@structured-field/widget-editor 1.0.0 → 1.0.3
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/structured-widget-editor.esm.js +547 -2220
- package/dist/structured-widget-editor.esm.js.map +1 -1
- package/dist/structured-widget-editor.iife.js +4 -9
- package/dist/structured-widget-editor.js +4 -9
- package/dist/structured-widget-editor.js.map +1 -1
- package/package.json +7 -2
- package/src/SchemaForm.vue +1 -0
- package/src/editors/ArrayEditor.vue +6 -2
- package/src/editors/NullableEditor.vue +6 -2
- package/src/editors/ObjectEditor.vue +5 -2
- package/src/editors/UnionEditor.vue +6 -2
- package/src/index.js +5 -132
|
@@ -46,8 +46,8 @@ function makeMap(str) {
|
|
|
46
46
|
return (val) => val in map;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
const EMPTY_OBJ =
|
|
50
|
-
const EMPTY_ARR =
|
|
49
|
+
const EMPTY_OBJ = {};
|
|
50
|
+
const EMPTY_ARR = [];
|
|
51
51
|
const NOOP = () => {
|
|
52
52
|
};
|
|
53
53
|
const NO = () => false;
|
|
@@ -85,9 +85,6 @@ const isReservedProp = /* @__PURE__ */ makeMap(
|
|
|
85
85
|
// the leading comma is intentional so empty string "" is also included
|
|
86
86
|
",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
|
|
87
87
|
);
|
|
88
|
-
const isBuiltInDirective = /* @__PURE__ */ makeMap(
|
|
89
|
-
"bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
|
|
90
|
-
);
|
|
91
88
|
const cacheStringFunction = (fn) => {
|
|
92
89
|
const cache = /* @__PURE__ */ Object.create(null);
|
|
93
90
|
return ((str) => {
|
|
@@ -132,6 +129,10 @@ const looseToNumber = (val) => {
|
|
|
132
129
|
const n = parseFloat(val);
|
|
133
130
|
return isNaN(n) ? val : n;
|
|
134
131
|
};
|
|
132
|
+
const toNumber = (val) => {
|
|
133
|
+
const n = isString(val) ? Number(val) : NaN;
|
|
134
|
+
return isNaN(n) ? val : n;
|
|
135
|
+
};
|
|
135
136
|
let _globalThis;
|
|
136
137
|
const getGlobalThis = () => {
|
|
137
138
|
return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
|
|
@@ -188,13 +189,6 @@ function normalizeClass(value) {
|
|
|
188
189
|
return res.trim();
|
|
189
190
|
}
|
|
190
191
|
|
|
191
|
-
const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot";
|
|
192
|
-
const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view";
|
|
193
|
-
const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics";
|
|
194
|
-
const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
|
|
195
|
-
const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
|
|
196
|
-
const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
|
|
197
|
-
|
|
198
192
|
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
|
|
199
193
|
const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
|
|
200
194
|
function includeBooleanAttr(value) {
|
|
@@ -293,10 +287,6 @@ const stringifySymbol = (v, i = "") => {
|
|
|
293
287
|
* @license MIT
|
|
294
288
|
**/
|
|
295
289
|
|
|
296
|
-
function warn$2(msg, ...args) {
|
|
297
|
-
console.warn(`[Vue warn] ${msg}`, ...args);
|
|
298
|
-
}
|
|
299
|
-
|
|
300
290
|
let activeEffectScope;
|
|
301
291
|
class EffectScope {
|
|
302
292
|
// TODO isolatedDeclarations "__v_skip"
|
|
@@ -372,8 +362,6 @@ class EffectScope {
|
|
|
372
362
|
} finally {
|
|
373
363
|
activeEffectScope = currentEffectScope;
|
|
374
364
|
}
|
|
375
|
-
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
376
|
-
warn$2(`cannot run an inactive effect scope.`);
|
|
377
365
|
}
|
|
378
366
|
}
|
|
379
367
|
/**
|
|
@@ -496,11 +484,6 @@ class ReactiveEffect {
|
|
|
496
484
|
try {
|
|
497
485
|
return this.fn();
|
|
498
486
|
} finally {
|
|
499
|
-
if (!!(process.env.NODE_ENV !== "production") && activeSub !== this) {
|
|
500
|
-
warn$2(
|
|
501
|
-
"Active effect was not restored correctly - this is likely a Vue internal bug."
|
|
502
|
-
);
|
|
503
|
-
}
|
|
504
487
|
cleanupDeps(this);
|
|
505
488
|
activeSub = prevEffect;
|
|
506
489
|
shouldTrack = prevShouldTrack;
|
|
@@ -674,9 +657,6 @@ function removeSub(link, soft = false) {
|
|
|
674
657
|
nextSub.prevSub = prevSub;
|
|
675
658
|
link.nextSub = void 0;
|
|
676
659
|
}
|
|
677
|
-
if (!!(process.env.NODE_ENV !== "production") && dep.subsHead === link) {
|
|
678
|
-
dep.subsHead = nextSub;
|
|
679
|
-
}
|
|
680
660
|
if (dep.subs === link) {
|
|
681
661
|
dep.subs = prevSub;
|
|
682
662
|
if (!prevSub && dep.computed) {
|
|
@@ -760,9 +740,6 @@ class Dep {
|
|
|
760
740
|
* @internal
|
|
761
741
|
*/
|
|
762
742
|
this.__v_skip = true;
|
|
763
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
764
|
-
this.subsHead = void 0;
|
|
765
|
-
}
|
|
766
743
|
}
|
|
767
744
|
track(debugInfo) {
|
|
768
745
|
if (!activeSub || !shouldTrack || activeSub === this.computed) {
|
|
@@ -796,16 +773,6 @@ class Dep {
|
|
|
796
773
|
}
|
|
797
774
|
}
|
|
798
775
|
}
|
|
799
|
-
if (!!(process.env.NODE_ENV !== "production") && activeSub.onTrack) {
|
|
800
|
-
activeSub.onTrack(
|
|
801
|
-
extend(
|
|
802
|
-
{
|
|
803
|
-
effect: activeSub
|
|
804
|
-
},
|
|
805
|
-
debugInfo
|
|
806
|
-
)
|
|
807
|
-
);
|
|
808
|
-
}
|
|
809
776
|
return link;
|
|
810
777
|
}
|
|
811
778
|
trigger(debugInfo) {
|
|
@@ -816,20 +783,7 @@ class Dep {
|
|
|
816
783
|
notify(debugInfo) {
|
|
817
784
|
startBatch();
|
|
818
785
|
try {
|
|
819
|
-
if (!!(
|
|
820
|
-
for (let head = this.subsHead; head; head = head.nextSub) {
|
|
821
|
-
if (head.sub.onTrigger && !(head.sub.flags & 8)) {
|
|
822
|
-
head.sub.onTrigger(
|
|
823
|
-
extend(
|
|
824
|
-
{
|
|
825
|
-
effect: head.sub
|
|
826
|
-
},
|
|
827
|
-
debugInfo
|
|
828
|
-
)
|
|
829
|
-
);
|
|
830
|
-
}
|
|
831
|
-
}
|
|
832
|
-
}
|
|
786
|
+
if (!!("production" !== "production")) ;
|
|
833
787
|
for (let link = this.subs; link; link = link.prevSub) {
|
|
834
788
|
if (link.sub.notify()) {
|
|
835
789
|
;
|
|
@@ -856,21 +810,18 @@ function addSub(link) {
|
|
|
856
810
|
link.prevSub = currentTail;
|
|
857
811
|
if (currentTail) currentTail.nextSub = link;
|
|
858
812
|
}
|
|
859
|
-
if (!!(process.env.NODE_ENV !== "production") && link.dep.subsHead === void 0) {
|
|
860
|
-
link.dep.subsHead = link;
|
|
861
|
-
}
|
|
862
813
|
link.dep.subs = link;
|
|
863
814
|
}
|
|
864
815
|
}
|
|
865
816
|
const targetMap = /* @__PURE__ */ new WeakMap();
|
|
866
817
|
const ITERATE_KEY = /* @__PURE__ */ Symbol(
|
|
867
|
-
|
|
818
|
+
""
|
|
868
819
|
);
|
|
869
820
|
const MAP_KEY_ITERATE_KEY = /* @__PURE__ */ Symbol(
|
|
870
|
-
|
|
821
|
+
""
|
|
871
822
|
);
|
|
872
823
|
const ARRAY_ITERATE_KEY = /* @__PURE__ */ Symbol(
|
|
873
|
-
|
|
824
|
+
""
|
|
874
825
|
);
|
|
875
826
|
function track(target, type, key) {
|
|
876
827
|
if (shouldTrack && activeSub) {
|
|
@@ -884,13 +835,7 @@ function track(target, type, key) {
|
|
|
884
835
|
dep.map = depsMap;
|
|
885
836
|
dep.key = key;
|
|
886
837
|
}
|
|
887
|
-
|
|
888
|
-
dep.track({
|
|
889
|
-
target,
|
|
890
|
-
type,
|
|
891
|
-
key
|
|
892
|
-
});
|
|
893
|
-
} else {
|
|
838
|
+
{
|
|
894
839
|
dep.track();
|
|
895
840
|
}
|
|
896
841
|
}
|
|
@@ -903,16 +848,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
903
848
|
}
|
|
904
849
|
const run = (dep) => {
|
|
905
850
|
if (dep) {
|
|
906
|
-
|
|
907
|
-
dep.trigger({
|
|
908
|
-
target,
|
|
909
|
-
type,
|
|
910
|
-
key,
|
|
911
|
-
newValue,
|
|
912
|
-
oldValue,
|
|
913
|
-
oldTarget
|
|
914
|
-
});
|
|
915
|
-
} else {
|
|
851
|
+
{
|
|
916
852
|
dep.trigger();
|
|
917
853
|
}
|
|
918
854
|
}
|
|
@@ -1262,12 +1198,6 @@ class MutableReactiveHandler extends BaseReactiveHandler {
|
|
|
1262
1198
|
}
|
|
1263
1199
|
if (!isArrayWithIntegerKey && isRef(oldValue) && !isRef(value)) {
|
|
1264
1200
|
if (isOldValueReadonly) {
|
|
1265
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1266
|
-
warn$2(
|
|
1267
|
-
`Set operation on key "${String(key)}" failed: target is readonly.`,
|
|
1268
|
-
target[key]
|
|
1269
|
-
);
|
|
1270
|
-
}
|
|
1271
1201
|
return true;
|
|
1272
1202
|
} else {
|
|
1273
1203
|
oldValue.value = value;
|
|
@@ -1286,17 +1216,17 @@ class MutableReactiveHandler extends BaseReactiveHandler {
|
|
|
1286
1216
|
if (!hadKey) {
|
|
1287
1217
|
trigger(target, "add", key, value);
|
|
1288
1218
|
} else if (hasChanged(value, oldValue)) {
|
|
1289
|
-
trigger(target, "set", key, value
|
|
1219
|
+
trigger(target, "set", key, value);
|
|
1290
1220
|
}
|
|
1291
1221
|
}
|
|
1292
1222
|
return result;
|
|
1293
1223
|
}
|
|
1294
1224
|
deleteProperty(target, key) {
|
|
1295
1225
|
const hadKey = hasOwn(target, key);
|
|
1296
|
-
|
|
1226
|
+
target[key];
|
|
1297
1227
|
const result = Reflect.deleteProperty(target, key);
|
|
1298
1228
|
if (result && hadKey) {
|
|
1299
|
-
trigger(target, "delete", key, void 0
|
|
1229
|
+
trigger(target, "delete", key, void 0);
|
|
1300
1230
|
}
|
|
1301
1231
|
return result;
|
|
1302
1232
|
}
|
|
@@ -1321,21 +1251,9 @@ class ReadonlyReactiveHandler extends BaseReactiveHandler {
|
|
|
1321
1251
|
super(true, isShallow2);
|
|
1322
1252
|
}
|
|
1323
1253
|
set(target, key) {
|
|
1324
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1325
|
-
warn$2(
|
|
1326
|
-
`Set operation on key "${String(key)}" failed: target is readonly.`,
|
|
1327
|
-
target
|
|
1328
|
-
);
|
|
1329
|
-
}
|
|
1330
1254
|
return true;
|
|
1331
1255
|
}
|
|
1332
1256
|
deleteProperty(target, key) {
|
|
1333
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1334
|
-
warn$2(
|
|
1335
|
-
`Delete operation on key "${String(key)}" failed: target is readonly.`,
|
|
1336
|
-
target
|
|
1337
|
-
);
|
|
1338
|
-
}
|
|
1339
1257
|
return true;
|
|
1340
1258
|
}
|
|
1341
1259
|
}
|
|
@@ -1378,13 +1296,6 @@ function createIterableMethod(method, isReadonly2, isShallow2) {
|
|
|
1378
1296
|
}
|
|
1379
1297
|
function createReadonlyMethod(type) {
|
|
1380
1298
|
return function(...args) {
|
|
1381
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1382
|
-
const key = args[0] ? `on key "${args[0]}" ` : ``;
|
|
1383
|
-
warn$2(
|
|
1384
|
-
`${capitalize(type)} operation ${key}failed: target is readonly.`,
|
|
1385
|
-
toRaw(this)
|
|
1386
|
-
);
|
|
1387
|
-
}
|
|
1388
1299
|
return type === "delete" ? false : type === "clear" ? void 0 : this;
|
|
1389
1300
|
};
|
|
1390
1301
|
}
|
|
@@ -1468,15 +1379,13 @@ function createInstrumentations(readonly, shallow) {
|
|
|
1468
1379
|
if (!hadKey) {
|
|
1469
1380
|
key = toRaw(key);
|
|
1470
1381
|
hadKey = has.call(target, key);
|
|
1471
|
-
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
1472
|
-
checkIdentityKeys(target, has, key);
|
|
1473
1382
|
}
|
|
1474
1383
|
const oldValue = get.call(target, key);
|
|
1475
1384
|
target.set(key, value);
|
|
1476
1385
|
if (!hadKey) {
|
|
1477
1386
|
trigger(target, "add", key, value);
|
|
1478
1387
|
} else if (hasChanged(value, oldValue)) {
|
|
1479
|
-
trigger(target, "set", key, value
|
|
1388
|
+
trigger(target, "set", key, value);
|
|
1480
1389
|
}
|
|
1481
1390
|
return this;
|
|
1482
1391
|
},
|
|
@@ -1487,29 +1396,24 @@ function createInstrumentations(readonly, shallow) {
|
|
|
1487
1396
|
if (!hadKey) {
|
|
1488
1397
|
key = toRaw(key);
|
|
1489
1398
|
hadKey = has.call(target, key);
|
|
1490
|
-
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
1491
|
-
checkIdentityKeys(target, has, key);
|
|
1492
1399
|
}
|
|
1493
|
-
|
|
1400
|
+
get ? get.call(target, key) : void 0;
|
|
1494
1401
|
const result = target.delete(key);
|
|
1495
1402
|
if (hadKey) {
|
|
1496
|
-
trigger(target, "delete", key, void 0
|
|
1403
|
+
trigger(target, "delete", key, void 0);
|
|
1497
1404
|
}
|
|
1498
1405
|
return result;
|
|
1499
1406
|
},
|
|
1500
1407
|
clear() {
|
|
1501
1408
|
const target = toRaw(this);
|
|
1502
1409
|
const hadItems = target.size !== 0;
|
|
1503
|
-
const oldTarget = !!(process.env.NODE_ENV !== "production") ? isMap(target) ? new Map(target) : new Set(target) : void 0;
|
|
1504
1410
|
const result = target.clear();
|
|
1505
1411
|
if (hadItems) {
|
|
1506
1412
|
trigger(
|
|
1507
1413
|
target,
|
|
1508
1414
|
"clear",
|
|
1509
1415
|
void 0,
|
|
1510
|
-
void 0
|
|
1511
|
-
oldTarget
|
|
1512
|
-
);
|
|
1416
|
+
void 0);
|
|
1513
1417
|
}
|
|
1514
1418
|
return result;
|
|
1515
1419
|
}
|
|
@@ -1555,15 +1459,6 @@ const readonlyCollectionHandlers = {
|
|
|
1555
1459
|
const shallowReadonlyCollectionHandlers = {
|
|
1556
1460
|
get: /* @__PURE__ */ createInstrumentationGetter(true, true)
|
|
1557
1461
|
};
|
|
1558
|
-
function checkIdentityKeys(target, has, key) {
|
|
1559
|
-
const rawKey = toRaw(key);
|
|
1560
|
-
if (rawKey !== key && has.call(target, rawKey)) {
|
|
1561
|
-
const type = toRawType(target);
|
|
1562
|
-
warn$2(
|
|
1563
|
-
`Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`
|
|
1564
|
-
);
|
|
1565
|
-
}
|
|
1566
|
-
}
|
|
1567
1462
|
|
|
1568
1463
|
const reactiveMap = /* @__PURE__ */ new WeakMap();
|
|
1569
1464
|
const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
|
|
@@ -1631,13 +1526,6 @@ function shallowReadonly(target) {
|
|
|
1631
1526
|
}
|
|
1632
1527
|
function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
|
|
1633
1528
|
if (!isObject(target)) {
|
|
1634
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1635
|
-
warn$2(
|
|
1636
|
-
`value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String(
|
|
1637
|
-
target
|
|
1638
|
-
)}`
|
|
1639
|
-
);
|
|
1640
|
-
}
|
|
1641
1529
|
return target;
|
|
1642
1530
|
}
|
|
1643
1531
|
if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
|
|
@@ -1695,58 +1583,6 @@ const toReadonly = (value) => isObject(value) ? /* @__PURE__ */ readonly(value)
|
|
|
1695
1583
|
function isRef(r) {
|
|
1696
1584
|
return r ? r["__v_isRef"] === true : false;
|
|
1697
1585
|
}
|
|
1698
|
-
// @__NO_SIDE_EFFECTS__
|
|
1699
|
-
function ref(value) {
|
|
1700
|
-
return createRef(value, false);
|
|
1701
|
-
}
|
|
1702
|
-
function createRef(rawValue, shallow) {
|
|
1703
|
-
if (/* @__PURE__ */ isRef(rawValue)) {
|
|
1704
|
-
return rawValue;
|
|
1705
|
-
}
|
|
1706
|
-
return new RefImpl(rawValue, shallow);
|
|
1707
|
-
}
|
|
1708
|
-
class RefImpl {
|
|
1709
|
-
constructor(value, isShallow2) {
|
|
1710
|
-
this.dep = new Dep();
|
|
1711
|
-
this["__v_isRef"] = true;
|
|
1712
|
-
this["__v_isShallow"] = false;
|
|
1713
|
-
this._rawValue = isShallow2 ? value : toRaw(value);
|
|
1714
|
-
this._value = isShallow2 ? value : toReactive(value);
|
|
1715
|
-
this["__v_isShallow"] = isShallow2;
|
|
1716
|
-
}
|
|
1717
|
-
get value() {
|
|
1718
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1719
|
-
this.dep.track({
|
|
1720
|
-
target: this,
|
|
1721
|
-
type: "get",
|
|
1722
|
-
key: "value"
|
|
1723
|
-
});
|
|
1724
|
-
} else {
|
|
1725
|
-
this.dep.track();
|
|
1726
|
-
}
|
|
1727
|
-
return this._value;
|
|
1728
|
-
}
|
|
1729
|
-
set value(newValue) {
|
|
1730
|
-
const oldValue = this._rawValue;
|
|
1731
|
-
const useDirectValue = this["__v_isShallow"] || isShallow(newValue) || isReadonly(newValue);
|
|
1732
|
-
newValue = useDirectValue ? newValue : toRaw(newValue);
|
|
1733
|
-
if (hasChanged(newValue, oldValue)) {
|
|
1734
|
-
this._rawValue = newValue;
|
|
1735
|
-
this._value = useDirectValue ? newValue : toReactive(newValue);
|
|
1736
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1737
|
-
this.dep.trigger({
|
|
1738
|
-
target: this,
|
|
1739
|
-
type: "set",
|
|
1740
|
-
key: "value",
|
|
1741
|
-
newValue,
|
|
1742
|
-
oldValue
|
|
1743
|
-
});
|
|
1744
|
-
} else {
|
|
1745
|
-
this.dep.trigger();
|
|
1746
|
-
}
|
|
1747
|
-
}
|
|
1748
|
-
}
|
|
1749
|
-
}
|
|
1750
1586
|
function unref(ref2) {
|
|
1751
1587
|
return /* @__PURE__ */ isRef(ref2) ? ref2.value : ref2;
|
|
1752
1588
|
}
|
|
@@ -1818,14 +1654,10 @@ class ComputedRefImpl {
|
|
|
1818
1654
|
activeSub !== this) {
|
|
1819
1655
|
batch(this, true);
|
|
1820
1656
|
return true;
|
|
1821
|
-
}
|
|
1657
|
+
}
|
|
1822
1658
|
}
|
|
1823
1659
|
get value() {
|
|
1824
|
-
const link =
|
|
1825
|
-
target: this,
|
|
1826
|
-
type: "get",
|
|
1827
|
-
key: "value"
|
|
1828
|
-
}) : this.dep.track();
|
|
1660
|
+
const link = this.dep.track();
|
|
1829
1661
|
refreshComputed(this);
|
|
1830
1662
|
if (link) {
|
|
1831
1663
|
link.version = this.dep.version;
|
|
@@ -1835,8 +1667,6 @@ class ComputedRefImpl {
|
|
|
1835
1667
|
set value(newValue) {
|
|
1836
1668
|
if (this.setter) {
|
|
1837
1669
|
this.setter(newValue);
|
|
1838
|
-
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
1839
|
-
warn$2("Write operation failed: computed value is readonly");
|
|
1840
1670
|
}
|
|
1841
1671
|
}
|
|
1842
1672
|
}
|
|
@@ -1851,7 +1681,6 @@ function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
|
1851
1681
|
setter = getterOrOptions.set;
|
|
1852
1682
|
}
|
|
1853
1683
|
const cRef = new ComputedRefImpl(getter, setter, isSSR);
|
|
1854
|
-
if (!!(process.env.NODE_ENV !== "production") && debugOptions) ;
|
|
1855
1684
|
return cRef;
|
|
1856
1685
|
}
|
|
1857
1686
|
const INITIAL_WATCHER_VALUE = {};
|
|
@@ -1862,21 +1691,10 @@ function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher
|
|
|
1862
1691
|
let cleanups = cleanupMap.get(owner);
|
|
1863
1692
|
if (!cleanups) cleanupMap.set(owner, cleanups = []);
|
|
1864
1693
|
cleanups.push(cleanupFn);
|
|
1865
|
-
} else if (!!(process.env.NODE_ENV !== "production") && !failSilently) {
|
|
1866
|
-
warn$2(
|
|
1867
|
-
`onWatcherCleanup() was called when there was no active watcher to associate with.`
|
|
1868
|
-
);
|
|
1869
1694
|
}
|
|
1870
1695
|
}
|
|
1871
1696
|
function watch$1(source, cb, options = EMPTY_OBJ) {
|
|
1872
1697
|
const { immediate, deep, once, scheduler, augmentJob, call } = options;
|
|
1873
|
-
const warnInvalidSource = (s) => {
|
|
1874
|
-
(options.onWarn || warn$2)(
|
|
1875
|
-
`Invalid watch source: `,
|
|
1876
|
-
s,
|
|
1877
|
-
`A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`
|
|
1878
|
-
);
|
|
1879
|
-
};
|
|
1880
1698
|
const reactiveGetter = (source2) => {
|
|
1881
1699
|
if (deep) return source2;
|
|
1882
1700
|
if (isShallow(source2) || deep === false || deep === 0)
|
|
@@ -1905,9 +1723,7 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
|
|
|
1905
1723
|
return reactiveGetter(s);
|
|
1906
1724
|
} else if (isFunction(s)) {
|
|
1907
1725
|
return call ? call(s, 2) : s();
|
|
1908
|
-
} else
|
|
1909
|
-
!!(process.env.NODE_ENV !== "production") && warnInvalidSource(s);
|
|
1910
|
-
}
|
|
1726
|
+
} else ;
|
|
1911
1727
|
});
|
|
1912
1728
|
} else if (isFunction(source)) {
|
|
1913
1729
|
if (cb) {
|
|
@@ -1933,7 +1749,6 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
|
|
|
1933
1749
|
}
|
|
1934
1750
|
} else {
|
|
1935
1751
|
getter = NOOP;
|
|
1936
|
-
!!(process.env.NODE_ENV !== "production") && warnInvalidSource(source);
|
|
1937
1752
|
}
|
|
1938
1753
|
if (cb && deep) {
|
|
1939
1754
|
const baseGetter = getter;
|
|
@@ -2004,10 +1819,6 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
|
|
|
2004
1819
|
cleanupMap.delete(effect);
|
|
2005
1820
|
}
|
|
2006
1821
|
};
|
|
2007
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
2008
|
-
effect.onTrack = options.onTrack;
|
|
2009
|
-
effect.onTrigger = options.onTrigger;
|
|
2010
|
-
}
|
|
2011
1822
|
if (cb) {
|
|
2012
1823
|
if (immediate) {
|
|
2013
1824
|
job(true);
|
|
@@ -2064,12 +1875,6 @@ function traverse(value, depth = Infinity, seen) {
|
|
|
2064
1875
|
**/
|
|
2065
1876
|
|
|
2066
1877
|
const stack = [];
|
|
2067
|
-
function pushWarningContext(vnode) {
|
|
2068
|
-
stack.push(vnode);
|
|
2069
|
-
}
|
|
2070
|
-
function popWarningContext() {
|
|
2071
|
-
stack.pop();
|
|
2072
|
-
}
|
|
2073
1878
|
let isWarning = false;
|
|
2074
1879
|
function warn$1(msg, ...args) {
|
|
2075
1880
|
if (isWarning) return;
|
|
@@ -2175,39 +1980,6 @@ function formatProp(key, value, raw) {
|
|
|
2175
1980
|
return raw ? value : [`${key}=`, value];
|
|
2176
1981
|
}
|
|
2177
1982
|
}
|
|
2178
|
-
const ErrorTypeStrings$1 = {
|
|
2179
|
-
["sp"]: "serverPrefetch hook",
|
|
2180
|
-
["bc"]: "beforeCreate hook",
|
|
2181
|
-
["c"]: "created hook",
|
|
2182
|
-
["bm"]: "beforeMount hook",
|
|
2183
|
-
["m"]: "mounted hook",
|
|
2184
|
-
["bu"]: "beforeUpdate hook",
|
|
2185
|
-
["u"]: "updated",
|
|
2186
|
-
["bum"]: "beforeUnmount hook",
|
|
2187
|
-
["um"]: "unmounted hook",
|
|
2188
|
-
["a"]: "activated hook",
|
|
2189
|
-
["da"]: "deactivated hook",
|
|
2190
|
-
["ec"]: "errorCaptured hook",
|
|
2191
|
-
["rtc"]: "renderTracked hook",
|
|
2192
|
-
["rtg"]: "renderTriggered hook",
|
|
2193
|
-
[0]: "setup function",
|
|
2194
|
-
[1]: "render function",
|
|
2195
|
-
[2]: "watcher getter",
|
|
2196
|
-
[3]: "watcher callback",
|
|
2197
|
-
[4]: "watcher cleanup function",
|
|
2198
|
-
[5]: "native event handler",
|
|
2199
|
-
[6]: "component event handler",
|
|
2200
|
-
[7]: "vnode hook",
|
|
2201
|
-
[8]: "directive hook",
|
|
2202
|
-
[9]: "transition hook",
|
|
2203
|
-
[10]: "app errorHandler",
|
|
2204
|
-
[11]: "app warnHandler",
|
|
2205
|
-
[12]: "ref function",
|
|
2206
|
-
[13]: "async component loader",
|
|
2207
|
-
[14]: "scheduler flush",
|
|
2208
|
-
[15]: "component update",
|
|
2209
|
-
[16]: "app unmount cleanup function"
|
|
2210
|
-
};
|
|
2211
1983
|
function callWithErrorHandling(fn, instance, type, args) {
|
|
2212
1984
|
try {
|
|
2213
1985
|
return args ? fn(...args) : fn();
|
|
@@ -2231,10 +2003,6 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
|
|
|
2231
2003
|
values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
|
|
2232
2004
|
}
|
|
2233
2005
|
return values;
|
|
2234
|
-
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
2235
|
-
warn$1(
|
|
2236
|
-
`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`
|
|
2237
|
-
);
|
|
2238
2006
|
}
|
|
2239
2007
|
}
|
|
2240
2008
|
function handleError(err, instance, type, throwInDev = true) {
|
|
@@ -2243,7 +2011,7 @@ function handleError(err, instance, type, throwInDev = true) {
|
|
|
2243
2011
|
if (instance) {
|
|
2244
2012
|
let cur = instance.parent;
|
|
2245
2013
|
const exposedInstance = instance.proxy;
|
|
2246
|
-
const errorInfo =
|
|
2014
|
+
const errorInfo = `https://vuejs.org/error-reference/#runtime-${type}`;
|
|
2247
2015
|
while (cur) {
|
|
2248
2016
|
const errorCapturedHooks = cur.ec;
|
|
2249
2017
|
if (errorCapturedHooks) {
|
|
@@ -2269,21 +2037,7 @@ function handleError(err, instance, type, throwInDev = true) {
|
|
|
2269
2037
|
logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction);
|
|
2270
2038
|
}
|
|
2271
2039
|
function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) {
|
|
2272
|
-
if (
|
|
2273
|
-
const info = ErrorTypeStrings$1[type];
|
|
2274
|
-
if (contextVNode) {
|
|
2275
|
-
pushWarningContext(contextVNode);
|
|
2276
|
-
}
|
|
2277
|
-
warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
|
|
2278
|
-
if (contextVNode) {
|
|
2279
|
-
popWarningContext();
|
|
2280
|
-
}
|
|
2281
|
-
if (throwInDev) {
|
|
2282
|
-
throw err;
|
|
2283
|
-
} else {
|
|
2284
|
-
console.error(err);
|
|
2285
|
-
}
|
|
2286
|
-
} else if (throwInProd) {
|
|
2040
|
+
if (throwInProd) {
|
|
2287
2041
|
throw err;
|
|
2288
2042
|
} else {
|
|
2289
2043
|
console.error(err);
|
|
@@ -2297,7 +2051,6 @@ let activePostFlushCbs = null;
|
|
|
2297
2051
|
let postFlushIndex = 0;
|
|
2298
2052
|
const resolvedPromise = /* @__PURE__ */ Promise.resolve();
|
|
2299
2053
|
let currentFlushPromise = null;
|
|
2300
|
-
const RECURSION_LIMIT = 100;
|
|
2301
2054
|
function nextTick(fn) {
|
|
2302
2055
|
const p = currentFlushPromise || resolvedPromise;
|
|
2303
2056
|
return fn ? p.then(this ? fn.bind(this) : fn) : p;
|
|
@@ -2350,18 +2103,12 @@ function queuePostFlushCb(cb) {
|
|
|
2350
2103
|
queueFlush();
|
|
2351
2104
|
}
|
|
2352
2105
|
function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
|
|
2353
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
2354
|
-
seen = seen || /* @__PURE__ */ new Map();
|
|
2355
|
-
}
|
|
2356
2106
|
for (; i < queue.length; i++) {
|
|
2357
2107
|
const cb = queue[i];
|
|
2358
2108
|
if (cb && cb.flags & 2) {
|
|
2359
2109
|
if (instance && cb.id !== instance.uid) {
|
|
2360
2110
|
continue;
|
|
2361
2111
|
}
|
|
2362
|
-
if (!!(process.env.NODE_ENV !== "production") && checkRecursiveUpdates(seen, cb)) {
|
|
2363
|
-
continue;
|
|
2364
|
-
}
|
|
2365
2112
|
queue.splice(i, 1);
|
|
2366
2113
|
i--;
|
|
2367
2114
|
if (cb.flags & 4) {
|
|
@@ -2385,14 +2132,8 @@ function flushPostFlushCbs(seen) {
|
|
|
2385
2132
|
return;
|
|
2386
2133
|
}
|
|
2387
2134
|
activePostFlushCbs = deduped;
|
|
2388
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
2389
|
-
seen = seen || /* @__PURE__ */ new Map();
|
|
2390
|
-
}
|
|
2391
2135
|
for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
|
|
2392
2136
|
const cb = activePostFlushCbs[postFlushIndex];
|
|
2393
|
-
if (!!(process.env.NODE_ENV !== "production") && checkRecursiveUpdates(seen, cb)) {
|
|
2394
|
-
continue;
|
|
2395
|
-
}
|
|
2396
2137
|
if (cb.flags & 4) {
|
|
2397
2138
|
cb.flags &= -2;
|
|
2398
2139
|
}
|
|
@@ -2405,17 +2146,12 @@ function flushPostFlushCbs(seen) {
|
|
|
2405
2146
|
}
|
|
2406
2147
|
const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
|
|
2407
2148
|
function flushJobs(seen) {
|
|
2408
|
-
|
|
2409
|
-
seen = seen || /* @__PURE__ */ new Map();
|
|
2410
|
-
}
|
|
2411
|
-
const check = !!(process.env.NODE_ENV !== "production") ? (job) => checkRecursiveUpdates(seen, job) : NOOP;
|
|
2149
|
+
const check = NOOP;
|
|
2412
2150
|
try {
|
|
2413
2151
|
for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
|
|
2414
2152
|
const job = queue[flushIndex];
|
|
2415
2153
|
if (job && !(job.flags & 8)) {
|
|
2416
|
-
if (!!(
|
|
2417
|
-
continue;
|
|
2418
|
-
}
|
|
2154
|
+
if (!!("production" !== "production") && check(job)) ;
|
|
2419
2155
|
if (job.flags & 4) {
|
|
2420
2156
|
job.flags &= ~1;
|
|
2421
2157
|
}
|
|
@@ -2438,245 +2174,12 @@ function flushJobs(seen) {
|
|
|
2438
2174
|
}
|
|
2439
2175
|
flushIndex = -1;
|
|
2440
2176
|
queue.length = 0;
|
|
2441
|
-
flushPostFlushCbs(
|
|
2177
|
+
flushPostFlushCbs();
|
|
2442
2178
|
currentFlushPromise = null;
|
|
2443
2179
|
if (queue.length || pendingPostFlushCbs.length) {
|
|
2444
|
-
flushJobs(
|
|
2445
|
-
}
|
|
2446
|
-
}
|
|
2447
|
-
}
|
|
2448
|
-
function checkRecursiveUpdates(seen, fn) {
|
|
2449
|
-
const count = seen.get(fn) || 0;
|
|
2450
|
-
if (count > RECURSION_LIMIT) {
|
|
2451
|
-
const instance = fn.i;
|
|
2452
|
-
const componentName = instance && getComponentName(instance.type);
|
|
2453
|
-
handleError(
|
|
2454
|
-
`Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
|
|
2455
|
-
null,
|
|
2456
|
-
10
|
|
2457
|
-
);
|
|
2458
|
-
return true;
|
|
2459
|
-
}
|
|
2460
|
-
seen.set(fn, count + 1);
|
|
2461
|
-
return false;
|
|
2462
|
-
}
|
|
2463
|
-
|
|
2464
|
-
let isHmrUpdating = false;
|
|
2465
|
-
const hmrDirtyComponents = /* @__PURE__ */ new Map();
|
|
2466
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
2467
|
-
getGlobalThis().__VUE_HMR_RUNTIME__ = {
|
|
2468
|
-
createRecord: tryWrap(createRecord),
|
|
2469
|
-
rerender: tryWrap(rerender),
|
|
2470
|
-
reload: tryWrap(reload)
|
|
2471
|
-
};
|
|
2472
|
-
}
|
|
2473
|
-
const map = /* @__PURE__ */ new Map();
|
|
2474
|
-
function registerHMR(instance) {
|
|
2475
|
-
const id = instance.type.__hmrId;
|
|
2476
|
-
let record = map.get(id);
|
|
2477
|
-
if (!record) {
|
|
2478
|
-
createRecord(id, instance.type);
|
|
2479
|
-
record = map.get(id);
|
|
2480
|
-
}
|
|
2481
|
-
record.instances.add(instance);
|
|
2482
|
-
}
|
|
2483
|
-
function unregisterHMR(instance) {
|
|
2484
|
-
map.get(instance.type.__hmrId).instances.delete(instance);
|
|
2485
|
-
}
|
|
2486
|
-
function createRecord(id, initialDef) {
|
|
2487
|
-
if (map.has(id)) {
|
|
2488
|
-
return false;
|
|
2489
|
-
}
|
|
2490
|
-
map.set(id, {
|
|
2491
|
-
initialDef: normalizeClassComponent(initialDef),
|
|
2492
|
-
instances: /* @__PURE__ */ new Set()
|
|
2493
|
-
});
|
|
2494
|
-
return true;
|
|
2495
|
-
}
|
|
2496
|
-
function normalizeClassComponent(component) {
|
|
2497
|
-
return isClassComponent(component) ? component.__vccOpts : component;
|
|
2498
|
-
}
|
|
2499
|
-
function rerender(id, newRender) {
|
|
2500
|
-
const record = map.get(id);
|
|
2501
|
-
if (!record) {
|
|
2502
|
-
return;
|
|
2503
|
-
}
|
|
2504
|
-
record.initialDef.render = newRender;
|
|
2505
|
-
[...record.instances].forEach((instance) => {
|
|
2506
|
-
if (newRender) {
|
|
2507
|
-
instance.render = newRender;
|
|
2508
|
-
normalizeClassComponent(instance.type).render = newRender;
|
|
2509
|
-
}
|
|
2510
|
-
instance.renderCache = [];
|
|
2511
|
-
isHmrUpdating = true;
|
|
2512
|
-
if (!(instance.job.flags & 8)) {
|
|
2513
|
-
instance.update();
|
|
2514
|
-
}
|
|
2515
|
-
isHmrUpdating = false;
|
|
2516
|
-
});
|
|
2517
|
-
}
|
|
2518
|
-
function reload(id, newComp) {
|
|
2519
|
-
const record = map.get(id);
|
|
2520
|
-
if (!record) return;
|
|
2521
|
-
newComp = normalizeClassComponent(newComp);
|
|
2522
|
-
updateComponentDef(record.initialDef, newComp);
|
|
2523
|
-
const instances = [...record.instances];
|
|
2524
|
-
for (let i = 0; i < instances.length; i++) {
|
|
2525
|
-
const instance = instances[i];
|
|
2526
|
-
const oldComp = normalizeClassComponent(instance.type);
|
|
2527
|
-
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
2528
|
-
if (!dirtyInstances) {
|
|
2529
|
-
if (oldComp !== record.initialDef) {
|
|
2530
|
-
updateComponentDef(oldComp, newComp);
|
|
2531
|
-
}
|
|
2532
|
-
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
2533
|
-
}
|
|
2534
|
-
dirtyInstances.add(instance);
|
|
2535
|
-
instance.appContext.propsCache.delete(instance.type);
|
|
2536
|
-
instance.appContext.emitsCache.delete(instance.type);
|
|
2537
|
-
instance.appContext.optionsCache.delete(instance.type);
|
|
2538
|
-
if (instance.ceReload) {
|
|
2539
|
-
dirtyInstances.add(instance);
|
|
2540
|
-
instance.ceReload(newComp.styles);
|
|
2541
|
-
dirtyInstances.delete(instance);
|
|
2542
|
-
} else if (instance.parent) {
|
|
2543
|
-
queueJob(() => {
|
|
2544
|
-
if (!(instance.job.flags & 8)) {
|
|
2545
|
-
isHmrUpdating = true;
|
|
2546
|
-
instance.parent.update();
|
|
2547
|
-
isHmrUpdating = false;
|
|
2548
|
-
dirtyInstances.delete(instance);
|
|
2549
|
-
}
|
|
2550
|
-
});
|
|
2551
|
-
} else if (instance.appContext.reload) {
|
|
2552
|
-
instance.appContext.reload();
|
|
2553
|
-
} else if (typeof window !== "undefined") {
|
|
2554
|
-
window.location.reload();
|
|
2555
|
-
} else {
|
|
2556
|
-
console.warn(
|
|
2557
|
-
"[HMR] Root or manually mounted instance modified. Full reload required."
|
|
2558
|
-
);
|
|
2559
|
-
}
|
|
2560
|
-
if (instance.root.ce && instance !== instance.root) {
|
|
2561
|
-
instance.root.ce._removeChildStyle(oldComp);
|
|
2562
|
-
}
|
|
2563
|
-
}
|
|
2564
|
-
queuePostFlushCb(() => {
|
|
2565
|
-
hmrDirtyComponents.clear();
|
|
2566
|
-
});
|
|
2567
|
-
}
|
|
2568
|
-
function updateComponentDef(oldComp, newComp) {
|
|
2569
|
-
extend(oldComp, newComp);
|
|
2570
|
-
for (const key in oldComp) {
|
|
2571
|
-
if (key !== "__file" && !(key in newComp)) {
|
|
2572
|
-
delete oldComp[key];
|
|
2573
|
-
}
|
|
2574
|
-
}
|
|
2575
|
-
}
|
|
2576
|
-
function tryWrap(fn) {
|
|
2577
|
-
return (id, arg) => {
|
|
2578
|
-
try {
|
|
2579
|
-
return fn(id, arg);
|
|
2580
|
-
} catch (e) {
|
|
2581
|
-
console.error(e);
|
|
2582
|
-
console.warn(
|
|
2583
|
-
`[HMR] Something went wrong during Vue component hot-reload. Full reload required.`
|
|
2584
|
-
);
|
|
2180
|
+
flushJobs();
|
|
2585
2181
|
}
|
|
2586
|
-
};
|
|
2587
|
-
}
|
|
2588
|
-
|
|
2589
|
-
let devtools$1;
|
|
2590
|
-
let buffer = [];
|
|
2591
|
-
let devtoolsNotInstalled = false;
|
|
2592
|
-
function emit$1(event, ...args) {
|
|
2593
|
-
if (devtools$1) {
|
|
2594
|
-
devtools$1.emit(event, ...args);
|
|
2595
|
-
} else if (!devtoolsNotInstalled) {
|
|
2596
|
-
buffer.push({ event, args });
|
|
2597
|
-
}
|
|
2598
|
-
}
|
|
2599
|
-
function setDevtoolsHook$1(hook, target) {
|
|
2600
|
-
var _a, _b;
|
|
2601
|
-
devtools$1 = hook;
|
|
2602
|
-
if (devtools$1) {
|
|
2603
|
-
devtools$1.enabled = true;
|
|
2604
|
-
buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args));
|
|
2605
|
-
buffer = [];
|
|
2606
|
-
} else if (
|
|
2607
|
-
// handle late devtools injection - only do this if we are in an actual
|
|
2608
|
-
// browser environment to avoid the timer handle stalling test runner exit
|
|
2609
|
-
// (#4815)
|
|
2610
|
-
typeof window !== "undefined" && // some envs mock window but not fully
|
|
2611
|
-
window.HTMLElement && // also exclude jsdom
|
|
2612
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
2613
|
-
!((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom"))
|
|
2614
|
-
) {
|
|
2615
|
-
const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];
|
|
2616
|
-
replay.push((newHook) => {
|
|
2617
|
-
setDevtoolsHook$1(newHook, target);
|
|
2618
|
-
});
|
|
2619
|
-
setTimeout(() => {
|
|
2620
|
-
if (!devtools$1) {
|
|
2621
|
-
target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
|
|
2622
|
-
devtoolsNotInstalled = true;
|
|
2623
|
-
buffer = [];
|
|
2624
|
-
}
|
|
2625
|
-
}, 3e3);
|
|
2626
|
-
} else {
|
|
2627
|
-
devtoolsNotInstalled = true;
|
|
2628
|
-
buffer = [];
|
|
2629
|
-
}
|
|
2630
|
-
}
|
|
2631
|
-
function devtoolsInitApp(app, version) {
|
|
2632
|
-
emit$1("app:init" /* APP_INIT */, app, version, {
|
|
2633
|
-
Fragment,
|
|
2634
|
-
Text,
|
|
2635
|
-
Comment,
|
|
2636
|
-
Static
|
|
2637
|
-
});
|
|
2638
|
-
}
|
|
2639
|
-
function devtoolsUnmountApp(app) {
|
|
2640
|
-
emit$1("app:unmount" /* APP_UNMOUNT */, app);
|
|
2641
|
-
}
|
|
2642
|
-
const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook("component:added" /* COMPONENT_ADDED */);
|
|
2643
|
-
const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */);
|
|
2644
|
-
const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook(
|
|
2645
|
-
"component:removed" /* COMPONENT_REMOVED */
|
|
2646
|
-
);
|
|
2647
|
-
const devtoolsComponentRemoved = (component) => {
|
|
2648
|
-
if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && // remove the component if it wasn't buffered
|
|
2649
|
-
!devtools$1.cleanupBuffer(component)) {
|
|
2650
|
-
_devtoolsComponentRemoved(component);
|
|
2651
2182
|
}
|
|
2652
|
-
};
|
|
2653
|
-
// @__NO_SIDE_EFFECTS__
|
|
2654
|
-
function createDevtoolsComponentHook(hook) {
|
|
2655
|
-
return (component) => {
|
|
2656
|
-
emit$1(
|
|
2657
|
-
hook,
|
|
2658
|
-
component.appContext.app,
|
|
2659
|
-
component.uid,
|
|
2660
|
-
component.parent ? component.parent.uid : void 0,
|
|
2661
|
-
component
|
|
2662
|
-
);
|
|
2663
|
-
};
|
|
2664
|
-
}
|
|
2665
|
-
const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:start" /* PERFORMANCE_START */);
|
|
2666
|
-
const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:end" /* PERFORMANCE_END */);
|
|
2667
|
-
function createDevtoolsPerformanceHook(hook) {
|
|
2668
|
-
return (component, type, time) => {
|
|
2669
|
-
emit$1(hook, component.appContext.app, component.uid, component, type, time);
|
|
2670
|
-
};
|
|
2671
|
-
}
|
|
2672
|
-
function devtoolsComponentEmit(component, event, params) {
|
|
2673
|
-
emit$1(
|
|
2674
|
-
"component:emit" /* COMPONENT_EMIT */,
|
|
2675
|
-
component.appContext.app,
|
|
2676
|
-
component,
|
|
2677
|
-
event,
|
|
2678
|
-
params
|
|
2679
|
-
);
|
|
2680
2183
|
}
|
|
2681
2184
|
|
|
2682
2185
|
let currentRenderingInstance = null;
|
|
@@ -2706,9 +2209,6 @@ function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
|
|
|
2706
2209
|
setBlockTracking(1);
|
|
2707
2210
|
}
|
|
2708
2211
|
}
|
|
2709
|
-
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
2710
|
-
devtoolsComponentUpdated(ctx);
|
|
2711
|
-
}
|
|
2712
2212
|
return res;
|
|
2713
2213
|
};
|
|
2714
2214
|
renderFnWithContext._n = true;
|
|
@@ -2716,15 +2216,8 @@ function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
|
|
|
2716
2216
|
renderFnWithContext._d = true;
|
|
2717
2217
|
return renderFnWithContext;
|
|
2718
2218
|
}
|
|
2719
|
-
|
|
2720
|
-
function validateDirectiveName(name) {
|
|
2721
|
-
if (isBuiltInDirective(name)) {
|
|
2722
|
-
warn$1("Do not use built-in directive ids as custom directive id: " + name);
|
|
2723
|
-
}
|
|
2724
|
-
}
|
|
2725
2219
|
function withDirectives(vnode, directives) {
|
|
2726
2220
|
if (currentRenderingInstance === null) {
|
|
2727
|
-
!!(process.env.NODE_ENV !== "production") && warn$1(`withDirectives can only be used inside render functions.`);
|
|
2728
2221
|
return vnode;
|
|
2729
2222
|
}
|
|
2730
2223
|
const instance = getComponentPublicInstance(currentRenderingInstance);
|
|
@@ -2776,11 +2269,6 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
|
2776
2269
|
}
|
|
2777
2270
|
|
|
2778
2271
|
function provide(key, value) {
|
|
2779
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
2780
|
-
if (!currentInstance || currentInstance.isMounted) {
|
|
2781
|
-
warn$1(`provide() can only be used inside setup().`);
|
|
2782
|
-
}
|
|
2783
|
-
}
|
|
2784
2272
|
if (currentInstance) {
|
|
2785
2273
|
let provides = currentInstance.provides;
|
|
2786
2274
|
const parentProvides = currentInstance.parent && currentInstance.parent.provides;
|
|
@@ -2798,11 +2286,7 @@ function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
|
2798
2286
|
return provides[key];
|
|
2799
2287
|
} else if (arguments.length > 1) {
|
|
2800
2288
|
return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
|
|
2801
|
-
} else
|
|
2802
|
-
warn$1(`injection "${String(key)}" not found.`);
|
|
2803
|
-
}
|
|
2804
|
-
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
2805
|
-
warn$1(`inject() can only be used inside setup() or functional components.`);
|
|
2289
|
+
} else ;
|
|
2806
2290
|
}
|
|
2807
2291
|
}
|
|
2808
2292
|
|
|
@@ -2810,43 +2294,15 @@ const ssrContextKey = /* @__PURE__ */ Symbol.for("v-scx");
|
|
|
2810
2294
|
const useSSRContext = () => {
|
|
2811
2295
|
{
|
|
2812
2296
|
const ctx = inject(ssrContextKey);
|
|
2813
|
-
if (!ctx) {
|
|
2814
|
-
!!(process.env.NODE_ENV !== "production") && warn$1(
|
|
2815
|
-
`Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`
|
|
2816
|
-
);
|
|
2817
|
-
}
|
|
2818
2297
|
return ctx;
|
|
2819
2298
|
}
|
|
2820
2299
|
};
|
|
2821
2300
|
function watch(source, cb, options) {
|
|
2822
|
-
if (!!(process.env.NODE_ENV !== "production") && !isFunction(cb)) {
|
|
2823
|
-
warn$1(
|
|
2824
|
-
`\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`
|
|
2825
|
-
);
|
|
2826
|
-
}
|
|
2827
2301
|
return doWatch(source, cb, options);
|
|
2828
2302
|
}
|
|
2829
2303
|
function doWatch(source, cb, options = EMPTY_OBJ) {
|
|
2830
2304
|
const { immediate, deep, flush, once } = options;
|
|
2831
|
-
if (!!(process.env.NODE_ENV !== "production") && !cb) {
|
|
2832
|
-
if (immediate !== void 0) {
|
|
2833
|
-
warn$1(
|
|
2834
|
-
`watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
|
|
2835
|
-
);
|
|
2836
|
-
}
|
|
2837
|
-
if (deep !== void 0) {
|
|
2838
|
-
warn$1(
|
|
2839
|
-
`watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
|
|
2840
|
-
);
|
|
2841
|
-
}
|
|
2842
|
-
if (once !== void 0) {
|
|
2843
|
-
warn$1(
|
|
2844
|
-
`watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
|
|
2845
|
-
);
|
|
2846
|
-
}
|
|
2847
|
-
}
|
|
2848
2305
|
const baseWatchOptions = extend({}, options);
|
|
2849
|
-
if (!!(process.env.NODE_ENV !== "production")) baseWatchOptions.onWarn = warn$1;
|
|
2850
2306
|
const runsImmediately = cb && immediate || !cb && flush !== "post";
|
|
2851
2307
|
let ssrCleanup;
|
|
2852
2308
|
if (isInSSRComponentSetup) {
|
|
@@ -2954,8 +2410,6 @@ function defineComponent(options, extraOptions) {
|
|
|
2954
2410
|
function markAsyncBoundary(instance) {
|
|
2955
2411
|
instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
|
|
2956
2412
|
}
|
|
2957
|
-
|
|
2958
|
-
const knownTemplateRefs = /* @__PURE__ */ new WeakSet();
|
|
2959
2413
|
function isTemplateRefKey(refs, key) {
|
|
2960
2414
|
let desc;
|
|
2961
2415
|
return !!((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable);
|
|
@@ -2984,36 +2438,17 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
2984
2438
|
const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
|
|
2985
2439
|
const value = isUnmount ? null : refValue;
|
|
2986
2440
|
const { i: owner, r: ref } = rawRef;
|
|
2987
|
-
if (!!(process.env.NODE_ENV !== "production") && !owner) {
|
|
2988
|
-
warn$1(
|
|
2989
|
-
`Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.`
|
|
2990
|
-
);
|
|
2991
|
-
return;
|
|
2992
|
-
}
|
|
2993
2441
|
const oldRef = oldRawRef && oldRawRef.r;
|
|
2994
2442
|
const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
|
|
2995
2443
|
const setupState = owner.setupState;
|
|
2996
2444
|
const rawSetupState = toRaw(setupState);
|
|
2997
2445
|
const canSetSetupRef = setupState === EMPTY_OBJ ? NO : (key) => {
|
|
2998
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
2999
|
-
if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
|
|
3000
|
-
warn$1(
|
|
3001
|
-
`Template ref "${key}" used on a non-ref value. It will not work in the production build.`
|
|
3002
|
-
);
|
|
3003
|
-
}
|
|
3004
|
-
if (knownTemplateRefs.has(rawSetupState[key])) {
|
|
3005
|
-
return false;
|
|
3006
|
-
}
|
|
3007
|
-
}
|
|
3008
2446
|
if (isTemplateRefKey(refs, key)) {
|
|
3009
2447
|
return false;
|
|
3010
2448
|
}
|
|
3011
2449
|
return hasOwn(rawSetupState, key);
|
|
3012
2450
|
};
|
|
3013
2451
|
const canSetRef = (ref2, key) => {
|
|
3014
|
-
if (!!(process.env.NODE_ENV !== "production") && knownTemplateRefs.has(ref2)) {
|
|
3015
|
-
return false;
|
|
3016
|
-
}
|
|
3017
2452
|
if (key && isTemplateRefKey(refs, key)) {
|
|
3018
2453
|
return false;
|
|
3019
2454
|
}
|
|
@@ -3042,7 +2477,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
3042
2477
|
if (_isString || _isRef) {
|
|
3043
2478
|
const doSet = () => {
|
|
3044
2479
|
if (rawRef.f) {
|
|
3045
|
-
const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(
|
|
2480
|
+
const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef() || !rawRef.k ? ref.value : refs[rawRef.k];
|
|
3046
2481
|
if (isUnmount) {
|
|
3047
2482
|
isArray(existing) && remove(existing, refValue);
|
|
3048
2483
|
} else {
|
|
@@ -3073,9 +2508,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
3073
2508
|
ref.value = value;
|
|
3074
2509
|
}
|
|
3075
2510
|
if (rawRef.k) refs[rawRef.k] = value;
|
|
3076
|
-
} else
|
|
3077
|
-
warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
|
|
3078
|
-
}
|
|
2511
|
+
} else ;
|
|
3079
2512
|
};
|
|
3080
2513
|
if (value) {
|
|
3081
2514
|
const job = () => {
|
|
@@ -3089,8 +2522,6 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
3089
2522
|
invalidatePendingSetRef(rawRef);
|
|
3090
2523
|
doSet();
|
|
3091
2524
|
}
|
|
3092
|
-
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
3093
|
-
warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
|
|
3094
2525
|
}
|
|
3095
2526
|
}
|
|
3096
2527
|
}
|
|
@@ -3101,204 +2532,11 @@ function invalidatePendingSetRef(rawRef) {
|
|
|
3101
2532
|
pendingSetRefMap.delete(rawRef);
|
|
3102
2533
|
}
|
|
3103
2534
|
}
|
|
3104
|
-
const isComment = (node) => node.nodeType === 8;
|
|
3105
2535
|
|
|
3106
2536
|
getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
|
|
3107
2537
|
getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
|
|
3108
|
-
function forEachElement(node, cb) {
|
|
3109
|
-
if (isComment(node) && node.data === "[") {
|
|
3110
|
-
let depth = 1;
|
|
3111
|
-
let next = node.nextSibling;
|
|
3112
|
-
while (next) {
|
|
3113
|
-
if (next.nodeType === 1) {
|
|
3114
|
-
const result = cb(next);
|
|
3115
|
-
if (result === false) {
|
|
3116
|
-
break;
|
|
3117
|
-
}
|
|
3118
|
-
} else if (isComment(next)) {
|
|
3119
|
-
if (next.data === "]") {
|
|
3120
|
-
if (--depth === 0) break;
|
|
3121
|
-
} else if (next.data === "[") {
|
|
3122
|
-
depth++;
|
|
3123
|
-
}
|
|
3124
|
-
}
|
|
3125
|
-
next = next.nextSibling;
|
|
3126
|
-
}
|
|
3127
|
-
} else {
|
|
3128
|
-
cb(node);
|
|
3129
|
-
}
|
|
3130
|
-
}
|
|
3131
2538
|
|
|
3132
2539
|
const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
|
|
3133
|
-
// @__NO_SIDE_EFFECTS__
|
|
3134
|
-
function defineAsyncComponent(source) {
|
|
3135
|
-
if (isFunction(source)) {
|
|
3136
|
-
source = { loader: source };
|
|
3137
|
-
}
|
|
3138
|
-
const {
|
|
3139
|
-
loader,
|
|
3140
|
-
loadingComponent,
|
|
3141
|
-
errorComponent,
|
|
3142
|
-
delay = 200,
|
|
3143
|
-
hydrate: hydrateStrategy,
|
|
3144
|
-
timeout,
|
|
3145
|
-
// undefined = never times out
|
|
3146
|
-
suspensible = true,
|
|
3147
|
-
onError: userOnError
|
|
3148
|
-
} = source;
|
|
3149
|
-
let pendingRequest = null;
|
|
3150
|
-
let resolvedComp;
|
|
3151
|
-
let retries = 0;
|
|
3152
|
-
const retry = () => {
|
|
3153
|
-
retries++;
|
|
3154
|
-
pendingRequest = null;
|
|
3155
|
-
return load();
|
|
3156
|
-
};
|
|
3157
|
-
const load = () => {
|
|
3158
|
-
let thisRequest;
|
|
3159
|
-
return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
|
|
3160
|
-
err = err instanceof Error ? err : new Error(String(err));
|
|
3161
|
-
if (userOnError) {
|
|
3162
|
-
return new Promise((resolve, reject) => {
|
|
3163
|
-
const userRetry = () => resolve(retry());
|
|
3164
|
-
const userFail = () => reject(err);
|
|
3165
|
-
userOnError(err, userRetry, userFail, retries + 1);
|
|
3166
|
-
});
|
|
3167
|
-
} else {
|
|
3168
|
-
throw err;
|
|
3169
|
-
}
|
|
3170
|
-
}).then((comp) => {
|
|
3171
|
-
if (thisRequest !== pendingRequest && pendingRequest) {
|
|
3172
|
-
return pendingRequest;
|
|
3173
|
-
}
|
|
3174
|
-
if (!!(process.env.NODE_ENV !== "production") && !comp) {
|
|
3175
|
-
warn$1(
|
|
3176
|
-
`Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
|
|
3177
|
-
);
|
|
3178
|
-
}
|
|
3179
|
-
if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
|
|
3180
|
-
comp = comp.default;
|
|
3181
|
-
}
|
|
3182
|
-
if (!!(process.env.NODE_ENV !== "production") && comp && !isObject(comp) && !isFunction(comp)) {
|
|
3183
|
-
throw new Error(`Invalid async component load result: ${comp}`);
|
|
3184
|
-
}
|
|
3185
|
-
resolvedComp = comp;
|
|
3186
|
-
return comp;
|
|
3187
|
-
}));
|
|
3188
|
-
};
|
|
3189
|
-
return defineComponent({
|
|
3190
|
-
name: "AsyncComponentWrapper",
|
|
3191
|
-
__asyncLoader: load,
|
|
3192
|
-
__asyncHydrate(el, instance, hydrate) {
|
|
3193
|
-
let patched = false;
|
|
3194
|
-
(instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
3195
|
-
const performHydrate = () => {
|
|
3196
|
-
if (patched) {
|
|
3197
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
3198
|
-
warn$1(
|
|
3199
|
-
`Skipping lazy hydration for component '${getComponentName(resolvedComp) || resolvedComp.__file}': it was updated before lazy hydration performed.`
|
|
3200
|
-
);
|
|
3201
|
-
}
|
|
3202
|
-
return;
|
|
3203
|
-
}
|
|
3204
|
-
hydrate();
|
|
3205
|
-
};
|
|
3206
|
-
const doHydrate = hydrateStrategy ? () => {
|
|
3207
|
-
const teardown = hydrateStrategy(
|
|
3208
|
-
performHydrate,
|
|
3209
|
-
(cb) => forEachElement(el, cb)
|
|
3210
|
-
);
|
|
3211
|
-
if (teardown) {
|
|
3212
|
-
(instance.bum || (instance.bum = [])).push(teardown);
|
|
3213
|
-
}
|
|
3214
|
-
} : performHydrate;
|
|
3215
|
-
if (resolvedComp) {
|
|
3216
|
-
doHydrate();
|
|
3217
|
-
} else {
|
|
3218
|
-
load().then(() => !instance.isUnmounted && doHydrate());
|
|
3219
|
-
}
|
|
3220
|
-
},
|
|
3221
|
-
get __asyncResolved() {
|
|
3222
|
-
return resolvedComp;
|
|
3223
|
-
},
|
|
3224
|
-
setup() {
|
|
3225
|
-
const instance = currentInstance;
|
|
3226
|
-
markAsyncBoundary(instance);
|
|
3227
|
-
if (resolvedComp) {
|
|
3228
|
-
return () => createInnerComp(resolvedComp, instance);
|
|
3229
|
-
}
|
|
3230
|
-
const onError = (err) => {
|
|
3231
|
-
pendingRequest = null;
|
|
3232
|
-
handleError(
|
|
3233
|
-
err,
|
|
3234
|
-
instance,
|
|
3235
|
-
13,
|
|
3236
|
-
!errorComponent
|
|
3237
|
-
);
|
|
3238
|
-
};
|
|
3239
|
-
if (suspensible && instance.suspense || isInSSRComponentSetup) {
|
|
3240
|
-
return load().then((comp) => {
|
|
3241
|
-
return () => createInnerComp(comp, instance);
|
|
3242
|
-
}).catch((err) => {
|
|
3243
|
-
onError(err);
|
|
3244
|
-
return () => errorComponent ? createVNode(errorComponent, {
|
|
3245
|
-
error: err
|
|
3246
|
-
}) : null;
|
|
3247
|
-
});
|
|
3248
|
-
}
|
|
3249
|
-
const loaded = ref(false);
|
|
3250
|
-
const error = ref();
|
|
3251
|
-
const delayed = ref(!!delay);
|
|
3252
|
-
if (delay) {
|
|
3253
|
-
setTimeout(() => {
|
|
3254
|
-
delayed.value = false;
|
|
3255
|
-
}, delay);
|
|
3256
|
-
}
|
|
3257
|
-
if (timeout != null) {
|
|
3258
|
-
setTimeout(() => {
|
|
3259
|
-
if (!loaded.value && !error.value) {
|
|
3260
|
-
const err = new Error(
|
|
3261
|
-
`Async component timed out after ${timeout}ms.`
|
|
3262
|
-
);
|
|
3263
|
-
onError(err);
|
|
3264
|
-
error.value = err;
|
|
3265
|
-
}
|
|
3266
|
-
}, timeout);
|
|
3267
|
-
}
|
|
3268
|
-
load().then(() => {
|
|
3269
|
-
loaded.value = true;
|
|
3270
|
-
if (instance.parent && isKeepAlive(instance.parent.vnode)) {
|
|
3271
|
-
instance.parent.update();
|
|
3272
|
-
}
|
|
3273
|
-
}).catch((err) => {
|
|
3274
|
-
onError(err);
|
|
3275
|
-
error.value = err;
|
|
3276
|
-
});
|
|
3277
|
-
return () => {
|
|
3278
|
-
if (loaded.value && resolvedComp) {
|
|
3279
|
-
return createInnerComp(resolvedComp, instance);
|
|
3280
|
-
} else if (error.value && errorComponent) {
|
|
3281
|
-
return createVNode(errorComponent, {
|
|
3282
|
-
error: error.value
|
|
3283
|
-
});
|
|
3284
|
-
} else if (loadingComponent && !delayed.value) {
|
|
3285
|
-
return createInnerComp(
|
|
3286
|
-
loadingComponent,
|
|
3287
|
-
instance
|
|
3288
|
-
);
|
|
3289
|
-
}
|
|
3290
|
-
};
|
|
3291
|
-
}
|
|
3292
|
-
});
|
|
3293
|
-
}
|
|
3294
|
-
function createInnerComp(comp, parent) {
|
|
3295
|
-
const { ref: ref2, props, children, ce } = parent.vnode;
|
|
3296
|
-
const vnode = createVNode(comp, props, children);
|
|
3297
|
-
vnode.ref = ref2;
|
|
3298
|
-
vnode.ce = ce;
|
|
3299
|
-
delete parent.vnode.ce;
|
|
3300
|
-
return vnode;
|
|
3301
|
-
}
|
|
3302
2540
|
|
|
3303
2541
|
const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
|
|
3304
2542
|
function onActivated(hook, target) {
|
|
@@ -3359,11 +2597,6 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
3359
2597
|
hooks.push(wrappedHook);
|
|
3360
2598
|
}
|
|
3361
2599
|
return wrappedHook;
|
|
3362
|
-
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
3363
|
-
const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, ""));
|
|
3364
|
-
warn$1(
|
|
3365
|
-
`${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().` + (` If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` )
|
|
3366
|
-
);
|
|
3367
2600
|
}
|
|
3368
2601
|
}
|
|
3369
2602
|
const createHook = (lifecycle) => (hook, target = currentInstance) => {
|
|
@@ -3424,16 +2657,7 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
|
|
|
3424
2657
|
if (!res && maybeSelfReference) {
|
|
3425
2658
|
return Component;
|
|
3426
2659
|
}
|
|
3427
|
-
if (!!(process.env.NODE_ENV !== "production") && warnMissing && !res) {
|
|
3428
|
-
const extra = `
|
|
3429
|
-
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` ;
|
|
3430
|
-
warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
|
|
3431
|
-
}
|
|
3432
2660
|
return res;
|
|
3433
|
-
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
3434
|
-
warn$1(
|
|
3435
|
-
`resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`
|
|
3436
|
-
);
|
|
3437
2661
|
}
|
|
3438
2662
|
}
|
|
3439
2663
|
function resolve(registry, name) {
|
|
@@ -3463,12 +2687,7 @@ function renderList(source, renderItem, cache, index) {
|
|
|
3463
2687
|
);
|
|
3464
2688
|
}
|
|
3465
2689
|
} else if (typeof source === "number") {
|
|
3466
|
-
|
|
3467
|
-
warn$1(
|
|
3468
|
-
`The v-for range expects a positive integer value but got ${source}.`
|
|
3469
|
-
);
|
|
3470
|
-
ret = [];
|
|
3471
|
-
} else {
|
|
2690
|
+
{
|
|
3472
2691
|
ret = new Array(source);
|
|
3473
2692
|
for (let i = 0; i < source; i++) {
|
|
3474
2693
|
ret[i] = renderItem(i + 1, i, void 0, cached);
|
|
@@ -3506,23 +2725,22 @@ const publicPropertiesMap = (
|
|
|
3506
2725
|
$: (i) => i,
|
|
3507
2726
|
$el: (i) => i.vnode.el,
|
|
3508
2727
|
$data: (i) => i.data,
|
|
3509
|
-
$props: (i) =>
|
|
3510
|
-
$attrs: (i) =>
|
|
3511
|
-
$slots: (i) =>
|
|
3512
|
-
$refs: (i) =>
|
|
2728
|
+
$props: (i) => i.props,
|
|
2729
|
+
$attrs: (i) => i.attrs,
|
|
2730
|
+
$slots: (i) => i.slots,
|
|
2731
|
+
$refs: (i) => i.refs,
|
|
3513
2732
|
$parent: (i) => getPublicInstance(i.parent),
|
|
3514
2733
|
$root: (i) => getPublicInstance(i.root),
|
|
3515
2734
|
$host: (i) => i.ce,
|
|
3516
2735
|
$emit: (i) => i.emit,
|
|
3517
|
-
$options: (i) =>
|
|
2736
|
+
$options: (i) => resolveMergedOptions(i) ,
|
|
3518
2737
|
$forceUpdate: (i) => i.f || (i.f = () => {
|
|
3519
2738
|
queueJob(i.update);
|
|
3520
2739
|
}),
|
|
3521
2740
|
$nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
|
|
3522
|
-
$watch: (i) =>
|
|
2741
|
+
$watch: (i) => instanceWatch.bind(i)
|
|
3523
2742
|
})
|
|
3524
2743
|
);
|
|
3525
|
-
const isReservedPrefix = (key) => key === "_" || key === "$";
|
|
3526
2744
|
const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
|
|
3527
2745
|
const PublicInstanceProxyHandlers = {
|
|
3528
2746
|
get({ _: instance }, key) {
|
|
@@ -3530,9 +2748,6 @@ const PublicInstanceProxyHandlers = {
|
|
|
3530
2748
|
return true;
|
|
3531
2749
|
}
|
|
3532
2750
|
const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
|
|
3533
|
-
if (!!(process.env.NODE_ENV !== "production") && key === "__isVue") {
|
|
3534
|
-
return true;
|
|
3535
|
-
}
|
|
3536
2751
|
if (key[0] !== "$") {
|
|
3537
2752
|
const n = accessCache[key];
|
|
3538
2753
|
if (n !== void 0) {
|
|
@@ -3549,7 +2764,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
3549
2764
|
} else if (hasSetupBinding(setupState, key)) {
|
|
3550
2765
|
accessCache[key] = 1 /* SETUP */;
|
|
3551
2766
|
return setupState[key];
|
|
3552
|
-
} else if (
|
|
2767
|
+
} else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
3553
2768
|
accessCache[key] = 2 /* DATA */;
|
|
3554
2769
|
return data[key];
|
|
3555
2770
|
} else if (hasOwn(props, key)) {
|
|
@@ -3558,7 +2773,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
3558
2773
|
} else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
3559
2774
|
accessCache[key] = 4 /* CONTEXT */;
|
|
3560
2775
|
return ctx[key];
|
|
3561
|
-
} else if (
|
|
2776
|
+
} else if (shouldCacheAccess) {
|
|
3562
2777
|
accessCache[key] = 0 /* OTHER */;
|
|
3563
2778
|
}
|
|
3564
2779
|
}
|
|
@@ -3567,9 +2782,6 @@ const PublicInstanceProxyHandlers = {
|
|
|
3567
2782
|
if (publicGetter) {
|
|
3568
2783
|
if (key === "$attrs") {
|
|
3569
2784
|
track(instance.attrs, "get", "");
|
|
3570
|
-
!!(process.env.NODE_ENV !== "production") && markAttrsAccessed();
|
|
3571
|
-
} else if (!!(process.env.NODE_ENV !== "production") && key === "$slots") {
|
|
3572
|
-
track(instance, "get", key);
|
|
3573
2785
|
}
|
|
3574
2786
|
return publicGetter(instance);
|
|
3575
2787
|
} else if (
|
|
@@ -3587,50 +2799,23 @@ const PublicInstanceProxyHandlers = {
|
|
|
3587
2799
|
{
|
|
3588
2800
|
return globalProperties[key];
|
|
3589
2801
|
}
|
|
3590
|
-
} else
|
|
3591
|
-
// to infinite warning loop
|
|
3592
|
-
key.indexOf("__v") !== 0)) {
|
|
3593
|
-
if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) {
|
|
3594
|
-
warn$1(
|
|
3595
|
-
`Property ${JSON.stringify(
|
|
3596
|
-
key
|
|
3597
|
-
)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`
|
|
3598
|
-
);
|
|
3599
|
-
} else if (instance === currentRenderingInstance) {
|
|
3600
|
-
warn$1(
|
|
3601
|
-
`Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`
|
|
3602
|
-
);
|
|
3603
|
-
}
|
|
3604
|
-
}
|
|
2802
|
+
} else ;
|
|
3605
2803
|
},
|
|
3606
2804
|
set({ _: instance }, key, value) {
|
|
3607
2805
|
const { data, setupState, ctx } = instance;
|
|
3608
2806
|
if (hasSetupBinding(setupState, key)) {
|
|
3609
2807
|
setupState[key] = value;
|
|
3610
2808
|
return true;
|
|
3611
|
-
} else if (
|
|
3612
|
-
warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`);
|
|
3613
|
-
return false;
|
|
3614
|
-
} else if (__VUE_OPTIONS_API__ && data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
2809
|
+
} else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
3615
2810
|
data[key] = value;
|
|
3616
2811
|
return true;
|
|
3617
2812
|
} else if (hasOwn(instance.props, key)) {
|
|
3618
|
-
!!(process.env.NODE_ENV !== "production") && warn$1(`Attempting to mutate prop "${key}". Props are readonly.`);
|
|
3619
2813
|
return false;
|
|
3620
2814
|
}
|
|
3621
2815
|
if (key[0] === "$" && key.slice(1) in instance) {
|
|
3622
|
-
!!(process.env.NODE_ENV !== "production") && warn$1(
|
|
3623
|
-
`Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.`
|
|
3624
|
-
);
|
|
3625
2816
|
return false;
|
|
3626
2817
|
} else {
|
|
3627
|
-
|
|
3628
|
-
Object.defineProperty(ctx, key, {
|
|
3629
|
-
enumerable: true,
|
|
3630
|
-
configurable: true,
|
|
3631
|
-
value
|
|
3632
|
-
});
|
|
3633
|
-
} else {
|
|
2818
|
+
{
|
|
3634
2819
|
ctx[key] = value;
|
|
3635
2820
|
}
|
|
3636
2821
|
}
|
|
@@ -3640,7 +2825,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
3640
2825
|
_: { data, setupState, accessCache, ctx, appContext, props, type }
|
|
3641
2826
|
}, key) {
|
|
3642
2827
|
let cssModules;
|
|
3643
|
-
return !!(accessCache[key] ||
|
|
2828
|
+
return !!(accessCache[key] || data !== EMPTY_OBJ && key[0] !== "$" && hasOwn(data, key) || hasSetupBinding(setupState, key) || hasOwn(props, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]);
|
|
3644
2829
|
},
|
|
3645
2830
|
defineProperty(target, key, descriptor) {
|
|
3646
2831
|
if (descriptor.get != null) {
|
|
@@ -3651,86 +2836,11 @@ const PublicInstanceProxyHandlers = {
|
|
|
3651
2836
|
return Reflect.defineProperty(target, key, descriptor);
|
|
3652
2837
|
}
|
|
3653
2838
|
};
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
return Reflect.ownKeys(target);
|
|
3660
|
-
};
|
|
3661
|
-
}
|
|
3662
|
-
function createDevRenderContext(instance) {
|
|
3663
|
-
const target = {};
|
|
3664
|
-
Object.defineProperty(target, `_`, {
|
|
3665
|
-
configurable: true,
|
|
3666
|
-
enumerable: false,
|
|
3667
|
-
get: () => instance
|
|
3668
|
-
});
|
|
3669
|
-
Object.keys(publicPropertiesMap).forEach((key) => {
|
|
3670
|
-
Object.defineProperty(target, key, {
|
|
3671
|
-
configurable: true,
|
|
3672
|
-
enumerable: false,
|
|
3673
|
-
get: () => publicPropertiesMap[key](instance),
|
|
3674
|
-
// intercepted by the proxy so no need for implementation,
|
|
3675
|
-
// but needed to prevent set errors
|
|
3676
|
-
set: NOOP
|
|
3677
|
-
});
|
|
3678
|
-
});
|
|
3679
|
-
return target;
|
|
3680
|
-
}
|
|
3681
|
-
function exposePropsOnRenderContext(instance) {
|
|
3682
|
-
const {
|
|
3683
|
-
ctx,
|
|
3684
|
-
propsOptions: [propsOptions]
|
|
3685
|
-
} = instance;
|
|
3686
|
-
if (propsOptions) {
|
|
3687
|
-
Object.keys(propsOptions).forEach((key) => {
|
|
3688
|
-
Object.defineProperty(ctx, key, {
|
|
3689
|
-
enumerable: true,
|
|
3690
|
-
configurable: true,
|
|
3691
|
-
get: () => instance.props[key],
|
|
3692
|
-
set: NOOP
|
|
3693
|
-
});
|
|
3694
|
-
});
|
|
3695
|
-
}
|
|
3696
|
-
}
|
|
3697
|
-
function exposeSetupStateOnRenderContext(instance) {
|
|
3698
|
-
const { ctx, setupState } = instance;
|
|
3699
|
-
Object.keys(toRaw(setupState)).forEach((key) => {
|
|
3700
|
-
if (!setupState.__isScriptSetup) {
|
|
3701
|
-
if (isReservedPrefix(key[0])) {
|
|
3702
|
-
warn$1(
|
|
3703
|
-
`setup() return property ${JSON.stringify(
|
|
3704
|
-
key
|
|
3705
|
-
)} should not start with "$" or "_" which are reserved prefixes for Vue internals.`
|
|
3706
|
-
);
|
|
3707
|
-
return;
|
|
3708
|
-
}
|
|
3709
|
-
Object.defineProperty(ctx, key, {
|
|
3710
|
-
enumerable: true,
|
|
3711
|
-
configurable: true,
|
|
3712
|
-
get: () => setupState[key],
|
|
3713
|
-
set: NOOP
|
|
3714
|
-
});
|
|
3715
|
-
}
|
|
3716
|
-
});
|
|
3717
|
-
}
|
|
3718
|
-
function normalizePropsOrEmits(props) {
|
|
3719
|
-
return isArray(props) ? props.reduce(
|
|
3720
|
-
(normalized, p) => (normalized[p] = null, normalized),
|
|
3721
|
-
{}
|
|
3722
|
-
) : props;
|
|
3723
|
-
}
|
|
3724
|
-
|
|
3725
|
-
function createDuplicateChecker() {
|
|
3726
|
-
const cache = /* @__PURE__ */ Object.create(null);
|
|
3727
|
-
return (type, key) => {
|
|
3728
|
-
if (cache[key]) {
|
|
3729
|
-
warn$1(`${type} property "${key}" is already defined in ${cache[key]}.`);
|
|
3730
|
-
} else {
|
|
3731
|
-
cache[key] = type;
|
|
3732
|
-
}
|
|
3733
|
-
};
|
|
2839
|
+
function normalizePropsOrEmits(props) {
|
|
2840
|
+
return isArray(props) ? props.reduce(
|
|
2841
|
+
(normalized, p) => (normalized[p] = null, normalized),
|
|
2842
|
+
{}
|
|
2843
|
+
) : props;
|
|
3734
2844
|
}
|
|
3735
2845
|
let shouldCacheAccess = true;
|
|
3736
2846
|
function applyOptions(instance) {
|
|
@@ -3774,15 +2884,7 @@ function applyOptions(instance) {
|
|
|
3774
2884
|
directives,
|
|
3775
2885
|
filters
|
|
3776
2886
|
} = options;
|
|
3777
|
-
const checkDuplicateProperties =
|
|
3778
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
3779
|
-
const [propsOptions] = instance.propsOptions;
|
|
3780
|
-
if (propsOptions) {
|
|
3781
|
-
for (const key in propsOptions) {
|
|
3782
|
-
checkDuplicateProperties("Props" /* PROPS */, key);
|
|
3783
|
-
}
|
|
3784
|
-
}
|
|
3785
|
-
}
|
|
2887
|
+
const checkDuplicateProperties = null;
|
|
3786
2888
|
if (injectOptions) {
|
|
3787
2889
|
resolveInjections(injectOptions, ctx, checkDuplicateProperties);
|
|
3788
2890
|
}
|
|
@@ -3790,55 +2892,16 @@ function applyOptions(instance) {
|
|
|
3790
2892
|
for (const key in methods) {
|
|
3791
2893
|
const methodHandler = methods[key];
|
|
3792
2894
|
if (isFunction(methodHandler)) {
|
|
3793
|
-
|
|
3794
|
-
Object.defineProperty(ctx, key, {
|
|
3795
|
-
value: methodHandler.bind(publicThis),
|
|
3796
|
-
configurable: true,
|
|
3797
|
-
enumerable: true,
|
|
3798
|
-
writable: true
|
|
3799
|
-
});
|
|
3800
|
-
} else {
|
|
2895
|
+
{
|
|
3801
2896
|
ctx[key] = methodHandler.bind(publicThis);
|
|
3802
2897
|
}
|
|
3803
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
3804
|
-
checkDuplicateProperties("Methods" /* METHODS */, key);
|
|
3805
|
-
}
|
|
3806
|
-
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
3807
|
-
warn$1(
|
|
3808
|
-
`Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?`
|
|
3809
|
-
);
|
|
3810
2898
|
}
|
|
3811
2899
|
}
|
|
3812
2900
|
}
|
|
3813
2901
|
if (dataOptions) {
|
|
3814
|
-
if (!!(process.env.NODE_ENV !== "production") && !isFunction(dataOptions)) {
|
|
3815
|
-
warn$1(
|
|
3816
|
-
`The data option must be a function. Plain object usage is no longer supported.`
|
|
3817
|
-
);
|
|
3818
|
-
}
|
|
3819
2902
|
const data = dataOptions.call(publicThis, publicThis);
|
|
3820
|
-
if (
|
|
3821
|
-
warn$1(
|
|
3822
|
-
`data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.`
|
|
3823
|
-
);
|
|
3824
|
-
}
|
|
3825
|
-
if (!isObject(data)) {
|
|
3826
|
-
!!(process.env.NODE_ENV !== "production") && warn$1(`data() should return an object.`);
|
|
3827
|
-
} else {
|
|
2903
|
+
if (!isObject(data)) ; else {
|
|
3828
2904
|
instance.data = reactive(data);
|
|
3829
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
3830
|
-
for (const key in data) {
|
|
3831
|
-
checkDuplicateProperties("Data" /* DATA */, key);
|
|
3832
|
-
if (!isReservedPrefix(key[0])) {
|
|
3833
|
-
Object.defineProperty(ctx, key, {
|
|
3834
|
-
configurable: true,
|
|
3835
|
-
enumerable: true,
|
|
3836
|
-
get: () => data[key],
|
|
3837
|
-
set: NOOP
|
|
3838
|
-
});
|
|
3839
|
-
}
|
|
3840
|
-
}
|
|
3841
|
-
}
|
|
3842
2905
|
}
|
|
3843
2906
|
}
|
|
3844
2907
|
shouldCacheAccess = true;
|
|
@@ -3846,14 +2909,7 @@ function applyOptions(instance) {
|
|
|
3846
2909
|
for (const key in computedOptions) {
|
|
3847
2910
|
const opt = computedOptions[key];
|
|
3848
2911
|
const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
|
|
3849
|
-
|
|
3850
|
-
warn$1(`Computed property "${key}" has no getter.`);
|
|
3851
|
-
}
|
|
3852
|
-
const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : !!(process.env.NODE_ENV !== "production") ? () => {
|
|
3853
|
-
warn$1(
|
|
3854
|
-
`Write operation failed: computed property "${key}" is readonly.`
|
|
3855
|
-
);
|
|
3856
|
-
} : NOOP;
|
|
2912
|
+
const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : NOOP;
|
|
3857
2913
|
const c = computed({
|
|
3858
2914
|
get,
|
|
3859
2915
|
set
|
|
@@ -3864,9 +2920,6 @@ function applyOptions(instance) {
|
|
|
3864
2920
|
get: () => c.value,
|
|
3865
2921
|
set: (v) => c.value = v
|
|
3866
2922
|
});
|
|
3867
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
3868
|
-
checkDuplicateProperties("Computed" /* COMPUTED */, key);
|
|
3869
|
-
}
|
|
3870
2923
|
}
|
|
3871
2924
|
}
|
|
3872
2925
|
if (watchOptions) {
|
|
@@ -3958,9 +3011,6 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP)
|
|
|
3958
3011
|
} else {
|
|
3959
3012
|
ctx[key] = injected;
|
|
3960
3013
|
}
|
|
3961
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
3962
|
-
checkDuplicateProperties("Inject" /* INJECT */, key);
|
|
3963
|
-
}
|
|
3964
3014
|
}
|
|
3965
3015
|
}
|
|
3966
3016
|
function callHook(hook, instance, type) {
|
|
@@ -3978,8 +3028,6 @@ function createWatcher(raw, ctx, publicThis, key) {
|
|
|
3978
3028
|
{
|
|
3979
3029
|
watch(getter, handler);
|
|
3980
3030
|
}
|
|
3981
|
-
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
3982
|
-
warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
|
|
3983
3031
|
}
|
|
3984
3032
|
} else if (isFunction(raw)) {
|
|
3985
3033
|
{
|
|
@@ -3992,13 +3040,9 @@ function createWatcher(raw, ctx, publicThis, key) {
|
|
|
3992
3040
|
const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
|
|
3993
3041
|
if (isFunction(handler)) {
|
|
3994
3042
|
watch(getter, handler, raw);
|
|
3995
|
-
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
3996
|
-
warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
|
|
3997
3043
|
}
|
|
3998
3044
|
}
|
|
3999
|
-
} else
|
|
4000
|
-
warn$1(`Invalid watch option: "${key}"`, raw);
|
|
4001
|
-
}
|
|
3045
|
+
} else ;
|
|
4002
3046
|
}
|
|
4003
3047
|
function resolveMergedOptions(instance) {
|
|
4004
3048
|
const base = instance.type;
|
|
@@ -4041,11 +3085,7 @@ function mergeOptions(to, from, strats, asMixin = false) {
|
|
|
4041
3085
|
);
|
|
4042
3086
|
}
|
|
4043
3087
|
for (const key in from) {
|
|
4044
|
-
if (asMixin && key === "expose") {
|
|
4045
|
-
!!(process.env.NODE_ENV !== "production") && warn$1(
|
|
4046
|
-
`"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`
|
|
4047
|
-
);
|
|
4048
|
-
} else {
|
|
3088
|
+
if (asMixin && key === "expose") ; else {
|
|
4049
3089
|
const strat = internalOptionMergeStrats[key] || strats && strats[key];
|
|
4050
3090
|
to[key] = strat ? strat(to[key], from[key]) : from[key];
|
|
4051
3091
|
}
|
|
@@ -4168,7 +3208,6 @@ function createAppAPI(render, hydrate) {
|
|
|
4168
3208
|
rootComponent = extend({}, rootComponent);
|
|
4169
3209
|
}
|
|
4170
3210
|
if (rootProps != null && !isObject(rootProps)) {
|
|
4171
|
-
!!(process.env.NODE_ENV !== "production") && warn$1(`root props passed to app.mount() must be an object.`);
|
|
4172
3211
|
rootProps = null;
|
|
4173
3212
|
}
|
|
4174
3213
|
const context = createAppContext();
|
|
@@ -4187,76 +3226,41 @@ function createAppAPI(render, hydrate) {
|
|
|
4187
3226
|
return context.config;
|
|
4188
3227
|
},
|
|
4189
3228
|
set config(v) {
|
|
4190
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
4191
|
-
warn$1(
|
|
4192
|
-
`app.config cannot be replaced. Modify individual options instead.`
|
|
4193
|
-
);
|
|
4194
|
-
}
|
|
4195
3229
|
},
|
|
4196
3230
|
use(plugin, ...options) {
|
|
4197
|
-
if (installedPlugins.has(plugin)) {
|
|
4198
|
-
!!(process.env.NODE_ENV !== "production") && warn$1(`Plugin has already been applied to target app.`);
|
|
4199
|
-
} else if (plugin && isFunction(plugin.install)) {
|
|
3231
|
+
if (installedPlugins.has(plugin)) ; else if (plugin && isFunction(plugin.install)) {
|
|
4200
3232
|
installedPlugins.add(plugin);
|
|
4201
3233
|
plugin.install(app, ...options);
|
|
4202
3234
|
} else if (isFunction(plugin)) {
|
|
4203
3235
|
installedPlugins.add(plugin);
|
|
4204
3236
|
plugin(app, ...options);
|
|
4205
|
-
} else
|
|
4206
|
-
warn$1(
|
|
4207
|
-
`A plugin must either be a function or an object with an "install" function.`
|
|
4208
|
-
);
|
|
4209
|
-
}
|
|
3237
|
+
} else ;
|
|
4210
3238
|
return app;
|
|
4211
3239
|
},
|
|
4212
3240
|
mixin(mixin) {
|
|
4213
|
-
|
|
3241
|
+
{
|
|
4214
3242
|
if (!context.mixins.includes(mixin)) {
|
|
4215
3243
|
context.mixins.push(mixin);
|
|
4216
|
-
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
4217
|
-
warn$1(
|
|
4218
|
-
"Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "")
|
|
4219
|
-
);
|
|
4220
3244
|
}
|
|
4221
|
-
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
4222
|
-
warn$1("Mixins are only available in builds supporting Options API");
|
|
4223
3245
|
}
|
|
4224
3246
|
return app;
|
|
4225
3247
|
},
|
|
4226
3248
|
component(name, component) {
|
|
4227
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
4228
|
-
validateComponentName(name, context.config);
|
|
4229
|
-
}
|
|
4230
3249
|
if (!component) {
|
|
4231
3250
|
return context.components[name];
|
|
4232
3251
|
}
|
|
4233
|
-
if (!!(process.env.NODE_ENV !== "production") && context.components[name]) {
|
|
4234
|
-
warn$1(`Component "${name}" has already been registered in target app.`);
|
|
4235
|
-
}
|
|
4236
3252
|
context.components[name] = component;
|
|
4237
3253
|
return app;
|
|
4238
3254
|
},
|
|
4239
3255
|
directive(name, directive) {
|
|
4240
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
4241
|
-
validateDirectiveName(name);
|
|
4242
|
-
}
|
|
4243
3256
|
if (!directive) {
|
|
4244
3257
|
return context.directives[name];
|
|
4245
3258
|
}
|
|
4246
|
-
if (!!(process.env.NODE_ENV !== "production") && context.directives[name]) {
|
|
4247
|
-
warn$1(`Directive "${name}" has already been registered in target app.`);
|
|
4248
|
-
}
|
|
4249
3259
|
context.directives[name] = directive;
|
|
4250
3260
|
return app;
|
|
4251
3261
|
},
|
|
4252
3262
|
mount(rootContainer, isHydrate, namespace) {
|
|
4253
3263
|
if (!isMounted) {
|
|
4254
|
-
if (!!(process.env.NODE_ENV !== "production") && rootContainer.__vue_app__) {
|
|
4255
|
-
warn$1(
|
|
4256
|
-
`There is already an app instance mounted on the host container.
|
|
4257
|
-
If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
|
|
4258
|
-
);
|
|
4259
|
-
}
|
|
4260
3264
|
const vnode = app._ceVNode || createVNode(rootComponent, rootProps);
|
|
4261
3265
|
vnode.appContext = context;
|
|
4262
3266
|
if (namespace === true) {
|
|
@@ -4264,37 +3268,16 @@ function createAppAPI(render, hydrate) {
|
|
|
4264
3268
|
} else if (namespace === false) {
|
|
4265
3269
|
namespace = void 0;
|
|
4266
3270
|
}
|
|
4267
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
4268
|
-
context.reload = () => {
|
|
4269
|
-
const cloned = cloneVNode(vnode);
|
|
4270
|
-
cloned.el = null;
|
|
4271
|
-
render(cloned, rootContainer, namespace);
|
|
4272
|
-
};
|
|
4273
|
-
}
|
|
4274
3271
|
{
|
|
4275
3272
|
render(vnode, rootContainer, namespace);
|
|
4276
3273
|
}
|
|
4277
3274
|
isMounted = true;
|
|
4278
3275
|
app._container = rootContainer;
|
|
4279
3276
|
rootContainer.__vue_app__ = app;
|
|
4280
|
-
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
4281
|
-
app._instance = vnode.component;
|
|
4282
|
-
devtoolsInitApp(app, version);
|
|
4283
|
-
}
|
|
4284
3277
|
return getComponentPublicInstance(vnode.component);
|
|
4285
|
-
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
4286
|
-
warn$1(
|
|
4287
|
-
`App has already been mounted.
|
|
4288
|
-
If you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. \`const createMyApp = () => createApp(App)\``
|
|
4289
|
-
);
|
|
4290
3278
|
}
|
|
4291
3279
|
},
|
|
4292
3280
|
onUnmount(cleanupFn) {
|
|
4293
|
-
if (!!(process.env.NODE_ENV !== "production") && typeof cleanupFn !== "function") {
|
|
4294
|
-
warn$1(
|
|
4295
|
-
`Expected function as first argument to app.onUnmount(), but got ${typeof cleanupFn}`
|
|
4296
|
-
);
|
|
4297
|
-
}
|
|
4298
3281
|
pluginCleanupFns.push(cleanupFn);
|
|
4299
3282
|
},
|
|
4300
3283
|
unmount() {
|
|
@@ -4305,27 +3288,10 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
4305
3288
|
16
|
|
4306
3289
|
);
|
|
4307
3290
|
render(null, app._container);
|
|
4308
|
-
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
4309
|
-
app._instance = null;
|
|
4310
|
-
devtoolsUnmountApp(app);
|
|
4311
|
-
}
|
|
4312
3291
|
delete app._container.__vue_app__;
|
|
4313
|
-
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
4314
|
-
warn$1(`Cannot unmount an app that is not mounted.`);
|
|
4315
3292
|
}
|
|
4316
3293
|
},
|
|
4317
3294
|
provide(key, value) {
|
|
4318
|
-
if (!!(process.env.NODE_ENV !== "production") && key in context.provides) {
|
|
4319
|
-
if (hasOwn(context.provides, key)) {
|
|
4320
|
-
warn$1(
|
|
4321
|
-
`App already provides property with key "${String(key)}". It will be overwritten with the new value.`
|
|
4322
|
-
);
|
|
4323
|
-
} else {
|
|
4324
|
-
warn$1(
|
|
4325
|
-
`App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`
|
|
4326
|
-
);
|
|
4327
|
-
}
|
|
4328
|
-
}
|
|
4329
3295
|
context.provides[key] = value;
|
|
4330
3296
|
return app;
|
|
4331
3297
|
},
|
|
@@ -4350,31 +3316,6 @@ const getModelModifiers = (props, modelName) => {
|
|
|
4350
3316
|
function emit(instance, event, ...rawArgs) {
|
|
4351
3317
|
if (instance.isUnmounted) return;
|
|
4352
3318
|
const props = instance.vnode.props || EMPTY_OBJ;
|
|
4353
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
4354
|
-
const {
|
|
4355
|
-
emitsOptions,
|
|
4356
|
-
propsOptions: [propsOptions]
|
|
4357
|
-
} = instance;
|
|
4358
|
-
if (emitsOptions) {
|
|
4359
|
-
if (!(event in emitsOptions) && true) {
|
|
4360
|
-
if (!propsOptions || !(toHandlerKey(camelize(event)) in propsOptions)) {
|
|
4361
|
-
warn$1(
|
|
4362
|
-
`Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.`
|
|
4363
|
-
);
|
|
4364
|
-
}
|
|
4365
|
-
} else {
|
|
4366
|
-
const validator = emitsOptions[event];
|
|
4367
|
-
if (isFunction(validator)) {
|
|
4368
|
-
const isValid = validator(...rawArgs);
|
|
4369
|
-
if (!isValid) {
|
|
4370
|
-
warn$1(
|
|
4371
|
-
`Invalid event arguments: event validation failed for event "${event}".`
|
|
4372
|
-
);
|
|
4373
|
-
}
|
|
4374
|
-
}
|
|
4375
|
-
}
|
|
4376
|
-
}
|
|
4377
|
-
}
|
|
4378
3319
|
let args = rawArgs;
|
|
4379
3320
|
const isModelListener = event.startsWith("update:");
|
|
4380
3321
|
const modifiers = isModelListener && getModelModifiers(props, event.slice(7));
|
|
@@ -4386,22 +3327,6 @@ function emit(instance, event, ...rawArgs) {
|
|
|
4386
3327
|
args = rawArgs.map(looseToNumber);
|
|
4387
3328
|
}
|
|
4388
3329
|
}
|
|
4389
|
-
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
4390
|
-
devtoolsComponentEmit(instance, event, args);
|
|
4391
|
-
}
|
|
4392
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
4393
|
-
const lowerCaseEvent = event.toLowerCase();
|
|
4394
|
-
if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
|
|
4395
|
-
warn$1(
|
|
4396
|
-
`Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
|
|
4397
|
-
instance,
|
|
4398
|
-
instance.type
|
|
4399
|
-
)} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate(
|
|
4400
|
-
event
|
|
4401
|
-
)}" instead of "${event}".`
|
|
4402
|
-
);
|
|
4403
|
-
}
|
|
4404
|
-
}
|
|
4405
3330
|
let handlerName;
|
|
4406
3331
|
let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
|
|
4407
3332
|
props[handlerName = toHandlerKey(camelize(event))];
|
|
@@ -4434,7 +3359,7 @@ function emit(instance, event, ...rawArgs) {
|
|
|
4434
3359
|
}
|
|
4435
3360
|
const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
|
|
4436
3361
|
function normalizeEmitsOptions(comp, appContext, asMixin = false) {
|
|
4437
|
-
const cache =
|
|
3362
|
+
const cache = asMixin ? mixinEmitsCache : appContext.emitsCache;
|
|
4438
3363
|
const cached = cache.get(comp);
|
|
4439
3364
|
if (cached !== void 0) {
|
|
4440
3365
|
return cached;
|
|
@@ -4442,7 +3367,7 @@ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
|
|
|
4442
3367
|
const raw = comp.emits;
|
|
4443
3368
|
let normalized = {};
|
|
4444
3369
|
let hasExtends = false;
|
|
4445
|
-
if (
|
|
3370
|
+
if (!isFunction(comp)) {
|
|
4446
3371
|
const extendEmits = (raw2) => {
|
|
4447
3372
|
const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
|
|
4448
3373
|
if (normalizedFromExtend) {
|
|
@@ -4483,10 +3408,7 @@ function isEmitListener(options, key) {
|
|
|
4483
3408
|
key = key.slice(2).replace(/Once$/, "");
|
|
4484
3409
|
return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
|
|
4485
3410
|
}
|
|
4486
|
-
|
|
4487
|
-
let accessedAttrs = false;
|
|
4488
3411
|
function markAttrsAccessed() {
|
|
4489
|
-
accessedAttrs = true;
|
|
4490
3412
|
}
|
|
4491
3413
|
function renderComponentRoot(instance) {
|
|
4492
3414
|
const {
|
|
@@ -4509,13 +3431,10 @@ function renderComponentRoot(instance) {
|
|
|
4509
3431
|
const prev = setCurrentRenderingInstance(instance);
|
|
4510
3432
|
let result;
|
|
4511
3433
|
let fallthroughAttrs;
|
|
4512
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
4513
|
-
accessedAttrs = false;
|
|
4514
|
-
}
|
|
4515
3434
|
try {
|
|
4516
3435
|
if (vnode.shapeFlag & 4) {
|
|
4517
3436
|
const proxyToUse = withProxy || proxy;
|
|
4518
|
-
const thisProxy = !!(
|
|
3437
|
+
const thisProxy = !!("production" !== "production") && setupState.__isScriptSetup ? new Proxy(proxyToUse, {
|
|
4519
3438
|
get(target, key, receiver) {
|
|
4520
3439
|
warn$1(
|
|
4521
3440
|
`Property '${String(
|
|
@@ -4530,7 +3449,7 @@ function renderComponentRoot(instance) {
|
|
|
4530
3449
|
thisProxy,
|
|
4531
3450
|
proxyToUse,
|
|
4532
3451
|
renderCache,
|
|
4533
|
-
!!(
|
|
3452
|
+
!!("production" !== "production") ? shallowReadonly(props) : props,
|
|
4534
3453
|
setupState,
|
|
4535
3454
|
data,
|
|
4536
3455
|
ctx
|
|
@@ -4539,13 +3458,11 @@ function renderComponentRoot(instance) {
|
|
|
4539
3458
|
fallthroughAttrs = attrs;
|
|
4540
3459
|
} else {
|
|
4541
3460
|
const render2 = Component;
|
|
4542
|
-
if (!!(
|
|
4543
|
-
markAttrsAccessed();
|
|
4544
|
-
}
|
|
3461
|
+
if (!!("production" !== "production") && attrs === props) ;
|
|
4545
3462
|
result = normalizeVNode(
|
|
4546
3463
|
render2.length > 1 ? render2(
|
|
4547
|
-
!!(
|
|
4548
|
-
!!(
|
|
3464
|
+
!!("production" !== "production") ? shallowReadonly(props) : props,
|
|
3465
|
+
!!("production" !== "production") ? {
|
|
4549
3466
|
get attrs() {
|
|
4550
3467
|
markAttrsAccessed();
|
|
4551
3468
|
return shallowReadonly(attrs);
|
|
@@ -4554,7 +3471,7 @@ function renderComponentRoot(instance) {
|
|
|
4554
3471
|
emit
|
|
4555
3472
|
} : { attrs, slots, emit }
|
|
4556
3473
|
) : render2(
|
|
4557
|
-
!!(
|
|
3474
|
+
!!("production" !== "production") ? shallowReadonly(props) : props,
|
|
4558
3475
|
null
|
|
4559
3476
|
)
|
|
4560
3477
|
);
|
|
@@ -4566,10 +3483,6 @@ function renderComponentRoot(instance) {
|
|
|
4566
3483
|
result = createVNode(Comment);
|
|
4567
3484
|
}
|
|
4568
3485
|
let root = result;
|
|
4569
|
-
let setRoot = void 0;
|
|
4570
|
-
if (!!(process.env.NODE_ENV !== "production") && result.patchFlag > 0 && result.patchFlag & 2048) {
|
|
4571
|
-
[root, setRoot] = getChildRoot(result);
|
|
4572
|
-
}
|
|
4573
3486
|
if (fallthroughAttrs && inheritAttrs !== false) {
|
|
4574
3487
|
const keys = Object.keys(fallthroughAttrs);
|
|
4575
3488
|
const { shapeFlag } = root;
|
|
@@ -4582,102 +3495,22 @@ function renderComponentRoot(instance) {
|
|
|
4582
3495
|
);
|
|
4583
3496
|
}
|
|
4584
3497
|
root = cloneVNode(root, fallthroughAttrs, false, true);
|
|
4585
|
-
} else if (!!(process.env.NODE_ENV !== "production") && !accessedAttrs && root.type !== Comment) {
|
|
4586
|
-
const allAttrs = Object.keys(attrs);
|
|
4587
|
-
const eventAttrs = [];
|
|
4588
|
-
const extraAttrs = [];
|
|
4589
|
-
for (let i = 0, l = allAttrs.length; i < l; i++) {
|
|
4590
|
-
const key = allAttrs[i];
|
|
4591
|
-
if (isOn(key)) {
|
|
4592
|
-
if (!isModelListener(key)) {
|
|
4593
|
-
eventAttrs.push(key[2].toLowerCase() + key.slice(3));
|
|
4594
|
-
}
|
|
4595
|
-
} else {
|
|
4596
|
-
extraAttrs.push(key);
|
|
4597
|
-
}
|
|
4598
|
-
}
|
|
4599
|
-
if (extraAttrs.length) {
|
|
4600
|
-
warn$1(
|
|
4601
|
-
`Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`
|
|
4602
|
-
);
|
|
4603
|
-
}
|
|
4604
|
-
if (eventAttrs.length) {
|
|
4605
|
-
warn$1(
|
|
4606
|
-
`Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`
|
|
4607
|
-
);
|
|
4608
|
-
}
|
|
4609
3498
|
}
|
|
4610
3499
|
}
|
|
4611
3500
|
}
|
|
4612
3501
|
if (vnode.dirs) {
|
|
4613
|
-
if (!!(process.env.NODE_ENV !== "production") && !isElementRoot(root)) {
|
|
4614
|
-
warn$1(
|
|
4615
|
-
`Runtime directive used on component with non-element root node. The directives will not function as intended.`
|
|
4616
|
-
);
|
|
4617
|
-
}
|
|
4618
3502
|
root = cloneVNode(root, null, false, true);
|
|
4619
3503
|
root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
|
|
4620
3504
|
}
|
|
4621
3505
|
if (vnode.transition) {
|
|
4622
|
-
if (!!(process.env.NODE_ENV !== "production") && !isElementRoot(root)) {
|
|
4623
|
-
warn$1(
|
|
4624
|
-
`Component inside <Transition> renders non-element root node that cannot be animated.`
|
|
4625
|
-
);
|
|
4626
|
-
}
|
|
4627
3506
|
setTransitionHooks(root, vnode.transition);
|
|
4628
3507
|
}
|
|
4629
|
-
|
|
4630
|
-
setRoot(root);
|
|
4631
|
-
} else {
|
|
3508
|
+
{
|
|
4632
3509
|
result = root;
|
|
4633
3510
|
}
|
|
4634
3511
|
setCurrentRenderingInstance(prev);
|
|
4635
3512
|
return result;
|
|
4636
3513
|
}
|
|
4637
|
-
const getChildRoot = (vnode) => {
|
|
4638
|
-
const rawChildren = vnode.children;
|
|
4639
|
-
const dynamicChildren = vnode.dynamicChildren;
|
|
4640
|
-
const childRoot = filterSingleRoot(rawChildren, false);
|
|
4641
|
-
if (!childRoot) {
|
|
4642
|
-
return [vnode, void 0];
|
|
4643
|
-
} else if (!!(process.env.NODE_ENV !== "production") && childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) {
|
|
4644
|
-
return getChildRoot(childRoot);
|
|
4645
|
-
}
|
|
4646
|
-
const index = rawChildren.indexOf(childRoot);
|
|
4647
|
-
const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;
|
|
4648
|
-
const setRoot = (updatedRoot) => {
|
|
4649
|
-
rawChildren[index] = updatedRoot;
|
|
4650
|
-
if (dynamicChildren) {
|
|
4651
|
-
if (dynamicIndex > -1) {
|
|
4652
|
-
dynamicChildren[dynamicIndex] = updatedRoot;
|
|
4653
|
-
} else if (updatedRoot.patchFlag > 0) {
|
|
4654
|
-
vnode.dynamicChildren = [...dynamicChildren, updatedRoot];
|
|
4655
|
-
}
|
|
4656
|
-
}
|
|
4657
|
-
};
|
|
4658
|
-
return [normalizeVNode(childRoot), setRoot];
|
|
4659
|
-
};
|
|
4660
|
-
function filterSingleRoot(children, recurse = true) {
|
|
4661
|
-
let singleRoot;
|
|
4662
|
-
for (let i = 0; i < children.length; i++) {
|
|
4663
|
-
const child = children[i];
|
|
4664
|
-
if (isVNode(child)) {
|
|
4665
|
-
if (child.type !== Comment || child.children === "v-if") {
|
|
4666
|
-
if (singleRoot) {
|
|
4667
|
-
return;
|
|
4668
|
-
} else {
|
|
4669
|
-
singleRoot = child;
|
|
4670
|
-
if (!!(process.env.NODE_ENV !== "production") && recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) {
|
|
4671
|
-
return filterSingleRoot(singleRoot.children);
|
|
4672
|
-
}
|
|
4673
|
-
}
|
|
4674
|
-
}
|
|
4675
|
-
} else {
|
|
4676
|
-
return;
|
|
4677
|
-
}
|
|
4678
|
-
}
|
|
4679
|
-
return singleRoot;
|
|
4680
|
-
}
|
|
4681
3514
|
const getFunctionalFallthrough = (attrs) => {
|
|
4682
3515
|
let res;
|
|
4683
3516
|
for (const key in attrs) {
|
|
@@ -4696,16 +3529,10 @@ const filterModelListeners = (attrs, props) => {
|
|
|
4696
3529
|
}
|
|
4697
3530
|
return res;
|
|
4698
3531
|
};
|
|
4699
|
-
const isElementRoot = (vnode) => {
|
|
4700
|
-
return vnode.shapeFlag & (6 | 1) || vnode.type === Comment;
|
|
4701
|
-
};
|
|
4702
3532
|
function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
|
|
4703
3533
|
const { props: prevProps, children: prevChildren, component } = prevVNode;
|
|
4704
3534
|
const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
|
|
4705
3535
|
const emits = component.emitsOptions;
|
|
4706
|
-
if (!!(process.env.NODE_ENV !== "production") && (prevChildren || nextChildren) && isHmrUpdating) {
|
|
4707
|
-
return true;
|
|
4708
|
-
}
|
|
4709
3536
|
if (nextVNode.dirs || nextVNode.transition) {
|
|
4710
3537
|
return true;
|
|
4711
3538
|
}
|
|
@@ -4796,9 +3623,6 @@ function initProps(instance, rawProps, isStateful, isSSR = false) {
|
|
|
4796
3623
|
props[key] = void 0;
|
|
4797
3624
|
}
|
|
4798
3625
|
}
|
|
4799
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
4800
|
-
validateProps(rawProps || {}, props, instance);
|
|
4801
|
-
}
|
|
4802
3626
|
if (isStateful) {
|
|
4803
3627
|
instance.props = isSSR ? props : shallowReactive(props);
|
|
4804
3628
|
} else {
|
|
@@ -4810,12 +3634,6 @@ function initProps(instance, rawProps, isStateful, isSSR = false) {
|
|
|
4810
3634
|
}
|
|
4811
3635
|
instance.attrs = attrs;
|
|
4812
3636
|
}
|
|
4813
|
-
function isInHmrContext(instance) {
|
|
4814
|
-
while (instance) {
|
|
4815
|
-
if (instance.type.__hmrId) return true;
|
|
4816
|
-
instance = instance.parent;
|
|
4817
|
-
}
|
|
4818
|
-
}
|
|
4819
3637
|
function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
4820
3638
|
const {
|
|
4821
3639
|
props,
|
|
@@ -4829,7 +3647,7 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
4829
3647
|
// always force full diff in dev
|
|
4830
3648
|
// - #1942 if hmr is enabled with sfc component
|
|
4831
3649
|
// - vite#872 non-sfc component used by sfc component
|
|
4832
|
-
|
|
3650
|
+
(optimized || patchFlag > 0) && !(patchFlag & 16)
|
|
4833
3651
|
) {
|
|
4834
3652
|
if (patchFlag & 8) {
|
|
4835
3653
|
const propsToUpdate = instance.vnode.dynamicProps;
|
|
@@ -4904,9 +3722,6 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
4904
3722
|
if (hasAttrsChanged) {
|
|
4905
3723
|
trigger(instance.attrs, "set", "");
|
|
4906
3724
|
}
|
|
4907
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
4908
|
-
validateProps(rawProps || {}, props, instance);
|
|
4909
|
-
}
|
|
4910
3725
|
}
|
|
4911
3726
|
function setFullProps(instance, rawProps, props, attrs) {
|
|
4912
3727
|
const [options, needCastKeys] = instance.propsOptions;
|
|
@@ -4987,7 +3802,7 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
|
|
|
4987
3802
|
}
|
|
4988
3803
|
const mixinPropsCache = /* @__PURE__ */ new WeakMap();
|
|
4989
3804
|
function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
4990
|
-
const cache =
|
|
3805
|
+
const cache = asMixin ? mixinPropsCache : appContext.propsCache;
|
|
4991
3806
|
const cached = cache.get(comp);
|
|
4992
3807
|
if (cached) {
|
|
4993
3808
|
return cached;
|
|
@@ -4996,7 +3811,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
4996
3811
|
const normalized = {};
|
|
4997
3812
|
const needCastKeys = [];
|
|
4998
3813
|
let hasExtends = false;
|
|
4999
|
-
if (
|
|
3814
|
+
if (!isFunction(comp)) {
|
|
5000
3815
|
const extendProps = (raw2) => {
|
|
5001
3816
|
hasExtends = true;
|
|
5002
3817
|
const [props, keys] = normalizePropsOptions(raw2, appContext, true);
|
|
@@ -5021,18 +3836,12 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
5021
3836
|
}
|
|
5022
3837
|
if (isArray(raw)) {
|
|
5023
3838
|
for (let i = 0; i < raw.length; i++) {
|
|
5024
|
-
if (!!(process.env.NODE_ENV !== "production") && !isString(raw[i])) {
|
|
5025
|
-
warn$1(`props must be strings when using array syntax.`, raw[i]);
|
|
5026
|
-
}
|
|
5027
3839
|
const normalizedKey = camelize(raw[i]);
|
|
5028
3840
|
if (validatePropName(normalizedKey)) {
|
|
5029
3841
|
normalized[normalizedKey] = EMPTY_OBJ;
|
|
5030
3842
|
}
|
|
5031
3843
|
}
|
|
5032
3844
|
} else if (raw) {
|
|
5033
|
-
if (!!(process.env.NODE_ENV !== "production") && !isObject(raw)) {
|
|
5034
|
-
warn$1(`invalid props options`, raw);
|
|
5035
|
-
}
|
|
5036
3845
|
for (const key in raw) {
|
|
5037
3846
|
const normalizedKey = camelize(key);
|
|
5038
3847
|
if (validatePropName(normalizedKey)) {
|
|
@@ -5072,126 +3881,9 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
5072
3881
|
function validatePropName(key) {
|
|
5073
3882
|
if (key[0] !== "$" && !isReservedProp(key)) {
|
|
5074
3883
|
return true;
|
|
5075
|
-
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
5076
|
-
warn$1(`Invalid prop name: "${key}" is a reserved property.`);
|
|
5077
3884
|
}
|
|
5078
3885
|
return false;
|
|
5079
3886
|
}
|
|
5080
|
-
function getType(ctor) {
|
|
5081
|
-
if (ctor === null) {
|
|
5082
|
-
return "null";
|
|
5083
|
-
}
|
|
5084
|
-
if (typeof ctor === "function") {
|
|
5085
|
-
return ctor.name || "";
|
|
5086
|
-
} else if (typeof ctor === "object") {
|
|
5087
|
-
const name = ctor.constructor && ctor.constructor.name;
|
|
5088
|
-
return name || "";
|
|
5089
|
-
}
|
|
5090
|
-
return "";
|
|
5091
|
-
}
|
|
5092
|
-
function validateProps(rawProps, props, instance) {
|
|
5093
|
-
const resolvedValues = toRaw(props);
|
|
5094
|
-
const options = instance.propsOptions[0];
|
|
5095
|
-
const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key));
|
|
5096
|
-
for (const key in options) {
|
|
5097
|
-
let opt = options[key];
|
|
5098
|
-
if (opt == null) continue;
|
|
5099
|
-
validateProp(
|
|
5100
|
-
key,
|
|
5101
|
-
resolvedValues[key],
|
|
5102
|
-
opt,
|
|
5103
|
-
!!(process.env.NODE_ENV !== "production") ? shallowReadonly(resolvedValues) : resolvedValues,
|
|
5104
|
-
!camelizePropsKey.includes(key)
|
|
5105
|
-
);
|
|
5106
|
-
}
|
|
5107
|
-
}
|
|
5108
|
-
function validateProp(name, value, prop, props, isAbsent) {
|
|
5109
|
-
const { type, required, validator, skipCheck } = prop;
|
|
5110
|
-
if (required && isAbsent) {
|
|
5111
|
-
warn$1('Missing required prop: "' + name + '"');
|
|
5112
|
-
return;
|
|
5113
|
-
}
|
|
5114
|
-
if (value == null && !required) {
|
|
5115
|
-
return;
|
|
5116
|
-
}
|
|
5117
|
-
if (type != null && type !== true && !skipCheck) {
|
|
5118
|
-
let isValid = false;
|
|
5119
|
-
const types = isArray(type) ? type : [type];
|
|
5120
|
-
const expectedTypes = [];
|
|
5121
|
-
for (let i = 0; i < types.length && !isValid; i++) {
|
|
5122
|
-
const { valid, expectedType } = assertType(value, types[i]);
|
|
5123
|
-
expectedTypes.push(expectedType || "");
|
|
5124
|
-
isValid = valid;
|
|
5125
|
-
}
|
|
5126
|
-
if (!isValid) {
|
|
5127
|
-
warn$1(getInvalidTypeMessage(name, value, expectedTypes));
|
|
5128
|
-
return;
|
|
5129
|
-
}
|
|
5130
|
-
}
|
|
5131
|
-
if (validator && !validator(value, props)) {
|
|
5132
|
-
warn$1('Invalid prop: custom validator check failed for prop "' + name + '".');
|
|
5133
|
-
}
|
|
5134
|
-
}
|
|
5135
|
-
const isSimpleType = /* @__PURE__ */ makeMap(
|
|
5136
|
-
"String,Number,Boolean,Function,Symbol,BigInt"
|
|
5137
|
-
);
|
|
5138
|
-
function assertType(value, type) {
|
|
5139
|
-
let valid;
|
|
5140
|
-
const expectedType = getType(type);
|
|
5141
|
-
if (expectedType === "null") {
|
|
5142
|
-
valid = value === null;
|
|
5143
|
-
} else if (isSimpleType(expectedType)) {
|
|
5144
|
-
const t = typeof value;
|
|
5145
|
-
valid = t === expectedType.toLowerCase();
|
|
5146
|
-
if (!valid && t === "object") {
|
|
5147
|
-
valid = value instanceof type;
|
|
5148
|
-
}
|
|
5149
|
-
} else if (expectedType === "Object") {
|
|
5150
|
-
valid = isObject(value);
|
|
5151
|
-
} else if (expectedType === "Array") {
|
|
5152
|
-
valid = isArray(value);
|
|
5153
|
-
} else {
|
|
5154
|
-
valid = value instanceof type;
|
|
5155
|
-
}
|
|
5156
|
-
return {
|
|
5157
|
-
valid,
|
|
5158
|
-
expectedType
|
|
5159
|
-
};
|
|
5160
|
-
}
|
|
5161
|
-
function getInvalidTypeMessage(name, value, expectedTypes) {
|
|
5162
|
-
if (expectedTypes.length === 0) {
|
|
5163
|
-
return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`;
|
|
5164
|
-
}
|
|
5165
|
-
let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
|
|
5166
|
-
const expectedType = expectedTypes[0];
|
|
5167
|
-
const receivedType = toRawType(value);
|
|
5168
|
-
const expectedValue = styleValue(value, expectedType);
|
|
5169
|
-
const receivedValue = styleValue(value, receivedType);
|
|
5170
|
-
if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
|
|
5171
|
-
message += ` with value ${expectedValue}`;
|
|
5172
|
-
}
|
|
5173
|
-
message += `, got ${receivedType} `;
|
|
5174
|
-
if (isExplicable(receivedType)) {
|
|
5175
|
-
message += `with value ${receivedValue}.`;
|
|
5176
|
-
}
|
|
5177
|
-
return message;
|
|
5178
|
-
}
|
|
5179
|
-
function styleValue(value, type) {
|
|
5180
|
-
if (type === "String") {
|
|
5181
|
-
return `"${value}"`;
|
|
5182
|
-
} else if (type === "Number") {
|
|
5183
|
-
return `${Number(value)}`;
|
|
5184
|
-
} else {
|
|
5185
|
-
return `${value}`;
|
|
5186
|
-
}
|
|
5187
|
-
}
|
|
5188
|
-
function isExplicable(type) {
|
|
5189
|
-
const explicitTypes = ["string", "number", "boolean"];
|
|
5190
|
-
return explicitTypes.some((elem) => type.toLowerCase() === elem);
|
|
5191
|
-
}
|
|
5192
|
-
function isBoolean(...args) {
|
|
5193
|
-
return args.some((elem) => elem.toLowerCase() === "boolean");
|
|
5194
|
-
}
|
|
5195
3887
|
|
|
5196
3888
|
const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
|
|
5197
3889
|
const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
|
|
@@ -5200,11 +3892,7 @@ const normalizeSlot = (key, rawSlot, ctx) => {
|
|
|
5200
3892
|
return rawSlot;
|
|
5201
3893
|
}
|
|
5202
3894
|
const normalized = withCtx((...args) => {
|
|
5203
|
-
if (!!(
|
|
5204
|
-
warn$1(
|
|
5205
|
-
`Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`
|
|
5206
|
-
);
|
|
5207
|
-
}
|
|
3895
|
+
if (!!("production" !== "production") && currentInstance && !(ctx === null && currentRenderingInstance) && !(ctx && ctx.root !== currentInstance.root)) ;
|
|
5208
3896
|
return normalizeSlotValue(rawSlot(...args));
|
|
5209
3897
|
}, ctx);
|
|
5210
3898
|
normalized._c = false;
|
|
@@ -5218,22 +3906,12 @@ const normalizeObjectSlots = (rawSlots, slots, instance) => {
|
|
|
5218
3906
|
if (isFunction(value)) {
|
|
5219
3907
|
slots[key] = normalizeSlot(key, value, ctx);
|
|
5220
3908
|
} else if (value != null) {
|
|
5221
|
-
if (!!(process.env.NODE_ENV !== "production") && true) {
|
|
5222
|
-
warn$1(
|
|
5223
|
-
`Non-function value encountered for slot "${key}". Prefer function slots for better performance.`
|
|
5224
|
-
);
|
|
5225
|
-
}
|
|
5226
3909
|
const normalized = normalizeSlotValue(value);
|
|
5227
3910
|
slots[key] = () => normalized;
|
|
5228
3911
|
}
|
|
5229
3912
|
}
|
|
5230
3913
|
};
|
|
5231
3914
|
const normalizeVNodeSlots = (instance, children) => {
|
|
5232
|
-
if (!!(process.env.NODE_ENV !== "production") && !isKeepAlive(instance.vnode) && true) {
|
|
5233
|
-
warn$1(
|
|
5234
|
-
`Non-function value encountered for default slot. Prefer function slots for better performance.`
|
|
5235
|
-
);
|
|
5236
|
-
}
|
|
5237
3915
|
const normalized = normalizeSlotValue(children);
|
|
5238
3916
|
instance.slots.default = () => normalized;
|
|
5239
3917
|
};
|
|
@@ -5267,10 +3945,7 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
5267
3945
|
if (vnode.shapeFlag & 32) {
|
|
5268
3946
|
const type = children._;
|
|
5269
3947
|
if (type) {
|
|
5270
|
-
if (
|
|
5271
|
-
assignSlots(slots, children, optimized);
|
|
5272
|
-
trigger(instance, "set", "$slots");
|
|
5273
|
-
} else if (optimized && type === 1) {
|
|
3948
|
+
if (optimized && type === 1) {
|
|
5274
3949
|
needDeletionCheck = false;
|
|
5275
3950
|
} else {
|
|
5276
3951
|
assignSlots(slots, children, optimized);
|
|
@@ -5293,81 +3968,13 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
5293
3968
|
}
|
|
5294
3969
|
};
|
|
5295
3970
|
|
|
5296
|
-
let supported;
|
|
5297
|
-
let perf;
|
|
5298
|
-
function startMeasure(instance, type) {
|
|
5299
|
-
if (instance.appContext.config.performance && isSupported()) {
|
|
5300
|
-
perf.mark(`vue-${type}-${instance.uid}`);
|
|
5301
|
-
}
|
|
5302
|
-
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
5303
|
-
devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
|
|
5304
|
-
}
|
|
5305
|
-
}
|
|
5306
|
-
function endMeasure(instance, type) {
|
|
5307
|
-
if (instance.appContext.config.performance && isSupported()) {
|
|
5308
|
-
const startTag = `vue-${type}-${instance.uid}`;
|
|
5309
|
-
const endTag = startTag + `:end`;
|
|
5310
|
-
const measureName = `<${formatComponentName(instance, instance.type)}> ${type}`;
|
|
5311
|
-
perf.mark(endTag);
|
|
5312
|
-
perf.measure(measureName, startTag, endTag);
|
|
5313
|
-
perf.clearMeasures(measureName);
|
|
5314
|
-
perf.clearMarks(startTag);
|
|
5315
|
-
perf.clearMarks(endTag);
|
|
5316
|
-
}
|
|
5317
|
-
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
5318
|
-
devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
|
|
5319
|
-
}
|
|
5320
|
-
}
|
|
5321
|
-
function isSupported() {
|
|
5322
|
-
if (supported !== void 0) {
|
|
5323
|
-
return supported;
|
|
5324
|
-
}
|
|
5325
|
-
if (typeof window !== "undefined" && window.performance) {
|
|
5326
|
-
supported = true;
|
|
5327
|
-
perf = window.performance;
|
|
5328
|
-
} else {
|
|
5329
|
-
supported = false;
|
|
5330
|
-
}
|
|
5331
|
-
return supported;
|
|
5332
|
-
}
|
|
5333
|
-
|
|
5334
|
-
function initFeatureFlags() {
|
|
5335
|
-
const needWarn = [];
|
|
5336
|
-
if (typeof __VUE_OPTIONS_API__ !== "boolean") {
|
|
5337
|
-
!!(process.env.NODE_ENV !== "production") && needWarn.push(`__VUE_OPTIONS_API__`);
|
|
5338
|
-
getGlobalThis().__VUE_OPTIONS_API__ = true;
|
|
5339
|
-
}
|
|
5340
|
-
if (typeof __VUE_PROD_DEVTOOLS__ !== "boolean") {
|
|
5341
|
-
!!(process.env.NODE_ENV !== "production") && needWarn.push(`__VUE_PROD_DEVTOOLS__`);
|
|
5342
|
-
getGlobalThis().__VUE_PROD_DEVTOOLS__ = false;
|
|
5343
|
-
}
|
|
5344
|
-
if (typeof __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ !== "boolean") {
|
|
5345
|
-
!!(process.env.NODE_ENV !== "production") && needWarn.push(`__VUE_PROD_HYDRATION_MISMATCH_DETAILS__`);
|
|
5346
|
-
getGlobalThis().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = false;
|
|
5347
|
-
}
|
|
5348
|
-
if (!!(process.env.NODE_ENV !== "production") && needWarn.length) {
|
|
5349
|
-
const multi = needWarn.length > 1;
|
|
5350
|
-
console.warn(
|
|
5351
|
-
`Feature flag${multi ? `s` : ``} ${needWarn.join(", ")} ${multi ? `are` : `is`} not explicitly defined. You are running the esm-bundler build of Vue, which expects these compile-time feature flags to be globally injected via the bundler config in order to get better tree-shaking in the production bundle.
|
|
5352
|
-
|
|
5353
|
-
For more details, see https://link.vuejs.org/feature-flags.`
|
|
5354
|
-
);
|
|
5355
|
-
}
|
|
5356
|
-
}
|
|
5357
|
-
|
|
5358
3971
|
const queuePostRenderEffect = queueEffectWithSuspense ;
|
|
5359
3972
|
function createRenderer(options) {
|
|
5360
3973
|
return baseCreateRenderer(options);
|
|
5361
3974
|
}
|
|
5362
3975
|
function baseCreateRenderer(options, createHydrationFns) {
|
|
5363
|
-
{
|
|
5364
|
-
initFeatureFlags();
|
|
5365
|
-
}
|
|
5366
3976
|
const target = getGlobalThis();
|
|
5367
3977
|
target.__VUE__ = true;
|
|
5368
|
-
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
5369
|
-
setDevtoolsHook$1(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
|
|
5370
|
-
}
|
|
5371
3978
|
const {
|
|
5372
3979
|
insert: hostInsert,
|
|
5373
3980
|
remove: hostRemove,
|
|
@@ -5382,7 +3989,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5382
3989
|
setScopeId: hostSetScopeId = NOOP,
|
|
5383
3990
|
insertStaticContent: hostInsertStaticContent
|
|
5384
3991
|
} = options;
|
|
5385
|
-
const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = !!
|
|
3992
|
+
const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = !!n2.dynamicChildren) => {
|
|
5386
3993
|
if (n1 === n2) {
|
|
5387
3994
|
return;
|
|
5388
3995
|
}
|
|
@@ -5406,8 +4013,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5406
4013
|
case Static:
|
|
5407
4014
|
if (n1 == null) {
|
|
5408
4015
|
mountStaticNode(n2, container, anchor, namespace);
|
|
5409
|
-
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
5410
|
-
patchStaticNode(n1, n2, container, namespace);
|
|
5411
4016
|
}
|
|
5412
4017
|
break;
|
|
5413
4018
|
case Fragment:
|
|
@@ -5474,9 +4079,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5474
4079
|
optimized,
|
|
5475
4080
|
internals
|
|
5476
4081
|
);
|
|
5477
|
-
} else
|
|
5478
|
-
warn$1("Invalid VNode type:", type, `(${typeof type})`);
|
|
5479
|
-
}
|
|
4082
|
+
} else ;
|
|
5480
4083
|
}
|
|
5481
4084
|
if (ref != null && parentComponent) {
|
|
5482
4085
|
setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
|
|
@@ -5519,21 +4122,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5519
4122
|
n2.anchor
|
|
5520
4123
|
);
|
|
5521
4124
|
};
|
|
5522
|
-
const patchStaticNode = (n1, n2, container, namespace) => {
|
|
5523
|
-
if (n2.children !== n1.children) {
|
|
5524
|
-
const anchor = hostNextSibling(n1.anchor);
|
|
5525
|
-
removeStaticNode(n1);
|
|
5526
|
-
[n2.el, n2.anchor] = hostInsertStaticContent(
|
|
5527
|
-
n2.children,
|
|
5528
|
-
container,
|
|
5529
|
-
anchor,
|
|
5530
|
-
namespace
|
|
5531
|
-
);
|
|
5532
|
-
} else {
|
|
5533
|
-
n2.el = n1.el;
|
|
5534
|
-
n2.anchor = n1.anchor;
|
|
5535
|
-
}
|
|
5536
|
-
};
|
|
5537
4125
|
const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
|
|
5538
4126
|
let next;
|
|
5539
4127
|
while (el && el !== anchor) {
|
|
@@ -5632,10 +4220,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5632
4220
|
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
5633
4221
|
}
|
|
5634
4222
|
}
|
|
5635
|
-
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
5636
|
-
def(el, "__vnode", vnode, true);
|
|
5637
|
-
def(el, "__vueParentComponent", parentComponent, true);
|
|
5638
|
-
}
|
|
5639
4223
|
if (dirs) {
|
|
5640
4224
|
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
5641
4225
|
}
|
|
@@ -5663,9 +4247,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5663
4247
|
}
|
|
5664
4248
|
if (parentComponent) {
|
|
5665
4249
|
let subTree = parentComponent.subTree;
|
|
5666
|
-
if (!!(process.env.NODE_ENV !== "production") && subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
|
|
5667
|
-
subTree = filterSingleRoot(subTree.children) || subTree;
|
|
5668
|
-
}
|
|
5669
4250
|
if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
|
|
5670
4251
|
const parentVNode = parentComponent.vnode;
|
|
5671
4252
|
setScopeId(
|
|
@@ -5696,9 +4277,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5696
4277
|
};
|
|
5697
4278
|
const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
5698
4279
|
const el = n2.el = n1.el;
|
|
5699
|
-
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
5700
|
-
el.__vnode = n2;
|
|
5701
|
-
}
|
|
5702
4280
|
let { patchFlag, dynamicChildren, dirs } = n2;
|
|
5703
4281
|
patchFlag |= n1.patchFlag & 16;
|
|
5704
4282
|
const oldProps = n1.props || EMPTY_OBJ;
|
|
@@ -5712,11 +4290,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5712
4290
|
invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
5713
4291
|
}
|
|
5714
4292
|
parentComponent && toggleRecurse(parentComponent, true);
|
|
5715
|
-
if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating) {
|
|
5716
|
-
patchFlag = 0;
|
|
5717
|
-
optimized = false;
|
|
5718
|
-
dynamicChildren = null;
|
|
5719
|
-
}
|
|
5720
4293
|
if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) {
|
|
5721
4294
|
hostSetElementText(el, "");
|
|
5722
4295
|
}
|
|
@@ -5730,9 +4303,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5730
4303
|
resolveChildrenNamespace(n2, namespace),
|
|
5731
4304
|
slotScopeIds
|
|
5732
4305
|
);
|
|
5733
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
5734
|
-
traverseStaticChildren(n1, n2);
|
|
5735
|
-
}
|
|
5736
4306
|
} else if (!optimized) {
|
|
5737
4307
|
patchChildren(
|
|
5738
4308
|
n1,
|
|
@@ -5849,12 +4419,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5849
4419
|
const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
|
|
5850
4420
|
const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
|
|
5851
4421
|
let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
|
|
5852
|
-
if (!!(process.env.NODE_ENV !== "production") && // #5523 dev root fragment may inherit directives
|
|
5853
|
-
(isHmrUpdating || patchFlag & 2048)) {
|
|
5854
|
-
patchFlag = 0;
|
|
5855
|
-
optimized = false;
|
|
5856
|
-
dynamicChildren = null;
|
|
5857
|
-
}
|
|
5858
4422
|
if (fragmentSlotScopeIds) {
|
|
5859
4423
|
slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
|
|
5860
4424
|
}
|
|
@@ -5888,9 +4452,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5888
4452
|
namespace,
|
|
5889
4453
|
slotScopeIds
|
|
5890
4454
|
);
|
|
5891
|
-
if (
|
|
5892
|
-
traverseStaticChildren(n1, n2);
|
|
5893
|
-
} else if (
|
|
4455
|
+
if (
|
|
5894
4456
|
// #2080 if the stable fragment has a key, it's a <template v-for> that may
|
|
5895
4457
|
// get moved around. Make sure all root level vnodes inherit el.
|
|
5896
4458
|
// #2134 or if it's a component root, it may also get moved around
|
|
@@ -5951,26 +4513,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5951
4513
|
parentComponent,
|
|
5952
4514
|
parentSuspense
|
|
5953
4515
|
));
|
|
5954
|
-
if (!!(process.env.NODE_ENV !== "production") && instance.type.__hmrId) {
|
|
5955
|
-
registerHMR(instance);
|
|
5956
|
-
}
|
|
5957
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
5958
|
-
pushWarningContext(initialVNode);
|
|
5959
|
-
startMeasure(instance, `mount`);
|
|
5960
|
-
}
|
|
5961
4516
|
if (isKeepAlive(initialVNode)) {
|
|
5962
4517
|
instance.ctx.renderer = internals;
|
|
5963
4518
|
}
|
|
5964
4519
|
{
|
|
5965
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
5966
|
-
startMeasure(instance, `init`);
|
|
5967
|
-
}
|
|
5968
4520
|
setupComponent(instance, false, optimized);
|
|
5969
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
5970
|
-
endMeasure(instance, `init`);
|
|
5971
|
-
}
|
|
5972
4521
|
}
|
|
5973
|
-
if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating) initialVNode.el = null;
|
|
5974
4522
|
if (instance.asyncDep) {
|
|
5975
4523
|
parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
|
|
5976
4524
|
if (!initialVNode.el) {
|
|
@@ -5989,22 +4537,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5989
4537
|
optimized
|
|
5990
4538
|
);
|
|
5991
4539
|
}
|
|
5992
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
5993
|
-
popWarningContext();
|
|
5994
|
-
endMeasure(instance, `mount`);
|
|
5995
|
-
}
|
|
5996
4540
|
};
|
|
5997
4541
|
const updateComponent = (n1, n2, optimized) => {
|
|
5998
4542
|
const instance = n2.component = n1.component;
|
|
5999
4543
|
if (shouldUpdateComponent(n1, n2, optimized)) {
|
|
6000
4544
|
if (instance.asyncDep && !instance.asyncResolved) {
|
|
6001
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
6002
|
-
pushWarningContext(n2);
|
|
6003
|
-
}
|
|
6004
4545
|
updateComponentPreRender(instance, n2, optimized);
|
|
6005
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
6006
|
-
popWarningContext();
|
|
6007
|
-
}
|
|
6008
4546
|
return;
|
|
6009
4547
|
} else {
|
|
6010
4548
|
instance.next = n2;
|
|
@@ -6037,16 +4575,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6037
4575
|
instance.parent ? instance.parent.type : void 0
|
|
6038
4576
|
);
|
|
6039
4577
|
}
|
|
6040
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
6041
|
-
startMeasure(instance, `render`);
|
|
6042
|
-
}
|
|
6043
4578
|
const subTree = instance.subTree = renderComponentRoot(instance);
|
|
6044
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
6045
|
-
endMeasure(instance, `render`);
|
|
6046
|
-
}
|
|
6047
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
6048
|
-
startMeasure(instance, `patch`);
|
|
6049
|
-
}
|
|
6050
4579
|
patch(
|
|
6051
4580
|
null,
|
|
6052
4581
|
subTree,
|
|
@@ -6056,9 +4585,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6056
4585
|
parentSuspense,
|
|
6057
4586
|
namespace
|
|
6058
4587
|
);
|
|
6059
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
6060
|
-
endMeasure(instance, `patch`);
|
|
6061
|
-
}
|
|
6062
4588
|
initialVNode.el = subTree.el;
|
|
6063
4589
|
}
|
|
6064
4590
|
if (m) {
|
|
@@ -6075,9 +4601,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6075
4601
|
instance.a && queuePostRenderEffect(instance.a, parentSuspense);
|
|
6076
4602
|
}
|
|
6077
4603
|
instance.isMounted = true;
|
|
6078
|
-
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
6079
|
-
devtoolsComponentAdded(instance);
|
|
6080
|
-
}
|
|
6081
4604
|
initialVNode = container = anchor = null;
|
|
6082
4605
|
} else {
|
|
6083
4606
|
let { next, bu, u, parent, vnode } = instance;
|
|
@@ -6098,9 +4621,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6098
4621
|
}
|
|
6099
4622
|
let originNext = next;
|
|
6100
4623
|
let vnodeHook;
|
|
6101
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
6102
|
-
pushWarningContext(next || instance.vnode);
|
|
6103
|
-
}
|
|
6104
4624
|
toggleRecurse(instance, false);
|
|
6105
4625
|
if (next) {
|
|
6106
4626
|
next.el = vnode.el;
|
|
@@ -6115,18 +4635,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6115
4635
|
invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
6116
4636
|
}
|
|
6117
4637
|
toggleRecurse(instance, true);
|
|
6118
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
6119
|
-
startMeasure(instance, `render`);
|
|
6120
|
-
}
|
|
6121
4638
|
const nextTree = renderComponentRoot(instance);
|
|
6122
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
6123
|
-
endMeasure(instance, `render`);
|
|
6124
|
-
}
|
|
6125
4639
|
const prevTree = instance.subTree;
|
|
6126
4640
|
instance.subTree = nextTree;
|
|
6127
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
6128
|
-
startMeasure(instance, `patch`);
|
|
6129
|
-
}
|
|
6130
4641
|
patch(
|
|
6131
4642
|
prevTree,
|
|
6132
4643
|
nextTree,
|
|
@@ -6138,9 +4649,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6138
4649
|
parentSuspense,
|
|
6139
4650
|
namespace
|
|
6140
4651
|
);
|
|
6141
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
6142
|
-
endMeasure(instance, `patch`);
|
|
6143
|
-
}
|
|
6144
4652
|
next.el = nextTree.el;
|
|
6145
4653
|
if (originNext === null) {
|
|
6146
4654
|
updateHOCHostEl(instance, nextTree.el);
|
|
@@ -6154,12 +4662,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6154
4662
|
parentSuspense
|
|
6155
4663
|
);
|
|
6156
4664
|
}
|
|
6157
|
-
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
6158
|
-
devtoolsComponentUpdated(instance);
|
|
6159
|
-
}
|
|
6160
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
6161
|
-
popWarningContext();
|
|
6162
|
-
}
|
|
6163
4665
|
}
|
|
6164
4666
|
};
|
|
6165
4667
|
instance.scope.on();
|
|
@@ -6171,10 +4673,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6171
4673
|
job.id = instance.uid;
|
|
6172
4674
|
effect.scheduler = () => queueJob(job);
|
|
6173
4675
|
toggleRecurse(instance, true);
|
|
6174
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
6175
|
-
effect.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;
|
|
6176
|
-
effect.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;
|
|
6177
|
-
}
|
|
6178
4676
|
update();
|
|
6179
4677
|
};
|
|
6180
4678
|
const updateComponentPreRender = (instance, nextVNode, optimized) => {
|
|
@@ -6386,13 +4884,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6386
4884
|
for (i = s2; i <= e2; i++) {
|
|
6387
4885
|
const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
|
|
6388
4886
|
if (nextChild.key != null) {
|
|
6389
|
-
if (!!(process.env.NODE_ENV !== "production") && keyToNewIndexMap.has(nextChild.key)) {
|
|
6390
|
-
warn$1(
|
|
6391
|
-
`Duplicate keys found during update:`,
|
|
6392
|
-
JSON.stringify(nextChild.key),
|
|
6393
|
-
`Make sure keys are unique.`
|
|
6394
|
-
);
|
|
6395
|
-
}
|
|
6396
4887
|
keyToNewIndexMap.set(nextChild.key, i);
|
|
6397
4888
|
}
|
|
6398
4889
|
}
|
|
@@ -6620,15 +5111,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6620
5111
|
const remove = (vnode) => {
|
|
6621
5112
|
const { type, el, anchor, transition } = vnode;
|
|
6622
5113
|
if (type === Fragment) {
|
|
6623
|
-
|
|
6624
|
-
vnode.children.forEach((child) => {
|
|
6625
|
-
if (child.type === Comment) {
|
|
6626
|
-
hostRemove(child.el);
|
|
6627
|
-
} else {
|
|
6628
|
-
remove(child);
|
|
6629
|
-
}
|
|
6630
|
-
});
|
|
6631
|
-
} else {
|
|
5114
|
+
{
|
|
6632
5115
|
removeFragment(el, anchor);
|
|
6633
5116
|
}
|
|
6634
5117
|
return;
|
|
@@ -6665,9 +5148,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6665
5148
|
hostRemove(end);
|
|
6666
5149
|
};
|
|
6667
5150
|
const unmountComponent = (instance, parentSuspense, doRemove) => {
|
|
6668
|
-
if (!!(process.env.NODE_ENV !== "production") && instance.type.__hmrId) {
|
|
6669
|
-
unregisterHMR(instance);
|
|
6670
|
-
}
|
|
6671
5151
|
const { bum, scope, job, subTree, um, m, a } = instance;
|
|
6672
5152
|
invalidateMount(m);
|
|
6673
5153
|
invalidateMount(a);
|
|
@@ -6685,9 +5165,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6685
5165
|
queuePostRenderEffect(() => {
|
|
6686
5166
|
instance.isUnmounted = true;
|
|
6687
5167
|
}, parentSuspense);
|
|
6688
|
-
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
6689
|
-
devtoolsComponentRemoved(instance);
|
|
6690
|
-
}
|
|
6691
5168
|
};
|
|
6692
5169
|
const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
|
|
6693
5170
|
for (let i = start; i < children.length; i++) {
|
|
@@ -6790,9 +5267,6 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
6790
5267
|
if (c2.type === Comment && !c2.el) {
|
|
6791
5268
|
c2.el = c1.el;
|
|
6792
5269
|
}
|
|
6793
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
6794
|
-
c2.el && (c2.el.__vnode = c2);
|
|
6795
|
-
}
|
|
6796
5270
|
}
|
|
6797
5271
|
}
|
|
6798
5272
|
}
|
|
@@ -6933,21 +5407,8 @@ function isVNode(value) {
|
|
|
6933
5407
|
return value ? value.__v_isVNode === true : false;
|
|
6934
5408
|
}
|
|
6935
5409
|
function isSameVNodeType(n1, n2) {
|
|
6936
|
-
if (!!(process.env.NODE_ENV !== "production") && n2.shapeFlag & 6 && n1.component) {
|
|
6937
|
-
const dirtyInstances = hmrDirtyComponents.get(n2.type);
|
|
6938
|
-
if (dirtyInstances && dirtyInstances.has(n1.component)) {
|
|
6939
|
-
n1.shapeFlag &= -257;
|
|
6940
|
-
n2.shapeFlag &= -513;
|
|
6941
|
-
return false;
|
|
6942
|
-
}
|
|
6943
|
-
}
|
|
6944
5410
|
return n1.type === n2.type && n1.key === n2.key;
|
|
6945
5411
|
}
|
|
6946
|
-
const createVNodeWithArgsTransform = (...args) => {
|
|
6947
|
-
return _createVNode(
|
|
6948
|
-
...args
|
|
6949
|
-
);
|
|
6950
|
-
};
|
|
6951
5412
|
const normalizeKey = ({ key }) => key != null ? key : null;
|
|
6952
5413
|
const normalizeRef = ({
|
|
6953
5414
|
ref,
|
|
@@ -6997,9 +5458,6 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
6997
5458
|
} else if (children) {
|
|
6998
5459
|
vnode.shapeFlag |= isString(children) ? 8 : 16;
|
|
6999
5460
|
}
|
|
7000
|
-
if (!!(process.env.NODE_ENV !== "production") && vnode.key !== vnode.key) {
|
|
7001
|
-
warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
|
|
7002
|
-
}
|
|
7003
5461
|
if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
|
|
7004
5462
|
!isBlockNode && // has current parent block
|
|
7005
5463
|
currentBlock && // presence of a patch flag indicates this node needs patching on updates.
|
|
@@ -7013,12 +5471,9 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
7013
5471
|
}
|
|
7014
5472
|
return vnode;
|
|
7015
5473
|
}
|
|
7016
|
-
const createVNode =
|
|
5474
|
+
const createVNode = _createVNode;
|
|
7017
5475
|
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
|
|
7018
5476
|
if (!type || type === NULL_DYNAMIC_COMPONENT) {
|
|
7019
|
-
if (!!(process.env.NODE_ENV !== "production") && !type) {
|
|
7020
|
-
warn$1(`Invalid vnode type when creating vnode: ${type}.`);
|
|
7021
|
-
}
|
|
7022
5477
|
type = Comment;
|
|
7023
5478
|
}
|
|
7024
5479
|
if (isVNode(type)) {
|
|
@@ -7058,15 +5513,6 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
7058
5513
|
}
|
|
7059
5514
|
}
|
|
7060
5515
|
const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0;
|
|
7061
|
-
if (!!(process.env.NODE_ENV !== "production") && shapeFlag & 4 && isProxy(type)) {
|
|
7062
|
-
type = toRaw(type);
|
|
7063
|
-
warn$1(
|
|
7064
|
-
`Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`,
|
|
7065
|
-
`
|
|
7066
|
-
Component that was made reactive: `,
|
|
7067
|
-
type
|
|
7068
|
-
);
|
|
7069
|
-
}
|
|
7070
5516
|
return createBaseVNode(
|
|
7071
5517
|
type,
|
|
7072
5518
|
props,
|
|
@@ -7099,7 +5545,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
7099
5545
|
) : ref,
|
|
7100
5546
|
scopeId: vnode.scopeId,
|
|
7101
5547
|
slotScopeIds: vnode.slotScopeIds,
|
|
7102
|
-
children:
|
|
5548
|
+
children: children,
|
|
7103
5549
|
target: vnode.target,
|
|
7104
5550
|
targetStart: vnode.targetStart,
|
|
7105
5551
|
targetAnchor: vnode.targetAnchor,
|
|
@@ -7137,13 +5583,6 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
7137
5583
|
}
|
|
7138
5584
|
return cloned;
|
|
7139
5585
|
}
|
|
7140
|
-
function deepCloneVNode(vnode) {
|
|
7141
|
-
const cloned = cloneVNode(vnode);
|
|
7142
|
-
if (isArray(vnode.children)) {
|
|
7143
|
-
cloned.children = vnode.children.map(deepCloneVNode);
|
|
7144
|
-
}
|
|
7145
|
-
return cloned;
|
|
7146
|
-
}
|
|
7147
5586
|
function createTextVNode(text = " ", flag = 0) {
|
|
7148
5587
|
return createVNode(Text, null, text, flag);
|
|
7149
5588
|
}
|
|
@@ -7326,9 +5765,7 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
7326
5765
|
ec: null,
|
|
7327
5766
|
sp: null
|
|
7328
5767
|
};
|
|
7329
|
-
|
|
7330
|
-
instance.ctx = createDevRenderContext(instance);
|
|
7331
|
-
} else {
|
|
5768
|
+
{
|
|
7332
5769
|
instance.ctx = { _: instance };
|
|
7333
5770
|
}
|
|
7334
5771
|
instance.root = parent ? parent.root : instance;
|
|
@@ -7375,14 +5812,6 @@ const unsetCurrentInstance = () => {
|
|
|
7375
5812
|
currentInstance && currentInstance.scope.off();
|
|
7376
5813
|
internalSetCurrentInstance(null);
|
|
7377
5814
|
};
|
|
7378
|
-
const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
|
|
7379
|
-
function validateComponentName(name, { isNativeTag }) {
|
|
7380
|
-
if (isBuiltInTag(name) || isNativeTag(name)) {
|
|
7381
|
-
warn$1(
|
|
7382
|
-
"Do not use built-in or reserved HTML elements as component id: " + name
|
|
7383
|
-
);
|
|
7384
|
-
}
|
|
7385
|
-
}
|
|
7386
5815
|
function isStatefulComponent(instance) {
|
|
7387
5816
|
return instance.vnode.shapeFlag & 4;
|
|
7388
5817
|
}
|
|
@@ -7399,33 +5828,8 @@ function setupComponent(instance, isSSR = false, optimized = false) {
|
|
|
7399
5828
|
}
|
|
7400
5829
|
function setupStatefulComponent(instance, isSSR) {
|
|
7401
5830
|
const Component = instance.type;
|
|
7402
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
7403
|
-
if (Component.name) {
|
|
7404
|
-
validateComponentName(Component.name, instance.appContext.config);
|
|
7405
|
-
}
|
|
7406
|
-
if (Component.components) {
|
|
7407
|
-
const names = Object.keys(Component.components);
|
|
7408
|
-
for (let i = 0; i < names.length; i++) {
|
|
7409
|
-
validateComponentName(names[i], instance.appContext.config);
|
|
7410
|
-
}
|
|
7411
|
-
}
|
|
7412
|
-
if (Component.directives) {
|
|
7413
|
-
const names = Object.keys(Component.directives);
|
|
7414
|
-
for (let i = 0; i < names.length; i++) {
|
|
7415
|
-
validateDirectiveName(names[i]);
|
|
7416
|
-
}
|
|
7417
|
-
}
|
|
7418
|
-
if (Component.compilerOptions && isRuntimeOnly()) {
|
|
7419
|
-
warn$1(
|
|
7420
|
-
`"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.`
|
|
7421
|
-
);
|
|
7422
|
-
}
|
|
7423
|
-
}
|
|
7424
5831
|
instance.accessCache = /* @__PURE__ */ Object.create(null);
|
|
7425
5832
|
instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
|
|
7426
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
7427
|
-
exposePropsOnRenderContext(instance);
|
|
7428
|
-
}
|
|
7429
5833
|
const { setup } = Component;
|
|
7430
5834
|
if (setup) {
|
|
7431
5835
|
pauseTracking();
|
|
@@ -7436,7 +5840,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
7436
5840
|
instance,
|
|
7437
5841
|
0,
|
|
7438
5842
|
[
|
|
7439
|
-
|
|
5843
|
+
instance.props,
|
|
7440
5844
|
setupContext
|
|
7441
5845
|
]
|
|
7442
5846
|
);
|
|
@@ -7450,24 +5854,18 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
7450
5854
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
7451
5855
|
if (isSSR) {
|
|
7452
5856
|
return setupResult.then((resolvedResult) => {
|
|
7453
|
-
handleSetupResult(instance, resolvedResult
|
|
5857
|
+
handleSetupResult(instance, resolvedResult);
|
|
7454
5858
|
}).catch((e) => {
|
|
7455
5859
|
handleError(e, instance, 0);
|
|
7456
5860
|
});
|
|
7457
5861
|
} else {
|
|
7458
5862
|
instance.asyncDep = setupResult;
|
|
7459
|
-
if (!!(process.env.NODE_ENV !== "production") && !instance.suspense) {
|
|
7460
|
-
const name = formatComponentName(instance, Component);
|
|
7461
|
-
warn$1(
|
|
7462
|
-
`Component <${name}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`
|
|
7463
|
-
);
|
|
7464
|
-
}
|
|
7465
5863
|
}
|
|
7466
5864
|
} else {
|
|
7467
|
-
handleSetupResult(instance, setupResult
|
|
5865
|
+
handleSetupResult(instance, setupResult);
|
|
7468
5866
|
}
|
|
7469
5867
|
} else {
|
|
7470
|
-
finishComponentSetup(instance
|
|
5868
|
+
finishComponentSetup(instance);
|
|
7471
5869
|
}
|
|
7472
5870
|
}
|
|
7473
5871
|
function handleSetupResult(instance, setupResult, isSSR) {
|
|
@@ -7478,32 +5876,16 @@ function handleSetupResult(instance, setupResult, isSSR) {
|
|
|
7478
5876
|
instance.render = setupResult;
|
|
7479
5877
|
}
|
|
7480
5878
|
} else if (isObject(setupResult)) {
|
|
7481
|
-
if (!!(process.env.NODE_ENV !== "production") && isVNode(setupResult)) {
|
|
7482
|
-
warn$1(
|
|
7483
|
-
`setup() should not return VNodes directly - return a render function instead.`
|
|
7484
|
-
);
|
|
7485
|
-
}
|
|
7486
|
-
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
7487
|
-
instance.devtoolsRawSetupState = setupResult;
|
|
7488
|
-
}
|
|
7489
5879
|
instance.setupState = proxyRefs(setupResult);
|
|
7490
|
-
|
|
7491
|
-
|
|
7492
|
-
}
|
|
7493
|
-
} else if (!!(process.env.NODE_ENV !== "production") && setupResult !== void 0) {
|
|
7494
|
-
warn$1(
|
|
7495
|
-
`setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}`
|
|
7496
|
-
);
|
|
7497
|
-
}
|
|
7498
|
-
finishComponentSetup(instance, isSSR);
|
|
5880
|
+
} else ;
|
|
5881
|
+
finishComponentSetup(instance);
|
|
7499
5882
|
}
|
|
7500
|
-
const isRuntimeOnly = () => true;
|
|
7501
5883
|
function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
7502
5884
|
const Component = instance.type;
|
|
7503
5885
|
if (!instance.render) {
|
|
7504
5886
|
instance.render = Component.render || NOOP;
|
|
7505
5887
|
}
|
|
7506
|
-
|
|
5888
|
+
{
|
|
7507
5889
|
const reset = setCurrentInstance(instance);
|
|
7508
5890
|
pauseTracking();
|
|
7509
5891
|
try {
|
|
@@ -7513,84 +5895,18 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
7513
5895
|
reset();
|
|
7514
5896
|
}
|
|
7515
5897
|
}
|
|
7516
|
-
if (!!(process.env.NODE_ENV !== "production") && !Component.render && instance.render === NOOP && !isSSR) {
|
|
7517
|
-
if (Component.template) {
|
|
7518
|
-
warn$1(
|
|
7519
|
-
`Component provided template option but runtime compilation is not supported in this build of Vue.` + (` Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".` )
|
|
7520
|
-
);
|
|
7521
|
-
} else {
|
|
7522
|
-
warn$1(`Component is missing template or render function: `, Component);
|
|
7523
|
-
}
|
|
7524
|
-
}
|
|
7525
5898
|
}
|
|
7526
|
-
const attrsProxyHandlers =
|
|
7527
|
-
get(target, key) {
|
|
7528
|
-
markAttrsAccessed();
|
|
7529
|
-
track(target, "get", "");
|
|
7530
|
-
return target[key];
|
|
7531
|
-
},
|
|
7532
|
-
set() {
|
|
7533
|
-
warn$1(`setupContext.attrs is readonly.`);
|
|
7534
|
-
return false;
|
|
7535
|
-
},
|
|
7536
|
-
deleteProperty() {
|
|
7537
|
-
warn$1(`setupContext.attrs is readonly.`);
|
|
7538
|
-
return false;
|
|
7539
|
-
}
|
|
7540
|
-
} : {
|
|
5899
|
+
const attrsProxyHandlers = {
|
|
7541
5900
|
get(target, key) {
|
|
7542
5901
|
track(target, "get", "");
|
|
7543
5902
|
return target[key];
|
|
7544
5903
|
}
|
|
7545
5904
|
};
|
|
7546
|
-
function getSlotsProxy(instance) {
|
|
7547
|
-
return new Proxy(instance.slots, {
|
|
7548
|
-
get(target, key) {
|
|
7549
|
-
track(instance, "get", "$slots");
|
|
7550
|
-
return target[key];
|
|
7551
|
-
}
|
|
7552
|
-
});
|
|
7553
|
-
}
|
|
7554
5905
|
function createSetupContext(instance) {
|
|
7555
5906
|
const expose = (exposed) => {
|
|
7556
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
7557
|
-
if (instance.exposed) {
|
|
7558
|
-
warn$1(`expose() should be called only once per setup().`);
|
|
7559
|
-
}
|
|
7560
|
-
if (exposed != null) {
|
|
7561
|
-
let exposedType = typeof exposed;
|
|
7562
|
-
if (exposedType === "object") {
|
|
7563
|
-
if (isArray(exposed)) {
|
|
7564
|
-
exposedType = "array";
|
|
7565
|
-
} else if (isRef(exposed)) {
|
|
7566
|
-
exposedType = "ref";
|
|
7567
|
-
}
|
|
7568
|
-
}
|
|
7569
|
-
if (exposedType !== "object") {
|
|
7570
|
-
warn$1(
|
|
7571
|
-
`expose() should be passed a plain object, received ${exposedType}.`
|
|
7572
|
-
);
|
|
7573
|
-
}
|
|
7574
|
-
}
|
|
7575
|
-
}
|
|
7576
5907
|
instance.exposed = exposed || {};
|
|
7577
5908
|
};
|
|
7578
|
-
|
|
7579
|
-
let attrsProxy;
|
|
7580
|
-
let slotsProxy;
|
|
7581
|
-
return Object.freeze({
|
|
7582
|
-
get attrs() {
|
|
7583
|
-
return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers));
|
|
7584
|
-
},
|
|
7585
|
-
get slots() {
|
|
7586
|
-
return slotsProxy || (slotsProxy = getSlotsProxy(instance));
|
|
7587
|
-
},
|
|
7588
|
-
get emit() {
|
|
7589
|
-
return (event, ...args) => instance.emit(event, ...args);
|
|
7590
|
-
},
|
|
7591
|
-
expose
|
|
7592
|
-
});
|
|
7593
|
-
} else {
|
|
5909
|
+
{
|
|
7594
5910
|
return {
|
|
7595
5911
|
attrs: new Proxy(instance.attrs, attrsProxyHandlers),
|
|
7596
5912
|
slots: instance.slots,
|
|
@@ -7650,225 +5966,10 @@ function isClassComponent(value) {
|
|
|
7650
5966
|
|
|
7651
5967
|
const computed = (getterOrOptions, debugOptions) => {
|
|
7652
5968
|
const c = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
7653
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
7654
|
-
const i = getCurrentInstance();
|
|
7655
|
-
if (i && i.appContext.config.warnRecursiveComputed) {
|
|
7656
|
-
c._warnRecursive = true;
|
|
7657
|
-
}
|
|
7658
|
-
}
|
|
7659
5969
|
return c;
|
|
7660
5970
|
};
|
|
7661
5971
|
|
|
7662
|
-
function h(type, propsOrChildren, children) {
|
|
7663
|
-
try {
|
|
7664
|
-
setBlockTracking(-1);
|
|
7665
|
-
const l = arguments.length;
|
|
7666
|
-
if (l === 2) {
|
|
7667
|
-
if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
|
|
7668
|
-
if (isVNode(propsOrChildren)) {
|
|
7669
|
-
return createVNode(type, null, [propsOrChildren]);
|
|
7670
|
-
}
|
|
7671
|
-
return createVNode(type, propsOrChildren);
|
|
7672
|
-
} else {
|
|
7673
|
-
return createVNode(type, null, propsOrChildren);
|
|
7674
|
-
}
|
|
7675
|
-
} else {
|
|
7676
|
-
if (l > 3) {
|
|
7677
|
-
children = Array.prototype.slice.call(arguments, 2);
|
|
7678
|
-
} else if (l === 3 && isVNode(children)) {
|
|
7679
|
-
children = [children];
|
|
7680
|
-
}
|
|
7681
|
-
return createVNode(type, propsOrChildren, children);
|
|
7682
|
-
}
|
|
7683
|
-
} finally {
|
|
7684
|
-
setBlockTracking(1);
|
|
7685
|
-
}
|
|
7686
|
-
}
|
|
7687
|
-
|
|
7688
|
-
function initCustomFormatter() {
|
|
7689
|
-
if (!!!(process.env.NODE_ENV !== "production") || typeof window === "undefined") {
|
|
7690
|
-
return;
|
|
7691
|
-
}
|
|
7692
|
-
const vueStyle = { style: "color:#3ba776" };
|
|
7693
|
-
const numberStyle = { style: "color:#1677ff" };
|
|
7694
|
-
const stringStyle = { style: "color:#f5222d" };
|
|
7695
|
-
const keywordStyle = { style: "color:#eb2f96" };
|
|
7696
|
-
const formatter = {
|
|
7697
|
-
__vue_custom_formatter: true,
|
|
7698
|
-
header(obj) {
|
|
7699
|
-
if (!isObject(obj)) {
|
|
7700
|
-
return null;
|
|
7701
|
-
}
|
|
7702
|
-
if (obj.__isVue) {
|
|
7703
|
-
return ["div", vueStyle, `VueInstance`];
|
|
7704
|
-
} else if (isRef(obj)) {
|
|
7705
|
-
pauseTracking();
|
|
7706
|
-
const value = obj.value;
|
|
7707
|
-
resetTracking();
|
|
7708
|
-
return [
|
|
7709
|
-
"div",
|
|
7710
|
-
{},
|
|
7711
|
-
["span", vueStyle, genRefFlag(obj)],
|
|
7712
|
-
"<",
|
|
7713
|
-
formatValue(value),
|
|
7714
|
-
`>`
|
|
7715
|
-
];
|
|
7716
|
-
} else if (isReactive(obj)) {
|
|
7717
|
-
return [
|
|
7718
|
-
"div",
|
|
7719
|
-
{},
|
|
7720
|
-
["span", vueStyle, isShallow(obj) ? "ShallowReactive" : "Reactive"],
|
|
7721
|
-
"<",
|
|
7722
|
-
formatValue(obj),
|
|
7723
|
-
`>${isReadonly(obj) ? ` (readonly)` : ``}`
|
|
7724
|
-
];
|
|
7725
|
-
} else if (isReadonly(obj)) {
|
|
7726
|
-
return [
|
|
7727
|
-
"div",
|
|
7728
|
-
{},
|
|
7729
|
-
["span", vueStyle, isShallow(obj) ? "ShallowReadonly" : "Readonly"],
|
|
7730
|
-
"<",
|
|
7731
|
-
formatValue(obj),
|
|
7732
|
-
">"
|
|
7733
|
-
];
|
|
7734
|
-
}
|
|
7735
|
-
return null;
|
|
7736
|
-
},
|
|
7737
|
-
hasBody(obj) {
|
|
7738
|
-
return obj && obj.__isVue;
|
|
7739
|
-
},
|
|
7740
|
-
body(obj) {
|
|
7741
|
-
if (obj && obj.__isVue) {
|
|
7742
|
-
return [
|
|
7743
|
-
"div",
|
|
7744
|
-
{},
|
|
7745
|
-
...formatInstance(obj.$)
|
|
7746
|
-
];
|
|
7747
|
-
}
|
|
7748
|
-
}
|
|
7749
|
-
};
|
|
7750
|
-
function formatInstance(instance) {
|
|
7751
|
-
const blocks = [];
|
|
7752
|
-
if (instance.type.props && instance.props) {
|
|
7753
|
-
blocks.push(createInstanceBlock("props", toRaw(instance.props)));
|
|
7754
|
-
}
|
|
7755
|
-
if (instance.setupState !== EMPTY_OBJ) {
|
|
7756
|
-
blocks.push(createInstanceBlock("setup", instance.setupState));
|
|
7757
|
-
}
|
|
7758
|
-
if (instance.data !== EMPTY_OBJ) {
|
|
7759
|
-
blocks.push(createInstanceBlock("data", toRaw(instance.data)));
|
|
7760
|
-
}
|
|
7761
|
-
const computed = extractKeys(instance, "computed");
|
|
7762
|
-
if (computed) {
|
|
7763
|
-
blocks.push(createInstanceBlock("computed", computed));
|
|
7764
|
-
}
|
|
7765
|
-
const injected = extractKeys(instance, "inject");
|
|
7766
|
-
if (injected) {
|
|
7767
|
-
blocks.push(createInstanceBlock("injected", injected));
|
|
7768
|
-
}
|
|
7769
|
-
blocks.push([
|
|
7770
|
-
"div",
|
|
7771
|
-
{},
|
|
7772
|
-
[
|
|
7773
|
-
"span",
|
|
7774
|
-
{
|
|
7775
|
-
style: keywordStyle.style + ";opacity:0.66"
|
|
7776
|
-
},
|
|
7777
|
-
"$ (internal): "
|
|
7778
|
-
],
|
|
7779
|
-
["object", { object: instance }]
|
|
7780
|
-
]);
|
|
7781
|
-
return blocks;
|
|
7782
|
-
}
|
|
7783
|
-
function createInstanceBlock(type, target) {
|
|
7784
|
-
target = extend({}, target);
|
|
7785
|
-
if (!Object.keys(target).length) {
|
|
7786
|
-
return ["span", {}];
|
|
7787
|
-
}
|
|
7788
|
-
return [
|
|
7789
|
-
"div",
|
|
7790
|
-
{ style: "line-height:1.25em;margin-bottom:0.6em" },
|
|
7791
|
-
[
|
|
7792
|
-
"div",
|
|
7793
|
-
{
|
|
7794
|
-
style: "color:#476582"
|
|
7795
|
-
},
|
|
7796
|
-
type
|
|
7797
|
-
],
|
|
7798
|
-
[
|
|
7799
|
-
"div",
|
|
7800
|
-
{
|
|
7801
|
-
style: "padding-left:1.25em"
|
|
7802
|
-
},
|
|
7803
|
-
...Object.keys(target).map((key) => {
|
|
7804
|
-
return [
|
|
7805
|
-
"div",
|
|
7806
|
-
{},
|
|
7807
|
-
["span", keywordStyle, key + ": "],
|
|
7808
|
-
formatValue(target[key], false)
|
|
7809
|
-
];
|
|
7810
|
-
})
|
|
7811
|
-
]
|
|
7812
|
-
];
|
|
7813
|
-
}
|
|
7814
|
-
function formatValue(v, asRaw = true) {
|
|
7815
|
-
if (typeof v === "number") {
|
|
7816
|
-
return ["span", numberStyle, v];
|
|
7817
|
-
} else if (typeof v === "string") {
|
|
7818
|
-
return ["span", stringStyle, JSON.stringify(v)];
|
|
7819
|
-
} else if (typeof v === "boolean") {
|
|
7820
|
-
return ["span", keywordStyle, v];
|
|
7821
|
-
} else if (isObject(v)) {
|
|
7822
|
-
return ["object", { object: asRaw ? toRaw(v) : v }];
|
|
7823
|
-
} else {
|
|
7824
|
-
return ["span", stringStyle, String(v)];
|
|
7825
|
-
}
|
|
7826
|
-
}
|
|
7827
|
-
function extractKeys(instance, type) {
|
|
7828
|
-
const Comp = instance.type;
|
|
7829
|
-
if (isFunction(Comp)) {
|
|
7830
|
-
return;
|
|
7831
|
-
}
|
|
7832
|
-
const extracted = {};
|
|
7833
|
-
for (const key in instance.ctx) {
|
|
7834
|
-
if (isKeyOfType(Comp, key, type)) {
|
|
7835
|
-
extracted[key] = instance.ctx[key];
|
|
7836
|
-
}
|
|
7837
|
-
}
|
|
7838
|
-
return extracted;
|
|
7839
|
-
}
|
|
7840
|
-
function isKeyOfType(Comp, key, type) {
|
|
7841
|
-
const opts = Comp[type];
|
|
7842
|
-
if (isArray(opts) && opts.includes(key) || isObject(opts) && key in opts) {
|
|
7843
|
-
return true;
|
|
7844
|
-
}
|
|
7845
|
-
if (Comp.extends && isKeyOfType(Comp.extends, key, type)) {
|
|
7846
|
-
return true;
|
|
7847
|
-
}
|
|
7848
|
-
if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) {
|
|
7849
|
-
return true;
|
|
7850
|
-
}
|
|
7851
|
-
}
|
|
7852
|
-
function genRefFlag(v) {
|
|
7853
|
-
if (isShallow(v)) {
|
|
7854
|
-
return `ShallowRef`;
|
|
7855
|
-
}
|
|
7856
|
-
if (v.effect) {
|
|
7857
|
-
return `ComputedRef`;
|
|
7858
|
-
}
|
|
7859
|
-
return `Ref`;
|
|
7860
|
-
}
|
|
7861
|
-
if (window.devtoolsFormatters) {
|
|
7862
|
-
window.devtoolsFormatters.push(formatter);
|
|
7863
|
-
} else {
|
|
7864
|
-
window.devtoolsFormatters = [formatter];
|
|
7865
|
-
}
|
|
7866
|
-
}
|
|
7867
|
-
|
|
7868
5972
|
const version = "3.5.30";
|
|
7869
|
-
const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
|
|
7870
|
-
!!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
|
|
7871
|
-
!!(process.env.NODE_ENV !== "production") || true ? setDevtoolsHook$1 : NOOP;
|
|
7872
5973
|
|
|
7873
5974
|
/**
|
|
7874
5975
|
* @vue/runtime-dom v3.5.30
|
|
@@ -7884,7 +5985,6 @@ if (tt) {
|
|
|
7884
5985
|
createHTML: (val) => val
|
|
7885
5986
|
});
|
|
7886
5987
|
} catch (e) {
|
|
7887
|
-
!!(process.env.NODE_ENV !== "production") && warn(`Error creating trusted types policy: ${e}`);
|
|
7888
5988
|
}
|
|
7889
5989
|
}
|
|
7890
5990
|
const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) => val;
|
|
@@ -8015,7 +6115,7 @@ function setDisplay(el, value) {
|
|
|
8015
6115
|
el[vShowHidden] = !value;
|
|
8016
6116
|
}
|
|
8017
6117
|
|
|
8018
|
-
const CSS_VAR_TEXT = /* @__PURE__ */ Symbol(
|
|
6118
|
+
const CSS_VAR_TEXT = /* @__PURE__ */ Symbol("");
|
|
8019
6119
|
|
|
8020
6120
|
const displayRE = /(?:^|;)\s*display\s*:/;
|
|
8021
6121
|
function patchStyle(el, prev, next) {
|
|
@@ -8066,20 +6166,12 @@ function patchStyle(el, prev, next) {
|
|
|
8066
6166
|
}
|
|
8067
6167
|
}
|
|
8068
6168
|
}
|
|
8069
|
-
const semicolonRE = /[^\\];\s*$/;
|
|
8070
6169
|
const importantRE = /\s*!important$/;
|
|
8071
6170
|
function setStyle(style, name, val) {
|
|
8072
6171
|
if (isArray(val)) {
|
|
8073
6172
|
val.forEach((v) => setStyle(style, name, v));
|
|
8074
6173
|
} else {
|
|
8075
6174
|
if (val == null) val = "";
|
|
8076
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
8077
|
-
if (semicolonRE.test(val)) {
|
|
8078
|
-
warn(
|
|
8079
|
-
`Unexpected semicolon at the end of '${name}' style value: '${val}'`
|
|
8080
|
-
);
|
|
8081
|
-
}
|
|
8082
|
-
}
|
|
8083
6175
|
if (name.startsWith("--")) {
|
|
8084
6176
|
style.setProperty(name, val);
|
|
8085
6177
|
} else {
|
|
@@ -8178,12 +6270,6 @@ function patchDOMProp(el, key, value, parentComponent, attrName) {
|
|
|
8178
6270
|
try {
|
|
8179
6271
|
el[key] = value;
|
|
8180
6272
|
} catch (e) {
|
|
8181
|
-
if (!!(process.env.NODE_ENV !== "production") && !needRemove) {
|
|
8182
|
-
warn(
|
|
8183
|
-
`Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`,
|
|
8184
|
-
e
|
|
8185
|
-
);
|
|
8186
|
-
}
|
|
8187
6273
|
}
|
|
8188
6274
|
needRemove && el.removeAttribute(attrName || key);
|
|
8189
6275
|
}
|
|
@@ -8199,12 +6285,12 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
|
|
|
8199
6285
|
const invokers = el[veiKey] || (el[veiKey] = {});
|
|
8200
6286
|
const existingInvoker = invokers[rawName];
|
|
8201
6287
|
if (nextValue && existingInvoker) {
|
|
8202
|
-
existingInvoker.value =
|
|
6288
|
+
existingInvoker.value = nextValue;
|
|
8203
6289
|
} else {
|
|
8204
6290
|
const [name, options] = parseName(rawName);
|
|
8205
6291
|
if (nextValue) {
|
|
8206
6292
|
const invoker = invokers[rawName] = createInvoker(
|
|
8207
|
-
|
|
6293
|
+
nextValue,
|
|
8208
6294
|
instance
|
|
8209
6295
|
);
|
|
8210
6296
|
addEventListener(el, name, invoker, options);
|
|
@@ -8249,16 +6335,6 @@ function createInvoker(initialValue, instance) {
|
|
|
8249
6335
|
invoker.attached = getNow();
|
|
8250
6336
|
return invoker;
|
|
8251
6337
|
}
|
|
8252
|
-
function sanitizeEventValue(value, propName) {
|
|
8253
|
-
if (isFunction(value) || isArray(value)) {
|
|
8254
|
-
return value;
|
|
8255
|
-
}
|
|
8256
|
-
warn(
|
|
8257
|
-
`Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?
|
|
8258
|
-
Expected function or array of functions, received type ${typeof value}.`
|
|
8259
|
-
);
|
|
8260
|
-
return NOOP;
|
|
8261
|
-
}
|
|
8262
6338
|
function patchStopImmediatePropagation(e, value) {
|
|
8263
6339
|
if (isArray(value)) {
|
|
8264
6340
|
const originalStop = e.stopImmediatePropagation;
|
|
@@ -8355,6 +6431,437 @@ function shouldSetAsPropForVueCE(el, key) {
|
|
|
8355
6431
|
return Array.isArray(props) ? props.some((prop) => camelize(prop) === camelKey) : Object.keys(props).some((prop) => camelize(prop) === camelKey);
|
|
8356
6432
|
}
|
|
8357
6433
|
|
|
6434
|
+
const REMOVAL = {};
|
|
6435
|
+
// @__NO_SIDE_EFFECTS__
|
|
6436
|
+
function defineCustomElement(options, extraOptions, _createApp) {
|
|
6437
|
+
let Comp = defineComponent(options, extraOptions);
|
|
6438
|
+
if (isPlainObject(Comp)) Comp = extend({}, Comp, extraOptions);
|
|
6439
|
+
class VueCustomElement extends VueElement {
|
|
6440
|
+
constructor(initialProps) {
|
|
6441
|
+
super(Comp, initialProps, _createApp);
|
|
6442
|
+
}
|
|
6443
|
+
}
|
|
6444
|
+
VueCustomElement.def = Comp;
|
|
6445
|
+
return VueCustomElement;
|
|
6446
|
+
}
|
|
6447
|
+
const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
|
|
6448
|
+
};
|
|
6449
|
+
class VueElement extends BaseClass {
|
|
6450
|
+
constructor(_def, _props = {}, _createApp = createApp) {
|
|
6451
|
+
super();
|
|
6452
|
+
this._def = _def;
|
|
6453
|
+
this._props = _props;
|
|
6454
|
+
this._createApp = _createApp;
|
|
6455
|
+
this._isVueCE = true;
|
|
6456
|
+
/**
|
|
6457
|
+
* @internal
|
|
6458
|
+
*/
|
|
6459
|
+
this._instance = null;
|
|
6460
|
+
/**
|
|
6461
|
+
* @internal
|
|
6462
|
+
*/
|
|
6463
|
+
this._app = null;
|
|
6464
|
+
/**
|
|
6465
|
+
* @internal
|
|
6466
|
+
*/
|
|
6467
|
+
this._nonce = this._def.nonce;
|
|
6468
|
+
this._connected = false;
|
|
6469
|
+
this._resolved = false;
|
|
6470
|
+
this._patching = false;
|
|
6471
|
+
this._dirty = false;
|
|
6472
|
+
this._numberProps = null;
|
|
6473
|
+
this._styleChildren = /* @__PURE__ */ new WeakSet();
|
|
6474
|
+
this._styleAnchors = /* @__PURE__ */ new WeakMap();
|
|
6475
|
+
this._ob = null;
|
|
6476
|
+
if (this.shadowRoot && _createApp !== createApp) {
|
|
6477
|
+
this._root = this.shadowRoot;
|
|
6478
|
+
} else {
|
|
6479
|
+
if (_def.shadowRoot !== false) {
|
|
6480
|
+
this.attachShadow(
|
|
6481
|
+
extend({}, _def.shadowRootOptions, {
|
|
6482
|
+
mode: "open"
|
|
6483
|
+
})
|
|
6484
|
+
);
|
|
6485
|
+
this._root = this.shadowRoot;
|
|
6486
|
+
} else {
|
|
6487
|
+
this._root = this;
|
|
6488
|
+
}
|
|
6489
|
+
}
|
|
6490
|
+
}
|
|
6491
|
+
connectedCallback() {
|
|
6492
|
+
if (!this.isConnected) return;
|
|
6493
|
+
if (!this.shadowRoot && !this._resolved) {
|
|
6494
|
+
this._parseSlots();
|
|
6495
|
+
}
|
|
6496
|
+
this._connected = true;
|
|
6497
|
+
let parent = this;
|
|
6498
|
+
while (parent = parent && // #12479 should check assignedSlot first to get correct parent
|
|
6499
|
+
(parent.assignedSlot || parent.parentNode || parent.host)) {
|
|
6500
|
+
if (parent instanceof VueElement) {
|
|
6501
|
+
this._parent = parent;
|
|
6502
|
+
break;
|
|
6503
|
+
}
|
|
6504
|
+
}
|
|
6505
|
+
if (!this._instance) {
|
|
6506
|
+
if (this._resolved) {
|
|
6507
|
+
this._mount(this._def);
|
|
6508
|
+
} else {
|
|
6509
|
+
if (parent && parent._pendingResolve) {
|
|
6510
|
+
this._pendingResolve = parent._pendingResolve.then(() => {
|
|
6511
|
+
this._pendingResolve = void 0;
|
|
6512
|
+
this._resolveDef();
|
|
6513
|
+
});
|
|
6514
|
+
} else {
|
|
6515
|
+
this._resolveDef();
|
|
6516
|
+
}
|
|
6517
|
+
}
|
|
6518
|
+
}
|
|
6519
|
+
}
|
|
6520
|
+
_setParent(parent = this._parent) {
|
|
6521
|
+
if (parent) {
|
|
6522
|
+
this._instance.parent = parent._instance;
|
|
6523
|
+
this._inheritParentContext(parent);
|
|
6524
|
+
}
|
|
6525
|
+
}
|
|
6526
|
+
_inheritParentContext(parent = this._parent) {
|
|
6527
|
+
if (parent && this._app) {
|
|
6528
|
+
Object.setPrototypeOf(
|
|
6529
|
+
this._app._context.provides,
|
|
6530
|
+
parent._instance.provides
|
|
6531
|
+
);
|
|
6532
|
+
}
|
|
6533
|
+
}
|
|
6534
|
+
disconnectedCallback() {
|
|
6535
|
+
this._connected = false;
|
|
6536
|
+
nextTick(() => {
|
|
6537
|
+
if (!this._connected) {
|
|
6538
|
+
if (this._ob) {
|
|
6539
|
+
this._ob.disconnect();
|
|
6540
|
+
this._ob = null;
|
|
6541
|
+
}
|
|
6542
|
+
this._app && this._app.unmount();
|
|
6543
|
+
if (this._instance) this._instance.ce = void 0;
|
|
6544
|
+
this._app = this._instance = null;
|
|
6545
|
+
if (this._teleportTargets) {
|
|
6546
|
+
this._teleportTargets.clear();
|
|
6547
|
+
this._teleportTargets = void 0;
|
|
6548
|
+
}
|
|
6549
|
+
}
|
|
6550
|
+
});
|
|
6551
|
+
}
|
|
6552
|
+
_processMutations(mutations) {
|
|
6553
|
+
for (const m of mutations) {
|
|
6554
|
+
this._setAttr(m.attributeName);
|
|
6555
|
+
}
|
|
6556
|
+
}
|
|
6557
|
+
/**
|
|
6558
|
+
* resolve inner component definition (handle possible async component)
|
|
6559
|
+
*/
|
|
6560
|
+
_resolveDef() {
|
|
6561
|
+
if (this._pendingResolve) {
|
|
6562
|
+
return;
|
|
6563
|
+
}
|
|
6564
|
+
for (let i = 0; i < this.attributes.length; i++) {
|
|
6565
|
+
this._setAttr(this.attributes[i].name);
|
|
6566
|
+
}
|
|
6567
|
+
this._ob = new MutationObserver(this._processMutations.bind(this));
|
|
6568
|
+
this._ob.observe(this, { attributes: true });
|
|
6569
|
+
const resolve = (def, isAsync = false) => {
|
|
6570
|
+
this._resolved = true;
|
|
6571
|
+
this._pendingResolve = void 0;
|
|
6572
|
+
const { props, styles } = def;
|
|
6573
|
+
let numberProps;
|
|
6574
|
+
if (props && !isArray(props)) {
|
|
6575
|
+
for (const key in props) {
|
|
6576
|
+
const opt = props[key];
|
|
6577
|
+
if (opt === Number || opt && opt.type === Number) {
|
|
6578
|
+
if (key in this._props) {
|
|
6579
|
+
this._props[key] = toNumber(this._props[key]);
|
|
6580
|
+
}
|
|
6581
|
+
(numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize(key)] = true;
|
|
6582
|
+
}
|
|
6583
|
+
}
|
|
6584
|
+
}
|
|
6585
|
+
this._numberProps = numberProps;
|
|
6586
|
+
this._resolveProps(def);
|
|
6587
|
+
if (this.shadowRoot) {
|
|
6588
|
+
this._applyStyles(styles);
|
|
6589
|
+
}
|
|
6590
|
+
this._mount(def);
|
|
6591
|
+
};
|
|
6592
|
+
const asyncDef = this._def.__asyncLoader;
|
|
6593
|
+
if (asyncDef) {
|
|
6594
|
+
this._pendingResolve = asyncDef().then((def) => {
|
|
6595
|
+
def.configureApp = this._def.configureApp;
|
|
6596
|
+
resolve(this._def = def, true);
|
|
6597
|
+
});
|
|
6598
|
+
} else {
|
|
6599
|
+
resolve(this._def);
|
|
6600
|
+
}
|
|
6601
|
+
}
|
|
6602
|
+
_mount(def) {
|
|
6603
|
+
this._app = this._createApp(def);
|
|
6604
|
+
this._inheritParentContext();
|
|
6605
|
+
if (def.configureApp) {
|
|
6606
|
+
def.configureApp(this._app);
|
|
6607
|
+
}
|
|
6608
|
+
this._app._ceVNode = this._createVNode();
|
|
6609
|
+
this._app.mount(this._root);
|
|
6610
|
+
const exposed = this._instance && this._instance.exposed;
|
|
6611
|
+
if (!exposed) return;
|
|
6612
|
+
for (const key in exposed) {
|
|
6613
|
+
if (!hasOwn(this, key)) {
|
|
6614
|
+
Object.defineProperty(this, key, {
|
|
6615
|
+
// unwrap ref to be consistent with public instance behavior
|
|
6616
|
+
get: () => unref(exposed[key])
|
|
6617
|
+
});
|
|
6618
|
+
}
|
|
6619
|
+
}
|
|
6620
|
+
}
|
|
6621
|
+
_resolveProps(def) {
|
|
6622
|
+
const { props } = def;
|
|
6623
|
+
const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
|
|
6624
|
+
for (const key of Object.keys(this)) {
|
|
6625
|
+
if (key[0] !== "_" && declaredPropKeys.includes(key)) {
|
|
6626
|
+
this._setProp(key, this[key]);
|
|
6627
|
+
}
|
|
6628
|
+
}
|
|
6629
|
+
for (const key of declaredPropKeys.map(camelize)) {
|
|
6630
|
+
Object.defineProperty(this, key, {
|
|
6631
|
+
get() {
|
|
6632
|
+
return this._getProp(key);
|
|
6633
|
+
},
|
|
6634
|
+
set(val) {
|
|
6635
|
+
this._setProp(key, val, true, !this._patching);
|
|
6636
|
+
}
|
|
6637
|
+
});
|
|
6638
|
+
}
|
|
6639
|
+
}
|
|
6640
|
+
_setAttr(key) {
|
|
6641
|
+
if (key.startsWith("data-v-")) return;
|
|
6642
|
+
const has = this.hasAttribute(key);
|
|
6643
|
+
let value = has ? this.getAttribute(key) : REMOVAL;
|
|
6644
|
+
const camelKey = camelize(key);
|
|
6645
|
+
if (has && this._numberProps && this._numberProps[camelKey]) {
|
|
6646
|
+
value = toNumber(value);
|
|
6647
|
+
}
|
|
6648
|
+
this._setProp(camelKey, value, false, true);
|
|
6649
|
+
}
|
|
6650
|
+
/**
|
|
6651
|
+
* @internal
|
|
6652
|
+
*/
|
|
6653
|
+
_getProp(key) {
|
|
6654
|
+
return this._props[key];
|
|
6655
|
+
}
|
|
6656
|
+
/**
|
|
6657
|
+
* @internal
|
|
6658
|
+
*/
|
|
6659
|
+
_setProp(key, val, shouldReflect = true, shouldUpdate = false) {
|
|
6660
|
+
if (val !== this._props[key]) {
|
|
6661
|
+
this._dirty = true;
|
|
6662
|
+
if (val === REMOVAL) {
|
|
6663
|
+
delete this._props[key];
|
|
6664
|
+
} else {
|
|
6665
|
+
this._props[key] = val;
|
|
6666
|
+
if (key === "key" && this._app) {
|
|
6667
|
+
this._app._ceVNode.key = val;
|
|
6668
|
+
}
|
|
6669
|
+
}
|
|
6670
|
+
if (shouldUpdate && this._instance) {
|
|
6671
|
+
this._update();
|
|
6672
|
+
}
|
|
6673
|
+
if (shouldReflect) {
|
|
6674
|
+
const ob = this._ob;
|
|
6675
|
+
if (ob) {
|
|
6676
|
+
this._processMutations(ob.takeRecords());
|
|
6677
|
+
ob.disconnect();
|
|
6678
|
+
}
|
|
6679
|
+
if (val === true) {
|
|
6680
|
+
this.setAttribute(hyphenate(key), "");
|
|
6681
|
+
} else if (typeof val === "string" || typeof val === "number") {
|
|
6682
|
+
this.setAttribute(hyphenate(key), val + "");
|
|
6683
|
+
} else if (!val) {
|
|
6684
|
+
this.removeAttribute(hyphenate(key));
|
|
6685
|
+
}
|
|
6686
|
+
ob && ob.observe(this, { attributes: true });
|
|
6687
|
+
}
|
|
6688
|
+
}
|
|
6689
|
+
}
|
|
6690
|
+
_update() {
|
|
6691
|
+
const vnode = this._createVNode();
|
|
6692
|
+
if (this._app) vnode.appContext = this._app._context;
|
|
6693
|
+
render$c(vnode, this._root);
|
|
6694
|
+
}
|
|
6695
|
+
_createVNode() {
|
|
6696
|
+
const baseProps = {};
|
|
6697
|
+
if (!this.shadowRoot) {
|
|
6698
|
+
baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this);
|
|
6699
|
+
}
|
|
6700
|
+
const vnode = createVNode(this._def, extend(baseProps, this._props));
|
|
6701
|
+
if (!this._instance) {
|
|
6702
|
+
vnode.ce = (instance) => {
|
|
6703
|
+
this._instance = instance;
|
|
6704
|
+
instance.ce = this;
|
|
6705
|
+
instance.isCE = true;
|
|
6706
|
+
const dispatch = (event, args) => {
|
|
6707
|
+
this.dispatchEvent(
|
|
6708
|
+
new CustomEvent(
|
|
6709
|
+
event,
|
|
6710
|
+
isPlainObject(args[0]) ? extend({ detail: args }, args[0]) : { detail: args }
|
|
6711
|
+
)
|
|
6712
|
+
);
|
|
6713
|
+
};
|
|
6714
|
+
instance.emit = (event, ...args) => {
|
|
6715
|
+
dispatch(event, args);
|
|
6716
|
+
if (hyphenate(event) !== event) {
|
|
6717
|
+
dispatch(hyphenate(event), args);
|
|
6718
|
+
}
|
|
6719
|
+
};
|
|
6720
|
+
this._setParent();
|
|
6721
|
+
};
|
|
6722
|
+
}
|
|
6723
|
+
return vnode;
|
|
6724
|
+
}
|
|
6725
|
+
_applyStyles(styles, owner, parentComp) {
|
|
6726
|
+
if (!styles) return;
|
|
6727
|
+
if (owner) {
|
|
6728
|
+
if (owner === this._def || this._styleChildren.has(owner)) {
|
|
6729
|
+
return;
|
|
6730
|
+
}
|
|
6731
|
+
this._styleChildren.add(owner);
|
|
6732
|
+
}
|
|
6733
|
+
const nonce = this._nonce;
|
|
6734
|
+
const root = this.shadowRoot;
|
|
6735
|
+
const insertionAnchor = parentComp ? this._getStyleAnchor(parentComp) || this._getStyleAnchor(this._def) : this._getRootStyleInsertionAnchor(root);
|
|
6736
|
+
let last = null;
|
|
6737
|
+
for (let i = styles.length - 1; i >= 0; i--) {
|
|
6738
|
+
const s = document.createElement("style");
|
|
6739
|
+
if (nonce) s.setAttribute("nonce", nonce);
|
|
6740
|
+
s.textContent = styles[i];
|
|
6741
|
+
root.insertBefore(s, last || insertionAnchor);
|
|
6742
|
+
last = s;
|
|
6743
|
+
if (i === 0) {
|
|
6744
|
+
if (!parentComp) this._styleAnchors.set(this._def, s);
|
|
6745
|
+
if (owner) this._styleAnchors.set(owner, s);
|
|
6746
|
+
}
|
|
6747
|
+
}
|
|
6748
|
+
}
|
|
6749
|
+
_getStyleAnchor(comp) {
|
|
6750
|
+
if (!comp) {
|
|
6751
|
+
return null;
|
|
6752
|
+
}
|
|
6753
|
+
const anchor = this._styleAnchors.get(comp);
|
|
6754
|
+
if (anchor && anchor.parentNode === this.shadowRoot) {
|
|
6755
|
+
return anchor;
|
|
6756
|
+
}
|
|
6757
|
+
if (anchor) {
|
|
6758
|
+
this._styleAnchors.delete(comp);
|
|
6759
|
+
}
|
|
6760
|
+
return null;
|
|
6761
|
+
}
|
|
6762
|
+
_getRootStyleInsertionAnchor(root) {
|
|
6763
|
+
for (let i = 0; i < root.childNodes.length; i++) {
|
|
6764
|
+
const node = root.childNodes[i];
|
|
6765
|
+
if (!(node instanceof HTMLStyleElement)) {
|
|
6766
|
+
return node;
|
|
6767
|
+
}
|
|
6768
|
+
}
|
|
6769
|
+
return null;
|
|
6770
|
+
}
|
|
6771
|
+
/**
|
|
6772
|
+
* Only called when shadowRoot is false
|
|
6773
|
+
*/
|
|
6774
|
+
_parseSlots() {
|
|
6775
|
+
const slots = this._slots = {};
|
|
6776
|
+
let n;
|
|
6777
|
+
while (n = this.firstChild) {
|
|
6778
|
+
const slotName = n.nodeType === 1 && n.getAttribute("slot") || "default";
|
|
6779
|
+
(slots[slotName] || (slots[slotName] = [])).push(n);
|
|
6780
|
+
this.removeChild(n);
|
|
6781
|
+
}
|
|
6782
|
+
}
|
|
6783
|
+
/**
|
|
6784
|
+
* Only called when shadowRoot is false
|
|
6785
|
+
*/
|
|
6786
|
+
_renderSlots() {
|
|
6787
|
+
const outlets = this._getSlots();
|
|
6788
|
+
const scopeId = this._instance.type.__scopeId;
|
|
6789
|
+
for (let i = 0; i < outlets.length; i++) {
|
|
6790
|
+
const o = outlets[i];
|
|
6791
|
+
const slotName = o.getAttribute("name") || "default";
|
|
6792
|
+
const content = this._slots[slotName];
|
|
6793
|
+
const parent = o.parentNode;
|
|
6794
|
+
if (content) {
|
|
6795
|
+
for (const n of content) {
|
|
6796
|
+
if (scopeId && n.nodeType === 1) {
|
|
6797
|
+
const id = scopeId + "-s";
|
|
6798
|
+
const walker = document.createTreeWalker(n, 1);
|
|
6799
|
+
n.setAttribute(id, "");
|
|
6800
|
+
let child;
|
|
6801
|
+
while (child = walker.nextNode()) {
|
|
6802
|
+
child.setAttribute(id, "");
|
|
6803
|
+
}
|
|
6804
|
+
}
|
|
6805
|
+
parent.insertBefore(n, o);
|
|
6806
|
+
}
|
|
6807
|
+
} else {
|
|
6808
|
+
while (o.firstChild) parent.insertBefore(o.firstChild, o);
|
|
6809
|
+
}
|
|
6810
|
+
parent.removeChild(o);
|
|
6811
|
+
}
|
|
6812
|
+
}
|
|
6813
|
+
/**
|
|
6814
|
+
* @internal
|
|
6815
|
+
*/
|
|
6816
|
+
_getSlots() {
|
|
6817
|
+
const roots = [this];
|
|
6818
|
+
if (this._teleportTargets) {
|
|
6819
|
+
roots.push(...this._teleportTargets);
|
|
6820
|
+
}
|
|
6821
|
+
const slots = /* @__PURE__ */ new Set();
|
|
6822
|
+
for (const root of roots) {
|
|
6823
|
+
const found = root.querySelectorAll("slot");
|
|
6824
|
+
for (let i = 0; i < found.length; i++) {
|
|
6825
|
+
slots.add(found[i]);
|
|
6826
|
+
}
|
|
6827
|
+
}
|
|
6828
|
+
return Array.from(slots);
|
|
6829
|
+
}
|
|
6830
|
+
/**
|
|
6831
|
+
* @internal
|
|
6832
|
+
*/
|
|
6833
|
+
_injectChildStyle(comp, parentComp) {
|
|
6834
|
+
this._applyStyles(comp.styles, comp, parentComp);
|
|
6835
|
+
}
|
|
6836
|
+
/**
|
|
6837
|
+
* @internal
|
|
6838
|
+
*/
|
|
6839
|
+
_beginPatch() {
|
|
6840
|
+
this._patching = true;
|
|
6841
|
+
this._dirty = false;
|
|
6842
|
+
}
|
|
6843
|
+
/**
|
|
6844
|
+
* @internal
|
|
6845
|
+
*/
|
|
6846
|
+
_endPatch() {
|
|
6847
|
+
this._patching = false;
|
|
6848
|
+
if (this._dirty && this._instance) {
|
|
6849
|
+
this._update();
|
|
6850
|
+
}
|
|
6851
|
+
}
|
|
6852
|
+
/**
|
|
6853
|
+
* @internal
|
|
6854
|
+
*/
|
|
6855
|
+
_hasShadowRoot() {
|
|
6856
|
+
return this._def.shadowRoot !== false;
|
|
6857
|
+
}
|
|
6858
|
+
/**
|
|
6859
|
+
* @internal
|
|
6860
|
+
*/
|
|
6861
|
+
_removeChildStyle(comp) {
|
|
6862
|
+
}
|
|
6863
|
+
}
|
|
6864
|
+
|
|
8358
6865
|
const getModelAssigner = (vnode) => {
|
|
8359
6866
|
const fn = vnode.props["onUpdate:modelValue"] || false;
|
|
8360
6867
|
return isArray(fn) ? (value) => invokeArrayFns(fn, value) : fn;
|
|
@@ -8450,12 +6957,11 @@ let renderer;
|
|
|
8450
6957
|
function ensureRenderer() {
|
|
8451
6958
|
return renderer || (renderer = createRenderer(rendererOptions));
|
|
8452
6959
|
}
|
|
6960
|
+
const render$c = ((...args) => {
|
|
6961
|
+
ensureRenderer().render(...args);
|
|
6962
|
+
});
|
|
8453
6963
|
const createApp = ((...args) => {
|
|
8454
6964
|
const app = ensureRenderer().createApp(...args);
|
|
8455
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
8456
|
-
injectNativeTagCheck(app);
|
|
8457
|
-
injectCompilerOptionsCheck(app);
|
|
8458
|
-
}
|
|
8459
6965
|
const { mount } = app;
|
|
8460
6966
|
app.mount = (containerOrSelector) => {
|
|
8461
6967
|
const container = normalizeContainer(containerOrSelector);
|
|
@@ -8484,75 +6990,14 @@ function resolveRootNamespace(container) {
|
|
|
8484
6990
|
return "mathml";
|
|
8485
6991
|
}
|
|
8486
6992
|
}
|
|
8487
|
-
function injectNativeTagCheck(app) {
|
|
8488
|
-
Object.defineProperty(app.config, "isNativeTag", {
|
|
8489
|
-
value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
|
|
8490
|
-
writable: false
|
|
8491
|
-
});
|
|
8492
|
-
}
|
|
8493
|
-
function injectCompilerOptionsCheck(app) {
|
|
8494
|
-
{
|
|
8495
|
-
const isCustomElement = app.config.isCustomElement;
|
|
8496
|
-
Object.defineProperty(app.config, "isCustomElement", {
|
|
8497
|
-
get() {
|
|
8498
|
-
return isCustomElement;
|
|
8499
|
-
},
|
|
8500
|
-
set() {
|
|
8501
|
-
warn(
|
|
8502
|
-
`The \`isCustomElement\` config option is deprecated. Use \`compilerOptions.isCustomElement\` instead.`
|
|
8503
|
-
);
|
|
8504
|
-
}
|
|
8505
|
-
});
|
|
8506
|
-
const compilerOptions = app.config.compilerOptions;
|
|
8507
|
-
const msg = `The \`compilerOptions\` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, \`compilerOptions\` must be passed to \`@vue/compiler-dom\` in the build setup instead.
|
|
8508
|
-
- For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option.
|
|
8509
|
-
- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader
|
|
8510
|
-
- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc`;
|
|
8511
|
-
Object.defineProperty(app.config, "compilerOptions", {
|
|
8512
|
-
get() {
|
|
8513
|
-
warn(msg);
|
|
8514
|
-
return compilerOptions;
|
|
8515
|
-
},
|
|
8516
|
-
set() {
|
|
8517
|
-
warn(msg);
|
|
8518
|
-
}
|
|
8519
|
-
});
|
|
8520
|
-
}
|
|
8521
|
-
}
|
|
8522
6993
|
function normalizeContainer(container) {
|
|
8523
6994
|
if (isString(container)) {
|
|
8524
6995
|
const res = document.querySelector(container);
|
|
8525
|
-
if (!!(process.env.NODE_ENV !== "production") && !res) {
|
|
8526
|
-
warn(
|
|
8527
|
-
`Failed to mount app: mount target selector "${container}" returned null.`
|
|
8528
|
-
);
|
|
8529
|
-
}
|
|
8530
6996
|
return res;
|
|
8531
6997
|
}
|
|
8532
|
-
if (!!(process.env.NODE_ENV !== "production") && window.ShadowRoot && container instanceof window.ShadowRoot && container.mode === "closed") {
|
|
8533
|
-
warn(
|
|
8534
|
-
`mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs`
|
|
8535
|
-
);
|
|
8536
|
-
}
|
|
8537
6998
|
return container;
|
|
8538
6999
|
}
|
|
8539
7000
|
|
|
8540
|
-
/**
|
|
8541
|
-
* vue v3.5.30
|
|
8542
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
8543
|
-
* @license MIT
|
|
8544
|
-
**/
|
|
8545
|
-
|
|
8546
|
-
function initDev() {
|
|
8547
|
-
{
|
|
8548
|
-
initCustomFormatter();
|
|
8549
|
-
}
|
|
8550
|
-
}
|
|
8551
|
-
|
|
8552
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
8553
|
-
initDev();
|
|
8554
|
-
}
|
|
8555
|
-
|
|
8556
7001
|
const _hoisted_1$a = ["value", "placeholder"];
|
|
8557
7002
|
const _hoisted_2$8 = ["value", "placeholder"];
|
|
8558
7003
|
const _hoisted_3$7 = {
|
|
@@ -8843,7 +7288,10 @@ script$7.__file = "src/editors/HiddenEditor.vue";
|
|
|
8843
7288
|
|
|
8844
7289
|
var script$6 = {
|
|
8845
7290
|
name: 'ObjectEditor',
|
|
8846
|
-
|
|
7291
|
+
beforeCreate() {
|
|
7292
|
+
if (!this.$options.components) this.$options.components = {};
|
|
7293
|
+
this.$options.components.SchemaEditor = script$1;
|
|
7294
|
+
},
|
|
8847
7295
|
props: {
|
|
8848
7296
|
schema: { type: Object, required: true },
|
|
8849
7297
|
modelValue: { default: () => ({}) },
|
|
@@ -8889,6 +7337,7 @@ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
8889
7337
|
return ($options.isRoot)
|
|
8890
7338
|
? (openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
8891
7339
|
createBaseVNode("div", _hoisted_2$4, [
|
|
7340
|
+
createCommentVNode(" {{ schema.properties }}\n <span v-for=\"(propSchema, key) in schema.properties\" :key=\"key\">\n {{ key }}: {{ form.resolveSchema(propSchema) }}\n </span> "),
|
|
8892
7341
|
(openBlock(true), createElementBlock(Fragment, null, renderList(($props.schema.properties || {}), (propSchema, key) => {
|
|
8893
7342
|
return (openBlock(), createBlock(_component_SchemaEditor, {
|
|
8894
7343
|
key: key,
|
|
@@ -8964,7 +7413,10 @@ let keyCounter = 0;
|
|
|
8964
7413
|
|
|
8965
7414
|
var script$5 = {
|
|
8966
7415
|
name: 'ArrayEditor',
|
|
8967
|
-
|
|
7416
|
+
beforeCreate() {
|
|
7417
|
+
if (!this.$options.components) this.$options.components = {};
|
|
7418
|
+
this.$options.components.SchemaEditor = script$1;
|
|
7419
|
+
},
|
|
8968
7420
|
props: {
|
|
8969
7421
|
schema: { type: Object, required: true },
|
|
8970
7422
|
modelValue: { default: () => [] },
|
|
@@ -9118,7 +7570,10 @@ script$5.__file = "src/editors/ArrayEditor.vue";
|
|
|
9118
7570
|
|
|
9119
7571
|
var script$4 = {
|
|
9120
7572
|
name: 'NullableEditor',
|
|
9121
|
-
|
|
7573
|
+
beforeCreate() {
|
|
7574
|
+
if (!this.$options.components) this.$options.components = {};
|
|
7575
|
+
this.$options.components.SchemaEditor = script$1;
|
|
7576
|
+
},
|
|
9122
7577
|
props: {
|
|
9123
7578
|
schema: { type: Object, required: true },
|
|
9124
7579
|
modelValue: { default: null },
|
|
@@ -9237,7 +7692,10 @@ script$4.__file = "src/editors/NullableEditor.vue";
|
|
|
9237
7692
|
|
|
9238
7693
|
var script$3 = {
|
|
9239
7694
|
name: 'UnionEditor',
|
|
9240
|
-
|
|
7695
|
+
beforeCreate() {
|
|
7696
|
+
if (!this.$options.components) this.$options.components = {};
|
|
7697
|
+
this.$options.components.SchemaEditor = script$1;
|
|
7698
|
+
},
|
|
9241
7699
|
props: {
|
|
9242
7700
|
schema: { type: Object, required: true },
|
|
9243
7701
|
modelValue: { default: null },
|
|
@@ -9663,11 +8121,6 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
9663
8121
|
script$1.render = render$1;
|
|
9664
8122
|
script$1.__file = "src/editors/SchemaEditor.vue";
|
|
9665
8123
|
|
|
9666
|
-
var SchemaEditor = /*#__PURE__*/Object.freeze({
|
|
9667
|
-
__proto__: null,
|
|
9668
|
-
default: script$1
|
|
9669
|
-
});
|
|
9670
|
-
|
|
9671
8124
|
var script = {
|
|
9672
8125
|
name: 'SchemaForm',
|
|
9673
8126
|
components: { SchemaEditor: script$1 },
|
|
@@ -9677,6 +8130,7 @@ var script = {
|
|
|
9677
8130
|
errors: { type: Object, default: () => ({}) },
|
|
9678
8131
|
},
|
|
9679
8132
|
emits: ['change'],
|
|
8133
|
+
expose: ['getValue'],
|
|
9680
8134
|
data() {
|
|
9681
8135
|
const parsedSchema = typeof this.schema === 'string' ? JSON.parse(this.schema) : this.schema;
|
|
9682
8136
|
const defs = parsedSchema.$defs || parsedSchema.definitions || {};
|
|
@@ -9815,137 +8269,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
9815
8269
|
script.render = render;
|
|
9816
8270
|
script.__file = "src/SchemaForm.vue";
|
|
9817
8271
|
|
|
9818
|
-
|
|
9819
|
-
|
|
9820
|
-
|
|
9821
|
-
|
|
9822
|
-
this._props = reactive({
|
|
9823
|
-
schema: {},
|
|
9824
|
-
initialData: undefined,
|
|
9825
|
-
errors: {},
|
|
9826
|
-
});
|
|
9827
|
-
this._app = null;
|
|
9828
|
-
this._mountPoint = null;
|
|
9829
|
-
}
|
|
9830
|
-
|
|
9831
|
-
connectedCallback() {
|
|
9832
|
-
this._mountPoint = document.createElement('div');
|
|
9833
|
-
this.appendChild(this._mountPoint);
|
|
9834
|
-
|
|
9835
|
-
// Read from attributes if properties haven't been set programmatically
|
|
9836
|
-
if (!this._propsSet) {
|
|
9837
|
-
const schemaAttr = this.getAttribute('schema');
|
|
9838
|
-
const dataAttr = this.getAttribute('initial-data');
|
|
9839
|
-
if (schemaAttr) this._props.schema = JSON.parse(schemaAttr);
|
|
9840
|
-
if (dataAttr) this._props.initialData = JSON.parse(dataAttr);
|
|
9841
|
-
}
|
|
9842
|
-
|
|
9843
|
-
const formRef = this._formRef;
|
|
9844
|
-
const props = this._props;
|
|
9845
|
-
|
|
9846
|
-
this._app = createApp({
|
|
9847
|
-
render: () => h(script, {
|
|
9848
|
-
ref: formRef,
|
|
9849
|
-
schema: props.schema,
|
|
9850
|
-
initialData: props.initialData,
|
|
9851
|
-
errors: props.errors,
|
|
9852
|
-
onChange: (val) => {
|
|
9853
|
-
this.dispatchEvent(new CustomEvent('change', { detail: val, bubbles: true }));
|
|
9854
|
-
},
|
|
9855
|
-
}),
|
|
9856
|
-
});
|
|
9857
|
-
|
|
9858
|
-
this._app.mount(this._mountPoint);
|
|
9859
|
-
}
|
|
9860
|
-
|
|
9861
|
-
disconnectedCallback() {
|
|
9862
|
-
if (this._app) {
|
|
9863
|
-
this._app.unmount();
|
|
9864
|
-
this._app = null;
|
|
9865
|
-
}
|
|
9866
|
-
this._mountPoint = null;
|
|
9867
|
-
}
|
|
9868
|
-
|
|
9869
|
-
// --- Property API ---
|
|
9870
|
-
|
|
9871
|
-
get schema() {
|
|
9872
|
-
return this._props.schema;
|
|
9873
|
-
}
|
|
9874
|
-
|
|
9875
|
-
set schema(val) {
|
|
9876
|
-
this._propsSet = true;
|
|
9877
|
-
this._props.schema = typeof val === 'string' ? JSON.parse(val) : val;
|
|
9878
|
-
this._rerender();
|
|
9879
|
-
}
|
|
9880
|
-
|
|
9881
|
-
get initialData() {
|
|
9882
|
-
return this._props.initialData;
|
|
9883
|
-
}
|
|
9884
|
-
|
|
9885
|
-
set initialData(val) {
|
|
9886
|
-
this._propsSet = true;
|
|
9887
|
-
this._props.initialData = typeof val === 'string' ? JSON.parse(val) : val;
|
|
9888
|
-
this._rerender();
|
|
9889
|
-
}
|
|
9890
|
-
|
|
9891
|
-
get errors() {
|
|
9892
|
-
return this._props.errors;
|
|
9893
|
-
}
|
|
9894
|
-
|
|
9895
|
-
set errors(val) {
|
|
9896
|
-
this._propsSet = true;
|
|
9897
|
-
this._props.errors = typeof val === 'string' ? JSON.parse(val) : (val || {});
|
|
9898
|
-
this._rerender();
|
|
9899
|
-
}
|
|
9900
|
-
|
|
9901
|
-
// --- Attribute reflection ---
|
|
9902
|
-
|
|
9903
|
-
static get observedAttributes() {
|
|
9904
|
-
return ['schema', 'initial-data', 'errors'];
|
|
9905
|
-
}
|
|
9906
|
-
|
|
9907
|
-
attributeChangedCallback(name, oldVal, newVal) {
|
|
9908
|
-
if (oldVal === newVal || this._propsSet) return;
|
|
9909
|
-
if (name === 'schema') {
|
|
9910
|
-
this._props.schema = newVal ? JSON.parse(newVal) : {};
|
|
9911
|
-
} else if (name === 'initial-data') {
|
|
9912
|
-
this._props.initialData = newVal ? JSON.parse(newVal) : undefined;
|
|
9913
|
-
} else if (name === 'errors') {
|
|
9914
|
-
this._props.errors = newVal ? JSON.parse(newVal) : {};
|
|
9915
|
-
}
|
|
9916
|
-
this._rerender();
|
|
9917
|
-
}
|
|
9918
|
-
|
|
9919
|
-
// --- Public methods ---
|
|
9920
|
-
|
|
9921
|
-
getValue() {
|
|
9922
|
-
return this._formRef.value?.getValue?.() ?? null;
|
|
9923
|
-
}
|
|
9924
|
-
|
|
9925
|
-
// --- Internal ---
|
|
9926
|
-
|
|
9927
|
-
_rerender() {
|
|
9928
|
-
if (!this._app) return;
|
|
9929
|
-
this._app.unmount();
|
|
9930
|
-
this._mountPoint.innerHTML = '';
|
|
9931
|
-
const formRef = this._formRef;
|
|
9932
|
-
const props = this._props;
|
|
9933
|
-
|
|
9934
|
-
this._app = createApp({
|
|
9935
|
-
render: () => h(script, {
|
|
9936
|
-
ref: formRef,
|
|
9937
|
-
schema: props.schema,
|
|
9938
|
-
initialData: props.initialData,
|
|
9939
|
-
errors: props.errors,
|
|
9940
|
-
onChange: (val) => {
|
|
9941
|
-
this.dispatchEvent(new CustomEvent('change', { detail: val, bubbles: true }));
|
|
9942
|
-
},
|
|
9943
|
-
}),
|
|
9944
|
-
});
|
|
9945
|
-
|
|
9946
|
-
this._app.mount(this._mountPoint);
|
|
9947
|
-
}
|
|
9948
|
-
}
|
|
8272
|
+
const SchemaFormElement = defineCustomElement({
|
|
8273
|
+
...script,
|
|
8274
|
+
shadowRoot: false,
|
|
8275
|
+
});
|
|
9949
8276
|
|
|
9950
8277
|
function registerCustomElement(tagName = 'schema-form') {
|
|
9951
8278
|
if (!customElements.get(tagName)) {
|