@vue/compat 3.6.0-rc.5 → 3.6.0-rc.7
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-compat.d.ts +686 -685
- package/dist/vue.cjs.js +974 -769
- package/dist/vue.cjs.prod.js +797 -653
- package/dist/vue.esm-browser.js +876 -688
- package/dist/vue.esm-browser.prod.js +7 -7
- package/dist/vue.esm-bundler.js +901 -705
- package/dist/vue.global.js +877 -689
- package/dist/vue.global.prod.js +7 -7
- package/dist/vue.runtime.esm-browser.js +876 -688
- package/dist/vue.runtime.esm-browser.prod.js +7 -7
- package/dist/vue.runtime.esm-bundler.js +901 -705
- package/dist/vue.runtime.global.js +877 -689
- package/dist/vue.runtime.global.prod.js +7 -7
- package/package.json +2 -2
package/dist/vue.esm-browser.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compat v3.6.0-rc.
|
|
2
|
+
* @vue/compat v3.6.0-rc.7
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -23,7 +23,7 @@ var __exportAll = (all, no_symbols) => {
|
|
|
23
23
|
* \/\*#\_\_PURE\_\_\*\/
|
|
24
24
|
* So that they can be tree-shaken if necessary.
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
27
27
|
function makeMap(str) {
|
|
28
28
|
const map = Object.create(null);
|
|
29
29
|
for (const key of str.split(",")) map[key] = 1;
|
|
@@ -67,9 +67,9 @@ const toRawType = (value) => {
|
|
|
67
67
|
};
|
|
68
68
|
const isPlainObject = (val) => toTypeString(val) === "[object Object]";
|
|
69
69
|
const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
|
|
70
|
-
const isReservedProp =
|
|
71
|
-
const isBuiltInTag =
|
|
72
|
-
const isBuiltInDirective =
|
|
70
|
+
const isReservedProp = /*@__PURE__*/ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
|
|
71
|
+
const isBuiltInTag = /*#__PURE__*/ makeMap("slot,component");
|
|
72
|
+
const isBuiltInDirective = /*@__PURE__*/ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
|
|
73
73
|
const cacheStringFunction = (fn) => {
|
|
74
74
|
const cache = Object.create(null);
|
|
75
75
|
return ((str) => {
|
|
@@ -177,7 +177,7 @@ const slotFlagsText = {
|
|
|
177
177
|
[2]: "DYNAMIC",
|
|
178
178
|
[3]: "FORWARDED"
|
|
179
179
|
};
|
|
180
|
-
const isGloballyAllowed =
|
|
180
|
+
const isGloballyAllowed = /*@__PURE__*/ makeMap("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol");
|
|
181
181
|
//#endregion
|
|
182
182
|
//#region packages/shared/src/codeframe.ts
|
|
183
183
|
const range = 2;
|
|
@@ -284,22 +284,22 @@ const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,tr
|
|
|
284
284
|
* Compiler only.
|
|
285
285
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
286
286
|
*/
|
|
287
|
-
const isHTMLTag =
|
|
287
|
+
const isHTMLTag = /*@__PURE__*/ makeMap(HTML_TAGS);
|
|
288
288
|
/**
|
|
289
289
|
* Compiler only.
|
|
290
290
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
291
291
|
*/
|
|
292
|
-
const isSVGTag =
|
|
292
|
+
const isSVGTag = /*@__PURE__*/ makeMap(SVG_TAGS);
|
|
293
293
|
/**
|
|
294
294
|
* Compiler only.
|
|
295
295
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
296
296
|
*/
|
|
297
|
-
const isMathMLTag =
|
|
297
|
+
const isMathMLTag = /*@__PURE__*/ makeMap(MATH_TAGS);
|
|
298
298
|
/**
|
|
299
299
|
* Compiler only.
|
|
300
300
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
301
301
|
*/
|
|
302
|
-
const isVoidTag =
|
|
302
|
+
const isVoidTag = /*@__PURE__*/ makeMap(VOID_TAGS);
|
|
303
303
|
//#endregion
|
|
304
304
|
//#region packages/shared/src/domAttrConfig.ts
|
|
305
305
|
/**
|
|
@@ -314,11 +314,11 @@ const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
|
|
|
314
314
|
* - readonly -> readOnly
|
|
315
315
|
*/
|
|
316
316
|
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
|
|
317
|
-
const isSpecialBooleanAttr =
|
|
317
|
+
const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
|
|
318
318
|
/**
|
|
319
319
|
* The full list is needed during SSR to produce the correct initial markup.
|
|
320
320
|
*/
|
|
321
|
-
const isBooleanAttr =
|
|
321
|
+
const isBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
|
|
322
322
|
/**
|
|
323
323
|
* Boolean attributes should be included if the value is truthy or ''.
|
|
324
324
|
* e.g. `<select multiple>` compiles to `{ multiple: '' }`
|
|
@@ -332,11 +332,11 @@ function includeBooleanAttr(value) {
|
|
|
332
332
|
* Don't also forget to allow `data-*` and `aria-*`!
|
|
333
333
|
* Generated from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes
|
|
334
334
|
*/
|
|
335
|
-
const isKnownHtmlAttr =
|
|
335
|
+
const isKnownHtmlAttr = /*@__PURE__*/ makeMap("accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap");
|
|
336
336
|
/**
|
|
337
337
|
* Generated from https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
|
|
338
338
|
*/
|
|
339
|
-
const isKnownSvgAttr =
|
|
339
|
+
const isKnownSvgAttr = /*@__PURE__*/ makeMap("xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan");
|
|
340
340
|
/**
|
|
341
341
|
* Shared between server-renderer and runtime-core hydration logic
|
|
342
342
|
*/
|
|
@@ -368,6 +368,21 @@ function looseCompareArrays(a, b) {
|
|
|
368
368
|
for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i]);
|
|
369
369
|
return equal;
|
|
370
370
|
}
|
|
371
|
+
function looseCompareCollections(a, b) {
|
|
372
|
+
if (a.size !== b.size) return false;
|
|
373
|
+
const candidates = Array.from(b);
|
|
374
|
+
const matched = new Uint8Array(candidates.length);
|
|
375
|
+
for (const item of a) {
|
|
376
|
+
let index = -1;
|
|
377
|
+
for (let i = 0; i < candidates.length; i++) if (!matched[i] && looseEqual(item, candidates[i])) {
|
|
378
|
+
index = i;
|
|
379
|
+
break;
|
|
380
|
+
}
|
|
381
|
+
if (index < 0) return false;
|
|
382
|
+
matched[index] = 1;
|
|
383
|
+
}
|
|
384
|
+
return true;
|
|
385
|
+
}
|
|
371
386
|
function looseEqual(a, b) {
|
|
372
387
|
if (a === b) return true;
|
|
373
388
|
let aValidType = isDate(a);
|
|
@@ -383,6 +398,12 @@ function looseEqual(a, b) {
|
|
|
383
398
|
bValidType = isObject(b);
|
|
384
399
|
if (aValidType || bValidType) {
|
|
385
400
|
if (!aValidType || !bValidType) return false;
|
|
401
|
+
aValidType = isMap(a);
|
|
402
|
+
bValidType = isMap(b);
|
|
403
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b) : false;
|
|
404
|
+
aValidType = isSet(a);
|
|
405
|
+
bValidType = isSet(b);
|
|
406
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b) : false;
|
|
386
407
|
if (Object.keys(a).length !== Object.keys(b).length) return false;
|
|
387
408
|
for (const key in a) {
|
|
388
409
|
const aHasKey = a.hasOwnProperty(key);
|
|
@@ -829,9 +850,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
829
850
|
if (isMap(target)) run(depsMap.get(MAP_KEY_ITERATE_KEY));
|
|
830
851
|
}
|
|
831
852
|
break;
|
|
832
|
-
case "set":
|
|
833
|
-
if (isMap(target)) run(depsMap.get(ITERATE_KEY));
|
|
834
|
-
break;
|
|
853
|
+
case "set": if (isMap(target)) run(depsMap.get(ITERATE_KEY));
|
|
835
854
|
}
|
|
836
855
|
}
|
|
837
856
|
}
|
|
@@ -1028,8 +1047,8 @@ function noTracking(self, method, args = []) {
|
|
|
1028
1047
|
}
|
|
1029
1048
|
//#endregion
|
|
1030
1049
|
//#region packages/reactivity/src/baseHandlers.ts
|
|
1031
|
-
const isNonTrackableKeys =
|
|
1032
|
-
const builtInSymbols = new Set(
|
|
1050
|
+
const isNonTrackableKeys = /*@__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);
|
|
1051
|
+
const builtInSymbols = new Set(/*@__PURE__*/ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
|
|
1033
1052
|
function hasOwnProperty(key) {
|
|
1034
1053
|
if (!isSymbol(key)) key = String(key);
|
|
1035
1054
|
const obj = /* @__PURE__ */ toRaw(this);
|
|
@@ -1084,12 +1103,14 @@ var MutableReactiveHandler = class extends BaseReactiveHandler {
|
|
|
1084
1103
|
oldValue = /* @__PURE__ */ toRaw(oldValue);
|
|
1085
1104
|
value = /* @__PURE__ */ toRaw(value);
|
|
1086
1105
|
}
|
|
1087
|
-
if (!isArrayWithIntegerKey && /* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value))
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1106
|
+
if (!isArrayWithIntegerKey && /* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value)) {
|
|
1107
|
+
if (isOldValueReadonly) {
|
|
1108
|
+
warn$2(`Set operation on key "${String(key)}" failed: target is readonly.`, target[key]);
|
|
1109
|
+
return true;
|
|
1110
|
+
} else {
|
|
1111
|
+
oldValue.value = value;
|
|
1112
|
+
return true;
|
|
1113
|
+
}
|
|
1093
1114
|
}
|
|
1094
1115
|
}
|
|
1095
1116
|
const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
|
|
@@ -1130,10 +1151,10 @@ var ReadonlyReactiveHandler = class extends BaseReactiveHandler {
|
|
|
1130
1151
|
return true;
|
|
1131
1152
|
}
|
|
1132
1153
|
};
|
|
1133
|
-
const mutableHandlers =
|
|
1134
|
-
const readonlyHandlers =
|
|
1135
|
-
const shallowReactiveHandlers =
|
|
1136
|
-
const shallowReadonlyHandlers =
|
|
1154
|
+
const mutableHandlers = /*@__PURE__*/ new MutableReactiveHandler();
|
|
1155
|
+
const readonlyHandlers = /*@__PURE__*/ new ReadonlyReactiveHandler();
|
|
1156
|
+
const shallowReactiveHandlers = /*@__PURE__*/ new MutableReactiveHandler(true);
|
|
1157
|
+
const shallowReadonlyHandlers = /*@__PURE__*/ new ReadonlyReactiveHandler(true);
|
|
1137
1158
|
//#endregion
|
|
1138
1159
|
//#region packages/reactivity/src/collectionHandlers.ts
|
|
1139
1160
|
const toShallow = (value) => value;
|
|
@@ -1284,10 +1305,10 @@ function createInstrumentationGetter(isReadonly, shallow) {
|
|
|
1284
1305
|
return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
|
|
1285
1306
|
};
|
|
1286
1307
|
}
|
|
1287
|
-
const mutableCollectionHandlers = { get:
|
|
1288
|
-
const shallowCollectionHandlers = { get:
|
|
1289
|
-
const readonlyCollectionHandlers = { get:
|
|
1290
|
-
const shallowReadonlyCollectionHandlers = { get:
|
|
1308
|
+
const mutableCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(false, false) };
|
|
1309
|
+
const shallowCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(false, true) };
|
|
1310
|
+
const readonlyCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(true, false) };
|
|
1311
|
+
const shallowReadonlyCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(true, true) };
|
|
1291
1312
|
function checkIdentityKeys(target, has, key) {
|
|
1292
1313
|
const rawKey = /* @__PURE__ */ toRaw(key);
|
|
1293
1314
|
if (rawKey !== key && has.call(target, rawKey)) {
|
|
@@ -1312,7 +1333,7 @@ function targetTypeMap(rawType) {
|
|
|
1312
1333
|
default: return 0;
|
|
1313
1334
|
}
|
|
1314
1335
|
}
|
|
1315
|
-
|
|
1336
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1316
1337
|
function reactive(target) {
|
|
1317
1338
|
if (/* @__PURE__ */ isReadonly(target)) return target;
|
|
1318
1339
|
return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
|
|
@@ -1347,7 +1368,7 @@ function reactive(target) {
|
|
|
1347
1368
|
* @param target - The source object.
|
|
1348
1369
|
* @see {@link https://vuejs.org/api/reactivity-advanced.html#shallowreactive}
|
|
1349
1370
|
*/
|
|
1350
|
-
|
|
1371
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1351
1372
|
function shallowReactive(target) {
|
|
1352
1373
|
return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap);
|
|
1353
1374
|
}
|
|
@@ -1380,7 +1401,7 @@ function shallowReactive(target) {
|
|
|
1380
1401
|
* @param target - The source object.
|
|
1381
1402
|
* @see {@link https://vuejs.org/api/reactivity-core.html#readonly}
|
|
1382
1403
|
*/
|
|
1383
|
-
|
|
1404
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1384
1405
|
function readonly(target) {
|
|
1385
1406
|
return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);
|
|
1386
1407
|
}
|
|
@@ -1414,7 +1435,7 @@ function readonly(target) {
|
|
|
1414
1435
|
* @param target - The source object.
|
|
1415
1436
|
* @see {@link https://vuejs.org/api/reactivity-advanced.html#shallowreadonly}
|
|
1416
1437
|
*/
|
|
1417
|
-
|
|
1438
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1418
1439
|
function shallowReadonly(target) {
|
|
1419
1440
|
return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);
|
|
1420
1441
|
}
|
|
@@ -1451,7 +1472,7 @@ function createReactiveObject(target, isReadonly, baseHandlers, collectionHandle
|
|
|
1451
1472
|
* @param value - The value to check.
|
|
1452
1473
|
* @see {@link https://vuejs.org/api/reactivity-utilities.html#isreactive}
|
|
1453
1474
|
*/
|
|
1454
|
-
|
|
1475
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1455
1476
|
function isReactive(value) {
|
|
1456
1477
|
if (/* @__PURE__ */ isReadonly(value)) return /* @__PURE__ */ isReactive(value["__v_raw"]);
|
|
1457
1478
|
return !!(value && value["__v_isReactive"]);
|
|
@@ -1467,11 +1488,11 @@ function isReactive(value) {
|
|
|
1467
1488
|
* @param value - The value to check.
|
|
1468
1489
|
* @see {@link https://vuejs.org/api/reactivity-utilities.html#isreadonly}
|
|
1469
1490
|
*/
|
|
1470
|
-
|
|
1491
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1471
1492
|
function isReadonly(value) {
|
|
1472
1493
|
return !!(value && value["__v_isReadonly"]);
|
|
1473
1494
|
}
|
|
1474
|
-
|
|
1495
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1475
1496
|
function isShallow(value) {
|
|
1476
1497
|
return !!(value && value["__v_isShallow"]);
|
|
1477
1498
|
}
|
|
@@ -1482,7 +1503,7 @@ function isShallow(value) {
|
|
|
1482
1503
|
* @param value - The value to check.
|
|
1483
1504
|
* @see {@link https://vuejs.org/api/reactivity-utilities.html#isproxy}
|
|
1484
1505
|
*/
|
|
1485
|
-
|
|
1506
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1486
1507
|
function isProxy(value) {
|
|
1487
1508
|
return value ? !!value["__v_raw"] : false;
|
|
1488
1509
|
}
|
|
@@ -1509,7 +1530,7 @@ function isProxy(value) {
|
|
|
1509
1530
|
* @param observed - The object for which the "raw" value is requested.
|
|
1510
1531
|
* @see {@link https://vuejs.org/api/reactivity-advanced.html#toraw}
|
|
1511
1532
|
*/
|
|
1512
|
-
|
|
1533
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1513
1534
|
function toRaw(observed) {
|
|
1514
1535
|
const raw = observed && observed["__v_raw"];
|
|
1515
1536
|
return raw ? /* @__PURE__ */ toRaw(raw) : observed;
|
|
@@ -1558,15 +1579,15 @@ const toReactive = (value) => isObject(value) ? /* @__PURE__ */ reactive(value)
|
|
|
1558
1579
|
const toReadonly = (value) => isObject(value) ? /* @__PURE__ */ readonly(value) : value;
|
|
1559
1580
|
//#endregion
|
|
1560
1581
|
//#region packages/reactivity/src/ref.ts
|
|
1561
|
-
|
|
1582
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1562
1583
|
function isRef(r) {
|
|
1563
1584
|
return r ? r["__v_isRef"] === true : false;
|
|
1564
1585
|
}
|
|
1565
|
-
|
|
1586
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1566
1587
|
function ref(value) {
|
|
1567
1588
|
return createRef(value, toReactive);
|
|
1568
1589
|
}
|
|
1569
|
-
|
|
1590
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1570
1591
|
function shallowRef(value) {
|
|
1571
1592
|
return createRef(value);
|
|
1572
1593
|
}
|
|
@@ -1769,7 +1790,7 @@ function customRef(factory) {
|
|
|
1769
1790
|
* @param object - Reactive object to be made into an object of linked refs.
|
|
1770
1791
|
* @see {@link https://vuejs.org/api/reactivity-utilities.html#torefs}
|
|
1771
1792
|
*/
|
|
1772
|
-
|
|
1793
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1773
1794
|
function toRefs(object) {
|
|
1774
1795
|
const ret = isArray(object) ? new Array(object.length) : {};
|
|
1775
1796
|
for (const key in object) ret[key] = propertyToRef(object, key);
|
|
@@ -1820,7 +1841,7 @@ var GetterRefImpl = class {
|
|
|
1820
1841
|
return this._value = this._getter();
|
|
1821
1842
|
}
|
|
1822
1843
|
};
|
|
1823
|
-
|
|
1844
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1824
1845
|
function toRef(source, key, defaultValue) {
|
|
1825
1846
|
if (/* @__PURE__ */ isRef(source)) return source;
|
|
1826
1847
|
else if (isFunction(source)) return new GetterRefImpl(source);
|
|
@@ -1886,10 +1907,12 @@ var ReactiveEffect = class {
|
|
|
1886
1907
|
get dirty() {
|
|
1887
1908
|
const flags = this.flags;
|
|
1888
1909
|
if (flags & 16) return true;
|
|
1889
|
-
if (flags & 32)
|
|
1890
|
-
this.
|
|
1891
|
-
|
|
1892
|
-
|
|
1910
|
+
if (flags & 32) {
|
|
1911
|
+
if (checkDirty(this.deps, this)) {
|
|
1912
|
+
this.flags = flags | 16;
|
|
1913
|
+
return true;
|
|
1914
|
+
} else this.flags = flags & -33;
|
|
1915
|
+
}
|
|
1893
1916
|
return false;
|
|
1894
1917
|
}
|
|
1895
1918
|
};
|
|
@@ -2068,10 +2091,12 @@ var ComputedRefImpl = class {
|
|
|
2068
2091
|
get _dirty() {
|
|
2069
2092
|
const flags = this.flags;
|
|
2070
2093
|
if (flags & 16) return true;
|
|
2071
|
-
if (flags & 32)
|
|
2072
|
-
this.
|
|
2073
|
-
|
|
2074
|
-
|
|
2094
|
+
if (flags & 32) {
|
|
2095
|
+
if (checkDirty(this.deps, this)) {
|
|
2096
|
+
this.flags = flags | 16;
|
|
2097
|
+
return true;
|
|
2098
|
+
} else this.flags = flags & -33;
|
|
2099
|
+
}
|
|
2075
2100
|
return false;
|
|
2076
2101
|
}
|
|
2077
2102
|
/**
|
|
@@ -2132,7 +2157,7 @@ var ComputedRefImpl = class {
|
|
|
2132
2157
|
}
|
|
2133
2158
|
};
|
|
2134
2159
|
setupOnTrigger(ComputedRefImpl);
|
|
2135
|
-
|
|
2160
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
2136
2161
|
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
2137
2162
|
let getter;
|
|
2138
2163
|
let setter;
|
|
@@ -2210,25 +2235,26 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
2210
2235
|
else if (isFunction(s)) return call ? call(s, 2) : s();
|
|
2211
2236
|
else warnInvalidSource(s, onWarn);
|
|
2212
2237
|
});
|
|
2213
|
-
} else if (isFunction(source))
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2238
|
+
} else if (isFunction(source)) {
|
|
2239
|
+
if (cb) getter = call ? () => call(source, 2) : source;
|
|
2240
|
+
else getter = () => {
|
|
2241
|
+
if (this.cleanupsLength) {
|
|
2242
|
+
const prevSub = setActiveSub();
|
|
2243
|
+
try {
|
|
2244
|
+
cleanup(this);
|
|
2245
|
+
} finally {
|
|
2246
|
+
setActiveSub(prevSub);
|
|
2247
|
+
}
|
|
2248
|
+
}
|
|
2249
|
+
const currentEffect = activeWatcher;
|
|
2250
|
+
activeWatcher = this;
|
|
2217
2251
|
try {
|
|
2218
|
-
|
|
2252
|
+
return call ? call(source, 3, [this.boundCleanup]) : source(this.boundCleanup);
|
|
2219
2253
|
} finally {
|
|
2220
|
-
|
|
2254
|
+
activeWatcher = currentEffect;
|
|
2221
2255
|
}
|
|
2222
|
-
}
|
|
2223
|
-
|
|
2224
|
-
activeWatcher = this;
|
|
2225
|
-
try {
|
|
2226
|
-
return call ? call(source, 3, [this.boundCleanup]) : source(this.boundCleanup);
|
|
2227
|
-
} finally {
|
|
2228
|
-
activeWatcher = currentEffect;
|
|
2229
|
-
}
|
|
2230
|
-
};
|
|
2231
|
-
else {
|
|
2256
|
+
};
|
|
2257
|
+
} else {
|
|
2232
2258
|
getter = NOOP;
|
|
2233
2259
|
warnInvalidSource(source, onWarn);
|
|
2234
2260
|
}
|
|
@@ -2552,7 +2578,7 @@ let currentFlushPromise = null;
|
|
|
2552
2578
|
let jobsLength = 0;
|
|
2553
2579
|
let flushIndex = 0;
|
|
2554
2580
|
let postFlushIndex = 0;
|
|
2555
|
-
const resolvedPromise =
|
|
2581
|
+
const resolvedPromise = /*@__PURE__*/ Promise.resolve();
|
|
2556
2582
|
const RECURSION_LIMIT = 100;
|
|
2557
2583
|
function nextTick(fn) {
|
|
2558
2584
|
const p = currentFlushPromise || resolvedPromise;
|
|
@@ -2591,6 +2617,7 @@ const doFlushJobs = () => {
|
|
|
2591
2617
|
flushJobs();
|
|
2592
2618
|
} catch (e) {
|
|
2593
2619
|
currentFlushPromise = null;
|
|
2620
|
+
if (jobsLength || postJobs.length) queueFlush();
|
|
2594
2621
|
throw e;
|
|
2595
2622
|
}
|
|
2596
2623
|
};
|
|
@@ -2598,9 +2625,10 @@ function queueFlush() {
|
|
|
2598
2625
|
if (!currentFlushPromise) currentFlushPromise = resolvedPromise.then(doFlushJobs);
|
|
2599
2626
|
}
|
|
2600
2627
|
function queuePostFlushCb(jobs, id = Infinity) {
|
|
2601
|
-
if (!isArray(jobs))
|
|
2602
|
-
|
|
2603
|
-
|
|
2628
|
+
if (!isArray(jobs)) {
|
|
2629
|
+
if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
|
|
2630
|
+
else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
|
|
2631
|
+
} else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
|
|
2604
2632
|
queueFlush();
|
|
2605
2633
|
}
|
|
2606
2634
|
function flushPreFlushCbs(instance, seen) {
|
|
@@ -2614,8 +2642,11 @@ function flushPreFlushCbs(instance, seen) {
|
|
|
2614
2642
|
i--;
|
|
2615
2643
|
jobsLength--;
|
|
2616
2644
|
if (cb.flags & 2) cb.flags &= -2;
|
|
2617
|
-
|
|
2618
|
-
|
|
2645
|
+
try {
|
|
2646
|
+
cb();
|
|
2647
|
+
} finally {
|
|
2648
|
+
if (!(cb.flags & 2)) cb.flags &= -2;
|
|
2649
|
+
}
|
|
2619
2650
|
}
|
|
2620
2651
|
}
|
|
2621
2652
|
function flushPostFlushCbs(seen) {
|
|
@@ -2628,18 +2659,22 @@ function flushPostFlushCbs(seen) {
|
|
|
2628
2659
|
activePostJobs = postJobs;
|
|
2629
2660
|
postJobs = [];
|
|
2630
2661
|
seen = seen || /* @__PURE__ */ new Map();
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
cb
|
|
2637
|
-
|
|
2638
|
-
|
|
2662
|
+
try {
|
|
2663
|
+
while (postFlushIndex < activePostJobs.length) {
|
|
2664
|
+
const cb = activePostJobs[postFlushIndex++];
|
|
2665
|
+
if (checkRecursiveUpdates(seen, cb)) continue;
|
|
2666
|
+
if (cb.flags & 2) cb.flags &= -2;
|
|
2667
|
+
if (!(cb.flags & 4)) try {
|
|
2668
|
+
cb();
|
|
2669
|
+
} finally {
|
|
2670
|
+
if (!(cb.flags & 2)) cb.flags &= -2;
|
|
2671
|
+
}
|
|
2639
2672
|
}
|
|
2673
|
+
} finally {
|
|
2674
|
+
while (postFlushIndex < activePostJobs.length) activePostJobs[postFlushIndex++].flags &= -2;
|
|
2675
|
+
activePostJobs = null;
|
|
2676
|
+
postFlushIndex = 0;
|
|
2640
2677
|
}
|
|
2641
|
-
activePostJobs = null;
|
|
2642
|
-
postFlushIndex = 0;
|
|
2643
2678
|
}
|
|
2644
2679
|
}
|
|
2645
2680
|
let isFlushing = false;
|
|
@@ -2649,9 +2684,12 @@ let isFlushing = false;
|
|
|
2649
2684
|
function flushOnAppMount(instance) {
|
|
2650
2685
|
if (!isFlushing) {
|
|
2651
2686
|
isFlushing = true;
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2687
|
+
try {
|
|
2688
|
+
flushPreFlushCbs(instance);
|
|
2689
|
+
flushPostFlushCbs();
|
|
2690
|
+
} finally {
|
|
2691
|
+
isFlushing = false;
|
|
2692
|
+
}
|
|
2655
2693
|
}
|
|
2656
2694
|
}
|
|
2657
2695
|
function flushJobs(seen) {
|
|
@@ -2681,8 +2719,8 @@ function flushJobs(seen) {
|
|
|
2681
2719
|
jobsLength = 0;
|
|
2682
2720
|
jobs.length = 0;
|
|
2683
2721
|
flushPostFlushCbs(seen);
|
|
2684
|
-
currentFlushPromise = null;
|
|
2685
2722
|
if (jobsLength || postJobs.length) flushJobs(seen);
|
|
2723
|
+
else currentFlushPromise = null;
|
|
2686
2724
|
}
|
|
2687
2725
|
}
|
|
2688
2726
|
function checkRecursiveUpdates(seen, fn) {
|
|
@@ -2713,6 +2751,19 @@ getGlobalThis().__VUE_HMR_RUNTIME__ = {
|
|
|
2713
2751
|
rerender: tryWrap(rerender),
|
|
2714
2752
|
reload: tryWrap(reload)
|
|
2715
2753
|
};
|
|
2754
|
+
function runWithHmrUpdating(fn) {
|
|
2755
|
+
isHmrUpdating = true;
|
|
2756
|
+
let done = false;
|
|
2757
|
+
try {
|
|
2758
|
+
fn();
|
|
2759
|
+
done = true;
|
|
2760
|
+
} finally {
|
|
2761
|
+
if (done) nextTick(() => {
|
|
2762
|
+
isHmrUpdating = false;
|
|
2763
|
+
});
|
|
2764
|
+
else isHmrUpdating = false;
|
|
2765
|
+
}
|
|
2766
|
+
}
|
|
2716
2767
|
const map = /* @__PURE__ */ new Map();
|
|
2717
2768
|
function registerHMR(instance) {
|
|
2718
2769
|
const id = instance.type.__hmrId;
|
|
@@ -2754,18 +2805,16 @@ function rerender(id, newRender) {
|
|
|
2754
2805
|
instance.render = newRender;
|
|
2755
2806
|
normalizeClassComponent(instance.type).render = newRender;
|
|
2756
2807
|
}
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2808
|
+
runWithHmrUpdating(() => {
|
|
2809
|
+
if (instance.vapor) {
|
|
2810
|
+
if (!instance.isUnmounted) instance.hmrRerender();
|
|
2811
|
+
} else {
|
|
2812
|
+
const i = instance;
|
|
2813
|
+
if (!(i.effect.flags & 1024)) {
|
|
2814
|
+
i.renderCache = [];
|
|
2815
|
+
i.effect.run();
|
|
2816
|
+
}
|
|
2765
2817
|
}
|
|
2766
|
-
}
|
|
2767
|
-
nextTick(() => {
|
|
2768
|
-
isHmrUpdating = false;
|
|
2769
2818
|
});
|
|
2770
2819
|
});
|
|
2771
2820
|
}
|
|
@@ -2780,15 +2829,17 @@ function reload(id, newComp) {
|
|
|
2780
2829
|
for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
|
|
2781
2830
|
const dirtyInstances = new Set(instances);
|
|
2782
2831
|
const rerenderedParents = /* @__PURE__ */ new Set();
|
|
2783
|
-
|
|
2784
|
-
const
|
|
2785
|
-
|
|
2786
|
-
if (
|
|
2787
|
-
rerenderedParents.
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2832
|
+
runWithHmrUpdating(() => {
|
|
2833
|
+
for (const instance of instances) {
|
|
2834
|
+
const parent = instance.parent;
|
|
2835
|
+
if (parent) {
|
|
2836
|
+
if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
|
|
2837
|
+
rerenderedParents.add(parent);
|
|
2838
|
+
parent.hmrRerender();
|
|
2839
|
+
}
|
|
2840
|
+
} else instance.hmrReload(newComp);
|
|
2841
|
+
}
|
|
2842
|
+
});
|
|
2792
2843
|
} else {
|
|
2793
2844
|
const parentUpdates = /* @__PURE__ */ new Map();
|
|
2794
2845
|
const dirtyInstanceSet = new Set(instances);
|
|
@@ -2822,21 +2873,22 @@ function reload(id, newComp) {
|
|
|
2822
2873
|
}
|
|
2823
2874
|
parentUpdates.forEach((updates, parent) => {
|
|
2824
2875
|
queueJob(() => {
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2876
|
+
try {
|
|
2877
|
+
runWithHmrUpdating(() => {
|
|
2878
|
+
if (parent.vapor) parent.hmrRerender();
|
|
2879
|
+
else {
|
|
2880
|
+
const i = parent;
|
|
2881
|
+
if (!(i.effect.flags & 1024)) {
|
|
2882
|
+
i.renderCache = [];
|
|
2883
|
+
i.effect.run();
|
|
2884
|
+
}
|
|
2885
|
+
}
|
|
2886
|
+
});
|
|
2887
|
+
} finally {
|
|
2888
|
+
updates.forEach(([instance, dirtyInstances]) => {
|
|
2889
|
+
dirtyInstances.delete(instance);
|
|
2890
|
+
});
|
|
2833
2891
|
}
|
|
2834
|
-
nextTick(() => {
|
|
2835
|
-
isHmrUpdating = false;
|
|
2836
|
-
});
|
|
2837
|
-
updates.forEach(([instance, dirtyInstances]) => {
|
|
2838
|
-
dirtyInstances.delete(instance);
|
|
2839
|
-
});
|
|
2840
2892
|
});
|
|
2841
2893
|
});
|
|
2842
2894
|
}
|
|
@@ -2905,20 +2957,20 @@ function devtoolsInitApp(app, version) {
|
|
|
2905
2957
|
function devtoolsUnmountApp(app) {
|
|
2906
2958
|
emit$2("app:unmount", app);
|
|
2907
2959
|
}
|
|
2908
|
-
const devtoolsComponentAdded =
|
|
2909
|
-
const devtoolsComponentUpdated =
|
|
2910
|
-
const _devtoolsComponentRemoved =
|
|
2960
|
+
const devtoolsComponentAdded = /*@__PURE__*/ createDevtoolsComponentHook("component:added");
|
|
2961
|
+
const devtoolsComponentUpdated = /*@__PURE__*/ createDevtoolsComponentHook("component:updated");
|
|
2962
|
+
const _devtoolsComponentRemoved = /*@__PURE__*/ createDevtoolsComponentHook("component:removed");
|
|
2911
2963
|
const devtoolsComponentRemoved = (component) => {
|
|
2912
2964
|
if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && !devtools$1.cleanupBuffer(component)) _devtoolsComponentRemoved(component);
|
|
2913
2965
|
};
|
|
2914
|
-
|
|
2966
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
2915
2967
|
function createDevtoolsComponentHook(hook) {
|
|
2916
2968
|
return (component) => {
|
|
2917
2969
|
emit$2(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : void 0, component);
|
|
2918
2970
|
};
|
|
2919
2971
|
}
|
|
2920
|
-
const devtoolsPerfStart =
|
|
2921
|
-
const devtoolsPerfEnd =
|
|
2972
|
+
const devtoolsPerfStart = /*@__PURE__*/ createDevtoolsPerformanceHook("perf:start");
|
|
2973
|
+
const devtoolsPerfEnd = /*@__PURE__*/ createDevtoolsPerformanceHook("perf:end");
|
|
2922
2974
|
function createDevtoolsPerformanceHook(hook) {
|
|
2923
2975
|
return (component, type, time) => {
|
|
2924
2976
|
emit$2(hook, component.appContext.app, component.uid, component, type, time);
|
|
@@ -3147,7 +3199,7 @@ function configureCompat$1(config) {
|
|
|
3147
3199
|
validateCompatConfig(config);
|
|
3148
3200
|
extend(globalCompatConfig, config);
|
|
3149
3201
|
}
|
|
3150
|
-
const seenConfigObjects =
|
|
3202
|
+
const seenConfigObjects = /*@__PURE__*/ new WeakSet();
|
|
3151
3203
|
const warnedInvalidKeys = {};
|
|
3152
3204
|
function validateCompatConfig(config, instance) {
|
|
3153
3205
|
if (seenConfigObjects.has(config)) return;
|
|
@@ -3199,7 +3251,7 @@ function checkCompatEnabled$1(key, instance, ...args) {
|
|
|
3199
3251
|
}
|
|
3200
3252
|
//#endregion
|
|
3201
3253
|
//#region packages/runtime-core/src/compat/instanceEventEmitter.ts
|
|
3202
|
-
const eventRegistryMap =
|
|
3254
|
+
const eventRegistryMap = /*@__PURE__*/ new WeakMap();
|
|
3203
3255
|
function getRegistry(instance) {
|
|
3204
3256
|
let events = eventRegistryMap.get(instance);
|
|
3205
3257
|
if (!events) eventRegistryMap.set(instance, events = Object.create(null));
|
|
@@ -3333,19 +3385,21 @@ const legacyDirectiveHookMap = {
|
|
|
3333
3385
|
};
|
|
3334
3386
|
function mapCompatDirectiveHook(name, dir, instance) {
|
|
3335
3387
|
const mappedName = legacyDirectiveHookMap[name];
|
|
3336
|
-
if (mappedName)
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3388
|
+
if (mappedName) {
|
|
3389
|
+
if (isArray(mappedName)) {
|
|
3390
|
+
const hook = [];
|
|
3391
|
+
mappedName.forEach((mapped) => {
|
|
3392
|
+
const mappedHook = dir[mapped];
|
|
3393
|
+
if (mappedHook) {
|
|
3394
|
+
softAssertCompatEnabled("CUSTOM_DIR", instance, mapped, name);
|
|
3395
|
+
hook.push(mappedHook);
|
|
3396
|
+
}
|
|
3397
|
+
});
|
|
3398
|
+
return hook.length ? hook : void 0;
|
|
3399
|
+
} else {
|
|
3400
|
+
if (dir[mappedName]) softAssertCompatEnabled("CUSTOM_DIR", instance, mappedName, name);
|
|
3401
|
+
return dir[mappedName];
|
|
3402
|
+
}
|
|
3349
3403
|
}
|
|
3350
3404
|
}
|
|
3351
3405
|
//#endregion
|
|
@@ -3534,15 +3588,16 @@ const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target inst
|
|
|
3534
3588
|
const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
|
|
3535
3589
|
const resolveTarget = (props, select) => {
|
|
3536
3590
|
const targetSelector = props && props.to;
|
|
3537
|
-
if (isString(targetSelector))
|
|
3538
|
-
|
|
3539
|
-
|
|
3591
|
+
if (isString(targetSelector)) {
|
|
3592
|
+
if (!select) {
|
|
3593
|
+
warn$1("Current renderer does not support string target for Teleports. (missing querySelector renderer option)");
|
|
3594
|
+
return null;
|
|
3595
|
+
} else {
|
|
3596
|
+
const target = select(targetSelector);
|
|
3597
|
+
if (!target && !isTeleportDisabled(props)) warn$1(`Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`);
|
|
3598
|
+
return target;
|
|
3599
|
+
}
|
|
3540
3600
|
} else {
|
|
3541
|
-
const target = select(targetSelector);
|
|
3542
|
-
if (!target && !isTeleportDisabled(props)) warn$1(`Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`);
|
|
3543
|
-
return target;
|
|
3544
|
-
}
|
|
3545
|
-
else {
|
|
3546
3601
|
if (!targetSelector && !isTeleportDisabled(props)) warn$1(`Invalid Teleport target: ${targetSelector}`);
|
|
3547
3602
|
return targetSelector;
|
|
3548
3603
|
}
|
|
@@ -3580,7 +3635,8 @@ const TeleportImpl = {
|
|
|
3580
3635
|
if (pendingMounts.get(vnode) !== mountJob) return;
|
|
3581
3636
|
pendingMounts.delete(vnode);
|
|
3582
3637
|
if (isTeleportDisabled(vnode.props)) {
|
|
3583
|
-
|
|
3638
|
+
const mountContainer = parentNode(vnode.el) || container;
|
|
3639
|
+
mount(vnode, mountContainer, vnode.anchor);
|
|
3584
3640
|
updateCssVars(vnode, true);
|
|
3585
3641
|
}
|
|
3586
3642
|
mountToTarget(vnode);
|
|
@@ -3689,15 +3745,17 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
3689
3745
|
const disabled = isTeleportDisabled(vnode.props);
|
|
3690
3746
|
if (target) {
|
|
3691
3747
|
const targetNode = target._lpa || target.firstChild;
|
|
3692
|
-
if (vnode.shapeFlag & 16)
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3748
|
+
if (vnode.shapeFlag & 16) {
|
|
3749
|
+
if (disabled) {
|
|
3750
|
+
hydrateDisabledTeleport(node, vnode);
|
|
3751
|
+
hydrateAnchor(target, targetNode);
|
|
3752
|
+
if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert, parentNode(node) === target ? node : null);
|
|
3753
|
+
} else {
|
|
3754
|
+
vnode.anchor = nextSibling(node);
|
|
3755
|
+
hydrateAnchor(target, targetNode);
|
|
3756
|
+
if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert);
|
|
3757
|
+
hydrateChildren(targetNode && nextSibling(targetNode), vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
3758
|
+
}
|
|
3701
3759
|
}
|
|
3702
3760
|
updateCssVars(vnode, disabled);
|
|
3703
3761
|
} else if (disabled) {
|
|
@@ -3864,8 +3922,10 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
3864
3922
|
persisted,
|
|
3865
3923
|
beforeEnter(el) {
|
|
3866
3924
|
let hook = onBeforeEnter;
|
|
3867
|
-
if (!state.isMounted)
|
|
3868
|
-
|
|
3925
|
+
if (!state.isMounted) {
|
|
3926
|
+
if (appear) hook = onBeforeAppear || onBeforeEnter;
|
|
3927
|
+
else return;
|
|
3928
|
+
}
|
|
3869
3929
|
if (el[leaveCbKey]) el[leaveCbKey](true);
|
|
3870
3930
|
earlyRemove();
|
|
3871
3931
|
callHook(hook, [el]);
|
|
@@ -3875,11 +3935,13 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
3875
3935
|
let hook = onEnter;
|
|
3876
3936
|
let afterHook = onAfterEnter;
|
|
3877
3937
|
let cancelHook = onEnterCancelled;
|
|
3878
|
-
if (!state.isMounted)
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3938
|
+
if (!state.isMounted) {
|
|
3939
|
+
if (appear) {
|
|
3940
|
+
hook = onAppear || onEnter;
|
|
3941
|
+
afterHook = onAfterAppear || onAfterEnter;
|
|
3942
|
+
cancelHook = onAppearCancelled || onEnterCancelled;
|
|
3943
|
+
} else return;
|
|
3944
|
+
}
|
|
3883
3945
|
let called = false;
|
|
3884
3946
|
el[enterCbKey$1] = (cancelled) => {
|
|
3885
3947
|
if (called) return;
|
|
@@ -3913,7 +3975,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
3913
3975
|
else done();
|
|
3914
3976
|
},
|
|
3915
3977
|
clone(node) {
|
|
3916
|
-
return cloneHooks(node);
|
|
3978
|
+
return cloneHooks ? cloneHooks(node) : hooks;
|
|
3917
3979
|
}
|
|
3918
3980
|
};
|
|
3919
3981
|
return hooks;
|
|
@@ -4045,9 +4107,9 @@ function checkTransitionMode(mode) {
|
|
|
4045
4107
|
}
|
|
4046
4108
|
//#endregion
|
|
4047
4109
|
//#region packages/runtime-core/src/apiDefineComponent.ts
|
|
4048
|
-
|
|
4110
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
4049
4111
|
function defineComponent(options, extraOptions) {
|
|
4050
|
-
return isFunction(options) ? extend({ name: options.name }, extraOptions, { setup: options }) : options;
|
|
4112
|
+
return isFunction(options) ? /*@__PURE__*/ (() => extend({ name: options.name }, extraOptions, { setup: options }))() : options;
|
|
4051
4113
|
}
|
|
4052
4114
|
//#endregion
|
|
4053
4115
|
//#region packages/runtime-core/src/helpers/useId.ts
|
|
@@ -4144,15 +4206,16 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
4144
4206
|
if (rawRef.f) {
|
|
4145
4207
|
const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
|
|
4146
4208
|
if (isUnmount) isArray(existing) && remove(existing, refValue);
|
|
4147
|
-
else if (!isArray(existing))
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4209
|
+
else if (!isArray(existing)) {
|
|
4210
|
+
if (_isString) {
|
|
4211
|
+
refs[ref] = [refValue];
|
|
4212
|
+
if (canSetSetupRef(ref)) setupState[ref] = refs[ref];
|
|
4213
|
+
} else {
|
|
4214
|
+
const newVal = [refValue];
|
|
4215
|
+
if (canSetRef(ref, rawRef.k)) ref.value = newVal;
|
|
4216
|
+
if (rawRef.k) refs[rawRef.k] = newVal;
|
|
4217
|
+
}
|
|
4218
|
+
} else if (!existing.includes(refValue)) existing.push(refValue);
|
|
4156
4219
|
} else if (_isString) {
|
|
4157
4220
|
refs[ref] = value;
|
|
4158
4221
|
if (canSetSetupRef(ref)) setupState[ref] = value;
|
|
@@ -4253,11 +4316,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4253
4316
|
let nextNode = null;
|
|
4254
4317
|
switch (type) {
|
|
4255
4318
|
case Text:
|
|
4256
|
-
if (domType !== 3)
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4319
|
+
if (domType !== 3) {
|
|
4320
|
+
if (vnode.children === "") {
|
|
4321
|
+
insert(vnode.el = createText(""), parentNode(node), node);
|
|
4322
|
+
nextNode = node;
|
|
4323
|
+
} else nextNode = onMismatch();
|
|
4324
|
+
} else {
|
|
4261
4325
|
if (node.data !== vnode.children) {
|
|
4262
4326
|
warn$1(`Hydration text mismatch in`, node.parentNode, `\n - rendered on server: ${JSON.stringify(node.data)}\n - expected on client: ${JSON.stringify(vnode.children)}`);
|
|
4263
4327
|
logMismatchError();
|
|
@@ -4296,9 +4360,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4296
4360
|
case VaporSlot:
|
|
4297
4361
|
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense, slotScopeIds);
|
|
4298
4362
|
break;
|
|
4299
|
-
default: if (shapeFlag & 1)
|
|
4300
|
-
|
|
4301
|
-
|
|
4363
|
+
default: if (shapeFlag & 1) {
|
|
4364
|
+
if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode$1(node)) nextNode = onMismatch();
|
|
4365
|
+
else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
4366
|
+
} else if (shapeFlag & 6) {
|
|
4302
4367
|
vnode.slotScopeIds = slotScopeIds;
|
|
4303
4368
|
const container = parentNode(node);
|
|
4304
4369
|
if (isFragmentStart) nextNode = locateClosingAnchor(node);
|
|
@@ -4320,19 +4385,20 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4320
4385
|
} else {
|
|
4321
4386
|
mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
|
|
4322
4387
|
const component = vnode.component;
|
|
4323
|
-
if (isAsyncWrapper(vnode)
|
|
4388
|
+
if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep && !component.asyncResolved)) {
|
|
4324
4389
|
let subTree;
|
|
4325
4390
|
if (isFragmentStart) {
|
|
4326
|
-
subTree = createVNode(
|
|
4391
|
+
subTree = createVNode(Static);
|
|
4327
4392
|
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
4328
4393
|
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
4329
4394
|
subTree.el = node;
|
|
4330
4395
|
component.subTree = subTree;
|
|
4331
4396
|
}
|
|
4332
4397
|
}
|
|
4333
|
-
} else if (shapeFlag & 64)
|
|
4334
|
-
|
|
4335
|
-
|
|
4398
|
+
} else if (shapeFlag & 64) {
|
|
4399
|
+
if (domType !== 8) nextNode = onMismatch();
|
|
4400
|
+
else nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
|
|
4401
|
+
} else if (shapeFlag & 128) nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, getContainerType(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);
|
|
4336
4402
|
else warn$1("Invalid HostVNode type:", type, `(${typeof type})`);
|
|
4337
4403
|
}
|
|
4338
4404
|
if (ref != null) setRef(ref, null, parentSuspense, vnode);
|
|
@@ -4473,8 +4539,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4473
4539
|
node = nextSibling(node);
|
|
4474
4540
|
if (node && isComment(node)) {
|
|
4475
4541
|
if (node.data === open) match++;
|
|
4476
|
-
if (node.data === close)
|
|
4477
|
-
|
|
4542
|
+
if (node.data === close) {
|
|
4543
|
+
if (match === 0) return nextSibling(node);
|
|
4544
|
+
else match--;
|
|
4545
|
+
}
|
|
4478
4546
|
}
|
|
4479
4547
|
}
|
|
4480
4548
|
return node;
|
|
@@ -4496,7 +4564,7 @@ const isTemplateNode$1 = (node) => {
|
|
|
4496
4564
|
/**
|
|
4497
4565
|
* Dev only
|
|
4498
4566
|
*/
|
|
4499
|
-
const resourceProps =
|
|
4567
|
+
const resourceProps = /*@__PURE__*/ new Set([
|
|
4500
4568
|
"src",
|
|
4501
4569
|
"srcset",
|
|
4502
4570
|
"href",
|
|
@@ -4738,14 +4806,14 @@ function forEachElement(node, cb) {
|
|
|
4738
4806
|
//#endregion
|
|
4739
4807
|
//#region packages/runtime-core/src/apiAsyncComponent.ts
|
|
4740
4808
|
const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
|
|
4741
|
-
|
|
4809
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
4742
4810
|
function defineAsyncComponent(source) {
|
|
4743
4811
|
const { load, getResolvedComp, setPendingRequest, source: { loadingComponent, errorComponent, delay, hydrate: hydrateStrategy, timeout, suspensible = true } } = createAsyncComponentContext(source);
|
|
4744
4812
|
return /* @__PURE__ */ defineComponent({
|
|
4745
4813
|
name: "AsyncComponentWrapper",
|
|
4746
4814
|
__asyncLoader: load,
|
|
4747
4815
|
__asyncHydrate(el, instance, hydrate) {
|
|
4748
|
-
performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy);
|
|
4816
|
+
performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy, true);
|
|
4749
4817
|
},
|
|
4750
4818
|
get __asyncResolved() {
|
|
4751
4819
|
return getResolvedComp();
|
|
@@ -4864,10 +4932,10 @@ const useAsyncComponentState = (delay, timeout, onError, instance = currentInsta
|
|
|
4864
4932
|
* shared between core and vapor
|
|
4865
4933
|
* @internal
|
|
4866
4934
|
*/
|
|
4867
|
-
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
|
|
4935
|
+
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy, skipIfUpdated) {
|
|
4868
4936
|
const wasConnected = el.isConnected;
|
|
4869
4937
|
let patched = false;
|
|
4870
|
-
(instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
4938
|
+
if (skipIfUpdated) (instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
4871
4939
|
const performHydrate = () => {
|
|
4872
4940
|
if (patched) {
|
|
4873
4941
|
{
|
|
@@ -4953,10 +5021,13 @@ const KeepAliveImpl = {
|
|
|
4953
5021
|
});
|
|
4954
5022
|
let pendingCacheKey = null;
|
|
4955
5023
|
const cacheSubtree = () => {
|
|
4956
|
-
if (pendingCacheKey != null)
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
5024
|
+
if (pendingCacheKey != null) {
|
|
5025
|
+
if (isSuspense(keepAliveInstance.subTree.type)) queuePostRenderEffect(() => {
|
|
5026
|
+
const vnode = getInnerChild(keepAliveInstance.subTree);
|
|
5027
|
+
if (vnode.component) cache.set(pendingCacheKey, vnode);
|
|
5028
|
+
}, void 0, keepAliveInstance.subTree.suspense);
|
|
5029
|
+
else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
|
|
5030
|
+
}
|
|
4960
5031
|
};
|
|
4961
5032
|
onMounted(cacheSubtree);
|
|
4962
5033
|
onUpdated(cacheSubtree);
|
|
@@ -5027,7 +5098,7 @@ const decorate$2 = (t) => {
|
|
|
5027
5098
|
t.__isBuiltIn = true;
|
|
5028
5099
|
return t;
|
|
5029
5100
|
};
|
|
5030
|
-
const KeepAlive =
|
|
5101
|
+
const KeepAlive = /*@__PURE__*/ decorate$2(KeepAliveImpl);
|
|
5031
5102
|
function matches(pattern, name) {
|
|
5032
5103
|
if (isArray(pattern)) return pattern.some((p) => matches(p, name));
|
|
5033
5104
|
else if (isString(pattern)) return pattern.split(",").includes(name);
|
|
@@ -5243,16 +5314,17 @@ function compatH(type, propsOrChildren, children) {
|
|
|
5243
5314
|
}
|
|
5244
5315
|
const l = arguments.length;
|
|
5245
5316
|
const is2ndArgArrayChildren = isArray(propsOrChildren);
|
|
5246
|
-
if (l === 2 || is2ndArgArrayChildren)
|
|
5247
|
-
if (
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5317
|
+
if (l === 2 || is2ndArgArrayChildren) {
|
|
5318
|
+
if (isObject(propsOrChildren) && !is2ndArgArrayChildren) {
|
|
5319
|
+
if (isVNode(propsOrChildren)) return convertLegacySlots(createVNode(type, null, [propsOrChildren]));
|
|
5320
|
+
return convertLegacySlots(convertLegacyDirectives(createVNode(type, convertLegacyProps(propsOrChildren, type)), propsOrChildren));
|
|
5321
|
+
} else return convertLegacySlots(createVNode(type, null, propsOrChildren));
|
|
5322
|
+
} else {
|
|
5251
5323
|
if (isVNode(children)) children = [children];
|
|
5252
5324
|
return convertLegacySlots(convertLegacyDirectives(createVNode(type, convertLegacyProps(propsOrChildren, type), children), propsOrChildren));
|
|
5253
5325
|
}
|
|
5254
5326
|
}
|
|
5255
|
-
const skipLegacyRootLevelProps =
|
|
5327
|
+
const skipLegacyRootLevelProps = /*@__PURE__*/ makeMap("staticStyle,staticClass,directives,model,hook");
|
|
5256
5328
|
function convertLegacyProps(legacyProps, type) {
|
|
5257
5329
|
if (!legacyProps) return null;
|
|
5258
5330
|
const converted = {};
|
|
@@ -5264,8 +5336,10 @@ function convertLegacyProps(legacyProps, type) {
|
|
|
5264
5336
|
if (key === "nativeOn") handlerKey += `Native`;
|
|
5265
5337
|
const existing = converted[handlerKey];
|
|
5266
5338
|
const incoming = listeners[event];
|
|
5267
|
-
if (existing !== incoming)
|
|
5268
|
-
|
|
5339
|
+
if (existing !== incoming) {
|
|
5340
|
+
if (existing) converted[handlerKey] = [].concat(existing, incoming);
|
|
5341
|
+
else converted[handlerKey] = incoming;
|
|
5342
|
+
}
|
|
5269
5343
|
}
|
|
5270
5344
|
} else if (!skipLegacyRootLevelProps(key)) converted[key] = legacyProps[key];
|
|
5271
5345
|
if (legacyProps.staticClass) converted.class = normalizeClass([legacyProps.staticClass, converted.class]);
|
|
@@ -5364,7 +5438,7 @@ function convertLegacyFunctionalComponent(comp) {
|
|
|
5364
5438
|
const legacyFn = comp.render;
|
|
5365
5439
|
const Func = (props, ctx) => {
|
|
5366
5440
|
const instance = getCurrentInstance();
|
|
5367
|
-
|
|
5441
|
+
const legacyCtx = {
|
|
5368
5442
|
props,
|
|
5369
5443
|
children: instance.vnode.children || [],
|
|
5370
5444
|
data: instance.vnode.props || {},
|
|
@@ -5384,7 +5458,8 @@ function convertLegacyFunctionalComponent(comp) {
|
|
|
5384
5458
|
}
|
|
5385
5459
|
return {};
|
|
5386
5460
|
}
|
|
5387
|
-
}
|
|
5461
|
+
};
|
|
5462
|
+
return legacyFn(compatH, legacyCtx);
|
|
5388
5463
|
};
|
|
5389
5464
|
Func.props = comp.props;
|
|
5390
5465
|
Func.displayName = comp.name;
|
|
@@ -5413,23 +5488,25 @@ function renderList(source, renderItem, cache, index) {
|
|
|
5413
5488
|
}
|
|
5414
5489
|
ret = new Array(source.length);
|
|
5415
5490
|
for (let i = 0, l = source.length; i < l; i++) ret[i] = renderItem(needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i], i, void 0, cached && cached[i]);
|
|
5416
|
-
} else if (typeof source === "number")
|
|
5417
|
-
|
|
5418
|
-
|
|
5419
|
-
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
else if (isObject(source)) if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
|
|
5424
|
-
else {
|
|
5425
|
-
const keys = Object.keys(source);
|
|
5426
|
-
ret = new Array(keys.length);
|
|
5427
|
-
for (let i = 0, l = keys.length; i < l; i++) {
|
|
5428
|
-
const key = keys[i];
|
|
5429
|
-
ret[i] = renderItem(source[key], key, i, cached && cached[i]);
|
|
5491
|
+
} else if (typeof source === "number") {
|
|
5492
|
+
if (!Number.isInteger(source) || source < 0) {
|
|
5493
|
+
warn$1(`The v-for range expects a positive integer value but got ${source}.`);
|
|
5494
|
+
ret = [];
|
|
5495
|
+
} else {
|
|
5496
|
+
ret = new Array(source);
|
|
5497
|
+
for (let i = 0; i < source; i++) ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
|
|
5430
5498
|
}
|
|
5431
|
-
}
|
|
5432
|
-
|
|
5499
|
+
} else if (isObject(source)) {
|
|
5500
|
+
if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
|
|
5501
|
+
else {
|
|
5502
|
+
const keys = Object.keys(source);
|
|
5503
|
+
ret = new Array(keys.length);
|
|
5504
|
+
for (let i = 0, l = keys.length; i < l; i++) {
|
|
5505
|
+
const key = keys[i];
|
|
5506
|
+
ret[i] = renderItem(source[key], key, i, cached && cached[i]);
|
|
5507
|
+
}
|
|
5508
|
+
}
|
|
5509
|
+
} else ret = [];
|
|
5433
5510
|
if (cache) cache[index] = ret;
|
|
5434
5511
|
return ret;
|
|
5435
5512
|
}
|
|
@@ -5454,14 +5531,27 @@ function createSlots(slots, dynamicSlots) {
|
|
|
5454
5531
|
//#endregion
|
|
5455
5532
|
//#region packages/runtime-core/src/helpers/renderSlot.ts
|
|
5456
5533
|
/**
|
|
5534
|
+
* Links a slot function to its raw vapor slot: a raw vapor slot carries
|
|
5535
|
+
* itself, and the wrapper the interop slots proxy hands out carries the raw
|
|
5536
|
+
* slot it wraps — one lookup answers both "is this a vapor slot" and
|
|
5537
|
+
* "which one". Internal to vapor interop.
|
|
5538
|
+
*/
|
|
5539
|
+
const rawVaporSlotKey = Symbol(`rawVaporSlot`);
|
|
5540
|
+
/**
|
|
5541
|
+
* Marks a compiler-generated slot fallback as VDOM-rendered so the vapor
|
|
5542
|
+
* interop fallback chain renders it through the VDOM renderer. Internal to
|
|
5543
|
+
* vapor interop.
|
|
5544
|
+
*/
|
|
5545
|
+
const vdomSlotFallbackKey = Symbol(`vdomSlotFallback`);
|
|
5546
|
+
/**
|
|
5457
5547
|
* Compiler runtime helper for rendering `<slot/>`
|
|
5458
5548
|
* @private
|
|
5459
5549
|
*/
|
|
5460
5550
|
function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
5461
5551
|
if (props == null) props = {};
|
|
5462
5552
|
let slot = slots[name];
|
|
5463
|
-
if (fallback) fallback
|
|
5464
|
-
const vaporSlot = slot &&
|
|
5553
|
+
if (fallback) fallback[vdomSlotFallbackKey] = true;
|
|
5554
|
+
const vaporSlot = slot && slot[rawVaporSlotKey];
|
|
5465
5555
|
if (vaporSlot) {
|
|
5466
5556
|
const ret = (openBlock(), createBlock(VaporSlot, props));
|
|
5467
5557
|
ret.vs = {
|
|
@@ -5569,12 +5659,14 @@ function legacyResolveScopedSlots(fns, raw, hasDynamicKeys) {
|
|
|
5569
5659
|
function mapKeyToName(slots) {
|
|
5570
5660
|
for (let i = 0; i < slots.length; i++) {
|
|
5571
5661
|
const fn = slots[i];
|
|
5572
|
-
if (fn)
|
|
5573
|
-
|
|
5662
|
+
if (fn) {
|
|
5663
|
+
if (isArray(fn)) mapKeyToName(fn);
|
|
5664
|
+
else fn.name = fn.key || "default";
|
|
5665
|
+
}
|
|
5574
5666
|
}
|
|
5575
5667
|
return slots;
|
|
5576
5668
|
}
|
|
5577
|
-
const staticCacheMap =
|
|
5669
|
+
const staticCacheMap = /*@__PURE__*/ new WeakMap();
|
|
5578
5670
|
function legacyRenderStatic(instance, index) {
|
|
5579
5671
|
let cache = staticCacheMap.get(instance);
|
|
5580
5672
|
if (!cache) staticCacheMap.set(instance, cache = []);
|
|
@@ -5707,11 +5799,38 @@ const getPublicInstance = (i) => {
|
|
|
5707
5799
|
if (isStatefulComponent(i)) return getComponentPublicInstance(i);
|
|
5708
5800
|
return getPublicInstance(i.parent);
|
|
5709
5801
|
};
|
|
5802
|
+
const resolveDevRootEl = (vnode) => {
|
|
5803
|
+
let found = false;
|
|
5804
|
+
while (true) {
|
|
5805
|
+
if (vnode.patchFlag > 0 && vnode.patchFlag & 2048) {
|
|
5806
|
+
const root = filterSingleRoot(vnode.children);
|
|
5807
|
+
if (!root) return;
|
|
5808
|
+
vnode = root;
|
|
5809
|
+
found = true;
|
|
5810
|
+
continue;
|
|
5811
|
+
}
|
|
5812
|
+
const component = vnode.component;
|
|
5813
|
+
if (component && component.subTree) {
|
|
5814
|
+
vnode = component.subTree;
|
|
5815
|
+
continue;
|
|
5816
|
+
}
|
|
5817
|
+
const suspense = vnode.suspense;
|
|
5818
|
+
if (suspense && suspense.activeBranch) {
|
|
5819
|
+
vnode = suspense.activeBranch;
|
|
5820
|
+
continue;
|
|
5821
|
+
}
|
|
5822
|
+
return found ? vnode.el : void 0;
|
|
5823
|
+
}
|
|
5824
|
+
};
|
|
5825
|
+
const getDevRootFragmentEl = (i) => {
|
|
5826
|
+
const el = i.subTree && resolveDevRootEl(i.subTree);
|
|
5827
|
+
return el === void 0 ? i.vnode.el : el;
|
|
5828
|
+
};
|
|
5710
5829
|
let publicPropertiesMap;
|
|
5711
5830
|
const getPublicPropertiesMap = () => {
|
|
5712
5831
|
if (!publicPropertiesMap) publicPropertiesMap = extend(Object.create(null), {
|
|
5713
5832
|
$: (i) => i,
|
|
5714
|
-
$el: (i) => i
|
|
5833
|
+
$el: (i) => getDevRootFragmentEl(i),
|
|
5715
5834
|
$data: (i) => i.data,
|
|
5716
5835
|
$props: (i) => /* @__PURE__ */ shallowReadonly(i.props),
|
|
5717
5836
|
$attrs: (i) => /* @__PURE__ */ shallowReadonly(i.attrs),
|
|
@@ -5824,7 +5943,7 @@ PublicInstanceProxyHandlers.ownKeys = (target) => {
|
|
|
5824
5943
|
warn$1("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.");
|
|
5825
5944
|
return Reflect.ownKeys(target);
|
|
5826
5945
|
};
|
|
5827
|
-
const RuntimeCompiledPublicInstanceProxyHandlers =
|
|
5946
|
+
const RuntimeCompiledPublicInstanceProxyHandlers = /*@__PURE__*/ extend({}, PublicInstanceProxyHandlers, {
|
|
5828
5947
|
get(target, key) {
|
|
5829
5948
|
if (key === Symbol.unscopables) return;
|
|
5830
5949
|
return PublicInstanceProxyHandlers.get(target, key, target);
|
|
@@ -6009,12 +6128,13 @@ function mergeDefaults(raw, defaults) {
|
|
|
6009
6128
|
for (const key in defaults) {
|
|
6010
6129
|
if (key.startsWith("__skip")) continue;
|
|
6011
6130
|
let opt = props[key];
|
|
6012
|
-
if (opt)
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
|
|
6131
|
+
if (opt) {
|
|
6132
|
+
if (isArray(opt) || isFunction(opt)) opt = props[key] = {
|
|
6133
|
+
type: opt,
|
|
6134
|
+
default: defaults[key]
|
|
6135
|
+
};
|
|
6136
|
+
else opt.default = defaults[key];
|
|
6137
|
+
} else if (opt === null) opt = props[key] = { default: defaults[key] };
|
|
6018
6138
|
else warn$1(`props default key "${key}" has no corresponding declaration.`);
|
|
6019
6139
|
if (opt && defaults[`__skip_${key}`]) opt.skipFactory = true;
|
|
6020
6140
|
}
|
|
@@ -6157,11 +6277,12 @@ function applyOptions(instance) {
|
|
|
6157
6277
|
const opt = computedOptions[key];
|
|
6158
6278
|
const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
|
|
6159
6279
|
if (get === NOOP) warn$1(`Computed property "${key}" has no getter.`);
|
|
6280
|
+
const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
|
|
6281
|
+
warn$1(`Write operation failed: computed property "${key}" is readonly.`);
|
|
6282
|
+
};
|
|
6160
6283
|
const c = computed({
|
|
6161
6284
|
get,
|
|
6162
|
-
set
|
|
6163
|
-
warn$1(`Write operation failed: computed property "${key}" is readonly.`);
|
|
6164
|
-
}
|
|
6285
|
+
set
|
|
6165
6286
|
});
|
|
6166
6287
|
Object.defineProperty(ctx, key, {
|
|
6167
6288
|
enumerable: true,
|
|
@@ -6220,9 +6341,10 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP)
|
|
|
6220
6341
|
for (const key in injectOptions) {
|
|
6221
6342
|
const opt = injectOptions[key];
|
|
6222
6343
|
let injected;
|
|
6223
|
-
if (isObject(opt))
|
|
6224
|
-
|
|
6225
|
-
|
|
6344
|
+
if (isObject(opt)) {
|
|
6345
|
+
if ("default" in opt) injected = inject(opt.from || key, opt.default, true);
|
|
6346
|
+
else injected = inject(opt.from || key);
|
|
6347
|
+
} else injected = inject(opt);
|
|
6226
6348
|
if (/* @__PURE__ */ isRef(injected)) Object.defineProperty(ctx, key, {
|
|
6227
6349
|
enumerable: true,
|
|
6228
6350
|
configurable: true,
|
|
@@ -6242,7 +6364,8 @@ function createWatcher(raw, ctx, publicThis, key) {
|
|
|
6242
6364
|
{
|
|
6243
6365
|
const cur = getCurrentInstance();
|
|
6244
6366
|
const instance = cur && getCurrentScope() === cur.scope ? cur : null;
|
|
6245
|
-
|
|
6367
|
+
const newValue = getter();
|
|
6368
|
+
if (isArray(newValue) && isCompatEnabled$1("WATCH_ARRAY", instance)) options.deep = true;
|
|
6246
6369
|
const baseGetter = getter;
|
|
6247
6370
|
getter = () => {
|
|
6248
6371
|
const val = baseGetter();
|
|
@@ -6255,13 +6378,14 @@ function createWatcher(raw, ctx, publicThis, key) {
|
|
|
6255
6378
|
if (isFunction(handler)) watch(getter, handler, options);
|
|
6256
6379
|
else warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
|
|
6257
6380
|
} else if (isFunction(raw)) watch(getter, raw.bind(publicThis), options);
|
|
6258
|
-
else if (isObject(raw))
|
|
6259
|
-
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6381
|
+
else if (isObject(raw)) {
|
|
6382
|
+
if (isArray(raw)) raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
|
|
6383
|
+
else {
|
|
6384
|
+
const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
|
|
6385
|
+
if (isFunction(handler)) watch(getter, handler, extend(raw, options));
|
|
6386
|
+
else warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
|
|
6387
|
+
}
|
|
6388
|
+
} else warn$1(`Invalid watch option: "${key}"`, raw);
|
|
6265
6389
|
}
|
|
6266
6390
|
/**
|
|
6267
6391
|
* Resolve merged options and cache it on the component.
|
|
@@ -6275,12 +6399,13 @@ function resolveMergedOptions(instance) {
|
|
|
6275
6399
|
const cached = cache.get(base);
|
|
6276
6400
|
let resolved;
|
|
6277
6401
|
if (cached) resolved = cached;
|
|
6278
|
-
else if (!globalMixins.length && !mixins && !extendsOptions)
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
|
|
6282
|
-
|
|
6283
|
-
|
|
6402
|
+
else if (!globalMixins.length && !mixins && !extendsOptions) {
|
|
6403
|
+
if (isCompatEnabled$1("PRIVATE_APIS", instance)) {
|
|
6404
|
+
resolved = extend({}, base);
|
|
6405
|
+
resolved.parent = instance.parent && instance.parent.proxy;
|
|
6406
|
+
resolved.propsData = instance.vnode.props;
|
|
6407
|
+
} else resolved = base;
|
|
6408
|
+
} else {
|
|
6284
6409
|
resolved = {};
|
|
6285
6410
|
if (globalMixins.length) globalMixins.forEach((m) => mergeOptions(resolved, m, optionMergeStrategies, true));
|
|
6286
6411
|
mergeOptions(resolved, base, optionMergeStrategies);
|
|
@@ -6353,7 +6478,7 @@ function mergeObjectOptions(to, from) {
|
|
|
6353
6478
|
}
|
|
6354
6479
|
function mergeEmitsOrPropsOptions(to, from) {
|
|
6355
6480
|
if (to) {
|
|
6356
|
-
if (isArray(to) && isArray(from)) return [
|
|
6481
|
+
if (isArray(to) && isArray(from)) return [.../* @__PURE__ */ new Set([...to, ...from])];
|
|
6357
6482
|
return extend(Object.create(null), normalizePropsOrEmits(to), normalizePropsOrEmits(from !== null && from !== void 0 ? from : {}));
|
|
6358
6483
|
} else return from;
|
|
6359
6484
|
}
|
|
@@ -6414,7 +6539,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
6414
6539
|
if (options.el) return vm.$mount(options.el);
|
|
6415
6540
|
else return vm;
|
|
6416
6541
|
}
|
|
6417
|
-
Vue.version = `2.6.14-compat:3.6.0-rc.
|
|
6542
|
+
Vue.version = `2.6.14-compat:3.6.0-rc.7`;
|
|
6418
6543
|
Vue.config = singletonApp.config;
|
|
6419
6544
|
Vue.use = (plugin, ...options) => {
|
|
6420
6545
|
if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
|
|
@@ -6804,8 +6929,10 @@ function createAppAPI(mount, unmount, getPublicInstance, render) {
|
|
|
6804
6929
|
} else warn$1(`Cannot unmount an app that is not mounted.`);
|
|
6805
6930
|
},
|
|
6806
6931
|
provide(key, value) {
|
|
6807
|
-
if (key in context.provides)
|
|
6808
|
-
|
|
6932
|
+
if (key in context.provides) {
|
|
6933
|
+
if (hasOwn(context.provides, key)) warn$1(`App already provides property with key "${String(key)}". It will be overwritten with the new value.`);
|
|
6934
|
+
else warn$1(`App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`);
|
|
6935
|
+
}
|
|
6809
6936
|
context.provides[key] = value;
|
|
6810
6937
|
return app;
|
|
6811
6938
|
},
|
|
@@ -6955,12 +7082,14 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
|
|
|
6955
7082
|
if (instance.isUnmounted) return;
|
|
6956
7083
|
{
|
|
6957
7084
|
const { emitsOptions, propsOptions } = instance;
|
|
6958
|
-
if (emitsOptions)
|
|
6959
|
-
if (!
|
|
6960
|
-
|
|
6961
|
-
|
|
6962
|
-
|
|
6963
|
-
if (
|
|
7085
|
+
if (emitsOptions) {
|
|
7086
|
+
if (!(event in emitsOptions) && !(event.startsWith("hook:") || event.startsWith(compatModelEventPrefix))) {
|
|
7087
|
+
if (!propsOptions || !propsOptions[0] || !(toHandlerKey(camelize(event)) in propsOptions[0])) warn$1(`Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.`);
|
|
7088
|
+
} else {
|
|
7089
|
+
const validator = emitsOptions[event];
|
|
7090
|
+
if (isFunction(validator)) {
|
|
7091
|
+
if (!validator(...rawArgs)) warn$1(`Invalid event arguments: event validation failed for event "${event}".`);
|
|
7092
|
+
}
|
|
6964
7093
|
}
|
|
6965
7094
|
}
|
|
6966
7095
|
}
|
|
@@ -6970,7 +7099,7 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
|
|
|
6970
7099
|
const modifiers = isCompatModelListener ? props.modelModifiers : isModelListener && getModelModifiers(props, event.slice(7), getter);
|
|
6971
7100
|
if (modifiers) {
|
|
6972
7101
|
if (modifiers.trim) args = rawArgs.map((a) => isString(a) ? a.trim() : a);
|
|
6973
|
-
if (modifiers.number) args =
|
|
7102
|
+
if (modifiers.number) args = args.map(looseToNumber);
|
|
6974
7103
|
}
|
|
6975
7104
|
devtoolsComponentEmit(instance, event, args);
|
|
6976
7105
|
{
|
|
@@ -7165,10 +7294,12 @@ function filterSingleRoot(children, recurse = true) {
|
|
|
7165
7294
|
for (let i = 0; i < children.length; i++) {
|
|
7166
7295
|
const child = children[i];
|
|
7167
7296
|
if (isVNode(child)) {
|
|
7168
|
-
if (child.type !== Comment || child.children === "v-if")
|
|
7169
|
-
|
|
7170
|
-
|
|
7171
|
-
|
|
7297
|
+
if (child.type !== Comment || child.children === "v-if") {
|
|
7298
|
+
if (singleRoot) return;
|
|
7299
|
+
else {
|
|
7300
|
+
singleRoot = child;
|
|
7301
|
+
if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) return filterSingleRoot(singleRoot.children);
|
|
7302
|
+
}
|
|
7172
7303
|
}
|
|
7173
7304
|
} else return;
|
|
7174
7305
|
}
|
|
@@ -7313,16 +7444,17 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
7313
7444
|
let key = propsToUpdate[i];
|
|
7314
7445
|
if (isEmitListener(instance.emitsOptions, key)) continue;
|
|
7315
7446
|
const value = rawProps[key];
|
|
7316
|
-
if (options)
|
|
7317
|
-
if (
|
|
7318
|
-
attrs[key]
|
|
7319
|
-
|
|
7447
|
+
if (options) {
|
|
7448
|
+
if (hasOwn(attrs, key)) {
|
|
7449
|
+
if (value !== attrs[key]) {
|
|
7450
|
+
attrs[key] = value;
|
|
7451
|
+
hasAttrsChanged = true;
|
|
7452
|
+
}
|
|
7453
|
+
} else {
|
|
7454
|
+
const camelizedKey = camelize(key);
|
|
7455
|
+
props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
|
|
7320
7456
|
}
|
|
7321
7457
|
} else {
|
|
7322
|
-
const camelizedKey = camelize(key);
|
|
7323
|
-
props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
|
|
7324
|
-
}
|
|
7325
|
-
else {
|
|
7326
7458
|
if (isOn(key) && key.endsWith("Native")) key = key.slice(0, -6);
|
|
7327
7459
|
else if (shouldSkipAttr(key, instance)) continue;
|
|
7328
7460
|
if (value !== attrs[key]) {
|
|
@@ -7335,9 +7467,11 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
7335
7467
|
} else {
|
|
7336
7468
|
if (setFullProps(instance, rawProps, props, attrs)) hasAttrsChanged = true;
|
|
7337
7469
|
let kebabKey;
|
|
7338
|
-
for (const key in rawCurrentProps) if (!rawProps || !hasOwn(rawProps, key) && ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey)))
|
|
7339
|
-
if (
|
|
7340
|
-
|
|
7470
|
+
for (const key in rawCurrentProps) if (!rawProps || !hasOwn(rawProps, key) && ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
|
|
7471
|
+
if (options) {
|
|
7472
|
+
if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) props[key] = resolvePropValue(options, key, void 0, instance, baseResolveDefault, true);
|
|
7473
|
+
} else delete props[key];
|
|
7474
|
+
}
|
|
7341
7475
|
if (attrs !== rawCurrentProps) {
|
|
7342
7476
|
for (const key in attrs) if (!rawProps || !hasOwn(rawProps, key) && !hasOwn(rawProps, key + "Native")) {
|
|
7343
7477
|
delete attrs[key];
|
|
@@ -7358,9 +7492,10 @@ function setFullProps(instance, rawProps, props, attrs) {
|
|
|
7358
7492
|
if (key === "inline-template") continue;
|
|
7359
7493
|
const value = rawProps[key];
|
|
7360
7494
|
let camelKey;
|
|
7361
|
-
if (options && hasOwn(options, camelKey = camelize(key)))
|
|
7362
|
-
|
|
7363
|
-
|
|
7495
|
+
if (options && hasOwn(options, camelKey = camelize(key))) {
|
|
7496
|
+
if (!needCastKeys || !needCastKeys.includes(camelKey)) props[camelKey] = value;
|
|
7497
|
+
else (rawCastValues || (rawCastValues = {}))[camelKey] = value;
|
|
7498
|
+
} else if (!isEmitListener(instance.emitsOptions, key)) {
|
|
7364
7499
|
if (isOn(key) && key.endsWith("Native")) key = key.slice(0, -6);
|
|
7365
7500
|
else if (shouldSkipAttr(key, instance)) continue;
|
|
7366
7501
|
if (!(key in attrs) || value !== attrs[key]) {
|
|
@@ -7526,7 +7661,7 @@ function validateProp(key, value, propOptions, resolvedProps, isAbsent) {
|
|
|
7526
7661
|
}
|
|
7527
7662
|
if (validator && !validator(value, /* @__PURE__ */ shallowReadonly(resolvedProps))) warn$1("Invalid prop: custom validator check failed for prop \"" + key + "\".");
|
|
7528
7663
|
}
|
|
7529
|
-
const isSimpleType =
|
|
7664
|
+
const isSimpleType = /*@__PURE__*/ makeMap("String,Number,Boolean,Function,Symbol,BigInt");
|
|
7530
7665
|
/**
|
|
7531
7666
|
* dev only
|
|
7532
7667
|
*/
|
|
@@ -7639,12 +7774,13 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
7639
7774
|
let deletionComparisonTarget = EMPTY_OBJ;
|
|
7640
7775
|
if (vnode.shapeFlag & 32) {
|
|
7641
7776
|
const type = children._;
|
|
7642
|
-
if (type)
|
|
7643
|
-
|
|
7644
|
-
|
|
7645
|
-
|
|
7646
|
-
|
|
7647
|
-
|
|
7777
|
+
if (type) {
|
|
7778
|
+
if (isHmrUpdating) {
|
|
7779
|
+
assignSlots(slots, children, optimized);
|
|
7780
|
+
trigger(instance, "set", "$slots");
|
|
7781
|
+
} else if (optimized && type === 1) needDeletionCheck = false;
|
|
7782
|
+
else assignSlots(slots, children, optimized);
|
|
7783
|
+
} else {
|
|
7648
7784
|
needDeletionCheck = !children.$stable;
|
|
7649
7785
|
normalizeObjectSlots(children, slots, instance);
|
|
7650
7786
|
}
|
|
@@ -7662,7 +7798,7 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
7662
7798
|
let supported;
|
|
7663
7799
|
let perf;
|
|
7664
7800
|
let cachedNow$1 = 0;
|
|
7665
|
-
const p$1 =
|
|
7801
|
+
const p$1 = /*@__PURE__*/ Promise.resolve();
|
|
7666
7802
|
const getNow$1 = () => cachedNow$1 || (p$1.then(() => cachedNow$1 = 0), cachedNow$1 = isSupported() ? perf.now() : Date.now());
|
|
7667
7803
|
/**
|
|
7668
7804
|
* @internal
|
|
@@ -7878,7 +8014,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7878
8014
|
for (let i = 0; i < inheritedScopeIds.length; i++) hostSetScopeId(el, inheritedScopeIds[i]);
|
|
7879
8015
|
};
|
|
7880
8016
|
const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
|
|
7881
|
-
for (let i = start; i < children.length; i++)
|
|
8017
|
+
for (let i = start; i < children.length; i++) {
|
|
8018
|
+
const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
|
|
8019
|
+
patch(null, child, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
8020
|
+
}
|
|
7882
8021
|
};
|
|
7883
8022
|
const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
7884
8023
|
const el = n2.el = n1.el;
|
|
@@ -7890,6 +8029,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7890
8029
|
let vnodeHook;
|
|
7891
8030
|
parentComponent && toggleRecurse(parentComponent, false);
|
|
7892
8031
|
if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
8032
|
+
if (n2.ibu) n2.ibu();
|
|
7893
8033
|
if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
7894
8034
|
parentComponent && toggleRecurse(parentComponent, true);
|
|
7895
8035
|
if (isHmrUpdating || dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
|
|
@@ -7923,8 +8063,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7923
8063
|
if (n1.children !== n2.children) hostSetElementText(el, n2.children);
|
|
7924
8064
|
}
|
|
7925
8065
|
} else if (!optimized && dynamicChildren == null) patchProps(el, oldProps, newProps, parentComponent, namespace);
|
|
7926
|
-
if ((vnodeHook = newProps.onVnodeUpdated) || dirs) queuePostRenderEffect(() => {
|
|
8066
|
+
if ((vnodeHook = newProps.onVnodeUpdated) || dirs || n2.iu) queuePostRenderEffect(() => {
|
|
7927
8067
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
8068
|
+
n2.iu && n2.iu();
|
|
7928
8069
|
dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
7929
8070
|
}, void 0, parentSuspense);
|
|
7930
8071
|
};
|
|
@@ -7932,7 +8073,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7932
8073
|
for (let i = 0; i < newChildren.length; i++) {
|
|
7933
8074
|
const oldVNode = oldChildren[i];
|
|
7934
8075
|
const newVNode = newChildren[i];
|
|
7935
|
-
|
|
8076
|
+
const container = oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer;
|
|
8077
|
+
patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
|
|
7936
8078
|
}
|
|
7937
8079
|
};
|
|
7938
8080
|
const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
|
|
@@ -7970,41 +8112,46 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7970
8112
|
};
|
|
7971
8113
|
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
7972
8114
|
n2.slotScopeIds = slotScopeIds;
|
|
7973
|
-
if (n2.type.__vapor)
|
|
7974
|
-
|
|
7975
|
-
|
|
7976
|
-
|
|
7977
|
-
|
|
7978
|
-
|
|
7979
|
-
|
|
8115
|
+
if (n2.type.__vapor) {
|
|
8116
|
+
if (n1 == null) {
|
|
8117
|
+
if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
|
|
8118
|
+
else {
|
|
8119
|
+
const vnodeBeforeMountHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeBeforeMount;
|
|
8120
|
+
getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense, () => {
|
|
8121
|
+
if (n2.dirs) {
|
|
8122
|
+
invokeDirectiveHook(n2, null, parentComponent, "created");
|
|
8123
|
+
invokeDirectiveHook(n2, null, parentComponent, "beforeMount");
|
|
8124
|
+
}
|
|
8125
|
+
}, () => {
|
|
8126
|
+
if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, n2);
|
|
8127
|
+
});
|
|
8128
|
+
if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, null, parentComponent, "mounted"), void 0, parentSuspense);
|
|
8129
|
+
const vnodeMountedHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeMounted;
|
|
8130
|
+
if (vnodeMountedHook) {
|
|
8131
|
+
const scopedVNode = n2;
|
|
8132
|
+
queuePostRenderEffect(() => invokeVNodeHook(vnodeMountedHook, parentComponent, scopedVNode), void 0, parentSuspense);
|
|
8133
|
+
}
|
|
7980
8134
|
}
|
|
7981
|
-
}
|
|
7982
|
-
|
|
7983
|
-
|
|
7984
|
-
|
|
7985
|
-
|
|
7986
|
-
|
|
7987
|
-
|
|
7988
|
-
|
|
8135
|
+
} else {
|
|
8136
|
+
const shouldUpdate = shouldUpdateComponent(n1, n2, optimized);
|
|
8137
|
+
getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdate, () => {
|
|
8138
|
+
if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
8139
|
+
}, () => {
|
|
8140
|
+
const vnodeBeforeUpdateHook = n2.props && n2.props.onVnodeBeforeUpdate;
|
|
8141
|
+
if (vnodeBeforeUpdateHook) invokeVNodeHook(vnodeBeforeUpdateHook, parentComponent, n2, n1);
|
|
8142
|
+
if (n2.ibu) n2.ibu();
|
|
8143
|
+
});
|
|
8144
|
+
const vnodeUpdatedHook = n2.props && n2.props.onVnodeUpdated;
|
|
8145
|
+
if (shouldUpdate && (vnodeUpdatedHook || n2.dirs || n2.iu)) queuePostRenderEffect(() => {
|
|
8146
|
+
n2.dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
8147
|
+
vnodeUpdatedHook && invokeVNodeHook(vnodeUpdatedHook, parentComponent, n2, n1);
|
|
8148
|
+
n2.iu && n2.iu();
|
|
8149
|
+
}, void 0, parentSuspense);
|
|
7989
8150
|
}
|
|
7990
|
-
}
|
|
7991
|
-
|
|
7992
|
-
|
|
7993
|
-
|
|
7994
|
-
if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
7995
|
-
}, () => {
|
|
7996
|
-
const vnodeBeforeUpdateHook = n2.props && n2.props.onVnodeBeforeUpdate;
|
|
7997
|
-
if (vnodeBeforeUpdateHook) invokeVNodeHook(vnodeBeforeUpdateHook, parentComponent, n2, n1);
|
|
7998
|
-
});
|
|
7999
|
-
const vnodeUpdatedHook = n2.props && n2.props.onVnodeUpdated;
|
|
8000
|
-
if (shouldUpdate && (vnodeUpdatedHook || n2.dirs)) queuePostRenderEffect(() => {
|
|
8001
|
-
n2.dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
8002
|
-
vnodeUpdatedHook && invokeVNodeHook(vnodeUpdatedHook, parentComponent, n2, n1);
|
|
8003
|
-
}, void 0, parentSuspense);
|
|
8004
|
-
}
|
|
8005
|
-
else if (n1 == null) if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
8006
|
-
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
8007
|
-
else updateComponent(n1, n2, optimized);
|
|
8151
|
+
} else if (n1 == null) {
|
|
8152
|
+
if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
8153
|
+
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
8154
|
+
} else updateComponent(n1, n2, optimized);
|
|
8008
8155
|
};
|
|
8009
8156
|
const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
|
|
8010
8157
|
const compatMountInstance = initialVNode.isCompatRoot && initialVNode.component;
|
|
@@ -8048,16 +8195,17 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8048
8195
|
};
|
|
8049
8196
|
const updateComponent = (n1, n2, optimized) => {
|
|
8050
8197
|
const instance = n2.component = n1.component;
|
|
8051
|
-
if (shouldUpdateComponent(n1, n2, optimized))
|
|
8052
|
-
|
|
8053
|
-
|
|
8054
|
-
|
|
8055
|
-
|
|
8198
|
+
if (shouldUpdateComponent(n1, n2, optimized)) {
|
|
8199
|
+
if (instance.asyncDep && !instance.asyncResolved) {
|
|
8200
|
+
pushWarningContext(n2);
|
|
8201
|
+
updateComponentPreRender(instance, n2, optimized);
|
|
8202
|
+
popWarningContext();
|
|
8203
|
+
return;
|
|
8204
|
+
} else {
|
|
8205
|
+
instance.next = n2;
|
|
8206
|
+
instance.effect.run();
|
|
8207
|
+
}
|
|
8056
8208
|
} else {
|
|
8057
|
-
instance.next = n2;
|
|
8058
|
-
instance.effect.run();
|
|
8059
|
-
}
|
|
8060
|
-
else {
|
|
8061
8209
|
n2.el = n1.el;
|
|
8062
8210
|
instance.vnode = n2;
|
|
8063
8211
|
}
|
|
@@ -8160,6 +8308,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8160
8308
|
} else next = vnode;
|
|
8161
8309
|
if (bu) invokeArrayFns(bu);
|
|
8162
8310
|
if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
8311
|
+
if (next.ibu) next.ibu();
|
|
8163
8312
|
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) instance.emit("hook:beforeUpdate");
|
|
8164
8313
|
toggleRecurse(instance, true);
|
|
8165
8314
|
startMeasure(instance, `render`);
|
|
@@ -8173,7 +8322,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8173
8322
|
next.el = nextTree.el;
|
|
8174
8323
|
if (originNext === null) updateHOCHostEl(instance, nextTree.el);
|
|
8175
8324
|
if (u) queuePostRenderEffect(u, void 0, parentSuspense);
|
|
8176
|
-
if (vnodeHook = next.props && next.props.onVnodeUpdated) queuePostRenderEffect(() =>
|
|
8325
|
+
if ((vnodeHook = next.props && next.props.onVnodeUpdated) || next.iu) queuePostRenderEffect(() => {
|
|
8326
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
8327
|
+
next.iu && next.iu();
|
|
8328
|
+
}, void 0, parentSuspense);
|
|
8177
8329
|
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) queuePostRenderEffect(() => instance.emit("hook:updated"), void 0, parentSuspense);
|
|
8178
8330
|
devtoolsComponentUpdated(instance);
|
|
8179
8331
|
popWarningContext();
|
|
@@ -8214,9 +8366,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8214
8366
|
if (shapeFlag & 8) {
|
|
8215
8367
|
if (prevShapeFlag & 16) unmountChildren(c1, parentComponent, parentSuspense);
|
|
8216
8368
|
if (c2 !== c1) hostSetElementText(container, c2);
|
|
8217
|
-
} else if (prevShapeFlag & 16)
|
|
8218
|
-
|
|
8219
|
-
|
|
8369
|
+
} else if (prevShapeFlag & 16) {
|
|
8370
|
+
if (shapeFlag & 16) patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
8371
|
+
else unmountChildren(c1, parentComponent, parentSuspense, true);
|
|
8372
|
+
} else {
|
|
8220
8373
|
if (prevShapeFlag & 8) hostSetElementText(container, "");
|
|
8221
8374
|
if (shapeFlag & 16) mountChildren(c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
8222
8375
|
}
|
|
@@ -8315,8 +8468,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8315
8468
|
const anchorVNode = c2[nextIndex + 1];
|
|
8316
8469
|
const anchor = nextIndex + 1 < l2 ? anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode) : parentAnchor;
|
|
8317
8470
|
if (newIndexToOldIndexMap[i] === 0) patch(null, nextChild, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
8318
|
-
else if (moved)
|
|
8319
|
-
|
|
8471
|
+
else if (moved) {
|
|
8472
|
+
if (j < 0 || i !== increasingNewIndexSequence[j]) move(nextChild, container, anchor, 2, parentComponent);
|
|
8473
|
+
else j--;
|
|
8474
|
+
}
|
|
8320
8475
|
}
|
|
8321
8476
|
}
|
|
8322
8477
|
};
|
|
@@ -8348,26 +8503,13 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8348
8503
|
moveStaticNode(vnode, container, anchor);
|
|
8349
8504
|
return;
|
|
8350
8505
|
}
|
|
8351
|
-
if (moveType !== 2 && shapeFlag & 1 && transition)
|
|
8352
|
-
|
|
8353
|
-
|
|
8354
|
-
const remove = () => {
|
|
8506
|
+
if (moveType !== 2 && shapeFlag & 1 && transition) {
|
|
8507
|
+
if (moveType === 0) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense, true);
|
|
8508
|
+
else performTransitionLeave(el, transition, () => {
|
|
8355
8509
|
if (vnode.ctx.isUnmounted) hostRemove(el);
|
|
8356
8510
|
else hostInsert(el, container, anchor);
|
|
8357
|
-
};
|
|
8358
|
-
|
|
8359
|
-
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
8360
|
-
if (el._isLeaving) el[leaveCbKey](true);
|
|
8361
|
-
if (transition.persisted && !wasLeaving) remove();
|
|
8362
|
-
else leave(el, () => {
|
|
8363
|
-
remove();
|
|
8364
|
-
afterLeave && afterLeave();
|
|
8365
|
-
});
|
|
8366
|
-
};
|
|
8367
|
-
if (delayLeave) delayLeave(el, remove, performLeave);
|
|
8368
|
-
else performLeave();
|
|
8369
|
-
}
|
|
8370
|
-
else hostInsert(el, container, anchor);
|
|
8511
|
+
}, true, true);
|
|
8512
|
+
} else hostInsert(el, container, anchor);
|
|
8371
8513
|
};
|
|
8372
8514
|
const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
|
|
8373
8515
|
const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
|
|
@@ -8387,16 +8529,17 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8387
8529
|
const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
|
|
8388
8530
|
let vnodeHook;
|
|
8389
8531
|
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
8390
|
-
if (shapeFlag & 6)
|
|
8391
|
-
if (
|
|
8392
|
-
|
|
8393
|
-
|
|
8394
|
-
|
|
8395
|
-
|
|
8396
|
-
|
|
8397
|
-
|
|
8398
|
-
|
|
8399
|
-
|
|
8532
|
+
if (shapeFlag & 6) {
|
|
8533
|
+
if (isVaporComponent(type)) {
|
|
8534
|
+
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
|
|
8535
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
8536
|
+
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || dirs) queuePostRenderEffect(() => {
|
|
8537
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
8538
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
8539
|
+
}, void 0, parentSuspense);
|
|
8540
|
+
return;
|
|
8541
|
+
} else unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
8542
|
+
} else {
|
|
8400
8543
|
if (shapeFlag & 128) {
|
|
8401
8544
|
vnode.suspense.unmount(parentSuspense, doRemove);
|
|
8402
8545
|
return;
|
|
@@ -8530,12 +8673,14 @@ function resolveChildrenNamespace({ type, props }, currentNamespace) {
|
|
|
8530
8673
|
return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
|
|
8531
8674
|
}
|
|
8532
8675
|
function toggleRecurse({ effect, job, vapor }, allowed) {
|
|
8533
|
-
if (!vapor)
|
|
8534
|
-
|
|
8535
|
-
|
|
8536
|
-
|
|
8537
|
-
|
|
8538
|
-
|
|
8676
|
+
if (!vapor) {
|
|
8677
|
+
if (allowed) {
|
|
8678
|
+
effect.flags |= 128;
|
|
8679
|
+
job.flags |= 2;
|
|
8680
|
+
} else {
|
|
8681
|
+
effect.flags &= -129;
|
|
8682
|
+
job.flags &= -3;
|
|
8683
|
+
}
|
|
8539
8684
|
}
|
|
8540
8685
|
}
|
|
8541
8686
|
function needTransition(parentSuspense, transition) {
|
|
@@ -8575,8 +8720,10 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
8575
8720
|
}
|
|
8576
8721
|
function locateNonHydratedAsyncRoot(instance) {
|
|
8577
8722
|
const subComponent = instance.subTree && instance.subTree.component;
|
|
8578
|
-
if (subComponent)
|
|
8579
|
-
|
|
8723
|
+
if (subComponent) {
|
|
8724
|
+
if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
|
|
8725
|
+
else return locateNonHydratedAsyncRoot(subComponent);
|
|
8726
|
+
}
|
|
8580
8727
|
}
|
|
8581
8728
|
function invalidateMount(hooks) {
|
|
8582
8729
|
if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
|
|
@@ -8595,13 +8742,15 @@ function performTransitionEnter(el, transition, insert, parentSuspense, force =
|
|
|
8595
8742
|
function performTransitionLeave(el, transition, remove, isElement = true, force = false) {
|
|
8596
8743
|
const performRemove = () => {
|
|
8597
8744
|
remove();
|
|
8598
|
-
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
8745
|
+
if (transition && (force || !transition.persisted) && transition.afterLeave) transition.afterLeave();
|
|
8599
8746
|
};
|
|
8600
8747
|
if (force || isElement && transition && !transition.persisted) {
|
|
8601
8748
|
const { leave, delayLeave } = transition;
|
|
8602
8749
|
const performLeave = () => {
|
|
8750
|
+
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
8603
8751
|
if (el._isLeaving && force) el[leaveCbKey](true);
|
|
8604
|
-
|
|
8752
|
+
if (force && transition.persisted && !wasLeaving) remove();
|
|
8753
|
+
else leave(el, performRemove);
|
|
8605
8754
|
};
|
|
8606
8755
|
if (delayLeave) delayLeave(el, performRemove, performLeave);
|
|
8607
8756
|
else performLeave();
|
|
@@ -8697,7 +8846,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
8697
8846
|
patch(pendingBranch, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
8698
8847
|
if (suspense.deps <= 0) suspense.resolve();
|
|
8699
8848
|
else if (isInFallback) {
|
|
8700
|
-
if (!isHydrating) {
|
|
8849
|
+
if (!isHydrating && !suspense.isFallbackMountPending) {
|
|
8701
8850
|
patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
8702
8851
|
setActiveBranch(suspense, newFallback);
|
|
8703
8852
|
}
|
|
@@ -8718,7 +8867,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
8718
8867
|
if (isInFallback) {
|
|
8719
8868
|
patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
8720
8869
|
if (suspense.deps <= 0) suspense.resolve();
|
|
8721
|
-
else {
|
|
8870
|
+
else if (!suspense.isFallbackMountPending) {
|
|
8722
8871
|
patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
8723
8872
|
setActiveBranch(suspense, newFallback);
|
|
8724
8873
|
}
|
|
@@ -8844,8 +8993,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
8844
8993
|
const mountFallback = () => {
|
|
8845
8994
|
suspense.isFallbackMountPending = false;
|
|
8846
8995
|
if (!suspense.isInFallback) return;
|
|
8847
|
-
|
|
8848
|
-
|
|
8996
|
+
const latestFallback = suspense.vnode.ssFallback;
|
|
8997
|
+
patch(null, latestFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
8998
|
+
setActiveBranch(suspense, latestFallback);
|
|
8849
8999
|
};
|
|
8850
9000
|
const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
|
|
8851
9001
|
if (delayEnter) {
|
|
@@ -8921,9 +9071,10 @@ function normalizeSuspenseSlot(s) {
|
|
|
8921
9071
|
return s;
|
|
8922
9072
|
}
|
|
8923
9073
|
function queueEffectWithSuspense(fn, id, suspense) {
|
|
8924
|
-
if (suspense && suspense.pendingBranch)
|
|
8925
|
-
|
|
8926
|
-
|
|
9074
|
+
if (suspense && suspense.pendingBranch) {
|
|
9075
|
+
if (isArray(fn)) suspense.effects.push(...fn);
|
|
9076
|
+
else suspense.effects.push(fn);
|
|
9077
|
+
} else queuePostFlushCb(fn, id);
|
|
8927
9078
|
}
|
|
8928
9079
|
function setActiveBranch(suspense, branch) {
|
|
8929
9080
|
suspense.activeBranch = branch;
|
|
@@ -9159,8 +9310,10 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
9159
9310
|
if (isVNode(type)) {
|
|
9160
9311
|
const cloned = cloneVNode(type, props, true);
|
|
9161
9312
|
if (children) normalizeChildren(cloned, children);
|
|
9162
|
-
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock)
|
|
9163
|
-
|
|
9313
|
+
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
|
|
9314
|
+
if (cloned.shapeFlag & 6) currentBlock[currentBlock.indexOf(type)] = cloned;
|
|
9315
|
+
else currentBlock.push(cloned);
|
|
9316
|
+
}
|
|
9164
9317
|
cloned.patchFlag = -2;
|
|
9165
9318
|
return cloned;
|
|
9166
9319
|
}
|
|
@@ -9221,7 +9374,9 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
9221
9374
|
ce: vnode.ce,
|
|
9222
9375
|
vi: vnode.vi,
|
|
9223
9376
|
vs: cloneVaporSlotMeta(vnode),
|
|
9224
|
-
vb: vnode.vb
|
|
9377
|
+
vb: vnode.vb,
|
|
9378
|
+
ibu: vnode.ibu,
|
|
9379
|
+
iu: vnode.iu
|
|
9225
9380
|
};
|
|
9226
9381
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
9227
9382
|
defineLegacyVNodeProperties(cloned);
|
|
@@ -9285,25 +9440,28 @@ function normalizeChildren(vnode, children) {
|
|
|
9285
9440
|
const { shapeFlag } = vnode;
|
|
9286
9441
|
if (children == null) children = null;
|
|
9287
9442
|
else if (isArray(children)) type = 16;
|
|
9288
|
-
else if (typeof children === "object")
|
|
9289
|
-
|
|
9290
|
-
|
|
9291
|
-
|
|
9292
|
-
|
|
9293
|
-
|
|
9294
|
-
|
|
9295
|
-
|
|
9296
|
-
|
|
9297
|
-
|
|
9298
|
-
|
|
9299
|
-
|
|
9300
|
-
|
|
9301
|
-
|
|
9302
|
-
|
|
9303
|
-
|
|
9443
|
+
else if (typeof children === "object") {
|
|
9444
|
+
if (shapeFlag & 65) {
|
|
9445
|
+
const slot = children.default;
|
|
9446
|
+
if (slot) {
|
|
9447
|
+
slot._c && (slot._d = false);
|
|
9448
|
+
normalizeChildren(vnode, slot());
|
|
9449
|
+
slot._c && (slot._d = true);
|
|
9450
|
+
}
|
|
9451
|
+
return;
|
|
9452
|
+
} else {
|
|
9453
|
+
type = 32;
|
|
9454
|
+
const slotFlag = children._;
|
|
9455
|
+
if (!slotFlag && !isInternalObject(children)) children._ctx = currentRenderingInstance;
|
|
9456
|
+
else if (slotFlag === 3 && currentRenderingInstance) {
|
|
9457
|
+
if (currentRenderingInstance.slots._ === 1) children._ = 1;
|
|
9458
|
+
else {
|
|
9459
|
+
children._ = 2;
|
|
9460
|
+
vnode.patchFlag |= 1024;
|
|
9461
|
+
}
|
|
9462
|
+
}
|
|
9304
9463
|
}
|
|
9305
|
-
}
|
|
9306
|
-
else if (isFunction(children)) {
|
|
9464
|
+
} else if (isFunction(children)) {
|
|
9307
9465
|
if (shapeFlag & 65) {
|
|
9308
9466
|
normalizeChildren(vnode, { default: children });
|
|
9309
9467
|
return;
|
|
@@ -9412,7 +9570,7 @@ const useInstanceOption = (key, silent = false) => {
|
|
|
9412
9570
|
};
|
|
9413
9571
|
//#endregion
|
|
9414
9572
|
//#region packages/runtime-core/src/component.ts
|
|
9415
|
-
const emptyAppContext =
|
|
9573
|
+
const emptyAppContext = /*@__PURE__*/ createAppContext();
|
|
9416
9574
|
let uid = 0;
|
|
9417
9575
|
function createComponentInstance(vnode, parent, suspense) {
|
|
9418
9576
|
const type = vnode.type;
|
|
@@ -9613,10 +9771,12 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
9613
9771
|
restoreCurrentInstance(prevInstance);
|
|
9614
9772
|
}
|
|
9615
9773
|
}
|
|
9616
|
-
if (!Component.render && instance.render === NOOP && !isSSR)
|
|
9774
|
+
if (!Component.render && instance.render === NOOP && !isSSR) {
|
|
9775
|
+
if (!compile$1 && Component.template)
|
|
9617
9776
|
/* v8 ignore start */
|
|
9618
|
-
|
|
9619
|
-
|
|
9777
|
+
warn$1("Component provided template option but runtime compilation is not supported in this build of Vue. Use \"vue.esm-browser.js\" instead.");
|
|
9778
|
+
else warn$1(`Component is missing template or render function: `, Component);
|
|
9779
|
+
}
|
|
9620
9780
|
}
|
|
9621
9781
|
const attrsProxyHandlers = {
|
|
9622
9782
|
get(target, key) {
|
|
@@ -9724,11 +9884,12 @@ function h(type, propsOrChildren, children) {
|
|
|
9724
9884
|
try {
|
|
9725
9885
|
setBlockTracking(-1);
|
|
9726
9886
|
const l = arguments.length;
|
|
9727
|
-
if (l === 2)
|
|
9728
|
-
if (
|
|
9729
|
-
|
|
9730
|
-
|
|
9731
|
-
|
|
9887
|
+
if (l === 2) {
|
|
9888
|
+
if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
|
|
9889
|
+
if (isVNode(propsOrChildren)) return createVNode(type, null, [propsOrChildren]);
|
|
9890
|
+
return createVNode(type, propsOrChildren);
|
|
9891
|
+
} else return createVNode(type, null, propsOrChildren);
|
|
9892
|
+
} else {
|
|
9732
9893
|
if (l > 3) children = Array.prototype.slice.call(arguments, 2);
|
|
9733
9894
|
else if (l === 3 && isVNode(children)) children = [children];
|
|
9734
9895
|
return createVNode(type, propsOrChildren, children);
|
|
@@ -9920,7 +10081,7 @@ function isMemoSame(cached, memo) {
|
|
|
9920
10081
|
}
|
|
9921
10082
|
//#endregion
|
|
9922
10083
|
//#region packages/runtime-core/src/index.ts
|
|
9923
|
-
const version = "3.6.0-rc.
|
|
10084
|
+
const version = "3.6.0-rc.7";
|
|
9924
10085
|
const warn = warn$1;
|
|
9925
10086
|
/**
|
|
9926
10087
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -9954,7 +10115,7 @@ const DeprecationTypes = DeprecationTypes$1;
|
|
|
9954
10115
|
let policy = void 0;
|
|
9955
10116
|
const tt = typeof window !== "undefined" && window.trustedTypes;
|
|
9956
10117
|
if (tt) try {
|
|
9957
|
-
policy =
|
|
10118
|
+
policy = /*@__PURE__*/ tt.createPolicy("vue", { createHTML: (val) => val });
|
|
9958
10119
|
} catch (e) {
|
|
9959
10120
|
warn(`Error creating trusted types policy: ${e}`);
|
|
9960
10121
|
}
|
|
@@ -9962,7 +10123,7 @@ const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) =>
|
|
|
9962
10123
|
const svgNS = "http://www.w3.org/2000/svg";
|
|
9963
10124
|
const mathmlNS = "http://www.w3.org/1998/Math/MathML";
|
|
9964
10125
|
const doc = typeof document !== "undefined" ? document : null;
|
|
9965
|
-
const templateContainer = doc &&
|
|
10126
|
+
const templateContainer = doc && /*@__PURE__*/ doc.createElement("template");
|
|
9966
10127
|
const nodeOps = {
|
|
9967
10128
|
insert: (child, parent, anchor) => {
|
|
9968
10129
|
parent.insertBefore(child, anchor || null);
|
|
@@ -10036,7 +10197,7 @@ const DOMTransitionPropsValidators = {
|
|
|
10036
10197
|
leaveActiveClass: String,
|
|
10037
10198
|
leaveToClass: String
|
|
10038
10199
|
};
|
|
10039
|
-
const TransitionPropsValidators =
|
|
10200
|
+
const TransitionPropsValidators = /*@__PURE__*/ extend({}, BaseTransitionPropsValidators, DOMTransitionPropsValidators);
|
|
10040
10201
|
/**
|
|
10041
10202
|
* Wrap logic that attaches extra properties to Transition in a function
|
|
10042
10203
|
* so that it can be annotated as pure
|
|
@@ -10051,7 +10212,7 @@ const decorate$1 = (t) => {
|
|
|
10051
10212
|
* DOM Transition is a higher-order-component based on the platform-agnostic
|
|
10052
10213
|
* base Transition component, with DOM-specific logic.
|
|
10053
10214
|
*/
|
|
10054
|
-
const Transition =
|
|
10215
|
+
const Transition = /*@__PURE__*/ decorate$1((props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots));
|
|
10055
10216
|
/**
|
|
10056
10217
|
* #3227 Incoming hooks may be merged into arrays when wrapping Transition
|
|
10057
10218
|
* with custom HOCs.
|
|
@@ -10291,14 +10452,15 @@ const vShow = {
|
|
|
10291
10452
|
},
|
|
10292
10453
|
updated(el, { value, oldValue }, { transition }) {
|
|
10293
10454
|
if (!value === !oldValue) return;
|
|
10294
|
-
if (transition)
|
|
10295
|
-
|
|
10296
|
-
|
|
10297
|
-
|
|
10298
|
-
|
|
10299
|
-
|
|
10300
|
-
|
|
10301
|
-
|
|
10455
|
+
if (transition) {
|
|
10456
|
+
if (value) {
|
|
10457
|
+
transition.beforeEnter(el);
|
|
10458
|
+
setDisplay(el, true);
|
|
10459
|
+
transition.enter(el);
|
|
10460
|
+
} else transition.leave(el, () => {
|
|
10461
|
+
setDisplay(el, false);
|
|
10462
|
+
});
|
|
10463
|
+
} else setDisplay(el, value);
|
|
10302
10464
|
},
|
|
10303
10465
|
beforeUnmount(el, { value }) {
|
|
10304
10466
|
setDisplay(el, value);
|
|
@@ -10400,11 +10562,13 @@ function patchStyle(el, prev, next) {
|
|
|
10400
10562
|
const isCssString = isString(next);
|
|
10401
10563
|
let hasControlledDisplay = false;
|
|
10402
10564
|
if (next && !isCssString) {
|
|
10403
|
-
if (prev)
|
|
10404
|
-
|
|
10405
|
-
|
|
10406
|
-
|
|
10407
|
-
|
|
10565
|
+
if (prev) {
|
|
10566
|
+
if (!isString(prev)) {
|
|
10567
|
+
for (const key in prev) if (next[key] == null) setStyle(style, key, "");
|
|
10568
|
+
} else for (const prevStyle of prev.split(";")) {
|
|
10569
|
+
const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
|
|
10570
|
+
if (next[key] == null) setStyle(style, key, "");
|
|
10571
|
+
}
|
|
10408
10572
|
}
|
|
10409
10573
|
for (const key in next) {
|
|
10410
10574
|
if (key === "display") hasControlledDisplay = true;
|
|
@@ -10433,8 +10597,10 @@ function setStyle(style, name, rawVal) {
|
|
|
10433
10597
|
else {
|
|
10434
10598
|
const val = rawVal == null ? "" : String(rawVal);
|
|
10435
10599
|
if (semicolonRE.test(val)) warn(`Unexpected semicolon at the end of '${name}' style value: '${val}'`);
|
|
10436
|
-
if (name.startsWith("--"))
|
|
10437
|
-
|
|
10600
|
+
if (name.startsWith("--")) {
|
|
10601
|
+
if (importantRE.test(val)) style.setProperty(name, val.replace(importantRE, ""), "important");
|
|
10602
|
+
else style.setProperty(name, val);
|
|
10603
|
+
} else {
|
|
10438
10604
|
const prefixed = autoPrefix(style, name);
|
|
10439
10605
|
if (importantRE.test(val)) style.setProperty(hyphenate(prefixed), val.replace(importantRE, ""), "important");
|
|
10440
10606
|
else style[prefixed] = val;
|
|
@@ -10471,15 +10637,16 @@ function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
|
|
|
10471
10637
|
//#region packages/runtime-dom/src/modules/attrs.ts
|
|
10472
10638
|
const xlinkNS = "http://www.w3.org/1999/xlink";
|
|
10473
10639
|
function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {
|
|
10474
|
-
if (isSVG && key.startsWith("xlink:"))
|
|
10475
|
-
|
|
10476
|
-
|
|
10640
|
+
if (isSVG && key.startsWith("xlink:")) {
|
|
10641
|
+
if (value == null) el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
|
|
10642
|
+
else el.setAttributeNS(xlinkNS, key, value);
|
|
10643
|
+
} else {
|
|
10477
10644
|
if (compatCoerceAttr(el, key, value, instance)) return;
|
|
10478
10645
|
if (value == null || isBoolean && !includeBooleanAttr(value)) el.removeAttribute(key);
|
|
10479
10646
|
else el.setAttribute(key, isBoolean ? "" : isSymbol(value) ? String(value) : value);
|
|
10480
10647
|
}
|
|
10481
10648
|
}
|
|
10482
|
-
const isEnumeratedAttr =
|
|
10649
|
+
const isEnumeratedAttr = /*@__PURE__*/ makeMap("contenteditable,draggable,spellcheck");
|
|
10483
10650
|
function compatCoerceAttr(el, key, value, instance = null) {
|
|
10484
10651
|
if (isEnumeratedAttr(key)) {
|
|
10485
10652
|
const v2CoercedValue = value === void 0 ? null : value === null || value === false || value === "false" ? "false" : "true";
|
|
@@ -10571,7 +10738,7 @@ function parseEventName(name) {
|
|
|
10571
10738
|
return [name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2)), options];
|
|
10572
10739
|
}
|
|
10573
10740
|
let cachedNow = 0;
|
|
10574
|
-
const p =
|
|
10741
|
+
const p = /*@__PURE__*/ Promise.resolve();
|
|
10575
10742
|
const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
|
|
10576
10743
|
function createInvoker(initialValue, instance) {
|
|
10577
10744
|
const invoker = (e) => {
|
|
@@ -10639,7 +10806,7 @@ function shouldSetAsPropForVueCE(el, key) {
|
|
|
10639
10806
|
//#endregion
|
|
10640
10807
|
//#region packages/runtime-dom/src/apiCustomElement.ts
|
|
10641
10808
|
const REMOVAL = {};
|
|
10642
|
-
|
|
10809
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
10643
10810
|
function defineCustomElement(options, extraOptions, _createApp) {
|
|
10644
10811
|
let Comp = /* @__PURE__ */ defineComponent(options, extraOptions);
|
|
10645
10812
|
if (isPlainObject(Comp)) Comp = extend({}, Comp, extraOptions);
|
|
@@ -10688,12 +10855,14 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
10688
10855
|
this._parent = parent;
|
|
10689
10856
|
break;
|
|
10690
10857
|
}
|
|
10691
|
-
if (!this._instance)
|
|
10692
|
-
|
|
10693
|
-
this._pendingResolve =
|
|
10694
|
-
|
|
10695
|
-
|
|
10696
|
-
|
|
10858
|
+
if (!this._instance) {
|
|
10859
|
+
if (this._resolved) this._mountComponent(this._def);
|
|
10860
|
+
else if (parent && parent._pendingResolve) this._pendingResolve = parent._pendingResolve.then(() => {
|
|
10861
|
+
this._pendingResolve = void 0;
|
|
10862
|
+
if (this.isConnected) return this._resolveDef();
|
|
10863
|
+
});
|
|
10864
|
+
else this._resolveDef();
|
|
10865
|
+
}
|
|
10697
10866
|
}
|
|
10698
10867
|
disconnectedCallback() {
|
|
10699
10868
|
this._connected = false;
|
|
@@ -10909,13 +11078,11 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
10909
11078
|
_renderSlots() {
|
|
10910
11079
|
const outlets = this._getSlots();
|
|
10911
11080
|
const scopeId = this._instance.type.__scopeId;
|
|
10912
|
-
const slotReplacements = /* @__PURE__ */ new Map();
|
|
10913
11081
|
for (let i = 0; i < outlets.length; i++) {
|
|
10914
11082
|
const o = outlets[i];
|
|
10915
11083
|
const slotName = o.getAttribute("name") || "default";
|
|
10916
11084
|
const content = this._slots[slotName];
|
|
10917
11085
|
const parent = o.parentNode;
|
|
10918
|
-
const replacementNodes = [];
|
|
10919
11086
|
if (content) for (const n of content) {
|
|
10920
11087
|
if (scopeId && n.nodeType === 1) {
|
|
10921
11088
|
const id = scopeId + "-s";
|
|
@@ -10925,20 +11092,10 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
10925
11092
|
while (child = walker.nextNode()) child.setAttribute(id, "");
|
|
10926
11093
|
}
|
|
10927
11094
|
parent.insertBefore(n, o);
|
|
10928
|
-
replacementNodes.push(n);
|
|
10929
|
-
}
|
|
10930
|
-
else while (o.firstChild) {
|
|
10931
|
-
const child = o.firstChild;
|
|
10932
|
-
parent.insertBefore(child, o);
|
|
10933
|
-
replacementNodes.push(child);
|
|
10934
11095
|
}
|
|
11096
|
+
else while (o.firstChild) parent.insertBefore(o.firstChild, o);
|
|
10935
11097
|
parent.removeChild(o);
|
|
10936
|
-
slotReplacements.set(o, {
|
|
10937
|
-
nodes: replacementNodes,
|
|
10938
|
-
usedFallback: !content
|
|
10939
|
-
});
|
|
10940
11098
|
}
|
|
10941
|
-
this._updateSlotNodes(slotReplacements);
|
|
10942
11099
|
}
|
|
10943
11100
|
/**
|
|
10944
11101
|
* @internal
|
|
@@ -10977,7 +11134,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
10977
11134
|
* @internal
|
|
10978
11135
|
*/
|
|
10979
11136
|
_hasShadowRoot() {
|
|
10980
|
-
return this.
|
|
11137
|
+
return this._root !== this;
|
|
10981
11138
|
}
|
|
10982
11139
|
/**
|
|
10983
11140
|
* @internal
|
|
@@ -11022,10 +11179,6 @@ var VueElement = class extends VueElementBase {
|
|
|
11022
11179
|
if (this._instance && this._instance.ce) this._instance.ce = void 0;
|
|
11023
11180
|
this._app = this._instance = null;
|
|
11024
11181
|
}
|
|
11025
|
-
/**
|
|
11026
|
-
* Only called when shadowRoot is false
|
|
11027
|
-
*/
|
|
11028
|
-
_updateSlotNodes(replacements) {}
|
|
11029
11182
|
_createVNode() {
|
|
11030
11183
|
const baseProps = {};
|
|
11031
11184
|
if (!this.shadowRoot) baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this);
|
|
@@ -11092,7 +11245,7 @@ const decorate = (t) => {
|
|
|
11092
11245
|
};
|
|
11093
11246
|
const TransitionGroup = /* @__PURE__ */ decorate({
|
|
11094
11247
|
name: "TransitionGroup",
|
|
11095
|
-
props:
|
|
11248
|
+
props: /*@__PURE__*/ extend({}, TransitionPropsValidators, {
|
|
11096
11249
|
tag: String,
|
|
11097
11250
|
moveClass: String
|
|
11098
11251
|
}),
|
|
@@ -11374,19 +11527,39 @@ const vModelSelectInit = (el, value, number, set) => {
|
|
|
11374
11527
|
el._modelValue = value;
|
|
11375
11528
|
addEventListener(el, "change", () => {
|
|
11376
11529
|
const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map((o) => number ? looseToNumber(getValue(o)) : getValue(o));
|
|
11377
|
-
|
|
11378
|
-
el.
|
|
11379
|
-
|
|
11380
|
-
|
|
11381
|
-
|
|
11530
|
+
const multiple = el.multiple;
|
|
11531
|
+
const assignedValue = multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0];
|
|
11532
|
+
const pending = el._pendingValue = [multiple, multiple ? isArray(assignedValue) ? selectedVal.slice() : selectedVal : assignedValue];
|
|
11533
|
+
try {
|
|
11534
|
+
(set || el[assignKey])(assignedValue);
|
|
11535
|
+
} finally {
|
|
11536
|
+
nextTick(() => {
|
|
11537
|
+
if (el._pendingValue === pending) el._pendingValue = void 0;
|
|
11538
|
+
});
|
|
11539
|
+
}
|
|
11382
11540
|
});
|
|
11383
11541
|
};
|
|
11542
|
+
function isSameSelectValue(value, assignedValue, multiple) {
|
|
11543
|
+
if (!multiple) return looseEqual(value, assignedValue);
|
|
11544
|
+
if (isArray(value)) return looseEqual(value, assignedValue);
|
|
11545
|
+
if (isSet(value)) {
|
|
11546
|
+
if (value.size !== assignedValue.length) return false;
|
|
11547
|
+
for (const item of assignedValue) if (!value.has(item)) return false;
|
|
11548
|
+
return true;
|
|
11549
|
+
}
|
|
11550
|
+
return false;
|
|
11551
|
+
}
|
|
11384
11552
|
/**
|
|
11385
11553
|
* @internal
|
|
11386
11554
|
*/
|
|
11387
11555
|
const vModelSetSelected = (el, value) => {
|
|
11388
11556
|
el._modelValue = value;
|
|
11389
|
-
|
|
11557
|
+
const pending = el._pendingValue;
|
|
11558
|
+
el._pendingValue = void 0;
|
|
11559
|
+
if (pending && pending[0] === el.multiple && isSameSelectValue(value, pending[1], pending[0])) return;
|
|
11560
|
+
setSelected(el, value);
|
|
11561
|
+
};
|
|
11562
|
+
function setSelected(el, value) {
|
|
11390
11563
|
const isMultiple = el.multiple;
|
|
11391
11564
|
const isArrayValue = isArray(value);
|
|
11392
11565
|
if (isMultiple && !isArrayValue && !isSet(value)) {
|
|
@@ -11396,18 +11569,19 @@ const vModelSetSelected = (el, value) => {
|
|
|
11396
11569
|
for (let i = 0, l = el.options.length; i < l; i++) {
|
|
11397
11570
|
const option = el.options[i];
|
|
11398
11571
|
const optionValue = getValue(option);
|
|
11399
|
-
if (isMultiple)
|
|
11400
|
-
|
|
11401
|
-
|
|
11402
|
-
|
|
11403
|
-
|
|
11404
|
-
|
|
11572
|
+
if (isMultiple) {
|
|
11573
|
+
if (isArrayValue) {
|
|
11574
|
+
const optionType = typeof optionValue;
|
|
11575
|
+
if (optionType === "string" || optionType === "number") option.selected = value.some((v) => String(v) === String(optionValue));
|
|
11576
|
+
else option.selected = looseIndexOf(value, optionValue) > -1;
|
|
11577
|
+
} else option.selected = value.has(optionValue);
|
|
11578
|
+
} else if (looseEqual(getValue(option), value)) {
|
|
11405
11579
|
if (el.selectedIndex !== i) el.selectedIndex = i;
|
|
11406
11580
|
return;
|
|
11407
11581
|
}
|
|
11408
11582
|
}
|
|
11409
11583
|
if (!isMultiple && el.selectedIndex !== -1) el.selectedIndex = -1;
|
|
11410
|
-
}
|
|
11584
|
+
}
|
|
11411
11585
|
/**
|
|
11412
11586
|
* @internal retrieve raw value set via :value bindings
|
|
11413
11587
|
*/
|
|
@@ -11703,7 +11877,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
11703
11877
|
withModifiers: () => withModifiers,
|
|
11704
11878
|
withScopeId: () => withScopeId
|
|
11705
11879
|
});
|
|
11706
|
-
const rendererOptions =
|
|
11880
|
+
const rendererOptions = /*@__PURE__*/ extend({ patchProp }, nodeOps);
|
|
11707
11881
|
let renderer;
|
|
11708
11882
|
let enabledHydration = false;
|
|
11709
11883
|
function ensureRenderer() {
|
|
@@ -12254,13 +12428,14 @@ var Tokenizer = class {
|
|
|
12254
12428
|
}
|
|
12255
12429
|
}
|
|
12256
12430
|
stateInterpolationOpen(c) {
|
|
12257
|
-
if (c === this.delimiterOpen[this.delimiterIndex])
|
|
12258
|
-
|
|
12259
|
-
|
|
12260
|
-
|
|
12261
|
-
|
|
12262
|
-
|
|
12263
|
-
|
|
12431
|
+
if (c === this.delimiterOpen[this.delimiterIndex]) {
|
|
12432
|
+
if (this.delimiterIndex === this.delimiterOpen.length - 1) {
|
|
12433
|
+
const start = this.index + 1 - this.delimiterOpen.length;
|
|
12434
|
+
if (start > this.sectionStart) this.cbs.ontext(this.sectionStart, start);
|
|
12435
|
+
this.state = 3;
|
|
12436
|
+
this.sectionStart = start;
|
|
12437
|
+
} else this.delimiterIndex++;
|
|
12438
|
+
} else if (this.inRCDATA) {
|
|
12264
12439
|
this.state = 32;
|
|
12265
12440
|
this.stateInRCDATA(c);
|
|
12266
12441
|
} else {
|
|
@@ -12276,13 +12451,14 @@ var Tokenizer = class {
|
|
|
12276
12451
|
}
|
|
12277
12452
|
}
|
|
12278
12453
|
stateInterpolationClose(c) {
|
|
12279
|
-
if (c === this.delimiterClose[this.delimiterIndex])
|
|
12280
|
-
|
|
12281
|
-
|
|
12282
|
-
|
|
12283
|
-
|
|
12284
|
-
|
|
12285
|
-
|
|
12454
|
+
if (c === this.delimiterClose[this.delimiterIndex]) {
|
|
12455
|
+
if (this.delimiterIndex === this.delimiterClose.length - 1) {
|
|
12456
|
+
this.cbs.oninterpolation(this.sectionStart, this.index + 1);
|
|
12457
|
+
if (this.inRCDATA) this.state = 32;
|
|
12458
|
+
else this.state = 1;
|
|
12459
|
+
this.sectionStart = this.index + 1;
|
|
12460
|
+
} else this.delimiterIndex++;
|
|
12461
|
+
} else {
|
|
12286
12462
|
this.state = 3;
|
|
12287
12463
|
this.stateInterpolation(c);
|
|
12288
12464
|
}
|
|
@@ -12397,9 +12573,10 @@ var Tokenizer = class {
|
|
|
12397
12573
|
this.sectionStart = this.index;
|
|
12398
12574
|
if (this.mode === 0) this.state = 6;
|
|
12399
12575
|
else if (this.inSFCRoot) this.state = 34;
|
|
12400
|
-
else if (!this.inXML)
|
|
12401
|
-
|
|
12402
|
-
|
|
12576
|
+
else if (!this.inXML) {
|
|
12577
|
+
if (c === 116) this.state = 30;
|
|
12578
|
+
else this.state = c === 115 ? 29 : 6;
|
|
12579
|
+
} else this.state = 6;
|
|
12403
12580
|
} else if (c === 47) this.state = 8;
|
|
12404
12581
|
else {
|
|
12405
12582
|
this.state = 1;
|
|
@@ -12752,9 +12929,7 @@ var Tokenizer = class {
|
|
|
12752
12929
|
case 24:
|
|
12753
12930
|
this.stateInProcessingInstruction(c);
|
|
12754
12931
|
break;
|
|
12755
|
-
case 33:
|
|
12756
|
-
this.stateInEntity();
|
|
12757
|
-
break;
|
|
12932
|
+
case 33: this.stateInEntity();
|
|
12758
12933
|
}
|
|
12759
12934
|
this.index++;
|
|
12760
12935
|
}
|
|
@@ -12783,9 +12958,10 @@ var Tokenizer = class {
|
|
|
12783
12958
|
handleTrailingData() {
|
|
12784
12959
|
const endIndex = this.buffer.length;
|
|
12785
12960
|
if (this.sectionStart >= endIndex) return;
|
|
12786
|
-
if (this.state === 28)
|
|
12787
|
-
|
|
12788
|
-
|
|
12961
|
+
if (this.state === 28) {
|
|
12962
|
+
if (this.currentSequence === Sequences.CdataEnd) this.cbs.oncdata(this.sectionStart, endIndex);
|
|
12963
|
+
else this.cbs.oncomment(this.sectionStart, endIndex);
|
|
12964
|
+
} else if (this.state === 6 || this.state === 11 || this.state === 18 || this.state === 17 || this.state === 12 || this.state === 13 || this.state === 14 || this.state === 15 || this.state === 16 || this.state === 20 || this.state === 19 || this.state === 21 || this.state === 9) {} else this.cbs.ontext(this.sectionStart, endIndex);
|
|
12789
12965
|
}
|
|
12790
12966
|
emitCodePoint(cp, consumed) {}
|
|
12791
12967
|
};
|
|
@@ -12987,12 +13163,10 @@ const isMemberExpressionBrowser = (exp) => {
|
|
|
12987
13163
|
if (!--currentOpenParensCount) state = stateStack.pop();
|
|
12988
13164
|
}
|
|
12989
13165
|
break;
|
|
12990
|
-
case 3:
|
|
12991
|
-
|
|
12992
|
-
|
|
12993
|
-
|
|
12994
|
-
}
|
|
12995
|
-
break;
|
|
13166
|
+
case 3: if (char === currentStringType) {
|
|
13167
|
+
state = stateStack.pop();
|
|
13168
|
+
currentStringType = null;
|
|
13169
|
+
}
|
|
12996
13170
|
}
|
|
12997
13171
|
}
|
|
12998
13172
|
return !currentOpenBracketCount && !currentOpenParensCount;
|
|
@@ -13042,7 +13216,7 @@ function isTemplateNode(node) {
|
|
|
13042
13216
|
function isSlotOutlet(node) {
|
|
13043
13217
|
return node.type === 1 && node.tagType === 2;
|
|
13044
13218
|
}
|
|
13045
|
-
const propsHelperSet = new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);
|
|
13219
|
+
const propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);
|
|
13046
13220
|
function getUnnormalizedProps(props, callPath = []) {
|
|
13047
13221
|
if (props && !isString(props) && props.type === 14) {
|
|
13048
13222
|
const callee = props.callee;
|
|
@@ -13085,9 +13259,10 @@ function injectProp(node, prop, context) {
|
|
|
13085
13259
|
propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [createObjectExpression([prop]), props]);
|
|
13086
13260
|
if (parentCall && parentCall.callee === GUARD_REACTIVE_PROPS) parentCall = callPath[callPath.length - 2];
|
|
13087
13261
|
}
|
|
13088
|
-
if (node.type === 13)
|
|
13089
|
-
|
|
13090
|
-
|
|
13262
|
+
if (node.type === 13) {
|
|
13263
|
+
if (parentCall) parentCall.arguments[0] = propsWithInjection;
|
|
13264
|
+
else node.props = propsWithInjection;
|
|
13265
|
+
} else if (parentCall) parentCall.arguments[0] = propsWithInjection;
|
|
13091
13266
|
else node.arguments[2] = propsWithInjection;
|
|
13092
13267
|
}
|
|
13093
13268
|
function injectSlotKey(node, prop) {
|
|
@@ -13362,10 +13537,7 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
13362
13537
|
case 18:
|
|
13363
13538
|
case 19:
|
|
13364
13539
|
case 20:
|
|
13365
|
-
case 21:
|
|
13366
|
-
emitError(9, end);
|
|
13367
|
-
break;
|
|
13368
|
-
default: break;
|
|
13540
|
+
case 21: emitError(9, end);
|
|
13369
13541
|
}
|
|
13370
13542
|
for (let index = 0; index < stack.length; index++) {
|
|
13371
13543
|
onCloseTag(stack[index], end - 1);
|
|
@@ -13515,7 +13687,7 @@ function backTrack(index, c) {
|
|
|
13515
13687
|
while (currentInput.charCodeAt(i) !== c && i >= 0) i--;
|
|
13516
13688
|
return i;
|
|
13517
13689
|
}
|
|
13518
|
-
const specialTemplateDir = new Set([
|
|
13690
|
+
const specialTemplateDir = /* @__PURE__ */ new Set([
|
|
13519
13691
|
"if",
|
|
13520
13692
|
"else",
|
|
13521
13693
|
"else-if",
|
|
@@ -13551,16 +13723,18 @@ function condenseWhitespace(nodes) {
|
|
|
13551
13723
|
let removedWhitespace = false;
|
|
13552
13724
|
for (let i = 0; i < nodes.length; i++) {
|
|
13553
13725
|
const node = nodes[i];
|
|
13554
|
-
if (node.type === 2)
|
|
13555
|
-
if (
|
|
13556
|
-
|
|
13557
|
-
|
|
13558
|
-
|
|
13559
|
-
|
|
13560
|
-
|
|
13561
|
-
|
|
13562
|
-
|
|
13563
|
-
|
|
13726
|
+
if (node.type === 2) {
|
|
13727
|
+
if (!inPre) {
|
|
13728
|
+
if (isAllWhitespace(node.content)) {
|
|
13729
|
+
const prev = nodes[i - 1] && nodes[i - 1].type;
|
|
13730
|
+
const next = nodes[i + 1] && nodes[i + 1].type;
|
|
13731
|
+
if (!prev || !next || shouldCondense && (prev === 3 && (next === 3 || next === 1) || prev === 1 && (next === 3 || next === 1 && hasNewlineChar(node.content)))) {
|
|
13732
|
+
removedWhitespace = true;
|
|
13733
|
+
nodes[i] = null;
|
|
13734
|
+
} else node.content = " ";
|
|
13735
|
+
} else if (shouldCondense) node.content = condense(node.content);
|
|
13736
|
+
} else node.content = node.content.replace(windowsNewlineRE, "\n");
|
|
13737
|
+
}
|
|
13564
13738
|
}
|
|
13565
13739
|
return removedWhitespace ? nodes.filter(Boolean) : nodes;
|
|
13566
13740
|
}
|
|
@@ -13821,7 +13995,7 @@ function getConstantType(node, context) {
|
|
|
13821
13995
|
default: return 0;
|
|
13822
13996
|
}
|
|
13823
13997
|
}
|
|
13824
|
-
const allowHoistedHelperSet = new Set([
|
|
13998
|
+
const allowHoistedHelperSet = /* @__PURE__ */ new Set([
|
|
13825
13999
|
NORMALIZE_CLASS,
|
|
13826
14000
|
NORMALIZE_STYLE,
|
|
13827
14001
|
NORMALIZE_PROPS,
|
|
@@ -13979,7 +14153,7 @@ function transform(root, options) {
|
|
|
13979
14153
|
traverseNode(root, context);
|
|
13980
14154
|
if (options.hoistStatic) cacheStatic(root, context);
|
|
13981
14155
|
if (!options.ssr) createRootCodegen(root, context);
|
|
13982
|
-
root.helpers = new Set([...context.helpers.keys()]);
|
|
14156
|
+
root.helpers = /* @__PURE__ */ new Set([...context.helpers.keys()]);
|
|
13983
14157
|
root.components = [...context.components];
|
|
13984
14158
|
root.directives = [...context.directives];
|
|
13985
14159
|
root.imports = context.imports;
|
|
@@ -14026,8 +14200,10 @@ function traverseNode(node, context) {
|
|
|
14026
14200
|
const exitFns = [];
|
|
14027
14201
|
for (let i = 0; i < nodeTransforms.length; i++) {
|
|
14028
14202
|
const onExit = nodeTransforms[i](node, context);
|
|
14029
|
-
if (onExit)
|
|
14030
|
-
|
|
14203
|
+
if (onExit) {
|
|
14204
|
+
if (isArray(onExit)) exitFns.push(...onExit);
|
|
14205
|
+
else exitFns.push(onExit);
|
|
14206
|
+
}
|
|
14031
14207
|
if (!context.currentNode) return;
|
|
14032
14208
|
else node = context.currentNode;
|
|
14033
14209
|
}
|
|
@@ -14044,9 +14220,7 @@ function traverseNode(node, context) {
|
|
|
14044
14220
|
case 10:
|
|
14045
14221
|
case 11:
|
|
14046
14222
|
case 1:
|
|
14047
|
-
case 0:
|
|
14048
|
-
traverseChildren(node, context);
|
|
14049
|
-
break;
|
|
14223
|
+
case 0: traverseChildren(node, context);
|
|
14050
14224
|
}
|
|
14051
14225
|
context.currentNode = node;
|
|
14052
14226
|
let i = exitFns.length;
|
|
@@ -14242,10 +14416,12 @@ function genNodeList(nodes, context, multilines = false, comma = true) {
|
|
|
14242
14416
|
if (isString(node)) push(node, -3);
|
|
14243
14417
|
else if (isArray(node)) genNodeListAsArray(node, context);
|
|
14244
14418
|
else genNode(node, context);
|
|
14245
|
-
if (i < nodes.length - 1)
|
|
14246
|
-
|
|
14247
|
-
|
|
14248
|
-
|
|
14419
|
+
if (i < nodes.length - 1) {
|
|
14420
|
+
if (multilines) {
|
|
14421
|
+
comma && push(",");
|
|
14422
|
+
newline();
|
|
14423
|
+
} else comma && push(", ");
|
|
14424
|
+
}
|
|
14249
14425
|
}
|
|
14250
14426
|
}
|
|
14251
14427
|
function genNode(node, context) {
|
|
@@ -14357,8 +14533,10 @@ function genVNodeCall(node, context) {
|
|
|
14357
14533
|
const { push, helper, pure } = context;
|
|
14358
14534
|
const { tag, props, children, patchFlag, dynamicProps, directives, isBlock, disableTracking, isComponent } = node;
|
|
14359
14535
|
let patchFlagString;
|
|
14360
|
-
if (patchFlag)
|
|
14361
|
-
|
|
14536
|
+
if (patchFlag) {
|
|
14537
|
+
if (patchFlag < 0) patchFlagString = patchFlag + ` /* ${PatchFlagNames[patchFlag]} */`;
|
|
14538
|
+
else patchFlagString = patchFlag + ` /* ${Object.keys(PatchFlagNames).map(Number).filter((n) => n > 0 && patchFlag & n).map((n) => PatchFlagNames[n]).join(`, `)} */`;
|
|
14539
|
+
}
|
|
14362
14540
|
if (directives) push(helper(WITH_DIRECTIVES) + `(`);
|
|
14363
14541
|
if (isBlock) push(`(${helper(OPEN_BLOCK)}(${disableTracking ? `true` : ``}), `);
|
|
14364
14542
|
if (pure) push(PURE_ANNOTATION);
|
|
@@ -14627,16 +14805,17 @@ function createChildrenCodegenNode(branch, keyIndex, context) {
|
|
|
14627
14805
|
const keyProperty = createObjectProperty(`key`, createSimpleExpression(`${keyIndex}`, false, locStub, 2));
|
|
14628
14806
|
const { children } = branch;
|
|
14629
14807
|
const firstChild = children[0];
|
|
14630
|
-
if (children.length !== 1 || firstChild.type !== 1)
|
|
14631
|
-
|
|
14632
|
-
|
|
14633
|
-
|
|
14808
|
+
if (children.length !== 1 || firstChild.type !== 1) {
|
|
14809
|
+
if (children.length === 1 && firstChild.type === 11) {
|
|
14810
|
+
const vnodeCall = firstChild.codegenNode;
|
|
14811
|
+
injectProp(vnodeCall, keyProperty, context);
|
|
14812
|
+
return vnodeCall;
|
|
14813
|
+
} else {
|
|
14814
|
+
let patchFlag = 64;
|
|
14815
|
+
if (!branch.isTemplateIf && children.filter((c) => c.type !== 3).length === 1) patchFlag |= 2048;
|
|
14816
|
+
return createVNodeCall(context, helper(FRAGMENT), createObjectExpression([keyProperty]), children, patchFlag, void 0, void 0, true, false, false, branch.loc);
|
|
14817
|
+
}
|
|
14634
14818
|
} else {
|
|
14635
|
-
let patchFlag = 64;
|
|
14636
|
-
if (!branch.isTemplateIf && children.filter((c) => c.type !== 3).length === 1) patchFlag |= 2048;
|
|
14637
|
-
return createVNodeCall(context, helper(FRAGMENT), createObjectExpression([keyProperty]), children, patchFlag, void 0, void 0, true, false, false, branch.loc);
|
|
14638
|
-
}
|
|
14639
|
-
else {
|
|
14640
14819
|
const ret = firstChild.codegenNode;
|
|
14641
14820
|
const vnodeCall = getMemoedVNodeCall(ret);
|
|
14642
14821
|
if (vnodeCall.type === 13) convertToBlock(vnodeCall, context);
|
|
@@ -14657,9 +14836,10 @@ function isSameKey(a, b) {
|
|
|
14657
14836
|
return true;
|
|
14658
14837
|
}
|
|
14659
14838
|
function getParentCondition(node) {
|
|
14660
|
-
while (true) if (node.type === 19)
|
|
14661
|
-
|
|
14662
|
-
|
|
14839
|
+
while (true) if (node.type === 19) {
|
|
14840
|
+
if (node.alternate.type === 19) node = node.alternate;
|
|
14841
|
+
else return node;
|
|
14842
|
+
} else if (node.type === 20) node = node.value;
|
|
14663
14843
|
}
|
|
14664
14844
|
//#endregion
|
|
14665
14845
|
//#region packages/compiler-core/src/transforms/vFor.ts
|
|
@@ -14698,10 +14878,12 @@ const transformFor = createStructuralDirectiveTransform("for", (node, dir, conte
|
|
|
14698
14878
|
childBlock = children[0].codegenNode;
|
|
14699
14879
|
if (isTemplate && keyProperty) injectProp(childBlock, keyProperty, context);
|
|
14700
14880
|
const shouldUseBlock = !isStableFragment || childBlock.isBlockRequired === true;
|
|
14701
|
-
if (childBlock.isBlock !== shouldUseBlock)
|
|
14702
|
-
|
|
14703
|
-
|
|
14704
|
-
|
|
14881
|
+
if (childBlock.isBlock !== shouldUseBlock) {
|
|
14882
|
+
if (childBlock.isBlock) {
|
|
14883
|
+
removeHelper(OPEN_BLOCK);
|
|
14884
|
+
removeHelper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
|
|
14885
|
+
} else removeHelper(getVNodeHelper(context.inSSR, childBlock.isComponent));
|
|
14886
|
+
}
|
|
14705
14887
|
childBlock.isBlock = shouldUseBlock;
|
|
14706
14888
|
if (childBlock.isBlock) {
|
|
14707
14889
|
helper(OPEN_BLOCK);
|
|
@@ -14884,8 +15066,10 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
14884
15066
|
return createObjectProperty(`default`, fn);
|
|
14885
15067
|
};
|
|
14886
15068
|
if (!hasTemplateSlots) slotsProperties.push(buildDefaultSlotProperty(void 0, children));
|
|
14887
|
-
else if (implicitDefaultChildren.length && !implicitDefaultChildren.every(isWhitespaceText))
|
|
14888
|
-
|
|
15069
|
+
else if (implicitDefaultChildren.length && !implicitDefaultChildren.every(isWhitespaceText)) {
|
|
15070
|
+
if (hasNamedDefaultSlot) context.onError(createCompilerError(39, implicitDefaultChildren[0].loc));
|
|
15071
|
+
else slotsProperties.push(buildDefaultSlotProperty(void 0, implicitDefaultChildren));
|
|
15072
|
+
}
|
|
14889
15073
|
}
|
|
14890
15074
|
const slotFlag = hasDynamicSlots ? 2 : hasForwardedSlots(node.children) ? 3 : 1;
|
|
14891
15075
|
let slots = createObjectExpression(slotsProperties.concat(createObjectProperty(`_`, createSimpleExpression(slotFlag + ` /* ${slotFlagsText[slotFlag]} */`, false))), loc);
|
|
@@ -14911,10 +15095,7 @@ function hasForwardedSlots(children) {
|
|
|
14911
15095
|
if (hasForwardedSlots(child.branches)) return true;
|
|
14912
15096
|
break;
|
|
14913
15097
|
case 10:
|
|
14914
|
-
case 11:
|
|
14915
|
-
if (hasForwardedSlots(child.children)) return true;
|
|
14916
|
-
break;
|
|
14917
|
-
default: break;
|
|
15098
|
+
case 11: if (hasForwardedSlots(child.children)) return true;
|
|
14918
15099
|
}
|
|
14919
15100
|
}
|
|
14920
15101
|
return false;
|
|
@@ -15075,29 +15256,30 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
15075
15256
|
if (isVBind && isStaticArgOf(arg, "ref")) pushRefVForMarker();
|
|
15076
15257
|
if (!arg && (isVBind || isVOn)) {
|
|
15077
15258
|
hasDynamicKeys = true;
|
|
15078
|
-
if (exp)
|
|
15079
|
-
|
|
15080
|
-
|
|
15081
|
-
if (
|
|
15082
|
-
if (
|
|
15083
|
-
|
|
15084
|
-
|
|
15085
|
-
|
|
15086
|
-
|
|
15087
|
-
|
|
15088
|
-
|
|
15089
|
-
|
|
15090
|
-
|
|
15091
|
-
|
|
15092
|
-
|
|
15093
|
-
|
|
15094
|
-
|
|
15095
|
-
|
|
15096
|
-
|
|
15097
|
-
|
|
15098
|
-
|
|
15099
|
-
|
|
15100
|
-
|
|
15259
|
+
if (exp) {
|
|
15260
|
+
if (isVBind) {
|
|
15261
|
+
pushMergeArg();
|
|
15262
|
+
if (mergeArgs.some((arg) => {
|
|
15263
|
+
if (arg.type === 15) return arg.properties.some(({ key }) => {
|
|
15264
|
+
if (key.type !== 4 || !key.isStatic) return true;
|
|
15265
|
+
return key.content !== "class" && key.content !== "style" && !isOn(key.content);
|
|
15266
|
+
});
|
|
15267
|
+
else return true;
|
|
15268
|
+
})) checkCompatEnabled("COMPILER_V_BIND_OBJECT_ORDER", context, loc);
|
|
15269
|
+
if (isCompatEnabled("COMPILER_V_BIND_OBJECT_ORDER", context)) {
|
|
15270
|
+
mergeArgs.unshift(exp);
|
|
15271
|
+
continue;
|
|
15272
|
+
}
|
|
15273
|
+
pushRefVForMarker();
|
|
15274
|
+
pushMergeArg();
|
|
15275
|
+
mergeArgs.push(exp);
|
|
15276
|
+
} else pushMergeArg({
|
|
15277
|
+
type: 14,
|
|
15278
|
+
loc,
|
|
15279
|
+
callee: context.helper(TO_HANDLERS),
|
|
15280
|
+
arguments: isComponent ? [exp] : [exp, `true`]
|
|
15281
|
+
});
|
|
15282
|
+
} else context.onError(createCompilerError(isVBind ? 34 : 35, loc));
|
|
15101
15283
|
continue;
|
|
15102
15284
|
}
|
|
15103
15285
|
if (isVBind && modifiers.some((mod) => mod.content === "prop")) patchFlag |= 32;
|
|
@@ -15155,9 +15337,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
15155
15337
|
} else propsExpression = createCallExpression(context.helper(NORMALIZE_PROPS), [propsExpression]);
|
|
15156
15338
|
break;
|
|
15157
15339
|
case 14: break;
|
|
15158
|
-
default:
|
|
15159
|
-
propsExpression = createCallExpression(context.helper(NORMALIZE_PROPS), [createCallExpression(context.helper(GUARD_REACTIVE_PROPS), [propsExpression])]);
|
|
15160
|
-
break;
|
|
15340
|
+
default: propsExpression = createCallExpression(context.helper(NORMALIZE_PROPS), [createCallExpression(context.helper(GUARD_REACTIVE_PROPS), [propsExpression])]);
|
|
15161
15341
|
}
|
|
15162
15342
|
return {
|
|
15163
15343
|
props: propsExpression,
|
|
@@ -15263,10 +15443,12 @@ function processSlotOutlet(node, context) {
|
|
|
15263
15443
|
for (let i = 0; i < node.props.length; i++) {
|
|
15264
15444
|
const p = node.props[i];
|
|
15265
15445
|
if (p.type === 6) {
|
|
15266
|
-
if (p.value)
|
|
15267
|
-
|
|
15268
|
-
|
|
15269
|
-
|
|
15446
|
+
if (p.value) {
|
|
15447
|
+
if (p.name === "name") slotName = JSON.stringify(p.value.content);
|
|
15448
|
+
else {
|
|
15449
|
+
p.name = camelize(p.name);
|
|
15450
|
+
nonNameProps.push(p);
|
|
15451
|
+
}
|
|
15270
15452
|
}
|
|
15271
15453
|
} else if (p.name === "bind" && isStaticArgOf(p.arg, "name")) {
|
|
15272
15454
|
if (p.exp) slotName = p.exp;
|
|
@@ -15292,17 +15474,18 @@ const transformOn$1 = (dir, node, context, augmentor) => {
|
|
|
15292
15474
|
const { loc, modifiers, arg } = dir;
|
|
15293
15475
|
if (!dir.exp && !modifiers.length) context.onError(createCompilerError(35, loc));
|
|
15294
15476
|
let eventName;
|
|
15295
|
-
if (arg.type === 4)
|
|
15296
|
-
|
|
15297
|
-
|
|
15298
|
-
|
|
15299
|
-
|
|
15300
|
-
|
|
15301
|
-
|
|
15302
|
-
|
|
15303
|
-
|
|
15304
|
-
|
|
15305
|
-
|
|
15477
|
+
if (arg.type === 4) {
|
|
15478
|
+
if (arg.isStatic) {
|
|
15479
|
+
let rawName = arg.content;
|
|
15480
|
+
if (rawName.startsWith("vnode")) context.onError(createCompilerError(52, arg.loc));
|
|
15481
|
+
if (rawName.startsWith("vue:")) rawName = `vnode-${rawName.slice(4)}`;
|
|
15482
|
+
eventName = createSimpleExpression(node.tagType !== 0 || rawName.startsWith("vnode") || !/[A-Z]/.test(rawName) ? toHandlerKey(camelize(rawName)) : `on:${rawName}`, true, arg.loc);
|
|
15483
|
+
} else eventName = createCompoundExpression([
|
|
15484
|
+
`${context.helperString(TO_HANDLER_KEY)}(`,
|
|
15485
|
+
arg,
|
|
15486
|
+
`)`
|
|
15487
|
+
]);
|
|
15488
|
+
} else {
|
|
15306
15489
|
eventName = arg;
|
|
15307
15490
|
eventName.children.unshift(`${context.helperString(TO_HANDLER_KEY)}(`);
|
|
15308
15491
|
eventName.children.push(`)`);
|
|
@@ -15338,11 +15521,14 @@ const transformBind = (dir, _node, context) => {
|
|
|
15338
15521
|
arg.children.unshift(`(`);
|
|
15339
15522
|
arg.children.push(`) || ""`);
|
|
15340
15523
|
} else if (!arg.isStatic) arg.content = arg.content ? `${arg.content} || ""` : `""`;
|
|
15341
|
-
if (modifiers.some((mod) => mod.content === "camel"))
|
|
15342
|
-
|
|
15343
|
-
|
|
15344
|
-
|
|
15345
|
-
|
|
15524
|
+
if (modifiers.some((mod) => mod.content === "camel")) {
|
|
15525
|
+
if (arg.type === 4) {
|
|
15526
|
+
if (arg.isStatic) arg.content = camelize(arg.content);
|
|
15527
|
+
else arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`;
|
|
15528
|
+
} else {
|
|
15529
|
+
arg.children.unshift(`${context.helperString(CAMELIZE)}(`);
|
|
15530
|
+
arg.children.push(`)`);
|
|
15531
|
+
}
|
|
15346
15532
|
}
|
|
15347
15533
|
if (!context.inSSR) {
|
|
15348
15534
|
if (modifiers.some((mod) => mod.content === "prop")) injectPrefix(arg, ".");
|
|
@@ -15351,9 +15537,10 @@ const transformBind = (dir, _node, context) => {
|
|
|
15351
15537
|
return { props: [createObjectProperty(arg, exp)] };
|
|
15352
15538
|
};
|
|
15353
15539
|
const injectPrefix = (arg, prefix) => {
|
|
15354
|
-
if (arg.type === 4)
|
|
15355
|
-
|
|
15356
|
-
|
|
15540
|
+
if (arg.type === 4) {
|
|
15541
|
+
if (arg.isStatic) arg.content = prefix + arg.content;
|
|
15542
|
+
else arg.content = `\`${prefix}\${${arg.content}}\``;
|
|
15543
|
+
} else {
|
|
15357
15544
|
arg.children.unshift(`'${prefix}' + (`);
|
|
15358
15545
|
arg.children.push(`)`);
|
|
15359
15546
|
}
|
|
@@ -15500,11 +15687,12 @@ function parseFilter(node, context) {
|
|
|
15500
15687
|
if (c === 96 && prev !== 92) inTemplateString = false;
|
|
15501
15688
|
} else if (inRegex) {
|
|
15502
15689
|
if (c === 47 && prev !== 92) inRegex = false;
|
|
15503
|
-
} else if (c === 124 && exp.charCodeAt(i + 1) !== 124 && exp.charCodeAt(i - 1) !== 124 && !curly && !square && !paren)
|
|
15504
|
-
|
|
15505
|
-
|
|
15506
|
-
|
|
15507
|
-
|
|
15690
|
+
} else if (c === 124 && exp.charCodeAt(i + 1) !== 124 && exp.charCodeAt(i - 1) !== 124 && !curly && !square && !paren) {
|
|
15691
|
+
if (expression === void 0) {
|
|
15692
|
+
lastFilterIndex = i + 1;
|
|
15693
|
+
expression = exp.slice(0, i).trim();
|
|
15694
|
+
} else pushFilter();
|
|
15695
|
+
} else {
|
|
15508
15696
|
switch (c) {
|
|
15509
15697
|
case 34:
|
|
15510
15698
|
inDouble = true;
|
|
@@ -15530,9 +15718,7 @@ function parseFilter(node, context) {
|
|
|
15530
15718
|
case 123:
|
|
15531
15719
|
curly++;
|
|
15532
15720
|
break;
|
|
15533
|
-
case 125:
|
|
15534
|
-
curly--;
|
|
15535
|
-
break;
|
|
15721
|
+
case 125: curly--;
|
|
15536
15722
|
}
|
|
15537
15723
|
if (c === 47) {
|
|
15538
15724
|
let j = i - 1;
|
|
@@ -15808,9 +15994,7 @@ const transformModel = (dir, node, context) => {
|
|
|
15808
15994
|
isInvalidType = true;
|
|
15809
15995
|
context.onError(createDOMCompilerError(60, dir.loc));
|
|
15810
15996
|
break;
|
|
15811
|
-
default:
|
|
15812
|
-
checkDuplicatedValue();
|
|
15813
|
-
break;
|
|
15997
|
+
default: checkDuplicatedValue();
|
|
15814
15998
|
}
|
|
15815
15999
|
} else if (hasDynamicKeyVBind(node)) directiveToUse = V_MODEL_DYNAMIC;
|
|
15816
16000
|
else checkDuplicatedValue();
|
|
@@ -15823,10 +16007,10 @@ const transformModel = (dir, node, context) => {
|
|
|
15823
16007
|
};
|
|
15824
16008
|
//#endregion
|
|
15825
16009
|
//#region packages/compiler-dom/src/transforms/vOn.ts
|
|
15826
|
-
const isEventOptionModifier =
|
|
15827
|
-
const isNonKeyModifier =
|
|
15828
|
-
const maybeKeyModifier =
|
|
15829
|
-
const isKeyboardEvent =
|
|
16010
|
+
const isEventOptionModifier = /*@__PURE__*/ makeMap(`passive,once,capture`);
|
|
16011
|
+
const isNonKeyModifier = /*@__PURE__*/ makeMap("stop,prevent,self,ctrl,shift,alt,meta,exact,middle");
|
|
16012
|
+
const maybeKeyModifier = /*@__PURE__*/ makeMap("left,right");
|
|
16013
|
+
const isKeyboardEvent = /*@__PURE__*/ makeMap(`onkeyup,onkeydown,onkeypress`);
|
|
15830
16014
|
const resolveModifiers = (key, modifiers, context, loc) => {
|
|
15831
16015
|
const keyModifiers = [];
|
|
15832
16016
|
const nonKeyModifiers = [];
|
|
@@ -15845,13 +16029,15 @@ const resolveModifiers = (key, modifiers, context, loc) => {
|
|
|
15845
16029
|
else if (isEventOptionModifier(modifier)) eventOptionModifiers.push(modifier);
|
|
15846
16030
|
else {
|
|
15847
16031
|
const keyString = isString(key) ? key : isStaticExp(key) ? key.content : null;
|
|
15848
|
-
if (maybeKeyModifier(modifier))
|
|
15849
|
-
|
|
15850
|
-
|
|
15851
|
-
|
|
15852
|
-
|
|
15853
|
-
|
|
15854
|
-
|
|
16032
|
+
if (maybeKeyModifier(modifier)) {
|
|
16033
|
+
if (keyString) {
|
|
16034
|
+
if (isKeyboardEvent(keyString.toLowerCase())) keyModifiers.push(modifier);
|
|
16035
|
+
else nonKeyModifiers.push(modifier);
|
|
16036
|
+
} else {
|
|
16037
|
+
keyModifiers.push(modifier);
|
|
16038
|
+
nonKeyModifiers.push(modifier);
|
|
16039
|
+
}
|
|
16040
|
+
} else if (isNonKeyModifier(modifier)) nonKeyModifiers.push(modifier);
|
|
15855
16041
|
else keyModifiers.push(modifier);
|
|
15856
16042
|
}
|
|
15857
16043
|
}
|
|
@@ -15966,7 +16152,7 @@ function isValidHTMLNesting(parent, child) {
|
|
|
15966
16152
|
}
|
|
15967
16153
|
return true;
|
|
15968
16154
|
}
|
|
15969
|
-
const headings = new Set([
|
|
16155
|
+
const headings = /* @__PURE__ */ new Set([
|
|
15970
16156
|
"h1",
|
|
15971
16157
|
"h2",
|
|
15972
16158
|
"h3",
|
|
@@ -15978,7 +16164,7 @@ const emptySet = /* @__PURE__ */ new Set([]);
|
|
|
15978
16164
|
/**
|
|
15979
16165
|
* maps element to set of elements that can be it's children, no other */
|
|
15980
16166
|
const onlyValidChildren = {
|
|
15981
|
-
head: new Set([
|
|
16167
|
+
head: /* @__PURE__ */ new Set([
|
|
15982
16168
|
"base",
|
|
15983
16169
|
"basefront",
|
|
15984
16170
|
"bgsound",
|
|
@@ -15991,24 +16177,24 @@ const onlyValidChildren = {
|
|
|
15991
16177
|
"script",
|
|
15992
16178
|
"template"
|
|
15993
16179
|
]),
|
|
15994
|
-
optgroup: new Set(["option"]),
|
|
15995
|
-
select: new Set([
|
|
16180
|
+
optgroup: /* @__PURE__ */ new Set(["option"]),
|
|
16181
|
+
select: /* @__PURE__ */ new Set([
|
|
15996
16182
|
"optgroup",
|
|
15997
16183
|
"option",
|
|
15998
16184
|
"hr"
|
|
15999
16185
|
]),
|
|
16000
|
-
table: new Set([
|
|
16186
|
+
table: /* @__PURE__ */ new Set([
|
|
16001
16187
|
"caption",
|
|
16002
16188
|
"colgroup",
|
|
16003
16189
|
"tbody",
|
|
16004
16190
|
"tfoot",
|
|
16005
16191
|
"thead"
|
|
16006
16192
|
]),
|
|
16007
|
-
tr: new Set(["td", "th"]),
|
|
16008
|
-
colgroup: new Set(["col"]),
|
|
16009
|
-
tbody: new Set(["tr"]),
|
|
16010
|
-
thead: new Set(["tr"]),
|
|
16011
|
-
tfoot: new Set(["tr"]),
|
|
16193
|
+
tr: /* @__PURE__ */ new Set(["td", "th"]),
|
|
16194
|
+
colgroup: /* @__PURE__ */ new Set(["col"]),
|
|
16195
|
+
tbody: /* @__PURE__ */ new Set(["tr"]),
|
|
16196
|
+
thead: /* @__PURE__ */ new Set(["tr"]),
|
|
16197
|
+
tfoot: /* @__PURE__ */ new Set(["tr"]),
|
|
16012
16198
|
script: emptySet,
|
|
16013
16199
|
iframe: emptySet,
|
|
16014
16200
|
option: emptySet,
|
|
@@ -16019,30 +16205,30 @@ const onlyValidChildren = {
|
|
|
16019
16205
|
/** maps elements to set of elements which can be it's parent, no other */
|
|
16020
16206
|
const onlyValidParents = {
|
|
16021
16207
|
html: emptySet,
|
|
16022
|
-
body: new Set(["html"]),
|
|
16023
|
-
head: new Set(["html"]),
|
|
16024
|
-
td: new Set(["tr"]),
|
|
16025
|
-
colgroup: new Set(["table"]),
|
|
16026
|
-
caption: new Set(["table"]),
|
|
16027
|
-
tbody: new Set(["table"]),
|
|
16028
|
-
tfoot: new Set(["table"]),
|
|
16029
|
-
col: new Set(["colgroup"]),
|
|
16030
|
-
th: new Set(["tr"]),
|
|
16031
|
-
thead: new Set(["table"]),
|
|
16032
|
-
tr: new Set([
|
|
16208
|
+
body: /* @__PURE__ */ new Set(["html"]),
|
|
16209
|
+
head: /* @__PURE__ */ new Set(["html"]),
|
|
16210
|
+
td: /* @__PURE__ */ new Set(["tr"]),
|
|
16211
|
+
colgroup: /* @__PURE__ */ new Set(["table"]),
|
|
16212
|
+
caption: /* @__PURE__ */ new Set(["table"]),
|
|
16213
|
+
tbody: /* @__PURE__ */ new Set(["table"]),
|
|
16214
|
+
tfoot: /* @__PURE__ */ new Set(["table"]),
|
|
16215
|
+
col: /* @__PURE__ */ new Set(["colgroup"]),
|
|
16216
|
+
th: /* @__PURE__ */ new Set(["tr"]),
|
|
16217
|
+
thead: /* @__PURE__ */ new Set(["table"]),
|
|
16218
|
+
tr: /* @__PURE__ */ new Set([
|
|
16033
16219
|
"tbody",
|
|
16034
16220
|
"thead",
|
|
16035
16221
|
"tfoot"
|
|
16036
16222
|
]),
|
|
16037
|
-
dd: new Set(["dl", "div"]),
|
|
16038
|
-
dt: new Set(["dl", "div"]),
|
|
16039
|
-
figcaption: new Set(["figure"]),
|
|
16040
|
-
summary: new Set(["details"]),
|
|
16041
|
-
area: new Set(["map"])
|
|
16223
|
+
dd: /* @__PURE__ */ new Set(["dl", "div"]),
|
|
16224
|
+
dt: /* @__PURE__ */ new Set(["dl", "div"]),
|
|
16225
|
+
figcaption: /* @__PURE__ */ new Set(["figure"]),
|
|
16226
|
+
summary: /* @__PURE__ */ new Set(["details"]),
|
|
16227
|
+
area: /* @__PURE__ */ new Set(["map"])
|
|
16042
16228
|
};
|
|
16043
16229
|
/** maps element to set of elements that can not be it's children, others can */
|
|
16044
16230
|
const knownInvalidChildren = {
|
|
16045
|
-
p: new Set([
|
|
16231
|
+
p: /* @__PURE__ */ new Set([
|
|
16046
16232
|
"address",
|
|
16047
16233
|
"article",
|
|
16048
16234
|
"aside",
|
|
@@ -16077,7 +16263,7 @@ const knownInvalidChildren = {
|
|
|
16077
16263
|
"table",
|
|
16078
16264
|
"ul"
|
|
16079
16265
|
]),
|
|
16080
|
-
svg: new Set([
|
|
16266
|
+
svg: /* @__PURE__ */ new Set([
|
|
16081
16267
|
"b",
|
|
16082
16268
|
"blockquote",
|
|
16083
16269
|
"br",
|
|
@@ -16118,12 +16304,12 @@ const knownInvalidChildren = {
|
|
|
16118
16304
|
};
|
|
16119
16305
|
/** maps element to set of elements that can not be it's parent, others can */
|
|
16120
16306
|
const knownInvalidParents = {
|
|
16121
|
-
a: new Set(["a"]),
|
|
16122
|
-
button: new Set(["button"]),
|
|
16123
|
-
dd: new Set(["dd", "dt"]),
|
|
16124
|
-
dt: new Set(["dd", "dt"]),
|
|
16125
|
-
form: new Set(["form"]),
|
|
16126
|
-
li: new Set(["li"]),
|
|
16307
|
+
a: /* @__PURE__ */ new Set(["a"]),
|
|
16308
|
+
button: /* @__PURE__ */ new Set(["button"]),
|
|
16309
|
+
dd: /* @__PURE__ */ new Set(["dd", "dt"]),
|
|
16310
|
+
dt: /* @__PURE__ */ new Set(["dd", "dt"]),
|
|
16311
|
+
form: /* @__PURE__ */ new Set(["form"]),
|
|
16312
|
+
li: /* @__PURE__ */ new Set(["li"]),
|
|
16127
16313
|
h1: headings,
|
|
16128
16314
|
h2: headings,
|
|
16129
16315
|
h3: headings,
|
|
@@ -16166,10 +16352,12 @@ function compile(src, options = {}) {
|
|
|
16166
16352
|
//#region packages/vue-compat/src/index.ts
|
|
16167
16353
|
const compileCache = Object.create(null);
|
|
16168
16354
|
function compileToFunction(template, options) {
|
|
16169
|
-
if (!isString(template))
|
|
16170
|
-
|
|
16171
|
-
|
|
16172
|
-
|
|
16355
|
+
if (!isString(template)) {
|
|
16356
|
+
if (template.nodeType) template = template.innerHTML;
|
|
16357
|
+
else {
|
|
16358
|
+
warn(`invalid template option: `, template);
|
|
16359
|
+
return NOOP;
|
|
16360
|
+
}
|
|
16173
16361
|
}
|
|
16174
16362
|
const key = genCacheKey(template, options);
|
|
16175
16363
|
const cached = compileCache[key];
|