@vue/runtime-core 3.5.38 → 3.5.40
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-core.cjs.js +84 -35
- package/dist/runtime-core.cjs.prod.js +90 -36
- package/dist/runtime-core.d.ts +15 -13
- package/dist/runtime-core.esm-bundler.js +87 -37
- package/package.json +3 -3
package/dist/runtime-core.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.5.
|
|
2
|
+
* @vue/runtime-core v3.5.40
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -694,10 +694,12 @@ function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
|
|
|
694
694
|
setBlockTracking(-1);
|
|
695
695
|
}
|
|
696
696
|
const prevInstance = setCurrentRenderingInstance(ctx);
|
|
697
|
+
const prevStackSize = blockStack.length;
|
|
697
698
|
let res;
|
|
698
699
|
try {
|
|
699
700
|
res = fn(...args);
|
|
700
701
|
} finally {
|
|
702
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
701
703
|
setCurrentRenderingInstance(prevInstance);
|
|
702
704
|
if (renderFnWithContext._d) {
|
|
703
705
|
setBlockTracking(1);
|
|
@@ -1116,11 +1118,9 @@ const TeleportImpl = {
|
|
|
1116
1118
|
}
|
|
1117
1119
|
} else {
|
|
1118
1120
|
if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
|
|
1119
|
-
const nextTarget = n2.
|
|
1120
|
-
n2.props,
|
|
1121
|
-
querySelector
|
|
1122
|
-
);
|
|
1121
|
+
const nextTarget = resolveTarget(n2.props, querySelector);
|
|
1123
1122
|
if (nextTarget) {
|
|
1123
|
+
n2.target = nextTarget;
|
|
1124
1124
|
moveTeleport(
|
|
1125
1125
|
n2,
|
|
1126
1126
|
nextTarget,
|
|
@@ -1158,7 +1158,8 @@ const TeleportImpl = {
|
|
|
1158
1158
|
target,
|
|
1159
1159
|
props
|
|
1160
1160
|
} = vnode;
|
|
1161
|
-
const
|
|
1161
|
+
const disabled = isTeleportDisabled(props);
|
|
1162
|
+
const shouldRemove = doRemove || !disabled;
|
|
1162
1163
|
const pendingMount = pendingMounts.get(vnode);
|
|
1163
1164
|
if (pendingMount) {
|
|
1164
1165
|
pendingMount.flags |= 8;
|
|
@@ -1169,7 +1170,7 @@ const TeleportImpl = {
|
|
|
1169
1170
|
hostRemove(targetAnchor);
|
|
1170
1171
|
}
|
|
1171
1172
|
doRemove && hostRemove(anchor);
|
|
1172
|
-
if (!pendingMount && shapeFlag & 16) {
|
|
1173
|
+
if (!pendingMount && (disabled || target) && shapeFlag & 16) {
|
|
1173
1174
|
for (let i = 0; i < children.length; i++) {
|
|
1174
1175
|
const child = children[i];
|
|
1175
1176
|
unmount(
|
|
@@ -2104,7 +2105,15 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
2104
2105
|
};
|
|
2105
2106
|
const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
2106
2107
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
2107
|
-
const {
|
|
2108
|
+
const {
|
|
2109
|
+
type,
|
|
2110
|
+
dynamicProps,
|
|
2111
|
+
props,
|
|
2112
|
+
patchFlag,
|
|
2113
|
+
shapeFlag,
|
|
2114
|
+
dirs,
|
|
2115
|
+
transition
|
|
2116
|
+
} = vnode;
|
|
2108
2117
|
const forcePatch = type === "input" || type === "option";
|
|
2109
2118
|
{
|
|
2110
2119
|
if (dirs) {
|
|
@@ -2175,6 +2184,7 @@ Server rendered element contains more child nodes than client vdom.`
|
|
|
2175
2184
|
if (props) {
|
|
2176
2185
|
{
|
|
2177
2186
|
const isCustomElement = el.tagName.includes("-");
|
|
2187
|
+
const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
|
|
2178
2188
|
for (const key in props) {
|
|
2179
2189
|
if (// #11189 skip if this node has directives that have created hooks
|
|
2180
2190
|
// as it could have mutated the DOM in any possible way
|
|
@@ -2182,8 +2192,8 @@ Server rendered element contains more child nodes than client vdom.`
|
|
|
2182
2192
|
logMismatchError();
|
|
2183
2193
|
}
|
|
2184
2194
|
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || shared.isOn(key) && !shared.isReservedProp(key) || // force hydrate v-bind with .prop modifiers
|
|
2185
|
-
key[0] === "." || isCustomElement && !shared.isReservedProp(key)) {
|
|
2186
|
-
patchProp(el, key, null, props[key],
|
|
2195
|
+
key[0] === "." || isCustomElement && !shared.isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
|
|
2196
|
+
patchProp(el, key, null, props[key], namespace, parentComponent);
|
|
2187
2197
|
}
|
|
2188
2198
|
}
|
|
2189
2199
|
}
|
|
@@ -2287,7 +2297,7 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
2287
2297
|
}
|
|
2288
2298
|
};
|
|
2289
2299
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
2290
|
-
if (!
|
|
2300
|
+
if (!isNodeMismatchAllowed(node, vnode)) {
|
|
2291
2301
|
warn$1(
|
|
2292
2302
|
`Hydration node mismatch:
|
|
2293
2303
|
- rendered on server:`,
|
|
@@ -2502,7 +2512,12 @@ function isMismatchAllowed(el, allowedType) {
|
|
|
2502
2512
|
el = el.parentElement;
|
|
2503
2513
|
}
|
|
2504
2514
|
}
|
|
2505
|
-
|
|
2515
|
+
return isMismatchAllowedByAttr(
|
|
2516
|
+
el && el.getAttribute(allowMismatchAttr),
|
|
2517
|
+
allowedType
|
|
2518
|
+
);
|
|
2519
|
+
}
|
|
2520
|
+
function isMismatchAllowedByAttr(allowedAttr, allowedType) {
|
|
2506
2521
|
if (allowedAttr == null) {
|
|
2507
2522
|
return false;
|
|
2508
2523
|
} else if (allowedAttr === "") {
|
|
@@ -2515,6 +2530,19 @@ function isMismatchAllowed(el, allowedType) {
|
|
|
2515
2530
|
return list.includes(MismatchTypeString[allowedType]);
|
|
2516
2531
|
}
|
|
2517
2532
|
}
|
|
2533
|
+
function isNodeMismatchAllowed(node, vnode) {
|
|
2534
|
+
return isMismatchAllowed(node.parentElement, 1 /* CHILDREN */) || isMismatchAllowedByNode(node) || isMismatchAllowedByVNode(vnode);
|
|
2535
|
+
}
|
|
2536
|
+
function isMismatchAllowedByNode(node) {
|
|
2537
|
+
return node.nodeType === 1 && isMismatchAllowedByAttr(
|
|
2538
|
+
node.getAttribute(allowMismatchAttr),
|
|
2539
|
+
1 /* CHILDREN */
|
|
2540
|
+
);
|
|
2541
|
+
}
|
|
2542
|
+
function isMismatchAllowedByVNode({ props }) {
|
|
2543
|
+
const allowedAttr = props && props[allowMismatchAttr];
|
|
2544
|
+
return typeof allowedAttr === "string" && isMismatchAllowedByAttr(allowedAttr, 1 /* CHILDREN */);
|
|
2545
|
+
}
|
|
2518
2546
|
|
|
2519
2547
|
const requestIdleCallback = shared.getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
|
|
2520
2548
|
const cancelIdleCallback = shared.getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
|
|
@@ -2668,6 +2696,7 @@ function defineAsyncComponent(source) {
|
|
|
2668
2696
|
name: "AsyncComponentWrapper",
|
|
2669
2697
|
__asyncLoader: load,
|
|
2670
2698
|
__asyncHydrate(el, instance, hydrate) {
|
|
2699
|
+
const wasConnected = el.isConnected;
|
|
2671
2700
|
let patched = false;
|
|
2672
2701
|
(instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
2673
2702
|
const performHydrate = () => {
|
|
@@ -2679,6 +2708,7 @@ function defineAsyncComponent(source) {
|
|
|
2679
2708
|
}
|
|
2680
2709
|
return;
|
|
2681
2710
|
}
|
|
2711
|
+
if (!el.parentNode || wasConnected && !el.isConnected) return;
|
|
2682
2712
|
hydrate();
|
|
2683
2713
|
};
|
|
2684
2714
|
const doHydrate = hydrateStrategy ? () => {
|
|
@@ -3234,14 +3264,15 @@ function createSlots(slots, dynamicSlots) {
|
|
|
3234
3264
|
return slots;
|
|
3235
3265
|
}
|
|
3236
3266
|
|
|
3237
|
-
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
3267
|
+
function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
|
|
3238
3268
|
if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
|
|
3239
|
-
const
|
|
3240
|
-
|
|
3269
|
+
const slotProps = branchKey != null && props.key == null ? shared.extend({}, props, { key: branchKey }) : props;
|
|
3270
|
+
const hasProps = Object.keys(slotProps).length > 0;
|
|
3271
|
+
if (name !== "default") slotProps.name = name;
|
|
3241
3272
|
return openBlock(), createBlock(
|
|
3242
3273
|
Fragment,
|
|
3243
3274
|
null,
|
|
3244
|
-
[createVNode("slot",
|
|
3275
|
+
[createVNode("slot", slotProps, fallback && fallback())],
|
|
3245
3276
|
hasProps ? -2 : 64
|
|
3246
3277
|
);
|
|
3247
3278
|
}
|
|
@@ -3255,26 +3286,34 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
|
3255
3286
|
if (slot && slot._c) {
|
|
3256
3287
|
slot._d = false;
|
|
3257
3288
|
}
|
|
3289
|
+
const prevStackSize = blockStack.length;
|
|
3258
3290
|
openBlock();
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3291
|
+
let rendered;
|
|
3292
|
+
try {
|
|
3293
|
+
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
3294
|
+
const slotKey = props.key || branchKey || // slot content array of a dynamic conditional slot may have a branch
|
|
3295
|
+
// key attached in the `createSlots` helper, respect that
|
|
3296
|
+
validSlotContent && validSlotContent.key;
|
|
3297
|
+
rendered = createBlock(
|
|
3298
|
+
Fragment,
|
|
3299
|
+
{
|
|
3300
|
+
key: (slotKey && !shared.isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
|
|
3301
|
+
(!validSlotContent && fallback ? "_fb" : "")
|
|
3302
|
+
},
|
|
3303
|
+
validSlotContent || (fallback ? fallback() : []),
|
|
3304
|
+
validSlotContent && slots._ === 1 ? 64 : -2
|
|
3305
|
+
);
|
|
3306
|
+
} catch (err) {
|
|
3307
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
3308
|
+
throw err;
|
|
3309
|
+
} finally {
|
|
3310
|
+
if (slot && slot._c) {
|
|
3311
|
+
slot._d = true;
|
|
3312
|
+
}
|
|
3313
|
+
}
|
|
3272
3314
|
if (!noSlotted && rendered.scopeId) {
|
|
3273
3315
|
rendered.slotScopeIds = [rendered.scopeId + "-s"];
|
|
3274
3316
|
}
|
|
3275
|
-
if (slot && slot._c) {
|
|
3276
|
-
slot._d = true;
|
|
3277
|
-
}
|
|
3278
3317
|
return rendered;
|
|
3279
3318
|
}
|
|
3280
3319
|
function ensureValidVNode(vnodes) {
|
|
@@ -4509,7 +4548,8 @@ function isEmitListener(options, key) {
|
|
|
4509
4548
|
if (!options || !shared.isOn(key)) {
|
|
4510
4549
|
return false;
|
|
4511
4550
|
}
|
|
4512
|
-
key = key.slice(2)
|
|
4551
|
+
key = key.slice(2);
|
|
4552
|
+
key = key === "Once" ? key : key.replace(/Once$/, "");
|
|
4513
4553
|
return shared.hasOwn(options, key[0].toLowerCase() + key.slice(1)) || shared.hasOwn(options, shared.hyphenate(key)) || shared.hasOwn(options, key);
|
|
4514
4554
|
}
|
|
4515
4555
|
|
|
@@ -5733,7 +5773,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5733
5773
|
invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
5734
5774
|
}
|
|
5735
5775
|
parentComponent && toggleRecurse(parentComponent, true);
|
|
5736
|
-
if (
|
|
5776
|
+
if (
|
|
5777
|
+
// HMR updated, force full diff
|
|
5778
|
+
isHmrUpdating || // #6385 the old vnode may be a user-wrapped non-isomorphic block
|
|
5779
|
+
// Force full diff when block metadata is unstable.
|
|
5780
|
+
dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)
|
|
5781
|
+
) {
|
|
5737
5782
|
patchFlag = 0;
|
|
5738
5783
|
optimized = false;
|
|
5739
5784
|
dynamicChildren = null;
|
|
@@ -7866,6 +7911,10 @@ function normalizeChildren(vnode, children) {
|
|
|
7866
7911
|
}
|
|
7867
7912
|
}
|
|
7868
7913
|
} else if (shared.isFunction(children)) {
|
|
7914
|
+
if (shapeFlag & (1 | 64)) {
|
|
7915
|
+
normalizeChildren(vnode, { default: children });
|
|
7916
|
+
return;
|
|
7917
|
+
}
|
|
7869
7918
|
children = { default: children, _ctx: currentRenderingInstance };
|
|
7870
7919
|
type = 32;
|
|
7871
7920
|
} else {
|
|
@@ -8584,7 +8633,7 @@ function isMemoSame(cached, memo) {
|
|
|
8584
8633
|
return true;
|
|
8585
8634
|
}
|
|
8586
8635
|
|
|
8587
|
-
const version = "3.5.
|
|
8636
|
+
const version = "3.5.40";
|
|
8588
8637
|
const warn = warn$1 ;
|
|
8589
8638
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
8590
8639
|
const devtools = devtools$1 ;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.5.
|
|
2
|
+
* @vue/runtime-core v3.5.40
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -307,10 +307,12 @@ function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
|
|
|
307
307
|
setBlockTracking(-1);
|
|
308
308
|
}
|
|
309
309
|
const prevInstance = setCurrentRenderingInstance(ctx);
|
|
310
|
+
const prevStackSize = blockStack.length;
|
|
310
311
|
let res;
|
|
311
312
|
try {
|
|
312
313
|
res = fn(...args);
|
|
313
314
|
} finally {
|
|
315
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
314
316
|
setCurrentRenderingInstance(prevInstance);
|
|
315
317
|
if (renderFnWithContext._d) {
|
|
316
318
|
setBlockTracking(1);
|
|
@@ -666,11 +668,9 @@ const TeleportImpl = {
|
|
|
666
668
|
}
|
|
667
669
|
} else {
|
|
668
670
|
if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
|
|
669
|
-
const nextTarget = n2.
|
|
670
|
-
n2.props,
|
|
671
|
-
querySelector
|
|
672
|
-
);
|
|
671
|
+
const nextTarget = resolveTarget(n2.props, querySelector);
|
|
673
672
|
if (nextTarget) {
|
|
673
|
+
n2.target = nextTarget;
|
|
674
674
|
moveTeleport(
|
|
675
675
|
n2,
|
|
676
676
|
nextTarget,
|
|
@@ -702,7 +702,8 @@ const TeleportImpl = {
|
|
|
702
702
|
target,
|
|
703
703
|
props
|
|
704
704
|
} = vnode;
|
|
705
|
-
const
|
|
705
|
+
const disabled = isTeleportDisabled(props);
|
|
706
|
+
const shouldRemove = doRemove || !disabled;
|
|
706
707
|
const pendingMount = pendingMounts.get(vnode);
|
|
707
708
|
if (pendingMount) {
|
|
708
709
|
pendingMount.flags |= 8;
|
|
@@ -713,7 +714,7 @@ const TeleportImpl = {
|
|
|
713
714
|
hostRemove(targetAnchor);
|
|
714
715
|
}
|
|
715
716
|
doRemove && hostRemove(anchor);
|
|
716
|
-
if (!pendingMount && shapeFlag & 16) {
|
|
717
|
+
if (!pendingMount && (disabled || target) && shapeFlag & 16) {
|
|
717
718
|
for (let i = 0; i < children.length; i++) {
|
|
718
719
|
const child = children[i];
|
|
719
720
|
unmount(
|
|
@@ -1583,9 +1584,18 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1583
1584
|
};
|
|
1584
1585
|
const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
1585
1586
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
1586
|
-
const {
|
|
1587
|
+
const {
|
|
1588
|
+
type,
|
|
1589
|
+
dynamicProps,
|
|
1590
|
+
props,
|
|
1591
|
+
patchFlag,
|
|
1592
|
+
shapeFlag,
|
|
1593
|
+
dirs,
|
|
1594
|
+
transition
|
|
1595
|
+
} = vnode;
|
|
1587
1596
|
const forcePatch = type === "input" || type === "option";
|
|
1588
|
-
|
|
1597
|
+
const hasDynamicProps = !!dynamicProps;
|
|
1598
|
+
if (forcePatch || hasDynamicProps || patchFlag !== -1) {
|
|
1589
1599
|
if (dirs) {
|
|
1590
1600
|
invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
1591
1601
|
}
|
|
@@ -1639,12 +1649,13 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1639
1649
|
}
|
|
1640
1650
|
}
|
|
1641
1651
|
if (props) {
|
|
1642
|
-
if (forcePatch || !optimized || patchFlag & (16 | 32)) {
|
|
1652
|
+
if (forcePatch || hasDynamicProps || !optimized || patchFlag & (16 | 32)) {
|
|
1643
1653
|
const isCustomElement = el.tagName.includes("-");
|
|
1654
|
+
const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
|
|
1644
1655
|
for (const key in props) {
|
|
1645
1656
|
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || shared.isOn(key) && !shared.isReservedProp(key) || // force hydrate v-bind with .prop modifiers
|
|
1646
|
-
key[0] === "." || isCustomElement && !shared.isReservedProp(key)) {
|
|
1647
|
-
patchProp(el, key, null, props[key],
|
|
1657
|
+
key[0] === "." || isCustomElement && !shared.isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
|
|
1658
|
+
patchProp(el, key, null, props[key], namespace, parentComponent);
|
|
1648
1659
|
}
|
|
1649
1660
|
}
|
|
1650
1661
|
} else if (props.onClick) {
|
|
@@ -1753,7 +1764,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1753
1764
|
}
|
|
1754
1765
|
};
|
|
1755
1766
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
1756
|
-
if (!
|
|
1767
|
+
if (!isNodeMismatchAllowed(node, vnode)) {
|
|
1757
1768
|
logMismatchError();
|
|
1758
1769
|
}
|
|
1759
1770
|
vnode.el = null;
|
|
@@ -1836,7 +1847,12 @@ function isMismatchAllowed(el, allowedType) {
|
|
|
1836
1847
|
el = el.parentElement;
|
|
1837
1848
|
}
|
|
1838
1849
|
}
|
|
1839
|
-
|
|
1850
|
+
return isMismatchAllowedByAttr(
|
|
1851
|
+
el && el.getAttribute(allowMismatchAttr),
|
|
1852
|
+
allowedType
|
|
1853
|
+
);
|
|
1854
|
+
}
|
|
1855
|
+
function isMismatchAllowedByAttr(allowedAttr, allowedType) {
|
|
1840
1856
|
if (allowedAttr == null) {
|
|
1841
1857
|
return false;
|
|
1842
1858
|
} else if (allowedAttr === "") {
|
|
@@ -1849,6 +1865,19 @@ function isMismatchAllowed(el, allowedType) {
|
|
|
1849
1865
|
return list.includes(MismatchTypeString[allowedType]);
|
|
1850
1866
|
}
|
|
1851
1867
|
}
|
|
1868
|
+
function isNodeMismatchAllowed(node, vnode) {
|
|
1869
|
+
return isMismatchAllowed(node.parentElement, 1 /* CHILDREN */) || isMismatchAllowedByNode(node) || isMismatchAllowedByVNode(vnode);
|
|
1870
|
+
}
|
|
1871
|
+
function isMismatchAllowedByNode(node) {
|
|
1872
|
+
return node.nodeType === 1 && isMismatchAllowedByAttr(
|
|
1873
|
+
node.getAttribute(allowMismatchAttr),
|
|
1874
|
+
1 /* CHILDREN */
|
|
1875
|
+
);
|
|
1876
|
+
}
|
|
1877
|
+
function isMismatchAllowedByVNode({ props }) {
|
|
1878
|
+
const allowedAttr = props && props[allowMismatchAttr];
|
|
1879
|
+
return typeof allowedAttr === "string" && isMismatchAllowedByAttr(allowedAttr, 1 /* CHILDREN */);
|
|
1880
|
+
}
|
|
1852
1881
|
|
|
1853
1882
|
const requestIdleCallback = shared.getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
|
|
1854
1883
|
const cancelIdleCallback = shared.getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
|
|
@@ -1994,12 +2023,14 @@ function defineAsyncComponent(source) {
|
|
|
1994
2023
|
name: "AsyncComponentWrapper",
|
|
1995
2024
|
__asyncLoader: load,
|
|
1996
2025
|
__asyncHydrate(el, instance, hydrate) {
|
|
2026
|
+
const wasConnected = el.isConnected;
|
|
1997
2027
|
let patched = false;
|
|
1998
2028
|
(instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
1999
2029
|
const performHydrate = () => {
|
|
2000
2030
|
if (patched) {
|
|
2001
2031
|
return;
|
|
2002
2032
|
}
|
|
2033
|
+
if (!el.parentNode || wasConnected && !el.isConnected) return;
|
|
2003
2034
|
hydrate();
|
|
2004
2035
|
};
|
|
2005
2036
|
const doHydrate = hydrateStrategy ? () => {
|
|
@@ -2524,14 +2555,15 @@ function createSlots(slots, dynamicSlots) {
|
|
|
2524
2555
|
return slots;
|
|
2525
2556
|
}
|
|
2526
2557
|
|
|
2527
|
-
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
2558
|
+
function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
|
|
2528
2559
|
if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
|
|
2529
|
-
const
|
|
2530
|
-
|
|
2560
|
+
const slotProps = branchKey != null && props.key == null ? shared.extend({}, props, { key: branchKey }) : props;
|
|
2561
|
+
const hasProps = Object.keys(slotProps).length > 0;
|
|
2562
|
+
if (name !== "default") slotProps.name = name;
|
|
2531
2563
|
return openBlock(), createBlock(
|
|
2532
2564
|
Fragment,
|
|
2533
2565
|
null,
|
|
2534
|
-
[createVNode("slot",
|
|
2566
|
+
[createVNode("slot", slotProps, fallback && fallback())],
|
|
2535
2567
|
hasProps ? -2 : 64
|
|
2536
2568
|
);
|
|
2537
2569
|
}
|
|
@@ -2539,26 +2571,34 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
|
2539
2571
|
if (slot && slot._c) {
|
|
2540
2572
|
slot._d = false;
|
|
2541
2573
|
}
|
|
2574
|
+
const prevStackSize = blockStack.length;
|
|
2542
2575
|
openBlock();
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2576
|
+
let rendered;
|
|
2577
|
+
try {
|
|
2578
|
+
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
2579
|
+
const slotKey = props.key || branchKey || // slot content array of a dynamic conditional slot may have a branch
|
|
2580
|
+
// key attached in the `createSlots` helper, respect that
|
|
2581
|
+
validSlotContent && validSlotContent.key;
|
|
2582
|
+
rendered = createBlock(
|
|
2583
|
+
Fragment,
|
|
2584
|
+
{
|
|
2585
|
+
key: (slotKey && !shared.isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
|
|
2586
|
+
(!validSlotContent && fallback ? "_fb" : "")
|
|
2587
|
+
},
|
|
2588
|
+
validSlotContent || (fallback ? fallback() : []),
|
|
2589
|
+
validSlotContent && slots._ === 1 ? 64 : -2
|
|
2590
|
+
);
|
|
2591
|
+
} catch (err) {
|
|
2592
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
2593
|
+
throw err;
|
|
2594
|
+
} finally {
|
|
2595
|
+
if (slot && slot._c) {
|
|
2596
|
+
slot._d = true;
|
|
2597
|
+
}
|
|
2598
|
+
}
|
|
2556
2599
|
if (!noSlotted && rendered.scopeId) {
|
|
2557
2600
|
rendered.slotScopeIds = [rendered.scopeId + "-s"];
|
|
2558
2601
|
}
|
|
2559
|
-
if (slot && slot._c) {
|
|
2560
|
-
slot._d = true;
|
|
2561
|
-
}
|
|
2562
2602
|
return rendered;
|
|
2563
2603
|
}
|
|
2564
2604
|
function ensureValidVNode(vnodes) {
|
|
@@ -3451,7 +3491,8 @@ function isEmitListener(options, key) {
|
|
|
3451
3491
|
if (!options || !shared.isOn(key)) {
|
|
3452
3492
|
return false;
|
|
3453
3493
|
}
|
|
3454
|
-
key = key.slice(2)
|
|
3494
|
+
key = key.slice(2);
|
|
3495
|
+
key = key === "Once" ? key : key.replace(/Once$/, "");
|
|
3455
3496
|
return shared.hasOwn(options, key[0].toLowerCase() + key.slice(1)) || shared.hasOwn(options, shared.hyphenate(key)) || shared.hasOwn(options, key);
|
|
3456
3497
|
}
|
|
3457
3498
|
|
|
@@ -4365,6 +4406,15 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4365
4406
|
invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
4366
4407
|
}
|
|
4367
4408
|
parentComponent && toggleRecurse(parentComponent, true);
|
|
4409
|
+
if (
|
|
4410
|
+
// #6385 the old vnode may be a user-wrapped non-isomorphic block
|
|
4411
|
+
// Force full diff when block metadata is unstable.
|
|
4412
|
+
dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)
|
|
4413
|
+
) {
|
|
4414
|
+
patchFlag = 0;
|
|
4415
|
+
optimized = false;
|
|
4416
|
+
dynamicChildren = null;
|
|
4417
|
+
}
|
|
4368
4418
|
if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) {
|
|
4369
4419
|
hostSetElementText(el, "");
|
|
4370
4420
|
}
|
|
@@ -6325,6 +6375,10 @@ function normalizeChildren(vnode, children) {
|
|
|
6325
6375
|
}
|
|
6326
6376
|
}
|
|
6327
6377
|
} else if (shared.isFunction(children)) {
|
|
6378
|
+
if (shapeFlag & (1 | 64)) {
|
|
6379
|
+
normalizeChildren(vnode, { default: children });
|
|
6380
|
+
return;
|
|
6381
|
+
}
|
|
6328
6382
|
children = { default: children, _ctx: currentRenderingInstance };
|
|
6329
6383
|
type = 32;
|
|
6330
6384
|
} else {
|
|
@@ -6725,7 +6779,7 @@ function isMemoSame(cached, memo) {
|
|
|
6725
6779
|
return true;
|
|
6726
6780
|
}
|
|
6727
6781
|
|
|
6728
|
-
const version = "3.5.
|
|
6782
|
+
const version = "3.5.40";
|
|
6729
6783
|
const warn$1 = shared.NOOP;
|
|
6730
6784
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
6731
6785
|
const devtools = void 0;
|
package/dist/runtime-core.d.ts
CHANGED
|
@@ -296,6 +296,8 @@ type DefineModelOptions<T = any, G = T, S = T> = {
|
|
|
296
296
|
get?: (v: T) => G;
|
|
297
297
|
set?: (v: S) => any;
|
|
298
298
|
};
|
|
299
|
+
type DefineModelRuntimeOptions<T, G, S> = Omit<PropOptions<T>, 'default'> & DefineModelOptions<T, G, S>;
|
|
300
|
+
type DefineModelDefault<T> = InferDefault<Data, T>;
|
|
299
301
|
/**
|
|
300
302
|
* Vue `<script setup>` compiler macro for declaring a
|
|
301
303
|
* two-way binding prop that can be consumed via `v-model` from the parent
|
|
@@ -330,17 +332,17 @@ type DefineModelOptions<T = any, G = T, S = T> = {
|
|
|
330
332
|
* ```
|
|
331
333
|
*/
|
|
332
334
|
export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(options: ({
|
|
333
|
-
default:
|
|
335
|
+
default: DefineModelDefault<T>;
|
|
334
336
|
} | {
|
|
335
337
|
required: true;
|
|
336
|
-
}) &
|
|
337
|
-
export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(options?:
|
|
338
|
+
}) & DefineModelRuntimeOptions<T, G, S>): ModelRef<T, M, G, S>;
|
|
339
|
+
export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(options?: DefineModelRuntimeOptions<T, G, S>): ModelRef<T | undefined, M, G | undefined, S | undefined>;
|
|
338
340
|
export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(name: string, options: ({
|
|
339
|
-
default:
|
|
341
|
+
default: DefineModelDefault<T>;
|
|
340
342
|
} | {
|
|
341
343
|
required: true;
|
|
342
|
-
}) &
|
|
343
|
-
export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(name: string, options?:
|
|
344
|
+
}) & DefineModelRuntimeOptions<T, G, S>): ModelRef<T, M, G, S>;
|
|
345
|
+
export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(name: string, options?: DefineModelRuntimeOptions<T, G, S>): ModelRef<T | undefined, M, G | undefined, S | undefined>;
|
|
344
346
|
type NotUndefined<T> = T extends undefined ? never : T;
|
|
345
347
|
type MappedOmit<T, K extends keyof any> = {
|
|
346
348
|
[P in keyof T as P extends K ? never : P]: T[P];
|
|
@@ -379,12 +381,12 @@ export declare function withDefaults<T, BKeys extends keyof T, Defaults extends
|
|
|
379
381
|
export declare function useSlots(): SetupContext['slots'];
|
|
380
382
|
export declare function useAttrs(): SetupContext['attrs'];
|
|
381
383
|
|
|
382
|
-
export type ObjectEmitsOptions = Record<string, ((...args: any[]) => any) | null>;
|
|
384
|
+
export type ObjectEmitsOptions = Record<string, ((...args: any[]) => any) | null | any[]>;
|
|
383
385
|
export type EmitsOptions = ObjectEmitsOptions | string[];
|
|
384
386
|
export type EmitsToProps<T extends EmitsOptions | ComponentTypeEmits> = T extends string[] ? {
|
|
385
387
|
[K in `on${Capitalize<T[number]>}`]?: (...args: any[]) => any;
|
|
386
388
|
} : T extends ObjectEmitsOptions ? {
|
|
387
|
-
[K in string & keyof T as `on${Capitalize<K>}`]?: (...args: T[K] extends (...args: infer P) => any ? P : T[K] extends null ? any[] : never) => any;
|
|
389
|
+
[K in string & keyof T as `on${Capitalize<K>}`]?: (...args: T[K] extends (...args: infer P) => any ? P : T[K] extends null ? any[] : T[K] extends any[] ? T[K] : never) => any;
|
|
388
390
|
} : {};
|
|
389
391
|
type TypeEmitsToOptions<T extends ComponentTypeEmits> = {
|
|
390
392
|
[K in keyof T & string]: T[K] extends [...args: infer Args] ? (...args: Args) => any : () => any;
|
|
@@ -496,12 +498,12 @@ export type CreateComponentPublicInstance<P = {}, B = {}, D = {}, C extends Comp
|
|
|
496
498
|
* inference everywhere internally, but it has to be a new type to avoid
|
|
497
499
|
* breaking types that relies on previous arguments order (#10842)
|
|
498
500
|
*/
|
|
499
|
-
export type CreateComponentPublicInstanceWithMixins<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, PublicProps = P, Defaults = {}, MakeDefaultsOptional extends boolean = false, I extends ComponentInjectOptions = {}, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, TypeRefs extends Data = {}, TypeEl
|
|
501
|
+
export type CreateComponentPublicInstanceWithMixins<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, PublicProps = P, Defaults = {}, MakeDefaultsOptional extends boolean = false, I extends ComponentInjectOptions = {}, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, TypeRefs extends Data = {}, TypeEl = any, Provide extends ComponentProvideOptions = ComponentProvideOptions, PublicMixin = IntersectionMixin<Mixin> & IntersectionMixin<Extends>, PublicP = UnwrapMixinsType<PublicMixin, 'P'> & EnsureNonVoid<P>, PublicB = UnwrapMixinsType<PublicMixin, 'B'> & EnsureNonVoid<B>, PublicD = UnwrapMixinsType<PublicMixin, 'D'> & EnsureNonVoid<D>, PublicC extends ComputedOptions = UnwrapMixinsType<PublicMixin, 'C'> & EnsureNonVoid<C>, PublicM extends MethodOptions = UnwrapMixinsType<PublicMixin, 'M'> & EnsureNonVoid<M>, PublicDefaults = UnwrapMixinsType<PublicMixin, 'Defaults'> & EnsureNonVoid<Defaults>> = ComponentPublicInstance<PublicP, PublicB, PublicD, PublicC, PublicM, E, PublicProps, PublicDefaults, MakeDefaultsOptional, ComponentOptionsBase<P, B, D, C, M, Mixin, Extends, E, string, Defaults, {}, string, S, LC, Directives, Exposed, Provide>, I, S, Exposed, TypeRefs, TypeEl>;
|
|
500
502
|
type ExposedKeys<T, Exposed extends string & keyof T> = '' extends Exposed ? T : Pick<T, Exposed>;
|
|
501
503
|
export type ComponentPublicInstance<P = {}, // props type extracted from props option
|
|
502
504
|
B = {}, // raw bindings returned from setup()
|
|
503
505
|
D = {}, // return from data()
|
|
504
|
-
C extends ComputedOptions = {}, M extends MethodOptions = {}, E extends EmitsOptions = {}, PublicProps = {}, Defaults = {}, MakeDefaultsOptional extends boolean = false, Options = ComponentOptionsBase<any, any, any, any, any, any, any, any, any>, I extends ComponentInjectOptions = {}, S extends SlotsType = {}, Exposed extends string = '', TypeRefs extends Data = {}, TypeEl
|
|
506
|
+
C extends ComputedOptions = {}, M extends MethodOptions = {}, E extends EmitsOptions = {}, PublicProps = {}, Defaults = {}, MakeDefaultsOptional extends boolean = false, Options = ComponentOptionsBase<any, any, any, any, any, any, any, any, any>, I extends ComponentInjectOptions = {}, S extends SlotsType = {}, Exposed extends string = '', TypeRefs extends Data = {}, TypeEl = any> = {
|
|
505
507
|
$: ComponentInternalInstance;
|
|
506
508
|
$data: D;
|
|
507
509
|
$props: MakeDefaultsOptional extends true ? Partial<Defaults> & Omit<Prettify<P> & PublicProps, keyof Defaults> : Prettify<P> & PublicProps;
|
|
@@ -1002,7 +1004,7 @@ export declare function hasInjectionContext(): boolean;
|
|
|
1002
1004
|
|
|
1003
1005
|
export type PublicProps = VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
1004
1006
|
type ResolveProps<PropsOrPropOptions, E extends EmitsOptions> = Readonly<PropsOrPropOptions extends ComponentPropsOptions ? ExtractPropTypes<PropsOrPropOptions> : PropsOrPropOptions> & ({} extends E ? {} : EmitsToProps<E>);
|
|
1005
|
-
export type DefineComponent<PropsOrPropOptions = {}, RawBindings = {}, D = {}, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, PP = PublicProps, Props = ResolveProps<PropsOrPropOptions, E>, Defaults = ExtractDefaultPropTypes<PropsOrPropOptions>, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, MakeDefaultsOptional extends boolean = true, TypeRefs extends Record<string, unknown> = {}, TypeEl
|
|
1007
|
+
export type DefineComponent<PropsOrPropOptions = {}, RawBindings = {}, D = {}, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, PP = PublicProps, Props = ResolveProps<PropsOrPropOptions, E>, Defaults = ExtractDefaultPropTypes<PropsOrPropOptions>, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, MakeDefaultsOptional extends boolean = true, TypeRefs extends Record<string, unknown> = {}, TypeEl = any> = ComponentPublicInstanceConstructor<CreateComponentPublicInstanceWithMixins<Props, RawBindings, D, C, M, Mixin, Extends, E, PP, Defaults, MakeDefaultsOptional, {}, S, LC & GlobalComponents, Directives & GlobalDirectives, Exposed, TypeRefs, TypeEl>> & ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, {}, string, S, LC & GlobalComponents, Directives & GlobalDirectives, Exposed, Provide> & PP;
|
|
1006
1008
|
export type DefineSetupFnComponent<P extends Record<string, any>, E extends EmitsOptions = {}, S extends SlotsType = SlotsType, Props = P & EmitsToProps<E>, PP = PublicProps> = new (props: Props & PP) => CreateComponentPublicInstanceWithMixins<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, E, PP, {}, false, {}, S>;
|
|
1007
1009
|
type ToResolvedProps<Props, Emits extends EmitsOptions> = Readonly<Props> & Readonly<EmitsToProps<Emits>>;
|
|
1008
1010
|
export declare function defineComponent<Props extends Record<string, any>, E extends EmitsOptions = {}, EE extends string = string, S extends SlotsType = {}>(setup: (props: Props, ctx: SetupContext<E, S>) => RenderFunction | Promise<RenderFunction>, options?: Pick<ComponentOptions, 'name' | 'inheritAttrs'> & {
|
|
@@ -1017,7 +1019,7 @@ export declare function defineComponent<Props extends Record<string, any>, E ext
|
|
|
1017
1019
|
}): DefineSetupFnComponent<Props, E, S>;
|
|
1018
1020
|
export declare function defineComponent<TypeProps, RuntimePropsOptions extends ComponentObjectPropsOptions = ComponentObjectPropsOptions, RuntimePropsKeys extends string = string, TypeEmits extends ComponentTypeEmits = {}, RuntimeEmitsOptions extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Data = {}, SetupBindings = {}, Computed extends ComputedOptions = {}, Methods extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, InjectOptions extends ComponentInjectOptions = {}, InjectKeys extends string = string, Slots extends SlotsType = {}, LocalComponents extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, ResolvedEmits extends EmitsOptions = {} extends RuntimeEmitsOptions ? TypeEmitsToOptions<TypeEmits> : RuntimeEmitsOptions, InferredProps = IsKeyValues<TypeProps> extends true ? TypeProps : string extends RuntimePropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : {
|
|
1019
1021
|
[key in RuntimePropsKeys]?: any;
|
|
1020
|
-
}, TypeRefs extends Record<string, unknown> = {}, TypeEl
|
|
1022
|
+
}, TypeRefs extends Record<string, unknown> = {}, TypeEl = any>(options: {
|
|
1021
1023
|
props?: (RuntimePropsOptions & ThisType<void>) | RuntimePropsKeys[];
|
|
1022
1024
|
/**
|
|
1023
1025
|
* @private for language-tools use only
|
|
@@ -1715,7 +1717,7 @@ export declare function toHandlers(obj: Record<string, any>, preserveCaseIfNeces
|
|
|
1715
1717
|
* Compiler runtime helper for rendering `<slot/>`
|
|
1716
1718
|
* @private
|
|
1717
1719
|
*/
|
|
1718
|
-
export declare function renderSlot(slots: Slots, name: string, props?: Data, fallback?: () => VNodeArrayChildren, noSlotted?: boolean): VNode;
|
|
1720
|
+
export declare function renderSlot(slots: Slots, name: string, props?: Data, fallback?: () => VNodeArrayChildren, noSlotted?: boolean, branchKey?: PropertyKey): VNode;
|
|
1719
1721
|
|
|
1720
1722
|
type SSRSlot = (...args: any[]) => VNode[] | undefined;
|
|
1721
1723
|
interface CompiledSlotDescriptor {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.5.
|
|
2
|
+
* @vue/runtime-core v3.5.40
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -697,10 +697,12 @@ function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
|
|
|
697
697
|
setBlockTracking(-1);
|
|
698
698
|
}
|
|
699
699
|
const prevInstance = setCurrentRenderingInstance(ctx);
|
|
700
|
+
const prevStackSize = blockStack.length;
|
|
700
701
|
let res;
|
|
701
702
|
try {
|
|
702
703
|
res = fn(...args);
|
|
703
704
|
} finally {
|
|
705
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
704
706
|
setCurrentRenderingInstance(prevInstance);
|
|
705
707
|
if (renderFnWithContext._d) {
|
|
706
708
|
setBlockTracking(1);
|
|
@@ -1119,11 +1121,9 @@ const TeleportImpl = {
|
|
|
1119
1121
|
}
|
|
1120
1122
|
} else {
|
|
1121
1123
|
if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
|
|
1122
|
-
const nextTarget = n2.
|
|
1123
|
-
n2.props,
|
|
1124
|
-
querySelector
|
|
1125
|
-
);
|
|
1124
|
+
const nextTarget = resolveTarget(n2.props, querySelector);
|
|
1126
1125
|
if (nextTarget) {
|
|
1126
|
+
n2.target = nextTarget;
|
|
1127
1127
|
moveTeleport(
|
|
1128
1128
|
n2,
|
|
1129
1129
|
nextTarget,
|
|
@@ -1161,7 +1161,8 @@ const TeleportImpl = {
|
|
|
1161
1161
|
target,
|
|
1162
1162
|
props
|
|
1163
1163
|
} = vnode;
|
|
1164
|
-
const
|
|
1164
|
+
const disabled = isTeleportDisabled(props);
|
|
1165
|
+
const shouldRemove = doRemove || !disabled;
|
|
1165
1166
|
const pendingMount = pendingMounts.get(vnode);
|
|
1166
1167
|
if (pendingMount) {
|
|
1167
1168
|
pendingMount.flags |= 8;
|
|
@@ -1172,7 +1173,7 @@ const TeleportImpl = {
|
|
|
1172
1173
|
hostRemove(targetAnchor);
|
|
1173
1174
|
}
|
|
1174
1175
|
doRemove && hostRemove(anchor);
|
|
1175
|
-
if (!pendingMount && shapeFlag & 16) {
|
|
1176
|
+
if (!pendingMount && (disabled || target) && shapeFlag & 16) {
|
|
1176
1177
|
for (let i = 0; i < children.length; i++) {
|
|
1177
1178
|
const child = children[i];
|
|
1178
1179
|
unmount(
|
|
@@ -2108,9 +2109,18 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
2108
2109
|
};
|
|
2109
2110
|
const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
2110
2111
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
2111
|
-
const {
|
|
2112
|
+
const {
|
|
2113
|
+
type,
|
|
2114
|
+
dynamicProps,
|
|
2115
|
+
props,
|
|
2116
|
+
patchFlag,
|
|
2117
|
+
shapeFlag,
|
|
2118
|
+
dirs,
|
|
2119
|
+
transition
|
|
2120
|
+
} = vnode;
|
|
2112
2121
|
const forcePatch = type === "input" || type === "option";
|
|
2113
|
-
|
|
2122
|
+
const hasDynamicProps = !!dynamicProps;
|
|
2123
|
+
if (!!(process.env.NODE_ENV !== "production") || forcePatch || hasDynamicProps || patchFlag !== -1) {
|
|
2114
2124
|
if (dirs) {
|
|
2115
2125
|
invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
2116
2126
|
}
|
|
@@ -2177,8 +2187,9 @@ Server rendered element contains more child nodes than client vdom.`
|
|
|
2177
2187
|
}
|
|
2178
2188
|
}
|
|
2179
2189
|
if (props) {
|
|
2180
|
-
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ || forcePatch || !optimized || patchFlag & (16 | 32)) {
|
|
2190
|
+
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ || forcePatch || hasDynamicProps || !optimized || patchFlag & (16 | 32)) {
|
|
2181
2191
|
const isCustomElement = el.tagName.includes("-");
|
|
2192
|
+
const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
|
|
2182
2193
|
for (const key in props) {
|
|
2183
2194
|
if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && // #11189 skip if this node has directives that have created hooks
|
|
2184
2195
|
// as it could have mutated the DOM in any possible way
|
|
@@ -2186,8 +2197,8 @@ Server rendered element contains more child nodes than client vdom.`
|
|
|
2186
2197
|
logMismatchError();
|
|
2187
2198
|
}
|
|
2188
2199
|
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
|
|
2189
|
-
key[0] === "." || isCustomElement && !isReservedProp(key)) {
|
|
2190
|
-
patchProp(el, key, null, props[key],
|
|
2200
|
+
key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
|
|
2201
|
+
patchProp(el, key, null, props[key], namespace, parentComponent);
|
|
2191
2202
|
}
|
|
2192
2203
|
}
|
|
2193
2204
|
} else if (props.onClick) {
|
|
@@ -2302,7 +2313,7 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
2302
2313
|
}
|
|
2303
2314
|
};
|
|
2304
2315
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
2305
|
-
if (!
|
|
2316
|
+
if (!isNodeMismatchAllowed(node, vnode)) {
|
|
2306
2317
|
(!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(
|
|
2307
2318
|
`Hydration node mismatch:
|
|
2308
2319
|
- rendered on server:`,
|
|
@@ -2517,7 +2528,12 @@ function isMismatchAllowed(el, allowedType) {
|
|
|
2517
2528
|
el = el.parentElement;
|
|
2518
2529
|
}
|
|
2519
2530
|
}
|
|
2520
|
-
|
|
2531
|
+
return isMismatchAllowedByAttr(
|
|
2532
|
+
el && el.getAttribute(allowMismatchAttr),
|
|
2533
|
+
allowedType
|
|
2534
|
+
);
|
|
2535
|
+
}
|
|
2536
|
+
function isMismatchAllowedByAttr(allowedAttr, allowedType) {
|
|
2521
2537
|
if (allowedAttr == null) {
|
|
2522
2538
|
return false;
|
|
2523
2539
|
} else if (allowedAttr === "") {
|
|
@@ -2530,6 +2546,19 @@ function isMismatchAllowed(el, allowedType) {
|
|
|
2530
2546
|
return list.includes(MismatchTypeString[allowedType]);
|
|
2531
2547
|
}
|
|
2532
2548
|
}
|
|
2549
|
+
function isNodeMismatchAllowed(node, vnode) {
|
|
2550
|
+
return isMismatchAllowed(node.parentElement, 1 /* CHILDREN */) || isMismatchAllowedByNode(node) || isMismatchAllowedByVNode(vnode);
|
|
2551
|
+
}
|
|
2552
|
+
function isMismatchAllowedByNode(node) {
|
|
2553
|
+
return node.nodeType === 1 && isMismatchAllowedByAttr(
|
|
2554
|
+
node.getAttribute(allowMismatchAttr),
|
|
2555
|
+
1 /* CHILDREN */
|
|
2556
|
+
);
|
|
2557
|
+
}
|
|
2558
|
+
function isMismatchAllowedByVNode({ props }) {
|
|
2559
|
+
const allowedAttr = props && props[allowMismatchAttr];
|
|
2560
|
+
return typeof allowedAttr === "string" && isMismatchAllowedByAttr(allowedAttr, 1 /* CHILDREN */);
|
|
2561
|
+
}
|
|
2533
2562
|
|
|
2534
2563
|
const requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
|
|
2535
2564
|
const cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
|
|
@@ -2683,6 +2712,7 @@ function defineAsyncComponent(source) {
|
|
|
2683
2712
|
name: "AsyncComponentWrapper",
|
|
2684
2713
|
__asyncLoader: load,
|
|
2685
2714
|
__asyncHydrate(el, instance, hydrate) {
|
|
2715
|
+
const wasConnected = el.isConnected;
|
|
2686
2716
|
let patched = false;
|
|
2687
2717
|
(instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
2688
2718
|
const performHydrate = () => {
|
|
@@ -2694,6 +2724,7 @@ function defineAsyncComponent(source) {
|
|
|
2694
2724
|
}
|
|
2695
2725
|
return;
|
|
2696
2726
|
}
|
|
2727
|
+
if (!el.parentNode || wasConnected && !el.isConnected) return;
|
|
2697
2728
|
hydrate();
|
|
2698
2729
|
};
|
|
2699
2730
|
const doHydrate = hydrateStrategy ? () => {
|
|
@@ -3252,14 +3283,15 @@ function createSlots(slots, dynamicSlots) {
|
|
|
3252
3283
|
return slots;
|
|
3253
3284
|
}
|
|
3254
3285
|
|
|
3255
|
-
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
3286
|
+
function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
|
|
3256
3287
|
if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
|
|
3257
|
-
const
|
|
3258
|
-
|
|
3288
|
+
const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
|
|
3289
|
+
const hasProps = Object.keys(slotProps).length > 0;
|
|
3290
|
+
if (name !== "default") slotProps.name = name;
|
|
3259
3291
|
return openBlock(), createBlock(
|
|
3260
3292
|
Fragment,
|
|
3261
3293
|
null,
|
|
3262
|
-
[createVNode("slot",
|
|
3294
|
+
[createVNode("slot", slotProps, fallback && fallback())],
|
|
3263
3295
|
hasProps ? -2 : 64
|
|
3264
3296
|
);
|
|
3265
3297
|
}
|
|
@@ -3273,26 +3305,34 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
|
3273
3305
|
if (slot && slot._c) {
|
|
3274
3306
|
slot._d = false;
|
|
3275
3307
|
}
|
|
3308
|
+
const prevStackSize = blockStack.length;
|
|
3276
3309
|
openBlock();
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3310
|
+
let rendered;
|
|
3311
|
+
try {
|
|
3312
|
+
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
3313
|
+
const slotKey = props.key || branchKey || // slot content array of a dynamic conditional slot may have a branch
|
|
3314
|
+
// key attached in the `createSlots` helper, respect that
|
|
3315
|
+
validSlotContent && validSlotContent.key;
|
|
3316
|
+
rendered = createBlock(
|
|
3317
|
+
Fragment,
|
|
3318
|
+
{
|
|
3319
|
+
key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
|
|
3320
|
+
(!validSlotContent && fallback ? "_fb" : "")
|
|
3321
|
+
},
|
|
3322
|
+
validSlotContent || (fallback ? fallback() : []),
|
|
3323
|
+
validSlotContent && slots._ === 1 ? 64 : -2
|
|
3324
|
+
);
|
|
3325
|
+
} catch (err) {
|
|
3326
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
3327
|
+
throw err;
|
|
3328
|
+
} finally {
|
|
3329
|
+
if (slot && slot._c) {
|
|
3330
|
+
slot._d = true;
|
|
3331
|
+
}
|
|
3332
|
+
}
|
|
3290
3333
|
if (!noSlotted && rendered.scopeId) {
|
|
3291
3334
|
rendered.slotScopeIds = [rendered.scopeId + "-s"];
|
|
3292
3335
|
}
|
|
3293
|
-
if (slot && slot._c) {
|
|
3294
|
-
slot._d = true;
|
|
3295
|
-
}
|
|
3296
3336
|
return rendered;
|
|
3297
3337
|
}
|
|
3298
3338
|
function ensureValidVNode(vnodes) {
|
|
@@ -4531,7 +4571,8 @@ function isEmitListener(options, key) {
|
|
|
4531
4571
|
if (!options || !isOn(key)) {
|
|
4532
4572
|
return false;
|
|
4533
4573
|
}
|
|
4534
|
-
key = key.slice(2)
|
|
4574
|
+
key = key.slice(2);
|
|
4575
|
+
key = key === "Once" ? key : key.replace(/Once$/, "");
|
|
4535
4576
|
return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
|
|
4536
4577
|
}
|
|
4537
4578
|
|
|
@@ -5782,7 +5823,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5782
5823
|
invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
5783
5824
|
}
|
|
5784
5825
|
parentComponent && toggleRecurse(parentComponent, true);
|
|
5785
|
-
if (
|
|
5826
|
+
if (
|
|
5827
|
+
// HMR updated, force full diff
|
|
5828
|
+
!!(process.env.NODE_ENV !== "production") && isHmrUpdating || // #6385 the old vnode may be a user-wrapped non-isomorphic block
|
|
5829
|
+
// Force full diff when block metadata is unstable.
|
|
5830
|
+
dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)
|
|
5831
|
+
) {
|
|
5786
5832
|
patchFlag = 0;
|
|
5787
5833
|
optimized = false;
|
|
5788
5834
|
dynamicChildren = null;
|
|
@@ -7926,6 +7972,10 @@ function normalizeChildren(vnode, children) {
|
|
|
7926
7972
|
}
|
|
7927
7973
|
}
|
|
7928
7974
|
} else if (isFunction(children)) {
|
|
7975
|
+
if (shapeFlag & (1 | 64)) {
|
|
7976
|
+
normalizeChildren(vnode, { default: children });
|
|
7977
|
+
return;
|
|
7978
|
+
}
|
|
7929
7979
|
children = { default: children, _ctx: currentRenderingInstance };
|
|
7930
7980
|
type = 32;
|
|
7931
7981
|
} else {
|
|
@@ -8658,7 +8708,7 @@ function isMemoSame(cached, memo) {
|
|
|
8658
8708
|
return true;
|
|
8659
8709
|
}
|
|
8660
8710
|
|
|
8661
|
-
const version = "3.5.
|
|
8711
|
+
const version = "3.5.40";
|
|
8662
8712
|
const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
|
|
8663
8713
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
8664
8714
|
const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/runtime-core",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.40",
|
|
4
4
|
"description": "@vue/runtime-core",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/runtime-core.esm-bundler.js",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@vue/shared": "3.5.
|
|
50
|
-
"@vue/reactivity": "3.5.
|
|
49
|
+
"@vue/shared": "3.5.40",
|
|
50
|
+
"@vue/reactivity": "3.5.40"
|
|
51
51
|
}
|
|
52
52
|
}
|