@finema/core 1.4.220 → 2.1.0
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/README.md +79 -60
- package/dist/module.d.mts +4 -24
- package/dist/module.json +4 -3
- package/dist/module.mjs +75 -213
- package/dist/runtime/components/App.vue +27 -0
- package/dist/runtime/components/App.vue.d.ts +12 -0
- package/dist/runtime/components/DevToolsWindow/index.vue +312 -0
- package/dist/runtime/components/DevToolsWindow/index.vue.d.ts +2 -0
- package/dist/runtime/components/Dialog/index.vue +77 -110
- package/dist/runtime/components/Dialog/index.vue.d.ts +10 -0
- package/dist/runtime/components/Empty.vue +33 -18
- package/dist/runtime/components/Empty.vue.d.ts +12 -0
- package/dist/runtime/components/FlexDeck/Base.vue +154 -159
- package/dist/runtime/components/FlexDeck/Base.vue.d.ts +63 -0
- package/dist/runtime/components/FlexDeck/index.vue +67 -68
- package/dist/runtime/components/FlexDeck/index.vue.d.ts +43 -0
- package/dist/runtime/components/Form/FieldWrapper.vue +35 -23
- package/dist/runtime/components/Form/FieldWrapper.vue.d.ts +16 -0
- package/dist/runtime/components/Form/Fields.vue +92 -230
- package/dist/runtime/components/Form/Fields.vue.d.ts +14 -0
- package/dist/runtime/components/Form/InputCheckbox/index.vue +53 -28
- package/dist/runtime/components/Form/InputCheckbox/index.vue.d.ts +3 -0
- package/dist/runtime/components/Form/InputCheckbox/types.d.ts +5 -1
- package/dist/runtime/components/Form/InputDateTime/date_time_field.types.d.ts +1 -1
- package/dist/runtime/components/Form/InputDateTime/index.vue +97 -68
- package/dist/runtime/components/Form/InputDateTime/index.vue.d.ts +4 -0
- package/dist/runtime/components/Form/InputNumber/index.vue +61 -27
- package/dist/runtime/components/Form/InputNumber/index.vue.d.ts +5 -0
- package/dist/runtime/components/Form/InputNumber/types.d.ts +10 -5
- package/dist/runtime/components/Form/InputSelect/index.vue +95 -55
- package/dist/runtime/components/Form/InputSelect/index.vue.d.ts +5 -0
- package/dist/runtime/components/Form/InputSelect/types.d.ts +14 -8
- package/dist/runtime/components/Form/InputSelectMultiple/index.vue +108 -54
- package/dist/runtime/components/Form/InputSelectMultiple/index.vue.d.ts +3 -0
- package/dist/runtime/components/Form/InputSelectMultiple/types.d.ts +9 -8
- package/dist/runtime/components/Form/InputText/index.vue +135 -68
- package/dist/runtime/components/Form/InputText/index.vue.d.ts +5 -0
- package/dist/runtime/components/Form/InputText/types.d.ts +4 -3
- package/dist/runtime/components/Form/InputTextarea/index.vue +57 -25
- package/dist/runtime/components/Form/InputTextarea/index.vue.d.ts +3 -0
- package/dist/runtime/components/Form/InputTextarea/types.d.ts +7 -2
- package/dist/runtime/components/Form/InputToggle/index.vue +51 -27
- package/dist/runtime/components/Form/InputToggle/index.vue.d.ts +3 -0
- package/dist/runtime/components/Form/InputToggle/types.d.ts +5 -1
- package/dist/runtime/components/Form/index.vue +5 -6
- package/dist/runtime/components/Form/index.vue.d.ts +12 -0
- package/dist/runtime/components/Form/types.d.ts +13 -27
- package/dist/runtime/components/Image.vue +51 -36
- package/dist/runtime/components/Image.vue.d.ts +13 -0
- package/dist/runtime/components/Loader.vue +29 -27
- package/dist/runtime/components/Loader.vue.d.ts +22 -0
- package/dist/runtime/components/{LogItem.vue → Log/LogItem.vue} +44 -41
- package/dist/runtime/components/Log/LogItem.vue.d.ts +6 -0
- package/dist/runtime/components/Log/index.vue +28 -0
- package/dist/runtime/components/Log/index.vue.d.ts +7 -0
- package/dist/runtime/components/Table/Base.vue +166 -161
- package/dist/runtime/components/Table/Base.vue.d.ts +47 -0
- package/dist/runtime/components/Table/ColumnDate.vue +14 -16
- package/dist/runtime/components/Table/ColumnDate.vue.d.ts +8 -0
- package/dist/runtime/components/Table/ColumnDateTime.vue +16 -18
- package/dist/runtime/components/Table/ColumnDateTime.vue.d.ts +8 -0
- package/dist/runtime/components/Table/ColumnImage.vue +16 -15
- package/dist/runtime/components/Table/ColumnImage.vue.d.ts +8 -0
- package/dist/runtime/components/Table/ColumnNumber.vue +14 -14
- package/dist/runtime/components/Table/ColumnNumber.vue.d.ts +8 -0
- package/dist/runtime/components/Table/ColumnText.vue +24 -29
- package/dist/runtime/components/Table/ColumnText.vue.d.ts +8 -0
- package/dist/runtime/components/Table/Simple.vue +69 -70
- package/dist/runtime/components/Table/Simple.vue.d.ts +24 -0
- package/dist/runtime/components/Table/index.vue +178 -65
- package/dist/runtime/components/Table/index.vue.d.ts +25 -0
- package/dist/runtime/components/Table/types.d.ts +14 -18
- package/dist/runtime/components/Table/{types.mjs → types.js} +1 -0
- package/dist/runtime/components/TeleportSafe.vue +42 -40
- package/dist/runtime/components/TeleportSafe.vue.d.ts +16 -0
- package/dist/runtime/composables/loaderList.d.ts +2 -2
- package/dist/runtime/composables/loaderList.js +51 -0
- package/dist/runtime/composables/loaderObject.d.ts +1 -1
- package/dist/runtime/composables/loaderObject.js +50 -0
- package/dist/runtime/composables/loaderPage.d.ts +10 -11
- package/dist/runtime/composables/loaderPage.js +243 -0
- package/dist/runtime/composables/useApp.d.ts +4 -9
- package/dist/runtime/composables/{useApp.mjs → useApp.js} +0 -12
- package/dist/runtime/composables/useConfig.d.ts +3 -3
- package/dist/runtime/composables/useConfig.js +12 -0
- package/dist/runtime/composables/useDialog.d.ts +1 -7
- package/dist/runtime/composables/useDialog.js +53 -0
- package/dist/runtime/composables/useFlexDeck.d.ts +1 -1
- package/dist/runtime/composables/{useFlexDeck.mjs → useFlexDeck.js} +5 -5
- package/dist/runtime/composables/useForm.d.ts +5 -2
- package/dist/runtime/composables/useForm.js +37 -0
- package/dist/runtime/composables/useNotification.d.ts +6 -22
- package/dist/runtime/composables/{useNotification.mjs → useNotification.js} +5 -21
- package/dist/runtime/composables/useTable.d.ts +12 -11
- package/dist/runtime/composables/{useTable.mjs → useTable.js} +3 -8
- package/dist/runtime/composables/useUpload.d.ts +2 -2
- package/dist/runtime/composables/{useUpload.mjs → useUpload.js} +1 -1
- package/dist/runtime/helpers/apiBaseHelper.d.ts +29 -0
- package/dist/runtime/helpers/apiBaseHelper.js +63 -0
- package/dist/runtime/helpers/apiListHelper.d.ts +4 -6
- package/dist/runtime/helpers/apiListHelper.js +50 -0
- package/dist/runtime/helpers/apiObjectHelper.d.ts +19 -20
- package/dist/runtime/helpers/apiObjectHelper.js +51 -0
- package/dist/runtime/helpers/apiPageHelper.d.ts +44 -44
- package/dist/runtime/helpers/apiPageHelper.js +287 -0
- package/dist/runtime/helpers/componentHelper.d.ts +11 -12
- package/dist/runtime/helpers/{componentHelper.mjs → componentHelper.js} +2 -7
- package/dist/runtime/i18n/valibot.d.ts +69 -0
- package/dist/runtime/i18n/valibot.js +72 -0
- package/dist/runtime/plugin.d.ts +1 -1
- package/dist/runtime/plugin.js +12 -0
- package/dist/runtime/server/tsconfig.json +3 -0
- package/dist/runtime/theme/button.d.ts +5 -0
- package/dist/runtime/theme/button.js +1 -0
- package/dist/runtime/theme/dialog.d.ts +31 -0
- package/dist/runtime/theme/dialog.js +21 -0
- package/dist/runtime/theme/empty.d.ts +7 -0
- package/dist/runtime/theme/empty.js +7 -0
- package/dist/runtime/theme/form.d.ts +18 -0
- package/dist/runtime/theme/form.js +16 -0
- package/dist/runtime/theme/index.d.ts +10 -0
- package/dist/runtime/theme/index.js +10 -0
- package/dist/runtime/theme/input.d.ts +8 -0
- package/dist/runtime/theme/input.js +4 -0
- package/dist/runtime/theme/inputNumber.d.ts +8 -0
- package/dist/runtime/theme/inputNumber.js +4 -0
- package/dist/runtime/theme/loader.d.ts +28 -0
- package/dist/runtime/theme/loader.js +18 -0
- package/dist/runtime/theme/selectMenu.d.ts +17 -0
- package/dist/runtime/theme/selectMenu.js +18 -0
- package/dist/runtime/theme/table.d.ts +10 -0
- package/dist/runtime/theme/table.js +10 -0
- package/dist/runtime/theme/textarea.d.ts +5 -0
- package/dist/runtime/theme/textarea.js +1 -0
- package/dist/runtime/types/lib.d.ts +1 -1
- package/dist/runtime/utils/ArrayHelper.d.ts +1 -1
- package/dist/runtime/utils/{ArrayHelper.mjs → ArrayHelper.js} +1 -1
- package/dist/runtime/utils/ObjectHelper.d.ts +3 -3
- package/dist/runtime/utils/{ObjectHelper.mjs → ObjectHelper.js} +3 -3
- package/dist/runtime/utils/ParamHelper.d.ts +1 -1
- package/dist/runtime/utils/{ParamHelper.mjs → ParamHelper.js} +1 -1
- package/dist/types.d.mts +2 -15
- package/package.json +91 -100
- package/dist/module.cjs +0 -5
- package/dist/module.d.ts +0 -50
- package/dist/runtime/components/Alert.vue +0 -48
- package/dist/runtime/components/Avatar.vue +0 -27
- package/dist/runtime/components/Badge.vue +0 -11
- package/dist/runtime/components/Breadcrumb.vue +0 -44
- package/dist/runtime/components/Button/Group.vue +0 -37
- package/dist/runtime/components/Button/index.vue +0 -75
- package/dist/runtime/components/Card.vue +0 -38
- package/dist/runtime/components/Core.vue +0 -45
- package/dist/runtime/components/Dropdown/index.vue +0 -70
- package/dist/runtime/components/Dropdown/types.d.ts +0 -2
- package/dist/runtime/components/Dropdown/types.mjs +0 -17
- package/dist/runtime/components/Form/InputDateTimeRange/date_range_time_field.types.d.ts +0 -17
- package/dist/runtime/components/Form/InputDateTimeRange/index.vue +0 -91
- package/dist/runtime/components/Form/InputRadio/index.vue +0 -27
- package/dist/runtime/components/Form/InputRadio/types.d.ts +0 -8
- package/dist/runtime/components/Form/InputStatic/index.vue +0 -16
- package/dist/runtime/components/Form/InputStatic/types.d.ts +0 -4
- package/dist/runtime/components/Form/InputTags/index.vue +0 -141
- package/dist/runtime/components/Form/InputTags/types.d.ts +0 -11
- package/dist/runtime/components/Form/InputTextarea/types.mjs +0 -0
- package/dist/runtime/components/Form/InputToggle/types.mjs +0 -0
- package/dist/runtime/components/Form/InputUploadDropzone/index.vue +0 -206
- package/dist/runtime/components/Form/InputUploadDropzone/types.d.ts +0 -11
- package/dist/runtime/components/Form/InputUploadDropzone/types.mjs +0 -0
- package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.vue +0 -362
- package/dist/runtime/components/Form/InputUploadDropzoneAuto/types.d.ts +0 -23
- package/dist/runtime/components/Form/InputUploadDropzoneAuto/types.mjs +0 -0
- package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/ItemUpload.vue +0 -241
- package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/ItemView.vue +0 -110
- package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/index.vue +0 -171
- package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/types.d.ts +0 -23
- package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/types.mjs +0 -0
- package/dist/runtime/components/Form/InputUploadDropzoneImageAutoMultiple/ItemUpload.vue +0 -161
- package/dist/runtime/components/Form/InputUploadDropzoneImageAutoMultiple/ItemView.vue +0 -64
- package/dist/runtime/components/Form/InputUploadDropzoneImageAutoMultiple/index.vue +0 -178
- package/dist/runtime/components/Form/InputUploadDropzoneImageAutoMultiple/types.d.ts +0 -21
- package/dist/runtime/components/Form/InputUploadDropzoneImageAutoMultiple/types.mjs +0 -0
- package/dist/runtime/components/Form/InputUploadFileClassic/index.vue +0 -95
- package/dist/runtime/components/Form/InputUploadFileClassic/types.d.ts +0 -13
- package/dist/runtime/components/Form/InputUploadFileClassic/types.mjs +0 -0
- package/dist/runtime/components/Form/InputUploadFileClassicAuto/index.vue +0 -151
- package/dist/runtime/components/Form/InputUploadFileClassicAuto/types.d.ts +0 -18
- package/dist/runtime/components/Form/InputUploadFileClassicAuto/types.mjs +0 -0
- package/dist/runtime/components/Form/InputUploadImageAuto/index.vue +0 -219
- package/dist/runtime/components/Form/InputUploadImageAuto/types.d.ts +0 -20
- package/dist/runtime/components/Form/InputUploadImageAuto/types.mjs +0 -0
- package/dist/runtime/components/Form/InputWYSIWYG/UploadImageForm.vue +0 -55
- package/dist/runtime/components/Form/InputWYSIWYG/index.vue +0 -230
- package/dist/runtime/components/Form/InputWYSIWYG/types.d.ts +0 -19
- package/dist/runtime/components/Form/InputWYSIWYG/types.mjs +0 -0
- package/dist/runtime/components/Icon.vue +0 -23
- package/dist/runtime/components/Log.vue +0 -22
- package/dist/runtime/components/Modal/index.vue +0 -146
- package/dist/runtime/components/OTPInput.vue +0 -127
- package/dist/runtime/components/QRCode.vue +0 -22
- package/dist/runtime/components/SimplePagination.vue +0 -96
- package/dist/runtime/components/Slideover/index.vue +0 -110
- package/dist/runtime/components/Tabs/index.vue +0 -64
- package/dist/runtime/composables/loaderList.mjs +0 -52
- package/dist/runtime/composables/loaderObject.mjs +0 -52
- package/dist/runtime/composables/loaderPage.mjs +0 -229
- package/dist/runtime/composables/useConfig.mjs +0 -9
- package/dist/runtime/composables/useDialog.mjs +0 -81
- package/dist/runtime/composables/useForm.mjs +0 -18
- package/dist/runtime/core.config.d.ts +0 -14
- package/dist/runtime/core.config.mjs +0 -14
- package/dist/runtime/helpers/apiListHelper.mjs +0 -44
- package/dist/runtime/helpers/apiObjectHelper.mjs +0 -46
- package/dist/runtime/helpers/apiPageHelper.mjs +0 -270
- package/dist/runtime/plugin.mjs +0 -149
- package/dist/runtime/types/common.mjs +0 -0
- package/dist/runtime/types/config.d.ts +0 -1
- package/dist/runtime/types/config.mjs +0 -0
- package/dist/runtime/types/lib.mjs +0 -0
- package/dist/runtime/ui.config/alert.d.ts +0 -3
- package/dist/runtime/ui.config/alert.mjs +0 -6
- package/dist/runtime/ui.config/badge.d.ts +0 -3
- package/dist/runtime/ui.config/badge.mjs +0 -1
- package/dist/runtime/ui.config/breadcrumb.d.ts +0 -1
- package/dist/runtime/ui.config/breadcrumb.mjs +0 -7
- package/dist/runtime/ui.config/button.d.ts +0 -3
- package/dist/runtime/ui.config/button.mjs +0 -8
- package/dist/runtime/ui.config/buttonGroup.d.ts +0 -3
- package/dist/runtime/ui.config/buttonGroup.mjs +0 -1
- package/dist/runtime/ui.config/card.d.ts +0 -1
- package/dist/runtime/ui.config/card.mjs +0 -2
- package/dist/runtime/ui.config/checkbox.d.ts +0 -3
- package/dist/runtime/ui.config/checkbox.mjs +0 -1
- package/dist/runtime/ui.config/formGroup.d.ts +0 -3
- package/dist/runtime/ui.config/formGroup.mjs +0 -5
- package/dist/runtime/ui.config/icon.d.ts +0 -3
- package/dist/runtime/ui.config/icon.mjs +0 -3
- package/dist/runtime/ui.config/index.d.ts +0 -16
- package/dist/runtime/ui.config/index.mjs +0 -16
- package/dist/runtime/ui.config/input.d.ts +0 -3
- package/dist/runtime/ui.config/input.mjs +0 -5
- package/dist/runtime/ui.config/modal.d.ts +0 -1
- package/dist/runtime/ui.config/modal.mjs +0 -34
- package/dist/runtime/ui.config/notification.d.ts +0 -11
- package/dist/runtime/ui.config/notification.mjs +0 -13
- package/dist/runtime/ui.config/notifications.d.ts +0 -3
- package/dist/runtime/ui.config/notifications.mjs +0 -3
- package/dist/runtime/ui.config/pagination.d.ts +0 -3
- package/dist/runtime/ui.config/pagination.mjs +0 -37
- package/dist/runtime/ui.config/select.d.ts +0 -3
- package/dist/runtime/ui.config/select.mjs +0 -5
- package/dist/runtime/ui.config/selectMenu.d.ts +0 -3
- package/dist/runtime/ui.config/selectMenu.mjs +0 -5
- package/dist/runtime/ui.config/slideover.d.ts +0 -1
- package/dist/runtime/ui.config/slideover.mjs +0 -16
- package/dist/runtime/ui.config/table.d.ts +0 -3
- package/dist/runtime/ui.config/table.mjs +0 -47
- package/dist/runtime/ui.config/tabs.d.ts +0 -3
- package/dist/runtime/ui.config/tabs.mjs +0 -4
- package/dist/runtime/ui.config/tags.d.ts +0 -25
- package/dist/runtime/ui.config/tags.mjs +0 -25
- package/dist/runtime/ui.config/textarea.d.ts +0 -3
- package/dist/runtime/ui.config/textarea.mjs +0 -5
- package/dist/runtime/ui.config/toggle.d.ts +0 -3
- package/dist/runtime/ui.config/toggle.mjs +0 -5
- package/dist/runtime/ui.config/uploadDropzoneImage.d.ts +0 -83
- package/dist/runtime/ui.config/uploadDropzoneImage.mjs +0 -26
- package/dist/runtime/ui.config/uploadFileDropzone.d.ts +0 -61
- package/dist/runtime/ui.config/uploadFileDropzone.mjs +0 -61
- package/dist/runtime/ui.config/uploadFileInputClassicAuto.d.ts +0 -8
- package/dist/runtime/ui.config/uploadFileInputClassicAuto.mjs +0 -8
- package/dist/runtime/ui.config/uploadImage.d.ts +0 -34
- package/dist/runtime/ui.config/uploadImage.mjs +0 -36
- package/dist/runtime/ui.css +0 -1
- package/dist/runtime/utils/ArrayHelper.spec.d.ts +0 -1
- package/dist/runtime/utils/ArrayHelper.spec.mjs +0 -112
- package/dist/runtime/utils/FileHelper.spec.d.ts +0 -1
- package/dist/runtime/utils/FileHelper.spec.mjs +0 -14
- package/dist/runtime/utils/ObjectHelper.spec.d.ts +0 -1
- package/dist/runtime/utils/ObjectHelper.spec.mjs +0 -52
- package/dist/runtime/utils/ParamHelper.spec.d.ts +0 -1
- package/dist/runtime/utils/ParamHelper.spec.mjs +0 -78
- package/dist/runtime/utils/StringHelper.spec.d.ts +0 -1
- package/dist/runtime/utils/StringHelper.spec.mjs +0 -76
- package/dist/runtime/utils/TimeHelper.spec.d.ts +0 -1
- package/dist/runtime/utils/TimeHelper.spec.mjs +0 -79
- package/dist/runtime/utils/TimeHelper.thai.spec.d.ts +0 -1
- package/dist/runtime/utils/TimeHelper.thai.spec.mjs +0 -31
- package/dist/types.d.ts +0 -16
- package/dist/runtime/components/FlexDeck/{types.mjs → types.js} +0 -0
- package/dist/runtime/components/Form/InputCheckbox/{types.mjs → types.js} +0 -0
- package/dist/runtime/components/Form/InputDateTime/{date_time_field.types.mjs → date_time_field.types.js} +0 -0
- package/dist/runtime/components/Form/{InputDateTimeRange/date_range_time_field.types.mjs → InputNumber/types.js} +0 -0
- package/dist/runtime/components/Form/{InputNumber/types.mjs → InputSelect/types.js} +0 -0
- package/dist/runtime/components/Form/{InputRadio/types.mjs → InputSelectMultiple/types.js} +0 -0
- package/dist/runtime/components/Form/{InputSelect/types.mjs → InputText/types.js} +0 -0
- package/dist/runtime/components/Form/{InputSelectMultiple/types.mjs → InputTextarea/types.js} +0 -0
- package/dist/runtime/components/Form/{InputStatic/types.mjs → InputToggle/types.js} +0 -0
- package/dist/runtime/components/Form/{types.mjs → types.js} +0 -0
- package/dist/runtime/composables/{useWatch.mjs → useWatch.js} +0 -0
- package/dist/runtime/lib/{Requester.mjs → Requester.js} +0 -0
- package/dist/runtime/{components/Form/InputTags/types.mjs → types/common.js} +0 -0
- package/dist/runtime/{components/Form/InputText/types.mjs → types/lib.js} +0 -0
- package/dist/runtime/utils/{FileHelper.mjs → FileHelper.js} +0 -0
- package/dist/runtime/utils/{StringHelper.mjs → StringHelper.js} +0 -0
- package/dist/runtime/utils/{TimeHelper.mjs → TimeHelper.js} +1 -1
- /package/dist/runtime/utils/{lodash.mjs → lodash.js} +0 -0
|
@@ -1,230 +1,92 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
v-bind="getFieldBinding(option)"
|
|
94
|
-
v-on="option.on ?? {}"
|
|
95
|
-
/>
|
|
96
|
-
<FormInputDateTime
|
|
97
|
-
v-else-if="option.type === INPUT_TYPES.DATE"
|
|
98
|
-
:class="option.class"
|
|
99
|
-
:form="form"
|
|
100
|
-
v-bind="getFieldBinding(option)"
|
|
101
|
-
:disabled-time="true"
|
|
102
|
-
v-on="option.on ?? {}"
|
|
103
|
-
/>
|
|
104
|
-
<FormInputDateTimeRange
|
|
105
|
-
v-else-if="option.type === INPUT_TYPES.DATE_TIME_RANGE"
|
|
106
|
-
:class="option.class"
|
|
107
|
-
:form="form"
|
|
108
|
-
v-bind="getFieldBinding(option)"
|
|
109
|
-
v-on="option.on ?? {}"
|
|
110
|
-
/>
|
|
111
|
-
<FormInputDateTimeRange
|
|
112
|
-
v-else-if="option.type === INPUT_TYPES.DATE_RANGE"
|
|
113
|
-
:class="option.class"
|
|
114
|
-
:form="form"
|
|
115
|
-
:disabled-time="true"
|
|
116
|
-
v-bind="getFieldBinding(option)"
|
|
117
|
-
v-on="option.on ?? {}"
|
|
118
|
-
/>
|
|
119
|
-
<FormInputUploadFileClassic
|
|
120
|
-
v-else-if="option.type === INPUT_TYPES.UPLOAD_FILE_CLASSIC"
|
|
121
|
-
:class="option.class"
|
|
122
|
-
:form="form"
|
|
123
|
-
v-bind="getFieldBinding(option)"
|
|
124
|
-
v-on="option.on ?? {}"
|
|
125
|
-
/>
|
|
126
|
-
<FormInputUploadFileClassicAuto
|
|
127
|
-
v-else-if="option.type === INPUT_TYPES.UPLOAD_FILE_CLASSIC_AUTO"
|
|
128
|
-
:class="option.class"
|
|
129
|
-
:form="form"
|
|
130
|
-
:request-options="option.props.requestOptions"
|
|
131
|
-
v-bind="getFieldBinding(option)"
|
|
132
|
-
v-on="option.on ?? {}"
|
|
133
|
-
/>
|
|
134
|
-
<FormInputUploadImageAuto
|
|
135
|
-
v-else-if="option.type === INPUT_TYPES.UPLOAD_IMAGE_AUTO"
|
|
136
|
-
:class="option.class"
|
|
137
|
-
:form="form"
|
|
138
|
-
:request-options="option.props.requestOptions"
|
|
139
|
-
v-bind="getFieldBinding(option)"
|
|
140
|
-
v-on="option.on ?? {}"
|
|
141
|
-
/>
|
|
142
|
-
<FormInputUploadDropzone
|
|
143
|
-
v-else-if="option.type === INPUT_TYPES.UPLOAD_DROPZONE"
|
|
144
|
-
:class="option.class"
|
|
145
|
-
:form="form"
|
|
146
|
-
v-bind="getFieldBinding(option)"
|
|
147
|
-
v-on="option.on ?? {}"
|
|
148
|
-
/>
|
|
149
|
-
<FormInputUploadDropzoneAuto
|
|
150
|
-
v-else-if="option.type === INPUT_TYPES.UPLOAD_DROPZONE_AUTO"
|
|
151
|
-
:class="option.class"
|
|
152
|
-
:form="form"
|
|
153
|
-
:request-options="option.props.requestOptions"
|
|
154
|
-
v-bind="getFieldBinding(option)"
|
|
155
|
-
v-on="option.on ?? {}"
|
|
156
|
-
/>
|
|
157
|
-
<FormInputUploadDropzoneAutoMultiple
|
|
158
|
-
v-else-if="option.type === INPUT_TYPES.UPLOAD_DROPZONE_AUTO_MULTIPLE"
|
|
159
|
-
:class="option.class"
|
|
160
|
-
:form="form"
|
|
161
|
-
:request-options="option.props.requestOptions"
|
|
162
|
-
v-bind="getFieldBinding(option)"
|
|
163
|
-
v-on="option.on ?? {}"
|
|
164
|
-
/>
|
|
165
|
-
<FormInputUploadDropzoneImageAutoMultiple
|
|
166
|
-
v-else-if="option.type === INPUT_TYPES.UPLOAD_DROPZONE_IMAGE_AUTO_MULTIPLE"
|
|
167
|
-
:class="option.class"
|
|
168
|
-
:form="form"
|
|
169
|
-
:request-options="option.props.requestOptions"
|
|
170
|
-
v-bind="getFieldBinding(option)"
|
|
171
|
-
v-on="option.on ?? {}"
|
|
172
|
-
/>
|
|
173
|
-
<FormInputWYSIWYG
|
|
174
|
-
v-else-if="option.type === INPUT_TYPES.WYSIWYG"
|
|
175
|
-
:class="option.class"
|
|
176
|
-
:form="form"
|
|
177
|
-
v-bind="getFieldBinding(option)"
|
|
178
|
-
v-on="option.on ?? {}"
|
|
179
|
-
/>
|
|
180
|
-
<FormInputTags
|
|
181
|
-
v-else-if="option.type === INPUT_TYPES.TAGS"
|
|
182
|
-
:class="option.class"
|
|
183
|
-
:form="form"
|
|
184
|
-
v-bind="getFieldBinding(option)"
|
|
185
|
-
v-on="option.on ?? {}"
|
|
186
|
-
/>
|
|
187
|
-
<component
|
|
188
|
-
:is="option.component"
|
|
189
|
-
v-else-if="option.type === INPUT_TYPES.COMPONENT"
|
|
190
|
-
:class="option.class"
|
|
191
|
-
:form="form"
|
|
192
|
-
v-bind="getFieldBinding(option)"
|
|
193
|
-
v-on="option.on ?? {}"
|
|
194
|
-
/>
|
|
195
|
-
</template>
|
|
196
|
-
</div>
|
|
197
|
-
</template>
|
|
198
|
-
<script lang="ts" setup>
|
|
199
|
-
import { type FormContext } from 'vee-validate'
|
|
200
|
-
import { type IFormField, INPUT_TYPES } from '#core/components/Form/types'
|
|
201
|
-
|
|
202
|
-
const props = withDefaults(
|
|
203
|
-
defineProps<{
|
|
204
|
-
form?: FormContext
|
|
205
|
-
options: IFormField[]
|
|
206
|
-
orientation?: 'horizontal' | 'vertical'
|
|
207
|
-
class?: any
|
|
208
|
-
}>(),
|
|
209
|
-
{
|
|
210
|
-
class: 'space-y-4',
|
|
211
|
-
orientation: 'vertical',
|
|
212
|
-
}
|
|
213
|
-
)
|
|
214
|
-
|
|
215
|
-
const getFieldBinding = (field: IFormField) => {
|
|
216
|
-
if (props.orientation === 'horizontal') {
|
|
217
|
-
return {
|
|
218
|
-
...field.props,
|
|
219
|
-
containerUi: {
|
|
220
|
-
...field.props.containerUi,
|
|
221
|
-
wrapper:
|
|
222
|
-
'lg:grid lg:grid-cols-3 lg:gap-4 lg:items-start ' + field.props.containerUi?.wrapper,
|
|
223
|
-
container: 'lg:col-span-2 ' + field.props.containerUi?.container,
|
|
224
|
-
},
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
return field.props
|
|
229
|
-
}
|
|
230
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="[theme.base({
|
|
4
|
+
class: [$props.class, ui?.base]
|
|
5
|
+
})]"
|
|
6
|
+
>
|
|
7
|
+
<component
|
|
8
|
+
:is="componentMap[option.type] || option.component"
|
|
9
|
+
v-for="option in options.filter((item) => !item.isHide)"
|
|
10
|
+
:key="option.props.name"
|
|
11
|
+
:class="option.class"
|
|
12
|
+
:form="form"
|
|
13
|
+
v-bind="getFieldBinding(option)"
|
|
14
|
+
v-on="option.on ?? {}"
|
|
15
|
+
/>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script setup>
|
|
20
|
+
import { computed } from "vue";
|
|
21
|
+
import FormInputTextarea from "./InputTextarea/index.vue";
|
|
22
|
+
import FormInputText from "./InputText/index.vue";
|
|
23
|
+
import FormInputNumber from "./InputNumber/index.vue";
|
|
24
|
+
import FormInputToggle from "./InputToggle/index.vue";
|
|
25
|
+
import FormInputCheckbox from "./InputCheckbox/index.vue";
|
|
26
|
+
import FormInputSelect from "./InputSelect/index.vue";
|
|
27
|
+
import FormInputSelectMultiple from "./InputSelectMultiple/index.vue";
|
|
28
|
+
import FormInputDateTime from "./InputDateTime/index.vue";
|
|
29
|
+
import { INPUT_TYPES } from "#core/components/Form/types";
|
|
30
|
+
import { formTheme } from "#core/theme/form";
|
|
31
|
+
import { useUiConfig } from "#core/composables/useConfig";
|
|
32
|
+
const props = defineProps({
|
|
33
|
+
form: { type: Object, required: false },
|
|
34
|
+
options: { type: Array, required: true },
|
|
35
|
+
orientation: { type: String, required: false, default: "vertical" },
|
|
36
|
+
class: { type: null, required: false },
|
|
37
|
+
ui: { type: null, required: false }
|
|
38
|
+
});
|
|
39
|
+
const componentMap = {
|
|
40
|
+
[INPUT_TYPES.TEXT]: FormInputText,
|
|
41
|
+
[INPUT_TYPES.TEXTAREA]: FormInputTextarea,
|
|
42
|
+
[INPUT_TYPES.TOGGLE]: FormInputToggle,
|
|
43
|
+
[INPUT_TYPES.CHECKBOX]: FormInputCheckbox,
|
|
44
|
+
[INPUT_TYPES.SELECT]: FormInputSelect,
|
|
45
|
+
[INPUT_TYPES.SELECT_MULTIPLE]: FormInputSelectMultiple,
|
|
46
|
+
// For INPUT_TYPES.COMPONENT, it will use option.component directly from the template
|
|
47
|
+
[INPUT_TYPES.COMPONENT]: void 0,
|
|
48
|
+
// Add other INPUT_TYPES here if they have dedicated components not covered by option.component
|
|
49
|
+
[INPUT_TYPES.NUMBER]: FormInputNumber,
|
|
50
|
+
// Example: Map to FormInputText or a specific Number input if exists
|
|
51
|
+
[INPUT_TYPES.PASSWORD]: void 0,
|
|
52
|
+
// Example: Map to FormInputText or a specific Password input if exists
|
|
53
|
+
[INPUT_TYPES.EMAIL]: void 0,
|
|
54
|
+
// Example: Map to FormInputText or a specific Email input if exists
|
|
55
|
+
[INPUT_TYPES.STATIC]: void 0,
|
|
56
|
+
[INPUT_TYPES.RADIO]: void 0,
|
|
57
|
+
[INPUT_TYPES.DATE_TIME]: FormInputDateTime,
|
|
58
|
+
[INPUT_TYPES.DATE]: void 0,
|
|
59
|
+
[INPUT_TYPES.DATE_RANGE]: void 0,
|
|
60
|
+
[INPUT_TYPES.DATE_TIME_RANGE]: void 0,
|
|
61
|
+
[INPUT_TYPES.UPLOAD_FILE_CLASSIC]: void 0,
|
|
62
|
+
[INPUT_TYPES.UPLOAD_FILE_CLASSIC_AUTO]: void 0,
|
|
63
|
+
[INPUT_TYPES.UPLOAD_IMAGE_AUTO]: void 0,
|
|
64
|
+
[INPUT_TYPES.UPLOAD_DROPZONE]: void 0,
|
|
65
|
+
[INPUT_TYPES.UPLOAD_DROPZONE_AUTO]: void 0,
|
|
66
|
+
[INPUT_TYPES.UPLOAD_DROPZONE_AUTO_MULTIPLE]: void 0,
|
|
67
|
+
[INPUT_TYPES.UPLOAD_DROPZONE_IMAGE_AUTO_MULTIPLE]: void 0,
|
|
68
|
+
[INPUT_TYPES.WYSIWYG]: void 0,
|
|
69
|
+
[INPUT_TYPES.TAGS]: void 0
|
|
70
|
+
};
|
|
71
|
+
const theme = computed(() => useUiConfig(formTheme, "form")({ orientation: props.orientation }));
|
|
72
|
+
const getFieldBinding = (field) => {
|
|
73
|
+
const {
|
|
74
|
+
props: fieldProps,
|
|
75
|
+
ui: fieldUi
|
|
76
|
+
} = field;
|
|
77
|
+
const allProps = {
|
|
78
|
+
...fieldProps,
|
|
79
|
+
containerUi: { ...fieldUi }
|
|
80
|
+
};
|
|
81
|
+
if (props.orientation === "horizontal") {
|
|
82
|
+
return {
|
|
83
|
+
...allProps,
|
|
84
|
+
containerUi: {
|
|
85
|
+
root: theme.value.wrapper({ class: [props.ui?.wrapper] }),
|
|
86
|
+
labelWrapper: theme.value.container({ class: [props.ui?.container] })
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
return allProps;
|
|
91
|
+
};
|
|
92
|
+
</script>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FormContext } from 'vee-validate';
|
|
2
|
+
import { type IFormField } from '#core/components/Form/types';
|
|
3
|
+
import { formTheme } from '#core/theme/form';
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
form?: FormContext;
|
|
6
|
+
options: IFormField[];
|
|
7
|
+
orientation?: 'horizontal' | 'vertical';
|
|
8
|
+
class?: any;
|
|
9
|
+
ui?: typeof formTheme['slots'];
|
|
10
|
+
};
|
|
11
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
12
|
+
orientation: "horizontal" | "vertical";
|
|
13
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
export default _default;
|
|
@@ -1,28 +1,53 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<FieldWrapper
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
:
|
|
9
|
-
:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<FieldWrapper
|
|
3
|
+
v-bind="wrapperProps"
|
|
4
|
+
label=""
|
|
5
|
+
description=""
|
|
6
|
+
>
|
|
7
|
+
<Checkbox
|
|
8
|
+
:model-value="value"
|
|
9
|
+
:disabled="wrapperProps.disabled"
|
|
10
|
+
:name="name"
|
|
11
|
+
:label="label"
|
|
12
|
+
:description="description"
|
|
13
|
+
:required="required"
|
|
14
|
+
:variant="variant"
|
|
15
|
+
:indicator="indicator"
|
|
16
|
+
:ui="ui"
|
|
17
|
+
@update:modelValue="onChange"
|
|
18
|
+
/>
|
|
19
|
+
</FieldWrapper>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script setup>
|
|
23
|
+
import { useFieldHOC } from "#core/composables/useForm";
|
|
24
|
+
import FieldWrapper from "#core/components/Form/FieldWrapper.vue";
|
|
25
|
+
const emits = defineEmits(["change"]);
|
|
26
|
+
const props = defineProps({
|
|
27
|
+
label: { type: String, required: false },
|
|
28
|
+
description: { type: String, required: false },
|
|
29
|
+
variant: { type: String, required: false },
|
|
30
|
+
indicator: { type: String, required: false },
|
|
31
|
+
form: { type: Object, required: false },
|
|
32
|
+
name: { type: String, required: true },
|
|
33
|
+
errorMessage: { type: String, required: false },
|
|
34
|
+
hint: { type: String, required: false },
|
|
35
|
+
rules: { type: null, required: false },
|
|
36
|
+
autoFocus: { type: Boolean, required: false },
|
|
37
|
+
placeholder: { type: String, required: false },
|
|
38
|
+
disabled: { type: Boolean, required: false },
|
|
39
|
+
readonly: { type: Boolean, required: false },
|
|
40
|
+
required: { type: Boolean, required: false },
|
|
41
|
+
help: { type: String, required: false },
|
|
42
|
+
ui: { type: null, required: false }
|
|
43
|
+
});
|
|
44
|
+
const {
|
|
45
|
+
value,
|
|
46
|
+
wrapperProps,
|
|
47
|
+
handleChange
|
|
48
|
+
} = useFieldHOC(props);
|
|
49
|
+
const onChange = (value2) => {
|
|
50
|
+
handleChange(value2);
|
|
51
|
+
emits("change", value2);
|
|
52
|
+
};
|
|
53
|
+
</script>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ICheckboxFieldProps } from '#core/components/Form/InputCheckbox/types';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<ICheckboxFieldProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any, string, import("vue").PublicProps, any, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
export default _default;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { IFieldProps, IFormFieldBase, INPUT_TYPES } from '#core/components/Form/types';
|
|
2
2
|
export interface ICheckboxFieldProps extends IFieldProps {
|
|
3
|
+
label?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
variant?: 'card' | 'list';
|
|
6
|
+
indicator?: 'start' | 'end' | 'hidden';
|
|
3
7
|
}
|
|
4
8
|
export type ICheckboxField = IFormFieldBase<INPUT_TYPES.CHECKBOX, ICheckboxFieldProps, {
|
|
5
9
|
change?: (value: boolean) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { IFieldProps, IFormFieldBase, INPUT_TYPES } from '#core/components/Form/types';
|
|
2
2
|
export interface ITimeOption {
|
|
3
3
|
hours?: number | string;
|
|
4
4
|
minutes?: number | string;
|
|
@@ -1,68 +1,97 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
-
<Datepicker
|
|
4
|
-
:model-value="value"
|
|
5
|
-
:disabled="wrapperProps.
|
|
6
|
-
cancel-text="ยกเลิก"
|
|
7
|
-
select-text="เลือก"
|
|
8
|
-
locale="th"
|
|
9
|
-
:enable-time-picker="!disabledTime"
|
|
10
|
-
:placeholder="wrapperProps.placeholder"
|
|
11
|
-
:format="format"
|
|
12
|
-
:min-date="minDate"
|
|
13
|
-
:max-date="maxDate"
|
|
14
|
-
:min-time="minTime"
|
|
15
|
-
:max-time="maxTime"
|
|
16
|
-
:start-time="startTime"
|
|
17
|
-
:required="
|
|
18
|
-
time
|
|
19
|
-
@update:model-value="onInput"
|
|
20
|
-
>
|
|
21
|
-
<template
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
{{ value + 543 }}
|
|
26
|
-
</template>
|
|
27
|
-
<template
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
+
<Datepicker
|
|
4
|
+
:model-value="value"
|
|
5
|
+
:disabled="wrapperProps.disabled"
|
|
6
|
+
cancel-text="ยกเลิก"
|
|
7
|
+
select-text="เลือก"
|
|
8
|
+
locale="th"
|
|
9
|
+
:enable-time-picker="!disabledTime"
|
|
10
|
+
:placeholder="wrapperProps.placeholder"
|
|
11
|
+
:format="format"
|
|
12
|
+
:min-date="minDate"
|
|
13
|
+
:max-date="maxDate"
|
|
14
|
+
:min-time="minTime"
|
|
15
|
+
:max-time="maxTime"
|
|
16
|
+
:start-time="startTime"
|
|
17
|
+
:required="required"
|
|
18
|
+
:flow="['calendar', 'time']"
|
|
19
|
+
@update:model-value="onInput"
|
|
20
|
+
>
|
|
21
|
+
<template
|
|
22
|
+
v-if="appConfig.core?.is_thai_year"
|
|
23
|
+
#year="{ value }"
|
|
24
|
+
>
|
|
25
|
+
{{ value + 543 }}
|
|
26
|
+
</template>
|
|
27
|
+
<template
|
|
28
|
+
v-if="appConfig.core?.is_thai_year"
|
|
29
|
+
#year-overlay-value="{ value }"
|
|
30
|
+
>
|
|
31
|
+
{{ value + 543 }}
|
|
32
|
+
</template>
|
|
33
|
+
<template #dp-input="{ value: innerValue }">
|
|
34
|
+
<Input
|
|
35
|
+
:trailing-icon="innerValue ? void 0 : 'i-heroicons-calendar-days'"
|
|
36
|
+
type="text"
|
|
37
|
+
:disabled="wrapperProps.disabled"
|
|
38
|
+
:model-value="innerValue"
|
|
39
|
+
:placeholder="wrapperProps.placeholder"
|
|
40
|
+
:readonly="true"
|
|
41
|
+
:ui="{
|
|
42
|
+
base: 'cursor-pointer select-none',
|
|
43
|
+
trailingIcon: 'cursor-pointer'
|
|
44
|
+
}"
|
|
45
|
+
/>
|
|
46
|
+
</template>
|
|
47
|
+
</Datepicker>
|
|
48
|
+
</FieldWrapper>
|
|
49
|
+
</template>
|
|
50
|
+
|
|
51
|
+
<script setup>
|
|
52
|
+
import Datepicker from "@vuepic/vue-datepicker";
|
|
53
|
+
import FieldWrapper from "#core/components/Form/FieldWrapper.vue";
|
|
54
|
+
import { TimeHelper, useAppConfig, useFieldHOC } from "#imports";
|
|
55
|
+
import "@vuepic/vue-datepicker/dist/main.css";
|
|
56
|
+
const props = defineProps({
|
|
57
|
+
disabledTime: { type: Boolean, required: false },
|
|
58
|
+
minDate: { type: [Date, String], required: false },
|
|
59
|
+
maxDate: { type: [Date, String], required: false },
|
|
60
|
+
startTime: { type: Object, required: false },
|
|
61
|
+
minTime: { type: Object, required: false },
|
|
62
|
+
maxTime: { type: Object, required: false },
|
|
63
|
+
isReturnISO: { type: Boolean, required: false },
|
|
64
|
+
form: { type: Object, required: false },
|
|
65
|
+
name: { type: String, required: true },
|
|
66
|
+
errorMessage: { type: String, required: false },
|
|
67
|
+
label: { type: null, required: false },
|
|
68
|
+
description: { type: String, required: false },
|
|
69
|
+
hint: { type: String, required: false },
|
|
70
|
+
rules: { type: null, required: false },
|
|
71
|
+
autoFocus: { type: Boolean, required: false },
|
|
72
|
+
placeholder: { type: String, required: false },
|
|
73
|
+
disabled: { type: Boolean, required: false },
|
|
74
|
+
readonly: { type: Boolean, required: false },
|
|
75
|
+
required: { type: Boolean, required: false },
|
|
76
|
+
help: { type: String, required: false },
|
|
77
|
+
ui: { type: null, required: false }
|
|
78
|
+
});
|
|
79
|
+
const appConfig = useAppConfig();
|
|
80
|
+
const {
|
|
81
|
+
value,
|
|
82
|
+
wrapperProps
|
|
83
|
+
} = useFieldHOC(props);
|
|
84
|
+
const format = (date) => {
|
|
85
|
+
if (props.disabledTime) {
|
|
86
|
+
return TimeHelper.displayDate(date);
|
|
87
|
+
}
|
|
88
|
+
return TimeHelper.displayDateTime(date);
|
|
89
|
+
};
|
|
90
|
+
const onInput = (_value) => {
|
|
91
|
+
if (props.disabledTime && !props.isReturnISO) {
|
|
92
|
+
value.value = TimeHelper.getDateFormTime(_value);
|
|
93
|
+
} else {
|
|
94
|
+
value.value = _value;
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
</script>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import '@vuepic/vue-datepicker/dist/main.css';
|
|
2
|
+
import type { IDateTimeFieldProps } from '#core/components/Form/InputDateTime/date_time_field.types';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<IDateTimeFieldProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IDateTimeFieldProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
4
|
+
export default _default;
|