feat(picker): add ability to use picker inline (#26336)

This commit is contained in:
Liam DeBeasi
2022-11-22 15:33:47 -05:00
committed by GitHub
parent f23fb342b2
commit c0a8501657
17 changed files with 480 additions and 35 deletions

View File

@ -53,6 +53,7 @@ export const DIRECTIVES = [
d.IonNav,
d.IonNavLink,
d.IonNote,
d.IonPicker,
d.IonProgressBar,
d.IonRadio,
d.IonRadioGroup,

View File

@ -1418,6 +1418,67 @@ export class IonNote {
}
}
import type { OverlayEventDetail as IPickerOverlayEventDetail } from '@ionic/core';
export declare interface IonPicker extends Components.IonPicker {
/**
* Emitted after the picker has presented.
*/
ionPickerDidPresent: EventEmitter<CustomEvent<void>>;
/**
* Emitted before the picker has presented.
*/
ionPickerWillPresent: EventEmitter<CustomEvent<void>>;
/**
* Emitted before the picker has dismissed.
*/
ionPickerWillDismiss: EventEmitter<CustomEvent<IPickerOverlayEventDetail>>;
/**
* Emitted after the picker has dismissed.
*/
ionPickerDidDismiss: EventEmitter<CustomEvent<IPickerOverlayEventDetail>>;
/**
* Emitted after the picker has presented.
Shorthand for ionPickerWillDismiss.
*/
didPresent: EventEmitter<CustomEvent<void>>;
/**
* Emitted before the picker has presented.
Shorthand for ionPickerWillPresent.
*/
willPresent: EventEmitter<CustomEvent<void>>;
/**
* Emitted before the picker has dismissed.
Shorthand for ionPickerWillDismiss.
*/
willDismiss: EventEmitter<CustomEvent<IPickerOverlayEventDetail>>;
/**
* Emitted after the picker has dismissed.
Shorthand for ionPickerDidDismiss.
*/
didDismiss: EventEmitter<CustomEvent<IPickerOverlayEventDetail>>;
}
@ProxyCmp({
defineCustomElementFn: undefined,
inputs: ['animated', 'backdropDismiss', 'buttons', 'columns', 'cssClass', 'duration', 'enterAnimation', 'htmlAttributes', 'isOpen', 'keyboardClose', 'leaveAnimation', 'mode', 'showBackdrop', 'trigger'],
methods: ['present', 'dismiss', 'onDidDismiss', 'onWillDismiss', 'getColumn']
})
@Component({
selector: 'ion-picker',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-content></ng-content>',
inputs: ['animated', 'backdropDismiss', 'buttons', 'columns', 'cssClass', 'duration', 'enterAnimation', 'htmlAttributes', 'isOpen', 'keyboardClose', 'leaveAnimation', 'mode', 'showBackdrop', 'trigger']
})
export class IonPicker {
protected el: HTMLElement;
constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
c.detach();
this.el = r.nativeElement;
proxyOutputs(this, this.el, ['ionPickerDidPresent', 'ionPickerWillPresent', 'ionPickerWillDismiss', 'ionPickerDidDismiss', 'didPresent', 'willPresent', 'willDismiss', 'didDismiss']);
}
}
export declare interface IonProgressBar extends Components.IonProgressBar {}