@vue/runtime-dom 3.4.19 → 3.4.20

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.20
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*$/;
@@ -595,7 +607,7 @@ function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspe
595
607
  if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
596
608
  !tag.includes("-")) {
597
609
  el._value = value;
598
- const oldValue = tag === "OPTION" ? el.getAttribute("value") : el.value;
610
+ const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
599
611
  const newValue = value == null ? "" : value;
600
612
  if (oldValue !== newValue) {
601
613
  el.value = newValue;
@@ -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.20
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) {
@@ -2700,6 +2705,8 @@ If this is a native custom element, make sure to exclude it from component resol
2700
2705
  } else {
2701
2706
  if (parentSuspense && parentSuspense.deps > 0) {
2702
2707
  n2.suspense = n1.suspense;
2708
+ n2.suspense.vnode = n2;
2709
+ n2.el = n1.el;
2703
2710
  return;
2704
2711
  }
2705
2712
  patchSuspense(
@@ -3626,7 +3633,6 @@ If this is a native custom element, make sure to exclude it from component resol
3626
3633
  setup(props, { slots }) {
3627
3634
  const instance = getCurrentInstance();
3628
3635
  const state = useTransitionState();
3629
- let prevTransitionKey;
3630
3636
  return () => {
3631
3637
  const children = slots.default && getTransitionRawChildren(slots.default(), true);
3632
3638
  if (!children || !children.length) {
@@ -3669,18 +3675,7 @@ If this is a native custom element, make sure to exclude it from component resol
3669
3675
  setTransitionHooks(innerChild, enterHooks);
3670
3676
  const oldChild = instance.subTree;
3671
3677
  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)) {
3678
+ if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild)) {
3684
3679
  const leavingHooks = resolveTransitionHooks(
3685
3680
  oldInnerChild,
3686
3681
  rawProps,
@@ -8957,9 +8952,8 @@ Component that was made reactive: `,
8957
8952
  internalSetCurrentInstance(null);
8958
8953
  };
8959
8954
  const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
8960
- function validateComponentName(name, config) {
8961
- const appIsNativeTag = config.isNativeTag || NO;
8962
- if (isBuiltInTag(name) || appIsNativeTag(name)) {
8955
+ function validateComponentName(name, { isNativeTag }) {
8956
+ if (isBuiltInTag(name) || isNativeTag(name)) {
8963
8957
  warn$1(
8964
8958
  "Do not use built-in or reserved HTML elements as component id: " + name
8965
8959
  );
@@ -9252,7 +9246,14 @@ Component that was made reactive: `,
9252
9246
  }
9253
9247
 
9254
9248
  const computed = (getterOrOptions, debugOptions) => {
9255
- return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
9249
+ const c = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
9250
+ {
9251
+ const i = getCurrentInstance();
9252
+ if (i && i.appContext.config.warnRecursiveComputed) {
9253
+ c._warnRecursive = true;
9254
+ }
9255
+ }
9256
+ return c;
9256
9257
  };
9257
9258
 
9258
9259
  function useModel(props, name, options = EMPTY_OBJ) {
@@ -9530,7 +9531,7 @@ Component that was made reactive: `,
9530
9531
  return true;
9531
9532
  }
9532
9533
 
9533
- const version = "3.4.19";
9534
+ const version = "3.4.20";
9534
9535
  const warn = warn$1 ;
9535
9536
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9536
9537
  const devtools = devtools$1 ;
@@ -9891,10 +9892,11 @@ Component that was made reactive: `,
9891
9892
  }
9892
9893
  }
9893
9894
 
9894
- const vShowOldKey = Symbol("_vod");
9895
+ const vShowOriginalDisplay = Symbol("_vod");
9896
+ const vShowHidden = Symbol("_vsh");
9895
9897
  const vShow = {
9896
9898
  beforeMount(el, { value }, { transition }) {
9897
- el[vShowOldKey] = el.style.display === "none" ? "" : el.style.display;
9899
+ el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
9898
9900
  if (transition && value) {
9899
9901
  transition.beforeEnter(el);
9900
9902
  } else {
@@ -9907,7 +9909,7 @@ Component that was made reactive: `,
9907
9909
  }
9908
9910
  },
9909
9911
  updated(el, { value, oldValue }, { transition }) {
9910
- if (!value === !oldValue && (el.style.display === el[vShowOldKey] || !value))
9912
+ if (!value === !oldValue)
9911
9913
  return;
9912
9914
  if (transition) {
9913
9915
  if (value) {
@@ -9931,7 +9933,8 @@ Component that was made reactive: `,
9931
9933
  vShow.name = "show";
9932
9934
  }
9933
9935
  function setDisplay(el, value) {
9934
- el.style.display = value ? el[vShowOldKey] : "none";
9936
+ el.style.display = value ? el[vShowOriginalDisplay] : "none";
9937
+ el[vShowHidden] = !value;
9935
9938
  }
9936
9939
 
9937
9940
  const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT" );
@@ -10004,13 +10007,21 @@ Component that was made reactive: `,
10004
10007
  function patchStyle(el, prev, next) {
10005
10008
  const style = el.style;
10006
10009
  const isCssString = isString(next);
10007
- const currentDisplay = style.display;
10008
10010
  let hasControlledDisplay = false;
10009
10011
  if (next && !isCssString) {
10010
- if (prev && !isString(prev)) {
10011
- for (const key in prev) {
10012
- if (next[key] == null) {
10013
- setStyle(style, key, "");
10012
+ if (prev) {
10013
+ if (!isString(prev)) {
10014
+ for (const key in prev) {
10015
+ if (next[key] == null) {
10016
+ setStyle(style, key, "");
10017
+ }
10018
+ }
10019
+ } else {
10020
+ for (const prevStyle of prev.split(";")) {
10021
+ const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
10022
+ if (next[key] == null) {
10023
+ setStyle(style, key, "");
10024
+ }
10014
10025
  }
10015
10026
  }
10016
10027
  }
@@ -10034,9 +10045,11 @@ Component that was made reactive: `,
10034
10045
  el.removeAttribute("style");
10035
10046
  }
10036
10047
  }
10037
- if (vShowOldKey in el) {
10038
- el[vShowOldKey] = hasControlledDisplay ? style.display : "";
10039
- style.display = currentDisplay;
10048
+ if (vShowOriginalDisplay in el) {
10049
+ el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
10050
+ if (el[vShowHidden]) {
10051
+ style.display = "none";
10052
+ }
10040
10053
  }
10041
10054
  }
10042
10055
  const semicolonRE = /[^\\];\s*$/;
@@ -10121,7 +10134,7 @@ Component that was made reactive: `,
10121
10134
  if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
10122
10135
  !tag.includes("-")) {
10123
10136
  el._value = value;
10124
- const oldValue = tag === "OPTION" ? el.getAttribute("value") : el.value;
10137
+ const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
10125
10138
  const newValue = value == null ? "" : value;
10126
10139
  if (oldValue !== newValue) {
10127
10140
  el.value = newValue;
@@ -10800,19 +10813,19 @@ Component that was made reactive: `,
10800
10813
  },
10801
10814
  // set value in mounted & updated because <select> relies on its children
10802
10815
  // <option>s.
10803
- mounted(el, { value, oldValue, modifiers: { number } }) {
10804
- setSelected(el, value, oldValue, number);
10816
+ mounted(el, { value, modifiers: { number } }) {
10817
+ setSelected(el, value, number);
10805
10818
  },
10806
10819
  beforeUpdate(el, _binding, vnode) {
10807
10820
  el[assignKey] = getModelAssigner(vnode);
10808
10821
  },
10809
- updated(el, { value, oldValue, modifiers: { number } }) {
10822
+ updated(el, { value, modifiers: { number } }) {
10810
10823
  if (!el._assigning) {
10811
- setSelected(el, value, oldValue, number);
10824
+ setSelected(el, value, number);
10812
10825
  }
10813
10826
  }
10814
10827
  };
10815
- function setSelected(el, value, oldValue, number) {
10828
+ function setSelected(el, value, number) {
10816
10829
  const isMultiple = el.multiple;
10817
10830
  const isArrayValue = isArray(value);
10818
10831
  if (isMultiple && !isArrayValue && !isSet(value)) {
@@ -10837,12 +10850,10 @@ Component that was made reactive: `,
10837
10850
  } else {
10838
10851
  option.selected = value.has(optionValue);
10839
10852
  }
10840
- } else {
10841
- if (looseEqual(getValue(option), value)) {
10842
- if (el.selectedIndex !== i)
10843
- el.selectedIndex = i;
10844
- return;
10845
- }
10853
+ } else if (looseEqual(getValue(option), value)) {
10854
+ if (el.selectedIndex !== i)
10855
+ el.selectedIndex = i;
10856
+ return;
10846
10857
  }
10847
10858
  }
10848
10859
  if (!isMultiple && el.selectedIndex !== -1) {