@vue/compat 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 +236 -51
- package/dist/vue.cjs.prod.js +174 -48
- package/dist/vue.esm-browser.js +232 -50
- package/dist/vue.esm-browser.prod.js +9 -8
- package/dist/vue.esm-bundler.js +232 -50
- package/dist/vue.global.js +232 -50
- package/dist/vue.global.prod.js +9 -8
- package/dist/vue.runtime.esm-browser.js +196 -35
- package/dist/vue.runtime.esm-browser.prod.js +4 -3
- package/dist/vue.runtime.esm-bundler.js +196 -35
- package/dist/vue.runtime.global.js +196 -35
- package/dist/vue.runtime.global.prod.js +4 -3
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compat v3.5.
|
|
2
|
+
* @vue/compat 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;
|
|
@@ -4394,7 +4425,11 @@ function getInnerChild$1(vnode) {
|
|
|
4394
4425
|
function setTransitionHooks(vnode, hooks) {
|
|
4395
4426
|
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
4396
4427
|
vnode.transition = hooks;
|
|
4397
|
-
|
|
4428
|
+
const subTree = vnode.component.subTree;
|
|
4429
|
+
setTransitionHooks(
|
|
4430
|
+
isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree,
|
|
4431
|
+
hooks
|
|
4432
|
+
);
|
|
4398
4433
|
} else if (vnode.shapeFlag & 128) {
|
|
4399
4434
|
vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
4400
4435
|
vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
@@ -4797,10 +4832,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4797
4832
|
getContainerType(container),
|
|
4798
4833
|
optimized
|
|
4799
4834
|
);
|
|
4800
|
-
if (isAsyncWrapper(vnode) && !vnode.
|
|
4835
|
+
if (isAsyncWrapper(vnode) && !vnode.component.subTree) {
|
|
4801
4836
|
let subTree;
|
|
4802
4837
|
if (isFragmentStart) {
|
|
4803
|
-
subTree = createVNode(
|
|
4838
|
+
subTree = createVNode(Static);
|
|
4804
4839
|
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
4805
4840
|
} else {
|
|
4806
4841
|
subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
@@ -4934,6 +4969,9 @@ Server rendered element contains more child nodes than client vdom.`
|
|
|
4934
4969
|
}
|
|
4935
4970
|
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
|
|
4936
4971
|
key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
|
|
4972
|
+
if (isUnchangedResourceProp(el, key, props[key])) {
|
|
4973
|
+
continue;
|
|
4974
|
+
}
|
|
4937
4975
|
patchProp(el, key, null, props[key], namespace, parentComponent);
|
|
4938
4976
|
}
|
|
4939
4977
|
}
|
|
@@ -5116,6 +5154,13 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
5116
5154
|
};
|
|
5117
5155
|
return [hydrate, hydrateNode];
|
|
5118
5156
|
}
|
|
5157
|
+
const resourceProps = /* @__PURE__ */ new Set(["src", "srcset", "href", "poster"]);
|
|
5158
|
+
function isUnchangedResourceProp(el, key, clientValue) {
|
|
5159
|
+
if (!resourceProps.has(key)) {
|
|
5160
|
+
return false;
|
|
5161
|
+
}
|
|
5162
|
+
return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
|
|
5163
|
+
}
|
|
5119
5164
|
function propHasMismatch(el, key, clientValue, vnode, instance) {
|
|
5120
5165
|
let mismatchType;
|
|
5121
5166
|
let mismatchKey;
|
|
@@ -5153,7 +5198,10 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
|
|
|
5153
5198
|
mismatchKey = "style";
|
|
5154
5199
|
}
|
|
5155
5200
|
} else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
|
|
5156
|
-
if (
|
|
5201
|
+
if (key === "hidden") {
|
|
5202
|
+
actual = normalizeHiddenValue(el.getAttribute(key));
|
|
5203
|
+
expected = normalizeHiddenValue(clientValue);
|
|
5204
|
+
} else if (isBooleanAttr(key)) {
|
|
5157
5205
|
actual = el.hasAttribute(key);
|
|
5158
5206
|
expected = includeBooleanAttr(clientValue);
|
|
5159
5207
|
} else if (clientValue == null) {
|
|
@@ -5189,6 +5237,15 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
|
|
|
5189
5237
|
}
|
|
5190
5238
|
return false;
|
|
5191
5239
|
}
|
|
5240
|
+
function normalizeHiddenValue(value) {
|
|
5241
|
+
if (!isRenderableAttrValue(value)) {
|
|
5242
|
+
return false;
|
|
5243
|
+
}
|
|
5244
|
+
if (isString(value)) {
|
|
5245
|
+
return value.toLowerCase() === "until-found" ? "until-found" : "";
|
|
5246
|
+
}
|
|
5247
|
+
return includeBooleanAttr(value) ? "" : false;
|
|
5248
|
+
}
|
|
5192
5249
|
function toClassSet(str) {
|
|
5193
5250
|
return new Set(str.trim().split(/\s+/));
|
|
5194
5251
|
}
|
|
@@ -5687,7 +5744,10 @@ const KeepAliveImpl = {
|
|
|
5687
5744
|
if (pendingCacheKey != null) {
|
|
5688
5745
|
if (isSuspense(instance.subTree.type)) {
|
|
5689
5746
|
queuePostRenderEffect(() => {
|
|
5690
|
-
|
|
5747
|
+
const vnode = getInnerChild(instance.subTree);
|
|
5748
|
+
if (vnode.component) {
|
|
5749
|
+
cache.set(pendingCacheKey, vnode);
|
|
5750
|
+
}
|
|
5691
5751
|
}, instance.subTree.suspense);
|
|
5692
5752
|
} else {
|
|
5693
5753
|
cache.set(pendingCacheKey, getInnerChild(instance.subTree));
|
|
@@ -6299,7 +6359,8 @@ function createSlots(slots, dynamicSlots) {
|
|
|
6299
6359
|
return slots;
|
|
6300
6360
|
}
|
|
6301
6361
|
|
|
6302
|
-
function renderSlot(slots, name, props
|
|
6362
|
+
function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
6363
|
+
if (props == null) props = {};
|
|
6303
6364
|
if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
|
|
6304
6365
|
const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
|
|
6305
6366
|
const hasProps = Object.keys(slotProps).length > 0;
|
|
@@ -6607,12 +6668,41 @@ const getPublicInstance = (i) => {
|
|
|
6607
6668
|
if (isStatefulComponent(i)) return getComponentPublicInstance(i);
|
|
6608
6669
|
return getPublicInstance(i.parent);
|
|
6609
6670
|
};
|
|
6671
|
+
const resolveDevRootEl = (vnode) => {
|
|
6672
|
+
let found = false;
|
|
6673
|
+
while (true) {
|
|
6674
|
+
if (vnode.patchFlag > 0 && vnode.patchFlag & 2048) {
|
|
6675
|
+
const root = filterSingleRoot(vnode.children);
|
|
6676
|
+
if (!root) {
|
|
6677
|
+
return;
|
|
6678
|
+
}
|
|
6679
|
+
vnode = root;
|
|
6680
|
+
found = true;
|
|
6681
|
+
continue;
|
|
6682
|
+
}
|
|
6683
|
+
const component = vnode.component;
|
|
6684
|
+
if (component && component.subTree) {
|
|
6685
|
+
vnode = component.subTree;
|
|
6686
|
+
continue;
|
|
6687
|
+
}
|
|
6688
|
+
const suspense = vnode.suspense;
|
|
6689
|
+
if (suspense && suspense.activeBranch) {
|
|
6690
|
+
vnode = suspense.activeBranch;
|
|
6691
|
+
continue;
|
|
6692
|
+
}
|
|
6693
|
+
return found ? vnode.el : void 0;
|
|
6694
|
+
}
|
|
6695
|
+
};
|
|
6696
|
+
const getDevRootFragmentEl = (i) => {
|
|
6697
|
+
const el = i.subTree && resolveDevRootEl(i.subTree);
|
|
6698
|
+
return el === void 0 ? i.vnode.el : el;
|
|
6699
|
+
};
|
|
6610
6700
|
const publicPropertiesMap = (
|
|
6611
6701
|
// Move PURE marker to new line to workaround compiler discarding it
|
|
6612
6702
|
// due to type annotation
|
|
6613
6703
|
/* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
|
|
6614
6704
|
$: (i) => i,
|
|
6615
|
-
$el: (i) => i
|
|
6705
|
+
$el: (i) => getDevRootFragmentEl(i) ,
|
|
6616
6706
|
$data: (i) => i.data,
|
|
6617
6707
|
$props: (i) => shallowReadonly(i.props) ,
|
|
6618
6708
|
$attrs: (i) => shallowReadonly(i.attrs) ,
|
|
@@ -7526,7 +7616,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
7526
7616
|
return vm;
|
|
7527
7617
|
}
|
|
7528
7618
|
}
|
|
7529
|
-
Vue.version = `2.6.14-compat:${"3.5.
|
|
7619
|
+
Vue.version = `2.6.14-compat:${"3.5.42"}`;
|
|
7530
7620
|
Vue.config = singletonApp.config;
|
|
7531
7621
|
Vue.use = (plugin, ...options) => {
|
|
7532
7622
|
if (plugin && isFunction(plugin.install)) {
|
|
@@ -8283,7 +8373,7 @@ function emit(instance, event, ...rawArgs) {
|
|
|
8283
8373
|
args = rawArgs.map((a) => isString(a) ? a.trim() : a);
|
|
8284
8374
|
}
|
|
8285
8375
|
if (modifiers.number) {
|
|
8286
|
-
args =
|
|
8376
|
+
args = args.map(looseToNumber);
|
|
8287
8377
|
}
|
|
8288
8378
|
}
|
|
8289
8379
|
{
|
|
@@ -8548,12 +8638,13 @@ function renderComponentRoot(instance) {
|
|
|
8548
8638
|
root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
|
|
8549
8639
|
}
|
|
8550
8640
|
if (vnode.transition) {
|
|
8551
|
-
|
|
8641
|
+
const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
|
|
8642
|
+
if (!isElementRoot(child)) {
|
|
8552
8643
|
warn$1(
|
|
8553
8644
|
`Component inside <Transition> renders non-element root node that cannot be animated.`
|
|
8554
8645
|
);
|
|
8555
8646
|
}
|
|
8556
|
-
setTransitionHooks(
|
|
8647
|
+
setTransitionHooks(child, vnode.transition);
|
|
8557
8648
|
}
|
|
8558
8649
|
if (setRoot) {
|
|
8559
8650
|
setRoot(root);
|
|
@@ -11059,7 +11150,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
11059
11150
|
if (suspense.deps <= 0) {
|
|
11060
11151
|
suspense.resolve();
|
|
11061
11152
|
} else if (isInFallback) {
|
|
11062
|
-
if (!isHydrating) {
|
|
11153
|
+
if (!isHydrating && !suspense.isFallbackMountPending) {
|
|
11063
11154
|
patch(
|
|
11064
11155
|
activeBranch,
|
|
11065
11156
|
newFallback,
|
|
@@ -11100,7 +11191,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
11100
11191
|
);
|
|
11101
11192
|
if (suspense.deps <= 0) {
|
|
11102
11193
|
suspense.resolve();
|
|
11103
|
-
} else {
|
|
11194
|
+
} else if (!suspense.isFallbackMountPending) {
|
|
11104
11195
|
patch(
|
|
11105
11196
|
activeBranch,
|
|
11106
11197
|
newFallback,
|
|
@@ -11307,7 +11398,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
11307
11398
|
let hasUnresolvedAncestor = false;
|
|
11308
11399
|
while (parent) {
|
|
11309
11400
|
if (parent.pendingBranch) {
|
|
11310
|
-
|
|
11401
|
+
for (let i = 0; i < effects.length; i++) {
|
|
11402
|
+
parent.effects.push(effects[i]);
|
|
11403
|
+
}
|
|
11311
11404
|
hasUnresolvedAncestor = true;
|
|
11312
11405
|
break;
|
|
11313
11406
|
}
|
|
@@ -11339,9 +11432,10 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
11339
11432
|
if (!suspense.isInFallback) {
|
|
11340
11433
|
return;
|
|
11341
11434
|
}
|
|
11435
|
+
const latestFallback = suspense.vnode.ssFallback;
|
|
11342
11436
|
patch(
|
|
11343
11437
|
null,
|
|
11344
|
-
|
|
11438
|
+
latestFallback,
|
|
11345
11439
|
container2,
|
|
11346
11440
|
anchor2,
|
|
11347
11441
|
parentComponent2,
|
|
@@ -11351,7 +11445,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
11351
11445
|
slotScopeIds,
|
|
11352
11446
|
optimized
|
|
11353
11447
|
);
|
|
11354
|
-
setActiveBranch(suspense,
|
|
11448
|
+
setActiveBranch(suspense, latestFallback);
|
|
11355
11449
|
};
|
|
11356
11450
|
const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
|
|
11357
11451
|
if (delayEnter) {
|
|
@@ -11729,6 +11823,14 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
11729
11823
|
if (vnode.key !== vnode.key) {
|
|
11730
11824
|
warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
|
|
11731
11825
|
}
|
|
11826
|
+
if (props && vnode.shapeFlag & 1) {
|
|
11827
|
+
const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
|
|
11828
|
+
if (overwritingProp && hasContentChildren(vnode.children)) {
|
|
11829
|
+
warn$1(
|
|
11830
|
+
`The \`${overwritingProp}\` prop on <${vnode.type}> will override its children. Remove either the \`${overwritingProp}\` prop or the children.`
|
|
11831
|
+
);
|
|
11832
|
+
}
|
|
11833
|
+
}
|
|
11732
11834
|
if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
|
|
11733
11835
|
!isBlockNode && // has current parent block
|
|
11734
11836
|
currentBlock && // presence of a patch flag indicates this node needs patching on updates.
|
|
@@ -11746,6 +11848,11 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
11746
11848
|
}
|
|
11747
11849
|
return vnode;
|
|
11748
11850
|
}
|
|
11851
|
+
function hasContentChildren(children) {
|
|
11852
|
+
if (isString(children)) return children !== "";
|
|
11853
|
+
if (isArray(children)) return children.length > 0;
|
|
11854
|
+
return false;
|
|
11855
|
+
}
|
|
11749
11856
|
const createVNode = createVNodeWithArgsTransform ;
|
|
11750
11857
|
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
|
|
11751
11858
|
if (!type || type === NULL_DYNAMIC_COMPONENT) {
|
|
@@ -12200,7 +12307,12 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
12200
12307
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
12201
12308
|
if (isSSR) {
|
|
12202
12309
|
return setupResult.then((resolvedResult) => {
|
|
12203
|
-
|
|
12310
|
+
setInSSRSetupState(true);
|
|
12311
|
+
try {
|
|
12312
|
+
handleSetupResult(instance, resolvedResult, isSSR);
|
|
12313
|
+
} finally {
|
|
12314
|
+
setInSSRSetupState(false);
|
|
12315
|
+
}
|
|
12204
12316
|
}).catch((e) => {
|
|
12205
12317
|
handleError(e, instance, 0);
|
|
12206
12318
|
});
|
|
@@ -12678,7 +12790,7 @@ function isMemoSame(cached, memo) {
|
|
|
12678
12790
|
return true;
|
|
12679
12791
|
}
|
|
12680
12792
|
|
|
12681
|
-
const version = "3.5.
|
|
12793
|
+
const version = "3.5.42";
|
|
12682
12794
|
const warn = warn$1 ;
|
|
12683
12795
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
12684
12796
|
const devtools = devtools$1 ;
|
|
@@ -13319,7 +13431,11 @@ function setStyle(style, name, val) {
|
|
|
13319
13431
|
}
|
|
13320
13432
|
}
|
|
13321
13433
|
if (name.startsWith("--")) {
|
|
13322
|
-
|
|
13434
|
+
if (importantRE.test(val)) {
|
|
13435
|
+
style.setProperty(name, val.replace(importantRE, ""), "important");
|
|
13436
|
+
} else {
|
|
13437
|
+
style.setProperty(name, val);
|
|
13438
|
+
}
|
|
13323
13439
|
} else {
|
|
13324
13440
|
const prefixed = autoPrefix(style, name);
|
|
13325
13441
|
if (importantRE.test(val)) {
|
|
@@ -13736,7 +13852,9 @@ class VueElement extends BaseClass {
|
|
|
13736
13852
|
if (parent && parent._pendingResolve) {
|
|
13737
13853
|
this._pendingResolve = parent._pendingResolve.then(() => {
|
|
13738
13854
|
this._pendingResolve = void 0;
|
|
13739
|
-
this.
|
|
13855
|
+
if (this.isConnected) {
|
|
13856
|
+
return this._resolveDef();
|
|
13857
|
+
}
|
|
13740
13858
|
});
|
|
13741
13859
|
} else {
|
|
13742
13860
|
this._resolveDef();
|
|
@@ -13786,7 +13904,7 @@ class VueElement extends BaseClass {
|
|
|
13786
13904
|
*/
|
|
13787
13905
|
_resolveDef() {
|
|
13788
13906
|
if (this._pendingResolve) {
|
|
13789
|
-
return;
|
|
13907
|
+
return this._pendingResolve;
|
|
13790
13908
|
}
|
|
13791
13909
|
for (let i = 0; i < this.attributes.length; i++) {
|
|
13792
13910
|
this._setAttr(this.attributes[i].name);
|
|
@@ -13826,6 +13944,7 @@ class VueElement extends BaseClass {
|
|
|
13826
13944
|
def.configureApp = this._def.configureApp;
|
|
13827
13945
|
resolve(this._def = def, true);
|
|
13828
13946
|
});
|
|
13947
|
+
return this._pendingResolve;
|
|
13829
13948
|
} else {
|
|
13830
13949
|
resolve(this._def);
|
|
13831
13950
|
}
|
|
@@ -13863,6 +13982,11 @@ class VueElement extends BaseClass {
|
|
|
13863
13982
|
}
|
|
13864
13983
|
}
|
|
13865
13984
|
for (const key of declaredPropKeys.map(camelize)) {
|
|
13985
|
+
if (key in Object.getPrototypeOf(this)) {
|
|
13986
|
+
warn(
|
|
13987
|
+
`Custom element prop "${key}" conflicts with an existing property on the element and will overwrite it.`
|
|
13988
|
+
);
|
|
13989
|
+
}
|
|
13866
13990
|
Object.defineProperty(this, key, {
|
|
13867
13991
|
get() {
|
|
13868
13992
|
return this._getProp(key);
|
|
@@ -14356,6 +14480,7 @@ function onCompositionEnd(e) {
|
|
|
14356
14480
|
}
|
|
14357
14481
|
}
|
|
14358
14482
|
const assignKey = /* @__PURE__ */ Symbol("_assign");
|
|
14483
|
+
const initialValueKey = /* @__PURE__ */ Symbol("_initialValue");
|
|
14359
14484
|
function castValue(value, trim, number) {
|
|
14360
14485
|
if (trim) value = value.trim();
|
|
14361
14486
|
if (number) value = looseToNumber(value);
|
|
@@ -14363,6 +14488,13 @@ function castValue(value, trim, number) {
|
|
|
14363
14488
|
}
|
|
14364
14489
|
const vModelText = {
|
|
14365
14490
|
created(el, { modifiers: { lazy, trim, number } }, vnode) {
|
|
14491
|
+
if (el.parentNode) {
|
|
14492
|
+
if (el.type === "text") {
|
|
14493
|
+
el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
|
|
14494
|
+
} else if (el.type === "textarea") {
|
|
14495
|
+
el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
|
|
14496
|
+
}
|
|
14497
|
+
}
|
|
14366
14498
|
el[assignKey] = getModelAssigner(vnode);
|
|
14367
14499
|
const castToNumber = number || vnode.props && vnode.props.type === "number";
|
|
14368
14500
|
addEventListener(el, lazy ? "change" : "input", (e) => {
|
|
@@ -14381,8 +14513,15 @@ const vModelText = {
|
|
|
14381
14513
|
}
|
|
14382
14514
|
},
|
|
14383
14515
|
// set value on mounted so it's after min/max for type="range"
|
|
14384
|
-
mounted(el, { value }) {
|
|
14385
|
-
|
|
14516
|
+
mounted(el, { value, modifiers: { trim, number } }) {
|
|
14517
|
+
const newValue = value == null ? "" : value;
|
|
14518
|
+
const initialValue = el[initialValueKey];
|
|
14519
|
+
delete el[initialValueKey];
|
|
14520
|
+
if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) {
|
|
14521
|
+
el[assignKey](castValue(el.value, trim, number));
|
|
14522
|
+
} else {
|
|
14523
|
+
el.value = newValue;
|
|
14524
|
+
}
|
|
14386
14525
|
},
|
|
14387
14526
|
beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
|
|
14388
14527
|
el[assignKey] = getModelAssigner(vnode);
|
|
@@ -14483,13 +14622,21 @@ const vModelSelect = {
|
|
|
14483
14622
|
const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
|
|
14484
14623
|
(o) => number ? looseToNumber(getValue(o)) : getValue(o)
|
|
14485
14624
|
);
|
|
14486
|
-
el
|
|
14487
|
-
|
|
14488
|
-
|
|
14489
|
-
|
|
14490
|
-
|
|
14491
|
-
|
|
14492
|
-
|
|
14625
|
+
const multiple = el.multiple;
|
|
14626
|
+
const assignedValue = multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0];
|
|
14627
|
+
const pending = el._pendingValue = [
|
|
14628
|
+
multiple,
|
|
14629
|
+
multiple ? isArray(assignedValue) ? selectedVal.slice() : selectedVal : assignedValue
|
|
14630
|
+
];
|
|
14631
|
+
try {
|
|
14632
|
+
el[assignKey](assignedValue);
|
|
14633
|
+
} finally {
|
|
14634
|
+
nextTick(() => {
|
|
14635
|
+
if (el._pendingValue === pending) {
|
|
14636
|
+
el._pendingValue = void 0;
|
|
14637
|
+
}
|
|
14638
|
+
});
|
|
14639
|
+
}
|
|
14493
14640
|
});
|
|
14494
14641
|
el[assignKey] = getModelAssigner(vnode);
|
|
14495
14642
|
},
|
|
@@ -14503,11 +14650,25 @@ const vModelSelect = {
|
|
|
14503
14650
|
el[assignKey] = getModelAssigner(vnode);
|
|
14504
14651
|
},
|
|
14505
14652
|
updated(el, { value }) {
|
|
14506
|
-
|
|
14653
|
+
const pending = el._pendingValue;
|
|
14654
|
+
el._pendingValue = void 0;
|
|
14655
|
+
if (!pending || pending[0] !== el.multiple || !isSameSelectValue(value, pending[1], pending[0])) {
|
|
14507
14656
|
setSelected(el, value);
|
|
14508
14657
|
}
|
|
14509
14658
|
}
|
|
14510
14659
|
};
|
|
14660
|
+
function isSameSelectValue(value, assignedValue, multiple) {
|
|
14661
|
+
if (!multiple) return looseEqual(value, assignedValue);
|
|
14662
|
+
if (isArray(value)) return looseEqual(value, assignedValue);
|
|
14663
|
+
if (isSet(value)) {
|
|
14664
|
+
if (value.size !== assignedValue.length) return false;
|
|
14665
|
+
for (const item of assignedValue) {
|
|
14666
|
+
if (!value.has(item)) return false;
|
|
14667
|
+
}
|
|
14668
|
+
return true;
|
|
14669
|
+
}
|
|
14670
|
+
return false;
|
|
14671
|
+
}
|
|
14511
14672
|
function setSelected(el, value) {
|
|
14512
14673
|
const isMultiple = el.multiple;
|
|
14513
14674
|
const isArrayValue = isArray(value);
|