@vue/runtime-dom 3.5.41 → 3.5.42
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/runtime-dom.cjs.js +36 -10
- package/dist/runtime-dom.cjs.prod.js +36 -10
- package/dist/runtime-dom.d.ts +1 -1
- package/dist/runtime-dom.esm-browser.js +106 -20
- package/dist/runtime-dom.esm-browser.prod.js +4 -4
- package/dist/runtime-dom.esm-bundler.js +36 -10
- package/dist/runtime-dom.global.js +106 -20
- package/dist/runtime-dom.global.prod.js +4 -4
- package/package.json +4 -4
package/dist/runtime-dom.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.5.
|
|
2
|
+
* @vue/runtime-dom v3.5.42
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -517,7 +517,11 @@ function setStyle(style, name, val) {
|
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
519
|
if (name.startsWith("--")) {
|
|
520
|
-
|
|
520
|
+
if (importantRE.test(val)) {
|
|
521
|
+
style.setProperty(name, val.replace(importantRE, ""), "important");
|
|
522
|
+
} else {
|
|
523
|
+
style.setProperty(name, val);
|
|
524
|
+
}
|
|
521
525
|
} else {
|
|
522
526
|
const prefixed = autoPrefix(style, name);
|
|
523
527
|
if (importantRE.test(val)) {
|
|
@@ -1651,13 +1655,21 @@ const vModelSelect = {
|
|
|
1651
1655
|
const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
|
|
1652
1656
|
(o) => number ? shared.looseToNumber(getValue(o)) : getValue(o)
|
|
1653
1657
|
);
|
|
1654
|
-
el
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1658
|
+
const multiple = el.multiple;
|
|
1659
|
+
const assignedValue = multiple ? shared.isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0];
|
|
1660
|
+
const pending = el._pendingValue = [
|
|
1661
|
+
multiple,
|
|
1662
|
+
multiple ? shared.isArray(assignedValue) ? selectedVal.slice() : selectedVal : assignedValue
|
|
1663
|
+
];
|
|
1664
|
+
try {
|
|
1665
|
+
el[assignKey](assignedValue);
|
|
1666
|
+
} finally {
|
|
1667
|
+
runtimeCore.nextTick(() => {
|
|
1668
|
+
if (el._pendingValue === pending) {
|
|
1669
|
+
el._pendingValue = void 0;
|
|
1670
|
+
}
|
|
1671
|
+
});
|
|
1672
|
+
}
|
|
1661
1673
|
});
|
|
1662
1674
|
el[assignKey] = getModelAssigner(vnode);
|
|
1663
1675
|
},
|
|
@@ -1671,11 +1683,25 @@ const vModelSelect = {
|
|
|
1671
1683
|
el[assignKey] = getModelAssigner(vnode);
|
|
1672
1684
|
},
|
|
1673
1685
|
updated(el, { value }) {
|
|
1674
|
-
|
|
1686
|
+
const pending = el._pendingValue;
|
|
1687
|
+
el._pendingValue = void 0;
|
|
1688
|
+
if (!pending || pending[0] !== el.multiple || !isSameSelectValue(value, pending[1], pending[0])) {
|
|
1675
1689
|
setSelected(el, value);
|
|
1676
1690
|
}
|
|
1677
1691
|
}
|
|
1678
1692
|
};
|
|
1693
|
+
function isSameSelectValue(value, assignedValue, multiple) {
|
|
1694
|
+
if (!multiple) return shared.looseEqual(value, assignedValue);
|
|
1695
|
+
if (shared.isArray(value)) return shared.looseEqual(value, assignedValue);
|
|
1696
|
+
if (shared.isSet(value)) {
|
|
1697
|
+
if (value.size !== assignedValue.length) return false;
|
|
1698
|
+
for (const item of assignedValue) {
|
|
1699
|
+
if (!value.has(item)) return false;
|
|
1700
|
+
}
|
|
1701
|
+
return true;
|
|
1702
|
+
}
|
|
1703
|
+
return false;
|
|
1704
|
+
}
|
|
1679
1705
|
function setSelected(el, value) {
|
|
1680
1706
|
const isMultiple = el.multiple;
|
|
1681
1707
|
const isArrayValue = shared.isArray(value);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.5.
|
|
2
|
+
* @vue/runtime-dom v3.5.42
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -505,7 +505,11 @@ function setStyle(style, name, val) {
|
|
|
505
505
|
} else {
|
|
506
506
|
if (val == null) val = "";
|
|
507
507
|
if (name.startsWith("--")) {
|
|
508
|
-
|
|
508
|
+
if (importantRE.test(val)) {
|
|
509
|
+
style.setProperty(name, val.replace(importantRE, ""), "important");
|
|
510
|
+
} else {
|
|
511
|
+
style.setProperty(name, val);
|
|
512
|
+
}
|
|
509
513
|
} else {
|
|
510
514
|
const prefixed = autoPrefix(style, name);
|
|
511
515
|
if (importantRE.test(val)) {
|
|
@@ -1552,13 +1556,21 @@ const vModelSelect = {
|
|
|
1552
1556
|
const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
|
|
1553
1557
|
(o) => number ? shared.looseToNumber(getValue(o)) : getValue(o)
|
|
1554
1558
|
);
|
|
1555
|
-
el
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1559
|
+
const multiple = el.multiple;
|
|
1560
|
+
const assignedValue = multiple ? shared.isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0];
|
|
1561
|
+
const pending = el._pendingValue = [
|
|
1562
|
+
multiple,
|
|
1563
|
+
multiple ? shared.isArray(assignedValue) ? selectedVal.slice() : selectedVal : assignedValue
|
|
1564
|
+
];
|
|
1565
|
+
try {
|
|
1566
|
+
el[assignKey](assignedValue);
|
|
1567
|
+
} finally {
|
|
1568
|
+
runtimeCore.nextTick(() => {
|
|
1569
|
+
if (el._pendingValue === pending) {
|
|
1570
|
+
el._pendingValue = void 0;
|
|
1571
|
+
}
|
|
1572
|
+
});
|
|
1573
|
+
}
|
|
1562
1574
|
});
|
|
1563
1575
|
el[assignKey] = getModelAssigner(vnode);
|
|
1564
1576
|
},
|
|
@@ -1572,11 +1584,25 @@ const vModelSelect = {
|
|
|
1572
1584
|
el[assignKey] = getModelAssigner(vnode);
|
|
1573
1585
|
},
|
|
1574
1586
|
updated(el, { value }) {
|
|
1575
|
-
|
|
1587
|
+
const pending = el._pendingValue;
|
|
1588
|
+
el._pendingValue = void 0;
|
|
1589
|
+
if (!pending || pending[0] !== el.multiple || !isSameSelectValue(value, pending[1], pending[0])) {
|
|
1576
1590
|
setSelected(el, value);
|
|
1577
1591
|
}
|
|
1578
1592
|
}
|
|
1579
1593
|
};
|
|
1594
|
+
function isSameSelectValue(value, assignedValue, multiple) {
|
|
1595
|
+
if (!multiple) return shared.looseEqual(value, assignedValue);
|
|
1596
|
+
if (shared.isArray(value)) return shared.looseEqual(value, assignedValue);
|
|
1597
|
+
if (shared.isSet(value)) {
|
|
1598
|
+
if (value.size !== assignedValue.length) return false;
|
|
1599
|
+
for (const item of assignedValue) {
|
|
1600
|
+
if (!value.has(item)) return false;
|
|
1601
|
+
}
|
|
1602
|
+
return true;
|
|
1603
|
+
}
|
|
1604
|
+
return false;
|
|
1605
|
+
}
|
|
1580
1606
|
function setSelected(el, value) {
|
|
1581
1607
|
const isMultiple = el.multiple;
|
|
1582
1608
|
const isArrayValue = shared.isArray(value);
|
package/dist/runtime-dom.d.ts
CHANGED
|
@@ -84,7 +84,7 @@ declare const initialValueKey: unique symbol;
|
|
|
84
84
|
type ModelDirective<T, Modifiers extends string = string> = ObjectDirective<T & {
|
|
85
85
|
[assignKey]: AssignerFn;
|
|
86
86
|
[initialValueKey]?: string;
|
|
87
|
-
|
|
87
|
+
_pendingValue?: [multiple: boolean, value: any];
|
|
88
88
|
}, any, Modifiers>;
|
|
89
89
|
export declare const vModelText: ModelDirective<HTMLInputElement | HTMLTextAreaElement, 'trim' | 'number' | 'lazy'>;
|
|
90
90
|
export declare const vModelCheckbox: ModelDirective<HTMLInputElement>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.5.
|
|
2
|
+
* @vue/runtime-dom v3.5.42
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -229,6 +229,23 @@ function looseCompareArrays(a, b) {
|
|
|
229
229
|
}
|
|
230
230
|
return equal;
|
|
231
231
|
}
|
|
232
|
+
function looseCompareCollections(a, b) {
|
|
233
|
+
if (a.size !== b.size) return false;
|
|
234
|
+
const candidates = Array.from(b);
|
|
235
|
+
const matched = new Uint8Array(candidates.length);
|
|
236
|
+
for (const item of a) {
|
|
237
|
+
let index = -1;
|
|
238
|
+
for (let i = 0; i < candidates.length; i++) {
|
|
239
|
+
if (!matched[i] && looseEqual(item, candidates[i])) {
|
|
240
|
+
index = i;
|
|
241
|
+
break;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
if (index < 0) return false;
|
|
245
|
+
matched[index] = 1;
|
|
246
|
+
}
|
|
247
|
+
return true;
|
|
248
|
+
}
|
|
232
249
|
function looseEqual(a, b) {
|
|
233
250
|
if (a === b) return true;
|
|
234
251
|
let aValidType = isDate(a);
|
|
@@ -252,6 +269,16 @@ function looseEqual(a, b) {
|
|
|
252
269
|
if (!aValidType || !bValidType) {
|
|
253
270
|
return false;
|
|
254
271
|
}
|
|
272
|
+
aValidType = isMap(a);
|
|
273
|
+
bValidType = isMap(b);
|
|
274
|
+
if (aValidType || bValidType) {
|
|
275
|
+
return aValidType && bValidType ? looseCompareCollections(a, b) : false;
|
|
276
|
+
}
|
|
277
|
+
aValidType = isSet(a);
|
|
278
|
+
bValidType = isSet(b);
|
|
279
|
+
if (aValidType || bValidType) {
|
|
280
|
+
return aValidType && bValidType ? looseCompareCollections(a, b) : false;
|
|
281
|
+
}
|
|
255
282
|
const aKeysCount = Object.keys(a).length;
|
|
256
283
|
const bKeysCount = Object.keys(b).length;
|
|
257
284
|
if (aKeysCount !== bKeysCount) {
|
|
@@ -4333,10 +4360,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4333
4360
|
getContainerType(container),
|
|
4334
4361
|
optimized
|
|
4335
4362
|
);
|
|
4336
|
-
if (isAsyncWrapper(vnode) && !vnode.
|
|
4363
|
+
if (isAsyncWrapper(vnode) && !vnode.component.subTree) {
|
|
4337
4364
|
let subTree;
|
|
4338
4365
|
if (isFragmentStart) {
|
|
4339
|
-
subTree = createVNode(
|
|
4366
|
+
subTree = createVNode(Static);
|
|
4340
4367
|
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
4341
4368
|
} else {
|
|
4342
4369
|
subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
@@ -5245,7 +5272,10 @@ const KeepAliveImpl = {
|
|
|
5245
5272
|
if (pendingCacheKey != null) {
|
|
5246
5273
|
if (isSuspense(instance.subTree.type)) {
|
|
5247
5274
|
queuePostRenderEffect(() => {
|
|
5248
|
-
|
|
5275
|
+
const vnode = getInnerChild(instance.subTree);
|
|
5276
|
+
if (vnode.component) {
|
|
5277
|
+
cache.set(pendingCacheKey, vnode);
|
|
5278
|
+
}
|
|
5249
5279
|
}, instance.subTree.suspense);
|
|
5250
5280
|
} else {
|
|
5251
5281
|
cache.set(pendingCacheKey, getInnerChild(instance.subTree));
|
|
@@ -5646,12 +5676,41 @@ const getPublicInstance = (i) => {
|
|
|
5646
5676
|
if (isStatefulComponent(i)) return getComponentPublicInstance(i);
|
|
5647
5677
|
return getPublicInstance(i.parent);
|
|
5648
5678
|
};
|
|
5679
|
+
const resolveDevRootEl = (vnode) => {
|
|
5680
|
+
let found = false;
|
|
5681
|
+
while (true) {
|
|
5682
|
+
if (vnode.patchFlag > 0 && vnode.patchFlag & 2048) {
|
|
5683
|
+
const root = filterSingleRoot(vnode.children);
|
|
5684
|
+
if (!root) {
|
|
5685
|
+
return;
|
|
5686
|
+
}
|
|
5687
|
+
vnode = root;
|
|
5688
|
+
found = true;
|
|
5689
|
+
continue;
|
|
5690
|
+
}
|
|
5691
|
+
const component = vnode.component;
|
|
5692
|
+
if (component && component.subTree) {
|
|
5693
|
+
vnode = component.subTree;
|
|
5694
|
+
continue;
|
|
5695
|
+
}
|
|
5696
|
+
const suspense = vnode.suspense;
|
|
5697
|
+
if (suspense && suspense.activeBranch) {
|
|
5698
|
+
vnode = suspense.activeBranch;
|
|
5699
|
+
continue;
|
|
5700
|
+
}
|
|
5701
|
+
return found ? vnode.el : void 0;
|
|
5702
|
+
}
|
|
5703
|
+
};
|
|
5704
|
+
const getDevRootFragmentEl = (i) => {
|
|
5705
|
+
const el = i.subTree && resolveDevRootEl(i.subTree);
|
|
5706
|
+
return el === void 0 ? i.vnode.el : el;
|
|
5707
|
+
};
|
|
5649
5708
|
const publicPropertiesMap = (
|
|
5650
5709
|
// Move PURE marker to new line to workaround compiler discarding it
|
|
5651
5710
|
// due to type annotation
|
|
5652
5711
|
/* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
|
|
5653
5712
|
$: (i) => i,
|
|
5654
|
-
$el: (i) => i
|
|
5713
|
+
$el: (i) => getDevRootFragmentEl(i) ,
|
|
5655
5714
|
$data: (i) => i.data,
|
|
5656
5715
|
$props: (i) => shallowReadonly(i.props) ,
|
|
5657
5716
|
$attrs: (i) => shallowReadonly(i.attrs) ,
|
|
@@ -6754,7 +6813,7 @@ function emit(instance, event, ...rawArgs) {
|
|
|
6754
6813
|
args = rawArgs.map((a) => isString(a) ? a.trim() : a);
|
|
6755
6814
|
}
|
|
6756
6815
|
if (modifiers.number) {
|
|
6757
|
-
args =
|
|
6816
|
+
args = args.map(looseToNumber);
|
|
6758
6817
|
}
|
|
6759
6818
|
}
|
|
6760
6819
|
{
|
|
@@ -9397,7 +9456,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
9397
9456
|
if (suspense.deps <= 0) {
|
|
9398
9457
|
suspense.resolve();
|
|
9399
9458
|
} else if (isInFallback) {
|
|
9400
|
-
if (!isHydrating) {
|
|
9459
|
+
if (!isHydrating && !suspense.isFallbackMountPending) {
|
|
9401
9460
|
patch(
|
|
9402
9461
|
activeBranch,
|
|
9403
9462
|
newFallback,
|
|
@@ -9438,7 +9497,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
9438
9497
|
);
|
|
9439
9498
|
if (suspense.deps <= 0) {
|
|
9440
9499
|
suspense.resolve();
|
|
9441
|
-
} else {
|
|
9500
|
+
} else if (!suspense.isFallbackMountPending) {
|
|
9442
9501
|
patch(
|
|
9443
9502
|
activeBranch,
|
|
9444
9503
|
newFallback,
|
|
@@ -9679,9 +9738,10 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9679
9738
|
if (!suspense.isInFallback) {
|
|
9680
9739
|
return;
|
|
9681
9740
|
}
|
|
9741
|
+
const latestFallback = suspense.vnode.ssFallback;
|
|
9682
9742
|
patch(
|
|
9683
9743
|
null,
|
|
9684
|
-
|
|
9744
|
+
latestFallback,
|
|
9685
9745
|
container2,
|
|
9686
9746
|
anchor2,
|
|
9687
9747
|
parentComponent2,
|
|
@@ -9691,7 +9751,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9691
9751
|
slotScopeIds,
|
|
9692
9752
|
optimized
|
|
9693
9753
|
);
|
|
9694
|
-
setActiveBranch(suspense,
|
|
9754
|
+
setActiveBranch(suspense, latestFallback);
|
|
9695
9755
|
};
|
|
9696
9756
|
const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
|
|
9697
9757
|
if (delayEnter) {
|
|
@@ -10957,7 +11017,7 @@ function isMemoSame(cached, memo) {
|
|
|
10957
11017
|
return true;
|
|
10958
11018
|
}
|
|
10959
11019
|
|
|
10960
|
-
const version = "3.5.
|
|
11020
|
+
const version = "3.5.42";
|
|
10961
11021
|
const warn = warn$1 ;
|
|
10962
11022
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
10963
11023
|
const devtools = devtools$1 ;
|
|
@@ -11554,7 +11614,11 @@ function setStyle(style, name, val) {
|
|
|
11554
11614
|
}
|
|
11555
11615
|
}
|
|
11556
11616
|
if (name.startsWith("--")) {
|
|
11557
|
-
|
|
11617
|
+
if (importantRE.test(val)) {
|
|
11618
|
+
style.setProperty(name, val.replace(importantRE, ""), "important");
|
|
11619
|
+
} else {
|
|
11620
|
+
style.setProperty(name, val);
|
|
11621
|
+
}
|
|
11558
11622
|
} else {
|
|
11559
11623
|
const prefixed = autoPrefix(style, name);
|
|
11560
11624
|
if (importantRE.test(val)) {
|
|
@@ -12688,13 +12752,21 @@ const vModelSelect = {
|
|
|
12688
12752
|
const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
|
|
12689
12753
|
(o) => number ? looseToNumber(getValue(o)) : getValue(o)
|
|
12690
12754
|
);
|
|
12691
|
-
el
|
|
12692
|
-
|
|
12693
|
-
|
|
12694
|
-
|
|
12695
|
-
|
|
12696
|
-
|
|
12697
|
-
|
|
12755
|
+
const multiple = el.multiple;
|
|
12756
|
+
const assignedValue = multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0];
|
|
12757
|
+
const pending = el._pendingValue = [
|
|
12758
|
+
multiple,
|
|
12759
|
+
multiple ? isArray(assignedValue) ? selectedVal.slice() : selectedVal : assignedValue
|
|
12760
|
+
];
|
|
12761
|
+
try {
|
|
12762
|
+
el[assignKey](assignedValue);
|
|
12763
|
+
} finally {
|
|
12764
|
+
nextTick(() => {
|
|
12765
|
+
if (el._pendingValue === pending) {
|
|
12766
|
+
el._pendingValue = void 0;
|
|
12767
|
+
}
|
|
12768
|
+
});
|
|
12769
|
+
}
|
|
12698
12770
|
});
|
|
12699
12771
|
el[assignKey] = getModelAssigner(vnode);
|
|
12700
12772
|
},
|
|
@@ -12708,11 +12780,25 @@ const vModelSelect = {
|
|
|
12708
12780
|
el[assignKey] = getModelAssigner(vnode);
|
|
12709
12781
|
},
|
|
12710
12782
|
updated(el, { value }) {
|
|
12711
|
-
|
|
12783
|
+
const pending = el._pendingValue;
|
|
12784
|
+
el._pendingValue = void 0;
|
|
12785
|
+
if (!pending || pending[0] !== el.multiple || !isSameSelectValue(value, pending[1], pending[0])) {
|
|
12712
12786
|
setSelected(el, value);
|
|
12713
12787
|
}
|
|
12714
12788
|
}
|
|
12715
12789
|
};
|
|
12790
|
+
function isSameSelectValue(value, assignedValue, multiple) {
|
|
12791
|
+
if (!multiple) return looseEqual(value, assignedValue);
|
|
12792
|
+
if (isArray(value)) return looseEqual(value, assignedValue);
|
|
12793
|
+
if (isSet(value)) {
|
|
12794
|
+
if (value.size !== assignedValue.length) return false;
|
|
12795
|
+
for (const item of assignedValue) {
|
|
12796
|
+
if (!value.has(item)) return false;
|
|
12797
|
+
}
|
|
12798
|
+
return true;
|
|
12799
|
+
}
|
|
12800
|
+
return false;
|
|
12801
|
+
}
|
|
12716
12802
|
function setSelected(el, value) {
|
|
12717
12803
|
const isMultiple = el.multiple;
|
|
12718
12804
|
const isArrayValue = isArray(value);
|