@vue/compat 3.2.44 → 3.2.46
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 +751 -628
- package/dist/vue.cjs.prod.js +556 -418
- package/dist/vue.esm-browser.js +767 -635
- package/dist/vue.esm-browser.prod.js +1 -1
- package/dist/vue.esm-bundler.js +772 -642
- package/dist/vue.global.js +761 -629
- package/dist/vue.global.prod.js +1 -1
- package/dist/vue.runtime.esm-browser.js +554 -434
- package/dist/vue.runtime.esm-browser.prod.js +1 -1
- package/dist/vue.runtime.esm-bundler.js +559 -441
- package/dist/vue.runtime.global.js +548 -428
- package/dist/vue.runtime.global.prod.js +1 -1
- package/package.json +2 -2
package/dist/vue.cjs.prod.js
CHANGED
|
@@ -20,6 +20,26 @@ function makeMap(str, expectsLowerCase) {
|
|
|
20
20
|
return expectsLowerCase ? val => !!map[val.toLowerCase()] : val => !!map[val];
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
/**
|
|
24
|
+
* dev only flag -> name mapping
|
|
25
|
+
*/
|
|
26
|
+
const PatchFlagNames = {
|
|
27
|
+
[1 /* PatchFlags.TEXT */]: `TEXT`,
|
|
28
|
+
[2 /* PatchFlags.CLASS */]: `CLASS`,
|
|
29
|
+
[4 /* PatchFlags.STYLE */]: `STYLE`,
|
|
30
|
+
[8 /* PatchFlags.PROPS */]: `PROPS`,
|
|
31
|
+
[16 /* PatchFlags.FULL_PROPS */]: `FULL_PROPS`,
|
|
32
|
+
[32 /* PatchFlags.HYDRATE_EVENTS */]: `HYDRATE_EVENTS`,
|
|
33
|
+
[64 /* PatchFlags.STABLE_FRAGMENT */]: `STABLE_FRAGMENT`,
|
|
34
|
+
[128 /* PatchFlags.KEYED_FRAGMENT */]: `KEYED_FRAGMENT`,
|
|
35
|
+
[256 /* PatchFlags.UNKEYED_FRAGMENT */]: `UNKEYED_FRAGMENT`,
|
|
36
|
+
[512 /* PatchFlags.NEED_PATCH */]: `NEED_PATCH`,
|
|
37
|
+
[1024 /* PatchFlags.DYNAMIC_SLOTS */]: `DYNAMIC_SLOTS`,
|
|
38
|
+
[2048 /* PatchFlags.DEV_ROOT_FRAGMENT */]: `DEV_ROOT_FRAGMENT`,
|
|
39
|
+
[-1 /* PatchFlags.HOISTED */]: `HOISTED`,
|
|
40
|
+
[-2 /* PatchFlags.BAIL */]: `BAIL`
|
|
41
|
+
};
|
|
42
|
+
|
|
23
43
|
const GLOBALS_WHITE_LISTED = 'Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,' +
|
|
24
44
|
'decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,' +
|
|
25
45
|
'Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt';
|
|
@@ -117,7 +137,7 @@ function normalizeProps(props) {
|
|
|
117
137
|
// These tag configs are shared between compiler-dom and runtime-dom, so they
|
|
118
138
|
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element
|
|
119
139
|
const HTML_TAGS = 'html,body,base,head,link,meta,style,title,address,article,aside,footer,' +
|
|
120
|
-
'header,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,' +
|
|
140
|
+
'header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,' +
|
|
121
141
|
'figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,' +
|
|
122
142
|
'data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,' +
|
|
123
143
|
'time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,' +
|
|
@@ -129,7 +149,7 @@ const HTML_TAGS = 'html,body,base,head,link,meta,style,title,address,article,asi
|
|
|
129
149
|
const SVG_TAGS = 'svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,' +
|
|
130
150
|
'defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,' +
|
|
131
151
|
'feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,' +
|
|
132
|
-
'
|
|
152
|
+
'feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,' +
|
|
133
153
|
'feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,' +
|
|
134
154
|
'fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,' +
|
|
135
155
|
'foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,' +
|
|
@@ -395,12 +415,13 @@ const remove = (arr, el) => {
|
|
|
395
415
|
arr.splice(i, 1);
|
|
396
416
|
}
|
|
397
417
|
};
|
|
398
|
-
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
399
|
-
const hasOwn = (val, key) => hasOwnProperty.call(val, key);
|
|
418
|
+
const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
419
|
+
const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
|
|
400
420
|
const isArray = Array.isArray;
|
|
401
421
|
const isMap = (val) => toTypeString(val) === '[object Map]';
|
|
402
422
|
const isSet = (val) => toTypeString(val) === '[object Set]';
|
|
403
423
|
const isDate = (val) => toTypeString(val) === '[object Date]';
|
|
424
|
+
const isRegExp = (val) => toTypeString(val) === '[object RegExp]';
|
|
404
425
|
const isFunction = (val) => typeof val === 'function';
|
|
405
426
|
const isString = (val) => typeof val === 'string';
|
|
406
427
|
const isSymbol = (val) => typeof val === 'symbol';
|
|
@@ -467,10 +488,22 @@ const def = (obj, key, value) => {
|
|
|
467
488
|
value
|
|
468
489
|
});
|
|
469
490
|
};
|
|
470
|
-
|
|
491
|
+
/**
|
|
492
|
+
* "123-foo" will be parsed to 123
|
|
493
|
+
* This is used for the .number modifier in v-model
|
|
494
|
+
*/
|
|
495
|
+
const looseToNumber = (val) => {
|
|
471
496
|
const n = parseFloat(val);
|
|
472
497
|
return isNaN(n) ? val : n;
|
|
473
498
|
};
|
|
499
|
+
/**
|
|
500
|
+
* Only conerces number-like strings
|
|
501
|
+
* "123-foo" will be returned as-is
|
|
502
|
+
*/
|
|
503
|
+
const toNumber = (val) => {
|
|
504
|
+
const n = isString(val) ? Number(val) : NaN;
|
|
505
|
+
return isNaN(n) ? val : n;
|
|
506
|
+
};
|
|
474
507
|
let _globalThis;
|
|
475
508
|
const getGlobalThis = () => {
|
|
476
509
|
return (_globalThis ||
|
|
@@ -499,7 +532,7 @@ class EffectScope {
|
|
|
499
532
|
/**
|
|
500
533
|
* @internal
|
|
501
534
|
*/
|
|
502
|
-
this.
|
|
535
|
+
this._active = true;
|
|
503
536
|
/**
|
|
504
537
|
* @internal
|
|
505
538
|
*/
|
|
@@ -514,8 +547,11 @@ class EffectScope {
|
|
|
514
547
|
(activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;
|
|
515
548
|
}
|
|
516
549
|
}
|
|
550
|
+
get active() {
|
|
551
|
+
return this._active;
|
|
552
|
+
}
|
|
517
553
|
run(fn) {
|
|
518
|
-
if (this.
|
|
554
|
+
if (this._active) {
|
|
519
555
|
const currentEffectScope = activeEffectScope;
|
|
520
556
|
try {
|
|
521
557
|
activeEffectScope = this;
|
|
@@ -541,7 +577,7 @@ class EffectScope {
|
|
|
541
577
|
activeEffectScope = this.parent;
|
|
542
578
|
}
|
|
543
579
|
stop(fromParent) {
|
|
544
|
-
if (this.
|
|
580
|
+
if (this._active) {
|
|
545
581
|
let i, l;
|
|
546
582
|
for (i = 0, l = this.effects.length; i < l; i++) {
|
|
547
583
|
this.effects[i].stop();
|
|
@@ -564,7 +600,7 @@ class EffectScope {
|
|
|
564
600
|
}
|
|
565
601
|
}
|
|
566
602
|
this.parent = undefined;
|
|
567
|
-
this.
|
|
603
|
+
this._active = false;
|
|
568
604
|
}
|
|
569
605
|
}
|
|
570
606
|
}
|
|
@@ -776,7 +812,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
776
812
|
deps = [...depsMap.values()];
|
|
777
813
|
}
|
|
778
814
|
else if (key === 'length' && isArray(target)) {
|
|
779
|
-
const newLength =
|
|
815
|
+
const newLength = Number(newValue);
|
|
780
816
|
depsMap.forEach((dep, key) => {
|
|
781
817
|
if (key === 'length' || key >= newLength) {
|
|
782
818
|
deps.push(dep);
|
|
@@ -860,6 +896,10 @@ function triggerEffect(effect, debuggerEventExtraInfo) {
|
|
|
860
896
|
}
|
|
861
897
|
}
|
|
862
898
|
}
|
|
899
|
+
function getDepFromReactive(object, key) {
|
|
900
|
+
var _a;
|
|
901
|
+
return (_a = targetMap.get(object)) === null || _a === void 0 ? void 0 : _a.get(key);
|
|
902
|
+
}
|
|
863
903
|
|
|
864
904
|
const isNonTrackableKeys = /*#__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);
|
|
865
905
|
const builtInSymbols = new Set(
|
|
@@ -871,7 +911,7 @@ Object.getOwnPropertyNames(Symbol)
|
|
|
871
911
|
.filter(key => key !== 'arguments' && key !== 'caller')
|
|
872
912
|
.map(key => Symbol[key])
|
|
873
913
|
.filter(isSymbol));
|
|
874
|
-
const get = /*#__PURE__*/ createGetter();
|
|
914
|
+
const get$1 = /*#__PURE__*/ createGetter();
|
|
875
915
|
const shallowGet = /*#__PURE__*/ createGetter(false, true);
|
|
876
916
|
const readonlyGet = /*#__PURE__*/ createGetter(true);
|
|
877
917
|
const shallowReadonlyGet = /*#__PURE__*/ createGetter(true, true);
|
|
@@ -905,6 +945,11 @@ function createArrayInstrumentations() {
|
|
|
905
945
|
});
|
|
906
946
|
return instrumentations;
|
|
907
947
|
}
|
|
948
|
+
function hasOwnProperty(key) {
|
|
949
|
+
const obj = toRaw(this);
|
|
950
|
+
track(obj, "has" /* TrackOpTypes.HAS */, key);
|
|
951
|
+
return obj.hasOwnProperty(key);
|
|
952
|
+
}
|
|
908
953
|
function createGetter(isReadonly = false, shallow = false) {
|
|
909
954
|
return function get(target, key, receiver) {
|
|
910
955
|
if (key === "__v_isReactive" /* ReactiveFlags.IS_REACTIVE */) {
|
|
@@ -928,8 +973,13 @@ function createGetter(isReadonly = false, shallow = false) {
|
|
|
928
973
|
return target;
|
|
929
974
|
}
|
|
930
975
|
const targetIsArray = isArray(target);
|
|
931
|
-
if (!isReadonly
|
|
932
|
-
|
|
976
|
+
if (!isReadonly) {
|
|
977
|
+
if (targetIsArray && hasOwn(arrayInstrumentations, key)) {
|
|
978
|
+
return Reflect.get(arrayInstrumentations, key, receiver);
|
|
979
|
+
}
|
|
980
|
+
if (key === 'hasOwnProperty') {
|
|
981
|
+
return hasOwnProperty;
|
|
982
|
+
}
|
|
933
983
|
}
|
|
934
984
|
const res = Reflect.get(target, key, receiver);
|
|
935
985
|
if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
|
|
@@ -954,7 +1004,7 @@ function createGetter(isReadonly = false, shallow = false) {
|
|
|
954
1004
|
return res;
|
|
955
1005
|
};
|
|
956
1006
|
}
|
|
957
|
-
const set = /*#__PURE__*/ createSetter();
|
|
1007
|
+
const set$1 = /*#__PURE__*/ createSetter();
|
|
958
1008
|
const shallowSet = /*#__PURE__*/ createSetter(true);
|
|
959
1009
|
function createSetter(shallow = false) {
|
|
960
1010
|
return function set(target, key, value, receiver) {
|
|
@@ -997,7 +1047,7 @@ function deleteProperty(target, key) {
|
|
|
997
1047
|
}
|
|
998
1048
|
return result;
|
|
999
1049
|
}
|
|
1000
|
-
function has(target, key) {
|
|
1050
|
+
function has$1(target, key) {
|
|
1001
1051
|
const result = Reflect.has(target, key);
|
|
1002
1052
|
if (!isSymbol(key) || !builtInSymbols.has(key)) {
|
|
1003
1053
|
track(target, "has" /* TrackOpTypes.HAS */, key);
|
|
@@ -1009,10 +1059,10 @@ function ownKeys(target) {
|
|
|
1009
1059
|
return Reflect.ownKeys(target);
|
|
1010
1060
|
}
|
|
1011
1061
|
const mutableHandlers = {
|
|
1012
|
-
get,
|
|
1013
|
-
set,
|
|
1062
|
+
get: get$1,
|
|
1063
|
+
set: set$1,
|
|
1014
1064
|
deleteProperty,
|
|
1015
|
-
has,
|
|
1065
|
+
has: has$1,
|
|
1016
1066
|
ownKeys
|
|
1017
1067
|
};
|
|
1018
1068
|
const readonlyHandlers = {
|
|
@@ -1037,7 +1087,7 @@ const shallowReadonlyHandlers = /*#__PURE__*/ extend({}, readonlyHandlers, {
|
|
|
1037
1087
|
|
|
1038
1088
|
const toShallow = (value) => value;
|
|
1039
1089
|
const getProto = (v) => Reflect.getPrototypeOf(v);
|
|
1040
|
-
function get
|
|
1090
|
+
function get(target, key, isReadonly = false, isShallow = false) {
|
|
1041
1091
|
// #1772: readonly(reactive(Map)) should return readonly + reactive version
|
|
1042
1092
|
// of the value
|
|
1043
1093
|
target = target["__v_raw" /* ReactiveFlags.RAW */];
|
|
@@ -1063,7 +1113,7 @@ function get$1(target, key, isReadonly = false, isShallow = false) {
|
|
|
1063
1113
|
target.get(key);
|
|
1064
1114
|
}
|
|
1065
1115
|
}
|
|
1066
|
-
function has
|
|
1116
|
+
function has(key, isReadonly = false) {
|
|
1067
1117
|
const target = this["__v_raw" /* ReactiveFlags.RAW */];
|
|
1068
1118
|
const rawTarget = toRaw(target);
|
|
1069
1119
|
const rawKey = toRaw(key);
|
|
@@ -1093,7 +1143,7 @@ function add(value) {
|
|
|
1093
1143
|
}
|
|
1094
1144
|
return this;
|
|
1095
1145
|
}
|
|
1096
|
-
function set
|
|
1146
|
+
function set(key, value) {
|
|
1097
1147
|
value = toRaw(value);
|
|
1098
1148
|
const target = toRaw(this);
|
|
1099
1149
|
const { has, get } = getProto(target);
|
|
@@ -1192,41 +1242,41 @@ function createReadonlyMethod(type) {
|
|
|
1192
1242
|
function createInstrumentations() {
|
|
1193
1243
|
const mutableInstrumentations = {
|
|
1194
1244
|
get(key) {
|
|
1195
|
-
return get
|
|
1245
|
+
return get(this, key);
|
|
1196
1246
|
},
|
|
1197
1247
|
get size() {
|
|
1198
1248
|
return size(this);
|
|
1199
1249
|
},
|
|
1200
|
-
has
|
|
1250
|
+
has,
|
|
1201
1251
|
add,
|
|
1202
|
-
set
|
|
1252
|
+
set,
|
|
1203
1253
|
delete: deleteEntry,
|
|
1204
1254
|
clear,
|
|
1205
1255
|
forEach: createForEach(false, false)
|
|
1206
1256
|
};
|
|
1207
1257
|
const shallowInstrumentations = {
|
|
1208
1258
|
get(key) {
|
|
1209
|
-
return get
|
|
1259
|
+
return get(this, key, false, true);
|
|
1210
1260
|
},
|
|
1211
1261
|
get size() {
|
|
1212
1262
|
return size(this);
|
|
1213
1263
|
},
|
|
1214
|
-
has
|
|
1264
|
+
has,
|
|
1215
1265
|
add,
|
|
1216
|
-
set
|
|
1266
|
+
set,
|
|
1217
1267
|
delete: deleteEntry,
|
|
1218
1268
|
clear,
|
|
1219
1269
|
forEach: createForEach(false, true)
|
|
1220
1270
|
};
|
|
1221
1271
|
const readonlyInstrumentations = {
|
|
1222
1272
|
get(key) {
|
|
1223
|
-
return get
|
|
1273
|
+
return get(this, key, true);
|
|
1224
1274
|
},
|
|
1225
1275
|
get size() {
|
|
1226
1276
|
return size(this, true);
|
|
1227
1277
|
},
|
|
1228
1278
|
has(key) {
|
|
1229
|
-
return has
|
|
1279
|
+
return has.call(this, key, true);
|
|
1230
1280
|
},
|
|
1231
1281
|
add: createReadonlyMethod("add" /* TriggerOpTypes.ADD */),
|
|
1232
1282
|
set: createReadonlyMethod("set" /* TriggerOpTypes.SET */),
|
|
@@ -1236,13 +1286,13 @@ function createInstrumentations() {
|
|
|
1236
1286
|
};
|
|
1237
1287
|
const shallowReadonlyInstrumentations = {
|
|
1238
1288
|
get(key) {
|
|
1239
|
-
return get
|
|
1289
|
+
return get(this, key, true, true);
|
|
1240
1290
|
},
|
|
1241
1291
|
get size() {
|
|
1242
1292
|
return size(this, true);
|
|
1243
1293
|
},
|
|
1244
1294
|
has(key) {
|
|
1245
|
-
return has
|
|
1295
|
+
return has.call(this, key, true);
|
|
1246
1296
|
},
|
|
1247
1297
|
add: createReadonlyMethod("add" /* TriggerOpTypes.ADD */),
|
|
1248
1298
|
set: createReadonlyMethod("set" /* TriggerOpTypes.SET */),
|
|
@@ -1415,9 +1465,10 @@ function trackRefValue(ref) {
|
|
|
1415
1465
|
}
|
|
1416
1466
|
function triggerRefValue(ref, newVal) {
|
|
1417
1467
|
ref = toRaw(ref);
|
|
1418
|
-
|
|
1468
|
+
const dep = ref.dep;
|
|
1469
|
+
if (dep) {
|
|
1419
1470
|
{
|
|
1420
|
-
triggerEffects(
|
|
1471
|
+
triggerEffects(dep);
|
|
1421
1472
|
}
|
|
1422
1473
|
}
|
|
1423
1474
|
}
|
|
@@ -1521,6 +1572,9 @@ class ObjectRefImpl {
|
|
|
1521
1572
|
set value(newVal) {
|
|
1522
1573
|
this._object[this._key] = newVal;
|
|
1523
1574
|
}
|
|
1575
|
+
get dep() {
|
|
1576
|
+
return getDepFromReactive(toRaw(this._object), this._key);
|
|
1577
|
+
}
|
|
1524
1578
|
}
|
|
1525
1579
|
function toRef(object, key, defaultValue) {
|
|
1526
1580
|
const val = object[key];
|
|
@@ -1562,7 +1616,7 @@ class ComputedRefImpl {
|
|
|
1562
1616
|
}
|
|
1563
1617
|
}
|
|
1564
1618
|
_a = "__v_isReadonly" /* ReactiveFlags.IS_READONLY */;
|
|
1565
|
-
function computed(getterOrOptions, debugOptions, isSSR = false) {
|
|
1619
|
+
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
1566
1620
|
let getter;
|
|
1567
1621
|
let setter;
|
|
1568
1622
|
const onlyGetter = isFunction(getterOrOptions);
|
|
@@ -1581,6 +1635,12 @@ function computed(getterOrOptions, debugOptions, isSSR = false) {
|
|
|
1581
1635
|
function warn(msg, ...args) {
|
|
1582
1636
|
return;
|
|
1583
1637
|
}
|
|
1638
|
+
/**
|
|
1639
|
+
* @internal
|
|
1640
|
+
*/
|
|
1641
|
+
function assertNumber(val, type) {
|
|
1642
|
+
return;
|
|
1643
|
+
}
|
|
1584
1644
|
|
|
1585
1645
|
function callWithErrorHandling(fn, instance, type, args) {
|
|
1586
1646
|
let res;
|
|
@@ -1854,7 +1914,7 @@ function getCompatConfigForKey(key, instance) {
|
|
|
1854
1914
|
}
|
|
1855
1915
|
return globalCompatConfig[key];
|
|
1856
1916
|
}
|
|
1857
|
-
function isCompatEnabled(key, instance, enableForBuiltIn = false) {
|
|
1917
|
+
function isCompatEnabled$1(key, instance, enableForBuiltIn = false) {
|
|
1858
1918
|
// skip compat for built-in components
|
|
1859
1919
|
if (!enableForBuiltIn && instance && instance.type.__isBuiltIn) {
|
|
1860
1920
|
return false;
|
|
@@ -1875,7 +1935,7 @@ function isCompatEnabled(key, instance, enableForBuiltIn = false) {
|
|
|
1875
1935
|
* Use this for features that are completely removed in non-compat build.
|
|
1876
1936
|
*/
|
|
1877
1937
|
function assertCompatEnabled(key, instance, ...args) {
|
|
1878
|
-
if (!isCompatEnabled(key, instance)) {
|
|
1938
|
+
if (!isCompatEnabled$1(key, instance)) {
|
|
1879
1939
|
throw new Error(`${key} compat has been disabled.`);
|
|
1880
1940
|
}
|
|
1881
1941
|
}
|
|
@@ -1884,15 +1944,15 @@ function assertCompatEnabled(key, instance, ...args) {
|
|
|
1884
1944
|
* lead to runtime error if compat is disabled. (warn in all cases)
|
|
1885
1945
|
*/
|
|
1886
1946
|
function softAssertCompatEnabled(key, instance, ...args) {
|
|
1887
|
-
return isCompatEnabled(key, instance);
|
|
1947
|
+
return isCompatEnabled$1(key, instance);
|
|
1888
1948
|
}
|
|
1889
1949
|
/**
|
|
1890
1950
|
* Use this for features with the same syntax but with mutually exclusive
|
|
1891
1951
|
* behavior in 2 vs 3. Only warn if compat is enabled.
|
|
1892
1952
|
* e.g. render function
|
|
1893
1953
|
*/
|
|
1894
|
-
function checkCompatEnabled(key, instance, ...args) {
|
|
1895
|
-
const enabled = isCompatEnabled(key, instance);
|
|
1954
|
+
function checkCompatEnabled$1(key, instance, ...args) {
|
|
1955
|
+
const enabled = isCompatEnabled$1(key, instance);
|
|
1896
1956
|
return enabled;
|
|
1897
1957
|
}
|
|
1898
1958
|
|
|
@@ -1955,7 +2015,7 @@ function off(instance, event, fn) {
|
|
|
1955
2015
|
events[event] = cbs.filter(cb => !(cb === fn || cb.fn === fn));
|
|
1956
2016
|
return vm;
|
|
1957
2017
|
}
|
|
1958
|
-
function emit(instance, event, args) {
|
|
2018
|
+
function emit$1(instance, event, args) {
|
|
1959
2019
|
const cbs = getRegistry(instance)[event];
|
|
1960
2020
|
if (cbs) {
|
|
1961
2021
|
callWithAsyncErrorHandling(cbs.map(cb => cb.bind(instance.proxy)), instance, 6 /* ErrorCodes.COMPONENT_EVENT_HANDLER */, args);
|
|
@@ -1968,7 +2028,7 @@ function convertLegacyVModelProps(vnode) {
|
|
|
1968
2028
|
const { type, shapeFlag, props, dynamicProps } = vnode;
|
|
1969
2029
|
const comp = type;
|
|
1970
2030
|
if (shapeFlag & 6 /* ShapeFlags.COMPONENT */ && props && 'modelValue' in props) {
|
|
1971
|
-
if (!isCompatEnabled("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */,
|
|
2031
|
+
if (!isCompatEnabled$1("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */,
|
|
1972
2032
|
// this is a special case where we want to use the vnode component's
|
|
1973
2033
|
// compat config instead of the current rendering instance (which is the
|
|
1974
2034
|
// parent of the component that exposes v-model)
|
|
@@ -2004,7 +2064,7 @@ function applyModelFromMixins(model, mixins) {
|
|
|
2004
2064
|
}
|
|
2005
2065
|
}
|
|
2006
2066
|
function compatModelEmit(instance, event, args) {
|
|
2007
|
-
if (!isCompatEnabled("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */, instance)) {
|
|
2067
|
+
if (!isCompatEnabled$1("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */, instance)) {
|
|
2008
2068
|
return;
|
|
2009
2069
|
}
|
|
2010
2070
|
const props = instance.vnode.props;
|
|
@@ -2014,7 +2074,7 @@ function compatModelEmit(instance, event, args) {
|
|
|
2014
2074
|
}
|
|
2015
2075
|
}
|
|
2016
2076
|
|
|
2017
|
-
function emit
|
|
2077
|
+
function emit(instance, event, ...rawArgs) {
|
|
2018
2078
|
if (instance.isUnmounted)
|
|
2019
2079
|
return;
|
|
2020
2080
|
const props = instance.vnode.props || EMPTY_OBJ;
|
|
@@ -2029,7 +2089,7 @@ function emit$1(instance, event, ...rawArgs) {
|
|
|
2029
2089
|
args = rawArgs.map(a => (isString(a) ? a.trim() : a));
|
|
2030
2090
|
}
|
|
2031
2091
|
if (number) {
|
|
2032
|
-
args = rawArgs.map(
|
|
2092
|
+
args = rawArgs.map(looseToNumber);
|
|
2033
2093
|
}
|
|
2034
2094
|
}
|
|
2035
2095
|
let handlerName;
|
|
@@ -2057,7 +2117,7 @@ function emit$1(instance, event, ...rawArgs) {
|
|
|
2057
2117
|
}
|
|
2058
2118
|
{
|
|
2059
2119
|
compatModelEmit(instance, event, args);
|
|
2060
|
-
return emit(instance, event, args);
|
|
2120
|
+
return emit$1(instance, event, args);
|
|
2061
2121
|
}
|
|
2062
2122
|
}
|
|
2063
2123
|
function normalizeEmitsOptions(comp, appContext, asMixin = false) {
|
|
@@ -2278,7 +2338,7 @@ function renderComponentRoot(instance) {
|
|
|
2278
2338
|
}
|
|
2279
2339
|
}
|
|
2280
2340
|
}
|
|
2281
|
-
if (isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance) &&
|
|
2341
|
+
if (isCompatEnabled$1("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance) &&
|
|
2282
2342
|
vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */ &&
|
|
2283
2343
|
root.shapeFlag & (1 /* ShapeFlags.ELEMENT */ | 6 /* ShapeFlags.COMPONENT */)) {
|
|
2284
2344
|
const { class: cls, style } = vnode.props || {};
|
|
@@ -2580,7 +2640,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
|
|
|
2580
2640
|
}
|
|
2581
2641
|
function createSuspenseBoundary(vnode, parent, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
|
|
2582
2642
|
const { p: patch, m: move, um: unmount, n: next, o: { parentNode, remove } } = rendererInternals;
|
|
2583
|
-
const timeout =
|
|
2643
|
+
const timeout = vnode.props ? toNumber(vnode.props.timeout) : undefined;
|
|
2584
2644
|
const suspense = {
|
|
2585
2645
|
vnode,
|
|
2586
2646
|
parent,
|
|
@@ -2872,10 +2932,10 @@ function watchEffect(effect, options) {
|
|
|
2872
2932
|
return doWatch(effect, null, options);
|
|
2873
2933
|
}
|
|
2874
2934
|
function watchPostEffect(effect, options) {
|
|
2875
|
-
return doWatch(effect, null,
|
|
2935
|
+
return doWatch(effect, null, { flush: 'post' });
|
|
2876
2936
|
}
|
|
2877
2937
|
function watchSyncEffect(effect, options) {
|
|
2878
|
-
return doWatch(effect, null,
|
|
2938
|
+
return doWatch(effect, null, { flush: 'sync' });
|
|
2879
2939
|
}
|
|
2880
2940
|
// initial value for watchers to trigger on undefined initial values
|
|
2881
2941
|
const INITIAL_WATCHER_VALUE = {};
|
|
@@ -2884,7 +2944,8 @@ function watch(source, cb, options) {
|
|
|
2884
2944
|
return doWatch(source, cb, options);
|
|
2885
2945
|
}
|
|
2886
2946
|
function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) {
|
|
2887
|
-
const instance = currentInstance;
|
|
2947
|
+
const instance = getCurrentScope() === (currentInstance === null || currentInstance === void 0 ? void 0 : currentInstance.scope) ? currentInstance : null;
|
|
2948
|
+
// const instance = currentInstance
|
|
2888
2949
|
let getter;
|
|
2889
2950
|
let forceTrigger = false;
|
|
2890
2951
|
let isMultiSource = false;
|
|
@@ -2939,7 +3000,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
2939
3000
|
getter = () => {
|
|
2940
3001
|
const val = baseGetter();
|
|
2941
3002
|
if (isArray(val) &&
|
|
2942
|
-
checkCompatEnabled("WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */, instance)) {
|
|
3003
|
+
checkCompatEnabled$1("WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */, instance)) {
|
|
2943
3004
|
traverse(val);
|
|
2944
3005
|
}
|
|
2945
3006
|
return val;
|
|
@@ -2995,7 +3056,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
2995
3056
|
? newValue.some((v, i) => hasChanged(v, oldValue[i]))
|
|
2996
3057
|
: hasChanged(newValue, oldValue)) ||
|
|
2997
3058
|
(isArray(newValue) &&
|
|
2998
|
-
isCompatEnabled("WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */, instance))) {
|
|
3059
|
+
isCompatEnabled$1("WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */, instance))) {
|
|
2999
3060
|
// cleanup before running cb again
|
|
3000
3061
|
if (cleanup) {
|
|
3001
3062
|
cleanup();
|
|
@@ -3005,7 +3066,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3005
3066
|
// pass undefined as the old value when it's changed for the first time
|
|
3006
3067
|
oldValue === INITIAL_WATCHER_VALUE
|
|
3007
3068
|
? undefined
|
|
3008
|
-
:
|
|
3069
|
+
: isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE
|
|
3009
3070
|
? []
|
|
3010
3071
|
: oldValue,
|
|
3011
3072
|
onCleanup
|
|
@@ -3584,10 +3645,15 @@ function defineAsyncComponent(source) {
|
|
|
3584
3645
|
}
|
|
3585
3646
|
});
|
|
3586
3647
|
}
|
|
3587
|
-
function createInnerComp(comp,
|
|
3648
|
+
function createInnerComp(comp, parent) {
|
|
3649
|
+
const { ref, props, children, ce } = parent.vnode;
|
|
3588
3650
|
const vnode = createVNode(comp, props, children);
|
|
3589
3651
|
// ensure inner component inherits the async wrapper's ref owner
|
|
3590
3652
|
vnode.ref = ref;
|
|
3653
|
+
// pass the custom element callback on to the inner comp
|
|
3654
|
+
// and remove it from the async wrapper
|
|
3655
|
+
vnode.ce = ce;
|
|
3656
|
+
delete parent.vnode.ce;
|
|
3591
3657
|
return vnode;
|
|
3592
3658
|
}
|
|
3593
3659
|
|
|
@@ -3670,7 +3736,7 @@ const KeepAliveImpl = {
|
|
|
3670
3736
|
}
|
|
3671
3737
|
function pruneCacheEntry(key) {
|
|
3672
3738
|
const cached = cache.get(key);
|
|
3673
|
-
if (!current || cached
|
|
3739
|
+
if (!current || !isSameVNodeType(cached, current)) {
|
|
3674
3740
|
unmount(cached);
|
|
3675
3741
|
}
|
|
3676
3742
|
else if (current) {
|
|
@@ -3702,7 +3768,7 @@ const KeepAliveImpl = {
|
|
|
3702
3768
|
cache.forEach(cached => {
|
|
3703
3769
|
const { subTree, suspense } = instance;
|
|
3704
3770
|
const vnode = getInnerChild(subTree);
|
|
3705
|
-
if (cached.type === vnode.type) {
|
|
3771
|
+
if (cached.type === vnode.type && cached.key === vnode.key) {
|
|
3706
3772
|
// current instance will be unmounted as part of keep-alive's unmount
|
|
3707
3773
|
resetShapeFlag(vnode);
|
|
3708
3774
|
// but invoke its deactivated hook here
|
|
@@ -3739,8 +3805,7 @@ const KeepAliveImpl = {
|
|
|
3739
3805
|
: comp);
|
|
3740
3806
|
const { include, exclude, max } = props;
|
|
3741
3807
|
if ((include && (!name || !matches(include, name))) ||
|
|
3742
|
-
(exclude && name && matches(exclude, name))
|
|
3743
|
-
(false )) {
|
|
3808
|
+
(exclude && name && matches(exclude, name))) {
|
|
3744
3809
|
current = vnode;
|
|
3745
3810
|
return rawVNode;
|
|
3746
3811
|
}
|
|
@@ -3800,7 +3865,7 @@ function matches(pattern, name) {
|
|
|
3800
3865
|
else if (isString(pattern)) {
|
|
3801
3866
|
return pattern.split(',').includes(name);
|
|
3802
3867
|
}
|
|
3803
|
-
else if (pattern
|
|
3868
|
+
else if (isRegExp(pattern)) {
|
|
3804
3869
|
return pattern.test(name);
|
|
3805
3870
|
}
|
|
3806
3871
|
/* istanbul ignore next */
|
|
@@ -3853,14 +3918,9 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
|
|
|
3853
3918
|
}, target);
|
|
3854
3919
|
}
|
|
3855
3920
|
function resetShapeFlag(vnode) {
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
}
|
|
3860
|
-
if (shapeFlag & 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */) {
|
|
3861
|
-
shapeFlag -= 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
3862
|
-
}
|
|
3863
|
-
vnode.shapeFlag = shapeFlag;
|
|
3921
|
+
// bitwise operations to remove keep alive flags
|
|
3922
|
+
vnode.shapeFlag &= ~256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
3923
|
+
vnode.shapeFlag &= ~512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
3864
3924
|
}
|
|
3865
3925
|
function getInnerChild(vnode) {
|
|
3866
3926
|
return vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */ ? vnode.ssContent : vnode;
|
|
@@ -3920,18 +3980,18 @@ function getCompatChildren(instance) {
|
|
|
3920
3980
|
const root = instance.subTree;
|
|
3921
3981
|
const children = [];
|
|
3922
3982
|
if (root) {
|
|
3923
|
-
walk(root, children);
|
|
3983
|
+
walk$1(root, children);
|
|
3924
3984
|
}
|
|
3925
3985
|
return children;
|
|
3926
3986
|
}
|
|
3927
|
-
function walk(vnode, children) {
|
|
3987
|
+
function walk$1(vnode, children) {
|
|
3928
3988
|
if (vnode.component) {
|
|
3929
3989
|
children.push(vnode.component.proxy);
|
|
3930
3990
|
}
|
|
3931
3991
|
else if (vnode.shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
3932
3992
|
const vnodes = vnode.children;
|
|
3933
3993
|
for (let i = 0; i < vnodes.length; i++) {
|
|
3934
|
-
walk(vnodes[i], children);
|
|
3994
|
+
walk$1(vnodes[i], children);
|
|
3935
3995
|
}
|
|
3936
3996
|
}
|
|
3937
3997
|
}
|
|
@@ -4086,7 +4146,7 @@ function resolveDirective(name) {
|
|
|
4086
4146
|
* v2 compat only
|
|
4087
4147
|
* @internal
|
|
4088
4148
|
*/
|
|
4089
|
-
function resolveFilter(name) {
|
|
4149
|
+
function resolveFilter$1(name) {
|
|
4090
4150
|
return resolveAsset(FILTERS, name);
|
|
4091
4151
|
}
|
|
4092
4152
|
// implementation
|
|
@@ -4139,7 +4199,7 @@ function convertLegacyRenderFn(instance) {
|
|
|
4139
4199
|
return;
|
|
4140
4200
|
}
|
|
4141
4201
|
// v2 render function, try to provide compat
|
|
4142
|
-
if (checkCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance)) {
|
|
4202
|
+
if (checkCompatEnabled$1("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance)) {
|
|
4143
4203
|
const wrapped = (Component.render = function compatRender() {
|
|
4144
4204
|
// @ts-ignore
|
|
4145
4205
|
return render.call(this, compatH);
|
|
@@ -4300,8 +4360,8 @@ function convertLegacySlots(vnode) {
|
|
|
4300
4360
|
}
|
|
4301
4361
|
function defineLegacyVNodeProperties(vnode) {
|
|
4302
4362
|
/* istanbul ignore if */
|
|
4303
|
-
if (isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, currentRenderingInstance, true /* enable for built-ins */) &&
|
|
4304
|
-
isCompatEnabled("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, currentRenderingInstance, true /* enable for built-ins */)) {
|
|
4363
|
+
if (isCompatEnabled$1("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, currentRenderingInstance, true /* enable for built-ins */) &&
|
|
4364
|
+
isCompatEnabled$1("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, currentRenderingInstance, true /* enable for built-ins */)) {
|
|
4305
4365
|
const context = currentRenderingInstance;
|
|
4306
4366
|
const getInstance = () => vnode.component && vnode.component.proxy;
|
|
4307
4367
|
let componentOptions;
|
|
@@ -4459,7 +4519,9 @@ fallback, noSlotted) {
|
|
|
4459
4519
|
(currentRenderingInstance.parent &&
|
|
4460
4520
|
isAsyncWrapper(currentRenderingInstance.parent) &&
|
|
4461
4521
|
currentRenderingInstance.parent.isCE)) {
|
|
4462
|
-
|
|
4522
|
+
if (name !== 'default')
|
|
4523
|
+
props.name = name;
|
|
4524
|
+
return createVNode('slot', props, fallback && fallback());
|
|
4463
4525
|
}
|
|
4464
4526
|
let slot = slots[name];
|
|
4465
4527
|
// a compiled slot disables block tracking by default to avoid manual
|
|
@@ -4667,7 +4729,7 @@ function installCompatInstanceProperties(map) {
|
|
|
4667
4729
|
},
|
|
4668
4730
|
// overrides existing accessor
|
|
4669
4731
|
$slots: i => {
|
|
4670
|
-
if (isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, i) &&
|
|
4732
|
+
if (isCompatEnabled$1("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, i) &&
|
|
4671
4733
|
i.render &&
|
|
4672
4734
|
i.render._compatWrapped) {
|
|
4673
4735
|
return new Proxy(i.slots, legacySlotProxyHandlers);
|
|
@@ -4692,7 +4754,7 @@ function installCompatInstanceProperties(map) {
|
|
|
4692
4754
|
$listeners: getCompatListeners
|
|
4693
4755
|
});
|
|
4694
4756
|
/* istanbul ignore if */
|
|
4695
|
-
if (isCompatEnabled("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, null)) {
|
|
4757
|
+
if (isCompatEnabled$1("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, null)) {
|
|
4696
4758
|
extend(map, {
|
|
4697
4759
|
// needed by many libs / render fns
|
|
4698
4760
|
$vnode: i => i.vnode,
|
|
@@ -4714,14 +4776,14 @@ function installCompatInstanceProperties(map) {
|
|
|
4714
4776
|
$createElement: () => compatH,
|
|
4715
4777
|
_c: () => compatH,
|
|
4716
4778
|
_o: () => legacyMarkOnce,
|
|
4717
|
-
_n: () =>
|
|
4779
|
+
_n: () => looseToNumber,
|
|
4718
4780
|
_s: () => toDisplayString,
|
|
4719
4781
|
_l: () => renderList,
|
|
4720
4782
|
_t: i => legacyRenderSlot.bind(null, i),
|
|
4721
4783
|
_q: () => looseEqual,
|
|
4722
4784
|
_i: () => looseIndexOf,
|
|
4723
4785
|
_m: i => legacyRenderStatic.bind(null, i),
|
|
4724
|
-
_f: () => resolveFilter,
|
|
4786
|
+
_f: () => resolveFilter$1,
|
|
4725
4787
|
_k: i => legacyCheckKeyCodes.bind(null, i),
|
|
4726
4788
|
_b: () => legacyBindObjectProps,
|
|
4727
4789
|
_v: () => createTextVNode,
|
|
@@ -4768,6 +4830,7 @@ const publicPropertiesMap =
|
|
|
4768
4830
|
{
|
|
4769
4831
|
installCompatInstanceProperties(publicPropertiesMap);
|
|
4770
4832
|
}
|
|
4833
|
+
const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
|
|
4771
4834
|
const PublicInstanceProxyHandlers = {
|
|
4772
4835
|
get({ _: instance }, key) {
|
|
4773
4836
|
const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
|
|
@@ -4793,7 +4856,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
4793
4856
|
// default: just fallthrough
|
|
4794
4857
|
}
|
|
4795
4858
|
}
|
|
4796
|
-
else if (
|
|
4859
|
+
else if (hasSetupBinding(setupState, key)) {
|
|
4797
4860
|
accessCache[key] = 1 /* AccessTypes.SETUP */;
|
|
4798
4861
|
return setupState[key];
|
|
4799
4862
|
}
|
|
@@ -4858,7 +4921,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
4858
4921
|
},
|
|
4859
4922
|
set({ _: instance }, key, value) {
|
|
4860
4923
|
const { data, setupState, ctx } = instance;
|
|
4861
|
-
if (
|
|
4924
|
+
if (hasSetupBinding(setupState, key)) {
|
|
4862
4925
|
setupState[key] = value;
|
|
4863
4926
|
return true;
|
|
4864
4927
|
}
|
|
@@ -4883,7 +4946,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
4883
4946
|
let normalizedProps;
|
|
4884
4947
|
return (!!accessCache[key] ||
|
|
4885
4948
|
(data !== EMPTY_OBJ && hasOwn(data, key)) ||
|
|
4886
|
-
(setupState
|
|
4949
|
+
hasSetupBinding(setupState, key) ||
|
|
4887
4950
|
((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||
|
|
4888
4951
|
hasOwn(ctx, key) ||
|
|
4889
4952
|
hasOwn(publicPropertiesMap, key) ||
|
|
@@ -4938,7 +5001,7 @@ function applyOptions(instance) {
|
|
|
4938
5001
|
// call beforeCreate first before accessing other options since
|
|
4939
5002
|
// the hook may mutate resolved options (#2791)
|
|
4940
5003
|
if (options.beforeCreate) {
|
|
4941
|
-
callHook(options.beforeCreate, instance, "bc" /* LifecycleHooks.BEFORE_CREATE */);
|
|
5004
|
+
callHook$1(options.beforeCreate, instance, "bc" /* LifecycleHooks.BEFORE_CREATE */);
|
|
4942
5005
|
}
|
|
4943
5006
|
const {
|
|
4944
5007
|
// state
|
|
@@ -4993,7 +5056,7 @@ function applyOptions(instance) {
|
|
|
4993
5056
|
const set = !isFunction(opt) && isFunction(opt.set)
|
|
4994
5057
|
? opt.set.bind(publicThis)
|
|
4995
5058
|
: NOOP;
|
|
4996
|
-
const c = computed
|
|
5059
|
+
const c = computed({
|
|
4997
5060
|
get,
|
|
4998
5061
|
set
|
|
4999
5062
|
});
|
|
@@ -5019,7 +5082,7 @@ function applyOptions(instance) {
|
|
|
5019
5082
|
});
|
|
5020
5083
|
}
|
|
5021
5084
|
if (created) {
|
|
5022
|
-
callHook(created, instance, "c" /* LifecycleHooks.CREATED */);
|
|
5085
|
+
callHook$1(created, instance, "c" /* LifecycleHooks.CREATED */);
|
|
5023
5086
|
}
|
|
5024
5087
|
function registerLifecycleHook(register, hook) {
|
|
5025
5088
|
if (isArray(hook)) {
|
|
@@ -5079,7 +5142,7 @@ function applyOptions(instance) {
|
|
|
5079
5142
|
if (directives)
|
|
5080
5143
|
instance.directives = directives;
|
|
5081
5144
|
if (filters &&
|
|
5082
|
-
isCompatEnabled("FILTERS" /* DeprecationTypes.FILTERS */, instance)) {
|
|
5145
|
+
isCompatEnabled$1("FILTERS" /* DeprecationTypes.FILTERS */, instance)) {
|
|
5083
5146
|
instance.filters = filters;
|
|
5084
5147
|
}
|
|
5085
5148
|
}
|
|
@@ -5120,7 +5183,7 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP,
|
|
|
5120
5183
|
}
|
|
5121
5184
|
}
|
|
5122
5185
|
}
|
|
5123
|
-
function callHook(hook, instance, type) {
|
|
5186
|
+
function callHook$1(hook, instance, type) {
|
|
5124
5187
|
callWithAsyncErrorHandling(isArray(hook)
|
|
5125
5188
|
? hook.map(h => h.bind(instance.proxy))
|
|
5126
5189
|
: hook.bind(instance.proxy), instance, type);
|
|
@@ -5168,7 +5231,7 @@ function resolveMergedOptions(instance) {
|
|
|
5168
5231
|
resolved = cached;
|
|
5169
5232
|
}
|
|
5170
5233
|
else if (!globalMixins.length && !mixins && !extendsOptions) {
|
|
5171
|
-
if (isCompatEnabled("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, instance)) {
|
|
5234
|
+
if (isCompatEnabled$1("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, instance)) {
|
|
5172
5235
|
resolved = extend({}, base);
|
|
5173
5236
|
resolved.parent = instance.parent && instance.parent.proxy;
|
|
5174
5237
|
resolved.propsData = instance.vnode.props;
|
|
@@ -5217,20 +5280,20 @@ const internalOptionMergeStrats = {
|
|
|
5217
5280
|
methods: mergeObjectOptions,
|
|
5218
5281
|
computed: mergeObjectOptions,
|
|
5219
5282
|
// lifecycle
|
|
5220
|
-
beforeCreate: mergeAsArray,
|
|
5221
|
-
created: mergeAsArray,
|
|
5222
|
-
beforeMount: mergeAsArray,
|
|
5223
|
-
mounted: mergeAsArray,
|
|
5224
|
-
beforeUpdate: mergeAsArray,
|
|
5225
|
-
updated: mergeAsArray,
|
|
5226
|
-
beforeDestroy: mergeAsArray,
|
|
5227
|
-
beforeUnmount: mergeAsArray,
|
|
5228
|
-
destroyed: mergeAsArray,
|
|
5229
|
-
unmounted: mergeAsArray,
|
|
5230
|
-
activated: mergeAsArray,
|
|
5231
|
-
deactivated: mergeAsArray,
|
|
5232
|
-
errorCaptured: mergeAsArray,
|
|
5233
|
-
serverPrefetch: mergeAsArray,
|
|
5283
|
+
beforeCreate: mergeAsArray$1,
|
|
5284
|
+
created: mergeAsArray$1,
|
|
5285
|
+
beforeMount: mergeAsArray$1,
|
|
5286
|
+
mounted: mergeAsArray$1,
|
|
5287
|
+
beforeUpdate: mergeAsArray$1,
|
|
5288
|
+
updated: mergeAsArray$1,
|
|
5289
|
+
beforeDestroy: mergeAsArray$1,
|
|
5290
|
+
beforeUnmount: mergeAsArray$1,
|
|
5291
|
+
destroyed: mergeAsArray$1,
|
|
5292
|
+
unmounted: mergeAsArray$1,
|
|
5293
|
+
activated: mergeAsArray$1,
|
|
5294
|
+
deactivated: mergeAsArray$1,
|
|
5295
|
+
errorCaptured: mergeAsArray$1,
|
|
5296
|
+
serverPrefetch: mergeAsArray$1,
|
|
5234
5297
|
// assets
|
|
5235
5298
|
components: mergeObjectOptions,
|
|
5236
5299
|
directives: mergeObjectOptions,
|
|
@@ -5251,7 +5314,7 @@ function mergeDataFn(to, from) {
|
|
|
5251
5314
|
return from;
|
|
5252
5315
|
}
|
|
5253
5316
|
return function mergedDataFn() {
|
|
5254
|
-
return (isCompatEnabled("OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */, null)
|
|
5317
|
+
return (isCompatEnabled$1("OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */, null)
|
|
5255
5318
|
? deepMergeData
|
|
5256
5319
|
: extend)(isFunction(to) ? to.call(this, this) : to, isFunction(from) ? from.call(this, this) : from);
|
|
5257
5320
|
};
|
|
@@ -5269,7 +5332,7 @@ function normalizeInject(raw) {
|
|
|
5269
5332
|
}
|
|
5270
5333
|
return raw;
|
|
5271
5334
|
}
|
|
5272
|
-
function mergeAsArray(to, from) {
|
|
5335
|
+
function mergeAsArray$1(to, from) {
|
|
5273
5336
|
return to ? [...new Set([].concat(to, from))] : from;
|
|
5274
5337
|
}
|
|
5275
5338
|
function mergeObjectOptions(to, from) {
|
|
@@ -5282,7 +5345,7 @@ function mergeWatchOptions(to, from) {
|
|
|
5282
5345
|
return to;
|
|
5283
5346
|
const merged = extend(Object.create(null), to);
|
|
5284
5347
|
for (const key in from) {
|
|
5285
|
-
merged[key] = mergeAsArray(to[key], from[key]);
|
|
5348
|
+
merged[key] = mergeAsArray$1(to[key], from[key]);
|
|
5286
5349
|
}
|
|
5287
5350
|
return merged;
|
|
5288
5351
|
}
|
|
@@ -5319,11 +5382,11 @@ function shouldSkipAttr(key, instance) {
|
|
|
5319
5382
|
return true;
|
|
5320
5383
|
}
|
|
5321
5384
|
if ((key === 'class' || key === 'style') &&
|
|
5322
|
-
isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance)) {
|
|
5385
|
+
isCompatEnabled$1("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance)) {
|
|
5323
5386
|
return true;
|
|
5324
5387
|
}
|
|
5325
5388
|
if (isOn(key) &&
|
|
5326
|
-
isCompatEnabled("INSTANCE_LISTENERS" /* DeprecationTypes.INSTANCE_LISTENERS */, instance)) {
|
|
5389
|
+
isCompatEnabled$1("INSTANCE_LISTENERS" /* DeprecationTypes.INSTANCE_LISTENERS */, instance)) {
|
|
5327
5390
|
return true;
|
|
5328
5391
|
}
|
|
5329
5392
|
// vue-router
|
|
@@ -5536,7 +5599,7 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
|
|
|
5536
5599
|
}
|
|
5537
5600
|
else {
|
|
5538
5601
|
setCurrentInstance(instance);
|
|
5539
|
-
value = propsDefaults[key] = defaultValue.call(isCompatEnabled("PROPS_DEFAULT_THIS" /* DeprecationTypes.PROPS_DEFAULT_THIS */, instance)
|
|
5602
|
+
value = propsDefaults[key] = defaultValue.call(isCompatEnabled$1("PROPS_DEFAULT_THIS" /* DeprecationTypes.PROPS_DEFAULT_THIS */, instance)
|
|
5540
5603
|
? createPropsDefaultThis(instance, props)
|
|
5541
5604
|
: null, props);
|
|
5542
5605
|
unsetCurrentInstance();
|
|
@@ -5641,8 +5704,8 @@ function validatePropName(key) {
|
|
|
5641
5704
|
// use function string name to check type constructors
|
|
5642
5705
|
// so that it works across vms / iframes.
|
|
5643
5706
|
function getType(ctor) {
|
|
5644
|
-
const match = ctor && ctor.toString().match(/^\s*function (\w+)/);
|
|
5645
|
-
return match ? match[
|
|
5707
|
+
const match = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/);
|
|
5708
|
+
return match ? match[2] : ctor === null ? 'null' : '';
|
|
5646
5709
|
}
|
|
5647
5710
|
function isSameType(a, b) {
|
|
5648
5711
|
return getType(a) === getType(b);
|
|
@@ -5779,7 +5842,7 @@ function installLegacyOptionMergeStrats(config) {
|
|
|
5779
5842
|
let singletonApp;
|
|
5780
5843
|
let singletonCtor;
|
|
5781
5844
|
// Legacy global Vue constructor
|
|
5782
|
-
function createCompatVue(createApp, createSingletonApp) {
|
|
5845
|
+
function createCompatVue$1(createApp, createSingletonApp) {
|
|
5783
5846
|
singletonApp = createSingletonApp({});
|
|
5784
5847
|
const Vue = (singletonCtor = function Vue(options = {}) {
|
|
5785
5848
|
return createCompatApp(options, Vue);
|
|
@@ -5804,7 +5867,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
5804
5867
|
return vm;
|
|
5805
5868
|
}
|
|
5806
5869
|
}
|
|
5807
|
-
Vue.version = `2.6.14-compat:${"3.2.
|
|
5870
|
+
Vue.version = `2.6.14-compat:${"3.2.46"}`;
|
|
5808
5871
|
Vue.config = singletonApp.config;
|
|
5809
5872
|
Vue.use = (p, ...options) => {
|
|
5810
5873
|
if (p && isFunction(p.install)) {
|
|
@@ -5983,7 +6046,7 @@ function applySingletonAppMutations(app) {
|
|
|
5983
6046
|
app.config[key] = isObject(val) ? Object.create(val) : val;
|
|
5984
6047
|
// compat for runtime ignoredElements -> isCustomElement
|
|
5985
6048
|
if (key === 'ignoredElements' &&
|
|
5986
|
-
isCompatEnabled("CONFIG_IGNORED_ELEMENTS" /* DeprecationTypes.CONFIG_IGNORED_ELEMENTS */, null) &&
|
|
6049
|
+
isCompatEnabled$1("CONFIG_IGNORED_ELEMENTS" /* DeprecationTypes.CONFIG_IGNORED_ELEMENTS */, null) &&
|
|
5987
6050
|
!isRuntimeOnly() &&
|
|
5988
6051
|
isArray(val)) {
|
|
5989
6052
|
app.config.compilerOptions.isCustomElement = tag => {
|
|
@@ -5995,7 +6058,7 @@ function applySingletonAppMutations(app) {
|
|
|
5995
6058
|
}
|
|
5996
6059
|
function applySingletonPrototype(app, Ctor) {
|
|
5997
6060
|
// copy prototype augmentations as config.globalProperties
|
|
5998
|
-
const enabled = isCompatEnabled("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
6061
|
+
const enabled = isCompatEnabled$1("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
5999
6062
|
if (enabled) {
|
|
6000
6063
|
app.config.globalProperties = Object.create(Ctor.prototype);
|
|
6001
6064
|
}
|
|
@@ -6087,7 +6150,7 @@ function installCompatMount(app, context, render) {
|
|
|
6087
6150
|
if (bum) {
|
|
6088
6151
|
invokeArrayFns(bum);
|
|
6089
6152
|
}
|
|
6090
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
6153
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
6091
6154
|
instance.emit('hook:beforeDestroy');
|
|
6092
6155
|
}
|
|
6093
6156
|
// stop effects
|
|
@@ -6098,7 +6161,7 @@ function installCompatMount(app, context, render) {
|
|
|
6098
6161
|
if (um) {
|
|
6099
6162
|
invokeArrayFns(um);
|
|
6100
6163
|
}
|
|
6101
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
6164
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
6102
6165
|
instance.emit('hook:destroyed');
|
|
6103
6166
|
}
|
|
6104
6167
|
}
|
|
@@ -6190,7 +6253,7 @@ function createAppContext() {
|
|
|
6190
6253
|
emitsCache: new WeakMap()
|
|
6191
6254
|
};
|
|
6192
6255
|
}
|
|
6193
|
-
let uid = 0;
|
|
6256
|
+
let uid$1 = 0;
|
|
6194
6257
|
function createAppAPI(render, hydrate) {
|
|
6195
6258
|
return function createApp(rootComponent, rootProps = null) {
|
|
6196
6259
|
if (!isFunction(rootComponent)) {
|
|
@@ -6203,7 +6266,7 @@ function createAppAPI(render, hydrate) {
|
|
|
6203
6266
|
const installedPlugins = new Set();
|
|
6204
6267
|
let isMounted = false;
|
|
6205
6268
|
const app = (context.app = {
|
|
6206
|
-
_uid: uid++,
|
|
6269
|
+
_uid: uid$1++,
|
|
6207
6270
|
_component: rootComponent,
|
|
6208
6271
|
_props: rootProps,
|
|
6209
6272
|
_container: null,
|
|
@@ -6852,6 +6915,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6852
6915
|
if (dirs) {
|
|
6853
6916
|
invokeDirectiveHook(vnode, null, parentComponent, 'created');
|
|
6854
6917
|
}
|
|
6918
|
+
// scopeId
|
|
6919
|
+
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
|
|
6855
6920
|
// props
|
|
6856
6921
|
if (props) {
|
|
6857
6922
|
for (const key in props) {
|
|
@@ -6875,8 +6940,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6875
6940
|
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
6876
6941
|
}
|
|
6877
6942
|
}
|
|
6878
|
-
// scopeId
|
|
6879
|
-
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
|
|
6880
6943
|
if (dirs) {
|
|
6881
6944
|
invokeDirectiveHook(vnode, null, parentComponent, 'beforeMount');
|
|
6882
6945
|
}
|
|
@@ -7191,7 +7254,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7191
7254
|
(vnodeHook = props && props.onVnodeBeforeMount)) {
|
|
7192
7255
|
invokeVNodeHook(vnodeHook, parent, initialVNode);
|
|
7193
7256
|
}
|
|
7194
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7257
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7195
7258
|
instance.emit('hook:beforeMount');
|
|
7196
7259
|
}
|
|
7197
7260
|
toggleRecurse(instance, true);
|
|
@@ -7228,7 +7291,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7228
7291
|
const scopedInitialVNode = initialVNode;
|
|
7229
7292
|
queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode), parentSuspense);
|
|
7230
7293
|
}
|
|
7231
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7294
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7232
7295
|
queuePostRenderEffect(() => instance.emit('hook:mounted'), parentSuspense);
|
|
7233
7296
|
}
|
|
7234
7297
|
// activated hook for keep-alive roots.
|
|
@@ -7239,7 +7302,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7239
7302
|
isAsyncWrapper(parent.vnode) &&
|
|
7240
7303
|
parent.vnode.shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */)) {
|
|
7241
7304
|
instance.a && queuePostRenderEffect(instance.a, parentSuspense);
|
|
7242
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7305
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7243
7306
|
queuePostRenderEffect(() => instance.emit('hook:activated'), parentSuspense);
|
|
7244
7307
|
}
|
|
7245
7308
|
}
|
|
@@ -7271,7 +7334,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7271
7334
|
if ((vnodeHook = next.props && next.props.onVnodeBeforeUpdate)) {
|
|
7272
7335
|
invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
7273
7336
|
}
|
|
7274
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7337
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7275
7338
|
instance.emit('hook:beforeUpdate');
|
|
7276
7339
|
}
|
|
7277
7340
|
toggleRecurse(instance, true);
|
|
@@ -7298,7 +7361,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7298
7361
|
if ((vnodeHook = next.props && next.props.onVnodeUpdated)) {
|
|
7299
7362
|
queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, next, vnode), parentSuspense);
|
|
7300
7363
|
}
|
|
7301
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7364
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7302
7365
|
queuePostRenderEffect(() => instance.emit('hook:updated'), parentSuspense);
|
|
7303
7366
|
}
|
|
7304
7367
|
}
|
|
@@ -7737,7 +7800,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7737
7800
|
if (bum) {
|
|
7738
7801
|
invokeArrayFns(bum);
|
|
7739
7802
|
}
|
|
7740
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7803
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7741
7804
|
instance.emit('hook:beforeDestroy');
|
|
7742
7805
|
}
|
|
7743
7806
|
// stop effects in component scope
|
|
@@ -7753,7 +7816,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7753
7816
|
if (um) {
|
|
7754
7817
|
queuePostRenderEffect(um, parentSuspense);
|
|
7755
7818
|
}
|
|
7756
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7819
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7757
7820
|
queuePostRenderEffect(() => instance.emit('hook:destroyed'), parentSuspense);
|
|
7758
7821
|
}
|
|
7759
7822
|
queuePostRenderEffect(() => {
|
|
@@ -7855,6 +7918,10 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
7855
7918
|
if (!shallow)
|
|
7856
7919
|
traverseStaticChildren(c1, c2);
|
|
7857
7920
|
}
|
|
7921
|
+
// #6852 also inherit for text nodes
|
|
7922
|
+
if (c2.type === Text) {
|
|
7923
|
+
c2.el = c1.el;
|
|
7924
|
+
}
|
|
7858
7925
|
}
|
|
7859
7926
|
}
|
|
7860
7927
|
}
|
|
@@ -7995,6 +8062,7 @@ const TeleportImpl = {
|
|
|
7995
8062
|
}
|
|
7996
8063
|
}
|
|
7997
8064
|
}
|
|
8065
|
+
updateCssVars(n2);
|
|
7998
8066
|
},
|
|
7999
8067
|
remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
8000
8068
|
const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode;
|
|
@@ -8073,11 +8141,26 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
8073
8141
|
hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
8074
8142
|
}
|
|
8075
8143
|
}
|
|
8144
|
+
updateCssVars(vnode);
|
|
8076
8145
|
}
|
|
8077
8146
|
return vnode.anchor && nextSibling(vnode.anchor);
|
|
8078
8147
|
}
|
|
8079
8148
|
// Force-casted public typing for h and TSX props inference
|
|
8080
8149
|
const Teleport = TeleportImpl;
|
|
8150
|
+
function updateCssVars(vnode) {
|
|
8151
|
+
// presence of .ut method indicates owner component uses css vars.
|
|
8152
|
+
// code path here can assume browser environment.
|
|
8153
|
+
const ctx = vnode.ctx;
|
|
8154
|
+
if (ctx && ctx.ut) {
|
|
8155
|
+
let node = vnode.children[0].el;
|
|
8156
|
+
while (node !== vnode.targetAnchor) {
|
|
8157
|
+
if (node.nodeType === 1)
|
|
8158
|
+
node.setAttribute('data-v-owner', ctx.uid);
|
|
8159
|
+
node = node.nextSibling;
|
|
8160
|
+
}
|
|
8161
|
+
ctx.ut();
|
|
8162
|
+
}
|
|
8163
|
+
}
|
|
8081
8164
|
|
|
8082
8165
|
const normalizedAsyncComponentMap = new Map();
|
|
8083
8166
|
function convertLegacyAsyncComponent(comp) {
|
|
@@ -8125,7 +8208,7 @@ function convertLegacyComponent(comp, instance) {
|
|
|
8125
8208
|
}
|
|
8126
8209
|
// 2.x async component
|
|
8127
8210
|
if (isFunction(comp) &&
|
|
8128
|
-
checkCompatEnabled("COMPONENT_ASYNC" /* DeprecationTypes.COMPONENT_ASYNC */, instance, comp)) {
|
|
8211
|
+
checkCompatEnabled$1("COMPONENT_ASYNC" /* DeprecationTypes.COMPONENT_ASYNC */, instance, comp)) {
|
|
8129
8212
|
// since after disabling this, plain functions are still valid usage, do not
|
|
8130
8213
|
// use softAssert here.
|
|
8131
8214
|
return convertLegacyAsyncComponent(comp);
|
|
@@ -8275,7 +8358,8 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
8275
8358
|
patchFlag,
|
|
8276
8359
|
dynamicProps,
|
|
8277
8360
|
dynamicChildren: null,
|
|
8278
|
-
appContext: null
|
|
8361
|
+
appContext: null,
|
|
8362
|
+
ctx: currentRenderingInstance
|
|
8279
8363
|
};
|
|
8280
8364
|
if (needFullChildrenNormalization) {
|
|
8281
8365
|
normalizeChildren(vnode, children);
|
|
@@ -8434,7 +8518,9 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
|
|
|
8434
8518
|
ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
|
|
8435
8519
|
ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
|
|
8436
8520
|
el: vnode.el,
|
|
8437
|
-
anchor: vnode.anchor
|
|
8521
|
+
anchor: vnode.anchor,
|
|
8522
|
+
ctx: vnode.ctx,
|
|
8523
|
+
ce: vnode.ce
|
|
8438
8524
|
};
|
|
8439
8525
|
{
|
|
8440
8526
|
defineLegacyVNodeProperties(cloned);
|
|
@@ -8593,13 +8679,13 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
|
8593
8679
|
}
|
|
8594
8680
|
|
|
8595
8681
|
const emptyAppContext = createAppContext();
|
|
8596
|
-
let uid
|
|
8682
|
+
let uid = 0;
|
|
8597
8683
|
function createComponentInstance(vnode, parent, suspense) {
|
|
8598
8684
|
const type = vnode.type;
|
|
8599
8685
|
// inherit parent app context - or - if root, adopt from root vnode
|
|
8600
8686
|
const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
|
|
8601
8687
|
const instance = {
|
|
8602
|
-
uid: uid
|
|
8688
|
+
uid: uid++,
|
|
8603
8689
|
vnode,
|
|
8604
8690
|
type,
|
|
8605
8691
|
parent,
|
|
@@ -8669,7 +8755,7 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
8669
8755
|
instance.ctx = { _: instance };
|
|
8670
8756
|
}
|
|
8671
8757
|
instance.root = parent ? parent.root : instance;
|
|
8672
|
-
instance.emit = emit
|
|
8758
|
+
instance.emit = emit.bind(null, instance);
|
|
8673
8759
|
// apply custom element special handling
|
|
8674
8760
|
if (vnode.ce) {
|
|
8675
8761
|
vnode.ce(instance);
|
|
@@ -8763,14 +8849,14 @@ function handleSetupResult(instance, setupResult, isSSR) {
|
|
|
8763
8849
|
else ;
|
|
8764
8850
|
finishComponentSetup(instance, isSSR);
|
|
8765
8851
|
}
|
|
8766
|
-
let compile;
|
|
8852
|
+
let compile$1;
|
|
8767
8853
|
let installWithProxy;
|
|
8768
8854
|
/**
|
|
8769
8855
|
* For runtime-dom to register the compiler.
|
|
8770
8856
|
* Note the exported method uses any to avoid d.ts relying on the compiler types.
|
|
8771
8857
|
*/
|
|
8772
8858
|
function registerRuntimeCompiler(_compile) {
|
|
8773
|
-
compile = _compile;
|
|
8859
|
+
compile$1 = _compile;
|
|
8774
8860
|
installWithProxy = i => {
|
|
8775
8861
|
if (i.render._rc) {
|
|
8776
8862
|
i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers);
|
|
@@ -8778,7 +8864,7 @@ function registerRuntimeCompiler(_compile) {
|
|
|
8778
8864
|
};
|
|
8779
8865
|
}
|
|
8780
8866
|
// dev only
|
|
8781
|
-
const isRuntimeOnly = () => !compile;
|
|
8867
|
+
const isRuntimeOnly = () => !compile$1;
|
|
8782
8868
|
function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
8783
8869
|
const Component = instance.type;
|
|
8784
8870
|
{
|
|
@@ -8789,7 +8875,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
8789
8875
|
if (!instance.render) {
|
|
8790
8876
|
// only do on-the-fly compile if not in SSR - SSR on-the-fly compilation
|
|
8791
8877
|
// is done by server-renderer
|
|
8792
|
-
if (!isSSR && compile && !Component.render) {
|
|
8878
|
+
if (!isSSR && compile$1 && !Component.render) {
|
|
8793
8879
|
const template = (instance.vnode.props &&
|
|
8794
8880
|
instance.vnode.props['inline-template']) ||
|
|
8795
8881
|
Component.template ||
|
|
@@ -8809,7 +8895,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
8809
8895
|
extend(finalCompilerOptions.compatConfig, Component.compatConfig);
|
|
8810
8896
|
}
|
|
8811
8897
|
}
|
|
8812
|
-
Component.render = compile(template, finalCompilerOptions);
|
|
8898
|
+
Component.render = compile$1(template, finalCompilerOptions);
|
|
8813
8899
|
}
|
|
8814
8900
|
}
|
|
8815
8901
|
instance.render = (Component.render || NOOP);
|
|
@@ -8880,9 +8966,9 @@ function isClassComponent(value) {
|
|
|
8880
8966
|
return isFunction(value) && '__vccOpts' in value;
|
|
8881
8967
|
}
|
|
8882
8968
|
|
|
8883
|
-
const computed
|
|
8969
|
+
const computed = ((getterOrOptions, debugOptions) => {
|
|
8884
8970
|
// @ts-ignore
|
|
8885
|
-
return computed(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
8971
|
+
return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
8886
8972
|
});
|
|
8887
8973
|
|
|
8888
8974
|
// implementation
|
|
@@ -9083,7 +9169,7 @@ function isMemoSame(cached, memo) {
|
|
|
9083
9169
|
}
|
|
9084
9170
|
|
|
9085
9171
|
// Core API ------------------------------------------------------------------
|
|
9086
|
-
const version = "3.2.
|
|
9172
|
+
const version = "3.2.46";
|
|
9087
9173
|
const _ssrUtils = {
|
|
9088
9174
|
createComponentInstance,
|
|
9089
9175
|
setupComponent,
|
|
@@ -9100,12 +9186,12 @@ const ssrUtils = (_ssrUtils );
|
|
|
9100
9186
|
/**
|
|
9101
9187
|
* @internal only exposed in compat builds
|
|
9102
9188
|
*/
|
|
9103
|
-
const resolveFilter
|
|
9189
|
+
const resolveFilter = resolveFilter$1 ;
|
|
9104
9190
|
const _compatUtils = {
|
|
9105
9191
|
warnDeprecation,
|
|
9106
|
-
createCompatVue,
|
|
9107
|
-
isCompatEnabled,
|
|
9108
|
-
checkCompatEnabled,
|
|
9192
|
+
createCompatVue: createCompatVue$1,
|
|
9193
|
+
isCompatEnabled: isCompatEnabled$1,
|
|
9194
|
+
checkCompatEnabled: checkCompatEnabled$1,
|
|
9109
9195
|
softAssertCompatEnabled
|
|
9110
9196
|
};
|
|
9111
9197
|
/**
|
|
@@ -9215,9 +9301,6 @@ function patchStyle(el, prev, next) {
|
|
|
9215
9301
|
const style = el.style;
|
|
9216
9302
|
const isCssString = isString(next);
|
|
9217
9303
|
if (next && !isCssString) {
|
|
9218
|
-
for (const key in next) {
|
|
9219
|
-
setStyle(style, key, next[key]);
|
|
9220
|
-
}
|
|
9221
9304
|
if (prev && !isString(prev)) {
|
|
9222
9305
|
for (const key in prev) {
|
|
9223
9306
|
if (next[key] == null) {
|
|
@@ -9225,6 +9308,9 @@ function patchStyle(el, prev, next) {
|
|
|
9225
9308
|
}
|
|
9226
9309
|
}
|
|
9227
9310
|
}
|
|
9311
|
+
for (const key in next) {
|
|
9312
|
+
setStyle(style, key, next[key]);
|
|
9313
|
+
}
|
|
9228
9314
|
}
|
|
9229
9315
|
else {
|
|
9230
9316
|
const currentDisplay = style.display;
|
|
@@ -9609,12 +9695,21 @@ class VueElement extends BaseClass {
|
|
|
9609
9695
|
}
|
|
9610
9696
|
else {
|
|
9611
9697
|
this.attachShadow({ mode: 'open' });
|
|
9698
|
+
if (!this._def.__asyncLoader) {
|
|
9699
|
+
// for sync component defs we can immediately resolve props
|
|
9700
|
+
this._resolveProps(this._def);
|
|
9701
|
+
}
|
|
9612
9702
|
}
|
|
9613
9703
|
}
|
|
9614
9704
|
connectedCallback() {
|
|
9615
9705
|
this._connected = true;
|
|
9616
9706
|
if (!this._instance) {
|
|
9617
|
-
this.
|
|
9707
|
+
if (this._resolved) {
|
|
9708
|
+
this._update();
|
|
9709
|
+
}
|
|
9710
|
+
else {
|
|
9711
|
+
this._resolveDef();
|
|
9712
|
+
}
|
|
9618
9713
|
}
|
|
9619
9714
|
}
|
|
9620
9715
|
disconnectedCallback() {
|
|
@@ -9630,9 +9725,6 @@ class VueElement extends BaseClass {
|
|
|
9630
9725
|
* resolve inner component definition (handle possible async component)
|
|
9631
9726
|
*/
|
|
9632
9727
|
_resolveDef() {
|
|
9633
|
-
if (this._resolved) {
|
|
9634
|
-
return;
|
|
9635
|
-
}
|
|
9636
9728
|
this._resolved = true;
|
|
9637
9729
|
// set initial attrs
|
|
9638
9730
|
for (let i = 0; i < this.attributes.length; i++) {
|
|
@@ -9644,38 +9736,26 @@ class VueElement extends BaseClass {
|
|
|
9644
9736
|
this._setAttr(m.attributeName);
|
|
9645
9737
|
}
|
|
9646
9738
|
}).observe(this, { attributes: true });
|
|
9647
|
-
const resolve = (def) => {
|
|
9648
|
-
const { props
|
|
9649
|
-
const hasOptions = !isArray(props);
|
|
9650
|
-
const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];
|
|
9739
|
+
const resolve = (def, isAsync = false) => {
|
|
9740
|
+
const { props, styles } = def;
|
|
9651
9741
|
// cast Number-type props set before resolve
|
|
9652
9742
|
let numberProps;
|
|
9653
|
-
if (
|
|
9654
|
-
for (const key in
|
|
9743
|
+
if (props && !isArray(props)) {
|
|
9744
|
+
for (const key in props) {
|
|
9655
9745
|
const opt = props[key];
|
|
9656
9746
|
if (opt === Number || (opt && opt.type === Number)) {
|
|
9657
|
-
|
|
9658
|
-
|
|
9747
|
+
if (key in this._props) {
|
|
9748
|
+
this._props[key] = toNumber(this._props[key]);
|
|
9749
|
+
}
|
|
9750
|
+
(numberProps || (numberProps = Object.create(null)))[camelize(key)] = true;
|
|
9659
9751
|
}
|
|
9660
9752
|
}
|
|
9661
9753
|
}
|
|
9662
9754
|
this._numberProps = numberProps;
|
|
9663
|
-
|
|
9664
|
-
|
|
9665
|
-
|
|
9666
|
-
|
|
9667
|
-
}
|
|
9668
|
-
}
|
|
9669
|
-
// defining getter/setters on prototype
|
|
9670
|
-
for (const key of rawKeys.map(camelize)) {
|
|
9671
|
-
Object.defineProperty(this, key, {
|
|
9672
|
-
get() {
|
|
9673
|
-
return this._getProp(key);
|
|
9674
|
-
},
|
|
9675
|
-
set(val) {
|
|
9676
|
-
this._setProp(key, val);
|
|
9677
|
-
}
|
|
9678
|
-
});
|
|
9755
|
+
if (isAsync) {
|
|
9756
|
+
// defining getter/setters on prototype
|
|
9757
|
+
// for sync defs, this already happened in the constructor
|
|
9758
|
+
this._resolveProps(def);
|
|
9679
9759
|
}
|
|
9680
9760
|
// apply CSS
|
|
9681
9761
|
this._applyStyles(styles);
|
|
@@ -9684,12 +9764,33 @@ class VueElement extends BaseClass {
|
|
|
9684
9764
|
};
|
|
9685
9765
|
const asyncDef = this._def.__asyncLoader;
|
|
9686
9766
|
if (asyncDef) {
|
|
9687
|
-
asyncDef().then(resolve);
|
|
9767
|
+
asyncDef().then(def => resolve(def, true));
|
|
9688
9768
|
}
|
|
9689
9769
|
else {
|
|
9690
9770
|
resolve(this._def);
|
|
9691
9771
|
}
|
|
9692
9772
|
}
|
|
9773
|
+
_resolveProps(def) {
|
|
9774
|
+
const { props } = def;
|
|
9775
|
+
const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
|
|
9776
|
+
// check if there are props set pre-upgrade or connect
|
|
9777
|
+
for (const key of Object.keys(this)) {
|
|
9778
|
+
if (key[0] !== '_' && declaredPropKeys.includes(key)) {
|
|
9779
|
+
this._setProp(key, this[key], true, false);
|
|
9780
|
+
}
|
|
9781
|
+
}
|
|
9782
|
+
// defining getter/setters on prototype
|
|
9783
|
+
for (const key of declaredPropKeys.map(camelize)) {
|
|
9784
|
+
Object.defineProperty(this, key, {
|
|
9785
|
+
get() {
|
|
9786
|
+
return this._getProp(key);
|
|
9787
|
+
},
|
|
9788
|
+
set(val) {
|
|
9789
|
+
this._setProp(key, val);
|
|
9790
|
+
}
|
|
9791
|
+
});
|
|
9792
|
+
}
|
|
9793
|
+
}
|
|
9693
9794
|
_setAttr(key) {
|
|
9694
9795
|
let value = this.getAttribute(key);
|
|
9695
9796
|
const camelKey = camelize(key);
|
|
@@ -9736,18 +9837,27 @@ class VueElement extends BaseClass {
|
|
|
9736
9837
|
vnode.ce = instance => {
|
|
9737
9838
|
this._instance = instance;
|
|
9738
9839
|
instance.isCE = true;
|
|
9739
|
-
|
|
9740
|
-
instance.emit = (event, ...args) => {
|
|
9840
|
+
const dispatch = (event, args) => {
|
|
9741
9841
|
this.dispatchEvent(new CustomEvent(event, {
|
|
9742
9842
|
detail: args
|
|
9743
9843
|
}));
|
|
9744
9844
|
};
|
|
9845
|
+
// intercept emit
|
|
9846
|
+
instance.emit = (event, ...args) => {
|
|
9847
|
+
// dispatch both the raw and hyphenated versions of an event
|
|
9848
|
+
// to match Vue behavior
|
|
9849
|
+
dispatch(event, args);
|
|
9850
|
+
if (hyphenate(event) !== event) {
|
|
9851
|
+
dispatch(hyphenate(event), args);
|
|
9852
|
+
}
|
|
9853
|
+
};
|
|
9745
9854
|
// locate nearest Vue custom element parent for provide/inject
|
|
9746
9855
|
let parent = this;
|
|
9747
9856
|
while ((parent =
|
|
9748
9857
|
parent && (parent.parentNode || parent.host))) {
|
|
9749
9858
|
if (parent instanceof VueElement) {
|
|
9750
9859
|
instance.parent = parent._instance;
|
|
9860
|
+
instance.provides = parent._instance.provides;
|
|
9751
9861
|
break;
|
|
9752
9862
|
}
|
|
9753
9863
|
}
|
|
@@ -9793,7 +9903,7 @@ function useCssVars(getter) {
|
|
|
9793
9903
|
return;
|
|
9794
9904
|
}
|
|
9795
9905
|
|
|
9796
|
-
const TRANSITION = 'transition';
|
|
9906
|
+
const TRANSITION$1 = 'transition';
|
|
9797
9907
|
const ANIMATION = 'animation';
|
|
9798
9908
|
// DOM Transition is a higher-order-component based on the platform-agnostic
|
|
9799
9909
|
// base Transition component, with DOM-specific logic.
|
|
@@ -9826,7 +9936,7 @@ const TransitionPropsValidators = (Transition.props =
|
|
|
9826
9936
|
* #3227 Incoming hooks may be merged into arrays when wrapping Transition
|
|
9827
9937
|
* with custom HOCs.
|
|
9828
9938
|
*/
|
|
9829
|
-
const callHook
|
|
9939
|
+
const callHook = (hook, args = []) => {
|
|
9830
9940
|
if (isArray(hook)) {
|
|
9831
9941
|
hook.forEach(h => h(...args));
|
|
9832
9942
|
}
|
|
@@ -9893,11 +10003,16 @@ function resolveTransitionProps(rawProps) {
|
|
|
9893
10003
|
return (el, done) => {
|
|
9894
10004
|
const hook = isAppear ? onAppear : onEnter;
|
|
9895
10005
|
const resolve = () => finishEnter(el, isAppear, done);
|
|
9896
|
-
callHook
|
|
10006
|
+
callHook(hook, [el, resolve]);
|
|
9897
10007
|
nextFrame(() => {
|
|
9898
10008
|
removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
|
|
9899
10009
|
if (legacyClassEnabled) {
|
|
9900
|
-
|
|
10010
|
+
const legacyClass = isAppear
|
|
10011
|
+
? legacyAppearFromClass
|
|
10012
|
+
: legacyEnterFromClass;
|
|
10013
|
+
if (legacyClass) {
|
|
10014
|
+
removeTransitionClass(el, legacyClass);
|
|
10015
|
+
}
|
|
9901
10016
|
}
|
|
9902
10017
|
addTransitionClass(el, isAppear ? appearToClass : enterToClass);
|
|
9903
10018
|
if (!hasExplicitCallback(hook)) {
|
|
@@ -9908,17 +10023,17 @@ function resolveTransitionProps(rawProps) {
|
|
|
9908
10023
|
};
|
|
9909
10024
|
return extend(baseProps, {
|
|
9910
10025
|
onBeforeEnter(el) {
|
|
9911
|
-
callHook
|
|
10026
|
+
callHook(onBeforeEnter, [el]);
|
|
9912
10027
|
addTransitionClass(el, enterFromClass);
|
|
9913
|
-
if (legacyClassEnabled) {
|
|
10028
|
+
if (legacyClassEnabled && legacyEnterFromClass) {
|
|
9914
10029
|
addTransitionClass(el, legacyEnterFromClass);
|
|
9915
10030
|
}
|
|
9916
10031
|
addTransitionClass(el, enterActiveClass);
|
|
9917
10032
|
},
|
|
9918
10033
|
onBeforeAppear(el) {
|
|
9919
|
-
callHook
|
|
10034
|
+
callHook(onBeforeAppear, [el]);
|
|
9920
10035
|
addTransitionClass(el, appearFromClass);
|
|
9921
|
-
if (legacyClassEnabled) {
|
|
10036
|
+
if (legacyClassEnabled && legacyAppearFromClass) {
|
|
9922
10037
|
addTransitionClass(el, legacyAppearFromClass);
|
|
9923
10038
|
}
|
|
9924
10039
|
addTransitionClass(el, appearActiveClass);
|
|
@@ -9929,7 +10044,7 @@ function resolveTransitionProps(rawProps) {
|
|
|
9929
10044
|
el._isLeaving = true;
|
|
9930
10045
|
const resolve = () => finishLeave(el, done);
|
|
9931
10046
|
addTransitionClass(el, leaveFromClass);
|
|
9932
|
-
if (legacyClassEnabled) {
|
|
10047
|
+
if (legacyClassEnabled && legacyLeaveFromClass) {
|
|
9933
10048
|
addTransitionClass(el, legacyLeaveFromClass);
|
|
9934
10049
|
}
|
|
9935
10050
|
// force reflow so *-leave-from classes immediately take effect (#2593)
|
|
@@ -9941,7 +10056,7 @@ function resolveTransitionProps(rawProps) {
|
|
|
9941
10056
|
return;
|
|
9942
10057
|
}
|
|
9943
10058
|
removeTransitionClass(el, leaveFromClass);
|
|
9944
|
-
if (legacyClassEnabled) {
|
|
10059
|
+
if (legacyClassEnabled && legacyLeaveFromClass) {
|
|
9945
10060
|
removeTransitionClass(el, legacyLeaveFromClass);
|
|
9946
10061
|
}
|
|
9947
10062
|
addTransitionClass(el, leaveToClass);
|
|
@@ -9949,19 +10064,19 @@ function resolveTransitionProps(rawProps) {
|
|
|
9949
10064
|
whenTransitionEnds(el, type, leaveDuration, resolve);
|
|
9950
10065
|
}
|
|
9951
10066
|
});
|
|
9952
|
-
callHook
|
|
10067
|
+
callHook(onLeave, [el, resolve]);
|
|
9953
10068
|
},
|
|
9954
10069
|
onEnterCancelled(el) {
|
|
9955
10070
|
finishEnter(el, false);
|
|
9956
|
-
callHook
|
|
10071
|
+
callHook(onEnterCancelled, [el]);
|
|
9957
10072
|
},
|
|
9958
10073
|
onAppearCancelled(el) {
|
|
9959
10074
|
finishEnter(el, true);
|
|
9960
|
-
callHook
|
|
10075
|
+
callHook(onAppearCancelled, [el]);
|
|
9961
10076
|
},
|
|
9962
10077
|
onLeaveCancelled(el) {
|
|
9963
10078
|
finishLeave(el);
|
|
9964
|
-
callHook
|
|
10079
|
+
callHook(onLeaveCancelled, [el]);
|
|
9965
10080
|
}
|
|
9966
10081
|
});
|
|
9967
10082
|
}
|
|
@@ -10038,8 +10153,8 @@ function getTransitionInfo(el, expectedType) {
|
|
|
10038
10153
|
const styles = window.getComputedStyle(el);
|
|
10039
10154
|
// JSDOM may return undefined for transition properties
|
|
10040
10155
|
const getStyleProperties = (key) => (styles[key] || '').split(', ');
|
|
10041
|
-
const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
|
|
10042
|
-
const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
|
|
10156
|
+
const transitionDelays = getStyleProperties(`${TRANSITION$1}Delay`);
|
|
10157
|
+
const transitionDurations = getStyleProperties(`${TRANSITION$1}Duration`);
|
|
10043
10158
|
const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
|
|
10044
10159
|
const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
|
|
10045
10160
|
const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
|
|
@@ -10048,9 +10163,9 @@ function getTransitionInfo(el, expectedType) {
|
|
|
10048
10163
|
let timeout = 0;
|
|
10049
10164
|
let propCount = 0;
|
|
10050
10165
|
/* istanbul ignore if */
|
|
10051
|
-
if (expectedType === TRANSITION) {
|
|
10166
|
+
if (expectedType === TRANSITION$1) {
|
|
10052
10167
|
if (transitionTimeout > 0) {
|
|
10053
|
-
type = TRANSITION;
|
|
10168
|
+
type = TRANSITION$1;
|
|
10054
10169
|
timeout = transitionTimeout;
|
|
10055
10170
|
propCount = transitionDurations.length;
|
|
10056
10171
|
}
|
|
@@ -10067,17 +10182,17 @@ function getTransitionInfo(el, expectedType) {
|
|
|
10067
10182
|
type =
|
|
10068
10183
|
timeout > 0
|
|
10069
10184
|
? transitionTimeout > animationTimeout
|
|
10070
|
-
? TRANSITION
|
|
10185
|
+
? TRANSITION$1
|
|
10071
10186
|
: ANIMATION
|
|
10072
10187
|
: null;
|
|
10073
10188
|
propCount = type
|
|
10074
|
-
? type === TRANSITION
|
|
10189
|
+
? type === TRANSITION$1
|
|
10075
10190
|
? transitionDurations.length
|
|
10076
10191
|
: animationDurations.length
|
|
10077
10192
|
: 0;
|
|
10078
10193
|
}
|
|
10079
|
-
const hasTransform = type === TRANSITION &&
|
|
10080
|
-
/\b(transform|all)(,|$)/.test(getStyleProperties(`${TRANSITION}Property`).toString());
|
|
10194
|
+
const hasTransform = type === TRANSITION$1 &&
|
|
10195
|
+
/\b(transform|all)(,|$)/.test(getStyleProperties(`${TRANSITION$1}Property`).toString());
|
|
10081
10196
|
return {
|
|
10082
10197
|
type,
|
|
10083
10198
|
timeout,
|
|
@@ -10180,6 +10295,14 @@ const TransitionGroupImpl = {
|
|
|
10180
10295
|
{
|
|
10181
10296
|
TransitionGroupImpl.__isBuiltIn = true;
|
|
10182
10297
|
}
|
|
10298
|
+
/**
|
|
10299
|
+
* TransitionGroup does not support "mode" so we need to remove it from the
|
|
10300
|
+
* props declarations, but direct delete operation is considered a side effect
|
|
10301
|
+
* and will make the entire transition feature non-tree-shakeable, so we do it
|
|
10302
|
+
* in a function and mark the function's invocation as pure.
|
|
10303
|
+
*/
|
|
10304
|
+
const removeMode = (props) => delete props.mode;
|
|
10305
|
+
/*#__PURE__*/ removeMode(TransitionGroupImpl.props);
|
|
10183
10306
|
const TransitionGroup = TransitionGroupImpl;
|
|
10184
10307
|
function callPendingCbs(c) {
|
|
10185
10308
|
const el = c.el;
|
|
@@ -10255,7 +10378,7 @@ const vModelText = {
|
|
|
10255
10378
|
domValue = domValue.trim();
|
|
10256
10379
|
}
|
|
10257
10380
|
if (castToNumber) {
|
|
10258
|
-
domValue =
|
|
10381
|
+
domValue = looseToNumber(domValue);
|
|
10259
10382
|
}
|
|
10260
10383
|
el._assign(domValue);
|
|
10261
10384
|
});
|
|
@@ -10290,7 +10413,8 @@ const vModelText = {
|
|
|
10290
10413
|
if (trim && el.value.trim() === value) {
|
|
10291
10414
|
return;
|
|
10292
10415
|
}
|
|
10293
|
-
if ((number || el.type === 'number') &&
|
|
10416
|
+
if ((number || el.type === 'number') &&
|
|
10417
|
+
looseToNumber(el.value) === value) {
|
|
10294
10418
|
return;
|
|
10295
10419
|
}
|
|
10296
10420
|
}
|
|
@@ -10379,7 +10503,7 @@ const vModelSelect = {
|
|
|
10379
10503
|
addEventListener(el, 'change', () => {
|
|
10380
10504
|
const selectedVal = Array.prototype.filter
|
|
10381
10505
|
.call(el.options, (o) => o.selected)
|
|
10382
|
-
.map((o) => number ?
|
|
10506
|
+
.map((o) => number ? looseToNumber(getValue(o)) : getValue(o));
|
|
10383
10507
|
el._assign(el.multiple
|
|
10384
10508
|
? isSetModel
|
|
10385
10509
|
? new Set(selectedVal)
|
|
@@ -10726,150 +10850,151 @@ const initDirectivesForSSR = () => {
|
|
|
10726
10850
|
|
|
10727
10851
|
var runtimeDom = /*#__PURE__*/Object.freeze({
|
|
10728
10852
|
__proto__: null,
|
|
10729
|
-
|
|
10730
|
-
|
|
10853
|
+
BaseTransition: BaseTransition,
|
|
10854
|
+
Comment: Comment,
|
|
10855
|
+
EffectScope: EffectScope,
|
|
10856
|
+
Fragment: Fragment,
|
|
10857
|
+
KeepAlive: KeepAlive,
|
|
10858
|
+
ReactiveEffect: ReactiveEffect,
|
|
10859
|
+
Static: Static,
|
|
10860
|
+
Suspense: Suspense,
|
|
10861
|
+
Teleport: Teleport,
|
|
10862
|
+
Text: Text,
|
|
10863
|
+
Transition: Transition,
|
|
10864
|
+
TransitionGroup: TransitionGroup,
|
|
10865
|
+
VueElement: VueElement,
|
|
10866
|
+
assertNumber: assertNumber,
|
|
10867
|
+
callWithAsyncErrorHandling: callWithAsyncErrorHandling,
|
|
10868
|
+
callWithErrorHandling: callWithErrorHandling,
|
|
10869
|
+
camelize: camelize,
|
|
10870
|
+
capitalize: capitalize,
|
|
10871
|
+
cloneVNode: cloneVNode,
|
|
10872
|
+
compatUtils: compatUtils,
|
|
10873
|
+
computed: computed,
|
|
10731
10874
|
createApp: createApp,
|
|
10875
|
+
createBlock: createBlock,
|
|
10876
|
+
createCommentVNode: createCommentVNode,
|
|
10877
|
+
createElementBlock: createElementBlock,
|
|
10878
|
+
createElementVNode: createBaseVNode,
|
|
10879
|
+
createHydrationRenderer: createHydrationRenderer,
|
|
10880
|
+
createPropsRestProxy: createPropsRestProxy,
|
|
10881
|
+
createRenderer: createRenderer,
|
|
10732
10882
|
createSSRApp: createSSRApp,
|
|
10733
|
-
|
|
10883
|
+
createSlots: createSlots,
|
|
10884
|
+
createStaticVNode: createStaticVNode,
|
|
10885
|
+
createTextVNode: createTextVNode,
|
|
10886
|
+
createVNode: createVNode,
|
|
10887
|
+
customRef: customRef,
|
|
10888
|
+
defineAsyncComponent: defineAsyncComponent,
|
|
10889
|
+
defineComponent: defineComponent,
|
|
10734
10890
|
defineCustomElement: defineCustomElement,
|
|
10891
|
+
defineEmits: defineEmits,
|
|
10892
|
+
defineExpose: defineExpose,
|
|
10893
|
+
defineProps: defineProps,
|
|
10735
10894
|
defineSSRCustomElement: defineSSRCustomElement,
|
|
10736
|
-
|
|
10737
|
-
|
|
10738
|
-
|
|
10739
|
-
|
|
10740
|
-
|
|
10741
|
-
|
|
10742
|
-
|
|
10743
|
-
|
|
10744
|
-
|
|
10745
|
-
|
|
10746
|
-
|
|
10747
|
-
|
|
10748
|
-
|
|
10749
|
-
|
|
10750
|
-
ref: ref,
|
|
10751
|
-
readonly: readonly,
|
|
10752
|
-
unref: unref,
|
|
10753
|
-
proxyRefs: proxyRefs,
|
|
10754
|
-
isRef: isRef,
|
|
10755
|
-
toRef: toRef,
|
|
10756
|
-
toRefs: toRefs,
|
|
10895
|
+
get devtools () { return devtools; },
|
|
10896
|
+
effect: effect,
|
|
10897
|
+
effectScope: effectScope,
|
|
10898
|
+
getCurrentInstance: getCurrentInstance,
|
|
10899
|
+
getCurrentScope: getCurrentScope,
|
|
10900
|
+
getTransitionRawChildren: getTransitionRawChildren,
|
|
10901
|
+
guardReactiveProps: guardReactiveProps,
|
|
10902
|
+
h: h,
|
|
10903
|
+
handleError: handleError,
|
|
10904
|
+
hydrate: hydrate,
|
|
10905
|
+
initCustomFormatter: initCustomFormatter,
|
|
10906
|
+
initDirectivesForSSR: initDirectivesForSSR,
|
|
10907
|
+
inject: inject,
|
|
10908
|
+
isMemoSame: isMemoSame,
|
|
10757
10909
|
isProxy: isProxy,
|
|
10758
10910
|
isReactive: isReactive,
|
|
10759
10911
|
isReadonly: isReadonly,
|
|
10912
|
+
isRef: isRef,
|
|
10913
|
+
isRuntimeOnly: isRuntimeOnly,
|
|
10760
10914
|
isShallow: isShallow,
|
|
10761
|
-
|
|
10762
|
-
triggerRef: triggerRef,
|
|
10763
|
-
shallowRef: shallowRef,
|
|
10764
|
-
shallowReactive: shallowReactive,
|
|
10765
|
-
shallowReadonly: shallowReadonly,
|
|
10915
|
+
isVNode: isVNode,
|
|
10766
10916
|
markRaw: markRaw,
|
|
10767
|
-
|
|
10768
|
-
|
|
10769
|
-
|
|
10770
|
-
|
|
10771
|
-
|
|
10772
|
-
|
|
10773
|
-
|
|
10774
|
-
onScopeDispose: onScopeDispose,
|
|
10775
|
-
computed: computed$1,
|
|
10776
|
-
watch: watch,
|
|
10777
|
-
watchEffect: watchEffect,
|
|
10778
|
-
watchPostEffect: watchPostEffect,
|
|
10779
|
-
watchSyncEffect: watchSyncEffect,
|
|
10917
|
+
mergeDefaults: mergeDefaults,
|
|
10918
|
+
mergeProps: mergeProps,
|
|
10919
|
+
nextTick: nextTick,
|
|
10920
|
+
normalizeClass: normalizeClass,
|
|
10921
|
+
normalizeProps: normalizeProps,
|
|
10922
|
+
normalizeStyle: normalizeStyle,
|
|
10923
|
+
onActivated: onActivated,
|
|
10780
10924
|
onBeforeMount: onBeforeMount,
|
|
10781
|
-
onMounted: onMounted,
|
|
10782
|
-
onBeforeUpdate: onBeforeUpdate,
|
|
10783
|
-
onUpdated: onUpdated,
|
|
10784
10925
|
onBeforeUnmount: onBeforeUnmount,
|
|
10785
|
-
|
|
10786
|
-
onActivated: onActivated,
|
|
10926
|
+
onBeforeUpdate: onBeforeUpdate,
|
|
10787
10927
|
onDeactivated: onDeactivated,
|
|
10928
|
+
onErrorCaptured: onErrorCaptured,
|
|
10929
|
+
onMounted: onMounted,
|
|
10788
10930
|
onRenderTracked: onRenderTracked,
|
|
10789
10931
|
onRenderTriggered: onRenderTriggered,
|
|
10790
|
-
|
|
10932
|
+
onScopeDispose: onScopeDispose,
|
|
10791
10933
|
onServerPrefetch: onServerPrefetch,
|
|
10934
|
+
onUnmounted: onUnmounted,
|
|
10935
|
+
onUpdated: onUpdated,
|
|
10936
|
+
openBlock: openBlock,
|
|
10937
|
+
popScopeId: popScopeId,
|
|
10792
10938
|
provide: provide,
|
|
10793
|
-
|
|
10794
|
-
|
|
10795
|
-
defineComponent: defineComponent,
|
|
10796
|
-
defineAsyncComponent: defineAsyncComponent,
|
|
10797
|
-
useAttrs: useAttrs,
|
|
10798
|
-
useSlots: useSlots,
|
|
10799
|
-
defineProps: defineProps,
|
|
10800
|
-
defineEmits: defineEmits,
|
|
10801
|
-
defineExpose: defineExpose,
|
|
10802
|
-
withDefaults: withDefaults,
|
|
10803
|
-
mergeDefaults: mergeDefaults,
|
|
10804
|
-
createPropsRestProxy: createPropsRestProxy,
|
|
10805
|
-
withAsyncContext: withAsyncContext,
|
|
10806
|
-
getCurrentInstance: getCurrentInstance,
|
|
10807
|
-
h: h,
|
|
10808
|
-
createVNode: createVNode,
|
|
10809
|
-
cloneVNode: cloneVNode,
|
|
10810
|
-
mergeProps: mergeProps,
|
|
10811
|
-
isVNode: isVNode,
|
|
10812
|
-
Fragment: Fragment,
|
|
10813
|
-
Text: Text,
|
|
10814
|
-
Comment: Comment,
|
|
10815
|
-
Static: Static,
|
|
10816
|
-
Teleport: Teleport,
|
|
10817
|
-
Suspense: Suspense,
|
|
10818
|
-
KeepAlive: KeepAlive,
|
|
10819
|
-
BaseTransition: BaseTransition,
|
|
10820
|
-
withDirectives: withDirectives,
|
|
10821
|
-
useSSRContext: useSSRContext,
|
|
10822
|
-
ssrContextKey: ssrContextKey,
|
|
10823
|
-
createRenderer: createRenderer,
|
|
10824
|
-
createHydrationRenderer: createHydrationRenderer,
|
|
10939
|
+
proxyRefs: proxyRefs,
|
|
10940
|
+
pushScopeId: pushScopeId,
|
|
10825
10941
|
queuePostFlushCb: queuePostFlushCb,
|
|
10826
|
-
|
|
10827
|
-
|
|
10828
|
-
|
|
10829
|
-
|
|
10942
|
+
reactive: reactive,
|
|
10943
|
+
readonly: readonly,
|
|
10944
|
+
ref: ref,
|
|
10945
|
+
registerRuntimeCompiler: registerRuntimeCompiler,
|
|
10946
|
+
render: render,
|
|
10947
|
+
renderList: renderList,
|
|
10948
|
+
renderSlot: renderSlot,
|
|
10830
10949
|
resolveComponent: resolveComponent,
|
|
10831
10950
|
resolveDirective: resolveDirective,
|
|
10832
10951
|
resolveDynamicComponent: resolveDynamicComponent,
|
|
10833
|
-
|
|
10834
|
-
isRuntimeOnly: isRuntimeOnly,
|
|
10835
|
-
useTransitionState: useTransitionState,
|
|
10952
|
+
resolveFilter: resolveFilter,
|
|
10836
10953
|
resolveTransitionHooks: resolveTransitionHooks,
|
|
10837
|
-
setTransitionHooks: setTransitionHooks,
|
|
10838
|
-
getTransitionRawChildren: getTransitionRawChildren,
|
|
10839
|
-
initCustomFormatter: initCustomFormatter,
|
|
10840
|
-
get devtools () { return devtools; },
|
|
10841
|
-
setDevtoolsHook: setDevtoolsHook,
|
|
10842
|
-
withCtx: withCtx,
|
|
10843
|
-
pushScopeId: pushScopeId,
|
|
10844
|
-
popScopeId: popScopeId,
|
|
10845
|
-
withScopeId: withScopeId,
|
|
10846
|
-
renderList: renderList,
|
|
10847
|
-
toHandlers: toHandlers,
|
|
10848
|
-
renderSlot: renderSlot,
|
|
10849
|
-
createSlots: createSlots,
|
|
10850
|
-
withMemo: withMemo,
|
|
10851
|
-
isMemoSame: isMemoSame,
|
|
10852
|
-
openBlock: openBlock,
|
|
10853
|
-
createBlock: createBlock,
|
|
10854
10954
|
setBlockTracking: setBlockTracking,
|
|
10855
|
-
|
|
10856
|
-
|
|
10857
|
-
|
|
10858
|
-
|
|
10859
|
-
|
|
10860
|
-
|
|
10955
|
+
setDevtoolsHook: setDevtoolsHook,
|
|
10956
|
+
setTransitionHooks: setTransitionHooks,
|
|
10957
|
+
shallowReactive: shallowReactive,
|
|
10958
|
+
shallowReadonly: shallowReadonly,
|
|
10959
|
+
shallowRef: shallowRef,
|
|
10960
|
+
ssrContextKey: ssrContextKey,
|
|
10961
|
+
ssrUtils: ssrUtils,
|
|
10962
|
+
stop: stop,
|
|
10861
10963
|
toDisplayString: toDisplayString,
|
|
10862
|
-
camelize: camelize,
|
|
10863
|
-
capitalize: capitalize,
|
|
10864
10964
|
toHandlerKey: toHandlerKey,
|
|
10865
|
-
|
|
10866
|
-
|
|
10867
|
-
|
|
10965
|
+
toHandlers: toHandlers,
|
|
10966
|
+
toRaw: toRaw,
|
|
10967
|
+
toRef: toRef,
|
|
10968
|
+
toRefs: toRefs,
|
|
10868
10969
|
transformVNodeArgs: transformVNodeArgs,
|
|
10970
|
+
triggerRef: triggerRef,
|
|
10971
|
+
unref: unref,
|
|
10972
|
+
useAttrs: useAttrs,
|
|
10973
|
+
useCssModule: useCssModule,
|
|
10974
|
+
useCssVars: useCssVars,
|
|
10975
|
+
useSSRContext: useSSRContext,
|
|
10976
|
+
useSlots: useSlots,
|
|
10977
|
+
useTransitionState: useTransitionState,
|
|
10978
|
+
vModelCheckbox: vModelCheckbox,
|
|
10979
|
+
vModelDynamic: vModelDynamic,
|
|
10980
|
+
vModelRadio: vModelRadio,
|
|
10981
|
+
vModelSelect: vModelSelect,
|
|
10982
|
+
vModelText: vModelText,
|
|
10983
|
+
vShow: vShow,
|
|
10869
10984
|
version: version,
|
|
10870
|
-
|
|
10871
|
-
|
|
10872
|
-
|
|
10985
|
+
warn: warn,
|
|
10986
|
+
watch: watch,
|
|
10987
|
+
watchEffect: watchEffect,
|
|
10988
|
+
watchPostEffect: watchPostEffect,
|
|
10989
|
+
watchSyncEffect: watchSyncEffect,
|
|
10990
|
+
withAsyncContext: withAsyncContext,
|
|
10991
|
+
withCtx: withCtx,
|
|
10992
|
+
withDefaults: withDefaults,
|
|
10993
|
+
withDirectives: withDirectives,
|
|
10994
|
+
withKeys: withKeys,
|
|
10995
|
+
withMemo: withMemo,
|
|
10996
|
+
withModifiers: withModifiers,
|
|
10997
|
+
withScopeId: withScopeId
|
|
10873
10998
|
});
|
|
10874
10999
|
|
|
10875
11000
|
// This entry exports the runtime only, and is built as
|
|
@@ -10890,7 +11015,7 @@ function wrappedCreateApp(...args) {
|
|
|
10890
11015
|
}
|
|
10891
11016
|
return app;
|
|
10892
11017
|
}
|
|
10893
|
-
function createCompatVue
|
|
11018
|
+
function createCompatVue() {
|
|
10894
11019
|
const Vue = compatUtils.createCompatVue(createApp, wrappedCreateApp);
|
|
10895
11020
|
extend(Vue, runtimeDom);
|
|
10896
11021
|
return Vue;
|
|
@@ -10951,7 +11076,7 @@ const errorMessages = {
|
|
|
10951
11076
|
[34 /* ErrorCodes.X_V_BIND_NO_EXPRESSION */]: `v-bind is missing expression.`,
|
|
10952
11077
|
[35 /* ErrorCodes.X_V_ON_NO_EXPRESSION */]: `v-on is missing expression.`,
|
|
10953
11078
|
[36 /* ErrorCodes.X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET */]: `Unexpected custom directive on <slot> outlet.`,
|
|
10954
|
-
[37 /* ErrorCodes.X_V_SLOT_MIXED_SLOT_USAGE */]: `Mixed v-slot usage on both the component and nested <template
|
|
11079
|
+
[37 /* ErrorCodes.X_V_SLOT_MIXED_SLOT_USAGE */]: `Mixed v-slot usage on both the component and nested <template>. ` +
|
|
10955
11080
|
`When there are multiple named slots, all slots should use <template> ` +
|
|
10956
11081
|
`syntax to avoid scope ambiguity.`,
|
|
10957
11082
|
[38 /* ErrorCodes.X_V_SLOT_DUPLICATE_SLOT_NAMES */]: `Duplicate slot names found. `,
|
|
@@ -10961,15 +11086,16 @@ const errorMessages = {
|
|
|
10961
11086
|
[41 /* ErrorCodes.X_V_MODEL_NO_EXPRESSION */]: `v-model is missing expression.`,
|
|
10962
11087
|
[42 /* ErrorCodes.X_V_MODEL_MALFORMED_EXPRESSION */]: `v-model value must be a valid JavaScript member expression.`,
|
|
10963
11088
|
[43 /* ErrorCodes.X_V_MODEL_ON_SCOPE_VARIABLE */]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
|
|
10964
|
-
[44 /* ErrorCodes.
|
|
10965
|
-
[45 /* ErrorCodes.
|
|
11089
|
+
[44 /* ErrorCodes.X_V_MODEL_ON_PROPS */]: `v-model cannot be used on a prop, because local prop bindings are not writable.\nUse a v-bind binding combined with a v-on listener that emits update:x event instead.`,
|
|
11090
|
+
[45 /* ErrorCodes.X_INVALID_EXPRESSION */]: `Error parsing JavaScript expression: `,
|
|
11091
|
+
[46 /* ErrorCodes.X_KEEP_ALIVE_INVALID_CHILDREN */]: `<KeepAlive> expects exactly one child component.`,
|
|
10966
11092
|
// generic errors
|
|
10967
|
-
[
|
|
10968
|
-
[
|
|
10969
|
-
[
|
|
10970
|
-
[
|
|
11093
|
+
[47 /* ErrorCodes.X_PREFIX_ID_NOT_SUPPORTED */]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
|
|
11094
|
+
[48 /* ErrorCodes.X_MODULE_MODE_NOT_SUPPORTED */]: `ES module mode is not supported in this build of compiler.`,
|
|
11095
|
+
[49 /* ErrorCodes.X_CACHE_HANDLER_NOT_SUPPORTED */]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
|
|
11096
|
+
[50 /* ErrorCodes.X_SCOPE_ID_NOT_SUPPORTED */]: `"scopeId" option is only supported in module mode.`,
|
|
10971
11097
|
// just to fulfill types
|
|
10972
|
-
[
|
|
11098
|
+
[51 /* ErrorCodes.__EXTEND_POINT__ */]: ``
|
|
10973
11099
|
};
|
|
10974
11100
|
|
|
10975
11101
|
const FRAGMENT = Symbol(``);
|
|
@@ -11073,7 +11199,7 @@ function createRoot(children, loc = locStub) {
|
|
|
11073
11199
|
return {
|
|
11074
11200
|
type: 0 /* NodeTypes.ROOT */,
|
|
11075
11201
|
children,
|
|
11076
|
-
helpers:
|
|
11202
|
+
helpers: new Set(),
|
|
11077
11203
|
components: [],
|
|
11078
11204
|
directives: [],
|
|
11079
11205
|
hoists: [],
|
|
@@ -11301,7 +11427,7 @@ function hasDynamicKeyVBind(node) {
|
|
|
11301
11427
|
!p.arg.isStatic) // v-bind:[foo]
|
|
11302
11428
|
);
|
|
11303
11429
|
}
|
|
11304
|
-
function isText(node) {
|
|
11430
|
+
function isText$1(node) {
|
|
11305
11431
|
return node.type === 5 /* NodeTypes.INTERPOLATION */ || node.type === 2 /* NodeTypes.TEXT */;
|
|
11306
11432
|
}
|
|
11307
11433
|
function isVSlot(p) {
|
|
@@ -11504,15 +11630,15 @@ function getCompatValue(key, context) {
|
|
|
11504
11630
|
return value;
|
|
11505
11631
|
}
|
|
11506
11632
|
}
|
|
11507
|
-
function isCompatEnabled
|
|
11633
|
+
function isCompatEnabled(key, context) {
|
|
11508
11634
|
const mode = getCompatValue('MODE', context);
|
|
11509
11635
|
const value = getCompatValue(key, context);
|
|
11510
11636
|
// in v3 mode, only enable if explicitly set to true
|
|
11511
11637
|
// otherwise enable for any non-false value
|
|
11512
11638
|
return mode === 3 ? value === true : value !== false;
|
|
11513
11639
|
}
|
|
11514
|
-
function checkCompatEnabled
|
|
11515
|
-
const enabled = isCompatEnabled
|
|
11640
|
+
function checkCompatEnabled(key, context, loc, ...args) {
|
|
11641
|
+
const enabled = isCompatEnabled(key, context);
|
|
11516
11642
|
return enabled;
|
|
11517
11643
|
}
|
|
11518
11644
|
|
|
@@ -11629,7 +11755,7 @@ function parseChildren(context, mode, ancestors) {
|
|
|
11629
11755
|
else if (/[a-z]/i.test(s[1])) {
|
|
11630
11756
|
node = parseElement(context, ancestors);
|
|
11631
11757
|
// 2.x <template> with no directive compat
|
|
11632
|
-
if (isCompatEnabled
|
|
11758
|
+
if (isCompatEnabled("COMPILER_NATIVE_TEMPLATE" /* CompilerDeprecationTypes.COMPILER_NATIVE_TEMPLATE */, context) &&
|
|
11633
11759
|
node &&
|
|
11634
11760
|
node.tag === 'template' &&
|
|
11635
11761
|
!node.props.some(p => p.type === 7 /* NodeTypes.DIRECTIVE */ &&
|
|
@@ -11833,7 +11959,7 @@ function parseElement(context, ancestors) {
|
|
|
11833
11959
|
{
|
|
11834
11960
|
const inlineTemplateProp = element.props.find(p => p.type === 6 /* NodeTypes.ATTRIBUTE */ && p.name === 'inline-template');
|
|
11835
11961
|
if (inlineTemplateProp &&
|
|
11836
|
-
checkCompatEnabled
|
|
11962
|
+
checkCompatEnabled("COMPILER_INLINE_TEMPLATE" /* CompilerDeprecationTypes.COMPILER_INLINE_TEMPLATE */, context, inlineTemplateProp.loc)) {
|
|
11837
11963
|
const loc = getSelection(context, element.loc.end);
|
|
11838
11964
|
inlineTemplateProp.value = {
|
|
11839
11965
|
type: 2 /* NodeTypes.TEXT */,
|
|
@@ -11956,7 +12082,7 @@ function isComponent(tag, props, context) {
|
|
|
11956
12082
|
if (p.value.content.startsWith('vue:')) {
|
|
11957
12083
|
return true;
|
|
11958
12084
|
}
|
|
11959
|
-
else if (checkCompatEnabled
|
|
12085
|
+
else if (checkCompatEnabled("COMPILER_IS_ON_ELEMENT" /* CompilerDeprecationTypes.COMPILER_IS_ON_ELEMENT */, context, p.loc)) {
|
|
11960
12086
|
return true;
|
|
11961
12087
|
}
|
|
11962
12088
|
}
|
|
@@ -11972,7 +12098,7 @@ function isComponent(tag, props, context) {
|
|
|
11972
12098
|
p.name === 'bind' &&
|
|
11973
12099
|
isStaticArgOf(p.arg, 'is') &&
|
|
11974
12100
|
true &&
|
|
11975
|
-
checkCompatEnabled
|
|
12101
|
+
checkCompatEnabled("COMPILER_IS_ON_ELEMENT" /* CompilerDeprecationTypes.COMPILER_IS_ON_ELEMENT */, context, p.loc)) {
|
|
11976
12102
|
return true;
|
|
11977
12103
|
}
|
|
11978
12104
|
}
|
|
@@ -12098,7 +12224,7 @@ function parseAttribute(context, nameSet) {
|
|
|
12098
12224
|
// 2.x compat v-bind:foo.sync -> v-model:foo
|
|
12099
12225
|
if (dirName === 'bind' && arg) {
|
|
12100
12226
|
if (modifiers.includes('sync') &&
|
|
12101
|
-
checkCompatEnabled
|
|
12227
|
+
checkCompatEnabled("COMPILER_V_BIND_SYNC" /* CompilerDeprecationTypes.COMPILER_V_BIND_SYNC */, context, loc, arg.loc.source)) {
|
|
12102
12228
|
dirName = 'model';
|
|
12103
12229
|
modifiers.splice(modifiers.indexOf('sync'), 1);
|
|
12104
12230
|
}
|
|
@@ -12315,7 +12441,7 @@ function startsWithEndTagOpen(source, tag) {
|
|
|
12315
12441
|
}
|
|
12316
12442
|
|
|
12317
12443
|
function hoistStatic(root, context) {
|
|
12318
|
-
walk
|
|
12444
|
+
walk(root, context,
|
|
12319
12445
|
// Root node is unfortunately non-hoistable due to potential parent
|
|
12320
12446
|
// fallthrough attributes.
|
|
12321
12447
|
isSingleElementRoot(root, root.children[0]));
|
|
@@ -12326,7 +12452,7 @@ function isSingleElementRoot(root, child) {
|
|
|
12326
12452
|
child.type === 1 /* NodeTypes.ELEMENT */ &&
|
|
12327
12453
|
!isSlotOutlet(child));
|
|
12328
12454
|
}
|
|
12329
|
-
function walk
|
|
12455
|
+
function walk(node, context, doNotHoistNode = false) {
|
|
12330
12456
|
const { children } = node;
|
|
12331
12457
|
const originalCount = children.length;
|
|
12332
12458
|
let hoistedCount = 0;
|
|
@@ -12375,19 +12501,19 @@ function walk$1(node, context, doNotHoistNode = false) {
|
|
|
12375
12501
|
if (isComponent) {
|
|
12376
12502
|
context.scopes.vSlot++;
|
|
12377
12503
|
}
|
|
12378
|
-
walk
|
|
12504
|
+
walk(child, context);
|
|
12379
12505
|
if (isComponent) {
|
|
12380
12506
|
context.scopes.vSlot--;
|
|
12381
12507
|
}
|
|
12382
12508
|
}
|
|
12383
12509
|
else if (child.type === 11 /* NodeTypes.FOR */) {
|
|
12384
12510
|
// Do not hoist v-for single child because it has to be a block
|
|
12385
|
-
walk
|
|
12511
|
+
walk(child, context, child.children.length === 1);
|
|
12386
12512
|
}
|
|
12387
12513
|
else if (child.type === 9 /* NodeTypes.IF */) {
|
|
12388
12514
|
for (let i = 0; i < child.branches.length; i++) {
|
|
12389
12515
|
// Do not hoist v-if single child because it has to be a block
|
|
12390
|
-
walk
|
|
12516
|
+
walk(child.branches[i], context, child.branches[i].children.length === 1);
|
|
12391
12517
|
}
|
|
12392
12518
|
}
|
|
12393
12519
|
}
|
|
@@ -12752,7 +12878,7 @@ function transform(root, options) {
|
|
|
12752
12878
|
createRootCodegen(root, context);
|
|
12753
12879
|
}
|
|
12754
12880
|
// finalize meta information
|
|
12755
|
-
root.helpers = [...context.helpers.keys()];
|
|
12881
|
+
root.helpers = new Set([...context.helpers.keys()]);
|
|
12756
12882
|
root.components = [...context.components];
|
|
12757
12883
|
root.directives = [...context.directives];
|
|
12758
12884
|
root.imports = context.imports;
|
|
@@ -12788,6 +12914,7 @@ function createRootCodegen(root, context) {
|
|
|
12788
12914
|
else if (children.length > 1) {
|
|
12789
12915
|
// root has multiple nodes - return a fragment block.
|
|
12790
12916
|
let patchFlag = 64 /* PatchFlags.STABLE_FRAGMENT */;
|
|
12917
|
+
PatchFlagNames[64 /* PatchFlags.STABLE_FRAGMENT */];
|
|
12791
12918
|
root.codegenNode = createVNodeCall(context, helper(FRAGMENT), undefined, root.children, patchFlag + (``), undefined, undefined, true, undefined, false /* isComponent */);
|
|
12792
12919
|
}
|
|
12793
12920
|
else ;
|
|
@@ -12986,7 +13113,8 @@ function generate(ast, options = {}) {
|
|
|
12986
13113
|
if (options.onContextCreated)
|
|
12987
13114
|
options.onContextCreated(context);
|
|
12988
13115
|
const { mode, push, prefixIdentifiers, indent, deindent, newline, scopeId, ssr } = context;
|
|
12989
|
-
const
|
|
13116
|
+
const helpers = Array.from(ast.helpers);
|
|
13117
|
+
const hasHelpers = helpers.length > 0;
|
|
12990
13118
|
const useWithBlock = !prefixIdentifiers && mode !== 'module';
|
|
12991
13119
|
const genScopeId = scopeId != null && mode === 'module';
|
|
12992
13120
|
const isSetupInlined = !!options.inline;
|
|
@@ -13025,7 +13153,7 @@ function generate(ast, options = {}) {
|
|
|
13025
13153
|
// function mode const declarations should be inside with block
|
|
13026
13154
|
// also they should be renamed to avoid collision with user properties
|
|
13027
13155
|
if (hasHelpers) {
|
|
13028
|
-
push(`const { ${
|
|
13156
|
+
push(`const { ${helpers.map(aliasHelper).join(', ')} } = _Vue`);
|
|
13029
13157
|
push(`\n`);
|
|
13030
13158
|
newline();
|
|
13031
13159
|
}
|
|
@@ -13091,9 +13219,10 @@ function genFunctionPreamble(ast, context) {
|
|
|
13091
13219
|
// In prefix mode, we place the const declaration at top so it's done
|
|
13092
13220
|
// only once; But if we not prefixing, we place the declaration inside the
|
|
13093
13221
|
// with block so it doesn't incur the `in` check cost for every helper access.
|
|
13094
|
-
|
|
13222
|
+
const helpers = Array.from(ast.helpers);
|
|
13223
|
+
if (helpers.length > 0) {
|
|
13095
13224
|
if (prefixIdentifiers) {
|
|
13096
|
-
push(`const { ${
|
|
13225
|
+
push(`const { ${helpers.map(aliasHelper).join(', ')} } = ${VueBinding}\n`);
|
|
13097
13226
|
}
|
|
13098
13227
|
else {
|
|
13099
13228
|
// "with" mode.
|
|
@@ -13110,7 +13239,7 @@ function genFunctionPreamble(ast, context) {
|
|
|
13110
13239
|
CREATE_TEXT,
|
|
13111
13240
|
CREATE_STATIC
|
|
13112
13241
|
]
|
|
13113
|
-
.filter(helper =>
|
|
13242
|
+
.filter(helper => helpers.includes(helper))
|
|
13114
13243
|
.map(aliasHelper)
|
|
13115
13244
|
.join(', ');
|
|
13116
13245
|
push(`const { ${staticHelpers} } = _Vue\n`);
|
|
@@ -13131,25 +13260,27 @@ function genFunctionPreamble(ast, context) {
|
|
|
13131
13260
|
function genModulePreamble(ast, context, genScopeId, inline) {
|
|
13132
13261
|
const { push, newline, optimizeImports, runtimeModuleName, ssrRuntimeModuleName } = context;
|
|
13133
13262
|
if (genScopeId && ast.hoists.length) {
|
|
13134
|
-
ast.helpers.
|
|
13263
|
+
ast.helpers.add(PUSH_SCOPE_ID);
|
|
13264
|
+
ast.helpers.add(POP_SCOPE_ID);
|
|
13135
13265
|
}
|
|
13136
13266
|
// generate import statements for helpers
|
|
13137
|
-
if (ast.helpers.
|
|
13267
|
+
if (ast.helpers.size) {
|
|
13268
|
+
const helpers = Array.from(ast.helpers);
|
|
13138
13269
|
if (optimizeImports) {
|
|
13139
13270
|
// when bundled with webpack with code-split, calling an import binding
|
|
13140
13271
|
// as a function leads to it being wrapped with `Object(a.b)` or `(0,a.b)`,
|
|
13141
13272
|
// incurring both payload size increase and potential perf overhead.
|
|
13142
13273
|
// therefore we assign the imports to variables (which is a constant ~50b
|
|
13143
13274
|
// cost per-component instead of scaling with template size)
|
|
13144
|
-
push(`import { ${
|
|
13275
|
+
push(`import { ${helpers
|
|
13145
13276
|
.map(s => helperNameMap[s])
|
|
13146
13277
|
.join(', ')} } from ${JSON.stringify(runtimeModuleName)}\n`);
|
|
13147
|
-
push(`\n// Binding optimization for webpack code-split\nconst ${
|
|
13278
|
+
push(`\n// Binding optimization for webpack code-split\nconst ${helpers
|
|
13148
13279
|
.map(s => `_${helperNameMap[s]} = ${helperNameMap[s]}`)
|
|
13149
13280
|
.join(', ')}\n`);
|
|
13150
13281
|
}
|
|
13151
13282
|
else {
|
|
13152
|
-
push(`import { ${
|
|
13283
|
+
push(`import { ${helpers
|
|
13153
13284
|
.map(s => `${helperNameMap[s]} as _${helperNameMap[s]}`)
|
|
13154
13285
|
.join(', ')} } from ${JSON.stringify(runtimeModuleName)}\n`);
|
|
13155
13286
|
}
|
|
@@ -13226,7 +13357,7 @@ function genImports(importsOptions, context) {
|
|
|
13226
13357
|
context.newline();
|
|
13227
13358
|
});
|
|
13228
13359
|
}
|
|
13229
|
-
function isText
|
|
13360
|
+
function isText(n) {
|
|
13230
13361
|
return (isString(n) ||
|
|
13231
13362
|
n.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */ ||
|
|
13232
13363
|
n.type === 2 /* NodeTypes.TEXT */ ||
|
|
@@ -13235,7 +13366,7 @@ function isText$1(n) {
|
|
|
13235
13366
|
}
|
|
13236
13367
|
function genNodeListAsArray(nodes, context) {
|
|
13237
13368
|
const multilines = nodes.length > 3 ||
|
|
13238
|
-
(nodes.some(n => isArray(n) || !isText
|
|
13369
|
+
(nodes.some(n => isArray(n) || !isText(n)));
|
|
13239
13370
|
context.push(`[`);
|
|
13240
13371
|
multilines && context.indent();
|
|
13241
13372
|
genNodeList(nodes, context, multilines);
|
|
@@ -14124,7 +14255,7 @@ asRawStatements = false, localVars = Object.create(context.identifiers)) {
|
|
|
14124
14255
|
}).program;
|
|
14125
14256
|
}
|
|
14126
14257
|
catch (e) {
|
|
14127
|
-
context.onError(createCompilerError(
|
|
14258
|
+
context.onError(createCompilerError(45 /* ErrorCodes.X_INVALID_EXPRESSION */, node.loc, undefined, e.message));
|
|
14128
14259
|
return node;
|
|
14129
14260
|
}
|
|
14130
14261
|
const ids = [];
|
|
@@ -15060,7 +15191,7 @@ function resolveComponentType(node, context, ssr = false) {
|
|
|
15060
15191
|
const isProp = findProp(node, 'is');
|
|
15061
15192
|
if (isProp) {
|
|
15062
15193
|
if (isExplicitDynamic ||
|
|
15063
|
-
(isCompatEnabled
|
|
15194
|
+
(isCompatEnabled("COMPILER_IS_ON_ELEMENT" /* CompilerDeprecationTypes.COMPILER_IS_ON_ELEMENT */, context))) {
|
|
15064
15195
|
const exp = isProp.type === 6 /* NodeTypes.ATTRIBUTE */
|
|
15065
15196
|
? isProp.value && createSimpleExpression(isProp.value.content, true)
|
|
15066
15197
|
: isProp.exp;
|
|
@@ -15262,7 +15393,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
15262
15393
|
if (name === 'is' &&
|
|
15263
15394
|
(isComponentTag(tag) ||
|
|
15264
15395
|
(value && value.content.startsWith('vue:')) ||
|
|
15265
|
-
(isCompatEnabled
|
|
15396
|
+
(isCompatEnabled("COMPILER_IS_ON_ELEMENT" /* CompilerDeprecationTypes.COMPILER_IS_ON_ELEMENT */, context)))) {
|
|
15266
15397
|
continue;
|
|
15267
15398
|
}
|
|
15268
15399
|
properties.push(createObjectProperty(createSimpleExpression(name, true, getInnerRange(loc, 0, name.length)), createSimpleExpression(value ? value.content : '', isStatic, value ? value.loc : loc)));
|
|
@@ -15288,7 +15419,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
15288
15419
|
(isVBind &&
|
|
15289
15420
|
isStaticArgOf(arg, 'is') &&
|
|
15290
15421
|
(isComponentTag(tag) ||
|
|
15291
|
-
(isCompatEnabled
|
|
15422
|
+
(isCompatEnabled("COMPILER_IS_ON_ELEMENT" /* CompilerDeprecationTypes.COMPILER_IS_ON_ELEMENT */, context))))) {
|
|
15292
15423
|
continue;
|
|
15293
15424
|
}
|
|
15294
15425
|
// skip v-on in SSR compilation
|
|
@@ -15314,7 +15445,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
15314
15445
|
// have to merge early for compat build check
|
|
15315
15446
|
pushMergeArg();
|
|
15316
15447
|
{
|
|
15317
|
-
if (isCompatEnabled
|
|
15448
|
+
if (isCompatEnabled("COMPILER_V_BIND_OBJECT_ORDER" /* CompilerDeprecationTypes.COMPILER_V_BIND_OBJECT_ORDER */, context)) {
|
|
15318
15449
|
mergeArgs.unshift(exp);
|
|
15319
15450
|
continue;
|
|
15320
15451
|
}
|
|
@@ -15494,7 +15625,7 @@ function dedupeProperties(properties) {
|
|
|
15494
15625
|
const existing = knownProps.get(name);
|
|
15495
15626
|
if (existing) {
|
|
15496
15627
|
if (name === 'style' || name === 'class' || isOn(name)) {
|
|
15497
|
-
mergeAsArray
|
|
15628
|
+
mergeAsArray(existing, prop);
|
|
15498
15629
|
}
|
|
15499
15630
|
// unexpected duplicate, should have emitted error during parse
|
|
15500
15631
|
}
|
|
@@ -15505,7 +15636,7 @@ function dedupeProperties(properties) {
|
|
|
15505
15636
|
}
|
|
15506
15637
|
return deduped;
|
|
15507
15638
|
}
|
|
15508
|
-
function mergeAsArray
|
|
15639
|
+
function mergeAsArray(existing, incoming) {
|
|
15509
15640
|
if (existing.value.type === 17 /* NodeTypes.JS_ARRAY_EXPRESSION */) {
|
|
15510
15641
|
existing.value.elements.push(incoming.value);
|
|
15511
15642
|
}
|
|
@@ -15639,7 +15770,7 @@ function processSlotOutlet(node, context) {
|
|
|
15639
15770
|
}
|
|
15640
15771
|
|
|
15641
15772
|
const fnExpRE = /^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
|
|
15642
|
-
const transformOn = (dir, node, context, augmentor) => {
|
|
15773
|
+
const transformOn$1 = (dir, node, context, augmentor) => {
|
|
15643
15774
|
const { loc, modifiers, arg } = dir;
|
|
15644
15775
|
if (!dir.exp && !modifiers.length) {
|
|
15645
15776
|
context.onError(createCompilerError(35 /* ErrorCodes.X_V_ON_NO_EXPRESSION */, loc));
|
|
@@ -15834,11 +15965,11 @@ const transformText = (node, context) => {
|
|
|
15834
15965
|
let hasText = false;
|
|
15835
15966
|
for (let i = 0; i < children.length; i++) {
|
|
15836
15967
|
const child = children[i];
|
|
15837
|
-
if (isText(child)) {
|
|
15968
|
+
if (isText$1(child)) {
|
|
15838
15969
|
hasText = true;
|
|
15839
15970
|
for (let j = i + 1; j < children.length; j++) {
|
|
15840
15971
|
const next = children[j];
|
|
15841
|
-
if (isText(next)) {
|
|
15972
|
+
if (isText$1(next)) {
|
|
15842
15973
|
if (!currentContainer) {
|
|
15843
15974
|
currentContainer = children[i] = createCompoundExpression([child], child.loc);
|
|
15844
15975
|
}
|
|
@@ -15880,7 +16011,7 @@ const transformText = (node, context) => {
|
|
|
15880
16011
|
// runtime normalization.
|
|
15881
16012
|
for (let i = 0; i < children.length; i++) {
|
|
15882
16013
|
const child = children[i];
|
|
15883
|
-
if (isText(child) || child.type === 8 /* NodeTypes.COMPOUND_EXPRESSION */) {
|
|
16014
|
+
if (isText$1(child) || child.type === 8 /* NodeTypes.COMPOUND_EXPRESSION */) {
|
|
15884
16015
|
const callArgs = [];
|
|
15885
16016
|
// createTextVNode defaults to single whitespace, so if it is a
|
|
15886
16017
|
// single space the code could be an empty call to save bytes.
|
|
@@ -15905,13 +16036,13 @@ const transformText = (node, context) => {
|
|
|
15905
16036
|
}
|
|
15906
16037
|
};
|
|
15907
16038
|
|
|
15908
|
-
const seen = new WeakSet();
|
|
16039
|
+
const seen$1 = new WeakSet();
|
|
15909
16040
|
const transformOnce = (node, context) => {
|
|
15910
16041
|
if (node.type === 1 /* NodeTypes.ELEMENT */ && findDir(node, 'once', true)) {
|
|
15911
|
-
if (seen.has(node) || context.inVOnce) {
|
|
16042
|
+
if (seen$1.has(node) || context.inVOnce) {
|
|
15912
16043
|
return;
|
|
15913
16044
|
}
|
|
15914
|
-
seen.add(node);
|
|
16045
|
+
seen$1.add(node);
|
|
15915
16046
|
context.inVOnce = true;
|
|
15916
16047
|
context.helper(SET_BLOCK_TRACKING);
|
|
15917
16048
|
return () => {
|
|
@@ -15924,7 +16055,7 @@ const transformOnce = (node, context) => {
|
|
|
15924
16055
|
}
|
|
15925
16056
|
};
|
|
15926
16057
|
|
|
15927
|
-
const transformModel = (dir, node, context) => {
|
|
16058
|
+
const transformModel$1 = (dir, node, context) => {
|
|
15928
16059
|
const { exp, arg } = dir;
|
|
15929
16060
|
if (!exp) {
|
|
15930
16061
|
context.onError(createCompilerError(41 /* ErrorCodes.X_V_MODEL_NO_EXPRESSION */, dir.loc));
|
|
@@ -15935,9 +16066,16 @@ const transformModel = (dir, node, context) => {
|
|
|
15935
16066
|
// im SFC <script setup> inline mode, the exp may have been transformed into
|
|
15936
16067
|
// _unref(exp)
|
|
15937
16068
|
const bindingType = context.bindingMetadata[rawExp];
|
|
16069
|
+
// check props
|
|
16070
|
+
if (bindingType === "props" /* BindingTypes.PROPS */ ||
|
|
16071
|
+
bindingType === "props-aliased" /* BindingTypes.PROPS_ALIASED */) {
|
|
16072
|
+
context.onError(createCompilerError(44 /* ErrorCodes.X_V_MODEL_ON_PROPS */, exp.loc));
|
|
16073
|
+
return createTransformProps();
|
|
16074
|
+
}
|
|
15938
16075
|
const maybeRef = context.inline &&
|
|
15939
|
-
bindingType
|
|
15940
|
-
|
|
16076
|
+
(bindingType === "setup-let" /* BindingTypes.SETUP_LET */ ||
|
|
16077
|
+
bindingType === "setup-ref" /* BindingTypes.SETUP_REF */ ||
|
|
16078
|
+
bindingType === "setup-maybe-ref" /* BindingTypes.SETUP_MAYBE_REF */);
|
|
15941
16079
|
if (!expString.trim() ||
|
|
15942
16080
|
(!isMemberExpression(expString, context) && !maybeRef)) {
|
|
15943
16081
|
context.onError(createCompilerError(42 /* ErrorCodes.X_V_MODEL_MALFORMED_EXPRESSION */, exp.loc));
|
|
@@ -15952,7 +16090,7 @@ const transformModel = (dir, node, context) => {
|
|
|
15952
16090
|
const propName = arg ? arg : createSimpleExpression('modelValue', true);
|
|
15953
16091
|
const eventName = arg
|
|
15954
16092
|
? isStaticExp(arg)
|
|
15955
|
-
? `onUpdate:${arg.content}`
|
|
16093
|
+
? `onUpdate:${camelize(arg.content)}`
|
|
15956
16094
|
: createCompoundExpression(['"onUpdate:" + ', arg])
|
|
15957
16095
|
: `onUpdate:modelValue`;
|
|
15958
16096
|
let assignmentExp;
|
|
@@ -16017,7 +16155,7 @@ function createTransformProps(props = []) {
|
|
|
16017
16155
|
|
|
16018
16156
|
const validDivisionCharRE = /[\w).+\-_$\]]/;
|
|
16019
16157
|
const transformFilter = (node, context) => {
|
|
16020
|
-
if (!isCompatEnabled
|
|
16158
|
+
if (!isCompatEnabled("COMPILER_FILTER" /* CompilerDeprecationTypes.COMPILER_FILTERS */, context)) {
|
|
16021
16159
|
return;
|
|
16022
16160
|
}
|
|
16023
16161
|
if (node.type === 5 /* NodeTypes.INTERPOLATION */) {
|
|
@@ -16179,14 +16317,14 @@ function wrapFilter(exp, filter, context) {
|
|
|
16179
16317
|
}
|
|
16180
16318
|
}
|
|
16181
16319
|
|
|
16182
|
-
const seen
|
|
16320
|
+
const seen = new WeakSet();
|
|
16183
16321
|
const transformMemo = (node, context) => {
|
|
16184
16322
|
if (node.type === 1 /* NodeTypes.ELEMENT */) {
|
|
16185
16323
|
const dir = findDir(node, 'memo');
|
|
16186
|
-
if (!dir || seen
|
|
16324
|
+
if (!dir || seen.has(node)) {
|
|
16187
16325
|
return;
|
|
16188
16326
|
}
|
|
16189
|
-
seen
|
|
16327
|
+
seen.add(node);
|
|
16190
16328
|
return () => {
|
|
16191
16329
|
const codegenNode = node.codegenNode ||
|
|
16192
16330
|
context.currentNode.codegenNode;
|
|
@@ -16227,9 +16365,9 @@ function getBaseTransformPreset(prefixIdentifiers) {
|
|
|
16227
16365
|
transformText
|
|
16228
16366
|
],
|
|
16229
16367
|
{
|
|
16230
|
-
on: transformOn,
|
|
16368
|
+
on: transformOn$1,
|
|
16231
16369
|
bind: transformBind,
|
|
16232
|
-
model: transformModel
|
|
16370
|
+
model: transformModel$1
|
|
16233
16371
|
}
|
|
16234
16372
|
];
|
|
16235
16373
|
}
|
|
@@ -16240,10 +16378,10 @@ function baseCompile(template, options = {}) {
|
|
|
16240
16378
|
const isModuleMode = options.mode === 'module';
|
|
16241
16379
|
const prefixIdentifiers = (options.prefixIdentifiers === true || isModuleMode);
|
|
16242
16380
|
if (!prefixIdentifiers && options.cacheHandlers) {
|
|
16243
|
-
onError(createCompilerError(
|
|
16381
|
+
onError(createCompilerError(49 /* ErrorCodes.X_CACHE_HANDLER_NOT_SUPPORTED */));
|
|
16244
16382
|
}
|
|
16245
16383
|
if (options.scopeId && !isModuleMode) {
|
|
16246
|
-
onError(createCompilerError(
|
|
16384
|
+
onError(createCompilerError(50 /* ErrorCodes.X_SCOPE_ID_NOT_SUPPORTED */));
|
|
16247
16385
|
}
|
|
16248
16386
|
const ast = isString(template) ? baseParse(template, options) : template;
|
|
16249
16387
|
const [nodeTransforms, directiveTransforms] = getBaseTransformPreset(prefixIdentifiers);
|
|
@@ -16277,7 +16415,7 @@ const V_MODEL_DYNAMIC = Symbol(``);
|
|
|
16277
16415
|
const V_ON_WITH_MODIFIERS = Symbol(``);
|
|
16278
16416
|
const V_ON_WITH_KEYS = Symbol(``);
|
|
16279
16417
|
const V_SHOW = Symbol(``);
|
|
16280
|
-
const TRANSITION
|
|
16418
|
+
const TRANSITION = Symbol(``);
|
|
16281
16419
|
const TRANSITION_GROUP = Symbol(``);
|
|
16282
16420
|
registerRuntimeHelpers({
|
|
16283
16421
|
[V_MODEL_RADIO]: `vModelRadio`,
|
|
@@ -16288,7 +16426,7 @@ registerRuntimeHelpers({
|
|
|
16288
16426
|
[V_ON_WITH_MODIFIERS]: `withModifiers`,
|
|
16289
16427
|
[V_ON_WITH_KEYS]: `withKeys`,
|
|
16290
16428
|
[V_SHOW]: `vShow`,
|
|
16291
|
-
[TRANSITION
|
|
16429
|
+
[TRANSITION]: `Transition`,
|
|
16292
16430
|
[TRANSITION_GROUP]: `TransitionGroup`
|
|
16293
16431
|
});
|
|
16294
16432
|
|
|
@@ -18656,7 +18794,7 @@ const parserOptions = {
|
|
|
18656
18794
|
decodeEntities: decodeHtml,
|
|
18657
18795
|
isBuiltInComponent: (tag) => {
|
|
18658
18796
|
if (isBuiltInType(tag, `Transition`)) {
|
|
18659
|
-
return TRANSITION
|
|
18797
|
+
return TRANSITION;
|
|
18660
18798
|
}
|
|
18661
18799
|
else if (isBuiltInType(tag, `TransitionGroup`)) {
|
|
18662
18800
|
return TRANSITION_GROUP;
|
|
@@ -18747,26 +18885,26 @@ function createDOMCompilerError(code, loc) {
|
|
|
18747
18885
|
return createCompilerError(code, loc, DOMErrorMessages );
|
|
18748
18886
|
}
|
|
18749
18887
|
const DOMErrorMessages = {
|
|
18750
|
-
[
|
|
18751
|
-
[
|
|
18752
|
-
[
|
|
18753
|
-
[
|
|
18754
|
-
[
|
|
18755
|
-
[
|
|
18756
|
-
[
|
|
18757
|
-
[
|
|
18758
|
-
[
|
|
18759
|
-
[
|
|
18760
|
-
[
|
|
18888
|
+
[51 /* DOMErrorCodes.X_V_HTML_NO_EXPRESSION */]: `v-html is missing expression.`,
|
|
18889
|
+
[52 /* DOMErrorCodes.X_V_HTML_WITH_CHILDREN */]: `v-html will override element children.`,
|
|
18890
|
+
[53 /* DOMErrorCodes.X_V_TEXT_NO_EXPRESSION */]: `v-text is missing expression.`,
|
|
18891
|
+
[54 /* DOMErrorCodes.X_V_TEXT_WITH_CHILDREN */]: `v-text will override element children.`,
|
|
18892
|
+
[55 /* DOMErrorCodes.X_V_MODEL_ON_INVALID_ELEMENT */]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
|
|
18893
|
+
[56 /* DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT */]: `v-model argument is not supported on plain elements.`,
|
|
18894
|
+
[57 /* DOMErrorCodes.X_V_MODEL_ON_FILE_INPUT_ELEMENT */]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
|
|
18895
|
+
[58 /* DOMErrorCodes.X_V_MODEL_UNNECESSARY_VALUE */]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
|
|
18896
|
+
[59 /* DOMErrorCodes.X_V_SHOW_NO_EXPRESSION */]: `v-show is missing expression.`,
|
|
18897
|
+
[60 /* DOMErrorCodes.X_TRANSITION_INVALID_CHILDREN */]: `<Transition> expects exactly one child element or component.`,
|
|
18898
|
+
[61 /* DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG */]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
|
|
18761
18899
|
};
|
|
18762
18900
|
|
|
18763
18901
|
const transformVHtml = (dir, node, context) => {
|
|
18764
18902
|
const { exp, loc } = dir;
|
|
18765
18903
|
if (!exp) {
|
|
18766
|
-
context.onError(createDOMCompilerError(
|
|
18904
|
+
context.onError(createDOMCompilerError(51 /* DOMErrorCodes.X_V_HTML_NO_EXPRESSION */, loc));
|
|
18767
18905
|
}
|
|
18768
18906
|
if (node.children.length) {
|
|
18769
|
-
context.onError(createDOMCompilerError(
|
|
18907
|
+
context.onError(createDOMCompilerError(52 /* DOMErrorCodes.X_V_HTML_WITH_CHILDREN */, loc));
|
|
18770
18908
|
node.children.length = 0;
|
|
18771
18909
|
}
|
|
18772
18910
|
return {
|
|
@@ -18779,10 +18917,10 @@ const transformVHtml = (dir, node, context) => {
|
|
|
18779
18917
|
const transformVText = (dir, node, context) => {
|
|
18780
18918
|
const { exp, loc } = dir;
|
|
18781
18919
|
if (!exp) {
|
|
18782
|
-
context.onError(createDOMCompilerError(
|
|
18920
|
+
context.onError(createDOMCompilerError(53 /* DOMErrorCodes.X_V_TEXT_NO_EXPRESSION */, loc));
|
|
18783
18921
|
}
|
|
18784
18922
|
if (node.children.length) {
|
|
18785
|
-
context.onError(createDOMCompilerError(
|
|
18923
|
+
context.onError(createDOMCompilerError(54 /* DOMErrorCodes.X_V_TEXT_WITH_CHILDREN */, loc));
|
|
18786
18924
|
node.children.length = 0;
|
|
18787
18925
|
}
|
|
18788
18926
|
return {
|
|
@@ -18796,14 +18934,14 @@ const transformVText = (dir, node, context) => {
|
|
|
18796
18934
|
};
|
|
18797
18935
|
};
|
|
18798
18936
|
|
|
18799
|
-
const transformModel
|
|
18800
|
-
const baseResult = transformModel(dir, node, context);
|
|
18937
|
+
const transformModel = (dir, node, context) => {
|
|
18938
|
+
const baseResult = transformModel$1(dir, node, context);
|
|
18801
18939
|
// base transform has errors OR component v-model (only need props)
|
|
18802
18940
|
if (!baseResult.props.length || node.tagType === 1 /* ElementTypes.COMPONENT */) {
|
|
18803
18941
|
return baseResult;
|
|
18804
18942
|
}
|
|
18805
18943
|
if (dir.arg) {
|
|
18806
|
-
context.onError(createDOMCompilerError(
|
|
18944
|
+
context.onError(createDOMCompilerError(56 /* DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT */, dir.arg.loc));
|
|
18807
18945
|
}
|
|
18808
18946
|
const { tag } = node;
|
|
18809
18947
|
const isCustomElement = context.isCustomElement(tag);
|
|
@@ -18830,7 +18968,7 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
18830
18968
|
break;
|
|
18831
18969
|
case 'file':
|
|
18832
18970
|
isInvalidType = true;
|
|
18833
|
-
context.onError(createDOMCompilerError(
|
|
18971
|
+
context.onError(createDOMCompilerError(57 /* DOMErrorCodes.X_V_MODEL_ON_FILE_INPUT_ELEMENT */, dir.loc));
|
|
18834
18972
|
break;
|
|
18835
18973
|
}
|
|
18836
18974
|
}
|
|
@@ -18854,7 +18992,7 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
18854
18992
|
}
|
|
18855
18993
|
}
|
|
18856
18994
|
else {
|
|
18857
|
-
context.onError(createDOMCompilerError(
|
|
18995
|
+
context.onError(createDOMCompilerError(55 /* DOMErrorCodes.X_V_MODEL_ON_INVALID_ELEMENT */, dir.loc));
|
|
18858
18996
|
}
|
|
18859
18997
|
// native vmodel doesn't need the `modelValue` props since they are also
|
|
18860
18998
|
// passed to the runtime as `binding.value`. removing it reduces code size.
|
|
@@ -18881,7 +19019,7 @@ const resolveModifiers = (key, modifiers, context, loc) => {
|
|
|
18881
19019
|
for (let i = 0; i < modifiers.length; i++) {
|
|
18882
19020
|
const modifier = modifiers[i];
|
|
18883
19021
|
if (modifier === 'native' &&
|
|
18884
|
-
checkCompatEnabled
|
|
19022
|
+
checkCompatEnabled("COMPILER_V_ON_NATIVE" /* CompilerDeprecationTypes.COMPILER_V_ON_NATIVE */, context)) {
|
|
18885
19023
|
eventOptionModifiers.push(modifier);
|
|
18886
19024
|
}
|
|
18887
19025
|
else if (isEventOptionModifier(modifier)) {
|
|
@@ -18935,8 +19073,8 @@ const transformClick = (key, event) => {
|
|
|
18935
19073
|
])
|
|
18936
19074
|
: key;
|
|
18937
19075
|
};
|
|
18938
|
-
const transformOn
|
|
18939
|
-
return transformOn(dir, node, context, baseResult => {
|
|
19076
|
+
const transformOn = (dir, node, context) => {
|
|
19077
|
+
return transformOn$1(dir, node, context, baseResult => {
|
|
18940
19078
|
const { modifiers } = dir;
|
|
18941
19079
|
if (!modifiers.length)
|
|
18942
19080
|
return baseResult;
|
|
@@ -18978,7 +19116,7 @@ const transformOn$1 = (dir, node, context) => {
|
|
|
18978
19116
|
const transformShow = (dir, node, context) => {
|
|
18979
19117
|
const { exp, loc } = dir;
|
|
18980
19118
|
if (!exp) {
|
|
18981
|
-
context.onError(createDOMCompilerError(
|
|
19119
|
+
context.onError(createDOMCompilerError(59 /* DOMErrorCodes.X_V_SHOW_NO_EXPRESSION */, loc));
|
|
18982
19120
|
}
|
|
18983
19121
|
return {
|
|
18984
19122
|
props: [],
|
|
@@ -19286,7 +19424,7 @@ const ignoreSideEffectTags = (node, context) => {
|
|
|
19286
19424
|
if (node.type === 1 /* NodeTypes.ELEMENT */ &&
|
|
19287
19425
|
node.tagType === 0 /* ElementTypes.ELEMENT */ &&
|
|
19288
19426
|
(node.tag === 'script' || node.tag === 'style')) {
|
|
19289
|
-
context.onError(createDOMCompilerError(
|
|
19427
|
+
context.onError(createDOMCompilerError(61 /* DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG */, node.loc));
|
|
19290
19428
|
context.removeNode();
|
|
19291
19429
|
}
|
|
19292
19430
|
};
|
|
@@ -19299,11 +19437,11 @@ const DOMDirectiveTransforms = {
|
|
|
19299
19437
|
cloak: noopDirectiveTransform,
|
|
19300
19438
|
html: transformVHtml,
|
|
19301
19439
|
text: transformVText,
|
|
19302
|
-
model: transformModel
|
|
19303
|
-
on: transformOn
|
|
19440
|
+
model: transformModel,
|
|
19441
|
+
on: transformOn,
|
|
19304
19442
|
show: transformShow
|
|
19305
19443
|
};
|
|
19306
|
-
function compile
|
|
19444
|
+
function compile(template, options = {}) {
|
|
19307
19445
|
return baseCompile(template, extend({}, parserOptions, options, {
|
|
19308
19446
|
nodeTransforms: [
|
|
19309
19447
|
// ignore <script> and <tag>
|
|
@@ -19342,7 +19480,7 @@ function compileToFunction(template, options) {
|
|
|
19342
19480
|
// by the server, the template should not contain any user data.
|
|
19343
19481
|
template = el ? el.innerHTML : ``;
|
|
19344
19482
|
}
|
|
19345
|
-
const { code } = compile
|
|
19483
|
+
const { code } = compile(template, extend({
|
|
19346
19484
|
hoistStatic: true,
|
|
19347
19485
|
whitespace: 'preserve',
|
|
19348
19486
|
onError: undefined,
|
|
@@ -19357,7 +19495,7 @@ function compileToFunction(template, options) {
|
|
|
19357
19495
|
return (compileCache[key] = render);
|
|
19358
19496
|
}
|
|
19359
19497
|
registerRuntimeCompiler(compileToFunction);
|
|
19360
|
-
const Vue = createCompatVue
|
|
19498
|
+
const Vue = createCompatVue();
|
|
19361
19499
|
Vue.compile = compileToFunction;
|
|
19362
19500
|
|
|
19363
19501
|
module.exports = Vue;
|