zartui 3.1.83 → 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/es/pagination/index.css +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/pagination/index.css +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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
-
import { DrawerSelectFieldNames, DrawerSelectTreeNode, FlatTreeNode } from './types';
|
|
2
|
+
import { DrawerSelectCommonType, DrawerSelectFieldNames, DrawerSelectHotType, DrawerSelectTreeNode, FlatTreeNode } from './types';
|
|
3
3
|
declare const drawerSelectProps: {
|
|
4
4
|
treeData: {
|
|
5
5
|
type: PropType<DrawerSelectTreeNode[]>;
|
|
@@ -23,6 +23,19 @@ declare const drawerSelectProps: {
|
|
|
23
23
|
type: PropType<string>;
|
|
24
24
|
default: string;
|
|
25
25
|
};
|
|
26
|
+
commonTypeList: {
|
|
27
|
+
type: PropType<DrawerSelectCommonType[]>;
|
|
28
|
+
default: () => DrawerSelectCommonType[];
|
|
29
|
+
};
|
|
30
|
+
showCommonTypes: {
|
|
31
|
+
type: BooleanConstructor;
|
|
32
|
+
default: boolean;
|
|
33
|
+
};
|
|
34
|
+
commonTypeVisibleCount: NumberConstructor;
|
|
35
|
+
hotTypeList: {
|
|
36
|
+
type: PropType<DrawerSelectHotType[]>;
|
|
37
|
+
default: () => DrawerSelectHotType[];
|
|
38
|
+
};
|
|
26
39
|
};
|
|
27
40
|
export type DrawerSelectProps = ExtractPropTypes<typeof drawerSelectProps>;
|
|
28
41
|
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
@@ -48,7 +61,20 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
48
61
|
type: PropType<string>;
|
|
49
62
|
default: string;
|
|
50
63
|
};
|
|
51
|
-
|
|
64
|
+
commonTypeList: {
|
|
65
|
+
type: PropType<DrawerSelectCommonType[]>;
|
|
66
|
+
default: () => DrawerSelectCommonType[];
|
|
67
|
+
};
|
|
68
|
+
showCommonTypes: {
|
|
69
|
+
type: BooleanConstructor;
|
|
70
|
+
default: boolean;
|
|
71
|
+
};
|
|
72
|
+
commonTypeVisibleCount: NumberConstructor;
|
|
73
|
+
hotTypeList: {
|
|
74
|
+
type: PropType<DrawerSelectHotType[]>;
|
|
75
|
+
default: () => DrawerSelectHotType[];
|
|
76
|
+
};
|
|
77
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "change" | "clearAll")[], "select" | "change" | "clearAll", import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
|
52
78
|
treeData: {
|
|
53
79
|
type: PropType<DrawerSelectTreeNode[]>;
|
|
54
80
|
default: () => DrawerSelectTreeNode[];
|
|
@@ -71,14 +97,31 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
71
97
|
type: PropType<string>;
|
|
72
98
|
default: string;
|
|
73
99
|
};
|
|
100
|
+
commonTypeList: {
|
|
101
|
+
type: PropType<DrawerSelectCommonType[]>;
|
|
102
|
+
default: () => DrawerSelectCommonType[];
|
|
103
|
+
};
|
|
104
|
+
showCommonTypes: {
|
|
105
|
+
type: BooleanConstructor;
|
|
106
|
+
default: boolean;
|
|
107
|
+
};
|
|
108
|
+
commonTypeVisibleCount: NumberConstructor;
|
|
109
|
+
hotTypeList: {
|
|
110
|
+
type: PropType<DrawerSelectHotType[]>;
|
|
111
|
+
default: () => DrawerSelectHotType[];
|
|
112
|
+
};
|
|
74
113
|
}>> & Readonly<{
|
|
75
114
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
76
115
|
onSelect?: ((...args: any[]) => any) | undefined;
|
|
116
|
+
onClearAll?: ((...args: any[]) => any) | undefined;
|
|
77
117
|
}>, {
|
|
78
118
|
title: string;
|
|
79
119
|
placeholder: string;
|
|
80
120
|
treeData: DrawerSelectTreeNode[];
|
|
81
121
|
expandAll: boolean;
|
|
82
122
|
activeClassName: string;
|
|
123
|
+
commonTypeList: DrawerSelectCommonType[];
|
|
124
|
+
showCommonTypes: boolean;
|
|
125
|
+
hotTypeList: DrawerSelectHotType[];
|
|
83
126
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
84
127
|
export default _default;
|
|
@@ -5,6 +5,7 @@ import ZtSearch from "../search/index.mjs";
|
|
|
5
5
|
import ZtIcon from "../icon/index.mjs";
|
|
6
6
|
import ZtPopup from "../popup/index.mjs";
|
|
7
7
|
import ZtTag from "../tag/index.mjs";
|
|
8
|
+
import ZtButton from "../button/index.mjs";
|
|
8
9
|
import { deepClone } from "../utils/deep-clone.mjs";
|
|
9
10
|
import { assignDefaultFields } from "../picker/utils.mjs";
|
|
10
11
|
import { showConfirmDialog } from "../dialog/index.mjs";
|
|
@@ -19,12 +20,19 @@ const drawerSelectProps = {
|
|
|
19
20
|
default: false
|
|
20
21
|
},
|
|
21
22
|
defaultSelectNode: Object,
|
|
22
|
-
activeClassName: makeStringProp("")
|
|
23
|
+
activeClassName: makeStringProp(""),
|
|
24
|
+
commonTypeList: makeArrayProp(),
|
|
25
|
+
showCommonTypes: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: false
|
|
28
|
+
},
|
|
29
|
+
commonTypeVisibleCount: Number,
|
|
30
|
+
hotTypeList: makeArrayProp()
|
|
23
31
|
};
|
|
24
32
|
var stdin_default = defineComponent({
|
|
25
33
|
name,
|
|
26
34
|
props: drawerSelectProps,
|
|
27
|
-
emits: ["change", "select"],
|
|
35
|
+
emits: ["change", "select", "clearAll"],
|
|
28
36
|
setup(props, {
|
|
29
37
|
emit
|
|
30
38
|
}) {
|
|
@@ -36,8 +44,17 @@ var stdin_default = defineComponent({
|
|
|
36
44
|
const searchRef = ref();
|
|
37
45
|
const offset = ref(0);
|
|
38
46
|
const historyList = ref([]);
|
|
47
|
+
const showAllCommonTypes = ref(false);
|
|
48
|
+
const selectCommonId = ref(-1);
|
|
39
49
|
const defaultTreeNode = ref(props.treeData);
|
|
40
50
|
const fields = computed(() => assignDefaultFields(props.treeFieldName));
|
|
51
|
+
const visibleCommonTypeList = computed(() => {
|
|
52
|
+
const count = props.commonTypeVisibleCount;
|
|
53
|
+
if (typeof count !== "number") {
|
|
54
|
+
return props.commonTypeList;
|
|
55
|
+
}
|
|
56
|
+
return props.commonTypeList.slice(0, Math.max(0, count));
|
|
57
|
+
});
|
|
41
58
|
const {
|
|
42
59
|
value,
|
|
43
60
|
children,
|
|
@@ -121,6 +138,37 @@ var stdin_default = defineComponent({
|
|
|
121
138
|
updateOffset();
|
|
122
139
|
});
|
|
123
140
|
const isEmpty = (item) => !item[children] || item[children].length === 0;
|
|
141
|
+
const syncExpandNodeByParent = (item) => {
|
|
142
|
+
var _a, _b, _c;
|
|
143
|
+
const parent = (_a = item.parent) != null ? _a : [];
|
|
144
|
+
if (parent.length >= 2) {
|
|
145
|
+
const parentValue = (_b = parent[parent.length - 2]) == null ? void 0 : _b[value];
|
|
146
|
+
if (parentValue !== void 0) {
|
|
147
|
+
const stack = [...props.treeData];
|
|
148
|
+
while (stack.length > 0) {
|
|
149
|
+
const current = stack.shift();
|
|
150
|
+
if (!current)
|
|
151
|
+
continue;
|
|
152
|
+
if (current[value] === parentValue) {
|
|
153
|
+
expandNode.value = {
|
|
154
|
+
text: current[key],
|
|
155
|
+
value: current[value],
|
|
156
|
+
children: current[children]
|
|
157
|
+
};
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
if ((_c = current[children]) == null ? void 0 : _c.length) {
|
|
161
|
+
stack.push(...current[children]);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
expandNode.value = {
|
|
167
|
+
text: allData[key],
|
|
168
|
+
value: allData[value],
|
|
169
|
+
children: allData[children]
|
|
170
|
+
};
|
|
171
|
+
};
|
|
124
172
|
const onLabelClick = (item, assign = true) => {
|
|
125
173
|
const {
|
|
126
174
|
text,
|
|
@@ -137,6 +185,7 @@ var stdin_default = defineComponent({
|
|
|
137
185
|
}
|
|
138
186
|
if (isEmpty(item)) {
|
|
139
187
|
selectNode.value = item;
|
|
188
|
+
selectCommonId.value = item[value2];
|
|
140
189
|
emit("select", item);
|
|
141
190
|
}
|
|
142
191
|
item.checked = !item.checked;
|
|
@@ -199,6 +248,117 @@ var stdin_default = defineComponent({
|
|
|
199
248
|
}));
|
|
200
249
|
}
|
|
201
250
|
};
|
|
251
|
+
const findCommonTypeNode = (id) => {
|
|
252
|
+
return flatArray.value.find((item) => item[value] === id);
|
|
253
|
+
};
|
|
254
|
+
const onCommonTypeClick = (item) => {
|
|
255
|
+
const matchNode = findCommonTypeNode(item.types.id);
|
|
256
|
+
if (!matchNode)
|
|
257
|
+
return;
|
|
258
|
+
selectCommonId.value = item.types.id;
|
|
259
|
+
syncExpandNodeByParent(matchNode);
|
|
260
|
+
selectNode.value = matchNode;
|
|
261
|
+
emit("select", Object.assign(matchNode, {
|
|
262
|
+
parent: matchNode.parent
|
|
263
|
+
}));
|
|
264
|
+
};
|
|
265
|
+
const onClearCommonTypes = () => {
|
|
266
|
+
selectCommonId.value = -1;
|
|
267
|
+
showAllCommonTypes.value = false;
|
|
268
|
+
emit("clearAll");
|
|
269
|
+
};
|
|
270
|
+
const findHotTypeNode = (id) => {
|
|
271
|
+
return flatArray.value.find((item) => item[value] === id);
|
|
272
|
+
};
|
|
273
|
+
const renderCommonTypeButton = (item) => {
|
|
274
|
+
const active = item.types.id === selectCommonId.value;
|
|
275
|
+
return _createVNode(ZtButton, {
|
|
276
|
+
"size": "small",
|
|
277
|
+
"class": [bem("common-types--btn")],
|
|
278
|
+
"type": active ? "primary" : "default",
|
|
279
|
+
"backgroundColor": active ? "#3388ff" : "var(--zt-background)",
|
|
280
|
+
"borderColor": active ? "#3388ff" : "var(--zt-border-color)",
|
|
281
|
+
"color": active ? "var(--zt-white)" : "var(--zt-text-color)",
|
|
282
|
+
"onClick": () => onCommonTypeClick(item)
|
|
283
|
+
}, {
|
|
284
|
+
default: () => [item.types.name]
|
|
285
|
+
});
|
|
286
|
+
};
|
|
287
|
+
const onHotTypeClick = (item) => {
|
|
288
|
+
const matchNode = findHotTypeNode(item.id);
|
|
289
|
+
if (!matchNode)
|
|
290
|
+
return;
|
|
291
|
+
selectCommonId.value = item.id;
|
|
292
|
+
syncExpandNodeByParent(matchNode);
|
|
293
|
+
selectNode.value = matchNode;
|
|
294
|
+
emit("select", Object.assign(matchNode, {
|
|
295
|
+
parent: matchNode.parent
|
|
296
|
+
}));
|
|
297
|
+
};
|
|
298
|
+
const renderHotTypeButton = (item) => {
|
|
299
|
+
const active = item.id === selectCommonId.value;
|
|
300
|
+
return _createVNode(ZtButton, {
|
|
301
|
+
"size": "small",
|
|
302
|
+
"class": [bem("common-types--btn")],
|
|
303
|
+
"type": active ? "primary" : "default",
|
|
304
|
+
"backgroundColor": active ? "#3388ff" : "var(--zt-background)",
|
|
305
|
+
"borderColor": active ? "#3388ff" : "var(--zt-border-color)",
|
|
306
|
+
"color": active ? "var(--zt-white)" : "var(--zt-text-color)",
|
|
307
|
+
"onClick": () => onHotTypeClick(item)
|
|
308
|
+
}, {
|
|
309
|
+
default: () => [item.text || item.name]
|
|
310
|
+
});
|
|
311
|
+
};
|
|
312
|
+
const renderCommonTypes = () => {
|
|
313
|
+
if (!props.showCommonTypes)
|
|
314
|
+
return null;
|
|
315
|
+
return _createVNode("section", {
|
|
316
|
+
"class": [bem("common-types")]
|
|
317
|
+
}, [_createVNode("div", {
|
|
318
|
+
"class": [bem("common-types--head")]
|
|
319
|
+
}, [_createVNode("span", {
|
|
320
|
+
"class": [bem("common-types--label")]
|
|
321
|
+
}, [_createTextVNode("\u5E38\u7528\u5C0F\u7C7B")]), visibleCommonTypeList.value.length > 0 ? _createVNode("div", {
|
|
322
|
+
"class": [bem("common-types--mask")]
|
|
323
|
+
}, [_createVNode("div", {
|
|
324
|
+
"class": [bem("common-types--viewport")]
|
|
325
|
+
}, [_createVNode("div", {
|
|
326
|
+
"class": [bem("common-types--list")]
|
|
327
|
+
}, [visibleCommonTypeList.value.map(renderCommonTypeButton)])])]) : _createVNode("div", {
|
|
328
|
+
"class": [bem("common-types--empty")]
|
|
329
|
+
}, [_createTextVNode("\u6682\u65E0\u5E38\u7528\u5C0F\u7C7B")]), visibleCommonTypeList.value.length > 0 && _createVNode("div", {
|
|
330
|
+
"class": [bem("common-types--icon")],
|
|
331
|
+
"onClick": () => showAllCommonTypes.value = !showAllCommonTypes.value
|
|
332
|
+
}, [_createVNode(ZtIcon, {
|
|
333
|
+
"size": "24",
|
|
334
|
+
"name": showAllCommonTypes.value ? "keyboard-arrow-up" : "keyboard-arrow-down",
|
|
335
|
+
"color": showAllCommonTypes.value ? "var(--zt-primary-color)" : void 0
|
|
336
|
+
}, null)])]), showAllCommonTypes.value && visibleCommonTypeList.value.length > 0 && _createVNode("div", {
|
|
337
|
+
"class": [bem("common-types--panel")]
|
|
338
|
+
}, [_createVNode("div", {
|
|
339
|
+
"class": [bem("common-types--panel-list")]
|
|
340
|
+
}, [visibleCommonTypeList.value.map(renderCommonTypeButton)]), _createVNode("div", {
|
|
341
|
+
"class": [bem("common-types--clear")],
|
|
342
|
+
"onClick": onClearCommonTypes
|
|
343
|
+
}, [_createVNode(ZtIcon, {
|
|
344
|
+
"name": "delete",
|
|
345
|
+
"size": "20"
|
|
346
|
+
}, null), _createVNode("span", {
|
|
347
|
+
"class": [bem("common-types--clear-text")]
|
|
348
|
+
}, [_createTextVNode("\u6E05\u7A7A\u5E38\u7528\u5C0F\u7C7B")])])])]);
|
|
349
|
+
};
|
|
350
|
+
const renderHotTypes = () => {
|
|
351
|
+
var _a;
|
|
352
|
+
if (!((_a = props.hotTypeList) == null ? void 0 : _a.length))
|
|
353
|
+
return null;
|
|
354
|
+
return _createVNode("section", {
|
|
355
|
+
"class": [bem("hot-types")]
|
|
356
|
+
}, [_createVNode("div", {
|
|
357
|
+
"class": [bem("hot-types--label")]
|
|
358
|
+
}, [_createTextVNode("\u70ED\u70B9\u5C0F\u7C7B")]), _createVNode("div", {
|
|
359
|
+
"class": [bem("hot-types--list")]
|
|
360
|
+
}, [props.hotTypeList.map(renderHotTypeButton)])]);
|
|
361
|
+
};
|
|
202
362
|
const renderSecondTree = (item) => {
|
|
203
363
|
var _a, _b;
|
|
204
364
|
const text = item[fields.value.text];
|
|
@@ -334,7 +494,7 @@ var stdin_default = defineComponent({
|
|
|
334
494
|
}, null), _createTextVNode("\u6E05\u7A7A\u641C\u7D22\u5386\u53F2")])]), historyList.value.length === 0 && _createVNode("div", {
|
|
335
495
|
"class": [bem("empty")]
|
|
336
496
|
}, [_createTextVNode("\u6682\u65E0\u641C\u7D22\u8BB0\u5F55")])])]
|
|
337
|
-
})]), [[_vShow, show.value]])]), _createVNode("div", {
|
|
497
|
+
})]), [[_vShow, show.value]])]), renderCommonTypes(), renderHotTypes(), _createVNode("div", {
|
|
338
498
|
"class": [bem("name"), "zt-hairline--bottom"]
|
|
339
499
|
}, [props.title]), _createVNode("main", {
|
|
340
500
|
"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;
|
package/es/index.d.ts
CHANGED
package/es/index.mjs
CHANGED
|
@@ -78,7 +78,7 @@ import { Timeline } from "./timeline/index.mjs";
|
|
|
78
78
|
import { Toast } from "./toast/index.mjs";
|
|
79
79
|
import { Uploader } from "./uploader/index.mjs";
|
|
80
80
|
import { Video } from "./video/index.mjs";
|
|
81
|
-
const version = "3.1.
|
|
81
|
+
const version = "3.1.85";
|
|
82
82
|
function install(app) {
|
|
83
83
|
const components = [
|
|
84
84
|
ActionSheet,
|
package/es/pagination/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--zt-pagination-bottom: 29px;--zt-pagination-item-size: 44px;--zt-pagination-gap: 16px;--zt-pagination-background: #2d4b7380;--zt-pagination-backdrop-filter: blur(5.44px);--zt-pagination-box-shadow: 0 4px 8px 0 #2d4b7333;--zt-pagination-text-color: #fff;--zt-pagination-disabled-icon-color: rgba(255, 255, 255, .45);--zt-pagination-font-size: 14px;--zt-pagination-text-line-height: 17px;--zt-pagination-z-index: 100}.zt-pagination{position:fixed;left:0;right:0;bottom:var(--zt-pagination-bottom);z-index:var(--zt-pagination-z-index);display:flex;align-items:center;justify-content:center;pointer-events:none}.zt-pagination__button,.zt-pagination__page{height:var(--zt-pagination-item-size);background:var(--zt-pagination-background);-webkit-backdrop-filter:var(--zt-pagination-backdrop-filter);backdrop-filter:var(--zt-pagination-backdrop-filter);box-shadow:var(--zt-pagination-box-shadow)}.zt-pagination__button{width:var(--zt-pagination-item-size);padding:0;border:0;border-radius:50%;color:var(--zt-pagination-text-color);display:flex;align-items:center;justify-content:center;cursor:pointer;pointer-events:auto;transition:opacity var(--zt-duration-fast),transform var(--zt-duration-fast)}.zt-pagination__button:not(.zt-pagination__button--disabled):hover{opacity:.88;transform:scale(1.04)}.zt-pagination__button:not(.zt-pagination__button--disabled):active{opacity:.75;transform:scale(.96)}.zt-pagination__button--disabled{color:var(--zt-pagination-disabled-icon-color);cursor:default}.zt-pagination__page{margin:0 var(--zt-pagination-gap);padding:0 27px;border:0;border-radius:22px;display:flex;align-items:center;justify-content:center;color:var(--zt-pagination-text-color);cursor:pointer;pointer-events:auto;-webkit-appearance:none;-moz-appearance:none;appearance:none}.zt-pagination__text{height:var(--zt-pagination-text-line-height);color:var(--zt-pagination-text-color);font-size:var(--zt-pagination-font-size);line-height:var(--zt-pagination-text-line-height)}.zt-pagination__next-icon{transform:rotate(180deg)}.zt-pagination__popup{height:100%;display:flex;flex-direction:column;background:#fff}.zt-pagination__popup-title{padding-top:var(--zt-popup-close-icon-margin);color:#2d4b73;font-size:18px;font-weight:600;text-align:center}.zt-pagination__popup-pages{flex:1;display:grid;grid-template-columns:repeat(5,40px);grid-auto-rows:40px;justify-content:space-around;row-gap:24px;padding:24px 0;overflow-y:auto}.zt-pagination__popup-page{width:40px;height:40px;padding:0;border:0;border-radius:50%;color:#
|
|
1
|
+
:root{--zt-pagination-bottom: 29px;--zt-pagination-item-size: 44px;--zt-pagination-gap: 16px;--zt-pagination-background: #2d4b7380;--zt-pagination-backdrop-filter: blur(5.44px);--zt-pagination-box-shadow: 0 4px 8px 0 #2d4b7333;--zt-pagination-text-color: #fff;--zt-pagination-disabled-icon-color: rgba(255, 255, 255, .45);--zt-pagination-font-size: 14px;--zt-pagination-text-line-height: 17px;--zt-pagination-z-index: 100}.zt-pagination{position:fixed;left:0;right:0;bottom:var(--zt-pagination-bottom);z-index:var(--zt-pagination-z-index);display:flex;align-items:center;justify-content:center;pointer-events:none}.zt-pagination__button,.zt-pagination__page{height:var(--zt-pagination-item-size);background:var(--zt-pagination-background);-webkit-backdrop-filter:var(--zt-pagination-backdrop-filter);backdrop-filter:var(--zt-pagination-backdrop-filter);box-shadow:var(--zt-pagination-box-shadow)}.zt-pagination__button{width:var(--zt-pagination-item-size);padding:0;border:0;border-radius:50%;color:var(--zt-pagination-text-color);display:flex;align-items:center;justify-content:center;cursor:pointer;pointer-events:auto;transition:opacity var(--zt-duration-fast),transform var(--zt-duration-fast)}.zt-pagination__button:not(.zt-pagination__button--disabled):hover{opacity:.88;transform:scale(1.04)}.zt-pagination__button:not(.zt-pagination__button--disabled):active{opacity:.75;transform:scale(.96)}.zt-pagination__button--disabled{color:var(--zt-pagination-disabled-icon-color);cursor:default}.zt-pagination__page{margin:0 var(--zt-pagination-gap);padding:0 27px;border:0;border-radius:22px;display:flex;align-items:center;justify-content:center;color:var(--zt-pagination-text-color);cursor:pointer;pointer-events:auto;-webkit-appearance:none;-moz-appearance:none;appearance:none}.zt-pagination__text{height:var(--zt-pagination-text-line-height);color:var(--zt-pagination-text-color);font-size:var(--zt-pagination-font-size);line-height:var(--zt-pagination-text-line-height)}.zt-pagination__next-icon{transform:rotate(180deg)}.zt-pagination__popup{height:100%;display:flex;flex-direction:column;background:#fff}.zt-pagination__popup-title{padding-top:var(--zt-popup-close-icon-margin);color:#2d4b73;font-size:18px;font-weight:600;text-align:center}.zt-pagination__popup-pages{flex:1;display:grid;grid-template-columns:repeat(5,40px);grid-auto-rows:40px;justify-content:space-around;row-gap:24px;padding:24px 0;overflow-y:auto}.zt-pagination__popup-page{width:40px;height:40px;padding:0;border:0;border-radius:50%;color:#235;background:#F1F6FA;font-size:16px;line-height:24px;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;transition:background-color var(--zt-duration-fast),transform var(--zt-duration-fast),opacity var(--zt-duration-fast)}.zt-pagination__popup-page:hover{background:rgba(45,75,115,.1);transform:scale(1.04)}.zt-pagination__popup-page:active{opacity:.75;transform:scale(.96)}.zt-pagination__popup-footer{padding:8px 16px;border-top:1px solid var(--zt-border-color)}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
-
import { DrawerSelectFieldNames, DrawerSelectTreeNode, FlatTreeNode } from './types';
|
|
2
|
+
import { DrawerSelectCommonType, DrawerSelectFieldNames, DrawerSelectHotType, DrawerSelectTreeNode, FlatTreeNode } from './types';
|
|
3
3
|
declare const drawerSelectProps: {
|
|
4
4
|
treeData: {
|
|
5
5
|
type: PropType<DrawerSelectTreeNode[]>;
|
|
@@ -23,6 +23,19 @@ declare const drawerSelectProps: {
|
|
|
23
23
|
type: PropType<string>;
|
|
24
24
|
default: string;
|
|
25
25
|
};
|
|
26
|
+
commonTypeList: {
|
|
27
|
+
type: PropType<DrawerSelectCommonType[]>;
|
|
28
|
+
default: () => DrawerSelectCommonType[];
|
|
29
|
+
};
|
|
30
|
+
showCommonTypes: {
|
|
31
|
+
type: BooleanConstructor;
|
|
32
|
+
default: boolean;
|
|
33
|
+
};
|
|
34
|
+
commonTypeVisibleCount: NumberConstructor;
|
|
35
|
+
hotTypeList: {
|
|
36
|
+
type: PropType<DrawerSelectHotType[]>;
|
|
37
|
+
default: () => DrawerSelectHotType[];
|
|
38
|
+
};
|
|
26
39
|
};
|
|
27
40
|
export type DrawerSelectProps = ExtractPropTypes<typeof drawerSelectProps>;
|
|
28
41
|
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
@@ -48,7 +61,20 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
48
61
|
type: PropType<string>;
|
|
49
62
|
default: string;
|
|
50
63
|
};
|
|
51
|
-
|
|
64
|
+
commonTypeList: {
|
|
65
|
+
type: PropType<DrawerSelectCommonType[]>;
|
|
66
|
+
default: () => DrawerSelectCommonType[];
|
|
67
|
+
};
|
|
68
|
+
showCommonTypes: {
|
|
69
|
+
type: BooleanConstructor;
|
|
70
|
+
default: boolean;
|
|
71
|
+
};
|
|
72
|
+
commonTypeVisibleCount: NumberConstructor;
|
|
73
|
+
hotTypeList: {
|
|
74
|
+
type: PropType<DrawerSelectHotType[]>;
|
|
75
|
+
default: () => DrawerSelectHotType[];
|
|
76
|
+
};
|
|
77
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "change" | "clearAll")[], "select" | "change" | "clearAll", import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
|
52
78
|
treeData: {
|
|
53
79
|
type: PropType<DrawerSelectTreeNode[]>;
|
|
54
80
|
default: () => DrawerSelectTreeNode[];
|
|
@@ -71,14 +97,31 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
71
97
|
type: PropType<string>;
|
|
72
98
|
default: string;
|
|
73
99
|
};
|
|
100
|
+
commonTypeList: {
|
|
101
|
+
type: PropType<DrawerSelectCommonType[]>;
|
|
102
|
+
default: () => DrawerSelectCommonType[];
|
|
103
|
+
};
|
|
104
|
+
showCommonTypes: {
|
|
105
|
+
type: BooleanConstructor;
|
|
106
|
+
default: boolean;
|
|
107
|
+
};
|
|
108
|
+
commonTypeVisibleCount: NumberConstructor;
|
|
109
|
+
hotTypeList: {
|
|
110
|
+
type: PropType<DrawerSelectHotType[]>;
|
|
111
|
+
default: () => DrawerSelectHotType[];
|
|
112
|
+
};
|
|
74
113
|
}>> & Readonly<{
|
|
75
114
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
76
115
|
onSelect?: ((...args: any[]) => any) | undefined;
|
|
116
|
+
onClearAll?: ((...args: any[]) => any) | undefined;
|
|
77
117
|
}>, {
|
|
78
118
|
title: string;
|
|
79
119
|
placeholder: string;
|
|
80
120
|
treeData: DrawerSelectTreeNode[];
|
|
81
121
|
expandAll: boolean;
|
|
82
122
|
activeClassName: string;
|
|
123
|
+
commonTypeList: DrawerSelectCommonType[];
|
|
124
|
+
showCommonTypes: boolean;
|
|
125
|
+
hotTypeList: DrawerSelectHotType[];
|
|
83
126
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
84
127
|
export default _default;
|