cnhis-design-vue 3.3.3-beta.13 → 3.3.3-beta.16
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/es/components/expand-field/index.d.ts +84 -3
- package/es/components/expand-field/src/components/FormItemPerson.vue.d.ts +84 -3
- package/es/components/expand-field/src/components/PersonModal.vue.d.ts +84 -3
- package/es/components/expand-field/src/components/form.vue.d.ts +84 -3
- package/es/components/expand-field/src/index.vue.d.ts +84 -3
- package/es/components/select-person/index.d.ts +84 -3
- package/es/components/select-person/src/SelectPerson.vue.d.ts +83 -2
- package/es/components/select-person/src/SelectPerson.vue2.js +27 -16
- package/es/components/select-person/src/components/GroupItem.vue.d.ts +19 -0
- package/es/components/select-person/src/components/GroupItem.vue.js +6 -0
- package/es/components/select-person/src/components/GroupItem.vue2.js +37 -0
- package/es/components/select-person/src/components/SearchGroupList.vue.d.ts +82 -0
- package/es/components/select-person/src/components/SearchGroupList.vue2.js +34 -5
- package/es/components/select-person/src/index.vue.d.ts +87 -5
- package/es/components/select-person/src/index.vue2.js +2 -2
- package/es/components/select-person/src/utils/index.d.ts +2 -0
- package/es/components/select-person/src/utils/index.js +24 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
- package/es/components/select-person/src/SelectPersonTest.vue.d.ts +0 -555
|
@@ -13,6 +13,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
13
13
|
}[]>;
|
|
14
14
|
required: true;
|
|
15
15
|
};
|
|
16
|
+
getChildren: {
|
|
17
|
+
type: FunctionConstructor;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
showTagHover: {
|
|
21
|
+
type: BooleanConstructor;
|
|
22
|
+
default: boolean;
|
|
23
|
+
};
|
|
16
24
|
type: {
|
|
17
25
|
type: StringConstructor;
|
|
18
26
|
default: string;
|
|
@@ -32,6 +40,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
32
40
|
}[]>;
|
|
33
41
|
required: true;
|
|
34
42
|
};
|
|
43
|
+
getChildren: {
|
|
44
|
+
type: FunctionConstructor;
|
|
45
|
+
required: true;
|
|
46
|
+
};
|
|
47
|
+
showTagHover: {
|
|
48
|
+
type: BooleanConstructor;
|
|
49
|
+
default: boolean;
|
|
50
|
+
};
|
|
35
51
|
type: {
|
|
36
52
|
type: StringConstructor;
|
|
37
53
|
default: string;
|
|
@@ -52,6 +68,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
52
68
|
handleChange: (item: AnyObject, checked: boolean) => void;
|
|
53
69
|
NVirtualList: any;
|
|
54
70
|
NCheckbox: any;
|
|
71
|
+
NPopover: any;
|
|
55
72
|
CDefaultPage: import("../../../../shared/types").SFCWithInstall<import("vue").DefineComponent<{
|
|
56
73
|
type: {
|
|
57
74
|
type: StringConstructor;
|
|
@@ -107,6 +124,62 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
107
124
|
type: string;
|
|
108
125
|
config: AnyObject;
|
|
109
126
|
}>>;
|
|
127
|
+
GroupItem: import("vue").DefineComponent<{
|
|
128
|
+
item: {
|
|
129
|
+
type: PropType<AnyObject>;
|
|
130
|
+
required: true;
|
|
131
|
+
};
|
|
132
|
+
}, {
|
|
133
|
+
emit: (event: "checked", ...args: any[]) => void;
|
|
134
|
+
handleClick: (item: AnyObject) => void;
|
|
135
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "checked"[], "checked", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
136
|
+
item: {
|
|
137
|
+
type: PropType<AnyObject>;
|
|
138
|
+
required: true;
|
|
139
|
+
};
|
|
140
|
+
}>> & {
|
|
141
|
+
onChecked?: ((...args: any[]) => any) | undefined;
|
|
142
|
+
}, {}>;
|
|
143
|
+
TagItem: import("vue").DefineComponent<{
|
|
144
|
+
tag: {
|
|
145
|
+
type: PropType<AnyObject>;
|
|
146
|
+
required: true;
|
|
147
|
+
};
|
|
148
|
+
showClose: {
|
|
149
|
+
type: BooleanConstructor;
|
|
150
|
+
default: boolean;
|
|
151
|
+
};
|
|
152
|
+
}, {
|
|
153
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
154
|
+
tag: {
|
|
155
|
+
type: PropType<AnyObject>;
|
|
156
|
+
required: true;
|
|
157
|
+
};
|
|
158
|
+
showClose: {
|
|
159
|
+
type: BooleanConstructor;
|
|
160
|
+
default: boolean;
|
|
161
|
+
};
|
|
162
|
+
}>> & {
|
|
163
|
+
onUnchecked?: ((...args: any[]) => any) | undefined;
|
|
164
|
+
}>>;
|
|
165
|
+
emit: (event: "unchecked", ...args: any[]) => void;
|
|
166
|
+
updateChecked: (key: string, checked: boolean) => void;
|
|
167
|
+
NIcon: any;
|
|
168
|
+
CloseCircleSharp: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
169
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "unchecked"[], "unchecked", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
170
|
+
tag: {
|
|
171
|
+
type: PropType<AnyObject>;
|
|
172
|
+
required: true;
|
|
173
|
+
};
|
|
174
|
+
showClose: {
|
|
175
|
+
type: BooleanConstructor;
|
|
176
|
+
default: boolean;
|
|
177
|
+
};
|
|
178
|
+
}>> & {
|
|
179
|
+
onUnchecked?: ((...args: any[]) => any) | undefined;
|
|
180
|
+
}, {
|
|
181
|
+
showClose: boolean;
|
|
182
|
+
}>;
|
|
110
183
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "checked"[], "checked", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
111
184
|
data: {
|
|
112
185
|
type: PropType<{
|
|
@@ -120,6 +193,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
120
193
|
}[]>;
|
|
121
194
|
required: true;
|
|
122
195
|
};
|
|
196
|
+
getChildren: {
|
|
197
|
+
type: FunctionConstructor;
|
|
198
|
+
required: true;
|
|
199
|
+
};
|
|
200
|
+
showTagHover: {
|
|
201
|
+
type: BooleanConstructor;
|
|
202
|
+
default: boolean;
|
|
203
|
+
};
|
|
123
204
|
type: {
|
|
124
205
|
type: StringConstructor;
|
|
125
206
|
default: string;
|
|
@@ -128,5 +209,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
128
209
|
onChecked?: ((...args: any[]) => any) | undefined;
|
|
129
210
|
}, {
|
|
130
211
|
type: string;
|
|
212
|
+
showTagHover: boolean;
|
|
131
213
|
}>;
|
|
132
214
|
export default _default;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createElementBlock, Fragment, renderList, unref, normalizeStyle, createCommentVNode, createVNode, withCtx, createElementVNode, createTextVNode, toDisplayString, createBlock } from 'vue';
|
|
2
|
-
import { NVirtualList, NCheckbox } from 'naive-ui';
|
|
2
|
+
import { NVirtualList, NCheckbox, NPopover } from 'naive-ui';
|
|
3
3
|
import DefaultPage from '../../../default-page/index.js';
|
|
4
|
+
import GroupItem from './GroupItem.vue.js';
|
|
5
|
+
import TagItem from './TagItem.vue.js';
|
|
4
6
|
|
|
5
7
|
const _hoisted_1 = {
|
|
6
8
|
class: "c-select-person__searchGroup"
|
|
@@ -18,9 +20,12 @@ const _hoisted_5 = {
|
|
|
18
20
|
const _hoisted_6 = ["onClick"];
|
|
19
21
|
const _hoisted_7 = ["title"];
|
|
20
22
|
const _hoisted_8 = {
|
|
21
|
-
class: "
|
|
23
|
+
class: "c-select-person__popover"
|
|
22
24
|
};
|
|
23
25
|
const _hoisted_9 = {
|
|
26
|
+
class: "font-12 ml-4"
|
|
27
|
+
};
|
|
28
|
+
const _hoisted_10 = {
|
|
24
29
|
class: "c-select-person__searchGroupItemDesc c-select-person__ellipsis"
|
|
25
30
|
};
|
|
26
31
|
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -30,6 +35,14 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
30
35
|
type: Array,
|
|
31
36
|
required: true
|
|
32
37
|
},
|
|
38
|
+
getChildren: {
|
|
39
|
+
type: Function,
|
|
40
|
+
required: true
|
|
41
|
+
},
|
|
42
|
+
showTagHover: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: false
|
|
45
|
+
},
|
|
33
46
|
type: {
|
|
34
47
|
type: String,
|
|
35
48
|
default: ""
|
|
@@ -95,14 +108,30 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
95
108
|
}, {
|
|
96
109
|
default: withCtx(({
|
|
97
110
|
item
|
|
98
|
-
}) => [(openBlock(), createElementBlock("div", {
|
|
99
|
-
key:
|
|
111
|
+
}) => [__props.showTagHover && item.innerItemsNum > 0 ? (openBlock(), createElementBlock("div", {
|
|
112
|
+
key: 0,
|
|
100
113
|
class: "c-select-person__searchGroupItemCell",
|
|
101
114
|
onClick: ($event) => handleClick(item)
|
|
102
115
|
}, [createElementVNode("div", {
|
|
103
116
|
class: "c-select-person__ellipsis",
|
|
104
117
|
title: item.label
|
|
105
|
-
}, [
|
|
118
|
+
}, [createVNode(unref(NPopover), {
|
|
119
|
+
trigger: "hover"
|
|
120
|
+
}, {
|
|
121
|
+
trigger: withCtx(() => [createElementVNode("span", null, toDisplayString(item.label), 1)]),
|
|
122
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_8, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.getChildren(item), (childTag) => {
|
|
123
|
+
return openBlock(), createBlock(TagItem, {
|
|
124
|
+
key: childTag.key,
|
|
125
|
+
tag: childTag,
|
|
126
|
+
showClose: false
|
|
127
|
+
}, null, 8, ["tag"]);
|
|
128
|
+
}), 128))])]),
|
|
129
|
+
_: 2
|
|
130
|
+
}, 1024), createTextVNode(" " + toDisplayString(item.innerItemsNum ? `(${item.innerItemsNum}\u4EBA)` : "") + " ", 1), createElementVNode("span", _hoisted_9, toDisplayString(item.labelExpand), 1)], 8, _hoisted_7), createElementVNode("div", _hoisted_10, toDisplayString(item.parentName), 1)], 8, _hoisted_6)) : (openBlock(), createBlock(GroupItem, {
|
|
131
|
+
key: 1,
|
|
132
|
+
item,
|
|
133
|
+
onChecked: handleClick
|
|
134
|
+
}, null, 8, ["item"]))]),
|
|
106
135
|
_: 2
|
|
107
136
|
}, 1032, ["items"])], 64))], 4);
|
|
108
137
|
}), 128)), !__props.data.length ? (openBlock(), createBlock(unref(DefaultPage), {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ref, PropType } from 'vue';
|
|
2
2
|
import { type TreeOption } from 'naive-ui';
|
|
3
3
|
import { AnyObject } from '../../../shared/types';
|
|
4
|
+
import { Strategy } from './types';
|
|
4
5
|
type IKey = string | number;
|
|
5
6
|
type ITreeOption = TreeOption & AnyObject;
|
|
6
7
|
type IWordBook<T> = {
|
|
@@ -1539,14 +1540,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1539
1540
|
renderLabel: ({ option }: {
|
|
1540
1541
|
option: TreeOption;
|
|
1541
1542
|
}) => JSX.Element;
|
|
1543
|
+
getChildren: (tag: import("./types").PTreeOption) => AnyObject[];
|
|
1542
1544
|
transformData: (trees: (import("naive-ui/es/tree/src/interface").TreeOptionBase & Record<string, unknown> & AnyObject)[], parentNode: import("./types").PTreeOption | null, visitor?: Partial<Record<"enter" | "leave", (node: import("./types").PTreeOption) => unknown>> | undefined) => {
|
|
1543
1545
|
treeItems: import("./types").PTreeOption[];
|
|
1544
1546
|
leafCount: number;
|
|
1545
|
-
innerItems: any[];
|
|
1546
1547
|
};
|
|
1547
|
-
getTreeOptionChildren: (item: import("./types").PTreeOption) => void;
|
|
1548
1548
|
onSearch: () => Promise<void>;
|
|
1549
|
-
getAllKeys: (tree: import("./types").PTreeOption[], strategy:
|
|
1549
|
+
getAllKeys: (tree: import("./types").PTreeOption[], strategy: Strategy) => (string | number)[];
|
|
1550
1550
|
getParentKeys: (node: import("./types").PTreeOption, map: Map<string | number, import("./types").PTreeOption>) => never[];
|
|
1551
1551
|
getTopLevelCheckedKey: (node: import("./types").PTreeOption, checked: Set<string | number>, map: Map<string | number, import("./types").PTreeOption>) => string | number;
|
|
1552
1552
|
checkedAllChange: (checked: boolean) => void;
|
|
@@ -1559,7 +1559,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1559
1559
|
updateChecked: (key: string | number, checked: boolean) => void;
|
|
1560
1560
|
notifyCheck: (key: string | number, isChecked?: boolean) => void;
|
|
1561
1561
|
checkSearchClear: (kw: string) => void;
|
|
1562
|
-
getCheckWithLevel: (strategy?:
|
|
1562
|
+
getCheckWithLevel: (strategy?: Strategy | undefined, hideLeaf?: boolean | undefined) => {
|
|
1563
1563
|
parentNode: import("./types").PTreeOption | undefined;
|
|
1564
1564
|
key: string | number;
|
|
1565
1565
|
label: string;
|
|
@@ -1597,6 +1597,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1597
1597
|
}[]>;
|
|
1598
1598
|
required: true;
|
|
1599
1599
|
};
|
|
1600
|
+
getChildren: {
|
|
1601
|
+
type: FunctionConstructor;
|
|
1602
|
+
required: true;
|
|
1603
|
+
};
|
|
1604
|
+
showTagHover: {
|
|
1605
|
+
type: BooleanConstructor;
|
|
1606
|
+
default: boolean;
|
|
1607
|
+
};
|
|
1600
1608
|
type: {
|
|
1601
1609
|
type: StringConstructor;
|
|
1602
1610
|
default: string;
|
|
@@ -1616,6 +1624,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1616
1624
|
}[]>;
|
|
1617
1625
|
required: true;
|
|
1618
1626
|
};
|
|
1627
|
+
getChildren: {
|
|
1628
|
+
type: FunctionConstructor;
|
|
1629
|
+
required: true;
|
|
1630
|
+
};
|
|
1631
|
+
showTagHover: {
|
|
1632
|
+
type: BooleanConstructor;
|
|
1633
|
+
default: boolean;
|
|
1634
|
+
};
|
|
1619
1635
|
type: {
|
|
1620
1636
|
type: StringConstructor;
|
|
1621
1637
|
default: string;
|
|
@@ -1636,6 +1652,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1636
1652
|
handleChange: (item: AnyObject, checked: boolean) => void;
|
|
1637
1653
|
NVirtualList: any;
|
|
1638
1654
|
NCheckbox: any;
|
|
1655
|
+
NPopover: any;
|
|
1639
1656
|
CDefaultPage: import("../../../shared/types").SFCWithInstall<import("vue").DefineComponent<{
|
|
1640
1657
|
type: {
|
|
1641
1658
|
type: StringConstructor;
|
|
@@ -1691,6 +1708,62 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1691
1708
|
type: string;
|
|
1692
1709
|
config: AnyObject;
|
|
1693
1710
|
}>>;
|
|
1711
|
+
GroupItem: import("vue").DefineComponent<{
|
|
1712
|
+
item: {
|
|
1713
|
+
type: PropType<AnyObject>;
|
|
1714
|
+
required: true;
|
|
1715
|
+
};
|
|
1716
|
+
}, {
|
|
1717
|
+
emit: (event: "checked", ...args: any[]) => void;
|
|
1718
|
+
handleClick: (item: AnyObject) => void;
|
|
1719
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "checked"[], "checked", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
1720
|
+
item: {
|
|
1721
|
+
type: PropType<AnyObject>;
|
|
1722
|
+
required: true;
|
|
1723
|
+
};
|
|
1724
|
+
}>> & {
|
|
1725
|
+
onChecked?: ((...args: any[]) => any) | undefined;
|
|
1726
|
+
}, {}>;
|
|
1727
|
+
TagItem: import("vue").DefineComponent<{
|
|
1728
|
+
tag: {
|
|
1729
|
+
type: PropType<AnyObject>;
|
|
1730
|
+
required: true;
|
|
1731
|
+
};
|
|
1732
|
+
showClose: {
|
|
1733
|
+
type: BooleanConstructor;
|
|
1734
|
+
default: boolean;
|
|
1735
|
+
};
|
|
1736
|
+
}, {
|
|
1737
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
1738
|
+
tag: {
|
|
1739
|
+
type: PropType<AnyObject>;
|
|
1740
|
+
required: true;
|
|
1741
|
+
};
|
|
1742
|
+
showClose: {
|
|
1743
|
+
type: BooleanConstructor;
|
|
1744
|
+
default: boolean;
|
|
1745
|
+
};
|
|
1746
|
+
}>> & {
|
|
1747
|
+
onUnchecked?: ((...args: any[]) => any) | undefined;
|
|
1748
|
+
}>>;
|
|
1749
|
+
emit: (event: "unchecked", ...args: any[]) => void;
|
|
1750
|
+
updateChecked: (key: string, checked: boolean) => void;
|
|
1751
|
+
NIcon: any;
|
|
1752
|
+
CloseCircleSharp: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
1753
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "unchecked"[], "unchecked", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
1754
|
+
tag: {
|
|
1755
|
+
type: PropType<AnyObject>;
|
|
1756
|
+
required: true;
|
|
1757
|
+
};
|
|
1758
|
+
showClose: {
|
|
1759
|
+
type: BooleanConstructor;
|
|
1760
|
+
default: boolean;
|
|
1761
|
+
};
|
|
1762
|
+
}>> & {
|
|
1763
|
+
onUnchecked?: ((...args: any[]) => any) | undefined;
|
|
1764
|
+
}, {
|
|
1765
|
+
showClose: boolean;
|
|
1766
|
+
}>;
|
|
1694
1767
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "checked"[], "checked", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
1695
1768
|
data: {
|
|
1696
1769
|
type: PropType<{
|
|
@@ -1704,6 +1777,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1704
1777
|
}[]>;
|
|
1705
1778
|
required: true;
|
|
1706
1779
|
};
|
|
1780
|
+
getChildren: {
|
|
1781
|
+
type: FunctionConstructor;
|
|
1782
|
+
required: true;
|
|
1783
|
+
};
|
|
1784
|
+
showTagHover: {
|
|
1785
|
+
type: BooleanConstructor;
|
|
1786
|
+
default: boolean;
|
|
1787
|
+
};
|
|
1707
1788
|
type: {
|
|
1708
1789
|
type: StringConstructor;
|
|
1709
1790
|
default: string;
|
|
@@ -1712,6 +1793,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1712
1793
|
onChecked?: ((...args: any[]) => any) | undefined;
|
|
1713
1794
|
}, {
|
|
1714
1795
|
type: string;
|
|
1796
|
+
showTagHover: boolean;
|
|
1715
1797
|
}>;
|
|
1716
1798
|
TagItem: import("vue").DefineComponent<{
|
|
1717
1799
|
tag: {
|
|
@@ -2033,7 +2115,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2033
2115
|
[x: string]: unknown;
|
|
2034
2116
|
}>;
|
|
2035
2117
|
emits: (event: "check" | "checkWithLevel", ...args: any[]) => void;
|
|
2036
|
-
getCheckWithLevel: () => any;
|
|
2118
|
+
getCheckWithLevel: (strategy?: Strategy, hideLeaf?: boolean) => any;
|
|
2037
2119
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("check" | "checkWithLevel")[], "check" | "checkWithLevel", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
2038
2120
|
defaultList: {
|
|
2039
2121
|
type: PropType<(IKey | ITag)[]>;
|
|
@@ -153,9 +153,9 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
153
153
|
__emits(eventName, ...args);
|
|
154
154
|
};
|
|
155
155
|
provide(InjectionSelectPersonEmits, emits);
|
|
156
|
-
const getCheckWithLevel = () => {
|
|
156
|
+
const getCheckWithLevel = (strategy, hideLeaf) => {
|
|
157
157
|
var _a;
|
|
158
|
-
return (_a = selectPersonRef.value) == null ? void 0 : _a.getCheckWithLevel();
|
|
158
|
+
return (_a = selectPersonRef.value) == null ? void 0 : _a.getCheckWithLevel(strategy, hideLeaf);
|
|
159
159
|
};
|
|
160
160
|
expose({
|
|
161
161
|
getCheckWithLevel
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { type TreeOption } from 'naive-ui';
|
|
2
|
+
import { AnyObject } from '../../../../shared/types';
|
|
2
3
|
export declare function searchFilterTree(attr: string, data: TreeOption[], keyword: string, filterKey: string): any[];
|
|
3
4
|
export declare function searchBasisTree(data: TreeOption[], keyword: string, filterKey: string): TreeOption[];
|
|
5
|
+
export declare function getAllChildren(children: AnyObject[], childrenKey: string): AnyObject[];
|
|
4
6
|
export declare function getExpandedKeys(tree: TreeOption[]): (string | number)[];
|
|
@@ -22,6 +22,29 @@ function searchBasisTree(data, keyword, filterKey) {
|
|
|
22
22
|
transform(data, keyword, filterKey);
|
|
23
23
|
return filterHandle(data);
|
|
24
24
|
}
|
|
25
|
+
function getAllChildren(children, childrenKey) {
|
|
26
|
+
const cache = /* @__PURE__ */ new WeakMap();
|
|
27
|
+
function* childrenIterator(nodes) {
|
|
28
|
+
if (!(nodes == null ? void 0 : nodes.length))
|
|
29
|
+
return;
|
|
30
|
+
for (const node of nodes) {
|
|
31
|
+
if (cache.has(node)) {
|
|
32
|
+
yield* cache.get(node);
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
const result = [];
|
|
36
|
+
const children2 = node[childrenKey];
|
|
37
|
+
if ((node == null ? void 0 : node.leaf) && !(node == null ? void 0 : node.disabled)) {
|
|
38
|
+
result.push(node);
|
|
39
|
+
yield node;
|
|
40
|
+
} else if (children2 == null ? void 0 : children2.length) {
|
|
41
|
+
yield* childrenIterator(children2);
|
|
42
|
+
}
|
|
43
|
+
cache.set(node, result);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return Array.from(childrenIterator(children || []));
|
|
47
|
+
}
|
|
25
48
|
function transform(data, keyword, filterKey) {
|
|
26
49
|
data.forEach((item) => {
|
|
27
50
|
var _a;
|
|
@@ -108,4 +131,4 @@ function getExpandedKeys(tree) {
|
|
|
108
131
|
return expandedKeys;
|
|
109
132
|
}
|
|
110
133
|
|
|
111
|
-
export { getExpandedKeys, searchBasisTree, searchFilterTree };
|
|
134
|
+
export { getAllChildren, getExpandedKeys, searchBasisTree, searchFilterTree };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cnhis-design-vue",
|
|
3
|
-
"version": "3.3.3-beta.
|
|
3
|
+
"version": "3.3.3-beta.16",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"module": "./es/components/index.js",
|
|
6
6
|
"main": "./es/components/index.js",
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"iOS 7",
|
|
74
74
|
"last 3 iOS versions"
|
|
75
75
|
],
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "2b2da68d316cd3ea18fd4ff5bc679f30cc6678a8"
|
|
77
77
|
}
|