@vue/compat 3.4.21 → 3.4.22
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 +205 -124
- package/dist/vue.cjs.prod.js +172 -116
- package/dist/vue.esm-browser.js +203 -124
- package/dist/vue.esm-browser.prod.js +6 -5
- package/dist/vue.esm-bundler.js +211 -134
- package/dist/vue.global.js +203 -124
- package/dist/vue.global.prod.js +7 -6
- package/dist/vue.runtime.esm-browser.js +180 -121
- package/dist/vue.runtime.esm-browser.prod.js +6 -5
- package/dist/vue.runtime.esm-bundler.js +188 -131
- package/dist/vue.runtime.global.js +180 -121
- package/dist/vue.runtime.global.prod.js +7 -6
- package/package.json +4 -4
package/dist/vue.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compat v3.4.
|
|
2
|
+
* @vue/compat v3.4.22
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -10,6 +10,8 @@ var estreeWalker = require('estree-walker');
|
|
|
10
10
|
var decode_js = require('entities/lib/decode.js');
|
|
11
11
|
var sourceMapJs = require('source-map-js');
|
|
12
12
|
|
|
13
|
+
/*! #__NO_SIDE_EFFECTS__ */
|
|
14
|
+
// @__NO_SIDE_EFFECTS__
|
|
13
15
|
function makeMap(str, expectsLowerCase) {
|
|
14
16
|
const set = new Set(str.split(","));
|
|
15
17
|
return expectsLowerCase ? (val) => set.has(val.toLowerCase()) : (val) => set.has(val);
|
|
@@ -405,7 +407,11 @@ const replacer = (_key, val) => {
|
|
|
405
407
|
};
|
|
406
408
|
const stringifySymbol = (v, i = "") => {
|
|
407
409
|
var _a;
|
|
408
|
-
return
|
|
410
|
+
return (
|
|
411
|
+
// Symbol.description in es2019+ so we need to cast here to pass
|
|
412
|
+
// the lib: es2016 check
|
|
413
|
+
isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v
|
|
414
|
+
);
|
|
409
415
|
};
|
|
410
416
|
|
|
411
417
|
function warn$2(msg, ...args) {
|
|
@@ -841,6 +847,8 @@ function createArrayInstrumentations() {
|
|
|
841
847
|
return instrumentations;
|
|
842
848
|
}
|
|
843
849
|
function hasOwnProperty(key) {
|
|
850
|
+
if (!isSymbol(key))
|
|
851
|
+
key = String(key);
|
|
844
852
|
const obj = toRaw(this);
|
|
845
853
|
track(obj, "has", key);
|
|
846
854
|
return obj.hasOwnProperty(key);
|
|
@@ -1193,23 +1201,16 @@ function createInstrumentations() {
|
|
|
1193
1201
|
clear: createReadonlyMethod("clear"),
|
|
1194
1202
|
forEach: createForEach(true, true)
|
|
1195
1203
|
};
|
|
1196
|
-
const iteratorMethods = [
|
|
1204
|
+
const iteratorMethods = [
|
|
1205
|
+
"keys",
|
|
1206
|
+
"values",
|
|
1207
|
+
"entries",
|
|
1208
|
+
Symbol.iterator
|
|
1209
|
+
];
|
|
1197
1210
|
iteratorMethods.forEach((method) => {
|
|
1198
|
-
mutableInstrumentations2[method] = createIterableMethod(
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
false
|
|
1202
|
-
);
|
|
1203
|
-
readonlyInstrumentations2[method] = createIterableMethod(
|
|
1204
|
-
method,
|
|
1205
|
-
true,
|
|
1206
|
-
false
|
|
1207
|
-
);
|
|
1208
|
-
shallowInstrumentations2[method] = createIterableMethod(
|
|
1209
|
-
method,
|
|
1210
|
-
false,
|
|
1211
|
-
true
|
|
1212
|
-
);
|
|
1211
|
+
mutableInstrumentations2[method] = createIterableMethod(method, false, false);
|
|
1212
|
+
readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
|
|
1213
|
+
shallowInstrumentations2[method] = createIterableMethod(method, false, true);
|
|
1213
1214
|
shallowReadonlyInstrumentations2[method] = createIterableMethod(
|
|
1214
1215
|
method,
|
|
1215
1216
|
true,
|
|
@@ -1366,7 +1367,7 @@ function isShallow(value) {
|
|
|
1366
1367
|
return !!(value && value["__v_isShallow"]);
|
|
1367
1368
|
}
|
|
1368
1369
|
function isProxy(value) {
|
|
1369
|
-
return
|
|
1370
|
+
return value ? !!value["__v_raw"] : false;
|
|
1370
1371
|
}
|
|
1371
1372
|
function toRaw(observed) {
|
|
1372
1373
|
const raw = observed && observed["__v_raw"];
|
|
@@ -1828,11 +1829,17 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
|
|
|
1828
1829
|
}
|
|
1829
1830
|
return res;
|
|
1830
1831
|
}
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1832
|
+
if (isArray(fn)) {
|
|
1833
|
+
const values = [];
|
|
1834
|
+
for (let i = 0; i < fn.length; i++) {
|
|
1835
|
+
values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
|
|
1836
|
+
}
|
|
1837
|
+
return values;
|
|
1838
|
+
} else {
|
|
1839
|
+
warn$1(
|
|
1840
|
+
`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`
|
|
1841
|
+
);
|
|
1834
1842
|
}
|
|
1835
|
-
return values;
|
|
1836
1843
|
}
|
|
1837
1844
|
function handleError(err, instance, type, throwInDev = true) {
|
|
1838
1845
|
const contextVNode = instance ? instance.vnode : null;
|
|
@@ -1853,12 +1860,14 @@ function handleError(err, instance, type, throwInDev = true) {
|
|
|
1853
1860
|
}
|
|
1854
1861
|
const appErrorHandler = instance.appContext.config.errorHandler;
|
|
1855
1862
|
if (appErrorHandler) {
|
|
1863
|
+
pauseTracking();
|
|
1856
1864
|
callWithErrorHandling(
|
|
1857
1865
|
appErrorHandler,
|
|
1858
1866
|
null,
|
|
1859
1867
|
10,
|
|
1860
1868
|
[err, exposedInstance, errorInfo]
|
|
1861
1869
|
);
|
|
1870
|
+
resetTracking();
|
|
1862
1871
|
return;
|
|
1863
1872
|
}
|
|
1864
1873
|
}
|
|
@@ -2234,6 +2243,8 @@ const devtoolsComponentRemoved = (component) => {
|
|
|
2234
2243
|
_devtoolsComponentRemoved(component);
|
|
2235
2244
|
}
|
|
2236
2245
|
};
|
|
2246
|
+
/*! #__NO_SIDE_EFFECTS__ */
|
|
2247
|
+
// @__NO_SIDE_EFFECTS__
|
|
2237
2248
|
function createDevtoolsComponentHook(hook) {
|
|
2238
2249
|
return (component) => {
|
|
2239
2250
|
emit$2(
|
|
@@ -4912,7 +4923,7 @@ const KeepAliveImpl = {
|
|
|
4912
4923
|
return () => {
|
|
4913
4924
|
pendingCacheKey = null;
|
|
4914
4925
|
if (!slots.default) {
|
|
4915
|
-
return null;
|
|
4926
|
+
return current = null;
|
|
4916
4927
|
}
|
|
4917
4928
|
const children = slots.default();
|
|
4918
4929
|
const rawVNode = children[0];
|
|
@@ -5643,47 +5654,74 @@ function installCompatInstanceProperties(map) {
|
|
|
5643
5654
|
$once: (i) => once.bind(null, i),
|
|
5644
5655
|
$off: (i) => off.bind(null, i),
|
|
5645
5656
|
$children: getCompatChildren,
|
|
5646
|
-
$listeners: getCompatListeners
|
|
5657
|
+
$listeners: getCompatListeners,
|
|
5658
|
+
// inject additional properties into $options for compat
|
|
5659
|
+
// e.g. vuex needs this.$options.parent
|
|
5660
|
+
$options: (i) => {
|
|
5661
|
+
if (!isCompatEnabled$1("PRIVATE_APIS", i)) {
|
|
5662
|
+
return resolveMergedOptions(i);
|
|
5663
|
+
}
|
|
5664
|
+
if (i.resolvedOptions) {
|
|
5665
|
+
return i.resolvedOptions;
|
|
5666
|
+
}
|
|
5667
|
+
const res = i.resolvedOptions = extend({}, resolveMergedOptions(i));
|
|
5668
|
+
Object.defineProperties(res, {
|
|
5669
|
+
parent: {
|
|
5670
|
+
get() {
|
|
5671
|
+
warnDeprecation$1("PRIVATE_APIS", i, "$options.parent");
|
|
5672
|
+
return i.proxy.$parent;
|
|
5673
|
+
}
|
|
5674
|
+
},
|
|
5675
|
+
propsData: {
|
|
5676
|
+
get() {
|
|
5677
|
+
warnDeprecation$1(
|
|
5678
|
+
"PRIVATE_APIS",
|
|
5679
|
+
i,
|
|
5680
|
+
"$options.propsData"
|
|
5681
|
+
);
|
|
5682
|
+
return i.vnode.props;
|
|
5683
|
+
}
|
|
5684
|
+
}
|
|
5685
|
+
});
|
|
5686
|
+
return res;
|
|
5687
|
+
}
|
|
5647
5688
|
});
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
|
|
5658
|
-
|
|
5659
|
-
|
|
5660
|
-
|
|
5661
|
-
|
|
5662
|
-
|
|
5663
|
-
|
|
5664
|
-
|
|
5665
|
-
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
|
|
5669
|
-
|
|
5670
|
-
|
|
5671
|
-
|
|
5672
|
-
|
|
5673
|
-
|
|
5674
|
-
|
|
5675
|
-
|
|
5676
|
-
|
|
5677
|
-
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
|
|
5683
|
-
|
|
5684
|
-
_d: () => legacyBindDynamicKeys,
|
|
5685
|
-
_p: () => legacyPrependModifier
|
|
5686
|
-
});
|
|
5689
|
+
const privateAPIs = {
|
|
5690
|
+
// needed by many libs / render fns
|
|
5691
|
+
$vnode: (i) => i.vnode,
|
|
5692
|
+
// some private properties that are likely accessed...
|
|
5693
|
+
_self: (i) => i.proxy,
|
|
5694
|
+
_uid: (i) => i.uid,
|
|
5695
|
+
_data: (i) => i.data,
|
|
5696
|
+
_isMounted: (i) => i.isMounted,
|
|
5697
|
+
_isDestroyed: (i) => i.isUnmounted,
|
|
5698
|
+
// v2 render helpers
|
|
5699
|
+
$createElement: () => compatH,
|
|
5700
|
+
_c: () => compatH,
|
|
5701
|
+
_o: () => legacyMarkOnce,
|
|
5702
|
+
_n: () => looseToNumber,
|
|
5703
|
+
_s: () => toDisplayString,
|
|
5704
|
+
_l: () => renderList,
|
|
5705
|
+
_t: (i) => legacyRenderSlot.bind(null, i),
|
|
5706
|
+
_q: () => looseEqual,
|
|
5707
|
+
_i: () => looseIndexOf,
|
|
5708
|
+
_m: (i) => legacyRenderStatic.bind(null, i),
|
|
5709
|
+
_f: () => resolveFilter$1,
|
|
5710
|
+
_k: (i) => legacyCheckKeyCodes.bind(null, i),
|
|
5711
|
+
_b: () => legacyBindObjectProps,
|
|
5712
|
+
_v: () => createTextVNode,
|
|
5713
|
+
_e: () => createCommentVNode,
|
|
5714
|
+
_u: () => legacyresolveScopedSlots,
|
|
5715
|
+
_g: () => legacyBindObjectListeners,
|
|
5716
|
+
_d: () => legacyBindDynamicKeys,
|
|
5717
|
+
_p: () => legacyPrependModifier
|
|
5718
|
+
};
|
|
5719
|
+
for (const key in privateAPIs) {
|
|
5720
|
+
map[key] = (i) => {
|
|
5721
|
+
if (isCompatEnabled$1("PRIVATE_APIS", i)) {
|
|
5722
|
+
return privateAPIs[key](i);
|
|
5723
|
+
}
|
|
5724
|
+
};
|
|
5687
5725
|
}
|
|
5688
5726
|
}
|
|
5689
5727
|
|
|
@@ -5724,6 +5762,9 @@ const isReservedPrefix = (key) => key === "_" || key === "$";
|
|
|
5724
5762
|
const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
|
|
5725
5763
|
const PublicInstanceProxyHandlers = {
|
|
5726
5764
|
get({ _: instance }, key) {
|
|
5765
|
+
if (key === "__v_skip") {
|
|
5766
|
+
return true;
|
|
5767
|
+
}
|
|
5727
5768
|
const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
|
|
5728
5769
|
if (key === "__isVue") {
|
|
5729
5770
|
return true;
|
|
@@ -6578,7 +6619,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
6578
6619
|
return vm;
|
|
6579
6620
|
}
|
|
6580
6621
|
}
|
|
6581
|
-
Vue.version = `2.6.14-compat:${"3.4.
|
|
6622
|
+
Vue.version = `2.6.14-compat:${"3.4.22"}`;
|
|
6582
6623
|
Vue.config = singletonApp.config;
|
|
6583
6624
|
Vue.use = (p, ...options) => {
|
|
6584
6625
|
if (p && isFunction(p.install)) {
|
|
@@ -6772,15 +6813,14 @@ function applySingletonPrototype(app, Ctor) {
|
|
|
6772
6813
|
app.config.globalProperties = Object.create(Ctor.prototype);
|
|
6773
6814
|
}
|
|
6774
6815
|
let hasPrototypeAugmentations = false;
|
|
6775
|
-
const
|
|
6776
|
-
for (const key in descriptors) {
|
|
6816
|
+
for (const key of Object.getOwnPropertyNames(Ctor.prototype)) {
|
|
6777
6817
|
if (key !== "constructor") {
|
|
6778
6818
|
hasPrototypeAugmentations = true;
|
|
6779
6819
|
if (enabled) {
|
|
6780
6820
|
Object.defineProperty(
|
|
6781
6821
|
app.config.globalProperties,
|
|
6782
6822
|
key,
|
|
6783
|
-
|
|
6823
|
+
Object.getOwnPropertyDescriptor(Ctor.prototype, key)
|
|
6784
6824
|
);
|
|
6785
6825
|
}
|
|
6786
6826
|
}
|
|
@@ -7216,10 +7256,10 @@ function shouldSkipAttr(key, instance) {
|
|
|
7216
7256
|
return false;
|
|
7217
7257
|
}
|
|
7218
7258
|
|
|
7259
|
+
const attrsProto = {};
|
|
7219
7260
|
function initProps(instance, rawProps, isStateful, isSSR = false) {
|
|
7220
7261
|
const props = {};
|
|
7221
|
-
const attrs =
|
|
7222
|
-
def(attrs, InternalObjectKey, 1);
|
|
7262
|
+
const attrs = Object.create(attrsProto);
|
|
7223
7263
|
instance.propsDefaults = /* @__PURE__ */ Object.create(null);
|
|
7224
7264
|
setFullProps(instance, rawProps, props, attrs);
|
|
7225
7265
|
for (const key in instance.propsOptions[0]) {
|
|
@@ -7341,7 +7381,7 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
7341
7381
|
}
|
|
7342
7382
|
}
|
|
7343
7383
|
if (hasAttrsChanged) {
|
|
7344
|
-
trigger(instance, "set", "
|
|
7384
|
+
trigger(instance.attrs, "set", "");
|
|
7345
7385
|
}
|
|
7346
7386
|
{
|
|
7347
7387
|
validateProps(rawProps || {}, props, instance);
|
|
@@ -7699,7 +7739,7 @@ const initSlots = (instance, children) => {
|
|
|
7699
7739
|
const type = children._;
|
|
7700
7740
|
if (type) {
|
|
7701
7741
|
instance.slots = toRaw(children);
|
|
7702
|
-
def(
|
|
7742
|
+
def(instance.slots, "_", type);
|
|
7703
7743
|
} else {
|
|
7704
7744
|
normalizeObjectSlots(
|
|
7705
7745
|
children,
|
|
@@ -7713,7 +7753,6 @@ const initSlots = (instance, children) => {
|
|
|
7713
7753
|
normalizeVNodeSlots(instance, children);
|
|
7714
7754
|
}
|
|
7715
7755
|
}
|
|
7716
|
-
def(instance.slots, InternalObjectKey, 1);
|
|
7717
7756
|
};
|
|
7718
7757
|
const updateSlots = (instance, children, optimized) => {
|
|
7719
7758
|
const { vnode, slots } = instance;
|
|
@@ -7885,6 +7924,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7885
7924
|
}
|
|
7886
7925
|
};
|
|
7887
7926
|
const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
|
|
7927
|
+
optimized = optimized || !!vnode.dynamicChildren;
|
|
7888
7928
|
const isFragmentStart = isComment(node) && node.data === "[";
|
|
7889
7929
|
const onMismatch = () => handleMismatch(
|
|
7890
7930
|
node,
|
|
@@ -10404,7 +10444,6 @@ const createVNodeWithArgsTransform = (...args) => {
|
|
|
10404
10444
|
...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args
|
|
10405
10445
|
);
|
|
10406
10446
|
};
|
|
10407
|
-
const InternalObjectKey = `__vInternal`;
|
|
10408
10447
|
const normalizeKey = ({ key }) => key != null ? key : null;
|
|
10409
10448
|
const normalizeRef = ({
|
|
10410
10449
|
ref,
|
|
@@ -10544,7 +10583,7 @@ Component that was made reactive: `,
|
|
|
10544
10583
|
function guardReactiveProps(props) {
|
|
10545
10584
|
if (!props)
|
|
10546
10585
|
return null;
|
|
10547
|
-
return isProxy(props) ||
|
|
10586
|
+
return isProxy(props) || Object.getPrototypeOf(props) === attrsProto ? extend({}, props) : props;
|
|
10548
10587
|
}
|
|
10549
10588
|
function cloneVNode(vnode, extraProps, mergeRef = false) {
|
|
10550
10589
|
const { props, ref, patchFlag, children } = vnode;
|
|
@@ -10652,7 +10691,7 @@ function normalizeChildren(vnode, children) {
|
|
|
10652
10691
|
} else {
|
|
10653
10692
|
type = 32;
|
|
10654
10693
|
const slotFlag = children._;
|
|
10655
|
-
if (!slotFlag
|
|
10694
|
+
if (!slotFlag) {
|
|
10656
10695
|
children._ctx = currentRenderingInstance;
|
|
10657
10696
|
} else if (slotFlag === 3 && currentRenderingInstance) {
|
|
10658
10697
|
if (currentRenderingInstance.slots._ === 1) {
|
|
@@ -10888,7 +10927,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
10888
10927
|
}
|
|
10889
10928
|
}
|
|
10890
10929
|
instance.accessCache = /* @__PURE__ */ Object.create(null);
|
|
10891
|
-
instance.proxy =
|
|
10930
|
+
instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
|
|
10892
10931
|
{
|
|
10893
10932
|
exposePropsOnRenderContext(instance);
|
|
10894
10933
|
}
|
|
@@ -11034,26 +11073,21 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
11034
11073
|
}
|
|
11035
11074
|
}
|
|
11036
11075
|
}
|
|
11037
|
-
|
|
11038
|
-
|
|
11039
|
-
|
|
11040
|
-
|
|
11041
|
-
|
|
11042
|
-
|
|
11043
|
-
|
|
11044
|
-
|
|
11045
|
-
|
|
11046
|
-
|
|
11047
|
-
|
|
11048
|
-
|
|
11049
|
-
|
|
11050
|
-
|
|
11051
|
-
|
|
11052
|
-
return false;
|
|
11053
|
-
}
|
|
11054
|
-
}
|
|
11055
|
-
));
|
|
11056
|
-
}
|
|
11076
|
+
const attrsProxyHandlers = {
|
|
11077
|
+
get(target, key) {
|
|
11078
|
+
markAttrsAccessed();
|
|
11079
|
+
track(target, "get", "");
|
|
11080
|
+
return target[key];
|
|
11081
|
+
},
|
|
11082
|
+
set() {
|
|
11083
|
+
warn$1(`setupContext.attrs is readonly.`);
|
|
11084
|
+
return false;
|
|
11085
|
+
},
|
|
11086
|
+
deleteProperty() {
|
|
11087
|
+
warn$1(`setupContext.attrs is readonly.`);
|
|
11088
|
+
return false;
|
|
11089
|
+
}
|
|
11090
|
+
} ;
|
|
11057
11091
|
function getSlotsProxy(instance) {
|
|
11058
11092
|
return instance.slotsProxy || (instance.slotsProxy = new Proxy(instance.slots, {
|
|
11059
11093
|
get(target, key) {
|
|
@@ -11087,9 +11121,10 @@ function createSetupContext(instance) {
|
|
|
11087
11121
|
instance.exposed = exposed || {};
|
|
11088
11122
|
};
|
|
11089
11123
|
{
|
|
11124
|
+
let attrsProxy;
|
|
11090
11125
|
return Object.freeze({
|
|
11091
11126
|
get attrs() {
|
|
11092
|
-
return
|
|
11127
|
+
return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers));
|
|
11093
11128
|
},
|
|
11094
11129
|
get slots() {
|
|
11095
11130
|
return getSlotsProxy(instance);
|
|
@@ -11434,7 +11469,7 @@ function isMemoSame(cached, memo) {
|
|
|
11434
11469
|
return true;
|
|
11435
11470
|
}
|
|
11436
11471
|
|
|
11437
|
-
const version = "3.4.
|
|
11472
|
+
const version = "3.4.22";
|
|
11438
11473
|
const warn = warn$1 ;
|
|
11439
11474
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
11440
11475
|
const devtools = devtools$1 ;
|
|
@@ -12125,11 +12160,14 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
|
|
|
12125
12160
|
const invokers = el[veiKey] || (el[veiKey] = {});
|
|
12126
12161
|
const existingInvoker = invokers[rawName];
|
|
12127
12162
|
if (nextValue && existingInvoker) {
|
|
12128
|
-
existingInvoker.value = nextValue;
|
|
12163
|
+
existingInvoker.value = sanitizeEventValue(nextValue, rawName) ;
|
|
12129
12164
|
} else {
|
|
12130
12165
|
const [name, options] = parseName(rawName);
|
|
12131
12166
|
if (nextValue) {
|
|
12132
|
-
const invoker = invokers[rawName] = createInvoker(
|
|
12167
|
+
const invoker = invokers[rawName] = createInvoker(
|
|
12168
|
+
sanitizeEventValue(nextValue, rawName) ,
|
|
12169
|
+
instance
|
|
12170
|
+
);
|
|
12133
12171
|
addEventListener(el, name, invoker, options);
|
|
12134
12172
|
} else if (existingInvoker) {
|
|
12135
12173
|
removeEventListener(el, name, existingInvoker, options);
|
|
@@ -12172,6 +12210,16 @@ function createInvoker(initialValue, instance) {
|
|
|
12172
12210
|
invoker.attached = getNow();
|
|
12173
12211
|
return invoker;
|
|
12174
12212
|
}
|
|
12213
|
+
function sanitizeEventValue(value, propName) {
|
|
12214
|
+
if (isFunction(value) || isArray(value)) {
|
|
12215
|
+
return value;
|
|
12216
|
+
}
|
|
12217
|
+
warn(
|
|
12218
|
+
`Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?
|
|
12219
|
+
Expected function or array of functions, received type ${typeof value}.`
|
|
12220
|
+
);
|
|
12221
|
+
return NOOP;
|
|
12222
|
+
}
|
|
12175
12223
|
function patchStopImmediatePropagation(e, value) {
|
|
12176
12224
|
if (isArray(value)) {
|
|
12177
12225
|
const originalStop = e.stopImmediatePropagation;
|
|
@@ -12179,7 +12227,9 @@ function patchStopImmediatePropagation(e, value) {
|
|
|
12179
12227
|
originalStop.call(e);
|
|
12180
12228
|
e._stopped = true;
|
|
12181
12229
|
};
|
|
12182
|
-
return value.map(
|
|
12230
|
+
return value.map(
|
|
12231
|
+
(fn) => (e2) => !e2._stopped && fn && fn(e2)
|
|
12232
|
+
);
|
|
12183
12233
|
} else {
|
|
12184
12234
|
return value;
|
|
12185
12235
|
}
|
|
@@ -12380,7 +12430,7 @@ class VueElement extends BaseClass {
|
|
|
12380
12430
|
}
|
|
12381
12431
|
}
|
|
12382
12432
|
_setAttr(key) {
|
|
12383
|
-
let value = this.getAttribute(key);
|
|
12433
|
+
let value = this.hasAttribute(key) ? this.getAttribute(key) : void 0;
|
|
12384
12434
|
const camelKey = camelize(key);
|
|
12385
12435
|
if (this._numberProps && this._numberProps[camelKey]) {
|
|
12386
12436
|
value = toNumber(value);
|
|
@@ -12552,7 +12602,28 @@ const TransitionGroupImpl = {
|
|
|
12552
12602
|
)) {
|
|
12553
12603
|
tag = "span";
|
|
12554
12604
|
}
|
|
12555
|
-
prevChildren =
|
|
12605
|
+
prevChildren = [];
|
|
12606
|
+
if (children) {
|
|
12607
|
+
for (let i = 0; i < children.length; i++) {
|
|
12608
|
+
const child = children[i];
|
|
12609
|
+
if (child.el && child.el instanceof Element) {
|
|
12610
|
+
prevChildren.push(child);
|
|
12611
|
+
setTransitionHooks(
|
|
12612
|
+
child,
|
|
12613
|
+
resolveTransitionHooks(
|
|
12614
|
+
child,
|
|
12615
|
+
cssTransitionProps,
|
|
12616
|
+
state,
|
|
12617
|
+
instance
|
|
12618
|
+
)
|
|
12619
|
+
);
|
|
12620
|
+
positionMap.set(
|
|
12621
|
+
child,
|
|
12622
|
+
child.el.getBoundingClientRect()
|
|
12623
|
+
);
|
|
12624
|
+
}
|
|
12625
|
+
}
|
|
12626
|
+
}
|
|
12556
12627
|
children = slots.default ? getTransitionRawChildren(slots.default()) : [];
|
|
12557
12628
|
for (let i = 0; i < children.length; i++) {
|
|
12558
12629
|
const child = children[i];
|
|
@@ -12565,16 +12636,6 @@ const TransitionGroupImpl = {
|
|
|
12565
12636
|
warn(`<TransitionGroup> children must be keyed.`);
|
|
12566
12637
|
}
|
|
12567
12638
|
}
|
|
12568
|
-
if (prevChildren) {
|
|
12569
|
-
for (let i = 0; i < prevChildren.length; i++) {
|
|
12570
|
-
const child = prevChildren[i];
|
|
12571
|
-
setTransitionHooks(
|
|
12572
|
-
child,
|
|
12573
|
-
resolveTransitionHooks(child, cssTransitionProps, state, instance)
|
|
12574
|
-
);
|
|
12575
|
-
positionMap.set(child, child.el.getBoundingClientRect());
|
|
12576
|
-
}
|
|
12577
|
-
}
|
|
12578
12639
|
return createVNode(tag, null, children);
|
|
12579
12640
|
};
|
|
12580
12641
|
}
|
|
@@ -12676,7 +12737,7 @@ const vModelText = {
|
|
|
12676
12737
|
el[assignKey] = getModelAssigner(vnode);
|
|
12677
12738
|
if (el.composing)
|
|
12678
12739
|
return;
|
|
12679
|
-
const elValue = number || el.type === "number" ? looseToNumber(el.value) : el.value;
|
|
12740
|
+
const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
|
|
12680
12741
|
const newValue = value == null ? "" : value;
|
|
12681
12742
|
if (elValue === newValue) {
|
|
12682
12743
|
return;
|
|
@@ -12779,14 +12840,14 @@ const vModelSelect = {
|
|
|
12779
12840
|
// set value in mounted & updated because <select> relies on its children
|
|
12780
12841
|
// <option>s.
|
|
12781
12842
|
mounted(el, { value, modifiers: { number } }) {
|
|
12782
|
-
setSelected(el, value
|
|
12843
|
+
setSelected(el, value);
|
|
12783
12844
|
},
|
|
12784
12845
|
beforeUpdate(el, _binding, vnode) {
|
|
12785
12846
|
el[assignKey] = getModelAssigner(vnode);
|
|
12786
12847
|
},
|
|
12787
12848
|
updated(el, { value, modifiers: { number } }) {
|
|
12788
12849
|
if (!el._assigning) {
|
|
12789
|
-
setSelected(el, value
|
|
12850
|
+
setSelected(el, value);
|
|
12790
12851
|
}
|
|
12791
12852
|
}
|
|
12792
12853
|
};
|
|
@@ -12806,9 +12867,7 @@ function setSelected(el, value, number) {
|
|
|
12806
12867
|
if (isArrayValue) {
|
|
12807
12868
|
const optionType = typeof optionValue;
|
|
12808
12869
|
if (optionType === "string" || optionType === "number") {
|
|
12809
|
-
option.selected = value.
|
|
12810
|
-
number ? looseToNumber(optionValue) : optionValue
|
|
12811
|
-
);
|
|
12870
|
+
option.selected = value.some((v) => String(v) === String(optionValue));
|
|
12812
12871
|
} else {
|
|
12813
12872
|
option.selected = looseIndexOf(value, optionValue) > -1;
|
|
12814
12873
|
}
|
|
@@ -15514,7 +15573,7 @@ function onCloseTag(el, end, isImplied = false) {
|
|
|
15514
15573
|
if (isImplied) {
|
|
15515
15574
|
setLocEnd(el.loc, backTrack(end, 60));
|
|
15516
15575
|
} else {
|
|
15517
|
-
setLocEnd(el.loc, end + 1);
|
|
15576
|
+
setLocEnd(el.loc, lookAhead(end, 62) + 1);
|
|
15518
15577
|
}
|
|
15519
15578
|
if (tokenizer.inSFCRoot) {
|
|
15520
15579
|
if (el.children.length) {
|
|
@@ -15609,6 +15668,12 @@ function onCloseTag(el, end, isImplied = false) {
|
|
|
15609
15668
|
}
|
|
15610
15669
|
}
|
|
15611
15670
|
}
|
|
15671
|
+
function lookAhead(index, c) {
|
|
15672
|
+
let i = index;
|
|
15673
|
+
while (currentInput.charCodeAt(i) !== c && i < currentInput.length - 1)
|
|
15674
|
+
i++;
|
|
15675
|
+
return i;
|
|
15676
|
+
}
|
|
15612
15677
|
function backTrack(index, c) {
|
|
15613
15678
|
let i = index;
|
|
15614
15679
|
while (currentInput.charCodeAt(i) !== c && i >= 0)
|
|
@@ -16510,7 +16575,6 @@ function createCodegenContext(ast, {
|
|
|
16510
16575
|
generatedLine: context.line,
|
|
16511
16576
|
generatedColumn: context.column - 1,
|
|
16512
16577
|
source: filename,
|
|
16513
|
-
// @ts-expect-error it is possible to be null
|
|
16514
16578
|
name
|
|
16515
16579
|
});
|
|
16516
16580
|
}
|
|
@@ -18271,13 +18335,30 @@ const transformElement = (node, context) => {
|
|
|
18271
18335
|
function resolveComponentType(node, context, ssr = false) {
|
|
18272
18336
|
let { tag } = node;
|
|
18273
18337
|
const isExplicitDynamic = isComponentTag(tag);
|
|
18274
|
-
const isProp = findProp(
|
|
18338
|
+
const isProp = findProp(
|
|
18339
|
+
node,
|
|
18340
|
+
"is",
|
|
18341
|
+
false,
|
|
18342
|
+
true
|
|
18343
|
+
/* allow empty */
|
|
18344
|
+
);
|
|
18275
18345
|
if (isProp) {
|
|
18276
18346
|
if (isExplicitDynamic || isCompatEnabled(
|
|
18277
18347
|
"COMPILER_IS_ON_ELEMENT",
|
|
18278
18348
|
context
|
|
18279
18349
|
)) {
|
|
18280
|
-
|
|
18350
|
+
let exp;
|
|
18351
|
+
if (isProp.type === 6) {
|
|
18352
|
+
exp = isProp.value && createSimpleExpression(isProp.value.content, true);
|
|
18353
|
+
} else {
|
|
18354
|
+
exp = isProp.exp;
|
|
18355
|
+
if (!exp) {
|
|
18356
|
+
exp = createSimpleExpression(`is`, false, isProp.loc);
|
|
18357
|
+
{
|
|
18358
|
+
exp = isProp.exp = processExpression(exp, context);
|
|
18359
|
+
}
|
|
18360
|
+
}
|
|
18361
|
+
}
|
|
18281
18362
|
if (exp) {
|
|
18282
18363
|
return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [
|
|
18283
18364
|
exp
|