@vue/runtime-dom 3.6.0-rc.1 → 3.6.0-rc.3
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 +26 -13
- package/dist/runtime-dom.cjs.prod.js +15 -5
- package/dist/runtime-dom.d.ts +2 -0
- package/dist/runtime-dom.esm-browser.js +193 -80
- package/dist/runtime-dom.esm-browser.prod.js +4 -3
- package/dist/runtime-dom.esm-bundler.js +26 -13
- package/dist/runtime-dom.global.js +193 -80
- package/dist/runtime-dom.global.prod.js +4 -3
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.6.0-rc.
|
|
2
|
+
* @vue/runtime-dom v3.6.0-rc.3
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -711,7 +711,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
711
711
|
if (!this._instance) if (this._resolved) this._mountComponent(this._def);
|
|
712
712
|
else if (parent && parent._pendingResolve) this._pendingResolve = parent._pendingResolve.then(() => {
|
|
713
713
|
this._pendingResolve = void 0;
|
|
714
|
-
this._resolveDef();
|
|
714
|
+
if (this.isConnected) return this._resolveDef();
|
|
715
715
|
});
|
|
716
716
|
else this._resolveDef();
|
|
717
717
|
}
|
|
@@ -747,7 +747,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
747
747
|
* resolve inner component definition (handle possible async component)
|
|
748
748
|
*/
|
|
749
749
|
_resolveDef() {
|
|
750
|
-
if (this._pendingResolve) return;
|
|
750
|
+
if (this._pendingResolve) return this._pendingResolve;
|
|
751
751
|
for (let i = 0; i < this.attributes.length; i++) this._setAttr(this.attributes[i].name);
|
|
752
752
|
this._ob = new MutationObserver(this._processMutations.bind(this));
|
|
753
753
|
this._ob.observe(this, { attributes: true });
|
|
@@ -777,6 +777,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
777
777
|
this._def = def;
|
|
778
778
|
resolve(def);
|
|
779
779
|
});
|
|
780
|
+
return this._pendingResolve;
|
|
780
781
|
} else resolve(this._def);
|
|
781
782
|
}
|
|
782
783
|
_mountComponent(def) {
|
|
@@ -815,14 +816,17 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
815
816
|
const { props } = def;
|
|
816
817
|
const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
|
|
817
818
|
for (const key of Object.keys(this)) if (key[0] !== "_" && declaredPropKeys.includes(key)) this._setProp(key, this[key]);
|
|
818
|
-
for (const key of declaredPropKeys.map(camelize$1))
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
819
|
+
for (const key of declaredPropKeys.map(camelize$1)) {
|
|
820
|
+
if (!!(process.env.NODE_ENV !== "production") && key in Object.getPrototypeOf(this)) warn(`Custom element prop "${key}" conflicts with an existing property on the element and will overwrite it.`);
|
|
821
|
+
Object.defineProperty(this, key, {
|
|
822
|
+
get() {
|
|
823
|
+
return this._getProp(key);
|
|
824
|
+
},
|
|
825
|
+
set(val) {
|
|
826
|
+
this._setProp(key, val, true, !this._patching);
|
|
827
|
+
}
|
|
828
|
+
});
|
|
829
|
+
}
|
|
826
830
|
}
|
|
827
831
|
_setAttr(key) {
|
|
828
832
|
if (key.startsWith("data-v-")) return;
|
|
@@ -1240,13 +1244,22 @@ function onCompositionEnd(e) {
|
|
|
1240
1244
|
}
|
|
1241
1245
|
}
|
|
1242
1246
|
const assignKey = Symbol("_assign");
|
|
1247
|
+
const initialValueKey = Symbol("_initialValue");
|
|
1243
1248
|
const vModelText = {
|
|
1244
1249
|
created(el, { modifiers: { lazy, trim, number } }, vnode) {
|
|
1250
|
+
if (el.parentNode) {
|
|
1251
|
+
if (el.type === "text") el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
|
|
1252
|
+
else if (el.type === "textarea") el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
|
|
1253
|
+
}
|
|
1245
1254
|
el[assignKey] = getModelAssigner(vnode);
|
|
1246
1255
|
vModelTextInit(el, trim, number || !!(vnode.props && vnode.props.type === "number"), lazy);
|
|
1247
1256
|
},
|
|
1248
|
-
mounted(el, { value }) {
|
|
1249
|
-
|
|
1257
|
+
mounted(el, { value, modifiers: { trim, number } }) {
|
|
1258
|
+
const newValue = value == null ? "" : value;
|
|
1259
|
+
const initialValue = el[initialValueKey];
|
|
1260
|
+
delete el[initialValueKey];
|
|
1261
|
+
if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) el[assignKey](castValue(el.value, trim, number));
|
|
1262
|
+
else el.value = newValue;
|
|
1250
1263
|
},
|
|
1251
1264
|
beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
|
|
1252
1265
|
el[assignKey] = getModelAssigner(vnode);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.6.0-rc.
|
|
2
|
+
* @vue/runtime-dom v3.6.0-rc.3
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -230,7 +230,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
230
230
|
/**
|
|
231
231
|
* The full list is needed during SSR to produce the correct initial markup.
|
|
232
232
|
*/
|
|
233
|
-
const isBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,
|
|
233
|
+
const isBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
|
|
234
234
|
/**
|
|
235
235
|
* Boolean attributes should be included if the value is truthy or ''.
|
|
236
236
|
* e.g. `<select multiple>` compiles to `{ multiple: '' }`
|
|
@@ -2512,7 +2512,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
2512
2512
|
function queuePostFlushCb(jobs, id = Infinity) {
|
|
2513
2513
|
if (!isArray(jobs)) if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
|
|
2514
2514
|
else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
|
|
2515
|
-
else for (
|
|
2515
|
+
else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
|
|
2516
2516
|
queueFlush();
|
|
2517
2517
|
}
|
|
2518
2518
|
function flushPreFlushCbs(instance, seen) {
|
|
@@ -2533,7 +2533,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
2533
2533
|
function flushPostFlushCbs(seen) {
|
|
2534
2534
|
if (postJobs.length) {
|
|
2535
2535
|
if (activePostJobs) {
|
|
2536
|
-
activePostJobs.push(
|
|
2536
|
+
for (let i = 0; i < postJobs.length; i++) activePostJobs.push(postJobs[i]);
|
|
2537
2537
|
postJobs.length = 0;
|
|
2538
2538
|
return;
|
|
2539
2539
|
}
|
|
@@ -3069,7 +3069,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3069
3069
|
}
|
|
3070
3070
|
const prev = setCurrentInstance(this);
|
|
3071
3071
|
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
3072
|
-
|
|
3072
|
+
restoreCurrentInstance(prev);
|
|
3073
3073
|
return res;
|
|
3074
3074
|
}
|
|
3075
3075
|
function createPathGetter(ctx, path) {
|
|
@@ -3342,49 +3342,16 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3342
3342
|
setup(props, { slots }) {
|
|
3343
3343
|
const instance = getCurrentInstance();
|
|
3344
3344
|
const state = useTransitionState();
|
|
3345
|
+
let resumeAfterLeave;
|
|
3345
3346
|
return () => {
|
|
3346
|
-
const
|
|
3347
|
-
const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
|
|
3347
|
+
const child = resolveTransitionChild(slots.default && slots.default(), !!instance.subTree);
|
|
3348
3348
|
if (!child) return;
|
|
3349
3349
|
const rawProps = /* @__PURE__ */ toRaw(props);
|
|
3350
3350
|
const { mode } = rawProps;
|
|
3351
3351
|
checkTransitionMode(mode);
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
let enterHooks = resolveTransitionHooks(innerChild, rawProps, state, instance, (hooks) => enterHooks = hooks);
|
|
3356
|
-
if (innerChild.type !== Comment) setTransitionHooks(innerChild, enterHooks);
|
|
3357
|
-
let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
|
|
3358
|
-
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
|
|
3359
|
-
let leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance);
|
|
3360
|
-
setTransitionHooks(oldInnerChild, leavingHooks);
|
|
3361
|
-
if (mode === "out-in" && innerChild.type !== Comment) {
|
|
3362
|
-
state.isLeaving = true;
|
|
3363
|
-
leavingHooks.afterLeave = () => {
|
|
3364
|
-
state.isLeaving = false;
|
|
3365
|
-
if (!(instance.job.flags & 4)) instance.update();
|
|
3366
|
-
delete leavingHooks.afterLeave;
|
|
3367
|
-
oldInnerChild = void 0;
|
|
3368
|
-
};
|
|
3369
|
-
return emptyPlaceholder(child);
|
|
3370
|
-
} else if (mode === "in-out" && innerChild.type !== Comment) leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
3371
|
-
const leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild);
|
|
3372
|
-
leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
|
|
3373
|
-
el[leaveCbKey] = () => {
|
|
3374
|
-
earlyRemove();
|
|
3375
|
-
el[leaveCbKey] = void 0;
|
|
3376
|
-
delete enterHooks.delayedLeave;
|
|
3377
|
-
oldInnerChild = void 0;
|
|
3378
|
-
};
|
|
3379
|
-
enterHooks.delayedLeave = () => {
|
|
3380
|
-
delayedLeave();
|
|
3381
|
-
delete enterHooks.delayedLeave;
|
|
3382
|
-
oldInnerChild = void 0;
|
|
3383
|
-
};
|
|
3384
|
-
};
|
|
3385
|
-
else oldInnerChild = void 0;
|
|
3386
|
-
} else if (oldInnerChild) oldInnerChild = void 0;
|
|
3387
|
-
return child;
|
|
3352
|
+
return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
|
|
3353
|
+
if (!(instance.job.flags & 4)) instance.update();
|
|
3354
|
+
}) : NOOP);
|
|
3388
3355
|
};
|
|
3389
3356
|
}
|
|
3390
3357
|
};
|
|
@@ -3526,16 +3493,91 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3526
3493
|
if (shapeFlag & 32 && isFunction(children.default)) return children.default();
|
|
3527
3494
|
}
|
|
3528
3495
|
}
|
|
3496
|
+
function resolveTransitionChild(children, renderEmpty = false) {
|
|
3497
|
+
const branches = children && getTransitionRawChildren(children, true);
|
|
3498
|
+
return branches && branches.length ? findNonCommentChild(branches) : renderEmpty ? createCommentVNode() : void 0;
|
|
3499
|
+
}
|
|
3500
|
+
/**
|
|
3501
|
+
* @internal
|
|
3502
|
+
*/
|
|
3503
|
+
function prepareTransitionSwitch(previous, next, props, state, instance, resumeAfterLeave, delayedLeaveSource) {
|
|
3504
|
+
if (state.isLeaving) return emptyPlaceholder(next);
|
|
3505
|
+
const nextInner = getInnerChild$1(next);
|
|
3506
|
+
if (!nextInner) return emptyPlaceholder(next);
|
|
3507
|
+
let enterHooks = resolveTransitionHooks(nextInner, props, state, instance, (hooks) => {
|
|
3508
|
+
if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
|
|
3509
|
+
enterHooks = hooks;
|
|
3510
|
+
});
|
|
3511
|
+
if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
|
|
3512
|
+
if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
|
|
3513
|
+
const mode = props.mode;
|
|
3514
|
+
const previousInner = previous && getInnerChild$1(previous);
|
|
3515
|
+
if (previous && previousInner && previousInner.type !== Comment && !isSameVNodeType(previousInner, nextInner) && (!previous.component || recursiveGetSubtree(previous.component).type !== Comment)) {
|
|
3516
|
+
const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
|
|
3517
|
+
if (nextInner.type !== Comment && (mode === "out-in" || mode === "in-out") && applyTransitionModeSwitch(previousInner, leavingHooks, mode === "in-out" ? () => enterHooks : void 0, props, state, resumeAfterLeave)) return emptyPlaceholder(next);
|
|
3518
|
+
}
|
|
3519
|
+
return next;
|
|
3520
|
+
}
|
|
3521
|
+
function forwardDelayedLeave(hooks, source) {
|
|
3522
|
+
const delayedLeave = source && source.delayedLeave;
|
|
3523
|
+
if (!delayedLeave) return;
|
|
3524
|
+
hooks.delayedLeave = () => {
|
|
3525
|
+
if (source.delayedLeave === delayedLeave) delayedLeave();
|
|
3526
|
+
delete hooks.delayedLeave;
|
|
3527
|
+
};
|
|
3528
|
+
}
|
|
3529
|
+
function prepareLeavingTransitionHooks(previousInner, props, state, instance) {
|
|
3530
|
+
return setTransitionHooks(previousInner, resolveTransitionHooks(previousInner, props, state, instance));
|
|
3531
|
+
}
|
|
3532
|
+
function applyTransitionModeSwitch(leavingVNode, leavingHooks, getEnterHooks, props, state, resumeAfterLeave) {
|
|
3533
|
+
if (props.mode === "out-in") {
|
|
3534
|
+
state.isLeaving = true;
|
|
3535
|
+
leavingHooks.afterLeave = () => {
|
|
3536
|
+
state.isLeaving = false;
|
|
3537
|
+
resumeAfterLeave();
|
|
3538
|
+
delete leavingHooks.afterLeave;
|
|
3539
|
+
};
|
|
3540
|
+
return true;
|
|
3541
|
+
} else if (props.mode === "in-out" && getEnterHooks) {
|
|
3542
|
+
let delayedLeavingVNode = leavingVNode;
|
|
3543
|
+
leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
3544
|
+
const enterHooks = getEnterHooks();
|
|
3545
|
+
if (!enterHooks) {
|
|
3546
|
+
delayedLeave();
|
|
3547
|
+
return;
|
|
3548
|
+
}
|
|
3549
|
+
const vnode = delayedLeavingVNode;
|
|
3550
|
+
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
3551
|
+
leavingVNodesCache[String(vnode.key)] = vnode;
|
|
3552
|
+
el[leaveCbKey] = () => {
|
|
3553
|
+
earlyRemove();
|
|
3554
|
+
el[leaveCbKey] = void 0;
|
|
3555
|
+
delete enterHooks.delayedLeave;
|
|
3556
|
+
delayedLeavingVNode = void 0;
|
|
3557
|
+
};
|
|
3558
|
+
enterHooks.delayedLeave = () => {
|
|
3559
|
+
delayedLeave();
|
|
3560
|
+
delete enterHooks.delayedLeave;
|
|
3561
|
+
delayedLeavingVNode = void 0;
|
|
3562
|
+
};
|
|
3563
|
+
};
|
|
3564
|
+
}
|
|
3565
|
+
return false;
|
|
3566
|
+
}
|
|
3529
3567
|
function setTransitionHooks(vnode, hooks) {
|
|
3530
|
-
if (vnode.shapeFlag & 6 && vnode.component)
|
|
3531
|
-
else {
|
|
3568
|
+
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
3532
3569
|
vnode.transition = hooks;
|
|
3533
|
-
setTransitionHooks(vnode.component
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3570
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
|
|
3571
|
+
else {
|
|
3572
|
+
const subTree = vnode.component.subTree;
|
|
3573
|
+
return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
|
|
3574
|
+
}
|
|
3575
|
+
} else if (vnode.shapeFlag & 128) {
|
|
3576
|
+
const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
3577
|
+
const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
3578
|
+
return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
|
|
3538
3579
|
} else vnode.transition = hooks;
|
|
3580
|
+
return hooks;
|
|
3539
3581
|
}
|
|
3540
3582
|
function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
3541
3583
|
let ret = [];
|
|
@@ -3887,7 +3929,10 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3887
3929
|
const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
|
|
3888
3930
|
for (const key in props) {
|
|
3889
3931
|
if (!(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) logMismatchError();
|
|
3890
|
-
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key))
|
|
3932
|
+
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
|
|
3933
|
+
if (isUnchangedResourceProp(el, key, props[key])) continue;
|
|
3934
|
+
patchProp(el, key, null, props[key], namespace, parentComponent);
|
|
3935
|
+
}
|
|
3891
3936
|
}
|
|
3892
3937
|
}
|
|
3893
3938
|
let vnodeHooks;
|
|
@@ -3996,6 +4041,16 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3996
4041
|
/**
|
|
3997
4042
|
* Dev only
|
|
3998
4043
|
*/
|
|
4044
|
+
const resourceProps = /* @__PURE__ */ new Set([
|
|
4045
|
+
"src",
|
|
4046
|
+
"srcset",
|
|
4047
|
+
"href",
|
|
4048
|
+
"poster"
|
|
4049
|
+
]);
|
|
4050
|
+
function isUnchangedResourceProp(el, key, clientValue) {
|
|
4051
|
+
if (!resourceProps.has(key)) return false;
|
|
4052
|
+
return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
|
|
4053
|
+
}
|
|
3999
4054
|
function propHasMismatch(el, key, clientValue, vnode, instance) {
|
|
4000
4055
|
let mismatchType;
|
|
4001
4056
|
let mismatchKey;
|
|
@@ -4036,7 +4091,10 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4036
4091
|
function getAttributeMismatch(el, key, clientValue) {
|
|
4037
4092
|
let actual;
|
|
4038
4093
|
let expected;
|
|
4039
|
-
if (
|
|
4094
|
+
if (key === "hidden") {
|
|
4095
|
+
actual = normalizeHiddenValue(el.getAttribute(key));
|
|
4096
|
+
expected = normalizeHiddenValue(clientValue);
|
|
4097
|
+
} else if (isBooleanAttr(key)) {
|
|
4040
4098
|
actual = el.hasAttribute(key);
|
|
4041
4099
|
expected = includeBooleanAttr(clientValue);
|
|
4042
4100
|
} else if (clientValue == null) {
|
|
@@ -4064,6 +4122,11 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4064
4122
|
}
|
|
4065
4123
|
return false;
|
|
4066
4124
|
}
|
|
4125
|
+
function normalizeHiddenValue(value) {
|
|
4126
|
+
if (!isRenderableAttrValue(value)) return false;
|
|
4127
|
+
if (isString(value)) return value.toLowerCase() === "until-found" ? "until-found" : "";
|
|
4128
|
+
return includeBooleanAttr(value) ? "" : false;
|
|
4129
|
+
}
|
|
4067
4130
|
function toClassSet(str) {
|
|
4068
4131
|
return new Set(str.trim().split(/\s+/));
|
|
4069
4132
|
}
|
|
@@ -4595,7 +4658,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4595
4658
|
try {
|
|
4596
4659
|
return callWithAsyncErrorHandling(hook, target, type, args);
|
|
4597
4660
|
} finally {
|
|
4598
|
-
|
|
4661
|
+
restoreCurrentInstance(prev);
|
|
4599
4662
|
setActiveSub(prevSub);
|
|
4600
4663
|
}
|
|
4601
4664
|
});
|
|
@@ -4724,7 +4787,8 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4724
4787
|
* Compiler runtime helper for rendering `<slot/>`
|
|
4725
4788
|
* @private
|
|
4726
4789
|
*/
|
|
4727
|
-
function renderSlot(slots, name, props
|
|
4790
|
+
function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
4791
|
+
if (props == null) props = {};
|
|
4728
4792
|
let slot = slots[name];
|
|
4729
4793
|
if (fallback) fallback.__vdom = true;
|
|
4730
4794
|
const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
|
|
@@ -5777,8 +5841,9 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
5777
5841
|
root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
|
|
5778
5842
|
}
|
|
5779
5843
|
if (vnode.transition) {
|
|
5780
|
-
|
|
5781
|
-
|
|
5844
|
+
const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
|
|
5845
|
+
if (!isElementRoot(child)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
|
|
5846
|
+
setTransitionHooks(child, vnode.transition);
|
|
5782
5847
|
}
|
|
5783
5848
|
if (setRoot) setRoot(root);
|
|
5784
5849
|
else result = root;
|
|
@@ -5838,9 +5903,10 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
5838
5903
|
}
|
|
5839
5904
|
return singleRoot;
|
|
5840
5905
|
}
|
|
5906
|
+
const isFunctionalFallthroughKey = (key) => key === "class" || key === "style" || isOn(key);
|
|
5841
5907
|
const getFunctionalFallthrough = (attrs) => {
|
|
5842
5908
|
let res;
|
|
5843
|
-
for (const key in attrs) if (
|
|
5909
|
+
for (const key in attrs) if (isFunctionalFallthroughKey(key)) (res || (res = {}))[key] = attrs[key];
|
|
5844
5910
|
return res;
|
|
5845
5911
|
};
|
|
5846
5912
|
const filterModelListeners = (attrs, props) => {
|
|
@@ -6040,7 +6106,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
6040
6106
|
const prev = setCurrentInstance(instance);
|
|
6041
6107
|
const props = /* @__PURE__ */ toRaw(instance.props);
|
|
6042
6108
|
value = factory.call(null, props);
|
|
6043
|
-
|
|
6109
|
+
restoreCurrentInstance(prev);
|
|
6044
6110
|
return value;
|
|
6045
6111
|
}
|
|
6046
6112
|
const mixinPropsCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -6600,7 +6666,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
6600
6666
|
};
|
|
6601
6667
|
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
6602
6668
|
n2.slotScopeIds = slotScopeIds;
|
|
6603
|
-
if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent);
|
|
6669
|
+
if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
|
|
6604
6670
|
else {
|
|
6605
6671
|
const vnodeBeforeMountHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeBeforeMount;
|
|
6606
6672
|
getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense, () => {
|
|
@@ -6943,7 +7009,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
6943
7009
|
const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
|
|
6944
7010
|
const { el, type, transition, children, shapeFlag } = vnode;
|
|
6945
7011
|
if (isVaporComponent(type) || type === VaporSlot) {
|
|
6946
|
-
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType);
|
|
7012
|
+
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType, parentSuspense);
|
|
6947
7013
|
return;
|
|
6948
7014
|
}
|
|
6949
7015
|
if (shapeFlag & 6) {
|
|
@@ -6999,7 +7065,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
6999
7065
|
}
|
|
7000
7066
|
if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
|
|
7001
7067
|
if (shapeFlag & 256) {
|
|
7002
|
-
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer());
|
|
7068
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
|
|
7003
7069
|
else parentComponent.ctx.deactivate(vnode);
|
|
7004
7070
|
return;
|
|
7005
7071
|
}
|
|
@@ -7009,7 +7075,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7009
7075
|
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
7010
7076
|
if (shapeFlag & 6) if (isVaporComponent(type)) {
|
|
7011
7077
|
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
|
|
7012
|
-
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
7078
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
7013
7079
|
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || dirs) queuePostRenderEffect(() => {
|
|
7014
7080
|
dirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
7015
7081
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
@@ -7026,7 +7092,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7026
7092
|
else if (dynamicChildren && !dynamicChildren.hasOnce && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
|
|
7027
7093
|
else if (type === Fragment && patchFlag & 384 || !optimized && shapeFlag & 16) unmountChildren(children, parentComponent, parentSuspense);
|
|
7028
7094
|
if (type === VaporSlot) {
|
|
7029
|
-
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
7095
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
7030
7096
|
return;
|
|
7031
7097
|
}
|
|
7032
7098
|
if (doRemove) remove(vnode);
|
|
@@ -7325,6 +7391,10 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7325
7391
|
suspense.activeBranch = pendingBranch;
|
|
7326
7392
|
} else unmount(pendingBranch, parentComponent, suspense);
|
|
7327
7393
|
suspense.deps = 0;
|
|
7394
|
+
for (let i = 0; i < suspense.effects.length; i++) {
|
|
7395
|
+
const effect = suspense.effects[i];
|
|
7396
|
+
if (effect.flags & 8) queuePostFlushCb(effect);
|
|
7397
|
+
}
|
|
7328
7398
|
suspense.effects.length = 0;
|
|
7329
7399
|
suspense.hiddenContainer = createElement("div");
|
|
7330
7400
|
if (isInFallback) {
|
|
@@ -7432,7 +7502,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7432
7502
|
let hasUnresolvedAncestor = false;
|
|
7433
7503
|
while (parent) {
|
|
7434
7504
|
if (parent.pendingBranch) {
|
|
7435
|
-
parent.effects.push(
|
|
7505
|
+
for (let i = 0; i < effects.length; i++) parent.effects.push(effects[i]);
|
|
7436
7506
|
hasUnresolvedAncestor = true;
|
|
7437
7507
|
break;
|
|
7438
7508
|
}
|
|
@@ -7702,9 +7772,24 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7702
7772
|
if (shapeFlag & 128) type.normalize(vnode);
|
|
7703
7773
|
} else if (children) vnode.shapeFlag |= isString(children) ? 8 : 16;
|
|
7704
7774
|
if (vnode.key !== vnode.key) warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
|
|
7775
|
+
if (props && vnode.shapeFlag & 1) {
|
|
7776
|
+
const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
|
|
7777
|
+
if (overwritingProp && hasContentChildren(vnode.children)) warn$1(`The \`${overwritingProp}\` prop on <${vnode.type}> will override its children. Remove either the \`${overwritingProp}\` prop or the children.`);
|
|
7778
|
+
}
|
|
7705
7779
|
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock && (vnode.patchFlag > 0 || shapeFlag & 6) && vnode.patchFlag !== 32) currentBlock.push(vnode);
|
|
7706
7780
|
return vnode;
|
|
7707
7781
|
}
|
|
7782
|
+
/**
|
|
7783
|
+
* dev only
|
|
7784
|
+
* Whether children would actually render something. Empty text and empty
|
|
7785
|
+
* arrays are ignored, mirroring the compiler's `node.children.length` check
|
|
7786
|
+
* for `v-html` / `v-text`.
|
|
7787
|
+
*/
|
|
7788
|
+
function hasContentChildren(children) {
|
|
7789
|
+
if (isString(children)) return children !== "";
|
|
7790
|
+
if (isArray(children)) return children.length > 0;
|
|
7791
|
+
return false;
|
|
7792
|
+
}
|
|
7708
7793
|
const createVNode = createVNodeWithArgsTransform;
|
|
7709
7794
|
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
|
|
7710
7795
|
if (!type || type === NULL_DYNAMIC_COMPONENT) {
|
|
@@ -7924,6 +8009,16 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7924
8009
|
simpleSetCurrentInstance(instance);
|
|
7925
8010
|
}
|
|
7926
8011
|
};
|
|
8012
|
+
/**
|
|
8013
|
+
* Restores a snapshot returned by {@link setCurrentInstance}. Unlike calling
|
|
8014
|
+
* `setCurrentInstance(...prev)`, an `undefined` saved scope is restored
|
|
8015
|
+
* verbatim instead of re-triggering the `instance.scope` default.
|
|
8016
|
+
* @internal
|
|
8017
|
+
*/
|
|
8018
|
+
const restoreCurrentInstance = (prev) => {
|
|
8019
|
+
setCurrentScope(prev[1]);
|
|
8020
|
+
simpleSetCurrentInstance(prev[0]);
|
|
8021
|
+
};
|
|
7927
8022
|
const internalOptions = [
|
|
7928
8023
|
"ce",
|
|
7929
8024
|
"type",
|
|
@@ -8075,7 +8170,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
8075
8170
|
const setupResult = callWithErrorHandling(setup, instance, 0, [/* @__PURE__ */ shallowReadonly(instance.props), setupContext]);
|
|
8076
8171
|
const isAsyncSetup = isPromise(setupResult);
|
|
8077
8172
|
setActiveSub(prevSub);
|
|
8078
|
-
|
|
8173
|
+
restoreCurrentInstance(prev);
|
|
8079
8174
|
if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) markAsyncBoundary(instance);
|
|
8080
8175
|
if (isAsyncSetup) {
|
|
8081
8176
|
const unsetCurrentInstance = () => {
|
|
@@ -8083,7 +8178,12 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
8083
8178
|
};
|
|
8084
8179
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
8085
8180
|
if (isSSR) return setupResult.then((resolvedResult) => {
|
|
8086
|
-
|
|
8181
|
+
setInSSRSetupState(true);
|
|
8182
|
+
try {
|
|
8183
|
+
handleSetupResult(instance, resolvedResult, isSSR);
|
|
8184
|
+
} finally {
|
|
8185
|
+
setInSSRSetupState(false);
|
|
8186
|
+
}
|
|
8087
8187
|
}).catch((e) => {
|
|
8088
8188
|
handleError(e, instance, 0);
|
|
8089
8189
|
});
|
|
@@ -8144,7 +8244,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
8144
8244
|
applyOptions(instance);
|
|
8145
8245
|
} finally {
|
|
8146
8246
|
setActiveSub(prevSub);
|
|
8147
|
-
|
|
8247
|
+
restoreCurrentInstance(prevInstance);
|
|
8148
8248
|
}
|
|
8149
8249
|
}
|
|
8150
8250
|
if (!Component.render && instance.render === NOOP && !isSSR) if (!compile && Component.template)
|
|
@@ -8454,7 +8554,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
8454
8554
|
}
|
|
8455
8555
|
//#endregion
|
|
8456
8556
|
//#region packages/runtime-core/src/index.ts
|
|
8457
|
-
const version = "3.6.0-rc.
|
|
8557
|
+
const version = "3.6.0-rc.3";
|
|
8458
8558
|
const warn = warn$1;
|
|
8459
8559
|
/**
|
|
8460
8560
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -9175,7 +9275,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
9175
9275
|
if (!this._instance) if (this._resolved) this._mountComponent(this._def);
|
|
9176
9276
|
else if (parent && parent._pendingResolve) this._pendingResolve = parent._pendingResolve.then(() => {
|
|
9177
9277
|
this._pendingResolve = void 0;
|
|
9178
|
-
this._resolveDef();
|
|
9278
|
+
if (this.isConnected) return this._resolveDef();
|
|
9179
9279
|
});
|
|
9180
9280
|
else this._resolveDef();
|
|
9181
9281
|
}
|
|
@@ -9211,7 +9311,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
9211
9311
|
* resolve inner component definition (handle possible async component)
|
|
9212
9312
|
*/
|
|
9213
9313
|
_resolveDef() {
|
|
9214
|
-
if (this._pendingResolve) return;
|
|
9314
|
+
if (this._pendingResolve) return this._pendingResolve;
|
|
9215
9315
|
for (let i = 0; i < this.attributes.length; i++) this._setAttr(this.attributes[i].name);
|
|
9216
9316
|
this._ob = new MutationObserver(this._processMutations.bind(this));
|
|
9217
9317
|
this._ob.observe(this, { attributes: true });
|
|
@@ -9241,6 +9341,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
9241
9341
|
this._def = def;
|
|
9242
9342
|
resolve(def);
|
|
9243
9343
|
});
|
|
9344
|
+
return this._pendingResolve;
|
|
9244
9345
|
} else resolve(this._def);
|
|
9245
9346
|
}
|
|
9246
9347
|
_mountComponent(def) {
|
|
@@ -9279,14 +9380,17 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
9279
9380
|
const { props } = def;
|
|
9280
9381
|
const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
|
|
9281
9382
|
for (const key of Object.keys(this)) if (key[0] !== "_" && declaredPropKeys.includes(key)) this._setProp(key, this[key]);
|
|
9282
|
-
for (const key of declaredPropKeys.map(camelize))
|
|
9283
|
-
|
|
9284
|
-
|
|
9285
|
-
|
|
9286
|
-
|
|
9287
|
-
|
|
9288
|
-
|
|
9289
|
-
|
|
9383
|
+
for (const key of declaredPropKeys.map(camelize)) {
|
|
9384
|
+
if (key in Object.getPrototypeOf(this)) warn(`Custom element prop "${key}" conflicts with an existing property on the element and will overwrite it.`);
|
|
9385
|
+
Object.defineProperty(this, key, {
|
|
9386
|
+
get() {
|
|
9387
|
+
return this._getProp(key);
|
|
9388
|
+
},
|
|
9389
|
+
set(val) {
|
|
9390
|
+
this._setProp(key, val, true, !this._patching);
|
|
9391
|
+
}
|
|
9392
|
+
});
|
|
9393
|
+
}
|
|
9290
9394
|
}
|
|
9291
9395
|
_setAttr(key) {
|
|
9292
9396
|
if (key.startsWith("data-v-")) return;
|
|
@@ -9686,13 +9790,22 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
9686
9790
|
}
|
|
9687
9791
|
}
|
|
9688
9792
|
const assignKey = Symbol("_assign");
|
|
9793
|
+
const initialValueKey = Symbol("_initialValue");
|
|
9689
9794
|
const vModelText = {
|
|
9690
9795
|
created(el, { modifiers: { lazy, trim, number } }, vnode) {
|
|
9796
|
+
if (el.parentNode) {
|
|
9797
|
+
if (el.type === "text") el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
|
|
9798
|
+
else if (el.type === "textarea") el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
|
|
9799
|
+
}
|
|
9691
9800
|
el[assignKey] = getModelAssigner(vnode);
|
|
9692
9801
|
vModelTextInit(el, trim, number || !!(vnode.props && vnode.props.type === "number"), lazy);
|
|
9693
9802
|
},
|
|
9694
|
-
mounted(el, { value }) {
|
|
9695
|
-
|
|
9803
|
+
mounted(el, { value, modifiers: { trim, number } }) {
|
|
9804
|
+
const newValue = value == null ? "" : value;
|
|
9805
|
+
const initialValue = el[initialValueKey];
|
|
9806
|
+
delete el[initialValueKey];
|
|
9807
|
+
if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) el[assignKey](castValue(el.value, trim, number));
|
|
9808
|
+
else el.value = newValue;
|
|
9696
9809
|
},
|
|
9697
9810
|
beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
|
|
9698
9811
|
el[assignKey] = getModelAssigner(vnode);
|