Skip to content

Commit

Permalink
fix(overlay): expose "animated" API
Browse files Browse the repository at this point in the history
fixes #14775
  • Loading branch information
manucorporat committed Aug 26, 2018
1 parent 771857b commit 8b768fb
Show file tree
Hide file tree
Showing 34 changed files with 122 additions and 123 deletions.
131 changes: 62 additions & 69 deletions core/src/components.d.ts
Expand Up @@ -49,6 +49,7 @@ import {
SelectInterface,
SelectPopoverOption,
Side,
SpinnerTypes,
StyleEvent,
TabbarLayout,
TabbarPlacement,
Expand Down Expand Up @@ -83,6 +84,10 @@ export namespace Components {
interface IonActionSheetControllerAttributes extends StencilHTMLAttributes {}

interface IonActionSheet {
/**
* If true, the action sheet will animate. Defaults to `true`.
*/
'animated': boolean;
/**
* If true, the action sheet will be dismissed when the backdrop is clicked. Defaults to `true`.
*/
Expand Down Expand Up @@ -139,12 +144,12 @@ export namespace Components {
* If true, the action sheet will be translucent. Defaults to `false`.
*/
'translucent': boolean;
}
interface IonActionSheetAttributes extends StencilHTMLAttributes {
/**
* If true, the action sheet will animate. Defaults to `true`.
*/
'willAnimate': boolean;
}
interface IonActionSheetAttributes extends StencilHTMLAttributes {
'animated'?: boolean;
/**
* If true, the action sheet will be dismissed when the backdrop is clicked. Defaults to `true`.
*/
Expand Down Expand Up @@ -209,10 +214,6 @@ export namespace Components {
* If true, the action sheet will be translucent. Defaults to `false`.
*/
'translucent'?: boolean;
/**
* If true, the action sheet will animate. Defaults to `true`.
*/
'willAnimate'?: boolean;
}

interface IonAlertController {
Expand All @@ -232,6 +233,10 @@ export namespace Components {
interface IonAlertControllerAttributes extends StencilHTMLAttributes {}

interface IonAlert {
/**
* If true, the alert will animate. Defaults to `true`.
*/
'animated': boolean;
/**
* If true, the alert will be dismissed when the backdrop is clicked. Defaults to `true`.
*/
Expand Down Expand Up @@ -294,12 +299,12 @@ export namespace Components {
* If true, the alert will be translucent. Defaults to `false`.
*/
'translucent': boolean;
}
interface IonAlertAttributes extends StencilHTMLAttributes {
/**
* If true, the alert will animate. Defaults to `true`.
*/
'willAnimate': boolean;
}
interface IonAlertAttributes extends StencilHTMLAttributes {
'animated'?: boolean;
/**
* If true, the alert will be dismissed when the backdrop is clicked. Defaults to `true`.
*/
Expand Down Expand Up @@ -370,10 +375,6 @@ export namespace Components {
* If true, the alert will be translucent. Defaults to `false`.
*/
'translucent'?: boolean;
/**
* If true, the alert will animate. Defaults to `true`.
*/
'willAnimate'?: boolean;
}

interface IonAnchor {
Expand Down Expand Up @@ -2239,13 +2240,13 @@ export namespace Components {

interface IonLoading {
/**
* If true, the loading indicator will be dismissed when the backdrop is clicked. Defaults to `false`.
* If true, the loading indicator will animate. Defaults to `true`.
*/
'backdropDismiss': boolean;
'animated': boolean;
/**
* Optional text content to display in the loading indicator.
* If true, the loading indicator will be dismissed when the backdrop is clicked. Defaults to `false`.
*/
'content': string;
'backdropDismiss': boolean;
/**
* Additional classes to apply for custom CSS. If multiple classes are provided they should be separated by spaces.
*/
Expand All @@ -2271,6 +2272,10 @@ export namespace Components {
*/
'leaveAnimation': AnimationBuilder;
/**
* Optional text content to display in the loading indicator.
*/
'message': string;
/**
* Returns a promise that resolves when the loading did dismiss. It also accepts a callback that is called in the same circumstances.
*/
'onDidDismiss': (callback?: ((detail: OverlayEventDetail<any>) => void) | undefined) => Promise<OverlayEventDetail<any>>;
Expand All @@ -2295,21 +2300,17 @@ export namespace Components {
* If true, the loading indicator will be translucent. Defaults to `false`.
*/
'translucent': boolean;
}
interface IonLoadingAttributes extends StencilHTMLAttributes {
/**
* If true, the loading indicator will animate. Defaults to `true`.
*/
'willAnimate': boolean;
}
interface IonLoadingAttributes extends StencilHTMLAttributes {
'animated'?: boolean;
/**
* If true, the loading indicator will be dismissed when the backdrop is clicked. Defaults to `false`.
*/
'backdropDismiss'?: boolean;
/**
* Optional text content to display in the loading indicator.
*/
'content'?: string;
/**
* Additional classes to apply for custom CSS. If multiple classes are provided they should be separated by spaces.
*/
'cssClass'?: string | string[];
Expand All @@ -2330,6 +2331,10 @@ export namespace Components {
*/
'leaveAnimation'?: AnimationBuilder;
/**
* Optional text content to display in the loading indicator.
*/
'message'?: string;
/**
* Emitted after the loading has dismissed.
*/
'onIonLoadingDidDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void;
Expand Down Expand Up @@ -2366,10 +2371,6 @@ export namespace Components {
* If true, the loading indicator will be translucent. Defaults to `false`.
*/
'translucent'?: boolean;
/**
* If true, the loading indicator will animate. Defaults to `true`.
*/
'willAnimate'?: boolean;
}

interface IonMenuButton {
Expand Down Expand Up @@ -2581,6 +2582,10 @@ export namespace Components {
interface IonModalControllerAttributes extends StencilHTMLAttributes {}

interface IonModal {
/**
* If true, the modal will animate. Defaults to `true`.
*/
'animated': boolean;
/**
* If true, the modal will be dismissed when the backdrop is clicked. Defaults to `true`.
*/
Expand Down Expand Up @@ -2628,12 +2633,12 @@ export namespace Components {
* If true, a backdrop will be displayed behind the modal. Defaults to `true`.
*/
'showBackdrop': boolean;
}
interface IonModalAttributes extends StencilHTMLAttributes {
/**
* If true, the modal will animate. Defaults to `true`.
*/
'willAnimate': boolean;
}
interface IonModalAttributes extends StencilHTMLAttributes {
'animated'?: boolean;
/**
* If true, the modal will be dismissed when the backdrop is clicked. Defaults to `true`.
*/
Expand Down Expand Up @@ -2689,10 +2694,6 @@ export namespace Components {
* If true, a backdrop will be displayed behind the modal. Defaults to `true`.
*/
'showBackdrop'?: boolean;
/**
* If true, the modal will animate. Defaults to `true`.
*/
'willAnimate'?: boolean;
}

interface IonNavPop {}
Expand Down Expand Up @@ -2886,6 +2887,10 @@ export namespace Components {
interface IonPickerControllerAttributes extends StencilHTMLAttributes {}

interface IonPicker {
/**
* If true, the picker will animate. Defaults to `true`.
*/
'animated': boolean;
/**
* If true, the picker will be dismissed when the backdrop is clicked. Defaults to `true`.
*/
Expand Down Expand Up @@ -2943,12 +2948,12 @@ export namespace Components {
* If true, a backdrop will be displayed behind the picker. Defaults to `true`.
*/
'showBackdrop': boolean;
}
interface IonPickerAttributes extends StencilHTMLAttributes {
/**
* If true, the picker will animate. Defaults to `true`.
*/
'willAnimate': boolean;
}
interface IonPickerAttributes extends StencilHTMLAttributes {
'animated'?: boolean;
/**
* If true, the picker will be dismissed when the backdrop is clicked. Defaults to `true`.
*/
Expand Down Expand Up @@ -3010,10 +3015,6 @@ export namespace Components {
* If true, a backdrop will be displayed behind the picker. Defaults to `true`.
*/
'showBackdrop'?: boolean;
/**
* If true, the picker will animate. Defaults to `true`.
*/
'willAnimate'?: boolean;
}

interface IonPopoverController {
Expand All @@ -3033,6 +3034,10 @@ export namespace Components {
interface IonPopoverControllerAttributes extends StencilHTMLAttributes {}

interface IonPopover {
/**
* If true, the popover will animate. Defaults to `true`.
*/
'animated': boolean;
/**
* If true, the popover will be dismissed when the backdrop is clicked. Defaults to `true`.
*/
Expand Down Expand Up @@ -3096,12 +3101,12 @@ export namespace Components {
* If true, the popover will be translucent. Defaults to `false`.
*/
'translucent': boolean;
}
interface IonPopoverAttributes extends StencilHTMLAttributes {
/**
* If true, the popover will animate. Defaults to `true`.
*/
'willAnimate': boolean;
}
interface IonPopoverAttributes extends StencilHTMLAttributes {
'animated'?: boolean;
/**
* If true, the popover will be dismissed when the backdrop is clicked. Defaults to `true`.
*/
Expand Down Expand Up @@ -3173,10 +3178,6 @@ export namespace Components {
* If true, the popover will be translucent. Defaults to `false`.
*/
'translucent'?: boolean;
/**
* If true, the popover will animate. Defaults to `true`.
*/
'willAnimate'?: boolean;
}

interface IonRadioGroup {
Expand Down Expand Up @@ -4284,13 +4285,9 @@ export namespace Components {
*/
'duration': number;
/**
* The mode determines which platform styles to use. Possible values are: `"ios"` or `"md"`.
*/
'mode': Mode;
/**
* The name of the SVG spinner to use. If a name is not provided, the platform's default spinner will be used. Possible values are: `"lines"`, `"lines-small"`, `"dots"`, `"bubbles"`, `"circles"`, `"crescent"`.
*/
'name': string;
'name': SpinnerTypes;
/**
* If true, the spinner's animation will be paused. Defaults to `false`.
*/
Expand All @@ -4306,13 +4303,9 @@ export namespace Components {
*/
'duration'?: number;
/**
* The mode determines which platform styles to use. Possible values are: `"ios"` or `"md"`.
*/
'mode'?: Mode;
/**
* The name of the SVG spinner to use. If a name is not provided, the platform's default spinner will be used. Possible values are: `"lines"`, `"lines-small"`, `"dots"`, `"bubbles"`, `"circles"`, `"crescent"`.
*/
'name'?: string;
'name'?: SpinnerTypes;
/**
* If true, the spinner's animation will be paused. Defaults to `false`.
*/
Expand Down Expand Up @@ -4870,6 +4863,10 @@ export namespace Components {
interface IonToastControllerAttributes extends StencilHTMLAttributes {}

interface IonToast {
/**
* If true, the toast will animate. Defaults to `true`.
*/
'animated': boolean;
/**
* Text to display in the close button.
*/
Expand Down Expand Up @@ -4911,7 +4908,7 @@ export namespace Components {
/**
* The position of the toast on the screen. Possible values: "top", "middle", "bottom".
*/
'position': string;
'position': 'top' | 'bottom';
/**
* Present the toast overlay after it has been created.
*/
Expand All @@ -4924,12 +4921,12 @@ export namespace Components {
* If true, the toast will be translucent. Defaults to `false`.
*/
'translucent': boolean;
}
interface IonToastAttributes extends StencilHTMLAttributes {
/**
* If true, the toast will animate. Defaults to `true`.
*/
'willAnimate': boolean;
}
interface IonToastAttributes extends StencilHTMLAttributes {
'animated'?: boolean;
/**
* Text to display in the close button.
*/
Expand Down Expand Up @@ -4983,7 +4980,7 @@ export namespace Components {
/**
* The position of the toast on the screen. Possible values: "top", "middle", "bottom".
*/
'position'?: string;
'position'?: 'top' | 'bottom';
/**
* If true, the close button will be displayed. Defaults to `false`.
*/
Expand All @@ -4992,10 +4989,6 @@ export namespace Components {
* If true, the toast will be translucent. Defaults to `false`.
*/
'translucent'?: boolean;
/**
* If true, the toast will animate. Defaults to `true`.
*/
'willAnimate'?: boolean;
}

interface IonToggle {
Expand Down
1 change: 1 addition & 0 deletions core/src/components/action-sheet/action-sheet-interface.ts
Expand Up @@ -6,6 +6,7 @@ export interface ActionSheetOptions {
buttons: (ActionSheetButton | string)[];
backdropDismiss?: boolean;
translucent?: boolean;
animated?: boolean;
}

export interface ActionSheetButton {
Expand Down
2 changes: 1 addition & 1 deletion core/src/components/action-sheet/action-sheet.tsx
Expand Up @@ -83,7 +83,7 @@ export class ActionSheet implements OverlayInterface {
/**
* If true, the action sheet will animate. Defaults to `true`.
*/
@Prop() willAnimate = true;
@Prop() animated = true;

/**
* Emitted after the alert has loaded.
Expand Down
2 changes: 1 addition & 1 deletion core/src/components/action-sheet/readme.md
Expand Up @@ -18,6 +18,7 @@ A button's `role` property can either be `destructive` or `cancel`. Buttons with

| Property | Attribute | Description | Type |
| ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------- | --------------------- |
| `animated` | `animated` | If true, the action sheet will animate. Defaults to `true`. | `boolean` |
| `backdropDismiss` | `backdrop-dismiss` | If true, the action sheet will be dismissed when the backdrop is clicked. Defaults to `true`. | `boolean` |
| `buttons` | -- | An array of buttons for the action sheet. | `ActionSheetButton[]` |
| `cssClass` | `css-class` | Additional classes to apply for custom CSS. If multiple classes are provided they should be separated by spaces. | `string`, `string[]` |
Expand All @@ -28,7 +29,6 @@ A button's `role` property can either be `destructive` or `cancel`. Buttons with
| `overlayId` | `overlay-id` | Unique ID to be used with the overlay. Internal only | `number` |
| `subHeader` | `sub-header` | Subtitle for the action sheet. | `string` |
| `translucent` | `translucent` | If true, the action sheet will be translucent. Defaults to `false`. | `boolean` |
| `willAnimate` | `will-animate` | If true, the action sheet will animate. Defaults to `true`. | `boolean` |


## Events
Expand Down

0 comments on commit 8b768fb

Please sign in to comment.