Skip to content

Commit 5423dd2

Browse files
committedFeb 3, 2025
fix(material/bottom-sheet): remove remaining animation dependencies
Removes the remaning dependencies on `@angular/animations` from the package.
1 parent 7b17243 commit 5423dd2

File tree

3 files changed

+75
-33
lines changed

3 files changed

+75
-33
lines changed
 

‎src/material/bottom-sheet/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ ng_module(
3232
"//src/cdk/platform",
3333
"//src/cdk/portal",
3434
"//src/material/core",
35-
"@npm//@angular/animations",
3635
"@npm//@angular/core",
3736
"@npm//rxjs",
3837
],

‎src/material/bottom-sheet/bottom-sheet-animations.ts

+74-30
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,87 @@
55
* Use of this source code is governed by an MIT-style license that can be
66
* found in the LICENSE file at https://angular.dev/license
77
*/
8-
import {
9-
animate,
10-
state,
11-
style,
12-
transition,
13-
trigger,
14-
AnimationTriggerMetadata,
15-
group,
16-
query,
17-
animateChild,
18-
} from '@angular/animations';
198

209
/**
2110
* Animations used by the Material bottom sheet.
2211
* @deprecated No longer used. Will be removed.
2312
* @breaking-change 21.0.0
2413
*/
2514
export const matBottomSheetAnimations: {
26-
readonly bottomSheetState: AnimationTriggerMetadata;
15+
readonly bottomSheetState: any;
2716
} = {
17+
// Represents the output of:
18+
// trigger('state', [
19+
// state('void, hidden', style({transform: 'translateY(100%)'})),
20+
// state('visible', style({transform: 'translateY(0%)'})),
21+
// transition(
22+
// 'visible => void, visible => hidden',
23+
// group([
24+
// animate('375ms cubic-bezier(0.4, 0, 1, 1)'),
25+
// query('@*', animateChild(), {optional: true}),
26+
// ]),
27+
// ),
28+
// transition(
29+
// 'void => visible',
30+
// group([
31+
// animate('195ms cubic-bezier(0, 0, 0.2, 1)'),
32+
// query('@*', animateChild(), {optional: true}),
33+
// ]),
34+
// ),
35+
// ])
36+
2837
/** Animation that shows and hides a bottom sheet. */
29-
bottomSheetState: trigger('state', [
30-
state('void, hidden', style({transform: 'translateY(100%)'})),
31-
state('visible', style({transform: 'translateY(0%)'})),
32-
transition(
33-
'visible => void, visible => hidden',
34-
group([
35-
animate('375ms cubic-bezier(0.4, 0, 1, 1)'),
36-
query('@*', animateChild(), {optional: true}),
37-
]),
38-
),
39-
transition(
40-
'void => visible',
41-
group([
42-
animate('195ms cubic-bezier(0, 0, 0.2, 1)'),
43-
query('@*', animateChild(), {optional: true}),
44-
]),
45-
),
46-
]),
38+
bottomSheetState: {
39+
type: 7,
40+
name: 'state',
41+
definitions: [
42+
{
43+
type: 0,
44+
name: 'void, hidden',
45+
styles: {type: 6, styles: {transform: 'translateY(100%)'}, offset: null},
46+
},
47+
{
48+
type: 0,
49+
name: 'visible',
50+
styles: {type: 6, styles: {transform: 'translateY(0%)'}, offset: null},
51+
},
52+
{
53+
type: 1,
54+
expr: 'visible => void, visible => hidden',
55+
animation: {
56+
type: 3,
57+
steps: [
58+
{type: 4, styles: null, timings: '375ms cubic-bezier(0.4, 0, 1, 1)'},
59+
{
60+
type: 11,
61+
selector: '@*',
62+
animation: {type: 9, options: null},
63+
options: {optional: true},
64+
},
65+
],
66+
options: null,
67+
},
68+
options: null,
69+
},
70+
{
71+
type: 1,
72+
expr: 'void => visible',
73+
animation: {
74+
type: 3,
75+
steps: [
76+
{type: 4, styles: null, timings: '195ms cubic-bezier(0, 0, 0.2, 1)'},
77+
{
78+
type: 11,
79+
selector: '@*',
80+
animation: {type: 9, options: null},
81+
options: {optional: true},
82+
},
83+
],
84+
options: null,
85+
},
86+
options: null,
87+
},
88+
],
89+
options: {},
90+
},
4791
};

‎tools/public_api_guard/material/bottom-sheet.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
55
```ts
66

7-
import { AnimationTriggerMetadata } from '@angular/animations';
87
import { CdkDialogContainer } from '@angular/cdk/dialog';
98
import { ComponentRef } from '@angular/core';
109
import { ComponentType } from '@angular/cdk/portal';
@@ -49,7 +48,7 @@ export class MatBottomSheet implements OnDestroy {
4948

5049
// @public @deprecated
5150
export const matBottomSheetAnimations: {
52-
readonly bottomSheetState: AnimationTriggerMetadata;
51+
readonly bottomSheetState: any;
5352
};
5453

5554
// @public

0 commit comments

Comments
 (0)
Please sign in to comment.