@vue/runtime-dom 3.2.21 → 3.2.25
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 +10 -3
- package/dist/runtime-dom.cjs.prod.js +9 -2
- package/dist/runtime-dom.esm-browser.js +164 -118
- package/dist/runtime-dom.esm-browser.prod.js +1 -1
- package/dist/runtime-dom.esm-bundler.js +10 -3
- package/dist/runtime-dom.global.js +164 -118
- package/dist/runtime-dom.global.prod.js +1 -1
- package/package.json +3 -3
package/dist/runtime-dom.cjs.js
CHANGED
|
@@ -223,12 +223,19 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
|
|
|
223
223
|
el[key] = value == null ? '' : value;
|
|
224
224
|
return;
|
|
225
225
|
}
|
|
226
|
-
if (key === 'value' &&
|
|
226
|
+
if (key === 'value' &&
|
|
227
|
+
el.tagName !== 'PROGRESS' &&
|
|
228
|
+
// custom elements may use _value internally
|
|
229
|
+
!el.tagName.includes('-')) {
|
|
227
230
|
// store value as _value as well since
|
|
228
231
|
// non-string values will be stringified.
|
|
229
232
|
el._value = value;
|
|
230
233
|
const newValue = value == null ? '' : value;
|
|
231
|
-
if (el.value !== newValue
|
|
234
|
+
if (el.value !== newValue ||
|
|
235
|
+
// #4956: always set for OPTION elements because its value falls back to
|
|
236
|
+
// textContent if no value attribute is present. And setting .value for
|
|
237
|
+
// OPTION has no side effect
|
|
238
|
+
el.tagName === 'OPTION') {
|
|
232
239
|
el.value = newValue;
|
|
233
240
|
}
|
|
234
241
|
if (value == null) {
|
|
@@ -614,7 +621,7 @@ class VueElement extends BaseClass {
|
|
|
614
621
|
// HMR
|
|
615
622
|
{
|
|
616
623
|
instance.ceReload = newStyles => {
|
|
617
|
-
//
|
|
624
|
+
// always reset styles
|
|
618
625
|
if (this._styles) {
|
|
619
626
|
this._styles.forEach(s => this.shadowRoot.removeChild(s));
|
|
620
627
|
this._styles.length = 0;
|
|
@@ -223,12 +223,19 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
|
|
|
223
223
|
el[key] = value == null ? '' : value;
|
|
224
224
|
return;
|
|
225
225
|
}
|
|
226
|
-
if (key === 'value' &&
|
|
226
|
+
if (key === 'value' &&
|
|
227
|
+
el.tagName !== 'PROGRESS' &&
|
|
228
|
+
// custom elements may use _value internally
|
|
229
|
+
!el.tagName.includes('-')) {
|
|
227
230
|
// store value as _value as well since
|
|
228
231
|
// non-string values will be stringified.
|
|
229
232
|
el._value = value;
|
|
230
233
|
const newValue = value == null ? '' : value;
|
|
231
|
-
if (el.value !== newValue
|
|
234
|
+
if (el.value !== newValue ||
|
|
235
|
+
// #4956: always set for OPTION elements because its value falls back to
|
|
236
|
+
// textContent if no value attribute is present. And setting .value for
|
|
237
|
+
// OPTION has no side effect
|
|
238
|
+
el.tagName === 'OPTION') {
|
|
232
239
|
el.value = newValue;
|
|
233
240
|
}
|
|
234
241
|
if (value == null) {
|
|
@@ -34,7 +34,7 @@ const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomo
|
|
|
34
34
|
const isSpecialBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs);
|
|
35
35
|
/**
|
|
36
36
|
* Boolean attributes should be included if the value is truthy or ''.
|
|
37
|
-
* e.g.
|
|
37
|
+
* e.g. `<select multiple>` compiles to `{ multiple: '' }`
|
|
38
38
|
*/
|
|
39
39
|
function includeBooleanAttr(value) {
|
|
40
40
|
return !!value || value === '';
|
|
@@ -266,7 +266,7 @@ const isIntegerKey = (key) => isString(key) &&
|
|
|
266
266
|
'' + parseInt(key, 10) === key;
|
|
267
267
|
const isReservedProp = /*#__PURE__*/ makeMap(
|
|
268
268
|
// the leading comma is intentional so empty string "" is also included
|
|
269
|
-
',key,ref,' +
|
|
269
|
+
',key,ref,ref_for,ref_key,' +
|
|
270
270
|
'onVnodeBeforeMount,onVnodeMounted,' +
|
|
271
271
|
'onVnodeBeforeUpdate,onVnodeUpdated,' +
|
|
272
272
|
'onVnodeBeforeUnmount,onVnodeUnmounted');
|
|
@@ -455,7 +455,7 @@ const targetMap = new WeakMap();
|
|
|
455
455
|
let effectTrackDepth = 0;
|
|
456
456
|
let trackOpBit = 1;
|
|
457
457
|
/**
|
|
458
|
-
* The bitwise track markers support at most 30 levels
|
|
458
|
+
* The bitwise track markers support at most 30 levels of recursion.
|
|
459
459
|
* This value is chosen to enable modern JS engines to use a SMI on all platforms.
|
|
460
460
|
* When recursion depth is greater, fall back to using a full cleanup.
|
|
461
461
|
*/
|
|
@@ -776,7 +776,7 @@ const shallowSet = /*#__PURE__*/ createSetter(true);
|
|
|
776
776
|
function createSetter(shallow = false) {
|
|
777
777
|
return function set(target, key, value, receiver) {
|
|
778
778
|
let oldValue = target[key];
|
|
779
|
-
if (!shallow) {
|
|
779
|
+
if (!shallow && !isReadonly(value)) {
|
|
780
780
|
value = toRaw(value);
|
|
781
781
|
oldValue = toRaw(oldValue);
|
|
782
782
|
if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
|
|
@@ -1361,21 +1361,25 @@ function toRefs(object) {
|
|
|
1361
1361
|
return ret;
|
|
1362
1362
|
}
|
|
1363
1363
|
class ObjectRefImpl {
|
|
1364
|
-
constructor(_object, _key) {
|
|
1364
|
+
constructor(_object, _key, _defaultValue) {
|
|
1365
1365
|
this._object = _object;
|
|
1366
1366
|
this._key = _key;
|
|
1367
|
+
this._defaultValue = _defaultValue;
|
|
1367
1368
|
this.__v_isRef = true;
|
|
1368
1369
|
}
|
|
1369
1370
|
get value() {
|
|
1370
|
-
|
|
1371
|
+
const val = this._object[this._key];
|
|
1372
|
+
return val === undefined ? this._defaultValue : val;
|
|
1371
1373
|
}
|
|
1372
1374
|
set value(newVal) {
|
|
1373
1375
|
this._object[this._key] = newVal;
|
|
1374
1376
|
}
|
|
1375
1377
|
}
|
|
1376
|
-
function toRef(object, key) {
|
|
1378
|
+
function toRef(object, key, defaultValue) {
|
|
1377
1379
|
const val = object[key];
|
|
1378
|
-
return isRef(val)
|
|
1380
|
+
return isRef(val)
|
|
1381
|
+
? val
|
|
1382
|
+
: new ObjectRefImpl(object, key, defaultValue);
|
|
1379
1383
|
}
|
|
1380
1384
|
|
|
1381
1385
|
class ComputedRefImpl {
|
|
@@ -1582,6 +1586,7 @@ function emit(event, ...args) {
|
|
|
1582
1586
|
}
|
|
1583
1587
|
}
|
|
1584
1588
|
function setDevtoolsHook(hook, target) {
|
|
1589
|
+
var _a, _b;
|
|
1585
1590
|
devtools = hook;
|
|
1586
1591
|
if (devtools) {
|
|
1587
1592
|
devtools.enabled = true;
|
|
@@ -1594,7 +1599,10 @@ function setDevtoolsHook(hook, target) {
|
|
|
1594
1599
|
// (#4815)
|
|
1595
1600
|
// eslint-disable-next-line no-restricted-globals
|
|
1596
1601
|
typeof window !== 'undefined' &&
|
|
1597
|
-
|
|
1602
|
+
// some envs mock window but not fully
|
|
1603
|
+
window.HTMLElement &&
|
|
1604
|
+
// also exclude jsdom
|
|
1605
|
+
!((_b = (_a = window.navigator) === null || _a === void 0 ? void 0 : _a.userAgent) === null || _b === void 0 ? void 0 : _b.includes('jsdom'))) {
|
|
1598
1606
|
const replay = (target.__VUE_DEVTOOLS_HOOK_REPLAY__ =
|
|
1599
1607
|
target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []);
|
|
1600
1608
|
replay.push((newHook) => {
|
|
@@ -2688,7 +2696,8 @@ const BaseTransitionImpl = {
|
|
|
2688
2696
|
const rawProps = toRaw(props);
|
|
2689
2697
|
const { mode } = rawProps;
|
|
2690
2698
|
// check mode
|
|
2691
|
-
if (mode &&
|
|
2699
|
+
if (mode &&
|
|
2700
|
+
mode !== 'in-out' && mode !== 'out-in' && mode !== 'default') {
|
|
2692
2701
|
warn$1(`invalid <transition> mode: ${mode}`);
|
|
2693
2702
|
}
|
|
2694
2703
|
// at this point children has a guaranteed length of 1.
|
|
@@ -3328,7 +3337,7 @@ function registerKeepAliveHook(hook, type, target = currentInstance) {
|
|
|
3328
3337
|
}
|
|
3329
3338
|
current = current.parent;
|
|
3330
3339
|
}
|
|
3331
|
-
hook();
|
|
3340
|
+
return hook();
|
|
3332
3341
|
});
|
|
3333
3342
|
injectHook(type, wrappedHook, target);
|
|
3334
3343
|
// In addition to registering it on the target instance, we walk up the parent
|
|
@@ -3990,7 +3999,7 @@ function setFullProps(instance, rawProps, props, attrs) {
|
|
|
3990
3999
|
}
|
|
3991
4000
|
}
|
|
3992
4001
|
else if (!isEmitListener(instance.emitsOptions, key)) {
|
|
3993
|
-
if (value !== attrs[key]) {
|
|
4002
|
+
if (!(key in attrs) || value !== attrs[key]) {
|
|
3994
4003
|
attrs[key] = value;
|
|
3995
4004
|
hasAttrsChanged = true;
|
|
3996
4005
|
}
|
|
@@ -4630,6 +4639,102 @@ function createAppAPI(render, hydrate) {
|
|
|
4630
4639
|
};
|
|
4631
4640
|
}
|
|
4632
4641
|
|
|
4642
|
+
/**
|
|
4643
|
+
* Function for handling a template ref
|
|
4644
|
+
*/
|
|
4645
|
+
function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
4646
|
+
if (isArray(rawRef)) {
|
|
4647
|
+
rawRef.forEach((r, i) => setRef(r, oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), parentSuspense, vnode, isUnmount));
|
|
4648
|
+
return;
|
|
4649
|
+
}
|
|
4650
|
+
if (isAsyncWrapper(vnode) && !isUnmount) {
|
|
4651
|
+
// when mounting async components, nothing needs to be done,
|
|
4652
|
+
// because the template ref is forwarded to inner component
|
|
4653
|
+
return;
|
|
4654
|
+
}
|
|
4655
|
+
const refValue = vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */
|
|
4656
|
+
? getExposeProxy(vnode.component) || vnode.component.proxy
|
|
4657
|
+
: vnode.el;
|
|
4658
|
+
const value = isUnmount ? null : refValue;
|
|
4659
|
+
const { i: owner, r: ref } = rawRef;
|
|
4660
|
+
if (!owner) {
|
|
4661
|
+
warn$1(`Missing ref owner context. ref cannot be used on hoisted vnodes. ` +
|
|
4662
|
+
`A vnode with ref must be created inside the render function.`);
|
|
4663
|
+
return;
|
|
4664
|
+
}
|
|
4665
|
+
const oldRef = oldRawRef && oldRawRef.r;
|
|
4666
|
+
const refs = owner.refs === EMPTY_OBJ ? (owner.refs = {}) : owner.refs;
|
|
4667
|
+
const setupState = owner.setupState;
|
|
4668
|
+
// dynamic ref changed. unset old ref
|
|
4669
|
+
if (oldRef != null && oldRef !== ref) {
|
|
4670
|
+
if (isString(oldRef)) {
|
|
4671
|
+
refs[oldRef] = null;
|
|
4672
|
+
if (hasOwn(setupState, oldRef)) {
|
|
4673
|
+
setupState[oldRef] = null;
|
|
4674
|
+
}
|
|
4675
|
+
}
|
|
4676
|
+
else if (isRef(oldRef)) {
|
|
4677
|
+
oldRef.value = null;
|
|
4678
|
+
}
|
|
4679
|
+
}
|
|
4680
|
+
if (isFunction(ref)) {
|
|
4681
|
+
callWithErrorHandling(ref, owner, 12 /* FUNCTION_REF */, [value, refs]);
|
|
4682
|
+
}
|
|
4683
|
+
else {
|
|
4684
|
+
const _isString = isString(ref);
|
|
4685
|
+
const _isRef = isRef(ref);
|
|
4686
|
+
if (_isString || _isRef) {
|
|
4687
|
+
const doSet = () => {
|
|
4688
|
+
if (rawRef.f) {
|
|
4689
|
+
const existing = _isString ? refs[ref] : ref.value;
|
|
4690
|
+
if (isUnmount) {
|
|
4691
|
+
isArray(existing) && remove(existing, refValue);
|
|
4692
|
+
}
|
|
4693
|
+
else {
|
|
4694
|
+
if (!isArray(existing)) {
|
|
4695
|
+
if (_isString) {
|
|
4696
|
+
refs[ref] = [refValue];
|
|
4697
|
+
}
|
|
4698
|
+
else {
|
|
4699
|
+
ref.value = [refValue];
|
|
4700
|
+
if (rawRef.k)
|
|
4701
|
+
refs[rawRef.k] = ref.value;
|
|
4702
|
+
}
|
|
4703
|
+
}
|
|
4704
|
+
else if (!existing.includes(refValue)) {
|
|
4705
|
+
existing.push(refValue);
|
|
4706
|
+
}
|
|
4707
|
+
}
|
|
4708
|
+
}
|
|
4709
|
+
else if (_isString) {
|
|
4710
|
+
refs[ref] = value;
|
|
4711
|
+
if (hasOwn(setupState, ref)) {
|
|
4712
|
+
setupState[ref] = value;
|
|
4713
|
+
}
|
|
4714
|
+
}
|
|
4715
|
+
else if (isRef(ref)) {
|
|
4716
|
+
ref.value = value;
|
|
4717
|
+
if (rawRef.k)
|
|
4718
|
+
refs[rawRef.k] = value;
|
|
4719
|
+
}
|
|
4720
|
+
else {
|
|
4721
|
+
warn$1('Invalid template ref type:', ref, `(${typeof ref})`);
|
|
4722
|
+
}
|
|
4723
|
+
};
|
|
4724
|
+
if (value) {
|
|
4725
|
+
doSet.id = -1;
|
|
4726
|
+
queuePostRenderEffect(doSet, parentSuspense);
|
|
4727
|
+
}
|
|
4728
|
+
else {
|
|
4729
|
+
doSet();
|
|
4730
|
+
}
|
|
4731
|
+
}
|
|
4732
|
+
else {
|
|
4733
|
+
warn$1('Invalid template ref type:', ref, `(${typeof ref})`);
|
|
4734
|
+
}
|
|
4735
|
+
}
|
|
4736
|
+
}
|
|
4737
|
+
|
|
4633
4738
|
let hasMismatch = false;
|
|
4634
4739
|
const isSVGContainer = (container) => /svg/.test(container.namespaceURI) && container.tagName !== 'foreignObject';
|
|
4635
4740
|
const isComment = (node) => node.nodeType === 8 /* COMMENT */;
|
|
@@ -5262,12 +5367,15 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5262
5367
|
const oldProps = n1.props || EMPTY_OBJ;
|
|
5263
5368
|
const newProps = n2.props || EMPTY_OBJ;
|
|
5264
5369
|
let vnodeHook;
|
|
5370
|
+
// disable recurse in beforeUpdate hooks
|
|
5371
|
+
parentComponent && toggleRecurse(parentComponent, false);
|
|
5265
5372
|
if ((vnodeHook = newProps.onVnodeBeforeUpdate)) {
|
|
5266
5373
|
invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
5267
5374
|
}
|
|
5268
5375
|
if (dirs) {
|
|
5269
5376
|
invokeDirectiveHook(n2, n1, parentComponent, 'beforeUpdate');
|
|
5270
5377
|
}
|
|
5378
|
+
parentComponent && toggleRecurse(parentComponent, true);
|
|
5271
5379
|
if (isHmrUpdating) {
|
|
5272
5380
|
// HMR updated, force full diff
|
|
5273
5381
|
patchFlag = 0;
|
|
@@ -5547,7 +5655,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5547
5655
|
const { el, props } = initialVNode;
|
|
5548
5656
|
const { bm, m, parent } = instance;
|
|
5549
5657
|
const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
|
|
5550
|
-
|
|
5658
|
+
toggleRecurse(instance, false);
|
|
5551
5659
|
// beforeMount hook
|
|
5552
5660
|
if (bm) {
|
|
5553
5661
|
invokeArrayFns(bm);
|
|
@@ -5557,7 +5665,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5557
5665
|
(vnodeHook = props && props.onVnodeBeforeMount)) {
|
|
5558
5666
|
invokeVNodeHook(vnodeHook, parent, initialVNode);
|
|
5559
5667
|
}
|
|
5560
|
-
|
|
5668
|
+
toggleRecurse(instance, true);
|
|
5561
5669
|
if (el && hydrateNode) {
|
|
5562
5670
|
// vnode has adopted host node - perform hydration instead of mount.
|
|
5563
5671
|
const hydrateSubTree = () => {
|
|
@@ -5639,7 +5747,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5639
5747
|
pushWarningContext(next || instance.vnode);
|
|
5640
5748
|
}
|
|
5641
5749
|
// Disallow component effect recursion during pre-lifecycle hooks.
|
|
5642
|
-
|
|
5750
|
+
toggleRecurse(instance, false);
|
|
5643
5751
|
if (next) {
|
|
5644
5752
|
next.el = vnode.el;
|
|
5645
5753
|
updateComponentPreRender(instance, next, optimized);
|
|
@@ -5655,7 +5763,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5655
5763
|
if ((vnodeHook = next.props && next.props.onVnodeBeforeUpdate)) {
|
|
5656
5764
|
invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
5657
5765
|
}
|
|
5658
|
-
|
|
5766
|
+
toggleRecurse(instance, true);
|
|
5659
5767
|
// render
|
|
5660
5768
|
{
|
|
5661
5769
|
startMeasure(instance, `render`);
|
|
@@ -5701,13 +5809,13 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5701
5809
|
}
|
|
5702
5810
|
};
|
|
5703
5811
|
// create reactive effect for rendering
|
|
5704
|
-
const effect = new ReactiveEffect(componentUpdateFn, () => queueJob(instance.update), instance.scope // track it in component's effect scope
|
|
5705
|
-
);
|
|
5812
|
+
const effect = (instance.effect = new ReactiveEffect(componentUpdateFn, () => queueJob(instance.update), instance.scope // track it in component's effect scope
|
|
5813
|
+
));
|
|
5706
5814
|
const update = (instance.update = effect.run.bind(effect));
|
|
5707
5815
|
update.id = instance.uid;
|
|
5708
5816
|
// allowRecurse
|
|
5709
5817
|
// #1801, #2043 component render effects should allow recursive updates
|
|
5710
|
-
|
|
5818
|
+
toggleRecurse(instance, true);
|
|
5711
5819
|
{
|
|
5712
5820
|
effect.onTrack = instance.rtc
|
|
5713
5821
|
? e => invokeArrayFns(instance.rtc, e)
|
|
@@ -6231,85 +6339,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6231
6339
|
createApp: createAppAPI(render, hydrate)
|
|
6232
6340
|
};
|
|
6233
6341
|
}
|
|
6234
|
-
function
|
|
6235
|
-
|
|
6236
|
-
rawRef.forEach((r, i) => setRef(r, oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), parentSuspense, vnode, isUnmount));
|
|
6237
|
-
return;
|
|
6238
|
-
}
|
|
6239
|
-
if (isAsyncWrapper(vnode) && !isUnmount) {
|
|
6240
|
-
// when mounting async components, nothing needs to be done,
|
|
6241
|
-
// because the template ref is forwarded to inner component
|
|
6242
|
-
return;
|
|
6243
|
-
}
|
|
6244
|
-
const refValue = vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */
|
|
6245
|
-
? getExposeProxy(vnode.component) || vnode.component.proxy
|
|
6246
|
-
: vnode.el;
|
|
6247
|
-
const value = isUnmount ? null : refValue;
|
|
6248
|
-
const { i: owner, r: ref } = rawRef;
|
|
6249
|
-
if (!owner) {
|
|
6250
|
-
warn$1(`Missing ref owner context. ref cannot be used on hoisted vnodes. ` +
|
|
6251
|
-
`A vnode with ref must be created inside the render function.`);
|
|
6252
|
-
return;
|
|
6253
|
-
}
|
|
6254
|
-
const oldRef = oldRawRef && oldRawRef.r;
|
|
6255
|
-
const refs = owner.refs === EMPTY_OBJ ? (owner.refs = {}) : owner.refs;
|
|
6256
|
-
const setupState = owner.setupState;
|
|
6257
|
-
// dynamic ref changed. unset old ref
|
|
6258
|
-
if (oldRef != null && oldRef !== ref) {
|
|
6259
|
-
if (isString(oldRef)) {
|
|
6260
|
-
refs[oldRef] = null;
|
|
6261
|
-
if (hasOwn(setupState, oldRef)) {
|
|
6262
|
-
setupState[oldRef] = null;
|
|
6263
|
-
}
|
|
6264
|
-
}
|
|
6265
|
-
else if (isRef(oldRef)) {
|
|
6266
|
-
oldRef.value = null;
|
|
6267
|
-
}
|
|
6268
|
-
}
|
|
6269
|
-
if (isString(ref)) {
|
|
6270
|
-
const doSet = () => {
|
|
6271
|
-
{
|
|
6272
|
-
refs[ref] = value;
|
|
6273
|
-
}
|
|
6274
|
-
if (hasOwn(setupState, ref)) {
|
|
6275
|
-
setupState[ref] = value;
|
|
6276
|
-
}
|
|
6277
|
-
};
|
|
6278
|
-
// #1789: for non-null values, set them after render
|
|
6279
|
-
// null values means this is unmount and it should not overwrite another
|
|
6280
|
-
// ref with the same key
|
|
6281
|
-
if (value) {
|
|
6282
|
-
doSet.id = -1;
|
|
6283
|
-
queuePostRenderEffect(doSet, parentSuspense);
|
|
6284
|
-
}
|
|
6285
|
-
else {
|
|
6286
|
-
doSet();
|
|
6287
|
-
}
|
|
6288
|
-
}
|
|
6289
|
-
else if (isRef(ref)) {
|
|
6290
|
-
const doSet = () => {
|
|
6291
|
-
ref.value = value;
|
|
6292
|
-
};
|
|
6293
|
-
if (value) {
|
|
6294
|
-
doSet.id = -1;
|
|
6295
|
-
queuePostRenderEffect(doSet, parentSuspense);
|
|
6296
|
-
}
|
|
6297
|
-
else {
|
|
6298
|
-
doSet();
|
|
6299
|
-
}
|
|
6300
|
-
}
|
|
6301
|
-
else if (isFunction(ref)) {
|
|
6302
|
-
callWithErrorHandling(ref, owner, 12 /* FUNCTION_REF */, [value, refs]);
|
|
6303
|
-
}
|
|
6304
|
-
else {
|
|
6305
|
-
warn$1('Invalid template ref type:', value, `(${typeof value})`);
|
|
6306
|
-
}
|
|
6307
|
-
}
|
|
6308
|
-
function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
6309
|
-
callWithAsyncErrorHandling(hook, instance, 7 /* VNODE_HOOK */, [
|
|
6310
|
-
vnode,
|
|
6311
|
-
prevVNode
|
|
6312
|
-
]);
|
|
6342
|
+
function toggleRecurse({ effect, update }, allowed) {
|
|
6343
|
+
effect.allowRecurse = update.allowRecurse = allowed;
|
|
6313
6344
|
}
|
|
6314
6345
|
/**
|
|
6315
6346
|
* #1156
|
|
@@ -6319,8 +6350,8 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
|
6319
6350
|
*
|
|
6320
6351
|
* #2080
|
|
6321
6352
|
* Inside keyed `template` fragment static children, if a fragment is moved,
|
|
6322
|
-
* the children will always moved
|
|
6323
|
-
*
|
|
6353
|
+
* the children will always be moved. Therefore, in order to ensure correct move
|
|
6354
|
+
* position, el should be inherited from previous nodes.
|
|
6324
6355
|
*/
|
|
6325
6356
|
function traverseStaticChildren(n1, n2, shallow = false) {
|
|
6326
6357
|
const ch1 = n1.children;
|
|
@@ -6768,10 +6799,10 @@ const createVNodeWithArgsTransform = (...args) => {
|
|
|
6768
6799
|
};
|
|
6769
6800
|
const InternalObjectKey = `__vInternal`;
|
|
6770
6801
|
const normalizeKey = ({ key }) => key != null ? key : null;
|
|
6771
|
-
const normalizeRef = ({ ref }) => {
|
|
6802
|
+
const normalizeRef = ({ ref, ref_key, ref_for }) => {
|
|
6772
6803
|
return (ref != null
|
|
6773
6804
|
? isString(ref) || isRef(ref) || isFunction(ref)
|
|
6774
|
-
? { i: currentRenderingInstance, r: ref }
|
|
6805
|
+
? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for }
|
|
6775
6806
|
: ref
|
|
6776
6807
|
: null);
|
|
6777
6808
|
};
|
|
@@ -7100,7 +7131,8 @@ function mergeProps(...args) {
|
|
|
7100
7131
|
else if (isOn(key)) {
|
|
7101
7132
|
const existing = ret[key];
|
|
7102
7133
|
const incoming = toMerge[key];
|
|
7103
|
-
if (existing !== incoming
|
|
7134
|
+
if (existing !== incoming &&
|
|
7135
|
+
!(isArray(existing) && existing.includes(incoming))) {
|
|
7104
7136
|
ret[key] = existing
|
|
7105
7137
|
? [].concat(existing, incoming)
|
|
7106
7138
|
: incoming;
|
|
@@ -7112,6 +7144,12 @@ function mergeProps(...args) {
|
|
|
7112
7144
|
}
|
|
7113
7145
|
}
|
|
7114
7146
|
return ret;
|
|
7147
|
+
}
|
|
7148
|
+
function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
7149
|
+
callWithAsyncErrorHandling(hook, instance, 7 /* VNODE_HOOK */, [
|
|
7150
|
+
vnode,
|
|
7151
|
+
prevVNode
|
|
7152
|
+
]);
|
|
7115
7153
|
}
|
|
7116
7154
|
|
|
7117
7155
|
/**
|
|
@@ -7303,23 +7341,23 @@ const PublicInstanceProxyHandlers = {
|
|
|
7303
7341
|
const n = accessCache[key];
|
|
7304
7342
|
if (n !== undefined) {
|
|
7305
7343
|
switch (n) {
|
|
7306
|
-
case
|
|
7344
|
+
case 1 /* SETUP */:
|
|
7307
7345
|
return setupState[key];
|
|
7308
|
-
case
|
|
7346
|
+
case 2 /* DATA */:
|
|
7309
7347
|
return data[key];
|
|
7310
|
-
case
|
|
7348
|
+
case 4 /* CONTEXT */:
|
|
7311
7349
|
return ctx[key];
|
|
7312
|
-
case
|
|
7350
|
+
case 3 /* PROPS */:
|
|
7313
7351
|
return props[key];
|
|
7314
7352
|
// default: just fallthrough
|
|
7315
7353
|
}
|
|
7316
7354
|
}
|
|
7317
7355
|
else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
|
|
7318
|
-
accessCache[key] =
|
|
7356
|
+
accessCache[key] = 1 /* SETUP */;
|
|
7319
7357
|
return setupState[key];
|
|
7320
7358
|
}
|
|
7321
7359
|
else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
7322
|
-
accessCache[key] =
|
|
7360
|
+
accessCache[key] = 2 /* DATA */;
|
|
7323
7361
|
return data[key];
|
|
7324
7362
|
}
|
|
7325
7363
|
else if (
|
|
@@ -7327,15 +7365,15 @@ const PublicInstanceProxyHandlers = {
|
|
|
7327
7365
|
// props
|
|
7328
7366
|
(normalizedProps = instance.propsOptions[0]) &&
|
|
7329
7367
|
hasOwn(normalizedProps, key)) {
|
|
7330
|
-
accessCache[key] =
|
|
7368
|
+
accessCache[key] = 3 /* PROPS */;
|
|
7331
7369
|
return props[key];
|
|
7332
7370
|
}
|
|
7333
7371
|
else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
7334
|
-
accessCache[key] =
|
|
7372
|
+
accessCache[key] = 4 /* CONTEXT */;
|
|
7335
7373
|
return ctx[key];
|
|
7336
7374
|
}
|
|
7337
7375
|
else if (shouldCacheAccess) {
|
|
7338
|
-
accessCache[key] =
|
|
7376
|
+
accessCache[key] = 0 /* OTHER */;
|
|
7339
7377
|
}
|
|
7340
7378
|
}
|
|
7341
7379
|
const publicGetter = publicPropertiesMap[key];
|
|
@@ -7356,7 +7394,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
7356
7394
|
}
|
|
7357
7395
|
else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
7358
7396
|
// user may set custom properties to `this` that start with `$`
|
|
7359
|
-
accessCache[key] =
|
|
7397
|
+
accessCache[key] = 4 /* CONTEXT */;
|
|
7360
7398
|
return ctx[key];
|
|
7361
7399
|
}
|
|
7362
7400
|
else if (
|
|
@@ -7417,7 +7455,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
7417
7455
|
},
|
|
7418
7456
|
has({ _: { data, setupState, accessCache, ctx, appContext, propsOptions } }, key) {
|
|
7419
7457
|
let normalizedProps;
|
|
7420
|
-
return (accessCache[key]
|
|
7458
|
+
return (!!accessCache[key] ||
|
|
7421
7459
|
(data !== EMPTY_OBJ && hasOwn(data, key)) ||
|
|
7422
7460
|
(setupState !== EMPTY_OBJ && hasOwn(setupState, key)) ||
|
|
7423
7461
|
((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||
|
|
@@ -7523,6 +7561,7 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
7523
7561
|
root: null,
|
|
7524
7562
|
next: null,
|
|
7525
7563
|
subTree: null,
|
|
7564
|
+
effect: null,
|
|
7526
7565
|
update: null,
|
|
7527
7566
|
scope: new EffectScope(true /* detached */),
|
|
7528
7567
|
render: null,
|
|
@@ -8964,7 +9003,7 @@ function isMemoSame(cached, memo) {
|
|
|
8964
9003
|
}
|
|
8965
9004
|
|
|
8966
9005
|
// Core API ------------------------------------------------------------------
|
|
8967
|
-
const version = "3.2.
|
|
9006
|
+
const version = "3.2.25";
|
|
8968
9007
|
/**
|
|
8969
9008
|
* SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
|
|
8970
9009
|
* @internal
|
|
@@ -9197,12 +9236,19 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
|
|
|
9197
9236
|
el[key] = value == null ? '' : value;
|
|
9198
9237
|
return;
|
|
9199
9238
|
}
|
|
9200
|
-
if (key === 'value' &&
|
|
9239
|
+
if (key === 'value' &&
|
|
9240
|
+
el.tagName !== 'PROGRESS' &&
|
|
9241
|
+
// custom elements may use _value internally
|
|
9242
|
+
!el.tagName.includes('-')) {
|
|
9201
9243
|
// store value as _value as well since
|
|
9202
9244
|
// non-string values will be stringified.
|
|
9203
9245
|
el._value = value;
|
|
9204
9246
|
const newValue = value == null ? '' : value;
|
|
9205
|
-
if (el.value !== newValue
|
|
9247
|
+
if (el.value !== newValue ||
|
|
9248
|
+
// #4956: always set for OPTION elements because its value falls back to
|
|
9249
|
+
// textContent if no value attribute is present. And setting .value for
|
|
9250
|
+
// OPTION has no side effect
|
|
9251
|
+
el.tagName === 'OPTION') {
|
|
9206
9252
|
el.value = newValue;
|
|
9207
9253
|
}
|
|
9208
9254
|
if (value == null) {
|
|
@@ -9588,7 +9634,7 @@ class VueElement extends BaseClass {
|
|
|
9588
9634
|
// HMR
|
|
9589
9635
|
{
|
|
9590
9636
|
instance.ceReload = newStyles => {
|
|
9591
|
-
//
|
|
9637
|
+
// always reset styles
|
|
9592
9638
|
if (this._styles) {
|
|
9593
9639
|
this._styles.forEach(s => this.shadowRoot.removeChild(s));
|
|
9594
9640
|
this._styles.length = 0;
|