chore(): update to latest stencil

This commit is contained in:
Manu Mtz.-Almeida
2018-08-22 23:37:32 +02:00
parent 11edc49dfe
commit 3d6caae13f
34 changed files with 248 additions and 225 deletions

View File

@@ -1,4 +1,4 @@
import { Animation, Menu } from '../../../interface';
import { Animation, MenuI } from '../../../interface';
import { baseAnimation } from './base';
@@ -9,7 +9,7 @@ const BOX_SHADOW_WIDTH = 8;
* The menu slides over the content. The content
* itself, which is under the menu, does not move.
*/
export function menuOverlayAnimation(AnimationC: Animation, _: HTMLElement, menu: Menu): Promise<Animation> {
export function menuOverlayAnimation(AnimationC: Animation, _: HTMLElement, menu: MenuI): Promise<Animation> {
let closedX: string;
let openedX: string;
const width = menu.width + BOX_SHADOW_WIDTH;

View File

@@ -1,4 +1,4 @@
import { Animation, Menu } from '../../../interface';
import { Animation, MenuI } from '../../../interface';
import { baseAnimation } from './base';
@@ -8,7 +8,7 @@ import { baseAnimation } from './base';
* The content slides over to reveal the menu underneath.
* The menu itself also slides over to reveal its bad self.
*/
export function menuPushAnimation(AnimationC: Animation, _: HTMLElement, menu: Menu): Promise<Animation> {
export function menuPushAnimation(AnimationC: Animation, _: HTMLElement, menu: MenuI): Promise<Animation> {
let contentOpenedX: string;
let menuClosedX: string;

View File

@@ -1,4 +1,4 @@
import { Animation, Menu } from '../../../interface';
import { Animation, MenuI } from '../../../interface';
import { baseAnimation } from './base';
@@ -8,7 +8,7 @@ import { baseAnimation } from './base';
* The content slides over to reveal the menu underneath.
* The menu itself, which is under the content, does not move.
*/
export function menuRevealAnimation(AnimationC: Animation, _: HTMLElement, menu: Menu): Promise<Animation> {
export function menuRevealAnimation(AnimationC: Animation, _: HTMLElement, menu: MenuI): Promise<Animation> {
const openedX = (menu.width * (menu.isEndSide ? -1 : 1)) + 'px';
const contentOpen = new AnimationC()

View File

@@ -1,6 +1,6 @@
import { Build, Component, Method, Prop } from '@stencil/core';
import { Animation, AnimationBuilder, Menu } from '../../interface';
import { Animation, AnimationBuilder, MenuI } from '../../interface';
import { menuOverlayAnimation } from './animations/overlay';
import { menuPushAnimation } from './animations/push';
@@ -11,7 +11,7 @@ import { menuRevealAnimation } from './animations/reveal';
styleUrl: 'menu-controller.scss'
})
export class MenuController {
private menus: Menu[] = [];
private menus: MenuI[] = [];
private menuAnimations = new Map<string, AnimationBuilder>();
@Prop({ connect: 'ion-animation-controller' }) animationCtrl!: HTMLIonAnimationControllerElement;
@@ -183,14 +183,14 @@ export class MenuController {
}
@Method()
_register(menu: Menu) {
_register(menu: MenuI) {
if (this.menus.indexOf(menu) < 0) {
this.menus.push(menu);
}
}
@Method()
_unregister(menu: Menu) {
_unregister(menu: MenuI) {
const index = this.menus.indexOf(menu);
if (index > -1) {
this.menus.splice(index, 1);
@@ -198,7 +198,7 @@ export class MenuController {
}
@Method()
_setActiveMenu(menu: Menu) {
_setActiveMenu(menu: MenuI) {
// if this menu should be enabled
// then find all the other menus on this same side
// and automatically disable other same side menus
@@ -209,7 +209,7 @@ export class MenuController {
}
@Method()
_setOpen(menu: Menu, shouldOpen: boolean, animated: boolean): Promise<boolean> {
_setOpen(menu: MenuI, shouldOpen: boolean, animated: boolean): Promise<boolean> {
if (this.isAnimating()) {
return Promise.resolve(false);
}
@@ -223,7 +223,7 @@ export class MenuController {
}
@Method()
createAnimation(type: string, menuCmp: Menu): Promise<Animation> {
createAnimation(type: string, menuCmp: MenuI): Promise<Animation> {
const animationBuilder = this.menuAnimations.get(type);
if (!animationBuilder) {
return Promise.reject('animation not registered');
@@ -236,7 +236,7 @@ export class MenuController {
this.menuAnimations.set(name, animation);
}
private find(predicate: (menu: Menu) => boolean): HTMLIonMenuElement | null {
private find(predicate: (menu: MenuI) => boolean): HTMLIonMenuElement | null {
const instance = this.menus.find(predicate);
if (instance) {
return instance.el;