mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 03:00:58 +08:00
chore(api): internal updates required for stencil 2 upgrade (#21889)
Stencil 2 is removing deprecated APIs, and these are the remaining ones Ionic has been using.
This commit is contained in:
@ -198,7 +198,7 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUnload() {
|
disconnectedCallback() {
|
||||||
if (this.gesture) {
|
if (this.gesture) {
|
||||||
this.gesture.destroy();
|
this.gesture.destroy();
|
||||||
this.gesture = undefined;
|
this.gesture = undefined;
|
||||||
|
@ -177,7 +177,7 @@ export class Alert implements ComponentInterface, OverlayInterface {
|
|||||||
this.buttonsChanged();
|
this.buttonsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUnload() {
|
disconnectedCallback() {
|
||||||
if (this.gesture) {
|
if (this.gesture) {
|
||||||
this.gesture.destroy();
|
this.gesture.destroy();
|
||||||
this.gesture = undefined;
|
this.gesture = undefined;
|
||||||
|
@ -40,7 +40,7 @@ export class BackButton implements ComponentInterface, ButtonInterface {
|
|||||||
/**
|
/**
|
||||||
* If `true`, the user cannot interact with the button.
|
* If `true`, the user cannot interact with the button.
|
||||||
*/
|
*/
|
||||||
@Prop({ reflectToAttr: true }) disabled = false;
|
@Prop({ reflect: true }) disabled = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The icon name to use for the back button.
|
* The icon name to use for the back button.
|
||||||
|
@ -46,20 +46,20 @@ export class Button implements ComponentInterface, AnchorInterface, ButtonInterf
|
|||||||
/**
|
/**
|
||||||
* If `true`, the user cannot interact with the button.
|
* If `true`, the user cannot interact with the button.
|
||||||
*/
|
*/
|
||||||
@Prop({ reflectToAttr: true }) disabled = false;
|
@Prop({ reflect: true }) disabled = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to `"block"` for a full-width button or to `"full"` for a full-width button
|
* Set to `"block"` for a full-width button or to `"full"` for a full-width button
|
||||||
* without left and right borders.
|
* without left and right borders.
|
||||||
*/
|
*/
|
||||||
@Prop({ reflectToAttr: true }) expand?: 'full' | 'block';
|
@Prop({ reflect: true }) expand?: 'full' | 'block';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to `"clear"` for a transparent button, to `"outline"` for a transparent
|
* Set to `"clear"` for a transparent button, to `"outline"` for a transparent
|
||||||
* button with a border, or to `"solid"`. The default style is `"solid"` except inside of
|
* button with a border, or to `"solid"`. The default style is `"solid"` except inside of
|
||||||
* a toolbar, where the default is `"clear"`.
|
* a toolbar, where the default is `"clear"`.
|
||||||
*/
|
*/
|
||||||
@Prop({ reflectToAttr: true, mutable: true }) fill?: 'clear' | 'outline' | 'solid' | 'default';
|
@Prop({ reflect: true, mutable: true }) fill?: 'clear' | 'outline' | 'solid' | 'default';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When using a router, it specifies the transition direction when navigating to
|
* When using a router, it specifies the transition direction when navigating to
|
||||||
@ -96,12 +96,12 @@ export class Button implements ComponentInterface, AnchorInterface, ButtonInterf
|
|||||||
/**
|
/**
|
||||||
* The button shape.
|
* The button shape.
|
||||||
*/
|
*/
|
||||||
@Prop({ reflectToAttr: true }) shape?: 'round';
|
@Prop({ reflect: true }) shape?: 'round';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The button size.
|
* The button size.
|
||||||
*/
|
*/
|
||||||
@Prop({ reflectToAttr: true }) size?: 'small' | 'default' | 'large';
|
@Prop({ reflect: true }) size?: 'small' | 'default' | 'large';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If `true`, activates a button with a heavier font weight.
|
* If `true`, activates a button with a heavier font weight.
|
||||||
|
@ -49,7 +49,7 @@ export class Header implements ComponentInterface {
|
|||||||
await this.checkCollapsibleHeader();
|
await this.checkCollapsibleHeader();
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUnload() {
|
disconnectedCallback() {
|
||||||
this.destroyCollapsibleHeader();
|
this.destroyCollapsibleHeader();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,12 +48,12 @@ export class Menu implements ComponentInterface, MenuI {
|
|||||||
/**
|
/**
|
||||||
* The content's id the menu should use.
|
* The content's id the menu should use.
|
||||||
*/
|
*/
|
||||||
@Prop({ reflectToAttr: true }) contentId?: string;
|
@Prop({ reflect: true }) contentId?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An id for the menu.
|
* An id for the menu.
|
||||||
*/
|
*/
|
||||||
@Prop({ reflectToAttr: true }) menuId?: string;
|
@Prop({ reflect: true }) menuId?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The display type of the menu.
|
* The display type of the menu.
|
||||||
@ -96,7 +96,7 @@ export class Menu implements ComponentInterface, MenuI {
|
|||||||
/**
|
/**
|
||||||
* Which side of the view the menu should be placed.
|
* Which side of the view the menu should be placed.
|
||||||
*/
|
*/
|
||||||
@Prop({ reflectToAttr: true }) side: Side = 'start';
|
@Prop({ reflect: true }) side: Side = 'start';
|
||||||
|
|
||||||
@Watch('side')
|
@Watch('side')
|
||||||
protected sideChanged() {
|
protected sideChanged() {
|
||||||
|
@ -120,7 +120,7 @@ export class Nav implements NavOutlet {
|
|||||||
this.swipeGestureChanged();
|
this.swipeGestureChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUnload() {
|
disconnectedCallback() {
|
||||||
for (const view of this.views) {
|
for (const view of this.views) {
|
||||||
lifecycle(view.element!, LIFECYCLE_WILL_UNLOAD);
|
lifecycle(view.element!, LIFECYCLE_WILL_UNLOAD);
|
||||||
view._destroy();
|
view._destroy();
|
||||||
|
@ -13,7 +13,7 @@ import { SwiperInterface, SwiperOptions } from './swiper/swiper-interface';
|
|||||||
ios: 'slides.ios.scss',
|
ios: 'slides.ios.scss',
|
||||||
md: 'slides.md.scss'
|
md: 'slides.md.scss'
|
||||||
},
|
},
|
||||||
assetsDir: 'swiper',
|
assetsDirs: ['swiper'],
|
||||||
})
|
})
|
||||||
export class Slides implements ComponentInterface {
|
export class Slides implements ComponentInterface {
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ export class SplitPane implements ComponentInterface {
|
|||||||
/**
|
/**
|
||||||
* The content `id` of the split-pane's main content.
|
* The content `id` of the split-pane's main content.
|
||||||
*/
|
*/
|
||||||
@Prop({ reflectToAttr: true }) contentId?: string;
|
@Prop({ reflect: true }) contentId?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If `true`, the split pane will be hidden.
|
* If `true`, the split pane will be hidden.
|
||||||
|
@ -77,10 +77,15 @@ export class TabButton implements ComponentInterface, AnchorInterface {
|
|||||||
*/
|
*/
|
||||||
@Event() ionTabButtonClick!: EventEmitter<TabButtonClickEventDetail>;
|
@Event() ionTabButtonClick!: EventEmitter<TabButtonClickEventDetail>;
|
||||||
|
|
||||||
@Listen('ionTabBarChanged', { target: 'parent' })
|
@Listen('ionTabBarChanged', { target: 'window' })
|
||||||
onTabBarChanged(ev: CustomEvent<TabBarChangedEventDetail>) {
|
onTabBarChanged(ev: CustomEvent<TabBarChangedEventDetail>) {
|
||||||
|
const dispatchedFrom = ev.target as HTMLElement;
|
||||||
|
const parent = this.el.parentElement as EventTarget;
|
||||||
|
|
||||||
|
if ((ev.composedPath && ev.composedPath().includes(parent)) || dispatchedFrom && dispatchedFrom.contains(this.el)) {
|
||||||
this.selected = this.tab === ev.detail.tab;
|
this.selected = this.tab === ev.detail.tab;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
componentWillLoad() {
|
componentWillLoad() {
|
||||||
if (this.layout === undefined) {
|
if (this.layout === undefined) {
|
||||||
|
Reference in New Issue
Block a user