mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix: picker-column emits correct payload
This commit is contained in:
4
core/src/components.d.ts
vendored
4
core/src/components.d.ts
vendored
@@ -4051,7 +4051,7 @@ declare global {
|
||||
new (): HTMLIonPickerElement;
|
||||
};
|
||||
interface HTMLIonPickerColumnElementEventMap {
|
||||
"ionChange": string | number | undefined;
|
||||
"ionChange": { value: string | number | undefined };
|
||||
}
|
||||
interface HTMLIonPickerColumnElement extends Components.IonPickerColumn, HTMLStencilElement {
|
||||
addEventListener<K extends keyof HTMLIonPickerColumnElementEventMap>(type: K, listener: (this: HTMLIonPickerColumnElement, ev: IonPickerColumnCustomEvent<HTMLIonPickerColumnElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
||||
@@ -6631,7 +6631,7 @@ declare namespace LocalJSX {
|
||||
/**
|
||||
* Emitted when the value has changed.
|
||||
*/
|
||||
"onIonChange"?: (event: IonPickerColumnCustomEvent<string | number | undefined>) => void;
|
||||
"onIonChange"?: (event: IonPickerColumnCustomEvent<{ value: string | number | undefined }>) => void;
|
||||
/**
|
||||
* The selected option in the picker.
|
||||
*/
|
||||
|
||||
@@ -1817,7 +1817,7 @@ export class Datetime implements ComponentInterface {
|
||||
}}
|
||||
>
|
||||
{months.map((month: PickerColumnItem) => (
|
||||
<ion-picker-column-option disabled={item.disabled} value={month.value}>{month.text}</ion-picker-column-option>
|
||||
<ion-picker-column-option disabled={month.disabled} value={month.value}>{month.text}</ion-picker-column-option>
|
||||
))}
|
||||
</ion-picker-column>
|
||||
);
|
||||
@@ -1864,7 +1864,7 @@ export class Datetime implements ComponentInterface {
|
||||
}}
|
||||
>
|
||||
{years.map((year: PickerColumnItem) => (
|
||||
<ion-picker-column-option disabled={item.disabled} value={year.value}>{year.text}</ion-picker-column-option>
|
||||
<ion-picker-column-option disabled={year.disabled} value={year.value}>{year.text}</ion-picker-column-option>
|
||||
))}
|
||||
</ion-picker-column>
|
||||
);
|
||||
@@ -1930,7 +1930,7 @@ export class Datetime implements ComponentInterface {
|
||||
}}
|
||||
>
|
||||
{hoursData.map((hour: PickerColumnItem) => (
|
||||
<ion-picker-column-option disabled={item.disabled} value={hour.value}>{hour.text}</ion-picker-column-option>
|
||||
<ion-picker-column-option disabled={hour.disabled} value={hour.value}>{hour.text}</ion-picker-column-option>
|
||||
))}
|
||||
</ion-picker-column>
|
||||
);
|
||||
@@ -1962,7 +1962,7 @@ export class Datetime implements ComponentInterface {
|
||||
}}
|
||||
>
|
||||
{minutesData.map((minute: PickerColumnItem) => (
|
||||
<ion-picker-column-option disabled={item.disabled} value={minute.value}>{minute.text}</ion-picker-column-option>
|
||||
<ion-picker-column-option disabled={minute.disabled} value={minute.value}>{minute.text}</ion-picker-column-option>
|
||||
))}
|
||||
</ion-picker-column>
|
||||
);
|
||||
@@ -2001,7 +2001,7 @@ export class Datetime implements ComponentInterface {
|
||||
}}
|
||||
>
|
||||
{dayPeriodData.map((dayPeriod: PickerColumnItem) => (
|
||||
<ion-picker-column-option disabled={item.disabled} value={dayPeriod.value}>{dayPeriod.text}</ion-picker-column-option>
|
||||
<ion-picker-column-option disabled={dayPeriod.disabled} value={dayPeriod.value}>{dayPeriod.text}</ion-picker-column-option>
|
||||
))}
|
||||
</ion-picker-column>
|
||||
);
|
||||
|
||||
@@ -72,7 +72,7 @@ export class PickerColumn implements ComponentInterface {
|
||||
/**
|
||||
* Emitted when the value has changed.
|
||||
*/
|
||||
@Event() ionChange!: EventEmitter<string | number | undefined>;
|
||||
@Event() ionChange!: EventEmitter<{ value: string | number | undefined }>;
|
||||
|
||||
@Watch('value')
|
||||
valueChange() {
|
||||
@@ -176,7 +176,7 @@ export class PickerColumn implements ComponentInterface {
|
||||
}
|
||||
|
||||
this.value = value;
|
||||
this.ionChange.emit(value);
|
||||
this.ionChange.emit({ value });
|
||||
}
|
||||
|
||||
private centerPickerItemInView = (target: HTMLElement, smooth = true, canExitInputMode = true) => {
|
||||
|
||||
@@ -1469,7 +1469,7 @@ export declare interface IonPickerColumn extends Components.IonPickerColumn {
|
||||
/**
|
||||
* Emitted when the value has changed.
|
||||
*/
|
||||
ionChange: EventEmitter<CustomEvent<string | number | undefined>>;
|
||||
ionChange: EventEmitter<CustomEvent<{ value: string | number | undefined }>>;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1465,7 +1465,7 @@ export declare interface IonPickerColumn extends Components.IonPickerColumn {
|
||||
/**
|
||||
* Emitted when the value has changed.
|
||||
*/
|
||||
ionChange: EventEmitter<CustomEvent<string | number | undefined>>;
|
||||
ionChange: EventEmitter<CustomEvent<{ value: string | number | undefined }>>;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user