@vue/compat 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/vue-compat.d.ts +30 -7
- package/dist/vue.cjs.js +241 -95
- package/dist/vue.cjs.prod.js +207 -85
- package/dist/vue.esm-browser.js +239 -94
- package/dist/vue.esm-browser.prod.js +7 -6
- package/dist/vue.esm-bundler.js +261 -96
- package/dist/vue.global.js +239 -94
- package/dist/vue.global.prod.js +7 -6
- package/dist/vue.runtime.esm-browser.js +239 -94
- package/dist/vue.runtime.esm-browser.prod.js +7 -6
- package/dist/vue.runtime.esm-bundler.js +261 -96
- package/dist/vue.runtime.global.js +239 -94
- package/dist/vue.runtime.global.prod.js +7 -6
- package/package.json +3 -3
package/dist/vue.esm-bundler.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compat v3.6.0-rc.
|
|
2
|
+
* @vue/compat v3.6.0-rc.3
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -318,7 +318,7 @@ const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
|
|
|
318
318
|
/**
|
|
319
319
|
* The full list is needed during SSR to produce the correct initial markup.
|
|
320
320
|
*/
|
|
321
|
-
const isBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,
|
|
321
|
+
const isBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
|
|
322
322
|
/**
|
|
323
323
|
* Boolean attributes should be included if the value is truthy or ''.
|
|
324
324
|
* e.g. `<select multiple>` compiles to `{ multiple: '' }`
|
|
@@ -2560,7 +2560,9 @@ const SchedulerJobFlags = {
|
|
|
2560
2560
|
"ALLOW_RECURSE": 2,
|
|
2561
2561
|
"2": "ALLOW_RECURSE",
|
|
2562
2562
|
"DISPOSED": 4,
|
|
2563
|
-
"4": "DISPOSED"
|
|
2563
|
+
"4": "DISPOSED",
|
|
2564
|
+
"REQUEUE_ON_SUSPENSE_DISCARD": 8,
|
|
2565
|
+
"8": "REQUEUE_ON_SUSPENSE_DISCARD"
|
|
2564
2566
|
};
|
|
2565
2567
|
const jobs = [];
|
|
2566
2568
|
let postJobs = [];
|
|
@@ -2617,7 +2619,7 @@ function queueFlush() {
|
|
|
2617
2619
|
function queuePostFlushCb(jobs, id = Infinity) {
|
|
2618
2620
|
if (!isArray(jobs)) if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
|
|
2619
2621
|
else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
|
|
2620
|
-
else for (
|
|
2622
|
+
else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
|
|
2621
2623
|
queueFlush();
|
|
2622
2624
|
}
|
|
2623
2625
|
function flushPreFlushCbs(instance, seen) {
|
|
@@ -2638,7 +2640,7 @@ function flushPreFlushCbs(instance, seen) {
|
|
|
2638
2640
|
function flushPostFlushCbs(seen) {
|
|
2639
2641
|
if (postJobs.length) {
|
|
2640
2642
|
if (activePostJobs) {
|
|
2641
|
-
activePostJobs.push(
|
|
2643
|
+
for (let i = 0; i < postJobs.length; i++) activePostJobs.push(postJobs[i]);
|
|
2642
2644
|
postJobs.length = 0;
|
|
2643
2645
|
return;
|
|
2644
2646
|
}
|
|
@@ -3550,7 +3552,7 @@ function instanceWatch(source, value, options) {
|
|
|
3550
3552
|
}
|
|
3551
3553
|
const prev = setCurrentInstance(this);
|
|
3552
3554
|
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
3553
|
-
|
|
3555
|
+
restoreCurrentInstance(prev);
|
|
3554
3556
|
return res;
|
|
3555
3557
|
}
|
|
3556
3558
|
function createPathGetter(ctx, path) {
|
|
@@ -3823,49 +3825,16 @@ const BaseTransitionImpl = {
|
|
|
3823
3825
|
setup(props, { slots }) {
|
|
3824
3826
|
const instance = getCurrentInstance();
|
|
3825
3827
|
const state = useTransitionState();
|
|
3828
|
+
let resumeAfterLeave;
|
|
3826
3829
|
return () => {
|
|
3827
|
-
const
|
|
3828
|
-
const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
|
|
3830
|
+
const child = resolveTransitionChild(slots.default && slots.default(), !!instance.subTree);
|
|
3829
3831
|
if (!child) return;
|
|
3830
3832
|
const rawProps = /* @__PURE__ */ toRaw(props);
|
|
3831
3833
|
const { mode } = rawProps;
|
|
3832
3834
|
checkTransitionMode(mode);
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
let enterHooks = resolveTransitionHooks(innerChild, rawProps, state, instance, (hooks) => enterHooks = hooks);
|
|
3837
|
-
if (innerChild.type !== Comment) setTransitionHooks(innerChild, enterHooks);
|
|
3838
|
-
let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
|
|
3839
|
-
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
|
|
3840
|
-
let leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance);
|
|
3841
|
-
setTransitionHooks(oldInnerChild, leavingHooks);
|
|
3842
|
-
if (mode === "out-in" && innerChild.type !== Comment) {
|
|
3843
|
-
state.isLeaving = true;
|
|
3844
|
-
leavingHooks.afterLeave = () => {
|
|
3845
|
-
state.isLeaving = false;
|
|
3846
|
-
if (!(instance.job.flags & 4)) instance.update();
|
|
3847
|
-
delete leavingHooks.afterLeave;
|
|
3848
|
-
oldInnerChild = void 0;
|
|
3849
|
-
};
|
|
3850
|
-
return emptyPlaceholder(child);
|
|
3851
|
-
} else if (mode === "in-out" && innerChild.type !== Comment) leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
3852
|
-
const leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild);
|
|
3853
|
-
leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
|
|
3854
|
-
el[leaveCbKey] = () => {
|
|
3855
|
-
earlyRemove();
|
|
3856
|
-
el[leaveCbKey] = void 0;
|
|
3857
|
-
delete enterHooks.delayedLeave;
|
|
3858
|
-
oldInnerChild = void 0;
|
|
3859
|
-
};
|
|
3860
|
-
enterHooks.delayedLeave = () => {
|
|
3861
|
-
delayedLeave();
|
|
3862
|
-
delete enterHooks.delayedLeave;
|
|
3863
|
-
oldInnerChild = void 0;
|
|
3864
|
-
};
|
|
3865
|
-
};
|
|
3866
|
-
else oldInnerChild = void 0;
|
|
3867
|
-
} else if (oldInnerChild) oldInnerChild = void 0;
|
|
3868
|
-
return child;
|
|
3835
|
+
return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
|
|
3836
|
+
if (!(instance.job.flags & 4)) instance.update();
|
|
3837
|
+
}) : NOOP);
|
|
3869
3838
|
};
|
|
3870
3839
|
}
|
|
3871
3840
|
};
|
|
@@ -4009,16 +3978,102 @@ function getInnerChild$1(vnode) {
|
|
|
4009
3978
|
if (shapeFlag & 32 && isFunction(children.default)) return children.default();
|
|
4010
3979
|
}
|
|
4011
3980
|
}
|
|
3981
|
+
function resolveTransitionChild(children, renderEmpty = false) {
|
|
3982
|
+
const branches = children && getTransitionRawChildren(children, true);
|
|
3983
|
+
return branches && branches.length ? findNonCommentChild(branches) : renderEmpty ? createCommentVNode() : void 0;
|
|
3984
|
+
}
|
|
3985
|
+
/**
|
|
3986
|
+
* @internal
|
|
3987
|
+
*/
|
|
3988
|
+
function prepareTransitionSwitch(previous, next, props, state, instance, resumeAfterLeave, delayedLeaveSource) {
|
|
3989
|
+
if (state.isLeaving) return emptyPlaceholder(next);
|
|
3990
|
+
const nextInner = getInnerChild$1(next);
|
|
3991
|
+
if (!nextInner) return emptyPlaceholder(next);
|
|
3992
|
+
let enterHooks = resolveTransitionHooks(nextInner, props, state, instance, (hooks) => {
|
|
3993
|
+
if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
|
|
3994
|
+
enterHooks = hooks;
|
|
3995
|
+
});
|
|
3996
|
+
if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
|
|
3997
|
+
if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
|
|
3998
|
+
const mode = props.mode;
|
|
3999
|
+
const previousInner = previous && getInnerChild$1(previous);
|
|
4000
|
+
if (previous && previousInner && previousInner.type !== Comment && !isSameVNodeType(previousInner, nextInner) && (!previous.component || recursiveGetSubtree(previous.component).type !== Comment)) {
|
|
4001
|
+
const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
|
|
4002
|
+
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);
|
|
4003
|
+
}
|
|
4004
|
+
return next;
|
|
4005
|
+
}
|
|
4006
|
+
function forwardDelayedLeave(hooks, source) {
|
|
4007
|
+
const delayedLeave = source && source.delayedLeave;
|
|
4008
|
+
if (!delayedLeave) return;
|
|
4009
|
+
hooks.delayedLeave = () => {
|
|
4010
|
+
if (source.delayedLeave === delayedLeave) delayedLeave();
|
|
4011
|
+
delete hooks.delayedLeave;
|
|
4012
|
+
};
|
|
4013
|
+
}
|
|
4014
|
+
/**
|
|
4015
|
+
* Prepares an outgoing VNode when the incoming branch belongs to another
|
|
4016
|
+
* renderer. Returns true when out-in must defer the incoming branch.
|
|
4017
|
+
*
|
|
4018
|
+
* @internal
|
|
4019
|
+
*/
|
|
4020
|
+
function prepareTransitionLeave(previous, enterHooks, props, state, instance, resumeAfterLeave) {
|
|
4021
|
+
const previousInner = getInnerChild$1(previous);
|
|
4022
|
+
if (!previousInner || previousInner.type === Comment || previous.component && recursiveGetSubtree(previous.component).type === Comment) return false;
|
|
4023
|
+
return applyTransitionModeSwitch(previousInner, prepareLeavingTransitionHooks(previousInner, props, state, instance), enterHooks ? () => enterHooks : void 0, props, state, resumeAfterLeave);
|
|
4024
|
+
}
|
|
4025
|
+
function prepareLeavingTransitionHooks(previousInner, props, state, instance) {
|
|
4026
|
+
return setTransitionHooks(previousInner, resolveTransitionHooks(previousInner, props, state, instance));
|
|
4027
|
+
}
|
|
4028
|
+
function applyTransitionModeSwitch(leavingVNode, leavingHooks, getEnterHooks, props, state, resumeAfterLeave) {
|
|
4029
|
+
if (props.mode === "out-in") {
|
|
4030
|
+
state.isLeaving = true;
|
|
4031
|
+
leavingHooks.afterLeave = () => {
|
|
4032
|
+
state.isLeaving = false;
|
|
4033
|
+
resumeAfterLeave();
|
|
4034
|
+
delete leavingHooks.afterLeave;
|
|
4035
|
+
};
|
|
4036
|
+
return true;
|
|
4037
|
+
} else if (props.mode === "in-out" && getEnterHooks) {
|
|
4038
|
+
let delayedLeavingVNode = leavingVNode;
|
|
4039
|
+
leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
4040
|
+
const enterHooks = getEnterHooks();
|
|
4041
|
+
if (!enterHooks) {
|
|
4042
|
+
delayedLeave();
|
|
4043
|
+
return;
|
|
4044
|
+
}
|
|
4045
|
+
const vnode = delayedLeavingVNode;
|
|
4046
|
+
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
4047
|
+
leavingVNodesCache[String(vnode.key)] = vnode;
|
|
4048
|
+
el[leaveCbKey] = () => {
|
|
4049
|
+
earlyRemove();
|
|
4050
|
+
el[leaveCbKey] = void 0;
|
|
4051
|
+
delete enterHooks.delayedLeave;
|
|
4052
|
+
delayedLeavingVNode = void 0;
|
|
4053
|
+
};
|
|
4054
|
+
enterHooks.delayedLeave = () => {
|
|
4055
|
+
delayedLeave();
|
|
4056
|
+
delete enterHooks.delayedLeave;
|
|
4057
|
+
delayedLeavingVNode = void 0;
|
|
4058
|
+
};
|
|
4059
|
+
};
|
|
4060
|
+
}
|
|
4061
|
+
return false;
|
|
4062
|
+
}
|
|
4012
4063
|
function setTransitionHooks(vnode, hooks) {
|
|
4013
|
-
if (vnode.shapeFlag & 6 && vnode.component)
|
|
4014
|
-
else {
|
|
4064
|
+
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
4015
4065
|
vnode.transition = hooks;
|
|
4016
|
-
setTransitionHooks(vnode.component
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4066
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
|
|
4067
|
+
else {
|
|
4068
|
+
const subTree = vnode.component.subTree;
|
|
4069
|
+
return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
|
|
4070
|
+
}
|
|
4071
|
+
} else if (vnode.shapeFlag & 128) {
|
|
4072
|
+
const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
4073
|
+
const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
4074
|
+
return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
|
|
4021
4075
|
} else vnode.transition = hooks;
|
|
4076
|
+
return hooks;
|
|
4022
4077
|
}
|
|
4023
4078
|
function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
4024
4079
|
let ret = [];
|
|
@@ -4385,7 +4440,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4385
4440
|
const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
|
|
4386
4441
|
for (const key in props) {
|
|
4387
4442
|
if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) logMismatchError();
|
|
4388
|
-
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key))
|
|
4443
|
+
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
|
|
4444
|
+
if (isUnchangedResourceProp(el, key, props[key])) continue;
|
|
4445
|
+
patchProp(el, key, null, props[key], namespace, parentComponent);
|
|
4446
|
+
}
|
|
4389
4447
|
}
|
|
4390
4448
|
} else if (props.onClick) patchProp(el, "onClick", null, props.onClick, void 0, parentComponent);
|
|
4391
4449
|
else if (patchFlag & 4 && /* @__PURE__ */ isReactive(props.style)) for (const key in props.style) props.style[key];
|
|
@@ -4496,6 +4554,16 @@ const isTemplateNode = (node) => {
|
|
|
4496
4554
|
/**
|
|
4497
4555
|
* Dev only
|
|
4498
4556
|
*/
|
|
4557
|
+
const resourceProps = /* @__PURE__ */ new Set([
|
|
4558
|
+
"src",
|
|
4559
|
+
"srcset",
|
|
4560
|
+
"href",
|
|
4561
|
+
"poster"
|
|
4562
|
+
]);
|
|
4563
|
+
function isUnchangedResourceProp(el, key, clientValue) {
|
|
4564
|
+
if (!resourceProps.has(key)) return false;
|
|
4565
|
+
return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
|
|
4566
|
+
}
|
|
4499
4567
|
function propHasMismatch(el, key, clientValue, vnode, instance) {
|
|
4500
4568
|
let mismatchType;
|
|
4501
4569
|
let mismatchKey;
|
|
@@ -4536,7 +4604,10 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
|
|
|
4536
4604
|
function getAttributeMismatch(el, key, clientValue) {
|
|
4537
4605
|
let actual;
|
|
4538
4606
|
let expected;
|
|
4539
|
-
if (
|
|
4607
|
+
if (key === "hidden") {
|
|
4608
|
+
actual = normalizeHiddenValue(el.getAttribute(key));
|
|
4609
|
+
expected = normalizeHiddenValue(clientValue);
|
|
4610
|
+
} else if (isBooleanAttr(key)) {
|
|
4540
4611
|
actual = el.hasAttribute(key);
|
|
4541
4612
|
expected = includeBooleanAttr(clientValue);
|
|
4542
4613
|
} else if (clientValue == null) {
|
|
@@ -4564,6 +4635,11 @@ function warnPropMismatch(el, mismatchKey, mismatchType, actual, expected) {
|
|
|
4564
4635
|
}
|
|
4565
4636
|
return false;
|
|
4566
4637
|
}
|
|
4638
|
+
function normalizeHiddenValue(value) {
|
|
4639
|
+
if (!isRenderableAttrValue(value)) return false;
|
|
4640
|
+
if (isString(value)) return value.toLowerCase() === "until-found" ? "until-found" : "";
|
|
4641
|
+
return includeBooleanAttr(value) ? "" : false;
|
|
4642
|
+
}
|
|
4567
4643
|
function toClassSet(str) {
|
|
4568
4644
|
return new Set(str.trim().split(/\s+/));
|
|
4569
4645
|
}
|
|
@@ -5116,7 +5192,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
5116
5192
|
try {
|
|
5117
5193
|
return callWithAsyncErrorHandling(hook, target, type, args);
|
|
5118
5194
|
} finally {
|
|
5119
|
-
|
|
5195
|
+
restoreCurrentInstance(prev);
|
|
5120
5196
|
setActiveSub(prevSub);
|
|
5121
5197
|
}
|
|
5122
5198
|
});
|
|
@@ -5455,7 +5531,8 @@ function createSlots(slots, dynamicSlots) {
|
|
|
5455
5531
|
* Compiler runtime helper for rendering `<slot/>`
|
|
5456
5532
|
* @private
|
|
5457
5533
|
*/
|
|
5458
|
-
function renderSlot(slots, name, props
|
|
5534
|
+
function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
5535
|
+
if (props == null) props = {};
|
|
5459
5536
|
let slot = slots[name];
|
|
5460
5537
|
if (fallback) fallback.__vdom = true;
|
|
5461
5538
|
const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
|
|
@@ -6413,7 +6490,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
6413
6490
|
if (options.el) return vm.$mount(options.el);
|
|
6414
6491
|
else return vm;
|
|
6415
6492
|
}
|
|
6416
|
-
Vue.version = `2.6.14-compat:3.6.0-rc.
|
|
6493
|
+
Vue.version = `2.6.14-compat:3.6.0-rc.3`;
|
|
6417
6494
|
Vue.config = singletonApp.config;
|
|
6418
6495
|
Vue.use = (plugin, ...options) => {
|
|
6419
6496
|
if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
|
|
@@ -7121,8 +7198,9 @@ function renderComponentRoot(instance) {
|
|
|
7121
7198
|
root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
|
|
7122
7199
|
}
|
|
7123
7200
|
if (vnode.transition) {
|
|
7124
|
-
|
|
7125
|
-
|
|
7201
|
+
const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
|
|
7202
|
+
if (!!(process.env.NODE_ENV !== "production") && !isElementRoot(child)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
|
|
7203
|
+
setTransitionHooks(child, vnode.transition);
|
|
7126
7204
|
}
|
|
7127
7205
|
if (!!(process.env.NODE_ENV !== "production") && setRoot) setRoot(root);
|
|
7128
7206
|
else result = root;
|
|
@@ -7182,9 +7260,10 @@ function filterSingleRoot(children, recurse = true) {
|
|
|
7182
7260
|
}
|
|
7183
7261
|
return singleRoot;
|
|
7184
7262
|
}
|
|
7263
|
+
const isFunctionalFallthroughKey = (key) => key === "class" || key === "style" || isOn(key);
|
|
7185
7264
|
const getFunctionalFallthrough = (attrs) => {
|
|
7186
7265
|
let res;
|
|
7187
|
-
for (const key in attrs) if (
|
|
7266
|
+
for (const key in attrs) if (isFunctionalFallthroughKey(key)) (res || (res = {}))[key] = attrs[key];
|
|
7188
7267
|
return res;
|
|
7189
7268
|
};
|
|
7190
7269
|
const filterModelListeners = (attrs, props) => {
|
|
@@ -7416,7 +7495,7 @@ function baseResolveDefault(factory, instance, key) {
|
|
|
7416
7495
|
const prev = setCurrentInstance(instance);
|
|
7417
7496
|
const props = /* @__PURE__ */ toRaw(instance.props);
|
|
7418
7497
|
value = factory.call(isCompatEnabled$1("PROPS_DEFAULT_THIS", instance) ? createPropsDefaultThis(instance, props, key) : null, props);
|
|
7419
|
-
|
|
7498
|
+
restoreCurrentInstance(prev);
|
|
7420
7499
|
return value;
|
|
7421
7500
|
}
|
|
7422
7501
|
const mixinPropsCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -8010,7 +8089,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8010
8089
|
};
|
|
8011
8090
|
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
8012
8091
|
n2.slotScopeIds = slotScopeIds;
|
|
8013
|
-
if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent);
|
|
8092
|
+
if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
|
|
8014
8093
|
else {
|
|
8015
8094
|
const vnodeBeforeMountHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeBeforeMount;
|
|
8016
8095
|
getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense, () => {
|
|
@@ -8369,7 +8448,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8369
8448
|
const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
|
|
8370
8449
|
const { el, type, transition, children, shapeFlag } = vnode;
|
|
8371
8450
|
if (isVaporComponent(type) || type === VaporSlot) {
|
|
8372
|
-
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType);
|
|
8451
|
+
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType, parentSuspense);
|
|
8373
8452
|
return;
|
|
8374
8453
|
}
|
|
8375
8454
|
if (shapeFlag & 6) {
|
|
@@ -8425,7 +8504,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8425
8504
|
}
|
|
8426
8505
|
if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
|
|
8427
8506
|
if (shapeFlag & 256) {
|
|
8428
|
-
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer());
|
|
8507
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
|
|
8429
8508
|
else parentComponent.ctx.deactivate(vnode);
|
|
8430
8509
|
return;
|
|
8431
8510
|
}
|
|
@@ -8435,7 +8514,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8435
8514
|
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
8436
8515
|
if (shapeFlag & 6) if (isVaporComponent(type)) {
|
|
8437
8516
|
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
|
|
8438
|
-
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
8517
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
8439
8518
|
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || dirs) queuePostRenderEffect(() => {
|
|
8440
8519
|
dirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
8441
8520
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
@@ -8452,7 +8531,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8452
8531
|
else if (dynamicChildren && !dynamicChildren.hasOnce && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
|
|
8453
8532
|
else if (type === Fragment && patchFlag & 384 || !optimized && shapeFlag & 16) unmountChildren(children, parentComponent, parentSuspense);
|
|
8454
8533
|
if (type === VaporSlot) {
|
|
8455
|
-
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
8534
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
8456
8535
|
return;
|
|
8457
8536
|
}
|
|
8458
8537
|
if (doRemove) remove(vnode);
|
|
@@ -8753,6 +8832,10 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
8753
8832
|
suspense.activeBranch = pendingBranch;
|
|
8754
8833
|
} else unmount(pendingBranch, parentComponent, suspense);
|
|
8755
8834
|
suspense.deps = 0;
|
|
8835
|
+
for (let i = 0; i < suspense.effects.length; i++) {
|
|
8836
|
+
const effect = suspense.effects[i];
|
|
8837
|
+
if (effect.flags & 8) queuePostFlushCb(effect);
|
|
8838
|
+
}
|
|
8756
8839
|
suspense.effects.length = 0;
|
|
8757
8840
|
suspense.hiddenContainer = createElement("div");
|
|
8758
8841
|
if (isInFallback) {
|
|
@@ -8862,7 +8945,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
8862
8945
|
let hasUnresolvedAncestor = false;
|
|
8863
8946
|
while (parent) {
|
|
8864
8947
|
if (parent.pendingBranch) {
|
|
8865
|
-
parent.effects.push(
|
|
8948
|
+
for (let i = 0; i < effects.length; i++) parent.effects.push(effects[i]);
|
|
8866
8949
|
hasUnresolvedAncestor = true;
|
|
8867
8950
|
break;
|
|
8868
8951
|
}
|
|
@@ -9172,11 +9255,26 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
9172
9255
|
if (shapeFlag & 128) type.normalize(vnode);
|
|
9173
9256
|
} else if (children) vnode.shapeFlag |= isString(children) ? 8 : 16;
|
|
9174
9257
|
if (!!(process.env.NODE_ENV !== "production") && vnode.key !== vnode.key) warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
|
|
9258
|
+
if (!!(process.env.NODE_ENV !== "production") && props && vnode.shapeFlag & 1) {
|
|
9259
|
+
const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
|
|
9260
|
+
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.`);
|
|
9261
|
+
}
|
|
9175
9262
|
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock && (vnode.patchFlag > 0 || shapeFlag & 6) && vnode.patchFlag !== 32) currentBlock.push(vnode);
|
|
9176
9263
|
convertLegacyVModelProps(vnode);
|
|
9177
9264
|
defineLegacyVNodeProperties(vnode);
|
|
9178
9265
|
return vnode;
|
|
9179
9266
|
}
|
|
9267
|
+
/**
|
|
9268
|
+
* dev only
|
|
9269
|
+
* Whether children would actually render something. Empty text and empty
|
|
9270
|
+
* arrays are ignored, mirroring the compiler's `node.children.length` check
|
|
9271
|
+
* for `v-html` / `v-text`.
|
|
9272
|
+
*/
|
|
9273
|
+
function hasContentChildren(children) {
|
|
9274
|
+
if (isString(children)) return children !== "";
|
|
9275
|
+
if (isArray(children)) return children.length > 0;
|
|
9276
|
+
return false;
|
|
9277
|
+
}
|
|
9180
9278
|
const createVNode = !!(process.env.NODE_ENV !== "production") ? createVNodeWithArgsTransform : _createVNode;
|
|
9181
9279
|
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
|
|
9182
9280
|
if (!type || type === NULL_DYNAMIC_COMPONENT) {
|
|
@@ -9407,6 +9505,16 @@ const setCurrentInstance = (instance, scope = instance !== null ? instance.scope
|
|
|
9407
9505
|
simpleSetCurrentInstance(instance);
|
|
9408
9506
|
}
|
|
9409
9507
|
};
|
|
9508
|
+
/**
|
|
9509
|
+
* Restores a snapshot returned by {@link setCurrentInstance}. Unlike calling
|
|
9510
|
+
* `setCurrentInstance(...prev)`, an `undefined` saved scope is restored
|
|
9511
|
+
* verbatim instead of re-triggering the `instance.scope` default.
|
|
9512
|
+
* @internal
|
|
9513
|
+
*/
|
|
9514
|
+
const restoreCurrentInstance = (prev) => {
|
|
9515
|
+
setCurrentScope(prev[1]);
|
|
9516
|
+
simpleSetCurrentInstance(prev[0]);
|
|
9517
|
+
};
|
|
9410
9518
|
const internalOptions = [
|
|
9411
9519
|
"ce",
|
|
9412
9520
|
"type",
|
|
@@ -9567,7 +9675,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
9567
9675
|
const setupResult = callWithErrorHandling(setup, instance, 0, [!!(process.env.NODE_ENV !== "production") ? /* @__PURE__ */ shallowReadonly(instance.props) : instance.props, setupContext]);
|
|
9568
9676
|
const isAsyncSetup = isPromise(setupResult);
|
|
9569
9677
|
setActiveSub(prevSub);
|
|
9570
|
-
|
|
9678
|
+
restoreCurrentInstance(prev);
|
|
9571
9679
|
if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) markAsyncBoundary(instance);
|
|
9572
9680
|
if (isAsyncSetup) {
|
|
9573
9681
|
const unsetCurrentInstance = () => {
|
|
@@ -9575,7 +9683,12 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
9575
9683
|
};
|
|
9576
9684
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
9577
9685
|
if (isSSR) return setupResult.then((resolvedResult) => {
|
|
9578
|
-
|
|
9686
|
+
setInSSRSetupState(true);
|
|
9687
|
+
try {
|
|
9688
|
+
handleSetupResult(instance, resolvedResult, isSSR);
|
|
9689
|
+
} finally {
|
|
9690
|
+
setInSSRSetupState(false);
|
|
9691
|
+
}
|
|
9579
9692
|
}).catch((e) => {
|
|
9580
9693
|
handleError(e, instance, 0);
|
|
9581
9694
|
});
|
|
@@ -9641,7 +9754,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
9641
9754
|
applyOptions(instance);
|
|
9642
9755
|
} finally {
|
|
9643
9756
|
setActiveSub(prevSub);
|
|
9644
|
-
|
|
9757
|
+
restoreCurrentInstance(prevInstance);
|
|
9645
9758
|
}
|
|
9646
9759
|
}
|
|
9647
9760
|
if (!!(process.env.NODE_ENV !== "production") && !Component.render && instance.render === NOOP && !isSSR) if (!compile$1 && Component.template)
|
|
@@ -9961,7 +10074,7 @@ function isMemoSame(cached, memo) {
|
|
|
9961
10074
|
}
|
|
9962
10075
|
//#endregion
|
|
9963
10076
|
//#region packages/runtime-core/src/index.ts
|
|
9964
|
-
const version = "3.6.0-rc.
|
|
10077
|
+
const version = "3.6.0-rc.3";
|
|
9965
10078
|
const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
|
|
9966
10079
|
/**
|
|
9967
10080
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -10751,7 +10864,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
10751
10864
|
if (!this._instance) if (this._resolved) this._mountComponent(this._def);
|
|
10752
10865
|
else if (parent && parent._pendingResolve) this._pendingResolve = parent._pendingResolve.then(() => {
|
|
10753
10866
|
this._pendingResolve = void 0;
|
|
10754
|
-
this._resolveDef();
|
|
10867
|
+
if (this.isConnected) return this._resolveDef();
|
|
10755
10868
|
});
|
|
10756
10869
|
else this._resolveDef();
|
|
10757
10870
|
}
|
|
@@ -10787,7 +10900,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
10787
10900
|
* resolve inner component definition (handle possible async component)
|
|
10788
10901
|
*/
|
|
10789
10902
|
_resolveDef() {
|
|
10790
|
-
if (this._pendingResolve) return;
|
|
10903
|
+
if (this._pendingResolve) return this._pendingResolve;
|
|
10791
10904
|
for (let i = 0; i < this.attributes.length; i++) this._setAttr(this.attributes[i].name);
|
|
10792
10905
|
this._ob = new MutationObserver(this._processMutations.bind(this));
|
|
10793
10906
|
this._ob.observe(this, { attributes: true });
|
|
@@ -10817,6 +10930,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
10817
10930
|
this._def = def;
|
|
10818
10931
|
resolve(def);
|
|
10819
10932
|
});
|
|
10933
|
+
return this._pendingResolve;
|
|
10820
10934
|
} else resolve(this._def);
|
|
10821
10935
|
}
|
|
10822
10936
|
_mountComponent(def) {
|
|
@@ -10855,14 +10969,17 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
10855
10969
|
const { props } = def;
|
|
10856
10970
|
const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
|
|
10857
10971
|
for (const key of Object.keys(this)) if (key[0] !== "_" && declaredPropKeys.includes(key)) this._setProp(key, this[key]);
|
|
10858
|
-
for (const key of declaredPropKeys.map(camelize))
|
|
10859
|
-
|
|
10860
|
-
|
|
10861
|
-
|
|
10862
|
-
|
|
10863
|
-
|
|
10864
|
-
|
|
10865
|
-
|
|
10972
|
+
for (const key of declaredPropKeys.map(camelize)) {
|
|
10973
|
+
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.`);
|
|
10974
|
+
Object.defineProperty(this, key, {
|
|
10975
|
+
get() {
|
|
10976
|
+
return this._getProp(key);
|
|
10977
|
+
},
|
|
10978
|
+
set(val) {
|
|
10979
|
+
this._setProp(key, val, true, !this._patching);
|
|
10980
|
+
}
|
|
10981
|
+
});
|
|
10982
|
+
}
|
|
10866
10983
|
}
|
|
10867
10984
|
_setAttr(key) {
|
|
10868
10985
|
if (key.startsWith("data-v-")) return;
|
|
@@ -11282,13 +11399,22 @@ function onCompositionEnd(e) {
|
|
|
11282
11399
|
}
|
|
11283
11400
|
}
|
|
11284
11401
|
const assignKey = Symbol("_assign");
|
|
11402
|
+
const initialValueKey = Symbol("_initialValue");
|
|
11285
11403
|
const vModelText = {
|
|
11286
11404
|
created(el, { modifiers: { lazy, trim, number } }, vnode) {
|
|
11405
|
+
if (el.parentNode) {
|
|
11406
|
+
if (el.type === "text") el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
|
|
11407
|
+
else if (el.type === "textarea") el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
|
|
11408
|
+
}
|
|
11287
11409
|
el[assignKey] = getModelAssigner(vnode);
|
|
11288
11410
|
vModelTextInit(el, trim, number || !!(vnode.props && vnode.props.type === "number"), lazy);
|
|
11289
11411
|
},
|
|
11290
|
-
mounted(el, { value }) {
|
|
11291
|
-
|
|
11412
|
+
mounted(el, { value, modifiers: { trim, number } }) {
|
|
11413
|
+
const newValue = value == null ? "" : value;
|
|
11414
|
+
const initialValue = el[initialValueKey];
|
|
11415
|
+
delete el[initialValueKey];
|
|
11416
|
+
if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) el[assignKey](castValue(el.value, trim, number));
|
|
11417
|
+
else el.value = newValue;
|
|
11292
11418
|
},
|
|
11293
11419
|
beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
|
|
11294
11420
|
el[assignKey] = getModelAssigner(vnode);
|
|
@@ -11705,7 +11831,9 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
11705
11831
|
invokeDirectiveHook: () => invokeDirectiveHook,
|
|
11706
11832
|
isAsyncWrapper: () => isAsyncWrapper,
|
|
11707
11833
|
isEmitListener: () => isEmitListener,
|
|
11834
|
+
isFunctionalFallthroughKey: () => isFunctionalFallthroughKey,
|
|
11708
11835
|
isHydrating: () => isHydrating,
|
|
11836
|
+
isHydratingEnabled: () => isHydratingEnabled,
|
|
11709
11837
|
isKeepAlive: () => isKeepAlive,
|
|
11710
11838
|
isMapEqual: () => isMapEqual,
|
|
11711
11839
|
isMemoSame: () => isMemoSame,
|
|
@@ -11764,12 +11892,15 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
11764
11892
|
performTransitionLeave: () => performTransitionLeave,
|
|
11765
11893
|
popScopeId: () => popScopeId,
|
|
11766
11894
|
popWarningContext: () => popWarningContext,
|
|
11895
|
+
prepareTransitionLeave: () => prepareTransitionLeave,
|
|
11896
|
+
prepareTransitionSwitch: () => prepareTransitionSwitch,
|
|
11767
11897
|
provide: () => provide,
|
|
11768
11898
|
proxyRefs: () => proxyRefs,
|
|
11769
11899
|
pushScopeId: () => pushScopeId,
|
|
11770
11900
|
pushWarningContext: () => pushWarningContext,
|
|
11771
11901
|
queueJob: () => queueJob,
|
|
11772
11902
|
queuePostFlushCb: () => queuePostFlushCb,
|
|
11903
|
+
queuePostRenderEffect: () => queuePostRenderEffect,
|
|
11773
11904
|
reactive: () => reactive,
|
|
11774
11905
|
readonly: () => readonly,
|
|
11775
11906
|
ref: () => ref,
|
|
@@ -11785,8 +11916,10 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
11785
11916
|
resolveFilter: () => resolveFilter,
|
|
11786
11917
|
resolvePropValue: () => resolvePropValue,
|
|
11787
11918
|
resolveTeleportTarget: () => resolveTarget,
|
|
11919
|
+
resolveTransitionChild: () => resolveTransitionChild,
|
|
11788
11920
|
resolveTransitionHooks: () => resolveTransitionHooks,
|
|
11789
11921
|
resolveTransitionProps: () => resolveTransitionProps,
|
|
11922
|
+
restoreCurrentInstance: () => restoreCurrentInstance,
|
|
11790
11923
|
setBlockTracking: () => setBlockTracking,
|
|
11791
11924
|
setCurrentInstance: () => setCurrentInstance,
|
|
11792
11925
|
setCurrentRenderingInstance: () => setCurrentRenderingInstance,
|
|
@@ -14045,7 +14178,7 @@ function getSelfName(filename) {
|
|
|
14045
14178
|
const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/);
|
|
14046
14179
|
return nameMatch ? capitalize(camelize(nameMatch[1])) : null;
|
|
14047
14180
|
}
|
|
14048
|
-
function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false,
|
|
14181
|
+
function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
|
|
14049
14182
|
const context = {
|
|
14050
14183
|
filename,
|
|
14051
14184
|
selfName: getSelfName(filename),
|
|
@@ -14067,7 +14200,6 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
|
|
|
14067
14200
|
bindingMetadata,
|
|
14068
14201
|
inline,
|
|
14069
14202
|
isTS,
|
|
14070
|
-
eventDelegation,
|
|
14071
14203
|
onError,
|
|
14072
14204
|
onWarn,
|
|
14073
14205
|
compatConfig,
|
|
@@ -14883,15 +15015,22 @@ const transformFor = createStructuralDirectiveTransform("for", (node, dir, conte
|
|
|
14883
15015
|
else {
|
|
14884
15016
|
childBlock = children[0].codegenNode;
|
|
14885
15017
|
if (isTemplate && keyProperty) injectProp(childBlock, keyProperty, context);
|
|
14886
|
-
|
|
15018
|
+
const shouldUseBlock = !isStableFragment || childBlock.isBlockRequired === true;
|
|
15019
|
+
if (childBlock.isBlock !== shouldUseBlock) if (childBlock.isBlock) {
|
|
14887
15020
|
removeHelper(OPEN_BLOCK);
|
|
14888
15021
|
removeHelper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
|
|
14889
15022
|
} else removeHelper(getVNodeHelper(context.inSSR, childBlock.isComponent));
|
|
14890
|
-
childBlock.isBlock =
|
|
15023
|
+
childBlock.isBlock = shouldUseBlock;
|
|
14891
15024
|
if (childBlock.isBlock) {
|
|
14892
15025
|
helper(OPEN_BLOCK);
|
|
14893
15026
|
helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
|
|
14894
|
-
} else
|
|
15027
|
+
} else {
|
|
15028
|
+
helper(getVNodeHelper(context.inSSR, childBlock.isComponent));
|
|
15029
|
+
if (childBlock.needsPatch) {
|
|
15030
|
+
var _childBlock$patchFlag;
|
|
15031
|
+
childBlock.patchFlag = ((_childBlock$patchFlag = childBlock.patchFlag) !== null && _childBlock$patchFlag !== void 0 ? _childBlock$patchFlag : 0) | 512;
|
|
15032
|
+
}
|
|
15033
|
+
}
|
|
14895
15034
|
}
|
|
14896
15035
|
if (memo) {
|
|
14897
15036
|
const loop = createFunctionExpression(createForLoopParams(forNode.parseResult, [createSimpleExpression(`_cached`)]));
|
|
@@ -15117,12 +15256,16 @@ const transformElement = (node, context) => {
|
|
|
15117
15256
|
let vnodeDynamicProps;
|
|
15118
15257
|
let dynamicPropNames;
|
|
15119
15258
|
let vnodeDirectives;
|
|
15259
|
+
let needsPatch = false;
|
|
15260
|
+
let isBlockRequired = false;
|
|
15120
15261
|
let shouldUseBlock = isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && (tag === "svg" || tag === "foreignObject" || tag === "math");
|
|
15121
15262
|
if (props.length > 0) {
|
|
15122
15263
|
const propsBuildResult = buildProps(node, context, void 0, isComponent, isDynamicComponent);
|
|
15123
15264
|
vnodeProps = propsBuildResult.props;
|
|
15124
15265
|
patchFlag = propsBuildResult.patchFlag;
|
|
15125
15266
|
dynamicPropNames = propsBuildResult.dynamicPropNames;
|
|
15267
|
+
needsPatch = propsBuildResult.needsPatch;
|
|
15268
|
+
isBlockRequired = propsBuildResult.isBlockRequired;
|
|
15126
15269
|
const directives = propsBuildResult.directives;
|
|
15127
15270
|
vnodeDirectives = directives && directives.length ? createArrayExpression(directives.map((dir) => buildDirectiveArgs(dir, context))) : void 0;
|
|
15128
15271
|
if (propsBuildResult.shouldUseBlock) shouldUseBlock = true;
|
|
@@ -15151,7 +15294,10 @@ const transformElement = (node, context) => {
|
|
|
15151
15294
|
} else vnodeChildren = node.children;
|
|
15152
15295
|
}
|
|
15153
15296
|
if (dynamicPropNames && dynamicPropNames.length) vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
|
|
15154
|
-
node.codegenNode = createVNodeCall(context, vnodeTag, vnodeProps, vnodeChildren, patchFlag === 0 ? void 0 : patchFlag, vnodeDynamicProps, vnodeDirectives, !!shouldUseBlock, false, isComponent, node.loc);
|
|
15297
|
+
const vnodeCall = node.codegenNode = createVNodeCall(context, vnodeTag, vnodeProps, vnodeChildren, patchFlag === 0 ? void 0 : patchFlag, vnodeDynamicProps, vnodeDirectives, !!shouldUseBlock, false, isComponent, node.loc);
|
|
15298
|
+
needsPatch = needsPatch && (patchFlag === 0 || patchFlag === 32);
|
|
15299
|
+
if (needsPatch) vnodeCall.needsPatch = true;
|
|
15300
|
+
if (isBlockRequired) vnodeCall.isBlockRequired = true;
|
|
15155
15301
|
};
|
|
15156
15302
|
};
|
|
15157
15303
|
function resolveComponentType(node, context, ssr = false) {
|
|
@@ -15185,6 +15331,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
15185
15331
|
const runtimeDirectives = [];
|
|
15186
15332
|
const hasChildren = children.length > 0;
|
|
15187
15333
|
let shouldUseBlock = false;
|
|
15334
|
+
let isBlockRequired = false;
|
|
15188
15335
|
let patchFlag = 0;
|
|
15189
15336
|
let hasRef = false;
|
|
15190
15337
|
let hasClassBinding = false;
|
|
@@ -15209,12 +15356,12 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
15209
15356
|
const isEventHandler = isOn(name);
|
|
15210
15357
|
if (isEventHandler && (!isComponent || isDynamicComponent) && name.toLowerCase() !== "onclick" && name !== "onUpdate:modelValue" && !isReservedProp(name)) hasHydrationEventBinding = true;
|
|
15211
15358
|
if (isEventHandler && isReservedProp(name)) hasVnodeHook = true;
|
|
15359
|
+
if (name === "ref") hasRef = true;
|
|
15212
15360
|
if (isEventHandler && value.type === 14) value = value.arguments[0];
|
|
15213
15361
|
if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) return;
|
|
15214
|
-
if (name === "
|
|
15215
|
-
else if (name === "class") hasClassBinding = true;
|
|
15362
|
+
if (name === "class") hasClassBinding = true;
|
|
15216
15363
|
else if (name === "style") hasStyleBinding = true;
|
|
15217
|
-
else if (name !== "key" && !dynamicPropNames.includes(name)) dynamicPropNames.push(name);
|
|
15364
|
+
else if (name !== "ref" && name !== "key" && !dynamicPropNames.includes(name)) dynamicPropNames.push(name);
|
|
15218
15365
|
if (isComponent && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) dynamicPropNames.push(name);
|
|
15219
15366
|
} else hasDynamicKeys = true;
|
|
15220
15367
|
};
|
|
@@ -15240,7 +15387,11 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
15240
15387
|
if (name === "once" || name === "memo") continue;
|
|
15241
15388
|
if (name === "is" || isVBind && isStaticArgOf(arg, "is") && (isComponentTag(tag) || isCompatEnabled("COMPILER_IS_ON_ELEMENT", context))) continue;
|
|
15242
15389
|
if (isVOn && ssr) continue;
|
|
15243
|
-
if (isVBind && isStaticArgOf(arg, "key")
|
|
15390
|
+
if (isVBind && isStaticArgOf(arg, "key")) shouldUseBlock = true;
|
|
15391
|
+
if (isVOn && hasChildren && arg && isStaticExp(arg) && camelize(arg.content) === "vue:beforeUpdate") {
|
|
15392
|
+
shouldUseBlock = true;
|
|
15393
|
+
isBlockRequired = true;
|
|
15394
|
+
}
|
|
15244
15395
|
if (isVBind && isStaticArgOf(arg, "ref")) pushRefVForMarker();
|
|
15245
15396
|
if (!arg && (isVBind || isVOn)) {
|
|
15246
15397
|
hasDynamicKeys = true;
|
|
@@ -15284,7 +15435,10 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
15284
15435
|
}
|
|
15285
15436
|
} else if (!isBuiltInDirective(name)) {
|
|
15286
15437
|
runtimeDirectives.push(prop);
|
|
15287
|
-
if (hasChildren)
|
|
15438
|
+
if (hasChildren) {
|
|
15439
|
+
shouldUseBlock = true;
|
|
15440
|
+
isBlockRequired = true;
|
|
15441
|
+
}
|
|
15288
15442
|
}
|
|
15289
15443
|
}
|
|
15290
15444
|
}
|
|
@@ -15301,7 +15455,8 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
15301
15455
|
if (dynamicPropNames.length) patchFlag |= 8;
|
|
15302
15456
|
if (hasHydrationEventBinding) patchFlag |= 32;
|
|
15303
15457
|
}
|
|
15304
|
-
|
|
15458
|
+
const needsPatch = (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0);
|
|
15459
|
+
if (!shouldUseBlock && needsPatch) patchFlag |= 512;
|
|
15305
15460
|
if (!context.inSSR && propsExpression) switch (propsExpression.type) {
|
|
15306
15461
|
case 15:
|
|
15307
15462
|
let classKeyIndex = -1;
|
|
@@ -15331,7 +15486,9 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
15331
15486
|
directives: runtimeDirectives,
|
|
15332
15487
|
patchFlag,
|
|
15333
15488
|
dynamicPropNames,
|
|
15334
|
-
shouldUseBlock
|
|
15489
|
+
shouldUseBlock,
|
|
15490
|
+
needsPatch,
|
|
15491
|
+
isBlockRequired
|
|
15335
15492
|
};
|
|
15336
15493
|
}
|
|
15337
15494
|
function dedupeProperties(properties) {
|
|
@@ -15998,6 +16155,14 @@ const resolveModifiers = (key, modifiers, context, loc) => {
|
|
|
15998
16155
|
const eventOptionModifiers = [];
|
|
15999
16156
|
for (let i = 0; i < modifiers.length; i++) {
|
|
16000
16157
|
const modifier = modifiers[i].content;
|
|
16158
|
+
if (modifier === "delegate") {
|
|
16159
|
+
if (context) {
|
|
16160
|
+
const error = /* @__PURE__ */ new SyntaxError(`.delegate modifier is only supported in Vapor components.`);
|
|
16161
|
+
error.loc = modifiers[i].loc;
|
|
16162
|
+
context.onWarn(error);
|
|
16163
|
+
}
|
|
16164
|
+
continue;
|
|
16165
|
+
}
|
|
16001
16166
|
if (modifier === "native" && context && checkCompatEnabled("COMPILER_V_ON_NATIVE", context, loc)) eventOptionModifiers.push(modifier);
|
|
16002
16167
|
else if (isEventOptionModifier(modifier)) eventOptionModifiers.push(modifier);
|
|
16003
16168
|
else {
|
|
@@ -16360,4 +16525,4 @@ Vue.compile = compileToFunction;
|
|
|
16360
16525
|
var esm_index_default = Vue;
|
|
16361
16526
|
const configureCompat = Vue.configureCompat;
|
|
16362
16527
|
//#endregion
|
|
16363
|
-
export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MismatchTypes, MoveType, NULL_DYNAMIC_COMPONENT, ReactiveEffect, SchedulerJobFlags, Static, Suspense, Teleport, Text, TrackOpTypes, Transition, TransitionGroup, TransitionPropsValidators, TriggerOpTypes, VaporSlot, VueElement, VueElementBase, activate, assertNumber, baseApplyTranslation, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, baseUseCssVars, callPendingCbs, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, checkTransitionMode, cloneVNode, compatUtils, computed, configureCompat, createApp, createAppAPI, createAsyncComponentContext, createBlock, createCanSetSetupRefChecker, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createInternalObject, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, currentInstance, customRef, deactivate, esm_index_default as default, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, devtoolsComponentAdded, effect, effectScope, endMeasure, ensureHydrationRenderer, ensureRenderer, ensureValidVNode, ensureVaporSlotFallback, expose, flushOnAppMount, forceReflow, getAttributeMismatch, getComponentName, getCurrentInstance, getCurrentScope, getCurrentWatcher, getFunctionalFallthrough, getInheritedScopeIds, getTransitionRawChildren, guardReactiveProps, h, handleError, handleMovedChildren, hasCSSTransform, hasInjectionContext, hydrate, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initDirectivesForSSR, initFeatureFlags, inject, invalidateMount, invokeDirectiveHook, isAsyncWrapper, isEmitListener, isHydrating, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isSetEqual, isShallow, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isVNode, isValidHtmlOrSvgAttribute, knownTemplateRefs, leaveCbKey, logMismatchError, markAsyncBoundary, markRaw, matches, mergeDefaults, mergeModels, mergeProps, nextTick, nextUid, nodeOps, normalizeClass, normalizeContainer, normalizeProps, normalizeRef, normalizeStyle, normalizeVNode, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, parseEventName, patchProp, patchStyle, performAsyncHydrate, performTransitionEnter, performTransitionLeave, popScopeId, popWarningContext, provide, proxyRefs, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, reactive, readonly, ref, registerHMR, registerRuntimeCompiler, render, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionHooks, resolveTransitionProps, setBlockTracking, setCurrentInstance, setCurrentRenderingInstance, setDevtoolsHook, setIsHydratingEnabled, setRef, setTransitionHooks, setVarsOnNode, shallowReactive, shallowReadonly, shallowRef, shouldSetAsProp, shouldSetAsPropForVueCE, shouldUpdateComponent, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, stop, svgNS, toClassSet, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toStyleMap, toValue, transformVNodeArgs, triggerRef, unref, unregisterHMR, unsafeToTrustedHTML, useAsyncComponentState, useAttrs, useCssModule, useCssVars, useHost, useId, useInstanceOption, useModel, useSSRContext, useShadowRoot, useSlots, useTemplateRef, useTransitionState, vModelCheckbox, vModelCheckboxInit, vModelCheckboxUpdate, vModelDynamic, getValue as vModelGetValue, vModelRadio, vModelSelect, vModelSelectInit, vModelSetSelected, vModelText, vModelTextInit, vModelTextUpdate, vShow, vShowHidden, vShowOriginalDisplay, validateComponentName, validateProps, version, warn, warnExtraneousAttributes, warnPropMismatch, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId, xlinkNS };
|
|
16528
|
+
export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MismatchTypes, MoveType, NULL_DYNAMIC_COMPONENT, ReactiveEffect, SchedulerJobFlags, Static, Suspense, Teleport, Text, TrackOpTypes, Transition, TransitionGroup, TransitionPropsValidators, TriggerOpTypes, VaporSlot, VueElement, VueElementBase, activate, assertNumber, baseApplyTranslation, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, baseUseCssVars, callPendingCbs, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, checkTransitionMode, cloneVNode, compatUtils, computed, configureCompat, createApp, createAppAPI, createAsyncComponentContext, createBlock, createCanSetSetupRefChecker, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createInternalObject, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, currentInstance, customRef, deactivate, esm_index_default as default, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, devtoolsComponentAdded, effect, effectScope, endMeasure, ensureHydrationRenderer, ensureRenderer, ensureValidVNode, ensureVaporSlotFallback, expose, flushOnAppMount, forceReflow, getAttributeMismatch, getComponentName, getCurrentInstance, getCurrentScope, getCurrentWatcher, getFunctionalFallthrough, getInheritedScopeIds, getTransitionRawChildren, guardReactiveProps, h, handleError, handleMovedChildren, hasCSSTransform, hasInjectionContext, hydrate, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initDirectivesForSSR, initFeatureFlags, inject, invalidateMount, invokeDirectiveHook, isAsyncWrapper, isEmitListener, isFunctionalFallthroughKey, isHydrating, isHydratingEnabled, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isSetEqual, isShallow, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isVNode, isValidHtmlOrSvgAttribute, knownTemplateRefs, leaveCbKey, logMismatchError, markAsyncBoundary, markRaw, matches, mergeDefaults, mergeModels, mergeProps, nextTick, nextUid, nodeOps, normalizeClass, normalizeContainer, normalizeProps, normalizeRef, normalizeStyle, normalizeVNode, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, parseEventName, patchProp, patchStyle, performAsyncHydrate, performTransitionEnter, performTransitionLeave, popScopeId, popWarningContext, prepareTransitionLeave, prepareTransitionSwitch, provide, proxyRefs, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, queuePostRenderEffect, reactive, readonly, ref, registerHMR, registerRuntimeCompiler, render, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionChild, resolveTransitionHooks, resolveTransitionProps, restoreCurrentInstance, setBlockTracking, setCurrentInstance, setCurrentRenderingInstance, setDevtoolsHook, setIsHydratingEnabled, setRef, setTransitionHooks, setVarsOnNode, shallowReactive, shallowReadonly, shallowRef, shouldSetAsProp, shouldSetAsPropForVueCE, shouldUpdateComponent, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, stop, svgNS, toClassSet, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toStyleMap, toValue, transformVNodeArgs, triggerRef, unref, unregisterHMR, unsafeToTrustedHTML, useAsyncComponentState, useAttrs, useCssModule, useCssVars, useHost, useId, useInstanceOption, useModel, useSSRContext, useShadowRoot, useSlots, useTemplateRef, useTransitionState, vModelCheckbox, vModelCheckboxInit, vModelCheckboxUpdate, vModelDynamic, getValue as vModelGetValue, vModelRadio, vModelSelect, vModelSelectInit, vModelSetSelected, vModelText, vModelTextInit, vModelTextUpdate, vShow, vShowHidden, vShowOriginalDisplay, validateComponentName, validateProps, version, warn, warnExtraneousAttributes, warnPropMismatch, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId, xlinkNS };
|