feat(modal): add bottom sheet functionality (#23828)

resolves #21039
This commit is contained in:
Liam DeBeasi
2021-08-31 15:19:19 -04:00
committed by GitHub
parent c925274c3b
commit 12216d378d
24 changed files with 1338 additions and 114 deletions

View File

@ -409,11 +409,31 @@ export const createAnimation = (animationId?: string): Animation => {
};
const keyframes = (keyframeValues: AnimationKeyFrames) => {
const different = _keyframes !== keyframeValues;
_keyframes = keyframeValues;
if (different) {
updateKeyframes(_keyframes);
}
return ani;
};
const updateKeyframes = (keyframeValues: AnimationKeyFrames) => {
if (supportsWebAnimations) {
getWebAnimations().forEach(animation => {
if (animation.effect.setKeyframes) {
animation.effect.setKeyframes(keyframeValues);
} else {
const newEffect = new KeyframeEffect(animation.effect.target, keyframeValues, animation.effect.getTiming());
animation.effect = newEffect;
}
});
} else {
initializeCSSAnimation();
}
};
/**
* Run all "before" animation hooks.
*/
@ -668,9 +688,8 @@ export const createAnimation = (animationId?: string): Animation => {
if (!initialized) {
initializeAnimation();
} else {
update(false, true, step);
}
update(false, true, step);
return ani;
};