-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(animations): added collapse animation and used in steps and expa…
…nsion (#186) * add TdCollapseAnimation to use in stepper and expansion * add TdCollapseAnimation function in platform/core index.ts * replace [tdToggle] for [@tdCollapse] in expansion-panel * replace [tdToggle] for [@tdCollapse] in stepper * bugfix with animation overflow in FF50 * added display on animation to none and * for a11y
- Loading branch information
1 parent
8d2d084
commit fe01822
Showing
8 changed files
with
56 additions
and
4 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,28 @@ | ||
import { trigger, state, style, transition, animate, AnimationEntryMetadata } from '@angular/core'; | ||
|
||
/** | ||
* Function TdCollapseAnimation | ||
* | ||
* params: | ||
* * duration: Duration of animation in miliseconds. Defaults to 150 ms. | ||
* | ||
* Returns an [AnimationEntryMetadata] object with states for a collapse/expand animation. | ||
* | ||
* usage: [@tdCollapse]="true|false" | ||
*/ | ||
export function TdCollapseAnimation(duration: number = 150): AnimationEntryMetadata { | ||
return trigger('tdCollapse', [ | ||
state('true', style({ | ||
height: '0', | ||
overflow: 'hidden', | ||
display: 'none', | ||
})), | ||
state('false', style({ | ||
height: '*', | ||
overflow: 'hidden', | ||
display: '*', | ||
})), | ||
transition('0 => 1', animate(duration + 'ms ease-in')), | ||
transition('1 => 0', animate(duration + 'ms ease-out')), | ||
]); | ||
} |
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
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