@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
|
**/
|
|
@@ -1208,10 +1208,17 @@ var Vue = (function () {
|
|
|
1208
1208
|
}
|
|
1209
1209
|
function reduce(self, method, fn, args) {
|
|
1210
1210
|
const arr = shallowReadArray(self);
|
|
1211
|
+
const needsWrap = arr !== self && !isShallow(self);
|
|
1211
1212
|
let wrappedFn = fn;
|
|
1213
|
+
let wrapInitialAccumulator = false;
|
|
1212
1214
|
if (arr !== self) {
|
|
1213
|
-
if (
|
|
1215
|
+
if (needsWrap) {
|
|
1216
|
+
wrapInitialAccumulator = args.length === 0;
|
|
1214
1217
|
wrappedFn = function(acc, item, index) {
|
|
1218
|
+
if (wrapInitialAccumulator) {
|
|
1219
|
+
wrapInitialAccumulator = false;
|
|
1220
|
+
acc = toWrapped(self, acc);
|
|
1221
|
+
}
|
|
1215
1222
|
return fn.call(this, acc, toWrapped(self, item), index, self);
|
|
1216
1223
|
};
|
|
1217
1224
|
} else if (fn.length > 3) {
|
|
@@ -1220,7 +1227,8 @@ var Vue = (function () {
|
|
|
1220
1227
|
};
|
|
1221
1228
|
}
|
|
1222
1229
|
}
|
|
1223
|
-
|
|
1230
|
+
const result = arr[method](wrappedFn, ...args);
|
|
1231
|
+
return wrapInitialAccumulator ? toWrapped(self, result) : result;
|
|
1224
1232
|
}
|
|
1225
1233
|
function searchProxy(self, method, args) {
|
|
1226
1234
|
const arr = toRaw(self);
|
|
@@ -1510,15 +1518,14 @@ var Vue = (function () {
|
|
|
1510
1518
|
clear: createReadonlyMethod("clear")
|
|
1511
1519
|
} : {
|
|
1512
1520
|
add(value) {
|
|
1513
|
-
if (!shallow && !isShallow(value) && !isReadonly(value)) {
|
|
1514
|
-
value = toRaw(value);
|
|
1515
|
-
}
|
|
1516
1521
|
const target = toRaw(this);
|
|
1517
1522
|
const proto = getProto(target);
|
|
1518
|
-
const
|
|
1523
|
+
const rawValue = toRaw(value);
|
|
1524
|
+
const valueToAdd = !shallow && !isShallow(value) && !isReadonly(value) ? rawValue : value;
|
|
1525
|
+
const hadKey = proto.has.call(target, valueToAdd) || hasChanged(value, valueToAdd) && proto.has.call(target, value) || hasChanged(rawValue, valueToAdd) && proto.has.call(target, rawValue);
|
|
1519
1526
|
if (!hadKey) {
|
|
1520
|
-
target.add(
|
|
1521
|
-
trigger(target, "add",
|
|
1527
|
+
target.add(valueToAdd);
|
|
1528
|
+
trigger(target, "add", valueToAdd, valueToAdd);
|
|
1522
1529
|
}
|
|
1523
1530
|
return this;
|
|
1524
1531
|
},
|
|
@@ -1875,16 +1882,16 @@ var Vue = (function () {
|
|
|
1875
1882
|
return ret;
|
|
1876
1883
|
}
|
|
1877
1884
|
class ObjectRefImpl {
|
|
1878
|
-
constructor(_object,
|
|
1885
|
+
constructor(_object, key, _defaultValue) {
|
|
1879
1886
|
this._object = _object;
|
|
1880
|
-
this._key = _key;
|
|
1881
1887
|
this._defaultValue = _defaultValue;
|
|
1882
1888
|
this["__v_isRef"] = true;
|
|
1883
1889
|
this._value = void 0;
|
|
1890
|
+
this._key = isSymbol(key) ? key : String(key);
|
|
1884
1891
|
this._raw = toRaw(_object);
|
|
1885
1892
|
let shallow = true;
|
|
1886
1893
|
let obj = _object;
|
|
1887
|
-
if (!isArray(_object) || !isIntegerKey(
|
|
1894
|
+
if (!isArray(_object) || isSymbol(this._key) || !isIntegerKey(this._key)) {
|
|
1888
1895
|
do {
|
|
1889
1896
|
shallow = !isProxy(obj) || isShallow(obj);
|
|
1890
1897
|
} while (shallow && (obj = obj["__v_raw"]));
|
|
@@ -2684,6 +2691,13 @@ var Vue = (function () {
|
|
|
2684
2691
|
}
|
|
2685
2692
|
|
|
2686
2693
|
let isHmrUpdating = false;
|
|
2694
|
+
const setHmrUpdating = (v) => {
|
|
2695
|
+
try {
|
|
2696
|
+
return isHmrUpdating;
|
|
2697
|
+
} finally {
|
|
2698
|
+
isHmrUpdating = v;
|
|
2699
|
+
}
|
|
2700
|
+
};
|
|
2687
2701
|
const hmrDirtyComponents = /* @__PURE__ */ new Map();
|
|
2688
2702
|
{
|
|
2689
2703
|
getGlobalThis().__VUE_HMR_RUNTIME__ = {
|
|
@@ -3711,9 +3725,10 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
|
|
|
3711
3725
|
mount(container, mainAnchor);
|
|
3712
3726
|
updateCssVars(n2, true);
|
|
3713
3727
|
}
|
|
3714
|
-
if (isTeleportDeferred(n2.props)) {
|
|
3728
|
+
if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
|
|
3715
3729
|
n2.el.__isMounted = false;
|
|
3716
3730
|
queuePostRenderEffect(() => {
|
|
3731
|
+
if (n2.el.__isMounted !== false) return;
|
|
3717
3732
|
mountToTarget();
|
|
3718
3733
|
delete n2.el.__isMounted;
|
|
3719
3734
|
}, parentSuspense);
|
|
@@ -3721,7 +3736,12 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
|
|
|
3721
3736
|
mountToTarget();
|
|
3722
3737
|
}
|
|
3723
3738
|
} else {
|
|
3724
|
-
|
|
3739
|
+
n2.el = n1.el;
|
|
3740
|
+
n2.targetStart = n1.targetStart;
|
|
3741
|
+
const mainAnchor = n2.anchor = n1.anchor;
|
|
3742
|
+
const target = n2.target = n1.target;
|
|
3743
|
+
const targetAnchor = n2.targetAnchor = n1.targetAnchor;
|
|
3744
|
+
if (n1.el.__isMounted === false) {
|
|
3725
3745
|
queuePostRenderEffect(() => {
|
|
3726
3746
|
TeleportImpl.process(
|
|
3727
3747
|
n1,
|
|
@@ -3738,11 +3758,6 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
|
|
|
3738
3758
|
}, parentSuspense);
|
|
3739
3759
|
return;
|
|
3740
3760
|
}
|
|
3741
|
-
n2.el = n1.el;
|
|
3742
|
-
n2.targetStart = n1.targetStart;
|
|
3743
|
-
const mainAnchor = n2.anchor = n1.anchor;
|
|
3744
|
-
const target = n2.target = n1.target;
|
|
3745
|
-
const targetAnchor = n2.targetAnchor = n1.targetAnchor;
|
|
3746
3761
|
const wasDisabled = isTeleportDisabled(n1.props);
|
|
3747
3762
|
const currentContainer = wasDisabled ? container : target;
|
|
3748
3763
|
const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
|
|
@@ -4208,7 +4223,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
|
|
|
4208
4223
|
callHook(hook, [el]);
|
|
4209
4224
|
},
|
|
4210
4225
|
enter(el) {
|
|
4211
|
-
if (leavingVNodesCache[key] === vnode) return;
|
|
4226
|
+
if (!isHmrUpdating && leavingVNodesCache[key] === vnode) return;
|
|
4212
4227
|
let hook = onEnter;
|
|
4213
4228
|
let afterHook = onAfterEnter;
|
|
4214
4229
|
let cancelHook = onEnterCancelled;
|
|
@@ -6130,12 +6145,16 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
6130
6145
|
);
|
|
6131
6146
|
}
|
|
6132
6147
|
} else if (typeof source === "number") {
|
|
6133
|
-
if (!Number.isInteger(source)) {
|
|
6134
|
-
warn$1(
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6148
|
+
if (!Number.isInteger(source) || source < 0) {
|
|
6149
|
+
warn$1(
|
|
6150
|
+
`The v-for range expects a positive integer value but got ${source}.`
|
|
6151
|
+
);
|
|
6152
|
+
ret = [];
|
|
6153
|
+
} else {
|
|
6154
|
+
ret = new Array(source);
|
|
6155
|
+
for (let i = 0; i < source; i++) {
|
|
6156
|
+
ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
|
|
6157
|
+
}
|
|
6139
6158
|
}
|
|
6140
6159
|
} else if (isObject(source)) {
|
|
6141
6160
|
if (source[Symbol.iterator]) {
|
|
@@ -6838,6 +6857,7 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
6838
6857
|
}
|
|
6839
6858
|
function withAsyncContext(getAwaitable) {
|
|
6840
6859
|
const ctx = getCurrentInstance();
|
|
6860
|
+
const inSSRSetup = isInSSRComponentSetup;
|
|
6841
6861
|
if (!ctx) {
|
|
6842
6862
|
warn$1(
|
|
6843
6863
|
`withAsyncContext called without active current instance. This is likely a bug.`
|
|
@@ -6845,13 +6865,25 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
6845
6865
|
}
|
|
6846
6866
|
let awaitable = getAwaitable();
|
|
6847
6867
|
unsetCurrentInstance();
|
|
6868
|
+
if (inSSRSetup) {
|
|
6869
|
+
setInSSRSetupState(false);
|
|
6870
|
+
}
|
|
6871
|
+
const restore = () => {
|
|
6872
|
+
setCurrentInstance(ctx);
|
|
6873
|
+
if (inSSRSetup) {
|
|
6874
|
+
setInSSRSetupState(true);
|
|
6875
|
+
}
|
|
6876
|
+
};
|
|
6848
6877
|
const cleanup = () => {
|
|
6849
6878
|
if (getCurrentInstance() !== ctx) ctx.scope.off();
|
|
6850
6879
|
unsetCurrentInstance();
|
|
6880
|
+
if (inSSRSetup) {
|
|
6881
|
+
setInSSRSetupState(false);
|
|
6882
|
+
}
|
|
6851
6883
|
};
|
|
6852
6884
|
if (isPromise(awaitable)) {
|
|
6853
6885
|
awaitable = awaitable.catch((e) => {
|
|
6854
|
-
|
|
6886
|
+
restore();
|
|
6855
6887
|
Promise.resolve().then(() => Promise.resolve().then(cleanup));
|
|
6856
6888
|
throw e;
|
|
6857
6889
|
});
|
|
@@ -6859,7 +6891,7 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
6859
6891
|
return [
|
|
6860
6892
|
awaitable,
|
|
6861
6893
|
() => {
|
|
6862
|
-
|
|
6894
|
+
restore();
|
|
6863
6895
|
Promise.resolve().then(cleanup);
|
|
6864
6896
|
}
|
|
6865
6897
|
];
|
|
@@ -7380,7 +7412,7 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
7380
7412
|
return vm;
|
|
7381
7413
|
}
|
|
7382
7414
|
}
|
|
7383
|
-
Vue.version = `2.6.14-compat:${"3.5.
|
|
7415
|
+
Vue.version = `2.6.14-compat:${"3.5.31"}`;
|
|
7384
7416
|
Vue.config = singletonApp.config;
|
|
7385
7417
|
Vue.use = (plugin, ...options) => {
|
|
7386
7418
|
if (plugin && isFunction(plugin.install)) {
|
|
@@ -8539,11 +8571,12 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
8539
8571
|
}
|
|
8540
8572
|
return nextProp !== prevProp;
|
|
8541
8573
|
}
|
|
8542
|
-
function updateHOCHostEl({ vnode, parent }, el) {
|
|
8574
|
+
function updateHOCHostEl({ vnode, parent, suspense }, el) {
|
|
8543
8575
|
while (parent) {
|
|
8544
8576
|
const root = parent.subTree;
|
|
8545
8577
|
if (root.suspense && root.suspense.activeBranch === vnode) {
|
|
8546
|
-
root.el =
|
|
8578
|
+
root.suspense.vnode.el = root.el = el;
|
|
8579
|
+
vnode = root;
|
|
8547
8580
|
}
|
|
8548
8581
|
if (root === vnode) {
|
|
8549
8582
|
(vnode = parent.vnode).el = el;
|
|
@@ -8552,6 +8585,9 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
8552
8585
|
break;
|
|
8553
8586
|
}
|
|
8554
8587
|
}
|
|
8588
|
+
if (suspense && suspense.activeBranch === vnode) {
|
|
8589
|
+
suspense.vnode.el = el;
|
|
8590
|
+
}
|
|
8555
8591
|
}
|
|
8556
8592
|
|
|
8557
8593
|
function createPropsDefaultThis(instance, rawProps, propKey) {
|
|
@@ -9465,10 +9501,17 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
9465
9501
|
}
|
|
9466
9502
|
hostInsert(el, container, anchor);
|
|
9467
9503
|
if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
|
|
9504
|
+
const isHmr = isHmrUpdating;
|
|
9468
9505
|
queuePostRenderEffect(() => {
|
|
9469
|
-
|
|
9470
|
-
|
|
9471
|
-
|
|
9506
|
+
let prev;
|
|
9507
|
+
prev = setHmrUpdating(isHmr);
|
|
9508
|
+
try {
|
|
9509
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
9510
|
+
needCallTransitionHooks && transition.enter(el);
|
|
9511
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
9512
|
+
} finally {
|
|
9513
|
+
setHmrUpdating(prev);
|
|
9514
|
+
}
|
|
9472
9515
|
}, parentSuspense);
|
|
9473
9516
|
}
|
|
9474
9517
|
};
|
|
@@ -9877,7 +9920,10 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
9877
9920
|
}
|
|
9878
9921
|
} else {
|
|
9879
9922
|
if (root.ce && root.ce._hasShadowRoot()) {
|
|
9880
|
-
root.ce._injectChildStyle(
|
|
9923
|
+
root.ce._injectChildStyle(
|
|
9924
|
+
type,
|
|
9925
|
+
instance.parent ? instance.parent.type : void 0
|
|
9926
|
+
);
|
|
9881
9927
|
}
|
|
9882
9928
|
{
|
|
9883
9929
|
startMeasure(instance, `render`);
|
|
@@ -10411,7 +10457,8 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
10411
10457
|
shapeFlag,
|
|
10412
10458
|
patchFlag,
|
|
10413
10459
|
dirs,
|
|
10414
|
-
cacheIndex
|
|
10460
|
+
cacheIndex,
|
|
10461
|
+
memo
|
|
10415
10462
|
} = vnode;
|
|
10416
10463
|
if (patchFlag === -2) {
|
|
10417
10464
|
optimized = false;
|
|
@@ -10473,10 +10520,14 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
10473
10520
|
remove(vnode);
|
|
10474
10521
|
}
|
|
10475
10522
|
}
|
|
10476
|
-
|
|
10523
|
+
const shouldInvalidateMemo = memo != null && cacheIndex == null;
|
|
10524
|
+
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs || shouldInvalidateMemo) {
|
|
10477
10525
|
queuePostRenderEffect(() => {
|
|
10478
10526
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
10479
10527
|
shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
10528
|
+
if (shouldInvalidateMemo) {
|
|
10529
|
+
vnode.el = null;
|
|
10530
|
+
}
|
|
10480
10531
|
}, parentSuspense);
|
|
10481
10532
|
}
|
|
10482
10533
|
};
|
|
@@ -11039,6 +11090,7 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
11039
11090
|
pendingId: suspenseId++,
|
|
11040
11091
|
timeout: typeof timeout === "number" ? timeout : -1,
|
|
11041
11092
|
activeBranch: null,
|
|
11093
|
+
isFallbackMountPending: false,
|
|
11042
11094
|
pendingBranch: null,
|
|
11043
11095
|
isInFallback: !isHydrating,
|
|
11044
11096
|
isHydrating,
|
|
@@ -11088,7 +11140,7 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
11088
11140
|
}
|
|
11089
11141
|
};
|
|
11090
11142
|
}
|
|
11091
|
-
if (activeBranch) {
|
|
11143
|
+
if (activeBranch && !suspense.isFallbackMountPending) {
|
|
11092
11144
|
if (parentNode(activeBranch.el) === container2) {
|
|
11093
11145
|
anchor = next(activeBranch);
|
|
11094
11146
|
}
|
|
@@ -11101,6 +11153,7 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
11101
11153
|
move(pendingBranch, container2, anchor, 0);
|
|
11102
11154
|
}
|
|
11103
11155
|
}
|
|
11156
|
+
suspense.isFallbackMountPending = false;
|
|
11104
11157
|
setActiveBranch(suspense, pendingBranch);
|
|
11105
11158
|
suspense.pendingBranch = null;
|
|
11106
11159
|
suspense.isInFallback = false;
|
|
@@ -11136,6 +11189,7 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
11136
11189
|
triggerEvent(vnode2, "onFallback");
|
|
11137
11190
|
const anchor2 = next(activeBranch);
|
|
11138
11191
|
const mountFallback = () => {
|
|
11192
|
+
suspense.isFallbackMountPending = false;
|
|
11139
11193
|
if (!suspense.isInFallback) {
|
|
11140
11194
|
return;
|
|
11141
11195
|
}
|
|
@@ -11155,6 +11209,7 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
11155
11209
|
};
|
|
11156
11210
|
const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
|
|
11157
11211
|
if (delayEnter) {
|
|
11212
|
+
suspense.isFallbackMountPending = true;
|
|
11158
11213
|
activeBranch.transition.afterLeave = mountFallback;
|
|
11159
11214
|
}
|
|
11160
11215
|
suspense.isInFallback = true;
|
|
@@ -11772,6 +11827,10 @@ Component that was made reactive: `,
|
|
|
11772
11827
|
const incoming = toMerge[key];
|
|
11773
11828
|
if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
|
|
11774
11829
|
ret[key] = existing ? [].concat(existing, incoming) : incoming;
|
|
11830
|
+
} else if (incoming == null && existing == null && // mergeProps({ 'onUpdate:modelValue': undefined }) should not retain
|
|
11831
|
+
// the model listener.
|
|
11832
|
+
!isModelListener(key)) {
|
|
11833
|
+
ret[key] = incoming;
|
|
11775
11834
|
}
|
|
11776
11835
|
} else if (key !== "") {
|
|
11777
11836
|
ret[key] = toMerge[key];
|
|
@@ -12454,7 +12513,7 @@ Component that was made reactive: `,
|
|
|
12454
12513
|
return true;
|
|
12455
12514
|
}
|
|
12456
12515
|
|
|
12457
|
-
const version = "3.5.
|
|
12516
|
+
const version = "3.5.31";
|
|
12458
12517
|
const warn = warn$1 ;
|
|
12459
12518
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
12460
12519
|
const devtools = devtools$1 ;
|
|
@@ -13320,7 +13379,9 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
13320
13379
|
}
|
|
13321
13380
|
} else if (
|
|
13322
13381
|
// #11081 force set props for possible async custom element
|
|
13323
|
-
el._isVueCE &&
|
|
13382
|
+
el._isVueCE && // #12408 check if it's declared prop or it's async custom element
|
|
13383
|
+
(shouldSetAsPropForVueCE(el, key) || // @ts-expect-error _def is private
|
|
13384
|
+
el._def.__asyncLoader && (/[A-Z]/.test(key) || !isString(nextValue)))
|
|
13324
13385
|
) {
|
|
13325
13386
|
patchDOMProp(el, camelize(key), nextValue, parentComponent, key);
|
|
13326
13387
|
} else {
|
|
@@ -13368,6 +13429,17 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
13368
13429
|
}
|
|
13369
13430
|
return key in el;
|
|
13370
13431
|
}
|
|
13432
|
+
function shouldSetAsPropForVueCE(el, key) {
|
|
13433
|
+
const props = (
|
|
13434
|
+
// @ts-expect-error _def is private
|
|
13435
|
+
el._def.props
|
|
13436
|
+
);
|
|
13437
|
+
if (!props) {
|
|
13438
|
+
return false;
|
|
13439
|
+
}
|
|
13440
|
+
const camelKey = camelize(key);
|
|
13441
|
+
return Array.isArray(props) ? props.some((prop) => camelize(prop) === camelKey) : Object.keys(props).some((prop) => camelize(prop) === camelKey);
|
|
13442
|
+
}
|
|
13371
13443
|
|
|
13372
13444
|
const REMOVAL = {};
|
|
13373
13445
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -13412,6 +13484,7 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
13412
13484
|
this._dirty = false;
|
|
13413
13485
|
this._numberProps = null;
|
|
13414
13486
|
this._styleChildren = /* @__PURE__ */ new WeakSet();
|
|
13487
|
+
this._styleAnchors = /* @__PURE__ */ new WeakMap();
|
|
13415
13488
|
this._ob = null;
|
|
13416
13489
|
if (this.shadowRoot && _createApp !== createApp) {
|
|
13417
13490
|
this._root = this.shadowRoot;
|
|
@@ -13440,7 +13513,8 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
13440
13513
|
}
|
|
13441
13514
|
this._connected = true;
|
|
13442
13515
|
let parent = this;
|
|
13443
|
-
while (parent = parent &&
|
|
13516
|
+
while (parent = parent && // #12479 should check assignedSlot first to get correct parent
|
|
13517
|
+
(parent.assignedSlot || parent.parentNode || parent.host)) {
|
|
13444
13518
|
if (parent instanceof VueElement) {
|
|
13445
13519
|
this._parent = parent;
|
|
13446
13520
|
break;
|
|
@@ -13662,6 +13736,7 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
13662
13736
|
this._styles.forEach((s) => this._root.removeChild(s));
|
|
13663
13737
|
this._styles.length = 0;
|
|
13664
13738
|
}
|
|
13739
|
+
this._styleAnchors.delete(this._def);
|
|
13665
13740
|
this._applyStyles(newStyles);
|
|
13666
13741
|
this._instance = null;
|
|
13667
13742
|
this._update();
|
|
@@ -13686,7 +13761,7 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
13686
13761
|
}
|
|
13687
13762
|
return vnode;
|
|
13688
13763
|
}
|
|
13689
|
-
_applyStyles(styles, owner) {
|
|
13764
|
+
_applyStyles(styles, owner, parentComp) {
|
|
13690
13765
|
if (!styles) return;
|
|
13691
13766
|
if (owner) {
|
|
13692
13767
|
if (owner === this._def || this._styleChildren.has(owner)) {
|
|
@@ -13695,11 +13770,19 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
13695
13770
|
this._styleChildren.add(owner);
|
|
13696
13771
|
}
|
|
13697
13772
|
const nonce = this._nonce;
|
|
13773
|
+
const root = this.shadowRoot;
|
|
13774
|
+
const insertionAnchor = parentComp ? this._getStyleAnchor(parentComp) || this._getStyleAnchor(this._def) : this._getRootStyleInsertionAnchor(root);
|
|
13775
|
+
let last = null;
|
|
13698
13776
|
for (let i = styles.length - 1; i >= 0; i--) {
|
|
13699
13777
|
const s = document.createElement("style");
|
|
13700
13778
|
if (nonce) s.setAttribute("nonce", nonce);
|
|
13701
13779
|
s.textContent = styles[i];
|
|
13702
|
-
|
|
13780
|
+
root.insertBefore(s, last || insertionAnchor);
|
|
13781
|
+
last = s;
|
|
13782
|
+
if (i === 0) {
|
|
13783
|
+
if (!parentComp) this._styleAnchors.set(this._def, s);
|
|
13784
|
+
if (owner) this._styleAnchors.set(owner, s);
|
|
13785
|
+
}
|
|
13703
13786
|
{
|
|
13704
13787
|
if (owner) {
|
|
13705
13788
|
if (owner.__hmrId) {
|
|
@@ -13716,6 +13799,28 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
13716
13799
|
}
|
|
13717
13800
|
}
|
|
13718
13801
|
}
|
|
13802
|
+
_getStyleAnchor(comp) {
|
|
13803
|
+
if (!comp) {
|
|
13804
|
+
return null;
|
|
13805
|
+
}
|
|
13806
|
+
const anchor = this._styleAnchors.get(comp);
|
|
13807
|
+
if (anchor && anchor.parentNode === this.shadowRoot) {
|
|
13808
|
+
return anchor;
|
|
13809
|
+
}
|
|
13810
|
+
if (anchor) {
|
|
13811
|
+
this._styleAnchors.delete(comp);
|
|
13812
|
+
}
|
|
13813
|
+
return null;
|
|
13814
|
+
}
|
|
13815
|
+
_getRootStyleInsertionAnchor(root) {
|
|
13816
|
+
for (let i = 0; i < root.childNodes.length; i++) {
|
|
13817
|
+
const node = root.childNodes[i];
|
|
13818
|
+
if (!(node instanceof HTMLStyleElement)) {
|
|
13819
|
+
return node;
|
|
13820
|
+
}
|
|
13821
|
+
}
|
|
13822
|
+
return null;
|
|
13823
|
+
}
|
|
13719
13824
|
/**
|
|
13720
13825
|
* Only called when shadowRoot is false
|
|
13721
13826
|
*/
|
|
@@ -13778,8 +13883,8 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
13778
13883
|
/**
|
|
13779
13884
|
* @internal
|
|
13780
13885
|
*/
|
|
13781
|
-
_injectChildStyle(comp) {
|
|
13782
|
-
this._applyStyles(comp.styles, comp);
|
|
13886
|
+
_injectChildStyle(comp, parentComp) {
|
|
13887
|
+
this._applyStyles(comp.styles, comp, parentComp);
|
|
13783
13888
|
}
|
|
13784
13889
|
/**
|
|
13785
13890
|
* @internal
|
|
@@ -13809,6 +13914,7 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
13809
13914
|
_removeChildStyle(comp) {
|
|
13810
13915
|
{
|
|
13811
13916
|
this._styleChildren.delete(comp);
|
|
13917
|
+
this._styleAnchors.delete(comp);
|
|
13812
13918
|
if (this._childStyles && comp.__hmrId) {
|
|
13813
13919
|
const oldStyles = this._childStyles.get(comp.__hmrId);
|
|
13814
13920
|
if (oldStyles) {
|
|
@@ -14064,7 +14170,8 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
14064
14170
|
if (elValue === newValue) {
|
|
14065
14171
|
return;
|
|
14066
14172
|
}
|
|
14067
|
-
|
|
14173
|
+
const rootNode = el.getRootNode();
|
|
14174
|
+
if ((rootNode instanceof Document || rootNode instanceof ShadowRoot) && rootNode.activeElement === el && el.type !== "range") {
|
|
14068
14175
|
if (lazy && value === oldValue) {
|
|
14069
14176
|
return;
|
|
14070
14177
|
}
|