@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
  **/
@@ -560,7 +560,11 @@ function patchDOMProp(el, key, value, parentComponent) {
560
560
  if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
561
561
  !tag.includes("-")) {
562
562
  const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
563
- const newValue = value == null ? "" : String(value);
563
+ const newValue = value == null ? (
564
+ // #11647: value should be set as empty string for null and undefined,
565
+ // but <input type="checkbox"> should be set as 'on'.
566
+ el.type === "checkbox" ? "on" : ""
567
+ ) : String(value);
564
568
  if (oldValue !== newValue || !("_value" in el)) {
565
569
  el.value = newValue;
566
570
  }
@@ -1421,12 +1425,16 @@ const vModelCheckbox = {
1421
1425
  };
1422
1426
  function setChecked(el, { value, oldValue }, vnode) {
1423
1427
  el._modelValue = value;
1428
+ let checked;
1424
1429
  if (shared.isArray(value)) {
1425
- el.checked = shared.looseIndexOf(value, vnode.props.value) > -1;
1430
+ checked = shared.looseIndexOf(value, vnode.props.value) > -1;
1426
1431
  } else if (shared.isSet(value)) {
1427
- el.checked = value.has(vnode.props.value);
1428
- } else if (value !== oldValue) {
1429
- el.checked = shared.looseEqual(value, getCheckboxValue(el, true));
1432
+ checked = value.has(vnode.props.value);
1433
+ } else {
1434
+ checked = shared.looseEqual(value, getCheckboxValue(el, true));
1435
+ }
1436
+ if (el.checked !== checked) {
1437
+ el.checked = checked;
1430
1438
  }
1431
1439
  }
1432
1440
  const vModelRadio = {
@@ -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
  **/
@@ -545,7 +545,11 @@ function patchDOMProp(el, key, value, parentComponent) {
545
545
  if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
546
546
  !tag.includes("-")) {
547
547
  const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
548
- const newValue = value == null ? "" : String(value);
548
+ const newValue = value == null ? (
549
+ // #11647: value should be set as empty string for null and undefined,
550
+ // but <input type="checkbox"> should be set as 'on'.
551
+ el.type === "checkbox" ? "on" : ""
552
+ ) : String(value);
549
553
  if (oldValue !== newValue || !("_value" in el)) {
550
554
  el.value = newValue;
551
555
  }
@@ -1326,12 +1330,16 @@ const vModelCheckbox = {
1326
1330
  };
1327
1331
  function setChecked(el, { value, oldValue }, vnode) {
1328
1332
  el._modelValue = value;
1333
+ let checked;
1329
1334
  if (shared.isArray(value)) {
1330
- el.checked = shared.looseIndexOf(value, vnode.props.value) > -1;
1335
+ checked = shared.looseIndexOf(value, vnode.props.value) > -1;
1331
1336
  } else if (shared.isSet(value)) {
1332
- el.checked = value.has(vnode.props.value);
1333
- } else if (value !== oldValue) {
1334
- el.checked = shared.looseEqual(value, getCheckboxValue(el, true));
1337
+ checked = value.has(vnode.props.value);
1338
+ } else {
1339
+ checked = shared.looseEqual(value, getCheckboxValue(el, true));
1340
+ }
1341
+ if (el.checked !== checked) {
1342
+ el.checked = checked;
1335
1343
  }
1336
1344
  }
1337
1345
  const vModelRadio = {
@@ -531,6 +531,7 @@ export interface IframeHTMLAttributes extends HTMLAttributes {
531
531
  /** @deprecated */
532
532
  frameborder?: Numberish;
533
533
  height?: Numberish;
534
+ loading?: 'eager' | 'lazy';
534
535
  /** @deprecated */
535
536
  marginheight?: Numberish;
536
537
  /** @deprecated */
@@ -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
  **/
@@ -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;
@@ -1073,7 +1081,7 @@ function apply(self, method, fn, thisArg, wrappedRetFn, args) {
1073
1081
  const needsWrap = arr !== self && !isShallow(self);
1074
1082
  const methodFn = arr[method];
1075
1083
  if (methodFn !== arrayProto[method]) {
1076
- const result2 = methodFn.apply(arr, args);
1084
+ const result2 = methodFn.apply(self, args);
1077
1085
  return needsWrap ? toReactive(result2) : result2;
1078
1086
  }
1079
1087
  let wrappedFn = fn;
@@ -4004,8 +4012,7 @@ Server rendered element contains more child nodes than client vdom.`
4004
4012
  const isText = vnode.type === Text;
4005
4013
  if (node) {
4006
4014
  if (isText && !optimized) {
4007
- let next = children[i + 1];
4008
- if (next && (next = normalizeVNode(next)).type === Text) {
4015
+ if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) {
4009
4016
  insert(
4010
4017
  createText(
4011
4018
  node.data.slice(vnode.children.length)
@@ -4261,7 +4268,10 @@ function resolveCssVars(instance, vnode, expectedMap) {
4261
4268
  if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
4262
4269
  const cssVars = instance.getCssVars();
4263
4270
  for (const key in cssVars) {
4264
- expectedMap.set(`--${key}`, String(cssVars[key]));
4271
+ expectedMap.set(
4272
+ `--${getEscapedCssVarName(key)}`,
4273
+ String(cssVars[key])
4274
+ );
4265
4275
  }
4266
4276
  }
4267
4277
  if (vnode === root && instance.parent) {
@@ -10350,7 +10360,7 @@ function isMemoSame(cached, memo) {
10350
10360
  return true;
10351
10361
  }
10352
10362
 
10353
- const version = "3.5.0-rc.1";
10363
+ const version = "3.5.0";
10354
10364
  const warn = warn$1 ;
10355
10365
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10356
10366
  const devtools = devtools$1 ;
@@ -10986,7 +10996,11 @@ function patchDOMProp(el, key, value, parentComponent) {
10986
10996
  if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
10987
10997
  !tag.includes("-")) {
10988
10998
  const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
10989
- const newValue = value == null ? "" : String(value);
10999
+ const newValue = value == null ? (
11000
+ // #11647: value should be set as empty string for null and undefined,
11001
+ // but <input type="checkbox"> should be set as 'on'.
11002
+ el.type === "checkbox" ? "on" : ""
11003
+ ) : String(value);
10990
11004
  if (oldValue !== newValue || !("_value" in el)) {
10991
11005
  el.value = newValue;
10992
11006
  }
@@ -11847,12 +11861,16 @@ const vModelCheckbox = {
11847
11861
  };
11848
11862
  function setChecked(el, { value, oldValue }, vnode) {
11849
11863
  el._modelValue = value;
11864
+ let checked;
11850
11865
  if (isArray(value)) {
11851
- el.checked = looseIndexOf(value, vnode.props.value) > -1;
11866
+ checked = looseIndexOf(value, vnode.props.value) > -1;
11852
11867
  } else if (isSet(value)) {
11853
- el.checked = value.has(vnode.props.value);
11854
- } else if (value !== oldValue) {
11855
- el.checked = looseEqual(value, getCheckboxValue(el, true));
11868
+ checked = value.has(vnode.props.value);
11869
+ } else {
11870
+ checked = looseEqual(value, getCheckboxValue(el, true));
11871
+ }
11872
+ if (el.checked !== checked) {
11873
+ el.checked = checked;
11856
11874
  }
11857
11875
  }
11858
11876
  const vModelRadio = {