1 | import type { ComponentPublicInstance } from 'vue';
|
2 | import type { Numeric } from '../utils';
|
3 | import type { PickerProps } from './Picker';
|
4 | export type PickerToolbarPosition = 'top' | 'bottom';
|
5 | export type PickerFieldNames = {
|
6 | text?: string;
|
7 | value?: string;
|
8 | children?: string;
|
9 | };
|
10 | export type PickerOption = {
|
11 | text?: Numeric;
|
12 | value?: Numeric;
|
13 | disabled?: boolean;
|
14 | children?: PickerColumn;
|
15 | className?: unknown;
|
16 | [key: PropertyKey]: any;
|
17 | };
|
18 | export type PickerColumn = PickerOption[];
|
19 | export type PickerExpose = {
|
20 | confirm: () => void;
|
21 | getSelectedOptions: () => Array<PickerOption | undefined>;
|
22 | };
|
23 | export type PickerColumnProvide = {
|
24 | state: {
|
25 | index: number;
|
26 | offset: number;
|
27 | duration: number;
|
28 | options: PickerOption[];
|
29 | };
|
30 | setIndex: (index: number, emitChange?: boolean | undefined) => void;
|
31 | getValue: () => PickerOption;
|
32 | setValue: (value: string) => void;
|
33 | setOptions: (options: PickerOption[]) => void;
|
34 | stopMomentum: () => void;
|
35 | };
|
36 | export type PickerInstance = ComponentPublicInstance<PickerProps, PickerExpose>;
|
37 | export type PickerConfirmEventParams = {
|
38 | selectedValues: Numeric[];
|
39 | selectedOptions: Array<PickerOption | undefined>;
|
40 | selectedIndexes: number[];
|
41 | };
|
42 | export type PickerCancelEventParams = PickerConfirmEventParams;
|
43 | export type PickerChangeEventParams = PickerConfirmEventParams & {
|
44 | columnIndex: number;
|
45 | };
|
46 | export type PickerThemeVars = {
|
47 | pickerBackground?: string;
|
48 | pickerToolbarHeight?: string;
|
49 | pickerTitleFontSize?: string;
|
50 | pickerTitleLineHeight?: number | string;
|
51 | pickerActionPadding?: string;
|
52 | pickerActionFontSize?: string;
|
53 | pickerConfirmActionColor?: string;
|
54 | pickerCancelActionColor?: string;
|
55 | pickerOptionFontSize?: string;
|
56 | pickerOptionPadding?: string;
|
57 | pickerOptionTextColor?: string;
|
58 | pickerOptionDisabledOpacity?: number | string;
|
59 | pickerLoadingIconColor?: string;
|
60 | pickerLoadingMaskColor?: string;
|
61 | pickerMaskColor?: string;
|
62 | };
|