@vue/runtime-dom 3.6.0-rc.1 → 3.6.0-rc.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/runtime-dom.cjs.js +106 -76
- package/dist/runtime-dom.cjs.prod.js +95 -68
- package/dist/runtime-dom.d.ts +147 -157
- package/dist/runtime-dom.esm-browser.js +942 -653
- package/dist/runtime-dom.esm-browser.prod.js +4 -3
- package/dist/runtime-dom.esm-bundler.js +153 -121
- package/dist/runtime-dom.global.js +942 -653
- package/dist/runtime-dom.global.prod.js +4 -3
- package/package.json +5 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.6.0-rc.
|
|
2
|
+
* @vue/runtime-dom v3.6.0-rc.11
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* \/\*#\_\_PURE\_\_\*\/
|
|
12
12
|
* So that they can be tree-shaken if necessary.
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
15
15
|
function makeMap(str) {
|
|
16
16
|
const map = Object.create(null);
|
|
17
17
|
for (const key of str.split(",")) map[key] = 1;
|
|
@@ -55,9 +55,9 @@ const toRawType = (value) => {
|
|
|
55
55
|
};
|
|
56
56
|
const isPlainObject = (val) => toTypeString(val) === "[object Object]";
|
|
57
57
|
const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
|
|
58
|
-
const isReservedProp =
|
|
59
|
-
const isBuiltInTag =
|
|
60
|
-
const isBuiltInDirective =
|
|
58
|
+
const isReservedProp = /*@__PURE__*/ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
|
|
59
|
+
const isBuiltInTag = /*#__PURE__*/ makeMap("slot,component");
|
|
60
|
+
const isBuiltInDirective = /*@__PURE__*/ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
|
|
61
61
|
const cacheStringFunction = (fn) => {
|
|
62
62
|
const cache = Object.create(null);
|
|
63
63
|
return ((str) => {
|
|
@@ -131,7 +131,7 @@ const getGlobalThis = () => {
|
|
|
131
131
|
function canSetValueDirectly(tagName) {
|
|
132
132
|
return tagName !== "PROGRESS" && !tagName.includes("-");
|
|
133
133
|
}
|
|
134
|
-
const isGloballyAllowed =
|
|
134
|
+
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");
|
|
135
135
|
//#endregion
|
|
136
136
|
//#region packages/shared/src/normalizeProp.ts
|
|
137
137
|
function normalizeStyle(value) {
|
|
@@ -147,10 +147,10 @@ function normalizeStyle(value) {
|
|
|
147
147
|
}
|
|
148
148
|
const listDelimiterRE = /;(?![^(]*\))/g;
|
|
149
149
|
const propertyDelimiterRE = /:([^]+)/;
|
|
150
|
-
const styleCommentRE =
|
|
150
|
+
const styleCommentRE = /"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;
|
|
151
151
|
function parseStringStyle(cssText) {
|
|
152
152
|
const ret = {};
|
|
153
|
-
cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
|
|
153
|
+
cssText.replace(styleCommentRE, (match) => match.startsWith("/*") ? "" : match).split(listDelimiterRE).forEach((item) => {
|
|
154
154
|
if (item) {
|
|
155
155
|
const tmp = item.split(propertyDelimiterRE);
|
|
156
156
|
tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
|
|
@@ -199,17 +199,17 @@ const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math
|
|
|
199
199
|
* Compiler only.
|
|
200
200
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
201
201
|
*/
|
|
202
|
-
const isHTMLTag =
|
|
202
|
+
const isHTMLTag = /*@__PURE__*/ makeMap(HTML_TAGS);
|
|
203
203
|
/**
|
|
204
204
|
* Compiler only.
|
|
205
205
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
206
206
|
*/
|
|
207
|
-
const isSVGTag =
|
|
207
|
+
const isSVGTag = /*@__PURE__*/ makeMap(SVG_TAGS);
|
|
208
208
|
/**
|
|
209
209
|
* Compiler only.
|
|
210
210
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
211
211
|
*/
|
|
212
|
-
const isMathMLTag =
|
|
212
|
+
const isMathMLTag = /*@__PURE__*/ makeMap(MATH_TAGS);
|
|
213
213
|
//#endregion
|
|
214
214
|
//#region packages/shared/src/domAttrConfig.ts
|
|
215
215
|
/**
|
|
@@ -224,11 +224,11 @@ const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
|
|
|
224
224
|
* - readonly -> readOnly
|
|
225
225
|
*/
|
|
226
226
|
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
|
|
227
|
-
const isSpecialBooleanAttr =
|
|
227
|
+
const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
|
|
228
228
|
/**
|
|
229
229
|
* The full list is needed during SSR to produce the correct initial markup.
|
|
230
230
|
*/
|
|
231
|
-
const isBooleanAttr =
|
|
231
|
+
const isBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
|
|
232
232
|
/**
|
|
233
233
|
* Boolean attributes should be included if the value is truthy or ''.
|
|
234
234
|
* e.g. `<select multiple>` compiles to `{ multiple: '' }`
|
|
@@ -242,11 +242,11 @@ function includeBooleanAttr(value) {
|
|
|
242
242
|
* Don't also forget to allow `data-*` and `aria-*`!
|
|
243
243
|
* Generated from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes
|
|
244
244
|
*/
|
|
245
|
-
const isKnownHtmlAttr =
|
|
245
|
+
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");
|
|
246
246
|
/**
|
|
247
247
|
* Generated from https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
|
|
248
248
|
*/
|
|
249
|
-
const isKnownSvgAttr =
|
|
249
|
+
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");
|
|
250
250
|
/**
|
|
251
251
|
* Shared between server-renderer and runtime-core hydration logic
|
|
252
252
|
*/
|
|
@@ -272,13 +272,54 @@ function getEscapedCssVarName(key, doubleEscape) {
|
|
|
272
272
|
}
|
|
273
273
|
//#endregion
|
|
274
274
|
//#region packages/shared/src/looseEqual.ts
|
|
275
|
-
function looseCompareArrays(a, b) {
|
|
275
|
+
function looseCompareArrays(a, b, seen) {
|
|
276
276
|
if (a.length !== b.length) return false;
|
|
277
277
|
let equal = true;
|
|
278
|
-
for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i]);
|
|
278
|
+
for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i], seen);
|
|
279
279
|
return equal;
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function looseCompareCollections(a, b, seen) {
|
|
282
|
+
if (a.size !== b.size) return false;
|
|
283
|
+
const candidates = Array.from(b);
|
|
284
|
+
const matched = new Uint8Array(candidates.length);
|
|
285
|
+
for (const item of a) {
|
|
286
|
+
let index = -1;
|
|
287
|
+
for (let i = 0; i < candidates.length; i++) if (!matched[i] && looseEqual(item, candidates[i], seen)) {
|
|
288
|
+
index = i;
|
|
289
|
+
break;
|
|
290
|
+
}
|
|
291
|
+
if (index < 0) return false;
|
|
292
|
+
matched[index] = 1;
|
|
293
|
+
}
|
|
294
|
+
return true;
|
|
295
|
+
}
|
|
296
|
+
function looseCompareObjects(a, b, seen) {
|
|
297
|
+
let aValidType = isMap(a);
|
|
298
|
+
let bValidType = isMap(b);
|
|
299
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
|
|
300
|
+
aValidType = isSet(a);
|
|
301
|
+
bValidType = isSet(b);
|
|
302
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
|
|
303
|
+
if (Object.keys(a).length !== Object.keys(b).length) return false;
|
|
304
|
+
for (const key in a) {
|
|
305
|
+
const aHasKey = a.hasOwnProperty(key);
|
|
306
|
+
const bHasKey = b.hasOwnProperty(key);
|
|
307
|
+
if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key], seen)) return false;
|
|
308
|
+
}
|
|
309
|
+
return String(a) === String(b);
|
|
310
|
+
}
|
|
311
|
+
function looseCompareNested(a, b, seen, compare) {
|
|
312
|
+
if (!seen) seen = [/* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()];
|
|
313
|
+
const [seenA, seenB] = seen;
|
|
314
|
+
if (seenA.has(a) || seenB.has(b)) return seenA.get(a) === b && seenB.get(b) === a;
|
|
315
|
+
seenA.set(a, b);
|
|
316
|
+
seenB.set(b, a);
|
|
317
|
+
const equal = compare(a, b, seen);
|
|
318
|
+
seenA.delete(a);
|
|
319
|
+
seenB.delete(b);
|
|
320
|
+
return equal;
|
|
321
|
+
}
|
|
322
|
+
function looseEqual(a, b, seen) {
|
|
282
323
|
if (a === b) return true;
|
|
283
324
|
let aValidType = isDate(a);
|
|
284
325
|
let bValidType = isDate(b);
|
|
@@ -288,17 +329,12 @@ function looseEqual(a, b) {
|
|
|
288
329
|
if (aValidType || bValidType) return a === b;
|
|
289
330
|
aValidType = isArray(a);
|
|
290
331
|
bValidType = isArray(b);
|
|
291
|
-
if (aValidType || bValidType) return aValidType && bValidType ?
|
|
332
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareNested(a, b, seen, looseCompareArrays) : false;
|
|
292
333
|
aValidType = isObject(a);
|
|
293
334
|
bValidType = isObject(b);
|
|
294
335
|
if (aValidType || bValidType) {
|
|
295
336
|
if (!aValidType || !bValidType) return false;
|
|
296
|
-
|
|
297
|
-
for (const key in a) {
|
|
298
|
-
const aHasKey = a.hasOwnProperty(key);
|
|
299
|
-
const bHasKey = b.hasOwnProperty(key);
|
|
300
|
-
if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) return false;
|
|
301
|
-
}
|
|
337
|
+
return looseCompareNested(a, b, seen, looseCompareObjects);
|
|
302
338
|
}
|
|
303
339
|
return String(a) === String(b);
|
|
304
340
|
}
|
|
@@ -428,6 +464,8 @@ function setupFlagsHandler(target) {
|
|
|
428
464
|
function warn$2(msg, ...args) {
|
|
429
465
|
console.warn(`[Vue warn] ${msg}`, ...args);
|
|
430
466
|
}
|
|
467
|
+
//#endregion
|
|
468
|
+
//#region packages/reactivity/src/system.ts
|
|
431
469
|
const notifyBuffer = [];
|
|
432
470
|
let batchDepth = 0;
|
|
433
471
|
let activeSub = void 0;
|
|
@@ -566,13 +604,23 @@ function endTracking(sub, prevSub) {
|
|
|
566
604
|
sub.flags &= -5;
|
|
567
605
|
}
|
|
568
606
|
function flush() {
|
|
607
|
+
let hasError = false;
|
|
608
|
+
let error;
|
|
569
609
|
while (notifyIndex < notifyBufferLength) {
|
|
570
610
|
const effect = notifyBuffer[notifyIndex];
|
|
571
611
|
notifyBuffer[notifyIndex++] = void 0;
|
|
572
|
-
|
|
612
|
+
try {
|
|
613
|
+
effect.notify();
|
|
614
|
+
} catch (err) {
|
|
615
|
+
if (!hasError) {
|
|
616
|
+
hasError = true;
|
|
617
|
+
error = err;
|
|
618
|
+
}
|
|
619
|
+
}
|
|
573
620
|
}
|
|
574
621
|
notifyIndex = 0;
|
|
575
622
|
notifyBufferLength = 0;
|
|
623
|
+
if (hasError) throw error;
|
|
576
624
|
}
|
|
577
625
|
function checkDirty(link, sub) {
|
|
578
626
|
let stack;
|
|
@@ -656,7 +704,7 @@ var Dep = class {
|
|
|
656
704
|
}
|
|
657
705
|
set subs(value) {
|
|
658
706
|
this._subs = value;
|
|
659
|
-
if (value === void 0) this.map.delete(this.key);
|
|
707
|
+
if (value === void 0 && this.map) this.map.delete(this.key);
|
|
660
708
|
}
|
|
661
709
|
};
|
|
662
710
|
const targetMap = /* @__PURE__ */ new WeakMap();
|
|
@@ -739,9 +787,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
739
787
|
if (isMap(target)) run(depsMap.get(MAP_KEY_ITERATE_KEY));
|
|
740
788
|
}
|
|
741
789
|
break;
|
|
742
|
-
case "set":
|
|
743
|
-
if (isMap(target)) run(depsMap.get(ITERATE_KEY));
|
|
744
|
-
break;
|
|
790
|
+
case "set": if (isMap(target)) run(depsMap.get(ITERATE_KEY));
|
|
745
791
|
}
|
|
746
792
|
}
|
|
747
793
|
}
|
|
@@ -756,13 +802,17 @@ function getDepFromReactive(object, key) {
|
|
|
756
802
|
/**
|
|
757
803
|
* Track array iteration and return:
|
|
758
804
|
* - if input is reactive: a cloned raw array with reactive values
|
|
759
|
-
* - if input is
|
|
805
|
+
* - if input is readonly: a cloned raw array with readonly values, preserving
|
|
806
|
+
* reactivity
|
|
807
|
+
* - if input is raw or shallow: the original raw array
|
|
760
808
|
*/
|
|
761
809
|
function reactiveReadArray(array) {
|
|
762
810
|
const raw = /* @__PURE__ */ toRaw(array);
|
|
763
811
|
if (raw === array) return raw;
|
|
764
812
|
track(raw, "iterate", ARRAY_ITERATE_KEY);
|
|
765
|
-
|
|
813
|
+
if (/* @__PURE__ */ isShallow(array)) return raw;
|
|
814
|
+
if (!/* @__PURE__ */ isReadonly(array)) return raw.map(toReactive);
|
|
815
|
+
return /* @__PURE__ */ isReactive(array) ? raw.map((item) => toReadonly(toReactive(item))) : raw.map(toReadonly);
|
|
766
816
|
}
|
|
767
817
|
/**
|
|
768
818
|
* Track array iteration and return raw array
|
|
@@ -938,8 +988,8 @@ function noTracking(self, method, args = []) {
|
|
|
938
988
|
}
|
|
939
989
|
//#endregion
|
|
940
990
|
//#region packages/reactivity/src/baseHandlers.ts
|
|
941
|
-
const isNonTrackableKeys =
|
|
942
|
-
const builtInSymbols = new Set(
|
|
991
|
+
const isNonTrackableKeys = /*@__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);
|
|
992
|
+
const builtInSymbols = new Set(/*@__PURE__*/ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
|
|
943
993
|
function hasOwnProperty(key) {
|
|
944
994
|
if (!isSymbol(key)) key = String(key);
|
|
945
995
|
const obj = /* @__PURE__ */ toRaw(this);
|
|
@@ -994,12 +1044,14 @@ var MutableReactiveHandler = class extends BaseReactiveHandler {
|
|
|
994
1044
|
oldValue = /* @__PURE__ */ toRaw(oldValue);
|
|
995
1045
|
value = /* @__PURE__ */ toRaw(value);
|
|
996
1046
|
}
|
|
997
|
-
if (!isArrayWithIntegerKey && /* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value))
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1047
|
+
if (!isArrayWithIntegerKey && /* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value)) {
|
|
1048
|
+
if (isOldValueReadonly) {
|
|
1049
|
+
warn$2(`Set operation on key "${String(key)}" failed: target is readonly.`, target[key]);
|
|
1050
|
+
return true;
|
|
1051
|
+
} else {
|
|
1052
|
+
oldValue.value = value;
|
|
1053
|
+
return true;
|
|
1054
|
+
}
|
|
1003
1055
|
}
|
|
1004
1056
|
}
|
|
1005
1057
|
const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
|
|
@@ -1040,10 +1092,10 @@ var ReadonlyReactiveHandler = class extends BaseReactiveHandler {
|
|
|
1040
1092
|
return true;
|
|
1041
1093
|
}
|
|
1042
1094
|
};
|
|
1043
|
-
const mutableHandlers =
|
|
1044
|
-
const readonlyHandlers =
|
|
1045
|
-
const shallowReactiveHandlers =
|
|
1046
|
-
const shallowReadonlyHandlers =
|
|
1095
|
+
const mutableHandlers = /*@__PURE__*/ new MutableReactiveHandler();
|
|
1096
|
+
const readonlyHandlers = /*@__PURE__*/ new ReadonlyReactiveHandler();
|
|
1097
|
+
const shallowReactiveHandlers = /*@__PURE__*/ new MutableReactiveHandler(true);
|
|
1098
|
+
const shallowReadonlyHandlers = /*@__PURE__*/ new ReadonlyReactiveHandler(true);
|
|
1047
1099
|
//#endregion
|
|
1048
1100
|
//#region packages/reactivity/src/collectionHandlers.ts
|
|
1049
1101
|
const toShallow = (value) => value;
|
|
@@ -1194,10 +1246,10 @@ function createInstrumentationGetter(isReadonly, shallow) {
|
|
|
1194
1246
|
return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
|
|
1195
1247
|
};
|
|
1196
1248
|
}
|
|
1197
|
-
const mutableCollectionHandlers = { get:
|
|
1198
|
-
const shallowCollectionHandlers = { get:
|
|
1199
|
-
const readonlyCollectionHandlers = { get:
|
|
1200
|
-
const shallowReadonlyCollectionHandlers = { get:
|
|
1249
|
+
const mutableCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(false, false) };
|
|
1250
|
+
const shallowCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(false, true) };
|
|
1251
|
+
const readonlyCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(true, false) };
|
|
1252
|
+
const shallowReadonlyCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(true, true) };
|
|
1201
1253
|
function checkIdentityKeys(target, has, key) {
|
|
1202
1254
|
const rawKey = /* @__PURE__ */ toRaw(key);
|
|
1203
1255
|
if (rawKey !== key && has.call(target, rawKey)) {
|
|
@@ -1222,7 +1274,7 @@ function targetTypeMap(rawType) {
|
|
|
1222
1274
|
default: return 0;
|
|
1223
1275
|
}
|
|
1224
1276
|
}
|
|
1225
|
-
|
|
1277
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1226
1278
|
function reactive(target) {
|
|
1227
1279
|
if (/* @__PURE__ */ isReadonly(target)) return target;
|
|
1228
1280
|
return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
|
|
@@ -1257,7 +1309,7 @@ function reactive(target) {
|
|
|
1257
1309
|
* @param target - The source object.
|
|
1258
1310
|
* @see {@link https://vuejs.org/api/reactivity-advanced.html#shallowreactive}
|
|
1259
1311
|
*/
|
|
1260
|
-
|
|
1312
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1261
1313
|
function shallowReactive(target) {
|
|
1262
1314
|
return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap);
|
|
1263
1315
|
}
|
|
@@ -1290,7 +1342,7 @@ function shallowReactive(target) {
|
|
|
1290
1342
|
* @param target - The source object.
|
|
1291
1343
|
* @see {@link https://vuejs.org/api/reactivity-core.html#readonly}
|
|
1292
1344
|
*/
|
|
1293
|
-
|
|
1345
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1294
1346
|
function readonly(target) {
|
|
1295
1347
|
return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);
|
|
1296
1348
|
}
|
|
@@ -1324,7 +1376,7 @@ function readonly(target) {
|
|
|
1324
1376
|
* @param target - The source object.
|
|
1325
1377
|
* @see {@link https://vuejs.org/api/reactivity-advanced.html#shallowreadonly}
|
|
1326
1378
|
*/
|
|
1327
|
-
|
|
1379
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1328
1380
|
function shallowReadonly(target) {
|
|
1329
1381
|
return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);
|
|
1330
1382
|
}
|
|
@@ -1361,7 +1413,7 @@ function createReactiveObject(target, isReadonly, baseHandlers, collectionHandle
|
|
|
1361
1413
|
* @param value - The value to check.
|
|
1362
1414
|
* @see {@link https://vuejs.org/api/reactivity-utilities.html#isreactive}
|
|
1363
1415
|
*/
|
|
1364
|
-
|
|
1416
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1365
1417
|
function isReactive(value) {
|
|
1366
1418
|
if (/* @__PURE__ */ isReadonly(value)) return /* @__PURE__ */ isReactive(value["__v_raw"]);
|
|
1367
1419
|
return !!(value && value["__v_isReactive"]);
|
|
@@ -1377,11 +1429,11 @@ function isReactive(value) {
|
|
|
1377
1429
|
* @param value - The value to check.
|
|
1378
1430
|
* @see {@link https://vuejs.org/api/reactivity-utilities.html#isreadonly}
|
|
1379
1431
|
*/
|
|
1380
|
-
|
|
1432
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1381
1433
|
function isReadonly(value) {
|
|
1382
1434
|
return !!(value && value["__v_isReadonly"]);
|
|
1383
1435
|
}
|
|
1384
|
-
|
|
1436
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1385
1437
|
function isShallow(value) {
|
|
1386
1438
|
return !!(value && value["__v_isShallow"]);
|
|
1387
1439
|
}
|
|
@@ -1392,7 +1444,7 @@ function isShallow(value) {
|
|
|
1392
1444
|
* @param value - The value to check.
|
|
1393
1445
|
* @see {@link https://vuejs.org/api/reactivity-utilities.html#isproxy}
|
|
1394
1446
|
*/
|
|
1395
|
-
|
|
1447
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1396
1448
|
function isProxy(value) {
|
|
1397
1449
|
return value ? !!value["__v_raw"] : false;
|
|
1398
1450
|
}
|
|
@@ -1419,7 +1471,7 @@ function isProxy(value) {
|
|
|
1419
1471
|
* @param observed - The object for which the "raw" value is requested.
|
|
1420
1472
|
* @see {@link https://vuejs.org/api/reactivity-advanced.html#toraw}
|
|
1421
1473
|
*/
|
|
1422
|
-
|
|
1474
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1423
1475
|
function toRaw(observed) {
|
|
1424
1476
|
const raw = observed && observed["__v_raw"];
|
|
1425
1477
|
return raw ? /* @__PURE__ */ toRaw(raw) : observed;
|
|
@@ -1468,15 +1520,15 @@ const toReactive = (value) => isObject(value) ? /* @__PURE__ */ reactive(value)
|
|
|
1468
1520
|
const toReadonly = (value) => isObject(value) ? /* @__PURE__ */ readonly(value) : value;
|
|
1469
1521
|
//#endregion
|
|
1470
1522
|
//#region packages/reactivity/src/ref.ts
|
|
1471
|
-
|
|
1523
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1472
1524
|
function isRef(r) {
|
|
1473
1525
|
return r ? r["__v_isRef"] === true : false;
|
|
1474
1526
|
}
|
|
1475
|
-
|
|
1527
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1476
1528
|
function ref(value) {
|
|
1477
1529
|
return createRef(value, toReactive);
|
|
1478
1530
|
}
|
|
1479
|
-
|
|
1531
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1480
1532
|
function shallowRef(value) {
|
|
1481
1533
|
return createRef(value);
|
|
1482
1534
|
}
|
|
@@ -1679,7 +1731,7 @@ function customRef(factory) {
|
|
|
1679
1731
|
* @param object - Reactive object to be made into an object of linked refs.
|
|
1680
1732
|
* @see {@link https://vuejs.org/api/reactivity-utilities.html#torefs}
|
|
1681
1733
|
*/
|
|
1682
|
-
|
|
1734
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1683
1735
|
function toRefs(object) {
|
|
1684
1736
|
const ret = isArray(object) ? new Array(object.length) : {};
|
|
1685
1737
|
for (const key in object) ret[key] = propertyToRef(object, key);
|
|
@@ -1730,7 +1782,7 @@ var GetterRefImpl = class {
|
|
|
1730
1782
|
return this._value = this._getter();
|
|
1731
1783
|
}
|
|
1732
1784
|
};
|
|
1733
|
-
|
|
1785
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1734
1786
|
function toRef(source, key, defaultValue) {
|
|
1735
1787
|
if (/* @__PURE__ */ isRef(source)) return source;
|
|
1736
1788
|
else if (isFunction(source)) return new GetterRefImpl(source);
|
|
@@ -1796,10 +1848,12 @@ var ReactiveEffect = class {
|
|
|
1796
1848
|
get dirty() {
|
|
1797
1849
|
const flags = this.flags;
|
|
1798
1850
|
if (flags & 16) return true;
|
|
1799
|
-
if (flags & 32)
|
|
1800
|
-
this.
|
|
1801
|
-
|
|
1802
|
-
|
|
1851
|
+
if (flags & 32) {
|
|
1852
|
+
if (checkDirty(this.deps, this)) {
|
|
1853
|
+
this.flags = flags | 16;
|
|
1854
|
+
return true;
|
|
1855
|
+
} else this.flags = flags & -33;
|
|
1856
|
+
}
|
|
1803
1857
|
return false;
|
|
1804
1858
|
}
|
|
1805
1859
|
};
|
|
@@ -1978,10 +2032,12 @@ var ComputedRefImpl = class {
|
|
|
1978
2032
|
get _dirty() {
|
|
1979
2033
|
const flags = this.flags;
|
|
1980
2034
|
if (flags & 16) return true;
|
|
1981
|
-
if (flags & 32)
|
|
1982
|
-
this.
|
|
1983
|
-
|
|
1984
|
-
|
|
2035
|
+
if (flags & 32) {
|
|
2036
|
+
if (checkDirty(this.deps, this)) {
|
|
2037
|
+
this.flags = flags | 16;
|
|
2038
|
+
return true;
|
|
2039
|
+
} else this.flags = flags & -33;
|
|
2040
|
+
}
|
|
1985
2041
|
return false;
|
|
1986
2042
|
}
|
|
1987
2043
|
/**
|
|
@@ -2042,7 +2098,7 @@ var ComputedRefImpl = class {
|
|
|
2042
2098
|
}
|
|
2043
2099
|
};
|
|
2044
2100
|
setupOnTrigger(ComputedRefImpl);
|
|
2045
|
-
|
|
2101
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
2046
2102
|
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
2047
2103
|
let getter;
|
|
2048
2104
|
let setter;
|
|
@@ -2120,25 +2176,26 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
2120
2176
|
else if (isFunction(s)) return call ? call(s, 2) : s();
|
|
2121
2177
|
else warnInvalidSource(s, onWarn);
|
|
2122
2178
|
});
|
|
2123
|
-
} else if (isFunction(source))
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2179
|
+
} else if (isFunction(source)) {
|
|
2180
|
+
if (cb) getter = call ? () => call(source, 2) : source;
|
|
2181
|
+
else getter = () => {
|
|
2182
|
+
if (this.cleanupsLength) {
|
|
2183
|
+
const prevSub = setActiveSub();
|
|
2184
|
+
try {
|
|
2185
|
+
cleanup(this);
|
|
2186
|
+
} finally {
|
|
2187
|
+
setActiveSub(prevSub);
|
|
2188
|
+
}
|
|
2189
|
+
}
|
|
2190
|
+
const currentEffect = activeWatcher;
|
|
2191
|
+
activeWatcher = this;
|
|
2127
2192
|
try {
|
|
2128
|
-
|
|
2193
|
+
return call ? call(source, 3, [this.boundCleanup]) : source(this.boundCleanup);
|
|
2129
2194
|
} finally {
|
|
2130
|
-
|
|
2195
|
+
activeWatcher = currentEffect;
|
|
2131
2196
|
}
|
|
2132
|
-
}
|
|
2133
|
-
|
|
2134
|
-
activeWatcher = this;
|
|
2135
|
-
try {
|
|
2136
|
-
return call ? call(source, 3, [this.boundCleanup]) : source(this.boundCleanup);
|
|
2137
|
-
} finally {
|
|
2138
|
-
activeWatcher = currentEffect;
|
|
2139
|
-
}
|
|
2140
|
-
};
|
|
2141
|
-
else {
|
|
2197
|
+
};
|
|
2198
|
+
} else {
|
|
2142
2199
|
getter = NOOP;
|
|
2143
2200
|
warnInvalidSource(source, onWarn);
|
|
2144
2201
|
}
|
|
@@ -2462,7 +2519,7 @@ let currentFlushPromise = null;
|
|
|
2462
2519
|
let jobsLength = 0;
|
|
2463
2520
|
let flushIndex = 0;
|
|
2464
2521
|
let postFlushIndex = 0;
|
|
2465
|
-
const resolvedPromise =
|
|
2522
|
+
const resolvedPromise = /*@__PURE__*/ Promise.resolve();
|
|
2466
2523
|
const RECURSION_LIMIT = 100;
|
|
2467
2524
|
function nextTick(fn) {
|
|
2468
2525
|
const p = currentFlushPromise || resolvedPromise;
|
|
@@ -2501,6 +2558,7 @@ const doFlushJobs = () => {
|
|
|
2501
2558
|
flushJobs();
|
|
2502
2559
|
} catch (e) {
|
|
2503
2560
|
currentFlushPromise = null;
|
|
2561
|
+
if (jobsLength || postJobs.length) queueFlush();
|
|
2504
2562
|
throw e;
|
|
2505
2563
|
}
|
|
2506
2564
|
};
|
|
@@ -2508,9 +2566,10 @@ function queueFlush() {
|
|
|
2508
2566
|
if (!currentFlushPromise) currentFlushPromise = resolvedPromise.then(doFlushJobs);
|
|
2509
2567
|
}
|
|
2510
2568
|
function queuePostFlushCb(jobs, id = Infinity) {
|
|
2511
|
-
if (!isArray(jobs))
|
|
2512
|
-
|
|
2513
|
-
|
|
2569
|
+
if (!isArray(jobs)) {
|
|
2570
|
+
if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
|
|
2571
|
+
else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
|
|
2572
|
+
} else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
|
|
2514
2573
|
queueFlush();
|
|
2515
2574
|
}
|
|
2516
2575
|
function flushPreFlushCbs(instance, seen) {
|
|
@@ -2524,32 +2583,39 @@ function flushPreFlushCbs(instance, seen) {
|
|
|
2524
2583
|
i--;
|
|
2525
2584
|
jobsLength--;
|
|
2526
2585
|
if (cb.flags & 2) cb.flags &= -2;
|
|
2527
|
-
|
|
2528
|
-
|
|
2586
|
+
try {
|
|
2587
|
+
cb();
|
|
2588
|
+
} finally {
|
|
2589
|
+
if (!(cb.flags & 2)) cb.flags &= -2;
|
|
2590
|
+
}
|
|
2529
2591
|
}
|
|
2530
2592
|
}
|
|
2531
2593
|
function flushPostFlushCbs(seen) {
|
|
2532
2594
|
if (postJobs.length) {
|
|
2533
2595
|
if (activePostJobs) {
|
|
2534
|
-
activePostJobs.push(
|
|
2596
|
+
for (let i = 0; i < postJobs.length; i++) activePostJobs.push(postJobs[i]);
|
|
2535
2597
|
postJobs.length = 0;
|
|
2536
2598
|
return;
|
|
2537
2599
|
}
|
|
2538
2600
|
activePostJobs = postJobs;
|
|
2539
2601
|
postJobs = [];
|
|
2540
2602
|
seen = seen || /* @__PURE__ */ new Map();
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
cb
|
|
2547
|
-
|
|
2548
|
-
|
|
2603
|
+
try {
|
|
2604
|
+
while (postFlushIndex < activePostJobs.length) {
|
|
2605
|
+
const cb = activePostJobs[postFlushIndex++];
|
|
2606
|
+
if (checkRecursiveUpdates(seen, cb)) continue;
|
|
2607
|
+
if (cb.flags & 2) cb.flags &= -2;
|
|
2608
|
+
if (!(cb.flags & 4)) try {
|
|
2609
|
+
cb();
|
|
2610
|
+
} finally {
|
|
2611
|
+
if (!(cb.flags & 2)) cb.flags &= -2;
|
|
2612
|
+
}
|
|
2549
2613
|
}
|
|
2614
|
+
} finally {
|
|
2615
|
+
while (postFlushIndex < activePostJobs.length) activePostJobs[postFlushIndex++].flags &= -2;
|
|
2616
|
+
activePostJobs = null;
|
|
2617
|
+
postFlushIndex = 0;
|
|
2550
2618
|
}
|
|
2551
|
-
activePostJobs = null;
|
|
2552
|
-
postFlushIndex = 0;
|
|
2553
2619
|
}
|
|
2554
2620
|
}
|
|
2555
2621
|
let isFlushing = false;
|
|
@@ -2559,9 +2625,12 @@ let isFlushing = false;
|
|
|
2559
2625
|
function flushOnAppMount(instance) {
|
|
2560
2626
|
if (!isFlushing) {
|
|
2561
2627
|
isFlushing = true;
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2628
|
+
try {
|
|
2629
|
+
flushPreFlushCbs(instance);
|
|
2630
|
+
flushPostFlushCbs();
|
|
2631
|
+
} finally {
|
|
2632
|
+
isFlushing = false;
|
|
2633
|
+
}
|
|
2565
2634
|
}
|
|
2566
2635
|
}
|
|
2567
2636
|
function flushJobs(seen) {
|
|
@@ -2591,8 +2660,8 @@ function flushJobs(seen) {
|
|
|
2591
2660
|
jobsLength = 0;
|
|
2592
2661
|
jobs.length = 0;
|
|
2593
2662
|
flushPostFlushCbs(seen);
|
|
2594
|
-
currentFlushPromise = null;
|
|
2595
2663
|
if (jobsLength || postJobs.length) flushJobs(seen);
|
|
2664
|
+
else currentFlushPromise = null;
|
|
2596
2665
|
}
|
|
2597
2666
|
}
|
|
2598
2667
|
function checkRecursiveUpdates(seen, fn) {
|
|
@@ -2623,6 +2692,19 @@ getGlobalThis().__VUE_HMR_RUNTIME__ = {
|
|
|
2623
2692
|
rerender: tryWrap(rerender),
|
|
2624
2693
|
reload: tryWrap(reload)
|
|
2625
2694
|
};
|
|
2695
|
+
function runWithHmrUpdating(fn) {
|
|
2696
|
+
isHmrUpdating = true;
|
|
2697
|
+
let done = false;
|
|
2698
|
+
try {
|
|
2699
|
+
fn();
|
|
2700
|
+
done = true;
|
|
2701
|
+
} finally {
|
|
2702
|
+
if (done) nextTick(() => {
|
|
2703
|
+
isHmrUpdating = false;
|
|
2704
|
+
});
|
|
2705
|
+
else isHmrUpdating = false;
|
|
2706
|
+
}
|
|
2707
|
+
}
|
|
2626
2708
|
const map = /* @__PURE__ */ new Map();
|
|
2627
2709
|
function registerHMR(instance) {
|
|
2628
2710
|
const id = instance.type.__hmrId;
|
|
@@ -2664,18 +2746,16 @@ function rerender(id, newRender) {
|
|
|
2664
2746
|
instance.render = newRender;
|
|
2665
2747
|
normalizeClassComponent(instance.type).render = newRender;
|
|
2666
2748
|
}
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2749
|
+
runWithHmrUpdating(() => {
|
|
2750
|
+
if (instance.vapor) {
|
|
2751
|
+
if (!instance.isUnmounted) instance.hmrRerender();
|
|
2752
|
+
} else {
|
|
2753
|
+
const i = instance;
|
|
2754
|
+
if (!(i.effect.flags & 1024)) {
|
|
2755
|
+
i.renderCache = [];
|
|
2756
|
+
i.effect.run();
|
|
2757
|
+
}
|
|
2675
2758
|
}
|
|
2676
|
-
}
|
|
2677
|
-
nextTick(() => {
|
|
2678
|
-
isHmrUpdating = false;
|
|
2679
2759
|
});
|
|
2680
2760
|
});
|
|
2681
2761
|
}
|
|
@@ -2690,17 +2770,19 @@ function reload(id, newComp) {
|
|
|
2690
2770
|
for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
|
|
2691
2771
|
const dirtyInstances = new Set(instances);
|
|
2692
2772
|
const rerenderedParents = /* @__PURE__ */ new Set();
|
|
2693
|
-
|
|
2694
|
-
const
|
|
2695
|
-
|
|
2696
|
-
if (
|
|
2697
|
-
rerenderedParents.
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2773
|
+
runWithHmrUpdating(() => {
|
|
2774
|
+
for (const instance of instances) {
|
|
2775
|
+
const parent = instance.parent;
|
|
2776
|
+
if (parent) {
|
|
2777
|
+
if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
|
|
2778
|
+
rerenderedParents.add(parent);
|
|
2779
|
+
parent.hmrRerender();
|
|
2780
|
+
}
|
|
2781
|
+
} else instance.hmrReload(newComp);
|
|
2782
|
+
}
|
|
2783
|
+
});
|
|
2702
2784
|
} else {
|
|
2703
|
-
const
|
|
2785
|
+
const parents = /* @__PURE__ */ new Set();
|
|
2704
2786
|
const dirtyInstanceSet = new Set(instances);
|
|
2705
2787
|
for (const instance of instances) {
|
|
2706
2788
|
const oldComp = normalizeClassComponent(instance.type);
|
|
@@ -2719,33 +2801,23 @@ function reload(id, newComp) {
|
|
|
2719
2801
|
instance.ceReload(newComp.styles);
|
|
2720
2802
|
dirtyInstances.delete(instance);
|
|
2721
2803
|
} else if (instance.parent) {
|
|
2722
|
-
|
|
2723
|
-
if (!hasDirtyAncestor(instance, dirtyInstanceSet)) {
|
|
2724
|
-
let updates = parentUpdates.get(parent);
|
|
2725
|
-
if (!updates) parentUpdates.set(parent, updates = []);
|
|
2726
|
-
updates.push([instance, dirtyInstances]);
|
|
2727
|
-
}
|
|
2804
|
+
if (!hasDirtyAncestor(instance, dirtyInstanceSet)) parents.add(instance.parent);
|
|
2728
2805
|
} else if (instance.appContext.reload) instance.appContext.reload();
|
|
2729
2806
|
else if (typeof window !== "undefined") window.location.reload();
|
|
2730
2807
|
else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
|
|
2731
2808
|
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
2732
2809
|
}
|
|
2733
|
-
|
|
2810
|
+
parents.forEach((parent) => {
|
|
2734
2811
|
queueJob(() => {
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2812
|
+
runWithHmrUpdating(() => {
|
|
2813
|
+
if (parent.vapor) parent.hmrRerender();
|
|
2814
|
+
else {
|
|
2815
|
+
const i = parent;
|
|
2816
|
+
if (!(i.effect.flags & 1024)) {
|
|
2817
|
+
i.renderCache = [];
|
|
2818
|
+
i.effect.run();
|
|
2819
|
+
}
|
|
2742
2820
|
}
|
|
2743
|
-
}
|
|
2744
|
-
nextTick(() => {
|
|
2745
|
-
isHmrUpdating = false;
|
|
2746
|
-
});
|
|
2747
|
-
updates.forEach(([instance, dirtyInstances]) => {
|
|
2748
|
-
dirtyInstances.delete(instance);
|
|
2749
2821
|
});
|
|
2750
2822
|
});
|
|
2751
2823
|
});
|
|
@@ -2815,20 +2887,20 @@ function devtoolsInitApp(app, version) {
|
|
|
2815
2887
|
function devtoolsUnmountApp(app) {
|
|
2816
2888
|
emit$1("app:unmount", app);
|
|
2817
2889
|
}
|
|
2818
|
-
const devtoolsComponentAdded =
|
|
2819
|
-
const devtoolsComponentUpdated =
|
|
2820
|
-
const _devtoolsComponentRemoved =
|
|
2890
|
+
const devtoolsComponentAdded = /*@__PURE__*/ createDevtoolsComponentHook("component:added");
|
|
2891
|
+
const devtoolsComponentUpdated = /*@__PURE__*/ createDevtoolsComponentHook("component:updated");
|
|
2892
|
+
const _devtoolsComponentRemoved = /*@__PURE__*/ createDevtoolsComponentHook("component:removed");
|
|
2821
2893
|
const devtoolsComponentRemoved = (component) => {
|
|
2822
2894
|
if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && !devtools$1.cleanupBuffer(component)) _devtoolsComponentRemoved(component);
|
|
2823
2895
|
};
|
|
2824
|
-
|
|
2896
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
2825
2897
|
function createDevtoolsComponentHook(hook) {
|
|
2826
2898
|
return (component) => {
|
|
2827
2899
|
emit$1(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : void 0, component);
|
|
2828
2900
|
};
|
|
2829
2901
|
}
|
|
2830
|
-
const devtoolsPerfStart =
|
|
2831
|
-
const devtoolsPerfEnd =
|
|
2902
|
+
const devtoolsPerfStart = /*@__PURE__*/ createDevtoolsPerformanceHook("perf:start");
|
|
2903
|
+
const devtoolsPerfEnd = /*@__PURE__*/ createDevtoolsPerformanceHook("perf:end");
|
|
2832
2904
|
function createDevtoolsPerformanceHook(hook) {
|
|
2833
2905
|
return (component, type, time) => {
|
|
2834
2906
|
emit$1(hook, component.appContext.app, component.uid, component, type, time);
|
|
@@ -3071,7 +3143,7 @@ function instanceWatch(source, value, options) {
|
|
|
3071
3143
|
}
|
|
3072
3144
|
const prev = setCurrentInstance(this);
|
|
3073
3145
|
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
3074
|
-
|
|
3146
|
+
restoreCurrentInstance(prev);
|
|
3075
3147
|
return res;
|
|
3076
3148
|
}
|
|
3077
3149
|
function createPathGetter(ctx, path) {
|
|
@@ -3093,15 +3165,16 @@ const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target inst
|
|
|
3093
3165
|
const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
|
|
3094
3166
|
const resolveTarget = (props, select) => {
|
|
3095
3167
|
const targetSelector = props && props.to;
|
|
3096
|
-
if (isString(targetSelector))
|
|
3097
|
-
|
|
3098
|
-
|
|
3168
|
+
if (isString(targetSelector)) {
|
|
3169
|
+
if (!select) {
|
|
3170
|
+
warn$1("Current renderer does not support string target for Teleports. (missing querySelector renderer option)");
|
|
3171
|
+
return null;
|
|
3172
|
+
} else {
|
|
3173
|
+
const target = select(targetSelector);
|
|
3174
|
+
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.`);
|
|
3175
|
+
return target;
|
|
3176
|
+
}
|
|
3099
3177
|
} else {
|
|
3100
|
-
const target = select(targetSelector);
|
|
3101
|
-
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.`);
|
|
3102
|
-
return target;
|
|
3103
|
-
}
|
|
3104
|
-
else {
|
|
3105
3178
|
if (!targetSelector && !isTeleportDisabled(props)) warn$1(`Invalid Teleport target: ${targetSelector}`);
|
|
3106
3179
|
return targetSelector;
|
|
3107
3180
|
}
|
|
@@ -3139,7 +3212,8 @@ const TeleportImpl = {
|
|
|
3139
3212
|
if (pendingMounts.get(vnode) !== mountJob) return;
|
|
3140
3213
|
pendingMounts.delete(vnode);
|
|
3141
3214
|
if (isTeleportDisabled(vnode.props)) {
|
|
3142
|
-
|
|
3215
|
+
const mountContainer = parentNode(vnode.el) || container;
|
|
3216
|
+
mount(vnode, mountContainer, vnode.anchor);
|
|
3143
3217
|
updateCssVars(vnode, true);
|
|
3144
3218
|
}
|
|
3145
3219
|
mountToTarget(vnode);
|
|
@@ -3248,15 +3322,17 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
3248
3322
|
const disabled = isTeleportDisabled(vnode.props);
|
|
3249
3323
|
if (target) {
|
|
3250
3324
|
const targetNode = target._lpa || target.firstChild;
|
|
3251
|
-
if (vnode.shapeFlag & 16)
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3325
|
+
if (vnode.shapeFlag & 16) {
|
|
3326
|
+
if (disabled) {
|
|
3327
|
+
hydrateDisabledTeleport(node, vnode);
|
|
3328
|
+
hydrateAnchor(target, targetNode);
|
|
3329
|
+
if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert, parentNode(node) === target ? node : null);
|
|
3330
|
+
} else {
|
|
3331
|
+
vnode.anchor = nextSibling(node);
|
|
3332
|
+
hydrateAnchor(target, targetNode);
|
|
3333
|
+
if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert);
|
|
3334
|
+
hydrateChildren(targetNode && nextSibling(targetNode), vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
3335
|
+
}
|
|
3260
3336
|
}
|
|
3261
3337
|
updateCssVars(vnode, disabled);
|
|
3262
3338
|
} else if (disabled) {
|
|
@@ -3334,59 +3410,27 @@ const BaseTransitionPropsValidators = {
|
|
|
3334
3410
|
onAfterAppear: TransitionHookValidator,
|
|
3335
3411
|
onAppearCancelled: TransitionHookValidator
|
|
3336
3412
|
};
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3413
|
+
function isEmptyTransitionChild(vnode, instance) {
|
|
3414
|
+
if (vnode.type === Comment) return true;
|
|
3415
|
+
if (vnode.type === VaporSlot || isVaporComponent(vnode.type)) return !getVaporInterface(instance, vnode).hasTransitionChild(vnode);
|
|
3416
|
+
return !!vnode.component && isEmptyTransitionChild(vnode.component.subTree, instance);
|
|
3417
|
+
}
|
|
3341
3418
|
const BaseTransitionImpl = {
|
|
3342
3419
|
name: `BaseTransition`,
|
|
3343
3420
|
props: BaseTransitionPropsValidators,
|
|
3344
3421
|
setup(props, { slots }) {
|
|
3345
3422
|
const instance = getCurrentInstance();
|
|
3346
3423
|
const state = useTransitionState();
|
|
3424
|
+
let resumeAfterLeave;
|
|
3347
3425
|
return () => {
|
|
3348
|
-
const
|
|
3349
|
-
const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
|
|
3426
|
+
const child = resolveTransitionChild(slots.default && slots.default(), !!instance.subTree);
|
|
3350
3427
|
if (!child) return;
|
|
3351
3428
|
const rawProps = /* @__PURE__ */ toRaw(props);
|
|
3352
3429
|
const { mode } = rawProps;
|
|
3353
3430
|
checkTransitionMode(mode);
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
let enterHooks = resolveTransitionHooks(innerChild, rawProps, state, instance, (hooks) => enterHooks = hooks);
|
|
3358
|
-
if (innerChild.type !== Comment) setTransitionHooks(innerChild, enterHooks);
|
|
3359
|
-
let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
|
|
3360
|
-
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
|
|
3361
|
-
let leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance);
|
|
3362
|
-
setTransitionHooks(oldInnerChild, leavingHooks);
|
|
3363
|
-
if (mode === "out-in" && innerChild.type !== Comment) {
|
|
3364
|
-
state.isLeaving = true;
|
|
3365
|
-
leavingHooks.afterLeave = () => {
|
|
3366
|
-
state.isLeaving = false;
|
|
3367
|
-
if (!(instance.job.flags & 4)) instance.update();
|
|
3368
|
-
delete leavingHooks.afterLeave;
|
|
3369
|
-
oldInnerChild = void 0;
|
|
3370
|
-
};
|
|
3371
|
-
return emptyPlaceholder(child);
|
|
3372
|
-
} else if (mode === "in-out" && innerChild.type !== Comment) leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
3373
|
-
const leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild);
|
|
3374
|
-
leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
|
|
3375
|
-
el[leaveCbKey] = () => {
|
|
3376
|
-
earlyRemove();
|
|
3377
|
-
el[leaveCbKey] = void 0;
|
|
3378
|
-
delete enterHooks.delayedLeave;
|
|
3379
|
-
oldInnerChild = void 0;
|
|
3380
|
-
};
|
|
3381
|
-
enterHooks.delayedLeave = () => {
|
|
3382
|
-
delayedLeave();
|
|
3383
|
-
delete enterHooks.delayedLeave;
|
|
3384
|
-
oldInnerChild = void 0;
|
|
3385
|
-
};
|
|
3386
|
-
};
|
|
3387
|
-
else oldInnerChild = void 0;
|
|
3388
|
-
} else if (oldInnerChild) oldInnerChild = void 0;
|
|
3389
|
-
return child;
|
|
3431
|
+
return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
|
|
3432
|
+
if (!(instance.job.flags & 4)) instance.update();
|
|
3433
|
+
}) : NOOP);
|
|
3390
3434
|
};
|
|
3391
3435
|
}
|
|
3392
3436
|
};
|
|
@@ -3418,7 +3462,7 @@ function getLeavingNodesForType(state, vnode) {
|
|
|
3418
3462
|
function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
3419
3463
|
const key = String(vnode.key);
|
|
3420
3464
|
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
3421
|
-
|
|
3465
|
+
const hooks = baseResolveTransitionHooks({
|
|
3422
3466
|
isLeaving: () => leavingVNodesCache[key] === vnode,
|
|
3423
3467
|
setLeavingNodeCache: () => {
|
|
3424
3468
|
leavingVNodesCache[key] = vnode;
|
|
@@ -3436,6 +3480,13 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
3436
3480
|
return hooks;
|
|
3437
3481
|
}
|
|
3438
3482
|
}, props, state, instance);
|
|
3483
|
+
if (vnode.type === VaporSlot) extend(hooks, {
|
|
3484
|
+
__vapor: true,
|
|
3485
|
+
props,
|
|
3486
|
+
state,
|
|
3487
|
+
instance
|
|
3488
|
+
});
|
|
3489
|
+
return hooks;
|
|
3439
3490
|
}
|
|
3440
3491
|
function baseResolveTransitionHooks(context, props, state, instance) {
|
|
3441
3492
|
const { isLeaving, setLeavingNodeCache, unsetLeavingNodeCache, earlyRemove, cloneHooks } = context;
|
|
@@ -3455,8 +3506,10 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
3455
3506
|
persisted,
|
|
3456
3507
|
beforeEnter(el) {
|
|
3457
3508
|
let hook = onBeforeEnter;
|
|
3458
|
-
if (!state.isMounted)
|
|
3459
|
-
|
|
3509
|
+
if (!state.isMounted) {
|
|
3510
|
+
if (appear) hook = onBeforeAppear || onBeforeEnter;
|
|
3511
|
+
else return;
|
|
3512
|
+
}
|
|
3460
3513
|
if (el[leaveCbKey]) el[leaveCbKey](true);
|
|
3461
3514
|
earlyRemove();
|
|
3462
3515
|
callHook(hook, [el]);
|
|
@@ -3466,11 +3519,13 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
3466
3519
|
let hook = onEnter;
|
|
3467
3520
|
let afterHook = onAfterEnter;
|
|
3468
3521
|
let cancelHook = onEnterCancelled;
|
|
3469
|
-
if (!state.isMounted)
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3522
|
+
if (!state.isMounted) {
|
|
3523
|
+
if (appear) {
|
|
3524
|
+
hook = onAppear || onEnter;
|
|
3525
|
+
afterHook = onAfterAppear || onAfterEnter;
|
|
3526
|
+
cancelHook = onAppearCancelled || onEnterCancelled;
|
|
3527
|
+
} else return;
|
|
3528
|
+
}
|
|
3474
3529
|
let called = false;
|
|
3475
3530
|
el[enterCbKey$1] = (cancelled) => {
|
|
3476
3531
|
if (called) return;
|
|
@@ -3504,7 +3559,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
3504
3559
|
else done();
|
|
3505
3560
|
},
|
|
3506
3561
|
clone(node) {
|
|
3507
|
-
return cloneHooks(node);
|
|
3562
|
+
return cloneHooks ? cloneHooks(node) : hooks;
|
|
3508
3563
|
}
|
|
3509
3564
|
};
|
|
3510
3565
|
return hooks;
|
|
@@ -3528,16 +3583,91 @@ function getInnerChild$1(vnode) {
|
|
|
3528
3583
|
if (shapeFlag & 32 && isFunction(children.default)) return children.default();
|
|
3529
3584
|
}
|
|
3530
3585
|
}
|
|
3586
|
+
function resolveTransitionChild(children, renderEmpty = false) {
|
|
3587
|
+
const branches = children && getTransitionRawChildren(children, true);
|
|
3588
|
+
return branches && branches.length ? findNonCommentChild(branches) : renderEmpty ? createCommentVNode() : void 0;
|
|
3589
|
+
}
|
|
3590
|
+
/**
|
|
3591
|
+
* @internal
|
|
3592
|
+
*/
|
|
3593
|
+
function prepareTransitionSwitch(previous, next, props, state, instance, resumeAfterLeave, delayedLeaveSource) {
|
|
3594
|
+
if (state.isLeaving) return emptyPlaceholder(next);
|
|
3595
|
+
const nextInner = getInnerChild$1(next);
|
|
3596
|
+
if (!nextInner) return emptyPlaceholder(next);
|
|
3597
|
+
let enterHooks = resolveTransitionHooks(nextInner, props, state, instance, (hooks) => {
|
|
3598
|
+
if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
|
|
3599
|
+
enterHooks = hooks;
|
|
3600
|
+
});
|
|
3601
|
+
if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
|
|
3602
|
+
if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
|
|
3603
|
+
const mode = props.mode;
|
|
3604
|
+
const previousInner = previous && getInnerChild$1(previous);
|
|
3605
|
+
if (previous && previousInner && !isSameVNodeType(previousInner, nextInner) && !isEmptyTransitionChild(previousInner, instance)) {
|
|
3606
|
+
const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
|
|
3607
|
+
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);
|
|
3608
|
+
}
|
|
3609
|
+
return next;
|
|
3610
|
+
}
|
|
3611
|
+
function forwardDelayedLeave(hooks, source) {
|
|
3612
|
+
const delayedLeave = source && source.delayedLeave;
|
|
3613
|
+
if (!delayedLeave) return;
|
|
3614
|
+
hooks.delayedLeave = () => {
|
|
3615
|
+
if (source.delayedLeave === delayedLeave) delayedLeave();
|
|
3616
|
+
delete hooks.delayedLeave;
|
|
3617
|
+
};
|
|
3618
|
+
}
|
|
3619
|
+
function prepareLeavingTransitionHooks(previousInner, props, state, instance) {
|
|
3620
|
+
return setTransitionHooks(previousInner, resolveTransitionHooks(previousInner, props, state, instance));
|
|
3621
|
+
}
|
|
3622
|
+
function applyTransitionModeSwitch(leavingVNode, leavingHooks, getEnterHooks, props, state, resumeAfterLeave) {
|
|
3623
|
+
if (props.mode === "out-in") {
|
|
3624
|
+
state.isLeaving = true;
|
|
3625
|
+
leavingHooks.afterLeave = () => {
|
|
3626
|
+
state.isLeaving = false;
|
|
3627
|
+
resumeAfterLeave();
|
|
3628
|
+
delete leavingHooks.afterLeave;
|
|
3629
|
+
};
|
|
3630
|
+
return true;
|
|
3631
|
+
} else if (props.mode === "in-out" && getEnterHooks) {
|
|
3632
|
+
let delayedLeavingVNode = leavingVNode;
|
|
3633
|
+
leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
3634
|
+
const enterHooks = getEnterHooks();
|
|
3635
|
+
if (!enterHooks) {
|
|
3636
|
+
delayedLeave();
|
|
3637
|
+
return;
|
|
3638
|
+
}
|
|
3639
|
+
const vnode = delayedLeavingVNode;
|
|
3640
|
+
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
3641
|
+
leavingVNodesCache[String(vnode.key)] = vnode;
|
|
3642
|
+
el[leaveCbKey] = () => {
|
|
3643
|
+
earlyRemove();
|
|
3644
|
+
el[leaveCbKey] = void 0;
|
|
3645
|
+
delete enterHooks.delayedLeave;
|
|
3646
|
+
delayedLeavingVNode = void 0;
|
|
3647
|
+
};
|
|
3648
|
+
enterHooks.delayedLeave = () => {
|
|
3649
|
+
delayedLeave();
|
|
3650
|
+
delete enterHooks.delayedLeave;
|
|
3651
|
+
delayedLeavingVNode = void 0;
|
|
3652
|
+
};
|
|
3653
|
+
};
|
|
3654
|
+
}
|
|
3655
|
+
return false;
|
|
3656
|
+
}
|
|
3531
3657
|
function setTransitionHooks(vnode, hooks) {
|
|
3532
|
-
if (vnode.shapeFlag & 6 && vnode.component)
|
|
3533
|
-
else {
|
|
3658
|
+
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
3534
3659
|
vnode.transition = hooks;
|
|
3535
|
-
setTransitionHooks(vnode.component
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3660
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
|
|
3661
|
+
else {
|
|
3662
|
+
const subTree = vnode.component.subTree;
|
|
3663
|
+
return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
|
|
3664
|
+
}
|
|
3665
|
+
} else if (vnode.shapeFlag & 128) {
|
|
3666
|
+
const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
3667
|
+
const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
3668
|
+
return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
|
|
3540
3669
|
} else vnode.transition = hooks;
|
|
3670
|
+
return hooks;
|
|
3541
3671
|
}
|
|
3542
3672
|
function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
3543
3673
|
let ret = [];
|
|
@@ -3561,9 +3691,9 @@ function checkTransitionMode(mode) {
|
|
|
3561
3691
|
}
|
|
3562
3692
|
//#endregion
|
|
3563
3693
|
//#region packages/runtime-core/src/apiDefineComponent.ts
|
|
3564
|
-
|
|
3694
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
3565
3695
|
function defineComponent(options, extraOptions) {
|
|
3566
|
-
return isFunction(options) ? extend({ name: options.name }, extraOptions, { setup: options }) : options;
|
|
3696
|
+
return isFunction(options) ? /*@__PURE__*/ (() => extend({ name: options.name }, extraOptions, { setup: options }))() : options;
|
|
3567
3697
|
}
|
|
3568
3698
|
//#endregion
|
|
3569
3699
|
//#region packages/runtime-core/src/helpers/useId.ts
|
|
@@ -3660,15 +3790,16 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
3660
3790
|
if (rawRef.f) {
|
|
3661
3791
|
const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
|
|
3662
3792
|
if (isUnmount) isArray(existing) && remove(existing, refValue);
|
|
3663
|
-
else if (!isArray(existing))
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3793
|
+
else if (!isArray(existing)) {
|
|
3794
|
+
if (_isString) {
|
|
3795
|
+
refs[ref] = [refValue];
|
|
3796
|
+
if (canSetSetupRef(ref)) setupState[ref] = refs[ref];
|
|
3797
|
+
} else {
|
|
3798
|
+
const newVal = [refValue];
|
|
3799
|
+
if (canSetRef(ref, rawRef.k)) ref.value = newVal;
|
|
3800
|
+
if (rawRef.k) refs[rawRef.k] = newVal;
|
|
3801
|
+
}
|
|
3802
|
+
} else if (!existing.includes(refValue)) existing.push(refValue);
|
|
3672
3803
|
} else if (_isString) {
|
|
3673
3804
|
refs[ref] = value;
|
|
3674
3805
|
if (canSetSetupRef(ref)) setupState[ref] = value;
|
|
@@ -3720,7 +3851,18 @@ const logMismatchError = () => {
|
|
|
3720
3851
|
hasLoggedMismatchError = true;
|
|
3721
3852
|
};
|
|
3722
3853
|
const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
|
|
3723
|
-
const isMathMLContainer = (container) =>
|
|
3854
|
+
const isMathMLContainer = (container) => {
|
|
3855
|
+
if (!container.namespaceURI.includes("MathML")) return false;
|
|
3856
|
+
if (container.tagName !== "annotation-xml") return true;
|
|
3857
|
+
const encoding = container.getAttribute("encoding");
|
|
3858
|
+
return !encoding || !encoding.includes("html");
|
|
3859
|
+
};
|
|
3860
|
+
/**
|
|
3861
|
+
* Resolve the element namespace a container's children should be created in.
|
|
3862
|
+
* The live DOM is the source of truth, so this also covers containers that are
|
|
3863
|
+
* only known at runtime (interop boundaries, teleport targets).
|
|
3864
|
+
* @internal
|
|
3865
|
+
*/
|
|
3724
3866
|
const getContainerType = (container) => {
|
|
3725
3867
|
if (container.nodeType !== 1) return void 0;
|
|
3726
3868
|
if (isSVGContainer(container)) return "svg";
|
|
@@ -3744,7 +3886,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3744
3886
|
};
|
|
3745
3887
|
const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
|
|
3746
3888
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
3747
|
-
const isFragmentStart = isComment(node) && node.data === "[";
|
|
3889
|
+
const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(");
|
|
3748
3890
|
const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);
|
|
3749
3891
|
const { type, ref, shapeFlag, patchFlag } = vnode;
|
|
3750
3892
|
let domType = node.nodeType;
|
|
@@ -3758,11 +3900,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3758
3900
|
let nextNode = null;
|
|
3759
3901
|
switch (type) {
|
|
3760
3902
|
case Text:
|
|
3761
|
-
if (domType !== 3)
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3903
|
+
if (domType !== 3) {
|
|
3904
|
+
if (vnode.children === "") {
|
|
3905
|
+
insert(vnode.el = createText(""), parentNode(node), node);
|
|
3906
|
+
nextNode = node;
|
|
3907
|
+
} else nextNode = onMismatch();
|
|
3908
|
+
} else {
|
|
3766
3909
|
if (node.data !== vnode.children) {
|
|
3767
3910
|
warn$1(`Hydration text mismatch in`, node.parentNode, `\n - rendered on server: ${JSON.stringify(node.data)}\n - expected on client: ${JSON.stringify(vnode.children)}`);
|
|
3768
3911
|
logMismatchError();
|
|
@@ -3799,45 +3942,35 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3799
3942
|
else nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
3800
3943
|
break;
|
|
3801
3944
|
case VaporSlot:
|
|
3802
|
-
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense);
|
|
3945
|
+
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense, slotScopeIds);
|
|
3803
3946
|
break;
|
|
3804
|
-
default: if (shapeFlag & 1)
|
|
3805
|
-
|
|
3806
|
-
|
|
3947
|
+
default: if (shapeFlag & 1) {
|
|
3948
|
+
if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) nextNode = onMismatch();
|
|
3949
|
+
else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
3950
|
+
} else if (shapeFlag & 6) {
|
|
3807
3951
|
vnode.slotScopeIds = slotScopeIds;
|
|
3808
3952
|
const container = parentNode(node);
|
|
3809
3953
|
if (isFragmentStart) nextNode = locateClosingAnchor(node);
|
|
3810
3954
|
else if (isComment(node) && node.data === "teleport start") nextNode = locateClosingAnchor(node, node.data, "teleport end");
|
|
3811
3955
|
else nextNode = nextSibling(node);
|
|
3812
|
-
if (vnode.type.__vapor)
|
|
3813
|
-
|
|
3814
|
-
getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense, () => {
|
|
3815
|
-
if (vnode.dirs) {
|
|
3816
|
-
invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
3817
|
-
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
3818
|
-
}
|
|
3819
|
-
}, () => {
|
|
3820
|
-
if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, vnode);
|
|
3821
|
-
});
|
|
3822
|
-
if (vnode.dirs) queueEffectWithSuspense(() => invokeDirectiveHook(vnode, null, parentComponent, "mounted"), void 0, parentSuspense);
|
|
3823
|
-
const vnodeMountedHook = !isAsyncWrapper(vnode) && vnode.props && vnode.props.onVnodeMounted;
|
|
3824
|
-
if (vnodeMountedHook) queueEffectWithSuspense(() => invokeVNodeHook(vnodeMountedHook, parentComponent, vnode), void 0, parentSuspense);
|
|
3825
|
-
} else {
|
|
3956
|
+
if (vnode.type.__vapor) getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense);
|
|
3957
|
+
else {
|
|
3826
3958
|
mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
|
|
3827
3959
|
const component = vnode.component;
|
|
3828
|
-
if (isAsyncWrapper(vnode)
|
|
3960
|
+
if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep)) {
|
|
3829
3961
|
let subTree;
|
|
3830
3962
|
if (isFragmentStart) {
|
|
3831
|
-
subTree = createVNode(
|
|
3963
|
+
subTree = createVNode(Static);
|
|
3832
3964
|
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
3833
|
-
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
3965
|
+
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode(node.nodeType === 8 ? Comment : "div");
|
|
3834
3966
|
subTree.el = node;
|
|
3835
3967
|
component.subTree = subTree;
|
|
3836
3968
|
}
|
|
3837
3969
|
}
|
|
3838
|
-
} else if (shapeFlag & 64)
|
|
3839
|
-
|
|
3840
|
-
|
|
3970
|
+
} else if (shapeFlag & 64) {
|
|
3971
|
+
if (domType !== 8) nextNode = onMismatch();
|
|
3972
|
+
else nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
|
|
3973
|
+
} else if (shapeFlag & 128) nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, getContainerType(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);
|
|
3841
3974
|
else warn$1("Invalid HostVNode type:", type, `(${typeof type})`);
|
|
3842
3975
|
}
|
|
3843
3976
|
if (ref != null) setRef(ref, null, parentSuspense, vnode);
|
|
@@ -3889,7 +4022,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3889
4022
|
const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
|
|
3890
4023
|
for (const key in props) {
|
|
3891
4024
|
if (!(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) logMismatchError();
|
|
3892
|
-
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key))
|
|
4025
|
+
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
|
|
4026
|
+
if (isUnchangedResourceProp(el, key, props[key])) continue;
|
|
4027
|
+
patchProp(el, key, null, props[key], namespace, parentComponent);
|
|
4028
|
+
}
|
|
3893
4029
|
}
|
|
3894
4030
|
}
|
|
3895
4031
|
let vnodeHooks;
|
|
@@ -3937,8 +4073,9 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3937
4073
|
const { slotScopeIds: fragmentSlotScopeIds } = vnode;
|
|
3938
4074
|
if (fragmentSlotScopeIds) slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
|
|
3939
4075
|
const container = parentNode(node);
|
|
3940
|
-
const
|
|
3941
|
-
|
|
4076
|
+
const first = nextSibling(node);
|
|
4077
|
+
const next = vnode.vo && node.data === "(" ? getVaporInterface(parentComponent, vnode).hydrateSlotOutlet(vnode, node, parentComponent, parentSuspense, slotScopeIds) : hydrateChildren(first, vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
4078
|
+
if (next && isComment(next) && next.data === (node.data === "(" ? ")" : "]")) return nextSibling(vnode.anchor = next);
|
|
3942
4079
|
else {
|
|
3943
4080
|
logMismatchError();
|
|
3944
4081
|
insert(vnode.anchor = createComment(`]`), container, next);
|
|
@@ -3947,7 +4084,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3947
4084
|
};
|
|
3948
4085
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
3949
4086
|
if (!isNodeMismatchAllowed(node, vnode)) {
|
|
3950
|
-
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);
|
|
4087
|
+
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);
|
|
3951
4088
|
logMismatchError();
|
|
3952
4089
|
}
|
|
3953
4090
|
vnode.el = null;
|
|
@@ -3963,20 +4100,22 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3963
4100
|
const container = parentNode(node);
|
|
3964
4101
|
remove(node);
|
|
3965
4102
|
patch(null, vnode, container, next, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
|
|
3966
|
-
if (parentComponent) {
|
|
4103
|
+
if (parentComponent && parentComponent.vnode) {
|
|
3967
4104
|
parentComponent.vnode.el = vnode.el;
|
|
3968
4105
|
updateHOCHostEl(parentComponent, vnode.el);
|
|
3969
4106
|
}
|
|
3970
4107
|
return next;
|
|
3971
4108
|
};
|
|
3972
|
-
const locateClosingAnchor = (node, open = "[", close = "]") => {
|
|
4109
|
+
const locateClosingAnchor = (node, open = node && isComment(node) && node.data === "(" ? "(" : "[", close = open === "(" ? ")" : "]") => {
|
|
3973
4110
|
let match = 0;
|
|
3974
4111
|
while (node) {
|
|
3975
4112
|
node = nextSibling(node);
|
|
3976
4113
|
if (node && isComment(node)) {
|
|
3977
4114
|
if (node.data === open) match++;
|
|
3978
|
-
if (node.data === close)
|
|
3979
|
-
|
|
4115
|
+
if (node.data === close) {
|
|
4116
|
+
if (match === 0) return nextSibling(node);
|
|
4117
|
+
else match--;
|
|
4118
|
+
}
|
|
3980
4119
|
}
|
|
3981
4120
|
}
|
|
3982
4121
|
return node;
|
|
@@ -3986,7 +4125,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3986
4125
|
if (parentNode) parentNode.replaceChild(newNode, oldNode);
|
|
3987
4126
|
let parent = parentComponent;
|
|
3988
4127
|
while (parent) {
|
|
3989
|
-
if (parent.vnode.el === oldNode) parent.vnode.el = parent.subTree.el = newNode;
|
|
4128
|
+
if (parent.vnode && parent.vnode.el === oldNode) parent.vnode.el = parent.subTree.el = newNode;
|
|
3990
4129
|
parent = parent.parent;
|
|
3991
4130
|
}
|
|
3992
4131
|
};
|
|
@@ -3995,6 +4134,16 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3995
4134
|
const isTemplateNode = (node) => {
|
|
3996
4135
|
return node.nodeType === 1 && node.tagName === "TEMPLATE";
|
|
3997
4136
|
};
|
|
4137
|
+
const resourceProps = /*@__PURE__*/ new Set([
|
|
4138
|
+
"src",
|
|
4139
|
+
"srcset",
|
|
4140
|
+
"href",
|
|
4141
|
+
"poster"
|
|
4142
|
+
]);
|
|
4143
|
+
function isUnchangedResourceProp(el, key, clientValue) {
|
|
4144
|
+
if (!resourceProps.has(key)) return false;
|
|
4145
|
+
return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
|
|
4146
|
+
}
|
|
3998
4147
|
/**
|
|
3999
4148
|
* Dev only
|
|
4000
4149
|
*/
|
|
@@ -4038,7 +4187,10 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
|
|
|
4038
4187
|
function getAttributeMismatch(el, key, clientValue) {
|
|
4039
4188
|
let actual;
|
|
4040
4189
|
let expected;
|
|
4041
|
-
if (
|
|
4190
|
+
if (key === "hidden") {
|
|
4191
|
+
actual = normalizeHiddenValue(el.getAttribute(key));
|
|
4192
|
+
expected = normalizeHiddenValue(clientValue);
|
|
4193
|
+
} else if (isBooleanAttr(key)) {
|
|
4042
4194
|
actual = el.hasAttribute(key);
|
|
4043
4195
|
expected = includeBooleanAttr(clientValue);
|
|
4044
4196
|
} else if (clientValue == null) {
|
|
@@ -4066,6 +4218,11 @@ function warnPropMismatch(el, mismatchKey, mismatchType, actual, expected) {
|
|
|
4066
4218
|
}
|
|
4067
4219
|
return false;
|
|
4068
4220
|
}
|
|
4221
|
+
function normalizeHiddenValue(value) {
|
|
4222
|
+
if (!isRenderableAttrValue(value)) return false;
|
|
4223
|
+
if (isString(value)) return value.toLowerCase() === "until-found" ? "until-found" : "";
|
|
4224
|
+
return includeBooleanAttr(value) ? "" : false;
|
|
4225
|
+
}
|
|
4069
4226
|
function toClassSet(str) {
|
|
4070
4227
|
return new Set(str.trim().split(/\s+/));
|
|
4071
4228
|
}
|
|
@@ -4204,16 +4361,18 @@ const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
|
|
|
4204
4361
|
return teardown;
|
|
4205
4362
|
};
|
|
4206
4363
|
function forEachElement(node, cb) {
|
|
4207
|
-
if (isComment(node) && node.data === "[") {
|
|
4364
|
+
if (isComment(node) && (node.data === "[" || node.data === "(")) {
|
|
4365
|
+
const open = node.data;
|
|
4366
|
+
const close = open === "[" ? "]" : ")";
|
|
4208
4367
|
let depth = 1;
|
|
4209
4368
|
let next = node.nextSibling;
|
|
4210
4369
|
while (next) {
|
|
4211
4370
|
if (next.nodeType === 1) {
|
|
4212
4371
|
if (cb(next) === false) break;
|
|
4213
4372
|
} else if (isComment(next)) {
|
|
4214
|
-
if (next.data ===
|
|
4373
|
+
if (next.data === close) {
|
|
4215
4374
|
if (--depth === 0) break;
|
|
4216
|
-
} else if (next.data ===
|
|
4375
|
+
} else if (next.data === open) depth++;
|
|
4217
4376
|
}
|
|
4218
4377
|
next = next.nextSibling;
|
|
4219
4378
|
}
|
|
@@ -4222,14 +4381,14 @@ function forEachElement(node, cb) {
|
|
|
4222
4381
|
//#endregion
|
|
4223
4382
|
//#region packages/runtime-core/src/apiAsyncComponent.ts
|
|
4224
4383
|
const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
|
|
4225
|
-
|
|
4384
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
4226
4385
|
function defineAsyncComponent(source) {
|
|
4227
4386
|
const { load, getResolvedComp, setPendingRequest, source: { loadingComponent, errorComponent, delay, hydrate: hydrateStrategy, timeout, suspensible = true } } = createAsyncComponentContext(source);
|
|
4228
4387
|
return /* @__PURE__ */ defineComponent({
|
|
4229
4388
|
name: "AsyncComponentWrapper",
|
|
4230
4389
|
__asyncLoader: load,
|
|
4231
4390
|
__asyncHydrate(el, instance, hydrate) {
|
|
4232
|
-
performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy);
|
|
4391
|
+
performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy, true);
|
|
4233
4392
|
},
|
|
4234
4393
|
get __asyncResolved() {
|
|
4235
4394
|
return getResolvedComp();
|
|
@@ -4348,10 +4507,10 @@ const useAsyncComponentState = (delay, timeout, onError, instance = currentInsta
|
|
|
4348
4507
|
* shared between core and vapor
|
|
4349
4508
|
* @internal
|
|
4350
4509
|
*/
|
|
4351
|
-
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
|
|
4510
|
+
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy, skipIfUpdated) {
|
|
4352
4511
|
const wasConnected = el.isConnected;
|
|
4353
4512
|
let patched = false;
|
|
4354
|
-
(instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
4513
|
+
if (skipIfUpdated) (instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
4355
4514
|
const performHydrate = () => {
|
|
4356
4515
|
if (patched) {
|
|
4357
4516
|
{
|
|
@@ -4437,10 +4596,13 @@ const KeepAlive = {
|
|
|
4437
4596
|
});
|
|
4438
4597
|
let pendingCacheKey = null;
|
|
4439
4598
|
const cacheSubtree = () => {
|
|
4440
|
-
if (pendingCacheKey != null)
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4599
|
+
if (pendingCacheKey != null) {
|
|
4600
|
+
if (isSuspense(keepAliveInstance.subTree.type)) queuePostRenderEffect(() => {
|
|
4601
|
+
const vnode = getInnerChild(keepAliveInstance.subTree);
|
|
4602
|
+
if (vnode.component) cache.set(pendingCacheKey, vnode);
|
|
4603
|
+
}, void 0, keepAliveInstance.subTree.suspense);
|
|
4604
|
+
else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
|
|
4605
|
+
}
|
|
4444
4606
|
};
|
|
4445
4607
|
onMounted(cacheSubtree);
|
|
4446
4608
|
onUpdated(cacheSubtree);
|
|
@@ -4597,7 +4759,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
4597
4759
|
try {
|
|
4598
4760
|
return callWithAsyncErrorHandling(hook, target, type, args);
|
|
4599
4761
|
} finally {
|
|
4600
|
-
|
|
4762
|
+
restoreCurrentInstance(prev);
|
|
4601
4763
|
setActiveSub(prevSub);
|
|
4602
4764
|
}
|
|
4603
4765
|
});
|
|
@@ -4682,23 +4844,25 @@ function renderList(source, renderItem, cache, index) {
|
|
|
4682
4844
|
}
|
|
4683
4845
|
ret = new Array(source.length);
|
|
4684
4846
|
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]);
|
|
4685
|
-
} else if (typeof source === "number")
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
else if (isObject(source)) if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
|
|
4693
|
-
else {
|
|
4694
|
-
const keys = Object.keys(source);
|
|
4695
|
-
ret = new Array(keys.length);
|
|
4696
|
-
for (let i = 0, l = keys.length; i < l; i++) {
|
|
4697
|
-
const key = keys[i];
|
|
4698
|
-
ret[i] = renderItem(source[key], key, i, cached && cached[i]);
|
|
4847
|
+
} else if (typeof source === "number") {
|
|
4848
|
+
if (!Number.isInteger(source) || source < 0) {
|
|
4849
|
+
warn$1(`The v-for range expects a positive integer value but got ${source}.`);
|
|
4850
|
+
ret = [];
|
|
4851
|
+
} else {
|
|
4852
|
+
ret = new Array(source);
|
|
4853
|
+
for (let i = 0; i < source; i++) ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
|
|
4699
4854
|
}
|
|
4700
|
-
}
|
|
4701
|
-
|
|
4855
|
+
} else if (isObject(source)) {
|
|
4856
|
+
if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
|
|
4857
|
+
else {
|
|
4858
|
+
const keys = Object.keys(source);
|
|
4859
|
+
ret = new Array(keys.length);
|
|
4860
|
+
for (let i = 0, l = keys.length; i < l; i++) {
|
|
4861
|
+
const key = keys[i];
|
|
4862
|
+
ret[i] = renderItem(source[key], key, i, cached && cached[i]);
|
|
4863
|
+
}
|
|
4864
|
+
}
|
|
4865
|
+
} else ret = [];
|
|
4702
4866
|
if (cache) cache[index] = ret;
|
|
4703
4867
|
return ret;
|
|
4704
4868
|
}
|
|
@@ -4723,18 +4887,28 @@ function createSlots(slots, dynamicSlots) {
|
|
|
4723
4887
|
//#endregion
|
|
4724
4888
|
//#region packages/runtime-core/src/helpers/renderSlot.ts
|
|
4725
4889
|
/**
|
|
4890
|
+
* Links a slot function to its raw vapor slot: a raw vapor slot carries
|
|
4891
|
+
* itself, and the wrapper the interop slots proxy hands out carries the raw
|
|
4892
|
+
* slot it wraps — one lookup answers both "is this a vapor slot" and
|
|
4893
|
+
* "which one". Internal to vapor interop.
|
|
4894
|
+
*/
|
|
4895
|
+
const rawVaporSlotKey = Symbol(`rawVaporSlot`);
|
|
4896
|
+
/**
|
|
4726
4897
|
* Compiler runtime helper for rendering `<slot/>`
|
|
4727
4898
|
* @private
|
|
4728
4899
|
*/
|
|
4729
|
-
function renderSlot(slots, name, props
|
|
4900
|
+
function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
4901
|
+
if (props == null) props = {};
|
|
4730
4902
|
let slot = slots[name];
|
|
4731
|
-
|
|
4732
|
-
const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
|
|
4903
|
+
const vaporSlot = slot && slot[rawVaporSlotKey];
|
|
4733
4904
|
if (vaporSlot) {
|
|
4734
4905
|
const ret = (openBlock(), createBlock(VaporSlot, props));
|
|
4735
4906
|
ret.vs = {
|
|
4736
4907
|
slot: vaporSlot,
|
|
4737
|
-
fallback
|
|
4908
|
+
outlets: fallback ? [{
|
|
4909
|
+
fallback,
|
|
4910
|
+
owner: currentRenderingInstance
|
|
4911
|
+
}] : void 0
|
|
4738
4912
|
};
|
|
4739
4913
|
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
4740
4914
|
return ret;
|
|
@@ -4755,9 +4929,15 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
|
|
|
4755
4929
|
let rendered;
|
|
4756
4930
|
try {
|
|
4757
4931
|
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
4758
|
-
|
|
4932
|
+
let attached = false;
|
|
4933
|
+
if (fallback && validSlotContent && currentRenderingInstance) {
|
|
4934
|
+
const interop = currentRenderingInstance.appContext.vapor;
|
|
4935
|
+
if (interop) attached = interop.attachSlotOutlet(validSlotContent, fallback, currentRenderingInstance);
|
|
4936
|
+
}
|
|
4759
4937
|
const slotKey = props.key || branchKey || validSlotContent && validSlotContent.key;
|
|
4760
4938
|
rendered = createBlock(Fragment, { key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
|
|
4939
|
+
if (!validSlotContent && fallback) rendered.shapeFlag |= 1024;
|
|
4940
|
+
if (attached) rendered.vo = true;
|
|
4761
4941
|
} catch (err) {
|
|
4762
4942
|
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
4763
4943
|
throw err;
|
|
@@ -4775,10 +4955,6 @@ function ensureValidVNode(vnodes) {
|
|
|
4775
4955
|
return true;
|
|
4776
4956
|
}) ? vnodes : null;
|
|
4777
4957
|
}
|
|
4778
|
-
function ensureVaporSlotFallback(vnodes, fallback) {
|
|
4779
|
-
let vaporSlot;
|
|
4780
|
-
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) vaporSlot.outletFallback = fallback;
|
|
4781
|
-
}
|
|
4782
4958
|
//#endregion
|
|
4783
4959
|
//#region packages/runtime-core/src/helpers/toHandlers.ts
|
|
4784
4960
|
/**
|
|
@@ -4806,11 +4982,38 @@ const getPublicInstance = (i) => {
|
|
|
4806
4982
|
if (isStatefulComponent(i)) return getComponentPublicInstance(i);
|
|
4807
4983
|
return getPublicInstance(i.parent);
|
|
4808
4984
|
};
|
|
4985
|
+
const resolveDevRootEl = (vnode) => {
|
|
4986
|
+
let found = false;
|
|
4987
|
+
while (true) {
|
|
4988
|
+
if (vnode.patchFlag > 0 && vnode.patchFlag & 2048) {
|
|
4989
|
+
const root = filterSingleRoot(vnode.children);
|
|
4990
|
+
if (!root) return;
|
|
4991
|
+
vnode = root;
|
|
4992
|
+
found = true;
|
|
4993
|
+
continue;
|
|
4994
|
+
}
|
|
4995
|
+
const component = vnode.component;
|
|
4996
|
+
if (component && component.subTree) {
|
|
4997
|
+
vnode = component.subTree;
|
|
4998
|
+
continue;
|
|
4999
|
+
}
|
|
5000
|
+
const suspense = vnode.suspense;
|
|
5001
|
+
if (suspense && suspense.activeBranch) {
|
|
5002
|
+
vnode = suspense.activeBranch;
|
|
5003
|
+
continue;
|
|
5004
|
+
}
|
|
5005
|
+
return found ? vnode.el : void 0;
|
|
5006
|
+
}
|
|
5007
|
+
};
|
|
5008
|
+
const getDevRootFragmentEl = (i) => {
|
|
5009
|
+
const el = i.subTree && resolveDevRootEl(i.subTree);
|
|
5010
|
+
return el === void 0 ? i.vnode.el : el;
|
|
5011
|
+
};
|
|
4809
5012
|
let publicPropertiesMap;
|
|
4810
5013
|
const getPublicPropertiesMap = () => {
|
|
4811
5014
|
if (!publicPropertiesMap) publicPropertiesMap = extend(Object.create(null), {
|
|
4812
5015
|
$: (i) => i,
|
|
4813
|
-
$el: (i) => i
|
|
5016
|
+
$el: (i) => getDevRootFragmentEl(i),
|
|
4814
5017
|
$data: (i) => i.data,
|
|
4815
5018
|
$props: (i) => /* @__PURE__ */ shallowReadonly(i.props),
|
|
4816
5019
|
$attrs: (i) => /* @__PURE__ */ shallowReadonly(i.attrs),
|
|
@@ -4916,7 +5119,7 @@ PublicInstanceProxyHandlers.ownKeys = (target) => {
|
|
|
4916
5119
|
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.");
|
|
4917
5120
|
return Reflect.ownKeys(target);
|
|
4918
5121
|
};
|
|
4919
|
-
const RuntimeCompiledPublicInstanceProxyHandlers =
|
|
5122
|
+
const RuntimeCompiledPublicInstanceProxyHandlers = /*@__PURE__*/ extend({}, PublicInstanceProxyHandlers, {
|
|
4920
5123
|
get(target, key) {
|
|
4921
5124
|
if (key === Symbol.unscopables) return;
|
|
4922
5125
|
return PublicInstanceProxyHandlers.get(target, key, target);
|
|
@@ -5088,12 +5291,13 @@ function mergeDefaults(raw, defaults) {
|
|
|
5088
5291
|
for (const key in defaults) {
|
|
5089
5292
|
if (key.startsWith("__skip")) continue;
|
|
5090
5293
|
let opt = props[key];
|
|
5091
|
-
if (opt)
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5096
|
-
|
|
5294
|
+
if (opt) {
|
|
5295
|
+
if (isArray(opt) || isFunction(opt)) opt = props[key] = {
|
|
5296
|
+
type: opt,
|
|
5297
|
+
default: defaults[key]
|
|
5298
|
+
};
|
|
5299
|
+
else opt.default = defaults[key];
|
|
5300
|
+
} else if (opt === null) opt = props[key] = { default: defaults[key] };
|
|
5097
5301
|
else warn$1(`props default key "${key}" has no corresponding declaration.`);
|
|
5098
5302
|
if (opt && defaults[`__skip_${key}`]) opt.skipFactory = true;
|
|
5099
5303
|
}
|
|
@@ -5143,37 +5347,32 @@ function createPropsRestProxy(props, excludedKeys) {
|
|
|
5143
5347
|
function withAsyncContext(getAwaitable) {
|
|
5144
5348
|
const ctx = getCurrentGenericInstance();
|
|
5145
5349
|
const inSSRSetup = isInSSRComponentSetup;
|
|
5146
|
-
const restoreAsyncContext = ctx && ctx.restoreAsyncContext ? ctx.restoreAsyncContext.bind(ctx) : void 0;
|
|
5147
5350
|
if (!ctx) warn$1("withAsyncContext called without active current instance. This is likely a bug.");
|
|
5148
5351
|
let awaitable = getAwaitable();
|
|
5149
5352
|
setCurrentInstance(null, void 0);
|
|
5150
5353
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
5151
5354
|
const restore = () => {
|
|
5152
|
-
const
|
|
5355
|
+
const stoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
|
|
5153
5356
|
setCurrentInstance(ctx);
|
|
5154
5357
|
if (inSSRSetup) setInSSRSetupState(true);
|
|
5155
|
-
|
|
5156
|
-
return () => {
|
|
5157
|
-
if (reset) reset();
|
|
5158
|
-
if (resetStoppedScope) resetStoppedScope.reset();
|
|
5159
|
-
};
|
|
5358
|
+
return stoppedScope;
|
|
5160
5359
|
};
|
|
5161
5360
|
const cleanup = () => {
|
|
5162
5361
|
setCurrentInstance(null, void 0);
|
|
5163
5362
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
5164
5363
|
};
|
|
5165
5364
|
if (isPromise(awaitable)) awaitable = awaitable.catch((e) => {
|
|
5166
|
-
const
|
|
5365
|
+
const stoppedScope = restore();
|
|
5167
5366
|
Promise.resolve().then(() => Promise.resolve().then(() => {
|
|
5168
|
-
if (
|
|
5367
|
+
if (stoppedScope) stoppedScope.reset();
|
|
5169
5368
|
cleanup();
|
|
5170
5369
|
}));
|
|
5171
5370
|
throw e;
|
|
5172
5371
|
});
|
|
5173
5372
|
return [awaitable, () => {
|
|
5174
|
-
const
|
|
5373
|
+
const stoppedScope = restore();
|
|
5175
5374
|
Promise.resolve().then(() => {
|
|
5176
|
-
if (
|
|
5375
|
+
if (stoppedScope) stoppedScope.reset();
|
|
5177
5376
|
cleanup();
|
|
5178
5377
|
});
|
|
5179
5378
|
}];
|
|
@@ -5236,11 +5435,12 @@ function applyOptions(instance) {
|
|
|
5236
5435
|
const opt = computedOptions[key];
|
|
5237
5436
|
const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
|
|
5238
5437
|
if (get === NOOP) warn$1(`Computed property "${key}" has no getter.`);
|
|
5438
|
+
const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
|
|
5439
|
+
warn$1(`Write operation failed: computed property "${key}" is readonly.`);
|
|
5440
|
+
};
|
|
5239
5441
|
const c = computed({
|
|
5240
5442
|
get,
|
|
5241
|
-
set
|
|
5242
|
-
warn$1(`Write operation failed: computed property "${key}" is readonly.`);
|
|
5243
|
-
}
|
|
5443
|
+
set
|
|
5244
5444
|
});
|
|
5245
5445
|
Object.defineProperty(ctx, key, {
|
|
5246
5446
|
enumerable: true,
|
|
@@ -5296,9 +5496,10 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP)
|
|
|
5296
5496
|
for (const key in injectOptions) {
|
|
5297
5497
|
const opt = injectOptions[key];
|
|
5298
5498
|
let injected;
|
|
5299
|
-
if (isObject(opt))
|
|
5300
|
-
|
|
5301
|
-
|
|
5499
|
+
if (isObject(opt)) {
|
|
5500
|
+
if ("default" in opt) injected = inject(opt.from || key, opt.default, true);
|
|
5501
|
+
else injected = inject(opt.from || key);
|
|
5502
|
+
} else injected = inject(opt);
|
|
5302
5503
|
if (/* @__PURE__ */ isRef(injected)) Object.defineProperty(ctx, key, {
|
|
5303
5504
|
enumerable: true,
|
|
5304
5505
|
configurable: true,
|
|
@@ -5319,13 +5520,14 @@ function createWatcher(raw, ctx, publicThis, key) {
|
|
|
5319
5520
|
if (isFunction(handler)) watch(getter, handler);
|
|
5320
5521
|
else warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
|
|
5321
5522
|
} else if (isFunction(raw)) watch(getter, raw.bind(publicThis));
|
|
5322
|
-
else if (isObject(raw))
|
|
5323
|
-
|
|
5324
|
-
|
|
5325
|
-
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
|
|
5523
|
+
else if (isObject(raw)) {
|
|
5524
|
+
if (isArray(raw)) raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
|
|
5525
|
+
else {
|
|
5526
|
+
const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
|
|
5527
|
+
if (isFunction(handler)) watch(getter, handler, raw);
|
|
5528
|
+
else warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
|
|
5529
|
+
}
|
|
5530
|
+
} else warn$1(`Invalid watch option: "${key}"`, raw);
|
|
5329
5531
|
}
|
|
5330
5532
|
/**
|
|
5331
5533
|
* Resolve merged options and cache it on the component.
|
|
@@ -5411,7 +5613,7 @@ function mergeObjectOptions(to, from) {
|
|
|
5411
5613
|
}
|
|
5412
5614
|
function mergeEmitsOrPropsOptions(to, from) {
|
|
5413
5615
|
if (to) {
|
|
5414
|
-
if (isArray(to) && isArray(from)) return [
|
|
5616
|
+
if (isArray(to) && isArray(from)) return [.../* @__PURE__ */ new Set([...to, ...from])];
|
|
5415
5617
|
return extend(Object.create(null), normalizePropsOrEmits(to), normalizePropsOrEmits(from !== null && from !== void 0 ? from : {}));
|
|
5416
5618
|
} else return from;
|
|
5417
5619
|
}
|
|
@@ -5530,8 +5732,10 @@ function createAppAPI(mount, unmount, getPublicInstance, render) {
|
|
|
5530
5732
|
} else warn$1(`Cannot unmount an app that is not mounted.`);
|
|
5531
5733
|
},
|
|
5532
5734
|
provide(key, value) {
|
|
5533
|
-
if (key in context.provides)
|
|
5534
|
-
|
|
5735
|
+
if (key in context.provides) {
|
|
5736
|
+
if (hasOwn(context.provides, key)) warn$1(`App already provides property with key "${String(key)}". It will be overwritten with the new value.`);
|
|
5737
|
+
else warn$1(`App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`);
|
|
5738
|
+
}
|
|
5535
5739
|
context.provides[key] = value;
|
|
5536
5740
|
return app;
|
|
5537
5741
|
},
|
|
@@ -5570,13 +5774,17 @@ function useModel(props, name, options = EMPTY_OBJ) {
|
|
|
5570
5774
|
const modifiers = getModelModifiers(props, camelizedName, defaultPropGetter);
|
|
5571
5775
|
const res = customRef((track, trigger) => {
|
|
5572
5776
|
let localValue;
|
|
5777
|
+
let prevPropValue = EMPTY_OBJ;
|
|
5573
5778
|
let prevSetValue = EMPTY_OBJ;
|
|
5574
5779
|
let prevEmittedValue;
|
|
5575
5780
|
watchSyncEffect(() => {
|
|
5576
5781
|
const propValue = props[camelizedName];
|
|
5577
|
-
if (hasChanged(
|
|
5578
|
-
|
|
5579
|
-
|
|
5782
|
+
if (hasChanged(prevPropValue, propValue)) {
|
|
5783
|
+
prevPropValue = propValue;
|
|
5784
|
+
if (hasChanged(localValue, propValue)) {
|
|
5785
|
+
localValue = propValue;
|
|
5786
|
+
trigger();
|
|
5787
|
+
}
|
|
5580
5788
|
}
|
|
5581
5789
|
});
|
|
5582
5790
|
return {
|
|
@@ -5638,12 +5846,14 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
|
|
|
5638
5846
|
if (instance.isUnmounted) return;
|
|
5639
5847
|
{
|
|
5640
5848
|
const { emitsOptions, propsOptions } = instance;
|
|
5641
|
-
if (emitsOptions)
|
|
5642
|
-
if (!
|
|
5643
|
-
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
if (
|
|
5849
|
+
if (emitsOptions) {
|
|
5850
|
+
if (!(event in emitsOptions) && true) {
|
|
5851
|
+
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.`);
|
|
5852
|
+
} else {
|
|
5853
|
+
const validator = emitsOptions[event];
|
|
5854
|
+
if (isFunction(validator)) {
|
|
5855
|
+
if (!validator(...rawArgs)) warn$1(`Invalid event arguments: event validation failed for event "${event}".`);
|
|
5856
|
+
}
|
|
5647
5857
|
}
|
|
5648
5858
|
}
|
|
5649
5859
|
}
|
|
@@ -5652,7 +5862,7 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
|
|
|
5652
5862
|
const modifiers = isModelListener && getModelModifiers(props, event.slice(7), getter);
|
|
5653
5863
|
if (modifiers) {
|
|
5654
5864
|
if (modifiers.trim) args = rawArgs.map((a) => isString(a) ? a.trim() : a);
|
|
5655
|
-
if (modifiers.number) args =
|
|
5865
|
+
if (modifiers.number) args = args.map(looseToNumber);
|
|
5656
5866
|
}
|
|
5657
5867
|
devtoolsComponentEmit(instance, event, args);
|
|
5658
5868
|
{
|
|
@@ -5779,8 +5989,9 @@ function renderComponentRoot(instance) {
|
|
|
5779
5989
|
root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
|
|
5780
5990
|
}
|
|
5781
5991
|
if (vnode.transition) {
|
|
5782
|
-
|
|
5783
|
-
|
|
5992
|
+
const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
|
|
5993
|
+
if (!isElementRoot(child)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
|
|
5994
|
+
setTransitionHooks(child, vnode.transition);
|
|
5784
5995
|
}
|
|
5785
5996
|
if (setRoot) setRoot(root);
|
|
5786
5997
|
else result = root;
|
|
@@ -5831,18 +6042,21 @@ function filterSingleRoot(children, recurse = true) {
|
|
|
5831
6042
|
for (let i = 0; i < children.length; i++) {
|
|
5832
6043
|
const child = children[i];
|
|
5833
6044
|
if (isVNode(child)) {
|
|
5834
|
-
if (child.type !== Comment || child.children === "v-if")
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
6045
|
+
if (child.type !== Comment || child.children === "v-if") {
|
|
6046
|
+
if (singleRoot) return;
|
|
6047
|
+
else {
|
|
6048
|
+
singleRoot = child;
|
|
6049
|
+
if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) return filterSingleRoot(singleRoot.children);
|
|
6050
|
+
}
|
|
5838
6051
|
}
|
|
5839
6052
|
} else return;
|
|
5840
6053
|
}
|
|
5841
6054
|
return singleRoot;
|
|
5842
6055
|
}
|
|
6056
|
+
const isFunctionalFallthroughKey = (key) => key === "class" || key === "style" || isOn(key);
|
|
5843
6057
|
const getFunctionalFallthrough = (attrs) => {
|
|
5844
6058
|
let res;
|
|
5845
|
-
for (const key in attrs) if (
|
|
6059
|
+
for (const key in attrs) if (isFunctionalFallthroughKey(key)) (res || (res = {}))[key] = attrs[key];
|
|
5846
6060
|
return res;
|
|
5847
6061
|
};
|
|
5848
6062
|
const filterModelListeners = (attrs, props) => {
|
|
@@ -5954,16 +6168,17 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
5954
6168
|
let key = propsToUpdate[i];
|
|
5955
6169
|
if (isEmitListener(instance.emitsOptions, key)) continue;
|
|
5956
6170
|
const value = rawProps[key];
|
|
5957
|
-
if (options)
|
|
5958
|
-
if (
|
|
5959
|
-
attrs[key]
|
|
5960
|
-
|
|
6171
|
+
if (options) {
|
|
6172
|
+
if (hasOwn(attrs, key)) {
|
|
6173
|
+
if (value !== attrs[key]) {
|
|
6174
|
+
attrs[key] = value;
|
|
6175
|
+
hasAttrsChanged = true;
|
|
6176
|
+
}
|
|
6177
|
+
} else {
|
|
6178
|
+
const camelizedKey = camelize(key);
|
|
6179
|
+
props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
|
|
5961
6180
|
}
|
|
5962
|
-
} else {
|
|
5963
|
-
const camelizedKey = camelize(key);
|
|
5964
|
-
props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
|
|
5965
|
-
}
|
|
5966
|
-
else if (value !== attrs[key]) {
|
|
6181
|
+
} else if (value !== attrs[key]) {
|
|
5967
6182
|
attrs[key] = value;
|
|
5968
6183
|
hasAttrsChanged = true;
|
|
5969
6184
|
}
|
|
@@ -5972,9 +6187,11 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
5972
6187
|
} else {
|
|
5973
6188
|
if (setFullProps(instance, rawProps, props, attrs)) hasAttrsChanged = true;
|
|
5974
6189
|
let kebabKey;
|
|
5975
|
-
for (const key in rawCurrentProps) if (!rawProps || !hasOwn(rawProps, key) && ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey)))
|
|
5976
|
-
if (
|
|
5977
|
-
|
|
6190
|
+
for (const key in rawCurrentProps) if (!rawProps || !hasOwn(rawProps, key) && ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
|
|
6191
|
+
if (options) {
|
|
6192
|
+
if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) props[key] = resolvePropValue(options, key, void 0, instance, baseResolveDefault, true);
|
|
6193
|
+
} else delete props[key];
|
|
6194
|
+
}
|
|
5978
6195
|
if (attrs !== rawCurrentProps) {
|
|
5979
6196
|
for (const key in attrs) if (!rawProps || !hasOwn(rawProps, key) && true) {
|
|
5980
6197
|
delete attrs[key];
|
|
@@ -5993,9 +6210,10 @@ function setFullProps(instance, rawProps, props, attrs) {
|
|
|
5993
6210
|
if (isReservedProp(key)) continue;
|
|
5994
6211
|
const value = rawProps[key];
|
|
5995
6212
|
let camelKey;
|
|
5996
|
-
if (options && hasOwn(options, camelKey = camelize(key)))
|
|
5997
|
-
|
|
5998
|
-
|
|
6213
|
+
if (options && hasOwn(options, camelKey = camelize(key))) {
|
|
6214
|
+
if (!needCastKeys || !needCastKeys.includes(camelKey)) props[camelKey] = value;
|
|
6215
|
+
else (rawCastValues || (rawCastValues = {}))[camelKey] = value;
|
|
6216
|
+
} else if (!isEmitListener(instance.emitsOptions, key)) {
|
|
5999
6217
|
if (!(key in attrs) || value !== attrs[key]) {
|
|
6000
6218
|
attrs[key] = value;
|
|
6001
6219
|
hasAttrsChanged = true;
|
|
@@ -6042,7 +6260,7 @@ function baseResolveDefault(factory, instance, key) {
|
|
|
6042
6260
|
const prev = setCurrentInstance(instance);
|
|
6043
6261
|
const props = /* @__PURE__ */ toRaw(instance.props);
|
|
6044
6262
|
value = factory.call(null, props);
|
|
6045
|
-
|
|
6263
|
+
restoreCurrentInstance(prev);
|
|
6046
6264
|
return value;
|
|
6047
6265
|
}
|
|
6048
6266
|
const mixinPropsCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -6158,7 +6376,7 @@ function validateProp(key, value, propOptions, resolvedProps, isAbsent) {
|
|
|
6158
6376
|
}
|
|
6159
6377
|
if (validator && !validator(value, /* @__PURE__ */ shallowReadonly(resolvedProps))) warn$1("Invalid prop: custom validator check failed for prop \"" + key + "\".");
|
|
6160
6378
|
}
|
|
6161
|
-
const isSimpleType =
|
|
6379
|
+
const isSimpleType = /*@__PURE__*/ makeMap("String,Number,Boolean,Function,Symbol,BigInt");
|
|
6162
6380
|
/**
|
|
6163
6381
|
* dev only
|
|
6164
6382
|
*/
|
|
@@ -6271,12 +6489,13 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
6271
6489
|
let deletionComparisonTarget = EMPTY_OBJ;
|
|
6272
6490
|
if (vnode.shapeFlag & 32) {
|
|
6273
6491
|
const type = children._;
|
|
6274
|
-
if (type)
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6492
|
+
if (type) {
|
|
6493
|
+
if (isHmrUpdating) {
|
|
6494
|
+
assignSlots(slots, children, optimized);
|
|
6495
|
+
trigger(instance, "set", "$slots");
|
|
6496
|
+
} else if (optimized && type === 1) needDeletionCheck = false;
|
|
6497
|
+
else assignSlots(slots, children, optimized);
|
|
6498
|
+
} else {
|
|
6280
6499
|
needDeletionCheck = !children.$stable;
|
|
6281
6500
|
normalizeObjectSlots(children, slots, instance);
|
|
6282
6501
|
}
|
|
@@ -6294,7 +6513,7 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
6294
6513
|
let supported;
|
|
6295
6514
|
let perf;
|
|
6296
6515
|
let cachedNow$1 = 0;
|
|
6297
|
-
const p$1 =
|
|
6516
|
+
const p$1 = /*@__PURE__*/ Promise.resolve();
|
|
6298
6517
|
const getNow$1 = () => cachedNow$1 || (p$1.then(() => cachedNow$1 = 0), cachedNow$1 = isSupported() ? perf.now() : Date.now());
|
|
6299
6518
|
/**
|
|
6300
6519
|
* @internal
|
|
@@ -6375,6 +6594,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6375
6594
|
optimized = false;
|
|
6376
6595
|
n2.dynamicChildren = null;
|
|
6377
6596
|
}
|
|
6597
|
+
if (n2.dynamicChildren && n1 && n1.dynamicChildren && n1.dynamicChildren.hasOnce) {
|
|
6598
|
+
if (n2.dynamicChildren === EMPTY_ARR) n2.dynamicChildren = [];
|
|
6599
|
+
n2.dynamicChildren.hasOnce = true;
|
|
6600
|
+
}
|
|
6378
6601
|
const { type, ref, shapeFlag } = n2;
|
|
6379
6602
|
switch (type) {
|
|
6380
6603
|
case Text:
|
|
@@ -6391,7 +6614,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6391
6614
|
processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
6392
6615
|
break;
|
|
6393
6616
|
case VaporSlot:
|
|
6394
|
-
getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense);
|
|
6617
|
+
getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense, slotScopeIds);
|
|
6395
6618
|
break;
|
|
6396
6619
|
default: if (shapeFlag & 1) processElement(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
6397
6620
|
else if (shapeFlag & 6) processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
@@ -6510,7 +6733,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6510
6733
|
for (let i = 0; i < inheritedScopeIds.length; i++) hostSetScopeId(el, inheritedScopeIds[i]);
|
|
6511
6734
|
};
|
|
6512
6735
|
const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
|
|
6513
|
-
for (let i = start; i < children.length; i++)
|
|
6736
|
+
for (let i = start; i < children.length; i++) {
|
|
6737
|
+
const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
|
|
6738
|
+
patch(null, child, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
6739
|
+
}
|
|
6514
6740
|
};
|
|
6515
6741
|
const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
6516
6742
|
const el = n2.el = n1.el;
|
|
@@ -6522,6 +6748,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6522
6748
|
let vnodeHook;
|
|
6523
6749
|
parentComponent && toggleRecurse(parentComponent, false);
|
|
6524
6750
|
if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
6751
|
+
if (n2.ibu) n2.ibu();
|
|
6525
6752
|
if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
6526
6753
|
parentComponent && toggleRecurse(parentComponent, true);
|
|
6527
6754
|
if (isHmrUpdating || dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
|
|
@@ -6555,8 +6782,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6555
6782
|
if (n1.children !== n2.children) hostSetElementText(el, n2.children);
|
|
6556
6783
|
}
|
|
6557
6784
|
} else if (!optimized && dynamicChildren == null) patchProps(el, oldProps, newProps, parentComponent, namespace);
|
|
6558
|
-
if ((vnodeHook = newProps.onVnodeUpdated) || dirs) queuePostRenderEffect(() => {
|
|
6785
|
+
if ((vnodeHook = newProps.onVnodeUpdated) || dirs || n2.iu) queuePostRenderEffect(() => {
|
|
6559
6786
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
6787
|
+
n2.iu && n2.iu();
|
|
6560
6788
|
dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
6561
6789
|
}, void 0, parentSuspense);
|
|
6562
6790
|
};
|
|
@@ -6564,7 +6792,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6564
6792
|
for (let i = 0; i < newChildren.length; i++) {
|
|
6565
6793
|
const oldVNode = oldChildren[i];
|
|
6566
6794
|
const newVNode = newChildren[i];
|
|
6567
|
-
|
|
6795
|
+
const container = oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer;
|
|
6796
|
+
patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
|
|
6568
6797
|
}
|
|
6569
6798
|
};
|
|
6570
6799
|
const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
|
|
@@ -6602,41 +6831,15 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6602
6831
|
};
|
|
6603
6832
|
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
6604
6833
|
n2.slotScopeIds = slotScopeIds;
|
|
6605
|
-
if (n2.type.__vapor)
|
|
6606
|
-
|
|
6607
|
-
|
|
6608
|
-
|
|
6609
|
-
|
|
6610
|
-
|
|
6611
|
-
|
|
6612
|
-
|
|
6613
|
-
|
|
6614
|
-
if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, n2);
|
|
6615
|
-
});
|
|
6616
|
-
if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, null, parentComponent, "mounted"), void 0, parentSuspense);
|
|
6617
|
-
const vnodeMountedHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeMounted;
|
|
6618
|
-
if (vnodeMountedHook) {
|
|
6619
|
-
const scopedVNode = n2;
|
|
6620
|
-
queuePostRenderEffect(() => invokeVNodeHook(vnodeMountedHook, parentComponent, scopedVNode), void 0, parentSuspense);
|
|
6621
|
-
}
|
|
6622
|
-
}
|
|
6623
|
-
else {
|
|
6624
|
-
const shouldUpdate = shouldUpdateComponent(n1, n2, optimized);
|
|
6625
|
-
getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdate, () => {
|
|
6626
|
-
if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
6627
|
-
}, () => {
|
|
6628
|
-
const vnodeBeforeUpdateHook = n2.props && n2.props.onVnodeBeforeUpdate;
|
|
6629
|
-
if (vnodeBeforeUpdateHook) invokeVNodeHook(vnodeBeforeUpdateHook, parentComponent, n2, n1);
|
|
6630
|
-
});
|
|
6631
|
-
const vnodeUpdatedHook = n2.props && n2.props.onVnodeUpdated;
|
|
6632
|
-
if (shouldUpdate && (vnodeUpdatedHook || n2.dirs)) queuePostRenderEffect(() => {
|
|
6633
|
-
n2.dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
6634
|
-
vnodeUpdatedHook && invokeVNodeHook(vnodeUpdatedHook, parentComponent, n2, n1);
|
|
6635
|
-
}, void 0, parentSuspense);
|
|
6636
|
-
}
|
|
6637
|
-
else if (n1 == null) if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
6638
|
-
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
6639
|
-
else updateComponent(n1, n2, optimized);
|
|
6834
|
+
if (n2.type.__vapor) {
|
|
6835
|
+
if (n1 == null) {
|
|
6836
|
+
if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
|
|
6837
|
+
else getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense);
|
|
6838
|
+
} else getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdateComponent(n1, n2, optimized));
|
|
6839
|
+
} else if (n1 == null) {
|
|
6840
|
+
if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
6841
|
+
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
6842
|
+
} else updateComponent(n1, n2, optimized);
|
|
6640
6843
|
};
|
|
6641
6844
|
const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
|
|
6642
6845
|
const instance = initialVNode.component = createComponentInstance(initialVNode, parentComponent, parentSuspense);
|
|
@@ -6677,16 +6880,18 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6677
6880
|
};
|
|
6678
6881
|
const updateComponent = (n1, n2, optimized) => {
|
|
6679
6882
|
const instance = n2.component = n1.component;
|
|
6680
|
-
if (shouldUpdateComponent(n1, n2, optimized))
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
|
|
6684
|
-
|
|
6883
|
+
if (shouldUpdateComponent(n1, n2, optimized)) {
|
|
6884
|
+
if (instance.asyncDep && !instance.asyncResolved) {
|
|
6885
|
+
pushWarningContext(n2);
|
|
6886
|
+
n2.el = n1.el;
|
|
6887
|
+
updateComponentPreRender(instance, n2, optimized);
|
|
6888
|
+
popWarningContext();
|
|
6889
|
+
return;
|
|
6890
|
+
} else {
|
|
6891
|
+
instance.next = n2;
|
|
6892
|
+
instance.effect.run();
|
|
6893
|
+
}
|
|
6685
6894
|
} else {
|
|
6686
|
-
instance.next = n2;
|
|
6687
|
-
instance.effect.run();
|
|
6688
|
-
}
|
|
6689
|
-
else {
|
|
6690
6895
|
n2.el = n1.el;
|
|
6691
6896
|
instance.vnode = n2;
|
|
6692
6897
|
}
|
|
@@ -6784,6 +6989,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6784
6989
|
} else next = vnode;
|
|
6785
6990
|
if (bu) invokeArrayFns(bu);
|
|
6786
6991
|
if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
6992
|
+
if (next.ibu) next.ibu();
|
|
6787
6993
|
toggleRecurse(instance, true);
|
|
6788
6994
|
startMeasure(instance, `render`);
|
|
6789
6995
|
const nextTree = renderComponentRoot(instance);
|
|
@@ -6796,7 +7002,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6796
7002
|
next.el = nextTree.el;
|
|
6797
7003
|
if (originNext === null) updateHOCHostEl(instance, nextTree.el);
|
|
6798
7004
|
if (u) queuePostRenderEffect(u, void 0, parentSuspense);
|
|
6799
|
-
if (vnodeHook = next.props && next.props.onVnodeUpdated) queuePostRenderEffect(() =>
|
|
7005
|
+
if ((vnodeHook = next.props && next.props.onVnodeUpdated) || next.iu) queuePostRenderEffect(() => {
|
|
7006
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
7007
|
+
next.iu && next.iu();
|
|
7008
|
+
}, void 0, parentSuspense);
|
|
6800
7009
|
devtoolsComponentUpdated(instance);
|
|
6801
7010
|
popWarningContext();
|
|
6802
7011
|
}
|
|
@@ -6836,9 +7045,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6836
7045
|
if (shapeFlag & 8) {
|
|
6837
7046
|
if (prevShapeFlag & 16) unmountChildren(c1, parentComponent, parentSuspense);
|
|
6838
7047
|
if (c2 !== c1) hostSetElementText(container, c2);
|
|
6839
|
-
} else if (prevShapeFlag & 16)
|
|
6840
|
-
|
|
6841
|
-
|
|
7048
|
+
} else if (prevShapeFlag & 16) {
|
|
7049
|
+
if (shapeFlag & 16) patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
7050
|
+
else unmountChildren(c1, parentComponent, parentSuspense, true);
|
|
7051
|
+
} else {
|
|
6842
7052
|
if (prevShapeFlag & 8) hostSetElementText(container, "");
|
|
6843
7053
|
if (shapeFlag & 16) mountChildren(c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
6844
7054
|
}
|
|
@@ -6937,15 +7147,17 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6937
7147
|
const anchorVNode = c2[nextIndex + 1];
|
|
6938
7148
|
const anchor = nextIndex + 1 < l2 ? anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode) : parentAnchor;
|
|
6939
7149
|
if (newIndexToOldIndexMap[i] === 0) patch(null, nextChild, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
6940
|
-
else if (moved)
|
|
6941
|
-
|
|
7150
|
+
else if (moved) {
|
|
7151
|
+
if (j < 0 || i !== increasingNewIndexSequence[j]) move(nextChild, container, anchor, 2, parentComponent);
|
|
7152
|
+
else j--;
|
|
7153
|
+
}
|
|
6942
7154
|
}
|
|
6943
7155
|
}
|
|
6944
7156
|
};
|
|
6945
7157
|
const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
|
|
6946
7158
|
const { el, type, transition, children, shapeFlag } = vnode;
|
|
6947
7159
|
if (isVaporComponent(type) || type === VaporSlot) {
|
|
6948
|
-
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType);
|
|
7160
|
+
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType, parentSuspense);
|
|
6949
7161
|
return;
|
|
6950
7162
|
}
|
|
6951
7163
|
if (shapeFlag & 6) {
|
|
@@ -6970,54 +7182,37 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6970
7182
|
moveStaticNode(vnode, container, anchor);
|
|
6971
7183
|
return;
|
|
6972
7184
|
}
|
|
6973
|
-
if (moveType !== 2 && shapeFlag & 1 && transition)
|
|
6974
|
-
|
|
6975
|
-
|
|
6976
|
-
const remove = () => {
|
|
7185
|
+
if (moveType !== 2 && shapeFlag & 1 && transition) {
|
|
7186
|
+
if (moveType === 0) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense, true);
|
|
7187
|
+
else performTransitionLeave(el, transition, () => {
|
|
6977
7188
|
if (vnode.ctx.isUnmounted) hostRemove(el);
|
|
6978
7189
|
else hostInsert(el, container, anchor);
|
|
6979
|
-
};
|
|
6980
|
-
|
|
6981
|
-
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
6982
|
-
if (el._isLeaving) el[leaveCbKey](true);
|
|
6983
|
-
if (transition.persisted && !wasLeaving) remove();
|
|
6984
|
-
else leave(el, () => {
|
|
6985
|
-
remove();
|
|
6986
|
-
afterLeave && afterLeave();
|
|
6987
|
-
});
|
|
6988
|
-
};
|
|
6989
|
-
if (delayLeave) delayLeave(el, remove, performLeave);
|
|
6990
|
-
else performLeave();
|
|
6991
|
-
}
|
|
6992
|
-
else hostInsert(el, container, anchor);
|
|
7190
|
+
}, true, true);
|
|
7191
|
+
} else hostInsert(el, container, anchor);
|
|
6993
7192
|
};
|
|
6994
7193
|
const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
|
|
6995
7194
|
const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
|
|
6996
|
-
if (patchFlag === -2) optimized = false;
|
|
7195
|
+
if (patchFlag === -2 || dynamicChildren && dynamicChildren.hasOnce) optimized = false;
|
|
6997
7196
|
if (ref != null) {
|
|
6998
7197
|
const prevSub = setActiveSub();
|
|
6999
7198
|
setRef(ref, null, parentSuspense, vnode, true);
|
|
7000
7199
|
setActiveSub(prevSub);
|
|
7001
7200
|
}
|
|
7002
|
-
if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
|
|
7201
|
+
if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
|
|
7003
7202
|
if (shapeFlag & 256) {
|
|
7004
|
-
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer());
|
|
7203
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
|
|
7005
7204
|
else parentComponent.ctx.deactivate(vnode);
|
|
7006
7205
|
return;
|
|
7007
7206
|
}
|
|
7207
|
+
if (shapeFlag & 6 && isVaporComponent(type)) {
|
|
7208
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
7209
|
+
return;
|
|
7210
|
+
}
|
|
7008
7211
|
const shouldInvokeDirs = shapeFlag & 1 && dirs;
|
|
7009
7212
|
const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
|
|
7010
7213
|
let vnodeHook;
|
|
7011
7214
|
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
7012
|
-
if (shapeFlag & 6)
|
|
7013
|
-
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
|
|
7014
|
-
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
7015
|
-
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || dirs) queuePostRenderEffect(() => {
|
|
7016
|
-
dirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
7017
|
-
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
7018
|
-
}, void 0, parentSuspense);
|
|
7019
|
-
return;
|
|
7020
|
-
} else unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
7215
|
+
if (shapeFlag & 6) unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
7021
7216
|
else {
|
|
7022
7217
|
if (shapeFlag & 128) {
|
|
7023
7218
|
vnode.suspense.unmount(parentSuspense, doRemove);
|
|
@@ -7028,7 +7223,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7028
7223
|
else if (dynamicChildren && !dynamicChildren.hasOnce && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
|
|
7029
7224
|
else if (type === Fragment && patchFlag & 384 || !optimized && shapeFlag & 16) unmountChildren(children, parentComponent, parentSuspense);
|
|
7030
7225
|
if (type === VaporSlot) {
|
|
7031
|
-
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
7226
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
7032
7227
|
return;
|
|
7033
7228
|
}
|
|
7034
7229
|
if (doRemove) remove(vnode);
|
|
@@ -7052,6 +7247,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7052
7247
|
}
|
|
7053
7248
|
if (type === Static) {
|
|
7054
7249
|
removeStaticNode(vnode);
|
|
7250
|
+
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
7055
7251
|
return;
|
|
7056
7252
|
}
|
|
7057
7253
|
if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
|
|
@@ -7076,7 +7272,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7076
7272
|
if (effect) {
|
|
7077
7273
|
effect.stop();
|
|
7078
7274
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
7079
|
-
} else if (
|
|
7275
|
+
} else if (instance.vnode.el && subTree) {
|
|
7276
|
+
subTree.transition = instance.vnode.transition;
|
|
7277
|
+
unmount(subTree, instance, parentSuspense, doRemove);
|
|
7278
|
+
}
|
|
7080
7279
|
if (um) queuePostRenderEffect(um, void 0, parentSuspense);
|
|
7081
7280
|
queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
|
|
7082
7281
|
devtoolsComponentRemoved(instance);
|
|
@@ -7150,12 +7349,14 @@ function resolveChildrenNamespace({ type, props }, currentNamespace) {
|
|
|
7150
7349
|
return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
|
|
7151
7350
|
}
|
|
7152
7351
|
function toggleRecurse({ effect, job, vapor }, allowed) {
|
|
7153
|
-
if (!vapor)
|
|
7154
|
-
|
|
7155
|
-
|
|
7156
|
-
|
|
7157
|
-
|
|
7158
|
-
|
|
7352
|
+
if (!vapor) {
|
|
7353
|
+
if (allowed) {
|
|
7354
|
+
effect.flags |= 128;
|
|
7355
|
+
job.flags |= 2;
|
|
7356
|
+
} else {
|
|
7357
|
+
effect.flags &= -129;
|
|
7358
|
+
job.flags &= -3;
|
|
7359
|
+
}
|
|
7159
7360
|
}
|
|
7160
7361
|
}
|
|
7161
7362
|
function needTransition(parentSuspense, transition) {
|
|
@@ -7195,8 +7396,10 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
7195
7396
|
}
|
|
7196
7397
|
function locateNonHydratedAsyncRoot(instance) {
|
|
7197
7398
|
const subComponent = instance.subTree && instance.subTree.component;
|
|
7198
|
-
if (subComponent)
|
|
7199
|
-
|
|
7399
|
+
if (subComponent) {
|
|
7400
|
+
if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
|
|
7401
|
+
else return locateNonHydratedAsyncRoot(subComponent);
|
|
7402
|
+
}
|
|
7200
7403
|
}
|
|
7201
7404
|
function invalidateMount(hooks) {
|
|
7202
7405
|
if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
|
|
@@ -7215,13 +7418,15 @@ function performTransitionEnter(el, transition, insert, parentSuspense, force =
|
|
|
7215
7418
|
function performTransitionLeave(el, transition, remove, isElement = true, force = false) {
|
|
7216
7419
|
const performRemove = () => {
|
|
7217
7420
|
remove();
|
|
7218
|
-
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
7421
|
+
if (transition && (force || !transition.persisted) && transition.afterLeave) transition.afterLeave();
|
|
7219
7422
|
};
|
|
7220
7423
|
if (force || isElement && transition && !transition.persisted) {
|
|
7221
7424
|
const { leave, delayLeave } = transition;
|
|
7222
7425
|
const performLeave = () => {
|
|
7426
|
+
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
7223
7427
|
if (el._isLeaving && force) el[leaveCbKey](true);
|
|
7224
|
-
|
|
7428
|
+
if (force && transition.persisted && !wasLeaving) remove();
|
|
7429
|
+
else leave(el, performRemove);
|
|
7225
7430
|
};
|
|
7226
7431
|
if (delayLeave) delayLeave(el, performRemove, performLeave);
|
|
7227
7432
|
else performLeave();
|
|
@@ -7240,7 +7445,7 @@ function isVaporComponent(type) {
|
|
|
7240
7445
|
/**
|
|
7241
7446
|
* shared between vdom and vapor
|
|
7242
7447
|
*/
|
|
7243
|
-
function getInheritedScopeIds(vnode, parentComponent) {
|
|
7448
|
+
function getInheritedScopeIds(vnode, parentComponent, includeVaporRootIds = true) {
|
|
7244
7449
|
const inheritedScopeIds = [];
|
|
7245
7450
|
let currentParent = parentComponent;
|
|
7246
7451
|
let currentVNode = vnode;
|
|
@@ -7256,6 +7461,8 @@ function getInheritedScopeIds(vnode, parentComponent) {
|
|
|
7256
7461
|
currentParent = currentParent.parent;
|
|
7257
7462
|
} else break;
|
|
7258
7463
|
}
|
|
7464
|
+
const vaporScopeIds = includeVaporRootIds && currentVNode.vaporScopeIds;
|
|
7465
|
+
if (vaporScopeIds) inheritedScopeIds.push(...vaporScopeIds);
|
|
7259
7466
|
return inheritedScopeIds;
|
|
7260
7467
|
}
|
|
7261
7468
|
function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
@@ -7274,7 +7481,7 @@ const Suspense = {
|
|
|
7274
7481
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
7275
7482
|
if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
|
|
7276
7483
|
else {
|
|
7277
|
-
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
|
|
7484
|
+
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
|
|
7278
7485
|
n2.suspense = n1.suspense;
|
|
7279
7486
|
n2.suspense.vnode = n2;
|
|
7280
7487
|
n2.el = n1.el;
|
|
@@ -7312,10 +7519,12 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
7312
7519
|
if (pendingBranch) {
|
|
7313
7520
|
suspense.pendingBranch = newBranch;
|
|
7314
7521
|
if (isSameVNodeType(pendingBranch, newBranch)) {
|
|
7315
|
-
|
|
7522
|
+
suspense.deps++;
|
|
7523
|
+
patch(pendingBranch, newBranch, isHydrating ? container : suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
7524
|
+
suspense.deps--;
|
|
7316
7525
|
if (suspense.deps <= 0) suspense.resolve();
|
|
7317
7526
|
else if (isInFallback) {
|
|
7318
|
-
if (!isHydrating) {
|
|
7527
|
+
if (!isHydrating && !suspense.isFallbackMountPending) {
|
|
7319
7528
|
patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
7320
7529
|
setActiveBranch(suspense, newFallback);
|
|
7321
7530
|
}
|
|
@@ -7327,12 +7536,16 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
7327
7536
|
suspense.activeBranch = pendingBranch;
|
|
7328
7537
|
} else unmount(pendingBranch, parentComponent, suspense);
|
|
7329
7538
|
suspense.deps = 0;
|
|
7539
|
+
for (let i = 0; i < suspense.effects.length; i++) {
|
|
7540
|
+
const effect = suspense.effects[i];
|
|
7541
|
+
if (effect.flags & 8) queuePostFlushCb(effect);
|
|
7542
|
+
}
|
|
7330
7543
|
suspense.effects.length = 0;
|
|
7331
7544
|
suspense.hiddenContainer = createElement("div");
|
|
7332
7545
|
if (isInFallback) {
|
|
7333
7546
|
patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
7334
7547
|
if (suspense.deps <= 0) suspense.resolve();
|
|
7335
|
-
else {
|
|
7548
|
+
else if (!suspense.isFallbackMountPending) {
|
|
7336
7549
|
patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
7337
7550
|
setActiveBranch(suspense, newFallback);
|
|
7338
7551
|
}
|
|
@@ -7434,7 +7647,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7434
7647
|
let hasUnresolvedAncestor = false;
|
|
7435
7648
|
while (parent) {
|
|
7436
7649
|
if (parent.pendingBranch) {
|
|
7437
|
-
parent.effects.push(
|
|
7650
|
+
for (let i = 0; i < effects.length; i++) parent.effects.push(effects[i]);
|
|
7438
7651
|
hasUnresolvedAncestor = true;
|
|
7439
7652
|
break;
|
|
7440
7653
|
}
|
|
@@ -7444,6 +7657,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7444
7657
|
suspense.effects = [];
|
|
7445
7658
|
if (isSuspensible) {
|
|
7446
7659
|
if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
|
|
7660
|
+
parentSuspenseId = void 0;
|
|
7447
7661
|
parentSuspense.deps--;
|
|
7448
7662
|
if (parentSuspense.deps === 0 && !sync) parentSuspense.resolve();
|
|
7449
7663
|
}
|
|
@@ -7458,8 +7672,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7458
7672
|
const mountFallback = () => {
|
|
7459
7673
|
suspense.isFallbackMountPending = false;
|
|
7460
7674
|
if (!suspense.isInFallback) return;
|
|
7461
|
-
|
|
7462
|
-
|
|
7675
|
+
const latestFallback = suspense.vnode.ssFallback;
|
|
7676
|
+
patch(null, latestFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
7677
|
+
setActiveBranch(suspense, latestFallback);
|
|
7463
7678
|
};
|
|
7464
7679
|
const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
|
|
7465
7680
|
if (delayEnter) {
|
|
@@ -7480,11 +7695,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7480
7695
|
registerDep(instance, onResolve) {
|
|
7481
7696
|
const isInPendingSuspense = !!suspense.pendingBranch;
|
|
7482
7697
|
if (isInPendingSuspense) suspense.deps++;
|
|
7698
|
+
const hydratedEl = instance.vnode && instance.vnode.el;
|
|
7483
7699
|
instance.asyncDep.catch((err) => {
|
|
7484
7700
|
handleError(err, instance, 0);
|
|
7485
7701
|
}).then((asyncSetupResult) => {
|
|
7486
7702
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
7487
7703
|
setCurrentInstance(null, void 0);
|
|
7704
|
+
if (hydratedEl && !instance.scope.active) {
|
|
7705
|
+
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
7706
|
+
return;
|
|
7707
|
+
}
|
|
7488
7708
|
instance.asyncResolved = true;
|
|
7489
7709
|
onResolve(asyncSetupResult);
|
|
7490
7710
|
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
@@ -7535,9 +7755,10 @@ function normalizeSuspenseSlot(s) {
|
|
|
7535
7755
|
return s;
|
|
7536
7756
|
}
|
|
7537
7757
|
function queueEffectWithSuspense(fn, id, suspense) {
|
|
7538
|
-
if (suspense && suspense.pendingBranch)
|
|
7539
|
-
|
|
7540
|
-
|
|
7758
|
+
if (suspense && suspense.pendingBranch) {
|
|
7759
|
+
if (isArray(fn)) suspense.effects.push(...fn);
|
|
7760
|
+
else suspense.effects.push(fn);
|
|
7761
|
+
} else queuePostFlushCb(fn, id);
|
|
7541
7762
|
}
|
|
7542
7763
|
function setActiveBranch(suspense, branch) {
|
|
7543
7764
|
suspense.activeBranch = branch;
|
|
@@ -7704,9 +7925,24 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
7704
7925
|
if (shapeFlag & 128) type.normalize(vnode);
|
|
7705
7926
|
} else if (children) vnode.shapeFlag |= isString(children) ? 8 : 16;
|
|
7706
7927
|
if (vnode.key !== vnode.key) warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
|
|
7928
|
+
if (props && vnode.shapeFlag & 1) {
|
|
7929
|
+
const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
|
|
7930
|
+
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.`);
|
|
7931
|
+
}
|
|
7707
7932
|
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock && (vnode.patchFlag > 0 || shapeFlag & 6) && vnode.patchFlag !== 32) currentBlock.push(vnode);
|
|
7708
7933
|
return vnode;
|
|
7709
7934
|
}
|
|
7935
|
+
/**
|
|
7936
|
+
* dev only
|
|
7937
|
+
* Whether children would actually render something. Empty text and empty
|
|
7938
|
+
* arrays are ignored, mirroring the compiler's `node.children.length` check
|
|
7939
|
+
* for `v-html` / `v-text`.
|
|
7940
|
+
*/
|
|
7941
|
+
function hasContentChildren(children) {
|
|
7942
|
+
if (isString(children)) return children !== "";
|
|
7943
|
+
if (isArray(children)) return children.length > 0;
|
|
7944
|
+
return false;
|
|
7945
|
+
}
|
|
7710
7946
|
const createVNode = createVNodeWithArgsTransform;
|
|
7711
7947
|
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
|
|
7712
7948
|
if (!type || type === NULL_DYNAMIC_COMPONENT) {
|
|
@@ -7716,8 +7952,10 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
7716
7952
|
if (isVNode(type)) {
|
|
7717
7953
|
const cloned = cloneVNode(type, props, true);
|
|
7718
7954
|
if (children) normalizeChildren(cloned, children);
|
|
7719
|
-
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock)
|
|
7720
|
-
|
|
7955
|
+
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
|
|
7956
|
+
if (cloned.shapeFlag & 6) currentBlock[currentBlock.indexOf(type)] = cloned;
|
|
7957
|
+
else currentBlock.push(cloned);
|
|
7958
|
+
}
|
|
7721
7959
|
cloned.patchFlag = -2;
|
|
7722
7960
|
return cloned;
|
|
7723
7961
|
}
|
|
@@ -7777,7 +8015,10 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
7777
8015
|
ce: vnode.ce,
|
|
7778
8016
|
vi: vnode.vi,
|
|
7779
8017
|
vs: cloneVaporSlotMeta(vnode),
|
|
7780
|
-
vb: vnode.vb
|
|
8018
|
+
vb: vnode.vb,
|
|
8019
|
+
ibu: vnode.ibu,
|
|
8020
|
+
iu: vnode.iu,
|
|
8021
|
+
cacheIndex: vnode.cacheIndex
|
|
7781
8022
|
};
|
|
7782
8023
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
7783
8024
|
return cloned;
|
|
@@ -7787,8 +8028,7 @@ function cloneVaporSlotMeta(vnode) {
|
|
|
7787
8028
|
if (!vaporSlot) return vaporSlot;
|
|
7788
8029
|
const cloned = {
|
|
7789
8030
|
slot: vaporSlot.slot,
|
|
7790
|
-
|
|
7791
|
-
outletFallback: vaporSlot.outletFallback
|
|
8031
|
+
outlets: vaporSlot.outlets
|
|
7792
8032
|
};
|
|
7793
8033
|
if (vnode.el) {
|
|
7794
8034
|
cloned.state = vaporSlot.state;
|
|
@@ -7840,25 +8080,28 @@ function normalizeChildren(vnode, children) {
|
|
|
7840
8080
|
const { shapeFlag } = vnode;
|
|
7841
8081
|
if (children == null) children = null;
|
|
7842
8082
|
else if (isArray(children)) type = 16;
|
|
7843
|
-
else if (typeof children === "object")
|
|
7844
|
-
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
|
|
7849
|
-
|
|
7850
|
-
|
|
7851
|
-
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
|
|
7857
|
-
|
|
7858
|
-
|
|
8083
|
+
else if (typeof children === "object") {
|
|
8084
|
+
if (shapeFlag & 65) {
|
|
8085
|
+
const slot = children.default;
|
|
8086
|
+
if (slot) {
|
|
8087
|
+
slot._c && (slot._d = false);
|
|
8088
|
+
normalizeChildren(vnode, slot());
|
|
8089
|
+
slot._c && (slot._d = true);
|
|
8090
|
+
}
|
|
8091
|
+
return;
|
|
8092
|
+
} else {
|
|
8093
|
+
type = 32;
|
|
8094
|
+
const slotFlag = children._;
|
|
8095
|
+
if (!slotFlag && !isInternalObject(children)) children._ctx = currentRenderingInstance;
|
|
8096
|
+
else if (slotFlag === 3 && currentRenderingInstance) {
|
|
8097
|
+
if (currentRenderingInstance.slots._ === 1) children._ = 1;
|
|
8098
|
+
else {
|
|
8099
|
+
children._ = 2;
|
|
8100
|
+
vnode.patchFlag |= 1024;
|
|
8101
|
+
}
|
|
8102
|
+
}
|
|
7859
8103
|
}
|
|
7860
|
-
}
|
|
7861
|
-
else if (isFunction(children)) {
|
|
8104
|
+
} else if (isFunction(children)) {
|
|
7862
8105
|
if (shapeFlag & 65) {
|
|
7863
8106
|
normalizeChildren(vnode, { default: children });
|
|
7864
8107
|
return;
|
|
@@ -7926,6 +8169,16 @@ const setCurrentInstance = (instance, scope = instance !== null ? instance.scope
|
|
|
7926
8169
|
simpleSetCurrentInstance(instance);
|
|
7927
8170
|
}
|
|
7928
8171
|
};
|
|
8172
|
+
/**
|
|
8173
|
+
* Restores a snapshot returned by {@link setCurrentInstance}. Unlike calling
|
|
8174
|
+
* `setCurrentInstance(...prev)`, an `undefined` saved scope is restored
|
|
8175
|
+
* verbatim instead of re-triggering the `instance.scope` default.
|
|
8176
|
+
* @internal
|
|
8177
|
+
*/
|
|
8178
|
+
const restoreCurrentInstance = (prev) => {
|
|
8179
|
+
setCurrentScope(prev[1]);
|
|
8180
|
+
simpleSetCurrentInstance(prev[0]);
|
|
8181
|
+
};
|
|
7929
8182
|
const internalOptions = [
|
|
7930
8183
|
"ce",
|
|
7931
8184
|
"type",
|
|
@@ -7957,7 +8210,7 @@ const useInstanceOption = (key, silent = false) => {
|
|
|
7957
8210
|
};
|
|
7958
8211
|
//#endregion
|
|
7959
8212
|
//#region packages/runtime-core/src/component.ts
|
|
7960
|
-
const emptyAppContext =
|
|
8213
|
+
const emptyAppContext = /*@__PURE__*/ createAppContext();
|
|
7961
8214
|
let uid = 0;
|
|
7962
8215
|
function createComponentInstance(vnode, parent, suspense) {
|
|
7963
8216
|
const type = vnode.type;
|
|
@@ -8077,7 +8330,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
8077
8330
|
const setupResult = callWithErrorHandling(setup, instance, 0, [/* @__PURE__ */ shallowReadonly(instance.props), setupContext]);
|
|
8078
8331
|
const isAsyncSetup = isPromise(setupResult);
|
|
8079
8332
|
setActiveSub(prevSub);
|
|
8080
|
-
|
|
8333
|
+
restoreCurrentInstance(prev);
|
|
8081
8334
|
if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) markAsyncBoundary(instance);
|
|
8082
8335
|
if (isAsyncSetup) {
|
|
8083
8336
|
const unsetCurrentInstance = () => {
|
|
@@ -8085,7 +8338,12 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
8085
8338
|
};
|
|
8086
8339
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
8087
8340
|
if (isSSR) return setupResult.then((resolvedResult) => {
|
|
8088
|
-
|
|
8341
|
+
setInSSRSetupState(true);
|
|
8342
|
+
try {
|
|
8343
|
+
handleSetupResult(instance, resolvedResult, isSSR);
|
|
8344
|
+
} finally {
|
|
8345
|
+
setInSSRSetupState(false);
|
|
8346
|
+
}
|
|
8089
8347
|
}).catch((e) => {
|
|
8090
8348
|
handleError(e, instance, 0);
|
|
8091
8349
|
});
|
|
@@ -8146,13 +8404,15 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
8146
8404
|
applyOptions(instance);
|
|
8147
8405
|
} finally {
|
|
8148
8406
|
setActiveSub(prevSub);
|
|
8149
|
-
|
|
8407
|
+
restoreCurrentInstance(prevInstance);
|
|
8150
8408
|
}
|
|
8151
8409
|
}
|
|
8152
|
-
if (!Component.render && instance.render === NOOP && !isSSR)
|
|
8410
|
+
if (!Component.render && instance.render === NOOP && !isSSR) {
|
|
8411
|
+
if (!compile && Component.template)
|
|
8153
8412
|
/* v8 ignore start */
|
|
8154
|
-
|
|
8155
|
-
|
|
8413
|
+
warn$1("Component provided template option but runtime compilation is not supported in this build of Vue. Use \"vue.esm-browser.js\" instead.");
|
|
8414
|
+
else warn$1(`Component is missing template or render function: `, Component);
|
|
8415
|
+
}
|
|
8156
8416
|
}
|
|
8157
8417
|
const attrsProxyHandlers = {
|
|
8158
8418
|
get(target, key) {
|
|
@@ -8215,14 +8475,13 @@ function getComponentPublicInstance(instance) {
|
|
|
8215
8475
|
if (instance.exposed) return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
|
|
8216
8476
|
get(target, key) {
|
|
8217
8477
|
if (key in target) return target[key];
|
|
8218
|
-
else {
|
|
8478
|
+
else if (!instance.vapor) {
|
|
8219
8479
|
const publicPropertiesMap = getPublicPropertiesMap();
|
|
8220
8480
|
if (key in publicPropertiesMap) return publicPropertiesMap[key](instance);
|
|
8221
8481
|
}
|
|
8222
8482
|
},
|
|
8223
8483
|
has(target, key) {
|
|
8224
|
-
|
|
8225
|
-
return key in target || key in publicPropertiesMap;
|
|
8484
|
+
return key in target || !instance.vapor && key in getPublicPropertiesMap();
|
|
8226
8485
|
}
|
|
8227
8486
|
}));
|
|
8228
8487
|
else return instance.proxy;
|
|
@@ -8260,11 +8519,12 @@ function h(type, propsOrChildren, children) {
|
|
|
8260
8519
|
try {
|
|
8261
8520
|
setBlockTracking(-1);
|
|
8262
8521
|
const l = arguments.length;
|
|
8263
|
-
if (l === 2)
|
|
8264
|
-
if (
|
|
8265
|
-
|
|
8266
|
-
|
|
8267
|
-
|
|
8522
|
+
if (l === 2) {
|
|
8523
|
+
if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
|
|
8524
|
+
if (isVNode(propsOrChildren)) return createVNode(type, null, [propsOrChildren]);
|
|
8525
|
+
return createVNode(type, propsOrChildren);
|
|
8526
|
+
} else return createVNode(type, null, propsOrChildren);
|
|
8527
|
+
} else {
|
|
8268
8528
|
if (l > 3) children = Array.prototype.slice.call(arguments, 2);
|
|
8269
8529
|
else if (l === 3 && isVNode(children)) children = [children];
|
|
8270
8530
|
return createVNode(type, propsOrChildren, children);
|
|
@@ -8456,7 +8716,7 @@ function isMemoSame(cached, memo) {
|
|
|
8456
8716
|
}
|
|
8457
8717
|
//#endregion
|
|
8458
8718
|
//#region packages/runtime-core/src/index.ts
|
|
8459
|
-
const version = "3.6.0-rc.
|
|
8719
|
+
const version = "3.6.0-rc.11";
|
|
8460
8720
|
const warn = warn$1;
|
|
8461
8721
|
/**
|
|
8462
8722
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -8484,7 +8744,7 @@ const DeprecationTypes = null;
|
|
|
8484
8744
|
let policy = void 0;
|
|
8485
8745
|
const tt = typeof window !== "undefined" && window.trustedTypes;
|
|
8486
8746
|
if (tt) try {
|
|
8487
|
-
policy =
|
|
8747
|
+
policy = /*@__PURE__*/ tt.createPolicy("vue", { createHTML: (val) => val });
|
|
8488
8748
|
} catch (e) {
|
|
8489
8749
|
warn(`Error creating trusted types policy: ${e}`);
|
|
8490
8750
|
}
|
|
@@ -8492,7 +8752,7 @@ const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) =>
|
|
|
8492
8752
|
const svgNS = "http://www.w3.org/2000/svg";
|
|
8493
8753
|
const mathmlNS = "http://www.w3.org/1998/Math/MathML";
|
|
8494
8754
|
const doc = typeof document !== "undefined" ? document : null;
|
|
8495
|
-
const templateContainer = doc &&
|
|
8755
|
+
const templateContainer = doc && /*@__PURE__*/ doc.createElement("template");
|
|
8496
8756
|
const nodeOps = {
|
|
8497
8757
|
insert: (child, parent, anchor) => {
|
|
8498
8758
|
parent.insertBefore(child, anchor || null);
|
|
@@ -8566,7 +8826,7 @@ const DOMTransitionPropsValidators = {
|
|
|
8566
8826
|
leaveActiveClass: String,
|
|
8567
8827
|
leaveToClass: String
|
|
8568
8828
|
};
|
|
8569
|
-
const TransitionPropsValidators =
|
|
8829
|
+
const TransitionPropsValidators = /*@__PURE__*/ extend({}, BaseTransitionPropsValidators, DOMTransitionPropsValidators);
|
|
8570
8830
|
/**
|
|
8571
8831
|
* Wrap logic that attaches extra properties to Transition in a function
|
|
8572
8832
|
* so that it can be annotated as pure
|
|
@@ -8580,7 +8840,7 @@ const decorate$1 = (t) => {
|
|
|
8580
8840
|
* DOM Transition is a higher-order-component based on the platform-agnostic
|
|
8581
8841
|
* base Transition component, with DOM-specific logic.
|
|
8582
8842
|
*/
|
|
8583
|
-
const Transition =
|
|
8843
|
+
const Transition = /*@__PURE__*/ decorate$1((props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots));
|
|
8584
8844
|
/**
|
|
8585
8845
|
* #3227 Incoming hooks may be merged into arrays when wrapping Transition
|
|
8586
8846
|
* with custom HOCs.
|
|
@@ -8802,14 +9062,15 @@ const vShow = {
|
|
|
8802
9062
|
},
|
|
8803
9063
|
updated(el, { value, oldValue }, { transition }) {
|
|
8804
9064
|
if (!value === !oldValue) return;
|
|
8805
|
-
if (transition)
|
|
8806
|
-
|
|
8807
|
-
|
|
8808
|
-
|
|
8809
|
-
|
|
8810
|
-
|
|
8811
|
-
|
|
8812
|
-
|
|
9065
|
+
if (transition) {
|
|
9066
|
+
if (value) {
|
|
9067
|
+
transition.beforeEnter(el);
|
|
9068
|
+
setDisplay(el, true);
|
|
9069
|
+
transition.enter(el);
|
|
9070
|
+
} else transition.leave(el, () => {
|
|
9071
|
+
setDisplay(el, false);
|
|
9072
|
+
});
|
|
9073
|
+
} else setDisplay(el, value);
|
|
8813
9074
|
},
|
|
8814
9075
|
beforeUnmount(el, { value }) {
|
|
8815
9076
|
setDisplay(el, value);
|
|
@@ -8828,49 +9089,20 @@ const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT");
|
|
|
8828
9089
|
*/
|
|
8829
9090
|
function useCssVars(getter) {
|
|
8830
9091
|
const instance = getCurrentInstance();
|
|
8831
|
-
const getVars = () => getter(instance.proxy);
|
|
8832
|
-
const setVars = (vars) => {
|
|
8833
|
-
if (instance.ce) setVarsOnNode(instance.ce, vars);
|
|
8834
|
-
else setVarsOnVNode(instance.subTree, vars);
|
|
8835
|
-
};
|
|
8836
|
-
baseUseCssVars(instance, () => instance.subTree.el.parentNode, getVars, setVars);
|
|
8837
|
-
}
|
|
8838
|
-
function setVarsOnVNode(vnode, vars) {
|
|
8839
|
-
if (vnode.shapeFlag & 128) {
|
|
8840
|
-
const suspense = vnode.suspense;
|
|
8841
|
-
vnode = suspense.activeBranch;
|
|
8842
|
-
if (suspense.pendingBranch && !suspense.isHydrating) suspense.effects.push(() => {
|
|
8843
|
-
setVarsOnVNode(suspense.activeBranch, vars);
|
|
8844
|
-
});
|
|
8845
|
-
}
|
|
8846
|
-
while (vnode.component) vnode = vnode.component.subTree;
|
|
8847
|
-
if (vnode.shapeFlag & 1 && vnode.el) setVarsOnNode(vnode.el, vars);
|
|
8848
|
-
else if (vnode.type === Fragment) vnode.children.forEach((c) => setVarsOnVNode(c, vars));
|
|
8849
|
-
else if (vnode.type === Static) {
|
|
8850
|
-
let { el, anchor } = vnode;
|
|
8851
|
-
while (el) {
|
|
8852
|
-
setVarsOnNode(el, vars);
|
|
8853
|
-
if (el === anchor) break;
|
|
8854
|
-
el = el.nextSibling;
|
|
8855
|
-
}
|
|
8856
|
-
}
|
|
8857
|
-
}
|
|
8858
|
-
/**
|
|
8859
|
-
* @internal
|
|
8860
|
-
* shared between vdom and vapor
|
|
8861
|
-
*/
|
|
8862
|
-
function baseUseCssVars(instance, getParentNode, getVars, setVars) {
|
|
8863
9092
|
/* v8 ignore start */
|
|
8864
9093
|
if (!instance) {
|
|
8865
9094
|
warn(`useCssVars is called without current active component instance.`);
|
|
8866
9095
|
return;
|
|
8867
9096
|
}
|
|
9097
|
+
/* v8 ignore stop */
|
|
9098
|
+
const getVars = () => getter(instance.proxy);
|
|
8868
9099
|
instance.getCssVars = getVars;
|
|
8869
9100
|
const updateTeleports = instance.ut = (vars = getVars()) => {
|
|
8870
9101
|
Array.from(document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)).forEach((node) => setVarsOnNode(node, vars));
|
|
8871
9102
|
};
|
|
8872
9103
|
const applyCssVars = (vars = getVars()) => {
|
|
8873
|
-
|
|
9104
|
+
if (instance.ce) setVarsOnNode(instance.ce, vars);
|
|
9105
|
+
else setVarsOnVNode(instance.subTree, vars);
|
|
8874
9106
|
updateTeleports(vars);
|
|
8875
9107
|
};
|
|
8876
9108
|
onBeforeUpdate(() => {
|
|
@@ -8883,10 +9115,38 @@ function baseUseCssVars(instance, getParentNode, getVars, setVars) {
|
|
|
8883
9115
|
applyCssVars(vars);
|
|
8884
9116
|
}, NOOP, { flush: "post" });
|
|
8885
9117
|
const ob = new MutationObserver(() => applyCssVars());
|
|
8886
|
-
ob.observe(
|
|
9118
|
+
ob.observe(instance.subTree.el.parentNode, { childList: true });
|
|
8887
9119
|
onUnmounted(() => ob.disconnect());
|
|
8888
9120
|
});
|
|
8889
9121
|
}
|
|
9122
|
+
function setVarsOnVNode(vnode, vars) {
|
|
9123
|
+
if (vnode.shapeFlag & 128) {
|
|
9124
|
+
const suspense = vnode.suspense;
|
|
9125
|
+
vnode = suspense.activeBranch;
|
|
9126
|
+
if (suspense.pendingBranch && !suspense.isHydrating) suspense.effects.push(() => {
|
|
9127
|
+
setVarsOnVNode(suspense.activeBranch, vars);
|
|
9128
|
+
});
|
|
9129
|
+
}
|
|
9130
|
+
while (vnode.component) {
|
|
9131
|
+
const component = vnode.component;
|
|
9132
|
+
if (component.vapor) {
|
|
9133
|
+
component.appContext.vapor.applyCssVars(vnode, vars);
|
|
9134
|
+
return;
|
|
9135
|
+
}
|
|
9136
|
+
vnode = vnode.component.subTree;
|
|
9137
|
+
}
|
|
9138
|
+
if (vnode.shapeFlag & 1 && vnode.el) setVarsOnNode(vnode.el, vars);
|
|
9139
|
+
else if (vnode.vb) vnode.ctx.appContext.vapor.applyCssVars(vnode, vars);
|
|
9140
|
+
else if (vnode.type === Fragment) vnode.children.forEach((c) => setVarsOnVNode(c, vars));
|
|
9141
|
+
else if (vnode.type === Static) {
|
|
9142
|
+
let { el, anchor } = vnode;
|
|
9143
|
+
while (el) {
|
|
9144
|
+
setVarsOnNode(el, vars);
|
|
9145
|
+
if (el === anchor) break;
|
|
9146
|
+
el = el.nextSibling;
|
|
9147
|
+
}
|
|
9148
|
+
}
|
|
9149
|
+
}
|
|
8890
9150
|
/**
|
|
8891
9151
|
* @internal
|
|
8892
9152
|
* shared between vdom and vapor
|
|
@@ -8911,11 +9171,13 @@ function patchStyle(el, prev, next) {
|
|
|
8911
9171
|
const isCssString = isString(next);
|
|
8912
9172
|
let hasControlledDisplay = false;
|
|
8913
9173
|
if (next && !isCssString) {
|
|
8914
|
-
if (prev)
|
|
8915
|
-
|
|
8916
|
-
|
|
8917
|
-
|
|
8918
|
-
|
|
9174
|
+
if (prev) {
|
|
9175
|
+
if (!isString(prev)) {
|
|
9176
|
+
for (const key in prev) if (next[key] == null) setStyle(style, key, "");
|
|
9177
|
+
} else for (const prevStyle of prev.split(";")) {
|
|
9178
|
+
const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
|
|
9179
|
+
if (next[key] == null) setStyle(style, key, "");
|
|
9180
|
+
}
|
|
8919
9181
|
}
|
|
8920
9182
|
for (const key in next) {
|
|
8921
9183
|
if (key === "display") hasControlledDisplay = true;
|
|
@@ -8931,7 +9193,11 @@ function patchStyle(el, prev, next) {
|
|
|
8931
9193
|
style.cssText = next;
|
|
8932
9194
|
hasControlledDisplay = displayRE.test(next);
|
|
8933
9195
|
}
|
|
8934
|
-
} else if (prev)
|
|
9196
|
+
} else if (prev) {
|
|
9197
|
+
const cssVarText = style[CSS_VAR_TEXT];
|
|
9198
|
+
if (cssVarText) style.cssText = cssVarText;
|
|
9199
|
+
else el.removeAttribute("style");
|
|
9200
|
+
}
|
|
8935
9201
|
if (vShowOriginalDisplay in el) {
|
|
8936
9202
|
el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
|
|
8937
9203
|
if (el[vShowHidden]) style.display = "none";
|
|
@@ -8944,8 +9210,10 @@ function setStyle(style, name, rawVal) {
|
|
|
8944
9210
|
else {
|
|
8945
9211
|
const val = rawVal == null ? "" : String(rawVal);
|
|
8946
9212
|
if (semicolonRE.test(val)) warn(`Unexpected semicolon at the end of '${name}' style value: '${val}'`);
|
|
8947
|
-
if (name.startsWith("--"))
|
|
8948
|
-
|
|
9213
|
+
if (name.startsWith("--")) {
|
|
9214
|
+
if (importantRE.test(val)) style.setProperty(name, val.replace(importantRE, ""), "important");
|
|
9215
|
+
else style.setProperty(name, val);
|
|
9216
|
+
} else {
|
|
8949
9217
|
const prefixed = autoPrefix(style, name);
|
|
8950
9218
|
if (importantRE.test(val)) style.setProperty(hyphenate(prefixed), val.replace(importantRE, ""), "important");
|
|
8951
9219
|
else style[prefixed] = val;
|
|
@@ -8982,9 +9250,10 @@ function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
|
|
|
8982
9250
|
//#region packages/runtime-dom/src/modules/attrs.ts
|
|
8983
9251
|
const xlinkNS = "http://www.w3.org/1999/xlink";
|
|
8984
9252
|
function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {
|
|
8985
|
-
if (isSVG && key.startsWith("xlink:"))
|
|
8986
|
-
|
|
8987
|
-
|
|
9253
|
+
if (isSVG && key.startsWith("xlink:")) {
|
|
9254
|
+
if (value == null) el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
|
|
9255
|
+
else el.setAttributeNS(xlinkNS, key, value);
|
|
9256
|
+
} else if (value == null || isBoolean && !includeBooleanAttr(value)) el.removeAttribute(key);
|
|
8988
9257
|
else el.setAttribute(key, isBoolean ? "" : isSymbol(value) ? String(value) : value);
|
|
8989
9258
|
}
|
|
8990
9259
|
//#endregion
|
|
@@ -9057,7 +9326,7 @@ function parseEventName(name) {
|
|
|
9057
9326
|
return [name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2)), options];
|
|
9058
9327
|
}
|
|
9059
9328
|
let cachedNow = 0;
|
|
9060
|
-
const p =
|
|
9329
|
+
const p = /*@__PURE__*/ Promise.resolve();
|
|
9061
9330
|
const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
|
|
9062
9331
|
function createInvoker(initialValue, instance) {
|
|
9063
9332
|
const invoker = (e) => {
|
|
@@ -9125,7 +9394,7 @@ function shouldSetAsPropForVueCE(el, key) {
|
|
|
9125
9394
|
//#endregion
|
|
9126
9395
|
//#region packages/runtime-dom/src/apiCustomElement.ts
|
|
9127
9396
|
const REMOVAL = {};
|
|
9128
|
-
|
|
9397
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
9129
9398
|
function defineCustomElement(options, extraOptions, _createApp) {
|
|
9130
9399
|
let Comp = /* @__PURE__ */ defineComponent(options, extraOptions);
|
|
9131
9400
|
if (isPlainObject(Comp)) Comp = extend({}, Comp, extraOptions);
|
|
@@ -9174,12 +9443,14 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
9174
9443
|
this._parent = parent;
|
|
9175
9444
|
break;
|
|
9176
9445
|
}
|
|
9177
|
-
if (!this._instance)
|
|
9178
|
-
|
|
9179
|
-
this._pendingResolve =
|
|
9180
|
-
|
|
9181
|
-
|
|
9182
|
-
|
|
9446
|
+
if (!this._instance) {
|
|
9447
|
+
if (this._resolved) this._mountComponent(this._def);
|
|
9448
|
+
else if (parent && parent._pendingResolve) this._pendingResolve = parent._pendingResolve.then(() => {
|
|
9449
|
+
this._pendingResolve = void 0;
|
|
9450
|
+
if (this.isConnected) return this._resolveDef();
|
|
9451
|
+
});
|
|
9452
|
+
else this._resolveDef();
|
|
9453
|
+
}
|
|
9183
9454
|
}
|
|
9184
9455
|
disconnectedCallback() {
|
|
9185
9456
|
this._connected = false;
|
|
@@ -9213,7 +9484,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
9213
9484
|
* resolve inner component definition (handle possible async component)
|
|
9214
9485
|
*/
|
|
9215
9486
|
_resolveDef() {
|
|
9216
|
-
if (this._pendingResolve) return;
|
|
9487
|
+
if (this._pendingResolve) return this._pendingResolve;
|
|
9217
9488
|
for (let i = 0; i < this.attributes.length; i++) this._setAttr(this.attributes[i].name);
|
|
9218
9489
|
this._ob = new MutationObserver(this._processMutations.bind(this));
|
|
9219
9490
|
this._ob.observe(this, { attributes: true });
|
|
@@ -9243,6 +9514,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
9243
9514
|
this._def = def;
|
|
9244
9515
|
resolve(def);
|
|
9245
9516
|
});
|
|
9517
|
+
return this._pendingResolve;
|
|
9246
9518
|
} else resolve(this._def);
|
|
9247
9519
|
}
|
|
9248
9520
|
_mountComponent(def) {
|
|
@@ -9281,14 +9553,17 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
9281
9553
|
const { props } = def;
|
|
9282
9554
|
const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
|
|
9283
9555
|
for (const key of Object.keys(this)) if (key[0] !== "_" && declaredPropKeys.includes(key)) this._setProp(key, this[key]);
|
|
9284
|
-
for (const key of declaredPropKeys.map(camelize))
|
|
9285
|
-
|
|
9286
|
-
|
|
9287
|
-
|
|
9288
|
-
|
|
9289
|
-
|
|
9290
|
-
|
|
9291
|
-
|
|
9556
|
+
for (const key of declaredPropKeys.map(camelize)) {
|
|
9557
|
+
if (key in Object.getPrototypeOf(this)) warn(`Custom element prop "${key}" conflicts with an existing property on the element and will overwrite it.`);
|
|
9558
|
+
Object.defineProperty(this, key, {
|
|
9559
|
+
get() {
|
|
9560
|
+
return this._getProp(key);
|
|
9561
|
+
},
|
|
9562
|
+
set(val) {
|
|
9563
|
+
this._setProp(key, val, true, !this._patching);
|
|
9564
|
+
}
|
|
9565
|
+
});
|
|
9566
|
+
}
|
|
9292
9567
|
}
|
|
9293
9568
|
_setAttr(key) {
|
|
9294
9569
|
if (key.startsWith("data-v-")) return;
|
|
@@ -9391,13 +9666,11 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
9391
9666
|
_renderSlots() {
|
|
9392
9667
|
const outlets = this._getSlots();
|
|
9393
9668
|
const scopeId = this._instance.type.__scopeId;
|
|
9394
|
-
const slotReplacements = /* @__PURE__ */ new Map();
|
|
9395
9669
|
for (let i = 0; i < outlets.length; i++) {
|
|
9396
9670
|
const o = outlets[i];
|
|
9397
9671
|
const slotName = o.getAttribute("name") || "default";
|
|
9398
9672
|
const content = this._slots[slotName];
|
|
9399
9673
|
const parent = o.parentNode;
|
|
9400
|
-
const replacementNodes = [];
|
|
9401
9674
|
if (content) for (const n of content) {
|
|
9402
9675
|
if (scopeId && n.nodeType === 1) {
|
|
9403
9676
|
const id = scopeId + "-s";
|
|
@@ -9407,20 +9680,10 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
9407
9680
|
while (child = walker.nextNode()) child.setAttribute(id, "");
|
|
9408
9681
|
}
|
|
9409
9682
|
parent.insertBefore(n, o);
|
|
9410
|
-
replacementNodes.push(n);
|
|
9411
|
-
}
|
|
9412
|
-
else while (o.firstChild) {
|
|
9413
|
-
const child = o.firstChild;
|
|
9414
|
-
parent.insertBefore(child, o);
|
|
9415
|
-
replacementNodes.push(child);
|
|
9416
9683
|
}
|
|
9684
|
+
else while (o.firstChild) parent.insertBefore(o.firstChild, o);
|
|
9417
9685
|
parent.removeChild(o);
|
|
9418
|
-
slotReplacements.set(o, {
|
|
9419
|
-
nodes: replacementNodes,
|
|
9420
|
-
usedFallback: !content
|
|
9421
|
-
});
|
|
9422
9686
|
}
|
|
9423
|
-
this._updateSlotNodes(slotReplacements);
|
|
9424
9687
|
}
|
|
9425
9688
|
/**
|
|
9426
9689
|
* @internal
|
|
@@ -9459,7 +9722,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
9459
9722
|
* @internal
|
|
9460
9723
|
*/
|
|
9461
9724
|
_hasShadowRoot() {
|
|
9462
|
-
return this.
|
|
9725
|
+
return this._root !== this;
|
|
9463
9726
|
}
|
|
9464
9727
|
/**
|
|
9465
9728
|
* @internal
|
|
@@ -9504,10 +9767,6 @@ var VueElement = class extends VueElementBase {
|
|
|
9504
9767
|
if (this._instance && this._instance.ce) this._instance.ce = void 0;
|
|
9505
9768
|
this._app = this._instance = null;
|
|
9506
9769
|
}
|
|
9507
|
-
/**
|
|
9508
|
-
* Only called when shadowRoot is false
|
|
9509
|
-
*/
|
|
9510
|
-
_updateSlotNodes(replacements) {}
|
|
9511
9770
|
_createVNode() {
|
|
9512
9771
|
const baseProps = {};
|
|
9513
9772
|
if (!this.shadowRoot) baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this);
|
|
@@ -9573,7 +9832,7 @@ const decorate = (t) => {
|
|
|
9573
9832
|
};
|
|
9574
9833
|
const TransitionGroup = /* @__PURE__ */ decorate({
|
|
9575
9834
|
name: "TransitionGroup",
|
|
9576
|
-
props:
|
|
9835
|
+
props: /*@__PURE__*/ extend({}, TransitionPropsValidators, {
|
|
9577
9836
|
tag: String,
|
|
9578
9837
|
moveClass: String
|
|
9579
9838
|
}),
|
|
@@ -9704,13 +9963,22 @@ function onCompositionEnd(e) {
|
|
|
9704
9963
|
}
|
|
9705
9964
|
}
|
|
9706
9965
|
const assignKey = Symbol("_assign");
|
|
9966
|
+
const initialValueKey = Symbol("_initialValue");
|
|
9707
9967
|
const vModelText = {
|
|
9708
9968
|
created(el, { modifiers: { lazy, trim, number } }, vnode) {
|
|
9969
|
+
if (el.parentNode) {
|
|
9970
|
+
if (el.type === "text") el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
|
|
9971
|
+
else if (el.type === "textarea") el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
|
|
9972
|
+
}
|
|
9709
9973
|
el[assignKey] = getModelAssigner(vnode);
|
|
9710
9974
|
vModelTextInit(el, trim, number || !!(vnode.props && vnode.props.type === "number"), lazy);
|
|
9711
9975
|
},
|
|
9712
|
-
mounted(el, { value }) {
|
|
9713
|
-
|
|
9976
|
+
mounted(el, { value, modifiers: { trim, number } }) {
|
|
9977
|
+
const newValue = value == null ? "" : value;
|
|
9978
|
+
const initialValue = el[initialValueKey];
|
|
9979
|
+
delete el[initialValueKey];
|
|
9980
|
+
if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) el[assignKey](castValue(el.value, trim, number));
|
|
9981
|
+
else el.value = newValue;
|
|
9714
9982
|
},
|
|
9715
9983
|
beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
|
|
9716
9984
|
el[assignKey] = getModelAssigner(vnode);
|
|
@@ -9845,19 +10113,39 @@ const vModelSelectInit = (el, value, number, set) => {
|
|
|
9845
10113
|
el._modelValue = value;
|
|
9846
10114
|
addEventListener(el, "change", () => {
|
|
9847
10115
|
const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map((o) => number ? looseToNumber(getValue(o)) : getValue(o));
|
|
9848
|
-
|
|
9849
|
-
el.
|
|
9850
|
-
|
|
9851
|
-
|
|
9852
|
-
|
|
10116
|
+
const multiple = el.multiple;
|
|
10117
|
+
const assignedValue = multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0];
|
|
10118
|
+
const pending = el._pendingValue = [multiple, multiple ? isArray(assignedValue) ? selectedVal.slice() : selectedVal : assignedValue];
|
|
10119
|
+
try {
|
|
10120
|
+
(set || el[assignKey])(assignedValue);
|
|
10121
|
+
} finally {
|
|
10122
|
+
nextTick(() => {
|
|
10123
|
+
if (el._pendingValue === pending) el._pendingValue = void 0;
|
|
10124
|
+
});
|
|
10125
|
+
}
|
|
9853
10126
|
});
|
|
9854
10127
|
};
|
|
10128
|
+
function isSameSelectValue(value, assignedValue, multiple) {
|
|
10129
|
+
if (!multiple) return looseEqual(value, assignedValue);
|
|
10130
|
+
if (isArray(value)) return looseEqual(value, assignedValue);
|
|
10131
|
+
if (isSet(value)) {
|
|
10132
|
+
if (value.size !== assignedValue.length) return false;
|
|
10133
|
+
for (const item of assignedValue) if (!value.has(item)) return false;
|
|
10134
|
+
return true;
|
|
10135
|
+
}
|
|
10136
|
+
return false;
|
|
10137
|
+
}
|
|
9855
10138
|
/**
|
|
9856
10139
|
* @internal
|
|
9857
10140
|
*/
|
|
9858
10141
|
const vModelSetSelected = (el, value) => {
|
|
9859
10142
|
el._modelValue = value;
|
|
9860
|
-
|
|
10143
|
+
const pending = el._pendingValue;
|
|
10144
|
+
el._pendingValue = void 0;
|
|
10145
|
+
if (pending && pending[0] === el.multiple && isSameSelectValue(value, pending[1], pending[0])) return;
|
|
10146
|
+
setSelected(el, value);
|
|
10147
|
+
};
|
|
10148
|
+
function setSelected(el, value) {
|
|
9861
10149
|
const isMultiple = el.multiple;
|
|
9862
10150
|
const isArrayValue = isArray(value);
|
|
9863
10151
|
if (isMultiple && !isArrayValue && !isSet(value)) {
|
|
@@ -9867,18 +10155,19 @@ const vModelSetSelected = (el, value) => {
|
|
|
9867
10155
|
for (let i = 0, l = el.options.length; i < l; i++) {
|
|
9868
10156
|
const option = el.options[i];
|
|
9869
10157
|
const optionValue = getValue(option);
|
|
9870
|
-
if (isMultiple)
|
|
9871
|
-
|
|
9872
|
-
|
|
9873
|
-
|
|
9874
|
-
|
|
9875
|
-
|
|
10158
|
+
if (isMultiple) {
|
|
10159
|
+
if (isArrayValue) {
|
|
10160
|
+
const optionType = typeof optionValue;
|
|
10161
|
+
if (optionType === "string" || optionType === "number") option.selected = value.some((v) => String(v) === String(optionValue));
|
|
10162
|
+
else option.selected = looseIndexOf(value, optionValue) > -1;
|
|
10163
|
+
} else option.selected = value.has(optionValue);
|
|
10164
|
+
} else if (looseEqual(getValue(option), value)) {
|
|
9876
10165
|
if (el.selectedIndex !== i) el.selectedIndex = i;
|
|
9877
10166
|
return;
|
|
9878
10167
|
}
|
|
9879
10168
|
}
|
|
9880
10169
|
if (!isMultiple && el.selectedIndex !== -1) el.selectedIndex = -1;
|
|
9881
|
-
}
|
|
10170
|
+
}
|
|
9882
10171
|
/**
|
|
9883
10172
|
* @internal retrieve raw value set via :value bindings
|
|
9884
10173
|
*/
|
|
@@ -9980,7 +10269,7 @@ const withKeys = (fn, modifiers) => {
|
|
|
9980
10269
|
};
|
|
9981
10270
|
//#endregion
|
|
9982
10271
|
//#region packages/runtime-dom/src/index.ts
|
|
9983
|
-
const rendererOptions =
|
|
10272
|
+
const rendererOptions = /*@__PURE__*/ extend({ patchProp }, nodeOps);
|
|
9984
10273
|
let renderer;
|
|
9985
10274
|
let enabledHydration = false;
|
|
9986
10275
|
function ensureRenderer() {
|