mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-11 18:09:21 +08:00
refactor(all): enable strictPropertyInitialization
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Component, Element, Event, EventEmitter, Listen, Method, Prop } from '@stencil/core';
|
||||
import { Animation, AnimationBuilder, Config, CssClassMap } from '../../index';
|
||||
import { Animation, AnimationBuilder, Config, CssClassMap, Mode } from '../../index';
|
||||
import { BACKDROP, OverlayEventDetail, OverlayInterface, dismiss, eventMethod, isCancel, present } from '../../utils/overlays';
|
||||
import { createThemedClasses, getClassMap } from '../../utils/theme';
|
||||
|
||||
@@ -21,37 +21,37 @@ import mdLeaveAnimation from './animations/md.leave';
|
||||
export class ActionSheet implements OverlayInterface {
|
||||
|
||||
presented = false;
|
||||
mode: string;
|
||||
color: string;
|
||||
animation: Animation|undefined;
|
||||
mode!: Mode;
|
||||
color!: string;
|
||||
animation?: Animation;
|
||||
|
||||
@Element() el: HTMLElement;
|
||||
@Element() el!: HTMLElement;
|
||||
|
||||
@Prop({ connect: 'ion-animation-controller' }) animationCtrl: HTMLIonAnimationControllerElement;
|
||||
@Prop({ context: 'config' }) config: Config;
|
||||
@Prop() overlayId: number;
|
||||
@Prop({ connect: 'ion-animation-controller' }) animationCtrl!: HTMLIonAnimationControllerElement;
|
||||
@Prop({ context: 'config' }) config!: Config;
|
||||
@Prop() overlayId!: number;
|
||||
@Prop() keyboardClose = true;
|
||||
|
||||
/**
|
||||
* Animation to use when the action sheet is presented.
|
||||
*/
|
||||
@Prop() enterAnimation: AnimationBuilder;
|
||||
@Prop() enterAnimation?: AnimationBuilder;
|
||||
|
||||
/**
|
||||
* Animation to use when the action sheet is dismissed.
|
||||
*/
|
||||
@Prop() leaveAnimation: AnimationBuilder;
|
||||
@Prop() leaveAnimation?: AnimationBuilder;
|
||||
|
||||
/**
|
||||
* An array of buttons for the action sheet.
|
||||
*/
|
||||
@Prop() buttons: ActionSheetButton[];
|
||||
@Prop() buttons!: ActionSheetButton[];
|
||||
|
||||
/**
|
||||
* Additional classes to apply for custom CSS. If multiple classes are
|
||||
* provided they should be separated by spaces.
|
||||
*/
|
||||
@Prop() cssClass: string | string[];
|
||||
@Prop() cssClass?: string | string[];
|
||||
|
||||
/**
|
||||
* If true, the action sheet will be dismissed when the backdrop is clicked. Defaults to `true`.
|
||||
@@ -61,12 +61,12 @@ export class ActionSheet implements OverlayInterface {
|
||||
/**
|
||||
* Title for the action sheet.
|
||||
*/
|
||||
@Prop() header: string;
|
||||
@Prop() header?: string;
|
||||
|
||||
/**
|
||||
* Subtitle for the action sheet.
|
||||
*/
|
||||
@Prop() subHeader: string;
|
||||
@Prop() subHeader?: string;
|
||||
|
||||
/**
|
||||
* If true, the action sheet will be translucent. Defaults to `false`.
|
||||
@@ -81,32 +81,32 @@ export class ActionSheet implements OverlayInterface {
|
||||
/**
|
||||
* Emitted after the alert has loaded.
|
||||
*/
|
||||
@Event() ionActionSheetDidLoad: EventEmitter;
|
||||
@Event() ionActionSheetDidLoad!: EventEmitter;
|
||||
|
||||
/**
|
||||
* Emitted after the alert has unloaded.
|
||||
*/
|
||||
@Event() ionActionSheetDidUnload: EventEmitter;
|
||||
@Event() ionActionSheetDidUnload!: EventEmitter;
|
||||
|
||||
/**
|
||||
* Emitted after the alert has presented.
|
||||
*/
|
||||
@Event({eventName: 'ionActionSheetDidPresent'}) didPresent: EventEmitter;
|
||||
@Event({eventName: 'ionActionSheetDidPresent'}) didPresent!: EventEmitter;
|
||||
|
||||
/**
|
||||
* Emitted before the alert has presented.
|
||||
*/
|
||||
@Event({eventName: 'ionActionSheetWillPresent'}) willPresent: EventEmitter;
|
||||
@Event({eventName: 'ionActionSheetWillPresent'}) willPresent!: EventEmitter;
|
||||
|
||||
/**
|
||||
* Emitted before the alert has dismissed.
|
||||
*/
|
||||
@Event({eventName: 'ionActionSheetWillDismiss'}) willDismiss: EventEmitter<OverlayEventDetail>;
|
||||
@Event({eventName: 'ionActionSheetWillDismiss'}) willDismiss!: EventEmitter<OverlayEventDetail>;
|
||||
|
||||
/**
|
||||
* Emitted after the alert has dismissed.
|
||||
*/
|
||||
@Event({eventName: 'ionActionSheetDidDismiss'}) didDismiss: EventEmitter<OverlayEventDetail>;
|
||||
@Event({eventName: 'ionActionSheetDidDismiss'}) didDismiss!: EventEmitter<OverlayEventDetail>;
|
||||
|
||||
|
||||
componentDidLoad() {
|
||||
@@ -288,7 +288,7 @@ export interface ActionSheetOptions {
|
||||
header?: string;
|
||||
subHeader?: string;
|
||||
cssClass?: string;
|
||||
buttons?: (ActionSheetButton | string)[];
|
||||
buttons: (ActionSheetButton | string)[];
|
||||
enableBackdropDismiss?: boolean;
|
||||
translucent?: boolean;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user