bkui-vue 3.0.2 → 3.0.4

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.
package/lib/index.js CHANGED
@@ -3,5 +3,5 @@ export * from './hooks';
3
3
  export { default } from './preset';
4
4
  export * from './config-provider';
5
5
  export * from './directives';
6
- export const version = "3.0.2";
6
+ export const version = "3.0.4";
7
7
  window.__bkui_vue_version__ = version;
@@ -43,6 +43,9 @@ declare const BkSelect: {
43
43
  default: string;
44
44
  };
45
45
  allOptionId: import("vue-types").VueTypeDef<string | number>;
46
+ showAllDisabled: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/shared/vue-types.d8e57a80").b<boolean>> & {
47
+ default: boolean;
48
+ };
46
49
  showSelectAll: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/shared/vue-types.d8e57a80").b<boolean>> & {
47
50
  default: boolean;
48
51
  };
@@ -87,6 +90,9 @@ declare const BkSelect: {
87
90
  selectAllText: import("vue-types").VueTypeValidableDef<string, import("vue-types/dist/shared/vue-types.d8e57a80").b<string>> & {
88
91
  default: string;
89
92
  };
93
+ showSelectAllDisabled: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/shared/vue-types.d8e57a80").b<boolean>> & {
94
+ default: boolean;
95
+ };
90
96
  scrollLoading: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/shared/vue-types.d8e57a80").b<boolean>> & {
91
97
  default: boolean;
92
98
  };
@@ -796,9 +802,11 @@ declare const BkSelect: {
796
802
  selectAllText: string;
797
803
  showAll: boolean;
798
804
  allOptionText: string;
805
+ showAllDisabled: boolean;
799
806
  showSelectAll: boolean;
800
807
  multipleMode: string;
801
808
  autoHeight: boolean;
809
+ showSelectAllDisabled: boolean;
802
810
  scrollLoading: boolean;
803
811
  customContent: boolean;
804
812
  idKey: string;
@@ -861,6 +869,9 @@ declare const BkSelect: {
861
869
  default: string;
862
870
  };
863
871
  allOptionId: import("vue-types").VueTypeDef<string | number>;
872
+ showAllDisabled: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/shared/vue-types.d8e57a80").b<boolean>> & {
873
+ default: boolean;
874
+ };
864
875
  showSelectAll: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/shared/vue-types.d8e57a80").b<boolean>> & {
865
876
  default: boolean;
866
877
  };
@@ -905,6 +916,9 @@ declare const BkSelect: {
905
916
  selectAllText: import("vue-types").VueTypeValidableDef<string, import("vue-types/dist/shared/vue-types.d8e57a80").b<string>> & {
906
917
  default: string;
907
918
  };
919
+ showSelectAllDisabled: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/shared/vue-types.d8e57a80").b<boolean>> & {
920
+ default: boolean;
921
+ };
908
922
  scrollLoading: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/shared/vue-types.d8e57a80").b<boolean>> & {
909
923
  default: boolean;
910
924
  };
@@ -1614,9 +1628,11 @@ declare const BkSelect: {
1614
1628
  selectAllText: string;
1615
1629
  showAll: boolean;
1616
1630
  allOptionText: string;
1631
+ showAllDisabled: boolean;
1617
1632
  showSelectAll: boolean;
1618
1633
  multipleMode: string;
1619
1634
  autoHeight: boolean;
1635
+ showSelectAllDisabled: boolean;
1620
1636
  scrollLoading: boolean;
1621
1637
  customContent: boolean;
1622
1638
  idKey: string;
@@ -1674,6 +1690,9 @@ declare const BkSelect: {
1674
1690
  default: string;
1675
1691
  };
1676
1692
  allOptionId: import("vue-types").VueTypeDef<string | number>;
1693
+ showAllDisabled: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/shared/vue-types.d8e57a80").b<boolean>> & {
1694
+ default: boolean;
1695
+ };
1677
1696
  showSelectAll: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/shared/vue-types.d8e57a80").b<boolean>> & {
1678
1697
  default: boolean;
1679
1698
  };
@@ -1718,6 +1737,9 @@ declare const BkSelect: {
1718
1737
  selectAllText: import("vue-types").VueTypeValidableDef<string, import("vue-types/dist/shared/vue-types.d8e57a80").b<string>> & {
1719
1738
  default: string;
1720
1739
  };
1740
+ showSelectAllDisabled: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/shared/vue-types.d8e57a80").b<boolean>> & {
1741
+ default: boolean;
1742
+ };
1721
1743
  scrollLoading: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/shared/vue-types.d8e57a80").b<boolean>> & {
1722
1744
  default: boolean;
1723
1745
  };
@@ -2302,9 +2324,11 @@ declare const BkSelect: {
2302
2324
  selectAllText: string;
2303
2325
  showAll: boolean;
2304
2326
  allOptionText: string;
2327
+ showAllDisabled: boolean;
2305
2328
  showSelectAll: boolean;
2306
2329
  multipleMode: string;
2307
2330
  autoHeight: boolean;
2331
+ showSelectAllDisabled: boolean;
2308
2332
  scrollLoading: boolean;
2309
2333
  customContent: boolean;
2310
2334
  idKey: string;
@@ -42,6 +42,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
42
42
  default: string;
43
43
  };
44
44
  allOptionId: import("vue-types").VueTypeDef<string | number>;
45
+ showAllDisabled: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/shared/vue-types.d8e57a80").b<boolean>> & {
46
+ default: boolean;
47
+ };
45
48
  showSelectAll: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/shared/vue-types.d8e57a80").b<boolean>> & {
46
49
  default: boolean;
47
50
  };
@@ -86,6 +89,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
86
89
  selectAllText: import("vue-types").VueTypeValidableDef<string, import("vue-types/dist/shared/vue-types.d8e57a80").b<string>> & {
87
90
  default: string;
88
91
  };
92
+ showSelectAllDisabled: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/shared/vue-types.d8e57a80").b<boolean>> & {
93
+ default: boolean;
94
+ };
89
95
  scrollLoading: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/shared/vue-types.d8e57a80").b<boolean>> & {
90
96
  default: boolean;
91
97
  };
@@ -667,6 +673,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
667
673
  default: string;
668
674
  };
669
675
  allOptionId: import("vue-types").VueTypeDef<string | number>;
676
+ showAllDisabled: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/shared/vue-types.d8e57a80").b<boolean>> & {
677
+ default: boolean;
678
+ };
670
679
  showSelectAll: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/shared/vue-types.d8e57a80").b<boolean>> & {
671
680
  default: boolean;
672
681
  };
@@ -711,6 +720,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
711
720
  selectAllText: import("vue-types").VueTypeValidableDef<string, import("vue-types/dist/shared/vue-types.d8e57a80").b<string>> & {
712
721
  default: string;
713
722
  };
723
+ showSelectAllDisabled: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/shared/vue-types.d8e57a80").b<boolean>> & {
724
+ default: boolean;
725
+ };
714
726
  scrollLoading: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/shared/vue-types.d8e57a80").b<boolean>> & {
715
727
  default: boolean;
716
728
  };
@@ -829,9 +841,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
829
841
  selectAllText: string;
830
842
  showAll: boolean;
831
843
  allOptionText: string;
844
+ showAllDisabled: boolean;
832
845
  showSelectAll: boolean;
833
846
  multipleMode: string;
834
847
  autoHeight: boolean;
848
+ showSelectAllDisabled: boolean;
835
849
  scrollLoading: boolean;
836
850
  customContent: boolean;
837
851
  idKey: string;
@@ -1,4 +1,5 @@
1
- import { ExtractPropTypes, PropType, VNode } from 'vue';
1
+ import { ComputedRef, ExtractPropTypes, InjectionKey, PropType, VNode } from 'vue';
2
+ export declare const tabActiveInjectionKey: InjectionKey<ComputedRef<number | string>>;
2
3
  export declare enum TabTypeEnum {
3
4
  BORDER_CARD = "border-card",
4
5
  CARD = "card",
@@ -69,11 +70,7 @@ export declare const tabPanelProps: {
69
70
  name: import("vue-types").VueTypeDef<string | number> & {
70
71
  default: string | number;
71
72
  };
72
- label: (import("vue-types").VueTypeValidableDef<string, import("vue-types/dist/shared/vue-types.d8e57a80").b<string>> & {
73
- default: string;
74
- }) | (import("vue-types").VueTypeValidableDef<(...args: any[]) => any, import("vue-types/dist/shared/vue-types.d8e57a80").b<(...args: any[]) => any>> & {
75
- default: (...args: any[]) => any;
76
- });
73
+ label: import("vue-types").VueTypeDef<any>;
77
74
  tips: import("vue-types").VueTypeValidableDef<string, import("vue-types/dist/shared/vue-types.d8e57a80").b<string>> & {
78
75
  default: string;
79
76
  };
@@ -86,11 +83,7 @@ export declare const tabPanelProps: {
86
83
  renderDirective: import("vue-types").VueTypeValidableDef<"if" | "show", import("vue-types/dist/shared/vue-types.d8e57a80").b<"if" | "show">> & {
87
84
  default: "if" | "show";
88
85
  };
89
- panel: (import("vue-types").VueTypeValidableDef<string, import("vue-types/dist/shared/vue-types.d8e57a80").b<string>> & {
90
- default: string;
91
- }) | (import("vue-types").VueTypeValidableDef<(...args: any[]) => any, import("vue-types/dist/shared/vue-types.d8e57a80").b<(...args: any[]) => any>> & {
92
- default: (...args: any[]) => any;
93
- });
86
+ panel: import("vue-types").VueTypeDef<any>;
94
87
  num: import("vue-types").VueTypeValidableDef<number, import("vue-types/dist/shared/vue-types.d8e57a80").b<number>> & {
95
88
  default: number;
96
89
  } & {
@@ -1,12 +1,9 @@
1
+ import { ComputedRef } from 'vue';
1
2
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
3
  name: import("vue-types").VueTypeDef<string | number> & {
3
4
  default: string | number;
4
5
  };
5
- label: (import("vue-types").VueTypeValidableDef<string, import("vue-types/dist/shared/vue-types.d8e57a80").b<string>> & {
6
- default: string;
7
- }) | (import("vue-types").VueTypeValidableDef<(...args: any[]) => any, import("vue-types/dist/shared/vue-types.d8e57a80").b<(...args: any[]) => any>> & {
8
- default: (...args: any[]) => any;
9
- });
6
+ label: import("vue-types").VueTypeDef<any>;
10
7
  tips: import("vue-types").VueTypeValidableDef<string, import("vue-types/dist/shared/vue-types.d8e57a80").b<string>> & {
11
8
  default: string;
12
9
  };
@@ -19,11 +16,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
19
16
  renderDirective: import("vue-types").VueTypeValidableDef<"if" | "show", import("vue-types/dist/shared/vue-types.d8e57a80").b<"if" | "show">> & {
20
17
  default: "if" | "show";
21
18
  };
22
- panel: (import("vue-types").VueTypeValidableDef<string, import("vue-types/dist/shared/vue-types.d8e57a80").b<string>> & {
23
- default: string;
24
- }) | (import("vue-types").VueTypeValidableDef<(...args: any[]) => any, import("vue-types/dist/shared/vue-types.d8e57a80").b<(...args: any[]) => any>> & {
25
- default: (...args: any[]) => any;
26
- });
19
+ panel: import("vue-types").VueTypeDef<any>;
27
20
  num: import("vue-types").VueTypeValidableDef<number, import("vue-types/dist/shared/vue-types.d8e57a80").b<number>> & {
28
21
  default: number;
29
22
  } & {
@@ -34,15 +27,13 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
34
27
  } & {
35
28
  default: string;
36
29
  };
37
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
30
+ }>, {
31
+ tabActive: ComputedRef<string | number>;
32
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
38
33
  name: import("vue-types").VueTypeDef<string | number> & {
39
34
  default: string | number;
40
35
  };
41
- label: (import("vue-types").VueTypeValidableDef<string, import("vue-types/dist/shared/vue-types.d8e57a80").b<string>> & {
42
- default: string;
43
- }) | (import("vue-types").VueTypeValidableDef<(...args: any[]) => any, import("vue-types/dist/shared/vue-types.d8e57a80").b<(...args: any[]) => any>> & {
44
- default: (...args: any[]) => any;
45
- });
36
+ label: import("vue-types").VueTypeDef<any>;
46
37
  tips: import("vue-types").VueTypeValidableDef<string, import("vue-types/dist/shared/vue-types.d8e57a80").b<string>> & {
47
38
  default: string;
48
39
  };
@@ -55,11 +46,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
55
46
  renderDirective: import("vue-types").VueTypeValidableDef<"if" | "show", import("vue-types/dist/shared/vue-types.d8e57a80").b<"if" | "show">> & {
56
47
  default: "if" | "show";
57
48
  };
58
- panel: (import("vue-types").VueTypeValidableDef<string, import("vue-types/dist/shared/vue-types.d8e57a80").b<string>> & {
59
- default: string;
60
- }) | (import("vue-types").VueTypeValidableDef<(...args: any[]) => any, import("vue-types/dist/shared/vue-types.d8e57a80").b<(...args: any[]) => any>> & {
61
- default: (...args: any[]) => any;
62
- });
49
+ panel: import("vue-types").VueTypeDef<any>;
63
50
  num: import("vue-types").VueTypeValidableDef<number, import("vue-types/dist/shared/vue-types.d8e57a80").b<number>> & {
64
51
  default: number;
65
52
  } & {
@@ -72,11 +59,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
72
59
  };
73
60
  }>> & Readonly<{}>, {
74
61
  name: string | number;
75
- label: string | ((...args: any[]) => any);
76
62
  visible: boolean;
77
63
  renderDirective: "if" | "show";
78
64
  tips: string;
79
- panel: string | ((...args: any[]) => any);
80
65
  num: number;
81
66
  numDisplayType: string;
82
67
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -33,6 +33,9 @@ declare const BkTree: {
33
33
  virtualRender: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/shared/vue-types.d8e57a80").b<boolean>> & {
34
34
  default: boolean;
35
35
  };
36
+ watchDataDeep: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/shared/vue-types.d8e57a80").b<boolean>> & {
37
+ default: boolean;
38
+ };
36
39
  prefixIcon: import("vue-types").VueTypeDef<any> & {
37
40
  default: any;
38
41
  };
@@ -166,6 +169,7 @@ declare const BkTree: {
166
169
  indent: number;
167
170
  levelLine: any;
168
171
  virtualRender: boolean;
172
+ watchDataDeep: boolean;
169
173
  disableDrag: (...args: any[]) => any;
170
174
  dragThreshold: number;
171
175
  dragSort: boolean;
@@ -224,6 +228,9 @@ declare const BkTree: {
224
228
  virtualRender: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/shared/vue-types.d8e57a80").b<boolean>> & {
225
229
  default: boolean;
226
230
  };
231
+ watchDataDeep: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/shared/vue-types.d8e57a80").b<boolean>> & {
232
+ default: boolean;
233
+ };
227
234
  prefixIcon: import("vue-types").VueTypeDef<any> & {
228
235
  default: any;
229
236
  };
@@ -342,6 +349,7 @@ declare const BkTree: {
342
349
  indent: number;
343
350
  levelLine: any;
344
351
  virtualRender: boolean;
352
+ watchDataDeep: boolean;
345
353
  disableDrag: (...args: any[]) => any;
346
354
  dragThreshold: number;
347
355
  dragSort: boolean;
@@ -397,6 +405,9 @@ declare const BkTree: {
397
405
  virtualRender: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/shared/vue-types.d8e57a80").b<boolean>> & {
398
406
  default: boolean;
399
407
  };
408
+ watchDataDeep: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/shared/vue-types.d8e57a80").b<boolean>> & {
409
+ default: boolean;
410
+ };
400
411
  prefixIcon: import("vue-types").VueTypeDef<any> & {
401
412
  default: any;
402
413
  };
@@ -530,6 +541,7 @@ declare const BkTree: {
530
541
  indent: number;
531
542
  levelLine: any;
532
543
  virtualRender: boolean;
544
+ watchDataDeep: boolean;
533
545
  disableDrag: (...args: any[]) => any;
534
546
  dragThreshold: number;
535
547
  dragSort: boolean;
@@ -144,6 +144,14 @@ export declare const treeProps: {
144
144
  virtualRender: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/shared/vue-types.d8e57a80").b<boolean>> & {
145
145
  default: boolean;
146
146
  };
147
+ /**
148
+ * 是否深度监听 data 内部变更(原地 push/改 children 等)
149
+ * 默认 false:仅监听 data 引用变化,大数据量下性能更好
150
+ * 若业务依赖「不换引用、原地改树」自动刷新,可设为 true(小数据场景)
151
+ */
152
+ watchDataDeep: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/shared/vue-types.d8e57a80").b<boolean>> & {
153
+ default: boolean;
154
+ };
147
155
  /**
148
156
  * 当前节点标识图标
149
157
  * 默认 true
@@ -38,6 +38,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
38
38
  virtualRender: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/shared/vue-types.d8e57a80").b<boolean>> & {
39
39
  default: boolean;
40
40
  };
41
+ watchDataDeep: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/shared/vue-types.d8e57a80").b<boolean>> & {
42
+ default: boolean;
43
+ };
41
44
  prefixIcon: import("vue-types").VueTypeDef<any> & {
42
45
  default: any;
43
46
  };
@@ -174,6 +177,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
174
177
  virtualRender: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/shared/vue-types.d8e57a80").b<boolean>> & {
175
178
  default: boolean;
176
179
  };
180
+ watchDataDeep: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/shared/vue-types.d8e57a80").b<boolean>> & {
181
+ default: boolean;
182
+ };
177
183
  prefixIcon: import("vue-types").VueTypeDef<any> & {
178
184
  default: any;
179
185
  };
@@ -292,6 +298,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
292
298
  indent: number;
293
299
  levelLine: any;
294
300
  virtualRender: boolean;
301
+ watchDataDeep: boolean;
295
302
  disableDrag: (...args: any[]) => any;
296
303
  dragThreshold: number;
297
304
  dragSort: boolean;
@@ -0,0 +1,29 @@
1
+ import { TreeNode } from './props';
2
+ import { IFlatData } from './util';
3
+ type CheckedHelpers = {
4
+ getChildNodes: (node: TreeNode) => TreeNode[];
5
+ getNodeAttr: (node: TreeNode, attr: string) => unknown;
6
+ getParentNode: (node: TreeNode) => TreeNode | null | undefined;
7
+ getSchemaVal: (node: TreeNode) => Record<string, unknown> | undefined;
8
+ isRootNode: (node: TreeNode) => boolean;
9
+ };
10
+ /**
11
+ * 勾选状态增量维护:
12
+ * - checked/indeterminate 用 Set 跟踪,避免每次 emit 全表 filter O(N)
13
+ * - 子树更新按 flatData 的 DFS 连续区间扫描,避免递归调用开销
14
+ */
15
+ declare const _default: (flatData: IFlatData, helpers: CheckedHelpers) => {
16
+ checkedSet: Set<TreeNode>;
17
+ indeterminateSet: Set<TreeNode>;
18
+ syncNodeToSets: (node: TreeNode) => void;
19
+ setNodeCheckedState: (node: TreeNode, checked: boolean, indeterminate?: boolean) => boolean;
20
+ setDescendantChecked: (node: TreeNode, checked: boolean) => void;
21
+ forEachDescendant: (node: TreeNode, fn: (child: TreeNode) => void) => void;
22
+ updateParentChecked: (item: TreeNode) => void;
23
+ getCheckedEmitPayload: () => [TreeNode[], TreeNode[]];
24
+ rebuildCheckedSets: () => void;
25
+ rebuildCheckedSetsFromList: (nodes?: TreeNode[]) => void;
26
+ clearAllCheckedState: () => void;
27
+ isNodeIndeterminate: (node: TreeNode) => boolean;
28
+ };
29
+ export default _default;
@@ -12,6 +12,13 @@ declare const _default: (props: TreePropTypes, ctx: any, flatData: IFlatData, _r
12
12
  setNodeAttribute: (node: TreeNode, attrName: string | string[], value: (boolean | number | string)[] | boolean | number | string, loopParent?: boolean) => void;
13
13
  isIndeterminate: (item: TreeNode) => boolean;
14
14
  deepUpdateChildNode: (node: TreeNode, attr: string | string[], value: unknown | unknown[]) => void;
15
- updateParentChecked: (item: TreeNode, isChecked: any) => void;
15
+ updateParentChecked: (item: TreeNode) => void;
16
+ applyCheckedChange: (item: TreeNode, value: boolean, options?: {
17
+ emitEvent?: boolean;
18
+ refresh?: boolean;
19
+ }) => void;
20
+ emitCheckedChange: () => void;
21
+ rebuildCheckedSetsFromList: (nodes?: TreeNode[]) => void;
22
+ clearAllCheckedState: () => void;
16
23
  };
17
24
  export default _default;
@@ -21,13 +21,24 @@ type TreeNodeAttributeMap = {
21
21
  [NODE_ATTRIBUTES.TREE_NODE_ATTR]: Record<string, unknown>;
22
22
  [NODE_ATTRIBUTES.UUID]: string | number;
23
23
  };
24
+ type SetNodeAttrOptions = {
25
+ /** 跳过 UI 刷新通知(批量更新时使用) */
26
+ silent?: boolean;
27
+ };
28
+ type UseNodeAttributeOptions = {
29
+ /** schema 变更后的 UI 刷新(schema 已 markRaw,需显式通知) */
30
+ onSchemaChange?: (node: TreeNode, attr: string, val: unknown) => void;
31
+ };
24
32
  declare const _default: (flatData: {
25
33
  data: TreeNode[];
26
34
  schema: WeakMap<TreeNode, Record<string, unknown>>;
27
35
  nodeMap?: Map<number | string, TreeNode>;
28
36
  childMap?: WeakMap<TreeNode, TreeNode[]>;
29
37
  rootNodes?: TreeNode[];
30
- }, props?: TreePropTypes) => {
38
+ openCount?: number;
39
+ notifySchemaChange?: (node: TreeNode, attr: string, val: unknown) => void;
40
+ syncCheckedState?: (node: TreeNode) => void;
41
+ }, props?: TreePropTypes, options?: UseNodeAttributeOptions) => {
31
42
  getSchemaVal: (node: TreeNode) => Record<string, unknown>;
32
43
  getNodeAttr: {
33
44
  <T extends NODE_ATTRIBUTES>(node: TreeNode | null | undefined, attr: T): TreeNodeAttributeMap[T] | undefined;
@@ -45,17 +56,17 @@ declare const _default: (flatData: {
45
56
  getRootNodeList: () => TreeNode[];
46
57
  getParentNodeAttr: (node: TreeNode, attrName: string) => unknown;
47
58
  getParentNode: (node: TreeNode) => TreeNode;
48
- setNodeAttr: (node: TreeNode, attr: string, val: unknown, id?: any) => void;
59
+ setNodeAttr: (node: TreeNode, attr: string, val: unknown, id?: any, setOptions?: SetNodeAttrOptions) => void;
49
60
  setNodeAttrById: (id: unknown, attr: string, val: unknown) => void;
50
61
  getNodePath: (node: TreeNode) => string;
51
62
  isRootNode: (node: TreeNode | string) => boolean;
52
63
  isNodeOpened: (node: TreeNode) => boolean;
53
64
  hasChildNode: (node: TreeNode) => boolean;
54
- isItemOpen: (item: TreeNode) => unknown;
65
+ isItemOpen: (item: TreeNode) => boolean;
55
66
  isNodeChecked: (node: TreeNode) => boolean;
56
67
  isNodeMatched: (node: TreeNode) => boolean;
57
68
  isNodeLoading: (node: TreeNode) => boolean;
58
- checkNodeIsOpen: (node: TreeNode) => unknown;
69
+ checkNodeIsOpen: (node: TreeNode) => boolean;
59
70
  getSourceNodeByPath: (path: string, uid?: string) => any[];
60
71
  getSourceNodeByUID: (uid: string) => TreeNode;
61
72
  isMatchedNode: (node: TreeNode) => boolean;
@@ -1,30 +1,13 @@
1
1
  import { TreeNode, TreePropTypes } from './props';
2
+ import { IFlatData } from './util';
2
3
  declare const _default: (props: TreePropTypes) => {
3
- flatData: {
4
- data: {
5
- [x: string]: unknown;
6
- children?: /*elided*/ any[];
7
- }[];
8
- schema: WeakMap<TreeNode, Record<string, unknown>> & Omit<WeakMap<TreeNode, Record<string, unknown>>, keyof WeakMap<any, any>>;
9
- nodeMap: Map<string, {
10
- [x: string]: unknown;
11
- children?: /*elided*/ any[];
12
- }> & Omit<Map<string, TreeNode>, keyof Map<any, any>>;
13
- childMap: WeakMap<TreeNode, {
14
- [x: string]: unknown;
15
- children?: /*elided*/ any[];
16
- }[]> & Omit<WeakMap<TreeNode, TreeNode[]>, keyof WeakMap<any, any>>;
17
- rootNodes: {
18
- [x: string]: unknown;
19
- children?: /*elided*/ any[];
20
- }[];
21
- levelLineSchema: {};
22
- };
4
+ flatData: import("vue").ShallowReactive<IFlatData>;
23
5
  asyncNodeClick: (item: TreeNode) => Promise<boolean | (TreeNode | TreeNode[])>;
24
6
  deepAutoOpen: () => void;
25
7
  afterDataUpdate: (callFn: (d: any) => void) => void;
26
8
  registerNextLoop: (key: string, event: any, reset?: boolean) => void;
27
- rebuildData: (treeData: TreeNode[], cachedSchema?: WeakMap<TreeNode, Record<string, unknown>> & Omit<WeakMap<TreeNode, Record<string, unknown>>, keyof WeakMap<any, any>>) => void;
9
+ rebuildData: (treeData: TreeNode[], cachedSchema?: WeakMap<TreeNode, Record<string, unknown>>) => void;
10
+ onAfterRebuild: (callback: () => void) => void;
28
11
  onSelected: (event: (d: any) => void) => void;
29
12
  };
30
13
  export default _default;
@@ -0,0 +1,27 @@
1
+ import { type ShallowRef } from 'vue';
2
+ import { TreeNode } from './props';
3
+ import { IFlatData } from './util';
4
+ type VisibleNodeHelpers = {
5
+ checkNodeIsOpen: (node: TreeNode) => boolean;
6
+ getChildNodes: (node: TreeNode) => TreeNode[];
7
+ getNodeAttr: (node: TreeNode, attr: string) => unknown;
8
+ getNodePath: (node: TreeNode) => string;
9
+ getNodeOrder: (node: TreeNode) => number;
10
+ getSchemaVal: (node: TreeNode) => Record<string, unknown> | undefined;
11
+ isNodeOpened: (node: TreeNode) => boolean;
12
+ };
13
+ /**
14
+ * 增量维护树的可见节点列表,避免每次展开都对全量 flatData 做 O(N) filter。
15
+ * 展开/收起复杂度接近 O(受影响的可见子节点数),禁止回退到全表扫描。
16
+ */
17
+ declare const _default: (flatData: IFlatData, helpers: VisibleNodeHelpers) => {
18
+ visibleNodes: ShallowRef<TreeNode[]>;
19
+ uiVersion: ShallowRef<number, number>;
20
+ rebuildVisibleNodes: (filterFn?: (node: TreeNode) => boolean) => void;
21
+ expandVisibleNode: (node: TreeNode) => void;
22
+ collapseVisibleNode: (node: TreeNode) => void;
23
+ syncNodeOpenState: (node: TreeNode, isOpen: boolean) => void;
24
+ scheduleUiRefresh: () => void;
25
+ };
26
+ export default _default;
27
+ export type { VisibleNodeHelpers };
@@ -6,6 +6,15 @@ export type IFlatData = {
6
6
  nodeMap?: Map<TreeNodeKey, TreeNode>;
7
7
  childMap?: WeakMap<TreeNode, TreeNode[]>;
8
8
  rootNodes?: TreeNode[];
9
+ /** 当前 IS_OPEN=true 的节点数,用于可见列表快速重建 */
10
+ openCount?: number;
11
+ /** flatten 阶段收集的初始勾选节点 */
12
+ checkedList?: TreeNode[];
13
+ levelLineSchema?: Record<string, unknown>;
14
+ /** schema 已 markRaw 时,用于通知 UI 刷新 */
15
+ notifySchemaChange?: (node: TreeNode, attr: string, val: unknown) => void;
16
+ /** 勾选相关 schema 变更后同步增量 Set */
17
+ syncCheckedState?: (node: TreeNode) => void;
9
18
  };
10
19
  /**
11
20
  * 获取当前节点显示Label
@@ -32,14 +41,9 @@ export declare const getTreeStyle: (item: TreeNode, props: TreePropTypes) => {
32
41
  * @returns
33
42
  */
34
43
  export declare const getNodeItemStyle: (item: TreeNode, props: TreePropTypes, flatData: IFlatData, showTree?: boolean) => {};
35
- /**
36
- * 获取当前渲染节点Class List
37
- * @param item
38
- * @returns
39
- */
40
44
  export declare const getNodeItemClass: (item: TreeNode, schema: WeakMap<TreeNode, Record<string, unknown>>, props: TreePropTypes, showTree?: boolean) => {
41
45
  [x: string]: unknown;
42
- 'is-root': unknown;
46
+ 'is-root': boolean;
43
47
  'is-open': unknown;
44
48
  'is-virtual-render': boolean;
45
49
  'level-line': boolean;
@@ -3875,6 +3875,8 @@ function select_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.l
3875
3875
  // 全部选项文本
3876
3876
  allOptionId: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.oneOfType([__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.number, __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.string]),
3877
3877
  // 全部选项ID
3878
+ showAllDisabled: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.bool.def(false),
3879
+ // 全部选项是否禁用
3878
3880
  showSelectAll: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.bool.def(false),
3879
3881
  // 全选
3880
3882
  popoverMinWidth: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.number.def(0),
@@ -3896,6 +3898,8 @@ function select_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.l
3896
3898
  placeholder: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.string,
3897
3899
  searchPlaceholder: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.string,
3898
3900
  selectAllText: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.string,
3901
+ showSelectAllDisabled: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.bool.def(false),
3902
+ // 全选选项是否禁用
3899
3903
  scrollLoading: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.bool.def(false),
3900
3904
  allowCreate: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.bool.def(false),
3901
3905
  // 是否运行创建自定义选项
@@ -3969,6 +3973,7 @@ function select_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.l
3969
3973
  enableVirtualRender = _toRefs.enableVirtualRender,
3970
3974
  showSelectAll = _toRefs.showSelectAll,
3971
3975
  showAll = _toRefs.showAll,
3976
+ showAllDisabled = _toRefs.showAllDisabled,
3972
3977
  allOptionId = _toRefs.allOptionId,
3973
3978
  scrollHeight = _toRefs.scrollHeight,
3974
3979
  list = _toRefs.list,
@@ -3986,7 +3991,8 @@ function select_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.l
3986
3991
  highlightKeyword = _toRefs.highlightKeyword,
3987
3992
  disableFocusBehavior = _toRefs.disableFocusBehavior,
3988
3993
  trigger = _toRefs.trigger,
3989
- disableScrollToSelectedOption = _toRefs.disableScrollToSelectedOption;
3994
+ disableScrollToSelectedOption = _toRefs.disableScrollToSelectedOption,
3995
+ showSelectAllDisabled = _toRefs.showSelectAllDisabled;
3990
3996
  var virtualRenderRef = __WEBPACK_EXTERNAL_MODULE_vue_ref__(null);
3991
3997
  var displayAllText = __WEBPACK_EXTERNAL_MODULE_vue_computed__(function () {
3992
3998
  return props.allOptionText;
@@ -4707,6 +4713,7 @@ function select_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.l
4707
4713
  };
4708
4714
  // 全选/取消全选
4709
4715
  var toggleSelectAll = function toggleSelectAll() {
4716
+ if (showSelectAllDisabled.value) return;
4710
4717
  if (isAllSelected.value) {
4711
4718
  selected.value = [];
4712
4719
  } else {
@@ -4735,6 +4742,7 @@ function select_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.l
4735
4742
  // 全部/取消全部
4736
4743
  var toggleAll = function toggleAll() {
4737
4744
  if (!isShowAll.value) return;
4745
+ if (showAllDisabled.value) return;
4738
4746
  var index = selected.value.findIndex(function (item) {
4739
4747
  return item.value === allOptionId.value;
4740
4748
  });
@@ -5255,11 +5263,12 @@ function select_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.l
5255
5263
  var renderSelectAll = function renderSelectAll() {
5256
5264
  if (!_this.isShowSelectAll) return;
5257
5265
  return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("li", {
5258
- "class": _this.resolveClassName('select-option'),
5259
- "onClick": _this.toggleSelectAll,
5266
+ "class": [_this.resolveClassName('select-option'), _this.showSelectAllDisabled ? 'is-disabled' : ''],
5267
+ "onClick": _this.showSelectAllDisabled ? undefined : _this.toggleSelectAll,
5260
5268
  "onMouseenter": _this.handleSelectedAllOptionMouseEnter
5261
5269
  }, [_this.selectedStyle === 'checkbox' && __WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_checkbox_13b1cb4a_default__, {
5262
5270
  "class": _this.resolveClassName('select-checkbox'),
5271
+ "disabled": _this.showSelectAllDisabled,
5263
5272
  "indeterminate": !_this.isAllSelected && !!_this.selected.length && !_this.isAll,
5264
5273
  "modelValue": _this.isAllSelected
5265
5274
  }, null), _this.localSelectAllText]);
@@ -5282,8 +5291,8 @@ function select_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.l
5282
5291
  return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
5283
5292
  "class": _this.resolveClassName('select-all')
5284
5293
  }, [__WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
5285
- "class": ['wrapper', _this.selected.length === 1 && ((_this$selected$ = _this.selected[0]) === null || _this$selected$ === void 0 ? void 0 : _this$selected$.value) === _this.allOptionId ? 'active' : ''],
5286
- "onClick": _this.toggleAll
5294
+ "class": ['wrapper', _this.selected.length === 1 && ((_this$selected$ = _this.selected[0]) === null || _this$selected$ === void 0 ? void 0 : _this$selected$.value) === _this.allOptionId ? 'active' : '', _this.showAllDisabled ? 'is-disabled' : ''],
5295
+ "onClick": _this.showAllDisabled ? undefined : _this.toggleAll
5287
5296
  }, [renderAllIcon(), renderAllText()])]);
5288
5297
  };
5289
5298
  // 默认trigger输入框渲染
@@ -322,6 +322,13 @@
322
322
  color: #3a84ff;
323
323
  background-color: #e1ecff;
324
324
  }
325
+ .bk-popover.bk-pop2-content.bk-select-popover .bk-select-content-wrapper .bk-select-all .wrapper.is-disabled {
326
+ color: #c4c6cc;
327
+ cursor: not-allowed;
328
+ }
329
+ .bk-popover.bk-pop2-content.bk-select-popover .bk-select-content-wrapper .bk-select-all .wrapper.is-disabled:hover {
330
+ background-color: transparent;
331
+ }
325
332
  .bk-popover.bk-pop2-content.bk-select-popover .bk-select-content-wrapper .bk-select-all .wrapper .select-all-icon {
326
333
  margin-right: 4px;
327
334
  font-size: 16px;