@vue/compat 3.6.0-alpha.2 → 3.6.0-alpha.3
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/README.md +0 -1
- package/dist/vue.cjs.js +1028 -690
- package/dist/vue.cjs.prod.js +896 -580
- package/dist/vue.esm-browser.js +961 -668
- package/dist/vue.esm-browser.prod.js +10 -9
- package/dist/vue.esm-bundler.js +1022 -670
- package/dist/vue.global.js +961 -668
- package/dist/vue.global.prod.js +10 -9
- package/dist/vue.runtime.esm-browser.js +961 -668
- package/dist/vue.runtime.esm-browser.prod.js +10 -9
- package/dist/vue.runtime.esm-bundler.js +1022 -670
- package/dist/vue.runtime.global.js +961 -668
- package/dist/vue.runtime.global.prod.js +10 -9
- package/package.json +3 -3
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compat v3.6.0-alpha.
|
|
2
|
+
* @vue/compat v3.6.0-alpha.3
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
6
|
-
/*! #__NO_SIDE_EFFECTS__ */
|
|
7
6
|
// @__NO_SIDE_EFFECTS__
|
|
8
7
|
function makeMap(str) {
|
|
9
8
|
const map = /* @__PURE__ */ Object.create(null);
|
|
@@ -59,10 +58,10 @@ const isBuiltInDirective = /* @__PURE__ */ makeMap(
|
|
|
59
58
|
);
|
|
60
59
|
const cacheStringFunction = (fn) => {
|
|
61
60
|
const cache = /* @__PURE__ */ Object.create(null);
|
|
62
|
-
return (str) => {
|
|
61
|
+
return ((str) => {
|
|
63
62
|
const hit = cache[str];
|
|
64
63
|
return hit || (cache[str] = fn(str));
|
|
65
|
-
};
|
|
64
|
+
});
|
|
66
65
|
};
|
|
67
66
|
const camelizeRE = /-(\w)/g;
|
|
68
67
|
const camelizeReplacer = (_, c) => c ? c.toUpperCase() : "";
|
|
@@ -308,6 +307,9 @@ function shouldSetAsAttr(tagName, key) {
|
|
|
308
307
|
if ((key === "width" || key === "height") && (tagName === "IMG" || tagName === "VIDEO" || tagName === "CANVAS" || tagName === "SOURCE")) {
|
|
309
308
|
return true;
|
|
310
309
|
}
|
|
310
|
+
if (key === "sandbox" && tagName === "IFRAME") {
|
|
311
|
+
return true;
|
|
312
|
+
}
|
|
311
313
|
return false;
|
|
312
314
|
}
|
|
313
315
|
|
|
@@ -497,6 +499,7 @@ var ReactiveFlags = /* @__PURE__ */ ((ReactiveFlags2) => {
|
|
|
497
499
|
const notifyBuffer = [];
|
|
498
500
|
let batchDepth = 0;
|
|
499
501
|
let activeSub = void 0;
|
|
502
|
+
let globalVersion = 0;
|
|
500
503
|
let notifyIndex = 0;
|
|
501
504
|
let notifyBufferLength = 0;
|
|
502
505
|
function setActiveSub(sub) {
|
|
@@ -519,17 +522,18 @@ function link(dep, sub) {
|
|
|
519
522
|
if (prevDep !== void 0 && prevDep.dep === dep) {
|
|
520
523
|
return;
|
|
521
524
|
}
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
sub.depsTail = nextDep;
|
|
528
|
-
return;
|
|
529
|
-
}
|
|
525
|
+
const nextDep = prevDep !== void 0 ? prevDep.nextDep : sub.deps;
|
|
526
|
+
if (nextDep !== void 0 && nextDep.dep === dep) {
|
|
527
|
+
nextDep.version = globalVersion;
|
|
528
|
+
sub.depsTail = nextDep;
|
|
529
|
+
return;
|
|
530
530
|
}
|
|
531
531
|
const prevSub = dep.subsTail;
|
|
532
|
+
if (prevSub !== void 0 && prevSub.version === globalVersion && prevSub.sub === sub) {
|
|
533
|
+
return;
|
|
534
|
+
}
|
|
532
535
|
const newLink = sub.depsTail = dep.subsTail = {
|
|
536
|
+
version: globalVersion,
|
|
533
537
|
dep,
|
|
534
538
|
sub,
|
|
535
539
|
prevDep,
|
|
@@ -635,6 +639,7 @@ function propagate(link2) {
|
|
|
635
639
|
} while (true);
|
|
636
640
|
}
|
|
637
641
|
function startTracking(sub) {
|
|
642
|
+
++globalVersion;
|
|
638
643
|
sub.depsTail = void 0;
|
|
639
644
|
sub.flags = sub.flags & -57 | 4 /* RecursedCheck */;
|
|
640
645
|
return setActiveSub(sub);
|
|
@@ -735,18 +740,12 @@ function shallowPropagate(link2) {
|
|
|
735
740
|
} while (link2 !== void 0);
|
|
736
741
|
}
|
|
737
742
|
function isValidLink(checkLink, sub) {
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
}
|
|
745
|
-
if (link2 === depsTail) {
|
|
746
|
-
break;
|
|
747
|
-
}
|
|
748
|
-
link2 = link2.nextDep;
|
|
749
|
-
} while (link2 !== void 0);
|
|
743
|
+
let link2 = sub.depsTail;
|
|
744
|
+
while (link2 !== void 0) {
|
|
745
|
+
if (link2 === checkLink) {
|
|
746
|
+
return true;
|
|
747
|
+
}
|
|
748
|
+
link2 = link2.prevDep;
|
|
750
749
|
}
|
|
751
750
|
return false;
|
|
752
751
|
}
|
|
@@ -986,7 +985,7 @@ const arrayInstrumentations = {
|
|
|
986
985
|
join(separator) {
|
|
987
986
|
return reactiveReadArray(this).join(separator);
|
|
988
987
|
},
|
|
989
|
-
// keys() iterator only reads `length`, no
|
|
988
|
+
// keys() iterator only reads `length`, no optimization required
|
|
990
989
|
lastIndexOf(...args) {
|
|
991
990
|
return searchProxy(this, "lastIndexOf", args);
|
|
992
991
|
},
|
|
@@ -1038,7 +1037,7 @@ function iterator(self, method, wrapValue) {
|
|
|
1038
1037
|
iter._next = iter.next;
|
|
1039
1038
|
iter.next = () => {
|
|
1040
1039
|
const result = iter._next();
|
|
1041
|
-
if (result.
|
|
1040
|
+
if (!result.done) {
|
|
1042
1041
|
result.value = wrapValue(result.value);
|
|
1043
1042
|
}
|
|
1044
1043
|
return result;
|
|
@@ -1169,7 +1168,8 @@ class BaseReactiveHandler {
|
|
|
1169
1168
|
return res;
|
|
1170
1169
|
}
|
|
1171
1170
|
if (isRef(res)) {
|
|
1172
|
-
|
|
1171
|
+
const value = targetIsArray && isIntegerKey(key) ? res : res.value;
|
|
1172
|
+
return isReadonly2 && isObject(value) ? readonly(value) : value;
|
|
1173
1173
|
}
|
|
1174
1174
|
if (isObject(res)) {
|
|
1175
1175
|
return isReadonly2 ? readonly(res) : reactive(res);
|
|
@@ -1191,7 +1191,13 @@ class MutableReactiveHandler extends BaseReactiveHandler {
|
|
|
1191
1191
|
}
|
|
1192
1192
|
if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
|
|
1193
1193
|
if (isOldValueReadonly) {
|
|
1194
|
-
|
|
1194
|
+
{
|
|
1195
|
+
warn$2(
|
|
1196
|
+
`Set operation on key "${String(key)}" failed: target is readonly.`,
|
|
1197
|
+
target[key]
|
|
1198
|
+
);
|
|
1199
|
+
}
|
|
1200
|
+
return true;
|
|
1195
1201
|
} else {
|
|
1196
1202
|
oldValue.value = value;
|
|
1197
1203
|
return true;
|
|
@@ -1336,7 +1342,7 @@ function createInstrumentations(readonly, shallow) {
|
|
|
1336
1342
|
get size() {
|
|
1337
1343
|
const target = this["__v_raw"];
|
|
1338
1344
|
!readonly && track(toRaw(target), "iterate", ITERATE_KEY);
|
|
1339
|
-
return
|
|
1345
|
+
return target.size;
|
|
1340
1346
|
},
|
|
1341
1347
|
has(key) {
|
|
1342
1348
|
const target = this["__v_raw"];
|
|
@@ -2339,11 +2345,11 @@ function traverse(value, depth = Infinity, seen) {
|
|
|
2339
2345
|
if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
|
|
2340
2346
|
return value;
|
|
2341
2347
|
}
|
|
2342
|
-
seen = seen || /* @__PURE__ */ new
|
|
2343
|
-
if (seen.
|
|
2348
|
+
seen = seen || /* @__PURE__ */ new Map();
|
|
2349
|
+
if ((seen.get(value) || 0) >= depth) {
|
|
2344
2350
|
return value;
|
|
2345
2351
|
}
|
|
2346
|
-
seen.
|
|
2352
|
+
seen.set(value, depth);
|
|
2347
2353
|
depth--;
|
|
2348
2354
|
if (isRef(value)) {
|
|
2349
2355
|
traverse(value.value, depth, seen);
|
|
@@ -2889,8 +2895,10 @@ function rerender(id, newRender) {
|
|
|
2889
2895
|
instance.hmrRerender();
|
|
2890
2896
|
} else {
|
|
2891
2897
|
const i = instance;
|
|
2892
|
-
i.
|
|
2893
|
-
|
|
2898
|
+
if (!(i.effect.flags & 1024)) {
|
|
2899
|
+
i.renderCache = [];
|
|
2900
|
+
i.effect.run();
|
|
2901
|
+
}
|
|
2894
2902
|
}
|
|
2895
2903
|
nextTick(() => {
|
|
2896
2904
|
isHmrUpdating = false;
|
|
@@ -2932,7 +2940,10 @@ function reload(id, newComp) {
|
|
|
2932
2940
|
if (parent.vapor) {
|
|
2933
2941
|
parent.hmrRerender();
|
|
2934
2942
|
} else {
|
|
2935
|
-
parent.effect.
|
|
2943
|
+
if (!(parent.effect.flags & 1024)) {
|
|
2944
|
+
parent.renderCache = [];
|
|
2945
|
+
parent.effect.run();
|
|
2946
|
+
}
|
|
2936
2947
|
}
|
|
2937
2948
|
nextTick(() => {
|
|
2938
2949
|
isHmrUpdating = false;
|
|
@@ -3042,7 +3053,6 @@ const devtoolsComponentRemoved = (component) => {
|
|
|
3042
3053
|
_devtoolsComponentRemoved(component);
|
|
3043
3054
|
}
|
|
3044
3055
|
};
|
|
3045
|
-
/*! #__NO_SIDE_EFFECTS__ */
|
|
3046
3056
|
// @__NO_SIDE_EFFECTS__
|
|
3047
3057
|
function createDevtoolsComponentHook(hook) {
|
|
3048
3058
|
return (component) => {
|
|
@@ -3756,9 +3766,6 @@ const TeleportImpl = {
|
|
|
3756
3766
|
insert(mainAnchor, container, anchor);
|
|
3757
3767
|
const mount = (container2, anchor2) => {
|
|
3758
3768
|
if (shapeFlag & 16) {
|
|
3759
|
-
if (parentComponent && parentComponent.isCE) {
|
|
3760
|
-
parentComponent.ce._teleportTarget = container2;
|
|
3761
|
-
}
|
|
3762
3769
|
mountChildren(
|
|
3763
3770
|
children,
|
|
3764
3771
|
container2,
|
|
@@ -3780,6 +3787,9 @@ const TeleportImpl = {
|
|
|
3780
3787
|
} else if (namespace !== "mathml" && isTargetMathML(target)) {
|
|
3781
3788
|
namespace = "mathml";
|
|
3782
3789
|
}
|
|
3790
|
+
if (parentComponent && parentComponent.isCE) {
|
|
3791
|
+
(parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
|
|
3792
|
+
}
|
|
3783
3793
|
if (!disabled) {
|
|
3784
3794
|
mount(target, targetAnchor);
|
|
3785
3795
|
updateCssVars(n2, false);
|
|
@@ -3980,26 +3990,34 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
|
|
|
3980
3990
|
function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
|
|
3981
3991
|
o: { nextSibling, parentNode, querySelector, insert, createText }
|
|
3982
3992
|
}, hydrateChildren) {
|
|
3993
|
+
function hydrateDisabledTeleport(node2, vnode2, targetStart, targetAnchor) {
|
|
3994
|
+
vnode2.anchor = hydrateChildren(
|
|
3995
|
+
nextSibling(node2),
|
|
3996
|
+
vnode2,
|
|
3997
|
+
parentNode(node2),
|
|
3998
|
+
parentComponent,
|
|
3999
|
+
parentSuspense,
|
|
4000
|
+
slotScopeIds,
|
|
4001
|
+
optimized
|
|
4002
|
+
);
|
|
4003
|
+
vnode2.targetStart = targetStart;
|
|
4004
|
+
vnode2.targetAnchor = targetAnchor;
|
|
4005
|
+
}
|
|
3983
4006
|
const target = vnode.target = resolveTarget(
|
|
3984
4007
|
vnode.props,
|
|
3985
4008
|
querySelector
|
|
3986
4009
|
);
|
|
4010
|
+
const disabled = isTeleportDisabled(vnode.props);
|
|
3987
4011
|
if (target) {
|
|
3988
|
-
const disabled = isTeleportDisabled(vnode.props);
|
|
3989
4012
|
const targetNode = target._lpa || target.firstChild;
|
|
3990
4013
|
if (vnode.shapeFlag & 16) {
|
|
3991
4014
|
if (disabled) {
|
|
3992
|
-
|
|
3993
|
-
|
|
4015
|
+
hydrateDisabledTeleport(
|
|
4016
|
+
node,
|
|
3994
4017
|
vnode,
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
parentSuspense,
|
|
3998
|
-
slotScopeIds,
|
|
3999
|
-
optimized
|
|
4018
|
+
targetNode,
|
|
4019
|
+
targetNode && nextSibling(targetNode)
|
|
4000
4020
|
);
|
|
4001
|
-
vnode.targetStart = targetNode;
|
|
4002
|
-
vnode.targetAnchor = targetNode && nextSibling(targetNode);
|
|
4003
4021
|
} else {
|
|
4004
4022
|
vnode.anchor = nextSibling(node);
|
|
4005
4023
|
let targetAnchor = targetNode;
|
|
@@ -4030,6 +4048,10 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
4030
4048
|
}
|
|
4031
4049
|
}
|
|
4032
4050
|
updateCssVars(vnode, disabled);
|
|
4051
|
+
} else if (disabled) {
|
|
4052
|
+
if (vnode.shapeFlag & 16) {
|
|
4053
|
+
hydrateDisabledTeleport(node, vnode, node, nextSibling(node));
|
|
4054
|
+
}
|
|
4033
4055
|
}
|
|
4034
4056
|
return vnode.anchor && nextSibling(vnode.anchor);
|
|
4035
4057
|
}
|
|
@@ -4070,7 +4092,7 @@ function useTransitionState() {
|
|
|
4070
4092
|
isMounted: false,
|
|
4071
4093
|
isLeaving: false,
|
|
4072
4094
|
isUnmounting: false,
|
|
4073
|
-
|
|
4095
|
+
leavingNodes: /* @__PURE__ */ new Map()
|
|
4074
4096
|
};
|
|
4075
4097
|
onMounted(() => {
|
|
4076
4098
|
state.isMounted = true;
|
|
@@ -4102,7 +4124,7 @@ const BaseTransitionPropsValidators = {
|
|
|
4102
4124
|
onAppearCancelled: TransitionHookValidator
|
|
4103
4125
|
};
|
|
4104
4126
|
const recursiveGetSubtree = (instance) => {
|
|
4105
|
-
const subTree = instance.subTree;
|
|
4127
|
+
const subTree = instance.type.__vapor ? instance.block : instance.subTree;
|
|
4106
4128
|
return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
|
|
4107
4129
|
};
|
|
4108
4130
|
const BaseTransitionImpl = {
|
|
@@ -4119,9 +4141,7 @@ const BaseTransitionImpl = {
|
|
|
4119
4141
|
const child = findNonCommentChild(children);
|
|
4120
4142
|
const rawProps = toRaw(props);
|
|
4121
4143
|
const { mode } = rawProps;
|
|
4122
|
-
|
|
4123
|
-
warn$1(`invalid <transition> mode: ${mode}`);
|
|
4124
|
-
}
|
|
4144
|
+
checkTransitionMode(mode);
|
|
4125
4145
|
if (state.isLeaving) {
|
|
4126
4146
|
return emptyPlaceholder(child);
|
|
4127
4147
|
}
|
|
@@ -4141,7 +4161,7 @@ const BaseTransitionImpl = {
|
|
|
4141
4161
|
setTransitionHooks(innerChild, enterHooks);
|
|
4142
4162
|
}
|
|
4143
4163
|
let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
|
|
4144
|
-
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(
|
|
4164
|
+
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
|
|
4145
4165
|
let leavingHooks = resolveTransitionHooks(
|
|
4146
4166
|
oldInnerChild,
|
|
4147
4167
|
rawProps,
|
|
@@ -4213,15 +4233,53 @@ function findNonCommentChild(children) {
|
|
|
4213
4233
|
}
|
|
4214
4234
|
const BaseTransition = BaseTransitionImpl;
|
|
4215
4235
|
function getLeavingNodesForType(state, vnode) {
|
|
4216
|
-
const {
|
|
4217
|
-
let leavingVNodesCache =
|
|
4236
|
+
const { leavingNodes } = state;
|
|
4237
|
+
let leavingVNodesCache = leavingNodes.get(vnode.type);
|
|
4218
4238
|
if (!leavingVNodesCache) {
|
|
4219
4239
|
leavingVNodesCache = /* @__PURE__ */ Object.create(null);
|
|
4220
|
-
|
|
4240
|
+
leavingNodes.set(vnode.type, leavingVNodesCache);
|
|
4221
4241
|
}
|
|
4222
4242
|
return leavingVNodesCache;
|
|
4223
4243
|
}
|
|
4224
4244
|
function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
4245
|
+
const key = String(vnode.key);
|
|
4246
|
+
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
4247
|
+
const context = {
|
|
4248
|
+
setLeavingNodeCache: () => {
|
|
4249
|
+
leavingVNodesCache[key] = vnode;
|
|
4250
|
+
},
|
|
4251
|
+
unsetLeavingNodeCache: () => {
|
|
4252
|
+
if (leavingVNodesCache[key] === vnode) {
|
|
4253
|
+
delete leavingVNodesCache[key];
|
|
4254
|
+
}
|
|
4255
|
+
},
|
|
4256
|
+
earlyRemove: () => {
|
|
4257
|
+
const leavingVNode = leavingVNodesCache[key];
|
|
4258
|
+
if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
|
|
4259
|
+
leavingVNode.el[leaveCbKey]();
|
|
4260
|
+
}
|
|
4261
|
+
},
|
|
4262
|
+
cloneHooks: (vnode2) => {
|
|
4263
|
+
const hooks = resolveTransitionHooks(
|
|
4264
|
+
vnode2,
|
|
4265
|
+
props,
|
|
4266
|
+
state,
|
|
4267
|
+
instance,
|
|
4268
|
+
postClone
|
|
4269
|
+
);
|
|
4270
|
+
if (postClone) postClone(hooks);
|
|
4271
|
+
return hooks;
|
|
4272
|
+
}
|
|
4273
|
+
};
|
|
4274
|
+
return baseResolveTransitionHooks(context, props, state, instance);
|
|
4275
|
+
}
|
|
4276
|
+
function baseResolveTransitionHooks(context, props, state, instance) {
|
|
4277
|
+
const {
|
|
4278
|
+
setLeavingNodeCache,
|
|
4279
|
+
unsetLeavingNodeCache,
|
|
4280
|
+
earlyRemove,
|
|
4281
|
+
cloneHooks
|
|
4282
|
+
} = context;
|
|
4225
4283
|
const {
|
|
4226
4284
|
appear,
|
|
4227
4285
|
mode,
|
|
@@ -4239,8 +4297,6 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
4239
4297
|
onAfterAppear,
|
|
4240
4298
|
onAppearCancelled
|
|
4241
4299
|
} = props;
|
|
4242
|
-
const key = String(vnode.key);
|
|
4243
|
-
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
4244
4300
|
const callHook = (hook, args) => {
|
|
4245
4301
|
hook && callWithAsyncErrorHandling(
|
|
4246
4302
|
hook,
|
|
@@ -4276,10 +4332,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
4276
4332
|
/* cancelled */
|
|
4277
4333
|
);
|
|
4278
4334
|
}
|
|
4279
|
-
|
|
4280
|
-
if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
|
|
4281
|
-
leavingVNode.el[leaveCbKey]();
|
|
4282
|
-
}
|
|
4335
|
+
earlyRemove();
|
|
4283
4336
|
callHook(hook, [el]);
|
|
4284
4337
|
},
|
|
4285
4338
|
enter(el) {
|
|
@@ -4316,7 +4369,6 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
4316
4369
|
}
|
|
4317
4370
|
},
|
|
4318
4371
|
leave(el, remove) {
|
|
4319
|
-
const key2 = String(vnode.key);
|
|
4320
4372
|
if (el[enterCbKey$1]) {
|
|
4321
4373
|
el[enterCbKey$1](
|
|
4322
4374
|
true
|
|
@@ -4338,27 +4390,17 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
4338
4390
|
callHook(onAfterLeave, [el]);
|
|
4339
4391
|
}
|
|
4340
4392
|
el[leaveCbKey] = void 0;
|
|
4341
|
-
|
|
4342
|
-
delete leavingVNodesCache[key2];
|
|
4343
|
-
}
|
|
4393
|
+
unsetLeavingNodeCache(el);
|
|
4344
4394
|
};
|
|
4345
|
-
|
|
4395
|
+
setLeavingNodeCache(el);
|
|
4346
4396
|
if (onLeave) {
|
|
4347
4397
|
callAsyncHook(onLeave, [el, done]);
|
|
4348
4398
|
} else {
|
|
4349
4399
|
done();
|
|
4350
4400
|
}
|
|
4351
4401
|
},
|
|
4352
|
-
clone(
|
|
4353
|
-
|
|
4354
|
-
vnode2,
|
|
4355
|
-
props,
|
|
4356
|
-
state,
|
|
4357
|
-
instance,
|
|
4358
|
-
postClone
|
|
4359
|
-
);
|
|
4360
|
-
if (postClone) postClone(hooks2);
|
|
4361
|
-
return hooks2;
|
|
4402
|
+
clone(node) {
|
|
4403
|
+
return cloneHooks(node);
|
|
4362
4404
|
}
|
|
4363
4405
|
};
|
|
4364
4406
|
return hooks;
|
|
@@ -4392,8 +4434,15 @@ function getInnerChild$1(vnode) {
|
|
|
4392
4434
|
}
|
|
4393
4435
|
function setTransitionHooks(vnode, hooks) {
|
|
4394
4436
|
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
4395
|
-
vnode.
|
|
4396
|
-
|
|
4437
|
+
if (vnode.type.__vapor) {
|
|
4438
|
+
getVaporInterface(vnode.component, vnode).setTransitionHooks(
|
|
4439
|
+
vnode.component,
|
|
4440
|
+
hooks
|
|
4441
|
+
);
|
|
4442
|
+
} else {
|
|
4443
|
+
vnode.transition = hooks;
|
|
4444
|
+
setTransitionHooks(vnode.component.subTree, hooks);
|
|
4445
|
+
}
|
|
4397
4446
|
} else if (vnode.shapeFlag & 128) {
|
|
4398
4447
|
vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
4399
4448
|
vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
@@ -4423,8 +4472,12 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
|
4423
4472
|
}
|
|
4424
4473
|
return ret;
|
|
4425
4474
|
}
|
|
4475
|
+
function checkTransitionMode(mode) {
|
|
4476
|
+
if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
|
|
4477
|
+
warn$1(`invalid <transition> mode: ${mode}`);
|
|
4478
|
+
}
|
|
4479
|
+
}
|
|
4426
4480
|
|
|
4427
|
-
/*! #__NO_SIDE_EFFECTS__ */
|
|
4428
4481
|
// @__NO_SIDE_EFFECTS__
|
|
4429
4482
|
function defineComponent(options, extraOptions) {
|
|
4430
4483
|
return isFunction(options) ? (
|
|
@@ -4477,6 +4530,7 @@ function useTemplateRef(key) {
|
|
|
4477
4530
|
return ret;
|
|
4478
4531
|
}
|
|
4479
4532
|
|
|
4533
|
+
const pendingSetRefMap = /* @__PURE__ */ new WeakMap();
|
|
4480
4534
|
function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
4481
4535
|
if (isArray(rawRef)) {
|
|
4482
4536
|
rawRef.forEach(
|
|
@@ -4508,28 +4562,23 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
4508
4562
|
const oldRef = oldRawRef && oldRawRef.r;
|
|
4509
4563
|
const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
|
|
4510
4564
|
const setupState = owner.setupState;
|
|
4511
|
-
const
|
|
4512
|
-
const
|
|
4513
|
-
|
|
4514
|
-
if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
|
|
4515
|
-
warn$1(
|
|
4516
|
-
`Template ref "${key}" used on a non-ref value. It will not work in the production build.`
|
|
4517
|
-
);
|
|
4518
|
-
}
|
|
4519
|
-
if (knownTemplateRefs.has(rawSetupState[key])) {
|
|
4520
|
-
return false;
|
|
4521
|
-
}
|
|
4522
|
-
}
|
|
4523
|
-
return hasOwn(rawSetupState, key);
|
|
4565
|
+
const canSetSetupRef = createCanSetSetupRefChecker(setupState);
|
|
4566
|
+
const canSetRef = (ref2) => {
|
|
4567
|
+
return !knownTemplateRefs.has(ref2);
|
|
4524
4568
|
};
|
|
4525
4569
|
if (oldRef != null && oldRef !== ref) {
|
|
4570
|
+
invalidatePendingSetRef(oldRawRef);
|
|
4526
4571
|
if (isString(oldRef)) {
|
|
4527
4572
|
refs[oldRef] = null;
|
|
4528
4573
|
if (canSetSetupRef(oldRef)) {
|
|
4529
4574
|
setupState[oldRef] = null;
|
|
4530
4575
|
}
|
|
4531
4576
|
} else if (isRef(oldRef)) {
|
|
4532
|
-
oldRef
|
|
4577
|
+
if (canSetRef(oldRef)) {
|
|
4578
|
+
oldRef.value = null;
|
|
4579
|
+
}
|
|
4580
|
+
const oldRawRefAtom = oldRawRef;
|
|
4581
|
+
if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null;
|
|
4533
4582
|
}
|
|
4534
4583
|
}
|
|
4535
4584
|
if (isFunction(ref)) {
|
|
@@ -4540,7 +4589,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
4540
4589
|
if (_isString || _isRef) {
|
|
4541
4590
|
const doSet = () => {
|
|
4542
4591
|
if (rawRef.f) {
|
|
4543
|
-
const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value;
|
|
4592
|
+
const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
|
|
4544
4593
|
if (isUnmount) {
|
|
4545
4594
|
isArray(existing) && remove(existing, refValue);
|
|
4546
4595
|
} else {
|
|
@@ -4551,8 +4600,11 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
4551
4600
|
setupState[ref] = refs[ref];
|
|
4552
4601
|
}
|
|
4553
4602
|
} else {
|
|
4554
|
-
|
|
4555
|
-
if (
|
|
4603
|
+
const newVal = [refValue];
|
|
4604
|
+
if (canSetRef(ref)) {
|
|
4605
|
+
ref.value = newVal;
|
|
4606
|
+
}
|
|
4607
|
+
if (rawRef.k) refs[rawRef.k] = newVal;
|
|
4556
4608
|
}
|
|
4557
4609
|
} else if (!existing.includes(refValue)) {
|
|
4558
4610
|
existing.push(refValue);
|
|
@@ -4564,15 +4616,23 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
4564
4616
|
setupState[ref] = value;
|
|
4565
4617
|
}
|
|
4566
4618
|
} else if (_isRef) {
|
|
4567
|
-
ref
|
|
4619
|
+
if (canSetRef(ref)) {
|
|
4620
|
+
ref.value = value;
|
|
4621
|
+
}
|
|
4568
4622
|
if (rawRef.k) refs[rawRef.k] = value;
|
|
4569
4623
|
} else {
|
|
4570
4624
|
warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
|
|
4571
4625
|
}
|
|
4572
4626
|
};
|
|
4573
4627
|
if (value) {
|
|
4574
|
-
|
|
4628
|
+
const job = () => {
|
|
4629
|
+
doSet();
|
|
4630
|
+
pendingSetRefMap.delete(rawRef);
|
|
4631
|
+
};
|
|
4632
|
+
pendingSetRefMap.set(rawRef, job);
|
|
4633
|
+
queuePostRenderEffect(job, -1, parentSuspense);
|
|
4575
4634
|
} else {
|
|
4635
|
+
invalidatePendingSetRef(rawRef);
|
|
4576
4636
|
doSet();
|
|
4577
4637
|
}
|
|
4578
4638
|
} else {
|
|
@@ -4580,6 +4640,29 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
4580
4640
|
}
|
|
4581
4641
|
}
|
|
4582
4642
|
}
|
|
4643
|
+
function createCanSetSetupRefChecker(setupState) {
|
|
4644
|
+
const rawSetupState = toRaw(setupState);
|
|
4645
|
+
return setupState === void 0 || setupState === EMPTY_OBJ ? NO : (key) => {
|
|
4646
|
+
{
|
|
4647
|
+
if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
|
|
4648
|
+
warn$1(
|
|
4649
|
+
`Template ref "${key}" used on a non-ref value. It will not work in the production build.`
|
|
4650
|
+
);
|
|
4651
|
+
}
|
|
4652
|
+
if (knownTemplateRefs.has(rawSetupState[key])) {
|
|
4653
|
+
return false;
|
|
4654
|
+
}
|
|
4655
|
+
}
|
|
4656
|
+
return hasOwn(rawSetupState, key);
|
|
4657
|
+
};
|
|
4658
|
+
}
|
|
4659
|
+
function invalidatePendingSetRef(rawRef) {
|
|
4660
|
+
const pendingSetRef = pendingSetRefMap.get(rawRef);
|
|
4661
|
+
if (pendingSetRef) {
|
|
4662
|
+
pendingSetRef.flags |= 4;
|
|
4663
|
+
pendingSetRefMap.delete(rawRef);
|
|
4664
|
+
}
|
|
4665
|
+
}
|
|
4583
4666
|
|
|
4584
4667
|
let hasLoggedMismatchError = false;
|
|
4585
4668
|
const logMismatchError = () => {
|
|
@@ -4676,7 +4759,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4676
4759
|
}
|
|
4677
4760
|
break;
|
|
4678
4761
|
case Comment:
|
|
4679
|
-
if (isTemplateNode(node)) {
|
|
4762
|
+
if (isTemplateNode$1(node)) {
|
|
4680
4763
|
nextNode = nextSibling(node);
|
|
4681
4764
|
replaceNode(
|
|
4682
4765
|
vnode.el = node.content.firstChild,
|
|
@@ -4724,9 +4807,15 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4724
4807
|
);
|
|
4725
4808
|
}
|
|
4726
4809
|
break;
|
|
4810
|
+
case VaporSlot:
|
|
4811
|
+
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(
|
|
4812
|
+
vnode,
|
|
4813
|
+
node
|
|
4814
|
+
);
|
|
4815
|
+
break;
|
|
4727
4816
|
default:
|
|
4728
4817
|
if (shapeFlag & 1) {
|
|
4729
|
-
if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
|
|
4818
|
+
if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode$1(node)) {
|
|
4730
4819
|
nextNode = onMismatch();
|
|
4731
4820
|
} else {
|
|
4732
4821
|
nextNode = hydrateElement(
|
|
@@ -4739,9 +4828,6 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4739
4828
|
);
|
|
4740
4829
|
}
|
|
4741
4830
|
} else if (shapeFlag & 6) {
|
|
4742
|
-
if (vnode.type.__vapor) {
|
|
4743
|
-
throw new Error("Vapor component hydration is not supported yet.");
|
|
4744
|
-
}
|
|
4745
4831
|
vnode.slotScopeIds = slotScopeIds;
|
|
4746
4832
|
const container = parentNode(node);
|
|
4747
4833
|
if (isFragmentStart) {
|
|
@@ -4751,15 +4837,25 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4751
4837
|
} else {
|
|
4752
4838
|
nextNode = nextSibling(node);
|
|
4753
4839
|
}
|
|
4754
|
-
|
|
4755
|
-
vnode
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4840
|
+
if (vnode.type.__vapor) {
|
|
4841
|
+
getVaporInterface(parentComponent, vnode).hydrate(
|
|
4842
|
+
vnode,
|
|
4843
|
+
node,
|
|
4844
|
+
container,
|
|
4845
|
+
null,
|
|
4846
|
+
parentComponent
|
|
4847
|
+
);
|
|
4848
|
+
} else {
|
|
4849
|
+
mountComponent(
|
|
4850
|
+
vnode,
|
|
4851
|
+
container,
|
|
4852
|
+
null,
|
|
4853
|
+
parentComponent,
|
|
4854
|
+
parentSuspense,
|
|
4855
|
+
getContainerType(container),
|
|
4856
|
+
optimized
|
|
4857
|
+
);
|
|
4858
|
+
}
|
|
4763
4859
|
if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
|
|
4764
4860
|
let subTree;
|
|
4765
4861
|
if (isFragmentStart) {
|
|
@@ -4816,7 +4912,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4816
4912
|
invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
4817
4913
|
}
|
|
4818
4914
|
let needCallTransitionHooks = false;
|
|
4819
|
-
if (isTemplateNode(el)) {
|
|
4915
|
+
if (isTemplateNode$1(el)) {
|
|
4820
4916
|
needCallTransitionHooks = needTransition(
|
|
4821
4917
|
null,
|
|
4822
4918
|
// no need check parentSuspense in hydration
|
|
@@ -4844,7 +4940,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4844
4940
|
);
|
|
4845
4941
|
let hasWarned = false;
|
|
4846
4942
|
while (next) {
|
|
4847
|
-
if (!isMismatchAllowed(el, 1
|
|
4943
|
+
if (!isMismatchAllowed(el, 1)) {
|
|
4848
4944
|
if (!hasWarned) {
|
|
4849
4945
|
warn$1(
|
|
4850
4946
|
`Hydration children mismatch on`,
|
|
@@ -4865,14 +4961,16 @@ Server rendered element contains more child nodes than client vdom.`
|
|
|
4865
4961
|
if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
|
|
4866
4962
|
clientText = clientText.slice(1);
|
|
4867
4963
|
}
|
|
4868
|
-
|
|
4869
|
-
|
|
4964
|
+
const { textContent } = el;
|
|
4965
|
+
if (textContent !== clientText && // innerHTML normalize \r\n or \r into a single \n in the DOM
|
|
4966
|
+
textContent !== clientText.replace(/\r\n|\r/g, "\n")) {
|
|
4967
|
+
if (!isMismatchAllowed(el, 0)) {
|
|
4870
4968
|
warn$1(
|
|
4871
4969
|
`Hydration text content mismatch on`,
|
|
4872
4970
|
el,
|
|
4873
4971
|
`
|
|
4874
|
-
- rendered on server: ${
|
|
4875
|
-
- expected on client: ${
|
|
4972
|
+
- rendered on server: ${textContent}
|
|
4973
|
+
- expected on client: ${clientText}`
|
|
4876
4974
|
);
|
|
4877
4975
|
logMismatchError();
|
|
4878
4976
|
}
|
|
@@ -4948,7 +5046,7 @@ Server rendered element contains more child nodes than client vdom.`
|
|
|
4948
5046
|
} else if (isText && !vnode.children) {
|
|
4949
5047
|
insert(vnode.el = createText(""), container);
|
|
4950
5048
|
} else {
|
|
4951
|
-
if (!isMismatchAllowed(container, 1
|
|
5049
|
+
if (!isMismatchAllowed(container, 1)) {
|
|
4952
5050
|
if (!hasWarned) {
|
|
4953
5051
|
warn$1(
|
|
4954
5052
|
`Hydration children mismatch on`,
|
|
@@ -4998,7 +5096,7 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
4998
5096
|
}
|
|
4999
5097
|
};
|
|
5000
5098
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
5001
|
-
if (!isMismatchAllowed(node.parentElement, 1
|
|
5099
|
+
if (!isMismatchAllowed(node.parentElement, 1)) {
|
|
5002
5100
|
warn$1(
|
|
5003
5101
|
`Hydration node mismatch:
|
|
5004
5102
|
- rendered on server:`,
|
|
@@ -5071,11 +5169,11 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
5071
5169
|
parent = parent.parent;
|
|
5072
5170
|
}
|
|
5073
5171
|
};
|
|
5074
|
-
const isTemplateNode = (node) => {
|
|
5075
|
-
return node.nodeType === 1 && node.tagName === "TEMPLATE";
|
|
5076
|
-
};
|
|
5077
5172
|
return [hydrate, hydrateNode];
|
|
5078
5173
|
}
|
|
5174
|
+
const isTemplateNode$1 = (node) => {
|
|
5175
|
+
return node.nodeType === 1 && node.tagName === "TEMPLATE";
|
|
5176
|
+
};
|
|
5079
5177
|
function propHasMismatch(el, key, clientValue, vnode, instance) {
|
|
5080
5178
|
let mismatchType;
|
|
5081
5179
|
let mismatchKey;
|
|
@@ -5090,7 +5188,7 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
|
|
|
5090
5188
|
}
|
|
5091
5189
|
expected = normalizeClass(clientValue);
|
|
5092
5190
|
if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
|
|
5093
|
-
mismatchType = 2
|
|
5191
|
+
mismatchType = 2;
|
|
5094
5192
|
mismatchKey = `class`;
|
|
5095
5193
|
}
|
|
5096
5194
|
} else if (key === "style") {
|
|
@@ -5109,31 +5207,43 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
|
|
|
5109
5207
|
resolveCssVars(instance, vnode, expectedMap);
|
|
5110
5208
|
}
|
|
5111
5209
|
if (!isMapEqual(actualMap, expectedMap)) {
|
|
5112
|
-
mismatchType = 3
|
|
5210
|
+
mismatchType = 3;
|
|
5113
5211
|
mismatchKey = "style";
|
|
5114
5212
|
}
|
|
5115
|
-
} else if (
|
|
5116
|
-
|
|
5117
|
-
actual = el.hasAttribute(key);
|
|
5118
|
-
expected = includeBooleanAttr(clientValue);
|
|
5119
|
-
} else if (clientValue == null) {
|
|
5120
|
-
actual = el.hasAttribute(key);
|
|
5121
|
-
expected = false;
|
|
5122
|
-
} else {
|
|
5123
|
-
if (el.hasAttribute(key)) {
|
|
5124
|
-
actual = el.getAttribute(key);
|
|
5125
|
-
} else if (key === "value" && el.tagName === "TEXTAREA") {
|
|
5126
|
-
actual = el.value;
|
|
5127
|
-
} else {
|
|
5128
|
-
actual = false;
|
|
5129
|
-
}
|
|
5130
|
-
expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
|
|
5131
|
-
}
|
|
5213
|
+
} else if (isValidHtmlOrSvgAttribute(el, key)) {
|
|
5214
|
+
({ actual, expected } = getAttributeMismatch(el, key, clientValue));
|
|
5132
5215
|
if (actual !== expected) {
|
|
5133
|
-
mismatchType = 4
|
|
5216
|
+
mismatchType = 4;
|
|
5134
5217
|
mismatchKey = key;
|
|
5135
5218
|
}
|
|
5136
5219
|
}
|
|
5220
|
+
return warnPropMismatch(el, mismatchKey, mismatchType, actual, expected);
|
|
5221
|
+
}
|
|
5222
|
+
function getAttributeMismatch(el, key, clientValue) {
|
|
5223
|
+
let actual;
|
|
5224
|
+
let expected;
|
|
5225
|
+
if (isBooleanAttr(key)) {
|
|
5226
|
+
actual = el.hasAttribute(key);
|
|
5227
|
+
expected = includeBooleanAttr(clientValue);
|
|
5228
|
+
} else if (clientValue == null) {
|
|
5229
|
+
actual = el.hasAttribute(key);
|
|
5230
|
+
expected = false;
|
|
5231
|
+
} else {
|
|
5232
|
+
if (el.hasAttribute(key)) {
|
|
5233
|
+
actual = el.getAttribute(key);
|
|
5234
|
+
} else if (key === "value" && el.tagName === "TEXTAREA") {
|
|
5235
|
+
actual = el.value;
|
|
5236
|
+
} else {
|
|
5237
|
+
actual = false;
|
|
5238
|
+
}
|
|
5239
|
+
expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
|
|
5240
|
+
}
|
|
5241
|
+
return { actual, expected };
|
|
5242
|
+
}
|
|
5243
|
+
function isValidHtmlOrSvgAttribute(el, key) {
|
|
5244
|
+
return el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key));
|
|
5245
|
+
}
|
|
5246
|
+
function warnPropMismatch(el, mismatchKey, mismatchType, actual, expected) {
|
|
5137
5247
|
if (mismatchType != null && !isMismatchAllowed(el, mismatchType)) {
|
|
5138
5248
|
const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
|
|
5139
5249
|
const preSegment = `Hydration ${MismatchTypeString[mismatchType]} mismatch on`;
|
|
@@ -5205,14 +5315,14 @@ function resolveCssVars(instance, vnode, expectedMap) {
|
|
|
5205
5315
|
}
|
|
5206
5316
|
const allowMismatchAttr = "data-allow-mismatch";
|
|
5207
5317
|
const MismatchTypeString = {
|
|
5208
|
-
[0
|
|
5209
|
-
[1
|
|
5210
|
-
[2
|
|
5211
|
-
[3
|
|
5212
|
-
[4
|
|
5318
|
+
[0]: "text",
|
|
5319
|
+
[1]: "children",
|
|
5320
|
+
[2]: "class",
|
|
5321
|
+
[3]: "style",
|
|
5322
|
+
[4]: "attribute"
|
|
5213
5323
|
};
|
|
5214
5324
|
function isMismatchAllowed(el, allowedType) {
|
|
5215
|
-
if (allowedType === 0
|
|
5325
|
+
if (allowedType === 0 || allowedType === 1) {
|
|
5216
5326
|
while (el && !el.hasAttribute(allowMismatchAttr)) {
|
|
5217
5327
|
el = el.parentElement;
|
|
5218
5328
|
}
|
|
@@ -5224,7 +5334,7 @@ function isMismatchAllowed(el, allowedType) {
|
|
|
5224
5334
|
return true;
|
|
5225
5335
|
} else {
|
|
5226
5336
|
const list = allowedAttr.split(",");
|
|
5227
|
-
if (allowedType === 0
|
|
5337
|
+
if (allowedType === 0 && list.includes("children")) {
|
|
5228
5338
|
return true;
|
|
5229
5339
|
}
|
|
5230
5340
|
return list.includes(MismatchTypeString[allowedType]);
|
|
@@ -5281,7 +5391,9 @@ const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
|
|
|
5281
5391
|
hasHydrated = true;
|
|
5282
5392
|
teardown();
|
|
5283
5393
|
hydrate();
|
|
5284
|
-
|
|
5394
|
+
if (!(`$evt${e.type}` in e.target)) {
|
|
5395
|
+
e.target.dispatchEvent(new e.constructor(e.type, e));
|
|
5396
|
+
}
|
|
5285
5397
|
}
|
|
5286
5398
|
};
|
|
5287
5399
|
const teardown = () => {
|
|
@@ -5323,104 +5435,46 @@ function forEachElement(node, cb) {
|
|
|
5323
5435
|
}
|
|
5324
5436
|
|
|
5325
5437
|
const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
|
|
5326
|
-
/*! #__NO_SIDE_EFFECTS__ */
|
|
5327
5438
|
// @__NO_SIDE_EFFECTS__
|
|
5328
5439
|
function defineAsyncComponent(source) {
|
|
5329
|
-
if (isFunction(source)) {
|
|
5330
|
-
source = { loader: source };
|
|
5331
|
-
}
|
|
5332
5440
|
const {
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
|
|
5342
|
-
|
|
5343
|
-
|
|
5344
|
-
|
|
5345
|
-
let retries = 0;
|
|
5346
|
-
const retry = () => {
|
|
5347
|
-
retries++;
|
|
5348
|
-
pendingRequest = null;
|
|
5349
|
-
return load();
|
|
5350
|
-
};
|
|
5351
|
-
const load = () => {
|
|
5352
|
-
let thisRequest;
|
|
5353
|
-
return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
|
|
5354
|
-
err = err instanceof Error ? err : new Error(String(err));
|
|
5355
|
-
if (userOnError) {
|
|
5356
|
-
return new Promise((resolve, reject) => {
|
|
5357
|
-
const userRetry = () => resolve(retry());
|
|
5358
|
-
const userFail = () => reject(err);
|
|
5359
|
-
userOnError(err, userRetry, userFail, retries + 1);
|
|
5360
|
-
});
|
|
5361
|
-
} else {
|
|
5362
|
-
throw err;
|
|
5363
|
-
}
|
|
5364
|
-
}).then((comp) => {
|
|
5365
|
-
if (thisRequest !== pendingRequest && pendingRequest) {
|
|
5366
|
-
return pendingRequest;
|
|
5367
|
-
}
|
|
5368
|
-
if (!comp) {
|
|
5369
|
-
warn$1(
|
|
5370
|
-
`Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
|
|
5371
|
-
);
|
|
5372
|
-
}
|
|
5373
|
-
if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
|
|
5374
|
-
comp = comp.default;
|
|
5375
|
-
}
|
|
5376
|
-
if (comp && !isObject(comp) && !isFunction(comp)) {
|
|
5377
|
-
throw new Error(`Invalid async component load result: ${comp}`);
|
|
5378
|
-
}
|
|
5379
|
-
resolvedComp = comp;
|
|
5380
|
-
return comp;
|
|
5381
|
-
}));
|
|
5382
|
-
};
|
|
5441
|
+
load,
|
|
5442
|
+
getResolvedComp,
|
|
5443
|
+
setPendingRequest,
|
|
5444
|
+
source: {
|
|
5445
|
+
loadingComponent,
|
|
5446
|
+
errorComponent,
|
|
5447
|
+
delay,
|
|
5448
|
+
hydrate: hydrateStrategy,
|
|
5449
|
+
timeout,
|
|
5450
|
+
suspensible = true
|
|
5451
|
+
}
|
|
5452
|
+
} = createAsyncComponentContext(source);
|
|
5383
5453
|
return defineComponent({
|
|
5384
5454
|
name: "AsyncComponentWrapper",
|
|
5385
5455
|
__asyncLoader: load,
|
|
5386
5456
|
__asyncHydrate(el, instance, hydrate) {
|
|
5387
|
-
|
|
5388
|
-
|
|
5389
|
-
|
|
5390
|
-
|
|
5391
|
-
|
|
5392
|
-
|
|
5393
|
-
|
|
5394
|
-
|
|
5395
|
-
}
|
|
5396
|
-
hydrate();
|
|
5397
|
-
};
|
|
5398
|
-
const teardown = hydrateStrategy(
|
|
5399
|
-
performHydrate,
|
|
5400
|
-
(cb) => forEachElement(el, cb)
|
|
5401
|
-
);
|
|
5402
|
-
if (teardown) {
|
|
5403
|
-
(instance.bum || (instance.bum = [])).push(teardown);
|
|
5404
|
-
}
|
|
5405
|
-
(instance.u || (instance.u = [])).push(() => patched = true);
|
|
5406
|
-
} : hydrate;
|
|
5407
|
-
if (resolvedComp) {
|
|
5408
|
-
doHydrate();
|
|
5409
|
-
} else {
|
|
5410
|
-
load().then(() => !instance.isUnmounted && doHydrate());
|
|
5411
|
-
}
|
|
5457
|
+
performAsyncHydrate(
|
|
5458
|
+
el,
|
|
5459
|
+
instance,
|
|
5460
|
+
hydrate,
|
|
5461
|
+
getResolvedComp,
|
|
5462
|
+
load,
|
|
5463
|
+
hydrateStrategy
|
|
5464
|
+
);
|
|
5412
5465
|
},
|
|
5413
5466
|
get __asyncResolved() {
|
|
5414
|
-
return
|
|
5467
|
+
return getResolvedComp();
|
|
5415
5468
|
},
|
|
5416
5469
|
setup() {
|
|
5417
5470
|
const instance = currentInstance;
|
|
5418
5471
|
markAsyncBoundary(instance);
|
|
5472
|
+
let resolvedComp = getResolvedComp();
|
|
5419
5473
|
if (resolvedComp) {
|
|
5420
5474
|
return () => createInnerComp(resolvedComp, instance);
|
|
5421
5475
|
}
|
|
5422
5476
|
const onError = (err) => {
|
|
5423
|
-
|
|
5477
|
+
setPendingRequest(null);
|
|
5424
5478
|
handleError(
|
|
5425
5479
|
err,
|
|
5426
5480
|
instance,
|
|
@@ -5438,25 +5492,11 @@ function defineAsyncComponent(source) {
|
|
|
5438
5492
|
}) : null;
|
|
5439
5493
|
});
|
|
5440
5494
|
}
|
|
5441
|
-
const loaded =
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
delayed.value = false;
|
|
5447
|
-
}, delay);
|
|
5448
|
-
}
|
|
5449
|
-
if (timeout != null) {
|
|
5450
|
-
setTimeout(() => {
|
|
5451
|
-
if (!loaded.value && !error.value) {
|
|
5452
|
-
const err = new Error(
|
|
5453
|
-
`Async component timed out after ${timeout}ms.`
|
|
5454
|
-
);
|
|
5455
|
-
onError(err);
|
|
5456
|
-
error.value = err;
|
|
5457
|
-
}
|
|
5458
|
-
}, timeout);
|
|
5459
|
-
}
|
|
5495
|
+
const { loaded, error, delayed } = useAsyncComponentState(
|
|
5496
|
+
delay,
|
|
5497
|
+
timeout,
|
|
5498
|
+
onError
|
|
5499
|
+
);
|
|
5460
5500
|
load().then(() => {
|
|
5461
5501
|
loaded.value = true;
|
|
5462
5502
|
if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) {
|
|
@@ -5467,6 +5507,7 @@ function defineAsyncComponent(source) {
|
|
|
5467
5507
|
error.value = err;
|
|
5468
5508
|
});
|
|
5469
5509
|
return () => {
|
|
5510
|
+
resolvedComp = getResolvedComp();
|
|
5470
5511
|
if (loaded.value && resolvedComp) {
|
|
5471
5512
|
return createInnerComp(resolvedComp, instance);
|
|
5472
5513
|
} else if (error.value && errorComponent) {
|
|
@@ -5474,7 +5515,10 @@ function defineAsyncComponent(source) {
|
|
|
5474
5515
|
error: error.value
|
|
5475
5516
|
});
|
|
5476
5517
|
} else if (loadingComponent && !delayed.value) {
|
|
5477
|
-
return
|
|
5518
|
+
return createInnerComp(
|
|
5519
|
+
loadingComponent,
|
|
5520
|
+
instance
|
|
5521
|
+
);
|
|
5478
5522
|
}
|
|
5479
5523
|
};
|
|
5480
5524
|
}
|
|
@@ -5488,6 +5532,108 @@ function createInnerComp(comp, parent) {
|
|
|
5488
5532
|
delete parent.vnode.ce;
|
|
5489
5533
|
return vnode;
|
|
5490
5534
|
}
|
|
5535
|
+
function createAsyncComponentContext(source) {
|
|
5536
|
+
if (isFunction(source)) {
|
|
5537
|
+
source = { loader: source };
|
|
5538
|
+
}
|
|
5539
|
+
const { loader, onError: userOnError } = source;
|
|
5540
|
+
let pendingRequest = null;
|
|
5541
|
+
let resolvedComp;
|
|
5542
|
+
let retries = 0;
|
|
5543
|
+
const retry = () => {
|
|
5544
|
+
retries++;
|
|
5545
|
+
pendingRequest = null;
|
|
5546
|
+
return load();
|
|
5547
|
+
};
|
|
5548
|
+
const load = () => {
|
|
5549
|
+
let thisRequest;
|
|
5550
|
+
return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
|
|
5551
|
+
err = err instanceof Error ? err : new Error(String(err));
|
|
5552
|
+
if (userOnError) {
|
|
5553
|
+
return new Promise((resolve, reject) => {
|
|
5554
|
+
const userRetry = () => resolve(retry());
|
|
5555
|
+
const userFail = () => reject(err);
|
|
5556
|
+
userOnError(err, userRetry, userFail, retries + 1);
|
|
5557
|
+
});
|
|
5558
|
+
} else {
|
|
5559
|
+
throw err;
|
|
5560
|
+
}
|
|
5561
|
+
}).then((comp) => {
|
|
5562
|
+
if (thisRequest !== pendingRequest && pendingRequest) {
|
|
5563
|
+
return pendingRequest;
|
|
5564
|
+
}
|
|
5565
|
+
if (!comp) {
|
|
5566
|
+
warn$1(
|
|
5567
|
+
`Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
|
|
5568
|
+
);
|
|
5569
|
+
}
|
|
5570
|
+
if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
|
|
5571
|
+
comp = comp.default;
|
|
5572
|
+
}
|
|
5573
|
+
if (comp && !isObject(comp) && !isFunction(comp)) {
|
|
5574
|
+
throw new Error(`Invalid async component load result: ${comp}`);
|
|
5575
|
+
}
|
|
5576
|
+
resolvedComp = comp;
|
|
5577
|
+
return comp;
|
|
5578
|
+
}));
|
|
5579
|
+
};
|
|
5580
|
+
return {
|
|
5581
|
+
load,
|
|
5582
|
+
source,
|
|
5583
|
+
getResolvedComp: () => resolvedComp,
|
|
5584
|
+
setPendingRequest: (request) => pendingRequest = request
|
|
5585
|
+
};
|
|
5586
|
+
}
|
|
5587
|
+
const useAsyncComponentState = (delay, timeout, onError) => {
|
|
5588
|
+
const loaded = ref(false);
|
|
5589
|
+
const error = ref();
|
|
5590
|
+
const delayed = ref(!!delay);
|
|
5591
|
+
if (delay) {
|
|
5592
|
+
setTimeout(() => {
|
|
5593
|
+
delayed.value = false;
|
|
5594
|
+
}, delay);
|
|
5595
|
+
}
|
|
5596
|
+
if (timeout != null) {
|
|
5597
|
+
setTimeout(() => {
|
|
5598
|
+
if (!loaded.value && !error.value) {
|
|
5599
|
+
const err = new Error(`Async component timed out after ${timeout}ms.`);
|
|
5600
|
+
onError(err);
|
|
5601
|
+
error.value = err;
|
|
5602
|
+
}
|
|
5603
|
+
}, timeout);
|
|
5604
|
+
}
|
|
5605
|
+
return { loaded, error, delayed };
|
|
5606
|
+
};
|
|
5607
|
+
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
|
|
5608
|
+
let patched = false;
|
|
5609
|
+
(instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
5610
|
+
const performHydrate = () => {
|
|
5611
|
+
if (patched) {
|
|
5612
|
+
{
|
|
5613
|
+
const resolvedComp = getResolvedComp();
|
|
5614
|
+
warn$1(
|
|
5615
|
+
`Skipping lazy hydration for component '${getComponentName(resolvedComp) || resolvedComp.__file}': it was updated before lazy hydration performed.`
|
|
5616
|
+
);
|
|
5617
|
+
}
|
|
5618
|
+
return;
|
|
5619
|
+
}
|
|
5620
|
+
hydrate();
|
|
5621
|
+
};
|
|
5622
|
+
const doHydrate = hydrateStrategy ? () => {
|
|
5623
|
+
const teardown = hydrateStrategy(
|
|
5624
|
+
performHydrate,
|
|
5625
|
+
(cb) => forEachElement(el, cb)
|
|
5626
|
+
);
|
|
5627
|
+
if (teardown) {
|
|
5628
|
+
(instance.bum || (instance.bum = [])).push(teardown);
|
|
5629
|
+
}
|
|
5630
|
+
} : performHydrate;
|
|
5631
|
+
if (getResolvedComp()) {
|
|
5632
|
+
doHydrate();
|
|
5633
|
+
} else {
|
|
5634
|
+
load().then(() => !instance.isUnmounted && doHydrate());
|
|
5635
|
+
}
|
|
5636
|
+
}
|
|
5491
5637
|
|
|
5492
5638
|
const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
|
|
5493
5639
|
const KeepAliveImpl = {
|
|
@@ -5517,86 +5663,37 @@ const KeepAliveImpl = {
|
|
|
5517
5663
|
keepAliveInstance.__v_cache = cache;
|
|
5518
5664
|
}
|
|
5519
5665
|
const parentSuspense = keepAliveInstance.suspense;
|
|
5666
|
+
const { renderer } = sharedContext;
|
|
5520
5667
|
const {
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
|
|
5524
|
-
um: _unmount,
|
|
5525
|
-
o: { createElement }
|
|
5526
|
-
}
|
|
5527
|
-
} = sharedContext;
|
|
5668
|
+
um: _unmount,
|
|
5669
|
+
o: { createElement }
|
|
5670
|
+
} = renderer;
|
|
5528
5671
|
const storageContainer = createElement("div");
|
|
5672
|
+
sharedContext.getStorageContainer = () => storageContainer;
|
|
5673
|
+
sharedContext.getCachedComponent = (vnode) => {
|
|
5674
|
+
const key = vnode.key == null ? vnode.type : vnode.key;
|
|
5675
|
+
return cache.get(key);
|
|
5676
|
+
};
|
|
5529
5677
|
sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
|
|
5530
|
-
|
|
5531
|
-
move(
|
|
5678
|
+
activate(
|
|
5532
5679
|
vnode,
|
|
5533
5680
|
container,
|
|
5534
5681
|
anchor,
|
|
5535
|
-
|
|
5682
|
+
renderer,
|
|
5536
5683
|
keepAliveInstance,
|
|
5537
|
-
parentSuspense
|
|
5538
|
-
);
|
|
5539
|
-
patch(
|
|
5540
|
-
instance.vnode,
|
|
5541
|
-
vnode,
|
|
5542
|
-
container,
|
|
5543
|
-
anchor,
|
|
5544
|
-
instance,
|
|
5545
5684
|
parentSuspense,
|
|
5546
5685
|
namespace,
|
|
5547
|
-
vnode.slotScopeIds,
|
|
5548
5686
|
optimized
|
|
5549
5687
|
);
|
|
5550
|
-
queuePostRenderEffect(
|
|
5551
|
-
() => {
|
|
5552
|
-
instance.isDeactivated = false;
|
|
5553
|
-
if (instance.a) {
|
|
5554
|
-
invokeArrayFns(instance.a);
|
|
5555
|
-
}
|
|
5556
|
-
const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
|
|
5557
|
-
if (vnodeHook) {
|
|
5558
|
-
invokeVNodeHook(vnodeHook, instance.parent, vnode);
|
|
5559
|
-
}
|
|
5560
|
-
},
|
|
5561
|
-
void 0,
|
|
5562
|
-
parentSuspense
|
|
5563
|
-
);
|
|
5564
|
-
{
|
|
5565
|
-
devtoolsComponentAdded(instance);
|
|
5566
|
-
}
|
|
5567
5688
|
};
|
|
5568
5689
|
sharedContext.deactivate = (vnode) => {
|
|
5569
|
-
|
|
5570
|
-
invalidateMount(instance.m);
|
|
5571
|
-
invalidateMount(instance.a);
|
|
5572
|
-
move(
|
|
5690
|
+
deactivate(
|
|
5573
5691
|
vnode,
|
|
5574
5692
|
storageContainer,
|
|
5575
|
-
|
|
5576
|
-
1,
|
|
5693
|
+
renderer,
|
|
5577
5694
|
keepAliveInstance,
|
|
5578
5695
|
parentSuspense
|
|
5579
5696
|
);
|
|
5580
|
-
queuePostRenderEffect(
|
|
5581
|
-
() => {
|
|
5582
|
-
if (instance.da) {
|
|
5583
|
-
invokeArrayFns(instance.da);
|
|
5584
|
-
}
|
|
5585
|
-
const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
|
|
5586
|
-
if (vnodeHook) {
|
|
5587
|
-
invokeVNodeHook(vnodeHook, instance.parent, vnode);
|
|
5588
|
-
}
|
|
5589
|
-
instance.isDeactivated = true;
|
|
5590
|
-
},
|
|
5591
|
-
void 0,
|
|
5592
|
-
parentSuspense
|
|
5593
|
-
);
|
|
5594
|
-
{
|
|
5595
|
-
devtoolsComponentAdded(instance);
|
|
5596
|
-
}
|
|
5597
|
-
{
|
|
5598
|
-
instance.__keepAliveStorageContainer = storageContainer;
|
|
5599
|
-
}
|
|
5600
5697
|
};
|
|
5601
5698
|
function unmount(vnode) {
|
|
5602
5699
|
resetShapeFlag(vnode);
|
|
@@ -5747,7 +5844,7 @@ function onActivated(hook, target) {
|
|
|
5747
5844
|
function onDeactivated(hook, target) {
|
|
5748
5845
|
registerKeepAliveHook(hook, "da", target);
|
|
5749
5846
|
}
|
|
5750
|
-
function registerKeepAliveHook(hook, type, target =
|
|
5847
|
+
function registerKeepAliveHook(hook, type, target = getCurrentGenericInstance()) {
|
|
5751
5848
|
const wrappedHook = hook.__wdc || (hook.__wdc = () => {
|
|
5752
5849
|
let current = target;
|
|
5753
5850
|
while (current) {
|
|
@@ -5761,8 +5858,9 @@ function registerKeepAliveHook(hook, type, target = getCurrentInstance()) {
|
|
|
5761
5858
|
injectHook(type, wrappedHook, target);
|
|
5762
5859
|
if (target) {
|
|
5763
5860
|
let current = target.parent;
|
|
5764
|
-
while (current && current.parent
|
|
5765
|
-
|
|
5861
|
+
while (current && current.parent) {
|
|
5862
|
+
let parent = current.parent;
|
|
5863
|
+
if (isKeepAlive(parent.vapor ? parent : parent.vnode)) {
|
|
5766
5864
|
injectToKeepAliveRoot(wrappedHook, type, target, current);
|
|
5767
5865
|
}
|
|
5768
5866
|
current = current.parent;
|
|
@@ -5788,6 +5886,71 @@ function resetShapeFlag(vnode) {
|
|
|
5788
5886
|
function getInnerChild(vnode) {
|
|
5789
5887
|
return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
|
|
5790
5888
|
}
|
|
5889
|
+
function activate(vnode, container, anchor, { p: patch, m: move }, parentComponent, parentSuspense, namespace, optimized) {
|
|
5890
|
+
const instance = vnode.component;
|
|
5891
|
+
move(
|
|
5892
|
+
vnode,
|
|
5893
|
+
container,
|
|
5894
|
+
anchor,
|
|
5895
|
+
0,
|
|
5896
|
+
parentComponent,
|
|
5897
|
+
parentSuspense
|
|
5898
|
+
);
|
|
5899
|
+
patch(
|
|
5900
|
+
instance.vnode,
|
|
5901
|
+
vnode,
|
|
5902
|
+
container,
|
|
5903
|
+
anchor,
|
|
5904
|
+
instance,
|
|
5905
|
+
parentSuspense,
|
|
5906
|
+
namespace,
|
|
5907
|
+
vnode.slotScopeIds,
|
|
5908
|
+
optimized
|
|
5909
|
+
);
|
|
5910
|
+
queuePostRenderEffect(
|
|
5911
|
+
() => {
|
|
5912
|
+
instance.isDeactivated = false;
|
|
5913
|
+
if (instance.a) {
|
|
5914
|
+
invokeArrayFns(instance.a);
|
|
5915
|
+
}
|
|
5916
|
+
const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
|
|
5917
|
+
if (vnodeHook) {
|
|
5918
|
+
invokeVNodeHook(vnodeHook, instance.parent, vnode);
|
|
5919
|
+
}
|
|
5920
|
+
},
|
|
5921
|
+
void 0,
|
|
5922
|
+
parentSuspense
|
|
5923
|
+
);
|
|
5924
|
+
{
|
|
5925
|
+
devtoolsComponentAdded(instance);
|
|
5926
|
+
}
|
|
5927
|
+
}
|
|
5928
|
+
function deactivate(vnode, container, { m: move }, parentComponent, parentSuspense) {
|
|
5929
|
+
const instance = vnode.component;
|
|
5930
|
+
invalidateMount(instance.m);
|
|
5931
|
+
invalidateMount(instance.a);
|
|
5932
|
+
move(vnode, container, null, 1, parentComponent, parentSuspense);
|
|
5933
|
+
queuePostRenderEffect(
|
|
5934
|
+
() => {
|
|
5935
|
+
if (instance.da) {
|
|
5936
|
+
invokeArrayFns(instance.da);
|
|
5937
|
+
}
|
|
5938
|
+
const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
|
|
5939
|
+
if (vnodeHook) {
|
|
5940
|
+
invokeVNodeHook(vnodeHook, instance.parent, vnode);
|
|
5941
|
+
}
|
|
5942
|
+
instance.isDeactivated = true;
|
|
5943
|
+
},
|
|
5944
|
+
void 0,
|
|
5945
|
+
parentSuspense
|
|
5946
|
+
);
|
|
5947
|
+
{
|
|
5948
|
+
devtoolsComponentAdded(instance);
|
|
5949
|
+
}
|
|
5950
|
+
{
|
|
5951
|
+
instance.__keepAliveStorageContainer = container;
|
|
5952
|
+
}
|
|
5953
|
+
}
|
|
5791
5954
|
|
|
5792
5955
|
function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
5793
5956
|
if (target) {
|
|
@@ -6263,12 +6426,13 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
|
6263
6426
|
return ret;
|
|
6264
6427
|
}
|
|
6265
6428
|
if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
|
|
6429
|
+
const hasProps = Object.keys(props).length > 0;
|
|
6266
6430
|
if (name !== "default") props.name = name;
|
|
6267
6431
|
return openBlock(), createBlock(
|
|
6268
6432
|
Fragment,
|
|
6269
6433
|
null,
|
|
6270
6434
|
[createVNode("slot", props, fallback && fallback())],
|
|
6271
|
-
64
|
|
6435
|
+
hasProps ? -2 : 64
|
|
6272
6436
|
);
|
|
6273
6437
|
}
|
|
6274
6438
|
if (slot && slot.length > 1) {
|
|
@@ -6282,6 +6446,7 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
|
6282
6446
|
}
|
|
6283
6447
|
openBlock();
|
|
6284
6448
|
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
6449
|
+
ensureVaporSlotFallback(validSlotContent, fallback);
|
|
6285
6450
|
const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
|
|
6286
6451
|
// key attached in the `createSlots` helper, respect that
|
|
6287
6452
|
validSlotContent && validSlotContent.key;
|
|
@@ -6311,6 +6476,14 @@ function ensureValidVNode(vnodes) {
|
|
|
6311
6476
|
return true;
|
|
6312
6477
|
}) ? vnodes : null;
|
|
6313
6478
|
}
|
|
6479
|
+
function ensureVaporSlotFallback(vnodes, fallback) {
|
|
6480
|
+
let vaporSlot;
|
|
6481
|
+
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) {
|
|
6482
|
+
if (!vaporSlot.fallback && fallback) {
|
|
6483
|
+
vaporSlot.fallback = fallback;
|
|
6484
|
+
}
|
|
6485
|
+
}
|
|
6486
|
+
}
|
|
6314
6487
|
|
|
6315
6488
|
function toHandlers(obj, preserveCaseIfNecessary) {
|
|
6316
6489
|
const ret = {};
|
|
@@ -6372,7 +6545,7 @@ function legacyRenderSlot(instance, name, fallback, props, bindObject) {
|
|
|
6372
6545
|
}
|
|
6373
6546
|
return renderSlot(instance.slots, name, props, fallback && (() => fallback));
|
|
6374
6547
|
}
|
|
6375
|
-
function
|
|
6548
|
+
function legacyResolveScopedSlots(fns, raw, hasDynamicKeys) {
|
|
6376
6549
|
return createSlots(
|
|
6377
6550
|
raw || { $stable: !hasDynamicKeys },
|
|
6378
6551
|
mapKeyToName(fns)
|
|
@@ -6539,7 +6712,7 @@ function installCompatInstanceProperties(map) {
|
|
|
6539
6712
|
_b: () => legacyBindObjectProps,
|
|
6540
6713
|
_v: () => createTextVNode,
|
|
6541
6714
|
_e: () => createCommentVNode,
|
|
6542
|
-
_u: () =>
|
|
6715
|
+
_u: () => legacyResolveScopedSlots,
|
|
6543
6716
|
_g: () => legacyBindObjectListeners,
|
|
6544
6717
|
_d: () => legacyBindDynamicKeys,
|
|
6545
6718
|
_p: () => legacyPrependModifier
|
|
@@ -6711,10 +6884,10 @@ const PublicInstanceProxyHandlers = {
|
|
|
6711
6884
|
return true;
|
|
6712
6885
|
},
|
|
6713
6886
|
has({
|
|
6714
|
-
_: { data, setupState, accessCache, ctx, appContext, propsOptions }
|
|
6887
|
+
_: { data, setupState, accessCache, ctx, appContext, propsOptions, type }
|
|
6715
6888
|
}, key) {
|
|
6716
|
-
let normalizedProps;
|
|
6717
|
-
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);
|
|
6889
|
+
let normalizedProps, cssModules;
|
|
6890
|
+
return !!(accessCache[key] || 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]);
|
|
6718
6891
|
},
|
|
6719
6892
|
defineProperty(target, key, descriptor) {
|
|
6720
6893
|
if (descriptor.get != null) {
|
|
@@ -6866,15 +7039,15 @@ function withDefaults(props, defaults) {
|
|
|
6866
7039
|
return null;
|
|
6867
7040
|
}
|
|
6868
7041
|
function useSlots() {
|
|
6869
|
-
return getContext().slots;
|
|
7042
|
+
return getContext("useSlots").slots;
|
|
6870
7043
|
}
|
|
6871
7044
|
function useAttrs() {
|
|
6872
|
-
return getContext().attrs;
|
|
7045
|
+
return getContext("useAttrs").attrs;
|
|
6873
7046
|
}
|
|
6874
|
-
function getContext() {
|
|
7047
|
+
function getContext(calledFunctionName) {
|
|
6875
7048
|
const i = getCurrentGenericInstance();
|
|
6876
7049
|
if (!i) {
|
|
6877
|
-
warn$1(
|
|
7050
|
+
warn$1(`${calledFunctionName}() called without active instance.`);
|
|
6878
7051
|
}
|
|
6879
7052
|
if (i.vapor) {
|
|
6880
7053
|
return i;
|
|
@@ -7138,7 +7311,8 @@ function applyOptions(instance) {
|
|
|
7138
7311
|
expose.forEach((key) => {
|
|
7139
7312
|
Object.defineProperty(exposed, key, {
|
|
7140
7313
|
get: () => publicThis[key],
|
|
7141
|
-
set: (val) => publicThis[key] = val
|
|
7314
|
+
set: (val) => publicThis[key] = val,
|
|
7315
|
+
enumerable: true
|
|
7142
7316
|
});
|
|
7143
7317
|
});
|
|
7144
7318
|
} else if (!instance.exposed) {
|
|
@@ -7464,7 +7638,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
7464
7638
|
return vm;
|
|
7465
7639
|
}
|
|
7466
7640
|
}
|
|
7467
|
-
Vue.version = `2.6.14-compat:${"3.6.0-alpha.
|
|
7641
|
+
Vue.version = `2.6.14-compat:${"3.6.0-alpha.3"}`;
|
|
7468
7642
|
Vue.config = singletonApp.config;
|
|
7469
7643
|
Vue.use = (plugin, ...options) => {
|
|
7470
7644
|
if (plugin && isFunction(plugin.install)) {
|
|
@@ -7478,22 +7652,22 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
7478
7652
|
singletonApp.mixin(m);
|
|
7479
7653
|
return Vue;
|
|
7480
7654
|
};
|
|
7481
|
-
Vue.component = (name, comp) => {
|
|
7655
|
+
Vue.component = ((name, comp) => {
|
|
7482
7656
|
if (comp) {
|
|
7483
7657
|
singletonApp.component(name, comp);
|
|
7484
7658
|
return Vue;
|
|
7485
7659
|
} else {
|
|
7486
7660
|
return singletonApp.component(name);
|
|
7487
7661
|
}
|
|
7488
|
-
};
|
|
7489
|
-
Vue.directive = (name, dir) => {
|
|
7662
|
+
});
|
|
7663
|
+
Vue.directive = ((name, dir) => {
|
|
7490
7664
|
if (dir) {
|
|
7491
7665
|
singletonApp.directive(name, dir);
|
|
7492
7666
|
return Vue;
|
|
7493
7667
|
} else {
|
|
7494
7668
|
return singletonApp.directive(name);
|
|
7495
7669
|
}
|
|
7496
|
-
};
|
|
7670
|
+
});
|
|
7497
7671
|
Vue.options = { _base: Vue };
|
|
7498
7672
|
let cid = 1;
|
|
7499
7673
|
Vue.cid = cid;
|
|
@@ -7556,14 +7730,14 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
7556
7730
|
assertCompatEnabled("GLOBAL_OBSERVABLE", null);
|
|
7557
7731
|
return reactive(target);
|
|
7558
7732
|
};
|
|
7559
|
-
Vue.filter = (name, filter) => {
|
|
7733
|
+
Vue.filter = ((name, filter) => {
|
|
7560
7734
|
if (filter) {
|
|
7561
7735
|
singletonApp.filter(name, filter);
|
|
7562
7736
|
return Vue;
|
|
7563
7737
|
} else {
|
|
7564
7738
|
return singletonApp.filter(name);
|
|
7565
7739
|
}
|
|
7566
|
-
};
|
|
7740
|
+
});
|
|
7567
7741
|
const util = {
|
|
7568
7742
|
warn: warn$1 ,
|
|
7569
7743
|
extend,
|
|
@@ -7722,7 +7896,7 @@ function installCompatMount(app, context, render) {
|
|
|
7722
7896
|
{
|
|
7723
7897
|
for (let i = 0; i < container.attributes.length; i++) {
|
|
7724
7898
|
const attr = container.attributes[i];
|
|
7725
|
-
if (attr.name !== "v-cloak" && /^(v-|:|@)/.test(attr.name)) {
|
|
7899
|
+
if (attr.name !== "v-cloak" && /^(?:v-|:|@)/.test(attr.name)) {
|
|
7726
7900
|
warnDeprecation$1("GLOBAL_MOUNT_CONTAINER", null);
|
|
7727
7901
|
break;
|
|
7728
7902
|
}
|
|
@@ -8556,7 +8730,7 @@ function isBoolean(...args) {
|
|
|
8556
8730
|
return args.some((elem) => elem.toLowerCase() === "boolean");
|
|
8557
8731
|
}
|
|
8558
8732
|
|
|
8559
|
-
const isInternalKey = (key) => key
|
|
8733
|
+
const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
|
|
8560
8734
|
const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
|
|
8561
8735
|
const normalizeSlot = (key, rawSlot, ctx) => {
|
|
8562
8736
|
if (rawSlot._n) {
|
|
@@ -8610,8 +8784,6 @@ const assignSlots = (slots, children, optimized) => {
|
|
|
8610
8784
|
const initSlots = (instance, children, optimized) => {
|
|
8611
8785
|
const slots = instance.slots = createInternalObject();
|
|
8612
8786
|
if (instance.vnode.shapeFlag & 32) {
|
|
8613
|
-
const cacheIndexes = children.__;
|
|
8614
|
-
if (cacheIndexes) def(slots, "__", cacheIndexes, true);
|
|
8615
8787
|
const type = children._;
|
|
8616
8788
|
if (type) {
|
|
8617
8789
|
assignSlots(slots, children, optimized);
|
|
@@ -8675,12 +8847,10 @@ function endMeasure(instance, type) {
|
|
|
8675
8847
|
if (instance.appContext.config.performance && isSupported()) {
|
|
8676
8848
|
const startTag = `vue-${type}-${instance.uid}`;
|
|
8677
8849
|
const endTag = startTag + `:end`;
|
|
8850
|
+
const measureName = `<${formatComponentName(instance, instance.type)}> ${type}`;
|
|
8678
8851
|
perf.mark(endTag);
|
|
8679
|
-
perf.measure(
|
|
8680
|
-
|
|
8681
|
-
startTag,
|
|
8682
|
-
endTag
|
|
8683
|
-
);
|
|
8852
|
+
perf.measure(measureName, startTag, endTag);
|
|
8853
|
+
perf.clearMeasures(measureName);
|
|
8684
8854
|
perf.clearMarks(startTag);
|
|
8685
8855
|
perf.clearMarks(endTag);
|
|
8686
8856
|
}
|
|
@@ -8919,15 +9089,25 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8919
9089
|
optimized
|
|
8920
9090
|
);
|
|
8921
9091
|
} else {
|
|
8922
|
-
|
|
8923
|
-
|
|
8924
|
-
|
|
8925
|
-
|
|
8926
|
-
|
|
8927
|
-
|
|
8928
|
-
|
|
8929
|
-
|
|
8930
|
-
|
|
9092
|
+
const customElement = !!(n1.el && n1.el._isVueCE) ? n1.el : null;
|
|
9093
|
+
try {
|
|
9094
|
+
if (customElement) {
|
|
9095
|
+
customElement._beginPatch();
|
|
9096
|
+
}
|
|
9097
|
+
patchElement(
|
|
9098
|
+
n1,
|
|
9099
|
+
n2,
|
|
9100
|
+
parentComponent,
|
|
9101
|
+
parentSuspense,
|
|
9102
|
+
namespace,
|
|
9103
|
+
slotScopeIds,
|
|
9104
|
+
optimized
|
|
9105
|
+
);
|
|
9106
|
+
} finally {
|
|
9107
|
+
if (customElement) {
|
|
9108
|
+
customElement._endPatch();
|
|
9109
|
+
}
|
|
9110
|
+
}
|
|
8931
9111
|
}
|
|
8932
9112
|
};
|
|
8933
9113
|
const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
@@ -8978,16 +9158,20 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8978
9158
|
if (dirs) {
|
|
8979
9159
|
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
8980
9160
|
}
|
|
8981
|
-
|
|
8982
|
-
|
|
8983
|
-
|
|
9161
|
+
if (transition) {
|
|
9162
|
+
performTransitionEnter(
|
|
9163
|
+
el,
|
|
9164
|
+
transition,
|
|
9165
|
+
() => hostInsert(el, container, anchor),
|
|
9166
|
+
parentSuspense
|
|
9167
|
+
);
|
|
9168
|
+
} else {
|
|
9169
|
+
hostInsert(el, container, anchor);
|
|
8984
9170
|
}
|
|
8985
|
-
|
|
8986
|
-
if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
|
|
9171
|
+
if ((vnodeHook = props && props.onVnodeMounted) || dirs) {
|
|
8987
9172
|
queuePostRenderEffect(
|
|
8988
9173
|
() => {
|
|
8989
9174
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
8990
|
-
needCallTransitionHooks && transition.enter(el);
|
|
8991
9175
|
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
8992
9176
|
},
|
|
8993
9177
|
void 0,
|
|
@@ -9004,21 +9188,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9004
9188
|
hostSetScopeId(el, slotScopeIds[i]);
|
|
9005
9189
|
}
|
|
9006
9190
|
}
|
|
9007
|
-
|
|
9008
|
-
|
|
9009
|
-
|
|
9010
|
-
subTree = filterSingleRoot(subTree.children) || subTree;
|
|
9011
|
-
}
|
|
9012
|
-
if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
|
|
9013
|
-
const parentVNode = parentComponent.vnode;
|
|
9014
|
-
setScopeId(
|
|
9015
|
-
el,
|
|
9016
|
-
parentVNode,
|
|
9017
|
-
parentVNode.scopeId,
|
|
9018
|
-
parentVNode.slotScopeIds,
|
|
9019
|
-
parentComponent.parent
|
|
9020
|
-
);
|
|
9021
|
-
}
|
|
9191
|
+
const inheritedScopeIds = getInheritedScopeIds(vnode, parentComponent);
|
|
9192
|
+
for (let i = 0; i < inheritedScopeIds.length; i++) {
|
|
9193
|
+
hostSetScopeId(el, inheritedScopeIds[i]);
|
|
9022
9194
|
}
|
|
9023
9195
|
};
|
|
9024
9196
|
const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
|
|
@@ -9259,12 +9431,21 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9259
9431
|
n2.slotScopeIds = slotScopeIds;
|
|
9260
9432
|
if (n2.type.__vapor) {
|
|
9261
9433
|
if (n1 == null) {
|
|
9262
|
-
|
|
9263
|
-
n2
|
|
9264
|
-
|
|
9265
|
-
|
|
9266
|
-
|
|
9267
|
-
|
|
9434
|
+
if (n2.shapeFlag & 512) {
|
|
9435
|
+
getVaporInterface(parentComponent, n2).activate(
|
|
9436
|
+
n2,
|
|
9437
|
+
container,
|
|
9438
|
+
anchor,
|
|
9439
|
+
parentComponent
|
|
9440
|
+
);
|
|
9441
|
+
} else {
|
|
9442
|
+
getVaporInterface(parentComponent, n2).mount(
|
|
9443
|
+
n2,
|
|
9444
|
+
container,
|
|
9445
|
+
anchor,
|
|
9446
|
+
parentComponent
|
|
9447
|
+
);
|
|
9448
|
+
}
|
|
9268
9449
|
} else {
|
|
9269
9450
|
getVaporInterface(parentComponent, n2).update(
|
|
9270
9451
|
n1,
|
|
@@ -9328,6 +9509,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9328
9509
|
if (!initialVNode.el) {
|
|
9329
9510
|
const placeholder = instance.subTree = createVNode(Comment);
|
|
9330
9511
|
processCommentNode(null, placeholder, container, anchor);
|
|
9512
|
+
initialVNode.placeholder = placeholder.el;
|
|
9331
9513
|
}
|
|
9332
9514
|
} else {
|
|
9333
9515
|
setupRenderEffect(
|
|
@@ -9895,7 +10077,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9895
10077
|
for (i = toBePatched - 1; i >= 0; i--) {
|
|
9896
10078
|
const nextIndex = s2 + i;
|
|
9897
10079
|
const nextChild = c2[nextIndex];
|
|
9898
|
-
const
|
|
10080
|
+
const anchorVNode = c2[nextIndex + 1];
|
|
10081
|
+
const anchor = nextIndex + 1 < l2 ? (
|
|
10082
|
+
// #13559, fallback to el placeholder for unresolved async component
|
|
10083
|
+
anchorVNode.el || anchorVNode.placeholder
|
|
10084
|
+
) : parentAnchor;
|
|
9899
10085
|
if (newIndexToOldIndexMap[i] === 0) {
|
|
9900
10086
|
patch(
|
|
9901
10087
|
null,
|
|
@@ -9975,12 +10161,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9975
10161
|
const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
|
|
9976
10162
|
if (needTransition2) {
|
|
9977
10163
|
if (moveType === 0) {
|
|
9978
|
-
|
|
9979
|
-
|
|
9980
|
-
|
|
9981
|
-
() =>
|
|
9982
|
-
|
|
9983
|
-
|
|
10164
|
+
performTransitionEnter(
|
|
10165
|
+
el,
|
|
10166
|
+
transition,
|
|
10167
|
+
() => hostInsert(el, container, anchor),
|
|
10168
|
+
parentSuspense,
|
|
10169
|
+
true
|
|
9984
10170
|
);
|
|
9985
10171
|
} else {
|
|
9986
10172
|
const { leave, delayLeave, afterLeave } = transition;
|
|
@@ -9992,6 +10178,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9992
10178
|
}
|
|
9993
10179
|
};
|
|
9994
10180
|
const performLeave = () => {
|
|
10181
|
+
if (el._isLeaving) {
|
|
10182
|
+
el[leaveCbKey](
|
|
10183
|
+
true
|
|
10184
|
+
/* cancelled */
|
|
10185
|
+
);
|
|
10186
|
+
}
|
|
9995
10187
|
leave(el, () => {
|
|
9996
10188
|
remove2();
|
|
9997
10189
|
afterLeave && afterLeave();
|
|
@@ -10031,7 +10223,14 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
10031
10223
|
parentComponent.renderCache[cacheIndex] = void 0;
|
|
10032
10224
|
}
|
|
10033
10225
|
if (shapeFlag & 256) {
|
|
10034
|
-
|
|
10226
|
+
if (vnode.type.__vapor) {
|
|
10227
|
+
getVaporInterface(parentComponent, vnode).deactivate(
|
|
10228
|
+
vnode,
|
|
10229
|
+
parentComponent.ctx.getStorageContainer()
|
|
10230
|
+
);
|
|
10231
|
+
} else {
|
|
10232
|
+
parentComponent.ctx.deactivate(vnode);
|
|
10233
|
+
}
|
|
10035
10234
|
return;
|
|
10036
10235
|
}
|
|
10037
10236
|
const shouldInvokeDirs = shapeFlag & 1 && dirs;
|
|
@@ -10119,22 +10318,15 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
10119
10318
|
removeStaticNode(vnode);
|
|
10120
10319
|
return;
|
|
10121
10320
|
}
|
|
10122
|
-
|
|
10123
|
-
|
|
10124
|
-
|
|
10125
|
-
transition
|
|
10126
|
-
|
|
10127
|
-
|
|
10128
|
-
|
|
10129
|
-
const { leave, delayLeave } = transition;
|
|
10130
|
-
const performLeave = () => leave(el, performRemove);
|
|
10131
|
-
if (delayLeave) {
|
|
10132
|
-
delayLeave(vnode.el, performRemove, performLeave);
|
|
10133
|
-
} else {
|
|
10134
|
-
performLeave();
|
|
10135
|
-
}
|
|
10321
|
+
if (transition) {
|
|
10322
|
+
performTransitionLeave(
|
|
10323
|
+
el,
|
|
10324
|
+
transition,
|
|
10325
|
+
() => hostRemove(el),
|
|
10326
|
+
!!(vnode.shapeFlag & 1)
|
|
10327
|
+
);
|
|
10136
10328
|
} else {
|
|
10137
|
-
|
|
10329
|
+
hostRemove(el);
|
|
10138
10330
|
}
|
|
10139
10331
|
};
|
|
10140
10332
|
const removeFragment = (cur, end) => {
|
|
@@ -10150,26 +10342,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
10150
10342
|
if (instance.type.__hmrId) {
|
|
10151
10343
|
unregisterHMR(instance);
|
|
10152
10344
|
}
|
|
10153
|
-
const {
|
|
10154
|
-
bum,
|
|
10155
|
-
scope,
|
|
10156
|
-
effect,
|
|
10157
|
-
subTree,
|
|
10158
|
-
um,
|
|
10159
|
-
m,
|
|
10160
|
-
a,
|
|
10161
|
-
parent,
|
|
10162
|
-
slots: { __: slotCacheKeys }
|
|
10163
|
-
} = instance;
|
|
10345
|
+
const { bum, scope, effect, subTree, um, m, a } = instance;
|
|
10164
10346
|
invalidateMount(m);
|
|
10165
10347
|
invalidateMount(a);
|
|
10166
10348
|
if (bum) {
|
|
10167
|
-
invokeArrayFns(bum);
|
|
10168
|
-
}
|
|
10169
|
-
if (parent && isArray(slotCacheKeys)) {
|
|
10170
|
-
slotCacheKeys.forEach((v) => {
|
|
10171
|
-
parent.renderCache[v] = void 0;
|
|
10172
|
-
});
|
|
10349
|
+
invokeArrayFns(bum);
|
|
10173
10350
|
}
|
|
10174
10351
|
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) {
|
|
10175
10352
|
instance.emit("hook:beforeDestroy");
|
|
@@ -10194,12 +10371,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
10194
10371
|
void 0,
|
|
10195
10372
|
parentSuspense
|
|
10196
10373
|
);
|
|
10197
|
-
if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
|
|
10198
|
-
parentSuspense.deps--;
|
|
10199
|
-
if (parentSuspense.deps === 0) {
|
|
10200
|
-
parentSuspense.resolve();
|
|
10201
|
-
}
|
|
10202
|
-
}
|
|
10203
10374
|
{
|
|
10204
10375
|
devtoolsComponentRemoved(instance);
|
|
10205
10376
|
}
|
|
@@ -10212,7 +10383,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
10212
10383
|
const getNextHostNode = (vnode) => {
|
|
10213
10384
|
if (vnode.shapeFlag & 6) {
|
|
10214
10385
|
if (vnode.type.__vapor) {
|
|
10215
|
-
return hostNextSibling(vnode.
|
|
10386
|
+
return hostNextSibling(vnode.anchor);
|
|
10216
10387
|
}
|
|
10217
10388
|
return getNextHostNode(vnode.component.subTree);
|
|
10218
10389
|
}
|
|
@@ -10290,6 +10461,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
10290
10461
|
return {
|
|
10291
10462
|
render,
|
|
10292
10463
|
hydrate,
|
|
10464
|
+
hydrateNode,
|
|
10293
10465
|
internals,
|
|
10294
10466
|
createApp: createAppAPI(
|
|
10295
10467
|
mountApp,
|
|
@@ -10331,7 +10503,8 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
10331
10503
|
if (!shallow && c2.patchFlag !== -2)
|
|
10332
10504
|
traverseStaticChildren(c1, c2);
|
|
10333
10505
|
}
|
|
10334
|
-
if (c2.type === Text
|
|
10506
|
+
if (c2.type === Text && // avoid cached text nodes retaining detached dom nodes
|
|
10507
|
+
c2.patchFlag !== -1) {
|
|
10335
10508
|
c2.el = c1.el;
|
|
10336
10509
|
}
|
|
10337
10510
|
if (c2.type === Comment && !c2.el) {
|
|
@@ -10344,7 +10517,7 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
10344
10517
|
}
|
|
10345
10518
|
}
|
|
10346
10519
|
function locateNonHydratedAsyncRoot(instance) {
|
|
10347
|
-
const subComponent = instance.
|
|
10520
|
+
const subComponent = instance.subTree && instance.subTree.component;
|
|
10348
10521
|
if (subComponent) {
|
|
10349
10522
|
if (subComponent.asyncDep && !subComponent.asyncResolved) {
|
|
10350
10523
|
return subComponent;
|
|
@@ -10359,6 +10532,34 @@ function invalidateMount(hooks) {
|
|
|
10359
10532
|
hooks[i].flags |= 4;
|
|
10360
10533
|
}
|
|
10361
10534
|
}
|
|
10535
|
+
function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
|
|
10536
|
+
if (force || needTransition(parentSuspense, transition)) {
|
|
10537
|
+
transition.beforeEnter(el);
|
|
10538
|
+
insert();
|
|
10539
|
+
queuePostRenderEffect(() => transition.enter(el), void 0, parentSuspense);
|
|
10540
|
+
} else {
|
|
10541
|
+
insert();
|
|
10542
|
+
}
|
|
10543
|
+
}
|
|
10544
|
+
function performTransitionLeave(el, transition, remove, isElement = true) {
|
|
10545
|
+
const performRemove = () => {
|
|
10546
|
+
remove();
|
|
10547
|
+
if (transition && !transition.persisted && transition.afterLeave) {
|
|
10548
|
+
transition.afterLeave();
|
|
10549
|
+
}
|
|
10550
|
+
};
|
|
10551
|
+
if (isElement && transition && !transition.persisted) {
|
|
10552
|
+
const { leave, delayLeave } = transition;
|
|
10553
|
+
const performLeave = () => leave(el, performRemove);
|
|
10554
|
+
if (delayLeave) {
|
|
10555
|
+
delayLeave(el, performRemove, performLeave);
|
|
10556
|
+
} else {
|
|
10557
|
+
performLeave();
|
|
10558
|
+
}
|
|
10559
|
+
} else {
|
|
10560
|
+
performRemove();
|
|
10561
|
+
}
|
|
10562
|
+
}
|
|
10362
10563
|
function getVaporInterface(instance, vnode) {
|
|
10363
10564
|
const ctx = instance ? instance.appContext : vnode.appContext;
|
|
10364
10565
|
const res = ctx && ctx.vapor;
|
|
@@ -10373,6 +10574,32 @@ app.use(vaporInteropPlugin)
|
|
|
10373
10574
|
}
|
|
10374
10575
|
return res;
|
|
10375
10576
|
}
|
|
10577
|
+
function getInheritedScopeIds(vnode, parentComponent) {
|
|
10578
|
+
const inheritedScopeIds = [];
|
|
10579
|
+
let currentParent = parentComponent;
|
|
10580
|
+
let currentVNode = vnode;
|
|
10581
|
+
while (currentParent) {
|
|
10582
|
+
let subTree = currentParent.subTree;
|
|
10583
|
+
if (!subTree) break;
|
|
10584
|
+
if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
|
|
10585
|
+
subTree = filterSingleRoot(subTree.children) || subTree;
|
|
10586
|
+
}
|
|
10587
|
+
if (currentVNode === subTree || isSuspense(subTree.type) && (subTree.ssContent === currentVNode || subTree.ssFallback === currentVNode)) {
|
|
10588
|
+
const parentVNode = currentParent.vnode;
|
|
10589
|
+
if (parentVNode.scopeId) {
|
|
10590
|
+
inheritedScopeIds.push(parentVNode.scopeId);
|
|
10591
|
+
}
|
|
10592
|
+
if (parentVNode.slotScopeIds) {
|
|
10593
|
+
inheritedScopeIds.push(...parentVNode.slotScopeIds);
|
|
10594
|
+
}
|
|
10595
|
+
currentVNode = parentVNode;
|
|
10596
|
+
currentParent = currentParent.parent;
|
|
10597
|
+
} else {
|
|
10598
|
+
break;
|
|
10599
|
+
}
|
|
10600
|
+
}
|
|
10601
|
+
return inheritedScopeIds;
|
|
10602
|
+
}
|
|
10376
10603
|
|
|
10377
10604
|
const ssrContextKey = Symbol.for("v-scx");
|
|
10378
10605
|
const useSSRContext = () => {
|
|
@@ -10721,8 +10948,9 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
|
|
|
10721
10948
|
function defaultPropGetter(props, key) {
|
|
10722
10949
|
return props[key];
|
|
10723
10950
|
}
|
|
10951
|
+
const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
|
|
10724
10952
|
function normalizeEmitsOptions(comp, appContext, asMixin = false) {
|
|
10725
|
-
const cache = appContext.emitsCache;
|
|
10953
|
+
const cache = asMixin ? mixinEmitsCache : appContext.emitsCache;
|
|
10726
10954
|
const cached = cache.get(comp);
|
|
10727
10955
|
if (cached !== void 0) {
|
|
10728
10956
|
return cached;
|
|
@@ -11194,7 +11422,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
11194
11422
|
const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
|
|
11195
11423
|
if (pendingBranch) {
|
|
11196
11424
|
suspense.pendingBranch = newBranch;
|
|
11197
|
-
if (isSameVNodeType(
|
|
11425
|
+
if (isSameVNodeType(pendingBranch, newBranch)) {
|
|
11198
11426
|
patch(
|
|
11199
11427
|
pendingBranch,
|
|
11200
11428
|
newBranch,
|
|
@@ -11265,7 +11493,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
11265
11493
|
);
|
|
11266
11494
|
setActiveBranch(suspense, newFallback);
|
|
11267
11495
|
}
|
|
11268
|
-
} else if (activeBranch && isSameVNodeType(
|
|
11496
|
+
} else if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
|
|
11269
11497
|
patch(
|
|
11270
11498
|
activeBranch,
|
|
11271
11499
|
newBranch,
|
|
@@ -11296,7 +11524,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
11296
11524
|
}
|
|
11297
11525
|
}
|
|
11298
11526
|
} else {
|
|
11299
|
-
if (activeBranch && isSameVNodeType(
|
|
11527
|
+
if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
|
|
11300
11528
|
patch(
|
|
11301
11529
|
activeBranch,
|
|
11302
11530
|
newBranch,
|
|
@@ -11409,7 +11637,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
11409
11637
|
pendingId,
|
|
11410
11638
|
effects,
|
|
11411
11639
|
parentComponent: parentComponent2,
|
|
11412
|
-
container: container2
|
|
11640
|
+
container: container2,
|
|
11641
|
+
isInFallback
|
|
11413
11642
|
} = suspense;
|
|
11414
11643
|
let delayEnter = false;
|
|
11415
11644
|
if (suspense.isHydrating) {
|
|
@@ -11427,6 +11656,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
11427
11656
|
parentComponent2
|
|
11428
11657
|
);
|
|
11429
11658
|
queuePostFlushCb(effects);
|
|
11659
|
+
if (isInFallback && vnode2.ssFallback) {
|
|
11660
|
+
vnode2.ssFallback.el = null;
|
|
11661
|
+
}
|
|
11430
11662
|
}
|
|
11431
11663
|
};
|
|
11432
11664
|
}
|
|
@@ -11435,6 +11667,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
11435
11667
|
anchor = next(activeBranch);
|
|
11436
11668
|
}
|
|
11437
11669
|
unmount(activeBranch, parentComponent2, suspense, true);
|
|
11670
|
+
if (!delayEnter && isInFallback && vnode2.ssFallback) {
|
|
11671
|
+
vnode2.ssFallback.el = null;
|
|
11672
|
+
}
|
|
11438
11673
|
}
|
|
11439
11674
|
if (!delayEnter) {
|
|
11440
11675
|
move(
|
|
@@ -11559,6 +11794,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
11559
11794
|
optimized2
|
|
11560
11795
|
);
|
|
11561
11796
|
if (placeholder) {
|
|
11797
|
+
vnode2.placeholder = null;
|
|
11562
11798
|
remove(placeholder);
|
|
11563
11799
|
}
|
|
11564
11800
|
updateHOCHostEl(instance, vnode2.el);
|
|
@@ -11821,15 +12057,11 @@ const createVNodeWithArgsTransform = (...args) => {
|
|
|
11821
12057
|
);
|
|
11822
12058
|
};
|
|
11823
12059
|
const normalizeKey = ({ key }) => key != null ? key : null;
|
|
11824
|
-
const normalizeRef = ({
|
|
11825
|
-
ref,
|
|
11826
|
-
ref_key,
|
|
11827
|
-
ref_for
|
|
11828
|
-
}) => {
|
|
12060
|
+
const normalizeRef = ({ ref, ref_key, ref_for }, i = currentRenderingInstance) => {
|
|
11829
12061
|
if (typeof ref === "number") {
|
|
11830
12062
|
ref = "" + ref;
|
|
11831
12063
|
}
|
|
11832
|
-
return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i
|
|
12064
|
+
return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i, r: ref, k: ref_key, f: !!ref_for } : ref : null;
|
|
11833
12065
|
};
|
|
11834
12066
|
function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
|
|
11835
12067
|
const vnode = {
|
|
@@ -12002,6 +12234,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
12002
12234
|
suspense: vnode.suspense,
|
|
12003
12235
|
ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
|
|
12004
12236
|
ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
|
|
12237
|
+
placeholder: vnode.placeholder,
|
|
12005
12238
|
el: vnode.el,
|
|
12006
12239
|
anchor: vnode.anchor,
|
|
12007
12240
|
ctx: vnode.ctx,
|
|
@@ -12543,7 +12776,7 @@ function getComponentPublicInstance(instance) {
|
|
|
12543
12776
|
return instance.proxy;
|
|
12544
12777
|
}
|
|
12545
12778
|
}
|
|
12546
|
-
const classifyRE = /(?:^|[-_])
|
|
12779
|
+
const classifyRE = /(?:^|[-_])\w/g;
|
|
12547
12780
|
const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
|
|
12548
12781
|
function getComponentName(Component, includeInferred = true) {
|
|
12549
12782
|
return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
|
|
@@ -12579,23 +12812,28 @@ const computed = (getterOrOptions, debugOptions) => {
|
|
|
12579
12812
|
};
|
|
12580
12813
|
|
|
12581
12814
|
function h(type, propsOrChildren, children) {
|
|
12582
|
-
|
|
12583
|
-
|
|
12584
|
-
|
|
12585
|
-
|
|
12586
|
-
|
|
12815
|
+
try {
|
|
12816
|
+
setBlockTracking(-1);
|
|
12817
|
+
const l = arguments.length;
|
|
12818
|
+
if (l === 2) {
|
|
12819
|
+
if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
|
|
12820
|
+
if (isVNode(propsOrChildren)) {
|
|
12821
|
+
return createVNode(type, null, [propsOrChildren]);
|
|
12822
|
+
}
|
|
12823
|
+
return createVNode(type, propsOrChildren);
|
|
12824
|
+
} else {
|
|
12825
|
+
return createVNode(type, null, propsOrChildren);
|
|
12587
12826
|
}
|
|
12588
|
-
return createVNode(type, propsOrChildren);
|
|
12589
12827
|
} else {
|
|
12590
|
-
|
|
12591
|
-
|
|
12592
|
-
|
|
12593
|
-
|
|
12594
|
-
|
|
12595
|
-
|
|
12596
|
-
children = [children];
|
|
12828
|
+
if (l > 3) {
|
|
12829
|
+
children = Array.prototype.slice.call(arguments, 2);
|
|
12830
|
+
} else if (l === 3 && isVNode(children)) {
|
|
12831
|
+
children = [children];
|
|
12832
|
+
}
|
|
12833
|
+
return createVNode(type, propsOrChildren, children);
|
|
12597
12834
|
}
|
|
12598
|
-
|
|
12835
|
+
} finally {
|
|
12836
|
+
setBlockTracking(1);
|
|
12599
12837
|
}
|
|
12600
12838
|
}
|
|
12601
12839
|
|
|
@@ -12805,7 +13043,7 @@ function isMemoSame(cached, memo) {
|
|
|
12805
13043
|
return true;
|
|
12806
13044
|
}
|
|
12807
13045
|
|
|
12808
|
-
const version = "3.6.0-alpha.
|
|
13046
|
+
const version = "3.6.0-alpha.3";
|
|
12809
13047
|
const warn = warn$1 ;
|
|
12810
13048
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
12811
13049
|
const devtools = devtools$1 ;
|
|
@@ -13075,11 +13313,11 @@ function resolveTransitionProps(rawProps) {
|
|
|
13075
13313
|
addTransitionClass(el, legacyLeaveFromClass);
|
|
13076
13314
|
}
|
|
13077
13315
|
if (!el._enterCancelled) {
|
|
13078
|
-
forceReflow();
|
|
13316
|
+
forceReflow(el);
|
|
13079
13317
|
addTransitionClass(el, leaveActiveClass);
|
|
13080
13318
|
} else {
|
|
13081
13319
|
addTransitionClass(el, leaveActiveClass);
|
|
13082
|
-
forceReflow();
|
|
13320
|
+
forceReflow(el);
|
|
13083
13321
|
}
|
|
13084
13322
|
nextFrame(() => {
|
|
13085
13323
|
if (!el._isLeaving) {
|
|
@@ -13208,7 +13446,7 @@ function getTransitionInfo(el, expectedType) {
|
|
|
13208
13446
|
type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION$1 : ANIMATION : null;
|
|
13209
13447
|
propCount = type ? type === TRANSITION$1 ? transitionDurations.length : animationDurations.length : 0;
|
|
13210
13448
|
}
|
|
13211
|
-
const hasTransform = type === TRANSITION$1 && /\b(transform|all)(
|
|
13449
|
+
const hasTransform = type === TRANSITION$1 && /\b(?:transform|all)(?:,|$)/.test(
|
|
13212
13450
|
getStyleProperties(`${TRANSITION$1}Property`).toString()
|
|
13213
13451
|
);
|
|
13214
13452
|
return {
|
|
@@ -13228,8 +13466,9 @@ function toMs(s) {
|
|
|
13228
13466
|
if (s === "auto") return 0;
|
|
13229
13467
|
return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
|
|
13230
13468
|
}
|
|
13231
|
-
function forceReflow() {
|
|
13232
|
-
|
|
13469
|
+
function forceReflow(el) {
|
|
13470
|
+
const targetDocument = el ? el.ownerDocument : document;
|
|
13471
|
+
return targetDocument.body.offsetHeight;
|
|
13233
13472
|
}
|
|
13234
13473
|
|
|
13235
13474
|
function patchClass(el, value, isSVG) {
|
|
@@ -13249,6 +13488,8 @@ function patchClass(el, value, isSVG) {
|
|
|
13249
13488
|
const vShowOriginalDisplay = Symbol("_vod");
|
|
13250
13489
|
const vShowHidden = Symbol("_vsh");
|
|
13251
13490
|
const vShow = {
|
|
13491
|
+
// used for prop mismatch check during hydration
|
|
13492
|
+
name: "show",
|
|
13252
13493
|
beforeMount(el, { value }, { transition }) {
|
|
13253
13494
|
el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
|
|
13254
13495
|
if (transition && value) {
|
|
@@ -13282,9 +13523,6 @@ const vShow = {
|
|
|
13282
13523
|
setDisplay(el, value);
|
|
13283
13524
|
}
|
|
13284
13525
|
};
|
|
13285
|
-
{
|
|
13286
|
-
vShow.name = "show";
|
|
13287
|
-
}
|
|
13288
13526
|
function setDisplay(el, value) {
|
|
13289
13527
|
el.style.display = value ? el[vShowOriginalDisplay] : "none";
|
|
13290
13528
|
el[vShowHidden] = !value;
|
|
@@ -13370,7 +13608,7 @@ function setVarsOnNode(el, vars) {
|
|
|
13370
13608
|
}
|
|
13371
13609
|
}
|
|
13372
13610
|
|
|
13373
|
-
const displayRE = /(
|
|
13611
|
+
const displayRE = /(?:^|;)\s*display\s*:/;
|
|
13374
13612
|
function patchStyle(el, prev, next) {
|
|
13375
13613
|
const style = el.style;
|
|
13376
13614
|
const isCssString = isString(next);
|
|
@@ -13719,11 +13957,10 @@ function shouldSetAsProp(el, key, value, isSVG) {
|
|
|
13719
13957
|
}
|
|
13720
13958
|
|
|
13721
13959
|
const REMOVAL = {};
|
|
13722
|
-
/*! #__NO_SIDE_EFFECTS__ */
|
|
13723
13960
|
// @__NO_SIDE_EFFECTS__
|
|
13724
13961
|
function defineCustomElement(options, extraOptions, _createApp) {
|
|
13725
|
-
|
|
13726
|
-
if (isPlainObject(Comp)) extend(Comp, extraOptions);
|
|
13962
|
+
let Comp = defineComponent(options, extraOptions);
|
|
13963
|
+
if (isPlainObject(Comp)) Comp = extend({}, Comp, extraOptions);
|
|
13727
13964
|
class VueCustomElement extends VueElement {
|
|
13728
13965
|
constructor(initialProps) {
|
|
13729
13966
|
super(Comp, initialProps, _createApp);
|
|
@@ -13732,10 +13969,9 @@ function defineCustomElement(options, extraOptions, _createApp) {
|
|
|
13732
13969
|
VueCustomElement.def = Comp;
|
|
13733
13970
|
return VueCustomElement;
|
|
13734
13971
|
}
|
|
13735
|
-
|
|
13736
|
-
const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
|
|
13972
|
+
const defineSSRCustomElement = (/* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
|
|
13737
13973
|
return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
|
|
13738
|
-
};
|
|
13974
|
+
});
|
|
13739
13975
|
const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
|
|
13740
13976
|
};
|
|
13741
13977
|
class VueElement extends BaseClass {
|
|
@@ -13759,6 +13995,8 @@ class VueElement extends BaseClass {
|
|
|
13759
13995
|
this._nonce = this._def.nonce;
|
|
13760
13996
|
this._connected = false;
|
|
13761
13997
|
this._resolved = false;
|
|
13998
|
+
this._patching = false;
|
|
13999
|
+
this._dirty = false;
|
|
13762
14000
|
this._numberProps = null;
|
|
13763
14001
|
this._styleChildren = /* @__PURE__ */ new WeakSet();
|
|
13764
14002
|
this._ob = null;
|
|
@@ -13771,7 +14009,11 @@ class VueElement extends BaseClass {
|
|
|
13771
14009
|
);
|
|
13772
14010
|
}
|
|
13773
14011
|
if (_def.shadowRoot !== false) {
|
|
13774
|
-
this.attachShadow(
|
|
14012
|
+
this.attachShadow(
|
|
14013
|
+
extend({}, _def.shadowRootOptions, {
|
|
14014
|
+
mode: "open"
|
|
14015
|
+
})
|
|
14016
|
+
);
|
|
13775
14017
|
this._root = this.shadowRoot;
|
|
13776
14018
|
} else {
|
|
13777
14019
|
this._root = this;
|
|
@@ -13831,9 +14073,18 @@ class VueElement extends BaseClass {
|
|
|
13831
14073
|
this._app && this._app.unmount();
|
|
13832
14074
|
if (this._instance) this._instance.ce = void 0;
|
|
13833
14075
|
this._app = this._instance = null;
|
|
14076
|
+
if (this._teleportTargets) {
|
|
14077
|
+
this._teleportTargets.clear();
|
|
14078
|
+
this._teleportTargets = void 0;
|
|
14079
|
+
}
|
|
13834
14080
|
}
|
|
13835
14081
|
});
|
|
13836
14082
|
}
|
|
14083
|
+
_processMutations(mutations) {
|
|
14084
|
+
for (const m of mutations) {
|
|
14085
|
+
this._setAttr(m.attributeName);
|
|
14086
|
+
}
|
|
14087
|
+
}
|
|
13837
14088
|
/**
|
|
13838
14089
|
* resolve inner component definition (handle possible async component)
|
|
13839
14090
|
*/
|
|
@@ -13844,11 +14095,7 @@ class VueElement extends BaseClass {
|
|
|
13844
14095
|
for (let i = 0; i < this.attributes.length; i++) {
|
|
13845
14096
|
this._setAttr(this.attributes[i].name);
|
|
13846
14097
|
}
|
|
13847
|
-
this._ob = new MutationObserver((
|
|
13848
|
-
for (const m of mutations) {
|
|
13849
|
-
this._setAttr(m.attributeName);
|
|
13850
|
-
}
|
|
13851
|
-
});
|
|
14098
|
+
this._ob = new MutationObserver(this._processMutations.bind(this));
|
|
13852
14099
|
this._ob.observe(this, { attributes: true });
|
|
13853
14100
|
const resolve = (def, isAsync = false) => {
|
|
13854
14101
|
this._resolved = true;
|
|
@@ -13925,7 +14172,7 @@ class VueElement extends BaseClass {
|
|
|
13925
14172
|
return this._getProp(key);
|
|
13926
14173
|
},
|
|
13927
14174
|
set(val) {
|
|
13928
|
-
this._setProp(key, val, true,
|
|
14175
|
+
this._setProp(key, val, true, !this._patching);
|
|
13929
14176
|
}
|
|
13930
14177
|
});
|
|
13931
14178
|
}
|
|
@@ -13951,6 +14198,7 @@ class VueElement extends BaseClass {
|
|
|
13951
14198
|
*/
|
|
13952
14199
|
_setProp(key, val, shouldReflect = true, shouldUpdate = false) {
|
|
13953
14200
|
if (val !== this._props[key]) {
|
|
14201
|
+
this._dirty = true;
|
|
13954
14202
|
if (val === REMOVAL) {
|
|
13955
14203
|
delete this._props[key];
|
|
13956
14204
|
} else {
|
|
@@ -13964,7 +14212,10 @@ class VueElement extends BaseClass {
|
|
|
13964
14212
|
}
|
|
13965
14213
|
if (shouldReflect) {
|
|
13966
14214
|
const ob = this._ob;
|
|
13967
|
-
|
|
14215
|
+
if (ob) {
|
|
14216
|
+
this._processMutations(ob.takeRecords());
|
|
14217
|
+
ob.disconnect();
|
|
14218
|
+
}
|
|
13968
14219
|
if (val === true) {
|
|
13969
14220
|
this.setAttribute(hyphenate(key), "");
|
|
13970
14221
|
} else if (typeof val === "string" || typeof val === "number") {
|
|
@@ -14068,7 +14319,7 @@ class VueElement extends BaseClass {
|
|
|
14068
14319
|
* Only called when shadowRoot is false
|
|
14069
14320
|
*/
|
|
14070
14321
|
_renderSlots() {
|
|
14071
|
-
const outlets =
|
|
14322
|
+
const outlets = this._getSlots();
|
|
14072
14323
|
const scopeId = this._instance.type.__scopeId;
|
|
14073
14324
|
for (let i = 0; i < outlets.length; i++) {
|
|
14074
14325
|
const o = outlets[i];
|
|
@@ -14094,12 +14345,45 @@ class VueElement extends BaseClass {
|
|
|
14094
14345
|
parent.removeChild(o);
|
|
14095
14346
|
}
|
|
14096
14347
|
}
|
|
14348
|
+
/**
|
|
14349
|
+
* @internal
|
|
14350
|
+
*/
|
|
14351
|
+
_getSlots() {
|
|
14352
|
+
const roots = [this];
|
|
14353
|
+
if (this._teleportTargets) {
|
|
14354
|
+
roots.push(...this._teleportTargets);
|
|
14355
|
+
}
|
|
14356
|
+
const slots = /* @__PURE__ */ new Set();
|
|
14357
|
+
for (const root of roots) {
|
|
14358
|
+
const found = root.querySelectorAll("slot");
|
|
14359
|
+
for (let i = 0; i < found.length; i++) {
|
|
14360
|
+
slots.add(found[i]);
|
|
14361
|
+
}
|
|
14362
|
+
}
|
|
14363
|
+
return Array.from(slots);
|
|
14364
|
+
}
|
|
14097
14365
|
/**
|
|
14098
14366
|
* @internal
|
|
14099
14367
|
*/
|
|
14100
14368
|
_injectChildStyle(comp) {
|
|
14101
14369
|
this._applyStyles(comp.styles, comp);
|
|
14102
14370
|
}
|
|
14371
|
+
/**
|
|
14372
|
+
* @internal
|
|
14373
|
+
*/
|
|
14374
|
+
_beginPatch() {
|
|
14375
|
+
this._patching = true;
|
|
14376
|
+
this._dirty = false;
|
|
14377
|
+
}
|
|
14378
|
+
/**
|
|
14379
|
+
* @internal
|
|
14380
|
+
*/
|
|
14381
|
+
_endPatch() {
|
|
14382
|
+
this._patching = false;
|
|
14383
|
+
if (this._dirty && this._instance) {
|
|
14384
|
+
this._update();
|
|
14385
|
+
}
|
|
14386
|
+
}
|
|
14103
14387
|
/**
|
|
14104
14388
|
* @internal
|
|
14105
14389
|
*/
|
|
@@ -14195,26 +14479,13 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
|
|
|
14195
14479
|
prevChildren = [];
|
|
14196
14480
|
return;
|
|
14197
14481
|
}
|
|
14198
|
-
prevChildren.forEach(callPendingCbs);
|
|
14482
|
+
prevChildren.forEach((vnode) => callPendingCbs(vnode.el));
|
|
14199
14483
|
prevChildren.forEach(recordPosition);
|
|
14200
14484
|
const movedChildren = prevChildren.filter(applyTranslation);
|
|
14201
|
-
forceReflow();
|
|
14485
|
+
forceReflow(instance.vnode.el);
|
|
14202
14486
|
movedChildren.forEach((c) => {
|
|
14203
14487
|
const el = c.el;
|
|
14204
|
-
|
|
14205
|
-
addTransitionClass(el, moveClass);
|
|
14206
|
-
style.transform = style.webkitTransform = style.transitionDuration = "";
|
|
14207
|
-
const cb = el[moveCbKey] = (e) => {
|
|
14208
|
-
if (e && e.target !== el) {
|
|
14209
|
-
return;
|
|
14210
|
-
}
|
|
14211
|
-
if (!e || /transform$/.test(e.propertyName)) {
|
|
14212
|
-
el.removeEventListener("transitionend", cb);
|
|
14213
|
-
el[moveCbKey] = null;
|
|
14214
|
-
removeTransitionClass(el, moveClass);
|
|
14215
|
-
}
|
|
14216
|
-
};
|
|
14217
|
-
el.addEventListener("transitionend", cb);
|
|
14488
|
+
handleMovedChildren(el, moveClass);
|
|
14218
14489
|
});
|
|
14219
14490
|
prevChildren = [];
|
|
14220
14491
|
});
|
|
@@ -14243,10 +14514,10 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
|
|
|
14243
14514
|
instance
|
|
14244
14515
|
)
|
|
14245
14516
|
);
|
|
14246
|
-
positionMap.set(
|
|
14247
|
-
child,
|
|
14248
|
-
child.el.
|
|
14249
|
-
);
|
|
14517
|
+
positionMap.set(child, {
|
|
14518
|
+
left: child.el.offsetLeft,
|
|
14519
|
+
top: child.el.offsetTop
|
|
14520
|
+
});
|
|
14250
14521
|
}
|
|
14251
14522
|
}
|
|
14252
14523
|
}
|
|
@@ -14267,8 +14538,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
|
|
|
14267
14538
|
}
|
|
14268
14539
|
});
|
|
14269
14540
|
const TransitionGroup = TransitionGroupImpl;
|
|
14270
|
-
function callPendingCbs(
|
|
14271
|
-
const el = c.el;
|
|
14541
|
+
function callPendingCbs(el) {
|
|
14272
14542
|
if (el[moveCbKey]) {
|
|
14273
14543
|
el[moveCbKey]();
|
|
14274
14544
|
}
|
|
@@ -14277,19 +14547,30 @@ function callPendingCbs(c) {
|
|
|
14277
14547
|
}
|
|
14278
14548
|
}
|
|
14279
14549
|
function recordPosition(c) {
|
|
14280
|
-
newPositionMap.set(c,
|
|
14550
|
+
newPositionMap.set(c, {
|
|
14551
|
+
left: c.el.offsetLeft,
|
|
14552
|
+
top: c.el.offsetTop
|
|
14553
|
+
});
|
|
14281
14554
|
}
|
|
14282
14555
|
function applyTranslation(c) {
|
|
14283
|
-
|
|
14284
|
-
|
|
14556
|
+
if (baseApplyTranslation(
|
|
14557
|
+
positionMap.get(c),
|
|
14558
|
+
newPositionMap.get(c),
|
|
14559
|
+
c.el
|
|
14560
|
+
)) {
|
|
14561
|
+
return c;
|
|
14562
|
+
}
|
|
14563
|
+
}
|
|
14564
|
+
function baseApplyTranslation(oldPos, newPos, el) {
|
|
14285
14565
|
const dx = oldPos.left - newPos.left;
|
|
14286
14566
|
const dy = oldPos.top - newPos.top;
|
|
14287
14567
|
if (dx || dy) {
|
|
14288
|
-
const s =
|
|
14568
|
+
const s = el.style;
|
|
14289
14569
|
s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
|
|
14290
14570
|
s.transitionDuration = "0s";
|
|
14291
|
-
return
|
|
14571
|
+
return true;
|
|
14292
14572
|
}
|
|
14573
|
+
return false;
|
|
14293
14574
|
}
|
|
14294
14575
|
function hasCSSTransform(el, root, moveClass) {
|
|
14295
14576
|
const clone = el.cloneNode();
|
|
@@ -14307,6 +14588,22 @@ function hasCSSTransform(el, root, moveClass) {
|
|
|
14307
14588
|
container.removeChild(clone);
|
|
14308
14589
|
return hasTransform;
|
|
14309
14590
|
}
|
|
14591
|
+
const handleMovedChildren = (el, moveClass) => {
|
|
14592
|
+
const style = el.style;
|
|
14593
|
+
addTransitionClass(el, moveClass);
|
|
14594
|
+
style.transform = style.webkitTransform = style.transitionDuration = "";
|
|
14595
|
+
const cb = el[moveCbKey] = (e) => {
|
|
14596
|
+
if (e && e.target !== el) {
|
|
14597
|
+
return;
|
|
14598
|
+
}
|
|
14599
|
+
if (!e || e.propertyName.endsWith("transform")) {
|
|
14600
|
+
el.removeEventListener("transitionend", cb);
|
|
14601
|
+
el[moveCbKey] = null;
|
|
14602
|
+
removeTransitionClass(el, moveClass);
|
|
14603
|
+
}
|
|
14604
|
+
};
|
|
14605
|
+
el.addEventListener("transitionend", cb);
|
|
14606
|
+
};
|
|
14310
14607
|
|
|
14311
14608
|
const getModelAssigner = (vnode) => {
|
|
14312
14609
|
const fn = vnode.props["onUpdate:modelValue"] || vnode.props["onModelCompat:input"];
|
|
@@ -14342,21 +14639,21 @@ const vModelText = {
|
|
|
14342
14639
|
vModelTextUpdate(el, oldValue, value, trim, number, lazy);
|
|
14343
14640
|
}
|
|
14344
14641
|
};
|
|
14642
|
+
function castValue(value, trim, number) {
|
|
14643
|
+
if (trim) value = value.trim();
|
|
14644
|
+
if (number) value = looseToNumber(value);
|
|
14645
|
+
return value;
|
|
14646
|
+
}
|
|
14345
14647
|
const vModelTextInit = (el, trim, number, lazy, set) => {
|
|
14346
14648
|
addEventListener(el, lazy ? "change" : "input", (e) => {
|
|
14347
14649
|
if (e.target.composing) return;
|
|
14348
|
-
|
|
14349
|
-
|
|
14350
|
-
|
|
14351
|
-
}
|
|
14352
|
-
if (number || el.type === "number") {
|
|
14353
|
-
domValue = looseToNumber(domValue);
|
|
14354
|
-
}
|
|
14355
|
-
(0, el[assignKey])(domValue);
|
|
14650
|
+
(0, el[assignKey])(
|
|
14651
|
+
castValue(el.value, trim, number || el.type === "number")
|
|
14652
|
+
);
|
|
14356
14653
|
});
|
|
14357
|
-
if (trim) {
|
|
14654
|
+
if (trim || number) {
|
|
14358
14655
|
addEventListener(el, "change", () => {
|
|
14359
|
-
el.value = el.value.
|
|
14656
|
+
el.value = castValue(el.value, trim, number || el.type === "number");
|
|
14360
14657
|
});
|
|
14361
14658
|
}
|
|
14362
14659
|
if (!lazy) {
|
|
@@ -14639,13 +14936,13 @@ const modifierGuards = {
|
|
|
14639
14936
|
const withModifiers = (fn, modifiers) => {
|
|
14640
14937
|
const cache = fn._withMods || (fn._withMods = {});
|
|
14641
14938
|
const cacheKey = modifiers.join(".");
|
|
14642
|
-
return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
|
|
14939
|
+
return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {
|
|
14643
14940
|
for (let i = 0; i < modifiers.length; i++) {
|
|
14644
14941
|
const guard = modifierGuards[modifiers[i]];
|
|
14645
14942
|
if (guard && guard(event, modifiers)) return;
|
|
14646
14943
|
}
|
|
14647
14944
|
return fn(event, ...args);
|
|
14648
|
-
});
|
|
14945
|
+
}));
|
|
14649
14946
|
};
|
|
14650
14947
|
const keyNames = {
|
|
14651
14948
|
esc: "escape",
|
|
@@ -14675,7 +14972,7 @@ const withKeys = (fn, modifiers) => {
|
|
|
14675
14972
|
}
|
|
14676
14973
|
const cache = fn._withKeys || (fn._withKeys = {});
|
|
14677
14974
|
const cacheKey = modifiers.join(".");
|
|
14678
|
-
return cache[cacheKey] || (cache[cacheKey] = (event) => {
|
|
14975
|
+
return cache[cacheKey] || (cache[cacheKey] = ((event) => {
|
|
14679
14976
|
if (!("key" in event)) {
|
|
14680
14977
|
return;
|
|
14681
14978
|
}
|
|
@@ -14705,7 +15002,7 @@ const withKeys = (fn, modifiers) => {
|
|
|
14705
15002
|
}
|
|
14706
15003
|
}
|
|
14707
15004
|
}
|
|
14708
|
-
});
|
|
15005
|
+
}));
|
|
14709
15006
|
};
|
|
14710
15007
|
|
|
14711
15008
|
const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
|
|
@@ -14719,13 +15016,13 @@ function ensureHydrationRenderer() {
|
|
|
14719
15016
|
enabledHydration = true;
|
|
14720
15017
|
return renderer;
|
|
14721
15018
|
}
|
|
14722
|
-
const render = (...args) => {
|
|
15019
|
+
const render = ((...args) => {
|
|
14723
15020
|
ensureRenderer().render(...args);
|
|
14724
|
-
};
|
|
14725
|
-
const hydrate = (...args) => {
|
|
15021
|
+
});
|
|
15022
|
+
const hydrate = ((...args) => {
|
|
14726
15023
|
ensureHydrationRenderer().hydrate(...args);
|
|
14727
|
-
};
|
|
14728
|
-
const createApp = (...args) => {
|
|
15024
|
+
});
|
|
15025
|
+
const createApp = ((...args) => {
|
|
14729
15026
|
const app = ensureRenderer().createApp(...args);
|
|
14730
15027
|
{
|
|
14731
15028
|
injectNativeTagCheck(app);
|
|
@@ -14741,7 +15038,7 @@ const createApp = (...args) => {
|
|
|
14741
15038
|
if (container.nodeType === 1) {
|
|
14742
15039
|
for (let i = 0; i < container.attributes.length; i++) {
|
|
14743
15040
|
const attr = container.attributes[i];
|
|
14744
|
-
if (attr.name !== "v-cloak" && /^(v-|:|@)/.test(attr.name)) {
|
|
15041
|
+
if (attr.name !== "v-cloak" && /^(?:v-|:|@)/.test(attr.name)) {
|
|
14745
15042
|
compatUtils.warnDeprecation(
|
|
14746
15043
|
"GLOBAL_MOUNT_CONTAINER",
|
|
14747
15044
|
null
|
|
@@ -14762,8 +15059,8 @@ const createApp = (...args) => {
|
|
|
14762
15059
|
return proxy;
|
|
14763
15060
|
};
|
|
14764
15061
|
return app;
|
|
14765
|
-
};
|
|
14766
|
-
const createSSRApp = (...args) => {
|
|
15062
|
+
});
|
|
15063
|
+
const createSSRApp = ((...args) => {
|
|
14767
15064
|
const app = ensureHydrationRenderer().createApp(...args);
|
|
14768
15065
|
{
|
|
14769
15066
|
injectNativeTagCheck(app);
|
|
@@ -14777,7 +15074,7 @@ const createSSRApp = (...args) => {
|
|
|
14777
15074
|
}
|
|
14778
15075
|
};
|
|
14779
15076
|
return app;
|
|
14780
|
-
};
|
|
15077
|
+
});
|
|
14781
15078
|
function resolveRootNamespace(container) {
|
|
14782
15079
|
if (container instanceof SVGElement) {
|
|
14783
15080
|
return "svg";
|
|
@@ -16283,7 +16580,7 @@ function isCoreComponent(tag) {
|
|
|
16283
16580
|
return BASE_TRANSITION;
|
|
16284
16581
|
}
|
|
16285
16582
|
}
|
|
16286
|
-
const nonIdentifierRE =
|
|
16583
|
+
const nonIdentifierRE = /^$|^\d|[^\$\w\xA0-\uFFFF]/;
|
|
16287
16584
|
const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);
|
|
16288
16585
|
const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/;
|
|
16289
16586
|
const validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/;
|
|
@@ -16352,7 +16649,7 @@ const isMemberExpressionBrowser = (exp) => {
|
|
|
16352
16649
|
return !currentOpenBracketCount && !currentOpenParensCount;
|
|
16353
16650
|
};
|
|
16354
16651
|
const isMemberExpression = isMemberExpressionBrowser ;
|
|
16355
|
-
const fnExpRE = /^\s*(async\s*)?(
|
|
16652
|
+
const fnExpRE = /^\s*(?:async\s*)?(?:\([^)]*?\)|[\w$_]+)\s*(?::[^=]+)?=>|^\s*(?:async\s+)?function(?:\s+[\w$]+)?\s*\(/;
|
|
16356
16653
|
const isFnExpressionBrowser = (exp) => fnExpRE.test(getExpSource(exp));
|
|
16357
16654
|
const isFnExpression = isFnExpressionBrowser ;
|
|
16358
16655
|
function assert(condition, msg) {
|
|
@@ -16395,6 +16692,9 @@ function hasDynamicKeyVBind(node) {
|
|
|
16395
16692
|
function isText$1(node) {
|
|
16396
16693
|
return node.type === 5 || node.type === 2;
|
|
16397
16694
|
}
|
|
16695
|
+
function isVPre(p) {
|
|
16696
|
+
return p.type === 7 && p.name === "pre";
|
|
16697
|
+
}
|
|
16398
16698
|
function isVSlot(p) {
|
|
16399
16699
|
return p.type === 7 && p.name === "slot";
|
|
16400
16700
|
}
|
|
@@ -16653,7 +16953,7 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
16653
16953
|
ondirarg(start, end) {
|
|
16654
16954
|
if (start === end) return;
|
|
16655
16955
|
const arg = getSlice(start, end);
|
|
16656
|
-
if (inVPre) {
|
|
16956
|
+
if (inVPre && !isVPre(currentProp)) {
|
|
16657
16957
|
currentProp.name += arg;
|
|
16658
16958
|
setLocEnd(currentProp.nameLoc, end);
|
|
16659
16959
|
} else {
|
|
@@ -16668,7 +16968,7 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
16668
16968
|
},
|
|
16669
16969
|
ondirmodifier(start, end) {
|
|
16670
16970
|
const mod = getSlice(start, end);
|
|
16671
|
-
if (inVPre) {
|
|
16971
|
+
if (inVPre && !isVPre(currentProp)) {
|
|
16672
16972
|
currentProp.name += "." + mod;
|
|
16673
16973
|
setLocEnd(currentProp.nameLoc, end);
|
|
16674
16974
|
} else if (currentProp.name === "slot") {
|
|
@@ -17296,6 +17596,11 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
|
|
|
17296
17596
|
} else if (child.type === 12) {
|
|
17297
17597
|
const constantType = doNotHoistNode ? 0 : getConstantType(child, context);
|
|
17298
17598
|
if (constantType >= 2) {
|
|
17599
|
+
if (child.codegenNode.type === 14 && child.codegenNode.arguments.length > 0) {
|
|
17600
|
+
child.codegenNode.arguments.push(
|
|
17601
|
+
-1 + (` /* ${PatchFlagNames[-1]} */` )
|
|
17602
|
+
);
|
|
17603
|
+
}
|
|
17299
17604
|
toCache.push(child);
|
|
17300
17605
|
continue;
|
|
17301
17606
|
}
|
|
@@ -17324,7 +17629,6 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
|
|
|
17324
17629
|
}
|
|
17325
17630
|
}
|
|
17326
17631
|
let cachedAsArray = false;
|
|
17327
|
-
const slotCacheKeys = [];
|
|
17328
17632
|
if (toCache.length === children.length && node.type === 1) {
|
|
17329
17633
|
if (node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) {
|
|
17330
17634
|
node.codegenNode.children = getCacheExpression(
|
|
@@ -17334,7 +17638,6 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
|
|
|
17334
17638
|
} else if (node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {
|
|
17335
17639
|
const slot = getSlotNode(node.codegenNode, "default");
|
|
17336
17640
|
if (slot) {
|
|
17337
|
-
slotCacheKeys.push(context.cached.length);
|
|
17338
17641
|
slot.returns = getCacheExpression(
|
|
17339
17642
|
createArrayExpression(slot.returns)
|
|
17340
17643
|
);
|
|
@@ -17344,7 +17647,6 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
|
|
|
17344
17647
|
const slotName = findDir(node, "slot", true);
|
|
17345
17648
|
const slot = slotName && slotName.arg && getSlotNode(parent.codegenNode, slotName.arg);
|
|
17346
17649
|
if (slot) {
|
|
17347
|
-
slotCacheKeys.push(context.cached.length);
|
|
17348
17650
|
slot.returns = getCacheExpression(
|
|
17349
17651
|
createArrayExpression(slot.returns)
|
|
17350
17652
|
);
|
|
@@ -17354,23 +17656,12 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
|
|
|
17354
17656
|
}
|
|
17355
17657
|
if (!cachedAsArray) {
|
|
17356
17658
|
for (const child of toCache) {
|
|
17357
|
-
slotCacheKeys.push(context.cached.length);
|
|
17358
17659
|
child.codegenNode = context.cache(child.codegenNode);
|
|
17359
17660
|
}
|
|
17360
17661
|
}
|
|
17361
|
-
if (slotCacheKeys.length && node.type === 1 && node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {
|
|
17362
|
-
node.codegenNode.children.properties.push(
|
|
17363
|
-
createObjectProperty(
|
|
17364
|
-
`__`,
|
|
17365
|
-
createSimpleExpression(JSON.stringify(slotCacheKeys), false)
|
|
17366
|
-
)
|
|
17367
|
-
);
|
|
17368
|
-
}
|
|
17369
17662
|
function getCacheExpression(value) {
|
|
17370
17663
|
const exp = context.cache(value);
|
|
17371
|
-
|
|
17372
|
-
exp.needArraySpread = true;
|
|
17373
|
-
}
|
|
17664
|
+
exp.needArraySpread = true;
|
|
17374
17665
|
return exp;
|
|
17375
17666
|
}
|
|
17376
17667
|
function getSlotNode(node2, name) {
|
|
@@ -18501,7 +18792,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
|
|
|
18501
18792
|
}
|
|
18502
18793
|
|
|
18503
18794
|
const transformIf = createStructuralDirectiveTransform(
|
|
18504
|
-
/^(if|else|else-if)$/,
|
|
18795
|
+
/^(?:if|else|else-if)$/,
|
|
18505
18796
|
(node, dir, context) => {
|
|
18506
18797
|
return processIf(node, dir, context, (ifNode, branch, isRoot) => {
|
|
18507
18798
|
const siblings = context.parent.children;
|
|
@@ -18570,7 +18861,7 @@ function processIf(node, dir, context, processCodegen) {
|
|
|
18570
18861
|
continue;
|
|
18571
18862
|
}
|
|
18572
18863
|
if (sibling && sibling.type === 9) {
|
|
18573
|
-
if (dir.name === "else-if" && sibling.branches[sibling.branches.length - 1].condition === void 0) {
|
|
18864
|
+
if ((dir.name === "else-if" || dir.name === "else") && sibling.branches[sibling.branches.length - 1].condition === void 0) {
|
|
18574
18865
|
context.onError(
|
|
18575
18866
|
createCompilerError(30, node.loc)
|
|
18576
18867
|
);
|
|
@@ -18719,80 +19010,6 @@ function getParentCondition(node) {
|
|
|
18719
19010
|
}
|
|
18720
19011
|
}
|
|
18721
19012
|
|
|
18722
|
-
const transformBind = (dir, _node, context) => {
|
|
18723
|
-
const { modifiers, loc } = dir;
|
|
18724
|
-
const arg = dir.arg;
|
|
18725
|
-
let { exp } = dir;
|
|
18726
|
-
if (exp && exp.type === 4 && !exp.content.trim()) {
|
|
18727
|
-
{
|
|
18728
|
-
exp = void 0;
|
|
18729
|
-
}
|
|
18730
|
-
}
|
|
18731
|
-
if (!exp) {
|
|
18732
|
-
if (arg.type !== 4 || !arg.isStatic) {
|
|
18733
|
-
context.onError(
|
|
18734
|
-
createCompilerError(
|
|
18735
|
-
52,
|
|
18736
|
-
arg.loc
|
|
18737
|
-
)
|
|
18738
|
-
);
|
|
18739
|
-
return {
|
|
18740
|
-
props: [
|
|
18741
|
-
createObjectProperty(arg, createSimpleExpression("", true, loc))
|
|
18742
|
-
]
|
|
18743
|
-
};
|
|
18744
|
-
}
|
|
18745
|
-
transformBindShorthand(dir);
|
|
18746
|
-
exp = dir.exp;
|
|
18747
|
-
}
|
|
18748
|
-
if (arg.type !== 4) {
|
|
18749
|
-
arg.children.unshift(`(`);
|
|
18750
|
-
arg.children.push(`) || ""`);
|
|
18751
|
-
} else if (!arg.isStatic) {
|
|
18752
|
-
arg.content = `${arg.content} || ""`;
|
|
18753
|
-
}
|
|
18754
|
-
if (modifiers.some((mod) => mod.content === "camel")) {
|
|
18755
|
-
if (arg.type === 4) {
|
|
18756
|
-
if (arg.isStatic) {
|
|
18757
|
-
arg.content = camelize(arg.content);
|
|
18758
|
-
} else {
|
|
18759
|
-
arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`;
|
|
18760
|
-
}
|
|
18761
|
-
} else {
|
|
18762
|
-
arg.children.unshift(`${context.helperString(CAMELIZE)}(`);
|
|
18763
|
-
arg.children.push(`)`);
|
|
18764
|
-
}
|
|
18765
|
-
}
|
|
18766
|
-
if (!context.inSSR) {
|
|
18767
|
-
if (modifiers.some((mod) => mod.content === "prop")) {
|
|
18768
|
-
injectPrefix(arg, ".");
|
|
18769
|
-
}
|
|
18770
|
-
if (modifiers.some((mod) => mod.content === "attr")) {
|
|
18771
|
-
injectPrefix(arg, "^");
|
|
18772
|
-
}
|
|
18773
|
-
}
|
|
18774
|
-
return {
|
|
18775
|
-
props: [createObjectProperty(arg, exp)]
|
|
18776
|
-
};
|
|
18777
|
-
};
|
|
18778
|
-
const transformBindShorthand = (dir, context) => {
|
|
18779
|
-
const arg = dir.arg;
|
|
18780
|
-
const propName = camelize(arg.content);
|
|
18781
|
-
dir.exp = createSimpleExpression(propName, false, arg.loc);
|
|
18782
|
-
};
|
|
18783
|
-
const injectPrefix = (arg, prefix) => {
|
|
18784
|
-
if (arg.type === 4) {
|
|
18785
|
-
if (arg.isStatic) {
|
|
18786
|
-
arg.content = prefix + arg.content;
|
|
18787
|
-
} else {
|
|
18788
|
-
arg.content = `\`${prefix}\${${arg.content}}\``;
|
|
18789
|
-
}
|
|
18790
|
-
} else {
|
|
18791
|
-
arg.children.unshift(`'${prefix}' + (`);
|
|
18792
|
-
arg.children.push(`)`);
|
|
18793
|
-
}
|
|
18794
|
-
};
|
|
18795
|
-
|
|
18796
19013
|
const transformFor = createStructuralDirectiveTransform(
|
|
18797
19014
|
"for",
|
|
18798
19015
|
(node, dir, context) => {
|
|
@@ -18804,10 +19021,7 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
18804
19021
|
const isTemplate = isTemplateNode(node);
|
|
18805
19022
|
const memo = findDir(node, "memo");
|
|
18806
19023
|
const keyProp = findProp(node, `key`, false, true);
|
|
18807
|
-
|
|
18808
|
-
if (isDirKey && !keyProp.exp) {
|
|
18809
|
-
transformBindShorthand(keyProp);
|
|
18810
|
-
}
|
|
19024
|
+
keyProp && keyProp.type === 7;
|
|
18811
19025
|
let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
|
|
18812
19026
|
const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
|
|
18813
19027
|
const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
|
|
@@ -19088,7 +19302,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
19088
19302
|
);
|
|
19089
19303
|
} else if (vElse = findDir(
|
|
19090
19304
|
slotElement,
|
|
19091
|
-
/^else(
|
|
19305
|
+
/^else(?:-if)?$/,
|
|
19092
19306
|
true
|
|
19093
19307
|
/* allowEmpty */
|
|
19094
19308
|
)) {
|
|
@@ -19100,7 +19314,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
19100
19314
|
break;
|
|
19101
19315
|
}
|
|
19102
19316
|
}
|
|
19103
|
-
if (prev && isTemplateNode(prev) && findDir(prev, /^(else-)?if$/)) {
|
|
19317
|
+
if (prev && isTemplateNode(prev) && findDir(prev, /^(?:else-)?if$/)) {
|
|
19104
19318
|
let conditional = dynamicSlots[dynamicSlots.length - 1];
|
|
19105
19319
|
while (conditional.alternate.type === 19) {
|
|
19106
19320
|
conditional = conditional.alternate;
|
|
@@ -19960,6 +20174,58 @@ const transformOn$1 = (dir, node, context, augmentor) => {
|
|
|
19960
20174
|
return ret;
|
|
19961
20175
|
};
|
|
19962
20176
|
|
|
20177
|
+
const transformBind = (dir, _node, context) => {
|
|
20178
|
+
const { modifiers, loc } = dir;
|
|
20179
|
+
const arg = dir.arg;
|
|
20180
|
+
let { exp } = dir;
|
|
20181
|
+
if (exp && exp.type === 4 && !exp.content.trim()) {
|
|
20182
|
+
{
|
|
20183
|
+
exp = void 0;
|
|
20184
|
+
}
|
|
20185
|
+
}
|
|
20186
|
+
if (arg.type !== 4) {
|
|
20187
|
+
arg.children.unshift(`(`);
|
|
20188
|
+
arg.children.push(`) || ""`);
|
|
20189
|
+
} else if (!arg.isStatic) {
|
|
20190
|
+
arg.content = arg.content ? `${arg.content} || ""` : `""`;
|
|
20191
|
+
}
|
|
20192
|
+
if (modifiers.some((mod) => mod.content === "camel")) {
|
|
20193
|
+
if (arg.type === 4) {
|
|
20194
|
+
if (arg.isStatic) {
|
|
20195
|
+
arg.content = camelize(arg.content);
|
|
20196
|
+
} else {
|
|
20197
|
+
arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`;
|
|
20198
|
+
}
|
|
20199
|
+
} else {
|
|
20200
|
+
arg.children.unshift(`${context.helperString(CAMELIZE)}(`);
|
|
20201
|
+
arg.children.push(`)`);
|
|
20202
|
+
}
|
|
20203
|
+
}
|
|
20204
|
+
if (!context.inSSR) {
|
|
20205
|
+
if (modifiers.some((mod) => mod.content === "prop")) {
|
|
20206
|
+
injectPrefix(arg, ".");
|
|
20207
|
+
}
|
|
20208
|
+
if (modifiers.some((mod) => mod.content === "attr")) {
|
|
20209
|
+
injectPrefix(arg, "^");
|
|
20210
|
+
}
|
|
20211
|
+
}
|
|
20212
|
+
return {
|
|
20213
|
+
props: [createObjectProperty(arg, exp)]
|
|
20214
|
+
};
|
|
20215
|
+
};
|
|
20216
|
+
const injectPrefix = (arg, prefix) => {
|
|
20217
|
+
if (arg.type === 4) {
|
|
20218
|
+
if (arg.isStatic) {
|
|
20219
|
+
arg.content = prefix + arg.content;
|
|
20220
|
+
} else {
|
|
20221
|
+
arg.content = `\`${prefix}\${${arg.content}}\``;
|
|
20222
|
+
}
|
|
20223
|
+
} else {
|
|
20224
|
+
arg.children.unshift(`'${prefix}' + (`);
|
|
20225
|
+
arg.children.push(`)`);
|
|
20226
|
+
}
|
|
20227
|
+
};
|
|
20228
|
+
|
|
19963
20229
|
const transformText = (node, context) => {
|
|
19964
20230
|
if (node.type === 0 || node.type === 1 || node.type === 11 || node.type === 10) {
|
|
19965
20231
|
return () => {
|
|
@@ -20268,7 +20534,7 @@ const seen = /* @__PURE__ */ new WeakSet();
|
|
|
20268
20534
|
const transformMemo = (node, context) => {
|
|
20269
20535
|
if (node.type === 1) {
|
|
20270
20536
|
const dir = findDir(node, "memo");
|
|
20271
|
-
if (!dir || seen.has(node)) {
|
|
20537
|
+
if (!dir || seen.has(node) || context.inSSR) {
|
|
20272
20538
|
return;
|
|
20273
20539
|
}
|
|
20274
20540
|
seen.add(node);
|
|
@@ -20290,9 +20556,36 @@ const transformMemo = (node, context) => {
|
|
|
20290
20556
|
}
|
|
20291
20557
|
};
|
|
20292
20558
|
|
|
20559
|
+
const transformVBindShorthand = (node, context) => {
|
|
20560
|
+
if (node.type === 1) {
|
|
20561
|
+
for (const prop of node.props) {
|
|
20562
|
+
if (prop.type === 7 && prop.name === "bind" && (!prop.exp || // #13930 :foo in in-DOM templates will be parsed into :foo="" by browser
|
|
20563
|
+
prop.exp.type === 4 && !prop.exp.content.trim()) && prop.arg) {
|
|
20564
|
+
const arg = prop.arg;
|
|
20565
|
+
if (arg.type !== 4 || !arg.isStatic) {
|
|
20566
|
+
context.onError(
|
|
20567
|
+
createCompilerError(
|
|
20568
|
+
52,
|
|
20569
|
+
arg.loc
|
|
20570
|
+
)
|
|
20571
|
+
);
|
|
20572
|
+
prop.exp = createSimpleExpression("", true, arg.loc);
|
|
20573
|
+
} else {
|
|
20574
|
+
const propName = camelize(arg.content);
|
|
20575
|
+
if (validFirstIdentCharRE.test(propName[0]) || // allow hyphen first char for https://github.com/vuejs/language-tools/pull/3424
|
|
20576
|
+
propName[0] === "-") {
|
|
20577
|
+
prop.exp = createSimpleExpression(propName, false, arg.loc);
|
|
20578
|
+
}
|
|
20579
|
+
}
|
|
20580
|
+
}
|
|
20581
|
+
}
|
|
20582
|
+
}
|
|
20583
|
+
};
|
|
20584
|
+
|
|
20293
20585
|
function getBaseTransformPreset(prefixIdentifiers) {
|
|
20294
20586
|
return [
|
|
20295
20587
|
[
|
|
20588
|
+
transformVBindShorthand,
|
|
20296
20589
|
transformOnce,
|
|
20297
20590
|
transformIf,
|
|
20298
20591
|
transformMemo,
|
|
@@ -20743,46 +21036,46 @@ const transformTransition = (node, context) => {
|
|
|
20743
21036
|
if (node.type === 1 && node.tagType === 1) {
|
|
20744
21037
|
const component = context.isBuiltInComponent(node.tag);
|
|
20745
21038
|
if (component === TRANSITION) {
|
|
20746
|
-
return ()
|
|
20747
|
-
if (!node.children.length) {
|
|
20748
|
-
return;
|
|
20749
|
-
}
|
|
20750
|
-
if (hasMultipleChildren(node)) {
|
|
20751
|
-
context.onError(
|
|
20752
|
-
createDOMCompilerError(
|
|
20753
|
-
62,
|
|
20754
|
-
{
|
|
20755
|
-
start: node.children[0].loc.start,
|
|
20756
|
-
end: node.children[node.children.length - 1].loc.end,
|
|
20757
|
-
source: ""
|
|
20758
|
-
}
|
|
20759
|
-
)
|
|
20760
|
-
);
|
|
20761
|
-
}
|
|
20762
|
-
const child = node.children[0];
|
|
20763
|
-
if (child.type === 1) {
|
|
20764
|
-
for (const p of child.props) {
|
|
20765
|
-
if (p.type === 7 && p.name === "show") {
|
|
20766
|
-
node.props.push({
|
|
20767
|
-
type: 6,
|
|
20768
|
-
name: "persisted",
|
|
20769
|
-
nameLoc: node.loc,
|
|
20770
|
-
value: void 0,
|
|
20771
|
-
loc: node.loc
|
|
20772
|
-
});
|
|
20773
|
-
}
|
|
20774
|
-
}
|
|
20775
|
-
}
|
|
20776
|
-
};
|
|
21039
|
+
return postTransformTransition(node, context.onError);
|
|
20777
21040
|
}
|
|
20778
21041
|
}
|
|
20779
21042
|
};
|
|
20780
|
-
function
|
|
21043
|
+
function postTransformTransition(node, onError, hasMultipleChildren = defaultHasMultipleChildren) {
|
|
21044
|
+
return () => {
|
|
21045
|
+
if (!node.children.length) {
|
|
21046
|
+
return;
|
|
21047
|
+
}
|
|
21048
|
+
if (hasMultipleChildren(node)) {
|
|
21049
|
+
onError(
|
|
21050
|
+
createDOMCompilerError(62, {
|
|
21051
|
+
start: node.children[0].loc.start,
|
|
21052
|
+
end: node.children[node.children.length - 1].loc.end,
|
|
21053
|
+
source: ""
|
|
21054
|
+
})
|
|
21055
|
+
);
|
|
21056
|
+
}
|
|
21057
|
+
const child = node.children[0];
|
|
21058
|
+
if (child.type === 1) {
|
|
21059
|
+
for (const p of child.props) {
|
|
21060
|
+
if (p.type === 7 && p.name === "show") {
|
|
21061
|
+
node.props.push({
|
|
21062
|
+
type: 6,
|
|
21063
|
+
name: "persisted",
|
|
21064
|
+
nameLoc: node.loc,
|
|
21065
|
+
value: void 0,
|
|
21066
|
+
loc: node.loc
|
|
21067
|
+
});
|
|
21068
|
+
}
|
|
21069
|
+
}
|
|
21070
|
+
}
|
|
21071
|
+
};
|
|
21072
|
+
}
|
|
21073
|
+
function defaultHasMultipleChildren(node) {
|
|
20781
21074
|
const children = node.children = node.children.filter(
|
|
20782
21075
|
(c) => c.type !== 3 && !(c.type === 2 && !c.content.trim())
|
|
20783
21076
|
);
|
|
20784
21077
|
const child = children[0];
|
|
20785
|
-
return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(
|
|
21078
|
+
return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(defaultHasMultipleChildren);
|
|
20786
21079
|
}
|
|
20787
21080
|
|
|
20788
21081
|
const ignoreSideEffectTags = (node, context) => {
|