@vue/compat 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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.4.33
2
+ * @vue/compat v3.4.35
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -5179,7 +5179,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5179
5179
  return vm;
5180
5180
  }
5181
5181
  }
5182
- Vue.version = `2.6.14-compat:${"3.4.33"}`;
5182
+ Vue.version = `2.6.14-compat:${"3.4.35"}`;
5183
5183
  Vue.config = singletonApp.config;
5184
5184
  Vue.use = (plugin, ...options) => {
5185
5185
  if (plugin && isFunction(plugin.install)) {
@@ -6096,14 +6096,27 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
6096
6096
  if (validatePropName(normalizedKey)) {
6097
6097
  const opt = raw[key];
6098
6098
  const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
6099
- if (prop) {
6100
- const booleanIndex = getTypeIndex(Boolean, prop.type);
6101
- const stringIndex = getTypeIndex(String, prop.type);
6102
- prop[0 /* shouldCast */] = booleanIndex > -1;
6103
- prop[1 /* shouldCastTrue */] = stringIndex < 0 || booleanIndex < stringIndex;
6104
- if (booleanIndex > -1 || hasOwn(prop, "default")) {
6105
- needCastKeys.push(normalizedKey);
6099
+ const propType = prop.type;
6100
+ let shouldCast = false;
6101
+ let shouldCastTrue = true;
6102
+ if (isArray(propType)) {
6103
+ for (let index = 0; index < propType.length; ++index) {
6104
+ const type = propType[index];
6105
+ const typeName = isFunction(type) && type.name;
6106
+ if (typeName === "Boolean") {
6107
+ shouldCast = true;
6108
+ break;
6109
+ } else if (typeName === "String") {
6110
+ shouldCastTrue = false;
6111
+ }
6106
6112
  }
6113
+ } else {
6114
+ shouldCast = isFunction(propType) && propType.name === "Boolean";
6115
+ }
6116
+ prop[0 /* shouldCast */] = shouldCast;
6117
+ prop[1 /* shouldCastTrue */] = shouldCastTrue;
6118
+ if (shouldCast || hasOwn(prop, "default")) {
6119
+ needCastKeys.push(normalizedKey);
6107
6120
  }
6108
6121
  }
6109
6122
  }
@@ -6134,17 +6147,6 @@ function getType(ctor) {
6134
6147
  }
6135
6148
  return "";
6136
6149
  }
6137
- function isSameType(a, b) {
6138
- return getType(a) === getType(b);
6139
- }
6140
- function getTypeIndex(type, expectedTypes) {
6141
- if (isArray(expectedTypes)) {
6142
- return expectedTypes.findIndex((t) => isSameType(t, type));
6143
- } else if (isFunction(expectedTypes)) {
6144
- return isSameType(expectedTypes, type) ? 0 : -1;
6145
- }
6146
- return -1;
6147
- }
6148
6150
  function validateProps(rawProps, props, instance) {
6149
6151
  const resolvedValues = toRaw(props);
6150
6152
  const options = instance.propsOptions[0];
@@ -6484,15 +6486,11 @@ const TeleportImpl = {
6484
6486
  if (n1 == null) {
6485
6487
  const placeholder = n2.el = createComment("teleport start") ;
6486
6488
  const mainAnchor = n2.anchor = createComment("teleport end") ;
6487
- const target = n2.target = resolveTarget(n2.props, querySelector);
6488
- const targetStart = n2.targetStart = createText("");
6489
- const targetAnchor = n2.targetAnchor = createText("");
6490
6489
  insert(placeholder, container, anchor);
6491
6490
  insert(mainAnchor, container, anchor);
6492
- targetStart[TeleportEndKey] = targetAnchor;
6491
+ const target = n2.target = resolveTarget(n2.props, querySelector);
6492
+ const targetAnchor = prepareAnchor(target, n2, createText, insert);
6493
6493
  if (target) {
6494
- insert(targetStart, target);
6495
- insert(targetAnchor, target);
6496
6494
  if (namespace === "svg" || isTargetSVG(target)) {
6497
6495
  namespace = "svg";
6498
6496
  } else if (namespace === "mathml" || isTargetMathML(target)) {
@@ -6664,7 +6662,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
6664
6662
  }
6665
6663
  }
6666
6664
  function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
6667
- o: { nextSibling, parentNode, querySelector }
6665
+ o: { nextSibling, parentNode, querySelector, insert, createText }
6668
6666
  }, hydrateChildren) {
6669
6667
  const target = vnode.target = resolveTarget(
6670
6668
  vnode.props,
@@ -6683,20 +6681,28 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
6683
6681
  slotScopeIds,
6684
6682
  optimized
6685
6683
  );
6686
- vnode.targetAnchor = targetNode;
6684
+ vnode.targetStart = targetNode;
6685
+ vnode.targetAnchor = targetNode && nextSibling(targetNode);
6687
6686
  } else {
6688
6687
  vnode.anchor = nextSibling(node);
6689
6688
  let targetAnchor = targetNode;
6690
6689
  while (targetAnchor) {
6691
- targetAnchor = nextSibling(targetAnchor);
6692
- if (targetAnchor && targetAnchor.nodeType === 8 && targetAnchor.data === "teleport anchor") {
6693
- vnode.targetAnchor = targetAnchor;
6694
- target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
6695
- break;
6690
+ if (targetAnchor && targetAnchor.nodeType === 8) {
6691
+ if (targetAnchor.data === "teleport start anchor") {
6692
+ vnode.targetStart = targetAnchor;
6693
+ } else if (targetAnchor.data === "teleport anchor") {
6694
+ vnode.targetAnchor = targetAnchor;
6695
+ target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
6696
+ break;
6697
+ }
6696
6698
  }
6699
+ targetAnchor = nextSibling(targetAnchor);
6700
+ }
6701
+ if (!vnode.targetAnchor) {
6702
+ prepareAnchor(target, vnode, createText, insert);
6697
6703
  }
6698
6704
  hydrateChildren(
6699
- targetNode,
6705
+ targetNode && nextSibling(targetNode),
6700
6706
  vnode,
6701
6707
  target,
6702
6708
  parentComponent,
@@ -6722,6 +6728,16 @@ function updateCssVars(vnode) {
6722
6728
  ctx.ut();
6723
6729
  }
6724
6730
  }
6731
+ function prepareAnchor(target, vnode, createText, insert) {
6732
+ const targetStart = vnode.targetStart = createText("");
6733
+ const targetAnchor = vnode.targetAnchor = createText("");
6734
+ targetStart[TeleportEndKey] = targetAnchor;
6735
+ if (target) {
6736
+ insert(targetStart, target);
6737
+ insert(targetAnchor, target);
6738
+ }
6739
+ return targetAnchor;
6740
+ }
6725
6741
 
6726
6742
  let hasLoggedMismatchError = false;
6727
6743
  const logMismatchError = () => {
@@ -9153,7 +9169,7 @@ function useModel(props, name, options = EMPTY_OBJ) {
9153
9169
  const modifiers = getModelModifiers(props, name);
9154
9170
  const res = customRef((track, trigger) => {
9155
9171
  let localValue;
9156
- let prevSetValue;
9172
+ let prevSetValue = EMPTY_OBJ;
9157
9173
  let prevEmittedValue;
9158
9174
  watchSyncEffect(() => {
9159
9175
  const propValue = props[name];
@@ -9168,7 +9184,7 @@ function useModel(props, name, options = EMPTY_OBJ) {
9168
9184
  return options.get ? options.get(localValue) : localValue;
9169
9185
  },
9170
9186
  set(value) {
9171
- if (!hasChanged(value, localValue)) {
9187
+ if (!hasChanged(value, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
9172
9188
  return;
9173
9189
  }
9174
9190
  const rawProps = i.vnode.props;
@@ -9179,7 +9195,7 @@ function useModel(props, name, options = EMPTY_OBJ) {
9179
9195
  }
9180
9196
  const emittedValue = options.set ? options.set(value) : value;
9181
9197
  i.emit(`update:${name}`, emittedValue);
9182
- if (value !== emittedValue && value !== prevSetValue && emittedValue === prevEmittedValue) {
9198
+ if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
9183
9199
  trigger();
9184
9200
  }
9185
9201
  prevSetValue = value;
@@ -11350,7 +11366,7 @@ function isMemoSame(cached, memo) {
11350
11366
  return true;
11351
11367
  }
11352
11368
 
11353
- const version = "3.4.33";
11369
+ const version = "3.4.35";
11354
11370
  const warn = warn$1 ;
11355
11371
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11356
11372
  const devtools = devtools$1 ;