@vue/runtime-core 3.6.0-alpha.2 → 3.6.0-alpha.4
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 +670 -413
- package/dist/runtime-core.cjs.prod.js +566 -341
- package/dist/runtime-core.d.ts +61 -25
- package/dist/runtime-core.esm-bundler.js +688 -420
- package/package.json +3 -3
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.6.0-alpha.
|
|
2
|
+
* @vue/runtime-core v3.6.0-alpha.4
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
6
6
|
import { setActiveSub, isRef, toRaw, traverse, shallowRef, readonly, isReactive, ref, isShallow, isReadonly, shallowReadArray, toReadonly, toReactive, shallowReadonly, track, reactive, shallowReactive, trigger, ReactiveEffect, setCurrentScope, WatcherEffect, customRef, isProxy, proxyRefs, markRaw, EffectScope, computed as computed$1 } from '@vue/reactivity';
|
|
7
7
|
export { EffectScope, ReactiveEffect, TrackOpTypes, TriggerOpTypes, customRef, effect, effectScope, getCurrentScope, getCurrentWatcher, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, onWatcherCleanup, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity';
|
|
8
|
-
import { isString, isFunction, EMPTY_OBJ, isPromise, isArray, getGlobalThis, extend, isBuiltInDirective, hasOwn, remove,
|
|
8
|
+
import { isString, isFunction, EMPTY_OBJ, isPromise, isArray, getGlobalThis, extend, isBuiltInDirective, NO, hasOwn, remove, isKnownSvgAttr, isBooleanAttr, isKnownHtmlAttr, includeBooleanAttr, isRenderableAttrValue, def, isOn, isReservedProp, normalizeClass, stringifyStyle, normalizeStyle, normalizeCssVarValue, getEscapedCssVarName, isObject, isRegExp, invokeArrayFns, toHandlerKey, camelize, capitalize, isSymbol, NOOP, isGloballyAllowed, hyphenate, EMPTY_ARR, makeMap, toRawType, getSequence, hasChanged, getModifierPropName, looseToNumber, isModelListener, toNumber, isBuiltInTag } from '@vue/shared';
|
|
9
9
|
export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
|
|
10
10
|
|
|
11
11
|
const stack = [];
|
|
@@ -534,8 +534,10 @@ function rerender(id, newRender) {
|
|
|
534
534
|
instance.hmrRerender();
|
|
535
535
|
} else {
|
|
536
536
|
const i = instance;
|
|
537
|
-
i.
|
|
538
|
-
|
|
537
|
+
if (!(i.effect.flags & 1024)) {
|
|
538
|
+
i.renderCache = [];
|
|
539
|
+
i.effect.run();
|
|
540
|
+
}
|
|
539
541
|
}
|
|
540
542
|
nextTick(() => {
|
|
541
543
|
isHmrUpdating = false;
|
|
@@ -548,7 +550,12 @@ function reload(id, newComp) {
|
|
|
548
550
|
newComp = normalizeClassComponent(newComp);
|
|
549
551
|
updateComponentDef(record.initialDef, newComp);
|
|
550
552
|
const instances = [...record.instances];
|
|
551
|
-
if (newComp.__vapor) {
|
|
553
|
+
if (newComp.__vapor && !instances.some((i) => i.ceReload)) {
|
|
554
|
+
for (const instance of instances) {
|
|
555
|
+
if (instance.root && instance.root.ce && instance !== instance.root) {
|
|
556
|
+
instance.root.ce._removeChildStyle(instance.type);
|
|
557
|
+
}
|
|
558
|
+
}
|
|
552
559
|
for (const instance of instances) {
|
|
553
560
|
instance.hmrReload(newComp);
|
|
554
561
|
}
|
|
@@ -577,7 +584,10 @@ function reload(id, newComp) {
|
|
|
577
584
|
if (parent.vapor) {
|
|
578
585
|
parent.hmrRerender();
|
|
579
586
|
} else {
|
|
580
|
-
parent.effect.
|
|
587
|
+
if (!(parent.effect.flags & 1024)) {
|
|
588
|
+
parent.renderCache = [];
|
|
589
|
+
parent.effect.run();
|
|
590
|
+
}
|
|
581
591
|
}
|
|
582
592
|
nextTick(() => {
|
|
583
593
|
isHmrUpdating = false;
|
|
@@ -687,7 +697,6 @@ const devtoolsComponentRemoved = (component) => {
|
|
|
687
697
|
_devtoolsComponentRemoved(component);
|
|
688
698
|
}
|
|
689
699
|
};
|
|
690
|
-
/*! #__NO_SIDE_EFFECTS__ */
|
|
691
700
|
// @__NO_SIDE_EFFECTS__
|
|
692
701
|
function createDevtoolsComponentHook(hook) {
|
|
693
702
|
return (component) => {
|
|
@@ -873,9 +882,6 @@ const TeleportImpl = {
|
|
|
873
882
|
insert(mainAnchor, container, anchor);
|
|
874
883
|
const mount = (container2, anchor2) => {
|
|
875
884
|
if (shapeFlag & 16) {
|
|
876
|
-
if (parentComponent && parentComponent.isCE) {
|
|
877
|
-
parentComponent.ce._teleportTarget = container2;
|
|
878
|
-
}
|
|
879
885
|
mountChildren(
|
|
880
886
|
children,
|
|
881
887
|
container2,
|
|
@@ -897,6 +903,9 @@ const TeleportImpl = {
|
|
|
897
903
|
} else if (namespace !== "mathml" && isTargetMathML(target)) {
|
|
898
904
|
namespace = "mathml";
|
|
899
905
|
}
|
|
906
|
+
if (parentComponent && parentComponent.isCE) {
|
|
907
|
+
(parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
|
|
908
|
+
}
|
|
900
909
|
if (!disabled) {
|
|
901
910
|
mount(target, targetAnchor);
|
|
902
911
|
updateCssVars(n2, false);
|
|
@@ -1097,26 +1106,34 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
|
|
|
1097
1106
|
function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
|
|
1098
1107
|
o: { nextSibling, parentNode, querySelector, insert, createText }
|
|
1099
1108
|
}, hydrateChildren) {
|
|
1109
|
+
function hydrateDisabledTeleport(node2, vnode2, targetStart, targetAnchor) {
|
|
1110
|
+
vnode2.anchor = hydrateChildren(
|
|
1111
|
+
nextSibling(node2),
|
|
1112
|
+
vnode2,
|
|
1113
|
+
parentNode(node2),
|
|
1114
|
+
parentComponent,
|
|
1115
|
+
parentSuspense,
|
|
1116
|
+
slotScopeIds,
|
|
1117
|
+
optimized
|
|
1118
|
+
);
|
|
1119
|
+
vnode2.targetStart = targetStart;
|
|
1120
|
+
vnode2.targetAnchor = targetAnchor;
|
|
1121
|
+
}
|
|
1100
1122
|
const target = vnode.target = resolveTarget(
|
|
1101
1123
|
vnode.props,
|
|
1102
1124
|
querySelector
|
|
1103
1125
|
);
|
|
1126
|
+
const disabled = isTeleportDisabled(vnode.props);
|
|
1104
1127
|
if (target) {
|
|
1105
|
-
const disabled = isTeleportDisabled(vnode.props);
|
|
1106
1128
|
const targetNode = target._lpa || target.firstChild;
|
|
1107
1129
|
if (vnode.shapeFlag & 16) {
|
|
1108
1130
|
if (disabled) {
|
|
1109
|
-
|
|
1110
|
-
|
|
1131
|
+
hydrateDisabledTeleport(
|
|
1132
|
+
node,
|
|
1111
1133
|
vnode,
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
parentSuspense,
|
|
1115
|
-
slotScopeIds,
|
|
1116
|
-
optimized
|
|
1134
|
+
targetNode,
|
|
1135
|
+
targetNode && nextSibling(targetNode)
|
|
1117
1136
|
);
|
|
1118
|
-
vnode.targetStart = targetNode;
|
|
1119
|
-
vnode.targetAnchor = targetNode && nextSibling(targetNode);
|
|
1120
1137
|
} else {
|
|
1121
1138
|
vnode.anchor = nextSibling(node);
|
|
1122
1139
|
let targetAnchor = targetNode;
|
|
@@ -1147,6 +1164,10 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
1147
1164
|
}
|
|
1148
1165
|
}
|
|
1149
1166
|
updateCssVars(vnode, disabled);
|
|
1167
|
+
} else if (disabled) {
|
|
1168
|
+
if (vnode.shapeFlag & 16) {
|
|
1169
|
+
hydrateDisabledTeleport(node, vnode, node, nextSibling(node));
|
|
1170
|
+
}
|
|
1150
1171
|
}
|
|
1151
1172
|
return vnode.anchor && nextSibling(vnode.anchor);
|
|
1152
1173
|
}
|
|
@@ -1187,7 +1208,7 @@ function useTransitionState() {
|
|
|
1187
1208
|
isMounted: false,
|
|
1188
1209
|
isLeaving: false,
|
|
1189
1210
|
isUnmounting: false,
|
|
1190
|
-
|
|
1211
|
+
leavingNodes: /* @__PURE__ */ new Map()
|
|
1191
1212
|
};
|
|
1192
1213
|
onMounted(() => {
|
|
1193
1214
|
state.isMounted = true;
|
|
@@ -1219,7 +1240,7 @@ const BaseTransitionPropsValidators = {
|
|
|
1219
1240
|
onAppearCancelled: TransitionHookValidator
|
|
1220
1241
|
};
|
|
1221
1242
|
const recursiveGetSubtree = (instance) => {
|
|
1222
|
-
const subTree = instance.subTree;
|
|
1243
|
+
const subTree = instance.type.__vapor ? instance.block : instance.subTree;
|
|
1223
1244
|
return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
|
|
1224
1245
|
};
|
|
1225
1246
|
const BaseTransitionImpl = {
|
|
@@ -1236,9 +1257,7 @@ const BaseTransitionImpl = {
|
|
|
1236
1257
|
const child = findNonCommentChild(children);
|
|
1237
1258
|
const rawProps = toRaw(props);
|
|
1238
1259
|
const { mode } = rawProps;
|
|
1239
|
-
|
|
1240
|
-
warn$1(`invalid <transition> mode: ${mode}`);
|
|
1241
|
-
}
|
|
1260
|
+
checkTransitionMode(mode);
|
|
1242
1261
|
if (state.isLeaving) {
|
|
1243
1262
|
return emptyPlaceholder(child);
|
|
1244
1263
|
}
|
|
@@ -1258,7 +1277,7 @@ const BaseTransitionImpl = {
|
|
|
1258
1277
|
setTransitionHooks(innerChild, enterHooks);
|
|
1259
1278
|
}
|
|
1260
1279
|
let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
|
|
1261
|
-
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(
|
|
1280
|
+
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
|
|
1262
1281
|
let leavingHooks = resolveTransitionHooks(
|
|
1263
1282
|
oldInnerChild,
|
|
1264
1283
|
rawProps,
|
|
@@ -1328,15 +1347,53 @@ function findNonCommentChild(children) {
|
|
|
1328
1347
|
}
|
|
1329
1348
|
const BaseTransition = BaseTransitionImpl;
|
|
1330
1349
|
function getLeavingNodesForType(state, vnode) {
|
|
1331
|
-
const {
|
|
1332
|
-
let leavingVNodesCache =
|
|
1350
|
+
const { leavingNodes } = state;
|
|
1351
|
+
let leavingVNodesCache = leavingNodes.get(vnode.type);
|
|
1333
1352
|
if (!leavingVNodesCache) {
|
|
1334
1353
|
leavingVNodesCache = /* @__PURE__ */ Object.create(null);
|
|
1335
|
-
|
|
1354
|
+
leavingNodes.set(vnode.type, leavingVNodesCache);
|
|
1336
1355
|
}
|
|
1337
1356
|
return leavingVNodesCache;
|
|
1338
1357
|
}
|
|
1339
1358
|
function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
1359
|
+
const key = String(vnode.key);
|
|
1360
|
+
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
1361
|
+
const context = {
|
|
1362
|
+
setLeavingNodeCache: () => {
|
|
1363
|
+
leavingVNodesCache[key] = vnode;
|
|
1364
|
+
},
|
|
1365
|
+
unsetLeavingNodeCache: () => {
|
|
1366
|
+
if (leavingVNodesCache[key] === vnode) {
|
|
1367
|
+
delete leavingVNodesCache[key];
|
|
1368
|
+
}
|
|
1369
|
+
},
|
|
1370
|
+
earlyRemove: () => {
|
|
1371
|
+
const leavingVNode = leavingVNodesCache[key];
|
|
1372
|
+
if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
|
|
1373
|
+
leavingVNode.el[leaveCbKey]();
|
|
1374
|
+
}
|
|
1375
|
+
},
|
|
1376
|
+
cloneHooks: (vnode2) => {
|
|
1377
|
+
const hooks = resolveTransitionHooks(
|
|
1378
|
+
vnode2,
|
|
1379
|
+
props,
|
|
1380
|
+
state,
|
|
1381
|
+
instance,
|
|
1382
|
+
postClone
|
|
1383
|
+
);
|
|
1384
|
+
if (postClone) postClone(hooks);
|
|
1385
|
+
return hooks;
|
|
1386
|
+
}
|
|
1387
|
+
};
|
|
1388
|
+
return baseResolveTransitionHooks(context, props, state, instance);
|
|
1389
|
+
}
|
|
1390
|
+
function baseResolveTransitionHooks(context, props, state, instance) {
|
|
1391
|
+
const {
|
|
1392
|
+
setLeavingNodeCache,
|
|
1393
|
+
unsetLeavingNodeCache,
|
|
1394
|
+
earlyRemove,
|
|
1395
|
+
cloneHooks
|
|
1396
|
+
} = context;
|
|
1340
1397
|
const {
|
|
1341
1398
|
appear,
|
|
1342
1399
|
mode,
|
|
@@ -1354,8 +1411,6 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
1354
1411
|
onAfterAppear,
|
|
1355
1412
|
onAppearCancelled
|
|
1356
1413
|
} = props;
|
|
1357
|
-
const key = String(vnode.key);
|
|
1358
|
-
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
1359
1414
|
const callHook = (hook, args) => {
|
|
1360
1415
|
hook && callWithAsyncErrorHandling(
|
|
1361
1416
|
hook,
|
|
@@ -1391,10 +1446,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
1391
1446
|
/* cancelled */
|
|
1392
1447
|
);
|
|
1393
1448
|
}
|
|
1394
|
-
|
|
1395
|
-
if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
|
|
1396
|
-
leavingVNode.el[leaveCbKey]();
|
|
1397
|
-
}
|
|
1449
|
+
earlyRemove();
|
|
1398
1450
|
callHook(hook, [el]);
|
|
1399
1451
|
},
|
|
1400
1452
|
enter(el) {
|
|
@@ -1431,7 +1483,6 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
1431
1483
|
}
|
|
1432
1484
|
},
|
|
1433
1485
|
leave(el, remove) {
|
|
1434
|
-
const key2 = String(vnode.key);
|
|
1435
1486
|
if (el[enterCbKey]) {
|
|
1436
1487
|
el[enterCbKey](
|
|
1437
1488
|
true
|
|
@@ -1453,27 +1504,17 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
1453
1504
|
callHook(onAfterLeave, [el]);
|
|
1454
1505
|
}
|
|
1455
1506
|
el[leaveCbKey] = void 0;
|
|
1456
|
-
|
|
1457
|
-
delete leavingVNodesCache[key2];
|
|
1458
|
-
}
|
|
1507
|
+
unsetLeavingNodeCache(el);
|
|
1459
1508
|
};
|
|
1460
|
-
|
|
1509
|
+
setLeavingNodeCache(el);
|
|
1461
1510
|
if (onLeave) {
|
|
1462
1511
|
callAsyncHook(onLeave, [el, done]);
|
|
1463
1512
|
} else {
|
|
1464
1513
|
done();
|
|
1465
1514
|
}
|
|
1466
1515
|
},
|
|
1467
|
-
clone(
|
|
1468
|
-
|
|
1469
|
-
vnode2,
|
|
1470
|
-
props,
|
|
1471
|
-
state,
|
|
1472
|
-
instance,
|
|
1473
|
-
postClone
|
|
1474
|
-
);
|
|
1475
|
-
if (postClone) postClone(hooks2);
|
|
1476
|
-
return hooks2;
|
|
1516
|
+
clone(node) {
|
|
1517
|
+
return cloneHooks(node);
|
|
1477
1518
|
}
|
|
1478
1519
|
};
|
|
1479
1520
|
return hooks;
|
|
@@ -1507,8 +1548,15 @@ function getInnerChild$1(vnode) {
|
|
|
1507
1548
|
}
|
|
1508
1549
|
function setTransitionHooks(vnode, hooks) {
|
|
1509
1550
|
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
1510
|
-
vnode.
|
|
1511
|
-
|
|
1551
|
+
if (vnode.type.__vapor) {
|
|
1552
|
+
getVaporInterface(vnode.component, vnode).setTransitionHooks(
|
|
1553
|
+
vnode.component,
|
|
1554
|
+
hooks
|
|
1555
|
+
);
|
|
1556
|
+
} else {
|
|
1557
|
+
vnode.transition = hooks;
|
|
1558
|
+
setTransitionHooks(vnode.component.subTree, hooks);
|
|
1559
|
+
}
|
|
1512
1560
|
} else if (vnode.shapeFlag & 128) {
|
|
1513
1561
|
vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
1514
1562
|
vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
@@ -1538,8 +1586,12 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
|
1538
1586
|
}
|
|
1539
1587
|
return ret;
|
|
1540
1588
|
}
|
|
1589
|
+
function checkTransitionMode(mode) {
|
|
1590
|
+
if (!!(process.env.NODE_ENV !== "production") && mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
|
|
1591
|
+
warn$1(`invalid <transition> mode: ${mode}`);
|
|
1592
|
+
}
|
|
1593
|
+
}
|
|
1541
1594
|
|
|
1542
|
-
/*! #__NO_SIDE_EFFECTS__ */
|
|
1543
1595
|
// @__NO_SIDE_EFFECTS__
|
|
1544
1596
|
function defineComponent(options, extraOptions) {
|
|
1545
1597
|
return isFunction(options) ? (
|
|
@@ -1592,6 +1644,7 @@ function useTemplateRef(key) {
|
|
|
1592
1644
|
return ret;
|
|
1593
1645
|
}
|
|
1594
1646
|
|
|
1647
|
+
const pendingSetRefMap = /* @__PURE__ */ new WeakMap();
|
|
1595
1648
|
function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
1596
1649
|
if (isArray(rawRef)) {
|
|
1597
1650
|
rawRef.forEach(
|
|
@@ -1623,28 +1676,23 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
1623
1676
|
const oldRef = oldRawRef && oldRawRef.r;
|
|
1624
1677
|
const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
|
|
1625
1678
|
const setupState = owner.setupState;
|
|
1626
|
-
const
|
|
1627
|
-
const
|
|
1628
|
-
|
|
1629
|
-
if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
|
|
1630
|
-
warn$1(
|
|
1631
|
-
`Template ref "${key}" used on a non-ref value. It will not work in the production build.`
|
|
1632
|
-
);
|
|
1633
|
-
}
|
|
1634
|
-
if (knownTemplateRefs.has(rawSetupState[key])) {
|
|
1635
|
-
return false;
|
|
1636
|
-
}
|
|
1637
|
-
}
|
|
1638
|
-
return hasOwn(rawSetupState, key);
|
|
1679
|
+
const canSetSetupRef = createCanSetSetupRefChecker(setupState);
|
|
1680
|
+
const canSetRef = (ref2) => {
|
|
1681
|
+
return !!!(process.env.NODE_ENV !== "production") || !knownTemplateRefs.has(ref2);
|
|
1639
1682
|
};
|
|
1640
1683
|
if (oldRef != null && oldRef !== ref) {
|
|
1684
|
+
invalidatePendingSetRef(oldRawRef);
|
|
1641
1685
|
if (isString(oldRef)) {
|
|
1642
1686
|
refs[oldRef] = null;
|
|
1643
1687
|
if (canSetSetupRef(oldRef)) {
|
|
1644
1688
|
setupState[oldRef] = null;
|
|
1645
1689
|
}
|
|
1646
1690
|
} else if (isRef(oldRef)) {
|
|
1647
|
-
oldRef
|
|
1691
|
+
if (canSetRef(oldRef)) {
|
|
1692
|
+
oldRef.value = null;
|
|
1693
|
+
}
|
|
1694
|
+
const oldRawRefAtom = oldRawRef;
|
|
1695
|
+
if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null;
|
|
1648
1696
|
}
|
|
1649
1697
|
}
|
|
1650
1698
|
if (isFunction(ref)) {
|
|
@@ -1655,7 +1703,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
1655
1703
|
if (_isString || _isRef) {
|
|
1656
1704
|
const doSet = () => {
|
|
1657
1705
|
if (rawRef.f) {
|
|
1658
|
-
const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value;
|
|
1706
|
+
const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
|
|
1659
1707
|
if (isUnmount) {
|
|
1660
1708
|
isArray(existing) && remove(existing, refValue);
|
|
1661
1709
|
} else {
|
|
@@ -1666,8 +1714,11 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
1666
1714
|
setupState[ref] = refs[ref];
|
|
1667
1715
|
}
|
|
1668
1716
|
} else {
|
|
1669
|
-
|
|
1670
|
-
if (
|
|
1717
|
+
const newVal = [refValue];
|
|
1718
|
+
if (canSetRef(ref)) {
|
|
1719
|
+
ref.value = newVal;
|
|
1720
|
+
}
|
|
1721
|
+
if (rawRef.k) refs[rawRef.k] = newVal;
|
|
1671
1722
|
}
|
|
1672
1723
|
} else if (!existing.includes(refValue)) {
|
|
1673
1724
|
existing.push(refValue);
|
|
@@ -1679,15 +1730,23 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
1679
1730
|
setupState[ref] = value;
|
|
1680
1731
|
}
|
|
1681
1732
|
} else if (_isRef) {
|
|
1682
|
-
ref
|
|
1733
|
+
if (canSetRef(ref)) {
|
|
1734
|
+
ref.value = value;
|
|
1735
|
+
}
|
|
1683
1736
|
if (rawRef.k) refs[rawRef.k] = value;
|
|
1684
1737
|
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
1685
1738
|
warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
|
|
1686
1739
|
}
|
|
1687
1740
|
};
|
|
1688
1741
|
if (value) {
|
|
1689
|
-
|
|
1742
|
+
const job = () => {
|
|
1743
|
+
doSet();
|
|
1744
|
+
pendingSetRefMap.delete(rawRef);
|
|
1745
|
+
};
|
|
1746
|
+
pendingSetRefMap.set(rawRef, job);
|
|
1747
|
+
queuePostRenderEffect(job, -1, parentSuspense);
|
|
1690
1748
|
} else {
|
|
1749
|
+
invalidatePendingSetRef(rawRef);
|
|
1691
1750
|
doSet();
|
|
1692
1751
|
}
|
|
1693
1752
|
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
@@ -1695,6 +1754,29 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
1695
1754
|
}
|
|
1696
1755
|
}
|
|
1697
1756
|
}
|
|
1757
|
+
function createCanSetSetupRefChecker(setupState) {
|
|
1758
|
+
const rawSetupState = toRaw(setupState);
|
|
1759
|
+
return setupState === void 0 || setupState === EMPTY_OBJ ? NO : (key) => {
|
|
1760
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1761
|
+
if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
|
|
1762
|
+
warn$1(
|
|
1763
|
+
`Template ref "${key}" used on a non-ref value. It will not work in the production build.`
|
|
1764
|
+
);
|
|
1765
|
+
}
|
|
1766
|
+
if (knownTemplateRefs.has(rawSetupState[key])) {
|
|
1767
|
+
return false;
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
return hasOwn(rawSetupState, key);
|
|
1771
|
+
};
|
|
1772
|
+
}
|
|
1773
|
+
function invalidatePendingSetRef(rawRef) {
|
|
1774
|
+
const pendingSetRef = pendingSetRefMap.get(rawRef);
|
|
1775
|
+
if (pendingSetRef) {
|
|
1776
|
+
pendingSetRef.flags |= 4;
|
|
1777
|
+
pendingSetRefMap.delete(rawRef);
|
|
1778
|
+
}
|
|
1779
|
+
}
|
|
1698
1780
|
|
|
1699
1781
|
let hasLoggedMismatchError = false;
|
|
1700
1782
|
const logMismatchError = () => {
|
|
@@ -1839,6 +1921,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1839
1921
|
);
|
|
1840
1922
|
}
|
|
1841
1923
|
break;
|
|
1924
|
+
case VaporSlot:
|
|
1925
|
+
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(
|
|
1926
|
+
vnode,
|
|
1927
|
+
node
|
|
1928
|
+
);
|
|
1929
|
+
break;
|
|
1842
1930
|
default:
|
|
1843
1931
|
if (shapeFlag & 1) {
|
|
1844
1932
|
if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
|
|
@@ -1854,9 +1942,6 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1854
1942
|
);
|
|
1855
1943
|
}
|
|
1856
1944
|
} else if (shapeFlag & 6) {
|
|
1857
|
-
if (vnode.type.__vapor) {
|
|
1858
|
-
throw new Error("Vapor component hydration is not supported yet.");
|
|
1859
|
-
}
|
|
1860
1945
|
vnode.slotScopeIds = slotScopeIds;
|
|
1861
1946
|
const container = parentNode(node);
|
|
1862
1947
|
if (isFragmentStart) {
|
|
@@ -1866,15 +1951,25 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1866
1951
|
} else {
|
|
1867
1952
|
nextNode = nextSibling(node);
|
|
1868
1953
|
}
|
|
1869
|
-
|
|
1870
|
-
vnode
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1954
|
+
if (vnode.type.__vapor) {
|
|
1955
|
+
getVaporInterface(parentComponent, vnode).hydrate(
|
|
1956
|
+
vnode,
|
|
1957
|
+
node,
|
|
1958
|
+
container,
|
|
1959
|
+
null,
|
|
1960
|
+
parentComponent
|
|
1961
|
+
);
|
|
1962
|
+
} else {
|
|
1963
|
+
mountComponent(
|
|
1964
|
+
vnode,
|
|
1965
|
+
container,
|
|
1966
|
+
null,
|
|
1967
|
+
parentComponent,
|
|
1968
|
+
parentSuspense,
|
|
1969
|
+
getContainerType(container),
|
|
1970
|
+
optimized
|
|
1971
|
+
);
|
|
1972
|
+
}
|
|
1878
1973
|
if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
|
|
1879
1974
|
let subTree;
|
|
1880
1975
|
if (isFragmentStart) {
|
|
@@ -1959,7 +2054,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1959
2054
|
);
|
|
1960
2055
|
let hasWarned = false;
|
|
1961
2056
|
while (next) {
|
|
1962
|
-
if (!isMismatchAllowed(el, 1
|
|
2057
|
+
if (!isMismatchAllowed(el, 1)) {
|
|
1963
2058
|
if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !hasWarned) {
|
|
1964
2059
|
warn$1(
|
|
1965
2060
|
`Hydration children mismatch on`,
|
|
@@ -1980,14 +2075,16 @@ Server rendered element contains more child nodes than client vdom.`
|
|
|
1980
2075
|
if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
|
|
1981
2076
|
clientText = clientText.slice(1);
|
|
1982
2077
|
}
|
|
1983
|
-
|
|
1984
|
-
|
|
2078
|
+
const { textContent } = el;
|
|
2079
|
+
if (textContent !== clientText && // innerHTML normalize \r\n or \r into a single \n in the DOM
|
|
2080
|
+
textContent !== clientText.replace(/\r\n|\r/g, "\n")) {
|
|
2081
|
+
if (!isMismatchAllowed(el, 0)) {
|
|
1985
2082
|
(!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(
|
|
1986
2083
|
`Hydration text content mismatch on`,
|
|
1987
2084
|
el,
|
|
1988
2085
|
`
|
|
1989
|
-
- rendered on server: ${
|
|
1990
|
-
- expected on client: ${
|
|
2086
|
+
- rendered on server: ${textContent}
|
|
2087
|
+
- expected on client: ${clientText}`
|
|
1991
2088
|
);
|
|
1992
2089
|
logMismatchError();
|
|
1993
2090
|
}
|
|
@@ -2074,7 +2171,7 @@ Server rendered element contains more child nodes than client vdom.`
|
|
|
2074
2171
|
} else if (isText && !vnode.children) {
|
|
2075
2172
|
insert(vnode.el = createText(""), container);
|
|
2076
2173
|
} else {
|
|
2077
|
-
if (!isMismatchAllowed(container, 1
|
|
2174
|
+
if (!isMismatchAllowed(container, 1)) {
|
|
2078
2175
|
if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !hasWarned) {
|
|
2079
2176
|
warn$1(
|
|
2080
2177
|
`Hydration children mismatch on`,
|
|
@@ -2124,7 +2221,7 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
2124
2221
|
}
|
|
2125
2222
|
};
|
|
2126
2223
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
2127
|
-
if (!isMismatchAllowed(node.parentElement, 1
|
|
2224
|
+
if (!isMismatchAllowed(node.parentElement, 1)) {
|
|
2128
2225
|
(!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(
|
|
2129
2226
|
`Hydration node mismatch:
|
|
2130
2227
|
- rendered on server:`,
|
|
@@ -2197,11 +2294,11 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
2197
2294
|
parent = parent.parent;
|
|
2198
2295
|
}
|
|
2199
2296
|
};
|
|
2200
|
-
const isTemplateNode = (node) => {
|
|
2201
|
-
return node.nodeType === 1 && node.tagName === "TEMPLATE";
|
|
2202
|
-
};
|
|
2203
2297
|
return [hydrate, hydrateNode];
|
|
2204
2298
|
}
|
|
2299
|
+
const isTemplateNode = (node) => {
|
|
2300
|
+
return node.nodeType === 1 && node.tagName === "TEMPLATE";
|
|
2301
|
+
};
|
|
2205
2302
|
function propHasMismatch(el, key, clientValue, vnode, instance) {
|
|
2206
2303
|
let mismatchType;
|
|
2207
2304
|
let mismatchKey;
|
|
@@ -2216,7 +2313,7 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
|
|
|
2216
2313
|
}
|
|
2217
2314
|
expected = normalizeClass(clientValue);
|
|
2218
2315
|
if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
|
|
2219
|
-
mismatchType = 2
|
|
2316
|
+
mismatchType = 2;
|
|
2220
2317
|
mismatchKey = `class`;
|
|
2221
2318
|
}
|
|
2222
2319
|
} else if (key === "style") {
|
|
@@ -2235,31 +2332,43 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
|
|
|
2235
2332
|
resolveCssVars(instance, vnode, expectedMap);
|
|
2236
2333
|
}
|
|
2237
2334
|
if (!isMapEqual(actualMap, expectedMap)) {
|
|
2238
|
-
mismatchType = 3
|
|
2335
|
+
mismatchType = 3;
|
|
2239
2336
|
mismatchKey = "style";
|
|
2240
2337
|
}
|
|
2241
|
-
} else if (
|
|
2242
|
-
|
|
2243
|
-
actual = el.hasAttribute(key);
|
|
2244
|
-
expected = includeBooleanAttr(clientValue);
|
|
2245
|
-
} else if (clientValue == null) {
|
|
2246
|
-
actual = el.hasAttribute(key);
|
|
2247
|
-
expected = false;
|
|
2248
|
-
} else {
|
|
2249
|
-
if (el.hasAttribute(key)) {
|
|
2250
|
-
actual = el.getAttribute(key);
|
|
2251
|
-
} else if (key === "value" && el.tagName === "TEXTAREA") {
|
|
2252
|
-
actual = el.value;
|
|
2253
|
-
} else {
|
|
2254
|
-
actual = false;
|
|
2255
|
-
}
|
|
2256
|
-
expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
|
|
2257
|
-
}
|
|
2338
|
+
} else if (isValidHtmlOrSvgAttribute(el, key)) {
|
|
2339
|
+
({ actual, expected } = getAttributeMismatch(el, key, clientValue));
|
|
2258
2340
|
if (actual !== expected) {
|
|
2259
|
-
mismatchType = 4
|
|
2341
|
+
mismatchType = 4;
|
|
2260
2342
|
mismatchKey = key;
|
|
2261
2343
|
}
|
|
2262
2344
|
}
|
|
2345
|
+
return warnPropMismatch(el, mismatchKey, mismatchType, actual, expected);
|
|
2346
|
+
}
|
|
2347
|
+
function getAttributeMismatch(el, key, clientValue) {
|
|
2348
|
+
let actual;
|
|
2349
|
+
let expected;
|
|
2350
|
+
if (isBooleanAttr(key)) {
|
|
2351
|
+
actual = el.hasAttribute(key);
|
|
2352
|
+
expected = includeBooleanAttr(clientValue);
|
|
2353
|
+
} else if (clientValue == null) {
|
|
2354
|
+
actual = el.hasAttribute(key);
|
|
2355
|
+
expected = false;
|
|
2356
|
+
} else {
|
|
2357
|
+
if (el.hasAttribute(key)) {
|
|
2358
|
+
actual = el.getAttribute(key);
|
|
2359
|
+
} else if (key === "value" && el.tagName === "TEXTAREA") {
|
|
2360
|
+
actual = el.value;
|
|
2361
|
+
} else {
|
|
2362
|
+
actual = false;
|
|
2363
|
+
}
|
|
2364
|
+
expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
|
|
2365
|
+
}
|
|
2366
|
+
return { actual, expected };
|
|
2367
|
+
}
|
|
2368
|
+
function isValidHtmlOrSvgAttribute(el, key) {
|
|
2369
|
+
return el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key));
|
|
2370
|
+
}
|
|
2371
|
+
function warnPropMismatch(el, mismatchKey, mismatchType, actual, expected) {
|
|
2263
2372
|
if (mismatchType != null && !isMismatchAllowed(el, mismatchType)) {
|
|
2264
2373
|
const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
|
|
2265
2374
|
const preSegment = `Hydration ${MismatchTypeString[mismatchType]} mismatch on`;
|
|
@@ -2330,15 +2439,27 @@ function resolveCssVars(instance, vnode, expectedMap) {
|
|
|
2330
2439
|
}
|
|
2331
2440
|
}
|
|
2332
2441
|
const allowMismatchAttr = "data-allow-mismatch";
|
|
2442
|
+
const MismatchTypes = {
|
|
2443
|
+
"TEXT": 0,
|
|
2444
|
+
"0": "TEXT",
|
|
2445
|
+
"CHILDREN": 1,
|
|
2446
|
+
"1": "CHILDREN",
|
|
2447
|
+
"CLASS": 2,
|
|
2448
|
+
"2": "CLASS",
|
|
2449
|
+
"STYLE": 3,
|
|
2450
|
+
"3": "STYLE",
|
|
2451
|
+
"ATTRIBUTE": 4,
|
|
2452
|
+
"4": "ATTRIBUTE"
|
|
2453
|
+
};
|
|
2333
2454
|
const MismatchTypeString = {
|
|
2334
|
-
[0
|
|
2335
|
-
[1
|
|
2336
|
-
[2
|
|
2337
|
-
[3
|
|
2338
|
-
[4
|
|
2455
|
+
[0]: "text",
|
|
2456
|
+
[1]: "children",
|
|
2457
|
+
[2]: "class",
|
|
2458
|
+
[3]: "style",
|
|
2459
|
+
[4]: "attribute"
|
|
2339
2460
|
};
|
|
2340
2461
|
function isMismatchAllowed(el, allowedType) {
|
|
2341
|
-
if (allowedType === 0
|
|
2462
|
+
if (allowedType === 0 || allowedType === 1) {
|
|
2342
2463
|
while (el && !el.hasAttribute(allowMismatchAttr)) {
|
|
2343
2464
|
el = el.parentElement;
|
|
2344
2465
|
}
|
|
@@ -2350,7 +2471,7 @@ function isMismatchAllowed(el, allowedType) {
|
|
|
2350
2471
|
return true;
|
|
2351
2472
|
} else {
|
|
2352
2473
|
const list = allowedAttr.split(",");
|
|
2353
|
-
if (allowedType === 0
|
|
2474
|
+
if (allowedType === 0 && list.includes("children")) {
|
|
2354
2475
|
return true;
|
|
2355
2476
|
}
|
|
2356
2477
|
return list.includes(MismatchTypeString[allowedType]);
|
|
@@ -2407,7 +2528,9 @@ const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
|
|
|
2407
2528
|
hasHydrated = true;
|
|
2408
2529
|
teardown();
|
|
2409
2530
|
hydrate();
|
|
2410
|
-
|
|
2531
|
+
if (!(`$evt${e.type}` in e.target)) {
|
|
2532
|
+
e.target.dispatchEvent(new e.constructor(e.type, e));
|
|
2533
|
+
}
|
|
2411
2534
|
}
|
|
2412
2535
|
};
|
|
2413
2536
|
const teardown = () => {
|
|
@@ -2449,104 +2572,46 @@ function forEachElement(node, cb) {
|
|
|
2449
2572
|
}
|
|
2450
2573
|
|
|
2451
2574
|
const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
|
|
2452
|
-
/*! #__NO_SIDE_EFFECTS__ */
|
|
2453
2575
|
// @__NO_SIDE_EFFECTS__
|
|
2454
2576
|
function defineAsyncComponent(source) {
|
|
2455
|
-
if (isFunction(source)) {
|
|
2456
|
-
source = { loader: source };
|
|
2457
|
-
}
|
|
2458
2577
|
const {
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
let retries = 0;
|
|
2472
|
-
const retry = () => {
|
|
2473
|
-
retries++;
|
|
2474
|
-
pendingRequest = null;
|
|
2475
|
-
return load();
|
|
2476
|
-
};
|
|
2477
|
-
const load = () => {
|
|
2478
|
-
let thisRequest;
|
|
2479
|
-
return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
|
|
2480
|
-
err = err instanceof Error ? err : new Error(String(err));
|
|
2481
|
-
if (userOnError) {
|
|
2482
|
-
return new Promise((resolve, reject) => {
|
|
2483
|
-
const userRetry = () => resolve(retry());
|
|
2484
|
-
const userFail = () => reject(err);
|
|
2485
|
-
userOnError(err, userRetry, userFail, retries + 1);
|
|
2486
|
-
});
|
|
2487
|
-
} else {
|
|
2488
|
-
throw err;
|
|
2489
|
-
}
|
|
2490
|
-
}).then((comp) => {
|
|
2491
|
-
if (thisRequest !== pendingRequest && pendingRequest) {
|
|
2492
|
-
return pendingRequest;
|
|
2493
|
-
}
|
|
2494
|
-
if (!!(process.env.NODE_ENV !== "production") && !comp) {
|
|
2495
|
-
warn$1(
|
|
2496
|
-
`Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
|
|
2497
|
-
);
|
|
2498
|
-
}
|
|
2499
|
-
if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
|
|
2500
|
-
comp = comp.default;
|
|
2501
|
-
}
|
|
2502
|
-
if (!!(process.env.NODE_ENV !== "production") && comp && !isObject(comp) && !isFunction(comp)) {
|
|
2503
|
-
throw new Error(`Invalid async component load result: ${comp}`);
|
|
2504
|
-
}
|
|
2505
|
-
resolvedComp = comp;
|
|
2506
|
-
return comp;
|
|
2507
|
-
}));
|
|
2508
|
-
};
|
|
2578
|
+
load,
|
|
2579
|
+
getResolvedComp,
|
|
2580
|
+
setPendingRequest,
|
|
2581
|
+
source: {
|
|
2582
|
+
loadingComponent,
|
|
2583
|
+
errorComponent,
|
|
2584
|
+
delay,
|
|
2585
|
+
hydrate: hydrateStrategy,
|
|
2586
|
+
timeout,
|
|
2587
|
+
suspensible = true
|
|
2588
|
+
}
|
|
2589
|
+
} = createAsyncComponentContext(source);
|
|
2509
2590
|
return defineComponent({
|
|
2510
2591
|
name: "AsyncComponentWrapper",
|
|
2511
2592
|
__asyncLoader: load,
|
|
2512
2593
|
__asyncHydrate(el, instance, hydrate) {
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
}
|
|
2522
|
-
hydrate();
|
|
2523
|
-
};
|
|
2524
|
-
const teardown = hydrateStrategy(
|
|
2525
|
-
performHydrate,
|
|
2526
|
-
(cb) => forEachElement(el, cb)
|
|
2527
|
-
);
|
|
2528
|
-
if (teardown) {
|
|
2529
|
-
(instance.bum || (instance.bum = [])).push(teardown);
|
|
2530
|
-
}
|
|
2531
|
-
(instance.u || (instance.u = [])).push(() => patched = true);
|
|
2532
|
-
} : hydrate;
|
|
2533
|
-
if (resolvedComp) {
|
|
2534
|
-
doHydrate();
|
|
2535
|
-
} else {
|
|
2536
|
-
load().then(() => !instance.isUnmounted && doHydrate());
|
|
2537
|
-
}
|
|
2594
|
+
performAsyncHydrate(
|
|
2595
|
+
el,
|
|
2596
|
+
instance,
|
|
2597
|
+
hydrate,
|
|
2598
|
+
getResolvedComp,
|
|
2599
|
+
load,
|
|
2600
|
+
hydrateStrategy
|
|
2601
|
+
);
|
|
2538
2602
|
},
|
|
2539
2603
|
get __asyncResolved() {
|
|
2540
|
-
return
|
|
2604
|
+
return getResolvedComp();
|
|
2541
2605
|
},
|
|
2542
2606
|
setup() {
|
|
2543
2607
|
const instance = currentInstance;
|
|
2544
2608
|
markAsyncBoundary(instance);
|
|
2609
|
+
let resolvedComp = getResolvedComp();
|
|
2545
2610
|
if (resolvedComp) {
|
|
2546
2611
|
return () => createInnerComp(resolvedComp, instance);
|
|
2547
2612
|
}
|
|
2548
2613
|
const onError = (err) => {
|
|
2549
|
-
|
|
2614
|
+
setPendingRequest(null);
|
|
2550
2615
|
handleError(
|
|
2551
2616
|
err,
|
|
2552
2617
|
instance,
|
|
@@ -2564,25 +2629,11 @@ function defineAsyncComponent(source) {
|
|
|
2564
2629
|
}) : null;
|
|
2565
2630
|
});
|
|
2566
2631
|
}
|
|
2567
|
-
const loaded =
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
delayed.value = false;
|
|
2573
|
-
}, delay);
|
|
2574
|
-
}
|
|
2575
|
-
if (timeout != null) {
|
|
2576
|
-
setTimeout(() => {
|
|
2577
|
-
if (!loaded.value && !error.value) {
|
|
2578
|
-
const err = new Error(
|
|
2579
|
-
`Async component timed out after ${timeout}ms.`
|
|
2580
|
-
);
|
|
2581
|
-
onError(err);
|
|
2582
|
-
error.value = err;
|
|
2583
|
-
}
|
|
2584
|
-
}, timeout);
|
|
2585
|
-
}
|
|
2632
|
+
const { loaded, error, delayed } = useAsyncComponentState(
|
|
2633
|
+
delay,
|
|
2634
|
+
timeout,
|
|
2635
|
+
onError
|
|
2636
|
+
);
|
|
2586
2637
|
load().then(() => {
|
|
2587
2638
|
loaded.value = true;
|
|
2588
2639
|
if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) {
|
|
@@ -2593,6 +2644,7 @@ function defineAsyncComponent(source) {
|
|
|
2593
2644
|
error.value = err;
|
|
2594
2645
|
});
|
|
2595
2646
|
return () => {
|
|
2647
|
+
resolvedComp = getResolvedComp();
|
|
2596
2648
|
if (loaded.value && resolvedComp) {
|
|
2597
2649
|
return createInnerComp(resolvedComp, instance);
|
|
2598
2650
|
} else if (error.value && errorComponent) {
|
|
@@ -2600,7 +2652,10 @@ function defineAsyncComponent(source) {
|
|
|
2600
2652
|
error: error.value
|
|
2601
2653
|
});
|
|
2602
2654
|
} else if (loadingComponent && !delayed.value) {
|
|
2603
|
-
return
|
|
2655
|
+
return createInnerComp(
|
|
2656
|
+
loadingComponent,
|
|
2657
|
+
instance
|
|
2658
|
+
);
|
|
2604
2659
|
}
|
|
2605
2660
|
};
|
|
2606
2661
|
}
|
|
@@ -2614,6 +2669,108 @@ function createInnerComp(comp, parent) {
|
|
|
2614
2669
|
delete parent.vnode.ce;
|
|
2615
2670
|
return vnode;
|
|
2616
2671
|
}
|
|
2672
|
+
function createAsyncComponentContext(source) {
|
|
2673
|
+
if (isFunction(source)) {
|
|
2674
|
+
source = { loader: source };
|
|
2675
|
+
}
|
|
2676
|
+
const { loader, onError: userOnError } = source;
|
|
2677
|
+
let pendingRequest = null;
|
|
2678
|
+
let resolvedComp;
|
|
2679
|
+
let retries = 0;
|
|
2680
|
+
const retry = () => {
|
|
2681
|
+
retries++;
|
|
2682
|
+
pendingRequest = null;
|
|
2683
|
+
return load();
|
|
2684
|
+
};
|
|
2685
|
+
const load = () => {
|
|
2686
|
+
let thisRequest;
|
|
2687
|
+
return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
|
|
2688
|
+
err = err instanceof Error ? err : new Error(String(err));
|
|
2689
|
+
if (userOnError) {
|
|
2690
|
+
return new Promise((resolve, reject) => {
|
|
2691
|
+
const userRetry = () => resolve(retry());
|
|
2692
|
+
const userFail = () => reject(err);
|
|
2693
|
+
userOnError(err, userRetry, userFail, retries + 1);
|
|
2694
|
+
});
|
|
2695
|
+
} else {
|
|
2696
|
+
throw err;
|
|
2697
|
+
}
|
|
2698
|
+
}).then((comp) => {
|
|
2699
|
+
if (thisRequest !== pendingRequest && pendingRequest) {
|
|
2700
|
+
return pendingRequest;
|
|
2701
|
+
}
|
|
2702
|
+
if (!!(process.env.NODE_ENV !== "production") && !comp) {
|
|
2703
|
+
warn$1(
|
|
2704
|
+
`Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
|
|
2705
|
+
);
|
|
2706
|
+
}
|
|
2707
|
+
if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
|
|
2708
|
+
comp = comp.default;
|
|
2709
|
+
}
|
|
2710
|
+
if (!!(process.env.NODE_ENV !== "production") && comp && !isObject(comp) && !isFunction(comp)) {
|
|
2711
|
+
throw new Error(`Invalid async component load result: ${comp}`);
|
|
2712
|
+
}
|
|
2713
|
+
resolvedComp = comp;
|
|
2714
|
+
return comp;
|
|
2715
|
+
}));
|
|
2716
|
+
};
|
|
2717
|
+
return {
|
|
2718
|
+
load,
|
|
2719
|
+
source,
|
|
2720
|
+
getResolvedComp: () => resolvedComp,
|
|
2721
|
+
setPendingRequest: (request) => pendingRequest = request
|
|
2722
|
+
};
|
|
2723
|
+
}
|
|
2724
|
+
const useAsyncComponentState = (delay, timeout, onError) => {
|
|
2725
|
+
const loaded = ref(false);
|
|
2726
|
+
const error = ref();
|
|
2727
|
+
const delayed = ref(!!delay);
|
|
2728
|
+
if (delay) {
|
|
2729
|
+
setTimeout(() => {
|
|
2730
|
+
delayed.value = false;
|
|
2731
|
+
}, delay);
|
|
2732
|
+
}
|
|
2733
|
+
if (timeout != null) {
|
|
2734
|
+
setTimeout(() => {
|
|
2735
|
+
if (!loaded.value && !error.value) {
|
|
2736
|
+
const err = new Error(`Async component timed out after ${timeout}ms.`);
|
|
2737
|
+
onError(err);
|
|
2738
|
+
error.value = err;
|
|
2739
|
+
}
|
|
2740
|
+
}, timeout);
|
|
2741
|
+
}
|
|
2742
|
+
return { loaded, error, delayed };
|
|
2743
|
+
};
|
|
2744
|
+
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
|
|
2745
|
+
let patched = false;
|
|
2746
|
+
(instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
2747
|
+
const performHydrate = () => {
|
|
2748
|
+
if (patched) {
|
|
2749
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
2750
|
+
const resolvedComp = getResolvedComp();
|
|
2751
|
+
warn$1(
|
|
2752
|
+
`Skipping lazy hydration for component '${getComponentName(resolvedComp) || resolvedComp.__file}': it was updated before lazy hydration performed.`
|
|
2753
|
+
);
|
|
2754
|
+
}
|
|
2755
|
+
return;
|
|
2756
|
+
}
|
|
2757
|
+
hydrate();
|
|
2758
|
+
};
|
|
2759
|
+
const doHydrate = hydrateStrategy ? () => {
|
|
2760
|
+
const teardown = hydrateStrategy(
|
|
2761
|
+
performHydrate,
|
|
2762
|
+
(cb) => forEachElement(el, cb)
|
|
2763
|
+
);
|
|
2764
|
+
if (teardown) {
|
|
2765
|
+
(instance.bum || (instance.bum = [])).push(teardown);
|
|
2766
|
+
}
|
|
2767
|
+
} : performHydrate;
|
|
2768
|
+
if (getResolvedComp()) {
|
|
2769
|
+
doHydrate();
|
|
2770
|
+
} else {
|
|
2771
|
+
load().then(() => !instance.isUnmounted && doHydrate());
|
|
2772
|
+
}
|
|
2773
|
+
}
|
|
2617
2774
|
|
|
2618
2775
|
const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
|
|
2619
2776
|
const KeepAliveImpl = {
|
|
@@ -2643,86 +2800,37 @@ const KeepAliveImpl = {
|
|
|
2643
2800
|
keepAliveInstance.__v_cache = cache;
|
|
2644
2801
|
}
|
|
2645
2802
|
const parentSuspense = keepAliveInstance.suspense;
|
|
2803
|
+
const { renderer } = sharedContext;
|
|
2646
2804
|
const {
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
um: _unmount,
|
|
2651
|
-
o: { createElement }
|
|
2652
|
-
}
|
|
2653
|
-
} = sharedContext;
|
|
2805
|
+
um: _unmount,
|
|
2806
|
+
o: { createElement }
|
|
2807
|
+
} = renderer;
|
|
2654
2808
|
const storageContainer = createElement("div");
|
|
2809
|
+
sharedContext.getStorageContainer = () => storageContainer;
|
|
2810
|
+
sharedContext.getCachedComponent = (vnode) => {
|
|
2811
|
+
const key = vnode.key == null ? vnode.type : vnode.key;
|
|
2812
|
+
return cache.get(key);
|
|
2813
|
+
};
|
|
2655
2814
|
sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
|
|
2656
|
-
|
|
2657
|
-
move(
|
|
2815
|
+
activate(
|
|
2658
2816
|
vnode,
|
|
2659
2817
|
container,
|
|
2660
2818
|
anchor,
|
|
2661
|
-
|
|
2819
|
+
renderer,
|
|
2662
2820
|
keepAliveInstance,
|
|
2663
|
-
parentSuspense
|
|
2664
|
-
);
|
|
2665
|
-
patch(
|
|
2666
|
-
instance.vnode,
|
|
2667
|
-
vnode,
|
|
2668
|
-
container,
|
|
2669
|
-
anchor,
|
|
2670
|
-
instance,
|
|
2671
2821
|
parentSuspense,
|
|
2672
2822
|
namespace,
|
|
2673
|
-
vnode.slotScopeIds,
|
|
2674
2823
|
optimized
|
|
2675
2824
|
);
|
|
2676
|
-
queuePostRenderEffect(
|
|
2677
|
-
() => {
|
|
2678
|
-
instance.isDeactivated = false;
|
|
2679
|
-
if (instance.a) {
|
|
2680
|
-
invokeArrayFns(instance.a);
|
|
2681
|
-
}
|
|
2682
|
-
const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
|
|
2683
|
-
if (vnodeHook) {
|
|
2684
|
-
invokeVNodeHook(vnodeHook, instance.parent, vnode);
|
|
2685
|
-
}
|
|
2686
|
-
},
|
|
2687
|
-
void 0,
|
|
2688
|
-
parentSuspense
|
|
2689
|
-
);
|
|
2690
|
-
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
2691
|
-
devtoolsComponentAdded(instance);
|
|
2692
|
-
}
|
|
2693
2825
|
};
|
|
2694
2826
|
sharedContext.deactivate = (vnode) => {
|
|
2695
|
-
|
|
2696
|
-
invalidateMount(instance.m);
|
|
2697
|
-
invalidateMount(instance.a);
|
|
2698
|
-
move(
|
|
2827
|
+
deactivate(
|
|
2699
2828
|
vnode,
|
|
2700
2829
|
storageContainer,
|
|
2701
|
-
|
|
2702
|
-
1,
|
|
2830
|
+
renderer,
|
|
2703
2831
|
keepAliveInstance,
|
|
2704
2832
|
parentSuspense
|
|
2705
2833
|
);
|
|
2706
|
-
queuePostRenderEffect(
|
|
2707
|
-
() => {
|
|
2708
|
-
if (instance.da) {
|
|
2709
|
-
invokeArrayFns(instance.da);
|
|
2710
|
-
}
|
|
2711
|
-
const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
|
|
2712
|
-
if (vnodeHook) {
|
|
2713
|
-
invokeVNodeHook(vnodeHook, instance.parent, vnode);
|
|
2714
|
-
}
|
|
2715
|
-
instance.isDeactivated = true;
|
|
2716
|
-
},
|
|
2717
|
-
void 0,
|
|
2718
|
-
parentSuspense
|
|
2719
|
-
);
|
|
2720
|
-
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
2721
|
-
devtoolsComponentAdded(instance);
|
|
2722
|
-
}
|
|
2723
|
-
if (!!(process.env.NODE_ENV !== "production") && true) {
|
|
2724
|
-
instance.__keepAliveStorageContainer = storageContainer;
|
|
2725
|
-
}
|
|
2726
2834
|
};
|
|
2727
2835
|
function unmount(vnode) {
|
|
2728
2836
|
resetShapeFlag(vnode);
|
|
@@ -2869,7 +2977,7 @@ function onActivated(hook, target) {
|
|
|
2869
2977
|
function onDeactivated(hook, target) {
|
|
2870
2978
|
registerKeepAliveHook(hook, "da", target);
|
|
2871
2979
|
}
|
|
2872
|
-
function registerKeepAliveHook(hook, type, target =
|
|
2980
|
+
function registerKeepAliveHook(hook, type, target = getCurrentGenericInstance()) {
|
|
2873
2981
|
const wrappedHook = hook.__wdc || (hook.__wdc = () => {
|
|
2874
2982
|
let current = target;
|
|
2875
2983
|
while (current) {
|
|
@@ -2883,8 +2991,9 @@ function registerKeepAliveHook(hook, type, target = getCurrentInstance()) {
|
|
|
2883
2991
|
injectHook(type, wrappedHook, target);
|
|
2884
2992
|
if (target) {
|
|
2885
2993
|
let current = target.parent;
|
|
2886
|
-
while (current && current.parent
|
|
2887
|
-
|
|
2994
|
+
while (current && current.parent) {
|
|
2995
|
+
let parent = current.parent;
|
|
2996
|
+
if (isKeepAlive(parent.vapor ? parent : parent.vnode)) {
|
|
2888
2997
|
injectToKeepAliveRoot(wrappedHook, type, target, current);
|
|
2889
2998
|
}
|
|
2890
2999
|
current = current.parent;
|
|
@@ -2910,6 +3019,71 @@ function resetShapeFlag(vnode) {
|
|
|
2910
3019
|
function getInnerChild(vnode) {
|
|
2911
3020
|
return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
|
|
2912
3021
|
}
|
|
3022
|
+
function activate(vnode, container, anchor, { p: patch, m: move }, parentComponent, parentSuspense, namespace, optimized) {
|
|
3023
|
+
const instance = vnode.component;
|
|
3024
|
+
move(
|
|
3025
|
+
vnode,
|
|
3026
|
+
container,
|
|
3027
|
+
anchor,
|
|
3028
|
+
0,
|
|
3029
|
+
parentComponent,
|
|
3030
|
+
parentSuspense
|
|
3031
|
+
);
|
|
3032
|
+
patch(
|
|
3033
|
+
instance.vnode,
|
|
3034
|
+
vnode,
|
|
3035
|
+
container,
|
|
3036
|
+
anchor,
|
|
3037
|
+
instance,
|
|
3038
|
+
parentSuspense,
|
|
3039
|
+
namespace,
|
|
3040
|
+
vnode.slotScopeIds,
|
|
3041
|
+
optimized
|
|
3042
|
+
);
|
|
3043
|
+
queuePostRenderEffect(
|
|
3044
|
+
() => {
|
|
3045
|
+
instance.isDeactivated = false;
|
|
3046
|
+
if (instance.a) {
|
|
3047
|
+
invokeArrayFns(instance.a);
|
|
3048
|
+
}
|
|
3049
|
+
const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
|
|
3050
|
+
if (vnodeHook) {
|
|
3051
|
+
invokeVNodeHook(vnodeHook, instance.parent, vnode);
|
|
3052
|
+
}
|
|
3053
|
+
},
|
|
3054
|
+
void 0,
|
|
3055
|
+
parentSuspense
|
|
3056
|
+
);
|
|
3057
|
+
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
3058
|
+
devtoolsComponentAdded(instance);
|
|
3059
|
+
}
|
|
3060
|
+
}
|
|
3061
|
+
function deactivate(vnode, container, { m: move }, parentComponent, parentSuspense) {
|
|
3062
|
+
const instance = vnode.component;
|
|
3063
|
+
invalidateMount(instance.m);
|
|
3064
|
+
invalidateMount(instance.a);
|
|
3065
|
+
move(vnode, container, null, 1, parentComponent, parentSuspense);
|
|
3066
|
+
queuePostRenderEffect(
|
|
3067
|
+
() => {
|
|
3068
|
+
if (instance.da) {
|
|
3069
|
+
invokeArrayFns(instance.da);
|
|
3070
|
+
}
|
|
3071
|
+
const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
|
|
3072
|
+
if (vnodeHook) {
|
|
3073
|
+
invokeVNodeHook(vnodeHook, instance.parent, vnode);
|
|
3074
|
+
}
|
|
3075
|
+
instance.isDeactivated = true;
|
|
3076
|
+
},
|
|
3077
|
+
void 0,
|
|
3078
|
+
parentSuspense
|
|
3079
|
+
);
|
|
3080
|
+
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
3081
|
+
devtoolsComponentAdded(instance);
|
|
3082
|
+
}
|
|
3083
|
+
if (!!(process.env.NODE_ENV !== "production") && true) {
|
|
3084
|
+
instance.__keepAliveStorageContainer = container;
|
|
3085
|
+
}
|
|
3086
|
+
}
|
|
2913
3087
|
|
|
2914
3088
|
function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
2915
3089
|
if (target) {
|
|
@@ -3098,12 +3272,13 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
|
3098
3272
|
return ret;
|
|
3099
3273
|
}
|
|
3100
3274
|
if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
|
|
3275
|
+
const hasProps = Object.keys(props).length > 0;
|
|
3101
3276
|
if (name !== "default") props.name = name;
|
|
3102
3277
|
return openBlock(), createBlock(
|
|
3103
3278
|
Fragment,
|
|
3104
3279
|
null,
|
|
3105
3280
|
[createVNode("slot", props, fallback && fallback())],
|
|
3106
|
-
64
|
|
3281
|
+
hasProps ? -2 : 64
|
|
3107
3282
|
);
|
|
3108
3283
|
}
|
|
3109
3284
|
if (!!(process.env.NODE_ENV !== "production") && slot && slot.length > 1) {
|
|
@@ -3117,6 +3292,7 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
|
3117
3292
|
}
|
|
3118
3293
|
openBlock();
|
|
3119
3294
|
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
3295
|
+
ensureVaporSlotFallback(validSlotContent, fallback);
|
|
3120
3296
|
const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
|
|
3121
3297
|
// key attached in the `createSlots` helper, respect that
|
|
3122
3298
|
validSlotContent && validSlotContent.key;
|
|
@@ -3146,6 +3322,14 @@ function ensureValidVNode(vnodes) {
|
|
|
3146
3322
|
return true;
|
|
3147
3323
|
}) ? vnodes : null;
|
|
3148
3324
|
}
|
|
3325
|
+
function ensureVaporSlotFallback(vnodes, fallback) {
|
|
3326
|
+
let vaporSlot;
|
|
3327
|
+
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) {
|
|
3328
|
+
if (!vaporSlot.fallback && fallback) {
|
|
3329
|
+
vaporSlot.fallback = fallback;
|
|
3330
|
+
}
|
|
3331
|
+
}
|
|
3332
|
+
}
|
|
3149
3333
|
|
|
3150
3334
|
function toHandlers(obj, preserveCaseIfNecessary) {
|
|
3151
3335
|
const ret = {};
|
|
@@ -3216,7 +3400,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
3216
3400
|
} else if (hasSetupBinding(setupState, key)) {
|
|
3217
3401
|
accessCache[key] = 1 /* SETUP */;
|
|
3218
3402
|
return setupState[key];
|
|
3219
|
-
} else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
3403
|
+
} else if (__VUE_OPTIONS_API__ && data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
3220
3404
|
accessCache[key] = 2 /* DATA */;
|
|
3221
3405
|
return data[key];
|
|
3222
3406
|
} else if (
|
|
@@ -3282,7 +3466,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
3282
3466
|
} else if (!!(process.env.NODE_ENV !== "production") && setupState.__isScriptSetup && hasOwn(setupState, key)) {
|
|
3283
3467
|
warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`);
|
|
3284
3468
|
return false;
|
|
3285
|
-
} else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
3469
|
+
} else if (__VUE_OPTIONS_API__ && data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
3286
3470
|
data[key] = value;
|
|
3287
3471
|
return true;
|
|
3288
3472
|
} else if (hasOwn(instance.props, key)) {
|
|
@@ -3308,10 +3492,10 @@ const PublicInstanceProxyHandlers = {
|
|
|
3308
3492
|
return true;
|
|
3309
3493
|
},
|
|
3310
3494
|
has({
|
|
3311
|
-
_: { data, setupState, accessCache, ctx, appContext, propsOptions }
|
|
3495
|
+
_: { data, setupState, accessCache, ctx, appContext, propsOptions, type }
|
|
3312
3496
|
}, key) {
|
|
3313
|
-
let normalizedProps;
|
|
3314
|
-
return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key);
|
|
3497
|
+
let normalizedProps, cssModules;
|
|
3498
|
+
return !!(accessCache[key] || __VUE_OPTIONS_API__ && data !== EMPTY_OBJ && key[0] !== "$" && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]);
|
|
3315
3499
|
},
|
|
3316
3500
|
defineProperty(target, key, descriptor) {
|
|
3317
3501
|
if (descriptor.get != null) {
|
|
@@ -3449,15 +3633,15 @@ function withDefaults(props, defaults) {
|
|
|
3449
3633
|
return null;
|
|
3450
3634
|
}
|
|
3451
3635
|
function useSlots() {
|
|
3452
|
-
return getContext().slots;
|
|
3636
|
+
return getContext("useSlots").slots;
|
|
3453
3637
|
}
|
|
3454
3638
|
function useAttrs() {
|
|
3455
|
-
return getContext().attrs;
|
|
3639
|
+
return getContext("useAttrs").attrs;
|
|
3456
3640
|
}
|
|
3457
|
-
function getContext() {
|
|
3641
|
+
function getContext(calledFunctionName) {
|
|
3458
3642
|
const i = getCurrentGenericInstance();
|
|
3459
3643
|
if (!!(process.env.NODE_ENV !== "production") && !i) {
|
|
3460
|
-
warn$1(
|
|
3644
|
+
warn$1(`${calledFunctionName}() called without active instance.`);
|
|
3461
3645
|
}
|
|
3462
3646
|
if (i.vapor) {
|
|
3463
3647
|
return i;
|
|
@@ -3715,7 +3899,8 @@ function applyOptions(instance) {
|
|
|
3715
3899
|
expose.forEach((key) => {
|
|
3716
3900
|
Object.defineProperty(exposed, key, {
|
|
3717
3901
|
get: () => publicThis[key],
|
|
3718
|
-
set: (val) => publicThis[key] = val
|
|
3902
|
+
set: (val) => publicThis[key] = val,
|
|
3903
|
+
enumerable: true
|
|
3719
3904
|
});
|
|
3720
3905
|
});
|
|
3721
3906
|
} else if (!instance.exposed) {
|
|
@@ -4590,7 +4775,7 @@ function isBoolean(...args) {
|
|
|
4590
4775
|
return args.some((elem) => elem.toLowerCase() === "boolean");
|
|
4591
4776
|
}
|
|
4592
4777
|
|
|
4593
|
-
const isInternalKey = (key) => key
|
|
4778
|
+
const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
|
|
4594
4779
|
const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
|
|
4595
4780
|
const normalizeSlot = (key, rawSlot, ctx) => {
|
|
4596
4781
|
if (rawSlot._n) {
|
|
@@ -4644,8 +4829,6 @@ const assignSlots = (slots, children, optimized) => {
|
|
|
4644
4829
|
const initSlots = (instance, children, optimized) => {
|
|
4645
4830
|
const slots = instance.slots = createInternalObject();
|
|
4646
4831
|
if (instance.vnode.shapeFlag & 32) {
|
|
4647
|
-
const cacheIndexes = children.__;
|
|
4648
|
-
if (cacheIndexes) def(slots, "__", cacheIndexes, true);
|
|
4649
4832
|
const type = children._;
|
|
4650
4833
|
if (type) {
|
|
4651
4834
|
assignSlots(slots, children, optimized);
|
|
@@ -4709,12 +4892,10 @@ function endMeasure(instance, type) {
|
|
|
4709
4892
|
if (instance.appContext.config.performance && isSupported()) {
|
|
4710
4893
|
const startTag = `vue-${type}-${instance.uid}`;
|
|
4711
4894
|
const endTag = startTag + `:end`;
|
|
4895
|
+
const measureName = `<${formatComponentName(instance, instance.type)}> ${type}`;
|
|
4712
4896
|
perf.mark(endTag);
|
|
4713
|
-
perf.measure(
|
|
4714
|
-
|
|
4715
|
-
startTag,
|
|
4716
|
-
endTag
|
|
4717
|
-
);
|
|
4897
|
+
perf.measure(measureName, startTag, endTag);
|
|
4898
|
+
perf.clearMeasures(measureName);
|
|
4718
4899
|
perf.clearMarks(startTag);
|
|
4719
4900
|
perf.clearMarks(endTag);
|
|
4720
4901
|
}
|
|
@@ -4991,15 +5172,25 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4991
5172
|
optimized
|
|
4992
5173
|
);
|
|
4993
5174
|
} else {
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
|
|
5175
|
+
const customElement = !!(n1.el && n1.el._isVueCE) ? n1.el : null;
|
|
5176
|
+
try {
|
|
5177
|
+
if (customElement) {
|
|
5178
|
+
customElement._beginPatch();
|
|
5179
|
+
}
|
|
5180
|
+
patchElement(
|
|
5181
|
+
n1,
|
|
5182
|
+
n2,
|
|
5183
|
+
parentComponent,
|
|
5184
|
+
parentSuspense,
|
|
5185
|
+
namespace,
|
|
5186
|
+
slotScopeIds,
|
|
5187
|
+
optimized
|
|
5188
|
+
);
|
|
5189
|
+
} finally {
|
|
5190
|
+
if (customElement) {
|
|
5191
|
+
customElement._endPatch();
|
|
5192
|
+
}
|
|
5193
|
+
}
|
|
5003
5194
|
}
|
|
5004
5195
|
};
|
|
5005
5196
|
const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
@@ -5050,16 +5241,20 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5050
5241
|
if (dirs) {
|
|
5051
5242
|
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
5052
5243
|
}
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5244
|
+
if (transition) {
|
|
5245
|
+
performTransitionEnter(
|
|
5246
|
+
el,
|
|
5247
|
+
transition,
|
|
5248
|
+
() => hostInsert(el, container, anchor),
|
|
5249
|
+
parentSuspense
|
|
5250
|
+
);
|
|
5251
|
+
} else {
|
|
5252
|
+
hostInsert(el, container, anchor);
|
|
5056
5253
|
}
|
|
5057
|
-
|
|
5058
|
-
if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
|
|
5254
|
+
if ((vnodeHook = props && props.onVnodeMounted) || dirs) {
|
|
5059
5255
|
queuePostRenderEffect(
|
|
5060
5256
|
() => {
|
|
5061
5257
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
5062
|
-
needCallTransitionHooks && transition.enter(el);
|
|
5063
5258
|
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
5064
5259
|
},
|
|
5065
5260
|
void 0,
|
|
@@ -5076,21 +5271,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5076
5271
|
hostSetScopeId(el, slotScopeIds[i]);
|
|
5077
5272
|
}
|
|
5078
5273
|
}
|
|
5079
|
-
|
|
5080
|
-
|
|
5081
|
-
|
|
5082
|
-
subTree = filterSingleRoot(subTree.children) || subTree;
|
|
5083
|
-
}
|
|
5084
|
-
if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
|
|
5085
|
-
const parentVNode = parentComponent.vnode;
|
|
5086
|
-
setScopeId(
|
|
5087
|
-
el,
|
|
5088
|
-
parentVNode,
|
|
5089
|
-
parentVNode.scopeId,
|
|
5090
|
-
parentVNode.slotScopeIds,
|
|
5091
|
-
parentComponent.parent
|
|
5092
|
-
);
|
|
5093
|
-
}
|
|
5274
|
+
const inheritedScopeIds = getInheritedScopeIds(vnode, parentComponent);
|
|
5275
|
+
for (let i = 0; i < inheritedScopeIds.length; i++) {
|
|
5276
|
+
hostSetScopeId(el, inheritedScopeIds[i]);
|
|
5094
5277
|
}
|
|
5095
5278
|
};
|
|
5096
5279
|
const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
|
|
@@ -5342,12 +5525,21 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5342
5525
|
n2.slotScopeIds = slotScopeIds;
|
|
5343
5526
|
if (n2.type.__vapor) {
|
|
5344
5527
|
if (n1 == null) {
|
|
5345
|
-
|
|
5346
|
-
n2
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
|
|
5528
|
+
if (n2.shapeFlag & 512) {
|
|
5529
|
+
getVaporInterface(parentComponent, n2).activate(
|
|
5530
|
+
n2,
|
|
5531
|
+
container,
|
|
5532
|
+
anchor,
|
|
5533
|
+
parentComponent
|
|
5534
|
+
);
|
|
5535
|
+
} else {
|
|
5536
|
+
getVaporInterface(parentComponent, n2).mount(
|
|
5537
|
+
n2,
|
|
5538
|
+
container,
|
|
5539
|
+
anchor,
|
|
5540
|
+
parentComponent
|
|
5541
|
+
);
|
|
5542
|
+
}
|
|
5351
5543
|
} else {
|
|
5352
5544
|
getVaporInterface(parentComponent, n2).update(
|
|
5353
5545
|
n1,
|
|
@@ -5410,6 +5602,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5410
5602
|
if (!initialVNode.el) {
|
|
5411
5603
|
const placeholder = instance.subTree = createVNode(Comment);
|
|
5412
5604
|
processCommentNode(null, placeholder, container, anchor);
|
|
5605
|
+
initialVNode.placeholder = placeholder.el;
|
|
5413
5606
|
}
|
|
5414
5607
|
} else {
|
|
5415
5608
|
setupRenderEffect(
|
|
@@ -5950,7 +6143,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5950
6143
|
for (i = toBePatched - 1; i >= 0; i--) {
|
|
5951
6144
|
const nextIndex = s2 + i;
|
|
5952
6145
|
const nextChild = c2[nextIndex];
|
|
5953
|
-
const
|
|
6146
|
+
const anchorVNode = c2[nextIndex + 1];
|
|
6147
|
+
const anchor = nextIndex + 1 < l2 ? (
|
|
6148
|
+
// #13559, fallback to el placeholder for unresolved async component
|
|
6149
|
+
anchorVNode.el || anchorVNode.placeholder
|
|
6150
|
+
) : parentAnchor;
|
|
5954
6151
|
if (newIndexToOldIndexMap[i] === 0) {
|
|
5955
6152
|
patch(
|
|
5956
6153
|
null,
|
|
@@ -6030,12 +6227,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6030
6227
|
const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
|
|
6031
6228
|
if (needTransition2) {
|
|
6032
6229
|
if (moveType === 0) {
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
() =>
|
|
6037
|
-
|
|
6038
|
-
|
|
6230
|
+
performTransitionEnter(
|
|
6231
|
+
el,
|
|
6232
|
+
transition,
|
|
6233
|
+
() => hostInsert(el, container, anchor),
|
|
6234
|
+
parentSuspense,
|
|
6235
|
+
true
|
|
6039
6236
|
);
|
|
6040
6237
|
} else {
|
|
6041
6238
|
const { leave, delayLeave, afterLeave } = transition;
|
|
@@ -6047,6 +6244,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6047
6244
|
}
|
|
6048
6245
|
};
|
|
6049
6246
|
const performLeave = () => {
|
|
6247
|
+
if (el._isLeaving) {
|
|
6248
|
+
el[leaveCbKey](
|
|
6249
|
+
true
|
|
6250
|
+
/* cancelled */
|
|
6251
|
+
);
|
|
6252
|
+
}
|
|
6050
6253
|
leave(el, () => {
|
|
6051
6254
|
remove2();
|
|
6052
6255
|
afterLeave && afterLeave();
|
|
@@ -6086,7 +6289,14 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6086
6289
|
parentComponent.renderCache[cacheIndex] = void 0;
|
|
6087
6290
|
}
|
|
6088
6291
|
if (shapeFlag & 256) {
|
|
6089
|
-
|
|
6292
|
+
if (vnode.type.__vapor) {
|
|
6293
|
+
getVaporInterface(parentComponent, vnode).deactivate(
|
|
6294
|
+
vnode,
|
|
6295
|
+
parentComponent.ctx.getStorageContainer()
|
|
6296
|
+
);
|
|
6297
|
+
} else {
|
|
6298
|
+
parentComponent.ctx.deactivate(vnode);
|
|
6299
|
+
}
|
|
6090
6300
|
return;
|
|
6091
6301
|
}
|
|
6092
6302
|
const shouldInvokeDirs = shapeFlag & 1 && dirs;
|
|
@@ -6174,22 +6384,15 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6174
6384
|
removeStaticNode(vnode);
|
|
6175
6385
|
return;
|
|
6176
6386
|
}
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
transition
|
|
6181
|
-
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
const { leave, delayLeave } = transition;
|
|
6185
|
-
const performLeave = () => leave(el, performRemove);
|
|
6186
|
-
if (delayLeave) {
|
|
6187
|
-
delayLeave(vnode.el, performRemove, performLeave);
|
|
6188
|
-
} else {
|
|
6189
|
-
performLeave();
|
|
6190
|
-
}
|
|
6387
|
+
if (transition) {
|
|
6388
|
+
performTransitionLeave(
|
|
6389
|
+
el,
|
|
6390
|
+
transition,
|
|
6391
|
+
() => hostRemove(el),
|
|
6392
|
+
!!(vnode.shapeFlag & 1)
|
|
6393
|
+
);
|
|
6191
6394
|
} else {
|
|
6192
|
-
|
|
6395
|
+
hostRemove(el);
|
|
6193
6396
|
}
|
|
6194
6397
|
};
|
|
6195
6398
|
const removeFragment = (cur, end) => {
|
|
@@ -6205,27 +6408,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6205
6408
|
if (!!(process.env.NODE_ENV !== "production") && instance.type.__hmrId) {
|
|
6206
6409
|
unregisterHMR(instance);
|
|
6207
6410
|
}
|
|
6208
|
-
const {
|
|
6209
|
-
bum,
|
|
6210
|
-
scope,
|
|
6211
|
-
effect,
|
|
6212
|
-
subTree,
|
|
6213
|
-
um,
|
|
6214
|
-
m,
|
|
6215
|
-
a,
|
|
6216
|
-
parent,
|
|
6217
|
-
slots: { __: slotCacheKeys }
|
|
6218
|
-
} = instance;
|
|
6411
|
+
const { bum, scope, effect, subTree, um, m, a } = instance;
|
|
6219
6412
|
invalidateMount(m);
|
|
6220
6413
|
invalidateMount(a);
|
|
6221
6414
|
if (bum) {
|
|
6222
6415
|
invokeArrayFns(bum);
|
|
6223
6416
|
}
|
|
6224
|
-
if (parent && isArray(slotCacheKeys)) {
|
|
6225
|
-
slotCacheKeys.forEach((v) => {
|
|
6226
|
-
parent.renderCache[v] = void 0;
|
|
6227
|
-
});
|
|
6228
|
-
}
|
|
6229
6417
|
scope.stop();
|
|
6230
6418
|
if (effect) {
|
|
6231
6419
|
effect.stop();
|
|
@@ -6239,12 +6427,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6239
6427
|
void 0,
|
|
6240
6428
|
parentSuspense
|
|
6241
6429
|
);
|
|
6242
|
-
if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
|
|
6243
|
-
parentSuspense.deps--;
|
|
6244
|
-
if (parentSuspense.deps === 0) {
|
|
6245
|
-
parentSuspense.resolve();
|
|
6246
|
-
}
|
|
6247
|
-
}
|
|
6248
6430
|
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
6249
6431
|
devtoolsComponentRemoved(instance);
|
|
6250
6432
|
}
|
|
@@ -6257,7 +6439,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6257
6439
|
const getNextHostNode = (vnode) => {
|
|
6258
6440
|
if (vnode.shapeFlag & 6) {
|
|
6259
6441
|
if (vnode.type.__vapor) {
|
|
6260
|
-
return hostNextSibling(vnode.
|
|
6442
|
+
return hostNextSibling(vnode.anchor);
|
|
6261
6443
|
}
|
|
6262
6444
|
return getNextHostNode(vnode.component.subTree);
|
|
6263
6445
|
}
|
|
@@ -6335,6 +6517,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6335
6517
|
return {
|
|
6336
6518
|
render,
|
|
6337
6519
|
hydrate,
|
|
6520
|
+
hydrateNode,
|
|
6338
6521
|
internals,
|
|
6339
6522
|
createApp: createAppAPI(
|
|
6340
6523
|
mountApp,
|
|
@@ -6374,7 +6557,8 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
6374
6557
|
if (!shallow && c2.patchFlag !== -2)
|
|
6375
6558
|
traverseStaticChildren(c1, c2);
|
|
6376
6559
|
}
|
|
6377
|
-
if (c2.type === Text
|
|
6560
|
+
if (c2.type === Text && // avoid cached text nodes retaining detached dom nodes
|
|
6561
|
+
c2.patchFlag !== -1) {
|
|
6378
6562
|
c2.el = c1.el;
|
|
6379
6563
|
}
|
|
6380
6564
|
if (c2.type === Comment && !c2.el) {
|
|
@@ -6387,7 +6571,7 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
6387
6571
|
}
|
|
6388
6572
|
}
|
|
6389
6573
|
function locateNonHydratedAsyncRoot(instance) {
|
|
6390
|
-
const subComponent = instance.
|
|
6574
|
+
const subComponent = instance.subTree && instance.subTree.component;
|
|
6391
6575
|
if (subComponent) {
|
|
6392
6576
|
if (subComponent.asyncDep && !subComponent.asyncResolved) {
|
|
6393
6577
|
return subComponent;
|
|
@@ -6402,6 +6586,34 @@ function invalidateMount(hooks) {
|
|
|
6402
6586
|
hooks[i].flags |= 4;
|
|
6403
6587
|
}
|
|
6404
6588
|
}
|
|
6589
|
+
function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
|
|
6590
|
+
if (force || needTransition(parentSuspense, transition)) {
|
|
6591
|
+
transition.beforeEnter(el);
|
|
6592
|
+
insert();
|
|
6593
|
+
queuePostRenderEffect(() => transition.enter(el), void 0, parentSuspense);
|
|
6594
|
+
} else {
|
|
6595
|
+
insert();
|
|
6596
|
+
}
|
|
6597
|
+
}
|
|
6598
|
+
function performTransitionLeave(el, transition, remove, isElement = true) {
|
|
6599
|
+
const performRemove = () => {
|
|
6600
|
+
remove();
|
|
6601
|
+
if (transition && !transition.persisted && transition.afterLeave) {
|
|
6602
|
+
transition.afterLeave();
|
|
6603
|
+
}
|
|
6604
|
+
};
|
|
6605
|
+
if (isElement && transition && !transition.persisted) {
|
|
6606
|
+
const { leave, delayLeave } = transition;
|
|
6607
|
+
const performLeave = () => leave(el, performRemove);
|
|
6608
|
+
if (delayLeave) {
|
|
6609
|
+
delayLeave(el, performRemove, performLeave);
|
|
6610
|
+
} else {
|
|
6611
|
+
performLeave();
|
|
6612
|
+
}
|
|
6613
|
+
} else {
|
|
6614
|
+
performRemove();
|
|
6615
|
+
}
|
|
6616
|
+
}
|
|
6405
6617
|
function getVaporInterface(instance, vnode) {
|
|
6406
6618
|
const ctx = instance ? instance.appContext : vnode.appContext;
|
|
6407
6619
|
const res = ctx && ctx.vapor;
|
|
@@ -6416,6 +6628,32 @@ app.use(vaporInteropPlugin)
|
|
|
6416
6628
|
}
|
|
6417
6629
|
return res;
|
|
6418
6630
|
}
|
|
6631
|
+
function getInheritedScopeIds(vnode, parentComponent) {
|
|
6632
|
+
const inheritedScopeIds = [];
|
|
6633
|
+
let currentParent = parentComponent;
|
|
6634
|
+
let currentVNode = vnode;
|
|
6635
|
+
while (currentParent) {
|
|
6636
|
+
let subTree = currentParent.subTree;
|
|
6637
|
+
if (!subTree) break;
|
|
6638
|
+
if (!!(process.env.NODE_ENV !== "production") && subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
|
|
6639
|
+
subTree = filterSingleRoot(subTree.children) || subTree;
|
|
6640
|
+
}
|
|
6641
|
+
if (currentVNode === subTree || isSuspense(subTree.type) && (subTree.ssContent === currentVNode || subTree.ssFallback === currentVNode)) {
|
|
6642
|
+
const parentVNode = currentParent.vnode;
|
|
6643
|
+
if (parentVNode.scopeId) {
|
|
6644
|
+
inheritedScopeIds.push(parentVNode.scopeId);
|
|
6645
|
+
}
|
|
6646
|
+
if (parentVNode.slotScopeIds) {
|
|
6647
|
+
inheritedScopeIds.push(...parentVNode.slotScopeIds);
|
|
6648
|
+
}
|
|
6649
|
+
currentVNode = parentVNode;
|
|
6650
|
+
currentParent = currentParent.parent;
|
|
6651
|
+
} else {
|
|
6652
|
+
break;
|
|
6653
|
+
}
|
|
6654
|
+
}
|
|
6655
|
+
return inheritedScopeIds;
|
|
6656
|
+
}
|
|
6419
6657
|
|
|
6420
6658
|
const ssrContextKey = Symbol.for("v-scx");
|
|
6421
6659
|
const useSSRContext = () => {
|
|
@@ -6659,7 +6897,7 @@ function useModel(props, name, options = EMPTY_OBJ) {
|
|
|
6659
6897
|
return res;
|
|
6660
6898
|
}
|
|
6661
6899
|
const getModelModifiers = (props, modelName, getter) => {
|
|
6662
|
-
return
|
|
6900
|
+
return getter(props, getModifierPropName(modelName)) || getter(props, `${camelize(modelName)}Modifiers`) || getter(props, `${hyphenate(modelName)}Modifiers`);
|
|
6663
6901
|
};
|
|
6664
6902
|
|
|
6665
6903
|
function emit(instance, event, ...rawArgs) {
|
|
@@ -6755,8 +6993,9 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
|
|
|
6755
6993
|
function defaultPropGetter(props, key) {
|
|
6756
6994
|
return props[key];
|
|
6757
6995
|
}
|
|
6996
|
+
const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
|
|
6758
6997
|
function normalizeEmitsOptions(comp, appContext, asMixin = false) {
|
|
6759
|
-
const cache = appContext.emitsCache;
|
|
6998
|
+
const cache = __VUE_OPTIONS_API__ && asMixin ? mixinEmitsCache : appContext.emitsCache;
|
|
6760
6999
|
const cached = cache.get(comp);
|
|
6761
7000
|
if (cached !== void 0) {
|
|
6762
7001
|
return cached;
|
|
@@ -7204,7 +7443,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
7204
7443
|
const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
|
|
7205
7444
|
if (pendingBranch) {
|
|
7206
7445
|
suspense.pendingBranch = newBranch;
|
|
7207
|
-
if (isSameVNodeType(
|
|
7446
|
+
if (isSameVNodeType(pendingBranch, newBranch)) {
|
|
7208
7447
|
patch(
|
|
7209
7448
|
pendingBranch,
|
|
7210
7449
|
newBranch,
|
|
@@ -7275,7 +7514,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
7275
7514
|
);
|
|
7276
7515
|
setActiveBranch(suspense, newFallback);
|
|
7277
7516
|
}
|
|
7278
|
-
} else if (activeBranch && isSameVNodeType(
|
|
7517
|
+
} else if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
|
|
7279
7518
|
patch(
|
|
7280
7519
|
activeBranch,
|
|
7281
7520
|
newBranch,
|
|
@@ -7306,7 +7545,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
7306
7545
|
}
|
|
7307
7546
|
}
|
|
7308
7547
|
} else {
|
|
7309
|
-
if (activeBranch && isSameVNodeType(
|
|
7548
|
+
if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
|
|
7310
7549
|
patch(
|
|
7311
7550
|
activeBranch,
|
|
7312
7551
|
newBranch,
|
|
@@ -7419,7 +7658,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7419
7658
|
pendingId,
|
|
7420
7659
|
effects,
|
|
7421
7660
|
parentComponent: parentComponent2,
|
|
7422
|
-
container: container2
|
|
7661
|
+
container: container2,
|
|
7662
|
+
isInFallback
|
|
7423
7663
|
} = suspense;
|
|
7424
7664
|
let delayEnter = false;
|
|
7425
7665
|
if (suspense.isHydrating) {
|
|
@@ -7437,6 +7677,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7437
7677
|
parentComponent2
|
|
7438
7678
|
);
|
|
7439
7679
|
queuePostFlushCb(effects);
|
|
7680
|
+
if (isInFallback && vnode2.ssFallback) {
|
|
7681
|
+
vnode2.ssFallback.el = null;
|
|
7682
|
+
}
|
|
7440
7683
|
}
|
|
7441
7684
|
};
|
|
7442
7685
|
}
|
|
@@ -7445,6 +7688,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7445
7688
|
anchor = next(activeBranch);
|
|
7446
7689
|
}
|
|
7447
7690
|
unmount(activeBranch, parentComponent2, suspense, true);
|
|
7691
|
+
if (!delayEnter && isInFallback && vnode2.ssFallback) {
|
|
7692
|
+
vnode2.ssFallback.el = null;
|
|
7693
|
+
}
|
|
7448
7694
|
}
|
|
7449
7695
|
if (!delayEnter) {
|
|
7450
7696
|
move(
|
|
@@ -7569,6 +7815,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7569
7815
|
optimized2
|
|
7570
7816
|
);
|
|
7571
7817
|
if (placeholder) {
|
|
7818
|
+
vnode2.placeholder = null;
|
|
7572
7819
|
remove(placeholder);
|
|
7573
7820
|
}
|
|
7574
7821
|
updateHOCHostEl(instance, vnode2.el);
|
|
@@ -7774,15 +8021,11 @@ const createVNodeWithArgsTransform = (...args) => {
|
|
|
7774
8021
|
);
|
|
7775
8022
|
};
|
|
7776
8023
|
const normalizeKey = ({ key }) => key != null ? key : null;
|
|
7777
|
-
const normalizeRef = ({
|
|
7778
|
-
ref,
|
|
7779
|
-
ref_key,
|
|
7780
|
-
ref_for
|
|
7781
|
-
}) => {
|
|
8024
|
+
const normalizeRef = ({ ref, ref_key, ref_for }, i = currentRenderingInstance) => {
|
|
7782
8025
|
if (typeof ref === "number") {
|
|
7783
8026
|
ref = "" + ref;
|
|
7784
8027
|
}
|
|
7785
|
-
return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i
|
|
8028
|
+
return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i, r: ref, k: ref_key, f: !!ref_for } : ref : null;
|
|
7786
8029
|
};
|
|
7787
8030
|
function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
|
|
7788
8031
|
const vnode = {
|
|
@@ -7948,6 +8191,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
7948
8191
|
suspense: vnode.suspense,
|
|
7949
8192
|
ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
|
|
7950
8193
|
ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
|
|
8194
|
+
placeholder: vnode.placeholder,
|
|
7951
8195
|
el: vnode.el,
|
|
7952
8196
|
anchor: vnode.anchor,
|
|
7953
8197
|
ctx: vnode.ctx,
|
|
@@ -8107,6 +8351,25 @@ const setCurrentInstance = (instance, scope = instance !== null ? instance.scope
|
|
|
8107
8351
|
simpleSetCurrentInstance(instance);
|
|
8108
8352
|
}
|
|
8109
8353
|
};
|
|
8354
|
+
const internalOptions = ["ce", "type"];
|
|
8355
|
+
const useInstanceOption = (key, silent = false) => {
|
|
8356
|
+
const instance = getCurrentGenericInstance();
|
|
8357
|
+
if (!instance) {
|
|
8358
|
+
if (!!(process.env.NODE_ENV !== "production") && !silent) {
|
|
8359
|
+
warn$1(`useInstanceOption called without an active component instance.`);
|
|
8360
|
+
}
|
|
8361
|
+
return { hasInstance: false, value: void 0 };
|
|
8362
|
+
}
|
|
8363
|
+
if (!internalOptions.includes(key)) {
|
|
8364
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
8365
|
+
warn$1(
|
|
8366
|
+
`useInstanceOption only accepts ${internalOptions.map((k) => `'${k}'`).join(", ")} as key, got '${key}'.`
|
|
8367
|
+
);
|
|
8368
|
+
}
|
|
8369
|
+
return { hasInstance: true, value: void 0 };
|
|
8370
|
+
}
|
|
8371
|
+
return { hasInstance: true, value: instance[key] };
|
|
8372
|
+
};
|
|
8110
8373
|
|
|
8111
8374
|
const emptyAppContext = createAppContext();
|
|
8112
8375
|
let uid = 0;
|
|
@@ -8491,7 +8754,7 @@ function getComponentPublicInstance(instance) {
|
|
|
8491
8754
|
return instance.proxy;
|
|
8492
8755
|
}
|
|
8493
8756
|
}
|
|
8494
|
-
const classifyRE = /(?:^|[-_])
|
|
8757
|
+
const classifyRE = /(?:^|[-_])\w/g;
|
|
8495
8758
|
const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
|
|
8496
8759
|
function getComponentName(Component, includeInferred = true) {
|
|
8497
8760
|
return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
|
|
@@ -8527,23 +8790,28 @@ const computed = (getterOrOptions, debugOptions) => {
|
|
|
8527
8790
|
};
|
|
8528
8791
|
|
|
8529
8792
|
function h(type, propsOrChildren, children) {
|
|
8530
|
-
|
|
8531
|
-
|
|
8532
|
-
|
|
8533
|
-
|
|
8534
|
-
|
|
8793
|
+
try {
|
|
8794
|
+
setBlockTracking(-1);
|
|
8795
|
+
const l = arguments.length;
|
|
8796
|
+
if (l === 2) {
|
|
8797
|
+
if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
|
|
8798
|
+
if (isVNode(propsOrChildren)) {
|
|
8799
|
+
return createVNode(type, null, [propsOrChildren]);
|
|
8800
|
+
}
|
|
8801
|
+
return createVNode(type, propsOrChildren);
|
|
8802
|
+
} else {
|
|
8803
|
+
return createVNode(type, null, propsOrChildren);
|
|
8535
8804
|
}
|
|
8536
|
-
return createVNode(type, propsOrChildren);
|
|
8537
8805
|
} else {
|
|
8538
|
-
|
|
8539
|
-
|
|
8540
|
-
|
|
8541
|
-
|
|
8542
|
-
|
|
8543
|
-
|
|
8544
|
-
children = [children];
|
|
8806
|
+
if (l > 3) {
|
|
8807
|
+
children = Array.prototype.slice.call(arguments, 2);
|
|
8808
|
+
} else if (l === 3 && isVNode(children)) {
|
|
8809
|
+
children = [children];
|
|
8810
|
+
}
|
|
8811
|
+
return createVNode(type, propsOrChildren, children);
|
|
8545
8812
|
}
|
|
8546
|
-
|
|
8813
|
+
} finally {
|
|
8814
|
+
setBlockTracking(1);
|
|
8547
8815
|
}
|
|
8548
8816
|
}
|
|
8549
8817
|
|
|
@@ -8753,7 +9021,7 @@ function isMemoSame(cached, memo) {
|
|
|
8753
9021
|
return true;
|
|
8754
9022
|
}
|
|
8755
9023
|
|
|
8756
|
-
const version = "3.6.0-alpha.
|
|
9024
|
+
const version = "3.6.0-alpha.4";
|
|
8757
9025
|
const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
|
|
8758
9026
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
8759
9027
|
const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
|
|
@@ -8775,4 +9043,4 @@ const resolveFilter = null;
|
|
|
8775
9043
|
const compatUtils = null;
|
|
8776
9044
|
const DeprecationTypes = null;
|
|
8777
9045
|
|
|
8778
|
-
export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MoveType, Static, Suspense, Teleport, Text, assertNumber, baseEmit, baseNormalizePropsOptions, callWithAsyncErrorHandling, callWithErrorHandling, cloneVNode, compatUtils, computed, createAppAPI, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createInternalObject, createPropsRestProxy, createRenderer, createSlots, createStaticVNode, createTextVNode, createVNode, currentInstance, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, devtools, endMeasure, expose, flushOnAppMount, getCurrentInstance, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initFeatureFlags, inject, isEmitListener, isMemoSame, isRuntimeOnly, isVNode, mergeDefaults, mergeModels, mergeProps, nextTick, nextUid, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, popWarningContext, provide, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, registerHMR, registerRuntimeCompiler, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTransitionHooks, setBlockTracking, setCurrentInstance, setDevtoolsHook, setTransitionHooks, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, toHandlers, transformVNodeArgs, unregisterHMR, useAttrs, useId, useModel, useSSRContext, useSlots, useTemplateRef, useTransitionState, validateComponentName, validateProps, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withMemo, withScopeId };
|
|
9046
|
+
export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MismatchTypes, MoveType, Static, Suspense, Teleport, Text, activate, assertNumber, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, callWithAsyncErrorHandling, callWithErrorHandling, checkTransitionMode, cloneVNode, compatUtils, computed, createAppAPI, createAsyncComponentContext, createBlock, createCanSetSetupRefChecker, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createInternalObject, createPropsRestProxy, createRenderer, createSlots, createStaticVNode, createTextVNode, createVNode, currentInstance, deactivate, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, devtools, devtoolsComponentAdded, endMeasure, ensureVaporSlotFallback, expose, flushOnAppMount, getAttributeMismatch, getComponentName, getCurrentInstance, getInheritedScopeIds, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initFeatureFlags, inject, isAsyncWrapper, isEmitListener, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isRuntimeOnly, isSetEqual, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isVNode, isValidHtmlOrSvgAttribute, leaveCbKey, markAsyncBoundary, matches, mergeDefaults, mergeModels, mergeProps, nextTick, nextUid, normalizeRef, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onServerPrefetch, onUnmounted, onUpdated, openBlock, performAsyncHydrate, performTransitionEnter, performTransitionLeave, popScopeId, popWarningContext, provide, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, registerHMR, registerRuntimeCompiler, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionHooks, setBlockTracking, setCurrentInstance, setDevtoolsHook, setRef, setTransitionHooks, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, toClassSet, toHandlers, toStyleMap, transformVNodeArgs, unregisterHMR, useAsyncComponentState, useAttrs, useId, useInstanceOption, useModel, useSSRContext, useSlots, useTemplateRef, useTransitionState, validateComponentName, validateProps, version, warn, warnPropMismatch, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withMemo, withScopeId };
|