@vue/runtime-dom 3.2.22 → 3.2.26
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 +155 -114
- 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 +155 -114
- 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 {
|
|
@@ -2692,7 +2696,8 @@ const BaseTransitionImpl = {
|
|
|
2692
2696
|
const rawProps = toRaw(props);
|
|
2693
2697
|
const { mode } = rawProps;
|
|
2694
2698
|
// check mode
|
|
2695
|
-
if (mode &&
|
|
2699
|
+
if (mode &&
|
|
2700
|
+
mode !== 'in-out' && mode !== 'out-in' && mode !== 'default') {
|
|
2696
2701
|
warn$1(`invalid <transition> mode: ${mode}`);
|
|
2697
2702
|
}
|
|
2698
2703
|
// at this point children has a guaranteed length of 1.
|
|
@@ -3332,7 +3337,7 @@ function registerKeepAliveHook(hook, type, target = currentInstance) {
|
|
|
3332
3337
|
}
|
|
3333
3338
|
current = current.parent;
|
|
3334
3339
|
}
|
|
3335
|
-
hook();
|
|
3340
|
+
return hook();
|
|
3336
3341
|
});
|
|
3337
3342
|
injectHook(type, wrappedHook, target);
|
|
3338
3343
|
// In addition to registering it on the target instance, we walk up the parent
|
|
@@ -3994,7 +3999,7 @@ function setFullProps(instance, rawProps, props, attrs) {
|
|
|
3994
3999
|
}
|
|
3995
4000
|
}
|
|
3996
4001
|
else if (!isEmitListener(instance.emitsOptions, key)) {
|
|
3997
|
-
if (value !== attrs[key]) {
|
|
4002
|
+
if (!(key in attrs) || value !== attrs[key]) {
|
|
3998
4003
|
attrs[key] = value;
|
|
3999
4004
|
hasAttrsChanged = true;
|
|
4000
4005
|
}
|
|
@@ -4634,6 +4639,102 @@ function createAppAPI(render, hydrate) {
|
|
|
4634
4639
|
};
|
|
4635
4640
|
}
|
|
4636
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
|
+
|
|
4637
4738
|
let hasMismatch = false;
|
|
4638
4739
|
const isSVGContainer = (container) => /svg/.test(container.namespaceURI) && container.tagName !== 'foreignObject';
|
|
4639
4740
|
const isComment = (node) => node.nodeType === 8 /* COMMENT */;
|
|
@@ -5266,12 +5367,15 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5266
5367
|
const oldProps = n1.props || EMPTY_OBJ;
|
|
5267
5368
|
const newProps = n2.props || EMPTY_OBJ;
|
|
5268
5369
|
let vnodeHook;
|
|
5370
|
+
// disable recurse in beforeUpdate hooks
|
|
5371
|
+
parentComponent && toggleRecurse(parentComponent, false);
|
|
5269
5372
|
if ((vnodeHook = newProps.onVnodeBeforeUpdate)) {
|
|
5270
5373
|
invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
5271
5374
|
}
|
|
5272
5375
|
if (dirs) {
|
|
5273
5376
|
invokeDirectiveHook(n2, n1, parentComponent, 'beforeUpdate');
|
|
5274
5377
|
}
|
|
5378
|
+
parentComponent && toggleRecurse(parentComponent, true);
|
|
5275
5379
|
if (isHmrUpdating) {
|
|
5276
5380
|
// HMR updated, force full diff
|
|
5277
5381
|
patchFlag = 0;
|
|
@@ -5551,7 +5655,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5551
5655
|
const { el, props } = initialVNode;
|
|
5552
5656
|
const { bm, m, parent } = instance;
|
|
5553
5657
|
const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
|
|
5554
|
-
|
|
5658
|
+
toggleRecurse(instance, false);
|
|
5555
5659
|
// beforeMount hook
|
|
5556
5660
|
if (bm) {
|
|
5557
5661
|
invokeArrayFns(bm);
|
|
@@ -5561,7 +5665,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5561
5665
|
(vnodeHook = props && props.onVnodeBeforeMount)) {
|
|
5562
5666
|
invokeVNodeHook(vnodeHook, parent, initialVNode);
|
|
5563
5667
|
}
|
|
5564
|
-
|
|
5668
|
+
toggleRecurse(instance, true);
|
|
5565
5669
|
if (el && hydrateNode) {
|
|
5566
5670
|
// vnode has adopted host node - perform hydration instead of mount.
|
|
5567
5671
|
const hydrateSubTree = () => {
|
|
@@ -5643,7 +5747,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5643
5747
|
pushWarningContext(next || instance.vnode);
|
|
5644
5748
|
}
|
|
5645
5749
|
// Disallow component effect recursion during pre-lifecycle hooks.
|
|
5646
|
-
|
|
5750
|
+
toggleRecurse(instance, false);
|
|
5647
5751
|
if (next) {
|
|
5648
5752
|
next.el = vnode.el;
|
|
5649
5753
|
updateComponentPreRender(instance, next, optimized);
|
|
@@ -5659,7 +5763,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5659
5763
|
if ((vnodeHook = next.props && next.props.onVnodeBeforeUpdate)) {
|
|
5660
5764
|
invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
5661
5765
|
}
|
|
5662
|
-
|
|
5766
|
+
toggleRecurse(instance, true);
|
|
5663
5767
|
// render
|
|
5664
5768
|
{
|
|
5665
5769
|
startMeasure(instance, `render`);
|
|
@@ -5705,13 +5809,13 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5705
5809
|
}
|
|
5706
5810
|
};
|
|
5707
5811
|
// create reactive effect for rendering
|
|
5708
|
-
const effect = new ReactiveEffect(componentUpdateFn, () => queueJob(instance.update), instance.scope // track it in component's effect scope
|
|
5709
|
-
);
|
|
5812
|
+
const effect = (instance.effect = new ReactiveEffect(componentUpdateFn, () => queueJob(instance.update), instance.scope // track it in component's effect scope
|
|
5813
|
+
));
|
|
5710
5814
|
const update = (instance.update = effect.run.bind(effect));
|
|
5711
5815
|
update.id = instance.uid;
|
|
5712
5816
|
// allowRecurse
|
|
5713
5817
|
// #1801, #2043 component render effects should allow recursive updates
|
|
5714
|
-
|
|
5818
|
+
toggleRecurse(instance, true);
|
|
5715
5819
|
{
|
|
5716
5820
|
effect.onTrack = instance.rtc
|
|
5717
5821
|
? e => invokeArrayFns(instance.rtc, e)
|
|
@@ -6235,85 +6339,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6235
6339
|
createApp: createAppAPI(render, hydrate)
|
|
6236
6340
|
};
|
|
6237
6341
|
}
|
|
6238
|
-
function
|
|
6239
|
-
|
|
6240
|
-
rawRef.forEach((r, i) => setRef(r, oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), parentSuspense, vnode, isUnmount));
|
|
6241
|
-
return;
|
|
6242
|
-
}
|
|
6243
|
-
if (isAsyncWrapper(vnode) && !isUnmount) {
|
|
6244
|
-
// when mounting async components, nothing needs to be done,
|
|
6245
|
-
// because the template ref is forwarded to inner component
|
|
6246
|
-
return;
|
|
6247
|
-
}
|
|
6248
|
-
const refValue = vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */
|
|
6249
|
-
? getExposeProxy(vnode.component) || vnode.component.proxy
|
|
6250
|
-
: vnode.el;
|
|
6251
|
-
const value = isUnmount ? null : refValue;
|
|
6252
|
-
const { i: owner, r: ref } = rawRef;
|
|
6253
|
-
if (!owner) {
|
|
6254
|
-
warn$1(`Missing ref owner context. ref cannot be used on hoisted vnodes. ` +
|
|
6255
|
-
`A vnode with ref must be created inside the render function.`);
|
|
6256
|
-
return;
|
|
6257
|
-
}
|
|
6258
|
-
const oldRef = oldRawRef && oldRawRef.r;
|
|
6259
|
-
const refs = owner.refs === EMPTY_OBJ ? (owner.refs = {}) : owner.refs;
|
|
6260
|
-
const setupState = owner.setupState;
|
|
6261
|
-
// dynamic ref changed. unset old ref
|
|
6262
|
-
if (oldRef != null && oldRef !== ref) {
|
|
6263
|
-
if (isString(oldRef)) {
|
|
6264
|
-
refs[oldRef] = null;
|
|
6265
|
-
if (hasOwn(setupState, oldRef)) {
|
|
6266
|
-
setupState[oldRef] = null;
|
|
6267
|
-
}
|
|
6268
|
-
}
|
|
6269
|
-
else if (isRef(oldRef)) {
|
|
6270
|
-
oldRef.value = null;
|
|
6271
|
-
}
|
|
6272
|
-
}
|
|
6273
|
-
if (isString(ref)) {
|
|
6274
|
-
const doSet = () => {
|
|
6275
|
-
{
|
|
6276
|
-
refs[ref] = value;
|
|
6277
|
-
}
|
|
6278
|
-
if (hasOwn(setupState, ref)) {
|
|
6279
|
-
setupState[ref] = value;
|
|
6280
|
-
}
|
|
6281
|
-
};
|
|
6282
|
-
// #1789: for non-null values, set them after render
|
|
6283
|
-
// null values means this is unmount and it should not overwrite another
|
|
6284
|
-
// ref with the same key
|
|
6285
|
-
if (value) {
|
|
6286
|
-
doSet.id = -1;
|
|
6287
|
-
queuePostRenderEffect(doSet, parentSuspense);
|
|
6288
|
-
}
|
|
6289
|
-
else {
|
|
6290
|
-
doSet();
|
|
6291
|
-
}
|
|
6292
|
-
}
|
|
6293
|
-
else if (isRef(ref)) {
|
|
6294
|
-
const doSet = () => {
|
|
6295
|
-
ref.value = value;
|
|
6296
|
-
};
|
|
6297
|
-
if (value) {
|
|
6298
|
-
doSet.id = -1;
|
|
6299
|
-
queuePostRenderEffect(doSet, parentSuspense);
|
|
6300
|
-
}
|
|
6301
|
-
else {
|
|
6302
|
-
doSet();
|
|
6303
|
-
}
|
|
6304
|
-
}
|
|
6305
|
-
else if (isFunction(ref)) {
|
|
6306
|
-
callWithErrorHandling(ref, owner, 12 /* FUNCTION_REF */, [value, refs]);
|
|
6307
|
-
}
|
|
6308
|
-
else {
|
|
6309
|
-
warn$1('Invalid template ref type:', value, `(${typeof value})`);
|
|
6310
|
-
}
|
|
6311
|
-
}
|
|
6312
|
-
function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
6313
|
-
callWithAsyncErrorHandling(hook, instance, 7 /* VNODE_HOOK */, [
|
|
6314
|
-
vnode,
|
|
6315
|
-
prevVNode
|
|
6316
|
-
]);
|
|
6342
|
+
function toggleRecurse({ effect, update }, allowed) {
|
|
6343
|
+
effect.allowRecurse = update.allowRecurse = allowed;
|
|
6317
6344
|
}
|
|
6318
6345
|
/**
|
|
6319
6346
|
* #1156
|
|
@@ -6772,10 +6799,10 @@ const createVNodeWithArgsTransform = (...args) => {
|
|
|
6772
6799
|
};
|
|
6773
6800
|
const InternalObjectKey = `__vInternal`;
|
|
6774
6801
|
const normalizeKey = ({ key }) => key != null ? key : null;
|
|
6775
|
-
const normalizeRef = ({ ref }) => {
|
|
6802
|
+
const normalizeRef = ({ ref, ref_key, ref_for }) => {
|
|
6776
6803
|
return (ref != null
|
|
6777
6804
|
? isString(ref) || isRef(ref) || isFunction(ref)
|
|
6778
|
-
? { i: currentRenderingInstance, r: ref }
|
|
6805
|
+
? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for }
|
|
6779
6806
|
: ref
|
|
6780
6807
|
: null);
|
|
6781
6808
|
};
|
|
@@ -7117,6 +7144,12 @@ function mergeProps(...args) {
|
|
|
7117
7144
|
}
|
|
7118
7145
|
}
|
|
7119
7146
|
return ret;
|
|
7147
|
+
}
|
|
7148
|
+
function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
7149
|
+
callWithAsyncErrorHandling(hook, instance, 7 /* VNODE_HOOK */, [
|
|
7150
|
+
vnode,
|
|
7151
|
+
prevVNode
|
|
7152
|
+
]);
|
|
7120
7153
|
}
|
|
7121
7154
|
|
|
7122
7155
|
/**
|
|
@@ -7308,23 +7341,23 @@ const PublicInstanceProxyHandlers = {
|
|
|
7308
7341
|
const n = accessCache[key];
|
|
7309
7342
|
if (n !== undefined) {
|
|
7310
7343
|
switch (n) {
|
|
7311
|
-
case
|
|
7344
|
+
case 1 /* SETUP */:
|
|
7312
7345
|
return setupState[key];
|
|
7313
|
-
case
|
|
7346
|
+
case 2 /* DATA */:
|
|
7314
7347
|
return data[key];
|
|
7315
|
-
case
|
|
7348
|
+
case 4 /* CONTEXT */:
|
|
7316
7349
|
return ctx[key];
|
|
7317
|
-
case
|
|
7350
|
+
case 3 /* PROPS */:
|
|
7318
7351
|
return props[key];
|
|
7319
7352
|
// default: just fallthrough
|
|
7320
7353
|
}
|
|
7321
7354
|
}
|
|
7322
7355
|
else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
|
|
7323
|
-
accessCache[key] =
|
|
7356
|
+
accessCache[key] = 1 /* SETUP */;
|
|
7324
7357
|
return setupState[key];
|
|
7325
7358
|
}
|
|
7326
7359
|
else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
7327
|
-
accessCache[key] =
|
|
7360
|
+
accessCache[key] = 2 /* DATA */;
|
|
7328
7361
|
return data[key];
|
|
7329
7362
|
}
|
|
7330
7363
|
else if (
|
|
@@ -7332,15 +7365,15 @@ const PublicInstanceProxyHandlers = {
|
|
|
7332
7365
|
// props
|
|
7333
7366
|
(normalizedProps = instance.propsOptions[0]) &&
|
|
7334
7367
|
hasOwn(normalizedProps, key)) {
|
|
7335
|
-
accessCache[key] =
|
|
7368
|
+
accessCache[key] = 3 /* PROPS */;
|
|
7336
7369
|
return props[key];
|
|
7337
7370
|
}
|
|
7338
7371
|
else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
7339
|
-
accessCache[key] =
|
|
7372
|
+
accessCache[key] = 4 /* CONTEXT */;
|
|
7340
7373
|
return ctx[key];
|
|
7341
7374
|
}
|
|
7342
7375
|
else if (shouldCacheAccess) {
|
|
7343
|
-
accessCache[key] =
|
|
7376
|
+
accessCache[key] = 0 /* OTHER */;
|
|
7344
7377
|
}
|
|
7345
7378
|
}
|
|
7346
7379
|
const publicGetter = publicPropertiesMap[key];
|
|
@@ -7361,7 +7394,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
7361
7394
|
}
|
|
7362
7395
|
else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
7363
7396
|
// user may set custom properties to `this` that start with `$`
|
|
7364
|
-
accessCache[key] =
|
|
7397
|
+
accessCache[key] = 4 /* CONTEXT */;
|
|
7365
7398
|
return ctx[key];
|
|
7366
7399
|
}
|
|
7367
7400
|
else if (
|
|
@@ -7422,7 +7455,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
7422
7455
|
},
|
|
7423
7456
|
has({ _: { data, setupState, accessCache, ctx, appContext, propsOptions } }, key) {
|
|
7424
7457
|
let normalizedProps;
|
|
7425
|
-
return (accessCache[key]
|
|
7458
|
+
return (!!accessCache[key] ||
|
|
7426
7459
|
(data !== EMPTY_OBJ && hasOwn(data, key)) ||
|
|
7427
7460
|
(setupState !== EMPTY_OBJ && hasOwn(setupState, key)) ||
|
|
7428
7461
|
((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||
|
|
@@ -7528,6 +7561,7 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
7528
7561
|
root: null,
|
|
7529
7562
|
next: null,
|
|
7530
7563
|
subTree: null,
|
|
7564
|
+
effect: null,
|
|
7531
7565
|
update: null,
|
|
7532
7566
|
scope: new EffectScope(true /* detached */),
|
|
7533
7567
|
render: null,
|
|
@@ -8969,7 +9003,7 @@ function isMemoSame(cached, memo) {
|
|
|
8969
9003
|
}
|
|
8970
9004
|
|
|
8971
9005
|
// Core API ------------------------------------------------------------------
|
|
8972
|
-
const version = "3.2.
|
|
9006
|
+
const version = "3.2.26";
|
|
8973
9007
|
/**
|
|
8974
9008
|
* SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
|
|
8975
9009
|
* @internal
|
|
@@ -9202,12 +9236,19 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
|
|
|
9202
9236
|
el[key] = value == null ? '' : value;
|
|
9203
9237
|
return;
|
|
9204
9238
|
}
|
|
9205
|
-
if (key === 'value' &&
|
|
9239
|
+
if (key === 'value' &&
|
|
9240
|
+
el.tagName !== 'PROGRESS' &&
|
|
9241
|
+
// custom elements may use _value internally
|
|
9242
|
+
!el.tagName.includes('-')) {
|
|
9206
9243
|
// store value as _value as well since
|
|
9207
9244
|
// non-string values will be stringified.
|
|
9208
9245
|
el._value = value;
|
|
9209
9246
|
const newValue = value == null ? '' : value;
|
|
9210
|
-
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') {
|
|
9211
9252
|
el.value = newValue;
|
|
9212
9253
|
}
|
|
9213
9254
|
if (value == null) {
|
|
@@ -9593,7 +9634,7 @@ class VueElement extends BaseClass {
|
|
|
9593
9634
|
// HMR
|
|
9594
9635
|
{
|
|
9595
9636
|
instance.ceReload = newStyles => {
|
|
9596
|
-
//
|
|
9637
|
+
// always reset styles
|
|
9597
9638
|
if (this._styles) {
|
|
9598
9639
|
this._styles.forEach(s => this.shadowRoot.removeChild(s));
|
|
9599
9640
|
this._styles.length = 0;
|