chore(): update components.d.ts

This commit is contained in:
Manu Mtz.-Almeida
2018-03-24 03:27:20 +01:00
parent 153f8ca02c
commit 08f5976a57
5 changed files with 55 additions and 51 deletions

View File

@ -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`.
*/

View File

@ -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.

View File

@ -9,33 +9,29 @@
</head>
<body onload="initialize()">
<ion-platform></ion-platform>
<ion-app>
<ion-header>
<ion-toolbar>
<ion-title>Platform - basic</ion-title>
</ion-toolbar>
</ion-header>
<ion-header>
<ion-toolbar>
<ion-title>Platform - basic</ion-title>
</ion-toolbar>
</ion-header>
<ion-content padding>
<h2>The Platforms are:</h2>
<ul class="platform-name-list"></ul>
<ion-content padding>
<h2>The Platforms are:</h2>
<ul class="platform-name-list"></ul>
<h2>The Platforms versions are:</h2>
<ul class="platform-version-list"></ul>
<h2>The orientation is <span class="orientation"></span></h2>
<h2>The ready event has fired: <span class="ready"></span></h2>
</ion-content>
<h2>The Platforms versions are:</h2>
<ul class="platform-version-list"></ul>
<h2>The orientation is <span class="orientation"></span></h2>
<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();

View File

@ -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(() => {
this.isExpanded = true;
return overlay;
});
});
const popover = this.overlay = await this.popoverCtrl.create(popoverOpts);
await popover.present();
this.isExpanded = true;
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(() => {
this.isExpanded = true;
return overlay;
});
});
const actionSheet = this.overlay = await this.actionSheetCtrl.create(actionSheetOpts);
await actionSheet.present();
this.isExpanded = true;
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(() => {
this.isExpanded = true;
return overlay;
});
});
const alert = this.overlay = await this.alertCtrl.create(alertOpts);
await alert.present();
this.isExpanded = true;
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(() => {

View File

@ -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