@vunk/form 1.1.65 → 1.1.66
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/component.d.ts +1 -1
- package/components/button/index.css +1 -0
- package/components/button/index.d.ts +1 -1
- package/components/button/index.js +43 -57
- package/components/button/src/ctx.d.ts +13 -13
- package/components/button/src/ctx.js +1 -39
- package/components/button/src/index.css +1 -0
- package/components/button/src/index.vue.d.ts +37 -73
- package/components/button/src/types.d.ts +1 -1
- package/components/cascader/index.css +1 -0
- package/components/cascader/index.d.ts +1 -1
- package/components/cascader/index.js +34 -49
- package/components/cascader/src/ctx.d.ts +15 -15
- package/components/cascader/src/ctx.js +1 -38
- package/components/cascader/src/index.css +1 -0
- package/components/cascader/src/index.vue.d.ts +45 -70
- package/components/cascader/src/use.d.ts +1 -1
- package/components/cascader/src/use.js +1 -28
- package/components/checkbox/index.css +1 -0
- package/components/checkbox/index.d.ts +1 -1
- package/components/checkbox/index.js +48 -53
- package/components/checkbox/src/ctx.d.ts +14 -14
- package/components/checkbox/src/ctx.js +1 -46
- package/components/checkbox/src/index.css +1 -0
- package/components/checkbox/src/index.vue.d.ts +43 -63
- package/components/color-picker/index.css +1 -0
- package/components/color-picker/index.d.ts +1 -1
- package/components/color-picker/index.js +38 -42
- package/components/color-picker/src/ctx.d.ts +15 -13
- package/components/color-picker/src/ctx.js +1 -23
- package/components/color-picker/src/index.css +1 -0
- package/components/color-picker/src/index.vue.d.ts +36 -65
- package/components/date-picker/index.css +1 -0
- package/components/date-picker/index.d.ts +1 -1
- package/components/date-picker/index.js +42 -55
- package/components/date-picker/src/ctx.d.ts +41 -34
- package/components/date-picker/src/ctx.js +1 -31
- package/components/date-picker/src/index.css +1 -0
- package/components/date-picker/src/index.vue.d.ts +122 -133
- package/components/date-picker/src/types.d.ts +9 -9
- package/components/date-picker/src/types.js +1 -11
- package/components/esri-input-geojson/index.css +8 -6
- package/components/esri-input-geojson/index.d.ts +1 -1
- package/components/esri-input-geojson/index.js +417 -535
- package/components/esri-input-geojson/src/append.vue.d.ts +7 -7
- package/components/esri-input-geojson/src/const.d.ts +1 -1
- package/components/esri-input-geojson/src/const.js +1 -33
- package/components/esri-input-geojson/src/ctx.d.ts +44 -35
- package/components/esri-input-geojson/src/ctx.js +1 -128
- package/components/esri-input-geojson/src/default-view.vue.d.ts +9 -9
- package/components/esri-input-geojson/src/index.css +1 -0
- package/components/esri-input-geojson/src/index.vue.d.ts +142 -119
- package/components/esri-input-geojson/src/types.d.ts +1 -0
- package/components/esri-input-geojson/src/viewer.vue.d.ts +23 -22
- package/components/form/index.css +1 -0
- package/components/form/index.d.ts +1 -1
- package/components/form/index.js +57 -87
- package/components/form/src/ctx.d.ts +176 -204
- package/components/form/src/ctx.js +1 -61
- package/components/form/src/index.css +1 -0
- package/components/form/src/index.vue.d.ts +515 -601
- package/components/form/src/types.d.ts +3 -3
- package/components/form/src/utils.d.ts +1 -1
- package/components/form/src/utils.js +1 -55
- package/components/form-item/index.css +1 -0
- package/components/form-item/index.d.ts +1 -1
- package/components/form-item/index.js +22 -50
- package/components/form-item/src/ctx.d.ts +9 -9
- package/components/form-item/src/ctx.js +1 -53
- package/components/form-item/src/index.css +1 -0
- package/components/form-item/src/index.vue.d.ts +26 -26
- package/components/form-item/src/types.d.ts +1 -1
- package/components/form-item-renderer/index.css +1 -0
- package/components/form-item-renderer/index.d.ts +1 -1
- package/components/form-item-renderer/index.js +10 -18
- package/components/form-item-renderer/src/ctx.d.ts +3 -3
- package/components/form-item-renderer/src/ctx.js +1 -16
- package/components/form-item-renderer/src/index.css +1 -0
- package/components/form-item-renderer/src/index.vue.d.ts +9 -9
- package/components/form-item-renderer/src/symbols.js +1 -3
- package/components/form-item-renderer-template/index.css +1 -0
- package/components/form-item-renderer-template/index.d.ts +1 -1
- package/components/form-item-renderer-template/index.js +6 -13
- package/components/form-item-renderer-template/src/ctx.js +1 -9
- package/components/form-item-renderer-template/src/index.css +1 -0
- package/components/form-item-renderer-template/src/index.vue.d.ts +2 -2
- package/components/geoinput/index.css +1 -0
- package/components/geoinput/index.d.ts +1 -1
- package/components/geoinput/index.js +45 -43
- package/components/geoinput/src/ctx.d.ts +42 -28
- package/components/geoinput/src/ctx.js +1 -39
- package/components/geoinput/src/index.css +1 -0
- package/components/geoinput/src/index.vue.d.ts +111 -223
- package/components/geoinput/src/types.d.ts +3 -3
- package/components/geoinput-read/index.css +1 -0
- package/components/geoinput-read/index.d.ts +1 -1
- package/components/geoinput-read/index.js +120 -160
- package/components/geoinput-read/src/append.vue.d.ts +4 -4
- package/components/geoinput-read/src/core.vue.d.ts +130 -104
- package/components/geoinput-read/src/ctx.d.ts +42 -30
- package/components/geoinput-read/src/ctx.js +1 -66
- package/components/geoinput-read/src/index.css +1 -0
- package/components/geoinput-read/src/index.vue.d.ts +108 -151
- package/components/geoinput-read/src/types.d.ts +1 -1
- package/components/geoinput-update/index.css +9 -7
- package/components/geoinput-update/index.d.ts +1 -1
- package/components/geoinput-update/index.js +335 -366
- package/components/geoinput-update/src/append.vue.d.ts +5 -5
- package/components/geoinput-update/src/ctx.d.ts +38 -28
- package/components/geoinput-update/src/ctx.js +1 -85
- package/components/geoinput-update/src/index.css +1 -0
- package/components/geoinput-update/src/index.vue.d.ts +120 -98
- package/components/geoinput-update/src/types.d.ts +2 -2
- package/components/input/index.css +1 -0
- package/components/input/index.d.ts +1 -1
- package/components/input/index.js +43 -60
- package/components/input/src/ctx.d.ts +31 -25
- package/components/input/src/ctx.js +1 -46
- package/components/input/src/index.css +1 -0
- package/components/input/src/index.vue.d.ts +94 -110
- package/components/input/src/types.d.ts +2 -2
- package/components/input-link/index.css +1 -0
- package/components/input-link/index.d.ts +1 -1
- package/components/input-link/index.js +71 -92
- package/components/input-link/src/ctx.d.ts +26 -20
- package/components/input-link/src/ctx.js +1 -66
- package/components/input-link/src/index.css +1 -0
- package/components/input-link/src/index.vue.d.ts +72 -116
- package/components/input-number/index.css +1 -0
- package/components/input-number/index.d.ts +1 -1
- package/components/input-number/index.js +37 -45
- package/components/input-number/src/ctx.d.ts +15 -15
- package/components/input-number/src/ctx.js +1 -38
- package/components/input-number/src/index.css +1 -0
- package/components/input-number/src/index.vue.d.ts +42 -65
- package/components/input-number/src/types.d.ts +1 -1
- package/components/radio/index.css +1 -0
- package/components/radio/index.d.ts +1 -1
- package/components/radio/index.js +45 -50
- package/components/radio/src/ctx.d.ts +11 -11
- package/components/radio/src/ctx.js +1 -39
- package/components/radio/src/index.css +1 -0
- package/components/radio/src/index.vue.d.ts +41 -60
- package/components/radio/src/types.d.ts +1 -1
- package/components/select/index.css +1 -0
- package/components/select/index.d.ts +1 -1
- package/components/select/index.js +59 -64
- package/components/select/src/ctx.d.ts +39 -41
- package/components/select/src/ctx.js +1 -40
- package/components/select/src/index.css +1 -0
- package/components/select/src/index.vue.d.ts +130 -162
- package/components/select/src/types.d.ts +2 -2
- package/components/slider/index.css +1 -0
- package/components/slider/index.d.ts +1 -1
- package/components/slider/index.js +33 -50
- package/components/slider/src/ctx.d.ts +18 -18
- package/components/slider/src/ctx.js +1 -29
- package/components/slider/src/index.css +1 -0
- package/components/slider/src/index.vue.d.ts +62 -81
- package/components/switch/index.css +1 -0
- package/components/switch/index.d.ts +1 -1
- package/components/switch/index.js +33 -50
- package/components/switch/src/ctx.d.ts +22 -22
- package/components/switch/src/ctx.js +1 -31
- package/components/switch/src/index.css +1 -0
- package/components/switch/src/index.vue.d.ts +65 -83
- package/components/switch/src/types.d.ts +1 -1
- package/components/templates-default/index.css +1 -0
- package/components/templates-default/index.d.ts +1 -1
- package/components/templates-default/index.js +243 -172
- package/components/templates-default/src/ctx.d.ts +1 -1
- package/components/templates-default/src/ctx.js +1 -18
- package/components/templates-default/src/index.css +1 -0
- package/components/templates-default/src/index.vue.d.ts +9 -9
- package/components/templates-default/src/types.d.ts +16 -16
- package/components/templates-element-plus/index.css +1 -0
- package/components/templates-element-plus/index.d.ts +1 -1
- package/components/templates-element-plus/index.js +66 -36
- package/components/templates-element-plus/src/ctx.js +1 -9
- package/components/templates-element-plus/src/index.css +1 -0
- package/components/templates-element-plus/src/index.vue.d.ts +7 -7
- package/components/templates-element-plus/src/types.d.ts +1 -1
- package/components/templates-esri/index.css +1 -0
- package/components/templates-esri/index.d.ts +1 -1
- package/components/templates-esri/index.js +25 -24
- package/components/templates-esri/src/ctx.d.ts +1 -1
- package/components/templates-esri/src/ctx.js +1 -11
- package/components/templates-esri/src/index.css +1 -0
- package/components/templates-esri/src/index.vue.d.ts +6 -6
- package/components/templates-esri/src/types.d.ts +1 -1
- package/components/templates-layout/index.css +1 -0
- package/components/templates-layout/index.d.ts +1 -1
- package/components/templates-layout/index.js +96 -63
- package/components/templates-layout/src/ctx.js +1 -9
- package/components/templates-layout/src/index.css +1 -0
- package/components/templates-layout/src/index.vue.d.ts +7 -7
- package/components/templates-layout/src/types.d.ts +3 -3
- package/components/templates-mapbox/index.css +1 -0
- package/components/templates-mapbox/index.d.ts +1 -1
- package/components/templates-mapbox/index.js +25 -24
- package/components/templates-mapbox/src/ctx.d.ts +1 -1
- package/components/templates-mapbox/src/ctx.js +1 -11
- package/components/templates-mapbox/src/index.css +1 -0
- package/components/templates-mapbox/src/index.vue.d.ts +6 -6
- package/components/templates-mapbox/src/types.d.ts +1 -1
- package/components/upload/index.css +11 -9
- package/components/upload/index.d.ts +1 -1
- package/components/upload/index.js +264 -289
- package/components/upload/src/ctx.d.ts +21 -16
- package/components/upload/src/ctx.js +1 -45
- package/components/upload/src/file.vue.d.ts +19 -19
- package/components/upload/src/index.css +1 -0
- package/components/upload/src/index.vue.d.ts +54 -62
- package/components/upload-plus/index.css +1 -0
- package/components/upload-plus/index.d.ts +1 -1
- package/components/upload-plus/index.js +911 -9539
- package/components/upload-plus/src/api.d.ts +3 -3
- package/components/upload-plus/src/api.js +21 -18114
- package/components/upload-plus/src/const.js +1 -12
- package/components/upload-plus/src/ctx.d.ts +13 -13
- package/components/upload-plus/src/ctx.js +1 -58
- package/components/upload-plus/src/index.css +1 -0
- package/components/upload-plus/src/index.vue.d.ts +31 -48
- package/components/upload-plus/src/types.d.ts +1 -1
- package/components/van-cascader/index.css +1 -0
- package/components/van-cascader/index.d.ts +1 -1
- package/components/van-cascader/index.js +47 -55
- package/components/van-cascader/src/ctx.d.ts +13 -13
- package/components/van-cascader/src/ctx.js +1 -22
- package/components/van-cascader/src/index.css +1 -0
- package/components/van-cascader/src/index.vue.d.ts +40 -57
- package/components/var-datetime-picker/index.css +1 -0
- package/components/var-datetime-picker/index.d.ts +1 -1
- package/components/var-datetime-picker/index.js +137 -168
- package/components/var-datetime-picker/src/const.js +1 -91
- package/components/var-datetime-picker/src/ctx.d.ts +10 -10
- package/components/var-datetime-picker/src/ctx.js +1 -43
- package/components/var-datetime-picker/src/index.css +1 -0
- package/components/var-datetime-picker/src/index.vue.d.ts +26 -42
- package/components/var-datetime-picker/src/types.d.ts +1 -1
- package/components/vditor/index.css +1 -0
- package/components/vditor/index.d.ts +1 -1
- package/components/vditor/index.js +22 -17
- package/components/vditor/src/ctx.js +1 -15
- package/components/vditor/src/index.css +1 -0
- package/components/vditor/src/index.vue.d.ts +4 -3
- package/components/vditor/src/types.d.ts +1 -1
- package/composables/index.css +1 -0
- package/composables/index.js +1 -104
- package/composables/useForm.d.ts +2 -2
- package/composables/useSourceManager.d.ts +1 -1
- package/index.css +127 -20
- package/index.esm.js +1 -44
- package/package.json +1 -1
- package/shared/const/index.css +1 -0
- package/shared/const/index.d.ts +1 -1
- package/shared/const/index.js +1 -56
- package/shared/element-plus/ctx.d.ts +28 -26
- package/shared/element-plus/index.css +1 -0
- package/shared/element-plus/index.js +1 -220
- package/shared/element-plus/instances.d.ts +45 -38
- package/shared/form/index.css +1 -0
- package/shared/form/index.js +1 -30
- package/shared/helper/index.css +1 -0
- package/shared/helper/index.js +1 -9
- package/shared/index.css +1 -0
- package/shared/index.js +1 -56
- package/shared/infer-prop/index.css +1 -0
- package/shared/infer-prop/index.d.ts +1 -1
- package/shared/infer-prop/index.js +1 -34
- package/shared/progress-it/index.css +1 -0
- package/shared/progress-it/index.d.ts +4 -4
- package/shared/progress-it/index.js +1 -57
- package/shared/rules/index.css +1 -0
- package/shared/rules/index.js +1 -32
- package/shared/types/form/index.css +1 -0
- package/shared/types/index.css +1 -0
- package/shared/types/source/index.css +1 -0
- package/shared/types/source/index.d.ts +2 -2
- package/shared/types/source-manager/index.css +1 -0
- package/shared/upload/index.css +1 -0
- package/shared/upload/index.js +1 -767
|
@@ -1,91 +1 @@
|
|
|
1
|
-
var
|
|
2
|
-
VarDatePickerType2["date"] = "date";
|
|
3
|
-
VarDatePickerType2["year"] = "year";
|
|
4
|
-
VarDatePickerType2["month"] = "month";
|
|
5
|
-
return VarDatePickerType2;
|
|
6
|
-
})(VarDatePickerType || {});
|
|
7
|
-
const VarDatePickerTypeOptions = [
|
|
8
|
-
{
|
|
9
|
-
label: "\u65E5\u671F",
|
|
10
|
-
value: "date" /* date */,
|
|
11
|
-
format: "YYYY-MM-DD"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
label: "\u5E74",
|
|
15
|
-
value: "year" /* year */,
|
|
16
|
-
format: "YYYY"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
label: "\u6708",
|
|
20
|
-
value: "month" /* month */,
|
|
21
|
-
format: "YYYY-MM"
|
|
22
|
-
}
|
|
23
|
-
];
|
|
24
|
-
const VarDatePickerTypeReflect = VarDatePickerTypeOptions.reduce((acc, cur) => {
|
|
25
|
-
acc[cur.value] = cur;
|
|
26
|
-
return acc;
|
|
27
|
-
}, {});
|
|
28
|
-
const ElDatePickerTypeOptions = [
|
|
29
|
-
{
|
|
30
|
-
label: "\u65E5\u671F",
|
|
31
|
-
value: "date",
|
|
32
|
-
varDatePickerType: "date" /* date */,
|
|
33
|
-
isRange: false
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
label: "\u5E74",
|
|
37
|
-
value: "year",
|
|
38
|
-
varDatePickerType: "year" /* year */,
|
|
39
|
-
isRange: false
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
label: "\u6708",
|
|
43
|
-
value: "month",
|
|
44
|
-
varDatePickerType: "month" /* month */,
|
|
45
|
-
isRange: false
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
value: "dates",
|
|
49
|
-
label: "\u591A\u9009\u65E5\u671F",
|
|
50
|
-
varDatePickerType: "date" /* date */,
|
|
51
|
-
isRange: false
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
value: "week",
|
|
55
|
-
label: "\u5468",
|
|
56
|
-
varDatePickerType: "date" /* date */,
|
|
57
|
-
isRange: false
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
value: "datetime",
|
|
61
|
-
label: "\u65E5\u671F\u65F6\u95F4",
|
|
62
|
-
varDatePickerType: "date" /* date */,
|
|
63
|
-
isRange: false,
|
|
64
|
-
hasTime: true
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
value: "datetimerange",
|
|
68
|
-
label: "\u65E5\u671F\u65F6\u95F4\u8303\u56F4",
|
|
69
|
-
varDatePickerType: "date" /* date */,
|
|
70
|
-
isRange: false,
|
|
71
|
-
hasTime: true
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
value: "daterange",
|
|
75
|
-
label: "\u65E5\u671F\u8303\u56F4",
|
|
76
|
-
varDatePickerType: "date" /* date */,
|
|
77
|
-
isRange: true
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
value: "monthrange",
|
|
81
|
-
label: "\u6708\u8303\u56F4",
|
|
82
|
-
varDatePickerType: "month" /* month */,
|
|
83
|
-
isRange: true
|
|
84
|
-
}
|
|
85
|
-
];
|
|
86
|
-
const ElDatePickerTypeReflect = ElDatePickerTypeOptions.reduce((acc, cur) => {
|
|
87
|
-
acc[cur.value] = cur;
|
|
88
|
-
return acc;
|
|
89
|
-
}, {});
|
|
90
|
-
|
|
91
|
-
export { ElDatePickerTypeOptions, ElDatePickerTypeReflect, VarDatePickerType, VarDatePickerTypeOptions, VarDatePickerTypeReflect };
|
|
1
|
+
var t=(e=>(e.date="date",e.year="year",e.month="month",e))(t||{});const u=[{label:"\u65E5\u671F",value:"date",format:"YYYY-MM-DD"},{label:"\u5E74",value:"year",format:"YYYY"},{label:"\u6708",value:"month",format:"YYYY-MM"}],r=u.reduce((e,a)=>(e[a.value]=a,e),{}),l=[{label:"\u65E5\u671F",value:"date",varDatePickerType:"date",isRange:!1},{label:"\u5E74",value:"year",varDatePickerType:"year",isRange:!1},{label:"\u6708",value:"month",varDatePickerType:"month",isRange:!1},{value:"dates",label:"\u591A\u9009\u65E5\u671F",varDatePickerType:"date",isRange:!1},{value:"week",label:"\u5468",varDatePickerType:"date",isRange:!1},{value:"datetime",label:"\u65E5\u671F\u65F6\u95F4",varDatePickerType:"date",isRange:!1,hasTime:!0},{value:"datetimerange",label:"\u65E5\u671F\u65F6\u95F4\u8303\u56F4",varDatePickerType:"date",isRange:!1,hasTime:!0},{value:"daterange",label:"\u65E5\u671F\u8303\u56F4",varDatePickerType:"date",isRange:!0},{value:"monthrange",label:"\u6708\u8303\u56F4",varDatePickerType:"month",isRange:!0}],n=l.reduce((e,a)=>(e[a.value]=a,e),{});export{l as ElDatePickerTypeOptions,n as ElDatePickerTypeReflect,t as VarDatePickerType,u as VarDatePickerTypeOptions,r as VarDatePickerTypeReflect};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
2
|
export declare const props: {
|
|
3
|
-
modelValue:
|
|
3
|
+
modelValue: any;
|
|
4
4
|
readonly: BooleanConstructor;
|
|
5
5
|
type: {
|
|
6
6
|
type: PropType<"year" | "month" | "date" | "dates" | "week" | "datetime" | "daterange" | "monthrange">;
|
|
@@ -8,33 +8,33 @@ export declare const props: {
|
|
|
8
8
|
};
|
|
9
9
|
allowedDates: {
|
|
10
10
|
type: PropType<(date: string) => boolean>;
|
|
11
|
-
default:
|
|
11
|
+
default: any;
|
|
12
12
|
};
|
|
13
13
|
useSeconds: BooleanConstructor;
|
|
14
14
|
valueFormat: {
|
|
15
15
|
type: StringConstructor;
|
|
16
16
|
default: string;
|
|
17
17
|
};
|
|
18
|
-
required: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
19
18
|
label: StringConstructor;
|
|
20
19
|
labelWidth: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
|
|
21
20
|
prop: {
|
|
22
|
-
readonly type: PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) =>
|
|
21
|
+
readonly type: PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | string[]) | (() => import("element-plus").FormItemProp) | ((new (...args: any[]) => string | string[]) | (() => import("element-plus").FormItemProp))[], unknown, unknown>>;
|
|
23
22
|
readonly required: false;
|
|
24
|
-
readonly validator: (
|
|
23
|
+
readonly validator: (val: unknown) => boolean;
|
|
25
24
|
__epPropKey: true;
|
|
26
25
|
};
|
|
26
|
+
required: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
27
27
|
rules: {
|
|
28
|
-
readonly type: PropType<
|
|
28
|
+
readonly type: PropType<unknown>;
|
|
29
29
|
readonly required: false;
|
|
30
|
-
readonly validator: (
|
|
30
|
+
readonly validator: (val: unknown) => boolean;
|
|
31
31
|
__epPropKey: true;
|
|
32
32
|
};
|
|
33
33
|
error: StringConstructor;
|
|
34
34
|
validateStatus: {
|
|
35
35
|
readonly type: PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "error" | "success" | "validating", unknown>>;
|
|
36
36
|
readonly required: false;
|
|
37
|
-
readonly validator: (
|
|
37
|
+
readonly validator: (val: unknown) => boolean;
|
|
38
38
|
__epPropKey: true;
|
|
39
39
|
};
|
|
40
40
|
for: StringConstructor;
|
|
@@ -46,7 +46,7 @@ export declare const props: {
|
|
|
46
46
|
};
|
|
47
47
|
formItemSlots: {
|
|
48
48
|
type: PropType<import("../../form-item/src/types").FormItemSlots>;
|
|
49
|
-
default:
|
|
49
|
+
default: any;
|
|
50
50
|
};
|
|
51
51
|
elRef: {
|
|
52
52
|
type: PropType<any>;
|
|
@@ -62,5 +62,5 @@ export declare const props: {
|
|
|
62
62
|
};
|
|
63
63
|
};
|
|
64
64
|
export declare const emits: {
|
|
65
|
-
'update:modelValue':
|
|
65
|
+
'update:modelValue': any;
|
|
66
66
|
};
|
|
@@ -1,43 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __defProps = Object.defineProperties;
|
|
5
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
-
var __spreadValues = (a, b) => {
|
|
11
|
-
for (var prop in b || (b = {}))
|
|
12
|
-
if (__hasOwnProp.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
if (__getOwnPropSymbols)
|
|
15
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
-
if (__propIsEnum.call(b, prop))
|
|
17
|
-
__defNormalProp(a, prop, b[prop]);
|
|
18
|
-
}
|
|
19
|
-
return a;
|
|
20
|
-
};
|
|
21
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
22
|
-
const props = __spreadProps(__spreadValues({}, _VkfFormItemCtx.props), {
|
|
23
|
-
modelValue: null,
|
|
24
|
-
readonly: Boolean,
|
|
25
|
-
type: {
|
|
26
|
-
type: String,
|
|
27
|
-
default: "month"
|
|
28
|
-
},
|
|
29
|
-
allowedDates: {
|
|
30
|
-
type: Function,
|
|
31
|
-
default: void 0
|
|
32
|
-
},
|
|
33
|
-
useSeconds: Boolean,
|
|
34
|
-
valueFormat: {
|
|
35
|
-
type: String,
|
|
36
|
-
default: "YYYY-MM-DD HH:mm"
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
const emits = {
|
|
40
|
-
"update:modelValue": null
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export { emits, props };
|
|
1
|
+
import{_VkfFormItemCtx as e}from"@vunk/form/components/form-item";const o={...e.props,modelValue:null,readonly:Boolean,type:{type:String,default:"month"},allowedDates:{type:Function,default:void 0},useSeconds:Boolean,valueFormat:{type:String,default:"YYYY-MM-DD HH:mm"}},t={"update:modelValue":null};export{t as emits,o as props};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -2,7 +2,7 @@ import 'vant/es/popup/style';
|
|
|
2
2
|
import '@varlet/ui/es/date-picker/style';
|
|
3
3
|
import '@varlet/ui/es/time-picker/style';
|
|
4
4
|
declare const _default: import("vue").DefineComponent<{
|
|
5
|
-
modelValue:
|
|
5
|
+
modelValue: any;
|
|
6
6
|
readonly: BooleanConstructor;
|
|
7
7
|
type: {
|
|
8
8
|
type: import("vue").PropType<"year" | "month" | "date" | "dates" | "week" | "datetime" | "daterange" | "monthrange">;
|
|
@@ -10,33 +10,33 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
10
10
|
};
|
|
11
11
|
allowedDates: {
|
|
12
12
|
type: import("vue").PropType<(date: string) => boolean>;
|
|
13
|
-
default:
|
|
13
|
+
default: any;
|
|
14
14
|
};
|
|
15
15
|
useSeconds: BooleanConstructor;
|
|
16
16
|
valueFormat: {
|
|
17
17
|
type: StringConstructor;
|
|
18
18
|
default: string;
|
|
19
19
|
};
|
|
20
|
-
required: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
21
20
|
label: StringConstructor;
|
|
22
21
|
labelWidth: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
|
|
23
22
|
prop: {
|
|
24
|
-
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) =>
|
|
23
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | string[]) | (() => import("element-plus").FormItemProp) | ((new (...args: any[]) => string | string[]) | (() => import("element-plus").FormItemProp))[], unknown, unknown>>;
|
|
25
24
|
readonly required: false;
|
|
26
|
-
readonly validator: (
|
|
25
|
+
readonly validator: (val: unknown) => boolean;
|
|
27
26
|
__epPropKey: true;
|
|
28
27
|
};
|
|
28
|
+
required: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
29
29
|
rules: {
|
|
30
|
-
readonly type: import("vue").PropType<
|
|
30
|
+
readonly type: import("vue").PropType<unknown>;
|
|
31
31
|
readonly required: false;
|
|
32
|
-
readonly validator: (
|
|
32
|
+
readonly validator: (val: unknown) => boolean;
|
|
33
33
|
__epPropKey: true;
|
|
34
34
|
};
|
|
35
35
|
error: StringConstructor;
|
|
36
36
|
validateStatus: {
|
|
37
37
|
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "error" | "success" | "validating", unknown>>;
|
|
38
38
|
readonly required: false;
|
|
39
|
-
readonly validator: (
|
|
39
|
+
readonly validator: (val: unknown) => boolean;
|
|
40
40
|
__epPropKey: true;
|
|
41
41
|
};
|
|
42
42
|
for: StringConstructor;
|
|
@@ -48,7 +48,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
48
48
|
};
|
|
49
49
|
formItemSlots: {
|
|
50
50
|
type: import("vue").PropType<import("../../form-item/src/types").FormItemSlots>;
|
|
51
|
-
default:
|
|
51
|
+
default: any;
|
|
52
52
|
};
|
|
53
53
|
elRef: {
|
|
54
54
|
type: import("vue").PropType<any>;
|
|
@@ -66,24 +66,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
66
66
|
preInput: () => void;
|
|
67
67
|
inputBlur: (e: FocusEvent) => void;
|
|
68
68
|
popupShow: import("vue").Ref<boolean>;
|
|
69
|
-
formItemBindProps: import("vue").ComputedRef<{
|
|
70
|
-
required: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown> | undefined;
|
|
71
|
-
label: string | undefined;
|
|
72
|
-
labelWidth: import("element-plus/es/utils").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
|
|
73
|
-
prop: import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => import("element-plus").FormItemProp & {}) | (() => import("element-plus").FormItemProp) | ((new (...args: any[]) => import("element-plus").FormItemProp & {}) | (() => import("element-plus").FormItemProp))[], unknown, unknown> | undefined;
|
|
74
|
-
rules: import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => import("element-plus").FormItemRule | import("element-plus").FormItemRule[]) | (() => import("element-plus/es/utils").Arrayable<import("element-plus").FormItemRule>) | ((new (...args: any[]) => import("element-plus").FormItemRule | import("element-plus").FormItemRule[]) | (() => import("element-plus/es/utils").Arrayable<import("element-plus").FormItemRule>))[], unknown, unknown> | undefined;
|
|
75
|
-
error: string | undefined;
|
|
76
|
-
validateStatus: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "error" | "success" | "validating", unknown> | undefined;
|
|
77
|
-
for: string | undefined;
|
|
78
|
-
inlineMessage: import("element-plus/es/utils").EpPropMergeType<readonly [StringConstructor, BooleanConstructor], unknown, unknown>;
|
|
79
|
-
showMessage: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
80
|
-
formItemSize: "default" | "small" | "large";
|
|
81
|
-
formItemSlots: import("../../form-item/src/types").FormItemSlots | undefined;
|
|
82
|
-
elRef: any;
|
|
83
|
-
inline: boolean;
|
|
84
|
-
readonly: boolean;
|
|
85
|
-
labelPosition: "right";
|
|
86
|
-
}>;
|
|
69
|
+
formItemBindProps: import("vue").ComputedRef<{}>;
|
|
87
70
|
varDatePickerType: import("vue").ComputedRef<import("./const").VarDatePickerType>;
|
|
88
71
|
isRange: import("vue").ComputedRef<boolean>;
|
|
89
72
|
hasTime: import("vue").ComputedRef<boolean>;
|
|
@@ -91,9 +74,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
91
74
|
valueTime: import("vue").WritableComputedRef<string>;
|
|
92
75
|
valueDate: import("vue").WritableComputedRef<string>;
|
|
93
76
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
94
|
-
'update:modelValue':
|
|
95
|
-
}, string, import("vue").
|
|
96
|
-
modelValue:
|
|
77
|
+
'update:modelValue': any;
|
|
78
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
79
|
+
modelValue: any;
|
|
97
80
|
readonly: BooleanConstructor;
|
|
98
81
|
type: {
|
|
99
82
|
type: import("vue").PropType<"year" | "month" | "date" | "dates" | "week" | "datetime" | "daterange" | "monthrange">;
|
|
@@ -101,33 +84,33 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
101
84
|
};
|
|
102
85
|
allowedDates: {
|
|
103
86
|
type: import("vue").PropType<(date: string) => boolean>;
|
|
104
|
-
default:
|
|
87
|
+
default: any;
|
|
105
88
|
};
|
|
106
89
|
useSeconds: BooleanConstructor;
|
|
107
90
|
valueFormat: {
|
|
108
91
|
type: StringConstructor;
|
|
109
92
|
default: string;
|
|
110
93
|
};
|
|
111
|
-
required: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
112
94
|
label: StringConstructor;
|
|
113
95
|
labelWidth: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
|
|
114
96
|
prop: {
|
|
115
|
-
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) =>
|
|
97
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | string[]) | (() => import("element-plus").FormItemProp) | ((new (...args: any[]) => string | string[]) | (() => import("element-plus").FormItemProp))[], unknown, unknown>>;
|
|
116
98
|
readonly required: false;
|
|
117
|
-
readonly validator: (
|
|
99
|
+
readonly validator: (val: unknown) => boolean;
|
|
118
100
|
__epPropKey: true;
|
|
119
101
|
};
|
|
102
|
+
required: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
120
103
|
rules: {
|
|
121
|
-
readonly type: import("vue").PropType<
|
|
104
|
+
readonly type: import("vue").PropType<unknown>;
|
|
122
105
|
readonly required: false;
|
|
123
|
-
readonly validator: (
|
|
106
|
+
readonly validator: (val: unknown) => boolean;
|
|
124
107
|
__epPropKey: true;
|
|
125
108
|
};
|
|
126
109
|
error: StringConstructor;
|
|
127
110
|
validateStatus: {
|
|
128
111
|
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "error" | "success" | "validating", unknown>>;
|
|
129
112
|
readonly required: false;
|
|
130
|
-
readonly validator: (
|
|
113
|
+
readonly validator: (val: unknown) => boolean;
|
|
131
114
|
__epPropKey: true;
|
|
132
115
|
};
|
|
133
116
|
for: StringConstructor;
|
|
@@ -139,7 +122,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
139
122
|
};
|
|
140
123
|
formItemSlots: {
|
|
141
124
|
type: import("vue").PropType<import("../../form-item/src/types").FormItemSlots>;
|
|
142
|
-
default:
|
|
125
|
+
default: any;
|
|
143
126
|
};
|
|
144
127
|
elRef: {
|
|
145
128
|
type: import("vue").PropType<any>;
|
|
@@ -154,20 +137,21 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
154
137
|
default: string;
|
|
155
138
|
};
|
|
156
139
|
}>> & {
|
|
157
|
-
"onUpdate:modelValue"?: (
|
|
140
|
+
"onUpdate:modelValue"?: (...args: any[] | unknown[]) => any;
|
|
158
141
|
}, {
|
|
159
|
-
required: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
160
|
-
type: "year" | "month" | "date" | "dates" | "week" | "datetime" | "daterange" | "monthrange";
|
|
161
142
|
labelWidth: import("element-plus/es/utils").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
|
|
143
|
+
required: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
162
144
|
inlineMessage: import("element-plus/es/utils").EpPropMergeType<readonly [StringConstructor, BooleanConstructor], unknown, unknown>;
|
|
163
145
|
showMessage: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
146
|
+
type: "year" | "month" | "date" | "dates" | "week" | "datetime" | "daterange" | "monthrange";
|
|
164
147
|
formItemSize: "default" | "small" | "large";
|
|
165
148
|
formItemSlots: import("../../form-item/src/types").FormItemSlots;
|
|
166
149
|
inline: boolean;
|
|
167
150
|
readonly: boolean;
|
|
168
151
|
labelPosition: "right";
|
|
152
|
+
modelValue: any;
|
|
169
153
|
valueFormat: string;
|
|
170
154
|
allowedDates: (date: string) => boolean;
|
|
171
155
|
useSeconds: boolean;
|
|
172
|
-
}>;
|
|
156
|
+
}, {}>;
|
|
173
157
|
export default _default;
|
|
@@ -2,7 +2,7 @@ import { DatePickType } from 'element-plus';
|
|
|
2
2
|
import { VarDatePickerType } from './const';
|
|
3
3
|
import { VueComponentPropsType } from '@vunk/core';
|
|
4
4
|
import { BasicSource } from '@vunk/form';
|
|
5
|
-
import type CoreVue from './index.vue
|
|
5
|
+
import type CoreVue from './index.vue';
|
|
6
6
|
export interface VarDatePickerTypeMedia {
|
|
7
7
|
label: string;
|
|
8
8
|
value: VarDatePickerType;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -15,19 +15,13 @@ const emits = {
|
|
|
15
15
|
load: (e) => e
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
var
|
|
19
|
-
const target = sfc.__vccOpts || sfc;
|
|
20
|
-
for (const [key, val] of props) {
|
|
21
|
-
target[key] = val;
|
|
22
|
-
}
|
|
23
|
-
return target;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
const _sfc_main = defineComponent({
|
|
18
|
+
var script = defineComponent({
|
|
27
19
|
name: "VkfVditor",
|
|
28
20
|
emits,
|
|
29
21
|
props,
|
|
30
|
-
setup(props2, {
|
|
22
|
+
setup(props2, {
|
|
23
|
+
emit
|
|
24
|
+
}) {
|
|
31
25
|
const vditorNode = ref();
|
|
32
26
|
const ready = ref(false);
|
|
33
27
|
onMounted(() => {
|
|
@@ -51,18 +45,29 @@ const _sfc_main = defineComponent({
|
|
|
51
45
|
};
|
|
52
46
|
}
|
|
53
47
|
});
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
48
|
+
|
|
49
|
+
const _hoisted_1 = {
|
|
50
|
+
ref: "vditorNode"
|
|
51
|
+
};
|
|
52
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
53
|
+
return openBlock(), createElementBlock(
|
|
54
|
+
"div",
|
|
55
|
+
_hoisted_1,
|
|
56
|
+
null,
|
|
57
|
+
512
|
|
58
|
+
/* NEED_PATCH */
|
|
59
|
+
);
|
|
57
60
|
}
|
|
58
|
-
|
|
61
|
+
|
|
62
|
+
script.render = render;
|
|
63
|
+
script.__file = "vditor/src/index.vue";
|
|
59
64
|
|
|
60
65
|
var types = /*#__PURE__*/Object.freeze({
|
|
61
66
|
__proto__: null
|
|
62
67
|
});
|
|
63
68
|
|
|
64
|
-
|
|
65
|
-
app.component(
|
|
69
|
+
script.install = (app) => {
|
|
70
|
+
app.component(script.name, script);
|
|
66
71
|
};
|
|
67
72
|
|
|
68
|
-
export { VkfVditor, types as __VkfVditor,
|
|
73
|
+
export { script as VkfVditor, types as __VkfVditor, script as default };
|
|
@@ -1,15 +1 @@
|
|
|
1
|
-
const
|
|
2
|
-
modelValue: {
|
|
3
|
-
type: Object,
|
|
4
|
-
default: () => ({})
|
|
5
|
-
},
|
|
6
|
-
defaultOptions: {
|
|
7
|
-
type: Object,
|
|
8
|
-
default: () => ({})
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
const emits = {
|
|
12
|
-
load: (e) => e
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export { emits, props };
|
|
1
|
+
const e={modelValue:{type:Object,default:()=>({})},defaultOptions:{type:Object,default:()=>({})}},o={load:t=>t};export{o as emits,e as props};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="./types" />
|
|
1
2
|
import Vditor from 'vditor';
|
|
2
3
|
import { Ref } from 'vue';
|
|
3
4
|
declare const _default: import("vue").DefineComponent<{
|
|
@@ -13,7 +14,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
13
14
|
vditorNode: Ref<HTMLDivElement>;
|
|
14
15
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
16
|
load: (e: Vditor) => Vditor;
|
|
16
|
-
}, string, import("vue").
|
|
17
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
17
18
|
modelValue: {
|
|
18
19
|
type: import("vue").PropType<unknown>;
|
|
19
20
|
default: () => {};
|
|
@@ -23,9 +24,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
23
24
|
default: () => IOptions;
|
|
24
25
|
};
|
|
25
26
|
}>> & {
|
|
26
|
-
onLoad?: (
|
|
27
|
+
onLoad?: (e: Vditor) => any;
|
|
27
28
|
}, {
|
|
28
29
|
modelValue: {};
|
|
29
30
|
defaultOptions: IOptions;
|
|
30
|
-
}>;
|
|
31
|
+
}, {}>;
|
|
31
32
|
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/composables/index.js
CHANGED
|
@@ -1,104 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __defProps = Object.defineProperties;
|
|
5
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
-
var __spreadValues = (a, b) => {
|
|
11
|
-
for (var prop in b || (b = {}))
|
|
12
|
-
if (__hasOwnProp.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
if (__getOwnPropSymbols)
|
|
15
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
-
if (__propIsEnum.call(b, prop))
|
|
17
|
-
__defNormalProp(a, prop, b[prop]);
|
|
18
|
-
}
|
|
19
|
-
return a;
|
|
20
|
-
};
|
|
21
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
22
|
-
const useSourceManager = (source, opts = {}) => {
|
|
23
|
-
if (!isRef(source)) {
|
|
24
|
-
source = ref(source);
|
|
25
|
-
}
|
|
26
|
-
const op = __spreadProps(__spreadValues({}, opts), {
|
|
27
|
-
slotsChildren: ["default"]
|
|
28
|
-
});
|
|
29
|
-
opts.slotsChildren && op.slotsChildren.push(...opts.slotsChildren);
|
|
30
|
-
const manager = computed(() => {
|
|
31
|
-
const keyRecord = {};
|
|
32
|
-
const propRecord = {};
|
|
33
|
-
const idRecord = {};
|
|
34
|
-
function intoData(list, k = []) {
|
|
35
|
-
list.forEach((item, index) => {
|
|
36
|
-
const currentK = [...k, index];
|
|
37
|
-
const managerInfo = {
|
|
38
|
-
source: item,
|
|
39
|
-
key: currentK,
|
|
40
|
-
nextKey: [...k, index + 1],
|
|
41
|
-
prop: item.prop,
|
|
42
|
-
id: item.id
|
|
43
|
-
};
|
|
44
|
-
keyRecord[currentK.join()] = managerInfo;
|
|
45
|
-
if (item.prop) {
|
|
46
|
-
propRecord[item.prop] = managerInfo;
|
|
47
|
-
}
|
|
48
|
-
if (item.id) {
|
|
49
|
-
idRecord[item.id] = managerInfo;
|
|
50
|
-
}
|
|
51
|
-
if (item.templateSlots) {
|
|
52
|
-
if (Array.isArray(item.templateSlots)) {
|
|
53
|
-
currentK.push("templateSlots");
|
|
54
|
-
intoData(item.templateSlots, currentK);
|
|
55
|
-
}
|
|
56
|
-
op.slotsChildren.forEach((filed) => {
|
|
57
|
-
if (Array.isArray(item.templateSlots[filed])) {
|
|
58
|
-
currentK.push("templateSlots", filed);
|
|
59
|
-
intoData(item.templateSlots[filed], currentK);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
intoData(unref(source));
|
|
66
|
-
return {
|
|
67
|
-
keyRecord,
|
|
68
|
-
propRecord,
|
|
69
|
-
idRecord
|
|
70
|
-
};
|
|
71
|
-
});
|
|
72
|
-
const getManagerInfoByProp = (prop) => {
|
|
73
|
-
return manager.value.propRecord[prop];
|
|
74
|
-
};
|
|
75
|
-
const getManagerInfoByKey = (key) => {
|
|
76
|
-
return manager.value.keyRecord[key.join()];
|
|
77
|
-
};
|
|
78
|
-
const getManagerInfoById = (id) => {
|
|
79
|
-
return manager.value.idRecord[id];
|
|
80
|
-
};
|
|
81
|
-
return [
|
|
82
|
-
source,
|
|
83
|
-
{
|
|
84
|
-
manager,
|
|
85
|
-
getManagerInfoByProp,
|
|
86
|
-
getManagerInfoByKey,
|
|
87
|
-
getManagerInfoById
|
|
88
|
-
}
|
|
89
|
-
];
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
const useForm = () => {
|
|
93
|
-
return inject("vkfFormVm", null);
|
|
94
|
-
};
|
|
95
|
-
const useComputedReadonly = (props) => {
|
|
96
|
-
const form = useForm();
|
|
97
|
-
const readonly = computed(() => {
|
|
98
|
-
var _a, _b;
|
|
99
|
-
return (_b = (_a = props.readonly) != null ? _a : form == null ? void 0 : form.props.readonly) != null ? _b : false;
|
|
100
|
-
});
|
|
101
|
-
return readonly;
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
export { useComputedReadonly, useForm, useSourceManager };
|
|
1
|
+
import{isRef as I,ref as R,computed as g,unref as S,inject as M}from"vue";const m=(e,t={})=>{I(e)||(e=R(e));const s={...t,slotsChildren:["default"]};t.slotsChildren&&s.slotsChildren.push(...t.slotsChildren);const a=g(()=>{const o={},d={},f={};function l(h,u=[]){h.forEach((r,y)=>{const n=[...u,y],p={source:r,key:n,nextKey:[...u,y+1],prop:r.prop,id:r.id};o[n.join()]=p,r.prop&&(d[r.prop]=p),r.id&&(f[r.id]=p),r.templateSlots&&(Array.isArray(r.templateSlots)&&(n.push("templateSlots"),l(r.templateSlots,n)),s.slotsChildren.forEach(c=>{Array.isArray(r.templateSlots[c])&&(n.push("templateSlots",c),l(r.templateSlots[c],n))}))})}return l(S(e)),{keyRecord:o,propRecord:d,idRecord:f}});return[e,{manager:a,getManagerInfoByProp:o=>a.value.propRecord[o],getManagerInfoByKey:o=>a.value.keyRecord[o.join()],getManagerInfoById:o=>a.value.idRecord[o]}]},i=()=>M("vkfFormVm",null),B=e=>{const t=i();return g(()=>e.readonly??t?.props.readonly??!1)};export{B as useComputedReadonly,i as useForm,m as useSourceManager};
|
package/composables/useForm.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ComponentInternalInstance, ComputedRef } from 'vue';
|
|
2
2
|
import { VkfForm } from '@vunk/form/components/form';
|
|
3
3
|
import { VueComponentPropsType } from '@vunk/core';
|
|
4
|
-
export declare const useForm: () =>
|
|
4
|
+
export declare const useForm: () => ComponentInternalInstance & {
|
|
5
5
|
props: VueComponentPropsType<typeof VkfForm>;
|
|
6
|
-
}
|
|
6
|
+
};
|
|
7
7
|
export declare const useComputedReadonly: (props: {
|
|
8
8
|
readonly?: boolean;
|
|
9
9
|
}) => ComputedRef<boolean>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FormItemRendererSource, ManagerInfo } from '@vunk/form/shared/types';
|
|
2
2
|
import { MaybeRef } from '@vunk/core';
|
|
3
3
|
import { Ref } from 'vue';
|
|
4
|
-
export declare const useSourceManager: <T = FormItemRendererSource
|
|
4
|
+
export declare const useSourceManager: <T = FormItemRendererSource>(source: MaybeRef<T[]>, opts?: {
|
|
5
5
|
slotsChildren?: string[];
|
|
6
6
|
}) => readonly [Ref<T[]>, {
|
|
7
7
|
readonly manager: import("vue").ComputedRef<{
|