@vunk/form 1.1.77 → 1.1.80
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/components/_plugin-vue_export-helper.mjs +9 -0
- package/components/button/{index.js → index.mjs} +33 -29
- package/components/button/src/ctx.d.ts +30 -30
- package/components/button/src/index.vue.d.ts +69 -69
- package/components/cascader/index.css +0 -2
- package/components/cascader/{index.js → index.mjs} +22 -22
- package/components/cascader/src/ctx.d.ts +37 -45
- package/components/cascader/src/index.vue.d.ts +92 -92
- package/components/cascader/src/use.d.ts +1 -1
- package/components/checkbox/index.css +0 -9
- package/components/checkbox/{index.js → index.mjs} +45 -42
- package/components/checkbox/src/ctx.d.ts +29 -32
- package/components/checkbox/src/index.vue.d.ts +65 -65
- package/components/color-picker/{index.js → index.mjs} +23 -22
- package/components/color-picker/src/ctx.d.ts +29 -29
- package/components/color-picker/src/index.vue.d.ts +67 -67
- package/components/date-picker/index.d.ts +1 -0
- package/components/date-picker/{index.js → index.mjs} +46 -26
- package/components/date-picker/src/ctx.d.ts +51 -49
- package/components/date-picker/src/index.vue.d.ts +104 -104
- package/components/date-picker-range/index.css +18 -0
- package/components/date-picker-range/index.d.ts +4 -0
- package/components/date-picker-range/index.mjs +164 -0
- package/components/date-picker-range/src/ctx.d.ts +177 -0
- package/components/date-picker-range/src/index.vue.d.ts +398 -0
- package/components/date-picker-range/src/types.d.ts +12 -0
- package/components/download-plus/index.css +0 -6
- package/components/download-plus/{index.js → index.mjs} +119 -147
- package/components/download-plus/src/api.d.ts +1 -1
- package/components/download-plus/src/ctx.d.ts +27 -26
- package/components/download-plus/src/index.vue.d.ts +59 -59
- package/components/esri-input-geojson/index.css +0 -10
- package/components/esri-input-geojson/index.mjs +1109 -0
- package/components/esri-input-geojson/src/append.vue.d.ts +1 -1
- package/components/esri-input-geojson/src/ctx.d.ts +49 -72
- package/components/esri-input-geojson/src/index.vue.d.ts +138 -158
- package/components/esri-input-geojson/src/types.d.ts +0 -1
- package/components/esri-input-geojson/src/viewer.vue.d.ts +18 -19
- package/components/form/{index.js → index.mjs} +38 -36
- package/components/form/src/ctx.d.ts +13 -297
- package/components/form/src/index.vue.d.ts +97 -659
- package/components/form-item/index.css +0 -8
- package/components/form-item/{index.js → index.mjs} +22 -19
- package/components/form-item/src/ctx.d.ts +13 -11
- package/components/form-item/src/index.vue.d.ts +20 -20
- package/components/form-item-renderer/{index.js → index.mjs} +9 -7
- package/components/form-item-renderer/src/index.vue.d.ts +1 -1
- package/components/form-item-renderer-template/{index.js → index.mjs} +7 -7
- package/components/geoinput/{index.js → index.mjs} +10 -17
- package/components/geoinput/src/ctx.d.ts +48 -60
- package/components/geoinput/src/index.vue.d.ts +114 -132
- package/components/geoinput-read/index.css +0 -2
- package/components/geoinput-read/{index.js → index.mjs} +101 -109
- package/components/geoinput-read/src/core.vue.d.ts +123 -142
- package/components/geoinput-read/src/ctx.d.ts +50 -74
- package/components/geoinput-read/src/index.vue.d.ts +102 -120
- package/components/geoinput-update/index.css +0 -6
- package/components/geoinput-update/index.mjs +399 -0
- package/components/geoinput-update/src/ctx.d.ts +49 -69
- package/components/geoinput-update/src/index.vue.d.ts +126 -141
- package/components/index.mjs +11 -0
- package/components/index2.mjs +306 -0
- package/components/index3.mjs +484 -0
- package/components/input/{index.js → index.mjs} +31 -27
- package/components/input/src/ctx.d.ts +47 -66
- package/components/input/src/index.vue.d.ts +101 -113
- package/components/input-link/index.css +0 -2
- package/components/input-link/index.mjs +151 -0
- package/components/input-link/src/ctx.d.ts +40 -56
- package/components/input-link/src/index.vue.d.ts +89 -101
- package/components/input-number/index.css +0 -2
- package/components/input-number/{index.js → index.mjs} +25 -25
- package/components/input-number/src/ctx.d.ts +31 -37
- package/components/input-number/src/index.vue.d.ts +71 -71
- package/components/radio/index.css +0 -6
- package/components/radio/{index.js → index.mjs} +50 -47
- package/components/radio/src/ctx.d.ts +29 -29
- package/components/radio/src/index.vue.d.ts +64 -64
- package/components/select/index.css +0 -2
- package/components/select/{index.js → index.mjs} +49 -48
- package/components/select/src/ctx.d.ts +31 -85
- package/components/select/src/index.vue.d.ts +121 -230
- package/components/slider/{index.js → index.mjs} +28 -24
- package/components/slider/src/ctx.d.ts +35 -35
- package/components/slider/src/index.vue.d.ts +93 -93
- package/components/switch/index.css +0 -2
- package/components/switch/{index.js → index.mjs} +29 -24
- package/components/switch/src/ctx.d.ts +40 -40
- package/components/switch/src/index.vue.d.ts +91 -91
- package/components/templates-default/index.mjs +302 -0
- package/components/templates-default/src/ctx.d.ts +2 -4
- package/components/templates-default/src/index.vue.d.ts +2 -8
- package/components/templates-element-plus/index.mjs +106 -0
- package/components/templates-esri/index.mjs +59 -0
- package/components/templates-layout/index.css +0 -3
- package/components/templates-layout/index.mjs +131 -0
- package/components/templates-mapbox/index.mjs +59 -0
- package/components/templates-variant/index.d.ts +4 -0
- package/components/templates-variant/index.mjs +64 -0
- package/components/templates-variant/src/ctx.d.ts +11 -0
- package/components/templates-variant/src/index.vue.d.ts +20 -0
- package/components/templates-variant/src/types.d.ts +2 -0
- package/components/upload/index.css +0 -7
- package/components/upload/index.mjs +501 -0
- package/components/upload/src/ctx.d.ts +36 -38
- package/components/upload/src/file.vue.d.ts +22 -21
- package/components/upload/src/index.vue.d.ts +78 -78
- package/components/upload-plus/index.css +4 -8
- package/components/upload-plus/{index.js → index.mjs} +9497 -926
- package/components/upload-plus/src/api.d.ts +1 -1
- package/components/upload-plus/src/ctx.d.ts +25 -28
- package/components/upload-plus/src/index.vue.d.ts +58 -58
- package/components/van-cascader/index.css +0 -2
- package/components/van-cascader/{index.js → index.mjs} +41 -44
- package/components/van-cascader/src/ctx.d.ts +35 -35
- package/components/van-cascader/src/index.vue.d.ts +82 -82
- package/components/var-datetime-picker/index.css +0 -2
- package/components/var-datetime-picker/index.mjs +324 -0
- package/components/var-datetime-picker/src/ctx.d.ts +27 -26
- package/components/var-datetime-picker/src/index.vue.d.ts +57 -57
- package/components/vditor/{index.js → index.mjs} +9 -14
- package/components/vditor/src/ctx.d.ts +2 -1
- package/components/vditor/src/index.vue.d.ts +2 -3
- package/composables/index.mjs +85 -0
- package/composables/useSourceManager.d.ts +2 -2
- package/defaults.d.ts +1 -1
- package/index.css +22 -168
- package/index.d.ts +1 -1
- package/index.esm.js +44 -1
- package/package.json +257 -2
- package/shared/const/index.d.ts +1 -1
- package/shared/const/index.mjs +56 -0
- package/shared/element-plus/ctx.d.ts +26 -94
- package/shared/element-plus/index.mjs +285 -0
- package/shared/element-plus/instances.d.ts +29 -28
- package/shared/form/index.mjs +30 -0
- package/shared/helper/index.mjs +9 -0
- package/shared/index.mjs +1 -0
- package/shared/infer-prop/index.mjs +34 -0
- package/shared/progress-it/index.mjs +38 -0
- package/shared/rules/index.mjs +53 -0
- package/shared/types/source/index.d.ts +2 -1
- package/shared/upload/index.mjs +771 -0
- package/components/button/src/ctx.js +0 -1
- package/components/cascader/src/ctx.js +0 -1
- package/components/cascader/src/types.js +0 -1
- package/components/cascader/src/use.js +0 -1
- package/components/checkbox/src/ctx.js +0 -1
- package/components/checkbox/src/index.css +0 -1
- package/components/checkbox/src/types.js +0 -1
- package/components/color-picker/index.css +0 -1
- package/components/color-picker/src/ctx.js +0 -1
- package/components/color-picker/src/index.css +0 -1
- package/components/color-picker/src/types.js +0 -1
- package/components/date-picker/index.css +0 -1
- package/components/date-picker/src/ctx.js +0 -1
- package/components/date-picker/src/index.css +0 -1
- package/components/date-picker/src/types.js +0 -1
- package/components/download-plus/src/api.js +0 -1
- package/components/download-plus/src/const.js +0 -1
- package/components/download-plus/src/ctx.js +0 -1
- package/components/download-plus/src/index.css +0 -1
- package/components/download-plus/src/types.js +0 -1
- package/components/esri-input-geojson/index.js +0 -1563
- package/components/esri-input-geojson/src/const.js +0 -1
- package/components/esri-input-geojson/src/ctx.js +0 -1
- package/components/esri-input-geojson/src/index.css +0 -1
- package/components/esri-input-geojson/src/types.js +0 -1
- package/components/form/index.css +0 -1
- package/components/form/src/ctx.js +0 -1
- package/components/form/src/index.css +0 -1
- package/components/form/src/types.js +0 -1
- package/components/form/src/utils.js +0 -1
- package/components/form-item/src/ctx.js +0 -1
- package/components/form-item/src/index.css +0 -1
- package/components/form-item/src/types.js +0 -1
- package/components/form-item-renderer/index.css +0 -1
- package/components/form-item-renderer/src/ctx.js +0 -1
- package/components/form-item-renderer/src/index.css +0 -1
- package/components/form-item-renderer/src/symbols.js +0 -1
- package/components/form-item-renderer/src/types.js +0 -1
- package/components/form-item-renderer-template/index.css +0 -1
- package/components/form-item-renderer-template/src/ctx.js +0 -1
- package/components/form-item-renderer-template/src/index.css +0 -1
- package/components/form-item-renderer-template/src/types.js +0 -1
- package/components/geoinput/index.css +0 -1
- package/components/geoinput/src/ctx.js +0 -1
- package/components/geoinput/src/index.css +0 -1
- package/components/geoinput/src/types.js +0 -1
- package/components/geoinput-read/src/ctx.js +0 -1
- package/components/geoinput-read/src/index.css +0 -1
- package/components/geoinput-read/src/types.js +0 -1
- package/components/geoinput-update/index.js +0 -930
- package/components/geoinput-update/src/ctx.js +0 -1
- package/components/geoinput-update/src/index.css +0 -1
- package/components/geoinput-update/src/types.js +0 -1
- package/components/input/index.css +0 -1
- package/components/input/src/ctx.js +0 -1
- package/components/input/src/index.css +0 -1
- package/components/input/src/types.js +0 -1
- package/components/input-link/index.js +0 -163
- package/components/input-link/src/ctx.js +0 -1
- package/components/input-link/src/index.css +0 -1
- package/components/input-link/src/types.js +0 -1
- package/components/input-number/src/ctx.js +0 -1
- package/components/input-number/src/index.css +0 -1
- package/components/input-number/src/types.js +0 -1
- package/components/radio/src/ctx.js +0 -1
- package/components/radio/src/index.css +0 -1
- package/components/radio/src/types.js +0 -1
- package/components/select/src/ctx.js +0 -1
- package/components/select/src/index.css +0 -1
- package/components/select/src/types.js +0 -1
- package/components/slider/index.css +0 -1
- package/components/slider/src/ctx.js +0 -1
- package/components/slider/src/index.css +0 -1
- package/components/slider/src/types.js +0 -1
- package/components/switch/src/ctx.js +0 -1
- package/components/switch/src/index.css +0 -1
- package/components/switch/src/types.js +0 -1
- package/components/templates-default/index.css +0 -1
- package/components/templates-default/index.js +0 -347
- package/components/templates-default/src/ctx.js +0 -1
- package/components/templates-default/src/index.css +0 -1
- package/components/templates-default/src/types.js +0 -1
- package/components/templates-element-plus/index.css +0 -1
- package/components/templates-element-plus/index.js +0 -110
- package/components/templates-element-plus/src/ctx.js +0 -1
- package/components/templates-element-plus/src/index.css +0 -1
- package/components/templates-element-plus/src/types.js +0 -1
- package/components/templates-esri/index.css +0 -1
- package/components/templates-esri/index.js +0 -65
- package/components/templates-esri/src/ctx.js +0 -1
- package/components/templates-esri/src/index.css +0 -1
- package/components/templates-esri/src/types.js +0 -1
- package/components/templates-layout/index.js +0 -141
- package/components/templates-layout/src/ctx.js +0 -1
- package/components/templates-layout/src/index.css +0 -1
- package/components/templates-layout/src/types.js +0 -1
- package/components/templates-mapbox/index.css +0 -1
- package/components/templates-mapbox/index.js +0 -65
- package/components/templates-mapbox/src/ctx.js +0 -1
- package/components/templates-mapbox/src/index.css +0 -1
- package/components/templates-mapbox/src/types.js +0 -1
- package/components/upload/index.js +0 -565
- package/components/upload/src/ctx.js +0 -1
- package/components/upload/src/index.css +0 -1
- package/components/upload/src/types.js +0 -1
- package/components/upload-plus/src/api.js +0 -28
- package/components/upload-plus/src/const.js +0 -1
- package/components/upload-plus/src/ctx.js +0 -1
- package/components/upload-plus/src/index.css +0 -1
- package/components/upload-plus/src/types.js +0 -1
- package/components/van-cascader/src/ctx.js +0 -1
- package/components/van-cascader/src/index.css +0 -1
- package/components/van-cascader/src/types.js +0 -1
- package/components/var-datetime-picker/index.js +0 -299
- package/components/var-datetime-picker/src/const.js +0 -1
- package/components/var-datetime-picker/src/ctx.js +0 -1
- package/components/var-datetime-picker/src/index.css +0 -1
- package/components/var-datetime-picker/src/types.js +0 -1
- package/components/vditor/index.css +0 -1
- package/components/vditor/src/ctx.js +0 -1
- package/components/vditor/src/index.css +0 -1
- package/components/vditor/src/types.js +0 -1
- package/composables/index.css +0 -1
- package/composables/index.js +0 -1
- package/shared/const/index.css +0 -1
- package/shared/const/index.js +0 -1
- package/shared/element-plus/index.css +0 -1
- package/shared/element-plus/index.js +0 -1
- package/shared/form/index.css +0 -1
- package/shared/form/index.js +0 -1
- package/shared/helper/index.css +0 -1
- package/shared/helper/index.js +0 -1
- package/shared/index.css +0 -1
- package/shared/index.js +0 -1
- package/shared/infer-prop/index.css +0 -1
- package/shared/infer-prop/index.js +0 -1
- package/shared/progress-it/index.css +0 -1
- package/shared/progress-it/index.js +0 -1
- package/shared/rules/index.css +0 -1
- package/shared/rules/index.js +0 -1
- package/shared/types/form/index.css +0 -1
- package/shared/types/form/index.js +0 -1
- package/shared/types/index.css +0 -1
- package/shared/types/index.js +0 -1
- package/shared/types/source/index.css +0 -1
- package/shared/types/source/index.js +0 -1
- package/shared/types/source-manager/index.css +0 -1
- package/shared/types/source-manager/index.js +0 -1
- package/shared/upload/index.css +0 -1
- package/shared/upload/index.js +0 -1
- /package/{components/button/index.css → shared/types/form/index.mjs} +0 -0
- /package/{components/button/src/index.css → shared/types/index.mjs} +0 -0
- /package/{components/cascader/src/index.css → shared/types/source/index.mjs} +0 -0
- /package/{components/button/src/types.js → shared/types/source-manager/index.mjs} +0 -0
|
@@ -9,37 +9,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
9
9
|
type: BooleanConstructor;
|
|
10
10
|
default: any;
|
|
11
11
|
};
|
|
12
|
-
label: StringConstructor;
|
|
13
|
-
labelWidth: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
|
|
14
|
-
prop: {
|
|
15
|
-
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>>;
|
|
16
|
-
readonly required: false;
|
|
17
|
-
readonly validator: (val: unknown) => boolean;
|
|
18
|
-
__epPropKey: true;
|
|
19
|
-
};
|
|
20
12
|
required: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
21
|
-
rules: {
|
|
22
|
-
readonly type: import("vue").PropType<unknown>;
|
|
23
|
-
readonly required: false;
|
|
24
|
-
readonly validator: (val: unknown) => boolean;
|
|
25
|
-
__epPropKey: true;
|
|
26
|
-
};
|
|
27
|
-
error: StringConstructor;
|
|
28
|
-
validateStatus: {
|
|
29
|
-
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "error" | "success" | "validating", unknown>>;
|
|
30
|
-
readonly required: false;
|
|
31
|
-
readonly validator: (val: unknown) => boolean;
|
|
32
|
-
__epPropKey: true;
|
|
33
|
-
};
|
|
34
|
-
for: StringConstructor;
|
|
35
|
-
inlineMessage: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, BooleanConstructor], unknown, unknown, "", boolean>;
|
|
36
|
-
showMessage: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
37
13
|
formItemSize: {
|
|
38
14
|
type: import("vue").PropType<"default" | "small" | "large">;
|
|
39
15
|
default: "default" | "small" | "large";
|
|
40
16
|
};
|
|
41
17
|
formItemSlots: {
|
|
42
|
-
type: import("vue").PropType<import("
|
|
18
|
+
type: import("vue").PropType<import("@vunk/form/components/form-item/src/types").FormItemSlots>;
|
|
43
19
|
default: any;
|
|
44
20
|
};
|
|
45
21
|
elRef: {
|
|
@@ -54,27 +30,51 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
54
30
|
type: import("vue").PropType<"right">;
|
|
55
31
|
default: string;
|
|
56
32
|
};
|
|
33
|
+
label: StringConstructor;
|
|
34
|
+
labelWidth: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
|
|
35
|
+
prop: {
|
|
36
|
+
readonly type: import("vue").PropType<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>>;
|
|
37
|
+
readonly required: false;
|
|
38
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
39
|
+
__epPropKey: true;
|
|
40
|
+
};
|
|
41
|
+
rules: {
|
|
42
|
+
readonly type: import("vue").PropType<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>>;
|
|
43
|
+
readonly required: false;
|
|
44
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
45
|
+
__epPropKey: true;
|
|
46
|
+
};
|
|
47
|
+
error: StringConstructor;
|
|
48
|
+
validateStatus: {
|
|
49
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "success" | "error" | "validating", unknown>>;
|
|
50
|
+
readonly required: false;
|
|
51
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
52
|
+
__epPropKey: true;
|
|
53
|
+
};
|
|
54
|
+
for: StringConstructor;
|
|
55
|
+
inlineMessage: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, BooleanConstructor], unknown, unknown, "", boolean>;
|
|
56
|
+
showMessage: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
57
57
|
emptyValues: ArrayConstructor;
|
|
58
58
|
valueOnClear: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor, BooleanConstructor, FunctionConstructor], unknown, unknown, undefined, boolean>;
|
|
59
59
|
size: {
|
|
60
60
|
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
|
|
61
61
|
readonly required: false;
|
|
62
|
-
readonly validator: (val: unknown) => boolean;
|
|
62
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
63
63
|
__epPropKey: true;
|
|
64
64
|
};
|
|
65
65
|
placeholder: StringConstructor;
|
|
66
66
|
disabled: BooleanConstructor;
|
|
67
67
|
clearable: BooleanConstructor;
|
|
68
68
|
filterable: BooleanConstructor;
|
|
69
|
-
filterMethod: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => (node: import("element-plus
|
|
70
|
-
(): (node: import("element-plus
|
|
69
|
+
filterMethod: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => (node: import("element-plus").CascaderNode, keyword: string) => boolean) | (() => (node: import("element-plus").CascaderNode, keyword: string) => boolean) | {
|
|
70
|
+
(): (node: import("element-plus").CascaderNode, keyword: string) => boolean;
|
|
71
71
|
new (): any;
|
|
72
72
|
readonly prototype: any;
|
|
73
|
-
} | ((new (...args: any[]) => (node: import("element-plus
|
|
74
|
-
(): (node: import("element-plus
|
|
73
|
+
} | ((new (...args: any[]) => (node: import("element-plus").CascaderNode, keyword: string) => boolean) | (() => (node: import("element-plus").CascaderNode, keyword: string) => boolean) | {
|
|
74
|
+
(): (node: import("element-plus").CascaderNode, keyword: string) => boolean;
|
|
75
75
|
new (): any;
|
|
76
76
|
readonly prototype: any;
|
|
77
|
-
})[], unknown, unknown, (node: import("element-plus
|
|
77
|
+
})[], unknown, unknown, (node: import("element-plus").CascaderNode, keyword: string) => boolean, boolean>;
|
|
78
78
|
separator: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
|
|
79
79
|
showAllLevels: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
|
|
80
80
|
collapseTags: BooleanConstructor;
|
|
@@ -96,14 +96,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
96
96
|
default: string;
|
|
97
97
|
type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "success" | "warning" | "info" | "primary" | "danger", unknown>>;
|
|
98
98
|
required: false;
|
|
99
|
-
validator: (val: unknown) => boolean;
|
|
99
|
+
validator: ((val: unknown) => boolean) | undefined;
|
|
100
100
|
__epPropKey: true;
|
|
101
101
|
};
|
|
102
102
|
validateEvent: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
|
|
103
103
|
modelValue: {
|
|
104
|
-
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) =>
|
|
104
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => import("element-plus/es/components/cascader-panel/src/node").CascaderValue & {}) | (() => import("element-plus/es/components/cascader-panel/src/node").CascaderValue) | ((new (...args: any[]) => import("element-plus/es/components/cascader-panel/src/node").CascaderValue & {}) | (() => import("element-plus/es/components/cascader-panel/src/node").CascaderValue))[], unknown, unknown>>;
|
|
105
105
|
readonly required: false;
|
|
106
|
-
readonly validator: (val: unknown) => boolean;
|
|
106
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
107
107
|
__epPropKey: true;
|
|
108
108
|
};
|
|
109
109
|
options: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => import("element-plus").CascaderOption[]) | (() => import("element-plus").CascaderOption[]) | ((new (...args: any[]) => import("element-plus").CascaderOption[]) | (() => import("element-plus").CascaderOption[]))[], unknown, unknown, () => import("element-plus").CascaderOption[], boolean>;
|
|
@@ -125,7 +125,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
125
125
|
blur: (evt: FocusEvent) => boolean;
|
|
126
126
|
visibleChange: (val: boolean) => boolean;
|
|
127
127
|
expandChange: (val: import("element-plus").CascaderValue) => boolean;
|
|
128
|
-
removeTag: (val: import("element-plus
|
|
128
|
+
removeTag: (val: import("element-plus").CascaderNode["valueByOption"]) => boolean;
|
|
129
129
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
130
130
|
optionsUrl: {
|
|
131
131
|
type: StringConstructor;
|
|
@@ -135,37 +135,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
135
135
|
type: BooleanConstructor;
|
|
136
136
|
default: any;
|
|
137
137
|
};
|
|
138
|
-
label: StringConstructor;
|
|
139
|
-
labelWidth: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
|
|
140
|
-
prop: {
|
|
141
|
-
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>>;
|
|
142
|
-
readonly required: false;
|
|
143
|
-
readonly validator: (val: unknown) => boolean;
|
|
144
|
-
__epPropKey: true;
|
|
145
|
-
};
|
|
146
138
|
required: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
147
|
-
rules: {
|
|
148
|
-
readonly type: import("vue").PropType<unknown>;
|
|
149
|
-
readonly required: false;
|
|
150
|
-
readonly validator: (val: unknown) => boolean;
|
|
151
|
-
__epPropKey: true;
|
|
152
|
-
};
|
|
153
|
-
error: StringConstructor;
|
|
154
|
-
validateStatus: {
|
|
155
|
-
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "error" | "success" | "validating", unknown>>;
|
|
156
|
-
readonly required: false;
|
|
157
|
-
readonly validator: (val: unknown) => boolean;
|
|
158
|
-
__epPropKey: true;
|
|
159
|
-
};
|
|
160
|
-
for: StringConstructor;
|
|
161
|
-
inlineMessage: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, BooleanConstructor], unknown, unknown, "", boolean>;
|
|
162
|
-
showMessage: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
163
139
|
formItemSize: {
|
|
164
140
|
type: import("vue").PropType<"default" | "small" | "large">;
|
|
165
141
|
default: "default" | "small" | "large";
|
|
166
142
|
};
|
|
167
143
|
formItemSlots: {
|
|
168
|
-
type: import("vue").PropType<import("
|
|
144
|
+
type: import("vue").PropType<import("@vunk/form/components/form-item/src/types").FormItemSlots>;
|
|
169
145
|
default: any;
|
|
170
146
|
};
|
|
171
147
|
elRef: {
|
|
@@ -180,27 +156,51 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
180
156
|
type: import("vue").PropType<"right">;
|
|
181
157
|
default: string;
|
|
182
158
|
};
|
|
159
|
+
label: StringConstructor;
|
|
160
|
+
labelWidth: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
|
|
161
|
+
prop: {
|
|
162
|
+
readonly type: import("vue").PropType<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>>;
|
|
163
|
+
readonly required: false;
|
|
164
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
165
|
+
__epPropKey: true;
|
|
166
|
+
};
|
|
167
|
+
rules: {
|
|
168
|
+
readonly type: import("vue").PropType<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>>;
|
|
169
|
+
readonly required: false;
|
|
170
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
171
|
+
__epPropKey: true;
|
|
172
|
+
};
|
|
173
|
+
error: StringConstructor;
|
|
174
|
+
validateStatus: {
|
|
175
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "success" | "error" | "validating", unknown>>;
|
|
176
|
+
readonly required: false;
|
|
177
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
178
|
+
__epPropKey: true;
|
|
179
|
+
};
|
|
180
|
+
for: StringConstructor;
|
|
181
|
+
inlineMessage: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, BooleanConstructor], unknown, unknown, "", boolean>;
|
|
182
|
+
showMessage: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
183
183
|
emptyValues: ArrayConstructor;
|
|
184
184
|
valueOnClear: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor, BooleanConstructor, FunctionConstructor], unknown, unknown, undefined, boolean>;
|
|
185
185
|
size: {
|
|
186
186
|
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
|
|
187
187
|
readonly required: false;
|
|
188
|
-
readonly validator: (val: unknown) => boolean;
|
|
188
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
189
189
|
__epPropKey: true;
|
|
190
190
|
};
|
|
191
191
|
placeholder: StringConstructor;
|
|
192
192
|
disabled: BooleanConstructor;
|
|
193
193
|
clearable: BooleanConstructor;
|
|
194
194
|
filterable: BooleanConstructor;
|
|
195
|
-
filterMethod: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => (node: import("element-plus
|
|
196
|
-
(): (node: import("element-plus
|
|
195
|
+
filterMethod: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => (node: import("element-plus").CascaderNode, keyword: string) => boolean) | (() => (node: import("element-plus").CascaderNode, keyword: string) => boolean) | {
|
|
196
|
+
(): (node: import("element-plus").CascaderNode, keyword: string) => boolean;
|
|
197
197
|
new (): any;
|
|
198
198
|
readonly prototype: any;
|
|
199
|
-
} | ((new (...args: any[]) => (node: import("element-plus
|
|
200
|
-
(): (node: import("element-plus
|
|
199
|
+
} | ((new (...args: any[]) => (node: import("element-plus").CascaderNode, keyword: string) => boolean) | (() => (node: import("element-plus").CascaderNode, keyword: string) => boolean) | {
|
|
200
|
+
(): (node: import("element-plus").CascaderNode, keyword: string) => boolean;
|
|
201
201
|
new (): any;
|
|
202
202
|
readonly prototype: any;
|
|
203
|
-
})[], unknown, unknown, (node: import("element-plus
|
|
203
|
+
})[], unknown, unknown, (node: import("element-plus").CascaderNode, keyword: string) => boolean, boolean>;
|
|
204
204
|
separator: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
|
|
205
205
|
showAllLevels: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
|
|
206
206
|
collapseTags: BooleanConstructor;
|
|
@@ -222,14 +222,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
222
222
|
default: string;
|
|
223
223
|
type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "success" | "warning" | "info" | "primary" | "danger", unknown>>;
|
|
224
224
|
required: false;
|
|
225
|
-
validator: (val: unknown) => boolean;
|
|
225
|
+
validator: ((val: unknown) => boolean) | undefined;
|
|
226
226
|
__epPropKey: true;
|
|
227
227
|
};
|
|
228
228
|
validateEvent: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
|
|
229
229
|
modelValue: {
|
|
230
|
-
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) =>
|
|
230
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => import("element-plus/es/components/cascader-panel/src/node").CascaderValue & {}) | (() => import("element-plus/es/components/cascader-panel/src/node").CascaderValue) | ((new (...args: any[]) => import("element-plus/es/components/cascader-panel/src/node").CascaderValue & {}) | (() => import("element-plus/es/components/cascader-panel/src/node").CascaderValue))[], unknown, unknown>>;
|
|
231
231
|
readonly required: false;
|
|
232
|
-
readonly validator: (val: unknown) => boolean;
|
|
232
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
233
233
|
__epPropKey: true;
|
|
234
234
|
};
|
|
235
235
|
options: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => import("element-plus").CascaderOption[]) | (() => import("element-plus").CascaderOption[]) | ((new (...args: any[]) => import("element-plus").CascaderOption[]) | (() => import("element-plus").CascaderOption[]))[], unknown, unknown, () => import("element-plus").CascaderOption[], boolean>;
|
|
@@ -243,33 +243,33 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
243
243
|
onExpandChange?: (val: import("element-plus").CascaderValue) => any;
|
|
244
244
|
onRemoveTag?: (val: import("element-plus/es/components/cascader-panel/src/node").CascaderNodeValue | import("element-plus/es/components/cascader-panel/src/node").CascaderNodePathValue) => any;
|
|
245
245
|
}, {
|
|
246
|
-
|
|
246
|
+
disabled: boolean;
|
|
247
247
|
required: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
248
|
-
inlineMessage: import("element-plus/es/utils").EpPropMergeType<readonly [StringConstructor, BooleanConstructor], unknown, unknown>;
|
|
249
|
-
showMessage: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
250
248
|
props: import("element-plus").CascaderProps;
|
|
251
249
|
formItemSize: "default" | "small" | "large";
|
|
252
|
-
formItemSlots: import("
|
|
250
|
+
formItemSlots: import("@vunk/form/components/form-item/src/types").FormItemSlots;
|
|
253
251
|
inline: boolean;
|
|
254
252
|
readonly: boolean;
|
|
255
253
|
labelPosition: "right";
|
|
254
|
+
labelWidth: import("element-plus/es/utils").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
|
|
255
|
+
inlineMessage: import("element-plus/es/utils").EpPropMergeType<readonly [StringConstructor, BooleanConstructor], unknown, unknown>;
|
|
256
|
+
showMessage: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
256
257
|
valueOnClear: import("element-plus/es/utils").EpPropMergeType<readonly [StringConstructor, NumberConstructor, BooleanConstructor, FunctionConstructor], unknown, unknown>;
|
|
257
|
-
disabled: boolean;
|
|
258
258
|
clearable: boolean;
|
|
259
|
-
validateEvent: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
260
259
|
filterable: boolean;
|
|
261
|
-
|
|
262
|
-
|
|
260
|
+
filterMethod: (node: import("element-plus").CascaderNode, keyword: string) => boolean;
|
|
261
|
+
separator: string;
|
|
262
|
+
showAllLevels: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
263
263
|
collapseTags: boolean;
|
|
264
|
-
collapseTagsTooltip: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
265
264
|
maxCollapseTags: number;
|
|
265
|
+
collapseTagsTooltip: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
266
|
+
debounce: number;
|
|
267
|
+
beforeFilter: (value: string) => boolean | Promise<any>;
|
|
268
|
+
popperClass: string;
|
|
266
269
|
teleported: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
267
270
|
tagType: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "success" | "warning" | "info" | "primary" | "danger", unknown>;
|
|
271
|
+
validateEvent: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
268
272
|
options: import("element-plus").CascaderOption[];
|
|
269
273
|
optionsUrl: string;
|
|
270
|
-
separator: string;
|
|
271
|
-
showAllLevels: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
272
|
-
debounce: number;
|
|
273
|
-
beforeFilter: (value: string) => boolean | Promise<any>;
|
|
274
274
|
}, {}>;
|
|
275
275
|
export default _default;
|
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
import { _VkfFormItemCtx, VkfFormItem } from '@vunk/form/components/form-item';
|
|
2
|
+
import { defineComponent, computed, ref, resolveComponent, openBlock, createBlock, normalizeProps, guardReactiveProps, withCtx, createElementVNode, createVNode, normalizeClass, createCommentVNode } from 'vue';
|
|
3
|
+
import { useComputedReadonly } from '@vunk/form/composables';
|
|
4
|
+
import { Popup } from 'vant';
|
|
5
|
+
import { DatePicker, TimePicker } from '@varlet/ui';
|
|
6
|
+
import { ElDatePicker, ElTabPane, ElTabs, dayjs } from 'element-plus';
|
|
7
|
+
import 'vant/es/popup/style';
|
|
8
|
+
import '@varlet/ui/es/date-picker/style';
|
|
9
|
+
import '@varlet/ui/es/time-picker/style';
|
|
10
|
+
import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
|
|
11
|
+
|
|
12
|
+
const props = {
|
|
13
|
+
..._VkfFormItemCtx.props,
|
|
14
|
+
modelValue: null,
|
|
15
|
+
readonly: Boolean,
|
|
16
|
+
type: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: "month"
|
|
19
|
+
},
|
|
20
|
+
// allowed-dates
|
|
21
|
+
allowedDates: {
|
|
22
|
+
type: Function,
|
|
23
|
+
default: void 0
|
|
24
|
+
},
|
|
25
|
+
useSeconds: Boolean,
|
|
26
|
+
valueFormat: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: "YYYY-MM-DD HH:mm"
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const emits = {
|
|
32
|
+
"update:modelValue": null
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const VarDatePickerTypeOptions = [
|
|
36
|
+
{
|
|
37
|
+
label: "\u65E5\u671F",
|
|
38
|
+
value: "date" /* date */,
|
|
39
|
+
format: "YYYY-MM-DD"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
label: "\u5E74",
|
|
43
|
+
value: "year" /* year */,
|
|
44
|
+
format: "YYYY"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
label: "\u6708",
|
|
48
|
+
value: "month" /* month */,
|
|
49
|
+
format: "YYYY-MM"
|
|
50
|
+
}
|
|
51
|
+
];
|
|
52
|
+
const VarDatePickerTypeReflect = VarDatePickerTypeOptions.reduce((acc, cur) => {
|
|
53
|
+
acc[cur.value] = cur;
|
|
54
|
+
return acc;
|
|
55
|
+
}, {});
|
|
56
|
+
const ElDatePickerTypeOptions = [
|
|
57
|
+
{
|
|
58
|
+
label: "\u65E5\u671F",
|
|
59
|
+
value: "date",
|
|
60
|
+
varDatePickerType: "date" /* date */,
|
|
61
|
+
isRange: false
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
label: "\u5E74",
|
|
65
|
+
value: "year",
|
|
66
|
+
varDatePickerType: "year" /* year */,
|
|
67
|
+
isRange: false
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
label: "\u6708",
|
|
71
|
+
value: "month",
|
|
72
|
+
varDatePickerType: "month" /* month */,
|
|
73
|
+
isRange: false
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
value: "dates",
|
|
77
|
+
label: "\u591A\u9009\u65E5\u671F",
|
|
78
|
+
varDatePickerType: "date" /* date */,
|
|
79
|
+
isRange: false
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
value: "week",
|
|
83
|
+
label: "\u5468",
|
|
84
|
+
varDatePickerType: "date" /* date */,
|
|
85
|
+
isRange: false
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
value: "datetime",
|
|
89
|
+
label: "\u65E5\u671F\u65F6\u95F4",
|
|
90
|
+
varDatePickerType: "date" /* date */,
|
|
91
|
+
isRange: false,
|
|
92
|
+
hasTime: true
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
value: "datetimerange",
|
|
96
|
+
label: "\u65E5\u671F\u65F6\u95F4\u8303\u56F4",
|
|
97
|
+
varDatePickerType: "date" /* date */,
|
|
98
|
+
/**
|
|
99
|
+
* 采用独立的时间选择器
|
|
100
|
+
*/
|
|
101
|
+
isRange: false,
|
|
102
|
+
hasTime: true
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
value: "daterange",
|
|
106
|
+
label: "\u65E5\u671F\u8303\u56F4",
|
|
107
|
+
varDatePickerType: "date" /* date */,
|
|
108
|
+
isRange: true
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
value: "monthrange",
|
|
112
|
+
label: "\u6708\u8303\u56F4",
|
|
113
|
+
varDatePickerType: "month" /* month */,
|
|
114
|
+
isRange: true
|
|
115
|
+
}
|
|
116
|
+
];
|
|
117
|
+
const ElDatePickerTypeReflect = ElDatePickerTypeOptions.reduce((acc, cur) => {
|
|
118
|
+
acc[cur.value] = cur;
|
|
119
|
+
return acc;
|
|
120
|
+
}, {});
|
|
121
|
+
|
|
122
|
+
var _sfc_main = defineComponent({
|
|
123
|
+
name: "VkfVarDatetimePicker",
|
|
124
|
+
components: {
|
|
125
|
+
VkfFormItem,
|
|
126
|
+
ElDatePicker,
|
|
127
|
+
DatePicker,
|
|
128
|
+
TimePicker,
|
|
129
|
+
Popup,
|
|
130
|
+
ElTabPane,
|
|
131
|
+
ElTabs
|
|
132
|
+
},
|
|
133
|
+
emits,
|
|
134
|
+
props,
|
|
135
|
+
setup(props2, { emit }) {
|
|
136
|
+
const formItemBindProps = _VkfFormItemCtx.createBindProps(props2);
|
|
137
|
+
const varDatePickerType = computed(() => {
|
|
138
|
+
return ElDatePickerTypeReflect[props2.type].varDatePickerType;
|
|
139
|
+
});
|
|
140
|
+
const varDatePickerFormat = computed(() => {
|
|
141
|
+
return VarDatePickerTypeReflect[varDatePickerType.value].format;
|
|
142
|
+
});
|
|
143
|
+
const isRange = computed(() => {
|
|
144
|
+
return !!ElDatePickerTypeReflect[props2.type].isRange;
|
|
145
|
+
});
|
|
146
|
+
const hasTime = computed(() => {
|
|
147
|
+
return !!ElDatePickerTypeReflect[props2.type].hasTime;
|
|
148
|
+
});
|
|
149
|
+
const getDateFromModelValue = () => {
|
|
150
|
+
return props2.modelValue ? dayjs(props2.modelValue).format(varDatePickerFormat.value) : "";
|
|
151
|
+
};
|
|
152
|
+
const getTimeFromModelValue = () => {
|
|
153
|
+
return props2.modelValue ? dayjs(props2.modelValue).format(props2.useSeconds ? "HH:mm:ss" : "HH:mm") : "";
|
|
154
|
+
};
|
|
155
|
+
const tansformModelValueByDateValue = (dateValue) => {
|
|
156
|
+
if (!dateValue) return "";
|
|
157
|
+
const date = dayjs(dateValue, varDatePickerFormat.value);
|
|
158
|
+
if (!props2.modelValue) {
|
|
159
|
+
return date.format(props2.valueFormat);
|
|
160
|
+
}
|
|
161
|
+
return dayjs(props2.modelValue).year(date.year()).month(date.month()).date(date.date()).format(props2.valueFormat);
|
|
162
|
+
};
|
|
163
|
+
const tansformModelValueByTimeValue = (timeValue) => {
|
|
164
|
+
if (!timeValue) return "";
|
|
165
|
+
const time = dayjs(
|
|
166
|
+
timeValue,
|
|
167
|
+
props2.useSeconds ? "HH:mm:ss" : "HH:mm"
|
|
168
|
+
);
|
|
169
|
+
if (!props2.modelValue) {
|
|
170
|
+
return time.format(props2.valueFormat);
|
|
171
|
+
}
|
|
172
|
+
return dayjs(props2.modelValue).hour(time.hour()).minute(time.minute()).second(time.second()).format(props2.valueFormat);
|
|
173
|
+
};
|
|
174
|
+
const valueDate = computed({
|
|
175
|
+
get() {
|
|
176
|
+
return getDateFromModelValue();
|
|
177
|
+
},
|
|
178
|
+
set(val) {
|
|
179
|
+
const nModelValue = tansformModelValueByDateValue(val);
|
|
180
|
+
emit("update:modelValue", nModelValue);
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
const valueTime = computed({
|
|
184
|
+
get() {
|
|
185
|
+
return getTimeFromModelValue();
|
|
186
|
+
},
|
|
187
|
+
set(val) {
|
|
188
|
+
const nModelValue = tansformModelValueByTimeValue(val);
|
|
189
|
+
emit("update:modelValue", nModelValue);
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
const readonly = useComputedReadonly(props2);
|
|
193
|
+
const popupShow = ref(false);
|
|
194
|
+
const currentTab = ref("date");
|
|
195
|
+
const inputBlur = (e) => {
|
|
196
|
+
const target = e.target;
|
|
197
|
+
target.blur();
|
|
198
|
+
};
|
|
199
|
+
const preInput = () => {
|
|
200
|
+
if (readonly.value) return;
|
|
201
|
+
if (props2.modelValue && hasTime.value) {
|
|
202
|
+
currentTab.value = "time";
|
|
203
|
+
}
|
|
204
|
+
popupShow.value = true;
|
|
205
|
+
};
|
|
206
|
+
return {
|
|
207
|
+
preInput,
|
|
208
|
+
inputBlur,
|
|
209
|
+
popupShow,
|
|
210
|
+
formItemBindProps,
|
|
211
|
+
varDatePickerType,
|
|
212
|
+
isRange,
|
|
213
|
+
hasTime,
|
|
214
|
+
currentTab,
|
|
215
|
+
valueTime,
|
|
216
|
+
valueDate
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
222
|
+
const _component_ElDatePicker = resolveComponent("ElDatePicker");
|
|
223
|
+
const _component_DatePicker = resolveComponent("DatePicker");
|
|
224
|
+
const _component_ElTabPane = resolveComponent("ElTabPane");
|
|
225
|
+
const _component_TimePicker = resolveComponent("TimePicker");
|
|
226
|
+
const _component_ElTabs = resolveComponent("ElTabs");
|
|
227
|
+
const _component_Popup = resolveComponent("Popup");
|
|
228
|
+
const _component_VkfFormItem = resolveComponent("VkfFormItem");
|
|
229
|
+
return openBlock(), createBlock(
|
|
230
|
+
_component_VkfFormItem,
|
|
231
|
+
normalizeProps(guardReactiveProps(_ctx.formItemBindProps)),
|
|
232
|
+
{
|
|
233
|
+
default: withCtx(() => [
|
|
234
|
+
createElementVNode(
|
|
235
|
+
"div",
|
|
236
|
+
{
|
|
237
|
+
onClickCapture: _cache[0] || (_cache[0] = (...args) => _ctx.preInput && _ctx.preInput(...args))
|
|
238
|
+
},
|
|
239
|
+
[
|
|
240
|
+
createVNode(_component_ElDatePicker, {
|
|
241
|
+
"popper-class": "var-datetime-picker-el-popover",
|
|
242
|
+
"model-value": _ctx.modelValue,
|
|
243
|
+
onFocus: _ctx.inputBlur,
|
|
244
|
+
type: _ctx.type,
|
|
245
|
+
readonly: true,
|
|
246
|
+
"value-format": _ctx.valueFormat
|
|
247
|
+
}, null, 8, ["model-value", "onFocus", "type", "value-format"])
|
|
248
|
+
],
|
|
249
|
+
32
|
|
250
|
+
/* NEED_HYDRATION */
|
|
251
|
+
),
|
|
252
|
+
createVNode(_component_Popup, {
|
|
253
|
+
position: "bottom",
|
|
254
|
+
show: _ctx.popupShow,
|
|
255
|
+
"onUpdate:show": _cache[4] || (_cache[4] = ($event) => _ctx.popupShow = $event),
|
|
256
|
+
round: ""
|
|
257
|
+
}, {
|
|
258
|
+
default: withCtx(() => [
|
|
259
|
+
createVNode(_component_ElTabs, {
|
|
260
|
+
class: normalizeClass(["var-datetime-picker-el-tabs", {
|
|
261
|
+
"is-hidden": !_ctx.hasTime
|
|
262
|
+
}]),
|
|
263
|
+
modelValue: _ctx.currentTab,
|
|
264
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => _ctx.currentTab = $event)
|
|
265
|
+
}, {
|
|
266
|
+
default: withCtx(() => [
|
|
267
|
+
createVNode(_component_ElTabPane, {
|
|
268
|
+
label: _ctx.valueDate || "\u9009\u62E9\u65E5\u671F",
|
|
269
|
+
name: "date"
|
|
270
|
+
}, {
|
|
271
|
+
default: withCtx(() => [
|
|
272
|
+
createVNode(_component_DatePicker, {
|
|
273
|
+
type: _ctx.varDatePickerType,
|
|
274
|
+
range: _ctx.isRange,
|
|
275
|
+
modelValue: _ctx.valueDate,
|
|
276
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.valueDate = $event),
|
|
277
|
+
"allowed-dates": _ctx.allowedDates
|
|
278
|
+
}, null, 8, ["type", "range", "modelValue", "allowed-dates"])
|
|
279
|
+
]),
|
|
280
|
+
_: 1
|
|
281
|
+
/* STABLE */
|
|
282
|
+
}, 8, ["label"]),
|
|
283
|
+
_ctx.hasTime ? (openBlock(), createBlock(_component_ElTabPane, {
|
|
284
|
+
key: 0,
|
|
285
|
+
label: _ctx.valueTime || "\u9009\u62E9\u65F6\u95F4",
|
|
286
|
+
name: "time"
|
|
287
|
+
}, {
|
|
288
|
+
default: withCtx(() => [
|
|
289
|
+
createVNode(_component_TimePicker, {
|
|
290
|
+
modelValue: _ctx.valueTime,
|
|
291
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.valueTime = $event),
|
|
292
|
+
format: "24hr"
|
|
293
|
+
}, null, 8, ["modelValue"])
|
|
294
|
+
]),
|
|
295
|
+
_: 1
|
|
296
|
+
/* STABLE */
|
|
297
|
+
}, 8, ["label"])) : createCommentVNode("v-if", true)
|
|
298
|
+
]),
|
|
299
|
+
_: 1
|
|
300
|
+
/* STABLE */
|
|
301
|
+
}, 8, ["class", "modelValue"])
|
|
302
|
+
]),
|
|
303
|
+
_: 1
|
|
304
|
+
/* STABLE */
|
|
305
|
+
}, 8, ["show"])
|
|
306
|
+
]),
|
|
307
|
+
_: 1
|
|
308
|
+
/* STABLE */
|
|
309
|
+
},
|
|
310
|
+
16
|
|
311
|
+
/* FULL_PROPS */
|
|
312
|
+
);
|
|
313
|
+
}
|
|
314
|
+
var VkfVarDatetimePicker = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/var-datetime-picker/src/index.vue"]]);
|
|
315
|
+
|
|
316
|
+
var types = /*#__PURE__*/Object.freeze({
|
|
317
|
+
__proto__: null
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
VkfVarDatetimePicker.install = (app) => {
|
|
321
|
+
app.component(VkfVarDatetimePicker.name, VkfVarDatetimePicker);
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
export { VkfVarDatetimePicker, types as __VkfVarDatetimePicker, VkfVarDatetimePicker as default };
|