@vue/runtime-dom 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/runtime-dom v3.5.0-rc.1
2
+ * @vue/runtime-dom 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 VueRuntimeDOM = (function (exports) {
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 VueRuntimeDOM = (function (exports) {
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;
@@ -4007,8 +4015,7 @@ Server rendered element contains more child nodes than client vdom.`
4007
4015
  const isText = vnode.type === Text;
4008
4016
  if (node) {
4009
4017
  if (isText && !optimized) {
4010
- let next = children[i + 1];
4011
- if (next && (next = normalizeVNode(next)).type === Text) {
4018
+ if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) {
4012
4019
  insert(
4013
4020
  createText(
4014
4021
  node.data.slice(vnode.children.length)
@@ -4264,7 +4271,10 @@ Server rendered element contains fewer child nodes than client vdom.`
4264
4271
  if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
4265
4272
  const cssVars = instance.getCssVars();
4266
4273
  for (const key in cssVars) {
4267
- expectedMap.set(`--${key}`, String(cssVars[key]));
4274
+ expectedMap.set(
4275
+ `--${getEscapedCssVarName(key)}`,
4276
+ String(cssVars[key])
4277
+ );
4268
4278
  }
4269
4279
  }
4270
4280
  if (vnode === root && instance.parent) {
@@ -10308,7 +10318,7 @@ Component that was made reactive: `,
10308
10318
  return true;
10309
10319
  }
10310
10320
 
10311
- const version = "3.5.0-rc.1";
10321
+ const version = "3.5.0";
10312
10322
  const warn = warn$1 ;
10313
10323
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10314
10324
  const devtools = devtools$1 ;
@@ -10927,7 +10937,11 @@ Component that was made reactive: `,
10927
10937
  if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
10928
10938
  !tag.includes("-")) {
10929
10939
  const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
10930
- const newValue = value == null ? "" : String(value);
10940
+ const newValue = value == null ? (
10941
+ // #11647: value should be set as empty string for null and undefined,
10942
+ // but <input type="checkbox"> should be set as 'on'.
10943
+ el.type === "checkbox" ? "on" : ""
10944
+ ) : String(value);
10931
10945
  if (oldValue !== newValue || !("_value" in el)) {
10932
10946
  el.value = newValue;
10933
10947
  }
@@ -11776,12 +11790,16 @@ Expected function or array of functions, received type ${typeof value}.`
11776
11790
  };
11777
11791
  function setChecked(el, { value, oldValue }, vnode) {
11778
11792
  el._modelValue = value;
11793
+ let checked;
11779
11794
  if (isArray(value)) {
11780
- el.checked = looseIndexOf(value, vnode.props.value) > -1;
11795
+ checked = looseIndexOf(value, vnode.props.value) > -1;
11781
11796
  } else if (isSet(value)) {
11782
- el.checked = value.has(vnode.props.value);
11783
- } else if (value !== oldValue) {
11784
- el.checked = looseEqual(value, getCheckboxValue(el, true));
11797
+ checked = value.has(vnode.props.value);
11798
+ } else {
11799
+ checked = looseEqual(value, getCheckboxValue(el, true));
11800
+ }
11801
+ if (el.checked !== checked) {
11802
+ el.checked = checked;
11785
11803
  }
11786
11804
  }
11787
11805
  const vModelRadio = {