chore(): simplify overlay attribute types (#25074)

This commit is contained in:
Liam DeBeasi
2022-04-07 14:11:30 -04:00
committed by GitHub
parent 1c26e9b9b0
commit 9fbaaf95eb
20 changed files with 214 additions and 238 deletions

View File

@ -42,7 +42,7 @@ interface ToastOptions {
translucent?: boolean;
animated?: boolean;
icon?: string;
htmlAttributes?: ToastAttributes;
htmlAttributes?: { [key: string]: any };
color?: Color;
mode?: Mode;
@ -54,11 +54,6 @@ interface ToastOptions {
}
```
### ToastAttributes
```typescript
interface ToastAttributes extends JSXBase.HTMLAttributes<HTMLElement> {}
```
## Accessibility
### Focus Management
@ -447,7 +442,7 @@ export default defineComponent({
| `duration` | `duration` | How many milliseconds to wait before hiding the toast. By default, it will show until `dismiss()` is called. | `number` | `0` |
| `enterAnimation` | -- | Animation to use when the toast is presented. | `((baseEl: any, opts?: any) => Animation) \| undefined` | `undefined` |
| `header` | `header` | Header to be shown in the toast. | `string \| undefined` | `undefined` |
| `htmlAttributes` | -- | Additional attributes to pass to the toast. | `ToastAttributes \| undefined` | `undefined` |
| `htmlAttributes` | -- | Additional attributes to pass to the toast. | `undefined \| { [key: string]: any; }` | `undefined` |
| `icon` | `icon` | The name of the icon to display, or the path to a valid SVG file. See `ion-icon`. https://ionic.io/ionicons | `string \| undefined` | `undefined` |
| `keyboardClose` | `keyboard-close` | If `true`, the keyboard will be automatically dismissed when the overlay is presented. | `boolean` | `false` |
| `leaveAnimation` | -- | Animation to use when the toast is dismissed. | `((baseEl: any, opts?: any) => Animation) \| undefined` | `undefined` |

View File

@ -1,5 +1,3 @@
import type { JSXBase } from '@stencil/core/internal';
import type { AnimationBuilder, Color, Mode } from '../../interface';
import type { IonicSafeString } from '../../utils/sanitization';
@ -24,7 +22,10 @@ export interface ToastOptions {
leaveAnimation?: AnimationBuilder;
}
export type ToastAttributes = JSXBase.HTMLAttributes<HTMLElement>;
/**
* @deprecated - Use { [key: string]: any } directly instead.
*/
export type ToastAttributes = { [key: string]: any };
export interface ToastButton {
text?: string;