UNPKG

3.19 kBTypeScriptView Raw
1import { ComponentInterface, EventEmitter } from '../../stencil-public-runtime';
2import { AnimationBuilder, OverlayEventDetail, OverlayInterface, PickerButton, PickerColumn } from '../../interface';
3/**
4 * @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use.
5 */
6export declare class Picker implements ComponentInterface, OverlayInterface {
7 private durationTimeout;
8 lastFocus?: HTMLElement;
9 el: HTMLIonPickerElement;
10 presented: boolean;
11 /** @internal */
12 overlayIndex: number;
13 /**
14 * If `true`, the keyboard will be automatically dismissed when the overlay is presented.
15 */
16 keyboardClose: boolean;
17 /**
18 * Animation to use when the picker is presented.
19 */
20 enterAnimation?: AnimationBuilder;
21 /**
22 * Animation to use when the picker is dismissed.
23 */
24 leaveAnimation?: AnimationBuilder;
25 /**
26 * Array of buttons to be displayed at the top of the picker.
27 */
28 buttons: PickerButton[];
29 /**
30 * Array of columns to be displayed in the picker.
31 */
32 columns: PickerColumn[];
33 /**
34 * Additional classes to apply for custom CSS. If multiple classes are
35 * provided they should be separated by spaces.
36 */
37 cssClass?: string | string[];
38 /**
39 * Number of milliseconds to wait before dismissing the picker.
40 */
41 duration: number;
42 /**
43 * If `true`, a backdrop will be displayed behind the picker.
44 */
45 showBackdrop: boolean;
46 /**
47 * If `true`, the picker will be dismissed when the backdrop is clicked.
48 */
49 backdropDismiss: boolean;
50 /**
51 * If `true`, the picker will animate.
52 */
53 animated: boolean;
54 /**
55 * Emitted after the picker has presented.
56 */
57 didPresent: EventEmitter<void>;
58 /**
59 * Emitted before the picker has presented.
60 */
61 willPresent: EventEmitter<void>;
62 /**
63 * Emitted before the picker has dismissed.
64 */
65 willDismiss: EventEmitter<OverlayEventDetail>;
66 /**
67 * Emitted after the picker has dismissed.
68 */
69 didDismiss: EventEmitter<OverlayEventDetail>;
70 connectedCallback(): void;
71 /**
72 * Present the picker overlay after it has been created.
73 */
74 present(): Promise<void>;
75 /**
76 * Dismiss the picker overlay after it has been presented.
77 *
78 * @param data Any data to emit in the dismiss events.
79 * @param role The role of the element that is dismissing the picker.
80 * This can be useful in a button handler for determining which button was
81 * clicked to dismiss the picker.
82 * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
83 */
84 dismiss(data?: any, role?: string): Promise<boolean>;
85 /**
86 * Returns a promise that resolves when the picker did dismiss.
87 */
88 onDidDismiss<T = any>(): Promise<OverlayEventDetail<T>>;
89 /**
90 * Returns a promise that resolves when the picker will dismiss.
91 */
92 onWillDismiss<T = any>(): Promise<OverlayEventDetail<T>>;
93 /**
94 * Get the column that matches the specified name.
95 *
96 * @param name The name of the column.
97 */
98 getColumn(name: string): Promise<PickerColumn | undefined>;
99 private buttonClick;
100 private callButtonHandler;
101 private getSelected;
102 private onBackdropTap;
103 private dispatchCancelHandler;
104 render(): any;
105}