@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
  **/
@@ -798,20 +798,20 @@ var Vue = (function () {
798
798
  return obj.hasOwnProperty(key);
799
799
  }
800
800
  class BaseReactiveHandler {
801
- constructor(_isReadonly = false, _shallow = false) {
801
+ constructor(_isReadonly = false, _isShallow = false) {
802
802
  this._isReadonly = _isReadonly;
803
- this._shallow = _shallow;
803
+ this._isShallow = _isShallow;
804
804
  }
805
805
  get(target, key, receiver) {
806
- const isReadonly2 = this._isReadonly, shallow = this._shallow;
806
+ const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
807
807
  if (key === "__v_isReactive") {
808
808
  return !isReadonly2;
809
809
  } else if (key === "__v_isReadonly") {
810
810
  return isReadonly2;
811
811
  } else if (key === "__v_isShallow") {
812
- return shallow;
812
+ return isShallow2;
813
813
  } else if (key === "__v_raw") {
814
- if (receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
814
+ if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
815
815
  // this means the reciever is a user proxy of the reactive proxy
816
816
  Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
817
817
  return target;
@@ -834,7 +834,7 @@ var Vue = (function () {
834
834
  if (!isReadonly2) {
835
835
  track(target, "get", key);
836
836
  }
837
- if (shallow) {
837
+ if (isShallow2) {
838
838
  return res;
839
839
  }
840
840
  if (isRef(res)) {
@@ -847,12 +847,12 @@ var Vue = (function () {
847
847
  }
848
848
  }
849
849
  class MutableReactiveHandler extends BaseReactiveHandler {
850
- constructor(shallow = false) {
851
- super(false, shallow);
850
+ constructor(isShallow2 = false) {
851
+ super(false, isShallow2);
852
852
  }
853
853
  set(target, key, value, receiver) {
854
854
  let oldValue = target[key];
855
- if (!this._shallow) {
855
+ if (!this._isShallow) {
856
856
  const isOldValueReadonly = isReadonly(oldValue);
857
857
  if (!isShallow(value) && !isReadonly(value)) {
858
858
  oldValue = toRaw(oldValue);
@@ -904,8 +904,8 @@ var Vue = (function () {
904
904
  }
905
905
  }
906
906
  class ReadonlyReactiveHandler extends BaseReactiveHandler {
907
- constructor(shallow = false) {
908
- super(true, shallow);
907
+ constructor(isShallow2 = false) {
908
+ super(true, isShallow2);
909
909
  }
910
910
  set(target, key) {
911
911
  {
@@ -1076,7 +1076,7 @@ var Vue = (function () {
1076
1076
  return function(...args) {
1077
1077
  {
1078
1078
  const key = args[0] ? `on key "${args[0]}" ` : ``;
1079
- console.warn(
1079
+ warn$2(
1080
1080
  `${capitalize(type)} operation ${key}failed: target is readonly.`,
1081
1081
  toRaw(this)
1082
1082
  );
@@ -1214,7 +1214,7 @@ var Vue = (function () {
1214
1214
  const rawKey = toRaw(key);
1215
1215
  if (rawKey !== key && has2.call(target, rawKey)) {
1216
1216
  const type = toRawType(target);
1217
- console.warn(
1217
+ warn$2(
1218
1218
  `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.`
1219
1219
  );
1220
1220
  }
@@ -1283,7 +1283,7 @@ var Vue = (function () {
1283
1283
  function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
1284
1284
  if (!isObject(target)) {
1285
1285
  {
1286
- console.warn(`value cannot be made reactive: ${String(target)}`);
1286
+ warn$2(`value cannot be made reactive: ${String(target)}`);
1287
1287
  }
1288
1288
  return target;
1289
1289
  }
@@ -1336,6 +1336,7 @@ var Vue = (function () {
1336
1336
  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`;
1337
1337
  class ComputedRefImpl {
1338
1338
  constructor(getter, _setter, isReadonly, isSSR) {
1339
+ this.getter = getter;
1339
1340
  this._setter = _setter;
1340
1341
  this.dep = void 0;
1341
1342
  this.__v_isRef = true;
@@ -1358,7 +1359,11 @@ var Vue = (function () {
1358
1359
  }
1359
1360
  trackRefValue(self);
1360
1361
  if (self.effect._dirtyLevel >= 2) {
1361
- warn$2(COMPUTED_SIDE_EFFECT_WARN);
1362
+ if (this._warnRecursive) {
1363
+ warn$2(COMPUTED_SIDE_EFFECT_WARN, `
1364
+
1365
+ getter: `, this.getter);
1366
+ }
1362
1367
  triggerRefValue(self, 2);
1363
1368
  }
1364
1369
  return self._value;
@@ -1514,7 +1519,7 @@ var Vue = (function () {
1514
1519
  }
1515
1520
  function toRefs(object) {
1516
1521
  if (!isProxy(object)) {
1517
- console.warn(`toRefs() expects a reactive object but received a plain one.`);
1522
+ warn$2(`toRefs() expects a reactive object but received a plain one.`);
1518
1523
  }
1519
1524
  const ret = isArray(object) ? new Array(object.length) : {};
1520
1525
  for (const key in object) {
@@ -3286,6 +3291,8 @@ If this is a native custom element, make sure to exclude it from component resol
3286
3291
  } else {
3287
3292
  if (parentSuspense && parentSuspense.deps > 0) {
3288
3293
  n2.suspense = n1.suspense;
3294
+ n2.suspense.vnode = n2;
3295
+ n2.el = n1.el;
3289
3296
  return;
3290
3297
  }
3291
3298
  patchSuspense(
@@ -4263,7 +4270,6 @@ If this is a native custom element, make sure to exclude it from component resol
4263
4270
  setup(props, { slots }) {
4264
4271
  const instance = getCurrentInstance();
4265
4272
  const state = useTransitionState();
4266
- let prevTransitionKey;
4267
4273
  return () => {
4268
4274
  const children = slots.default && getTransitionRawChildren(slots.default(), true);
4269
4275
  if (!children || !children.length) {
@@ -4306,18 +4312,7 @@ If this is a native custom element, make sure to exclude it from component resol
4306
4312
  setTransitionHooks(innerChild, enterHooks);
4307
4313
  const oldChild = instance.subTree;
4308
4314
  const oldInnerChild = oldChild && getKeepAliveChild(oldChild);
4309
- let transitionKeyChanged = false;
4310
- const { getTransitionKey } = innerChild.type;
4311
- if (getTransitionKey) {
4312
- const key = getTransitionKey();
4313
- if (prevTransitionKey === void 0) {
4314
- prevTransitionKey = key;
4315
- } else if (key !== prevTransitionKey) {
4316
- prevTransitionKey = key;
4317
- transitionKeyChanged = true;
4318
- }
4319
- }
4320
- if (oldInnerChild && oldInnerChild.type !== Comment && (!isSameVNodeType(innerChild, oldInnerChild) || transitionKeyChanged)) {
4315
+ if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild)) {
4321
4316
  const leavingHooks = resolveTransitionHooks(
4322
4317
  oldInnerChild,
4323
4318
  rawProps,
@@ -6499,7 +6494,7 @@ If this is a native custom element, make sure to exclude it from component resol
6499
6494
  return vm;
6500
6495
  }
6501
6496
  }
6502
- Vue.version = `2.6.14-compat:${"3.4.19"}`;
6497
+ Vue.version = `2.6.14-compat:${"3.4.20"}`;
6503
6498
  Vue.config = singletonApp.config;
6504
6499
  Vue.use = (p, ...options) => {
6505
6500
  if (p && isFunction(p.install)) {
@@ -10747,9 +10742,8 @@ Component that was made reactive: `,
10747
10742
  internalSetCurrentInstance(null);
10748
10743
  };
10749
10744
  const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
10750
- function validateComponentName(name, config) {
10751
- const appIsNativeTag = config.isNativeTag || NO;
10752
- if (isBuiltInTag(name) || appIsNativeTag(name)) {
10745
+ function validateComponentName(name, { isNativeTag }) {
10746
+ if (isBuiltInTag(name) || isNativeTag(name)) {
10753
10747
  warn$1(
10754
10748
  "Do not use built-in or reserved HTML elements as component id: " + name
10755
10749
  );
@@ -11054,7 +11048,14 @@ Component that was made reactive: `,
11054
11048
  }
11055
11049
 
11056
11050
  const computed = (getterOrOptions, debugOptions) => {
11057
- return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
11051
+ const c = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
11052
+ {
11053
+ const i = getCurrentInstance();
11054
+ if (i && i.appContext.config.warnRecursiveComputed) {
11055
+ c._warnRecursive = true;
11056
+ }
11057
+ }
11058
+ return c;
11058
11059
  };
11059
11060
 
11060
11061
  function useModel(props, name, options = EMPTY_OBJ) {
@@ -11332,7 +11333,7 @@ Component that was made reactive: `,
11332
11333
  return true;
11333
11334
  }
11334
11335
 
11335
- const version = "3.4.19";
11336
+ const version = "3.4.20";
11336
11337
  const warn = warn$1 ;
11337
11338
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11338
11339
  const devtools = devtools$1 ;
@@ -11737,10 +11738,11 @@ Component that was made reactive: `,
11737
11738
  }
11738
11739
  }
11739
11740
 
11740
- const vShowOldKey = Symbol("_vod");
11741
+ const vShowOriginalDisplay = Symbol("_vod");
11742
+ const vShowHidden = Symbol("_vsh");
11741
11743
  const vShow = {
11742
11744
  beforeMount(el, { value }, { transition }) {
11743
- el[vShowOldKey] = el.style.display === "none" ? "" : el.style.display;
11745
+ el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
11744
11746
  if (transition && value) {
11745
11747
  transition.beforeEnter(el);
11746
11748
  } else {
@@ -11753,7 +11755,7 @@ Component that was made reactive: `,
11753
11755
  }
11754
11756
  },
11755
11757
  updated(el, { value, oldValue }, { transition }) {
11756
- if (!value === !oldValue && (el.style.display === el[vShowOldKey] || !value))
11758
+ if (!value === !oldValue)
11757
11759
  return;
11758
11760
  if (transition) {
11759
11761
  if (value) {
@@ -11777,7 +11779,8 @@ Component that was made reactive: `,
11777
11779
  vShow.name = "show";
11778
11780
  }
11779
11781
  function setDisplay(el, value) {
11780
- el.style.display = value ? el[vShowOldKey] : "none";
11782
+ el.style.display = value ? el[vShowOriginalDisplay] : "none";
11783
+ el[vShowHidden] = !value;
11781
11784
  }
11782
11785
 
11783
11786
  const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT" );
@@ -11850,13 +11853,21 @@ Component that was made reactive: `,
11850
11853
  function patchStyle(el, prev, next) {
11851
11854
  const style = el.style;
11852
11855
  const isCssString = isString(next);
11853
- const currentDisplay = style.display;
11854
11856
  let hasControlledDisplay = false;
11855
11857
  if (next && !isCssString) {
11856
- if (prev && !isString(prev)) {
11857
- for (const key in prev) {
11858
- if (next[key] == null) {
11859
- setStyle(style, key, "");
11858
+ if (prev) {
11859
+ if (!isString(prev)) {
11860
+ for (const key in prev) {
11861
+ if (next[key] == null) {
11862
+ setStyle(style, key, "");
11863
+ }
11864
+ }
11865
+ } else {
11866
+ for (const prevStyle of prev.split(";")) {
11867
+ const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
11868
+ if (next[key] == null) {
11869
+ setStyle(style, key, "");
11870
+ }
11860
11871
  }
11861
11872
  }
11862
11873
  }
@@ -11880,9 +11891,11 @@ Component that was made reactive: `,
11880
11891
  el.removeAttribute("style");
11881
11892
  }
11882
11893
  }
11883
- if (vShowOldKey in el) {
11884
- el[vShowOldKey] = hasControlledDisplay ? style.display : "";
11885
- style.display = currentDisplay;
11894
+ if (vShowOriginalDisplay in el) {
11895
+ el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
11896
+ if (el[vShowHidden]) {
11897
+ style.display = "none";
11898
+ }
11886
11899
  }
11887
11900
  }
11888
11901
  const semicolonRE = /[^\\];\s*$/;
@@ -11994,7 +12007,7 @@ Component that was made reactive: `,
11994
12007
  if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
11995
12008
  !tag.includes("-")) {
11996
12009
  el._value = value;
11997
- const oldValue = tag === "OPTION" ? el.getAttribute("value") : el.value;
12010
+ const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
11998
12011
  const newValue = value == null ? "" : value;
11999
12012
  if (oldValue !== newValue) {
12000
12013
  el.value = newValue;
@@ -12698,19 +12711,19 @@ Component that was made reactive: `,
12698
12711
  },
12699
12712
  // set value in mounted & updated because <select> relies on its children
12700
12713
  // <option>s.
12701
- mounted(el, { value, oldValue, modifiers: { number } }) {
12702
- setSelected(el, value, oldValue, number);
12714
+ mounted(el, { value, modifiers: { number } }) {
12715
+ setSelected(el, value, number);
12703
12716
  },
12704
12717
  beforeUpdate(el, _binding, vnode) {
12705
12718
  el[assignKey] = getModelAssigner(vnode);
12706
12719
  },
12707
- updated(el, { value, oldValue, modifiers: { number } }) {
12720
+ updated(el, { value, modifiers: { number } }) {
12708
12721
  if (!el._assigning) {
12709
- setSelected(el, value, oldValue, number);
12722
+ setSelected(el, value, number);
12710
12723
  }
12711
12724
  }
12712
12725
  };
12713
- function setSelected(el, value, oldValue, number) {
12726
+ function setSelected(el, value, number) {
12714
12727
  const isMultiple = el.multiple;
12715
12728
  const isArrayValue = isArray(value);
12716
12729
  if (isMultiple && !isArrayValue && !isSet(value)) {
@@ -12735,12 +12748,10 @@ Component that was made reactive: `,
12735
12748
  } else {
12736
12749
  option.selected = value.has(optionValue);
12737
12750
  }
12738
- } else {
12739
- if (looseEqual(getValue(option), value)) {
12740
- if (el.selectedIndex !== i)
12741
- el.selectedIndex = i;
12742
- return;
12743
- }
12751
+ } else if (looseEqual(getValue(option), value)) {
12752
+ if (el.selectedIndex !== i)
12753
+ el.selectedIndex = i;
12754
+ return;
12744
12755
  }
12745
12756
  }
12746
12757
  if (!isMultiple && el.selectedIndex !== -1) {
@@ -13749,11 +13760,10 @@ Make sure to use the production build (*.prod.js) when deploying for production.
13749
13760
  } else if (this.inSFCRoot) {
13750
13761
  this.state = 34;
13751
13762
  } else if (!this.inXML) {
13752
- const lower = c | 32;
13753
- if (lower === 116) {
13763
+ if (c === 116) {
13754
13764
  this.state = 30;
13755
13765
  } else {
13756
- this.state = lower === 115 ? 29 : 6;
13766
+ this.state = c === 115 ? 29 : 6;
13757
13767
  }
13758
13768
  } else {
13759
13769
  this.state = 6;
@@ -14025,10 +14035,9 @@ Make sure to use the production build (*.prod.js) when deploying for production.
14025
14035
  }
14026
14036
  }
14027
14037
  stateBeforeSpecialS(c) {
14028
- const lower = c | 32;
14029
- if (lower === Sequences.ScriptEnd[3]) {
14038
+ if (c === Sequences.ScriptEnd[3]) {
14030
14039
  this.startSpecial(Sequences.ScriptEnd, 4);
14031
- } else if (lower === Sequences.StyleEnd[3]) {
14040
+ } else if (c === Sequences.StyleEnd[3]) {
14032
14041
  this.startSpecial(Sequences.StyleEnd, 4);
14033
14042
  } else {
14034
14043
  this.state = 6;
@@ -14036,10 +14045,9 @@ Make sure to use the production build (*.prod.js) when deploying for production.
14036
14045
  }
14037
14046
  }
14038
14047
  stateBeforeSpecialT(c) {
14039
- const lower = c | 32;
14040
- if (lower === Sequences.TitleEnd[3]) {
14048
+ if (c === Sequences.TitleEnd[3]) {
14041
14049
  this.startSpecial(Sequences.TitleEnd, 4);
14042
- } else if (lower === Sequences.TextareaEnd[3]) {
14050
+ } else if (c === Sequences.TextareaEnd[3]) {
14043
14051
  this.startSpecial(Sequences.TextareaEnd, 4);
14044
14052
  } else {
14045
14053
  this.state = 6;