@vue/compat 3.6.0-rc.2 → 3.6.0-rc.4

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.6.0-rc.2
2
+ * @vue/compat v3.6.0-rc.4
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -319,7 +319,7 @@ var Vue = (function() {
319
319
  /**
320
320
  * The full list is needed during SSR to produce the correct initial markup.
321
321
  */
322
- const isBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
322
+ const isBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
323
323
  /**
324
324
  * Boolean attributes should be included if the value is truthy or ''.
325
325
  * e.g. `<select multiple>` compiles to `{ multiple: '' }`
@@ -2601,7 +2601,7 @@ var Vue = (function() {
2601
2601
  function queuePostFlushCb(jobs, id = Infinity) {
2602
2602
  if (!isArray(jobs)) if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
2603
2603
  else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
2604
- else for (const job of jobs) queueJobWorker(job, id, postJobs, postJobs.length, 0);
2604
+ else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
2605
2605
  queueFlush();
2606
2606
  }
2607
2607
  function flushPreFlushCbs(instance, seen) {
@@ -2622,7 +2622,7 @@ var Vue = (function() {
2622
2622
  function flushPostFlushCbs(seen) {
2623
2623
  if (postJobs.length) {
2624
2624
  if (activePostJobs) {
2625
- activePostJobs.push(...postJobs);
2625
+ for (let i = 0; i < postJobs.length; i++) activePostJobs.push(postJobs[i]);
2626
2626
  postJobs.length = 0;
2627
2627
  return;
2628
2628
  }
@@ -3782,49 +3782,16 @@ var Vue = (function() {
3782
3782
  setup(props, { slots }) {
3783
3783
  const instance = getCurrentInstance();
3784
3784
  const state = useTransitionState();
3785
+ let resumeAfterLeave;
3785
3786
  return () => {
3786
- const children = slots.default && getTransitionRawChildren(slots.default(), true);
3787
- const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
3787
+ const child = resolveTransitionChild(slots.default && slots.default(), !!instance.subTree);
3788
3788
  if (!child) return;
3789
3789
  const rawProps = /* @__PURE__ */ toRaw(props);
3790
3790
  const { mode } = rawProps;
3791
3791
  checkTransitionMode(mode);
3792
- if (state.isLeaving) return emptyPlaceholder(child);
3793
- const innerChild = getInnerChild$1(child);
3794
- if (!innerChild) return emptyPlaceholder(child);
3795
- let enterHooks = resolveTransitionHooks(innerChild, rawProps, state, instance, (hooks) => enterHooks = hooks);
3796
- if (innerChild.type !== Comment) setTransitionHooks(innerChild, enterHooks);
3797
- let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
3798
- if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
3799
- let leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance);
3800
- setTransitionHooks(oldInnerChild, leavingHooks);
3801
- if (mode === "out-in" && innerChild.type !== Comment) {
3802
- state.isLeaving = true;
3803
- leavingHooks.afterLeave = () => {
3804
- state.isLeaving = false;
3805
- if (!(instance.job.flags & 4)) instance.update();
3806
- delete leavingHooks.afterLeave;
3807
- oldInnerChild = void 0;
3808
- };
3809
- return emptyPlaceholder(child);
3810
- } else if (mode === "in-out" && innerChild.type !== Comment) leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
3811
- const leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild);
3812
- leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
3813
- el[leaveCbKey] = () => {
3814
- earlyRemove();
3815
- el[leaveCbKey] = void 0;
3816
- delete enterHooks.delayedLeave;
3817
- oldInnerChild = void 0;
3818
- };
3819
- enterHooks.delayedLeave = () => {
3820
- delayedLeave();
3821
- delete enterHooks.delayedLeave;
3822
- oldInnerChild = void 0;
3823
- };
3824
- };
3825
- else oldInnerChild = void 0;
3826
- } else if (oldInnerChild) oldInnerChild = void 0;
3827
- return child;
3792
+ return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
3793
+ if (!(instance.job.flags & 4)) instance.update();
3794
+ }) : NOOP);
3828
3795
  };
3829
3796
  }
3830
3797
  };
@@ -3967,15 +3934,91 @@ var Vue = (function() {
3967
3934
  if (shapeFlag & 32 && isFunction(children.default)) return children.default();
3968
3935
  }
3969
3936
  }
3937
+ function resolveTransitionChild(children, renderEmpty = false) {
3938
+ const branches = children && getTransitionRawChildren(children, true);
3939
+ return branches && branches.length ? findNonCommentChild(branches) : renderEmpty ? createCommentVNode() : void 0;
3940
+ }
3941
+ /**
3942
+ * @internal
3943
+ */
3944
+ function prepareTransitionSwitch(previous, next, props, state, instance, resumeAfterLeave, delayedLeaveSource) {
3945
+ if (state.isLeaving) return emptyPlaceholder(next);
3946
+ const nextInner = getInnerChild$1(next);
3947
+ if (!nextInner) return emptyPlaceholder(next);
3948
+ let enterHooks = resolveTransitionHooks(nextInner, props, state, instance, (hooks) => {
3949
+ if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
3950
+ enterHooks = hooks;
3951
+ });
3952
+ if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
3953
+ if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
3954
+ const mode = props.mode;
3955
+ const previousInner = previous && getInnerChild$1(previous);
3956
+ if (previous && previousInner && previousInner.type !== Comment && !isSameVNodeType(previousInner, nextInner) && (!previous.component || recursiveGetSubtree(previous.component).type !== Comment)) {
3957
+ const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
3958
+ 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);
3959
+ }
3960
+ return next;
3961
+ }
3962
+ function forwardDelayedLeave(hooks, source) {
3963
+ const delayedLeave = source && source.delayedLeave;
3964
+ if (!delayedLeave) return;
3965
+ hooks.delayedLeave = () => {
3966
+ if (source.delayedLeave === delayedLeave) delayedLeave();
3967
+ delete hooks.delayedLeave;
3968
+ };
3969
+ }
3970
+ function prepareLeavingTransitionHooks(previousInner, props, state, instance) {
3971
+ return setTransitionHooks(previousInner, resolveTransitionHooks(previousInner, props, state, instance));
3972
+ }
3973
+ function applyTransitionModeSwitch(leavingVNode, leavingHooks, getEnterHooks, props, state, resumeAfterLeave) {
3974
+ if (props.mode === "out-in") {
3975
+ state.isLeaving = true;
3976
+ leavingHooks.afterLeave = () => {
3977
+ state.isLeaving = false;
3978
+ resumeAfterLeave();
3979
+ delete leavingHooks.afterLeave;
3980
+ };
3981
+ return true;
3982
+ } else if (props.mode === "in-out" && getEnterHooks) {
3983
+ let delayedLeavingVNode = leavingVNode;
3984
+ leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
3985
+ const enterHooks = getEnterHooks();
3986
+ if (!enterHooks) {
3987
+ delayedLeave();
3988
+ return;
3989
+ }
3990
+ const vnode = delayedLeavingVNode;
3991
+ const leavingVNodesCache = getLeavingNodesForType(state, vnode);
3992
+ leavingVNodesCache[String(vnode.key)] = vnode;
3993
+ el[leaveCbKey] = () => {
3994
+ earlyRemove();
3995
+ el[leaveCbKey] = void 0;
3996
+ delete enterHooks.delayedLeave;
3997
+ delayedLeavingVNode = void 0;
3998
+ };
3999
+ enterHooks.delayedLeave = () => {
4000
+ delayedLeave();
4001
+ delete enterHooks.delayedLeave;
4002
+ delayedLeavingVNode = void 0;
4003
+ };
4004
+ };
4005
+ }
4006
+ return false;
4007
+ }
3970
4008
  function setTransitionHooks(vnode, hooks) {
3971
4009
  if (vnode.shapeFlag & 6 && vnode.component) {
3972
4010
  vnode.transition = hooks;
3973
4011
  if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
3974
- else setTransitionHooks(vnode.component.subTree, hooks);
4012
+ else {
4013
+ const subTree = vnode.component.subTree;
4014
+ return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
4015
+ }
3975
4016
  } else if (vnode.shapeFlag & 128) {
3976
- vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3977
- vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4017
+ const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4018
+ const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4019
+ return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
3978
4020
  } else vnode.transition = hooks;
4021
+ return hooks;
3979
4022
  }
3980
4023
  function getTransitionRawChildren(children, keepComment = false, parentKey) {
3981
4024
  let ret = [];
@@ -4327,7 +4370,10 @@ var Vue = (function() {
4327
4370
  const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
4328
4371
  for (const key in props) {
4329
4372
  if (!(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) logMismatchError();
4330
- if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) patchProp(el, key, null, props[key], namespace, parentComponent);
4373
+ if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
4374
+ if (isUnchangedResourceProp(el, key, props[key])) continue;
4375
+ patchProp(el, key, null, props[key], namespace, parentComponent);
4376
+ }
4331
4377
  }
4332
4378
  }
4333
4379
  let vnodeHooks;
@@ -4436,6 +4482,16 @@ var Vue = (function() {
4436
4482
  /**
4437
4483
  * Dev only
4438
4484
  */
4485
+ const resourceProps = /* @__PURE__ */ new Set([
4486
+ "src",
4487
+ "srcset",
4488
+ "href",
4489
+ "poster"
4490
+ ]);
4491
+ function isUnchangedResourceProp(el, key, clientValue) {
4492
+ if (!resourceProps.has(key)) return false;
4493
+ return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
4494
+ }
4439
4495
  function propHasMismatch(el, key, clientValue, vnode, instance) {
4440
4496
  let mismatchType;
4441
4497
  let mismatchKey;
@@ -4476,7 +4532,10 @@ var Vue = (function() {
4476
4532
  function getAttributeMismatch(el, key, clientValue) {
4477
4533
  let actual;
4478
4534
  let expected;
4479
- if (isBooleanAttr(key)) {
4535
+ if (key === "hidden") {
4536
+ actual = normalizeHiddenValue(el.getAttribute(key));
4537
+ expected = normalizeHiddenValue(clientValue);
4538
+ } else if (isBooleanAttr(key)) {
4480
4539
  actual = el.hasAttribute(key);
4481
4540
  expected = includeBooleanAttr(clientValue);
4482
4541
  } else if (clientValue == null) {
@@ -4504,6 +4563,11 @@ var Vue = (function() {
4504
4563
  }
4505
4564
  return false;
4506
4565
  }
4566
+ function normalizeHiddenValue(value) {
4567
+ if (!isRenderableAttrValue(value)) return false;
4568
+ if (isString(value)) return value.toLowerCase() === "until-found" ? "until-found" : "";
4569
+ return includeBooleanAttr(value) ? "" : false;
4570
+ }
4507
4571
  function toClassSet(str) {
4508
4572
  return new Set(str.trim().split(/\s+/));
4509
4573
  }
@@ -5379,7 +5443,8 @@ var Vue = (function() {
5379
5443
  * Compiler runtime helper for rendering `<slot/>`
5380
5444
  * @private
5381
5445
  */
5382
- function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
5446
+ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
5447
+ if (props == null) props = {};
5383
5448
  let slot = slots[name];
5384
5449
  if (fallback) fallback.__vdom = true;
5385
5450
  const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
@@ -6335,7 +6400,7 @@ var Vue = (function() {
6335
6400
  if (options.el) return vm.$mount(options.el);
6336
6401
  else return vm;
6337
6402
  }
6338
- Vue.version = `2.6.14-compat:3.6.0-rc.2`;
6403
+ Vue.version = `2.6.14-compat:3.6.0-rc.4`;
6339
6404
  Vue.config = singletonApp.config;
6340
6405
  Vue.use = (plugin, ...options) => {
6341
6406
  if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
@@ -7033,8 +7098,9 @@ var Vue = (function() {
7033
7098
  root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
7034
7099
  }
7035
7100
  if (vnode.transition) {
7036
- if (!isElementRoot(root)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
7037
- setTransitionHooks(root, vnode.transition);
7101
+ const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
7102
+ if (!isElementRoot(child)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
7103
+ setTransitionHooks(child, vnode.transition);
7038
7104
  }
7039
7105
  if (setRoot) setRoot(root);
7040
7106
  else result = root;
@@ -7094,9 +7160,10 @@ var Vue = (function() {
7094
7160
  }
7095
7161
  return singleRoot;
7096
7162
  }
7163
+ const isFunctionalFallthroughKey = (key) => key === "class" || key === "style" || isOn(key);
7097
7164
  const getFunctionalFallthrough = (attrs) => {
7098
7165
  let res;
7099
- for (const key in attrs) if (key === "class" || key === "style" || isOn(key)) (res || (res = {}))[key] = attrs[key];
7166
+ for (const key in attrs) if (isFunctionalFallthroughKey(key)) (res || (res = {}))[key] = attrs[key];
7100
7167
  return res;
7101
7168
  };
7102
7169
  const filterModelListeners = (attrs, props) => {
@@ -8626,6 +8693,10 @@ var Vue = (function() {
8626
8693
  suspense.activeBranch = pendingBranch;
8627
8694
  } else unmount(pendingBranch, parentComponent, suspense);
8628
8695
  suspense.deps = 0;
8696
+ for (let i = 0; i < suspense.effects.length; i++) {
8697
+ const effect = suspense.effects[i];
8698
+ if (effect.flags & 8) queuePostFlushCb(effect);
8699
+ }
8629
8700
  suspense.effects.length = 0;
8630
8701
  suspense.hiddenContainer = createElement("div");
8631
8702
  if (isInFallback) {
@@ -8733,7 +8804,7 @@ var Vue = (function() {
8733
8804
  let hasUnresolvedAncestor = false;
8734
8805
  while (parent) {
8735
8806
  if (parent.pendingBranch) {
8736
- parent.effects.push(...effects);
8807
+ for (let i = 0; i < effects.length; i++) parent.effects.push(effects[i]);
8737
8808
  hasUnresolvedAncestor = true;
8738
8809
  break;
8739
8810
  }
@@ -9043,11 +9114,26 @@ var Vue = (function() {
9043
9114
  if (shapeFlag & 128) type.normalize(vnode);
9044
9115
  } else if (children) vnode.shapeFlag |= isString(children) ? 8 : 16;
9045
9116
  if (vnode.key !== vnode.key) warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
9117
+ if (props && vnode.shapeFlag & 1) {
9118
+ const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
9119
+ 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.`);
9120
+ }
9046
9121
  if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock && (vnode.patchFlag > 0 || shapeFlag & 6) && vnode.patchFlag !== 32) currentBlock.push(vnode);
9047
9122
  convertLegacyVModelProps(vnode);
9048
9123
  defineLegacyVNodeProperties(vnode);
9049
9124
  return vnode;
9050
9125
  }
9126
+ /**
9127
+ * dev only
9128
+ * Whether children would actually render something. Empty text and empty
9129
+ * arrays are ignored, mirroring the compiler's `node.children.length` check
9130
+ * for `v-html` / `v-text`.
9131
+ */
9132
+ function hasContentChildren(children) {
9133
+ if (isString(children)) return children !== "";
9134
+ if (isArray(children)) return children.length > 0;
9135
+ return false;
9136
+ }
9051
9137
  const createVNode = createVNodeWithArgsTransform;
9052
9138
  function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
9053
9139
  if (!type || type === NULL_DYNAMIC_COMPONENT) {
@@ -9438,7 +9524,12 @@ var Vue = (function() {
9438
9524
  };
9439
9525
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
9440
9526
  if (isSSR) return setupResult.then((resolvedResult) => {
9441
- handleSetupResult(instance, resolvedResult, isSSR);
9527
+ setInSSRSetupState(true);
9528
+ try {
9529
+ handleSetupResult(instance, resolvedResult, isSSR);
9530
+ } finally {
9531
+ setInSSRSetupState(false);
9532
+ }
9442
9533
  }).catch((e) => {
9443
9534
  handleError(e, instance, 0);
9444
9535
  });
@@ -9813,7 +9904,7 @@ var Vue = (function() {
9813
9904
  }
9814
9905
  //#endregion
9815
9906
  //#region packages/runtime-core/src/index.ts
9816
- const version = "3.6.0-rc.2";
9907
+ const version = "3.6.0-rc.4";
9817
9908
  const warn = warn$1;
9818
9909
  /**
9819
9910
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -10579,7 +10670,7 @@ var Vue = (function() {
10579
10670
  if (!this._instance) if (this._resolved) this._mountComponent(this._def);
10580
10671
  else if (parent && parent._pendingResolve) this._pendingResolve = parent._pendingResolve.then(() => {
10581
10672
  this._pendingResolve = void 0;
10582
- this._resolveDef();
10673
+ if (this.isConnected) return this._resolveDef();
10583
10674
  });
10584
10675
  else this._resolveDef();
10585
10676
  }
@@ -10615,7 +10706,7 @@ var Vue = (function() {
10615
10706
  * resolve inner component definition (handle possible async component)
10616
10707
  */
10617
10708
  _resolveDef() {
10618
- if (this._pendingResolve) return;
10709
+ if (this._pendingResolve) return this._pendingResolve;
10619
10710
  for (let i = 0; i < this.attributes.length; i++) this._setAttr(this.attributes[i].name);
10620
10711
  this._ob = new MutationObserver(this._processMutations.bind(this));
10621
10712
  this._ob.observe(this, { attributes: true });
@@ -10645,6 +10736,7 @@ var Vue = (function() {
10645
10736
  this._def = def;
10646
10737
  resolve(def);
10647
10738
  });
10739
+ return this._pendingResolve;
10648
10740
  } else resolve(this._def);
10649
10741
  }
10650
10742
  _mountComponent(def) {
@@ -10683,14 +10775,17 @@ var Vue = (function() {
10683
10775
  const { props } = def;
10684
10776
  const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
10685
10777
  for (const key of Object.keys(this)) if (key[0] !== "_" && declaredPropKeys.includes(key)) this._setProp(key, this[key]);
10686
- for (const key of declaredPropKeys.map(camelize)) Object.defineProperty(this, key, {
10687
- get() {
10688
- return this._getProp(key);
10689
- },
10690
- set(val) {
10691
- this._setProp(key, val, true, !this._patching);
10692
- }
10693
- });
10778
+ for (const key of declaredPropKeys.map(camelize)) {
10779
+ if (key in Object.getPrototypeOf(this)) warn(`Custom element prop "${key}" conflicts with an existing property on the element and will overwrite it.`);
10780
+ Object.defineProperty(this, key, {
10781
+ get() {
10782
+ return this._getProp(key);
10783
+ },
10784
+ set(val) {
10785
+ this._setProp(key, val, true, !this._patching);
10786
+ }
10787
+ });
10788
+ }
10694
10789
  }
10695
10790
  _setAttr(key) {
10696
10791
  if (key.startsWith("data-v-")) return;
@@ -11092,13 +11187,22 @@ var Vue = (function() {
11092
11187
  }
11093
11188
  }
11094
11189
  const assignKey = Symbol("_assign");
11190
+ const initialValueKey = Symbol("_initialValue");
11095
11191
  const vModelText = {
11096
11192
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
11193
+ if (el.parentNode) {
11194
+ if (el.type === "text") el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
11195
+ else if (el.type === "textarea") el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
11196
+ }
11097
11197
  el[assignKey] = getModelAssigner(vnode);
11098
11198
  vModelTextInit(el, trim, number || !!(vnode.props && vnode.props.type === "number"), lazy);
11099
11199
  },
11100
- mounted(el, { value }) {
11101
- el.value = value == null ? "" : value;
11200
+ mounted(el, { value, modifiers: { trim, number } }) {
11201
+ const newValue = value == null ? "" : value;
11202
+ const initialValue = el[initialValueKey];
11203
+ delete el[initialValueKey];
11204
+ if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) el[assignKey](castValue(el.value, trim, number));
11205
+ else el.value = newValue;
11102
11206
  },
11103
11207
  beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
11104
11208
  el[assignKey] = getModelAssigner(vnode);
@@ -14556,15 +14660,22 @@ var Vue = (function() {
14556
14660
  else {
14557
14661
  childBlock = children[0].codegenNode;
14558
14662
  if (isTemplate && keyProperty) injectProp(childBlock, keyProperty, context);
14559
- if (childBlock.isBlock !== !isStableFragment) if (childBlock.isBlock) {
14663
+ const shouldUseBlock = !isStableFragment || childBlock.isBlockRequired === true;
14664
+ if (childBlock.isBlock !== shouldUseBlock) if (childBlock.isBlock) {
14560
14665
  removeHelper(OPEN_BLOCK);
14561
14666
  removeHelper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
14562
14667
  } else removeHelper(getVNodeHelper(context.inSSR, childBlock.isComponent));
14563
- childBlock.isBlock = !isStableFragment;
14668
+ childBlock.isBlock = shouldUseBlock;
14564
14669
  if (childBlock.isBlock) {
14565
14670
  helper(OPEN_BLOCK);
14566
14671
  helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
14567
- } else helper(getVNodeHelper(context.inSSR, childBlock.isComponent));
14672
+ } else {
14673
+ helper(getVNodeHelper(context.inSSR, childBlock.isComponent));
14674
+ if (childBlock.needsPatch) {
14675
+ var _childBlock$patchFlag;
14676
+ childBlock.patchFlag = ((_childBlock$patchFlag = childBlock.patchFlag) !== null && _childBlock$patchFlag !== void 0 ? _childBlock$patchFlag : 0) | 512;
14677
+ }
14678
+ }
14568
14679
  }
14569
14680
  if (memo) {
14570
14681
  const loop = createFunctionExpression(createForLoopParams(forNode.parseResult, [createSimpleExpression(`_cached`)]));
@@ -14788,12 +14899,16 @@ var Vue = (function() {
14788
14899
  let vnodeDynamicProps;
14789
14900
  let dynamicPropNames;
14790
14901
  let vnodeDirectives;
14902
+ let needsPatch = false;
14903
+ let isBlockRequired = false;
14791
14904
  let shouldUseBlock = isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && (tag === "svg" || tag === "foreignObject" || tag === "math");
14792
14905
  if (props.length > 0) {
14793
14906
  const propsBuildResult = buildProps(node, context, void 0, isComponent, isDynamicComponent);
14794
14907
  vnodeProps = propsBuildResult.props;
14795
14908
  patchFlag = propsBuildResult.patchFlag;
14796
14909
  dynamicPropNames = propsBuildResult.dynamicPropNames;
14910
+ needsPatch = propsBuildResult.needsPatch;
14911
+ isBlockRequired = propsBuildResult.isBlockRequired;
14797
14912
  const directives = propsBuildResult.directives;
14798
14913
  vnodeDirectives = directives && directives.length ? createArrayExpression(directives.map((dir) => buildDirectiveArgs(dir, context))) : void 0;
14799
14914
  if (propsBuildResult.shouldUseBlock) shouldUseBlock = true;
@@ -14822,7 +14937,10 @@ var Vue = (function() {
14822
14937
  } else vnodeChildren = node.children;
14823
14938
  }
14824
14939
  if (dynamicPropNames && dynamicPropNames.length) vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
14825
- node.codegenNode = createVNodeCall(context, vnodeTag, vnodeProps, vnodeChildren, patchFlag === 0 ? void 0 : patchFlag, vnodeDynamicProps, vnodeDirectives, !!shouldUseBlock, false, isComponent, node.loc);
14940
+ const vnodeCall = node.codegenNode = createVNodeCall(context, vnodeTag, vnodeProps, vnodeChildren, patchFlag === 0 ? void 0 : patchFlag, vnodeDynamicProps, vnodeDirectives, !!shouldUseBlock, false, isComponent, node.loc);
14941
+ needsPatch = needsPatch && (patchFlag === 0 || patchFlag === 32);
14942
+ if (needsPatch) vnodeCall.needsPatch = true;
14943
+ if (isBlockRequired) vnodeCall.isBlockRequired = true;
14826
14944
  };
14827
14945
  };
14828
14946
  function resolveComponentType(node, context, ssr = false) {
@@ -14856,6 +14974,7 @@ var Vue = (function() {
14856
14974
  const runtimeDirectives = [];
14857
14975
  const hasChildren = children.length > 0;
14858
14976
  let shouldUseBlock = false;
14977
+ let isBlockRequired = false;
14859
14978
  let patchFlag = 0;
14860
14979
  let hasRef = false;
14861
14980
  let hasClassBinding = false;
@@ -14880,12 +14999,12 @@ var Vue = (function() {
14880
14999
  const isEventHandler = isOn(name);
14881
15000
  if (isEventHandler && (!isComponent || isDynamicComponent) && name.toLowerCase() !== "onclick" && name !== "onUpdate:modelValue" && !isReservedProp(name)) hasHydrationEventBinding = true;
14882
15001
  if (isEventHandler && isReservedProp(name)) hasVnodeHook = true;
15002
+ if (name === "ref") hasRef = true;
14883
15003
  if (isEventHandler && value.type === 14) value = value.arguments[0];
14884
15004
  if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) return;
14885
- if (name === "ref") hasRef = true;
14886
- else if (name === "class") hasClassBinding = true;
15005
+ if (name === "class") hasClassBinding = true;
14887
15006
  else if (name === "style") hasStyleBinding = true;
14888
- else if (name !== "key" && !dynamicPropNames.includes(name)) dynamicPropNames.push(name);
15007
+ else if (name !== "ref" && name !== "key" && !dynamicPropNames.includes(name)) dynamicPropNames.push(name);
14889
15008
  if (isComponent && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) dynamicPropNames.push(name);
14890
15009
  } else hasDynamicKeys = true;
14891
15010
  };
@@ -14911,7 +15030,11 @@ var Vue = (function() {
14911
15030
  if (name === "once" || name === "memo") continue;
14912
15031
  if (name === "is" || isVBind && isStaticArgOf(arg, "is") && (isComponentTag(tag) || isCompatEnabled("COMPILER_IS_ON_ELEMENT", context))) continue;
14913
15032
  if (isVOn && ssr) continue;
14914
- if (isVBind && isStaticArgOf(arg, "key") || isVOn && hasChildren && isStaticArgOf(arg, "vue:before-update")) shouldUseBlock = true;
15033
+ if (isVBind && isStaticArgOf(arg, "key")) shouldUseBlock = true;
15034
+ if (isVOn && hasChildren && arg && isStaticExp(arg) && camelize(arg.content) === "vue:beforeUpdate") {
15035
+ shouldUseBlock = true;
15036
+ isBlockRequired = true;
15037
+ }
14915
15038
  if (isVBind && isStaticArgOf(arg, "ref")) pushRefVForMarker();
14916
15039
  if (!arg && (isVBind || isVOn)) {
14917
15040
  hasDynamicKeys = true;
@@ -14953,7 +15076,10 @@ var Vue = (function() {
14953
15076
  }
14954
15077
  } else if (!isBuiltInDirective(name)) {
14955
15078
  runtimeDirectives.push(prop);
14956
- if (hasChildren) shouldUseBlock = true;
15079
+ if (hasChildren) {
15080
+ shouldUseBlock = true;
15081
+ isBlockRequired = true;
15082
+ }
14957
15083
  }
14958
15084
  }
14959
15085
  }
@@ -14970,7 +15096,8 @@ var Vue = (function() {
14970
15096
  if (dynamicPropNames.length) patchFlag |= 8;
14971
15097
  if (hasHydrationEventBinding) patchFlag |= 32;
14972
15098
  }
14973
- if (!shouldUseBlock && (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) patchFlag |= 512;
15099
+ const needsPatch = (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0);
15100
+ if (!shouldUseBlock && needsPatch) patchFlag |= 512;
14974
15101
  if (!context.inSSR && propsExpression) switch (propsExpression.type) {
14975
15102
  case 15:
14976
15103
  let classKeyIndex = -1;
@@ -15000,7 +15127,9 @@ var Vue = (function() {
15000
15127
  directives: runtimeDirectives,
15001
15128
  patchFlag,
15002
15129
  dynamicPropNames,
15003
- shouldUseBlock
15130
+ shouldUseBlock,
15131
+ needsPatch,
15132
+ isBlockRequired
15004
15133
  };
15005
15134
  }
15006
15135
  function dedupeProperties(properties) {