@vue/runtime-dom 3.4.17 → 3.4.19

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.17
2
+ * @vue/runtime-dom v3.4.19
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -377,7 +377,7 @@ const vShow = {
377
377
  }
378
378
  },
379
379
  updated(el, { value, oldValue }, { transition }) {
380
- if (!value === !oldValue)
380
+ if (!value === !oldValue && (el.style.display === el[vShowOldKey] || !value))
381
381
  return;
382
382
  if (transition) {
383
383
  if (value) {
@@ -416,10 +416,12 @@ function useCssVars(getter) {
416
416
  return;
417
417
  }
418
418
 
419
+ const displayRE = /(^|;)\s*display\s*:/;
419
420
  function patchStyle(el, prev, next) {
420
421
  const style = el.style;
421
- const currentDisplay = style.display;
422
422
  const isCssString = shared.isString(next);
423
+ const currentDisplay = style.display;
424
+ let hasControlledDisplay = false;
423
425
  if (next && !isCssString) {
424
426
  if (prev && !shared.isString(prev)) {
425
427
  for (const key in prev) {
@@ -429,6 +431,9 @@ function patchStyle(el, prev, next) {
429
431
  }
430
432
  }
431
433
  for (const key in next) {
434
+ if (key === "display") {
435
+ hasControlledDisplay = true;
436
+ }
432
437
  setStyle(style, key, next[key]);
433
438
  }
434
439
  } else {
@@ -439,12 +444,14 @@ function patchStyle(el, prev, next) {
439
444
  next += ";" + cssVarText;
440
445
  }
441
446
  style.cssText = next;
447
+ hasControlledDisplay = displayRE.test(next);
442
448
  }
443
449
  } else if (prev) {
444
450
  el.removeAttribute("style");
445
451
  }
446
452
  }
447
453
  if (vShowOldKey in el) {
454
+ el[vShowOldKey] = hasControlledDisplay ? style.display : "";
448
455
  style.display = currentDisplay;
449
456
  }
450
457
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.4.17
2
+ * @vue/runtime-dom v3.4.19
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -374,7 +374,7 @@ const vShow = {
374
374
  }
375
375
  },
376
376
  updated(el, { value, oldValue }, { transition }) {
377
- if (!value === !oldValue)
377
+ if (!value === !oldValue && (el.style.display === el[vShowOldKey] || !value))
378
378
  return;
379
379
  if (transition) {
380
380
  if (value) {
@@ -410,10 +410,12 @@ function useCssVars(getter) {
410
410
  return;
411
411
  }
412
412
 
413
+ const displayRE = /(^|;)\s*display\s*:/;
413
414
  function patchStyle(el, prev, next) {
414
415
  const style = el.style;
415
- const currentDisplay = style.display;
416
416
  const isCssString = shared.isString(next);
417
+ const currentDisplay = style.display;
418
+ let hasControlledDisplay = false;
417
419
  if (next && !isCssString) {
418
420
  if (prev && !shared.isString(prev)) {
419
421
  for (const key in prev) {
@@ -423,6 +425,9 @@ function patchStyle(el, prev, next) {
423
425
  }
424
426
  }
425
427
  for (const key in next) {
428
+ if (key === "display") {
429
+ hasControlledDisplay = true;
430
+ }
426
431
  setStyle(style, key, next[key]);
427
432
  }
428
433
  } else {
@@ -433,12 +438,14 @@ function patchStyle(el, prev, next) {
433
438
  next += ";" + cssVarText;
434
439
  }
435
440
  style.cssText = next;
441
+ hasControlledDisplay = displayRE.test(next);
436
442
  }
437
443
  } else if (prev) {
438
444
  el.removeAttribute("style");
439
445
  }
440
446
  }
441
447
  if (vShowOldKey in el) {
448
+ el[vShowOldKey] = hasControlledDisplay ? style.display : "";
442
449
  style.display = currentDisplay;
443
450
  }
444
451
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.4.17
2
+ * @vue/runtime-dom v3.4.19
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1265,6 +1265,7 @@ function markRaw(value) {
1265
1265
  const toReactive = (value) => isObject(value) ? reactive(value) : value;
1266
1266
  const toReadonly = (value) => isObject(value) ? readonly(value) : value;
1267
1267
 
1268
+ 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`;
1268
1269
  class ComputedRefImpl {
1269
1270
  constructor(getter, _setter, isReadonly, isSSR) {
1270
1271
  this._setter = _setter;
@@ -1289,6 +1290,7 @@ class ComputedRefImpl {
1289
1290
  }
1290
1291
  trackRefValue(self);
1291
1292
  if (self.effect._dirtyLevel >= 2) {
1293
+ warn$2(COMPUTED_SIDE_EFFECT_WARN);
1292
1294
  triggerRefValue(self, 2);
1293
1295
  }
1294
1296
  return self._value;
@@ -1312,7 +1314,7 @@ function computed$1(getterOrOptions, debugOptions, isSSR = false) {
1312
1314
  if (onlyGetter) {
1313
1315
  getter = getterOrOptions;
1314
1316
  setter = () => {
1315
- console.warn("Write operation failed: computed value is readonly");
1317
+ warn$2("Write operation failed: computed value is readonly");
1316
1318
  } ;
1317
1319
  } else {
1318
1320
  getter = getterOrOptions.get;
@@ -1686,13 +1688,11 @@ const ErrorTypeStrings$1 = {
1686
1688
  [14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ."
1687
1689
  };
1688
1690
  function callWithErrorHandling(fn, instance, type, args) {
1689
- let res;
1690
1691
  try {
1691
- res = args ? fn(...args) : fn();
1692
+ return args ? fn(...args) : fn();
1692
1693
  } catch (err) {
1693
1694
  handleError(err, instance, type);
1694
1695
  }
1695
- return res;
1696
1696
  }
1697
1697
  function callWithAsyncErrorHandling(fn, instance, type, args) {
1698
1698
  if (isFunction(fn)) {
@@ -5746,7 +5746,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
5746
5746
  return res;
5747
5747
  }
5748
5748
  function validatePropName(key) {
5749
- if (key[0] !== "$") {
5749
+ if (key[0] !== "$" && !isReservedProp(key)) {
5750
5750
  return true;
5751
5751
  } else {
5752
5752
  warn$1(`Invalid prop name: "${key}" is a reserved property.`);
@@ -5754,8 +5754,16 @@ function validatePropName(key) {
5754
5754
  return false;
5755
5755
  }
5756
5756
  function getType(ctor) {
5757
- const match = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/);
5758
- return match ? match[2] : ctor === null ? "null" : "";
5757
+ if (ctor === null) {
5758
+ return "null";
5759
+ }
5760
+ if (typeof ctor === "function") {
5761
+ return ctor.name || "";
5762
+ } else if (typeof ctor === "object") {
5763
+ const name = ctor.constructor && ctor.constructor.name;
5764
+ return name || "";
5765
+ }
5766
+ return "";
5759
5767
  }
5760
5768
  function isSameType(a, b) {
5761
5769
  return getType(a) === getType(b);
@@ -6552,9 +6560,12 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
6552
6560
  }
6553
6561
  }
6554
6562
  }
6555
- const cssVars = (_a = instance == null ? void 0 : instance.getCssVars) == null ? void 0 : _a.call(instance);
6556
- for (const key2 in cssVars) {
6557
- expectedMap.set(`--${key2}`, String(cssVars[key2]));
6563
+ const root = instance == null ? void 0 : instance.subTree;
6564
+ if (vnode === root || (root == null ? void 0 : root.type) === Fragment && root.children.includes(vnode)) {
6565
+ const cssVars = (_a = instance == null ? void 0 : instance.getCssVars) == null ? void 0 : _a.call(instance);
6566
+ for (const key2 in cssVars) {
6567
+ expectedMap.set(`--${key2}`, String(cssVars[key2]));
6568
+ }
6558
6569
  }
6559
6570
  if (!isMapEqual(actualMap, expectedMap)) {
6560
6571
  mismatchType = mismatchKey = "style";
@@ -9522,7 +9533,7 @@ function isMemoSame(cached, memo) {
9522
9533
  return true;
9523
9534
  }
9524
9535
 
9525
- const version = "3.4.17";
9536
+ const version = "3.4.19";
9526
9537
  const warn = warn$1 ;
9527
9538
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9528
9539
  const devtools = devtools$1 ;
@@ -9899,7 +9910,7 @@ const vShow = {
9899
9910
  }
9900
9911
  },
9901
9912
  updated(el, { value, oldValue }, { transition }) {
9902
- if (!value === !oldValue)
9913
+ if (!value === !oldValue && (el.style.display === el[vShowOldKey] || !value))
9903
9914
  return;
9904
9915
  if (transition) {
9905
9916
  if (value) {
@@ -9992,10 +10003,12 @@ function setVarsOnNode(el, vars) {
9992
10003
  }
9993
10004
  }
9994
10005
 
10006
+ const displayRE = /(^|;)\s*display\s*:/;
9995
10007
  function patchStyle(el, prev, next) {
9996
10008
  const style = el.style;
9997
- const currentDisplay = style.display;
9998
10009
  const isCssString = isString(next);
10010
+ const currentDisplay = style.display;
10011
+ let hasControlledDisplay = false;
9999
10012
  if (next && !isCssString) {
10000
10013
  if (prev && !isString(prev)) {
10001
10014
  for (const key in prev) {
@@ -10005,6 +10018,9 @@ function patchStyle(el, prev, next) {
10005
10018
  }
10006
10019
  }
10007
10020
  for (const key in next) {
10021
+ if (key === "display") {
10022
+ hasControlledDisplay = true;
10023
+ }
10008
10024
  setStyle(style, key, next[key]);
10009
10025
  }
10010
10026
  } else {
@@ -10015,12 +10031,14 @@ function patchStyle(el, prev, next) {
10015
10031
  next += ";" + cssVarText;
10016
10032
  }
10017
10033
  style.cssText = next;
10034
+ hasControlledDisplay = displayRE.test(next);
10018
10035
  }
10019
10036
  } else if (prev) {
10020
10037
  el.removeAttribute("style");
10021
10038
  }
10022
10039
  }
10023
10040
  if (vShowOldKey in el) {
10041
+ el[vShowOldKey] = hasControlledDisplay ? style.display : "";
10024
10042
  style.display = currentDisplay;
10025
10043
  }
10026
10044
  }