@vue/runtime-dom 3.4.19 → 3.4.21

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/runtime-dom v3.4.19
2
+ * @vue/runtime-dom v3.4.21
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -358,10 +358,11 @@ function patchClass(el, value, isSVG) {
358
358
  }
359
359
  }
360
360
 
361
- const vShowOldKey = Symbol("_vod");
361
+ const vShowOriginalDisplay = Symbol("_vod");
362
+ const vShowHidden = Symbol("_vsh");
362
363
  const vShow = {
363
364
  beforeMount(el, { value }, { transition }) {
364
- el[vShowOldKey] = el.style.display === "none" ? "" : el.style.display;
365
+ el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
365
366
  if (transition && value) {
366
367
  transition.beforeEnter(el);
367
368
  } else {
@@ -374,7 +375,7 @@ const vShow = {
374
375
  }
375
376
  },
376
377
  updated(el, { value, oldValue }, { transition }) {
377
- if (!value === !oldValue && (el.style.display === el[vShowOldKey] || !value))
378
+ if (!value === !oldValue)
378
379
  return;
379
380
  if (transition) {
380
381
  if (value) {
@@ -398,7 +399,8 @@ if (!!(process.env.NODE_ENV !== "production")) {
398
399
  vShow.name = "show";
399
400
  }
400
401
  function setDisplay(el, value) {
401
- el.style.display = value ? el[vShowOldKey] : "none";
402
+ el.style.display = value ? el[vShowOriginalDisplay] : "none";
403
+ el[vShowHidden] = !value;
402
404
  }
403
405
  function initVShowForSSR() {
404
406
  vShow.getSSRProps = ({ value }) => {
@@ -478,13 +480,21 @@ const displayRE = /(^|;)\s*display\s*:/;
478
480
  function patchStyle(el, prev, next) {
479
481
  const style = el.style;
480
482
  const isCssString = isString(next);
481
- const currentDisplay = style.display;
482
483
  let hasControlledDisplay = false;
483
484
  if (next && !isCssString) {
484
- if (prev && !isString(prev)) {
485
- for (const key in prev) {
486
- if (next[key] == null) {
487
- setStyle(style, key, "");
485
+ if (prev) {
486
+ if (!isString(prev)) {
487
+ for (const key in prev) {
488
+ if (next[key] == null) {
489
+ setStyle(style, key, "");
490
+ }
491
+ }
492
+ } else {
493
+ for (const prevStyle of prev.split(";")) {
494
+ const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
495
+ if (next[key] == null) {
496
+ setStyle(style, key, "");
497
+ }
488
498
  }
489
499
  }
490
500
  }
@@ -508,9 +518,11 @@ function patchStyle(el, prev, next) {
508
518
  el.removeAttribute("style");
509
519
  }
510
520
  }
511
- if (vShowOldKey in el) {
512
- el[vShowOldKey] = hasControlledDisplay ? style.display : "";
513
- style.display = currentDisplay;
521
+ if (vShowOriginalDisplay in el) {
522
+ el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
523
+ if (el[vShowHidden]) {
524
+ style.display = "none";
525
+ }
514
526
  }
515
527
  }
516
528
  const semicolonRE = /[^\\];\s*$/;
@@ -594,15 +606,15 @@ function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspe
594
606
  const tag = el.tagName;
595
607
  if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
596
608
  !tag.includes("-")) {
597
- el._value = value;
598
- const oldValue = tag === "OPTION" ? el.getAttribute("value") : el.value;
609
+ const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
599
610
  const newValue = value == null ? "" : value;
600
- if (oldValue !== newValue) {
611
+ if (oldValue !== newValue || !("_value" in el)) {
601
612
  el.value = newValue;
602
613
  }
603
614
  if (value == null) {
604
615
  el.removeAttribute(key);
605
616
  }
617
+ el._value = value;
606
618
  return;
607
619
  }
608
620
  let needRemove = false;
@@ -1286,19 +1298,19 @@ const vModelSelect = {
1286
1298
  },
1287
1299
  // set value in mounted & updated because <select> relies on its children
1288
1300
  // <option>s.
1289
- mounted(el, { value, oldValue, modifiers: { number } }) {
1290
- setSelected(el, value, oldValue, number);
1301
+ mounted(el, { value, modifiers: { number } }) {
1302
+ setSelected(el, value, number);
1291
1303
  },
1292
1304
  beforeUpdate(el, _binding, vnode) {
1293
1305
  el[assignKey] = getModelAssigner(vnode);
1294
1306
  },
1295
- updated(el, { value, oldValue, modifiers: { number } }) {
1307
+ updated(el, { value, modifiers: { number } }) {
1296
1308
  if (!el._assigning) {
1297
- setSelected(el, value, oldValue, number);
1309
+ setSelected(el, value, number);
1298
1310
  }
1299
1311
  }
1300
1312
  };
1301
- function setSelected(el, value, oldValue, number) {
1313
+ function setSelected(el, value, number) {
1302
1314
  const isMultiple = el.multiple;
1303
1315
  const isArrayValue = isArray(value);
1304
1316
  if (isMultiple && !isArrayValue && !isSet(value)) {
@@ -1323,12 +1335,10 @@ function setSelected(el, value, oldValue, number) {
1323
1335
  } else {
1324
1336
  option.selected = value.has(optionValue);
1325
1337
  }
1326
- } else {
1327
- if (looseEqual(getValue(option), value)) {
1328
- if (el.selectedIndex !== i)
1329
- el.selectedIndex = i;
1330
- return;
1331
- }
1338
+ } else if (looseEqual(getValue(option), value)) {
1339
+ if (el.selectedIndex !== i)
1340
+ el.selectedIndex = i;
1341
+ return;
1332
1342
  }
1333
1343
  }
1334
1344
  if (!isMultiple && el.selectedIndex !== -1) {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.4.19
2
+ * @vue/runtime-dom v3.4.21
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -733,20 +733,20 @@ var VueRuntimeDOM = (function (exports) {
733
733
  return obj.hasOwnProperty(key);
734
734
  }
735
735
  class BaseReactiveHandler {
736
- constructor(_isReadonly = false, _shallow = false) {
736
+ constructor(_isReadonly = false, _isShallow = false) {
737
737
  this._isReadonly = _isReadonly;
738
- this._shallow = _shallow;
738
+ this._isShallow = _isShallow;
739
739
  }
740
740
  get(target, key, receiver) {
741
- const isReadonly2 = this._isReadonly, shallow = this._shallow;
741
+ const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
742
742
  if (key === "__v_isReactive") {
743
743
  return !isReadonly2;
744
744
  } else if (key === "__v_isReadonly") {
745
745
  return isReadonly2;
746
746
  } else if (key === "__v_isShallow") {
747
- return shallow;
747
+ return isShallow2;
748
748
  } else if (key === "__v_raw") {
749
- if (receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
749
+ if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
750
750
  // this means the reciever is a user proxy of the reactive proxy
751
751
  Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
752
752
  return target;
@@ -769,7 +769,7 @@ var VueRuntimeDOM = (function (exports) {
769
769
  if (!isReadonly2) {
770
770
  track(target, "get", key);
771
771
  }
772
- if (shallow) {
772
+ if (isShallow2) {
773
773
  return res;
774
774
  }
775
775
  if (isRef(res)) {
@@ -782,12 +782,12 @@ var VueRuntimeDOM = (function (exports) {
782
782
  }
783
783
  }
784
784
  class MutableReactiveHandler extends BaseReactiveHandler {
785
- constructor(shallow = false) {
786
- super(false, shallow);
785
+ constructor(isShallow2 = false) {
786
+ super(false, isShallow2);
787
787
  }
788
788
  set(target, key, value, receiver) {
789
789
  let oldValue = target[key];
790
- if (!this._shallow) {
790
+ if (!this._isShallow) {
791
791
  const isOldValueReadonly = isReadonly(oldValue);
792
792
  if (!isShallow(value) && !isReadonly(value)) {
793
793
  oldValue = toRaw(oldValue);
@@ -839,8 +839,8 @@ var VueRuntimeDOM = (function (exports) {
839
839
  }
840
840
  }
841
841
  class ReadonlyReactiveHandler extends BaseReactiveHandler {
842
- constructor(shallow = false) {
843
- super(true, shallow);
842
+ constructor(isShallow2 = false) {
843
+ super(true, isShallow2);
844
844
  }
845
845
  set(target, key) {
846
846
  {
@@ -1011,7 +1011,7 @@ var VueRuntimeDOM = (function (exports) {
1011
1011
  return function(...args) {
1012
1012
  {
1013
1013
  const key = args[0] ? `on key "${args[0]}" ` : ``;
1014
- console.warn(
1014
+ warn$2(
1015
1015
  `${capitalize(type)} operation ${key}failed: target is readonly.`,
1016
1016
  toRaw(this)
1017
1017
  );
@@ -1149,7 +1149,7 @@ var VueRuntimeDOM = (function (exports) {
1149
1149
  const rawKey = toRaw(key);
1150
1150
  if (rawKey !== key && has2.call(target, rawKey)) {
1151
1151
  const type = toRawType(target);
1152
- console.warn(
1152
+ warn$2(
1153
1153
  `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`
1154
1154
  );
1155
1155
  }
@@ -1218,7 +1218,7 @@ var VueRuntimeDOM = (function (exports) {
1218
1218
  function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
1219
1219
  if (!isObject(target)) {
1220
1220
  {
1221
- console.warn(`value cannot be made reactive: ${String(target)}`);
1221
+ warn$2(`value cannot be made reactive: ${String(target)}`);
1222
1222
  }
1223
1223
  return target;
1224
1224
  }
@@ -1271,6 +1271,7 @@ var VueRuntimeDOM = (function (exports) {
1271
1271
  const COMPUTED_SIDE_EFFECT_WARN = `Computed is still dirty after getter evaluation, likely because a computed is mutating its own dependency in its getter. State mutations in computed getters should be avoided. Check the docs for more details: https://vuejs.org/guide/essentials/computed.html#getters-should-be-side-effect-free`;
1272
1272
  class ComputedRefImpl {
1273
1273
  constructor(getter, _setter, isReadonly, isSSR) {
1274
+ this.getter = getter;
1274
1275
  this._setter = _setter;
1275
1276
  this.dep = void 0;
1276
1277
  this.__v_isRef = true;
@@ -1293,7 +1294,11 @@ var VueRuntimeDOM = (function (exports) {
1293
1294
  }
1294
1295
  trackRefValue(self);
1295
1296
  if (self.effect._dirtyLevel >= 2) {
1296
- warn$2(COMPUTED_SIDE_EFFECT_WARN);
1297
+ if (this._warnRecursive) {
1298
+ warn$2(COMPUTED_SIDE_EFFECT_WARN, `
1299
+
1300
+ getter: `, this.getter);
1301
+ }
1297
1302
  triggerRefValue(self, 2);
1298
1303
  }
1299
1304
  return self._value;
@@ -1449,7 +1454,7 @@ var VueRuntimeDOM = (function (exports) {
1449
1454
  }
1450
1455
  function toRefs(object) {
1451
1456
  if (!isProxy(object)) {
1452
- console.warn(`toRefs() expects a reactive object but received a plain one.`);
1457
+ warn$2(`toRefs() expects a reactive object but received a plain one.`);
1453
1458
  }
1454
1459
  const ret = isArray(object) ? new Array(object.length) : {};
1455
1460
  for (const key in object) {
@@ -1531,7 +1536,10 @@ var VueRuntimeDOM = (function (exports) {
1531
1536
  instance,
1532
1537
  11,
1533
1538
  [
1534
- msg + args.join(""),
1539
+ msg + args.map((a) => {
1540
+ var _a, _b;
1541
+ return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
1542
+ }).join(""),
1535
1543
  instance && instance.proxy,
1536
1544
  trace.map(
1537
1545
  ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
@@ -2698,8 +2706,10 @@ If this is a native custom element, make sure to exclude it from component resol
2698
2706
  rendererInternals
2699
2707
  );
2700
2708
  } else {
2701
- if (parentSuspense && parentSuspense.deps > 0) {
2709
+ if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
2702
2710
  n2.suspense = n1.suspense;
2711
+ n2.suspense.vnode = n2;
2712
+ n2.el = n1.el;
2703
2713
  return;
2704
2714
  }
2705
2715
  patchSuspense(
@@ -3626,7 +3636,6 @@ If this is a native custom element, make sure to exclude it from component resol
3626
3636
  setup(props, { slots }) {
3627
3637
  const instance = getCurrentInstance();
3628
3638
  const state = useTransitionState();
3629
- let prevTransitionKey;
3630
3639
  return () => {
3631
3640
  const children = slots.default && getTransitionRawChildren(slots.default(), true);
3632
3641
  if (!children || !children.length) {
@@ -3669,18 +3678,7 @@ If this is a native custom element, make sure to exclude it from component resol
3669
3678
  setTransitionHooks(innerChild, enterHooks);
3670
3679
  const oldChild = instance.subTree;
3671
3680
  const oldInnerChild = oldChild && getKeepAliveChild(oldChild);
3672
- let transitionKeyChanged = false;
3673
- const { getTransitionKey } = innerChild.type;
3674
- if (getTransitionKey) {
3675
- const key = getTransitionKey();
3676
- if (prevTransitionKey === void 0) {
3677
- prevTransitionKey = key;
3678
- } else if (key !== prevTransitionKey) {
3679
- prevTransitionKey = key;
3680
- transitionKeyChanged = true;
3681
- }
3682
- }
3683
- if (oldInnerChild && oldInnerChild.type !== Comment && (!isSameVNodeType(innerChild, oldInnerChild) || transitionKeyChanged)) {
3681
+ if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild)) {
3684
3682
  const leavingHooks = resolveTransitionHooks(
3685
3683
  oldInnerChild,
3686
3684
  rawProps,
@@ -8957,9 +8955,8 @@ Component that was made reactive: `,
8957
8955
  internalSetCurrentInstance(null);
8958
8956
  };
8959
8957
  const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
8960
- function validateComponentName(name, config) {
8961
- const appIsNativeTag = config.isNativeTag || NO;
8962
- if (isBuiltInTag(name) || appIsNativeTag(name)) {
8958
+ function validateComponentName(name, { isNativeTag }) {
8959
+ if (isBuiltInTag(name) || isNativeTag(name)) {
8963
8960
  warn$1(
8964
8961
  "Do not use built-in or reserved HTML elements as component id: " + name
8965
8962
  );
@@ -9252,7 +9249,14 @@ Component that was made reactive: `,
9252
9249
  }
9253
9250
 
9254
9251
  const computed = (getterOrOptions, debugOptions) => {
9255
- return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
9252
+ const c = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
9253
+ {
9254
+ const i = getCurrentInstance();
9255
+ if (i && i.appContext.config.warnRecursiveComputed) {
9256
+ c._warnRecursive = true;
9257
+ }
9258
+ }
9259
+ return c;
9256
9260
  };
9257
9261
 
9258
9262
  function useModel(props, name, options = EMPTY_OBJ) {
@@ -9530,7 +9534,7 @@ Component that was made reactive: `,
9530
9534
  return true;
9531
9535
  }
9532
9536
 
9533
- const version = "3.4.19";
9537
+ const version = "3.4.21";
9534
9538
  const warn = warn$1 ;
9535
9539
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9536
9540
  const devtools = devtools$1 ;
@@ -9891,10 +9895,11 @@ Component that was made reactive: `,
9891
9895
  }
9892
9896
  }
9893
9897
 
9894
- const vShowOldKey = Symbol("_vod");
9898
+ const vShowOriginalDisplay = Symbol("_vod");
9899
+ const vShowHidden = Symbol("_vsh");
9895
9900
  const vShow = {
9896
9901
  beforeMount(el, { value }, { transition }) {
9897
- el[vShowOldKey] = el.style.display === "none" ? "" : el.style.display;
9902
+ el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
9898
9903
  if (transition && value) {
9899
9904
  transition.beforeEnter(el);
9900
9905
  } else {
@@ -9907,7 +9912,7 @@ Component that was made reactive: `,
9907
9912
  }
9908
9913
  },
9909
9914
  updated(el, { value, oldValue }, { transition }) {
9910
- if (!value === !oldValue && (el.style.display === el[vShowOldKey] || !value))
9915
+ if (!value === !oldValue)
9911
9916
  return;
9912
9917
  if (transition) {
9913
9918
  if (value) {
@@ -9931,7 +9936,8 @@ Component that was made reactive: `,
9931
9936
  vShow.name = "show";
9932
9937
  }
9933
9938
  function setDisplay(el, value) {
9934
- el.style.display = value ? el[vShowOldKey] : "none";
9939
+ el.style.display = value ? el[vShowOriginalDisplay] : "none";
9940
+ el[vShowHidden] = !value;
9935
9941
  }
9936
9942
 
9937
9943
  const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT" );
@@ -10004,13 +10010,21 @@ Component that was made reactive: `,
10004
10010
  function patchStyle(el, prev, next) {
10005
10011
  const style = el.style;
10006
10012
  const isCssString = isString(next);
10007
- const currentDisplay = style.display;
10008
10013
  let hasControlledDisplay = false;
10009
10014
  if (next && !isCssString) {
10010
- if (prev && !isString(prev)) {
10011
- for (const key in prev) {
10012
- if (next[key] == null) {
10013
- setStyle(style, key, "");
10015
+ if (prev) {
10016
+ if (!isString(prev)) {
10017
+ for (const key in prev) {
10018
+ if (next[key] == null) {
10019
+ setStyle(style, key, "");
10020
+ }
10021
+ }
10022
+ } else {
10023
+ for (const prevStyle of prev.split(";")) {
10024
+ const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
10025
+ if (next[key] == null) {
10026
+ setStyle(style, key, "");
10027
+ }
10014
10028
  }
10015
10029
  }
10016
10030
  }
@@ -10034,9 +10048,11 @@ Component that was made reactive: `,
10034
10048
  el.removeAttribute("style");
10035
10049
  }
10036
10050
  }
10037
- if (vShowOldKey in el) {
10038
- el[vShowOldKey] = hasControlledDisplay ? style.display : "";
10039
- style.display = currentDisplay;
10051
+ if (vShowOriginalDisplay in el) {
10052
+ el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
10053
+ if (el[vShowHidden]) {
10054
+ style.display = "none";
10055
+ }
10040
10056
  }
10041
10057
  }
10042
10058
  const semicolonRE = /[^\\];\s*$/;
@@ -10120,15 +10136,15 @@ Component that was made reactive: `,
10120
10136
  const tag = el.tagName;
10121
10137
  if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
10122
10138
  !tag.includes("-")) {
10123
- el._value = value;
10124
- const oldValue = tag === "OPTION" ? el.getAttribute("value") : el.value;
10139
+ const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
10125
10140
  const newValue = value == null ? "" : value;
10126
- if (oldValue !== newValue) {
10141
+ if (oldValue !== newValue || !("_value" in el)) {
10127
10142
  el.value = newValue;
10128
10143
  }
10129
10144
  if (value == null) {
10130
10145
  el.removeAttribute(key);
10131
10146
  }
10147
+ el._value = value;
10132
10148
  return;
10133
10149
  }
10134
10150
  let needRemove = false;
@@ -10800,19 +10816,19 @@ Component that was made reactive: `,
10800
10816
  },
10801
10817
  // set value in mounted & updated because <select> relies on its children
10802
10818
  // <option>s.
10803
- mounted(el, { value, oldValue, modifiers: { number } }) {
10804
- setSelected(el, value, oldValue, number);
10819
+ mounted(el, { value, modifiers: { number } }) {
10820
+ setSelected(el, value, number);
10805
10821
  },
10806
10822
  beforeUpdate(el, _binding, vnode) {
10807
10823
  el[assignKey] = getModelAssigner(vnode);
10808
10824
  },
10809
- updated(el, { value, oldValue, modifiers: { number } }) {
10825
+ updated(el, { value, modifiers: { number } }) {
10810
10826
  if (!el._assigning) {
10811
- setSelected(el, value, oldValue, number);
10827
+ setSelected(el, value, number);
10812
10828
  }
10813
10829
  }
10814
10830
  };
10815
- function setSelected(el, value, oldValue, number) {
10831
+ function setSelected(el, value, number) {
10816
10832
  const isMultiple = el.multiple;
10817
10833
  const isArrayValue = isArray(value);
10818
10834
  if (isMultiple && !isArrayValue && !isSet(value)) {
@@ -10837,12 +10853,10 @@ Component that was made reactive: `,
10837
10853
  } else {
10838
10854
  option.selected = value.has(optionValue);
10839
10855
  }
10840
- } else {
10841
- if (looseEqual(getValue(option), value)) {
10842
- if (el.selectedIndex !== i)
10843
- el.selectedIndex = i;
10844
- return;
10845
- }
10856
+ } else if (looseEqual(getValue(option), value)) {
10857
+ if (el.selectedIndex !== i)
10858
+ el.selectedIndex = i;
10859
+ return;
10846
10860
  }
10847
10861
  }
10848
10862
  if (!isMultiple && el.selectedIndex !== -1) {