vue 3.2.41 → 3.2.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.esm-browser.js +104 -71
- package/dist/vue.esm-browser.prod.js +1 -1
- package/dist/vue.global.js +104 -71
- package/dist/vue.global.prod.js +1 -1
- package/dist/vue.runtime.esm-browser.js +78 -56
- package/dist/vue.runtime.esm-browser.prod.js +1 -1
- package/dist/vue.runtime.global.js +78 -56
- package/dist/vue.runtime.global.prod.js +1 -1
- package/macros.d.ts +4 -2
- package/package.json +6 -6
|
@@ -19,27 +19,6 @@ const GLOBALS_WHITE_LISTED = 'Infinity,undefined,NaN,isFinite,isNaN,parseFloat,p
|
|
|
19
19
|
'Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt';
|
|
20
20
|
const isGloballyWhitelisted = /*#__PURE__*/ makeMap(GLOBALS_WHITE_LISTED);
|
|
21
21
|
|
|
22
|
-
/**
|
|
23
|
-
* On the client we only need to offer special cases for boolean attributes that
|
|
24
|
-
* have different names from their corresponding dom properties:
|
|
25
|
-
* - itemscope -> N/A
|
|
26
|
-
* - allowfullscreen -> allowFullscreen
|
|
27
|
-
* - formnovalidate -> formNoValidate
|
|
28
|
-
* - ismap -> isMap
|
|
29
|
-
* - nomodule -> noModule
|
|
30
|
-
* - novalidate -> noValidate
|
|
31
|
-
* - readonly -> readOnly
|
|
32
|
-
*/
|
|
33
|
-
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
|
|
34
|
-
const isSpecialBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs);
|
|
35
|
-
/**
|
|
36
|
-
* Boolean attributes should be included if the value is truthy or ''.
|
|
37
|
-
* e.g. `<select multiple>` compiles to `{ multiple: '' }`
|
|
38
|
-
*/
|
|
39
|
-
function includeBooleanAttr(value) {
|
|
40
|
-
return !!value || value === '';
|
|
41
|
-
}
|
|
42
|
-
|
|
43
22
|
function normalizeStyle(value) {
|
|
44
23
|
if (isArray(value)) {
|
|
45
24
|
const res = {};
|
|
@@ -64,10 +43,14 @@ function normalizeStyle(value) {
|
|
|
64
43
|
}
|
|
65
44
|
}
|
|
66
45
|
const listDelimiterRE = /;(?![^(]*\))/g;
|
|
67
|
-
const propertyDelimiterRE = /:(
|
|
46
|
+
const propertyDelimiterRE = /:([^]+)/;
|
|
47
|
+
const styleCommentRE = /\/\*.*?\*\//gs;
|
|
68
48
|
function parseStringStyle(cssText) {
|
|
69
49
|
const ret = {};
|
|
70
|
-
cssText
|
|
50
|
+
cssText
|
|
51
|
+
.replace(styleCommentRE, '')
|
|
52
|
+
.split(listDelimiterRE)
|
|
53
|
+
.forEach(item => {
|
|
71
54
|
if (item) {
|
|
72
55
|
const tmp = item.split(propertyDelimiterRE);
|
|
73
56
|
tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
|
|
@@ -143,6 +126,27 @@ const isHTMLTag = /*#__PURE__*/ makeMap(HTML_TAGS);
|
|
|
143
126
|
*/
|
|
144
127
|
const isSVGTag = /*#__PURE__*/ makeMap(SVG_TAGS);
|
|
145
128
|
|
|
129
|
+
/**
|
|
130
|
+
* On the client we only need to offer special cases for boolean attributes that
|
|
131
|
+
* have different names from their corresponding dom properties:
|
|
132
|
+
* - itemscope -> N/A
|
|
133
|
+
* - allowfullscreen -> allowFullscreen
|
|
134
|
+
* - formnovalidate -> formNoValidate
|
|
135
|
+
* - ismap -> isMap
|
|
136
|
+
* - nomodule -> noModule
|
|
137
|
+
* - novalidate -> noValidate
|
|
138
|
+
* - readonly -> readOnly
|
|
139
|
+
*/
|
|
140
|
+
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
|
|
141
|
+
const isSpecialBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs);
|
|
142
|
+
/**
|
|
143
|
+
* Boolean attributes should be included if the value is truthy or ''.
|
|
144
|
+
* e.g. `<select multiple>` compiles to `{ multiple: '' }`
|
|
145
|
+
*/
|
|
146
|
+
function includeBooleanAttr(value) {
|
|
147
|
+
return !!value || value === '';
|
|
148
|
+
}
|
|
149
|
+
|
|
146
150
|
function looseCompareArrays(a, b) {
|
|
147
151
|
if (a.length !== b.length)
|
|
148
152
|
return false;
|
|
@@ -646,8 +650,9 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
646
650
|
deps = [...depsMap.values()];
|
|
647
651
|
}
|
|
648
652
|
else if (key === 'length' && isArray(target)) {
|
|
653
|
+
const newLength = toNumber(newValue);
|
|
649
654
|
depsMap.forEach((dep, key) => {
|
|
650
|
-
if (key === 'length' || key >=
|
|
655
|
+
if (key === 'length' || key >= newLength) {
|
|
651
656
|
deps.push(dep);
|
|
652
657
|
}
|
|
653
658
|
});
|
|
@@ -2182,7 +2187,7 @@ function emit$1(instance, event, ...rawArgs) {
|
|
|
2182
2187
|
const modifiersKey = `${modelArg === 'modelValue' ? 'model' : modelArg}Modifiers`;
|
|
2183
2188
|
const { number, trim } = props[modifiersKey] || EMPTY_OBJ;
|
|
2184
2189
|
if (trim) {
|
|
2185
|
-
args = rawArgs.map(a => a.trim());
|
|
2190
|
+
args = rawArgs.map(a => (isString(a) ? a.trim() : a));
|
|
2186
2191
|
}
|
|
2187
2192
|
if (number) {
|
|
2188
2193
|
args = rawArgs.map(toNumber);
|
|
@@ -3244,7 +3249,9 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3244
3249
|
callWithErrorHandling(fn, instance, 4 /* ErrorCodes.WATCH_CLEANUP */);
|
|
3245
3250
|
};
|
|
3246
3251
|
};
|
|
3247
|
-
let oldValue = isMultiSource
|
|
3252
|
+
let oldValue = isMultiSource
|
|
3253
|
+
? new Array(source.length).fill(INITIAL_WATCHER_VALUE)
|
|
3254
|
+
: INITIAL_WATCHER_VALUE;
|
|
3248
3255
|
const job = () => {
|
|
3249
3256
|
if (!effect.active) {
|
|
3250
3257
|
return;
|
|
@@ -3265,7 +3272,10 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3265
3272
|
callWithAsyncErrorHandling(cb, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [
|
|
3266
3273
|
newValue,
|
|
3267
3274
|
// pass undefined as the old value when it's changed for the first time
|
|
3268
|
-
oldValue === INITIAL_WATCHER_VALUE
|
|
3275
|
+
oldValue === INITIAL_WATCHER_VALUE ||
|
|
3276
|
+
(isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE)
|
|
3277
|
+
? undefined
|
|
3278
|
+
: oldValue,
|
|
3269
3279
|
onCleanup
|
|
3270
3280
|
]);
|
|
3271
3281
|
oldValue = newValue;
|
|
@@ -3313,12 +3323,13 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3313
3323
|
else {
|
|
3314
3324
|
effect.run();
|
|
3315
3325
|
}
|
|
3316
|
-
|
|
3326
|
+
const unwatch = () => {
|
|
3317
3327
|
effect.stop();
|
|
3318
3328
|
if (instance && instance.scope) {
|
|
3319
3329
|
remove(instance.scope.effects, effect);
|
|
3320
3330
|
}
|
|
3321
3331
|
};
|
|
3332
|
+
return unwatch;
|
|
3322
3333
|
}
|
|
3323
3334
|
// this.$watch
|
|
3324
3335
|
function instanceWatch(source, value, options) {
|
|
@@ -3500,7 +3511,11 @@ const BaseTransitionImpl = {
|
|
|
3500
3511
|
// return placeholder node and queue update when leave finishes
|
|
3501
3512
|
leavingHooks.afterLeave = () => {
|
|
3502
3513
|
state.isLeaving = false;
|
|
3503
|
-
|
|
3514
|
+
// #6835
|
|
3515
|
+
// it also needs to be updated when active is undefined
|
|
3516
|
+
if (instance.update.active !== false) {
|
|
3517
|
+
instance.update();
|
|
3518
|
+
}
|
|
3504
3519
|
};
|
|
3505
3520
|
return emptyPlaceholder(child);
|
|
3506
3521
|
}
|
|
@@ -4018,7 +4033,8 @@ const KeepAliveImpl = {
|
|
|
4018
4033
|
: comp);
|
|
4019
4034
|
const { include, exclude, max } = props;
|
|
4020
4035
|
if ((include && (!name || !matches(include, name))) ||
|
|
4021
|
-
(exclude && name && matches(exclude, name))
|
|
4036
|
+
(exclude && name && matches(exclude, name)) ||
|
|
4037
|
+
(hmrDirtyComponents.has(comp))) {
|
|
4022
4038
|
current = vnode;
|
|
4023
4039
|
return rawVNode;
|
|
4024
4040
|
}
|
|
@@ -4230,23 +4246,25 @@ function withDirectives(vnode, directives) {
|
|
|
4230
4246
|
const bindings = vnode.dirs || (vnode.dirs = []);
|
|
4231
4247
|
for (let i = 0; i < directives.length; i++) {
|
|
4232
4248
|
let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
|
|
4233
|
-
if (
|
|
4234
|
-
dir
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4249
|
+
if (dir) {
|
|
4250
|
+
if (isFunction(dir)) {
|
|
4251
|
+
dir = {
|
|
4252
|
+
mounted: dir,
|
|
4253
|
+
updated: dir
|
|
4254
|
+
};
|
|
4255
|
+
}
|
|
4256
|
+
if (dir.deep) {
|
|
4257
|
+
traverse(value);
|
|
4258
|
+
}
|
|
4259
|
+
bindings.push({
|
|
4260
|
+
dir,
|
|
4261
|
+
instance,
|
|
4262
|
+
value,
|
|
4263
|
+
oldValue: void 0,
|
|
4264
|
+
arg,
|
|
4265
|
+
modifiers
|
|
4266
|
+
});
|
|
4241
4267
|
}
|
|
4242
|
-
bindings.push({
|
|
4243
|
-
dir,
|
|
4244
|
-
instance,
|
|
4245
|
-
value,
|
|
4246
|
-
oldValue: void 0,
|
|
4247
|
-
arg,
|
|
4248
|
-
modifiers
|
|
4249
|
-
});
|
|
4250
4268
|
}
|
|
4251
4269
|
return vnode;
|
|
4252
4270
|
}
|
|
@@ -5459,7 +5477,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
5459
5477
|
if (validatePropName(normalizedKey)) {
|
|
5460
5478
|
const opt = raw[key];
|
|
5461
5479
|
const prop = (normalized[normalizedKey] =
|
|
5462
|
-
isArray(opt) || isFunction(opt) ? { type: opt } : opt);
|
|
5480
|
+
isArray(opt) || isFunction(opt) ? { type: opt } : Object.assign({}, opt));
|
|
5463
5481
|
if (prop) {
|
|
5464
5482
|
const booleanIndex = getTypeIndex(Boolean, prop.type);
|
|
5465
5483
|
const stringIndex = getTypeIndex(String, prop.type);
|
|
@@ -8796,6 +8814,9 @@ function getExposeProxy(instance) {
|
|
|
8796
8814
|
else if (key in publicPropertiesMap) {
|
|
8797
8815
|
return publicPropertiesMap[key](instance);
|
|
8798
8816
|
}
|
|
8817
|
+
},
|
|
8818
|
+
has(target, key) {
|
|
8819
|
+
return key in target || key in publicPropertiesMap;
|
|
8799
8820
|
}
|
|
8800
8821
|
})));
|
|
8801
8822
|
}
|
|
@@ -9249,7 +9270,7 @@ function isMemoSame(cached, memo) {
|
|
|
9249
9270
|
}
|
|
9250
9271
|
|
|
9251
9272
|
// Core API ------------------------------------------------------------------
|
|
9252
|
-
const version = "3.2.
|
|
9273
|
+
const version = "3.2.42";
|
|
9253
9274
|
/**
|
|
9254
9275
|
* SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
|
|
9255
9276
|
* @internal
|
|
@@ -9768,7 +9789,7 @@ class VueElement extends BaseClass {
|
|
|
9768
9789
|
}
|
|
9769
9790
|
}).observe(this, { attributes: true });
|
|
9770
9791
|
const resolve = (def) => {
|
|
9771
|
-
const { props, styles } = def;
|
|
9792
|
+
const { props = {}, styles } = def;
|
|
9772
9793
|
const hasOptions = !isArray(props);
|
|
9773
9794
|
const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];
|
|
9774
9795
|
// cast Number-type props set before resolve
|
|
@@ -9815,10 +9836,11 @@ class VueElement extends BaseClass {
|
|
|
9815
9836
|
}
|
|
9816
9837
|
_setAttr(key) {
|
|
9817
9838
|
let value = this.getAttribute(key);
|
|
9818
|
-
|
|
9839
|
+
const camelKey = camelize(key);
|
|
9840
|
+
if (this._numberProps && this._numberProps[camelKey]) {
|
|
9819
9841
|
value = toNumber(value);
|
|
9820
9842
|
}
|
|
9821
|
-
this._setProp(
|
|
9843
|
+
this._setProp(camelKey, value, false);
|
|
9822
9844
|
}
|
|
9823
9845
|
/**
|
|
9824
9846
|
* @internal
|
|
@@ -10211,11 +10233,11 @@ function getTransitionInfo(el, expectedType) {
|
|
|
10211
10233
|
const styles = window.getComputedStyle(el);
|
|
10212
10234
|
// JSDOM may return undefined for transition properties
|
|
10213
10235
|
const getStyleProperties = (key) => (styles[key] || '').split(', ');
|
|
10214
|
-
const transitionDelays = getStyleProperties(TRANSITION
|
|
10215
|
-
const transitionDurations = getStyleProperties(TRANSITION
|
|
10236
|
+
const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
|
|
10237
|
+
const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
|
|
10216
10238
|
const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
|
|
10217
|
-
const animationDelays = getStyleProperties(ANIMATION
|
|
10218
|
-
const animationDurations = getStyleProperties(ANIMATION
|
|
10239
|
+
const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
|
|
10240
|
+
const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
|
|
10219
10241
|
const animationTimeout = getTimeout(animationDelays, animationDurations);
|
|
10220
10242
|
let type = null;
|
|
10221
10243
|
let timeout = 0;
|
|
@@ -10250,7 +10272,7 @@ function getTransitionInfo(el, expectedType) {
|
|
|
10250
10272
|
: 0;
|
|
10251
10273
|
}
|
|
10252
10274
|
const hasTransform = type === TRANSITION &&
|
|
10253
|
-
/\b(transform|all)(,|$)/.test(
|
|
10275
|
+
/\b(transform|all)(,|$)/.test(getStyleProperties(`${TRANSITION}Property`).toString());
|
|
10254
10276
|
return {
|
|
10255
10277
|
type,
|
|
10256
10278
|
timeout,
|