@vue/compat 3.6.0-beta.9 → 3.6.0-rc.10
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/README.md +2 -2
- package/dist/vue-compat.d.ts +748 -679
- package/dist/vue.cjs.js +1667 -1044
- package/dist/vue.cjs.prod.js +1409 -889
- package/dist/vue.esm-browser.js +1550 -987
- package/dist/vue.esm-browser.prod.js +7 -6
- package/dist/vue.esm-bundler.js +1632 -1011
- package/dist/vue.global.js +1550 -987
- package/dist/vue.global.prod.js +7 -6
- package/dist/vue.runtime.esm-browser.js +1550 -987
- package/dist/vue.runtime.esm-browser.prod.js +7 -6
- package/dist/vue.runtime.esm-bundler.js +1632 -1011
- package/dist/vue.runtime.global.js +1550 -987
- package/dist/vue.runtime.global.prod.js +7 -6
- package/package.json +3 -3
package/dist/vue.global.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compat v3.6.0-
|
|
2
|
+
* @vue/compat v3.6.0-rc.10
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -24,7 +24,7 @@ var Vue = (function() {
|
|
|
24
24
|
* \/\*#\_\_PURE\_\_\*\/
|
|
25
25
|
* So that they can be tree-shaken if necessary.
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
28
28
|
function makeMap(str) {
|
|
29
29
|
const map = Object.create(null);
|
|
30
30
|
for (const key of str.split(",")) map[key] = 1;
|
|
@@ -68,9 +68,9 @@ var Vue = (function() {
|
|
|
68
68
|
};
|
|
69
69
|
const isPlainObject = (val) => toTypeString(val) === "[object Object]";
|
|
70
70
|
const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
|
|
71
|
-
const isReservedProp =
|
|
72
|
-
const isBuiltInTag =
|
|
73
|
-
const isBuiltInDirective =
|
|
71
|
+
const isReservedProp = /*@__PURE__*/ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
|
|
72
|
+
const isBuiltInTag = /*#__PURE__*/ makeMap("slot,component");
|
|
73
|
+
const isBuiltInDirective = /*@__PURE__*/ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
|
|
74
74
|
const cacheStringFunction = (fn) => {
|
|
75
75
|
const cache = Object.create(null);
|
|
76
76
|
return ((str) => {
|
|
@@ -178,7 +178,7 @@ var Vue = (function() {
|
|
|
178
178
|
[2]: "DYNAMIC",
|
|
179
179
|
[3]: "FORWARDED"
|
|
180
180
|
};
|
|
181
|
-
const isGloballyAllowed =
|
|
181
|
+
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");
|
|
182
182
|
//#endregion
|
|
183
183
|
//#region packages/shared/src/codeframe.ts
|
|
184
184
|
const range = 2;
|
|
@@ -232,10 +232,10 @@ var Vue = (function() {
|
|
|
232
232
|
}
|
|
233
233
|
const listDelimiterRE = /;(?![^(]*\))/g;
|
|
234
234
|
const propertyDelimiterRE = /:([^]+)/;
|
|
235
|
-
const styleCommentRE =
|
|
235
|
+
const styleCommentRE = /"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;
|
|
236
236
|
function parseStringStyle(cssText) {
|
|
237
237
|
const ret = {};
|
|
238
|
-
cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
|
|
238
|
+
cssText.replace(styleCommentRE, (match) => match.startsWith("/*") ? "" : match).split(listDelimiterRE).forEach((item) => {
|
|
239
239
|
if (item) {
|
|
240
240
|
const tmp = item.split(propertyDelimiterRE);
|
|
241
241
|
tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
|
|
@@ -285,22 +285,22 @@ var Vue = (function() {
|
|
|
285
285
|
* Compiler only.
|
|
286
286
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
287
287
|
*/
|
|
288
|
-
const isHTMLTag =
|
|
288
|
+
const isHTMLTag = /*@__PURE__*/ makeMap(HTML_TAGS);
|
|
289
289
|
/**
|
|
290
290
|
* Compiler only.
|
|
291
291
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
292
292
|
*/
|
|
293
|
-
const isSVGTag =
|
|
293
|
+
const isSVGTag = /*@__PURE__*/ makeMap(SVG_TAGS);
|
|
294
294
|
/**
|
|
295
295
|
* Compiler only.
|
|
296
296
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
297
297
|
*/
|
|
298
|
-
const isMathMLTag =
|
|
298
|
+
const isMathMLTag = /*@__PURE__*/ makeMap(MATH_TAGS);
|
|
299
299
|
/**
|
|
300
300
|
* Compiler only.
|
|
301
301
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
302
302
|
*/
|
|
303
|
-
const isVoidTag =
|
|
303
|
+
const isVoidTag = /*@__PURE__*/ makeMap(VOID_TAGS);
|
|
304
304
|
//#endregion
|
|
305
305
|
//#region packages/shared/src/domAttrConfig.ts
|
|
306
306
|
/**
|
|
@@ -315,11 +315,11 @@ var Vue = (function() {
|
|
|
315
315
|
* - readonly -> readOnly
|
|
316
316
|
*/
|
|
317
317
|
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
|
|
318
|
-
const isSpecialBooleanAttr =
|
|
318
|
+
const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
|
|
319
319
|
/**
|
|
320
320
|
* The full list is needed during SSR to produce the correct initial markup.
|
|
321
321
|
*/
|
|
322
|
-
const isBooleanAttr =
|
|
322
|
+
const isBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
|
|
323
323
|
/**
|
|
324
324
|
* Boolean attributes should be included if the value is truthy or ''.
|
|
325
325
|
* e.g. `<select multiple>` compiles to `{ multiple: '' }`
|
|
@@ -333,11 +333,11 @@ var Vue = (function() {
|
|
|
333
333
|
* Don't also forget to allow `data-*` and `aria-*`!
|
|
334
334
|
* Generated from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes
|
|
335
335
|
*/
|
|
336
|
-
const isKnownHtmlAttr =
|
|
336
|
+
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");
|
|
337
337
|
/**
|
|
338
338
|
* Generated from https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
|
|
339
339
|
*/
|
|
340
|
-
const isKnownSvgAttr =
|
|
340
|
+
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");
|
|
341
341
|
/**
|
|
342
342
|
* Shared between server-renderer and runtime-core hydration logic
|
|
343
343
|
*/
|
|
@@ -363,13 +363,54 @@ var Vue = (function() {
|
|
|
363
363
|
}
|
|
364
364
|
//#endregion
|
|
365
365
|
//#region packages/shared/src/looseEqual.ts
|
|
366
|
-
function looseCompareArrays(a, b) {
|
|
366
|
+
function looseCompareArrays(a, b, seen) {
|
|
367
367
|
if (a.length !== b.length) return false;
|
|
368
368
|
let equal = true;
|
|
369
|
-
for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i]);
|
|
369
|
+
for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i], seen);
|
|
370
370
|
return equal;
|
|
371
371
|
}
|
|
372
|
-
function
|
|
372
|
+
function looseCompareCollections(a, b, seen) {
|
|
373
|
+
if (a.size !== b.size) return false;
|
|
374
|
+
const candidates = Array.from(b);
|
|
375
|
+
const matched = new Uint8Array(candidates.length);
|
|
376
|
+
for (const item of a) {
|
|
377
|
+
let index = -1;
|
|
378
|
+
for (let i = 0; i < candidates.length; i++) if (!matched[i] && looseEqual(item, candidates[i], seen)) {
|
|
379
|
+
index = i;
|
|
380
|
+
break;
|
|
381
|
+
}
|
|
382
|
+
if (index < 0) return false;
|
|
383
|
+
matched[index] = 1;
|
|
384
|
+
}
|
|
385
|
+
return true;
|
|
386
|
+
}
|
|
387
|
+
function looseCompareObjects(a, b, seen) {
|
|
388
|
+
let aValidType = isMap(a);
|
|
389
|
+
let bValidType = isMap(b);
|
|
390
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
|
|
391
|
+
aValidType = isSet(a);
|
|
392
|
+
bValidType = isSet(b);
|
|
393
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
|
|
394
|
+
if (Object.keys(a).length !== Object.keys(b).length) return false;
|
|
395
|
+
for (const key in a) {
|
|
396
|
+
const aHasKey = a.hasOwnProperty(key);
|
|
397
|
+
const bHasKey = b.hasOwnProperty(key);
|
|
398
|
+
if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key], seen)) return false;
|
|
399
|
+
}
|
|
400
|
+
return String(a) === String(b);
|
|
401
|
+
}
|
|
402
|
+
function looseCompareNested(a, b, seen, compare) {
|
|
403
|
+
if (!seen) seen = [/* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()];
|
|
404
|
+
const [seenA, seenB] = seen;
|
|
405
|
+
if (seenA.has(a) || seenB.has(b)) return seenA.get(a) === b && seenB.get(b) === a;
|
|
406
|
+
seenA.set(a, b);
|
|
407
|
+
seenB.set(b, a);
|
|
408
|
+
const equal = compare(a, b, seen);
|
|
409
|
+
seenA.delete(a);
|
|
410
|
+
seenB.delete(b);
|
|
411
|
+
return equal;
|
|
412
|
+
}
|
|
413
|
+
function looseEqual(a, b, seen) {
|
|
373
414
|
if (a === b) return true;
|
|
374
415
|
let aValidType = isDate(a);
|
|
375
416
|
let bValidType = isDate(b);
|
|
@@ -379,17 +420,12 @@ var Vue = (function() {
|
|
|
379
420
|
if (aValidType || bValidType) return a === b;
|
|
380
421
|
aValidType = isArray(a);
|
|
381
422
|
bValidType = isArray(b);
|
|
382
|
-
if (aValidType || bValidType) return aValidType && bValidType ?
|
|
423
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareNested(a, b, seen, looseCompareArrays) : false;
|
|
383
424
|
aValidType = isObject(a);
|
|
384
425
|
bValidType = isObject(b);
|
|
385
426
|
if (aValidType || bValidType) {
|
|
386
427
|
if (!aValidType || !bValidType) return false;
|
|
387
|
-
|
|
388
|
-
for (const key in a) {
|
|
389
|
-
const aHasKey = a.hasOwnProperty(key);
|
|
390
|
-
const bHasKey = b.hasOwnProperty(key);
|
|
391
|
-
if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) return false;
|
|
392
|
-
}
|
|
428
|
+
return looseCompareNested(a, b, seen, looseCompareObjects);
|
|
393
429
|
}
|
|
394
430
|
return String(a) === String(b);
|
|
395
431
|
}
|
|
@@ -519,9 +555,18 @@ var Vue = (function() {
|
|
|
519
555
|
function warn$2(msg, ...args) {
|
|
520
556
|
console.warn(`[Vue warn] ${msg}`, ...args);
|
|
521
557
|
}
|
|
558
|
+
//#endregion
|
|
559
|
+
//#region packages/reactivity/src/system.ts
|
|
522
560
|
const notifyBuffer = [];
|
|
523
561
|
let batchDepth = 0;
|
|
524
562
|
let activeSub = void 0;
|
|
563
|
+
let runDepth = 0;
|
|
564
|
+
function incRunDepth() {
|
|
565
|
+
++runDepth;
|
|
566
|
+
}
|
|
567
|
+
function decRunDepth() {
|
|
568
|
+
--runDepth;
|
|
569
|
+
}
|
|
525
570
|
let globalVersion = 0;
|
|
526
571
|
let notifyIndex = 0;
|
|
527
572
|
let notifyBufferLength = 0;
|
|
@@ -595,8 +640,10 @@ var Vue = (function() {
|
|
|
595
640
|
const sub = link.sub;
|
|
596
641
|
let flags = sub.flags;
|
|
597
642
|
if (flags & 3) {
|
|
598
|
-
if (!(flags & 60))
|
|
599
|
-
|
|
643
|
+
if (!(flags & 60)) {
|
|
644
|
+
sub.flags = flags | 32;
|
|
645
|
+
if (runDepth) sub.flags |= 8;
|
|
646
|
+
} else if (!(flags & 12)) flags = 0;
|
|
600
647
|
else if (!(flags & 4)) sub.flags = flags & -9 | 32;
|
|
601
648
|
else if (!(flags & 48) && isValidLink(link, sub)) {
|
|
602
649
|
sub.flags = flags | 40;
|
|
@@ -648,13 +695,23 @@ var Vue = (function() {
|
|
|
648
695
|
sub.flags &= -5;
|
|
649
696
|
}
|
|
650
697
|
function flush() {
|
|
698
|
+
let hasError = false;
|
|
699
|
+
let error;
|
|
651
700
|
while (notifyIndex < notifyBufferLength) {
|
|
652
701
|
const effect = notifyBuffer[notifyIndex];
|
|
653
702
|
notifyBuffer[notifyIndex++] = void 0;
|
|
654
|
-
|
|
703
|
+
try {
|
|
704
|
+
effect.notify();
|
|
705
|
+
} catch (err) {
|
|
706
|
+
if (!hasError) {
|
|
707
|
+
hasError = true;
|
|
708
|
+
error = err;
|
|
709
|
+
}
|
|
710
|
+
}
|
|
655
711
|
}
|
|
656
712
|
notifyIndex = 0;
|
|
657
713
|
notifyBufferLength = 0;
|
|
714
|
+
if (hasError) throw error;
|
|
658
715
|
}
|
|
659
716
|
function checkDirty(link, sub) {
|
|
660
717
|
let stack;
|
|
@@ -665,13 +722,13 @@ var Vue = (function() {
|
|
|
665
722
|
let dirty = false;
|
|
666
723
|
if (sub.flags & 16) dirty = true;
|
|
667
724
|
else if ((depFlags & 17) === 17) {
|
|
725
|
+
const subs = dep.subs;
|
|
668
726
|
if (dep.update()) {
|
|
669
|
-
const subs = dep.subs;
|
|
670
727
|
if (subs.nextSub !== void 0) shallowPropagate(subs);
|
|
671
728
|
dirty = true;
|
|
672
729
|
}
|
|
673
730
|
} else if ((depFlags & 33) === 33) {
|
|
674
|
-
|
|
731
|
+
stack = {
|
|
675
732
|
value: link,
|
|
676
733
|
prev: stack
|
|
677
734
|
};
|
|
@@ -686,15 +743,12 @@ var Vue = (function() {
|
|
|
686
743
|
}
|
|
687
744
|
while (checkDepth) {
|
|
688
745
|
--checkDepth;
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
if (hasMultipleSubs) {
|
|
692
|
-
link = stack.value;
|
|
693
|
-
stack = stack.prev;
|
|
694
|
-
} else link = firstSub;
|
|
746
|
+
link = stack.value;
|
|
747
|
+
stack = stack.prev;
|
|
695
748
|
if (dirty) {
|
|
749
|
+
const subs = sub.subs;
|
|
696
750
|
if (sub.update()) {
|
|
697
|
-
if (
|
|
751
|
+
if (subs.nextSub !== void 0) shallowPropagate(subs);
|
|
698
752
|
sub = link.sub;
|
|
699
753
|
continue;
|
|
700
754
|
}
|
|
@@ -706,7 +760,7 @@ var Vue = (function() {
|
|
|
706
760
|
}
|
|
707
761
|
dirty = false;
|
|
708
762
|
}
|
|
709
|
-
return dirty;
|
|
763
|
+
return dirty && !!sub.flags;
|
|
710
764
|
} while (true);
|
|
711
765
|
}
|
|
712
766
|
function shallowPropagate(link) {
|
|
@@ -741,7 +795,7 @@ var Vue = (function() {
|
|
|
741
795
|
}
|
|
742
796
|
set subs(value) {
|
|
743
797
|
this._subs = value;
|
|
744
|
-
if (value === void 0) this.map.delete(this.key);
|
|
798
|
+
if (value === void 0 && this.map) this.map.delete(this.key);
|
|
745
799
|
}
|
|
746
800
|
};
|
|
747
801
|
const targetMap = /* @__PURE__ */ new WeakMap();
|
|
@@ -824,9 +878,7 @@ var Vue = (function() {
|
|
|
824
878
|
if (isMap(target)) run(depsMap.get(MAP_KEY_ITERATE_KEY));
|
|
825
879
|
}
|
|
826
880
|
break;
|
|
827
|
-
case "set":
|
|
828
|
-
if (isMap(target)) run(depsMap.get(ITERATE_KEY));
|
|
829
|
-
break;
|
|
881
|
+
case "set": if (isMap(target)) run(depsMap.get(ITERATE_KEY));
|
|
830
882
|
}
|
|
831
883
|
}
|
|
832
884
|
}
|
|
@@ -841,13 +893,17 @@ var Vue = (function() {
|
|
|
841
893
|
/**
|
|
842
894
|
* Track array iteration and return:
|
|
843
895
|
* - if input is reactive: a cloned raw array with reactive values
|
|
844
|
-
* - if input is
|
|
896
|
+
* - if input is readonly: a cloned raw array with readonly values, preserving
|
|
897
|
+
* reactivity
|
|
898
|
+
* - if input is raw or shallow: the original raw array
|
|
845
899
|
*/
|
|
846
900
|
function reactiveReadArray(array) {
|
|
847
901
|
const raw = /* @__PURE__ */ toRaw(array);
|
|
848
902
|
if (raw === array) return raw;
|
|
849
903
|
track(raw, "iterate", ARRAY_ITERATE_KEY);
|
|
850
|
-
|
|
904
|
+
if (/* @__PURE__ */ isShallow(array)) return raw;
|
|
905
|
+
if (!/* @__PURE__ */ isReadonly(array)) return raw.map(toReactive);
|
|
906
|
+
return /* @__PURE__ */ isReactive(array) ? raw.map((item) => toReadonly(toReactive(item))) : raw.map(toReadonly);
|
|
851
907
|
}
|
|
852
908
|
/**
|
|
853
909
|
* Track array iteration and return raw array
|
|
@@ -1023,8 +1079,8 @@ var Vue = (function() {
|
|
|
1023
1079
|
}
|
|
1024
1080
|
//#endregion
|
|
1025
1081
|
//#region packages/reactivity/src/baseHandlers.ts
|
|
1026
|
-
const isNonTrackableKeys =
|
|
1027
|
-
const builtInSymbols = new Set(
|
|
1082
|
+
const isNonTrackableKeys = /*@__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);
|
|
1083
|
+
const builtInSymbols = new Set(/*@__PURE__*/ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
|
|
1028
1084
|
function hasOwnProperty(key) {
|
|
1029
1085
|
if (!isSymbol(key)) key = String(key);
|
|
1030
1086
|
const obj = /* @__PURE__ */ toRaw(this);
|
|
@@ -1079,17 +1135,19 @@ var Vue = (function() {
|
|
|
1079
1135
|
oldValue = /* @__PURE__ */ toRaw(oldValue);
|
|
1080
1136
|
value = /* @__PURE__ */ toRaw(value);
|
|
1081
1137
|
}
|
|
1082
|
-
if (!isArrayWithIntegerKey && /* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value))
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1138
|
+
if (!isArrayWithIntegerKey && /* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value)) {
|
|
1139
|
+
if (isOldValueReadonly) {
|
|
1140
|
+
warn$2(`Set operation on key "${String(key)}" failed: target is readonly.`, target[key]);
|
|
1141
|
+
return true;
|
|
1142
|
+
} else {
|
|
1143
|
+
oldValue.value = value;
|
|
1144
|
+
return true;
|
|
1145
|
+
}
|
|
1088
1146
|
}
|
|
1089
1147
|
}
|
|
1090
1148
|
const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
|
|
1091
1149
|
const result = Reflect.set(target, key, value, /* @__PURE__ */ isRef(target) ? target : receiver);
|
|
1092
|
-
if (target === /* @__PURE__ */ toRaw(receiver)) {
|
|
1150
|
+
if (target === /* @__PURE__ */ toRaw(receiver) && result) {
|
|
1093
1151
|
if (!hadKey) trigger(target, "add", key, value);
|
|
1094
1152
|
else if (hasChanged(value, oldValue)) trigger(target, "set", key, value, oldValue);
|
|
1095
1153
|
}
|
|
@@ -1125,10 +1183,10 @@ var Vue = (function() {
|
|
|
1125
1183
|
return true;
|
|
1126
1184
|
}
|
|
1127
1185
|
};
|
|
1128
|
-
const mutableHandlers =
|
|
1129
|
-
const readonlyHandlers =
|
|
1130
|
-
const shallowReactiveHandlers =
|
|
1131
|
-
const shallowReadonlyHandlers =
|
|
1186
|
+
const mutableHandlers = /*@__PURE__*/ new MutableReactiveHandler();
|
|
1187
|
+
const readonlyHandlers = /*@__PURE__*/ new ReadonlyReactiveHandler();
|
|
1188
|
+
const shallowReactiveHandlers = /*@__PURE__*/ new MutableReactiveHandler(true);
|
|
1189
|
+
const shallowReadonlyHandlers = /*@__PURE__*/ new ReadonlyReactiveHandler(true);
|
|
1132
1190
|
//#endregion
|
|
1133
1191
|
//#region packages/reactivity/src/collectionHandlers.ts
|
|
1134
1192
|
const toShallow = (value) => value;
|
|
@@ -1279,10 +1337,10 @@ var Vue = (function() {
|
|
|
1279
1337
|
return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
|
|
1280
1338
|
};
|
|
1281
1339
|
}
|
|
1282
|
-
const mutableCollectionHandlers = { get:
|
|
1283
|
-
const shallowCollectionHandlers = { get:
|
|
1284
|
-
const readonlyCollectionHandlers = { get:
|
|
1285
|
-
const shallowReadonlyCollectionHandlers = { get:
|
|
1340
|
+
const mutableCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(false, false) };
|
|
1341
|
+
const shallowCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(false, true) };
|
|
1342
|
+
const readonlyCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(true, false) };
|
|
1343
|
+
const shallowReadonlyCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(true, true) };
|
|
1286
1344
|
function checkIdentityKeys(target, has, key) {
|
|
1287
1345
|
const rawKey = /* @__PURE__ */ toRaw(key);
|
|
1288
1346
|
if (rawKey !== key && has.call(target, rawKey)) {
|
|
@@ -1307,10 +1365,7 @@ var Vue = (function() {
|
|
|
1307
1365
|
default: return 0;
|
|
1308
1366
|
}
|
|
1309
1367
|
}
|
|
1310
|
-
|
|
1311
|
-
return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
|
|
1312
|
-
}
|
|
1313
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
1368
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1314
1369
|
function reactive(target) {
|
|
1315
1370
|
if (/* @__PURE__ */ isReadonly(target)) return target;
|
|
1316
1371
|
return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
|
|
@@ -1345,7 +1400,7 @@ var Vue = (function() {
|
|
|
1345
1400
|
* @param target - The source object.
|
|
1346
1401
|
* @see {@link https://vuejs.org/api/reactivity-advanced.html#shallowreactive}
|
|
1347
1402
|
*/
|
|
1348
|
-
|
|
1403
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1349
1404
|
function shallowReactive(target) {
|
|
1350
1405
|
return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap);
|
|
1351
1406
|
}
|
|
@@ -1378,7 +1433,7 @@ var Vue = (function() {
|
|
|
1378
1433
|
* @param target - The source object.
|
|
1379
1434
|
* @see {@link https://vuejs.org/api/reactivity-core.html#readonly}
|
|
1380
1435
|
*/
|
|
1381
|
-
|
|
1436
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1382
1437
|
function readonly(target) {
|
|
1383
1438
|
return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);
|
|
1384
1439
|
}
|
|
@@ -1412,7 +1467,7 @@ var Vue = (function() {
|
|
|
1412
1467
|
* @param target - The source object.
|
|
1413
1468
|
* @see {@link https://vuejs.org/api/reactivity-advanced.html#shallowreadonly}
|
|
1414
1469
|
*/
|
|
1415
|
-
|
|
1470
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1416
1471
|
function shallowReadonly(target) {
|
|
1417
1472
|
return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);
|
|
1418
1473
|
}
|
|
@@ -1422,10 +1477,11 @@ var Vue = (function() {
|
|
|
1422
1477
|
return target;
|
|
1423
1478
|
}
|
|
1424
1479
|
if (target["__v_raw"] && !(isReadonly && target["__v_isReactive"])) return target;
|
|
1425
|
-
|
|
1426
|
-
if (targetType === 0) return target;
|
|
1480
|
+
if (target["__v_skip"] || !Object.isExtensible(target)) return target;
|
|
1427
1481
|
const existingProxy = proxyMap.get(target);
|
|
1428
1482
|
if (existingProxy) return existingProxy;
|
|
1483
|
+
const targetType = targetTypeMap(toRawType(target));
|
|
1484
|
+
if (targetType === 0) return target;
|
|
1429
1485
|
const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
|
|
1430
1486
|
proxyMap.set(target, proxy);
|
|
1431
1487
|
return proxy;
|
|
@@ -1448,7 +1504,7 @@ var Vue = (function() {
|
|
|
1448
1504
|
* @param value - The value to check.
|
|
1449
1505
|
* @see {@link https://vuejs.org/api/reactivity-utilities.html#isreactive}
|
|
1450
1506
|
*/
|
|
1451
|
-
|
|
1507
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1452
1508
|
function isReactive(value) {
|
|
1453
1509
|
if (/* @__PURE__ */ isReadonly(value)) return /* @__PURE__ */ isReactive(value["__v_raw"]);
|
|
1454
1510
|
return !!(value && value["__v_isReactive"]);
|
|
@@ -1464,11 +1520,11 @@ var Vue = (function() {
|
|
|
1464
1520
|
* @param value - The value to check.
|
|
1465
1521
|
* @see {@link https://vuejs.org/api/reactivity-utilities.html#isreadonly}
|
|
1466
1522
|
*/
|
|
1467
|
-
|
|
1523
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1468
1524
|
function isReadonly(value) {
|
|
1469
1525
|
return !!(value && value["__v_isReadonly"]);
|
|
1470
1526
|
}
|
|
1471
|
-
|
|
1527
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1472
1528
|
function isShallow(value) {
|
|
1473
1529
|
return !!(value && value["__v_isShallow"]);
|
|
1474
1530
|
}
|
|
@@ -1479,7 +1535,7 @@ var Vue = (function() {
|
|
|
1479
1535
|
* @param value - The value to check.
|
|
1480
1536
|
* @see {@link https://vuejs.org/api/reactivity-utilities.html#isproxy}
|
|
1481
1537
|
*/
|
|
1482
|
-
|
|
1538
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1483
1539
|
function isProxy(value) {
|
|
1484
1540
|
return value ? !!value["__v_raw"] : false;
|
|
1485
1541
|
}
|
|
@@ -1506,7 +1562,7 @@ var Vue = (function() {
|
|
|
1506
1562
|
* @param observed - The object for which the "raw" value is requested.
|
|
1507
1563
|
* @see {@link https://vuejs.org/api/reactivity-advanced.html#toraw}
|
|
1508
1564
|
*/
|
|
1509
|
-
|
|
1565
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1510
1566
|
function toRaw(observed) {
|
|
1511
1567
|
const raw = observed && observed["__v_raw"];
|
|
1512
1568
|
return raw ? /* @__PURE__ */ toRaw(raw) : observed;
|
|
@@ -1555,15 +1611,15 @@ var Vue = (function() {
|
|
|
1555
1611
|
const toReadonly = (value) => isObject(value) ? /* @__PURE__ */ readonly(value) : value;
|
|
1556
1612
|
//#endregion
|
|
1557
1613
|
//#region packages/reactivity/src/ref.ts
|
|
1558
|
-
|
|
1614
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1559
1615
|
function isRef(r) {
|
|
1560
1616
|
return r ? r["__v_isRef"] === true : false;
|
|
1561
1617
|
}
|
|
1562
|
-
|
|
1618
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1563
1619
|
function ref(value) {
|
|
1564
1620
|
return createRef(value, toReactive);
|
|
1565
1621
|
}
|
|
1566
|
-
|
|
1622
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1567
1623
|
function shallowRef(value) {
|
|
1568
1624
|
return createRef(value);
|
|
1569
1625
|
}
|
|
@@ -1766,7 +1822,7 @@ var Vue = (function() {
|
|
|
1766
1822
|
* @param object - Reactive object to be made into an object of linked refs.
|
|
1767
1823
|
* @see {@link https://vuejs.org/api/reactivity-utilities.html#torefs}
|
|
1768
1824
|
*/
|
|
1769
|
-
|
|
1825
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1770
1826
|
function toRefs(object) {
|
|
1771
1827
|
const ret = isArray(object) ? new Array(object.length) : {};
|
|
1772
1828
|
for (const key in object) ret[key] = propertyToRef(object, key);
|
|
@@ -1817,7 +1873,7 @@ var Vue = (function() {
|
|
|
1817
1873
|
return this._value = this._getter();
|
|
1818
1874
|
}
|
|
1819
1875
|
};
|
|
1820
|
-
|
|
1876
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1821
1877
|
function toRef(source, key, defaultValue) {
|
|
1822
1878
|
if (/* @__PURE__ */ isRef(source)) return source;
|
|
1823
1879
|
else if (isFunction(source)) return new GetterRefImpl(source);
|
|
@@ -1858,9 +1914,11 @@ var Vue = (function() {
|
|
|
1858
1914
|
if (!this.active) return this.fn();
|
|
1859
1915
|
cleanup(this);
|
|
1860
1916
|
const prevSub = startTracking(this);
|
|
1917
|
+
incRunDepth();
|
|
1861
1918
|
try {
|
|
1862
1919
|
return this.fn();
|
|
1863
1920
|
} finally {
|
|
1921
|
+
decRunDepth();
|
|
1864
1922
|
endTracking(this, prevSub);
|
|
1865
1923
|
const flags = this.flags;
|
|
1866
1924
|
if ((flags & 136) === 136) {
|
|
@@ -1881,10 +1939,12 @@ var Vue = (function() {
|
|
|
1881
1939
|
get dirty() {
|
|
1882
1940
|
const flags = this.flags;
|
|
1883
1941
|
if (flags & 16) return true;
|
|
1884
|
-
if (flags & 32)
|
|
1885
|
-
this.
|
|
1886
|
-
|
|
1887
|
-
|
|
1942
|
+
if (flags & 32) {
|
|
1943
|
+
if (checkDirty(this.deps, this)) {
|
|
1944
|
+
this.flags = flags | 16;
|
|
1945
|
+
return true;
|
|
1946
|
+
} else this.flags = flags & -33;
|
|
1947
|
+
}
|
|
1888
1948
|
return false;
|
|
1889
1949
|
}
|
|
1890
1950
|
};
|
|
@@ -2063,10 +2123,12 @@ var Vue = (function() {
|
|
|
2063
2123
|
get _dirty() {
|
|
2064
2124
|
const flags = this.flags;
|
|
2065
2125
|
if (flags & 16) return true;
|
|
2066
|
-
if (flags & 32)
|
|
2067
|
-
this.
|
|
2068
|
-
|
|
2069
|
-
|
|
2126
|
+
if (flags & 32) {
|
|
2127
|
+
if (checkDirty(this.deps, this)) {
|
|
2128
|
+
this.flags = flags | 16;
|
|
2129
|
+
return true;
|
|
2130
|
+
} else this.flags = flags & -33;
|
|
2131
|
+
}
|
|
2070
2132
|
return false;
|
|
2071
2133
|
}
|
|
2072
2134
|
/**
|
|
@@ -2127,7 +2189,7 @@ var Vue = (function() {
|
|
|
2127
2189
|
}
|
|
2128
2190
|
};
|
|
2129
2191
|
setupOnTrigger(ComputedRefImpl);
|
|
2130
|
-
|
|
2192
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
2131
2193
|
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
2132
2194
|
let getter;
|
|
2133
2195
|
let setter;
|
|
@@ -2205,25 +2267,26 @@ var Vue = (function() {
|
|
|
2205
2267
|
else if (isFunction(s)) return call ? call(s, 2) : s();
|
|
2206
2268
|
else warnInvalidSource(s, onWarn);
|
|
2207
2269
|
});
|
|
2208
|
-
} else if (isFunction(source))
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2270
|
+
} else if (isFunction(source)) {
|
|
2271
|
+
if (cb) getter = call ? () => call(source, 2) : source;
|
|
2272
|
+
else getter = () => {
|
|
2273
|
+
if (this.cleanupsLength) {
|
|
2274
|
+
const prevSub = setActiveSub();
|
|
2275
|
+
try {
|
|
2276
|
+
cleanup(this);
|
|
2277
|
+
} finally {
|
|
2278
|
+
setActiveSub(prevSub);
|
|
2279
|
+
}
|
|
2280
|
+
}
|
|
2281
|
+
const currentEffect = activeWatcher;
|
|
2282
|
+
activeWatcher = this;
|
|
2212
2283
|
try {
|
|
2213
|
-
|
|
2284
|
+
return call ? call(source, 3, [this.boundCleanup]) : source(this.boundCleanup);
|
|
2214
2285
|
} finally {
|
|
2215
|
-
|
|
2286
|
+
activeWatcher = currentEffect;
|
|
2216
2287
|
}
|
|
2217
|
-
}
|
|
2218
|
-
|
|
2219
|
-
activeWatcher = this;
|
|
2220
|
-
try {
|
|
2221
|
-
return call ? call(source, 3, [this.boundCleanup]) : source(this.boundCleanup);
|
|
2222
|
-
} finally {
|
|
2223
|
-
activeWatcher = currentEffect;
|
|
2224
|
-
}
|
|
2225
|
-
};
|
|
2226
|
-
else {
|
|
2288
|
+
};
|
|
2289
|
+
} else {
|
|
2227
2290
|
getter = NOOP;
|
|
2228
2291
|
warnInvalidSource(source, onWarn);
|
|
2229
2292
|
}
|
|
@@ -2241,8 +2304,9 @@ var Vue = (function() {
|
|
|
2241
2304
|
if (once && cb) {
|
|
2242
2305
|
const _cb = cb;
|
|
2243
2306
|
cb = (...args) => {
|
|
2244
|
-
_cb(...args);
|
|
2307
|
+
const res = _cb(...args);
|
|
2245
2308
|
this.stop();
|
|
2309
|
+
return res;
|
|
2246
2310
|
};
|
|
2247
2311
|
}
|
|
2248
2312
|
this.cb = cb;
|
|
@@ -2256,7 +2320,7 @@ var Vue = (function() {
|
|
|
2256
2320
|
if (!this.cb) return;
|
|
2257
2321
|
const { immediate, deep, call } = this.options;
|
|
2258
2322
|
if (initialRun && !immediate) return;
|
|
2259
|
-
if (deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
|
|
2323
|
+
if (initialRun || deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
|
|
2260
2324
|
cleanup(this);
|
|
2261
2325
|
const currentWatcher = activeWatcher;
|
|
2262
2326
|
activeWatcher = this;
|
|
@@ -2546,7 +2610,7 @@ var Vue = (function() {
|
|
|
2546
2610
|
let jobsLength = 0;
|
|
2547
2611
|
let flushIndex = 0;
|
|
2548
2612
|
let postFlushIndex = 0;
|
|
2549
|
-
const resolvedPromise =
|
|
2613
|
+
const resolvedPromise = /*@__PURE__*/ Promise.resolve();
|
|
2550
2614
|
const RECURSION_LIMIT = 100;
|
|
2551
2615
|
function nextTick(fn) {
|
|
2552
2616
|
const p = currentFlushPromise || resolvedPromise;
|
|
@@ -2563,8 +2627,8 @@ var Vue = (function() {
|
|
|
2563
2627
|
/**
|
|
2564
2628
|
* @internal for runtime-vapor only
|
|
2565
2629
|
*/
|
|
2566
|
-
function queueJob(job, id, isPre = false) {
|
|
2567
|
-
if (queueJobWorker(job, id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : id * 2 + 1, jobs, jobsLength, flushIndex)) {
|
|
2630
|
+
function queueJob(job, id, isPre = false, order = 0) {
|
|
2631
|
+
if (queueJobWorker(job, id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : order ? id * 2 + 1 + order / (order + 1) : id * 2 + 1, jobs, jobsLength, flushIndex)) {
|
|
2568
2632
|
jobsLength++;
|
|
2569
2633
|
queueFlush();
|
|
2570
2634
|
}
|
|
@@ -2585,6 +2649,7 @@ var Vue = (function() {
|
|
|
2585
2649
|
flushJobs();
|
|
2586
2650
|
} catch (e) {
|
|
2587
2651
|
currentFlushPromise = null;
|
|
2652
|
+
if (jobsLength || postJobs.length) queueFlush();
|
|
2588
2653
|
throw e;
|
|
2589
2654
|
}
|
|
2590
2655
|
};
|
|
@@ -2592,9 +2657,10 @@ var Vue = (function() {
|
|
|
2592
2657
|
if (!currentFlushPromise) currentFlushPromise = resolvedPromise.then(doFlushJobs);
|
|
2593
2658
|
}
|
|
2594
2659
|
function queuePostFlushCb(jobs, id = Infinity) {
|
|
2595
|
-
if (!isArray(jobs))
|
|
2596
|
-
|
|
2597
|
-
|
|
2660
|
+
if (!isArray(jobs)) {
|
|
2661
|
+
if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
|
|
2662
|
+
else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
|
|
2663
|
+
} else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
|
|
2598
2664
|
queueFlush();
|
|
2599
2665
|
}
|
|
2600
2666
|
function flushPreFlushCbs(instance, seen) {
|
|
@@ -2608,32 +2674,39 @@ var Vue = (function() {
|
|
|
2608
2674
|
i--;
|
|
2609
2675
|
jobsLength--;
|
|
2610
2676
|
if (cb.flags & 2) cb.flags &= -2;
|
|
2611
|
-
|
|
2612
|
-
|
|
2677
|
+
try {
|
|
2678
|
+
cb();
|
|
2679
|
+
} finally {
|
|
2680
|
+
if (!(cb.flags & 2)) cb.flags &= -2;
|
|
2681
|
+
}
|
|
2613
2682
|
}
|
|
2614
2683
|
}
|
|
2615
2684
|
function flushPostFlushCbs(seen) {
|
|
2616
2685
|
if (postJobs.length) {
|
|
2617
2686
|
if (activePostJobs) {
|
|
2618
|
-
activePostJobs.push(
|
|
2687
|
+
for (let i = 0; i < postJobs.length; i++) activePostJobs.push(postJobs[i]);
|
|
2619
2688
|
postJobs.length = 0;
|
|
2620
2689
|
return;
|
|
2621
2690
|
}
|
|
2622
2691
|
activePostJobs = postJobs;
|
|
2623
2692
|
postJobs = [];
|
|
2624
2693
|
seen = seen || /* @__PURE__ */ new Map();
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
cb
|
|
2631
|
-
|
|
2632
|
-
|
|
2694
|
+
try {
|
|
2695
|
+
while (postFlushIndex < activePostJobs.length) {
|
|
2696
|
+
const cb = activePostJobs[postFlushIndex++];
|
|
2697
|
+
if (checkRecursiveUpdates(seen, cb)) continue;
|
|
2698
|
+
if (cb.flags & 2) cb.flags &= -2;
|
|
2699
|
+
if (!(cb.flags & 4)) try {
|
|
2700
|
+
cb();
|
|
2701
|
+
} finally {
|
|
2702
|
+
if (!(cb.flags & 2)) cb.flags &= -2;
|
|
2703
|
+
}
|
|
2633
2704
|
}
|
|
2705
|
+
} finally {
|
|
2706
|
+
while (postFlushIndex < activePostJobs.length) activePostJobs[postFlushIndex++].flags &= -2;
|
|
2707
|
+
activePostJobs = null;
|
|
2708
|
+
postFlushIndex = 0;
|
|
2634
2709
|
}
|
|
2635
|
-
activePostJobs = null;
|
|
2636
|
-
postFlushIndex = 0;
|
|
2637
2710
|
}
|
|
2638
2711
|
}
|
|
2639
2712
|
let isFlushing = false;
|
|
@@ -2643,9 +2716,12 @@ var Vue = (function() {
|
|
|
2643
2716
|
function flushOnAppMount(instance) {
|
|
2644
2717
|
if (!isFlushing) {
|
|
2645
2718
|
isFlushing = true;
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2719
|
+
try {
|
|
2720
|
+
flushPreFlushCbs(instance);
|
|
2721
|
+
flushPostFlushCbs();
|
|
2722
|
+
} finally {
|
|
2723
|
+
isFlushing = false;
|
|
2724
|
+
}
|
|
2649
2725
|
}
|
|
2650
2726
|
}
|
|
2651
2727
|
function flushJobs(seen) {
|
|
@@ -2673,9 +2749,10 @@ var Vue = (function() {
|
|
|
2673
2749
|
}
|
|
2674
2750
|
flushIndex = 0;
|
|
2675
2751
|
jobsLength = 0;
|
|
2752
|
+
jobs.length = 0;
|
|
2676
2753
|
flushPostFlushCbs(seen);
|
|
2677
|
-
currentFlushPromise = null;
|
|
2678
2754
|
if (jobsLength || postJobs.length) flushJobs(seen);
|
|
2755
|
+
else currentFlushPromise = null;
|
|
2679
2756
|
}
|
|
2680
2757
|
}
|
|
2681
2758
|
function checkRecursiveUpdates(seen, fn) {
|
|
@@ -2706,6 +2783,19 @@ var Vue = (function() {
|
|
|
2706
2783
|
rerender: tryWrap(rerender),
|
|
2707
2784
|
reload: tryWrap(reload)
|
|
2708
2785
|
};
|
|
2786
|
+
function runWithHmrUpdating(fn) {
|
|
2787
|
+
isHmrUpdating = true;
|
|
2788
|
+
let done = false;
|
|
2789
|
+
try {
|
|
2790
|
+
fn();
|
|
2791
|
+
done = true;
|
|
2792
|
+
} finally {
|
|
2793
|
+
if (done) nextTick(() => {
|
|
2794
|
+
isHmrUpdating = false;
|
|
2795
|
+
});
|
|
2796
|
+
else isHmrUpdating = false;
|
|
2797
|
+
}
|
|
2798
|
+
}
|
|
2709
2799
|
const map = /* @__PURE__ */ new Map();
|
|
2710
2800
|
function registerHMR(instance) {
|
|
2711
2801
|
const id = instance.type.__hmrId;
|
|
@@ -2730,6 +2820,14 @@ var Vue = (function() {
|
|
|
2730
2820
|
function normalizeClassComponent(component) {
|
|
2731
2821
|
return isClassComponent(component) ? component.__vccOpts : component;
|
|
2732
2822
|
}
|
|
2823
|
+
function hasDirtyAncestor(instance, dirtyInstances) {
|
|
2824
|
+
let parent = instance.parent;
|
|
2825
|
+
while (parent) {
|
|
2826
|
+
if (dirtyInstances.has(parent)) return true;
|
|
2827
|
+
parent = parent.parent;
|
|
2828
|
+
}
|
|
2829
|
+
return false;
|
|
2830
|
+
}
|
|
2733
2831
|
function rerender(id, newRender) {
|
|
2734
2832
|
const record = map.get(id);
|
|
2735
2833
|
if (!record) return;
|
|
@@ -2739,18 +2837,16 @@ var Vue = (function() {
|
|
|
2739
2837
|
instance.render = newRender;
|
|
2740
2838
|
normalizeClassComponent(instance.type).render = newRender;
|
|
2741
2839
|
}
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2840
|
+
runWithHmrUpdating(() => {
|
|
2841
|
+
if (instance.vapor) {
|
|
2842
|
+
if (!instance.isUnmounted) instance.hmrRerender();
|
|
2843
|
+
} else {
|
|
2844
|
+
const i = instance;
|
|
2845
|
+
if (!(i.effect.flags & 1024)) {
|
|
2846
|
+
i.renderCache = [];
|
|
2847
|
+
i.effect.run();
|
|
2848
|
+
}
|
|
2750
2849
|
}
|
|
2751
|
-
}
|
|
2752
|
-
nextTick(() => {
|
|
2753
|
-
isHmrUpdating = false;
|
|
2754
2850
|
});
|
|
2755
2851
|
});
|
|
2756
2852
|
}
|
|
@@ -2761,42 +2857,61 @@ var Vue = (function() {
|
|
|
2761
2857
|
const isVapor = record.initialDef.__vapor;
|
|
2762
2858
|
updateComponentDef(record.initialDef, newComp);
|
|
2763
2859
|
const instances = [...record.instances];
|
|
2764
|
-
if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
|
|
2860
|
+
if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
|
|
2765
2861
|
for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
instance.appContext.emitsCache.delete(instance.type);
|
|
2778
|
-
instance.appContext.optionsCache.delete(instance.type);
|
|
2779
|
-
if (instance.ceReload) {
|
|
2780
|
-
dirtyInstances.add(instance);
|
|
2781
|
-
instance.ceReload(newComp.styles);
|
|
2782
|
-
dirtyInstances.delete(instance);
|
|
2783
|
-
} else if (instance.parent) queueJob(() => {
|
|
2784
|
-
isHmrUpdating = true;
|
|
2785
|
-
const parent = instance.parent;
|
|
2786
|
-
if (parent.vapor) parent.hmrRerender();
|
|
2787
|
-
else if (!(parent.effect.flags & 1024)) {
|
|
2788
|
-
parent.renderCache = [];
|
|
2789
|
-
parent.effect.run();
|
|
2862
|
+
const dirtyInstances = new Set(instances);
|
|
2863
|
+
const rerenderedParents = /* @__PURE__ */ new Set();
|
|
2864
|
+
runWithHmrUpdating(() => {
|
|
2865
|
+
for (const instance of instances) {
|
|
2866
|
+
const parent = instance.parent;
|
|
2867
|
+
if (parent) {
|
|
2868
|
+
if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
|
|
2869
|
+
rerenderedParents.add(parent);
|
|
2870
|
+
parent.hmrRerender();
|
|
2871
|
+
}
|
|
2872
|
+
} else instance.hmrReload(newComp);
|
|
2790
2873
|
}
|
|
2791
|
-
|
|
2792
|
-
|
|
2874
|
+
});
|
|
2875
|
+
} else {
|
|
2876
|
+
const parents = /* @__PURE__ */ new Set();
|
|
2877
|
+
const dirtyInstanceSet = new Set(instances);
|
|
2878
|
+
for (const instance of instances) {
|
|
2879
|
+
const oldComp = normalizeClassComponent(instance.type);
|
|
2880
|
+
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
2881
|
+
if (!dirtyInstances) {
|
|
2882
|
+
if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
|
|
2883
|
+
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
2884
|
+
}
|
|
2885
|
+
dirtyInstances.add(instance);
|
|
2886
|
+
hmrDirtyComponentsMode.set(oldComp, !!isVapor);
|
|
2887
|
+
instance.appContext.propsCache.delete(instance.type);
|
|
2888
|
+
instance.appContext.emitsCache.delete(instance.type);
|
|
2889
|
+
instance.appContext.optionsCache.delete(instance.type);
|
|
2890
|
+
if (instance.ceReload) {
|
|
2891
|
+
dirtyInstances.add(instance);
|
|
2892
|
+
instance.ceReload(newComp.styles);
|
|
2893
|
+
dirtyInstances.delete(instance);
|
|
2894
|
+
} else if (instance.parent) {
|
|
2895
|
+
if (!hasDirtyAncestor(instance, dirtyInstanceSet)) parents.add(instance.parent);
|
|
2896
|
+
} else if (instance.appContext.reload) instance.appContext.reload();
|
|
2897
|
+
else if (typeof window !== "undefined") window.location.reload();
|
|
2898
|
+
else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
|
|
2899
|
+
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
2900
|
+
}
|
|
2901
|
+
parents.forEach((parent) => {
|
|
2902
|
+
queueJob(() => {
|
|
2903
|
+
runWithHmrUpdating(() => {
|
|
2904
|
+
if (parent.vapor) parent.hmrRerender();
|
|
2905
|
+
else {
|
|
2906
|
+
const i = parent;
|
|
2907
|
+
if (!(i.effect.flags & 1024)) {
|
|
2908
|
+
i.renderCache = [];
|
|
2909
|
+
i.effect.run();
|
|
2910
|
+
}
|
|
2911
|
+
}
|
|
2912
|
+
});
|
|
2793
2913
|
});
|
|
2794
|
-
dirtyInstances.delete(instance);
|
|
2795
2914
|
});
|
|
2796
|
-
else if (instance.appContext.reload) instance.appContext.reload();
|
|
2797
|
-
else if (typeof window !== "undefined") window.location.reload();
|
|
2798
|
-
else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
|
|
2799
|
-
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
2800
2915
|
}
|
|
2801
2916
|
queuePostFlushCb(() => {
|
|
2802
2917
|
hmrDirtyComponents.clear();
|
|
@@ -2863,20 +2978,20 @@ var Vue = (function() {
|
|
|
2863
2978
|
function devtoolsUnmountApp(app) {
|
|
2864
2979
|
emit$2("app:unmount", app);
|
|
2865
2980
|
}
|
|
2866
|
-
const devtoolsComponentAdded =
|
|
2867
|
-
const devtoolsComponentUpdated =
|
|
2868
|
-
const _devtoolsComponentRemoved =
|
|
2981
|
+
const devtoolsComponentAdded = /*@__PURE__*/ createDevtoolsComponentHook("component:added");
|
|
2982
|
+
const devtoolsComponentUpdated = /*@__PURE__*/ createDevtoolsComponentHook("component:updated");
|
|
2983
|
+
const _devtoolsComponentRemoved = /*@__PURE__*/ createDevtoolsComponentHook("component:removed");
|
|
2869
2984
|
const devtoolsComponentRemoved = (component) => {
|
|
2870
2985
|
if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && !devtools$1.cleanupBuffer(component)) _devtoolsComponentRemoved(component);
|
|
2871
2986
|
};
|
|
2872
|
-
|
|
2987
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
2873
2988
|
function createDevtoolsComponentHook(hook) {
|
|
2874
2989
|
return (component) => {
|
|
2875
2990
|
emit$2(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : void 0, component);
|
|
2876
2991
|
};
|
|
2877
2992
|
}
|
|
2878
|
-
const devtoolsPerfStart =
|
|
2879
|
-
const devtoolsPerfEnd =
|
|
2993
|
+
const devtoolsPerfStart = /*@__PURE__*/ createDevtoolsPerformanceHook("perf:start");
|
|
2994
|
+
const devtoolsPerfEnd = /*@__PURE__*/ createDevtoolsPerformanceHook("perf:end");
|
|
2880
2995
|
function createDevtoolsPerformanceHook(hook) {
|
|
2881
2996
|
return (component, type, time) => {
|
|
2882
2997
|
emit$2(hook, component.appContext.app, component.uid, component, type, time);
|
|
@@ -3105,7 +3220,7 @@ var Vue = (function() {
|
|
|
3105
3220
|
validateCompatConfig(config);
|
|
3106
3221
|
extend(globalCompatConfig, config);
|
|
3107
3222
|
}
|
|
3108
|
-
const seenConfigObjects =
|
|
3223
|
+
const seenConfigObjects = /*@__PURE__*/ new WeakSet();
|
|
3109
3224
|
const warnedInvalidKeys = {};
|
|
3110
3225
|
function validateCompatConfig(config, instance) {
|
|
3111
3226
|
if (seenConfigObjects.has(config)) return;
|
|
@@ -3157,7 +3272,7 @@ var Vue = (function() {
|
|
|
3157
3272
|
}
|
|
3158
3273
|
//#endregion
|
|
3159
3274
|
//#region packages/runtime-core/src/compat/instanceEventEmitter.ts
|
|
3160
|
-
const eventRegistryMap =
|
|
3275
|
+
const eventRegistryMap = /*@__PURE__*/ new WeakMap();
|
|
3161
3276
|
function getRegistry(instance) {
|
|
3162
3277
|
let events = eventRegistryMap.get(instance);
|
|
3163
3278
|
if (!events) eventRegistryMap.set(instance, events = Object.create(null));
|
|
@@ -3263,10 +3378,12 @@ var Vue = (function() {
|
|
|
3263
3378
|
const renderFnWithContext = (...args) => {
|
|
3264
3379
|
if (renderFnWithContext._d) setBlockTracking(-1);
|
|
3265
3380
|
const prevInstance = setCurrentRenderingInstance(ctx);
|
|
3381
|
+
const prevStackSize = blockStack.length;
|
|
3266
3382
|
let res;
|
|
3267
3383
|
try {
|
|
3268
3384
|
res = fn(...args);
|
|
3269
3385
|
} finally {
|
|
3386
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
3270
3387
|
setCurrentRenderingInstance(prevInstance);
|
|
3271
3388
|
if (renderFnWithContext._d) setBlockTracking(1);
|
|
3272
3389
|
}
|
|
@@ -3289,19 +3406,21 @@ var Vue = (function() {
|
|
|
3289
3406
|
};
|
|
3290
3407
|
function mapCompatDirectiveHook(name, dir, instance) {
|
|
3291
3408
|
const mappedName = legacyDirectiveHookMap[name];
|
|
3292
|
-
if (mappedName)
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3409
|
+
if (mappedName) {
|
|
3410
|
+
if (isArray(mappedName)) {
|
|
3411
|
+
const hook = [];
|
|
3412
|
+
mappedName.forEach((mapped) => {
|
|
3413
|
+
const mappedHook = dir[mapped];
|
|
3414
|
+
if (mappedHook) {
|
|
3415
|
+
softAssertCompatEnabled("CUSTOM_DIR", instance, mapped, name);
|
|
3416
|
+
hook.push(mappedHook);
|
|
3417
|
+
}
|
|
3418
|
+
});
|
|
3419
|
+
return hook.length ? hook : void 0;
|
|
3420
|
+
} else {
|
|
3421
|
+
if (dir[mappedName]) softAssertCompatEnabled("CUSTOM_DIR", instance, mappedName, name);
|
|
3422
|
+
return dir[mappedName];
|
|
3423
|
+
}
|
|
3305
3424
|
}
|
|
3306
3425
|
}
|
|
3307
3426
|
//#endregion
|
|
@@ -3464,7 +3583,7 @@ var Vue = (function() {
|
|
|
3464
3583
|
}
|
|
3465
3584
|
const prev = setCurrentInstance(this);
|
|
3466
3585
|
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
3467
|
-
|
|
3586
|
+
restoreCurrentInstance(prev);
|
|
3468
3587
|
return res;
|
|
3469
3588
|
}
|
|
3470
3589
|
function createPathGetter(ctx, path) {
|
|
@@ -3477,6 +3596,7 @@ var Vue = (function() {
|
|
|
3477
3596
|
}
|
|
3478
3597
|
//#endregion
|
|
3479
3598
|
//#region packages/runtime-core/src/components/Teleport.ts
|
|
3599
|
+
const pendingMounts = /* @__PURE__ */ new WeakMap();
|
|
3480
3600
|
const TeleportEndKey = Symbol("_vte");
|
|
3481
3601
|
const isTeleport = (type) => type.__isTeleport;
|
|
3482
3602
|
const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
|
|
@@ -3485,15 +3605,16 @@ var Vue = (function() {
|
|
|
3485
3605
|
const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
|
|
3486
3606
|
const resolveTarget = (props, select) => {
|
|
3487
3607
|
const targetSelector = props && props.to;
|
|
3488
|
-
if (isString(targetSelector))
|
|
3489
|
-
|
|
3490
|
-
|
|
3608
|
+
if (isString(targetSelector)) {
|
|
3609
|
+
if (!select) {
|
|
3610
|
+
warn$1("Current renderer does not support string target for Teleports. (missing querySelector renderer option)");
|
|
3611
|
+
return null;
|
|
3612
|
+
} else {
|
|
3613
|
+
const target = select(targetSelector);
|
|
3614
|
+
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.`);
|
|
3615
|
+
return target;
|
|
3616
|
+
}
|
|
3491
3617
|
} else {
|
|
3492
|
-
const target = select(targetSelector);
|
|
3493
|
-
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.`);
|
|
3494
|
-
return target;
|
|
3495
|
-
}
|
|
3496
|
-
else {
|
|
3497
3618
|
if (!targetSelector && !isTeleportDisabled(props)) warn$1(`Invalid Teleport target: ${targetSelector}`);
|
|
3498
3619
|
return targetSelector;
|
|
3499
3620
|
}
|
|
@@ -3502,58 +3623,71 @@ var Vue = (function() {
|
|
|
3502
3623
|
name: "Teleport",
|
|
3503
3624
|
__isTeleport: true,
|
|
3504
3625
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
|
|
3505
|
-
const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment } } = internals;
|
|
3626
|
+
const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment, parentNode } } = internals;
|
|
3506
3627
|
const disabled = isTeleportDisabled(n2.props);
|
|
3507
|
-
let {
|
|
3628
|
+
let { dynamicChildren } = n2;
|
|
3508
3629
|
if (isHmrUpdating) {
|
|
3509
3630
|
optimized = false;
|
|
3510
3631
|
dynamicChildren = null;
|
|
3511
3632
|
}
|
|
3633
|
+
const mount = (vnode, container, anchor) => {
|
|
3634
|
+
if (vnode.shapeFlag & 16) mountChildren(vnode.children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
3635
|
+
};
|
|
3636
|
+
const mountToTarget = (vnode = n2) => {
|
|
3637
|
+
const disabled = isTeleportDisabled(vnode.props);
|
|
3638
|
+
const target = vnode.target = resolveTarget(vnode.props, querySelector);
|
|
3639
|
+
const targetAnchor = prepareAnchor(target, vnode, createText, insert);
|
|
3640
|
+
if (target) {
|
|
3641
|
+
if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
|
|
3642
|
+
else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
|
|
3643
|
+
if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
|
|
3644
|
+
if (!disabled) {
|
|
3645
|
+
mount(vnode, target, targetAnchor);
|
|
3646
|
+
updateCssVars(vnode, false);
|
|
3647
|
+
}
|
|
3648
|
+
} else if (!disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
|
|
3649
|
+
};
|
|
3650
|
+
const queuePendingMount = (vnode) => {
|
|
3651
|
+
const mountJob = () => {
|
|
3652
|
+
if (pendingMounts.get(vnode) !== mountJob) return;
|
|
3653
|
+
pendingMounts.delete(vnode);
|
|
3654
|
+
if (isTeleportDisabled(vnode.props)) {
|
|
3655
|
+
const mountContainer = parentNode(vnode.el) || container;
|
|
3656
|
+
mount(vnode, mountContainer, vnode.anchor);
|
|
3657
|
+
updateCssVars(vnode, true);
|
|
3658
|
+
}
|
|
3659
|
+
mountToTarget(vnode);
|
|
3660
|
+
};
|
|
3661
|
+
pendingMounts.set(vnode, mountJob);
|
|
3662
|
+
queuePostRenderEffect(mountJob, void 0, parentSuspense);
|
|
3663
|
+
};
|
|
3512
3664
|
if (n1 == null) {
|
|
3513
3665
|
const placeholder = n2.el = createComment("teleport start");
|
|
3514
3666
|
const mainAnchor = n2.anchor = createComment("teleport end");
|
|
3515
3667
|
insert(placeholder, container, anchor);
|
|
3516
3668
|
insert(mainAnchor, container, anchor);
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
const target = n2.target = resolveTarget(n2.props, querySelector);
|
|
3522
|
-
const targetAnchor = prepareAnchor(target, n2, createText, insert);
|
|
3523
|
-
if (target) {
|
|
3524
|
-
if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
|
|
3525
|
-
else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
|
|
3526
|
-
if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
|
|
3527
|
-
if (!disabled) {
|
|
3528
|
-
mount(target, targetAnchor);
|
|
3529
|
-
updateCssVars(n2, false);
|
|
3530
|
-
}
|
|
3531
|
-
} else if (!disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
|
|
3532
|
-
};
|
|
3669
|
+
if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
|
|
3670
|
+
queuePendingMount(n2);
|
|
3671
|
+
return;
|
|
3672
|
+
}
|
|
3533
3673
|
if (disabled) {
|
|
3534
|
-
mount(container, mainAnchor);
|
|
3674
|
+
mount(n2, container, mainAnchor);
|
|
3535
3675
|
updateCssVars(n2, true);
|
|
3536
3676
|
}
|
|
3537
|
-
|
|
3538
|
-
n2.el.__isMounted = false;
|
|
3539
|
-
queuePostRenderEffect(() => {
|
|
3540
|
-
if (n2.el.__isMounted !== false) return;
|
|
3541
|
-
mountToTarget();
|
|
3542
|
-
delete n2.el.__isMounted;
|
|
3543
|
-
}, void 0, parentSuspense);
|
|
3544
|
-
} else mountToTarget();
|
|
3677
|
+
mountToTarget();
|
|
3545
3678
|
} else {
|
|
3546
3679
|
n2.el = n1.el;
|
|
3547
|
-
n2.targetStart = n1.targetStart;
|
|
3548
3680
|
const mainAnchor = n2.anchor = n1.anchor;
|
|
3549
|
-
const
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
}, void 0, parentSuspense);
|
|
3681
|
+
const pendingMount = pendingMounts.get(n1);
|
|
3682
|
+
if (pendingMount) {
|
|
3683
|
+
pendingMount.flags |= 4;
|
|
3684
|
+
pendingMounts.delete(n1);
|
|
3685
|
+
queuePendingMount(n2);
|
|
3555
3686
|
return;
|
|
3556
3687
|
}
|
|
3688
|
+
n2.targetStart = n1.targetStart;
|
|
3689
|
+
const target = n2.target = n1.target;
|
|
3690
|
+
const targetAnchor = n2.targetAnchor = n1.targetAnchor;
|
|
3557
3691
|
const wasDisabled = isTeleportDisabled(n1.props);
|
|
3558
3692
|
const currentContainer = wasDisabled ? container : target;
|
|
3559
3693
|
const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
|
|
@@ -3567,24 +3701,30 @@ var Vue = (function() {
|
|
|
3567
3701
|
if (!wasDisabled) moveTeleport(n2, container, mainAnchor, internals, parentComponent, 1);
|
|
3568
3702
|
else if (n2.props && n1.props && n2.props.to !== n1.props.to) n2.props.to = n1.props.to;
|
|
3569
3703
|
} else if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
|
|
3570
|
-
const nextTarget =
|
|
3571
|
-
if (nextTarget)
|
|
3572
|
-
|
|
3704
|
+
const nextTarget = resolveTarget(n2.props, querySelector);
|
|
3705
|
+
if (nextTarget) {
|
|
3706
|
+
n2.target = nextTarget;
|
|
3707
|
+
moveTeleport(n2, nextTarget, null, internals, parentComponent, 0);
|
|
3708
|
+
} else warn$1("Invalid Teleport target on update:", target, `(${typeof target})`);
|
|
3573
3709
|
} else if (wasDisabled) moveTeleport(n2, target, targetAnchor, internals, parentComponent, 1);
|
|
3574
3710
|
updateCssVars(n2, disabled);
|
|
3575
3711
|
}
|
|
3576
3712
|
},
|
|
3577
3713
|
remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
3578
|
-
const { shapeFlag, children, anchor, targetStart, targetAnchor, props } = vnode;
|
|
3714
|
+
const { shapeFlag, children, anchor, targetStart, targetAnchor, target, props } = vnode;
|
|
3715
|
+
const disabled = isTeleportDisabled(props);
|
|
3716
|
+
const shouldRemove = doRemove || !disabled;
|
|
3717
|
+
const pendingMount = pendingMounts.get(vnode);
|
|
3718
|
+
if (pendingMount) {
|
|
3719
|
+
pendingMount.flags |= 4;
|
|
3720
|
+
pendingMounts.delete(vnode);
|
|
3721
|
+
}
|
|
3579
3722
|
if (targetStart) hostRemove(targetStart);
|
|
3580
3723
|
if (targetAnchor) hostRemove(targetAnchor);
|
|
3581
3724
|
doRemove && hostRemove(anchor);
|
|
3582
|
-
if (shapeFlag & 16) {
|
|
3583
|
-
const
|
|
3584
|
-
|
|
3585
|
-
const child = children[i];
|
|
3586
|
-
unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
|
|
3587
|
-
}
|
|
3725
|
+
if (!pendingMount && (disabled || target) && shapeFlag & 16) for (let i = 0; i < children.length; i++) {
|
|
3726
|
+
const child = children[i];
|
|
3727
|
+
unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
|
|
3588
3728
|
}
|
|
3589
3729
|
},
|
|
3590
3730
|
move: moveTeleport,
|
|
@@ -3595,7 +3735,7 @@ var Vue = (function() {
|
|
|
3595
3735
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
3596
3736
|
const isReorder = moveType === 2;
|
|
3597
3737
|
if (isReorder) insert(el, container, parentAnchor);
|
|
3598
|
-
if (!isReorder || isTeleportDisabled(props)) {
|
|
3738
|
+
if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
|
|
3599
3739
|
if (shapeFlag & 16) for (let i = 0; i < children.length; i++) move(children[i], container, parentAnchor, 2, parentComponent);
|
|
3600
3740
|
}
|
|
3601
3741
|
if (isReorder) insert(anchor, container, parentAnchor);
|
|
@@ -3622,15 +3762,17 @@ var Vue = (function() {
|
|
|
3622
3762
|
const disabled = isTeleportDisabled(vnode.props);
|
|
3623
3763
|
if (target) {
|
|
3624
3764
|
const targetNode = target._lpa || target.firstChild;
|
|
3625
|
-
if (vnode.shapeFlag & 16)
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3765
|
+
if (vnode.shapeFlag & 16) {
|
|
3766
|
+
if (disabled) {
|
|
3767
|
+
hydrateDisabledTeleport(node, vnode);
|
|
3768
|
+
hydrateAnchor(target, targetNode);
|
|
3769
|
+
if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert, parentNode(node) === target ? node : null);
|
|
3770
|
+
} else {
|
|
3771
|
+
vnode.anchor = nextSibling(node);
|
|
3772
|
+
hydrateAnchor(target, targetNode);
|
|
3773
|
+
if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert);
|
|
3774
|
+
hydrateChildren(targetNode && nextSibling(targetNode), vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
3775
|
+
}
|
|
3634
3776
|
}
|
|
3635
3777
|
updateCssVars(vnode, disabled);
|
|
3636
3778
|
} else if (disabled) {
|
|
@@ -3718,49 +3860,16 @@ var Vue = (function() {
|
|
|
3718
3860
|
setup(props, { slots }) {
|
|
3719
3861
|
const instance = getCurrentInstance();
|
|
3720
3862
|
const state = useTransitionState();
|
|
3863
|
+
let resumeAfterLeave;
|
|
3721
3864
|
return () => {
|
|
3722
|
-
const
|
|
3723
|
-
if (!
|
|
3724
|
-
const child = findNonCommentChild(children);
|
|
3865
|
+
const child = resolveTransitionChild(slots.default && slots.default(), !!instance.subTree);
|
|
3866
|
+
if (!child) return;
|
|
3725
3867
|
const rawProps = /* @__PURE__ */ toRaw(props);
|
|
3726
3868
|
const { mode } = rawProps;
|
|
3727
3869
|
checkTransitionMode(mode);
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
let enterHooks = resolveTransitionHooks(innerChild, rawProps, state, instance, (hooks) => enterHooks = hooks);
|
|
3732
|
-
if (innerChild.type !== Comment) setTransitionHooks(innerChild, enterHooks);
|
|
3733
|
-
let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
|
|
3734
|
-
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
|
|
3735
|
-
let leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance);
|
|
3736
|
-
setTransitionHooks(oldInnerChild, leavingHooks);
|
|
3737
|
-
if (mode === "out-in" && innerChild.type !== Comment) {
|
|
3738
|
-
state.isLeaving = true;
|
|
3739
|
-
leavingHooks.afterLeave = () => {
|
|
3740
|
-
state.isLeaving = false;
|
|
3741
|
-
if (!(instance.job.flags & 4)) instance.update();
|
|
3742
|
-
delete leavingHooks.afterLeave;
|
|
3743
|
-
oldInnerChild = void 0;
|
|
3744
|
-
};
|
|
3745
|
-
return emptyPlaceholder(child);
|
|
3746
|
-
} else if (mode === "in-out" && innerChild.type !== Comment) leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
3747
|
-
const leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild);
|
|
3748
|
-
leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
|
|
3749
|
-
el[leaveCbKey] = () => {
|
|
3750
|
-
earlyRemove();
|
|
3751
|
-
el[leaveCbKey] = void 0;
|
|
3752
|
-
delete enterHooks.delayedLeave;
|
|
3753
|
-
oldInnerChild = void 0;
|
|
3754
|
-
};
|
|
3755
|
-
enterHooks.delayedLeave = () => {
|
|
3756
|
-
delayedLeave();
|
|
3757
|
-
delete enterHooks.delayedLeave;
|
|
3758
|
-
oldInnerChild = void 0;
|
|
3759
|
-
};
|
|
3760
|
-
};
|
|
3761
|
-
else oldInnerChild = void 0;
|
|
3762
|
-
} else if (oldInnerChild) oldInnerChild = void 0;
|
|
3763
|
-
return child;
|
|
3870
|
+
return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
|
|
3871
|
+
if (!(instance.job.flags & 4)) instance.update();
|
|
3872
|
+
}) : NOOP);
|
|
3764
3873
|
};
|
|
3765
3874
|
}
|
|
3766
3875
|
};
|
|
@@ -3830,8 +3939,10 @@ var Vue = (function() {
|
|
|
3830
3939
|
persisted,
|
|
3831
3940
|
beforeEnter(el) {
|
|
3832
3941
|
let hook = onBeforeEnter;
|
|
3833
|
-
if (!state.isMounted)
|
|
3834
|
-
|
|
3942
|
+
if (!state.isMounted) {
|
|
3943
|
+
if (appear) hook = onBeforeAppear || onBeforeEnter;
|
|
3944
|
+
else return;
|
|
3945
|
+
}
|
|
3835
3946
|
if (el[leaveCbKey]) el[leaveCbKey](true);
|
|
3836
3947
|
earlyRemove();
|
|
3837
3948
|
callHook(hook, [el]);
|
|
@@ -3841,11 +3952,13 @@ var Vue = (function() {
|
|
|
3841
3952
|
let hook = onEnter;
|
|
3842
3953
|
let afterHook = onAfterEnter;
|
|
3843
3954
|
let cancelHook = onEnterCancelled;
|
|
3844
|
-
if (!state.isMounted)
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3955
|
+
if (!state.isMounted) {
|
|
3956
|
+
if (appear) {
|
|
3957
|
+
hook = onAppear || onEnter;
|
|
3958
|
+
afterHook = onAfterAppear || onAfterEnter;
|
|
3959
|
+
cancelHook = onAppearCancelled || onEnterCancelled;
|
|
3960
|
+
} else return;
|
|
3961
|
+
}
|
|
3849
3962
|
let called = false;
|
|
3850
3963
|
el[enterCbKey$1] = (cancelled) => {
|
|
3851
3964
|
if (called) return;
|
|
@@ -3879,7 +3992,7 @@ var Vue = (function() {
|
|
|
3879
3992
|
else done();
|
|
3880
3993
|
},
|
|
3881
3994
|
clone(node) {
|
|
3882
|
-
return cloneHooks(node);
|
|
3995
|
+
return cloneHooks ? cloneHooks(node) : hooks;
|
|
3883
3996
|
}
|
|
3884
3997
|
};
|
|
3885
3998
|
return hooks;
|
|
@@ -3903,16 +4016,91 @@ var Vue = (function() {
|
|
|
3903
4016
|
if (shapeFlag & 32 && isFunction(children.default)) return children.default();
|
|
3904
4017
|
}
|
|
3905
4018
|
}
|
|
4019
|
+
function resolveTransitionChild(children, renderEmpty = false) {
|
|
4020
|
+
const branches = children && getTransitionRawChildren(children, true);
|
|
4021
|
+
return branches && branches.length ? findNonCommentChild(branches) : renderEmpty ? createCommentVNode() : void 0;
|
|
4022
|
+
}
|
|
4023
|
+
/**
|
|
4024
|
+
* @internal
|
|
4025
|
+
*/
|
|
4026
|
+
function prepareTransitionSwitch(previous, next, props, state, instance, resumeAfterLeave, delayedLeaveSource) {
|
|
4027
|
+
if (state.isLeaving) return emptyPlaceholder(next);
|
|
4028
|
+
const nextInner = getInnerChild$1(next);
|
|
4029
|
+
if (!nextInner) return emptyPlaceholder(next);
|
|
4030
|
+
let enterHooks = resolveTransitionHooks(nextInner, props, state, instance, (hooks) => {
|
|
4031
|
+
if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
|
|
4032
|
+
enterHooks = hooks;
|
|
4033
|
+
});
|
|
4034
|
+
if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
|
|
4035
|
+
if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
|
|
4036
|
+
const mode = props.mode;
|
|
4037
|
+
const previousInner = previous && getInnerChild$1(previous);
|
|
4038
|
+
if (previous && previousInner && previousInner.type !== Comment && !isSameVNodeType(previousInner, nextInner) && (!previous.component || recursiveGetSubtree(previous.component).type !== Comment)) {
|
|
4039
|
+
const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
|
|
4040
|
+
if (nextInner.type !== Comment && (mode === "out-in" || mode === "in-out") && applyTransitionModeSwitch(previousInner, leavingHooks, mode === "in-out" ? () => enterHooks : void 0, props, state, resumeAfterLeave)) return emptyPlaceholder(next);
|
|
4041
|
+
}
|
|
4042
|
+
return next;
|
|
4043
|
+
}
|
|
4044
|
+
function forwardDelayedLeave(hooks, source) {
|
|
4045
|
+
const delayedLeave = source && source.delayedLeave;
|
|
4046
|
+
if (!delayedLeave) return;
|
|
4047
|
+
hooks.delayedLeave = () => {
|
|
4048
|
+
if (source.delayedLeave === delayedLeave) delayedLeave();
|
|
4049
|
+
delete hooks.delayedLeave;
|
|
4050
|
+
};
|
|
4051
|
+
}
|
|
4052
|
+
function prepareLeavingTransitionHooks(previousInner, props, state, instance) {
|
|
4053
|
+
return setTransitionHooks(previousInner, resolveTransitionHooks(previousInner, props, state, instance));
|
|
4054
|
+
}
|
|
4055
|
+
function applyTransitionModeSwitch(leavingVNode, leavingHooks, getEnterHooks, props, state, resumeAfterLeave) {
|
|
4056
|
+
if (props.mode === "out-in") {
|
|
4057
|
+
state.isLeaving = true;
|
|
4058
|
+
leavingHooks.afterLeave = () => {
|
|
4059
|
+
state.isLeaving = false;
|
|
4060
|
+
resumeAfterLeave();
|
|
4061
|
+
delete leavingHooks.afterLeave;
|
|
4062
|
+
};
|
|
4063
|
+
return true;
|
|
4064
|
+
} else if (props.mode === "in-out" && getEnterHooks) {
|
|
4065
|
+
let delayedLeavingVNode = leavingVNode;
|
|
4066
|
+
leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
4067
|
+
const enterHooks = getEnterHooks();
|
|
4068
|
+
if (!enterHooks) {
|
|
4069
|
+
delayedLeave();
|
|
4070
|
+
return;
|
|
4071
|
+
}
|
|
4072
|
+
const vnode = delayedLeavingVNode;
|
|
4073
|
+
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
4074
|
+
leavingVNodesCache[String(vnode.key)] = vnode;
|
|
4075
|
+
el[leaveCbKey] = () => {
|
|
4076
|
+
earlyRemove();
|
|
4077
|
+
el[leaveCbKey] = void 0;
|
|
4078
|
+
delete enterHooks.delayedLeave;
|
|
4079
|
+
delayedLeavingVNode = void 0;
|
|
4080
|
+
};
|
|
4081
|
+
enterHooks.delayedLeave = () => {
|
|
4082
|
+
delayedLeave();
|
|
4083
|
+
delete enterHooks.delayedLeave;
|
|
4084
|
+
delayedLeavingVNode = void 0;
|
|
4085
|
+
};
|
|
4086
|
+
};
|
|
4087
|
+
}
|
|
4088
|
+
return false;
|
|
4089
|
+
}
|
|
3906
4090
|
function setTransitionHooks(vnode, hooks) {
|
|
3907
|
-
if (vnode.shapeFlag & 6 && vnode.component)
|
|
3908
|
-
else {
|
|
4091
|
+
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
3909
4092
|
vnode.transition = hooks;
|
|
3910
|
-
setTransitionHooks(vnode.component
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
4093
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
|
|
4094
|
+
else {
|
|
4095
|
+
const subTree = vnode.component.subTree;
|
|
4096
|
+
return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
|
|
4097
|
+
}
|
|
4098
|
+
} else if (vnode.shapeFlag & 128) {
|
|
4099
|
+
const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
4100
|
+
const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
4101
|
+
return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
|
|
3915
4102
|
} else vnode.transition = hooks;
|
|
4103
|
+
return hooks;
|
|
3916
4104
|
}
|
|
3917
4105
|
function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
3918
4106
|
let ret = [];
|
|
@@ -3936,9 +4124,9 @@ var Vue = (function() {
|
|
|
3936
4124
|
}
|
|
3937
4125
|
//#endregion
|
|
3938
4126
|
//#region packages/runtime-core/src/apiDefineComponent.ts
|
|
3939
|
-
|
|
4127
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
3940
4128
|
function defineComponent(options, extraOptions) {
|
|
3941
|
-
return isFunction(options) ? extend({ name: options.name }, extraOptions, { setup: options }) : options;
|
|
4129
|
+
return isFunction(options) ? /*@__PURE__*/ (() => extend({ name: options.name }, extraOptions, { setup: options }))() : options;
|
|
3942
4130
|
}
|
|
3943
4131
|
//#endregion
|
|
3944
4132
|
//#region packages/runtime-core/src/helpers/useId.ts
|
|
@@ -4035,15 +4223,16 @@ var Vue = (function() {
|
|
|
4035
4223
|
if (rawRef.f) {
|
|
4036
4224
|
const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
|
|
4037
4225
|
if (isUnmount) isArray(existing) && remove(existing, refValue);
|
|
4038
|
-
else if (!isArray(existing))
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4226
|
+
else if (!isArray(existing)) {
|
|
4227
|
+
if (_isString) {
|
|
4228
|
+
refs[ref] = [refValue];
|
|
4229
|
+
if (canSetSetupRef(ref)) setupState[ref] = refs[ref];
|
|
4230
|
+
} else {
|
|
4231
|
+
const newVal = [refValue];
|
|
4232
|
+
if (canSetRef(ref, rawRef.k)) ref.value = newVal;
|
|
4233
|
+
if (rawRef.k) refs[rawRef.k] = newVal;
|
|
4234
|
+
}
|
|
4235
|
+
} else if (!existing.includes(refValue)) existing.push(refValue);
|
|
4047
4236
|
} else if (_isString) {
|
|
4048
4237
|
refs[ref] = value;
|
|
4049
4238
|
if (canSetSetupRef(ref)) setupState[ref] = value;
|
|
@@ -4095,7 +4284,18 @@ var Vue = (function() {
|
|
|
4095
4284
|
hasLoggedMismatchError = true;
|
|
4096
4285
|
};
|
|
4097
4286
|
const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
|
|
4098
|
-
const isMathMLContainer = (container) =>
|
|
4287
|
+
const isMathMLContainer = (container) => {
|
|
4288
|
+
if (!container.namespaceURI.includes("MathML")) return false;
|
|
4289
|
+
if (container.tagName !== "annotation-xml") return true;
|
|
4290
|
+
const encoding = container.getAttribute("encoding");
|
|
4291
|
+
return !encoding || !encoding.includes("html");
|
|
4292
|
+
};
|
|
4293
|
+
/**
|
|
4294
|
+
* Resolve the element namespace a container's children should be created in.
|
|
4295
|
+
* The live DOM is the source of truth, so this also covers containers that are
|
|
4296
|
+
* only known at runtime (interop boundaries, teleport targets).
|
|
4297
|
+
* @internal
|
|
4298
|
+
*/
|
|
4099
4299
|
const getContainerType = (container) => {
|
|
4100
4300
|
if (container.nodeType !== 1) return void 0;
|
|
4101
4301
|
if (isSVGContainer(container)) return "svg";
|
|
@@ -4119,7 +4319,7 @@ var Vue = (function() {
|
|
|
4119
4319
|
};
|
|
4120
4320
|
const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
|
|
4121
4321
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
4122
|
-
const isFragmentStart = isComment(node) && node.data === "[";
|
|
4322
|
+
const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(");
|
|
4123
4323
|
const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);
|
|
4124
4324
|
const { type, ref, shapeFlag, patchFlag } = vnode;
|
|
4125
4325
|
let domType = node.nodeType;
|
|
@@ -4133,11 +4333,12 @@ var Vue = (function() {
|
|
|
4133
4333
|
let nextNode = null;
|
|
4134
4334
|
switch (type) {
|
|
4135
4335
|
case Text:
|
|
4136
|
-
if (domType !== 3)
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4336
|
+
if (domType !== 3) {
|
|
4337
|
+
if (vnode.children === "") {
|
|
4338
|
+
insert(vnode.el = createText(""), parentNode(node), node);
|
|
4339
|
+
nextNode = node;
|
|
4340
|
+
} else nextNode = onMismatch();
|
|
4341
|
+
} else {
|
|
4141
4342
|
if (node.data !== vnode.children) {
|
|
4142
4343
|
warn$1(`Hydration text mismatch in`, node.parentNode, `\n - rendered on server: ${JSON.stringify(node.data)}\n - expected on client: ${JSON.stringify(vnode.children)}`);
|
|
4143
4344
|
logMismatchError();
|
|
@@ -4174,30 +4375,35 @@ var Vue = (function() {
|
|
|
4174
4375
|
else nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
4175
4376
|
break;
|
|
4176
4377
|
case VaporSlot:
|
|
4177
|
-
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node);
|
|
4378
|
+
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense, slotScopeIds);
|
|
4178
4379
|
break;
|
|
4179
|
-
default: if (shapeFlag & 1)
|
|
4180
|
-
|
|
4181
|
-
|
|
4380
|
+
default: if (shapeFlag & 1) {
|
|
4381
|
+
if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode$1(node)) nextNode = onMismatch();
|
|
4382
|
+
else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
4383
|
+
} else if (shapeFlag & 6) {
|
|
4182
4384
|
vnode.slotScopeIds = slotScopeIds;
|
|
4183
4385
|
const container = parentNode(node);
|
|
4184
4386
|
if (isFragmentStart) nextNode = locateClosingAnchor(node);
|
|
4185
4387
|
else if (isComment(node) && node.data === "teleport start") nextNode = locateClosingAnchor(node, node.data, "teleport end");
|
|
4186
4388
|
else nextNode = nextSibling(node);
|
|
4187
|
-
if (vnode.type.__vapor) getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container,
|
|
4188
|
-
else
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
if (
|
|
4192
|
-
subTree
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4389
|
+
if (vnode.type.__vapor) getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense);
|
|
4390
|
+
else {
|
|
4391
|
+
mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
|
|
4392
|
+
const component = vnode.component;
|
|
4393
|
+
if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep)) {
|
|
4394
|
+
let subTree;
|
|
4395
|
+
if (isFragmentStart) {
|
|
4396
|
+
subTree = createVNode(Static);
|
|
4397
|
+
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
4398
|
+
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode(node.nodeType === 8 ? Comment : "div");
|
|
4399
|
+
subTree.el = node;
|
|
4400
|
+
component.subTree = subTree;
|
|
4401
|
+
}
|
|
4197
4402
|
}
|
|
4198
|
-
} else if (shapeFlag & 64)
|
|
4199
|
-
|
|
4200
|
-
|
|
4403
|
+
} else if (shapeFlag & 64) {
|
|
4404
|
+
if (domType !== 8) nextNode = onMismatch();
|
|
4405
|
+
else nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
|
|
4406
|
+
} else if (shapeFlag & 128) nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, getContainerType(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);
|
|
4201
4407
|
else warn$1("Invalid HostVNode type:", type, `(${typeof type})`);
|
|
4202
4408
|
}
|
|
4203
4409
|
if (ref != null) setRef(ref, null, parentSuspense, vnode);
|
|
@@ -4205,7 +4411,7 @@ var Vue = (function() {
|
|
|
4205
4411
|
};
|
|
4206
4412
|
const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
4207
4413
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
4208
|
-
const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
4414
|
+
const { type, dynamicProps, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
4209
4415
|
const forcePatch = type === "input" || type === "option";
|
|
4210
4416
|
{
|
|
4211
4417
|
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
@@ -4223,15 +4429,11 @@ var Vue = (function() {
|
|
|
4223
4429
|
}
|
|
4224
4430
|
if (shapeFlag & 16 && !(props && (props.innerHTML || props.textContent))) {
|
|
4225
4431
|
let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
4226
|
-
|
|
4432
|
+
if (next && !isMismatchAllowed(el, 1)) {
|
|
4433
|
+
warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
|
|
4434
|
+
logMismatchError();
|
|
4435
|
+
}
|
|
4227
4436
|
while (next) {
|
|
4228
|
-
if (!isMismatchAllowed(el, 1)) {
|
|
4229
|
-
if (!hasWarned) {
|
|
4230
|
-
warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
|
|
4231
|
-
hasWarned = true;
|
|
4232
|
-
}
|
|
4233
|
-
logMismatchError();
|
|
4234
|
-
}
|
|
4235
4437
|
const cur = next;
|
|
4236
4438
|
next = next.nextSibling;
|
|
4237
4439
|
remove(cur);
|
|
@@ -4250,9 +4452,13 @@ var Vue = (function() {
|
|
|
4250
4452
|
}
|
|
4251
4453
|
if (props) {
|
|
4252
4454
|
const isCustomElement = el.tagName.includes("-");
|
|
4455
|
+
const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
|
|
4253
4456
|
for (const key in props) {
|
|
4254
4457
|
if (!(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) logMismatchError();
|
|
4255
|
-
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key)
|
|
4458
|
+
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
|
|
4459
|
+
if (isUnchangedResourceProp(el, key, props[key])) continue;
|
|
4460
|
+
patchProp(el, key, null, props[key], namespace, parentComponent);
|
|
4461
|
+
}
|
|
4256
4462
|
}
|
|
4257
4463
|
}
|
|
4258
4464
|
let vnodeHooks;
|
|
@@ -4270,7 +4476,7 @@ var Vue = (function() {
|
|
|
4270
4476
|
optimized = optimized || !!parentVNode.dynamicChildren;
|
|
4271
4477
|
const children = parentVNode.children;
|
|
4272
4478
|
const l = children.length;
|
|
4273
|
-
let
|
|
4479
|
+
let hasCheckedMismatch = false;
|
|
4274
4480
|
for (let i = 0; i < l; i++) {
|
|
4275
4481
|
const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
|
|
4276
4482
|
const isText = vnode.type === Text;
|
|
@@ -4284,12 +4490,12 @@ var Vue = (function() {
|
|
|
4284
4490
|
node = hydrateNode(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
4285
4491
|
} else if (isText && !vnode.children) insert(vnode.el = createText(""), container);
|
|
4286
4492
|
else {
|
|
4287
|
-
if (!
|
|
4288
|
-
|
|
4493
|
+
if (!hasCheckedMismatch) {
|
|
4494
|
+
hasCheckedMismatch = true;
|
|
4495
|
+
if (!isMismatchAllowed(container, 1)) {
|
|
4289
4496
|
warn$1(`Hydration children mismatch on`, container, `\nServer rendered element contains fewer child nodes than client vdom.`);
|
|
4290
|
-
|
|
4497
|
+
logMismatchError();
|
|
4291
4498
|
}
|
|
4292
|
-
logMismatchError();
|
|
4293
4499
|
}
|
|
4294
4500
|
patch(null, vnode, container, null, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
|
|
4295
4501
|
}
|
|
@@ -4300,8 +4506,9 @@ var Vue = (function() {
|
|
|
4300
4506
|
const { slotScopeIds: fragmentSlotScopeIds } = vnode;
|
|
4301
4507
|
if (fragmentSlotScopeIds) slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
|
|
4302
4508
|
const container = parentNode(node);
|
|
4303
|
-
const
|
|
4304
|
-
|
|
4509
|
+
const first = nextSibling(node);
|
|
4510
|
+
const next = vnode.vo && node.data === "(" ? getVaporInterface(parentComponent, vnode).hydrateSlotOutlet(vnode, node, parentComponent, parentSuspense, slotScopeIds) : hydrateChildren(first, vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
4511
|
+
if (next && isComment(next) && next.data === (node.data === "(" ? ")" : "]")) return nextSibling(vnode.anchor = next);
|
|
4305
4512
|
else {
|
|
4306
4513
|
logMismatchError();
|
|
4307
4514
|
insert(vnode.anchor = createComment(`]`), container, next);
|
|
@@ -4309,8 +4516,8 @@ var Vue = (function() {
|
|
|
4309
4516
|
}
|
|
4310
4517
|
};
|
|
4311
4518
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
4312
|
-
if (!
|
|
4313
|
-
warn$1(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``, `\n- expected on client:`, vnode.type);
|
|
4519
|
+
if (!isNodeMismatchAllowed(node, vnode)) {
|
|
4520
|
+
warn$1(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node) && (node.data === "[" || node.data === "(") ? `(start of fragment)` : ``, `\n- expected on client:`, vnode.type);
|
|
4314
4521
|
logMismatchError();
|
|
4315
4522
|
}
|
|
4316
4523
|
vnode.el = null;
|
|
@@ -4326,20 +4533,22 @@ var Vue = (function() {
|
|
|
4326
4533
|
const container = parentNode(node);
|
|
4327
4534
|
remove(node);
|
|
4328
4535
|
patch(null, vnode, container, next, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
|
|
4329
|
-
if (parentComponent) {
|
|
4536
|
+
if (parentComponent && parentComponent.vnode) {
|
|
4330
4537
|
parentComponent.vnode.el = vnode.el;
|
|
4331
4538
|
updateHOCHostEl(parentComponent, vnode.el);
|
|
4332
4539
|
}
|
|
4333
4540
|
return next;
|
|
4334
4541
|
};
|
|
4335
|
-
const locateClosingAnchor = (node, open = "[", close = "]") => {
|
|
4542
|
+
const locateClosingAnchor = (node, open = node && isComment(node) && node.data === "(" ? "(" : "[", close = open === "(" ? ")" : "]") => {
|
|
4336
4543
|
let match = 0;
|
|
4337
4544
|
while (node) {
|
|
4338
4545
|
node = nextSibling(node);
|
|
4339
4546
|
if (node && isComment(node)) {
|
|
4340
4547
|
if (node.data === open) match++;
|
|
4341
|
-
if (node.data === close)
|
|
4342
|
-
|
|
4548
|
+
if (node.data === close) {
|
|
4549
|
+
if (match === 0) return nextSibling(node);
|
|
4550
|
+
else match--;
|
|
4551
|
+
}
|
|
4343
4552
|
}
|
|
4344
4553
|
}
|
|
4345
4554
|
return node;
|
|
@@ -4349,7 +4558,7 @@ var Vue = (function() {
|
|
|
4349
4558
|
if (parentNode) parentNode.replaceChild(newNode, oldNode);
|
|
4350
4559
|
let parent = parentComponent;
|
|
4351
4560
|
while (parent) {
|
|
4352
|
-
if (parent.vnode.el === oldNode) parent.vnode.el = parent.subTree.el = newNode;
|
|
4561
|
+
if (parent.vnode && parent.vnode.el === oldNode) parent.vnode.el = parent.subTree.el = newNode;
|
|
4353
4562
|
parent = parent.parent;
|
|
4354
4563
|
}
|
|
4355
4564
|
};
|
|
@@ -4358,6 +4567,16 @@ var Vue = (function() {
|
|
|
4358
4567
|
const isTemplateNode$1 = (node) => {
|
|
4359
4568
|
return node.nodeType === 1 && node.tagName === "TEMPLATE";
|
|
4360
4569
|
};
|
|
4570
|
+
const resourceProps = /*@__PURE__*/ new Set([
|
|
4571
|
+
"src",
|
|
4572
|
+
"srcset",
|
|
4573
|
+
"href",
|
|
4574
|
+
"poster"
|
|
4575
|
+
]);
|
|
4576
|
+
function isUnchangedResourceProp(el, key, clientValue) {
|
|
4577
|
+
if (!resourceProps.has(key)) return false;
|
|
4578
|
+
return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
|
|
4579
|
+
}
|
|
4361
4580
|
/**
|
|
4362
4581
|
* Dev only
|
|
4363
4582
|
*/
|
|
@@ -4401,7 +4620,10 @@ var Vue = (function() {
|
|
|
4401
4620
|
function getAttributeMismatch(el, key, clientValue) {
|
|
4402
4621
|
let actual;
|
|
4403
4622
|
let expected;
|
|
4404
|
-
if (
|
|
4623
|
+
if (key === "hidden") {
|
|
4624
|
+
actual = normalizeHiddenValue(el.getAttribute(key));
|
|
4625
|
+
expected = normalizeHiddenValue(clientValue);
|
|
4626
|
+
} else if (isBooleanAttr(key)) {
|
|
4405
4627
|
actual = el.hasAttribute(key);
|
|
4406
4628
|
expected = includeBooleanAttr(clientValue);
|
|
4407
4629
|
} else if (clientValue == null) {
|
|
@@ -4429,6 +4651,11 @@ var Vue = (function() {
|
|
|
4429
4651
|
}
|
|
4430
4652
|
return false;
|
|
4431
4653
|
}
|
|
4654
|
+
function normalizeHiddenValue(value) {
|
|
4655
|
+
if (!isRenderableAttrValue(value)) return false;
|
|
4656
|
+
if (isString(value)) return value.toLowerCase() === "until-found" ? "until-found" : "";
|
|
4657
|
+
return includeBooleanAttr(value) ? "" : false;
|
|
4658
|
+
}
|
|
4432
4659
|
function toClassSet(str) {
|
|
4433
4660
|
return new Set(str.trim().split(/\s+/));
|
|
4434
4661
|
}
|
|
@@ -4473,7 +4700,9 @@ var Vue = (function() {
|
|
|
4473
4700
|
};
|
|
4474
4701
|
function isMismatchAllowed(el, allowedType) {
|
|
4475
4702
|
if (allowedType === 0 || allowedType === 1) while (el && !el.hasAttribute(allowMismatchAttr)) el = el.parentElement;
|
|
4476
|
-
|
|
4703
|
+
return isMismatchAllowedByAttr(el && el.getAttribute(allowMismatchAttr), allowedType);
|
|
4704
|
+
}
|
|
4705
|
+
function isMismatchAllowedByAttr(allowedAttr, allowedType) {
|
|
4477
4706
|
if (allowedAttr == null) return false;
|
|
4478
4707
|
else if (allowedAttr === "") return true;
|
|
4479
4708
|
else {
|
|
@@ -4482,6 +4711,16 @@ var Vue = (function() {
|
|
|
4482
4711
|
return list.includes(MismatchTypeString[allowedType]);
|
|
4483
4712
|
}
|
|
4484
4713
|
}
|
|
4714
|
+
function isNodeMismatchAllowed(node, vnode) {
|
|
4715
|
+
return isMismatchAllowed(node.parentElement, 1) || isMismatchAllowedByNode(node) || isMismatchAllowedByVNode(vnode);
|
|
4716
|
+
}
|
|
4717
|
+
function isMismatchAllowedByNode(node) {
|
|
4718
|
+
return node.nodeType === 1 && isMismatchAllowedByAttr(node.getAttribute(allowMismatchAttr), 1);
|
|
4719
|
+
}
|
|
4720
|
+
function isMismatchAllowedByVNode({ props }) {
|
|
4721
|
+
const allowedAttr = props && props[allowMismatchAttr];
|
|
4722
|
+
return typeof allowedAttr === "string" && isMismatchAllowedByAttr(allowedAttr, 1);
|
|
4723
|
+
}
|
|
4485
4724
|
//#endregion
|
|
4486
4725
|
//#region packages/runtime-core/src/hydrationStrategies.ts
|
|
4487
4726
|
let requestIdleCallback;
|
|
@@ -4555,16 +4794,18 @@ var Vue = (function() {
|
|
|
4555
4794
|
return teardown;
|
|
4556
4795
|
};
|
|
4557
4796
|
function forEachElement(node, cb) {
|
|
4558
|
-
if (isComment(node) && node.data === "[") {
|
|
4797
|
+
if (isComment(node) && (node.data === "[" || node.data === "(")) {
|
|
4798
|
+
const open = node.data;
|
|
4799
|
+
const close = open === "[" ? "]" : ")";
|
|
4559
4800
|
let depth = 1;
|
|
4560
4801
|
let next = node.nextSibling;
|
|
4561
4802
|
while (next) {
|
|
4562
4803
|
if (next.nodeType === 1) {
|
|
4563
4804
|
if (cb(next) === false) break;
|
|
4564
4805
|
} else if (isComment(next)) {
|
|
4565
|
-
if (next.data ===
|
|
4806
|
+
if (next.data === close) {
|
|
4566
4807
|
if (--depth === 0) break;
|
|
4567
|
-
} else if (next.data ===
|
|
4808
|
+
} else if (next.data === open) depth++;
|
|
4568
4809
|
}
|
|
4569
4810
|
next = next.nextSibling;
|
|
4570
4811
|
}
|
|
@@ -4573,14 +4814,14 @@ var Vue = (function() {
|
|
|
4573
4814
|
//#endregion
|
|
4574
4815
|
//#region packages/runtime-core/src/apiAsyncComponent.ts
|
|
4575
4816
|
const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
|
|
4576
|
-
|
|
4817
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
4577
4818
|
function defineAsyncComponent(source) {
|
|
4578
4819
|
const { load, getResolvedComp, setPendingRequest, source: { loadingComponent, errorComponent, delay, hydrate: hydrateStrategy, timeout, suspensible = true } } = createAsyncComponentContext(source);
|
|
4579
4820
|
return /* @__PURE__ */ defineComponent({
|
|
4580
4821
|
name: "AsyncComponentWrapper",
|
|
4581
4822
|
__asyncLoader: load,
|
|
4582
4823
|
__asyncHydrate(el, instance, hydrate) {
|
|
4583
|
-
performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy);
|
|
4824
|
+
performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy, true);
|
|
4584
4825
|
},
|
|
4585
4826
|
get __asyncResolved() {
|
|
4586
4827
|
return getResolvedComp();
|
|
@@ -4600,11 +4841,16 @@ var Vue = (function() {
|
|
|
4600
4841
|
onError(err);
|
|
4601
4842
|
return () => errorComponent ? createVNode(errorComponent, { error: err }) : null;
|
|
4602
4843
|
});
|
|
4603
|
-
const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError);
|
|
4844
|
+
const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError, instance);
|
|
4604
4845
|
load().then(() => {
|
|
4846
|
+
if (instance.isUnmounted) return;
|
|
4605
4847
|
loaded.value = true;
|
|
4606
4848
|
if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) instance.parent.update();
|
|
4607
4849
|
}).catch((err) => {
|
|
4850
|
+
if (instance.isUnmounted) {
|
|
4851
|
+
setPendingRequest(null);
|
|
4852
|
+
return;
|
|
4853
|
+
}
|
|
4608
4854
|
onError(err);
|
|
4609
4855
|
error.value = err;
|
|
4610
4856
|
});
|
|
@@ -4662,14 +4908,22 @@ var Vue = (function() {
|
|
|
4662
4908
|
setPendingRequest: (request) => pendingRequest = request
|
|
4663
4909
|
};
|
|
4664
4910
|
}
|
|
4665
|
-
const useAsyncComponentState = (delay, timeout, onError) => {
|
|
4911
|
+
const useAsyncComponentState = (delay, timeout, onError, instance = currentInstance) => {
|
|
4666
4912
|
const loaded = /* @__PURE__ */ ref(false);
|
|
4667
4913
|
const error = /* @__PURE__ */ ref();
|
|
4668
4914
|
const delayed = /* @__PURE__ */ ref(!!delay);
|
|
4669
|
-
|
|
4915
|
+
let timeoutTimer;
|
|
4916
|
+
let delayTimer;
|
|
4917
|
+
if (instance) onUnmounted(() => {
|
|
4918
|
+
if (timeoutTimer != null) clearTimeout(timeoutTimer);
|
|
4919
|
+
if (delayTimer != null) clearTimeout(delayTimer);
|
|
4920
|
+
}, instance);
|
|
4921
|
+
if (delay) delayTimer = setTimeout(() => {
|
|
4922
|
+
if (instance && instance.isUnmounted) return;
|
|
4670
4923
|
delayed.value = false;
|
|
4671
4924
|
}, delay);
|
|
4672
|
-
if (timeout != null) setTimeout(() => {
|
|
4925
|
+
if (timeout != null) timeoutTimer = setTimeout(() => {
|
|
4926
|
+
if (instance && instance.isUnmounted) return;
|
|
4673
4927
|
if (!loaded.value && !error.value) {
|
|
4674
4928
|
const err = /* @__PURE__ */ new Error(`Async component timed out after ${timeout}ms.`);
|
|
4675
4929
|
onError(err);
|
|
@@ -4686,9 +4940,10 @@ var Vue = (function() {
|
|
|
4686
4940
|
* shared between core and vapor
|
|
4687
4941
|
* @internal
|
|
4688
4942
|
*/
|
|
4689
|
-
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
|
|
4943
|
+
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy, skipIfUpdated) {
|
|
4944
|
+
const wasConnected = el.isConnected;
|
|
4690
4945
|
let patched = false;
|
|
4691
|
-
(instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
4946
|
+
if (skipIfUpdated) (instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
4692
4947
|
const performHydrate = () => {
|
|
4693
4948
|
if (patched) {
|
|
4694
4949
|
{
|
|
@@ -4697,6 +4952,7 @@ var Vue = (function() {
|
|
|
4697
4952
|
}
|
|
4698
4953
|
return;
|
|
4699
4954
|
}
|
|
4955
|
+
if (!el.parentNode || wasConnected && !el.isConnected) return;
|
|
4700
4956
|
hydrate();
|
|
4701
4957
|
};
|
|
4702
4958
|
const doHydrate = hydrateStrategy ? () => {
|
|
@@ -4773,10 +5029,13 @@ var Vue = (function() {
|
|
|
4773
5029
|
});
|
|
4774
5030
|
let pendingCacheKey = null;
|
|
4775
5031
|
const cacheSubtree = () => {
|
|
4776
|
-
if (pendingCacheKey != null)
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
5032
|
+
if (pendingCacheKey != null) {
|
|
5033
|
+
if (isSuspense(keepAliveInstance.subTree.type)) queuePostRenderEffect(() => {
|
|
5034
|
+
const vnode = getInnerChild(keepAliveInstance.subTree);
|
|
5035
|
+
if (vnode.component) cache.set(pendingCacheKey, vnode);
|
|
5036
|
+
}, void 0, keepAliveInstance.subTree.suspense);
|
|
5037
|
+
else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
|
|
5038
|
+
}
|
|
4780
5039
|
};
|
|
4781
5040
|
onMounted(cacheSubtree);
|
|
4782
5041
|
onUpdated(cacheSubtree);
|
|
@@ -4847,7 +5106,7 @@ var Vue = (function() {
|
|
|
4847
5106
|
t.__isBuiltIn = true;
|
|
4848
5107
|
return t;
|
|
4849
5108
|
};
|
|
4850
|
-
const KeepAlive =
|
|
5109
|
+
const KeepAlive = /*@__PURE__*/ decorate$2(KeepAliveImpl);
|
|
4851
5110
|
function matches(pattern, name) {
|
|
4852
5111
|
if (isArray(pattern)) return pattern.some((p) => matches(p, name));
|
|
4853
5112
|
else if (isString(pattern)) return pattern.split(",").includes(name);
|
|
@@ -4938,7 +5197,7 @@ var Vue = (function() {
|
|
|
4938
5197
|
try {
|
|
4939
5198
|
return callWithAsyncErrorHandling(hook, target, type, args);
|
|
4940
5199
|
} finally {
|
|
4941
|
-
|
|
5200
|
+
restoreCurrentInstance(prev);
|
|
4942
5201
|
setActiveSub(prevSub);
|
|
4943
5202
|
}
|
|
4944
5203
|
});
|
|
@@ -5063,16 +5322,17 @@ var Vue = (function() {
|
|
|
5063
5322
|
}
|
|
5064
5323
|
const l = arguments.length;
|
|
5065
5324
|
const is2ndArgArrayChildren = isArray(propsOrChildren);
|
|
5066
|
-
if (l === 2 || is2ndArgArrayChildren)
|
|
5067
|
-
if (
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5325
|
+
if (l === 2 || is2ndArgArrayChildren) {
|
|
5326
|
+
if (isObject(propsOrChildren) && !is2ndArgArrayChildren) {
|
|
5327
|
+
if (isVNode(propsOrChildren)) return convertLegacySlots(createVNode(type, null, [propsOrChildren]));
|
|
5328
|
+
return convertLegacySlots(convertLegacyDirectives(createVNode(type, convertLegacyProps(propsOrChildren, type)), propsOrChildren));
|
|
5329
|
+
} else return convertLegacySlots(createVNode(type, null, propsOrChildren));
|
|
5330
|
+
} else {
|
|
5071
5331
|
if (isVNode(children)) children = [children];
|
|
5072
5332
|
return convertLegacySlots(convertLegacyDirectives(createVNode(type, convertLegacyProps(propsOrChildren, type), children), propsOrChildren));
|
|
5073
5333
|
}
|
|
5074
5334
|
}
|
|
5075
|
-
const skipLegacyRootLevelProps =
|
|
5335
|
+
const skipLegacyRootLevelProps = /*@__PURE__*/ makeMap("staticStyle,staticClass,directives,model,hook");
|
|
5076
5336
|
function convertLegacyProps(legacyProps, type) {
|
|
5077
5337
|
if (!legacyProps) return null;
|
|
5078
5338
|
const converted = {};
|
|
@@ -5084,8 +5344,10 @@ var Vue = (function() {
|
|
|
5084
5344
|
if (key === "nativeOn") handlerKey += `Native`;
|
|
5085
5345
|
const existing = converted[handlerKey];
|
|
5086
5346
|
const incoming = listeners[event];
|
|
5087
|
-
if (existing !== incoming)
|
|
5088
|
-
|
|
5347
|
+
if (existing !== incoming) {
|
|
5348
|
+
if (existing) converted[handlerKey] = [].concat(existing, incoming);
|
|
5349
|
+
else converted[handlerKey] = incoming;
|
|
5350
|
+
}
|
|
5089
5351
|
}
|
|
5090
5352
|
} else if (!skipLegacyRootLevelProps(key)) converted[key] = legacyProps[key];
|
|
5091
5353
|
if (legacyProps.staticClass) converted.class = normalizeClass([legacyProps.staticClass, converted.class]);
|
|
@@ -5184,7 +5446,7 @@ var Vue = (function() {
|
|
|
5184
5446
|
const legacyFn = comp.render;
|
|
5185
5447
|
const Func = (props, ctx) => {
|
|
5186
5448
|
const instance = getCurrentInstance();
|
|
5187
|
-
|
|
5449
|
+
const legacyCtx = {
|
|
5188
5450
|
props,
|
|
5189
5451
|
children: instance.vnode.children || [],
|
|
5190
5452
|
data: instance.vnode.props || {},
|
|
@@ -5204,7 +5466,8 @@ var Vue = (function() {
|
|
|
5204
5466
|
}
|
|
5205
5467
|
return {};
|
|
5206
5468
|
}
|
|
5207
|
-
}
|
|
5469
|
+
};
|
|
5470
|
+
return legacyFn(compatH, legacyCtx);
|
|
5208
5471
|
};
|
|
5209
5472
|
Func.props = comp.props;
|
|
5210
5473
|
Func.displayName = comp.name;
|
|
@@ -5233,23 +5496,25 @@ var Vue = (function() {
|
|
|
5233
5496
|
}
|
|
5234
5497
|
ret = new Array(source.length);
|
|
5235
5498
|
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]);
|
|
5236
|
-
} else if (typeof source === "number")
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
else if (isObject(source)) if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
|
|
5244
|
-
else {
|
|
5245
|
-
const keys = Object.keys(source);
|
|
5246
|
-
ret = new Array(keys.length);
|
|
5247
|
-
for (let i = 0, l = keys.length; i < l; i++) {
|
|
5248
|
-
const key = keys[i];
|
|
5249
|
-
ret[i] = renderItem(source[key], key, i, cached && cached[i]);
|
|
5499
|
+
} else if (typeof source === "number") {
|
|
5500
|
+
if (!Number.isInteger(source) || source < 0) {
|
|
5501
|
+
warn$1(`The v-for range expects a positive integer value but got ${source}.`);
|
|
5502
|
+
ret = [];
|
|
5503
|
+
} else {
|
|
5504
|
+
ret = new Array(source);
|
|
5505
|
+
for (let i = 0; i < source; i++) ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
|
|
5250
5506
|
}
|
|
5251
|
-
}
|
|
5252
|
-
|
|
5507
|
+
} else if (isObject(source)) {
|
|
5508
|
+
if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
|
|
5509
|
+
else {
|
|
5510
|
+
const keys = Object.keys(source);
|
|
5511
|
+
ret = new Array(keys.length);
|
|
5512
|
+
for (let i = 0, l = keys.length; i < l; i++) {
|
|
5513
|
+
const key = keys[i];
|
|
5514
|
+
ret[i] = renderItem(source[key], key, i, cached && cached[i]);
|
|
5515
|
+
}
|
|
5516
|
+
}
|
|
5517
|
+
} else ret = [];
|
|
5253
5518
|
if (cache) cache[index] = ret;
|
|
5254
5519
|
return ret;
|
|
5255
5520
|
}
|
|
@@ -5274,37 +5539,64 @@ var Vue = (function() {
|
|
|
5274
5539
|
//#endregion
|
|
5275
5540
|
//#region packages/runtime-core/src/helpers/renderSlot.ts
|
|
5276
5541
|
/**
|
|
5542
|
+
* Links a slot function to its raw vapor slot: a raw vapor slot carries
|
|
5543
|
+
* itself, and the wrapper the interop slots proxy hands out carries the raw
|
|
5544
|
+
* slot it wraps — one lookup answers both "is this a vapor slot" and
|
|
5545
|
+
* "which one". Internal to vapor interop.
|
|
5546
|
+
*/
|
|
5547
|
+
const rawVaporSlotKey = Symbol(`rawVaporSlot`);
|
|
5548
|
+
/**
|
|
5277
5549
|
* Compiler runtime helper for rendering `<slot/>`
|
|
5278
5550
|
* @private
|
|
5279
5551
|
*/
|
|
5280
|
-
function renderSlot(slots, name, props
|
|
5552
|
+
function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
5553
|
+
if (props == null) props = {};
|
|
5281
5554
|
let slot = slots[name];
|
|
5282
|
-
const vaporSlot = slot &&
|
|
5555
|
+
const vaporSlot = slot && slot[rawVaporSlotKey];
|
|
5283
5556
|
if (vaporSlot) {
|
|
5284
5557
|
const ret = (openBlock(), createBlock(VaporSlot, props));
|
|
5285
5558
|
ret.vs = {
|
|
5286
5559
|
slot: vaporSlot,
|
|
5287
|
-
fallback
|
|
5560
|
+
outlets: fallback ? [{
|
|
5561
|
+
fallback,
|
|
5562
|
+
owner: currentRenderingInstance
|
|
5563
|
+
}] : void 0
|
|
5288
5564
|
};
|
|
5565
|
+
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
5289
5566
|
return ret;
|
|
5290
5567
|
}
|
|
5291
5568
|
if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
|
|
5292
|
-
const
|
|
5293
|
-
|
|
5294
|
-
|
|
5569
|
+
const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
|
|
5570
|
+
const hasProps = Object.keys(slotProps).length > 0;
|
|
5571
|
+
if (name !== "default") slotProps.name = name;
|
|
5572
|
+
return openBlock(), createBlock(Fragment, null, [createVNode("slot", slotProps, fallback && fallback())], hasProps ? -2 : 64);
|
|
5295
5573
|
}
|
|
5296
5574
|
if (slot && slot.length > 1) {
|
|
5297
5575
|
warn$1("SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.");
|
|
5298
5576
|
slot = () => [];
|
|
5299
5577
|
}
|
|
5300
5578
|
if (slot && slot._c) slot._d = false;
|
|
5579
|
+
const prevStackSize = blockStack.length;
|
|
5301
5580
|
openBlock();
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
|
|
5581
|
+
let rendered;
|
|
5582
|
+
try {
|
|
5583
|
+
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
5584
|
+
let attached = false;
|
|
5585
|
+
if (fallback && validSlotContent && currentRenderingInstance) {
|
|
5586
|
+
const interop = currentRenderingInstance.appContext.vapor;
|
|
5587
|
+
if (interop) attached = interop.attachSlotOutlet(validSlotContent, fallback, currentRenderingInstance);
|
|
5588
|
+
}
|
|
5589
|
+
const slotKey = props.key || branchKey || validSlotContent && validSlotContent.key;
|
|
5590
|
+
rendered = createBlock(Fragment, { key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
|
|
5591
|
+
if (!validSlotContent && fallback) rendered.shapeFlag |= 1024;
|
|
5592
|
+
if (attached) rendered.vo = true;
|
|
5593
|
+
} catch (err) {
|
|
5594
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
5595
|
+
throw err;
|
|
5596
|
+
} finally {
|
|
5597
|
+
if (slot && slot._c) slot._d = true;
|
|
5598
|
+
}
|
|
5306
5599
|
if (!noSlotted && rendered.scopeId) rendered.slotScopeIds = [rendered.scopeId + "-s"];
|
|
5307
|
-
if (slot && slot._c) slot._d = true;
|
|
5308
5600
|
return rendered;
|
|
5309
5601
|
}
|
|
5310
5602
|
function ensureValidVNode(vnodes) {
|
|
@@ -5315,12 +5607,6 @@ var Vue = (function() {
|
|
|
5315
5607
|
return true;
|
|
5316
5608
|
}) ? vnodes : null;
|
|
5317
5609
|
}
|
|
5318
|
-
function ensureVaporSlotFallback(vnodes, fallback) {
|
|
5319
|
-
let vaporSlot;
|
|
5320
|
-
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) {
|
|
5321
|
-
if (!vaporSlot.fallback && fallback) vaporSlot.fallback = fallback;
|
|
5322
|
-
}
|
|
5323
|
-
}
|
|
5324
5610
|
//#endregion
|
|
5325
5611
|
//#region packages/runtime-core/src/helpers/toHandlers.ts
|
|
5326
5612
|
/**
|
|
@@ -5379,12 +5665,14 @@ var Vue = (function() {
|
|
|
5379
5665
|
function mapKeyToName(slots) {
|
|
5380
5666
|
for (let i = 0; i < slots.length; i++) {
|
|
5381
5667
|
const fn = slots[i];
|
|
5382
|
-
if (fn)
|
|
5383
|
-
|
|
5668
|
+
if (fn) {
|
|
5669
|
+
if (isArray(fn)) mapKeyToName(fn);
|
|
5670
|
+
else fn.name = fn.key || "default";
|
|
5671
|
+
}
|
|
5384
5672
|
}
|
|
5385
5673
|
return slots;
|
|
5386
5674
|
}
|
|
5387
|
-
const staticCacheMap =
|
|
5675
|
+
const staticCacheMap = /*@__PURE__*/ new WeakMap();
|
|
5388
5676
|
function legacyRenderStatic(instance, index) {
|
|
5389
5677
|
let cache = staticCacheMap.get(instance);
|
|
5390
5678
|
if (!cache) staticCacheMap.set(instance, cache = []);
|
|
@@ -5517,11 +5805,38 @@ var Vue = (function() {
|
|
|
5517
5805
|
if (isStatefulComponent(i)) return getComponentPublicInstance(i);
|
|
5518
5806
|
return getPublicInstance(i.parent);
|
|
5519
5807
|
};
|
|
5808
|
+
const resolveDevRootEl = (vnode) => {
|
|
5809
|
+
let found = false;
|
|
5810
|
+
while (true) {
|
|
5811
|
+
if (vnode.patchFlag > 0 && vnode.patchFlag & 2048) {
|
|
5812
|
+
const root = filterSingleRoot(vnode.children);
|
|
5813
|
+
if (!root) return;
|
|
5814
|
+
vnode = root;
|
|
5815
|
+
found = true;
|
|
5816
|
+
continue;
|
|
5817
|
+
}
|
|
5818
|
+
const component = vnode.component;
|
|
5819
|
+
if (component && component.subTree) {
|
|
5820
|
+
vnode = component.subTree;
|
|
5821
|
+
continue;
|
|
5822
|
+
}
|
|
5823
|
+
const suspense = vnode.suspense;
|
|
5824
|
+
if (suspense && suspense.activeBranch) {
|
|
5825
|
+
vnode = suspense.activeBranch;
|
|
5826
|
+
continue;
|
|
5827
|
+
}
|
|
5828
|
+
return found ? vnode.el : void 0;
|
|
5829
|
+
}
|
|
5830
|
+
};
|
|
5831
|
+
const getDevRootFragmentEl = (i) => {
|
|
5832
|
+
const el = i.subTree && resolveDevRootEl(i.subTree);
|
|
5833
|
+
return el === void 0 ? i.vnode.el : el;
|
|
5834
|
+
};
|
|
5520
5835
|
let publicPropertiesMap;
|
|
5521
5836
|
const getPublicPropertiesMap = () => {
|
|
5522
5837
|
if (!publicPropertiesMap) publicPropertiesMap = extend(Object.create(null), {
|
|
5523
5838
|
$: (i) => i,
|
|
5524
|
-
$el: (i) => i
|
|
5839
|
+
$el: (i) => getDevRootFragmentEl(i),
|
|
5525
5840
|
$data: (i) => i.data,
|
|
5526
5841
|
$props: (i) => /* @__PURE__ */ shallowReadonly(i.props),
|
|
5527
5842
|
$attrs: (i) => /* @__PURE__ */ shallowReadonly(i.attrs),
|
|
@@ -5634,7 +5949,7 @@ var Vue = (function() {
|
|
|
5634
5949
|
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.");
|
|
5635
5950
|
return Reflect.ownKeys(target);
|
|
5636
5951
|
};
|
|
5637
|
-
const RuntimeCompiledPublicInstanceProxyHandlers =
|
|
5952
|
+
const RuntimeCompiledPublicInstanceProxyHandlers = /*@__PURE__*/ extend({}, PublicInstanceProxyHandlers, {
|
|
5638
5953
|
get(target, key) {
|
|
5639
5954
|
if (key === Symbol.unscopables) return;
|
|
5640
5955
|
return PublicInstanceProxyHandlers.get(target, key, target);
|
|
@@ -5819,12 +6134,13 @@ var Vue = (function() {
|
|
|
5819
6134
|
for (const key in defaults) {
|
|
5820
6135
|
if (key.startsWith("__skip")) continue;
|
|
5821
6136
|
let opt = props[key];
|
|
5822
|
-
if (opt)
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
6137
|
+
if (opt) {
|
|
6138
|
+
if (isArray(opt) || isFunction(opt)) opt = props[key] = {
|
|
6139
|
+
type: opt,
|
|
6140
|
+
default: defaults[key]
|
|
6141
|
+
};
|
|
6142
|
+
else opt.default = defaults[key];
|
|
6143
|
+
} else if (opt === null) opt = props[key] = { default: defaults[key] };
|
|
5828
6144
|
else warn$1(`props default key "${key}" has no corresponding declaration.`);
|
|
5829
6145
|
if (opt && defaults[`__skip_${key}`]) opt.skipFactory = true;
|
|
5830
6146
|
}
|
|
@@ -5879,21 +6195,29 @@ var Vue = (function() {
|
|
|
5879
6195
|
setCurrentInstance(null, void 0);
|
|
5880
6196
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
5881
6197
|
const restore = () => {
|
|
6198
|
+
const stoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
|
|
5882
6199
|
setCurrentInstance(ctx);
|
|
5883
6200
|
if (inSSRSetup) setInSSRSetupState(true);
|
|
6201
|
+
return stoppedScope;
|
|
5884
6202
|
};
|
|
5885
6203
|
const cleanup = () => {
|
|
5886
6204
|
setCurrentInstance(null, void 0);
|
|
5887
6205
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
5888
6206
|
};
|
|
5889
6207
|
if (isPromise(awaitable)) awaitable = awaitable.catch((e) => {
|
|
5890
|
-
restore();
|
|
5891
|
-
Promise.resolve().then(() => Promise.resolve().then(
|
|
6208
|
+
const stoppedScope = restore();
|
|
6209
|
+
Promise.resolve().then(() => Promise.resolve().then(() => {
|
|
6210
|
+
if (stoppedScope) stoppedScope.reset();
|
|
6211
|
+
cleanup();
|
|
6212
|
+
}));
|
|
5892
6213
|
throw e;
|
|
5893
6214
|
});
|
|
5894
6215
|
return [awaitable, () => {
|
|
5895
|
-
restore();
|
|
5896
|
-
Promise.resolve().then(
|
|
6216
|
+
const stoppedScope = restore();
|
|
6217
|
+
Promise.resolve().then(() => {
|
|
6218
|
+
if (stoppedScope) stoppedScope.reset();
|
|
6219
|
+
cleanup();
|
|
6220
|
+
});
|
|
5897
6221
|
}];
|
|
5898
6222
|
}
|
|
5899
6223
|
//#endregion
|
|
@@ -5954,11 +6278,12 @@ var Vue = (function() {
|
|
|
5954
6278
|
const opt = computedOptions[key];
|
|
5955
6279
|
const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
|
|
5956
6280
|
if (get === NOOP) warn$1(`Computed property "${key}" has no getter.`);
|
|
6281
|
+
const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
|
|
6282
|
+
warn$1(`Write operation failed: computed property "${key}" is readonly.`);
|
|
6283
|
+
};
|
|
5957
6284
|
const c = computed({
|
|
5958
6285
|
get,
|
|
5959
|
-
set
|
|
5960
|
-
warn$1(`Write operation failed: computed property "${key}" is readonly.`);
|
|
5961
|
-
}
|
|
6286
|
+
set
|
|
5962
6287
|
});
|
|
5963
6288
|
Object.defineProperty(ctx, key, {
|
|
5964
6289
|
enumerable: true,
|
|
@@ -6017,9 +6342,10 @@ var Vue = (function() {
|
|
|
6017
6342
|
for (const key in injectOptions) {
|
|
6018
6343
|
const opt = injectOptions[key];
|
|
6019
6344
|
let injected;
|
|
6020
|
-
if (isObject(opt))
|
|
6021
|
-
|
|
6022
|
-
|
|
6345
|
+
if (isObject(opt)) {
|
|
6346
|
+
if ("default" in opt) injected = inject(opt.from || key, opt.default, true);
|
|
6347
|
+
else injected = inject(opt.from || key);
|
|
6348
|
+
} else injected = inject(opt);
|
|
6023
6349
|
if (/* @__PURE__ */ isRef(injected)) Object.defineProperty(ctx, key, {
|
|
6024
6350
|
enumerable: true,
|
|
6025
6351
|
configurable: true,
|
|
@@ -6039,7 +6365,8 @@ var Vue = (function() {
|
|
|
6039
6365
|
{
|
|
6040
6366
|
const cur = getCurrentInstance();
|
|
6041
6367
|
const instance = cur && getCurrentScope() === cur.scope ? cur : null;
|
|
6042
|
-
|
|
6368
|
+
const newValue = getter();
|
|
6369
|
+
if (isArray(newValue) && isCompatEnabled$1("WATCH_ARRAY", instance)) options.deep = true;
|
|
6043
6370
|
const baseGetter = getter;
|
|
6044
6371
|
getter = () => {
|
|
6045
6372
|
const val = baseGetter();
|
|
@@ -6052,13 +6379,14 @@ var Vue = (function() {
|
|
|
6052
6379
|
if (isFunction(handler)) watch(getter, handler, options);
|
|
6053
6380
|
else warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
|
|
6054
6381
|
} else if (isFunction(raw)) watch(getter, raw.bind(publicThis), options);
|
|
6055
|
-
else if (isObject(raw))
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6382
|
+
else if (isObject(raw)) {
|
|
6383
|
+
if (isArray(raw)) raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
|
|
6384
|
+
else {
|
|
6385
|
+
const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
|
|
6386
|
+
if (isFunction(handler)) watch(getter, handler, extend(raw, options));
|
|
6387
|
+
else warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
|
|
6388
|
+
}
|
|
6389
|
+
} else warn$1(`Invalid watch option: "${key}"`, raw);
|
|
6062
6390
|
}
|
|
6063
6391
|
/**
|
|
6064
6392
|
* Resolve merged options and cache it on the component.
|
|
@@ -6072,12 +6400,13 @@ var Vue = (function() {
|
|
|
6072
6400
|
const cached = cache.get(base);
|
|
6073
6401
|
let resolved;
|
|
6074
6402
|
if (cached) resolved = cached;
|
|
6075
|
-
else if (!globalMixins.length && !mixins && !extendsOptions)
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
|
|
6403
|
+
else if (!globalMixins.length && !mixins && !extendsOptions) {
|
|
6404
|
+
if (isCompatEnabled$1("PRIVATE_APIS", instance)) {
|
|
6405
|
+
resolved = extend({}, base);
|
|
6406
|
+
resolved.parent = instance.parent && instance.parent.proxy;
|
|
6407
|
+
resolved.propsData = instance.vnode.props;
|
|
6408
|
+
} else resolved = base;
|
|
6409
|
+
} else {
|
|
6081
6410
|
resolved = {};
|
|
6082
6411
|
if (globalMixins.length) globalMixins.forEach((m) => mergeOptions(resolved, m, optionMergeStrategies, true));
|
|
6083
6412
|
mergeOptions(resolved, base, optionMergeStrategies);
|
|
@@ -6150,7 +6479,7 @@ var Vue = (function() {
|
|
|
6150
6479
|
}
|
|
6151
6480
|
function mergeEmitsOrPropsOptions(to, from) {
|
|
6152
6481
|
if (to) {
|
|
6153
|
-
if (isArray(to) && isArray(from)) return [
|
|
6482
|
+
if (isArray(to) && isArray(from)) return [.../* @__PURE__ */ new Set([...to, ...from])];
|
|
6154
6483
|
return extend(Object.create(null), normalizePropsOrEmits(to), normalizePropsOrEmits(from !== null && from !== void 0 ? from : {}));
|
|
6155
6484
|
} else return from;
|
|
6156
6485
|
}
|
|
@@ -6211,7 +6540,7 @@ var Vue = (function() {
|
|
|
6211
6540
|
if (options.el) return vm.$mount(options.el);
|
|
6212
6541
|
else return vm;
|
|
6213
6542
|
}
|
|
6214
|
-
Vue.version = `2.6.14-compat:3.6.0-
|
|
6543
|
+
Vue.version = `2.6.14-compat:3.6.0-rc.10`;
|
|
6215
6544
|
Vue.config = singletonApp.config;
|
|
6216
6545
|
Vue.use = (plugin, ...options) => {
|
|
6217
6546
|
if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
|
|
@@ -6466,7 +6795,9 @@ var Vue = (function() {
|
|
|
6466
6795
|
else Object.keys(val).forEach((key) => {
|
|
6467
6796
|
try {
|
|
6468
6797
|
defineReactiveSimple(val, key, val[key]);
|
|
6469
|
-
} catch (e) {
|
|
6798
|
+
} catch (e) {
|
|
6799
|
+
warn$1(`Failed making property "${key}" reactive:`, e);
|
|
6800
|
+
}
|
|
6470
6801
|
});
|
|
6471
6802
|
}
|
|
6472
6803
|
const i = obj.$;
|
|
@@ -6599,8 +6930,10 @@ var Vue = (function() {
|
|
|
6599
6930
|
} else warn$1(`Cannot unmount an app that is not mounted.`);
|
|
6600
6931
|
},
|
|
6601
6932
|
provide(key, value) {
|
|
6602
|
-
if (key in context.provides)
|
|
6603
|
-
|
|
6933
|
+
if (key in context.provides) {
|
|
6934
|
+
if (hasOwn(context.provides, key)) warn$1(`App already provides property with key "${String(key)}". It will be overwritten with the new value.`);
|
|
6935
|
+
else warn$1(`App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`);
|
|
6936
|
+
}
|
|
6604
6937
|
context.provides[key] = value;
|
|
6605
6938
|
return app;
|
|
6606
6939
|
},
|
|
@@ -6682,13 +7015,17 @@ var Vue = (function() {
|
|
|
6682
7015
|
const modifiers = getModelModifiers(props, camelizedName, defaultPropGetter);
|
|
6683
7016
|
const res = customRef((track, trigger) => {
|
|
6684
7017
|
let localValue;
|
|
7018
|
+
let prevPropValue = EMPTY_OBJ;
|
|
6685
7019
|
let prevSetValue = EMPTY_OBJ;
|
|
6686
7020
|
let prevEmittedValue;
|
|
6687
7021
|
watchSyncEffect(() => {
|
|
6688
7022
|
const propValue = props[camelizedName];
|
|
6689
|
-
if (hasChanged(
|
|
6690
|
-
|
|
6691
|
-
|
|
7023
|
+
if (hasChanged(prevPropValue, propValue)) {
|
|
7024
|
+
prevPropValue = propValue;
|
|
7025
|
+
if (hasChanged(localValue, propValue)) {
|
|
7026
|
+
localValue = propValue;
|
|
7027
|
+
trigger();
|
|
7028
|
+
}
|
|
6692
7029
|
}
|
|
6693
7030
|
});
|
|
6694
7031
|
return {
|
|
@@ -6711,12 +7048,13 @@ var Vue = (function() {
|
|
|
6711
7048
|
for (const key of rawPropKeys) if (key === name || key === camelizedName || key === hyphenatedName) parentPassedModelValue = true;
|
|
6712
7049
|
else if (key === `onUpdate:${name}` || key === `onUpdate:${camelizedName}` || key === `onUpdate:${hyphenatedName}`) parentPassedModelUpdater = true;
|
|
6713
7050
|
}
|
|
6714
|
-
|
|
7051
|
+
const hasVModel = parentPassedModelValue && parentPassedModelUpdater;
|
|
7052
|
+
if (!hasVModel) {
|
|
6715
7053
|
localValue = value;
|
|
6716
7054
|
trigger();
|
|
6717
7055
|
}
|
|
6718
7056
|
i.emit(`update:${name}`, emittedValue);
|
|
6719
|
-
if (hasChanged(value,
|
|
7057
|
+
if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) trigger();
|
|
6720
7058
|
prevSetValue = value;
|
|
6721
7059
|
prevEmittedValue = emittedValue;
|
|
6722
7060
|
}
|
|
@@ -6749,12 +7087,14 @@ var Vue = (function() {
|
|
|
6749
7087
|
if (instance.isUnmounted) return;
|
|
6750
7088
|
{
|
|
6751
7089
|
const { emitsOptions, propsOptions } = instance;
|
|
6752
|
-
if (emitsOptions)
|
|
6753
|
-
if (!
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
|
|
6757
|
-
if (
|
|
7090
|
+
if (emitsOptions) {
|
|
7091
|
+
if (!(event in emitsOptions) && !(event.startsWith("hook:") || event.startsWith(compatModelEventPrefix))) {
|
|
7092
|
+
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.`);
|
|
7093
|
+
} else {
|
|
7094
|
+
const validator = emitsOptions[event];
|
|
7095
|
+
if (isFunction(validator)) {
|
|
7096
|
+
if (!validator(...rawArgs)) warn$1(`Invalid event arguments: event validation failed for event "${event}".`);
|
|
7097
|
+
}
|
|
6758
7098
|
}
|
|
6759
7099
|
}
|
|
6760
7100
|
}
|
|
@@ -6764,7 +7104,7 @@ var Vue = (function() {
|
|
|
6764
7104
|
const modifiers = isCompatModelListener ? props.modelModifiers : isModelListener && getModelModifiers(props, event.slice(7), getter);
|
|
6765
7105
|
if (modifiers) {
|
|
6766
7106
|
if (modifiers.trim) args = rawArgs.map((a) => isString(a) ? a.trim() : a);
|
|
6767
|
-
if (modifiers.number) args =
|
|
7107
|
+
if (modifiers.number) args = args.map(looseToNumber);
|
|
6768
7108
|
}
|
|
6769
7109
|
devtoolsComponentEmit(instance, event, args);
|
|
6770
7110
|
{
|
|
@@ -6829,7 +7169,8 @@ var Vue = (function() {
|
|
|
6829
7169
|
function isEmitListener(options, key) {
|
|
6830
7170
|
if (!options || !isOn(key)) return false;
|
|
6831
7171
|
if (key.startsWith(compatModelEventPrefix)) return true;
|
|
6832
|
-
key = key.slice(2)
|
|
7172
|
+
key = key.slice(2);
|
|
7173
|
+
key = key === "Once" ? key : key.replace(/Once$/, "");
|
|
6833
7174
|
return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
|
|
6834
7175
|
}
|
|
6835
7176
|
//#endregion
|
|
@@ -6905,8 +7246,9 @@ var Vue = (function() {
|
|
|
6905
7246
|
root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
|
|
6906
7247
|
}
|
|
6907
7248
|
if (vnode.transition) {
|
|
6908
|
-
|
|
6909
|
-
|
|
7249
|
+
const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
|
|
7250
|
+
if (!isElementRoot(child)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
|
|
7251
|
+
setTransitionHooks(child, vnode.transition);
|
|
6910
7252
|
}
|
|
6911
7253
|
if (setRoot) setRoot(root);
|
|
6912
7254
|
else result = root;
|
|
@@ -6957,18 +7299,21 @@ var Vue = (function() {
|
|
|
6957
7299
|
for (let i = 0; i < children.length; i++) {
|
|
6958
7300
|
const child = children[i];
|
|
6959
7301
|
if (isVNode(child)) {
|
|
6960
|
-
if (child.type !== Comment || child.children === "v-if")
|
|
6961
|
-
|
|
6962
|
-
|
|
6963
|
-
|
|
7302
|
+
if (child.type !== Comment || child.children === "v-if") {
|
|
7303
|
+
if (singleRoot) return;
|
|
7304
|
+
else {
|
|
7305
|
+
singleRoot = child;
|
|
7306
|
+
if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) return filterSingleRoot(singleRoot.children);
|
|
7307
|
+
}
|
|
6964
7308
|
}
|
|
6965
7309
|
} else return;
|
|
6966
7310
|
}
|
|
6967
7311
|
return singleRoot;
|
|
6968
7312
|
}
|
|
7313
|
+
const isFunctionalFallthroughKey = (key) => key === "class" || key === "style" || isOn(key);
|
|
6969
7314
|
const getFunctionalFallthrough = (attrs) => {
|
|
6970
7315
|
let res;
|
|
6971
|
-
for (const key in attrs) if (
|
|
7316
|
+
for (const key in attrs) if (isFunctionalFallthroughKey(key)) (res || (res = {}))[key] = attrs[key];
|
|
6972
7317
|
return res;
|
|
6973
7318
|
};
|
|
6974
7319
|
const filterModelListeners = (attrs, props) => {
|
|
@@ -7104,16 +7449,17 @@ var Vue = (function() {
|
|
|
7104
7449
|
let key = propsToUpdate[i];
|
|
7105
7450
|
if (isEmitListener(instance.emitsOptions, key)) continue;
|
|
7106
7451
|
const value = rawProps[key];
|
|
7107
|
-
if (options)
|
|
7108
|
-
if (
|
|
7109
|
-
attrs[key]
|
|
7110
|
-
|
|
7452
|
+
if (options) {
|
|
7453
|
+
if (hasOwn(attrs, key)) {
|
|
7454
|
+
if (value !== attrs[key]) {
|
|
7455
|
+
attrs[key] = value;
|
|
7456
|
+
hasAttrsChanged = true;
|
|
7457
|
+
}
|
|
7458
|
+
} else {
|
|
7459
|
+
const camelizedKey = camelize(key);
|
|
7460
|
+
props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
|
|
7111
7461
|
}
|
|
7112
7462
|
} else {
|
|
7113
|
-
const camelizedKey = camelize(key);
|
|
7114
|
-
props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
|
|
7115
|
-
}
|
|
7116
|
-
else {
|
|
7117
7463
|
if (isOn(key) && key.endsWith("Native")) key = key.slice(0, -6);
|
|
7118
7464
|
else if (shouldSkipAttr(key, instance)) continue;
|
|
7119
7465
|
if (value !== attrs[key]) {
|
|
@@ -7126,9 +7472,11 @@ var Vue = (function() {
|
|
|
7126
7472
|
} else {
|
|
7127
7473
|
if (setFullProps(instance, rawProps, props, attrs)) hasAttrsChanged = true;
|
|
7128
7474
|
let kebabKey;
|
|
7129
|
-
for (const key in rawCurrentProps) if (!rawProps || !hasOwn(rawProps, key) && ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey)))
|
|
7130
|
-
if (
|
|
7131
|
-
|
|
7475
|
+
for (const key in rawCurrentProps) if (!rawProps || !hasOwn(rawProps, key) && ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
|
|
7476
|
+
if (options) {
|
|
7477
|
+
if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) props[key] = resolvePropValue(options, key, void 0, instance, baseResolveDefault, true);
|
|
7478
|
+
} else delete props[key];
|
|
7479
|
+
}
|
|
7132
7480
|
if (attrs !== rawCurrentProps) {
|
|
7133
7481
|
for (const key in attrs) if (!rawProps || !hasOwn(rawProps, key) && !hasOwn(rawProps, key + "Native")) {
|
|
7134
7482
|
delete attrs[key];
|
|
@@ -7149,9 +7497,10 @@ var Vue = (function() {
|
|
|
7149
7497
|
if (key === "inline-template") continue;
|
|
7150
7498
|
const value = rawProps[key];
|
|
7151
7499
|
let camelKey;
|
|
7152
|
-
if (options && hasOwn(options, camelKey = camelize(key)))
|
|
7153
|
-
|
|
7154
|
-
|
|
7500
|
+
if (options && hasOwn(options, camelKey = camelize(key))) {
|
|
7501
|
+
if (!needCastKeys || !needCastKeys.includes(camelKey)) props[camelKey] = value;
|
|
7502
|
+
else (rawCastValues || (rawCastValues = {}))[camelKey] = value;
|
|
7503
|
+
} else if (!isEmitListener(instance.emitsOptions, key)) {
|
|
7155
7504
|
if (isOn(key) && key.endsWith("Native")) key = key.slice(0, -6);
|
|
7156
7505
|
else if (shouldSkipAttr(key, instance)) continue;
|
|
7157
7506
|
if (!(key in attrs) || value !== attrs[key]) {
|
|
@@ -7200,7 +7549,7 @@ var Vue = (function() {
|
|
|
7200
7549
|
const prev = setCurrentInstance(instance);
|
|
7201
7550
|
const props = /* @__PURE__ */ toRaw(instance.props);
|
|
7202
7551
|
value = factory.call(isCompatEnabled$1("PROPS_DEFAULT_THIS", instance) ? createPropsDefaultThis(instance, props, key) : null, props);
|
|
7203
|
-
|
|
7552
|
+
restoreCurrentInstance(prev);
|
|
7204
7553
|
return value;
|
|
7205
7554
|
}
|
|
7206
7555
|
const mixinPropsCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -7317,7 +7666,7 @@ var Vue = (function() {
|
|
|
7317
7666
|
}
|
|
7318
7667
|
if (validator && !validator(value, /* @__PURE__ */ shallowReadonly(resolvedProps))) warn$1("Invalid prop: custom validator check failed for prop \"" + key + "\".");
|
|
7319
7668
|
}
|
|
7320
|
-
const isSimpleType =
|
|
7669
|
+
const isSimpleType = /*@__PURE__*/ makeMap("String,Number,Boolean,Function,Symbol,BigInt");
|
|
7321
7670
|
/**
|
|
7322
7671
|
* dev only
|
|
7323
7672
|
*/
|
|
@@ -7347,7 +7696,7 @@ var Vue = (function() {
|
|
|
7347
7696
|
const receivedType = toRawType(value);
|
|
7348
7697
|
const expectedValue = styleValue(value, expectedType);
|
|
7349
7698
|
const receivedValue = styleValue(value, receivedType);
|
|
7350
|
-
if (expectedTypes.length === 1 && isExplicable(expectedType) &&
|
|
7699
|
+
if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) message += ` with value ${expectedValue}`;
|
|
7351
7700
|
message += `, got ${receivedType} `;
|
|
7352
7701
|
if (isExplicable(receivedType)) message += `with value ${receivedValue}.`;
|
|
7353
7702
|
return message;
|
|
@@ -7356,7 +7705,8 @@ var Vue = (function() {
|
|
|
7356
7705
|
* dev only
|
|
7357
7706
|
*/
|
|
7358
7707
|
function styleValue(value, type) {
|
|
7359
|
-
if (
|
|
7708
|
+
if (isSymbol(value)) return value.toString();
|
|
7709
|
+
else if (type === "String") return `"${value}"`;
|
|
7360
7710
|
else if (type === "Number") return `${Number(value)}`;
|
|
7361
7711
|
else return `${value}`;
|
|
7362
7712
|
}
|
|
@@ -7373,8 +7723,11 @@ var Vue = (function() {
|
|
|
7373
7723
|
/**
|
|
7374
7724
|
* dev only
|
|
7375
7725
|
*/
|
|
7376
|
-
function
|
|
7377
|
-
return args.
|
|
7726
|
+
function isCoercible(...args) {
|
|
7727
|
+
return args.every((elem) => {
|
|
7728
|
+
const value = elem.toLowerCase();
|
|
7729
|
+
return value !== "boolean" && value !== "symbol";
|
|
7730
|
+
});
|
|
7378
7731
|
}
|
|
7379
7732
|
//#endregion
|
|
7380
7733
|
//#region packages/runtime-core/src/componentSlots.ts
|
|
@@ -7426,12 +7779,13 @@ var Vue = (function() {
|
|
|
7426
7779
|
let deletionComparisonTarget = EMPTY_OBJ;
|
|
7427
7780
|
if (vnode.shapeFlag & 32) {
|
|
7428
7781
|
const type = children._;
|
|
7429
|
-
if (type)
|
|
7430
|
-
|
|
7431
|
-
|
|
7432
|
-
|
|
7433
|
-
|
|
7434
|
-
|
|
7782
|
+
if (type) {
|
|
7783
|
+
if (isHmrUpdating) {
|
|
7784
|
+
assignSlots(slots, children, optimized);
|
|
7785
|
+
trigger(instance, "set", "$slots");
|
|
7786
|
+
} else if (optimized && type === 1) needDeletionCheck = false;
|
|
7787
|
+
else assignSlots(slots, children, optimized);
|
|
7788
|
+
} else {
|
|
7435
7789
|
needDeletionCheck = !children.$stable;
|
|
7436
7790
|
normalizeObjectSlots(children, slots, instance);
|
|
7437
7791
|
}
|
|
@@ -7449,7 +7803,7 @@ var Vue = (function() {
|
|
|
7449
7803
|
let supported;
|
|
7450
7804
|
let perf;
|
|
7451
7805
|
let cachedNow$1 = 0;
|
|
7452
|
-
const p$1 =
|
|
7806
|
+
const p$1 = /*@__PURE__*/ Promise.resolve();
|
|
7453
7807
|
const getNow$1 = () => cachedNow$1 || (p$1.then(() => cachedNow$1 = 0), cachedNow$1 = isSupported() ? perf.now() : Date.now());
|
|
7454
7808
|
/**
|
|
7455
7809
|
* @internal
|
|
@@ -7530,6 +7884,10 @@ var Vue = (function() {
|
|
|
7530
7884
|
optimized = false;
|
|
7531
7885
|
n2.dynamicChildren = null;
|
|
7532
7886
|
}
|
|
7887
|
+
if (n2.dynamicChildren && n1 && n1.dynamicChildren && n1.dynamicChildren.hasOnce) {
|
|
7888
|
+
if (n2.dynamicChildren === EMPTY_ARR) n2.dynamicChildren = [];
|
|
7889
|
+
n2.dynamicChildren.hasOnce = true;
|
|
7890
|
+
}
|
|
7533
7891
|
const { type, ref, shapeFlag } = n2;
|
|
7534
7892
|
switch (type) {
|
|
7535
7893
|
case Text:
|
|
@@ -7546,7 +7904,7 @@ var Vue = (function() {
|
|
|
7546
7904
|
processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
7547
7905
|
break;
|
|
7548
7906
|
case VaporSlot:
|
|
7549
|
-
getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense);
|
|
7907
|
+
getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense, slotScopeIds);
|
|
7550
7908
|
break;
|
|
7551
7909
|
default: if (shapeFlag & 1) processElement(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
7552
7910
|
else if (shapeFlag & 6) processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
@@ -7665,7 +8023,10 @@ var Vue = (function() {
|
|
|
7665
8023
|
for (let i = 0; i < inheritedScopeIds.length; i++) hostSetScopeId(el, inheritedScopeIds[i]);
|
|
7666
8024
|
};
|
|
7667
8025
|
const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
|
|
7668
|
-
for (let i = start; i < children.length; i++)
|
|
8026
|
+
for (let i = start; i < children.length; i++) {
|
|
8027
|
+
const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
|
|
8028
|
+
patch(null, child, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
8029
|
+
}
|
|
7669
8030
|
};
|
|
7670
8031
|
const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
7671
8032
|
const el = n2.el = n1.el;
|
|
@@ -7677,9 +8038,10 @@ var Vue = (function() {
|
|
|
7677
8038
|
let vnodeHook;
|
|
7678
8039
|
parentComponent && toggleRecurse(parentComponent, false);
|
|
7679
8040
|
if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
8041
|
+
if (n2.ibu) n2.ibu();
|
|
7680
8042
|
if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
7681
8043
|
parentComponent && toggleRecurse(parentComponent, true);
|
|
7682
|
-
if (isHmrUpdating) {
|
|
8044
|
+
if (isHmrUpdating || dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
|
|
7683
8045
|
patchFlag = 0;
|
|
7684
8046
|
optimized = false;
|
|
7685
8047
|
dynamicChildren = null;
|
|
@@ -7710,8 +8072,9 @@ var Vue = (function() {
|
|
|
7710
8072
|
if (n1.children !== n2.children) hostSetElementText(el, n2.children);
|
|
7711
8073
|
}
|
|
7712
8074
|
} else if (!optimized && dynamicChildren == null) patchProps(el, oldProps, newProps, parentComponent, namespace);
|
|
7713
|
-
if ((vnodeHook = newProps.onVnodeUpdated) || dirs) queuePostRenderEffect(() => {
|
|
8075
|
+
if ((vnodeHook = newProps.onVnodeUpdated) || dirs || n2.iu) queuePostRenderEffect(() => {
|
|
7714
8076
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
8077
|
+
n2.iu && n2.iu();
|
|
7715
8078
|
dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
7716
8079
|
}, void 0, parentSuspense);
|
|
7717
8080
|
};
|
|
@@ -7719,7 +8082,8 @@ var Vue = (function() {
|
|
|
7719
8082
|
for (let i = 0; i < newChildren.length; i++) {
|
|
7720
8083
|
const oldVNode = oldChildren[i];
|
|
7721
8084
|
const newVNode = newChildren[i];
|
|
7722
|
-
|
|
8085
|
+
const container = oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer;
|
|
8086
|
+
patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
|
|
7723
8087
|
}
|
|
7724
8088
|
};
|
|
7725
8089
|
const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
|
|
@@ -7757,25 +8121,15 @@ var Vue = (function() {
|
|
|
7757
8121
|
};
|
|
7758
8122
|
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
7759
8123
|
n2.slotScopeIds = slotScopeIds;
|
|
7760
|
-
if (n2.type.__vapor)
|
|
7761
|
-
|
|
7762
|
-
|
|
7763
|
-
|
|
7764
|
-
|
|
7765
|
-
|
|
7766
|
-
|
|
7767
|
-
|
|
7768
|
-
|
|
7769
|
-
}
|
|
7770
|
-
else {
|
|
7771
|
-
getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdateComponent(n1, n2, optimized), () => {
|
|
7772
|
-
if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
7773
|
-
});
|
|
7774
|
-
if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, n1, parentComponent, "updated"), void 0, parentSuspense);
|
|
7775
|
-
}
|
|
7776
|
-
else if (n1 == null) if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
7777
|
-
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
7778
|
-
else updateComponent(n1, n2, optimized);
|
|
8124
|
+
if (n2.type.__vapor) {
|
|
8125
|
+
if (n1 == null) {
|
|
8126
|
+
if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
|
|
8127
|
+
else getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense);
|
|
8128
|
+
} else getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdateComponent(n1, n2, optimized));
|
|
8129
|
+
} else if (n1 == null) {
|
|
8130
|
+
if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
8131
|
+
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
8132
|
+
} else updateComponent(n1, n2, optimized);
|
|
7779
8133
|
};
|
|
7780
8134
|
const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
|
|
7781
8135
|
const compatMountInstance = initialVNode.isCompatRoot && initialVNode.component;
|
|
@@ -7819,16 +8173,18 @@ var Vue = (function() {
|
|
|
7819
8173
|
};
|
|
7820
8174
|
const updateComponent = (n1, n2, optimized) => {
|
|
7821
8175
|
const instance = n2.component = n1.component;
|
|
7822
|
-
if (shouldUpdateComponent(n1, n2, optimized))
|
|
7823
|
-
|
|
7824
|
-
|
|
7825
|
-
|
|
7826
|
-
|
|
8176
|
+
if (shouldUpdateComponent(n1, n2, optimized)) {
|
|
8177
|
+
if (instance.asyncDep && !instance.asyncResolved) {
|
|
8178
|
+
pushWarningContext(n2);
|
|
8179
|
+
n2.el = n1.el;
|
|
8180
|
+
updateComponentPreRender(instance, n2, optimized);
|
|
8181
|
+
popWarningContext();
|
|
8182
|
+
return;
|
|
8183
|
+
} else {
|
|
8184
|
+
instance.next = n2;
|
|
8185
|
+
instance.effect.run();
|
|
8186
|
+
}
|
|
7827
8187
|
} else {
|
|
7828
|
-
instance.next = n2;
|
|
7829
|
-
instance.effect.run();
|
|
7830
|
-
}
|
|
7831
|
-
else {
|
|
7832
8188
|
n2.el = n1.el;
|
|
7833
8189
|
instance.vnode = n2;
|
|
7834
8190
|
}
|
|
@@ -7931,6 +8287,7 @@ var Vue = (function() {
|
|
|
7931
8287
|
} else next = vnode;
|
|
7932
8288
|
if (bu) invokeArrayFns(bu);
|
|
7933
8289
|
if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
8290
|
+
if (next.ibu) next.ibu();
|
|
7934
8291
|
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) instance.emit("hook:beforeUpdate");
|
|
7935
8292
|
toggleRecurse(instance, true);
|
|
7936
8293
|
startMeasure(instance, `render`);
|
|
@@ -7944,7 +8301,10 @@ var Vue = (function() {
|
|
|
7944
8301
|
next.el = nextTree.el;
|
|
7945
8302
|
if (originNext === null) updateHOCHostEl(instance, nextTree.el);
|
|
7946
8303
|
if (u) queuePostRenderEffect(u, void 0, parentSuspense);
|
|
7947
|
-
if (vnodeHook = next.props && next.props.onVnodeUpdated) queuePostRenderEffect(() =>
|
|
8304
|
+
if ((vnodeHook = next.props && next.props.onVnodeUpdated) || next.iu) queuePostRenderEffect(() => {
|
|
8305
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
8306
|
+
next.iu && next.iu();
|
|
8307
|
+
}, void 0, parentSuspense);
|
|
7948
8308
|
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) queuePostRenderEffect(() => instance.emit("hook:updated"), void 0, parentSuspense);
|
|
7949
8309
|
devtoolsComponentUpdated(instance);
|
|
7950
8310
|
popWarningContext();
|
|
@@ -7985,9 +8345,10 @@ var Vue = (function() {
|
|
|
7985
8345
|
if (shapeFlag & 8) {
|
|
7986
8346
|
if (prevShapeFlag & 16) unmountChildren(c1, parentComponent, parentSuspense);
|
|
7987
8347
|
if (c2 !== c1) hostSetElementText(container, c2);
|
|
7988
|
-
} else if (prevShapeFlag & 16)
|
|
7989
|
-
|
|
7990
|
-
|
|
8348
|
+
} else if (prevShapeFlag & 16) {
|
|
8349
|
+
if (shapeFlag & 16) patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
8350
|
+
else unmountChildren(c1, parentComponent, parentSuspense, true);
|
|
8351
|
+
} else {
|
|
7991
8352
|
if (prevShapeFlag & 8) hostSetElementText(container, "");
|
|
7992
8353
|
if (shapeFlag & 16) mountChildren(c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
7993
8354
|
}
|
|
@@ -8086,15 +8447,17 @@ var Vue = (function() {
|
|
|
8086
8447
|
const anchorVNode = c2[nextIndex + 1];
|
|
8087
8448
|
const anchor = nextIndex + 1 < l2 ? anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode) : parentAnchor;
|
|
8088
8449
|
if (newIndexToOldIndexMap[i] === 0) patch(null, nextChild, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
8089
|
-
else if (moved)
|
|
8090
|
-
|
|
8450
|
+
else if (moved) {
|
|
8451
|
+
if (j < 0 || i !== increasingNewIndexSequence[j]) move(nextChild, container, anchor, 2, parentComponent);
|
|
8452
|
+
else j--;
|
|
8453
|
+
}
|
|
8091
8454
|
}
|
|
8092
8455
|
}
|
|
8093
8456
|
};
|
|
8094
8457
|
const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
|
|
8095
8458
|
const { el, type, transition, children, shapeFlag } = vnode;
|
|
8096
8459
|
if (isVaporComponent(type) || type === VaporSlot) {
|
|
8097
|
-
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType);
|
|
8460
|
+
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType, parentSuspense);
|
|
8098
8461
|
return;
|
|
8099
8462
|
}
|
|
8100
8463
|
if (shapeFlag & 6) {
|
|
@@ -8119,49 +8482,37 @@ var Vue = (function() {
|
|
|
8119
8482
|
moveStaticNode(vnode, container, anchor);
|
|
8120
8483
|
return;
|
|
8121
8484
|
}
|
|
8122
|
-
if (moveType !== 2 && shapeFlag & 1 && transition)
|
|
8123
|
-
|
|
8124
|
-
|
|
8125
|
-
const remove = () => {
|
|
8485
|
+
if (moveType !== 2 && shapeFlag & 1 && transition) {
|
|
8486
|
+
if (moveType === 0) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense, true);
|
|
8487
|
+
else performTransitionLeave(el, transition, () => {
|
|
8126
8488
|
if (vnode.ctx.isUnmounted) hostRemove(el);
|
|
8127
8489
|
else hostInsert(el, container, anchor);
|
|
8128
|
-
};
|
|
8129
|
-
|
|
8130
|
-
if (el._isLeaving) el[leaveCbKey](true);
|
|
8131
|
-
leave(el, () => {
|
|
8132
|
-
remove();
|
|
8133
|
-
afterLeave && afterLeave();
|
|
8134
|
-
});
|
|
8135
|
-
};
|
|
8136
|
-
if (delayLeave) delayLeave(el, remove, performLeave);
|
|
8137
|
-
else performLeave();
|
|
8138
|
-
}
|
|
8139
|
-
else hostInsert(el, container, anchor);
|
|
8490
|
+
}, true, true);
|
|
8491
|
+
} else hostInsert(el, container, anchor);
|
|
8140
8492
|
};
|
|
8141
8493
|
const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
|
|
8142
8494
|
const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
|
|
8143
|
-
if (patchFlag === -2) optimized = false;
|
|
8495
|
+
if (patchFlag === -2 || dynamicChildren && dynamicChildren.hasOnce) optimized = false;
|
|
8144
8496
|
if (ref != null) {
|
|
8145
8497
|
const prevSub = setActiveSub();
|
|
8146
8498
|
setRef(ref, null, parentSuspense, vnode, true);
|
|
8147
8499
|
setActiveSub(prevSub);
|
|
8148
8500
|
}
|
|
8149
|
-
if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
|
|
8501
|
+
if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
|
|
8150
8502
|
if (shapeFlag & 256) {
|
|
8151
|
-
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer());
|
|
8503
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
|
|
8152
8504
|
else parentComponent.ctx.deactivate(vnode);
|
|
8153
8505
|
return;
|
|
8154
8506
|
}
|
|
8507
|
+
if (shapeFlag & 6 && isVaporComponent(type)) {
|
|
8508
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
8509
|
+
return;
|
|
8510
|
+
}
|
|
8155
8511
|
const shouldInvokeDirs = shapeFlag & 1 && dirs;
|
|
8156
8512
|
const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
|
|
8157
8513
|
let vnodeHook;
|
|
8158
8514
|
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
8159
|
-
if (shapeFlag & 6)
|
|
8160
|
-
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
|
|
8161
|
-
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
8162
|
-
if (dirs) queuePostRenderEffect(() => invokeDirectiveHook(vnode, null, parentComponent, "unmounted"), void 0, parentSuspense);
|
|
8163
|
-
return;
|
|
8164
|
-
} else unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
8515
|
+
if (shapeFlag & 6) unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
8165
8516
|
else {
|
|
8166
8517
|
if (shapeFlag & 128) {
|
|
8167
8518
|
vnode.suspense.unmount(parentSuspense, doRemove);
|
|
@@ -8172,7 +8523,7 @@ var Vue = (function() {
|
|
|
8172
8523
|
else if (dynamicChildren && !dynamicChildren.hasOnce && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
|
|
8173
8524
|
else if (type === Fragment && patchFlag & 384 || !optimized && shapeFlag & 16) unmountChildren(children, parentComponent, parentSuspense);
|
|
8174
8525
|
if (type === VaporSlot) {
|
|
8175
|
-
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
8526
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
8176
8527
|
return;
|
|
8177
8528
|
}
|
|
8178
8529
|
if (doRemove) remove(vnode);
|
|
@@ -8196,6 +8547,7 @@ var Vue = (function() {
|
|
|
8196
8547
|
}
|
|
8197
8548
|
if (type === Static) {
|
|
8198
8549
|
removeStaticNode(vnode);
|
|
8550
|
+
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
8199
8551
|
return;
|
|
8200
8552
|
}
|
|
8201
8553
|
if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
|
|
@@ -8221,6 +8573,9 @@ var Vue = (function() {
|
|
|
8221
8573
|
if (effect) {
|
|
8222
8574
|
effect.stop();
|
|
8223
8575
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
8576
|
+
} else if (instance.vnode.el && subTree) {
|
|
8577
|
+
subTree.transition = instance.vnode.transition;
|
|
8578
|
+
unmount(subTree, instance, parentSuspense, doRemove);
|
|
8224
8579
|
}
|
|
8225
8580
|
if (um) queuePostRenderEffect(um, void 0, parentSuspense);
|
|
8226
8581
|
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) queuePostRenderEffect(() => instance.emit("hook:destroyed"), void 0, parentSuspense);
|
|
@@ -8296,12 +8651,14 @@ var Vue = (function() {
|
|
|
8296
8651
|
return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
|
|
8297
8652
|
}
|
|
8298
8653
|
function toggleRecurse({ effect, job, vapor }, allowed) {
|
|
8299
|
-
if (!vapor)
|
|
8300
|
-
|
|
8301
|
-
|
|
8302
|
-
|
|
8303
|
-
|
|
8304
|
-
|
|
8654
|
+
if (!vapor) {
|
|
8655
|
+
if (allowed) {
|
|
8656
|
+
effect.flags |= 128;
|
|
8657
|
+
job.flags |= 2;
|
|
8658
|
+
} else {
|
|
8659
|
+
effect.flags &= -129;
|
|
8660
|
+
job.flags &= -3;
|
|
8661
|
+
}
|
|
8305
8662
|
}
|
|
8306
8663
|
}
|
|
8307
8664
|
function needTransition(parentSuspense, transition) {
|
|
@@ -8341,13 +8698,19 @@ var Vue = (function() {
|
|
|
8341
8698
|
}
|
|
8342
8699
|
function locateNonHydratedAsyncRoot(instance) {
|
|
8343
8700
|
const subComponent = instance.subTree && instance.subTree.component;
|
|
8344
|
-
if (subComponent)
|
|
8345
|
-
|
|
8701
|
+
if (subComponent) {
|
|
8702
|
+
if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
|
|
8703
|
+
else return locateNonHydratedAsyncRoot(subComponent);
|
|
8704
|
+
}
|
|
8346
8705
|
}
|
|
8347
8706
|
function invalidateMount(hooks) {
|
|
8348
8707
|
if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
|
|
8349
8708
|
}
|
|
8350
8709
|
function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
|
|
8710
|
+
if (force && transition.persisted && !el[leaveCbKey]) {
|
|
8711
|
+
insert();
|
|
8712
|
+
return;
|
|
8713
|
+
}
|
|
8351
8714
|
if (force || needTransition(parentSuspense, transition)) {
|
|
8352
8715
|
transition.beforeEnter(el);
|
|
8353
8716
|
insert();
|
|
@@ -8357,13 +8720,15 @@ var Vue = (function() {
|
|
|
8357
8720
|
function performTransitionLeave(el, transition, remove, isElement = true, force = false) {
|
|
8358
8721
|
const performRemove = () => {
|
|
8359
8722
|
remove();
|
|
8360
|
-
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
8723
|
+
if (transition && (force || !transition.persisted) && transition.afterLeave) transition.afterLeave();
|
|
8361
8724
|
};
|
|
8362
8725
|
if (force || isElement && transition && !transition.persisted) {
|
|
8363
8726
|
const { leave, delayLeave } = transition;
|
|
8364
8727
|
const performLeave = () => {
|
|
8728
|
+
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
8365
8729
|
if (el._isLeaving && force) el[leaveCbKey](true);
|
|
8366
|
-
|
|
8730
|
+
if (force && transition.persisted && !wasLeaving) remove();
|
|
8731
|
+
else leave(el, performRemove);
|
|
8367
8732
|
};
|
|
8368
8733
|
if (delayLeave) delayLeave(el, performRemove, performLeave);
|
|
8369
8734
|
else performLeave();
|
|
@@ -8382,7 +8747,7 @@ var Vue = (function() {
|
|
|
8382
8747
|
/**
|
|
8383
8748
|
* shared between vdom and vapor
|
|
8384
8749
|
*/
|
|
8385
|
-
function getInheritedScopeIds(vnode, parentComponent) {
|
|
8750
|
+
function getInheritedScopeIds(vnode, parentComponent, includeVaporRootIds = true) {
|
|
8386
8751
|
const inheritedScopeIds = [];
|
|
8387
8752
|
let currentParent = parentComponent;
|
|
8388
8753
|
let currentVNode = vnode;
|
|
@@ -8398,6 +8763,8 @@ var Vue = (function() {
|
|
|
8398
8763
|
currentParent = currentParent.parent;
|
|
8399
8764
|
} else break;
|
|
8400
8765
|
}
|
|
8766
|
+
const vaporScopeIds = includeVaporRootIds && currentVNode.vaporScopeIds;
|
|
8767
|
+
if (vaporScopeIds) inheritedScopeIds.push(...vaporScopeIds);
|
|
8401
8768
|
return inheritedScopeIds;
|
|
8402
8769
|
}
|
|
8403
8770
|
function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
@@ -8416,7 +8783,7 @@ var Vue = (function() {
|
|
|
8416
8783
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
8417
8784
|
if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
|
|
8418
8785
|
else {
|
|
8419
|
-
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
|
|
8786
|
+
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
|
|
8420
8787
|
n2.suspense = n1.suspense;
|
|
8421
8788
|
n2.suspense.vnode = n2;
|
|
8422
8789
|
n2.el = n1.el;
|
|
@@ -8454,10 +8821,12 @@ var Vue = (function() {
|
|
|
8454
8821
|
if (pendingBranch) {
|
|
8455
8822
|
suspense.pendingBranch = newBranch;
|
|
8456
8823
|
if (isSameVNodeType(pendingBranch, newBranch)) {
|
|
8457
|
-
|
|
8824
|
+
suspense.deps++;
|
|
8825
|
+
patch(pendingBranch, newBranch, isHydrating ? container : suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
8826
|
+
suspense.deps--;
|
|
8458
8827
|
if (suspense.deps <= 0) suspense.resolve();
|
|
8459
8828
|
else if (isInFallback) {
|
|
8460
|
-
if (!isHydrating) {
|
|
8829
|
+
if (!isHydrating && !suspense.isFallbackMountPending) {
|
|
8461
8830
|
patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
8462
8831
|
setActiveBranch(suspense, newFallback);
|
|
8463
8832
|
}
|
|
@@ -8469,12 +8838,16 @@ var Vue = (function() {
|
|
|
8469
8838
|
suspense.activeBranch = pendingBranch;
|
|
8470
8839
|
} else unmount(pendingBranch, parentComponent, suspense);
|
|
8471
8840
|
suspense.deps = 0;
|
|
8841
|
+
for (let i = 0; i < suspense.effects.length; i++) {
|
|
8842
|
+
const effect = suspense.effects[i];
|
|
8843
|
+
if (effect.flags & 8) queuePostFlushCb(effect);
|
|
8844
|
+
}
|
|
8472
8845
|
suspense.effects.length = 0;
|
|
8473
8846
|
suspense.hiddenContainer = createElement("div");
|
|
8474
8847
|
if (isInFallback) {
|
|
8475
8848
|
patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
8476
8849
|
if (suspense.deps <= 0) suspense.resolve();
|
|
8477
|
-
else {
|
|
8850
|
+
else if (!suspense.isFallbackMountPending) {
|
|
8478
8851
|
patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
8479
8852
|
setActiveBranch(suspense, newFallback);
|
|
8480
8853
|
}
|
|
@@ -8550,15 +8923,19 @@ var Vue = (function() {
|
|
|
8550
8923
|
if (suspense.isHydrating) suspense.isHydrating = false;
|
|
8551
8924
|
else if (!resume) {
|
|
8552
8925
|
delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
|
|
8926
|
+
let hasUpdatedAnchor = false;
|
|
8553
8927
|
if (delayEnter) activeBranch.transition.afterLeave = () => {
|
|
8554
8928
|
if (pendingId === suspense.pendingId) {
|
|
8555
|
-
move(pendingBranch, container, anchor === initialAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
8929
|
+
move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
8556
8930
|
queuePostFlushCb(effects);
|
|
8557
8931
|
if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
|
|
8558
8932
|
}
|
|
8559
8933
|
};
|
|
8560
8934
|
if (activeBranch && !suspense.isFallbackMountPending) {
|
|
8561
|
-
if (parentNode(activeBranch.el) === container)
|
|
8935
|
+
if (parentNode(activeBranch.el) === container) {
|
|
8936
|
+
anchor = next(activeBranch);
|
|
8937
|
+
hasUpdatedAnchor = true;
|
|
8938
|
+
}
|
|
8562
8939
|
unmount(activeBranch, parentComponent, suspense, true);
|
|
8563
8940
|
if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
|
|
8564
8941
|
}
|
|
@@ -8572,7 +8949,7 @@ var Vue = (function() {
|
|
|
8572
8949
|
let hasUnresolvedAncestor = false;
|
|
8573
8950
|
while (parent) {
|
|
8574
8951
|
if (parent.pendingBranch) {
|
|
8575
|
-
parent.effects.push(
|
|
8952
|
+
for (let i = 0; i < effects.length; i++) parent.effects.push(effects[i]);
|
|
8576
8953
|
hasUnresolvedAncestor = true;
|
|
8577
8954
|
break;
|
|
8578
8955
|
}
|
|
@@ -8582,6 +8959,7 @@ var Vue = (function() {
|
|
|
8582
8959
|
suspense.effects = [];
|
|
8583
8960
|
if (isSuspensible) {
|
|
8584
8961
|
if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
|
|
8962
|
+
parentSuspenseId = void 0;
|
|
8585
8963
|
parentSuspense.deps--;
|
|
8586
8964
|
if (parentSuspense.deps === 0 && !sync) parentSuspense.resolve();
|
|
8587
8965
|
}
|
|
@@ -8596,8 +8974,9 @@ var Vue = (function() {
|
|
|
8596
8974
|
const mountFallback = () => {
|
|
8597
8975
|
suspense.isFallbackMountPending = false;
|
|
8598
8976
|
if (!suspense.isInFallback) return;
|
|
8599
|
-
|
|
8600
|
-
|
|
8977
|
+
const latestFallback = suspense.vnode.ssFallback;
|
|
8978
|
+
patch(null, latestFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
8979
|
+
setActiveBranch(suspense, latestFallback);
|
|
8601
8980
|
};
|
|
8602
8981
|
const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
|
|
8603
8982
|
if (delayEnter) {
|
|
@@ -8618,10 +8997,16 @@ var Vue = (function() {
|
|
|
8618
8997
|
registerDep(instance, onResolve) {
|
|
8619
8998
|
const isInPendingSuspense = !!suspense.pendingBranch;
|
|
8620
8999
|
if (isInPendingSuspense) suspense.deps++;
|
|
9000
|
+
const hydratedEl = instance.vnode && instance.vnode.el;
|
|
8621
9001
|
instance.asyncDep.catch((err) => {
|
|
8622
9002
|
handleError(err, instance, 0);
|
|
8623
9003
|
}).then((asyncSetupResult) => {
|
|
8624
9004
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
9005
|
+
setCurrentInstance(null, void 0);
|
|
9006
|
+
if (hydratedEl && !instance.scope.active) {
|
|
9007
|
+
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
9008
|
+
return;
|
|
9009
|
+
}
|
|
8625
9010
|
instance.asyncResolved = true;
|
|
8626
9011
|
onResolve(asyncSetupResult);
|
|
8627
9012
|
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
@@ -8672,9 +9057,10 @@ var Vue = (function() {
|
|
|
8672
9057
|
return s;
|
|
8673
9058
|
}
|
|
8674
9059
|
function queueEffectWithSuspense(fn, id, suspense) {
|
|
8675
|
-
if (suspense && suspense.pendingBranch)
|
|
8676
|
-
|
|
8677
|
-
|
|
9060
|
+
if (suspense && suspense.pendingBranch) {
|
|
9061
|
+
if (isArray(fn)) suspense.effects.push(...fn);
|
|
9062
|
+
else suspense.effects.push(fn);
|
|
9063
|
+
} else queuePostFlushCb(fn, id);
|
|
8678
9064
|
}
|
|
8679
9065
|
function setActiveBranch(suspense, branch) {
|
|
8680
9066
|
suspense.activeBranch = branch;
|
|
@@ -8881,11 +9267,26 @@ var Vue = (function() {
|
|
|
8881
9267
|
if (shapeFlag & 128) type.normalize(vnode);
|
|
8882
9268
|
} else if (children) vnode.shapeFlag |= isString(children) ? 8 : 16;
|
|
8883
9269
|
if (vnode.key !== vnode.key) warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
|
|
9270
|
+
if (props && vnode.shapeFlag & 1) {
|
|
9271
|
+
const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
|
|
9272
|
+
if (overwritingProp && hasContentChildren(vnode.children)) warn$1(`The \`${overwritingProp}\` prop on <${vnode.type}> will override its children. Remove either the \`${overwritingProp}\` prop or the children.`);
|
|
9273
|
+
}
|
|
8884
9274
|
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock && (vnode.patchFlag > 0 || shapeFlag & 6) && vnode.patchFlag !== 32) currentBlock.push(vnode);
|
|
8885
9275
|
convertLegacyVModelProps(vnode);
|
|
8886
9276
|
defineLegacyVNodeProperties(vnode);
|
|
8887
9277
|
return vnode;
|
|
8888
9278
|
}
|
|
9279
|
+
/**
|
|
9280
|
+
* dev only
|
|
9281
|
+
* Whether children would actually render something. Empty text and empty
|
|
9282
|
+
* arrays are ignored, mirroring the compiler's `node.children.length` check
|
|
9283
|
+
* for `v-html` / `v-text`.
|
|
9284
|
+
*/
|
|
9285
|
+
function hasContentChildren(children) {
|
|
9286
|
+
if (isString(children)) return children !== "";
|
|
9287
|
+
if (isArray(children)) return children.length > 0;
|
|
9288
|
+
return false;
|
|
9289
|
+
}
|
|
8889
9290
|
const createVNode = createVNodeWithArgsTransform;
|
|
8890
9291
|
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
|
|
8891
9292
|
if (!type || type === NULL_DYNAMIC_COMPONENT) {
|
|
@@ -8895,8 +9296,10 @@ var Vue = (function() {
|
|
|
8895
9296
|
if (isVNode(type)) {
|
|
8896
9297
|
const cloned = cloneVNode(type, props, true);
|
|
8897
9298
|
if (children) normalizeChildren(cloned, children);
|
|
8898
|
-
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock)
|
|
8899
|
-
|
|
9299
|
+
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
|
|
9300
|
+
if (cloned.shapeFlag & 6) currentBlock[currentBlock.indexOf(type)] = cloned;
|
|
9301
|
+
else currentBlock.push(cloned);
|
|
9302
|
+
}
|
|
8900
9303
|
cloned.patchFlag = -2;
|
|
8901
9304
|
return cloned;
|
|
8902
9305
|
}
|
|
@@ -8954,12 +9357,32 @@ var Vue = (function() {
|
|
|
8954
9357
|
el: vnode.el,
|
|
8955
9358
|
anchor: vnode.anchor,
|
|
8956
9359
|
ctx: vnode.ctx,
|
|
8957
|
-
ce: vnode.ce
|
|
9360
|
+
ce: vnode.ce,
|
|
9361
|
+
vi: vnode.vi,
|
|
9362
|
+
vs: cloneVaporSlotMeta(vnode),
|
|
9363
|
+
vb: vnode.vb,
|
|
9364
|
+
ibu: vnode.ibu,
|
|
9365
|
+
iu: vnode.iu,
|
|
9366
|
+
cacheIndex: vnode.cacheIndex
|
|
8958
9367
|
};
|
|
8959
9368
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
8960
9369
|
defineLegacyVNodeProperties(cloned);
|
|
8961
9370
|
return cloned;
|
|
8962
9371
|
}
|
|
9372
|
+
function cloneVaporSlotMeta(vnode) {
|
|
9373
|
+
const vaporSlot = vnode.vs;
|
|
9374
|
+
if (!vaporSlot) return vaporSlot;
|
|
9375
|
+
const cloned = {
|
|
9376
|
+
slot: vaporSlot.slot,
|
|
9377
|
+
outlets: vaporSlot.outlets
|
|
9378
|
+
};
|
|
9379
|
+
if (vnode.el) {
|
|
9380
|
+
cloned.state = vaporSlot.state;
|
|
9381
|
+
cloned.ref = vaporSlot.ref;
|
|
9382
|
+
cloned.scope = vaporSlot.scope;
|
|
9383
|
+
}
|
|
9384
|
+
return cloned;
|
|
9385
|
+
}
|
|
8963
9386
|
/**
|
|
8964
9387
|
* Dev only, for HMR of hoisted vnodes reused in v-for
|
|
8965
9388
|
* https://github.com/vitejs/vite/issues/2022
|
|
@@ -9003,25 +9426,32 @@ var Vue = (function() {
|
|
|
9003
9426
|
const { shapeFlag } = vnode;
|
|
9004
9427
|
if (children == null) children = null;
|
|
9005
9428
|
else if (isArray(children)) type = 16;
|
|
9006
|
-
else if (typeof children === "object")
|
|
9007
|
-
|
|
9008
|
-
|
|
9009
|
-
|
|
9010
|
-
|
|
9011
|
-
|
|
9429
|
+
else if (typeof children === "object") {
|
|
9430
|
+
if (shapeFlag & 65) {
|
|
9431
|
+
const slot = children.default;
|
|
9432
|
+
if (slot) {
|
|
9433
|
+
slot._c && (slot._d = false);
|
|
9434
|
+
normalizeChildren(vnode, slot());
|
|
9435
|
+
slot._c && (slot._d = true);
|
|
9436
|
+
}
|
|
9437
|
+
return;
|
|
9438
|
+
} else {
|
|
9439
|
+
type = 32;
|
|
9440
|
+
const slotFlag = children._;
|
|
9441
|
+
if (!slotFlag && !isInternalObject(children)) children._ctx = currentRenderingInstance;
|
|
9442
|
+
else if (slotFlag === 3 && currentRenderingInstance) {
|
|
9443
|
+
if (currentRenderingInstance.slots._ === 1) children._ = 1;
|
|
9444
|
+
else {
|
|
9445
|
+
children._ = 2;
|
|
9446
|
+
vnode.patchFlag |= 1024;
|
|
9447
|
+
}
|
|
9448
|
+
}
|
|
9012
9449
|
}
|
|
9013
|
-
|
|
9014
|
-
|
|
9015
|
-
|
|
9016
|
-
|
|
9017
|
-
if (!slotFlag && !isInternalObject(children)) children._ctx = currentRenderingInstance;
|
|
9018
|
-
else if (slotFlag === 3 && currentRenderingInstance) if (currentRenderingInstance.slots._ === 1) children._ = 1;
|
|
9019
|
-
else {
|
|
9020
|
-
children._ = 2;
|
|
9021
|
-
vnode.patchFlag |= 1024;
|
|
9450
|
+
} else if (isFunction(children)) {
|
|
9451
|
+
if (shapeFlag & 65) {
|
|
9452
|
+
normalizeChildren(vnode, { default: children });
|
|
9453
|
+
return;
|
|
9022
9454
|
}
|
|
9023
|
-
}
|
|
9024
|
-
else if (isFunction(children)) {
|
|
9025
9455
|
children = {
|
|
9026
9456
|
default: children,
|
|
9027
9457
|
_ctx: currentRenderingInstance
|
|
@@ -9085,6 +9515,16 @@ var Vue = (function() {
|
|
|
9085
9515
|
simpleSetCurrentInstance(instance);
|
|
9086
9516
|
}
|
|
9087
9517
|
};
|
|
9518
|
+
/**
|
|
9519
|
+
* Restores a snapshot returned by {@link setCurrentInstance}. Unlike calling
|
|
9520
|
+
* `setCurrentInstance(...prev)`, an `undefined` saved scope is restored
|
|
9521
|
+
* verbatim instead of re-triggering the `instance.scope` default.
|
|
9522
|
+
* @internal
|
|
9523
|
+
*/
|
|
9524
|
+
const restoreCurrentInstance = (prev) => {
|
|
9525
|
+
setCurrentScope(prev[1]);
|
|
9526
|
+
simpleSetCurrentInstance(prev[0]);
|
|
9527
|
+
};
|
|
9088
9528
|
const internalOptions = [
|
|
9089
9529
|
"ce",
|
|
9090
9530
|
"type",
|
|
@@ -9116,7 +9556,7 @@ var Vue = (function() {
|
|
|
9116
9556
|
};
|
|
9117
9557
|
//#endregion
|
|
9118
9558
|
//#region packages/runtime-core/src/component.ts
|
|
9119
|
-
const emptyAppContext =
|
|
9559
|
+
const emptyAppContext = /*@__PURE__*/ createAppContext();
|
|
9120
9560
|
let uid = 0;
|
|
9121
9561
|
function createComponentInstance(vnode, parent, suspense) {
|
|
9122
9562
|
const type = vnode.type;
|
|
@@ -9236,7 +9676,7 @@ var Vue = (function() {
|
|
|
9236
9676
|
const setupResult = callWithErrorHandling(setup, instance, 0, [/* @__PURE__ */ shallowReadonly(instance.props), setupContext]);
|
|
9237
9677
|
const isAsyncSetup = isPromise(setupResult);
|
|
9238
9678
|
setActiveSub(prevSub);
|
|
9239
|
-
|
|
9679
|
+
restoreCurrentInstance(prev);
|
|
9240
9680
|
if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) markAsyncBoundary(instance);
|
|
9241
9681
|
if (isAsyncSetup) {
|
|
9242
9682
|
const unsetCurrentInstance = () => {
|
|
@@ -9244,7 +9684,12 @@ var Vue = (function() {
|
|
|
9244
9684
|
};
|
|
9245
9685
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
9246
9686
|
if (isSSR) return setupResult.then((resolvedResult) => {
|
|
9247
|
-
|
|
9687
|
+
setInSSRSetupState(true);
|
|
9688
|
+
try {
|
|
9689
|
+
handleSetupResult(instance, resolvedResult, isSSR);
|
|
9690
|
+
} finally {
|
|
9691
|
+
setInSSRSetupState(false);
|
|
9692
|
+
}
|
|
9248
9693
|
}).catch((e) => {
|
|
9249
9694
|
handleError(e, instance, 0);
|
|
9250
9695
|
});
|
|
@@ -9309,13 +9754,15 @@ var Vue = (function() {
|
|
|
9309
9754
|
applyOptions(instance);
|
|
9310
9755
|
} finally {
|
|
9311
9756
|
setActiveSub(prevSub);
|
|
9312
|
-
|
|
9757
|
+
restoreCurrentInstance(prevInstance);
|
|
9313
9758
|
}
|
|
9314
9759
|
}
|
|
9315
|
-
if (!Component.render && instance.render === NOOP && !isSSR)
|
|
9760
|
+
if (!Component.render && instance.render === NOOP && !isSSR) {
|
|
9761
|
+
if (!compile$1 && Component.template)
|
|
9316
9762
|
/* v8 ignore start */
|
|
9317
|
-
|
|
9318
|
-
|
|
9763
|
+
warn$1("Component provided template option but runtime compilation is not supported in this build of Vue. Use \"vue.global.js\" instead.");
|
|
9764
|
+
else warn$1(`Component is missing template or render function: `, Component);
|
|
9765
|
+
}
|
|
9319
9766
|
}
|
|
9320
9767
|
const attrsProxyHandlers = {
|
|
9321
9768
|
get(target, key) {
|
|
@@ -9378,14 +9825,13 @@ var Vue = (function() {
|
|
|
9378
9825
|
if (instance.exposed) return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
|
|
9379
9826
|
get(target, key) {
|
|
9380
9827
|
if (key in target) return target[key];
|
|
9381
|
-
else {
|
|
9828
|
+
else if (!instance.vapor) {
|
|
9382
9829
|
const publicPropertiesMap = getPublicPropertiesMap();
|
|
9383
9830
|
if (key in publicPropertiesMap) return publicPropertiesMap[key](instance);
|
|
9384
9831
|
}
|
|
9385
9832
|
},
|
|
9386
9833
|
has(target, key) {
|
|
9387
|
-
|
|
9388
|
-
return key in target || key in publicPropertiesMap;
|
|
9834
|
+
return key in target || !instance.vapor && key in getPublicPropertiesMap();
|
|
9389
9835
|
}
|
|
9390
9836
|
}));
|
|
9391
9837
|
else return instance.proxy;
|
|
@@ -9423,11 +9869,12 @@ var Vue = (function() {
|
|
|
9423
9869
|
try {
|
|
9424
9870
|
setBlockTracking(-1);
|
|
9425
9871
|
const l = arguments.length;
|
|
9426
|
-
if (l === 2)
|
|
9427
|
-
if (
|
|
9428
|
-
|
|
9429
|
-
|
|
9430
|
-
|
|
9872
|
+
if (l === 2) {
|
|
9873
|
+
if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
|
|
9874
|
+
if (isVNode(propsOrChildren)) return createVNode(type, null, [propsOrChildren]);
|
|
9875
|
+
return createVNode(type, propsOrChildren);
|
|
9876
|
+
} else return createVNode(type, null, propsOrChildren);
|
|
9877
|
+
} else {
|
|
9431
9878
|
if (l > 3) children = Array.prototype.slice.call(arguments, 2);
|
|
9432
9879
|
else if (l === 3 && isVNode(children)) children = [children];
|
|
9433
9880
|
return createVNode(type, propsOrChildren, children);
|
|
@@ -9619,7 +10066,7 @@ var Vue = (function() {
|
|
|
9619
10066
|
}
|
|
9620
10067
|
//#endregion
|
|
9621
10068
|
//#region packages/runtime-core/src/index.ts
|
|
9622
|
-
const version = "3.6.0-
|
|
10069
|
+
const version = "3.6.0-rc.10";
|
|
9623
10070
|
const warn = warn$1;
|
|
9624
10071
|
/**
|
|
9625
10072
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -9648,7 +10095,7 @@ var Vue = (function() {
|
|
|
9648
10095
|
let policy = void 0;
|
|
9649
10096
|
const tt = typeof window !== "undefined" && window.trustedTypes;
|
|
9650
10097
|
if (tt) try {
|
|
9651
|
-
policy =
|
|
10098
|
+
policy = /*@__PURE__*/ tt.createPolicy("vue", { createHTML: (val) => val });
|
|
9652
10099
|
} catch (e) {
|
|
9653
10100
|
warn(`Error creating trusted types policy: ${e}`);
|
|
9654
10101
|
}
|
|
@@ -9656,7 +10103,7 @@ var Vue = (function() {
|
|
|
9656
10103
|
const svgNS = "http://www.w3.org/2000/svg";
|
|
9657
10104
|
const mathmlNS = "http://www.w3.org/1998/Math/MathML";
|
|
9658
10105
|
const doc = typeof document !== "undefined" ? document : null;
|
|
9659
|
-
const templateContainer = doc &&
|
|
10106
|
+
const templateContainer = doc && /*@__PURE__*/ doc.createElement("template");
|
|
9660
10107
|
const nodeOps = {
|
|
9661
10108
|
insert: (child, parent, anchor) => {
|
|
9662
10109
|
parent.insertBefore(child, anchor || null);
|
|
@@ -9730,7 +10177,7 @@ var Vue = (function() {
|
|
|
9730
10177
|
leaveActiveClass: String,
|
|
9731
10178
|
leaveToClass: String
|
|
9732
10179
|
};
|
|
9733
|
-
const TransitionPropsValidators =
|
|
10180
|
+
const TransitionPropsValidators = /*@__PURE__*/ extend({}, BaseTransitionPropsValidators, DOMTransitionPropsValidators);
|
|
9734
10181
|
/**
|
|
9735
10182
|
* Wrap logic that attaches extra properties to Transition in a function
|
|
9736
10183
|
* so that it can be annotated as pure
|
|
@@ -9745,7 +10192,7 @@ var Vue = (function() {
|
|
|
9745
10192
|
* DOM Transition is a higher-order-component based on the platform-agnostic
|
|
9746
10193
|
* base Transition component, with DOM-specific logic.
|
|
9747
10194
|
*/
|
|
9748
|
-
const Transition =
|
|
10195
|
+
const Transition = /*@__PURE__*/ decorate$1((props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots));
|
|
9749
10196
|
/**
|
|
9750
10197
|
* #3227 Incoming hooks may be merged into arrays when wrapping Transition
|
|
9751
10198
|
* with custom HOCs.
|
|
@@ -9985,14 +10432,15 @@ var Vue = (function() {
|
|
|
9985
10432
|
},
|
|
9986
10433
|
updated(el, { value, oldValue }, { transition }) {
|
|
9987
10434
|
if (!value === !oldValue) return;
|
|
9988
|
-
if (transition)
|
|
9989
|
-
|
|
9990
|
-
|
|
9991
|
-
|
|
9992
|
-
|
|
9993
|
-
|
|
9994
|
-
|
|
9995
|
-
|
|
10435
|
+
if (transition) {
|
|
10436
|
+
if (value) {
|
|
10437
|
+
transition.beforeEnter(el);
|
|
10438
|
+
setDisplay(el, true);
|
|
10439
|
+
transition.enter(el);
|
|
10440
|
+
} else transition.leave(el, () => {
|
|
10441
|
+
setDisplay(el, false);
|
|
10442
|
+
});
|
|
10443
|
+
} else setDisplay(el, value);
|
|
9996
10444
|
},
|
|
9997
10445
|
beforeUnmount(el, { value }) {
|
|
9998
10446
|
setDisplay(el, value);
|
|
@@ -10011,49 +10459,20 @@ var Vue = (function() {
|
|
|
10011
10459
|
*/
|
|
10012
10460
|
function useCssVars(getter) {
|
|
10013
10461
|
const instance = getCurrentInstance();
|
|
10014
|
-
const getVars = () => getter(instance.proxy);
|
|
10015
|
-
const setVars = (vars) => {
|
|
10016
|
-
if (instance.ce) setVarsOnNode(instance.ce, vars);
|
|
10017
|
-
else setVarsOnVNode(instance.subTree, vars);
|
|
10018
|
-
};
|
|
10019
|
-
baseUseCssVars(instance, () => instance.subTree.el.parentNode, getVars, setVars);
|
|
10020
|
-
}
|
|
10021
|
-
function setVarsOnVNode(vnode, vars) {
|
|
10022
|
-
if (vnode.shapeFlag & 128) {
|
|
10023
|
-
const suspense = vnode.suspense;
|
|
10024
|
-
vnode = suspense.activeBranch;
|
|
10025
|
-
if (suspense.pendingBranch && !suspense.isHydrating) suspense.effects.push(() => {
|
|
10026
|
-
setVarsOnVNode(suspense.activeBranch, vars);
|
|
10027
|
-
});
|
|
10028
|
-
}
|
|
10029
|
-
while (vnode.component) vnode = vnode.component.subTree;
|
|
10030
|
-
if (vnode.shapeFlag & 1 && vnode.el) setVarsOnNode(vnode.el, vars);
|
|
10031
|
-
else if (vnode.type === Fragment) vnode.children.forEach((c) => setVarsOnVNode(c, vars));
|
|
10032
|
-
else if (vnode.type === Static) {
|
|
10033
|
-
let { el, anchor } = vnode;
|
|
10034
|
-
while (el) {
|
|
10035
|
-
setVarsOnNode(el, vars);
|
|
10036
|
-
if (el === anchor) break;
|
|
10037
|
-
el = el.nextSibling;
|
|
10038
|
-
}
|
|
10039
|
-
}
|
|
10040
|
-
}
|
|
10041
|
-
/**
|
|
10042
|
-
* @internal
|
|
10043
|
-
* shared between vdom and vapor
|
|
10044
|
-
*/
|
|
10045
|
-
function baseUseCssVars(instance, getParentNode, getVars, setVars) {
|
|
10046
10462
|
/* v8 ignore start */
|
|
10047
10463
|
if (!instance) {
|
|
10048
10464
|
warn(`useCssVars is called without current active component instance.`);
|
|
10049
10465
|
return;
|
|
10050
10466
|
}
|
|
10467
|
+
/* v8 ignore stop */
|
|
10468
|
+
const getVars = () => getter(instance.proxy);
|
|
10051
10469
|
instance.getCssVars = getVars;
|
|
10052
10470
|
const updateTeleports = instance.ut = (vars = getVars()) => {
|
|
10053
10471
|
Array.from(document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)).forEach((node) => setVarsOnNode(node, vars));
|
|
10054
10472
|
};
|
|
10055
10473
|
const applyCssVars = (vars = getVars()) => {
|
|
10056
|
-
|
|
10474
|
+
if (instance.ce) setVarsOnNode(instance.ce, vars);
|
|
10475
|
+
else setVarsOnVNode(instance.subTree, vars);
|
|
10057
10476
|
updateTeleports(vars);
|
|
10058
10477
|
};
|
|
10059
10478
|
onBeforeUpdate(() => {
|
|
@@ -10066,10 +10485,38 @@ var Vue = (function() {
|
|
|
10066
10485
|
applyCssVars(vars);
|
|
10067
10486
|
}, NOOP, { flush: "post" });
|
|
10068
10487
|
const ob = new MutationObserver(() => applyCssVars());
|
|
10069
|
-
ob.observe(
|
|
10488
|
+
ob.observe(instance.subTree.el.parentNode, { childList: true });
|
|
10070
10489
|
onUnmounted(() => ob.disconnect());
|
|
10071
10490
|
});
|
|
10072
10491
|
}
|
|
10492
|
+
function setVarsOnVNode(vnode, vars) {
|
|
10493
|
+
if (vnode.shapeFlag & 128) {
|
|
10494
|
+
const suspense = vnode.suspense;
|
|
10495
|
+
vnode = suspense.activeBranch;
|
|
10496
|
+
if (suspense.pendingBranch && !suspense.isHydrating) suspense.effects.push(() => {
|
|
10497
|
+
setVarsOnVNode(suspense.activeBranch, vars);
|
|
10498
|
+
});
|
|
10499
|
+
}
|
|
10500
|
+
while (vnode.component) {
|
|
10501
|
+
const component = vnode.component;
|
|
10502
|
+
if (component.vapor) {
|
|
10503
|
+
component.appContext.vapor.applyCssVars(vnode, vars);
|
|
10504
|
+
return;
|
|
10505
|
+
}
|
|
10506
|
+
vnode = vnode.component.subTree;
|
|
10507
|
+
}
|
|
10508
|
+
if (vnode.shapeFlag & 1 && vnode.el) setVarsOnNode(vnode.el, vars);
|
|
10509
|
+
else if (vnode.vb) vnode.ctx.appContext.vapor.applyCssVars(vnode, vars);
|
|
10510
|
+
else if (vnode.type === Fragment) vnode.children.forEach((c) => setVarsOnVNode(c, vars));
|
|
10511
|
+
else if (vnode.type === Static) {
|
|
10512
|
+
let { el, anchor } = vnode;
|
|
10513
|
+
while (el) {
|
|
10514
|
+
setVarsOnNode(el, vars);
|
|
10515
|
+
if (el === anchor) break;
|
|
10516
|
+
el = el.nextSibling;
|
|
10517
|
+
}
|
|
10518
|
+
}
|
|
10519
|
+
}
|
|
10073
10520
|
/**
|
|
10074
10521
|
* @internal
|
|
10075
10522
|
* shared between vdom and vapor
|
|
@@ -10094,15 +10541,20 @@ var Vue = (function() {
|
|
|
10094
10541
|
const isCssString = isString(next);
|
|
10095
10542
|
let hasControlledDisplay = false;
|
|
10096
10543
|
if (next && !isCssString) {
|
|
10097
|
-
if (prev)
|
|
10098
|
-
|
|
10099
|
-
|
|
10100
|
-
|
|
10101
|
-
|
|
10544
|
+
if (prev) {
|
|
10545
|
+
if (!isString(prev)) {
|
|
10546
|
+
for (const key in prev) if (next[key] == null) setStyle(style, key, "");
|
|
10547
|
+
} else for (const prevStyle of prev.split(";")) {
|
|
10548
|
+
const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
|
|
10549
|
+
if (next[key] == null) setStyle(style, key, "");
|
|
10550
|
+
}
|
|
10102
10551
|
}
|
|
10103
10552
|
for (const key in next) {
|
|
10104
10553
|
if (key === "display") hasControlledDisplay = true;
|
|
10105
|
-
|
|
10554
|
+
const value = next[key];
|
|
10555
|
+
if (value != null) {
|
|
10556
|
+
if (!shouldPreserveTextareaResizeStyle(el, key, !isString(prev) && prev ? prev[key] : void 0, value)) setStyle(style, key, value);
|
|
10557
|
+
} else setStyle(style, key, "");
|
|
10106
10558
|
}
|
|
10107
10559
|
} else if (isCssString) {
|
|
10108
10560
|
if (prev !== next) {
|
|
@@ -10111,7 +10563,11 @@ var Vue = (function() {
|
|
|
10111
10563
|
style.cssText = next;
|
|
10112
10564
|
hasControlledDisplay = displayRE.test(next);
|
|
10113
10565
|
}
|
|
10114
|
-
} else if (prev)
|
|
10566
|
+
} else if (prev) {
|
|
10567
|
+
const cssVarText = style[CSS_VAR_TEXT];
|
|
10568
|
+
if (cssVarText) style.cssText = cssVarText;
|
|
10569
|
+
else el.removeAttribute("style");
|
|
10570
|
+
}
|
|
10115
10571
|
if (vShowOriginalDisplay in el) {
|
|
10116
10572
|
el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
|
|
10117
10573
|
if (el[vShowHidden]) style.display = "none";
|
|
@@ -10124,8 +10580,10 @@ var Vue = (function() {
|
|
|
10124
10580
|
else {
|
|
10125
10581
|
const val = rawVal == null ? "" : String(rawVal);
|
|
10126
10582
|
if (semicolonRE.test(val)) warn(`Unexpected semicolon at the end of '${name}' style value: '${val}'`);
|
|
10127
|
-
if (name.startsWith("--"))
|
|
10128
|
-
|
|
10583
|
+
if (name.startsWith("--")) {
|
|
10584
|
+
if (importantRE.test(val)) style.setProperty(name, val.replace(importantRE, ""), "important");
|
|
10585
|
+
else style.setProperty(name, val);
|
|
10586
|
+
} else {
|
|
10129
10587
|
const prefixed = autoPrefix(style, name);
|
|
10130
10588
|
if (importantRE.test(val)) style.setProperty(hyphenate(prefixed), val.replace(importantRE, ""), "important");
|
|
10131
10589
|
else style[prefixed] = val;
|
|
@@ -10150,19 +10608,28 @@ var Vue = (function() {
|
|
|
10150
10608
|
}
|
|
10151
10609
|
return rawName;
|
|
10152
10610
|
}
|
|
10611
|
+
/**
|
|
10612
|
+
* Browsers update textarea width/height directly during native resize.
|
|
10613
|
+
* Only special-case this common textarea path for now; other resize scenarios
|
|
10614
|
+
* still follow normal vnode style patching.
|
|
10615
|
+
*/
|
|
10616
|
+
function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
|
|
10617
|
+
return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
|
|
10618
|
+
}
|
|
10153
10619
|
//#endregion
|
|
10154
10620
|
//#region packages/runtime-dom/src/modules/attrs.ts
|
|
10155
10621
|
const xlinkNS = "http://www.w3.org/1999/xlink";
|
|
10156
10622
|
function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {
|
|
10157
|
-
if (isSVG && key.startsWith("xlink:"))
|
|
10158
|
-
|
|
10159
|
-
|
|
10623
|
+
if (isSVG && key.startsWith("xlink:")) {
|
|
10624
|
+
if (value == null) el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
|
|
10625
|
+
else el.setAttributeNS(xlinkNS, key, value);
|
|
10626
|
+
} else {
|
|
10160
10627
|
if (compatCoerceAttr(el, key, value, instance)) return;
|
|
10161
10628
|
if (value == null || isBoolean && !includeBooleanAttr(value)) el.removeAttribute(key);
|
|
10162
10629
|
else el.setAttribute(key, isBoolean ? "" : isSymbol(value) ? String(value) : value);
|
|
10163
10630
|
}
|
|
10164
10631
|
}
|
|
10165
|
-
const isEnumeratedAttr =
|
|
10632
|
+
const isEnumeratedAttr = /*@__PURE__*/ makeMap("contenteditable,draggable,spellcheck");
|
|
10166
10633
|
function compatCoerceAttr(el, key, value, instance = null) {
|
|
10167
10634
|
if (isEnumeratedAttr(key)) {
|
|
10168
10635
|
const v2CoercedValue = value === void 0 ? null : value === null || value === false || value === "false" ? "false" : "true";
|
|
@@ -10233,7 +10700,7 @@ var Vue = (function() {
|
|
|
10233
10700
|
const existingInvoker = invokers[rawName];
|
|
10234
10701
|
if (nextValue && existingInvoker) existingInvoker.value = sanitizeEventValue(nextValue, rawName);
|
|
10235
10702
|
else {
|
|
10236
|
-
const [name, options] =
|
|
10703
|
+
const [name, options] = parseEventName(rawName);
|
|
10237
10704
|
if (nextValue) addEventListener(el, name, invokers[rawName] = createInvoker(sanitizeEventValue(nextValue, rawName), instance), options);
|
|
10238
10705
|
else if (existingInvoker) {
|
|
10239
10706
|
removeEventListener(el, name, existingInvoker, options);
|
|
@@ -10241,27 +10708,40 @@ var Vue = (function() {
|
|
|
10241
10708
|
}
|
|
10242
10709
|
}
|
|
10243
10710
|
}
|
|
10244
|
-
const optionsModifierRE = /(
|
|
10245
|
-
|
|
10711
|
+
const optionsModifierRE = /(Once|Passive|Capture)$/;
|
|
10712
|
+
const optionsModifierEventRE = /^on:?(?:Once|Passive|Capture)$/;
|
|
10713
|
+
function parseEventName(name) {
|
|
10246
10714
|
let options;
|
|
10247
|
-
|
|
10248
|
-
|
|
10249
|
-
|
|
10250
|
-
|
|
10251
|
-
|
|
10252
|
-
options[m[0].toLowerCase()] = true;
|
|
10253
|
-
}
|
|
10715
|
+
let m;
|
|
10716
|
+
while ((m = name.match(optionsModifierRE)) && !optionsModifierEventRE.test(name)) {
|
|
10717
|
+
if (!options) options = {};
|
|
10718
|
+
name = name.slice(0, name.length - m[1].length);
|
|
10719
|
+
options[m[1].toLowerCase()] = true;
|
|
10254
10720
|
}
|
|
10255
10721
|
return [name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2)), options];
|
|
10256
10722
|
}
|
|
10257
10723
|
let cachedNow = 0;
|
|
10258
|
-
const p =
|
|
10724
|
+
const p = /*@__PURE__*/ Promise.resolve();
|
|
10259
10725
|
const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
|
|
10260
10726
|
function createInvoker(initialValue, instance) {
|
|
10261
10727
|
const invoker = (e) => {
|
|
10262
10728
|
if (!e._vts) e._vts = Date.now();
|
|
10263
10729
|
else if (e._vts <= invoker.attached) return;
|
|
10264
|
-
|
|
10730
|
+
const value = invoker.value;
|
|
10731
|
+
if (isArray(value)) {
|
|
10732
|
+
const originalStop = e.stopImmediatePropagation;
|
|
10733
|
+
e.stopImmediatePropagation = () => {
|
|
10734
|
+
originalStop.call(e);
|
|
10735
|
+
e._stopped = true;
|
|
10736
|
+
};
|
|
10737
|
+
const handlers = value.slice();
|
|
10738
|
+
const args = [e];
|
|
10739
|
+
for (let i = 0; i < handlers.length; i++) {
|
|
10740
|
+
if (e._stopped) break;
|
|
10741
|
+
const handler = handlers[i];
|
|
10742
|
+
if (handler) callWithAsyncErrorHandling(handler, instance, 5, args);
|
|
10743
|
+
}
|
|
10744
|
+
} else callWithAsyncErrorHandling(value, instance, 5, [e]);
|
|
10265
10745
|
};
|
|
10266
10746
|
invoker.value = initialValue;
|
|
10267
10747
|
invoker.attached = getNow();
|
|
@@ -10272,16 +10752,6 @@ var Vue = (function() {
|
|
|
10272
10752
|
warn(`Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?\nExpected function or array of functions, received type ${typeof value}.`);
|
|
10273
10753
|
return NOOP;
|
|
10274
10754
|
}
|
|
10275
|
-
function patchStopImmediatePropagation(e, value) {
|
|
10276
|
-
if (isArray(value)) {
|
|
10277
|
-
const originalStop = e.stopImmediatePropagation;
|
|
10278
|
-
e.stopImmediatePropagation = () => {
|
|
10279
|
-
originalStop.call(e);
|
|
10280
|
-
e._stopped = true;
|
|
10281
|
-
};
|
|
10282
|
-
return value.map((fn) => (e) => !e._stopped && fn && fn(e));
|
|
10283
|
-
} else return value;
|
|
10284
|
-
}
|
|
10285
10755
|
//#endregion
|
|
10286
10756
|
//#region packages/runtime-dom/src/patchProp.ts
|
|
10287
10757
|
const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
|
|
@@ -10319,7 +10789,7 @@ var Vue = (function() {
|
|
|
10319
10789
|
//#endregion
|
|
10320
10790
|
//#region packages/runtime-dom/src/apiCustomElement.ts
|
|
10321
10791
|
const REMOVAL = {};
|
|
10322
|
-
|
|
10792
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
10323
10793
|
function defineCustomElement(options, extraOptions, _createApp) {
|
|
10324
10794
|
let Comp = /* @__PURE__ */ defineComponent(options, extraOptions);
|
|
10325
10795
|
if (isPlainObject(Comp)) Comp = extend({}, Comp, extraOptions);
|
|
@@ -10368,12 +10838,14 @@ var Vue = (function() {
|
|
|
10368
10838
|
this._parent = parent;
|
|
10369
10839
|
break;
|
|
10370
10840
|
}
|
|
10371
|
-
if (!this._instance)
|
|
10372
|
-
|
|
10373
|
-
this._pendingResolve =
|
|
10374
|
-
|
|
10375
|
-
|
|
10376
|
-
|
|
10841
|
+
if (!this._instance) {
|
|
10842
|
+
if (this._resolved) this._mountComponent(this._def);
|
|
10843
|
+
else if (parent && parent._pendingResolve) this._pendingResolve = parent._pendingResolve.then(() => {
|
|
10844
|
+
this._pendingResolve = void 0;
|
|
10845
|
+
if (this.isConnected) return this._resolveDef();
|
|
10846
|
+
});
|
|
10847
|
+
else this._resolveDef();
|
|
10848
|
+
}
|
|
10377
10849
|
}
|
|
10378
10850
|
disconnectedCallback() {
|
|
10379
10851
|
this._connected = false;
|
|
@@ -10407,7 +10879,7 @@ var Vue = (function() {
|
|
|
10407
10879
|
* resolve inner component definition (handle possible async component)
|
|
10408
10880
|
*/
|
|
10409
10881
|
_resolveDef() {
|
|
10410
|
-
if (this._pendingResolve) return;
|
|
10882
|
+
if (this._pendingResolve) return this._pendingResolve;
|
|
10411
10883
|
for (let i = 0; i < this.attributes.length; i++) this._setAttr(this.attributes[i].name);
|
|
10412
10884
|
this._ob = new MutationObserver(this._processMutations.bind(this));
|
|
10413
10885
|
this._ob.observe(this, { attributes: true });
|
|
@@ -10437,6 +10909,7 @@ var Vue = (function() {
|
|
|
10437
10909
|
this._def = def;
|
|
10438
10910
|
resolve(def);
|
|
10439
10911
|
});
|
|
10912
|
+
return this._pendingResolve;
|
|
10440
10913
|
} else resolve(this._def);
|
|
10441
10914
|
}
|
|
10442
10915
|
_mountComponent(def) {
|
|
@@ -10475,14 +10948,17 @@ var Vue = (function() {
|
|
|
10475
10948
|
const { props } = def;
|
|
10476
10949
|
const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
|
|
10477
10950
|
for (const key of Object.keys(this)) if (key[0] !== "_" && declaredPropKeys.includes(key)) this._setProp(key, this[key]);
|
|
10478
|
-
for (const key of declaredPropKeys.map(camelize))
|
|
10479
|
-
|
|
10480
|
-
|
|
10481
|
-
|
|
10482
|
-
|
|
10483
|
-
|
|
10484
|
-
|
|
10485
|
-
|
|
10951
|
+
for (const key of declaredPropKeys.map(camelize)) {
|
|
10952
|
+
if (key in Object.getPrototypeOf(this)) warn(`Custom element prop "${key}" conflicts with an existing property on the element and will overwrite it.`);
|
|
10953
|
+
Object.defineProperty(this, key, {
|
|
10954
|
+
get() {
|
|
10955
|
+
return this._getProp(key);
|
|
10956
|
+
},
|
|
10957
|
+
set(val) {
|
|
10958
|
+
this._setProp(key, val, true, !this._patching);
|
|
10959
|
+
}
|
|
10960
|
+
});
|
|
10961
|
+
}
|
|
10486
10962
|
}
|
|
10487
10963
|
_setAttr(key) {
|
|
10488
10964
|
if (key.startsWith("data-v-")) return;
|
|
@@ -10585,13 +11061,11 @@ var Vue = (function() {
|
|
|
10585
11061
|
_renderSlots() {
|
|
10586
11062
|
const outlets = this._getSlots();
|
|
10587
11063
|
const scopeId = this._instance.type.__scopeId;
|
|
10588
|
-
const slotReplacements = /* @__PURE__ */ new Map();
|
|
10589
11064
|
for (let i = 0; i < outlets.length; i++) {
|
|
10590
11065
|
const o = outlets[i];
|
|
10591
11066
|
const slotName = o.getAttribute("name") || "default";
|
|
10592
11067
|
const content = this._slots[slotName];
|
|
10593
11068
|
const parent = o.parentNode;
|
|
10594
|
-
const replacementNodes = [];
|
|
10595
11069
|
if (content) for (const n of content) {
|
|
10596
11070
|
if (scopeId && n.nodeType === 1) {
|
|
10597
11071
|
const id = scopeId + "-s";
|
|
@@ -10601,17 +11075,10 @@ var Vue = (function() {
|
|
|
10601
11075
|
while (child = walker.nextNode()) child.setAttribute(id, "");
|
|
10602
11076
|
}
|
|
10603
11077
|
parent.insertBefore(n, o);
|
|
10604
|
-
replacementNodes.push(n);
|
|
10605
|
-
}
|
|
10606
|
-
else while (o.firstChild) {
|
|
10607
|
-
const child = o.firstChild;
|
|
10608
|
-
parent.insertBefore(child, o);
|
|
10609
|
-
replacementNodes.push(child);
|
|
10610
11078
|
}
|
|
11079
|
+
else while (o.firstChild) parent.insertBefore(o.firstChild, o);
|
|
10611
11080
|
parent.removeChild(o);
|
|
10612
|
-
slotReplacements.set(o, replacementNodes);
|
|
10613
11081
|
}
|
|
10614
|
-
this._updateSlotNodes(slotReplacements);
|
|
10615
11082
|
}
|
|
10616
11083
|
/**
|
|
10617
11084
|
* @internal
|
|
@@ -10650,7 +11117,7 @@ var Vue = (function() {
|
|
|
10650
11117
|
* @internal
|
|
10651
11118
|
*/
|
|
10652
11119
|
_hasShadowRoot() {
|
|
10653
|
-
return this.
|
|
11120
|
+
return this._root !== this;
|
|
10654
11121
|
}
|
|
10655
11122
|
/**
|
|
10656
11123
|
* @internal
|
|
@@ -10695,10 +11162,6 @@ var Vue = (function() {
|
|
|
10695
11162
|
if (this._instance && this._instance.ce) this._instance.ce = void 0;
|
|
10696
11163
|
this._app = this._instance = null;
|
|
10697
11164
|
}
|
|
10698
|
-
/**
|
|
10699
|
-
* Only called when shadowRoot is false
|
|
10700
|
-
*/
|
|
10701
|
-
_updateSlotNodes(replacements) {}
|
|
10702
11165
|
_createVNode() {
|
|
10703
11166
|
const baseProps = {};
|
|
10704
11167
|
if (!this.shadowRoot) baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this);
|
|
@@ -10749,7 +11212,7 @@ var Vue = (function() {
|
|
|
10749
11212
|
};
|
|
10750
11213
|
const TransitionGroup = /* @__PURE__ */ decorate({
|
|
10751
11214
|
name: "TransitionGroup",
|
|
10752
|
-
props:
|
|
11215
|
+
props: /*@__PURE__*/ extend({}, TransitionPropsValidators, {
|
|
10753
11216
|
tag: String,
|
|
10754
11217
|
moveClass: String
|
|
10755
11218
|
}),
|
|
@@ -10783,7 +11246,7 @@ var Vue = (function() {
|
|
|
10783
11246
|
prevChildren = [];
|
|
10784
11247
|
if (children) for (let i = 0; i < children.length; i++) {
|
|
10785
11248
|
const child = children[i];
|
|
10786
|
-
if (child.el && child.el instanceof Element) {
|
|
11249
|
+
if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
|
|
10787
11250
|
prevChildren.push(child);
|
|
10788
11251
|
setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
|
|
10789
11252
|
positionMap.set(child, getPosition(child.el));
|
|
@@ -10881,13 +11344,22 @@ var Vue = (function() {
|
|
|
10881
11344
|
}
|
|
10882
11345
|
}
|
|
10883
11346
|
const assignKey = Symbol("_assign");
|
|
11347
|
+
const initialValueKey = Symbol("_initialValue");
|
|
10884
11348
|
const vModelText = {
|
|
10885
11349
|
created(el, { modifiers: { lazy, trim, number } }, vnode) {
|
|
11350
|
+
if (el.parentNode) {
|
|
11351
|
+
if (el.type === "text") el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
|
|
11352
|
+
else if (el.type === "textarea") el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
|
|
11353
|
+
}
|
|
10886
11354
|
el[assignKey] = getModelAssigner(vnode);
|
|
10887
11355
|
vModelTextInit(el, trim, number || !!(vnode.props && vnode.props.type === "number"), lazy);
|
|
10888
11356
|
},
|
|
10889
|
-
mounted(el, { value }) {
|
|
10890
|
-
|
|
11357
|
+
mounted(el, { value, modifiers: { trim, number } }) {
|
|
11358
|
+
const newValue = value == null ? "" : value;
|
|
11359
|
+
const initialValue = el[initialValueKey];
|
|
11360
|
+
delete el[initialValueKey];
|
|
11361
|
+
if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) el[assignKey](castValue(el.value, trim, number));
|
|
11362
|
+
else el.value = newValue;
|
|
10891
11363
|
},
|
|
10892
11364
|
beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
|
|
10893
11365
|
el[assignKey] = getModelAssigner(vnode);
|
|
@@ -11007,7 +11479,8 @@ var Vue = (function() {
|
|
|
11007
11479
|
mounted(el, { value }) {
|
|
11008
11480
|
vModelSetSelected(el, value);
|
|
11009
11481
|
},
|
|
11010
|
-
beforeUpdate(el,
|
|
11482
|
+
beforeUpdate(el, { value }, vnode) {
|
|
11483
|
+
el._modelValue = value;
|
|
11011
11484
|
el[assignKey] = getModelAssigner(vnode);
|
|
11012
11485
|
},
|
|
11013
11486
|
updated(el, { value }) {
|
|
@@ -11018,21 +11491,42 @@ var Vue = (function() {
|
|
|
11018
11491
|
* @internal
|
|
11019
11492
|
*/
|
|
11020
11493
|
const vModelSelectInit = (el, value, number, set) => {
|
|
11021
|
-
|
|
11494
|
+
el._modelValue = value;
|
|
11022
11495
|
addEventListener(el, "change", () => {
|
|
11023
11496
|
const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map((o) => number ? looseToNumber(getValue(o)) : getValue(o));
|
|
11024
|
-
|
|
11025
|
-
el.
|
|
11026
|
-
|
|
11027
|
-
|
|
11028
|
-
|
|
11497
|
+
const multiple = el.multiple;
|
|
11498
|
+
const assignedValue = multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0];
|
|
11499
|
+
const pending = el._pendingValue = [multiple, multiple ? isArray(assignedValue) ? selectedVal.slice() : selectedVal : assignedValue];
|
|
11500
|
+
try {
|
|
11501
|
+
(set || el[assignKey])(assignedValue);
|
|
11502
|
+
} finally {
|
|
11503
|
+
nextTick(() => {
|
|
11504
|
+
if (el._pendingValue === pending) el._pendingValue = void 0;
|
|
11505
|
+
});
|
|
11506
|
+
}
|
|
11029
11507
|
});
|
|
11030
11508
|
};
|
|
11509
|
+
function isSameSelectValue(value, assignedValue, multiple) {
|
|
11510
|
+
if (!multiple) return looseEqual(value, assignedValue);
|
|
11511
|
+
if (isArray(value)) return looseEqual(value, assignedValue);
|
|
11512
|
+
if (isSet(value)) {
|
|
11513
|
+
if (value.size !== assignedValue.length) return false;
|
|
11514
|
+
for (const item of assignedValue) if (!value.has(item)) return false;
|
|
11515
|
+
return true;
|
|
11516
|
+
}
|
|
11517
|
+
return false;
|
|
11518
|
+
}
|
|
11031
11519
|
/**
|
|
11032
11520
|
* @internal
|
|
11033
11521
|
*/
|
|
11034
11522
|
const vModelSetSelected = (el, value) => {
|
|
11035
|
-
|
|
11523
|
+
el._modelValue = value;
|
|
11524
|
+
const pending = el._pendingValue;
|
|
11525
|
+
el._pendingValue = void 0;
|
|
11526
|
+
if (pending && pending[0] === el.multiple && isSameSelectValue(value, pending[1], pending[0])) return;
|
|
11527
|
+
setSelected(el, value);
|
|
11528
|
+
};
|
|
11529
|
+
function setSelected(el, value) {
|
|
11036
11530
|
const isMultiple = el.multiple;
|
|
11037
11531
|
const isArrayValue = isArray(value);
|
|
11038
11532
|
if (isMultiple && !isArrayValue && !isSet(value)) {
|
|
@@ -11042,18 +11536,19 @@ var Vue = (function() {
|
|
|
11042
11536
|
for (let i = 0, l = el.options.length; i < l; i++) {
|
|
11043
11537
|
const option = el.options[i];
|
|
11044
11538
|
const optionValue = getValue(option);
|
|
11045
|
-
if (isMultiple)
|
|
11046
|
-
|
|
11047
|
-
|
|
11048
|
-
|
|
11049
|
-
|
|
11050
|
-
|
|
11539
|
+
if (isMultiple) {
|
|
11540
|
+
if (isArrayValue) {
|
|
11541
|
+
const optionType = typeof optionValue;
|
|
11542
|
+
if (optionType === "string" || optionType === "number") option.selected = value.some((v) => String(v) === String(optionValue));
|
|
11543
|
+
else option.selected = looseIndexOf(value, optionValue) > -1;
|
|
11544
|
+
} else option.selected = value.has(optionValue);
|
|
11545
|
+
} else if (looseEqual(getValue(option), value)) {
|
|
11051
11546
|
if (el.selectedIndex !== i) el.selectedIndex = i;
|
|
11052
11547
|
return;
|
|
11053
11548
|
}
|
|
11054
11549
|
}
|
|
11055
11550
|
if (!isMultiple && el.selectedIndex !== -1) el.selectedIndex = -1;
|
|
11056
|
-
}
|
|
11551
|
+
}
|
|
11057
11552
|
/**
|
|
11058
11553
|
* @internal retrieve raw value set via :value bindings
|
|
11059
11554
|
*/
|
|
@@ -11349,7 +11844,7 @@ var Vue = (function() {
|
|
|
11349
11844
|
withModifiers: () => withModifiers,
|
|
11350
11845
|
withScopeId: () => withScopeId
|
|
11351
11846
|
});
|
|
11352
|
-
const rendererOptions =
|
|
11847
|
+
const rendererOptions = /*@__PURE__*/ extend({ patchProp }, nodeOps);
|
|
11353
11848
|
let renderer;
|
|
11354
11849
|
let enabledHydration = false;
|
|
11355
11850
|
function ensureRenderer() {
|
|
@@ -11900,13 +12395,14 @@ var Vue = (function() {
|
|
|
11900
12395
|
}
|
|
11901
12396
|
}
|
|
11902
12397
|
stateInterpolationOpen(c) {
|
|
11903
|
-
if (c === this.delimiterOpen[this.delimiterIndex])
|
|
11904
|
-
|
|
11905
|
-
|
|
11906
|
-
|
|
11907
|
-
|
|
11908
|
-
|
|
11909
|
-
|
|
12398
|
+
if (c === this.delimiterOpen[this.delimiterIndex]) {
|
|
12399
|
+
if (this.delimiterIndex === this.delimiterOpen.length - 1) {
|
|
12400
|
+
const start = this.index + 1 - this.delimiterOpen.length;
|
|
12401
|
+
if (start > this.sectionStart) this.cbs.ontext(this.sectionStart, start);
|
|
12402
|
+
this.state = 3;
|
|
12403
|
+
this.sectionStart = start;
|
|
12404
|
+
} else this.delimiterIndex++;
|
|
12405
|
+
} else if (this.inRCDATA) {
|
|
11910
12406
|
this.state = 32;
|
|
11911
12407
|
this.stateInRCDATA(c);
|
|
11912
12408
|
} else {
|
|
@@ -11922,13 +12418,14 @@ var Vue = (function() {
|
|
|
11922
12418
|
}
|
|
11923
12419
|
}
|
|
11924
12420
|
stateInterpolationClose(c) {
|
|
11925
|
-
if (c === this.delimiterClose[this.delimiterIndex])
|
|
11926
|
-
|
|
11927
|
-
|
|
11928
|
-
|
|
11929
|
-
|
|
11930
|
-
|
|
11931
|
-
|
|
12421
|
+
if (c === this.delimiterClose[this.delimiterIndex]) {
|
|
12422
|
+
if (this.delimiterIndex === this.delimiterClose.length - 1) {
|
|
12423
|
+
this.cbs.oninterpolation(this.sectionStart, this.index + 1);
|
|
12424
|
+
if (this.inRCDATA) this.state = 32;
|
|
12425
|
+
else this.state = 1;
|
|
12426
|
+
this.sectionStart = this.index + 1;
|
|
12427
|
+
} else this.delimiterIndex++;
|
|
12428
|
+
} else {
|
|
11932
12429
|
this.state = 3;
|
|
11933
12430
|
this.stateInterpolation(c);
|
|
11934
12431
|
}
|
|
@@ -12043,9 +12540,10 @@ var Vue = (function() {
|
|
|
12043
12540
|
this.sectionStart = this.index;
|
|
12044
12541
|
if (this.mode === 0) this.state = 6;
|
|
12045
12542
|
else if (this.inSFCRoot) this.state = 34;
|
|
12046
|
-
else if (!this.inXML)
|
|
12047
|
-
|
|
12048
|
-
|
|
12543
|
+
else if (!this.inXML) {
|
|
12544
|
+
if (c === 116) this.state = 30;
|
|
12545
|
+
else this.state = c === 115 ? 29 : 6;
|
|
12546
|
+
} else this.state = 6;
|
|
12049
12547
|
} else if (c === 47) this.state = 8;
|
|
12050
12548
|
else {
|
|
12051
12549
|
this.state = 1;
|
|
@@ -12398,9 +12896,7 @@ var Vue = (function() {
|
|
|
12398
12896
|
case 24:
|
|
12399
12897
|
this.stateInProcessingInstruction(c);
|
|
12400
12898
|
break;
|
|
12401
|
-
case 33:
|
|
12402
|
-
this.stateInEntity();
|
|
12403
|
-
break;
|
|
12899
|
+
case 33: this.stateInEntity();
|
|
12404
12900
|
}
|
|
12405
12901
|
this.index++;
|
|
12406
12902
|
}
|
|
@@ -12429,9 +12925,10 @@ var Vue = (function() {
|
|
|
12429
12925
|
handleTrailingData() {
|
|
12430
12926
|
const endIndex = this.buffer.length;
|
|
12431
12927
|
if (this.sectionStart >= endIndex) return;
|
|
12432
|
-
if (this.state === 28)
|
|
12433
|
-
|
|
12434
|
-
|
|
12928
|
+
if (this.state === 28) {
|
|
12929
|
+
if (this.currentSequence === Sequences.CdataEnd) this.cbs.oncdata(this.sectionStart, endIndex);
|
|
12930
|
+
else this.cbs.oncomment(this.sectionStart, endIndex);
|
|
12931
|
+
} 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);
|
|
12435
12932
|
}
|
|
12436
12933
|
emitCodePoint(cp, consumed) {}
|
|
12437
12934
|
};
|
|
@@ -12633,12 +13130,10 @@ var Vue = (function() {
|
|
|
12633
13130
|
if (!--currentOpenParensCount) state = stateStack.pop();
|
|
12634
13131
|
}
|
|
12635
13132
|
break;
|
|
12636
|
-
case 3:
|
|
12637
|
-
|
|
12638
|
-
|
|
12639
|
-
|
|
12640
|
-
}
|
|
12641
|
-
break;
|
|
13133
|
+
case 3: if (char === currentStringType) {
|
|
13134
|
+
state = stateStack.pop();
|
|
13135
|
+
currentStringType = null;
|
|
13136
|
+
}
|
|
12642
13137
|
}
|
|
12643
13138
|
}
|
|
12644
13139
|
return !currentOpenBracketCount && !currentOpenParensCount;
|
|
@@ -12688,7 +13183,7 @@ var Vue = (function() {
|
|
|
12688
13183
|
function isSlotOutlet(node) {
|
|
12689
13184
|
return node.type === 1 && node.tagType === 2;
|
|
12690
13185
|
}
|
|
12691
|
-
const propsHelperSet = new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);
|
|
13186
|
+
const propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);
|
|
12692
13187
|
function getUnnormalizedProps(props, callPath = []) {
|
|
12693
13188
|
if (props && !isString(props) && props.type === 14) {
|
|
12694
13189
|
const callee = props.callee;
|
|
@@ -12697,6 +13192,7 @@ var Vue = (function() {
|
|
|
12697
13192
|
return [props, callPath];
|
|
12698
13193
|
}
|
|
12699
13194
|
function injectProp(node, prop, context) {
|
|
13195
|
+
if (node.type !== 13 && injectSlotKey(node, prop)) return;
|
|
12700
13196
|
let propsWithInjection;
|
|
12701
13197
|
/**
|
|
12702
13198
|
* 1. mergeProps(...)
|
|
@@ -12730,11 +13226,26 @@ var Vue = (function() {
|
|
|
12730
13226
|
propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [createObjectExpression([prop]), props]);
|
|
12731
13227
|
if (parentCall && parentCall.callee === GUARD_REACTIVE_PROPS) parentCall = callPath[callPath.length - 2];
|
|
12732
13228
|
}
|
|
12733
|
-
if (node.type === 13)
|
|
12734
|
-
|
|
12735
|
-
|
|
13229
|
+
if (node.type === 13) {
|
|
13230
|
+
if (parentCall) parentCall.arguments[0] = propsWithInjection;
|
|
13231
|
+
else node.props = propsWithInjection;
|
|
13232
|
+
} else if (parentCall) parentCall.arguments[0] = propsWithInjection;
|
|
12736
13233
|
else node.arguments[2] = propsWithInjection;
|
|
12737
13234
|
}
|
|
13235
|
+
function injectSlotKey(node, prop) {
|
|
13236
|
+
var _node$arguments, _node$arguments2, _node$arguments3;
|
|
13237
|
+
if (prop.key.type !== 4 || prop.key.content !== "key") return false;
|
|
13238
|
+
const props = node.arguments[2];
|
|
13239
|
+
if (props && !isString(props)) {
|
|
13240
|
+
const [unnormalizedProps] = getUnnormalizedProps(props);
|
|
13241
|
+
if (unnormalizedProps && !isString(unnormalizedProps) && unnormalizedProps.type === 15 && hasProp(prop, unnormalizedProps)) return true;
|
|
13242
|
+
}
|
|
13243
|
+
(_node$arguments = node.arguments)[2] || (_node$arguments[2] = "{}");
|
|
13244
|
+
(_node$arguments2 = node.arguments)[3] || (_node$arguments2[3] = "undefined");
|
|
13245
|
+
(_node$arguments3 = node.arguments)[4] || (_node$arguments3[4] = "undefined");
|
|
13246
|
+
node.arguments[5] = prop.value;
|
|
13247
|
+
return true;
|
|
13248
|
+
}
|
|
12738
13249
|
function hasProp(prop, props) {
|
|
12739
13250
|
let result = false;
|
|
12740
13251
|
if (prop.key.type === 4) {
|
|
@@ -12993,10 +13504,7 @@ var Vue = (function() {
|
|
|
12993
13504
|
case 18:
|
|
12994
13505
|
case 19:
|
|
12995
13506
|
case 20:
|
|
12996
|
-
case 21:
|
|
12997
|
-
emitError(9, end);
|
|
12998
|
-
break;
|
|
12999
|
-
default: break;
|
|
13507
|
+
case 21: emitError(9, end);
|
|
13000
13508
|
}
|
|
13001
13509
|
for (let index = 0; index < stack.length; index++) {
|
|
13002
13510
|
onCloseTag(stack[index], end - 1);
|
|
@@ -13004,7 +13512,7 @@ var Vue = (function() {
|
|
|
13004
13512
|
}
|
|
13005
13513
|
},
|
|
13006
13514
|
oncdata(start, end) {
|
|
13007
|
-
if (stack[0].ns !== 0) onText(getSlice(start, end), start, end);
|
|
13515
|
+
if ((stack[0] ? stack[0].ns : currentOptions.ns) !== 0) onText(getSlice(start, end), start, end);
|
|
13008
13516
|
else emitError(1, start - 9);
|
|
13009
13517
|
},
|
|
13010
13518
|
onprocessinginstruction(start) {
|
|
@@ -13146,7 +13654,7 @@ var Vue = (function() {
|
|
|
13146
13654
|
while (currentInput.charCodeAt(i) !== c && i >= 0) i--;
|
|
13147
13655
|
return i;
|
|
13148
13656
|
}
|
|
13149
|
-
const specialTemplateDir = new Set([
|
|
13657
|
+
const specialTemplateDir = /* @__PURE__ */ new Set([
|
|
13150
13658
|
"if",
|
|
13151
13659
|
"else",
|
|
13152
13660
|
"else-if",
|
|
@@ -13182,16 +13690,18 @@ var Vue = (function() {
|
|
|
13182
13690
|
let removedWhitespace = false;
|
|
13183
13691
|
for (let i = 0; i < nodes.length; i++) {
|
|
13184
13692
|
const node = nodes[i];
|
|
13185
|
-
if (node.type === 2)
|
|
13186
|
-
if (
|
|
13187
|
-
|
|
13188
|
-
|
|
13189
|
-
|
|
13190
|
-
|
|
13191
|
-
|
|
13192
|
-
|
|
13193
|
-
|
|
13194
|
-
|
|
13693
|
+
if (node.type === 2) {
|
|
13694
|
+
if (!inPre) {
|
|
13695
|
+
if (isAllWhitespace(node.content)) {
|
|
13696
|
+
const prev = nodes[i - 1] && nodes[i - 1].type;
|
|
13697
|
+
const next = nodes[i + 1] && nodes[i + 1].type;
|
|
13698
|
+
if (!prev || !next || shouldCondense && (prev === 3 && (next === 3 || next === 1) || prev === 1 && (next === 3 || next === 1 && hasNewlineChar(node.content)))) {
|
|
13699
|
+
removedWhitespace = true;
|
|
13700
|
+
nodes[i] = null;
|
|
13701
|
+
} else node.content = " ";
|
|
13702
|
+
} else if (shouldCondense) node.content = condense(node.content);
|
|
13703
|
+
} else node.content = node.content.replace(windowsNewlineRE, "\n");
|
|
13704
|
+
}
|
|
13195
13705
|
}
|
|
13196
13706
|
return removedWhitespace ? nodes.filter(Boolean) : nodes;
|
|
13197
13707
|
}
|
|
@@ -13452,7 +13962,7 @@ var Vue = (function() {
|
|
|
13452
13962
|
default: return 0;
|
|
13453
13963
|
}
|
|
13454
13964
|
}
|
|
13455
|
-
const allowHoistedHelperSet = new Set([
|
|
13965
|
+
const allowHoistedHelperSet = /* @__PURE__ */ new Set([
|
|
13456
13966
|
NORMALIZE_CLASS,
|
|
13457
13967
|
NORMALIZE_STYLE,
|
|
13458
13968
|
NORMALIZE_PROPS,
|
|
@@ -13529,8 +14039,10 @@ var Vue = (function() {
|
|
|
13529
14039
|
imports: [],
|
|
13530
14040
|
cached: [],
|
|
13531
14041
|
constantCache: /* @__PURE__ */ new WeakMap(),
|
|
14042
|
+
vForMemoKeyedNodes: /* @__PURE__ */ new WeakSet(),
|
|
13532
14043
|
temps: 0,
|
|
13533
14044
|
identifiers: Object.create(null),
|
|
14045
|
+
identifierScopes: Object.create(null),
|
|
13534
14046
|
scopes: {
|
|
13535
14047
|
vFor: 0,
|
|
13536
14048
|
vSlot: 0,
|
|
@@ -13581,8 +14093,12 @@ var Vue = (function() {
|
|
|
13581
14093
|
context.parent.children.splice(removalIndex, 1);
|
|
13582
14094
|
},
|
|
13583
14095
|
onNodeRemoved: NOOP,
|
|
13584
|
-
addIdentifiers(exp) {},
|
|
14096
|
+
addIdentifiers(exp, type = "local") {},
|
|
13585
14097
|
removeIdentifiers(exp) {},
|
|
14098
|
+
isSlotScopeIdentifier(name) {
|
|
14099
|
+
const scopes = context.identifierScopes[name];
|
|
14100
|
+
return scopes ? scopes[scopes.length - 1] === "slot" : false;
|
|
14101
|
+
},
|
|
13586
14102
|
hoist(exp) {
|
|
13587
14103
|
if (isString(exp)) exp = createSimpleExpression(exp);
|
|
13588
14104
|
context.hoists.push(exp);
|
|
@@ -13604,7 +14120,7 @@ var Vue = (function() {
|
|
|
13604
14120
|
traverseNode(root, context);
|
|
13605
14121
|
if (options.hoistStatic) cacheStatic(root, context);
|
|
13606
14122
|
if (!options.ssr) createRootCodegen(root, context);
|
|
13607
|
-
root.helpers = new Set([...context.helpers.keys()]);
|
|
14123
|
+
root.helpers = /* @__PURE__ */ new Set([...context.helpers.keys()]);
|
|
13608
14124
|
root.components = [...context.components];
|
|
13609
14125
|
root.directives = [...context.directives];
|
|
13610
14126
|
root.imports = context.imports;
|
|
@@ -13651,8 +14167,10 @@ var Vue = (function() {
|
|
|
13651
14167
|
const exitFns = [];
|
|
13652
14168
|
for (let i = 0; i < nodeTransforms.length; i++) {
|
|
13653
14169
|
const onExit = nodeTransforms[i](node, context);
|
|
13654
|
-
if (onExit)
|
|
13655
|
-
|
|
14170
|
+
if (onExit) {
|
|
14171
|
+
if (isArray(onExit)) exitFns.push(...onExit);
|
|
14172
|
+
else exitFns.push(onExit);
|
|
14173
|
+
}
|
|
13656
14174
|
if (!context.currentNode) return;
|
|
13657
14175
|
else node = context.currentNode;
|
|
13658
14176
|
}
|
|
@@ -13669,9 +14187,7 @@ var Vue = (function() {
|
|
|
13669
14187
|
case 10:
|
|
13670
14188
|
case 11:
|
|
13671
14189
|
case 1:
|
|
13672
|
-
case 0:
|
|
13673
|
-
traverseChildren(node, context);
|
|
13674
|
-
break;
|
|
14190
|
+
case 0: traverseChildren(node, context);
|
|
13675
14191
|
}
|
|
13676
14192
|
context.currentNode = node;
|
|
13677
14193
|
let i = exitFns.length;
|
|
@@ -13867,10 +14383,12 @@ var Vue = (function() {
|
|
|
13867
14383
|
if (isString(node)) push(node, -3);
|
|
13868
14384
|
else if (isArray(node)) genNodeListAsArray(node, context);
|
|
13869
14385
|
else genNode(node, context);
|
|
13870
|
-
if (i < nodes.length - 1)
|
|
13871
|
-
|
|
13872
|
-
|
|
13873
|
-
|
|
14386
|
+
if (i < nodes.length - 1) {
|
|
14387
|
+
if (multilines) {
|
|
14388
|
+
comma && push(",");
|
|
14389
|
+
newline();
|
|
14390
|
+
} else comma && push(", ");
|
|
14391
|
+
}
|
|
13874
14392
|
}
|
|
13875
14393
|
}
|
|
13876
14394
|
function genNode(node, context) {
|
|
@@ -13936,6 +14454,7 @@ var Vue = (function() {
|
|
|
13936
14454
|
case 24: break;
|
|
13937
14455
|
case 25: break;
|
|
13938
14456
|
case 26: break;
|
|
14457
|
+
/* v8 ignore start */
|
|
13939
14458
|
case 10: break;
|
|
13940
14459
|
default:
|
|
13941
14460
|
assert(false, `unhandled codegen node type: ${node.type}`);
|
|
@@ -13981,8 +14500,10 @@ var Vue = (function() {
|
|
|
13981
14500
|
const { push, helper, pure } = context;
|
|
13982
14501
|
const { tag, props, children, patchFlag, dynamicProps, directives, isBlock, disableTracking, isComponent } = node;
|
|
13983
14502
|
let patchFlagString;
|
|
13984
|
-
if (patchFlag)
|
|
13985
|
-
|
|
14503
|
+
if (patchFlag) {
|
|
14504
|
+
if (patchFlag < 0) patchFlagString = patchFlag + ` /* ${PatchFlagNames[patchFlag]} */`;
|
|
14505
|
+
else patchFlagString = patchFlag + ` /* ${Object.keys(PatchFlagNames).map(Number).filter((n) => n > 0 && patchFlag & n).map((n) => PatchFlagNames[n]).join(`, `)} */`;
|
|
14506
|
+
}
|
|
13986
14507
|
if (directives) push(helper(WITH_DIRECTIVES) + `(`);
|
|
13987
14508
|
if (isBlock) push(`(${helper(OPEN_BLOCK)}(${disableTracking ? `true` : ``}), `);
|
|
13988
14509
|
if (pure) push(PURE_ANNOTATION);
|
|
@@ -14153,7 +14674,7 @@ var Vue = (function() {
|
|
|
14153
14674
|
if (dir.type === 7 && dir.name !== "for") {
|
|
14154
14675
|
const exp = dir.exp;
|
|
14155
14676
|
const arg = dir.arg;
|
|
14156
|
-
if (exp && exp.type === 4 && !(dir.name === "on" && arg) && !(memo && arg && arg.type === 4 && arg.content === "key")) dir.exp = processExpression(exp, context, dir.name === "slot");
|
|
14677
|
+
if (exp && exp.type === 4 && !(dir.name === "on" && arg) && !(memo && context.vForMemoKeyedNodes.has(node) && arg && arg.type === 4 && arg.content === "key")) dir.exp = processExpression(exp, context, dir.name === "slot");
|
|
14157
14678
|
if (arg && arg.type === 4 && !arg.isStatic) dir.arg = processExpression(arg, context);
|
|
14158
14679
|
}
|
|
14159
14680
|
}
|
|
@@ -14251,16 +14772,17 @@ var Vue = (function() {
|
|
|
14251
14772
|
const keyProperty = createObjectProperty(`key`, createSimpleExpression(`${keyIndex}`, false, locStub, 2));
|
|
14252
14773
|
const { children } = branch;
|
|
14253
14774
|
const firstChild = children[0];
|
|
14254
|
-
if (children.length !== 1 || firstChild.type !== 1)
|
|
14255
|
-
|
|
14256
|
-
|
|
14257
|
-
|
|
14775
|
+
if (children.length !== 1 || firstChild.type !== 1) {
|
|
14776
|
+
if (children.length === 1 && firstChild.type === 11) {
|
|
14777
|
+
const vnodeCall = firstChild.codegenNode;
|
|
14778
|
+
injectProp(vnodeCall, keyProperty, context);
|
|
14779
|
+
return vnodeCall;
|
|
14780
|
+
} else {
|
|
14781
|
+
let patchFlag = 64;
|
|
14782
|
+
if (!branch.isTemplateIf && children.filter((c) => c.type !== 3).length === 1) patchFlag |= 2048;
|
|
14783
|
+
return createVNodeCall(context, helper(FRAGMENT), createObjectExpression([keyProperty]), children, patchFlag, void 0, void 0, true, false, false, branch.loc);
|
|
14784
|
+
}
|
|
14258
14785
|
} else {
|
|
14259
|
-
let patchFlag = 64;
|
|
14260
|
-
if (!branch.isTemplateIf && children.filter((c) => c.type !== 3).length === 1) patchFlag |= 2048;
|
|
14261
|
-
return createVNodeCall(context, helper(FRAGMENT), createObjectExpression([keyProperty]), children, patchFlag, void 0, void 0, true, false, false, branch.loc);
|
|
14262
|
-
}
|
|
14263
|
-
else {
|
|
14264
14786
|
const ret = firstChild.codegenNode;
|
|
14265
14787
|
const vnodeCall = getMemoedVNodeCall(ret);
|
|
14266
14788
|
if (vnodeCall.type === 13) convertToBlock(vnodeCall, context);
|
|
@@ -14281,9 +14803,10 @@ var Vue = (function() {
|
|
|
14281
14803
|
return true;
|
|
14282
14804
|
}
|
|
14283
14805
|
function getParentCondition(node) {
|
|
14284
|
-
while (true) if (node.type === 19)
|
|
14285
|
-
|
|
14286
|
-
|
|
14806
|
+
while (true) if (node.type === 19) {
|
|
14807
|
+
if (node.alternate.type === 19) node = node.alternate;
|
|
14808
|
+
else return node;
|
|
14809
|
+
} else if (node.type === 20) node = node.value;
|
|
14287
14810
|
}
|
|
14288
14811
|
//#endregion
|
|
14289
14812
|
//#region packages/compiler-core/src/transforms/vFor.ts
|
|
@@ -14294,10 +14817,9 @@ var Vue = (function() {
|
|
|
14294
14817
|
const isTemplate = isTemplateNode(node);
|
|
14295
14818
|
const memo = findDir(node, "memo");
|
|
14296
14819
|
const keyProp = findProp(node, `key`, false, true);
|
|
14297
|
-
|
|
14820
|
+
keyProp && keyProp.type;
|
|
14298
14821
|
let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
|
|
14299
|
-
|
|
14300
|
-
const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
|
|
14822
|
+
const keyProperty = keyExp ? createObjectProperty(`key`, keyExp) : null;
|
|
14301
14823
|
const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
|
|
14302
14824
|
const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
|
|
14303
14825
|
forNode.codegenNode = createVNodeCall(context, helper(FRAGMENT), void 0, renderExp, fragmentFlag, void 0, void 0, true, !isStableFragment, false, node.loc);
|
|
@@ -14322,15 +14844,24 @@ var Vue = (function() {
|
|
|
14322
14844
|
else {
|
|
14323
14845
|
childBlock = children[0].codegenNode;
|
|
14324
14846
|
if (isTemplate && keyProperty) injectProp(childBlock, keyProperty, context);
|
|
14325
|
-
|
|
14326
|
-
|
|
14327
|
-
|
|
14328
|
-
|
|
14329
|
-
|
|
14847
|
+
const shouldUseBlock = !isStableFragment || childBlock.isBlockRequired === true;
|
|
14848
|
+
if (childBlock.isBlock !== shouldUseBlock) {
|
|
14849
|
+
if (childBlock.isBlock) {
|
|
14850
|
+
removeHelper(OPEN_BLOCK);
|
|
14851
|
+
removeHelper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
|
|
14852
|
+
} else removeHelper(getVNodeHelper(context.inSSR, childBlock.isComponent));
|
|
14853
|
+
}
|
|
14854
|
+
childBlock.isBlock = shouldUseBlock;
|
|
14330
14855
|
if (childBlock.isBlock) {
|
|
14331
14856
|
helper(OPEN_BLOCK);
|
|
14332
14857
|
helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
|
|
14333
|
-
} else
|
|
14858
|
+
} else {
|
|
14859
|
+
helper(getVNodeHelper(context.inSSR, childBlock.isComponent));
|
|
14860
|
+
if (childBlock.needsPatch) {
|
|
14861
|
+
var _childBlock$patchFlag;
|
|
14862
|
+
childBlock.patchFlag = ((_childBlock$patchFlag = childBlock.patchFlag) !== null && _childBlock$patchFlag !== void 0 ? _childBlock$patchFlag : 0) | 512;
|
|
14863
|
+
}
|
|
14864
|
+
}
|
|
14334
14865
|
}
|
|
14335
14866
|
if (memo) {
|
|
14336
14867
|
const loop = createFunctionExpression(createForLoopParams(forNode.parseResult, [createSimpleExpression(`_cached`)]));
|
|
@@ -14502,8 +15033,10 @@ var Vue = (function() {
|
|
|
14502
15033
|
return createObjectProperty(`default`, fn);
|
|
14503
15034
|
};
|
|
14504
15035
|
if (!hasTemplateSlots) slotsProperties.push(buildDefaultSlotProperty(void 0, children));
|
|
14505
|
-
else if (implicitDefaultChildren.length && !implicitDefaultChildren.every(isWhitespaceText))
|
|
14506
|
-
|
|
15036
|
+
else if (implicitDefaultChildren.length && !implicitDefaultChildren.every(isWhitespaceText)) {
|
|
15037
|
+
if (hasNamedDefaultSlot) context.onError(createCompilerError(39, implicitDefaultChildren[0].loc));
|
|
15038
|
+
else slotsProperties.push(buildDefaultSlotProperty(void 0, implicitDefaultChildren));
|
|
15039
|
+
}
|
|
14507
15040
|
}
|
|
14508
15041
|
const slotFlag = hasDynamicSlots ? 2 : hasForwardedSlots(node.children) ? 3 : 1;
|
|
14509
15042
|
let slots = createObjectExpression(slotsProperties.concat(createObjectProperty(`_`, createSimpleExpression(slotFlag + ` /* ${slotFlagsText[slotFlag]} */`, false))), loc);
|
|
@@ -14529,10 +15062,7 @@ var Vue = (function() {
|
|
|
14529
15062
|
if (hasForwardedSlots(child.branches)) return true;
|
|
14530
15063
|
break;
|
|
14531
15064
|
case 10:
|
|
14532
|
-
case 11:
|
|
14533
|
-
if (hasForwardedSlots(child.children)) return true;
|
|
14534
|
-
break;
|
|
14535
|
-
default: break;
|
|
15065
|
+
case 11: if (hasForwardedSlots(child.children)) return true;
|
|
14536
15066
|
}
|
|
14537
15067
|
}
|
|
14538
15068
|
return false;
|
|
@@ -14554,12 +15084,16 @@ var Vue = (function() {
|
|
|
14554
15084
|
let vnodeDynamicProps;
|
|
14555
15085
|
let dynamicPropNames;
|
|
14556
15086
|
let vnodeDirectives;
|
|
15087
|
+
let needsPatch = false;
|
|
15088
|
+
let isBlockRequired = false;
|
|
14557
15089
|
let shouldUseBlock = isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && (tag === "svg" || tag === "foreignObject" || tag === "math");
|
|
14558
15090
|
if (props.length > 0) {
|
|
14559
15091
|
const propsBuildResult = buildProps(node, context, void 0, isComponent, isDynamicComponent);
|
|
14560
15092
|
vnodeProps = propsBuildResult.props;
|
|
14561
15093
|
patchFlag = propsBuildResult.patchFlag;
|
|
14562
15094
|
dynamicPropNames = propsBuildResult.dynamicPropNames;
|
|
15095
|
+
needsPatch = propsBuildResult.needsPatch;
|
|
15096
|
+
isBlockRequired = propsBuildResult.isBlockRequired;
|
|
14563
15097
|
const directives = propsBuildResult.directives;
|
|
14564
15098
|
vnodeDirectives = directives && directives.length ? createArrayExpression(directives.map((dir) => buildDirectiveArgs(dir, context))) : void 0;
|
|
14565
15099
|
if (propsBuildResult.shouldUseBlock) shouldUseBlock = true;
|
|
@@ -14588,7 +15122,10 @@ var Vue = (function() {
|
|
|
14588
15122
|
} else vnodeChildren = node.children;
|
|
14589
15123
|
}
|
|
14590
15124
|
if (dynamicPropNames && dynamicPropNames.length) vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
|
|
14591
|
-
node.codegenNode = createVNodeCall(context, vnodeTag, vnodeProps, vnodeChildren, patchFlag === 0 ? void 0 : patchFlag, vnodeDynamicProps, vnodeDirectives, !!shouldUseBlock, false, isComponent, node.loc);
|
|
15125
|
+
const vnodeCall = node.codegenNode = createVNodeCall(context, vnodeTag, vnodeProps, vnodeChildren, patchFlag === 0 ? void 0 : patchFlag, vnodeDynamicProps, vnodeDirectives, !!shouldUseBlock, false, isComponent, node.loc);
|
|
15126
|
+
needsPatch = needsPatch && (patchFlag === 0 || patchFlag === 32);
|
|
15127
|
+
if (needsPatch) vnodeCall.needsPatch = true;
|
|
15128
|
+
if (isBlockRequired) vnodeCall.isBlockRequired = true;
|
|
14592
15129
|
};
|
|
14593
15130
|
};
|
|
14594
15131
|
function resolveComponentType(node, context, ssr = false) {
|
|
@@ -14622,6 +15159,7 @@ var Vue = (function() {
|
|
|
14622
15159
|
const runtimeDirectives = [];
|
|
14623
15160
|
const hasChildren = children.length > 0;
|
|
14624
15161
|
let shouldUseBlock = false;
|
|
15162
|
+
let isBlockRequired = false;
|
|
14625
15163
|
let patchFlag = 0;
|
|
14626
15164
|
let hasRef = false;
|
|
14627
15165
|
let hasClassBinding = false;
|
|
@@ -14646,12 +15184,12 @@ var Vue = (function() {
|
|
|
14646
15184
|
const isEventHandler = isOn(name);
|
|
14647
15185
|
if (isEventHandler && (!isComponent || isDynamicComponent) && name.toLowerCase() !== "onclick" && name !== "onUpdate:modelValue" && !isReservedProp(name)) hasHydrationEventBinding = true;
|
|
14648
15186
|
if (isEventHandler && isReservedProp(name)) hasVnodeHook = true;
|
|
15187
|
+
if (name === "ref") hasRef = true;
|
|
14649
15188
|
if (isEventHandler && value.type === 14) value = value.arguments[0];
|
|
14650
15189
|
if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) return;
|
|
14651
|
-
if (name === "
|
|
14652
|
-
else if (name === "class") hasClassBinding = true;
|
|
15190
|
+
if (name === "class") hasClassBinding = true;
|
|
14653
15191
|
else if (name === "style") hasStyleBinding = true;
|
|
14654
|
-
else if (name !== "key" && !dynamicPropNames.includes(name)) dynamicPropNames.push(name);
|
|
15192
|
+
else if (name !== "ref" && name !== "key" && !dynamicPropNames.includes(name)) dynamicPropNames.push(name);
|
|
14655
15193
|
if (isComponent && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) dynamicPropNames.push(name);
|
|
14656
15194
|
} else hasDynamicKeys = true;
|
|
14657
15195
|
};
|
|
@@ -14677,33 +15215,38 @@ var Vue = (function() {
|
|
|
14677
15215
|
if (name === "once" || name === "memo") continue;
|
|
14678
15216
|
if (name === "is" || isVBind && isStaticArgOf(arg, "is") && (isComponentTag(tag) || isCompatEnabled("COMPILER_IS_ON_ELEMENT", context))) continue;
|
|
14679
15217
|
if (isVOn && ssr) continue;
|
|
14680
|
-
if (isVBind && isStaticArgOf(arg, "key")
|
|
15218
|
+
if (isVBind && isStaticArgOf(arg, "key")) shouldUseBlock = true;
|
|
15219
|
+
if (isVOn && hasChildren && arg && isStaticExp(arg) && camelize(arg.content) === "vue:beforeUpdate") {
|
|
15220
|
+
shouldUseBlock = true;
|
|
15221
|
+
isBlockRequired = true;
|
|
15222
|
+
}
|
|
14681
15223
|
if (isVBind && isStaticArgOf(arg, "ref")) pushRefVForMarker();
|
|
14682
15224
|
if (!arg && (isVBind || isVOn)) {
|
|
14683
15225
|
hasDynamicKeys = true;
|
|
14684
|
-
if (exp)
|
|
14685
|
-
|
|
14686
|
-
|
|
14687
|
-
if (
|
|
14688
|
-
if (
|
|
14689
|
-
|
|
14690
|
-
|
|
14691
|
-
|
|
14692
|
-
|
|
14693
|
-
|
|
14694
|
-
|
|
14695
|
-
|
|
14696
|
-
|
|
14697
|
-
|
|
14698
|
-
|
|
14699
|
-
|
|
14700
|
-
|
|
14701
|
-
|
|
14702
|
-
|
|
14703
|
-
|
|
14704
|
-
|
|
14705
|
-
|
|
14706
|
-
|
|
15226
|
+
if (exp) {
|
|
15227
|
+
if (isVBind) {
|
|
15228
|
+
pushMergeArg();
|
|
15229
|
+
if (mergeArgs.some((arg) => {
|
|
15230
|
+
if (arg.type === 15) return arg.properties.some(({ key }) => {
|
|
15231
|
+
if (key.type !== 4 || !key.isStatic) return true;
|
|
15232
|
+
return key.content !== "class" && key.content !== "style" && !isOn(key.content);
|
|
15233
|
+
});
|
|
15234
|
+
else return true;
|
|
15235
|
+
})) checkCompatEnabled("COMPILER_V_BIND_OBJECT_ORDER", context, loc);
|
|
15236
|
+
if (isCompatEnabled("COMPILER_V_BIND_OBJECT_ORDER", context)) {
|
|
15237
|
+
mergeArgs.unshift(exp);
|
|
15238
|
+
continue;
|
|
15239
|
+
}
|
|
15240
|
+
pushRefVForMarker();
|
|
15241
|
+
pushMergeArg();
|
|
15242
|
+
mergeArgs.push(exp);
|
|
15243
|
+
} else pushMergeArg({
|
|
15244
|
+
type: 14,
|
|
15245
|
+
loc,
|
|
15246
|
+
callee: context.helper(TO_HANDLERS),
|
|
15247
|
+
arguments: isComponent ? [exp] : [exp, `true`]
|
|
15248
|
+
});
|
|
15249
|
+
} else context.onError(createCompilerError(isVBind ? 34 : 35, loc));
|
|
14707
15250
|
continue;
|
|
14708
15251
|
}
|
|
14709
15252
|
if (isVBind && modifiers.some((mod) => mod.content === "prop")) patchFlag |= 32;
|
|
@@ -14719,7 +15262,10 @@ var Vue = (function() {
|
|
|
14719
15262
|
}
|
|
14720
15263
|
} else if (!isBuiltInDirective(name)) {
|
|
14721
15264
|
runtimeDirectives.push(prop);
|
|
14722
|
-
if (hasChildren)
|
|
15265
|
+
if (hasChildren) {
|
|
15266
|
+
shouldUseBlock = true;
|
|
15267
|
+
isBlockRequired = true;
|
|
15268
|
+
}
|
|
14723
15269
|
}
|
|
14724
15270
|
}
|
|
14725
15271
|
}
|
|
@@ -14736,7 +15282,8 @@ var Vue = (function() {
|
|
|
14736
15282
|
if (dynamicPropNames.length) patchFlag |= 8;
|
|
14737
15283
|
if (hasHydrationEventBinding) patchFlag |= 32;
|
|
14738
15284
|
}
|
|
14739
|
-
|
|
15285
|
+
const needsPatch = (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0);
|
|
15286
|
+
if (!shouldUseBlock && needsPatch) patchFlag |= 512;
|
|
14740
15287
|
if (!context.inSSR && propsExpression) switch (propsExpression.type) {
|
|
14741
15288
|
case 15:
|
|
14742
15289
|
let classKeyIndex = -1;
|
|
@@ -14757,16 +15304,16 @@ var Vue = (function() {
|
|
|
14757
15304
|
} else propsExpression = createCallExpression(context.helper(NORMALIZE_PROPS), [propsExpression]);
|
|
14758
15305
|
break;
|
|
14759
15306
|
case 14: break;
|
|
14760
|
-
default:
|
|
14761
|
-
propsExpression = createCallExpression(context.helper(NORMALIZE_PROPS), [createCallExpression(context.helper(GUARD_REACTIVE_PROPS), [propsExpression])]);
|
|
14762
|
-
break;
|
|
15307
|
+
default: propsExpression = createCallExpression(context.helper(NORMALIZE_PROPS), [createCallExpression(context.helper(GUARD_REACTIVE_PROPS), [propsExpression])]);
|
|
14763
15308
|
}
|
|
14764
15309
|
return {
|
|
14765
15310
|
props: propsExpression,
|
|
14766
15311
|
directives: runtimeDirectives,
|
|
14767
15312
|
patchFlag,
|
|
14768
15313
|
dynamicPropNames,
|
|
14769
|
-
shouldUseBlock
|
|
15314
|
+
shouldUseBlock,
|
|
15315
|
+
needsPatch,
|
|
15316
|
+
isBlockRequired
|
|
14770
15317
|
};
|
|
14771
15318
|
}
|
|
14772
15319
|
function dedupeProperties(properties) {
|
|
@@ -14863,10 +15410,12 @@ var Vue = (function() {
|
|
|
14863
15410
|
for (let i = 0; i < node.props.length; i++) {
|
|
14864
15411
|
const p = node.props[i];
|
|
14865
15412
|
if (p.type === 6) {
|
|
14866
|
-
if (p.value)
|
|
14867
|
-
|
|
14868
|
-
|
|
14869
|
-
|
|
15413
|
+
if (p.value) {
|
|
15414
|
+
if (p.name === "name") slotName = JSON.stringify(p.value.content);
|
|
15415
|
+
else {
|
|
15416
|
+
p.name = camelize(p.name);
|
|
15417
|
+
nonNameProps.push(p);
|
|
15418
|
+
}
|
|
14870
15419
|
}
|
|
14871
15420
|
} else if (p.name === "bind" && isStaticArgOf(p.arg, "name")) {
|
|
14872
15421
|
if (p.exp) slotName = p.exp;
|
|
@@ -14892,17 +15441,18 @@ var Vue = (function() {
|
|
|
14892
15441
|
const { loc, modifiers, arg } = dir;
|
|
14893
15442
|
if (!dir.exp && !modifiers.length) context.onError(createCompilerError(35, loc));
|
|
14894
15443
|
let eventName;
|
|
14895
|
-
if (arg.type === 4)
|
|
14896
|
-
|
|
14897
|
-
|
|
14898
|
-
|
|
14899
|
-
|
|
14900
|
-
|
|
14901
|
-
|
|
14902
|
-
|
|
14903
|
-
|
|
14904
|
-
|
|
14905
|
-
|
|
15444
|
+
if (arg.type === 4) {
|
|
15445
|
+
if (arg.isStatic) {
|
|
15446
|
+
let rawName = arg.content;
|
|
15447
|
+
if (rawName.startsWith("vnode")) context.onError(createCompilerError(52, arg.loc));
|
|
15448
|
+
if (rawName.startsWith("vue:")) rawName = `vnode-${rawName.slice(4)}`;
|
|
15449
|
+
eventName = createSimpleExpression(node.tagType !== 0 || rawName.startsWith("vnode") || !/[A-Z]/.test(rawName) ? toHandlerKey(camelize(rawName)) : `on:${rawName}`, true, arg.loc);
|
|
15450
|
+
} else eventName = createCompoundExpression([
|
|
15451
|
+
`${context.helperString(TO_HANDLER_KEY)}(`,
|
|
15452
|
+
arg,
|
|
15453
|
+
`)`
|
|
15454
|
+
]);
|
|
15455
|
+
} else {
|
|
14906
15456
|
eventName = arg;
|
|
14907
15457
|
eventName.children.unshift(`${context.helperString(TO_HANDLER_KEY)}(`);
|
|
14908
15458
|
eventName.children.push(`)`);
|
|
@@ -14938,11 +15488,14 @@ var Vue = (function() {
|
|
|
14938
15488
|
arg.children.unshift(`(`);
|
|
14939
15489
|
arg.children.push(`) || ""`);
|
|
14940
15490
|
} else if (!arg.isStatic) arg.content = arg.content ? `${arg.content} || ""` : `""`;
|
|
14941
|
-
if (modifiers.some((mod) => mod.content === "camel"))
|
|
14942
|
-
|
|
14943
|
-
|
|
14944
|
-
|
|
14945
|
-
|
|
15491
|
+
if (modifiers.some((mod) => mod.content === "camel")) {
|
|
15492
|
+
if (arg.type === 4) {
|
|
15493
|
+
if (arg.isStatic) arg.content = camelize(arg.content);
|
|
15494
|
+
else arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`;
|
|
15495
|
+
} else {
|
|
15496
|
+
arg.children.unshift(`${context.helperString(CAMELIZE)}(`);
|
|
15497
|
+
arg.children.push(`)`);
|
|
15498
|
+
}
|
|
14946
15499
|
}
|
|
14947
15500
|
if (!context.inSSR) {
|
|
14948
15501
|
if (modifiers.some((mod) => mod.content === "prop")) injectPrefix(arg, ".");
|
|
@@ -14951,9 +15504,10 @@ var Vue = (function() {
|
|
|
14951
15504
|
return { props: [createObjectProperty(arg, exp)] };
|
|
14952
15505
|
};
|
|
14953
15506
|
const injectPrefix = (arg, prefix) => {
|
|
14954
|
-
if (arg.type === 4)
|
|
14955
|
-
|
|
14956
|
-
|
|
15507
|
+
if (arg.type === 4) {
|
|
15508
|
+
if (arg.isStatic) arg.content = prefix + arg.content;
|
|
15509
|
+
else arg.content = `\`${prefix}\${${arg.content}}\``;
|
|
15510
|
+
} else {
|
|
14957
15511
|
arg.children.unshift(`'${prefix}' + (`);
|
|
14958
15512
|
arg.children.push(`)`);
|
|
14959
15513
|
}
|
|
@@ -15074,7 +15628,7 @@ var Vue = (function() {
|
|
|
15074
15628
|
const child = node.children[i];
|
|
15075
15629
|
if (typeof child !== "object") continue;
|
|
15076
15630
|
if (child.type === 4) parseFilter(child, context);
|
|
15077
|
-
else if (child.type === 8) rewriteFilter(
|
|
15631
|
+
else if (child.type === 8) rewriteFilter(child, context);
|
|
15078
15632
|
else if (child.type === 5) rewriteFilter(child.content, context);
|
|
15079
15633
|
}
|
|
15080
15634
|
}
|
|
@@ -15100,11 +15654,12 @@ var Vue = (function() {
|
|
|
15100
15654
|
if (c === 96 && prev !== 92) inTemplateString = false;
|
|
15101
15655
|
} else if (inRegex) {
|
|
15102
15656
|
if (c === 47 && prev !== 92) inRegex = false;
|
|
15103
|
-
} else if (c === 124 && exp.charCodeAt(i + 1) !== 124 && exp.charCodeAt(i - 1) !== 124 && !curly && !square && !paren)
|
|
15104
|
-
|
|
15105
|
-
|
|
15106
|
-
|
|
15107
|
-
|
|
15657
|
+
} else if (c === 124 && exp.charCodeAt(i + 1) !== 124 && exp.charCodeAt(i - 1) !== 124 && !curly && !square && !paren) {
|
|
15658
|
+
if (expression === void 0) {
|
|
15659
|
+
lastFilterIndex = i + 1;
|
|
15660
|
+
expression = exp.slice(0, i).trim();
|
|
15661
|
+
} else pushFilter();
|
|
15662
|
+
} else {
|
|
15108
15663
|
switch (c) {
|
|
15109
15664
|
case 34:
|
|
15110
15665
|
inDouble = true;
|
|
@@ -15130,9 +15685,7 @@ var Vue = (function() {
|
|
|
15130
15685
|
case 123:
|
|
15131
15686
|
curly++;
|
|
15132
15687
|
break;
|
|
15133
|
-
case 125:
|
|
15134
|
-
curly--;
|
|
15135
|
-
break;
|
|
15688
|
+
case 125: curly--;
|
|
15136
15689
|
}
|
|
15137
15690
|
if (c === 47) {
|
|
15138
15691
|
let j = i - 1;
|
|
@@ -15408,9 +15961,7 @@ var Vue = (function() {
|
|
|
15408
15961
|
isInvalidType = true;
|
|
15409
15962
|
context.onError(createDOMCompilerError(60, dir.loc));
|
|
15410
15963
|
break;
|
|
15411
|
-
default:
|
|
15412
|
-
checkDuplicatedValue();
|
|
15413
|
-
break;
|
|
15964
|
+
default: checkDuplicatedValue();
|
|
15414
15965
|
}
|
|
15415
15966
|
} else if (hasDynamicKeyVBind(node)) directiveToUse = V_MODEL_DYNAMIC;
|
|
15416
15967
|
else checkDuplicatedValue();
|
|
@@ -15423,27 +15974,37 @@ var Vue = (function() {
|
|
|
15423
15974
|
};
|
|
15424
15975
|
//#endregion
|
|
15425
15976
|
//#region packages/compiler-dom/src/transforms/vOn.ts
|
|
15426
|
-
const isEventOptionModifier =
|
|
15427
|
-
const isNonKeyModifier =
|
|
15428
|
-
const maybeKeyModifier =
|
|
15429
|
-
const isKeyboardEvent =
|
|
15977
|
+
const isEventOptionModifier = /*@__PURE__*/ makeMap(`passive,once,capture`);
|
|
15978
|
+
const isNonKeyModifier = /*@__PURE__*/ makeMap("stop,prevent,self,ctrl,shift,alt,meta,exact,middle");
|
|
15979
|
+
const maybeKeyModifier = /*@__PURE__*/ makeMap("left,right");
|
|
15980
|
+
const isKeyboardEvent = /*@__PURE__*/ makeMap(`onkeyup,onkeydown,onkeypress`);
|
|
15430
15981
|
const resolveModifiers = (key, modifiers, context, loc) => {
|
|
15431
15982
|
const keyModifiers = [];
|
|
15432
15983
|
const nonKeyModifiers = [];
|
|
15433
15984
|
const eventOptionModifiers = [];
|
|
15434
15985
|
for (let i = 0; i < modifiers.length; i++) {
|
|
15435
15986
|
const modifier = modifiers[i].content;
|
|
15987
|
+
if (modifier === "delegate") {
|
|
15988
|
+
if (context) {
|
|
15989
|
+
const error = /* @__PURE__ */ new SyntaxError(`.delegate modifier is only supported in Vapor components.`);
|
|
15990
|
+
error.loc = modifiers[i].loc;
|
|
15991
|
+
context.onWarn(error);
|
|
15992
|
+
}
|
|
15993
|
+
continue;
|
|
15994
|
+
}
|
|
15436
15995
|
if (modifier === "native" && context && checkCompatEnabled("COMPILER_V_ON_NATIVE", context, loc)) eventOptionModifiers.push(modifier);
|
|
15437
15996
|
else if (isEventOptionModifier(modifier)) eventOptionModifiers.push(modifier);
|
|
15438
15997
|
else {
|
|
15439
15998
|
const keyString = isString(key) ? key : isStaticExp(key) ? key.content : null;
|
|
15440
|
-
if (maybeKeyModifier(modifier))
|
|
15441
|
-
|
|
15442
|
-
|
|
15443
|
-
|
|
15444
|
-
|
|
15445
|
-
|
|
15446
|
-
|
|
15999
|
+
if (maybeKeyModifier(modifier)) {
|
|
16000
|
+
if (keyString) {
|
|
16001
|
+
if (isKeyboardEvent(keyString.toLowerCase())) keyModifiers.push(modifier);
|
|
16002
|
+
else nonKeyModifiers.push(modifier);
|
|
16003
|
+
} else {
|
|
16004
|
+
keyModifiers.push(modifier);
|
|
16005
|
+
nonKeyModifiers.push(modifier);
|
|
16006
|
+
}
|
|
16007
|
+
} else if (isNonKeyModifier(modifier)) nonKeyModifiers.push(modifier);
|
|
15447
16008
|
else keyModifiers.push(modifier);
|
|
15448
16009
|
}
|
|
15449
16010
|
}
|
|
@@ -15509,7 +16070,7 @@ var Vue = (function() {
|
|
|
15509
16070
|
source: ""
|
|
15510
16071
|
}));
|
|
15511
16072
|
const child = node.children[0];
|
|
15512
|
-
if (child.type === 1) {
|
|
16073
|
+
if (child.type === 1 && !findDir(child, "if")) {
|
|
15513
16074
|
for (const p of child.props) if (p.type === 7 && p.name === "show") node.props.push({
|
|
15514
16075
|
type: 6,
|
|
15515
16076
|
name: "persisted",
|
|
@@ -15558,7 +16119,7 @@ var Vue = (function() {
|
|
|
15558
16119
|
}
|
|
15559
16120
|
return true;
|
|
15560
16121
|
}
|
|
15561
|
-
const headings = new Set([
|
|
16122
|
+
const headings = /* @__PURE__ */ new Set([
|
|
15562
16123
|
"h1",
|
|
15563
16124
|
"h2",
|
|
15564
16125
|
"h3",
|
|
@@ -15570,7 +16131,7 @@ var Vue = (function() {
|
|
|
15570
16131
|
/**
|
|
15571
16132
|
* maps element to set of elements that can be it's children, no other */
|
|
15572
16133
|
const onlyValidChildren = {
|
|
15573
|
-
head: new Set([
|
|
16134
|
+
head: /* @__PURE__ */ new Set([
|
|
15574
16135
|
"base",
|
|
15575
16136
|
"basefront",
|
|
15576
16137
|
"bgsound",
|
|
@@ -15583,24 +16144,24 @@ var Vue = (function() {
|
|
|
15583
16144
|
"script",
|
|
15584
16145
|
"template"
|
|
15585
16146
|
]),
|
|
15586
|
-
optgroup: new Set(["option"]),
|
|
15587
|
-
select: new Set([
|
|
16147
|
+
optgroup: /* @__PURE__ */ new Set(["option"]),
|
|
16148
|
+
select: /* @__PURE__ */ new Set([
|
|
15588
16149
|
"optgroup",
|
|
15589
16150
|
"option",
|
|
15590
16151
|
"hr"
|
|
15591
16152
|
]),
|
|
15592
|
-
table: new Set([
|
|
16153
|
+
table: /* @__PURE__ */ new Set([
|
|
15593
16154
|
"caption",
|
|
15594
16155
|
"colgroup",
|
|
15595
16156
|
"tbody",
|
|
15596
16157
|
"tfoot",
|
|
15597
16158
|
"thead"
|
|
15598
16159
|
]),
|
|
15599
|
-
tr: new Set(["td", "th"]),
|
|
15600
|
-
colgroup: new Set(["col"]),
|
|
15601
|
-
tbody: new Set(["tr"]),
|
|
15602
|
-
thead: new Set(["tr"]),
|
|
15603
|
-
tfoot: new Set(["tr"]),
|
|
16160
|
+
tr: /* @__PURE__ */ new Set(["td", "th"]),
|
|
16161
|
+
colgroup: /* @__PURE__ */ new Set(["col"]),
|
|
16162
|
+
tbody: /* @__PURE__ */ new Set(["tr"]),
|
|
16163
|
+
thead: /* @__PURE__ */ new Set(["tr"]),
|
|
16164
|
+
tfoot: /* @__PURE__ */ new Set(["tr"]),
|
|
15604
16165
|
script: emptySet,
|
|
15605
16166
|
iframe: emptySet,
|
|
15606
16167
|
option: emptySet,
|
|
@@ -15611,30 +16172,30 @@ var Vue = (function() {
|
|
|
15611
16172
|
/** maps elements to set of elements which can be it's parent, no other */
|
|
15612
16173
|
const onlyValidParents = {
|
|
15613
16174
|
html: emptySet,
|
|
15614
|
-
body: new Set(["html"]),
|
|
15615
|
-
head: new Set(["html"]),
|
|
15616
|
-
td: new Set(["tr"]),
|
|
15617
|
-
colgroup: new Set(["table"]),
|
|
15618
|
-
caption: new Set(["table"]),
|
|
15619
|
-
tbody: new Set(["table"]),
|
|
15620
|
-
tfoot: new Set(["table"]),
|
|
15621
|
-
col: new Set(["colgroup"]),
|
|
15622
|
-
th: new Set(["tr"]),
|
|
15623
|
-
thead: new Set(["table"]),
|
|
15624
|
-
tr: new Set([
|
|
16175
|
+
body: /* @__PURE__ */ new Set(["html"]),
|
|
16176
|
+
head: /* @__PURE__ */ new Set(["html"]),
|
|
16177
|
+
td: /* @__PURE__ */ new Set(["tr"]),
|
|
16178
|
+
colgroup: /* @__PURE__ */ new Set(["table"]),
|
|
16179
|
+
caption: /* @__PURE__ */ new Set(["table"]),
|
|
16180
|
+
tbody: /* @__PURE__ */ new Set(["table"]),
|
|
16181
|
+
tfoot: /* @__PURE__ */ new Set(["table"]),
|
|
16182
|
+
col: /* @__PURE__ */ new Set(["colgroup"]),
|
|
16183
|
+
th: /* @__PURE__ */ new Set(["tr"]),
|
|
16184
|
+
thead: /* @__PURE__ */ new Set(["table"]),
|
|
16185
|
+
tr: /* @__PURE__ */ new Set([
|
|
15625
16186
|
"tbody",
|
|
15626
16187
|
"thead",
|
|
15627
16188
|
"tfoot"
|
|
15628
16189
|
]),
|
|
15629
|
-
dd: new Set(["dl", "div"]),
|
|
15630
|
-
dt: new Set(["dl", "div"]),
|
|
15631
|
-
figcaption: new Set(["figure"]),
|
|
15632
|
-
summary: new Set(["details"]),
|
|
15633
|
-
area: new Set(["map"])
|
|
16190
|
+
dd: /* @__PURE__ */ new Set(["dl", "div"]),
|
|
16191
|
+
dt: /* @__PURE__ */ new Set(["dl", "div"]),
|
|
16192
|
+
figcaption: /* @__PURE__ */ new Set(["figure"]),
|
|
16193
|
+
summary: /* @__PURE__ */ new Set(["details"]),
|
|
16194
|
+
area: /* @__PURE__ */ new Set(["map"])
|
|
15634
16195
|
};
|
|
15635
16196
|
/** maps element to set of elements that can not be it's children, others can */
|
|
15636
16197
|
const knownInvalidChildren = {
|
|
15637
|
-
p: new Set([
|
|
16198
|
+
p: /* @__PURE__ */ new Set([
|
|
15638
16199
|
"address",
|
|
15639
16200
|
"article",
|
|
15640
16201
|
"aside",
|
|
@@ -15669,7 +16230,7 @@ var Vue = (function() {
|
|
|
15669
16230
|
"table",
|
|
15670
16231
|
"ul"
|
|
15671
16232
|
]),
|
|
15672
|
-
svg: new Set([
|
|
16233
|
+
svg: /* @__PURE__ */ new Set([
|
|
15673
16234
|
"b",
|
|
15674
16235
|
"blockquote",
|
|
15675
16236
|
"br",
|
|
@@ -15710,12 +16271,12 @@ var Vue = (function() {
|
|
|
15710
16271
|
};
|
|
15711
16272
|
/** maps element to set of elements that can not be it's parent, others can */
|
|
15712
16273
|
const knownInvalidParents = {
|
|
15713
|
-
a: new Set(["a"]),
|
|
15714
|
-
button: new Set(["button"]),
|
|
15715
|
-
dd: new Set(["dd", "dt"]),
|
|
15716
|
-
dt: new Set(["dd", "dt"]),
|
|
15717
|
-
form: new Set(["form"]),
|
|
15718
|
-
li: new Set(["li"]),
|
|
16274
|
+
a: /* @__PURE__ */ new Set(["a"]),
|
|
16275
|
+
button: /* @__PURE__ */ new Set(["button"]),
|
|
16276
|
+
dd: /* @__PURE__ */ new Set(["dd", "dt"]),
|
|
16277
|
+
dt: /* @__PURE__ */ new Set(["dd", "dt"]),
|
|
16278
|
+
form: /* @__PURE__ */ new Set(["form"]),
|
|
16279
|
+
li: /* @__PURE__ */ new Set(["li"]),
|
|
15719
16280
|
h1: headings,
|
|
15720
16281
|
h2: headings,
|
|
15721
16282
|
h3: headings,
|
|
@@ -15758,10 +16319,12 @@ var Vue = (function() {
|
|
|
15758
16319
|
//#region packages/vue-compat/src/index.ts
|
|
15759
16320
|
const compileCache = Object.create(null);
|
|
15760
16321
|
function compileToFunction(template, options) {
|
|
15761
|
-
if (!isString(template))
|
|
15762
|
-
|
|
15763
|
-
|
|
15764
|
-
|
|
16322
|
+
if (!isString(template)) {
|
|
16323
|
+
if (template.nodeType) template = template.innerHTML;
|
|
16324
|
+
else {
|
|
16325
|
+
warn(`invalid template option: `, template);
|
|
16326
|
+
return NOOP;
|
|
16327
|
+
}
|
|
15765
16328
|
}
|
|
15766
16329
|
const key = genCacheKey(template, options);
|
|
15767
16330
|
const cached = compileCache[key];
|