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, ComponentProps, ComponentRef, Config, FrameworkDelegate, Mode, OverlayEventDetail, OverlayInterface } from '../../interface';
import { getIonMode } from '../../global/ionic-global';
import { Animation, AnimationBuilder, ComponentProps, ComponentRef, Config, FrameworkDelegate, OverlayEventDetail, OverlayInterface } from '../../interface';
import { attachComponent, detachComponent } from '../../utils/framework-delegate';
import { BACKDROP, dismiss, eventMethod, present } from '../../utils/overlays';
import { getClassMap } from '../../utils/theme';
@ -11,6 +12,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-modal',
styleUrls: {
@ -25,6 +29,7 @@ export class Modal implements ComponentInterface, OverlayInterface {
presented = false;
animation: Animation | undefined;
mode = getIonMode(this);
@Element() el!: HTMLElement;
@ -36,11 +41,6 @@ export class Modal implements ComponentInterface, OverlayInterface {
/** @internal */
@Prop() delegate?: FrameworkDelegate;
/**
* The mode determines which platform styles to use.
*/
@Prop() mode!: Mode;
/**
* If `true`, the keyboard will be automatically dismissed when the overlay is presented.
*/
@ -190,11 +190,12 @@ export class Modal implements ComponentInterface, OverlayInterface {
}
hostData() {
const mode = getIonMode(this);
return {
'no-router': true,
'aria-modal': 'true',
class: {
[`${this.mode}`]: true,
[`${mode}`]: true,
...getClassMap(this.cssClass)
},
style: {
@ -204,9 +205,10 @@ export class Modal implements ComponentInterface, OverlayInterface {
}
render() {
const mode = getIonMode(this);
const dialogClasses = {
[`modal-wrapper`]: true,
[`${this.mode}`]: true,
[`${mode}`]: true,
};
return [