UNPKG

2.01 kBTypeScriptView Raw
1import type { ComponentPublicInstance } from 'vue';
2import type { Numeric } from '../utils';
3import type { PickerProps } from './Picker';
4export type PickerToolbarPosition = 'top' | 'bottom';
5export type PickerFieldNames = {
6 text?: string;
7 value?: string;
8 children?: string;
9};
10export type PickerOption = {
11 text?: Numeric;
12 value?: Numeric;
13 disabled?: boolean;
14 children?: PickerColumn;
15 className?: unknown;
16 [key: PropertyKey]: any;
17};
18export type PickerColumn = PickerOption[];
19export type PickerExpose = {
20 confirm: () => void;
21 getSelectedOptions: () => Array<PickerOption | undefined>;
22};
23export 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};
36export type PickerInstance = ComponentPublicInstance<PickerProps, PickerExpose>;
37export type PickerConfirmEventParams = {
38 selectedValues: Numeric[];
39 selectedOptions: Array<PickerOption | undefined>;
40 selectedIndexes: number[];
41};
42export type PickerCancelEventParams = PickerConfirmEventParams;
43export type PickerChangeEventParams = PickerConfirmEventParams & {
44 columnIndex: number;
45};
46export 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};