-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.d.ts
44 lines (44 loc) · 1.18 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
export type CascaderOptionsData = {
className?: string;
showTitle?: boolean;
disabled?: boolean;
children?: CascaderOptionsData[];
label: string;
value: string;
};
export type CascaderOptions = {
placeholder?: string;
showClear?: boolean;
mode?: "single" | "multiple";
data: CascaderOptionsData[];
displayRender?: (value: any[]) => string;
defaultValue?: any[];
onChange?: (value: any[], labelValue: any[], indexValue: any[]) => void;
};
export default class Cascader {
private container;
private uuid;
private splitStr;
private options;
private valValue;
private randomStr;
private query;
private queryAll;
private getSiblings;
private menusShow;
private menusHide;
private calculateElementWidth;
private selectItem;
private renderValue;
private getNextLevelData;
private transformValue;
private createMenu;
private event;
constructor(container: string, options: CascaderOptions);
init(): void;
setValue(value?: any[]): void;
get value(): any[];
get labelValue(): any;
get indexValue(): any;
}
export type CascaderInstance = InstanceType<typeof Cascader>;