@vue/compat 3.3.0-alpha.8 → 3.3.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vue.cjs.js +1522 -1409
- package/dist/vue.cjs.prod.js +1179 -1102
- package/dist/vue.esm-browser.js +1517 -1402
- package/dist/vue.esm-browser.prod.js +1 -1
- package/dist/vue.esm-bundler.js +1530 -1402
- package/dist/vue.global.js +1516 -1401
- package/dist/vue.global.prod.js +1 -1
- package/dist/vue.runtime.esm-browser.js +1482 -1380
- package/dist/vue.runtime.esm-browser.prod.js +1 -1
- package/dist/vue.runtime.esm-bundler.js +1493 -1378
- package/dist/vue.runtime.global.js +1481 -1379
- package/dist/vue.runtime.global.prod.js +1 -1
- package/package.json +3 -3
package/dist/vue.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var parser = require('@babel/parser');
|
|
4
4
|
var estreeWalker = require('estree-walker');
|
|
5
|
-
var
|
|
5
|
+
var sourceMapJs = require('source-map-js');
|
|
6
6
|
|
|
7
7
|
function makeMap(str, expectsLowerCase) {
|
|
8
8
|
const map = /* @__PURE__ */ Object.create(null);
|
|
@@ -130,7 +130,7 @@ const slotFlagsText = {
|
|
|
130
130
|
[3]: "FORWARDED"
|
|
131
131
|
};
|
|
132
132
|
|
|
133
|
-
const GLOBALS_WHITE_LISTED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt";
|
|
133
|
+
const GLOBALS_WHITE_LISTED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console";
|
|
134
134
|
const isGloballyWhitelisted = /* @__PURE__ */ makeMap(GLOBALS_WHITE_LISTED);
|
|
135
135
|
|
|
136
136
|
const range = 2;
|
|
@@ -1994,6 +1994,8 @@ function reload(id, newComp) {
|
|
|
1994
1994
|
}
|
|
1995
1995
|
hmrDirtyComponents.add(oldComp);
|
|
1996
1996
|
}
|
|
1997
|
+
instance.appContext.propsCache.delete(instance.type);
|
|
1998
|
+
instance.appContext.emitsCache.delete(instance.type);
|
|
1997
1999
|
instance.appContext.optionsCache.delete(instance.type);
|
|
1998
2000
|
if (instance.ceReload) {
|
|
1999
2001
|
hmrDirtyComponents.add(oldComp);
|
|
@@ -3309,7 +3311,8 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
|
|
|
3309
3311
|
}
|
|
3310
3312
|
}
|
|
3311
3313
|
let hasWarned = false;
|
|
3312
|
-
function createSuspenseBoundary(vnode,
|
|
3314
|
+
function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
|
|
3315
|
+
var _a;
|
|
3313
3316
|
if (!hasWarned) {
|
|
3314
3317
|
hasWarned = true;
|
|
3315
3318
|
console[console.info ? "info" : "log"](
|
|
@@ -3323,13 +3326,21 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
3323
3326
|
n: next,
|
|
3324
3327
|
o: { parentNode, remove }
|
|
3325
3328
|
} = rendererInternals;
|
|
3329
|
+
let parentSuspenseId;
|
|
3330
|
+
const isSuspensible = ((_a = vnode.props) == null ? void 0 : _a.suspensible) != null && vnode.props.suspensible !== false;
|
|
3331
|
+
if (isSuspensible) {
|
|
3332
|
+
if (parentSuspense == null ? void 0 : parentSuspense.pendingBranch) {
|
|
3333
|
+
parentSuspenseId = parentSuspense == null ? void 0 : parentSuspense.pendingId;
|
|
3334
|
+
parentSuspense.deps++;
|
|
3335
|
+
}
|
|
3336
|
+
}
|
|
3326
3337
|
const timeout = vnode.props ? toNumber(vnode.props.timeout) : void 0;
|
|
3327
3338
|
{
|
|
3328
3339
|
assertNumber(timeout, `Suspense timeout`);
|
|
3329
3340
|
}
|
|
3330
3341
|
const suspense = {
|
|
3331
3342
|
vnode,
|
|
3332
|
-
parent,
|
|
3343
|
+
parent: parentSuspense,
|
|
3333
3344
|
parentComponent,
|
|
3334
3345
|
isSVG,
|
|
3335
3346
|
container,
|
|
@@ -3389,20 +3400,28 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
3389
3400
|
setActiveBranch(suspense, pendingBranch);
|
|
3390
3401
|
suspense.pendingBranch = null;
|
|
3391
3402
|
suspense.isInFallback = false;
|
|
3392
|
-
let
|
|
3403
|
+
let parent = suspense.parent;
|
|
3393
3404
|
let hasUnresolvedAncestor = false;
|
|
3394
|
-
while (
|
|
3395
|
-
if (
|
|
3396
|
-
|
|
3405
|
+
while (parent) {
|
|
3406
|
+
if (parent.pendingBranch) {
|
|
3407
|
+
parent.effects.push(...effects);
|
|
3397
3408
|
hasUnresolvedAncestor = true;
|
|
3398
3409
|
break;
|
|
3399
3410
|
}
|
|
3400
|
-
|
|
3411
|
+
parent = parent.parent;
|
|
3401
3412
|
}
|
|
3402
3413
|
if (!hasUnresolvedAncestor) {
|
|
3403
3414
|
queuePostFlushCb(effects);
|
|
3404
3415
|
}
|
|
3405
3416
|
suspense.effects = [];
|
|
3417
|
+
if (isSuspensible) {
|
|
3418
|
+
if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
|
|
3419
|
+
parentSuspense.deps--;
|
|
3420
|
+
if (parentSuspense.deps === 0) {
|
|
3421
|
+
parentSuspense.resolve();
|
|
3422
|
+
}
|
|
3423
|
+
}
|
|
3424
|
+
}
|
|
3406
3425
|
triggerEvent(vnode2, "onResolve");
|
|
3407
3426
|
},
|
|
3408
3427
|
fallback(fallbackVNode) {
|
|
@@ -3502,13 +3521,13 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
3502
3521
|
}
|
|
3503
3522
|
});
|
|
3504
3523
|
},
|
|
3505
|
-
unmount(
|
|
3524
|
+
unmount(parentSuspense2, doRemove) {
|
|
3506
3525
|
suspense.isUnmounted = true;
|
|
3507
3526
|
if (suspense.activeBranch) {
|
|
3508
3527
|
unmount(
|
|
3509
3528
|
suspense.activeBranch,
|
|
3510
3529
|
parentComponent,
|
|
3511
|
-
|
|
3530
|
+
parentSuspense2,
|
|
3512
3531
|
doRemove
|
|
3513
3532
|
);
|
|
3514
3533
|
}
|
|
@@ -3516,7 +3535,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
3516
3535
|
unmount(
|
|
3517
3536
|
suspense.pendingBranch,
|
|
3518
3537
|
parentComponent,
|
|
3519
|
-
|
|
3538
|
+
parentSuspense2,
|
|
3520
3539
|
doRemove
|
|
3521
3540
|
);
|
|
3522
3541
|
}
|
|
@@ -3609,33 +3628,41 @@ function setActiveBranch(suspense, branch) {
|
|
|
3609
3628
|
}
|
|
3610
3629
|
}
|
|
3611
3630
|
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3631
|
+
const legacyDirectiveHookMap = {
|
|
3632
|
+
beforeMount: "bind",
|
|
3633
|
+
mounted: "inserted",
|
|
3634
|
+
updated: ["update", "componentUpdated"],
|
|
3635
|
+
unmounted: "unbind"
|
|
3636
|
+
};
|
|
3637
|
+
function mapCompatDirectiveHook(name, dir, instance) {
|
|
3638
|
+
const mappedName = legacyDirectiveHookMap[name];
|
|
3639
|
+
if (mappedName) {
|
|
3640
|
+
if (isArray(mappedName)) {
|
|
3641
|
+
const hook = [];
|
|
3642
|
+
mappedName.forEach((mapped) => {
|
|
3643
|
+
const mappedHook = dir[mapped];
|
|
3644
|
+
if (mappedHook) {
|
|
3645
|
+
softAssertCompatEnabled(
|
|
3646
|
+
"CUSTOM_DIR",
|
|
3647
|
+
instance,
|
|
3648
|
+
mapped,
|
|
3649
|
+
name
|
|
3650
|
+
);
|
|
3651
|
+
hook.push(mappedHook);
|
|
3652
|
+
}
|
|
3653
|
+
});
|
|
3654
|
+
return hook.length ? hook : void 0;
|
|
3634
3655
|
} else {
|
|
3635
|
-
|
|
3656
|
+
if (dir[mappedName]) {
|
|
3657
|
+
softAssertCompatEnabled(
|
|
3658
|
+
"CUSTOM_DIR",
|
|
3659
|
+
instance,
|
|
3660
|
+
mappedName,
|
|
3661
|
+
name
|
|
3662
|
+
);
|
|
3663
|
+
}
|
|
3664
|
+
return dir[mappedName];
|
|
3636
3665
|
}
|
|
3637
|
-
} else {
|
|
3638
|
-
warn(`inject() can only be used inside setup() or functional components.`);
|
|
3639
3666
|
}
|
|
3640
3667
|
}
|
|
3641
3668
|
|
|
@@ -3895,6 +3922,68 @@ function traverse(value, seen) {
|
|
|
3895
3922
|
return value;
|
|
3896
3923
|
}
|
|
3897
3924
|
|
|
3925
|
+
function validateDirectiveName(name) {
|
|
3926
|
+
if (isBuiltInDirective(name)) {
|
|
3927
|
+
warn("Do not use built-in directive ids as custom directive id: " + name);
|
|
3928
|
+
}
|
|
3929
|
+
}
|
|
3930
|
+
function withDirectives(vnode, directives) {
|
|
3931
|
+
const internalInstance = currentRenderingInstance;
|
|
3932
|
+
if (internalInstance === null) {
|
|
3933
|
+
warn(`withDirectives can only be used inside render functions.`);
|
|
3934
|
+
return vnode;
|
|
3935
|
+
}
|
|
3936
|
+
const instance = getExposeProxy(internalInstance) || internalInstance.proxy;
|
|
3937
|
+
const bindings = vnode.dirs || (vnode.dirs = []);
|
|
3938
|
+
for (let i = 0; i < directives.length; i++) {
|
|
3939
|
+
let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
|
|
3940
|
+
if (dir) {
|
|
3941
|
+
if (isFunction(dir)) {
|
|
3942
|
+
dir = {
|
|
3943
|
+
mounted: dir,
|
|
3944
|
+
updated: dir
|
|
3945
|
+
};
|
|
3946
|
+
}
|
|
3947
|
+
if (dir.deep) {
|
|
3948
|
+
traverse(value);
|
|
3949
|
+
}
|
|
3950
|
+
bindings.push({
|
|
3951
|
+
dir,
|
|
3952
|
+
instance,
|
|
3953
|
+
value,
|
|
3954
|
+
oldValue: void 0,
|
|
3955
|
+
arg,
|
|
3956
|
+
modifiers
|
|
3957
|
+
});
|
|
3958
|
+
}
|
|
3959
|
+
}
|
|
3960
|
+
return vnode;
|
|
3961
|
+
}
|
|
3962
|
+
function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
3963
|
+
const bindings = vnode.dirs;
|
|
3964
|
+
const oldBindings = prevVNode && prevVNode.dirs;
|
|
3965
|
+
for (let i = 0; i < bindings.length; i++) {
|
|
3966
|
+
const binding = bindings[i];
|
|
3967
|
+
if (oldBindings) {
|
|
3968
|
+
binding.oldValue = oldBindings[i].value;
|
|
3969
|
+
}
|
|
3970
|
+
let hook = binding.dir[name];
|
|
3971
|
+
if (!hook) {
|
|
3972
|
+
hook = mapCompatDirectiveHook(name, binding.dir, instance);
|
|
3973
|
+
}
|
|
3974
|
+
if (hook) {
|
|
3975
|
+
pauseTracking();
|
|
3976
|
+
callWithAsyncErrorHandling(hook, instance, 8, [
|
|
3977
|
+
vnode.el,
|
|
3978
|
+
binding,
|
|
3979
|
+
vnode,
|
|
3980
|
+
prevVNode
|
|
3981
|
+
]);
|
|
3982
|
+
resetTracking();
|
|
3983
|
+
}
|
|
3984
|
+
}
|
|
3985
|
+
}
|
|
3986
|
+
|
|
3898
3987
|
function useTransitionState() {
|
|
3899
3988
|
const state = {
|
|
3900
3989
|
isMounted: false,
|
|
@@ -4699,106 +4788,6 @@ function getCompatListeners(instance) {
|
|
|
4699
4788
|
return listeners;
|
|
4700
4789
|
}
|
|
4701
4790
|
|
|
4702
|
-
const legacyDirectiveHookMap = {
|
|
4703
|
-
beforeMount: "bind",
|
|
4704
|
-
mounted: "inserted",
|
|
4705
|
-
updated: ["update", "componentUpdated"],
|
|
4706
|
-
unmounted: "unbind"
|
|
4707
|
-
};
|
|
4708
|
-
function mapCompatDirectiveHook(name, dir, instance) {
|
|
4709
|
-
const mappedName = legacyDirectiveHookMap[name];
|
|
4710
|
-
if (mappedName) {
|
|
4711
|
-
if (isArray(mappedName)) {
|
|
4712
|
-
const hook = [];
|
|
4713
|
-
mappedName.forEach((mapped) => {
|
|
4714
|
-
const mappedHook = dir[mapped];
|
|
4715
|
-
if (mappedHook) {
|
|
4716
|
-
softAssertCompatEnabled(
|
|
4717
|
-
"CUSTOM_DIR",
|
|
4718
|
-
instance,
|
|
4719
|
-
mapped,
|
|
4720
|
-
name
|
|
4721
|
-
);
|
|
4722
|
-
hook.push(mappedHook);
|
|
4723
|
-
}
|
|
4724
|
-
});
|
|
4725
|
-
return hook.length ? hook : void 0;
|
|
4726
|
-
} else {
|
|
4727
|
-
if (dir[mappedName]) {
|
|
4728
|
-
softAssertCompatEnabled(
|
|
4729
|
-
"CUSTOM_DIR",
|
|
4730
|
-
instance,
|
|
4731
|
-
mappedName,
|
|
4732
|
-
name
|
|
4733
|
-
);
|
|
4734
|
-
}
|
|
4735
|
-
return dir[mappedName];
|
|
4736
|
-
}
|
|
4737
|
-
}
|
|
4738
|
-
}
|
|
4739
|
-
|
|
4740
|
-
function validateDirectiveName(name) {
|
|
4741
|
-
if (isBuiltInDirective(name)) {
|
|
4742
|
-
warn("Do not use built-in directive ids as custom directive id: " + name);
|
|
4743
|
-
}
|
|
4744
|
-
}
|
|
4745
|
-
function withDirectives(vnode, directives) {
|
|
4746
|
-
const internalInstance = currentRenderingInstance;
|
|
4747
|
-
if (internalInstance === null) {
|
|
4748
|
-
warn(`withDirectives can only be used inside render functions.`);
|
|
4749
|
-
return vnode;
|
|
4750
|
-
}
|
|
4751
|
-
const instance = getExposeProxy(internalInstance) || internalInstance.proxy;
|
|
4752
|
-
const bindings = vnode.dirs || (vnode.dirs = []);
|
|
4753
|
-
for (let i = 0; i < directives.length; i++) {
|
|
4754
|
-
let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
|
|
4755
|
-
if (dir) {
|
|
4756
|
-
if (isFunction(dir)) {
|
|
4757
|
-
dir = {
|
|
4758
|
-
mounted: dir,
|
|
4759
|
-
updated: dir
|
|
4760
|
-
};
|
|
4761
|
-
}
|
|
4762
|
-
if (dir.deep) {
|
|
4763
|
-
traverse(value);
|
|
4764
|
-
}
|
|
4765
|
-
bindings.push({
|
|
4766
|
-
dir,
|
|
4767
|
-
instance,
|
|
4768
|
-
value,
|
|
4769
|
-
oldValue: void 0,
|
|
4770
|
-
arg,
|
|
4771
|
-
modifiers
|
|
4772
|
-
});
|
|
4773
|
-
}
|
|
4774
|
-
}
|
|
4775
|
-
return vnode;
|
|
4776
|
-
}
|
|
4777
|
-
function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
4778
|
-
const bindings = vnode.dirs;
|
|
4779
|
-
const oldBindings = prevVNode && prevVNode.dirs;
|
|
4780
|
-
for (let i = 0; i < bindings.length; i++) {
|
|
4781
|
-
const binding = bindings[i];
|
|
4782
|
-
if (oldBindings) {
|
|
4783
|
-
binding.oldValue = oldBindings[i].value;
|
|
4784
|
-
}
|
|
4785
|
-
let hook = binding.dir[name];
|
|
4786
|
-
if (!hook) {
|
|
4787
|
-
hook = mapCompatDirectiveHook(name, binding.dir, instance);
|
|
4788
|
-
}
|
|
4789
|
-
if (hook) {
|
|
4790
|
-
pauseTracking();
|
|
4791
|
-
callWithAsyncErrorHandling(hook, instance, 8, [
|
|
4792
|
-
vnode.el,
|
|
4793
|
-
binding,
|
|
4794
|
-
vnode,
|
|
4795
|
-
prevVNode
|
|
4796
|
-
]);
|
|
4797
|
-
resetTracking();
|
|
4798
|
-
}
|
|
4799
|
-
}
|
|
4800
|
-
}
|
|
4801
|
-
|
|
4802
4791
|
const COMPONENTS = "components";
|
|
4803
4792
|
const DIRECTIVES = "directives";
|
|
4804
4793
|
const FILTERS = "filters";
|
|
@@ -5514,6 +5503,8 @@ const PublicInstanceProxyHandlers = {
|
|
|
5514
5503
|
if (key === "$attrs") {
|
|
5515
5504
|
track(instance, "get", key);
|
|
5516
5505
|
markAttrsAccessed();
|
|
5506
|
+
} else if (key === "$slots") {
|
|
5507
|
+
track(instance, "get", key);
|
|
5517
5508
|
}
|
|
5518
5509
|
return publicGetter(instance);
|
|
5519
5510
|
} else if (
|
|
@@ -5703,24 +5694,179 @@ function deepMergeData(to, from) {
|
|
|
5703
5694
|
return to;
|
|
5704
5695
|
}
|
|
5705
5696
|
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
};
|
|
5697
|
+
const warnRuntimeUsage = (method) => warn(
|
|
5698
|
+
`${method}() is a compiler-hint helper that is only usable inside <script setup> of a single file component. Its arguments should be compiled away and passing it at runtime has no effect.`
|
|
5699
|
+
);
|
|
5700
|
+
function defineProps() {
|
|
5701
|
+
{
|
|
5702
|
+
warnRuntimeUsage(`defineProps`);
|
|
5703
|
+
}
|
|
5704
|
+
return null;
|
|
5715
5705
|
}
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
|
|
5723
|
-
|
|
5706
|
+
function defineEmits() {
|
|
5707
|
+
{
|
|
5708
|
+
warnRuntimeUsage(`defineEmits`);
|
|
5709
|
+
}
|
|
5710
|
+
return null;
|
|
5711
|
+
}
|
|
5712
|
+
function defineExpose(exposed) {
|
|
5713
|
+
{
|
|
5714
|
+
warnRuntimeUsage(`defineExpose`);
|
|
5715
|
+
}
|
|
5716
|
+
}
|
|
5717
|
+
function defineOptions(options) {
|
|
5718
|
+
{
|
|
5719
|
+
warnRuntimeUsage(`defineOptions`);
|
|
5720
|
+
}
|
|
5721
|
+
}
|
|
5722
|
+
function defineSlots() {
|
|
5723
|
+
{
|
|
5724
|
+
warnRuntimeUsage(`defineSlots`);
|
|
5725
|
+
}
|
|
5726
|
+
return null;
|
|
5727
|
+
}
|
|
5728
|
+
function defineModel() {
|
|
5729
|
+
{
|
|
5730
|
+
warnRuntimeUsage("defineModel");
|
|
5731
|
+
}
|
|
5732
|
+
}
|
|
5733
|
+
function withDefaults(props, defaults) {
|
|
5734
|
+
{
|
|
5735
|
+
warnRuntimeUsage(`withDefaults`);
|
|
5736
|
+
}
|
|
5737
|
+
return null;
|
|
5738
|
+
}
|
|
5739
|
+
function useSlots() {
|
|
5740
|
+
return getContext().slots;
|
|
5741
|
+
}
|
|
5742
|
+
function useAttrs() {
|
|
5743
|
+
return getContext().attrs;
|
|
5744
|
+
}
|
|
5745
|
+
function useModel(props, name, options) {
|
|
5746
|
+
const i = getCurrentInstance();
|
|
5747
|
+
if (!i) {
|
|
5748
|
+
warn(`useModel() called without active instance.`);
|
|
5749
|
+
return ref();
|
|
5750
|
+
}
|
|
5751
|
+
if (!i.propsOptions[0][name]) {
|
|
5752
|
+
warn(`useModel() called with prop "${name}" which is not declared.`);
|
|
5753
|
+
return ref();
|
|
5754
|
+
}
|
|
5755
|
+
if (options && options.local) {
|
|
5756
|
+
const proxy = ref(props[name]);
|
|
5757
|
+
watch(
|
|
5758
|
+
() => props[name],
|
|
5759
|
+
(v) => proxy.value = v
|
|
5760
|
+
);
|
|
5761
|
+
watch(proxy, (value) => {
|
|
5762
|
+
if (value !== props[name]) {
|
|
5763
|
+
i.emit(`update:${name}`, value);
|
|
5764
|
+
}
|
|
5765
|
+
});
|
|
5766
|
+
return proxy;
|
|
5767
|
+
} else {
|
|
5768
|
+
return {
|
|
5769
|
+
__v_isRef: true,
|
|
5770
|
+
get value() {
|
|
5771
|
+
return props[name];
|
|
5772
|
+
},
|
|
5773
|
+
set value(value) {
|
|
5774
|
+
i.emit(`update:${name}`, value);
|
|
5775
|
+
}
|
|
5776
|
+
};
|
|
5777
|
+
}
|
|
5778
|
+
}
|
|
5779
|
+
function getContext() {
|
|
5780
|
+
const i = getCurrentInstance();
|
|
5781
|
+
if (!i) {
|
|
5782
|
+
warn(`useContext() called without active instance.`);
|
|
5783
|
+
}
|
|
5784
|
+
return i.setupContext || (i.setupContext = createSetupContext(i));
|
|
5785
|
+
}
|
|
5786
|
+
function normalizePropsOrEmits(props) {
|
|
5787
|
+
return isArray(props) ? props.reduce(
|
|
5788
|
+
(normalized, p) => (normalized[p] = null, normalized),
|
|
5789
|
+
{}
|
|
5790
|
+
) : props;
|
|
5791
|
+
}
|
|
5792
|
+
function mergeDefaults(raw, defaults) {
|
|
5793
|
+
const props = normalizePropsOrEmits(raw);
|
|
5794
|
+
for (const key in defaults) {
|
|
5795
|
+
if (key.startsWith("__skip"))
|
|
5796
|
+
continue;
|
|
5797
|
+
let opt = props[key];
|
|
5798
|
+
if (opt) {
|
|
5799
|
+
if (isArray(opt) || isFunction(opt)) {
|
|
5800
|
+
opt = props[key] = { type: opt, default: defaults[key] };
|
|
5801
|
+
} else {
|
|
5802
|
+
opt.default = defaults[key];
|
|
5803
|
+
}
|
|
5804
|
+
} else if (opt === null) {
|
|
5805
|
+
opt = props[key] = { default: defaults[key] };
|
|
5806
|
+
} else {
|
|
5807
|
+
warn(`props default key "${key}" has no corresponding declaration.`);
|
|
5808
|
+
}
|
|
5809
|
+
if (opt && defaults[`__skip_${key}`]) {
|
|
5810
|
+
opt.skipFactory = true;
|
|
5811
|
+
}
|
|
5812
|
+
}
|
|
5813
|
+
return props;
|
|
5814
|
+
}
|
|
5815
|
+
function mergeModels(a, b) {
|
|
5816
|
+
if (!a || !b)
|
|
5817
|
+
return a || b;
|
|
5818
|
+
if (isArray(a) && isArray(b))
|
|
5819
|
+
return a.concat(b);
|
|
5820
|
+
return extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
|
|
5821
|
+
}
|
|
5822
|
+
function createPropsRestProxy(props, excludedKeys) {
|
|
5823
|
+
const ret = {};
|
|
5824
|
+
for (const key in props) {
|
|
5825
|
+
if (!excludedKeys.includes(key)) {
|
|
5826
|
+
Object.defineProperty(ret, key, {
|
|
5827
|
+
enumerable: true,
|
|
5828
|
+
get: () => props[key]
|
|
5829
|
+
});
|
|
5830
|
+
}
|
|
5831
|
+
}
|
|
5832
|
+
return ret;
|
|
5833
|
+
}
|
|
5834
|
+
function withAsyncContext(getAwaitable) {
|
|
5835
|
+
const ctx = getCurrentInstance();
|
|
5836
|
+
if (!ctx) {
|
|
5837
|
+
warn(
|
|
5838
|
+
`withAsyncContext called without active current instance. This is likely a bug.`
|
|
5839
|
+
);
|
|
5840
|
+
}
|
|
5841
|
+
let awaitable = getAwaitable();
|
|
5842
|
+
unsetCurrentInstance();
|
|
5843
|
+
if (isPromise(awaitable)) {
|
|
5844
|
+
awaitable = awaitable.catch((e) => {
|
|
5845
|
+
setCurrentInstance(ctx);
|
|
5846
|
+
throw e;
|
|
5847
|
+
});
|
|
5848
|
+
}
|
|
5849
|
+
return [awaitable, () => setCurrentInstance(ctx)];
|
|
5850
|
+
}
|
|
5851
|
+
|
|
5852
|
+
function createDuplicateChecker() {
|
|
5853
|
+
const cache = /* @__PURE__ */ Object.create(null);
|
|
5854
|
+
return (type, key) => {
|
|
5855
|
+
if (cache[key]) {
|
|
5856
|
+
warn(`${type} property "${key}" is already defined in ${cache[key]}.`);
|
|
5857
|
+
} else {
|
|
5858
|
+
cache[key] = type;
|
|
5859
|
+
}
|
|
5860
|
+
};
|
|
5861
|
+
}
|
|
5862
|
+
let shouldCacheAccess = true;
|
|
5863
|
+
function applyOptions(instance) {
|
|
5864
|
+
const options = resolveMergedOptions(instance);
|
|
5865
|
+
const publicThis = instance.proxy;
|
|
5866
|
+
const ctx = instance.ctx;
|
|
5867
|
+
shouldCacheAccess = false;
|
|
5868
|
+
if (options.beforeCreate) {
|
|
5869
|
+
callHook$1(options.beforeCreate, instance, "bc");
|
|
5724
5870
|
}
|
|
5725
5871
|
const {
|
|
5726
5872
|
// state
|
|
@@ -5765,12 +5911,7 @@ function applyOptions(instance) {
|
|
|
5765
5911
|
}
|
|
5766
5912
|
}
|
|
5767
5913
|
if (injectOptions) {
|
|
5768
|
-
resolveInjections(
|
|
5769
|
-
injectOptions,
|
|
5770
|
-
ctx,
|
|
5771
|
-
checkDuplicateProperties,
|
|
5772
|
-
instance.appContext.config.unwrapInjectedRef
|
|
5773
|
-
);
|
|
5914
|
+
resolveInjections(injectOptions, ctx, checkDuplicateProperties);
|
|
5774
5915
|
}
|
|
5775
5916
|
if (methods) {
|
|
5776
5917
|
for (const key in methods) {
|
|
@@ -5921,7 +6062,7 @@ function applyOptions(instance) {
|
|
|
5921
6062
|
instance.filters = filters;
|
|
5922
6063
|
}
|
|
5923
6064
|
}
|
|
5924
|
-
function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP
|
|
6065
|
+
function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) {
|
|
5925
6066
|
if (isArray(injectOptions)) {
|
|
5926
6067
|
injectOptions = normalizeInject(injectOptions);
|
|
5927
6068
|
}
|
|
@@ -5943,21 +6084,12 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP,
|
|
|
5943
6084
|
injected = inject(opt);
|
|
5944
6085
|
}
|
|
5945
6086
|
if (isRef(injected)) {
|
|
5946
|
-
|
|
5947
|
-
|
|
5948
|
-
|
|
5949
|
-
|
|
5950
|
-
|
|
5951
|
-
|
|
5952
|
-
});
|
|
5953
|
-
} else {
|
|
5954
|
-
{
|
|
5955
|
-
warn(
|
|
5956
|
-
`injected property "${key}" is a ref and will be auto-unwrapped and no longer needs \`.value\` in the next minor release. To opt-in to the new behavior now, set \`app.config.unwrapInjectedRef = true\` (this config is temporary and will not be needed in the future.)`
|
|
5957
|
-
);
|
|
5958
|
-
}
|
|
5959
|
-
ctx[key] = injected;
|
|
5960
|
-
}
|
|
6087
|
+
Object.defineProperty(ctx, key, {
|
|
6088
|
+
enumerable: true,
|
|
6089
|
+
configurable: true,
|
|
6090
|
+
get: () => injected.value,
|
|
6091
|
+
set: (v) => injected.value = v
|
|
6092
|
+
});
|
|
5961
6093
|
} else {
|
|
5962
6094
|
ctx[key] = injected;
|
|
5963
6095
|
}
|
|
@@ -6060,10 +6192,8 @@ function mergeOptions(to, from, strats, asMixin = false) {
|
|
|
6060
6192
|
}
|
|
6061
6193
|
const internalOptionMergeStrats = {
|
|
6062
6194
|
data: mergeDataFn,
|
|
6063
|
-
props:
|
|
6064
|
-
|
|
6065
|
-
emits: mergeObjectOptions,
|
|
6066
|
-
// TODO
|
|
6195
|
+
props: mergeEmitsOrPropsOptions,
|
|
6196
|
+
emits: mergeEmitsOrPropsOptions,
|
|
6067
6197
|
// objects
|
|
6068
6198
|
methods: mergeObjectOptions,
|
|
6069
6199
|
computed: mergeObjectOptions,
|
|
@@ -6125,7 +6255,21 @@ function mergeAsArray$1(to, from) {
|
|
|
6125
6255
|
return to ? [...new Set([].concat(to, from))] : from;
|
|
6126
6256
|
}
|
|
6127
6257
|
function mergeObjectOptions(to, from) {
|
|
6128
|
-
return to ? extend(
|
|
6258
|
+
return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from;
|
|
6259
|
+
}
|
|
6260
|
+
function mergeEmitsOrPropsOptions(to, from) {
|
|
6261
|
+
if (to) {
|
|
6262
|
+
if (isArray(to) && isArray(from)) {
|
|
6263
|
+
return [.../* @__PURE__ */ new Set([...to, ...from])];
|
|
6264
|
+
}
|
|
6265
|
+
return extend(
|
|
6266
|
+
/* @__PURE__ */ Object.create(null),
|
|
6267
|
+
normalizePropsOrEmits(to),
|
|
6268
|
+
normalizePropsOrEmits(from != null ? from : {})
|
|
6269
|
+
);
|
|
6270
|
+
} else {
|
|
6271
|
+
return from;
|
|
6272
|
+
}
|
|
6129
6273
|
}
|
|
6130
6274
|
function mergeWatchOptions(to, from) {
|
|
6131
6275
|
if (!to)
|
|
@@ -6139,1179 +6283,1234 @@ function mergeWatchOptions(to, from) {
|
|
|
6139
6283
|
return merged;
|
|
6140
6284
|
}
|
|
6141
6285
|
|
|
6142
|
-
function
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6159
|
-
|
|
6160
|
-
} else if (key in injections) {
|
|
6161
|
-
return inject(key);
|
|
6162
|
-
}
|
|
6286
|
+
function installLegacyConfigWarnings(config) {
|
|
6287
|
+
const legacyConfigOptions = {
|
|
6288
|
+
silent: "CONFIG_SILENT",
|
|
6289
|
+
devtools: "CONFIG_DEVTOOLS",
|
|
6290
|
+
ignoredElements: "CONFIG_IGNORED_ELEMENTS",
|
|
6291
|
+
keyCodes: "CONFIG_KEY_CODES",
|
|
6292
|
+
productionTip: "CONFIG_PRODUCTION_TIP"
|
|
6293
|
+
};
|
|
6294
|
+
Object.keys(legacyConfigOptions).forEach((key) => {
|
|
6295
|
+
let val = config[key];
|
|
6296
|
+
Object.defineProperty(config, key, {
|
|
6297
|
+
enumerable: true,
|
|
6298
|
+
get() {
|
|
6299
|
+
return val;
|
|
6300
|
+
},
|
|
6301
|
+
set(newVal) {
|
|
6302
|
+
if (!isCopyingConfig) {
|
|
6303
|
+
warnDeprecation$1(legacyConfigOptions[key], null);
|
|
6163
6304
|
}
|
|
6305
|
+
val = newVal;
|
|
6164
6306
|
}
|
|
6165
|
-
}
|
|
6166
|
-
);
|
|
6307
|
+
});
|
|
6308
|
+
});
|
|
6167
6309
|
}
|
|
6168
|
-
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
}
|
|
6182
|
-
return false;
|
|
6310
|
+
function installLegacyOptionMergeStrats(config) {
|
|
6311
|
+
config.optionMergeStrategies = new Proxy({}, {
|
|
6312
|
+
get(target, key) {
|
|
6313
|
+
if (key in target) {
|
|
6314
|
+
return target[key];
|
|
6315
|
+
}
|
|
6316
|
+
if (key in internalOptionMergeStrats && softAssertCompatEnabled(
|
|
6317
|
+
"CONFIG_OPTION_MERGE_STRATS",
|
|
6318
|
+
null
|
|
6319
|
+
)) {
|
|
6320
|
+
return internalOptionMergeStrats[key];
|
|
6321
|
+
}
|
|
6322
|
+
}
|
|
6323
|
+
});
|
|
6183
6324
|
}
|
|
6184
6325
|
|
|
6185
|
-
|
|
6186
|
-
|
|
6187
|
-
|
|
6188
|
-
|
|
6189
|
-
|
|
6190
|
-
|
|
6191
|
-
|
|
6192
|
-
|
|
6193
|
-
|
|
6326
|
+
let isCopyingConfig = false;
|
|
6327
|
+
let singletonApp;
|
|
6328
|
+
let singletonCtor;
|
|
6329
|
+
function createCompatVue$1(createApp, createSingletonApp) {
|
|
6330
|
+
singletonApp = createSingletonApp({});
|
|
6331
|
+
const Vue = singletonCtor = function Vue2(options = {}) {
|
|
6332
|
+
return createCompatApp(options, Vue2);
|
|
6333
|
+
};
|
|
6334
|
+
function createCompatApp(options = {}, Ctor) {
|
|
6335
|
+
assertCompatEnabled("GLOBAL_MOUNT", null);
|
|
6336
|
+
const { data } = options;
|
|
6337
|
+
if (data && !isFunction(data) && softAssertCompatEnabled("OPTIONS_DATA_FN", null)) {
|
|
6338
|
+
options.data = () => data;
|
|
6339
|
+
}
|
|
6340
|
+
const app = createApp(options);
|
|
6341
|
+
if (Ctor !== Vue) {
|
|
6342
|
+
applySingletonPrototype(app, Ctor);
|
|
6343
|
+
}
|
|
6344
|
+
const vm = app._createRoot(options);
|
|
6345
|
+
if (options.el) {
|
|
6346
|
+
return vm.$mount(options.el);
|
|
6347
|
+
} else {
|
|
6348
|
+
return vm;
|
|
6194
6349
|
}
|
|
6195
6350
|
}
|
|
6196
|
-
{
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
|
|
6351
|
+
Vue.version = `2.6.14-compat:${"3.3.0-beta.1"}`;
|
|
6352
|
+
Vue.config = singletonApp.config;
|
|
6353
|
+
Vue.use = (p, ...options) => {
|
|
6354
|
+
if (p && isFunction(p.install)) {
|
|
6355
|
+
p.install(Vue, ...options);
|
|
6356
|
+
} else if (isFunction(p)) {
|
|
6357
|
+
p(Vue, ...options);
|
|
6358
|
+
}
|
|
6359
|
+
return Vue;
|
|
6360
|
+
};
|
|
6361
|
+
Vue.mixin = (m) => {
|
|
6362
|
+
singletonApp.mixin(m);
|
|
6363
|
+
return Vue;
|
|
6364
|
+
};
|
|
6365
|
+
Vue.component = (name, comp) => {
|
|
6366
|
+
if (comp) {
|
|
6367
|
+
singletonApp.component(name, comp);
|
|
6368
|
+
return Vue;
|
|
6204
6369
|
} else {
|
|
6205
|
-
|
|
6370
|
+
return singletonApp.component(name);
|
|
6371
|
+
}
|
|
6372
|
+
};
|
|
6373
|
+
Vue.directive = (name, dir) => {
|
|
6374
|
+
if (dir) {
|
|
6375
|
+
singletonApp.directive(name, dir);
|
|
6376
|
+
return Vue;
|
|
6377
|
+
} else {
|
|
6378
|
+
return singletonApp.directive(name);
|
|
6379
|
+
}
|
|
6380
|
+
};
|
|
6381
|
+
Vue.options = { _base: Vue };
|
|
6382
|
+
let cid = 1;
|
|
6383
|
+
Vue.cid = cid;
|
|
6384
|
+
Vue.nextTick = nextTick;
|
|
6385
|
+
const extendCache = /* @__PURE__ */ new WeakMap();
|
|
6386
|
+
function extendCtor(extendOptions = {}) {
|
|
6387
|
+
assertCompatEnabled("GLOBAL_EXTEND", null);
|
|
6388
|
+
if (isFunction(extendOptions)) {
|
|
6389
|
+
extendOptions = extendOptions.options;
|
|
6390
|
+
}
|
|
6391
|
+
if (extendCache.has(extendOptions)) {
|
|
6392
|
+
return extendCache.get(extendOptions);
|
|
6393
|
+
}
|
|
6394
|
+
const Super = this;
|
|
6395
|
+
function SubVue(inlineOptions) {
|
|
6396
|
+
if (!inlineOptions) {
|
|
6397
|
+
return createCompatApp(SubVue.options, SubVue);
|
|
6398
|
+
} else {
|
|
6399
|
+
return createCompatApp(
|
|
6400
|
+
mergeOptions(
|
|
6401
|
+
extend({}, SubVue.options),
|
|
6402
|
+
inlineOptions,
|
|
6403
|
+
internalOptionMergeStrats
|
|
6404
|
+
),
|
|
6405
|
+
SubVue
|
|
6406
|
+
);
|
|
6407
|
+
}
|
|
6206
6408
|
}
|
|
6409
|
+
SubVue.super = Super;
|
|
6410
|
+
SubVue.prototype = Object.create(Vue.prototype);
|
|
6411
|
+
SubVue.prototype.constructor = SubVue;
|
|
6412
|
+
const mergeBase = {};
|
|
6413
|
+
for (const key in Super.options) {
|
|
6414
|
+
const superValue = Super.options[key];
|
|
6415
|
+
mergeBase[key] = isArray(superValue) ? superValue.slice() : isObject(superValue) ? extend(/* @__PURE__ */ Object.create(null), superValue) : superValue;
|
|
6416
|
+
}
|
|
6417
|
+
SubVue.options = mergeOptions(
|
|
6418
|
+
mergeBase,
|
|
6419
|
+
extendOptions,
|
|
6420
|
+
internalOptionMergeStrats
|
|
6421
|
+
);
|
|
6422
|
+
SubVue.options._base = SubVue;
|
|
6423
|
+
SubVue.extend = extendCtor.bind(SubVue);
|
|
6424
|
+
SubVue.mixin = Super.mixin;
|
|
6425
|
+
SubVue.use = Super.use;
|
|
6426
|
+
SubVue.cid = ++cid;
|
|
6427
|
+
extendCache.set(extendOptions, SubVue);
|
|
6428
|
+
return SubVue;
|
|
6207
6429
|
}
|
|
6208
|
-
|
|
6430
|
+
Vue.extend = extendCtor.bind(Vue);
|
|
6431
|
+
Vue.set = (target, key, value) => {
|
|
6432
|
+
assertCompatEnabled("GLOBAL_SET", null);
|
|
6433
|
+
target[key] = value;
|
|
6434
|
+
};
|
|
6435
|
+
Vue.delete = (target, key) => {
|
|
6436
|
+
assertCompatEnabled("GLOBAL_DELETE", null);
|
|
6437
|
+
delete target[key];
|
|
6438
|
+
};
|
|
6439
|
+
Vue.observable = (target) => {
|
|
6440
|
+
assertCompatEnabled("GLOBAL_OBSERVABLE", null);
|
|
6441
|
+
return reactive(target);
|
|
6442
|
+
};
|
|
6443
|
+
Vue.filter = (name, filter) => {
|
|
6444
|
+
if (filter) {
|
|
6445
|
+
singletonApp.filter(name, filter);
|
|
6446
|
+
return Vue;
|
|
6447
|
+
} else {
|
|
6448
|
+
return singletonApp.filter(name);
|
|
6449
|
+
}
|
|
6450
|
+
};
|
|
6451
|
+
const util = {
|
|
6452
|
+
warn: warn ,
|
|
6453
|
+
extend,
|
|
6454
|
+
mergeOptions: (parent, child, vm) => mergeOptions(
|
|
6455
|
+
parent,
|
|
6456
|
+
child,
|
|
6457
|
+
vm ? void 0 : internalOptionMergeStrats
|
|
6458
|
+
),
|
|
6459
|
+
defineReactive
|
|
6460
|
+
};
|
|
6461
|
+
Object.defineProperty(Vue, "util", {
|
|
6462
|
+
get() {
|
|
6463
|
+
assertCompatEnabled("GLOBAL_PRIVATE_UTIL", null);
|
|
6464
|
+
return util;
|
|
6465
|
+
}
|
|
6466
|
+
});
|
|
6467
|
+
Vue.configureCompat = configureCompat;
|
|
6468
|
+
return Vue;
|
|
6209
6469
|
}
|
|
6210
|
-
function
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
|
|
6470
|
+
function installAppCompatProperties(app, context, render) {
|
|
6471
|
+
installFilterMethod(app, context);
|
|
6472
|
+
installLegacyOptionMergeStrats(app.config);
|
|
6473
|
+
if (!singletonApp) {
|
|
6474
|
+
return;
|
|
6215
6475
|
}
|
|
6476
|
+
installCompatMount(app, context, render);
|
|
6477
|
+
installLegacyAPIs(app);
|
|
6478
|
+
applySingletonAppMutations(app);
|
|
6479
|
+
installLegacyConfigWarnings(app.config);
|
|
6216
6480
|
}
|
|
6217
|
-
function
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
const rawCurrentProps = toRaw(props);
|
|
6224
|
-
const [options] = instance.propsOptions;
|
|
6225
|
-
let hasAttrsChanged = false;
|
|
6226
|
-
if (
|
|
6227
|
-
// always force full diff in dev
|
|
6228
|
-
// - #1942 if hmr is enabled with sfc component
|
|
6229
|
-
// - vite#872 non-sfc component used by sfc component
|
|
6230
|
-
!isInHmrContext(instance) && (optimized || patchFlag > 0) && !(patchFlag & 16)
|
|
6231
|
-
) {
|
|
6232
|
-
if (patchFlag & 8) {
|
|
6233
|
-
const propsToUpdate = instance.vnode.dynamicProps;
|
|
6234
|
-
for (let i = 0; i < propsToUpdate.length; i++) {
|
|
6235
|
-
let key = propsToUpdate[i];
|
|
6236
|
-
if (isEmitListener(instance.emitsOptions, key)) {
|
|
6237
|
-
continue;
|
|
6238
|
-
}
|
|
6239
|
-
const value = rawProps[key];
|
|
6240
|
-
if (options) {
|
|
6241
|
-
if (hasOwn(attrs, key)) {
|
|
6242
|
-
if (value !== attrs[key]) {
|
|
6243
|
-
attrs[key] = value;
|
|
6244
|
-
hasAttrsChanged = true;
|
|
6245
|
-
}
|
|
6246
|
-
} else {
|
|
6247
|
-
const camelizedKey = camelize(key);
|
|
6248
|
-
props[camelizedKey] = resolvePropValue(
|
|
6249
|
-
options,
|
|
6250
|
-
rawCurrentProps,
|
|
6251
|
-
camelizedKey,
|
|
6252
|
-
value,
|
|
6253
|
-
instance,
|
|
6254
|
-
false
|
|
6255
|
-
/* isAbsent */
|
|
6256
|
-
);
|
|
6257
|
-
}
|
|
6258
|
-
} else {
|
|
6259
|
-
{
|
|
6260
|
-
if (isOn(key) && key.endsWith("Native")) {
|
|
6261
|
-
key = key.slice(0, -6);
|
|
6262
|
-
} else if (shouldSkipAttr(key, instance)) {
|
|
6263
|
-
continue;
|
|
6264
|
-
}
|
|
6265
|
-
}
|
|
6266
|
-
if (value !== attrs[key]) {
|
|
6267
|
-
attrs[key] = value;
|
|
6268
|
-
hasAttrsChanged = true;
|
|
6269
|
-
}
|
|
6270
|
-
}
|
|
6271
|
-
}
|
|
6481
|
+
function installFilterMethod(app, context) {
|
|
6482
|
+
context.filters = {};
|
|
6483
|
+
app.filter = (name, filter) => {
|
|
6484
|
+
assertCompatEnabled("FILTERS", null);
|
|
6485
|
+
if (!filter) {
|
|
6486
|
+
return context.filters[name];
|
|
6272
6487
|
}
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
hasAttrsChanged = true;
|
|
6488
|
+
if (context.filters[name]) {
|
|
6489
|
+
warn(`Filter "${name}" has already been registered.`);
|
|
6276
6490
|
}
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
|
|
6282
|
-
|
|
6283
|
-
|
|
6284
|
-
|
|
6285
|
-
|
|
6286
|
-
|
|
6287
|
-
|
|
6288
|
-
options,
|
|
6289
|
-
rawCurrentProps,
|
|
6290
|
-
key,
|
|
6291
|
-
void 0,
|
|
6292
|
-
instance,
|
|
6293
|
-
true
|
|
6294
|
-
/* isAbsent */
|
|
6295
|
-
);
|
|
6296
|
-
}
|
|
6297
|
-
} else {
|
|
6298
|
-
delete props[key];
|
|
6299
|
-
}
|
|
6491
|
+
context.filters[name] = filter;
|
|
6492
|
+
return app;
|
|
6493
|
+
};
|
|
6494
|
+
}
|
|
6495
|
+
function installLegacyAPIs(app) {
|
|
6496
|
+
Object.defineProperties(app, {
|
|
6497
|
+
// so that app.use() can work with legacy plugins that extend prototypes
|
|
6498
|
+
prototype: {
|
|
6499
|
+
get() {
|
|
6500
|
+
warnDeprecation$1("GLOBAL_PROTOTYPE", null);
|
|
6501
|
+
return app.config.globalProperties;
|
|
6300
6502
|
}
|
|
6301
|
-
}
|
|
6302
|
-
|
|
6303
|
-
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
|
|
6503
|
+
},
|
|
6504
|
+
nextTick: { value: nextTick },
|
|
6505
|
+
extend: { value: singletonCtor.extend },
|
|
6506
|
+
set: { value: singletonCtor.set },
|
|
6507
|
+
delete: { value: singletonCtor.delete },
|
|
6508
|
+
observable: { value: singletonCtor.observable },
|
|
6509
|
+
util: {
|
|
6510
|
+
get() {
|
|
6511
|
+
return singletonCtor.util;
|
|
6308
6512
|
}
|
|
6309
6513
|
}
|
|
6514
|
+
});
|
|
6515
|
+
}
|
|
6516
|
+
function applySingletonAppMutations(app) {
|
|
6517
|
+
app._context.mixins = [...singletonApp._context.mixins];
|
|
6518
|
+
["components", "directives", "filters"].forEach((key) => {
|
|
6519
|
+
app._context[key] = Object.create(singletonApp._context[key]);
|
|
6520
|
+
});
|
|
6521
|
+
isCopyingConfig = true;
|
|
6522
|
+
for (const key in singletonApp.config) {
|
|
6523
|
+
if (key === "isNativeTag")
|
|
6524
|
+
continue;
|
|
6525
|
+
if (isRuntimeOnly() && (key === "isCustomElement" || key === "compilerOptions")) {
|
|
6526
|
+
continue;
|
|
6527
|
+
}
|
|
6528
|
+
const val = singletonApp.config[key];
|
|
6529
|
+
app.config[key] = isObject(val) ? Object.create(val) : val;
|
|
6530
|
+
if (key === "ignoredElements" && isCompatEnabled$1("CONFIG_IGNORED_ELEMENTS", null) && !isRuntimeOnly() && isArray(val)) {
|
|
6531
|
+
app.config.compilerOptions.isCustomElement = (tag) => {
|
|
6532
|
+
return val.some((v) => isString(v) ? v === tag : v.test(tag));
|
|
6533
|
+
};
|
|
6534
|
+
}
|
|
6310
6535
|
}
|
|
6311
|
-
|
|
6312
|
-
|
|
6313
|
-
|
|
6314
|
-
|
|
6315
|
-
|
|
6536
|
+
isCopyingConfig = false;
|
|
6537
|
+
applySingletonPrototype(app, singletonCtor);
|
|
6538
|
+
}
|
|
6539
|
+
function applySingletonPrototype(app, Ctor) {
|
|
6540
|
+
const enabled = isCompatEnabled$1("GLOBAL_PROTOTYPE", null);
|
|
6541
|
+
if (enabled) {
|
|
6542
|
+
app.config.globalProperties = Object.create(Ctor.prototype);
|
|
6543
|
+
}
|
|
6544
|
+
let hasPrototypeAugmentations = false;
|
|
6545
|
+
const descriptors = Object.getOwnPropertyDescriptors(Ctor.prototype);
|
|
6546
|
+
for (const key in descriptors) {
|
|
6547
|
+
if (key !== "constructor") {
|
|
6548
|
+
hasPrototypeAugmentations = true;
|
|
6549
|
+
if (enabled) {
|
|
6550
|
+
Object.defineProperty(
|
|
6551
|
+
app.config.globalProperties,
|
|
6552
|
+
key,
|
|
6553
|
+
descriptors[key]
|
|
6554
|
+
);
|
|
6555
|
+
}
|
|
6556
|
+
}
|
|
6557
|
+
}
|
|
6558
|
+
if (hasPrototypeAugmentations) {
|
|
6559
|
+
warnDeprecation$1("GLOBAL_PROTOTYPE", null);
|
|
6316
6560
|
}
|
|
6317
6561
|
}
|
|
6318
|
-
function
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
|
|
6323
|
-
|
|
6324
|
-
|
|
6325
|
-
|
|
6562
|
+
function installCompatMount(app, context, render) {
|
|
6563
|
+
let isMounted = false;
|
|
6564
|
+
app._createRoot = (options) => {
|
|
6565
|
+
const component = app._component;
|
|
6566
|
+
const vnode = createVNode(component, options.propsData || null);
|
|
6567
|
+
vnode.appContext = context;
|
|
6568
|
+
const hasNoRender = !isFunction(component) && !component.render && !component.template;
|
|
6569
|
+
const emptyRender = () => {
|
|
6570
|
+
};
|
|
6571
|
+
const instance = createComponentInstance(vnode, null, null);
|
|
6572
|
+
if (hasNoRender) {
|
|
6573
|
+
instance.render = emptyRender;
|
|
6574
|
+
}
|
|
6575
|
+
setupComponent(instance);
|
|
6576
|
+
vnode.component = instance;
|
|
6577
|
+
vnode.isCompatRoot = true;
|
|
6578
|
+
instance.ctx._compat_mount = (selectorOrEl) => {
|
|
6579
|
+
if (isMounted) {
|
|
6580
|
+
warn(`Root instance is already mounted.`);
|
|
6581
|
+
return;
|
|
6326
6582
|
}
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
|
-
|
|
6330
|
-
|
|
6331
|
-
|
|
6332
|
-
|
|
6583
|
+
let container;
|
|
6584
|
+
if (typeof selectorOrEl === "string") {
|
|
6585
|
+
const result = document.querySelector(selectorOrEl);
|
|
6586
|
+
if (!result) {
|
|
6587
|
+
warn(
|
|
6588
|
+
`Failed to mount root instance: selector "${selectorOrEl}" returned null.`
|
|
6333
6589
|
);
|
|
6590
|
+
return;
|
|
6334
6591
|
}
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
|
|
6592
|
+
container = result;
|
|
6593
|
+
} else {
|
|
6594
|
+
container = selectorOrEl || document.createElement("div");
|
|
6338
6595
|
}
|
|
6339
|
-
const
|
|
6340
|
-
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
|
|
6344
|
-
|
|
6345
|
-
|
|
6346
|
-
|
|
6347
|
-
|
|
6596
|
+
const isSVG = container instanceof SVGElement;
|
|
6597
|
+
{
|
|
6598
|
+
context.reload = () => {
|
|
6599
|
+
const cloned = cloneVNode(vnode);
|
|
6600
|
+
cloned.component = null;
|
|
6601
|
+
render(cloned, container, isSVG);
|
|
6602
|
+
};
|
|
6603
|
+
}
|
|
6604
|
+
if (hasNoRender && instance.render === emptyRender) {
|
|
6348
6605
|
{
|
|
6349
|
-
|
|
6350
|
-
|
|
6351
|
-
|
|
6352
|
-
|
|
6606
|
+
for (let i = 0; i < container.attributes.length; i++) {
|
|
6607
|
+
const attr = container.attributes[i];
|
|
6608
|
+
if (attr.name !== "v-cloak" && /^(v-|:|@)/.test(attr.name)) {
|
|
6609
|
+
warnDeprecation$1("GLOBAL_MOUNT_CONTAINER", null);
|
|
6610
|
+
break;
|
|
6611
|
+
}
|
|
6353
6612
|
}
|
|
6354
6613
|
}
|
|
6355
|
-
|
|
6356
|
-
|
|
6357
|
-
|
|
6358
|
-
|
|
6614
|
+
instance.render = null;
|
|
6615
|
+
component.template = container.innerHTML;
|
|
6616
|
+
finishComponentSetup(
|
|
6617
|
+
instance,
|
|
6618
|
+
false,
|
|
6619
|
+
true
|
|
6620
|
+
/* skip options */
|
|
6621
|
+
);
|
|
6359
6622
|
}
|
|
6360
|
-
|
|
6361
|
-
|
|
6362
|
-
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
|
|
6379
|
-
function resolvePropValue(options, props, key, value, instance, isAbsent) {
|
|
6380
|
-
const opt = options[key];
|
|
6381
|
-
if (opt != null) {
|
|
6382
|
-
const hasDefault = hasOwn(opt, "default");
|
|
6383
|
-
if (hasDefault && value === void 0) {
|
|
6384
|
-
const defaultValue = opt.default;
|
|
6385
|
-
if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
|
|
6386
|
-
const { propsDefaults } = instance;
|
|
6387
|
-
if (key in propsDefaults) {
|
|
6388
|
-
value = propsDefaults[key];
|
|
6389
|
-
} else {
|
|
6390
|
-
setCurrentInstance(instance);
|
|
6391
|
-
value = propsDefaults[key] = defaultValue.call(
|
|
6392
|
-
isCompatEnabled$1("PROPS_DEFAULT_THIS", instance) ? createPropsDefaultThis(instance, props, key) : null,
|
|
6393
|
-
props
|
|
6394
|
-
);
|
|
6395
|
-
unsetCurrentInstance();
|
|
6623
|
+
container.innerHTML = "";
|
|
6624
|
+
render(vnode, container, isSVG);
|
|
6625
|
+
if (container instanceof Element) {
|
|
6626
|
+
container.removeAttribute("v-cloak");
|
|
6627
|
+
container.setAttribute("data-v-app", "");
|
|
6628
|
+
}
|
|
6629
|
+
isMounted = true;
|
|
6630
|
+
app._container = container;
|
|
6631
|
+
container.__vue_app__ = app;
|
|
6632
|
+
{
|
|
6633
|
+
devtoolsInitApp(app, version);
|
|
6634
|
+
}
|
|
6635
|
+
return instance.proxy;
|
|
6636
|
+
};
|
|
6637
|
+
instance.ctx._compat_destroy = () => {
|
|
6638
|
+
if (isMounted) {
|
|
6639
|
+
render(null, app._container);
|
|
6640
|
+
{
|
|
6641
|
+
devtoolsUnmountApp(app);
|
|
6396
6642
|
}
|
|
6643
|
+
delete app._container.__vue_app__;
|
|
6397
6644
|
} else {
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
|
|
6404
|
-
|
|
6405
|
-
|
|
6645
|
+
const { bum, scope, um } = instance;
|
|
6646
|
+
if (bum) {
|
|
6647
|
+
invokeArrayFns(bum);
|
|
6648
|
+
}
|
|
6649
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) {
|
|
6650
|
+
instance.emit("hook:beforeDestroy");
|
|
6651
|
+
}
|
|
6652
|
+
if (scope) {
|
|
6653
|
+
scope.stop();
|
|
6654
|
+
}
|
|
6655
|
+
if (um) {
|
|
6656
|
+
invokeArrayFns(um);
|
|
6657
|
+
}
|
|
6658
|
+
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) {
|
|
6659
|
+
instance.emit("hook:destroyed");
|
|
6660
|
+
}
|
|
6406
6661
|
}
|
|
6662
|
+
};
|
|
6663
|
+
return instance.proxy;
|
|
6664
|
+
};
|
|
6665
|
+
}
|
|
6666
|
+
const methodsToPatch = [
|
|
6667
|
+
"push",
|
|
6668
|
+
"pop",
|
|
6669
|
+
"shift",
|
|
6670
|
+
"unshift",
|
|
6671
|
+
"splice",
|
|
6672
|
+
"sort",
|
|
6673
|
+
"reverse"
|
|
6674
|
+
];
|
|
6675
|
+
const patched = /* @__PURE__ */ new WeakSet();
|
|
6676
|
+
function defineReactive(obj, key, val) {
|
|
6677
|
+
if (isObject(val) && !isReactive(val) && !patched.has(val)) {
|
|
6678
|
+
const reactiveVal = reactive(val);
|
|
6679
|
+
if (isArray(val)) {
|
|
6680
|
+
methodsToPatch.forEach((m) => {
|
|
6681
|
+
val[m] = (...args) => {
|
|
6682
|
+
Array.prototype[m].call(reactiveVal, ...args);
|
|
6683
|
+
};
|
|
6684
|
+
});
|
|
6685
|
+
} else {
|
|
6686
|
+
Object.keys(val).forEach((key2) => {
|
|
6687
|
+
try {
|
|
6688
|
+
defineReactiveSimple(val, key2, val[key2]);
|
|
6689
|
+
} catch (e) {
|
|
6690
|
+
}
|
|
6691
|
+
});
|
|
6407
6692
|
}
|
|
6408
6693
|
}
|
|
6409
|
-
|
|
6694
|
+
const i = obj.$;
|
|
6695
|
+
if (i && obj === i.proxy) {
|
|
6696
|
+
defineReactiveSimple(i.ctx, key, val);
|
|
6697
|
+
i.accessCache = /* @__PURE__ */ Object.create(null);
|
|
6698
|
+
} else if (isReactive(obj)) {
|
|
6699
|
+
obj[key] = val;
|
|
6700
|
+
} else {
|
|
6701
|
+
defineReactiveSimple(obj, key, val);
|
|
6702
|
+
}
|
|
6410
6703
|
}
|
|
6411
|
-
function
|
|
6412
|
-
|
|
6413
|
-
|
|
6414
|
-
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
|
|
6418
|
-
|
|
6419
|
-
|
|
6420
|
-
|
|
6421
|
-
|
|
6422
|
-
|
|
6423
|
-
if (isFunction(raw2)) {
|
|
6424
|
-
raw2 = raw2.options;
|
|
6425
|
-
}
|
|
6426
|
-
hasExtends = true;
|
|
6427
|
-
const [props, keys] = normalizePropsOptions(raw2, appContext, true);
|
|
6428
|
-
extend(normalized, props);
|
|
6429
|
-
if (keys)
|
|
6430
|
-
needCastKeys.push(...keys);
|
|
6431
|
-
};
|
|
6432
|
-
if (!asMixin && appContext.mixins.length) {
|
|
6433
|
-
appContext.mixins.forEach(extendProps);
|
|
6434
|
-
}
|
|
6435
|
-
if (comp.extends) {
|
|
6436
|
-
extendProps(comp.extends);
|
|
6437
|
-
}
|
|
6438
|
-
if (comp.mixins) {
|
|
6439
|
-
comp.mixins.forEach(extendProps);
|
|
6704
|
+
function defineReactiveSimple(obj, key, val) {
|
|
6705
|
+
val = isObject(val) ? reactive(val) : val;
|
|
6706
|
+
Object.defineProperty(obj, key, {
|
|
6707
|
+
enumerable: true,
|
|
6708
|
+
configurable: true,
|
|
6709
|
+
get() {
|
|
6710
|
+
track(obj, "get", key);
|
|
6711
|
+
return val;
|
|
6712
|
+
},
|
|
6713
|
+
set(newVal) {
|
|
6714
|
+
val = isObject(newVal) ? reactive(newVal) : newVal;
|
|
6715
|
+
trigger(obj, "set", key, newVal);
|
|
6440
6716
|
}
|
|
6441
|
-
}
|
|
6442
|
-
|
|
6443
|
-
|
|
6444
|
-
|
|
6717
|
+
});
|
|
6718
|
+
}
|
|
6719
|
+
|
|
6720
|
+
function createAppContext() {
|
|
6721
|
+
return {
|
|
6722
|
+
app: null,
|
|
6723
|
+
config: {
|
|
6724
|
+
isNativeTag: NO,
|
|
6725
|
+
performance: false,
|
|
6726
|
+
globalProperties: {},
|
|
6727
|
+
optionMergeStrategies: {},
|
|
6728
|
+
errorHandler: void 0,
|
|
6729
|
+
warnHandler: void 0,
|
|
6730
|
+
compilerOptions: {}
|
|
6731
|
+
},
|
|
6732
|
+
mixins: [],
|
|
6733
|
+
components: {},
|
|
6734
|
+
directives: {},
|
|
6735
|
+
provides: /* @__PURE__ */ Object.create(null),
|
|
6736
|
+
optionsCache: /* @__PURE__ */ new WeakMap(),
|
|
6737
|
+
propsCache: /* @__PURE__ */ new WeakMap(),
|
|
6738
|
+
emitsCache: /* @__PURE__ */ new WeakMap()
|
|
6739
|
+
};
|
|
6740
|
+
}
|
|
6741
|
+
let uid$1 = 0;
|
|
6742
|
+
function createAppAPI(render, hydrate) {
|
|
6743
|
+
return function createApp(rootComponent, rootProps = null) {
|
|
6744
|
+
if (!isFunction(rootComponent)) {
|
|
6745
|
+
rootComponent = extend({}, rootComponent);
|
|
6445
6746
|
}
|
|
6446
|
-
|
|
6447
|
-
|
|
6448
|
-
|
|
6449
|
-
for (let i = 0; i < raw.length; i++) {
|
|
6450
|
-
if (!isString(raw[i])) {
|
|
6451
|
-
warn(`props must be strings when using array syntax.`, raw[i]);
|
|
6452
|
-
}
|
|
6453
|
-
const normalizedKey = camelize(raw[i]);
|
|
6454
|
-
if (validatePropName(normalizedKey)) {
|
|
6455
|
-
normalized[normalizedKey] = EMPTY_OBJ;
|
|
6456
|
-
}
|
|
6747
|
+
if (rootProps != null && !isObject(rootProps)) {
|
|
6748
|
+
warn(`root props passed to app.mount() must be an object.`);
|
|
6749
|
+
rootProps = null;
|
|
6457
6750
|
}
|
|
6458
|
-
|
|
6459
|
-
|
|
6460
|
-
|
|
6751
|
+
const context = createAppContext();
|
|
6752
|
+
{
|
|
6753
|
+
Object.defineProperty(context.config, "unwrapInjectedRef", {
|
|
6754
|
+
get() {
|
|
6755
|
+
return true;
|
|
6756
|
+
},
|
|
6757
|
+
set() {
|
|
6758
|
+
warn(
|
|
6759
|
+
`app.config.unwrapInjectedRef has been deprecated. 3.3 now alawys unwraps injected refs in Options API.`
|
|
6760
|
+
);
|
|
6761
|
+
}
|
|
6762
|
+
});
|
|
6461
6763
|
}
|
|
6462
|
-
|
|
6463
|
-
|
|
6464
|
-
|
|
6465
|
-
|
|
6466
|
-
|
|
6467
|
-
|
|
6468
|
-
|
|
6469
|
-
|
|
6470
|
-
|
|
6471
|
-
|
|
6472
|
-
|
|
6473
|
-
|
|
6764
|
+
const installedPlugins = /* @__PURE__ */ new Set();
|
|
6765
|
+
let isMounted = false;
|
|
6766
|
+
const app = context.app = {
|
|
6767
|
+
_uid: uid$1++,
|
|
6768
|
+
_component: rootComponent,
|
|
6769
|
+
_props: rootProps,
|
|
6770
|
+
_container: null,
|
|
6771
|
+
_context: context,
|
|
6772
|
+
_instance: null,
|
|
6773
|
+
version,
|
|
6774
|
+
get config() {
|
|
6775
|
+
return context.config;
|
|
6776
|
+
},
|
|
6777
|
+
set config(v) {
|
|
6778
|
+
{
|
|
6779
|
+
warn(
|
|
6780
|
+
`app.config cannot be replaced. Modify individual options instead.`
|
|
6781
|
+
);
|
|
6782
|
+
}
|
|
6783
|
+
},
|
|
6784
|
+
use(plugin, ...options) {
|
|
6785
|
+
if (installedPlugins.has(plugin)) {
|
|
6786
|
+
warn(`Plugin has already been applied to target app.`);
|
|
6787
|
+
} else if (plugin && isFunction(plugin.install)) {
|
|
6788
|
+
installedPlugins.add(plugin);
|
|
6789
|
+
plugin.install(app, ...options);
|
|
6790
|
+
} else if (isFunction(plugin)) {
|
|
6791
|
+
installedPlugins.add(plugin);
|
|
6792
|
+
plugin(app, ...options);
|
|
6793
|
+
} else {
|
|
6794
|
+
warn(
|
|
6795
|
+
`A plugin must either be a function or an object with an "install" function.`
|
|
6796
|
+
);
|
|
6797
|
+
}
|
|
6798
|
+
return app;
|
|
6799
|
+
},
|
|
6800
|
+
mixin(mixin) {
|
|
6801
|
+
{
|
|
6802
|
+
if (!context.mixins.includes(mixin)) {
|
|
6803
|
+
context.mixins.push(mixin);
|
|
6804
|
+
} else {
|
|
6805
|
+
warn(
|
|
6806
|
+
"Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "")
|
|
6807
|
+
);
|
|
6808
|
+
}
|
|
6809
|
+
}
|
|
6810
|
+
return app;
|
|
6811
|
+
},
|
|
6812
|
+
component(name, component) {
|
|
6813
|
+
{
|
|
6814
|
+
validateComponentName(name, context.config);
|
|
6815
|
+
}
|
|
6816
|
+
if (!component) {
|
|
6817
|
+
return context.components[name];
|
|
6818
|
+
}
|
|
6819
|
+
if (context.components[name]) {
|
|
6820
|
+
warn(`Component "${name}" has already been registered in target app.`);
|
|
6821
|
+
}
|
|
6822
|
+
context.components[name] = component;
|
|
6823
|
+
return app;
|
|
6824
|
+
},
|
|
6825
|
+
directive(name, directive) {
|
|
6826
|
+
{
|
|
6827
|
+
validateDirectiveName(name);
|
|
6828
|
+
}
|
|
6829
|
+
if (!directive) {
|
|
6830
|
+
return context.directives[name];
|
|
6831
|
+
}
|
|
6832
|
+
if (context.directives[name]) {
|
|
6833
|
+
warn(`Directive "${name}" has already been registered in target app.`);
|
|
6834
|
+
}
|
|
6835
|
+
context.directives[name] = directive;
|
|
6836
|
+
return app;
|
|
6837
|
+
},
|
|
6838
|
+
mount(rootContainer, isHydrate, isSVG) {
|
|
6839
|
+
if (!isMounted) {
|
|
6840
|
+
if (rootContainer.__vue_app__) {
|
|
6841
|
+
warn(
|
|
6842
|
+
`There is already an app instance mounted on the host container.
|
|
6843
|
+
If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
|
|
6844
|
+
);
|
|
6474
6845
|
}
|
|
6846
|
+
const vnode = createVNode(
|
|
6847
|
+
rootComponent,
|
|
6848
|
+
rootProps
|
|
6849
|
+
);
|
|
6850
|
+
vnode.appContext = context;
|
|
6851
|
+
{
|
|
6852
|
+
context.reload = () => {
|
|
6853
|
+
render(cloneVNode(vnode), rootContainer, isSVG);
|
|
6854
|
+
};
|
|
6855
|
+
}
|
|
6856
|
+
if (isHydrate && hydrate) {
|
|
6857
|
+
hydrate(vnode, rootContainer);
|
|
6858
|
+
} else {
|
|
6859
|
+
render(vnode, rootContainer, isSVG);
|
|
6860
|
+
}
|
|
6861
|
+
isMounted = true;
|
|
6862
|
+
app._container = rootContainer;
|
|
6863
|
+
rootContainer.__vue_app__ = app;
|
|
6864
|
+
{
|
|
6865
|
+
app._instance = vnode.component;
|
|
6866
|
+
devtoolsInitApp(app, version);
|
|
6867
|
+
}
|
|
6868
|
+
return getExposeProxy(vnode.component) || vnode.component.proxy;
|
|
6869
|
+
} else {
|
|
6870
|
+
warn(
|
|
6871
|
+
`App has already been mounted.
|
|
6872
|
+
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)\``
|
|
6873
|
+
);
|
|
6874
|
+
}
|
|
6875
|
+
},
|
|
6876
|
+
unmount() {
|
|
6877
|
+
if (isMounted) {
|
|
6878
|
+
render(null, app._container);
|
|
6879
|
+
{
|
|
6880
|
+
app._instance = null;
|
|
6881
|
+
devtoolsUnmountApp(app);
|
|
6882
|
+
}
|
|
6883
|
+
delete app._container.__vue_app__;
|
|
6884
|
+
} else {
|
|
6885
|
+
warn(`Cannot unmount an app that is not mounted.`);
|
|
6886
|
+
}
|
|
6887
|
+
},
|
|
6888
|
+
provide(key, value) {
|
|
6889
|
+
if (key in context.provides) {
|
|
6890
|
+
warn(
|
|
6891
|
+
`App already provides property with key "${String(key)}". It will be overwritten with the new value.`
|
|
6892
|
+
);
|
|
6893
|
+
}
|
|
6894
|
+
context.provides[key] = value;
|
|
6895
|
+
return app;
|
|
6896
|
+
},
|
|
6897
|
+
runWithContext(fn) {
|
|
6898
|
+
currentApp = app;
|
|
6899
|
+
try {
|
|
6900
|
+
return fn();
|
|
6901
|
+
} finally {
|
|
6902
|
+
currentApp = null;
|
|
6475
6903
|
}
|
|
6476
6904
|
}
|
|
6905
|
+
};
|
|
6906
|
+
{
|
|
6907
|
+
installAppCompatProperties(app, context, render);
|
|
6477
6908
|
}
|
|
6478
|
-
|
|
6479
|
-
|
|
6480
|
-
if (isObject(comp)) {
|
|
6481
|
-
cache.set(comp, res);
|
|
6482
|
-
}
|
|
6483
|
-
return res;
|
|
6909
|
+
return app;
|
|
6910
|
+
};
|
|
6484
6911
|
}
|
|
6485
|
-
|
|
6486
|
-
|
|
6487
|
-
|
|
6912
|
+
let currentApp = null;
|
|
6913
|
+
|
|
6914
|
+
function provide(key, value) {
|
|
6915
|
+
if (!currentInstance) {
|
|
6916
|
+
{
|
|
6917
|
+
warn(`provide() can only be used inside setup().`);
|
|
6918
|
+
}
|
|
6488
6919
|
} else {
|
|
6489
|
-
|
|
6920
|
+
let provides = currentInstance.provides;
|
|
6921
|
+
const parentProvides = currentInstance.parent && currentInstance.parent.provides;
|
|
6922
|
+
if (parentProvides === provides) {
|
|
6923
|
+
provides = currentInstance.provides = Object.create(parentProvides);
|
|
6924
|
+
}
|
|
6925
|
+
provides[key] = value;
|
|
6490
6926
|
}
|
|
6491
|
-
return false;
|
|
6492
6927
|
}
|
|
6493
|
-
function
|
|
6494
|
-
const
|
|
6495
|
-
|
|
6496
|
-
|
|
6497
|
-
|
|
6498
|
-
|
|
6499
|
-
}
|
|
6500
|
-
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
|
|
6928
|
+
function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
6929
|
+
const instance = currentInstance || currentRenderingInstance;
|
|
6930
|
+
if (instance || currentApp) {
|
|
6931
|
+
const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides;
|
|
6932
|
+
if (provides && key in provides) {
|
|
6933
|
+
return provides[key];
|
|
6934
|
+
} else if (arguments.length > 1) {
|
|
6935
|
+
return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
|
|
6936
|
+
} else {
|
|
6937
|
+
warn(`injection "${String(key)}" not found.`);
|
|
6938
|
+
}
|
|
6939
|
+
} else {
|
|
6940
|
+
warn(`inject() can only be used inside setup() or functional components.`);
|
|
6505
6941
|
}
|
|
6506
|
-
return -1;
|
|
6507
6942
|
}
|
|
6508
|
-
function
|
|
6509
|
-
|
|
6510
|
-
const options = instance.propsOptions[0];
|
|
6511
|
-
for (const key in options) {
|
|
6512
|
-
let opt = options[key];
|
|
6513
|
-
if (opt == null)
|
|
6514
|
-
continue;
|
|
6515
|
-
validateProp(
|
|
6516
|
-
key,
|
|
6517
|
-
resolvedValues[key],
|
|
6518
|
-
opt,
|
|
6519
|
-
!hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
|
|
6520
|
-
);
|
|
6521
|
-
}
|
|
6943
|
+
function hasInjectionContext() {
|
|
6944
|
+
return !!(currentInstance || currentRenderingInstance || currentApp);
|
|
6522
6945
|
}
|
|
6523
|
-
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6946
|
+
|
|
6947
|
+
function createPropsDefaultThis(instance, rawProps, propKey) {
|
|
6948
|
+
return new Proxy(
|
|
6949
|
+
{},
|
|
6950
|
+
{
|
|
6951
|
+
get(_, key) {
|
|
6952
|
+
warnDeprecation$1("PROPS_DEFAULT_THIS", null, propKey);
|
|
6953
|
+
if (key === "$options") {
|
|
6954
|
+
return resolveMergedOptions(instance);
|
|
6955
|
+
}
|
|
6956
|
+
if (key in rawProps) {
|
|
6957
|
+
return rawProps[key];
|
|
6958
|
+
}
|
|
6959
|
+
const injections = instance.type.inject;
|
|
6960
|
+
if (injections) {
|
|
6961
|
+
if (isArray(injections)) {
|
|
6962
|
+
if (injections.includes(key)) {
|
|
6963
|
+
return inject(key);
|
|
6964
|
+
}
|
|
6965
|
+
} else if (key in injections) {
|
|
6966
|
+
return inject(key);
|
|
6967
|
+
}
|
|
6968
|
+
}
|
|
6969
|
+
}
|
|
6544
6970
|
}
|
|
6545
|
-
|
|
6546
|
-
if (validator && !validator(value)) {
|
|
6547
|
-
warn('Invalid prop: custom validator check failed for prop "' + name + '".');
|
|
6548
|
-
}
|
|
6971
|
+
);
|
|
6549
6972
|
}
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
|
-
)
|
|
6553
|
-
|
|
6554
|
-
let valid;
|
|
6555
|
-
const expectedType = getType(type);
|
|
6556
|
-
if (isSimpleType(expectedType)) {
|
|
6557
|
-
const t = typeof value;
|
|
6558
|
-
valid = t === expectedType.toLowerCase();
|
|
6559
|
-
if (!valid && t === "object") {
|
|
6560
|
-
valid = value instanceof type;
|
|
6561
|
-
}
|
|
6562
|
-
} else if (expectedType === "Object") {
|
|
6563
|
-
valid = isObject(value);
|
|
6564
|
-
} else if (expectedType === "Array") {
|
|
6565
|
-
valid = isArray(value);
|
|
6566
|
-
} else if (expectedType === "null") {
|
|
6567
|
-
valid = value === null;
|
|
6568
|
-
} else {
|
|
6569
|
-
valid = value instanceof type;
|
|
6973
|
+
|
|
6974
|
+
function shouldSkipAttr(key, instance) {
|
|
6975
|
+
if (key === "is") {
|
|
6976
|
+
return true;
|
|
6570
6977
|
}
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
expectedType
|
|
6574
|
-
};
|
|
6575
|
-
}
|
|
6576
|
-
function getInvalidTypeMessage(name, value, expectedTypes) {
|
|
6577
|
-
let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
|
|
6578
|
-
const expectedType = expectedTypes[0];
|
|
6579
|
-
const receivedType = toRawType(value);
|
|
6580
|
-
const expectedValue = styleValue(value, expectedType);
|
|
6581
|
-
const receivedValue = styleValue(value, receivedType);
|
|
6582
|
-
if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
|
|
6583
|
-
message += ` with value ${expectedValue}`;
|
|
6978
|
+
if ((key === "class" || key === "style") && isCompatEnabled$1("INSTANCE_ATTRS_CLASS_STYLE", instance)) {
|
|
6979
|
+
return true;
|
|
6584
6980
|
}
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
message += `with value ${receivedValue}.`;
|
|
6981
|
+
if (isOn(key) && isCompatEnabled$1("INSTANCE_LISTENERS", instance)) {
|
|
6982
|
+
return true;
|
|
6588
6983
|
}
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
function styleValue(value, type) {
|
|
6592
|
-
if (type === "String") {
|
|
6593
|
-
return `"${value}"`;
|
|
6594
|
-
} else if (type === "Number") {
|
|
6595
|
-
return `${Number(value)}`;
|
|
6596
|
-
} else {
|
|
6597
|
-
return `${value}`;
|
|
6984
|
+
if (key.startsWith("routerView") || key === "registerRouteInstance") {
|
|
6985
|
+
return true;
|
|
6598
6986
|
}
|
|
6599
|
-
|
|
6600
|
-
function isExplicable(type) {
|
|
6601
|
-
const explicitTypes = ["string", "number", "boolean"];
|
|
6602
|
-
return explicitTypes.some((elem) => type.toLowerCase() === elem);
|
|
6603
|
-
}
|
|
6604
|
-
function isBoolean(...args) {
|
|
6605
|
-
return args.some((elem) => elem.toLowerCase() === "boolean");
|
|
6987
|
+
return false;
|
|
6606
6988
|
}
|
|
6607
6989
|
|
|
6608
|
-
|
|
6609
|
-
const
|
|
6610
|
-
const
|
|
6611
|
-
|
|
6612
|
-
|
|
6613
|
-
|
|
6614
|
-
const
|
|
6615
|
-
if (
|
|
6616
|
-
|
|
6617
|
-
`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.`
|
|
6618
|
-
);
|
|
6619
|
-
}
|
|
6620
|
-
return normalizeSlotValue(rawSlot(...args));
|
|
6621
|
-
}, ctx);
|
|
6622
|
-
normalized._c = false;
|
|
6623
|
-
return normalized;
|
|
6624
|
-
};
|
|
6625
|
-
const normalizeObjectSlots = (rawSlots, slots, instance) => {
|
|
6626
|
-
const ctx = rawSlots._ctx;
|
|
6627
|
-
for (const key in rawSlots) {
|
|
6628
|
-
if (isInternalKey(key))
|
|
6629
|
-
continue;
|
|
6630
|
-
const value = rawSlots[key];
|
|
6631
|
-
if (isFunction(value)) {
|
|
6632
|
-
slots[key] = normalizeSlot(key, value, ctx);
|
|
6633
|
-
} else if (value != null) {
|
|
6634
|
-
if (!isCompatEnabled$1("RENDER_FUNCTION", instance)) {
|
|
6635
|
-
warn(
|
|
6636
|
-
`Non-function value encountered for slot "${key}". Prefer function slots for better performance.`
|
|
6637
|
-
);
|
|
6638
|
-
}
|
|
6639
|
-
const normalized = normalizeSlotValue(value);
|
|
6640
|
-
slots[key] = () => normalized;
|
|
6990
|
+
function initProps(instance, rawProps, isStateful, isSSR = false) {
|
|
6991
|
+
const props = {};
|
|
6992
|
+
const attrs = {};
|
|
6993
|
+
def(attrs, InternalObjectKey, 1);
|
|
6994
|
+
instance.propsDefaults = /* @__PURE__ */ Object.create(null);
|
|
6995
|
+
setFullProps(instance, rawProps, props, attrs);
|
|
6996
|
+
for (const key in instance.propsOptions[0]) {
|
|
6997
|
+
if (!(key in props)) {
|
|
6998
|
+
props[key] = void 0;
|
|
6641
6999
|
}
|
|
6642
7000
|
}
|
|
6643
|
-
|
|
6644
|
-
|
|
6645
|
-
if (!isKeepAlive(instance.vnode) && !isCompatEnabled$1("RENDER_FUNCTION", instance)) {
|
|
6646
|
-
warn(
|
|
6647
|
-
`Non-function value encountered for default slot. Prefer function slots for better performance.`
|
|
6648
|
-
);
|
|
7001
|
+
{
|
|
7002
|
+
validateProps(rawProps || {}, props, instance);
|
|
6649
7003
|
}
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
};
|
|
6653
|
-
const initSlots = (instance, children) => {
|
|
6654
|
-
if (instance.vnode.shapeFlag & 32) {
|
|
6655
|
-
const type = children._;
|
|
6656
|
-
if (type) {
|
|
6657
|
-
instance.slots = toRaw(children);
|
|
6658
|
-
def(children, "_", type);
|
|
6659
|
-
} else {
|
|
6660
|
-
normalizeObjectSlots(
|
|
6661
|
-
children,
|
|
6662
|
-
instance.slots = {},
|
|
6663
|
-
instance
|
|
6664
|
-
);
|
|
6665
|
-
}
|
|
7004
|
+
if (isStateful) {
|
|
7005
|
+
instance.props = isSSR ? props : shallowReactive(props);
|
|
6666
7006
|
} else {
|
|
6667
|
-
instance.
|
|
6668
|
-
|
|
6669
|
-
|
|
7007
|
+
if (!instance.type.props) {
|
|
7008
|
+
instance.props = attrs;
|
|
7009
|
+
} else {
|
|
7010
|
+
instance.props = props;
|
|
6670
7011
|
}
|
|
6671
7012
|
}
|
|
6672
|
-
|
|
6673
|
-
}
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
|
|
6677
|
-
|
|
6678
|
-
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
|
|
6684
|
-
|
|
6685
|
-
|
|
6686
|
-
|
|
6687
|
-
|
|
6688
|
-
|
|
7013
|
+
instance.attrs = attrs;
|
|
7014
|
+
}
|
|
7015
|
+
function isInHmrContext(instance) {
|
|
7016
|
+
while (instance) {
|
|
7017
|
+
if (instance.type.__hmrId)
|
|
7018
|
+
return true;
|
|
7019
|
+
instance = instance.parent;
|
|
7020
|
+
}
|
|
7021
|
+
}
|
|
7022
|
+
function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
7023
|
+
const {
|
|
7024
|
+
props,
|
|
7025
|
+
attrs,
|
|
7026
|
+
vnode: { patchFlag }
|
|
7027
|
+
} = instance;
|
|
7028
|
+
const rawCurrentProps = toRaw(props);
|
|
7029
|
+
const [options] = instance.propsOptions;
|
|
7030
|
+
let hasAttrsChanged = false;
|
|
7031
|
+
if (
|
|
7032
|
+
// always force full diff in dev
|
|
7033
|
+
// - #1942 if hmr is enabled with sfc component
|
|
7034
|
+
// - vite#872 non-sfc component used by sfc component
|
|
7035
|
+
!isInHmrContext(instance) && (optimized || patchFlag > 0) && !(patchFlag & 16)
|
|
7036
|
+
) {
|
|
7037
|
+
if (patchFlag & 8) {
|
|
7038
|
+
const propsToUpdate = instance.vnode.dynamicProps;
|
|
7039
|
+
for (let i = 0; i < propsToUpdate.length; i++) {
|
|
7040
|
+
let key = propsToUpdate[i];
|
|
7041
|
+
if (isEmitListener(instance.emitsOptions, key)) {
|
|
7042
|
+
continue;
|
|
7043
|
+
}
|
|
7044
|
+
const value = rawProps[key];
|
|
7045
|
+
if (options) {
|
|
7046
|
+
if (hasOwn(attrs, key)) {
|
|
7047
|
+
if (value !== attrs[key]) {
|
|
7048
|
+
attrs[key] = value;
|
|
7049
|
+
hasAttrsChanged = true;
|
|
7050
|
+
}
|
|
7051
|
+
} else {
|
|
7052
|
+
const camelizedKey = camelize(key);
|
|
7053
|
+
props[camelizedKey] = resolvePropValue(
|
|
7054
|
+
options,
|
|
7055
|
+
rawCurrentProps,
|
|
7056
|
+
camelizedKey,
|
|
7057
|
+
value,
|
|
7058
|
+
instance,
|
|
7059
|
+
false
|
|
7060
|
+
/* isAbsent */
|
|
7061
|
+
);
|
|
7062
|
+
}
|
|
7063
|
+
} else {
|
|
7064
|
+
{
|
|
7065
|
+
if (isOn(key) && key.endsWith("Native")) {
|
|
7066
|
+
key = key.slice(0, -6);
|
|
7067
|
+
} else if (shouldSkipAttr(key, instance)) {
|
|
7068
|
+
continue;
|
|
7069
|
+
}
|
|
7070
|
+
}
|
|
7071
|
+
if (value !== attrs[key]) {
|
|
7072
|
+
attrs[key] = value;
|
|
7073
|
+
hasAttrsChanged = true;
|
|
7074
|
+
}
|
|
6689
7075
|
}
|
|
6690
7076
|
}
|
|
6691
|
-
} else {
|
|
6692
|
-
needDeletionCheck = !children.$stable;
|
|
6693
|
-
normalizeObjectSlots(children, slots, instance);
|
|
6694
7077
|
}
|
|
6695
|
-
|
|
6696
|
-
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
|
|
6703
|
-
|
|
7078
|
+
} else {
|
|
7079
|
+
if (setFullProps(instance, rawProps, props, attrs)) {
|
|
7080
|
+
hasAttrsChanged = true;
|
|
7081
|
+
}
|
|
7082
|
+
let kebabKey;
|
|
7083
|
+
for (const key in rawCurrentProps) {
|
|
7084
|
+
if (!rawProps || // for camelCase
|
|
7085
|
+
!hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
|
|
7086
|
+
// and converted to camelCase (#955)
|
|
7087
|
+
((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
|
|
7088
|
+
if (options) {
|
|
7089
|
+
if (rawPrevProps && // for camelCase
|
|
7090
|
+
(rawPrevProps[key] !== void 0 || // for kebab-case
|
|
7091
|
+
rawPrevProps[kebabKey] !== void 0)) {
|
|
7092
|
+
props[key] = resolvePropValue(
|
|
7093
|
+
options,
|
|
7094
|
+
rawCurrentProps,
|
|
7095
|
+
key,
|
|
7096
|
+
void 0,
|
|
7097
|
+
instance,
|
|
7098
|
+
true
|
|
7099
|
+
/* isAbsent */
|
|
7100
|
+
);
|
|
7101
|
+
}
|
|
7102
|
+
} else {
|
|
7103
|
+
delete props[key];
|
|
7104
|
+
}
|
|
6704
7105
|
}
|
|
6705
7106
|
}
|
|
6706
|
-
|
|
6707
|
-
|
|
6708
|
-
|
|
6709
|
-
|
|
6710
|
-
|
|
6711
|
-
silent: "CONFIG_SILENT",
|
|
6712
|
-
devtools: "CONFIG_DEVTOOLS",
|
|
6713
|
-
ignoredElements: "CONFIG_IGNORED_ELEMENTS",
|
|
6714
|
-
keyCodes: "CONFIG_KEY_CODES",
|
|
6715
|
-
productionTip: "CONFIG_PRODUCTION_TIP"
|
|
6716
|
-
};
|
|
6717
|
-
Object.keys(legacyConfigOptions).forEach((key) => {
|
|
6718
|
-
let val = config[key];
|
|
6719
|
-
Object.defineProperty(config, key, {
|
|
6720
|
-
enumerable: true,
|
|
6721
|
-
get() {
|
|
6722
|
-
return val;
|
|
6723
|
-
},
|
|
6724
|
-
set(newVal) {
|
|
6725
|
-
if (!isCopyingConfig) {
|
|
6726
|
-
warnDeprecation$1(legacyConfigOptions[key], null);
|
|
7107
|
+
if (attrs !== rawCurrentProps) {
|
|
7108
|
+
for (const key in attrs) {
|
|
7109
|
+
if (!rawProps || !hasOwn(rawProps, key) && !hasOwn(rawProps, key + "Native")) {
|
|
7110
|
+
delete attrs[key];
|
|
7111
|
+
hasAttrsChanged = true;
|
|
6727
7112
|
}
|
|
6728
|
-
val = newVal;
|
|
6729
7113
|
}
|
|
6730
|
-
}
|
|
6731
|
-
}
|
|
7114
|
+
}
|
|
7115
|
+
}
|
|
7116
|
+
if (hasAttrsChanged) {
|
|
7117
|
+
trigger(instance, "set", "$attrs");
|
|
7118
|
+
}
|
|
7119
|
+
{
|
|
7120
|
+
validateProps(rawProps || {}, props, instance);
|
|
7121
|
+
}
|
|
6732
7122
|
}
|
|
6733
|
-
function
|
|
6734
|
-
|
|
6735
|
-
|
|
6736
|
-
|
|
6737
|
-
|
|
7123
|
+
function setFullProps(instance, rawProps, props, attrs) {
|
|
7124
|
+
const [options, needCastKeys] = instance.propsOptions;
|
|
7125
|
+
let hasAttrsChanged = false;
|
|
7126
|
+
let rawCastValues;
|
|
7127
|
+
if (rawProps) {
|
|
7128
|
+
for (let key in rawProps) {
|
|
7129
|
+
if (isReservedProp(key)) {
|
|
7130
|
+
continue;
|
|
6738
7131
|
}
|
|
6739
|
-
|
|
6740
|
-
"
|
|
6741
|
-
|
|
6742
|
-
|
|
6743
|
-
|
|
7132
|
+
{
|
|
7133
|
+
if (key.startsWith("onHook:")) {
|
|
7134
|
+
softAssertCompatEnabled(
|
|
7135
|
+
"INSTANCE_EVENT_HOOKS",
|
|
7136
|
+
instance,
|
|
7137
|
+
key.slice(2).toLowerCase()
|
|
7138
|
+
);
|
|
7139
|
+
}
|
|
7140
|
+
if (key === "inline-template") {
|
|
7141
|
+
continue;
|
|
7142
|
+
}
|
|
7143
|
+
}
|
|
7144
|
+
const value = rawProps[key];
|
|
7145
|
+
let camelKey;
|
|
7146
|
+
if (options && hasOwn(options, camelKey = camelize(key))) {
|
|
7147
|
+
if (!needCastKeys || !needCastKeys.includes(camelKey)) {
|
|
7148
|
+
props[camelKey] = value;
|
|
7149
|
+
} else {
|
|
7150
|
+
(rawCastValues || (rawCastValues = {}))[camelKey] = value;
|
|
7151
|
+
}
|
|
7152
|
+
} else if (!isEmitListener(instance.emitsOptions, key)) {
|
|
7153
|
+
{
|
|
7154
|
+
if (isOn(key) && key.endsWith("Native")) {
|
|
7155
|
+
key = key.slice(0, -6);
|
|
7156
|
+
} else if (shouldSkipAttr(key, instance)) {
|
|
7157
|
+
continue;
|
|
7158
|
+
}
|
|
7159
|
+
}
|
|
7160
|
+
if (!(key in attrs) || value !== attrs[key]) {
|
|
7161
|
+
attrs[key] = value;
|
|
7162
|
+
hasAttrsChanged = true;
|
|
7163
|
+
}
|
|
6744
7164
|
}
|
|
6745
7165
|
}
|
|
6746
|
-
}
|
|
7166
|
+
}
|
|
7167
|
+
if (needCastKeys) {
|
|
7168
|
+
const rawCurrentProps = toRaw(props);
|
|
7169
|
+
const castValues = rawCastValues || EMPTY_OBJ;
|
|
7170
|
+
for (let i = 0; i < needCastKeys.length; i++) {
|
|
7171
|
+
const key = needCastKeys[i];
|
|
7172
|
+
props[key] = resolvePropValue(
|
|
7173
|
+
options,
|
|
7174
|
+
rawCurrentProps,
|
|
7175
|
+
key,
|
|
7176
|
+
castValues[key],
|
|
7177
|
+
instance,
|
|
7178
|
+
!hasOwn(castValues, key)
|
|
7179
|
+
);
|
|
7180
|
+
}
|
|
7181
|
+
}
|
|
7182
|
+
return hasAttrsChanged;
|
|
6747
7183
|
}
|
|
6748
|
-
|
|
6749
|
-
|
|
6750
|
-
|
|
6751
|
-
|
|
6752
|
-
|
|
6753
|
-
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
|
|
6760
|
-
|
|
6761
|
-
|
|
7184
|
+
function resolvePropValue(options, props, key, value, instance, isAbsent) {
|
|
7185
|
+
const opt = options[key];
|
|
7186
|
+
if (opt != null) {
|
|
7187
|
+
const hasDefault = hasOwn(opt, "default");
|
|
7188
|
+
if (hasDefault && value === void 0) {
|
|
7189
|
+
const defaultValue = opt.default;
|
|
7190
|
+
if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
|
|
7191
|
+
const { propsDefaults } = instance;
|
|
7192
|
+
if (key in propsDefaults) {
|
|
7193
|
+
value = propsDefaults[key];
|
|
7194
|
+
} else {
|
|
7195
|
+
setCurrentInstance(instance);
|
|
7196
|
+
value = propsDefaults[key] = defaultValue.call(
|
|
7197
|
+
isCompatEnabled$1("PROPS_DEFAULT_THIS", instance) ? createPropsDefaultThis(instance, props, key) : null,
|
|
7198
|
+
props
|
|
7199
|
+
);
|
|
7200
|
+
unsetCurrentInstance();
|
|
7201
|
+
}
|
|
7202
|
+
} else {
|
|
7203
|
+
value = defaultValue;
|
|
7204
|
+
}
|
|
6762
7205
|
}
|
|
6763
|
-
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
return vm.$mount(options.el);
|
|
6770
|
-
} else {
|
|
6771
|
-
return vm;
|
|
7206
|
+
if (opt[0 /* shouldCast */]) {
|
|
7207
|
+
if (isAbsent && !hasDefault) {
|
|
7208
|
+
value = false;
|
|
7209
|
+
} else if (opt[1 /* shouldCastTrue */] && (value === "" || value === hyphenate(key))) {
|
|
7210
|
+
value = true;
|
|
7211
|
+
}
|
|
6772
7212
|
}
|
|
6773
7213
|
}
|
|
6774
|
-
|
|
6775
|
-
|
|
6776
|
-
|
|
6777
|
-
|
|
6778
|
-
|
|
6779
|
-
|
|
6780
|
-
|
|
6781
|
-
|
|
6782
|
-
|
|
6783
|
-
};
|
|
6784
|
-
|
|
6785
|
-
|
|
6786
|
-
|
|
6787
|
-
|
|
6788
|
-
|
|
6789
|
-
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
|
|
6793
|
-
|
|
7214
|
+
return value;
|
|
7215
|
+
}
|
|
7216
|
+
function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
7217
|
+
const cache = appContext.propsCache;
|
|
7218
|
+
const cached = cache.get(comp);
|
|
7219
|
+
if (cached) {
|
|
7220
|
+
return cached;
|
|
7221
|
+
}
|
|
7222
|
+
const raw = comp.props;
|
|
7223
|
+
const normalized = {};
|
|
7224
|
+
const needCastKeys = [];
|
|
7225
|
+
let hasExtends = false;
|
|
7226
|
+
if (!isFunction(comp)) {
|
|
7227
|
+
const extendProps = (raw2) => {
|
|
7228
|
+
if (isFunction(raw2)) {
|
|
7229
|
+
raw2 = raw2.options;
|
|
7230
|
+
}
|
|
7231
|
+
hasExtends = true;
|
|
7232
|
+
const [props, keys] = normalizePropsOptions(raw2, appContext, true);
|
|
7233
|
+
extend(normalized, props);
|
|
7234
|
+
if (keys)
|
|
7235
|
+
needCastKeys.push(...keys);
|
|
7236
|
+
};
|
|
7237
|
+
if (!asMixin && appContext.mixins.length) {
|
|
7238
|
+
appContext.mixins.forEach(extendProps);
|
|
6794
7239
|
}
|
|
6795
|
-
|
|
6796
|
-
|
|
6797
|
-
if (dir) {
|
|
6798
|
-
singletonApp.directive(name, dir);
|
|
6799
|
-
return Vue;
|
|
6800
|
-
} else {
|
|
6801
|
-
return singletonApp.directive(name);
|
|
7240
|
+
if (comp.extends) {
|
|
7241
|
+
extendProps(comp.extends);
|
|
6802
7242
|
}
|
|
6803
|
-
|
|
6804
|
-
|
|
6805
|
-
let cid = 1;
|
|
6806
|
-
Vue.cid = cid;
|
|
6807
|
-
Vue.nextTick = nextTick;
|
|
6808
|
-
const extendCache = /* @__PURE__ */ new WeakMap();
|
|
6809
|
-
function extendCtor(extendOptions = {}) {
|
|
6810
|
-
assertCompatEnabled("GLOBAL_EXTEND", null);
|
|
6811
|
-
if (isFunction(extendOptions)) {
|
|
6812
|
-
extendOptions = extendOptions.options;
|
|
7243
|
+
if (comp.mixins) {
|
|
7244
|
+
comp.mixins.forEach(extendProps);
|
|
6813
7245
|
}
|
|
6814
|
-
|
|
6815
|
-
|
|
7246
|
+
}
|
|
7247
|
+
if (!raw && !hasExtends) {
|
|
7248
|
+
if (isObject(comp)) {
|
|
7249
|
+
cache.set(comp, EMPTY_ARR);
|
|
6816
7250
|
}
|
|
6817
|
-
|
|
6818
|
-
|
|
6819
|
-
|
|
6820
|
-
|
|
6821
|
-
|
|
6822
|
-
|
|
6823
|
-
|
|
6824
|
-
|
|
6825
|
-
|
|
6826
|
-
|
|
6827
|
-
),
|
|
6828
|
-
SubVue
|
|
6829
|
-
);
|
|
7251
|
+
return EMPTY_ARR;
|
|
7252
|
+
}
|
|
7253
|
+
if (isArray(raw)) {
|
|
7254
|
+
for (let i = 0; i < raw.length; i++) {
|
|
7255
|
+
if (!isString(raw[i])) {
|
|
7256
|
+
warn(`props must be strings when using array syntax.`, raw[i]);
|
|
7257
|
+
}
|
|
7258
|
+
const normalizedKey = camelize(raw[i]);
|
|
7259
|
+
if (validatePropName(normalizedKey)) {
|
|
7260
|
+
normalized[normalizedKey] = EMPTY_OBJ;
|
|
6830
7261
|
}
|
|
6831
7262
|
}
|
|
6832
|
-
|
|
6833
|
-
|
|
6834
|
-
|
|
6835
|
-
const mergeBase = {};
|
|
6836
|
-
for (const key in Super.options) {
|
|
6837
|
-
const superValue = Super.options[key];
|
|
6838
|
-
mergeBase[key] = isArray(superValue) ? superValue.slice() : isObject(superValue) ? extend(/* @__PURE__ */ Object.create(null), superValue) : superValue;
|
|
7263
|
+
} else if (raw) {
|
|
7264
|
+
if (!isObject(raw)) {
|
|
7265
|
+
warn(`invalid props options`, raw);
|
|
6839
7266
|
}
|
|
6840
|
-
|
|
6841
|
-
|
|
6842
|
-
|
|
6843
|
-
|
|
7267
|
+
for (const key in raw) {
|
|
7268
|
+
const normalizedKey = camelize(key);
|
|
7269
|
+
if (validatePropName(normalizedKey)) {
|
|
7270
|
+
const opt = raw[key];
|
|
7271
|
+
const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
|
|
7272
|
+
if (prop) {
|
|
7273
|
+
const booleanIndex = getTypeIndex(Boolean, prop.type);
|
|
7274
|
+
const stringIndex = getTypeIndex(String, prop.type);
|
|
7275
|
+
prop[0 /* shouldCast */] = booleanIndex > -1;
|
|
7276
|
+
prop[1 /* shouldCastTrue */] = stringIndex < 0 || booleanIndex < stringIndex;
|
|
7277
|
+
if (booleanIndex > -1 || hasOwn(prop, "default")) {
|
|
7278
|
+
needCastKeys.push(normalizedKey);
|
|
7279
|
+
}
|
|
7280
|
+
}
|
|
7281
|
+
}
|
|
7282
|
+
}
|
|
7283
|
+
}
|
|
7284
|
+
const res = [normalized, needCastKeys];
|
|
7285
|
+
if (isObject(comp)) {
|
|
7286
|
+
cache.set(comp, res);
|
|
7287
|
+
}
|
|
7288
|
+
return res;
|
|
7289
|
+
}
|
|
7290
|
+
function validatePropName(key) {
|
|
7291
|
+
if (key[0] !== "$") {
|
|
7292
|
+
return true;
|
|
7293
|
+
} else {
|
|
7294
|
+
warn(`Invalid prop name: "${key}" is a reserved property.`);
|
|
7295
|
+
}
|
|
7296
|
+
return false;
|
|
7297
|
+
}
|
|
7298
|
+
function getType(ctor) {
|
|
7299
|
+
const match = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/);
|
|
7300
|
+
return match ? match[2] : ctor === null ? "null" : "";
|
|
7301
|
+
}
|
|
7302
|
+
function isSameType(a, b) {
|
|
7303
|
+
return getType(a) === getType(b);
|
|
7304
|
+
}
|
|
7305
|
+
function getTypeIndex(type, expectedTypes) {
|
|
7306
|
+
if (isArray(expectedTypes)) {
|
|
7307
|
+
return expectedTypes.findIndex((t) => isSameType(t, type));
|
|
7308
|
+
} else if (isFunction(expectedTypes)) {
|
|
7309
|
+
return isSameType(expectedTypes, type) ? 0 : -1;
|
|
7310
|
+
}
|
|
7311
|
+
return -1;
|
|
7312
|
+
}
|
|
7313
|
+
function validateProps(rawProps, props, instance) {
|
|
7314
|
+
const resolvedValues = toRaw(props);
|
|
7315
|
+
const options = instance.propsOptions[0];
|
|
7316
|
+
for (const key in options) {
|
|
7317
|
+
let opt = options[key];
|
|
7318
|
+
if (opt == null)
|
|
7319
|
+
continue;
|
|
7320
|
+
validateProp(
|
|
7321
|
+
key,
|
|
7322
|
+
resolvedValues[key],
|
|
7323
|
+
opt,
|
|
7324
|
+
!hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
|
|
6844
7325
|
);
|
|
6845
|
-
SubVue.options._base = SubVue;
|
|
6846
|
-
SubVue.extend = extendCtor.bind(SubVue);
|
|
6847
|
-
SubVue.mixin = Super.mixin;
|
|
6848
|
-
SubVue.use = Super.use;
|
|
6849
|
-
SubVue.cid = ++cid;
|
|
6850
|
-
extendCache.set(extendOptions, SubVue);
|
|
6851
|
-
return SubVue;
|
|
6852
7326
|
}
|
|
6853
|
-
Vue.extend = extendCtor.bind(Vue);
|
|
6854
|
-
Vue.set = (target, key, value) => {
|
|
6855
|
-
assertCompatEnabled("GLOBAL_SET", null);
|
|
6856
|
-
target[key] = value;
|
|
6857
|
-
};
|
|
6858
|
-
Vue.delete = (target, key) => {
|
|
6859
|
-
assertCompatEnabled("GLOBAL_DELETE", null);
|
|
6860
|
-
delete target[key];
|
|
6861
|
-
};
|
|
6862
|
-
Vue.observable = (target) => {
|
|
6863
|
-
assertCompatEnabled("GLOBAL_OBSERVABLE", null);
|
|
6864
|
-
return reactive(target);
|
|
6865
|
-
};
|
|
6866
|
-
Vue.filter = (name, filter) => {
|
|
6867
|
-
if (filter) {
|
|
6868
|
-
singletonApp.filter(name, filter);
|
|
6869
|
-
return Vue;
|
|
6870
|
-
} else {
|
|
6871
|
-
return singletonApp.filter(name);
|
|
6872
|
-
}
|
|
6873
|
-
};
|
|
6874
|
-
const util = {
|
|
6875
|
-
warn: warn ,
|
|
6876
|
-
extend,
|
|
6877
|
-
mergeOptions: (parent, child, vm) => mergeOptions(
|
|
6878
|
-
parent,
|
|
6879
|
-
child,
|
|
6880
|
-
vm ? void 0 : internalOptionMergeStrats
|
|
6881
|
-
),
|
|
6882
|
-
defineReactive
|
|
6883
|
-
};
|
|
6884
|
-
Object.defineProperty(Vue, "util", {
|
|
6885
|
-
get() {
|
|
6886
|
-
assertCompatEnabled("GLOBAL_PRIVATE_UTIL", null);
|
|
6887
|
-
return util;
|
|
6888
|
-
}
|
|
6889
|
-
});
|
|
6890
|
-
Vue.configureCompat = configureCompat;
|
|
6891
|
-
return Vue;
|
|
6892
7327
|
}
|
|
6893
|
-
function
|
|
6894
|
-
|
|
6895
|
-
|
|
6896
|
-
|
|
7328
|
+
function validateProp(name, value, prop, isAbsent) {
|
|
7329
|
+
const { type, required, validator, skipCheck } = prop;
|
|
7330
|
+
if (required && isAbsent) {
|
|
7331
|
+
warn('Missing required prop: "' + name + '"');
|
|
6897
7332
|
return;
|
|
6898
7333
|
}
|
|
6899
|
-
|
|
6900
|
-
|
|
6901
|
-
|
|
6902
|
-
|
|
6903
|
-
|
|
6904
|
-
|
|
6905
|
-
|
|
6906
|
-
|
|
6907
|
-
|
|
6908
|
-
|
|
6909
|
-
|
|
7334
|
+
if (value == null && !required) {
|
|
7335
|
+
return;
|
|
7336
|
+
}
|
|
7337
|
+
if (type != null && type !== true && !skipCheck) {
|
|
7338
|
+
let isValid = false;
|
|
7339
|
+
const types = isArray(type) ? type : [type];
|
|
7340
|
+
const expectedTypes = [];
|
|
7341
|
+
for (let i = 0; i < types.length && !isValid; i++) {
|
|
7342
|
+
const { valid, expectedType } = assertType(value, types[i]);
|
|
7343
|
+
expectedTypes.push(expectedType || "");
|
|
7344
|
+
isValid = valid;
|
|
6910
7345
|
}
|
|
6911
|
-
if (
|
|
6912
|
-
warn(
|
|
7346
|
+
if (!isValid) {
|
|
7347
|
+
warn(getInvalidTypeMessage(name, value, expectedTypes));
|
|
7348
|
+
return;
|
|
6913
7349
|
}
|
|
6914
|
-
|
|
6915
|
-
|
|
6916
|
-
|
|
7350
|
+
}
|
|
7351
|
+
if (validator && !validator(value)) {
|
|
7352
|
+
warn('Invalid prop: custom validator check failed for prop "' + name + '".');
|
|
7353
|
+
}
|
|
6917
7354
|
}
|
|
6918
|
-
|
|
6919
|
-
|
|
6920
|
-
|
|
6921
|
-
|
|
6922
|
-
|
|
6923
|
-
|
|
6924
|
-
|
|
6925
|
-
|
|
6926
|
-
|
|
6927
|
-
|
|
6928
|
-
|
|
6929
|
-
set: { value: singletonCtor.set },
|
|
6930
|
-
delete: { value: singletonCtor.delete },
|
|
6931
|
-
observable: { value: singletonCtor.observable },
|
|
6932
|
-
util: {
|
|
6933
|
-
get() {
|
|
6934
|
-
return singletonCtor.util;
|
|
6935
|
-
}
|
|
6936
|
-
}
|
|
6937
|
-
});
|
|
6938
|
-
}
|
|
6939
|
-
function applySingletonAppMutations(app) {
|
|
6940
|
-
app._context.mixins = [...singletonApp._context.mixins];
|
|
6941
|
-
["components", "directives", "filters"].forEach((key) => {
|
|
6942
|
-
app._context[key] = Object.create(singletonApp._context[key]);
|
|
6943
|
-
});
|
|
6944
|
-
isCopyingConfig = true;
|
|
6945
|
-
for (const key in singletonApp.config) {
|
|
6946
|
-
if (key === "isNativeTag")
|
|
6947
|
-
continue;
|
|
6948
|
-
if (isRuntimeOnly() && (key === "isCustomElement" || key === "compilerOptions")) {
|
|
6949
|
-
continue;
|
|
6950
|
-
}
|
|
6951
|
-
const val = singletonApp.config[key];
|
|
6952
|
-
app.config[key] = isObject(val) ? Object.create(val) : val;
|
|
6953
|
-
if (key === "ignoredElements" && isCompatEnabled$1("CONFIG_IGNORED_ELEMENTS", null) && !isRuntimeOnly() && isArray(val)) {
|
|
6954
|
-
app.config.compilerOptions.isCustomElement = (tag) => {
|
|
6955
|
-
return val.some((v) => isString(v) ? v === tag : v.test(tag));
|
|
6956
|
-
};
|
|
6957
|
-
}
|
|
6958
|
-
}
|
|
6959
|
-
isCopyingConfig = false;
|
|
6960
|
-
applySingletonPrototype(app, singletonCtor);
|
|
6961
|
-
}
|
|
6962
|
-
function applySingletonPrototype(app, Ctor) {
|
|
6963
|
-
const enabled = isCompatEnabled$1("GLOBAL_PROTOTYPE", null);
|
|
6964
|
-
if (enabled) {
|
|
6965
|
-
app.config.globalProperties = Object.create(Ctor.prototype);
|
|
6966
|
-
}
|
|
6967
|
-
let hasPrototypeAugmentations = false;
|
|
6968
|
-
const descriptors = Object.getOwnPropertyDescriptors(Ctor.prototype);
|
|
6969
|
-
for (const key in descriptors) {
|
|
6970
|
-
if (key !== "constructor") {
|
|
6971
|
-
hasPrototypeAugmentations = true;
|
|
6972
|
-
if (enabled) {
|
|
6973
|
-
Object.defineProperty(
|
|
6974
|
-
app.config.globalProperties,
|
|
6975
|
-
key,
|
|
6976
|
-
descriptors[key]
|
|
6977
|
-
);
|
|
6978
|
-
}
|
|
6979
|
-
}
|
|
6980
|
-
}
|
|
6981
|
-
if (hasPrototypeAugmentations) {
|
|
6982
|
-
warnDeprecation$1("GLOBAL_PROTOTYPE", null);
|
|
6983
|
-
}
|
|
6984
|
-
}
|
|
6985
|
-
function installCompatMount(app, context, render) {
|
|
6986
|
-
let isMounted = false;
|
|
6987
|
-
app._createRoot = (options) => {
|
|
6988
|
-
const component = app._component;
|
|
6989
|
-
const vnode = createVNode(component, options.propsData || null);
|
|
6990
|
-
vnode.appContext = context;
|
|
6991
|
-
const hasNoRender = !isFunction(component) && !component.render && !component.template;
|
|
6992
|
-
const emptyRender = () => {
|
|
6993
|
-
};
|
|
6994
|
-
const instance = createComponentInstance(vnode, null, null);
|
|
6995
|
-
if (hasNoRender) {
|
|
6996
|
-
instance.render = emptyRender;
|
|
6997
|
-
}
|
|
6998
|
-
setupComponent(instance);
|
|
6999
|
-
vnode.component = instance;
|
|
7000
|
-
vnode.isCompatRoot = true;
|
|
7001
|
-
instance.ctx._compat_mount = (selectorOrEl) => {
|
|
7002
|
-
if (isMounted) {
|
|
7003
|
-
warn(`Root instance is already mounted.`);
|
|
7004
|
-
return;
|
|
7005
|
-
}
|
|
7006
|
-
let container;
|
|
7007
|
-
if (typeof selectorOrEl === "string") {
|
|
7008
|
-
const result = document.querySelector(selectorOrEl);
|
|
7009
|
-
if (!result) {
|
|
7010
|
-
warn(
|
|
7011
|
-
`Failed to mount root instance: selector "${selectorOrEl}" returned null.`
|
|
7012
|
-
);
|
|
7013
|
-
return;
|
|
7014
|
-
}
|
|
7015
|
-
container = result;
|
|
7016
|
-
} else {
|
|
7017
|
-
container = selectorOrEl || document.createElement("div");
|
|
7018
|
-
}
|
|
7019
|
-
const isSVG = container instanceof SVGElement;
|
|
7020
|
-
{
|
|
7021
|
-
context.reload = () => {
|
|
7022
|
-
const cloned = cloneVNode(vnode);
|
|
7023
|
-
cloned.component = null;
|
|
7024
|
-
render(cloned, container, isSVG);
|
|
7025
|
-
};
|
|
7026
|
-
}
|
|
7027
|
-
if (hasNoRender && instance.render === emptyRender) {
|
|
7028
|
-
{
|
|
7029
|
-
for (let i = 0; i < container.attributes.length; i++) {
|
|
7030
|
-
const attr = container.attributes[i];
|
|
7031
|
-
if (attr.name !== "v-cloak" && /^(v-|:|@)/.test(attr.name)) {
|
|
7032
|
-
warnDeprecation$1("GLOBAL_MOUNT_CONTAINER", null);
|
|
7033
|
-
break;
|
|
7034
|
-
}
|
|
7035
|
-
}
|
|
7036
|
-
}
|
|
7037
|
-
instance.render = null;
|
|
7038
|
-
component.template = container.innerHTML;
|
|
7039
|
-
finishComponentSetup(
|
|
7040
|
-
instance,
|
|
7041
|
-
false,
|
|
7042
|
-
true
|
|
7043
|
-
/* skip options */
|
|
7044
|
-
);
|
|
7045
|
-
}
|
|
7046
|
-
container.innerHTML = "";
|
|
7047
|
-
render(vnode, container, isSVG);
|
|
7048
|
-
if (container instanceof Element) {
|
|
7049
|
-
container.removeAttribute("v-cloak");
|
|
7050
|
-
container.setAttribute("data-v-app", "");
|
|
7051
|
-
}
|
|
7052
|
-
isMounted = true;
|
|
7053
|
-
app._container = container;
|
|
7054
|
-
container.__vue_app__ = app;
|
|
7055
|
-
{
|
|
7056
|
-
devtoolsInitApp(app, version);
|
|
7057
|
-
}
|
|
7058
|
-
return instance.proxy;
|
|
7059
|
-
};
|
|
7060
|
-
instance.ctx._compat_destroy = () => {
|
|
7061
|
-
if (isMounted) {
|
|
7062
|
-
render(null, app._container);
|
|
7063
|
-
{
|
|
7064
|
-
devtoolsUnmountApp(app);
|
|
7065
|
-
}
|
|
7066
|
-
delete app._container.__vue_app__;
|
|
7067
|
-
} else {
|
|
7068
|
-
const { bum, scope, um } = instance;
|
|
7069
|
-
if (bum) {
|
|
7070
|
-
invokeArrayFns(bum);
|
|
7071
|
-
}
|
|
7072
|
-
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) {
|
|
7073
|
-
instance.emit("hook:beforeDestroy");
|
|
7074
|
-
}
|
|
7075
|
-
if (scope) {
|
|
7076
|
-
scope.stop();
|
|
7077
|
-
}
|
|
7078
|
-
if (um) {
|
|
7079
|
-
invokeArrayFns(um);
|
|
7080
|
-
}
|
|
7081
|
-
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) {
|
|
7082
|
-
instance.emit("hook:destroyed");
|
|
7083
|
-
}
|
|
7084
|
-
}
|
|
7085
|
-
};
|
|
7086
|
-
return instance.proxy;
|
|
7087
|
-
};
|
|
7088
|
-
}
|
|
7089
|
-
const methodsToPatch = [
|
|
7090
|
-
"push",
|
|
7091
|
-
"pop",
|
|
7092
|
-
"shift",
|
|
7093
|
-
"unshift",
|
|
7094
|
-
"splice",
|
|
7095
|
-
"sort",
|
|
7096
|
-
"reverse"
|
|
7097
|
-
];
|
|
7098
|
-
const patched = /* @__PURE__ */ new WeakSet();
|
|
7099
|
-
function defineReactive(obj, key, val) {
|
|
7100
|
-
if (isObject(val) && !isReactive(val) && !patched.has(val)) {
|
|
7101
|
-
const reactiveVal = reactive(val);
|
|
7102
|
-
if (isArray(val)) {
|
|
7103
|
-
methodsToPatch.forEach((m) => {
|
|
7104
|
-
val[m] = (...args) => {
|
|
7105
|
-
Array.prototype[m].call(reactiveVal, ...args);
|
|
7106
|
-
};
|
|
7107
|
-
});
|
|
7108
|
-
} else {
|
|
7109
|
-
Object.keys(val).forEach((key2) => {
|
|
7110
|
-
try {
|
|
7111
|
-
defineReactiveSimple(val, key2, val[key2]);
|
|
7112
|
-
} catch (e) {
|
|
7113
|
-
}
|
|
7114
|
-
});
|
|
7355
|
+
const isSimpleType = /* @__PURE__ */ makeMap(
|
|
7356
|
+
"String,Number,Boolean,Function,Symbol,BigInt"
|
|
7357
|
+
);
|
|
7358
|
+
function assertType(value, type) {
|
|
7359
|
+
let valid;
|
|
7360
|
+
const expectedType = getType(type);
|
|
7361
|
+
if (isSimpleType(expectedType)) {
|
|
7362
|
+
const t = typeof value;
|
|
7363
|
+
valid = t === expectedType.toLowerCase();
|
|
7364
|
+
if (!valid && t === "object") {
|
|
7365
|
+
valid = value instanceof type;
|
|
7115
7366
|
}
|
|
7116
|
-
}
|
|
7117
|
-
|
|
7118
|
-
if (
|
|
7119
|
-
|
|
7120
|
-
|
|
7121
|
-
|
|
7122
|
-
obj[key] = val;
|
|
7367
|
+
} else if (expectedType === "Object") {
|
|
7368
|
+
valid = isObject(value);
|
|
7369
|
+
} else if (expectedType === "Array") {
|
|
7370
|
+
valid = isArray(value);
|
|
7371
|
+
} else if (expectedType === "null") {
|
|
7372
|
+
valid = value === null;
|
|
7123
7373
|
} else {
|
|
7124
|
-
|
|
7374
|
+
valid = value instanceof type;
|
|
7125
7375
|
}
|
|
7126
|
-
}
|
|
7127
|
-
function defineReactiveSimple(obj, key, val) {
|
|
7128
|
-
val = isObject(val) ? reactive(val) : val;
|
|
7129
|
-
Object.defineProperty(obj, key, {
|
|
7130
|
-
enumerable: true,
|
|
7131
|
-
configurable: true,
|
|
7132
|
-
get() {
|
|
7133
|
-
track(obj, "get", key);
|
|
7134
|
-
return val;
|
|
7135
|
-
},
|
|
7136
|
-
set(newVal) {
|
|
7137
|
-
val = isObject(newVal) ? reactive(newVal) : newVal;
|
|
7138
|
-
trigger(obj, "set", key, newVal);
|
|
7139
|
-
}
|
|
7140
|
-
});
|
|
7141
|
-
}
|
|
7142
|
-
|
|
7143
|
-
function createAppContext() {
|
|
7144
7376
|
return {
|
|
7145
|
-
|
|
7146
|
-
|
|
7147
|
-
isNativeTag: NO,
|
|
7148
|
-
performance: false,
|
|
7149
|
-
globalProperties: {},
|
|
7150
|
-
optionMergeStrategies: {},
|
|
7151
|
-
errorHandler: void 0,
|
|
7152
|
-
warnHandler: void 0,
|
|
7153
|
-
compilerOptions: {}
|
|
7154
|
-
},
|
|
7155
|
-
mixins: [],
|
|
7156
|
-
components: {},
|
|
7157
|
-
directives: {},
|
|
7158
|
-
provides: /* @__PURE__ */ Object.create(null),
|
|
7159
|
-
optionsCache: /* @__PURE__ */ new WeakMap(),
|
|
7160
|
-
propsCache: /* @__PURE__ */ new WeakMap(),
|
|
7161
|
-
emitsCache: /* @__PURE__ */ new WeakMap()
|
|
7377
|
+
valid,
|
|
7378
|
+
expectedType
|
|
7162
7379
|
};
|
|
7163
7380
|
}
|
|
7164
|
-
|
|
7165
|
-
|
|
7166
|
-
|
|
7167
|
-
|
|
7168
|
-
|
|
7169
|
-
|
|
7170
|
-
|
|
7171
|
-
|
|
7172
|
-
|
|
7173
|
-
|
|
7174
|
-
|
|
7175
|
-
|
|
7176
|
-
|
|
7177
|
-
|
|
7178
|
-
|
|
7179
|
-
|
|
7180
|
-
|
|
7181
|
-
|
|
7182
|
-
|
|
7183
|
-
|
|
7184
|
-
|
|
7185
|
-
|
|
7186
|
-
|
|
7187
|
-
|
|
7188
|
-
|
|
7189
|
-
|
|
7190
|
-
|
|
7191
|
-
|
|
7192
|
-
|
|
7193
|
-
|
|
7194
|
-
|
|
7195
|
-
|
|
7196
|
-
|
|
7197
|
-
|
|
7198
|
-
|
|
7199
|
-
|
|
7200
|
-
|
|
7201
|
-
|
|
7202
|
-
|
|
7203
|
-
|
|
7204
|
-
|
|
7205
|
-
|
|
7206
|
-
|
|
7207
|
-
|
|
7208
|
-
|
|
7209
|
-
|
|
7210
|
-
|
|
7211
|
-
|
|
7212
|
-
|
|
7213
|
-
|
|
7214
|
-
|
|
7215
|
-
|
|
7216
|
-
|
|
7217
|
-
|
|
7218
|
-
|
|
7219
|
-
|
|
7220
|
-
|
|
7221
|
-
|
|
7222
|
-
|
|
7223
|
-
|
|
7224
|
-
|
|
7225
|
-
|
|
7226
|
-
|
|
7227
|
-
|
|
7228
|
-
|
|
7229
|
-
|
|
7230
|
-
|
|
7231
|
-
|
|
7232
|
-
|
|
7233
|
-
|
|
7234
|
-
|
|
7235
|
-
|
|
7236
|
-
|
|
7237
|
-
|
|
7238
|
-
|
|
7239
|
-
|
|
7240
|
-
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
|
|
7244
|
-
|
|
7245
|
-
|
|
7246
|
-
|
|
7247
|
-
|
|
7248
|
-
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
|
|
7252
|
-
|
|
7253
|
-
|
|
7254
|
-
|
|
7255
|
-
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
|
|
7261
|
-
|
|
7262
|
-
|
|
7263
|
-
|
|
7264
|
-
|
|
7265
|
-
|
|
7266
|
-
|
|
7267
|
-
|
|
7268
|
-
|
|
7269
|
-
|
|
7270
|
-
|
|
7271
|
-
|
|
7272
|
-
|
|
7273
|
-
|
|
7274
|
-
|
|
7275
|
-
|
|
7276
|
-
|
|
7277
|
-
|
|
7278
|
-
}
|
|
7279
|
-
return getExposeProxy(vnode.component) || vnode.component.proxy;
|
|
7280
|
-
} else {
|
|
7281
|
-
warn(
|
|
7282
|
-
`App has already been mounted.
|
|
7283
|
-
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)\``
|
|
7284
|
-
);
|
|
7285
|
-
}
|
|
7286
|
-
},
|
|
7287
|
-
unmount() {
|
|
7288
|
-
if (isMounted) {
|
|
7289
|
-
render(null, app._container);
|
|
7290
|
-
{
|
|
7291
|
-
app._instance = null;
|
|
7292
|
-
devtoolsUnmountApp(app);
|
|
7293
|
-
}
|
|
7294
|
-
delete app._container.__vue_app__;
|
|
7295
|
-
} else {
|
|
7296
|
-
warn(`Cannot unmount an app that is not mounted.`);
|
|
7297
|
-
}
|
|
7298
|
-
},
|
|
7299
|
-
provide(key, value) {
|
|
7300
|
-
if (key in context.provides) {
|
|
7301
|
-
warn(
|
|
7302
|
-
`App already provides property with key "${String(key)}". It will be overwritten with the new value.`
|
|
7303
|
-
);
|
|
7381
|
+
function getInvalidTypeMessage(name, value, expectedTypes) {
|
|
7382
|
+
let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
|
|
7383
|
+
const expectedType = expectedTypes[0];
|
|
7384
|
+
const receivedType = toRawType(value);
|
|
7385
|
+
const expectedValue = styleValue(value, expectedType);
|
|
7386
|
+
const receivedValue = styleValue(value, receivedType);
|
|
7387
|
+
if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
|
|
7388
|
+
message += ` with value ${expectedValue}`;
|
|
7389
|
+
}
|
|
7390
|
+
message += `, got ${receivedType} `;
|
|
7391
|
+
if (isExplicable(receivedType)) {
|
|
7392
|
+
message += `with value ${receivedValue}.`;
|
|
7393
|
+
}
|
|
7394
|
+
return message;
|
|
7395
|
+
}
|
|
7396
|
+
function styleValue(value, type) {
|
|
7397
|
+
if (type === "String") {
|
|
7398
|
+
return `"${value}"`;
|
|
7399
|
+
} else if (type === "Number") {
|
|
7400
|
+
return `${Number(value)}`;
|
|
7401
|
+
} else {
|
|
7402
|
+
return `${value}`;
|
|
7403
|
+
}
|
|
7404
|
+
}
|
|
7405
|
+
function isExplicable(type) {
|
|
7406
|
+
const explicitTypes = ["string", "number", "boolean"];
|
|
7407
|
+
return explicitTypes.some((elem) => type.toLowerCase() === elem);
|
|
7408
|
+
}
|
|
7409
|
+
function isBoolean(...args) {
|
|
7410
|
+
return args.some((elem) => elem.toLowerCase() === "boolean");
|
|
7411
|
+
}
|
|
7412
|
+
|
|
7413
|
+
const isInternalKey = (key) => key[0] === "_" || key === "$stable";
|
|
7414
|
+
const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
|
|
7415
|
+
const normalizeSlot = (key, rawSlot, ctx) => {
|
|
7416
|
+
if (rawSlot._n) {
|
|
7417
|
+
return rawSlot;
|
|
7418
|
+
}
|
|
7419
|
+
const normalized = withCtx((...args) => {
|
|
7420
|
+
if (currentInstance) {
|
|
7421
|
+
warn(
|
|
7422
|
+
`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.`
|
|
7423
|
+
);
|
|
7424
|
+
}
|
|
7425
|
+
return normalizeSlotValue(rawSlot(...args));
|
|
7426
|
+
}, ctx);
|
|
7427
|
+
normalized._c = false;
|
|
7428
|
+
return normalized;
|
|
7429
|
+
};
|
|
7430
|
+
const normalizeObjectSlots = (rawSlots, slots, instance) => {
|
|
7431
|
+
const ctx = rawSlots._ctx;
|
|
7432
|
+
for (const key in rawSlots) {
|
|
7433
|
+
if (isInternalKey(key))
|
|
7434
|
+
continue;
|
|
7435
|
+
const value = rawSlots[key];
|
|
7436
|
+
if (isFunction(value)) {
|
|
7437
|
+
slots[key] = normalizeSlot(key, value, ctx);
|
|
7438
|
+
} else if (value != null) {
|
|
7439
|
+
if (!isCompatEnabled$1("RENDER_FUNCTION", instance)) {
|
|
7440
|
+
warn(
|
|
7441
|
+
`Non-function value encountered for slot "${key}". Prefer function slots for better performance.`
|
|
7442
|
+
);
|
|
7443
|
+
}
|
|
7444
|
+
const normalized = normalizeSlotValue(value);
|
|
7445
|
+
slots[key] = () => normalized;
|
|
7446
|
+
}
|
|
7447
|
+
}
|
|
7448
|
+
};
|
|
7449
|
+
const normalizeVNodeSlots = (instance, children) => {
|
|
7450
|
+
if (!isKeepAlive(instance.vnode) && !isCompatEnabled$1("RENDER_FUNCTION", instance)) {
|
|
7451
|
+
warn(
|
|
7452
|
+
`Non-function value encountered for default slot. Prefer function slots for better performance.`
|
|
7453
|
+
);
|
|
7454
|
+
}
|
|
7455
|
+
const normalized = normalizeSlotValue(children);
|
|
7456
|
+
instance.slots.default = () => normalized;
|
|
7457
|
+
};
|
|
7458
|
+
const initSlots = (instance, children) => {
|
|
7459
|
+
if (instance.vnode.shapeFlag & 32) {
|
|
7460
|
+
const type = children._;
|
|
7461
|
+
if (type) {
|
|
7462
|
+
instance.slots = toRaw(children);
|
|
7463
|
+
def(children, "_", type);
|
|
7464
|
+
} else {
|
|
7465
|
+
normalizeObjectSlots(
|
|
7466
|
+
children,
|
|
7467
|
+
instance.slots = {},
|
|
7468
|
+
instance
|
|
7469
|
+
);
|
|
7470
|
+
}
|
|
7471
|
+
} else {
|
|
7472
|
+
instance.slots = {};
|
|
7473
|
+
if (children) {
|
|
7474
|
+
normalizeVNodeSlots(instance, children);
|
|
7475
|
+
}
|
|
7476
|
+
}
|
|
7477
|
+
def(instance.slots, InternalObjectKey, 1);
|
|
7478
|
+
};
|
|
7479
|
+
const updateSlots = (instance, children, optimized) => {
|
|
7480
|
+
const { vnode, slots } = instance;
|
|
7481
|
+
let needDeletionCheck = true;
|
|
7482
|
+
let deletionComparisonTarget = EMPTY_OBJ;
|
|
7483
|
+
if (vnode.shapeFlag & 32) {
|
|
7484
|
+
const type = children._;
|
|
7485
|
+
if (type) {
|
|
7486
|
+
if (isHmrUpdating) {
|
|
7487
|
+
extend(slots, children);
|
|
7488
|
+
trigger(instance, "set", "$slots");
|
|
7489
|
+
} else if (optimized && type === 1) {
|
|
7490
|
+
needDeletionCheck = false;
|
|
7491
|
+
} else {
|
|
7492
|
+
extend(slots, children);
|
|
7493
|
+
if (!optimized && type === 1) {
|
|
7494
|
+
delete slots._;
|
|
7304
7495
|
}
|
|
7305
|
-
context.provides[key] = value;
|
|
7306
|
-
return app;
|
|
7307
7496
|
}
|
|
7308
|
-
}
|
|
7309
|
-
|
|
7310
|
-
|
|
7497
|
+
} else {
|
|
7498
|
+
needDeletionCheck = !children.$stable;
|
|
7499
|
+
normalizeObjectSlots(children, slots, instance);
|
|
7311
7500
|
}
|
|
7312
|
-
|
|
7313
|
-
}
|
|
7314
|
-
|
|
7501
|
+
deletionComparisonTarget = children;
|
|
7502
|
+
} else if (children) {
|
|
7503
|
+
normalizeVNodeSlots(instance, children);
|
|
7504
|
+
deletionComparisonTarget = { default: 1 };
|
|
7505
|
+
}
|
|
7506
|
+
if (needDeletionCheck) {
|
|
7507
|
+
for (const key in slots) {
|
|
7508
|
+
if (!isInternalKey(key) && !(key in deletionComparisonTarget)) {
|
|
7509
|
+
delete slots[key];
|
|
7510
|
+
}
|
|
7511
|
+
}
|
|
7512
|
+
}
|
|
7513
|
+
};
|
|
7315
7514
|
|
|
7316
7515
|
function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
7317
7516
|
if (isArray(rawRef)) {
|
|
@@ -8215,7 +8414,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8215
8414
|
areChildrenSVG,
|
|
8216
8415
|
slotScopeIds
|
|
8217
8416
|
);
|
|
8218
|
-
|
|
8417
|
+
{
|
|
8219
8418
|
traverseStaticChildren(n1, n2);
|
|
8220
8419
|
}
|
|
8221
8420
|
} else if (!optimized) {
|
|
@@ -8411,21 +8610,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8411
8610
|
isSVG,
|
|
8412
8611
|
slotScopeIds
|
|
8413
8612
|
);
|
|
8414
|
-
|
|
8613
|
+
{
|
|
8415
8614
|
traverseStaticChildren(n1, n2);
|
|
8416
|
-
} else if (
|
|
8417
|
-
// #2080 if the stable fragment has a key, it's a <template v-for> that may
|
|
8418
|
-
// get moved around. Make sure all root level vnodes inherit el.
|
|
8419
|
-
// #2134 or if it's a component root, it may also get moved around
|
|
8420
|
-
// as the component is being moved.
|
|
8421
|
-
n2.key != null || parentComponent && n2 === parentComponent.subTree
|
|
8422
|
-
) {
|
|
8423
|
-
traverseStaticChildren(
|
|
8424
|
-
n1,
|
|
8425
|
-
n2,
|
|
8426
|
-
true
|
|
8427
|
-
/* shallow */
|
|
8428
|
-
);
|
|
8429
8615
|
}
|
|
8430
8616
|
} else {
|
|
8431
8617
|
patchChildren(
|
|
@@ -10094,6 +10280,8 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
10094
10280
|
refs: EMPTY_OBJ,
|
|
10095
10281
|
setupState: EMPTY_OBJ,
|
|
10096
10282
|
setupContext: null,
|
|
10283
|
+
attrsProxy: null,
|
|
10284
|
+
slotsProxy: null,
|
|
10097
10285
|
// suspense related
|
|
10098
10286
|
suspense,
|
|
10099
10287
|
suspenseId: suspense ? suspense.pendingId : 0,
|
|
@@ -10345,8 +10533,8 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
10345
10533
|
}
|
|
10346
10534
|
}
|
|
10347
10535
|
}
|
|
10348
|
-
function
|
|
10349
|
-
return new Proxy(
|
|
10536
|
+
function getAttrsProxy(instance) {
|
|
10537
|
+
return instance.attrsProxy || (instance.attrsProxy = new Proxy(
|
|
10350
10538
|
instance.attrs,
|
|
10351
10539
|
{
|
|
10352
10540
|
get(target, key) {
|
|
@@ -10363,7 +10551,23 @@ function createAttrsProxy(instance) {
|
|
|
10363
10551
|
return false;
|
|
10364
10552
|
}
|
|
10365
10553
|
}
|
|
10366
|
-
);
|
|
10554
|
+
));
|
|
10555
|
+
}
|
|
10556
|
+
function getSlotsProxy(instance) {
|
|
10557
|
+
return instance.slotsProxy || (instance.slotsProxy = new Proxy(instance.slots, {
|
|
10558
|
+
get(target, key) {
|
|
10559
|
+
track(instance, "get", "$slots");
|
|
10560
|
+
return target[key];
|
|
10561
|
+
},
|
|
10562
|
+
set() {
|
|
10563
|
+
warn(`setupContext.slots is readonly.`);
|
|
10564
|
+
return false;
|
|
10565
|
+
},
|
|
10566
|
+
deleteProperty() {
|
|
10567
|
+
warn(`setupContext.slots is readonly.`);
|
|
10568
|
+
return false;
|
|
10569
|
+
}
|
|
10570
|
+
}));
|
|
10367
10571
|
}
|
|
10368
10572
|
function createSetupContext(instance) {
|
|
10369
10573
|
const expose = (exposed) => {
|
|
@@ -10389,14 +10593,13 @@ function createSetupContext(instance) {
|
|
|
10389
10593
|
}
|
|
10390
10594
|
instance.exposed = exposed || {};
|
|
10391
10595
|
};
|
|
10392
|
-
let attrs;
|
|
10393
10596
|
{
|
|
10394
10597
|
return Object.freeze({
|
|
10395
10598
|
get attrs() {
|
|
10396
|
-
return
|
|
10599
|
+
return getAttrsProxy(instance);
|
|
10397
10600
|
},
|
|
10398
10601
|
get slots() {
|
|
10399
|
-
return
|
|
10602
|
+
return getSlotsProxy(instance);
|
|
10400
10603
|
},
|
|
10401
10604
|
get emit() {
|
|
10402
10605
|
return (event, ...args) => instance.emit(event, ...args);
|
|
@@ -10456,111 +10659,6 @@ const computed = (getterOrOptions, debugOptions) => {
|
|
|
10456
10659
|
return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
10457
10660
|
};
|
|
10458
10661
|
|
|
10459
|
-
const warnRuntimeUsage = (method) => warn(
|
|
10460
|
-
`${method}() is a compiler-hint helper that is only usable inside <script setup> of a single file component. Its arguments should be compiled away and passing it at runtime has no effect.`
|
|
10461
|
-
);
|
|
10462
|
-
function defineProps() {
|
|
10463
|
-
{
|
|
10464
|
-
warnRuntimeUsage(`defineProps`);
|
|
10465
|
-
}
|
|
10466
|
-
return null;
|
|
10467
|
-
}
|
|
10468
|
-
function defineEmits() {
|
|
10469
|
-
{
|
|
10470
|
-
warnRuntimeUsage(`defineEmits`);
|
|
10471
|
-
}
|
|
10472
|
-
return null;
|
|
10473
|
-
}
|
|
10474
|
-
function defineExpose(exposed) {
|
|
10475
|
-
{
|
|
10476
|
-
warnRuntimeUsage(`defineExpose`);
|
|
10477
|
-
}
|
|
10478
|
-
}
|
|
10479
|
-
function defineOptions(options) {
|
|
10480
|
-
{
|
|
10481
|
-
warnRuntimeUsage(`defineOptions`);
|
|
10482
|
-
}
|
|
10483
|
-
}
|
|
10484
|
-
function defineSlots() {
|
|
10485
|
-
{
|
|
10486
|
-
warnRuntimeUsage(`defineSlots`);
|
|
10487
|
-
}
|
|
10488
|
-
}
|
|
10489
|
-
function withDefaults(props, defaults) {
|
|
10490
|
-
{
|
|
10491
|
-
warnRuntimeUsage(`withDefaults`);
|
|
10492
|
-
}
|
|
10493
|
-
return null;
|
|
10494
|
-
}
|
|
10495
|
-
function useSlots() {
|
|
10496
|
-
return getContext().slots;
|
|
10497
|
-
}
|
|
10498
|
-
function useAttrs() {
|
|
10499
|
-
return getContext().attrs;
|
|
10500
|
-
}
|
|
10501
|
-
function getContext() {
|
|
10502
|
-
const i = getCurrentInstance();
|
|
10503
|
-
if (!i) {
|
|
10504
|
-
warn(`useContext() called without active instance.`);
|
|
10505
|
-
}
|
|
10506
|
-
return i.setupContext || (i.setupContext = createSetupContext(i));
|
|
10507
|
-
}
|
|
10508
|
-
function mergeDefaults(raw, defaults) {
|
|
10509
|
-
const props = isArray(raw) ? raw.reduce(
|
|
10510
|
-
(normalized, p) => (normalized[p] = {}, normalized),
|
|
10511
|
-
{}
|
|
10512
|
-
) : raw;
|
|
10513
|
-
for (const key in defaults) {
|
|
10514
|
-
if (key.startsWith("__skip"))
|
|
10515
|
-
continue;
|
|
10516
|
-
let opt = props[key];
|
|
10517
|
-
if (opt) {
|
|
10518
|
-
if (isArray(opt) || isFunction(opt)) {
|
|
10519
|
-
opt = props[key] = { type: opt, default: defaults[key] };
|
|
10520
|
-
} else {
|
|
10521
|
-
opt.default = defaults[key];
|
|
10522
|
-
}
|
|
10523
|
-
} else if (opt === null) {
|
|
10524
|
-
opt = props[key] = { default: defaults[key] };
|
|
10525
|
-
} else {
|
|
10526
|
-
warn(`props default key "${key}" has no corresponding declaration.`);
|
|
10527
|
-
}
|
|
10528
|
-
if (opt && defaults[`__skip_${key}`]) {
|
|
10529
|
-
opt.skipFactory = true;
|
|
10530
|
-
}
|
|
10531
|
-
}
|
|
10532
|
-
return props;
|
|
10533
|
-
}
|
|
10534
|
-
function createPropsRestProxy(props, excludedKeys) {
|
|
10535
|
-
const ret = {};
|
|
10536
|
-
for (const key in props) {
|
|
10537
|
-
if (!excludedKeys.includes(key)) {
|
|
10538
|
-
Object.defineProperty(ret, key, {
|
|
10539
|
-
enumerable: true,
|
|
10540
|
-
get: () => props[key]
|
|
10541
|
-
});
|
|
10542
|
-
}
|
|
10543
|
-
}
|
|
10544
|
-
return ret;
|
|
10545
|
-
}
|
|
10546
|
-
function withAsyncContext(getAwaitable) {
|
|
10547
|
-
const ctx = getCurrentInstance();
|
|
10548
|
-
if (!ctx) {
|
|
10549
|
-
warn(
|
|
10550
|
-
`withAsyncContext called without active current instance. This is likely a bug.`
|
|
10551
|
-
);
|
|
10552
|
-
}
|
|
10553
|
-
let awaitable = getAwaitable();
|
|
10554
|
-
unsetCurrentInstance();
|
|
10555
|
-
if (isPromise(awaitable)) {
|
|
10556
|
-
awaitable = awaitable.catch((e) => {
|
|
10557
|
-
setCurrentInstance(ctx);
|
|
10558
|
-
throw e;
|
|
10559
|
-
});
|
|
10560
|
-
}
|
|
10561
|
-
return [awaitable, () => setCurrentInstance(ctx)];
|
|
10562
|
-
}
|
|
10563
|
-
|
|
10564
10662
|
function h(type, propsOrChildren, children) {
|
|
10565
10663
|
const l = arguments.length;
|
|
10566
10664
|
if (l === 2) {
|
|
@@ -10796,7 +10894,7 @@ function isMemoSame(cached, memo) {
|
|
|
10796
10894
|
return true;
|
|
10797
10895
|
}
|
|
10798
10896
|
|
|
10799
|
-
const version = "3.3.0-
|
|
10897
|
+
const version = "3.3.0-beta.1";
|
|
10800
10898
|
const _ssrUtils = {
|
|
10801
10899
|
createComponentInstance,
|
|
10802
10900
|
setupComponent,
|
|
@@ -12453,6 +12551,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
|
|
|
12453
12551
|
defineCustomElement: defineCustomElement,
|
|
12454
12552
|
defineEmits: defineEmits,
|
|
12455
12553
|
defineExpose: defineExpose,
|
|
12554
|
+
defineModel: defineModel,
|
|
12456
12555
|
defineOptions: defineOptions,
|
|
12457
12556
|
defineProps: defineProps,
|
|
12458
12557
|
defineSSRCustomElement: defineSSRCustomElement,
|
|
@@ -12466,6 +12565,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
|
|
|
12466
12565
|
guardReactiveProps: guardReactiveProps,
|
|
12467
12566
|
h: h,
|
|
12468
12567
|
handleError: handleError,
|
|
12568
|
+
hasInjectionContext: hasInjectionContext,
|
|
12469
12569
|
hydrate: hydrate,
|
|
12470
12570
|
initCustomFormatter: initCustomFormatter,
|
|
12471
12571
|
initDirectivesForSSR: initDirectivesForSSR,
|
|
@@ -12480,6 +12580,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
|
|
|
12480
12580
|
isVNode: isVNode,
|
|
12481
12581
|
markRaw: markRaw,
|
|
12482
12582
|
mergeDefaults: mergeDefaults,
|
|
12583
|
+
mergeModels: mergeModels,
|
|
12483
12584
|
mergeProps: mergeProps,
|
|
12484
12585
|
nextTick: nextTick,
|
|
12485
12586
|
normalizeClass: normalizeClass,
|
|
@@ -12538,6 +12639,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
|
|
|
12538
12639
|
useAttrs: useAttrs,
|
|
12539
12640
|
useCssModule: useCssModule,
|
|
12540
12641
|
useCssVars: useCssVars,
|
|
12642
|
+
useModel: useModel,
|
|
12541
12643
|
useSSRContext: useSSRContext,
|
|
12542
12644
|
useSlots: useSlots,
|
|
12543
12645
|
useTransitionState: useTransitionState,
|
|
@@ -12650,8 +12752,11 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
|
|
|
12650
12752
|
[48]: `ES module mode is not supported in this build of compiler.`,
|
|
12651
12753
|
[49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
|
|
12652
12754
|
[50]: `"scopeId" option is only supported in module mode.`,
|
|
12755
|
+
// deprecations
|
|
12756
|
+
[51]: `@vnode-* hooks in templates are deprecated. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support will be removed in 3.4.`,
|
|
12757
|
+
[52]: `v-is="component-name" has been deprecated. Use is="vue:component-name" instead. v-is support will be removed in 3.4.`,
|
|
12653
12758
|
// just to fulfill types
|
|
12654
|
-
[
|
|
12759
|
+
[53]: ``
|
|
12655
12760
|
};
|
|
12656
12761
|
|
|
12657
12762
|
const FRAGMENT = Symbol(`Fragment` );
|
|
@@ -14542,7 +14647,7 @@ const aliasHelper = (s) => `${helperNameMap[s]}: _${helperNameMap[s]}`;
|
|
|
14542
14647
|
function createCodegenContext(ast, {
|
|
14543
14648
|
mode = "function",
|
|
14544
14649
|
prefixIdentifiers = mode === "module",
|
|
14545
|
-
sourceMap
|
|
14650
|
+
sourceMap = false,
|
|
14546
14651
|
filename = `template.vue.html`,
|
|
14547
14652
|
scopeId = null,
|
|
14548
14653
|
optimizeImports = false,
|
|
@@ -14556,7 +14661,7 @@ function createCodegenContext(ast, {
|
|
|
14556
14661
|
const context = {
|
|
14557
14662
|
mode,
|
|
14558
14663
|
prefixIdentifiers,
|
|
14559
|
-
sourceMap
|
|
14664
|
+
sourceMap,
|
|
14560
14665
|
filename,
|
|
14561
14666
|
scopeId,
|
|
14562
14667
|
optimizeImports,
|
|
@@ -14628,8 +14733,8 @@ function createCodegenContext(ast, {
|
|
|
14628
14733
|
}
|
|
14629
14734
|
});
|
|
14630
14735
|
}
|
|
14631
|
-
if (sourceMap
|
|
14632
|
-
context.map = new
|
|
14736
|
+
if (sourceMap) {
|
|
14737
|
+
context.map = new sourceMapJs.SourceMapGenerator();
|
|
14633
14738
|
context.map.setSourceContent(filename, context.source);
|
|
14634
14739
|
}
|
|
14635
14740
|
return context;
|
|
@@ -15613,12 +15718,10 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
|
|
|
15613
15718
|
return genPropsAccessExp(bindingMetadata.__propsAliases[raw]);
|
|
15614
15719
|
}
|
|
15615
15720
|
} else {
|
|
15616
|
-
if (type && type.startsWith("setup")) {
|
|
15721
|
+
if (type && type.startsWith("setup") || type === "literal-const") {
|
|
15617
15722
|
return `$setup.${raw}`;
|
|
15618
15723
|
} else if (type === "props-aliased") {
|
|
15619
15724
|
return `$props['${bindingMetadata.__propsAliases[raw]}']`;
|
|
15620
|
-
} else if (type === "literal-const") {
|
|
15621
|
-
return raw;
|
|
15622
15725
|
} else if (type) {
|
|
15623
15726
|
return `$${type}.${raw}`;
|
|
15624
15727
|
}
|
|
@@ -16669,6 +16772,11 @@ function resolveComponentType(node, context, ssr = false) {
|
|
|
16669
16772
|
}
|
|
16670
16773
|
const isDir = !isExplicitDynamic && findDir(node, "is");
|
|
16671
16774
|
if (isDir && isDir.exp) {
|
|
16775
|
+
{
|
|
16776
|
+
context.onWarn(
|
|
16777
|
+
createCompilerError(52, isDir.loc)
|
|
16778
|
+
);
|
|
16779
|
+
}
|
|
16672
16780
|
return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [
|
|
16673
16781
|
isDir.exp
|
|
16674
16782
|
]);
|
|
@@ -17240,6 +17348,11 @@ const transformOn$1 = (dir, node, context, augmentor) => {
|
|
|
17240
17348
|
if (arg.type === 4) {
|
|
17241
17349
|
if (arg.isStatic) {
|
|
17242
17350
|
let rawName = arg.content;
|
|
17351
|
+
if (rawName.startsWith("vnode")) {
|
|
17352
|
+
context.onWarn(
|
|
17353
|
+
createCompilerError(51, arg.loc)
|
|
17354
|
+
);
|
|
17355
|
+
}
|
|
17243
17356
|
if (rawName.startsWith("vue:")) {
|
|
17244
17357
|
rawName = `vnode-${rawName.slice(4)}`;
|
|
17245
17358
|
}
|
|
@@ -17458,7 +17571,7 @@ const transformText = (node, context) => {
|
|
|
17458
17571
|
const seen$1 = /* @__PURE__ */ new WeakSet();
|
|
17459
17572
|
const transformOnce = (node, context) => {
|
|
17460
17573
|
if (node.type === 1 && findDir(node, "once", true)) {
|
|
17461
|
-
if (seen$1.has(node) || context.inVOnce) {
|
|
17574
|
+
if (seen$1.has(node) || context.inVOnce || context.inSSR) {
|
|
17462
17575
|
return;
|
|
17463
17576
|
}
|
|
17464
17577
|
seen$1.add(node);
|
|
@@ -20261,29 +20374,29 @@ function createDOMCompilerError(code, loc) {
|
|
|
20261
20374
|
);
|
|
20262
20375
|
}
|
|
20263
20376
|
const DOMErrorMessages = {
|
|
20264
|
-
[
|
|
20265
|
-
[
|
|
20266
|
-
[
|
|
20267
|
-
[
|
|
20268
|
-
[
|
|
20269
|
-
[
|
|
20270
|
-
[
|
|
20271
|
-
[
|
|
20272
|
-
[
|
|
20273
|
-
[
|
|
20274
|
-
[
|
|
20377
|
+
[53]: `v-html is missing expression.`,
|
|
20378
|
+
[54]: `v-html will override element children.`,
|
|
20379
|
+
[55]: `v-text is missing expression.`,
|
|
20380
|
+
[56]: `v-text will override element children.`,
|
|
20381
|
+
[57]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
|
|
20382
|
+
[58]: `v-model argument is not supported on plain elements.`,
|
|
20383
|
+
[59]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
|
|
20384
|
+
[60]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
|
|
20385
|
+
[61]: `v-show is missing expression.`,
|
|
20386
|
+
[62]: `<Transition> expects exactly one child element or component.`,
|
|
20387
|
+
[63]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
|
|
20275
20388
|
};
|
|
20276
20389
|
|
|
20277
20390
|
const transformVHtml = (dir, node, context) => {
|
|
20278
20391
|
const { exp, loc } = dir;
|
|
20279
20392
|
if (!exp) {
|
|
20280
20393
|
context.onError(
|
|
20281
|
-
createDOMCompilerError(
|
|
20394
|
+
createDOMCompilerError(53, loc)
|
|
20282
20395
|
);
|
|
20283
20396
|
}
|
|
20284
20397
|
if (node.children.length) {
|
|
20285
20398
|
context.onError(
|
|
20286
|
-
createDOMCompilerError(
|
|
20399
|
+
createDOMCompilerError(54, loc)
|
|
20287
20400
|
);
|
|
20288
20401
|
node.children.length = 0;
|
|
20289
20402
|
}
|
|
@@ -20301,12 +20414,12 @@ const transformVText = (dir, node, context) => {
|
|
|
20301
20414
|
const { exp, loc } = dir;
|
|
20302
20415
|
if (!exp) {
|
|
20303
20416
|
context.onError(
|
|
20304
|
-
createDOMCompilerError(
|
|
20417
|
+
createDOMCompilerError(55, loc)
|
|
20305
20418
|
);
|
|
20306
20419
|
}
|
|
20307
20420
|
if (node.children.length) {
|
|
20308
20421
|
context.onError(
|
|
20309
|
-
createDOMCompilerError(
|
|
20422
|
+
createDOMCompilerError(56, loc)
|
|
20310
20423
|
);
|
|
20311
20424
|
node.children.length = 0;
|
|
20312
20425
|
}
|
|
@@ -20332,7 +20445,7 @@ const transformModel = (dir, node, context) => {
|
|
|
20332
20445
|
if (dir.arg) {
|
|
20333
20446
|
context.onError(
|
|
20334
20447
|
createDOMCompilerError(
|
|
20335
|
-
|
|
20448
|
+
58,
|
|
20336
20449
|
dir.arg.loc
|
|
20337
20450
|
)
|
|
20338
20451
|
);
|
|
@@ -20342,7 +20455,7 @@ const transformModel = (dir, node, context) => {
|
|
|
20342
20455
|
if (value) {
|
|
20343
20456
|
context.onError(
|
|
20344
20457
|
createDOMCompilerError(
|
|
20345
|
-
|
|
20458
|
+
60,
|
|
20346
20459
|
value.loc
|
|
20347
20460
|
)
|
|
20348
20461
|
);
|
|
@@ -20370,7 +20483,7 @@ const transformModel = (dir, node, context) => {
|
|
|
20370
20483
|
isInvalidType = true;
|
|
20371
20484
|
context.onError(
|
|
20372
20485
|
createDOMCompilerError(
|
|
20373
|
-
|
|
20486
|
+
59,
|
|
20374
20487
|
dir.loc
|
|
20375
20488
|
)
|
|
20376
20489
|
);
|
|
@@ -20396,7 +20509,7 @@ const transformModel = (dir, node, context) => {
|
|
|
20396
20509
|
} else {
|
|
20397
20510
|
context.onError(
|
|
20398
20511
|
createDOMCompilerError(
|
|
20399
|
-
|
|
20512
|
+
57,
|
|
20400
20513
|
dir.loc
|
|
20401
20514
|
)
|
|
20402
20515
|
);
|
|
@@ -20508,7 +20621,7 @@ const transformShow = (dir, node, context) => {
|
|
|
20508
20621
|
const { exp, loc } = dir;
|
|
20509
20622
|
if (!exp) {
|
|
20510
20623
|
context.onError(
|
|
20511
|
-
createDOMCompilerError(
|
|
20624
|
+
createDOMCompilerError(61, loc)
|
|
20512
20625
|
);
|
|
20513
20626
|
}
|
|
20514
20627
|
return {
|
|
@@ -20528,7 +20641,7 @@ const transformTransition = (node, context) => {
|
|
|
20528
20641
|
if (hasMultipleChildren(node)) {
|
|
20529
20642
|
context.onError(
|
|
20530
20643
|
createDOMCompilerError(
|
|
20531
|
-
|
|
20644
|
+
62,
|
|
20532
20645
|
{
|
|
20533
20646
|
start: node.children[0].loc.start,
|
|
20534
20647
|
end: node.children[node.children.length - 1].loc.end,
|
|
@@ -20776,7 +20889,7 @@ function evaluateConstant(exp) {
|
|
|
20776
20889
|
const ignoreSideEffectTags = (node, context) => {
|
|
20777
20890
|
if (node.type === 1 && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) {
|
|
20778
20891
|
context.onError(
|
|
20779
|
-
createDOMCompilerError(
|
|
20892
|
+
createDOMCompilerError(63, node.loc)
|
|
20780
20893
|
);
|
|
20781
20894
|
context.removeNode();
|
|
20782
20895
|
}
|