-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 (#5173)
- Loading branch information
Showing
14 changed files
with
164 additions
and
28 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
16 changes: 16 additions & 0 deletions
16
demo/src/app/components/+datepicker/demos/animated/animated.html
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,16 @@ | ||
<div class="row"> | ||
<div class="col-xs-12 col-12 col-md-4 form-group"> | ||
<input type="text" | ||
placeholder="Datepicker" | ||
class="form-control" | ||
bsDatepicker | ||
[bsConfig]="{ isAnimated: true }"> | ||
</div> | ||
<div class="col-xs-12 col-12 col-md-4 form-group"> | ||
<input type="text" | ||
placeholder="Daterangepicker" | ||
class="form-control" | ||
bsDaterangepicker | ||
[bsConfig]="{ isAnimated: true }"> | ||
</div> | ||
</div> |
7 changes: 7 additions & 0 deletions
7
demo/src/app/components/+datepicker/demos/animated/animated.ts
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,7 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'demo-datepicker-animated', | ||
templateUrl: './animated.html' | ||
}) | ||
export class DemoDatePickerAnimatedComponent {} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; | ||
|
||
// RECOMMENDED | ||
import { BsDatepickerModule } from 'ngx-bootstrap/datepicker'; | ||
// or | ||
import { BsDatepickerModule } from 'ngx-bootstrap'; | ||
|
||
@NgModule({ | ||
imports: [BsDatepickerModule.forRoot(),...] | ||
imports: [ | ||
BrowserAnimationsModule, | ||
BsDatepickerModule.forRoot(), | ||
... | ||
] | ||
}) | ||
export class AppModule(){} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { | ||
animate, | ||
style, | ||
AnimationTriggerMetadata, | ||
state, | ||
transition, | ||
trigger | ||
} from '@angular/animations'; | ||
|
||
export const DATEPICKER_ANIMATION_TIMING = '220ms cubic-bezier(0, 0, 0.2, 1)'; | ||
|
||
export const datepickerAnimation: AnimationTriggerMetadata = | ||
trigger('datepickerAnimation', [ | ||
state('animated-down', style({ height: '*', overflow: 'hidden'})), | ||
transition('* => animated-down', [ | ||
style({ height: 0, overflow: 'hidden' }), | ||
animate(DATEPICKER_ANIMATION_TIMING) | ||
]), | ||
state('animated-up', style({ height: '*', overflow: 'hidden'})), | ||
transition('* => animated-up', [ | ||
style({ height: '*', overflow: 'hidden' }), | ||
animate(DATEPICKER_ANIMATION_TIMING) | ||
]), | ||
transition('* => unanimated', animate('0s')) | ||
]); |
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
Oops, something went wrong.