Skip to content

Commit 37693e3

Browse files
committed
fix(material/form-field): remove remaining animation dependencies
Removes the remaning dependencies on `@angular/animations` from the package.
1 parent e164e23 commit 37693e3

File tree

2 files changed

+37
-19
lines changed

2 files changed

+37
-19
lines changed

src/material/form-field/form-field-animations.ts

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@
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-
} from '@angular/animations';
168

179
/**
1810
* Animations used by the MatFormField.
@@ -21,15 +13,42 @@ import {
2113
* @breaking-change 21.0.0
2214
*/
2315
export const matFormFieldAnimations: {
24-
readonly transitionMessages: AnimationTriggerMetadata;
16+
readonly transitionMessages: any;
2517
} = {
18+
// Represents:
19+
// trigger('transitionMessages', [
20+
// // TODO(mmalerba): Use angular animations for label animation as well.
21+
// state('enter', style({opacity: 1, transform: 'translateY(0%)'})),
22+
// transition('void => enter', [
23+
// style({opacity: 0, transform: 'translateY(-5px)'}),
24+
// animate('300ms cubic-bezier(0.55, 0, 0.55, 0.2)'),
25+
// ]),
26+
// ])
27+
2628
/** Animation that transitions the form field's error and hint messages. */
27-
transitionMessages: trigger('transitionMessages', [
28-
// TODO(mmalerba): Use angular animations for label animation as well.
29-
state('enter', style({opacity: 1, transform: 'translateY(0%)'})),
30-
transition('void => enter', [
31-
style({opacity: 0, transform: 'translateY(-5px)'}),
32-
animate('300ms cubic-bezier(0.55, 0, 0.55, 0.2)'),
33-
]),
34-
]),
29+
transitionMessages: {
30+
type: 7,
31+
name: 'transitionMessages',
32+
definitions: [
33+
{
34+
type: 0,
35+
name: 'enter',
36+
styles: {
37+
type: 6,
38+
styles: {opacity: 1, transform: 'translateY(0%)'},
39+
offset: null,
40+
},
41+
},
42+
{
43+
type: 1,
44+
expr: 'void => enter',
45+
animation: [
46+
{type: 6, styles: {opacity: 0, transform: 'translateY(-5px)'}, offset: null},
47+
{type: 4, styles: null, timings: '300ms cubic-bezier(0.55, 0, 0.55, 0.2)'},
48+
],
49+
options: null,
50+
},
51+
],
52+
options: {},
53+
},
3554
};

tools/public_api_guard/material/form-field.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { AbstractControlDirective } from '@angular/forms';
88
import { AfterContentChecked } from '@angular/core';
99
import { AfterContentInit } from '@angular/core';
1010
import { AfterViewInit } from '@angular/core';
11-
import { AnimationTriggerMetadata } from '@angular/animations';
1211
import { BooleanInput } from '@angular/cdk/coercion';
1312
import { ElementRef } from '@angular/core';
1413
import * as i0 from '@angular/core';
@@ -149,7 +148,7 @@ export class MatFormField implements FloatingLabelParent, AfterContentInit, Afte
149148

150149
// @public @deprecated
151150
export const matFormFieldAnimations: {
152-
readonly transitionMessages: AnimationTriggerMetadata;
151+
readonly transitionMessages: any;
153152
};
154153

155154
// @public

0 commit comments

Comments
 (0)