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, Method, Prop } from '@stencil/core';
import { Component, ComponentInterface, Element, Event, EventEmitter, Method, Prop, h } from '@stencil/core';
import { Animation, AnimationBuilder, Color, Config, CssClassMap, Mode, OverlayEventDetail, OverlayInterface, ToastButton } from '../../interface';
import { getIonMode } from '../../global/ionic-global';
import { Animation, AnimationBuilder, Color, Config, CssClassMap, OverlayEventDetail, OverlayInterface, ToastButton } from '../../interface';
import { dismiss, eventMethod, isCancel, present } from '../../utils/overlays';
import { sanitizeDOMString } from '../../utils/sanitization';
import { createColorClasses, 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-toast',
styleUrls: {
@ -23,11 +27,11 @@ export class Toast implements ComponentInterface, OverlayInterface {
private durationTimeout: any;
presented = false;
animation?: Animation;
mode = getIonMode(this);
@Element() el!: HTMLElement;
animation: Animation | undefined;
@Prop({ context: 'config' }) config!: Config;
/**
@ -35,11 +39,6 @@ export class Toast implements ComponentInterface, OverlayInterface {
*/
@Prop() overlayIndex!: number;
/**
* The mode determines which platform styles to use.
*/
@Prop() mode!: Mode;
/**
* The color to use from your application's color palette.
* Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`.
@ -228,12 +227,13 @@ export class Toast implements ComponentInterface, OverlayInterface {
}
hostData() {
const mode = getIonMode(this);
return {
style: {
zIndex: 60000 + this.overlayIndex,
},
class: {
[`${this.mode}`]: true,
[`${mode}`]: true,
...createColorClasses(this.color),
...getClassMap(this.cssClass),
@ -247,6 +247,7 @@ export class Toast implements ComponentInterface, OverlayInterface {
return;
}
const mode = getIonMode(this);
const buttonGroupsClasses = {
'toast-button-group': true,
[`toast-button-group-${side}`]: true
@ -264,7 +265,7 @@ export class Toast implements ComponentInterface, OverlayInterface {
/>}
{b.text}
</div>
{this.mode === 'md' && <ion-ripple-effect type={b.icon !== undefined && b.text === undefined ? 'unbounded' : 'bounded'}></ion-ripple-effect>}
{mode === 'md' && <ion-ripple-effect type={b.icon !== undefined && b.text === undefined ? 'unbounded' : 'bounded'}></ion-ripple-effect>}
</button>
)}
</div>