@tmagic/element-plus-adapter 1.6.0 → 1.7.0-beta.0
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/dist/tmagic-element-plus-adapter.js +2885 -11
- package/dist/tmagic-element-plus-adapter.umd.cjs +2884 -10
- package/package.json +3 -3
- package/src/FormItem.vue +26 -0
- package/src/Table.vue +92 -0
- package/src/index.ts +12 -18
|
@@ -1,4 +1,2882 @@
|
|
|
1
|
-
import { ElLoading,
|
|
1
|
+
import { ElTableColumn, ElTable, ElLoading, ElPopconfirm, ElUpload, ElTooltip, ElTimePicker, ElTag, ElTabs, ElTabPane, ElSwitch, ElSteps, ElStep, ElSelect, ElScrollbar, ElRow, ElRadioGroup, ElRadioButton, ElRadio, ElPagination, ElOptionGroup, ElOption, ElInputNumber, ElInput, ElIcon, ElForm, ElDropdownMenu, ElDropdownItem, ElDropdown, ElDrawer, ElDivider, ElDialog, ElDatePicker, ElColorPicker, ElCollapseItem, ElCollapse, ElCol, ElCheckboxGroup, ElCheckbox, ElCascader, ElCard, ElButton, ElBadge, ElAutocomplete, ElMessageBox, ElMessage, useZIndex } from 'element-plus';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @vue/shared v3.5.22
|
|
5
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
6
|
+
* @license MIT
|
|
7
|
+
**/
|
|
8
|
+
// @__NO_SIDE_EFFECTS__
|
|
9
|
+
function makeMap(str) {
|
|
10
|
+
const map = /* @__PURE__ */ Object.create(null);
|
|
11
|
+
for (const key of str.split(",")) map[key] = 1;
|
|
12
|
+
return (val) => val in map;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const EMPTY_OBJ = !!(process.env.NODE_ENV !== "production") ? Object.freeze({}) : {};
|
|
16
|
+
const EMPTY_ARR = !!(process.env.NODE_ENV !== "production") ? Object.freeze([]) : [];
|
|
17
|
+
const NOOP = () => {
|
|
18
|
+
};
|
|
19
|
+
const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
|
|
20
|
+
(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
|
|
21
|
+
const extend = Object.assign;
|
|
22
|
+
const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
23
|
+
const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
|
|
24
|
+
const isArray = Array.isArray;
|
|
25
|
+
const isMap = (val) => toTypeString(val) === "[object Map]";
|
|
26
|
+
const isFunction = (val) => typeof val === "function";
|
|
27
|
+
const isString = (val) => typeof val === "string";
|
|
28
|
+
const isSymbol = (val) => typeof val === "symbol";
|
|
29
|
+
const isObject = (val) => val !== null && typeof val === "object";
|
|
30
|
+
const objectToString = Object.prototype.toString;
|
|
31
|
+
const toTypeString = (value) => objectToString.call(value);
|
|
32
|
+
const toRawType = (value) => {
|
|
33
|
+
return toTypeString(value).slice(8, -1);
|
|
34
|
+
};
|
|
35
|
+
const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
|
|
36
|
+
const cacheStringFunction = (fn) => {
|
|
37
|
+
const cache = /* @__PURE__ */ Object.create(null);
|
|
38
|
+
return ((str) => {
|
|
39
|
+
const hit = cache[str];
|
|
40
|
+
return hit || (cache[str] = fn(str));
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
const camelizeRE = /-\w/g;
|
|
44
|
+
const camelize = cacheStringFunction(
|
|
45
|
+
(str) => {
|
|
46
|
+
return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
const capitalize = cacheStringFunction((str) => {
|
|
50
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
51
|
+
});
|
|
52
|
+
const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
|
|
53
|
+
let _globalThis;
|
|
54
|
+
const getGlobalThis = () => {
|
|
55
|
+
return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
function normalizeStyle(value) {
|
|
59
|
+
if (isArray(value)) {
|
|
60
|
+
const res = {};
|
|
61
|
+
for (let i = 0; i < value.length; i++) {
|
|
62
|
+
const item = value[i];
|
|
63
|
+
const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
|
|
64
|
+
if (normalized) {
|
|
65
|
+
for (const key in normalized) {
|
|
66
|
+
res[key] = normalized[key];
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return res;
|
|
71
|
+
} else if (isString(value) || isObject(value)) {
|
|
72
|
+
return value;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
const listDelimiterRE = /;(?![^(]*\))/g;
|
|
76
|
+
const propertyDelimiterRE = /:([^]+)/;
|
|
77
|
+
const styleCommentRE = /\/\*[^]*?\*\//g;
|
|
78
|
+
function parseStringStyle(cssText) {
|
|
79
|
+
const ret = {};
|
|
80
|
+
cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
|
|
81
|
+
if (item) {
|
|
82
|
+
const tmp = item.split(propertyDelimiterRE);
|
|
83
|
+
tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
return ret;
|
|
87
|
+
}
|
|
88
|
+
function normalizeClass(value) {
|
|
89
|
+
let res = "";
|
|
90
|
+
if (isString(value)) {
|
|
91
|
+
res = value;
|
|
92
|
+
} else if (isArray(value)) {
|
|
93
|
+
for (let i = 0; i < value.length; i++) {
|
|
94
|
+
const normalized = normalizeClass(value[i]);
|
|
95
|
+
if (normalized) {
|
|
96
|
+
res += normalized + " ";
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
} else if (isObject(value)) {
|
|
100
|
+
for (const name in value) {
|
|
101
|
+
if (value[name]) {
|
|
102
|
+
res += name + " ";
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return res.trim();
|
|
107
|
+
}
|
|
108
|
+
function normalizeProps(props) {
|
|
109
|
+
if (!props) return null;
|
|
110
|
+
let { class: klass, style } = props;
|
|
111
|
+
if (klass && !isString(klass)) {
|
|
112
|
+
props.class = normalizeClass(klass);
|
|
113
|
+
}
|
|
114
|
+
if (style) {
|
|
115
|
+
props.style = normalizeStyle(style);
|
|
116
|
+
}
|
|
117
|
+
return props;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* @vue/reactivity v3.5.22
|
|
122
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
123
|
+
* @license MIT
|
|
124
|
+
**/
|
|
125
|
+
|
|
126
|
+
function warn(msg, ...args) {
|
|
127
|
+
console.warn(`[Vue warn] ${msg}`, ...args);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
let activeSub;
|
|
131
|
+
let batchDepth = 0;
|
|
132
|
+
let batchedSub;
|
|
133
|
+
let batchedComputed;
|
|
134
|
+
function batch(sub, isComputed = false) {
|
|
135
|
+
sub.flags |= 8;
|
|
136
|
+
if (isComputed) {
|
|
137
|
+
sub.next = batchedComputed;
|
|
138
|
+
batchedComputed = sub;
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
sub.next = batchedSub;
|
|
142
|
+
batchedSub = sub;
|
|
143
|
+
}
|
|
144
|
+
function startBatch() {
|
|
145
|
+
batchDepth++;
|
|
146
|
+
}
|
|
147
|
+
function endBatch() {
|
|
148
|
+
if (--batchDepth > 0) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
if (batchedComputed) {
|
|
152
|
+
let e = batchedComputed;
|
|
153
|
+
batchedComputed = void 0;
|
|
154
|
+
while (e) {
|
|
155
|
+
const next = e.next;
|
|
156
|
+
e.next = void 0;
|
|
157
|
+
e.flags &= -9;
|
|
158
|
+
e = next;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
let error;
|
|
162
|
+
while (batchedSub) {
|
|
163
|
+
let e = batchedSub;
|
|
164
|
+
batchedSub = void 0;
|
|
165
|
+
while (e) {
|
|
166
|
+
const next = e.next;
|
|
167
|
+
e.next = void 0;
|
|
168
|
+
e.flags &= -9;
|
|
169
|
+
if (e.flags & 1) {
|
|
170
|
+
try {
|
|
171
|
+
;
|
|
172
|
+
e.trigger();
|
|
173
|
+
} catch (err) {
|
|
174
|
+
if (!error) error = err;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
e = next;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
if (error) throw error;
|
|
181
|
+
}
|
|
182
|
+
function prepareDeps(sub) {
|
|
183
|
+
for (let link = sub.deps; link; link = link.nextDep) {
|
|
184
|
+
link.version = -1;
|
|
185
|
+
link.prevActiveLink = link.dep.activeLink;
|
|
186
|
+
link.dep.activeLink = link;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
function cleanupDeps(sub) {
|
|
190
|
+
let head;
|
|
191
|
+
let tail = sub.depsTail;
|
|
192
|
+
let link = tail;
|
|
193
|
+
while (link) {
|
|
194
|
+
const prev = link.prevDep;
|
|
195
|
+
if (link.version === -1) {
|
|
196
|
+
if (link === tail) tail = prev;
|
|
197
|
+
removeSub(link);
|
|
198
|
+
removeDep(link);
|
|
199
|
+
} else {
|
|
200
|
+
head = link;
|
|
201
|
+
}
|
|
202
|
+
link.dep.activeLink = link.prevActiveLink;
|
|
203
|
+
link.prevActiveLink = void 0;
|
|
204
|
+
link = prev;
|
|
205
|
+
}
|
|
206
|
+
sub.deps = head;
|
|
207
|
+
sub.depsTail = tail;
|
|
208
|
+
}
|
|
209
|
+
function isDirty(sub) {
|
|
210
|
+
for (let link = sub.deps; link; link = link.nextDep) {
|
|
211
|
+
if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) {
|
|
212
|
+
return true;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
if (sub._dirty) {
|
|
216
|
+
return true;
|
|
217
|
+
}
|
|
218
|
+
return false;
|
|
219
|
+
}
|
|
220
|
+
function refreshComputed(computed) {
|
|
221
|
+
if (computed.flags & 4 && !(computed.flags & 16)) {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
computed.flags &= -17;
|
|
225
|
+
if (computed.globalVersion === globalVersion) {
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
computed.globalVersion = globalVersion;
|
|
229
|
+
if (!computed.isSSR && computed.flags & 128 && (!computed.deps && !computed._dirty || !isDirty(computed))) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
computed.flags |= 2;
|
|
233
|
+
const dep = computed.dep;
|
|
234
|
+
const prevSub = activeSub;
|
|
235
|
+
const prevShouldTrack = shouldTrack;
|
|
236
|
+
activeSub = computed;
|
|
237
|
+
shouldTrack = true;
|
|
238
|
+
try {
|
|
239
|
+
prepareDeps(computed);
|
|
240
|
+
const value = computed.fn(computed._value);
|
|
241
|
+
if (dep.version === 0 || hasChanged(value, computed._value)) {
|
|
242
|
+
computed.flags |= 128;
|
|
243
|
+
computed._value = value;
|
|
244
|
+
dep.version++;
|
|
245
|
+
}
|
|
246
|
+
} catch (err) {
|
|
247
|
+
dep.version++;
|
|
248
|
+
throw err;
|
|
249
|
+
} finally {
|
|
250
|
+
activeSub = prevSub;
|
|
251
|
+
shouldTrack = prevShouldTrack;
|
|
252
|
+
cleanupDeps(computed);
|
|
253
|
+
computed.flags &= -3;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
function removeSub(link, soft = false) {
|
|
257
|
+
const { dep, prevSub, nextSub } = link;
|
|
258
|
+
if (prevSub) {
|
|
259
|
+
prevSub.nextSub = nextSub;
|
|
260
|
+
link.prevSub = void 0;
|
|
261
|
+
}
|
|
262
|
+
if (nextSub) {
|
|
263
|
+
nextSub.prevSub = prevSub;
|
|
264
|
+
link.nextSub = void 0;
|
|
265
|
+
}
|
|
266
|
+
if (!!(process.env.NODE_ENV !== "production") && dep.subsHead === link) {
|
|
267
|
+
dep.subsHead = nextSub;
|
|
268
|
+
}
|
|
269
|
+
if (dep.subs === link) {
|
|
270
|
+
dep.subs = prevSub;
|
|
271
|
+
if (!prevSub && dep.computed) {
|
|
272
|
+
dep.computed.flags &= -5;
|
|
273
|
+
for (let l = dep.computed.deps; l; l = l.nextDep) {
|
|
274
|
+
removeSub(l, true);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
if (!soft && !--dep.sc && dep.map) {
|
|
279
|
+
dep.map.delete(dep.key);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
function removeDep(link) {
|
|
283
|
+
const { prevDep, nextDep } = link;
|
|
284
|
+
if (prevDep) {
|
|
285
|
+
prevDep.nextDep = nextDep;
|
|
286
|
+
link.prevDep = void 0;
|
|
287
|
+
}
|
|
288
|
+
if (nextDep) {
|
|
289
|
+
nextDep.prevDep = prevDep;
|
|
290
|
+
link.nextDep = void 0;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
let shouldTrack = true;
|
|
294
|
+
const trackStack = [];
|
|
295
|
+
function pauseTracking() {
|
|
296
|
+
trackStack.push(shouldTrack);
|
|
297
|
+
shouldTrack = false;
|
|
298
|
+
}
|
|
299
|
+
function resetTracking() {
|
|
300
|
+
const last = trackStack.pop();
|
|
301
|
+
shouldTrack = last === void 0 ? true : last;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
let globalVersion = 0;
|
|
305
|
+
class Link {
|
|
306
|
+
constructor(sub, dep) {
|
|
307
|
+
this.sub = sub;
|
|
308
|
+
this.dep = dep;
|
|
309
|
+
this.version = dep.version;
|
|
310
|
+
this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
class Dep {
|
|
314
|
+
// TODO isolatedDeclarations "__v_skip"
|
|
315
|
+
constructor(computed) {
|
|
316
|
+
this.computed = computed;
|
|
317
|
+
this.version = 0;
|
|
318
|
+
/**
|
|
319
|
+
* Link between this dep and the current active effect
|
|
320
|
+
*/
|
|
321
|
+
this.activeLink = void 0;
|
|
322
|
+
/**
|
|
323
|
+
* Doubly linked list representing the subscribing effects (tail)
|
|
324
|
+
*/
|
|
325
|
+
this.subs = void 0;
|
|
326
|
+
/**
|
|
327
|
+
* For object property deps cleanup
|
|
328
|
+
*/
|
|
329
|
+
this.map = void 0;
|
|
330
|
+
this.key = void 0;
|
|
331
|
+
/**
|
|
332
|
+
* Subscriber counter
|
|
333
|
+
*/
|
|
334
|
+
this.sc = 0;
|
|
335
|
+
/**
|
|
336
|
+
* @internal
|
|
337
|
+
*/
|
|
338
|
+
this.__v_skip = true;
|
|
339
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
340
|
+
this.subsHead = void 0;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
track(debugInfo) {
|
|
344
|
+
if (!activeSub || !shouldTrack || activeSub === this.computed) {
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
let link = this.activeLink;
|
|
348
|
+
if (link === void 0 || link.sub !== activeSub) {
|
|
349
|
+
link = this.activeLink = new Link(activeSub, this);
|
|
350
|
+
if (!activeSub.deps) {
|
|
351
|
+
activeSub.deps = activeSub.depsTail = link;
|
|
352
|
+
} else {
|
|
353
|
+
link.prevDep = activeSub.depsTail;
|
|
354
|
+
activeSub.depsTail.nextDep = link;
|
|
355
|
+
activeSub.depsTail = link;
|
|
356
|
+
}
|
|
357
|
+
addSub(link);
|
|
358
|
+
} else if (link.version === -1) {
|
|
359
|
+
link.version = this.version;
|
|
360
|
+
if (link.nextDep) {
|
|
361
|
+
const next = link.nextDep;
|
|
362
|
+
next.prevDep = link.prevDep;
|
|
363
|
+
if (link.prevDep) {
|
|
364
|
+
link.prevDep.nextDep = next;
|
|
365
|
+
}
|
|
366
|
+
link.prevDep = activeSub.depsTail;
|
|
367
|
+
link.nextDep = void 0;
|
|
368
|
+
activeSub.depsTail.nextDep = link;
|
|
369
|
+
activeSub.depsTail = link;
|
|
370
|
+
if (activeSub.deps === link) {
|
|
371
|
+
activeSub.deps = next;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
if (!!(process.env.NODE_ENV !== "production") && activeSub.onTrack) {
|
|
376
|
+
activeSub.onTrack(
|
|
377
|
+
extend(
|
|
378
|
+
{
|
|
379
|
+
effect: activeSub
|
|
380
|
+
},
|
|
381
|
+
debugInfo
|
|
382
|
+
)
|
|
383
|
+
);
|
|
384
|
+
}
|
|
385
|
+
return link;
|
|
386
|
+
}
|
|
387
|
+
trigger(debugInfo) {
|
|
388
|
+
this.version++;
|
|
389
|
+
globalVersion++;
|
|
390
|
+
this.notify(debugInfo);
|
|
391
|
+
}
|
|
392
|
+
notify(debugInfo) {
|
|
393
|
+
startBatch();
|
|
394
|
+
try {
|
|
395
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
396
|
+
for (let head = this.subsHead; head; head = head.nextSub) {
|
|
397
|
+
if (head.sub.onTrigger && !(head.sub.flags & 8)) {
|
|
398
|
+
head.sub.onTrigger(
|
|
399
|
+
extend(
|
|
400
|
+
{
|
|
401
|
+
effect: head.sub
|
|
402
|
+
},
|
|
403
|
+
debugInfo
|
|
404
|
+
)
|
|
405
|
+
);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
for (let link = this.subs; link; link = link.prevSub) {
|
|
410
|
+
if (link.sub.notify()) {
|
|
411
|
+
;
|
|
412
|
+
link.sub.dep.notify();
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
} finally {
|
|
416
|
+
endBatch();
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
function addSub(link) {
|
|
421
|
+
link.dep.sc++;
|
|
422
|
+
if (link.sub.flags & 4) {
|
|
423
|
+
const computed = link.dep.computed;
|
|
424
|
+
if (computed && !link.dep.subs) {
|
|
425
|
+
computed.flags |= 4 | 16;
|
|
426
|
+
for (let l = computed.deps; l; l = l.nextDep) {
|
|
427
|
+
addSub(l);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
const currentTail = link.dep.subs;
|
|
431
|
+
if (currentTail !== link) {
|
|
432
|
+
link.prevSub = currentTail;
|
|
433
|
+
if (currentTail) currentTail.nextSub = link;
|
|
434
|
+
}
|
|
435
|
+
if (!!(process.env.NODE_ENV !== "production") && link.dep.subsHead === void 0) {
|
|
436
|
+
link.dep.subsHead = link;
|
|
437
|
+
}
|
|
438
|
+
link.dep.subs = link;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
const targetMap = /* @__PURE__ */ new WeakMap();
|
|
442
|
+
const ITERATE_KEY = Symbol(
|
|
443
|
+
!!(process.env.NODE_ENV !== "production") ? "Object iterate" : ""
|
|
444
|
+
);
|
|
445
|
+
const MAP_KEY_ITERATE_KEY = Symbol(
|
|
446
|
+
!!(process.env.NODE_ENV !== "production") ? "Map keys iterate" : ""
|
|
447
|
+
);
|
|
448
|
+
const ARRAY_ITERATE_KEY = Symbol(
|
|
449
|
+
!!(process.env.NODE_ENV !== "production") ? "Array iterate" : ""
|
|
450
|
+
);
|
|
451
|
+
function track(target, type, key) {
|
|
452
|
+
if (shouldTrack && activeSub) {
|
|
453
|
+
let depsMap = targetMap.get(target);
|
|
454
|
+
if (!depsMap) {
|
|
455
|
+
targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
|
|
456
|
+
}
|
|
457
|
+
let dep = depsMap.get(key);
|
|
458
|
+
if (!dep) {
|
|
459
|
+
depsMap.set(key, dep = new Dep());
|
|
460
|
+
dep.map = depsMap;
|
|
461
|
+
dep.key = key;
|
|
462
|
+
}
|
|
463
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
464
|
+
dep.track({
|
|
465
|
+
target,
|
|
466
|
+
type,
|
|
467
|
+
key
|
|
468
|
+
});
|
|
469
|
+
} else {
|
|
470
|
+
dep.track();
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
475
|
+
const depsMap = targetMap.get(target);
|
|
476
|
+
if (!depsMap) {
|
|
477
|
+
globalVersion++;
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
const run = (dep) => {
|
|
481
|
+
if (dep) {
|
|
482
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
483
|
+
dep.trigger({
|
|
484
|
+
target,
|
|
485
|
+
type,
|
|
486
|
+
key,
|
|
487
|
+
newValue,
|
|
488
|
+
oldValue,
|
|
489
|
+
oldTarget
|
|
490
|
+
});
|
|
491
|
+
} else {
|
|
492
|
+
dep.trigger();
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
};
|
|
496
|
+
startBatch();
|
|
497
|
+
if (type === "clear") {
|
|
498
|
+
depsMap.forEach(run);
|
|
499
|
+
} else {
|
|
500
|
+
const targetIsArray = isArray(target);
|
|
501
|
+
const isArrayIndex = targetIsArray && isIntegerKey(key);
|
|
502
|
+
if (targetIsArray && key === "length") {
|
|
503
|
+
const newLength = Number(newValue);
|
|
504
|
+
depsMap.forEach((dep, key2) => {
|
|
505
|
+
if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) {
|
|
506
|
+
run(dep);
|
|
507
|
+
}
|
|
508
|
+
});
|
|
509
|
+
} else {
|
|
510
|
+
if (key !== void 0 || depsMap.has(void 0)) {
|
|
511
|
+
run(depsMap.get(key));
|
|
512
|
+
}
|
|
513
|
+
if (isArrayIndex) {
|
|
514
|
+
run(depsMap.get(ARRAY_ITERATE_KEY));
|
|
515
|
+
}
|
|
516
|
+
switch (type) {
|
|
517
|
+
case "add":
|
|
518
|
+
if (!targetIsArray) {
|
|
519
|
+
run(depsMap.get(ITERATE_KEY));
|
|
520
|
+
if (isMap(target)) {
|
|
521
|
+
run(depsMap.get(MAP_KEY_ITERATE_KEY));
|
|
522
|
+
}
|
|
523
|
+
} else if (isArrayIndex) {
|
|
524
|
+
run(depsMap.get("length"));
|
|
525
|
+
}
|
|
526
|
+
break;
|
|
527
|
+
case "delete":
|
|
528
|
+
if (!targetIsArray) {
|
|
529
|
+
run(depsMap.get(ITERATE_KEY));
|
|
530
|
+
if (isMap(target)) {
|
|
531
|
+
run(depsMap.get(MAP_KEY_ITERATE_KEY));
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
break;
|
|
535
|
+
case "set":
|
|
536
|
+
if (isMap(target)) {
|
|
537
|
+
run(depsMap.get(ITERATE_KEY));
|
|
538
|
+
}
|
|
539
|
+
break;
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
endBatch();
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
function reactiveReadArray(array) {
|
|
547
|
+
const raw = toRaw(array);
|
|
548
|
+
if (raw === array) return raw;
|
|
549
|
+
track(raw, "iterate", ARRAY_ITERATE_KEY);
|
|
550
|
+
return isShallow(array) ? raw : raw.map(toReactive);
|
|
551
|
+
}
|
|
552
|
+
function shallowReadArray(arr) {
|
|
553
|
+
track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
|
|
554
|
+
return arr;
|
|
555
|
+
}
|
|
556
|
+
const arrayInstrumentations = {
|
|
557
|
+
__proto__: null,
|
|
558
|
+
[Symbol.iterator]() {
|
|
559
|
+
return iterator(this, Symbol.iterator, toReactive);
|
|
560
|
+
},
|
|
561
|
+
concat(...args) {
|
|
562
|
+
return reactiveReadArray(this).concat(
|
|
563
|
+
...args.map((x) => isArray(x) ? reactiveReadArray(x) : x)
|
|
564
|
+
);
|
|
565
|
+
},
|
|
566
|
+
entries() {
|
|
567
|
+
return iterator(this, "entries", (value) => {
|
|
568
|
+
value[1] = toReactive(value[1]);
|
|
569
|
+
return value;
|
|
570
|
+
});
|
|
571
|
+
},
|
|
572
|
+
every(fn, thisArg) {
|
|
573
|
+
return apply(this, "every", fn, thisArg, void 0, arguments);
|
|
574
|
+
},
|
|
575
|
+
filter(fn, thisArg) {
|
|
576
|
+
return apply(this, "filter", fn, thisArg, (v) => v.map(toReactive), arguments);
|
|
577
|
+
},
|
|
578
|
+
find(fn, thisArg) {
|
|
579
|
+
return apply(this, "find", fn, thisArg, toReactive, arguments);
|
|
580
|
+
},
|
|
581
|
+
findIndex(fn, thisArg) {
|
|
582
|
+
return apply(this, "findIndex", fn, thisArg, void 0, arguments);
|
|
583
|
+
},
|
|
584
|
+
findLast(fn, thisArg) {
|
|
585
|
+
return apply(this, "findLast", fn, thisArg, toReactive, arguments);
|
|
586
|
+
},
|
|
587
|
+
findLastIndex(fn, thisArg) {
|
|
588
|
+
return apply(this, "findLastIndex", fn, thisArg, void 0, arguments);
|
|
589
|
+
},
|
|
590
|
+
// flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement
|
|
591
|
+
forEach(fn, thisArg) {
|
|
592
|
+
return apply(this, "forEach", fn, thisArg, void 0, arguments);
|
|
593
|
+
},
|
|
594
|
+
includes(...args) {
|
|
595
|
+
return searchProxy(this, "includes", args);
|
|
596
|
+
},
|
|
597
|
+
indexOf(...args) {
|
|
598
|
+
return searchProxy(this, "indexOf", args);
|
|
599
|
+
},
|
|
600
|
+
join(separator) {
|
|
601
|
+
return reactiveReadArray(this).join(separator);
|
|
602
|
+
},
|
|
603
|
+
// keys() iterator only reads `length`, no optimization required
|
|
604
|
+
lastIndexOf(...args) {
|
|
605
|
+
return searchProxy(this, "lastIndexOf", args);
|
|
606
|
+
},
|
|
607
|
+
map(fn, thisArg) {
|
|
608
|
+
return apply(this, "map", fn, thisArg, void 0, arguments);
|
|
609
|
+
},
|
|
610
|
+
pop() {
|
|
611
|
+
return noTracking(this, "pop");
|
|
612
|
+
},
|
|
613
|
+
push(...args) {
|
|
614
|
+
return noTracking(this, "push", args);
|
|
615
|
+
},
|
|
616
|
+
reduce(fn, ...args) {
|
|
617
|
+
return reduce(this, "reduce", fn, args);
|
|
618
|
+
},
|
|
619
|
+
reduceRight(fn, ...args) {
|
|
620
|
+
return reduce(this, "reduceRight", fn, args);
|
|
621
|
+
},
|
|
622
|
+
shift() {
|
|
623
|
+
return noTracking(this, "shift");
|
|
624
|
+
},
|
|
625
|
+
// slice could use ARRAY_ITERATE but also seems to beg for range tracking
|
|
626
|
+
some(fn, thisArg) {
|
|
627
|
+
return apply(this, "some", fn, thisArg, void 0, arguments);
|
|
628
|
+
},
|
|
629
|
+
splice(...args) {
|
|
630
|
+
return noTracking(this, "splice", args);
|
|
631
|
+
},
|
|
632
|
+
toReversed() {
|
|
633
|
+
return reactiveReadArray(this).toReversed();
|
|
634
|
+
},
|
|
635
|
+
toSorted(comparer) {
|
|
636
|
+
return reactiveReadArray(this).toSorted(comparer);
|
|
637
|
+
},
|
|
638
|
+
toSpliced(...args) {
|
|
639
|
+
return reactiveReadArray(this).toSpliced(...args);
|
|
640
|
+
},
|
|
641
|
+
unshift(...args) {
|
|
642
|
+
return noTracking(this, "unshift", args);
|
|
643
|
+
},
|
|
644
|
+
values() {
|
|
645
|
+
return iterator(this, "values", toReactive);
|
|
646
|
+
}
|
|
647
|
+
};
|
|
648
|
+
function iterator(self, method, wrapValue) {
|
|
649
|
+
const arr = shallowReadArray(self);
|
|
650
|
+
const iter = arr[method]();
|
|
651
|
+
if (arr !== self && !isShallow(self)) {
|
|
652
|
+
iter._next = iter.next;
|
|
653
|
+
iter.next = () => {
|
|
654
|
+
const result = iter._next();
|
|
655
|
+
if (!result.done) {
|
|
656
|
+
result.value = wrapValue(result.value);
|
|
657
|
+
}
|
|
658
|
+
return result;
|
|
659
|
+
};
|
|
660
|
+
}
|
|
661
|
+
return iter;
|
|
662
|
+
}
|
|
663
|
+
const arrayProto = Array.prototype;
|
|
664
|
+
function apply(self, method, fn, thisArg, wrappedRetFn, args) {
|
|
665
|
+
const arr = shallowReadArray(self);
|
|
666
|
+
const needsWrap = arr !== self && !isShallow(self);
|
|
667
|
+
const methodFn = arr[method];
|
|
668
|
+
if (methodFn !== arrayProto[method]) {
|
|
669
|
+
const result2 = methodFn.apply(self, args);
|
|
670
|
+
return needsWrap ? toReactive(result2) : result2;
|
|
671
|
+
}
|
|
672
|
+
let wrappedFn = fn;
|
|
673
|
+
if (arr !== self) {
|
|
674
|
+
if (needsWrap) {
|
|
675
|
+
wrappedFn = function(item, index) {
|
|
676
|
+
return fn.call(this, toReactive(item), index, self);
|
|
677
|
+
};
|
|
678
|
+
} else if (fn.length > 2) {
|
|
679
|
+
wrappedFn = function(item, index) {
|
|
680
|
+
return fn.call(this, item, index, self);
|
|
681
|
+
};
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
const result = methodFn.call(arr, wrappedFn, thisArg);
|
|
685
|
+
return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result;
|
|
686
|
+
}
|
|
687
|
+
function reduce(self, method, fn, args) {
|
|
688
|
+
const arr = shallowReadArray(self);
|
|
689
|
+
let wrappedFn = fn;
|
|
690
|
+
if (arr !== self) {
|
|
691
|
+
if (!isShallow(self)) {
|
|
692
|
+
wrappedFn = function(acc, item, index) {
|
|
693
|
+
return fn.call(this, acc, toReactive(item), index, self);
|
|
694
|
+
};
|
|
695
|
+
} else if (fn.length > 3) {
|
|
696
|
+
wrappedFn = function(acc, item, index) {
|
|
697
|
+
return fn.call(this, acc, item, index, self);
|
|
698
|
+
};
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
return arr[method](wrappedFn, ...args);
|
|
702
|
+
}
|
|
703
|
+
function searchProxy(self, method, args) {
|
|
704
|
+
const arr = toRaw(self);
|
|
705
|
+
track(arr, "iterate", ARRAY_ITERATE_KEY);
|
|
706
|
+
const res = arr[method](...args);
|
|
707
|
+
if ((res === -1 || res === false) && isProxy(args[0])) {
|
|
708
|
+
args[0] = toRaw(args[0]);
|
|
709
|
+
return arr[method](...args);
|
|
710
|
+
}
|
|
711
|
+
return res;
|
|
712
|
+
}
|
|
713
|
+
function noTracking(self, method, args = []) {
|
|
714
|
+
pauseTracking();
|
|
715
|
+
startBatch();
|
|
716
|
+
const res = toRaw(self)[method].apply(self, args);
|
|
717
|
+
endBatch();
|
|
718
|
+
resetTracking();
|
|
719
|
+
return res;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
|
|
723
|
+
const builtInSymbols = new Set(
|
|
724
|
+
/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
|
|
725
|
+
);
|
|
726
|
+
function hasOwnProperty(key) {
|
|
727
|
+
if (!isSymbol(key)) key = String(key);
|
|
728
|
+
const obj = toRaw(this);
|
|
729
|
+
track(obj, "has", key);
|
|
730
|
+
return obj.hasOwnProperty(key);
|
|
731
|
+
}
|
|
732
|
+
class BaseReactiveHandler {
|
|
733
|
+
constructor(_isReadonly = false, _isShallow = false) {
|
|
734
|
+
this._isReadonly = _isReadonly;
|
|
735
|
+
this._isShallow = _isShallow;
|
|
736
|
+
}
|
|
737
|
+
get(target, key, receiver) {
|
|
738
|
+
if (key === "__v_skip") return target["__v_skip"];
|
|
739
|
+
const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
|
|
740
|
+
if (key === "__v_isReactive") {
|
|
741
|
+
return !isReadonly2;
|
|
742
|
+
} else if (key === "__v_isReadonly") {
|
|
743
|
+
return isReadonly2;
|
|
744
|
+
} else if (key === "__v_isShallow") {
|
|
745
|
+
return isShallow2;
|
|
746
|
+
} else if (key === "__v_raw") {
|
|
747
|
+
if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
|
|
748
|
+
// this means the receiver is a user proxy of the reactive proxy
|
|
749
|
+
Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
|
|
750
|
+
return target;
|
|
751
|
+
}
|
|
752
|
+
return;
|
|
753
|
+
}
|
|
754
|
+
const targetIsArray = isArray(target);
|
|
755
|
+
if (!isReadonly2) {
|
|
756
|
+
let fn;
|
|
757
|
+
if (targetIsArray && (fn = arrayInstrumentations[key])) {
|
|
758
|
+
return fn;
|
|
759
|
+
}
|
|
760
|
+
if (key === "hasOwnProperty") {
|
|
761
|
+
return hasOwnProperty;
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
const res = Reflect.get(
|
|
765
|
+
target,
|
|
766
|
+
key,
|
|
767
|
+
// if this is a proxy wrapping a ref, return methods using the raw ref
|
|
768
|
+
// as receiver so that we don't have to call `toRaw` on the ref in all
|
|
769
|
+
// its class methods
|
|
770
|
+
isRef(target) ? target : receiver
|
|
771
|
+
);
|
|
772
|
+
if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
|
|
773
|
+
return res;
|
|
774
|
+
}
|
|
775
|
+
if (!isReadonly2) {
|
|
776
|
+
track(target, "get", key);
|
|
777
|
+
}
|
|
778
|
+
if (isShallow2) {
|
|
779
|
+
return res;
|
|
780
|
+
}
|
|
781
|
+
if (isRef(res)) {
|
|
782
|
+
const value = targetIsArray && isIntegerKey(key) ? res : res.value;
|
|
783
|
+
return isReadonly2 && isObject(value) ? readonly(value) : value;
|
|
784
|
+
}
|
|
785
|
+
if (isObject(res)) {
|
|
786
|
+
return isReadonly2 ? readonly(res) : reactive(res);
|
|
787
|
+
}
|
|
788
|
+
return res;
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
class MutableReactiveHandler extends BaseReactiveHandler {
|
|
792
|
+
constructor(isShallow2 = false) {
|
|
793
|
+
super(false, isShallow2);
|
|
794
|
+
}
|
|
795
|
+
set(target, key, value, receiver) {
|
|
796
|
+
let oldValue = target[key];
|
|
797
|
+
if (!this._isShallow) {
|
|
798
|
+
const isOldValueReadonly = isReadonly(oldValue);
|
|
799
|
+
if (!isShallow(value) && !isReadonly(value)) {
|
|
800
|
+
oldValue = toRaw(oldValue);
|
|
801
|
+
value = toRaw(value);
|
|
802
|
+
}
|
|
803
|
+
if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
|
|
804
|
+
if (isOldValueReadonly) {
|
|
805
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
806
|
+
warn(
|
|
807
|
+
`Set operation on key "${String(key)}" failed: target is readonly.`,
|
|
808
|
+
target[key]
|
|
809
|
+
);
|
|
810
|
+
}
|
|
811
|
+
return true;
|
|
812
|
+
} else {
|
|
813
|
+
oldValue.value = value;
|
|
814
|
+
return true;
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
|
|
819
|
+
const result = Reflect.set(
|
|
820
|
+
target,
|
|
821
|
+
key,
|
|
822
|
+
value,
|
|
823
|
+
isRef(target) ? target : receiver
|
|
824
|
+
);
|
|
825
|
+
if (target === toRaw(receiver)) {
|
|
826
|
+
if (!hadKey) {
|
|
827
|
+
trigger(target, "add", key, value);
|
|
828
|
+
} else if (hasChanged(value, oldValue)) {
|
|
829
|
+
trigger(target, "set", key, value, oldValue);
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
return result;
|
|
833
|
+
}
|
|
834
|
+
deleteProperty(target, key) {
|
|
835
|
+
const hadKey = hasOwn(target, key);
|
|
836
|
+
const oldValue = target[key];
|
|
837
|
+
const result = Reflect.deleteProperty(target, key);
|
|
838
|
+
if (result && hadKey) {
|
|
839
|
+
trigger(target, "delete", key, void 0, oldValue);
|
|
840
|
+
}
|
|
841
|
+
return result;
|
|
842
|
+
}
|
|
843
|
+
has(target, key) {
|
|
844
|
+
const result = Reflect.has(target, key);
|
|
845
|
+
if (!isSymbol(key) || !builtInSymbols.has(key)) {
|
|
846
|
+
track(target, "has", key);
|
|
847
|
+
}
|
|
848
|
+
return result;
|
|
849
|
+
}
|
|
850
|
+
ownKeys(target) {
|
|
851
|
+
track(
|
|
852
|
+
target,
|
|
853
|
+
"iterate",
|
|
854
|
+
isArray(target) ? "length" : ITERATE_KEY
|
|
855
|
+
);
|
|
856
|
+
return Reflect.ownKeys(target);
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
class ReadonlyReactiveHandler extends BaseReactiveHandler {
|
|
860
|
+
constructor(isShallow2 = false) {
|
|
861
|
+
super(true, isShallow2);
|
|
862
|
+
}
|
|
863
|
+
set(target, key) {
|
|
864
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
865
|
+
warn(
|
|
866
|
+
`Set operation on key "${String(key)}" failed: target is readonly.`,
|
|
867
|
+
target
|
|
868
|
+
);
|
|
869
|
+
}
|
|
870
|
+
return true;
|
|
871
|
+
}
|
|
872
|
+
deleteProperty(target, key) {
|
|
873
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
874
|
+
warn(
|
|
875
|
+
`Delete operation on key "${String(key)}" failed: target is readonly.`,
|
|
876
|
+
target
|
|
877
|
+
);
|
|
878
|
+
}
|
|
879
|
+
return true;
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
|
|
883
|
+
const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
|
|
884
|
+
|
|
885
|
+
const toShallow = (value) => value;
|
|
886
|
+
const getProto = (v) => Reflect.getPrototypeOf(v);
|
|
887
|
+
function createIterableMethod(method, isReadonly2, isShallow2) {
|
|
888
|
+
return function(...args) {
|
|
889
|
+
const target = this["__v_raw"];
|
|
890
|
+
const rawTarget = toRaw(target);
|
|
891
|
+
const targetIsMap = isMap(rawTarget);
|
|
892
|
+
const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
|
|
893
|
+
const isKeyOnly = method === "keys" && targetIsMap;
|
|
894
|
+
const innerIterator = target[method](...args);
|
|
895
|
+
const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
|
|
896
|
+
!isReadonly2 && track(
|
|
897
|
+
rawTarget,
|
|
898
|
+
"iterate",
|
|
899
|
+
isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
|
|
900
|
+
);
|
|
901
|
+
return {
|
|
902
|
+
// iterator protocol
|
|
903
|
+
next() {
|
|
904
|
+
const { value, done } = innerIterator.next();
|
|
905
|
+
return done ? { value, done } : {
|
|
906
|
+
value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
|
|
907
|
+
done
|
|
908
|
+
};
|
|
909
|
+
},
|
|
910
|
+
// iterable protocol
|
|
911
|
+
[Symbol.iterator]() {
|
|
912
|
+
return this;
|
|
913
|
+
}
|
|
914
|
+
};
|
|
915
|
+
};
|
|
916
|
+
}
|
|
917
|
+
function createReadonlyMethod(type) {
|
|
918
|
+
return function(...args) {
|
|
919
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
920
|
+
const key = args[0] ? `on key "${args[0]}" ` : ``;
|
|
921
|
+
warn(
|
|
922
|
+
`${capitalize(type)} operation ${key}failed: target is readonly.`,
|
|
923
|
+
toRaw(this)
|
|
924
|
+
);
|
|
925
|
+
}
|
|
926
|
+
return type === "delete" ? false : type === "clear" ? void 0 : this;
|
|
927
|
+
};
|
|
928
|
+
}
|
|
929
|
+
function createInstrumentations(readonly, shallow) {
|
|
930
|
+
const instrumentations = {
|
|
931
|
+
get(key) {
|
|
932
|
+
const target = this["__v_raw"];
|
|
933
|
+
const rawTarget = toRaw(target);
|
|
934
|
+
const rawKey = toRaw(key);
|
|
935
|
+
if (!readonly) {
|
|
936
|
+
if (hasChanged(key, rawKey)) {
|
|
937
|
+
track(rawTarget, "get", key);
|
|
938
|
+
}
|
|
939
|
+
track(rawTarget, "get", rawKey);
|
|
940
|
+
}
|
|
941
|
+
const { has } = getProto(rawTarget);
|
|
942
|
+
const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
|
|
943
|
+
if (has.call(rawTarget, key)) {
|
|
944
|
+
return wrap(target.get(key));
|
|
945
|
+
} else if (has.call(rawTarget, rawKey)) {
|
|
946
|
+
return wrap(target.get(rawKey));
|
|
947
|
+
} else if (target !== rawTarget) {
|
|
948
|
+
target.get(key);
|
|
949
|
+
}
|
|
950
|
+
},
|
|
951
|
+
get size() {
|
|
952
|
+
const target = this["__v_raw"];
|
|
953
|
+
!readonly && track(toRaw(target), "iterate", ITERATE_KEY);
|
|
954
|
+
return target.size;
|
|
955
|
+
},
|
|
956
|
+
has(key) {
|
|
957
|
+
const target = this["__v_raw"];
|
|
958
|
+
const rawTarget = toRaw(target);
|
|
959
|
+
const rawKey = toRaw(key);
|
|
960
|
+
if (!readonly) {
|
|
961
|
+
if (hasChanged(key, rawKey)) {
|
|
962
|
+
track(rawTarget, "has", key);
|
|
963
|
+
}
|
|
964
|
+
track(rawTarget, "has", rawKey);
|
|
965
|
+
}
|
|
966
|
+
return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
|
|
967
|
+
},
|
|
968
|
+
forEach(callback, thisArg) {
|
|
969
|
+
const observed = this;
|
|
970
|
+
const target = observed["__v_raw"];
|
|
971
|
+
const rawTarget = toRaw(target);
|
|
972
|
+
const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
|
|
973
|
+
!readonly && track(rawTarget, "iterate", ITERATE_KEY);
|
|
974
|
+
return target.forEach((value, key) => {
|
|
975
|
+
return callback.call(thisArg, wrap(value), wrap(key), observed);
|
|
976
|
+
});
|
|
977
|
+
}
|
|
978
|
+
};
|
|
979
|
+
extend(
|
|
980
|
+
instrumentations,
|
|
981
|
+
readonly ? {
|
|
982
|
+
add: createReadonlyMethod("add"),
|
|
983
|
+
set: createReadonlyMethod("set"),
|
|
984
|
+
delete: createReadonlyMethod("delete"),
|
|
985
|
+
clear: createReadonlyMethod("clear")
|
|
986
|
+
} : {
|
|
987
|
+
add(value) {
|
|
988
|
+
if (!shallow && !isShallow(value) && !isReadonly(value)) {
|
|
989
|
+
value = toRaw(value);
|
|
990
|
+
}
|
|
991
|
+
const target = toRaw(this);
|
|
992
|
+
const proto = getProto(target);
|
|
993
|
+
const hadKey = proto.has.call(target, value);
|
|
994
|
+
if (!hadKey) {
|
|
995
|
+
target.add(value);
|
|
996
|
+
trigger(target, "add", value, value);
|
|
997
|
+
}
|
|
998
|
+
return this;
|
|
999
|
+
},
|
|
1000
|
+
set(key, value) {
|
|
1001
|
+
if (!shallow && !isShallow(value) && !isReadonly(value)) {
|
|
1002
|
+
value = toRaw(value);
|
|
1003
|
+
}
|
|
1004
|
+
const target = toRaw(this);
|
|
1005
|
+
const { has, get } = getProto(target);
|
|
1006
|
+
let hadKey = has.call(target, key);
|
|
1007
|
+
if (!hadKey) {
|
|
1008
|
+
key = toRaw(key);
|
|
1009
|
+
hadKey = has.call(target, key);
|
|
1010
|
+
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
1011
|
+
checkIdentityKeys(target, has, key);
|
|
1012
|
+
}
|
|
1013
|
+
const oldValue = get.call(target, key);
|
|
1014
|
+
target.set(key, value);
|
|
1015
|
+
if (!hadKey) {
|
|
1016
|
+
trigger(target, "add", key, value);
|
|
1017
|
+
} else if (hasChanged(value, oldValue)) {
|
|
1018
|
+
trigger(target, "set", key, value, oldValue);
|
|
1019
|
+
}
|
|
1020
|
+
return this;
|
|
1021
|
+
},
|
|
1022
|
+
delete(key) {
|
|
1023
|
+
const target = toRaw(this);
|
|
1024
|
+
const { has, get } = getProto(target);
|
|
1025
|
+
let hadKey = has.call(target, key);
|
|
1026
|
+
if (!hadKey) {
|
|
1027
|
+
key = toRaw(key);
|
|
1028
|
+
hadKey = has.call(target, key);
|
|
1029
|
+
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
1030
|
+
checkIdentityKeys(target, has, key);
|
|
1031
|
+
}
|
|
1032
|
+
const oldValue = get ? get.call(target, key) : void 0;
|
|
1033
|
+
const result = target.delete(key);
|
|
1034
|
+
if (hadKey) {
|
|
1035
|
+
trigger(target, "delete", key, void 0, oldValue);
|
|
1036
|
+
}
|
|
1037
|
+
return result;
|
|
1038
|
+
},
|
|
1039
|
+
clear() {
|
|
1040
|
+
const target = toRaw(this);
|
|
1041
|
+
const hadItems = target.size !== 0;
|
|
1042
|
+
const oldTarget = !!(process.env.NODE_ENV !== "production") ? isMap(target) ? new Map(target) : new Set(target) : void 0;
|
|
1043
|
+
const result = target.clear();
|
|
1044
|
+
if (hadItems) {
|
|
1045
|
+
trigger(
|
|
1046
|
+
target,
|
|
1047
|
+
"clear",
|
|
1048
|
+
void 0,
|
|
1049
|
+
void 0,
|
|
1050
|
+
oldTarget
|
|
1051
|
+
);
|
|
1052
|
+
}
|
|
1053
|
+
return result;
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
);
|
|
1057
|
+
const iteratorMethods = [
|
|
1058
|
+
"keys",
|
|
1059
|
+
"values",
|
|
1060
|
+
"entries",
|
|
1061
|
+
Symbol.iterator
|
|
1062
|
+
];
|
|
1063
|
+
iteratorMethods.forEach((method) => {
|
|
1064
|
+
instrumentations[method] = createIterableMethod(method, readonly, shallow);
|
|
1065
|
+
});
|
|
1066
|
+
return instrumentations;
|
|
1067
|
+
}
|
|
1068
|
+
function createInstrumentationGetter(isReadonly2, shallow) {
|
|
1069
|
+
const instrumentations = createInstrumentations(isReadonly2, shallow);
|
|
1070
|
+
return (target, key, receiver) => {
|
|
1071
|
+
if (key === "__v_isReactive") {
|
|
1072
|
+
return !isReadonly2;
|
|
1073
|
+
} else if (key === "__v_isReadonly") {
|
|
1074
|
+
return isReadonly2;
|
|
1075
|
+
} else if (key === "__v_raw") {
|
|
1076
|
+
return target;
|
|
1077
|
+
}
|
|
1078
|
+
return Reflect.get(
|
|
1079
|
+
hasOwn(instrumentations, key) && key in target ? instrumentations : target,
|
|
1080
|
+
key,
|
|
1081
|
+
receiver
|
|
1082
|
+
);
|
|
1083
|
+
};
|
|
1084
|
+
}
|
|
1085
|
+
const mutableCollectionHandlers = {
|
|
1086
|
+
get: /* @__PURE__ */ createInstrumentationGetter(false, false)
|
|
1087
|
+
};
|
|
1088
|
+
const readonlyCollectionHandlers = {
|
|
1089
|
+
get: /* @__PURE__ */ createInstrumentationGetter(true, false)
|
|
1090
|
+
};
|
|
1091
|
+
function checkIdentityKeys(target, has, key) {
|
|
1092
|
+
const rawKey = toRaw(key);
|
|
1093
|
+
if (rawKey !== key && has.call(target, rawKey)) {
|
|
1094
|
+
const type = toRawType(target);
|
|
1095
|
+
warn(
|
|
1096
|
+
`Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`
|
|
1097
|
+
);
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
const reactiveMap = /* @__PURE__ */ new WeakMap();
|
|
1102
|
+
const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
|
|
1103
|
+
const readonlyMap = /* @__PURE__ */ new WeakMap();
|
|
1104
|
+
const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
|
|
1105
|
+
function targetTypeMap(rawType) {
|
|
1106
|
+
switch (rawType) {
|
|
1107
|
+
case "Object":
|
|
1108
|
+
case "Array":
|
|
1109
|
+
return 1 /* COMMON */;
|
|
1110
|
+
case "Map":
|
|
1111
|
+
case "Set":
|
|
1112
|
+
case "WeakMap":
|
|
1113
|
+
case "WeakSet":
|
|
1114
|
+
return 2 /* COLLECTION */;
|
|
1115
|
+
default:
|
|
1116
|
+
return 0 /* INVALID */;
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
function getTargetType(value) {
|
|
1120
|
+
return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value));
|
|
1121
|
+
}
|
|
1122
|
+
function reactive(target) {
|
|
1123
|
+
if (isReadonly(target)) {
|
|
1124
|
+
return target;
|
|
1125
|
+
}
|
|
1126
|
+
return createReactiveObject(
|
|
1127
|
+
target,
|
|
1128
|
+
false,
|
|
1129
|
+
mutableHandlers,
|
|
1130
|
+
mutableCollectionHandlers,
|
|
1131
|
+
reactiveMap
|
|
1132
|
+
);
|
|
1133
|
+
}
|
|
1134
|
+
function readonly(target) {
|
|
1135
|
+
return createReactiveObject(
|
|
1136
|
+
target,
|
|
1137
|
+
true,
|
|
1138
|
+
readonlyHandlers,
|
|
1139
|
+
readonlyCollectionHandlers,
|
|
1140
|
+
readonlyMap
|
|
1141
|
+
);
|
|
1142
|
+
}
|
|
1143
|
+
function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
|
|
1144
|
+
if (!isObject(target)) {
|
|
1145
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1146
|
+
warn(
|
|
1147
|
+
`value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String(
|
|
1148
|
+
target
|
|
1149
|
+
)}`
|
|
1150
|
+
);
|
|
1151
|
+
}
|
|
1152
|
+
return target;
|
|
1153
|
+
}
|
|
1154
|
+
if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
|
|
1155
|
+
return target;
|
|
1156
|
+
}
|
|
1157
|
+
const targetType = getTargetType(target);
|
|
1158
|
+
if (targetType === 0 /* INVALID */) {
|
|
1159
|
+
return target;
|
|
1160
|
+
}
|
|
1161
|
+
const existingProxy = proxyMap.get(target);
|
|
1162
|
+
if (existingProxy) {
|
|
1163
|
+
return existingProxy;
|
|
1164
|
+
}
|
|
1165
|
+
const proxy = new Proxy(
|
|
1166
|
+
target,
|
|
1167
|
+
targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers
|
|
1168
|
+
);
|
|
1169
|
+
proxyMap.set(target, proxy);
|
|
1170
|
+
return proxy;
|
|
1171
|
+
}
|
|
1172
|
+
function isReactive(value) {
|
|
1173
|
+
if (isReadonly(value)) {
|
|
1174
|
+
return isReactive(value["__v_raw"]);
|
|
1175
|
+
}
|
|
1176
|
+
return !!(value && value["__v_isReactive"]);
|
|
1177
|
+
}
|
|
1178
|
+
function isReadonly(value) {
|
|
1179
|
+
return !!(value && value["__v_isReadonly"]);
|
|
1180
|
+
}
|
|
1181
|
+
function isShallow(value) {
|
|
1182
|
+
return !!(value && value["__v_isShallow"]);
|
|
1183
|
+
}
|
|
1184
|
+
function isProxy(value) {
|
|
1185
|
+
return value ? !!value["__v_raw"] : false;
|
|
1186
|
+
}
|
|
1187
|
+
function toRaw(observed) {
|
|
1188
|
+
const raw = observed && observed["__v_raw"];
|
|
1189
|
+
return raw ? toRaw(raw) : observed;
|
|
1190
|
+
}
|
|
1191
|
+
const toReactive = (value) => isObject(value) ? reactive(value) : value;
|
|
1192
|
+
const toReadonly = (value) => isObject(value) ? readonly(value) : value;
|
|
1193
|
+
|
|
1194
|
+
function isRef(r) {
|
|
1195
|
+
return r ? r["__v_isRef"] === true : false;
|
|
1196
|
+
}
|
|
1197
|
+
function shallowRef(value) {
|
|
1198
|
+
return createRef(value, true);
|
|
1199
|
+
}
|
|
1200
|
+
function createRef(rawValue, shallow) {
|
|
1201
|
+
if (isRef(rawValue)) {
|
|
1202
|
+
return rawValue;
|
|
1203
|
+
}
|
|
1204
|
+
return new RefImpl(rawValue, shallow);
|
|
1205
|
+
}
|
|
1206
|
+
class RefImpl {
|
|
1207
|
+
constructor(value, isShallow2) {
|
|
1208
|
+
this.dep = new Dep();
|
|
1209
|
+
this["__v_isRef"] = true;
|
|
1210
|
+
this["__v_isShallow"] = false;
|
|
1211
|
+
this._rawValue = isShallow2 ? value : toRaw(value);
|
|
1212
|
+
this._value = isShallow2 ? value : toReactive(value);
|
|
1213
|
+
this["__v_isShallow"] = isShallow2;
|
|
1214
|
+
}
|
|
1215
|
+
get value() {
|
|
1216
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1217
|
+
this.dep.track({
|
|
1218
|
+
target: this,
|
|
1219
|
+
type: "get",
|
|
1220
|
+
key: "value"
|
|
1221
|
+
});
|
|
1222
|
+
} else {
|
|
1223
|
+
this.dep.track();
|
|
1224
|
+
}
|
|
1225
|
+
return this._value;
|
|
1226
|
+
}
|
|
1227
|
+
set value(newValue) {
|
|
1228
|
+
const oldValue = this._rawValue;
|
|
1229
|
+
const useDirectValue = this["__v_isShallow"] || isShallow(newValue) || isReadonly(newValue);
|
|
1230
|
+
newValue = useDirectValue ? newValue : toRaw(newValue);
|
|
1231
|
+
if (hasChanged(newValue, oldValue)) {
|
|
1232
|
+
this._rawValue = newValue;
|
|
1233
|
+
this._value = useDirectValue ? newValue : toReactive(newValue);
|
|
1234
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1235
|
+
this.dep.trigger({
|
|
1236
|
+
target: this,
|
|
1237
|
+
type: "set",
|
|
1238
|
+
key: "value",
|
|
1239
|
+
newValue,
|
|
1240
|
+
oldValue
|
|
1241
|
+
});
|
|
1242
|
+
} else {
|
|
1243
|
+
this.dep.trigger();
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
function unref(ref2) {
|
|
1249
|
+
return isRef(ref2) ? ref2.value : ref2;
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
class ComputedRefImpl {
|
|
1253
|
+
constructor(fn, setter, isSSR) {
|
|
1254
|
+
this.fn = fn;
|
|
1255
|
+
this.setter = setter;
|
|
1256
|
+
/**
|
|
1257
|
+
* @internal
|
|
1258
|
+
*/
|
|
1259
|
+
this._value = void 0;
|
|
1260
|
+
/**
|
|
1261
|
+
* @internal
|
|
1262
|
+
*/
|
|
1263
|
+
this.dep = new Dep(this);
|
|
1264
|
+
/**
|
|
1265
|
+
* @internal
|
|
1266
|
+
*/
|
|
1267
|
+
this.__v_isRef = true;
|
|
1268
|
+
// TODO isolatedDeclarations "__v_isReadonly"
|
|
1269
|
+
// A computed is also a subscriber that tracks other deps
|
|
1270
|
+
/**
|
|
1271
|
+
* @internal
|
|
1272
|
+
*/
|
|
1273
|
+
this.deps = void 0;
|
|
1274
|
+
/**
|
|
1275
|
+
* @internal
|
|
1276
|
+
*/
|
|
1277
|
+
this.depsTail = void 0;
|
|
1278
|
+
/**
|
|
1279
|
+
* @internal
|
|
1280
|
+
*/
|
|
1281
|
+
this.flags = 16;
|
|
1282
|
+
/**
|
|
1283
|
+
* @internal
|
|
1284
|
+
*/
|
|
1285
|
+
this.globalVersion = globalVersion - 1;
|
|
1286
|
+
/**
|
|
1287
|
+
* @internal
|
|
1288
|
+
*/
|
|
1289
|
+
this.next = void 0;
|
|
1290
|
+
// for backwards compat
|
|
1291
|
+
this.effect = this;
|
|
1292
|
+
this["__v_isReadonly"] = !setter;
|
|
1293
|
+
this.isSSR = isSSR;
|
|
1294
|
+
}
|
|
1295
|
+
/**
|
|
1296
|
+
* @internal
|
|
1297
|
+
*/
|
|
1298
|
+
notify() {
|
|
1299
|
+
this.flags |= 16;
|
|
1300
|
+
if (!(this.flags & 8) && // avoid infinite self recursion
|
|
1301
|
+
activeSub !== this) {
|
|
1302
|
+
batch(this, true);
|
|
1303
|
+
return true;
|
|
1304
|
+
} else if (!!(process.env.NODE_ENV !== "production")) ;
|
|
1305
|
+
}
|
|
1306
|
+
get value() {
|
|
1307
|
+
const link = !!(process.env.NODE_ENV !== "production") ? this.dep.track({
|
|
1308
|
+
target: this,
|
|
1309
|
+
type: "get",
|
|
1310
|
+
key: "value"
|
|
1311
|
+
}) : this.dep.track();
|
|
1312
|
+
refreshComputed(this);
|
|
1313
|
+
if (link) {
|
|
1314
|
+
link.version = this.dep.version;
|
|
1315
|
+
}
|
|
1316
|
+
return this._value;
|
|
1317
|
+
}
|
|
1318
|
+
set value(newValue) {
|
|
1319
|
+
if (this.setter) {
|
|
1320
|
+
this.setter(newValue);
|
|
1321
|
+
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
1322
|
+
warn("Write operation failed: computed value is readonly");
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
1327
|
+
let getter;
|
|
1328
|
+
let setter;
|
|
1329
|
+
if (isFunction(getterOrOptions)) {
|
|
1330
|
+
getter = getterOrOptions;
|
|
1331
|
+
} else {
|
|
1332
|
+
getter = getterOrOptions.get;
|
|
1333
|
+
setter = getterOrOptions.set;
|
|
1334
|
+
}
|
|
1335
|
+
const cRef = new ComputedRefImpl(getter, setter, isSSR);
|
|
1336
|
+
if (!!(process.env.NODE_ENV !== "production") && debugOptions) ;
|
|
1337
|
+
return cRef;
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
/**
|
|
1341
|
+
* @vue/runtime-core v3.5.22
|
|
1342
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
1343
|
+
* @license MIT
|
|
1344
|
+
**/
|
|
1345
|
+
const stack = [];
|
|
1346
|
+
function pushWarningContext(vnode) {
|
|
1347
|
+
stack.push(vnode);
|
|
1348
|
+
}
|
|
1349
|
+
function popWarningContext() {
|
|
1350
|
+
stack.pop();
|
|
1351
|
+
}
|
|
1352
|
+
let isWarning = false;
|
|
1353
|
+
function warn$1(msg, ...args) {
|
|
1354
|
+
if (isWarning) return;
|
|
1355
|
+
isWarning = true;
|
|
1356
|
+
pauseTracking();
|
|
1357
|
+
const instance = stack.length ? stack[stack.length - 1].component : null;
|
|
1358
|
+
const appWarnHandler = instance && instance.appContext.config.warnHandler;
|
|
1359
|
+
const trace = getComponentTrace();
|
|
1360
|
+
if (appWarnHandler) {
|
|
1361
|
+
callWithErrorHandling(
|
|
1362
|
+
appWarnHandler,
|
|
1363
|
+
instance,
|
|
1364
|
+
11,
|
|
1365
|
+
[
|
|
1366
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
1367
|
+
msg + args.map((a) => {
|
|
1368
|
+
var _a, _b;
|
|
1369
|
+
return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
|
|
1370
|
+
}).join(""),
|
|
1371
|
+
instance && instance.proxy,
|
|
1372
|
+
trace.map(
|
|
1373
|
+
({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
|
|
1374
|
+
).join("\n"),
|
|
1375
|
+
trace
|
|
1376
|
+
]
|
|
1377
|
+
);
|
|
1378
|
+
} else {
|
|
1379
|
+
const warnArgs = [`[Vue warn]: ${msg}`, ...args];
|
|
1380
|
+
if (trace.length && // avoid spamming console during tests
|
|
1381
|
+
true) {
|
|
1382
|
+
warnArgs.push(`
|
|
1383
|
+
`, ...formatTrace(trace));
|
|
1384
|
+
}
|
|
1385
|
+
console.warn(...warnArgs);
|
|
1386
|
+
}
|
|
1387
|
+
resetTracking();
|
|
1388
|
+
isWarning = false;
|
|
1389
|
+
}
|
|
1390
|
+
function getComponentTrace() {
|
|
1391
|
+
let currentVNode = stack[stack.length - 1];
|
|
1392
|
+
if (!currentVNode) {
|
|
1393
|
+
return [];
|
|
1394
|
+
}
|
|
1395
|
+
const normalizedStack = [];
|
|
1396
|
+
while (currentVNode) {
|
|
1397
|
+
const last = normalizedStack[0];
|
|
1398
|
+
if (last && last.vnode === currentVNode) {
|
|
1399
|
+
last.recurseCount++;
|
|
1400
|
+
} else {
|
|
1401
|
+
normalizedStack.push({
|
|
1402
|
+
vnode: currentVNode,
|
|
1403
|
+
recurseCount: 0
|
|
1404
|
+
});
|
|
1405
|
+
}
|
|
1406
|
+
const parentInstance = currentVNode.component && currentVNode.component.parent;
|
|
1407
|
+
currentVNode = parentInstance && parentInstance.vnode;
|
|
1408
|
+
}
|
|
1409
|
+
return normalizedStack;
|
|
1410
|
+
}
|
|
1411
|
+
function formatTrace(trace) {
|
|
1412
|
+
const logs = [];
|
|
1413
|
+
trace.forEach((entry, i) => {
|
|
1414
|
+
logs.push(...i === 0 ? [] : [`
|
|
1415
|
+
`], ...formatTraceEntry(entry));
|
|
1416
|
+
});
|
|
1417
|
+
return logs;
|
|
1418
|
+
}
|
|
1419
|
+
function formatTraceEntry({ vnode, recurseCount }) {
|
|
1420
|
+
const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
|
|
1421
|
+
const isRoot = vnode.component ? vnode.component.parent == null : false;
|
|
1422
|
+
const open = ` at <${formatComponentName(
|
|
1423
|
+
vnode.component,
|
|
1424
|
+
vnode.type,
|
|
1425
|
+
isRoot
|
|
1426
|
+
)}`;
|
|
1427
|
+
const close = `>` + postfix;
|
|
1428
|
+
return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
|
|
1429
|
+
}
|
|
1430
|
+
function formatProps(props) {
|
|
1431
|
+
const res = [];
|
|
1432
|
+
const keys = Object.keys(props);
|
|
1433
|
+
keys.slice(0, 3).forEach((key) => {
|
|
1434
|
+
res.push(...formatProp(key, props[key]));
|
|
1435
|
+
});
|
|
1436
|
+
if (keys.length > 3) {
|
|
1437
|
+
res.push(` ...`);
|
|
1438
|
+
}
|
|
1439
|
+
return res;
|
|
1440
|
+
}
|
|
1441
|
+
function formatProp(key, value, raw) {
|
|
1442
|
+
if (isString(value)) {
|
|
1443
|
+
value = JSON.stringify(value);
|
|
1444
|
+
return raw ? value : [`${key}=${value}`];
|
|
1445
|
+
} else if (typeof value === "number" || typeof value === "boolean" || value == null) {
|
|
1446
|
+
return raw ? value : [`${key}=${value}`];
|
|
1447
|
+
} else if (isRef(value)) {
|
|
1448
|
+
value = formatProp(key, toRaw(value.value), true);
|
|
1449
|
+
return raw ? value : [`${key}=Ref<`, value, `>`];
|
|
1450
|
+
} else if (isFunction(value)) {
|
|
1451
|
+
return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
|
|
1452
|
+
} else {
|
|
1453
|
+
value = toRaw(value);
|
|
1454
|
+
return raw ? value : [`${key}=`, value];
|
|
1455
|
+
}
|
|
1456
|
+
}
|
|
1457
|
+
const ErrorTypeStrings$1 = {
|
|
1458
|
+
["sp"]: "serverPrefetch hook",
|
|
1459
|
+
["bc"]: "beforeCreate hook",
|
|
1460
|
+
["c"]: "created hook",
|
|
1461
|
+
["bm"]: "beforeMount hook",
|
|
1462
|
+
["m"]: "mounted hook",
|
|
1463
|
+
["bu"]: "beforeUpdate hook",
|
|
1464
|
+
["u"]: "updated",
|
|
1465
|
+
["bum"]: "beforeUnmount hook",
|
|
1466
|
+
["um"]: "unmounted hook",
|
|
1467
|
+
["a"]: "activated hook",
|
|
1468
|
+
["da"]: "deactivated hook",
|
|
1469
|
+
["ec"]: "errorCaptured hook",
|
|
1470
|
+
["rtc"]: "renderTracked hook",
|
|
1471
|
+
["rtg"]: "renderTriggered hook",
|
|
1472
|
+
[0]: "setup function",
|
|
1473
|
+
[1]: "render function",
|
|
1474
|
+
[2]: "watcher getter",
|
|
1475
|
+
[3]: "watcher callback",
|
|
1476
|
+
[4]: "watcher cleanup function",
|
|
1477
|
+
[5]: "native event handler",
|
|
1478
|
+
[6]: "component event handler",
|
|
1479
|
+
[7]: "vnode hook",
|
|
1480
|
+
[8]: "directive hook",
|
|
1481
|
+
[9]: "transition hook",
|
|
1482
|
+
[10]: "app errorHandler",
|
|
1483
|
+
[11]: "app warnHandler",
|
|
1484
|
+
[12]: "ref function",
|
|
1485
|
+
[13]: "async component loader",
|
|
1486
|
+
[14]: "scheduler flush",
|
|
1487
|
+
[15]: "component update",
|
|
1488
|
+
[16]: "app unmount cleanup function"
|
|
1489
|
+
};
|
|
1490
|
+
function callWithErrorHandling(fn, instance, type, args) {
|
|
1491
|
+
try {
|
|
1492
|
+
return args ? fn(...args) : fn();
|
|
1493
|
+
} catch (err) {
|
|
1494
|
+
handleError(err, instance, type);
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1497
|
+
function handleError(err, instance, type, throwInDev = true) {
|
|
1498
|
+
const contextVNode = instance ? instance.vnode : null;
|
|
1499
|
+
const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
|
|
1500
|
+
if (instance) {
|
|
1501
|
+
let cur = instance.parent;
|
|
1502
|
+
const exposedInstance = instance.proxy;
|
|
1503
|
+
const errorInfo = !!(process.env.NODE_ENV !== "production") ? ErrorTypeStrings$1[type] : `https://vuejs.org/error-reference/#runtime-${type}`;
|
|
1504
|
+
while (cur) {
|
|
1505
|
+
const errorCapturedHooks = cur.ec;
|
|
1506
|
+
if (errorCapturedHooks) {
|
|
1507
|
+
for (let i = 0; i < errorCapturedHooks.length; i++) {
|
|
1508
|
+
if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
|
|
1509
|
+
return;
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1513
|
+
cur = cur.parent;
|
|
1514
|
+
}
|
|
1515
|
+
if (errorHandler) {
|
|
1516
|
+
pauseTracking();
|
|
1517
|
+
callWithErrorHandling(errorHandler, null, 10, [
|
|
1518
|
+
err,
|
|
1519
|
+
exposedInstance,
|
|
1520
|
+
errorInfo
|
|
1521
|
+
]);
|
|
1522
|
+
resetTracking();
|
|
1523
|
+
return;
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction);
|
|
1527
|
+
}
|
|
1528
|
+
function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) {
|
|
1529
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1530
|
+
const info = ErrorTypeStrings$1[type];
|
|
1531
|
+
if (contextVNode) {
|
|
1532
|
+
pushWarningContext(contextVNode);
|
|
1533
|
+
}
|
|
1534
|
+
warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
|
|
1535
|
+
if (contextVNode) {
|
|
1536
|
+
popWarningContext();
|
|
1537
|
+
}
|
|
1538
|
+
if (throwInDev) {
|
|
1539
|
+
throw err;
|
|
1540
|
+
} else {
|
|
1541
|
+
console.error(err);
|
|
1542
|
+
}
|
|
1543
|
+
} else if (throwInProd) {
|
|
1544
|
+
throw err;
|
|
1545
|
+
} else {
|
|
1546
|
+
console.error(err);
|
|
1547
|
+
}
|
|
1548
|
+
}
|
|
1549
|
+
const queue = [];
|
|
1550
|
+
let flushIndex = -1;
|
|
1551
|
+
const pendingPostFlushCbs = [];
|
|
1552
|
+
let activePostFlushCbs = null;
|
|
1553
|
+
let postFlushIndex = 0;
|
|
1554
|
+
const resolvedPromise = /* @__PURE__ */ Promise.resolve();
|
|
1555
|
+
let currentFlushPromise = null;
|
|
1556
|
+
const RECURSION_LIMIT = 100;
|
|
1557
|
+
function findInsertionIndex(id) {
|
|
1558
|
+
let start = flushIndex + 1;
|
|
1559
|
+
let end = queue.length;
|
|
1560
|
+
while (start < end) {
|
|
1561
|
+
const middle = start + end >>> 1;
|
|
1562
|
+
const middleJob = queue[middle];
|
|
1563
|
+
const middleJobId = getId(middleJob);
|
|
1564
|
+
if (middleJobId < id || middleJobId === id && middleJob.flags & 2) {
|
|
1565
|
+
start = middle + 1;
|
|
1566
|
+
} else {
|
|
1567
|
+
end = middle;
|
|
1568
|
+
}
|
|
1569
|
+
}
|
|
1570
|
+
return start;
|
|
1571
|
+
}
|
|
1572
|
+
function queueJob(job) {
|
|
1573
|
+
if (!(job.flags & 1)) {
|
|
1574
|
+
const jobId = getId(job);
|
|
1575
|
+
const lastJob = queue[queue.length - 1];
|
|
1576
|
+
if (!lastJob || // fast path when the job id is larger than the tail
|
|
1577
|
+
!(job.flags & 2) && jobId >= getId(lastJob)) {
|
|
1578
|
+
queue.push(job);
|
|
1579
|
+
} else {
|
|
1580
|
+
queue.splice(findInsertionIndex(jobId), 0, job);
|
|
1581
|
+
}
|
|
1582
|
+
job.flags |= 1;
|
|
1583
|
+
queueFlush();
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1586
|
+
function queueFlush() {
|
|
1587
|
+
if (!currentFlushPromise) {
|
|
1588
|
+
currentFlushPromise = resolvedPromise.then(flushJobs);
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1591
|
+
function queuePostFlushCb(cb) {
|
|
1592
|
+
if (!isArray(cb)) {
|
|
1593
|
+
if (activePostFlushCbs && cb.id === -1) {
|
|
1594
|
+
activePostFlushCbs.splice(postFlushIndex + 1, 0, cb);
|
|
1595
|
+
} else if (!(cb.flags & 1)) {
|
|
1596
|
+
pendingPostFlushCbs.push(cb);
|
|
1597
|
+
cb.flags |= 1;
|
|
1598
|
+
}
|
|
1599
|
+
} else {
|
|
1600
|
+
pendingPostFlushCbs.push(...cb);
|
|
1601
|
+
}
|
|
1602
|
+
queueFlush();
|
|
1603
|
+
}
|
|
1604
|
+
function flushPostFlushCbs(seen) {
|
|
1605
|
+
if (pendingPostFlushCbs.length) {
|
|
1606
|
+
const deduped = [...new Set(pendingPostFlushCbs)].sort(
|
|
1607
|
+
(a, b) => getId(a) - getId(b)
|
|
1608
|
+
);
|
|
1609
|
+
pendingPostFlushCbs.length = 0;
|
|
1610
|
+
if (activePostFlushCbs) {
|
|
1611
|
+
activePostFlushCbs.push(...deduped);
|
|
1612
|
+
return;
|
|
1613
|
+
}
|
|
1614
|
+
activePostFlushCbs = deduped;
|
|
1615
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1616
|
+
seen = seen || /* @__PURE__ */ new Map();
|
|
1617
|
+
}
|
|
1618
|
+
for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
|
|
1619
|
+
const cb = activePostFlushCbs[postFlushIndex];
|
|
1620
|
+
if (!!(process.env.NODE_ENV !== "production") && checkRecursiveUpdates(seen, cb)) {
|
|
1621
|
+
continue;
|
|
1622
|
+
}
|
|
1623
|
+
if (cb.flags & 4) {
|
|
1624
|
+
cb.flags &= -2;
|
|
1625
|
+
}
|
|
1626
|
+
if (!(cb.flags & 8)) cb();
|
|
1627
|
+
cb.flags &= -2;
|
|
1628
|
+
}
|
|
1629
|
+
activePostFlushCbs = null;
|
|
1630
|
+
postFlushIndex = 0;
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1633
|
+
const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
|
|
1634
|
+
function flushJobs(seen) {
|
|
1635
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1636
|
+
seen = seen || /* @__PURE__ */ new Map();
|
|
1637
|
+
}
|
|
1638
|
+
const check = !!(process.env.NODE_ENV !== "production") ? (job) => checkRecursiveUpdates(seen, job) : NOOP;
|
|
1639
|
+
try {
|
|
1640
|
+
for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
|
|
1641
|
+
const job = queue[flushIndex];
|
|
1642
|
+
if (job && !(job.flags & 8)) {
|
|
1643
|
+
if (!!(process.env.NODE_ENV !== "production") && check(job)) {
|
|
1644
|
+
continue;
|
|
1645
|
+
}
|
|
1646
|
+
if (job.flags & 4) {
|
|
1647
|
+
job.flags &= ~1;
|
|
1648
|
+
}
|
|
1649
|
+
callWithErrorHandling(
|
|
1650
|
+
job,
|
|
1651
|
+
job.i,
|
|
1652
|
+
job.i ? 15 : 14
|
|
1653
|
+
);
|
|
1654
|
+
if (!(job.flags & 4)) {
|
|
1655
|
+
job.flags &= ~1;
|
|
1656
|
+
}
|
|
1657
|
+
}
|
|
1658
|
+
}
|
|
1659
|
+
} finally {
|
|
1660
|
+
for (; flushIndex < queue.length; flushIndex++) {
|
|
1661
|
+
const job = queue[flushIndex];
|
|
1662
|
+
if (job) {
|
|
1663
|
+
job.flags &= -2;
|
|
1664
|
+
}
|
|
1665
|
+
}
|
|
1666
|
+
flushIndex = -1;
|
|
1667
|
+
queue.length = 0;
|
|
1668
|
+
flushPostFlushCbs(seen);
|
|
1669
|
+
currentFlushPromise = null;
|
|
1670
|
+
if (queue.length || pendingPostFlushCbs.length) {
|
|
1671
|
+
flushJobs(seen);
|
|
1672
|
+
}
|
|
1673
|
+
}
|
|
1674
|
+
}
|
|
1675
|
+
function checkRecursiveUpdates(seen, fn) {
|
|
1676
|
+
const count = seen.get(fn) || 0;
|
|
1677
|
+
if (count > RECURSION_LIMIT) {
|
|
1678
|
+
const instance = fn.i;
|
|
1679
|
+
const componentName = instance && getComponentName(instance.type);
|
|
1680
|
+
handleError(
|
|
1681
|
+
`Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
|
|
1682
|
+
null,
|
|
1683
|
+
10
|
|
1684
|
+
);
|
|
1685
|
+
return true;
|
|
1686
|
+
}
|
|
1687
|
+
seen.set(fn, count + 1);
|
|
1688
|
+
return false;
|
|
1689
|
+
}
|
|
1690
|
+
const hmrDirtyComponents = /* @__PURE__ */ new Map();
|
|
1691
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1692
|
+
getGlobalThis().__VUE_HMR_RUNTIME__ = {
|
|
1693
|
+
createRecord: tryWrap(createRecord),
|
|
1694
|
+
rerender: tryWrap(rerender),
|
|
1695
|
+
reload: tryWrap(reload)
|
|
1696
|
+
};
|
|
1697
|
+
}
|
|
1698
|
+
const map = /* @__PURE__ */ new Map();
|
|
1699
|
+
function createRecord(id, initialDef) {
|
|
1700
|
+
if (map.has(id)) {
|
|
1701
|
+
return false;
|
|
1702
|
+
}
|
|
1703
|
+
map.set(id, {
|
|
1704
|
+
initialDef: normalizeClassComponent(initialDef),
|
|
1705
|
+
instances: /* @__PURE__ */ new Set()
|
|
1706
|
+
});
|
|
1707
|
+
return true;
|
|
1708
|
+
}
|
|
1709
|
+
function normalizeClassComponent(component) {
|
|
1710
|
+
return isClassComponent(component) ? component.__vccOpts : component;
|
|
1711
|
+
}
|
|
1712
|
+
function rerender(id, newRender) {
|
|
1713
|
+
const record = map.get(id);
|
|
1714
|
+
if (!record) {
|
|
1715
|
+
return;
|
|
1716
|
+
}
|
|
1717
|
+
record.initialDef.render = newRender;
|
|
1718
|
+
[...record.instances].forEach((instance) => {
|
|
1719
|
+
if (newRender) {
|
|
1720
|
+
instance.render = newRender;
|
|
1721
|
+
normalizeClassComponent(instance.type).render = newRender;
|
|
1722
|
+
}
|
|
1723
|
+
instance.renderCache = [];
|
|
1724
|
+
if (!(instance.job.flags & 8)) {
|
|
1725
|
+
instance.update();
|
|
1726
|
+
}
|
|
1727
|
+
});
|
|
1728
|
+
}
|
|
1729
|
+
function reload(id, newComp) {
|
|
1730
|
+
const record = map.get(id);
|
|
1731
|
+
if (!record) return;
|
|
1732
|
+
newComp = normalizeClassComponent(newComp);
|
|
1733
|
+
updateComponentDef(record.initialDef, newComp);
|
|
1734
|
+
const instances = [...record.instances];
|
|
1735
|
+
for (let i = 0; i < instances.length; i++) {
|
|
1736
|
+
const instance = instances[i];
|
|
1737
|
+
const oldComp = normalizeClassComponent(instance.type);
|
|
1738
|
+
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
1739
|
+
if (!dirtyInstances) {
|
|
1740
|
+
if (oldComp !== record.initialDef) {
|
|
1741
|
+
updateComponentDef(oldComp, newComp);
|
|
1742
|
+
}
|
|
1743
|
+
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
1744
|
+
}
|
|
1745
|
+
dirtyInstances.add(instance);
|
|
1746
|
+
instance.appContext.propsCache.delete(instance.type);
|
|
1747
|
+
instance.appContext.emitsCache.delete(instance.type);
|
|
1748
|
+
instance.appContext.optionsCache.delete(instance.type);
|
|
1749
|
+
if (instance.ceReload) {
|
|
1750
|
+
dirtyInstances.add(instance);
|
|
1751
|
+
instance.ceReload(newComp.styles);
|
|
1752
|
+
dirtyInstances.delete(instance);
|
|
1753
|
+
} else if (instance.parent) {
|
|
1754
|
+
queueJob(() => {
|
|
1755
|
+
if (!(instance.job.flags & 8)) {
|
|
1756
|
+
instance.parent.update();
|
|
1757
|
+
dirtyInstances.delete(instance);
|
|
1758
|
+
}
|
|
1759
|
+
});
|
|
1760
|
+
} else if (instance.appContext.reload) {
|
|
1761
|
+
instance.appContext.reload();
|
|
1762
|
+
} else if (typeof window !== "undefined") {
|
|
1763
|
+
window.location.reload();
|
|
1764
|
+
} else {
|
|
1765
|
+
console.warn(
|
|
1766
|
+
"[HMR] Root or manually mounted instance modified. Full reload required."
|
|
1767
|
+
);
|
|
1768
|
+
}
|
|
1769
|
+
if (instance.root.ce && instance !== instance.root) {
|
|
1770
|
+
instance.root.ce._removeChildStyle(oldComp);
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
queuePostFlushCb(() => {
|
|
1774
|
+
hmrDirtyComponents.clear();
|
|
1775
|
+
});
|
|
1776
|
+
}
|
|
1777
|
+
function updateComponentDef(oldComp, newComp) {
|
|
1778
|
+
extend(oldComp, newComp);
|
|
1779
|
+
for (const key in oldComp) {
|
|
1780
|
+
if (key !== "__file" && !(key in newComp)) {
|
|
1781
|
+
delete oldComp[key];
|
|
1782
|
+
}
|
|
1783
|
+
}
|
|
1784
|
+
}
|
|
1785
|
+
function tryWrap(fn) {
|
|
1786
|
+
return (id, arg) => {
|
|
1787
|
+
try {
|
|
1788
|
+
return fn(id, arg);
|
|
1789
|
+
} catch (e) {
|
|
1790
|
+
console.error(e);
|
|
1791
|
+
console.warn(
|
|
1792
|
+
`[HMR] Something went wrong during Vue component hot-reload. Full reload required.`
|
|
1793
|
+
);
|
|
1794
|
+
}
|
|
1795
|
+
};
|
|
1796
|
+
}
|
|
1797
|
+
let devtools$1;
|
|
1798
|
+
let buffer = [];
|
|
1799
|
+
let devtoolsNotInstalled = false;
|
|
1800
|
+
function emit$1(event, ...args) {
|
|
1801
|
+
if (devtools$1) {
|
|
1802
|
+
devtools$1.emit(event, ...args);
|
|
1803
|
+
} else if (!devtoolsNotInstalled) {
|
|
1804
|
+
buffer.push({ event, args });
|
|
1805
|
+
}
|
|
1806
|
+
}
|
|
1807
|
+
function setDevtoolsHook$1(hook, target) {
|
|
1808
|
+
var _a, _b;
|
|
1809
|
+
devtools$1 = hook;
|
|
1810
|
+
if (devtools$1) {
|
|
1811
|
+
devtools$1.enabled = true;
|
|
1812
|
+
buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args));
|
|
1813
|
+
buffer = [];
|
|
1814
|
+
} else if (
|
|
1815
|
+
// handle late devtools injection - only do this if we are in an actual
|
|
1816
|
+
// browser environment to avoid the timer handle stalling test runner exit
|
|
1817
|
+
// (#4815)
|
|
1818
|
+
typeof window !== "undefined" && // some envs mock window but not fully
|
|
1819
|
+
window.HTMLElement && // also exclude jsdom
|
|
1820
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
1821
|
+
!((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom"))
|
|
1822
|
+
) {
|
|
1823
|
+
const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];
|
|
1824
|
+
replay.push((newHook) => {
|
|
1825
|
+
setDevtoolsHook$1(newHook, target);
|
|
1826
|
+
});
|
|
1827
|
+
setTimeout(() => {
|
|
1828
|
+
if (!devtools$1) {
|
|
1829
|
+
target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
|
|
1830
|
+
devtoolsNotInstalled = true;
|
|
1831
|
+
buffer = [];
|
|
1832
|
+
}
|
|
1833
|
+
}, 3e3);
|
|
1834
|
+
} else {
|
|
1835
|
+
devtoolsNotInstalled = true;
|
|
1836
|
+
buffer = [];
|
|
1837
|
+
}
|
|
1838
|
+
}
|
|
1839
|
+
const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook(
|
|
1840
|
+
"component:updated"
|
|
1841
|
+
/* COMPONENT_UPDATED */
|
|
1842
|
+
);
|
|
1843
|
+
// @__NO_SIDE_EFFECTS__
|
|
1844
|
+
function createDevtoolsComponentHook(hook) {
|
|
1845
|
+
return (component) => {
|
|
1846
|
+
emit$1(
|
|
1847
|
+
hook,
|
|
1848
|
+
component.appContext.app,
|
|
1849
|
+
component.uid,
|
|
1850
|
+
component.parent ? component.parent.uid : void 0,
|
|
1851
|
+
component
|
|
1852
|
+
);
|
|
1853
|
+
};
|
|
1854
|
+
}
|
|
1855
|
+
let currentRenderingInstance = null;
|
|
1856
|
+
let currentScopeId = null;
|
|
1857
|
+
function setCurrentRenderingInstance(instance) {
|
|
1858
|
+
const prev = currentRenderingInstance;
|
|
1859
|
+
currentRenderingInstance = instance;
|
|
1860
|
+
currentScopeId = instance && instance.type.__scopeId || null;
|
|
1861
|
+
return prev;
|
|
1862
|
+
}
|
|
1863
|
+
function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
|
|
1864
|
+
if (!ctx) return fn;
|
|
1865
|
+
if (fn._n) {
|
|
1866
|
+
return fn;
|
|
1867
|
+
}
|
|
1868
|
+
const renderFnWithContext = (...args) => {
|
|
1869
|
+
if (renderFnWithContext._d) {
|
|
1870
|
+
setBlockTracking(-1);
|
|
1871
|
+
}
|
|
1872
|
+
const prevInstance = setCurrentRenderingInstance(ctx);
|
|
1873
|
+
let res;
|
|
1874
|
+
try {
|
|
1875
|
+
res = fn(...args);
|
|
1876
|
+
} finally {
|
|
1877
|
+
setCurrentRenderingInstance(prevInstance);
|
|
1878
|
+
if (renderFnWithContext._d) {
|
|
1879
|
+
setBlockTracking(1);
|
|
1880
|
+
}
|
|
1881
|
+
}
|
|
1882
|
+
if (!!(process.env.NODE_ENV !== "production") || false) {
|
|
1883
|
+
devtoolsComponentUpdated(ctx);
|
|
1884
|
+
}
|
|
1885
|
+
return res;
|
|
1886
|
+
};
|
|
1887
|
+
renderFnWithContext._n = true;
|
|
1888
|
+
renderFnWithContext._c = true;
|
|
1889
|
+
renderFnWithContext._d = true;
|
|
1890
|
+
return renderFnWithContext;
|
|
1891
|
+
}
|
|
1892
|
+
const isTeleport = (type) => type.__isTeleport;
|
|
1893
|
+
function setTransitionHooks(vnode, hooks) {
|
|
1894
|
+
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
1895
|
+
vnode.transition = hooks;
|
|
1896
|
+
setTransitionHooks(vnode.component.subTree, hooks);
|
|
1897
|
+
} else if (vnode.shapeFlag & 128) {
|
|
1898
|
+
vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
1899
|
+
vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
1900
|
+
} else {
|
|
1901
|
+
vnode.transition = hooks;
|
|
1902
|
+
}
|
|
1903
|
+
}
|
|
1904
|
+
// @__NO_SIDE_EFFECTS__
|
|
1905
|
+
function defineComponent(options, extraOptions) {
|
|
1906
|
+
return isFunction(options) ? (
|
|
1907
|
+
// #8236: extend call and options.name access are considered side-effects
|
|
1908
|
+
// by Rollup, so we have to wrap it in a pure-annotated IIFE.
|
|
1909
|
+
/* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()
|
|
1910
|
+
) : options;
|
|
1911
|
+
}
|
|
1912
|
+
const knownTemplateRefs = /* @__PURE__ */ new WeakSet();
|
|
1913
|
+
function useTemplateRef(key) {
|
|
1914
|
+
const i = getCurrentInstance();
|
|
1915
|
+
const r = shallowRef(null);
|
|
1916
|
+
if (i) {
|
|
1917
|
+
const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs;
|
|
1918
|
+
let desc;
|
|
1919
|
+
if (!!(process.env.NODE_ENV !== "production") && (desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable) {
|
|
1920
|
+
warn$1(`useTemplateRef('${key}') already exists.`);
|
|
1921
|
+
} else {
|
|
1922
|
+
Object.defineProperty(refs, key, {
|
|
1923
|
+
enumerable: true,
|
|
1924
|
+
get: () => r.value,
|
|
1925
|
+
set: (val) => r.value = val
|
|
1926
|
+
});
|
|
1927
|
+
}
|
|
1928
|
+
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
1929
|
+
warn$1(
|
|
1930
|
+
`useTemplateRef() is called when there is no active component instance to be associated with.`
|
|
1931
|
+
);
|
|
1932
|
+
}
|
|
1933
|
+
const ret = !!(process.env.NODE_ENV !== "production") ? readonly(r) : r;
|
|
1934
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1935
|
+
knownTemplateRefs.add(ret);
|
|
1936
|
+
}
|
|
1937
|
+
return ret;
|
|
1938
|
+
}
|
|
1939
|
+
getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
|
|
1940
|
+
getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
|
|
1941
|
+
const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
|
|
1942
|
+
const COMPONENTS = "components";
|
|
1943
|
+
function resolveComponent(name, maybeSelfReference) {
|
|
1944
|
+
return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
|
|
1945
|
+
}
|
|
1946
|
+
const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
|
|
1947
|
+
function resolveDynamicComponent(component) {
|
|
1948
|
+
if (isString(component)) {
|
|
1949
|
+
return resolveAsset(COMPONENTS, component, false) || component;
|
|
1950
|
+
} else {
|
|
1951
|
+
return component || NULL_DYNAMIC_COMPONENT;
|
|
1952
|
+
}
|
|
1953
|
+
}
|
|
1954
|
+
function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
|
|
1955
|
+
const instance = currentRenderingInstance || currentInstance;
|
|
1956
|
+
if (instance) {
|
|
1957
|
+
const Component = instance.type;
|
|
1958
|
+
{
|
|
1959
|
+
const selfName = getComponentName(
|
|
1960
|
+
Component,
|
|
1961
|
+
false
|
|
1962
|
+
);
|
|
1963
|
+
if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
|
|
1964
|
+
return Component;
|
|
1965
|
+
}
|
|
1966
|
+
}
|
|
1967
|
+
const res = (
|
|
1968
|
+
// local registration
|
|
1969
|
+
// check instance[type] first which is resolved for options API
|
|
1970
|
+
resolve(instance[type] || Component[type], name) || // global registration
|
|
1971
|
+
resolve(instance.appContext[type], name)
|
|
1972
|
+
);
|
|
1973
|
+
if (!res && maybeSelfReference) {
|
|
1974
|
+
return Component;
|
|
1975
|
+
}
|
|
1976
|
+
if (!!(process.env.NODE_ENV !== "production") && warnMissing && !res) {
|
|
1977
|
+
const extra = `
|
|
1978
|
+
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` ;
|
|
1979
|
+
warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
|
|
1980
|
+
}
|
|
1981
|
+
return res;
|
|
1982
|
+
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
1983
|
+
warn$1(
|
|
1984
|
+
`resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`
|
|
1985
|
+
);
|
|
1986
|
+
}
|
|
1987
|
+
}
|
|
1988
|
+
function resolve(registry, name) {
|
|
1989
|
+
return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
|
|
1990
|
+
}
|
|
1991
|
+
function renderList(source, renderItem, cache, index) {
|
|
1992
|
+
let ret;
|
|
1993
|
+
const cached = cache;
|
|
1994
|
+
const sourceIsArray = isArray(source);
|
|
1995
|
+
if (sourceIsArray || isString(source)) {
|
|
1996
|
+
const sourceIsReactiveArray = sourceIsArray && isReactive(source);
|
|
1997
|
+
let needsWrap = false;
|
|
1998
|
+
let isReadonlySource = false;
|
|
1999
|
+
if (sourceIsReactiveArray) {
|
|
2000
|
+
needsWrap = !isShallow(source);
|
|
2001
|
+
isReadonlySource = isReadonly(source);
|
|
2002
|
+
source = shallowReadArray(source);
|
|
2003
|
+
}
|
|
2004
|
+
ret = new Array(source.length);
|
|
2005
|
+
for (let i = 0, l = source.length; i < l; i++) {
|
|
2006
|
+
ret[i] = renderItem(
|
|
2007
|
+
needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i],
|
|
2008
|
+
i,
|
|
2009
|
+
void 0,
|
|
2010
|
+
cached
|
|
2011
|
+
);
|
|
2012
|
+
}
|
|
2013
|
+
} else if (typeof source === "number") {
|
|
2014
|
+
if (!!(process.env.NODE_ENV !== "production") && !Number.isInteger(source)) {
|
|
2015
|
+
warn$1(`The v-for range expect an integer value but got ${source}.`);
|
|
2016
|
+
}
|
|
2017
|
+
ret = new Array(source);
|
|
2018
|
+
for (let i = 0; i < source; i++) {
|
|
2019
|
+
ret[i] = renderItem(i + 1, i, void 0, cached);
|
|
2020
|
+
}
|
|
2021
|
+
} else if (isObject(source)) {
|
|
2022
|
+
if (source[Symbol.iterator]) {
|
|
2023
|
+
ret = Array.from(
|
|
2024
|
+
source,
|
|
2025
|
+
(item, i) => renderItem(item, i, void 0, cached)
|
|
2026
|
+
);
|
|
2027
|
+
} else {
|
|
2028
|
+
const keys = Object.keys(source);
|
|
2029
|
+
ret = new Array(keys.length);
|
|
2030
|
+
for (let i = 0, l = keys.length; i < l; i++) {
|
|
2031
|
+
const key = keys[i];
|
|
2032
|
+
ret[i] = renderItem(source[key], key, i, cached);
|
|
2033
|
+
}
|
|
2034
|
+
}
|
|
2035
|
+
} else {
|
|
2036
|
+
ret = [];
|
|
2037
|
+
}
|
|
2038
|
+
return ret;
|
|
2039
|
+
}
|
|
2040
|
+
function createSlots(slots, dynamicSlots) {
|
|
2041
|
+
for (let i = 0; i < dynamicSlots.length; i++) {
|
|
2042
|
+
const slot = dynamicSlots[i];
|
|
2043
|
+
if (isArray(slot)) {
|
|
2044
|
+
for (let j = 0; j < slot.length; j++) {
|
|
2045
|
+
slots[slot[j].name] = slot[j].fn;
|
|
2046
|
+
}
|
|
2047
|
+
} else if (slot) {
|
|
2048
|
+
slots[slot.name] = slot.key ? (...args) => {
|
|
2049
|
+
const res = slot.fn(...args);
|
|
2050
|
+
if (res) res.key = slot.key;
|
|
2051
|
+
return res;
|
|
2052
|
+
} : slot.fn;
|
|
2053
|
+
}
|
|
2054
|
+
}
|
|
2055
|
+
return slots;
|
|
2056
|
+
}
|
|
2057
|
+
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
2058
|
+
if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
|
|
2059
|
+
const hasProps = Object.keys(props).length > 0;
|
|
2060
|
+
if (name !== "default") props.name = name;
|
|
2061
|
+
return openBlock(), createBlock(
|
|
2062
|
+
Fragment,
|
|
2063
|
+
null,
|
|
2064
|
+
[createVNode("slot", props, fallback)],
|
|
2065
|
+
hasProps ? -2 : 64
|
|
2066
|
+
);
|
|
2067
|
+
}
|
|
2068
|
+
let slot = slots[name];
|
|
2069
|
+
if (!!(process.env.NODE_ENV !== "production") && slot && slot.length > 1) {
|
|
2070
|
+
warn$1(
|
|
2071
|
+
`SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.`
|
|
2072
|
+
);
|
|
2073
|
+
slot = () => [];
|
|
2074
|
+
}
|
|
2075
|
+
if (slot && slot._c) {
|
|
2076
|
+
slot._d = false;
|
|
2077
|
+
}
|
|
2078
|
+
openBlock();
|
|
2079
|
+
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
2080
|
+
const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
|
|
2081
|
+
// key attached in the `createSlots` helper, respect that
|
|
2082
|
+
validSlotContent && validSlotContent.key;
|
|
2083
|
+
const rendered = createBlock(
|
|
2084
|
+
Fragment,
|
|
2085
|
+
{
|
|
2086
|
+
key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
|
|
2087
|
+
("")
|
|
2088
|
+
},
|
|
2089
|
+
validSlotContent || ([]),
|
|
2090
|
+
validSlotContent && slots._ === 1 ? 64 : -2
|
|
2091
|
+
);
|
|
2092
|
+
if (rendered.scopeId) {
|
|
2093
|
+
rendered.slotScopeIds = [rendered.scopeId + "-s"];
|
|
2094
|
+
}
|
|
2095
|
+
if (slot && slot._c) {
|
|
2096
|
+
slot._d = true;
|
|
2097
|
+
}
|
|
2098
|
+
return rendered;
|
|
2099
|
+
}
|
|
2100
|
+
function ensureValidVNode(vnodes) {
|
|
2101
|
+
return vnodes.some((child) => {
|
|
2102
|
+
if (!isVNode(child)) return true;
|
|
2103
|
+
if (child.type === Comment) return false;
|
|
2104
|
+
if (child.type === Fragment && !ensureValidVNode(child.children))
|
|
2105
|
+
return false;
|
|
2106
|
+
return true;
|
|
2107
|
+
}) ? vnodes : null;
|
|
2108
|
+
}
|
|
2109
|
+
const PublicInstanceProxyHandlers = {
|
|
2110
|
+
};
|
|
2111
|
+
if (!!(process.env.NODE_ENV !== "production") && true) {
|
|
2112
|
+
PublicInstanceProxyHandlers.ownKeys = (target) => {
|
|
2113
|
+
warn$1(
|
|
2114
|
+
`Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`
|
|
2115
|
+
);
|
|
2116
|
+
return Reflect.ownKeys(target);
|
|
2117
|
+
};
|
|
2118
|
+
}
|
|
2119
|
+
const internalObjectProto = {};
|
|
2120
|
+
const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
|
|
2121
|
+
const isSuspense = (type) => type.__isSuspense;
|
|
2122
|
+
const Fragment = Symbol.for("v-fgt");
|
|
2123
|
+
const Text = Symbol.for("v-txt");
|
|
2124
|
+
const Comment = Symbol.for("v-cmt");
|
|
2125
|
+
const blockStack = [];
|
|
2126
|
+
let currentBlock = null;
|
|
2127
|
+
function openBlock(disableTracking = false) {
|
|
2128
|
+
blockStack.push(currentBlock = disableTracking ? null : []);
|
|
2129
|
+
}
|
|
2130
|
+
function closeBlock() {
|
|
2131
|
+
blockStack.pop();
|
|
2132
|
+
currentBlock = blockStack[blockStack.length - 1] || null;
|
|
2133
|
+
}
|
|
2134
|
+
let isBlockTreeEnabled = 1;
|
|
2135
|
+
function setBlockTracking(value, inVOnce = false) {
|
|
2136
|
+
isBlockTreeEnabled += value;
|
|
2137
|
+
if (value < 0 && currentBlock && inVOnce) {
|
|
2138
|
+
currentBlock.hasOnce = true;
|
|
2139
|
+
}
|
|
2140
|
+
}
|
|
2141
|
+
function setupBlock(vnode) {
|
|
2142
|
+
vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null;
|
|
2143
|
+
closeBlock();
|
|
2144
|
+
if (isBlockTreeEnabled > 0 && currentBlock) {
|
|
2145
|
+
currentBlock.push(vnode);
|
|
2146
|
+
}
|
|
2147
|
+
return vnode;
|
|
2148
|
+
}
|
|
2149
|
+
function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {
|
|
2150
|
+
return setupBlock(
|
|
2151
|
+
createBaseVNode(
|
|
2152
|
+
type,
|
|
2153
|
+
props,
|
|
2154
|
+
children,
|
|
2155
|
+
patchFlag,
|
|
2156
|
+
dynamicProps,
|
|
2157
|
+
shapeFlag,
|
|
2158
|
+
true
|
|
2159
|
+
)
|
|
2160
|
+
);
|
|
2161
|
+
}
|
|
2162
|
+
function createBlock(type, props, children, patchFlag, dynamicProps) {
|
|
2163
|
+
return setupBlock(
|
|
2164
|
+
createVNode(
|
|
2165
|
+
type,
|
|
2166
|
+
props,
|
|
2167
|
+
children,
|
|
2168
|
+
patchFlag,
|
|
2169
|
+
dynamicProps,
|
|
2170
|
+
true
|
|
2171
|
+
)
|
|
2172
|
+
);
|
|
2173
|
+
}
|
|
2174
|
+
function isVNode(value) {
|
|
2175
|
+
return value ? value.__v_isVNode === true : false;
|
|
2176
|
+
}
|
|
2177
|
+
const createVNodeWithArgsTransform = (...args) => {
|
|
2178
|
+
return _createVNode(
|
|
2179
|
+
...args
|
|
2180
|
+
);
|
|
2181
|
+
};
|
|
2182
|
+
const normalizeKey = ({ key }) => key != null ? key : null;
|
|
2183
|
+
const normalizeRef = ({
|
|
2184
|
+
ref: ref3,
|
|
2185
|
+
ref_key,
|
|
2186
|
+
ref_for
|
|
2187
|
+
}) => {
|
|
2188
|
+
if (typeof ref3 === "number") {
|
|
2189
|
+
ref3 = "" + ref3;
|
|
2190
|
+
}
|
|
2191
|
+
return ref3 != null ? isString(ref3) || isRef(ref3) || isFunction(ref3) ? { i: currentRenderingInstance, r: ref3, k: ref_key, f: !!ref_for } : ref3 : null;
|
|
2192
|
+
};
|
|
2193
|
+
function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
|
|
2194
|
+
const vnode = {
|
|
2195
|
+
__v_isVNode: true,
|
|
2196
|
+
__v_skip: true,
|
|
2197
|
+
type,
|
|
2198
|
+
props,
|
|
2199
|
+
key: props && normalizeKey(props),
|
|
2200
|
+
ref: props && normalizeRef(props),
|
|
2201
|
+
scopeId: currentScopeId,
|
|
2202
|
+
slotScopeIds: null,
|
|
2203
|
+
children,
|
|
2204
|
+
component: null,
|
|
2205
|
+
suspense: null,
|
|
2206
|
+
ssContent: null,
|
|
2207
|
+
ssFallback: null,
|
|
2208
|
+
dirs: null,
|
|
2209
|
+
transition: null,
|
|
2210
|
+
el: null,
|
|
2211
|
+
anchor: null,
|
|
2212
|
+
target: null,
|
|
2213
|
+
targetStart: null,
|
|
2214
|
+
targetAnchor: null,
|
|
2215
|
+
staticCount: 0,
|
|
2216
|
+
shapeFlag,
|
|
2217
|
+
patchFlag,
|
|
2218
|
+
dynamicProps,
|
|
2219
|
+
dynamicChildren: null,
|
|
2220
|
+
appContext: null,
|
|
2221
|
+
ctx: currentRenderingInstance
|
|
2222
|
+
};
|
|
2223
|
+
if (needFullChildrenNormalization) {
|
|
2224
|
+
normalizeChildren(vnode, children);
|
|
2225
|
+
if (shapeFlag & 128) {
|
|
2226
|
+
type.normalize(vnode);
|
|
2227
|
+
}
|
|
2228
|
+
} else if (children) {
|
|
2229
|
+
vnode.shapeFlag |= isString(children) ? 8 : 16;
|
|
2230
|
+
}
|
|
2231
|
+
if (!!(process.env.NODE_ENV !== "production") && vnode.key !== vnode.key) {
|
|
2232
|
+
warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
|
|
2233
|
+
}
|
|
2234
|
+
if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
|
|
2235
|
+
!isBlockNode && // has current parent block
|
|
2236
|
+
currentBlock && // presence of a patch flag indicates this node needs patching on updates.
|
|
2237
|
+
// component nodes also should always be patched, because even if the
|
|
2238
|
+
// component doesn't need to update, it needs to persist the instance on to
|
|
2239
|
+
// the next vnode so that it can be properly unmounted later.
|
|
2240
|
+
(vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
|
|
2241
|
+
// vnode should not be considered dynamic due to handler caching.
|
|
2242
|
+
vnode.patchFlag !== 32) {
|
|
2243
|
+
currentBlock.push(vnode);
|
|
2244
|
+
}
|
|
2245
|
+
return vnode;
|
|
2246
|
+
}
|
|
2247
|
+
const createVNode = !!(process.env.NODE_ENV !== "production") ? createVNodeWithArgsTransform : _createVNode;
|
|
2248
|
+
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
|
|
2249
|
+
if (!type || type === NULL_DYNAMIC_COMPONENT) {
|
|
2250
|
+
if (!!(process.env.NODE_ENV !== "production") && !type) {
|
|
2251
|
+
warn$1(`Invalid vnode type when creating vnode: ${type}.`);
|
|
2252
|
+
}
|
|
2253
|
+
type = Comment;
|
|
2254
|
+
}
|
|
2255
|
+
if (isVNode(type)) {
|
|
2256
|
+
const cloned = cloneVNode(
|
|
2257
|
+
type,
|
|
2258
|
+
props,
|
|
2259
|
+
true
|
|
2260
|
+
/* mergeRef: true */
|
|
2261
|
+
);
|
|
2262
|
+
if (children) {
|
|
2263
|
+
normalizeChildren(cloned, children);
|
|
2264
|
+
}
|
|
2265
|
+
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
|
|
2266
|
+
if (cloned.shapeFlag & 6) {
|
|
2267
|
+
currentBlock[currentBlock.indexOf(type)] = cloned;
|
|
2268
|
+
} else {
|
|
2269
|
+
currentBlock.push(cloned);
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2272
|
+
cloned.patchFlag = -2;
|
|
2273
|
+
return cloned;
|
|
2274
|
+
}
|
|
2275
|
+
if (isClassComponent(type)) {
|
|
2276
|
+
type = type.__vccOpts;
|
|
2277
|
+
}
|
|
2278
|
+
if (props) {
|
|
2279
|
+
props = guardReactiveProps(props);
|
|
2280
|
+
let { class: klass, style } = props;
|
|
2281
|
+
if (klass && !isString(klass)) {
|
|
2282
|
+
props.class = normalizeClass(klass);
|
|
2283
|
+
}
|
|
2284
|
+
if (isObject(style)) {
|
|
2285
|
+
if (isProxy(style) && !isArray(style)) {
|
|
2286
|
+
style = extend({}, style);
|
|
2287
|
+
}
|
|
2288
|
+
props.style = normalizeStyle(style);
|
|
2289
|
+
}
|
|
2290
|
+
}
|
|
2291
|
+
const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0;
|
|
2292
|
+
if (!!(process.env.NODE_ENV !== "production") && shapeFlag & 4 && isProxy(type)) {
|
|
2293
|
+
type = toRaw(type);
|
|
2294
|
+
warn$1(
|
|
2295
|
+
`Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`,
|
|
2296
|
+
`
|
|
2297
|
+
Component that was made reactive: `,
|
|
2298
|
+
type
|
|
2299
|
+
);
|
|
2300
|
+
}
|
|
2301
|
+
return createBaseVNode(
|
|
2302
|
+
type,
|
|
2303
|
+
props,
|
|
2304
|
+
children,
|
|
2305
|
+
patchFlag,
|
|
2306
|
+
dynamicProps,
|
|
2307
|
+
shapeFlag,
|
|
2308
|
+
isBlockNode,
|
|
2309
|
+
true
|
|
2310
|
+
);
|
|
2311
|
+
}
|
|
2312
|
+
function guardReactiveProps(props) {
|
|
2313
|
+
if (!props) return null;
|
|
2314
|
+
return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
|
|
2315
|
+
}
|
|
2316
|
+
function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
|
|
2317
|
+
const { props, ref: ref3, patchFlag, children, transition } = vnode;
|
|
2318
|
+
const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
|
|
2319
|
+
const cloned = {
|
|
2320
|
+
__v_isVNode: true,
|
|
2321
|
+
__v_skip: true,
|
|
2322
|
+
type: vnode.type,
|
|
2323
|
+
props: mergedProps,
|
|
2324
|
+
key: mergedProps && normalizeKey(mergedProps),
|
|
2325
|
+
ref: extraProps && extraProps.ref ? (
|
|
2326
|
+
// #2078 in the case of <component :is="vnode" ref="extra"/>
|
|
2327
|
+
// if the vnode itself already has a ref, cloneVNode will need to merge
|
|
2328
|
+
// the refs so the single vnode can be set on multiple refs
|
|
2329
|
+
mergeRef && ref3 ? isArray(ref3) ? ref3.concat(normalizeRef(extraProps)) : [ref3, normalizeRef(extraProps)] : normalizeRef(extraProps)
|
|
2330
|
+
) : ref3,
|
|
2331
|
+
scopeId: vnode.scopeId,
|
|
2332
|
+
slotScopeIds: vnode.slotScopeIds,
|
|
2333
|
+
children: !!(process.env.NODE_ENV !== "production") && patchFlag === -1 && isArray(children) ? children.map(deepCloneVNode) : children,
|
|
2334
|
+
target: vnode.target,
|
|
2335
|
+
targetStart: vnode.targetStart,
|
|
2336
|
+
targetAnchor: vnode.targetAnchor,
|
|
2337
|
+
staticCount: vnode.staticCount,
|
|
2338
|
+
shapeFlag: vnode.shapeFlag,
|
|
2339
|
+
// if the vnode is cloned with extra props, we can no longer assume its
|
|
2340
|
+
// existing patch flag to be reliable and need to add the FULL_PROPS flag.
|
|
2341
|
+
// note: preserve flag for fragments since they use the flag for children
|
|
2342
|
+
// fast paths only.
|
|
2343
|
+
patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,
|
|
2344
|
+
dynamicProps: vnode.dynamicProps,
|
|
2345
|
+
dynamicChildren: vnode.dynamicChildren,
|
|
2346
|
+
appContext: vnode.appContext,
|
|
2347
|
+
dirs: vnode.dirs,
|
|
2348
|
+
transition,
|
|
2349
|
+
// These should technically only be non-null on mounted VNodes. However,
|
|
2350
|
+
// they *should* be copied for kept-alive vnodes. So we just always copy
|
|
2351
|
+
// them since them being non-null during a mount doesn't affect the logic as
|
|
2352
|
+
// they will simply be overwritten.
|
|
2353
|
+
component: vnode.component,
|
|
2354
|
+
suspense: vnode.suspense,
|
|
2355
|
+
ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
|
|
2356
|
+
ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
|
|
2357
|
+
placeholder: vnode.placeholder,
|
|
2358
|
+
el: vnode.el,
|
|
2359
|
+
anchor: vnode.anchor,
|
|
2360
|
+
ctx: vnode.ctx,
|
|
2361
|
+
ce: vnode.ce
|
|
2362
|
+
};
|
|
2363
|
+
if (transition && cloneTransition) {
|
|
2364
|
+
setTransitionHooks(
|
|
2365
|
+
cloned,
|
|
2366
|
+
transition.clone(cloned)
|
|
2367
|
+
);
|
|
2368
|
+
}
|
|
2369
|
+
return cloned;
|
|
2370
|
+
}
|
|
2371
|
+
function deepCloneVNode(vnode) {
|
|
2372
|
+
const cloned = cloneVNode(vnode);
|
|
2373
|
+
if (isArray(vnode.children)) {
|
|
2374
|
+
cloned.children = vnode.children.map(deepCloneVNode);
|
|
2375
|
+
}
|
|
2376
|
+
return cloned;
|
|
2377
|
+
}
|
|
2378
|
+
function createTextVNode(text = " ", flag = 0) {
|
|
2379
|
+
return createVNode(Text, null, text, flag);
|
|
2380
|
+
}
|
|
2381
|
+
function createCommentVNode(text = "", asBlock = false) {
|
|
2382
|
+
return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text);
|
|
2383
|
+
}
|
|
2384
|
+
function normalizeChildren(vnode, children) {
|
|
2385
|
+
let type = 0;
|
|
2386
|
+
const { shapeFlag } = vnode;
|
|
2387
|
+
if (children == null) {
|
|
2388
|
+
children = null;
|
|
2389
|
+
} else if (isArray(children)) {
|
|
2390
|
+
type = 16;
|
|
2391
|
+
} else if (typeof children === "object") {
|
|
2392
|
+
if (shapeFlag & (1 | 64)) {
|
|
2393
|
+
const slot = children.default;
|
|
2394
|
+
if (slot) {
|
|
2395
|
+
slot._c && (slot._d = false);
|
|
2396
|
+
normalizeChildren(vnode, slot());
|
|
2397
|
+
slot._c && (slot._d = true);
|
|
2398
|
+
}
|
|
2399
|
+
return;
|
|
2400
|
+
} else {
|
|
2401
|
+
type = 32;
|
|
2402
|
+
const slotFlag = children._;
|
|
2403
|
+
if (!slotFlag && !isInternalObject(children)) {
|
|
2404
|
+
children._ctx = currentRenderingInstance;
|
|
2405
|
+
} else if (slotFlag === 3 && currentRenderingInstance) {
|
|
2406
|
+
if (currentRenderingInstance.slots._ === 1) {
|
|
2407
|
+
children._ = 1;
|
|
2408
|
+
} else {
|
|
2409
|
+
children._ = 2;
|
|
2410
|
+
vnode.patchFlag |= 1024;
|
|
2411
|
+
}
|
|
2412
|
+
}
|
|
2413
|
+
}
|
|
2414
|
+
} else if (isFunction(children)) {
|
|
2415
|
+
children = { default: children, _ctx: currentRenderingInstance };
|
|
2416
|
+
type = 32;
|
|
2417
|
+
} else {
|
|
2418
|
+
children = String(children);
|
|
2419
|
+
if (shapeFlag & 64) {
|
|
2420
|
+
type = 16;
|
|
2421
|
+
children = [createTextVNode(children)];
|
|
2422
|
+
} else {
|
|
2423
|
+
type = 8;
|
|
2424
|
+
}
|
|
2425
|
+
}
|
|
2426
|
+
vnode.children = children;
|
|
2427
|
+
vnode.shapeFlag |= type;
|
|
2428
|
+
}
|
|
2429
|
+
function mergeProps(...args) {
|
|
2430
|
+
const ret = {};
|
|
2431
|
+
for (let i = 0; i < args.length; i++) {
|
|
2432
|
+
const toMerge = args[i];
|
|
2433
|
+
for (const key in toMerge) {
|
|
2434
|
+
if (key === "class") {
|
|
2435
|
+
if (ret.class !== toMerge.class) {
|
|
2436
|
+
ret.class = normalizeClass([ret.class, toMerge.class]);
|
|
2437
|
+
}
|
|
2438
|
+
} else if (key === "style") {
|
|
2439
|
+
ret.style = normalizeStyle([ret.style, toMerge.style]);
|
|
2440
|
+
} else if (isOn(key)) {
|
|
2441
|
+
const existing = ret[key];
|
|
2442
|
+
const incoming = toMerge[key];
|
|
2443
|
+
if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
|
|
2444
|
+
ret[key] = existing ? [].concat(existing, incoming) : incoming;
|
|
2445
|
+
}
|
|
2446
|
+
} else if (key !== "") {
|
|
2447
|
+
ret[key] = toMerge[key];
|
|
2448
|
+
}
|
|
2449
|
+
}
|
|
2450
|
+
}
|
|
2451
|
+
return ret;
|
|
2452
|
+
}
|
|
2453
|
+
let currentInstance = null;
|
|
2454
|
+
const getCurrentInstance = () => currentInstance || currentRenderingInstance;
|
|
2455
|
+
{
|
|
2456
|
+
const g = getGlobalThis();
|
|
2457
|
+
const registerGlobalSetter = (key, setter) => {
|
|
2458
|
+
let setters;
|
|
2459
|
+
if (!(setters = g[key])) setters = g[key] = [];
|
|
2460
|
+
setters.push(setter);
|
|
2461
|
+
return (v) => {
|
|
2462
|
+
if (setters.length > 1) setters.forEach((set) => set(v));
|
|
2463
|
+
else setters[0](v);
|
|
2464
|
+
};
|
|
2465
|
+
};
|
|
2466
|
+
registerGlobalSetter(
|
|
2467
|
+
`__VUE_INSTANCE_SETTERS__`,
|
|
2468
|
+
(v) => currentInstance = v
|
|
2469
|
+
);
|
|
2470
|
+
registerGlobalSetter(
|
|
2471
|
+
`__VUE_SSR_SETTERS__`,
|
|
2472
|
+
(v) => isInSSRComponentSetup = v
|
|
2473
|
+
);
|
|
2474
|
+
}
|
|
2475
|
+
let isInSSRComponentSetup = false;
|
|
2476
|
+
!!(process.env.NODE_ENV !== "production") ? {
|
|
2477
|
+
} : {
|
|
2478
|
+
};
|
|
2479
|
+
const classifyRE = /(?:^|[-_])\w/g;
|
|
2480
|
+
const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
|
|
2481
|
+
function getComponentName(Component, includeInferred = true) {
|
|
2482
|
+
return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
|
|
2483
|
+
}
|
|
2484
|
+
function formatComponentName(instance, Component, isRoot = false) {
|
|
2485
|
+
let name = getComponentName(Component);
|
|
2486
|
+
if (!name && Component.__file) {
|
|
2487
|
+
const match = Component.__file.match(/([^/\\]+)\.\w+$/);
|
|
2488
|
+
if (match) {
|
|
2489
|
+
name = match[1];
|
|
2490
|
+
}
|
|
2491
|
+
}
|
|
2492
|
+
if (!name && instance && instance.parent) {
|
|
2493
|
+
const inferFromRegistry = (registry) => {
|
|
2494
|
+
for (const key in registry) {
|
|
2495
|
+
if (registry[key] === Component) {
|
|
2496
|
+
return key;
|
|
2497
|
+
}
|
|
2498
|
+
}
|
|
2499
|
+
};
|
|
2500
|
+
name = inferFromRegistry(
|
|
2501
|
+
instance.components || instance.parent.type.components
|
|
2502
|
+
) || inferFromRegistry(instance.appContext.components);
|
|
2503
|
+
}
|
|
2504
|
+
return name ? classify(name) : isRoot ? `App` : `Anonymous`;
|
|
2505
|
+
}
|
|
2506
|
+
function isClassComponent(value) {
|
|
2507
|
+
return isFunction(value) && "__vccOpts" in value;
|
|
2508
|
+
}
|
|
2509
|
+
const computed = (getterOrOptions, debugOptions) => {
|
|
2510
|
+
const c = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
2511
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
2512
|
+
const i = getCurrentInstance();
|
|
2513
|
+
if (i && i.appContext.config.warnRecursiveComputed) {
|
|
2514
|
+
c._warnRecursive = true;
|
|
2515
|
+
}
|
|
2516
|
+
}
|
|
2517
|
+
return c;
|
|
2518
|
+
};
|
|
2519
|
+
function initCustomFormatter() {
|
|
2520
|
+
if (!!!(process.env.NODE_ENV !== "production") || typeof window === "undefined") {
|
|
2521
|
+
return;
|
|
2522
|
+
}
|
|
2523
|
+
const vueStyle = { style: "color:#3ba776" };
|
|
2524
|
+
const numberStyle = { style: "color:#1677ff" };
|
|
2525
|
+
const stringStyle = { style: "color:#f5222d" };
|
|
2526
|
+
const keywordStyle = { style: "color:#eb2f96" };
|
|
2527
|
+
const formatter = {
|
|
2528
|
+
__vue_custom_formatter: true,
|
|
2529
|
+
header(obj) {
|
|
2530
|
+
if (!isObject(obj)) {
|
|
2531
|
+
return null;
|
|
2532
|
+
}
|
|
2533
|
+
if (obj.__isVue) {
|
|
2534
|
+
return ["div", vueStyle, `VueInstance`];
|
|
2535
|
+
} else if (isRef(obj)) {
|
|
2536
|
+
pauseTracking();
|
|
2537
|
+
const value = obj.value;
|
|
2538
|
+
resetTracking();
|
|
2539
|
+
return [
|
|
2540
|
+
"div",
|
|
2541
|
+
{},
|
|
2542
|
+
["span", vueStyle, genRefFlag(obj)],
|
|
2543
|
+
"<",
|
|
2544
|
+
formatValue(value),
|
|
2545
|
+
`>`
|
|
2546
|
+
];
|
|
2547
|
+
} else if (isReactive(obj)) {
|
|
2548
|
+
return [
|
|
2549
|
+
"div",
|
|
2550
|
+
{},
|
|
2551
|
+
["span", vueStyle, isShallow(obj) ? "ShallowReactive" : "Reactive"],
|
|
2552
|
+
"<",
|
|
2553
|
+
formatValue(obj),
|
|
2554
|
+
`>${isReadonly(obj) ? ` (readonly)` : ``}`
|
|
2555
|
+
];
|
|
2556
|
+
} else if (isReadonly(obj)) {
|
|
2557
|
+
return [
|
|
2558
|
+
"div",
|
|
2559
|
+
{},
|
|
2560
|
+
["span", vueStyle, isShallow(obj) ? "ShallowReadonly" : "Readonly"],
|
|
2561
|
+
"<",
|
|
2562
|
+
formatValue(obj),
|
|
2563
|
+
">"
|
|
2564
|
+
];
|
|
2565
|
+
}
|
|
2566
|
+
return null;
|
|
2567
|
+
},
|
|
2568
|
+
hasBody(obj) {
|
|
2569
|
+
return obj && obj.__isVue;
|
|
2570
|
+
},
|
|
2571
|
+
body(obj) {
|
|
2572
|
+
if (obj && obj.__isVue) {
|
|
2573
|
+
return [
|
|
2574
|
+
"div",
|
|
2575
|
+
{},
|
|
2576
|
+
...formatInstance(obj.$)
|
|
2577
|
+
];
|
|
2578
|
+
}
|
|
2579
|
+
}
|
|
2580
|
+
};
|
|
2581
|
+
function formatInstance(instance) {
|
|
2582
|
+
const blocks = [];
|
|
2583
|
+
if (instance.type.props && instance.props) {
|
|
2584
|
+
blocks.push(createInstanceBlock("props", toRaw(instance.props)));
|
|
2585
|
+
}
|
|
2586
|
+
if (instance.setupState !== EMPTY_OBJ) {
|
|
2587
|
+
blocks.push(createInstanceBlock("setup", instance.setupState));
|
|
2588
|
+
}
|
|
2589
|
+
if (instance.data !== EMPTY_OBJ) {
|
|
2590
|
+
blocks.push(createInstanceBlock("data", toRaw(instance.data)));
|
|
2591
|
+
}
|
|
2592
|
+
const computed2 = extractKeys(instance, "computed");
|
|
2593
|
+
if (computed2) {
|
|
2594
|
+
blocks.push(createInstanceBlock("computed", computed2));
|
|
2595
|
+
}
|
|
2596
|
+
const injected = extractKeys(instance, "inject");
|
|
2597
|
+
if (injected) {
|
|
2598
|
+
blocks.push(createInstanceBlock("injected", injected));
|
|
2599
|
+
}
|
|
2600
|
+
blocks.push([
|
|
2601
|
+
"div",
|
|
2602
|
+
{},
|
|
2603
|
+
[
|
|
2604
|
+
"span",
|
|
2605
|
+
{
|
|
2606
|
+
style: keywordStyle.style + ";opacity:0.66"
|
|
2607
|
+
},
|
|
2608
|
+
"$ (internal): "
|
|
2609
|
+
],
|
|
2610
|
+
["object", { object: instance }]
|
|
2611
|
+
]);
|
|
2612
|
+
return blocks;
|
|
2613
|
+
}
|
|
2614
|
+
function createInstanceBlock(type, target) {
|
|
2615
|
+
target = extend({}, target);
|
|
2616
|
+
if (!Object.keys(target).length) {
|
|
2617
|
+
return ["span", {}];
|
|
2618
|
+
}
|
|
2619
|
+
return [
|
|
2620
|
+
"div",
|
|
2621
|
+
{ style: "line-height:1.25em;margin-bottom:0.6em" },
|
|
2622
|
+
[
|
|
2623
|
+
"div",
|
|
2624
|
+
{
|
|
2625
|
+
style: "color:#476582"
|
|
2626
|
+
},
|
|
2627
|
+
type
|
|
2628
|
+
],
|
|
2629
|
+
[
|
|
2630
|
+
"div",
|
|
2631
|
+
{
|
|
2632
|
+
style: "padding-left:1.25em"
|
|
2633
|
+
},
|
|
2634
|
+
...Object.keys(target).map((key) => {
|
|
2635
|
+
return [
|
|
2636
|
+
"div",
|
|
2637
|
+
{},
|
|
2638
|
+
["span", keywordStyle, key + ": "],
|
|
2639
|
+
formatValue(target[key], false)
|
|
2640
|
+
];
|
|
2641
|
+
})
|
|
2642
|
+
]
|
|
2643
|
+
];
|
|
2644
|
+
}
|
|
2645
|
+
function formatValue(v, asRaw = true) {
|
|
2646
|
+
if (typeof v === "number") {
|
|
2647
|
+
return ["span", numberStyle, v];
|
|
2648
|
+
} else if (typeof v === "string") {
|
|
2649
|
+
return ["span", stringStyle, JSON.stringify(v)];
|
|
2650
|
+
} else if (typeof v === "boolean") {
|
|
2651
|
+
return ["span", keywordStyle, v];
|
|
2652
|
+
} else if (isObject(v)) {
|
|
2653
|
+
return ["object", { object: asRaw ? toRaw(v) : v }];
|
|
2654
|
+
} else {
|
|
2655
|
+
return ["span", stringStyle, String(v)];
|
|
2656
|
+
}
|
|
2657
|
+
}
|
|
2658
|
+
function extractKeys(instance, type) {
|
|
2659
|
+
const Comp = instance.type;
|
|
2660
|
+
if (isFunction(Comp)) {
|
|
2661
|
+
return;
|
|
2662
|
+
}
|
|
2663
|
+
const extracted = {};
|
|
2664
|
+
for (const key in instance.ctx) {
|
|
2665
|
+
if (isKeyOfType(Comp, key, type)) {
|
|
2666
|
+
extracted[key] = instance.ctx[key];
|
|
2667
|
+
}
|
|
2668
|
+
}
|
|
2669
|
+
return extracted;
|
|
2670
|
+
}
|
|
2671
|
+
function isKeyOfType(Comp, key, type) {
|
|
2672
|
+
const opts = Comp[type];
|
|
2673
|
+
if (isArray(opts) && opts.includes(key) || isObject(opts) && key in opts) {
|
|
2674
|
+
return true;
|
|
2675
|
+
}
|
|
2676
|
+
if (Comp.extends && isKeyOfType(Comp.extends, key, type)) {
|
|
2677
|
+
return true;
|
|
2678
|
+
}
|
|
2679
|
+
if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) {
|
|
2680
|
+
return true;
|
|
2681
|
+
}
|
|
2682
|
+
}
|
|
2683
|
+
function genRefFlag(v) {
|
|
2684
|
+
if (isShallow(v)) {
|
|
2685
|
+
return `ShallowRef`;
|
|
2686
|
+
}
|
|
2687
|
+
if (v.effect) {
|
|
2688
|
+
return `ComputedRef`;
|
|
2689
|
+
}
|
|
2690
|
+
return `Ref`;
|
|
2691
|
+
}
|
|
2692
|
+
if (window.devtoolsFormatters) {
|
|
2693
|
+
window.devtoolsFormatters.push(formatter);
|
|
2694
|
+
} else {
|
|
2695
|
+
window.devtoolsFormatters = [formatter];
|
|
2696
|
+
}
|
|
2697
|
+
}
|
|
2698
|
+
!!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
|
|
2699
|
+
!!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
|
|
2700
|
+
!!(process.env.NODE_ENV !== "production") || true ? setDevtoolsHook$1 : NOOP;
|
|
2701
|
+
|
|
2702
|
+
/**
|
|
2703
|
+
* vue v3.5.22
|
|
2704
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
2705
|
+
* @license MIT
|
|
2706
|
+
**/
|
|
2707
|
+
|
|
2708
|
+
function initDev() {
|
|
2709
|
+
{
|
|
2710
|
+
initCustomFormatter();
|
|
2711
|
+
}
|
|
2712
|
+
}
|
|
2713
|
+
|
|
2714
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
2715
|
+
initDev();
|
|
2716
|
+
}
|
|
2717
|
+
|
|
2718
|
+
const _hoisted_1 = ["innerHTML"];
|
|
2719
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
2720
|
+
...{
|
|
2721
|
+
name: "TElAdapterFormItem"
|
|
2722
|
+
},
|
|
2723
|
+
__name: "FormItem",
|
|
2724
|
+
props: {
|
|
2725
|
+
prop: {},
|
|
2726
|
+
labelWidth: {},
|
|
2727
|
+
rules: {},
|
|
2728
|
+
extra: {}
|
|
2729
|
+
},
|
|
2730
|
+
setup(__props) {
|
|
2731
|
+
const props = __props;
|
|
2732
|
+
const itemProps = computed(() => {
|
|
2733
|
+
const { extra, ...rest } = props;
|
|
2734
|
+
return rest;
|
|
2735
|
+
});
|
|
2736
|
+
return (_ctx, _cache) => {
|
|
2737
|
+
const _component_ElFormItem = resolveComponent("ElFormItem");
|
|
2738
|
+
return openBlock(), createBlock(
|
|
2739
|
+
_component_ElFormItem,
|
|
2740
|
+
normalizeProps(guardReactiveProps(itemProps.value)),
|
|
2741
|
+
{
|
|
2742
|
+
label: withCtx(() => [
|
|
2743
|
+
renderSlot(_ctx.$slots, "label")
|
|
2744
|
+
]),
|
|
2745
|
+
default: withCtx(() => [
|
|
2746
|
+
renderSlot(_ctx.$slots, "default"),
|
|
2747
|
+
__props.extra ? (openBlock(), createElementBlock("div", {
|
|
2748
|
+
key: 0,
|
|
2749
|
+
innerHTML: __props.extra,
|
|
2750
|
+
class: "m-form-tip"
|
|
2751
|
+
}, null, 8, _hoisted_1)) : createCommentVNode("v-if", true)
|
|
2752
|
+
]),
|
|
2753
|
+
_: 3
|
|
2754
|
+
/* FORWARDED */
|
|
2755
|
+
},
|
|
2756
|
+
16
|
|
2757
|
+
/* FULL_PROPS */
|
|
2758
|
+
);
|
|
2759
|
+
};
|
|
2760
|
+
}
|
|
2761
|
+
});
|
|
2762
|
+
|
|
2763
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
2764
|
+
...{
|
|
2765
|
+
name: "TElAdapterTable"
|
|
2766
|
+
},
|
|
2767
|
+
__name: "Table",
|
|
2768
|
+
props: {
|
|
2769
|
+
columns: {},
|
|
2770
|
+
data: {},
|
|
2771
|
+
border: { type: Boolean },
|
|
2772
|
+
maxHeight: {},
|
|
2773
|
+
defaultExpandAll: { type: Boolean },
|
|
2774
|
+
showHeader: { type: Boolean },
|
|
2775
|
+
rowKey: {},
|
|
2776
|
+
treeProps: {},
|
|
2777
|
+
emptyText: {},
|
|
2778
|
+
tooltipEffect: {},
|
|
2779
|
+
tooltipOptions: {},
|
|
2780
|
+
showOverflowTooltip: { type: Boolean },
|
|
2781
|
+
spanMethod: { type: Function }
|
|
2782
|
+
},
|
|
2783
|
+
emits: ["sort-change", "select", "select-all", "selection-change", "expand-change", "cell-click"],
|
|
2784
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
2785
|
+
const emit = __emit;
|
|
2786
|
+
const tableRef = useTemplateRef("table");
|
|
2787
|
+
const sortChange = (data) => {
|
|
2788
|
+
emit("sort-change", data);
|
|
2789
|
+
};
|
|
2790
|
+
const selectHandler = (...args) => {
|
|
2791
|
+
emit("select", ...args);
|
|
2792
|
+
};
|
|
2793
|
+
const selectAllHandler = (...args) => {
|
|
2794
|
+
emit("select-all", ...args);
|
|
2795
|
+
};
|
|
2796
|
+
const selectionChangeHandler = (...args) => {
|
|
2797
|
+
emit("selection-change", ...args);
|
|
2798
|
+
};
|
|
2799
|
+
const cellClickHandler = (...args) => {
|
|
2800
|
+
emit("cell-click", ...args);
|
|
2801
|
+
};
|
|
2802
|
+
const expandChange = (...args) => {
|
|
2803
|
+
emit("expand-change", ...args);
|
|
2804
|
+
};
|
|
2805
|
+
const toggleRowSelection = (row, selected) => {
|
|
2806
|
+
tableRef.value?.toggleRowSelection(row, selected);
|
|
2807
|
+
};
|
|
2808
|
+
const toggleRowExpansion = (row, expanded) => {
|
|
2809
|
+
tableRef.value?.toggleRowExpansion(row, expanded);
|
|
2810
|
+
};
|
|
2811
|
+
const clearSelection = () => {
|
|
2812
|
+
tableRef.value?.clearSelection();
|
|
2813
|
+
};
|
|
2814
|
+
__expose({
|
|
2815
|
+
getEl: () => tableRef.value?.$el,
|
|
2816
|
+
getTableRef: () => tableRef.value,
|
|
2817
|
+
clearSelection,
|
|
2818
|
+
toggleRowSelection,
|
|
2819
|
+
toggleRowExpansion
|
|
2820
|
+
});
|
|
2821
|
+
return (_ctx, _cache) => {
|
|
2822
|
+
return openBlock(), createBlock(unref(ElTable), {
|
|
2823
|
+
ref: "table",
|
|
2824
|
+
data: __props.data,
|
|
2825
|
+
border: __props.border,
|
|
2826
|
+
"max-height": __props.maxHeight,
|
|
2827
|
+
"default-expand-all": __props.defaultExpandAll,
|
|
2828
|
+
"show-header": __props.showHeader,
|
|
2829
|
+
"row-key": __props.rowKey,
|
|
2830
|
+
"tree-props": __props.treeProps,
|
|
2831
|
+
"empty-text": __props.emptyText,
|
|
2832
|
+
"show-overflow-tooltip": __props.showOverflowTooltip,
|
|
2833
|
+
"tooltip-effect": __props.tooltipEffect,
|
|
2834
|
+
"tooltip-options": __props.tooltipOptions,
|
|
2835
|
+
"span-method": __props.spanMethod,
|
|
2836
|
+
onSortChange: sortChange,
|
|
2837
|
+
onSelect: selectHandler,
|
|
2838
|
+
onSelectAll: selectAllHandler,
|
|
2839
|
+
onSelectionChange: selectionChangeHandler,
|
|
2840
|
+
onCellClick: cellClickHandler,
|
|
2841
|
+
onExpandChange: expandChange
|
|
2842
|
+
}, {
|
|
2843
|
+
default: withCtx(() => [
|
|
2844
|
+
(openBlock(true), createElementBlock(
|
|
2845
|
+
Fragment,
|
|
2846
|
+
null,
|
|
2847
|
+
renderList(__props.columns, (item, columnIndex) => {
|
|
2848
|
+
return openBlock(), createBlock(
|
|
2849
|
+
unref(ElTableColumn),
|
|
2850
|
+
mergeProps({
|
|
2851
|
+
key: columnIndex,
|
|
2852
|
+
ref_for: true
|
|
2853
|
+
}, item.props || {}),
|
|
2854
|
+
createSlots({
|
|
2855
|
+
_: 2
|
|
2856
|
+
/* DYNAMIC */
|
|
2857
|
+
}, [
|
|
2858
|
+
item.cell ? {
|
|
2859
|
+
name: "default",
|
|
2860
|
+
fn: withCtx((scope) => [
|
|
2861
|
+
(openBlock(), createBlock(resolveDynamicComponent(item.cell(scope))))
|
|
2862
|
+
]),
|
|
2863
|
+
key: "0"
|
|
2864
|
+
} : void 0
|
|
2865
|
+
]),
|
|
2866
|
+
1040
|
|
2867
|
+
/* FULL_PROPS, DYNAMIC_SLOTS */
|
|
2868
|
+
);
|
|
2869
|
+
}),
|
|
2870
|
+
128
|
|
2871
|
+
/* KEYED_FRAGMENT */
|
|
2872
|
+
))
|
|
2873
|
+
]),
|
|
2874
|
+
_: 1
|
|
2875
|
+
/* STABLE */
|
|
2876
|
+
}, 8, ["data", "border", "max-height", "default-expand-all", "show-header", "row-key", "tree-props", "empty-text", "show-overflow-tooltip", "tooltip-effect", "tooltip-options", "span-method"]);
|
|
2877
|
+
};
|
|
2878
|
+
}
|
|
2879
|
+
});
|
|
2
2880
|
|
|
3
2881
|
const adapter = {
|
|
4
2882
|
useZIndex,
|
|
@@ -82,7 +2960,7 @@ const adapter = {
|
|
|
82
2960
|
props: (props) => props
|
|
83
2961
|
},
|
|
84
2962
|
formItem: {
|
|
85
|
-
component:
|
|
2963
|
+
component: _sfc_main$1,
|
|
86
2964
|
props: (props) => props
|
|
87
2965
|
},
|
|
88
2966
|
icon: {
|
|
@@ -146,11 +3024,7 @@ const adapter = {
|
|
|
146
3024
|
props: (props) => props
|
|
147
3025
|
},
|
|
148
3026
|
table: {
|
|
149
|
-
component:
|
|
150
|
-
props: (props) => props
|
|
151
|
-
},
|
|
152
|
-
tableColumn: {
|
|
153
|
-
component: ElTableColumn,
|
|
3027
|
+
component: _sfc_main,
|
|
154
3028
|
props: (props) => props
|
|
155
3029
|
},
|
|
156
3030
|
tabPane: {
|
|
@@ -173,13 +3047,13 @@ const adapter = {
|
|
|
173
3047
|
component: ElTooltip,
|
|
174
3048
|
props: (props) => props
|
|
175
3049
|
},
|
|
176
|
-
tree: {
|
|
177
|
-
component: ElTree,
|
|
178
|
-
props: (props) => props
|
|
179
|
-
},
|
|
180
3050
|
upload: {
|
|
181
3051
|
component: ElUpload,
|
|
182
3052
|
props: (props) => props
|
|
3053
|
+
},
|
|
3054
|
+
popconfirm: {
|
|
3055
|
+
component: ElPopconfirm,
|
|
3056
|
+
props: (props) => props
|
|
183
3057
|
}
|
|
184
3058
|
},
|
|
185
3059
|
loading: ElLoading.directive
|