@vue/compat 3.4.18 → 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/compat v3.4.18
2
+ * @vue/compat v3.4.20
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -743,20 +743,20 @@ function hasOwnProperty(key) {
743
743
  return obj.hasOwnProperty(key);
744
744
  }
745
745
  class BaseReactiveHandler {
746
- constructor(_isReadonly = false, _shallow = false) {
746
+ constructor(_isReadonly = false, _isShallow = false) {
747
747
  this._isReadonly = _isReadonly;
748
- this._shallow = _shallow;
748
+ this._isShallow = _isShallow;
749
749
  }
750
750
  get(target, key, receiver) {
751
- const isReadonly2 = this._isReadonly, shallow = this._shallow;
751
+ const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
752
752
  if (key === "__v_isReactive") {
753
753
  return !isReadonly2;
754
754
  } else if (key === "__v_isReadonly") {
755
755
  return isReadonly2;
756
756
  } else if (key === "__v_isShallow") {
757
- return shallow;
757
+ return isShallow2;
758
758
  } else if (key === "__v_raw") {
759
- if (receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
759
+ if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
760
760
  // this means the reciever is a user proxy of the reactive proxy
761
761
  Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
762
762
  return target;
@@ -779,7 +779,7 @@ class BaseReactiveHandler {
779
779
  if (!isReadonly2) {
780
780
  track(target, "get", key);
781
781
  }
782
- if (shallow) {
782
+ if (isShallow2) {
783
783
  return res;
784
784
  }
785
785
  if (isRef(res)) {
@@ -792,12 +792,12 @@ class BaseReactiveHandler {
792
792
  }
793
793
  }
794
794
  class MutableReactiveHandler extends BaseReactiveHandler {
795
- constructor(shallow = false) {
796
- super(false, shallow);
795
+ constructor(isShallow2 = false) {
796
+ super(false, isShallow2);
797
797
  }
798
798
  set(target, key, value, receiver) {
799
799
  let oldValue = target[key];
800
- if (!this._shallow) {
800
+ if (!this._isShallow) {
801
801
  const isOldValueReadonly = isReadonly(oldValue);
802
802
  if (!isShallow(value) && !isReadonly(value)) {
803
803
  oldValue = toRaw(oldValue);
@@ -849,8 +849,8 @@ class MutableReactiveHandler extends BaseReactiveHandler {
849
849
  }
850
850
  }
851
851
  class ReadonlyReactiveHandler extends BaseReactiveHandler {
852
- constructor(shallow = false) {
853
- super(true, shallow);
852
+ constructor(isShallow2 = false) {
853
+ super(true, isShallow2);
854
854
  }
855
855
  set(target, key) {
856
856
  return true;
@@ -1244,6 +1244,7 @@ const toReadonly = (value) => isObject(value) ? readonly(value) : value;
1244
1244
 
1245
1245
  class ComputedRefImpl {
1246
1246
  constructor(getter, _setter, isReadonly, isSSR) {
1247
+ this.getter = getter;
1247
1248
  this._setter = _setter;
1248
1249
  this.dep = void 0;
1249
1250
  this.__v_isRef = true;
@@ -1531,13 +1532,11 @@ const ErrorTypeStrings$1 = {
1531
1532
  [14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ."
1532
1533
  };
1533
1534
  function callWithErrorHandling(fn, instance, type, args) {
1534
- let res;
1535
1535
  try {
1536
- res = args ? fn(...args) : fn();
1536
+ return args ? fn(...args) : fn();
1537
1537
  } catch (err) {
1538
1538
  handleError(err, instance, type);
1539
1539
  }
1540
- return res;
1541
1540
  }
1542
1541
  function callWithAsyncErrorHandling(fn, instance, type, args) {
1543
1542
  if (isFunction(fn)) {
@@ -2385,6 +2384,8 @@ const SuspenseImpl = {
2385
2384
  } else {
2386
2385
  if (parentSuspense && parentSuspense.deps > 0) {
2387
2386
  n2.suspense = n1.suspense;
2387
+ n2.suspense.vnode = n2;
2388
+ n2.el = n1.el;
2388
2389
  return;
2389
2390
  }
2390
2391
  patchSuspense(
@@ -3306,7 +3307,6 @@ const BaseTransitionImpl = {
3306
3307
  setup(props, { slots }) {
3307
3308
  const instance = getCurrentInstance();
3308
3309
  const state = useTransitionState();
3309
- let prevTransitionKey;
3310
3310
  return () => {
3311
3311
  const children = slots.default && getTransitionRawChildren(slots.default(), true);
3312
3312
  if (!children || !children.length) {
@@ -3339,18 +3339,7 @@ const BaseTransitionImpl = {
3339
3339
  setTransitionHooks(innerChild, enterHooks);
3340
3340
  const oldChild = instance.subTree;
3341
3341
  const oldInnerChild = oldChild && getKeepAliveChild(oldChild);
3342
- let transitionKeyChanged = false;
3343
- const { getTransitionKey } = innerChild.type;
3344
- if (getTransitionKey) {
3345
- const key = getTransitionKey();
3346
- if (prevTransitionKey === void 0) {
3347
- prevTransitionKey = key;
3348
- } else if (key !== prevTransitionKey) {
3349
- prevTransitionKey = key;
3350
- transitionKeyChanged = true;
3351
- }
3352
- }
3353
- if (oldInnerChild && oldInnerChild.type !== Comment && (!isSameVNodeType(innerChild, oldInnerChild) || transitionKeyChanged)) {
3342
+ if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild)) {
3354
3343
  const leavingHooks = resolveTransitionHooks(
3355
3344
  oldInnerChild,
3356
3345
  rawProps,
@@ -5257,7 +5246,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5257
5246
  return vm;
5258
5247
  }
5259
5248
  }
5260
- Vue.version = `2.6.14-compat:${"3.4.18"}`;
5249
+ Vue.version = `2.6.14-compat:${"3.4.20"}`;
5261
5250
  Vue.config = singletonApp.config;
5262
5251
  Vue.use = (p, ...options) => {
5263
5252
  if (p && isFunction(p.install)) {
@@ -6071,8 +6060,16 @@ function validatePropName(key) {
6071
6060
  return false;
6072
6061
  }
6073
6062
  function getType(ctor) {
6074
- const match = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/);
6075
- return match ? match[2] : ctor === null ? "null" : "";
6063
+ if (ctor === null) {
6064
+ return "null";
6065
+ }
6066
+ if (typeof ctor === "function") {
6067
+ return ctor.name || "";
6068
+ } else if (typeof ctor === "object") {
6069
+ const name = ctor.constructor && ctor.constructor.name;
6070
+ return name || "";
6071
+ }
6072
+ return "";
6076
6073
  }
6077
6074
  function isSameType(a, b) {
6078
6075
  return getType(a) === getType(b);
@@ -9017,7 +9014,8 @@ function isClassComponent(value) {
9017
9014
  }
9018
9015
 
9019
9016
  const computed = (getterOrOptions, debugOptions) => {
9020
- return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
9017
+ const c = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
9018
+ return c;
9021
9019
  };
9022
9020
 
9023
9021
  function useModel(props, name, options = EMPTY_OBJ) {
@@ -9117,7 +9115,7 @@ function isMemoSame(cached, memo) {
9117
9115
  return true;
9118
9116
  }
9119
9117
 
9120
- const version = "3.4.18";
9118
+ const version = "3.4.20";
9121
9119
  const warn$1 = NOOP;
9122
9120
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9123
9121
  const devtools = void 0;
@@ -9527,10 +9525,11 @@ function patchClass(el, value, isSVG) {
9527
9525
  }
9528
9526
  }
9529
9527
 
9530
- const vShowOldKey = Symbol("_vod");
9528
+ const vShowOriginalDisplay = Symbol("_vod");
9529
+ const vShowHidden = Symbol("_vsh");
9531
9530
  const vShow = {
9532
9531
  beforeMount(el, { value }, { transition }) {
9533
- el[vShowOldKey] = el.style.display === "none" ? "" : el.style.display;
9532
+ el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
9534
9533
  if (transition && value) {
9535
9534
  transition.beforeEnter(el);
9536
9535
  } else {
@@ -9543,7 +9542,7 @@ const vShow = {
9543
9542
  }
9544
9543
  },
9545
9544
  updated(el, { value, oldValue }, { transition }) {
9546
- if (!value === !oldValue && el.style.display === el[vShowOldKey])
9545
+ if (!value === !oldValue)
9547
9546
  return;
9548
9547
  if (transition) {
9549
9548
  if (value) {
@@ -9564,7 +9563,8 @@ const vShow = {
9564
9563
  }
9565
9564
  };
9566
9565
  function setDisplay(el, value) {
9567
- el.style.display = value ? el[vShowOldKey] : "none";
9566
+ el.style.display = value ? el[vShowOriginalDisplay] : "none";
9567
+ el[vShowHidden] = !value;
9568
9568
  }
9569
9569
  function initVShowForSSR() {
9570
9570
  vShow.getSSRProps = ({ value }) => {
@@ -9583,13 +9583,21 @@ const displayRE = /(^|;)\s*display\s*:/;
9583
9583
  function patchStyle(el, prev, next) {
9584
9584
  const style = el.style;
9585
9585
  const isCssString = isString(next);
9586
- const currentDisplay = style.display;
9587
9586
  let hasControlledDisplay = false;
9588
9587
  if (next && !isCssString) {
9589
- if (prev && !isString(prev)) {
9590
- for (const key in prev) {
9591
- if (next[key] == null) {
9592
- setStyle(style, key, "");
9588
+ if (prev) {
9589
+ if (!isString(prev)) {
9590
+ for (const key in prev) {
9591
+ if (next[key] == null) {
9592
+ setStyle(style, key, "");
9593
+ }
9594
+ }
9595
+ } else {
9596
+ for (const prevStyle of prev.split(";")) {
9597
+ const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
9598
+ if (next[key] == null) {
9599
+ setStyle(style, key, "");
9600
+ }
9593
9601
  }
9594
9602
  }
9595
9603
  }
@@ -9613,9 +9621,11 @@ function patchStyle(el, prev, next) {
9613
9621
  el.removeAttribute("style");
9614
9622
  }
9615
9623
  }
9616
- if (vShowOldKey in el) {
9617
- el[vShowOldKey] = hasControlledDisplay ? style.display : "";
9618
- style.display = currentDisplay;
9624
+ if (vShowOriginalDisplay in el) {
9625
+ el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
9626
+ if (el[vShowHidden]) {
9627
+ style.display = "none";
9628
+ }
9619
9629
  }
9620
9630
  }
9621
9631
  const importantRE = /\s*!important$/;
@@ -9719,7 +9729,7 @@ function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspe
9719
9729
  if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
9720
9730
  !tag.includes("-")) {
9721
9731
  el._value = value;
9722
- const oldValue = tag === "OPTION" ? el.getAttribute("value") : el.value;
9732
+ const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
9723
9733
  const newValue = value == null ? "" : value;
9724
9734
  if (oldValue !== newValue) {
9725
9735
  el.value = newValue;
@@ -10400,19 +10410,19 @@ const vModelSelect = {
10400
10410
  },
10401
10411
  // set value in mounted & updated because <select> relies on its children
10402
10412
  // <option>s.
10403
- mounted(el, { value, oldValue, modifiers: { number } }) {
10404
- setSelected(el, value, oldValue, number);
10413
+ mounted(el, { value, modifiers: { number } }) {
10414
+ setSelected(el, value, number);
10405
10415
  },
10406
10416
  beforeUpdate(el, _binding, vnode) {
10407
10417
  el[assignKey] = getModelAssigner(vnode);
10408
10418
  },
10409
- updated(el, { value, oldValue, modifiers: { number } }) {
10419
+ updated(el, { value, modifiers: { number } }) {
10410
10420
  if (!el._assigning) {
10411
- setSelected(el, value, oldValue, number);
10421
+ setSelected(el, value, number);
10412
10422
  }
10413
10423
  }
10414
10424
  };
10415
- function setSelected(el, value, oldValue, number) {
10425
+ function setSelected(el, value, number) {
10416
10426
  const isMultiple = el.multiple;
10417
10427
  const isArrayValue = isArray(value);
10418
10428
  if (isMultiple && !isArrayValue && !isSet(value)) {
@@ -10434,12 +10444,10 @@ function setSelected(el, value, oldValue, number) {
10434
10444
  } else {
10435
10445
  option.selected = value.has(optionValue);
10436
10446
  }
10437
- } else {
10438
- if (looseEqual(getValue(option), value)) {
10439
- if (el.selectedIndex !== i)
10440
- el.selectedIndex = i;
10441
- return;
10442
- }
10447
+ } else if (looseEqual(getValue(option), value)) {
10448
+ if (el.selectedIndex !== i)
10449
+ el.selectedIndex = i;
10450
+ return;
10443
10451
  }
10444
10452
  }
10445
10453
  if (!isMultiple && el.selectedIndex !== -1) {
@@ -11413,11 +11421,10 @@ class Tokenizer {
11413
11421
  } else if (this.inSFCRoot) {
11414
11422
  this.state = 34;
11415
11423
  } else if (!this.inXML) {
11416
- const lower = c | 32;
11417
- if (lower === 116) {
11424
+ if (c === 116) {
11418
11425
  this.state = 30;
11419
11426
  } else {
11420
- this.state = lower === 115 ? 29 : 6;
11427
+ this.state = c === 115 ? 29 : 6;
11421
11428
  }
11422
11429
  } else {
11423
11430
  this.state = 6;
@@ -11693,10 +11700,9 @@ class Tokenizer {
11693
11700
  }
11694
11701
  }
11695
11702
  stateBeforeSpecialS(c) {
11696
- const lower = c | 32;
11697
- if (lower === Sequences.ScriptEnd[3]) {
11703
+ if (c === Sequences.ScriptEnd[3]) {
11698
11704
  this.startSpecial(Sequences.ScriptEnd, 4);
11699
- } else if (lower === Sequences.StyleEnd[3]) {
11705
+ } else if (c === Sequences.StyleEnd[3]) {
11700
11706
  this.startSpecial(Sequences.StyleEnd, 4);
11701
11707
  } else {
11702
11708
  this.state = 6;
@@ -11704,10 +11710,9 @@ class Tokenizer {
11704
11710
  }
11705
11711
  }
11706
11712
  stateBeforeSpecialT(c) {
11707
- const lower = c | 32;
11708
- if (lower === Sequences.TitleEnd[3]) {
11713
+ if (c === Sequences.TitleEnd[3]) {
11709
11714
  this.startSpecial(Sequences.TitleEnd, 4);
11710
- } else if (lower === Sequences.TextareaEnd[3]) {
11715
+ } else if (c === Sequences.TextareaEnd[3]) {
11711
11716
  this.startSpecial(Sequences.TextareaEnd, 4);
11712
11717
  } else {
11713
11718
  this.state = 6;