vue 3.5.20 → 3.5.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vue.cjs.js +1 -1
- package/dist/vue.cjs.prod.js +1 -1
- package/dist/vue.esm-browser.js +213 -155
- package/dist/vue.esm-browser.prod.js +9 -9
- package/dist/vue.esm-bundler.js +1 -1
- package/dist/vue.global.js +213 -155
- package/dist/vue.global.prod.js +9 -9
- package/dist/vue.runtime.esm-browser.js +130 -73
- package/dist/vue.runtime.esm-browser.prod.js +3 -3
- package/dist/vue.runtime.esm-bundler.js +1 -1
- package/dist/vue.runtime.global.js +130 -73
- package/dist/vue.runtime.global.prod.js +3 -3
- package/package.json +6 -6
package/dist/vue.esm-browser.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* vue v3.5.
|
|
2
|
+
* vue v3.5.22
|
|
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);
|
|
@@ -61,10 +60,10 @@ const cacheStringFunction = (fn) => {
|
|
|
61
60
|
return hit || (cache[str] = fn(str));
|
|
62
61
|
});
|
|
63
62
|
};
|
|
64
|
-
const camelizeRE =
|
|
63
|
+
const camelizeRE = /-\w/g;
|
|
65
64
|
const camelize = cacheStringFunction(
|
|
66
65
|
(str) => {
|
|
67
|
-
return str.replace(camelizeRE, (
|
|
66
|
+
return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
|
|
68
67
|
}
|
|
69
68
|
);
|
|
70
69
|
const hyphenateRE = /\B([A-Z])/g;
|
|
@@ -1216,7 +1215,7 @@ function iterator(self, method, wrapValue) {
|
|
|
1216
1215
|
iter._next = iter.next;
|
|
1217
1216
|
iter.next = () => {
|
|
1218
1217
|
const result = iter._next();
|
|
1219
|
-
if (result.
|
|
1218
|
+
if (!result.done) {
|
|
1220
1219
|
result.value = wrapValue(result.value);
|
|
1221
1220
|
}
|
|
1222
1221
|
return result;
|
|
@@ -1343,7 +1342,8 @@ class BaseReactiveHandler {
|
|
|
1343
1342
|
return res;
|
|
1344
1343
|
}
|
|
1345
1344
|
if (isRef(res)) {
|
|
1346
|
-
|
|
1345
|
+
const value = targetIsArray && isIntegerKey(key) ? res : res.value;
|
|
1346
|
+
return isReadonly2 && isObject(value) ? readonly(value) : value;
|
|
1347
1347
|
}
|
|
1348
1348
|
if (isObject(res)) {
|
|
1349
1349
|
return isReadonly2 ? readonly(res) : reactive(res);
|
|
@@ -2227,11 +2227,11 @@ function traverse(value, depth = Infinity, seen) {
|
|
|
2227
2227
|
if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
|
|
2228
2228
|
return value;
|
|
2229
2229
|
}
|
|
2230
|
-
seen = seen || /* @__PURE__ */ new
|
|
2231
|
-
if (seen.
|
|
2230
|
+
seen = seen || /* @__PURE__ */ new Map();
|
|
2231
|
+
if ((seen.get(value) || 0) >= depth) {
|
|
2232
2232
|
return value;
|
|
2233
2233
|
}
|
|
2234
|
-
seen.
|
|
2234
|
+
seen.set(value, depth);
|
|
2235
2235
|
depth--;
|
|
2236
2236
|
if (isRef(value)) {
|
|
2237
2237
|
traverse(value.value, depth, seen);
|
|
@@ -2770,10 +2770,12 @@ function reload(id, newComp) {
|
|
|
2770
2770
|
dirtyInstances.delete(instance);
|
|
2771
2771
|
} else if (instance.parent) {
|
|
2772
2772
|
queueJob(() => {
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2773
|
+
if (!(instance.job.flags & 8)) {
|
|
2774
|
+
isHmrUpdating = true;
|
|
2775
|
+
instance.parent.update();
|
|
2776
|
+
isHmrUpdating = false;
|
|
2777
|
+
dirtyInstances.delete(instance);
|
|
2778
|
+
}
|
|
2777
2779
|
});
|
|
2778
2780
|
} else if (instance.appContext.reload) {
|
|
2779
2781
|
instance.appContext.reload();
|
|
@@ -2877,7 +2879,6 @@ const devtoolsComponentRemoved = (component) => {
|
|
|
2877
2879
|
_devtoolsComponentRemoved(component);
|
|
2878
2880
|
}
|
|
2879
2881
|
};
|
|
2880
|
-
/*! #__NO_SIDE_EFFECTS__ */
|
|
2881
2882
|
// @__NO_SIDE_EFFECTS__
|
|
2882
2883
|
function createDevtoolsComponentHook(hook) {
|
|
2883
2884
|
return (component) => {
|
|
@@ -3063,9 +3064,6 @@ const TeleportImpl = {
|
|
|
3063
3064
|
insert(mainAnchor, container, anchor);
|
|
3064
3065
|
const mount = (container2, anchor2) => {
|
|
3065
3066
|
if (shapeFlag & 16) {
|
|
3066
|
-
if (parentComponent && parentComponent.isCE) {
|
|
3067
|
-
parentComponent.ce._teleportTarget = container2;
|
|
3068
|
-
}
|
|
3069
3067
|
mountChildren(
|
|
3070
3068
|
children,
|
|
3071
3069
|
container2,
|
|
@@ -3087,6 +3085,9 @@ const TeleportImpl = {
|
|
|
3087
3085
|
} else if (namespace !== "mathml" && isTargetMathML(target)) {
|
|
3088
3086
|
namespace = "mathml";
|
|
3089
3087
|
}
|
|
3088
|
+
if (parentComponent && parentComponent.isCE) {
|
|
3089
|
+
(parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
|
|
3090
|
+
}
|
|
3090
3091
|
if (!disabled) {
|
|
3091
3092
|
mount(target, targetAnchor);
|
|
3092
3093
|
updateCssVars(n2, false);
|
|
@@ -3275,26 +3276,34 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
|
|
|
3275
3276
|
function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
|
|
3276
3277
|
o: { nextSibling, parentNode, querySelector, insert, createText }
|
|
3277
3278
|
}, hydrateChildren) {
|
|
3279
|
+
function hydrateDisabledTeleport(node2, vnode2, targetStart, targetAnchor) {
|
|
3280
|
+
vnode2.anchor = hydrateChildren(
|
|
3281
|
+
nextSibling(node2),
|
|
3282
|
+
vnode2,
|
|
3283
|
+
parentNode(node2),
|
|
3284
|
+
parentComponent,
|
|
3285
|
+
parentSuspense,
|
|
3286
|
+
slotScopeIds,
|
|
3287
|
+
optimized
|
|
3288
|
+
);
|
|
3289
|
+
vnode2.targetStart = targetStart;
|
|
3290
|
+
vnode2.targetAnchor = targetAnchor;
|
|
3291
|
+
}
|
|
3278
3292
|
const target = vnode.target = resolveTarget(
|
|
3279
3293
|
vnode.props,
|
|
3280
3294
|
querySelector
|
|
3281
3295
|
);
|
|
3296
|
+
const disabled = isTeleportDisabled(vnode.props);
|
|
3282
3297
|
if (target) {
|
|
3283
|
-
const disabled = isTeleportDisabled(vnode.props);
|
|
3284
3298
|
const targetNode = target._lpa || target.firstChild;
|
|
3285
3299
|
if (vnode.shapeFlag & 16) {
|
|
3286
3300
|
if (disabled) {
|
|
3287
|
-
|
|
3288
|
-
|
|
3301
|
+
hydrateDisabledTeleport(
|
|
3302
|
+
node,
|
|
3289
3303
|
vnode,
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
parentSuspense,
|
|
3293
|
-
slotScopeIds,
|
|
3294
|
-
optimized
|
|
3304
|
+
targetNode,
|
|
3305
|
+
targetNode && nextSibling(targetNode)
|
|
3295
3306
|
);
|
|
3296
|
-
vnode.targetStart = targetNode;
|
|
3297
|
-
vnode.targetAnchor = targetNode && nextSibling(targetNode);
|
|
3298
3307
|
} else {
|
|
3299
3308
|
vnode.anchor = nextSibling(node);
|
|
3300
3309
|
let targetAnchor = targetNode;
|
|
@@ -3325,6 +3334,10 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
3325
3334
|
}
|
|
3326
3335
|
}
|
|
3327
3336
|
updateCssVars(vnode, disabled);
|
|
3337
|
+
} else if (disabled) {
|
|
3338
|
+
if (vnode.shapeFlag & 16) {
|
|
3339
|
+
hydrateDisabledTeleport(node, vnode, node, nextSibling(node));
|
|
3340
|
+
}
|
|
3328
3341
|
}
|
|
3329
3342
|
return vnode.anchor && nextSibling(vnode.anchor);
|
|
3330
3343
|
}
|
|
@@ -3436,7 +3449,7 @@ const BaseTransitionImpl = {
|
|
|
3436
3449
|
setTransitionHooks(innerChild, enterHooks);
|
|
3437
3450
|
}
|
|
3438
3451
|
let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
|
|
3439
|
-
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(
|
|
3452
|
+
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
|
|
3440
3453
|
let leavingHooks = resolveTransitionHooks(
|
|
3441
3454
|
oldInnerChild,
|
|
3442
3455
|
rawProps,
|
|
@@ -3716,7 +3729,6 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
|
3716
3729
|
return ret;
|
|
3717
3730
|
}
|
|
3718
3731
|
|
|
3719
|
-
/*! #__NO_SIDE_EFFECTS__ */
|
|
3720
3732
|
// @__NO_SIDE_EFFECTS__
|
|
3721
3733
|
function defineComponent(options, extraOptions) {
|
|
3722
3734
|
return isFunction(options) ? (
|
|
@@ -3769,6 +3781,7 @@ function useTemplateRef(key) {
|
|
|
3769
3781
|
return ret;
|
|
3770
3782
|
}
|
|
3771
3783
|
|
|
3784
|
+
const pendingSetRefMap = /* @__PURE__ */ new WeakMap();
|
|
3772
3785
|
function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
3773
3786
|
if (isArray(rawRef)) {
|
|
3774
3787
|
rawRef.forEach(
|
|
@@ -3818,6 +3831,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
3818
3831
|
return !knownTemplateRefs.has(ref2);
|
|
3819
3832
|
};
|
|
3820
3833
|
if (oldRef != null && oldRef !== ref) {
|
|
3834
|
+
invalidatePendingSetRef(oldRawRef);
|
|
3821
3835
|
if (isString(oldRef)) {
|
|
3822
3836
|
refs[oldRef] = null;
|
|
3823
3837
|
if (canSetSetupRef(oldRef)) {
|
|
@@ -3875,9 +3889,15 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
3875
3889
|
}
|
|
3876
3890
|
};
|
|
3877
3891
|
if (value) {
|
|
3878
|
-
|
|
3879
|
-
|
|
3892
|
+
const job = () => {
|
|
3893
|
+
doSet();
|
|
3894
|
+
pendingSetRefMap.delete(rawRef);
|
|
3895
|
+
};
|
|
3896
|
+
job.id = -1;
|
|
3897
|
+
pendingSetRefMap.set(rawRef, job);
|
|
3898
|
+
queuePostRenderEffect(job, parentSuspense);
|
|
3880
3899
|
} else {
|
|
3900
|
+
invalidatePendingSetRef(rawRef);
|
|
3881
3901
|
doSet();
|
|
3882
3902
|
}
|
|
3883
3903
|
} else {
|
|
@@ -3885,6 +3905,13 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
3885
3905
|
}
|
|
3886
3906
|
}
|
|
3887
3907
|
}
|
|
3908
|
+
function invalidatePendingSetRef(rawRef) {
|
|
3909
|
+
const pendingSetRef = pendingSetRefMap.get(rawRef);
|
|
3910
|
+
if (pendingSetRef) {
|
|
3911
|
+
pendingSetRef.flags |= 8;
|
|
3912
|
+
pendingSetRefMap.delete(rawRef);
|
|
3913
|
+
}
|
|
3914
|
+
}
|
|
3888
3915
|
|
|
3889
3916
|
let hasLoggedMismatchError = false;
|
|
3890
3917
|
const logMismatchError = () => {
|
|
@@ -4617,7 +4644,6 @@ function forEachElement(node, cb) {
|
|
|
4617
4644
|
}
|
|
4618
4645
|
|
|
4619
4646
|
const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
|
|
4620
|
-
/*! #__NO_SIDE_EFFECTS__ */
|
|
4621
4647
|
// @__NO_SIDE_EFFECTS__
|
|
4622
4648
|
function defineAsyncComponent(source) {
|
|
4623
4649
|
if (isFunction(source)) {
|
|
@@ -5227,12 +5253,13 @@ function createSlots(slots, dynamicSlots) {
|
|
|
5227
5253
|
|
|
5228
5254
|
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
5229
5255
|
if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
|
|
5256
|
+
const hasProps = Object.keys(props).length > 0;
|
|
5230
5257
|
if (name !== "default") props.name = name;
|
|
5231
5258
|
return openBlock(), createBlock(
|
|
5232
5259
|
Fragment,
|
|
5233
5260
|
null,
|
|
5234
5261
|
[createVNode("slot", props, fallback && fallback())],
|
|
5235
|
-
64
|
|
5262
|
+
hasProps ? -2 : 64
|
|
5236
5263
|
);
|
|
5237
5264
|
}
|
|
5238
5265
|
let slot = slots[name];
|
|
@@ -8655,8 +8682,9 @@ function emit(instance, event, ...rawArgs) {
|
|
|
8655
8682
|
);
|
|
8656
8683
|
}
|
|
8657
8684
|
}
|
|
8685
|
+
const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
|
|
8658
8686
|
function normalizeEmitsOptions(comp, appContext, asMixin = false) {
|
|
8659
|
-
const cache = appContext.emitsCache;
|
|
8687
|
+
const cache = asMixin ? mixinEmitsCache : appContext.emitsCache;
|
|
8660
8688
|
const cached = cache.get(comp);
|
|
8661
8689
|
if (cached !== void 0) {
|
|
8662
8690
|
return cached;
|
|
@@ -9104,7 +9132,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
9104
9132
|
const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
|
|
9105
9133
|
if (pendingBranch) {
|
|
9106
9134
|
suspense.pendingBranch = newBranch;
|
|
9107
|
-
if (isSameVNodeType(
|
|
9135
|
+
if (isSameVNodeType(pendingBranch, newBranch)) {
|
|
9108
9136
|
patch(
|
|
9109
9137
|
pendingBranch,
|
|
9110
9138
|
newBranch,
|
|
@@ -9175,7 +9203,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
9175
9203
|
);
|
|
9176
9204
|
setActiveBranch(suspense, newFallback);
|
|
9177
9205
|
}
|
|
9178
|
-
} else if (activeBranch && isSameVNodeType(
|
|
9206
|
+
} else if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
|
|
9179
9207
|
patch(
|
|
9180
9208
|
activeBranch,
|
|
9181
9209
|
newBranch,
|
|
@@ -9206,7 +9234,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
9206
9234
|
}
|
|
9207
9235
|
}
|
|
9208
9236
|
} else {
|
|
9209
|
-
if (activeBranch && isSameVNodeType(
|
|
9237
|
+
if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
|
|
9210
9238
|
patch(
|
|
9211
9239
|
activeBranch,
|
|
9212
9240
|
newBranch,
|
|
@@ -10363,7 +10391,7 @@ function getComponentPublicInstance(instance) {
|
|
|
10363
10391
|
return instance.proxy;
|
|
10364
10392
|
}
|
|
10365
10393
|
}
|
|
10366
|
-
const classifyRE = /(?:^|[-_])
|
|
10394
|
+
const classifyRE = /(?:^|[-_])\w/g;
|
|
10367
10395
|
const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
|
|
10368
10396
|
function getComponentName(Component, includeInferred = true) {
|
|
10369
10397
|
return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
|
|
@@ -10406,23 +10434,28 @@ const computed = (getterOrOptions, debugOptions) => {
|
|
|
10406
10434
|
};
|
|
10407
10435
|
|
|
10408
10436
|
function h(type, propsOrChildren, children) {
|
|
10409
|
-
|
|
10410
|
-
|
|
10411
|
-
|
|
10412
|
-
|
|
10413
|
-
|
|
10437
|
+
try {
|
|
10438
|
+
setBlockTracking(-1);
|
|
10439
|
+
const l = arguments.length;
|
|
10440
|
+
if (l === 2) {
|
|
10441
|
+
if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
|
|
10442
|
+
if (isVNode(propsOrChildren)) {
|
|
10443
|
+
return createVNode(type, null, [propsOrChildren]);
|
|
10444
|
+
}
|
|
10445
|
+
return createVNode(type, propsOrChildren);
|
|
10446
|
+
} else {
|
|
10447
|
+
return createVNode(type, null, propsOrChildren);
|
|
10414
10448
|
}
|
|
10415
|
-
return createVNode(type, propsOrChildren);
|
|
10416
10449
|
} else {
|
|
10417
|
-
|
|
10418
|
-
|
|
10419
|
-
|
|
10420
|
-
|
|
10421
|
-
|
|
10422
|
-
|
|
10423
|
-
children = [children];
|
|
10450
|
+
if (l > 3) {
|
|
10451
|
+
children = Array.prototype.slice.call(arguments, 2);
|
|
10452
|
+
} else if (l === 3 && isVNode(children)) {
|
|
10453
|
+
children = [children];
|
|
10454
|
+
}
|
|
10455
|
+
return createVNode(type, propsOrChildren, children);
|
|
10424
10456
|
}
|
|
10425
|
-
|
|
10457
|
+
} finally {
|
|
10458
|
+
setBlockTracking(1);
|
|
10426
10459
|
}
|
|
10427
10460
|
}
|
|
10428
10461
|
|
|
@@ -10632,7 +10665,7 @@ function isMemoSame(cached, memo) {
|
|
|
10632
10665
|
return true;
|
|
10633
10666
|
}
|
|
10634
10667
|
|
|
10635
|
-
const version = "3.5.
|
|
10668
|
+
const version = "3.5.22";
|
|
10636
10669
|
const warn = warn$1 ;
|
|
10637
10670
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
10638
10671
|
const devtools = devtools$1 ;
|
|
@@ -10861,11 +10894,11 @@ function resolveTransitionProps(rawProps) {
|
|
|
10861
10894
|
const resolve = () => finishLeave(el, done);
|
|
10862
10895
|
addTransitionClass(el, leaveFromClass);
|
|
10863
10896
|
if (!el._enterCancelled) {
|
|
10864
|
-
forceReflow();
|
|
10897
|
+
forceReflow(el);
|
|
10865
10898
|
addTransitionClass(el, leaveActiveClass);
|
|
10866
10899
|
} else {
|
|
10867
10900
|
addTransitionClass(el, leaveActiveClass);
|
|
10868
|
-
forceReflow();
|
|
10901
|
+
forceReflow(el);
|
|
10869
10902
|
}
|
|
10870
10903
|
nextFrame(() => {
|
|
10871
10904
|
if (!el._isLeaving) {
|
|
@@ -10991,7 +11024,7 @@ function getTransitionInfo(el, expectedType) {
|
|
|
10991
11024
|
type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION$1 : ANIMATION : null;
|
|
10992
11025
|
propCount = type ? type === TRANSITION$1 ? transitionDurations.length : animationDurations.length : 0;
|
|
10993
11026
|
}
|
|
10994
|
-
const hasTransform = type === TRANSITION$1 && /\b(transform|all)(
|
|
11027
|
+
const hasTransform = type === TRANSITION$1 && /\b(?:transform|all)(?:,|$)/.test(
|
|
10995
11028
|
getStyleProperties(`${TRANSITION$1}Property`).toString()
|
|
10996
11029
|
);
|
|
10997
11030
|
return {
|
|
@@ -11011,8 +11044,9 @@ function toMs(s) {
|
|
|
11011
11044
|
if (s === "auto") return 0;
|
|
11012
11045
|
return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
|
|
11013
11046
|
}
|
|
11014
|
-
function forceReflow() {
|
|
11015
|
-
|
|
11047
|
+
function forceReflow(el) {
|
|
11048
|
+
const targetDocument = el ? el.ownerDocument : document;
|
|
11049
|
+
return targetDocument.body.offsetHeight;
|
|
11016
11050
|
}
|
|
11017
11051
|
|
|
11018
11052
|
function patchClass(el, value, isSVG) {
|
|
@@ -11152,7 +11186,7 @@ function setVarsOnNode(el, vars) {
|
|
|
11152
11186
|
}
|
|
11153
11187
|
}
|
|
11154
11188
|
|
|
11155
|
-
const displayRE = /(
|
|
11189
|
+
const displayRE = /(?:^|;)\s*display\s*:/;
|
|
11156
11190
|
function patchStyle(el, prev, next) {
|
|
11157
11191
|
const style = el.style;
|
|
11158
11192
|
const isCssString = isString(next);
|
|
@@ -11475,11 +11509,10 @@ function shouldSetAsProp(el, key, value, isSVG) {
|
|
|
11475
11509
|
}
|
|
11476
11510
|
|
|
11477
11511
|
const REMOVAL = {};
|
|
11478
|
-
/*! #__NO_SIDE_EFFECTS__ */
|
|
11479
11512
|
// @__NO_SIDE_EFFECTS__
|
|
11480
11513
|
function defineCustomElement(options, extraOptions, _createApp) {
|
|
11481
|
-
|
|
11482
|
-
if (isPlainObject(Comp)) extend(Comp, extraOptions);
|
|
11514
|
+
let Comp = defineComponent(options, extraOptions);
|
|
11515
|
+
if (isPlainObject(Comp)) Comp = extend({}, Comp, extraOptions);
|
|
11483
11516
|
class VueCustomElement extends VueElement {
|
|
11484
11517
|
constructor(initialProps) {
|
|
11485
11518
|
super(Comp, initialProps, _createApp);
|
|
@@ -11488,7 +11521,6 @@ function defineCustomElement(options, extraOptions, _createApp) {
|
|
|
11488
11521
|
VueCustomElement.def = Comp;
|
|
11489
11522
|
return VueCustomElement;
|
|
11490
11523
|
}
|
|
11491
|
-
|
|
11492
11524
|
const defineSSRCustomElement = (/* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
|
|
11493
11525
|
return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
|
|
11494
11526
|
});
|
|
@@ -11527,7 +11559,11 @@ class VueElement extends BaseClass {
|
|
|
11527
11559
|
);
|
|
11528
11560
|
}
|
|
11529
11561
|
if (_def.shadowRoot !== false) {
|
|
11530
|
-
this.attachShadow(
|
|
11562
|
+
this.attachShadow(
|
|
11563
|
+
extend({}, _def.shadowRootOptions, {
|
|
11564
|
+
mode: "open"
|
|
11565
|
+
})
|
|
11566
|
+
);
|
|
11531
11567
|
this._root = this.shadowRoot;
|
|
11532
11568
|
} else {
|
|
11533
11569
|
this._root = this;
|
|
@@ -11587,9 +11623,18 @@ class VueElement extends BaseClass {
|
|
|
11587
11623
|
this._app && this._app.unmount();
|
|
11588
11624
|
if (this._instance) this._instance.ce = void 0;
|
|
11589
11625
|
this._app = this._instance = null;
|
|
11626
|
+
if (this._teleportTargets) {
|
|
11627
|
+
this._teleportTargets.clear();
|
|
11628
|
+
this._teleportTargets = void 0;
|
|
11629
|
+
}
|
|
11590
11630
|
}
|
|
11591
11631
|
});
|
|
11592
11632
|
}
|
|
11633
|
+
_processMutations(mutations) {
|
|
11634
|
+
for (const m of mutations) {
|
|
11635
|
+
this._setAttr(m.attributeName);
|
|
11636
|
+
}
|
|
11637
|
+
}
|
|
11593
11638
|
/**
|
|
11594
11639
|
* resolve inner component definition (handle possible async component)
|
|
11595
11640
|
*/
|
|
@@ -11600,11 +11645,7 @@ class VueElement extends BaseClass {
|
|
|
11600
11645
|
for (let i = 0; i < this.attributes.length; i++) {
|
|
11601
11646
|
this._setAttr(this.attributes[i].name);
|
|
11602
11647
|
}
|
|
11603
|
-
this._ob = new MutationObserver((
|
|
11604
|
-
for (const m of mutations) {
|
|
11605
|
-
this._setAttr(m.attributeName);
|
|
11606
|
-
}
|
|
11607
|
-
});
|
|
11648
|
+
this._ob = new MutationObserver(this._processMutations.bind(this));
|
|
11608
11649
|
this._ob.observe(this, { attributes: true });
|
|
11609
11650
|
const resolve = (def, isAsync = false) => {
|
|
11610
11651
|
this._resolved = true;
|
|
@@ -11720,7 +11761,10 @@ class VueElement extends BaseClass {
|
|
|
11720
11761
|
}
|
|
11721
11762
|
if (shouldReflect) {
|
|
11722
11763
|
const ob = this._ob;
|
|
11723
|
-
|
|
11764
|
+
if (ob) {
|
|
11765
|
+
this._processMutations(ob.takeRecords());
|
|
11766
|
+
ob.disconnect();
|
|
11767
|
+
}
|
|
11724
11768
|
if (val === true) {
|
|
11725
11769
|
this.setAttribute(hyphenate(key), "");
|
|
11726
11770
|
} else if (typeof val === "string" || typeof val === "number") {
|
|
@@ -11824,7 +11868,7 @@ class VueElement extends BaseClass {
|
|
|
11824
11868
|
* Only called when shadowRoot is false
|
|
11825
11869
|
*/
|
|
11826
11870
|
_renderSlots() {
|
|
11827
|
-
const outlets =
|
|
11871
|
+
const outlets = this._getSlots();
|
|
11828
11872
|
const scopeId = this._instance.type.__scopeId;
|
|
11829
11873
|
for (let i = 0; i < outlets.length; i++) {
|
|
11830
11874
|
const o = outlets[i];
|
|
@@ -11850,6 +11894,19 @@ class VueElement extends BaseClass {
|
|
|
11850
11894
|
parent.removeChild(o);
|
|
11851
11895
|
}
|
|
11852
11896
|
}
|
|
11897
|
+
/**
|
|
11898
|
+
* @internal
|
|
11899
|
+
*/
|
|
11900
|
+
_getSlots() {
|
|
11901
|
+
const roots = [this];
|
|
11902
|
+
if (this._teleportTargets) {
|
|
11903
|
+
roots.push(...this._teleportTargets);
|
|
11904
|
+
}
|
|
11905
|
+
return roots.reduce((res, i) => {
|
|
11906
|
+
res.push(...Array.from(i.querySelectorAll("slot")));
|
|
11907
|
+
return res;
|
|
11908
|
+
}, []);
|
|
11909
|
+
}
|
|
11853
11910
|
/**
|
|
11854
11911
|
* @internal
|
|
11855
11912
|
*/
|
|
@@ -11951,7 +12008,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
|
|
|
11951
12008
|
prevChildren.forEach(callPendingCbs);
|
|
11952
12009
|
prevChildren.forEach(recordPosition);
|
|
11953
12010
|
const movedChildren = prevChildren.filter(applyTranslation);
|
|
11954
|
-
forceReflow();
|
|
12011
|
+
forceReflow(instance.vnode.el);
|
|
11955
12012
|
movedChildren.forEach((c) => {
|
|
11956
12013
|
const el = c.el;
|
|
11957
12014
|
const style = el.style;
|
|
@@ -11961,7 +12018,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
|
|
|
11961
12018
|
if (e && e.target !== el) {
|
|
11962
12019
|
return;
|
|
11963
12020
|
}
|
|
11964
|
-
if (!e ||
|
|
12021
|
+
if (!e || e.propertyName.endsWith("transform")) {
|
|
11965
12022
|
el.removeEventListener("transitionend", cb);
|
|
11966
12023
|
el[moveCbKey] = null;
|
|
11967
12024
|
removeTransitionClass(el, moveClass);
|
|
@@ -13930,7 +13987,7 @@ const isMemberExpressionBrowser = (exp) => {
|
|
|
13930
13987
|
return !currentOpenBracketCount && !currentOpenParensCount;
|
|
13931
13988
|
};
|
|
13932
13989
|
const isMemberExpression = isMemberExpressionBrowser ;
|
|
13933
|
-
const fnExpRE = /^\s*(async\s*)?(
|
|
13990
|
+
const fnExpRE = /^\s*(?:async\s*)?(?:\([^)]*?\)|[\w$_]+)\s*(?::[^=]+)?=>|^\s*(?:async\s+)?function(?:\s+[\w$]+)?\s*\(/;
|
|
13934
13991
|
const isFnExpressionBrowser = (exp) => fnExpRE.test(getExpSource(exp));
|
|
13935
13992
|
const isFnExpression = isFnExpressionBrowser ;
|
|
13936
13993
|
function assert(condition, msg) {
|
|
@@ -15972,7 +16029,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
|
|
|
15972
16029
|
}
|
|
15973
16030
|
|
|
15974
16031
|
const transformIf = createStructuralDirectiveTransform(
|
|
15975
|
-
/^(if|else|else-if)$/,
|
|
16032
|
+
/^(?:if|else|else-if)$/,
|
|
15976
16033
|
(node, dir, context) => {
|
|
15977
16034
|
return processIf(node, dir, context, (ifNode, branch, isRoot) => {
|
|
15978
16035
|
const siblings = context.parent.children;
|
|
@@ -16190,80 +16247,6 @@ function getParentCondition(node) {
|
|
|
16190
16247
|
}
|
|
16191
16248
|
}
|
|
16192
16249
|
|
|
16193
|
-
const transformBind = (dir, _node, context) => {
|
|
16194
|
-
const { modifiers, loc } = dir;
|
|
16195
|
-
const arg = dir.arg;
|
|
16196
|
-
let { exp } = dir;
|
|
16197
|
-
if (exp && exp.type === 4 && !exp.content.trim()) {
|
|
16198
|
-
{
|
|
16199
|
-
exp = void 0;
|
|
16200
|
-
}
|
|
16201
|
-
}
|
|
16202
|
-
if (!exp) {
|
|
16203
|
-
if (arg.type !== 4 || !arg.isStatic) {
|
|
16204
|
-
context.onError(
|
|
16205
|
-
createCompilerError(
|
|
16206
|
-
52,
|
|
16207
|
-
arg.loc
|
|
16208
|
-
)
|
|
16209
|
-
);
|
|
16210
|
-
return {
|
|
16211
|
-
props: [
|
|
16212
|
-
createObjectProperty(arg, createSimpleExpression("", true, loc))
|
|
16213
|
-
]
|
|
16214
|
-
};
|
|
16215
|
-
}
|
|
16216
|
-
transformBindShorthand(dir);
|
|
16217
|
-
exp = dir.exp;
|
|
16218
|
-
}
|
|
16219
|
-
if (arg.type !== 4) {
|
|
16220
|
-
arg.children.unshift(`(`);
|
|
16221
|
-
arg.children.push(`) || ""`);
|
|
16222
|
-
} else if (!arg.isStatic) {
|
|
16223
|
-
arg.content = arg.content ? `${arg.content} || ""` : `""`;
|
|
16224
|
-
}
|
|
16225
|
-
if (modifiers.some((mod) => mod.content === "camel")) {
|
|
16226
|
-
if (arg.type === 4) {
|
|
16227
|
-
if (arg.isStatic) {
|
|
16228
|
-
arg.content = camelize(arg.content);
|
|
16229
|
-
} else {
|
|
16230
|
-
arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`;
|
|
16231
|
-
}
|
|
16232
|
-
} else {
|
|
16233
|
-
arg.children.unshift(`${context.helperString(CAMELIZE)}(`);
|
|
16234
|
-
arg.children.push(`)`);
|
|
16235
|
-
}
|
|
16236
|
-
}
|
|
16237
|
-
if (!context.inSSR) {
|
|
16238
|
-
if (modifiers.some((mod) => mod.content === "prop")) {
|
|
16239
|
-
injectPrefix(arg, ".");
|
|
16240
|
-
}
|
|
16241
|
-
if (modifiers.some((mod) => mod.content === "attr")) {
|
|
16242
|
-
injectPrefix(arg, "^");
|
|
16243
|
-
}
|
|
16244
|
-
}
|
|
16245
|
-
return {
|
|
16246
|
-
props: [createObjectProperty(arg, exp)]
|
|
16247
|
-
};
|
|
16248
|
-
};
|
|
16249
|
-
const transformBindShorthand = (dir, context) => {
|
|
16250
|
-
const arg = dir.arg;
|
|
16251
|
-
const propName = camelize(arg.content);
|
|
16252
|
-
dir.exp = createSimpleExpression(propName, false, arg.loc);
|
|
16253
|
-
};
|
|
16254
|
-
const injectPrefix = (arg, prefix) => {
|
|
16255
|
-
if (arg.type === 4) {
|
|
16256
|
-
if (arg.isStatic) {
|
|
16257
|
-
arg.content = prefix + arg.content;
|
|
16258
|
-
} else {
|
|
16259
|
-
arg.content = `\`${prefix}\${${arg.content}}\``;
|
|
16260
|
-
}
|
|
16261
|
-
} else {
|
|
16262
|
-
arg.children.unshift(`'${prefix}' + (`);
|
|
16263
|
-
arg.children.push(`)`);
|
|
16264
|
-
}
|
|
16265
|
-
};
|
|
16266
|
-
|
|
16267
16250
|
const transformFor = createStructuralDirectiveTransform(
|
|
16268
16251
|
"for",
|
|
16269
16252
|
(node, dir, context) => {
|
|
@@ -16275,10 +16258,7 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
16275
16258
|
const isTemplate = isTemplateNode(node);
|
|
16276
16259
|
const memo = findDir(node, "memo");
|
|
16277
16260
|
const keyProp = findProp(node, `key`, false, true);
|
|
16278
|
-
|
|
16279
|
-
if (isDirKey && !keyProp.exp) {
|
|
16280
|
-
transformBindShorthand(keyProp);
|
|
16281
|
-
}
|
|
16261
|
+
keyProp && keyProp.type === 7;
|
|
16282
16262
|
let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
|
|
16283
16263
|
const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
|
|
16284
16264
|
const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
|
|
@@ -16559,7 +16539,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
16559
16539
|
);
|
|
16560
16540
|
} else if (vElse = findDir(
|
|
16561
16541
|
slotElement,
|
|
16562
|
-
/^else(
|
|
16542
|
+
/^else(?:-if)?$/,
|
|
16563
16543
|
true
|
|
16564
16544
|
/* allowEmpty */
|
|
16565
16545
|
)) {
|
|
@@ -16571,7 +16551,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
16571
16551
|
break;
|
|
16572
16552
|
}
|
|
16573
16553
|
}
|
|
16574
|
-
if (prev && isTemplateNode(prev) && findDir(prev, /^(else-)?if$/)) {
|
|
16554
|
+
if (prev && isTemplateNode(prev) && findDir(prev, /^(?:else-)?if$/)) {
|
|
16575
16555
|
let conditional = dynamicSlots[dynamicSlots.length - 1];
|
|
16576
16556
|
while (conditional.alternate.type === 19) {
|
|
16577
16557
|
conditional = conditional.alternate;
|
|
@@ -17388,6 +17368,58 @@ const transformOn$1 = (dir, node, context, augmentor) => {
|
|
|
17388
17368
|
return ret;
|
|
17389
17369
|
};
|
|
17390
17370
|
|
|
17371
|
+
const transformBind = (dir, _node, context) => {
|
|
17372
|
+
const { modifiers, loc } = dir;
|
|
17373
|
+
const arg = dir.arg;
|
|
17374
|
+
let { exp } = dir;
|
|
17375
|
+
if (exp && exp.type === 4 && !exp.content.trim()) {
|
|
17376
|
+
{
|
|
17377
|
+
exp = void 0;
|
|
17378
|
+
}
|
|
17379
|
+
}
|
|
17380
|
+
if (arg.type !== 4) {
|
|
17381
|
+
arg.children.unshift(`(`);
|
|
17382
|
+
arg.children.push(`) || ""`);
|
|
17383
|
+
} else if (!arg.isStatic) {
|
|
17384
|
+
arg.content = arg.content ? `${arg.content} || ""` : `""`;
|
|
17385
|
+
}
|
|
17386
|
+
if (modifiers.some((mod) => mod.content === "camel")) {
|
|
17387
|
+
if (arg.type === 4) {
|
|
17388
|
+
if (arg.isStatic) {
|
|
17389
|
+
arg.content = camelize(arg.content);
|
|
17390
|
+
} else {
|
|
17391
|
+
arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`;
|
|
17392
|
+
}
|
|
17393
|
+
} else {
|
|
17394
|
+
arg.children.unshift(`${context.helperString(CAMELIZE)}(`);
|
|
17395
|
+
arg.children.push(`)`);
|
|
17396
|
+
}
|
|
17397
|
+
}
|
|
17398
|
+
if (!context.inSSR) {
|
|
17399
|
+
if (modifiers.some((mod) => mod.content === "prop")) {
|
|
17400
|
+
injectPrefix(arg, ".");
|
|
17401
|
+
}
|
|
17402
|
+
if (modifiers.some((mod) => mod.content === "attr")) {
|
|
17403
|
+
injectPrefix(arg, "^");
|
|
17404
|
+
}
|
|
17405
|
+
}
|
|
17406
|
+
return {
|
|
17407
|
+
props: [createObjectProperty(arg, exp)]
|
|
17408
|
+
};
|
|
17409
|
+
};
|
|
17410
|
+
const injectPrefix = (arg, prefix) => {
|
|
17411
|
+
if (arg.type === 4) {
|
|
17412
|
+
if (arg.isStatic) {
|
|
17413
|
+
arg.content = prefix + arg.content;
|
|
17414
|
+
} else {
|
|
17415
|
+
arg.content = `\`${prefix}\${${arg.content}}\``;
|
|
17416
|
+
}
|
|
17417
|
+
} else {
|
|
17418
|
+
arg.children.unshift(`'${prefix}' + (`);
|
|
17419
|
+
arg.children.push(`)`);
|
|
17420
|
+
}
|
|
17421
|
+
};
|
|
17422
|
+
|
|
17391
17423
|
const transformText = (node, context) => {
|
|
17392
17424
|
if (node.type === 0 || node.type === 1 || node.type === 11 || node.type === 10) {
|
|
17393
17425
|
return () => {
|
|
@@ -17569,9 +17601,35 @@ const transformMemo = (node, context) => {
|
|
|
17569
17601
|
}
|
|
17570
17602
|
};
|
|
17571
17603
|
|
|
17604
|
+
const transformVBindShorthand = (node, context) => {
|
|
17605
|
+
if (node.type === 1) {
|
|
17606
|
+
for (const prop of node.props) {
|
|
17607
|
+
if (prop.type === 7 && prop.name === "bind" && !prop.exp) {
|
|
17608
|
+
const arg = prop.arg;
|
|
17609
|
+
if (arg.type !== 4 || !arg.isStatic) {
|
|
17610
|
+
context.onError(
|
|
17611
|
+
createCompilerError(
|
|
17612
|
+
52,
|
|
17613
|
+
arg.loc
|
|
17614
|
+
)
|
|
17615
|
+
);
|
|
17616
|
+
prop.exp = createSimpleExpression("", true, arg.loc);
|
|
17617
|
+
} else {
|
|
17618
|
+
const propName = camelize(arg.content);
|
|
17619
|
+
if (validFirstIdentCharRE.test(propName[0]) || // allow hyphen first char for https://github.com/vuejs/language-tools/pull/3424
|
|
17620
|
+
propName[0] === "-") {
|
|
17621
|
+
prop.exp = createSimpleExpression(propName, false, arg.loc);
|
|
17622
|
+
}
|
|
17623
|
+
}
|
|
17624
|
+
}
|
|
17625
|
+
}
|
|
17626
|
+
}
|
|
17627
|
+
};
|
|
17628
|
+
|
|
17572
17629
|
function getBaseTransformPreset(prefixIdentifiers) {
|
|
17573
17630
|
return [
|
|
17574
17631
|
[
|
|
17632
|
+
transformVBindShorthand,
|
|
17575
17633
|
transformOnce,
|
|
17576
17634
|
transformIf,
|
|
17577
17635
|
transformMemo,
|