feat(select): add optional generic typings (#21514)

resolves https://github.com/ionic-team/ionic-framework/issues/20220
This commit is contained in:
Simon Hänisch
2020-07-14 22:06:48 +02:00
committed by GitHub
parent 1351b2eafc
commit 7c2d0c981a
3 changed files with 9 additions and 9 deletions

View File

@@ -1070,7 +1070,7 @@ ion-select,prop,value,any,undefined,false,false
ion-select,method,open,open(event?: UIEvent | undefined) => Promise<any>
ion-select,event,ionBlur,void,true
ion-select,event,ionCancel,void,true
ion-select,event,ionChange,SelectChangeEventDetail,true
ion-select,event,ionChange,SelectChangeEventDetail<any>,true
ion-select,event,ionFocus,void,true
ion-select,css-prop,--padding-bottom
ion-select,css-prop,--padding-end

View File

@@ -1225,12 +1225,12 @@ export class SelectExample {
## Events
| Event | Description | Type |
| ----------- | ---------------------------------------- | -------------------------------------- |
| `ionBlur` | Emitted when the select loses focus. | `CustomEvent<void>` |
| `ionCancel` | Emitted when the selection is cancelled. | `CustomEvent<void>` |
| `ionChange` | Emitted when the value has changed. | `CustomEvent<SelectChangeEventDetail>` |
| `ionFocus` | Emitted when the select has focus. | `CustomEvent<void>` |
| Event | Description | Type |
| ----------- | ---------------------------------------- | ------------------------------------------- |
| `ionBlur` | Emitted when the select loses focus. | `CustomEvent<void>` |
| `ionCancel` | Emitted when the selection is cancelled. | `CustomEvent<void>` |
| `ionChange` | Emitted when the value has changed. | `CustomEvent<SelectChangeEventDetail<any>>` |
| `ionFocus` | Emitted when the select has focus. | `CustomEvent<void>` |
## Methods

View File

@@ -2,6 +2,6 @@ export type SelectInterface = 'action-sheet' | 'popover' | 'alert';
export type SelectCompareFn = (currentValue: any, compareValue: any) => boolean;
export interface SelectChangeEventDetail {
value: any | any[] | undefined | null;
export interface SelectChangeEventDetail<T = any> {
value: T;
}