mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-08 23:58:13 +08:00
lint(eslint): migrate to eslint and prettier (#25046)
This commit is contained in:
@ -1,10 +1,18 @@
|
||||
import { Component, ComponentInterface, Element, Event, EventEmitter, Host, Method, Prop, h } from '@stencil/core';
|
||||
import type { ComponentInterface, EventEmitter } from '@stencil/core';
|
||||
import { Component, Element, Event, Host, Method, Prop, h } from '@stencil/core';
|
||||
|
||||
import { config } from '../../global/config';
|
||||
import { getIonMode } from '../../global/ionic-global';
|
||||
import { AnimationBuilder, LoadingAttributes, OverlayEventDetail, OverlayInterface, SpinnerTypes } from '../../interface';
|
||||
import type {
|
||||
AnimationBuilder,
|
||||
LoadingAttributes,
|
||||
OverlayEventDetail,
|
||||
OverlayInterface,
|
||||
SpinnerTypes,
|
||||
} from '../../interface';
|
||||
import { BACKDROP, dismiss, eventMethod, prepareOverlay, present } from '../../utils/overlays';
|
||||
import { IonicSafeString, sanitizeDOMString } from '../../utils/sanitization';
|
||||
import type { IonicSafeString } from '../../utils/sanitization';
|
||||
import { sanitizeDOMString } from '../../utils/sanitization';
|
||||
import { getClassMap } from '../../utils/theme';
|
||||
|
||||
import { iosEnterAnimation } from './animations/ios.enter';
|
||||
@ -19,9 +27,9 @@ import { mdLeaveAnimation } from './animations/md.leave';
|
||||
tag: 'ion-loading',
|
||||
styleUrls: {
|
||||
ios: 'loading.ios.scss',
|
||||
md: 'loading.md.scss'
|
||||
md: 'loading.md.scss',
|
||||
},
|
||||
scoped: true
|
||||
scoped: true,
|
||||
})
|
||||
export class Loading implements ComponentInterface, OverlayInterface {
|
||||
private durationTimeout: any;
|
||||
@ -124,10 +132,7 @@ export class Loading implements ComponentInterface, OverlayInterface {
|
||||
componentWillLoad() {
|
||||
if (this.spinner === undefined) {
|
||||
const mode = getIonMode(this);
|
||||
this.spinner = config.get(
|
||||
'loadingSpinner',
|
||||
config.get('spinner', mode === 'ios' ? 'lines' : 'crescent')
|
||||
);
|
||||
this.spinner = config.get('loadingSpinner', config.get('spinner', mode === 'ios' ? 'lines' : 'crescent'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -139,10 +144,7 @@ export class Loading implements ComponentInterface, OverlayInterface {
|
||||
await present(this, 'loadingEnter', iosEnterAnimation, mdEnterAnimation, undefined);
|
||||
|
||||
if (this.duration > 0) {
|
||||
this.durationTimeout = setTimeout(
|
||||
() => this.dismiss(),
|
||||
this.duration + 10
|
||||
);
|
||||
this.durationTimeout = setTimeout(() => this.dismiss(), this.duration + 10);
|
||||
}
|
||||
}
|
||||
|
||||
@ -181,7 +183,7 @@ export class Loading implements ComponentInterface, OverlayInterface {
|
||||
|
||||
private onBackdropTap = () => {
|
||||
this.dismiss(undefined, BACKDROP);
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { message, spinner, htmlAttributes } = this;
|
||||
@ -189,16 +191,16 @@ export class Loading implements ComponentInterface, OverlayInterface {
|
||||
return (
|
||||
<Host
|
||||
tabindex="-1"
|
||||
{...htmlAttributes as any}
|
||||
{...(htmlAttributes as any)}
|
||||
style={{
|
||||
zIndex: `${40000 + this.overlayIndex}`
|
||||
zIndex: `${40000 + this.overlayIndex}`,
|
||||
}}
|
||||
onIonBackdropTap={this.onBackdropTap}
|
||||
class={{
|
||||
...getClassMap(this.cssClass),
|
||||
[mode]: true,
|
||||
'overlay-hidden': true,
|
||||
'loading-translucent': this.translucent
|
||||
'loading-translucent': this.translucent,
|
||||
}}
|
||||
>
|
||||
<ion-backdrop visible={this.showBackdrop} tappable={this.backdropDismiss} />
|
||||
|
||||
Reference in New Issue
Block a user