fix(): update to Stencil One 🎉🎊

This commit is contained in:
Manu MA
2019-06-19 21:33:50 +02:00
committed by GitHub
parent 7f1829eb21
commit b40f7d36d5
572 changed files with 14426 additions and 9916 deletions

View File

@ -1,6 +1,7 @@
import { Component, ComponentInterface, Element, Event, EventEmitter, Listen, Method, Prop } from '@stencil/core';
import { Component, ComponentInterface, Element, Event, EventEmitter, Listen, Method, Prop, h } from '@stencil/core';
import { Animation, AnimationBuilder, Config, Mode, OverlayEventDetail, OverlayInterface, SpinnerTypes } from '../../interface';
import { getIonMode } from '../../global/ionic-global';
import { Animation, AnimationBuilder, Config, OverlayEventDetail, OverlayInterface, SpinnerTypes } from '../../interface';
import { BACKDROP, dismiss, eventMethod, present } from '../../utils/overlays';
import { sanitizeDOMString } from '../../utils/sanitization';
import { getClassMap } from '../../utils/theme';
@ -10,6 +11,9 @@ import { iosLeaveAnimation } from './animations/ios.leave';
import { mdEnterAnimation } from './animations/md.enter';
import { mdLeaveAnimation } from './animations/md.leave';
/**
* @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use.
*/
@Component({
tag: 'ion-loading',
styleUrls: {
@ -23,6 +27,7 @@ export class Loading implements ComponentInterface, OverlayInterface {
presented = false;
animation?: Animation;
mode = getIonMode(this);
@Element() el!: HTMLElement;
@ -31,11 +36,6 @@ export class Loading implements ComponentInterface, OverlayInterface {
/** @internal */
@Prop() overlayIndex!: number;
/**
* The mode determines which platform styles to use.
*/
@Prop() mode!: Mode;
/**
* If `true`, the keyboard will be automatically dismissed when the overlay is presented.
*/
@ -114,9 +114,10 @@ export class Loading implements ComponentInterface, OverlayInterface {
componentWillLoad() {
if (this.spinner === undefined) {
const mode = getIonMode(this);
this.spinner = this.config.get(
'loadingSpinner',
this.config.get('spinner', this.mode === 'ios' ? 'lines' : 'crescent')
this.config.get('spinner', mode === 'ios' ? 'lines' : 'crescent')
);
}
}
@ -175,13 +176,14 @@ export class Loading implements ComponentInterface, OverlayInterface {
}
hostData() {
const mode = getIonMode(this);
return {
style: {
zIndex: 40000 + this.overlayIndex
},
class: {
...getClassMap(this.cssClass),
[`${this.mode}`]: true,
[`${mode}`]: true,
'loading-translucent': this.translucent
}
};