@visactor/vue-vtable 1.7.5-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +93 -0
- package/cjs/components/component/menu.d.ts +9 -0
- package/cjs/components/component/menu.js +9 -0
- package/cjs/components/component/menu.js.map +1 -0
- package/cjs/components/component/tooltip.d.ts +7 -0
- package/cjs/components/component/tooltip.js +10 -0
- package/cjs/components/component/tooltip.js.map +1 -0
- package/cjs/components/custom/checkBox.d.ts +16 -0
- package/cjs/components/custom/checkBox.js +10 -0
- package/cjs/components/custom/checkBox.js.map +1 -0
- package/cjs/components/custom/custom-layout.d.ts +16 -0
- package/cjs/components/custom/custom-layout.js +10 -0
- package/cjs/components/custom/custom-layout.js.map +1 -0
- package/cjs/components/custom/group.d.ts +2 -0
- package/cjs/components/custom/group.js +10 -0
- package/cjs/components/custom/group.js.map +1 -0
- package/cjs/components/custom/image.d.ts +2 -0
- package/cjs/components/custom/image.js +10 -0
- package/cjs/components/custom/image.js.map +1 -0
- package/cjs/components/custom/radio.d.ts +13 -0
- package/cjs/components/custom/radio.js +10 -0
- package/cjs/components/custom/radio.js.map +1 -0
- package/cjs/components/custom/tag.d.ts +12 -0
- package/cjs/components/custom/tag.js +10 -0
- package/cjs/components/custom/tag.js.map +1 -0
- package/cjs/components/custom/text.d.ts +2 -0
- package/cjs/components/custom/text.js +10 -0
- package/cjs/components/custom/text.js.map +1 -0
- package/cjs/components/index.d.ts +15 -0
- package/cjs/components/index.js +147 -0
- package/cjs/components/index.js.map +1 -0
- package/cjs/components/list/list-column.d.ts +3 -0
- package/cjs/components/list/list-column.js +10 -0
- package/cjs/components/list/list-column.js.map +1 -0
- package/cjs/components/pivot/pivot-column-dimension.d.ts +8 -0
- package/cjs/components/pivot/pivot-column-dimension.js +10 -0
- package/cjs/components/pivot/pivot-column-dimension.js.map +1 -0
- package/cjs/components/pivot/pivot-column-header-title.d.ts +3 -0
- package/cjs/components/pivot/pivot-column-header-title.js +10 -0
- package/cjs/components/pivot/pivot-column-header-title.js.map +1 -0
- package/cjs/components/pivot/pivot-corner.d.ts +3 -0
- package/cjs/components/pivot/pivot-corner.js +10 -0
- package/cjs/components/pivot/pivot-corner.js.map +1 -0
- package/cjs/components/pivot/pivot-indicator.d.ts +3 -0
- package/cjs/components/pivot/pivot-indicator.js +10 -0
- package/cjs/components/pivot/pivot-indicator.js.map +1 -0
- package/cjs/components/pivot/pivot-row-dimension.d.ts +8 -0
- package/cjs/components/pivot/pivot-row-dimension.js +10 -0
- package/cjs/components/pivot/pivot-row-dimension.js.map +1 -0
- package/cjs/components/pivot/pivot-row-header-title.d.ts +3 -0
- package/cjs/components/pivot/pivot-row-header-title.js +10 -0
- package/cjs/components/pivot/pivot-row-header-title.js.map +1 -0
- package/cjs/constants.d.ts +1 -0
- package/cjs/constants.js +5 -0
- package/cjs/constants.js.map +1 -0
- package/cjs/eventsUtils.d.ts +101 -0
- package/cjs/eventsUtils.js +58 -0
- package/cjs/eventsUtils.js.map +1 -0
- package/cjs/index.d.ts +5 -0
- package/cjs/index.js +38 -0
- package/cjs/index.js.map +1 -0
- package/cjs/tables/chartModule.d.ts +1 -0
- package/cjs/tables/chartModule.js +37 -0
- package/cjs/tables/chartModule.js.map +1 -0
- package/cjs/tables/index.d.ts +4 -0
- package/cjs/tables/index.js +48 -0
- package/cjs/tables/index.js.map +1 -0
- package/cjs/tables/utils.d.ts +2 -0
- package/cjs/tables/utils.js +80 -0
- package/cjs/tables/utils.js.map +1 -0
- package/dist/vue-vtable.js +4040 -0
- package/dist/vue-vtable.min.js +18 -0
- package/es/components/component/menu.d.ts +9 -0
- package/es/components/component/menu.js +3 -0
- package/es/components/component/menu.js.map +1 -0
- package/es/components/component/tooltip.d.ts +7 -0
- package/es/components/component/tooltip.js +4 -0
- package/es/components/component/tooltip.js.map +1 -0
- package/es/components/custom/checkBox.d.ts +16 -0
- package/es/components/custom/checkBox.js +4 -0
- package/es/components/custom/checkBox.js.map +1 -0
- package/es/components/custom/custom-layout.d.ts +16 -0
- package/es/components/custom/custom-layout.js +4 -0
- package/es/components/custom/custom-layout.js.map +1 -0
- package/es/components/custom/group.d.ts +2 -0
- package/es/components/custom/group.js +4 -0
- package/es/components/custom/group.js.map +1 -0
- package/es/components/custom/image.d.ts +2 -0
- package/es/components/custom/image.js +4 -0
- package/es/components/custom/image.js.map +1 -0
- package/es/components/custom/radio.d.ts +13 -0
- package/es/components/custom/radio.js +4 -0
- package/es/components/custom/radio.js.map +1 -0
- package/es/components/custom/tag.d.ts +12 -0
- package/es/components/custom/tag.js +4 -0
- package/es/components/custom/tag.js.map +1 -0
- package/es/components/custom/text.d.ts +2 -0
- package/es/components/custom/text.js +4 -0
- package/es/components/custom/text.js.map +1 -0
- package/es/components/index.d.ts +15 -0
- package/es/components/index.js +30 -0
- package/es/components/index.js.map +1 -0
- package/es/components/list/list-column.d.ts +3 -0
- package/es/components/list/list-column.js +4 -0
- package/es/components/list/list-column.js.map +1 -0
- package/es/components/pivot/pivot-column-dimension.d.ts +8 -0
- package/es/components/pivot/pivot-column-dimension.js +4 -0
- package/es/components/pivot/pivot-column-dimension.js.map +1 -0
- package/es/components/pivot/pivot-column-header-title.d.ts +3 -0
- package/es/components/pivot/pivot-column-header-title.js +4 -0
- package/es/components/pivot/pivot-column-header-title.js.map +1 -0
- package/es/components/pivot/pivot-corner.d.ts +3 -0
- package/es/components/pivot/pivot-corner.js +4 -0
- package/es/components/pivot/pivot-corner.js.map +1 -0
- package/es/components/pivot/pivot-indicator.d.ts +3 -0
- package/es/components/pivot/pivot-indicator.js +4 -0
- package/es/components/pivot/pivot-indicator.js.map +1 -0
- package/es/components/pivot/pivot-row-dimension.d.ts +8 -0
- package/es/components/pivot/pivot-row-dimension.js +4 -0
- package/es/components/pivot/pivot-row-dimension.js.map +1 -0
- package/es/components/pivot/pivot-row-header-title.d.ts +3 -0
- package/es/components/pivot/pivot-row-header-title.js +4 -0
- package/es/components/pivot/pivot-row-header-title.js.map +1 -0
- package/es/constants.d.ts +1 -0
- package/es/constants.js +1 -0
- package/es/constants.js.map +1 -0
- package/es/eventsUtils.d.ts +101 -0
- package/es/eventsUtils.js +56 -0
- package/es/eventsUtils.js.map +1 -0
- package/es/index.d.ts +5 -0
- package/es/index.js +10 -0
- package/es/index.js.map +1 -0
- package/es/tables/chartModule.d.ts +1 -0
- package/es/tables/chartModule.js +6 -0
- package/es/tables/chartModule.js.map +1 -0
- package/es/tables/index.d.ts +4 -0
- package/es/tables/index.js +8 -0
- package/es/tables/index.js.map +1 -0
- package/es/tables/utils.d.ts +2 -0
- package/es/tables/utils.js +49 -0
- package/es/tables/utils.js.map +1 -0
- package/package.json +100 -0
|
@@ -0,0 +1,4040 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@visactor/vtable')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', '@visactor/vtable'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.VueVTable = {}, global.VTable));
|
|
5
|
+
})(this, (function (exports, VTable) { 'use strict';
|
|
6
|
+
|
|
7
|
+
function _interopNamespaceDefault(e) {
|
|
8
|
+
var n = Object.create(null);
|
|
9
|
+
if (e) {
|
|
10
|
+
Object.keys(e).forEach(function (k) {
|
|
11
|
+
if (k !== 'default') {
|
|
12
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
13
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return e[k]; }
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
n.default = e;
|
|
21
|
+
return Object.freeze(n);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
var VTable__namespace = /*#__PURE__*/_interopNamespaceDefault(VTable);
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @vue/shared v3.5.0
|
|
28
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
29
|
+
* @license MIT
|
|
30
|
+
**/
|
|
31
|
+
/*! #__NO_SIDE_EFFECTS__ */
|
|
32
|
+
// @__NO_SIDE_EFFECTS__
|
|
33
|
+
function makeMap(str, expectsLowerCase) {
|
|
34
|
+
const set = new Set(str.split(","));
|
|
35
|
+
return expectsLowerCase ? val => set.has(val.toLowerCase()) : val => set.has(val);
|
|
36
|
+
}
|
|
37
|
+
const EMPTY_OBJ = !!(process.env.NODE_ENV !== "production") ? Object.freeze({}) : {};
|
|
38
|
+
const EMPTY_ARR = !!(process.env.NODE_ENV !== "production") ? Object.freeze([]) : [];
|
|
39
|
+
const NOOP = () => {};
|
|
40
|
+
const isOn = key => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && (
|
|
41
|
+
// uppercase letter
|
|
42
|
+
key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
|
|
43
|
+
const extend = Object.assign;
|
|
44
|
+
const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
45
|
+
const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
|
|
46
|
+
const isArray = Array.isArray;
|
|
47
|
+
const isMap = val => toTypeString(val) === "[object Map]";
|
|
48
|
+
const isSet = val => toTypeString(val) === "[object Set]";
|
|
49
|
+
const isFunction$2 = val => typeof val === "function";
|
|
50
|
+
const isString = val => typeof val === "string";
|
|
51
|
+
const isSymbol = val => typeof val === "symbol";
|
|
52
|
+
const isObject = val => val !== null && typeof val === "object";
|
|
53
|
+
const isPromise = val => {
|
|
54
|
+
return (isObject(val) || isFunction$2(val)) && isFunction$2(val.then) && isFunction$2(val.catch);
|
|
55
|
+
};
|
|
56
|
+
const objectToString = Object.prototype.toString;
|
|
57
|
+
const toTypeString = value => objectToString.call(value);
|
|
58
|
+
const toRawType = value => {
|
|
59
|
+
return toTypeString(value).slice(8, -1);
|
|
60
|
+
};
|
|
61
|
+
const isPlainObject = val => toTypeString(val) === "[object Object]";
|
|
62
|
+
const isIntegerKey = key => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
|
|
63
|
+
const cacheStringFunction = fn => {
|
|
64
|
+
const cache = /* @__PURE__ */Object.create(null);
|
|
65
|
+
return str => {
|
|
66
|
+
const hit = cache[str];
|
|
67
|
+
return hit || (cache[str] = fn(str));
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
const capitalize = cacheStringFunction(str => {
|
|
71
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
72
|
+
});
|
|
73
|
+
const toHandlerKey = cacheStringFunction(str => {
|
|
74
|
+
const s = str ? `on${capitalize(str)}` : ``;
|
|
75
|
+
return s;
|
|
76
|
+
});
|
|
77
|
+
const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
|
|
78
|
+
const def = function (obj, key, value) {
|
|
79
|
+
let writable = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
80
|
+
Object.defineProperty(obj, key, {
|
|
81
|
+
configurable: true,
|
|
82
|
+
enumerable: false,
|
|
83
|
+
writable,
|
|
84
|
+
value
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
let _globalThis;
|
|
88
|
+
const getGlobalThis = () => {
|
|
89
|
+
return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
|
|
90
|
+
};
|
|
91
|
+
function normalizeStyle(value) {
|
|
92
|
+
if (isArray(value)) {
|
|
93
|
+
const res = {};
|
|
94
|
+
for (let i = 0; i < value.length; i++) {
|
|
95
|
+
const item = value[i];
|
|
96
|
+
const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
|
|
97
|
+
if (normalized) {
|
|
98
|
+
for (const key in normalized) {
|
|
99
|
+
res[key] = normalized[key];
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return res;
|
|
104
|
+
} else if (isString(value) || isObject(value)) {
|
|
105
|
+
return value;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
const listDelimiterRE = /;(?![^(]*\))/g;
|
|
109
|
+
const propertyDelimiterRE = /:([^]+)/;
|
|
110
|
+
const styleCommentRE = /\/\*[^]*?\*\//g;
|
|
111
|
+
function parseStringStyle(cssText) {
|
|
112
|
+
const ret = {};
|
|
113
|
+
cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach(item => {
|
|
114
|
+
if (item) {
|
|
115
|
+
const tmp = item.split(propertyDelimiterRE);
|
|
116
|
+
tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
return ret;
|
|
120
|
+
}
|
|
121
|
+
function normalizeClass(value) {
|
|
122
|
+
let res = "";
|
|
123
|
+
if (isString(value)) {
|
|
124
|
+
res = value;
|
|
125
|
+
} else if (isArray(value)) {
|
|
126
|
+
for (let i = 0; i < value.length; i++) {
|
|
127
|
+
const normalized = normalizeClass(value[i]);
|
|
128
|
+
if (normalized) {
|
|
129
|
+
res += normalized + " ";
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
} else if (isObject(value)) {
|
|
133
|
+
for (const name in value) {
|
|
134
|
+
if (value[name]) {
|
|
135
|
+
res += name + " ";
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return res.trim();
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* @vue/reactivity v3.5.0
|
|
144
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
145
|
+
* @license MIT
|
|
146
|
+
**/
|
|
147
|
+
function warn(msg) {
|
|
148
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key2 = 1; _key2 < _len; _key2++) {
|
|
149
|
+
args[_key2 - 1] = arguments[_key2];
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
let activeSub;
|
|
153
|
+
const pausedQueueEffects = /* @__PURE__ */new WeakSet();
|
|
154
|
+
class ReactiveEffect {
|
|
155
|
+
constructor(fn) {
|
|
156
|
+
this.fn = fn;
|
|
157
|
+
/**
|
|
158
|
+
* @internal
|
|
159
|
+
*/
|
|
160
|
+
this.deps = void 0;
|
|
161
|
+
/**
|
|
162
|
+
* @internal
|
|
163
|
+
*/
|
|
164
|
+
this.depsTail = void 0;
|
|
165
|
+
/**
|
|
166
|
+
* @internal
|
|
167
|
+
*/
|
|
168
|
+
this.flags = 1 | 4;
|
|
169
|
+
/**
|
|
170
|
+
* @internal
|
|
171
|
+
*/
|
|
172
|
+
this.nextEffect = void 0;
|
|
173
|
+
/**
|
|
174
|
+
* @internal
|
|
175
|
+
*/
|
|
176
|
+
this.cleanup = void 0;
|
|
177
|
+
this.scheduler = void 0;
|
|
178
|
+
}
|
|
179
|
+
pause() {
|
|
180
|
+
this.flags |= 64;
|
|
181
|
+
}
|
|
182
|
+
resume() {
|
|
183
|
+
if (this.flags & 64) {
|
|
184
|
+
this.flags &= ~64;
|
|
185
|
+
if (pausedQueueEffects.has(this)) {
|
|
186
|
+
pausedQueueEffects.delete(this);
|
|
187
|
+
this.trigger();
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* @internal
|
|
193
|
+
*/
|
|
194
|
+
notify() {
|
|
195
|
+
if (this.flags & 2 && !(this.flags & 32)) {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
if (!(this.flags & 8)) {
|
|
199
|
+
this.flags |= 8;
|
|
200
|
+
this.nextEffect = batchedEffect;
|
|
201
|
+
batchedEffect = this;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
run() {
|
|
205
|
+
if (!(this.flags & 1)) {
|
|
206
|
+
return this.fn();
|
|
207
|
+
}
|
|
208
|
+
this.flags |= 2;
|
|
209
|
+
cleanupEffect(this);
|
|
210
|
+
prepareDeps(this);
|
|
211
|
+
const prevEffect = activeSub;
|
|
212
|
+
const prevShouldTrack = shouldTrack;
|
|
213
|
+
activeSub = this;
|
|
214
|
+
shouldTrack = true;
|
|
215
|
+
try {
|
|
216
|
+
return this.fn();
|
|
217
|
+
} finally {
|
|
218
|
+
if (!!(process.env.NODE_ENV !== "production") && activeSub !== this) {
|
|
219
|
+
warn("Active effect was not restored correctly - this is likely a Vue internal bug.");
|
|
220
|
+
}
|
|
221
|
+
cleanupDeps(this);
|
|
222
|
+
activeSub = prevEffect;
|
|
223
|
+
shouldTrack = prevShouldTrack;
|
|
224
|
+
this.flags &= ~2;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
stop() {
|
|
228
|
+
if (this.flags & 1) {
|
|
229
|
+
for (let link = this.deps; link; link = link.nextDep) {
|
|
230
|
+
removeSub(link);
|
|
231
|
+
}
|
|
232
|
+
this.deps = this.depsTail = void 0;
|
|
233
|
+
cleanupEffect(this);
|
|
234
|
+
this.onStop && this.onStop();
|
|
235
|
+
this.flags &= ~1;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
trigger() {
|
|
239
|
+
if (this.flags & 64) {
|
|
240
|
+
pausedQueueEffects.add(this);
|
|
241
|
+
} else if (this.scheduler) {
|
|
242
|
+
this.scheduler();
|
|
243
|
+
} else {
|
|
244
|
+
this.runIfDirty();
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* @internal
|
|
249
|
+
*/
|
|
250
|
+
runIfDirty() {
|
|
251
|
+
if (isDirty(this)) {
|
|
252
|
+
this.run();
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
get dirty() {
|
|
256
|
+
return isDirty(this);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
let batchDepth = 0;
|
|
260
|
+
let batchedEffect;
|
|
261
|
+
function startBatch() {
|
|
262
|
+
batchDepth++;
|
|
263
|
+
}
|
|
264
|
+
function endBatch() {
|
|
265
|
+
if (--batchDepth > 0) {
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
let error;
|
|
269
|
+
while (batchedEffect) {
|
|
270
|
+
let e = batchedEffect;
|
|
271
|
+
batchedEffect = void 0;
|
|
272
|
+
while (e) {
|
|
273
|
+
const next = e.nextEffect;
|
|
274
|
+
e.nextEffect = void 0;
|
|
275
|
+
e.flags &= ~8;
|
|
276
|
+
if (e.flags & 1) {
|
|
277
|
+
try {
|
|
278
|
+
e.trigger();
|
|
279
|
+
} catch (err) {
|
|
280
|
+
if (!error) error = err;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
e = next;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
if (error) throw error;
|
|
287
|
+
}
|
|
288
|
+
function prepareDeps(sub) {
|
|
289
|
+
for (let link = sub.deps; link; link = link.nextDep) {
|
|
290
|
+
link.version = -1;
|
|
291
|
+
link.prevActiveLink = link.dep.activeLink;
|
|
292
|
+
link.dep.activeLink = link;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
function cleanupDeps(sub) {
|
|
296
|
+
let head;
|
|
297
|
+
let tail = sub.depsTail;
|
|
298
|
+
for (let link = tail; link; link = link.prevDep) {
|
|
299
|
+
if (link.version === -1) {
|
|
300
|
+
if (link === tail) tail = link.prevDep;
|
|
301
|
+
removeSub(link);
|
|
302
|
+
removeDep(link);
|
|
303
|
+
} else {
|
|
304
|
+
head = link;
|
|
305
|
+
}
|
|
306
|
+
link.dep.activeLink = link.prevActiveLink;
|
|
307
|
+
link.prevActiveLink = void 0;
|
|
308
|
+
}
|
|
309
|
+
sub.deps = head;
|
|
310
|
+
sub.depsTail = tail;
|
|
311
|
+
}
|
|
312
|
+
function isDirty(sub) {
|
|
313
|
+
for (let link = sub.deps; link; link = link.nextDep) {
|
|
314
|
+
if (link.dep.version !== link.version || link.dep.computed && refreshComputed(link.dep.computed) === false || link.dep.version !== link.version) {
|
|
315
|
+
return true;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
if (sub._dirty) {
|
|
319
|
+
return true;
|
|
320
|
+
}
|
|
321
|
+
return false;
|
|
322
|
+
}
|
|
323
|
+
function refreshComputed(computed) {
|
|
324
|
+
if (computed.flags & 2) {
|
|
325
|
+
return false;
|
|
326
|
+
}
|
|
327
|
+
if (computed.flags & 4 && !(computed.flags & 16)) {
|
|
328
|
+
return;
|
|
329
|
+
}
|
|
330
|
+
computed.flags &= ~16;
|
|
331
|
+
if (computed.globalVersion === globalVersion) {
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
computed.globalVersion = globalVersion;
|
|
335
|
+
const dep = computed.dep;
|
|
336
|
+
computed.flags |= 2;
|
|
337
|
+
if (dep.version > 0 && !computed.isSSR && !isDirty(computed)) {
|
|
338
|
+
computed.flags &= ~2;
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
const prevSub = activeSub;
|
|
342
|
+
const prevShouldTrack = shouldTrack;
|
|
343
|
+
activeSub = computed;
|
|
344
|
+
shouldTrack = true;
|
|
345
|
+
try {
|
|
346
|
+
prepareDeps(computed);
|
|
347
|
+
const value = computed.fn();
|
|
348
|
+
if (dep.version === 0 || hasChanged(value, computed._value)) {
|
|
349
|
+
computed._value = value;
|
|
350
|
+
dep.version++;
|
|
351
|
+
}
|
|
352
|
+
} catch (err) {
|
|
353
|
+
dep.version++;
|
|
354
|
+
throw err;
|
|
355
|
+
} finally {
|
|
356
|
+
activeSub = prevSub;
|
|
357
|
+
shouldTrack = prevShouldTrack;
|
|
358
|
+
cleanupDeps(computed);
|
|
359
|
+
computed.flags &= ~2;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
function removeSub(link) {
|
|
363
|
+
const {
|
|
364
|
+
dep,
|
|
365
|
+
prevSub,
|
|
366
|
+
nextSub
|
|
367
|
+
} = link;
|
|
368
|
+
if (prevSub) {
|
|
369
|
+
prevSub.nextSub = nextSub;
|
|
370
|
+
link.prevSub = void 0;
|
|
371
|
+
}
|
|
372
|
+
if (nextSub) {
|
|
373
|
+
nextSub.prevSub = prevSub;
|
|
374
|
+
link.nextSub = void 0;
|
|
375
|
+
}
|
|
376
|
+
if (dep.subs === link) {
|
|
377
|
+
dep.subs = prevSub;
|
|
378
|
+
}
|
|
379
|
+
if (!dep.subs && dep.computed) {
|
|
380
|
+
dep.computed.flags &= ~4;
|
|
381
|
+
for (let l = dep.computed.deps; l; l = l.nextDep) {
|
|
382
|
+
removeSub(l);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
function removeDep(link) {
|
|
387
|
+
const {
|
|
388
|
+
prevDep,
|
|
389
|
+
nextDep
|
|
390
|
+
} = link;
|
|
391
|
+
if (prevDep) {
|
|
392
|
+
prevDep.nextDep = nextDep;
|
|
393
|
+
link.prevDep = void 0;
|
|
394
|
+
}
|
|
395
|
+
if (nextDep) {
|
|
396
|
+
nextDep.prevDep = prevDep;
|
|
397
|
+
link.nextDep = void 0;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
let shouldTrack = true;
|
|
401
|
+
const trackStack = [];
|
|
402
|
+
function pauseTracking() {
|
|
403
|
+
trackStack.push(shouldTrack);
|
|
404
|
+
shouldTrack = false;
|
|
405
|
+
}
|
|
406
|
+
function resetTracking() {
|
|
407
|
+
const last = trackStack.pop();
|
|
408
|
+
shouldTrack = last === void 0 ? true : last;
|
|
409
|
+
}
|
|
410
|
+
function cleanupEffect(e) {
|
|
411
|
+
const {
|
|
412
|
+
cleanup
|
|
413
|
+
} = e;
|
|
414
|
+
e.cleanup = void 0;
|
|
415
|
+
if (cleanup) {
|
|
416
|
+
const prevSub = activeSub;
|
|
417
|
+
activeSub = void 0;
|
|
418
|
+
try {
|
|
419
|
+
cleanup();
|
|
420
|
+
} finally {
|
|
421
|
+
activeSub = prevSub;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
let globalVersion = 0;
|
|
426
|
+
class Dep {
|
|
427
|
+
constructor(computed) {
|
|
428
|
+
this.computed = computed;
|
|
429
|
+
this.version = 0;
|
|
430
|
+
/**
|
|
431
|
+
* Link between this dep and the current active effect
|
|
432
|
+
*/
|
|
433
|
+
this.activeLink = void 0;
|
|
434
|
+
/**
|
|
435
|
+
* Doubly linked list representing the subscribing effects (tail)
|
|
436
|
+
*/
|
|
437
|
+
this.subs = void 0;
|
|
438
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
439
|
+
this.subsHead = void 0;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
track(debugInfo) {
|
|
443
|
+
if (!activeSub || !shouldTrack) {
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
let link = this.activeLink;
|
|
447
|
+
if (link === void 0 || link.sub !== activeSub) {
|
|
448
|
+
link = this.activeLink = {
|
|
449
|
+
dep: this,
|
|
450
|
+
sub: activeSub,
|
|
451
|
+
version: this.version,
|
|
452
|
+
nextDep: void 0,
|
|
453
|
+
prevDep: void 0,
|
|
454
|
+
nextSub: void 0,
|
|
455
|
+
prevSub: void 0,
|
|
456
|
+
prevActiveLink: void 0
|
|
457
|
+
};
|
|
458
|
+
if (!activeSub.deps) {
|
|
459
|
+
activeSub.deps = activeSub.depsTail = link;
|
|
460
|
+
} else {
|
|
461
|
+
link.prevDep = activeSub.depsTail;
|
|
462
|
+
activeSub.depsTail.nextDep = link;
|
|
463
|
+
activeSub.depsTail = link;
|
|
464
|
+
}
|
|
465
|
+
if (activeSub.flags & 4) {
|
|
466
|
+
addSub(link);
|
|
467
|
+
}
|
|
468
|
+
} else if (link.version === -1) {
|
|
469
|
+
link.version = this.version;
|
|
470
|
+
if (link.nextDep) {
|
|
471
|
+
const next = link.nextDep;
|
|
472
|
+
next.prevDep = link.prevDep;
|
|
473
|
+
if (link.prevDep) {
|
|
474
|
+
link.prevDep.nextDep = next;
|
|
475
|
+
}
|
|
476
|
+
link.prevDep = activeSub.depsTail;
|
|
477
|
+
link.nextDep = void 0;
|
|
478
|
+
activeSub.depsTail.nextDep = link;
|
|
479
|
+
activeSub.depsTail = link;
|
|
480
|
+
if (activeSub.deps === link) {
|
|
481
|
+
activeSub.deps = next;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
if (!!(process.env.NODE_ENV !== "production") && activeSub.onTrack) {
|
|
486
|
+
activeSub.onTrack(extend({
|
|
487
|
+
effect: activeSub
|
|
488
|
+
}, debugInfo));
|
|
489
|
+
}
|
|
490
|
+
return link;
|
|
491
|
+
}
|
|
492
|
+
trigger(debugInfo) {
|
|
493
|
+
this.version++;
|
|
494
|
+
globalVersion++;
|
|
495
|
+
this.notify(debugInfo);
|
|
496
|
+
}
|
|
497
|
+
notify(debugInfo) {
|
|
498
|
+
startBatch();
|
|
499
|
+
try {
|
|
500
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
501
|
+
for (let head = this.subsHead; head; head = head.nextSub) {
|
|
502
|
+
if (!!(process.env.NODE_ENV !== "production") && head.sub.onTrigger && !(head.sub.flags & 8)) {
|
|
503
|
+
head.sub.onTrigger(extend({
|
|
504
|
+
effect: head.sub
|
|
505
|
+
}, debugInfo));
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
for (let link = this.subs; link; link = link.prevSub) {
|
|
510
|
+
link.sub.notify();
|
|
511
|
+
}
|
|
512
|
+
} finally {
|
|
513
|
+
endBatch();
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
function addSub(link) {
|
|
518
|
+
const computed = link.dep.computed;
|
|
519
|
+
if (computed && !link.dep.subs) {
|
|
520
|
+
computed.flags |= 4 | 16;
|
|
521
|
+
for (let l = computed.deps; l; l = l.nextDep) {
|
|
522
|
+
addSub(l);
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
const currentTail = link.dep.subs;
|
|
526
|
+
if (currentTail !== link) {
|
|
527
|
+
link.prevSub = currentTail;
|
|
528
|
+
if (currentTail) currentTail.nextSub = link;
|
|
529
|
+
}
|
|
530
|
+
if (!!(process.env.NODE_ENV !== "production") && link.dep.subsHead === void 0) {
|
|
531
|
+
link.dep.subsHead = link;
|
|
532
|
+
}
|
|
533
|
+
link.dep.subs = link;
|
|
534
|
+
}
|
|
535
|
+
const targetMap = /* @__PURE__ */new WeakMap();
|
|
536
|
+
const ITERATE_KEY = Symbol(!!(process.env.NODE_ENV !== "production") ? "Object iterate" : "");
|
|
537
|
+
const MAP_KEY_ITERATE_KEY = Symbol(!!(process.env.NODE_ENV !== "production") ? "Map keys iterate" : "");
|
|
538
|
+
const ARRAY_ITERATE_KEY = Symbol(!!(process.env.NODE_ENV !== "production") ? "Array iterate" : "");
|
|
539
|
+
function track(target, type, key) {
|
|
540
|
+
if (shouldTrack && activeSub) {
|
|
541
|
+
let depsMap = targetMap.get(target);
|
|
542
|
+
if (!depsMap) {
|
|
543
|
+
targetMap.set(target, depsMap = /* @__PURE__ */new Map());
|
|
544
|
+
}
|
|
545
|
+
let dep = depsMap.get(key);
|
|
546
|
+
if (!dep) {
|
|
547
|
+
depsMap.set(key, dep = new Dep());
|
|
548
|
+
}
|
|
549
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
550
|
+
dep.track({
|
|
551
|
+
target,
|
|
552
|
+
type,
|
|
553
|
+
key
|
|
554
|
+
});
|
|
555
|
+
} else {
|
|
556
|
+
dep.track();
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
561
|
+
const depsMap = targetMap.get(target);
|
|
562
|
+
if (!depsMap) {
|
|
563
|
+
globalVersion++;
|
|
564
|
+
return;
|
|
565
|
+
}
|
|
566
|
+
let deps = [];
|
|
567
|
+
if (type === "clear") {
|
|
568
|
+
deps = [...depsMap.values()];
|
|
569
|
+
} else {
|
|
570
|
+
const targetIsArray = isArray(target);
|
|
571
|
+
const isArrayIndex = targetIsArray && isIntegerKey(key);
|
|
572
|
+
if (targetIsArray && key === "length") {
|
|
573
|
+
const newLength = Number(newValue);
|
|
574
|
+
depsMap.forEach((dep, key2) => {
|
|
575
|
+
if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) {
|
|
576
|
+
deps.push(dep);
|
|
577
|
+
}
|
|
578
|
+
});
|
|
579
|
+
} else {
|
|
580
|
+
const push = dep => dep && deps.push(dep);
|
|
581
|
+
if (key !== void 0) {
|
|
582
|
+
push(depsMap.get(key));
|
|
583
|
+
}
|
|
584
|
+
if (isArrayIndex) {
|
|
585
|
+
push(depsMap.get(ARRAY_ITERATE_KEY));
|
|
586
|
+
}
|
|
587
|
+
switch (type) {
|
|
588
|
+
case "add":
|
|
589
|
+
if (!targetIsArray) {
|
|
590
|
+
push(depsMap.get(ITERATE_KEY));
|
|
591
|
+
if (isMap(target)) {
|
|
592
|
+
push(depsMap.get(MAP_KEY_ITERATE_KEY));
|
|
593
|
+
}
|
|
594
|
+
} else if (isArrayIndex) {
|
|
595
|
+
push(depsMap.get("length"));
|
|
596
|
+
}
|
|
597
|
+
break;
|
|
598
|
+
case "delete":
|
|
599
|
+
if (!targetIsArray) {
|
|
600
|
+
push(depsMap.get(ITERATE_KEY));
|
|
601
|
+
if (isMap(target)) {
|
|
602
|
+
push(depsMap.get(MAP_KEY_ITERATE_KEY));
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
break;
|
|
606
|
+
case "set":
|
|
607
|
+
if (isMap(target)) {
|
|
608
|
+
push(depsMap.get(ITERATE_KEY));
|
|
609
|
+
}
|
|
610
|
+
break;
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
startBatch();
|
|
615
|
+
for (const dep of deps) {
|
|
616
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
617
|
+
dep.trigger({
|
|
618
|
+
target,
|
|
619
|
+
type,
|
|
620
|
+
key,
|
|
621
|
+
newValue,
|
|
622
|
+
oldValue,
|
|
623
|
+
oldTarget
|
|
624
|
+
});
|
|
625
|
+
} else {
|
|
626
|
+
dep.trigger();
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
endBatch();
|
|
630
|
+
}
|
|
631
|
+
function reactiveReadArray(array) {
|
|
632
|
+
const raw = toRaw(array);
|
|
633
|
+
if (raw === array) return raw;
|
|
634
|
+
track(raw, "iterate", ARRAY_ITERATE_KEY);
|
|
635
|
+
return isShallow(array) ? raw : raw.map(toReactive);
|
|
636
|
+
}
|
|
637
|
+
function shallowReadArray(arr) {
|
|
638
|
+
track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
|
|
639
|
+
return arr;
|
|
640
|
+
}
|
|
641
|
+
const arrayInstrumentations = {
|
|
642
|
+
__proto__: null,
|
|
643
|
+
[Symbol.iterator]() {
|
|
644
|
+
return iterator(this, Symbol.iterator, toReactive);
|
|
645
|
+
},
|
|
646
|
+
concat() {
|
|
647
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key3 = 0; _key3 < _len2; _key3++) {
|
|
648
|
+
args[_key3] = arguments[_key3];
|
|
649
|
+
}
|
|
650
|
+
return reactiveReadArray(this).concat(...args.map(x => reactiveReadArray(x)));
|
|
651
|
+
},
|
|
652
|
+
entries() {
|
|
653
|
+
return iterator(this, "entries", value => {
|
|
654
|
+
value[1] = toReactive(value[1]);
|
|
655
|
+
return value;
|
|
656
|
+
});
|
|
657
|
+
},
|
|
658
|
+
every(fn, thisArg) {
|
|
659
|
+
return apply(this, "every", fn, thisArg, void 0, arguments);
|
|
660
|
+
},
|
|
661
|
+
filter(fn, thisArg) {
|
|
662
|
+
return apply(this, "filter", fn, thisArg, v => v.map(toReactive), arguments);
|
|
663
|
+
},
|
|
664
|
+
find(fn, thisArg) {
|
|
665
|
+
return apply(this, "find", fn, thisArg, toReactive, arguments);
|
|
666
|
+
},
|
|
667
|
+
findIndex(fn, thisArg) {
|
|
668
|
+
return apply(this, "findIndex", fn, thisArg, void 0, arguments);
|
|
669
|
+
},
|
|
670
|
+
findLast(fn, thisArg) {
|
|
671
|
+
return apply(this, "findLast", fn, thisArg, toReactive, arguments);
|
|
672
|
+
},
|
|
673
|
+
findLastIndex(fn, thisArg) {
|
|
674
|
+
return apply(this, "findLastIndex", fn, thisArg, void 0, arguments);
|
|
675
|
+
},
|
|
676
|
+
// flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement
|
|
677
|
+
forEach(fn, thisArg) {
|
|
678
|
+
return apply(this, "forEach", fn, thisArg, void 0, arguments);
|
|
679
|
+
},
|
|
680
|
+
includes() {
|
|
681
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key4 = 0; _key4 < _len3; _key4++) {
|
|
682
|
+
args[_key4] = arguments[_key4];
|
|
683
|
+
}
|
|
684
|
+
return searchProxy(this, "includes", args);
|
|
685
|
+
},
|
|
686
|
+
indexOf() {
|
|
687
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key5 = 0; _key5 < _len4; _key5++) {
|
|
688
|
+
args[_key5] = arguments[_key5];
|
|
689
|
+
}
|
|
690
|
+
return searchProxy(this, "indexOf", args);
|
|
691
|
+
},
|
|
692
|
+
join(separator) {
|
|
693
|
+
return reactiveReadArray(this).join(separator);
|
|
694
|
+
},
|
|
695
|
+
// keys() iterator only reads `length`, no optimisation required
|
|
696
|
+
lastIndexOf() {
|
|
697
|
+
for (var _len5 = arguments.length, args = new Array(_len5), _key6 = 0; _key6 < _len5; _key6++) {
|
|
698
|
+
args[_key6] = arguments[_key6];
|
|
699
|
+
}
|
|
700
|
+
return searchProxy(this, "lastIndexOf", args);
|
|
701
|
+
},
|
|
702
|
+
map(fn, thisArg) {
|
|
703
|
+
return apply(this, "map", fn, thisArg, void 0, arguments);
|
|
704
|
+
},
|
|
705
|
+
pop() {
|
|
706
|
+
return noTracking(this, "pop");
|
|
707
|
+
},
|
|
708
|
+
push() {
|
|
709
|
+
for (var _len6 = arguments.length, args = new Array(_len6), _key7 = 0; _key7 < _len6; _key7++) {
|
|
710
|
+
args[_key7] = arguments[_key7];
|
|
711
|
+
}
|
|
712
|
+
return noTracking(this, "push", args);
|
|
713
|
+
},
|
|
714
|
+
reduce(fn) {
|
|
715
|
+
for (var _len7 = arguments.length, args = new Array(_len7 > 1 ? _len7 - 1 : 0), _key8 = 1; _key8 < _len7; _key8++) {
|
|
716
|
+
args[_key8 - 1] = arguments[_key8];
|
|
717
|
+
}
|
|
718
|
+
return reduce(this, "reduce", fn, args);
|
|
719
|
+
},
|
|
720
|
+
reduceRight(fn) {
|
|
721
|
+
for (var _len8 = arguments.length, args = new Array(_len8 > 1 ? _len8 - 1 : 0), _key9 = 1; _key9 < _len8; _key9++) {
|
|
722
|
+
args[_key9 - 1] = arguments[_key9];
|
|
723
|
+
}
|
|
724
|
+
return reduce(this, "reduceRight", fn, args);
|
|
725
|
+
},
|
|
726
|
+
shift() {
|
|
727
|
+
return noTracking(this, "shift");
|
|
728
|
+
},
|
|
729
|
+
// slice could use ARRAY_ITERATE but also seems to beg for range tracking
|
|
730
|
+
some(fn, thisArg) {
|
|
731
|
+
return apply(this, "some", fn, thisArg, void 0, arguments);
|
|
732
|
+
},
|
|
733
|
+
splice() {
|
|
734
|
+
for (var _len9 = arguments.length, args = new Array(_len9), _key10 = 0; _key10 < _len9; _key10++) {
|
|
735
|
+
args[_key10] = arguments[_key10];
|
|
736
|
+
}
|
|
737
|
+
return noTracking(this, "splice", args);
|
|
738
|
+
},
|
|
739
|
+
toReversed() {
|
|
740
|
+
return reactiveReadArray(this).toReversed();
|
|
741
|
+
},
|
|
742
|
+
toSorted(comparer) {
|
|
743
|
+
return reactiveReadArray(this).toSorted(comparer);
|
|
744
|
+
},
|
|
745
|
+
toSpliced() {
|
|
746
|
+
return reactiveReadArray(this).toSpliced(...arguments);
|
|
747
|
+
},
|
|
748
|
+
unshift() {
|
|
749
|
+
for (var _len10 = arguments.length, args = new Array(_len10), _key11 = 0; _key11 < _len10; _key11++) {
|
|
750
|
+
args[_key11] = arguments[_key11];
|
|
751
|
+
}
|
|
752
|
+
return noTracking(this, "unshift", args);
|
|
753
|
+
},
|
|
754
|
+
values() {
|
|
755
|
+
return iterator(this, "values", toReactive);
|
|
756
|
+
}
|
|
757
|
+
};
|
|
758
|
+
function iterator(self, method, wrapValue) {
|
|
759
|
+
const arr = shallowReadArray(self);
|
|
760
|
+
const iter = arr[method]();
|
|
761
|
+
if (arr !== self && !isShallow(self)) {
|
|
762
|
+
iter._next = iter.next;
|
|
763
|
+
iter.next = () => {
|
|
764
|
+
const result = iter._next();
|
|
765
|
+
if (result.value) {
|
|
766
|
+
result.value = wrapValue(result.value);
|
|
767
|
+
}
|
|
768
|
+
return result;
|
|
769
|
+
};
|
|
770
|
+
}
|
|
771
|
+
return iter;
|
|
772
|
+
}
|
|
773
|
+
const arrayProto = Array.prototype;
|
|
774
|
+
function apply(self, method, fn, thisArg, wrappedRetFn, args) {
|
|
775
|
+
const arr = shallowReadArray(self);
|
|
776
|
+
const needsWrap = arr !== self && !isShallow(self);
|
|
777
|
+
const methodFn = arr[method];
|
|
778
|
+
if (methodFn !== arrayProto[method]) {
|
|
779
|
+
const result2 = methodFn.apply(self, args);
|
|
780
|
+
return needsWrap ? toReactive(result2) : result2;
|
|
781
|
+
}
|
|
782
|
+
let wrappedFn = fn;
|
|
783
|
+
if (arr !== self) {
|
|
784
|
+
if (needsWrap) {
|
|
785
|
+
wrappedFn = function (item, index) {
|
|
786
|
+
return fn.call(this, toReactive(item), index, self);
|
|
787
|
+
};
|
|
788
|
+
} else if (fn.length > 2) {
|
|
789
|
+
wrappedFn = function (item, index) {
|
|
790
|
+
return fn.call(this, item, index, self);
|
|
791
|
+
};
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
const result = methodFn.call(arr, wrappedFn, thisArg);
|
|
795
|
+
return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result;
|
|
796
|
+
}
|
|
797
|
+
function reduce(self, method, fn, args) {
|
|
798
|
+
const arr = shallowReadArray(self);
|
|
799
|
+
let wrappedFn = fn;
|
|
800
|
+
if (arr !== self) {
|
|
801
|
+
if (!isShallow(self)) {
|
|
802
|
+
wrappedFn = function (acc, item, index) {
|
|
803
|
+
return fn.call(this, acc, toReactive(item), index, self);
|
|
804
|
+
};
|
|
805
|
+
} else if (fn.length > 3) {
|
|
806
|
+
wrappedFn = function (acc, item, index) {
|
|
807
|
+
return fn.call(this, acc, item, index, self);
|
|
808
|
+
};
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
return arr[method](wrappedFn, ...args);
|
|
812
|
+
}
|
|
813
|
+
function searchProxy(self, method, args) {
|
|
814
|
+
const arr = toRaw(self);
|
|
815
|
+
track(arr, "iterate", ARRAY_ITERATE_KEY);
|
|
816
|
+
const res = arr[method](...args);
|
|
817
|
+
if ((res === -1 || res === false) && isProxy(args[0])) {
|
|
818
|
+
args[0] = toRaw(args[0]);
|
|
819
|
+
return arr[method](...args);
|
|
820
|
+
}
|
|
821
|
+
return res;
|
|
822
|
+
}
|
|
823
|
+
function noTracking(self, method) {
|
|
824
|
+
let args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
825
|
+
pauseTracking();
|
|
826
|
+
startBatch();
|
|
827
|
+
const res = toRaw(self)[method].apply(self, args);
|
|
828
|
+
endBatch();
|
|
829
|
+
resetTracking();
|
|
830
|
+
return res;
|
|
831
|
+
}
|
|
832
|
+
const isNonTrackableKeys = /* @__PURE__ */makeMap(`__proto__,__v_isRef,__isVue`);
|
|
833
|
+
const builtInSymbols = new Set( /* @__PURE__ */Object.getOwnPropertyNames(Symbol).filter(key => key !== "arguments" && key !== "caller").map(key => Symbol[key]).filter(isSymbol));
|
|
834
|
+
function hasOwnProperty(key) {
|
|
835
|
+
if (!isSymbol(key)) key = String(key);
|
|
836
|
+
const obj = toRaw(this);
|
|
837
|
+
track(obj, "has", key);
|
|
838
|
+
return obj.hasOwnProperty(key);
|
|
839
|
+
}
|
|
840
|
+
class BaseReactiveHandler {
|
|
841
|
+
constructor() {
|
|
842
|
+
let _isReadonly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
843
|
+
let _isShallow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
844
|
+
this._isReadonly = _isReadonly;
|
|
845
|
+
this._isShallow = _isShallow;
|
|
846
|
+
}
|
|
847
|
+
get(target, key, receiver) {
|
|
848
|
+
const isReadonly2 = this._isReadonly,
|
|
849
|
+
isShallow2 = this._isShallow;
|
|
850
|
+
if (key === "__v_isReactive") {
|
|
851
|
+
return !isReadonly2;
|
|
852
|
+
} else if (key === "__v_isReadonly") {
|
|
853
|
+
return isReadonly2;
|
|
854
|
+
} else if (key === "__v_isShallow") {
|
|
855
|
+
return isShallow2;
|
|
856
|
+
} else if (key === "__v_raw") {
|
|
857
|
+
if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) ||
|
|
858
|
+
// receiver is not the reactive proxy, but has the same prototype
|
|
859
|
+
// this means the receiver is a user proxy of the reactive proxy
|
|
860
|
+
Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
|
|
861
|
+
return target;
|
|
862
|
+
}
|
|
863
|
+
return;
|
|
864
|
+
}
|
|
865
|
+
const targetIsArray = isArray(target);
|
|
866
|
+
if (!isReadonly2) {
|
|
867
|
+
let fn;
|
|
868
|
+
if (targetIsArray && (fn = arrayInstrumentations[key])) {
|
|
869
|
+
return fn;
|
|
870
|
+
}
|
|
871
|
+
if (key === "hasOwnProperty") {
|
|
872
|
+
return hasOwnProperty;
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
const res = Reflect.get(target, key,
|
|
876
|
+
// if this is a proxy wrapping a ref, return methods using the raw ref
|
|
877
|
+
// as receiver so that we don't have to call `toRaw` on the ref in all
|
|
878
|
+
// its class methods
|
|
879
|
+
isRef(target) ? target : receiver);
|
|
880
|
+
if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
|
|
881
|
+
return res;
|
|
882
|
+
}
|
|
883
|
+
if (!isReadonly2) {
|
|
884
|
+
track(target, "get", key);
|
|
885
|
+
}
|
|
886
|
+
if (isShallow2) {
|
|
887
|
+
return res;
|
|
888
|
+
}
|
|
889
|
+
if (isRef(res)) {
|
|
890
|
+
return targetIsArray && isIntegerKey(key) ? res : res.value;
|
|
891
|
+
}
|
|
892
|
+
if (isObject(res)) {
|
|
893
|
+
return isReadonly2 ? readonly(res) : reactive(res);
|
|
894
|
+
}
|
|
895
|
+
return res;
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
class MutableReactiveHandler extends BaseReactiveHandler {
|
|
899
|
+
constructor() {
|
|
900
|
+
let isShallow2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
901
|
+
super(false, isShallow2);
|
|
902
|
+
}
|
|
903
|
+
set(target, key, value, receiver) {
|
|
904
|
+
let oldValue = target[key];
|
|
905
|
+
if (!this._isShallow) {
|
|
906
|
+
const isOldValueReadonly = isReadonly(oldValue);
|
|
907
|
+
if (!isShallow(value) && !isReadonly(value)) {
|
|
908
|
+
oldValue = toRaw(oldValue);
|
|
909
|
+
value = toRaw(value);
|
|
910
|
+
}
|
|
911
|
+
if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
|
|
912
|
+
if (isOldValueReadonly) {
|
|
913
|
+
return false;
|
|
914
|
+
} else {
|
|
915
|
+
oldValue.value = value;
|
|
916
|
+
return true;
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
|
|
921
|
+
const result = Reflect.set(target, key, value, isRef(target) ? target : receiver);
|
|
922
|
+
if (target === toRaw(receiver)) {
|
|
923
|
+
if (!hadKey) {
|
|
924
|
+
trigger(target, "add", key, value);
|
|
925
|
+
} else if (hasChanged(value, oldValue)) {
|
|
926
|
+
trigger(target, "set", key, value, oldValue);
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
return result;
|
|
930
|
+
}
|
|
931
|
+
deleteProperty(target, key) {
|
|
932
|
+
const hadKey = hasOwn(target, key);
|
|
933
|
+
const oldValue = target[key];
|
|
934
|
+
const result = Reflect.deleteProperty(target, key);
|
|
935
|
+
if (result && hadKey) {
|
|
936
|
+
trigger(target, "delete", key, void 0, oldValue);
|
|
937
|
+
}
|
|
938
|
+
return result;
|
|
939
|
+
}
|
|
940
|
+
has(target, key) {
|
|
941
|
+
const result = Reflect.has(target, key);
|
|
942
|
+
if (!isSymbol(key) || !builtInSymbols.has(key)) {
|
|
943
|
+
track(target, "has", key);
|
|
944
|
+
}
|
|
945
|
+
return result;
|
|
946
|
+
}
|
|
947
|
+
ownKeys(target) {
|
|
948
|
+
track(target, "iterate", isArray(target) ? "length" : ITERATE_KEY);
|
|
949
|
+
return Reflect.ownKeys(target);
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
class ReadonlyReactiveHandler extends BaseReactiveHandler {
|
|
953
|
+
constructor() {
|
|
954
|
+
let isShallow2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
955
|
+
super(true, isShallow2);
|
|
956
|
+
}
|
|
957
|
+
set(target, key) {
|
|
958
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
959
|
+
warn(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
|
|
960
|
+
}
|
|
961
|
+
return true;
|
|
962
|
+
}
|
|
963
|
+
deleteProperty(target, key) {
|
|
964
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
965
|
+
warn(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
|
|
966
|
+
}
|
|
967
|
+
return true;
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
const mutableHandlers = /* @__PURE__ */new MutableReactiveHandler();
|
|
971
|
+
const readonlyHandlers = /* @__PURE__ */new ReadonlyReactiveHandler();
|
|
972
|
+
const shallowReadonlyHandlers = /* @__PURE__ */new ReadonlyReactiveHandler(true);
|
|
973
|
+
const toShallow = value => value;
|
|
974
|
+
const getProto = v => Reflect.getPrototypeOf(v);
|
|
975
|
+
function get(target, key) {
|
|
976
|
+
let isReadonly2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
977
|
+
let isShallow2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
978
|
+
target = target["__v_raw"];
|
|
979
|
+
const rawTarget = toRaw(target);
|
|
980
|
+
const rawKey = toRaw(key);
|
|
981
|
+
if (!isReadonly2) {
|
|
982
|
+
if (hasChanged(key, rawKey)) {
|
|
983
|
+
track(rawTarget, "get", key);
|
|
984
|
+
}
|
|
985
|
+
track(rawTarget, "get", rawKey);
|
|
986
|
+
}
|
|
987
|
+
const {
|
|
988
|
+
has: has2
|
|
989
|
+
} = getProto(rawTarget);
|
|
990
|
+
const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
|
|
991
|
+
if (has2.call(rawTarget, key)) {
|
|
992
|
+
return wrap(target.get(key));
|
|
993
|
+
} else if (has2.call(rawTarget, rawKey)) {
|
|
994
|
+
return wrap(target.get(rawKey));
|
|
995
|
+
} else if (target !== rawTarget) {
|
|
996
|
+
target.get(key);
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
function has(key) {
|
|
1000
|
+
let isReadonly2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
1001
|
+
const target = this["__v_raw"];
|
|
1002
|
+
const rawTarget = toRaw(target);
|
|
1003
|
+
const rawKey = toRaw(key);
|
|
1004
|
+
if (!isReadonly2) {
|
|
1005
|
+
if (hasChanged(key, rawKey)) {
|
|
1006
|
+
track(rawTarget, "has", key);
|
|
1007
|
+
}
|
|
1008
|
+
track(rawTarget, "has", rawKey);
|
|
1009
|
+
}
|
|
1010
|
+
return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
|
|
1011
|
+
}
|
|
1012
|
+
function size(target) {
|
|
1013
|
+
let isReadonly2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
1014
|
+
target = target["__v_raw"];
|
|
1015
|
+
!isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
|
|
1016
|
+
return Reflect.get(target, "size", target);
|
|
1017
|
+
}
|
|
1018
|
+
function add(value) {
|
|
1019
|
+
let _isShallow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
1020
|
+
if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
|
|
1021
|
+
value = toRaw(value);
|
|
1022
|
+
}
|
|
1023
|
+
const target = toRaw(this);
|
|
1024
|
+
const proto = getProto(target);
|
|
1025
|
+
const hadKey = proto.has.call(target, value);
|
|
1026
|
+
if (!hadKey) {
|
|
1027
|
+
target.add(value);
|
|
1028
|
+
trigger(target, "add", value, value);
|
|
1029
|
+
}
|
|
1030
|
+
return this;
|
|
1031
|
+
}
|
|
1032
|
+
function set(key, value) {
|
|
1033
|
+
let _isShallow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
1034
|
+
if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
|
|
1035
|
+
value = toRaw(value);
|
|
1036
|
+
}
|
|
1037
|
+
const target = toRaw(this);
|
|
1038
|
+
const {
|
|
1039
|
+
has: has2,
|
|
1040
|
+
get: get2
|
|
1041
|
+
} = getProto(target);
|
|
1042
|
+
let hadKey = has2.call(target, key);
|
|
1043
|
+
if (!hadKey) {
|
|
1044
|
+
key = toRaw(key);
|
|
1045
|
+
hadKey = has2.call(target, key);
|
|
1046
|
+
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
1047
|
+
checkIdentityKeys(target, has2, key);
|
|
1048
|
+
}
|
|
1049
|
+
const oldValue = get2.call(target, key);
|
|
1050
|
+
target.set(key, value);
|
|
1051
|
+
if (!hadKey) {
|
|
1052
|
+
trigger(target, "add", key, value);
|
|
1053
|
+
} else if (hasChanged(value, oldValue)) {
|
|
1054
|
+
trigger(target, "set", key, value, oldValue);
|
|
1055
|
+
}
|
|
1056
|
+
return this;
|
|
1057
|
+
}
|
|
1058
|
+
function deleteEntry(key) {
|
|
1059
|
+
const target = toRaw(this);
|
|
1060
|
+
const {
|
|
1061
|
+
has: has2,
|
|
1062
|
+
get: get2
|
|
1063
|
+
} = getProto(target);
|
|
1064
|
+
let hadKey = has2.call(target, key);
|
|
1065
|
+
if (!hadKey) {
|
|
1066
|
+
key = toRaw(key);
|
|
1067
|
+
hadKey = has2.call(target, key);
|
|
1068
|
+
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
1069
|
+
checkIdentityKeys(target, has2, key);
|
|
1070
|
+
}
|
|
1071
|
+
const oldValue = get2 ? get2.call(target, key) : void 0;
|
|
1072
|
+
const result = target.delete(key);
|
|
1073
|
+
if (hadKey) {
|
|
1074
|
+
trigger(target, "delete", key, void 0, oldValue);
|
|
1075
|
+
}
|
|
1076
|
+
return result;
|
|
1077
|
+
}
|
|
1078
|
+
function clear() {
|
|
1079
|
+
const target = toRaw(this);
|
|
1080
|
+
const hadItems = target.size !== 0;
|
|
1081
|
+
const oldTarget = !!(process.env.NODE_ENV !== "production") ? isMap(target) ? new Map(target) : new Set(target) : void 0;
|
|
1082
|
+
const result = target.clear();
|
|
1083
|
+
if (hadItems) {
|
|
1084
|
+
trigger(target, "clear", void 0, void 0, oldTarget);
|
|
1085
|
+
}
|
|
1086
|
+
return result;
|
|
1087
|
+
}
|
|
1088
|
+
function createForEach(isReadonly2, isShallow2) {
|
|
1089
|
+
return function forEach(callback, thisArg) {
|
|
1090
|
+
const observed = this;
|
|
1091
|
+
const target = observed["__v_raw"];
|
|
1092
|
+
const rawTarget = toRaw(target);
|
|
1093
|
+
const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
|
|
1094
|
+
!isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
|
|
1095
|
+
return target.forEach((value, key) => {
|
|
1096
|
+
return callback.call(thisArg, wrap(value), wrap(key), observed);
|
|
1097
|
+
});
|
|
1098
|
+
};
|
|
1099
|
+
}
|
|
1100
|
+
function createIterableMethod(method, isReadonly2, isShallow2) {
|
|
1101
|
+
return function () {
|
|
1102
|
+
const target = this["__v_raw"];
|
|
1103
|
+
const rawTarget = toRaw(target);
|
|
1104
|
+
const targetIsMap = isMap(rawTarget);
|
|
1105
|
+
const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
|
|
1106
|
+
const isKeyOnly = method === "keys" && targetIsMap;
|
|
1107
|
+
const innerIterator = target[method](...arguments);
|
|
1108
|
+
const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
|
|
1109
|
+
!isReadonly2 && track(rawTarget, "iterate", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);
|
|
1110
|
+
return {
|
|
1111
|
+
// iterator protocol
|
|
1112
|
+
next() {
|
|
1113
|
+
const {
|
|
1114
|
+
value,
|
|
1115
|
+
done
|
|
1116
|
+
} = innerIterator.next();
|
|
1117
|
+
return done ? {
|
|
1118
|
+
value,
|
|
1119
|
+
done
|
|
1120
|
+
} : {
|
|
1121
|
+
value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
|
|
1122
|
+
done
|
|
1123
|
+
};
|
|
1124
|
+
},
|
|
1125
|
+
// iterable protocol
|
|
1126
|
+
[Symbol.iterator]() {
|
|
1127
|
+
return this;
|
|
1128
|
+
}
|
|
1129
|
+
};
|
|
1130
|
+
};
|
|
1131
|
+
}
|
|
1132
|
+
function createReadonlyMethod(type) {
|
|
1133
|
+
return function () {
|
|
1134
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1135
|
+
const key = (arguments.length <= 0 ? undefined : arguments[0]) ? `on key "${arguments.length <= 0 ? undefined : arguments[0]}" ` : ``;
|
|
1136
|
+
warn(`${capitalize(type)} operation ${key}failed: target is readonly.`, toRaw(this));
|
|
1137
|
+
}
|
|
1138
|
+
return type === "delete" ? false : type === "clear" ? void 0 : this;
|
|
1139
|
+
};
|
|
1140
|
+
}
|
|
1141
|
+
function createInstrumentations() {
|
|
1142
|
+
const mutableInstrumentations2 = {
|
|
1143
|
+
get(key) {
|
|
1144
|
+
return get(this, key);
|
|
1145
|
+
},
|
|
1146
|
+
get size() {
|
|
1147
|
+
return size(this);
|
|
1148
|
+
},
|
|
1149
|
+
has,
|
|
1150
|
+
add,
|
|
1151
|
+
set,
|
|
1152
|
+
delete: deleteEntry,
|
|
1153
|
+
clear,
|
|
1154
|
+
forEach: createForEach(false, false)
|
|
1155
|
+
};
|
|
1156
|
+
const shallowInstrumentations2 = {
|
|
1157
|
+
get(key) {
|
|
1158
|
+
return get(this, key, false, true);
|
|
1159
|
+
},
|
|
1160
|
+
get size() {
|
|
1161
|
+
return size(this);
|
|
1162
|
+
},
|
|
1163
|
+
has,
|
|
1164
|
+
add(value) {
|
|
1165
|
+
return add.call(this, value, true);
|
|
1166
|
+
},
|
|
1167
|
+
set(key, value) {
|
|
1168
|
+
return set.call(this, key, value, true);
|
|
1169
|
+
},
|
|
1170
|
+
delete: deleteEntry,
|
|
1171
|
+
clear,
|
|
1172
|
+
forEach: createForEach(false, true)
|
|
1173
|
+
};
|
|
1174
|
+
const readonlyInstrumentations2 = {
|
|
1175
|
+
get(key) {
|
|
1176
|
+
return get(this, key, true);
|
|
1177
|
+
},
|
|
1178
|
+
get size() {
|
|
1179
|
+
return size(this, true);
|
|
1180
|
+
},
|
|
1181
|
+
has(key) {
|
|
1182
|
+
return has.call(this, key, true);
|
|
1183
|
+
},
|
|
1184
|
+
add: createReadonlyMethod("add"),
|
|
1185
|
+
set: createReadonlyMethod("set"),
|
|
1186
|
+
delete: createReadonlyMethod("delete"),
|
|
1187
|
+
clear: createReadonlyMethod("clear"),
|
|
1188
|
+
forEach: createForEach(true, false)
|
|
1189
|
+
};
|
|
1190
|
+
const shallowReadonlyInstrumentations2 = {
|
|
1191
|
+
get(key) {
|
|
1192
|
+
return get(this, key, true, true);
|
|
1193
|
+
},
|
|
1194
|
+
get size() {
|
|
1195
|
+
return size(this, true);
|
|
1196
|
+
},
|
|
1197
|
+
has(key) {
|
|
1198
|
+
return has.call(this, key, true);
|
|
1199
|
+
},
|
|
1200
|
+
add: createReadonlyMethod("add"),
|
|
1201
|
+
set: createReadonlyMethod("set"),
|
|
1202
|
+
delete: createReadonlyMethod("delete"),
|
|
1203
|
+
clear: createReadonlyMethod("clear"),
|
|
1204
|
+
forEach: createForEach(true, true)
|
|
1205
|
+
};
|
|
1206
|
+
const iteratorMethods = ["keys", "values", "entries", Symbol.iterator];
|
|
1207
|
+
iteratorMethods.forEach(method => {
|
|
1208
|
+
mutableInstrumentations2[method] = createIterableMethod(method, false, false);
|
|
1209
|
+
readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
|
|
1210
|
+
shallowInstrumentations2[method] = createIterableMethod(method, false, true);
|
|
1211
|
+
shallowReadonlyInstrumentations2[method] = createIterableMethod(method, true, true);
|
|
1212
|
+
});
|
|
1213
|
+
return [mutableInstrumentations2, readonlyInstrumentations2, shallowInstrumentations2, shallowReadonlyInstrumentations2];
|
|
1214
|
+
}
|
|
1215
|
+
const [mutableInstrumentations, readonlyInstrumentations, shallowInstrumentations, shallowReadonlyInstrumentations] = /* @__PURE__ */createInstrumentations();
|
|
1216
|
+
function createInstrumentationGetter(isReadonly2, shallow) {
|
|
1217
|
+
const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
|
|
1218
|
+
return (target, key, receiver) => {
|
|
1219
|
+
if (key === "__v_isReactive") {
|
|
1220
|
+
return !isReadonly2;
|
|
1221
|
+
} else if (key === "__v_isReadonly") {
|
|
1222
|
+
return isReadonly2;
|
|
1223
|
+
} else if (key === "__v_raw") {
|
|
1224
|
+
return target;
|
|
1225
|
+
}
|
|
1226
|
+
return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
|
|
1227
|
+
};
|
|
1228
|
+
}
|
|
1229
|
+
const mutableCollectionHandlers = {
|
|
1230
|
+
get: /* @__PURE__ */createInstrumentationGetter(false, false)
|
|
1231
|
+
};
|
|
1232
|
+
const readonlyCollectionHandlers = {
|
|
1233
|
+
get: /* @__PURE__ */createInstrumentationGetter(true, false)
|
|
1234
|
+
};
|
|
1235
|
+
const shallowReadonlyCollectionHandlers = {
|
|
1236
|
+
get: /* @__PURE__ */createInstrumentationGetter(true, true)
|
|
1237
|
+
};
|
|
1238
|
+
function checkIdentityKeys(target, has2, key) {
|
|
1239
|
+
const rawKey = toRaw(key);
|
|
1240
|
+
if (rawKey !== key && has2.call(target, rawKey)) {
|
|
1241
|
+
const type = toRawType(target);
|
|
1242
|
+
warn(`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.`);
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
const reactiveMap = /* @__PURE__ */new WeakMap();
|
|
1246
|
+
const shallowReactiveMap = /* @__PURE__ */new WeakMap();
|
|
1247
|
+
const readonlyMap = /* @__PURE__ */new WeakMap();
|
|
1248
|
+
const shallowReadonlyMap = /* @__PURE__ */new WeakMap();
|
|
1249
|
+
function targetTypeMap(rawType) {
|
|
1250
|
+
switch (rawType) {
|
|
1251
|
+
case "Object":
|
|
1252
|
+
case "Array":
|
|
1253
|
+
return 1 /* COMMON */;
|
|
1254
|
+
case "Map":
|
|
1255
|
+
case "Set":
|
|
1256
|
+
case "WeakMap":
|
|
1257
|
+
case "WeakSet":
|
|
1258
|
+
return 2 /* COLLECTION */;
|
|
1259
|
+
default:
|
|
1260
|
+
return 0 /* INVALID */;
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
function getTargetType(value) {
|
|
1265
|
+
return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value));
|
|
1266
|
+
}
|
|
1267
|
+
function reactive(target) {
|
|
1268
|
+
if (isReadonly(target)) {
|
|
1269
|
+
return target;
|
|
1270
|
+
}
|
|
1271
|
+
return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
|
|
1272
|
+
}
|
|
1273
|
+
function readonly(target) {
|
|
1274
|
+
return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);
|
|
1275
|
+
}
|
|
1276
|
+
function shallowReadonly(target) {
|
|
1277
|
+
return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);
|
|
1278
|
+
}
|
|
1279
|
+
function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
|
|
1280
|
+
if (!isObject(target)) {
|
|
1281
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1282
|
+
warn(`value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String(target)}`);
|
|
1283
|
+
}
|
|
1284
|
+
return target;
|
|
1285
|
+
}
|
|
1286
|
+
if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
|
|
1287
|
+
return target;
|
|
1288
|
+
}
|
|
1289
|
+
const existingProxy = proxyMap.get(target);
|
|
1290
|
+
if (existingProxy) {
|
|
1291
|
+
return existingProxy;
|
|
1292
|
+
}
|
|
1293
|
+
const targetType = getTargetType(target);
|
|
1294
|
+
if (targetType === 0 /* INVALID */) {
|
|
1295
|
+
return target;
|
|
1296
|
+
}
|
|
1297
|
+
const proxy = new Proxy(target, targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers);
|
|
1298
|
+
proxyMap.set(target, proxy);
|
|
1299
|
+
return proxy;
|
|
1300
|
+
}
|
|
1301
|
+
function isReactive(value) {
|
|
1302
|
+
if (isReadonly(value)) {
|
|
1303
|
+
return isReactive(value["__v_raw"]);
|
|
1304
|
+
}
|
|
1305
|
+
return !!(value && value["__v_isReactive"]);
|
|
1306
|
+
}
|
|
1307
|
+
function isReadonly(value) {
|
|
1308
|
+
return !!(value && value["__v_isReadonly"]);
|
|
1309
|
+
}
|
|
1310
|
+
function isShallow(value) {
|
|
1311
|
+
return !!(value && value["__v_isShallow"]);
|
|
1312
|
+
}
|
|
1313
|
+
function isProxy(value) {
|
|
1314
|
+
return value ? !!value["__v_raw"] : false;
|
|
1315
|
+
}
|
|
1316
|
+
function toRaw(observed) {
|
|
1317
|
+
const raw = observed && observed["__v_raw"];
|
|
1318
|
+
return raw ? toRaw(raw) : observed;
|
|
1319
|
+
}
|
|
1320
|
+
function markRaw(value) {
|
|
1321
|
+
if (Object.isExtensible(value)) {
|
|
1322
|
+
def(value, "__v_skip", true);
|
|
1323
|
+
}
|
|
1324
|
+
return value;
|
|
1325
|
+
}
|
|
1326
|
+
const toReactive = value => isObject(value) ? reactive(value) : value;
|
|
1327
|
+
const toReadonly = value => isObject(value) ? readonly(value) : value;
|
|
1328
|
+
function isRef(r) {
|
|
1329
|
+
return r ? r["__v_isRef"] === true : false;
|
|
1330
|
+
}
|
|
1331
|
+
function ref(value) {
|
|
1332
|
+
return createRef(value, false);
|
|
1333
|
+
}
|
|
1334
|
+
function shallowRef(value) {
|
|
1335
|
+
return createRef(value, true);
|
|
1336
|
+
}
|
|
1337
|
+
function createRef(rawValue, shallow) {
|
|
1338
|
+
if (isRef(rawValue)) {
|
|
1339
|
+
return rawValue;
|
|
1340
|
+
}
|
|
1341
|
+
return new RefImpl(rawValue, shallow);
|
|
1342
|
+
}
|
|
1343
|
+
class RefImpl {
|
|
1344
|
+
constructor(value, isShallow2) {
|
|
1345
|
+
this.dep = new Dep();
|
|
1346
|
+
this["__v_isRef"] = true;
|
|
1347
|
+
this["__v_isShallow"] = false;
|
|
1348
|
+
this._rawValue = isShallow2 ? value : toRaw(value);
|
|
1349
|
+
this._value = isShallow2 ? value : toReactive(value);
|
|
1350
|
+
this["__v_isShallow"] = isShallow2;
|
|
1351
|
+
}
|
|
1352
|
+
get value() {
|
|
1353
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1354
|
+
this.dep.track({
|
|
1355
|
+
target: this,
|
|
1356
|
+
type: "get",
|
|
1357
|
+
key: "value"
|
|
1358
|
+
});
|
|
1359
|
+
} else {
|
|
1360
|
+
this.dep.track();
|
|
1361
|
+
}
|
|
1362
|
+
return this._value;
|
|
1363
|
+
}
|
|
1364
|
+
set value(newValue) {
|
|
1365
|
+
const oldValue = this._rawValue;
|
|
1366
|
+
const useDirectValue = this["__v_isShallow"] || isShallow(newValue) || isReadonly(newValue);
|
|
1367
|
+
newValue = useDirectValue ? newValue : toRaw(newValue);
|
|
1368
|
+
if (hasChanged(newValue, oldValue)) {
|
|
1369
|
+
this._rawValue = newValue;
|
|
1370
|
+
this._value = useDirectValue ? newValue : toReactive(newValue);
|
|
1371
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1372
|
+
this.dep.trigger({
|
|
1373
|
+
target: this,
|
|
1374
|
+
type: "set",
|
|
1375
|
+
key: "value",
|
|
1376
|
+
newValue,
|
|
1377
|
+
oldValue
|
|
1378
|
+
});
|
|
1379
|
+
} else {
|
|
1380
|
+
this.dep.trigger();
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1384
|
+
}
|
|
1385
|
+
function unref(ref2) {
|
|
1386
|
+
return isRef(ref2) ? ref2.value : ref2;
|
|
1387
|
+
}
|
|
1388
|
+
const shallowUnwrapHandlers = {
|
|
1389
|
+
get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
|
|
1390
|
+
set: (target, key, value, receiver) => {
|
|
1391
|
+
const oldValue = target[key];
|
|
1392
|
+
if (isRef(oldValue) && !isRef(value)) {
|
|
1393
|
+
oldValue.value = value;
|
|
1394
|
+
return true;
|
|
1395
|
+
} else {
|
|
1396
|
+
return Reflect.set(target, key, value, receiver);
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
};
|
|
1400
|
+
function proxyRefs(objectWithRefs) {
|
|
1401
|
+
return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
|
|
1402
|
+
}
|
|
1403
|
+
class ComputedRefImpl {
|
|
1404
|
+
constructor(fn, setter, isSSR) {
|
|
1405
|
+
this.fn = fn;
|
|
1406
|
+
this.setter = setter;
|
|
1407
|
+
/**
|
|
1408
|
+
* @internal
|
|
1409
|
+
*/
|
|
1410
|
+
this._value = void 0;
|
|
1411
|
+
/**
|
|
1412
|
+
* @internal
|
|
1413
|
+
*/
|
|
1414
|
+
this.dep = new Dep(this);
|
|
1415
|
+
/**
|
|
1416
|
+
* @internal
|
|
1417
|
+
*/
|
|
1418
|
+
this.__v_isRef = true;
|
|
1419
|
+
// TODO isolatedDeclarations "__v_isReadonly"
|
|
1420
|
+
// A computed is also a subscriber that tracks other deps
|
|
1421
|
+
/**
|
|
1422
|
+
* @internal
|
|
1423
|
+
*/
|
|
1424
|
+
this.deps = void 0;
|
|
1425
|
+
/**
|
|
1426
|
+
* @internal
|
|
1427
|
+
*/
|
|
1428
|
+
this.depsTail = void 0;
|
|
1429
|
+
/**
|
|
1430
|
+
* @internal
|
|
1431
|
+
*/
|
|
1432
|
+
this.flags = 16;
|
|
1433
|
+
/**
|
|
1434
|
+
* @internal
|
|
1435
|
+
*/
|
|
1436
|
+
this.globalVersion = globalVersion - 1;
|
|
1437
|
+
// for backwards compat
|
|
1438
|
+
this.effect = this;
|
|
1439
|
+
this["__v_isReadonly"] = !setter;
|
|
1440
|
+
this.isSSR = isSSR;
|
|
1441
|
+
}
|
|
1442
|
+
/**
|
|
1443
|
+
* @internal
|
|
1444
|
+
*/
|
|
1445
|
+
notify() {
|
|
1446
|
+
if (activeSub !== this) {
|
|
1447
|
+
this.flags |= 16;
|
|
1448
|
+
this.dep.notify();
|
|
1449
|
+
} else if (!!(process.env.NODE_ENV !== "production")) ;
|
|
1450
|
+
}
|
|
1451
|
+
get value() {
|
|
1452
|
+
const link = !!(process.env.NODE_ENV !== "production") ? this.dep.track({
|
|
1453
|
+
target: this,
|
|
1454
|
+
type: "get",
|
|
1455
|
+
key: "value"
|
|
1456
|
+
}) : this.dep.track();
|
|
1457
|
+
refreshComputed(this);
|
|
1458
|
+
if (link) {
|
|
1459
|
+
link.version = this.dep.version;
|
|
1460
|
+
}
|
|
1461
|
+
return this._value;
|
|
1462
|
+
}
|
|
1463
|
+
set value(newValue) {
|
|
1464
|
+
if (this.setter) {
|
|
1465
|
+
this.setter(newValue);
|
|
1466
|
+
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
1467
|
+
warn("Write operation failed: computed value is readonly");
|
|
1468
|
+
}
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
function computed$1(getterOrOptions, debugOptions) {
|
|
1472
|
+
let isSSR = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
1473
|
+
let getter;
|
|
1474
|
+
let setter;
|
|
1475
|
+
if (isFunction$2(getterOrOptions)) {
|
|
1476
|
+
getter = getterOrOptions;
|
|
1477
|
+
} else {
|
|
1478
|
+
getter = getterOrOptions.get;
|
|
1479
|
+
setter = getterOrOptions.set;
|
|
1480
|
+
}
|
|
1481
|
+
const cRef = new ComputedRefImpl(getter, setter, isSSR);
|
|
1482
|
+
if (!!(process.env.NODE_ENV !== "production") && debugOptions && !isSSR) {
|
|
1483
|
+
cRef.onTrack = debugOptions.onTrack;
|
|
1484
|
+
cRef.onTrigger = debugOptions.onTrigger;
|
|
1485
|
+
}
|
|
1486
|
+
return cRef;
|
|
1487
|
+
}
|
|
1488
|
+
const INITIAL_WATCHER_VALUE = {};
|
|
1489
|
+
const cleanupMap = /* @__PURE__ */new WeakMap();
|
|
1490
|
+
let activeWatcher = void 0;
|
|
1491
|
+
function onWatcherCleanup(cleanupFn) {
|
|
1492
|
+
let failSilently = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
1493
|
+
let owner = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : activeWatcher;
|
|
1494
|
+
if (owner) {
|
|
1495
|
+
let cleanups = cleanupMap.get(owner);
|
|
1496
|
+
if (!cleanups) cleanupMap.set(owner, cleanups = []);
|
|
1497
|
+
cleanups.push(cleanupFn);
|
|
1498
|
+
} else if (!!(process.env.NODE_ENV !== "production") && !failSilently) {
|
|
1499
|
+
warn(`onWatcherCleanup() was called when there was no active watcher to associate with.`);
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
function watch$1(source, cb) {
|
|
1503
|
+
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : EMPTY_OBJ;
|
|
1504
|
+
const {
|
|
1505
|
+
immediate,
|
|
1506
|
+
deep,
|
|
1507
|
+
once,
|
|
1508
|
+
scheduler,
|
|
1509
|
+
augmentJob,
|
|
1510
|
+
call
|
|
1511
|
+
} = options;
|
|
1512
|
+
const warnInvalidSource = s => {
|
|
1513
|
+
(options.onWarn || warn)(`Invalid watch source: `, s, `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`);
|
|
1514
|
+
};
|
|
1515
|
+
const reactiveGetter = source2 => {
|
|
1516
|
+
if (deep) return source2;
|
|
1517
|
+
if (isShallow(source2) || deep === false || deep === 0) return traverse(source2, 1);
|
|
1518
|
+
return traverse(source2);
|
|
1519
|
+
};
|
|
1520
|
+
let effect;
|
|
1521
|
+
let getter;
|
|
1522
|
+
let cleanup;
|
|
1523
|
+
let boundCleanup;
|
|
1524
|
+
let forceTrigger = false;
|
|
1525
|
+
let isMultiSource = false;
|
|
1526
|
+
if (isRef(source)) {
|
|
1527
|
+
getter = () => source.value;
|
|
1528
|
+
forceTrigger = isShallow(source);
|
|
1529
|
+
} else if (isReactive(source)) {
|
|
1530
|
+
getter = () => reactiveGetter(source);
|
|
1531
|
+
forceTrigger = true;
|
|
1532
|
+
} else if (isArray(source)) {
|
|
1533
|
+
isMultiSource = true;
|
|
1534
|
+
forceTrigger = source.some(s => isReactive(s) || isShallow(s));
|
|
1535
|
+
getter = () => source.map(s => {
|
|
1536
|
+
if (isRef(s)) {
|
|
1537
|
+
return s.value;
|
|
1538
|
+
} else if (isReactive(s)) {
|
|
1539
|
+
return reactiveGetter(s);
|
|
1540
|
+
} else if (isFunction$2(s)) {
|
|
1541
|
+
return call ? call(s, 2) : s();
|
|
1542
|
+
} else {
|
|
1543
|
+
!!(process.env.NODE_ENV !== "production") && warnInvalidSource(s);
|
|
1544
|
+
}
|
|
1545
|
+
});
|
|
1546
|
+
} else if (isFunction$2(source)) {
|
|
1547
|
+
if (cb) {
|
|
1548
|
+
getter = call ? () => call(source, 2) : source;
|
|
1549
|
+
} else {
|
|
1550
|
+
getter = () => {
|
|
1551
|
+
if (cleanup) {
|
|
1552
|
+
pauseTracking();
|
|
1553
|
+
try {
|
|
1554
|
+
cleanup();
|
|
1555
|
+
} finally {
|
|
1556
|
+
resetTracking();
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
const currentEffect = activeWatcher;
|
|
1560
|
+
activeWatcher = effect;
|
|
1561
|
+
try {
|
|
1562
|
+
return call ? call(source, 3, [boundCleanup]) : source(boundCleanup);
|
|
1563
|
+
} finally {
|
|
1564
|
+
activeWatcher = currentEffect;
|
|
1565
|
+
}
|
|
1566
|
+
};
|
|
1567
|
+
}
|
|
1568
|
+
} else {
|
|
1569
|
+
getter = NOOP;
|
|
1570
|
+
!!(process.env.NODE_ENV !== "production") && warnInvalidSource(source);
|
|
1571
|
+
}
|
|
1572
|
+
if (cb && deep) {
|
|
1573
|
+
const baseGetter = getter;
|
|
1574
|
+
const depth = deep === true ? Infinity : deep;
|
|
1575
|
+
getter = () => traverse(baseGetter(), depth);
|
|
1576
|
+
}
|
|
1577
|
+
const watchHandle = () => {
|
|
1578
|
+
effect.stop();
|
|
1579
|
+
};
|
|
1580
|
+
if (once) {
|
|
1581
|
+
if (cb) {
|
|
1582
|
+
const _cb = cb;
|
|
1583
|
+
cb = function () {
|
|
1584
|
+
_cb(...arguments);
|
|
1585
|
+
watchHandle();
|
|
1586
|
+
};
|
|
1587
|
+
} else {
|
|
1588
|
+
const _getter = getter;
|
|
1589
|
+
getter = () => {
|
|
1590
|
+
_getter();
|
|
1591
|
+
watchHandle();
|
|
1592
|
+
};
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1595
|
+
let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
|
|
1596
|
+
const job = immediateFirstRun => {
|
|
1597
|
+
if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) {
|
|
1598
|
+
return;
|
|
1599
|
+
}
|
|
1600
|
+
if (cb) {
|
|
1601
|
+
const newValue = effect.run();
|
|
1602
|
+
if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
|
|
1603
|
+
if (cleanup) {
|
|
1604
|
+
cleanup();
|
|
1605
|
+
}
|
|
1606
|
+
const currentWatcher = activeWatcher;
|
|
1607
|
+
activeWatcher = effect;
|
|
1608
|
+
try {
|
|
1609
|
+
const args = [newValue,
|
|
1610
|
+
// pass undefined as the old value when it's changed for the first time
|
|
1611
|
+
oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue, boundCleanup];
|
|
1612
|
+
call ? call(cb, 3, args) :
|
|
1613
|
+
// @ts-expect-error
|
|
1614
|
+
cb(...args);
|
|
1615
|
+
oldValue = newValue;
|
|
1616
|
+
} finally {
|
|
1617
|
+
activeWatcher = currentWatcher;
|
|
1618
|
+
}
|
|
1619
|
+
}
|
|
1620
|
+
} else {
|
|
1621
|
+
effect.run();
|
|
1622
|
+
}
|
|
1623
|
+
};
|
|
1624
|
+
if (augmentJob) {
|
|
1625
|
+
augmentJob(job);
|
|
1626
|
+
}
|
|
1627
|
+
effect = new ReactiveEffect(getter);
|
|
1628
|
+
effect.scheduler = scheduler ? () => scheduler(job, false) : job;
|
|
1629
|
+
boundCleanup = fn => onWatcherCleanup(fn, false, effect);
|
|
1630
|
+
cleanup = effect.onStop = () => {
|
|
1631
|
+
const cleanups = cleanupMap.get(effect);
|
|
1632
|
+
if (cleanups) {
|
|
1633
|
+
if (call) {
|
|
1634
|
+
call(cleanups, 4);
|
|
1635
|
+
} else {
|
|
1636
|
+
for (const cleanup2 of cleanups) cleanup2();
|
|
1637
|
+
}
|
|
1638
|
+
cleanupMap.delete(effect);
|
|
1639
|
+
}
|
|
1640
|
+
};
|
|
1641
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1642
|
+
effect.onTrack = options.onTrack;
|
|
1643
|
+
effect.onTrigger = options.onTrigger;
|
|
1644
|
+
}
|
|
1645
|
+
if (cb) {
|
|
1646
|
+
if (immediate) {
|
|
1647
|
+
job(true);
|
|
1648
|
+
} else {
|
|
1649
|
+
oldValue = effect.run();
|
|
1650
|
+
}
|
|
1651
|
+
} else if (scheduler) {
|
|
1652
|
+
scheduler(job.bind(null, true), true);
|
|
1653
|
+
} else {
|
|
1654
|
+
effect.run();
|
|
1655
|
+
}
|
|
1656
|
+
watchHandle.pause = effect.pause.bind(effect);
|
|
1657
|
+
watchHandle.resume = effect.resume.bind(effect);
|
|
1658
|
+
watchHandle.stop = watchHandle;
|
|
1659
|
+
return watchHandle;
|
|
1660
|
+
}
|
|
1661
|
+
function traverse(value) {
|
|
1662
|
+
let depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;
|
|
1663
|
+
let seen = arguments.length > 2 ? arguments[2] : undefined;
|
|
1664
|
+
if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
|
|
1665
|
+
return value;
|
|
1666
|
+
}
|
|
1667
|
+
seen = seen || /* @__PURE__ */new Set();
|
|
1668
|
+
if (seen.has(value)) {
|
|
1669
|
+
return value;
|
|
1670
|
+
}
|
|
1671
|
+
seen.add(value);
|
|
1672
|
+
depth--;
|
|
1673
|
+
if (isRef(value)) {
|
|
1674
|
+
traverse(value.value, depth, seen);
|
|
1675
|
+
} else if (isArray(value)) {
|
|
1676
|
+
for (let i = 0; i < value.length; i++) {
|
|
1677
|
+
traverse(value[i], depth, seen);
|
|
1678
|
+
}
|
|
1679
|
+
} else if (isSet(value) || isMap(value)) {
|
|
1680
|
+
value.forEach(v => {
|
|
1681
|
+
traverse(v, depth, seen);
|
|
1682
|
+
});
|
|
1683
|
+
} else if (isPlainObject(value)) {
|
|
1684
|
+
for (const key in value) {
|
|
1685
|
+
traverse(value[key], depth, seen);
|
|
1686
|
+
}
|
|
1687
|
+
for (const key of Object.getOwnPropertySymbols(value)) {
|
|
1688
|
+
if (Object.prototype.propertyIsEnumerable.call(value, key)) {
|
|
1689
|
+
traverse(value[key], depth, seen);
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
}
|
|
1693
|
+
return value;
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1696
|
+
/**
|
|
1697
|
+
* @vue/runtime-core v3.5.0
|
|
1698
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
1699
|
+
* @license MIT
|
|
1700
|
+
**/
|
|
1701
|
+
const stack = [];
|
|
1702
|
+
function pushWarningContext(vnode) {
|
|
1703
|
+
stack.push(vnode);
|
|
1704
|
+
}
|
|
1705
|
+
function popWarningContext() {
|
|
1706
|
+
stack.pop();
|
|
1707
|
+
}
|
|
1708
|
+
let isWarning = false;
|
|
1709
|
+
function warn$1(msg) {
|
|
1710
|
+
if (isWarning) return;
|
|
1711
|
+
isWarning = true;
|
|
1712
|
+
pauseTracking();
|
|
1713
|
+
const instance = stack.length ? stack[stack.length - 1].component : null;
|
|
1714
|
+
const appWarnHandler = instance && instance.appContext.config.warnHandler;
|
|
1715
|
+
const trace = getComponentTrace();
|
|
1716
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
1717
|
+
args[_key - 1] = arguments[_key];
|
|
1718
|
+
}
|
|
1719
|
+
if (appWarnHandler) {
|
|
1720
|
+
callWithErrorHandling(appWarnHandler, instance, 11, [
|
|
1721
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
1722
|
+
msg + args.map(a => {
|
|
1723
|
+
var _a, _b;
|
|
1724
|
+
return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
|
|
1725
|
+
}).join(""), instance && instance.proxy, trace.map(_ref => {
|
|
1726
|
+
let {
|
|
1727
|
+
vnode
|
|
1728
|
+
} = _ref;
|
|
1729
|
+
return `at <${formatComponentName(instance, vnode.type)}>`;
|
|
1730
|
+
}).join("\n"), trace]);
|
|
1731
|
+
} else {
|
|
1732
|
+
const warnArgs = [`[Vue warn]: ${msg}`, ...args];
|
|
1733
|
+
if (trace.length &&
|
|
1734
|
+
// avoid spamming console during tests
|
|
1735
|
+
true) {
|
|
1736
|
+
warnArgs.push(`
|
|
1737
|
+
`, ...formatTrace(trace));
|
|
1738
|
+
}
|
|
1739
|
+
}
|
|
1740
|
+
resetTracking();
|
|
1741
|
+
isWarning = false;
|
|
1742
|
+
}
|
|
1743
|
+
function getComponentTrace() {
|
|
1744
|
+
let currentVNode = stack[stack.length - 1];
|
|
1745
|
+
if (!currentVNode) {
|
|
1746
|
+
return [];
|
|
1747
|
+
}
|
|
1748
|
+
const normalizedStack = [];
|
|
1749
|
+
while (currentVNode) {
|
|
1750
|
+
const last = normalizedStack[0];
|
|
1751
|
+
if (last && last.vnode === currentVNode) {
|
|
1752
|
+
last.recurseCount++;
|
|
1753
|
+
} else {
|
|
1754
|
+
normalizedStack.push({
|
|
1755
|
+
vnode: currentVNode,
|
|
1756
|
+
recurseCount: 0
|
|
1757
|
+
});
|
|
1758
|
+
}
|
|
1759
|
+
const parentInstance = currentVNode.component && currentVNode.component.parent;
|
|
1760
|
+
currentVNode = parentInstance && parentInstance.vnode;
|
|
1761
|
+
}
|
|
1762
|
+
return normalizedStack;
|
|
1763
|
+
}
|
|
1764
|
+
function formatTrace(trace) {
|
|
1765
|
+
const logs = [];
|
|
1766
|
+
trace.forEach((entry, i) => {
|
|
1767
|
+
logs.push(...(i === 0 ? [] : [`
|
|
1768
|
+
`]), ...formatTraceEntry(entry));
|
|
1769
|
+
});
|
|
1770
|
+
return logs;
|
|
1771
|
+
}
|
|
1772
|
+
function formatTraceEntry(_ref2) {
|
|
1773
|
+
let {
|
|
1774
|
+
vnode,
|
|
1775
|
+
recurseCount
|
|
1776
|
+
} = _ref2;
|
|
1777
|
+
const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
|
|
1778
|
+
const isRoot = vnode.component ? vnode.component.parent == null : false;
|
|
1779
|
+
const open = ` at <${formatComponentName(vnode.component, vnode.type, isRoot)}`;
|
|
1780
|
+
const close = `>` + postfix;
|
|
1781
|
+
return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
|
|
1782
|
+
}
|
|
1783
|
+
function formatProps(props) {
|
|
1784
|
+
const res = [];
|
|
1785
|
+
const keys = Object.keys(props);
|
|
1786
|
+
keys.slice(0, 3).forEach(key => {
|
|
1787
|
+
res.push(...formatProp(key, props[key]));
|
|
1788
|
+
});
|
|
1789
|
+
if (keys.length > 3) {
|
|
1790
|
+
res.push(` ...`);
|
|
1791
|
+
}
|
|
1792
|
+
return res;
|
|
1793
|
+
}
|
|
1794
|
+
function formatProp(key, value, raw) {
|
|
1795
|
+
if (isString(value)) {
|
|
1796
|
+
value = JSON.stringify(value);
|
|
1797
|
+
return raw ? value : [`${key}=${value}`];
|
|
1798
|
+
} else if (typeof value === "number" || typeof value === "boolean" || value == null) {
|
|
1799
|
+
return raw ? value : [`${key}=${value}`];
|
|
1800
|
+
} else if (isRef(value)) {
|
|
1801
|
+
value = formatProp(key, toRaw(value.value), true);
|
|
1802
|
+
return raw ? value : [`${key}=Ref<`, value, `>`];
|
|
1803
|
+
} else if (isFunction$2(value)) {
|
|
1804
|
+
return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
|
|
1805
|
+
} else {
|
|
1806
|
+
value = toRaw(value);
|
|
1807
|
+
return raw ? value : [`${key}=`, value];
|
|
1808
|
+
}
|
|
1809
|
+
}
|
|
1810
|
+
const ErrorTypeStrings$1 = {
|
|
1811
|
+
["sp"]: "serverPrefetch hook",
|
|
1812
|
+
["bc"]: "beforeCreate hook",
|
|
1813
|
+
["c"]: "created hook",
|
|
1814
|
+
["bm"]: "beforeMount hook",
|
|
1815
|
+
["m"]: "mounted hook",
|
|
1816
|
+
["bu"]: "beforeUpdate hook",
|
|
1817
|
+
["u"]: "updated",
|
|
1818
|
+
["bum"]: "beforeUnmount hook",
|
|
1819
|
+
["um"]: "unmounted hook",
|
|
1820
|
+
["a"]: "activated hook",
|
|
1821
|
+
["da"]: "deactivated hook",
|
|
1822
|
+
["ec"]: "errorCaptured hook",
|
|
1823
|
+
["rtc"]: "renderTracked hook",
|
|
1824
|
+
["rtg"]: "renderTriggered hook",
|
|
1825
|
+
[0]: "setup function",
|
|
1826
|
+
[1]: "render function",
|
|
1827
|
+
[2]: "watcher getter",
|
|
1828
|
+
[3]: "watcher callback",
|
|
1829
|
+
[4]: "watcher cleanup function",
|
|
1830
|
+
[5]: "native event handler",
|
|
1831
|
+
[6]: "component event handler",
|
|
1832
|
+
[7]: "vnode hook",
|
|
1833
|
+
[8]: "directive hook",
|
|
1834
|
+
[9]: "transition hook",
|
|
1835
|
+
[10]: "app errorHandler",
|
|
1836
|
+
[11]: "app warnHandler",
|
|
1837
|
+
[12]: "ref function",
|
|
1838
|
+
[13]: "async component loader",
|
|
1839
|
+
[14]: "scheduler flush",
|
|
1840
|
+
[15]: "component update",
|
|
1841
|
+
[16]: "app unmount cleanup function"
|
|
1842
|
+
};
|
|
1843
|
+
function callWithErrorHandling(fn, instance, type, args) {
|
|
1844
|
+
try {
|
|
1845
|
+
return args ? fn(...args) : fn();
|
|
1846
|
+
} catch (err) {
|
|
1847
|
+
handleError(err, instance, type);
|
|
1848
|
+
}
|
|
1849
|
+
}
|
|
1850
|
+
function callWithAsyncErrorHandling(fn, instance, type, args) {
|
|
1851
|
+
if (isFunction$2(fn)) {
|
|
1852
|
+
const res = callWithErrorHandling(fn, instance, type, args);
|
|
1853
|
+
if (res && isPromise(res)) {
|
|
1854
|
+
res.catch(err => {
|
|
1855
|
+
handleError(err, instance, type);
|
|
1856
|
+
});
|
|
1857
|
+
}
|
|
1858
|
+
return res;
|
|
1859
|
+
}
|
|
1860
|
+
if (isArray(fn)) {
|
|
1861
|
+
const values = [];
|
|
1862
|
+
for (let i = 0; i < fn.length; i++) {
|
|
1863
|
+
values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
|
|
1864
|
+
}
|
|
1865
|
+
return values;
|
|
1866
|
+
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
1867
|
+
warn$1(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`);
|
|
1868
|
+
}
|
|
1869
|
+
}
|
|
1870
|
+
function handleError(err, instance, type) {
|
|
1871
|
+
let throwInDev = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
1872
|
+
const contextVNode = instance ? instance.vnode : null;
|
|
1873
|
+
const {
|
|
1874
|
+
errorHandler,
|
|
1875
|
+
throwUnhandledErrorInProduction
|
|
1876
|
+
} = instance && instance.appContext.config || EMPTY_OBJ;
|
|
1877
|
+
if (instance) {
|
|
1878
|
+
let cur = instance.parent;
|
|
1879
|
+
const exposedInstance = instance.proxy;
|
|
1880
|
+
const errorInfo = !!(process.env.NODE_ENV !== "production") ? ErrorTypeStrings$1[type] : `https://vuejs.org/error-reference/#runtime-${type}`;
|
|
1881
|
+
while (cur) {
|
|
1882
|
+
const errorCapturedHooks = cur.ec;
|
|
1883
|
+
if (errorCapturedHooks) {
|
|
1884
|
+
for (let i = 0; i < errorCapturedHooks.length; i++) {
|
|
1885
|
+
if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
|
|
1886
|
+
return;
|
|
1887
|
+
}
|
|
1888
|
+
}
|
|
1889
|
+
}
|
|
1890
|
+
cur = cur.parent;
|
|
1891
|
+
}
|
|
1892
|
+
if (errorHandler) {
|
|
1893
|
+
pauseTracking();
|
|
1894
|
+
callWithErrorHandling(errorHandler, null, 10, [err, exposedInstance, errorInfo]);
|
|
1895
|
+
resetTracking();
|
|
1896
|
+
return;
|
|
1897
|
+
}
|
|
1898
|
+
}
|
|
1899
|
+
logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction);
|
|
1900
|
+
}
|
|
1901
|
+
function logError(err, type, contextVNode) {
|
|
1902
|
+
let throwInDev = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
1903
|
+
let throwInProd = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
1904
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1905
|
+
const info = ErrorTypeStrings$1[type];
|
|
1906
|
+
if (contextVNode) {
|
|
1907
|
+
pushWarningContext(contextVNode);
|
|
1908
|
+
}
|
|
1909
|
+
warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
|
|
1910
|
+
if (contextVNode) {
|
|
1911
|
+
popWarningContext();
|
|
1912
|
+
}
|
|
1913
|
+
if (throwInDev) {
|
|
1914
|
+
throw err;
|
|
1915
|
+
}
|
|
1916
|
+
} else if (throwInProd) {
|
|
1917
|
+
throw err;
|
|
1918
|
+
} else ;
|
|
1919
|
+
}
|
|
1920
|
+
let isFlushing = false;
|
|
1921
|
+
let isFlushPending = false;
|
|
1922
|
+
const queue = [];
|
|
1923
|
+
let flushIndex = 0;
|
|
1924
|
+
const pendingPostFlushCbs = [];
|
|
1925
|
+
let activePostFlushCbs = null;
|
|
1926
|
+
let postFlushIndex = 0;
|
|
1927
|
+
const resolvedPromise = /* @__PURE__ */Promise.resolve();
|
|
1928
|
+
let currentFlushPromise = null;
|
|
1929
|
+
const RECURSION_LIMIT = 100;
|
|
1930
|
+
function nextTick(fn) {
|
|
1931
|
+
const p = currentFlushPromise || resolvedPromise;
|
|
1932
|
+
return fn ? p.then(this ? fn.bind(this) : fn) : p;
|
|
1933
|
+
}
|
|
1934
|
+
function findInsertionIndex(id) {
|
|
1935
|
+
let start = isFlushing ? flushIndex + 1 : 0;
|
|
1936
|
+
let end = queue.length;
|
|
1937
|
+
while (start < end) {
|
|
1938
|
+
const middle = start + end >>> 1;
|
|
1939
|
+
const middleJob = queue[middle];
|
|
1940
|
+
const middleJobId = getId(middleJob);
|
|
1941
|
+
if (middleJobId < id || middleJobId === id && middleJob.flags & 2) {
|
|
1942
|
+
start = middle + 1;
|
|
1943
|
+
} else {
|
|
1944
|
+
end = middle;
|
|
1945
|
+
}
|
|
1946
|
+
}
|
|
1947
|
+
return start;
|
|
1948
|
+
}
|
|
1949
|
+
function queueJob(job) {
|
|
1950
|
+
if (!(job.flags & 1)) {
|
|
1951
|
+
const jobId = getId(job);
|
|
1952
|
+
const lastJob = queue[queue.length - 1];
|
|
1953
|
+
if (!lastJob ||
|
|
1954
|
+
// fast path when the job id is larger than the tail
|
|
1955
|
+
!(job.flags & 2) && jobId >= getId(lastJob)) {
|
|
1956
|
+
queue.push(job);
|
|
1957
|
+
} else {
|
|
1958
|
+
queue.splice(findInsertionIndex(jobId), 0, job);
|
|
1959
|
+
}
|
|
1960
|
+
if (!(job.flags & 4)) {
|
|
1961
|
+
job.flags |= 1;
|
|
1962
|
+
}
|
|
1963
|
+
queueFlush();
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
function queueFlush() {
|
|
1967
|
+
if (!isFlushing && !isFlushPending) {
|
|
1968
|
+
isFlushPending = true;
|
|
1969
|
+
currentFlushPromise = resolvedPromise.then(flushJobs);
|
|
1970
|
+
}
|
|
1971
|
+
}
|
|
1972
|
+
function queuePostFlushCb(cb) {
|
|
1973
|
+
if (!isArray(cb)) {
|
|
1974
|
+
if (activePostFlushCbs && cb.id === -1) {
|
|
1975
|
+
activePostFlushCbs.splice(postFlushIndex + 1, 0, cb);
|
|
1976
|
+
} else if (!(cb.flags & 1)) {
|
|
1977
|
+
pendingPostFlushCbs.push(cb);
|
|
1978
|
+
if (!(cb.flags & 4)) {
|
|
1979
|
+
cb.flags |= 1;
|
|
1980
|
+
}
|
|
1981
|
+
}
|
|
1982
|
+
} else {
|
|
1983
|
+
pendingPostFlushCbs.push(...cb);
|
|
1984
|
+
}
|
|
1985
|
+
queueFlush();
|
|
1986
|
+
}
|
|
1987
|
+
function flushPostFlushCbs(seen) {
|
|
1988
|
+
if (pendingPostFlushCbs.length) {
|
|
1989
|
+
const deduped = [...new Set(pendingPostFlushCbs)].sort((a, b) => getId(a) - getId(b));
|
|
1990
|
+
pendingPostFlushCbs.length = 0;
|
|
1991
|
+
if (activePostFlushCbs) {
|
|
1992
|
+
activePostFlushCbs.push(...deduped);
|
|
1993
|
+
return;
|
|
1994
|
+
}
|
|
1995
|
+
activePostFlushCbs = deduped;
|
|
1996
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1997
|
+
seen = seen || /* @__PURE__ */new Map();
|
|
1998
|
+
}
|
|
1999
|
+
for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
|
|
2000
|
+
const cb = activePostFlushCbs[postFlushIndex];
|
|
2001
|
+
if (!!(process.env.NODE_ENV !== "production") && checkRecursiveUpdates(seen, cb)) {
|
|
2002
|
+
continue;
|
|
2003
|
+
}
|
|
2004
|
+
if (!(cb.flags & 8)) cb();
|
|
2005
|
+
cb.flags &= ~1;
|
|
2006
|
+
}
|
|
2007
|
+
activePostFlushCbs = null;
|
|
2008
|
+
postFlushIndex = 0;
|
|
2009
|
+
}
|
|
2010
|
+
}
|
|
2011
|
+
const getId = job => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
|
|
2012
|
+
function flushJobs(seen) {
|
|
2013
|
+
isFlushPending = false;
|
|
2014
|
+
isFlushing = true;
|
|
2015
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
2016
|
+
seen = seen || /* @__PURE__ */new Map();
|
|
2017
|
+
}
|
|
2018
|
+
const check = !!(process.env.NODE_ENV !== "production") ? job => checkRecursiveUpdates(seen, job) : NOOP;
|
|
2019
|
+
try {
|
|
2020
|
+
for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
|
|
2021
|
+
const job = queue[flushIndex];
|
|
2022
|
+
if (job && !(job.flags & 8)) {
|
|
2023
|
+
if (!!(process.env.NODE_ENV !== "production") && check(job)) {
|
|
2024
|
+
continue;
|
|
2025
|
+
}
|
|
2026
|
+
callWithErrorHandling(job, job.i, job.i ? 15 : 14);
|
|
2027
|
+
job.flags &= ~1;
|
|
2028
|
+
}
|
|
2029
|
+
}
|
|
2030
|
+
} finally {
|
|
2031
|
+
flushIndex = 0;
|
|
2032
|
+
queue.length = 0;
|
|
2033
|
+
flushPostFlushCbs(seen);
|
|
2034
|
+
isFlushing = false;
|
|
2035
|
+
currentFlushPromise = null;
|
|
2036
|
+
if (queue.length || pendingPostFlushCbs.length) {
|
|
2037
|
+
flushJobs(seen);
|
|
2038
|
+
}
|
|
2039
|
+
}
|
|
2040
|
+
}
|
|
2041
|
+
function checkRecursiveUpdates(seen, fn) {
|
|
2042
|
+
if (!seen.has(fn)) {
|
|
2043
|
+
seen.set(fn, 1);
|
|
2044
|
+
} else {
|
|
2045
|
+
const count = seen.get(fn);
|
|
2046
|
+
if (count > RECURSION_LIMIT) {
|
|
2047
|
+
const instance = fn.i;
|
|
2048
|
+
const componentName = instance && getComponentName(instance.type);
|
|
2049
|
+
handleError(`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.`, null, 10);
|
|
2050
|
+
return true;
|
|
2051
|
+
} else {
|
|
2052
|
+
seen.set(fn, count + 1);
|
|
2053
|
+
}
|
|
2054
|
+
}
|
|
2055
|
+
}
|
|
2056
|
+
const hmrDirtyComponents = /* @__PURE__ */new Map();
|
|
2057
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
2058
|
+
getGlobalThis().__VUE_HMR_RUNTIME__ = {
|
|
2059
|
+
createRecord: tryWrap(createRecord),
|
|
2060
|
+
rerender: tryWrap(rerender),
|
|
2061
|
+
reload: tryWrap(reload)
|
|
2062
|
+
};
|
|
2063
|
+
}
|
|
2064
|
+
const map = /* @__PURE__ */new Map();
|
|
2065
|
+
function createRecord(id, initialDef) {
|
|
2066
|
+
if (map.has(id)) {
|
|
2067
|
+
return false;
|
|
2068
|
+
}
|
|
2069
|
+
map.set(id, {
|
|
2070
|
+
initialDef: normalizeClassComponent(initialDef),
|
|
2071
|
+
instances: /* @__PURE__ */new Set()
|
|
2072
|
+
});
|
|
2073
|
+
return true;
|
|
2074
|
+
}
|
|
2075
|
+
function normalizeClassComponent(component) {
|
|
2076
|
+
return isClassComponent(component) ? component.__vccOpts : component;
|
|
2077
|
+
}
|
|
2078
|
+
function rerender(id, newRender) {
|
|
2079
|
+
const record = map.get(id);
|
|
2080
|
+
if (!record) {
|
|
2081
|
+
return;
|
|
2082
|
+
}
|
|
2083
|
+
record.initialDef.render = newRender;
|
|
2084
|
+
[...record.instances].forEach(instance => {
|
|
2085
|
+
if (newRender) {
|
|
2086
|
+
instance.render = newRender;
|
|
2087
|
+
normalizeClassComponent(instance.type).render = newRender;
|
|
2088
|
+
}
|
|
2089
|
+
instance.renderCache = [];
|
|
2090
|
+
instance.update();
|
|
2091
|
+
});
|
|
2092
|
+
}
|
|
2093
|
+
function reload(id, newComp) {
|
|
2094
|
+
const record = map.get(id);
|
|
2095
|
+
if (!record) return;
|
|
2096
|
+
newComp = normalizeClassComponent(newComp);
|
|
2097
|
+
updateComponentDef(record.initialDef, newComp);
|
|
2098
|
+
const instances = [...record.instances];
|
|
2099
|
+
for (let i = 0; i < instances.length; i++) {
|
|
2100
|
+
const instance = instances[i];
|
|
2101
|
+
const oldComp = normalizeClassComponent(instance.type);
|
|
2102
|
+
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
2103
|
+
if (!dirtyInstances) {
|
|
2104
|
+
if (oldComp !== record.initialDef) {
|
|
2105
|
+
updateComponentDef(oldComp, newComp);
|
|
2106
|
+
}
|
|
2107
|
+
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */new Set());
|
|
2108
|
+
}
|
|
2109
|
+
dirtyInstances.add(instance);
|
|
2110
|
+
instance.appContext.propsCache.delete(instance.type);
|
|
2111
|
+
instance.appContext.emitsCache.delete(instance.type);
|
|
2112
|
+
instance.appContext.optionsCache.delete(instance.type);
|
|
2113
|
+
if (instance.ceReload) {
|
|
2114
|
+
dirtyInstances.add(instance);
|
|
2115
|
+
instance.ceReload(newComp.styles);
|
|
2116
|
+
dirtyInstances.delete(instance);
|
|
2117
|
+
} else if (instance.parent) {
|
|
2118
|
+
queueJob(() => {
|
|
2119
|
+
instance.parent.update();
|
|
2120
|
+
dirtyInstances.delete(instance);
|
|
2121
|
+
});
|
|
2122
|
+
} else if (instance.appContext.reload) {
|
|
2123
|
+
instance.appContext.reload();
|
|
2124
|
+
} else if (typeof window !== "undefined") {
|
|
2125
|
+
window.location.reload();
|
|
2126
|
+
} else ;
|
|
2127
|
+
if (instance.root.ce && instance !== instance.root) {
|
|
2128
|
+
instance.root.ce._removeChildStyle(oldComp);
|
|
2129
|
+
}
|
|
2130
|
+
}
|
|
2131
|
+
queuePostFlushCb(() => {
|
|
2132
|
+
hmrDirtyComponents.clear();
|
|
2133
|
+
});
|
|
2134
|
+
}
|
|
2135
|
+
function updateComponentDef(oldComp, newComp) {
|
|
2136
|
+
extend(oldComp, newComp);
|
|
2137
|
+
for (const key in oldComp) {
|
|
2138
|
+
if (key !== "__file" && !(key in newComp)) {
|
|
2139
|
+
delete oldComp[key];
|
|
2140
|
+
}
|
|
2141
|
+
}
|
|
2142
|
+
}
|
|
2143
|
+
function tryWrap(fn) {
|
|
2144
|
+
return (id, arg) => {
|
|
2145
|
+
try {
|
|
2146
|
+
return fn(id, arg);
|
|
2147
|
+
} catch (e) {
|
|
2148
|
+
}
|
|
2149
|
+
};
|
|
2150
|
+
}
|
|
2151
|
+
let devtools$1;
|
|
2152
|
+
let buffer = [];
|
|
2153
|
+
function setDevtoolsHook$1(hook, target) {
|
|
2154
|
+
var _a, _b;
|
|
2155
|
+
devtools$1 = hook;
|
|
2156
|
+
if (devtools$1) {
|
|
2157
|
+
devtools$1.enabled = true;
|
|
2158
|
+
buffer.forEach(_ref3 => {
|
|
2159
|
+
let {
|
|
2160
|
+
event,
|
|
2161
|
+
args
|
|
2162
|
+
} = _ref3;
|
|
2163
|
+
return devtools$1.emit(event, ...args);
|
|
2164
|
+
});
|
|
2165
|
+
buffer = [];
|
|
2166
|
+
} else if (
|
|
2167
|
+
// handle late devtools injection - only do this if we are in an actual
|
|
2168
|
+
// browser environment to avoid the timer handle stalling test runner exit
|
|
2169
|
+
// (#4815)
|
|
2170
|
+
typeof window !== "undefined" &&
|
|
2171
|
+
// some envs mock window but not fully
|
|
2172
|
+
window.HTMLElement &&
|
|
2173
|
+
// also exclude jsdom
|
|
2174
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
2175
|
+
!((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom"))) {
|
|
2176
|
+
const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];
|
|
2177
|
+
replay.push(newHook => {
|
|
2178
|
+
setDevtoolsHook$1(newHook, target);
|
|
2179
|
+
});
|
|
2180
|
+
setTimeout(() => {
|
|
2181
|
+
if (!devtools$1) {
|
|
2182
|
+
target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
|
|
2183
|
+
buffer = [];
|
|
2184
|
+
}
|
|
2185
|
+
}, 3e3);
|
|
2186
|
+
} else {
|
|
2187
|
+
buffer = [];
|
|
2188
|
+
}
|
|
2189
|
+
}
|
|
2190
|
+
let currentRenderingInstance = null;
|
|
2191
|
+
let currentScopeId = null;
|
|
2192
|
+
const isTeleport = type => type.__isTeleport;
|
|
2193
|
+
function setTransitionHooks(vnode, hooks) {
|
|
2194
|
+
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
2195
|
+
setTransitionHooks(vnode.component.subTree, hooks);
|
|
2196
|
+
} else if (vnode.shapeFlag & 128) {
|
|
2197
|
+
vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
2198
|
+
vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
2199
|
+
} else {
|
|
2200
|
+
vnode.transition = hooks;
|
|
2201
|
+
}
|
|
2202
|
+
}
|
|
2203
|
+
|
|
2204
|
+
/*! #__NO_SIDE_EFFECTS__ */
|
|
2205
|
+
// @__NO_SIDE_EFFECTS__
|
|
2206
|
+
function defineComponent(options, extraOptions) {
|
|
2207
|
+
return isFunction$2(options) ?
|
|
2208
|
+
// #8236: extend call and options.name access are considered side-effects
|
|
2209
|
+
// by Rollup, so we have to wrap it in a pure-annotated IIFE.
|
|
2210
|
+
/* @__PURE__ */
|
|
2211
|
+
(() => extend({
|
|
2212
|
+
name: options.name
|
|
2213
|
+
}, extraOptions, {
|
|
2214
|
+
setup: options
|
|
2215
|
+
}))() : options;
|
|
2216
|
+
}
|
|
2217
|
+
const isAsyncWrapper = i => !!i.type.__asyncLoader;
|
|
2218
|
+
function injectHook(type, hook) {
|
|
2219
|
+
let target = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : currentInstance;
|
|
2220
|
+
let prepend = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
2221
|
+
if (target) {
|
|
2222
|
+
const hooks = target[type] || (target[type] = []);
|
|
2223
|
+
const wrappedHook = hook.__weh || (hook.__weh = function () {
|
|
2224
|
+
pauseTracking();
|
|
2225
|
+
const reset = setCurrentInstance(target);
|
|
2226
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
2227
|
+
args[_key3] = arguments[_key3];
|
|
2228
|
+
}
|
|
2229
|
+
const res = callWithAsyncErrorHandling(hook, target, type, args);
|
|
2230
|
+
reset();
|
|
2231
|
+
resetTracking();
|
|
2232
|
+
return res;
|
|
2233
|
+
});
|
|
2234
|
+
if (prepend) {
|
|
2235
|
+
hooks.unshift(wrappedHook);
|
|
2236
|
+
} else {
|
|
2237
|
+
hooks.push(wrappedHook);
|
|
2238
|
+
}
|
|
2239
|
+
return wrappedHook;
|
|
2240
|
+
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
2241
|
+
const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, ""));
|
|
2242
|
+
warn$1(`${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().` + ` If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`);
|
|
2243
|
+
}
|
|
2244
|
+
}
|
|
2245
|
+
const createHook = lifecycle => function (hook) {
|
|
2246
|
+
let target = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : currentInstance;
|
|
2247
|
+
if (!isInSSRComponentSetup || lifecycle === "sp") {
|
|
2248
|
+
injectHook(lifecycle, function () {
|
|
2249
|
+
return hook(...arguments);
|
|
2250
|
+
}, target);
|
|
2251
|
+
}
|
|
2252
|
+
};
|
|
2253
|
+
const onMounted = createHook("m");
|
|
2254
|
+
const onBeforeUnmount = createHook("bum");
|
|
2255
|
+
const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
|
|
2256
|
+
function renderSlot(slots, name) {
|
|
2257
|
+
let props = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
2258
|
+
let fallback = arguments.length > 3 ? arguments[3] : undefined;
|
|
2259
|
+
let noSlotted = arguments.length > 4 ? arguments[4] : undefined;
|
|
2260
|
+
if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
|
|
2261
|
+
if (name !== "default") props.name = name;
|
|
2262
|
+
return openBlock(), createBlock(Fragment, null, [createVNode("slot", props, fallback && fallback())], 64);
|
|
2263
|
+
}
|
|
2264
|
+
let slot = slots[name];
|
|
2265
|
+
if (!!(process.env.NODE_ENV !== "production") && slot && slot.length > 1) {
|
|
2266
|
+
warn$1(`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.`);
|
|
2267
|
+
slot = () => [];
|
|
2268
|
+
}
|
|
2269
|
+
if (slot && slot._c) {
|
|
2270
|
+
slot._d = false;
|
|
2271
|
+
}
|
|
2272
|
+
openBlock();
|
|
2273
|
+
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
2274
|
+
const rendered = createBlock(Fragment, {
|
|
2275
|
+
key: (props.key ||
|
|
2276
|
+
// slot content array of a dynamic conditional slot may have a branch
|
|
2277
|
+
// key attached in the `createSlots` helper, respect that
|
|
2278
|
+
validSlotContent && validSlotContent.key || `_${name}`) + (
|
|
2279
|
+
// #7256 force differentiate fallback content from actual content
|
|
2280
|
+
!validSlotContent && fallback ? "_fb" : "")
|
|
2281
|
+
}, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
|
|
2282
|
+
if (!noSlotted && rendered.scopeId) {
|
|
2283
|
+
rendered.slotScopeIds = [rendered.scopeId + "-s"];
|
|
2284
|
+
}
|
|
2285
|
+
if (slot && slot._c) {
|
|
2286
|
+
slot._d = true;
|
|
2287
|
+
}
|
|
2288
|
+
return rendered;
|
|
2289
|
+
}
|
|
2290
|
+
function ensureValidVNode(vnodes) {
|
|
2291
|
+
return vnodes.some(child => {
|
|
2292
|
+
if (!isVNode(child)) return true;
|
|
2293
|
+
if (child.type === Comment) return false;
|
|
2294
|
+
if (child.type === Fragment && !ensureValidVNode(child.children)) return false;
|
|
2295
|
+
return true;
|
|
2296
|
+
}) ? vnodes : null;
|
|
2297
|
+
}
|
|
2298
|
+
const getPublicInstance = i => {
|
|
2299
|
+
if (!i) return null;
|
|
2300
|
+
if (isStatefulComponent(i)) return getComponentPublicInstance(i);
|
|
2301
|
+
return getPublicInstance(i.parent);
|
|
2302
|
+
};
|
|
2303
|
+
const publicPropertiesMap =
|
|
2304
|
+
// Move PURE marker to new line to workaround compiler discarding it
|
|
2305
|
+
// due to type annotation
|
|
2306
|
+
/* @__PURE__ */
|
|
2307
|
+
extend( /* @__PURE__ */Object.create(null), {
|
|
2308
|
+
$: i => i,
|
|
2309
|
+
$el: i => i.vnode.el,
|
|
2310
|
+
$data: i => i.data,
|
|
2311
|
+
$props: i => !!(process.env.NODE_ENV !== "production") ? shallowReadonly(i.props) : i.props,
|
|
2312
|
+
$attrs: i => !!(process.env.NODE_ENV !== "production") ? shallowReadonly(i.attrs) : i.attrs,
|
|
2313
|
+
$slots: i => !!(process.env.NODE_ENV !== "production") ? shallowReadonly(i.slots) : i.slots,
|
|
2314
|
+
$refs: i => !!(process.env.NODE_ENV !== "production") ? shallowReadonly(i.refs) : i.refs,
|
|
2315
|
+
$parent: i => getPublicInstance(i.parent),
|
|
2316
|
+
$root: i => getPublicInstance(i.root),
|
|
2317
|
+
$host: i => i.ce,
|
|
2318
|
+
$emit: i => i.emit,
|
|
2319
|
+
$options: i => __VUE_OPTIONS_API__ ? resolveMergedOptions(i) : i.type,
|
|
2320
|
+
$forceUpdate: i => i.f || (i.f = () => {
|
|
2321
|
+
queueJob(i.update);
|
|
2322
|
+
}),
|
|
2323
|
+
$nextTick: i => i.n || (i.n = nextTick.bind(i.proxy)),
|
|
2324
|
+
$watch: i => __VUE_OPTIONS_API__ ? instanceWatch.bind(i) : NOOP
|
|
2325
|
+
});
|
|
2326
|
+
const isReservedPrefix = key => key === "_" || key === "$";
|
|
2327
|
+
const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
|
|
2328
|
+
const PublicInstanceProxyHandlers = {
|
|
2329
|
+
get(_ref10, key) {
|
|
2330
|
+
let {
|
|
2331
|
+
_: instance
|
|
2332
|
+
} = _ref10;
|
|
2333
|
+
if (key === "__v_skip") {
|
|
2334
|
+
return true;
|
|
2335
|
+
}
|
|
2336
|
+
const {
|
|
2337
|
+
ctx,
|
|
2338
|
+
setupState,
|
|
2339
|
+
data,
|
|
2340
|
+
props,
|
|
2341
|
+
accessCache,
|
|
2342
|
+
type,
|
|
2343
|
+
appContext
|
|
2344
|
+
} = instance;
|
|
2345
|
+
if (!!(process.env.NODE_ENV !== "production") && key === "__isVue") {
|
|
2346
|
+
return true;
|
|
2347
|
+
}
|
|
2348
|
+
let normalizedProps;
|
|
2349
|
+
if (key[0] !== "$") {
|
|
2350
|
+
const n = accessCache[key];
|
|
2351
|
+
if (n !== void 0) {
|
|
2352
|
+
switch (n) {
|
|
2353
|
+
case 1 /* SETUP */:
|
|
2354
|
+
return setupState[key];
|
|
2355
|
+
case 2 /* DATA */:
|
|
2356
|
+
return data[key];
|
|
2357
|
+
case 4 /* CONTEXT */:
|
|
2358
|
+
return ctx[key];
|
|
2359
|
+
case 3 /* PROPS */:
|
|
2360
|
+
return props[key];
|
|
2361
|
+
}
|
|
2362
|
+
} else if (hasSetupBinding(setupState, key)) {
|
|
2363
|
+
accessCache[key] = 1 /* SETUP */;
|
|
2364
|
+
return setupState[key];
|
|
2365
|
+
} else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
2366
|
+
accessCache[key] = 2 /* DATA */;
|
|
2367
|
+
return data[key];
|
|
2368
|
+
} else if (
|
|
2369
|
+
// only cache other properties when instance has declared (thus stable)
|
|
2370
|
+
// props
|
|
2371
|
+
(normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key)) {
|
|
2372
|
+
accessCache[key] = 3 /* PROPS */;
|
|
2373
|
+
return props[key];
|
|
2374
|
+
} else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
2375
|
+
accessCache[key] = 4 /* CONTEXT */;
|
|
2376
|
+
return ctx[key];
|
|
2377
|
+
} else if (!__VUE_OPTIONS_API__ || shouldCacheAccess) {
|
|
2378
|
+
accessCache[key] = 0 /* OTHER */;
|
|
2379
|
+
}
|
|
2380
|
+
}
|
|
2381
|
+
|
|
2382
|
+
const publicGetter = publicPropertiesMap[key];
|
|
2383
|
+
let cssModule, globalProperties;
|
|
2384
|
+
if (publicGetter) {
|
|
2385
|
+
if (key === "$attrs") {
|
|
2386
|
+
track(instance.attrs, "get", "");
|
|
2387
|
+
!!(process.env.NODE_ENV !== "production") && markAttrsAccessed();
|
|
2388
|
+
} else if (!!(process.env.NODE_ENV !== "production") && key === "$slots") {
|
|
2389
|
+
track(instance, "get", key);
|
|
2390
|
+
}
|
|
2391
|
+
return publicGetter(instance);
|
|
2392
|
+
} else if (
|
|
2393
|
+
// css module (injected by vue-loader)
|
|
2394
|
+
(cssModule = type.__cssModules) && (cssModule = cssModule[key])) {
|
|
2395
|
+
return cssModule;
|
|
2396
|
+
} else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
2397
|
+
accessCache[key] = 4 /* CONTEXT */;
|
|
2398
|
+
return ctx[key];
|
|
2399
|
+
} else if (
|
|
2400
|
+
// global properties
|
|
2401
|
+
globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)) {
|
|
2402
|
+
{
|
|
2403
|
+
return globalProperties[key];
|
|
2404
|
+
}
|
|
2405
|
+
} else if (!!(process.env.NODE_ENV !== "production") && currentRenderingInstance && (!isString(key) ||
|
|
2406
|
+
// #1091 avoid internal isRef/isVNode checks on component instance leading
|
|
2407
|
+
// to infinite warning loop
|
|
2408
|
+
key.indexOf("__v") !== 0)) {
|
|
2409
|
+
if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) {
|
|
2410
|
+
warn$1(`Property ${JSON.stringify(key)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`);
|
|
2411
|
+
} else if (instance === currentRenderingInstance) {
|
|
2412
|
+
warn$1(`Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`);
|
|
2413
|
+
}
|
|
2414
|
+
}
|
|
2415
|
+
},
|
|
2416
|
+
set(_ref11, key, value) {
|
|
2417
|
+
let {
|
|
2418
|
+
_: instance
|
|
2419
|
+
} = _ref11;
|
|
2420
|
+
const {
|
|
2421
|
+
data,
|
|
2422
|
+
setupState,
|
|
2423
|
+
ctx
|
|
2424
|
+
} = instance;
|
|
2425
|
+
if (hasSetupBinding(setupState, key)) {
|
|
2426
|
+
setupState[key] = value;
|
|
2427
|
+
return true;
|
|
2428
|
+
} else if (!!(process.env.NODE_ENV !== "production") && setupState.__isScriptSetup && hasOwn(setupState, key)) {
|
|
2429
|
+
warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`);
|
|
2430
|
+
return false;
|
|
2431
|
+
} else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
2432
|
+
data[key] = value;
|
|
2433
|
+
return true;
|
|
2434
|
+
} else if (hasOwn(instance.props, key)) {
|
|
2435
|
+
!!(process.env.NODE_ENV !== "production") && warn$1(`Attempting to mutate prop "${key}". Props are readonly.`);
|
|
2436
|
+
return false;
|
|
2437
|
+
}
|
|
2438
|
+
if (key[0] === "$" && key.slice(1) in instance) {
|
|
2439
|
+
!!(process.env.NODE_ENV !== "production") && warn$1(`Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.`);
|
|
2440
|
+
return false;
|
|
2441
|
+
} else {
|
|
2442
|
+
if (!!(process.env.NODE_ENV !== "production") && key in instance.appContext.config.globalProperties) {
|
|
2443
|
+
Object.defineProperty(ctx, key, {
|
|
2444
|
+
enumerable: true,
|
|
2445
|
+
configurable: true,
|
|
2446
|
+
value
|
|
2447
|
+
});
|
|
2448
|
+
} else {
|
|
2449
|
+
ctx[key] = value;
|
|
2450
|
+
}
|
|
2451
|
+
}
|
|
2452
|
+
return true;
|
|
2453
|
+
},
|
|
2454
|
+
has(_ref12, key) {
|
|
2455
|
+
let {
|
|
2456
|
+
_: {
|
|
2457
|
+
data,
|
|
2458
|
+
setupState,
|
|
2459
|
+
accessCache,
|
|
2460
|
+
ctx,
|
|
2461
|
+
appContext,
|
|
2462
|
+
propsOptions
|
|
2463
|
+
}
|
|
2464
|
+
} = _ref12;
|
|
2465
|
+
let normalizedProps;
|
|
2466
|
+
return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key);
|
|
2467
|
+
},
|
|
2468
|
+
defineProperty(target, key, descriptor) {
|
|
2469
|
+
if (descriptor.get != null) {
|
|
2470
|
+
target._.accessCache[key] = 0;
|
|
2471
|
+
} else if (hasOwn(descriptor, "value")) {
|
|
2472
|
+
this.set(target, key, descriptor.value, null);
|
|
2473
|
+
}
|
|
2474
|
+
return Reflect.defineProperty(target, key, descriptor);
|
|
2475
|
+
}
|
|
2476
|
+
};
|
|
2477
|
+
if (!!(process.env.NODE_ENV !== "production") && true) {
|
|
2478
|
+
PublicInstanceProxyHandlers.ownKeys = target => {
|
|
2479
|
+
warn$1(`Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`);
|
|
2480
|
+
return Reflect.ownKeys(target);
|
|
2481
|
+
};
|
|
2482
|
+
}
|
|
2483
|
+
function useSlots() {
|
|
2484
|
+
return getContext().slots;
|
|
2485
|
+
}
|
|
2486
|
+
function getContext() {
|
|
2487
|
+
const i = getCurrentInstance();
|
|
2488
|
+
if (!!(process.env.NODE_ENV !== "production") && !i) {
|
|
2489
|
+
warn$1(`useContext() called without active instance.`);
|
|
2490
|
+
}
|
|
2491
|
+
return i.setupContext || (i.setupContext = createSetupContext(i));
|
|
2492
|
+
}
|
|
2493
|
+
function normalizePropsOrEmits(props) {
|
|
2494
|
+
return isArray(props) ? props.reduce((normalized, p) => (normalized[p] = null, normalized), {}) : props;
|
|
2495
|
+
}
|
|
2496
|
+
let shouldCacheAccess = true;
|
|
2497
|
+
function resolveMergedOptions(instance) {
|
|
2498
|
+
const base = instance.type;
|
|
2499
|
+
const {
|
|
2500
|
+
mixins,
|
|
2501
|
+
extends: extendsOptions
|
|
2502
|
+
} = base;
|
|
2503
|
+
const {
|
|
2504
|
+
mixins: globalMixins,
|
|
2505
|
+
optionsCache: cache,
|
|
2506
|
+
config: {
|
|
2507
|
+
optionMergeStrategies
|
|
2508
|
+
}
|
|
2509
|
+
} = instance.appContext;
|
|
2510
|
+
const cached = cache.get(base);
|
|
2511
|
+
let resolved;
|
|
2512
|
+
if (cached) {
|
|
2513
|
+
resolved = cached;
|
|
2514
|
+
} else if (!globalMixins.length && !mixins && !extendsOptions) {
|
|
2515
|
+
{
|
|
2516
|
+
resolved = base;
|
|
2517
|
+
}
|
|
2518
|
+
} else {
|
|
2519
|
+
resolved = {};
|
|
2520
|
+
if (globalMixins.length) {
|
|
2521
|
+
globalMixins.forEach(m => mergeOptions(resolved, m, optionMergeStrategies, true));
|
|
2522
|
+
}
|
|
2523
|
+
mergeOptions(resolved, base, optionMergeStrategies);
|
|
2524
|
+
}
|
|
2525
|
+
if (isObject(base)) {
|
|
2526
|
+
cache.set(base, resolved);
|
|
2527
|
+
}
|
|
2528
|
+
return resolved;
|
|
2529
|
+
}
|
|
2530
|
+
function mergeOptions(to, from, strats) {
|
|
2531
|
+
let asMixin = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
2532
|
+
const {
|
|
2533
|
+
mixins,
|
|
2534
|
+
extends: extendsOptions
|
|
2535
|
+
} = from;
|
|
2536
|
+
if (extendsOptions) {
|
|
2537
|
+
mergeOptions(to, extendsOptions, strats, true);
|
|
2538
|
+
}
|
|
2539
|
+
if (mixins) {
|
|
2540
|
+
mixins.forEach(m => mergeOptions(to, m, strats, true));
|
|
2541
|
+
}
|
|
2542
|
+
for (const key in from) {
|
|
2543
|
+
if (asMixin && key === "expose") {
|
|
2544
|
+
!!(process.env.NODE_ENV !== "production") && warn$1(`"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`);
|
|
2545
|
+
} else {
|
|
2546
|
+
const strat = internalOptionMergeStrats[key] || strats && strats[key];
|
|
2547
|
+
to[key] = strat ? strat(to[key], from[key]) : from[key];
|
|
2548
|
+
}
|
|
2549
|
+
}
|
|
2550
|
+
return to;
|
|
2551
|
+
}
|
|
2552
|
+
const internalOptionMergeStrats = {
|
|
2553
|
+
data: mergeDataFn,
|
|
2554
|
+
props: mergeEmitsOrPropsOptions,
|
|
2555
|
+
emits: mergeEmitsOrPropsOptions,
|
|
2556
|
+
// objects
|
|
2557
|
+
methods: mergeObjectOptions,
|
|
2558
|
+
computed: mergeObjectOptions,
|
|
2559
|
+
// lifecycle
|
|
2560
|
+
beforeCreate: mergeAsArray,
|
|
2561
|
+
created: mergeAsArray,
|
|
2562
|
+
beforeMount: mergeAsArray,
|
|
2563
|
+
mounted: mergeAsArray,
|
|
2564
|
+
beforeUpdate: mergeAsArray,
|
|
2565
|
+
updated: mergeAsArray,
|
|
2566
|
+
beforeDestroy: mergeAsArray,
|
|
2567
|
+
beforeUnmount: mergeAsArray,
|
|
2568
|
+
destroyed: mergeAsArray,
|
|
2569
|
+
unmounted: mergeAsArray,
|
|
2570
|
+
activated: mergeAsArray,
|
|
2571
|
+
deactivated: mergeAsArray,
|
|
2572
|
+
errorCaptured: mergeAsArray,
|
|
2573
|
+
serverPrefetch: mergeAsArray,
|
|
2574
|
+
// assets
|
|
2575
|
+
components: mergeObjectOptions,
|
|
2576
|
+
directives: mergeObjectOptions,
|
|
2577
|
+
// watch
|
|
2578
|
+
watch: mergeWatchOptions,
|
|
2579
|
+
// provide / inject
|
|
2580
|
+
provide: mergeDataFn,
|
|
2581
|
+
inject: mergeInject
|
|
2582
|
+
};
|
|
2583
|
+
function mergeDataFn(to, from) {
|
|
2584
|
+
if (!from) {
|
|
2585
|
+
return to;
|
|
2586
|
+
}
|
|
2587
|
+
if (!to) {
|
|
2588
|
+
return from;
|
|
2589
|
+
}
|
|
2590
|
+
return function mergedDataFn() {
|
|
2591
|
+
return extend(isFunction$2(to) ? to.call(this, this) : to, isFunction$2(from) ? from.call(this, this) : from);
|
|
2592
|
+
};
|
|
2593
|
+
}
|
|
2594
|
+
function mergeInject(to, from) {
|
|
2595
|
+
return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
|
|
2596
|
+
}
|
|
2597
|
+
function normalizeInject(raw) {
|
|
2598
|
+
if (isArray(raw)) {
|
|
2599
|
+
const res = {};
|
|
2600
|
+
for (let i = 0; i < raw.length; i++) {
|
|
2601
|
+
res[raw[i]] = raw[i];
|
|
2602
|
+
}
|
|
2603
|
+
return res;
|
|
2604
|
+
}
|
|
2605
|
+
return raw;
|
|
2606
|
+
}
|
|
2607
|
+
function mergeAsArray(to, from) {
|
|
2608
|
+
return to ? [...new Set([].concat(to, from))] : from;
|
|
2609
|
+
}
|
|
2610
|
+
function mergeObjectOptions(to, from) {
|
|
2611
|
+
return to ? extend( /* @__PURE__ */Object.create(null), to, from) : from;
|
|
2612
|
+
}
|
|
2613
|
+
function mergeEmitsOrPropsOptions(to, from) {
|
|
2614
|
+
if (to) {
|
|
2615
|
+
if (isArray(to) && isArray(from)) {
|
|
2616
|
+
return [... /* @__PURE__ */new Set([...to, ...from])];
|
|
2617
|
+
}
|
|
2618
|
+
return extend( /* @__PURE__ */Object.create(null), normalizePropsOrEmits(to), normalizePropsOrEmits(from != null ? from : {}));
|
|
2619
|
+
} else {
|
|
2620
|
+
return from;
|
|
2621
|
+
}
|
|
2622
|
+
}
|
|
2623
|
+
function mergeWatchOptions(to, from) {
|
|
2624
|
+
if (!to) return from;
|
|
2625
|
+
if (!from) return to;
|
|
2626
|
+
const merged = extend( /* @__PURE__ */Object.create(null), to);
|
|
2627
|
+
for (const key in from) {
|
|
2628
|
+
merged[key] = mergeAsArray(to[key], from[key]);
|
|
2629
|
+
}
|
|
2630
|
+
return merged;
|
|
2631
|
+
}
|
|
2632
|
+
let currentApp = null;
|
|
2633
|
+
function inject(key, defaultValue) {
|
|
2634
|
+
let treatDefaultAsFactory = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
2635
|
+
const instance = currentInstance || currentRenderingInstance;
|
|
2636
|
+
if (instance || currentApp) {
|
|
2637
|
+
const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
|
|
2638
|
+
if (provides && key in provides) {
|
|
2639
|
+
return provides[key];
|
|
2640
|
+
} else if (arguments.length > 1) {
|
|
2641
|
+
return treatDefaultAsFactory && isFunction$2(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
|
|
2642
|
+
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
2643
|
+
warn$1(`injection "${String(key)}" not found.`);
|
|
2644
|
+
}
|
|
2645
|
+
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
2646
|
+
warn$1(`inject() can only be used inside setup() or functional components.`);
|
|
2647
|
+
}
|
|
2648
|
+
}
|
|
2649
|
+
const internalObjectProto = {};
|
|
2650
|
+
const isInternalObject = obj => Object.getPrototypeOf(obj) === internalObjectProto;
|
|
2651
|
+
const queuePostRenderEffect = queueEffectWithSuspense;
|
|
2652
|
+
const ssrContextKey = Symbol.for("v-scx");
|
|
2653
|
+
const useSSRContext = () => {
|
|
2654
|
+
{
|
|
2655
|
+
const ctx = inject(ssrContextKey);
|
|
2656
|
+
if (!ctx) {
|
|
2657
|
+
!!(process.env.NODE_ENV !== "production") && warn$1(`Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`);
|
|
2658
|
+
}
|
|
2659
|
+
return ctx;
|
|
2660
|
+
}
|
|
2661
|
+
};
|
|
2662
|
+
function watch(source, cb, options) {
|
|
2663
|
+
if (!!(process.env.NODE_ENV !== "production") && !isFunction$2(cb)) {
|
|
2664
|
+
warn$1(`\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`);
|
|
2665
|
+
}
|
|
2666
|
+
return doWatch(source, cb, options);
|
|
2667
|
+
}
|
|
2668
|
+
function doWatch(source, cb) {
|
|
2669
|
+
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : EMPTY_OBJ;
|
|
2670
|
+
const {
|
|
2671
|
+
immediate,
|
|
2672
|
+
deep,
|
|
2673
|
+
flush,
|
|
2674
|
+
once
|
|
2675
|
+
} = options;
|
|
2676
|
+
if (!!(process.env.NODE_ENV !== "production") && !cb) {
|
|
2677
|
+
if (immediate !== void 0) {
|
|
2678
|
+
warn$1(`watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`);
|
|
2679
|
+
}
|
|
2680
|
+
if (deep !== void 0) {
|
|
2681
|
+
warn$1(`watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`);
|
|
2682
|
+
}
|
|
2683
|
+
if (once !== void 0) {
|
|
2684
|
+
warn$1(`watch() "once" option is only respected when using the watch(source, callback, options?) signature.`);
|
|
2685
|
+
}
|
|
2686
|
+
}
|
|
2687
|
+
const baseWatchOptions = extend({}, options);
|
|
2688
|
+
if (!!(process.env.NODE_ENV !== "production")) baseWatchOptions.onWarn = warn$1;
|
|
2689
|
+
let ssrCleanup;
|
|
2690
|
+
if (isInSSRComponentSetup) {
|
|
2691
|
+
if (flush === "sync") {
|
|
2692
|
+
const ctx = useSSRContext();
|
|
2693
|
+
ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
|
|
2694
|
+
} else if (!cb || immediate) {
|
|
2695
|
+
baseWatchOptions.once = true;
|
|
2696
|
+
} else {
|
|
2697
|
+
return {
|
|
2698
|
+
stop: NOOP,
|
|
2699
|
+
resume: NOOP,
|
|
2700
|
+
pause: NOOP
|
|
2701
|
+
};
|
|
2702
|
+
}
|
|
2703
|
+
}
|
|
2704
|
+
const instance = currentInstance;
|
|
2705
|
+
baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
|
|
2706
|
+
let isPre = false;
|
|
2707
|
+
if (flush === "post") {
|
|
2708
|
+
baseWatchOptions.scheduler = job => {
|
|
2709
|
+
queuePostRenderEffect(job, instance && instance.suspense);
|
|
2710
|
+
};
|
|
2711
|
+
} else if (flush !== "sync") {
|
|
2712
|
+
isPre = true;
|
|
2713
|
+
baseWatchOptions.scheduler = (job, isFirstRun) => {
|
|
2714
|
+
if (isFirstRun) {
|
|
2715
|
+
job();
|
|
2716
|
+
} else {
|
|
2717
|
+
queueJob(job);
|
|
2718
|
+
}
|
|
2719
|
+
};
|
|
2720
|
+
}
|
|
2721
|
+
baseWatchOptions.augmentJob = job => {
|
|
2722
|
+
if (cb) {
|
|
2723
|
+
job.flags |= 4;
|
|
2724
|
+
}
|
|
2725
|
+
if (isPre) {
|
|
2726
|
+
job.flags |= 2;
|
|
2727
|
+
if (instance) {
|
|
2728
|
+
job.id = instance.uid;
|
|
2729
|
+
job.i = instance;
|
|
2730
|
+
}
|
|
2731
|
+
}
|
|
2732
|
+
};
|
|
2733
|
+
const watchHandle = watch$1(source, cb, baseWatchOptions);
|
|
2734
|
+
if (ssrCleanup) ssrCleanup.push(watchHandle);
|
|
2735
|
+
return watchHandle;
|
|
2736
|
+
}
|
|
2737
|
+
function instanceWatch(source, value, options) {
|
|
2738
|
+
const publicThis = this.proxy;
|
|
2739
|
+
const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
|
|
2740
|
+
let cb;
|
|
2741
|
+
if (isFunction$2(value)) {
|
|
2742
|
+
cb = value;
|
|
2743
|
+
} else {
|
|
2744
|
+
cb = value.handler;
|
|
2745
|
+
options = value;
|
|
2746
|
+
}
|
|
2747
|
+
const reset = setCurrentInstance(this);
|
|
2748
|
+
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
2749
|
+
reset();
|
|
2750
|
+
return res;
|
|
2751
|
+
}
|
|
2752
|
+
function createPathGetter(ctx, path) {
|
|
2753
|
+
const segments = path.split(".");
|
|
2754
|
+
return () => {
|
|
2755
|
+
let cur = ctx;
|
|
2756
|
+
for (let i = 0; i < segments.length && cur; i++) {
|
|
2757
|
+
cur = cur[segments[i]];
|
|
2758
|
+
}
|
|
2759
|
+
return cur;
|
|
2760
|
+
};
|
|
2761
|
+
}
|
|
2762
|
+
function markAttrsAccessed() {
|
|
2763
|
+
}
|
|
2764
|
+
const isSuspense = type => type.__isSuspense;
|
|
2765
|
+
function queueEffectWithSuspense(fn, suspense) {
|
|
2766
|
+
if (suspense && suspense.pendingBranch) {
|
|
2767
|
+
if (isArray(fn)) {
|
|
2768
|
+
suspense.effects.push(...fn);
|
|
2769
|
+
} else {
|
|
2770
|
+
suspense.effects.push(fn);
|
|
2771
|
+
}
|
|
2772
|
+
} else {
|
|
2773
|
+
queuePostFlushCb(fn);
|
|
2774
|
+
}
|
|
2775
|
+
}
|
|
2776
|
+
const Fragment = Symbol.for("v-fgt");
|
|
2777
|
+
const Text$1 = Symbol.for("v-txt");
|
|
2778
|
+
const Comment = Symbol.for("v-cmt");
|
|
2779
|
+
const blockStack = [];
|
|
2780
|
+
let currentBlock = null;
|
|
2781
|
+
function openBlock() {
|
|
2782
|
+
let disableTracking = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
2783
|
+
blockStack.push(currentBlock = disableTracking ? null : []);
|
|
2784
|
+
}
|
|
2785
|
+
function closeBlock() {
|
|
2786
|
+
blockStack.pop();
|
|
2787
|
+
currentBlock = blockStack[blockStack.length - 1] || null;
|
|
2788
|
+
}
|
|
2789
|
+
function setupBlock(vnode) {
|
|
2790
|
+
vnode.dynamicChildren = currentBlock || EMPTY_ARR ;
|
|
2791
|
+
closeBlock();
|
|
2792
|
+
if (currentBlock) {
|
|
2793
|
+
currentBlock.push(vnode);
|
|
2794
|
+
}
|
|
2795
|
+
return vnode;
|
|
2796
|
+
}
|
|
2797
|
+
function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {
|
|
2798
|
+
return setupBlock(createBaseVNode(type, props, children, patchFlag, dynamicProps, shapeFlag, true));
|
|
2799
|
+
}
|
|
2800
|
+
function createBlock(type, props, children, patchFlag, dynamicProps) {
|
|
2801
|
+
return setupBlock(createVNode(type, props, children, patchFlag, dynamicProps, true));
|
|
2802
|
+
}
|
|
2803
|
+
function isVNode(value) {
|
|
2804
|
+
return value ? value.__v_isVNode === true : false;
|
|
2805
|
+
}
|
|
2806
|
+
const createVNodeWithArgsTransform = function () {
|
|
2807
|
+
for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
|
|
2808
|
+
args[_key7] = arguments[_key7];
|
|
2809
|
+
}
|
|
2810
|
+
return _createVNode(...(args));
|
|
2811
|
+
};
|
|
2812
|
+
const normalizeKey = _ref19 => {
|
|
2813
|
+
let {
|
|
2814
|
+
key
|
|
2815
|
+
} = _ref19;
|
|
2816
|
+
return key != null ? key : null;
|
|
2817
|
+
};
|
|
2818
|
+
const normalizeRef = _ref20 => {
|
|
2819
|
+
let {
|
|
2820
|
+
ref,
|
|
2821
|
+
ref_key,
|
|
2822
|
+
ref_for
|
|
2823
|
+
} = _ref20;
|
|
2824
|
+
if (typeof ref === "number") {
|
|
2825
|
+
ref = "" + ref;
|
|
2826
|
+
}
|
|
2827
|
+
return ref != null ? isString(ref) || isRef(ref) || isFunction$2(ref) ? {
|
|
2828
|
+
i: currentRenderingInstance,
|
|
2829
|
+
r: ref,
|
|
2830
|
+
k: ref_key,
|
|
2831
|
+
f: !!ref_for
|
|
2832
|
+
} : ref : null;
|
|
2833
|
+
};
|
|
2834
|
+
function createBaseVNode(type) {
|
|
2835
|
+
let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
2836
|
+
let children = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
2837
|
+
let patchFlag = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
2838
|
+
let dynamicProps = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
|
|
2839
|
+
let shapeFlag = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : type === Fragment ? 0 : 1;
|
|
2840
|
+
let isBlockNode = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
2841
|
+
let needFullChildrenNormalization = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : false;
|
|
2842
|
+
const vnode = {
|
|
2843
|
+
__v_isVNode: true,
|
|
2844
|
+
__v_skip: true,
|
|
2845
|
+
type,
|
|
2846
|
+
props,
|
|
2847
|
+
key: props && normalizeKey(props),
|
|
2848
|
+
ref: props && normalizeRef(props),
|
|
2849
|
+
scopeId: currentScopeId,
|
|
2850
|
+
slotScopeIds: null,
|
|
2851
|
+
children,
|
|
2852
|
+
component: null,
|
|
2853
|
+
suspense: null,
|
|
2854
|
+
ssContent: null,
|
|
2855
|
+
ssFallback: null,
|
|
2856
|
+
dirs: null,
|
|
2857
|
+
transition: null,
|
|
2858
|
+
el: null,
|
|
2859
|
+
anchor: null,
|
|
2860
|
+
target: null,
|
|
2861
|
+
targetStart: null,
|
|
2862
|
+
targetAnchor: null,
|
|
2863
|
+
staticCount: 0,
|
|
2864
|
+
shapeFlag,
|
|
2865
|
+
patchFlag,
|
|
2866
|
+
dynamicProps,
|
|
2867
|
+
dynamicChildren: null,
|
|
2868
|
+
appContext: null,
|
|
2869
|
+
ctx: currentRenderingInstance
|
|
2870
|
+
};
|
|
2871
|
+
if (needFullChildrenNormalization) {
|
|
2872
|
+
normalizeChildren(vnode, children);
|
|
2873
|
+
if (shapeFlag & 128) {
|
|
2874
|
+
type.normalize(vnode);
|
|
2875
|
+
}
|
|
2876
|
+
} else if (children) {
|
|
2877
|
+
vnode.shapeFlag |= isString(children) ? 8 : 16;
|
|
2878
|
+
}
|
|
2879
|
+
if (!!(process.env.NODE_ENV !== "production") && vnode.key !== vnode.key) {
|
|
2880
|
+
warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
|
|
2881
|
+
}
|
|
2882
|
+
if (// avoid a block node from tracking itself
|
|
2883
|
+
!isBlockNode &&
|
|
2884
|
+
// has current parent block
|
|
2885
|
+
currentBlock && (
|
|
2886
|
+
// presence of a patch flag indicates this node needs patching on updates.
|
|
2887
|
+
// component nodes also should always be patched, because even if the
|
|
2888
|
+
// component doesn't need to update, it needs to persist the instance on to
|
|
2889
|
+
// the next vnode so that it can be properly unmounted later.
|
|
2890
|
+
vnode.patchFlag > 0 || shapeFlag & 6) &&
|
|
2891
|
+
// the EVENTS flag is only for hydration and if it is the only flag, the
|
|
2892
|
+
// vnode should not be considered dynamic due to handler caching.
|
|
2893
|
+
vnode.patchFlag !== 32) {
|
|
2894
|
+
currentBlock.push(vnode);
|
|
2895
|
+
}
|
|
2896
|
+
return vnode;
|
|
2897
|
+
}
|
|
2898
|
+
const createVNode = !!(process.env.NODE_ENV !== "production") ? createVNodeWithArgsTransform : _createVNode;
|
|
2899
|
+
function _createVNode(type) {
|
|
2900
|
+
let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
2901
|
+
let children = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
2902
|
+
let patchFlag = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
2903
|
+
let dynamicProps = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
|
|
2904
|
+
let isBlockNode = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
2905
|
+
if (!type || type === NULL_DYNAMIC_COMPONENT) {
|
|
2906
|
+
if (!!(process.env.NODE_ENV !== "production") && !type) {
|
|
2907
|
+
warn$1(`Invalid vnode type when creating vnode: ${type}.`);
|
|
2908
|
+
}
|
|
2909
|
+
type = Comment;
|
|
2910
|
+
}
|
|
2911
|
+
if (isVNode(type)) {
|
|
2912
|
+
const cloned = cloneVNode(type, props, true
|
|
2913
|
+
/* mergeRef: true */);
|
|
2914
|
+
|
|
2915
|
+
if (children) {
|
|
2916
|
+
normalizeChildren(cloned, children);
|
|
2917
|
+
}
|
|
2918
|
+
if (!isBlockNode && currentBlock) {
|
|
2919
|
+
if (cloned.shapeFlag & 6) {
|
|
2920
|
+
currentBlock[currentBlock.indexOf(type)] = cloned;
|
|
2921
|
+
} else {
|
|
2922
|
+
currentBlock.push(cloned);
|
|
2923
|
+
}
|
|
2924
|
+
}
|
|
2925
|
+
cloned.patchFlag = -2;
|
|
2926
|
+
return cloned;
|
|
2927
|
+
}
|
|
2928
|
+
if (isClassComponent(type)) {
|
|
2929
|
+
type = type.__vccOpts;
|
|
2930
|
+
}
|
|
2931
|
+
if (props) {
|
|
2932
|
+
props = guardReactiveProps(props);
|
|
2933
|
+
let {
|
|
2934
|
+
class: klass,
|
|
2935
|
+
style
|
|
2936
|
+
} = props;
|
|
2937
|
+
if (klass && !isString(klass)) {
|
|
2938
|
+
props.class = normalizeClass(klass);
|
|
2939
|
+
}
|
|
2940
|
+
if (isObject(style)) {
|
|
2941
|
+
if (isProxy(style) && !isArray(style)) {
|
|
2942
|
+
style = extend({}, style);
|
|
2943
|
+
}
|
|
2944
|
+
props.style = normalizeStyle(style);
|
|
2945
|
+
}
|
|
2946
|
+
}
|
|
2947
|
+
const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction$2(type) ? 2 : 0;
|
|
2948
|
+
if (!!(process.env.NODE_ENV !== "production") && shapeFlag & 4 && isProxy(type)) {
|
|
2949
|
+
type = toRaw(type);
|
|
2950
|
+
warn$1(`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\`.`, `
|
|
2951
|
+
Component that was made reactive: `, type);
|
|
2952
|
+
}
|
|
2953
|
+
return createBaseVNode(type, props, children, patchFlag, dynamicProps, shapeFlag, isBlockNode, true);
|
|
2954
|
+
}
|
|
2955
|
+
function guardReactiveProps(props) {
|
|
2956
|
+
if (!props) return null;
|
|
2957
|
+
return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
|
|
2958
|
+
}
|
|
2959
|
+
function cloneVNode(vnode, extraProps) {
|
|
2960
|
+
let mergeRef = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
2961
|
+
let cloneTransition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
2962
|
+
const {
|
|
2963
|
+
props,
|
|
2964
|
+
ref,
|
|
2965
|
+
patchFlag,
|
|
2966
|
+
children,
|
|
2967
|
+
transition
|
|
2968
|
+
} = vnode;
|
|
2969
|
+
const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
|
|
2970
|
+
const cloned = {
|
|
2971
|
+
__v_isVNode: true,
|
|
2972
|
+
__v_skip: true,
|
|
2973
|
+
type: vnode.type,
|
|
2974
|
+
props: mergedProps,
|
|
2975
|
+
key: mergedProps && normalizeKey(mergedProps),
|
|
2976
|
+
ref: extraProps && extraProps.ref ?
|
|
2977
|
+
// #2078 in the case of <component :is="vnode" ref="extra"/>
|
|
2978
|
+
// if the vnode itself already has a ref, cloneVNode will need to merge
|
|
2979
|
+
// the refs so the single vnode can be set on multiple refs
|
|
2980
|
+
mergeRef && ref ? isArray(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps) : ref,
|
|
2981
|
+
scopeId: vnode.scopeId,
|
|
2982
|
+
slotScopeIds: vnode.slotScopeIds,
|
|
2983
|
+
children: !!(process.env.NODE_ENV !== "production") && patchFlag === -1 && isArray(children) ? children.map(deepCloneVNode) : children,
|
|
2984
|
+
target: vnode.target,
|
|
2985
|
+
targetStart: vnode.targetStart,
|
|
2986
|
+
targetAnchor: vnode.targetAnchor,
|
|
2987
|
+
staticCount: vnode.staticCount,
|
|
2988
|
+
shapeFlag: vnode.shapeFlag,
|
|
2989
|
+
// if the vnode is cloned with extra props, we can no longer assume its
|
|
2990
|
+
// existing patch flag to be reliable and need to add the FULL_PROPS flag.
|
|
2991
|
+
// note: preserve flag for fragments since they use the flag for children
|
|
2992
|
+
// fast paths only.
|
|
2993
|
+
patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,
|
|
2994
|
+
dynamicProps: vnode.dynamicProps,
|
|
2995
|
+
dynamicChildren: vnode.dynamicChildren,
|
|
2996
|
+
appContext: vnode.appContext,
|
|
2997
|
+
dirs: vnode.dirs,
|
|
2998
|
+
transition,
|
|
2999
|
+
// These should technically only be non-null on mounted VNodes. However,
|
|
3000
|
+
// they *should* be copied for kept-alive vnodes. So we just always copy
|
|
3001
|
+
// them since them being non-null during a mount doesn't affect the logic as
|
|
3002
|
+
// they will simply be overwritten.
|
|
3003
|
+
component: vnode.component,
|
|
3004
|
+
suspense: vnode.suspense,
|
|
3005
|
+
ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
|
|
3006
|
+
ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
|
|
3007
|
+
el: vnode.el,
|
|
3008
|
+
anchor: vnode.anchor,
|
|
3009
|
+
ctx: vnode.ctx,
|
|
3010
|
+
ce: vnode.ce
|
|
3011
|
+
};
|
|
3012
|
+
if (transition && cloneTransition) {
|
|
3013
|
+
setTransitionHooks(cloned, transition.clone(cloned));
|
|
3014
|
+
}
|
|
3015
|
+
return cloned;
|
|
3016
|
+
}
|
|
3017
|
+
function deepCloneVNode(vnode) {
|
|
3018
|
+
const cloned = cloneVNode(vnode);
|
|
3019
|
+
if (isArray(vnode.children)) {
|
|
3020
|
+
cloned.children = vnode.children.map(deepCloneVNode);
|
|
3021
|
+
}
|
|
3022
|
+
return cloned;
|
|
3023
|
+
}
|
|
3024
|
+
function createTextVNode() {
|
|
3025
|
+
let text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : " ";
|
|
3026
|
+
let flag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
3027
|
+
return createVNode(Text$1, null, text, flag);
|
|
3028
|
+
}
|
|
3029
|
+
function normalizeChildren(vnode, children) {
|
|
3030
|
+
let type = 0;
|
|
3031
|
+
const {
|
|
3032
|
+
shapeFlag
|
|
3033
|
+
} = vnode;
|
|
3034
|
+
if (children == null) {
|
|
3035
|
+
children = null;
|
|
3036
|
+
} else if (isArray(children)) {
|
|
3037
|
+
type = 16;
|
|
3038
|
+
} else if (typeof children === "object") {
|
|
3039
|
+
if (shapeFlag & (1 | 64)) {
|
|
3040
|
+
const slot = children.default;
|
|
3041
|
+
if (slot) {
|
|
3042
|
+
slot._c && (slot._d = false);
|
|
3043
|
+
normalizeChildren(vnode, slot());
|
|
3044
|
+
slot._c && (slot._d = true);
|
|
3045
|
+
}
|
|
3046
|
+
return;
|
|
3047
|
+
} else {
|
|
3048
|
+
type = 32;
|
|
3049
|
+
const slotFlag = children._;
|
|
3050
|
+
if (!slotFlag && !isInternalObject(children)) {
|
|
3051
|
+
children._ctx = currentRenderingInstance;
|
|
3052
|
+
} else if (slotFlag === 3 && currentRenderingInstance) {
|
|
3053
|
+
if (currentRenderingInstance.slots._ === 1) {
|
|
3054
|
+
children._ = 1;
|
|
3055
|
+
} else {
|
|
3056
|
+
children._ = 2;
|
|
3057
|
+
vnode.patchFlag |= 1024;
|
|
3058
|
+
}
|
|
3059
|
+
}
|
|
3060
|
+
}
|
|
3061
|
+
} else if (isFunction$2(children)) {
|
|
3062
|
+
children = {
|
|
3063
|
+
default: children,
|
|
3064
|
+
_ctx: currentRenderingInstance
|
|
3065
|
+
};
|
|
3066
|
+
type = 32;
|
|
3067
|
+
} else {
|
|
3068
|
+
children = String(children);
|
|
3069
|
+
if (shapeFlag & 64) {
|
|
3070
|
+
type = 16;
|
|
3071
|
+
children = [createTextVNode(children)];
|
|
3072
|
+
} else {
|
|
3073
|
+
type = 8;
|
|
3074
|
+
}
|
|
3075
|
+
}
|
|
3076
|
+
vnode.children = children;
|
|
3077
|
+
vnode.shapeFlag |= type;
|
|
3078
|
+
}
|
|
3079
|
+
function mergeProps() {
|
|
3080
|
+
const ret = {};
|
|
3081
|
+
for (let i = 0; i < arguments.length; i++) {
|
|
3082
|
+
const toMerge = i < 0 || arguments.length <= i ? undefined : arguments[i];
|
|
3083
|
+
for (const key in toMerge) {
|
|
3084
|
+
if (key === "class") {
|
|
3085
|
+
if (ret.class !== toMerge.class) {
|
|
3086
|
+
ret.class = normalizeClass([ret.class, toMerge.class]);
|
|
3087
|
+
}
|
|
3088
|
+
} else if (key === "style") {
|
|
3089
|
+
ret.style = normalizeStyle([ret.style, toMerge.style]);
|
|
3090
|
+
} else if (isOn(key)) {
|
|
3091
|
+
const existing = ret[key];
|
|
3092
|
+
const incoming = toMerge[key];
|
|
3093
|
+
if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
|
|
3094
|
+
ret[key] = existing ? [].concat(existing, incoming) : incoming;
|
|
3095
|
+
}
|
|
3096
|
+
} else if (key !== "") {
|
|
3097
|
+
ret[key] = toMerge[key];
|
|
3098
|
+
}
|
|
3099
|
+
}
|
|
3100
|
+
}
|
|
3101
|
+
return ret;
|
|
3102
|
+
}
|
|
3103
|
+
let currentInstance = null;
|
|
3104
|
+
const getCurrentInstance = () => currentInstance || currentRenderingInstance;
|
|
3105
|
+
let internalSetCurrentInstance;
|
|
3106
|
+
{
|
|
3107
|
+
const g = getGlobalThis();
|
|
3108
|
+
const registerGlobalSetter = (key, setter) => {
|
|
3109
|
+
let setters;
|
|
3110
|
+
if (!(setters = g[key])) setters = g[key] = [];
|
|
3111
|
+
setters.push(setter);
|
|
3112
|
+
return v => {
|
|
3113
|
+
if (setters.length > 1) setters.forEach(set => set(v));else setters[0](v);
|
|
3114
|
+
};
|
|
3115
|
+
};
|
|
3116
|
+
internalSetCurrentInstance = registerGlobalSetter(`__VUE_INSTANCE_SETTERS__`, v => currentInstance = v);
|
|
3117
|
+
registerGlobalSetter(`__VUE_SSR_SETTERS__`, v => isInSSRComponentSetup = v);
|
|
3118
|
+
}
|
|
3119
|
+
const setCurrentInstance = instance => {
|
|
3120
|
+
const prev = currentInstance;
|
|
3121
|
+
internalSetCurrentInstance(instance);
|
|
3122
|
+
instance.scope.on();
|
|
3123
|
+
return () => {
|
|
3124
|
+
instance.scope.off();
|
|
3125
|
+
internalSetCurrentInstance(prev);
|
|
3126
|
+
};
|
|
3127
|
+
};
|
|
3128
|
+
function isStatefulComponent(instance) {
|
|
3129
|
+
return instance.vnode.shapeFlag & 4;
|
|
3130
|
+
}
|
|
3131
|
+
let isInSSRComponentSetup = false;
|
|
3132
|
+
const attrsProxyHandlers = !!(process.env.NODE_ENV !== "production") ? {
|
|
3133
|
+
get(target, key) {
|
|
3134
|
+
track(target, "get", "");
|
|
3135
|
+
return target[key];
|
|
3136
|
+
},
|
|
3137
|
+
set() {
|
|
3138
|
+
warn$1(`setupContext.attrs is readonly.`);
|
|
3139
|
+
return false;
|
|
3140
|
+
},
|
|
3141
|
+
deleteProperty() {
|
|
3142
|
+
warn$1(`setupContext.attrs is readonly.`);
|
|
3143
|
+
return false;
|
|
3144
|
+
}
|
|
3145
|
+
} : {
|
|
3146
|
+
get(target, key) {
|
|
3147
|
+
track(target, "get", "");
|
|
3148
|
+
return target[key];
|
|
3149
|
+
}
|
|
3150
|
+
};
|
|
3151
|
+
function getSlotsProxy(instance) {
|
|
3152
|
+
return new Proxy(instance.slots, {
|
|
3153
|
+
get(target, key) {
|
|
3154
|
+
track(instance, "get", "$slots");
|
|
3155
|
+
return target[key];
|
|
3156
|
+
}
|
|
3157
|
+
});
|
|
3158
|
+
}
|
|
3159
|
+
function createSetupContext(instance) {
|
|
3160
|
+
const expose = exposed => {
|
|
3161
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
3162
|
+
if (instance.exposed) {
|
|
3163
|
+
warn$1(`expose() should be called only once per setup().`);
|
|
3164
|
+
}
|
|
3165
|
+
if (exposed != null) {
|
|
3166
|
+
let exposedType = typeof exposed;
|
|
3167
|
+
if (exposedType === "object") {
|
|
3168
|
+
if (isArray(exposed)) {
|
|
3169
|
+
exposedType = "array";
|
|
3170
|
+
} else if (isRef(exposed)) {
|
|
3171
|
+
exposedType = "ref";
|
|
3172
|
+
}
|
|
3173
|
+
}
|
|
3174
|
+
if (exposedType !== "object") {
|
|
3175
|
+
warn$1(`expose() should be passed a plain object, received ${exposedType}.`);
|
|
3176
|
+
}
|
|
3177
|
+
}
|
|
3178
|
+
}
|
|
3179
|
+
instance.exposed = exposed || {};
|
|
3180
|
+
};
|
|
3181
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
3182
|
+
let attrsProxy;
|
|
3183
|
+
let slotsProxy;
|
|
3184
|
+
return Object.freeze({
|
|
3185
|
+
get attrs() {
|
|
3186
|
+
return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers));
|
|
3187
|
+
},
|
|
3188
|
+
get slots() {
|
|
3189
|
+
return slotsProxy || (slotsProxy = getSlotsProxy(instance));
|
|
3190
|
+
},
|
|
3191
|
+
get emit() {
|
|
3192
|
+
return function (event) {
|
|
3193
|
+
for (var _len8 = arguments.length, args = new Array(_len8 > 1 ? _len8 - 1 : 0), _key8 = 1; _key8 < _len8; _key8++) {
|
|
3194
|
+
args[_key8 - 1] = arguments[_key8];
|
|
3195
|
+
}
|
|
3196
|
+
return instance.emit(event, ...args);
|
|
3197
|
+
};
|
|
3198
|
+
},
|
|
3199
|
+
expose
|
|
3200
|
+
});
|
|
3201
|
+
} else {
|
|
3202
|
+
return {
|
|
3203
|
+
attrs: new Proxy(instance.attrs, attrsProxyHandlers),
|
|
3204
|
+
slots: instance.slots,
|
|
3205
|
+
emit: instance.emit,
|
|
3206
|
+
expose
|
|
3207
|
+
};
|
|
3208
|
+
}
|
|
3209
|
+
}
|
|
3210
|
+
function getComponentPublicInstance(instance) {
|
|
3211
|
+
if (instance.exposed) {
|
|
3212
|
+
return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
|
|
3213
|
+
get(target, key) {
|
|
3214
|
+
if (key in target) {
|
|
3215
|
+
return target[key];
|
|
3216
|
+
} else if (key in publicPropertiesMap) {
|
|
3217
|
+
return publicPropertiesMap[key](instance);
|
|
3218
|
+
}
|
|
3219
|
+
},
|
|
3220
|
+
has(target, key) {
|
|
3221
|
+
return key in target || key in publicPropertiesMap;
|
|
3222
|
+
}
|
|
3223
|
+
}));
|
|
3224
|
+
} else {
|
|
3225
|
+
return instance.proxy;
|
|
3226
|
+
}
|
|
3227
|
+
}
|
|
3228
|
+
const classifyRE = /(?:^|[-_])(\w)/g;
|
|
3229
|
+
const classify = str => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, "");
|
|
3230
|
+
function getComponentName(Component) {
|
|
3231
|
+
let includeInferred = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
3232
|
+
return isFunction$2(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
|
|
3233
|
+
}
|
|
3234
|
+
function formatComponentName(instance, Component) {
|
|
3235
|
+
let isRoot = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
3236
|
+
let name = getComponentName(Component);
|
|
3237
|
+
if (!name && Component.__file) {
|
|
3238
|
+
const match = Component.__file.match(/([^/\\]+)\.\w+$/);
|
|
3239
|
+
if (match) {
|
|
3240
|
+
name = match[1];
|
|
3241
|
+
}
|
|
3242
|
+
}
|
|
3243
|
+
if (!name && instance && instance.parent) {
|
|
3244
|
+
const inferFromRegistry = registry => {
|
|
3245
|
+
for (const key in registry) {
|
|
3246
|
+
if (registry[key] === Component) {
|
|
3247
|
+
return key;
|
|
3248
|
+
}
|
|
3249
|
+
}
|
|
3250
|
+
};
|
|
3251
|
+
name = inferFromRegistry(instance.components || instance.parent.type.components) || inferFromRegistry(instance.appContext.components);
|
|
3252
|
+
}
|
|
3253
|
+
return name ? classify(name) : isRoot ? `App` : `Anonymous`;
|
|
3254
|
+
}
|
|
3255
|
+
function isClassComponent(value) {
|
|
3256
|
+
return isFunction$2(value) && "__vccOpts" in value;
|
|
3257
|
+
}
|
|
3258
|
+
const computed = (getterOrOptions, debugOptions) => {
|
|
3259
|
+
const c = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
3260
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
3261
|
+
const i = getCurrentInstance();
|
|
3262
|
+
if (i && i.appContext.config.warnRecursiveComputed) {
|
|
3263
|
+
c._warnRecursive = true;
|
|
3264
|
+
}
|
|
3265
|
+
}
|
|
3266
|
+
return c;
|
|
3267
|
+
};
|
|
3268
|
+
function initCustomFormatter() {
|
|
3269
|
+
if (!!!(process.env.NODE_ENV !== "production") || typeof window === "undefined") {
|
|
3270
|
+
return;
|
|
3271
|
+
}
|
|
3272
|
+
const vueStyle = {
|
|
3273
|
+
style: "color:#3ba776"
|
|
3274
|
+
};
|
|
3275
|
+
const numberStyle = {
|
|
3276
|
+
style: "color:#1677ff"
|
|
3277
|
+
};
|
|
3278
|
+
const stringStyle = {
|
|
3279
|
+
style: "color:#f5222d"
|
|
3280
|
+
};
|
|
3281
|
+
const keywordStyle = {
|
|
3282
|
+
style: "color:#eb2f96"
|
|
3283
|
+
};
|
|
3284
|
+
const formatter = {
|
|
3285
|
+
__vue_custom_formatter: true,
|
|
3286
|
+
header(obj) {
|
|
3287
|
+
if (!isObject(obj)) {
|
|
3288
|
+
return null;
|
|
3289
|
+
}
|
|
3290
|
+
if (obj.__isVue) {
|
|
3291
|
+
return ["div", vueStyle, `VueInstance`];
|
|
3292
|
+
} else if (isRef(obj)) {
|
|
3293
|
+
return ["div", {}, ["span", vueStyle, genRefFlag(obj)], "<",
|
|
3294
|
+
// avoid debugger accessing value affecting behavior
|
|
3295
|
+
formatValue("_value" in obj ? obj._value : obj), `>`];
|
|
3296
|
+
} else if (isReactive(obj)) {
|
|
3297
|
+
return ["div", {}, ["span", vueStyle, isShallow(obj) ? "ShallowReactive" : "Reactive"], "<", formatValue(obj), `>${isReadonly(obj) ? ` (readonly)` : ``}`];
|
|
3298
|
+
} else if (isReadonly(obj)) {
|
|
3299
|
+
return ["div", {}, ["span", vueStyle, isShallow(obj) ? "ShallowReadonly" : "Readonly"], "<", formatValue(obj), ">"];
|
|
3300
|
+
}
|
|
3301
|
+
return null;
|
|
3302
|
+
},
|
|
3303
|
+
hasBody(obj) {
|
|
3304
|
+
return obj && obj.__isVue;
|
|
3305
|
+
},
|
|
3306
|
+
body(obj) {
|
|
3307
|
+
if (obj && obj.__isVue) {
|
|
3308
|
+
return ["div", {}, ...formatInstance(obj.$)];
|
|
3309
|
+
}
|
|
3310
|
+
}
|
|
3311
|
+
};
|
|
3312
|
+
function formatInstance(instance) {
|
|
3313
|
+
const blocks = [];
|
|
3314
|
+
if (instance.type.props && instance.props) {
|
|
3315
|
+
blocks.push(createInstanceBlock("props", toRaw(instance.props)));
|
|
3316
|
+
}
|
|
3317
|
+
if (instance.setupState !== EMPTY_OBJ) {
|
|
3318
|
+
blocks.push(createInstanceBlock("setup", instance.setupState));
|
|
3319
|
+
}
|
|
3320
|
+
if (instance.data !== EMPTY_OBJ) {
|
|
3321
|
+
blocks.push(createInstanceBlock("data", toRaw(instance.data)));
|
|
3322
|
+
}
|
|
3323
|
+
const computed = extractKeys(instance, "computed");
|
|
3324
|
+
if (computed) {
|
|
3325
|
+
blocks.push(createInstanceBlock("computed", computed));
|
|
3326
|
+
}
|
|
3327
|
+
const injected = extractKeys(instance, "inject");
|
|
3328
|
+
if (injected) {
|
|
3329
|
+
blocks.push(createInstanceBlock("injected", injected));
|
|
3330
|
+
}
|
|
3331
|
+
blocks.push(["div", {}, ["span", {
|
|
3332
|
+
style: keywordStyle.style + ";opacity:0.66"
|
|
3333
|
+
}, "$ (internal): "], ["object", {
|
|
3334
|
+
object: instance
|
|
3335
|
+
}]]);
|
|
3336
|
+
return blocks;
|
|
3337
|
+
}
|
|
3338
|
+
function createInstanceBlock(type, target) {
|
|
3339
|
+
target = extend({}, target);
|
|
3340
|
+
if (!Object.keys(target).length) {
|
|
3341
|
+
return ["span", {}];
|
|
3342
|
+
}
|
|
3343
|
+
return ["div", {
|
|
3344
|
+
style: "line-height:1.25em;margin-bottom:0.6em"
|
|
3345
|
+
}, ["div", {
|
|
3346
|
+
style: "color:#476582"
|
|
3347
|
+
}, type], ["div", {
|
|
3348
|
+
style: "padding-left:1.25em"
|
|
3349
|
+
}, ...Object.keys(target).map(key => {
|
|
3350
|
+
return ["div", {}, ["span", keywordStyle, key + ": "], formatValue(target[key], false)];
|
|
3351
|
+
})]];
|
|
3352
|
+
}
|
|
3353
|
+
function formatValue(v) {
|
|
3354
|
+
let asRaw = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
3355
|
+
if (typeof v === "number") {
|
|
3356
|
+
return ["span", numberStyle, v];
|
|
3357
|
+
} else if (typeof v === "string") {
|
|
3358
|
+
return ["span", stringStyle, JSON.stringify(v)];
|
|
3359
|
+
} else if (typeof v === "boolean") {
|
|
3360
|
+
return ["span", keywordStyle, v];
|
|
3361
|
+
} else if (isObject(v)) {
|
|
3362
|
+
return ["object", {
|
|
3363
|
+
object: asRaw ? toRaw(v) : v
|
|
3364
|
+
}];
|
|
3365
|
+
} else {
|
|
3366
|
+
return ["span", stringStyle, String(v)];
|
|
3367
|
+
}
|
|
3368
|
+
}
|
|
3369
|
+
function extractKeys(instance, type) {
|
|
3370
|
+
const Comp = instance.type;
|
|
3371
|
+
if (isFunction$2(Comp)) {
|
|
3372
|
+
return;
|
|
3373
|
+
}
|
|
3374
|
+
const extracted = {};
|
|
3375
|
+
for (const key in instance.ctx) {
|
|
3376
|
+
if (isKeyOfType(Comp, key, type)) {
|
|
3377
|
+
extracted[key] = instance.ctx[key];
|
|
3378
|
+
}
|
|
3379
|
+
}
|
|
3380
|
+
return extracted;
|
|
3381
|
+
}
|
|
3382
|
+
function isKeyOfType(Comp, key, type) {
|
|
3383
|
+
const opts = Comp[type];
|
|
3384
|
+
if (isArray(opts) && opts.includes(key) || isObject(opts) && key in opts) {
|
|
3385
|
+
return true;
|
|
3386
|
+
}
|
|
3387
|
+
if (Comp.extends && isKeyOfType(Comp.extends, key, type)) {
|
|
3388
|
+
return true;
|
|
3389
|
+
}
|
|
3390
|
+
if (Comp.mixins && Comp.mixins.some(m => isKeyOfType(m, key, type))) {
|
|
3391
|
+
return true;
|
|
3392
|
+
}
|
|
3393
|
+
}
|
|
3394
|
+
function genRefFlag(v) {
|
|
3395
|
+
if (isShallow(v)) {
|
|
3396
|
+
return `ShallowRef`;
|
|
3397
|
+
}
|
|
3398
|
+
if (v.effect) {
|
|
3399
|
+
return `ComputedRef`;
|
|
3400
|
+
}
|
|
3401
|
+
return `Ref`;
|
|
3402
|
+
}
|
|
3403
|
+
if (window.devtoolsFormatters) {
|
|
3404
|
+
window.devtoolsFormatters.push(formatter);
|
|
3405
|
+
} else {
|
|
3406
|
+
window.devtoolsFormatters = [formatter];
|
|
3407
|
+
}
|
|
3408
|
+
}
|
|
3409
|
+
!!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
|
|
3410
|
+
!!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
|
|
3411
|
+
!!(process.env.NODE_ENV !== "production") || true ? setDevtoolsHook$1 : NOOP;
|
|
3412
|
+
|
|
3413
|
+
/**
|
|
3414
|
+
* vue v3.5.0
|
|
3415
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
3416
|
+
* @license MIT
|
|
3417
|
+
**/
|
|
3418
|
+
function initDev() {
|
|
3419
|
+
{
|
|
3420
|
+
initCustomFormatter();
|
|
3421
|
+
}
|
|
3422
|
+
}
|
|
3423
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
3424
|
+
initDev();
|
|
3425
|
+
}
|
|
3426
|
+
|
|
3427
|
+
const isFunction = value => "function" == typeof value;
|
|
3428
|
+
var isFunction$1 = isFunction;
|
|
3429
|
+
|
|
3430
|
+
function flattenVNodes(vnodes) {
|
|
3431
|
+
return vnodes.flatMap(vnode => (Array.isArray(vnode.children) ? flattenVNodes(vnode.children) : vnode));
|
|
3432
|
+
}
|
|
3433
|
+
function isEventProp(key, props) {
|
|
3434
|
+
return key.startsWith('on') && isFunction$1(props[key]);
|
|
3435
|
+
}
|
|
3436
|
+
function createCustomLayout(children) {
|
|
3437
|
+
const componentMap = {
|
|
3438
|
+
Group: VTable__namespace.CustomLayout.Group,
|
|
3439
|
+
Image: VTable__namespace.CustomLayout.Image,
|
|
3440
|
+
Text: VTable__namespace.CustomLayout.Text,
|
|
3441
|
+
Tag: VTable__namespace.CustomLayout.Tag,
|
|
3442
|
+
Radio: VTable__namespace.CustomLayout.Radio,
|
|
3443
|
+
CheckBox: VTable__namespace.CustomLayout.CheckBox
|
|
3444
|
+
};
|
|
3445
|
+
function createComponent(child) {
|
|
3446
|
+
if (!child) {
|
|
3447
|
+
return null;
|
|
3448
|
+
}
|
|
3449
|
+
const { type, props, children: childChildren } = child;
|
|
3450
|
+
const componentName = type?.name || type;
|
|
3451
|
+
const ComponentClass = componentMap[componentName];
|
|
3452
|
+
if (!ComponentClass) {
|
|
3453
|
+
return null;
|
|
3454
|
+
}
|
|
3455
|
+
const component = new ComponentClass({ ...props });
|
|
3456
|
+
bindComponentEvents(component, props);
|
|
3457
|
+
const subChildren = resolveChildren(childChildren);
|
|
3458
|
+
subChildren.forEach((subChild) => {
|
|
3459
|
+
const subComponent = createComponent(subChild);
|
|
3460
|
+
if (subComponent) {
|
|
3461
|
+
component.add(subComponent);
|
|
3462
|
+
}
|
|
3463
|
+
else if (subChild.type === Symbol.for('v-fgt')) {
|
|
3464
|
+
subChild.children.forEach((nestedChild) => {
|
|
3465
|
+
const nestedComponent = createComponent(nestedChild);
|
|
3466
|
+
if (nestedComponent) {
|
|
3467
|
+
component.add(nestedComponent);
|
|
3468
|
+
}
|
|
3469
|
+
});
|
|
3470
|
+
}
|
|
3471
|
+
});
|
|
3472
|
+
return component;
|
|
3473
|
+
}
|
|
3474
|
+
function resolveChildren(childChildren) {
|
|
3475
|
+
return childChildren?.default?.() || childChildren || [];
|
|
3476
|
+
}
|
|
3477
|
+
function bindComponentEvents(component, props) {
|
|
3478
|
+
Object.keys(props).forEach(key => {
|
|
3479
|
+
if (isEventProp(key, props)) {
|
|
3480
|
+
const eventName = key.slice(2).toLowerCase();
|
|
3481
|
+
component.addEventListener(eventName, props[key]);
|
|
3482
|
+
}
|
|
3483
|
+
});
|
|
3484
|
+
}
|
|
3485
|
+
return { rootComponent: createComponent(children) };
|
|
3486
|
+
}
|
|
3487
|
+
|
|
3488
|
+
const EVENT_TYPE = {
|
|
3489
|
+
...VTable.ListTable.EVENT_TYPE,
|
|
3490
|
+
...VTable.PivotTable.EVENT_TYPE,
|
|
3491
|
+
...VTable.PivotChart.EVENT_TYPE
|
|
3492
|
+
};
|
|
3493
|
+
const TABLE_EVENTS = {
|
|
3494
|
+
onClickCell: EVENT_TYPE.CLICK_CELL,
|
|
3495
|
+
onDblClickCell: EVENT_TYPE.DBLCLICK_CELL,
|
|
3496
|
+
onMouseDownCell: EVENT_TYPE.MOUSEDOWN_CELL,
|
|
3497
|
+
onMouseUpCell: EVENT_TYPE.MOUSEUP_CELL,
|
|
3498
|
+
onSelectedCell: EVENT_TYPE.SELECTED_CELL,
|
|
3499
|
+
onKeyDown: EVENT_TYPE.KEYDOWN,
|
|
3500
|
+
onMouseEnterTable: EVENT_TYPE.MOUSEENTER_TABLE,
|
|
3501
|
+
onMouseLeaveTable: EVENT_TYPE.MOUSELEAVE_TABLE,
|
|
3502
|
+
onMouseDownTable: EVENT_TYPE.MOUSEDOWN_TABLE,
|
|
3503
|
+
onMouseMoveCell: EVENT_TYPE.MOUSEMOVE_CELL,
|
|
3504
|
+
onMouseEnterCell: EVENT_TYPE.MOUSEENTER_CELL,
|
|
3505
|
+
onMouseLeaveCell: EVENT_TYPE.MOUSELEAVE_CELL,
|
|
3506
|
+
onContextMenuCell: EVENT_TYPE.CONTEXTMENU_CELL,
|
|
3507
|
+
onResizeColumn: EVENT_TYPE.RESIZE_COLUMN,
|
|
3508
|
+
onResizeColumnEnd: EVENT_TYPE.RESIZE_COLUMN_END,
|
|
3509
|
+
onChangeHeaderPosition: EVENT_TYPE.CHANGE_HEADER_POSITION,
|
|
3510
|
+
onSortClick: EVENT_TYPE.SORT_CLICK,
|
|
3511
|
+
onFreezeClick: EVENT_TYPE.FREEZE_CLICK,
|
|
3512
|
+
onScroll: EVENT_TYPE.SCROLL,
|
|
3513
|
+
onDropdownMenuClick: EVENT_TYPE.DROPDOWN_MENU_CLICK,
|
|
3514
|
+
onMouseOverChartSymbol: EVENT_TYPE.MOUSEOVER_CHART_SYMBOL,
|
|
3515
|
+
onDragSelectEnd: EVENT_TYPE.DRAG_SELECT_END,
|
|
3516
|
+
onDropdownIconClick: EVENT_TYPE.DROPDOWN_ICON_CLICK,
|
|
3517
|
+
onDropdownMenuClear: EVENT_TYPE.DROPDOWN_MENU_CLEAR,
|
|
3518
|
+
onTreeHierarchyStateChange: EVENT_TYPE.TREE_HIERARCHY_STATE_CHANGE,
|
|
3519
|
+
onShowMenu: EVENT_TYPE.SHOW_MENU,
|
|
3520
|
+
onHideMenu: EVENT_TYPE.HIDE_MENU,
|
|
3521
|
+
onIconClick: EVENT_TYPE.ICON_CLICK,
|
|
3522
|
+
onLegendItemClick: EVENT_TYPE.LEGEND_ITEM_CLICK,
|
|
3523
|
+
onLegendItemHover: EVENT_TYPE.LEGEND_ITEM_HOVER,
|
|
3524
|
+
onLegendItemUnHover: EVENT_TYPE.LEGEND_ITEM_UNHOVER,
|
|
3525
|
+
onLegendChange: EVENT_TYPE.LEGEND_CHANGE,
|
|
3526
|
+
onMouseEnterAxis: EVENT_TYPE.MOUSEENTER_AXIS,
|
|
3527
|
+
onMouseLeaveAxis: EVENT_TYPE.MOUSELEAVE_AXIS,
|
|
3528
|
+
onCheckboxStateChange: EVENT_TYPE.CHECKBOX_STATE_CHANGE,
|
|
3529
|
+
onRadioStateChange: EVENT_TYPE.RADIO_STATE_CHANGE,
|
|
3530
|
+
onAfterRender: EVENT_TYPE.AFTER_RENDER,
|
|
3531
|
+
onInitialized: EVENT_TYPE.INITIALIZED,
|
|
3532
|
+
onPivotSortClick: EVENT_TYPE.PIVOT_SORT_CLICK,
|
|
3533
|
+
onDrillMenuClick: EVENT_TYPE.DRILLMENU_CLICK,
|
|
3534
|
+
onVChartEventType: EVENT_TYPE.VCHART_EVENT_TYPE,
|
|
3535
|
+
onChangCellValue: EVENT_TYPE.CHANGE_CELL_VALUE,
|
|
3536
|
+
onMousedownFillHandle: EVENT_TYPE.MOUSEDOWN_FILL_HANDLE,
|
|
3537
|
+
onDragFillHandleEnd: EVENT_TYPE.DRAG_FILL_HANDLE_END,
|
|
3538
|
+
onDblclickFillHandle: EVENT_TYPE.DBLCLICK_FILL_HANDLE,
|
|
3539
|
+
onScrollVerticalEnd: EVENT_TYPE.SCROLL_VERTICAL_END,
|
|
3540
|
+
onScrollHorizontalEnd: EVENT_TYPE.SCROLL_HORIZONTAL_END
|
|
3541
|
+
};
|
|
3542
|
+
const TABLE_EVENTS_KEYS = Object.keys(TABLE_EVENTS);
|
|
3543
|
+
|
|
3544
|
+
var _sfc_main$3 = defineComponent({
|
|
3545
|
+
__name: 'base-table',
|
|
3546
|
+
props: {
|
|
3547
|
+
type: { type: String, required: false },
|
|
3548
|
+
options: { type: null, required: false },
|
|
3549
|
+
records: { type: Array, required: false },
|
|
3550
|
+
width: { type: [Number, String], required: false, default: '100%' },
|
|
3551
|
+
height: { type: [Number, String], required: false, default: '100%' },
|
|
3552
|
+
onReady: { type: Function, required: false },
|
|
3553
|
+
onError: { type: Function, required: false },
|
|
3554
|
+
onClickCell: { type: null, required: false },
|
|
3555
|
+
onDblClickCell: { type: null, required: false },
|
|
3556
|
+
onMouseDownCell: { type: null, required: false },
|
|
3557
|
+
onMouseUpCell: { type: null, required: false },
|
|
3558
|
+
onSelectedCell: { type: null, required: false },
|
|
3559
|
+
onKeyDown: { type: null, required: false },
|
|
3560
|
+
onMouseEnterTable: { type: null, required: false },
|
|
3561
|
+
onMouseLeaveTable: { type: null, required: false },
|
|
3562
|
+
onMouseDownTable: { type: null, required: false },
|
|
3563
|
+
onMouseMoveCell: { type: null, required: false },
|
|
3564
|
+
onMouseEnterCell: { type: null, required: false },
|
|
3565
|
+
onMouseLeaveCell: { type: null, required: false },
|
|
3566
|
+
onContextMenuCell: { type: null, required: false },
|
|
3567
|
+
onResizeColumn: { type: null, required: false },
|
|
3568
|
+
onResizeColumnEnd: { type: null, required: false },
|
|
3569
|
+
onChangeHeaderPosition: { type: null, required: false },
|
|
3570
|
+
onSortClick: { type: null, required: false },
|
|
3571
|
+
onFreezeClick: { type: null, required: false },
|
|
3572
|
+
onScroll: { type: null, required: false },
|
|
3573
|
+
onDropdownMenuClick: { type: null, required: false },
|
|
3574
|
+
onMouseOverChartSymbol: { type: null, required: false },
|
|
3575
|
+
onDragSelectEnd: { type: null, required: false },
|
|
3576
|
+
onDropdownIconClick: { type: null, required: false },
|
|
3577
|
+
onDropdownMenuClear: { type: null, required: false },
|
|
3578
|
+
onTreeHierarchyStateChange: { type: null, required: false },
|
|
3579
|
+
onShowMenu: { type: null, required: false },
|
|
3580
|
+
onHideMenu: { type: null, required: false },
|
|
3581
|
+
onIconClick: { type: null, required: false },
|
|
3582
|
+
onLegendItemClick: { type: null, required: false },
|
|
3583
|
+
onLegendItemHover: { type: null, required: false },
|
|
3584
|
+
onLegendItemUnHover: { type: null, required: false },
|
|
3585
|
+
onLegendChange: { type: null, required: false },
|
|
3586
|
+
onMouseEnterAxis: { type: null, required: false },
|
|
3587
|
+
onMouseLeaveAxis: { type: null, required: false },
|
|
3588
|
+
onCheckboxStateChange: { type: null, required: false },
|
|
3589
|
+
onRadioStateChange: { type: null, required: false },
|
|
3590
|
+
onAfterRender: { type: null, required: false },
|
|
3591
|
+
onInitialized: { type: null, required: false },
|
|
3592
|
+
onPivotSortClick: { type: null, required: false },
|
|
3593
|
+
onDrillMenuClick: { type: null, required: false },
|
|
3594
|
+
onVChartEventType: { type: null, required: false },
|
|
3595
|
+
onChangCellValue: { type: null, required: false },
|
|
3596
|
+
onMousedownFillHandle: { type: null, required: false },
|
|
3597
|
+
onDragFillHandleEnd: { type: null, required: false },
|
|
3598
|
+
onDblclickFillHandle: { type: null, required: false },
|
|
3599
|
+
onScrollVerticalEnd: { type: null, required: false },
|
|
3600
|
+
onScrollHorizontalEnd: { type: null, required: false }
|
|
3601
|
+
},
|
|
3602
|
+
emits: TABLE_EVENTS_KEYS,
|
|
3603
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
3604
|
+
const props = __props;
|
|
3605
|
+
const vTableContainer = ref(null);
|
|
3606
|
+
const vTableInstance = shallowRef(null);
|
|
3607
|
+
__expose({ vTableInstance });
|
|
3608
|
+
const containerWidth = computed(() => (typeof props.width === 'number' ? `${props.width}px` : props.width));
|
|
3609
|
+
const containerHeight = computed(() => (typeof props.height === 'number' ? `${props.height}px` : props.height));
|
|
3610
|
+
const emit = __emit;
|
|
3611
|
+
const bindEvents = (instance) => {
|
|
3612
|
+
TABLE_EVENTS_KEYS.forEach(eventKey => {
|
|
3613
|
+
const vueEventHandler = (event) => {
|
|
3614
|
+
emit(eventKey, event);
|
|
3615
|
+
};
|
|
3616
|
+
instance.on(TABLE_EVENTS[eventKey], vueEventHandler);
|
|
3617
|
+
});
|
|
3618
|
+
};
|
|
3619
|
+
const createVTable = () => {
|
|
3620
|
+
if (!vTableContainer.value)
|
|
3621
|
+
return;
|
|
3622
|
+
if (vTableInstance.value) {
|
|
3623
|
+
vTableInstance.value.release();
|
|
3624
|
+
}
|
|
3625
|
+
const getRecords = () => {
|
|
3626
|
+
return props.records !== undefined && props.records !== null && props.records.length > 0 ? props.records : props.options.records;
|
|
3627
|
+
};
|
|
3628
|
+
const createTableInstance = (Type, options) => {
|
|
3629
|
+
vTableInstance.value = new Type(vTableContainer.value, options);
|
|
3630
|
+
};
|
|
3631
|
+
try {
|
|
3632
|
+
switch (props.type) {
|
|
3633
|
+
case 'list':
|
|
3634
|
+
createTableInstance(VTable.ListTable, {
|
|
3635
|
+
...props.options,
|
|
3636
|
+
records: getRecords()
|
|
3637
|
+
});
|
|
3638
|
+
break;
|
|
3639
|
+
case 'pivot':
|
|
3640
|
+
createTableInstance(VTable.PivotTable, {
|
|
3641
|
+
...props.options,
|
|
3642
|
+
records: getRecords()
|
|
3643
|
+
});
|
|
3644
|
+
break;
|
|
3645
|
+
case 'chart':
|
|
3646
|
+
createTableInstance(VTable.PivotChart, {
|
|
3647
|
+
...props.options,
|
|
3648
|
+
records: getRecords()
|
|
3649
|
+
});
|
|
3650
|
+
break;
|
|
3651
|
+
}
|
|
3652
|
+
bindEvents(vTableInstance.value);
|
|
3653
|
+
props.onReady?.(vTableInstance.value, true);
|
|
3654
|
+
}
|
|
3655
|
+
catch (err) {
|
|
3656
|
+
}
|
|
3657
|
+
};
|
|
3658
|
+
const updateVTable = (newOptions) => {
|
|
3659
|
+
if (!vTableInstance.value)
|
|
3660
|
+
return;
|
|
3661
|
+
try {
|
|
3662
|
+
switch (props.type) {
|
|
3663
|
+
case 'list':
|
|
3664
|
+
if (vTableInstance.value instanceof VTable.ListTable) {
|
|
3665
|
+
vTableInstance.value.updateOption(newOptions);
|
|
3666
|
+
}
|
|
3667
|
+
break;
|
|
3668
|
+
case 'pivot':
|
|
3669
|
+
if (vTableInstance.value instanceof VTable.PivotTable) {
|
|
3670
|
+
vTableInstance.value.updateOption(newOptions);
|
|
3671
|
+
}
|
|
3672
|
+
break;
|
|
3673
|
+
case 'chart':
|
|
3674
|
+
if (vTableInstance.value instanceof VTable.PivotChart) {
|
|
3675
|
+
vTableInstance.value.updateOption(newOptions);
|
|
3676
|
+
}
|
|
3677
|
+
break;
|
|
3678
|
+
}
|
|
3679
|
+
}
|
|
3680
|
+
catch (err) {
|
|
3681
|
+
props.onError?.(err);
|
|
3682
|
+
}
|
|
3683
|
+
};
|
|
3684
|
+
onMounted(createVTable);
|
|
3685
|
+
onBeforeUnmount(() => vTableInstance.value?.release());
|
|
3686
|
+
watch(() => props.options, (newOptions) => {
|
|
3687
|
+
if (vTableInstance.value) {
|
|
3688
|
+
updateVTable(newOptions);
|
|
3689
|
+
}
|
|
3690
|
+
else {
|
|
3691
|
+
createVTable();
|
|
3692
|
+
}
|
|
3693
|
+
}, { deep: true });
|
|
3694
|
+
watch(() => props.records, (newRecords, oldRecords) => {
|
|
3695
|
+
if (vTableInstance.value) {
|
|
3696
|
+
updateVTable({ ...props.options, records: newRecords });
|
|
3697
|
+
}
|
|
3698
|
+
else {
|
|
3699
|
+
createVTable();
|
|
3700
|
+
}
|
|
3701
|
+
}, { deep: true });
|
|
3702
|
+
return (_ctx, _cache) => {
|
|
3703
|
+
return (openBlock(), createElementBlock("div", {
|
|
3704
|
+
ref_key: "vTableContainer",
|
|
3705
|
+
ref: vTableContainer,
|
|
3706
|
+
style: normalizeStyle([{ width: containerWidth.value, height: containerHeight.value }, { "position": "relative" }])
|
|
3707
|
+
}, null, 4));
|
|
3708
|
+
};
|
|
3709
|
+
}
|
|
3710
|
+
});
|
|
3711
|
+
|
|
3712
|
+
var _sfc_main$2 = defineComponent({
|
|
3713
|
+
__name: 'list-table',
|
|
3714
|
+
props: {
|
|
3715
|
+
options: { type: Object, required: true },
|
|
3716
|
+
records: { type: Array, required: false },
|
|
3717
|
+
width: { type: [String, Number], required: false },
|
|
3718
|
+
height: { type: [String, Number], required: false }
|
|
3719
|
+
},
|
|
3720
|
+
setup(__props, { expose: __expose }) {
|
|
3721
|
+
const props = __props;
|
|
3722
|
+
const baseTableRef = ref(null);
|
|
3723
|
+
const slots = useSlots();
|
|
3724
|
+
const computedOptions = computed(() => {
|
|
3725
|
+
const flattenedSlots = flattenVNodes(slots.default?.() || []);
|
|
3726
|
+
const slotOptions = extractSlotOptions(flattenedSlots);
|
|
3727
|
+
return {
|
|
3728
|
+
...props.options,
|
|
3729
|
+
columns: slotOptions.columns.length ? slotOptions.columns : props.options.columns,
|
|
3730
|
+
tooltip: slotOptions.tooltip || props.options.tooltip,
|
|
3731
|
+
menu: slotOptions.menu || props.options.menu,
|
|
3732
|
+
};
|
|
3733
|
+
});
|
|
3734
|
+
function extractSlotOptions(vnodes) {
|
|
3735
|
+
const options = {
|
|
3736
|
+
columns: [],
|
|
3737
|
+
tooltip: {},
|
|
3738
|
+
menu: {},
|
|
3739
|
+
};
|
|
3740
|
+
const typeMapping = {
|
|
3741
|
+
ListColumn: 'columns',
|
|
3742
|
+
Tooltip: 'tooltip',
|
|
3743
|
+
Menu: 'menu',
|
|
3744
|
+
};
|
|
3745
|
+
vnodes.forEach(vnode => {
|
|
3746
|
+
const typeName = vnode.type?.name || vnode.type?.__name;
|
|
3747
|
+
const optionKey = typeMapping[typeName];
|
|
3748
|
+
if (optionKey) {
|
|
3749
|
+
if (optionKey === 'columns' && vnode.children) {
|
|
3750
|
+
vnode.props.customLayout = createCustomLayoutHandler(vnode.children);
|
|
3751
|
+
}
|
|
3752
|
+
if (Array.isArray(options[optionKey])) {
|
|
3753
|
+
options[optionKey].push(vnode.props);
|
|
3754
|
+
}
|
|
3755
|
+
else {
|
|
3756
|
+
options[optionKey] = vnode.props;
|
|
3757
|
+
}
|
|
3758
|
+
}
|
|
3759
|
+
});
|
|
3760
|
+
return options;
|
|
3761
|
+
}
|
|
3762
|
+
function createCustomLayoutHandler(children) {
|
|
3763
|
+
return (args) => {
|
|
3764
|
+
const { table, row, col, rect } = args;
|
|
3765
|
+
const record = table.getCellOriginRecord(col, row);
|
|
3766
|
+
const { height, width } = rect ?? table.getCellRect(col, row);
|
|
3767
|
+
const rootContainer = children.customLayout({ table, row, col, rect, record, height, width })[0];
|
|
3768
|
+
const { rootComponent } = createCustomLayout(rootContainer);
|
|
3769
|
+
return {
|
|
3770
|
+
rootContainer: rootComponent,
|
|
3771
|
+
renderDefault: false,
|
|
3772
|
+
};
|
|
3773
|
+
};
|
|
3774
|
+
}
|
|
3775
|
+
__expose({
|
|
3776
|
+
vTableInstance: computed(() => baseTableRef.value?.vTableInstance || null),
|
|
3777
|
+
});
|
|
3778
|
+
return (_ctx, _cache) => {
|
|
3779
|
+
return (openBlock(), createElementBlock(Fragment, null, [
|
|
3780
|
+
createVNode(_sfc_main$3, mergeProps({
|
|
3781
|
+
type: "list",
|
|
3782
|
+
options: computedOptions.value,
|
|
3783
|
+
records: _ctx.records,
|
|
3784
|
+
width: _ctx.width,
|
|
3785
|
+
height: _ctx.height,
|
|
3786
|
+
ref_key: "baseTableRef",
|
|
3787
|
+
ref: baseTableRef
|
|
3788
|
+
}, _ctx.$attrs), null, 16, ["options", "records", "width", "height"]),
|
|
3789
|
+
renderSlot(_ctx.$slots, "default")
|
|
3790
|
+
], 64));
|
|
3791
|
+
};
|
|
3792
|
+
}
|
|
3793
|
+
});
|
|
3794
|
+
|
|
3795
|
+
var _sfc_main$1 = defineComponent({
|
|
3796
|
+
__name: 'pivot-table',
|
|
3797
|
+
props: {
|
|
3798
|
+
options: { type: Object, required: true },
|
|
3799
|
+
records: { type: Array, required: false },
|
|
3800
|
+
width: { type: [String, Number], required: false },
|
|
3801
|
+
height: { type: [String, Number], required: false }
|
|
3802
|
+
},
|
|
3803
|
+
setup(__props, { expose: __expose }) {
|
|
3804
|
+
const props = __props;
|
|
3805
|
+
const baseTableRef = shallowRef(null);
|
|
3806
|
+
const slots = useSlots();
|
|
3807
|
+
const computedOptions = computed(() => {
|
|
3808
|
+
const flattenedSlots = flattenVNodes(slots.default?.() || []);
|
|
3809
|
+
const options = {
|
|
3810
|
+
columns: [],
|
|
3811
|
+
columnHeaderTitle: [],
|
|
3812
|
+
rows: [],
|
|
3813
|
+
rowHeaderTitle: [],
|
|
3814
|
+
indicators: [],
|
|
3815
|
+
corner: Object,
|
|
3816
|
+
tooltip: Object,
|
|
3817
|
+
menu: Object,
|
|
3818
|
+
};
|
|
3819
|
+
const typeMapping = {
|
|
3820
|
+
'PivotColumnDimension': 'columns',
|
|
3821
|
+
'PivotColumnHeaderTitle': 'columnHeaderTitle',
|
|
3822
|
+
'PivotRowDimension': 'rows',
|
|
3823
|
+
'PivotRowHeaderTitle': 'rowHeaderTitle',
|
|
3824
|
+
'PivotCorner': 'corner',
|
|
3825
|
+
'PivotIndicator': 'indicators',
|
|
3826
|
+
'Tooltip': 'tooltip',
|
|
3827
|
+
'Menu': 'menu',
|
|
3828
|
+
};
|
|
3829
|
+
flattenedSlots.forEach(vnode => {
|
|
3830
|
+
const typeName = vnode.type?.name || vnode.type?.__name;
|
|
3831
|
+
const optionKey = typeMapping[typeName];
|
|
3832
|
+
if (optionKey) {
|
|
3833
|
+
if (Array.isArray(options[optionKey])) {
|
|
3834
|
+
options[optionKey].push(vnode.props);
|
|
3835
|
+
}
|
|
3836
|
+
else {
|
|
3837
|
+
options[optionKey] = vnode.props;
|
|
3838
|
+
}
|
|
3839
|
+
}
|
|
3840
|
+
});
|
|
3841
|
+
return {
|
|
3842
|
+
...props.options,
|
|
3843
|
+
columns: options.columns.length ? options.columns : props.options.columns,
|
|
3844
|
+
columnHeaderTitle: options.columnHeaderTitle.length ? options.columnHeaderTitle : props.options.columnHeaderTitle,
|
|
3845
|
+
rows: options.rows.length ? options.rows : props.options.rows,
|
|
3846
|
+
rowHeaderTitle: options.rowHeaderTitle.length ? options.rowHeaderTitle : props.options.rowHeaderTitle,
|
|
3847
|
+
indicators: options.indicators.length ? options.indicators : props.options.indicators,
|
|
3848
|
+
corner: options.corner || props.options.corner,
|
|
3849
|
+
tooltip: options.tooltip || props.options.tooltip,
|
|
3850
|
+
menu: options.menu || props.options.menu,
|
|
3851
|
+
};
|
|
3852
|
+
});
|
|
3853
|
+
__expose({ vTableInstance: computed(() => baseTableRef.value?.vTableInstance || null) });
|
|
3854
|
+
return (_ctx, _cache) => {
|
|
3855
|
+
return (openBlock(), createElementBlock(Fragment, null, [
|
|
3856
|
+
createVNode(_sfc_main$3, mergeProps({
|
|
3857
|
+
type: "pivot",
|
|
3858
|
+
options: computedOptions.value,
|
|
3859
|
+
records: _ctx.records,
|
|
3860
|
+
width: _ctx.width,
|
|
3861
|
+
height: _ctx.height,
|
|
3862
|
+
ref_key: "baseTableRef",
|
|
3863
|
+
ref: baseTableRef
|
|
3864
|
+
}, _ctx.$attrs), null, 16, ["options", "records", "width", "height"]),
|
|
3865
|
+
renderSlot(_ctx.$slots, "default")
|
|
3866
|
+
], 64));
|
|
3867
|
+
};
|
|
3868
|
+
}
|
|
3869
|
+
});
|
|
3870
|
+
|
|
3871
|
+
var _sfc_main = defineComponent({
|
|
3872
|
+
__name: 'pivot-chart',
|
|
3873
|
+
props: {
|
|
3874
|
+
options: { type: Object, required: true },
|
|
3875
|
+
records: { type: Array, required: false },
|
|
3876
|
+
width: { type: [String, Number], required: false },
|
|
3877
|
+
height: { type: [String, Number], required: false }
|
|
3878
|
+
},
|
|
3879
|
+
setup(__props, { expose: __expose }) {
|
|
3880
|
+
const props = __props;
|
|
3881
|
+
const baseTableRef = shallowRef(null);
|
|
3882
|
+
const slots = useSlots();
|
|
3883
|
+
const computedOptions = computed(() => {
|
|
3884
|
+
const flattenedSlots = flattenVNodes(slots.default?.() || []);
|
|
3885
|
+
const options = {
|
|
3886
|
+
columns: [],
|
|
3887
|
+
columnHeaderTitle: [],
|
|
3888
|
+
rows: [],
|
|
3889
|
+
rowHeaderTitle: [],
|
|
3890
|
+
indicators: [],
|
|
3891
|
+
corner: Object,
|
|
3892
|
+
tooltip: Object,
|
|
3893
|
+
menu: Object,
|
|
3894
|
+
};
|
|
3895
|
+
const typeMapping = {
|
|
3896
|
+
'PivotColumnDimension': 'columns',
|
|
3897
|
+
'PivotColumnHeaderTitle': 'columnHeaderTitle',
|
|
3898
|
+
'PivotRowDimension': 'rows',
|
|
3899
|
+
'PivotRowHeaderTitle': 'rowHeaderTitle',
|
|
3900
|
+
'PivotCorner': 'corner',
|
|
3901
|
+
'PivotIndicator': 'indicators',
|
|
3902
|
+
'Tooltip': 'tooltip',
|
|
3903
|
+
'Menu': 'menu',
|
|
3904
|
+
};
|
|
3905
|
+
flattenedSlots.forEach(vnode => {
|
|
3906
|
+
const typeName = vnode.type?.name || vnode.type?.__name;
|
|
3907
|
+
const optionKey = typeMapping[typeName];
|
|
3908
|
+
if (optionKey) {
|
|
3909
|
+
if (Array.isArray(options[optionKey])) {
|
|
3910
|
+
if (vnode.props.hasOwnProperty('objectHandler')) {
|
|
3911
|
+
options[optionKey].push(vnode.props.objectHandler);
|
|
3912
|
+
}
|
|
3913
|
+
else {
|
|
3914
|
+
options[optionKey].push(vnode.props);
|
|
3915
|
+
}
|
|
3916
|
+
}
|
|
3917
|
+
else {
|
|
3918
|
+
options[optionKey] = vnode.props;
|
|
3919
|
+
}
|
|
3920
|
+
}
|
|
3921
|
+
});
|
|
3922
|
+
return {
|
|
3923
|
+
...props.options,
|
|
3924
|
+
columns: options.columns.length ? options.columns : props.options.columns,
|
|
3925
|
+
columnHeaderTitle: options.columnHeaderTitle.length ? options.columnHeaderTitle : props.options.columnHeaderTitle,
|
|
3926
|
+
rows: options.rows.length ? options.rows : props.options.rows,
|
|
3927
|
+
rowHeaderTitle: options.rowHeaderTitle.length ? options.rowHeaderTitle : props.options.rowHeaderTitle,
|
|
3928
|
+
indicators: options.indicators.length ? options.indicators : props.options.indicators,
|
|
3929
|
+
corner: options.corner || props.options.corner,
|
|
3930
|
+
tooltip: options.tooltip || props.options.tooltip,
|
|
3931
|
+
menu: options.menu || props.options.menu,
|
|
3932
|
+
};
|
|
3933
|
+
});
|
|
3934
|
+
__expose({ vTableInstance: computed(() => baseTableRef.value?.vTableInstance || null) });
|
|
3935
|
+
return (_ctx, _cache) => {
|
|
3936
|
+
return (openBlock(), createElementBlock(Fragment, null, [
|
|
3937
|
+
createVNode(_sfc_main$3, mergeProps({
|
|
3938
|
+
type: "chart",
|
|
3939
|
+
options: computedOptions.value,
|
|
3940
|
+
records: _ctx.records,
|
|
3941
|
+
width: _ctx.width,
|
|
3942
|
+
height: _ctx.height,
|
|
3943
|
+
ref_key: "baseTableRef",
|
|
3944
|
+
ref: baseTableRef
|
|
3945
|
+
}, _ctx.$attrs), null, 16, ["options", "records", "width", "height"]),
|
|
3946
|
+
renderSlot(_ctx.$slots, "default")
|
|
3947
|
+
], 64));
|
|
3948
|
+
};
|
|
3949
|
+
}
|
|
3950
|
+
});
|
|
3951
|
+
|
|
3952
|
+
const registerChartModule = (name, chart) => {
|
|
3953
|
+
VTable__namespace.register.chartModule(name, chart);
|
|
3954
|
+
};
|
|
3955
|
+
|
|
3956
|
+
function ListColumn(props) {
|
|
3957
|
+
return null;
|
|
3958
|
+
}
|
|
3959
|
+
|
|
3960
|
+
function PivotColumnDimension(props) {
|
|
3961
|
+
return null;
|
|
3962
|
+
}
|
|
3963
|
+
|
|
3964
|
+
function PivotRowDimension(props) {
|
|
3965
|
+
return null;
|
|
3966
|
+
}
|
|
3967
|
+
|
|
3968
|
+
function PivotColumnHeaderTitle(props) {
|
|
3969
|
+
return null;
|
|
3970
|
+
}
|
|
3971
|
+
|
|
3972
|
+
function PivotRowHeaderTitle(props) {
|
|
3973
|
+
return null;
|
|
3974
|
+
}
|
|
3975
|
+
|
|
3976
|
+
function PivotIndicator(props) {
|
|
3977
|
+
return null;
|
|
3978
|
+
}
|
|
3979
|
+
|
|
3980
|
+
function PivotCorner(props) {
|
|
3981
|
+
return null;
|
|
3982
|
+
}
|
|
3983
|
+
|
|
3984
|
+
function Menu(props) {
|
|
3985
|
+
return null;
|
|
3986
|
+
}
|
|
3987
|
+
|
|
3988
|
+
function Tooltip(props) {
|
|
3989
|
+
return null;
|
|
3990
|
+
}
|
|
3991
|
+
|
|
3992
|
+
function Group() {
|
|
3993
|
+
return null;
|
|
3994
|
+
}
|
|
3995
|
+
|
|
3996
|
+
function Image() {
|
|
3997
|
+
return null;
|
|
3998
|
+
}
|
|
3999
|
+
|
|
4000
|
+
function Text() {
|
|
4001
|
+
return null;
|
|
4002
|
+
}
|
|
4003
|
+
|
|
4004
|
+
function Tag(props) {
|
|
4005
|
+
return null;
|
|
4006
|
+
}
|
|
4007
|
+
|
|
4008
|
+
function Radio(props) {
|
|
4009
|
+
return null;
|
|
4010
|
+
}
|
|
4011
|
+
|
|
4012
|
+
function CheckBox(props) {
|
|
4013
|
+
return null;
|
|
4014
|
+
}
|
|
4015
|
+
|
|
4016
|
+
const version = "1.7.4";
|
|
4017
|
+
|
|
4018
|
+
exports.VTable = VTable__namespace;
|
|
4019
|
+
exports.CheckBox = CheckBox;
|
|
4020
|
+
exports.Group = Group;
|
|
4021
|
+
exports.Image = Image;
|
|
4022
|
+
exports.ListColumn = ListColumn;
|
|
4023
|
+
exports.ListTable = _sfc_main$2;
|
|
4024
|
+
exports.Menu = Menu;
|
|
4025
|
+
exports.PivotChart = _sfc_main;
|
|
4026
|
+
exports.PivotColumnDimension = PivotColumnDimension;
|
|
4027
|
+
exports.PivotColumnHeaderTitle = PivotColumnHeaderTitle;
|
|
4028
|
+
exports.PivotCorner = PivotCorner;
|
|
4029
|
+
exports.PivotIndicator = PivotIndicator;
|
|
4030
|
+
exports.PivotRowDimension = PivotRowDimension;
|
|
4031
|
+
exports.PivotRowHeaderTitle = PivotRowHeaderTitle;
|
|
4032
|
+
exports.PivotTable = _sfc_main$1;
|
|
4033
|
+
exports.Radio = Radio;
|
|
4034
|
+
exports.Tag = Tag;
|
|
4035
|
+
exports.Text = Text;
|
|
4036
|
+
exports.Tooltip = Tooltip;
|
|
4037
|
+
exports.registerChartModule = registerChartModule;
|
|
4038
|
+
exports.version = version;
|
|
4039
|
+
|
|
4040
|
+
}));
|