1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | import { trigger, state, style, animate, transition, } from '@angular/animations';
|
---|
9 | /**
|
---|
10 | * Animations used by the mat-menu component.
|
---|
11 | * Animation duration and timing values are based on:
|
---|
12 | * https://material.io/guidelines/components/menus.html#menus-usage
|
---|
13 | * @docs-private
|
---|
14 | */
|
---|
15 | export const matMenuAnimations = {
|
---|
16 | /**
|
---|
17 | * This animation controls the menu panel's entry and exit from the page.
|
---|
18 | *
|
---|
19 | * When the menu panel is added to the DOM, it scales in and fades in its border.
|
---|
20 | *
|
---|
21 | * When the menu panel is removed from the DOM, it simply fades out after a brief
|
---|
22 | * delay to display the ripple.
|
---|
23 | */
|
---|
24 | transformMenu: trigger('transformMenu', [
|
---|
25 | state('void', style({
|
---|
26 | opacity: 0,
|
---|
27 | transform: 'scale(0.8)'
|
---|
28 | })),
|
---|
29 | transition('void => enter', animate('120ms cubic-bezier(0, 0, 0.2, 1)', style({
|
---|
30 | opacity: 1,
|
---|
31 | transform: 'scale(1)'
|
---|
32 | }))),
|
---|
33 | transition('* => void', animate('100ms 25ms linear', style({ opacity: 0 })))
|
---|
34 | ]),
|
---|
35 | /**
|
---|
36 | * This animation fades in the background color and content of the menu panel
|
---|
37 | * after its containing element is scaled in.
|
---|
38 | */
|
---|
39 | fadeInItems: trigger('fadeInItems', [
|
---|
40 | // TODO(crisbeto): this is inside the `transformMenu`
|
---|
41 | // now. Remove next time we do breaking changes.
|
---|
42 | state('showing', style({ opacity: 1 })),
|
---|
43 | transition('void => *', [
|
---|
44 | style({ opacity: 0 }),
|
---|
45 | animate('400ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)')
|
---|
46 | ])
|
---|
47 | ])
|
---|
48 | };
|
---|
49 | /**
|
---|
50 | * @deprecated
|
---|
51 | * @breaking-change 8.0.0
|
---|
52 | * @docs-private
|
---|
53 | */
|
---|
54 | export const fadeInItems = matMenuAnimations.fadeInItems;
|
---|
55 | /**
|
---|
56 | * @deprecated
|
---|
57 | * @breaking-change 8.0.0
|
---|
58 | * @docs-private
|
---|
59 | */
|
---|
60 | export const transformMenu = matMenuAnimations.transformMenu;
|
---|
61 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVudS1hbmltYXRpb25zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL21hdGVyaWFsL21lbnUvbWVudS1hbmltYXRpb25zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRztBQUVILE9BQU0sRUFDSixPQUFPLEVBQ1AsS0FBSyxFQUNMLEtBQUssRUFDTCxPQUFPLEVBQ1AsVUFBVSxHQUVYLE1BQU0scUJBQXFCLENBQUM7QUFFN0I7Ozs7O0dBS0c7QUFDSCxNQUFNLENBQUMsTUFBTSxpQkFBaUIsR0FHMUI7SUFDRjs7Ozs7OztPQU9HO0lBQ0gsYUFBYSxFQUFFLE9BQU8sQ0FBQyxlQUFlLEVBQUU7UUFDdEMsS0FBSyxDQUFDLE1BQU0sRUFBRSxLQUFLLENBQUM7WUFDbEIsT0FBTyxFQUFFLENBQUM7WUFDVixTQUFTLEVBQUUsWUFBWTtTQUN4QixDQUFDLENBQUM7UUFDSCxVQUFVLENBQUMsZUFBZSxFQUFFLE9BQU8sQ0FBQyxrQ0FBa0MsRUFBRSxLQUFLLENBQUM7WUFDNUUsT0FBTyxFQUFFLENBQUM7WUFDVixTQUFTLEVBQUUsVUFBVTtTQUN0QixDQUFDLENBQUMsQ0FBQztRQUNKLFVBQVUsQ0FBQyxXQUFXLEVBQUUsT0FBTyxDQUFDLG1CQUFtQixFQUFFLEtBQUssQ0FBQyxFQUFDLE9BQU8sRUFBRSxDQUF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