Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(overlays): enableBackdropDismiss => backdropDismiss #15150

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
96 changes: 48 additions & 48 deletions core/src/components.d.ts
Expand Up @@ -97,6 +97,10 @@ declare global {
}

interface IonActionSheet {
/**
* If true, the action sheet will be dismissed when the backdrop is clicked. Defaults to `true`.
*/
'backdropDismiss': boolean;
/**
* An array of buttons for the action sheet.
*/
Expand All @@ -109,10 +113,6 @@ declare global {
* Dismiss the action sheet overlay after it has been presented.
*/
'dismiss': (data?: any, role?: string | undefined) => Promise<void>;
/**
* If true, the action sheet will be dismissed when the backdrop is clicked. Defaults to `true`.
*/
'enableBackdropDismiss': boolean;
/**
* Animation to use when the action sheet is presented.
*/
Expand Down Expand Up @@ -175,6 +175,10 @@ declare global {
}

interface IonAlert {
/**
* If true, the alert will be dismissed when the backdrop is clicked. Defaults to `true`.
*/
'backdropDismiss': boolean;
/**
* Array of buttons to be added to the alert.
*/
Expand All @@ -187,10 +191,6 @@ declare global {
* Dismiss the alert overlay after it has been presented.
*/
'dismiss': (data?: any, role?: string | undefined) => Promise<void>;
/**
* If true, the alert will be dismissed when the backdrop is clicked. Defaults to `true`.
*/
'enableBackdropDismiss': boolean;
/**
* Animation to use when the alert is presented.
*/
Expand Down Expand Up @@ -1188,6 +1188,10 @@ declare global {
}

interface IonLoading {
/**
* 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.
*/
Expand All @@ -1204,10 +1208,6 @@ declare global {
* Number of milliseconds to wait before dismissing the loading indicator.
*/
'duration': number;
/**
* If true, the loading indicator will be dismissed when the backdrop is clicked. Defaults to `false`.
*/
'enableBackdropDismiss': boolean;
/**
* Animation to use when the loading indicator is presented.
*/
Expand Down Expand Up @@ -1388,6 +1388,10 @@ declare global {
}

interface IonModal {
/**
* If true, the modal will be dismissed when the backdrop is clicked. Defaults to `true`.
*/
'backdropDismiss': boolean;
/**
* The component to display inside of the modal.
*/
Expand All @@ -1405,10 +1409,6 @@ declare global {
* Dismiss the modal overlay after it has been presented.
*/
'dismiss': (data?: any, role?: string | undefined) => Promise<void>;
/**
* If true, the modal will be dismissed when the backdrop is clicked. Defaults to `true`.
*/
'enableBackdropDismiss': boolean;
/**
* Animation to use when the modal is presented.
*/
Expand Down Expand Up @@ -1568,6 +1568,10 @@ declare global {
}

interface IonPicker {
/**
* If true, the picker will be dismissed when the backdrop is clicked. Defaults to `true`.
*/
'backdropDismiss': boolean;
/**
* Array of buttons to be displayed at the top of the picker.
*/
Expand All @@ -1588,10 +1592,6 @@ declare global {
* Number of milliseconds to wait before dismissing the picker.
*/
'duration': number;
/**
* If true, the picker will be dismissed when the backdrop is clicked. Defaults to `true`.
*/
'enableBackdropDismiss': boolean;
/**
* Animation to use when the picker is presented.
*/
Expand Down Expand Up @@ -1647,6 +1647,10 @@ declare global {
}

interface IonPopover {
/**
* If true, the popover will be dismissed when the backdrop is clicked. Defaults to `true`.
*/
'backdropDismiss': boolean;
/**
* The color to use from your application's color palette. Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`. For more information on colors, see [theming](/docs/theming/basics).
*/
Expand All @@ -1668,10 +1672,6 @@ declare global {
* Dismiss the popover overlay after it has been presented.
*/
'dismiss': (data?: any, role?: string | undefined) => Promise<void>;
/**
* If true, the popover will be dismissed when the backdrop is clicked. Defaults to `true`.
*/
'enableBackdropDismiss': boolean;
/**
* Animation to use when the popover is presented.
*/
Expand Down Expand Up @@ -3602,6 +3602,10 @@ declare global {
}

export interface IonActionSheetAttributes extends HTMLAttributes {
/**
* If true, the action sheet will be dismissed when the backdrop is clicked. Defaults to `true`.
*/
'backdropDismiss'?: boolean;
/**
* An array of buttons for the action sheet.
*/
Expand All @@ -3610,10 +3614,6 @@ declare global {
* Additional classes to apply for custom CSS. If multiple classes are provided they should be separated by spaces.
*/
'cssClass'?: string | string[];
/**
* If true, the action sheet will be dismissed when the backdrop is clicked. Defaults to `true`.
*/
'enableBackdropDismiss'?: boolean;
/**
* Animation to use when the action sheet is presented.
*/
Expand Down Expand Up @@ -3677,6 +3677,10 @@ declare global {
}

export interface IonAlertAttributes extends HTMLAttributes {
/**
* If true, the alert will be dismissed when the backdrop is clicked. Defaults to `true`.
*/
'backdropDismiss'?: boolean;
/**
* Array of buttons to be added to the alert.
*/
Expand All @@ -3685,10 +3689,6 @@ declare global {
* Additional classes to apply for custom CSS. If multiple classes are provided they should be separated by spaces.
*/
'cssClass'?: string | string[];
/**
* If true, the alert will be dismissed when the backdrop is clicked. Defaults to `true`.
*/
'enableBackdropDismiss'?: boolean;
/**
* Animation to use when the alert is presented.
*/
Expand Down Expand Up @@ -4722,6 +4722,10 @@ declare global {
}

export interface IonLoadingAttributes extends HTMLAttributes {
/**
* 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.
*/
Expand All @@ -4734,10 +4738,6 @@ declare global {
* Number of milliseconds to wait before dismissing the loading indicator.
*/
'duration'?: number;
/**
* If true, the loading indicator will be dismissed when the backdrop is clicked. Defaults to `false`.
*/
'enableBackdropDismiss'?: boolean;
/**
* Animation to use when the loading indicator is presented.
*/
Expand Down Expand Up @@ -4875,6 +4875,10 @@ declare global {
}

export interface IonModalAttributes extends HTMLAttributes {
/**
* If true, the modal will be dismissed when the backdrop is clicked. Defaults to `true`.
*/
'backdropDismiss'?: boolean;
/**
* The component to display inside of the modal.
*/
Expand All @@ -4888,10 +4892,6 @@ declare global {
*/
'cssClass'?: string | string[];
'delegate'?: FrameworkDelegate;
/**
* If true, the modal will be dismissed when the backdrop is clicked. Defaults to `true`.
*/
'enableBackdropDismiss'?: boolean;
/**
* Animation to use when the modal is presented.
*/
Expand Down Expand Up @@ -5014,6 +5014,10 @@ declare global {
}

export interface IonPickerAttributes extends HTMLAttributes {
/**
* If true, the picker will be dismissed when the backdrop is clicked. Defaults to `true`.
*/
'backdropDismiss'?: boolean;
/**
* Array of buttons to be displayed at the top of the picker.
*/
Expand All @@ -5030,10 +5034,6 @@ declare global {
* Number of milliseconds to wait before dismissing the picker.
*/
'duration'?: number;
/**
* If true, the picker will be dismissed when the backdrop is clicked. Defaults to `true`.
*/
'enableBackdropDismiss'?: boolean;
/**
* Animation to use when the picker is presented.
*/
Expand Down Expand Up @@ -5086,6 +5086,10 @@ declare global {
}

export interface IonPopoverAttributes extends HTMLAttributes {
/**
* If true, the popover will be dismissed when the backdrop is clicked. Defaults to `true`.
*/
'backdropDismiss'?: boolean;
/**
* The color to use from your application's color palette. Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`. For more information on colors, see [theming](/docs/theming/basics).
*/
Expand All @@ -5103,10 +5107,6 @@ declare global {
*/
'cssClass'?: string | string[];
'delegate'?: FrameworkDelegate;
/**
* If true, the popover will be dismissed when the backdrop is clicked. Defaults to `true`.
*/
'enableBackdropDismiss'?: boolean;
/**
* Animation to use when the popover is presented.
*/
Expand Down
2 changes: 1 addition & 1 deletion core/src/components/action-sheet/action-sheet-interface.ts
Expand Up @@ -4,7 +4,7 @@ export interface ActionSheetOptions {
subHeader?: string;
cssClass?: string | string[];
buttons: (ActionSheetButton | string)[];
enableBackdropDismiss?: boolean;
backdropDismiss?: boolean;
translucent?: boolean;
}

Expand Down
4 changes: 2 additions & 2 deletions core/src/components/action-sheet/action-sheet.tsx
Expand Up @@ -64,7 +64,7 @@ export class ActionSheet implements OverlayInterface {
/**
* If true, the action sheet will be dismissed when the backdrop is clicked. Defaults to `true`.
*/
@Prop() enableBackdropDismiss = true;
@Prop() backdropDismiss = true;

/**
* Title for the action sheet.
Expand Down Expand Up @@ -226,7 +226,7 @@ export class ActionSheet implements OverlayInterface {
const buttons = allButtons.filter(b => b.role !== 'cancel');

return [
<ion-backdrop tappable={this.enableBackdropDismiss}/>,
<ion-backdrop tappable={this.backdropDismiss}/>,
<div class="action-sheet-wrapper" role="dialog">
<div class="action-sheet-container">
<div class="action-sheet-group">
Expand Down
26 changes: 13 additions & 13 deletions core/src/components/action-sheet/readme.md
Expand Up @@ -16,19 +16,19 @@ A button's `role` property can either be `destructive` or `cancel`. Buttons with

## Properties

| Property | Attribute | Description | Type |
| ----------------------- | ------------------------- | ---------------------------------------------------------------------------------------------------------------- | --------------------- |
| `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[]` |
| `enableBackdropDismiss` | `enable-backdrop-dismiss` | If true, the action sheet will be dismissed when the backdrop is clicked. Defaults to `true`. | `boolean` |
| `enterAnimation` | -- | Animation to use when the action sheet is presented. | `AnimationBuilder` |
| `header` | `header` | Title for the action sheet. | `string` |
| `keyboardClose` | `keyboard-close` | If the actionSheet should close the keyboard | `boolean` |
| `leaveAnimation` | -- | Animation to use when the action sheet is dismissed. | `AnimationBuilder` |
| `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` |
| Property | Attribute | Description | Type |
| ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------- | --------------------- |
| `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[]` |
| `enterAnimation` | -- | Animation to use when the action sheet is presented. | `AnimationBuilder` |
| `header` | `header` | Title for the action sheet. | `string` |
| `keyboardClose` | `keyboard-close` | If the actionSheet should close the keyboard | `boolean` |
| `leaveAnimation` | -- | Animation to use when the action sheet is dismissed. | `AnimationBuilder` |
| `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
2 changes: 1 addition & 1 deletion core/src/components/action-sheet/test/basic/index.html
Expand Up @@ -140,7 +140,7 @@
const actionSheetController = document.querySelector('ion-action-sheet-controller');
await actionSheetController.componentOnReady();
const actionSheetElement = await actionSheetController.create({
enableBackdropDismiss: false,
backdropDismiss: false,
buttons: [{
text: 'Archive',
handler: () => {
Expand Down
2 changes: 1 addition & 1 deletion core/src/components/action-sheet/test/preview/index.html
Expand Up @@ -135,7 +135,7 @@
const actionSheetController = document.querySelector('ion-action-sheet-controller');
await actionSheetController.componentOnReady();
const actionSheetElement = await actionSheetController.create({
enableBackdropDismiss: false,
backdropDismiss: false,
buttons: [{
text: 'Archive',
handler: () => {
Expand Down
Expand Up @@ -97,7 +97,7 @@
const actionSheetController = document.querySelector('ion-action-sheet-controller');
await actionSheetController.componentOnReady();
const actionSheetElement = await actionSheetController.create({
enableBackdropDismiss: false,
backdropDismiss: false,
buttons: [{
text: 'Archive',
handler: () => {
Expand Down
2 changes: 1 addition & 1 deletion core/src/components/alert/alert-interface.ts
Expand Up @@ -8,7 +8,7 @@ export interface AlertOptions {
mode?: string;
inputs?: AlertInput[];
buttons?: (AlertButton | string)[];
enableBackdropDismiss?: boolean;
backdropDismiss?: boolean;
translucent?: boolean;
}

Expand Down
4 changes: 2 additions & 2 deletions core/src/components/alert/alert.tsx
Expand Up @@ -81,7 +81,7 @@ export class Alert implements OverlayInterface {
/**
* If true, the alert will be dismissed when the backdrop is clicked. Defaults to `true`.
*/
@Prop() enableBackdropDismiss = true;
@Prop() backdropDismiss = true;

/**
* If true, the alert will be translucent. Defaults to `false`.
Expand Down Expand Up @@ -438,7 +438,7 @@ export class Alert implements OverlayInterface {
}

return [
<ion-backdrop tappable={this.enableBackdropDismiss}/>,
<ion-backdrop tappable={this.backdropDismiss}/>,

<div class="alert-wrapper">

Expand Down