@vue/compat 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/compat v3.4.19
2
+ * @vue/compat v3.4.20
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -795,20 +795,20 @@ function hasOwnProperty(key) {
795
795
  return obj.hasOwnProperty(key);
796
796
  }
797
797
  class BaseReactiveHandler {
798
- constructor(_isReadonly = false, _shallow = false) {
798
+ constructor(_isReadonly = false, _isShallow = false) {
799
799
  this._isReadonly = _isReadonly;
800
- this._shallow = _shallow;
800
+ this._isShallow = _isShallow;
801
801
  }
802
802
  get(target, key, receiver) {
803
- const isReadonly2 = this._isReadonly, shallow = this._shallow;
803
+ const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
804
804
  if (key === "__v_isReactive") {
805
805
  return !isReadonly2;
806
806
  } else if (key === "__v_isReadonly") {
807
807
  return isReadonly2;
808
808
  } else if (key === "__v_isShallow") {
809
- return shallow;
809
+ return isShallow2;
810
810
  } else if (key === "__v_raw") {
811
- if (receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
811
+ if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
812
812
  // this means the reciever is a user proxy of the reactive proxy
813
813
  Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
814
814
  return target;
@@ -831,7 +831,7 @@ class BaseReactiveHandler {
831
831
  if (!isReadonly2) {
832
832
  track(target, "get", key);
833
833
  }
834
- if (shallow) {
834
+ if (isShallow2) {
835
835
  return res;
836
836
  }
837
837
  if (isRef(res)) {
@@ -844,12 +844,12 @@ class BaseReactiveHandler {
844
844
  }
845
845
  }
846
846
  class MutableReactiveHandler extends BaseReactiveHandler {
847
- constructor(shallow = false) {
848
- super(false, shallow);
847
+ constructor(isShallow2 = false) {
848
+ super(false, isShallow2);
849
849
  }
850
850
  set(target, key, value, receiver) {
851
851
  let oldValue = target[key];
852
- if (!this._shallow) {
852
+ if (!this._isShallow) {
853
853
  const isOldValueReadonly = isReadonly(oldValue);
854
854
  if (!isShallow(value) && !isReadonly(value)) {
855
855
  oldValue = toRaw(oldValue);
@@ -901,8 +901,8 @@ class MutableReactiveHandler extends BaseReactiveHandler {
901
901
  }
902
902
  }
903
903
  class ReadonlyReactiveHandler extends BaseReactiveHandler {
904
- constructor(shallow = false) {
905
- super(true, shallow);
904
+ constructor(isShallow2 = false) {
905
+ super(true, isShallow2);
906
906
  }
907
907
  set(target, key) {
908
908
  if (!!(process.env.NODE_ENV !== "production")) {
@@ -1073,7 +1073,7 @@ function createReadonlyMethod(type) {
1073
1073
  return function(...args) {
1074
1074
  if (!!(process.env.NODE_ENV !== "production")) {
1075
1075
  const key = args[0] ? `on key "${args[0]}" ` : ``;
1076
- console.warn(
1076
+ warn$2(
1077
1077
  `${capitalize(type)} operation ${key}failed: target is readonly.`,
1078
1078
  toRaw(this)
1079
1079
  );
@@ -1211,7 +1211,7 @@ function checkIdentityKeys(target, has2, key) {
1211
1211
  const rawKey = toRaw(key);
1212
1212
  if (rawKey !== key && has2.call(target, rawKey)) {
1213
1213
  const type = toRawType(target);
1214
- console.warn(
1214
+ warn$2(
1215
1215
  `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.`
1216
1216
  );
1217
1217
  }
@@ -1280,7 +1280,7 @@ function shallowReadonly(target) {
1280
1280
  function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
1281
1281
  if (!isObject(target)) {
1282
1282
  if (!!(process.env.NODE_ENV !== "production")) {
1283
- console.warn(`value cannot be made reactive: ${String(target)}`);
1283
+ warn$2(`value cannot be made reactive: ${String(target)}`);
1284
1284
  }
1285
1285
  return target;
1286
1286
  }
@@ -1333,6 +1333,7 @@ const toReadonly = (value) => isObject(value) ? readonly(value) : value;
1333
1333
  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`;
1334
1334
  class ComputedRefImpl {
1335
1335
  constructor(getter, _setter, isReadonly, isSSR) {
1336
+ this.getter = getter;
1336
1337
  this._setter = _setter;
1337
1338
  this.dep = void 0;
1338
1339
  this.__v_isRef = true;
@@ -1355,7 +1356,11 @@ class ComputedRefImpl {
1355
1356
  }
1356
1357
  trackRefValue(self);
1357
1358
  if (self.effect._dirtyLevel >= 2) {
1358
- !!(process.env.NODE_ENV !== "production") && warn$2(COMPUTED_SIDE_EFFECT_WARN);
1359
+ if (!!(process.env.NODE_ENV !== "production") && this._warnRecursive) {
1360
+ warn$2(COMPUTED_SIDE_EFFECT_WARN, `
1361
+
1362
+ getter: `, this.getter);
1363
+ }
1359
1364
  triggerRefValue(self, 2);
1360
1365
  }
1361
1366
  return self._value;
@@ -1511,7 +1516,7 @@ function customRef(factory) {
1511
1516
  }
1512
1517
  function toRefs(object) {
1513
1518
  if (!!(process.env.NODE_ENV !== "production") && !isProxy(object)) {
1514
- console.warn(`toRefs() expects a reactive object but received a plain one.`);
1519
+ warn$2(`toRefs() expects a reactive object but received a plain one.`);
1515
1520
  }
1516
1521
  const ret = isArray(object) ? new Array(object.length) : {};
1517
1522
  for (const key in object) {
@@ -3290,6 +3295,8 @@ const SuspenseImpl = {
3290
3295
  } else {
3291
3296
  if (parentSuspense && parentSuspense.deps > 0) {
3292
3297
  n2.suspense = n1.suspense;
3298
+ n2.suspense.vnode = n2;
3299
+ n2.el = n1.el;
3293
3300
  return;
3294
3301
  }
3295
3302
  patchSuspense(
@@ -4294,7 +4301,6 @@ const BaseTransitionImpl = {
4294
4301
  setup(props, { slots }) {
4295
4302
  const instance = getCurrentInstance();
4296
4303
  const state = useTransitionState();
4297
- let prevTransitionKey;
4298
4304
  return () => {
4299
4305
  const children = slots.default && getTransitionRawChildren(slots.default(), true);
4300
4306
  if (!children || !children.length) {
@@ -4339,18 +4345,7 @@ const BaseTransitionImpl = {
4339
4345
  setTransitionHooks(innerChild, enterHooks);
4340
4346
  const oldChild = instance.subTree;
4341
4347
  const oldInnerChild = oldChild && getKeepAliveChild(oldChild);
4342
- let transitionKeyChanged = false;
4343
- const { getTransitionKey } = innerChild.type;
4344
- if (getTransitionKey) {
4345
- const key = getTransitionKey();
4346
- if (prevTransitionKey === void 0) {
4347
- prevTransitionKey = key;
4348
- } else if (key !== prevTransitionKey) {
4349
- prevTransitionKey = key;
4350
- transitionKeyChanged = true;
4351
- }
4352
- }
4353
- if (oldInnerChild && oldInnerChild.type !== Comment && (!isSameVNodeType(innerChild, oldInnerChild) || transitionKeyChanged)) {
4348
+ if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild)) {
4354
4349
  const leavingHooks = resolveTransitionHooks(
4355
4350
  oldInnerChild,
4356
4351
  rawProps,
@@ -6540,7 +6535,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6540
6535
  return vm;
6541
6536
  }
6542
6537
  }
6543
- Vue.version = `2.6.14-compat:${"3.4.19"}`;
6538
+ Vue.version = `2.6.14-compat:${"3.4.20"}`;
6544
6539
  Vue.config = singletonApp.config;
6545
6540
  Vue.use = (p, ...options) => {
6546
6541
  if (p && isFunction(p.install)) {
@@ -10856,9 +10851,8 @@ const unsetCurrentInstance = () => {
10856
10851
  internalSetCurrentInstance(null);
10857
10852
  };
10858
10853
  const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
10859
- function validateComponentName(name, config) {
10860
- const appIsNativeTag = config.isNativeTag || NO;
10861
- if (isBuiltInTag(name) || appIsNativeTag(name)) {
10854
+ function validateComponentName(name, { isNativeTag }) {
10855
+ if (isBuiltInTag(name) || isNativeTag(name)) {
10862
10856
  warn$1(
10863
10857
  "Do not use built-in or reserved HTML elements as component id: " + name
10864
10858
  );
@@ -11179,7 +11173,14 @@ function isClassComponent(value) {
11179
11173
  }
11180
11174
 
11181
11175
  const computed = (getterOrOptions, debugOptions) => {
11182
- return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
11176
+ const c = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
11177
+ if (!!(process.env.NODE_ENV !== "production")) {
11178
+ const i = getCurrentInstance();
11179
+ if (i && i.appContext.config.warnRecursiveComputed) {
11180
+ c._warnRecursive = true;
11181
+ }
11182
+ }
11183
+ return c;
11183
11184
  };
11184
11185
 
11185
11186
  function useModel(props, name, options = EMPTY_OBJ) {
@@ -11457,7 +11458,7 @@ function isMemoSame(cached, memo) {
11457
11458
  return true;
11458
11459
  }
11459
11460
 
11460
- const version = "3.4.19";
11461
+ const version = "3.4.20";
11461
11462
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
11462
11463
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11463
11464
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -11870,10 +11871,11 @@ function patchClass(el, value, isSVG) {
11870
11871
  }
11871
11872
  }
11872
11873
 
11873
- const vShowOldKey = Symbol("_vod");
11874
+ const vShowOriginalDisplay = Symbol("_vod");
11875
+ const vShowHidden = Symbol("_vsh");
11874
11876
  const vShow = {
11875
11877
  beforeMount(el, { value }, { transition }) {
11876
- el[vShowOldKey] = el.style.display === "none" ? "" : el.style.display;
11878
+ el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
11877
11879
  if (transition && value) {
11878
11880
  transition.beforeEnter(el);
11879
11881
  } else {
@@ -11886,7 +11888,7 @@ const vShow = {
11886
11888
  }
11887
11889
  },
11888
11890
  updated(el, { value, oldValue }, { transition }) {
11889
- if (!value === !oldValue && (el.style.display === el[vShowOldKey] || !value))
11891
+ if (!value === !oldValue)
11890
11892
  return;
11891
11893
  if (transition) {
11892
11894
  if (value) {
@@ -11910,7 +11912,8 @@ if (!!(process.env.NODE_ENV !== "production")) {
11910
11912
  vShow.name = "show";
11911
11913
  }
11912
11914
  function setDisplay(el, value) {
11913
- el.style.display = value ? el[vShowOldKey] : "none";
11915
+ el.style.display = value ? el[vShowOriginalDisplay] : "none";
11916
+ el[vShowHidden] = !value;
11914
11917
  }
11915
11918
  function initVShowForSSR() {
11916
11919
  vShow.getSSRProps = ({ value }) => {
@@ -11990,13 +11993,21 @@ const displayRE = /(^|;)\s*display\s*:/;
11990
11993
  function patchStyle(el, prev, next) {
11991
11994
  const style = el.style;
11992
11995
  const isCssString = isString(next);
11993
- const currentDisplay = style.display;
11994
11996
  let hasControlledDisplay = false;
11995
11997
  if (next && !isCssString) {
11996
- if (prev && !isString(prev)) {
11997
- for (const key in prev) {
11998
- if (next[key] == null) {
11999
- setStyle(style, key, "");
11998
+ if (prev) {
11999
+ if (!isString(prev)) {
12000
+ for (const key in prev) {
12001
+ if (next[key] == null) {
12002
+ setStyle(style, key, "");
12003
+ }
12004
+ }
12005
+ } else {
12006
+ for (const prevStyle of prev.split(";")) {
12007
+ const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
12008
+ if (next[key] == null) {
12009
+ setStyle(style, key, "");
12010
+ }
12000
12011
  }
12001
12012
  }
12002
12013
  }
@@ -12020,9 +12031,11 @@ function patchStyle(el, prev, next) {
12020
12031
  el.removeAttribute("style");
12021
12032
  }
12022
12033
  }
12023
- if (vShowOldKey in el) {
12024
- el[vShowOldKey] = hasControlledDisplay ? style.display : "";
12025
- style.display = currentDisplay;
12034
+ if (vShowOriginalDisplay in el) {
12035
+ el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
12036
+ if (el[vShowHidden]) {
12037
+ style.display = "none";
12038
+ }
12026
12039
  }
12027
12040
  }
12028
12041
  const semicolonRE = /[^\\];\s*$/;
@@ -12134,7 +12147,7 @@ function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspe
12134
12147
  if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
12135
12148
  !tag.includes("-")) {
12136
12149
  el._value = value;
12137
- const oldValue = tag === "OPTION" ? el.getAttribute("value") : el.value;
12150
+ const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
12138
12151
  const newValue = value == null ? "" : value;
12139
12152
  if (oldValue !== newValue) {
12140
12153
  el.value = newValue;
@@ -12850,19 +12863,19 @@ const vModelSelect = {
12850
12863
  },
12851
12864
  // set value in mounted & updated because <select> relies on its children
12852
12865
  // <option>s.
12853
- mounted(el, { value, oldValue, modifiers: { number } }) {
12854
- setSelected(el, value, oldValue, number);
12866
+ mounted(el, { value, modifiers: { number } }) {
12867
+ setSelected(el, value, number);
12855
12868
  },
12856
12869
  beforeUpdate(el, _binding, vnode) {
12857
12870
  el[assignKey] = getModelAssigner(vnode);
12858
12871
  },
12859
- updated(el, { value, oldValue, modifiers: { number } }) {
12872
+ updated(el, { value, modifiers: { number } }) {
12860
12873
  if (!el._assigning) {
12861
- setSelected(el, value, oldValue, number);
12874
+ setSelected(el, value, number);
12862
12875
  }
12863
12876
  }
12864
12877
  };
12865
- function setSelected(el, value, oldValue, number) {
12878
+ function setSelected(el, value, number) {
12866
12879
  const isMultiple = el.multiple;
12867
12880
  const isArrayValue = isArray(value);
12868
12881
  if (isMultiple && !isArrayValue && !isSet(value)) {
@@ -12887,12 +12900,10 @@ function setSelected(el, value, oldValue, number) {
12887
12900
  } else {
12888
12901
  option.selected = value.has(optionValue);
12889
12902
  }
12890
- } else {
12891
- if (looseEqual(getValue(option), value)) {
12892
- if (el.selectedIndex !== i)
12893
- el.selectedIndex = i;
12894
- return;
12895
- }
12903
+ } else if (looseEqual(getValue(option), value)) {
12904
+ if (el.selectedIndex !== i)
12905
+ el.selectedIndex = i;
12906
+ return;
12896
12907
  }
12897
12908
  }
12898
12909
  if (!isMultiple && el.selectedIndex !== -1) {
@@ -13936,11 +13947,10 @@ class Tokenizer {
13936
13947
  } else if (this.inSFCRoot) {
13937
13948
  this.state = 34;
13938
13949
  } else if (!this.inXML) {
13939
- const lower = c | 32;
13940
- if (lower === 116) {
13950
+ if (c === 116) {
13941
13951
  this.state = 30;
13942
13952
  } else {
13943
- this.state = lower === 115 ? 29 : 6;
13953
+ this.state = c === 115 ? 29 : 6;
13944
13954
  }
13945
13955
  } else {
13946
13956
  this.state = 6;
@@ -14212,10 +14222,9 @@ class Tokenizer {
14212
14222
  }
14213
14223
  }
14214
14224
  stateBeforeSpecialS(c) {
14215
- const lower = c | 32;
14216
- if (lower === Sequences.ScriptEnd[3]) {
14225
+ if (c === Sequences.ScriptEnd[3]) {
14217
14226
  this.startSpecial(Sequences.ScriptEnd, 4);
14218
- } else if (lower === Sequences.StyleEnd[3]) {
14227
+ } else if (c === Sequences.StyleEnd[3]) {
14219
14228
  this.startSpecial(Sequences.StyleEnd, 4);
14220
14229
  } else {
14221
14230
  this.state = 6;
@@ -14223,10 +14232,9 @@ class Tokenizer {
14223
14232
  }
14224
14233
  }
14225
14234
  stateBeforeSpecialT(c) {
14226
- const lower = c | 32;
14227
- if (lower === Sequences.TitleEnd[3]) {
14235
+ if (c === Sequences.TitleEnd[3]) {
14228
14236
  this.startSpecial(Sequences.TitleEnd, 4);
14229
- } else if (lower === Sequences.TextareaEnd[3]) {
14237
+ } else if (c === Sequences.TextareaEnd[3]) {
14230
14238
  this.startSpecial(Sequences.TextareaEnd, 4);
14231
14239
  } else {
14232
14240
  this.state = 6;