@vue/runtime-dom 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/runtime-dom.cjs.js +1 -1
- package/dist/runtime-dom.cjs.prod.js +1 -1
- package/dist/runtime-dom.esm-browser.js +53 -37
- package/dist/runtime-dom.esm-browser.prod.js +2 -2
- package/dist/runtime-dom.esm-bundler.js +1 -1
- package/dist/runtime-dom.global.js +53 -37
- package/dist/runtime-dom.global.prod.js +2 -2
- package/package.json +4 -4
package/dist/runtime-dom.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.4.
|
|
2
|
+
* @vue/runtime-dom v3.4.35
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -4492,14 +4492,27 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
4492
4492
|
if (validatePropName(normalizedKey)) {
|
|
4493
4493
|
const opt = raw[key];
|
|
4494
4494
|
const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4495
|
+
const propType = prop.type;
|
|
4496
|
+
let shouldCast = false;
|
|
4497
|
+
let shouldCastTrue = true;
|
|
4498
|
+
if (isArray(propType)) {
|
|
4499
|
+
for (let index = 0; index < propType.length; ++index) {
|
|
4500
|
+
const type = propType[index];
|
|
4501
|
+
const typeName = isFunction(type) && type.name;
|
|
4502
|
+
if (typeName === "Boolean") {
|
|
4503
|
+
shouldCast = true;
|
|
4504
|
+
break;
|
|
4505
|
+
} else if (typeName === "String") {
|
|
4506
|
+
shouldCastTrue = false;
|
|
4507
|
+
}
|
|
4502
4508
|
}
|
|
4509
|
+
} else {
|
|
4510
|
+
shouldCast = isFunction(propType) && propType.name === "Boolean";
|
|
4511
|
+
}
|
|
4512
|
+
prop[0 /* shouldCast */] = shouldCast;
|
|
4513
|
+
prop[1 /* shouldCastTrue */] = shouldCastTrue;
|
|
4514
|
+
if (shouldCast || hasOwn(prop, "default")) {
|
|
4515
|
+
needCastKeys.push(normalizedKey);
|
|
4503
4516
|
}
|
|
4504
4517
|
}
|
|
4505
4518
|
}
|
|
@@ -4530,17 +4543,6 @@ function getType(ctor) {
|
|
|
4530
4543
|
}
|
|
4531
4544
|
return "";
|
|
4532
4545
|
}
|
|
4533
|
-
function isSameType(a, b) {
|
|
4534
|
-
return getType(a) === getType(b);
|
|
4535
|
-
}
|
|
4536
|
-
function getTypeIndex(type, expectedTypes) {
|
|
4537
|
-
if (isArray(expectedTypes)) {
|
|
4538
|
-
return expectedTypes.findIndex((t) => isSameType(t, type));
|
|
4539
|
-
} else if (isFunction(expectedTypes)) {
|
|
4540
|
-
return isSameType(expectedTypes, type) ? 0 : -1;
|
|
4541
|
-
}
|
|
4542
|
-
return -1;
|
|
4543
|
-
}
|
|
4544
4546
|
function validateProps(rawProps, props, instance) {
|
|
4545
4547
|
const resolvedValues = toRaw(props);
|
|
4546
4548
|
const options = instance.propsOptions[0];
|
|
@@ -4880,15 +4882,11 @@ const TeleportImpl = {
|
|
|
4880
4882
|
if (n1 == null) {
|
|
4881
4883
|
const placeholder = n2.el = createComment("teleport start") ;
|
|
4882
4884
|
const mainAnchor = n2.anchor = createComment("teleport end") ;
|
|
4883
|
-
const target = n2.target = resolveTarget(n2.props, querySelector);
|
|
4884
|
-
const targetStart = n2.targetStart = createText("");
|
|
4885
|
-
const targetAnchor = n2.targetAnchor = createText("");
|
|
4886
4885
|
insert(placeholder, container, anchor);
|
|
4887
4886
|
insert(mainAnchor, container, anchor);
|
|
4888
|
-
|
|
4887
|
+
const target = n2.target = resolveTarget(n2.props, querySelector);
|
|
4888
|
+
const targetAnchor = prepareAnchor(target, n2, createText, insert);
|
|
4889
4889
|
if (target) {
|
|
4890
|
-
insert(targetStart, target);
|
|
4891
|
-
insert(targetAnchor, target);
|
|
4892
4890
|
if (namespace === "svg" || isTargetSVG(target)) {
|
|
4893
4891
|
namespace = "svg";
|
|
4894
4892
|
} else if (namespace === "mathml" || isTargetMathML(target)) {
|
|
@@ -5060,7 +5058,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
|
|
|
5060
5058
|
}
|
|
5061
5059
|
}
|
|
5062
5060
|
function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
|
|
5063
|
-
o: { nextSibling, parentNode, querySelector }
|
|
5061
|
+
o: { nextSibling, parentNode, querySelector, insert, createText }
|
|
5064
5062
|
}, hydrateChildren) {
|
|
5065
5063
|
const target = vnode.target = resolveTarget(
|
|
5066
5064
|
vnode.props,
|
|
@@ -5079,20 +5077,28 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
5079
5077
|
slotScopeIds,
|
|
5080
5078
|
optimized
|
|
5081
5079
|
);
|
|
5082
|
-
vnode.
|
|
5080
|
+
vnode.targetStart = targetNode;
|
|
5081
|
+
vnode.targetAnchor = targetNode && nextSibling(targetNode);
|
|
5083
5082
|
} else {
|
|
5084
5083
|
vnode.anchor = nextSibling(node);
|
|
5085
5084
|
let targetAnchor = targetNode;
|
|
5086
5085
|
while (targetAnchor) {
|
|
5087
|
-
targetAnchor
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5086
|
+
if (targetAnchor && targetAnchor.nodeType === 8) {
|
|
5087
|
+
if (targetAnchor.data === "teleport start anchor") {
|
|
5088
|
+
vnode.targetStart = targetAnchor;
|
|
5089
|
+
} else if (targetAnchor.data === "teleport anchor") {
|
|
5090
|
+
vnode.targetAnchor = targetAnchor;
|
|
5091
|
+
target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
|
|
5092
|
+
break;
|
|
5093
|
+
}
|
|
5092
5094
|
}
|
|
5095
|
+
targetAnchor = nextSibling(targetAnchor);
|
|
5096
|
+
}
|
|
5097
|
+
if (!vnode.targetAnchor) {
|
|
5098
|
+
prepareAnchor(target, vnode, createText, insert);
|
|
5093
5099
|
}
|
|
5094
5100
|
hydrateChildren(
|
|
5095
|
-
targetNode,
|
|
5101
|
+
targetNode && nextSibling(targetNode),
|
|
5096
5102
|
vnode,
|
|
5097
5103
|
target,
|
|
5098
5104
|
parentComponent,
|
|
@@ -5118,6 +5124,16 @@ function updateCssVars(vnode) {
|
|
|
5118
5124
|
ctx.ut();
|
|
5119
5125
|
}
|
|
5120
5126
|
}
|
|
5127
|
+
function prepareAnchor(target, vnode, createText, insert) {
|
|
5128
|
+
const targetStart = vnode.targetStart = createText("");
|
|
5129
|
+
const targetAnchor = vnode.targetAnchor = createText("");
|
|
5130
|
+
targetStart[TeleportEndKey] = targetAnchor;
|
|
5131
|
+
if (target) {
|
|
5132
|
+
insert(targetStart, target);
|
|
5133
|
+
insert(targetAnchor, target);
|
|
5134
|
+
}
|
|
5135
|
+
return targetAnchor;
|
|
5136
|
+
}
|
|
5121
5137
|
|
|
5122
5138
|
let hasLoggedMismatchError = false;
|
|
5123
5139
|
const logMismatchError = () => {
|
|
@@ -7505,7 +7521,7 @@ function useModel(props, name, options = EMPTY_OBJ) {
|
|
|
7505
7521
|
const modifiers = getModelModifiers(props, name);
|
|
7506
7522
|
const res = customRef((track, trigger) => {
|
|
7507
7523
|
let localValue;
|
|
7508
|
-
let prevSetValue;
|
|
7524
|
+
let prevSetValue = EMPTY_OBJ;
|
|
7509
7525
|
let prevEmittedValue;
|
|
7510
7526
|
watchSyncEffect(() => {
|
|
7511
7527
|
const propValue = props[name];
|
|
@@ -7520,7 +7536,7 @@ function useModel(props, name, options = EMPTY_OBJ) {
|
|
|
7520
7536
|
return options.get ? options.get(localValue) : localValue;
|
|
7521
7537
|
},
|
|
7522
7538
|
set(value) {
|
|
7523
|
-
if (!hasChanged(value, localValue)) {
|
|
7539
|
+
if (!hasChanged(value, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
|
|
7524
7540
|
return;
|
|
7525
7541
|
}
|
|
7526
7542
|
const rawProps = i.vnode.props;
|
|
@@ -7531,7 +7547,7 @@ function useModel(props, name, options = EMPTY_OBJ) {
|
|
|
7531
7547
|
}
|
|
7532
7548
|
const emittedValue = options.set ? options.set(value) : value;
|
|
7533
7549
|
i.emit(`update:${name}`, emittedValue);
|
|
7534
|
-
if (value
|
|
7550
|
+
if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
|
|
7535
7551
|
trigger();
|
|
7536
7552
|
}
|
|
7537
7553
|
prevSetValue = value;
|
|
@@ -9595,7 +9611,7 @@ function isMemoSame(cached, memo) {
|
|
|
9595
9611
|
return true;
|
|
9596
9612
|
}
|
|
9597
9613
|
|
|
9598
|
-
const version = "3.4.
|
|
9614
|
+
const version = "3.4.35";
|
|
9599
9615
|
const warn = warn$1 ;
|
|
9600
9616
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
9601
9617
|
const devtools = devtools$1 ;
|