@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) {
|
|
@@ -2612,7 +2639,9 @@ function queuePostFlushCb(cb) {
|
|
|
2612
2639
|
cb.flags |= 1;
|
|
2613
2640
|
}
|
|
2614
2641
|
} else {
|
|
2615
|
-
|
|
2642
|
+
for (let i = 0; i < cb.length; i++) {
|
|
2643
|
+
pendingPostFlushCbs.push(cb[i]);
|
|
2644
|
+
}
|
|
2616
2645
|
}
|
|
2617
2646
|
queueFlush();
|
|
2618
2647
|
}
|
|
@@ -2648,7 +2677,9 @@ function flushPostFlushCbs(seen) {
|
|
|
2648
2677
|
);
|
|
2649
2678
|
pendingPostFlushCbs.length = 0;
|
|
2650
2679
|
if (activePostFlushCbs) {
|
|
2651
|
-
|
|
2680
|
+
for (let i = 0; i < deduped.length; i++) {
|
|
2681
|
+
activePostFlushCbs.push(deduped[i]);
|
|
2682
|
+
}
|
|
2652
2683
|
return;
|
|
2653
2684
|
}
|
|
2654
2685
|
activePostFlushCbs = deduped;
|
|
@@ -4413,7 +4444,11 @@ function getInnerChild$1(vnode) {
|
|
|
4413
4444
|
function setTransitionHooks(vnode, hooks) {
|
|
4414
4445
|
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
4415
4446
|
vnode.transition = hooks;
|
|
4416
|
-
|
|
4447
|
+
const subTree = vnode.component.subTree;
|
|
4448
|
+
setTransitionHooks(
|
|
4449
|
+
isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree,
|
|
4450
|
+
hooks
|
|
4451
|
+
);
|
|
4417
4452
|
} else if (vnode.shapeFlag & 128) {
|
|
4418
4453
|
vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
4419
4454
|
vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
@@ -4816,10 +4851,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4816
4851
|
getContainerType(container),
|
|
4817
4852
|
optimized
|
|
4818
4853
|
);
|
|
4819
|
-
if (isAsyncWrapper(vnode) && !vnode.
|
|
4854
|
+
if (isAsyncWrapper(vnode) && !vnode.component.subTree) {
|
|
4820
4855
|
let subTree;
|
|
4821
4856
|
if (isFragmentStart) {
|
|
4822
|
-
subTree = createVNode(
|
|
4857
|
+
subTree = createVNode(Static);
|
|
4823
4858
|
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
4824
4859
|
} else {
|
|
4825
4860
|
subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
@@ -4954,6 +4989,9 @@ Server rendered element contains more child nodes than client vdom.`
|
|
|
4954
4989
|
}
|
|
4955
4990
|
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
|
|
4956
4991
|
key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
|
|
4992
|
+
if (isUnchangedResourceProp(el, key, props[key])) {
|
|
4993
|
+
continue;
|
|
4994
|
+
}
|
|
4957
4995
|
patchProp(el, key, null, props[key], namespace, parentComponent);
|
|
4958
4996
|
}
|
|
4959
4997
|
}
|
|
@@ -5147,6 +5185,13 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
5147
5185
|
};
|
|
5148
5186
|
return [hydrate, hydrateNode];
|
|
5149
5187
|
}
|
|
5188
|
+
const resourceProps = /* @__PURE__ */ new Set(["src", "srcset", "href", "poster"]);
|
|
5189
|
+
function isUnchangedResourceProp(el, key, clientValue) {
|
|
5190
|
+
if (!resourceProps.has(key)) {
|
|
5191
|
+
return false;
|
|
5192
|
+
}
|
|
5193
|
+
return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
|
|
5194
|
+
}
|
|
5150
5195
|
function propHasMismatch(el, key, clientValue, vnode, instance) {
|
|
5151
5196
|
let mismatchType;
|
|
5152
5197
|
let mismatchKey;
|
|
@@ -5184,7 +5229,10 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
|
|
|
5184
5229
|
mismatchKey = "style";
|
|
5185
5230
|
}
|
|
5186
5231
|
} else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
|
|
5187
|
-
if (
|
|
5232
|
+
if (key === "hidden") {
|
|
5233
|
+
actual = normalizeHiddenValue(el.getAttribute(key));
|
|
5234
|
+
expected = normalizeHiddenValue(clientValue);
|
|
5235
|
+
} else if (isBooleanAttr(key)) {
|
|
5188
5236
|
actual = el.hasAttribute(key);
|
|
5189
5237
|
expected = includeBooleanAttr(clientValue);
|
|
5190
5238
|
} else if (clientValue == null) {
|
|
@@ -5220,6 +5268,15 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
|
|
|
5220
5268
|
}
|
|
5221
5269
|
return false;
|
|
5222
5270
|
}
|
|
5271
|
+
function normalizeHiddenValue(value) {
|
|
5272
|
+
if (!isRenderableAttrValue(value)) {
|
|
5273
|
+
return false;
|
|
5274
|
+
}
|
|
5275
|
+
if (isString(value)) {
|
|
5276
|
+
return value.toLowerCase() === "until-found" ? "until-found" : "";
|
|
5277
|
+
}
|
|
5278
|
+
return includeBooleanAttr(value) ? "" : false;
|
|
5279
|
+
}
|
|
5223
5280
|
function toClassSet(str) {
|
|
5224
5281
|
return new Set(str.trim().split(/\s+/));
|
|
5225
5282
|
}
|
|
@@ -5718,7 +5775,10 @@ const KeepAliveImpl = {
|
|
|
5718
5775
|
if (pendingCacheKey != null) {
|
|
5719
5776
|
if (isSuspense(instance.subTree.type)) {
|
|
5720
5777
|
queuePostRenderEffect(() => {
|
|
5721
|
-
|
|
5778
|
+
const vnode = getInnerChild(instance.subTree);
|
|
5779
|
+
if (vnode.component) {
|
|
5780
|
+
cache.set(pendingCacheKey, vnode);
|
|
5781
|
+
}
|
|
5722
5782
|
}, instance.subTree.suspense);
|
|
5723
5783
|
} else {
|
|
5724
5784
|
cache.set(pendingCacheKey, getInnerChild(instance.subTree));
|
|
@@ -6330,7 +6390,8 @@ function createSlots(slots, dynamicSlots) {
|
|
|
6330
6390
|
return slots;
|
|
6331
6391
|
}
|
|
6332
6392
|
|
|
6333
|
-
function renderSlot(slots, name, props
|
|
6393
|
+
function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
6394
|
+
if (props == null) props = {};
|
|
6334
6395
|
if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
|
|
6335
6396
|
const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
|
|
6336
6397
|
const hasProps = Object.keys(slotProps).length > 0;
|
|
@@ -6638,12 +6699,41 @@ const getPublicInstance = (i) => {
|
|
|
6638
6699
|
if (isStatefulComponent(i)) return getComponentPublicInstance(i);
|
|
6639
6700
|
return getPublicInstance(i.parent);
|
|
6640
6701
|
};
|
|
6702
|
+
const resolveDevRootEl = (vnode) => {
|
|
6703
|
+
let found = false;
|
|
6704
|
+
while (true) {
|
|
6705
|
+
if (vnode.patchFlag > 0 && vnode.patchFlag & 2048) {
|
|
6706
|
+
const root = filterSingleRoot(vnode.children);
|
|
6707
|
+
if (!root) {
|
|
6708
|
+
return;
|
|
6709
|
+
}
|
|
6710
|
+
vnode = root;
|
|
6711
|
+
found = true;
|
|
6712
|
+
continue;
|
|
6713
|
+
}
|
|
6714
|
+
const component = vnode.component;
|
|
6715
|
+
if (component && component.subTree) {
|
|
6716
|
+
vnode = component.subTree;
|
|
6717
|
+
continue;
|
|
6718
|
+
}
|
|
6719
|
+
const suspense = vnode.suspense;
|
|
6720
|
+
if (suspense && suspense.activeBranch) {
|
|
6721
|
+
vnode = suspense.activeBranch;
|
|
6722
|
+
continue;
|
|
6723
|
+
}
|
|
6724
|
+
return found ? vnode.el : void 0;
|
|
6725
|
+
}
|
|
6726
|
+
};
|
|
6727
|
+
const getDevRootFragmentEl = (i) => {
|
|
6728
|
+
const el = i.subTree && resolveDevRootEl(i.subTree);
|
|
6729
|
+
return el === void 0 ? i.vnode.el : el;
|
|
6730
|
+
};
|
|
6641
6731
|
const publicPropertiesMap = (
|
|
6642
6732
|
// Move PURE marker to new line to workaround compiler discarding it
|
|
6643
6733
|
// due to type annotation
|
|
6644
6734
|
/* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
|
|
6645
6735
|
$: (i) => i,
|
|
6646
|
-
$el: (i) => i.vnode.el,
|
|
6736
|
+
$el: (i) => !!(process.env.NODE_ENV !== "production") ? getDevRootFragmentEl(i) : i.vnode.el,
|
|
6647
6737
|
$data: (i) => i.data,
|
|
6648
6738
|
$props: (i) => !!(process.env.NODE_ENV !== "production") ? shallowReadonly(i.props) : i.props,
|
|
6649
6739
|
$attrs: (i) => !!(process.env.NODE_ENV !== "production") ? shallowReadonly(i.attrs) : i.attrs,
|
|
@@ -7559,7 +7649,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
7559
7649
|
return vm;
|
|
7560
7650
|
}
|
|
7561
7651
|
}
|
|
7562
|
-
Vue.version = `2.6.14-compat:${"3.5.
|
|
7652
|
+
Vue.version = `2.6.14-compat:${"3.5.42"}`;
|
|
7563
7653
|
Vue.config = singletonApp.config;
|
|
7564
7654
|
Vue.use = (plugin, ...options) => {
|
|
7565
7655
|
if (plugin && isFunction(plugin.install)) {
|
|
@@ -8318,7 +8408,7 @@ function emit(instance, event, ...rawArgs) {
|
|
|
8318
8408
|
args = rawArgs.map((a) => isString(a) ? a.trim() : a);
|
|
8319
8409
|
}
|
|
8320
8410
|
if (modifiers.number) {
|
|
8321
|
-
args =
|
|
8411
|
+
args = args.map(looseToNumber);
|
|
8322
8412
|
}
|
|
8323
8413
|
}
|
|
8324
8414
|
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
@@ -8583,12 +8673,13 @@ function renderComponentRoot(instance) {
|
|
|
8583
8673
|
root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
|
|
8584
8674
|
}
|
|
8585
8675
|
if (vnode.transition) {
|
|
8586
|
-
|
|
8676
|
+
const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
|
|
8677
|
+
if (!!(process.env.NODE_ENV !== "production") && !isElementRoot(child)) {
|
|
8587
8678
|
warn$1(
|
|
8588
8679
|
`Component inside <Transition> renders non-element root node that cannot be animated.`
|
|
8589
8680
|
);
|
|
8590
8681
|
}
|
|
8591
|
-
setTransitionHooks(
|
|
8682
|
+
setTransitionHooks(child, vnode.transition);
|
|
8592
8683
|
}
|
|
8593
8684
|
if (!!(process.env.NODE_ENV !== "production") && setRoot) {
|
|
8594
8685
|
setRoot(root);
|
|
@@ -11132,7 +11223,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
11132
11223
|
if (suspense.deps <= 0) {
|
|
11133
11224
|
suspense.resolve();
|
|
11134
11225
|
} else if (isInFallback) {
|
|
11135
|
-
if (!isHydrating) {
|
|
11226
|
+
if (!isHydrating && !suspense.isFallbackMountPending) {
|
|
11136
11227
|
patch(
|
|
11137
11228
|
activeBranch,
|
|
11138
11229
|
newFallback,
|
|
@@ -11173,7 +11264,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
11173
11264
|
);
|
|
11174
11265
|
if (suspense.deps <= 0) {
|
|
11175
11266
|
suspense.resolve();
|
|
11176
|
-
} else {
|
|
11267
|
+
} else if (!suspense.isFallbackMountPending) {
|
|
11177
11268
|
patch(
|
|
11178
11269
|
activeBranch,
|
|
11179
11270
|
newFallback,
|
|
@@ -11380,7 +11471,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
11380
11471
|
let hasUnresolvedAncestor = false;
|
|
11381
11472
|
while (parent) {
|
|
11382
11473
|
if (parent.pendingBranch) {
|
|
11383
|
-
|
|
11474
|
+
for (let i = 0; i < effects.length; i++) {
|
|
11475
|
+
parent.effects.push(effects[i]);
|
|
11476
|
+
}
|
|
11384
11477
|
hasUnresolvedAncestor = true;
|
|
11385
11478
|
break;
|
|
11386
11479
|
}
|
|
@@ -11412,9 +11505,10 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
11412
11505
|
if (!suspense.isInFallback) {
|
|
11413
11506
|
return;
|
|
11414
11507
|
}
|
|
11508
|
+
const latestFallback = suspense.vnode.ssFallback;
|
|
11415
11509
|
patch(
|
|
11416
11510
|
null,
|
|
11417
|
-
|
|
11511
|
+
latestFallback,
|
|
11418
11512
|
container2,
|
|
11419
11513
|
anchor2,
|
|
11420
11514
|
parentComponent2,
|
|
@@ -11424,7 +11518,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
11424
11518
|
slotScopeIds,
|
|
11425
11519
|
optimized
|
|
11426
11520
|
);
|
|
11427
|
-
setActiveBranch(suspense,
|
|
11521
|
+
setActiveBranch(suspense, latestFallback);
|
|
11428
11522
|
};
|
|
11429
11523
|
const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
|
|
11430
11524
|
if (delayEnter) {
|
|
@@ -11802,6 +11896,14 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
11802
11896
|
if (!!(process.env.NODE_ENV !== "production") && vnode.key !== vnode.key) {
|
|
11803
11897
|
warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
|
|
11804
11898
|
}
|
|
11899
|
+
if (!!(process.env.NODE_ENV !== "production") && props && vnode.shapeFlag & 1) {
|
|
11900
|
+
const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
|
|
11901
|
+
if (overwritingProp && hasContentChildren(vnode.children)) {
|
|
11902
|
+
warn$1(
|
|
11903
|
+
`The \`${overwritingProp}\` prop on <${vnode.type}> will override its children. Remove either the \`${overwritingProp}\` prop or the children.`
|
|
11904
|
+
);
|
|
11905
|
+
}
|
|
11906
|
+
}
|
|
11805
11907
|
if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
|
|
11806
11908
|
!isBlockNode && // has current parent block
|
|
11807
11909
|
currentBlock && // presence of a patch flag indicates this node needs patching on updates.
|
|
@@ -11819,6 +11921,11 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
11819
11921
|
}
|
|
11820
11922
|
return vnode;
|
|
11821
11923
|
}
|
|
11924
|
+
function hasContentChildren(children) {
|
|
11925
|
+
if (isString(children)) return children !== "";
|
|
11926
|
+
if (isArray(children)) return children.length > 0;
|
|
11927
|
+
return false;
|
|
11928
|
+
}
|
|
11822
11929
|
const createVNode = !!(process.env.NODE_ENV !== "production") ? createVNodeWithArgsTransform : _createVNode;
|
|
11823
11930
|
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
|
|
11824
11931
|
if (!type || type === NULL_DYNAMIC_COMPONENT) {
|
|
@@ -12275,7 +12382,12 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
12275
12382
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
12276
12383
|
if (isSSR) {
|
|
12277
12384
|
return setupResult.then((resolvedResult) => {
|
|
12278
|
-
|
|
12385
|
+
setInSSRSetupState(true);
|
|
12386
|
+
try {
|
|
12387
|
+
handleSetupResult(instance, resolvedResult, isSSR);
|
|
12388
|
+
} finally {
|
|
12389
|
+
setInSSRSetupState(false);
|
|
12390
|
+
}
|
|
12279
12391
|
}).catch((e) => {
|
|
12280
12392
|
handleError(e, instance, 0);
|
|
12281
12393
|
});
|
|
@@ -12765,7 +12877,7 @@ function isMemoSame(cached, memo) {
|
|
|
12765
12877
|
return true;
|
|
12766
12878
|
}
|
|
12767
12879
|
|
|
12768
|
-
const version = "3.5.
|
|
12880
|
+
const version = "3.5.42";
|
|
12769
12881
|
const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
|
|
12770
12882
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
12771
12883
|
const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
|
|
@@ -13406,7 +13518,11 @@ function setStyle(style, name, val) {
|
|
|
13406
13518
|
}
|
|
13407
13519
|
}
|
|
13408
13520
|
if (name.startsWith("--")) {
|
|
13409
|
-
|
|
13521
|
+
if (importantRE.test(val)) {
|
|
13522
|
+
style.setProperty(name, val.replace(importantRE, ""), "important");
|
|
13523
|
+
} else {
|
|
13524
|
+
style.setProperty(name, val);
|
|
13525
|
+
}
|
|
13410
13526
|
} else {
|
|
13411
13527
|
const prefixed = autoPrefix(style, name);
|
|
13412
13528
|
if (importantRE.test(val)) {
|
|
@@ -13823,7 +13939,9 @@ class VueElement extends BaseClass {
|
|
|
13823
13939
|
if (parent && parent._pendingResolve) {
|
|
13824
13940
|
this._pendingResolve = parent._pendingResolve.then(() => {
|
|
13825
13941
|
this._pendingResolve = void 0;
|
|
13826
|
-
this.
|
|
13942
|
+
if (this.isConnected) {
|
|
13943
|
+
return this._resolveDef();
|
|
13944
|
+
}
|
|
13827
13945
|
});
|
|
13828
13946
|
} else {
|
|
13829
13947
|
this._resolveDef();
|
|
@@ -13873,7 +13991,7 @@ class VueElement extends BaseClass {
|
|
|
13873
13991
|
*/
|
|
13874
13992
|
_resolveDef() {
|
|
13875
13993
|
if (this._pendingResolve) {
|
|
13876
|
-
return;
|
|
13994
|
+
return this._pendingResolve;
|
|
13877
13995
|
}
|
|
13878
13996
|
for (let i = 0; i < this.attributes.length; i++) {
|
|
13879
13997
|
this._setAttr(this.attributes[i].name);
|
|
@@ -13913,6 +14031,7 @@ class VueElement extends BaseClass {
|
|
|
13913
14031
|
def.configureApp = this._def.configureApp;
|
|
13914
14032
|
resolve(this._def = def, true);
|
|
13915
14033
|
});
|
|
14034
|
+
return this._pendingResolve;
|
|
13916
14035
|
} else {
|
|
13917
14036
|
resolve(this._def);
|
|
13918
14037
|
}
|
|
@@ -13950,6 +14069,11 @@ class VueElement extends BaseClass {
|
|
|
13950
14069
|
}
|
|
13951
14070
|
}
|
|
13952
14071
|
for (const key of declaredPropKeys.map(camelize)) {
|
|
14072
|
+
if (!!(process.env.NODE_ENV !== "production") && key in Object.getPrototypeOf(this)) {
|
|
14073
|
+
warn(
|
|
14074
|
+
`Custom element prop "${key}" conflicts with an existing property on the element and will overwrite it.`
|
|
14075
|
+
);
|
|
14076
|
+
}
|
|
13953
14077
|
Object.defineProperty(this, key, {
|
|
13954
14078
|
get() {
|
|
13955
14079
|
return this._getProp(key);
|
|
@@ -14443,6 +14567,7 @@ function onCompositionEnd(e) {
|
|
|
14443
14567
|
}
|
|
14444
14568
|
}
|
|
14445
14569
|
const assignKey = /* @__PURE__ */ Symbol("_assign");
|
|
14570
|
+
const initialValueKey = /* @__PURE__ */ Symbol("_initialValue");
|
|
14446
14571
|
function castValue(value, trim, number) {
|
|
14447
14572
|
if (trim) value = value.trim();
|
|
14448
14573
|
if (number) value = looseToNumber(value);
|
|
@@ -14450,6 +14575,13 @@ function castValue(value, trim, number) {
|
|
|
14450
14575
|
}
|
|
14451
14576
|
const vModelText = {
|
|
14452
14577
|
created(el, { modifiers: { lazy, trim, number } }, vnode) {
|
|
14578
|
+
if (el.parentNode) {
|
|
14579
|
+
if (el.type === "text") {
|
|
14580
|
+
el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
|
|
14581
|
+
} else if (el.type === "textarea") {
|
|
14582
|
+
el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
|
|
14583
|
+
}
|
|
14584
|
+
}
|
|
14453
14585
|
el[assignKey] = getModelAssigner(vnode);
|
|
14454
14586
|
const castToNumber = number || vnode.props && vnode.props.type === "number";
|
|
14455
14587
|
addEventListener(el, lazy ? "change" : "input", (e) => {
|
|
@@ -14468,8 +14600,15 @@ const vModelText = {
|
|
|
14468
14600
|
}
|
|
14469
14601
|
},
|
|
14470
14602
|
// set value on mounted so it's after min/max for type="range"
|
|
14471
|
-
mounted(el, { value }) {
|
|
14472
|
-
|
|
14603
|
+
mounted(el, { value, modifiers: { trim, number } }) {
|
|
14604
|
+
const newValue = value == null ? "" : value;
|
|
14605
|
+
const initialValue = el[initialValueKey];
|
|
14606
|
+
delete el[initialValueKey];
|
|
14607
|
+
if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) {
|
|
14608
|
+
el[assignKey](castValue(el.value, trim, number));
|
|
14609
|
+
} else {
|
|
14610
|
+
el.value = newValue;
|
|
14611
|
+
}
|
|
14473
14612
|
},
|
|
14474
14613
|
beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
|
|
14475
14614
|
el[assignKey] = getModelAssigner(vnode);
|
|
@@ -14570,13 +14709,21 @@ const vModelSelect = {
|
|
|
14570
14709
|
const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
|
|
14571
14710
|
(o) => number ? looseToNumber(getValue(o)) : getValue(o)
|
|
14572
14711
|
);
|
|
14573
|
-
el
|
|
14574
|
-
|
|
14575
|
-
|
|
14576
|
-
|
|
14577
|
-
|
|
14578
|
-
|
|
14579
|
-
|
|
14712
|
+
const multiple = el.multiple;
|
|
14713
|
+
const assignedValue = multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0];
|
|
14714
|
+
const pending = el._pendingValue = [
|
|
14715
|
+
multiple,
|
|
14716
|
+
multiple ? isArray(assignedValue) ? selectedVal.slice() : selectedVal : assignedValue
|
|
14717
|
+
];
|
|
14718
|
+
try {
|
|
14719
|
+
el[assignKey](assignedValue);
|
|
14720
|
+
} finally {
|
|
14721
|
+
nextTick(() => {
|
|
14722
|
+
if (el._pendingValue === pending) {
|
|
14723
|
+
el._pendingValue = void 0;
|
|
14724
|
+
}
|
|
14725
|
+
});
|
|
14726
|
+
}
|
|
14580
14727
|
});
|
|
14581
14728
|
el[assignKey] = getModelAssigner(vnode);
|
|
14582
14729
|
},
|
|
@@ -14590,11 +14737,25 @@ const vModelSelect = {
|
|
|
14590
14737
|
el[assignKey] = getModelAssigner(vnode);
|
|
14591
14738
|
},
|
|
14592
14739
|
updated(el, { value }) {
|
|
14593
|
-
|
|
14740
|
+
const pending = el._pendingValue;
|
|
14741
|
+
el._pendingValue = void 0;
|
|
14742
|
+
if (!pending || pending[0] !== el.multiple || !isSameSelectValue(value, pending[1], pending[0])) {
|
|
14594
14743
|
setSelected(el, value);
|
|
14595
14744
|
}
|
|
14596
14745
|
}
|
|
14597
14746
|
};
|
|
14747
|
+
function isSameSelectValue(value, assignedValue, multiple) {
|
|
14748
|
+
if (!multiple) return looseEqual(value, assignedValue);
|
|
14749
|
+
if (isArray(value)) return looseEqual(value, assignedValue);
|
|
14750
|
+
if (isSet(value)) {
|
|
14751
|
+
if (value.size !== assignedValue.length) return false;
|
|
14752
|
+
for (const item of assignedValue) {
|
|
14753
|
+
if (!value.has(item)) return false;
|
|
14754
|
+
}
|
|
14755
|
+
return true;
|
|
14756
|
+
}
|
|
14757
|
+
return false;
|
|
14758
|
+
}
|
|
14598
14759
|
function setSelected(el, value) {
|
|
14599
14760
|
const isMultiple = el.multiple;
|
|
14600
14761
|
const isArrayValue = isArray(value);
|