lew-ui 2.7.68 → 2.7.69

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,5 @@
1
1
  import { LewTreeDataSource } from '../../../../types';
2
2
  declare function reset(): void;
3
- declare function search(keyword: string): void;
4
3
  declare function __VLS_template(): {
5
4
  attrs: Partial<{}>;
6
5
  slots: {
@@ -86,22 +85,38 @@ declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractP
86
85
  validator: (value: any) => boolean;
87
86
  };
88
87
  modelValue: {
89
- type: globalThis.PropType<any>;
88
+ type: globalThis.PropType<string | string[]>;
90
89
  };
91
90
  expandKeys: {
92
- type: globalThis.PropType<never[]>;
91
+ type: globalThis.PropType<string[]>;
93
92
  };
94
93
  }>, {
95
- search: typeof search;
94
+ search: any;
96
95
  reset: typeof reset;
97
- getTree: () => any;
96
+ getTree: () => {
97
+ label: string;
98
+ key: string;
99
+ level: number;
100
+ isLeaf?: boolean | undefined;
101
+ loading?: boolean | undefined;
102
+ disabled?: boolean | undefined;
103
+ parentKey?: string | undefined;
104
+ treeIndex?: number | undefined;
105
+ labelPaths?: string[] | undefined;
106
+ valueKeys?: string[] | undefined;
107
+ parentKeyPaths?: string[] | undefined;
108
+ parentLabelPaths?: string[] | undefined;
109
+ allNodeValues: string[];
110
+ leafNodeValues: string[];
111
+ children?: /*elided*/ any[] | undefined;
112
+ }[];
98
113
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
99
114
  change: (data: any) => void;
100
115
  expand: (data: any) => void;
101
116
  loadStart: () => void;
102
117
  loadEnd: (text: string) => void;
103
- "update:modelValue": (value: any) => void;
104
- "update:expandKeys": (value: never[]) => void;
118
+ "update:modelValue": (value: string | string[]) => void;
119
+ "update:expandKeys": (value: string[]) => void;
105
120
  }, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
106
121
  dataSource: {
107
122
  type: PropType<LewTreeDataSource[]>;
@@ -178,18 +193,18 @@ declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractP
178
193
  validator: (value: any) => boolean;
179
194
  };
180
195
  modelValue: {
181
- type: globalThis.PropType<any>;
196
+ type: globalThis.PropType<string | string[]>;
182
197
  };
183
198
  expandKeys: {
184
- type: globalThis.PropType<never[]>;
199
+ type: globalThis.PropType<string[]>;
185
200
  };
186
201
  }>> & Readonly<{
187
202
  onChange?: ((data: any) => any) | undefined;
188
- "onUpdate:modelValue"?: ((value: any) => any) | undefined;
203
+ "onUpdate:modelValue"?: ((value: string | string[]) => any) | undefined;
189
204
  onExpand?: ((data: any) => any) | undefined;
190
205
  onLoadStart?: (() => any) | undefined;
191
206
  onLoadEnd?: ((text: string) => any) | undefined;
192
- "onUpdate:expandKeys"?: ((value: never[]) => any) | undefined;
207
+ "onUpdate:expandKeys"?: ((value: string[]) => any) | undefined;
193
208
  }>, {
194
209
  checkable: boolean;
195
210
  height: string;
@@ -3,7 +3,7 @@ declare function __VLS_template(): {
3
3
  slots: {
4
4
  item?(_: {
5
5
  props: {
6
- checked: any;
6
+ checked: boolean;
7
7
  certain: boolean;
8
8
  disabled: boolean;
9
9
  level: number;
@@ -0,0 +1,31 @@
1
+ import { LewTreeDataSource } from '../../../../types';
2
+ import { InjectionKey, Ref } from 'vue';
3
+ /**
4
+ * Tree 组件通过 provide/inject 传递的上下文类型
5
+ */
6
+ export interface TreeContext {
7
+ readonly multiple: boolean;
8
+ readonly checkable: boolean;
9
+ readonly expandAll: boolean;
10
+ readonly free: boolean;
11
+ readonly showLine: boolean;
12
+ readonly onlyLeafSelectable: boolean;
13
+ readonly keyField: string;
14
+ readonly labelField: string;
15
+ modelValue: Ref<string | string[] | undefined>;
16
+ expandKeys: Ref<string[]>;
17
+ dataSource: Ref<LewTreeDataSource[]>;
18
+ cacheDataSource: Ref<LewTreeDataSource[]>;
19
+ loadMethod?: (item: LewTreeDataSource) => void | Promise<LewTreeDataSource[]>;
20
+ treeSelection?: {
21
+ isSelected: (key: string) => boolean;
22
+ isIndeterminate: (key: string) => boolean;
23
+ toggleKey: (key: string) => void;
24
+ addKey: (key: string) => void;
25
+ removeKey: (key: string) => void;
26
+ };
27
+ }
28
+ /**
29
+ * Tree 组件的 Symbol Key,用于类型安全的 inject
30
+ */
31
+ export declare const TREE_INJECTION_KEY: InjectionKey<TreeContext>;