refactor(): minor updates for next stencil version (#20787)

This commit is contained in:
Manu MA
2020-03-24 16:59:07 +01:00
committed by GitHub
parent 7a4ddde5ce
commit 976e68da5b
38 changed files with 6889 additions and 6926 deletions

View File

@ -2,7 +2,6 @@ import { Animation, Side } from '../../interface';
export interface MenuI {
el: HTMLIonMenuElement;
mode: string;
side: Side;
menuId?: string;
disabled: boolean;

View File

@ -28,11 +28,6 @@ export class Menu implements ComponentInterface, MenuI {
private gesture?: Gesture;
private blocker = GESTURE_CONTROLLER.createBlocker({ disableScroll: true });
mode = getIonMode(this);
private easing: string = this.mode === 'ios' ? iosEasing : mdEasing;
private easingReverse: string = this.mode === 'ios' ? iosEasingReverse : mdEasingReverse;
isAnimating = false;
width!: number; // TODO
_isOpen = false;
@ -335,9 +330,12 @@ AFTER:
private async startAnimation(shouldOpen: boolean, animated: boolean): Promise<void> {
const isReversed = !shouldOpen;
const mode = getIonMode(this);
const easing = mode === 'ios' ? iosEasing : mdEasing;
const easingReverse = mode === 'ios' ? iosEasingReverse : mdEasingReverse;
const ani = (this.animation as Animation)!
.direction((isReversed) ? 'reverse' : 'normal')
.easing((isReversed) ? this.easingReverse : this.easing)
.easing((isReversed) ? easingReverse : easing)
.onFinish(() => {
if (ani.getDirection() === 'reverse') {
ani.direction('normal');
@ -554,7 +552,8 @@ AFTER:
}
render() {
const { isEndSide, type, disabled, mode, isPaneVisible } = this;
const { isEndSide, type, disabled, isPaneVisible } = this;
const mode = getIonMode(this);
return (
<Host