@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
|
@@ -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
|
**/
|
|
@@ -1205,10 +1205,17 @@ function apply(self, method, fn, thisArg, wrappedRetFn, args) {
|
|
|
1205
1205
|
}
|
|
1206
1206
|
function reduce(self, method, fn, args) {
|
|
1207
1207
|
const arr = shallowReadArray(self);
|
|
1208
|
+
const needsWrap = arr !== self && !isShallow(self);
|
|
1208
1209
|
let wrappedFn = fn;
|
|
1210
|
+
let wrapInitialAccumulator = false;
|
|
1209
1211
|
if (arr !== self) {
|
|
1210
|
-
if (
|
|
1212
|
+
if (needsWrap) {
|
|
1213
|
+
wrapInitialAccumulator = args.length === 0;
|
|
1211
1214
|
wrappedFn = function(acc, item, index) {
|
|
1215
|
+
if (wrapInitialAccumulator) {
|
|
1216
|
+
wrapInitialAccumulator = false;
|
|
1217
|
+
acc = toWrapped(self, acc);
|
|
1218
|
+
}
|
|
1212
1219
|
return fn.call(this, acc, toWrapped(self, item), index, self);
|
|
1213
1220
|
};
|
|
1214
1221
|
} else if (fn.length > 3) {
|
|
@@ -1217,7 +1224,8 @@ function reduce(self, method, fn, args) {
|
|
|
1217
1224
|
};
|
|
1218
1225
|
}
|
|
1219
1226
|
}
|
|
1220
|
-
|
|
1227
|
+
const result = arr[method](wrappedFn, ...args);
|
|
1228
|
+
return wrapInitialAccumulator ? toWrapped(self, result) : result;
|
|
1221
1229
|
}
|
|
1222
1230
|
function searchProxy(self, method, args) {
|
|
1223
1231
|
const arr = toRaw(self);
|
|
@@ -1507,15 +1515,14 @@ function createInstrumentations(readonly, shallow) {
|
|
|
1507
1515
|
clear: createReadonlyMethod("clear")
|
|
1508
1516
|
} : {
|
|
1509
1517
|
add(value) {
|
|
1510
|
-
if (!shallow && !isShallow(value) && !isReadonly(value)) {
|
|
1511
|
-
value = toRaw(value);
|
|
1512
|
-
}
|
|
1513
1518
|
const target = toRaw(this);
|
|
1514
1519
|
const proto = getProto(target);
|
|
1515
|
-
const
|
|
1520
|
+
const rawValue = toRaw(value);
|
|
1521
|
+
const valueToAdd = !shallow && !isShallow(value) && !isReadonly(value) ? rawValue : value;
|
|
1522
|
+
const hadKey = proto.has.call(target, valueToAdd) || hasChanged(value, valueToAdd) && proto.has.call(target, value) || hasChanged(rawValue, valueToAdd) && proto.has.call(target, rawValue);
|
|
1516
1523
|
if (!hadKey) {
|
|
1517
|
-
target.add(
|
|
1518
|
-
trigger(target, "add",
|
|
1524
|
+
target.add(valueToAdd);
|
|
1525
|
+
trigger(target, "add", valueToAdd, valueToAdd);
|
|
1519
1526
|
}
|
|
1520
1527
|
return this;
|
|
1521
1528
|
},
|
|
@@ -1872,16 +1879,16 @@ function toRefs(object) {
|
|
|
1872
1879
|
return ret;
|
|
1873
1880
|
}
|
|
1874
1881
|
class ObjectRefImpl {
|
|
1875
|
-
constructor(_object,
|
|
1882
|
+
constructor(_object, key, _defaultValue) {
|
|
1876
1883
|
this._object = _object;
|
|
1877
|
-
this._key = _key;
|
|
1878
1884
|
this._defaultValue = _defaultValue;
|
|
1879
1885
|
this["__v_isRef"] = true;
|
|
1880
1886
|
this._value = void 0;
|
|
1887
|
+
this._key = isSymbol(key) ? key : String(key);
|
|
1881
1888
|
this._raw = toRaw(_object);
|
|
1882
1889
|
let shallow = true;
|
|
1883
1890
|
let obj = _object;
|
|
1884
|
-
if (!isArray(_object) || !isIntegerKey(
|
|
1891
|
+
if (!isArray(_object) || isSymbol(this._key) || !isIntegerKey(this._key)) {
|
|
1885
1892
|
do {
|
|
1886
1893
|
shallow = !isProxy(obj) || isShallow(obj);
|
|
1887
1894
|
} while (shallow && (obj = obj["__v_raw"]));
|
|
@@ -2681,6 +2688,13 @@ function checkRecursiveUpdates(seen, fn) {
|
|
|
2681
2688
|
}
|
|
2682
2689
|
|
|
2683
2690
|
let isHmrUpdating = false;
|
|
2691
|
+
const setHmrUpdating = (v) => {
|
|
2692
|
+
try {
|
|
2693
|
+
return isHmrUpdating;
|
|
2694
|
+
} finally {
|
|
2695
|
+
isHmrUpdating = v;
|
|
2696
|
+
}
|
|
2697
|
+
};
|
|
2684
2698
|
const hmrDirtyComponents = /* @__PURE__ */ new Map();
|
|
2685
2699
|
{
|
|
2686
2700
|
getGlobalThis().__VUE_HMR_RUNTIME__ = {
|
|
@@ -3736,9 +3750,10 @@ const TeleportImpl = {
|
|
|
3736
3750
|
mount(container, mainAnchor);
|
|
3737
3751
|
updateCssVars(n2, true);
|
|
3738
3752
|
}
|
|
3739
|
-
if (isTeleportDeferred(n2.props)) {
|
|
3753
|
+
if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
|
|
3740
3754
|
n2.el.__isMounted = false;
|
|
3741
3755
|
queuePostRenderEffect(() => {
|
|
3756
|
+
if (n2.el.__isMounted !== false) return;
|
|
3742
3757
|
mountToTarget();
|
|
3743
3758
|
delete n2.el.__isMounted;
|
|
3744
3759
|
}, parentSuspense);
|
|
@@ -3746,7 +3761,12 @@ const TeleportImpl = {
|
|
|
3746
3761
|
mountToTarget();
|
|
3747
3762
|
}
|
|
3748
3763
|
} else {
|
|
3749
|
-
|
|
3764
|
+
n2.el = n1.el;
|
|
3765
|
+
n2.targetStart = n1.targetStart;
|
|
3766
|
+
const mainAnchor = n2.anchor = n1.anchor;
|
|
3767
|
+
const target = n2.target = n1.target;
|
|
3768
|
+
const targetAnchor = n2.targetAnchor = n1.targetAnchor;
|
|
3769
|
+
if (n1.el.__isMounted === false) {
|
|
3750
3770
|
queuePostRenderEffect(() => {
|
|
3751
3771
|
TeleportImpl.process(
|
|
3752
3772
|
n1,
|
|
@@ -3763,11 +3783,6 @@ const TeleportImpl = {
|
|
|
3763
3783
|
}, parentSuspense);
|
|
3764
3784
|
return;
|
|
3765
3785
|
}
|
|
3766
|
-
n2.el = n1.el;
|
|
3767
|
-
n2.targetStart = n1.targetStart;
|
|
3768
|
-
const mainAnchor = n2.anchor = n1.anchor;
|
|
3769
|
-
const target = n2.target = n1.target;
|
|
3770
|
-
const targetAnchor = n2.targetAnchor = n1.targetAnchor;
|
|
3771
3786
|
const wasDisabled = isTeleportDisabled(n1.props);
|
|
3772
3787
|
const currentContainer = wasDisabled ? container : target;
|
|
3773
3788
|
const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
|
|
@@ -4233,7 +4248,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
4233
4248
|
callHook(hook, [el]);
|
|
4234
4249
|
},
|
|
4235
4250
|
enter(el) {
|
|
4236
|
-
if (leavingVNodesCache[key] === vnode) return;
|
|
4251
|
+
if (!isHmrUpdating && leavingVNodesCache[key] === vnode) return;
|
|
4237
4252
|
let hook = onEnter;
|
|
4238
4253
|
let afterHook = onAfterEnter;
|
|
4239
4254
|
let cancelHook = onEnterCancelled;
|
|
@@ -6161,12 +6176,16 @@ function renderList(source, renderItem, cache, index) {
|
|
|
6161
6176
|
);
|
|
6162
6177
|
}
|
|
6163
6178
|
} else if (typeof source === "number") {
|
|
6164
|
-
if (!Number.isInteger(source)) {
|
|
6165
|
-
warn$1(
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
|
|
6179
|
+
if (!Number.isInteger(source) || source < 0) {
|
|
6180
|
+
warn$1(
|
|
6181
|
+
`The v-for range expects a positive integer value but got ${source}.`
|
|
6182
|
+
);
|
|
6183
|
+
ret = [];
|
|
6184
|
+
} else {
|
|
6185
|
+
ret = new Array(source);
|
|
6186
|
+
for (let i = 0; i < source; i++) {
|
|
6187
|
+
ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
|
|
6188
|
+
}
|
|
6170
6189
|
}
|
|
6171
6190
|
} else if (isObject(source)) {
|
|
6172
6191
|
if (source[Symbol.iterator]) {
|
|
@@ -6869,6 +6888,7 @@ function createPropsRestProxy(props, excludedKeys) {
|
|
|
6869
6888
|
}
|
|
6870
6889
|
function withAsyncContext(getAwaitable) {
|
|
6871
6890
|
const ctx = getCurrentInstance();
|
|
6891
|
+
const inSSRSetup = isInSSRComponentSetup;
|
|
6872
6892
|
if (!ctx) {
|
|
6873
6893
|
warn$1(
|
|
6874
6894
|
`withAsyncContext called without active current instance. This is likely a bug.`
|
|
@@ -6876,13 +6896,25 @@ function withAsyncContext(getAwaitable) {
|
|
|
6876
6896
|
}
|
|
6877
6897
|
let awaitable = getAwaitable();
|
|
6878
6898
|
unsetCurrentInstance();
|
|
6899
|
+
if (inSSRSetup) {
|
|
6900
|
+
setInSSRSetupState(false);
|
|
6901
|
+
}
|
|
6902
|
+
const restore = () => {
|
|
6903
|
+
setCurrentInstance(ctx);
|
|
6904
|
+
if (inSSRSetup) {
|
|
6905
|
+
setInSSRSetupState(true);
|
|
6906
|
+
}
|
|
6907
|
+
};
|
|
6879
6908
|
const cleanup = () => {
|
|
6880
6909
|
if (getCurrentInstance() !== ctx) ctx.scope.off();
|
|
6881
6910
|
unsetCurrentInstance();
|
|
6911
|
+
if (inSSRSetup) {
|
|
6912
|
+
setInSSRSetupState(false);
|
|
6913
|
+
}
|
|
6882
6914
|
};
|
|
6883
6915
|
if (isPromise(awaitable)) {
|
|
6884
6916
|
awaitable = awaitable.catch((e) => {
|
|
6885
|
-
|
|
6917
|
+
restore();
|
|
6886
6918
|
Promise.resolve().then(() => Promise.resolve().then(cleanup));
|
|
6887
6919
|
throw e;
|
|
6888
6920
|
});
|
|
@@ -6890,7 +6922,7 @@ function withAsyncContext(getAwaitable) {
|
|
|
6890
6922
|
return [
|
|
6891
6923
|
awaitable,
|
|
6892
6924
|
() => {
|
|
6893
|
-
|
|
6925
|
+
restore();
|
|
6894
6926
|
Promise.resolve().then(cleanup);
|
|
6895
6927
|
}
|
|
6896
6928
|
];
|
|
@@ -7414,7 +7446,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
7414
7446
|
return vm;
|
|
7415
7447
|
}
|
|
7416
7448
|
}
|
|
7417
|
-
Vue.version = `2.6.14-compat:${"3.5.
|
|
7449
|
+
Vue.version = `2.6.14-compat:${"3.5.31"}`;
|
|
7418
7450
|
Vue.config = singletonApp.config;
|
|
7419
7451
|
Vue.use = (plugin, ...options) => {
|
|
7420
7452
|
if (plugin && isFunction(plugin.install)) {
|
|
@@ -8573,11 +8605,12 @@ function hasPropValueChanged(nextProps, prevProps, key) {
|
|
|
8573
8605
|
}
|
|
8574
8606
|
return nextProp !== prevProp;
|
|
8575
8607
|
}
|
|
8576
|
-
function updateHOCHostEl({ vnode, parent }, el) {
|
|
8608
|
+
function updateHOCHostEl({ vnode, parent, suspense }, el) {
|
|
8577
8609
|
while (parent) {
|
|
8578
8610
|
const root = parent.subTree;
|
|
8579
8611
|
if (root.suspense && root.suspense.activeBranch === vnode) {
|
|
8580
|
-
root.el =
|
|
8612
|
+
root.suspense.vnode.el = root.el = el;
|
|
8613
|
+
vnode = root;
|
|
8581
8614
|
}
|
|
8582
8615
|
if (root === vnode) {
|
|
8583
8616
|
(vnode = parent.vnode).el = el;
|
|
@@ -8586,6 +8619,9 @@ function updateHOCHostEl({ vnode, parent }, el) {
|
|
|
8586
8619
|
break;
|
|
8587
8620
|
}
|
|
8588
8621
|
}
|
|
8622
|
+
if (suspense && suspense.activeBranch === vnode) {
|
|
8623
|
+
suspense.vnode.el = el;
|
|
8624
|
+
}
|
|
8589
8625
|
}
|
|
8590
8626
|
|
|
8591
8627
|
function createPropsDefaultThis(instance, rawProps, propKey) {
|
|
@@ -9499,10 +9535,17 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9499
9535
|
}
|
|
9500
9536
|
hostInsert(el, container, anchor);
|
|
9501
9537
|
if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
|
|
9538
|
+
const isHmr = isHmrUpdating;
|
|
9502
9539
|
queuePostRenderEffect(() => {
|
|
9503
|
-
|
|
9504
|
-
|
|
9505
|
-
|
|
9540
|
+
let prev;
|
|
9541
|
+
prev = setHmrUpdating(isHmr);
|
|
9542
|
+
try {
|
|
9543
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
9544
|
+
needCallTransitionHooks && transition.enter(el);
|
|
9545
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
9546
|
+
} finally {
|
|
9547
|
+
setHmrUpdating(prev);
|
|
9548
|
+
}
|
|
9506
9549
|
}, parentSuspense);
|
|
9507
9550
|
}
|
|
9508
9551
|
};
|
|
@@ -9911,7 +9954,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9911
9954
|
}
|
|
9912
9955
|
} else {
|
|
9913
9956
|
if (root.ce && root.ce._hasShadowRoot()) {
|
|
9914
|
-
root.ce._injectChildStyle(
|
|
9957
|
+
root.ce._injectChildStyle(
|
|
9958
|
+
type,
|
|
9959
|
+
instance.parent ? instance.parent.type : void 0
|
|
9960
|
+
);
|
|
9915
9961
|
}
|
|
9916
9962
|
{
|
|
9917
9963
|
startMeasure(instance, `render`);
|
|
@@ -10445,7 +10491,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
10445
10491
|
shapeFlag,
|
|
10446
10492
|
patchFlag,
|
|
10447
10493
|
dirs,
|
|
10448
|
-
cacheIndex
|
|
10494
|
+
cacheIndex,
|
|
10495
|
+
memo
|
|
10449
10496
|
} = vnode;
|
|
10450
10497
|
if (patchFlag === -2) {
|
|
10451
10498
|
optimized = false;
|
|
@@ -10507,10 +10554,14 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
10507
10554
|
remove(vnode);
|
|
10508
10555
|
}
|
|
10509
10556
|
}
|
|
10510
|
-
|
|
10557
|
+
const shouldInvalidateMemo = memo != null && cacheIndex == null;
|
|
10558
|
+
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs || shouldInvalidateMemo) {
|
|
10511
10559
|
queuePostRenderEffect(() => {
|
|
10512
10560
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
10513
10561
|
shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
10562
|
+
if (shouldInvalidateMemo) {
|
|
10563
|
+
vnode.el = null;
|
|
10564
|
+
}
|
|
10514
10565
|
}, parentSuspense);
|
|
10515
10566
|
}
|
|
10516
10567
|
};
|
|
@@ -11073,6 +11124,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
11073
11124
|
pendingId: suspenseId++,
|
|
11074
11125
|
timeout: typeof timeout === "number" ? timeout : -1,
|
|
11075
11126
|
activeBranch: null,
|
|
11127
|
+
isFallbackMountPending: false,
|
|
11076
11128
|
pendingBranch: null,
|
|
11077
11129
|
isInFallback: !isHydrating,
|
|
11078
11130
|
isHydrating,
|
|
@@ -11122,7 +11174,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
11122
11174
|
}
|
|
11123
11175
|
};
|
|
11124
11176
|
}
|
|
11125
|
-
if (activeBranch) {
|
|
11177
|
+
if (activeBranch && !suspense.isFallbackMountPending) {
|
|
11126
11178
|
if (parentNode(activeBranch.el) === container2) {
|
|
11127
11179
|
anchor = next(activeBranch);
|
|
11128
11180
|
}
|
|
@@ -11135,6 +11187,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
11135
11187
|
move(pendingBranch, container2, anchor, 0);
|
|
11136
11188
|
}
|
|
11137
11189
|
}
|
|
11190
|
+
suspense.isFallbackMountPending = false;
|
|
11138
11191
|
setActiveBranch(suspense, pendingBranch);
|
|
11139
11192
|
suspense.pendingBranch = null;
|
|
11140
11193
|
suspense.isInFallback = false;
|
|
@@ -11170,6 +11223,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
11170
11223
|
triggerEvent(vnode2, "onFallback");
|
|
11171
11224
|
const anchor2 = next(activeBranch);
|
|
11172
11225
|
const mountFallback = () => {
|
|
11226
|
+
suspense.isFallbackMountPending = false;
|
|
11173
11227
|
if (!suspense.isInFallback) {
|
|
11174
11228
|
return;
|
|
11175
11229
|
}
|
|
@@ -11189,6 +11243,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
11189
11243
|
};
|
|
11190
11244
|
const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
|
|
11191
11245
|
if (delayEnter) {
|
|
11246
|
+
suspense.isFallbackMountPending = true;
|
|
11192
11247
|
activeBranch.transition.afterLeave = mountFallback;
|
|
11193
11248
|
}
|
|
11194
11249
|
suspense.isInFallback = true;
|
|
@@ -11806,6 +11861,10 @@ function mergeProps(...args) {
|
|
|
11806
11861
|
const incoming = toMerge[key];
|
|
11807
11862
|
if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
|
|
11808
11863
|
ret[key] = existing ? [].concat(existing, incoming) : incoming;
|
|
11864
|
+
} else if (incoming == null && existing == null && // mergeProps({ 'onUpdate:modelValue': undefined }) should not retain
|
|
11865
|
+
// the model listener.
|
|
11866
|
+
!isModelListener(key)) {
|
|
11867
|
+
ret[key] = incoming;
|
|
11809
11868
|
}
|
|
11810
11869
|
} else if (key !== "") {
|
|
11811
11870
|
ret[key] = toMerge[key];
|
|
@@ -12502,7 +12561,7 @@ function isMemoSame(cached, memo) {
|
|
|
12502
12561
|
return true;
|
|
12503
12562
|
}
|
|
12504
12563
|
|
|
12505
|
-
const version = "3.5.
|
|
12564
|
+
const version = "3.5.31";
|
|
12506
12565
|
const warn = warn$1 ;
|
|
12507
12566
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
12508
12567
|
const devtools = devtools$1 ;
|
|
@@ -13387,7 +13446,9 @@ const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) =>
|
|
|
13387
13446
|
}
|
|
13388
13447
|
} else if (
|
|
13389
13448
|
// #11081 force set props for possible async custom element
|
|
13390
|
-
el._isVueCE &&
|
|
13449
|
+
el._isVueCE && // #12408 check if it's declared prop or it's async custom element
|
|
13450
|
+
(shouldSetAsPropForVueCE(el, key) || // @ts-expect-error _def is private
|
|
13451
|
+
el._def.__asyncLoader && (/[A-Z]/.test(key) || !isString(nextValue)))
|
|
13391
13452
|
) {
|
|
13392
13453
|
patchDOMProp(el, camelize(key), nextValue, parentComponent, key);
|
|
13393
13454
|
} else {
|
|
@@ -13435,6 +13496,17 @@ function shouldSetAsProp(el, key, value, isSVG) {
|
|
|
13435
13496
|
}
|
|
13436
13497
|
return key in el;
|
|
13437
13498
|
}
|
|
13499
|
+
function shouldSetAsPropForVueCE(el, key) {
|
|
13500
|
+
const props = (
|
|
13501
|
+
// @ts-expect-error _def is private
|
|
13502
|
+
el._def.props
|
|
13503
|
+
);
|
|
13504
|
+
if (!props) {
|
|
13505
|
+
return false;
|
|
13506
|
+
}
|
|
13507
|
+
const camelKey = camelize(key);
|
|
13508
|
+
return Array.isArray(props) ? props.some((prop) => camelize(prop) === camelKey) : Object.keys(props).some((prop) => camelize(prop) === camelKey);
|
|
13509
|
+
}
|
|
13438
13510
|
|
|
13439
13511
|
const REMOVAL = {};
|
|
13440
13512
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -13479,6 +13551,7 @@ class VueElement extends BaseClass {
|
|
|
13479
13551
|
this._dirty = false;
|
|
13480
13552
|
this._numberProps = null;
|
|
13481
13553
|
this._styleChildren = /* @__PURE__ */ new WeakSet();
|
|
13554
|
+
this._styleAnchors = /* @__PURE__ */ new WeakMap();
|
|
13482
13555
|
this._ob = null;
|
|
13483
13556
|
if (this.shadowRoot && _createApp !== createApp) {
|
|
13484
13557
|
this._root = this.shadowRoot;
|
|
@@ -13507,7 +13580,8 @@ class VueElement extends BaseClass {
|
|
|
13507
13580
|
}
|
|
13508
13581
|
this._connected = true;
|
|
13509
13582
|
let parent = this;
|
|
13510
|
-
while (parent = parent &&
|
|
13583
|
+
while (parent = parent && // #12479 should check assignedSlot first to get correct parent
|
|
13584
|
+
(parent.assignedSlot || parent.parentNode || parent.host)) {
|
|
13511
13585
|
if (parent instanceof VueElement) {
|
|
13512
13586
|
this._parent = parent;
|
|
13513
13587
|
break;
|
|
@@ -13729,6 +13803,7 @@ class VueElement extends BaseClass {
|
|
|
13729
13803
|
this._styles.forEach((s) => this._root.removeChild(s));
|
|
13730
13804
|
this._styles.length = 0;
|
|
13731
13805
|
}
|
|
13806
|
+
this._styleAnchors.delete(this._def);
|
|
13732
13807
|
this._applyStyles(newStyles);
|
|
13733
13808
|
this._instance = null;
|
|
13734
13809
|
this._update();
|
|
@@ -13753,7 +13828,7 @@ class VueElement extends BaseClass {
|
|
|
13753
13828
|
}
|
|
13754
13829
|
return vnode;
|
|
13755
13830
|
}
|
|
13756
|
-
_applyStyles(styles, owner) {
|
|
13831
|
+
_applyStyles(styles, owner, parentComp) {
|
|
13757
13832
|
if (!styles) return;
|
|
13758
13833
|
if (owner) {
|
|
13759
13834
|
if (owner === this._def || this._styleChildren.has(owner)) {
|
|
@@ -13762,11 +13837,19 @@ class VueElement extends BaseClass {
|
|
|
13762
13837
|
this._styleChildren.add(owner);
|
|
13763
13838
|
}
|
|
13764
13839
|
const nonce = this._nonce;
|
|
13840
|
+
const root = this.shadowRoot;
|
|
13841
|
+
const insertionAnchor = parentComp ? this._getStyleAnchor(parentComp) || this._getStyleAnchor(this._def) : this._getRootStyleInsertionAnchor(root);
|
|
13842
|
+
let last = null;
|
|
13765
13843
|
for (let i = styles.length - 1; i >= 0; i--) {
|
|
13766
13844
|
const s = document.createElement("style");
|
|
13767
13845
|
if (nonce) s.setAttribute("nonce", nonce);
|
|
13768
13846
|
s.textContent = styles[i];
|
|
13769
|
-
|
|
13847
|
+
root.insertBefore(s, last || insertionAnchor);
|
|
13848
|
+
last = s;
|
|
13849
|
+
if (i === 0) {
|
|
13850
|
+
if (!parentComp) this._styleAnchors.set(this._def, s);
|
|
13851
|
+
if (owner) this._styleAnchors.set(owner, s);
|
|
13852
|
+
}
|
|
13770
13853
|
{
|
|
13771
13854
|
if (owner) {
|
|
13772
13855
|
if (owner.__hmrId) {
|
|
@@ -13783,6 +13866,28 @@ class VueElement extends BaseClass {
|
|
|
13783
13866
|
}
|
|
13784
13867
|
}
|
|
13785
13868
|
}
|
|
13869
|
+
_getStyleAnchor(comp) {
|
|
13870
|
+
if (!comp) {
|
|
13871
|
+
return null;
|
|
13872
|
+
}
|
|
13873
|
+
const anchor = this._styleAnchors.get(comp);
|
|
13874
|
+
if (anchor && anchor.parentNode === this.shadowRoot) {
|
|
13875
|
+
return anchor;
|
|
13876
|
+
}
|
|
13877
|
+
if (anchor) {
|
|
13878
|
+
this._styleAnchors.delete(comp);
|
|
13879
|
+
}
|
|
13880
|
+
return null;
|
|
13881
|
+
}
|
|
13882
|
+
_getRootStyleInsertionAnchor(root) {
|
|
13883
|
+
for (let i = 0; i < root.childNodes.length; i++) {
|
|
13884
|
+
const node = root.childNodes[i];
|
|
13885
|
+
if (!(node instanceof HTMLStyleElement)) {
|
|
13886
|
+
return node;
|
|
13887
|
+
}
|
|
13888
|
+
}
|
|
13889
|
+
return null;
|
|
13890
|
+
}
|
|
13786
13891
|
/**
|
|
13787
13892
|
* Only called when shadowRoot is false
|
|
13788
13893
|
*/
|
|
@@ -13845,8 +13950,8 @@ class VueElement extends BaseClass {
|
|
|
13845
13950
|
/**
|
|
13846
13951
|
* @internal
|
|
13847
13952
|
*/
|
|
13848
|
-
_injectChildStyle(comp) {
|
|
13849
|
-
this._applyStyles(comp.styles, comp);
|
|
13953
|
+
_injectChildStyle(comp, parentComp) {
|
|
13954
|
+
this._applyStyles(comp.styles, comp, parentComp);
|
|
13850
13955
|
}
|
|
13851
13956
|
/**
|
|
13852
13957
|
* @internal
|
|
@@ -13876,6 +13981,7 @@ class VueElement extends BaseClass {
|
|
|
13876
13981
|
_removeChildStyle(comp) {
|
|
13877
13982
|
{
|
|
13878
13983
|
this._styleChildren.delete(comp);
|
|
13984
|
+
this._styleAnchors.delete(comp);
|
|
13879
13985
|
if (this._childStyles && comp.__hmrId) {
|
|
13880
13986
|
const oldStyles = this._childStyles.get(comp.__hmrId);
|
|
13881
13987
|
if (oldStyles) {
|
|
@@ -14143,7 +14249,8 @@ const vModelText = {
|
|
|
14143
14249
|
if (elValue === newValue) {
|
|
14144
14250
|
return;
|
|
14145
14251
|
}
|
|
14146
|
-
|
|
14252
|
+
const rootNode = el.getRootNode();
|
|
14253
|
+
if ((rootNode instanceof Document || rootNode instanceof ShadowRoot) && rootNode.activeElement === el && el.type !== "range") {
|
|
14147
14254
|
if (lazy && value === oldValue) {
|
|
14148
14255
|
return;
|
|
14149
14256
|
}
|