vue 3.4.33 → 3.4.35

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.
package/dist/vue.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.4.33
2
+ * vue v3.4.35
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.4.33
2
+ * vue v3.4.35
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.4.33
2
+ * vue v3.4.35
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -4559,14 +4559,27 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
4559
4559
  if (validatePropName(normalizedKey)) {
4560
4560
  const opt = raw[key];
4561
4561
  const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
4562
- if (prop) {
4563
- const booleanIndex = getTypeIndex(Boolean, prop.type);
4564
- const stringIndex = getTypeIndex(String, prop.type);
4565
- prop[0 /* shouldCast */] = booleanIndex > -1;
4566
- prop[1 /* shouldCastTrue */] = stringIndex < 0 || booleanIndex < stringIndex;
4567
- if (booleanIndex > -1 || hasOwn(prop, "default")) {
4568
- needCastKeys.push(normalizedKey);
4562
+ const propType = prop.type;
4563
+ let shouldCast = false;
4564
+ let shouldCastTrue = true;
4565
+ if (isArray(propType)) {
4566
+ for (let index = 0; index < propType.length; ++index) {
4567
+ const type = propType[index];
4568
+ const typeName = isFunction(type) && type.name;
4569
+ if (typeName === "Boolean") {
4570
+ shouldCast = true;
4571
+ break;
4572
+ } else if (typeName === "String") {
4573
+ shouldCastTrue = false;
4574
+ }
4569
4575
  }
4576
+ } else {
4577
+ shouldCast = isFunction(propType) && propType.name === "Boolean";
4578
+ }
4579
+ prop[0 /* shouldCast */] = shouldCast;
4580
+ prop[1 /* shouldCastTrue */] = shouldCastTrue;
4581
+ if (shouldCast || hasOwn(prop, "default")) {
4582
+ needCastKeys.push(normalizedKey);
4570
4583
  }
4571
4584
  }
4572
4585
  }
@@ -4597,17 +4610,6 @@ function getType(ctor) {
4597
4610
  }
4598
4611
  return "";
4599
4612
  }
4600
- function isSameType(a, b) {
4601
- return getType(a) === getType(b);
4602
- }
4603
- function getTypeIndex(type, expectedTypes) {
4604
- if (isArray(expectedTypes)) {
4605
- return expectedTypes.findIndex((t) => isSameType(t, type));
4606
- } else if (isFunction(expectedTypes)) {
4607
- return isSameType(expectedTypes, type) ? 0 : -1;
4608
- }
4609
- return -1;
4610
- }
4611
4613
  function validateProps(rawProps, props, instance) {
4612
4614
  const resolvedValues = toRaw(props);
4613
4615
  const options = instance.propsOptions[0];
@@ -4947,15 +4949,11 @@ const TeleportImpl = {
4947
4949
  if (n1 == null) {
4948
4950
  const placeholder = n2.el = createComment("teleport start") ;
4949
4951
  const mainAnchor = n2.anchor = createComment("teleport end") ;
4950
- const target = n2.target = resolveTarget(n2.props, querySelector);
4951
- const targetStart = n2.targetStart = createText("");
4952
- const targetAnchor = n2.targetAnchor = createText("");
4953
4952
  insert(placeholder, container, anchor);
4954
4953
  insert(mainAnchor, container, anchor);
4955
- targetStart[TeleportEndKey] = targetAnchor;
4954
+ const target = n2.target = resolveTarget(n2.props, querySelector);
4955
+ const targetAnchor = prepareAnchor(target, n2, createText, insert);
4956
4956
  if (target) {
4957
- insert(targetStart, target);
4958
- insert(targetAnchor, target);
4959
4957
  if (namespace === "svg" || isTargetSVG(target)) {
4960
4958
  namespace = "svg";
4961
4959
  } else if (namespace === "mathml" || isTargetMathML(target)) {
@@ -5127,7 +5125,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
5127
5125
  }
5128
5126
  }
5129
5127
  function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
5130
- o: { nextSibling, parentNode, querySelector }
5128
+ o: { nextSibling, parentNode, querySelector, insert, createText }
5131
5129
  }, hydrateChildren) {
5132
5130
  const target = vnode.target = resolveTarget(
5133
5131
  vnode.props,
@@ -5146,20 +5144,28 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
5146
5144
  slotScopeIds,
5147
5145
  optimized
5148
5146
  );
5149
- vnode.targetAnchor = targetNode;
5147
+ vnode.targetStart = targetNode;
5148
+ vnode.targetAnchor = targetNode && nextSibling(targetNode);
5150
5149
  } else {
5151
5150
  vnode.anchor = nextSibling(node);
5152
5151
  let targetAnchor = targetNode;
5153
5152
  while (targetAnchor) {
5154
- targetAnchor = nextSibling(targetAnchor);
5155
- if (targetAnchor && targetAnchor.nodeType === 8 && targetAnchor.data === "teleport anchor") {
5156
- vnode.targetAnchor = targetAnchor;
5157
- target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
5158
- break;
5153
+ if (targetAnchor && targetAnchor.nodeType === 8) {
5154
+ if (targetAnchor.data === "teleport start anchor") {
5155
+ vnode.targetStart = targetAnchor;
5156
+ } else if (targetAnchor.data === "teleport anchor") {
5157
+ vnode.targetAnchor = targetAnchor;
5158
+ target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
5159
+ break;
5160
+ }
5159
5161
  }
5162
+ targetAnchor = nextSibling(targetAnchor);
5163
+ }
5164
+ if (!vnode.targetAnchor) {
5165
+ prepareAnchor(target, vnode, createText, insert);
5160
5166
  }
5161
5167
  hydrateChildren(
5162
- targetNode,
5168
+ targetNode && nextSibling(targetNode),
5163
5169
  vnode,
5164
5170
  target,
5165
5171
  parentComponent,
@@ -5185,6 +5191,16 @@ function updateCssVars(vnode) {
5185
5191
  ctx.ut();
5186
5192
  }
5187
5193
  }
5194
+ function prepareAnchor(target, vnode, createText, insert) {
5195
+ const targetStart = vnode.targetStart = createText("");
5196
+ const targetAnchor = vnode.targetAnchor = createText("");
5197
+ targetStart[TeleportEndKey] = targetAnchor;
5198
+ if (target) {
5199
+ insert(targetStart, target);
5200
+ insert(targetAnchor, target);
5201
+ }
5202
+ return targetAnchor;
5203
+ }
5188
5204
 
5189
5205
  let hasLoggedMismatchError = false;
5190
5206
  const logMismatchError = () => {
@@ -7572,7 +7588,7 @@ function useModel(props, name, options = EMPTY_OBJ) {
7572
7588
  const modifiers = getModelModifiers(props, name);
7573
7589
  const res = customRef((track, trigger) => {
7574
7590
  let localValue;
7575
- let prevSetValue;
7591
+ let prevSetValue = EMPTY_OBJ;
7576
7592
  let prevEmittedValue;
7577
7593
  watchSyncEffect(() => {
7578
7594
  const propValue = props[name];
@@ -7587,7 +7603,7 @@ function useModel(props, name, options = EMPTY_OBJ) {
7587
7603
  return options.get ? options.get(localValue) : localValue;
7588
7604
  },
7589
7605
  set(value) {
7590
- if (!hasChanged(value, localValue)) {
7606
+ if (!hasChanged(value, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
7591
7607
  return;
7592
7608
  }
7593
7609
  const rawProps = i.vnode.props;
@@ -7598,7 +7614,7 @@ function useModel(props, name, options = EMPTY_OBJ) {
7598
7614
  }
7599
7615
  const emittedValue = options.set ? options.set(value) : value;
7600
7616
  i.emit(`update:${name}`, emittedValue);
7601
- if (value !== emittedValue && value !== prevSetValue && emittedValue === prevEmittedValue) {
7617
+ if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
7602
7618
  trigger();
7603
7619
  }
7604
7620
  prevSetValue = value;
@@ -9662,7 +9678,7 @@ function isMemoSame(cached, memo) {
9662
9678
  return true;
9663
9679
  }
9664
9680
 
9665
- const version = "3.4.33";
9681
+ const version = "3.4.35";
9666
9682
  const warn = warn$1 ;
9667
9683
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9668
9684
  const devtools = devtools$1 ;