@vue/compat 3.5.29 → 3.5.31
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 +154 -47
- package/dist/vue.cjs.prod.js +135 -43
- package/dist/vue.esm-browser.js +154 -47
- package/dist/vue.esm-browser.prod.js +8 -8
- package/dist/vue.esm-bundler.js +154 -47
- package/dist/vue.global.js +154 -47
- package/dist/vue.global.prod.js +8 -8
- package/dist/vue.runtime.esm-browser.js +153 -46
- package/dist/vue.runtime.esm-browser.prod.js +4 -4
- package/dist/vue.runtime.esm-bundler.js +153 -46
- package/dist/vue.runtime.global.js +153 -46
- package/dist/vue.runtime.global.prod.js +3 -3
- package/package.json +4 -3
package/dist/vue.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compat v3.5.
|
|
2
|
+
* @vue/compat v3.5.31
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -1331,10 +1331,17 @@ function apply(self, method, fn, thisArg, wrappedRetFn, args) {
|
|
|
1331
1331
|
}
|
|
1332
1332
|
function reduce(self, method, fn, args) {
|
|
1333
1333
|
const arr = shallowReadArray(self);
|
|
1334
|
+
const needsWrap = arr !== self && !isShallow(self);
|
|
1334
1335
|
let wrappedFn = fn;
|
|
1336
|
+
let wrapInitialAccumulator = false;
|
|
1335
1337
|
if (arr !== self) {
|
|
1336
|
-
if (
|
|
1338
|
+
if (needsWrap) {
|
|
1339
|
+
wrapInitialAccumulator = args.length === 0;
|
|
1337
1340
|
wrappedFn = function(acc, item, index) {
|
|
1341
|
+
if (wrapInitialAccumulator) {
|
|
1342
|
+
wrapInitialAccumulator = false;
|
|
1343
|
+
acc = toWrapped(self, acc);
|
|
1344
|
+
}
|
|
1338
1345
|
return fn.call(this, acc, toWrapped(self, item), index, self);
|
|
1339
1346
|
};
|
|
1340
1347
|
} else if (fn.length > 3) {
|
|
@@ -1343,7 +1350,8 @@ function reduce(self, method, fn, args) {
|
|
|
1343
1350
|
};
|
|
1344
1351
|
}
|
|
1345
1352
|
}
|
|
1346
|
-
|
|
1353
|
+
const result = arr[method](wrappedFn, ...args);
|
|
1354
|
+
return wrapInitialAccumulator ? toWrapped(self, result) : result;
|
|
1347
1355
|
}
|
|
1348
1356
|
function searchProxy(self, method, args) {
|
|
1349
1357
|
const arr = toRaw(self);
|
|
@@ -1633,15 +1641,14 @@ function createInstrumentations(readonly, shallow) {
|
|
|
1633
1641
|
clear: createReadonlyMethod("clear")
|
|
1634
1642
|
} : {
|
|
1635
1643
|
add(value) {
|
|
1636
|
-
if (!shallow && !isShallow(value) && !isReadonly(value)) {
|
|
1637
|
-
value = toRaw(value);
|
|
1638
|
-
}
|
|
1639
1644
|
const target = toRaw(this);
|
|
1640
1645
|
const proto = getProto(target);
|
|
1641
|
-
const
|
|
1646
|
+
const rawValue = toRaw(value);
|
|
1647
|
+
const valueToAdd = !shallow && !isShallow(value) && !isReadonly(value) ? rawValue : value;
|
|
1648
|
+
const hadKey = proto.has.call(target, valueToAdd) || hasChanged(value, valueToAdd) && proto.has.call(target, value) || hasChanged(rawValue, valueToAdd) && proto.has.call(target, rawValue);
|
|
1642
1649
|
if (!hadKey) {
|
|
1643
|
-
target.add(
|
|
1644
|
-
trigger(target, "add",
|
|
1650
|
+
target.add(valueToAdd);
|
|
1651
|
+
trigger(target, "add", valueToAdd, valueToAdd);
|
|
1645
1652
|
}
|
|
1646
1653
|
return this;
|
|
1647
1654
|
},
|
|
@@ -1998,16 +2005,16 @@ function toRefs(object) {
|
|
|
1998
2005
|
return ret;
|
|
1999
2006
|
}
|
|
2000
2007
|
class ObjectRefImpl {
|
|
2001
|
-
constructor(_object,
|
|
2008
|
+
constructor(_object, key, _defaultValue) {
|
|
2002
2009
|
this._object = _object;
|
|
2003
|
-
this._key = _key;
|
|
2004
2010
|
this._defaultValue = _defaultValue;
|
|
2005
2011
|
this["__v_isRef"] = true;
|
|
2006
2012
|
this._value = void 0;
|
|
2013
|
+
this._key = isSymbol(key) ? key : String(key);
|
|
2007
2014
|
this._raw = toRaw(_object);
|
|
2008
2015
|
let shallow = true;
|
|
2009
2016
|
let obj = _object;
|
|
2010
|
-
if (!isArray(_object) || !isIntegerKey(
|
|
2017
|
+
if (!isArray(_object) || isSymbol(this._key) || !isIntegerKey(this._key)) {
|
|
2011
2018
|
do {
|
|
2012
2019
|
shallow = !isProxy(obj) || isShallow(obj);
|
|
2013
2020
|
} while (shallow && (obj = obj["__v_raw"]));
|
|
@@ -2807,6 +2814,13 @@ function checkRecursiveUpdates(seen, fn) {
|
|
|
2807
2814
|
}
|
|
2808
2815
|
|
|
2809
2816
|
let isHmrUpdating = false;
|
|
2817
|
+
const setHmrUpdating = (v) => {
|
|
2818
|
+
try {
|
|
2819
|
+
return isHmrUpdating;
|
|
2820
|
+
} finally {
|
|
2821
|
+
isHmrUpdating = v;
|
|
2822
|
+
}
|
|
2823
|
+
};
|
|
2810
2824
|
const hmrDirtyComponents = /* @__PURE__ */ new Map();
|
|
2811
2825
|
{
|
|
2812
2826
|
getGlobalThis().__VUE_HMR_RUNTIME__ = {
|
|
@@ -3862,9 +3876,10 @@ const TeleportImpl = {
|
|
|
3862
3876
|
mount(container, mainAnchor);
|
|
3863
3877
|
updateCssVars(n2, true);
|
|
3864
3878
|
}
|
|
3865
|
-
if (isTeleportDeferred(n2.props)) {
|
|
3879
|
+
if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
|
|
3866
3880
|
n2.el.__isMounted = false;
|
|
3867
3881
|
queuePostRenderEffect(() => {
|
|
3882
|
+
if (n2.el.__isMounted !== false) return;
|
|
3868
3883
|
mountToTarget();
|
|
3869
3884
|
delete n2.el.__isMounted;
|
|
3870
3885
|
}, parentSuspense);
|
|
@@ -3872,7 +3887,12 @@ const TeleportImpl = {
|
|
|
3872
3887
|
mountToTarget();
|
|
3873
3888
|
}
|
|
3874
3889
|
} else {
|
|
3875
|
-
|
|
3890
|
+
n2.el = n1.el;
|
|
3891
|
+
n2.targetStart = n1.targetStart;
|
|
3892
|
+
const mainAnchor = n2.anchor = n1.anchor;
|
|
3893
|
+
const target = n2.target = n1.target;
|
|
3894
|
+
const targetAnchor = n2.targetAnchor = n1.targetAnchor;
|
|
3895
|
+
if (n1.el.__isMounted === false) {
|
|
3876
3896
|
queuePostRenderEffect(() => {
|
|
3877
3897
|
TeleportImpl.process(
|
|
3878
3898
|
n1,
|
|
@@ -3889,11 +3909,6 @@ const TeleportImpl = {
|
|
|
3889
3909
|
}, parentSuspense);
|
|
3890
3910
|
return;
|
|
3891
3911
|
}
|
|
3892
|
-
n2.el = n1.el;
|
|
3893
|
-
n2.targetStart = n1.targetStart;
|
|
3894
|
-
const mainAnchor = n2.anchor = n1.anchor;
|
|
3895
|
-
const target = n2.target = n1.target;
|
|
3896
|
-
const targetAnchor = n2.targetAnchor = n1.targetAnchor;
|
|
3897
3912
|
const wasDisabled = isTeleportDisabled(n1.props);
|
|
3898
3913
|
const currentContainer = wasDisabled ? container : target;
|
|
3899
3914
|
const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
|
|
@@ -4359,7 +4374,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
4359
4374
|
callHook(hook, [el]);
|
|
4360
4375
|
},
|
|
4361
4376
|
enter(el) {
|
|
4362
|
-
if (leavingVNodesCache[key] === vnode) return;
|
|
4377
|
+
if (!isHmrUpdating && leavingVNodesCache[key] === vnode) return;
|
|
4363
4378
|
let hook = onEnter;
|
|
4364
4379
|
let afterHook = onAfterEnter;
|
|
4365
4380
|
let cancelHook = onEnterCancelled;
|
|
@@ -6284,12 +6299,16 @@ function renderList(source, renderItem, cache, index) {
|
|
|
6284
6299
|
);
|
|
6285
6300
|
}
|
|
6286
6301
|
} else if (typeof source === "number") {
|
|
6287
|
-
if (!Number.isInteger(source)) {
|
|
6288
|
-
warn$1(
|
|
6289
|
-
|
|
6290
|
-
|
|
6291
|
-
|
|
6292
|
-
|
|
6302
|
+
if (!Number.isInteger(source) || source < 0) {
|
|
6303
|
+
warn$1(
|
|
6304
|
+
`The v-for range expects a positive integer value but got ${source}.`
|
|
6305
|
+
);
|
|
6306
|
+
ret = [];
|
|
6307
|
+
} else {
|
|
6308
|
+
ret = new Array(source);
|
|
6309
|
+
for (let i = 0; i < source; i++) {
|
|
6310
|
+
ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
|
|
6311
|
+
}
|
|
6293
6312
|
}
|
|
6294
6313
|
} else if (isObject(source)) {
|
|
6295
6314
|
if (source[Symbol.iterator]) {
|
|
@@ -6992,6 +7011,7 @@ function createPropsRestProxy(props, excludedKeys) {
|
|
|
6992
7011
|
}
|
|
6993
7012
|
function withAsyncContext(getAwaitable) {
|
|
6994
7013
|
const ctx = getCurrentInstance();
|
|
7014
|
+
const inSSRSetup = isInSSRComponentSetup;
|
|
6995
7015
|
if (!ctx) {
|
|
6996
7016
|
warn$1(
|
|
6997
7017
|
`withAsyncContext called without active current instance. This is likely a bug.`
|
|
@@ -6999,13 +7019,25 @@ function withAsyncContext(getAwaitable) {
|
|
|
6999
7019
|
}
|
|
7000
7020
|
let awaitable = getAwaitable();
|
|
7001
7021
|
unsetCurrentInstance();
|
|
7022
|
+
if (inSSRSetup) {
|
|
7023
|
+
setInSSRSetupState(false);
|
|
7024
|
+
}
|
|
7025
|
+
const restore = () => {
|
|
7026
|
+
setCurrentInstance(ctx);
|
|
7027
|
+
if (inSSRSetup) {
|
|
7028
|
+
setInSSRSetupState(true);
|
|
7029
|
+
}
|
|
7030
|
+
};
|
|
7002
7031
|
const cleanup = () => {
|
|
7003
7032
|
if (getCurrentInstance() !== ctx) ctx.scope.off();
|
|
7004
7033
|
unsetCurrentInstance();
|
|
7034
|
+
if (inSSRSetup) {
|
|
7035
|
+
setInSSRSetupState(false);
|
|
7036
|
+
}
|
|
7005
7037
|
};
|
|
7006
7038
|
if (isPromise(awaitable)) {
|
|
7007
7039
|
awaitable = awaitable.catch((e) => {
|
|
7008
|
-
|
|
7040
|
+
restore();
|
|
7009
7041
|
Promise.resolve().then(() => Promise.resolve().then(cleanup));
|
|
7010
7042
|
throw e;
|
|
7011
7043
|
});
|
|
@@ -7013,7 +7045,7 @@ function withAsyncContext(getAwaitable) {
|
|
|
7013
7045
|
return [
|
|
7014
7046
|
awaitable,
|
|
7015
7047
|
() => {
|
|
7016
|
-
|
|
7048
|
+
restore();
|
|
7017
7049
|
Promise.resolve().then(cleanup);
|
|
7018
7050
|
}
|
|
7019
7051
|
];
|
|
@@ -7537,7 +7569,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
7537
7569
|
return vm;
|
|
7538
7570
|
}
|
|
7539
7571
|
}
|
|
7540
|
-
Vue.version = `2.6.14-compat:${"3.5.
|
|
7572
|
+
Vue.version = `2.6.14-compat:${"3.5.31"}`;
|
|
7541
7573
|
Vue.config = singletonApp.config;
|
|
7542
7574
|
Vue.use = (plugin, ...options) => {
|
|
7543
7575
|
if (plugin && isFunction(plugin.install)) {
|
|
@@ -8696,11 +8728,12 @@ function hasPropValueChanged(nextProps, prevProps, key) {
|
|
|
8696
8728
|
}
|
|
8697
8729
|
return nextProp !== prevProp;
|
|
8698
8730
|
}
|
|
8699
|
-
function updateHOCHostEl({ vnode, parent }, el) {
|
|
8731
|
+
function updateHOCHostEl({ vnode, parent, suspense }, el) {
|
|
8700
8732
|
while (parent) {
|
|
8701
8733
|
const root = parent.subTree;
|
|
8702
8734
|
if (root.suspense && root.suspense.activeBranch === vnode) {
|
|
8703
|
-
root.el =
|
|
8735
|
+
root.suspense.vnode.el = root.el = el;
|
|
8736
|
+
vnode = root;
|
|
8704
8737
|
}
|
|
8705
8738
|
if (root === vnode) {
|
|
8706
8739
|
(vnode = parent.vnode).el = el;
|
|
@@ -8709,6 +8742,9 @@ function updateHOCHostEl({ vnode, parent }, el) {
|
|
|
8709
8742
|
break;
|
|
8710
8743
|
}
|
|
8711
8744
|
}
|
|
8745
|
+
if (suspense && suspense.activeBranch === vnode) {
|
|
8746
|
+
suspense.vnode.el = el;
|
|
8747
|
+
}
|
|
8712
8748
|
}
|
|
8713
8749
|
|
|
8714
8750
|
function createPropsDefaultThis(instance, rawProps, propKey) {
|
|
@@ -9622,10 +9658,17 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9622
9658
|
}
|
|
9623
9659
|
hostInsert(el, container, anchor);
|
|
9624
9660
|
if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
|
|
9661
|
+
const isHmr = isHmrUpdating;
|
|
9625
9662
|
queuePostRenderEffect(() => {
|
|
9626
|
-
|
|
9627
|
-
|
|
9628
|
-
|
|
9663
|
+
let prev;
|
|
9664
|
+
prev = setHmrUpdating(isHmr);
|
|
9665
|
+
try {
|
|
9666
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
9667
|
+
needCallTransitionHooks && transition.enter(el);
|
|
9668
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
9669
|
+
} finally {
|
|
9670
|
+
setHmrUpdating(prev);
|
|
9671
|
+
}
|
|
9629
9672
|
}, parentSuspense);
|
|
9630
9673
|
}
|
|
9631
9674
|
};
|
|
@@ -10034,7 +10077,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
10034
10077
|
}
|
|
10035
10078
|
} else {
|
|
10036
10079
|
if (root.ce && root.ce._hasShadowRoot()) {
|
|
10037
|
-
root.ce._injectChildStyle(
|
|
10080
|
+
root.ce._injectChildStyle(
|
|
10081
|
+
type,
|
|
10082
|
+
instance.parent ? instance.parent.type : void 0
|
|
10083
|
+
);
|
|
10038
10084
|
}
|
|
10039
10085
|
{
|
|
10040
10086
|
startMeasure(instance, `render`);
|
|
@@ -10568,7 +10614,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
10568
10614
|
shapeFlag,
|
|
10569
10615
|
patchFlag,
|
|
10570
10616
|
dirs,
|
|
10571
|
-
cacheIndex
|
|
10617
|
+
cacheIndex,
|
|
10618
|
+
memo
|
|
10572
10619
|
} = vnode;
|
|
10573
10620
|
if (patchFlag === -2) {
|
|
10574
10621
|
optimized = false;
|
|
@@ -10630,10 +10677,14 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
10630
10677
|
remove(vnode);
|
|
10631
10678
|
}
|
|
10632
10679
|
}
|
|
10633
|
-
|
|
10680
|
+
const shouldInvalidateMemo = memo != null && cacheIndex == null;
|
|
10681
|
+
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs || shouldInvalidateMemo) {
|
|
10634
10682
|
queuePostRenderEffect(() => {
|
|
10635
10683
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
10636
10684
|
shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
10685
|
+
if (shouldInvalidateMemo) {
|
|
10686
|
+
vnode.el = null;
|
|
10687
|
+
}
|
|
10637
10688
|
}, parentSuspense);
|
|
10638
10689
|
}
|
|
10639
10690
|
};
|
|
@@ -11196,6 +11247,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
11196
11247
|
pendingId: suspenseId++,
|
|
11197
11248
|
timeout: typeof timeout === "number" ? timeout : -1,
|
|
11198
11249
|
activeBranch: null,
|
|
11250
|
+
isFallbackMountPending: false,
|
|
11199
11251
|
pendingBranch: null,
|
|
11200
11252
|
isInFallback: !isHydrating,
|
|
11201
11253
|
isHydrating,
|
|
@@ -11245,7 +11297,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
11245
11297
|
}
|
|
11246
11298
|
};
|
|
11247
11299
|
}
|
|
11248
|
-
if (activeBranch) {
|
|
11300
|
+
if (activeBranch && !suspense.isFallbackMountPending) {
|
|
11249
11301
|
if (parentNode(activeBranch.el) === container2) {
|
|
11250
11302
|
anchor = next(activeBranch);
|
|
11251
11303
|
}
|
|
@@ -11258,6 +11310,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
11258
11310
|
move(pendingBranch, container2, anchor, 0);
|
|
11259
11311
|
}
|
|
11260
11312
|
}
|
|
11313
|
+
suspense.isFallbackMountPending = false;
|
|
11261
11314
|
setActiveBranch(suspense, pendingBranch);
|
|
11262
11315
|
suspense.pendingBranch = null;
|
|
11263
11316
|
suspense.isInFallback = false;
|
|
@@ -11293,6 +11346,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
11293
11346
|
triggerEvent(vnode2, "onFallback");
|
|
11294
11347
|
const anchor2 = next(activeBranch);
|
|
11295
11348
|
const mountFallback = () => {
|
|
11349
|
+
suspense.isFallbackMountPending = false;
|
|
11296
11350
|
if (!suspense.isInFallback) {
|
|
11297
11351
|
return;
|
|
11298
11352
|
}
|
|
@@ -11312,6 +11366,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
11312
11366
|
};
|
|
11313
11367
|
const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
|
|
11314
11368
|
if (delayEnter) {
|
|
11369
|
+
suspense.isFallbackMountPending = true;
|
|
11315
11370
|
activeBranch.transition.afterLeave = mountFallback;
|
|
11316
11371
|
}
|
|
11317
11372
|
suspense.isInFallback = true;
|
|
@@ -11929,6 +11984,10 @@ function mergeProps(...args) {
|
|
|
11929
11984
|
const incoming = toMerge[key];
|
|
11930
11985
|
if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
|
|
11931
11986
|
ret[key] = existing ? [].concat(existing, incoming) : incoming;
|
|
11987
|
+
} else if (incoming == null && existing == null && // mergeProps({ 'onUpdate:modelValue': undefined }) should not retain
|
|
11988
|
+
// the model listener.
|
|
11989
|
+
!isModelListener(key)) {
|
|
11990
|
+
ret[key] = incoming;
|
|
11932
11991
|
}
|
|
11933
11992
|
} else if (key !== "") {
|
|
11934
11993
|
ret[key] = toMerge[key];
|
|
@@ -12625,7 +12684,7 @@ function isMemoSame(cached, memo) {
|
|
|
12625
12684
|
return true;
|
|
12626
12685
|
}
|
|
12627
12686
|
|
|
12628
|
-
const version = "3.5.
|
|
12687
|
+
const version = "3.5.31";
|
|
12629
12688
|
const warn = warn$1 ;
|
|
12630
12689
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
12631
12690
|
const devtools = devtools$1 ;
|
|
@@ -13442,7 +13501,9 @@ const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) =>
|
|
|
13442
13501
|
}
|
|
13443
13502
|
} else if (
|
|
13444
13503
|
// #11081 force set props for possible async custom element
|
|
13445
|
-
el._isVueCE &&
|
|
13504
|
+
el._isVueCE && // #12408 check if it's declared prop or it's async custom element
|
|
13505
|
+
(shouldSetAsPropForVueCE(el, key) || // @ts-expect-error _def is private
|
|
13506
|
+
el._def.__asyncLoader && (/[A-Z]/.test(key) || !isString(nextValue)))
|
|
13446
13507
|
) {
|
|
13447
13508
|
patchDOMProp(el, camelize(key), nextValue, parentComponent, key);
|
|
13448
13509
|
} else {
|
|
@@ -13490,6 +13551,17 @@ function shouldSetAsProp(el, key, value, isSVG) {
|
|
|
13490
13551
|
}
|
|
13491
13552
|
return key in el;
|
|
13492
13553
|
}
|
|
13554
|
+
function shouldSetAsPropForVueCE(el, key) {
|
|
13555
|
+
const props = (
|
|
13556
|
+
// @ts-expect-error _def is private
|
|
13557
|
+
el._def.props
|
|
13558
|
+
);
|
|
13559
|
+
if (!props) {
|
|
13560
|
+
return false;
|
|
13561
|
+
}
|
|
13562
|
+
const camelKey = camelize(key);
|
|
13563
|
+
return Array.isArray(props) ? props.some((prop) => camelize(prop) === camelKey) : Object.keys(props).some((prop) => camelize(prop) === camelKey);
|
|
13564
|
+
}
|
|
13493
13565
|
|
|
13494
13566
|
const REMOVAL = {};
|
|
13495
13567
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -13534,6 +13606,7 @@ class VueElement extends BaseClass {
|
|
|
13534
13606
|
this._dirty = false;
|
|
13535
13607
|
this._numberProps = null;
|
|
13536
13608
|
this._styleChildren = /* @__PURE__ */ new WeakSet();
|
|
13609
|
+
this._styleAnchors = /* @__PURE__ */ new WeakMap();
|
|
13537
13610
|
this._ob = null;
|
|
13538
13611
|
if (this.shadowRoot && _createApp !== createApp) {
|
|
13539
13612
|
this._root = this.shadowRoot;
|
|
@@ -13562,7 +13635,8 @@ class VueElement extends BaseClass {
|
|
|
13562
13635
|
}
|
|
13563
13636
|
this._connected = true;
|
|
13564
13637
|
let parent = this;
|
|
13565
|
-
while (parent = parent &&
|
|
13638
|
+
while (parent = parent && // #12479 should check assignedSlot first to get correct parent
|
|
13639
|
+
(parent.assignedSlot || parent.parentNode || parent.host)) {
|
|
13566
13640
|
if (parent instanceof VueElement) {
|
|
13567
13641
|
this._parent = parent;
|
|
13568
13642
|
break;
|
|
@@ -13784,6 +13858,7 @@ class VueElement extends BaseClass {
|
|
|
13784
13858
|
this._styles.forEach((s) => this._root.removeChild(s));
|
|
13785
13859
|
this._styles.length = 0;
|
|
13786
13860
|
}
|
|
13861
|
+
this._styleAnchors.delete(this._def);
|
|
13787
13862
|
this._applyStyles(newStyles);
|
|
13788
13863
|
this._instance = null;
|
|
13789
13864
|
this._update();
|
|
@@ -13808,7 +13883,7 @@ class VueElement extends BaseClass {
|
|
|
13808
13883
|
}
|
|
13809
13884
|
return vnode;
|
|
13810
13885
|
}
|
|
13811
|
-
_applyStyles(styles, owner) {
|
|
13886
|
+
_applyStyles(styles, owner, parentComp) {
|
|
13812
13887
|
if (!styles) return;
|
|
13813
13888
|
if (owner) {
|
|
13814
13889
|
if (owner === this._def || this._styleChildren.has(owner)) {
|
|
@@ -13817,11 +13892,19 @@ class VueElement extends BaseClass {
|
|
|
13817
13892
|
this._styleChildren.add(owner);
|
|
13818
13893
|
}
|
|
13819
13894
|
const nonce = this._nonce;
|
|
13895
|
+
const root = this.shadowRoot;
|
|
13896
|
+
const insertionAnchor = parentComp ? this._getStyleAnchor(parentComp) || this._getStyleAnchor(this._def) : this._getRootStyleInsertionAnchor(root);
|
|
13897
|
+
let last = null;
|
|
13820
13898
|
for (let i = styles.length - 1; i >= 0; i--) {
|
|
13821
13899
|
const s = document.createElement("style");
|
|
13822
13900
|
if (nonce) s.setAttribute("nonce", nonce);
|
|
13823
13901
|
s.textContent = styles[i];
|
|
13824
|
-
|
|
13902
|
+
root.insertBefore(s, last || insertionAnchor);
|
|
13903
|
+
last = s;
|
|
13904
|
+
if (i === 0) {
|
|
13905
|
+
if (!parentComp) this._styleAnchors.set(this._def, s);
|
|
13906
|
+
if (owner) this._styleAnchors.set(owner, s);
|
|
13907
|
+
}
|
|
13825
13908
|
{
|
|
13826
13909
|
if (owner) {
|
|
13827
13910
|
if (owner.__hmrId) {
|
|
@@ -13838,6 +13921,28 @@ class VueElement extends BaseClass {
|
|
|
13838
13921
|
}
|
|
13839
13922
|
}
|
|
13840
13923
|
}
|
|
13924
|
+
_getStyleAnchor(comp) {
|
|
13925
|
+
if (!comp) {
|
|
13926
|
+
return null;
|
|
13927
|
+
}
|
|
13928
|
+
const anchor = this._styleAnchors.get(comp);
|
|
13929
|
+
if (anchor && anchor.parentNode === this.shadowRoot) {
|
|
13930
|
+
return anchor;
|
|
13931
|
+
}
|
|
13932
|
+
if (anchor) {
|
|
13933
|
+
this._styleAnchors.delete(comp);
|
|
13934
|
+
}
|
|
13935
|
+
return null;
|
|
13936
|
+
}
|
|
13937
|
+
_getRootStyleInsertionAnchor(root) {
|
|
13938
|
+
for (let i = 0; i < root.childNodes.length; i++) {
|
|
13939
|
+
const node = root.childNodes[i];
|
|
13940
|
+
if (!(node instanceof HTMLStyleElement)) {
|
|
13941
|
+
return node;
|
|
13942
|
+
}
|
|
13943
|
+
}
|
|
13944
|
+
return null;
|
|
13945
|
+
}
|
|
13841
13946
|
/**
|
|
13842
13947
|
* Only called when shadowRoot is false
|
|
13843
13948
|
*/
|
|
@@ -13900,8 +14005,8 @@ class VueElement extends BaseClass {
|
|
|
13900
14005
|
/**
|
|
13901
14006
|
* @internal
|
|
13902
14007
|
*/
|
|
13903
|
-
_injectChildStyle(comp) {
|
|
13904
|
-
this._applyStyles(comp.styles, comp);
|
|
14008
|
+
_injectChildStyle(comp, parentComp) {
|
|
14009
|
+
this._applyStyles(comp.styles, comp, parentComp);
|
|
13905
14010
|
}
|
|
13906
14011
|
/**
|
|
13907
14012
|
* @internal
|
|
@@ -13931,6 +14036,7 @@ class VueElement extends BaseClass {
|
|
|
13931
14036
|
_removeChildStyle(comp) {
|
|
13932
14037
|
{
|
|
13933
14038
|
this._styleChildren.delete(comp);
|
|
14039
|
+
this._styleAnchors.delete(comp);
|
|
13934
14040
|
if (this._childStyles && comp.__hmrId) {
|
|
13935
14041
|
const oldStyles = this._childStyles.get(comp.__hmrId);
|
|
13936
14042
|
if (oldStyles) {
|
|
@@ -14198,7 +14304,8 @@ const vModelText = {
|
|
|
14198
14304
|
if (elValue === newValue) {
|
|
14199
14305
|
return;
|
|
14200
14306
|
}
|
|
14201
|
-
|
|
14307
|
+
const rootNode = el.getRootNode();
|
|
14308
|
+
if ((rootNode instanceof Document || rootNode instanceof ShadowRoot) && rootNode.activeElement === el && el.type !== "range") {
|
|
14202
14309
|
if (lazy && value === oldValue) {
|
|
14203
14310
|
return;
|
|
14204
14311
|
}
|
|
@@ -19530,7 +19637,7 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
19530
19637
|
loop.body = createBlockStatement([
|
|
19531
19638
|
createCompoundExpression([`const _memo = (`, memo.exp, `)`]),
|
|
19532
19639
|
createCompoundExpression([
|
|
19533
|
-
`if (_cached`,
|
|
19640
|
+
`if (_cached && _cached.el`,
|
|
19534
19641
|
...keyExp ? [` && _cached.key === `, keyExp] : [],
|
|
19535
19642
|
` && ${context.helperString(
|
|
19536
19643
|
IS_MEMO_SAME
|