zartui 3.1.84 → 3.1.85
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/drawer-select/DrawerSelect.d.ts +45 -2
- package/es/drawer-select/DrawerSelect.mjs +163 -3
- package/es/drawer-select/index.css +1 -1
- package/es/drawer-select/index.d.ts +32 -2
- package/es/drawer-select/types.d.ts +22 -0
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/lib/drawer-select/DrawerSelect.d.ts +45 -2
- package/lib/drawer-select/DrawerSelect.js +163 -3
- package/lib/drawer-select/index.css +1 -1
- package/lib/drawer-select/index.d.ts +32 -2
- package/lib/drawer-select/types.d.ts +22 -0
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/web-types.json +1 -1
- package/lib/zartui.cjs.js +163 -4
- package/lib/zartui.es.js +163 -4
- package/lib/zartui.js +163 -4
- package/lib/zartui.min.js +2 -2
- package/package.json +5 -5
|
@@ -37,6 +37,7 @@ var import_search = __toESM(require("../search"));
|
|
|
37
37
|
var import_icon = __toESM(require("../icon"));
|
|
38
38
|
var import_popup = __toESM(require("../popup"));
|
|
39
39
|
var import_tag = __toESM(require("../tag"));
|
|
40
|
+
var import_button = __toESM(require("../button"));
|
|
40
41
|
var import_deep_clone = require("../utils/deep-clone");
|
|
41
42
|
var import_utils2 = require("../picker/utils");
|
|
42
43
|
var import_dialog = require("../dialog");
|
|
@@ -51,12 +52,19 @@ const drawerSelectProps = {
|
|
|
51
52
|
default: false
|
|
52
53
|
},
|
|
53
54
|
defaultSelectNode: Object,
|
|
54
|
-
activeClassName: (0, import_utils.makeStringProp)("")
|
|
55
|
+
activeClassName: (0, import_utils.makeStringProp)(""),
|
|
56
|
+
commonTypeList: (0, import_utils.makeArrayProp)(),
|
|
57
|
+
showCommonTypes: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: false
|
|
60
|
+
},
|
|
61
|
+
commonTypeVisibleCount: Number,
|
|
62
|
+
hotTypeList: (0, import_utils.makeArrayProp)()
|
|
55
63
|
};
|
|
56
64
|
var stdin_default = (0, import_vue.defineComponent)({
|
|
57
65
|
name,
|
|
58
66
|
props: drawerSelectProps,
|
|
59
|
-
emits: ["change", "select"],
|
|
67
|
+
emits: ["change", "select", "clearAll"],
|
|
60
68
|
setup(props, {
|
|
61
69
|
emit
|
|
62
70
|
}) {
|
|
@@ -68,8 +76,17 @@ var stdin_default = (0, import_vue.defineComponent)({
|
|
|
68
76
|
const searchRef = (0, import_vue.ref)();
|
|
69
77
|
const offset = (0, import_vue.ref)(0);
|
|
70
78
|
const historyList = (0, import_vue.ref)([]);
|
|
79
|
+
const showAllCommonTypes = (0, import_vue.ref)(false);
|
|
80
|
+
const selectCommonId = (0, import_vue.ref)(-1);
|
|
71
81
|
const defaultTreeNode = (0, import_vue.ref)(props.treeData);
|
|
72
82
|
const fields = (0, import_vue.computed)(() => (0, import_utils2.assignDefaultFields)(props.treeFieldName));
|
|
83
|
+
const visibleCommonTypeList = (0, import_vue.computed)(() => {
|
|
84
|
+
const count = props.commonTypeVisibleCount;
|
|
85
|
+
if (typeof count !== "number") {
|
|
86
|
+
return props.commonTypeList;
|
|
87
|
+
}
|
|
88
|
+
return props.commonTypeList.slice(0, Math.max(0, count));
|
|
89
|
+
});
|
|
73
90
|
const {
|
|
74
91
|
value,
|
|
75
92
|
children,
|
|
@@ -153,6 +170,37 @@ var stdin_default = (0, import_vue.defineComponent)({
|
|
|
153
170
|
updateOffset();
|
|
154
171
|
});
|
|
155
172
|
const isEmpty = (item) => !item[children] || item[children].length === 0;
|
|
173
|
+
const syncExpandNodeByParent = (item) => {
|
|
174
|
+
var _a, _b, _c;
|
|
175
|
+
const parent = (_a = item.parent) != null ? _a : [];
|
|
176
|
+
if (parent.length >= 2) {
|
|
177
|
+
const parentValue = (_b = parent[parent.length - 2]) == null ? void 0 : _b[value];
|
|
178
|
+
if (parentValue !== void 0) {
|
|
179
|
+
const stack = [...props.treeData];
|
|
180
|
+
while (stack.length > 0) {
|
|
181
|
+
const current = stack.shift();
|
|
182
|
+
if (!current)
|
|
183
|
+
continue;
|
|
184
|
+
if (current[value] === parentValue) {
|
|
185
|
+
expandNode.value = {
|
|
186
|
+
text: current[key],
|
|
187
|
+
value: current[value],
|
|
188
|
+
children: current[children]
|
|
189
|
+
};
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
if ((_c = current[children]) == null ? void 0 : _c.length) {
|
|
193
|
+
stack.push(...current[children]);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
expandNode.value = {
|
|
199
|
+
text: allData[key],
|
|
200
|
+
value: allData[value],
|
|
201
|
+
children: allData[children]
|
|
202
|
+
};
|
|
203
|
+
};
|
|
156
204
|
const onLabelClick = (item, assign = true) => {
|
|
157
205
|
const {
|
|
158
206
|
text,
|
|
@@ -169,6 +217,7 @@ var stdin_default = (0, import_vue.defineComponent)({
|
|
|
169
217
|
}
|
|
170
218
|
if (isEmpty(item)) {
|
|
171
219
|
selectNode.value = item;
|
|
220
|
+
selectCommonId.value = item[value2];
|
|
172
221
|
emit("select", item);
|
|
173
222
|
}
|
|
174
223
|
item.checked = !item.checked;
|
|
@@ -231,6 +280,117 @@ var stdin_default = (0, import_vue.defineComponent)({
|
|
|
231
280
|
}));
|
|
232
281
|
}
|
|
233
282
|
};
|
|
283
|
+
const findCommonTypeNode = (id) => {
|
|
284
|
+
return flatArray.value.find((item) => item[value] === id);
|
|
285
|
+
};
|
|
286
|
+
const onCommonTypeClick = (item) => {
|
|
287
|
+
const matchNode = findCommonTypeNode(item.types.id);
|
|
288
|
+
if (!matchNode)
|
|
289
|
+
return;
|
|
290
|
+
selectCommonId.value = item.types.id;
|
|
291
|
+
syncExpandNodeByParent(matchNode);
|
|
292
|
+
selectNode.value = matchNode;
|
|
293
|
+
emit("select", Object.assign(matchNode, {
|
|
294
|
+
parent: matchNode.parent
|
|
295
|
+
}));
|
|
296
|
+
};
|
|
297
|
+
const onClearCommonTypes = () => {
|
|
298
|
+
selectCommonId.value = -1;
|
|
299
|
+
showAllCommonTypes.value = false;
|
|
300
|
+
emit("clearAll");
|
|
301
|
+
};
|
|
302
|
+
const findHotTypeNode = (id) => {
|
|
303
|
+
return flatArray.value.find((item) => item[value] === id);
|
|
304
|
+
};
|
|
305
|
+
const renderCommonTypeButton = (item) => {
|
|
306
|
+
const active = item.types.id === selectCommonId.value;
|
|
307
|
+
return (0, import_vue.createVNode)(import_button.default, {
|
|
308
|
+
"size": "small",
|
|
309
|
+
"class": [bem("common-types--btn")],
|
|
310
|
+
"type": active ? "primary" : "default",
|
|
311
|
+
"backgroundColor": active ? "#3388ff" : "var(--zt-background)",
|
|
312
|
+
"borderColor": active ? "#3388ff" : "var(--zt-border-color)",
|
|
313
|
+
"color": active ? "var(--zt-white)" : "var(--zt-text-color)",
|
|
314
|
+
"onClick": () => onCommonTypeClick(item)
|
|
315
|
+
}, {
|
|
316
|
+
default: () => [item.types.name]
|
|
317
|
+
});
|
|
318
|
+
};
|
|
319
|
+
const onHotTypeClick = (item) => {
|
|
320
|
+
const matchNode = findHotTypeNode(item.id);
|
|
321
|
+
if (!matchNode)
|
|
322
|
+
return;
|
|
323
|
+
selectCommonId.value = item.id;
|
|
324
|
+
syncExpandNodeByParent(matchNode);
|
|
325
|
+
selectNode.value = matchNode;
|
|
326
|
+
emit("select", Object.assign(matchNode, {
|
|
327
|
+
parent: matchNode.parent
|
|
328
|
+
}));
|
|
329
|
+
};
|
|
330
|
+
const renderHotTypeButton = (item) => {
|
|
331
|
+
const active = item.id === selectCommonId.value;
|
|
332
|
+
return (0, import_vue.createVNode)(import_button.default, {
|
|
333
|
+
"size": "small",
|
|
334
|
+
"class": [bem("common-types--btn")],
|
|
335
|
+
"type": active ? "primary" : "default",
|
|
336
|
+
"backgroundColor": active ? "#3388ff" : "var(--zt-background)",
|
|
337
|
+
"borderColor": active ? "#3388ff" : "var(--zt-border-color)",
|
|
338
|
+
"color": active ? "var(--zt-white)" : "var(--zt-text-color)",
|
|
339
|
+
"onClick": () => onHotTypeClick(item)
|
|
340
|
+
}, {
|
|
341
|
+
default: () => [item.text || item.name]
|
|
342
|
+
});
|
|
343
|
+
};
|
|
344
|
+
const renderCommonTypes = () => {
|
|
345
|
+
if (!props.showCommonTypes)
|
|
346
|
+
return null;
|
|
347
|
+
return (0, import_vue.createVNode)("section", {
|
|
348
|
+
"class": [bem("common-types")]
|
|
349
|
+
}, [(0, import_vue.createVNode)("div", {
|
|
350
|
+
"class": [bem("common-types--head")]
|
|
351
|
+
}, [(0, import_vue.createVNode)("span", {
|
|
352
|
+
"class": [bem("common-types--label")]
|
|
353
|
+
}, [(0, import_vue.createTextVNode)("\u5E38\u7528\u5C0F\u7C7B")]), visibleCommonTypeList.value.length > 0 ? (0, import_vue.createVNode)("div", {
|
|
354
|
+
"class": [bem("common-types--mask")]
|
|
355
|
+
}, [(0, import_vue.createVNode)("div", {
|
|
356
|
+
"class": [bem("common-types--viewport")]
|
|
357
|
+
}, [(0, import_vue.createVNode)("div", {
|
|
358
|
+
"class": [bem("common-types--list")]
|
|
359
|
+
}, [visibleCommonTypeList.value.map(renderCommonTypeButton)])])]) : (0, import_vue.createVNode)("div", {
|
|
360
|
+
"class": [bem("common-types--empty")]
|
|
361
|
+
}, [(0, import_vue.createTextVNode)("\u6682\u65E0\u5E38\u7528\u5C0F\u7C7B")]), visibleCommonTypeList.value.length > 0 && (0, import_vue.createVNode)("div", {
|
|
362
|
+
"class": [bem("common-types--icon")],
|
|
363
|
+
"onClick": () => showAllCommonTypes.value = !showAllCommonTypes.value
|
|
364
|
+
}, [(0, import_vue.createVNode)(import_icon.default, {
|
|
365
|
+
"size": "24",
|
|
366
|
+
"name": showAllCommonTypes.value ? "keyboard-arrow-up" : "keyboard-arrow-down",
|
|
367
|
+
"color": showAllCommonTypes.value ? "var(--zt-primary-color)" : void 0
|
|
368
|
+
}, null)])]), showAllCommonTypes.value && visibleCommonTypeList.value.length > 0 && (0, import_vue.createVNode)("div", {
|
|
369
|
+
"class": [bem("common-types--panel")]
|
|
370
|
+
}, [(0, import_vue.createVNode)("div", {
|
|
371
|
+
"class": [bem("common-types--panel-list")]
|
|
372
|
+
}, [visibleCommonTypeList.value.map(renderCommonTypeButton)]), (0, import_vue.createVNode)("div", {
|
|
373
|
+
"class": [bem("common-types--clear")],
|
|
374
|
+
"onClick": onClearCommonTypes
|
|
375
|
+
}, [(0, import_vue.createVNode)(import_icon.default, {
|
|
376
|
+
"name": "delete",
|
|
377
|
+
"size": "20"
|
|
378
|
+
}, null), (0, import_vue.createVNode)("span", {
|
|
379
|
+
"class": [bem("common-types--clear-text")]
|
|
380
|
+
}, [(0, import_vue.createTextVNode)("\u6E05\u7A7A\u5E38\u7528\u5C0F\u7C7B")])])])]);
|
|
381
|
+
};
|
|
382
|
+
const renderHotTypes = () => {
|
|
383
|
+
var _a;
|
|
384
|
+
if (!((_a = props.hotTypeList) == null ? void 0 : _a.length))
|
|
385
|
+
return null;
|
|
386
|
+
return (0, import_vue.createVNode)("section", {
|
|
387
|
+
"class": [bem("hot-types")]
|
|
388
|
+
}, [(0, import_vue.createVNode)("div", {
|
|
389
|
+
"class": [bem("hot-types--label")]
|
|
390
|
+
}, [(0, import_vue.createTextVNode)("\u70ED\u70B9\u5C0F\u7C7B")]), (0, import_vue.createVNode)("div", {
|
|
391
|
+
"class": [bem("hot-types--list")]
|
|
392
|
+
}, [props.hotTypeList.map(renderHotTypeButton)])]);
|
|
393
|
+
};
|
|
234
394
|
const renderSecondTree = (item) => {
|
|
235
395
|
var _a, _b;
|
|
236
396
|
const text = item[fields.value.text];
|
|
@@ -366,7 +526,7 @@ var stdin_default = (0, import_vue.defineComponent)({
|
|
|
366
526
|
}, null), (0, import_vue.createTextVNode)("\u6E05\u7A7A\u641C\u7D22\u5386\u53F2")])]), historyList.value.length === 0 && (0, import_vue.createVNode)("div", {
|
|
367
527
|
"class": [bem("empty")]
|
|
368
528
|
}, [(0, import_vue.createTextVNode)("\u6682\u65E0\u641C\u7D22\u8BB0\u5F55")])])]
|
|
369
|
-
})]), [[import_vue.vShow, show.value]])]), (0, import_vue.createVNode)("div", {
|
|
529
|
+
})]), [[import_vue.vShow, show.value]])]), renderCommonTypes(), renderHotTypes(), (0, import_vue.createVNode)("div", {
|
|
370
530
|
"class": [bem("name"), "zt-hairline--bottom"]
|
|
371
531
|
}, [props.title]), (0, import_vue.createVNode)("main", {
|
|
372
532
|
"class": [bem("tree")]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--zt-drawer-select-background: #ebf2f5}.zt-drawer-select{height:100%;width:100%;display:flex;flex-direction:column;background:var(--zt-background)}.zt-drawer-select__search{padding:var(--zt-padding-xs) 0}.zt-drawer-select__search--item{padding:var(--zt-padding-sm) 0 var(--zt-padding-sm) var(--zt-padding-md)}.zt-drawer-select__search--item:after{left:calc(-50% + 22px)}.zt-drawer-select__search--header{font-size:var(--zt-font-size-lg);font-weight:700;color:var(--zt-text-color);margin-bottom:4px}.zt-drawer-select__search--name{font-size:var(--zt-font-size-md);color:var(--zt-text-color-2)}.zt-drawer-select__wrap{position:fixed;right:0;left:0;bottom:0;z-index:999;overflow:hidden}.zt-drawer-select__popup{position:absolute;max-height:350px;border-radius:0 0 16px 16px}.zt-drawer-select__empty{font-size:var(--zt-font-size-md);color:var(--zt-gray-a4);text-align:center;padding:var(--zt-padding-lg) 0}.zt-drawer-select__history--title{height:44px;line-height:44px;font-weight:700;padding-left:var(--zt-padding-sm);color:var(--zt-text-color)}.zt-drawer-select__history--content{padding:var(--zt-padding-sm) var(--zt-padding-md) var(--zt-padding-xs)}.zt-drawer-select__history--content .zt-tag{line-height:28px;border-radius:14px;font-size:var(--zt-font-size-md);margin-right:4px;margin-bottom:8px}.zt-drawer-select__history--clear{display:flex;align-items:center;justify-content:center;height:44px;color:var(--zt-gray-a6);text-align:center;font-size:var(--zt-font-size-md)}.zt-drawer-select__name{position:relative;height:44px;line-height:44px;font-size:var(--zt-font-size-lg);color:var(--zt-text-color);font-weight:700;padding-left:var(--zt-padding-md)}.zt-drawer-select__name:before{content:"";position:absolute;width:4px;height:16px;top:14px;left:0;background:var(--zt-primary-color)}.zt-drawer-
|
|
1
|
+
:root{--zt-drawer-select-background: #ebf2f5}.zt-drawer-select{height:100%;width:100%;display:flex;flex-direction:column;background:var(--zt-background)}.zt-drawer-select__search{padding:var(--zt-padding-xs) 0}.zt-drawer-select__search--item{padding:var(--zt-padding-sm) 0 var(--zt-padding-sm) var(--zt-padding-md)}.zt-drawer-select__search--item:after{left:calc(-50% + 22px)}.zt-drawer-select__search--header{font-size:var(--zt-font-size-lg);font-weight:700;color:var(--zt-text-color);margin-bottom:4px}.zt-drawer-select__search--name{font-size:var(--zt-font-size-md);color:var(--zt-text-color-2)}.zt-drawer-select__wrap{position:fixed;right:0;left:0;bottom:0;z-index:999;overflow:hidden}.zt-drawer-select__popup{position:absolute;max-height:350px;border-radius:0 0 16px 16px}.zt-drawer-select__empty{font-size:var(--zt-font-size-md);color:var(--zt-gray-a4);text-align:center;padding:var(--zt-padding-lg) 0}.zt-drawer-select__history--title{height:44px;line-height:44px;font-weight:700;padding-left:var(--zt-padding-sm);color:var(--zt-text-color)}.zt-drawer-select__history--content{padding:var(--zt-padding-sm) var(--zt-padding-md) var(--zt-padding-xs)}.zt-drawer-select__history--content .zt-tag{line-height:28px;border-radius:14px;font-size:var(--zt-font-size-md);margin-right:4px;margin-bottom:8px}.zt-drawer-select__history--clear{display:flex;align-items:center;justify-content:center;height:44px;color:var(--zt-gray-a6);text-align:center;font-size:var(--zt-font-size-md)}.zt-drawer-select__name{position:relative;height:44px;line-height:44px;font-size:var(--zt-font-size-lg);color:var(--zt-text-color);font-weight:700;padding-left:var(--zt-padding-md)}.zt-drawer-select__name:before{content:"";position:absolute;width:4px;height:16px;top:14px;left:0;background:var(--zt-primary-color)}.zt-drawer-select__common-types{width:100%;background:var(--zt-white)}.zt-drawer-select__common-types--head{display:flex;align-items:center;min-height:44px;padding-left:var(--zt-padding-md);font-size:var(--zt-font-size-md);color:var(--zt-text-color)}.zt-drawer-select__common-types--label{flex-shrink:0;font-weight:700;padding-right:4px}.zt-drawer-select__common-types--mask{position:relative;flex:1;min-width:0;background:var(--zt-white)}.zt-drawer-select__common-types--mask:before,.zt-drawer-select__common-types--mask:after{content:"";position:absolute;top:0;bottom:0;width:40px;pointer-events:none;z-index:3}.zt-drawer-select__common-types--mask:before{left:-1px;background-image:linear-gradient(90deg,var(--zt-white) 0%,var(--zt-white) 24px,rgba(255,255,255,0) 100%)}.zt-drawer-select__common-types--mask:after{right:-1px;background-image:linear-gradient(270deg,var(--zt-white) 0%,var(--zt-white) 12px,rgba(255,255,255,0) 100%)}.zt-drawer-select__common-types--viewport{min-width:0;overflow:hidden}.zt-drawer-select__common-types--list{display:flex;align-items:center;gap:4px;padding:8px 16px;overflow-x:auto;overflow-y:hidden;white-space:nowrap;scrollbar-width:none}.zt-drawer-select__common-types--list::-webkit-scrollbar{display:none}.zt-drawer-select__common-types--icon{display:flex;align-items:center;justify-content:center;width:56px;height:44px;flex-shrink:0}.zt-drawer-select__common-types--empty{flex:1;min-width:0;padding-left:8px;color:var(--zt-text-color-2);opacity:.2}.zt-drawer-select__common-types--btn{flex-shrink:0;min-width:-moz-fit-content;min-width:fit-content;border-radius:15px;opacity:1;padding-top:15px;padding-bottom:15px}.zt-drawer-select__common-types--panel{padding:0 var(--zt-padding-md) 8px;background:var(--zt-white)}.zt-drawer-select__common-types--panel-list{display:flex;flex-wrap:wrap;gap:8px 4px;padding-bottom:8px}.zt-drawer-select__common-types--clear{display:flex;align-items:center;justify-content:center;height:44px;color:var(--zt-text-color-2);opacity:.6;font-size:var(--zt-font-size-md)}.zt-drawer-select__common-types--clear-text{margin-left:4px}.zt-drawer-select__hot-types{width:100%;padding:0 16px 4px;margin-top:8px;box-sizing:border-box;background:var(--zt-white)}.zt-drawer-select__hot-types--label{height:44px;line-height:44px;font-size:var(--zt-font-size-md);font-weight:700;color:var(--zt-text-color)}.zt-drawer-select__hot-types--list{display:flex;flex-wrap:wrap;gap:8px 4px;width:100%;max-height:108px;overflow-x:hidden;overflow-y:auto;padding-bottom:8px}.zt-drawer-select__tree{display:flex;flex:1;min-height:0}.zt-drawer-select__tree-left{width:120px}.zt-drawer-select__tree-right{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;background:var(--zt-white)}.zt-drawer-select__label{display:flex;align-items:center;line-height:28px;color:var(--zt-text-color);padding:var(--zt-padding-xs) 0 var(--zt-padding-xs) var(--zt-padding-base);font-size:var(--zt-font-size-md)}.zt-drawer-select__label--second{background:var(--zt-drawer-select-background);padding-left:var(--zt-padding-sm)}.zt-drawer-select__label--placeholder{display:flex;align-items:center;width:24px}.zt-drawer-select__label--text{display:flex;align-items:center;min-height:28px}.zt-drawer-select__label--icon--active{transform:rotate(90deg);color:var(--zt-primary-color)}.zt-drawer-select__label--active{color:var(--zt-primary-color);background:var(--zt-white)}.zt-drawer-select__title{display:flex;align-items:center;line-height:28px;font-size:var(--zt-font-size-md);color:var(--zt-text-color);font-weight:700;padding:var(--zt-padding-xs) var(--zt-padding-md)}.zt-drawer-select__content{flex:1;min-height:0;overflow-y:scroll}.zt-drawer-select__item--placeholder{width:30px}.zt-drawer-select__item--header{display:flex;min-height:44px;font-size:var(--zt-font-size-md);color:var(--zt-text-color);padding-left:4px}.zt-drawer-select__item--icon{display:flex;align-items:center;width:24px;margin-right:6px;height:100%}.zt-drawer-select__item--icon--active{transform:rotate(90deg);color:var(--zt-primary-color)}.zt-drawer-select__item--label{flex:1;display:flex;align-items:center;line-height:28px;padding:var(--zt-padding-xs) var(--zt-padding-md) var(--zt-padding-xs) 0}.zt-drawer-select__item--label--active{color:var(--zt-primary-color)}.zt-drawer-select__item--child{padding-left:var(--zt-padding-md)}.zt-drawer-select .zt-dialog__confirm{background:var(--zt-dialog-cancel-button-background-color);border:var(--zt-button-border-width) solid #ff5023;color:#ff5023}
|
|
@@ -21,7 +21,20 @@ export declare const DrawerSelect: import("../utils").WithInstall<import("vue").
|
|
|
21
21
|
type: import("vue").PropType<string>;
|
|
22
22
|
default: string;
|
|
23
23
|
};
|
|
24
|
-
|
|
24
|
+
commonTypeList: {
|
|
25
|
+
type: import("vue").PropType<import("./types").DrawerSelectCommonType[]>;
|
|
26
|
+
default: () => import("./types").DrawerSelectCommonType[];
|
|
27
|
+
};
|
|
28
|
+
showCommonTypes: {
|
|
29
|
+
type: BooleanConstructor;
|
|
30
|
+
default: boolean;
|
|
31
|
+
};
|
|
32
|
+
commonTypeVisibleCount: NumberConstructor;
|
|
33
|
+
hotTypeList: {
|
|
34
|
+
type: import("vue").PropType<import("./types").DrawerSelectHotType[]>;
|
|
35
|
+
default: () => import("./types").DrawerSelectHotType[];
|
|
36
|
+
};
|
|
37
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "change" | "clearAll")[], "select" | "change" | "clearAll", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
25
38
|
treeData: {
|
|
26
39
|
type: import("vue").PropType<import("./types").DrawerSelectTreeNode[]>;
|
|
27
40
|
default: () => import("./types").DrawerSelectTreeNode[];
|
|
@@ -44,19 +57,36 @@ export declare const DrawerSelect: import("../utils").WithInstall<import("vue").
|
|
|
44
57
|
type: import("vue").PropType<string>;
|
|
45
58
|
default: string;
|
|
46
59
|
};
|
|
60
|
+
commonTypeList: {
|
|
61
|
+
type: import("vue").PropType<import("./types").DrawerSelectCommonType[]>;
|
|
62
|
+
default: () => import("./types").DrawerSelectCommonType[];
|
|
63
|
+
};
|
|
64
|
+
showCommonTypes: {
|
|
65
|
+
type: BooleanConstructor;
|
|
66
|
+
default: boolean;
|
|
67
|
+
};
|
|
68
|
+
commonTypeVisibleCount: NumberConstructor;
|
|
69
|
+
hotTypeList: {
|
|
70
|
+
type: import("vue").PropType<import("./types").DrawerSelectHotType[]>;
|
|
71
|
+
default: () => import("./types").DrawerSelectHotType[];
|
|
72
|
+
};
|
|
47
73
|
}>> & Readonly<{
|
|
48
74
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
49
75
|
onSelect?: ((...args: any[]) => any) | undefined;
|
|
76
|
+
onClearAll?: ((...args: any[]) => any) | undefined;
|
|
50
77
|
}>, {
|
|
51
78
|
title: string;
|
|
52
79
|
placeholder: string;
|
|
53
80
|
treeData: import("./types").DrawerSelectTreeNode[];
|
|
54
81
|
expandAll: boolean;
|
|
55
82
|
activeClassName: string;
|
|
83
|
+
commonTypeList: import("./types").DrawerSelectCommonType[];
|
|
84
|
+
showCommonTypes: boolean;
|
|
85
|
+
hotTypeList: import("./types").DrawerSelectHotType[];
|
|
56
86
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
|
57
87
|
export default DrawerSelect;
|
|
58
88
|
export type { DrawerSelectProps } from './DrawerSelect';
|
|
59
|
-
export type { DrawerSelectThemeVars, DrawerSelectTreeNode, FlatTreeNode, } from './types';
|
|
89
|
+
export type { DrawerSelectCommonType, DrawerSelectHotType, DrawerSelectThemeVars, DrawerSelectTreeNode, FlatTreeNode, } from './types';
|
|
60
90
|
declare module 'vue' {
|
|
61
91
|
interface GlobalComponents {
|
|
62
92
|
ZtDrawerSelect: typeof DrawerSelect;
|
|
@@ -4,6 +4,28 @@ export type DrawerSelectTreeNode = {
|
|
|
4
4
|
children?: DrawerSelectTreeNode[];
|
|
5
5
|
[key: PropertyKey]: any;
|
|
6
6
|
};
|
|
7
|
+
export type DrawerSelectCommonType = {
|
|
8
|
+
types: {
|
|
9
|
+
id: string | number;
|
|
10
|
+
name: string;
|
|
11
|
+
[key: PropertyKey]: any;
|
|
12
|
+
};
|
|
13
|
+
timestamp: number;
|
|
14
|
+
uid: string | number;
|
|
15
|
+
count: number;
|
|
16
|
+
[key: PropertyKey]: any;
|
|
17
|
+
};
|
|
18
|
+
export type DrawerSelectHotType = {
|
|
19
|
+
id: string | number;
|
|
20
|
+
text?: string;
|
|
21
|
+
name?: string;
|
|
22
|
+
data?: {
|
|
23
|
+
id: string | number;
|
|
24
|
+
name: string;
|
|
25
|
+
[key: PropertyKey]: any;
|
|
26
|
+
};
|
|
27
|
+
[key: PropertyKey]: any;
|
|
28
|
+
};
|
|
7
29
|
export type FlatTreeNode = {
|
|
8
30
|
text?: string;
|
|
9
31
|
value?: string | number;
|