@vue/runtime-dom 3.2.45 → 3.2.47

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.
@@ -107,9 +107,6 @@ function patchStyle(el, prev, next) {
107
107
  const style = el.style;
108
108
  const isCssString = shared.isString(next);
109
109
  if (next && !isCssString) {
110
- for (const key in next) {
111
- setStyle(style, key, next[key]);
112
- }
113
110
  if (prev && !shared.isString(prev)) {
114
111
  for (const key in prev) {
115
112
  if (next[key] == null) {
@@ -117,6 +114,9 @@ function patchStyle(el, prev, next) {
117
114
  }
118
115
  }
119
116
  }
117
+ for (const key in next) {
118
+ setStyle(style, key, next[key]);
119
+ }
120
120
  }
121
121
  else {
122
122
  const currentDisplay = style.display;
@@ -858,18 +858,10 @@ function normalizeDuration(duration) {
858
858
  }
859
859
  function NumberOf(val) {
860
860
  const res = shared.toNumber(val);
861
- validateDuration(res);
862
- return res;
863
- }
864
- function validateDuration(val) {
865
- if (typeof val !== 'number') {
866
- runtimeCore.warn(`<transition> explicit duration is not a valid number - ` +
867
- `got ${JSON.stringify(val)}.`);
868
- }
869
- else if (isNaN(val)) {
870
- runtimeCore.warn(`<transition> explicit duration is NaN - ` +
871
- 'the duration expression might be incorrect.');
861
+ {
862
+ runtimeCore.assertNumber(res, '<transition> explicit duration');
872
863
  }
864
+ return res;
873
865
  }
874
866
  function addTransitionClass(el, cls) {
875
867
  cls.split(/\s+/).forEach(c => c && el.classList.add(c));
@@ -1066,6 +1058,14 @@ const TransitionGroupImpl = {
1066
1058
  };
1067
1059
  }
1068
1060
  };
1061
+ /**
1062
+ * TransitionGroup does not support "mode" so we need to remove it from the
1063
+ * props declarations, but direct delete operation is considered a side effect
1064
+ * and will make the entire transition feature non-tree-shakeable, so we do it
1065
+ * in a function and mark the function's invocation as pure.
1066
+ */
1067
+ const removeMode = (props) => delete props.mode;
1068
+ /*#__PURE__*/ removeMode(TransitionGroupImpl.props);
1069
1069
  const TransitionGroup = TransitionGroupImpl;
1070
1070
  function callPendingCbs(c) {
1071
1071
  const el = c.el;
@@ -1141,7 +1141,7 @@ const vModelText = {
1141
1141
  domValue = domValue.trim();
1142
1142
  }
1143
1143
  if (castToNumber) {
1144
- domValue = shared.toNumber(domValue);
1144
+ domValue = shared.looseToNumber(domValue);
1145
1145
  }
1146
1146
  el._assign(domValue);
1147
1147
  });
@@ -1176,7 +1176,8 @@ const vModelText = {
1176
1176
  if (trim && el.value.trim() === value) {
1177
1177
  return;
1178
1178
  }
1179
- if ((number || el.type === 'number') && shared.toNumber(el.value) === value) {
1179
+ if ((number || el.type === 'number') &&
1180
+ shared.looseToNumber(el.value) === value) {
1180
1181
  return;
1181
1182
  }
1182
1183
  }
@@ -1265,7 +1266,7 @@ const vModelSelect = {
1265
1266
  addEventListener(el, 'change', () => {
1266
1267
  const selectedVal = Array.prototype.filter
1267
1268
  .call(el.options, (o) => o.selected)
1268
- .map((o) => number ? shared.toNumber(getValue(o)) : getValue(o));
1269
+ .map((o) => number ? shared.looseToNumber(getValue(o)) : getValue(o));
1269
1270
  el._assign(el.multiple
1270
1271
  ? isSetModel
1271
1272
  ? new Set(selectedVal)
@@ -1638,9 +1639,6 @@ const initDirectivesForSSR = () => {
1638
1639
  }
1639
1640
  ;
1640
1641
 
1641
- Object.keys(runtimeCore).forEach(function (k) {
1642
- if (k !== 'default') exports[k] = runtimeCore[k];
1643
- });
1644
1642
  exports.Transition = Transition;
1645
1643
  exports.TransitionGroup = TransitionGroup;
1646
1644
  exports.VueElement = VueElement;
@@ -1661,3 +1659,6 @@ exports.vModelText = vModelText;
1661
1659
  exports.vShow = vShow;
1662
1660
  exports.withKeys = withKeys;
1663
1661
  exports.withModifiers = withModifiers;
1662
+ Object.keys(runtimeCore).forEach(function(k) {
1663
+ if (k !== 'default') exports[k] = runtimeCore[k];
1664
+ });
@@ -107,9 +107,6 @@ function patchStyle(el, prev, next) {
107
107
  const style = el.style;
108
108
  const isCssString = shared.isString(next);
109
109
  if (next && !isCssString) {
110
- for (const key in next) {
111
- setStyle(style, key, next[key]);
112
- }
113
110
  if (prev && !shared.isString(prev)) {
114
111
  for (const key in prev) {
115
112
  if (next[key] == null) {
@@ -117,6 +114,9 @@ function patchStyle(el, prev, next) {
117
114
  }
118
115
  }
119
116
  }
117
+ for (const key in next) {
118
+ setStyle(style, key, next[key]);
119
+ }
120
120
  }
121
121
  else {
122
122
  const currentDisplay = style.display;
@@ -1017,6 +1017,14 @@ const TransitionGroupImpl = {
1017
1017
  };
1018
1018
  }
1019
1019
  };
1020
+ /**
1021
+ * TransitionGroup does not support "mode" so we need to remove it from the
1022
+ * props declarations, but direct delete operation is considered a side effect
1023
+ * and will make the entire transition feature non-tree-shakeable, so we do it
1024
+ * in a function and mark the function's invocation as pure.
1025
+ */
1026
+ const removeMode = (props) => delete props.mode;
1027
+ /*#__PURE__*/ removeMode(TransitionGroupImpl.props);
1020
1028
  const TransitionGroup = TransitionGroupImpl;
1021
1029
  function callPendingCbs(c) {
1022
1030
  const el = c.el;
@@ -1092,7 +1100,7 @@ const vModelText = {
1092
1100
  domValue = domValue.trim();
1093
1101
  }
1094
1102
  if (castToNumber) {
1095
- domValue = shared.toNumber(domValue);
1103
+ domValue = shared.looseToNumber(domValue);
1096
1104
  }
1097
1105
  el._assign(domValue);
1098
1106
  });
@@ -1127,7 +1135,8 @@ const vModelText = {
1127
1135
  if (trim && el.value.trim() === value) {
1128
1136
  return;
1129
1137
  }
1130
- if ((number || el.type === 'number') && shared.toNumber(el.value) === value) {
1138
+ if ((number || el.type === 'number') &&
1139
+ shared.looseToNumber(el.value) === value) {
1131
1140
  return;
1132
1141
  }
1133
1142
  }
@@ -1216,7 +1225,7 @@ const vModelSelect = {
1216
1225
  addEventListener(el, 'change', () => {
1217
1226
  const selectedVal = Array.prototype.filter
1218
1227
  .call(el.options, (o) => o.selected)
1219
- .map((o) => number ? shared.toNumber(getValue(o)) : getValue(o));
1228
+ .map((o) => number ? shared.looseToNumber(getValue(o)) : getValue(o));
1220
1229
  el._assign(el.multiple
1221
1230
  ? isSetModel
1222
1231
  ? new Set(selectedVal)
@@ -1531,9 +1540,6 @@ const initDirectivesForSSR = () => {
1531
1540
  }
1532
1541
  ;
1533
1542
 
1534
- Object.keys(runtimeCore).forEach(function (k) {
1535
- if (k !== 'default') exports[k] = runtimeCore[k];
1536
- });
1537
1543
  exports.Transition = Transition;
1538
1544
  exports.TransitionGroup = TransitionGroup;
1539
1545
  exports.VueElement = VueElement;
@@ -1554,3 +1560,6 @@ exports.vModelText = vModelText;
1554
1560
  exports.vShow = vShow;
1555
1561
  exports.withKeys = withKeys;
1556
1562
  exports.withModifiers = withModifiers;
1563
+ Object.keys(runtimeCore).forEach(function(k) {
1564
+ if (k !== 'default') exports[k] = runtimeCore[k];
1565
+ });
@@ -481,6 +481,17 @@ export interface HTMLAttributes extends AriaAttributes, EventHandlers<Events> {
481
481
  is?: string
482
482
  }
483
483
 
484
+ type HTMLAttributeReferrerPolicy =
485
+ | ''
486
+ | 'no-referrer'
487
+ | 'no-referrer-when-downgrade'
488
+ | 'origin'
489
+ | 'origin-when-cross-origin'
490
+ | 'same-origin'
491
+ | 'strict-origin'
492
+ | 'strict-origin-when-cross-origin'
493
+ | 'unsafe-url'
494
+
484
495
  export interface AnchorHTMLAttributes extends HTMLAttributes {
485
496
  download?: any
486
497
  href?: string
@@ -490,7 +501,7 @@ export interface AnchorHTMLAttributes extends HTMLAttributes {
490
501
  rel?: string
491
502
  target?: string
492
503
  type?: string
493
- referrerpolicy?: string
504
+ referrerpolicy?: HTMLAttributeReferrerPolicy
494
505
  }
495
506
 
496
507
  export interface AreaHTMLAttributes extends HTMLAttributes {
@@ -500,6 +511,7 @@ export interface AreaHTMLAttributes extends HTMLAttributes {
500
511
  href?: string
501
512
  hreflang?: string
502
513
  media?: string
514
+ referrerpolicy?: HTMLAttributeReferrerPolicy
503
515
  rel?: string
504
516
  shape?: string
505
517
  target?: string
@@ -598,7 +610,7 @@ export interface IframeHTMLAttributes extends HTMLAttributes {
598
610
  marginheight?: Numberish
599
611
  marginwidth?: Numberish
600
612
  name?: string
601
- referrerpolicy?: string
613
+ referrerpolicy?: HTMLAttributeReferrerPolicy
602
614
  sandbox?: string
603
615
  scrolling?: string
604
616
  seamless?: Booleanish
@@ -612,6 +624,7 @@ export interface ImgHTMLAttributes extends HTMLAttributes {
612
624
  crossorigin?: 'anonymous' | 'use-credentials' | ''
613
625
  decoding?: 'async' | 'auto' | 'sync'
614
626
  height?: Numberish
627
+ referrerpolicy?: HTMLAttributeReferrerPolicy
615
628
  sizes?: string
616
629
  src?: string
617
630
  srcset?: string
@@ -686,6 +699,7 @@ export interface LinkHTMLAttributes extends HTMLAttributes {
686
699
  hreflang?: string
687
700
  integrity?: string
688
701
  media?: string
702
+ referrerpolicy?: HTMLAttributeReferrerPolicy
689
703
  rel?: string
690
704
  sizes?: string
691
705
  type?: string
@@ -786,6 +800,7 @@ export interface ScriptHTMLAttributes extends HTMLAttributes {
786
800
  defer?: Booleanish
787
801
  integrity?: string
788
802
  nomodule?: Booleanish
803
+ referrerpolicy?: HTMLAttributeReferrerPolicy
789
804
  nonce?: string
790
805
  src?: string
791
806
  type?: string
@@ -1473,7 +1488,9 @@ export interface Events {
1473
1488
  }
1474
1489
 
1475
1490
  type EventHandlers<E> = {
1476
- [K in keyof E]?: E[K] extends (...args: any) => any ? E[K] : (payload: E[K]) => void
1491
+ [K in keyof E]?: E[K] extends (...args: any) => any
1492
+ ? E[K]
1493
+ : (payload: E[K]) => void
1477
1494
  }
1478
1495
 
1479
1496
  // use namespace import to avoid collision with generated types which use