forked from angular/components
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(datepicker): add animation to calendar popup
Adds an animation when opening and closing the datepicker's calendar. This is a resubmit of angular#8542.
- Loading branch information
Showing
6 changed files
with
150 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
import { | ||
animate, | ||
state, | ||
style, | ||
transition, | ||
trigger, | ||
AnimationTriggerMetadata, | ||
} from '@angular/animations'; | ||
|
||
/** Animations used by the Material datepicker. */ | ||
export const matDatepickerAnimations: { | ||
readonly transformPanel: AnimationTriggerMetadata; | ||
readonly fadeInCalendar: AnimationTriggerMetadata; | ||
} = { | ||
/** Transforms the height of the datepicker's calendar. */ | ||
transformPanel: trigger('transformPanel', [ | ||
state('void', style({opacity: 0, transform: 'scale(1, 0)'})), | ||
state('enter', style({opacity: 1, transform: 'scale(1, 1)'})), | ||
transition('void => enter', animate('400ms cubic-bezier(0.25, 0.8, 0.25, 1)')), | ||
transition('* => void', animate('100ms linear', style({opacity: 0}))) | ||
]), | ||
|
||
/** Fades in the content of the calendar. */ | ||
fadeInCalendar: trigger('fadeInCalendar', [ | ||
state('void', style({opacity: 0})), | ||
state('enter', style({opacity: 1})), | ||
transition('void => *', animate('400ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)')) | ||
]) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters