@vue/runtime-dom 3.6.0-beta.9 → 3.6.0-rc.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/dist/runtime-dom.cjs.js +47 -28
- package/dist/runtime-dom.cjs.prod.js +47 -28
- package/dist/runtime-dom.d.ts +8 -2
- package/dist/runtime-dom.esm-browser.js +395 -193
- package/dist/runtime-dom.esm-browser.prod.js +3 -3
- package/dist/runtime-dom.esm-bundler.js +48 -29
- package/dist/runtime-dom.global.js +395 -193
- package/dist/runtime-dom.global.prod.js +3 -3
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.6.0-
|
|
2
|
+
* @vue/runtime-dom v3.6.0-rc.1
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -433,6 +433,13 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
433
433
|
const notifyBuffer = [];
|
|
434
434
|
let batchDepth = 0;
|
|
435
435
|
let activeSub = void 0;
|
|
436
|
+
let runDepth = 0;
|
|
437
|
+
function incRunDepth() {
|
|
438
|
+
++runDepth;
|
|
439
|
+
}
|
|
440
|
+
function decRunDepth() {
|
|
441
|
+
--runDepth;
|
|
442
|
+
}
|
|
436
443
|
let globalVersion = 0;
|
|
437
444
|
let notifyIndex = 0;
|
|
438
445
|
let notifyBufferLength = 0;
|
|
@@ -506,8 +513,10 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
506
513
|
const sub = link.sub;
|
|
507
514
|
let flags = sub.flags;
|
|
508
515
|
if (flags & 3) {
|
|
509
|
-
if (!(flags & 60))
|
|
510
|
-
|
|
516
|
+
if (!(flags & 60)) {
|
|
517
|
+
sub.flags = flags | 32;
|
|
518
|
+
if (runDepth) sub.flags |= 8;
|
|
519
|
+
} else if (!(flags & 12)) flags = 0;
|
|
511
520
|
else if (!(flags & 4)) sub.flags = flags & -9 | 32;
|
|
512
521
|
else if (!(flags & 48) && isValidLink(link, sub)) {
|
|
513
522
|
sub.flags = flags | 40;
|
|
@@ -576,13 +585,13 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
576
585
|
let dirty = false;
|
|
577
586
|
if (sub.flags & 16) dirty = true;
|
|
578
587
|
else if ((depFlags & 17) === 17) {
|
|
588
|
+
const subs = dep.subs;
|
|
579
589
|
if (dep.update()) {
|
|
580
|
-
const subs = dep.subs;
|
|
581
590
|
if (subs.nextSub !== void 0) shallowPropagate(subs);
|
|
582
591
|
dirty = true;
|
|
583
592
|
}
|
|
584
593
|
} else if ((depFlags & 33) === 33) {
|
|
585
|
-
|
|
594
|
+
stack = {
|
|
586
595
|
value: link,
|
|
587
596
|
prev: stack
|
|
588
597
|
};
|
|
@@ -597,15 +606,12 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
597
606
|
}
|
|
598
607
|
while (checkDepth) {
|
|
599
608
|
--checkDepth;
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
if (hasMultipleSubs) {
|
|
603
|
-
link = stack.value;
|
|
604
|
-
stack = stack.prev;
|
|
605
|
-
} else link = firstSub;
|
|
609
|
+
link = stack.value;
|
|
610
|
+
stack = stack.prev;
|
|
606
611
|
if (dirty) {
|
|
612
|
+
const subs = sub.subs;
|
|
607
613
|
if (sub.update()) {
|
|
608
|
-
if (
|
|
614
|
+
if (subs.nextSub !== void 0) shallowPropagate(subs);
|
|
609
615
|
sub = link.sub;
|
|
610
616
|
continue;
|
|
611
617
|
}
|
|
@@ -617,7 +623,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
617
623
|
}
|
|
618
624
|
dirty = false;
|
|
619
625
|
}
|
|
620
|
-
return dirty;
|
|
626
|
+
return dirty && !!sub.flags;
|
|
621
627
|
} while (true);
|
|
622
628
|
}
|
|
623
629
|
function shallowPropagate(link) {
|
|
@@ -1000,7 +1006,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
1000
1006
|
}
|
|
1001
1007
|
const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
|
|
1002
1008
|
const result = Reflect.set(target, key, value, /* @__PURE__ */ isRef(target) ? target : receiver);
|
|
1003
|
-
if (target === /* @__PURE__ */ toRaw(receiver)) {
|
|
1009
|
+
if (target === /* @__PURE__ */ toRaw(receiver) && result) {
|
|
1004
1010
|
if (!hadKey) trigger(target, "add", key, value);
|
|
1005
1011
|
else if (hasChanged(value, oldValue)) trigger(target, "set", key, value, oldValue);
|
|
1006
1012
|
}
|
|
@@ -1218,9 +1224,6 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
1218
1224
|
default: return 0;
|
|
1219
1225
|
}
|
|
1220
1226
|
}
|
|
1221
|
-
function getTargetType(value) {
|
|
1222
|
-
return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
|
|
1223
|
-
}
|
|
1224
1227
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1225
1228
|
function reactive(target) {
|
|
1226
1229
|
if (/* @__PURE__ */ isReadonly(target)) return target;
|
|
@@ -1333,10 +1336,11 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
1333
1336
|
return target;
|
|
1334
1337
|
}
|
|
1335
1338
|
if (target["__v_raw"] && !(isReadonly && target["__v_isReactive"])) return target;
|
|
1336
|
-
|
|
1337
|
-
if (targetType === 0) return target;
|
|
1339
|
+
if (target["__v_skip"] || !Object.isExtensible(target)) return target;
|
|
1338
1340
|
const existingProxy = proxyMap.get(target);
|
|
1339
1341
|
if (existingProxy) return existingProxy;
|
|
1342
|
+
const targetType = targetTypeMap(toRawType(target));
|
|
1343
|
+
if (targetType === 0) return target;
|
|
1340
1344
|
const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
|
|
1341
1345
|
proxyMap.set(target, proxy);
|
|
1342
1346
|
return proxy;
|
|
@@ -1769,9 +1773,11 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
1769
1773
|
if (!this.active) return this.fn();
|
|
1770
1774
|
cleanup(this);
|
|
1771
1775
|
const prevSub = startTracking(this);
|
|
1776
|
+
incRunDepth();
|
|
1772
1777
|
try {
|
|
1773
1778
|
return this.fn();
|
|
1774
1779
|
} finally {
|
|
1780
|
+
decRunDepth();
|
|
1775
1781
|
endTracking(this, prevSub);
|
|
1776
1782
|
const flags = this.flags;
|
|
1777
1783
|
if ((flags & 136) === 136) {
|
|
@@ -2152,8 +2158,9 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
2152
2158
|
if (once && cb) {
|
|
2153
2159
|
const _cb = cb;
|
|
2154
2160
|
cb = (...args) => {
|
|
2155
|
-
_cb(...args);
|
|
2161
|
+
const res = _cb(...args);
|
|
2156
2162
|
this.stop();
|
|
2163
|
+
return res;
|
|
2157
2164
|
};
|
|
2158
2165
|
}
|
|
2159
2166
|
this.cb = cb;
|
|
@@ -2167,7 +2174,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
2167
2174
|
if (!this.cb) return;
|
|
2168
2175
|
const { immediate, deep, call } = this.options;
|
|
2169
2176
|
if (initialRun && !immediate) return;
|
|
2170
|
-
if (deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
|
|
2177
|
+
if (initialRun || deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
|
|
2171
2178
|
cleanup(this);
|
|
2172
2179
|
const currentWatcher = activeWatcher;
|
|
2173
2180
|
activeWatcher = this;
|
|
@@ -2474,8 +2481,8 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
2474
2481
|
/**
|
|
2475
2482
|
* @internal for runtime-vapor only
|
|
2476
2483
|
*/
|
|
2477
|
-
function queueJob(job, id, isPre = false) {
|
|
2478
|
-
if (queueJobWorker(job, id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : id * 2 + 1, jobs, jobsLength, flushIndex)) {
|
|
2484
|
+
function queueJob(job, id, isPre = false, order = 0) {
|
|
2485
|
+
if (queueJobWorker(job, id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : order ? id * 2 + 1 + order / (order + 1) : id * 2 + 1, jobs, jobsLength, flushIndex)) {
|
|
2479
2486
|
jobsLength++;
|
|
2480
2487
|
queueFlush();
|
|
2481
2488
|
}
|
|
@@ -2584,6 +2591,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
2584
2591
|
}
|
|
2585
2592
|
flushIndex = 0;
|
|
2586
2593
|
jobsLength = 0;
|
|
2594
|
+
jobs.length = 0;
|
|
2587
2595
|
flushPostFlushCbs(seen);
|
|
2588
2596
|
currentFlushPromise = null;
|
|
2589
2597
|
if (jobsLength || postJobs.length) flushJobs(seen);
|
|
@@ -2641,6 +2649,14 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
2641
2649
|
function normalizeClassComponent(component) {
|
|
2642
2650
|
return isClassComponent(component) ? component.__vccOpts : component;
|
|
2643
2651
|
}
|
|
2652
|
+
function hasDirtyAncestor(instance, dirtyInstances) {
|
|
2653
|
+
let parent = instance.parent;
|
|
2654
|
+
while (parent) {
|
|
2655
|
+
if (dirtyInstances.has(parent)) return true;
|
|
2656
|
+
parent = parent.parent;
|
|
2657
|
+
}
|
|
2658
|
+
return false;
|
|
2659
|
+
}
|
|
2644
2660
|
function rerender(id, newRender) {
|
|
2645
2661
|
const record = map.get(id);
|
|
2646
2662
|
if (!record) return;
|
|
@@ -2672,42 +2688,69 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
2672
2688
|
const isVapor = record.initialDef.__vapor;
|
|
2673
2689
|
updateComponentDef(record.initialDef, newComp);
|
|
2674
2690
|
const instances = [...record.instances];
|
|
2675
|
-
if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
|
|
2691
|
+
if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
|
|
2676
2692
|
for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
const
|
|
2680
|
-
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
2681
|
-
if (!dirtyInstances) {
|
|
2682
|
-
if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
|
|
2683
|
-
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
2684
|
-
}
|
|
2685
|
-
dirtyInstances.add(instance);
|
|
2686
|
-
hmrDirtyComponentsMode.set(oldComp, !!isVapor);
|
|
2687
|
-
instance.appContext.propsCache.delete(instance.type);
|
|
2688
|
-
instance.appContext.emitsCache.delete(instance.type);
|
|
2689
|
-
instance.appContext.optionsCache.delete(instance.type);
|
|
2690
|
-
if (instance.ceReload) {
|
|
2691
|
-
dirtyInstances.add(instance);
|
|
2692
|
-
instance.ceReload(newComp.styles);
|
|
2693
|
-
dirtyInstances.delete(instance);
|
|
2694
|
-
} else if (instance.parent) queueJob(() => {
|
|
2695
|
-
isHmrUpdating = true;
|
|
2693
|
+
const dirtyInstances = new Set(instances);
|
|
2694
|
+
const rerenderedParents = /* @__PURE__ */ new Set();
|
|
2695
|
+
for (const instance of instances) {
|
|
2696
2696
|
const parent = instance.parent;
|
|
2697
|
-
if (parent
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2697
|
+
if (parent) {
|
|
2698
|
+
if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
|
|
2699
|
+
rerenderedParents.add(parent);
|
|
2700
|
+
parent.hmrRerender();
|
|
2701
|
+
}
|
|
2702
|
+
} else instance.hmrReload(newComp);
|
|
2703
|
+
}
|
|
2704
|
+
} else {
|
|
2705
|
+
const parentUpdates = /* @__PURE__ */ new Map();
|
|
2706
|
+
const dirtyInstanceSet = new Set(instances);
|
|
2707
|
+
for (const instance of instances) {
|
|
2708
|
+
const oldComp = normalizeClassComponent(instance.type);
|
|
2709
|
+
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
2710
|
+
if (!dirtyInstances) {
|
|
2711
|
+
if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
|
|
2712
|
+
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
2701
2713
|
}
|
|
2702
|
-
|
|
2703
|
-
|
|
2714
|
+
dirtyInstances.add(instance);
|
|
2715
|
+
hmrDirtyComponentsMode.set(oldComp, !!isVapor);
|
|
2716
|
+
instance.appContext.propsCache.delete(instance.type);
|
|
2717
|
+
instance.appContext.emitsCache.delete(instance.type);
|
|
2718
|
+
instance.appContext.optionsCache.delete(instance.type);
|
|
2719
|
+
if (instance.ceReload) {
|
|
2720
|
+
dirtyInstances.add(instance);
|
|
2721
|
+
instance.ceReload(newComp.styles);
|
|
2722
|
+
dirtyInstances.delete(instance);
|
|
2723
|
+
} else if (instance.parent) {
|
|
2724
|
+
const parent = instance.parent;
|
|
2725
|
+
if (!hasDirtyAncestor(instance, dirtyInstanceSet)) {
|
|
2726
|
+
let updates = parentUpdates.get(parent);
|
|
2727
|
+
if (!updates) parentUpdates.set(parent, updates = []);
|
|
2728
|
+
updates.push([instance, dirtyInstances]);
|
|
2729
|
+
}
|
|
2730
|
+
} else if (instance.appContext.reload) instance.appContext.reload();
|
|
2731
|
+
else if (typeof window !== "undefined") window.location.reload();
|
|
2732
|
+
else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
|
|
2733
|
+
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
2734
|
+
}
|
|
2735
|
+
parentUpdates.forEach((updates, parent) => {
|
|
2736
|
+
queueJob(() => {
|
|
2737
|
+
isHmrUpdating = true;
|
|
2738
|
+
if (parent.vapor) parent.hmrRerender();
|
|
2739
|
+
else {
|
|
2740
|
+
const i = parent;
|
|
2741
|
+
if (!(i.effect.flags & 1024)) {
|
|
2742
|
+
i.renderCache = [];
|
|
2743
|
+
i.effect.run();
|
|
2744
|
+
}
|
|
2745
|
+
}
|
|
2746
|
+
nextTick(() => {
|
|
2747
|
+
isHmrUpdating = false;
|
|
2748
|
+
});
|
|
2749
|
+
updates.forEach(([instance, dirtyInstances]) => {
|
|
2750
|
+
dirtyInstances.delete(instance);
|
|
2751
|
+
});
|
|
2704
2752
|
});
|
|
2705
|
-
dirtyInstances.delete(instance);
|
|
2706
2753
|
});
|
|
2707
|
-
else if (instance.appContext.reload) instance.appContext.reload();
|
|
2708
|
-
else if (typeof window !== "undefined") window.location.reload();
|
|
2709
|
-
else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
|
|
2710
|
-
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
2711
2754
|
}
|
|
2712
2755
|
queuePostFlushCb(() => {
|
|
2713
2756
|
hmrDirtyComponents.clear();
|
|
@@ -2850,10 +2893,12 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
2850
2893
|
const renderFnWithContext = (...args) => {
|
|
2851
2894
|
if (renderFnWithContext._d) setBlockTracking(-1);
|
|
2852
2895
|
const prevInstance = setCurrentRenderingInstance(ctx);
|
|
2896
|
+
const prevStackSize = blockStack.length;
|
|
2853
2897
|
let res;
|
|
2854
2898
|
try {
|
|
2855
2899
|
res = fn(...args);
|
|
2856
2900
|
} finally {
|
|
2901
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
2857
2902
|
setCurrentRenderingInstance(prevInstance);
|
|
2858
2903
|
if (renderFnWithContext._d) setBlockTracking(1);
|
|
2859
2904
|
}
|
|
@@ -3037,6 +3082,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3037
3082
|
}
|
|
3038
3083
|
//#endregion
|
|
3039
3084
|
//#region packages/runtime-core/src/components/Teleport.ts
|
|
3085
|
+
const pendingMounts = /* @__PURE__ */ new WeakMap();
|
|
3040
3086
|
const TeleportEndKey = Symbol("_vte");
|
|
3041
3087
|
const isTeleport = (type) => type.__isTeleport;
|
|
3042
3088
|
const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
|
|
@@ -3062,58 +3108,70 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3062
3108
|
name: "Teleport",
|
|
3063
3109
|
__isTeleport: true,
|
|
3064
3110
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
|
|
3065
|
-
const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment } } = internals;
|
|
3111
|
+
const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment, parentNode } } = internals;
|
|
3066
3112
|
const disabled = isTeleportDisabled(n2.props);
|
|
3067
|
-
let {
|
|
3113
|
+
let { dynamicChildren } = n2;
|
|
3068
3114
|
if (isHmrUpdating) {
|
|
3069
3115
|
optimized = false;
|
|
3070
3116
|
dynamicChildren = null;
|
|
3071
3117
|
}
|
|
3118
|
+
const mount = (vnode, container, anchor) => {
|
|
3119
|
+
if (vnode.shapeFlag & 16) mountChildren(vnode.children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
3120
|
+
};
|
|
3121
|
+
const mountToTarget = (vnode = n2) => {
|
|
3122
|
+
const disabled = isTeleportDisabled(vnode.props);
|
|
3123
|
+
const target = vnode.target = resolveTarget(vnode.props, querySelector);
|
|
3124
|
+
const targetAnchor = prepareAnchor(target, vnode, createText, insert);
|
|
3125
|
+
if (target) {
|
|
3126
|
+
if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
|
|
3127
|
+
else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
|
|
3128
|
+
if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
|
|
3129
|
+
if (!disabled) {
|
|
3130
|
+
mount(vnode, target, targetAnchor);
|
|
3131
|
+
updateCssVars(vnode, false);
|
|
3132
|
+
}
|
|
3133
|
+
} else if (!disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
|
|
3134
|
+
};
|
|
3135
|
+
const queuePendingMount = (vnode) => {
|
|
3136
|
+
const mountJob = () => {
|
|
3137
|
+
if (pendingMounts.get(vnode) !== mountJob) return;
|
|
3138
|
+
pendingMounts.delete(vnode);
|
|
3139
|
+
if (isTeleportDisabled(vnode.props)) {
|
|
3140
|
+
mount(vnode, parentNode(vnode.el) || container, vnode.anchor);
|
|
3141
|
+
updateCssVars(vnode, true);
|
|
3142
|
+
}
|
|
3143
|
+
mountToTarget(vnode);
|
|
3144
|
+
};
|
|
3145
|
+
pendingMounts.set(vnode, mountJob);
|
|
3146
|
+
queuePostRenderEffect(mountJob, void 0, parentSuspense);
|
|
3147
|
+
};
|
|
3072
3148
|
if (n1 == null) {
|
|
3073
3149
|
const placeholder = n2.el = createComment("teleport start");
|
|
3074
3150
|
const mainAnchor = n2.anchor = createComment("teleport end");
|
|
3075
3151
|
insert(placeholder, container, anchor);
|
|
3076
3152
|
insert(mainAnchor, container, anchor);
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
const target = n2.target = resolveTarget(n2.props, querySelector);
|
|
3082
|
-
const targetAnchor = prepareAnchor(target, n2, createText, insert);
|
|
3083
|
-
if (target) {
|
|
3084
|
-
if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
|
|
3085
|
-
else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
|
|
3086
|
-
if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
|
|
3087
|
-
if (!disabled) {
|
|
3088
|
-
mount(target, targetAnchor);
|
|
3089
|
-
updateCssVars(n2, false);
|
|
3090
|
-
}
|
|
3091
|
-
} else if (!disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
|
|
3092
|
-
};
|
|
3153
|
+
if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
|
|
3154
|
+
queuePendingMount(n2);
|
|
3155
|
+
return;
|
|
3156
|
+
}
|
|
3093
3157
|
if (disabled) {
|
|
3094
|
-
mount(container, mainAnchor);
|
|
3158
|
+
mount(n2, container, mainAnchor);
|
|
3095
3159
|
updateCssVars(n2, true);
|
|
3096
3160
|
}
|
|
3097
|
-
|
|
3098
|
-
n2.el.__isMounted = false;
|
|
3099
|
-
queuePostRenderEffect(() => {
|
|
3100
|
-
if (n2.el.__isMounted !== false) return;
|
|
3101
|
-
mountToTarget();
|
|
3102
|
-
delete n2.el.__isMounted;
|
|
3103
|
-
}, void 0, parentSuspense);
|
|
3104
|
-
} else mountToTarget();
|
|
3161
|
+
mountToTarget();
|
|
3105
3162
|
} else {
|
|
3106
3163
|
n2.el = n1.el;
|
|
3107
|
-
n2.targetStart = n1.targetStart;
|
|
3108
3164
|
const mainAnchor = n2.anchor = n1.anchor;
|
|
3109
|
-
const
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
}, void 0, parentSuspense);
|
|
3165
|
+
const pendingMount = pendingMounts.get(n1);
|
|
3166
|
+
if (pendingMount) {
|
|
3167
|
+
pendingMount.flags |= 4;
|
|
3168
|
+
pendingMounts.delete(n1);
|
|
3169
|
+
queuePendingMount(n2);
|
|
3115
3170
|
return;
|
|
3116
3171
|
}
|
|
3172
|
+
n2.targetStart = n1.targetStart;
|
|
3173
|
+
const target = n2.target = n1.target;
|
|
3174
|
+
const targetAnchor = n2.targetAnchor = n1.targetAnchor;
|
|
3117
3175
|
const wasDisabled = isTeleportDisabled(n1.props);
|
|
3118
3176
|
const currentContainer = wasDisabled ? container : target;
|
|
3119
3177
|
const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
|
|
@@ -3127,24 +3185,30 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3127
3185
|
if (!wasDisabled) moveTeleport(n2, container, mainAnchor, internals, parentComponent, 1);
|
|
3128
3186
|
else if (n2.props && n1.props && n2.props.to !== n1.props.to) n2.props.to = n1.props.to;
|
|
3129
3187
|
} else if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
|
|
3130
|
-
const nextTarget =
|
|
3131
|
-
if (nextTarget)
|
|
3132
|
-
|
|
3188
|
+
const nextTarget = resolveTarget(n2.props, querySelector);
|
|
3189
|
+
if (nextTarget) {
|
|
3190
|
+
n2.target = nextTarget;
|
|
3191
|
+
moveTeleport(n2, nextTarget, null, internals, parentComponent, 0);
|
|
3192
|
+
} else warn$1("Invalid Teleport target on update:", target, `(${typeof target})`);
|
|
3133
3193
|
} else if (wasDisabled) moveTeleport(n2, target, targetAnchor, internals, parentComponent, 1);
|
|
3134
3194
|
updateCssVars(n2, disabled);
|
|
3135
3195
|
}
|
|
3136
3196
|
},
|
|
3137
3197
|
remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
3138
|
-
const { shapeFlag, children, anchor, targetStart, targetAnchor, props } = vnode;
|
|
3198
|
+
const { shapeFlag, children, anchor, targetStart, targetAnchor, target, props } = vnode;
|
|
3199
|
+
const disabled = isTeleportDisabled(props);
|
|
3200
|
+
const shouldRemove = doRemove || !disabled;
|
|
3201
|
+
const pendingMount = pendingMounts.get(vnode);
|
|
3202
|
+
if (pendingMount) {
|
|
3203
|
+
pendingMount.flags |= 4;
|
|
3204
|
+
pendingMounts.delete(vnode);
|
|
3205
|
+
}
|
|
3139
3206
|
if (targetStart) hostRemove(targetStart);
|
|
3140
3207
|
if (targetAnchor) hostRemove(targetAnchor);
|
|
3141
3208
|
doRemove && hostRemove(anchor);
|
|
3142
|
-
if (shapeFlag & 16) {
|
|
3143
|
-
const
|
|
3144
|
-
|
|
3145
|
-
const child = children[i];
|
|
3146
|
-
unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
|
|
3147
|
-
}
|
|
3209
|
+
if (!pendingMount && (disabled || target) && shapeFlag & 16) for (let i = 0; i < children.length; i++) {
|
|
3210
|
+
const child = children[i];
|
|
3211
|
+
unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
|
|
3148
3212
|
}
|
|
3149
3213
|
},
|
|
3150
3214
|
move: moveTeleport,
|
|
@@ -3155,7 +3219,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3155
3219
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
3156
3220
|
const isReorder = moveType === 2;
|
|
3157
3221
|
if (isReorder) insert(el, container, parentAnchor);
|
|
3158
|
-
if (!isReorder || isTeleportDisabled(props)) {
|
|
3222
|
+
if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
|
|
3159
3223
|
if (shapeFlag & 16) for (let i = 0; i < children.length; i++) move(children[i], container, parentAnchor, 2, parentComponent);
|
|
3160
3224
|
}
|
|
3161
3225
|
if (isReorder) insert(anchor, container, parentAnchor);
|
|
@@ -3280,8 +3344,8 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3280
3344
|
const state = useTransitionState();
|
|
3281
3345
|
return () => {
|
|
3282
3346
|
const children = slots.default && getTransitionRawChildren(slots.default(), true);
|
|
3283
|
-
|
|
3284
|
-
|
|
3347
|
+
const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
|
|
3348
|
+
if (!child) return;
|
|
3285
3349
|
const rawProps = /* @__PURE__ */ toRaw(props);
|
|
3286
3350
|
const { mode } = rawProps;
|
|
3287
3351
|
checkTransitionMode(mode);
|
|
@@ -3733,7 +3797,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3733
3797
|
else nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
3734
3798
|
break;
|
|
3735
3799
|
case VaporSlot:
|
|
3736
|
-
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node);
|
|
3800
|
+
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense);
|
|
3737
3801
|
break;
|
|
3738
3802
|
default: if (shapeFlag & 1) if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) nextNode = onMismatch();
|
|
3739
3803
|
else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
@@ -3743,16 +3807,31 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3743
3807
|
if (isFragmentStart) nextNode = locateClosingAnchor(node);
|
|
3744
3808
|
else if (isComment(node) && node.data === "teleport start") nextNode = locateClosingAnchor(node, node.data, "teleport end");
|
|
3745
3809
|
else nextNode = nextSibling(node);
|
|
3746
|
-
if (vnode.type.__vapor)
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
}
|
|
3754
|
-
|
|
3755
|
-
|
|
3810
|
+
if (vnode.type.__vapor) {
|
|
3811
|
+
const vnodeBeforeMountHook = !isAsyncWrapper(vnode) && vnode.props && vnode.props.onVnodeBeforeMount;
|
|
3812
|
+
getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense, () => {
|
|
3813
|
+
if (vnode.dirs) {
|
|
3814
|
+
invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
3815
|
+
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
3816
|
+
}
|
|
3817
|
+
}, () => {
|
|
3818
|
+
if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, vnode);
|
|
3819
|
+
});
|
|
3820
|
+
if (vnode.dirs) queueEffectWithSuspense(() => invokeDirectiveHook(vnode, null, parentComponent, "mounted"), void 0, parentSuspense);
|
|
3821
|
+
const vnodeMountedHook = !isAsyncWrapper(vnode) && vnode.props && vnode.props.onVnodeMounted;
|
|
3822
|
+
if (vnodeMountedHook) queueEffectWithSuspense(() => invokeVNodeHook(vnodeMountedHook, parentComponent, vnode), void 0, parentSuspense);
|
|
3823
|
+
} else {
|
|
3824
|
+
mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
|
|
3825
|
+
const component = vnode.component;
|
|
3826
|
+
if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved || component.asyncDep && !component.asyncResolved) {
|
|
3827
|
+
let subTree;
|
|
3828
|
+
if (isFragmentStart) {
|
|
3829
|
+
subTree = createVNode(Fragment);
|
|
3830
|
+
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
3831
|
+
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
3832
|
+
subTree.el = node;
|
|
3833
|
+
component.subTree = subTree;
|
|
3834
|
+
}
|
|
3756
3835
|
}
|
|
3757
3836
|
} else if (shapeFlag & 64) if (domType !== 8) nextNode = onMismatch();
|
|
3758
3837
|
else nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
|
|
@@ -3764,7 +3843,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3764
3843
|
};
|
|
3765
3844
|
const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
3766
3845
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
3767
|
-
const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
3846
|
+
const { type, dynamicProps, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
3768
3847
|
const forcePatch = type === "input" || type === "option";
|
|
3769
3848
|
{
|
|
3770
3849
|
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
@@ -3782,15 +3861,11 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3782
3861
|
}
|
|
3783
3862
|
if (shapeFlag & 16 && !(props && (props.innerHTML || props.textContent))) {
|
|
3784
3863
|
let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
3785
|
-
|
|
3864
|
+
if (next && !isMismatchAllowed(el, 1)) {
|
|
3865
|
+
warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
|
|
3866
|
+
logMismatchError();
|
|
3867
|
+
}
|
|
3786
3868
|
while (next) {
|
|
3787
|
-
if (!isMismatchAllowed(el, 1)) {
|
|
3788
|
-
if (!hasWarned) {
|
|
3789
|
-
warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
|
|
3790
|
-
hasWarned = true;
|
|
3791
|
-
}
|
|
3792
|
-
logMismatchError();
|
|
3793
|
-
}
|
|
3794
3869
|
const cur = next;
|
|
3795
3870
|
next = next.nextSibling;
|
|
3796
3871
|
remove(cur);
|
|
@@ -3809,9 +3884,10 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3809
3884
|
}
|
|
3810
3885
|
if (props) {
|
|
3811
3886
|
const isCustomElement = el.tagName.includes("-");
|
|
3887
|
+
const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
|
|
3812
3888
|
for (const key in props) {
|
|
3813
3889
|
if (!(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) logMismatchError();
|
|
3814
|
-
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key)) patchProp(el, key, null, props[key],
|
|
3890
|
+
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) patchProp(el, key, null, props[key], namespace, parentComponent);
|
|
3815
3891
|
}
|
|
3816
3892
|
}
|
|
3817
3893
|
let vnodeHooks;
|
|
@@ -3829,7 +3905,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3829
3905
|
optimized = optimized || !!parentVNode.dynamicChildren;
|
|
3830
3906
|
const children = parentVNode.children;
|
|
3831
3907
|
const l = children.length;
|
|
3832
|
-
let
|
|
3908
|
+
let hasCheckedMismatch = false;
|
|
3833
3909
|
for (let i = 0; i < l; i++) {
|
|
3834
3910
|
const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
|
|
3835
3911
|
const isText = vnode.type === Text;
|
|
@@ -3843,12 +3919,12 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3843
3919
|
node = hydrateNode(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
3844
3920
|
} else if (isText && !vnode.children) insert(vnode.el = createText(""), container);
|
|
3845
3921
|
else {
|
|
3846
|
-
if (!
|
|
3847
|
-
|
|
3922
|
+
if (!hasCheckedMismatch) {
|
|
3923
|
+
hasCheckedMismatch = true;
|
|
3924
|
+
if (!isMismatchAllowed(container, 1)) {
|
|
3848
3925
|
warn$1(`Hydration children mismatch on`, container, `\nServer rendered element contains fewer child nodes than client vdom.`);
|
|
3849
|
-
|
|
3926
|
+
logMismatchError();
|
|
3850
3927
|
}
|
|
3851
|
-
logMismatchError();
|
|
3852
3928
|
}
|
|
3853
3929
|
patch(null, vnode, container, null, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
|
|
3854
3930
|
}
|
|
@@ -3868,7 +3944,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3868
3944
|
}
|
|
3869
3945
|
};
|
|
3870
3946
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
3871
|
-
if (!
|
|
3947
|
+
if (!isNodeMismatchAllowed(node, vnode)) {
|
|
3872
3948
|
warn$1(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``, `\n- expected on client:`, vnode.type);
|
|
3873
3949
|
logMismatchError();
|
|
3874
3950
|
}
|
|
@@ -4032,7 +4108,9 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4032
4108
|
};
|
|
4033
4109
|
function isMismatchAllowed(el, allowedType) {
|
|
4034
4110
|
if (allowedType === 0 || allowedType === 1) while (el && !el.hasAttribute(allowMismatchAttr)) el = el.parentElement;
|
|
4035
|
-
|
|
4111
|
+
return isMismatchAllowedByAttr(el && el.getAttribute(allowMismatchAttr), allowedType);
|
|
4112
|
+
}
|
|
4113
|
+
function isMismatchAllowedByAttr(allowedAttr, allowedType) {
|
|
4036
4114
|
if (allowedAttr == null) return false;
|
|
4037
4115
|
else if (allowedAttr === "") return true;
|
|
4038
4116
|
else {
|
|
@@ -4041,6 +4119,16 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4041
4119
|
return list.includes(MismatchTypeString[allowedType]);
|
|
4042
4120
|
}
|
|
4043
4121
|
}
|
|
4122
|
+
function isNodeMismatchAllowed(node, vnode) {
|
|
4123
|
+
return isMismatchAllowed(node.parentElement, 1) || isMismatchAllowedByNode(node) || isMismatchAllowedByVNode(vnode);
|
|
4124
|
+
}
|
|
4125
|
+
function isMismatchAllowedByNode(node) {
|
|
4126
|
+
return node.nodeType === 1 && isMismatchAllowedByAttr(node.getAttribute(allowMismatchAttr), 1);
|
|
4127
|
+
}
|
|
4128
|
+
function isMismatchAllowedByVNode({ props }) {
|
|
4129
|
+
const allowedAttr = props && props[allowMismatchAttr];
|
|
4130
|
+
return typeof allowedAttr === "string" && isMismatchAllowedByAttr(allowedAttr, 1);
|
|
4131
|
+
}
|
|
4044
4132
|
//#endregion
|
|
4045
4133
|
//#region packages/runtime-core/src/hydrationStrategies.ts
|
|
4046
4134
|
let requestIdleCallback;
|
|
@@ -4159,11 +4247,16 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4159
4247
|
onError(err);
|
|
4160
4248
|
return () => errorComponent ? createVNode(errorComponent, { error: err }) : null;
|
|
4161
4249
|
});
|
|
4162
|
-
const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError);
|
|
4250
|
+
const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError, instance);
|
|
4163
4251
|
load().then(() => {
|
|
4252
|
+
if (instance.isUnmounted) return;
|
|
4164
4253
|
loaded.value = true;
|
|
4165
4254
|
if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) instance.parent.update();
|
|
4166
4255
|
}).catch((err) => {
|
|
4256
|
+
if (instance.isUnmounted) {
|
|
4257
|
+
setPendingRequest(null);
|
|
4258
|
+
return;
|
|
4259
|
+
}
|
|
4167
4260
|
onError(err);
|
|
4168
4261
|
error.value = err;
|
|
4169
4262
|
});
|
|
@@ -4221,14 +4314,22 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4221
4314
|
setPendingRequest: (request) => pendingRequest = request
|
|
4222
4315
|
};
|
|
4223
4316
|
}
|
|
4224
|
-
const useAsyncComponentState = (delay, timeout, onError) => {
|
|
4317
|
+
const useAsyncComponentState = (delay, timeout, onError, instance = currentInstance) => {
|
|
4225
4318
|
const loaded = /* @__PURE__ */ ref(false);
|
|
4226
4319
|
const error = /* @__PURE__ */ ref();
|
|
4227
4320
|
const delayed = /* @__PURE__ */ ref(!!delay);
|
|
4228
|
-
|
|
4321
|
+
let timeoutTimer;
|
|
4322
|
+
let delayTimer;
|
|
4323
|
+
if (instance) onUnmounted(() => {
|
|
4324
|
+
if (timeoutTimer != null) clearTimeout(timeoutTimer);
|
|
4325
|
+
if (delayTimer != null) clearTimeout(delayTimer);
|
|
4326
|
+
}, instance);
|
|
4327
|
+
if (delay) delayTimer = setTimeout(() => {
|
|
4328
|
+
if (instance && instance.isUnmounted) return;
|
|
4229
4329
|
delayed.value = false;
|
|
4230
4330
|
}, delay);
|
|
4231
|
-
if (timeout != null) setTimeout(() => {
|
|
4331
|
+
if (timeout != null) timeoutTimer = setTimeout(() => {
|
|
4332
|
+
if (instance && instance.isUnmounted) return;
|
|
4232
4333
|
if (!loaded.value && !error.value) {
|
|
4233
4334
|
const err = /* @__PURE__ */ new Error(`Async component timed out after ${timeout}ms.`);
|
|
4234
4335
|
onError(err);
|
|
@@ -4246,6 +4347,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4246
4347
|
* @internal
|
|
4247
4348
|
*/
|
|
4248
4349
|
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
|
|
4350
|
+
const wasConnected = el.isConnected;
|
|
4249
4351
|
let patched = false;
|
|
4250
4352
|
(instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
4251
4353
|
const performHydrate = () => {
|
|
@@ -4256,6 +4358,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4256
4358
|
}
|
|
4257
4359
|
return;
|
|
4258
4360
|
}
|
|
4361
|
+
if (!el.parentNode || wasConnected && !el.isConnected) return;
|
|
4259
4362
|
hydrate();
|
|
4260
4363
|
};
|
|
4261
4364
|
const doHydrate = hydrateStrategy ? () => {
|
|
@@ -4621,8 +4724,9 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4621
4724
|
* Compiler runtime helper for rendering `<slot/>`
|
|
4622
4725
|
* @private
|
|
4623
4726
|
*/
|
|
4624
|
-
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
4727
|
+
function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
|
|
4625
4728
|
let slot = slots[name];
|
|
4729
|
+
if (fallback) fallback.__vdom = true;
|
|
4626
4730
|
const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
|
|
4627
4731
|
if (vaporSlot) {
|
|
4628
4732
|
const ret = (openBlock(), createBlock(VaporSlot, props));
|
|
@@ -4630,25 +4734,35 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4630
4734
|
slot: vaporSlot,
|
|
4631
4735
|
fallback
|
|
4632
4736
|
};
|
|
4737
|
+
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
4633
4738
|
return ret;
|
|
4634
4739
|
}
|
|
4635
4740
|
if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
|
|
4636
|
-
const
|
|
4637
|
-
|
|
4638
|
-
|
|
4741
|
+
const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
|
|
4742
|
+
const hasProps = Object.keys(slotProps).length > 0;
|
|
4743
|
+
if (name !== "default") slotProps.name = name;
|
|
4744
|
+
return openBlock(), createBlock(Fragment, null, [createVNode("slot", slotProps, fallback && fallback())], hasProps ? -2 : 64);
|
|
4639
4745
|
}
|
|
4640
4746
|
if (slot && slot.length > 1) {
|
|
4641
4747
|
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.");
|
|
4642
4748
|
slot = () => [];
|
|
4643
4749
|
}
|
|
4644
4750
|
if (slot && slot._c) slot._d = false;
|
|
4751
|
+
const prevStackSize = blockStack.length;
|
|
4645
4752
|
openBlock();
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4753
|
+
let rendered;
|
|
4754
|
+
try {
|
|
4755
|
+
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
4756
|
+
ensureVaporSlotFallback(validSlotContent, fallback);
|
|
4757
|
+
const slotKey = props.key || branchKey || validSlotContent && validSlotContent.key;
|
|
4758
|
+
rendered = createBlock(Fragment, { key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
|
|
4759
|
+
} catch (err) {
|
|
4760
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
4761
|
+
throw err;
|
|
4762
|
+
} finally {
|
|
4763
|
+
if (slot && slot._c) slot._d = true;
|
|
4764
|
+
}
|
|
4650
4765
|
if (!noSlotted && rendered.scopeId) rendered.slotScopeIds = [rendered.scopeId + "-s"];
|
|
4651
|
-
if (slot && slot._c) slot._d = true;
|
|
4652
4766
|
return rendered;
|
|
4653
4767
|
}
|
|
4654
4768
|
function ensureValidVNode(vnodes) {
|
|
@@ -4661,9 +4775,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4661
4775
|
}
|
|
4662
4776
|
function ensureVaporSlotFallback(vnodes, fallback) {
|
|
4663
4777
|
let vaporSlot;
|
|
4664
|
-
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs))
|
|
4665
|
-
if (!vaporSlot.fallback && fallback) vaporSlot.fallback = fallback;
|
|
4666
|
-
}
|
|
4778
|
+
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) vaporSlot.outletFallback = fallback;
|
|
4667
4779
|
}
|
|
4668
4780
|
//#endregion
|
|
4669
4781
|
//#region packages/runtime-core/src/helpers/toHandlers.ts
|
|
@@ -5029,26 +5141,39 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
5029
5141
|
function withAsyncContext(getAwaitable) {
|
|
5030
5142
|
const ctx = getCurrentGenericInstance();
|
|
5031
5143
|
const inSSRSetup = isInSSRComponentSetup;
|
|
5144
|
+
const restoreAsyncContext = ctx && ctx.restoreAsyncContext ? ctx.restoreAsyncContext.bind(ctx) : void 0;
|
|
5032
5145
|
if (!ctx) warn$1("withAsyncContext called without active current instance. This is likely a bug.");
|
|
5033
5146
|
let awaitable = getAwaitable();
|
|
5034
5147
|
setCurrentInstance(null, void 0);
|
|
5035
5148
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
5036
5149
|
const restore = () => {
|
|
5150
|
+
const resetStoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
|
|
5037
5151
|
setCurrentInstance(ctx);
|
|
5038
5152
|
if (inSSRSetup) setInSSRSetupState(true);
|
|
5153
|
+
const reset = restoreAsyncContext && restoreAsyncContext();
|
|
5154
|
+
return () => {
|
|
5155
|
+
if (reset) reset();
|
|
5156
|
+
if (resetStoppedScope) resetStoppedScope.reset();
|
|
5157
|
+
};
|
|
5039
5158
|
};
|
|
5040
5159
|
const cleanup = () => {
|
|
5041
5160
|
setCurrentInstance(null, void 0);
|
|
5042
5161
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
5043
5162
|
};
|
|
5044
5163
|
if (isPromise(awaitable)) awaitable = awaitable.catch((e) => {
|
|
5045
|
-
restore();
|
|
5046
|
-
Promise.resolve().then(() => Promise.resolve().then(
|
|
5164
|
+
const reset = restore();
|
|
5165
|
+
Promise.resolve().then(() => Promise.resolve().then(() => {
|
|
5166
|
+
if (reset) reset();
|
|
5167
|
+
cleanup();
|
|
5168
|
+
}));
|
|
5047
5169
|
throw e;
|
|
5048
5170
|
});
|
|
5049
5171
|
return [awaitable, () => {
|
|
5050
|
-
restore();
|
|
5051
|
-
Promise.resolve().then(
|
|
5172
|
+
const reset = restore();
|
|
5173
|
+
Promise.resolve().then(() => {
|
|
5174
|
+
if (reset) reset();
|
|
5175
|
+
cleanup();
|
|
5176
|
+
});
|
|
5052
5177
|
}];
|
|
5053
5178
|
}
|
|
5054
5179
|
//#endregion
|
|
@@ -5472,12 +5597,13 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
5472
5597
|
for (const key of rawPropKeys) if (key === name || key === camelizedName || key === hyphenatedName) parentPassedModelValue = true;
|
|
5473
5598
|
else if (key === `onUpdate:${name}` || key === `onUpdate:${camelizedName}` || key === `onUpdate:${hyphenatedName}`) parentPassedModelUpdater = true;
|
|
5474
5599
|
}
|
|
5475
|
-
|
|
5600
|
+
const hasVModel = parentPassedModelValue && parentPassedModelUpdater;
|
|
5601
|
+
if (!hasVModel) {
|
|
5476
5602
|
localValue = value;
|
|
5477
5603
|
trigger();
|
|
5478
5604
|
}
|
|
5479
5605
|
i.emit(`update:${name}`, emittedValue);
|
|
5480
|
-
if (hasChanged(value,
|
|
5606
|
+
if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) trigger();
|
|
5481
5607
|
prevSetValue = value;
|
|
5482
5608
|
prevEmittedValue = emittedValue;
|
|
5483
5609
|
}
|
|
@@ -5584,7 +5710,8 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
5584
5710
|
*/
|
|
5585
5711
|
function isEmitListener(options, key) {
|
|
5586
5712
|
if (!options || !isOn(key)) return false;
|
|
5587
|
-
key = key.slice(2)
|
|
5713
|
+
key = key.slice(2);
|
|
5714
|
+
key = key === "Once" ? key : key.replace(/Once$/, "");
|
|
5588
5715
|
return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
|
|
5589
5716
|
}
|
|
5590
5717
|
//#endregion
|
|
@@ -6059,7 +6186,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
6059
6186
|
const receivedType = toRawType(value);
|
|
6060
6187
|
const expectedValue = styleValue(value, expectedType);
|
|
6061
6188
|
const receivedValue = styleValue(value, receivedType);
|
|
6062
|
-
if (expectedTypes.length === 1 && isExplicable(expectedType) &&
|
|
6189
|
+
if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) message += ` with value ${expectedValue}`;
|
|
6063
6190
|
message += `, got ${receivedType} `;
|
|
6064
6191
|
if (isExplicable(receivedType)) message += `with value ${receivedValue}.`;
|
|
6065
6192
|
return message;
|
|
@@ -6068,7 +6195,8 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
6068
6195
|
* dev only
|
|
6069
6196
|
*/
|
|
6070
6197
|
function styleValue(value, type) {
|
|
6071
|
-
if (
|
|
6198
|
+
if (isSymbol(value)) return value.toString();
|
|
6199
|
+
else if (type === "String") return `"${value}"`;
|
|
6072
6200
|
else if (type === "Number") return `${Number(value)}`;
|
|
6073
6201
|
else return `${value}`;
|
|
6074
6202
|
}
|
|
@@ -6085,8 +6213,11 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
6085
6213
|
/**
|
|
6086
6214
|
* dev only
|
|
6087
6215
|
*/
|
|
6088
|
-
function
|
|
6089
|
-
return args.
|
|
6216
|
+
function isCoercible(...args) {
|
|
6217
|
+
return args.every((elem) => {
|
|
6218
|
+
const value = elem.toLowerCase();
|
|
6219
|
+
return value !== "boolean" && value !== "symbol";
|
|
6220
|
+
});
|
|
6090
6221
|
}
|
|
6091
6222
|
//#endregion
|
|
6092
6223
|
//#region packages/runtime-core/src/componentSlots.ts
|
|
@@ -6391,7 +6522,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
6391
6522
|
if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
6392
6523
|
if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
6393
6524
|
parentComponent && toggleRecurse(parentComponent, true);
|
|
6394
|
-
if (isHmrUpdating) {
|
|
6525
|
+
if (isHmrUpdating || dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
|
|
6395
6526
|
patchFlag = 0;
|
|
6396
6527
|
optimized = false;
|
|
6397
6528
|
dynamicChildren = null;
|
|
@@ -6471,19 +6602,35 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
6471
6602
|
n2.slotScopeIds = slotScopeIds;
|
|
6472
6603
|
if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent);
|
|
6473
6604
|
else {
|
|
6605
|
+
const vnodeBeforeMountHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeBeforeMount;
|
|
6474
6606
|
getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense, () => {
|
|
6475
6607
|
if (n2.dirs) {
|
|
6476
6608
|
invokeDirectiveHook(n2, null, parentComponent, "created");
|
|
6477
6609
|
invokeDirectiveHook(n2, null, parentComponent, "beforeMount");
|
|
6478
6610
|
}
|
|
6611
|
+
}, () => {
|
|
6612
|
+
if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, n2);
|
|
6479
6613
|
});
|
|
6480
6614
|
if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, null, parentComponent, "mounted"), void 0, parentSuspense);
|
|
6615
|
+
const vnodeMountedHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeMounted;
|
|
6616
|
+
if (vnodeMountedHook) {
|
|
6617
|
+
const scopedVNode = n2;
|
|
6618
|
+
queuePostRenderEffect(() => invokeVNodeHook(vnodeMountedHook, parentComponent, scopedVNode), void 0, parentSuspense);
|
|
6619
|
+
}
|
|
6481
6620
|
}
|
|
6482
6621
|
else {
|
|
6483
|
-
|
|
6622
|
+
const shouldUpdate = shouldUpdateComponent(n1, n2, optimized);
|
|
6623
|
+
getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdate, () => {
|
|
6484
6624
|
if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
6625
|
+
}, () => {
|
|
6626
|
+
const vnodeBeforeUpdateHook = n2.props && n2.props.onVnodeBeforeUpdate;
|
|
6627
|
+
if (vnodeBeforeUpdateHook) invokeVNodeHook(vnodeBeforeUpdateHook, parentComponent, n2, n1);
|
|
6485
6628
|
});
|
|
6486
|
-
|
|
6629
|
+
const vnodeUpdatedHook = n2.props && n2.props.onVnodeUpdated;
|
|
6630
|
+
if (shouldUpdate && (vnodeUpdatedHook || n2.dirs)) queuePostRenderEffect(() => {
|
|
6631
|
+
n2.dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
6632
|
+
vnodeUpdatedHook && invokeVNodeHook(vnodeUpdatedHook, parentComponent, n2, n1);
|
|
6633
|
+
}, void 0, parentSuspense);
|
|
6487
6634
|
}
|
|
6488
6635
|
else if (n1 == null) if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
6489
6636
|
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
@@ -6829,8 +6976,10 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
6829
6976
|
else hostInsert(el, container, anchor);
|
|
6830
6977
|
};
|
|
6831
6978
|
const performLeave = () => {
|
|
6979
|
+
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
6832
6980
|
if (el._isLeaving) el[leaveCbKey](true);
|
|
6833
|
-
|
|
6981
|
+
if (transition.persisted && !wasLeaving) remove();
|
|
6982
|
+
else leave(el, () => {
|
|
6834
6983
|
remove();
|
|
6835
6984
|
afterLeave && afterLeave();
|
|
6836
6985
|
});
|
|
@@ -6861,7 +7010,10 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
6861
7010
|
if (shapeFlag & 6) if (isVaporComponent(type)) {
|
|
6862
7011
|
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
|
|
6863
7012
|
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
6864
|
-
if (
|
|
7013
|
+
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || dirs) queuePostRenderEffect(() => {
|
|
7014
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
7015
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
7016
|
+
}, void 0, parentSuspense);
|
|
6865
7017
|
return;
|
|
6866
7018
|
} else unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
6867
7019
|
else {
|
|
@@ -6922,7 +7074,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
6922
7074
|
if (effect) {
|
|
6923
7075
|
effect.stop();
|
|
6924
7076
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
6925
|
-
}
|
|
7077
|
+
} else if (doRemove && subTree && instance.vnode.el) remove(subTree);
|
|
6926
7078
|
if (um) queuePostRenderEffect(um, void 0, parentSuspense);
|
|
6927
7079
|
queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
|
|
6928
7080
|
devtoolsComponentRemoved(instance);
|
|
@@ -7048,6 +7200,10 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7048
7200
|
if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
|
|
7049
7201
|
}
|
|
7050
7202
|
function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
|
|
7203
|
+
if (force && transition.persisted && !el[leaveCbKey]) {
|
|
7204
|
+
insert();
|
|
7205
|
+
return;
|
|
7206
|
+
}
|
|
7051
7207
|
if (force || needTransition(parentSuspense, transition)) {
|
|
7052
7208
|
transition.beforeEnter(el);
|
|
7053
7209
|
insert();
|
|
@@ -7250,15 +7406,19 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7250
7406
|
if (suspense.isHydrating) suspense.isHydrating = false;
|
|
7251
7407
|
else if (!resume) {
|
|
7252
7408
|
delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
|
|
7409
|
+
let hasUpdatedAnchor = false;
|
|
7253
7410
|
if (delayEnter) activeBranch.transition.afterLeave = () => {
|
|
7254
7411
|
if (pendingId === suspense.pendingId) {
|
|
7255
|
-
move(pendingBranch, container, anchor === initialAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
7412
|
+
move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
7256
7413
|
queuePostFlushCb(effects);
|
|
7257
7414
|
if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
|
|
7258
7415
|
}
|
|
7259
7416
|
};
|
|
7260
7417
|
if (activeBranch && !suspense.isFallbackMountPending) {
|
|
7261
|
-
if (parentNode(activeBranch.el) === container)
|
|
7418
|
+
if (parentNode(activeBranch.el) === container) {
|
|
7419
|
+
anchor = next(activeBranch);
|
|
7420
|
+
hasUpdatedAnchor = true;
|
|
7421
|
+
}
|
|
7262
7422
|
unmount(activeBranch, parentComponent, suspense, true);
|
|
7263
7423
|
if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
|
|
7264
7424
|
}
|
|
@@ -7322,6 +7482,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7322
7482
|
handleError(err, instance, 0);
|
|
7323
7483
|
}).then((asyncSetupResult) => {
|
|
7324
7484
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
7485
|
+
setCurrentInstance(null, void 0);
|
|
7325
7486
|
instance.asyncResolved = true;
|
|
7326
7487
|
onResolve(asyncSetupResult);
|
|
7327
7488
|
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
@@ -7611,11 +7772,29 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7611
7772
|
el: vnode.el,
|
|
7612
7773
|
anchor: vnode.anchor,
|
|
7613
7774
|
ctx: vnode.ctx,
|
|
7614
|
-
ce: vnode.ce
|
|
7775
|
+
ce: vnode.ce,
|
|
7776
|
+
vi: vnode.vi,
|
|
7777
|
+
vs: cloneVaporSlotMeta(vnode),
|
|
7778
|
+
vb: vnode.vb
|
|
7615
7779
|
};
|
|
7616
7780
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
7617
7781
|
return cloned;
|
|
7618
7782
|
}
|
|
7783
|
+
function cloneVaporSlotMeta(vnode) {
|
|
7784
|
+
const vaporSlot = vnode.vs;
|
|
7785
|
+
if (!vaporSlot) return vaporSlot;
|
|
7786
|
+
const cloned = {
|
|
7787
|
+
slot: vaporSlot.slot,
|
|
7788
|
+
fallback: vaporSlot.fallback,
|
|
7789
|
+
outletFallback: vaporSlot.outletFallback
|
|
7790
|
+
};
|
|
7791
|
+
if (vnode.el) {
|
|
7792
|
+
cloned.state = vaporSlot.state;
|
|
7793
|
+
cloned.ref = vaporSlot.ref;
|
|
7794
|
+
cloned.scope = vaporSlot.scope;
|
|
7795
|
+
}
|
|
7796
|
+
return cloned;
|
|
7797
|
+
}
|
|
7619
7798
|
/**
|
|
7620
7799
|
* Dev only, for HMR of hoisted vnodes reused in v-for
|
|
7621
7800
|
* https://github.com/vitejs/vite/issues/2022
|
|
@@ -7678,6 +7857,10 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7678
7857
|
}
|
|
7679
7858
|
}
|
|
7680
7859
|
else if (isFunction(children)) {
|
|
7860
|
+
if (shapeFlag & 65) {
|
|
7861
|
+
normalizeChildren(vnode, { default: children });
|
|
7862
|
+
return;
|
|
7863
|
+
}
|
|
7681
7864
|
children = {
|
|
7682
7865
|
default: children,
|
|
7683
7866
|
_ctx: currentRenderingInstance
|
|
@@ -8271,7 +8454,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
8271
8454
|
}
|
|
8272
8455
|
//#endregion
|
|
8273
8456
|
//#region packages/runtime-core/src/index.ts
|
|
8274
|
-
const version = "3.6.0-
|
|
8457
|
+
const version = "3.6.0-rc.1";
|
|
8275
8458
|
const warn = warn$1;
|
|
8276
8459
|
/**
|
|
8277
8460
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -8734,7 +8917,10 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
8734
8917
|
}
|
|
8735
8918
|
for (const key in next) {
|
|
8736
8919
|
if (key === "display") hasControlledDisplay = true;
|
|
8737
|
-
|
|
8920
|
+
const value = next[key];
|
|
8921
|
+
if (value != null) {
|
|
8922
|
+
if (!shouldPreserveTextareaResizeStyle(el, key, !isString(prev) && prev ? prev[key] : void 0, value)) setStyle(style, key, value);
|
|
8923
|
+
} else setStyle(style, key, "");
|
|
8738
8924
|
}
|
|
8739
8925
|
} else if (isCssString) {
|
|
8740
8926
|
if (prev !== next) {
|
|
@@ -8782,6 +8968,14 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
8782
8968
|
}
|
|
8783
8969
|
return rawName;
|
|
8784
8970
|
}
|
|
8971
|
+
/**
|
|
8972
|
+
* Browsers update textarea width/height directly during native resize.
|
|
8973
|
+
* Only special-case this common textarea path for now; other resize scenarios
|
|
8974
|
+
* still follow normal vnode style patching.
|
|
8975
|
+
*/
|
|
8976
|
+
function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
|
|
8977
|
+
return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
|
|
8978
|
+
}
|
|
8785
8979
|
//#endregion
|
|
8786
8980
|
//#region packages/runtime-dom/src/modules/attrs.ts
|
|
8787
8981
|
const xlinkNS = "http://www.w3.org/1999/xlink";
|
|
@@ -8840,7 +9034,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
8840
9034
|
const existingInvoker = invokers[rawName];
|
|
8841
9035
|
if (nextValue && existingInvoker) existingInvoker.value = sanitizeEventValue(nextValue, rawName);
|
|
8842
9036
|
else {
|
|
8843
|
-
const [name, options] =
|
|
9037
|
+
const [name, options] = parseEventName(rawName);
|
|
8844
9038
|
if (nextValue) addEventListener(el, name, invokers[rawName] = createInvoker(sanitizeEventValue(nextValue, rawName), instance), options);
|
|
8845
9039
|
else if (existingInvoker) {
|
|
8846
9040
|
removeEventListener(el, name, existingInvoker, options);
|
|
@@ -8848,16 +9042,15 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
8848
9042
|
}
|
|
8849
9043
|
}
|
|
8850
9044
|
}
|
|
8851
|
-
const optionsModifierRE = /(
|
|
8852
|
-
|
|
9045
|
+
const optionsModifierRE = /(Once|Passive|Capture)$/;
|
|
9046
|
+
const optionsModifierEventRE = /^on:?(?:Once|Passive|Capture)$/;
|
|
9047
|
+
function parseEventName(name) {
|
|
8853
9048
|
let options;
|
|
8854
|
-
|
|
8855
|
-
|
|
8856
|
-
|
|
8857
|
-
|
|
8858
|
-
|
|
8859
|
-
options[m[0].toLowerCase()] = true;
|
|
8860
|
-
}
|
|
9049
|
+
let m;
|
|
9050
|
+
while ((m = name.match(optionsModifierRE)) && !optionsModifierEventRE.test(name)) {
|
|
9051
|
+
if (!options) options = {};
|
|
9052
|
+
name = name.slice(0, name.length - m[1].length);
|
|
9053
|
+
options[m[1].toLowerCase()] = true;
|
|
8861
9054
|
}
|
|
8862
9055
|
return [name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2)), options];
|
|
8863
9056
|
}
|
|
@@ -8868,7 +9061,21 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
8868
9061
|
const invoker = (e) => {
|
|
8869
9062
|
if (!e._vts) e._vts = Date.now();
|
|
8870
9063
|
else if (e._vts <= invoker.attached) return;
|
|
8871
|
-
|
|
9064
|
+
const value = invoker.value;
|
|
9065
|
+
if (isArray(value)) {
|
|
9066
|
+
const originalStop = e.stopImmediatePropagation;
|
|
9067
|
+
e.stopImmediatePropagation = () => {
|
|
9068
|
+
originalStop.call(e);
|
|
9069
|
+
e._stopped = true;
|
|
9070
|
+
};
|
|
9071
|
+
const handlers = value.slice();
|
|
9072
|
+
const args = [e];
|
|
9073
|
+
for (let i = 0; i < handlers.length; i++) {
|
|
9074
|
+
if (e._stopped) break;
|
|
9075
|
+
const handler = handlers[i];
|
|
9076
|
+
if (handler) callWithAsyncErrorHandling(handler, instance, 5, args);
|
|
9077
|
+
}
|
|
9078
|
+
} else callWithAsyncErrorHandling(value, instance, 5, [e]);
|
|
8872
9079
|
};
|
|
8873
9080
|
invoker.value = initialValue;
|
|
8874
9081
|
invoker.attached = getNow();
|
|
@@ -8879,16 +9086,6 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
8879
9086
|
warn(`Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?\nExpected function or array of functions, received type ${typeof value}.`);
|
|
8880
9087
|
return NOOP;
|
|
8881
9088
|
}
|
|
8882
|
-
function patchStopImmediatePropagation(e, value) {
|
|
8883
|
-
if (isArray(value)) {
|
|
8884
|
-
const originalStop = e.stopImmediatePropagation;
|
|
8885
|
-
e.stopImmediatePropagation = () => {
|
|
8886
|
-
originalStop.call(e);
|
|
8887
|
-
e._stopped = true;
|
|
8888
|
-
};
|
|
8889
|
-
return value.map((fn) => (e) => !e._stopped && fn && fn(e));
|
|
8890
|
-
} else return value;
|
|
8891
|
-
}
|
|
8892
9089
|
//#endregion
|
|
8893
9090
|
//#region packages/runtime-dom/src/patchProp.ts
|
|
8894
9091
|
const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
|
|
@@ -9216,7 +9413,10 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
9216
9413
|
replacementNodes.push(child);
|
|
9217
9414
|
}
|
|
9218
9415
|
parent.removeChild(o);
|
|
9219
|
-
slotReplacements.set(o,
|
|
9416
|
+
slotReplacements.set(o, {
|
|
9417
|
+
nodes: replacementNodes,
|
|
9418
|
+
usedFallback: !content
|
|
9419
|
+
});
|
|
9220
9420
|
}
|
|
9221
9421
|
this._updateSlotNodes(slotReplacements);
|
|
9222
9422
|
}
|
|
@@ -9388,7 +9588,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
9388
9588
|
prevChildren = [];
|
|
9389
9589
|
if (children) for (let i = 0; i < children.length; i++) {
|
|
9390
9590
|
const child = children[i];
|
|
9391
|
-
if (child.el && child.el instanceof Element) {
|
|
9591
|
+
if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
|
|
9392
9592
|
prevChildren.push(child);
|
|
9393
9593
|
setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
|
|
9394
9594
|
positionMap.set(child, getPosition(child.el));
|
|
@@ -9612,7 +9812,8 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
9612
9812
|
mounted(el, { value }) {
|
|
9613
9813
|
vModelSetSelected(el, value);
|
|
9614
9814
|
},
|
|
9615
|
-
beforeUpdate(el,
|
|
9815
|
+
beforeUpdate(el, { value }, vnode) {
|
|
9816
|
+
el._modelValue = value;
|
|
9616
9817
|
el[assignKey] = getModelAssigner(vnode);
|
|
9617
9818
|
},
|
|
9618
9819
|
updated(el, { value }) {
|
|
@@ -9623,10 +9824,10 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
9623
9824
|
* @internal
|
|
9624
9825
|
*/
|
|
9625
9826
|
const vModelSelectInit = (el, value, number, set) => {
|
|
9626
|
-
|
|
9827
|
+
el._modelValue = value;
|
|
9627
9828
|
addEventListener(el, "change", () => {
|
|
9628
9829
|
const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map((o) => number ? looseToNumber(getValue(o)) : getValue(o));
|
|
9629
|
-
(set || el[assignKey])(el.multiple ?
|
|
9830
|
+
(set || el[assignKey])(el.multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0]);
|
|
9630
9831
|
el._assigning = true;
|
|
9631
9832
|
nextTick(() => {
|
|
9632
9833
|
el._assigning = false;
|
|
@@ -9637,6 +9838,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
9637
9838
|
* @internal
|
|
9638
9839
|
*/
|
|
9639
9840
|
const vModelSetSelected = (el, value) => {
|
|
9841
|
+
el._modelValue = value;
|
|
9640
9842
|
if (el._assigning) return;
|
|
9641
9843
|
const isMultiple = el.multiple;
|
|
9642
9844
|
const isArrayValue = isArray(value);
|