vue 3.5.40 → 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/vue.cjs.js +1 -1
- package/dist/vue.cjs.prod.js +1 -1
- package/dist/vue.esm-browser.js +231 -49
- package/dist/vue.esm-browser.prod.js +9 -8
- package/dist/vue.esm-bundler.js +1 -1
- package/dist/vue.global.js +231 -49
- package/dist/vue.global.prod.js +9 -8
- package/dist/vue.runtime.esm-browser.js +195 -34
- package/dist/vue.runtime.esm-browser.prod.js +4 -3
- package/dist/vue.runtime.esm-bundler.js +1 -1
- package/dist/vue.runtime.global.js +195 -34
- package/dist/vue.runtime.global.prod.js +4 -3
- package/package.json +6 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* vue v3.5.
|
|
2
|
+
* vue v3.5.42
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -194,7 +194,7 @@ const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
|
|
|
194
194
|
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
|
|
195
195
|
const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
|
|
196
196
|
const isBooleanAttr = /* @__PURE__ */ makeMap(
|
|
197
|
-
specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,
|
|
197
|
+
specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
|
|
198
198
|
);
|
|
199
199
|
function includeBooleanAttr(value) {
|
|
200
200
|
return !!value || value === "";
|
|
@@ -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) {
|
|
@@ -2597,7 +2624,9 @@ function queuePostFlushCb(cb) {
|
|
|
2597
2624
|
cb.flags |= 1;
|
|
2598
2625
|
}
|
|
2599
2626
|
} else {
|
|
2600
|
-
|
|
2627
|
+
for (let i = 0; i < cb.length; i++) {
|
|
2628
|
+
pendingPostFlushCbs.push(cb[i]);
|
|
2629
|
+
}
|
|
2601
2630
|
}
|
|
2602
2631
|
queueFlush();
|
|
2603
2632
|
}
|
|
@@ -2633,7 +2662,9 @@ function flushPostFlushCbs(seen) {
|
|
|
2633
2662
|
);
|
|
2634
2663
|
pendingPostFlushCbs.length = 0;
|
|
2635
2664
|
if (activePostFlushCbs) {
|
|
2636
|
-
|
|
2665
|
+
for (let i = 0; i < deduped.length; i++) {
|
|
2666
|
+
activePostFlushCbs.push(deduped[i]);
|
|
2667
|
+
}
|
|
2637
2668
|
return;
|
|
2638
2669
|
}
|
|
2639
2670
|
activePostFlushCbs = deduped;
|
|
@@ -3922,7 +3953,11 @@ function getInnerChild$1(vnode) {
|
|
|
3922
3953
|
function setTransitionHooks(vnode, hooks) {
|
|
3923
3954
|
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
3924
3955
|
vnode.transition = hooks;
|
|
3925
|
-
|
|
3956
|
+
const subTree = vnode.component.subTree;
|
|
3957
|
+
setTransitionHooks(
|
|
3958
|
+
isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree,
|
|
3959
|
+
hooks
|
|
3960
|
+
);
|
|
3926
3961
|
} else if (vnode.shapeFlag & 128) {
|
|
3927
3962
|
vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
3928
3963
|
vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
@@ -4325,10 +4360,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4325
4360
|
getContainerType(container),
|
|
4326
4361
|
optimized
|
|
4327
4362
|
);
|
|
4328
|
-
if (isAsyncWrapper(vnode) && !vnode.
|
|
4363
|
+
if (isAsyncWrapper(vnode) && !vnode.component.subTree) {
|
|
4329
4364
|
let subTree;
|
|
4330
4365
|
if (isFragmentStart) {
|
|
4331
|
-
subTree = createVNode(
|
|
4366
|
+
subTree = createVNode(Static);
|
|
4332
4367
|
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
4333
4368
|
} else {
|
|
4334
4369
|
subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
@@ -4462,6 +4497,9 @@ Server rendered element contains more child nodes than client vdom.`
|
|
|
4462
4497
|
}
|
|
4463
4498
|
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
|
|
4464
4499
|
key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
|
|
4500
|
+
if (isUnchangedResourceProp(el, key, props[key])) {
|
|
4501
|
+
continue;
|
|
4502
|
+
}
|
|
4465
4503
|
patchProp(el, key, null, props[key], namespace, parentComponent);
|
|
4466
4504
|
}
|
|
4467
4505
|
}
|
|
@@ -4644,6 +4682,13 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
4644
4682
|
};
|
|
4645
4683
|
return [hydrate, hydrateNode];
|
|
4646
4684
|
}
|
|
4685
|
+
const resourceProps = /* @__PURE__ */ new Set(["src", "srcset", "href", "poster"]);
|
|
4686
|
+
function isUnchangedResourceProp(el, key, clientValue) {
|
|
4687
|
+
if (!resourceProps.has(key)) {
|
|
4688
|
+
return false;
|
|
4689
|
+
}
|
|
4690
|
+
return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
|
|
4691
|
+
}
|
|
4647
4692
|
function propHasMismatch(el, key, clientValue, vnode, instance) {
|
|
4648
4693
|
let mismatchType;
|
|
4649
4694
|
let mismatchKey;
|
|
@@ -4681,7 +4726,10 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
|
|
|
4681
4726
|
mismatchKey = "style";
|
|
4682
4727
|
}
|
|
4683
4728
|
} else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
|
|
4684
|
-
if (
|
|
4729
|
+
if (key === "hidden") {
|
|
4730
|
+
actual = normalizeHiddenValue(el.getAttribute(key));
|
|
4731
|
+
expected = normalizeHiddenValue(clientValue);
|
|
4732
|
+
} else if (isBooleanAttr(key)) {
|
|
4685
4733
|
actual = el.hasAttribute(key);
|
|
4686
4734
|
expected = includeBooleanAttr(clientValue);
|
|
4687
4735
|
} else if (clientValue == null) {
|
|
@@ -4717,6 +4765,15 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
|
|
|
4717
4765
|
}
|
|
4718
4766
|
return false;
|
|
4719
4767
|
}
|
|
4768
|
+
function normalizeHiddenValue(value) {
|
|
4769
|
+
if (!isRenderableAttrValue(value)) {
|
|
4770
|
+
return false;
|
|
4771
|
+
}
|
|
4772
|
+
if (isString(value)) {
|
|
4773
|
+
return value.toLowerCase() === "until-found" ? "until-found" : "";
|
|
4774
|
+
}
|
|
4775
|
+
return includeBooleanAttr(value) ? "" : false;
|
|
4776
|
+
}
|
|
4720
4777
|
function toClassSet(str) {
|
|
4721
4778
|
return new Set(str.trim().split(/\s+/));
|
|
4722
4779
|
}
|
|
@@ -5215,7 +5272,10 @@ const KeepAliveImpl = {
|
|
|
5215
5272
|
if (pendingCacheKey != null) {
|
|
5216
5273
|
if (isSuspense(instance.subTree.type)) {
|
|
5217
5274
|
queuePostRenderEffect(() => {
|
|
5218
|
-
|
|
5275
|
+
const vnode = getInnerChild(instance.subTree);
|
|
5276
|
+
if (vnode.component) {
|
|
5277
|
+
cache.set(pendingCacheKey, vnode);
|
|
5278
|
+
}
|
|
5219
5279
|
}, instance.subTree.suspense);
|
|
5220
5280
|
} else {
|
|
5221
5281
|
cache.set(pendingCacheKey, getInnerChild(instance.subTree));
|
|
@@ -5536,7 +5596,8 @@ function createSlots(slots, dynamicSlots) {
|
|
|
5536
5596
|
return slots;
|
|
5537
5597
|
}
|
|
5538
5598
|
|
|
5539
|
-
function renderSlot(slots, name, props
|
|
5599
|
+
function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
5600
|
+
if (props == null) props = {};
|
|
5540
5601
|
if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
|
|
5541
5602
|
const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
|
|
5542
5603
|
const hasProps = Object.keys(slotProps).length > 0;
|
|
@@ -5615,12 +5676,41 @@ const getPublicInstance = (i) => {
|
|
|
5615
5676
|
if (isStatefulComponent(i)) return getComponentPublicInstance(i);
|
|
5616
5677
|
return getPublicInstance(i.parent);
|
|
5617
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
|
+
};
|
|
5618
5708
|
const publicPropertiesMap = (
|
|
5619
5709
|
// Move PURE marker to new line to workaround compiler discarding it
|
|
5620
5710
|
// due to type annotation
|
|
5621
5711
|
/* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
|
|
5622
5712
|
$: (i) => i,
|
|
5623
|
-
$el: (i) => i
|
|
5713
|
+
$el: (i) => getDevRootFragmentEl(i) ,
|
|
5624
5714
|
$data: (i) => i.data,
|
|
5625
5715
|
$props: (i) => shallowReadonly(i.props) ,
|
|
5626
5716
|
$attrs: (i) => shallowReadonly(i.attrs) ,
|
|
@@ -6723,7 +6813,7 @@ function emit(instance, event, ...rawArgs) {
|
|
|
6723
6813
|
args = rawArgs.map((a) => isString(a) ? a.trim() : a);
|
|
6724
6814
|
}
|
|
6725
6815
|
if (modifiers.number) {
|
|
6726
|
-
args =
|
|
6816
|
+
args = args.map(looseToNumber);
|
|
6727
6817
|
}
|
|
6728
6818
|
}
|
|
6729
6819
|
{
|
|
@@ -6960,12 +7050,13 @@ function renderComponentRoot(instance) {
|
|
|
6960
7050
|
root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
|
|
6961
7051
|
}
|
|
6962
7052
|
if (vnode.transition) {
|
|
6963
|
-
|
|
7053
|
+
const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
|
|
7054
|
+
if (!isElementRoot(child)) {
|
|
6964
7055
|
warn$1(
|
|
6965
7056
|
`Component inside <Transition> renders non-element root node that cannot be animated.`
|
|
6966
7057
|
);
|
|
6967
7058
|
}
|
|
6968
|
-
setTransitionHooks(
|
|
7059
|
+
setTransitionHooks(child, vnode.transition);
|
|
6969
7060
|
}
|
|
6970
7061
|
if (setRoot) {
|
|
6971
7062
|
setRoot(root);
|
|
@@ -9365,7 +9456,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
9365
9456
|
if (suspense.deps <= 0) {
|
|
9366
9457
|
suspense.resolve();
|
|
9367
9458
|
} else if (isInFallback) {
|
|
9368
|
-
if (!isHydrating) {
|
|
9459
|
+
if (!isHydrating && !suspense.isFallbackMountPending) {
|
|
9369
9460
|
patch(
|
|
9370
9461
|
activeBranch,
|
|
9371
9462
|
newFallback,
|
|
@@ -9406,7 +9497,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
9406
9497
|
);
|
|
9407
9498
|
if (suspense.deps <= 0) {
|
|
9408
9499
|
suspense.resolve();
|
|
9409
|
-
} else {
|
|
9500
|
+
} else if (!suspense.isFallbackMountPending) {
|
|
9410
9501
|
patch(
|
|
9411
9502
|
activeBranch,
|
|
9412
9503
|
newFallback,
|
|
@@ -9613,7 +9704,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9613
9704
|
let hasUnresolvedAncestor = false;
|
|
9614
9705
|
while (parent) {
|
|
9615
9706
|
if (parent.pendingBranch) {
|
|
9616
|
-
|
|
9707
|
+
for (let i = 0; i < effects.length; i++) {
|
|
9708
|
+
parent.effects.push(effects[i]);
|
|
9709
|
+
}
|
|
9617
9710
|
hasUnresolvedAncestor = true;
|
|
9618
9711
|
break;
|
|
9619
9712
|
}
|
|
@@ -9645,9 +9738,10 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9645
9738
|
if (!suspense.isInFallback) {
|
|
9646
9739
|
return;
|
|
9647
9740
|
}
|
|
9741
|
+
const latestFallback = suspense.vnode.ssFallback;
|
|
9648
9742
|
patch(
|
|
9649
9743
|
null,
|
|
9650
|
-
|
|
9744
|
+
latestFallback,
|
|
9651
9745
|
container2,
|
|
9652
9746
|
anchor2,
|
|
9653
9747
|
parentComponent2,
|
|
@@ -9657,7 +9751,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9657
9751
|
slotScopeIds,
|
|
9658
9752
|
optimized
|
|
9659
9753
|
);
|
|
9660
|
-
setActiveBranch(suspense,
|
|
9754
|
+
setActiveBranch(suspense, latestFallback);
|
|
9661
9755
|
};
|
|
9662
9756
|
const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
|
|
9663
9757
|
if (delayEnter) {
|
|
@@ -9978,6 +10072,14 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
9978
10072
|
if (vnode.key !== vnode.key) {
|
|
9979
10073
|
warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
|
|
9980
10074
|
}
|
|
10075
|
+
if (props && vnode.shapeFlag & 1) {
|
|
10076
|
+
const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
|
|
10077
|
+
if (overwritingProp && hasContentChildren(vnode.children)) {
|
|
10078
|
+
warn$1(
|
|
10079
|
+
`The \`${overwritingProp}\` prop on <${vnode.type}> will override its children. Remove either the \`${overwritingProp}\` prop or the children.`
|
|
10080
|
+
);
|
|
10081
|
+
}
|
|
10082
|
+
}
|
|
9981
10083
|
if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
|
|
9982
10084
|
!isBlockNode && // has current parent block
|
|
9983
10085
|
currentBlock && // presence of a patch flag indicates this node needs patching on updates.
|
|
@@ -9991,6 +10093,11 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
9991
10093
|
}
|
|
9992
10094
|
return vnode;
|
|
9993
10095
|
}
|
|
10096
|
+
function hasContentChildren(children) {
|
|
10097
|
+
if (isString(children)) return children !== "";
|
|
10098
|
+
if (isArray(children)) return children.length > 0;
|
|
10099
|
+
return false;
|
|
10100
|
+
}
|
|
9994
10101
|
const createVNode = createVNodeWithArgsTransform ;
|
|
9995
10102
|
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
|
|
9996
10103
|
if (!type || type === NULL_DYNAMIC_COMPONENT) {
|
|
@@ -10439,7 +10546,12 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
10439
10546
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
10440
10547
|
if (isSSR) {
|
|
10441
10548
|
return setupResult.then((resolvedResult) => {
|
|
10442
|
-
|
|
10549
|
+
setInSSRSetupState(true);
|
|
10550
|
+
try {
|
|
10551
|
+
handleSetupResult(instance, resolvedResult, isSSR);
|
|
10552
|
+
} finally {
|
|
10553
|
+
setInSSRSetupState(false);
|
|
10554
|
+
}
|
|
10443
10555
|
}).catch((e) => {
|
|
10444
10556
|
handleError(e, instance, 0);
|
|
10445
10557
|
});
|
|
@@ -10905,7 +11017,7 @@ function isMemoSame(cached, memo) {
|
|
|
10905
11017
|
return true;
|
|
10906
11018
|
}
|
|
10907
11019
|
|
|
10908
|
-
const version = "3.5.
|
|
11020
|
+
const version = "3.5.42";
|
|
10909
11021
|
const warn = warn$1 ;
|
|
10910
11022
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
10911
11023
|
const devtools = devtools$1 ;
|
|
@@ -11502,7 +11614,11 @@ function setStyle(style, name, val) {
|
|
|
11502
11614
|
}
|
|
11503
11615
|
}
|
|
11504
11616
|
if (name.startsWith("--")) {
|
|
11505
|
-
|
|
11617
|
+
if (importantRE.test(val)) {
|
|
11618
|
+
style.setProperty(name, val.replace(importantRE, ""), "important");
|
|
11619
|
+
} else {
|
|
11620
|
+
style.setProperty(name, val);
|
|
11621
|
+
}
|
|
11506
11622
|
} else {
|
|
11507
11623
|
const prefixed = autoPrefix(style, name);
|
|
11508
11624
|
if (importantRE.test(val)) {
|
|
@@ -11875,7 +11991,9 @@ class VueElement extends BaseClass {
|
|
|
11875
11991
|
if (parent && parent._pendingResolve) {
|
|
11876
11992
|
this._pendingResolve = parent._pendingResolve.then(() => {
|
|
11877
11993
|
this._pendingResolve = void 0;
|
|
11878
|
-
this.
|
|
11994
|
+
if (this.isConnected) {
|
|
11995
|
+
return this._resolveDef();
|
|
11996
|
+
}
|
|
11879
11997
|
});
|
|
11880
11998
|
} else {
|
|
11881
11999
|
this._resolveDef();
|
|
@@ -11925,7 +12043,7 @@ class VueElement extends BaseClass {
|
|
|
11925
12043
|
*/
|
|
11926
12044
|
_resolveDef() {
|
|
11927
12045
|
if (this._pendingResolve) {
|
|
11928
|
-
return;
|
|
12046
|
+
return this._pendingResolve;
|
|
11929
12047
|
}
|
|
11930
12048
|
for (let i = 0; i < this.attributes.length; i++) {
|
|
11931
12049
|
this._setAttr(this.attributes[i].name);
|
|
@@ -11965,6 +12083,7 @@ class VueElement extends BaseClass {
|
|
|
11965
12083
|
def.configureApp = this._def.configureApp;
|
|
11966
12084
|
resolve(this._def = def, true);
|
|
11967
12085
|
});
|
|
12086
|
+
return this._pendingResolve;
|
|
11968
12087
|
} else {
|
|
11969
12088
|
resolve(this._def);
|
|
11970
12089
|
}
|
|
@@ -12002,6 +12121,11 @@ class VueElement extends BaseClass {
|
|
|
12002
12121
|
}
|
|
12003
12122
|
}
|
|
12004
12123
|
for (const key of declaredPropKeys.map(camelize)) {
|
|
12124
|
+
if (key in Object.getPrototypeOf(this)) {
|
|
12125
|
+
warn(
|
|
12126
|
+
`Custom element prop "${key}" conflicts with an existing property on the element and will overwrite it.`
|
|
12127
|
+
);
|
|
12128
|
+
}
|
|
12005
12129
|
Object.defineProperty(this, key, {
|
|
12006
12130
|
get() {
|
|
12007
12131
|
return this._getProp(key);
|
|
@@ -12486,6 +12610,7 @@ function onCompositionEnd(e) {
|
|
|
12486
12610
|
}
|
|
12487
12611
|
}
|
|
12488
12612
|
const assignKey = /* @__PURE__ */ Symbol("_assign");
|
|
12613
|
+
const initialValueKey = /* @__PURE__ */ Symbol("_initialValue");
|
|
12489
12614
|
function castValue(value, trim, number) {
|
|
12490
12615
|
if (trim) value = value.trim();
|
|
12491
12616
|
if (number) value = looseToNumber(value);
|
|
@@ -12493,6 +12618,13 @@ function castValue(value, trim, number) {
|
|
|
12493
12618
|
}
|
|
12494
12619
|
const vModelText = {
|
|
12495
12620
|
created(el, { modifiers: { lazy, trim, number } }, vnode) {
|
|
12621
|
+
if (el.parentNode) {
|
|
12622
|
+
if (el.type === "text") {
|
|
12623
|
+
el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
|
|
12624
|
+
} else if (el.type === "textarea") {
|
|
12625
|
+
el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
|
|
12626
|
+
}
|
|
12627
|
+
}
|
|
12496
12628
|
el[assignKey] = getModelAssigner(vnode);
|
|
12497
12629
|
const castToNumber = number || vnode.props && vnode.props.type === "number";
|
|
12498
12630
|
addEventListener(el, lazy ? "change" : "input", (e) => {
|
|
@@ -12511,8 +12643,15 @@ const vModelText = {
|
|
|
12511
12643
|
}
|
|
12512
12644
|
},
|
|
12513
12645
|
// set value on mounted so it's after min/max for type="range"
|
|
12514
|
-
mounted(el, { value }) {
|
|
12515
|
-
|
|
12646
|
+
mounted(el, { value, modifiers: { trim, number } }) {
|
|
12647
|
+
const newValue = value == null ? "" : value;
|
|
12648
|
+
const initialValue = el[initialValueKey];
|
|
12649
|
+
delete el[initialValueKey];
|
|
12650
|
+
if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) {
|
|
12651
|
+
el[assignKey](castValue(el.value, trim, number));
|
|
12652
|
+
} else {
|
|
12653
|
+
el.value = newValue;
|
|
12654
|
+
}
|
|
12516
12655
|
},
|
|
12517
12656
|
beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
|
|
12518
12657
|
el[assignKey] = getModelAssigner(vnode);
|
|
@@ -12613,13 +12752,21 @@ const vModelSelect = {
|
|
|
12613
12752
|
const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
|
|
12614
12753
|
(o) => number ? looseToNumber(getValue(o)) : getValue(o)
|
|
12615
12754
|
);
|
|
12616
|
-
el
|
|
12617
|
-
|
|
12618
|
-
|
|
12619
|
-
|
|
12620
|
-
|
|
12621
|
-
|
|
12622
|
-
|
|
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
|
+
}
|
|
12623
12770
|
});
|
|
12624
12771
|
el[assignKey] = getModelAssigner(vnode);
|
|
12625
12772
|
},
|
|
@@ -12633,11 +12780,25 @@ const vModelSelect = {
|
|
|
12633
12780
|
el[assignKey] = getModelAssigner(vnode);
|
|
12634
12781
|
},
|
|
12635
12782
|
updated(el, { value }) {
|
|
12636
|
-
|
|
12783
|
+
const pending = el._pendingValue;
|
|
12784
|
+
el._pendingValue = void 0;
|
|
12785
|
+
if (!pending || pending[0] !== el.multiple || !isSameSelectValue(value, pending[1], pending[0])) {
|
|
12637
12786
|
setSelected(el, value);
|
|
12638
12787
|
}
|
|
12639
12788
|
}
|
|
12640
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
|
+
}
|
|
12641
12802
|
function setSelected(el, value) {
|
|
12642
12803
|
const isMultiple = el.multiple;
|
|
12643
12804
|
const isArrayValue = isArray(value);
|