@deot/vc 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +4 -4
- package/dist/index.d.ts +871 -137
- package/dist/index.iife.js +2017 -1283
- package/dist/index.js +5 -5
- package/dist/index.umd.cjs +2017 -1283
- package/package.json +4 -4
package/dist/index.umd.cjs
CHANGED
|
@@ -3696,138 +3696,6 @@
|
|
|
3696
3696
|
return flatten(value, JSON.parse);
|
|
3697
3697
|
};
|
|
3698
3698
|
|
|
3699
|
-
class Validator {
|
|
3700
|
-
static falsy = [void 0, null, ""];
|
|
3701
|
-
rules = {};
|
|
3702
|
-
paths;
|
|
3703
|
-
original;
|
|
3704
|
-
constructor(rules, paths, original) {
|
|
3705
|
-
this.updateRules(rules);
|
|
3706
|
-
this.paths = paths || [];
|
|
3707
|
-
this.original = original;
|
|
3708
|
-
}
|
|
3709
|
-
/**
|
|
3710
|
-
* 构建统一规则类型的Rule[], 也可供外部使用
|
|
3711
|
-
* @param rules ~
|
|
3712
|
-
*/
|
|
3713
|
-
updateRules(rules) {
|
|
3714
|
-
if (!rules)
|
|
3715
|
-
return;
|
|
3716
|
-
Object.keys(rules).forEach((field) => {
|
|
3717
|
-
const rule = rules[field];
|
|
3718
|
-
this.rules[field] = (Array.isArray(rule) ? rule : [rule]).map((rule$) => {
|
|
3719
|
-
if (typeof rule$ === "function") {
|
|
3720
|
-
return { validate: rule$ };
|
|
3721
|
-
}
|
|
3722
|
-
if (typeof rule$ === "string" || rule$ instanceof RegExp) {
|
|
3723
|
-
rule$ = { pattern: rule$ };
|
|
3724
|
-
}
|
|
3725
|
-
if (typeof rule$ === "boolean") {
|
|
3726
|
-
rule$ = { required: rule$ };
|
|
3727
|
-
}
|
|
3728
|
-
const { validate, pattern, required, enum: enum$ = [] } = rule$;
|
|
3729
|
-
if (validate && rule$.fields) {
|
|
3730
|
-
rule$.fields = void 0;
|
|
3731
|
-
}
|
|
3732
|
-
if (!validate && pattern) {
|
|
3733
|
-
const pattern$ = typeof pattern === "string" ? new RegExp(pattern) : pattern;
|
|
3734
|
-
return {
|
|
3735
|
-
...rule$,
|
|
3736
|
-
validate: (v) => pattern$.test(v)
|
|
3737
|
-
};
|
|
3738
|
-
}
|
|
3739
|
-
if (!validate && required) {
|
|
3740
|
-
return {
|
|
3741
|
-
...rule$,
|
|
3742
|
-
validate: (v) => Array.isArray(v) ? !!v.length && v.every((j) => Validator.falsy.every((i) => j !== i)) : Validator.falsy.every((i) => v !== i)
|
|
3743
|
-
};
|
|
3744
|
-
}
|
|
3745
|
-
if (!validate && enum$.length) {
|
|
3746
|
-
return {
|
|
3747
|
-
...rule$,
|
|
3748
|
-
validate: (v) => enum$.some((i) => v === i)
|
|
3749
|
-
};
|
|
3750
|
-
}
|
|
3751
|
-
return rule$;
|
|
3752
|
-
});
|
|
3753
|
-
});
|
|
3754
|
-
}
|
|
3755
|
-
async validate(source, options) {
|
|
3756
|
-
options = options || {};
|
|
3757
|
-
if (!Object.keys(this.rules).length) {
|
|
3758
|
-
return;
|
|
3759
|
-
}
|
|
3760
|
-
const needCheckFields = options.fields || Object.keys(this.rules);
|
|
3761
|
-
const errors = [];
|
|
3762
|
-
for (let i = 0; i < needCheckFields.length; i++) {
|
|
3763
|
-
const field = needCheckFields[i];
|
|
3764
|
-
const rules = this.rules[field];
|
|
3765
|
-
const value = source[field];
|
|
3766
|
-
const original = this.original;
|
|
3767
|
-
for (let j = 0; j < rules.length; j++) {
|
|
3768
|
-
const rule = rules[j];
|
|
3769
|
-
const { validate = () => {
|
|
3770
|
-
}, transform = (x) => x, fields: fields$ } = rule;
|
|
3771
|
-
const paths = [...this.paths, field];
|
|
3772
|
-
if (typeof options._index !== "undefined") {
|
|
3773
|
-
paths.splice(paths.length - 1, 0, options._index);
|
|
3774
|
-
}
|
|
3775
|
-
const value$ = transform(value, { field, source, paths, original });
|
|
3776
|
-
if (fields$) {
|
|
3777
|
-
const isArray = Array.isArray(value$);
|
|
3778
|
-
const value$$ = isArray ? value$ : [value$];
|
|
3779
|
-
if (value$$.every((v) => v && typeof v === "object")) {
|
|
3780
|
-
const validator = new Validator(fields$, paths);
|
|
3781
|
-
for (let k = 0; k < value$$.length; k++) {
|
|
3782
|
-
try {
|
|
3783
|
-
await validator.validate(value$$[k], { _index: isArray ? k : void 0, first: options.first, original });
|
|
3784
|
-
} catch (errors$) {
|
|
3785
|
-
errors.push(...errors$);
|
|
3786
|
-
if (errors$.length && options.first)
|
|
3787
|
-
break;
|
|
3788
|
-
}
|
|
3789
|
-
}
|
|
3790
|
-
continue;
|
|
3791
|
-
}
|
|
3792
|
-
}
|
|
3793
|
-
let result = validate(value$, { field, source, paths, original });
|
|
3794
|
-
let message$ = "";
|
|
3795
|
-
if (result instanceof Promise) {
|
|
3796
|
-
try {
|
|
3797
|
-
await result;
|
|
3798
|
-
} catch (e) {
|
|
3799
|
-
result = false;
|
|
3800
|
-
message$ = e.message || e;
|
|
3801
|
-
}
|
|
3802
|
-
} else if (typeof result === "string") {
|
|
3803
|
-
message$ = result;
|
|
3804
|
-
result = false;
|
|
3805
|
-
}
|
|
3806
|
-
if (result === false) {
|
|
3807
|
-
errors.push({
|
|
3808
|
-
paths,
|
|
3809
|
-
message: message$ || rule.message || "",
|
|
3810
|
-
field,
|
|
3811
|
-
value: value$
|
|
3812
|
-
});
|
|
3813
|
-
if (options.first)
|
|
3814
|
-
break;
|
|
3815
|
-
}
|
|
3816
|
-
}
|
|
3817
|
-
if (errors.length && options.first)
|
|
3818
|
-
break;
|
|
3819
|
-
}
|
|
3820
|
-
if (errors.length) {
|
|
3821
|
-
const errors$ = errors.map((i) => {
|
|
3822
|
-
const { message, ...extra } = i;
|
|
3823
|
-
i.message = typeof message === "function" ? message(extra) : message;
|
|
3824
|
-
return i;
|
|
3825
|
-
});
|
|
3826
|
-
return Promise.reject(errors$);
|
|
3827
|
-
}
|
|
3828
|
-
}
|
|
3829
|
-
}
|
|
3830
|
-
|
|
3831
3699
|
const IS_SERVER$2 = typeof window === "undefined";
|
|
3832
3700
|
|
|
3833
3701
|
const composedPath = (e) => {
|
|
@@ -3969,6 +3837,138 @@
|
|
|
3969
3837
|
};
|
|
3970
3838
|
};
|
|
3971
3839
|
|
|
3840
|
+
class Validator {
|
|
3841
|
+
static falsy = [void 0, null, ""];
|
|
3842
|
+
rules = {};
|
|
3843
|
+
paths;
|
|
3844
|
+
original;
|
|
3845
|
+
constructor(rules, paths, original) {
|
|
3846
|
+
this.updateRules(rules);
|
|
3847
|
+
this.paths = paths || [];
|
|
3848
|
+
this.original = original;
|
|
3849
|
+
}
|
|
3850
|
+
/**
|
|
3851
|
+
* 构建统一规则类型的Rule[], 也可供外部使用
|
|
3852
|
+
* @param rules ~
|
|
3853
|
+
*/
|
|
3854
|
+
updateRules(rules) {
|
|
3855
|
+
if (!rules)
|
|
3856
|
+
return;
|
|
3857
|
+
Object.keys(rules).forEach((field) => {
|
|
3858
|
+
const rule = rules[field];
|
|
3859
|
+
this.rules[field] = (Array.isArray(rule) ? rule : [rule]).map((rule$) => {
|
|
3860
|
+
if (typeof rule$ === "function") {
|
|
3861
|
+
return { validate: rule$ };
|
|
3862
|
+
}
|
|
3863
|
+
if (typeof rule$ === "string" || rule$ instanceof RegExp) {
|
|
3864
|
+
rule$ = { pattern: rule$ };
|
|
3865
|
+
}
|
|
3866
|
+
if (typeof rule$ === "boolean") {
|
|
3867
|
+
rule$ = { required: rule$ };
|
|
3868
|
+
}
|
|
3869
|
+
const { validate, pattern, required, enum: enum$ = [] } = rule$;
|
|
3870
|
+
if (validate && rule$.fields) {
|
|
3871
|
+
rule$.fields = void 0;
|
|
3872
|
+
}
|
|
3873
|
+
if (!validate && pattern) {
|
|
3874
|
+
const pattern$ = typeof pattern === "string" ? new RegExp(pattern) : pattern;
|
|
3875
|
+
return {
|
|
3876
|
+
...rule$,
|
|
3877
|
+
validate: (v) => pattern$.test(v)
|
|
3878
|
+
};
|
|
3879
|
+
}
|
|
3880
|
+
if (!validate && required) {
|
|
3881
|
+
return {
|
|
3882
|
+
...rule$,
|
|
3883
|
+
validate: (v) => Array.isArray(v) ? !!v.length && v.every((j) => Validator.falsy.every((i) => j !== i)) : Validator.falsy.every((i) => v !== i)
|
|
3884
|
+
};
|
|
3885
|
+
}
|
|
3886
|
+
if (!validate && enum$.length) {
|
|
3887
|
+
return {
|
|
3888
|
+
...rule$,
|
|
3889
|
+
validate: (v) => enum$.some((i) => v === i)
|
|
3890
|
+
};
|
|
3891
|
+
}
|
|
3892
|
+
return rule$;
|
|
3893
|
+
});
|
|
3894
|
+
});
|
|
3895
|
+
}
|
|
3896
|
+
async validate(source, options) {
|
|
3897
|
+
options = options || {};
|
|
3898
|
+
if (!Object.keys(this.rules).length) {
|
|
3899
|
+
return;
|
|
3900
|
+
}
|
|
3901
|
+
const needCheckFields = options.fields || Object.keys(this.rules);
|
|
3902
|
+
const errors = [];
|
|
3903
|
+
for (let i = 0; i < needCheckFields.length; i++) {
|
|
3904
|
+
const field = needCheckFields[i];
|
|
3905
|
+
const rules = this.rules[field];
|
|
3906
|
+
const value = source[field];
|
|
3907
|
+
const original = this.original;
|
|
3908
|
+
for (let j = 0; j < rules.length; j++) {
|
|
3909
|
+
const rule = rules[j];
|
|
3910
|
+
const { validate = () => {
|
|
3911
|
+
}, transform = (x) => x, fields: fields$ } = rule;
|
|
3912
|
+
const paths = [...this.paths, field];
|
|
3913
|
+
if (typeof options._index !== "undefined") {
|
|
3914
|
+
paths.splice(paths.length - 1, 0, options._index);
|
|
3915
|
+
}
|
|
3916
|
+
const value$ = transform(value, { field, source, paths, original });
|
|
3917
|
+
if (fields$) {
|
|
3918
|
+
const isArray = Array.isArray(value$);
|
|
3919
|
+
const value$$ = isArray ? value$ : [value$];
|
|
3920
|
+
if (value$$.every((v) => v && typeof v === "object")) {
|
|
3921
|
+
const validator = new Validator(fields$, paths);
|
|
3922
|
+
for (let k = 0; k < value$$.length; k++) {
|
|
3923
|
+
try {
|
|
3924
|
+
await validator.validate(value$$[k], { _index: isArray ? k : void 0, first: options.first, original });
|
|
3925
|
+
} catch (errors$) {
|
|
3926
|
+
errors.push(...errors$);
|
|
3927
|
+
if (errors$.length && options.first)
|
|
3928
|
+
break;
|
|
3929
|
+
}
|
|
3930
|
+
}
|
|
3931
|
+
continue;
|
|
3932
|
+
}
|
|
3933
|
+
}
|
|
3934
|
+
let result = validate(value$, { field, source, paths, original });
|
|
3935
|
+
let message$ = "";
|
|
3936
|
+
if (result instanceof Promise) {
|
|
3937
|
+
try {
|
|
3938
|
+
await result;
|
|
3939
|
+
} catch (e) {
|
|
3940
|
+
result = false;
|
|
3941
|
+
message$ = e.message || e;
|
|
3942
|
+
}
|
|
3943
|
+
} else if (typeof result === "string") {
|
|
3944
|
+
message$ = result;
|
|
3945
|
+
result = false;
|
|
3946
|
+
}
|
|
3947
|
+
if (result === false) {
|
|
3948
|
+
errors.push({
|
|
3949
|
+
paths,
|
|
3950
|
+
message: message$ || rule.message || "",
|
|
3951
|
+
field,
|
|
3952
|
+
value: value$
|
|
3953
|
+
});
|
|
3954
|
+
if (options.first)
|
|
3955
|
+
break;
|
|
3956
|
+
}
|
|
3957
|
+
}
|
|
3958
|
+
if (errors.length && options.first)
|
|
3959
|
+
break;
|
|
3960
|
+
}
|
|
3961
|
+
if (errors.length) {
|
|
3962
|
+
const errors$ = errors.map((i) => {
|
|
3963
|
+
const { message, ...extra } = i;
|
|
3964
|
+
i.message = typeof message === "function" ? message(extra) : message;
|
|
3965
|
+
return i;
|
|
3966
|
+
});
|
|
3967
|
+
return Promise.reject(errors$);
|
|
3968
|
+
}
|
|
3969
|
+
}
|
|
3970
|
+
}
|
|
3971
|
+
|
|
3972
3972
|
class ACache {
|
|
3973
3973
|
options;
|
|
3974
3974
|
constructor() {
|
|
@@ -5415,16 +5415,16 @@
|
|
|
5415
5415
|
}
|
|
5416
5416
|
}
|
|
5417
5417
|
const VcInstance = new Instance();
|
|
5418
|
-
const props$
|
|
5418
|
+
const props$1j = {
|
|
5419
5419
|
tag: {
|
|
5420
5420
|
type: String,
|
|
5421
5421
|
default: "div"
|
|
5422
5422
|
}
|
|
5423
5423
|
};
|
|
5424
|
-
const COMPONENT_NAME$
|
|
5424
|
+
const COMPONENT_NAME$1A = "vc-action-sheet";
|
|
5425
5425
|
const ActionSheet = /* @__PURE__ */ vue.defineComponent({
|
|
5426
|
-
name: COMPONENT_NAME$
|
|
5427
|
-
props: props$
|
|
5426
|
+
name: COMPONENT_NAME$1A,
|
|
5427
|
+
props: props$1j,
|
|
5428
5428
|
setup(props2, {
|
|
5429
5429
|
slots
|
|
5430
5430
|
}) {
|
|
@@ -5436,7 +5436,7 @@
|
|
|
5436
5436
|
}
|
|
5437
5437
|
});
|
|
5438
5438
|
const MActionSheet = ActionSheet;
|
|
5439
|
-
const props$
|
|
5439
|
+
const props$1i = {
|
|
5440
5440
|
modelValue: {
|
|
5441
5441
|
type: Boolean,
|
|
5442
5442
|
default: true
|
|
@@ -5462,7 +5462,7 @@
|
|
|
5462
5462
|
default: false
|
|
5463
5463
|
}
|
|
5464
5464
|
};
|
|
5465
|
-
const props$
|
|
5465
|
+
const props$1h = {
|
|
5466
5466
|
type: String,
|
|
5467
5467
|
inherit: {
|
|
5468
5468
|
type: Boolean,
|
|
@@ -5514,7 +5514,7 @@
|
|
|
5514
5514
|
icons = await this.parser(data, url);
|
|
5515
5515
|
try {
|
|
5516
5516
|
window.localStorage.setItem(key, JSON.stringify(icons));
|
|
5517
|
-
} catch
|
|
5517
|
+
} catch {
|
|
5518
5518
|
setTimeout(() => {
|
|
5519
5519
|
this.clearResource();
|
|
5520
5520
|
window.localStorage.setItem(key, JSON.stringify(icons));
|
|
@@ -5603,10 +5603,10 @@
|
|
|
5603
5603
|
}
|
|
5604
5604
|
}
|
|
5605
5605
|
const IconManager = new Manager();
|
|
5606
|
-
const COMPONENT_NAME$
|
|
5606
|
+
const COMPONENT_NAME$1z = "vc-icon";
|
|
5607
5607
|
const Icon = /* @__PURE__ */ vue.defineComponent({
|
|
5608
|
-
name: COMPONENT_NAME$
|
|
5609
|
-
props: props$
|
|
5608
|
+
name: COMPONENT_NAME$1z,
|
|
5609
|
+
props: props$1h,
|
|
5610
5610
|
setup(props2) {
|
|
5611
5611
|
const viewBox = vue.ref("0 0 1024 1024");
|
|
5612
5612
|
const path = vue.ref([]);
|
|
@@ -5638,7 +5638,7 @@
|
|
|
5638
5638
|
};
|
|
5639
5639
|
}
|
|
5640
5640
|
});
|
|
5641
|
-
const props$
|
|
5641
|
+
const props$1g = {
|
|
5642
5642
|
/**
|
|
5643
5643
|
* 进入/离开持续时间
|
|
5644
5644
|
* {enter: 300, leave: 300}
|
|
@@ -5801,10 +5801,10 @@
|
|
|
5801
5801
|
}
|
|
5802
5802
|
};
|
|
5803
5803
|
};
|
|
5804
|
-
const COMPONENT_NAME$
|
|
5804
|
+
const COMPONENT_NAME$1y = "vc-transition";
|
|
5805
5805
|
const Transition = vue.defineComponent({
|
|
5806
|
-
name: COMPONENT_NAME$
|
|
5807
|
-
props: props$
|
|
5806
|
+
name: COMPONENT_NAME$1y,
|
|
5807
|
+
props: props$1g,
|
|
5808
5808
|
// 当不声明emits的情况下,事件存在于attrs中
|
|
5809
5809
|
inheritAttrs: false,
|
|
5810
5810
|
setup(props2, { slots, attrs }) {
|
|
@@ -5823,10 +5823,10 @@
|
|
|
5823
5823
|
};
|
|
5824
5824
|
}
|
|
5825
5825
|
});
|
|
5826
|
-
const COMPONENT_NAME$
|
|
5826
|
+
const COMPONENT_NAME$1x = "vc-transition-collapse";
|
|
5827
5827
|
const TransitionCollapse = vue.defineComponent({
|
|
5828
|
-
name: COMPONENT_NAME$
|
|
5829
|
-
props: props$
|
|
5828
|
+
name: COMPONENT_NAME$1x,
|
|
5829
|
+
props: props$1g,
|
|
5830
5830
|
// 当不声明emits的情况下,事件存在于attrs中
|
|
5831
5831
|
inheritAttrs: false,
|
|
5832
5832
|
setup(props2, { slots, attrs: _attrs }) {
|
|
@@ -5943,11 +5943,11 @@
|
|
|
5943
5943
|
};
|
|
5944
5944
|
}
|
|
5945
5945
|
});
|
|
5946
|
-
const COMPONENT_NAME$
|
|
5946
|
+
const COMPONENT_NAME$1w = "vc-transition-fade";
|
|
5947
5947
|
const TransitionFade = vue.defineComponent({
|
|
5948
|
-
name: COMPONENT_NAME$
|
|
5948
|
+
name: COMPONENT_NAME$1w,
|
|
5949
5949
|
props: {
|
|
5950
|
-
...props$
|
|
5950
|
+
...props$1g,
|
|
5951
5951
|
// inheritAttrs必须是false
|
|
5952
5952
|
style: {
|
|
5953
5953
|
type: Object,
|
|
@@ -5979,11 +5979,11 @@
|
|
|
5979
5979
|
};
|
|
5980
5980
|
}
|
|
5981
5981
|
});
|
|
5982
|
-
const COMPONENT_NAME$
|
|
5982
|
+
const COMPONENT_NAME$1v = "vc-transition-scale";
|
|
5983
5983
|
const TransitionScale = vue.defineComponent({
|
|
5984
|
-
name: COMPONENT_NAME$
|
|
5984
|
+
name: COMPONENT_NAME$1v,
|
|
5985
5985
|
props: {
|
|
5986
|
-
...props$
|
|
5986
|
+
...props$1g,
|
|
5987
5987
|
mode: {
|
|
5988
5988
|
type: String,
|
|
5989
5989
|
default: "both",
|
|
@@ -6020,15 +6020,15 @@
|
|
|
6020
6020
|
};
|
|
6021
6021
|
}
|
|
6022
6022
|
});
|
|
6023
|
-
const COMPONENT_NAME$
|
|
6023
|
+
const COMPONENT_NAME$1u = "vc-transition-slide";
|
|
6024
6024
|
const TransitionSlide = vue.defineComponent({
|
|
6025
|
-
name: COMPONENT_NAME$
|
|
6025
|
+
name: COMPONENT_NAME$1u,
|
|
6026
6026
|
props: {
|
|
6027
|
-
...props$
|
|
6027
|
+
...props$1g,
|
|
6028
6028
|
mode: {
|
|
6029
6029
|
type: String,
|
|
6030
6030
|
default: "left",
|
|
6031
|
-
validator: (v) => /^(left|right|
|
|
6031
|
+
validator: (v) => /^(left|right|top|bottom|none)(|-part)$/.test(v)
|
|
6032
6032
|
},
|
|
6033
6033
|
// inheritAttrs必须是false
|
|
6034
6034
|
style: {
|
|
@@ -6061,11 +6061,11 @@
|
|
|
6061
6061
|
};
|
|
6062
6062
|
}
|
|
6063
6063
|
});
|
|
6064
|
-
const COMPONENT_NAME$
|
|
6064
|
+
const COMPONENT_NAME$1t = "vc-transition-zoom";
|
|
6065
6065
|
const TransitionZoom = vue.defineComponent({
|
|
6066
|
-
name: COMPONENT_NAME$
|
|
6066
|
+
name: COMPONENT_NAME$1t,
|
|
6067
6067
|
props: {
|
|
6068
|
-
...props$
|
|
6068
|
+
...props$1g,
|
|
6069
6069
|
mode: {
|
|
6070
6070
|
type: String,
|
|
6071
6071
|
default: "x",
|
|
@@ -6102,7 +6102,7 @@
|
|
|
6102
6102
|
};
|
|
6103
6103
|
}
|
|
6104
6104
|
});
|
|
6105
|
-
const COMPONENT_NAME$
|
|
6105
|
+
const COMPONENT_NAME$1s = "vc-alert";
|
|
6106
6106
|
const THEME_MAP = {
|
|
6107
6107
|
info: ["#5495f6", "#91d5ff", "#e6f7ff"],
|
|
6108
6108
|
success: ["#52c41a", "#b7eb8f", "#f6ffed"],
|
|
@@ -6110,8 +6110,8 @@
|
|
|
6110
6110
|
warning: ["#ffbf00", "#ffe58f", "#fffbe6"]
|
|
6111
6111
|
};
|
|
6112
6112
|
const Alert = /* @__PURE__ */ vue.defineComponent({
|
|
6113
|
-
name: COMPONENT_NAME$
|
|
6114
|
-
props: props$
|
|
6113
|
+
name: COMPONENT_NAME$1s,
|
|
6114
|
+
props: props$1i,
|
|
6115
6115
|
setup(props2, {
|
|
6116
6116
|
slots,
|
|
6117
6117
|
emit
|
|
@@ -6197,16 +6197,16 @@
|
|
|
6197
6197
|
}
|
|
6198
6198
|
});
|
|
6199
6199
|
const MAlert = Alert;
|
|
6200
|
-
const props$
|
|
6200
|
+
const props$1f = {
|
|
6201
6201
|
tag: {
|
|
6202
6202
|
type: String,
|
|
6203
6203
|
default: "div"
|
|
6204
6204
|
}
|
|
6205
6205
|
};
|
|
6206
|
-
const COMPONENT_NAME$
|
|
6206
|
+
const COMPONENT_NAME$1r = "vc-artboard";
|
|
6207
6207
|
const Artboard = /* @__PURE__ */ vue.defineComponent({
|
|
6208
|
-
name: COMPONENT_NAME$
|
|
6209
|
-
props: props$
|
|
6208
|
+
name: COMPONENT_NAME$1r,
|
|
6209
|
+
props: props$1f,
|
|
6210
6210
|
setup(props2, {
|
|
6211
6211
|
slots
|
|
6212
6212
|
}) {
|
|
@@ -6218,7 +6218,7 @@
|
|
|
6218
6218
|
}
|
|
6219
6219
|
});
|
|
6220
6220
|
const MArtboard = Artboard;
|
|
6221
|
-
const props$
|
|
6221
|
+
const props$1e = {
|
|
6222
6222
|
size: {
|
|
6223
6223
|
type: Number,
|
|
6224
6224
|
default: 28
|
|
@@ -6239,10 +6239,10 @@
|
|
|
6239
6239
|
default: false
|
|
6240
6240
|
}
|
|
6241
6241
|
};
|
|
6242
|
-
const COMPONENT_NAME$
|
|
6242
|
+
const COMPONENT_NAME$1q = "vc-spin";
|
|
6243
6243
|
const Spin = /* @__PURE__ */ vue.defineComponent({
|
|
6244
|
-
name: COMPONENT_NAME$
|
|
6245
|
-
props: props$
|
|
6244
|
+
name: COMPONENT_NAME$1q,
|
|
6245
|
+
props: props$1e,
|
|
6246
6246
|
setup(props2, {
|
|
6247
6247
|
slots
|
|
6248
6248
|
}) {
|
|
@@ -6275,7 +6275,7 @@
|
|
|
6275
6275
|
};
|
|
6276
6276
|
}
|
|
6277
6277
|
});
|
|
6278
|
-
const props$
|
|
6278
|
+
const props$1d = {
|
|
6279
6279
|
wait: {
|
|
6280
6280
|
type: Number,
|
|
6281
6281
|
default: 250
|
|
@@ -6290,10 +6290,10 @@
|
|
|
6290
6290
|
},
|
|
6291
6291
|
exclude: RegExp
|
|
6292
6292
|
};
|
|
6293
|
-
const COMPONENT_NAME$
|
|
6293
|
+
const COMPONENT_NAME$1p = "vc-debounce";
|
|
6294
6294
|
const Debounce = vue.defineComponent({
|
|
6295
|
-
name: COMPONENT_NAME$
|
|
6296
|
-
props: props$
|
|
6295
|
+
name: COMPONENT_NAME$1p,
|
|
6296
|
+
props: props$1d,
|
|
6297
6297
|
/**
|
|
6298
6298
|
* 不声明emits使得事件被透传放入attrs中, 这样可以让所有的事件透传
|
|
6299
6299
|
* 如事件onClick
|
|
@@ -6333,7 +6333,7 @@
|
|
|
6333
6333
|
};
|
|
6334
6334
|
}
|
|
6335
6335
|
});
|
|
6336
|
-
const props$
|
|
6336
|
+
const props$1c = {
|
|
6337
6337
|
tag: {
|
|
6338
6338
|
type: String,
|
|
6339
6339
|
default: "button"
|
|
@@ -6360,18 +6360,18 @@
|
|
|
6360
6360
|
default: "button"
|
|
6361
6361
|
}
|
|
6362
6362
|
};
|
|
6363
|
-
const COMPONENT_NAME$
|
|
6363
|
+
const COMPONENT_NAME$1o = "vc-button";
|
|
6364
6364
|
const Button = /* @__PURE__ */ vue.defineComponent({
|
|
6365
|
-
name: COMPONENT_NAME$
|
|
6365
|
+
name: COMPONENT_NAME$1o,
|
|
6366
6366
|
emits: ["click"],
|
|
6367
|
-
props: props$
|
|
6367
|
+
props: props$1c,
|
|
6368
6368
|
setup(props2, {
|
|
6369
6369
|
slots
|
|
6370
6370
|
}) {
|
|
6371
6371
|
const vm = vue.getCurrentInstance();
|
|
6372
6372
|
const hasSlot = vue.ref(true);
|
|
6373
6373
|
const isLoading = vue.ref(false);
|
|
6374
|
-
const group = vue.inject("button-group", {
|
|
6374
|
+
const group = vue.inject("vc-button-group", {
|
|
6375
6375
|
size: "medium",
|
|
6376
6376
|
vertical: false,
|
|
6377
6377
|
circle: false
|
|
@@ -6420,7 +6420,7 @@
|
|
|
6420
6420
|
};
|
|
6421
6421
|
}
|
|
6422
6422
|
});
|
|
6423
|
-
const props$
|
|
6423
|
+
const props$1b = {
|
|
6424
6424
|
vertical: {
|
|
6425
6425
|
type: Boolean,
|
|
6426
6426
|
default: false
|
|
@@ -6438,14 +6438,14 @@
|
|
|
6438
6438
|
default: false
|
|
6439
6439
|
}
|
|
6440
6440
|
};
|
|
6441
|
-
const COMPONENT_NAME$
|
|
6441
|
+
const COMPONENT_NAME$1n = "vc-button-group";
|
|
6442
6442
|
const ButtonGroup = /* @__PURE__ */ vue.defineComponent({
|
|
6443
|
-
name: COMPONENT_NAME$
|
|
6444
|
-
props: props$
|
|
6443
|
+
name: COMPONENT_NAME$1n,
|
|
6444
|
+
props: props$1b,
|
|
6445
6445
|
setup(props2, {
|
|
6446
6446
|
slots
|
|
6447
6447
|
}) {
|
|
6448
|
-
vue.provide("button-group", props2);
|
|
6448
|
+
vue.provide("vc-button-group", props2);
|
|
6449
6449
|
const classes = vue.computed(() => ({
|
|
6450
6450
|
"is-vertical": props2.vertical,
|
|
6451
6451
|
"is-circle": props2.circle,
|
|
@@ -6463,16 +6463,16 @@
|
|
|
6463
6463
|
});
|
|
6464
6464
|
const MButton = Button;
|
|
6465
6465
|
const MButtonGroup = ButtonGroup;
|
|
6466
|
-
const props$
|
|
6466
|
+
const props$1a = {
|
|
6467
6467
|
tag: {
|
|
6468
6468
|
type: String,
|
|
6469
6469
|
default: "div"
|
|
6470
6470
|
}
|
|
6471
6471
|
};
|
|
6472
|
-
const COMPONENT_NAME$
|
|
6472
|
+
const COMPONENT_NAME$1m = "vc-calendar";
|
|
6473
6473
|
const Calendar$1 = /* @__PURE__ */ vue.defineComponent({
|
|
6474
|
-
name: COMPONENT_NAME$
|
|
6475
|
-
props: props$
|
|
6474
|
+
name: COMPONENT_NAME$1m,
|
|
6475
|
+
props: props$1a,
|
|
6476
6476
|
setup(props2, {
|
|
6477
6477
|
slots
|
|
6478
6478
|
}) {
|
|
@@ -6484,7 +6484,7 @@
|
|
|
6484
6484
|
}
|
|
6485
6485
|
});
|
|
6486
6486
|
const MCalendar = Calendar$1;
|
|
6487
|
-
const props$
|
|
6487
|
+
const props$19 = {
|
|
6488
6488
|
border: {
|
|
6489
6489
|
type: Boolean,
|
|
6490
6490
|
default: true
|
|
@@ -6504,10 +6504,10 @@
|
|
|
6504
6504
|
type: String
|
|
6505
6505
|
}
|
|
6506
6506
|
};
|
|
6507
|
-
const COMPONENT_NAME$
|
|
6507
|
+
const COMPONENT_NAME$1l = "vc-card";
|
|
6508
6508
|
const Card = /* @__PURE__ */ vue.defineComponent({
|
|
6509
|
-
name: COMPONENT_NAME$
|
|
6510
|
-
props: props$
|
|
6509
|
+
name: COMPONENT_NAME$1l,
|
|
6510
|
+
props: props$19,
|
|
6511
6511
|
setup(props2, {
|
|
6512
6512
|
slots
|
|
6513
6513
|
}) {
|
|
@@ -6531,16 +6531,16 @@
|
|
|
6531
6531
|
}
|
|
6532
6532
|
});
|
|
6533
6533
|
const MCard = Card;
|
|
6534
|
-
const props$
|
|
6534
|
+
const props$18 = {
|
|
6535
6535
|
tag: {
|
|
6536
6536
|
type: String,
|
|
6537
6537
|
default: "div"
|
|
6538
6538
|
}
|
|
6539
6539
|
};
|
|
6540
|
-
const COMPONENT_NAME$
|
|
6540
|
+
const COMPONENT_NAME$1k = "vc-carousel";
|
|
6541
6541
|
const Carousel = /* @__PURE__ */ vue.defineComponent({
|
|
6542
|
-
name: COMPONENT_NAME$
|
|
6543
|
-
props: props$
|
|
6542
|
+
name: COMPONENT_NAME$1k,
|
|
6543
|
+
props: props$18,
|
|
6544
6544
|
setup(props2, {
|
|
6545
6545
|
slots
|
|
6546
6546
|
}) {
|
|
@@ -6552,16 +6552,16 @@
|
|
|
6552
6552
|
}
|
|
6553
6553
|
});
|
|
6554
6554
|
const MCarousel = Carousel;
|
|
6555
|
-
const props$
|
|
6555
|
+
const props$17 = {
|
|
6556
6556
|
tag: {
|
|
6557
6557
|
type: String,
|
|
6558
6558
|
default: "div"
|
|
6559
6559
|
}
|
|
6560
6560
|
};
|
|
6561
|
-
const COMPONENT_NAME$
|
|
6561
|
+
const COMPONENT_NAME$1j = "vc-cascader";
|
|
6562
6562
|
const Cascader = /* @__PURE__ */ vue.defineComponent({
|
|
6563
|
-
name: COMPONENT_NAME$
|
|
6564
|
-
props: props$
|
|
6563
|
+
name: COMPONENT_NAME$1j,
|
|
6564
|
+
props: props$17,
|
|
6565
6565
|
setup(props2, {
|
|
6566
6566
|
slots
|
|
6567
6567
|
}) {
|
|
@@ -6611,7 +6611,7 @@
|
|
|
6611
6611
|
"globalout",
|
|
6612
6612
|
"contextmenu"
|
|
6613
6613
|
];
|
|
6614
|
-
const props$
|
|
6614
|
+
const props$16 = {
|
|
6615
6615
|
options: Object,
|
|
6616
6616
|
pluginOptions: Object,
|
|
6617
6617
|
theme: [String, Object],
|
|
@@ -6620,10 +6620,10 @@
|
|
|
6620
6620
|
watchShallow: Boolean,
|
|
6621
6621
|
manualUpdate: Boolean
|
|
6622
6622
|
};
|
|
6623
|
-
const COMPONENT_NAME$
|
|
6623
|
+
const COMPONENT_NAME$1i = "vc-chart";
|
|
6624
6624
|
const Chart = /* @__PURE__ */ vue.defineComponent({
|
|
6625
|
-
name: COMPONENT_NAME$
|
|
6626
|
-
props: props$
|
|
6625
|
+
name: COMPONENT_NAME$1i,
|
|
6626
|
+
props: props$16,
|
|
6627
6627
|
emits: [...EVENTS, "ready"],
|
|
6628
6628
|
setup(props2, {
|
|
6629
6629
|
emit,
|
|
@@ -6731,16 +6731,16 @@
|
|
|
6731
6731
|
}
|
|
6732
6732
|
});
|
|
6733
6733
|
const MChart = Chart;
|
|
6734
|
-
const props$
|
|
6734
|
+
const props$15 = {
|
|
6735
6735
|
tag: {
|
|
6736
6736
|
type: String,
|
|
6737
6737
|
default: "div"
|
|
6738
6738
|
}
|
|
6739
6739
|
};
|
|
6740
|
-
const COMPONENT_NAME$
|
|
6740
|
+
const COMPONENT_NAME$1h = "vc-checkbox";
|
|
6741
6741
|
const Checkbox = /* @__PURE__ */ vue.defineComponent({
|
|
6742
|
-
name: COMPONENT_NAME$
|
|
6743
|
-
props: props$
|
|
6742
|
+
name: COMPONENT_NAME$1h,
|
|
6743
|
+
props: props$15,
|
|
6744
6744
|
setup(props2, {
|
|
6745
6745
|
slots
|
|
6746
6746
|
}) {
|
|
@@ -6752,16 +6752,16 @@
|
|
|
6752
6752
|
}
|
|
6753
6753
|
});
|
|
6754
6754
|
const MCheckbox = Checkbox;
|
|
6755
|
-
const props$
|
|
6755
|
+
const props$14 = {
|
|
6756
6756
|
tag: {
|
|
6757
6757
|
type: String,
|
|
6758
6758
|
default: "div"
|
|
6759
6759
|
}
|
|
6760
6760
|
};
|
|
6761
|
-
const COMPONENT_NAME$
|
|
6761
|
+
const COMPONENT_NAME$1g = "vc-clipboard";
|
|
6762
6762
|
const Clipboard = /* @__PURE__ */ vue.defineComponent({
|
|
6763
|
-
name: COMPONENT_NAME$
|
|
6764
|
-
props: props$
|
|
6763
|
+
name: COMPONENT_NAME$1g,
|
|
6764
|
+
props: props$14,
|
|
6765
6765
|
setup(props2, {
|
|
6766
6766
|
slots
|
|
6767
6767
|
}) {
|
|
@@ -6773,36 +6773,246 @@
|
|
|
6773
6773
|
}
|
|
6774
6774
|
});
|
|
6775
6775
|
const MClipboard = Clipboard;
|
|
6776
|
+
const props$13 = {
|
|
6777
|
+
tag: {
|
|
6778
|
+
type: String,
|
|
6779
|
+
default: "div"
|
|
6780
|
+
},
|
|
6781
|
+
accordion: {
|
|
6782
|
+
type: Boolean,
|
|
6783
|
+
default: false
|
|
6784
|
+
},
|
|
6785
|
+
modelValue: {
|
|
6786
|
+
type: [Array, String, Number]
|
|
6787
|
+
},
|
|
6788
|
+
alive: {
|
|
6789
|
+
type: Boolean,
|
|
6790
|
+
default: true
|
|
6791
|
+
},
|
|
6792
|
+
// TODO: 添加默认样式
|
|
6793
|
+
styleless: {
|
|
6794
|
+
type: Boolean,
|
|
6795
|
+
default: false
|
|
6796
|
+
}
|
|
6797
|
+
};
|
|
6798
|
+
const COMPONENT_NAME$1f = "vc-collapse";
|
|
6799
|
+
const Collapse = vue.defineComponent({
|
|
6800
|
+
name: COMPONENT_NAME$1f,
|
|
6801
|
+
props: props$13,
|
|
6802
|
+
emits: ["update:moodelValue", "change"],
|
|
6803
|
+
setup(props2, { slots, emit }) {
|
|
6804
|
+
const instance = vue.getCurrentInstance();
|
|
6805
|
+
const currentValue = vue.ref();
|
|
6806
|
+
const items = vue.ref([]);
|
|
6807
|
+
const sync = () => {
|
|
6808
|
+
const v = props2.accordion ? currentValue.value[0] : currentValue.value;
|
|
6809
|
+
emit("update:moodelValue", v);
|
|
6810
|
+
emit("change", v);
|
|
6811
|
+
};
|
|
6812
|
+
const setActive = () => {
|
|
6813
|
+
const activeKey = currentValue.value;
|
|
6814
|
+
vue.nextTick(() => {
|
|
6815
|
+
items.value.forEach((child, index) => {
|
|
6816
|
+
const value = typeof child.props.value !== "undefined" ? child.props.value : index;
|
|
6817
|
+
child.exposed.toggle(activeKey.indexOf(value) > -1);
|
|
6818
|
+
});
|
|
6819
|
+
});
|
|
6820
|
+
};
|
|
6821
|
+
const toggle = (item) => {
|
|
6822
|
+
const activeKey = currentValue.value;
|
|
6823
|
+
const index = activeKey.indexOf(item.value);
|
|
6824
|
+
if (!item.visible) {
|
|
6825
|
+
if (index > -1) {
|
|
6826
|
+
activeKey.splice(index, 1);
|
|
6827
|
+
}
|
|
6828
|
+
} else if (index < 0) {
|
|
6829
|
+
activeKey.push(item.value);
|
|
6830
|
+
}
|
|
6831
|
+
currentValue.value = props2.accordion ? activeKey.slice(-1) : activeKey;
|
|
6832
|
+
sync();
|
|
6833
|
+
};
|
|
6834
|
+
const add = (item, setValue) => {
|
|
6835
|
+
if (!item) return;
|
|
6836
|
+
vue.nextTick(() => {
|
|
6837
|
+
if (instance.vnode.el) {
|
|
6838
|
+
const index = Array.from(instance.vnode.el.children).filter((i) => /vcm?-collapse-item/.test(i.className)).indexOf(item.vnode.el);
|
|
6839
|
+
if (index != -1) {
|
|
6840
|
+
items.value.splice(index, 0, item);
|
|
6841
|
+
typeof item.props.value === "undefined" && setValue(index);
|
|
6842
|
+
return;
|
|
6843
|
+
}
|
|
6844
|
+
}
|
|
6845
|
+
items.value.push(item);
|
|
6846
|
+
typeof item.props.value === "undefined" && setValue(items.value.length - 1);
|
|
6847
|
+
});
|
|
6848
|
+
};
|
|
6849
|
+
const remove = (item, setValue) => {
|
|
6850
|
+
if (!item) return;
|
|
6851
|
+
items.value.splice(items.value.indexOf(item), 1);
|
|
6852
|
+
items.value.forEach((_, index) => setValue(index));
|
|
6853
|
+
};
|
|
6854
|
+
vue.provide("vc-collapse", {
|
|
6855
|
+
props: props2,
|
|
6856
|
+
toggle,
|
|
6857
|
+
add,
|
|
6858
|
+
remove
|
|
6859
|
+
});
|
|
6860
|
+
vue.watch(
|
|
6861
|
+
() => props2.modelValue,
|
|
6862
|
+
(v) => {
|
|
6863
|
+
if (v === currentValue.value) return;
|
|
6864
|
+
currentValue.value = props2.accordion && typeof v !== "undefined" ? Array.isArray(v) ? v : [v] : Array.isArray(v) ? v : [];
|
|
6865
|
+
},
|
|
6866
|
+
{ immediate: true }
|
|
6867
|
+
);
|
|
6868
|
+
vue.watch(
|
|
6869
|
+
() => currentValue.value,
|
|
6870
|
+
setActive,
|
|
6871
|
+
{ deep: true }
|
|
6872
|
+
);
|
|
6873
|
+
vue.onMounted(setActive);
|
|
6874
|
+
return () => {
|
|
6875
|
+
return vue.h(
|
|
6876
|
+
props2.tag,
|
|
6877
|
+
{
|
|
6878
|
+
class: [{ "vc-collapse": !props2.styleless }]
|
|
6879
|
+
},
|
|
6880
|
+
slots.default?.()
|
|
6881
|
+
);
|
|
6882
|
+
};
|
|
6883
|
+
}
|
|
6884
|
+
});
|
|
6885
|
+
const props$12 = {
|
|
6886
|
+
tag: {
|
|
6887
|
+
type: String,
|
|
6888
|
+
default: "div"
|
|
6889
|
+
},
|
|
6890
|
+
value: {
|
|
6891
|
+
type: [String, Number]
|
|
6892
|
+
}
|
|
6893
|
+
};
|
|
6776
6894
|
const props$11 = {
|
|
6777
6895
|
tag: {
|
|
6778
6896
|
type: String,
|
|
6779
6897
|
default: "div"
|
|
6898
|
+
},
|
|
6899
|
+
modelValue: {
|
|
6900
|
+
type: Boolean,
|
|
6901
|
+
default: false
|
|
6902
|
+
},
|
|
6903
|
+
// 子节点每次toggle不销毁
|
|
6904
|
+
alive: {
|
|
6905
|
+
type: Boolean,
|
|
6906
|
+
default: true
|
|
6780
6907
|
}
|
|
6781
6908
|
};
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
|
|
6909
|
+
function _isSlot$2(s) {
|
|
6910
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
|
|
6911
|
+
}
|
|
6912
|
+
const COMPONENT_NAME$1e = "vc-expand";
|
|
6913
|
+
const Expand = /* @__PURE__ */ vue.defineComponent({
|
|
6914
|
+
name: COMPONENT_NAME$1e,
|
|
6785
6915
|
props: props$11,
|
|
6786
6916
|
setup(props2, {
|
|
6787
6917
|
slots
|
|
6788
6918
|
}) {
|
|
6919
|
+
const isActive = vue.ref(false);
|
|
6920
|
+
const Content = props2.tag;
|
|
6921
|
+
vue.watch(() => props2.modelValue, (v) => {
|
|
6922
|
+
isActive.value = v;
|
|
6923
|
+
}, {
|
|
6924
|
+
immediate: true
|
|
6925
|
+
});
|
|
6789
6926
|
return () => {
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
|
|
6927
|
+
let _slot;
|
|
6928
|
+
return vue.createVNode(TransitionCollapse, {
|
|
6929
|
+
"duration": {
|
|
6930
|
+
enter: 200,
|
|
6931
|
+
leave: 200
|
|
6932
|
+
}
|
|
6933
|
+
}, _isSlot$2(_slot = vue.withDirectives(vue.createVNode(Content, null, {
|
|
6934
|
+
default: () => [(props2.alive || !props2.alive && isActive.value) && slots.default?.()]
|
|
6935
|
+
}), [[vue.vShow, isActive.value]])) ? _slot : {
|
|
6936
|
+
default: () => [_slot]
|
|
6937
|
+
});
|
|
6938
|
+
};
|
|
6939
|
+
}
|
|
6940
|
+
});
|
|
6941
|
+
const COMPONENT_NAME$1d = "vc-collapse-item";
|
|
6942
|
+
const CollapseItem = /* @__PURE__ */ vue.defineComponent({
|
|
6943
|
+
name: COMPONENT_NAME$1d,
|
|
6944
|
+
props: props$12,
|
|
6945
|
+
setup(props2, {
|
|
6946
|
+
slots,
|
|
6947
|
+
expose
|
|
6948
|
+
}) {
|
|
6949
|
+
const Content = props2.tag;
|
|
6950
|
+
const instance = vue.getCurrentInstance();
|
|
6951
|
+
const isActive = vue.ref(false);
|
|
6952
|
+
const current = vue.ref();
|
|
6953
|
+
const collapse = vue.inject("vc-collapse");
|
|
6954
|
+
const handleToggle = () => {
|
|
6955
|
+
collapse.toggle({
|
|
6956
|
+
value: typeof props2.value !== "undefined" ? props2.value : current.value,
|
|
6957
|
+
visible: !isActive.value
|
|
6958
|
+
});
|
|
6959
|
+
};
|
|
6960
|
+
const alive = vue.computed(() => {
|
|
6961
|
+
return collapse.props.alive;
|
|
6962
|
+
});
|
|
6963
|
+
const styleless = vue.computed(() => {
|
|
6964
|
+
return collapse.props.styleless;
|
|
6965
|
+
});
|
|
6966
|
+
const setValue = (v) => current.value = v;
|
|
6967
|
+
vue.onBeforeMount(() => {
|
|
6968
|
+
collapse.add?.(instance, setValue);
|
|
6969
|
+
});
|
|
6970
|
+
vue.onBeforeUnmount(() => {
|
|
6971
|
+
collapse.remove?.(instance, setValue);
|
|
6972
|
+
});
|
|
6973
|
+
expose({
|
|
6974
|
+
isActive,
|
|
6975
|
+
toggle: (v) => isActive.value = v
|
|
6976
|
+
});
|
|
6977
|
+
return () => {
|
|
6978
|
+
return vue.createVNode(Content, {
|
|
6979
|
+
"class": [{
|
|
6980
|
+
"vc-collapse-item": !styleless.value
|
|
6981
|
+
}]
|
|
6982
|
+
}, {
|
|
6983
|
+
default: () => [vue.createVNode("div", {
|
|
6984
|
+
"class": [{
|
|
6985
|
+
"vc-collapse-item__title": !styleless.value
|
|
6986
|
+
}],
|
|
6987
|
+
"onClick": handleToggle
|
|
6988
|
+
}, [slots.default?.(), slots.icon?.({
|
|
6989
|
+
visible: isActive.value
|
|
6990
|
+
})]), vue.createVNode(Expand, {
|
|
6991
|
+
"modelValue": isActive.value,
|
|
6992
|
+
"alive": alive.value,
|
|
6993
|
+
"onChange": (v) => isActive.value = v
|
|
6994
|
+
}, {
|
|
6995
|
+
default: () => [vue.createVNode("div", {
|
|
6996
|
+
"class": [{
|
|
6997
|
+
"vc-collapse-item__content": !styleless.value
|
|
6998
|
+
}]
|
|
6999
|
+
}, [slots.content?.()])]
|
|
7000
|
+
})]
|
|
7001
|
+
});
|
|
6793
7002
|
};
|
|
6794
7003
|
}
|
|
6795
7004
|
});
|
|
6796
7005
|
const MCollapse = Collapse;
|
|
7006
|
+
const MCollapseItem = CollapseItem;
|
|
6797
7007
|
const props$10 = {
|
|
6798
7008
|
tag: {
|
|
6799
7009
|
type: String,
|
|
6800
7010
|
default: "div"
|
|
6801
7011
|
}
|
|
6802
7012
|
};
|
|
6803
|
-
const COMPONENT_NAME$
|
|
7013
|
+
const COMPONENT_NAME$1c = "vc-color-picker";
|
|
6804
7014
|
const ColorPicker = /* @__PURE__ */ vue.defineComponent({
|
|
6805
|
-
name: COMPONENT_NAME$
|
|
7015
|
+
name: COMPONENT_NAME$1c,
|
|
6806
7016
|
props: props$10,
|
|
6807
7017
|
setup(props2, {
|
|
6808
7018
|
slots
|
|
@@ -6821,9 +7031,9 @@
|
|
|
6821
7031
|
default: "div"
|
|
6822
7032
|
}
|
|
6823
7033
|
};
|
|
6824
|
-
const COMPONENT_NAME$
|
|
7034
|
+
const COMPONENT_NAME$1b = "vc-countdown";
|
|
6825
7035
|
const Countdown = /* @__PURE__ */ vue.defineComponent({
|
|
6826
|
-
name: COMPONENT_NAME$
|
|
7036
|
+
name: COMPONENT_NAME$1b,
|
|
6827
7037
|
props: props$$,
|
|
6828
7038
|
setup(props2, {
|
|
6829
7039
|
slots
|
|
@@ -6842,9 +7052,9 @@
|
|
|
6842
7052
|
default: () => null
|
|
6843
7053
|
}
|
|
6844
7054
|
};
|
|
6845
|
-
const COMPONENT_NAME$
|
|
7055
|
+
const COMPONENT_NAME$1a = "vc-customer";
|
|
6846
7056
|
const Customer = vue.defineComponent({
|
|
6847
|
-
name: COMPONENT_NAME$
|
|
7057
|
+
name: COMPONENT_NAME$1a,
|
|
6848
7058
|
props: props$_,
|
|
6849
7059
|
setup(props2, context) {
|
|
6850
7060
|
return () => vue.h(() => {
|
|
@@ -6859,9 +7069,9 @@
|
|
|
6859
7069
|
default: "div"
|
|
6860
7070
|
}
|
|
6861
7071
|
};
|
|
6862
|
-
const COMPONENT_NAME$
|
|
7072
|
+
const COMPONENT_NAME$19 = "vc-date-picker";
|
|
6863
7073
|
const DatePicker = /* @__PURE__ */ vue.defineComponent({
|
|
6864
|
-
name: COMPONENT_NAME$
|
|
7074
|
+
name: COMPONENT_NAME$19,
|
|
6865
7075
|
props: props$Z,
|
|
6866
7076
|
setup(props2, {
|
|
6867
7077
|
slots
|
|
@@ -6880,9 +7090,9 @@
|
|
|
6880
7090
|
default: "div"
|
|
6881
7091
|
}
|
|
6882
7092
|
};
|
|
6883
|
-
const COMPONENT_NAME$
|
|
7093
|
+
const COMPONENT_NAME$18 = "vc-divider";
|
|
6884
7094
|
const Divider = /* @__PURE__ */ vue.defineComponent({
|
|
6885
|
-
name: COMPONENT_NAME$
|
|
7095
|
+
name: COMPONENT_NAME$18,
|
|
6886
7096
|
props: props$Y,
|
|
6887
7097
|
setup(props2, {
|
|
6888
7098
|
slots
|
|
@@ -6895,178 +7105,714 @@
|
|
|
6895
7105
|
}
|
|
6896
7106
|
});
|
|
6897
7107
|
const MDivider = Divider;
|
|
6898
|
-
const
|
|
6899
|
-
tag:
|
|
6900
|
-
|
|
6901
|
-
|
|
6902
|
-
|
|
7108
|
+
const defaults$2 = {
|
|
7109
|
+
tag: "div",
|
|
7110
|
+
el: "body",
|
|
7111
|
+
alive: false,
|
|
7112
|
+
multiple: false,
|
|
7113
|
+
aliveRegExp: { className: /(vc-hack-alive|vc-hack-cp)/ },
|
|
7114
|
+
aliveVisibleKey: "isVisible",
|
|
7115
|
+
aliveUpdateKey: "update",
|
|
7116
|
+
leaveDelay: 300,
|
|
7117
|
+
autoDestroy: true,
|
|
7118
|
+
components: {},
|
|
7119
|
+
uses: {},
|
|
7120
|
+
fragment: false,
|
|
7121
|
+
insertion: "last"
|
|
6903
7122
|
};
|
|
6904
|
-
|
|
6905
|
-
|
|
6906
|
-
|
|
6907
|
-
|
|
6908
|
-
|
|
6909
|
-
|
|
6910
|
-
|
|
6911
|
-
|
|
6912
|
-
|
|
6913
|
-
|
|
6914
|
-
|
|
7123
|
+
class PortalLeaf {
|
|
7124
|
+
app;
|
|
7125
|
+
/**
|
|
7126
|
+
* 目标的实例,挂载到app上
|
|
7127
|
+
*/
|
|
7128
|
+
wrapper;
|
|
7129
|
+
propsData;
|
|
7130
|
+
/**
|
|
7131
|
+
* 销毁的函数,挂载到app上,避免冲突
|
|
7132
|
+
*/
|
|
7133
|
+
destroy;
|
|
7134
|
+
/**
|
|
7135
|
+
* 自动销毁的标记,挂载到app上,避免冲突
|
|
7136
|
+
*/
|
|
7137
|
+
autoDestroy;
|
|
7138
|
+
target;
|
|
7139
|
+
constructor(target) {
|
|
7140
|
+
this.target = target;
|
|
7141
|
+
this.autoDestroy = false;
|
|
7142
|
+
this.destroy = /* istanbul ignore next */
|
|
7143
|
+
() => {
|
|
7144
|
+
throw new VcError("portal", "未注册的destroy方法");
|
|
6915
7145
|
};
|
|
6916
7146
|
}
|
|
6917
|
-
|
|
6918
|
-
|
|
6919
|
-
const props$W = {
|
|
6920
|
-
tag: {
|
|
6921
|
-
type: String,
|
|
6922
|
-
default: "div"
|
|
7147
|
+
then(resolve, reject) {
|
|
7148
|
+
return this.target.then(resolve, reject);
|
|
6923
7149
|
}
|
|
6924
|
-
|
|
6925
|
-
|
|
6926
|
-
const Dropdown = /* @__PURE__ */ vue.defineComponent({
|
|
6927
|
-
name: COMPONENT_NAME$15,
|
|
6928
|
-
props: props$W,
|
|
6929
|
-
setup(props2, {
|
|
6930
|
-
slots
|
|
6931
|
-
}) {
|
|
6932
|
-
return () => {
|
|
6933
|
-
return vue.createVNode("div", {
|
|
6934
|
-
"class": "vc-dropdown"
|
|
6935
|
-
}, [slots?.default?.()]);
|
|
6936
|
-
};
|
|
7150
|
+
catch(callback) {
|
|
7151
|
+
return this.target.catch(callback);
|
|
6937
7152
|
}
|
|
6938
|
-
|
|
6939
|
-
|
|
6940
|
-
const props$V = {
|
|
6941
|
-
tag: {
|
|
6942
|
-
type: String,
|
|
6943
|
-
default: "div"
|
|
7153
|
+
finally(callback) {
|
|
7154
|
+
return this.target.finally(callback);
|
|
6944
7155
|
}
|
|
6945
|
-
}
|
|
6946
|
-
const COMPONENT_NAME$
|
|
6947
|
-
|
|
6948
|
-
|
|
6949
|
-
|
|
6950
|
-
|
|
6951
|
-
|
|
6952
|
-
|
|
6953
|
-
|
|
6954
|
-
|
|
6955
|
-
|
|
6956
|
-
|
|
6957
|
-
|
|
7156
|
+
}
|
|
7157
|
+
const COMPONENT_NAME$17 = "vc-portal";
|
|
7158
|
+
class Portal {
|
|
7159
|
+
/**
|
|
7160
|
+
* 清理Portals类型组件
|
|
7161
|
+
* @param name 清理的组件名, boolean表示全部leafs是否强制清理
|
|
7162
|
+
*/
|
|
7163
|
+
static clear(name) {
|
|
7164
|
+
try {
|
|
7165
|
+
let force = false;
|
|
7166
|
+
let target = /* @__PURE__ */ new Map();
|
|
7167
|
+
if (name && typeof name !== "boolean") {
|
|
7168
|
+
let names = [];
|
|
7169
|
+
if (typeof name === "string") {
|
|
7170
|
+
names = [name];
|
|
7171
|
+
} else if (name instanceof Array && name.length > 0) {
|
|
7172
|
+
names = name;
|
|
7173
|
+
}
|
|
7174
|
+
names.forEach((i) => target.set(i, ""));
|
|
7175
|
+
force = true;
|
|
7176
|
+
} else {
|
|
7177
|
+
force = !!name;
|
|
7178
|
+
target = Portal.leafs;
|
|
7179
|
+
}
|
|
7180
|
+
for (const key of target.keys()) {
|
|
7181
|
+
const leaf = Portal.leafs.get(key);
|
|
7182
|
+
if (leaf && (force === true || leaf.autoDestroy === true)) {
|
|
7183
|
+
leaf.destroy();
|
|
7184
|
+
}
|
|
7185
|
+
}
|
|
7186
|
+
} catch (e) {
|
|
7187
|
+
/* istanbul ignore next -- @preserve */
|
|
7188
|
+
throw new VcError("instance", e);
|
|
7189
|
+
}
|
|
6958
7190
|
}
|
|
6959
|
-
|
|
6960
|
-
|
|
6961
|
-
|
|
6962
|
-
|
|
6963
|
-
|
|
6964
|
-
|
|
7191
|
+
/**
|
|
7192
|
+
* 清理全部Portals
|
|
7193
|
+
*/
|
|
7194
|
+
static clearAll() {
|
|
7195
|
+
try {
|
|
7196
|
+
Portal.leafs.forEach((leaf) => leaf.destroy());
|
|
7197
|
+
} catch (e) {
|
|
7198
|
+
/* istanbul ignore next -- @preserve */
|
|
7199
|
+
throw new VcError("instance", e);
|
|
7200
|
+
}
|
|
6965
7201
|
}
|
|
6966
|
-
|
|
6967
|
-
|
|
6968
|
-
|
|
6969
|
-
|
|
6970
|
-
|
|
6971
|
-
|
|
6972
|
-
|
|
6973
|
-
|
|
6974
|
-
return () => {
|
|
6975
|
-
return vue.createVNode("div", {
|
|
6976
|
-
"class": "vc-expand"
|
|
6977
|
-
}, [slots?.default?.()]);
|
|
7202
|
+
static leafs = /* @__PURE__ */ new Map();
|
|
7203
|
+
wrapper;
|
|
7204
|
+
globalOptions;
|
|
7205
|
+
constructor(wrapper, options) {
|
|
7206
|
+
this.wrapper = wrapper;
|
|
7207
|
+
this.globalOptions = {
|
|
7208
|
+
...options,
|
|
7209
|
+
name: options?.name || wrapper.name || getUid(COMPONENT_NAME$17)
|
|
6978
7210
|
};
|
|
6979
7211
|
}
|
|
6980
|
-
|
|
6981
|
-
|
|
6982
|
-
|
|
6983
|
-
|
|
6984
|
-
|
|
6985
|
-
default: "form"
|
|
6986
|
-
},
|
|
6987
|
-
model: {
|
|
6988
|
-
type: Object
|
|
6989
|
-
},
|
|
6990
|
-
rules: {
|
|
6991
|
-
type: Object
|
|
6992
|
-
},
|
|
6993
|
-
labelWidth: {
|
|
6994
|
-
type: Number
|
|
6995
|
-
},
|
|
6996
|
-
showMessage: {
|
|
6997
|
-
type: Boolean,
|
|
6998
|
-
default: true
|
|
6999
|
-
},
|
|
7000
|
-
inline: {
|
|
7001
|
-
type: Boolean,
|
|
7002
|
-
default: false
|
|
7003
|
-
},
|
|
7004
|
-
labelPosition: {
|
|
7005
|
-
type: String,
|
|
7006
|
-
default: "right"
|
|
7007
|
-
},
|
|
7008
|
-
autocomplete: {
|
|
7009
|
-
type: String,
|
|
7010
|
-
default: "off"
|
|
7011
|
-
},
|
|
7012
|
-
styleless: {
|
|
7013
|
-
type: Boolean,
|
|
7014
|
-
default: false
|
|
7015
|
-
}
|
|
7016
|
-
};
|
|
7017
|
-
const useForm = (expose, options = {}) => {
|
|
7018
|
-
const instance = vue.getCurrentInstance();
|
|
7019
|
-
const props2 = instance.props;
|
|
7020
|
-
const fields = [];
|
|
7021
|
-
vue.provide("form", {
|
|
7022
|
-
props: props2,
|
|
7023
|
-
add: (field) => {
|
|
7024
|
-
field && fields.push(field);
|
|
7025
|
-
},
|
|
7026
|
-
remove: (field) => {
|
|
7027
|
-
field && fields.splice(fields.indexOf(field), 1);
|
|
7212
|
+
popup(propsData, options) {
|
|
7213
|
+
if (!options) {
|
|
7214
|
+
options = propsData || {};
|
|
7215
|
+
} else {
|
|
7216
|
+
options.propsData = propsData;
|
|
7028
7217
|
}
|
|
7029
|
-
|
|
7030
|
-
|
|
7031
|
-
|
|
7032
|
-
|
|
7033
|
-
|
|
7034
|
-
|
|
7035
|
-
|
|
7036
|
-
|
|
7037
|
-
|
|
7038
|
-
|
|
7039
|
-
|
|
7040
|
-
|
|
7041
|
-
|
|
7042
|
-
|
|
7043
|
-
|
|
7044
|
-
|
|
7045
|
-
|
|
7046
|
-
|
|
7047
|
-
|
|
7048
|
-
|
|
7049
|
-
|
|
7050
|
-
|
|
7218
|
+
const $options = { ...this.getDefaultOptions(), ...options };
|
|
7219
|
+
const { onFulfilled, onRejected, ...rest } = $options;
|
|
7220
|
+
let onFulfilled$ = (
|
|
7221
|
+
/* istanbul ignore next -- @preserve */
|
|
7222
|
+
() => {
|
|
7223
|
+
}
|
|
7224
|
+
);
|
|
7225
|
+
let onRejected$ = (
|
|
7226
|
+
/* istanbul ignore next -- @preserve */
|
|
7227
|
+
() => {
|
|
7228
|
+
}
|
|
7229
|
+
);
|
|
7230
|
+
const target = new Promise((resolve, reject) => {
|
|
7231
|
+
onFulfilled$ = (v) => {
|
|
7232
|
+
onFulfilled?.(v);
|
|
7233
|
+
resolve(v);
|
|
7234
|
+
};
|
|
7235
|
+
onRejected$ = (v) => {
|
|
7236
|
+
onRejected?.(v);
|
|
7237
|
+
reject(v);
|
|
7238
|
+
};
|
|
7239
|
+
});
|
|
7240
|
+
return this.render(rest, target, onFulfilled$, onRejected$);
|
|
7241
|
+
}
|
|
7242
|
+
/**
|
|
7243
|
+
* 销毁当前Portal下的节点
|
|
7244
|
+
* @param target [description]
|
|
7245
|
+
*/
|
|
7246
|
+
destroy = (target) => {
|
|
7247
|
+
const { multiple, name } = this.getDefaultOptions();
|
|
7248
|
+
target = target || name;
|
|
7249
|
+
const instance = typeof target === "object" ? target : Portal.leafs.get(target);
|
|
7250
|
+
if (instance) {
|
|
7251
|
+
instance.destroy();
|
|
7252
|
+
} else if (multiple) {
|
|
7253
|
+
Portal.leafs.forEach((item, key) => {
|
|
7254
|
+
if (key.includes(name)) {
|
|
7255
|
+
item.destroy();
|
|
7256
|
+
}
|
|
7051
7257
|
});
|
|
7052
|
-
} catch (e) {
|
|
7053
|
-
return errors;
|
|
7054
7258
|
}
|
|
7055
7259
|
};
|
|
7056
|
-
|
|
7057
|
-
|
|
7058
|
-
|
|
7059
|
-
|
|
7060
|
-
|
|
7061
|
-
}
|
|
7062
|
-
}
|
|
7063
|
-
|
|
7064
|
-
|
|
7065
|
-
|
|
7260
|
+
getDefaultOptions() {
|
|
7261
|
+
return {
|
|
7262
|
+
...defaults$2,
|
|
7263
|
+
...VcInstance.options.Portal,
|
|
7264
|
+
...this.globalOptions
|
|
7265
|
+
};
|
|
7266
|
+
}
|
|
7267
|
+
createCallback(getLeaf, delay, callback) {
|
|
7268
|
+
return (...args) => {
|
|
7269
|
+
const done = () => {
|
|
7270
|
+
const leaf = getLeaf();
|
|
7271
|
+
/* istanbul ignore next -- @preserve */
|
|
7272
|
+
if (!leaf) {
|
|
7273
|
+
throw new VcError("portal", "实例不存在或已卸载");
|
|
7274
|
+
}
|
|
7275
|
+
leaf.destroy();
|
|
7276
|
+
};
|
|
7277
|
+
delay ? setTimeout(done, delay) : done();
|
|
7278
|
+
callback?.(...args);
|
|
7279
|
+
};
|
|
7280
|
+
}
|
|
7281
|
+
render(options, target, onFulfilled, onRejected) {
|
|
7282
|
+
const {
|
|
7283
|
+
el: el2,
|
|
7284
|
+
tag,
|
|
7285
|
+
alive,
|
|
7286
|
+
aliveRegExp,
|
|
7287
|
+
aliveVisibleKey,
|
|
7288
|
+
aliveUpdateKey,
|
|
7289
|
+
name: name$,
|
|
7290
|
+
leaveDelay,
|
|
7291
|
+
autoDestroy,
|
|
7292
|
+
multiple,
|
|
7293
|
+
fragment,
|
|
7294
|
+
onDestroyed,
|
|
7295
|
+
onBeforeCreate,
|
|
7296
|
+
insertion,
|
|
7297
|
+
// 全局注册
|
|
7298
|
+
globalProperties,
|
|
7299
|
+
install,
|
|
7300
|
+
components,
|
|
7301
|
+
uses,
|
|
7302
|
+
slots,
|
|
7303
|
+
parent,
|
|
7304
|
+
propsData,
|
|
7305
|
+
...rest
|
|
7306
|
+
} = options;
|
|
7307
|
+
let useAllNodes = fragment;
|
|
7308
|
+
const name = multiple ? `${name$}__${getUid(COMPONENT_NAME$17)}` : name$;
|
|
7309
|
+
const container = document.createElement(tag);
|
|
7310
|
+
const root = typeof el2 === "object" ? el2 : document.querySelector(el2 || "body");
|
|
7311
|
+
!alive && Portal.leafs.get(name)?.destroy();
|
|
7312
|
+
const propsData$ = propsData || rest;
|
|
7313
|
+
let leaf = new PortalLeaf(target);
|
|
7314
|
+
const isDestroyed = () => {
|
|
7315
|
+
const leaf$ = Portal.leafs.get(name);
|
|
7316
|
+
return !leaf$ || leaf$ !== leaf;
|
|
7317
|
+
};
|
|
7318
|
+
const $onDestroyed = (...args) => {
|
|
7319
|
+
if (isDestroyed()) return;
|
|
7320
|
+
onDestroyed?.(...args);
|
|
7321
|
+
leaf.app?.unmount();
|
|
7322
|
+
/* istanbul ignore else -- @preserve */
|
|
7323
|
+
if (useAllNodes) {
|
|
7324
|
+
root?.contains(container) && root.removeChild(container);
|
|
7325
|
+
} else if (container && container._children) {
|
|
7326
|
+
container._children.forEach((i) => {
|
|
7327
|
+
root?.contains(i) && root.removeChild(i);
|
|
7328
|
+
});
|
|
7329
|
+
}
|
|
7330
|
+
Portal.leafs.delete(name);
|
|
7331
|
+
};
|
|
7332
|
+
const $onRejected = this.createCallback(() => leaf, leaveDelay, onRejected);
|
|
7333
|
+
const $onFulfilled = this.createCallback(() => leaf, leaveDelay, onFulfilled);
|
|
7334
|
+
if (alive && Portal.leafs.has(name)) {
|
|
7335
|
+
leaf = Portal.leafs.get(name);
|
|
7336
|
+
leaf.target = target;
|
|
7337
|
+
leaf.propsData.value = propsData$;
|
|
7338
|
+
leaf.wrapper?.[aliveUpdateKey]?.(options);
|
|
7339
|
+
} else {
|
|
7340
|
+
const wrapper = this.wrapper;
|
|
7341
|
+
const app = vue.createApp({
|
|
7342
|
+
name: COMPONENT_NAME$17,
|
|
7343
|
+
parent,
|
|
7344
|
+
setup() {
|
|
7345
|
+
if (alive) {
|
|
7346
|
+
const handleExtra = (e) => {
|
|
7347
|
+
try {
|
|
7348
|
+
const path = e.path || composedPath(e);
|
|
7349
|
+
/* istanbul ignore else -- @preserve */
|
|
7350
|
+
if (container && e.target && !container.contains(e.target) && !path?.some((item) => utils.eleInRegExp(item, aliveRegExp))) {
|
|
7351
|
+
/* istanbul ignore else -- @preserve */
|
|
7352
|
+
if (leaf.wrapper && leaf.wrapper?.[aliveVisibleKey]) {
|
|
7353
|
+
leaf.wrapper[aliveVisibleKey] = false;
|
|
7354
|
+
}
|
|
7355
|
+
leaveDelay ? setTimeout($onDestroyed, leaveDelay) : $onDestroyed();
|
|
7356
|
+
}
|
|
7357
|
+
} catch (error2) {
|
|
7358
|
+
/* istanbul ignore next -- @preserve */
|
|
7359
|
+
throw new VcError("portal", error2);
|
|
7360
|
+
}
|
|
7361
|
+
};
|
|
7362
|
+
vue.onMounted(() => {
|
|
7363
|
+
document.addEventListener("click", handleExtra, true);
|
|
7364
|
+
});
|
|
7365
|
+
vue.onBeforeUnmount(() => {
|
|
7366
|
+
document.removeEventListener("click", handleExtra, true);
|
|
7367
|
+
});
|
|
7368
|
+
}
|
|
7369
|
+
const propsData1 = vue.ref(propsData$);
|
|
7370
|
+
const propsData2 = vue.ref();
|
|
7371
|
+
leaf.propsData = propsData1;
|
|
7372
|
+
const allowMounted = vue.ref(typeof onBeforeCreate !== "function");
|
|
7373
|
+
if (!allowMounted.value) {
|
|
7374
|
+
const result = onBeforeCreate(propsData$);
|
|
7375
|
+
if (result && result.then) {
|
|
7376
|
+
result.then((response) => {
|
|
7377
|
+
if (isDestroyed()) return;
|
|
7378
|
+
allowMounted.value = true;
|
|
7379
|
+
propsData2.value = response;
|
|
7380
|
+
}).catch((error2) => {
|
|
7381
|
+
$onDestroyed(error2);
|
|
7382
|
+
});
|
|
7383
|
+
} else {
|
|
7384
|
+
allowMounted.value = true;
|
|
7385
|
+
propsData2.value = result;
|
|
7386
|
+
}
|
|
7387
|
+
}
|
|
7388
|
+
return () => allowMounted.value && vue.h(
|
|
7389
|
+
wrapper,
|
|
7390
|
+
{
|
|
7391
|
+
...propsData1.value,
|
|
7392
|
+
...propsData2.value,
|
|
7393
|
+
ref: (vm) => leaf.wrapper = vm,
|
|
7394
|
+
onPortalFulfilled: (...args) => $onFulfilled(...args),
|
|
7395
|
+
onPortalRejected: (...args) => $onRejected(...args),
|
|
7396
|
+
onPortalDestroyed: (...args) => $onDestroyed(...args)
|
|
7397
|
+
},
|
|
7398
|
+
slots || void 0
|
|
7399
|
+
);
|
|
7400
|
+
}
|
|
7401
|
+
});
|
|
7402
|
+
leaf.app = app;
|
|
7403
|
+
if (globalProperties) {
|
|
7404
|
+
app.config.globalProperties = globalProperties;
|
|
7405
|
+
}
|
|
7406
|
+
for (const key in components) {
|
|
7407
|
+
app.component(key, components[key]);
|
|
7408
|
+
}
|
|
7409
|
+
for (const key in uses) {
|
|
7410
|
+
app.use(uses[key]);
|
|
7411
|
+
}
|
|
7412
|
+
install?.(app);
|
|
7413
|
+
app.mount(container);
|
|
7414
|
+
}
|
|
7415
|
+
leaf.destroy = $onDestroyed;
|
|
7416
|
+
leaf.autoDestroy = !!autoDestroy;
|
|
7417
|
+
Portal.leafs.set(name, leaf);
|
|
7418
|
+
const append = (root$, child$) => {
|
|
7419
|
+
if (!root$ || !child$) return;
|
|
7420
|
+
if (insertion === "first") {
|
|
7421
|
+
const firstEl = root$.firstElementChild;
|
|
7422
|
+
if (firstEl) {
|
|
7423
|
+
root$.insertBefore(child$, firstEl);
|
|
7424
|
+
return;
|
|
7425
|
+
}
|
|
7426
|
+
}
|
|
7427
|
+
root$.appendChild(child$);
|
|
7428
|
+
};
|
|
7429
|
+
if (fragment || typeof container._children === "undefined" && !Array.from(container.children).length) {
|
|
7430
|
+
useAllNodes = true;
|
|
7431
|
+
container.parentElement === null && append(root, container);
|
|
7432
|
+
} else if (!container._children) {
|
|
7433
|
+
container._children = [];
|
|
7434
|
+
let childs = Array.from(container.children);
|
|
7435
|
+
if (insertion === "first") {
|
|
7436
|
+
childs = childs.reverse();
|
|
7437
|
+
}
|
|
7438
|
+
childs.forEach((i) => {
|
|
7439
|
+
append(root, i);
|
|
7440
|
+
container._children?.push?.(i);
|
|
7441
|
+
});
|
|
7442
|
+
}
|
|
7443
|
+
return leaf;
|
|
7444
|
+
}
|
|
7445
|
+
}
|
|
7446
|
+
const props$X = {
|
|
7447
|
+
tag: {
|
|
7448
|
+
type: String,
|
|
7449
|
+
default: "div"
|
|
7450
|
+
}
|
|
7451
|
+
};
|
|
7452
|
+
const COMPONENT_NAME$16 = "vc-portal-view";
|
|
7453
|
+
const PortalView = /* @__PURE__ */ vue.defineComponent({
|
|
7454
|
+
name: COMPONENT_NAME$16,
|
|
7455
|
+
props: props$X,
|
|
7456
|
+
setup(props2, {
|
|
7457
|
+
slots
|
|
7458
|
+
}) {
|
|
7459
|
+
return () => {
|
|
7460
|
+
return vue.h(vue.Fragment, [vue.h(props2.tag, {
|
|
7461
|
+
class: "vc-portal-view"
|
|
7462
|
+
}, slots?.default?.()), vue.h(vue.Teleport, {
|
|
7463
|
+
to: "body"
|
|
7464
|
+
}, slots?.content?.())]);
|
|
7465
|
+
};
|
|
7466
|
+
}
|
|
7467
|
+
});
|
|
7468
|
+
const props$W = {
|
|
7469
|
+
title: String,
|
|
7470
|
+
content: {
|
|
7471
|
+
type: [String, Function],
|
|
7472
|
+
default: ""
|
|
7473
|
+
},
|
|
7474
|
+
modelValue: {
|
|
7475
|
+
type: Boolean,
|
|
7476
|
+
default: false
|
|
7477
|
+
},
|
|
7478
|
+
width: {
|
|
7479
|
+
type: Number,
|
|
7480
|
+
default: 300
|
|
7481
|
+
},
|
|
7482
|
+
height: {
|
|
7483
|
+
type: Number,
|
|
7484
|
+
default: 300
|
|
7485
|
+
},
|
|
7486
|
+
mask: {
|
|
7487
|
+
type: Boolean,
|
|
7488
|
+
default: true
|
|
7489
|
+
},
|
|
7490
|
+
maskClosable: {
|
|
7491
|
+
type: Boolean,
|
|
7492
|
+
default: true
|
|
7493
|
+
},
|
|
7494
|
+
scrollable: {
|
|
7495
|
+
type: Boolean,
|
|
7496
|
+
default: false
|
|
7497
|
+
},
|
|
7498
|
+
placement: {
|
|
7499
|
+
type: String,
|
|
7500
|
+
default: "right"
|
|
7501
|
+
// top/right/left/bottom
|
|
7502
|
+
},
|
|
7503
|
+
maskStyle: [Object, String],
|
|
7504
|
+
wrapperClass: [Object, String],
|
|
7505
|
+
wrapperStyle: [Object, String],
|
|
7506
|
+
closeWithCancel: {
|
|
7507
|
+
type: Boolean,
|
|
7508
|
+
default: true
|
|
7509
|
+
// 如果关闭, cancel只能是取消的按钮
|
|
7510
|
+
},
|
|
7511
|
+
okText: {
|
|
7512
|
+
type: [String, Boolean],
|
|
7513
|
+
default: "确定"
|
|
7514
|
+
},
|
|
7515
|
+
cancelText: {
|
|
7516
|
+
type: [String, Boolean],
|
|
7517
|
+
default: "取消"
|
|
7518
|
+
},
|
|
7519
|
+
footer: {
|
|
7520
|
+
type: Boolean,
|
|
7521
|
+
default: true
|
|
7522
|
+
},
|
|
7523
|
+
/**
|
|
7524
|
+
* 兼容portal设计, 实现Promise方式
|
|
7525
|
+
*/
|
|
7526
|
+
onOk: {
|
|
7527
|
+
type: Function
|
|
7528
|
+
},
|
|
7529
|
+
onCancel: {
|
|
7530
|
+
type: Function
|
|
7531
|
+
}
|
|
7532
|
+
};
|
|
7533
|
+
function _isSlot$1(s) {
|
|
7534
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
|
|
7535
|
+
}
|
|
7536
|
+
const COMPONENT_NAME$15 = "vc-drawer";
|
|
7537
|
+
const DrawerView = /* @__PURE__ */ vue.defineComponent({
|
|
7538
|
+
name: COMPONENT_NAME$15,
|
|
7539
|
+
props: props$W,
|
|
7540
|
+
emits: ["close", "update:modelValue", "visible-change"],
|
|
7541
|
+
setup(props2, {
|
|
7542
|
+
emit,
|
|
7543
|
+
slots,
|
|
7544
|
+
expose
|
|
7545
|
+
}) {
|
|
7546
|
+
const instance = vue.getCurrentInstance();
|
|
7547
|
+
const isActive = vue.ref(false);
|
|
7548
|
+
const classes = vue.computed(() => {
|
|
7549
|
+
return {
|
|
7550
|
+
[`is-${props2.placement}`]: true
|
|
7551
|
+
};
|
|
7552
|
+
});
|
|
7553
|
+
const style = vue.computed(() => {
|
|
7554
|
+
return props2.placement === "top" || props2.placement === "bottom" ? {
|
|
7555
|
+
height: `${props2.height}px`
|
|
7556
|
+
} : {
|
|
7557
|
+
width: `${props2.width}px`
|
|
7558
|
+
};
|
|
7559
|
+
});
|
|
7560
|
+
vue.watch(() => props2.modelValue, (v) => {
|
|
7561
|
+
isActive.value = v;
|
|
7562
|
+
}, {
|
|
7563
|
+
immediate: true
|
|
7564
|
+
});
|
|
7565
|
+
const handleBefore = (e, hook) => {
|
|
7566
|
+
if (!isActive.value) return;
|
|
7567
|
+
const fn = hook && hook(e);
|
|
7568
|
+
if (fn && fn.then) {
|
|
7569
|
+
return fn.then((res) => {
|
|
7570
|
+
isActive.value = false;
|
|
7571
|
+
return res;
|
|
7572
|
+
});
|
|
7573
|
+
} else if (!fn || fn === true) {
|
|
7574
|
+
isActive.value = false;
|
|
7575
|
+
}
|
|
7576
|
+
};
|
|
7577
|
+
const handleClose = (e, closable) => {
|
|
7578
|
+
if (closable || props2.maskClosable && e.target.classList.contains("vc-drawer__wrapper")) {
|
|
7579
|
+
if (props2.closeWithCancel) {
|
|
7580
|
+
handleBefore(e, handleCancel);
|
|
7581
|
+
} else {
|
|
7582
|
+
isActive.value = false;
|
|
7583
|
+
}
|
|
7584
|
+
}
|
|
7585
|
+
};
|
|
7586
|
+
const handleRemove = () => {
|
|
7587
|
+
!instance.isUnmounted && (emit("close"), emit("update:modelValue", false), emit("visible-change", false));
|
|
7588
|
+
};
|
|
7589
|
+
const handleOk = (...rest) => {
|
|
7590
|
+
const ok = instance.vnode.props?.onOk || props2.onOk || (() => {
|
|
7591
|
+
});
|
|
7592
|
+
return ok(...rest);
|
|
7593
|
+
};
|
|
7594
|
+
const handleCancel = (...rest) => {
|
|
7595
|
+
const cancel = instance.vnode.props?.onCancel || props2.onCancel || (() => {
|
|
7596
|
+
});
|
|
7597
|
+
return cancel(...rest);
|
|
7598
|
+
};
|
|
7599
|
+
useScrollbar(isActive);
|
|
7600
|
+
expose({
|
|
7601
|
+
isActive,
|
|
7602
|
+
// for portal
|
|
7603
|
+
toggle(v) {
|
|
7604
|
+
v = typeof v === "boolean" ? v : !isActive.value;
|
|
7605
|
+
isActive.value = v;
|
|
7606
|
+
}
|
|
7607
|
+
});
|
|
7608
|
+
return () => {
|
|
7609
|
+
let _slot, _slot2;
|
|
7610
|
+
return vue.createVNode("div", {
|
|
7611
|
+
"class": [classes.value, "vc-drawer"]
|
|
7612
|
+
}, [vue.createVNode(TransitionFade, {
|
|
7613
|
+
"delay": 50
|
|
7614
|
+
}, _isSlot$1(_slot = vue.withDirectives(vue.createVNode("div", {
|
|
7615
|
+
"style": props2.maskStyle,
|
|
7616
|
+
"class": "vc-drawer__mask",
|
|
7617
|
+
"onClick": (e) => handleClose(e, props2.maskClosable)
|
|
7618
|
+
}, null), [[vue.vShow, props2.mask && isActive.value]])) ? _slot : {
|
|
7619
|
+
default: () => [_slot]
|
|
7620
|
+
}), vue.createVNode(TransitionSlide, {
|
|
7621
|
+
"mode": props2.placement,
|
|
7622
|
+
"onAfterLeave": handleRemove
|
|
7623
|
+
}, _isSlot$1(_slot2 = vue.withDirectives(vue.createVNode("div", {
|
|
7624
|
+
"class": [props2.wrapperClass, "vc-drawer__wrapper"],
|
|
7625
|
+
"style": [style.value, props2.wrapperStyle]
|
|
7626
|
+
}, [vue.createVNode("div", {
|
|
7627
|
+
"class": "vc-drawer__container"
|
|
7628
|
+
}, [vue.createVNode("div", {
|
|
7629
|
+
"class": "vc-drawer__header"
|
|
7630
|
+
}, [slots.header ? slots.header() : typeof props2.title === "string" ? vue.createVNode("div", {
|
|
7631
|
+
"class": "vc-drawer__title",
|
|
7632
|
+
"innerHTML": props2.title
|
|
7633
|
+
}, null) : typeof props2.title === "function" && vue.createVNode(Customer, {
|
|
7634
|
+
"render": props2.title
|
|
7635
|
+
}, null), vue.createVNode("a", {
|
|
7636
|
+
"class": "vc-drawer__close",
|
|
7637
|
+
"onClick": (e) => handleClose(e, true)
|
|
7638
|
+
}, [vue.createVNode(Icon, {
|
|
7639
|
+
"type": "close"
|
|
7640
|
+
}, null)])]), vue.createVNode("div", {
|
|
7641
|
+
"class": ["vc-drawer__content"]
|
|
7642
|
+
}, [typeof props2.content === "string" ? vue.createVNode("div", {
|
|
7643
|
+
"innerHTML": props2.content
|
|
7644
|
+
}, null) : typeof props2.content === "function" ? vue.createVNode(Customer, {
|
|
7645
|
+
"render": props2.content
|
|
7646
|
+
}, null) : null, slots.default?.()]), props2.footer && (props2.cancelText || props2.okText) && vue.createVNode("div", {
|
|
7647
|
+
"class": ["vc-drawer__footer"]
|
|
7648
|
+
}, [slots["footer-extra"]?.(), !slots.footer ? vue.createVNode(vue.Fragment, null, [props2.cancelText && vue.createVNode(Button, {
|
|
7649
|
+
"style": "margin-right: 8px;",
|
|
7650
|
+
"onClick": (e) => handleBefore(e, handleCancel)
|
|
7651
|
+
}, {
|
|
7652
|
+
default: () => [props2.cancelText]
|
|
7653
|
+
}), props2.okText && vue.createVNode(Button, {
|
|
7654
|
+
"type": "primary",
|
|
7655
|
+
"onClick": (e) => handleBefore(e, handleOk)
|
|
7656
|
+
}, {
|
|
7657
|
+
default: () => [props2.okText]
|
|
7658
|
+
})]) : slots.footer?.()])])]), [[vue.vShow, isActive.value]])) ? _slot2 : {
|
|
7659
|
+
default: () => [_slot2]
|
|
7660
|
+
})]);
|
|
7661
|
+
};
|
|
7662
|
+
}
|
|
7663
|
+
});
|
|
7664
|
+
const Drawer = new Portal(DrawerView, {
|
|
7665
|
+
leaveDelay: 0,
|
|
7666
|
+
multiple: true
|
|
7667
|
+
});
|
|
7668
|
+
const destroy$5 = () => Drawer.destroy();
|
|
7669
|
+
const open$1 = (options) => {
|
|
7670
|
+
const leaf = Drawer.popup({
|
|
7671
|
+
...options,
|
|
7672
|
+
onFulfilled: options.onClose,
|
|
7673
|
+
// 当组件内使用emit('close'),避免重复触发
|
|
7674
|
+
onClose: null
|
|
7675
|
+
});
|
|
7676
|
+
leaf.wrapper.toggle?.(true);
|
|
7677
|
+
return leaf;
|
|
7678
|
+
};
|
|
7679
|
+
const drawer = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7680
|
+
__proto__: null,
|
|
7681
|
+
destroy: destroy$5,
|
|
7682
|
+
open: open$1
|
|
7683
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
7684
|
+
const MDrawerView = DrawerView;
|
|
7685
|
+
const props$V = {
|
|
7686
|
+
tag: {
|
|
7687
|
+
type: String,
|
|
7688
|
+
default: "div"
|
|
7689
|
+
}
|
|
7690
|
+
};
|
|
7691
|
+
const COMPONENT_NAME$14 = "vc-dropdown";
|
|
7692
|
+
const Dropdown = /* @__PURE__ */ vue.defineComponent({
|
|
7693
|
+
name: COMPONENT_NAME$14,
|
|
7694
|
+
props: props$V,
|
|
7695
|
+
setup(props2, {
|
|
7696
|
+
slots
|
|
7697
|
+
}) {
|
|
7698
|
+
return () => {
|
|
7699
|
+
return vue.createVNode("div", {
|
|
7700
|
+
"class": "vc-dropdown"
|
|
7701
|
+
}, [slots?.default?.()]);
|
|
7702
|
+
};
|
|
7703
|
+
}
|
|
7704
|
+
});
|
|
7705
|
+
const MDropdown = Dropdown;
|
|
7706
|
+
const props$U = {
|
|
7707
|
+
tag: {
|
|
7708
|
+
type: String,
|
|
7709
|
+
default: "div"
|
|
7710
|
+
}
|
|
7711
|
+
};
|
|
7712
|
+
const COMPONENT_NAME$13 = "vc-editor";
|
|
7713
|
+
const Editor = /* @__PURE__ */ vue.defineComponent({
|
|
7714
|
+
name: COMPONENT_NAME$13,
|
|
7715
|
+
props: props$U,
|
|
7716
|
+
setup(props2, {
|
|
7717
|
+
slots
|
|
7718
|
+
}) {
|
|
7719
|
+
return () => {
|
|
7720
|
+
return vue.createVNode("div", {
|
|
7721
|
+
"class": "vc-editor"
|
|
7722
|
+
}, [slots?.default?.()]);
|
|
7723
|
+
};
|
|
7724
|
+
}
|
|
7725
|
+
});
|
|
7726
|
+
const MEditor = Editor;
|
|
7727
|
+
const MExpand = Expand;
|
|
7728
|
+
const props$T = {
|
|
7729
|
+
tag: {
|
|
7730
|
+
type: String,
|
|
7731
|
+
default: "form"
|
|
7732
|
+
},
|
|
7733
|
+
model: {
|
|
7734
|
+
type: Object
|
|
7735
|
+
},
|
|
7736
|
+
rules: {
|
|
7737
|
+
type: Object
|
|
7738
|
+
},
|
|
7739
|
+
labelWidth: {
|
|
7740
|
+
type: Number
|
|
7741
|
+
},
|
|
7742
|
+
showMessage: {
|
|
7743
|
+
type: Boolean,
|
|
7744
|
+
default: true
|
|
7745
|
+
},
|
|
7746
|
+
inline: {
|
|
7747
|
+
type: Boolean,
|
|
7748
|
+
default: false
|
|
7749
|
+
},
|
|
7750
|
+
labelPosition: {
|
|
7751
|
+
type: String,
|
|
7752
|
+
default: "right"
|
|
7753
|
+
},
|
|
7754
|
+
autocomplete: {
|
|
7755
|
+
type: String,
|
|
7756
|
+
default: "off"
|
|
7757
|
+
},
|
|
7758
|
+
styleless: {
|
|
7759
|
+
type: Boolean,
|
|
7760
|
+
default: false
|
|
7761
|
+
}
|
|
7762
|
+
};
|
|
7763
|
+
const useForm = (expose, options = {}) => {
|
|
7764
|
+
const instance = vue.getCurrentInstance();
|
|
7765
|
+
const props2 = instance.props;
|
|
7766
|
+
const fields = [];
|
|
7767
|
+
vue.provide("form", {
|
|
7768
|
+
props: props2,
|
|
7769
|
+
add: (field) => {
|
|
7770
|
+
field && fields.push(field);
|
|
7771
|
+
},
|
|
7772
|
+
remove: (field) => {
|
|
7773
|
+
field && fields.splice(fields.indexOf(field), 1);
|
|
7774
|
+
}
|
|
7775
|
+
});
|
|
7776
|
+
const filterFields = (fields$) => {
|
|
7777
|
+
return !fields$ ? fields : fields.filter((item) => fields$.includes(item.props.prop));
|
|
7778
|
+
};
|
|
7779
|
+
const getField = (prop) => {
|
|
7780
|
+
const field = fields.find((item) => item.props.prop === prop);
|
|
7781
|
+
if (!field) throw new VcError("form", "请选择有用的prop值");
|
|
7782
|
+
return field;
|
|
7783
|
+
};
|
|
7784
|
+
const showToast = (msg) => {
|
|
7785
|
+
props2.showMessage && options.throwToast?.(msg);
|
|
7786
|
+
};
|
|
7787
|
+
const sortErrors = async (errors) => {
|
|
7788
|
+
const positions = await Promise.all(fields.map((item) => item.exposed.getPosition()));
|
|
7789
|
+
try {
|
|
7790
|
+
return [...errors].toSorted((a, b) => {
|
|
7791
|
+
const aIndex = fields.findIndex((i) => i.props.prop === a.prop);
|
|
7792
|
+
const bIndex = fields.findIndex((i) => i.props.prop === b.prop);
|
|
7793
|
+
const aPosition = positions[aIndex];
|
|
7794
|
+
const bPosition = positions[bIndex];
|
|
7795
|
+
if (aPosition.top != bPosition.top) return aPosition.top - bPosition.top;
|
|
7796
|
+
return aPosition.left - bPosition.left;
|
|
7797
|
+
});
|
|
7798
|
+
} catch {
|
|
7799
|
+
return errors;
|
|
7800
|
+
}
|
|
7801
|
+
};
|
|
7802
|
+
const scrollIntoView = (prop) => {
|
|
7803
|
+
const field = getField(prop);
|
|
7804
|
+
field.vnode?.el?.scrollIntoView?.({
|
|
7805
|
+
behavior: "smooth",
|
|
7806
|
+
block: "center"
|
|
7807
|
+
});
|
|
7808
|
+
};
|
|
7809
|
+
const reset = (options$ = {}) => {
|
|
7810
|
+
const { fields: fields$, original = {} } = options$;
|
|
7811
|
+
filterFields(fields$).forEach((field) => {
|
|
7066
7812
|
let v;
|
|
7067
7813
|
try {
|
|
7068
7814
|
v = getPropByPath(original, field.props.prop).v;
|
|
7069
|
-
} catch
|
|
7815
|
+
} catch {
|
|
7070
7816
|
}
|
|
7071
7817
|
field.exposed.reset(v);
|
|
7072
7818
|
});
|
|
@@ -7137,6 +7883,11 @@
|
|
|
7137
7883
|
type: [Boolean, String],
|
|
7138
7884
|
default: false
|
|
7139
7885
|
},
|
|
7886
|
+
// 控制`*`是否展示
|
|
7887
|
+
asterisk: {
|
|
7888
|
+
type: Boolean,
|
|
7889
|
+
default: true
|
|
7890
|
+
},
|
|
7140
7891
|
error: {
|
|
7141
7892
|
type: String
|
|
7142
7893
|
},
|
|
@@ -7181,7 +7932,7 @@
|
|
|
7181
7932
|
if (!form?.props) {
|
|
7182
7933
|
throw new VcError("form-item", "form-item需要在form内使用");
|
|
7183
7934
|
}
|
|
7184
|
-
const formItem = vue.inject("form-item", {});
|
|
7935
|
+
const formItem = vue.inject("vc-form-item", {});
|
|
7185
7936
|
const validateState = vue.ref("");
|
|
7186
7937
|
const validateMessage = vue.ref("");
|
|
7187
7938
|
let validateDisabled = false;
|
|
@@ -7219,7 +7970,7 @@
|
|
|
7219
7970
|
});
|
|
7220
7971
|
const classes = vue.computed(() => {
|
|
7221
7972
|
return {
|
|
7222
|
-
"is-require": isRequired.value,
|
|
7973
|
+
"is-require": isRequired.value && props2.asterisk,
|
|
7223
7974
|
"is-error": validateState.value === "error",
|
|
7224
7975
|
"is-validating": validateState.value === "validating",
|
|
7225
7976
|
"is-inline": form.props.inline,
|
|
@@ -7266,666 +8017,318 @@
|
|
|
7266
8017
|
return getPropByPath(model, path).v;
|
|
7267
8018
|
});
|
|
7268
8019
|
const showError = vue.computed(() => {
|
|
7269
|
-
return validateState.value === "error" && props2.showMessage && form.props.showMessage;
|
|
7270
|
-
});
|
|
7271
|
-
vue.watch(
|
|
7272
|
-
() => props2.error,
|
|
7273
|
-
(v) => {
|
|
7274
|
-
validateMessage.value = v || "";
|
|
7275
|
-
validateState.value = v === "" ? "" : "error";
|
|
7276
|
-
}
|
|
7277
|
-
);
|
|
7278
|
-
const reset = (v) => {
|
|
7279
|
-
validateState.value = "";
|
|
7280
|
-
validateMessage.value = "";
|
|
7281
|
-
const model = form.props.model;
|
|
7282
|
-
if (!props2.prop) return;
|
|
7283
|
-
const { o, k } = getPropByPath(model, props2.prop);
|
|
7284
|
-
if (!k) return;
|
|
7285
|
-
validateDisabled = true;
|
|
7286
|
-
o[k] = v !== null && v !== void 0 ? v : Array.isArray(fieldValue.value) ? [].concat(initialValue) : initialValue;
|
|
7287
|
-
};
|
|
7288
|
-
const validate = async (trigger) => {
|
|
7289
|
-
if (!props2.prop) return;
|
|
7290
|
-
let rules = currentRules.value.filter((rule) => !rule.trigger || rule.trigger.includes(trigger));
|
|
7291
|
-
if (!rules.length) {
|
|
7292
|
-
if (!props2.required) {
|
|
7293
|
-
return;
|
|
7294
|
-
} else {
|
|
7295
|
-
rules = [{
|
|
7296
|
-
required: true,
|
|
7297
|
-
message: typeof props2.required === "string" ? props2.required : void 0
|
|
7298
|
-
}];
|
|
7299
|
-
}
|
|
7300
|
-
}
|
|
7301
|
-
validateState.value = "validating";
|
|
7302
|
-
const descriptor = {};
|
|
7303
|
-
descriptor[props2.prop] = rules;
|
|
7304
|
-
const validator = new Validator(descriptor);
|
|
7305
|
-
const model = {};
|
|
7306
|
-
model[props2.prop] = filterEmpty(fieldValue.value);
|
|
7307
|
-
try {
|
|
7308
|
-
await validator.validate(model, { first: false });
|
|
7309
|
-
validateState.value = "success";
|
|
7310
|
-
validateMessage.value = "";
|
|
7311
|
-
} catch (errors) {
|
|
7312
|
-
validateState.value = "error";
|
|
7313
|
-
validateMessage.value = errors[0].message;
|
|
7314
|
-
throw {
|
|
7315
|
-
prop: props2.prop,
|
|
7316
|
-
message: validateMessage.value
|
|
7317
|
-
};
|
|
7318
|
-
}
|
|
7319
|
-
validateDisabled = false;
|
|
7320
|
-
};
|
|
7321
|
-
const handleFieldBlur = () => {
|
|
7322
|
-
if (!props2.prop) {
|
|
7323
|
-
formItem.blur?.();
|
|
7324
|
-
return;
|
|
7325
|
-
}
|
|
7326
|
-
validate("blur");
|
|
7327
|
-
};
|
|
7328
|
-
const handleFieldChange = () => {
|
|
7329
|
-
if (!props2.prop) {
|
|
7330
|
-
formItem.change?.();
|
|
7331
|
-
return;
|
|
7332
|
-
}
|
|
7333
|
-
if (validateDisabled) {
|
|
7334
|
-
validateDisabled = false;
|
|
7335
|
-
return;
|
|
7336
|
-
}
|
|
7337
|
-
validate("change");
|
|
7338
|
-
};
|
|
7339
|
-
const getPosition = async () => {
|
|
7340
|
-
let el2 = instance.vnode.el;
|
|
7341
|
-
try {
|
|
7342
|
-
while (el2 && !el2.getBoundingClientRect) {
|
|
7343
|
-
el2 = el2.nextSibling;
|
|
7344
|
-
}
|
|
7345
|
-
;
|
|
7346
|
-
const rect = el2.getBoundingClientRect();
|
|
7347
|
-
return {
|
|
7348
|
-
top: rect.top,
|
|
7349
|
-
left: rect.left
|
|
7350
|
-
};
|
|
7351
|
-
} catch (e) {
|
|
7352
|
-
throw new VcError("form-item", "form-item位置计算错误");
|
|
7353
|
-
}
|
|
7354
|
-
};
|
|
7355
|
-
const fields = vue.reactive([]);
|
|
7356
|
-
vue.provide("form-item", {
|
|
7357
|
-
fields,
|
|
7358
|
-
blur: handleFieldBlur,
|
|
7359
|
-
change: handleFieldChange,
|
|
7360
|
-
message: validateMessage,
|
|
7361
|
-
add: (field) => {
|
|
7362
|
-
field && fields.push(field);
|
|
7363
|
-
},
|
|
7364
|
-
remove: (field) => {
|
|
7365
|
-
field && fields.splice(fields.indexOf(field), 1);
|
|
7366
|
-
}
|
|
7367
|
-
});
|
|
7368
|
-
vue.onMounted(() => {
|
|
7369
|
-
if (props2.prop) {
|
|
7370
|
-
form.add?.(instance);
|
|
7371
|
-
initialValue = cloneDeep(fieldValue.value);
|
|
7372
|
-
}
|
|
7373
|
-
formItem.add?.(instance);
|
|
7374
|
-
});
|
|
7375
|
-
vue.onBeforeUnmount(() => {
|
|
7376
|
-
form.remove?.(instance);
|
|
7377
|
-
formItem.remove?.(instance);
|
|
7378
|
-
});
|
|
7379
|
-
vue.watch(
|
|
7380
|
-
() => props2.rules,
|
|
7381
|
-
() => {
|
|
7382
|
-
props2.resetByRulesChanged && reset();
|
|
7383
|
-
}
|
|
7384
|
-
);
|
|
7385
|
-
vue.watch(
|
|
7386
|
-
() => formItem.fields?.length,
|
|
7387
|
-
async (v) => {
|
|
7388
|
-
if (!isNest.value || !v) return isNestLast.value = false;
|
|
7389
|
-
const fields$ = [...vue.toRaw(formItem.fields)];
|
|
7390
|
-
const positions = await Promise.all(fields$.map((item) => item.exposed.getPosition()));
|
|
7391
|
-
const sortFields = fields$.toSorted((a, b) => {
|
|
7392
|
-
const aIndex = fields$.findIndex((i) => i === a);
|
|
7393
|
-
const bIndex = fields$.findIndex((i) => i === b);
|
|
7394
|
-
const aPosition = positions[aIndex];
|
|
7395
|
-
const bPosition = positions[bIndex];
|
|
7396
|
-
if (aPosition.top != bPosition.top) return aPosition.top - bPosition.top;
|
|
7397
|
-
return aPosition.left - bPosition.left;
|
|
7398
|
-
});
|
|
7399
|
-
isNestLast.value = sortFields[sortFields.length - 1] === instance;
|
|
7400
|
-
}
|
|
7401
|
-
);
|
|
7402
|
-
expose({
|
|
7403
|
-
validate,
|
|
7404
|
-
reset,
|
|
7405
|
-
getPosition
|
|
7406
|
-
});
|
|
7407
|
-
return {
|
|
7408
|
-
isNest,
|
|
7409
|
-
isStyleless,
|
|
7410
|
-
isNestLast,
|
|
7411
|
-
validateMessage,
|
|
7412
|
-
classes,
|
|
7413
|
-
labelStyle,
|
|
7414
|
-
contentStyle,
|
|
7415
|
-
showError,
|
|
7416
|
-
labelPosition
|
|
7417
|
-
};
|
|
7418
|
-
};
|
|
7419
|
-
const COMPONENT_NAME$11 = "vc-form-item";
|
|
7420
|
-
const FormItem = /* @__PURE__ */ vue.defineComponent({
|
|
7421
|
-
name: COMPONENT_NAME$11,
|
|
7422
|
-
props: props$S,
|
|
7423
|
-
setup(props2, {
|
|
7424
|
-
slots,
|
|
7425
|
-
expose
|
|
7426
|
-
}) {
|
|
7427
|
-
const it = useFormItem(expose);
|
|
7428
|
-
const {
|
|
7429
|
-
isStyleless,
|
|
7430
|
-
isNest,
|
|
7431
|
-
classes,
|
|
7432
|
-
labelStyle,
|
|
7433
|
-
contentStyle,
|
|
7434
|
-
showError,
|
|
7435
|
-
validateMessage
|
|
7436
|
-
} = it;
|
|
7437
|
-
const {
|
|
7438
|
-
label,
|
|
7439
|
-
labelFor
|
|
7440
|
-
} = props2;
|
|
7441
|
-
const errorColorClass = "vc-form-item__error";
|
|
7442
|
-
return () => {
|
|
7443
|
-
if (isStyleless.value) return [slots.default?.(), slots.error?.({
|
|
7444
|
-
show: showError.value,
|
|
7445
|
-
nest: isNest.value,
|
|
7446
|
-
message: validateMessage.value,
|
|
7447
|
-
class: errorColorClass
|
|
7448
|
-
})];
|
|
7449
|
-
return vue.createVNode("div", {
|
|
7450
|
-
"class": ["vc-form-item", classes.value]
|
|
7451
|
-
}, [vue.createVNode("div", {
|
|
7452
|
-
"style": labelStyle.value,
|
|
7453
|
-
"class": "vc-form-item__label",
|
|
7454
|
-
"for": labelFor
|
|
7455
|
-
}, [vue.createVNode("label", null, [label || slots.label?.()])]), vue.createVNode("div", {
|
|
7456
|
-
"class": "vc-form-item__wrapper"
|
|
7457
|
-
}, [vue.createVNode("div", {
|
|
7458
|
-
"class": "vc-form-item__content",
|
|
7459
|
-
"style": contentStyle.value
|
|
7460
|
-
}, [slots.default?.(), slots.error ? slots.error({
|
|
7461
|
-
show: showError.value,
|
|
7462
|
-
nest: isNest.value,
|
|
7463
|
-
message: validateMessage.value,
|
|
7464
|
-
class: errorColorClass
|
|
7465
|
-
}) : vue.createVNode(TransitionFade, null, {
|
|
7466
|
-
default: () => [vue.withDirectives(vue.createVNode("div", {
|
|
7467
|
-
"class": ["vc-form-item__tip", isNest.value ? "is-nest" : "", errorColorClass]
|
|
7468
|
-
}, [validateMessage.value]), [[vue.vShow, showError.value]])]
|
|
7469
|
-
})])])]);
|
|
7470
|
-
};
|
|
7471
|
-
}
|
|
7472
|
-
});
|
|
7473
|
-
const props$R = {
|
|
7474
|
-
...props$T,
|
|
7475
|
-
showToast: {
|
|
7476
|
-
type: Boolean,
|
|
7477
|
-
default: false
|
|
7478
|
-
},
|
|
7479
|
-
border: {
|
|
7480
|
-
type: Boolean,
|
|
7481
|
-
default: false
|
|
7482
|
-
}
|
|
7483
|
-
};
|
|
7484
|
-
const props$Q = {
|
|
7485
|
-
content: [String, Function],
|
|
7486
|
-
maskClosable: {
|
|
7487
|
-
type: Boolean,
|
|
7488
|
-
default: true
|
|
7489
|
-
},
|
|
7490
|
-
duration: {
|
|
7491
|
-
type: Number,
|
|
7492
|
-
default: 3e3
|
|
7493
|
-
},
|
|
7494
|
-
mode: {
|
|
7495
|
-
type: String,
|
|
7496
|
-
default: "info",
|
|
7497
|
-
validator: (val) => ["info", "loading", "success", "warning", "error"].includes(val)
|
|
7498
|
-
}
|
|
7499
|
-
};
|
|
7500
|
-
const MSpin = Spin;
|
|
7501
|
-
const MTransition = Transition;
|
|
7502
|
-
const MTransitionCollapse = TransitionCollapse;
|
|
7503
|
-
const MTransitionFade = TransitionFade;
|
|
7504
|
-
const MTransitionScale = TransitionScale;
|
|
7505
|
-
const MTransitionSlide = TransitionSlide;
|
|
7506
|
-
const MTransitionZoom = TransitionZoom;
|
|
7507
|
-
const COMPONENT_NAME$10 = "vcm-toast";
|
|
7508
|
-
const MToastView = /* @__PURE__ */ vue.defineComponent({
|
|
7509
|
-
name: COMPONENT_NAME$10,
|
|
7510
|
-
emits: ["close", "portal-fulfilled"],
|
|
7511
|
-
props: props$Q,
|
|
7512
|
-
setup(props2, {
|
|
7513
|
-
emit,
|
|
7514
|
-
expose
|
|
7515
|
-
}) {
|
|
7516
|
-
const isVisible = vue.ref(false);
|
|
7517
|
-
const handleRemove = () => {
|
|
7518
|
-
emit("close");
|
|
7519
|
-
emit("portal-fulfilled");
|
|
7520
|
-
};
|
|
7521
|
-
const handleClose = () => {
|
|
7522
|
-
if (props2.maskClosable) {
|
|
7523
|
-
isVisible.value = false;
|
|
7524
|
-
}
|
|
7525
|
-
};
|
|
7526
|
-
let timer;
|
|
7527
|
-
vue.onMounted(() => {
|
|
7528
|
-
isVisible.value = true;
|
|
7529
|
-
if (props2.duration !== 0) {
|
|
7530
|
-
timer = setTimeout(() => {
|
|
7531
|
-
isVisible.value = false;
|
|
7532
|
-
}, props2.duration - 300);
|
|
7533
|
-
}
|
|
7534
|
-
});
|
|
7535
|
-
vue.onUnmounted(() => {
|
|
7536
|
-
timer && clearTimeout(timer);
|
|
7537
|
-
});
|
|
7538
|
-
const exposes = ["destroy", "remove", "close", "hide"].reduce((pre, key) => {
|
|
7539
|
-
pre[key] = handleRemove;
|
|
7540
|
-
return pre;
|
|
7541
|
-
}, {});
|
|
7542
|
-
expose(exposes);
|
|
7543
|
-
return () => {
|
|
7544
|
-
return vue.createVNode("div", {
|
|
7545
|
-
"class": "vcm-toast"
|
|
7546
|
-
}, [vue.createVNode("div", {
|
|
7547
|
-
"class": "vcm-toast__bg",
|
|
7548
|
-
"onClick": handleClose,
|
|
7549
|
-
"onTouchmove": vue.withModifiers(() => {
|
|
7550
|
-
}, ["prevent"])
|
|
7551
|
-
}, null), vue.createVNode(MTransitionFade, {
|
|
7552
|
-
"duration": {
|
|
7553
|
-
enter: 300,
|
|
7554
|
-
leave: 150
|
|
7555
|
-
},
|
|
7556
|
-
"onAfterLeave": handleRemove
|
|
7557
|
-
}, {
|
|
7558
|
-
default: () => [vue.withDirectives(vue.createVNode("div", {
|
|
7559
|
-
"class": "vcm-toast__wrapper"
|
|
7560
|
-
}, [props2.mode === "loading" && vue.createVNode(MSpin, {
|
|
7561
|
-
"class": "vcm-toast__loading"
|
|
7562
|
-
}, null), typeof props2.content === "string" ? vue.createVNode("div", {
|
|
7563
|
-
"class": "vcm-toast__content",
|
|
7564
|
-
"innerHTML": props2.content
|
|
7565
|
-
}, null) : typeof props2.content === "function" ? vue.createVNode(MCustomer, {
|
|
7566
|
-
"render": props2.content
|
|
7567
|
-
}, null) : null]), [[vue.vShow, isVisible.value]])]
|
|
7568
|
-
})]);
|
|
7569
|
-
};
|
|
7570
|
-
}
|
|
7571
|
-
});
|
|
7572
|
-
const defaults$2 = {
|
|
7573
|
-
tag: "div",
|
|
7574
|
-
el: "body",
|
|
7575
|
-
alive: false,
|
|
7576
|
-
multiple: false,
|
|
7577
|
-
aliveRegExp: { className: /(vc-hack-alive|vc-hack-cp)/ },
|
|
7578
|
-
aliveVisibleKey: "isVisible",
|
|
7579
|
-
aliveUpdateKey: "update",
|
|
7580
|
-
leaveDelay: 300,
|
|
7581
|
-
autoDestroy: true,
|
|
7582
|
-
components: {},
|
|
7583
|
-
uses: {},
|
|
7584
|
-
fragment: false,
|
|
7585
|
-
insertion: "last"
|
|
7586
|
-
};
|
|
7587
|
-
class PortalLeaf {
|
|
7588
|
-
app;
|
|
7589
|
-
/**
|
|
7590
|
-
* 目标的实例,挂载到app上
|
|
7591
|
-
*/
|
|
7592
|
-
wrapper;
|
|
7593
|
-
propsData;
|
|
7594
|
-
/**
|
|
7595
|
-
* 销毁的函数,挂载到app上,避免冲突
|
|
7596
|
-
*/
|
|
7597
|
-
destroy;
|
|
7598
|
-
/**
|
|
7599
|
-
* 自动销毁的标记,挂载到app上,避免冲突
|
|
7600
|
-
*/
|
|
7601
|
-
autoDestroy;
|
|
7602
|
-
target;
|
|
7603
|
-
constructor(target) {
|
|
7604
|
-
this.target = target;
|
|
7605
|
-
this.autoDestroy = false;
|
|
7606
|
-
this.destroy = /* istanbul ignore next */
|
|
7607
|
-
() => {
|
|
7608
|
-
throw new VcError("portal", "未注册的destroy方法");
|
|
7609
|
-
};
|
|
7610
|
-
}
|
|
7611
|
-
then(resolve, reject) {
|
|
7612
|
-
return this.target.then(resolve, reject);
|
|
7613
|
-
}
|
|
7614
|
-
catch(callback) {
|
|
7615
|
-
return this.target.catch(callback);
|
|
7616
|
-
}
|
|
7617
|
-
finally(callback) {
|
|
7618
|
-
return this.target.finally(callback);
|
|
7619
|
-
}
|
|
7620
|
-
}
|
|
7621
|
-
const COMPONENT_NAME$$ = "vc-portal";
|
|
7622
|
-
class Portal {
|
|
7623
|
-
/**
|
|
7624
|
-
* 清理Portals类型组件
|
|
7625
|
-
* @param name 清理的组件名, boolean表示全部leafs是否强制清理
|
|
7626
|
-
*/
|
|
7627
|
-
static clear(name) {
|
|
7628
|
-
try {
|
|
7629
|
-
let force = false;
|
|
7630
|
-
let target = /* @__PURE__ */ new Map();
|
|
7631
|
-
if (name && typeof name !== "boolean") {
|
|
7632
|
-
let names = [];
|
|
7633
|
-
if (typeof name === "string") {
|
|
7634
|
-
names = [name];
|
|
7635
|
-
} else if (name instanceof Array && name.length > 0) {
|
|
7636
|
-
names = name;
|
|
7637
|
-
}
|
|
7638
|
-
names.forEach((i) => target.set(i, ""));
|
|
7639
|
-
force = true;
|
|
7640
|
-
} else {
|
|
7641
|
-
force = !!name;
|
|
7642
|
-
target = Portal.leafs;
|
|
7643
|
-
}
|
|
7644
|
-
for (const key of target.keys()) {
|
|
7645
|
-
const leaf = Portal.leafs.get(key);
|
|
7646
|
-
if (leaf && (force === true || leaf.autoDestroy === true)) {
|
|
7647
|
-
leaf.destroy();
|
|
7648
|
-
}
|
|
7649
|
-
}
|
|
7650
|
-
} catch (e) {
|
|
7651
|
-
/* istanbul ignore next -- @preserve */
|
|
7652
|
-
throw new VcError("instance", e);
|
|
7653
|
-
}
|
|
7654
|
-
}
|
|
7655
|
-
/**
|
|
7656
|
-
* 清理全部Portals
|
|
7657
|
-
*/
|
|
7658
|
-
static clearAll() {
|
|
7659
|
-
try {
|
|
7660
|
-
Portal.leafs.forEach((leaf) => leaf.destroy());
|
|
7661
|
-
} catch (e) {
|
|
7662
|
-
/* istanbul ignore next -- @preserve */
|
|
7663
|
-
throw new VcError("instance", e);
|
|
7664
|
-
}
|
|
7665
|
-
}
|
|
7666
|
-
static leafs = /* @__PURE__ */ new Map();
|
|
7667
|
-
wrapper;
|
|
7668
|
-
globalOptions;
|
|
7669
|
-
constructor(wrapper, options) {
|
|
7670
|
-
this.wrapper = wrapper;
|
|
7671
|
-
this.globalOptions = {
|
|
7672
|
-
...options,
|
|
7673
|
-
name: options?.name || wrapper.name || getUid(COMPONENT_NAME$$)
|
|
7674
|
-
};
|
|
7675
|
-
}
|
|
7676
|
-
popup(propsData, options) {
|
|
7677
|
-
if (!options) {
|
|
7678
|
-
options = propsData || {};
|
|
7679
|
-
} else {
|
|
7680
|
-
options.propsData = propsData;
|
|
7681
|
-
}
|
|
7682
|
-
const $options = { ...this.getDefaultOptions(), ...options };
|
|
7683
|
-
const { onFulfilled, onRejected, ...rest } = $options;
|
|
7684
|
-
let onFulfilled$ = (
|
|
7685
|
-
/* istanbul ignore next -- @preserve */
|
|
7686
|
-
() => {
|
|
7687
|
-
}
|
|
7688
|
-
);
|
|
7689
|
-
let onRejected$ = (
|
|
7690
|
-
/* istanbul ignore next -- @preserve */
|
|
7691
|
-
() => {
|
|
7692
|
-
}
|
|
7693
|
-
);
|
|
7694
|
-
const target = new Promise((resolve, reject) => {
|
|
7695
|
-
onFulfilled$ = (v) => {
|
|
7696
|
-
onFulfilled?.(v);
|
|
7697
|
-
resolve(v);
|
|
7698
|
-
};
|
|
7699
|
-
onRejected$ = (v) => {
|
|
7700
|
-
onRejected?.(v);
|
|
7701
|
-
reject(v);
|
|
7702
|
-
};
|
|
7703
|
-
});
|
|
7704
|
-
return this.render(rest, target, onFulfilled$, onRejected$);
|
|
7705
|
-
}
|
|
7706
|
-
/**
|
|
7707
|
-
* 销毁当前Portal下的节点
|
|
7708
|
-
* @param target [description]
|
|
7709
|
-
*/
|
|
7710
|
-
destroy = (target) => {
|
|
7711
|
-
const { multiple, name } = this.getDefaultOptions();
|
|
7712
|
-
target = target || name;
|
|
7713
|
-
const instance = typeof target === "object" ? target : Portal.leafs.get(target);
|
|
7714
|
-
if (instance) {
|
|
7715
|
-
instance.destroy();
|
|
7716
|
-
} else if (multiple) {
|
|
7717
|
-
Portal.leafs.forEach((item, key) => {
|
|
7718
|
-
if (key.includes(name)) {
|
|
7719
|
-
item.destroy();
|
|
7720
|
-
}
|
|
7721
|
-
});
|
|
7722
|
-
}
|
|
7723
|
-
};
|
|
7724
|
-
getDefaultOptions() {
|
|
7725
|
-
return {
|
|
7726
|
-
...defaults$2,
|
|
7727
|
-
...VcInstance.options.Portal,
|
|
7728
|
-
...this.globalOptions
|
|
7729
|
-
};
|
|
7730
|
-
}
|
|
7731
|
-
createCallback(getLeaf, delay, callback) {
|
|
7732
|
-
return (...args) => {
|
|
7733
|
-
const done = () => {
|
|
7734
|
-
const leaf = getLeaf();
|
|
7735
|
-
/* istanbul ignore next -- @preserve */
|
|
7736
|
-
if (!leaf) {
|
|
7737
|
-
throw new VcError("portal", "实例不存在或已卸载");
|
|
7738
|
-
}
|
|
7739
|
-
leaf.destroy();
|
|
7740
|
-
};
|
|
7741
|
-
delay ? setTimeout(done, delay) : done();
|
|
7742
|
-
callback?.(...args);
|
|
7743
|
-
};
|
|
7744
|
-
}
|
|
7745
|
-
render(options, target, onFulfilled, onRejected) {
|
|
7746
|
-
const {
|
|
7747
|
-
el: el2,
|
|
7748
|
-
tag,
|
|
7749
|
-
alive,
|
|
7750
|
-
aliveRegExp,
|
|
7751
|
-
aliveVisibleKey,
|
|
7752
|
-
aliveUpdateKey,
|
|
7753
|
-
name: name$,
|
|
7754
|
-
leaveDelay,
|
|
7755
|
-
autoDestroy,
|
|
7756
|
-
multiple,
|
|
7757
|
-
fragment,
|
|
7758
|
-
onDestroyed,
|
|
7759
|
-
onBeforeCreate,
|
|
7760
|
-
insertion,
|
|
7761
|
-
// 全局注册
|
|
7762
|
-
globalProperties,
|
|
7763
|
-
install,
|
|
7764
|
-
components,
|
|
7765
|
-
uses,
|
|
7766
|
-
slots,
|
|
7767
|
-
parent,
|
|
7768
|
-
propsData,
|
|
7769
|
-
...rest
|
|
7770
|
-
} = options;
|
|
7771
|
-
let useAllNodes = fragment;
|
|
7772
|
-
const name = multiple ? `${name$}__${getUid(COMPONENT_NAME$$)}` : name$;
|
|
7773
|
-
const container = document.createElement(tag);
|
|
7774
|
-
const root = typeof el2 === "object" ? el2 : document.querySelector(el2 || "body");
|
|
7775
|
-
!alive && Portal.leafs.get(name)?.destroy();
|
|
7776
|
-
const propsData$ = propsData || rest;
|
|
7777
|
-
let leaf = new PortalLeaf(target);
|
|
7778
|
-
const isDestroyed = () => {
|
|
7779
|
-
const leaf$ = Portal.leafs.get(name);
|
|
7780
|
-
return !leaf$ || leaf$ !== leaf;
|
|
7781
|
-
};
|
|
7782
|
-
const $onDestroyed = (...args) => {
|
|
7783
|
-
if (isDestroyed()) return;
|
|
7784
|
-
onDestroyed?.(...args);
|
|
7785
|
-
leaf.app?.unmount();
|
|
7786
|
-
/* istanbul ignore else -- @preserve */
|
|
7787
|
-
if (useAllNodes) {
|
|
7788
|
-
root?.contains(container) && root.removeChild(container);
|
|
7789
|
-
} else if (container && container._children) {
|
|
7790
|
-
container._children.forEach((i) => {
|
|
7791
|
-
root?.contains(i) && root.removeChild(i);
|
|
7792
|
-
});
|
|
7793
|
-
}
|
|
7794
|
-
Portal.leafs.delete(name);
|
|
7795
|
-
};
|
|
7796
|
-
const $onRejected = this.createCallback(() => leaf, leaveDelay, onRejected);
|
|
7797
|
-
const $onFulfilled = this.createCallback(() => leaf, leaveDelay, onFulfilled);
|
|
7798
|
-
if (alive && Portal.leafs.has(name)) {
|
|
7799
|
-
leaf = Portal.leafs.get(name);
|
|
7800
|
-
leaf.target = target;
|
|
7801
|
-
leaf.propsData.value = propsData$;
|
|
7802
|
-
leaf.wrapper?.[aliveUpdateKey]?.(options);
|
|
7803
|
-
} else {
|
|
7804
|
-
const wrapper = this.wrapper;
|
|
7805
|
-
const app = vue.createApp({
|
|
7806
|
-
name: COMPONENT_NAME$$,
|
|
7807
|
-
parent,
|
|
7808
|
-
setup() {
|
|
7809
|
-
if (alive) {
|
|
7810
|
-
const handleExtra = (e) => {
|
|
7811
|
-
try {
|
|
7812
|
-
const path = e.path || composedPath(e);
|
|
7813
|
-
/* istanbul ignore else -- @preserve */
|
|
7814
|
-
if (container && e.target && !container.contains(e.target) && !path?.some((item) => utils.eleInRegExp(item, aliveRegExp))) {
|
|
7815
|
-
/* istanbul ignore else -- @preserve */
|
|
7816
|
-
if (leaf.wrapper && leaf.wrapper?.[aliveVisibleKey]) {
|
|
7817
|
-
leaf.wrapper[aliveVisibleKey] = false;
|
|
7818
|
-
}
|
|
7819
|
-
leaveDelay ? setTimeout($onDestroyed, leaveDelay) : $onDestroyed();
|
|
7820
|
-
}
|
|
7821
|
-
} catch (error2) {
|
|
7822
|
-
/* istanbul ignore next -- @preserve */
|
|
7823
|
-
throw new VcError("portal", error2);
|
|
7824
|
-
}
|
|
7825
|
-
};
|
|
7826
|
-
vue.onMounted(() => {
|
|
7827
|
-
document.addEventListener("click", handleExtra, true);
|
|
7828
|
-
});
|
|
7829
|
-
vue.onBeforeUnmount(() => {
|
|
7830
|
-
document.removeEventListener("click", handleExtra, true);
|
|
7831
|
-
});
|
|
7832
|
-
}
|
|
7833
|
-
const propsData1 = vue.ref(propsData$);
|
|
7834
|
-
const propsData2 = vue.ref();
|
|
7835
|
-
leaf.propsData = propsData1;
|
|
7836
|
-
const allowMounted = vue.ref(typeof onBeforeCreate !== "function");
|
|
7837
|
-
if (!allowMounted.value) {
|
|
7838
|
-
const result = onBeforeCreate(propsData$);
|
|
7839
|
-
if (result && result.then) {
|
|
7840
|
-
result.then((response) => {
|
|
7841
|
-
if (isDestroyed()) return;
|
|
7842
|
-
allowMounted.value = true;
|
|
7843
|
-
propsData2.value = response;
|
|
7844
|
-
}).catch((error2) => {
|
|
7845
|
-
$onDestroyed(error2);
|
|
7846
|
-
});
|
|
7847
|
-
} else {
|
|
7848
|
-
allowMounted.value = true;
|
|
7849
|
-
propsData2.value = result;
|
|
7850
|
-
}
|
|
7851
|
-
}
|
|
7852
|
-
return () => allowMounted.value && vue.h(
|
|
7853
|
-
wrapper,
|
|
7854
|
-
{
|
|
7855
|
-
...propsData1.value,
|
|
7856
|
-
...propsData2.value,
|
|
7857
|
-
ref: (vm) => leaf.wrapper = vm,
|
|
7858
|
-
onPortalFulfilled: (...args) => $onFulfilled(...args),
|
|
7859
|
-
onPortalRejected: (...args) => $onRejected(...args),
|
|
7860
|
-
onPortalDestroyed: (...args) => $onDestroyed(...args)
|
|
7861
|
-
},
|
|
7862
|
-
slots || void 0
|
|
7863
|
-
);
|
|
7864
|
-
}
|
|
7865
|
-
});
|
|
7866
|
-
leaf.app = app;
|
|
7867
|
-
if (globalProperties) {
|
|
7868
|
-
app.config.globalProperties = globalProperties;
|
|
7869
|
-
}
|
|
7870
|
-
for (const key in components) {
|
|
7871
|
-
app.component(key, components[key]);
|
|
7872
|
-
}
|
|
7873
|
-
for (const key in uses) {
|
|
7874
|
-
app.use(uses[key]);
|
|
7875
|
-
}
|
|
7876
|
-
install?.(app);
|
|
7877
|
-
app.mount(container);
|
|
8020
|
+
return validateState.value === "error" && props2.showMessage && form.props.showMessage;
|
|
8021
|
+
});
|
|
8022
|
+
vue.watch(
|
|
8023
|
+
() => props2.error,
|
|
8024
|
+
(v) => {
|
|
8025
|
+
validateMessage.value = v || "";
|
|
8026
|
+
validateState.value = v === "" ? "" : "error";
|
|
7878
8027
|
}
|
|
7879
|
-
|
|
7880
|
-
|
|
7881
|
-
|
|
7882
|
-
|
|
7883
|
-
|
|
7884
|
-
|
|
7885
|
-
|
|
7886
|
-
|
|
7887
|
-
|
|
7888
|
-
|
|
7889
|
-
|
|
8028
|
+
);
|
|
8029
|
+
const reset = (v) => {
|
|
8030
|
+
validateState.value = "";
|
|
8031
|
+
validateMessage.value = "";
|
|
8032
|
+
const model = form.props.model;
|
|
8033
|
+
if (!props2.prop) return;
|
|
8034
|
+
const { o, k } = getPropByPath(model, props2.prop);
|
|
8035
|
+
if (!k) return;
|
|
8036
|
+
validateDisabled = true;
|
|
8037
|
+
o[k] = v !== null && v !== void 0 ? v : Array.isArray(fieldValue.value) ? [].concat(initialValue) : initialValue;
|
|
8038
|
+
};
|
|
8039
|
+
const validate = async (trigger) => {
|
|
8040
|
+
if (!props2.prop) return;
|
|
8041
|
+
let rules = currentRules.value.filter((rule) => !rule.trigger || rule.trigger.includes(trigger));
|
|
8042
|
+
if (!rules.length) {
|
|
8043
|
+
if (!props2.required) {
|
|
8044
|
+
return;
|
|
8045
|
+
} else {
|
|
8046
|
+
rules = [{
|
|
8047
|
+
required: true,
|
|
8048
|
+
message: typeof props2.required === "string" ? props2.required : void 0
|
|
8049
|
+
}];
|
|
7890
8050
|
}
|
|
7891
|
-
|
|
7892
|
-
|
|
7893
|
-
|
|
7894
|
-
|
|
7895
|
-
|
|
7896
|
-
|
|
7897
|
-
|
|
7898
|
-
|
|
7899
|
-
|
|
7900
|
-
|
|
8051
|
+
}
|
|
8052
|
+
validateState.value = "validating";
|
|
8053
|
+
const descriptor = {};
|
|
8054
|
+
descriptor[props2.prop] = rules;
|
|
8055
|
+
const validator = new Validator(descriptor);
|
|
8056
|
+
const model = {};
|
|
8057
|
+
model[props2.prop] = filterEmpty(fieldValue.value);
|
|
8058
|
+
try {
|
|
8059
|
+
await validator.validate(model, { first: false });
|
|
8060
|
+
validateState.value = "success";
|
|
8061
|
+
validateMessage.value = "";
|
|
8062
|
+
} catch (errors) {
|
|
8063
|
+
validateState.value = "error";
|
|
8064
|
+
validateMessage.value = errors[0].message;
|
|
8065
|
+
throw {
|
|
8066
|
+
prop: props2.prop,
|
|
8067
|
+
message: validateMessage.value
|
|
8068
|
+
};
|
|
8069
|
+
}
|
|
8070
|
+
validateDisabled = false;
|
|
8071
|
+
};
|
|
8072
|
+
const handleFieldBlur = () => {
|
|
8073
|
+
if (!props2.prop) {
|
|
8074
|
+
formItem.blur?.();
|
|
8075
|
+
return;
|
|
8076
|
+
}
|
|
8077
|
+
validate("blur");
|
|
8078
|
+
};
|
|
8079
|
+
const handleFieldChange = () => {
|
|
8080
|
+
if (!props2.prop) {
|
|
8081
|
+
formItem.change?.();
|
|
8082
|
+
return;
|
|
8083
|
+
}
|
|
8084
|
+
if (validateDisabled) {
|
|
8085
|
+
validateDisabled = false;
|
|
8086
|
+
return;
|
|
8087
|
+
}
|
|
8088
|
+
validate("change");
|
|
8089
|
+
};
|
|
8090
|
+
const getPosition = async () => {
|
|
8091
|
+
let el2 = instance.vnode.el;
|
|
8092
|
+
try {
|
|
8093
|
+
while (el2 && !el2.getBoundingClientRect) {
|
|
8094
|
+
el2 = el2.nextSibling;
|
|
7901
8095
|
}
|
|
7902
|
-
|
|
7903
|
-
|
|
7904
|
-
|
|
8096
|
+
;
|
|
8097
|
+
const rect = el2.getBoundingClientRect();
|
|
8098
|
+
return {
|
|
8099
|
+
top: rect.top,
|
|
8100
|
+
left: rect.left
|
|
8101
|
+
};
|
|
8102
|
+
} catch {
|
|
8103
|
+
throw new VcError("form-item", "form-item位置计算错误");
|
|
8104
|
+
}
|
|
8105
|
+
};
|
|
8106
|
+
const fields = vue.reactive([]);
|
|
8107
|
+
vue.provide("vc-form-item", {
|
|
8108
|
+
fields,
|
|
8109
|
+
blur: handleFieldBlur,
|
|
8110
|
+
change: handleFieldChange,
|
|
8111
|
+
message: validateMessage,
|
|
8112
|
+
add: (field) => {
|
|
8113
|
+
field && fields.push(field);
|
|
8114
|
+
},
|
|
8115
|
+
remove: (field) => {
|
|
8116
|
+
field && fields.splice(fields.indexOf(field), 1);
|
|
8117
|
+
}
|
|
8118
|
+
});
|
|
8119
|
+
vue.onMounted(() => {
|
|
8120
|
+
if (props2.prop) {
|
|
8121
|
+
form.add?.(instance);
|
|
8122
|
+
initialValue = cloneDeep(fieldValue.value);
|
|
8123
|
+
}
|
|
8124
|
+
formItem.add?.(instance);
|
|
8125
|
+
});
|
|
8126
|
+
vue.onBeforeUnmount(() => {
|
|
8127
|
+
form.remove?.(instance);
|
|
8128
|
+
formItem.remove?.(instance);
|
|
8129
|
+
});
|
|
8130
|
+
vue.watch(
|
|
8131
|
+
() => props2.rules,
|
|
8132
|
+
() => {
|
|
8133
|
+
props2.resetByRulesChanged && reset();
|
|
8134
|
+
}
|
|
8135
|
+
);
|
|
8136
|
+
vue.watch(
|
|
8137
|
+
() => formItem.fields?.length,
|
|
8138
|
+
async (v) => {
|
|
8139
|
+
if (!isNest.value || !v) return isNestLast.value = false;
|
|
8140
|
+
const fields$ = [...vue.toRaw(formItem.fields)];
|
|
8141
|
+
const positions = await Promise.all(fields$.map((item) => item.exposed.getPosition()));
|
|
8142
|
+
const sortFields = fields$.toSorted((a, b) => {
|
|
8143
|
+
const aIndex = fields$.findIndex((i) => i === a);
|
|
8144
|
+
const bIndex = fields$.findIndex((i) => i === b);
|
|
8145
|
+
const aPosition = positions[aIndex];
|
|
8146
|
+
const bPosition = positions[bIndex];
|
|
8147
|
+
if (aPosition.top != bPosition.top) return aPosition.top - bPosition.top;
|
|
8148
|
+
return aPosition.left - bPosition.left;
|
|
7905
8149
|
});
|
|
8150
|
+
isNestLast.value = sortFields[sortFields.length - 1] === instance;
|
|
7906
8151
|
}
|
|
7907
|
-
|
|
8152
|
+
);
|
|
8153
|
+
expose({
|
|
8154
|
+
validate,
|
|
8155
|
+
reset,
|
|
8156
|
+
getPosition
|
|
8157
|
+
});
|
|
8158
|
+
return {
|
|
8159
|
+
isNest,
|
|
8160
|
+
isStyleless,
|
|
8161
|
+
isNestLast,
|
|
8162
|
+
validateMessage,
|
|
8163
|
+
classes,
|
|
8164
|
+
labelStyle,
|
|
8165
|
+
contentStyle,
|
|
8166
|
+
showError,
|
|
8167
|
+
labelPosition
|
|
8168
|
+
};
|
|
8169
|
+
};
|
|
8170
|
+
const COMPONENT_NAME$11 = "vc-form-item";
|
|
8171
|
+
const FormItem = /* @__PURE__ */ vue.defineComponent({
|
|
8172
|
+
name: COMPONENT_NAME$11,
|
|
8173
|
+
props: props$S,
|
|
8174
|
+
setup(props2, {
|
|
8175
|
+
slots,
|
|
8176
|
+
expose
|
|
8177
|
+
}) {
|
|
8178
|
+
const it = useFormItem(expose);
|
|
8179
|
+
const {
|
|
8180
|
+
isStyleless,
|
|
8181
|
+
isNest,
|
|
8182
|
+
classes,
|
|
8183
|
+
labelStyle,
|
|
8184
|
+
contentStyle,
|
|
8185
|
+
showError,
|
|
8186
|
+
validateMessage
|
|
8187
|
+
} = it;
|
|
8188
|
+
const {
|
|
8189
|
+
label,
|
|
8190
|
+
labelFor
|
|
8191
|
+
} = props2;
|
|
8192
|
+
const errorColorClass = "vc-form-item__error";
|
|
8193
|
+
return () => {
|
|
8194
|
+
if (isStyleless.value) return [slots.default?.(), slots.error?.({
|
|
8195
|
+
show: showError.value,
|
|
8196
|
+
nest: isNest.value,
|
|
8197
|
+
message: validateMessage.value,
|
|
8198
|
+
class: errorColorClass
|
|
8199
|
+
})];
|
|
8200
|
+
return vue.createVNode("div", {
|
|
8201
|
+
"class": ["vc-form-item", classes.value]
|
|
8202
|
+
}, [vue.createVNode("div", {
|
|
8203
|
+
"style": labelStyle.value,
|
|
8204
|
+
"class": "vc-form-item__label",
|
|
8205
|
+
"for": labelFor
|
|
8206
|
+
}, [vue.createVNode("label", null, [label || slots.label?.()])]), vue.createVNode("div", {
|
|
8207
|
+
"class": "vc-form-item__wrapper"
|
|
8208
|
+
}, [vue.createVNode("div", {
|
|
8209
|
+
"class": "vc-form-item__content",
|
|
8210
|
+
"style": contentStyle.value
|
|
8211
|
+
}, [slots.default?.(), slots.error ? slots.error({
|
|
8212
|
+
show: showError.value,
|
|
8213
|
+
nest: isNest.value,
|
|
8214
|
+
message: validateMessage.value,
|
|
8215
|
+
class: errorColorClass
|
|
8216
|
+
}) : vue.createVNode(TransitionFade, null, {
|
|
8217
|
+
default: () => [vue.withDirectives(vue.createVNode("div", {
|
|
8218
|
+
"class": ["vc-form-item__tip", isNest.value ? "is-nest" : "", errorColorClass]
|
|
8219
|
+
}, [validateMessage.value]), [[vue.vShow, showError.value]])]
|
|
8220
|
+
})])])]);
|
|
8221
|
+
};
|
|
7908
8222
|
}
|
|
7909
|
-
}
|
|
7910
|
-
const props$
|
|
7911
|
-
|
|
8223
|
+
});
|
|
8224
|
+
const props$R = {
|
|
8225
|
+
...props$T,
|
|
8226
|
+
showToast: {
|
|
8227
|
+
type: Boolean,
|
|
8228
|
+
default: false
|
|
8229
|
+
},
|
|
8230
|
+
border: {
|
|
8231
|
+
type: Boolean,
|
|
8232
|
+
default: false
|
|
8233
|
+
}
|
|
8234
|
+
};
|
|
8235
|
+
const props$Q = {
|
|
8236
|
+
content: [String, Function],
|
|
8237
|
+
maskClosable: {
|
|
8238
|
+
type: Boolean,
|
|
8239
|
+
default: true
|
|
8240
|
+
},
|
|
8241
|
+
// 单位ms
|
|
8242
|
+
duration: {
|
|
8243
|
+
type: Number,
|
|
8244
|
+
default: 3e3
|
|
8245
|
+
},
|
|
8246
|
+
mode: {
|
|
7912
8247
|
type: String,
|
|
7913
|
-
default: "
|
|
8248
|
+
default: "info",
|
|
8249
|
+
validator: (val) => ["info", "loading", "success", "warning", "error"].includes(val)
|
|
7914
8250
|
}
|
|
7915
8251
|
};
|
|
7916
|
-
const
|
|
7917
|
-
const
|
|
7918
|
-
|
|
7919
|
-
|
|
8252
|
+
const MSpin = Spin;
|
|
8253
|
+
const MTransition = Transition;
|
|
8254
|
+
const MTransitionCollapse = TransitionCollapse;
|
|
8255
|
+
const MTransitionFade = TransitionFade;
|
|
8256
|
+
const MTransitionScale = TransitionScale;
|
|
8257
|
+
const MTransitionSlide = TransitionSlide;
|
|
8258
|
+
const MTransitionZoom = TransitionZoom;
|
|
8259
|
+
const COMPONENT_NAME$10 = "vcm-toast";
|
|
8260
|
+
const MToastView = /* @__PURE__ */ vue.defineComponent({
|
|
8261
|
+
name: COMPONENT_NAME$10,
|
|
8262
|
+
emits: ["close", "portal-fulfilled"],
|
|
8263
|
+
props: props$Q,
|
|
7920
8264
|
setup(props2, {
|
|
7921
|
-
|
|
8265
|
+
emit,
|
|
8266
|
+
expose
|
|
7922
8267
|
}) {
|
|
8268
|
+
const isActive = vue.ref(false);
|
|
8269
|
+
const currentContent = vue.ref();
|
|
8270
|
+
let timer;
|
|
8271
|
+
const setDuration = (v) => {
|
|
8272
|
+
timer && clearTimeout(timer);
|
|
8273
|
+
if (v === 0) return;
|
|
8274
|
+
timer = setTimeout(() => isActive.value = false, v);
|
|
8275
|
+
};
|
|
8276
|
+
const setContent = (v) => {
|
|
8277
|
+
currentContent.value = v;
|
|
8278
|
+
};
|
|
8279
|
+
const handleRemove = () => {
|
|
8280
|
+
emit("close");
|
|
8281
|
+
emit("portal-fulfilled");
|
|
8282
|
+
};
|
|
8283
|
+
const handleClose = () => {
|
|
8284
|
+
if (props2.maskClosable) {
|
|
8285
|
+
isActive.value = false;
|
|
8286
|
+
}
|
|
8287
|
+
};
|
|
8288
|
+
vue.watch(() => props2.content, setContent, {
|
|
8289
|
+
immediate: true
|
|
8290
|
+
});
|
|
8291
|
+
vue.onMounted(() => {
|
|
8292
|
+
isActive.value = true;
|
|
8293
|
+
setDuration(props2.duration);
|
|
8294
|
+
});
|
|
8295
|
+
vue.onUnmounted(() => {
|
|
8296
|
+
timer && clearTimeout(timer);
|
|
8297
|
+
});
|
|
8298
|
+
const exposes = ["destroy", "remove", "close", "hide"].reduce((pre, key) => {
|
|
8299
|
+
pre[key] = handleRemove;
|
|
8300
|
+
return pre;
|
|
8301
|
+
}, {
|
|
8302
|
+
setContent,
|
|
8303
|
+
setDuration
|
|
8304
|
+
});
|
|
8305
|
+
expose(exposes);
|
|
7923
8306
|
return () => {
|
|
7924
|
-
return vue.
|
|
7925
|
-
class: "
|
|
7926
|
-
},
|
|
7927
|
-
|
|
7928
|
-
|
|
8307
|
+
return vue.createVNode("div", {
|
|
8308
|
+
"class": "vcm-toast"
|
|
8309
|
+
}, [vue.createVNode("div", {
|
|
8310
|
+
"class": "vcm-toast__bg",
|
|
8311
|
+
"onClick": handleClose,
|
|
8312
|
+
"onTouchmove": vue.withModifiers(() => {
|
|
8313
|
+
}, ["prevent"])
|
|
8314
|
+
}, null), vue.createVNode(MTransitionFade, {
|
|
8315
|
+
"duration": {
|
|
8316
|
+
enter: 300,
|
|
8317
|
+
leave: 150
|
|
8318
|
+
},
|
|
8319
|
+
"onAfterLeave": handleRemove
|
|
8320
|
+
}, {
|
|
8321
|
+
default: () => [vue.withDirectives(vue.createVNode("div", {
|
|
8322
|
+
"class": "vcm-toast__wrapper"
|
|
8323
|
+
}, [props2.mode === "loading" && vue.createVNode(MSpin, {
|
|
8324
|
+
"class": "vcm-toast__loading"
|
|
8325
|
+
}, null), typeof currentContent.value === "string" ? vue.createVNode("div", {
|
|
8326
|
+
"class": "vcm-toast__content",
|
|
8327
|
+
"innerHTML": currentContent.value
|
|
8328
|
+
}, null) : typeof currentContent.value === "function" ? vue.createVNode(MCustomer, {
|
|
8329
|
+
"render": currentContent.value
|
|
8330
|
+
}, null) : null]), [[vue.vShow, isActive.value]])]
|
|
8331
|
+
})]);
|
|
7929
8332
|
};
|
|
7930
8333
|
}
|
|
7931
8334
|
});
|
|
@@ -7962,9 +8365,9 @@
|
|
|
7962
8365
|
success: success$3,
|
|
7963
8366
|
warning: warning$3
|
|
7964
8367
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7965
|
-
const COMPONENT_NAME
|
|
8368
|
+
const COMPONENT_NAME$$ = "vcm-form";
|
|
7966
8369
|
const MForm = vue.defineComponent({
|
|
7967
|
-
name: COMPONENT_NAME
|
|
8370
|
+
name: COMPONENT_NAME$$,
|
|
7968
8371
|
props: props$R,
|
|
7969
8372
|
setup(props2, { slots, expose }) {
|
|
7970
8373
|
useForm(expose, {
|
|
@@ -7984,17 +8387,17 @@
|
|
|
7984
8387
|
};
|
|
7985
8388
|
}
|
|
7986
8389
|
});
|
|
7987
|
-
const props$
|
|
8390
|
+
const props$P = {
|
|
7988
8391
|
...props$S,
|
|
7989
8392
|
indent: {
|
|
7990
8393
|
type: Number,
|
|
7991
8394
|
default: 12
|
|
7992
8395
|
}
|
|
7993
8396
|
};
|
|
7994
|
-
const COMPONENT_NAME$
|
|
8397
|
+
const COMPONENT_NAME$_ = "vcm-form-item";
|
|
7995
8398
|
const MFormItem = /* @__PURE__ */ vue.defineComponent({
|
|
7996
|
-
name: COMPONENT_NAME$
|
|
7997
|
-
props: props$
|
|
8399
|
+
name: COMPONENT_NAME$_,
|
|
8400
|
+
props: props$P,
|
|
7998
8401
|
setup(props2, {
|
|
7999
8402
|
slots,
|
|
8000
8403
|
expose
|
|
@@ -8046,24 +8449,24 @@
|
|
|
8046
8449
|
};
|
|
8047
8450
|
}
|
|
8048
8451
|
});
|
|
8049
|
-
const COMPONENT_NAME$
|
|
8452
|
+
const COMPONENT_NAME$Z = "vc-fragment";
|
|
8050
8453
|
const Fragment = vue.defineComponent({
|
|
8051
|
-
name: COMPONENT_NAME$
|
|
8454
|
+
name: COMPONENT_NAME$Z,
|
|
8052
8455
|
setup(_, { slots }) {
|
|
8053
8456
|
return () => vue.h(vue.Fragment, slots.default?.());
|
|
8054
8457
|
}
|
|
8055
8458
|
});
|
|
8056
8459
|
const MFragment = Fragment;
|
|
8057
|
-
const props$
|
|
8460
|
+
const props$O = {
|
|
8058
8461
|
tag: {
|
|
8059
8462
|
type: String,
|
|
8060
8463
|
default: "div"
|
|
8061
8464
|
}
|
|
8062
8465
|
};
|
|
8063
|
-
const COMPONENT_NAME$
|
|
8466
|
+
const COMPONENT_NAME$Y = "vc-html-to-image";
|
|
8064
8467
|
const HTMLToImage = /* @__PURE__ */ vue.defineComponent({
|
|
8065
|
-
name: COMPONENT_NAME$
|
|
8066
|
-
props: props$
|
|
8468
|
+
name: COMPONENT_NAME$Y,
|
|
8469
|
+
props: props$O,
|
|
8067
8470
|
setup(props2, {
|
|
8068
8471
|
slots
|
|
8069
8472
|
}) {
|
|
@@ -8076,7 +8479,7 @@
|
|
|
8076
8479
|
});
|
|
8077
8480
|
const MHTMLToImage = HTMLToImage;
|
|
8078
8481
|
const MIcon = Icon;
|
|
8079
|
-
const props$
|
|
8482
|
+
const props$N = {
|
|
8080
8483
|
src: String,
|
|
8081
8484
|
fit: String,
|
|
8082
8485
|
lazy: Boolean,
|
|
@@ -8131,7 +8534,7 @@
|
|
|
8131
8534
|
}
|
|
8132
8535
|
}
|
|
8133
8536
|
const IMGStore$1 = new IMGStore();
|
|
8134
|
-
const COMPONENT_NAME$
|
|
8537
|
+
const COMPONENT_NAME$X = "vc-image";
|
|
8135
8538
|
let isSupportObjectFit = false;
|
|
8136
8539
|
window.addEventListener("DOMContentLoaded", () => {
|
|
8137
8540
|
isSupportObjectFit = !IS_SERVER$3 && document.documentElement.style.objectFit !== void 0;
|
|
@@ -8144,9 +8547,9 @@
|
|
|
8144
8547
|
SCALE_DOWN: "scale-down"
|
|
8145
8548
|
};
|
|
8146
8549
|
const Image$1 = /* @__PURE__ */ vue.defineComponent({
|
|
8147
|
-
name: COMPONENT_NAME$
|
|
8550
|
+
name: COMPONENT_NAME$X,
|
|
8148
8551
|
inheritAttrs: false,
|
|
8149
|
-
props: props$
|
|
8552
|
+
props: props$N,
|
|
8150
8553
|
setup(props2, {
|
|
8151
8554
|
slots,
|
|
8152
8555
|
emit
|
|
@@ -8333,16 +8736,16 @@
|
|
|
8333
8736
|
}
|
|
8334
8737
|
});
|
|
8335
8738
|
const MImage = Image$1;
|
|
8336
|
-
const props$
|
|
8739
|
+
const props$M = {
|
|
8337
8740
|
tag: {
|
|
8338
8741
|
type: String,
|
|
8339
8742
|
default: "div"
|
|
8340
8743
|
}
|
|
8341
8744
|
};
|
|
8342
|
-
const COMPONENT_NAME$
|
|
8745
|
+
const COMPONENT_NAME$W = "vc-image-crop";
|
|
8343
8746
|
const ImageCrop = /* @__PURE__ */ vue.defineComponent({
|
|
8344
|
-
name: COMPONENT_NAME$
|
|
8345
|
-
props: props$
|
|
8747
|
+
name: COMPONENT_NAME$W,
|
|
8748
|
+
props: props$M,
|
|
8346
8749
|
setup(props2, {
|
|
8347
8750
|
slots
|
|
8348
8751
|
}) {
|
|
@@ -8354,16 +8757,16 @@
|
|
|
8354
8757
|
}
|
|
8355
8758
|
});
|
|
8356
8759
|
const MImageCrop = ImageCrop;
|
|
8357
|
-
const props$
|
|
8760
|
+
const props$L = {
|
|
8358
8761
|
tag: {
|
|
8359
8762
|
type: String,
|
|
8360
8763
|
default: "div"
|
|
8361
8764
|
}
|
|
8362
8765
|
};
|
|
8363
|
-
const COMPONENT_NAME$
|
|
8766
|
+
const COMPONENT_NAME$V = "vc-image-preview";
|
|
8364
8767
|
const ImagePreview = /* @__PURE__ */ vue.defineComponent({
|
|
8365
|
-
name: COMPONENT_NAME$
|
|
8366
|
-
props: props$
|
|
8768
|
+
name: COMPONENT_NAME$V,
|
|
8769
|
+
props: props$L,
|
|
8367
8770
|
setup(props2, {
|
|
8368
8771
|
slots
|
|
8369
8772
|
}) {
|
|
@@ -8375,16 +8778,16 @@
|
|
|
8375
8778
|
}
|
|
8376
8779
|
});
|
|
8377
8780
|
const MImagePreview = ImagePreview;
|
|
8378
|
-
const props$
|
|
8781
|
+
const props$K = {
|
|
8379
8782
|
tag: {
|
|
8380
8783
|
type: String,
|
|
8381
8784
|
default: "div"
|
|
8382
8785
|
}
|
|
8383
8786
|
};
|
|
8384
|
-
const COMPONENT_NAME$
|
|
8787
|
+
const COMPONENT_NAME$U = "vc-image-processing";
|
|
8385
8788
|
const ImageProcessing = /* @__PURE__ */ vue.defineComponent({
|
|
8386
|
-
name: COMPONENT_NAME$
|
|
8387
|
-
props: props$
|
|
8789
|
+
name: COMPONENT_NAME$U,
|
|
8790
|
+
props: props$K,
|
|
8388
8791
|
setup(props2, {
|
|
8389
8792
|
slots
|
|
8390
8793
|
}) {
|
|
@@ -8396,7 +8799,7 @@
|
|
|
8396
8799
|
}
|
|
8397
8800
|
});
|
|
8398
8801
|
const MImageProcessing = ImageProcessing;
|
|
8399
|
-
const props$
|
|
8802
|
+
const props$J = {
|
|
8400
8803
|
// Array, 作为select等数组存放临时值
|
|
8401
8804
|
modelValue: {
|
|
8402
8805
|
type: [String, Number, Array],
|
|
@@ -8493,7 +8896,7 @@
|
|
|
8493
8896
|
const isFocus = vue.ref(false);
|
|
8494
8897
|
const isClearing = vue.ref(false);
|
|
8495
8898
|
const isOnComposition = vue.ref(false);
|
|
8496
|
-
const formItem = vue.inject("form-item", {});
|
|
8899
|
+
const formItem = vue.inject("vc-form-item", {});
|
|
8497
8900
|
vue.watch(
|
|
8498
8901
|
() => props2.modelValue,
|
|
8499
8902
|
(v) => {
|
|
@@ -8644,12 +9047,12 @@
|
|
|
8644
9047
|
expose?.(exposed);
|
|
8645
9048
|
return exposed;
|
|
8646
9049
|
};
|
|
8647
|
-
const COMPONENT_NAME$
|
|
9050
|
+
const COMPONENT_NAME$T = "vc-input";
|
|
8648
9051
|
const Input = /* @__PURE__ */ vue.defineComponent({
|
|
8649
|
-
name: COMPONENT_NAME$
|
|
9052
|
+
name: COMPONENT_NAME$T,
|
|
8650
9053
|
inheritAttrs: false,
|
|
8651
9054
|
props: {
|
|
8652
|
-
...props$
|
|
9055
|
+
...props$J,
|
|
8653
9056
|
indicator: {
|
|
8654
9057
|
type: [Boolean, Object],
|
|
8655
9058
|
default: false
|
|
@@ -8750,8 +9153,8 @@
|
|
|
8750
9153
|
};
|
|
8751
9154
|
}
|
|
8752
9155
|
});
|
|
8753
|
-
const props$
|
|
8754
|
-
...props$
|
|
9156
|
+
const props$I = {
|
|
9157
|
+
...props$J,
|
|
8755
9158
|
min: {
|
|
8756
9159
|
type: Number,
|
|
8757
9160
|
default: 0
|
|
@@ -8962,10 +9365,10 @@
|
|
|
8962
9365
|
handleStepper
|
|
8963
9366
|
};
|
|
8964
9367
|
};
|
|
8965
|
-
const COMPONENT_NAME$
|
|
9368
|
+
const COMPONENT_NAME$S = "vc-input-number";
|
|
8966
9369
|
const InputNumber = /* @__PURE__ */ vue.defineComponent({
|
|
8967
|
-
name: COMPONENT_NAME$
|
|
8968
|
-
props: props$
|
|
9370
|
+
name: COMPONENT_NAME$S,
|
|
9371
|
+
props: props$I,
|
|
8969
9372
|
inheritAttrs: false,
|
|
8970
9373
|
setup(props2, {
|
|
8971
9374
|
slots,
|
|
@@ -9015,17 +9418,17 @@
|
|
|
9015
9418
|
};
|
|
9016
9419
|
}
|
|
9017
9420
|
});
|
|
9018
|
-
const props$
|
|
9019
|
-
...props$
|
|
9421
|
+
const props$H = {
|
|
9422
|
+
...props$J,
|
|
9020
9423
|
enterText: {
|
|
9021
9424
|
type: [Boolean, String],
|
|
9022
9425
|
default: true
|
|
9023
9426
|
}
|
|
9024
9427
|
};
|
|
9025
|
-
const COMPONENT_NAME$
|
|
9428
|
+
const COMPONENT_NAME$R = "vc-input-search";
|
|
9026
9429
|
const InputSearch = /* @__PURE__ */ vue.defineComponent({
|
|
9027
|
-
name: COMPONENT_NAME$
|
|
9028
|
-
props: props$
|
|
9430
|
+
name: COMPONENT_NAME$R,
|
|
9431
|
+
props: props$H,
|
|
9029
9432
|
inheritAttrs: false,
|
|
9030
9433
|
setup(props2, {
|
|
9031
9434
|
emit,
|
|
@@ -9056,12 +9459,12 @@
|
|
|
9056
9459
|
};
|
|
9057
9460
|
}
|
|
9058
9461
|
});
|
|
9059
|
-
const COMPONENT_NAME$
|
|
9462
|
+
const COMPONENT_NAME$Q = "vcm-input";
|
|
9060
9463
|
const MInput = /* @__PURE__ */ vue.defineComponent({
|
|
9061
|
-
name: COMPONENT_NAME$
|
|
9464
|
+
name: COMPONENT_NAME$Q,
|
|
9062
9465
|
inheritAttrs: false,
|
|
9063
9466
|
props: {
|
|
9064
|
-
...props$
|
|
9467
|
+
...props$J,
|
|
9065
9468
|
right: {
|
|
9066
9469
|
type: Boolean,
|
|
9067
9470
|
default: false
|
|
@@ -9145,10 +9548,10 @@
|
|
|
9145
9548
|
};
|
|
9146
9549
|
}
|
|
9147
9550
|
});
|
|
9148
|
-
const COMPONENT_NAME$
|
|
9551
|
+
const COMPONENT_NAME$P = "vcm-input-number";
|
|
9149
9552
|
const MInputNumber = /* @__PURE__ */ vue.defineComponent({
|
|
9150
|
-
name: COMPONENT_NAME$
|
|
9151
|
-
props: props$
|
|
9553
|
+
name: COMPONENT_NAME$P,
|
|
9554
|
+
props: props$I,
|
|
9152
9555
|
inheritAttrs: false,
|
|
9153
9556
|
setup(props2, {
|
|
9154
9557
|
slots,
|
|
@@ -9193,11 +9596,11 @@
|
|
|
9193
9596
|
};
|
|
9194
9597
|
}
|
|
9195
9598
|
});
|
|
9196
|
-
const COMPONENT_NAME$
|
|
9599
|
+
const COMPONENT_NAME$O = "vcm-input-search";
|
|
9197
9600
|
const MInputSearch = /* @__PURE__ */ vue.defineComponent({
|
|
9198
|
-
name: COMPONENT_NAME$
|
|
9601
|
+
name: COMPONENT_NAME$O,
|
|
9199
9602
|
props: {
|
|
9200
|
-
...props$
|
|
9603
|
+
...props$H,
|
|
9201
9604
|
cancelText: {
|
|
9202
9605
|
type: String,
|
|
9203
9606
|
default: "取消"
|
|
@@ -9255,7 +9658,7 @@
|
|
|
9255
9658
|
};
|
|
9256
9659
|
}
|
|
9257
9660
|
});
|
|
9258
|
-
const props$
|
|
9661
|
+
const props$G = {
|
|
9259
9662
|
tag: {
|
|
9260
9663
|
type: String,
|
|
9261
9664
|
default: "div"
|
|
@@ -9269,12 +9672,12 @@
|
|
|
9269
9672
|
default: true
|
|
9270
9673
|
}
|
|
9271
9674
|
};
|
|
9272
|
-
const COMPONENT_NAME$
|
|
9675
|
+
const COMPONENT_NAME$N = "vcm-list";
|
|
9273
9676
|
const MList = vue.defineComponent({
|
|
9274
|
-
name: COMPONENT_NAME$
|
|
9275
|
-
props: props$
|
|
9677
|
+
name: COMPONENT_NAME$N,
|
|
9678
|
+
props: props$G,
|
|
9276
9679
|
setup(props2, { slots }) {
|
|
9277
|
-
vue.provide("list", { props: props2 });
|
|
9680
|
+
vue.provide("vc-list", { props: props2 });
|
|
9278
9681
|
return () => {
|
|
9279
9682
|
return vue.h(
|
|
9280
9683
|
props2.tag,
|
|
@@ -9291,7 +9694,7 @@
|
|
|
9291
9694
|
};
|
|
9292
9695
|
}
|
|
9293
9696
|
});
|
|
9294
|
-
const props$
|
|
9697
|
+
const props$F = {
|
|
9295
9698
|
tag: {
|
|
9296
9699
|
type: String,
|
|
9297
9700
|
default: "div"
|
|
@@ -9322,17 +9725,17 @@
|
|
|
9322
9725
|
// MListItem是否独立存在
|
|
9323
9726
|
alone: Boolean
|
|
9324
9727
|
};
|
|
9325
|
-
const COMPONENT_NAME$
|
|
9728
|
+
const COMPONENT_NAME$M = "vcm-list-item";
|
|
9326
9729
|
const HTTP_REGEX = /[a-zA-z]+:\/\/[^\s]*/;
|
|
9327
9730
|
const MListItem = /* @__PURE__ */ vue.defineComponent({
|
|
9328
|
-
name: COMPONENT_NAME$
|
|
9329
|
-
props: props$
|
|
9731
|
+
name: COMPONENT_NAME$M,
|
|
9732
|
+
props: props$F,
|
|
9330
9733
|
emits: ["click"],
|
|
9331
9734
|
setup(props2, {
|
|
9332
9735
|
slots,
|
|
9333
9736
|
emit
|
|
9334
9737
|
}) {
|
|
9335
|
-
const list = vue.inject("list", {});
|
|
9738
|
+
const list = vue.inject("vc-list", {});
|
|
9336
9739
|
const classes = vue.computed(() => {
|
|
9337
9740
|
const hasList = !!list.props;
|
|
9338
9741
|
return {
|
|
@@ -9393,16 +9796,16 @@
|
|
|
9393
9796
|
};
|
|
9394
9797
|
}
|
|
9395
9798
|
});
|
|
9396
|
-
const props$
|
|
9799
|
+
const props$E = {
|
|
9397
9800
|
tag: {
|
|
9398
9801
|
type: String,
|
|
9399
9802
|
default: "div"
|
|
9400
9803
|
}
|
|
9401
9804
|
};
|
|
9402
|
-
const COMPONENT_NAME$
|
|
9805
|
+
const COMPONENT_NAME$L = "vc-marquee";
|
|
9403
9806
|
const Marquee = /* @__PURE__ */ vue.defineComponent({
|
|
9404
|
-
name: COMPONENT_NAME$
|
|
9405
|
-
props: props$
|
|
9807
|
+
name: COMPONENT_NAME$L,
|
|
9808
|
+
props: props$E,
|
|
9406
9809
|
setup(props2, {
|
|
9407
9810
|
slots
|
|
9408
9811
|
}) {
|
|
@@ -9414,7 +9817,7 @@
|
|
|
9414
9817
|
}
|
|
9415
9818
|
});
|
|
9416
9819
|
const MMarquee = Marquee;
|
|
9417
|
-
const props$
|
|
9820
|
+
const props$D = {
|
|
9418
9821
|
content: [String, Function],
|
|
9419
9822
|
mask: {
|
|
9420
9823
|
type: Boolean,
|
|
@@ -9428,6 +9831,7 @@
|
|
|
9428
9831
|
type: Boolean,
|
|
9429
9832
|
default: true
|
|
9430
9833
|
},
|
|
9834
|
+
// 单位ms
|
|
9431
9835
|
duration: {
|
|
9432
9836
|
type: Number,
|
|
9433
9837
|
default: 1500
|
|
@@ -9448,17 +9852,27 @@
|
|
|
9448
9852
|
// 这个相当于Modal中的onCancel,支持Promise
|
|
9449
9853
|
onBeforeClose: Function
|
|
9450
9854
|
};
|
|
9451
|
-
const COMPONENT_NAME$
|
|
9855
|
+
const COMPONENT_NAME$K = "vc-message";
|
|
9452
9856
|
const MessageView = /* @__PURE__ */ vue.defineComponent({
|
|
9453
|
-
name: COMPONENT_NAME$
|
|
9857
|
+
name: COMPONENT_NAME$K,
|
|
9454
9858
|
emits: ["before-close", "close", "portal-fulfilled"],
|
|
9455
|
-
props: props$
|
|
9859
|
+
props: props$D,
|
|
9456
9860
|
setup(props2, {
|
|
9457
9861
|
emit,
|
|
9458
9862
|
expose
|
|
9459
9863
|
}) {
|
|
9460
9864
|
const instance = vue.getCurrentInstance();
|
|
9461
9865
|
const isActive = vue.ref(false);
|
|
9866
|
+
const currentContent = vue.ref();
|
|
9867
|
+
let timer;
|
|
9868
|
+
const setDuration = (v) => {
|
|
9869
|
+
timer && clearTimeout(timer);
|
|
9870
|
+
if (v === 0) return;
|
|
9871
|
+
timer = setTimeout(() => isActive.value = false, v);
|
|
9872
|
+
};
|
|
9873
|
+
const setContent = (v) => {
|
|
9874
|
+
currentContent.value = v;
|
|
9875
|
+
};
|
|
9462
9876
|
const handleRemove = () => {
|
|
9463
9877
|
emit("close");
|
|
9464
9878
|
emit("portal-fulfilled");
|
|
@@ -9477,14 +9891,12 @@
|
|
|
9477
9891
|
isActive.value = false;
|
|
9478
9892
|
}
|
|
9479
9893
|
};
|
|
9480
|
-
|
|
9894
|
+
vue.watch(() => props2.content, setContent, {
|
|
9895
|
+
immediate: true
|
|
9896
|
+
});
|
|
9481
9897
|
vue.onMounted(() => {
|
|
9482
9898
|
isActive.value = true;
|
|
9483
|
-
|
|
9484
|
-
timer = setTimeout(() => {
|
|
9485
|
-
isActive.value = false;
|
|
9486
|
-
}, props2.duration * 1e3 - 300);
|
|
9487
|
-
}
|
|
9899
|
+
setDuration(props2.duration);
|
|
9488
9900
|
});
|
|
9489
9901
|
vue.onUnmounted(() => {
|
|
9490
9902
|
timer && clearTimeout(timer);
|
|
@@ -9492,7 +9904,10 @@
|
|
|
9492
9904
|
const exposes = ["destroy", "remove", "close", "hide"].reduce((pre, key) => {
|
|
9493
9905
|
pre[key] = handleRemove;
|
|
9494
9906
|
return pre;
|
|
9495
|
-
}, {
|
|
9907
|
+
}, {
|
|
9908
|
+
setContent,
|
|
9909
|
+
setDuration
|
|
9910
|
+
});
|
|
9496
9911
|
expose(exposes);
|
|
9497
9912
|
return () => {
|
|
9498
9913
|
return vue.createVNode("div", {
|
|
@@ -9501,7 +9916,7 @@
|
|
|
9501
9916
|
"class": "vc-message__mask",
|
|
9502
9917
|
"onClick": (e) => handleClose(e, props2.maskClosable)
|
|
9503
9918
|
}, null), vue.createVNode(TransitionSlide, {
|
|
9504
|
-
"mode": "
|
|
9919
|
+
"mode": "bottom",
|
|
9505
9920
|
"onAfterLeave": handleRemove
|
|
9506
9921
|
}, {
|
|
9507
9922
|
default: () => [vue.withDirectives(vue.createVNode("div", {
|
|
@@ -9519,11 +9934,11 @@
|
|
|
9519
9934
|
}, null) : vue.createVNode(Icon, {
|
|
9520
9935
|
"type": props2.mode,
|
|
9521
9936
|
"class": [`is-${props2.mode}`, "vc-message__icon"]
|
|
9522
|
-
}, null), typeof
|
|
9937
|
+
}, null), typeof currentContent.value === "string" ? vue.createVNode("div", {
|
|
9523
9938
|
"class": "vc-message__content",
|
|
9524
|
-
"innerHTML":
|
|
9525
|
-
}, null) : typeof
|
|
9526
|
-
"render":
|
|
9939
|
+
"innerHTML": currentContent.value
|
|
9940
|
+
}, null) : typeof currentContent.value === "function" ? vue.createVNode(Customer, {
|
|
9941
|
+
"render": currentContent.value
|
|
9527
9942
|
}, null) : null, props2.closable && vue.createVNode(Icon, {
|
|
9528
9943
|
"type": "close",
|
|
9529
9944
|
"class": "vc-message__close",
|
|
@@ -9577,7 +9992,7 @@
|
|
|
9577
9992
|
warning: warning$2
|
|
9578
9993
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
9579
9994
|
const MMessage = Message$1;
|
|
9580
|
-
const props$
|
|
9995
|
+
const props$C = {
|
|
9581
9996
|
modelValue: {
|
|
9582
9997
|
type: Boolean,
|
|
9583
9998
|
default: false
|
|
@@ -9654,12 +10069,12 @@
|
|
|
9654
10069
|
type: Function
|
|
9655
10070
|
}
|
|
9656
10071
|
};
|
|
9657
|
-
const COMPONENT_NAME$
|
|
10072
|
+
const COMPONENT_NAME$J = "vc-modal";
|
|
9658
10073
|
let zIndexNumber = 1002;
|
|
9659
10074
|
const ModalView = /* @__PURE__ */ vue.defineComponent({
|
|
9660
|
-
name: COMPONENT_NAME$
|
|
10075
|
+
name: COMPONENT_NAME$J,
|
|
9661
10076
|
emits: ["update:modelValue", "close", "portal-fulfilled", "visible-change", "ok", "cancel"],
|
|
9662
|
-
props: props$
|
|
10077
|
+
props: props$C,
|
|
9663
10078
|
setup(props2, {
|
|
9664
10079
|
slots,
|
|
9665
10080
|
emit,
|
|
@@ -9847,6 +10262,10 @@
|
|
|
9847
10262
|
expose({
|
|
9848
10263
|
isActive,
|
|
9849
10264
|
// for portal
|
|
10265
|
+
toggle(v) {
|
|
10266
|
+
v = typeof v === "boolean" ? v : !isActive.value;
|
|
10267
|
+
isActive.value = v;
|
|
10268
|
+
},
|
|
9850
10269
|
resetOrigin
|
|
9851
10270
|
});
|
|
9852
10271
|
return () => {
|
|
@@ -9936,7 +10355,7 @@
|
|
|
9936
10355
|
// 当组件内使用emit('close'),避免重复触发
|
|
9937
10356
|
onClose: null
|
|
9938
10357
|
});
|
|
9939
|
-
leaf.wrapper.
|
|
10358
|
+
leaf.wrapper.toggle?.(true);
|
|
9940
10359
|
return leaf;
|
|
9941
10360
|
};
|
|
9942
10361
|
const destroy$2 = () => Modal.destroy();
|
|
@@ -9952,7 +10371,7 @@
|
|
|
9952
10371
|
success: success$1,
|
|
9953
10372
|
warning: warning$1
|
|
9954
10373
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
9955
|
-
const props$
|
|
10374
|
+
const props$B = {
|
|
9956
10375
|
mode: {
|
|
9957
10376
|
type: String,
|
|
9958
10377
|
validator: (v) => /(alert|operation)/.test(v),
|
|
@@ -10011,11 +10430,11 @@
|
|
|
10011
10430
|
type: Function
|
|
10012
10431
|
}
|
|
10013
10432
|
};
|
|
10014
|
-
const COMPONENT_NAME$
|
|
10433
|
+
const COMPONENT_NAME$I = "vc-modal";
|
|
10015
10434
|
const MModalView = /* @__PURE__ */ vue.defineComponent({
|
|
10016
|
-
name: COMPONENT_NAME$
|
|
10435
|
+
name: COMPONENT_NAME$I,
|
|
10017
10436
|
emits: ["update:modelValue", "portal-fulfilled", "close", "ok", "cancel"],
|
|
10018
|
-
props: props$
|
|
10437
|
+
props: props$B,
|
|
10019
10438
|
setup(props2, {
|
|
10020
10439
|
slots,
|
|
10021
10440
|
emit,
|
|
@@ -10175,12 +10594,13 @@
|
|
|
10175
10594
|
destroy: destroy$1,
|
|
10176
10595
|
operation
|
|
10177
10596
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
10178
|
-
const props$
|
|
10597
|
+
const props$A = {
|
|
10179
10598
|
title: [String, Function],
|
|
10180
10599
|
content: [String, Function],
|
|
10600
|
+
// 单位ms
|
|
10181
10601
|
duration: {
|
|
10182
10602
|
type: Number,
|
|
10183
|
-
default:
|
|
10603
|
+
default: 4500
|
|
10184
10604
|
},
|
|
10185
10605
|
closable: {
|
|
10186
10606
|
type: Boolean,
|
|
@@ -10201,28 +10621,31 @@
|
|
|
10201
10621
|
// 这个相当于Modal中的onCancel,支持Promise
|
|
10202
10622
|
onBeforeClose: Function
|
|
10203
10623
|
};
|
|
10204
|
-
const COMPONENT_NAME$
|
|
10624
|
+
const COMPONENT_NAME$H = "vc-notice";
|
|
10205
10625
|
const NoticeView = /* @__PURE__ */ vue.defineComponent({
|
|
10206
|
-
name: COMPONENT_NAME$
|
|
10207
|
-
props: props$
|
|
10626
|
+
name: COMPONENT_NAME$H,
|
|
10627
|
+
props: props$A,
|
|
10208
10628
|
emits: ["portal-fulfilled", "close", "before-close"],
|
|
10209
10629
|
setup(props2, {
|
|
10210
|
-
emit
|
|
10630
|
+
emit,
|
|
10631
|
+
expose
|
|
10211
10632
|
}) {
|
|
10212
10633
|
const instance = vue.getCurrentInstance();
|
|
10213
10634
|
const isActive = vue.ref(false);
|
|
10635
|
+
const currentTitle = vue.ref();
|
|
10636
|
+
const currentContent = vue.ref();
|
|
10214
10637
|
let timer;
|
|
10215
|
-
|
|
10216
|
-
isActive.value = true;
|
|
10217
|
-
if (props2.duration !== 0) {
|
|
10218
|
-
timer = setTimeout(() => {
|
|
10219
|
-
isActive.value = false;
|
|
10220
|
-
}, props2.duration * 1e3 - 300);
|
|
10221
|
-
}
|
|
10222
|
-
});
|
|
10223
|
-
vue.onUnmounted(() => {
|
|
10638
|
+
const setDuration = (v) => {
|
|
10224
10639
|
timer && clearTimeout(timer);
|
|
10225
|
-
|
|
10640
|
+
if (v === 0) return;
|
|
10641
|
+
timer = setTimeout(() => isActive.value = false, v);
|
|
10642
|
+
};
|
|
10643
|
+
const setTitle = (v) => {
|
|
10644
|
+
currentTitle.value = v;
|
|
10645
|
+
};
|
|
10646
|
+
const setContent = (v) => {
|
|
10647
|
+
currentContent.value = v;
|
|
10648
|
+
};
|
|
10226
10649
|
const handleRemove = () => {
|
|
10227
10650
|
emit("close");
|
|
10228
10651
|
emit("portal-fulfilled");
|
|
@@ -10241,6 +10664,27 @@
|
|
|
10241
10664
|
isActive.value = false;
|
|
10242
10665
|
}
|
|
10243
10666
|
};
|
|
10667
|
+
vue.watch(() => props2.title, setTitle, {
|
|
10668
|
+
immediate: true
|
|
10669
|
+
});
|
|
10670
|
+
vue.watch(() => props2.content, setContent, {
|
|
10671
|
+
immediate: true
|
|
10672
|
+
});
|
|
10673
|
+
vue.onMounted(() => {
|
|
10674
|
+
isActive.value = true;
|
|
10675
|
+
setDuration(props2.duration);
|
|
10676
|
+
});
|
|
10677
|
+
vue.onUnmounted(() => {
|
|
10678
|
+
timer && clearTimeout(timer);
|
|
10679
|
+
});
|
|
10680
|
+
const exposes = ["destroy", "remove", "close", "hide"].reduce((pre, key) => {
|
|
10681
|
+
pre[key] = handleRemove;
|
|
10682
|
+
return pre;
|
|
10683
|
+
}, {
|
|
10684
|
+
setContent,
|
|
10685
|
+
setDuration
|
|
10686
|
+
});
|
|
10687
|
+
expose(exposes);
|
|
10244
10688
|
return () => {
|
|
10245
10689
|
return vue.createVNode("div", {
|
|
10246
10690
|
"class": ["vc-notice", {
|
|
@@ -10260,21 +10704,21 @@
|
|
|
10260
10704
|
}, [props2.mode && vue.createVNode(Icon, {
|
|
10261
10705
|
"type": `o-${props2.mode}`,
|
|
10262
10706
|
"class": [`is-${props2.mode}`, "vc-notice__icon"]
|
|
10263
|
-
}, null), vue.createVNode("div", null, [
|
|
10707
|
+
}, null), vue.createVNode("div", null, [currentTitle.value && vue.createVNode("div", {
|
|
10264
10708
|
"style": [{
|
|
10265
|
-
marginBottom:
|
|
10709
|
+
marginBottom: currentContent.value ? "8px" : ""
|
|
10266
10710
|
}],
|
|
10267
10711
|
"class": "vc-notice__title"
|
|
10268
|
-
}, [typeof
|
|
10269
|
-
"innerHTML":
|
|
10270
|
-
}, null) : typeof
|
|
10271
|
-
"render":
|
|
10272
|
-
}, null) : null]),
|
|
10712
|
+
}, [typeof currentTitle.value === "string" ? vue.createVNode("div", {
|
|
10713
|
+
"innerHTML": currentTitle.value
|
|
10714
|
+
}, null) : typeof currentTitle.value === "function" ? vue.createVNode(Customer, {
|
|
10715
|
+
"render": currentTitle.value
|
|
10716
|
+
}, null) : null]), currentContent.value && vue.createVNode("div", {
|
|
10273
10717
|
"class": "vc-notice__content"
|
|
10274
|
-
}, [typeof
|
|
10275
|
-
"innerHTML":
|
|
10276
|
-
}, null) : typeof
|
|
10277
|
-
"render":
|
|
10718
|
+
}, [typeof currentContent.value === "string" ? vue.createVNode("div", {
|
|
10719
|
+
"innerHTML": currentContent.value
|
|
10720
|
+
}, null) : typeof currentContent.value === "function" ? vue.createVNode(Customer, {
|
|
10721
|
+
"render": currentContent.value
|
|
10278
10722
|
}, null) : null])]), props2.closable && vue.createVNode(Icon, {
|
|
10279
10723
|
"type": "close",
|
|
10280
10724
|
"style": "font-size: 12px",
|
|
@@ -10347,16 +10791,16 @@
|
|
|
10347
10791
|
warning
|
|
10348
10792
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
10349
10793
|
const MNotice = Notice$1;
|
|
10350
|
-
const props$
|
|
10794
|
+
const props$z = {
|
|
10351
10795
|
tag: {
|
|
10352
10796
|
type: String,
|
|
10353
10797
|
default: "div"
|
|
10354
10798
|
}
|
|
10355
10799
|
};
|
|
10356
|
-
const COMPONENT_NAME$
|
|
10800
|
+
const COMPONENT_NAME$G = "vc-option";
|
|
10357
10801
|
const Option = /* @__PURE__ */ vue.defineComponent({
|
|
10358
|
-
name: COMPONENT_NAME$
|
|
10359
|
-
props: props$
|
|
10802
|
+
name: COMPONENT_NAME$G,
|
|
10803
|
+
props: props$z,
|
|
10360
10804
|
setup(props2, {
|
|
10361
10805
|
slots
|
|
10362
10806
|
}) {
|
|
@@ -10368,16 +10812,16 @@
|
|
|
10368
10812
|
}
|
|
10369
10813
|
});
|
|
10370
10814
|
const MOption = Option;
|
|
10371
|
-
const props$
|
|
10815
|
+
const props$y = {
|
|
10372
10816
|
tag: {
|
|
10373
10817
|
type: String,
|
|
10374
10818
|
default: "div"
|
|
10375
10819
|
}
|
|
10376
10820
|
};
|
|
10377
|
-
const COMPONENT_NAME$
|
|
10821
|
+
const COMPONENT_NAME$F = "vc-page";
|
|
10378
10822
|
const Page = /* @__PURE__ */ vue.defineComponent({
|
|
10379
|
-
name: COMPONENT_NAME$
|
|
10380
|
-
props: props$
|
|
10823
|
+
name: COMPONENT_NAME$F,
|
|
10824
|
+
props: props$y,
|
|
10381
10825
|
setup(props2, {
|
|
10382
10826
|
slots
|
|
10383
10827
|
}) {
|
|
@@ -10389,16 +10833,16 @@
|
|
|
10389
10833
|
}
|
|
10390
10834
|
});
|
|
10391
10835
|
const MPage = Page;
|
|
10392
|
-
const props$
|
|
10836
|
+
const props$x = {
|
|
10393
10837
|
tag: {
|
|
10394
10838
|
type: String,
|
|
10395
10839
|
default: "div"
|
|
10396
10840
|
}
|
|
10397
10841
|
};
|
|
10398
|
-
const COMPONENT_NAME$
|
|
10842
|
+
const COMPONENT_NAME$E = "vc-picker";
|
|
10399
10843
|
const Picker = /* @__PURE__ */ vue.defineComponent({
|
|
10400
|
-
name: COMPONENT_NAME$
|
|
10401
|
-
props: props$
|
|
10844
|
+
name: COMPONENT_NAME$E,
|
|
10845
|
+
props: props$x,
|
|
10402
10846
|
setup(props2, {
|
|
10403
10847
|
slots
|
|
10404
10848
|
}) {
|
|
@@ -10410,16 +10854,16 @@
|
|
|
10410
10854
|
}
|
|
10411
10855
|
});
|
|
10412
10856
|
const MPicker = Picker;
|
|
10413
|
-
const props$
|
|
10857
|
+
const props$w = {
|
|
10414
10858
|
tag: {
|
|
10415
10859
|
type: String,
|
|
10416
10860
|
default: "div"
|
|
10417
10861
|
}
|
|
10418
10862
|
};
|
|
10419
|
-
const COMPONENT_NAME$
|
|
10863
|
+
const COMPONENT_NAME$D = "vc-popconfirm";
|
|
10420
10864
|
const Popconfirm = /* @__PURE__ */ vue.defineComponent({
|
|
10421
|
-
name: COMPONENT_NAME$
|
|
10422
|
-
props: props$
|
|
10865
|
+
name: COMPONENT_NAME$D,
|
|
10866
|
+
props: props$w,
|
|
10423
10867
|
setup(props2, {
|
|
10424
10868
|
slots
|
|
10425
10869
|
}) {
|
|
@@ -10431,7 +10875,7 @@
|
|
|
10431
10875
|
}
|
|
10432
10876
|
});
|
|
10433
10877
|
const MPopconfirm = Popconfirm;
|
|
10434
|
-
const props$
|
|
10878
|
+
const props$v = {
|
|
10435
10879
|
modelValue: Boolean,
|
|
10436
10880
|
animation: String,
|
|
10437
10881
|
placement: {
|
|
@@ -10509,7 +10953,7 @@
|
|
|
10509
10953
|
"autoWidth",
|
|
10510
10954
|
"always"
|
|
10511
10955
|
];
|
|
10512
|
-
const props$
|
|
10956
|
+
const props$u = {
|
|
10513
10957
|
trigger: {
|
|
10514
10958
|
type: String,
|
|
10515
10959
|
default: "hover",
|
|
@@ -10527,7 +10971,7 @@
|
|
|
10527
10971
|
type: Boolean,
|
|
10528
10972
|
default: true
|
|
10529
10973
|
},
|
|
10530
|
-
...pick(props$
|
|
10974
|
+
...pick(props$v, wrapperKeys)
|
|
10531
10975
|
};
|
|
10532
10976
|
const EXTRA_DISTANCE = 4;
|
|
10533
10977
|
const HALF_ARROW = 12.73 / 2;
|
|
@@ -10784,10 +11228,10 @@
|
|
|
10784
11228
|
function _isSlot(s) {
|
|
10785
11229
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
|
|
10786
11230
|
}
|
|
10787
|
-
const COMPONENT_NAME$
|
|
11231
|
+
const COMPONENT_NAME$C = "vc-popover-wrapper";
|
|
10788
11232
|
const PopoverWrapper = /* @__PURE__ */ vue.defineComponent({
|
|
10789
|
-
name: COMPONENT_NAME$
|
|
10790
|
-
props: props$
|
|
11233
|
+
name: COMPONENT_NAME$C,
|
|
11234
|
+
props: props$v,
|
|
10791
11235
|
emits: ["portal-fulfilled", "close"],
|
|
10792
11236
|
setup(props2, {
|
|
10793
11237
|
emit,
|
|
@@ -10966,7 +11410,11 @@
|
|
|
10966
11410
|
props2.alone && props2.hover && removeEvents();
|
|
10967
11411
|
});
|
|
10968
11412
|
expose({
|
|
10969
|
-
isActive
|
|
11413
|
+
isActive,
|
|
11414
|
+
toggle(v) {
|
|
11415
|
+
v = typeof v === "boolean" ? v : !isActive.value;
|
|
11416
|
+
isActive.value = v;
|
|
11417
|
+
}
|
|
10970
11418
|
});
|
|
10971
11419
|
return () => {
|
|
10972
11420
|
let _slot;
|
|
@@ -11003,10 +11451,10 @@
|
|
|
11003
11451
|
}
|
|
11004
11452
|
});
|
|
11005
11453
|
const PopoverPortal = new Portal(PopoverWrapper);
|
|
11006
|
-
const COMPONENT_NAME$
|
|
11454
|
+
const COMPONENT_NAME$B = "vc-popover";
|
|
11007
11455
|
const Popover = /* @__PURE__ */ vue.defineComponent({
|
|
11008
|
-
name: COMPONENT_NAME$
|
|
11009
|
-
props: props$
|
|
11456
|
+
name: COMPONENT_NAME$B,
|
|
11457
|
+
props: props$u,
|
|
11010
11458
|
emits: ["update:modelValue", "visible-change", "ready", "close"],
|
|
11011
11459
|
open: PopoverPortal.popup.bind(PopoverPortal),
|
|
11012
11460
|
setup(props2, {
|
|
@@ -11088,7 +11536,7 @@
|
|
|
11088
11536
|
portalClass
|
|
11089
11537
|
});
|
|
11090
11538
|
} else if (popperInstance && popperInstance.wrapper) {
|
|
11091
|
-
popperInstance.wrapper.
|
|
11539
|
+
popperInstance.wrapper.toggle(false);
|
|
11092
11540
|
}
|
|
11093
11541
|
};
|
|
11094
11542
|
vue.watch(() => props2.modelValue, (v) => {
|
|
@@ -11129,16 +11577,16 @@
|
|
|
11129
11577
|
}
|
|
11130
11578
|
});
|
|
11131
11579
|
const MPopover = Popover;
|
|
11132
|
-
const props$
|
|
11580
|
+
const props$t = {
|
|
11133
11581
|
tag: {
|
|
11134
11582
|
type: String,
|
|
11135
11583
|
default: "div"
|
|
11136
11584
|
}
|
|
11137
11585
|
};
|
|
11138
|
-
const COMPONENT_NAME$
|
|
11586
|
+
const COMPONENT_NAME$A = "vc-popup";
|
|
11139
11587
|
const Popup = /* @__PURE__ */ vue.defineComponent({
|
|
11140
|
-
name: COMPONENT_NAME$
|
|
11141
|
-
props: props$
|
|
11588
|
+
name: COMPONENT_NAME$A,
|
|
11589
|
+
props: props$t,
|
|
11142
11590
|
setup(props2, {
|
|
11143
11591
|
slots
|
|
11144
11592
|
}) {
|
|
@@ -11151,16 +11599,16 @@
|
|
|
11151
11599
|
});
|
|
11152
11600
|
const MPopup = Popup;
|
|
11153
11601
|
const MPortal = Portal;
|
|
11154
|
-
const props$
|
|
11602
|
+
const props$s = {
|
|
11155
11603
|
tag: {
|
|
11156
11604
|
type: String,
|
|
11157
11605
|
default: "div"
|
|
11158
11606
|
}
|
|
11159
11607
|
};
|
|
11160
|
-
const COMPONENT_NAME$
|
|
11608
|
+
const COMPONENT_NAME$z = "vc-print";
|
|
11161
11609
|
const Print = /* @__PURE__ */ vue.defineComponent({
|
|
11162
|
-
name: COMPONENT_NAME$
|
|
11163
|
-
props: props$
|
|
11610
|
+
name: COMPONENT_NAME$z,
|
|
11611
|
+
props: props$s,
|
|
11164
11612
|
setup(props2, {
|
|
11165
11613
|
slots
|
|
11166
11614
|
}) {
|
|
@@ -11172,16 +11620,16 @@
|
|
|
11172
11620
|
}
|
|
11173
11621
|
});
|
|
11174
11622
|
const MPrint = Print;
|
|
11175
|
-
const props$
|
|
11623
|
+
const props$r = {
|
|
11176
11624
|
tag: {
|
|
11177
11625
|
type: String,
|
|
11178
11626
|
default: "div"
|
|
11179
11627
|
}
|
|
11180
11628
|
};
|
|
11181
|
-
const COMPONENT_NAME$
|
|
11629
|
+
const COMPONENT_NAME$y = "vc-progress";
|
|
11182
11630
|
const Progress = /* @__PURE__ */ vue.defineComponent({
|
|
11183
|
-
name: COMPONENT_NAME$
|
|
11184
|
-
props: props$
|
|
11631
|
+
name: COMPONENT_NAME$y,
|
|
11632
|
+
props: props$r,
|
|
11185
11633
|
setup(props2, {
|
|
11186
11634
|
slots
|
|
11187
11635
|
}) {
|
|
@@ -11193,16 +11641,16 @@
|
|
|
11193
11641
|
}
|
|
11194
11642
|
});
|
|
11195
11643
|
const MProgress = Progress;
|
|
11196
|
-
const props$
|
|
11644
|
+
const props$q = {
|
|
11197
11645
|
tag: {
|
|
11198
11646
|
type: String,
|
|
11199
11647
|
default: "div"
|
|
11200
11648
|
}
|
|
11201
11649
|
};
|
|
11202
|
-
const COMPONENT_NAME$
|
|
11650
|
+
const COMPONENT_NAME$x = "vc-radio";
|
|
11203
11651
|
const Radio = /* @__PURE__ */ vue.defineComponent({
|
|
11204
|
-
name: COMPONENT_NAME$
|
|
11205
|
-
props: props$
|
|
11652
|
+
name: COMPONENT_NAME$x,
|
|
11653
|
+
props: props$q,
|
|
11206
11654
|
setup(props2, {
|
|
11207
11655
|
slots
|
|
11208
11656
|
}) {
|
|
@@ -11214,16 +11662,16 @@
|
|
|
11214
11662
|
}
|
|
11215
11663
|
});
|
|
11216
11664
|
const MRadio = Radio;
|
|
11217
|
-
const props$
|
|
11665
|
+
const props$p = {
|
|
11218
11666
|
tag: {
|
|
11219
11667
|
type: String,
|
|
11220
11668
|
default: "div"
|
|
11221
11669
|
}
|
|
11222
11670
|
};
|
|
11223
|
-
const COMPONENT_NAME$
|
|
11671
|
+
const COMPONENT_NAME$w = "vc-rate";
|
|
11224
11672
|
const Rate = /* @__PURE__ */ vue.defineComponent({
|
|
11225
|
-
name: COMPONENT_NAME$
|
|
11226
|
-
props: props$
|
|
11673
|
+
name: COMPONENT_NAME$w,
|
|
11674
|
+
props: props$p,
|
|
11227
11675
|
setup(props2, {
|
|
11228
11676
|
slots
|
|
11229
11677
|
}) {
|
|
@@ -11235,7 +11683,7 @@
|
|
|
11235
11683
|
}
|
|
11236
11684
|
});
|
|
11237
11685
|
const MRate = Rate;
|
|
11238
|
-
const props$
|
|
11686
|
+
const props$o = {
|
|
11239
11687
|
data: {
|
|
11240
11688
|
type: Array,
|
|
11241
11689
|
default: () => []
|
|
@@ -11285,7 +11733,7 @@
|
|
|
11285
11733
|
renderPlaceholder: Function,
|
|
11286
11734
|
renderRefresh: Function
|
|
11287
11735
|
};
|
|
11288
|
-
const props$
|
|
11736
|
+
const props$n = {
|
|
11289
11737
|
vertical: Boolean,
|
|
11290
11738
|
wrapperSize: {
|
|
11291
11739
|
type: Number,
|
|
@@ -11338,7 +11786,7 @@
|
|
|
11338
11786
|
"thumbStyle",
|
|
11339
11787
|
"thumbClass"
|
|
11340
11788
|
];
|
|
11341
|
-
const props$
|
|
11789
|
+
const props$m = {
|
|
11342
11790
|
// 如果存在滚动条宽度为false, 不存在则为true
|
|
11343
11791
|
// 为false的情况下才能使用track-offset
|
|
11344
11792
|
native: {
|
|
@@ -11369,7 +11817,7 @@
|
|
|
11369
11817
|
scrollX: Number,
|
|
11370
11818
|
scrollY: Number,
|
|
11371
11819
|
fit: Boolean,
|
|
11372
|
-
...pick(props$
|
|
11820
|
+
...pick(props$n, barKeys$1)
|
|
11373
11821
|
};
|
|
11374
11822
|
const barKeys = [
|
|
11375
11823
|
"always",
|
|
@@ -11383,7 +11831,7 @@
|
|
|
11383
11831
|
"autoResize",
|
|
11384
11832
|
"native"
|
|
11385
11833
|
];
|
|
11386
|
-
const props$
|
|
11834
|
+
const props$l = {
|
|
11387
11835
|
tag: {
|
|
11388
11836
|
type: String,
|
|
11389
11837
|
default: "div"
|
|
@@ -11416,10 +11864,10 @@
|
|
|
11416
11864
|
type: Boolean,
|
|
11417
11865
|
default: true
|
|
11418
11866
|
},
|
|
11419
|
-
barTo: props$
|
|
11420
|
-
...pick(props$
|
|
11867
|
+
barTo: props$m.to,
|
|
11868
|
+
...pick(props$m, barKeys)
|
|
11421
11869
|
};
|
|
11422
|
-
const COMPONENT_NAME$
|
|
11870
|
+
const COMPONENT_NAME$v = "vc-scroller-track";
|
|
11423
11871
|
const BAR_MAP = {
|
|
11424
11872
|
vertical: {
|
|
11425
11873
|
scroll: "scrollTop",
|
|
@@ -11439,8 +11887,8 @@
|
|
|
11439
11887
|
}
|
|
11440
11888
|
};
|
|
11441
11889
|
const Track$1 = /* @__PURE__ */ vue.defineComponent({
|
|
11442
|
-
name: COMPONENT_NAME$
|
|
11443
|
-
props: props$
|
|
11890
|
+
name: COMPONENT_NAME$v,
|
|
11891
|
+
props: props$n,
|
|
11444
11892
|
emits: ["change"],
|
|
11445
11893
|
setup(props2, {
|
|
11446
11894
|
emit,
|
|
@@ -11597,10 +12045,10 @@
|
|
|
11597
12045
|
};
|
|
11598
12046
|
}
|
|
11599
12047
|
});
|
|
11600
|
-
const COMPONENT_NAME$
|
|
12048
|
+
const COMPONENT_NAME$u = "vc-scroller-bar";
|
|
11601
12049
|
const Bar = /* @__PURE__ */ vue.defineComponent({
|
|
11602
|
-
name: COMPONENT_NAME$
|
|
11603
|
-
props: props$
|
|
12050
|
+
name: COMPONENT_NAME$u,
|
|
12051
|
+
props: props$m,
|
|
11604
12052
|
emits: ["change"],
|
|
11605
12053
|
setup(props2, {
|
|
11606
12054
|
emit,
|
|
@@ -11809,10 +12257,10 @@
|
|
|
11809
12257
|
refreshPosition
|
|
11810
12258
|
};
|
|
11811
12259
|
};
|
|
11812
|
-
const COMPONENT_NAME$
|
|
12260
|
+
const COMPONENT_NAME$t = "vc-scroller";
|
|
11813
12261
|
const Scroller = /* @__PURE__ */ vue.defineComponent({
|
|
11814
|
-
name: COMPONENT_NAME$
|
|
11815
|
-
props: props$
|
|
12262
|
+
name: COMPONENT_NAME$t,
|
|
12263
|
+
props: props$l,
|
|
11816
12264
|
emits: ["scroll"],
|
|
11817
12265
|
setup(props2, {
|
|
11818
12266
|
slots,
|
|
@@ -11869,10 +12317,10 @@
|
|
|
11869
12317
|
};
|
|
11870
12318
|
}
|
|
11871
12319
|
});
|
|
11872
|
-
const COMPONENT_NAME$
|
|
12320
|
+
const COMPONENT_NAME$s = "vc-scroller-wheel";
|
|
11873
12321
|
const ScrollerWheel = /* @__PURE__ */ vue.defineComponent({
|
|
11874
|
-
name: COMPONENT_NAME$
|
|
11875
|
-
props: props$
|
|
12322
|
+
name: COMPONENT_NAME$s,
|
|
12323
|
+
props: props$l,
|
|
11876
12324
|
emits: ["scroll"],
|
|
11877
12325
|
setup(props2, {
|
|
11878
12326
|
slots,
|
|
@@ -11969,9 +12417,9 @@
|
|
|
11969
12417
|
};
|
|
11970
12418
|
}
|
|
11971
12419
|
});
|
|
11972
|
-
const COMPONENT_NAME$
|
|
12420
|
+
const COMPONENT_NAME$r = "vc-recycle-list-scroll-state";
|
|
11973
12421
|
const ScrollState = /* @__PURE__ */ vue.defineComponent({
|
|
11974
|
-
name: COMPONENT_NAME$
|
|
12422
|
+
name: COMPONENT_NAME$r,
|
|
11975
12423
|
setup(_, {
|
|
11976
12424
|
slots
|
|
11977
12425
|
}) {
|
|
@@ -12040,7 +12488,7 @@
|
|
|
12040
12488
|
[REFRESH]: "加载中..."
|
|
12041
12489
|
}
|
|
12042
12490
|
};
|
|
12043
|
-
const props$
|
|
12491
|
+
const props$k = {
|
|
12044
12492
|
inverted: {
|
|
12045
12493
|
type: Boolean,
|
|
12046
12494
|
default: false
|
|
@@ -12095,11 +12543,11 @@
|
|
|
12095
12543
|
);
|
|
12096
12544
|
return keys;
|
|
12097
12545
|
};
|
|
12098
|
-
const COMPONENT_NAME$
|
|
12546
|
+
const COMPONENT_NAME$q = "vc-recycle-list-container";
|
|
12099
12547
|
const transformKey = prefixStyle("transform").camel;
|
|
12100
12548
|
const Container = /* @__PURE__ */ vue.defineComponent({
|
|
12101
|
-
name: COMPONENT_NAME$
|
|
12102
|
-
props: props$
|
|
12549
|
+
name: COMPONENT_NAME$q,
|
|
12550
|
+
props: props$k,
|
|
12103
12551
|
emits: ["refresh"],
|
|
12104
12552
|
setup(props2, {
|
|
12105
12553
|
slots
|
|
@@ -12191,16 +12639,16 @@
|
|
|
12191
12639
|
};
|
|
12192
12640
|
}
|
|
12193
12641
|
});
|
|
12194
|
-
const COMPONENT_NAME$
|
|
12642
|
+
const COMPONENT_NAME$p = "vc-recycle-list-item";
|
|
12195
12643
|
const Item = /* @__PURE__ */ vue.defineComponent({
|
|
12196
|
-
name: COMPONENT_NAME$
|
|
12644
|
+
name: COMPONENT_NAME$p,
|
|
12197
12645
|
props: {
|
|
12198
12646
|
vertical: {
|
|
12199
12647
|
type: Boolean,
|
|
12200
12648
|
default: true
|
|
12201
12649
|
}
|
|
12202
12650
|
},
|
|
12203
|
-
emits: ["resize"],
|
|
12651
|
+
emits: ["resize", "change"],
|
|
12204
12652
|
setup(_, {
|
|
12205
12653
|
emit,
|
|
12206
12654
|
slots
|
|
@@ -12212,9 +12660,10 @@
|
|
|
12212
12660
|
const handleResize = () => {
|
|
12213
12661
|
const v = current.value.getBoundingClientRect()[K.size];
|
|
12214
12662
|
const changed = offsetSize.value != v;
|
|
12215
|
-
if (
|
|
12663
|
+
if (changed) {
|
|
12216
12664
|
offsetSize.value = v;
|
|
12217
|
-
emit("resize");
|
|
12665
|
+
hasInitial && emit("resize", v);
|
|
12666
|
+
emit("change", v);
|
|
12218
12667
|
}
|
|
12219
12668
|
hasInitial = true;
|
|
12220
12669
|
};
|
|
@@ -12232,10 +12681,10 @@
|
|
|
12232
12681
|
};
|
|
12233
12682
|
}
|
|
12234
12683
|
});
|
|
12235
|
-
const COMPONENT_NAME$
|
|
12684
|
+
const COMPONENT_NAME$o = "vc-recycle-list";
|
|
12236
12685
|
const RecycleList = /* @__PURE__ */ vue.defineComponent({
|
|
12237
|
-
name: COMPONENT_NAME$
|
|
12238
|
-
props: props$
|
|
12686
|
+
name: COMPONENT_NAME$o,
|
|
12687
|
+
props: props$o,
|
|
12239
12688
|
emits: ["scroll"],
|
|
12240
12689
|
setup(props2, {
|
|
12241
12690
|
slots,
|
|
@@ -12736,17 +13185,17 @@
|
|
|
12736
13185
|
}
|
|
12737
13186
|
});
|
|
12738
13187
|
const MRecycleList = RecycleList;
|
|
12739
|
-
const props$
|
|
13188
|
+
const props$j = {
|
|
12740
13189
|
tag: {
|
|
12741
13190
|
type: String,
|
|
12742
13191
|
default: "div"
|
|
12743
13192
|
}
|
|
12744
13193
|
};
|
|
12745
|
-
const COMPONENT_NAME$
|
|
13194
|
+
const COMPONENT_NAME$n = "vc-resizer";
|
|
12746
13195
|
const Resizer = vue.defineComponent({
|
|
12747
|
-
name: COMPONENT_NAME$
|
|
12748
|
-
props: props$
|
|
12749
|
-
emit: ["resize"],
|
|
13196
|
+
name: COMPONENT_NAME$n,
|
|
13197
|
+
props: props$j,
|
|
13198
|
+
emit: ["resize", "change"],
|
|
12750
13199
|
setup(props2, { emit, slots }) {
|
|
12751
13200
|
const width = vue.ref(0);
|
|
12752
13201
|
const height = vue.ref(0);
|
|
@@ -12772,8 +13221,9 @@
|
|
|
12772
13221
|
const widthChanged = width.value != width$;
|
|
12773
13222
|
heightChanged && (height.value = height$);
|
|
12774
13223
|
widthChanged && (width.value = width$);
|
|
12775
|
-
if (
|
|
12776
|
-
emit("resize", currentExposed.value);
|
|
13224
|
+
if (heightChanged || widthChanged) {
|
|
13225
|
+
hasInitial && emit("resize", currentExposed.value);
|
|
13226
|
+
emit("change", currentExposed.value);
|
|
12777
13227
|
}
|
|
12778
13228
|
hasInitial = true;
|
|
12779
13229
|
};
|
|
@@ -12797,16 +13247,16 @@
|
|
|
12797
13247
|
});
|
|
12798
13248
|
const MResizer = Resizer;
|
|
12799
13249
|
const MScroller = Scroller;
|
|
12800
|
-
const props$
|
|
13250
|
+
const props$i = {
|
|
12801
13251
|
tag: {
|
|
12802
13252
|
type: String,
|
|
12803
13253
|
default: "div"
|
|
12804
13254
|
}
|
|
12805
13255
|
};
|
|
12806
|
-
const COMPONENT_NAME$
|
|
13256
|
+
const COMPONENT_NAME$m = "vc-select";
|
|
12807
13257
|
const Select = /* @__PURE__ */ vue.defineComponent({
|
|
12808
|
-
name: COMPONENT_NAME$
|
|
12809
|
-
props: props$
|
|
13258
|
+
name: COMPONENT_NAME$m,
|
|
13259
|
+
props: props$i,
|
|
12810
13260
|
setup(props2, {
|
|
12811
13261
|
slots
|
|
12812
13262
|
}) {
|
|
@@ -12818,16 +13268,16 @@
|
|
|
12818
13268
|
}
|
|
12819
13269
|
});
|
|
12820
13270
|
const MSelect = Select;
|
|
12821
|
-
const props$
|
|
13271
|
+
const props$h = {
|
|
12822
13272
|
tag: {
|
|
12823
13273
|
type: String,
|
|
12824
13274
|
default: "div"
|
|
12825
13275
|
}
|
|
12826
13276
|
};
|
|
12827
|
-
const COMPONENT_NAME$
|
|
13277
|
+
const COMPONENT_NAME$l = "vc-slider";
|
|
12828
13278
|
const Slider = /* @__PURE__ */ vue.defineComponent({
|
|
12829
|
-
name: COMPONENT_NAME$
|
|
12830
|
-
props: props$
|
|
13279
|
+
name: COMPONENT_NAME$l,
|
|
13280
|
+
props: props$h,
|
|
12831
13281
|
setup(props2, {
|
|
12832
13282
|
slots
|
|
12833
13283
|
}) {
|
|
@@ -12839,16 +13289,16 @@
|
|
|
12839
13289
|
}
|
|
12840
13290
|
});
|
|
12841
13291
|
const MSlider = Slider;
|
|
12842
|
-
const props$
|
|
13292
|
+
const props$g = {
|
|
12843
13293
|
tag: {
|
|
12844
13294
|
type: String,
|
|
12845
13295
|
default: "div"
|
|
12846
13296
|
}
|
|
12847
13297
|
};
|
|
12848
|
-
const COMPONENT_NAME$
|
|
13298
|
+
const COMPONENT_NAME$k = "vc-sort-list";
|
|
12849
13299
|
const SortList = /* @__PURE__ */ vue.defineComponent({
|
|
12850
|
-
name: COMPONENT_NAME$
|
|
12851
|
-
props: props$
|
|
13300
|
+
name: COMPONENT_NAME$k,
|
|
13301
|
+
props: props$g,
|
|
12852
13302
|
setup(props2, {
|
|
12853
13303
|
slots
|
|
12854
13304
|
}) {
|
|
@@ -12860,16 +13310,16 @@
|
|
|
12860
13310
|
}
|
|
12861
13311
|
});
|
|
12862
13312
|
const MSortList = SortList;
|
|
12863
|
-
const props$
|
|
13313
|
+
const props$f = {
|
|
12864
13314
|
tag: {
|
|
12865
13315
|
type: String,
|
|
12866
13316
|
default: "div"
|
|
12867
13317
|
}
|
|
12868
13318
|
};
|
|
12869
|
-
const COMPONENT_NAME$
|
|
13319
|
+
const COMPONENT_NAME$j = "vc-steps";
|
|
12870
13320
|
const Steps = /* @__PURE__ */ vue.defineComponent({
|
|
12871
|
-
name: COMPONENT_NAME$
|
|
12872
|
-
props: props$
|
|
13321
|
+
name: COMPONENT_NAME$j,
|
|
13322
|
+
props: props$f,
|
|
12873
13323
|
setup(props2, {
|
|
12874
13324
|
slots
|
|
12875
13325
|
}) {
|
|
@@ -12881,16 +13331,16 @@
|
|
|
12881
13331
|
}
|
|
12882
13332
|
});
|
|
12883
13333
|
const MSteps = Steps;
|
|
12884
|
-
const props$
|
|
13334
|
+
const props$e = {
|
|
12885
13335
|
tag: {
|
|
12886
13336
|
type: String,
|
|
12887
13337
|
default: "div"
|
|
12888
13338
|
}
|
|
12889
13339
|
};
|
|
12890
|
-
const COMPONENT_NAME$
|
|
13340
|
+
const COMPONENT_NAME$i = "vc-switch";
|
|
12891
13341
|
const Switch = /* @__PURE__ */ vue.defineComponent({
|
|
12892
|
-
name: COMPONENT_NAME$
|
|
12893
|
-
props: props$
|
|
13342
|
+
name: COMPONENT_NAME$i,
|
|
13343
|
+
props: props$e,
|
|
12894
13344
|
setup(props2, {
|
|
12895
13345
|
slots
|
|
12896
13346
|
}) {
|
|
@@ -12902,16 +13352,16 @@
|
|
|
12902
13352
|
}
|
|
12903
13353
|
});
|
|
12904
13354
|
const MSwitch = Switch;
|
|
12905
|
-
const props$
|
|
13355
|
+
const props$d = {
|
|
12906
13356
|
tag: {
|
|
12907
13357
|
type: String,
|
|
12908
13358
|
default: "div"
|
|
12909
13359
|
}
|
|
12910
13360
|
};
|
|
12911
|
-
const COMPONENT_NAME$
|
|
13361
|
+
const COMPONENT_NAME$h = "vc-table";
|
|
12912
13362
|
const Table = /* @__PURE__ */ vue.defineComponent({
|
|
12913
|
-
name: COMPONENT_NAME$
|
|
12914
|
-
props: props$
|
|
13363
|
+
name: COMPONENT_NAME$h,
|
|
13364
|
+
props: props$d,
|
|
12915
13365
|
setup(props2, {
|
|
12916
13366
|
slots
|
|
12917
13367
|
}) {
|
|
@@ -12923,7 +13373,7 @@
|
|
|
12923
13373
|
}
|
|
12924
13374
|
});
|
|
12925
13375
|
const MTable = Table;
|
|
12926
|
-
const props$
|
|
13376
|
+
const props$c = {
|
|
12927
13377
|
type: {
|
|
12928
13378
|
type: String,
|
|
12929
13379
|
validator: (v) => /^(line|card)$/.test(v),
|
|
@@ -13030,7 +13480,7 @@
|
|
|
13030
13480
|
if (!item) return;
|
|
13031
13481
|
list.value.splice(list.value.indexOf(item.props), 1);
|
|
13032
13482
|
};
|
|
13033
|
-
vue.provide("tabs", {
|
|
13483
|
+
vue.provide("vc-tabs", {
|
|
13034
13484
|
props: props2,
|
|
13035
13485
|
currentValue,
|
|
13036
13486
|
refresh,
|
|
@@ -13074,10 +13524,10 @@
|
|
|
13074
13524
|
handleChange
|
|
13075
13525
|
};
|
|
13076
13526
|
};
|
|
13077
|
-
const COMPONENT_NAME$
|
|
13527
|
+
const COMPONENT_NAME$g = "vc-tabs";
|
|
13078
13528
|
const Tabs = /* @__PURE__ */ vue.defineComponent({
|
|
13079
|
-
name: COMPONENT_NAME$
|
|
13080
|
-
props: props$
|
|
13529
|
+
name: COMPONENT_NAME$g,
|
|
13530
|
+
props: props$c,
|
|
13081
13531
|
emits: ["update:modelValue", "change", "click"],
|
|
13082
13532
|
setup(props2, {
|
|
13083
13533
|
slots
|
|
@@ -13222,7 +13672,7 @@
|
|
|
13222
13672
|
};
|
|
13223
13673
|
}
|
|
13224
13674
|
});
|
|
13225
|
-
const props$
|
|
13675
|
+
const props$b = {
|
|
13226
13676
|
value: {
|
|
13227
13677
|
type: [String, Number]
|
|
13228
13678
|
},
|
|
@@ -13248,7 +13698,7 @@
|
|
|
13248
13698
|
const { props: props2 } = instance;
|
|
13249
13699
|
const currentValue = vue.ref(void 0);
|
|
13250
13700
|
const isLoaded = vue.ref(false);
|
|
13251
|
-
const tabs = vue.inject("tabs", {});
|
|
13701
|
+
const tabs = vue.inject("vc-tabs", {});
|
|
13252
13702
|
const isActive = vue.computed(() => {
|
|
13253
13703
|
const state = tabs.currentValue.value === (props2.value || currentValue.value);
|
|
13254
13704
|
if (!isLoaded.value && state) {
|
|
@@ -13300,10 +13750,10 @@
|
|
|
13300
13750
|
currentValue
|
|
13301
13751
|
};
|
|
13302
13752
|
};
|
|
13303
|
-
const COMPONENT_NAME$
|
|
13753
|
+
const COMPONENT_NAME$f = "vc-tabs-pane";
|
|
13304
13754
|
const TabsPane = /* @__PURE__ */ vue.defineComponent({
|
|
13305
|
-
name: COMPONENT_NAME$
|
|
13306
|
-
props: props$
|
|
13755
|
+
name: COMPONENT_NAME$f,
|
|
13756
|
+
props: props$b,
|
|
13307
13757
|
setup(_, {
|
|
13308
13758
|
slots
|
|
13309
13759
|
}) {
|
|
@@ -13317,8 +13767,289 @@
|
|
|
13317
13767
|
};
|
|
13318
13768
|
}
|
|
13319
13769
|
});
|
|
13320
|
-
const
|
|
13321
|
-
|
|
13770
|
+
const props$a = {
|
|
13771
|
+
...props$c,
|
|
13772
|
+
theme: {
|
|
13773
|
+
type: String,
|
|
13774
|
+
default: "light",
|
|
13775
|
+
validator: (v) => /(light|dark)/.test(v)
|
|
13776
|
+
},
|
|
13777
|
+
barStyle: {
|
|
13778
|
+
type: [Object, Array],
|
|
13779
|
+
default: () => ({})
|
|
13780
|
+
},
|
|
13781
|
+
autoAfloatWidth: {
|
|
13782
|
+
type: Boolean,
|
|
13783
|
+
default: true
|
|
13784
|
+
},
|
|
13785
|
+
average: {
|
|
13786
|
+
type: Boolean,
|
|
13787
|
+
default: true
|
|
13788
|
+
},
|
|
13789
|
+
showWrapper: {
|
|
13790
|
+
type: Boolean,
|
|
13791
|
+
default: true
|
|
13792
|
+
},
|
|
13793
|
+
sticky: {
|
|
13794
|
+
type: Boolean,
|
|
13795
|
+
default: false
|
|
13796
|
+
},
|
|
13797
|
+
offsetTop: {
|
|
13798
|
+
type: Number,
|
|
13799
|
+
default: 0
|
|
13800
|
+
},
|
|
13801
|
+
showStep: {
|
|
13802
|
+
type: Boolean,
|
|
13803
|
+
default: false
|
|
13804
|
+
}
|
|
13805
|
+
};
|
|
13806
|
+
const COMPONENT_NAME$e = "vcm-tabs";
|
|
13807
|
+
const MTabs = /* @__PURE__ */ vue.defineComponent({
|
|
13808
|
+
name: COMPONENT_NAME$e,
|
|
13809
|
+
props: props$a,
|
|
13810
|
+
emits: ["update:modelValue", "change", "click"],
|
|
13811
|
+
setup(props2, {
|
|
13812
|
+
slots
|
|
13813
|
+
}) {
|
|
13814
|
+
const instance = vue.getCurrentInstance();
|
|
13815
|
+
const wrapper = vue.ref(null);
|
|
13816
|
+
const content = vue.ref(null);
|
|
13817
|
+
const scroll = vue.ref(null);
|
|
13818
|
+
const nav = vue.ref(null);
|
|
13819
|
+
const top = vue.ref(0);
|
|
13820
|
+
const isFixed = vue.ref(false);
|
|
13821
|
+
const placeholderH = vue.ref(53);
|
|
13822
|
+
const startX = vue.ref(0);
|
|
13823
|
+
const isTouching = vue.ref(false);
|
|
13824
|
+
const scrollViewW = vue.ref(0);
|
|
13825
|
+
const scrollContentW = vue.ref(0);
|
|
13826
|
+
const baseX = vue.ref(0);
|
|
13827
|
+
const isDark = vue.computed(() => {
|
|
13828
|
+
return props2.theme === "dark";
|
|
13829
|
+
});
|
|
13830
|
+
const fixedStyle = vue.computed(() => {
|
|
13831
|
+
return isFixed.value ? {
|
|
13832
|
+
top: `${props2.offsetTop}px`
|
|
13833
|
+
} : {};
|
|
13834
|
+
});
|
|
13835
|
+
let tabs;
|
|
13836
|
+
const handleScroll = throttle$2(() => {
|
|
13837
|
+
isFixed.value = document.scrollingElement.scrollTop + props2.offsetTop > top.value;
|
|
13838
|
+
}, 100);
|
|
13839
|
+
const handleTouchstart = (e) => {
|
|
13840
|
+
isTouching.value = true;
|
|
13841
|
+
startX.value = e.touches[0].pageX;
|
|
13842
|
+
baseX.value = tabs.scrollOffset.value;
|
|
13843
|
+
};
|
|
13844
|
+
const handleTouchmove = throttle$2((e) => {
|
|
13845
|
+
const touchPageX = e.touches[0].pageX;
|
|
13846
|
+
const changedX = touchPageX - startX.value;
|
|
13847
|
+
if (changedX > 0) {
|
|
13848
|
+
if (tabs.scrollOffset.value >= 0) {
|
|
13849
|
+
tabs.scrollOffset.value = 0;
|
|
13850
|
+
return;
|
|
13851
|
+
}
|
|
13852
|
+
} else if (Math.abs(tabs.scrollOffset.value) + scrollViewW.value >= scrollContentW.value) {
|
|
13853
|
+
tabs.scrollOffset.value = -(scrollContentW.value - scrollViewW.value);
|
|
13854
|
+
return;
|
|
13855
|
+
}
|
|
13856
|
+
tabs.scrollOffset.value = baseX.value + touchPageX - startX.value;
|
|
13857
|
+
}, 17);
|
|
13858
|
+
const handleTouchend = () => {
|
|
13859
|
+
isTouching.value = false;
|
|
13860
|
+
};
|
|
13861
|
+
const handleStep = (flag) => {
|
|
13862
|
+
if (!tabs.scrollable.value) return;
|
|
13863
|
+
const moveX = flag * scrollViewW.value;
|
|
13864
|
+
let offsetX = tabs.scrollOffset.value + moveX;
|
|
13865
|
+
if (offsetX < -(scrollContentW.value - scrollViewW.value) || offsetX > 0) {
|
|
13866
|
+
offsetX = flag === -1 ? -(scrollContentW.value - scrollViewW.value) : 0;
|
|
13867
|
+
}
|
|
13868
|
+
tabs.scrollOffset.value = offsetX;
|
|
13869
|
+
};
|
|
13870
|
+
const refreshTop = debounce$1(() => {
|
|
13871
|
+
if (props2.sticky) {
|
|
13872
|
+
top.value = content.value.offsetTop - placeholderH.value;
|
|
13873
|
+
isFixed.value = document.scrollingElement.scrollTop + props2.offsetTop > top.value;
|
|
13874
|
+
}
|
|
13875
|
+
}, 250, {
|
|
13876
|
+
leading: true,
|
|
13877
|
+
trailing: true
|
|
13878
|
+
});
|
|
13879
|
+
const scrollToActive = () => {
|
|
13880
|
+
if (!tabs.scrollable.value) return;
|
|
13881
|
+
const activeEl = instance.vnode.el.querySelector(`.vcm-tabs__item[data-id="${tabs.currentValue.value}"]`);
|
|
13882
|
+
if (!activeEl) return;
|
|
13883
|
+
const contentEl = nav.value;
|
|
13884
|
+
const activeRect = activeEl.getBoundingClientRect();
|
|
13885
|
+
const viewRect = scroll.value.getBoundingClientRect();
|
|
13886
|
+
const contentRect = contentEl.getBoundingClientRect();
|
|
13887
|
+
let offset = 0;
|
|
13888
|
+
if (activeRect.width < viewRect.width) {
|
|
13889
|
+
const targetOffset = (viewRect.width - activeRect.width) / 2;
|
|
13890
|
+
const offsetLeft = activeRect.left - contentRect.left;
|
|
13891
|
+
if (offsetLeft - viewRect.left <= targetOffset) {
|
|
13892
|
+
offset = 0;
|
|
13893
|
+
} else if (contentRect.right - activeRect.right <= targetOffset) {
|
|
13894
|
+
offset = viewRect.width - contentRect.width;
|
|
13895
|
+
} else {
|
|
13896
|
+
offset = targetOffset - offsetLeft;
|
|
13897
|
+
}
|
|
13898
|
+
}
|
|
13899
|
+
tabs.scrollOffset.value = offset;
|
|
13900
|
+
};
|
|
13901
|
+
const operateDOMScrollEvents = (type) => {
|
|
13902
|
+
const fn = type === "add" ? window.addEventListener : window.removeEventListener;
|
|
13903
|
+
fn("scroll", handleScroll);
|
|
13904
|
+
fn("touchstart", handleTouchstart, false);
|
|
13905
|
+
fn("touchmove", handleTouchmove, false);
|
|
13906
|
+
fn("touchend", handleTouchend, false);
|
|
13907
|
+
};
|
|
13908
|
+
const refreshScroll = () => {
|
|
13909
|
+
const viewEl = scroll.value;
|
|
13910
|
+
scrollViewW.value = viewEl.offsetWidth;
|
|
13911
|
+
scrollContentW.value = nav.value.offsetWidth;
|
|
13912
|
+
if (scrollContentW.value > scrollViewW.value) {
|
|
13913
|
+
operateDOMScrollEvents("remove");
|
|
13914
|
+
operateDOMScrollEvents("add");
|
|
13915
|
+
tabs.scrollable.value = true;
|
|
13916
|
+
} else if (tabs.scrollable.value) {
|
|
13917
|
+
operateDOMScrollEvents("remove");
|
|
13918
|
+
tabs.scrollable.value = false;
|
|
13919
|
+
}
|
|
13920
|
+
tabs.scrollable.value && scrollToActive();
|
|
13921
|
+
};
|
|
13922
|
+
const refreshAfloat = () => {
|
|
13923
|
+
if (!props2.showWrapper) return;
|
|
13924
|
+
vue.nextTick(() => {
|
|
13925
|
+
const index = tabs.getTabIndex(tabs.currentValue.value);
|
|
13926
|
+
if (instance.isUnmounted) return;
|
|
13927
|
+
const items = nav.value.querySelectorAll(`.vcm-tabs__item`);
|
|
13928
|
+
const $2 = items[index];
|
|
13929
|
+
tabs.afloatWidth.value = $2 ? isDark.value ? 20 : props2.autoAfloatWidth ? $2.querySelector("span").offsetWidth : $2.offsetWidth : 0;
|
|
13930
|
+
if (!Array.from(items).length) return;
|
|
13931
|
+
let offset = 0;
|
|
13932
|
+
const basicOffset = $2 ? ($2.offsetWidth - tabs.afloatWidth.value) / 2 : 0;
|
|
13933
|
+
if (index > 0) {
|
|
13934
|
+
for (let i = 0; i < index; i++) {
|
|
13935
|
+
offset += parseFloat(items[i].offsetWidth);
|
|
13936
|
+
}
|
|
13937
|
+
}
|
|
13938
|
+
tabs.afloatOffset.value = offset + basicOffset;
|
|
13939
|
+
refreshScroll();
|
|
13940
|
+
});
|
|
13941
|
+
};
|
|
13942
|
+
const operateDOMEvents = (type) => {
|
|
13943
|
+
if (!props2.sticky) return;
|
|
13944
|
+
const fn = type === "add" ? window.addEventListener : window.removeEventListener;
|
|
13945
|
+
fn("scroll", handleScroll);
|
|
13946
|
+
};
|
|
13947
|
+
tabs = useTabs({
|
|
13948
|
+
content,
|
|
13949
|
+
wrapper,
|
|
13950
|
+
refreshAfloat,
|
|
13951
|
+
refreshScroll,
|
|
13952
|
+
scrollToActive
|
|
13953
|
+
});
|
|
13954
|
+
const scrollStyle = vue.computed(() => {
|
|
13955
|
+
return {
|
|
13956
|
+
transition: isTouching.value ? "" : "transform 300ms ease-in-out",
|
|
13957
|
+
transform: `translate3d(${tabs.scrollOffset.value}px, 0, 0)`
|
|
13958
|
+
};
|
|
13959
|
+
});
|
|
13960
|
+
vue.onMounted(() => {
|
|
13961
|
+
refreshTop();
|
|
13962
|
+
operateDOMEvents("add");
|
|
13963
|
+
vue.nextTick(refreshScroll);
|
|
13964
|
+
});
|
|
13965
|
+
vue.onUpdated(refreshTop);
|
|
13966
|
+
vue.onUnmounted(() => {
|
|
13967
|
+
operateDOMEvents("remove");
|
|
13968
|
+
operateDOMScrollEvents("remove");
|
|
13969
|
+
});
|
|
13970
|
+
vue.watch(() => props2.theme, refreshAfloat);
|
|
13971
|
+
vue.watch(() => props2.average, refreshAfloat);
|
|
13972
|
+
vue.watch(() => props2.showStep, () => vue.nextTick(refreshScroll));
|
|
13973
|
+
return () => {
|
|
13974
|
+
return vue.createVNode("div", {
|
|
13975
|
+
"class": [tabs.classes.value, "vcm-tabs"]
|
|
13976
|
+
}, [props2.showWrapper && vue.createVNode("div", {
|
|
13977
|
+
"ref": wrapper,
|
|
13978
|
+
"style": [props2.barStyle, fixedStyle.value],
|
|
13979
|
+
"class": [{
|
|
13980
|
+
"is-fixed": isFixed
|
|
13981
|
+
}, "vcm-tabs__bar"]
|
|
13982
|
+
}, [vue.createVNode("slot", {
|
|
13983
|
+
"name": "prepend"
|
|
13984
|
+
}, null), slots.prepend?.(), props2.showStep && tabs.scrollable.value && vue.createVNode("div", {
|
|
13985
|
+
"class": "vcm-tabs__step is-left",
|
|
13986
|
+
"onClick": () => handleStep(1)
|
|
13987
|
+
}, [vue.createVNode(Icon, {
|
|
13988
|
+
"type": "left"
|
|
13989
|
+
}, null)]), vue.createVNode("div", {
|
|
13990
|
+
"ref": scroll,
|
|
13991
|
+
"class": "vcm-tabs__scroll"
|
|
13992
|
+
}, [vue.createVNode("div", {
|
|
13993
|
+
"ref": nav,
|
|
13994
|
+
"style": scrollStyle.value,
|
|
13995
|
+
"class": "vcm-tabs__nav"
|
|
13996
|
+
}, [props2.afloat && vue.createVNode("div", {
|
|
13997
|
+
"style": tabs.afloatStyle.value,
|
|
13998
|
+
"class": "vcm-tabs__afloat"
|
|
13999
|
+
}, null), tabs.list.value.map((item, index) => {
|
|
14000
|
+
return vue.createVNode("div", {
|
|
14001
|
+
"key": index,
|
|
14002
|
+
"data-id": item.value,
|
|
14003
|
+
"class": [{
|
|
14004
|
+
"is-active": (item.value || index) == tabs.currentValue.value,
|
|
14005
|
+
"is-average": props2.average
|
|
14006
|
+
}, "vcm-tabs__item"],
|
|
14007
|
+
"onClick": () => tabs.handleChange(index)
|
|
14008
|
+
}, [slots.label ? slots.label({
|
|
14009
|
+
it: item,
|
|
14010
|
+
index
|
|
14011
|
+
}) : typeof item.label === "string" ? vue.createVNode("span", {
|
|
14012
|
+
"innerHTML": item.label
|
|
14013
|
+
}, null) : typeof item.label === "function" && vue.createVNode(Customer, {
|
|
14014
|
+
"render": item.label,
|
|
14015
|
+
"it": item,
|
|
14016
|
+
"index": index
|
|
14017
|
+
}, null)]);
|
|
14018
|
+
})])]), props2.showStep && tabs.scrollable.value && vue.createVNode("div", {
|
|
14019
|
+
"class": "vcm-tabs__step is-right",
|
|
14020
|
+
"onClick": () => handleStep(-1)
|
|
14021
|
+
}, [vue.createVNode(Icon, {
|
|
14022
|
+
"type": "right"
|
|
14023
|
+
}, null)]), slots.append?.()]), isFixed.value && vue.createVNode("div", {
|
|
14024
|
+
"style": {
|
|
14025
|
+
height: `${placeholderH.value}px`
|
|
14026
|
+
},
|
|
14027
|
+
"class": "vcm-tabs__placeholder"
|
|
14028
|
+
}, null), vue.createVNode("div", {
|
|
14029
|
+
"ref": content,
|
|
14030
|
+
"style": tabs.contentStyle.value,
|
|
14031
|
+
"class": "vcm-tabs__content"
|
|
14032
|
+
}, [slots.default?.()])]);
|
|
14033
|
+
};
|
|
14034
|
+
}
|
|
14035
|
+
});
|
|
14036
|
+
const COMPONENT_NAME$d = "vcm-tabs-pane";
|
|
14037
|
+
const MTabsPane = /* @__PURE__ */ vue.defineComponent({
|
|
14038
|
+
name: COMPONENT_NAME$d,
|
|
14039
|
+
props: props$b,
|
|
14040
|
+
setup(_, {
|
|
14041
|
+
slots
|
|
14042
|
+
}) {
|
|
14043
|
+
const tabsPane = useTabsPane();
|
|
14044
|
+
return () => {
|
|
14045
|
+
return vue.createVNode("div", {
|
|
14046
|
+
"class": "vcm-tabs-pane",
|
|
14047
|
+
"style": tabsPane.style.value,
|
|
14048
|
+
"name": tabsPane.currentValue.value
|
|
14049
|
+
}, [tabsPane.isReady && slots.default?.()]);
|
|
14050
|
+
};
|
|
14051
|
+
}
|
|
14052
|
+
});
|
|
13322
14053
|
const props$9 = {
|
|
13323
14054
|
tag: {
|
|
13324
14055
|
type: String,
|
|
@@ -13740,8 +14471,8 @@
|
|
|
13740
14471
|
MDebounce: Debounce,
|
|
13741
14472
|
Divider,
|
|
13742
14473
|
MDivider,
|
|
13743
|
-
|
|
13744
|
-
|
|
14474
|
+
DrawerView,
|
|
14475
|
+
MDrawerView,
|
|
13745
14476
|
Dropdown,
|
|
13746
14477
|
MDropdown,
|
|
13747
14478
|
// DropdownItem,
|
|
@@ -13784,8 +14515,8 @@
|
|
|
13784
14515
|
MListItem,
|
|
13785
14516
|
Marquee,
|
|
13786
14517
|
MMarquee,
|
|
13787
|
-
|
|
13788
|
-
|
|
14518
|
+
ModalView,
|
|
14519
|
+
MModalView,
|
|
13789
14520
|
Notice: Notice$1,
|
|
13790
14521
|
MNotice,
|
|
13791
14522
|
Option,
|
|
@@ -94019,6 +94750,7 @@
|
|
|
94019
94750
|
exports.Checkbox = Checkbox;
|
|
94020
94751
|
exports.Clipboard = Clipboard;
|
|
94021
94752
|
exports.Collapse = Collapse;
|
|
94753
|
+
exports.CollapseItem = CollapseItem;
|
|
94022
94754
|
exports.ColorPicker = ColorPicker;
|
|
94023
94755
|
exports.Components = Components;
|
|
94024
94756
|
exports.Countdown = Countdown;
|
|
@@ -94026,7 +94758,8 @@
|
|
|
94026
94758
|
exports.DatePicker = DatePicker;
|
|
94027
94759
|
exports.Debounce = Debounce;
|
|
94028
94760
|
exports.Divider = Divider;
|
|
94029
|
-
exports.Drawer =
|
|
94761
|
+
exports.Drawer = drawer;
|
|
94762
|
+
exports.DrawerView = DrawerView;
|
|
94030
94763
|
exports.Dropdown = Dropdown;
|
|
94031
94764
|
exports.Editor = Editor;
|
|
94032
94765
|
exports.Expand = Expand;
|
|
@@ -94058,13 +94791,14 @@
|
|
|
94058
94791
|
exports.MCheckbox = MCheckbox;
|
|
94059
94792
|
exports.MClipboard = MClipboard;
|
|
94060
94793
|
exports.MCollapse = MCollapse;
|
|
94794
|
+
exports.MCollapseItem = MCollapseItem;
|
|
94061
94795
|
exports.MColorPicker = MColorPicker;
|
|
94062
94796
|
exports.MCountdown = MCountdown;
|
|
94063
94797
|
exports.MCustomer = MCustomer;
|
|
94064
94798
|
exports.MDatePicker = MDatePicker;
|
|
94065
94799
|
exports.MDebounce = Debounce;
|
|
94066
94800
|
exports.MDivider = MDivider;
|
|
94067
|
-
exports.
|
|
94801
|
+
exports.MDrawerView = MDrawerView;
|
|
94068
94802
|
exports.MDropdown = MDropdown;
|
|
94069
94803
|
exports.MEditor = MEditor;
|
|
94070
94804
|
exports.MExpand = MExpand;
|