@vue/compat 3.5.0-rc.1 → 3.5.0

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.5.0-rc.1
2
+ * @vue/compat v3.5.0
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -214,6 +214,14 @@ function isRenderableAttrValue(value) {
214
214
  return type === "string" || type === "number" || type === "boolean";
215
215
  }
216
216
 
217
+ const cssVarNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g;
218
+ function getEscapedCssVarName(key, doubleEscape) {
219
+ return key.replace(
220
+ cssVarNameEscapeSymbolsRE,
221
+ (s) => `\\${s}`
222
+ );
223
+ }
224
+
217
225
  function looseCompareArrays(a, b) {
218
226
  if (a.length !== b.length) return false;
219
227
  let equal = true;
@@ -1077,7 +1085,7 @@ function apply(self, method, fn, thisArg, wrappedRetFn, args) {
1077
1085
  const needsWrap = arr !== self && !isShallow(self);
1078
1086
  const methodFn = arr[method];
1079
1087
  if (methodFn !== arrayProto[method]) {
1080
- const result2 = methodFn.apply(arr, args);
1088
+ const result2 = methodFn.apply(self, args);
1081
1089
  return needsWrap ? toReactive(result2) : result2;
1082
1090
  }
1083
1091
  let wrappedFn = fn;
@@ -4565,8 +4573,7 @@ Server rendered element contains more child nodes than client vdom.`
4565
4573
  const isText = vnode.type === Text;
4566
4574
  if (node) {
4567
4575
  if (isText && !optimized) {
4568
- let next = children[i + 1];
4569
- if (next && (next = normalizeVNode(next)).type === Text) {
4576
+ if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) {
4570
4577
  insert(
4571
4578
  createText(
4572
4579
  node.data.slice(vnode.children.length)
@@ -4822,7 +4829,10 @@ function resolveCssVars(instance, vnode, expectedMap) {
4822
4829
  if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
4823
4830
  const cssVars = instance.getCssVars();
4824
4831
  for (const key in cssVars) {
4825
- expectedMap.set(`--${key}`, String(cssVars[key]));
4832
+ expectedMap.set(
4833
+ `--${getEscapedCssVarName(key)}`,
4834
+ String(cssVars[key])
4835
+ );
4826
4836
  }
4827
4837
  }
4828
4838
  if (vnode === root && instance.parent) {
@@ -7007,7 +7017,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7007
7017
  return vm;
7008
7018
  }
7009
7019
  }
7010
- Vue.version = `2.6.14-compat:${"3.5.0-rc.1"}`;
7020
+ Vue.version = `2.6.14-compat:${"3.5.0"}`;
7011
7021
  Vue.config = singletonApp.config;
7012
7022
  Vue.use = (plugin, ...options) => {
7013
7023
  if (plugin && isFunction(plugin.install)) {
@@ -12197,7 +12207,7 @@ function isMemoSame(cached, memo) {
12197
12207
  return true;
12198
12208
  }
12199
12209
 
12200
- const version = "3.5.0-rc.1";
12210
+ const version = "3.5.0";
12201
12211
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
12202
12212
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12203
12213
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -12905,7 +12915,11 @@ function patchDOMProp(el, key, value, parentComponent) {
12905
12915
  if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
12906
12916
  !tag.includes("-")) {
12907
12917
  const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
12908
- const newValue = value == null ? "" : String(value);
12918
+ const newValue = value == null ? (
12919
+ // #11647: value should be set as empty string for null and undefined,
12920
+ // but <input type="checkbox"> should be set as 'on'.
12921
+ el.type === "checkbox" ? "on" : ""
12922
+ ) : String(value);
12909
12923
  if (oldValue !== newValue || !("_value" in el)) {
12910
12924
  el.value = newValue;
12911
12925
  }
@@ -13791,12 +13805,16 @@ const vModelCheckbox = {
13791
13805
  };
13792
13806
  function setChecked(el, { value, oldValue }, vnode) {
13793
13807
  el._modelValue = value;
13808
+ let checked;
13794
13809
  if (isArray(value)) {
13795
- el.checked = looseIndexOf(value, vnode.props.value) > -1;
13810
+ checked = looseIndexOf(value, vnode.props.value) > -1;
13796
13811
  } else if (isSet(value)) {
13797
- el.checked = value.has(vnode.props.value);
13798
- } else if (value !== oldValue) {
13799
- el.checked = looseEqual(value, getCheckboxValue(el, true));
13812
+ checked = value.has(vnode.props.value);
13813
+ } else {
13814
+ checked = looseEqual(value, getCheckboxValue(el, true));
13815
+ }
13816
+ if (el.checked !== checked) {
13817
+ el.checked = checked;
13800
13818
  }
13801
13819
  }
13802
13820
  const vModelRadio = {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.5.0-rc.1
2
+ * @vue/compat v3.5.0
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -217,6 +217,14 @@ var Vue = (function () {
217
217
  return type === "string" || type === "number" || type === "boolean";
218
218
  }
219
219
 
220
+ const cssVarNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g;
221
+ function getEscapedCssVarName(key, doubleEscape) {
222
+ return key.replace(
223
+ cssVarNameEscapeSymbolsRE,
224
+ (s) => `\\${s}`
225
+ );
226
+ }
227
+
220
228
  function looseCompareArrays(a, b) {
221
229
  if (a.length !== b.length) return false;
222
230
  let equal = true;
@@ -1076,7 +1084,7 @@ var Vue = (function () {
1076
1084
  const needsWrap = arr !== self && !isShallow(self);
1077
1085
  const methodFn = arr[method];
1078
1086
  if (methodFn !== arrayProto[method]) {
1079
- const result2 = methodFn.apply(arr, args);
1087
+ const result2 = methodFn.apply(self, args);
1080
1088
  return needsWrap ? toReactive(result2) : result2;
1081
1089
  }
1082
1090
  let wrappedFn = fn;
@@ -4538,8 +4546,7 @@ Server rendered element contains more child nodes than client vdom.`
4538
4546
  const isText = vnode.type === Text;
4539
4547
  if (node) {
4540
4548
  if (isText && !optimized) {
4541
- let next = children[i + 1];
4542
- if (next && (next = normalizeVNode(next)).type === Text) {
4549
+ if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) {
4543
4550
  insert(
4544
4551
  createText(
4545
4552
  node.data.slice(vnode.children.length)
@@ -4795,7 +4802,10 @@ Server rendered element contains fewer child nodes than client vdom.`
4795
4802
  if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
4796
4803
  const cssVars = instance.getCssVars();
4797
4804
  for (const key in cssVars) {
4798
- expectedMap.set(`--${key}`, String(cssVars[key]));
4805
+ expectedMap.set(
4806
+ `--${getEscapedCssVarName(key)}`,
4807
+ String(cssVars[key])
4808
+ );
4799
4809
  }
4800
4810
  }
4801
4811
  if (vnode === root && instance.parent) {
@@ -6969,7 +6979,7 @@ If this is a native custom element, make sure to exclude it from component resol
6969
6979
  return vm;
6970
6980
  }
6971
6981
  }
6972
- Vue.version = `2.6.14-compat:${"3.5.0-rc.1"}`;
6982
+ Vue.version = `2.6.14-compat:${"3.5.0"}`;
6973
6983
  Vue.config = singletonApp.config;
6974
6984
  Vue.use = (plugin, ...options) => {
6975
6985
  if (plugin && isFunction(plugin.install)) {
@@ -12069,7 +12079,7 @@ Component that was made reactive: `,
12069
12079
  return true;
12070
12080
  }
12071
12081
 
12072
- const version = "3.5.0-rc.1";
12082
+ const version = "3.5.0";
12073
12083
  const warn = warn$1 ;
12074
12084
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12075
12085
  const devtools = devtools$1 ;
@@ -12760,7 +12770,11 @@ Component that was made reactive: `,
12760
12770
  if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
12761
12771
  !tag.includes("-")) {
12762
12772
  const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
12763
- const newValue = value == null ? "" : String(value);
12773
+ const newValue = value == null ? (
12774
+ // #11647: value should be set as empty string for null and undefined,
12775
+ // but <input type="checkbox"> should be set as 'on'.
12776
+ el.type === "checkbox" ? "on" : ""
12777
+ ) : String(value);
12764
12778
  if (oldValue !== newValue || !("_value" in el)) {
12765
12779
  el.value = newValue;
12766
12780
  }
@@ -13634,12 +13648,16 @@ Expected function or array of functions, received type ${typeof value}.`
13634
13648
  };
13635
13649
  function setChecked(el, { value, oldValue }, vnode) {
13636
13650
  el._modelValue = value;
13651
+ let checked;
13637
13652
  if (isArray(value)) {
13638
- el.checked = looseIndexOf(value, vnode.props.value) > -1;
13653
+ checked = looseIndexOf(value, vnode.props.value) > -1;
13639
13654
  } else if (isSet(value)) {
13640
- el.checked = value.has(vnode.props.value);
13641
- } else if (value !== oldValue) {
13642
- el.checked = looseEqual(value, getCheckboxValue(el, true));
13655
+ checked = value.has(vnode.props.value);
13656
+ } else {
13657
+ checked = looseEqual(value, getCheckboxValue(el, true));
13658
+ }
13659
+ if (el.checked !== checked) {
13660
+ el.checked = checked;
13643
13661
  }
13644
13662
  }
13645
13663
  const vModelRadio = {