vue 3.2.20 → 3.2.24
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.esm-browser.js +99 -88
- package/dist/vue.esm-browser.prod.js +1 -1
- package/dist/vue.global.js +99 -88
- package/dist/vue.global.prod.js +1 -1
- package/dist/vue.runtime.esm-browser.js +92 -61
- package/dist/vue.runtime.esm-browser.prod.js +1 -1
- package/dist/vue.runtime.global.js +92 -61
- package/dist/vue.runtime.global.prod.js +1 -1
- package/package.json +10 -8
|
@@ -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)) {
|
|
@@ -1572,22 +1572,33 @@ function tryWrap(fn) {
|
|
|
1572
1572
|
|
|
1573
1573
|
let devtools;
|
|
1574
1574
|
let buffer = [];
|
|
1575
|
+
let devtoolsNotInstalled = false;
|
|
1575
1576
|
function emit(event, ...args) {
|
|
1576
1577
|
if (devtools) {
|
|
1577
1578
|
devtools.emit(event, ...args);
|
|
1578
1579
|
}
|
|
1579
|
-
else {
|
|
1580
|
+
else if (!devtoolsNotInstalled) {
|
|
1580
1581
|
buffer.push({ event, args });
|
|
1581
1582
|
}
|
|
1582
1583
|
}
|
|
1583
1584
|
function setDevtoolsHook(hook, target) {
|
|
1585
|
+
var _a, _b;
|
|
1584
1586
|
devtools = hook;
|
|
1585
1587
|
if (devtools) {
|
|
1586
1588
|
devtools.enabled = true;
|
|
1587
1589
|
buffer.forEach(({ event, args }) => devtools.emit(event, ...args));
|
|
1588
1590
|
buffer = [];
|
|
1589
1591
|
}
|
|
1590
|
-
else
|
|
1592
|
+
else if (
|
|
1593
|
+
// handle late devtools injection - only do this if we are in an actual
|
|
1594
|
+
// browser environment to avoid the timer handle stalling test runner exit
|
|
1595
|
+
// (#4815)
|
|
1596
|
+
// eslint-disable-next-line no-restricted-globals
|
|
1597
|
+
typeof window !== 'undefined' &&
|
|
1598
|
+
// some envs mock window but not fully
|
|
1599
|
+
window.HTMLElement &&
|
|
1600
|
+
// also exclude jsdom
|
|
1601
|
+
!((_b = (_a = window.navigator) === null || _a === void 0 ? void 0 : _a.userAgent) === null || _b === void 0 ? void 0 : _b.includes('jsdom'))) {
|
|
1591
1602
|
const replay = (target.__VUE_DEVTOOLS_HOOK_REPLAY__ =
|
|
1592
1603
|
target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []);
|
|
1593
1604
|
replay.push((newHook) => {
|
|
@@ -1596,9 +1607,18 @@ function setDevtoolsHook(hook, target) {
|
|
|
1596
1607
|
// clear buffer after 3s - the user probably doesn't have devtools installed
|
|
1597
1608
|
// at all, and keeping the buffer will cause memory leaks (#4738)
|
|
1598
1609
|
setTimeout(() => {
|
|
1599
|
-
|
|
1610
|
+
if (!devtools) {
|
|
1611
|
+
target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
|
|
1612
|
+
devtoolsNotInstalled = true;
|
|
1613
|
+
buffer = [];
|
|
1614
|
+
}
|
|
1600
1615
|
}, 3000);
|
|
1601
1616
|
}
|
|
1617
|
+
else {
|
|
1618
|
+
// non-browser env, assume not installed
|
|
1619
|
+
devtoolsNotInstalled = true;
|
|
1620
|
+
buffer = [];
|
|
1621
|
+
}
|
|
1602
1622
|
}
|
|
1603
1623
|
function devtoolsInitApp(app, version) {
|
|
1604
1624
|
emit("app:init" /* APP_INIT */, app, version, {
|
|
@@ -2672,7 +2692,8 @@ const BaseTransitionImpl = {
|
|
|
2672
2692
|
const rawProps = toRaw(props);
|
|
2673
2693
|
const { mode } = rawProps;
|
|
2674
2694
|
// check mode
|
|
2675
|
-
if (mode &&
|
|
2695
|
+
if (mode &&
|
|
2696
|
+
mode !== 'in-out' && mode !== 'out-in' && mode !== 'default') {
|
|
2676
2697
|
warn$1(`invalid <transition> mode: ${mode}`);
|
|
2677
2698
|
}
|
|
2678
2699
|
// at this point children has a guaranteed length of 1.
|
|
@@ -3312,7 +3333,7 @@ function registerKeepAliveHook(hook, type, target = currentInstance) {
|
|
|
3312
3333
|
}
|
|
3313
3334
|
current = current.parent;
|
|
3314
3335
|
}
|
|
3315
|
-
hook();
|
|
3336
|
+
return hook();
|
|
3316
3337
|
});
|
|
3317
3338
|
injectHook(type, wrappedHook, target);
|
|
3318
3339
|
// In addition to registering it on the target instance, we walk up the parent
|
|
@@ -3974,7 +3995,7 @@ function setFullProps(instance, rawProps, props, attrs) {
|
|
|
3974
3995
|
}
|
|
3975
3996
|
}
|
|
3976
3997
|
else if (!isEmitListener(instance.emitsOptions, key)) {
|
|
3977
|
-
if (value !== attrs[key]) {
|
|
3998
|
+
if (!(key in attrs) || value !== attrs[key]) {
|
|
3978
3999
|
attrs[key] = value;
|
|
3979
4000
|
hasAttrsChanged = true;
|
|
3980
4001
|
}
|
|
@@ -4386,7 +4407,7 @@ return withDirectives(h(comp), [
|
|
|
4386
4407
|
[bar, this.y]
|
|
4387
4408
|
])
|
|
4388
4409
|
*/
|
|
4389
|
-
const isBuiltInDirective = /*#__PURE__*/ makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text');
|
|
4410
|
+
const isBuiltInDirective = /*#__PURE__*/ makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo');
|
|
4390
4411
|
function validateDirectiveName(name) {
|
|
4391
4412
|
if (isBuiltInDirective(name)) {
|
|
4392
4413
|
warn$1('Do not use built-in directive ids as custom directive id: ' + name);
|
|
@@ -6303,8 +6324,8 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
|
6303
6324
|
*
|
|
6304
6325
|
* #2080
|
|
6305
6326
|
* Inside keyed `template` fragment static children, if a fragment is moved,
|
|
6306
|
-
* the children will always moved
|
|
6307
|
-
*
|
|
6327
|
+
* the children will always be moved. Therefore, in order to ensure correct move
|
|
6328
|
+
* position, el should be inherited from previous nodes.
|
|
6308
6329
|
*/
|
|
6309
6330
|
function traverseStaticChildren(n1, n2, shallow = false) {
|
|
6310
6331
|
const ch1 = n1.children;
|
|
@@ -7084,7 +7105,8 @@ function mergeProps(...args) {
|
|
|
7084
7105
|
else if (isOn(key)) {
|
|
7085
7106
|
const existing = ret[key];
|
|
7086
7107
|
const incoming = toMerge[key];
|
|
7087
|
-
if (existing !== incoming
|
|
7108
|
+
if (existing !== incoming &&
|
|
7109
|
+
!(isArray(existing) && existing.includes(incoming))) {
|
|
7088
7110
|
ret[key] = existing
|
|
7089
7111
|
? [].concat(existing, incoming)
|
|
7090
7112
|
: incoming;
|
|
@@ -7287,23 +7309,23 @@ const PublicInstanceProxyHandlers = {
|
|
|
7287
7309
|
const n = accessCache[key];
|
|
7288
7310
|
if (n !== undefined) {
|
|
7289
7311
|
switch (n) {
|
|
7290
|
-
case
|
|
7312
|
+
case 1 /* SETUP */:
|
|
7291
7313
|
return setupState[key];
|
|
7292
|
-
case
|
|
7314
|
+
case 2 /* DATA */:
|
|
7293
7315
|
return data[key];
|
|
7294
|
-
case
|
|
7316
|
+
case 4 /* CONTEXT */:
|
|
7295
7317
|
return ctx[key];
|
|
7296
|
-
case
|
|
7318
|
+
case 3 /* PROPS */:
|
|
7297
7319
|
return props[key];
|
|
7298
7320
|
// default: just fallthrough
|
|
7299
7321
|
}
|
|
7300
7322
|
}
|
|
7301
7323
|
else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
|
|
7302
|
-
accessCache[key] =
|
|
7324
|
+
accessCache[key] = 1 /* SETUP */;
|
|
7303
7325
|
return setupState[key];
|
|
7304
7326
|
}
|
|
7305
7327
|
else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
7306
|
-
accessCache[key] =
|
|
7328
|
+
accessCache[key] = 2 /* DATA */;
|
|
7307
7329
|
return data[key];
|
|
7308
7330
|
}
|
|
7309
7331
|
else if (
|
|
@@ -7311,15 +7333,15 @@ const PublicInstanceProxyHandlers = {
|
|
|
7311
7333
|
// props
|
|
7312
7334
|
(normalizedProps = instance.propsOptions[0]) &&
|
|
7313
7335
|
hasOwn(normalizedProps, key)) {
|
|
7314
|
-
accessCache[key] =
|
|
7336
|
+
accessCache[key] = 3 /* PROPS */;
|
|
7315
7337
|
return props[key];
|
|
7316
7338
|
}
|
|
7317
7339
|
else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
7318
|
-
accessCache[key] =
|
|
7340
|
+
accessCache[key] = 4 /* CONTEXT */;
|
|
7319
7341
|
return ctx[key];
|
|
7320
7342
|
}
|
|
7321
7343
|
else if (shouldCacheAccess) {
|
|
7322
|
-
accessCache[key] =
|
|
7344
|
+
accessCache[key] = 0 /* OTHER */;
|
|
7323
7345
|
}
|
|
7324
7346
|
}
|
|
7325
7347
|
const publicGetter = publicPropertiesMap[key];
|
|
@@ -7340,7 +7362,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
7340
7362
|
}
|
|
7341
7363
|
else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
7342
7364
|
// user may set custom properties to `this` that start with `$`
|
|
7343
|
-
accessCache[key] =
|
|
7365
|
+
accessCache[key] = 4 /* CONTEXT */;
|
|
7344
7366
|
return ctx[key];
|
|
7345
7367
|
}
|
|
7346
7368
|
else if (
|
|
@@ -7401,7 +7423,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
7401
7423
|
},
|
|
7402
7424
|
has({ _: { data, setupState, accessCache, ctx, appContext, propsOptions } }, key) {
|
|
7403
7425
|
let normalizedProps;
|
|
7404
|
-
return (accessCache[key]
|
|
7426
|
+
return (!!accessCache[key] ||
|
|
7405
7427
|
(data !== EMPTY_OBJ && hasOwn(data, key)) ||
|
|
7406
7428
|
(setupState !== EMPTY_OBJ && hasOwn(setupState, key)) ||
|
|
7407
7429
|
((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||
|
|
@@ -8948,7 +8970,7 @@ function isMemoSame(cached, memo) {
|
|
|
8948
8970
|
}
|
|
8949
8971
|
|
|
8950
8972
|
// Core API ------------------------------------------------------------------
|
|
8951
|
-
const version = "3.2.
|
|
8973
|
+
const version = "3.2.24";
|
|
8952
8974
|
/**
|
|
8953
8975
|
* SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
|
|
8954
8976
|
* @internal
|
|
@@ -9070,16 +9092,8 @@ function patchClass(el, value, isSVG) {
|
|
|
9070
9092
|
|
|
9071
9093
|
function patchStyle(el, prev, next) {
|
|
9072
9094
|
const style = el.style;
|
|
9073
|
-
const
|
|
9074
|
-
if (!
|
|
9075
|
-
el.removeAttribute('style');
|
|
9076
|
-
}
|
|
9077
|
-
else if (isString(next)) {
|
|
9078
|
-
if (prev !== next) {
|
|
9079
|
-
style.cssText = next;
|
|
9080
|
-
}
|
|
9081
|
-
}
|
|
9082
|
-
else {
|
|
9095
|
+
const isCssString = isString(next);
|
|
9096
|
+
if (next && !isCssString) {
|
|
9083
9097
|
for (const key in next) {
|
|
9084
9098
|
setStyle(style, key, next[key]);
|
|
9085
9099
|
}
|
|
@@ -9091,11 +9105,22 @@ function patchStyle(el, prev, next) {
|
|
|
9091
9105
|
}
|
|
9092
9106
|
}
|
|
9093
9107
|
}
|
|
9094
|
-
|
|
9095
|
-
|
|
9096
|
-
|
|
9097
|
-
|
|
9098
|
-
|
|
9108
|
+
else {
|
|
9109
|
+
const currentDisplay = style.display;
|
|
9110
|
+
if (isCssString) {
|
|
9111
|
+
if (prev !== next) {
|
|
9112
|
+
style.cssText = next;
|
|
9113
|
+
}
|
|
9114
|
+
}
|
|
9115
|
+
else if (prev) {
|
|
9116
|
+
el.removeAttribute('style');
|
|
9117
|
+
}
|
|
9118
|
+
// indicates that the `display` of the element is controlled by `v-show`,
|
|
9119
|
+
// so we always keep the current `display` value regardless of the `style`
|
|
9120
|
+
// value, thus handing over control to `v-show`.
|
|
9121
|
+
if ('_vod' in el) {
|
|
9122
|
+
style.display = currentDisplay;
|
|
9123
|
+
}
|
|
9099
9124
|
}
|
|
9100
9125
|
}
|
|
9101
9126
|
const importantRE = /\s*!important$/;
|
|
@@ -9178,12 +9203,19 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
|
|
|
9178
9203
|
el[key] = value == null ? '' : value;
|
|
9179
9204
|
return;
|
|
9180
9205
|
}
|
|
9181
|
-
if (key === 'value' &&
|
|
9206
|
+
if (key === 'value' &&
|
|
9207
|
+
el.tagName !== 'PROGRESS' &&
|
|
9208
|
+
// custom elements may use _value internally
|
|
9209
|
+
!el.tagName.includes('-')) {
|
|
9182
9210
|
// store value as _value as well since
|
|
9183
9211
|
// non-string values will be stringified.
|
|
9184
9212
|
el._value = value;
|
|
9185
9213
|
const newValue = value == null ? '' : value;
|
|
9186
|
-
if (el.value !== newValue
|
|
9214
|
+
if (el.value !== newValue ||
|
|
9215
|
+
// #4956: always set for OPTION elements because its value falls back to
|
|
9216
|
+
// textContent if no value attribute is present. And setting .value for
|
|
9217
|
+
// OPTION has no side effect
|
|
9218
|
+
el.tagName === 'OPTION') {
|
|
9187
9219
|
el.value = newValue;
|
|
9188
9220
|
}
|
|
9189
9221
|
if (value == null) {
|
|
@@ -9441,22 +9473,11 @@ class VueElement extends BaseClass {
|
|
|
9441
9473
|
}
|
|
9442
9474
|
this.attachShadow({ mode: 'open' });
|
|
9443
9475
|
}
|
|
9444
|
-
// set initial attrs
|
|
9445
|
-
for (let i = 0; i < this.attributes.length; i++) {
|
|
9446
|
-
this._setAttr(this.attributes[i].name);
|
|
9447
|
-
}
|
|
9448
|
-
// watch future attr changes
|
|
9449
|
-
new MutationObserver(mutations => {
|
|
9450
|
-
for (const m of mutations) {
|
|
9451
|
-
this._setAttr(m.attributeName);
|
|
9452
|
-
}
|
|
9453
|
-
}).observe(this, { attributes: true });
|
|
9454
9476
|
}
|
|
9455
9477
|
connectedCallback() {
|
|
9456
9478
|
this._connected = true;
|
|
9457
9479
|
if (!this._instance) {
|
|
9458
9480
|
this._resolveDef();
|
|
9459
|
-
this._update();
|
|
9460
9481
|
}
|
|
9461
9482
|
}
|
|
9462
9483
|
disconnectedCallback() {
|
|
@@ -9475,8 +9496,18 @@ class VueElement extends BaseClass {
|
|
|
9475
9496
|
if (this._resolved) {
|
|
9476
9497
|
return;
|
|
9477
9498
|
}
|
|
9499
|
+
this._resolved = true;
|
|
9500
|
+
// set initial attrs
|
|
9501
|
+
for (let i = 0; i < this.attributes.length; i++) {
|
|
9502
|
+
this._setAttr(this.attributes[i].name);
|
|
9503
|
+
}
|
|
9504
|
+
// watch future attr changes
|
|
9505
|
+
new MutationObserver(mutations => {
|
|
9506
|
+
for (const m of mutations) {
|
|
9507
|
+
this._setAttr(m.attributeName);
|
|
9508
|
+
}
|
|
9509
|
+
}).observe(this, { attributes: true });
|
|
9478
9510
|
const resolve = (def) => {
|
|
9479
|
-
this._resolved = true;
|
|
9480
9511
|
const { props, styles } = def;
|
|
9481
9512
|
const hasOptions = !isArray(props);
|
|
9482
9513
|
const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];
|
|
@@ -9491,14 +9522,11 @@ class VueElement extends BaseClass {
|
|
|
9491
9522
|
}
|
|
9492
9523
|
}
|
|
9493
9524
|
}
|
|
9494
|
-
|
|
9495
|
-
this._numberProps = numberProps;
|
|
9496
|
-
this._update();
|
|
9497
|
-
}
|
|
9525
|
+
this._numberProps = numberProps;
|
|
9498
9526
|
// check if there are props set pre-upgrade or connect
|
|
9499
9527
|
for (const key of Object.keys(this)) {
|
|
9500
9528
|
if (key[0] !== '_') {
|
|
9501
|
-
this._setProp(key, this[key]);
|
|
9529
|
+
this._setProp(key, this[key], true, false);
|
|
9502
9530
|
}
|
|
9503
9531
|
}
|
|
9504
9532
|
// defining getter/setters on prototype
|
|
@@ -9512,7 +9540,10 @@ class VueElement extends BaseClass {
|
|
|
9512
9540
|
}
|
|
9513
9541
|
});
|
|
9514
9542
|
}
|
|
9543
|
+
// apply CSS
|
|
9515
9544
|
this._applyStyles(styles);
|
|
9545
|
+
// initial render
|
|
9546
|
+
this._update();
|
|
9516
9547
|
};
|
|
9517
9548
|
const asyncDef = this._def.__asyncLoader;
|
|
9518
9549
|
if (asyncDef) {
|
|
@@ -9538,10 +9569,10 @@ class VueElement extends BaseClass {
|
|
|
9538
9569
|
/**
|
|
9539
9570
|
* @internal
|
|
9540
9571
|
*/
|
|
9541
|
-
_setProp(key, val, shouldReflect = true) {
|
|
9572
|
+
_setProp(key, val, shouldReflect = true, shouldUpdate = true) {
|
|
9542
9573
|
if (val !== this._props[key]) {
|
|
9543
9574
|
this._props[key] = val;
|
|
9544
|
-
if (this._instance) {
|
|
9575
|
+
if (shouldUpdate && this._instance) {
|
|
9545
9576
|
this._update();
|
|
9546
9577
|
}
|
|
9547
9578
|
// reflect
|
|
@@ -9570,7 +9601,7 @@ class VueElement extends BaseClass {
|
|
|
9570
9601
|
// HMR
|
|
9571
9602
|
{
|
|
9572
9603
|
instance.ceReload = newStyles => {
|
|
9573
|
-
//
|
|
9604
|
+
// always reset styles
|
|
9574
9605
|
if (this._styles) {
|
|
9575
9606
|
this._styles.forEach(s => this.shadowRoot.removeChild(s));
|
|
9576
9607
|
this._styles.length = 0;
|