vue-devui 1.0.0-rc.13 → 1.0.0-rc.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/README.md +161 -156
- package/alert/index.umd.js +1 -1
- package/auto-complete/index.es.js +241 -82
- package/auto-complete/index.umd.js +28 -17
- package/auto-complete/style.css +1 -1
- package/avatar/index.umd.js +1 -1
- package/badge/index.umd.js +1 -1
- package/button/index.es.js +21 -42
- package/button/index.umd.js +9 -9
- package/card/index.umd.js +1 -1
- package/checkbox/index.es.js +94 -77
- package/checkbox/index.umd.js +26 -15
- package/collapse/index.es.js +3 -21
- package/collapse/index.umd.js +1 -1
- package/countdown/index.umd.js +1 -1
- package/date-picker-pro/index.es.js +1384 -220
- package/date-picker-pro/index.umd.js +25 -14
- package/date-picker-pro/style.css +1 -1
- package/drawer/index.es.js +4 -17
- package/drawer/index.umd.js +1 -1
- package/dropdown/index.es.js +4 -22
- package/dropdown/index.umd.js +1 -1
- package/editable-select/index.es.js +254 -99
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.es.js +85 -71
- package/form/index.umd.js +22 -11
- package/fullscreen/index.umd.js +1 -1
- package/grid/index.es.js +7 -20
- package/grid/index.umd.js +1 -1
- package/icon/index.umd.js +1 -1
- package/image-preview/index.es.js +12 -23
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/input/index.es.js +239 -75
- package/input/index.umd.js +27 -16
- package/input-number/index.es.js +1 -16
- package/input-number/index.umd.js +1 -1
- package/layout/index.es.js +1 -1
- package/layout/index.umd.js +1 -1
- package/loading/index.es.js +15 -38
- package/loading/index.umd.js +1 -1
- package/message/index.d.ts +7 -0
- package/message/index.es.js +534 -0
- package/message/index.umd.js +1 -0
- package/message/package.json +7 -0
- package/message/style.css +1 -0
- package/modal/index.es.js +11 -43
- package/modal/index.umd.js +1 -1
- package/notification/index.es.js +16 -22
- package/notification/index.umd.js +1 -1
- package/nuxt/components/Message.js +3 -0
- package/nuxt/components/animationInjectionKey.js +3 -0
- package/nuxt/components/messageProps.js +3 -0
- package/nuxt/components/roundInjectionKey.js +3 -0
- package/nuxt/components/skeletonItemProps.js +3 -0
- package/overlay/index.es.js +1 -1
- package/overlay/index.umd.js +1 -1
- package/package.json +4 -2
- package/pagination/index.es.js +152 -2
- package/pagination/index.umd.js +1 -1
- package/panel/index.umd.js +1 -1
- package/popover/index.es.js +1 -1
- package/popover/index.umd.js +4 -4
- package/progress/index.umd.js +3 -3
- package/radio/index.es.js +91 -75
- package/radio/index.umd.js +28 -17
- package/radio/style.css +1 -1
- package/rate/index.umd.js +1 -1
- package/result/index.umd.js +1 -1
- package/ripple/index.es.js +5 -18
- package/ripple/index.umd.js +1 -1
- package/search/index.es.js +255 -78
- package/search/index.umd.js +27 -16
- package/search/style.css +1 -1
- package/select/index.es.js +283 -114
- package/select/index.umd.js +27 -16
- package/select/style.css +1 -1
- package/skeleton/index.es.js +87 -261
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.umd.js +1 -1
- package/splitter/index.es.js +175 -32
- package/splitter/index.umd.js +13 -13
- package/statistic/index.es.js +0 -21
- package/statistic/index.umd.js +1 -1
- package/status/index.umd.js +1 -1
- package/steps/index.umd.js +1 -1
- package/style.css +1 -1
- package/switch/index.es.js +85 -71
- package/switch/index.umd.js +25 -14
- package/table/index.es.js +309 -96
- package/table/index.umd.js +25 -14
- package/table/style.css +1 -1
- package/tabs/index.umd.js +1 -1
- package/tag/index.umd.js +1 -1
- package/textarea/index.es.js +88 -72
- package/textarea/index.umd.js +26 -15
- package/time-picker/index.es.js +248 -89
- package/time-picker/index.umd.js +25 -14
- package/time-select/index.es.js +283 -114
- package/time-select/index.umd.js +26 -15
- package/time-select/style.css +1 -1
- package/timeline/index.umd.js +1 -1
- package/tooltip/index.es.js +1 -1
- package/tooltip/index.umd.js +4 -4
- package/tree/index.es.js +422 -110
- package/tree/index.umd.js +25 -14
- package/tree/style.css +1 -1
- package/upload/index.es.js +168 -49
- package/upload/index.umd.js +1 -1
- package/vue-devui.es.js +13601 -13023
- package/vue-devui.umd.js +32 -21
- package/LICENSE +0 -23
package/tree/index.es.js
CHANGED
|
@@ -1,35 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
|
-
import { createVNode, defineComponent, toRefs, inject, getCurrentInstance, watch, provide, reactive, onUnmounted, Transition, mergeProps, ref, unref, nextTick, Comment, Text, h, Fragment, withDirectives, cloneVNode, computed, onMounted, Teleport, createTextVNode, onBeforeUnmount, toRef, renderSlot, useSlots, resolveComponent, isVNode, onUpdated, shallowRef, toRaw, watchEffect } from "vue";
|
|
1
|
+
import { createVNode, defineComponent, toRefs, inject, ref, reactive, getCurrentInstance, watch, provide, onUnmounted, Transition, mergeProps, nextTick, unref, Comment, Text, Fragment, h, withDirectives, cloneVNode, computed, onMounted, Teleport, createTextVNode, onBeforeUnmount, toRef, renderSlot, useSlots, resolveComponent, isVNode, onUpdated, shallowRef, toRaw, watchEffect } from "vue";
|
|
33
2
|
import { offset, autoPlacement, arrow, shift, computePosition } from "@floating-ui/dom";
|
|
34
3
|
const USE_TREE_TOKEN = "use-tree-token";
|
|
35
4
|
const TREE_INSTANCE = "tree-instance";
|
|
@@ -142,6 +111,155 @@ var DTreeNodeToggle = defineComponent({
|
|
|
142
111
|
};
|
|
143
112
|
}
|
|
144
113
|
});
|
|
114
|
+
function deepAssign(...objects) {
|
|
115
|
+
const isObject2 = (obj) => obj && typeof obj === "object";
|
|
116
|
+
return objects.reduce((prev, from) => {
|
|
117
|
+
Object.keys(from).forEach((key) => {
|
|
118
|
+
const pVal = prev[key];
|
|
119
|
+
const oVal = from[key];
|
|
120
|
+
if (Array.isArray(pVal) && Array.isArray(oVal)) {
|
|
121
|
+
prev[key] = Array.from(/* @__PURE__ */ new Set([...oVal, ...pVal]));
|
|
122
|
+
} else if (isObject2(pVal) && isObject2(oVal)) {
|
|
123
|
+
prev[key] = deepAssign(pVal, oVal);
|
|
124
|
+
} else {
|
|
125
|
+
prev[key] = oVal;
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
return prev;
|
|
129
|
+
}, {});
|
|
130
|
+
}
|
|
131
|
+
var zhCN = {
|
|
132
|
+
pagination: {
|
|
133
|
+
totalItemText: "\u6240\u6709\u6761\u76EE",
|
|
134
|
+
goToText: "\u8DF3\u81F3"
|
|
135
|
+
},
|
|
136
|
+
accordion: {
|
|
137
|
+
loading: "\u52A0\u8F7D\u4E2D",
|
|
138
|
+
noData: "\u6CA1\u6709\u6570\u636E"
|
|
139
|
+
},
|
|
140
|
+
autoCompleteDropdown: {
|
|
141
|
+
latestInput: "\u6700\u8FD1\u8F93\u5165"
|
|
142
|
+
},
|
|
143
|
+
cascaderList: {
|
|
144
|
+
noData: "\u6CA1\u6709\u6570\u636E"
|
|
145
|
+
},
|
|
146
|
+
colorPicker: {
|
|
147
|
+
foundationPanel: "\u57FA\u7840\u9762\u677F",
|
|
148
|
+
advancedPanel: "\u9AD8\u7EA7\u9762\u677F"
|
|
149
|
+
},
|
|
150
|
+
datePickerPro: {
|
|
151
|
+
ok: "\u786E\u5B9A",
|
|
152
|
+
placeholder: "\u8BF7\u9009\u62E9\u65E5\u671F",
|
|
153
|
+
month1: "1\u6708",
|
|
154
|
+
month2: "2\u6708",
|
|
155
|
+
month3: "3\u6708",
|
|
156
|
+
month4: "4\u6708",
|
|
157
|
+
month5: "5\u6708",
|
|
158
|
+
month6: "6\u6708",
|
|
159
|
+
month7: "7\u6708",
|
|
160
|
+
month8: "8\u6708",
|
|
161
|
+
month9: "9\u6708",
|
|
162
|
+
month10: "10\u6708",
|
|
163
|
+
month11: "11\u6708",
|
|
164
|
+
month12: "12\u6708",
|
|
165
|
+
year: "\u5E74",
|
|
166
|
+
startPlaceholder: "\u8BF7\u9009\u62E9\u5F00\u59CB\u65E5\u671F",
|
|
167
|
+
endPlaceholder: "\u8BF7\u9009\u62E9\u7ED3\u675F\u65E5\u671F",
|
|
168
|
+
getWeekDays() {
|
|
169
|
+
return ["\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"];
|
|
170
|
+
},
|
|
171
|
+
getTimeArr() {
|
|
172
|
+
return ["\u65F6", "\u5206", "\u79D2"];
|
|
173
|
+
},
|
|
174
|
+
getYearMonthStr(year, month) {
|
|
175
|
+
return `${year}\u5E74${month}\u6708`;
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
editableSelect: {
|
|
179
|
+
noRelatedRecords: "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55",
|
|
180
|
+
noData: "\u6CA1\u6709\u6570\u636E"
|
|
181
|
+
},
|
|
182
|
+
input: {
|
|
183
|
+
placeholder: "\u8BF7\u8F93\u5165"
|
|
184
|
+
},
|
|
185
|
+
splitterBar: {
|
|
186
|
+
collapse: "\u6536\u8D77",
|
|
187
|
+
expand: "\u5C55\u5F00"
|
|
188
|
+
},
|
|
189
|
+
stepsGuide: {
|
|
190
|
+
previous: "\u4E0A\u4E00\u6B65",
|
|
191
|
+
continue: "\u6211\u77E5\u9053\u5566\uFF0C\u7EE7\u7EED",
|
|
192
|
+
ok: "\u6211\u77E5\u9053\u5566"
|
|
193
|
+
},
|
|
194
|
+
table: {
|
|
195
|
+
selectAll: "\u5168\u9009",
|
|
196
|
+
ok: "\u786E\u5B9A"
|
|
197
|
+
},
|
|
198
|
+
timePopup: {
|
|
199
|
+
ok: "\u786E\u5B9A"
|
|
200
|
+
},
|
|
201
|
+
transfer: {
|
|
202
|
+
unit: "\u9879",
|
|
203
|
+
panelUnit: "\u9879",
|
|
204
|
+
headerUnit: "\u9879",
|
|
205
|
+
noData: "\u6682\u65E0\u6570\u636E",
|
|
206
|
+
placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22"
|
|
207
|
+
},
|
|
208
|
+
tree: {
|
|
209
|
+
loading: "\u52A0\u8F7D\u4E2D",
|
|
210
|
+
newNode: "\u65B0\u8282\u70B9",
|
|
211
|
+
selectPlaceholder: "\u8BF7\u9009\u62E9"
|
|
212
|
+
},
|
|
213
|
+
upload: {
|
|
214
|
+
placeholder: "\u9009\u62E9\u6587\u4EF6",
|
|
215
|
+
getExistSameNameFilesMsg(sameNames) {
|
|
216
|
+
return `\u60A8\u4E0A\u4F20\u7684 "${sameNames}" \u5B58\u5728\u91CD\u540D\u6587\u4EF6, \u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6`;
|
|
217
|
+
},
|
|
218
|
+
getAllFilesBeyondMaximalFileSizeMsg(maximalSize) {
|
|
219
|
+
return `\u6700\u5927\u652F\u6301\u4E0A\u4F20${maximalSize}MB\u7684\u6587\u4EF6, \u60A8\u672C\u6B21\u4E0A\u4F20\u7684\u6240\u6709\u6587\u4EF6\u8D85\u8FC7\u53EF\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F`;
|
|
220
|
+
},
|
|
221
|
+
getBeyondMaximalFileSizeMsg(filename, maximalSize) {
|
|
222
|
+
return `\u6700\u5927\u652F\u6301\u4E0A\u4F20${maximalSize}MB\u7684\u6587\u4EF6, \u60A8\u4E0A\u4F20\u7684\u6587\u4EF6"${filename}"\u8D85\u8FC7\u53EF\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F`;
|
|
223
|
+
},
|
|
224
|
+
getNotAllowedFileTypeMsg(filename, scope) {
|
|
225
|
+
return `\u652F\u6301\u7684\u6587\u4EF6\u7C7B\u578B: "${scope}", \u60A8\u4E0A\u4F20\u7684\u6587\u4EF6"${filename}"\u4E0D\u5728\u5141\u8BB8\u8303\u56F4\u5185\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6`;
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
search: {
|
|
229
|
+
placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u5B57"
|
|
230
|
+
},
|
|
231
|
+
select: {
|
|
232
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
233
|
+
noDataText: "\u65E0\u6570\u636E",
|
|
234
|
+
noMatchText: "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55",
|
|
235
|
+
loadingText: "\u52A0\u8F7D\u4E2D..."
|
|
236
|
+
},
|
|
237
|
+
tagInput: {
|
|
238
|
+
maxTagsText: "\u5DF2\u8FBE\u5230\u6700\u5927\u4E2A\u6570\uFF1A"
|
|
239
|
+
},
|
|
240
|
+
timeSelect: {
|
|
241
|
+
placeholder: "\u8BF7\u9009\u62E9\u65F6\u95F4"
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
const lang = ref("zh-CN");
|
|
245
|
+
let langMessages = reactive({
|
|
246
|
+
[lang.value]: zhCN
|
|
247
|
+
});
|
|
248
|
+
const Locale = {
|
|
249
|
+
messages() {
|
|
250
|
+
return langMessages[lang.value];
|
|
251
|
+
},
|
|
252
|
+
lang() {
|
|
253
|
+
return lang.value;
|
|
254
|
+
},
|
|
255
|
+
use(newLang, newMessages2) {
|
|
256
|
+
lang.value = newLang;
|
|
257
|
+
this.add({ [newLang]: newMessages2 });
|
|
258
|
+
},
|
|
259
|
+
add(newMessages2 = {}) {
|
|
260
|
+
langMessages = deepAssign(langMessages, newMessages2);
|
|
261
|
+
}
|
|
262
|
+
};
|
|
145
263
|
const camelize = (name) => name.substring(1).replace(/^\S/, (s) => s.toLocaleLowerCase());
|
|
146
264
|
function get(object4, path) {
|
|
147
265
|
const keys = path.split(".");
|
|
@@ -155,7 +273,8 @@ function get(object4, path) {
|
|
|
155
273
|
function createI18nTranslate(name, app, newPrefix) {
|
|
156
274
|
const prefix = newPrefix || camelize(name) + ".";
|
|
157
275
|
return (path) => {
|
|
158
|
-
|
|
276
|
+
var _a;
|
|
277
|
+
const messages2 = ((_a = app == null ? void 0 : app.appContext.config.globalProperties.langMessages) == null ? void 0 : _a.value) || Locale.messages();
|
|
159
278
|
const message = get(messages2, prefix + path) || get(messages2, path);
|
|
160
279
|
return message;
|
|
161
280
|
};
|
|
@@ -210,7 +329,8 @@ const commonProps = {
|
|
|
210
329
|
default: "md"
|
|
211
330
|
}
|
|
212
331
|
};
|
|
213
|
-
const checkboxProps =
|
|
332
|
+
const checkboxProps = {
|
|
333
|
+
...commonProps,
|
|
214
334
|
checked: {
|
|
215
335
|
type: Boolean,
|
|
216
336
|
default: false
|
|
@@ -240,8 +360,9 @@ const checkboxProps = __spreadProps(__spreadValues({}, commonProps), {
|
|
|
240
360
|
type: Boolean,
|
|
241
361
|
default: false
|
|
242
362
|
}
|
|
243
|
-
}
|
|
244
|
-
const checkboxGroupProps =
|
|
363
|
+
};
|
|
364
|
+
const checkboxGroupProps = {
|
|
365
|
+
...commonProps,
|
|
245
366
|
modelValue: {
|
|
246
367
|
type: Array,
|
|
247
368
|
required: true
|
|
@@ -278,7 +399,7 @@ const checkboxGroupProps = __spreadProps(__spreadValues({}, commonProps), {
|
|
|
278
399
|
type: String,
|
|
279
400
|
default: ""
|
|
280
401
|
}
|
|
281
|
-
}
|
|
402
|
+
};
|
|
282
403
|
const checkboxGroupInjectionKey = Symbol("d-checkbox-group");
|
|
283
404
|
const formProps = {
|
|
284
405
|
data: {
|
|
@@ -1046,7 +1167,7 @@ var lodash = { exports: {} };
|
|
|
1046
1167
|
var objectCtorString = funcToString.call(Object2);
|
|
1047
1168
|
var oldDash = root._;
|
|
1048
1169
|
var reIsNative = RegExp2("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
|
|
1049
|
-
var
|
|
1170
|
+
var Buffer = moduleExports ? context.Buffer : undefined$1, Symbol2 = context.Symbol, Uint8Array = context.Uint8Array, allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined$1, getPrototype = overArg(Object2.getPrototypeOf, Object2), objectCreate = Object2.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : undefined$1, symIterator = Symbol2 ? Symbol2.iterator : undefined$1, symToStringTag = Symbol2 ? Symbol2.toStringTag : undefined$1;
|
|
1050
1171
|
var defineProperty = function() {
|
|
1051
1172
|
try {
|
|
1052
1173
|
var func = getNative(Object2, "defineProperty");
|
|
@@ -1056,11 +1177,11 @@ var lodash = { exports: {} };
|
|
|
1056
1177
|
}
|
|
1057
1178
|
}();
|
|
1058
1179
|
var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date2 && Date2.now !== root.Date.now && Date2.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
|
|
1059
|
-
var nativeCeil = Math2.ceil, nativeFloor = Math2.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer =
|
|
1060
|
-
var DataView = getNative(context, "DataView"), Map2 = getNative(context, "Map"), Promise2 = getNative(context, "Promise"),
|
|
1061
|
-
var metaMap =
|
|
1180
|
+
var nativeCeil = Math2.ceil, nativeFloor = Math2.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined$1, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object2.keys, Object2), nativeMax = Math2.max, nativeMin = Math2.min, nativeNow = Date2.now, nativeParseInt = context.parseInt, nativeRandom = Math2.random, nativeReverse = arrayProto.reverse;
|
|
1181
|
+
var DataView = getNative(context, "DataView"), Map2 = getNative(context, "Map"), Promise2 = getNative(context, "Promise"), Set2 = getNative(context, "Set"), WeakMap = getNative(context, "WeakMap"), nativeCreate = getNative(Object2, "create");
|
|
1182
|
+
var metaMap = WeakMap && new WeakMap();
|
|
1062
1183
|
var realNames = {};
|
|
1063
|
-
var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(
|
|
1184
|
+
var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap);
|
|
1064
1185
|
var symbolProto = Symbol2 ? Symbol2.prototype : undefined$1, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined$1, symbolToString = symbolProto ? symbolProto.toString : undefined$1;
|
|
1065
1186
|
function lodash2(value) {
|
|
1066
1187
|
if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
|
|
@@ -2308,7 +2429,7 @@ var lodash = { exports: {} };
|
|
|
2308
2429
|
}
|
|
2309
2430
|
function cloneArrayBuffer(arrayBuffer) {
|
|
2310
2431
|
var result2 = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
|
2311
|
-
new
|
|
2432
|
+
new Uint8Array(result2).set(new Uint8Array(arrayBuffer));
|
|
2312
2433
|
return result2;
|
|
2313
2434
|
}
|
|
2314
2435
|
function cloneDataView(dataView, isDeep) {
|
|
@@ -2752,8 +2873,8 @@ var lodash = { exports: {} };
|
|
|
2752
2873
|
return func(number4);
|
|
2753
2874
|
};
|
|
2754
2875
|
}
|
|
2755
|
-
var createSet = !(
|
|
2756
|
-
return new
|
|
2876
|
+
var createSet = !(Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY) ? noop : function(values2) {
|
|
2877
|
+
return new Set2(values2);
|
|
2757
2878
|
};
|
|
2758
2879
|
function createToPairs(keysFunc) {
|
|
2759
2880
|
return function(object4) {
|
|
@@ -2890,7 +3011,7 @@ var lodash = { exports: {} };
|
|
|
2890
3011
|
object4 = object4.buffer;
|
|
2891
3012
|
other = other.buffer;
|
|
2892
3013
|
case arrayBufferTag:
|
|
2893
|
-
if (object4.byteLength != other.byteLength || !equalFunc(new
|
|
3014
|
+
if (object4.byteLength != other.byteLength || !equalFunc(new Uint8Array(object4), new Uint8Array(other))) {
|
|
2894
3015
|
return false;
|
|
2895
3016
|
}
|
|
2896
3017
|
return true;
|
|
@@ -3052,7 +3173,7 @@ var lodash = { exports: {} };
|
|
|
3052
3173
|
return result2;
|
|
3053
3174
|
};
|
|
3054
3175
|
var getTag = baseGetTag;
|
|
3055
|
-
if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag ||
|
|
3176
|
+
if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
|
|
3056
3177
|
getTag = function(value) {
|
|
3057
3178
|
var result2 = baseGetTag(value), Ctor = result2 == objectTag ? value.constructor : undefined$1, ctorString = Ctor ? toSource(Ctor) : "";
|
|
3058
3179
|
if (ctorString) {
|
|
@@ -5769,7 +5890,10 @@ function useFormValidation(itemContexts) {
|
|
|
5769
5890
|
try {
|
|
5770
5891
|
await field.validate("");
|
|
5771
5892
|
} catch (err) {
|
|
5772
|
-
errors =
|
|
5893
|
+
errors = {
|
|
5894
|
+
...errors,
|
|
5895
|
+
...err
|
|
5896
|
+
};
|
|
5773
5897
|
}
|
|
5774
5898
|
}
|
|
5775
5899
|
if (!Object.keys(errors).length) {
|
|
@@ -5826,11 +5950,12 @@ defineComponent({
|
|
|
5826
5950
|
}, {
|
|
5827
5951
|
deep: true
|
|
5828
5952
|
});
|
|
5829
|
-
provide(FORM_TOKEN, reactive(
|
|
5953
|
+
provide(FORM_TOKEN, reactive({
|
|
5954
|
+
...toRefs(props),
|
|
5830
5955
|
emit: ctx.emit,
|
|
5831
5956
|
addItemContext,
|
|
5832
5957
|
removeItemContext
|
|
5833
|
-
}))
|
|
5958
|
+
}));
|
|
5834
5959
|
ctx.expose({
|
|
5835
5960
|
validate,
|
|
5836
5961
|
validateFields,
|
|
@@ -6707,7 +6832,7 @@ var FormControl = defineComponent({
|
|
|
6707
6832
|
}
|
|
6708
6833
|
});
|
|
6709
6834
|
function _extends() {
|
|
6710
|
-
_extends = Object.assign
|
|
6835
|
+
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
|
6711
6836
|
for (var i = 1; i < arguments.length; i++) {
|
|
6712
6837
|
var source = arguments[i];
|
|
6713
6838
|
for (var key in source) {
|
|
@@ -6726,13 +6851,13 @@ function _inheritsLoose(subClass, superClass) {
|
|
|
6726
6851
|
_setPrototypeOf(subClass, superClass);
|
|
6727
6852
|
}
|
|
6728
6853
|
function _getPrototypeOf(o) {
|
|
6729
|
-
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o2) {
|
|
6854
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf2(o2) {
|
|
6730
6855
|
return o2.__proto__ || Object.getPrototypeOf(o2);
|
|
6731
6856
|
};
|
|
6732
6857
|
return _getPrototypeOf(o);
|
|
6733
6858
|
}
|
|
6734
6859
|
function _setPrototypeOf(o, p) {
|
|
6735
|
-
_setPrototypeOf = Object.setPrototypeOf
|
|
6860
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
|
|
6736
6861
|
o2.__proto__ = p2;
|
|
6737
6862
|
return o2;
|
|
6738
6863
|
};
|
|
@@ -6755,7 +6880,7 @@ function _isNativeReflectConstruct() {
|
|
|
6755
6880
|
}
|
|
6756
6881
|
function _construct(Parent, args, Class) {
|
|
6757
6882
|
if (_isNativeReflectConstruct()) {
|
|
6758
|
-
_construct = Reflect.construct;
|
|
6883
|
+
_construct = Reflect.construct.bind();
|
|
6759
6884
|
} else {
|
|
6760
6885
|
_construct = function _construct2(Parent2, args2, Class2) {
|
|
6761
6886
|
var a = [null];
|
|
@@ -7033,9 +7158,45 @@ var whitespace = function whitespace2(rule, value, source, errors, options) {
|
|
|
7033
7158
|
errors.push(format(options.messages.whitespace, rule.fullField));
|
|
7034
7159
|
}
|
|
7035
7160
|
};
|
|
7161
|
+
var urlReg;
|
|
7162
|
+
var getUrlRegex = function() {
|
|
7163
|
+
if (urlReg) {
|
|
7164
|
+
return urlReg;
|
|
7165
|
+
}
|
|
7166
|
+
var word = "[a-fA-F\\d:]";
|
|
7167
|
+
var b = function b2(options) {
|
|
7168
|
+
return options && options.includeBoundaries ? "(?:(?<=\\s|^)(?=" + word + ")|(?<=" + word + ")(?=\\s|$))" : "";
|
|
7169
|
+
};
|
|
7170
|
+
var v4 = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}";
|
|
7171
|
+
var v6seg = "[a-fA-F\\d]{1,4}";
|
|
7172
|
+
var v6 = ("\n(?:\n(?:" + v6seg + ":){7}(?:" + v6seg + "|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8\n(?:" + v6seg + ":){6}(?:" + v4 + "|:" + v6seg + "|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4\n(?:" + v6seg + ":){5}(?::" + v4 + "|(?::" + v6seg + "){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4\n(?:" + v6seg + ":){4}(?:(?::" + v6seg + "){0,1}:" + v4 + "|(?::" + v6seg + "){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4\n(?:" + v6seg + ":){3}(?:(?::" + v6seg + "){0,2}:" + v4 + "|(?::" + v6seg + "){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4\n(?:" + v6seg + ":){2}(?:(?::" + v6seg + "){0,3}:" + v4 + "|(?::" + v6seg + "){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4\n(?:" + v6seg + ":){1}(?:(?::" + v6seg + "){0,4}:" + v4 + "|(?::" + v6seg + "){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4\n(?::(?:(?::" + v6seg + "){0,5}:" + v4 + "|(?::" + v6seg + "){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4\n)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1\n").replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim();
|
|
7173
|
+
var v46Exact = new RegExp("(?:^" + v4 + "$)|(?:^" + v6 + "$)");
|
|
7174
|
+
var v4exact = new RegExp("^" + v4 + "$");
|
|
7175
|
+
var v6exact = new RegExp("^" + v6 + "$");
|
|
7176
|
+
var ip = function ip2(options) {
|
|
7177
|
+
return options && options.exact ? v46Exact : new RegExp("(?:" + b(options) + v4 + b(options) + ")|(?:" + b(options) + v6 + b(options) + ")", "g");
|
|
7178
|
+
};
|
|
7179
|
+
ip.v4 = function(options) {
|
|
7180
|
+
return options && options.exact ? v4exact : new RegExp("" + b(options) + v4 + b(options), "g");
|
|
7181
|
+
};
|
|
7182
|
+
ip.v6 = function(options) {
|
|
7183
|
+
return options && options.exact ? v6exact : new RegExp("" + b(options) + v6 + b(options), "g");
|
|
7184
|
+
};
|
|
7185
|
+
var protocol = "(?:(?:[a-z]+:)?//)";
|
|
7186
|
+
var auth = "(?:\\S+(?::\\S*)?@)?";
|
|
7187
|
+
var ipv4 = ip.v4().source;
|
|
7188
|
+
var ipv6 = ip.v6().source;
|
|
7189
|
+
var host = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)";
|
|
7190
|
+
var domain = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*";
|
|
7191
|
+
var tld = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))";
|
|
7192
|
+
var port = "(?::\\d{2,5})?";
|
|
7193
|
+
var path = '(?:[/?#][^\\s"]*)?';
|
|
7194
|
+
var regex = "(?:" + protocol + "|www\\.)" + auth + "(?:localhost|" + ipv4 + "|" + ipv6 + "|" + host + domain + tld + ")" + port + path;
|
|
7195
|
+
urlReg = new RegExp("(?:^" + regex + "$)", "i");
|
|
7196
|
+
return urlReg;
|
|
7197
|
+
};
|
|
7036
7198
|
var pattern$2 = {
|
|
7037
7199
|
email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,
|
|
7038
|
-
url: new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$", "i"),
|
|
7039
7200
|
hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
|
|
7040
7201
|
};
|
|
7041
7202
|
var types = {
|
|
@@ -7077,7 +7238,7 @@ var types = {
|
|
|
7077
7238
|
return typeof value === "string" && value.length <= 320 && !!value.match(pattern$2.email);
|
|
7078
7239
|
},
|
|
7079
7240
|
url: function url(value) {
|
|
7080
|
-
return typeof value === "string" && value.length <= 2048 && !!value.match(
|
|
7241
|
+
return typeof value === "string" && value.length <= 2048 && !!value.match(getUrlRegex());
|
|
7081
7242
|
},
|
|
7082
7243
|
hex: function hex(value) {
|
|
7083
7244
|
return typeof value === "string" && !!value.match(pattern$2.hex);
|
|
@@ -7652,7 +7813,17 @@ var Schema = /* @__PURE__ */ function() {
|
|
|
7652
7813
|
if (rule.asyncValidator) {
|
|
7653
7814
|
res = rule.asyncValidator(rule, data.value, cb, data.source, options);
|
|
7654
7815
|
} else if (rule.validator) {
|
|
7655
|
-
|
|
7816
|
+
try {
|
|
7817
|
+
res = rule.validator(rule, data.value, cb, data.source, options);
|
|
7818
|
+
} catch (error) {
|
|
7819
|
+
console.error == null ? void 0 : console.error(error);
|
|
7820
|
+
if (!options.suppressValidatorError) {
|
|
7821
|
+
setTimeout(function() {
|
|
7822
|
+
throw error;
|
|
7823
|
+
}, 0);
|
|
7824
|
+
}
|
|
7825
|
+
cb(error.message);
|
|
7826
|
+
}
|
|
7656
7827
|
if (res === true) {
|
|
7657
7828
|
cb();
|
|
7658
7829
|
} else if (res === false) {
|
|
@@ -7773,10 +7944,7 @@ function useFormItemValidate(props, _rules) {
|
|
|
7773
7944
|
} else {
|
|
7774
7945
|
return rule.trigger === triggerVal;
|
|
7775
7946
|
}
|
|
7776
|
-
}).map((
|
|
7777
|
-
var rule = __objRest(_a, []);
|
|
7778
|
-
return rule;
|
|
7779
|
-
});
|
|
7947
|
+
}).map(({ ...rule }) => rule);
|
|
7780
7948
|
};
|
|
7781
7949
|
const onValidateSuccess = () => {
|
|
7782
7950
|
validateState.value = "success";
|
|
@@ -7849,15 +8017,12 @@ defineComponent({
|
|
|
7849
8017
|
props: formItemProps,
|
|
7850
8018
|
setup(props, ctx) {
|
|
7851
8019
|
const formContext = inject(FORM_TOKEN);
|
|
7852
|
-
const
|
|
8020
|
+
const {
|
|
7853
8021
|
messageType: itemMessageType,
|
|
7854
8022
|
popPosition: itemPopPosition,
|
|
7855
|
-
showFeedback: itemShowFeedback
|
|
7856
|
-
|
|
7857
|
-
|
|
7858
|
-
"popPosition",
|
|
7859
|
-
"showFeedback"
|
|
7860
|
-
]);
|
|
8023
|
+
showFeedback: itemShowFeedback,
|
|
8024
|
+
...otherProps
|
|
8025
|
+
} = toRefs(props);
|
|
7861
8026
|
const {
|
|
7862
8027
|
label,
|
|
7863
8028
|
helpTips,
|
|
@@ -7887,7 +8052,8 @@ defineComponent({
|
|
|
7887
8052
|
labelAlign: formContext.labelAlign
|
|
7888
8053
|
}));
|
|
7889
8054
|
provide(LABEL_DATA, labelData);
|
|
7890
|
-
const context = reactive(
|
|
8055
|
+
const context = reactive({
|
|
8056
|
+
...otherProps,
|
|
7891
8057
|
showFeedback,
|
|
7892
8058
|
messageType,
|
|
7893
8059
|
popPosition,
|
|
@@ -7897,7 +8063,7 @@ defineComponent({
|
|
|
7897
8063
|
validate,
|
|
7898
8064
|
resetField,
|
|
7899
8065
|
clearValidate
|
|
7900
|
-
})
|
|
8066
|
+
});
|
|
7901
8067
|
provide(FORM_ITEM_TOKEN, context);
|
|
7902
8068
|
ctx.expose({
|
|
7903
8069
|
resetField,
|
|
@@ -7922,8 +8088,8 @@ defineComponent({
|
|
|
7922
8088
|
"extra-info": extraInfo.value
|
|
7923
8089
|
}, {
|
|
7924
8090
|
default: () => {
|
|
7925
|
-
var
|
|
7926
|
-
return [(_b = (
|
|
8091
|
+
var _a, _b;
|
|
8092
|
+
return [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)];
|
|
7927
8093
|
}
|
|
7928
8094
|
})]);
|
|
7929
8095
|
}
|
|
@@ -8224,9 +8390,10 @@ defineComponent({
|
|
|
8224
8390
|
value: opt
|
|
8225
8391
|
});
|
|
8226
8392
|
} else if (typeof opt === "object") {
|
|
8227
|
-
mergedOpt = Object.assign({}, defaultOpt,
|
|
8393
|
+
mergedOpt = Object.assign({}, defaultOpt, {
|
|
8394
|
+
...opt,
|
|
8228
8395
|
label: opt.name
|
|
8229
|
-
})
|
|
8396
|
+
});
|
|
8230
8397
|
}
|
|
8231
8398
|
return createVNode(Checkbox, mergedOpt, null);
|
|
8232
8399
|
});
|
|
@@ -8334,6 +8501,15 @@ function useTreeNode(data) {
|
|
|
8334
8501
|
return [ns.e("node-title"), ((_a = data.value) == null ? void 0 : _a.disableSelect) && "select-disabled"];
|
|
8335
8502
|
});
|
|
8336
8503
|
const nodeOperationAreaClass = computed(() => ns.e("node-operation-area"));
|
|
8504
|
+
const matchedContents = computed(() => {
|
|
8505
|
+
var _a, _b;
|
|
8506
|
+
const matchItem = ((_a = data.value) == null ? void 0 : _a.matchedText) || "";
|
|
8507
|
+
const label = ((_b = data.value) == null ? void 0 : _b.label) || "";
|
|
8508
|
+
const reg = (str) => str.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
8509
|
+
const regExp = new RegExp("(" + reg(matchItem) + ")", "gi");
|
|
8510
|
+
return label.split(regExp);
|
|
8511
|
+
});
|
|
8512
|
+
const highlightCls = ns.e("match-highlight");
|
|
8337
8513
|
return {
|
|
8338
8514
|
nodeClass,
|
|
8339
8515
|
nodeStyle,
|
|
@@ -8342,7 +8518,9 @@ function useTreeNode(data) {
|
|
|
8342
8518
|
nodeVLineClass,
|
|
8343
8519
|
nodeVLineStyles,
|
|
8344
8520
|
nodeHLineClass,
|
|
8345
|
-
nodeOperationAreaClass
|
|
8521
|
+
nodeOperationAreaClass,
|
|
8522
|
+
matchedContents,
|
|
8523
|
+
highlightCls
|
|
8346
8524
|
};
|
|
8347
8525
|
}
|
|
8348
8526
|
var DTreeNodeContent = defineComponent({
|
|
@@ -8358,13 +8536,17 @@ var DTreeNodeContent = defineComponent({
|
|
|
8358
8536
|
data
|
|
8359
8537
|
} = toRefs(props);
|
|
8360
8538
|
const {
|
|
8361
|
-
nodeTitleClass
|
|
8539
|
+
nodeTitleClass,
|
|
8540
|
+
matchedContents,
|
|
8541
|
+
highlightCls
|
|
8362
8542
|
} = useTreeNode(data);
|
|
8363
8543
|
return () => {
|
|
8364
|
-
var _a;
|
|
8544
|
+
var _a, _b, _c;
|
|
8365
8545
|
return createVNode("span", {
|
|
8366
8546
|
"class": nodeTitleClass.value
|
|
8367
|
-
}, [(_a = data.value) == null ? void 0 : _a.label
|
|
8547
|
+
}, [!((_a = data.value) == null ? void 0 : _a.matchedText) && ((_b = data.value) == null ? void 0 : _b.label), ((_c = data.value) == null ? void 0 : _c.matchedText) && matchedContents.value.map((item, index2) => index2 % 2 === 0 ? item : createVNode("span", {
|
|
8548
|
+
"class": highlightCls
|
|
8549
|
+
}, [item]))]);
|
|
8368
8550
|
};
|
|
8369
8551
|
}
|
|
8370
8552
|
});
|
|
@@ -8852,10 +9034,11 @@ var ResizeObserver$1 = defineComponent({
|
|
|
8852
9034
|
Object.assign(state, size);
|
|
8853
9035
|
if (onResize) {
|
|
8854
9036
|
Promise.resolve().then(() => {
|
|
8855
|
-
onResize(
|
|
9037
|
+
onResize({
|
|
9038
|
+
...size,
|
|
8856
9039
|
offsetWidth,
|
|
8857
9040
|
offsetHeight
|
|
8858
|
-
}
|
|
9041
|
+
}, target);
|
|
8859
9042
|
});
|
|
8860
9043
|
}
|
|
8861
9044
|
}
|
|
@@ -8918,13 +9101,14 @@ var ResizeObserverContainer = defineComponent({
|
|
|
8918
9101
|
position: "relative",
|
|
8919
9102
|
overflow: "hidden"
|
|
8920
9103
|
};
|
|
8921
|
-
innerStyle.value =
|
|
9104
|
+
innerStyle.value = {
|
|
9105
|
+
...innerStyle.value,
|
|
8922
9106
|
transform: `translateY(${offset2.value}px)`,
|
|
8923
9107
|
position: "absolute",
|
|
8924
9108
|
left: 0,
|
|
8925
9109
|
right: 0,
|
|
8926
9110
|
top: 0
|
|
8927
|
-
}
|
|
9111
|
+
};
|
|
8928
9112
|
}
|
|
8929
9113
|
}, {
|
|
8930
9114
|
immediate: true
|
|
@@ -9412,9 +9596,10 @@ var VirtualList = defineComponent({
|
|
|
9412
9596
|
const componentStyle = computed(() => {
|
|
9413
9597
|
let cs = null;
|
|
9414
9598
|
if (props.height) {
|
|
9415
|
-
cs =
|
|
9416
|
-
maxHeight: isVirtual.value ? props.height + "px" : void 0
|
|
9417
|
-
|
|
9599
|
+
cs = {
|
|
9600
|
+
maxHeight: isVirtual.value ? props.height + "px" : void 0,
|
|
9601
|
+
...ScrollStyle
|
|
9602
|
+
};
|
|
9418
9603
|
if (isVirtual.value) {
|
|
9419
9604
|
cs.overflowY = "hidden";
|
|
9420
9605
|
if (state.scrollMoving) {
|
|
@@ -9550,7 +9735,7 @@ function generateInnerTree(tree2, key = "children", level = 0, path = []) {
|
|
|
9550
9735
|
newItem.parentId = parentNode.id;
|
|
9551
9736
|
}
|
|
9552
9737
|
if (!newItem[key]) {
|
|
9553
|
-
return acc.concat(
|
|
9738
|
+
return acc.concat({ ...newItem, isLeaf: newItem.isLeaf === false ? false : true });
|
|
9554
9739
|
} else {
|
|
9555
9740
|
return acc.concat(omit(newItem, "children"), generateInnerTree(newItem[key], key, level, path));
|
|
9556
9741
|
}
|
|
@@ -9560,8 +9745,8 @@ const DEFAULT_CONFIG = {
|
|
|
9560
9745
|
expanded: false,
|
|
9561
9746
|
recursive: true
|
|
9562
9747
|
};
|
|
9563
|
-
const nodeMap = /* @__PURE__ */ new Map();
|
|
9564
9748
|
function useCore() {
|
|
9749
|
+
const nodeMap = /* @__PURE__ */ new Map();
|
|
9565
9750
|
return function useCore2(data) {
|
|
9566
9751
|
const getLevel = (node) => {
|
|
9567
9752
|
var _a;
|
|
@@ -9571,7 +9756,14 @@ function useCore() {
|
|
|
9571
9756
|
if (node.isLeaf) {
|
|
9572
9757
|
return [];
|
|
9573
9758
|
}
|
|
9574
|
-
|
|
9759
|
+
let mapKey = node.id || "";
|
|
9760
|
+
if (userConfig.expanded) {
|
|
9761
|
+
mapKey += "_expanded";
|
|
9762
|
+
}
|
|
9763
|
+
if (userConfig.recursive) {
|
|
9764
|
+
mapKey += "_recursive";
|
|
9765
|
+
}
|
|
9766
|
+
if (node.id && nodeMap.has(mapKey)) {
|
|
9575
9767
|
const cacheNode = nodeMap.get(node.id);
|
|
9576
9768
|
if (cacheNode) {
|
|
9577
9769
|
return cacheNode;
|
|
@@ -9595,21 +9787,24 @@ function useCore() {
|
|
|
9595
9787
|
});
|
|
9596
9788
|
};
|
|
9597
9789
|
const result = [];
|
|
9598
|
-
const config =
|
|
9790
|
+
const config = { ...DEFAULT_CONFIG, ...userConfig };
|
|
9599
9791
|
const treeData = config.expanded ? getInnerExpendedTree() : data;
|
|
9600
9792
|
const startIndex = treeData.value.findIndex((item) => item.id === node.id);
|
|
9601
9793
|
for (let i = startIndex + 1; i < treeData.value.length && getLevel(node) < treeData.value[i].level; i++) {
|
|
9602
|
-
if (config.recursive) {
|
|
9794
|
+
if (config.recursive && !treeData.value[i].isHide) {
|
|
9603
9795
|
result.push(treeData.value[i]);
|
|
9604
|
-
} else if (getLevel(node) === treeData.value[i].level - 1) {
|
|
9796
|
+
} else if (getLevel(node) === treeData.value[i].level - 1 && !treeData.value[i].isHide) {
|
|
9605
9797
|
result.push(treeData.value[i]);
|
|
9606
9798
|
}
|
|
9607
9799
|
}
|
|
9608
9800
|
if (node.id) {
|
|
9609
|
-
nodeMap.set(
|
|
9801
|
+
nodeMap.set(mapKey, result);
|
|
9610
9802
|
}
|
|
9611
9803
|
return result;
|
|
9612
9804
|
};
|
|
9805
|
+
const clearNodeMap = () => {
|
|
9806
|
+
nodeMap.clear();
|
|
9807
|
+
};
|
|
9613
9808
|
const getParent = (node) => {
|
|
9614
9809
|
return data.value.find((item) => item.id === node.parentId);
|
|
9615
9810
|
};
|
|
@@ -9619,7 +9814,7 @@ function useCore() {
|
|
|
9619
9814
|
const result = [];
|
|
9620
9815
|
for (let i = 0, len = data == null ? void 0 : data.value.length; i < len; i++) {
|
|
9621
9816
|
const item = data == null ? void 0 : data.value[i];
|
|
9622
|
-
if (excludeNodes.map((node) => node.id).includes(item.id)) {
|
|
9817
|
+
if (excludeNodes.map((node) => node.id).includes(item.id) || item.isHide) {
|
|
9623
9818
|
continue;
|
|
9624
9819
|
}
|
|
9625
9820
|
if (item.expanded !== true) {
|
|
@@ -9640,24 +9835,25 @@ function useCore() {
|
|
|
9640
9835
|
return data.value.find((item) => item.id === node.id);
|
|
9641
9836
|
};
|
|
9642
9837
|
const setNodeValue = (node, key, value) => {
|
|
9643
|
-
|
|
9838
|
+
clearNodeMap();
|
|
9644
9839
|
if (getIndex(node) !== -1) {
|
|
9645
9840
|
data.value[getIndex(node)][key] = value;
|
|
9646
9841
|
}
|
|
9647
9842
|
};
|
|
9648
9843
|
const setTree = (newTree) => {
|
|
9649
|
-
|
|
9844
|
+
clearNodeMap();
|
|
9650
9845
|
data.value = generateInnerTree(newTree);
|
|
9651
9846
|
};
|
|
9652
9847
|
const getTree = () => {
|
|
9653
9848
|
return data.value;
|
|
9654
9849
|
};
|
|
9655
9850
|
onUnmounted(() => {
|
|
9656
|
-
|
|
9851
|
+
clearNodeMap();
|
|
9657
9852
|
});
|
|
9658
9853
|
return {
|
|
9659
9854
|
getLevel,
|
|
9660
9855
|
getChildren,
|
|
9856
|
+
clearNodeMap,
|
|
9661
9857
|
getParent,
|
|
9662
9858
|
getExpendedTree,
|
|
9663
9859
|
getIndex,
|
|
@@ -9705,17 +9901,19 @@ function useLazyLoad() {
|
|
|
9705
9901
|
};
|
|
9706
9902
|
};
|
|
9707
9903
|
}
|
|
9708
|
-
const DEFAULT_TREE_PLUGINS = [
|
|
9904
|
+
const DEFAULT_TREE_PLUGINS = [useToggle()];
|
|
9709
9905
|
function useTree(tree2, plugins = [], context) {
|
|
9710
9906
|
const treeData = ref(generateInnerTree(tree2));
|
|
9711
9907
|
const core = useCore()(treeData);
|
|
9712
9908
|
const lazyLode = useLazyLoad()(treeData, core, context);
|
|
9713
9909
|
const pluginMethods = DEFAULT_TREE_PLUGINS.concat(plugins).reduce((acc, plugin) => {
|
|
9714
|
-
return
|
|
9910
|
+
return { ...acc, ...plugin(treeData, core, context, lazyLode) };
|
|
9715
9911
|
}, {});
|
|
9716
|
-
return
|
|
9717
|
-
treeData
|
|
9718
|
-
|
|
9912
|
+
return {
|
|
9913
|
+
treeData,
|
|
9914
|
+
...pluginMethods,
|
|
9915
|
+
...core
|
|
9916
|
+
};
|
|
9719
9917
|
}
|
|
9720
9918
|
function useCheck(options = ref({ checkStrategy: "both" })) {
|
|
9721
9919
|
return function useCheck2(data, core, context) {
|
|
@@ -9724,6 +9922,11 @@ function useCheck(options = ref({ checkStrategy: "both" })) {
|
|
|
9724
9922
|
setNodeValue(node, "checked", true);
|
|
9725
9923
|
context.emit("check-change", node);
|
|
9726
9924
|
};
|
|
9925
|
+
const setNodeValueInAvailable = (node, key, value) => {
|
|
9926
|
+
if (!node.disableCheck) {
|
|
9927
|
+
setNodeValue(node, key, value);
|
|
9928
|
+
}
|
|
9929
|
+
};
|
|
9727
9930
|
const uncheckNode = (node) => {
|
|
9728
9931
|
setNodeValue(node, "checked", false);
|
|
9729
9932
|
context.emit("check-change", node);
|
|
@@ -9739,15 +9942,15 @@ function useCheck(options = ref({ checkStrategy: "both" })) {
|
|
|
9739
9942
|
let childChecked = checked;
|
|
9740
9943
|
if (checked) {
|
|
9741
9944
|
if (!parentNode.checked) {
|
|
9742
|
-
|
|
9945
|
+
setNodeValueInAvailable(parentNode, "checked", true);
|
|
9743
9946
|
}
|
|
9744
9947
|
} else {
|
|
9745
9948
|
const siblingNodes = getChildren(parentNode);
|
|
9746
9949
|
const checkedSiblingNodes = siblingNodes.filter((item) => item.checked && item.id !== node.id);
|
|
9747
9950
|
if (checkedSiblingNodes.length === 0) {
|
|
9748
|
-
|
|
9951
|
+
setNodeValueInAvailable(parentNode, "checked", false);
|
|
9749
9952
|
} else {
|
|
9750
|
-
|
|
9953
|
+
setNodeValueInAvailable(parentNode, "checked", true);
|
|
9751
9954
|
childChecked = true;
|
|
9752
9955
|
}
|
|
9753
9956
|
}
|
|
@@ -9761,13 +9964,13 @@ function useCheck(options = ref({ checkStrategy: "both" })) {
|
|
|
9761
9964
|
setNodeValue(node, "checked", false);
|
|
9762
9965
|
context.emit("check-change", node);
|
|
9763
9966
|
if (["downward", "both"].includes(options.value.checkStrategy)) {
|
|
9764
|
-
getChildren(node).forEach((item) =>
|
|
9967
|
+
getChildren(node).forEach((item) => setNodeValueInAvailable(item, "checked", false));
|
|
9765
9968
|
}
|
|
9766
9969
|
} else {
|
|
9767
9970
|
setNodeValue(node, "checked", true);
|
|
9768
9971
|
context.emit("check-change", node);
|
|
9769
9972
|
if (["downward", "both"].includes(options.value.checkStrategy)) {
|
|
9770
|
-
getChildren(node).forEach((item) =>
|
|
9973
|
+
getChildren(node).forEach((item) => setNodeValueInAvailable(item, "checked", true));
|
|
9771
9974
|
}
|
|
9772
9975
|
}
|
|
9773
9976
|
if (["upward", "both"].includes(options.value.checkStrategy)) {
|
|
@@ -9842,13 +10045,14 @@ function useOperate() {
|
|
|
9842
10045
|
if (lastChild) {
|
|
9843
10046
|
setNodeValue(lastChild, "parentChildNodeCount", children.length + 1);
|
|
9844
10047
|
}
|
|
9845
|
-
const currentNode = ref(
|
|
10048
|
+
const currentNode = ref({
|
|
10049
|
+
...node,
|
|
9846
10050
|
level: getLevel(parentNode) + 1,
|
|
9847
10051
|
parentId: parentNode.id,
|
|
9848
10052
|
isLeaf: true,
|
|
9849
10053
|
parentChildNodeCount: children.length + 1,
|
|
9850
10054
|
currentIndex: (lastChild == null ? void 0 : lastChild.currentIndex) + 1
|
|
9851
|
-
})
|
|
10055
|
+
});
|
|
9852
10056
|
if (currentNode.value.id === void 0) {
|
|
9853
10057
|
currentNode.value.id = randomId();
|
|
9854
10058
|
}
|
|
@@ -9913,6 +10117,111 @@ function useMergeNodes() {
|
|
|
9913
10117
|
};
|
|
9914
10118
|
};
|
|
9915
10119
|
}
|
|
10120
|
+
function useSearchFilter() {
|
|
10121
|
+
return function useSearchFilter2(data, core) {
|
|
10122
|
+
const { clearNodeMap, getExpendedTree } = core;
|
|
10123
|
+
const virtualListRef = ref();
|
|
10124
|
+
const resetNodeSearchProperty = () => {
|
|
10125
|
+
data.value.forEach((item) => {
|
|
10126
|
+
item.childrenMatched = false;
|
|
10127
|
+
item.isHide = false;
|
|
10128
|
+
item.isMatched = false;
|
|
10129
|
+
item.matchedText = "";
|
|
10130
|
+
});
|
|
10131
|
+
if (virtualListRef.value) {
|
|
10132
|
+
virtualListRef.value.scrollTo(0);
|
|
10133
|
+
}
|
|
10134
|
+
};
|
|
10135
|
+
const hasDealParentNode = (pre, cur, parentIdSet) => {
|
|
10136
|
+
return data.value[pre].parentId === data.value[cur].parentId && data.value[pre].isMatched || parentIdSet.has(data.value[pre].id) && data.value[pre].childrenMatched;
|
|
10137
|
+
};
|
|
10138
|
+
const dealMatchedData = (target, matchKey, pattern4) => {
|
|
10139
|
+
const trimmedTarget = lodash.exports.trim(target).toLocaleLowerCase();
|
|
10140
|
+
for (let i = 0; i < data.value.length; i++) {
|
|
10141
|
+
const key = matchKey ? data.value[i][matchKey] : data.value[i].label;
|
|
10142
|
+
const selfMatched = pattern4 ? pattern4.test(key) : key.toLocaleLowerCase().includes(trimmedTarget);
|
|
10143
|
+
data.value[i].isMatched = selfMatched;
|
|
10144
|
+
if (selfMatched) {
|
|
10145
|
+
data.value[i].matchedText = matchKey ? data.value[i].label : trimmedTarget;
|
|
10146
|
+
if (!data.value[i].parentId) {
|
|
10147
|
+
continue;
|
|
10148
|
+
}
|
|
10149
|
+
let L = i - 1;
|
|
10150
|
+
const set = /* @__PURE__ */ new Set();
|
|
10151
|
+
set.add(data.value[i].parentId);
|
|
10152
|
+
while (L >= 0 && data.value[L].parentId && !hasDealParentNode(L, i, set)) {
|
|
10153
|
+
if (set.has(data.value[L].id)) {
|
|
10154
|
+
data.value[L].childrenMatched = true;
|
|
10155
|
+
data.value[L].expanded = true;
|
|
10156
|
+
set.add(data.value[L].parentId);
|
|
10157
|
+
}
|
|
10158
|
+
L--;
|
|
10159
|
+
}
|
|
10160
|
+
if (L >= 0 && !data.value[L].parentId && set.has(data.value[L].id)) {
|
|
10161
|
+
data.value[L].childrenMatched = true;
|
|
10162
|
+
data.value[L].expanded = true;
|
|
10163
|
+
}
|
|
10164
|
+
}
|
|
10165
|
+
}
|
|
10166
|
+
};
|
|
10167
|
+
const hasParentNodeMatched = (pre, cur, parentIdSet) => {
|
|
10168
|
+
return parentIdSet.has(data.value[pre].id) && data.value[pre].isMatched;
|
|
10169
|
+
};
|
|
10170
|
+
const dealNodeHideProperty = () => {
|
|
10171
|
+
data.value.forEach((item, index2) => {
|
|
10172
|
+
if (item.isMatched || item.childrenMatched) {
|
|
10173
|
+
item.isHide = false;
|
|
10174
|
+
} else {
|
|
10175
|
+
if (!item.parentId) {
|
|
10176
|
+
item.isHide = true;
|
|
10177
|
+
return;
|
|
10178
|
+
}
|
|
10179
|
+
let L = index2 - 1;
|
|
10180
|
+
const set = /* @__PURE__ */ new Set();
|
|
10181
|
+
set.add(data.value[index2].parentId);
|
|
10182
|
+
while (L >= 0 && data.value[L].parentId && !hasParentNodeMatched(L, index2, set)) {
|
|
10183
|
+
if (set.has(data.value[L].id)) {
|
|
10184
|
+
set.add(data.value[L].parentId);
|
|
10185
|
+
}
|
|
10186
|
+
L--;
|
|
10187
|
+
}
|
|
10188
|
+
if (!data.value[L].parentId && !data.value[L].isMatched) {
|
|
10189
|
+
item.isHide = true;
|
|
10190
|
+
} else {
|
|
10191
|
+
item.isHide = false;
|
|
10192
|
+
}
|
|
10193
|
+
}
|
|
10194
|
+
});
|
|
10195
|
+
};
|
|
10196
|
+
const getFirstMatchIndex = () => {
|
|
10197
|
+
let index2 = 0;
|
|
10198
|
+
const showTreeData = getExpendedTree().value;
|
|
10199
|
+
while (index2 <= showTreeData.length - 1 && !showTreeData[index2].isMatched) {
|
|
10200
|
+
index2++;
|
|
10201
|
+
}
|
|
10202
|
+
return index2 >= showTreeData.length ? 0 : index2;
|
|
10203
|
+
};
|
|
10204
|
+
const searchTree = (target, option) => {
|
|
10205
|
+
clearNodeMap();
|
|
10206
|
+
resetNodeSearchProperty();
|
|
10207
|
+
if (!target) {
|
|
10208
|
+
return;
|
|
10209
|
+
}
|
|
10210
|
+
dealMatchedData(target, option.matchKey, option.pattern);
|
|
10211
|
+
if (option.isFilter) {
|
|
10212
|
+
dealNodeHideProperty();
|
|
10213
|
+
}
|
|
10214
|
+
if (virtualListRef.value) {
|
|
10215
|
+
const scrollIndex = getFirstMatchIndex();
|
|
10216
|
+
virtualListRef.value.scrollTo(scrollIndex);
|
|
10217
|
+
}
|
|
10218
|
+
};
|
|
10219
|
+
return {
|
|
10220
|
+
virtualListRef,
|
|
10221
|
+
searchTree
|
|
10222
|
+
};
|
|
10223
|
+
};
|
|
10224
|
+
}
|
|
9916
10225
|
const treeProps = {
|
|
9917
10226
|
data: {
|
|
9918
10227
|
type: Object,
|
|
@@ -9947,7 +10256,8 @@ var Tree = defineComponent({
|
|
|
9947
10256
|
operate
|
|
9948
10257
|
} = toRefs(props);
|
|
9949
10258
|
const ns2 = useNamespace("tree");
|
|
9950
|
-
const
|
|
10259
|
+
const normalRef = ref();
|
|
10260
|
+
const userPlugins = [useSelect(), useOperate(), useMergeNodes(), useSearchFilter()];
|
|
9951
10261
|
const checkOptions = ref({
|
|
9952
10262
|
checkStrategy: formatCheckStatus(check.value)
|
|
9953
10263
|
});
|
|
@@ -9961,7 +10271,8 @@ var Tree = defineComponent({
|
|
|
9961
10271
|
const {
|
|
9962
10272
|
setTree,
|
|
9963
10273
|
getExpendedTree,
|
|
9964
|
-
toggleNode
|
|
10274
|
+
toggleNode,
|
|
10275
|
+
virtualListRef
|
|
9965
10276
|
} = treeFactory;
|
|
9966
10277
|
watch(data, setTree);
|
|
9967
10278
|
provide(USE_TREE_TOKEN, treeFactory);
|
|
@@ -10008,6 +10319,7 @@ var Tree = defineComponent({
|
|
|
10008
10319
|
};
|
|
10009
10320
|
}
|
|
10010
10321
|
return createVNode(Component, mergeProps({
|
|
10322
|
+
"ref": props.height ? virtualListRef : normalRef,
|
|
10011
10323
|
"class": ns2.b()
|
|
10012
10324
|
}, virtualListProps2), vSlotsProps);
|
|
10013
10325
|
};
|