mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 19:57:22 +08:00
chore(): update components.d.ts
This commit is contained in:
6
core/src/components.d.ts
vendored
6
core/src/components.d.ts
vendored
@ -116,6 +116,9 @@ import {
|
||||
import {
|
||||
SelectPopoverOption,
|
||||
} from './components/select-popover/select-popover';
|
||||
import {
|
||||
FrameworkDelegate as FrameworkDelegate3,
|
||||
} from './utils/framework-delegate';
|
||||
import {
|
||||
DomRenderFn,
|
||||
HeaderFn,
|
||||
@ -3052,6 +3055,7 @@ declare global {
|
||||
* Programatically open the Menu.
|
||||
*/
|
||||
'open': (menuId?: string) => Promise<boolean>;
|
||||
'registerAnimation': (name: string, animation: AnimationBuilder) => void;
|
||||
/**
|
||||
* Used to enable or disable the ability to swipe open the menu.
|
||||
*/
|
||||
@ -5753,6 +5757,7 @@ declare global {
|
||||
* The component to display inside of the tab.
|
||||
*/
|
||||
'component': any;
|
||||
'delegate': FrameworkDelegate;
|
||||
/**
|
||||
* If true, the user cannot interact with the tab. Defaults to `false`.
|
||||
*/
|
||||
@ -5819,6 +5824,7 @@ declare global {
|
||||
* The component to display inside of the tab.
|
||||
*/
|
||||
'component'?: any;
|
||||
'delegate'?: FrameworkDelegate;
|
||||
/**
|
||||
* If true, the user cannot interact with the tab. Defaults to `false`.
|
||||
*/
|
||||
|
@ -66,6 +66,9 @@ property. If a menu is not found then it'll return `null`.
|
||||
Programatically open the Menu.
|
||||
|
||||
|
||||
#### registerAnimation()
|
||||
|
||||
|
||||
#### swipeEnable()
|
||||
|
||||
Used to enable or disable the ability to swipe open the menu.
|
||||
|
@ -9,8 +9,8 @@
|
||||
</head>
|
||||
|
||||
<body onload="initialize()">
|
||||
<ion-platform></ion-platform>
|
||||
<ion-app>
|
||||
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-title>Platform - basic</ion-title>
|
||||
@ -28,14 +28,10 @@
|
||||
|
||||
<h2>The ready event has fired: <span class="ready"></span></h2>
|
||||
</ion-content>
|
||||
|
||||
|
||||
</ion-app>
|
||||
|
||||
<script>
|
||||
async function initialize() {
|
||||
const app = document.querySelector('ion-app');
|
||||
await app.componentOnReady();
|
||||
const platform = document.querySelector('ion-platform');
|
||||
await platform.componentOnReady();
|
||||
|
||||
|
@ -24,6 +24,7 @@ import { SelectPopoverOption } from '../select-popover/select-popover';
|
||||
}
|
||||
})
|
||||
export class Select {
|
||||
|
||||
private childOpts: HTMLIonSelectOptionElement[] = [];
|
||||
private selectId: string;
|
||||
private labelId: string;
|
||||
@ -272,7 +273,7 @@ export class Select {
|
||||
this.emitStyle();
|
||||
}
|
||||
|
||||
getLabel() {
|
||||
private getLabel() {
|
||||
const item = this.el.closest('ion-item');
|
||||
if (item) {
|
||||
return item.querySelector('ion-label');
|
||||
@ -280,7 +281,7 @@ export class Select {
|
||||
return null;
|
||||
}
|
||||
|
||||
open(ev: UIEvent) {
|
||||
private open(ev: UIEvent) {
|
||||
let selectInterface = this.interface;
|
||||
|
||||
if ((selectInterface === 'action-sheet' || selectInterface === 'popover') && this.multiple) {
|
||||
@ -304,7 +305,7 @@ export class Select {
|
||||
return this.openAlert();
|
||||
}
|
||||
|
||||
openPopover(ev: UIEvent) {
|
||||
private async openPopover(ev: UIEvent) {
|
||||
const interfaceOptions = {...this.interfaceOptions};
|
||||
|
||||
const popoverOpts: PopoverOptions = Object.assign(interfaceOptions, {
|
||||
@ -331,19 +332,13 @@ export class Select {
|
||||
ev: ev
|
||||
});
|
||||
|
||||
const popover = this.popoverCtrl.create(popoverOpts);
|
||||
|
||||
return popover.then(overlay => {
|
||||
this.overlay = overlay;
|
||||
|
||||
return overlay.present().then(() => {
|
||||
const popover = this.overlay = await this.popoverCtrl.create(popoverOpts);
|
||||
await popover.present();
|
||||
this.isExpanded = true;
|
||||
return overlay;
|
||||
});
|
||||
});
|
||||
return popover;
|
||||
}
|
||||
|
||||
openActionSheet() {
|
||||
private async openActionSheet() {
|
||||
const interfaceOptions = {...this.interfaceOptions};
|
||||
|
||||
const actionSheetButtons = this.childOpts.map(option => {
|
||||
@ -369,17 +364,14 @@ export class Select {
|
||||
cssClass: 'select-action-sheet' + (interfaceOptions.cssClass ? ' ' + interfaceOptions.cssClass : '')
|
||||
});
|
||||
|
||||
const actionSheet = this.actionSheetCtrl.create(actionSheetOpts);
|
||||
return actionSheet.then(overlay => {
|
||||
this.overlay = overlay;
|
||||
return overlay.present().then(() => {
|
||||
const actionSheet = this.overlay = await this.actionSheetCtrl.create(actionSheetOpts);
|
||||
await actionSheet.present();
|
||||
|
||||
this.isExpanded = true;
|
||||
return overlay;
|
||||
});
|
||||
});
|
||||
return actionSheet;
|
||||
}
|
||||
|
||||
openAlert() {
|
||||
private async openAlert() {
|
||||
const interfaceOptions = {...this.interfaceOptions};
|
||||
|
||||
const label = this.getLabel();
|
||||
@ -416,20 +408,17 @@ export class Select {
|
||||
(interfaceOptions.cssClass ? ' ' + interfaceOptions.cssClass : '')
|
||||
});
|
||||
|
||||
const alert = this.alertCtrl.create(alertOpts);
|
||||
return alert.then(overlay => {
|
||||
this.overlay = overlay;
|
||||
return overlay.present().then(() => {
|
||||
const alert = this.overlay = await this.alertCtrl.create(alertOpts);
|
||||
await alert.present();
|
||||
|
||||
this.isExpanded = true;
|
||||
return overlay;
|
||||
});
|
||||
});
|
||||
return alert;
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the select interface.
|
||||
*/
|
||||
close(): Promise<any> | void {
|
||||
private close(): Promise<void> {
|
||||
// TODO check !this.overlay || !this.isFocus()
|
||||
if (!this.overlay) {
|
||||
return Promise.resolve();
|
||||
@ -463,7 +452,7 @@ export class Select {
|
||||
return (this.value !== null && this.value !== undefined && this.value !== '');
|
||||
}
|
||||
|
||||
emitStyle() {
|
||||
private emitStyle() {
|
||||
clearTimeout(this.styleTmr);
|
||||
|
||||
this.styleTmr = setTimeout(() => {
|
||||
|
@ -81,6 +81,11 @@ any
|
||||
The component to display inside of the tab.
|
||||
|
||||
|
||||
#### delegate
|
||||
|
||||
|
||||
|
||||
|
||||
#### disabled
|
||||
|
||||
boolean
|
||||
@ -170,6 +175,11 @@ any
|
||||
The component to display inside of the tab.
|
||||
|
||||
|
||||
#### delegate
|
||||
|
||||
|
||||
|
||||
|
||||
#### disabled
|
||||
|
||||
boolean
|
||||
|
Reference in New Issue
Block a user