@vue/compat 3.4.21 → 3.4.23

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,8 +1,10 @@
1
1
  /**
2
- * @vue/compat v3.4.21
2
+ * @vue/compat v3.4.23
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
6
+ /*! #__NO_SIDE_EFFECTS__ */
7
+ // @__NO_SIDE_EFFECTS__
6
8
  function makeMap(str, expectsLowerCase) {
7
9
  const set = new Set(str.split(","));
8
10
  return expectsLowerCase ? (val) => set.has(val.toLowerCase()) : (val) => set.has(val);
@@ -354,7 +356,11 @@ const replacer = (_key, val) => {
354
356
  };
355
357
  const stringifySymbol = (v, i = "") => {
356
358
  var _a;
357
- return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;
359
+ return (
360
+ // Symbol.description in es2019+ so we need to cast here to pass
361
+ // the lib: es2016 check
362
+ isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v
363
+ );
358
364
  };
359
365
 
360
366
  function warn$2(msg, ...args) {
@@ -790,6 +796,8 @@ function createArrayInstrumentations() {
790
796
  return instrumentations;
791
797
  }
792
798
  function hasOwnProperty(key) {
799
+ if (!isSymbol(key))
800
+ key = String(key);
793
801
  const obj = toRaw(this);
794
802
  track(obj, "has", key);
795
803
  return obj.hasOwnProperty(key);
@@ -1142,23 +1150,16 @@ function createInstrumentations() {
1142
1150
  clear: createReadonlyMethod("clear"),
1143
1151
  forEach: createForEach(true, true)
1144
1152
  };
1145
- const iteratorMethods = ["keys", "values", "entries", Symbol.iterator];
1153
+ const iteratorMethods = [
1154
+ "keys",
1155
+ "values",
1156
+ "entries",
1157
+ Symbol.iterator
1158
+ ];
1146
1159
  iteratorMethods.forEach((method) => {
1147
- mutableInstrumentations2[method] = createIterableMethod(
1148
- method,
1149
- false,
1150
- false
1151
- );
1152
- readonlyInstrumentations2[method] = createIterableMethod(
1153
- method,
1154
- true,
1155
- false
1156
- );
1157
- shallowInstrumentations2[method] = createIterableMethod(
1158
- method,
1159
- false,
1160
- true
1161
- );
1160
+ mutableInstrumentations2[method] = createIterableMethod(method, false, false);
1161
+ readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
1162
+ shallowInstrumentations2[method] = createIterableMethod(method, false, true);
1162
1163
  shallowReadonlyInstrumentations2[method] = createIterableMethod(
1163
1164
  method,
1164
1165
  true,
@@ -1315,7 +1316,7 @@ function isShallow(value) {
1315
1316
  return !!(value && value["__v_isShallow"]);
1316
1317
  }
1317
1318
  function isProxy(value) {
1318
- return isReactive(value) || isReadonly(value);
1319
+ return value ? !!value["__v_raw"] : false;
1319
1320
  }
1320
1321
  function toRaw(observed) {
1321
1322
  const raw = observed && observed["__v_raw"];
@@ -1777,11 +1778,17 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
1777
1778
  }
1778
1779
  return res;
1779
1780
  }
1780
- const values = [];
1781
- for (let i = 0; i < fn.length; i++) {
1782
- values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
1781
+ if (isArray(fn)) {
1782
+ const values = [];
1783
+ for (let i = 0; i < fn.length; i++) {
1784
+ values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
1785
+ }
1786
+ return values;
1787
+ } else {
1788
+ warn$1(
1789
+ `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`
1790
+ );
1783
1791
  }
1784
- return values;
1785
1792
  }
1786
1793
  function handleError(err, instance, type, throwInDev = true) {
1787
1794
  const contextVNode = instance ? instance.vnode : null;
@@ -1802,12 +1809,14 @@ function handleError(err, instance, type, throwInDev = true) {
1802
1809
  }
1803
1810
  const appErrorHandler = instance.appContext.config.errorHandler;
1804
1811
  if (appErrorHandler) {
1812
+ pauseTracking();
1805
1813
  callWithErrorHandling(
1806
1814
  appErrorHandler,
1807
1815
  null,
1808
1816
  10,
1809
1817
  [err, exposedInstance, errorInfo]
1810
1818
  );
1819
+ resetTracking();
1811
1820
  return;
1812
1821
  }
1813
1822
  }
@@ -2183,6 +2192,8 @@ const devtoolsComponentRemoved = (component) => {
2183
2192
  _devtoolsComponentRemoved(component);
2184
2193
  }
2185
2194
  };
2195
+ /*! #__NO_SIDE_EFFECTS__ */
2196
+ // @__NO_SIDE_EFFECTS__
2186
2197
  function createDevtoolsComponentHook(hook) {
2187
2198
  return (component) => {
2188
2199
  emit$2(
@@ -4834,7 +4845,7 @@ const KeepAliveImpl = {
4834
4845
  return () => {
4835
4846
  pendingCacheKey = null;
4836
4847
  if (!slots.default) {
4837
- return null;
4848
+ return current = null;
4838
4849
  }
4839
4850
  const children = slots.default();
4840
4851
  const rawVNode = children[0];
@@ -5565,47 +5576,74 @@ function installCompatInstanceProperties(map) {
5565
5576
  $once: (i) => once.bind(null, i),
5566
5577
  $off: (i) => off.bind(null, i),
5567
5578
  $children: getCompatChildren,
5568
- $listeners: getCompatListeners
5579
+ $listeners: getCompatListeners,
5580
+ // inject additional properties into $options for compat
5581
+ // e.g. vuex needs this.$options.parent
5582
+ $options: (i) => {
5583
+ if (!isCompatEnabled$1("PRIVATE_APIS", i)) {
5584
+ return resolveMergedOptions(i);
5585
+ }
5586
+ if (i.resolvedOptions) {
5587
+ return i.resolvedOptions;
5588
+ }
5589
+ const res = i.resolvedOptions = extend({}, resolveMergedOptions(i));
5590
+ Object.defineProperties(res, {
5591
+ parent: {
5592
+ get() {
5593
+ warnDeprecation$1("PRIVATE_APIS", i, "$options.parent");
5594
+ return i.proxy.$parent;
5595
+ }
5596
+ },
5597
+ propsData: {
5598
+ get() {
5599
+ warnDeprecation$1(
5600
+ "PRIVATE_APIS",
5601
+ i,
5602
+ "$options.propsData"
5603
+ );
5604
+ return i.vnode.props;
5605
+ }
5606
+ }
5607
+ });
5608
+ return res;
5609
+ }
5569
5610
  });
5570
- if (isCompatEnabled$1("PRIVATE_APIS", null)) {
5571
- extend(map, {
5572
- // needed by many libs / render fns
5573
- $vnode: (i) => i.vnode,
5574
- // inject additional properties into $options for compat
5575
- // e.g. vuex needs this.$options.parent
5576
- $options: (i) => {
5577
- const res = extend({}, resolveMergedOptions(i));
5578
- res.parent = i.proxy.$parent;
5579
- res.propsData = i.vnode.props;
5580
- return res;
5581
- },
5582
- // some private properties that are likely accessed...
5583
- _self: (i) => i.proxy,
5584
- _uid: (i) => i.uid,
5585
- _data: (i) => i.data,
5586
- _isMounted: (i) => i.isMounted,
5587
- _isDestroyed: (i) => i.isUnmounted,
5588
- // v2 render helpers
5589
- $createElement: () => compatH,
5590
- _c: () => compatH,
5591
- _o: () => legacyMarkOnce,
5592
- _n: () => looseToNumber,
5593
- _s: () => toDisplayString,
5594
- _l: () => renderList,
5595
- _t: (i) => legacyRenderSlot.bind(null, i),
5596
- _q: () => looseEqual,
5597
- _i: () => looseIndexOf,
5598
- _m: (i) => legacyRenderStatic.bind(null, i),
5599
- _f: () => resolveFilter$1,
5600
- _k: (i) => legacyCheckKeyCodes.bind(null, i),
5601
- _b: () => legacyBindObjectProps,
5602
- _v: () => createTextVNode,
5603
- _e: () => createCommentVNode,
5604
- _u: () => legacyresolveScopedSlots,
5605
- _g: () => legacyBindObjectListeners,
5606
- _d: () => legacyBindDynamicKeys,
5607
- _p: () => legacyPrependModifier
5608
- });
5611
+ const privateAPIs = {
5612
+ // needed by many libs / render fns
5613
+ $vnode: (i) => i.vnode,
5614
+ // some private properties that are likely accessed...
5615
+ _self: (i) => i.proxy,
5616
+ _uid: (i) => i.uid,
5617
+ _data: (i) => i.data,
5618
+ _isMounted: (i) => i.isMounted,
5619
+ _isDestroyed: (i) => i.isUnmounted,
5620
+ // v2 render helpers
5621
+ $createElement: () => compatH,
5622
+ _c: () => compatH,
5623
+ _o: () => legacyMarkOnce,
5624
+ _n: () => looseToNumber,
5625
+ _s: () => toDisplayString,
5626
+ _l: () => renderList,
5627
+ _t: (i) => legacyRenderSlot.bind(null, i),
5628
+ _q: () => looseEqual,
5629
+ _i: () => looseIndexOf,
5630
+ _m: (i) => legacyRenderStatic.bind(null, i),
5631
+ _f: () => resolveFilter$1,
5632
+ _k: (i) => legacyCheckKeyCodes.bind(null, i),
5633
+ _b: () => legacyBindObjectProps,
5634
+ _v: () => createTextVNode,
5635
+ _e: () => createCommentVNode,
5636
+ _u: () => legacyresolveScopedSlots,
5637
+ _g: () => legacyBindObjectListeners,
5638
+ _d: () => legacyBindDynamicKeys,
5639
+ _p: () => legacyPrependModifier
5640
+ };
5641
+ for (const key in privateAPIs) {
5642
+ map[key] = (i) => {
5643
+ if (isCompatEnabled$1("PRIVATE_APIS", i)) {
5644
+ return privateAPIs[key](i);
5645
+ }
5646
+ };
5609
5647
  }
5610
5648
  }
5611
5649
 
@@ -5646,6 +5684,9 @@ const isReservedPrefix = (key) => key === "_" || key === "$";
5646
5684
  const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
5647
5685
  const PublicInstanceProxyHandlers = {
5648
5686
  get({ _: instance }, key) {
5687
+ if (key === "__v_skip") {
5688
+ return true;
5689
+ }
5649
5690
  const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
5650
5691
  if (key === "__isVue") {
5651
5692
  return true;
@@ -5688,7 +5729,7 @@ const PublicInstanceProxyHandlers = {
5688
5729
  let cssModule, globalProperties;
5689
5730
  if (publicGetter) {
5690
5731
  if (key === "$attrs") {
5691
- track(instance, "get", key);
5732
+ track(instance.attrs, "get", "");
5692
5733
  markAttrsAccessed();
5693
5734
  } else if (key === "$slots") {
5694
5735
  track(instance, "get", key);
@@ -6500,7 +6541,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6500
6541
  return vm;
6501
6542
  }
6502
6543
  }
6503
- Vue.version = `2.6.14-compat:${"3.4.21"}`;
6544
+ Vue.version = `2.6.14-compat:${"3.4.23"}`;
6504
6545
  Vue.config = singletonApp.config;
6505
6546
  Vue.use = (p, ...options) => {
6506
6547
  if (p && isFunction(p.install)) {
@@ -6694,15 +6735,14 @@ function applySingletonPrototype(app, Ctor) {
6694
6735
  app.config.globalProperties = Object.create(Ctor.prototype);
6695
6736
  }
6696
6737
  let hasPrototypeAugmentations = false;
6697
- const descriptors = Object.getOwnPropertyDescriptors(Ctor.prototype);
6698
- for (const key in descriptors) {
6738
+ for (const key of Object.getOwnPropertyNames(Ctor.prototype)) {
6699
6739
  if (key !== "constructor") {
6700
6740
  hasPrototypeAugmentations = true;
6701
6741
  if (enabled) {
6702
6742
  Object.defineProperty(
6703
6743
  app.config.globalProperties,
6704
6744
  key,
6705
- descriptors[key]
6745
+ Object.getOwnPropertyDescriptor(Ctor.prototype, key)
6706
6746
  );
6707
6747
  }
6708
6748
  }
@@ -7138,10 +7178,13 @@ function shouldSkipAttr(key, instance) {
7138
7178
  return false;
7139
7179
  }
7140
7180
 
7181
+ const internalObjectProto = /* @__PURE__ */ Object.create(null);
7182
+ const createInternalObject = () => Object.create(internalObjectProto);
7183
+ const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
7184
+
7141
7185
  function initProps(instance, rawProps, isStateful, isSSR = false) {
7142
7186
  const props = {};
7143
- const attrs = {};
7144
- def(attrs, InternalObjectKey, 1);
7187
+ const attrs = createInternalObject();
7145
7188
  instance.propsDefaults = /* @__PURE__ */ Object.create(null);
7146
7189
  setFullProps(instance, rawProps, props, attrs);
7147
7190
  for (const key in instance.propsOptions[0]) {
@@ -7263,7 +7306,7 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
7263
7306
  }
7264
7307
  }
7265
7308
  if (hasAttrsChanged) {
7266
- trigger(instance, "set", "$attrs");
7309
+ trigger(instance.attrs, "set", "");
7267
7310
  }
7268
7311
  {
7269
7312
  validateProps(rawProps || {}, props, instance);
@@ -7621,21 +7664,20 @@ const initSlots = (instance, children) => {
7621
7664
  const type = children._;
7622
7665
  if (type) {
7623
7666
  instance.slots = toRaw(children);
7624
- def(children, "_", type);
7667
+ def(instance.slots, "_", type);
7625
7668
  } else {
7626
7669
  normalizeObjectSlots(
7627
7670
  children,
7628
- instance.slots = {},
7671
+ instance.slots = createInternalObject(),
7629
7672
  instance
7630
7673
  );
7631
7674
  }
7632
7675
  } else {
7633
- instance.slots = {};
7676
+ instance.slots = createInternalObject();
7634
7677
  if (children) {
7635
7678
  normalizeVNodeSlots(instance, children);
7636
7679
  }
7637
7680
  }
7638
- def(instance.slots, InternalObjectKey, 1);
7639
7681
  };
7640
7682
  const updateSlots = (instance, children, optimized) => {
7641
7683
  const { vnode, slots } = instance;
@@ -7807,6 +7849,7 @@ function createHydrationFunctions(rendererInternals) {
7807
7849
  }
7808
7850
  };
7809
7851
  const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
7852
+ optimized = optimized || !!vnode.dynamicChildren;
7810
7853
  const isFragmentStart = isComment(node) && node.data === "[";
7811
7854
  const onMismatch = () => handleMismatch(
7812
7855
  node,
@@ -10326,7 +10369,6 @@ const createVNodeWithArgsTransform = (...args) => {
10326
10369
  ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args
10327
10370
  );
10328
10371
  };
10329
- const InternalObjectKey = `__vInternal`;
10330
10372
  const normalizeKey = ({ key }) => key != null ? key : null;
10331
10373
  const normalizeRef = ({
10332
10374
  ref,
@@ -10466,7 +10508,7 @@ Component that was made reactive: `,
10466
10508
  function guardReactiveProps(props) {
10467
10509
  if (!props)
10468
10510
  return null;
10469
- return isProxy(props) || InternalObjectKey in props ? extend({}, props) : props;
10511
+ return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
10470
10512
  }
10471
10513
  function cloneVNode(vnode, extraProps, mergeRef = false) {
10472
10514
  const { props, ref, patchFlag, children } = vnode;
@@ -10574,7 +10616,7 @@ function normalizeChildren(vnode, children) {
10574
10616
  } else {
10575
10617
  type = 32;
10576
10618
  const slotFlag = children._;
10577
- if (!slotFlag && !(InternalObjectKey in children)) {
10619
+ if (!slotFlag && !isInternalObject(children)) {
10578
10620
  children._ctx = currentRenderingInstance;
10579
10621
  } else if (slotFlag === 3 && currentRenderingInstance) {
10580
10622
  if (currentRenderingInstance.slots._ === 1) {
@@ -10795,7 +10837,7 @@ function setupStatefulComponent(instance, isSSR) {
10795
10837
  }
10796
10838
  }
10797
10839
  instance.accessCache = /* @__PURE__ */ Object.create(null);
10798
- instance.proxy = markRaw(new Proxy(instance.ctx, PublicInstanceProxyHandlers));
10840
+ instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
10799
10841
  {
10800
10842
  exposePropsOnRenderContext(instance);
10801
10843
  }
@@ -10939,26 +10981,21 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
10939
10981
  }
10940
10982
  }
10941
10983
  }
10942
- function getAttrsProxy(instance) {
10943
- return instance.attrsProxy || (instance.attrsProxy = new Proxy(
10944
- instance.attrs,
10945
- {
10946
- get(target, key) {
10947
- markAttrsAccessed();
10948
- track(instance, "get", "$attrs");
10949
- return target[key];
10950
- },
10951
- set() {
10952
- warn$1(`setupContext.attrs is readonly.`);
10953
- return false;
10954
- },
10955
- deleteProperty() {
10956
- warn$1(`setupContext.attrs is readonly.`);
10957
- return false;
10958
- }
10959
- }
10960
- ));
10961
- }
10984
+ const attrsProxyHandlers = {
10985
+ get(target, key) {
10986
+ markAttrsAccessed();
10987
+ track(target, "get", "");
10988
+ return target[key];
10989
+ },
10990
+ set() {
10991
+ warn$1(`setupContext.attrs is readonly.`);
10992
+ return false;
10993
+ },
10994
+ deleteProperty() {
10995
+ warn$1(`setupContext.attrs is readonly.`);
10996
+ return false;
10997
+ }
10998
+ } ;
10962
10999
  function getSlotsProxy(instance) {
10963
11000
  return instance.slotsProxy || (instance.slotsProxy = new Proxy(instance.slots, {
10964
11001
  get(target, key) {
@@ -10992,9 +11029,10 @@ function createSetupContext(instance) {
10992
11029
  instance.exposed = exposed || {};
10993
11030
  };
10994
11031
  {
11032
+ let attrsProxy;
10995
11033
  return Object.freeze({
10996
11034
  get attrs() {
10997
- return getAttrsProxy(instance);
11035
+ return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers));
10998
11036
  },
10999
11037
  get slots() {
11000
11038
  return getSlotsProxy(instance);
@@ -11339,7 +11377,7 @@ function isMemoSame(cached, memo) {
11339
11377
  return true;
11340
11378
  }
11341
11379
 
11342
- const version = "3.4.21";
11380
+ const version = "3.4.23";
11343
11381
  const warn = warn$1 ;
11344
11382
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11345
11383
  const devtools = devtools$1 ;
@@ -11809,8 +11847,8 @@ function useCssVars(getter) {
11809
11847
  setVarsOnVNode(instance.subTree, vars);
11810
11848
  updateTeleports(vars);
11811
11849
  };
11812
- watchPostEffect(setVars);
11813
11850
  onMounted(() => {
11851
+ watchPostEffect(setVars);
11814
11852
  const ob = new MutationObserver(setVars);
11815
11853
  ob.observe(instance.subTree.el.parentNode, { childList: true });
11816
11854
  onUnmounted(() => ob.disconnect());
@@ -12076,11 +12114,14 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
12076
12114
  const invokers = el[veiKey] || (el[veiKey] = {});
12077
12115
  const existingInvoker = invokers[rawName];
12078
12116
  if (nextValue && existingInvoker) {
12079
- existingInvoker.value = nextValue;
12117
+ existingInvoker.value = sanitizeEventValue(nextValue, rawName) ;
12080
12118
  } else {
12081
12119
  const [name, options] = parseName(rawName);
12082
12120
  if (nextValue) {
12083
- const invoker = invokers[rawName] = createInvoker(nextValue, instance);
12121
+ const invoker = invokers[rawName] = createInvoker(
12122
+ sanitizeEventValue(nextValue, rawName) ,
12123
+ instance
12124
+ );
12084
12125
  addEventListener(el, name, invoker, options);
12085
12126
  } else if (existingInvoker) {
12086
12127
  removeEventListener(el, name, existingInvoker, options);
@@ -12123,6 +12164,16 @@ function createInvoker(initialValue, instance) {
12123
12164
  invoker.attached = getNow();
12124
12165
  return invoker;
12125
12166
  }
12167
+ function sanitizeEventValue(value, propName) {
12168
+ if (isFunction(value) || isArray(value)) {
12169
+ return value;
12170
+ }
12171
+ warn(
12172
+ `Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?
12173
+ Expected function or array of functions, received type ${typeof value}.`
12174
+ );
12175
+ return NOOP;
12176
+ }
12126
12177
  function patchStopImmediatePropagation(e, value) {
12127
12178
  if (isArray(value)) {
12128
12179
  const originalStop = e.stopImmediatePropagation;
@@ -12130,7 +12181,9 @@ function patchStopImmediatePropagation(e, value) {
12130
12181
  originalStop.call(e);
12131
12182
  e._stopped = true;
12132
12183
  };
12133
- return value.map((fn) => (e2) => !e2._stopped && fn && fn(e2));
12184
+ return value.map(
12185
+ (fn) => (e2) => !e2._stopped && fn && fn(e2)
12186
+ );
12134
12187
  } else {
12135
12188
  return value;
12136
12189
  }
@@ -12331,7 +12384,7 @@ class VueElement extends BaseClass {
12331
12384
  }
12332
12385
  }
12333
12386
  _setAttr(key) {
12334
- let value = this.getAttribute(key);
12387
+ let value = this.hasAttribute(key) ? this.getAttribute(key) : void 0;
12335
12388
  const camelKey = camelize(key);
12336
12389
  if (this._numberProps && this._numberProps[camelKey]) {
12337
12390
  value = toNumber(value);
@@ -12503,7 +12556,28 @@ const TransitionGroupImpl = {
12503
12556
  )) {
12504
12557
  tag = "span";
12505
12558
  }
12506
- prevChildren = children;
12559
+ prevChildren = [];
12560
+ if (children) {
12561
+ for (let i = 0; i < children.length; i++) {
12562
+ const child = children[i];
12563
+ if (child.el && child.el instanceof Element) {
12564
+ prevChildren.push(child);
12565
+ setTransitionHooks(
12566
+ child,
12567
+ resolveTransitionHooks(
12568
+ child,
12569
+ cssTransitionProps,
12570
+ state,
12571
+ instance
12572
+ )
12573
+ );
12574
+ positionMap.set(
12575
+ child,
12576
+ child.el.getBoundingClientRect()
12577
+ );
12578
+ }
12579
+ }
12580
+ }
12507
12581
  children = slots.default ? getTransitionRawChildren(slots.default()) : [];
12508
12582
  for (let i = 0; i < children.length; i++) {
12509
12583
  const child = children[i];
@@ -12516,16 +12590,6 @@ const TransitionGroupImpl = {
12516
12590
  warn(`<TransitionGroup> children must be keyed.`);
12517
12591
  }
12518
12592
  }
12519
- if (prevChildren) {
12520
- for (let i = 0; i < prevChildren.length; i++) {
12521
- const child = prevChildren[i];
12522
- setTransitionHooks(
12523
- child,
12524
- resolveTransitionHooks(child, cssTransitionProps, state, instance)
12525
- );
12526
- positionMap.set(child, child.el.getBoundingClientRect());
12527
- }
12528
- }
12529
12593
  return createVNode(tag, null, children);
12530
12594
  };
12531
12595
  }
@@ -12627,7 +12691,7 @@ const vModelText = {
12627
12691
  el[assignKey] = getModelAssigner(vnode);
12628
12692
  if (el.composing)
12629
12693
  return;
12630
- const elValue = number || el.type === "number" ? looseToNumber(el.value) : el.value;
12694
+ const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
12631
12695
  const newValue = value == null ? "" : value;
12632
12696
  if (elValue === newValue) {
12633
12697
  return;
@@ -12730,14 +12794,14 @@ const vModelSelect = {
12730
12794
  // set value in mounted & updated because <select> relies on its children
12731
12795
  // <option>s.
12732
12796
  mounted(el, { value, modifiers: { number } }) {
12733
- setSelected(el, value, number);
12797
+ setSelected(el, value);
12734
12798
  },
12735
12799
  beforeUpdate(el, _binding, vnode) {
12736
12800
  el[assignKey] = getModelAssigner(vnode);
12737
12801
  },
12738
12802
  updated(el, { value, modifiers: { number } }) {
12739
12803
  if (!el._assigning) {
12740
- setSelected(el, value, number);
12804
+ setSelected(el, value);
12741
12805
  }
12742
12806
  }
12743
12807
  };
@@ -12757,9 +12821,7 @@ function setSelected(el, value, number) {
12757
12821
  if (isArrayValue) {
12758
12822
  const optionType = typeof optionValue;
12759
12823
  if (optionType === "string" || optionType === "number") {
12760
- option.selected = value.includes(
12761
- number ? looseToNumber(optionValue) : optionValue
12762
- );
12824
+ option.selected = value.some((v) => String(v) === String(optionValue));
12763
12825
  } else {
12764
12826
  option.selected = looseIndexOf(value, optionValue) > -1;
12765
12827
  }
@@ -15080,7 +15142,7 @@ function onCloseTag(el, end, isImplied = false) {
15080
15142
  if (isImplied) {
15081
15143
  setLocEnd(el.loc, backTrack(end, 60));
15082
15144
  } else {
15083
- setLocEnd(el.loc, end + 1);
15145
+ setLocEnd(el.loc, lookAhead(end, 62) + 1);
15084
15146
  }
15085
15147
  if (tokenizer.inSFCRoot) {
15086
15148
  if (el.children.length) {
@@ -15175,6 +15237,12 @@ function onCloseTag(el, end, isImplied = false) {
15175
15237
  }
15176
15238
  }
15177
15239
  }
15240
+ function lookAhead(index, c) {
15241
+ let i = index;
15242
+ while (currentInput.charCodeAt(i) !== c && i < currentInput.length - 1)
15243
+ i++;
15244
+ return i;
15245
+ }
15178
15246
  function backTrack(index, c) {
15179
15247
  let i = index;
15180
15248
  while (currentInput.charCodeAt(i) !== c && i >= 0)
@@ -17356,13 +17424,27 @@ const transformElement = (node, context) => {
17356
17424
  function resolveComponentType(node, context, ssr = false) {
17357
17425
  let { tag } = node;
17358
17426
  const isExplicitDynamic = isComponentTag(tag);
17359
- const isProp = findProp(node, "is");
17427
+ const isProp = findProp(
17428
+ node,
17429
+ "is",
17430
+ false,
17431
+ true
17432
+ /* allow empty */
17433
+ );
17360
17434
  if (isProp) {
17361
17435
  if (isExplicitDynamic || isCompatEnabled(
17362
17436
  "COMPILER_IS_ON_ELEMENT",
17363
17437
  context
17364
17438
  )) {
17365
- const exp = isProp.type === 6 ? isProp.value && createSimpleExpression(isProp.value.content, true) : isProp.exp;
17439
+ let exp;
17440
+ if (isProp.type === 6) {
17441
+ exp = isProp.value && createSimpleExpression(isProp.value.content, true);
17442
+ } else {
17443
+ exp = isProp.exp;
17444
+ if (!exp) {
17445
+ exp = createSimpleExpression(`is`, false, isProp.loc);
17446
+ }
17447
+ }
17366
17448
  if (exp) {
17367
17449
  return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [
17368
17450
  exp