@vue/compat 3.6.0-rc.2 → 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 +26 -3
- package/dist/vue.cjs.js +209 -79
- package/dist/vue.cjs.prod.js +175 -69
- package/dist/vue.esm-browser.js +207 -78
- package/dist/vue.esm-browser.prod.js +7 -6
- package/dist/vue.esm-bundler.js +226 -80
- package/dist/vue.global.js +207 -78
- package/dist/vue.global.prod.js +7 -6
- package/dist/vue.runtime.esm-browser.js +207 -78
- package/dist/vue.runtime.esm-browser.prod.js +7 -6
- package/dist/vue.runtime.esm-bundler.js +226 -80
- package/dist/vue.runtime.global.js +207 -78
- package/dist/vue.runtime.global.prod.js +7 -6
- package/package.json +3 -3
package/dist/vue.cjs.prod.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
|
**/
|
|
@@ -255,7 +255,7 @@ const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
|
|
|
255
255
|
/**
|
|
256
256
|
* The full list is needed during SSR to produce the correct initial markup.
|
|
257
257
|
*/
|
|
258
|
-
const isBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,
|
|
258
|
+
const isBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
|
|
259
259
|
/**
|
|
260
260
|
* Boolean attributes should be included if the value is truthy or ''.
|
|
261
261
|
* e.g. `<select multiple>` compiles to `{ multiple: '' }`
|
|
@@ -2335,7 +2335,7 @@ function queueFlush() {
|
|
|
2335
2335
|
function queuePostFlushCb(jobs, id = Infinity) {
|
|
2336
2336
|
if (!isArray(jobs)) if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
|
|
2337
2337
|
else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
|
|
2338
|
-
else for (
|
|
2338
|
+
else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
|
|
2339
2339
|
queueFlush();
|
|
2340
2340
|
}
|
|
2341
2341
|
function flushPreFlushCbs(instance, seen) {
|
|
@@ -2354,7 +2354,7 @@ function flushPreFlushCbs(instance, seen) {
|
|
|
2354
2354
|
function flushPostFlushCbs(seen) {
|
|
2355
2355
|
if (postJobs.length) {
|
|
2356
2356
|
if (activePostJobs) {
|
|
2357
|
-
activePostJobs.push(
|
|
2357
|
+
for (let i = 0; i < postJobs.length; i++) activePostJobs.push(postJobs[i]);
|
|
2358
2358
|
postJobs.length = 0;
|
|
2359
2359
|
return;
|
|
2360
2360
|
}
|
|
@@ -3075,48 +3075,15 @@ const BaseTransitionImpl = {
|
|
|
3075
3075
|
setup(props, { slots }) {
|
|
3076
3076
|
const instance = getCurrentInstance();
|
|
3077
3077
|
const state = useTransitionState();
|
|
3078
|
+
let resumeAfterLeave;
|
|
3078
3079
|
return () => {
|
|
3079
|
-
const
|
|
3080
|
-
const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
|
|
3080
|
+
const child = resolveTransitionChild(slots.default && slots.default(), !!instance.subTree);
|
|
3081
3081
|
if (!child) return;
|
|
3082
3082
|
const rawProps = /* @__PURE__ */ toRaw(props);
|
|
3083
3083
|
const { mode } = rawProps;
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
let enterHooks = resolveTransitionHooks(innerChild, rawProps, state, instance, (hooks) => enterHooks = hooks);
|
|
3088
|
-
if (innerChild.type !== Comment) setTransitionHooks(innerChild, enterHooks);
|
|
3089
|
-
let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
|
|
3090
|
-
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
|
|
3091
|
-
let leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance);
|
|
3092
|
-
setTransitionHooks(oldInnerChild, leavingHooks);
|
|
3093
|
-
if (mode === "out-in" && innerChild.type !== Comment) {
|
|
3094
|
-
state.isLeaving = true;
|
|
3095
|
-
leavingHooks.afterLeave = () => {
|
|
3096
|
-
state.isLeaving = false;
|
|
3097
|
-
if (!(instance.job.flags & 4)) instance.update();
|
|
3098
|
-
delete leavingHooks.afterLeave;
|
|
3099
|
-
oldInnerChild = void 0;
|
|
3100
|
-
};
|
|
3101
|
-
return emptyPlaceholder(child);
|
|
3102
|
-
} else if (mode === "in-out" && innerChild.type !== Comment) leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
3103
|
-
const leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild);
|
|
3104
|
-
leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
|
|
3105
|
-
el[leaveCbKey] = () => {
|
|
3106
|
-
earlyRemove();
|
|
3107
|
-
el[leaveCbKey] = void 0;
|
|
3108
|
-
delete enterHooks.delayedLeave;
|
|
3109
|
-
oldInnerChild = void 0;
|
|
3110
|
-
};
|
|
3111
|
-
enterHooks.delayedLeave = () => {
|
|
3112
|
-
delayedLeave();
|
|
3113
|
-
delete enterHooks.delayedLeave;
|
|
3114
|
-
oldInnerChild = void 0;
|
|
3115
|
-
};
|
|
3116
|
-
};
|
|
3117
|
-
else oldInnerChild = void 0;
|
|
3118
|
-
} else if (oldInnerChild) oldInnerChild = void 0;
|
|
3119
|
-
return child;
|
|
3084
|
+
return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
|
|
3085
|
+
if (!(instance.job.flags & 4)) instance.update();
|
|
3086
|
+
}) : NOOP);
|
|
3120
3087
|
};
|
|
3121
3088
|
}
|
|
3122
3089
|
};
|
|
@@ -3254,15 +3221,91 @@ function getInnerChild$1(vnode) {
|
|
|
3254
3221
|
if (shapeFlag & 32 && isFunction(children.default)) return children.default();
|
|
3255
3222
|
}
|
|
3256
3223
|
}
|
|
3224
|
+
function resolveTransitionChild(children, renderEmpty = false) {
|
|
3225
|
+
const branches = children && getTransitionRawChildren(children, true);
|
|
3226
|
+
return branches && branches.length ? findNonCommentChild(branches) : renderEmpty ? createCommentVNode() : void 0;
|
|
3227
|
+
}
|
|
3228
|
+
/**
|
|
3229
|
+
* @internal
|
|
3230
|
+
*/
|
|
3231
|
+
function prepareTransitionSwitch(previous, next, props, state, instance, resumeAfterLeave, delayedLeaveSource) {
|
|
3232
|
+
if (state.isLeaving) return emptyPlaceholder(next);
|
|
3233
|
+
const nextInner = getInnerChild$1(next);
|
|
3234
|
+
if (!nextInner) return emptyPlaceholder(next);
|
|
3235
|
+
let enterHooks = resolveTransitionHooks(nextInner, props, state, instance, (hooks) => {
|
|
3236
|
+
if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
|
|
3237
|
+
enterHooks = hooks;
|
|
3238
|
+
});
|
|
3239
|
+
if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
|
|
3240
|
+
if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
|
|
3241
|
+
const mode = props.mode;
|
|
3242
|
+
const previousInner = previous && getInnerChild$1(previous);
|
|
3243
|
+
if (previous && previousInner && previousInner.type !== Comment && !isSameVNodeType(previousInner, nextInner) && (!previous.component || recursiveGetSubtree(previous.component).type !== Comment)) {
|
|
3244
|
+
const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
|
|
3245
|
+
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);
|
|
3246
|
+
}
|
|
3247
|
+
return next;
|
|
3248
|
+
}
|
|
3249
|
+
function forwardDelayedLeave(hooks, source) {
|
|
3250
|
+
const delayedLeave = source && source.delayedLeave;
|
|
3251
|
+
if (!delayedLeave) return;
|
|
3252
|
+
hooks.delayedLeave = () => {
|
|
3253
|
+
if (source.delayedLeave === delayedLeave) delayedLeave();
|
|
3254
|
+
delete hooks.delayedLeave;
|
|
3255
|
+
};
|
|
3256
|
+
}
|
|
3257
|
+
function prepareLeavingTransitionHooks(previousInner, props, state, instance) {
|
|
3258
|
+
return setTransitionHooks(previousInner, resolveTransitionHooks(previousInner, props, state, instance));
|
|
3259
|
+
}
|
|
3260
|
+
function applyTransitionModeSwitch(leavingVNode, leavingHooks, getEnterHooks, props, state, resumeAfterLeave) {
|
|
3261
|
+
if (props.mode === "out-in") {
|
|
3262
|
+
state.isLeaving = true;
|
|
3263
|
+
leavingHooks.afterLeave = () => {
|
|
3264
|
+
state.isLeaving = false;
|
|
3265
|
+
resumeAfterLeave();
|
|
3266
|
+
delete leavingHooks.afterLeave;
|
|
3267
|
+
};
|
|
3268
|
+
return true;
|
|
3269
|
+
} else if (props.mode === "in-out" && getEnterHooks) {
|
|
3270
|
+
let delayedLeavingVNode = leavingVNode;
|
|
3271
|
+
leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
3272
|
+
const enterHooks = getEnterHooks();
|
|
3273
|
+
if (!enterHooks) {
|
|
3274
|
+
delayedLeave();
|
|
3275
|
+
return;
|
|
3276
|
+
}
|
|
3277
|
+
const vnode = delayedLeavingVNode;
|
|
3278
|
+
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
3279
|
+
leavingVNodesCache[String(vnode.key)] = vnode;
|
|
3280
|
+
el[leaveCbKey] = () => {
|
|
3281
|
+
earlyRemove();
|
|
3282
|
+
el[leaveCbKey] = void 0;
|
|
3283
|
+
delete enterHooks.delayedLeave;
|
|
3284
|
+
delayedLeavingVNode = void 0;
|
|
3285
|
+
};
|
|
3286
|
+
enterHooks.delayedLeave = () => {
|
|
3287
|
+
delayedLeave();
|
|
3288
|
+
delete enterHooks.delayedLeave;
|
|
3289
|
+
delayedLeavingVNode = void 0;
|
|
3290
|
+
};
|
|
3291
|
+
};
|
|
3292
|
+
}
|
|
3293
|
+
return false;
|
|
3294
|
+
}
|
|
3257
3295
|
function setTransitionHooks(vnode, hooks) {
|
|
3258
3296
|
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
3259
3297
|
vnode.transition = hooks;
|
|
3260
3298
|
if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
|
|
3261
|
-
else
|
|
3299
|
+
else {
|
|
3300
|
+
const subTree = vnode.component.subTree;
|
|
3301
|
+
return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
|
|
3302
|
+
}
|
|
3262
3303
|
} else if (vnode.shapeFlag & 128) {
|
|
3263
|
-
vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
3264
|
-
vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
3304
|
+
const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
3305
|
+
const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
3306
|
+
return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
|
|
3265
3307
|
} else vnode.transition = hooks;
|
|
3308
|
+
return hooks;
|
|
3266
3309
|
}
|
|
3267
3310
|
function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
3268
3311
|
let ret = [];
|
|
@@ -3585,7 +3628,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3585
3628
|
if (forcePatch || hasDynamicProps || !optimized || patchFlag & 48) {
|
|
3586
3629
|
const isCustomElement = el.tagName.includes("-");
|
|
3587
3630
|
const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
|
|
3588
|
-
for (const key in props) if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key))
|
|
3631
|
+
for (const key in props) if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
|
|
3632
|
+
if (isUnchangedResourceProp(el, key, props[key])) continue;
|
|
3633
|
+
patchProp(el, key, null, props[key], namespace, parentComponent);
|
|
3634
|
+
}
|
|
3589
3635
|
} else if (props.onClick) patchProp(el, "onClick", null, props.onClick, void 0, parentComponent);
|
|
3590
3636
|
else if (patchFlag & 4 && /* @__PURE__ */ isReactive(props.style)) for (const key in props.style) props.style[key];
|
|
3591
3637
|
}
|
|
@@ -3686,6 +3732,19 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3686
3732
|
const isTemplateNode$1 = (node) => {
|
|
3687
3733
|
return node.nodeType === 1 && node.tagName === "TEMPLATE";
|
|
3688
3734
|
};
|
|
3735
|
+
/**
|
|
3736
|
+
* Dev only
|
|
3737
|
+
*/
|
|
3738
|
+
const resourceProps = /* @__PURE__ */ new Set([
|
|
3739
|
+
"src",
|
|
3740
|
+
"srcset",
|
|
3741
|
+
"href",
|
|
3742
|
+
"poster"
|
|
3743
|
+
]);
|
|
3744
|
+
function isUnchangedResourceProp(el, key, clientValue) {
|
|
3745
|
+
if (!resourceProps.has(key)) return false;
|
|
3746
|
+
return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
|
|
3747
|
+
}
|
|
3689
3748
|
const allowMismatchAttr = "data-allow-mismatch";
|
|
3690
3749
|
const MismatchTypeString = {
|
|
3691
3750
|
[0]: "text",
|
|
@@ -4511,7 +4570,8 @@ function createSlots(slots, dynamicSlots) {
|
|
|
4511
4570
|
* Compiler runtime helper for rendering `<slot/>`
|
|
4512
4571
|
* @private
|
|
4513
4572
|
*/
|
|
4514
|
-
function renderSlot(slots, name, props
|
|
4573
|
+
function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
4574
|
+
if (props == null) props = {};
|
|
4515
4575
|
let slot = slots[name];
|
|
4516
4576
|
if (fallback) fallback.__vdom = true;
|
|
4517
4577
|
const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
|
|
@@ -5302,7 +5362,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
5302
5362
|
if (options.el) return vm.$mount(options.el);
|
|
5303
5363
|
else return vm;
|
|
5304
5364
|
}
|
|
5305
|
-
Vue.version = `2.6.14-compat:3.6.0-rc.
|
|
5365
|
+
Vue.version = `2.6.14-compat:3.6.0-rc.3`;
|
|
5306
5366
|
Vue.config = singletonApp.config;
|
|
5307
5367
|
Vue.use = (plugin, ...options) => {
|
|
5308
5368
|
if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
|
|
@@ -5893,7 +5953,7 @@ function renderComponentRoot(instance) {
|
|
|
5893
5953
|
root = cloneVNode(root, null, false, true);
|
|
5894
5954
|
root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
|
|
5895
5955
|
}
|
|
5896
|
-
if (vnode.transition) setTransitionHooks(root, vnode.transition);
|
|
5956
|
+
if (vnode.transition) setTransitionHooks(isTeleport(root.type) ? getInnerChild$1(root) || root : root, vnode.transition);
|
|
5897
5957
|
result = root;
|
|
5898
5958
|
setCurrentRenderingInstance(prev);
|
|
5899
5959
|
return result;
|
|
@@ -5909,9 +5969,10 @@ function filterSingleRoot(children, recurse = true) {
|
|
|
5909
5969
|
}
|
|
5910
5970
|
return singleRoot;
|
|
5911
5971
|
}
|
|
5972
|
+
const isFunctionalFallthroughKey = (key) => key === "class" || key === "style" || isOn(key);
|
|
5912
5973
|
const getFunctionalFallthrough = (attrs) => {
|
|
5913
5974
|
let res;
|
|
5914
|
-
for (const key in attrs) if (
|
|
5975
|
+
for (const key in attrs) if (isFunctionalFallthroughKey(key)) (res || (res = {}))[key] = attrs[key];
|
|
5915
5976
|
return res;
|
|
5916
5977
|
};
|
|
5917
5978
|
const filterModelListeners = (attrs, props) => {
|
|
@@ -7188,6 +7249,10 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
7188
7249
|
suspense.activeBranch = pendingBranch;
|
|
7189
7250
|
} else unmount(pendingBranch, parentComponent, suspense);
|
|
7190
7251
|
suspense.deps = 0;
|
|
7252
|
+
for (let i = 0; i < suspense.effects.length; i++) {
|
|
7253
|
+
const effect = suspense.effects[i];
|
|
7254
|
+
if (effect.flags & 8) queuePostFlushCb(effect);
|
|
7255
|
+
}
|
|
7191
7256
|
suspense.effects.length = 0;
|
|
7192
7257
|
suspense.hiddenContainer = createElement("div");
|
|
7193
7258
|
if (isInFallback) {
|
|
@@ -7286,7 +7351,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7286
7351
|
let hasUnresolvedAncestor = false;
|
|
7287
7352
|
while (parent) {
|
|
7288
7353
|
if (parent.pendingBranch) {
|
|
7289
|
-
parent.effects.push(
|
|
7354
|
+
for (let i = 0; i < effects.length; i++) parent.effects.push(effects[i]);
|
|
7290
7355
|
hasUnresolvedAncestor = true;
|
|
7291
7356
|
break;
|
|
7292
7357
|
}
|
|
@@ -7942,7 +8007,12 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
7942
8007
|
};
|
|
7943
8008
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
7944
8009
|
if (isSSR) return setupResult.then((resolvedResult) => {
|
|
7945
|
-
|
|
8010
|
+
setInSSRSetupState(true);
|
|
8011
|
+
try {
|
|
8012
|
+
handleSetupResult(instance, resolvedResult, isSSR);
|
|
8013
|
+
} finally {
|
|
8014
|
+
setInSSRSetupState(false);
|
|
8015
|
+
}
|
|
7946
8016
|
}).catch((e) => {
|
|
7947
8017
|
handleError(e, instance, 0);
|
|
7948
8018
|
});
|
|
@@ -8095,7 +8165,7 @@ function isMemoSame(cached, memo) {
|
|
|
8095
8165
|
}
|
|
8096
8166
|
//#endregion
|
|
8097
8167
|
//#region packages/runtime-core/src/index.ts
|
|
8098
|
-
const version = "3.6.0-rc.
|
|
8168
|
+
const version = "3.6.0-rc.3";
|
|
8099
8169
|
const warn = NOOP;
|
|
8100
8170
|
/**
|
|
8101
8171
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -8791,7 +8861,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
8791
8861
|
if (!this._instance) if (this._resolved) this._mountComponent(this._def);
|
|
8792
8862
|
else if (parent && parent._pendingResolve) this._pendingResolve = parent._pendingResolve.then(() => {
|
|
8793
8863
|
this._pendingResolve = void 0;
|
|
8794
|
-
this._resolveDef();
|
|
8864
|
+
if (this.isConnected) return this._resolveDef();
|
|
8795
8865
|
});
|
|
8796
8866
|
else this._resolveDef();
|
|
8797
8867
|
}
|
|
@@ -8827,7 +8897,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
8827
8897
|
* resolve inner component definition (handle possible async component)
|
|
8828
8898
|
*/
|
|
8829
8899
|
_resolveDef() {
|
|
8830
|
-
if (this._pendingResolve) return;
|
|
8900
|
+
if (this._pendingResolve) return this._pendingResolve;
|
|
8831
8901
|
for (let i = 0; i < this.attributes.length; i++) this._setAttr(this.attributes[i].name);
|
|
8832
8902
|
this._ob = new MutationObserver(this._processMutations.bind(this));
|
|
8833
8903
|
this._ob.observe(this, { attributes: true });
|
|
@@ -8856,6 +8926,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
8856
8926
|
this._def = def;
|
|
8857
8927
|
resolve(def);
|
|
8858
8928
|
});
|
|
8929
|
+
return this._pendingResolve;
|
|
8859
8930
|
} else resolve(this._def);
|
|
8860
8931
|
}
|
|
8861
8932
|
_mountComponent(def) {
|
|
@@ -9276,13 +9347,22 @@ function onCompositionEnd(e) {
|
|
|
9276
9347
|
}
|
|
9277
9348
|
}
|
|
9278
9349
|
const assignKey = Symbol("_assign");
|
|
9350
|
+
const initialValueKey = Symbol("_initialValue");
|
|
9279
9351
|
const vModelText = {
|
|
9280
9352
|
created(el, { modifiers: { lazy, trim, number } }, vnode) {
|
|
9353
|
+
if (el.parentNode) {
|
|
9354
|
+
if (el.type === "text") el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
|
|
9355
|
+
else if (el.type === "textarea") el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
|
|
9356
|
+
}
|
|
9281
9357
|
el[assignKey] = getModelAssigner(vnode);
|
|
9282
9358
|
vModelTextInit(el, trim, number || !!(vnode.props && vnode.props.type === "number"), lazy);
|
|
9283
9359
|
},
|
|
9284
|
-
mounted(el, { value }) {
|
|
9285
|
-
|
|
9360
|
+
mounted(el, { value, modifiers: { trim, number } }) {
|
|
9361
|
+
const newValue = value == null ? "" : value;
|
|
9362
|
+
const initialValue = el[initialValueKey];
|
|
9363
|
+
delete el[initialValueKey];
|
|
9364
|
+
if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) el[assignKey](castValue(el.value, trim, number));
|
|
9365
|
+
else el.value = newValue;
|
|
9286
9366
|
},
|
|
9287
9367
|
beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
|
|
9288
9368
|
el[assignKey] = getModelAssigner(vnode);
|
|
@@ -13626,15 +13706,22 @@ const transformFor = createStructuralDirectiveTransform("for", (node, dir, conte
|
|
|
13626
13706
|
else {
|
|
13627
13707
|
childBlock = children[0].codegenNode;
|
|
13628
13708
|
if (isTemplate && keyProperty) injectProp(childBlock, keyProperty, context);
|
|
13629
|
-
|
|
13709
|
+
const shouldUseBlock = !isStableFragment || childBlock.isBlockRequired === true;
|
|
13710
|
+
if (childBlock.isBlock !== shouldUseBlock) if (childBlock.isBlock) {
|
|
13630
13711
|
removeHelper(OPEN_BLOCK);
|
|
13631
13712
|
removeHelper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
|
|
13632
13713
|
} else removeHelper(getVNodeHelper(context.inSSR, childBlock.isComponent));
|
|
13633
|
-
childBlock.isBlock =
|
|
13714
|
+
childBlock.isBlock = shouldUseBlock;
|
|
13634
13715
|
if (childBlock.isBlock) {
|
|
13635
13716
|
helper(OPEN_BLOCK);
|
|
13636
13717
|
helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
|
|
13637
|
-
} else
|
|
13718
|
+
} else {
|
|
13719
|
+
helper(getVNodeHelper(context.inSSR, childBlock.isComponent));
|
|
13720
|
+
if (childBlock.needsPatch) {
|
|
13721
|
+
var _childBlock$patchFlag;
|
|
13722
|
+
childBlock.patchFlag = ((_childBlock$patchFlag = childBlock.patchFlag) !== null && _childBlock$patchFlag !== void 0 ? _childBlock$patchFlag : 0) | 512;
|
|
13723
|
+
}
|
|
13724
|
+
}
|
|
13638
13725
|
}
|
|
13639
13726
|
if (memo) {
|
|
13640
13727
|
const loop = createFunctionExpression(createForLoopParams(forNode.parseResult, [createSimpleExpression(`_cached`)]));
|
|
@@ -13892,12 +13979,16 @@ const transformElement = (node, context) => {
|
|
|
13892
13979
|
let vnodeDynamicProps;
|
|
13893
13980
|
let dynamicPropNames;
|
|
13894
13981
|
let vnodeDirectives;
|
|
13982
|
+
let needsPatch = false;
|
|
13983
|
+
let isBlockRequired = false;
|
|
13895
13984
|
let shouldUseBlock = isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && (tag === "svg" || tag === "foreignObject" || tag === "math");
|
|
13896
13985
|
if (props.length > 0) {
|
|
13897
13986
|
const propsBuildResult = buildProps(node, context, void 0, isComponent, isDynamicComponent);
|
|
13898
13987
|
vnodeProps = propsBuildResult.props;
|
|
13899
13988
|
patchFlag = propsBuildResult.patchFlag;
|
|
13900
13989
|
dynamicPropNames = propsBuildResult.dynamicPropNames;
|
|
13990
|
+
needsPatch = propsBuildResult.needsPatch;
|
|
13991
|
+
isBlockRequired = propsBuildResult.isBlockRequired;
|
|
13901
13992
|
const directives = propsBuildResult.directives;
|
|
13902
13993
|
vnodeDirectives = directives && directives.length ? createArrayExpression(directives.map((dir) => buildDirectiveArgs(dir, context))) : void 0;
|
|
13903
13994
|
if (propsBuildResult.shouldUseBlock) shouldUseBlock = true;
|
|
@@ -13921,7 +14012,10 @@ const transformElement = (node, context) => {
|
|
|
13921
14012
|
} else vnodeChildren = node.children;
|
|
13922
14013
|
}
|
|
13923
14014
|
if (dynamicPropNames && dynamicPropNames.length) vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
|
|
13924
|
-
node.codegenNode = createVNodeCall(context, vnodeTag, vnodeProps, vnodeChildren, patchFlag === 0 ? void 0 : patchFlag, vnodeDynamicProps, vnodeDirectives, !!shouldUseBlock, false, isComponent, node.loc);
|
|
14015
|
+
const vnodeCall = node.codegenNode = createVNodeCall(context, vnodeTag, vnodeProps, vnodeChildren, patchFlag === 0 ? void 0 : patchFlag, vnodeDynamicProps, vnodeDirectives, !!shouldUseBlock, false, isComponent, node.loc);
|
|
14016
|
+
needsPatch = needsPatch && (patchFlag === 0 || patchFlag === 32);
|
|
14017
|
+
if (needsPatch) vnodeCall.needsPatch = true;
|
|
14018
|
+
if (isBlockRequired) vnodeCall.isBlockRequired = true;
|
|
13925
14019
|
};
|
|
13926
14020
|
};
|
|
13927
14021
|
function resolveComponentType(node, context, ssr = false) {
|
|
@@ -14006,6 +14100,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
14006
14100
|
const runtimeDirectives = [];
|
|
14007
14101
|
const hasChildren = children.length > 0;
|
|
14008
14102
|
let shouldUseBlock = false;
|
|
14103
|
+
let isBlockRequired = false;
|
|
14009
14104
|
let patchFlag = 0;
|
|
14010
14105
|
let hasRef = false;
|
|
14011
14106
|
let hasClassBinding = false;
|
|
@@ -14030,12 +14125,12 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
14030
14125
|
const isEventHandler = isOn(name);
|
|
14031
14126
|
if (isEventHandler && (!isComponent || isDynamicComponent) && name.toLowerCase() !== "onclick" && name !== "onUpdate:modelValue" && !isReservedProp(name)) hasHydrationEventBinding = true;
|
|
14032
14127
|
if (isEventHandler && isReservedProp(name)) hasVnodeHook = true;
|
|
14128
|
+
if (name === "ref") hasRef = true;
|
|
14033
14129
|
if (isEventHandler && value.type === 14) value = value.arguments[0];
|
|
14034
14130
|
if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) return;
|
|
14035
|
-
if (name === "
|
|
14036
|
-
else if (name === "class") hasClassBinding = true;
|
|
14131
|
+
if (name === "class") hasClassBinding = true;
|
|
14037
14132
|
else if (name === "style") hasStyleBinding = true;
|
|
14038
|
-
else if (name !== "key" && !dynamicPropNames.includes(name)) dynamicPropNames.push(name);
|
|
14133
|
+
else if (name !== "ref" && name !== "key" && !dynamicPropNames.includes(name)) dynamicPropNames.push(name);
|
|
14039
14134
|
if (isComponent && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) dynamicPropNames.push(name);
|
|
14040
14135
|
} else hasDynamicKeys = true;
|
|
14041
14136
|
};
|
|
@@ -14068,7 +14163,11 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
14068
14163
|
if (name === "once" || name === "memo") continue;
|
|
14069
14164
|
if (name === "is" || isVBind && isStaticArgOf(arg, "is") && (isComponentTag(tag) || isCompatEnabled("COMPILER_IS_ON_ELEMENT", context))) continue;
|
|
14070
14165
|
if (isVOn && ssr) continue;
|
|
14071
|
-
if (isVBind && isStaticArgOf(arg, "key")
|
|
14166
|
+
if (isVBind && isStaticArgOf(arg, "key")) shouldUseBlock = true;
|
|
14167
|
+
if (isVOn && hasChildren && arg && isStaticExp(arg) && camelize(arg.content) === "vue:beforeUpdate") {
|
|
14168
|
+
shouldUseBlock = true;
|
|
14169
|
+
isBlockRequired = true;
|
|
14170
|
+
}
|
|
14072
14171
|
if (isVBind && isStaticArgOf(arg, "ref")) pushRefVForMarker();
|
|
14073
14172
|
if (!arg && (isVBind || isVOn)) {
|
|
14074
14173
|
hasDynamicKeys = true;
|
|
@@ -14103,7 +14202,10 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
14103
14202
|
}
|
|
14104
14203
|
} else if (!isBuiltInDirective(name)) {
|
|
14105
14204
|
runtimeDirectives.push(prop);
|
|
14106
|
-
if (hasChildren)
|
|
14205
|
+
if (hasChildren) {
|
|
14206
|
+
shouldUseBlock = true;
|
|
14207
|
+
isBlockRequired = true;
|
|
14208
|
+
}
|
|
14107
14209
|
}
|
|
14108
14210
|
}
|
|
14109
14211
|
}
|
|
@@ -14120,7 +14222,8 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
14120
14222
|
if (dynamicPropNames.length) patchFlag |= 8;
|
|
14121
14223
|
if (hasHydrationEventBinding) patchFlag |= 32;
|
|
14122
14224
|
}
|
|
14123
|
-
|
|
14225
|
+
const needsPatch = (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0);
|
|
14226
|
+
if (!shouldUseBlock && needsPatch) patchFlag |= 512;
|
|
14124
14227
|
if (!context.inSSR && propsExpression) switch (propsExpression.type) {
|
|
14125
14228
|
case 15:
|
|
14126
14229
|
let classKeyIndex = -1;
|
|
@@ -14150,7 +14253,9 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
14150
14253
|
directives: runtimeDirectives,
|
|
14151
14254
|
patchFlag,
|
|
14152
14255
|
dynamicPropNames,
|
|
14153
|
-
shouldUseBlock
|
|
14256
|
+
shouldUseBlock,
|
|
14257
|
+
needsPatch,
|
|
14258
|
+
isBlockRequired
|
|
14154
14259
|
};
|
|
14155
14260
|
}
|
|
14156
14261
|
function dedupeProperties(properties) {
|
|
@@ -15065,10 +15170,11 @@ function stringifyElement(node, context) {
|
|
|
15065
15170
|
res += ` ${p.arg.content}="__VUE_EXP_START__${exp.content}__VUE_EXP_END__"`;
|
|
15066
15171
|
continue;
|
|
15067
15172
|
}
|
|
15068
|
-
if (isBooleanAttr(p.arg.content) && exp.content === "false") continue;
|
|
15173
|
+
if ((isBooleanAttr(p.arg.content) || p.arg.content === "hidden") && exp.content === "false") continue;
|
|
15069
15174
|
let evaluated = evaluateConstant(exp);
|
|
15070
15175
|
if (evaluated != null) {
|
|
15071
15176
|
const arg = p.arg && p.arg.content;
|
|
15177
|
+
if (arg === "hidden" && typeof evaluated === "number" && !includeBooleanAttr(evaluated)) continue;
|
|
15072
15178
|
if (arg === "class") evaluated = normalizeClass(evaluated);
|
|
15073
15179
|
else if (arg === "style") evaluated = stringifyStyle(normalizeStyle(evaluated));
|
|
15074
15180
|
res += ` ${p.arg.content}="${escapeHtml(evaluated)}"`;
|