@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.esm-browser.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
|
**/
|
|
@@ -1278,10 +1278,17 @@ function apply(self, method, fn, thisArg, wrappedRetFn, args) {
|
|
|
1278
1278
|
}
|
|
1279
1279
|
function reduce(self, method, fn, args) {
|
|
1280
1280
|
const arr = shallowReadArray(self);
|
|
1281
|
+
const needsWrap = arr !== self && !isShallow(self);
|
|
1281
1282
|
let wrappedFn = fn;
|
|
1283
|
+
let wrapInitialAccumulator = false;
|
|
1282
1284
|
if (arr !== self) {
|
|
1283
|
-
if (
|
|
1285
|
+
if (needsWrap) {
|
|
1286
|
+
wrapInitialAccumulator = args.length === 0;
|
|
1284
1287
|
wrappedFn = function(acc, item, index) {
|
|
1288
|
+
if (wrapInitialAccumulator) {
|
|
1289
|
+
wrapInitialAccumulator = false;
|
|
1290
|
+
acc = toWrapped(self, acc);
|
|
1291
|
+
}
|
|
1285
1292
|
return fn.call(this, acc, toWrapped(self, item), index, self);
|
|
1286
1293
|
};
|
|
1287
1294
|
} else if (fn.length > 3) {
|
|
@@ -1290,7 +1297,8 @@ function reduce(self, method, fn, args) {
|
|
|
1290
1297
|
};
|
|
1291
1298
|
}
|
|
1292
1299
|
}
|
|
1293
|
-
|
|
1300
|
+
const result = arr[method](wrappedFn, ...args);
|
|
1301
|
+
return wrapInitialAccumulator ? toWrapped(self, result) : result;
|
|
1294
1302
|
}
|
|
1295
1303
|
function searchProxy(self, method, args) {
|
|
1296
1304
|
const arr = toRaw(self);
|
|
@@ -1580,15 +1588,14 @@ function createInstrumentations(readonly, shallow) {
|
|
|
1580
1588
|
clear: createReadonlyMethod("clear")
|
|
1581
1589
|
} : {
|
|
1582
1590
|
add(value) {
|
|
1583
|
-
if (!shallow && !isShallow(value) && !isReadonly(value)) {
|
|
1584
|
-
value = toRaw(value);
|
|
1585
|
-
}
|
|
1586
1591
|
const target = toRaw(this);
|
|
1587
1592
|
const proto = getProto(target);
|
|
1588
|
-
const
|
|
1593
|
+
const rawValue = toRaw(value);
|
|
1594
|
+
const valueToAdd = !shallow && !isShallow(value) && !isReadonly(value) ? rawValue : value;
|
|
1595
|
+
const hadKey = proto.has.call(target, valueToAdd) || hasChanged(value, valueToAdd) && proto.has.call(target, value) || hasChanged(rawValue, valueToAdd) && proto.has.call(target, rawValue);
|
|
1589
1596
|
if (!hadKey) {
|
|
1590
|
-
target.add(
|
|
1591
|
-
trigger(target, "add",
|
|
1597
|
+
target.add(valueToAdd);
|
|
1598
|
+
trigger(target, "add", valueToAdd, valueToAdd);
|
|
1592
1599
|
}
|
|
1593
1600
|
return this;
|
|
1594
1601
|
},
|
|
@@ -1945,16 +1952,16 @@ function toRefs(object) {
|
|
|
1945
1952
|
return ret;
|
|
1946
1953
|
}
|
|
1947
1954
|
class ObjectRefImpl {
|
|
1948
|
-
constructor(_object,
|
|
1955
|
+
constructor(_object, key, _defaultValue) {
|
|
1949
1956
|
this._object = _object;
|
|
1950
|
-
this._key = _key;
|
|
1951
1957
|
this._defaultValue = _defaultValue;
|
|
1952
1958
|
this["__v_isRef"] = true;
|
|
1953
1959
|
this._value = void 0;
|
|
1960
|
+
this._key = isSymbol(key) ? key : String(key);
|
|
1954
1961
|
this._raw = toRaw(_object);
|
|
1955
1962
|
let shallow = true;
|
|
1956
1963
|
let obj = _object;
|
|
1957
|
-
if (!isArray(_object) || !isIntegerKey(
|
|
1964
|
+
if (!isArray(_object) || isSymbol(this._key) || !isIntegerKey(this._key)) {
|
|
1958
1965
|
do {
|
|
1959
1966
|
shallow = !isProxy(obj) || isShallow(obj);
|
|
1960
1967
|
} while (shallow && (obj = obj["__v_raw"]));
|
|
@@ -2754,6 +2761,13 @@ function checkRecursiveUpdates(seen, fn) {
|
|
|
2754
2761
|
}
|
|
2755
2762
|
|
|
2756
2763
|
let isHmrUpdating = false;
|
|
2764
|
+
const setHmrUpdating = (v) => {
|
|
2765
|
+
try {
|
|
2766
|
+
return isHmrUpdating;
|
|
2767
|
+
} finally {
|
|
2768
|
+
isHmrUpdating = v;
|
|
2769
|
+
}
|
|
2770
|
+
};
|
|
2757
2771
|
const hmrDirtyComponents = /* @__PURE__ */ new Map();
|
|
2758
2772
|
{
|
|
2759
2773
|
getGlobalThis().__VUE_HMR_RUNTIME__ = {
|
|
@@ -3809,9 +3823,10 @@ const TeleportImpl = {
|
|
|
3809
3823
|
mount(container, mainAnchor);
|
|
3810
3824
|
updateCssVars(n2, true);
|
|
3811
3825
|
}
|
|
3812
|
-
if (isTeleportDeferred(n2.props)) {
|
|
3826
|
+
if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
|
|
3813
3827
|
n2.el.__isMounted = false;
|
|
3814
3828
|
queuePostRenderEffect(() => {
|
|
3829
|
+
if (n2.el.__isMounted !== false) return;
|
|
3815
3830
|
mountToTarget();
|
|
3816
3831
|
delete n2.el.__isMounted;
|
|
3817
3832
|
}, parentSuspense);
|
|
@@ -3819,7 +3834,12 @@ const TeleportImpl = {
|
|
|
3819
3834
|
mountToTarget();
|
|
3820
3835
|
}
|
|
3821
3836
|
} else {
|
|
3822
|
-
|
|
3837
|
+
n2.el = n1.el;
|
|
3838
|
+
n2.targetStart = n1.targetStart;
|
|
3839
|
+
const mainAnchor = n2.anchor = n1.anchor;
|
|
3840
|
+
const target = n2.target = n1.target;
|
|
3841
|
+
const targetAnchor = n2.targetAnchor = n1.targetAnchor;
|
|
3842
|
+
if (n1.el.__isMounted === false) {
|
|
3823
3843
|
queuePostRenderEffect(() => {
|
|
3824
3844
|
TeleportImpl.process(
|
|
3825
3845
|
n1,
|
|
@@ -3836,11 +3856,6 @@ const TeleportImpl = {
|
|
|
3836
3856
|
}, parentSuspense);
|
|
3837
3857
|
return;
|
|
3838
3858
|
}
|
|
3839
|
-
n2.el = n1.el;
|
|
3840
|
-
n2.targetStart = n1.targetStart;
|
|
3841
|
-
const mainAnchor = n2.anchor = n1.anchor;
|
|
3842
|
-
const target = n2.target = n1.target;
|
|
3843
|
-
const targetAnchor = n2.targetAnchor = n1.targetAnchor;
|
|
3844
3859
|
const wasDisabled = isTeleportDisabled(n1.props);
|
|
3845
3860
|
const currentContainer = wasDisabled ? container : target;
|
|
3846
3861
|
const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
|
|
@@ -4306,7 +4321,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
4306
4321
|
callHook(hook, [el]);
|
|
4307
4322
|
},
|
|
4308
4323
|
enter(el) {
|
|
4309
|
-
if (leavingVNodesCache[key] === vnode) return;
|
|
4324
|
+
if (!isHmrUpdating && leavingVNodesCache[key] === vnode) return;
|
|
4310
4325
|
let hook = onEnter;
|
|
4311
4326
|
let afterHook = onAfterEnter;
|
|
4312
4327
|
let cancelHook = onEnterCancelled;
|
|
@@ -6234,12 +6249,16 @@ function renderList(source, renderItem, cache, index) {
|
|
|
6234
6249
|
);
|
|
6235
6250
|
}
|
|
6236
6251
|
} else if (typeof source === "number") {
|
|
6237
|
-
if (!Number.isInteger(source)) {
|
|
6238
|
-
warn$1(
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
|
|
6242
|
-
|
|
6252
|
+
if (!Number.isInteger(source) || source < 0) {
|
|
6253
|
+
warn$1(
|
|
6254
|
+
`The v-for range expects a positive integer value but got ${source}.`
|
|
6255
|
+
);
|
|
6256
|
+
ret = [];
|
|
6257
|
+
} else {
|
|
6258
|
+
ret = new Array(source);
|
|
6259
|
+
for (let i = 0; i < source; i++) {
|
|
6260
|
+
ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
|
|
6261
|
+
}
|
|
6243
6262
|
}
|
|
6244
6263
|
} else if (isObject(source)) {
|
|
6245
6264
|
if (source[Symbol.iterator]) {
|
|
@@ -6942,6 +6961,7 @@ function createPropsRestProxy(props, excludedKeys) {
|
|
|
6942
6961
|
}
|
|
6943
6962
|
function withAsyncContext(getAwaitable) {
|
|
6944
6963
|
const ctx = getCurrentInstance();
|
|
6964
|
+
const inSSRSetup = isInSSRComponentSetup;
|
|
6945
6965
|
if (!ctx) {
|
|
6946
6966
|
warn$1(
|
|
6947
6967
|
`withAsyncContext called without active current instance. This is likely a bug.`
|
|
@@ -6949,13 +6969,25 @@ function withAsyncContext(getAwaitable) {
|
|
|
6949
6969
|
}
|
|
6950
6970
|
let awaitable = getAwaitable();
|
|
6951
6971
|
unsetCurrentInstance();
|
|
6972
|
+
if (inSSRSetup) {
|
|
6973
|
+
setInSSRSetupState(false);
|
|
6974
|
+
}
|
|
6975
|
+
const restore = () => {
|
|
6976
|
+
setCurrentInstance(ctx);
|
|
6977
|
+
if (inSSRSetup) {
|
|
6978
|
+
setInSSRSetupState(true);
|
|
6979
|
+
}
|
|
6980
|
+
};
|
|
6952
6981
|
const cleanup = () => {
|
|
6953
6982
|
if (getCurrentInstance() !== ctx) ctx.scope.off();
|
|
6954
6983
|
unsetCurrentInstance();
|
|
6984
|
+
if (inSSRSetup) {
|
|
6985
|
+
setInSSRSetupState(false);
|
|
6986
|
+
}
|
|
6955
6987
|
};
|
|
6956
6988
|
if (isPromise(awaitable)) {
|
|
6957
6989
|
awaitable = awaitable.catch((e) => {
|
|
6958
|
-
|
|
6990
|
+
restore();
|
|
6959
6991
|
Promise.resolve().then(() => Promise.resolve().then(cleanup));
|
|
6960
6992
|
throw e;
|
|
6961
6993
|
});
|
|
@@ -6963,7 +6995,7 @@ function withAsyncContext(getAwaitable) {
|
|
|
6963
6995
|
return [
|
|
6964
6996
|
awaitable,
|
|
6965
6997
|
() => {
|
|
6966
|
-
|
|
6998
|
+
restore();
|
|
6967
6999
|
Promise.resolve().then(cleanup);
|
|
6968
7000
|
}
|
|
6969
7001
|
];
|
|
@@ -7487,7 +7519,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
7487
7519
|
return vm;
|
|
7488
7520
|
}
|
|
7489
7521
|
}
|
|
7490
|
-
Vue.version = `2.6.14-compat:${"3.5.
|
|
7522
|
+
Vue.version = `2.6.14-compat:${"3.5.31"}`;
|
|
7491
7523
|
Vue.config = singletonApp.config;
|
|
7492
7524
|
Vue.use = (plugin, ...options) => {
|
|
7493
7525
|
if (plugin && isFunction(plugin.install)) {
|
|
@@ -8646,11 +8678,12 @@ function hasPropValueChanged(nextProps, prevProps, key) {
|
|
|
8646
8678
|
}
|
|
8647
8679
|
return nextProp !== prevProp;
|
|
8648
8680
|
}
|
|
8649
|
-
function updateHOCHostEl({ vnode, parent }, el) {
|
|
8681
|
+
function updateHOCHostEl({ vnode, parent, suspense }, el) {
|
|
8650
8682
|
while (parent) {
|
|
8651
8683
|
const root = parent.subTree;
|
|
8652
8684
|
if (root.suspense && root.suspense.activeBranch === vnode) {
|
|
8653
|
-
root.el =
|
|
8685
|
+
root.suspense.vnode.el = root.el = el;
|
|
8686
|
+
vnode = root;
|
|
8654
8687
|
}
|
|
8655
8688
|
if (root === vnode) {
|
|
8656
8689
|
(vnode = parent.vnode).el = el;
|
|
@@ -8659,6 +8692,9 @@ function updateHOCHostEl({ vnode, parent }, el) {
|
|
|
8659
8692
|
break;
|
|
8660
8693
|
}
|
|
8661
8694
|
}
|
|
8695
|
+
if (suspense && suspense.activeBranch === vnode) {
|
|
8696
|
+
suspense.vnode.el = el;
|
|
8697
|
+
}
|
|
8662
8698
|
}
|
|
8663
8699
|
|
|
8664
8700
|
function createPropsDefaultThis(instance, rawProps, propKey) {
|
|
@@ -9572,10 +9608,17 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9572
9608
|
}
|
|
9573
9609
|
hostInsert(el, container, anchor);
|
|
9574
9610
|
if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
|
|
9611
|
+
const isHmr = isHmrUpdating;
|
|
9575
9612
|
queuePostRenderEffect(() => {
|
|
9576
|
-
|
|
9577
|
-
|
|
9578
|
-
|
|
9613
|
+
let prev;
|
|
9614
|
+
prev = setHmrUpdating(isHmr);
|
|
9615
|
+
try {
|
|
9616
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
9617
|
+
needCallTransitionHooks && transition.enter(el);
|
|
9618
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
9619
|
+
} finally {
|
|
9620
|
+
setHmrUpdating(prev);
|
|
9621
|
+
}
|
|
9579
9622
|
}, parentSuspense);
|
|
9580
9623
|
}
|
|
9581
9624
|
};
|
|
@@ -9984,7 +10027,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9984
10027
|
}
|
|
9985
10028
|
} else {
|
|
9986
10029
|
if (root.ce && root.ce._hasShadowRoot()) {
|
|
9987
|
-
root.ce._injectChildStyle(
|
|
10030
|
+
root.ce._injectChildStyle(
|
|
10031
|
+
type,
|
|
10032
|
+
instance.parent ? instance.parent.type : void 0
|
|
10033
|
+
);
|
|
9988
10034
|
}
|
|
9989
10035
|
{
|
|
9990
10036
|
startMeasure(instance, `render`);
|
|
@@ -10518,7 +10564,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
10518
10564
|
shapeFlag,
|
|
10519
10565
|
patchFlag,
|
|
10520
10566
|
dirs,
|
|
10521
|
-
cacheIndex
|
|
10567
|
+
cacheIndex,
|
|
10568
|
+
memo
|
|
10522
10569
|
} = vnode;
|
|
10523
10570
|
if (patchFlag === -2) {
|
|
10524
10571
|
optimized = false;
|
|
@@ -10580,10 +10627,14 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
10580
10627
|
remove(vnode);
|
|
10581
10628
|
}
|
|
10582
10629
|
}
|
|
10583
|
-
|
|
10630
|
+
const shouldInvalidateMemo = memo != null && cacheIndex == null;
|
|
10631
|
+
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs || shouldInvalidateMemo) {
|
|
10584
10632
|
queuePostRenderEffect(() => {
|
|
10585
10633
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
10586
10634
|
shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
10635
|
+
if (shouldInvalidateMemo) {
|
|
10636
|
+
vnode.el = null;
|
|
10637
|
+
}
|
|
10587
10638
|
}, parentSuspense);
|
|
10588
10639
|
}
|
|
10589
10640
|
};
|
|
@@ -11146,6 +11197,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
11146
11197
|
pendingId: suspenseId++,
|
|
11147
11198
|
timeout: typeof timeout === "number" ? timeout : -1,
|
|
11148
11199
|
activeBranch: null,
|
|
11200
|
+
isFallbackMountPending: false,
|
|
11149
11201
|
pendingBranch: null,
|
|
11150
11202
|
isInFallback: !isHydrating,
|
|
11151
11203
|
isHydrating,
|
|
@@ -11195,7 +11247,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
11195
11247
|
}
|
|
11196
11248
|
};
|
|
11197
11249
|
}
|
|
11198
|
-
if (activeBranch) {
|
|
11250
|
+
if (activeBranch && !suspense.isFallbackMountPending) {
|
|
11199
11251
|
if (parentNode(activeBranch.el) === container2) {
|
|
11200
11252
|
anchor = next(activeBranch);
|
|
11201
11253
|
}
|
|
@@ -11208,6 +11260,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
11208
11260
|
move(pendingBranch, container2, anchor, 0);
|
|
11209
11261
|
}
|
|
11210
11262
|
}
|
|
11263
|
+
suspense.isFallbackMountPending = false;
|
|
11211
11264
|
setActiveBranch(suspense, pendingBranch);
|
|
11212
11265
|
suspense.pendingBranch = null;
|
|
11213
11266
|
suspense.isInFallback = false;
|
|
@@ -11243,6 +11296,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
11243
11296
|
triggerEvent(vnode2, "onFallback");
|
|
11244
11297
|
const anchor2 = next(activeBranch);
|
|
11245
11298
|
const mountFallback = () => {
|
|
11299
|
+
suspense.isFallbackMountPending = false;
|
|
11246
11300
|
if (!suspense.isInFallback) {
|
|
11247
11301
|
return;
|
|
11248
11302
|
}
|
|
@@ -11262,6 +11316,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
11262
11316
|
};
|
|
11263
11317
|
const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
|
|
11264
11318
|
if (delayEnter) {
|
|
11319
|
+
suspense.isFallbackMountPending = true;
|
|
11265
11320
|
activeBranch.transition.afterLeave = mountFallback;
|
|
11266
11321
|
}
|
|
11267
11322
|
suspense.isInFallback = true;
|
|
@@ -11879,6 +11934,10 @@ function mergeProps(...args) {
|
|
|
11879
11934
|
const incoming = toMerge[key];
|
|
11880
11935
|
if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
|
|
11881
11936
|
ret[key] = existing ? [].concat(existing, incoming) : incoming;
|
|
11937
|
+
} else if (incoming == null && existing == null && // mergeProps({ 'onUpdate:modelValue': undefined }) should not retain
|
|
11938
|
+
// the model listener.
|
|
11939
|
+
!isModelListener(key)) {
|
|
11940
|
+
ret[key] = incoming;
|
|
11882
11941
|
}
|
|
11883
11942
|
} else if (key !== "") {
|
|
11884
11943
|
ret[key] = toMerge[key];
|
|
@@ -12575,7 +12634,7 @@ function isMemoSame(cached, memo) {
|
|
|
12575
12634
|
return true;
|
|
12576
12635
|
}
|
|
12577
12636
|
|
|
12578
|
-
const version = "3.5.
|
|
12637
|
+
const version = "3.5.31";
|
|
12579
12638
|
const warn = warn$1 ;
|
|
12580
12639
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
12581
12640
|
const devtools = devtools$1 ;
|
|
@@ -13460,7 +13519,9 @@ const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) =>
|
|
|
13460
13519
|
}
|
|
13461
13520
|
} else if (
|
|
13462
13521
|
// #11081 force set props for possible async custom element
|
|
13463
|
-
el._isVueCE &&
|
|
13522
|
+
el._isVueCE && // #12408 check if it's declared prop or it's async custom element
|
|
13523
|
+
(shouldSetAsPropForVueCE(el, key) || // @ts-expect-error _def is private
|
|
13524
|
+
el._def.__asyncLoader && (/[A-Z]/.test(key) || !isString(nextValue)))
|
|
13464
13525
|
) {
|
|
13465
13526
|
patchDOMProp(el, camelize(key), nextValue, parentComponent, key);
|
|
13466
13527
|
} else {
|
|
@@ -13508,6 +13569,17 @@ function shouldSetAsProp(el, key, value, isSVG) {
|
|
|
13508
13569
|
}
|
|
13509
13570
|
return key in el;
|
|
13510
13571
|
}
|
|
13572
|
+
function shouldSetAsPropForVueCE(el, key) {
|
|
13573
|
+
const props = (
|
|
13574
|
+
// @ts-expect-error _def is private
|
|
13575
|
+
el._def.props
|
|
13576
|
+
);
|
|
13577
|
+
if (!props) {
|
|
13578
|
+
return false;
|
|
13579
|
+
}
|
|
13580
|
+
const camelKey = camelize(key);
|
|
13581
|
+
return Array.isArray(props) ? props.some((prop) => camelize(prop) === camelKey) : Object.keys(props).some((prop) => camelize(prop) === camelKey);
|
|
13582
|
+
}
|
|
13511
13583
|
|
|
13512
13584
|
const REMOVAL = {};
|
|
13513
13585
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -13552,6 +13624,7 @@ class VueElement extends BaseClass {
|
|
|
13552
13624
|
this._dirty = false;
|
|
13553
13625
|
this._numberProps = null;
|
|
13554
13626
|
this._styleChildren = /* @__PURE__ */ new WeakSet();
|
|
13627
|
+
this._styleAnchors = /* @__PURE__ */ new WeakMap();
|
|
13555
13628
|
this._ob = null;
|
|
13556
13629
|
if (this.shadowRoot && _createApp !== createApp) {
|
|
13557
13630
|
this._root = this.shadowRoot;
|
|
@@ -13580,7 +13653,8 @@ class VueElement extends BaseClass {
|
|
|
13580
13653
|
}
|
|
13581
13654
|
this._connected = true;
|
|
13582
13655
|
let parent = this;
|
|
13583
|
-
while (parent = parent &&
|
|
13656
|
+
while (parent = parent && // #12479 should check assignedSlot first to get correct parent
|
|
13657
|
+
(parent.assignedSlot || parent.parentNode || parent.host)) {
|
|
13584
13658
|
if (parent instanceof VueElement) {
|
|
13585
13659
|
this._parent = parent;
|
|
13586
13660
|
break;
|
|
@@ -13802,6 +13876,7 @@ class VueElement extends BaseClass {
|
|
|
13802
13876
|
this._styles.forEach((s) => this._root.removeChild(s));
|
|
13803
13877
|
this._styles.length = 0;
|
|
13804
13878
|
}
|
|
13879
|
+
this._styleAnchors.delete(this._def);
|
|
13805
13880
|
this._applyStyles(newStyles);
|
|
13806
13881
|
this._instance = null;
|
|
13807
13882
|
this._update();
|
|
@@ -13826,7 +13901,7 @@ class VueElement extends BaseClass {
|
|
|
13826
13901
|
}
|
|
13827
13902
|
return vnode;
|
|
13828
13903
|
}
|
|
13829
|
-
_applyStyles(styles, owner) {
|
|
13904
|
+
_applyStyles(styles, owner, parentComp) {
|
|
13830
13905
|
if (!styles) return;
|
|
13831
13906
|
if (owner) {
|
|
13832
13907
|
if (owner === this._def || this._styleChildren.has(owner)) {
|
|
@@ -13835,11 +13910,19 @@ class VueElement extends BaseClass {
|
|
|
13835
13910
|
this._styleChildren.add(owner);
|
|
13836
13911
|
}
|
|
13837
13912
|
const nonce = this._nonce;
|
|
13913
|
+
const root = this.shadowRoot;
|
|
13914
|
+
const insertionAnchor = parentComp ? this._getStyleAnchor(parentComp) || this._getStyleAnchor(this._def) : this._getRootStyleInsertionAnchor(root);
|
|
13915
|
+
let last = null;
|
|
13838
13916
|
for (let i = styles.length - 1; i >= 0; i--) {
|
|
13839
13917
|
const s = document.createElement("style");
|
|
13840
13918
|
if (nonce) s.setAttribute("nonce", nonce);
|
|
13841
13919
|
s.textContent = styles[i];
|
|
13842
|
-
|
|
13920
|
+
root.insertBefore(s, last || insertionAnchor);
|
|
13921
|
+
last = s;
|
|
13922
|
+
if (i === 0) {
|
|
13923
|
+
if (!parentComp) this._styleAnchors.set(this._def, s);
|
|
13924
|
+
if (owner) this._styleAnchors.set(owner, s);
|
|
13925
|
+
}
|
|
13843
13926
|
{
|
|
13844
13927
|
if (owner) {
|
|
13845
13928
|
if (owner.__hmrId) {
|
|
@@ -13856,6 +13939,28 @@ class VueElement extends BaseClass {
|
|
|
13856
13939
|
}
|
|
13857
13940
|
}
|
|
13858
13941
|
}
|
|
13942
|
+
_getStyleAnchor(comp) {
|
|
13943
|
+
if (!comp) {
|
|
13944
|
+
return null;
|
|
13945
|
+
}
|
|
13946
|
+
const anchor = this._styleAnchors.get(comp);
|
|
13947
|
+
if (anchor && anchor.parentNode === this.shadowRoot) {
|
|
13948
|
+
return anchor;
|
|
13949
|
+
}
|
|
13950
|
+
if (anchor) {
|
|
13951
|
+
this._styleAnchors.delete(comp);
|
|
13952
|
+
}
|
|
13953
|
+
return null;
|
|
13954
|
+
}
|
|
13955
|
+
_getRootStyleInsertionAnchor(root) {
|
|
13956
|
+
for (let i = 0; i < root.childNodes.length; i++) {
|
|
13957
|
+
const node = root.childNodes[i];
|
|
13958
|
+
if (!(node instanceof HTMLStyleElement)) {
|
|
13959
|
+
return node;
|
|
13960
|
+
}
|
|
13961
|
+
}
|
|
13962
|
+
return null;
|
|
13963
|
+
}
|
|
13859
13964
|
/**
|
|
13860
13965
|
* Only called when shadowRoot is false
|
|
13861
13966
|
*/
|
|
@@ -13918,8 +14023,8 @@ class VueElement extends BaseClass {
|
|
|
13918
14023
|
/**
|
|
13919
14024
|
* @internal
|
|
13920
14025
|
*/
|
|
13921
|
-
_injectChildStyle(comp) {
|
|
13922
|
-
this._applyStyles(comp.styles, comp);
|
|
14026
|
+
_injectChildStyle(comp, parentComp) {
|
|
14027
|
+
this._applyStyles(comp.styles, comp, parentComp);
|
|
13923
14028
|
}
|
|
13924
14029
|
/**
|
|
13925
14030
|
* @internal
|
|
@@ -13949,6 +14054,7 @@ class VueElement extends BaseClass {
|
|
|
13949
14054
|
_removeChildStyle(comp) {
|
|
13950
14055
|
{
|
|
13951
14056
|
this._styleChildren.delete(comp);
|
|
14057
|
+
this._styleAnchors.delete(comp);
|
|
13952
14058
|
if (this._childStyles && comp.__hmrId) {
|
|
13953
14059
|
const oldStyles = this._childStyles.get(comp.__hmrId);
|
|
13954
14060
|
if (oldStyles) {
|
|
@@ -14216,7 +14322,8 @@ const vModelText = {
|
|
|
14216
14322
|
if (elValue === newValue) {
|
|
14217
14323
|
return;
|
|
14218
14324
|
}
|
|
14219
|
-
|
|
14325
|
+
const rootNode = el.getRootNode();
|
|
14326
|
+
if ((rootNode instanceof Document || rootNode instanceof ShadowRoot) && rootNode.activeElement === el && el.type !== "range") {
|
|
14220
14327
|
if (lazy && value === oldValue) {
|
|
14221
14328
|
return;
|
|
14222
14329
|
}
|
|
@@ -18654,7 +18761,7 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
18654
18761
|
loop.body = createBlockStatement([
|
|
18655
18762
|
createCompoundExpression([`const _memo = (`, memo.exp, `)`]),
|
|
18656
18763
|
createCompoundExpression([
|
|
18657
|
-
`if (_cached`,
|
|
18764
|
+
`if (_cached && _cached.el`,
|
|
18658
18765
|
...keyExp ? [` && _cached.key === `, keyExp] : [],
|
|
18659
18766
|
` && ${context.helperString(
|
|
18660
18767
|
IS_MEMO_SAME
|