fix(checkbox, radio): change event interfaces correctly use TypeScript generics for value (#23044)

Co-authored-by: Liam DeBeasi <liamdebeasi@icloud.com>
This commit is contained in:
Evgeniy
2021-08-03 23:29:53 +03:00
committed by GitHub
parent fbe648406b
commit 8a941fd24c
5 changed files with 16 additions and 16 deletions

View File

@ -230,7 +230,7 @@ ion-checkbox,prop,mode,"ios" | "md",undefined,false,false
ion-checkbox,prop,name,string,this.inputId,false,false ion-checkbox,prop,name,string,this.inputId,false,false
ion-checkbox,prop,value,string,'on',false,false ion-checkbox,prop,value,string,'on',false,false
ion-checkbox,event,ionBlur,void,true ion-checkbox,event,ionBlur,void,true
ion-checkbox,event,ionChange,CheckboxChangeEventDetail,true ion-checkbox,event,ionChange,CheckboxChangeEventDetail<any>,true
ion-checkbox,event,ionFocus,void,true ion-checkbox,event,ionFocus,void,true
ion-checkbox,css-prop,--background ion-checkbox,css-prop,--background
ion-checkbox,css-prop,--background-checked ion-checkbox,css-prop,--background-checked
@ -867,7 +867,7 @@ ion-radio-group,none
ion-radio-group,prop,allowEmptySelection,boolean,false,false,false ion-radio-group,prop,allowEmptySelection,boolean,false,false,false
ion-radio-group,prop,name,string,this.inputId,false,false ion-radio-group,prop,name,string,this.inputId,false,false
ion-radio-group,prop,value,any,undefined,false,false ion-radio-group,prop,value,any,undefined,false,false
ion-radio-group,event,ionChange,RadioGroupChangeEventDetail,true ion-radio-group,event,ionChange,RadioGroupChangeEventDetail<any>,true
ion-range,shadow ion-range,shadow
ion-range,prop,color,string | undefined,undefined,false,true ion-range,prop,color,string | undefined,undefined,false,true

View File

@ -1,5 +1,5 @@
export interface CheckboxChangeEventDetail { export interface CheckboxChangeEventDetail<T = any> {
value: any; value: T;
checked: boolean; checked: boolean;
} }

View File

@ -271,11 +271,11 @@ export default defineComponent({
## Events ## Events
| Event | Description | Type | | Event | Description | Type |
| ----------- | ---------------------------------------------- | ---------------------------------------- | | ----------- | ---------------------------------------------- | --------------------------------------------- |
| `ionBlur` | Emitted when the checkbox loses focus. | `CustomEvent<void>` | | `ionBlur` | Emitted when the checkbox loses focus. | `CustomEvent<void>` |
| `ionChange` | Emitted when the checked property has changed. | `CustomEvent<CheckboxChangeEventDetail>` | | `ionChange` | Emitted when the checked property has changed. | `CustomEvent<CheckboxChangeEventDetail<any>>` |
| `ionFocus` | Emitted when the checkbox has focus. | `CustomEvent<void>` | | `ionFocus` | Emitted when the checkbox has focus. | `CustomEvent<void>` |
## Shadow Parts ## Shadow Parts

View File

@ -1,9 +1,9 @@
export interface RadioGroupChangeEventDetail { export interface RadioGroupChangeEventDetail<T = any> {
value: any; value: T;
} }
export interface RadioChangeEventDetail { export interface RadioChangeEventDetail<T = any> {
value: any; value: T;
checked: boolean; checked: boolean;
} }

View File

@ -229,9 +229,9 @@ export default defineComponent({
## Events ## Events
| Event | Description | Type | | Event | Description | Type |
| ----------- | ----------------------------------- | ------------------------------------------ | | ----------- | ----------------------------------- | ----------------------------------------------- |
| `ionChange` | Emitted when the value has changed. | `CustomEvent<RadioGroupChangeEventDetail>` | | `ionChange` | Emitted when the value has changed. | `CustomEvent<RadioGroupChangeEventDetail<any>>` |
## Dependencies ## Dependencies