Skip to content

Commit 5eeade7

Browse files
committed
fix(material/select): remove remaining animation dependencies
Removes the remaning dependencies on `@angular/animations` from the package.
1 parent 879cbe7 commit 5eeade7

File tree

3 files changed

+89
-40
lines changed

3 files changed

+89
-40
lines changed

src/material/select/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ ng_module(
3030
"//src/cdk/scrolling",
3131
"//src/material/core",
3232
"//src/material/form-field",
33-
"@npm//@angular/animations",
3433
"@npm//@angular/common",
3534
"@npm//@angular/core",
3635
"@npm//@angular/forms",

src/material/select/select-animations.ts

Lines changed: 87 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,6 @@
66
* found in the LICENSE file at https://angular.dev/license
77
*/
88

9-
import {
10-
animate,
11-
animateChild,
12-
AnimationTriggerMetadata,
13-
query,
14-
state,
15-
style,
16-
transition,
17-
trigger,
18-
} from '@angular/animations';
19-
209
/**
2110
* The following are all the animations for the mat-select component, with each
2211
* const containing the metadata for one animation.
@@ -31,37 +20,99 @@ export const matSelectAnimations: {
3120
* @deprecated No longer being used. To be removed.
3221
* @breaking-change 12.0.0
3322
*/
34-
readonly transformPanelWrap: AnimationTriggerMetadata;
35-
readonly transformPanel: AnimationTriggerMetadata;
23+
readonly transformPanelWrap: any;
24+
readonly transformPanel: any;
3625
} = {
26+
// Represents
27+
// trigger('transformPanelWrap', [
28+
// transition('* => void', query('@transformPanel', [animateChild()], {optional: true})),
29+
// ])
30+
3731
/**
3832
* This animation ensures the select's overlay panel animation (transformPanel) is called when
3933
* closing the select.
4034
* This is needed due to https://github.com/angular/angular/issues/23302
4135
*/
42-
transformPanelWrap: trigger('transformPanelWrap', [
43-
transition('* => void', query('@transformPanel', [animateChild()], {optional: true})),
44-
]),
36+
transformPanelWrap: {
37+
type: 7,
38+
name: 'transformPanelWrap',
39+
definitions: [
40+
{
41+
type: 1,
42+
expr: '* => void',
43+
animation: {
44+
type: 11,
45+
selector: '@transformPanel',
46+
animation: [{type: 9, options: null}],
47+
options: {optional: true},
48+
},
49+
options: null,
50+
},
51+
],
52+
options: {},
53+
},
54+
55+
// Represents
56+
// trigger('transformPanel', [
57+
// state(
58+
// 'void',
59+
// style({
60+
// opacity: 0,
61+
// transform: 'scale(1, 0.8)',
62+
// }),
63+
// ),
64+
// transition(
65+
// 'void => showing',
66+
// animate(
67+
// '120ms cubic-bezier(0, 0, 0.2, 1)',
68+
// style({
69+
// opacity: 1,
70+
// transform: 'scale(1, 1)',
71+
// }),
72+
// ),
73+
// ),
74+
// transition('* => void', animate('100ms linear', style({opacity: 0}))),
75+
// ])
4576

4677
/** This animation transforms the select's overlay panel on and off the page. */
47-
transformPanel: trigger('transformPanel', [
48-
state(
49-
'void',
50-
style({
51-
opacity: 0,
52-
transform: 'scale(1, 0.8)',
53-
}),
54-
),
55-
transition(
56-
'void => showing',
57-
animate(
58-
'120ms cubic-bezier(0, 0, 0.2, 1)',
59-
style({
60-
opacity: 1,
61-
transform: 'scale(1, 1)',
62-
}),
63-
),
64-
),
65-
transition('* => void', animate('100ms linear', style({opacity: 0}))),
66-
]),
78+
transformPanel: {
79+
type: 7,
80+
name: 'transformPanel',
81+
definitions: [
82+
{
83+
type: 0,
84+
name: 'void',
85+
styles: {
86+
type: 6,
87+
styles: {opacity: 0, transform: 'scale(1, 0.8)'},
88+
offset: null,
89+
},
90+
},
91+
{
92+
type: 1,
93+
expr: 'void => showing',
94+
animation: {
95+
type: 4,
96+
styles: {
97+
type: 6,
98+
styles: {opacity: 1, transform: 'scale(1, 1)'},
99+
offset: null,
100+
},
101+
timings: '120ms cubic-bezier(0, 0, 0.2, 1)',
102+
},
103+
options: null,
104+
},
105+
{
106+
type: 1,
107+
expr: '* => void',
108+
animation: {
109+
type: 4,
110+
styles: {type: 6, styles: {opacity: 0}, offset: null},
111+
timings: '100ms linear',
112+
},
113+
options: null,
114+
},
115+
],
116+
options: {},
117+
},
67118
};

tools/public_api_guard/material/select.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
import { ActiveDescendantKeyManager } from '@angular/cdk/a11y';
88
import { AfterContentInit } from '@angular/core';
9-
import { AnimationTriggerMetadata } from '@angular/animations';
109
import { CdkConnectedOverlay } from '@angular/cdk/overlay';
1110
import { CdkOverlayOrigin } from '@angular/cdk/overlay';
1211
import { ChangeDetectorRef } from '@angular/core';
@@ -219,8 +218,8 @@ export class MatSelect implements AfterContentInit, OnChanges, OnDestroy, OnInit
219218

220219
// @public @deprecated
221220
export const matSelectAnimations: {
222-
readonly transformPanelWrap: AnimationTriggerMetadata;
223-
readonly transformPanel: AnimationTriggerMetadata;
221+
readonly transformPanelWrap: any;
222+
readonly transformPanel: any;
224223
};
225224

226225
// @public

0 commit comments

Comments
 (0)