@vue/runtime-dom 3.5.43 → 3.5.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/runtime-dom.cjs.js +74 -24
- package/dist/runtime-dom.cjs.prod.js +74 -24
- package/dist/runtime-dom.d.ts +1 -0
- package/dist/runtime-dom.esm-browser.js +556 -216
- package/dist/runtime-dom.esm-browser.prod.js +4 -4
- package/dist/runtime-dom.esm-bundler.js +74 -24
- package/dist/runtime-dom.global.js +556 -216
- package/dist/runtime-dom.global.prod.js +4 -4
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.5.
|
|
2
|
+
* @vue/runtime-dom v3.5.45
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -61,24 +61,20 @@ const cacheStringFunction = (fn) => {
|
|
|
61
61
|
});
|
|
62
62
|
};
|
|
63
63
|
const camelizeRE = /-\w/g;
|
|
64
|
-
const camelize = cacheStringFunction(
|
|
65
|
-
(
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
);
|
|
64
|
+
const camelize = /* @__PURE__ */ cacheStringFunction((str) => {
|
|
65
|
+
return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
|
|
66
|
+
});
|
|
69
67
|
const hyphenateRE = /\B([A-Z])/g;
|
|
70
|
-
const hyphenate = cacheStringFunction(
|
|
68
|
+
const hyphenate = /* @__PURE__ */ cacheStringFunction(
|
|
71
69
|
(str) => str.replace(hyphenateRE, "-$1").toLowerCase()
|
|
72
70
|
);
|
|
73
|
-
const capitalize = cacheStringFunction((str) => {
|
|
71
|
+
const capitalize = /* @__PURE__ */ cacheStringFunction((str) => {
|
|
74
72
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
75
73
|
});
|
|
76
|
-
const toHandlerKey = cacheStringFunction(
|
|
77
|
-
(str)
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
);
|
|
74
|
+
const toHandlerKey = /* @__PURE__ */ cacheStringFunction((str) => {
|
|
75
|
+
const s = str ? `on${capitalize(str)}` : ``;
|
|
76
|
+
return s;
|
|
77
|
+
});
|
|
82
78
|
const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
|
|
83
79
|
const invokeArrayFns = (fns, ...arg) => {
|
|
84
80
|
for (let i = 0; i < fns.length; i++) {
|
|
@@ -191,7 +187,7 @@ const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
|
|
|
191
187
|
const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
|
|
192
188
|
const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
|
|
193
189
|
|
|
194
|
-
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
|
|
190
|
+
const specialBooleanAttrs = `itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
|
|
195
191
|
const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
|
|
196
192
|
const isBooleanAttr = /* @__PURE__ */ makeMap(
|
|
197
193
|
specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
|
|
@@ -535,7 +531,11 @@ function getCurrentScope() {
|
|
|
535
531
|
}
|
|
536
532
|
function onScopeDispose(fn, failSilently = false) {
|
|
537
533
|
if (activeEffectScope) {
|
|
538
|
-
activeEffectScope.
|
|
534
|
+
if (activeEffectScope.active) {
|
|
535
|
+
activeEffectScope.cleanups.push(fn);
|
|
536
|
+
} else {
|
|
537
|
+
fn();
|
|
538
|
+
}
|
|
539
539
|
} else if (!failSilently) {
|
|
540
540
|
warn$2(
|
|
541
541
|
`onScopeDispose() is called when there is no active effect scope to be associated with.`
|
|
@@ -1239,19 +1239,41 @@ const arrayInstrumentations = {
|
|
|
1239
1239
|
};
|
|
1240
1240
|
function iterator(self, method, wrapValue) {
|
|
1241
1241
|
const arr = shallowReadArray(self);
|
|
1242
|
-
const
|
|
1242
|
+
const methodFn = arr[method];
|
|
1243
|
+
const iter = methodFn.call(arr);
|
|
1243
1244
|
if (arr !== self && !isShallow(self)) {
|
|
1244
|
-
iter.
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
if (
|
|
1248
|
-
|
|
1245
|
+
if (iter[Symbol.toStringTag] === "Array Iterator") {
|
|
1246
|
+
const wrapped = Object.create(Object.getPrototypeOf(iter));
|
|
1247
|
+
wrapped.next = () => wrapResult(iter.next(), wrapValue);
|
|
1248
|
+
if (methodFn !== arrayProto[method]) {
|
|
1249
|
+
Object.defineProperties(wrapped, {
|
|
1250
|
+
return: {
|
|
1251
|
+
get() {
|
|
1252
|
+
const fn = iter.return;
|
|
1253
|
+
return typeof fn === "function" ? fn.bind(iter) : fn;
|
|
1254
|
+
}
|
|
1255
|
+
},
|
|
1256
|
+
throw: {
|
|
1257
|
+
get() {
|
|
1258
|
+
const fn = iter.throw;
|
|
1259
|
+
return typeof fn === "function" ? fn.bind(iter) : fn;
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
});
|
|
1249
1263
|
}
|
|
1250
|
-
return
|
|
1251
|
-
}
|
|
1264
|
+
return wrapped;
|
|
1265
|
+
}
|
|
1266
|
+
iter._next = iter.next;
|
|
1267
|
+
iter.next = () => wrapResult(iter._next(), wrapValue);
|
|
1252
1268
|
}
|
|
1253
1269
|
return iter;
|
|
1254
1270
|
}
|
|
1271
|
+
function wrapResult(result, wrapValue) {
|
|
1272
|
+
if (!result.done) {
|
|
1273
|
+
result.value = wrapValue(result.value);
|
|
1274
|
+
}
|
|
1275
|
+
return result;
|
|
1276
|
+
}
|
|
1255
1277
|
const arrayProto = Array.prototype;
|
|
1256
1278
|
function apply(self, method, fn, thisArg, wrappedRetFn, args) {
|
|
1257
1279
|
const arr = shallowReadArray(self);
|
|
@@ -1320,7 +1342,7 @@ function noTracking(self, method, args = []) {
|
|
|
1320
1342
|
}
|
|
1321
1343
|
|
|
1322
1344
|
const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
|
|
1323
|
-
const builtInSymbols = new Set(
|
|
1345
|
+
const builtInSymbols = /* @__PURE__ */ new Set(
|
|
1324
1346
|
/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
|
|
1325
1347
|
);
|
|
1326
1348
|
function hasOwnProperty(key) {
|
|
@@ -1674,6 +1696,8 @@ function createInstrumentationGetter(isReadonly2, shallow) {
|
|
|
1674
1696
|
return !isReadonly2;
|
|
1675
1697
|
} else if (key === "__v_isReadonly") {
|
|
1676
1698
|
return isReadonly2;
|
|
1699
|
+
} else if (key === "__v_isShallow") {
|
|
1700
|
+
return shallow;
|
|
1677
1701
|
} else if (key === "__v_raw") {
|
|
1678
1702
|
return target;
|
|
1679
1703
|
}
|
|
@@ -2219,9 +2243,11 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
|
|
|
2219
2243
|
if (once && cb) {
|
|
2220
2244
|
const _cb = cb;
|
|
2221
2245
|
cb = (...args) => {
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2246
|
+
try {
|
|
2247
|
+
return _cb(...args);
|
|
2248
|
+
} finally {
|
|
2249
|
+
watchHandle();
|
|
2250
|
+
}
|
|
2225
2251
|
};
|
|
2226
2252
|
}
|
|
2227
2253
|
let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
|
|
@@ -2232,12 +2258,13 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
|
|
|
2232
2258
|
if (cb) {
|
|
2233
2259
|
const newValue = effect.run();
|
|
2234
2260
|
if (immediateFirstRun || deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
|
|
2235
|
-
if (cleanup) {
|
|
2236
|
-
cleanup();
|
|
2237
|
-
}
|
|
2238
2261
|
const currentWatcher = activeWatcher;
|
|
2239
|
-
|
|
2262
|
+
pauseTracking();
|
|
2240
2263
|
try {
|
|
2264
|
+
if (cleanup) {
|
|
2265
|
+
cleanup();
|
|
2266
|
+
}
|
|
2267
|
+
activeWatcher = effect;
|
|
2241
2268
|
const args = [
|
|
2242
2269
|
newValue,
|
|
2243
2270
|
// pass undefined as the old value when it's changed for the first time
|
|
@@ -2251,6 +2278,7 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
|
|
|
2251
2278
|
);
|
|
2252
2279
|
} finally {
|
|
2253
2280
|
activeWatcher = currentWatcher;
|
|
2281
|
+
resetTracking();
|
|
2254
2282
|
}
|
|
2255
2283
|
}
|
|
2256
2284
|
} else {
|
|
@@ -2524,7 +2552,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
|
|
|
2524
2552
|
const res = callWithErrorHandling(fn, instance, type, args);
|
|
2525
2553
|
if (res && isPromise(res)) {
|
|
2526
2554
|
res.catch((err) => {
|
|
2527
|
-
handleError(err, instance, type);
|
|
2555
|
+
handleError(err, instance, type, void 0, true);
|
|
2528
2556
|
});
|
|
2529
2557
|
}
|
|
2530
2558
|
return res;
|
|
@@ -2541,7 +2569,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
|
|
|
2541
2569
|
);
|
|
2542
2570
|
}
|
|
2543
2571
|
}
|
|
2544
|
-
function handleError(err, instance, type, throwInDev = true) {
|
|
2572
|
+
function handleError(err, instance, type, throwInDev = true, isAsyncError = false) {
|
|
2545
2573
|
const contextVNode = instance ? instance.vnode : null;
|
|
2546
2574
|
const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
|
|
2547
2575
|
if (instance) {
|
|
@@ -2550,7 +2578,9 @@ function handleError(err, instance, type, throwInDev = true) {
|
|
|
2550
2578
|
const errorInfo = ErrorTypeStrings$1[type] ;
|
|
2551
2579
|
while (cur) {
|
|
2552
2580
|
const errorCapturedHooks = cur.ec;
|
|
2553
|
-
if (errorCapturedHooks
|
|
2581
|
+
if (errorCapturedHooks && !cur.isUnmounted && // Async failures may outlive stopped scopes whose unmount effects
|
|
2582
|
+
// are deferred or discarded by Suspense.
|
|
2583
|
+
(!isAsyncError || cur.scope.active)) {
|
|
2554
2584
|
for (let i = 0; i < errorCapturedHooks.length; i++) {
|
|
2555
2585
|
if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
|
|
2556
2586
|
return;
|
|
@@ -2651,21 +2681,21 @@ function queuePostFlushCb(cb) {
|
|
|
2651
2681
|
}
|
|
2652
2682
|
queueFlush();
|
|
2653
2683
|
}
|
|
2654
|
-
function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
|
|
2684
|
+
function flushPreFlushCbs(instance, minUid, seen, i = flushIndex + 1) {
|
|
2655
2685
|
{
|
|
2656
2686
|
seen = seen || /* @__PURE__ */ new Map();
|
|
2657
2687
|
}
|
|
2658
2688
|
for (; i < queue.length; i++) {
|
|
2659
2689
|
const cb = queue[i];
|
|
2660
2690
|
if (cb && cb.flags & 2) {
|
|
2661
|
-
if (instance && cb.id !== instance.uid) {
|
|
2691
|
+
if (instance && cb.id !== instance.uid || minUid !== void 0 && !(cb.id >= minUid)) {
|
|
2662
2692
|
continue;
|
|
2663
2693
|
}
|
|
2664
2694
|
if (checkRecursiveUpdates(seen, cb)) {
|
|
2665
2695
|
continue;
|
|
2666
2696
|
}
|
|
2667
2697
|
queue.splice(i, 1);
|
|
2668
|
-
i
|
|
2698
|
+
i = instance ? i - 1 : flushIndex;
|
|
2669
2699
|
if (cb.flags & 4) {
|
|
2670
2700
|
cb.flags &= -2;
|
|
2671
2701
|
}
|
|
@@ -2676,12 +2706,23 @@ function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
|
|
|
2676
2706
|
}
|
|
2677
2707
|
}
|
|
2678
2708
|
}
|
|
2679
|
-
function flushPostFlushCbs(seen) {
|
|
2709
|
+
function flushPostFlushCbs(seen, skip, minUid = 0) {
|
|
2680
2710
|
if (pendingPostFlushCbs.length) {
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
)
|
|
2684
|
-
|
|
2711
|
+
let cbs = pendingPostFlushCbs;
|
|
2712
|
+
let kept = 0;
|
|
2713
|
+
if (skip) {
|
|
2714
|
+
cbs = [];
|
|
2715
|
+
for (let i = 0; i < pendingPostFlushCbs.length; i++) {
|
|
2716
|
+
const cb = pendingPostFlushCbs[i];
|
|
2717
|
+
if (cb.i !== void 0 ? !cb.i || cb.i.uid < minUid : skip.has(cb)) {
|
|
2718
|
+
pendingPostFlushCbs[kept++] = cb;
|
|
2719
|
+
} else {
|
|
2720
|
+
cbs.push(cb);
|
|
2721
|
+
}
|
|
2722
|
+
}
|
|
2723
|
+
}
|
|
2724
|
+
const deduped = [...new Set(cbs)].sort((a, b) => getId(a) - getId(b));
|
|
2725
|
+
pendingPostFlushCbs.length = kept;
|
|
2685
2726
|
if (activePostFlushCbs) {
|
|
2686
2727
|
for (let i = 0; i < deduped.length; i++) {
|
|
2687
2728
|
activePostFlushCbs.push(deduped[i]);
|
|
@@ -2707,6 +2748,22 @@ function flushPostFlushCbs(seen) {
|
|
|
2707
2748
|
postFlushIndex = 0;
|
|
2708
2749
|
}
|
|
2709
2750
|
}
|
|
2751
|
+
let isFlushing = false;
|
|
2752
|
+
function flushOnAppMount(fn, minUid) {
|
|
2753
|
+
if (isFlushing) {
|
|
2754
|
+
fn();
|
|
2755
|
+
return;
|
|
2756
|
+
}
|
|
2757
|
+
const queued = minUid === void 0 ? void 0 : new Set(pendingPostFlushCbs);
|
|
2758
|
+
fn();
|
|
2759
|
+
isFlushing = true;
|
|
2760
|
+
try {
|
|
2761
|
+
flushPreFlushCbs(void 0, minUid);
|
|
2762
|
+
flushPostFlushCbs(void 0, queued, minUid);
|
|
2763
|
+
} finally {
|
|
2764
|
+
isFlushing = false;
|
|
2765
|
+
}
|
|
2766
|
+
}
|
|
2710
2767
|
const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
|
|
2711
2768
|
function flushJobs(seen) {
|
|
2712
2769
|
{
|
|
@@ -2851,14 +2908,32 @@ function reload(id, newComp) {
|
|
|
2851
2908
|
instance.ceReload(newComp.styles);
|
|
2852
2909
|
dirtyInstances.delete(instance);
|
|
2853
2910
|
} else if (instance.parent) {
|
|
2854
|
-
|
|
2855
|
-
if (!
|
|
2856
|
-
|
|
2911
|
+
const update = () => {
|
|
2912
|
+
if (!instance.scope.active) return;
|
|
2913
|
+
const pending = instance.asyncDep && !instance.asyncResolved ? instance : locateUnresolvedAsyncRoot(instance.parent);
|
|
2914
|
+
if (pending) {
|
|
2915
|
+
pending.asyncDep.catch(NOOP).then(() => {
|
|
2916
|
+
if (instance.scope.active && (pending.asyncResolved || !pending.scope.active)) {
|
|
2917
|
+
queueJob(update);
|
|
2918
|
+
}
|
|
2919
|
+
});
|
|
2920
|
+
return;
|
|
2921
|
+
}
|
|
2922
|
+
dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
2923
|
+
if (!dirtyInstances) {
|
|
2924
|
+
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
2925
|
+
}
|
|
2926
|
+
dirtyInstances.add(instance);
|
|
2927
|
+
isHmrUpdating = true;
|
|
2928
|
+
try {
|
|
2857
2929
|
instance.parent.update();
|
|
2930
|
+
} finally {
|
|
2858
2931
|
isHmrUpdating = false;
|
|
2859
2932
|
dirtyInstances.delete(instance);
|
|
2933
|
+
queuePostFlushCb(() => hmrDirtyComponents.clear());
|
|
2860
2934
|
}
|
|
2861
|
-
}
|
|
2935
|
+
};
|
|
2936
|
+
queueJob(update);
|
|
2862
2937
|
} else if (instance.appContext.reload) {
|
|
2863
2938
|
instance.appContext.reload();
|
|
2864
2939
|
} else if (typeof window !== "undefined") {
|
|
@@ -3074,12 +3149,31 @@ function withDirectives(vnode, directives) {
|
|
|
3074
3149
|
return vnode;
|
|
3075
3150
|
}
|
|
3076
3151
|
function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
3077
|
-
|
|
3152
|
+
let hookVNode = vnode;
|
|
3153
|
+
if (name === "beforeMount") {
|
|
3154
|
+
vnode._mount = vnode;
|
|
3155
|
+
} else if (name === "beforeUpdate") {
|
|
3156
|
+
const mount = prevVNode && prevVNode._mount;
|
|
3157
|
+
if (mount) {
|
|
3158
|
+
mount._latest = vnode;
|
|
3159
|
+
vnode._mount = mount;
|
|
3160
|
+
}
|
|
3161
|
+
} else if (name === "mounted") {
|
|
3162
|
+
const latest = vnode._latest;
|
|
3163
|
+
vnode._mount = vnode._latest = void 0;
|
|
3164
|
+
if (latest) {
|
|
3165
|
+
hookVNode = latest;
|
|
3166
|
+
latest._mount = void 0;
|
|
3167
|
+
}
|
|
3168
|
+
}
|
|
3169
|
+
const bindings = hookVNode.dirs;
|
|
3078
3170
|
const oldBindings = prevVNode && prevVNode.dirs;
|
|
3079
3171
|
for (let i = 0; i < bindings.length; i++) {
|
|
3080
|
-
|
|
3172
|
+
let binding = bindings[i];
|
|
3081
3173
|
if (oldBindings) {
|
|
3082
3174
|
binding.oldValue = oldBindings[i].value;
|
|
3175
|
+
} else if (name === "mounted" && binding.oldValue !== void 0) {
|
|
3176
|
+
binding = extend({}, binding, { oldValue: void 0 });
|
|
3083
3177
|
}
|
|
3084
3178
|
let hook = binding.dir[name];
|
|
3085
3179
|
if (hook) {
|
|
@@ -3087,7 +3181,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
|
3087
3181
|
callWithAsyncErrorHandling(hook, instance, 8, [
|
|
3088
3182
|
vnode.el,
|
|
3089
3183
|
binding,
|
|
3090
|
-
|
|
3184
|
+
hookVNode,
|
|
3091
3185
|
prevVNode
|
|
3092
3186
|
]);
|
|
3093
3187
|
resetTracking();
|
|
@@ -3208,6 +3302,7 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
|
|
|
3208
3302
|
let isPre = false;
|
|
3209
3303
|
if (flush === "post") {
|
|
3210
3304
|
baseWatchOptions.scheduler = (job) => {
|
|
3305
|
+
job.i = instance;
|
|
3211
3306
|
queuePostRenderEffect(job, instance && instance.suspense);
|
|
3212
3307
|
};
|
|
3213
3308
|
} else if (flush !== "sync") {
|
|
@@ -3509,7 +3604,11 @@ const TeleportImpl = {
|
|
|
3509
3604
|
};
|
|
3510
3605
|
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
|
|
3511
3606
|
if (moveType === 0) {
|
|
3607
|
+
if (vnode.targetStart) {
|
|
3608
|
+
insert(vnode.targetStart, container, parentAnchor);
|
|
3609
|
+
}
|
|
3512
3610
|
insert(vnode.targetAnchor, container, parentAnchor);
|
|
3611
|
+
parentAnchor = vnode.targetAnchor;
|
|
3513
3612
|
}
|
|
3514
3613
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
3515
3614
|
const isReorder = moveType === 2;
|
|
@@ -3678,10 +3777,6 @@ const BaseTransitionPropsValidators = {
|
|
|
3678
3777
|
onAfterAppear: TransitionHookValidator,
|
|
3679
3778
|
onAppearCancelled: TransitionHookValidator
|
|
3680
3779
|
};
|
|
3681
|
-
const recursiveGetSubtree = (instance) => {
|
|
3682
|
-
const subTree = instance.subTree;
|
|
3683
|
-
return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
|
|
3684
|
-
};
|
|
3685
3780
|
const BaseTransitionImpl = {
|
|
3686
3781
|
name: `BaseTransition`,
|
|
3687
3782
|
props: BaseTransitionPropsValidators,
|
|
@@ -3710,19 +3805,17 @@ const BaseTransitionImpl = {
|
|
|
3710
3805
|
if (!innerChild) {
|
|
3711
3806
|
return emptyPlaceholder(child);
|
|
3712
3807
|
}
|
|
3713
|
-
|
|
3808
|
+
const enterHooks = resolveTransitionHooks(
|
|
3714
3809
|
innerChild,
|
|
3715
3810
|
rawProps,
|
|
3716
3811
|
state,
|
|
3717
|
-
instance
|
|
3718
|
-
// #11061, ensure enterHooks is fresh after clone
|
|
3719
|
-
(hooks) => enterHooks = hooks
|
|
3812
|
+
instance
|
|
3720
3813
|
);
|
|
3721
3814
|
if (innerChild.type !== Comment) {
|
|
3722
3815
|
setTransitionHooks(innerChild, enterHooks);
|
|
3723
3816
|
}
|
|
3724
3817
|
let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
|
|
3725
|
-
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) &&
|
|
3818
|
+
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && getTransitionRoot(instance.subTree)) {
|
|
3726
3819
|
let leavingHooks = resolveTransitionHooks(
|
|
3727
3820
|
oldInnerChild,
|
|
3728
3821
|
rawProps,
|
|
@@ -3735,7 +3828,17 @@ const BaseTransitionImpl = {
|
|
|
3735
3828
|
leavingHooks.afterLeave = () => {
|
|
3736
3829
|
state.isLeaving = false;
|
|
3737
3830
|
if (!(instance.job.flags & 8)) {
|
|
3738
|
-
instance.
|
|
3831
|
+
if (instance.effect.flags & 2) {
|
|
3832
|
+
const job = () => {
|
|
3833
|
+
if (!(instance.job.flags & 8)) {
|
|
3834
|
+
instance.update();
|
|
3835
|
+
}
|
|
3836
|
+
};
|
|
3837
|
+
job.i = instance;
|
|
3838
|
+
queueJob(job);
|
|
3839
|
+
} else {
|
|
3840
|
+
instance.update();
|
|
3841
|
+
}
|
|
3739
3842
|
}
|
|
3740
3843
|
delete leavingHooks.afterLeave;
|
|
3741
3844
|
oldInnerChild = void 0;
|
|
@@ -3799,7 +3902,7 @@ function getLeavingNodesForType(state, vnode) {
|
|
|
3799
3902
|
}
|
|
3800
3903
|
return leavingVNodesCache;
|
|
3801
3904
|
}
|
|
3802
|
-
function resolveTransitionHooks(vnode, props, state, instance
|
|
3905
|
+
function resolveTransitionHooks(vnode, props, state, instance) {
|
|
3803
3906
|
const {
|
|
3804
3907
|
appear,
|
|
3805
3908
|
mode,
|
|
@@ -3855,8 +3958,15 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
3855
3958
|
);
|
|
3856
3959
|
}
|
|
3857
3960
|
const leavingVNode = leavingVNodesCache[key];
|
|
3858
|
-
if (leavingVNode && isSameVNodeType(vnode, leavingVNode)
|
|
3859
|
-
leavingVNode.el[leaveCbKey]
|
|
3961
|
+
if (leavingVNode && isSameVNodeType(vnode, leavingVNode)) {
|
|
3962
|
+
let leavingCb = leavingVNode.el[leaveCbKey];
|
|
3963
|
+
if (!leavingCb) {
|
|
3964
|
+
const leavingRoot = getTransitionRoot(leavingVNode);
|
|
3965
|
+
leavingCb = leavingRoot && leavingRoot.el[leaveCbKey];
|
|
3966
|
+
}
|
|
3967
|
+
if (leavingCb) {
|
|
3968
|
+
leavingCb();
|
|
3969
|
+
}
|
|
3860
3970
|
}
|
|
3861
3971
|
callHook(hook, [el]);
|
|
3862
3972
|
},
|
|
@@ -3931,15 +4041,21 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
3931
4041
|
}
|
|
3932
4042
|
},
|
|
3933
4043
|
clone(vnode2) {
|
|
3934
|
-
const
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
4044
|
+
const cloned = resolveTransitionHooks(vnode2, props, state, instance);
|
|
4045
|
+
cloned.afterLeave = () => {
|
|
4046
|
+
if (hooks.afterLeave) hooks.afterLeave();
|
|
4047
|
+
};
|
|
4048
|
+
cloned.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
4049
|
+
if (hooks.delayLeave) {
|
|
4050
|
+
hooks.delayLeave(el, earlyRemove, delayedLeave);
|
|
4051
|
+
} else {
|
|
4052
|
+
delayedLeave();
|
|
4053
|
+
}
|
|
4054
|
+
};
|
|
4055
|
+
cloned.delayedLeave = () => {
|
|
4056
|
+
if (hooks.delayedLeave) hooks.delayedLeave();
|
|
4057
|
+
};
|
|
4058
|
+
return cloned;
|
|
3943
4059
|
}
|
|
3944
4060
|
};
|
|
3945
4061
|
return hooks;
|
|
@@ -3980,10 +4096,24 @@ function setTransitionHooks(vnode, hooks) {
|
|
|
3980
4096
|
hooks
|
|
3981
4097
|
);
|
|
3982
4098
|
} else if (vnode.shapeFlag & 128) {
|
|
3983
|
-
|
|
3984
|
-
|
|
4099
|
+
const suspense = vnode.suspense;
|
|
4100
|
+
if (suspense) {
|
|
4101
|
+
const branch = suspense.isHydrating ? suspense.pendingBranch : suspense.activeBranch;
|
|
4102
|
+
if (branch) {
|
|
4103
|
+
setTransitionHooks(branch, hooks.clone(branch));
|
|
4104
|
+
}
|
|
4105
|
+
} else {
|
|
4106
|
+
vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
4107
|
+
vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
4108
|
+
}
|
|
3985
4109
|
} else {
|
|
3986
4110
|
vnode.transition = hooks;
|
|
4111
|
+
if (vnode.type === Fragment && isArray(vnode.children)) {
|
|
4112
|
+
const child = filterSingleRoot(vnode.children, false);
|
|
4113
|
+
if (child) {
|
|
4114
|
+
setTransitionHooks(child, hooks);
|
|
4115
|
+
}
|
|
4116
|
+
}
|
|
3987
4117
|
}
|
|
3988
4118
|
}
|
|
3989
4119
|
function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
@@ -4008,6 +4138,18 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
|
4008
4138
|
}
|
|
4009
4139
|
return ret;
|
|
4010
4140
|
}
|
|
4141
|
+
function getTransitionRoot(vnode) {
|
|
4142
|
+
if (vnode.component) {
|
|
4143
|
+
return getTransitionRoot(vnode.component.subTree);
|
|
4144
|
+
}
|
|
4145
|
+
if (vnode.type === Fragment) {
|
|
4146
|
+
const child = isArray(vnode.children) && filterSingleRoot(vnode.children, false);
|
|
4147
|
+
return child ? getTransitionRoot(child) : void 0;
|
|
4148
|
+
}
|
|
4149
|
+
if (vnode.type !== Comment) {
|
|
4150
|
+
return vnode;
|
|
4151
|
+
}
|
|
4152
|
+
}
|
|
4011
4153
|
|
|
4012
4154
|
// @__NO_SIDE_EFFECTS__
|
|
4013
4155
|
function defineComponent(options, extraOptions) {
|
|
@@ -4664,7 +4806,7 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
4664
4806
|
getContainerType(container),
|
|
4665
4807
|
slotScopeIds
|
|
4666
4808
|
);
|
|
4667
|
-
if (parentComponent) {
|
|
4809
|
+
if (parentComponent && parentComponent.vnode.el === node) {
|
|
4668
4810
|
parentComponent.vnode.el = vnode.el;
|
|
4669
4811
|
updateHOCHostEl(parentComponent, vnode.el);
|
|
4670
4812
|
}
|
|
@@ -4913,14 +5055,22 @@ const hydrateOnVisible = (opts) => (hydrate, forEach) => {
|
|
|
4913
5055
|
break;
|
|
4914
5056
|
}
|
|
4915
5057
|
}, opts);
|
|
4916
|
-
|
|
4917
|
-
if (!(el instanceof Element)) return;
|
|
5058
|
+
const observe = (el) => {
|
|
4918
5059
|
if (elementIsVisibleInViewport(el)) {
|
|
4919
5060
|
hydrate();
|
|
4920
5061
|
ob.disconnect();
|
|
4921
5062
|
return false;
|
|
4922
5063
|
}
|
|
5064
|
+
if (getComputedStyle(el).display === "contents") {
|
|
5065
|
+
for (let i = 0; i < el.children.length; i++) {
|
|
5066
|
+
if (observe(el.children[i]) === false) return false;
|
|
5067
|
+
}
|
|
5068
|
+
}
|
|
4923
5069
|
ob.observe(el);
|
|
5070
|
+
};
|
|
5071
|
+
forEach((el) => {
|
|
5072
|
+
if (!(el instanceof Element)) return;
|
|
5073
|
+
return observe(el);
|
|
4924
5074
|
});
|
|
4925
5075
|
return () => ob.disconnect();
|
|
4926
5076
|
};
|
|
@@ -5090,7 +5240,8 @@ function defineAsyncComponent(source) {
|
|
|
5090
5240
|
err,
|
|
5091
5241
|
instance,
|
|
5092
5242
|
13,
|
|
5093
|
-
!errorComponent
|
|
5243
|
+
!errorComponent,
|
|
5244
|
+
true
|
|
5094
5245
|
);
|
|
5095
5246
|
};
|
|
5096
5247
|
if (suspensible && instance.suspense || isInSSRComponentSetup) {
|
|
@@ -5108,7 +5259,7 @@ function defineAsyncComponent(source) {
|
|
|
5108
5259
|
const delayed = ref(!!delay);
|
|
5109
5260
|
let timeoutTimer;
|
|
5110
5261
|
let delayTimer;
|
|
5111
|
-
|
|
5262
|
+
onScopeDispose(() => {
|
|
5112
5263
|
if (timeoutTimer != null) clearTimeout(timeoutTimer);
|
|
5113
5264
|
if (delayTimer != null) clearTimeout(delayTimer);
|
|
5114
5265
|
});
|
|
@@ -5236,6 +5387,12 @@ const KeepAliveImpl = {
|
|
|
5236
5387
|
}
|
|
5237
5388
|
};
|
|
5238
5389
|
sharedContext.deactivate = (vnode) => {
|
|
5390
|
+
const cached = cache.get(
|
|
5391
|
+
vnode.key == null ? vnode.type : vnode.key
|
|
5392
|
+
);
|
|
5393
|
+
if (!cached || cached.component !== vnode.component) {
|
|
5394
|
+
return false;
|
|
5395
|
+
}
|
|
5239
5396
|
const instance2 = vnode.component;
|
|
5240
5397
|
invalidateMount(instance2.m);
|
|
5241
5398
|
invalidateMount(instance2.a);
|
|
@@ -5256,6 +5413,7 @@ const KeepAliveImpl = {
|
|
|
5256
5413
|
{
|
|
5257
5414
|
instance2.__keepAliveStorageContainer = storageContainer;
|
|
5258
5415
|
}
|
|
5416
|
+
return true;
|
|
5259
5417
|
};
|
|
5260
5418
|
function unmount(vnode) {
|
|
5261
5419
|
resetShapeFlag(vnode);
|
|
@@ -5277,6 +5435,7 @@ const KeepAliveImpl = {
|
|
|
5277
5435
|
unmount(cached);
|
|
5278
5436
|
} else if (current) {
|
|
5279
5437
|
resetShapeFlag(current);
|
|
5438
|
+
if (cached) resetShapeFlag(cached);
|
|
5280
5439
|
}
|
|
5281
5440
|
cache.delete(key);
|
|
5282
5441
|
keys.delete(key);
|
|
@@ -5294,12 +5453,17 @@ const KeepAliveImpl = {
|
|
|
5294
5453
|
const cacheSubtree = () => {
|
|
5295
5454
|
if (pendingCacheKey != null) {
|
|
5296
5455
|
if (isSuspense(instance.subTree.type)) {
|
|
5297
|
-
|
|
5456
|
+
const cacheInnerChild = () => {
|
|
5298
5457
|
const vnode = getInnerChild(instance.subTree);
|
|
5299
5458
|
if (vnode.component) {
|
|
5300
5459
|
cache.set(pendingCacheKey, vnode);
|
|
5301
5460
|
}
|
|
5302
|
-
}
|
|
5461
|
+
};
|
|
5462
|
+
if (instance.subTree.suspense.pendingBranch) {
|
|
5463
|
+
queuePostRenderEffect(cacheInnerChild, instance.subTree.suspense);
|
|
5464
|
+
} else {
|
|
5465
|
+
cacheInnerChild();
|
|
5466
|
+
}
|
|
5303
5467
|
} else {
|
|
5304
5468
|
cache.set(pendingCacheKey, getInnerChild(instance.subTree));
|
|
5305
5469
|
}
|
|
@@ -5430,9 +5594,12 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
|
|
|
5430
5594
|
true
|
|
5431
5595
|
/* prepend */
|
|
5432
5596
|
);
|
|
5433
|
-
|
|
5434
|
-
|
|
5435
|
-
|
|
5597
|
+
const removal = injectHook(
|
|
5598
|
+
"um",
|
|
5599
|
+
() => remove(keepAliveRoot[type], injected),
|
|
5600
|
+
target
|
|
5601
|
+
);
|
|
5602
|
+
removal.flags = 16;
|
|
5436
5603
|
}
|
|
5437
5604
|
function resetShapeFlag(vnode) {
|
|
5438
5605
|
vnode.shapeFlag &= -257;
|
|
@@ -5568,9 +5735,11 @@ function renderList(source, renderItem, cache, index) {
|
|
|
5568
5735
|
}
|
|
5569
5736
|
} else if (typeof source === "number") {
|
|
5570
5737
|
if (!Number.isInteger(source) || source < 0) {
|
|
5571
|
-
|
|
5572
|
-
|
|
5573
|
-
|
|
5738
|
+
{
|
|
5739
|
+
warn$1(
|
|
5740
|
+
`The v-for range expects a positive integer value but got ${source}.`
|
|
5741
|
+
);
|
|
5742
|
+
}
|
|
5574
5743
|
ret = [];
|
|
5575
5744
|
} else {
|
|
5576
5745
|
ret = new Array(source);
|
|
@@ -7208,7 +7377,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
|
|
|
7208
7377
|
}
|
|
7209
7378
|
for (let i = 0; i < nextKeys.length; i++) {
|
|
7210
7379
|
const key = nextKeys[i];
|
|
7211
|
-
if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) {
|
|
7380
|
+
if (!hasOwn(prevProps, key) || hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) {
|
|
7212
7381
|
return true;
|
|
7213
7382
|
}
|
|
7214
7383
|
}
|
|
@@ -8088,6 +8257,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8088
8257
|
const needCallTransitionHooks = needTransition(parentSuspense, transition);
|
|
8089
8258
|
if (needCallTransitionHooks) {
|
|
8090
8259
|
transition.beforeEnter(el);
|
|
8260
|
+
} else if (transition && !transition.persisted) {
|
|
8261
|
+
el[deferredEnterKey] = true;
|
|
8091
8262
|
}
|
|
8092
8263
|
hostInsert(el, container, anchor);
|
|
8093
8264
|
if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
|
|
@@ -8247,15 +8418,16 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8247
8418
|
for (let i = 0; i < newChildren.length; i++) {
|
|
8248
8419
|
const oldVNode = oldChildren[i];
|
|
8249
8420
|
const newVNode = newChildren[i];
|
|
8421
|
+
const oldEl = oldVNode.el || resolveAsyncComponentPlaceholder(oldVNode);
|
|
8250
8422
|
const container = (
|
|
8251
8423
|
// oldVNode may be an errored async setup() component inside Suspense
|
|
8252
8424
|
// which will not have a mounted element
|
|
8253
|
-
|
|
8425
|
+
oldEl && // - In the case of a Fragment, we need to provide the actual parent
|
|
8254
8426
|
// of the Fragment itself so it can move its children.
|
|
8255
8427
|
(oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
|
|
8256
8428
|
// which also requires the correct parent container
|
|
8257
8429
|
!isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
|
|
8258
|
-
oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(
|
|
8430
|
+
oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldEl) : (
|
|
8259
8431
|
// In other cases, the parent container is not actually used so we
|
|
8260
8432
|
// just pass the block element here to avoid a DOM parentNode call.
|
|
8261
8433
|
fallbackContainer
|
|
@@ -8419,7 +8591,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8419
8591
|
}
|
|
8420
8592
|
if (isHmrUpdating) initialVNode.el = null;
|
|
8421
8593
|
if (instance.asyncDep) {
|
|
8422
|
-
parentSuspense && parentSuspense.registerDep(
|
|
8594
|
+
parentSuspense && parentSuspense.registerDep(
|
|
8595
|
+
instance,
|
|
8596
|
+
setupRenderEffect,
|
|
8597
|
+
optimized,
|
|
8598
|
+
namespace
|
|
8599
|
+
);
|
|
8423
8600
|
if (!initialVNode.el) {
|
|
8424
8601
|
const placeholder = instance.subTree = createVNode(Comment);
|
|
8425
8602
|
processCommentNode(null, placeholder, container, anchor);
|
|
@@ -8449,6 +8626,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8449
8626
|
pushWarningContext(n2);
|
|
8450
8627
|
}
|
|
8451
8628
|
n2.el = n1.el;
|
|
8629
|
+
n2.placeholder = n1.placeholder;
|
|
8452
8630
|
updateComponentPreRender(instance, n2, optimized);
|
|
8453
8631
|
{
|
|
8454
8632
|
popWarningContext();
|
|
@@ -8460,6 +8638,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8460
8638
|
}
|
|
8461
8639
|
} else {
|
|
8462
8640
|
n2.el = n1.el;
|
|
8641
|
+
n2.placeholder = n1.placeholder;
|
|
8463
8642
|
instance.vnode = n2;
|
|
8464
8643
|
}
|
|
8465
8644
|
};
|
|
@@ -8562,16 +8741,23 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8562
8741
|
} else {
|
|
8563
8742
|
let { next, bu, u, parent, vnode } = instance;
|
|
8564
8743
|
{
|
|
8565
|
-
const
|
|
8566
|
-
if (
|
|
8744
|
+
const unresolvedAsyncRoot = locateUnresolvedAsyncRoot(instance);
|
|
8745
|
+
if (unresolvedAsyncRoot) {
|
|
8567
8746
|
if (next) {
|
|
8568
8747
|
next.el = vnode.el;
|
|
8569
8748
|
updateComponentPreRender(instance, next, optimized);
|
|
8570
8749
|
}
|
|
8571
|
-
|
|
8572
|
-
|
|
8573
|
-
if (
|
|
8574
|
-
|
|
8750
|
+
unresolvedAsyncRoot.asyncDep.then(() => {
|
|
8751
|
+
const retry = () => {
|
|
8752
|
+
if (instance.job.flags & 8) return;
|
|
8753
|
+
if (parentSuspense && parentSuspense.pendingBranch) {
|
|
8754
|
+
queuePostRenderEffect(retry, parentSuspense);
|
|
8755
|
+
} else {
|
|
8756
|
+
update();
|
|
8757
|
+
}
|
|
8758
|
+
};
|
|
8759
|
+
retry.flags = 16 | 32;
|
|
8760
|
+
queuePostRenderEffect(retry, parentSuspense);
|
|
8575
8761
|
});
|
|
8576
8762
|
return;
|
|
8577
8763
|
}
|
|
@@ -8610,8 +8796,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8610
8796
|
patch(
|
|
8611
8797
|
prevTree,
|
|
8612
8798
|
nextTree,
|
|
8613
|
-
// parent may have changed if it's in a teleport
|
|
8614
|
-
|
|
8799
|
+
// parent may have changed if it's in a teleport. a root that is a
|
|
8800
|
+
// pending async component only has its placeholder comment
|
|
8801
|
+
hostParentNode(
|
|
8802
|
+
prevTree.el || resolveAsyncComponentPlaceholder(prevTree)
|
|
8803
|
+
),
|
|
8615
8804
|
// anchor may have changed if it's in a fragment
|
|
8616
8805
|
getNextHostNode(prevTree),
|
|
8617
8806
|
instance,
|
|
@@ -9051,8 +9240,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9051
9240
|
if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) {
|
|
9052
9241
|
parentComponent.renderCache[cacheIndex] = void 0;
|
|
9053
9242
|
}
|
|
9054
|
-
if (shapeFlag & 256) {
|
|
9055
|
-
parentComponent.ctx.deactivate(vnode);
|
|
9243
|
+
if (shapeFlag & 256 && parentComponent.ctx.deactivate(vnode)) {
|
|
9056
9244
|
return;
|
|
9057
9245
|
}
|
|
9058
9246
|
const shouldInvokeDirs = shapeFlag & 1 && dirs;
|
|
@@ -9113,18 +9301,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9113
9301
|
};
|
|
9114
9302
|
const remove = (vnode) => {
|
|
9115
9303
|
const { type, el, anchor, transition } = vnode;
|
|
9116
|
-
|
|
9117
|
-
|
|
9118
|
-
|
|
9119
|
-
if (child.type === Comment) {
|
|
9120
|
-
hostRemove(child.el);
|
|
9121
|
-
} else {
|
|
9122
|
-
remove(child);
|
|
9123
|
-
}
|
|
9124
|
-
});
|
|
9125
|
-
} else {
|
|
9126
|
-
removeFragment(el, anchor);
|
|
9127
|
-
}
|
|
9304
|
+
const isFragment = type === Fragment;
|
|
9305
|
+
if (isFragment && !transition) {
|
|
9306
|
+
removeFragment(el, anchor);
|
|
9128
9307
|
return;
|
|
9129
9308
|
}
|
|
9130
9309
|
if (type === Static) {
|
|
@@ -9134,17 +9313,25 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9134
9313
|
}
|
|
9135
9314
|
return;
|
|
9136
9315
|
}
|
|
9316
|
+
const leavingNode = isFragment ? getTransitionRoot(vnode) : vnode;
|
|
9137
9317
|
const performRemove = () => {
|
|
9138
|
-
|
|
9318
|
+
if (isFragment) {
|
|
9319
|
+
if (hostParentNode(el)) {
|
|
9320
|
+
removeFragment(el, anchor);
|
|
9321
|
+
}
|
|
9322
|
+
} else {
|
|
9323
|
+
hostRemove(el);
|
|
9324
|
+
}
|
|
9139
9325
|
if (transition && !transition.persisted && transition.afterLeave) {
|
|
9140
9326
|
transition.afterLeave();
|
|
9141
9327
|
}
|
|
9142
9328
|
};
|
|
9143
|
-
if (
|
|
9329
|
+
if (leavingNode && leavingNode.shapeFlag & 1 && transition && !transition.persisted) {
|
|
9144
9330
|
const { leave, delayLeave } = transition;
|
|
9145
|
-
const
|
|
9331
|
+
const leavingEl = leavingNode.el;
|
|
9332
|
+
const performLeave = () => leave(leavingEl, performRemove);
|
|
9146
9333
|
if (delayLeave) {
|
|
9147
|
-
delayLeave(
|
|
9334
|
+
delayLeave(leavingEl, performRemove, performLeave);
|
|
9148
9335
|
} else {
|
|
9149
9336
|
performLeave();
|
|
9150
9337
|
}
|
|
@@ -9175,16 +9362,18 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9175
9362
|
if (job) {
|
|
9176
9363
|
job.flags |= 8;
|
|
9177
9364
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
9178
|
-
} else if (
|
|
9365
|
+
} else if (subTree) {
|
|
9179
9366
|
subTree.transition = instance.vnode.transition;
|
|
9180
9367
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
9181
9368
|
}
|
|
9182
9369
|
if (um) {
|
|
9183
9370
|
queuePostRenderEffect(um, parentSuspense);
|
|
9184
9371
|
}
|
|
9185
|
-
|
|
9372
|
+
const markUnmounted = () => {
|
|
9186
9373
|
instance.isUnmounted = true;
|
|
9187
|
-
}
|
|
9374
|
+
};
|
|
9375
|
+
markUnmounted.flags = 16;
|
|
9376
|
+
queuePostRenderEffect(markUnmounted, parentSuspense);
|
|
9188
9377
|
{
|
|
9189
9378
|
devtoolsComponentRemoved(instance);
|
|
9190
9379
|
}
|
|
@@ -9205,32 +9394,26 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9205
9394
|
const teleportEnd = el && el[TeleportEndKey];
|
|
9206
9395
|
return teleportEnd ? hostNextSibling(teleportEnd) : el;
|
|
9207
9396
|
};
|
|
9208
|
-
let isFlushing = false;
|
|
9209
9397
|
const render = (vnode, container, namespace) => {
|
|
9210
|
-
|
|
9211
|
-
|
|
9212
|
-
if (
|
|
9213
|
-
|
|
9214
|
-
|
|
9398
|
+
const minUid = vnode && container._vnode ? void 0 : vnode && vnode.component ? vnode.component.uid : getNextUid();
|
|
9399
|
+
flushOnAppMount(() => {
|
|
9400
|
+
if (vnode == null) {
|
|
9401
|
+
if (container._vnode) {
|
|
9402
|
+
unmount(container._vnode, null, null, true);
|
|
9403
|
+
}
|
|
9404
|
+
} else {
|
|
9405
|
+
patch(
|
|
9406
|
+
container._vnode || null,
|
|
9407
|
+
vnode,
|
|
9408
|
+
container,
|
|
9409
|
+
null,
|
|
9410
|
+
null,
|
|
9411
|
+
null,
|
|
9412
|
+
namespace
|
|
9413
|
+
);
|
|
9215
9414
|
}
|
|
9216
|
-
|
|
9217
|
-
|
|
9218
|
-
container._vnode || null,
|
|
9219
|
-
vnode,
|
|
9220
|
-
container,
|
|
9221
|
-
null,
|
|
9222
|
-
null,
|
|
9223
|
-
null,
|
|
9224
|
-
namespace
|
|
9225
|
-
);
|
|
9226
|
-
}
|
|
9227
|
-
container._vnode = vnode;
|
|
9228
|
-
if (!isFlushing) {
|
|
9229
|
-
isFlushing = true;
|
|
9230
|
-
flushPreFlushCbs(instance);
|
|
9231
|
-
flushPostFlushCbs();
|
|
9232
|
-
isFlushing = false;
|
|
9233
|
-
}
|
|
9415
|
+
container._vnode = vnode;
|
|
9416
|
+
}, minUid);
|
|
9234
9417
|
};
|
|
9235
9418
|
const internals = {
|
|
9236
9419
|
p: patch,
|
|
@@ -9342,13 +9525,13 @@ function getSequence(arr) {
|
|
|
9342
9525
|
}
|
|
9343
9526
|
return result;
|
|
9344
9527
|
}
|
|
9345
|
-
function
|
|
9528
|
+
function locateUnresolvedAsyncRoot(instance) {
|
|
9346
9529
|
const subComponent = instance.subTree.component;
|
|
9347
9530
|
if (subComponent) {
|
|
9348
9531
|
if (subComponent.asyncDep && !subComponent.asyncResolved) {
|
|
9349
9532
|
return subComponent;
|
|
9350
9533
|
} else {
|
|
9351
|
-
return
|
|
9534
|
+
return locateUnresolvedAsyncRoot(subComponent);
|
|
9352
9535
|
}
|
|
9353
9536
|
}
|
|
9354
9537
|
}
|
|
@@ -9366,11 +9549,16 @@ function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
|
9366
9549
|
if (instance) {
|
|
9367
9550
|
return resolveAsyncComponentPlaceholder(instance.subTree);
|
|
9368
9551
|
}
|
|
9552
|
+
const suspense = anchorVnode.suspense;
|
|
9553
|
+
if (suspense && suspense.activeBranch) {
|
|
9554
|
+
return resolveAsyncComponentPlaceholder(suspense.activeBranch);
|
|
9555
|
+
}
|
|
9369
9556
|
return null;
|
|
9370
9557
|
}
|
|
9371
9558
|
|
|
9372
9559
|
const isSuspense = (type) => type.__isSuspense;
|
|
9373
9560
|
let suspenseId = 0;
|
|
9561
|
+
const deferredEnterKey = /* @__PURE__ */ Symbol("_deferredEnter");
|
|
9374
9562
|
const SuspenseImpl = {
|
|
9375
9563
|
name: "Suspense",
|
|
9376
9564
|
// In order to make Suspense tree-shakable, we need to avoid importing it
|
|
@@ -9392,11 +9580,22 @@ const SuspenseImpl = {
|
|
|
9392
9580
|
rendererInternals
|
|
9393
9581
|
);
|
|
9394
9582
|
} else {
|
|
9395
|
-
|
|
9396
|
-
|
|
9397
|
-
|
|
9398
|
-
|
|
9399
|
-
|
|
9583
|
+
const suspense = n1.suspense;
|
|
9584
|
+
if (parentSuspense && parentSuspense.deps > 0 && !parentSuspense.isHydrating) {
|
|
9585
|
+
const owner = suspense.parentComponent;
|
|
9586
|
+
const retained = !!owner && owner.suspense === parentSuspense && owner.suspenseId !== parentSuspense.pendingId;
|
|
9587
|
+
if (retained ? (
|
|
9588
|
+
// deps can outlive the pending branch: skip only while it exists
|
|
9589
|
+
parentSuspense.pendingBranch && !isSameVNodeType(
|
|
9590
|
+
n2.ssContent,
|
|
9591
|
+
suspense.pendingBranch || suspense.activeBranch
|
|
9592
|
+
)
|
|
9593
|
+
) : !suspense.isInFallback) {
|
|
9594
|
+
n2.suspense = suspense;
|
|
9595
|
+
suspense.vnode = n2;
|
|
9596
|
+
n2.el = n1.el;
|
|
9597
|
+
return;
|
|
9598
|
+
}
|
|
9400
9599
|
}
|
|
9401
9600
|
patchSuspense(
|
|
9402
9601
|
n1,
|
|
@@ -9421,6 +9620,38 @@ function triggerEvent(vnode, name) {
|
|
|
9421
9620
|
eventListener();
|
|
9422
9621
|
}
|
|
9423
9622
|
}
|
|
9623
|
+
function enterDeferred(branch) {
|
|
9624
|
+
const enters = [];
|
|
9625
|
+
collectDeferredEnters(branch, enters, true);
|
|
9626
|
+
if (enters.length) {
|
|
9627
|
+
queuePostFlushCb(enters);
|
|
9628
|
+
}
|
|
9629
|
+
}
|
|
9630
|
+
function collectDeferredEnters(vnode, enters, isRoot) {
|
|
9631
|
+
const { el, transition, children, shapeFlag } = vnode;
|
|
9632
|
+
if (shapeFlag & 6) {
|
|
9633
|
+
collectDeferredEnters(vnode.component.subTree, enters, isRoot);
|
|
9634
|
+
return;
|
|
9635
|
+
}
|
|
9636
|
+
if (shapeFlag & (128 | 64)) {
|
|
9637
|
+
return;
|
|
9638
|
+
}
|
|
9639
|
+
if (shapeFlag & 1) {
|
|
9640
|
+
if (!isRoot && el && el[deferredEnterKey]) {
|
|
9641
|
+
el[deferredEnterKey] = void 0;
|
|
9642
|
+
if (transition && !transition.persisted) {
|
|
9643
|
+
transition.beforeEnter(el);
|
|
9644
|
+
enters.push(() => transition.enter(el));
|
|
9645
|
+
}
|
|
9646
|
+
}
|
|
9647
|
+
isRoot = false;
|
|
9648
|
+
}
|
|
9649
|
+
if (shapeFlag & 16) {
|
|
9650
|
+
for (let i = 0; i < children.length; i++) {
|
|
9651
|
+
collectDeferredEnters(children[i], enters, isRoot);
|
|
9652
|
+
}
|
|
9653
|
+
}
|
|
9654
|
+
}
|
|
9424
9655
|
function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
9425
9656
|
const {
|
|
9426
9657
|
p: patch,
|
|
@@ -9520,7 +9751,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
9520
9751
|
unmount(pendingBranch, parentComponent, suspense);
|
|
9521
9752
|
}
|
|
9522
9753
|
suspense.deps = 0;
|
|
9523
|
-
suspense
|
|
9754
|
+
discardEffects(suspense);
|
|
9524
9755
|
suspense.hiddenContainer = createElement("div");
|
|
9525
9756
|
if (isInFallback) {
|
|
9526
9757
|
patch(
|
|
@@ -9598,11 +9829,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
9598
9829
|
} else {
|
|
9599
9830
|
triggerEvent(n2, "onPending");
|
|
9600
9831
|
suspense.pendingBranch = newBranch;
|
|
9601
|
-
|
|
9602
|
-
suspense.pendingId = newBranch.component.suspenseId;
|
|
9603
|
-
} else {
|
|
9604
|
-
suspense.pendingId = suspenseId++;
|
|
9605
|
-
}
|
|
9832
|
+
suspense.pendingId = suspenseId++;
|
|
9606
9833
|
patch(
|
|
9607
9834
|
null,
|
|
9608
9835
|
newBranch,
|
|
@@ -9617,12 +9844,11 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
9617
9844
|
if (suspense.deps <= 0) {
|
|
9618
9845
|
suspense.resolve();
|
|
9619
9846
|
} else {
|
|
9620
|
-
const { timeout
|
|
9847
|
+
const { timeout } = suspense;
|
|
9621
9848
|
if (timeout > 0) {
|
|
9622
|
-
setTimeout(() => {
|
|
9623
|
-
|
|
9624
|
-
|
|
9625
|
-
}
|
|
9849
|
+
suspense.timeoutTimer = setTimeout(() => {
|
|
9850
|
+
suspense.timeoutTimer = void 0;
|
|
9851
|
+
suspense.fallback(suspense.vnode.ssFallback);
|
|
9626
9852
|
}, timeout);
|
|
9627
9853
|
} else if (timeout === 0) {
|
|
9628
9854
|
suspense.fallback(newFallback);
|
|
@@ -9669,6 +9895,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9669
9895
|
deps: 0,
|
|
9670
9896
|
pendingId: suspenseId++,
|
|
9671
9897
|
timeout: typeof timeout === "number" ? timeout : -1,
|
|
9898
|
+
timeoutTimer: void 0,
|
|
9672
9899
|
activeBranch: null,
|
|
9673
9900
|
isFallbackMountPending: false,
|
|
9674
9901
|
pendingBranch: null,
|
|
@@ -9707,7 +9934,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9707
9934
|
let hasUpdatedAnchor = false;
|
|
9708
9935
|
if (delayEnter) {
|
|
9709
9936
|
activeBranch.transition.afterLeave = () => {
|
|
9710
|
-
if (pendingId === suspense.pendingId) {
|
|
9937
|
+
if (pendingId === suspense.pendingId && !suspense.isUnmounted) {
|
|
9938
|
+
enterDeferred(pendingBranch);
|
|
9711
9939
|
move(
|
|
9712
9940
|
pendingBranch,
|
|
9713
9941
|
container2,
|
|
@@ -9722,7 +9950,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9722
9950
|
};
|
|
9723
9951
|
}
|
|
9724
9952
|
if (activeBranch && !suspense.isFallbackMountPending) {
|
|
9725
|
-
if (parentNode(
|
|
9953
|
+
if (parentNode(
|
|
9954
|
+
activeBranch.el || resolveAsyncComponentPlaceholder(activeBranch)
|
|
9955
|
+
) === container2) {
|
|
9726
9956
|
anchor = next(activeBranch);
|
|
9727
9957
|
hasUpdatedAnchor = true;
|
|
9728
9958
|
}
|
|
@@ -9732,13 +9962,26 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9732
9962
|
}
|
|
9733
9963
|
}
|
|
9734
9964
|
if (!delayEnter) {
|
|
9965
|
+
enterDeferred(pendingBranch);
|
|
9735
9966
|
move(pendingBranch, container2, anchor, 0);
|
|
9736
9967
|
}
|
|
9737
9968
|
}
|
|
9969
|
+
clearTimeout(suspense.timeoutTimer);
|
|
9970
|
+
suspense.timeoutTimer = void 0;
|
|
9738
9971
|
suspense.isFallbackMountPending = false;
|
|
9739
9972
|
setActiveBranch(suspense, pendingBranch);
|
|
9740
9973
|
suspense.pendingBranch = null;
|
|
9741
9974
|
suspense.isInFallback = false;
|
|
9975
|
+
let kept = 0;
|
|
9976
|
+
for (let i = 0; i < effects.length; i++) {
|
|
9977
|
+
const effect = effects[i];
|
|
9978
|
+
if (effect.flags & 32) {
|
|
9979
|
+
queuePostFlushCb(effect);
|
|
9980
|
+
} else {
|
|
9981
|
+
effects[kept++] = effect;
|
|
9982
|
+
}
|
|
9983
|
+
}
|
|
9984
|
+
effects.length = kept;
|
|
9742
9985
|
let parent = suspense.parent;
|
|
9743
9986
|
let hasUnresolvedAncestor = false;
|
|
9744
9987
|
while (parent) {
|
|
@@ -9767,7 +10010,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9767
10010
|
triggerEvent(vnode2, "onResolve");
|
|
9768
10011
|
},
|
|
9769
10012
|
fallback(fallbackVNode) {
|
|
9770
|
-
if (!suspense.pendingBranch) {
|
|
10013
|
+
if (suspense.isUnmounted || !suspense.pendingBranch) {
|
|
9771
10014
|
return;
|
|
9772
10015
|
}
|
|
9773
10016
|
const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
|
|
@@ -9775,7 +10018,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9775
10018
|
const anchor2 = next(activeBranch);
|
|
9776
10019
|
const mountFallback = () => {
|
|
9777
10020
|
suspense.isFallbackMountPending = false;
|
|
9778
|
-
if (!suspense.isInFallback) {
|
|
10021
|
+
if (suspense.isUnmounted || !suspense.isInFallback) {
|
|
9779
10022
|
return;
|
|
9780
10023
|
}
|
|
9781
10024
|
const latestFallback = suspense.vnode.ssFallback;
|
|
@@ -9818,25 +10061,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9818
10061
|
next() {
|
|
9819
10062
|
return suspense.activeBranch && next(suspense.activeBranch);
|
|
9820
10063
|
},
|
|
9821
|
-
|
|
10064
|
+
// `namespace` intentionally shadows the boundary's own: the dep must be
|
|
10065
|
+
// mounted with the namespace of the position it was rendered at, which can
|
|
10066
|
+
// differ from the boundary's (e.g. a component nested inside an <svg>).
|
|
10067
|
+
registerDep(instance, setupRenderEffect, optimized2, namespace2) {
|
|
9822
10068
|
const isInPendingSuspense = !!suspense.pendingBranch;
|
|
9823
10069
|
if (isInPendingSuspense) {
|
|
9824
10070
|
suspense.deps++;
|
|
9825
10071
|
}
|
|
9826
10072
|
const hydratedEl = instance.vnode.el;
|
|
9827
|
-
|
|
9828
|
-
handleError(err, instance, 0);
|
|
9829
|
-
}).then((asyncSetupResult) => {
|
|
9830
|
-
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
|
|
9831
|
-
return;
|
|
9832
|
-
}
|
|
9833
|
-
unsetCurrentInstance();
|
|
9834
|
-
if (hydratedEl && !instance.scope.active) {
|
|
9835
|
-
if (isInPendingSuspense && --suspense.deps === 0) {
|
|
9836
|
-
suspense.resolve();
|
|
9837
|
-
}
|
|
9838
|
-
return;
|
|
9839
|
-
}
|
|
10073
|
+
const render = (asyncSetupResult) => {
|
|
9840
10074
|
instance.asyncResolved = true;
|
|
9841
10075
|
const { vnode: vnode2 } = instance;
|
|
9842
10076
|
{
|
|
@@ -9858,7 +10092,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9858
10092
|
// consider the comment placeholder case.
|
|
9859
10093
|
hydratedEl ? null : next(instance.subTree),
|
|
9860
10094
|
suspense,
|
|
9861
|
-
|
|
10095
|
+
namespace2,
|
|
9862
10096
|
optimized2
|
|
9863
10097
|
);
|
|
9864
10098
|
if (placeholder) {
|
|
@@ -9869,13 +10103,57 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9869
10103
|
{
|
|
9870
10104
|
popWarningContext();
|
|
9871
10105
|
}
|
|
9872
|
-
|
|
10106
|
+
};
|
|
10107
|
+
instance.asyncDep.catch((err) => {
|
|
10108
|
+
handleError(err, instance, 0, false, true);
|
|
10109
|
+
return () => null;
|
|
10110
|
+
}).then((asyncSetupResult) => {
|
|
10111
|
+
if (instance.isUnmounted || suspense.isUnmounted) {
|
|
10112
|
+
return;
|
|
10113
|
+
}
|
|
10114
|
+
const isPendingDep = isInPendingSuspense && suspense.pendingId === instance.suspenseId;
|
|
10115
|
+
unsetCurrentInstance();
|
|
10116
|
+
if (!instance.scope.active) {
|
|
10117
|
+
if (isPendingDep && --suspense.deps === 0) {
|
|
10118
|
+
suspense.resolve();
|
|
10119
|
+
}
|
|
10120
|
+
return;
|
|
10121
|
+
}
|
|
10122
|
+
if (!isPendingDep && suspense.pendingBranch) {
|
|
10123
|
+
const job = () => {
|
|
10124
|
+
if (instance.isUnmounted || suspense.isUnmounted || !instance.scope.active) {
|
|
10125
|
+
return;
|
|
10126
|
+
}
|
|
10127
|
+
if (suspense.pendingBranch) {
|
|
10128
|
+
queueEffectWithSuspense(job, suspense);
|
|
10129
|
+
} else {
|
|
10130
|
+
render(asyncSetupResult);
|
|
10131
|
+
}
|
|
10132
|
+
};
|
|
10133
|
+
job.flags = 16 | 32;
|
|
10134
|
+
queueEffectWithSuspense(job, suspense);
|
|
10135
|
+
return;
|
|
10136
|
+
}
|
|
10137
|
+
render(asyncSetupResult);
|
|
10138
|
+
if (isPendingDep && --suspense.deps === 0) {
|
|
9873
10139
|
suspense.resolve();
|
|
9874
10140
|
}
|
|
9875
10141
|
});
|
|
9876
10142
|
},
|
|
9877
10143
|
unmount(parentSuspense2, doRemove) {
|
|
9878
10144
|
suspense.isUnmounted = true;
|
|
10145
|
+
clearTimeout(suspense.timeoutTimer);
|
|
10146
|
+
suspense.timeoutTimer = void 0;
|
|
10147
|
+
if (parentSuspenseId !== void 0) {
|
|
10148
|
+
const parent = suspense.parent;
|
|
10149
|
+
const pendingId = parentSuspenseId;
|
|
10150
|
+
parentSuspenseId = void 0;
|
|
10151
|
+
queuePostFlushCb(() => {
|
|
10152
|
+
if (parent.pendingId === pendingId && !parent.isUnmounted && --parent.deps === 0) {
|
|
10153
|
+
parent.resolve();
|
|
10154
|
+
}
|
|
10155
|
+
});
|
|
10156
|
+
}
|
|
9879
10157
|
if (suspense.activeBranch) {
|
|
9880
10158
|
unmount(
|
|
9881
10159
|
suspense.activeBranch,
|
|
@@ -9885,12 +10163,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9885
10163
|
);
|
|
9886
10164
|
}
|
|
9887
10165
|
if (suspense.pendingBranch) {
|
|
9888
|
-
unmount(
|
|
9889
|
-
|
|
9890
|
-
parentComponent,
|
|
9891
|
-
parentSuspense2,
|
|
9892
|
-
doRemove
|
|
9893
|
-
);
|
|
10166
|
+
unmount(suspense.pendingBranch, parentComponent, suspense, doRemove);
|
|
10167
|
+
discardEffects(suspense);
|
|
9894
10168
|
}
|
|
9895
10169
|
}
|
|
9896
10170
|
};
|
|
@@ -9960,6 +10234,16 @@ function normalizeSuspenseSlot(s) {
|
|
|
9960
10234
|
}
|
|
9961
10235
|
return s;
|
|
9962
10236
|
}
|
|
10237
|
+
function discardEffects(suspense) {
|
|
10238
|
+
const { effects } = suspense;
|
|
10239
|
+
for (let i = 0; i < effects.length; i++) {
|
|
10240
|
+
const effect = effects[i];
|
|
10241
|
+
if (effect.flags & 16) {
|
|
10242
|
+
queuePostFlushCb(effect);
|
|
10243
|
+
}
|
|
10244
|
+
}
|
|
10245
|
+
effects.length = 0;
|
|
10246
|
+
}
|
|
9963
10247
|
function queueEffectWithSuspense(fn, suspense) {
|
|
9964
10248
|
if (suspense && suspense.pendingBranch) {
|
|
9965
10249
|
if (isArray(fn)) {
|
|
@@ -10211,7 +10495,8 @@ Component that was made reactive: `,
|
|
|
10211
10495
|
}
|
|
10212
10496
|
function guardReactiveProps(props) {
|
|
10213
10497
|
if (!props) return null;
|
|
10214
|
-
|
|
10498
|
+
if (isProxy(props)) return extend({}, props);
|
|
10499
|
+
return isInternalObject(props) ? extend({}, props[rawAttrsKey] || props) : props;
|
|
10215
10500
|
}
|
|
10216
10501
|
function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
|
|
10217
10502
|
const { props, ref, patchFlag, children, transition } = vnode;
|
|
@@ -10390,8 +10675,11 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
|
10390
10675
|
]);
|
|
10391
10676
|
}
|
|
10392
10677
|
|
|
10393
|
-
const emptyAppContext = createAppContext();
|
|
10678
|
+
const emptyAppContext = /* @__PURE__ */ createAppContext();
|
|
10394
10679
|
let uid = 0;
|
|
10680
|
+
function getNextUid() {
|
|
10681
|
+
return uid;
|
|
10682
|
+
}
|
|
10395
10683
|
function createComponentInstance(vnode, parent, suspense) {
|
|
10396
10684
|
const type = vnode.type;
|
|
10397
10685
|
const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
|
|
@@ -10600,7 +10888,8 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
10600
10888
|
setInSSRSetupState(false);
|
|
10601
10889
|
}
|
|
10602
10890
|
}).catch((e) => {
|
|
10603
|
-
handleError(e, instance, 0);
|
|
10891
|
+
handleError(e, instance, 0, void 0, true);
|
|
10892
|
+
instance.ssrRender = (_, push) => push("<!---->");
|
|
10604
10893
|
});
|
|
10605
10894
|
} else {
|
|
10606
10895
|
instance.asyncDep = setupResult;
|
|
@@ -10708,11 +10997,12 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
10708
10997
|
}
|
|
10709
10998
|
}
|
|
10710
10999
|
}
|
|
11000
|
+
const rawAttrsKey = /* @__PURE__ */ Symbol();
|
|
10711
11001
|
const attrsProxyHandlers = {
|
|
10712
11002
|
get(target, key) {
|
|
10713
11003
|
markAttrsAccessed();
|
|
10714
11004
|
track(target, "get", "");
|
|
10715
|
-
return target[key];
|
|
11005
|
+
return key === rawAttrsKey ? target : target[key];
|
|
10716
11006
|
},
|
|
10717
11007
|
set() {
|
|
10718
11008
|
warn$1(`setupContext.attrs is readonly.`);
|
|
@@ -11064,7 +11354,7 @@ function isMemoSame(cached, memo) {
|
|
|
11064
11354
|
return true;
|
|
11065
11355
|
}
|
|
11066
11356
|
|
|
11067
|
-
const version = "3.5.
|
|
11357
|
+
const version = "3.5.45";
|
|
11068
11358
|
const warn = warn$1 ;
|
|
11069
11359
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
11070
11360
|
const devtools = devtools$1 ;
|
|
@@ -11640,7 +11930,9 @@ function patchStyle(el, prev, next) {
|
|
|
11640
11930
|
}
|
|
11641
11931
|
}
|
|
11642
11932
|
if (vShowOriginalDisplay in el) {
|
|
11643
|
-
|
|
11933
|
+
if (!isCssString || prev !== next) {
|
|
11934
|
+
el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
|
|
11935
|
+
}
|
|
11644
11936
|
if (el[vShowHidden]) {
|
|
11645
11937
|
style.display = "none";
|
|
11646
11938
|
}
|
|
@@ -12122,7 +12414,9 @@ class VueElement extends BaseClass {
|
|
|
12122
12414
|
"Custom element style injection is not supported when using shadowRoot: false"
|
|
12123
12415
|
);
|
|
12124
12416
|
}
|
|
12125
|
-
this.
|
|
12417
|
+
if (this._connected) {
|
|
12418
|
+
this._mount(def);
|
|
12419
|
+
}
|
|
12126
12420
|
};
|
|
12127
12421
|
const asyncDef = this._def.__asyncLoader;
|
|
12128
12422
|
if (asyncDef) {
|
|
@@ -12492,6 +12786,7 @@ const positionMap = /* @__PURE__ */ new WeakMap();
|
|
|
12492
12786
|
const newPositionMap = /* @__PURE__ */ new WeakMap();
|
|
12493
12787
|
const moveCbKey = /* @__PURE__ */ Symbol("_moveCb");
|
|
12494
12788
|
const enterCbKey = /* @__PURE__ */ Symbol("_enterCb");
|
|
12789
|
+
const pendingGroups = /* @__PURE__ */ new WeakMap();
|
|
12495
12790
|
const decorate = (t) => {
|
|
12496
12791
|
delete t.props.mode;
|
|
12497
12792
|
return t;
|
|
@@ -12507,21 +12802,30 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
|
|
|
12507
12802
|
const state = useTransitionState();
|
|
12508
12803
|
let prevChildren;
|
|
12509
12804
|
let children;
|
|
12510
|
-
|
|
12511
|
-
|
|
12512
|
-
|
|
12805
|
+
let origins;
|
|
12806
|
+
let moves;
|
|
12807
|
+
const willMove = () => {
|
|
12808
|
+
if (moves === void 0) {
|
|
12809
|
+
moves = prevChildren.length > 0 && hasCSSTransform(
|
|
12810
|
+
prevChildren[0].el,
|
|
12811
|
+
instance.vnode.el,
|
|
12812
|
+
resolveMoveClass(props)
|
|
12813
|
+
);
|
|
12513
12814
|
}
|
|
12514
|
-
|
|
12515
|
-
|
|
12516
|
-
|
|
12517
|
-
|
|
12518
|
-
|
|
12519
|
-
)) {
|
|
12815
|
+
return moves;
|
|
12816
|
+
};
|
|
12817
|
+
onUpdated(() => {
|
|
12818
|
+
pendingGroups.delete(instance);
|
|
12819
|
+
if (!willMove()) {
|
|
12520
12820
|
prevChildren = [];
|
|
12821
|
+
origins = void 0;
|
|
12521
12822
|
return;
|
|
12522
12823
|
}
|
|
12824
|
+
const moveClass = resolveMoveClass(props);
|
|
12523
12825
|
prevChildren.forEach(callPendingCbs);
|
|
12524
|
-
|
|
12826
|
+
const shift = origins && getOriginShift(origins, instance.vnode.el);
|
|
12827
|
+
origins = void 0;
|
|
12828
|
+
prevChildren.forEach((c) => recordPosition(c, shift));
|
|
12525
12829
|
const movedChildren = prevChildren.filter(applyTranslation);
|
|
12526
12830
|
forceReflow(instance.vnode.el);
|
|
12527
12831
|
movedChildren.forEach((c) => {
|
|
@@ -12548,6 +12852,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
|
|
|
12548
12852
|
const cssTransitionProps = resolveTransitionProps(rawProps);
|
|
12549
12853
|
let tag = rawProps.tag || Fragment;
|
|
12550
12854
|
prevChildren = [];
|
|
12855
|
+
moves = void 0;
|
|
12551
12856
|
if (children) {
|
|
12552
12857
|
for (let i = 0; i < children.length; i++) {
|
|
12553
12858
|
const child = children[i];
|
|
@@ -12579,6 +12884,10 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
|
|
|
12579
12884
|
warn(`<TransitionGroup> children must be keyed.`);
|
|
12580
12885
|
}
|
|
12581
12886
|
}
|
|
12887
|
+
if (prevChildren.length) {
|
|
12888
|
+
origins = getOrigins(instance);
|
|
12889
|
+
pendingGroups.set(instance, willMove);
|
|
12890
|
+
}
|
|
12582
12891
|
return createVNode(tag, null, children);
|
|
12583
12892
|
};
|
|
12584
12893
|
}
|
|
@@ -12593,8 +12902,11 @@ function callPendingCbs(c) {
|
|
|
12593
12902
|
el[enterCbKey]();
|
|
12594
12903
|
}
|
|
12595
12904
|
}
|
|
12596
|
-
function
|
|
12597
|
-
|
|
12905
|
+
function resolveMoveClass(props) {
|
|
12906
|
+
return props.moveClass || `${props.name || "v"}-move`;
|
|
12907
|
+
}
|
|
12908
|
+
function recordPosition(c, shift) {
|
|
12909
|
+
newPositionMap.set(c, getPosition(c.el, shift));
|
|
12598
12910
|
}
|
|
12599
12911
|
function applyTranslation(c) {
|
|
12600
12912
|
const oldPos = positionMap.get(c);
|
|
@@ -12618,13 +12930,41 @@ function applyTranslation(c) {
|
|
|
12618
12930
|
return c;
|
|
12619
12931
|
}
|
|
12620
12932
|
}
|
|
12621
|
-
function getPosition(el) {
|
|
12933
|
+
function getPosition(el, shift) {
|
|
12622
12934
|
const rect = el.getBoundingClientRect();
|
|
12623
12935
|
return {
|
|
12624
|
-
left: rect.left,
|
|
12625
|
-
top: rect.top
|
|
12936
|
+
left: rect.left - (shift ? shift.left : 0),
|
|
12937
|
+
top: rect.top - (shift ? shift.top : 0)
|
|
12626
12938
|
};
|
|
12627
12939
|
}
|
|
12940
|
+
function getOrigins(instance) {
|
|
12941
|
+
let origins;
|
|
12942
|
+
for (let group = instance.parent; group; group = group.parent) {
|
|
12943
|
+
const willMove = pendingGroups.get(group);
|
|
12944
|
+
if (willMove) {
|
|
12945
|
+
const item = findItem(group.vnode.el, instance.vnode.el);
|
|
12946
|
+
if (item) {
|
|
12947
|
+
(origins || (origins = [])).push(
|
|
12948
|
+
extend(getPosition(item), { item, willMove })
|
|
12949
|
+
);
|
|
12950
|
+
}
|
|
12951
|
+
}
|
|
12952
|
+
}
|
|
12953
|
+
return origins;
|
|
12954
|
+
}
|
|
12955
|
+
function findItem(root, node) {
|
|
12956
|
+
const container = root.nodeType === 1 ? root : root.parentNode;
|
|
12957
|
+
while (node && node.parentNode !== container) {
|
|
12958
|
+
node = node.parentNode;
|
|
12959
|
+
}
|
|
12960
|
+
if (node && node.nodeType === 1) {
|
|
12961
|
+
return node;
|
|
12962
|
+
}
|
|
12963
|
+
}
|
|
12964
|
+
function getOriginShift(origins, root) {
|
|
12965
|
+
const origin = origins.find((o) => o.willMove() && o.item.contains(root));
|
|
12966
|
+
return origin && getPosition(origin.item, origin);
|
|
12967
|
+
}
|
|
12628
12968
|
function hasCSSTransform(el, root, moveClass) {
|
|
12629
12969
|
const clone = el.cloneNode();
|
|
12630
12970
|
const _vtc = el[vtcKey];
|
|
@@ -12819,18 +13159,18 @@ const vModelSelect = {
|
|
|
12819
13159
|
},
|
|
12820
13160
|
// set value in mounted & updated because <select> relies on its children
|
|
12821
13161
|
// <option>s.
|
|
12822
|
-
mounted(el, { value }) {
|
|
12823
|
-
setSelected(el, value);
|
|
13162
|
+
mounted(el, { value, modifiers: { number } }) {
|
|
13163
|
+
setSelected(el, value, number);
|
|
12824
13164
|
},
|
|
12825
13165
|
beforeUpdate(el, { value }, vnode) {
|
|
12826
13166
|
el._modelValue = value;
|
|
12827
13167
|
el[assignKey] = getModelAssigner(vnode);
|
|
12828
13168
|
},
|
|
12829
|
-
updated(el, { value }) {
|
|
13169
|
+
updated(el, { value, modifiers: { number } }) {
|
|
12830
13170
|
const pending = el._pendingValue;
|
|
12831
13171
|
el._pendingValue = void 0;
|
|
12832
13172
|
if (!pending || pending[0] !== el.multiple || !isSameSelectValue(value, pending[1], pending[0])) {
|
|
12833
|
-
setSelected(el, value);
|
|
13173
|
+
setSelected(el, value, number);
|
|
12834
13174
|
}
|
|
12835
13175
|
}
|
|
12836
13176
|
};
|
|
@@ -12846,7 +13186,7 @@ function isSameSelectValue(value, assignedValue, multiple) {
|
|
|
12846
13186
|
}
|
|
12847
13187
|
return false;
|
|
12848
13188
|
}
|
|
12849
|
-
function setSelected(el, value) {
|
|
13189
|
+
function setSelected(el, value, number = false) {
|
|
12850
13190
|
const isMultiple = el.multiple;
|
|
12851
13191
|
const isArrayValue = isArray(value);
|
|
12852
13192
|
if (isMultiple && !isArrayValue && !isSet(value)) {
|
|
@@ -12867,7 +13207,7 @@ function setSelected(el, value) {
|
|
|
12867
13207
|
option.selected = looseIndexOf(value, optionValue) > -1;
|
|
12868
13208
|
}
|
|
12869
13209
|
} else {
|
|
12870
|
-
option.selected = value.has(optionValue);
|
|
13210
|
+
option.selected = value.has(optionValue) || number && typeof optionValue === "string" && value.has(looseToNumber(optionValue));
|
|
12871
13211
|
}
|
|
12872
13212
|
} else if (looseEqual(getValue(option), value)) {
|
|
12873
13213
|
if (el.selectedIndex !== i) el.selectedIndex = i;
|