@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,31 +1,19 @@
|
|
|
1
|
-
import { type IAPIAddState, type IAPIDeleteState, type IAPIFetchState, type IAPIFindState, type IAPIOptions, type IAPIUpdateState, type IPageOptions, type IStatus } from '../types/lib';
|
|
2
1
|
import type { AxiosRequestConfig } from 'axios';
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
params?: Record<string, any>;
|
|
7
|
-
expire?: number;
|
|
2
|
+
import type { IAPIAddState, IAPIDeleteState, IAPIFetchState, IAPIFindState, IAPIOptions, IAPIUpdateState, IPageOptions, IStatus } from '../types/lib.js';
|
|
3
|
+
import { type IBaseLoaderOptions } from './apiBaseHelper.js';
|
|
4
|
+
export interface IPageFetchLoaderOptions<D = Record<string, any>> extends IBaseLoaderOptions {
|
|
8
5
|
data?: D;
|
|
9
6
|
}
|
|
10
|
-
export interface IPageFindLoaderOptions<D = Record<string, any>> {
|
|
11
|
-
isMock?: boolean;
|
|
12
|
-
params?: Record<string, any>;
|
|
13
|
-
expire?: number;
|
|
7
|
+
export interface IPageFindLoaderOptions<D = Record<string, any>> extends IBaseLoaderOptions {
|
|
14
8
|
data?: D;
|
|
15
9
|
}
|
|
16
|
-
export interface IPageUpdateLoaderOptions<D = Record<string, any>> {
|
|
17
|
-
isMock?: boolean;
|
|
18
|
-
params?: Record<string, any>;
|
|
10
|
+
export interface IPageUpdateLoaderOptions<D = Record<string, any>> extends IBaseLoaderOptions {
|
|
19
11
|
data?: D;
|
|
20
12
|
}
|
|
21
|
-
export interface IPageDeleteLoaderOptions<D = Record<string, any>> {
|
|
22
|
-
isMock?: boolean;
|
|
23
|
-
params?: Record<string, any>;
|
|
13
|
+
export interface IPageDeleteLoaderOptions<D = Record<string, any>> extends IBaseLoaderOptions {
|
|
24
14
|
data?: D;
|
|
25
15
|
}
|
|
26
|
-
export interface IPageAddLoaderOptions<D = Record<string, any>> {
|
|
27
|
-
isMock?: boolean;
|
|
28
|
-
params?: Record<string, any>;
|
|
16
|
+
export interface IPageAddLoaderOptions<D = Record<string, any>> extends IBaseLoaderOptions {
|
|
29
17
|
data?: D;
|
|
30
18
|
}
|
|
31
19
|
export interface IPageLoaderOptions<T> {
|
|
@@ -56,33 +44,45 @@ export interface IPageLoaderOptions<T> {
|
|
|
56
44
|
};
|
|
57
45
|
}
|
|
58
46
|
export interface IUsePageLoader<T> {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
47
|
+
fetch: {
|
|
48
|
+
status: IStatus;
|
|
49
|
+
items: T[];
|
|
50
|
+
options: IPageOptions;
|
|
51
|
+
};
|
|
52
|
+
find: {
|
|
53
|
+
status: IStatus;
|
|
54
|
+
item: T | null;
|
|
55
|
+
options: IAPIOptions;
|
|
56
|
+
value: (id: string, opts?: any) => Promise<void>;
|
|
57
|
+
};
|
|
58
|
+
add: {
|
|
59
|
+
status: IStatus;
|
|
60
|
+
item: T | null;
|
|
61
|
+
options: IAPIOptions;
|
|
62
|
+
};
|
|
63
|
+
update: {
|
|
64
|
+
status: IStatus;
|
|
65
|
+
item: T | null;
|
|
66
|
+
options: IAPIOptions;
|
|
67
|
+
};
|
|
68
|
+
delete: {
|
|
69
|
+
status: IStatus;
|
|
70
|
+
item: T | null;
|
|
71
|
+
options: IAPIOptions;
|
|
72
|
+
};
|
|
73
|
+
fetchPage: (page?: number, query?: string, opts?: IPageFetchLoaderOptions) => Promise<void>;
|
|
74
|
+
fetchPageChange: (page: number, opts?: IPageFetchLoaderOptions) => Promise<void>;
|
|
75
|
+
fetchSearch: (query: string, opts?: IPageFetchLoaderOptions) => Promise<void>;
|
|
76
|
+
fetchSetLoading: () => void;
|
|
77
|
+
findSetLoading: () => void;
|
|
78
|
+
findRun: (id: string, opts?: any) => Promise<void>;
|
|
79
|
+
addRun: (data: any, opts?: IPageAddLoaderOptions) => Promise<void>;
|
|
80
|
+
updateRun: (id: string, data: any, opts?: any) => Promise<void>;
|
|
81
|
+
deleteRun: (id: string, opts?: IPageDeleteLoaderOptions) => Promise<void>;
|
|
82
|
+
clearAll: () => void;
|
|
83
83
|
}
|
|
84
84
|
export declare const apiAddHelper: <T>(state: () => IAPIAddState<T>, onUpdateStatus: (status: IStatus) => void, onUpdateOptions: (options: IAPIOptions) => void, onUpdateData: (data: any) => void, onUpdateItems: (data: any[]) => void, data: any, opts: IPageLoaderOptions<any> & IPageFetchLoaderOptions) => Promise<void>;
|
|
85
85
|
export declare const apiDeleteHelper: <T>(state: () => IAPIDeleteState<T>, onUpdateStatus: (status: IStatus) => void, onUpdateOptions: (options: IAPIOptions) => void, _onUpdateData: (data: T) => void, onUpdateItems: (data: T[]) => void, id: string | number, opts: IPageLoaderOptions<any> & IPageDeleteLoaderOptions) => Promise<void>;
|
|
86
86
|
export declare const apiFetchHelper: <T>(state: () => IAPIFetchState<T>, onUpdateStatus: (status: IStatus) => void, onUpdateOptions: (options: IPageOptions) => void, onUpdateItems: (items: T[]) => void, page: number, query: string, opts: IPageLoaderOptions<T> & IPageFetchLoaderOptions<any>) => Promise<void>;
|
|
87
87
|
export declare const apiFindHelper: <T>(state: () => IAPIFindState<T>, onUpdateStatus: (status: IStatus) => void, onUpdateOptions: (options: IAPIOptions) => void, onUpdateData: (data: any) => void, id: string | number, opts: IPageLoaderOptions<T> & IPageFindLoaderOptions) => Promise<void>;
|
|
88
|
-
export declare const updateHelper: <T>(state: () => IAPIUpdateState<T>, onUpdateStatus: (status: IStatus) => void, onUpdateOptions: (options: IAPIOptions) => void, onUpdateData: (data: T) => void,
|
|
88
|
+
export declare const updateHelper: <T>(state: () => IAPIUpdateState<T>, onUpdateStatus: (status: IStatus) => void, onUpdateOptions: (options: IAPIOptions) => void, onUpdateData: (data: T) => void, onUpdateItems: (data: T[]) => void, onUpdateOldData: (data: T) => void, id: string | number, data: any, opts: IPageLoaderOptions<any> & IPageUpdateLoaderOptions) => Promise<void>;
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
import { useCoreConfig } from "../composables/useConfig.js";
|
|
2
|
+
import { bindParamsToUrl } from "./apiBaseHelper.js";
|
|
3
|
+
import {
|
|
4
|
+
checkExpiration,
|
|
5
|
+
handleApiRequest,
|
|
6
|
+
prepareRequestOptions,
|
|
7
|
+
updateLoaderState
|
|
8
|
+
} from "./apiBaseHelper.js";
|
|
9
|
+
import { _findIndex, _get, _shuffle } from "#imports";
|
|
10
|
+
export const apiAddHelper = async (state, onUpdateStatus, onUpdateOptions, onUpdateData, onUpdateItems, data, opts) => {
|
|
11
|
+
onUpdateStatus(updateLoaderState.setLoading(state().status));
|
|
12
|
+
onUpdateOptions({});
|
|
13
|
+
const requestOptions = prepareRequestOptions(
|
|
14
|
+
opts.getBaseRequestOptions?.() || {},
|
|
15
|
+
opts.add?.getRequestOptions?.(data, opts),
|
|
16
|
+
opts.params
|
|
17
|
+
);
|
|
18
|
+
const url = bindParamsToUrl(opts.add?.getURL ? opts.add.getURL(data, opts) : opts.baseURL, opts.pathBind);
|
|
19
|
+
await handleApiRequest(
|
|
20
|
+
{
|
|
21
|
+
url,
|
|
22
|
+
method: "POST",
|
|
23
|
+
data,
|
|
24
|
+
options: requestOptions
|
|
25
|
+
},
|
|
26
|
+
opts.isMock ? opts.mockItems?.[0] || null : null,
|
|
27
|
+
{
|
|
28
|
+
onSuccess: (item, status) => {
|
|
29
|
+
onUpdateData(item);
|
|
30
|
+
if (state().items) {
|
|
31
|
+
onUpdateItems([item, ...state().items]);
|
|
32
|
+
}
|
|
33
|
+
onUpdateStatus(updateLoaderState.setSuccess(state().status));
|
|
34
|
+
onUpdateOptions({
|
|
35
|
+
_timestamp: Date.now(),
|
|
36
|
+
_status: status,
|
|
37
|
+
request: requestOptions
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
onError: (error) => {
|
|
41
|
+
onUpdateStatus(updateLoaderState.setError(state().status, error));
|
|
42
|
+
onUpdateOptions({
|
|
43
|
+
_status: error.response?.status,
|
|
44
|
+
request: requestOptions
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
onComplete: () => {
|
|
48
|
+
onUpdateStatus(updateLoaderState.setComplete(state().status));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
export const apiDeleteHelper = async (state, onUpdateStatus, onUpdateOptions, _onUpdateData, onUpdateItems, id, opts) => {
|
|
54
|
+
const primaryKey = opts.primary ?? "id";
|
|
55
|
+
const getPrimaryKey = (item) => _get(item, primaryKey, "");
|
|
56
|
+
onUpdateStatus(updateLoaderState.setLoading(state().status));
|
|
57
|
+
onUpdateOptions({});
|
|
58
|
+
const requestOptions = prepareRequestOptions(
|
|
59
|
+
opts.getBaseRequestOptions?.() || {},
|
|
60
|
+
opts.delete?.getRequestOptions?.(id, opts),
|
|
61
|
+
opts.params
|
|
62
|
+
);
|
|
63
|
+
const url = bindParamsToUrl(opts.delete?.getURL ? opts.delete.getURL(id, opts) : `${opts.baseURL}/${id}`, opts.pathBind);
|
|
64
|
+
await handleApiRequest(
|
|
65
|
+
{
|
|
66
|
+
url,
|
|
67
|
+
method: "DELETE",
|
|
68
|
+
options: requestOptions
|
|
69
|
+
},
|
|
70
|
+
opts.isMock ? null : null,
|
|
71
|
+
// No mock data needed for delete
|
|
72
|
+
{
|
|
73
|
+
onSuccess: (_, status) => {
|
|
74
|
+
if (state().items) {
|
|
75
|
+
onUpdateItems(
|
|
76
|
+
state().items.filter((item) => getPrimaryKey(item) !== id)
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
onUpdateStatus(updateLoaderState.setSuccess(state().status));
|
|
80
|
+
onUpdateOptions({
|
|
81
|
+
_timestamp: Date.now(),
|
|
82
|
+
_status: status,
|
|
83
|
+
request: requestOptions
|
|
84
|
+
});
|
|
85
|
+
},
|
|
86
|
+
onError: (error) => {
|
|
87
|
+
onUpdateStatus(updateLoaderState.setError(state().status, error));
|
|
88
|
+
onUpdateOptions({
|
|
89
|
+
_status: error.response?.status,
|
|
90
|
+
request: requestOptions
|
|
91
|
+
});
|
|
92
|
+
},
|
|
93
|
+
onComplete: () => {
|
|
94
|
+
onUpdateStatus(updateLoaderState.setComplete(state().status));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
};
|
|
99
|
+
export const apiFetchHelper = async (state, onUpdateStatus, onUpdateOptions, onUpdateItems, page, query, opts) => {
|
|
100
|
+
const config = useCoreConfig();
|
|
101
|
+
if (checkExpiration(state().options._timestamp, opts.expire)) {
|
|
102
|
+
onUpdateStatus(updateLoaderState.setComplete(state().status));
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
onUpdateStatus(updateLoaderState.setLoading(state().status));
|
|
106
|
+
onUpdateOptions({
|
|
107
|
+
...state().options,
|
|
108
|
+
...opts,
|
|
109
|
+
currentPage: page,
|
|
110
|
+
search: query,
|
|
111
|
+
primary: opts.primary ?? "id",
|
|
112
|
+
_status: void 0
|
|
113
|
+
});
|
|
114
|
+
const getOptions = (data) => {
|
|
115
|
+
const {
|
|
116
|
+
total,
|
|
117
|
+
limit: limit2,
|
|
118
|
+
...more
|
|
119
|
+
} = data;
|
|
120
|
+
return {
|
|
121
|
+
...state().options,
|
|
122
|
+
...more,
|
|
123
|
+
currentPageCount: state().items?.length || 0,
|
|
124
|
+
currentPage: page,
|
|
125
|
+
totalCount: total,
|
|
126
|
+
limit: limit2,
|
|
127
|
+
search: query,
|
|
128
|
+
totalPage: Math.ceil(total / data.limit)
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
const baseRequestOptions = {
|
|
132
|
+
...opts.getBaseRequestOptions?.() || {},
|
|
133
|
+
...opts.fetch?.getRequestOptions?.(page, query, opts) || {}
|
|
134
|
+
};
|
|
135
|
+
const limit = baseRequestOptions.params?.limit || config.limit_per_page;
|
|
136
|
+
const requestOptions = prepareRequestOptions(
|
|
137
|
+
baseRequestOptions,
|
|
138
|
+
{
|
|
139
|
+
params: {
|
|
140
|
+
limit,
|
|
141
|
+
q: (query || "").trim(),
|
|
142
|
+
page
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
opts.params
|
|
146
|
+
);
|
|
147
|
+
const url = bindParamsToUrl(opts.fetch?.getURL ? opts.fetch.getURL(page, query, opts) : opts.baseURL, opts.pathBind);
|
|
148
|
+
await handleApiRequest(
|
|
149
|
+
{
|
|
150
|
+
url,
|
|
151
|
+
method: "GET",
|
|
152
|
+
options: requestOptions
|
|
153
|
+
},
|
|
154
|
+
opts.isMock ? {
|
|
155
|
+
items: _shuffle(opts.mockItems || []),
|
|
156
|
+
totalCount: (opts.mockItems || []).length,
|
|
157
|
+
limit
|
|
158
|
+
} : null,
|
|
159
|
+
{
|
|
160
|
+
onSuccess: (response, status) => {
|
|
161
|
+
const {
|
|
162
|
+
items,
|
|
163
|
+
...moreOptions
|
|
164
|
+
} = response;
|
|
165
|
+
onUpdateItems(items);
|
|
166
|
+
onUpdateOptions({
|
|
167
|
+
...getOptions(moreOptions),
|
|
168
|
+
_timestamp: Date.now(),
|
|
169
|
+
_status: status,
|
|
170
|
+
request: requestOptions
|
|
171
|
+
});
|
|
172
|
+
onUpdateStatus(updateLoaderState.setSuccess(state().status));
|
|
173
|
+
},
|
|
174
|
+
onError: (error) => {
|
|
175
|
+
onUpdateStatus(updateLoaderState.setError(state().status, error));
|
|
176
|
+
onUpdateOptions({
|
|
177
|
+
...state().options,
|
|
178
|
+
_status: error.response?.status,
|
|
179
|
+
request: requestOptions
|
|
180
|
+
});
|
|
181
|
+
},
|
|
182
|
+
onComplete: () => {
|
|
183
|
+
onUpdateStatus(updateLoaderState.setComplete(state().status));
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
};
|
|
188
|
+
export const apiFindHelper = async (state, onUpdateStatus, onUpdateOptions, onUpdateData, id, opts) => {
|
|
189
|
+
if (checkExpiration(state().options._timestamp, opts.expire)) {
|
|
190
|
+
onUpdateStatus(updateLoaderState.setComplete(state().status));
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
onUpdateStatus(updateLoaderState.setLoading(state().status));
|
|
194
|
+
onUpdateOptions({});
|
|
195
|
+
const requestOptions = prepareRequestOptions(
|
|
196
|
+
opts.getBaseRequestOptions?.() || {},
|
|
197
|
+
opts.find?.getRequestOptions?.(id, opts),
|
|
198
|
+
opts.params
|
|
199
|
+
);
|
|
200
|
+
const url = bindParamsToUrl(opts.find?.getURL ? opts.find.getURL(id, opts) : `${opts.baseURL}/${id}`, opts.pathBind);
|
|
201
|
+
await handleApiRequest(
|
|
202
|
+
{
|
|
203
|
+
url,
|
|
204
|
+
method: "GET",
|
|
205
|
+
options: requestOptions
|
|
206
|
+
},
|
|
207
|
+
opts.isMock ? opts.mockItems?.[0] || null : null,
|
|
208
|
+
{
|
|
209
|
+
onSuccess: (item, status) => {
|
|
210
|
+
onUpdateData(item);
|
|
211
|
+
onUpdateStatus(updateLoaderState.setSuccess(state().status));
|
|
212
|
+
onUpdateOptions({
|
|
213
|
+
_timestamp: Date.now(),
|
|
214
|
+
_status: status,
|
|
215
|
+
request: requestOptions
|
|
216
|
+
});
|
|
217
|
+
},
|
|
218
|
+
onError: (error) => {
|
|
219
|
+
onUpdateStatus(updateLoaderState.setError(state().status, error));
|
|
220
|
+
onUpdateOptions({
|
|
221
|
+
_status: error.response?.status,
|
|
222
|
+
request: requestOptions
|
|
223
|
+
});
|
|
224
|
+
},
|
|
225
|
+
onComplete: () => {
|
|
226
|
+
onUpdateStatus(updateLoaderState.setComplete(state().status));
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
);
|
|
230
|
+
};
|
|
231
|
+
export const updateHelper = async (state, onUpdateStatus, onUpdateOptions, onUpdateData, onUpdateItems, onUpdateOldData, id, data, opts) => {
|
|
232
|
+
if (checkExpiration(state().options._timestamp, opts.expire)) {
|
|
233
|
+
onUpdateStatus(updateLoaderState.setComplete(state().status));
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
onUpdateStatus(updateLoaderState.setLoading(state().status));
|
|
237
|
+
onUpdateOptions({});
|
|
238
|
+
const requestOptions = prepareRequestOptions(
|
|
239
|
+
opts.getBaseRequestOptions?.() || {},
|
|
240
|
+
opts.update?.getRequestOptions?.(id, data, opts),
|
|
241
|
+
opts.params
|
|
242
|
+
);
|
|
243
|
+
const url = bindParamsToUrl(opts.update?.getURL ? opts.update.getURL(id, data, opts) : `${opts.baseURL}/${id}`, opts.pathBind);
|
|
244
|
+
await handleApiRequest(
|
|
245
|
+
{
|
|
246
|
+
url,
|
|
247
|
+
method: "PUT",
|
|
248
|
+
data,
|
|
249
|
+
options: requestOptions
|
|
250
|
+
},
|
|
251
|
+
opts.isMock ? opts.mockItems?.[0] || null : null,
|
|
252
|
+
{
|
|
253
|
+
onSuccess: (item, status) => {
|
|
254
|
+
onUpdateData(item);
|
|
255
|
+
const finalItem = item;
|
|
256
|
+
if (state().oldData) {
|
|
257
|
+
onUpdateOldData(finalItem);
|
|
258
|
+
}
|
|
259
|
+
const currentItems = state().items;
|
|
260
|
+
if (currentItems) {
|
|
261
|
+
const index = _findIndex(currentItems, (existingItem) => existingItem.id === id);
|
|
262
|
+
if (index !== -1) {
|
|
263
|
+
const itemsTemp = [...currentItems];
|
|
264
|
+
itemsTemp[index] = finalItem;
|
|
265
|
+
onUpdateItems(itemsTemp);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
onUpdateStatus(updateLoaderState.setSuccess(state().status));
|
|
269
|
+
onUpdateOptions({
|
|
270
|
+
_timestamp: Date.now(),
|
|
271
|
+
_status: status,
|
|
272
|
+
request: requestOptions
|
|
273
|
+
});
|
|
274
|
+
},
|
|
275
|
+
onError: (error) => {
|
|
276
|
+
onUpdateStatus(updateLoaderState.setError(state().status, error));
|
|
277
|
+
onUpdateOptions({
|
|
278
|
+
_status: error.response?.status,
|
|
279
|
+
request: requestOptions
|
|
280
|
+
});
|
|
281
|
+
},
|
|
282
|
+
onComplete: () => {
|
|
283
|
+
onUpdateStatus(updateLoaderState.setComplete(state().status));
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
);
|
|
287
|
+
};
|
|
@@ -4,27 +4,26 @@ export declare const checkFileType: (file: File, acceptFileType: string | string
|
|
|
4
4
|
export declare const generateURL: (file: File) => string;
|
|
5
5
|
export declare const isImage: (file: File) => boolean;
|
|
6
6
|
export declare const isImageFromPath: (path?: string) => boolean;
|
|
7
|
-
export declare const isVideoFromPath: (path?: string) => boolean;
|
|
8
7
|
export declare const isPDFFromPath: (path?: string) => boolean;
|
|
9
8
|
export declare const useFileAllocate: (selectedFile: Ref<File | undefined | null>, props: {
|
|
10
9
|
accept?: string | string[];
|
|
11
10
|
maxSize?: number;
|
|
12
11
|
}) => {
|
|
13
|
-
selectedFileSizeKb:
|
|
14
|
-
selectedFileSizeMb:
|
|
15
|
-
isSelectedFileUseMb:
|
|
16
|
-
acceptFileSizeKb:
|
|
17
|
-
acceptFileSizeMb:
|
|
18
|
-
isAcceptFileUseMb:
|
|
19
|
-
acceptFile:
|
|
12
|
+
selectedFileSizeKb: import("vue").ComputedRef<string>;
|
|
13
|
+
selectedFileSizeMb: import("vue").ComputedRef<string>;
|
|
14
|
+
isSelectedFileUseMb: import("vue").ComputedRef<boolean>;
|
|
15
|
+
acceptFileSizeKb: import("vue").ComputedRef<number>;
|
|
16
|
+
acceptFileSizeMb: import("vue").ComputedRef<string>;
|
|
17
|
+
isAcceptFileUseMb: import("vue").ComputedRef<boolean | 0>;
|
|
18
|
+
acceptFile: import("vue").ComputedRef<string | undefined>;
|
|
20
19
|
};
|
|
21
20
|
export declare const useFileSize: (size?: number) => {
|
|
22
|
-
isSelectedFileUseMb:
|
|
23
|
-
selectedFileSizeKb:
|
|
24
|
-
selectedFileSizeMb:
|
|
21
|
+
isSelectedFileUseMb: import("vue").ComputedRef<boolean>;
|
|
22
|
+
selectedFileSizeKb: import("vue").ComputedRef<string>;
|
|
23
|
+
selectedFileSizeMb: import("vue").ComputedRef<string>;
|
|
25
24
|
};
|
|
26
25
|
export declare const useFileProgress: () => {
|
|
27
|
-
percent:
|
|
26
|
+
percent: Ref<number, number>;
|
|
28
27
|
onUploadProgress: (progressEvent: ProgressEvent) => void;
|
|
29
28
|
onDownloadProgress: (progressEvent: ProgressEvent) => void;
|
|
30
29
|
};
|
|
@@ -41,11 +41,6 @@ export const isImageFromPath = (path = "") => {
|
|
|
41
41
|
const extension = path.toLowerCase().substring(path.lastIndexOf("."));
|
|
42
42
|
return imageExtensions.includes(extension);
|
|
43
43
|
};
|
|
44
|
-
export const isVideoFromPath = (path = "") => {
|
|
45
|
-
const imageExtensions = [".mp4"];
|
|
46
|
-
const extension = path.toLowerCase().substring(path.lastIndexOf("."));
|
|
47
|
-
return imageExtensions.includes(extension);
|
|
48
|
-
};
|
|
49
44
|
export const isPDFFromPath = (path = "") => {
|
|
50
45
|
const imageExtensions = [".pdf"];
|
|
51
46
|
const extension = path.toLowerCase().substring(path.lastIndexOf("."));
|
|
@@ -86,7 +81,7 @@ export const useFileSize = (size = 0) => {
|
|
|
86
81
|
export const useFileProgress = () => {
|
|
87
82
|
const percent = ref(0);
|
|
88
83
|
const onUploadProgress = (progressEvent) => {
|
|
89
|
-
percent.value = parseFloat(
|
|
84
|
+
percent.value = Number.parseFloat(
|
|
90
85
|
StringHelper.withFixed(
|
|
91
86
|
(Math.floor(progressEvent.loaded * 100 / progressEvent.total) || 0) * 0.8
|
|
92
87
|
)
|
|
@@ -97,7 +92,7 @@ export const useFileProgress = () => {
|
|
|
97
92
|
percent.value = 100;
|
|
98
93
|
return;
|
|
99
94
|
}
|
|
100
|
-
percent.value = parseFloat(
|
|
95
|
+
percent.value = Number.parseFloat(
|
|
101
96
|
StringHelper.withFixed(
|
|
102
97
|
(Math.floor(progressEvent.loaded * 100 / progressEvent.total) || 0) * 0.2 + 80
|
|
103
98
|
)
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export declare const valibotLanguageTH: {
|
|
2
|
+
base64: () => string;
|
|
3
|
+
bic: () => string;
|
|
4
|
+
bytes: (issue: any) => string;
|
|
5
|
+
check: () => string;
|
|
6
|
+
credit_card: () => string;
|
|
7
|
+
cuid: () => string;
|
|
8
|
+
cuid2: () => string;
|
|
9
|
+
decimal: () => string;
|
|
10
|
+
digits: () => string;
|
|
11
|
+
email: () => string;
|
|
12
|
+
emoji: () => string;
|
|
13
|
+
empty: () => string;
|
|
14
|
+
ends_with: (issue: any) => string;
|
|
15
|
+
every_item: () => string;
|
|
16
|
+
excludes: (issue: any) => string;
|
|
17
|
+
finite: () => string;
|
|
18
|
+
graphemes: (issue: any) => string;
|
|
19
|
+
hash: () => string;
|
|
20
|
+
hex_color: () => string;
|
|
21
|
+
hexadecimal: () => string;
|
|
22
|
+
imei: () => string;
|
|
23
|
+
includes: (issue: any) => string;
|
|
24
|
+
integer: () => string;
|
|
25
|
+
ip: () => string;
|
|
26
|
+
ipv4: () => string;
|
|
27
|
+
ipv6: () => string;
|
|
28
|
+
iso_date: () => string;
|
|
29
|
+
iso_date_time: () => string;
|
|
30
|
+
length: (issue: any) => string;
|
|
31
|
+
mac: () => string;
|
|
32
|
+
mac_48: () => string;
|
|
33
|
+
mac_64: () => string;
|
|
34
|
+
max_bytes: (issue: any) => string;
|
|
35
|
+
max_graphemes: (issue: any) => string;
|
|
36
|
+
max_length: (issue: any) => string;
|
|
37
|
+
max_size: (issue: any) => string;
|
|
38
|
+
max_value: (issue: any) => string;
|
|
39
|
+
max_words: (issue: any) => string;
|
|
40
|
+
mime_type: (issue: any) => string;
|
|
41
|
+
min_bytes: (issue: any) => string;
|
|
42
|
+
min_graphemes: (issue: any) => string;
|
|
43
|
+
min_length: (issue: any) => string;
|
|
44
|
+
min_size: (issue: any) => string;
|
|
45
|
+
min_value: (issue: any) => string;
|
|
46
|
+
min_words: (issue: any) => string;
|
|
47
|
+
multiple_of: (issue: any) => string;
|
|
48
|
+
nanoid: () => string;
|
|
49
|
+
non_empty: () => string;
|
|
50
|
+
not_bytes: (issue: any) => string;
|
|
51
|
+
not_graphemes: (issue: any) => string;
|
|
52
|
+
not_length: (issue: any) => string;
|
|
53
|
+
not_size: (issue: any) => string;
|
|
54
|
+
not_value: (issue: any) => string;
|
|
55
|
+
not_words: (issue: any) => string;
|
|
56
|
+
octal: () => string;
|
|
57
|
+
partial_check: () => string;
|
|
58
|
+
regex: () => string;
|
|
59
|
+
safe_integer: () => string;
|
|
60
|
+
size: (issue: any) => string;
|
|
61
|
+
some_item: () => string;
|
|
62
|
+
starts_with: (issue: any) => string;
|
|
63
|
+
ulid: () => string;
|
|
64
|
+
url: () => string;
|
|
65
|
+
uuid: () => string;
|
|
66
|
+
value: () => string;
|
|
67
|
+
words: (issue: any) => string;
|
|
68
|
+
default: () => string;
|
|
69
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export const valibotLanguageTH = {
|
|
2
|
+
base64: () => "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25 base64 \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
3
|
+
bic: () => "\u0E23\u0E2B\u0E31\u0E2A bic \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
4
|
+
bytes: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35\u0E02\u0E19\u0E32\u0E14 ${issue.expected} \u0E44\u0E1A\u0E15\u0E4C \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${issue.received}`,
|
|
5
|
+
check: () => "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E01\u0E23\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
6
|
+
credit_card: () => "\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E1A\u0E31\u0E15\u0E23\u0E40\u0E04\u0E23\u0E14\u0E34\u0E15\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
7
|
+
cuid: () => "cuid \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
8
|
+
cuid2: () => "cuid2 \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
9
|
+
decimal: () => "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E01\u0E23\u0E2D\u0E01\u0E40\u0E1B\u0E47\u0E19\u0E40\u0E25\u0E02\u0E17\u0E28\u0E19\u0E34\u0E22\u0E21",
|
|
10
|
+
digits: () => "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E01\u0E23\u0E2D\u0E01\u0E40\u0E09\u0E1E\u0E32\u0E30\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",
|
|
11
|
+
email: () => "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E01\u0E23\u0E2D\u0E01\u0E2D\u0E35\u0E40\u0E21\u0E25\u0E17\u0E35\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
12
|
+
emoji: () => "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E01\u0E23\u0E2D\u0E01\u0E2D\u0E35\u0E42\u0E21\u0E08\u0E34\u0E17\u0E35\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
13
|
+
empty: () => "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E2D\u0E22\u0E48\u0E32\u0E1B\u0E25\u0E48\u0E2D\u0E22\u0E27\u0E48\u0E32\u0E07",
|
|
14
|
+
ends_with: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${issue.expected}"`,
|
|
15
|
+
every_item: () => "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E1A\u0E32\u0E07\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
16
|
+
excludes: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E1B\u0E23\u0E30\u0E01\u0E2D\u0E1A\u0E14\u0E49\u0E27\u0E22 "${issue.expected}"`,
|
|
17
|
+
finite: () => "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E01\u0E23\u0E2D\u0E01\u0E04\u0E48\u0E32\u0E17\u0E35\u0E48\u0E08\u0E33\u0E01\u0E31\u0E14",
|
|
18
|
+
graphemes: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 ${issue.expected} \u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23`,
|
|
19
|
+
hash: () => "\u0E04\u0E48\u0E32 hash \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
20
|
+
hex_color: () => "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E01\u0E23\u0E2D\u0E01\u0E2A\u0E35\u0E43\u0E19\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A hex",
|
|
21
|
+
hexadecimal: () => "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E01\u0E23\u0E2D\u0E01\u0E40\u0E25\u0E02\u0E10\u0E32\u0E19\u0E2A\u0E34\u0E1A\u0E2B\u0E01",
|
|
22
|
+
imei: () => "imei \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
23
|
+
includes: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E1B\u0E23\u0E30\u0E01\u0E2D\u0E1A\u0E14\u0E49\u0E27\u0E22 "${issue.expected}"`,
|
|
24
|
+
integer: () => "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E01\u0E23\u0E2D\u0E01\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E08\u0E33\u0E19\u0E27\u0E19\u0E40\u0E15\u0E47\u0E21",
|
|
25
|
+
ip: () => "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 ip \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
26
|
+
ipv4: () => "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 ipv4 \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
27
|
+
ipv6: () => "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 ipv6 \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
28
|
+
iso_date: () => "\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E43\u0E19\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A iso \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
29
|
+
iso_date_time: () => "\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E25\u0E30\u0E40\u0E27\u0E25\u0E32\u0E43\u0E19\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A iso \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
30
|
+
length: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35\u0E04\u0E27\u0E32\u0E21\u0E22\u0E32\u0E27 ${issue.expected} \u0E15\u0E31\u0E27`,
|
|
31
|
+
mac: () => "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 mac \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
32
|
+
mac_48: () => "mac 48-bit \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
33
|
+
mac_64: () => "mac 64-bit \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
34
|
+
max_bytes: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 ${issue.expected} \u0E44\u0E1A\u0E15\u0E4C`,
|
|
35
|
+
max_graphemes: (issue) => `\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 ${issue.expected} \u0E15\u0E31\u0E27`,
|
|
36
|
+
max_length: (issue) => `\u0E04\u0E27\u0E32\u0E21\u0E22\u0E32\u0E27\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 ${issue.expected} \u0E15\u0E31\u0E27`,
|
|
37
|
+
max_size: (issue) => `\u0E02\u0E19\u0E32\u0E14\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 ${issue.expected}`,
|
|
38
|
+
max_value: (issue) => `\u0E04\u0E48\u0E32\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 ${issue.expected}`,
|
|
39
|
+
max_words: (issue) => `\u0E08\u0E33\u0E19\u0E27\u0E19\u0E04\u0E33\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 ${issue.expected} \u0E04\u0E33`,
|
|
40
|
+
mime_type: (issue) => "mime type \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
41
|
+
min_bytes: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22 ${issue.expected} \u0E44\u0E1A\u0E15\u0E4C`,
|
|
42
|
+
min_graphemes: (issue) => `\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22 ${issue.expected} \u0E15\u0E31\u0E27`,
|
|
43
|
+
min_length: (issue) => `\u0E04\u0E27\u0E32\u0E21\u0E22\u0E32\u0E27\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22 ${issue.expected} \u0E15\u0E31\u0E27`,
|
|
44
|
+
min_size: (issue) => `\u0E02\u0E19\u0E32\u0E14\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32 ${issue.expected}`,
|
|
45
|
+
min_value: (issue) => {
|
|
46
|
+
return `\u0E04\u0E48\u0E32\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22 ${issue.requirement}`;
|
|
47
|
+
},
|
|
48
|
+
min_words: (issue) => `\u0E08\u0E33\u0E19\u0E27\u0E19\u0E04\u0E33\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22 ${issue.expected} \u0E04\u0E33`,
|
|
49
|
+
multiple_of: (issue) => `\u0E04\u0E48\u0E32\u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E40\u0E17\u0E48\u0E32\u0E02\u0E2D\u0E07 ${issue.expected}`,
|
|
50
|
+
nanoid: () => "nano id \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
51
|
+
non_empty: () => "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E01\u0E23\u0E2D\u0E01\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",
|
|
52
|
+
not_bytes: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48 ${issue.expected} \u0E44\u0E1A\u0E15\u0E4C`,
|
|
53
|
+
not_graphemes: (issue) => `\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A ${issue.expected}`,
|
|
54
|
+
not_length: (issue) => `\u0E04\u0E27\u0E32\u0E21\u0E22\u0E32\u0E27\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A ${issue.expected}`,
|
|
55
|
+
not_size: (issue) => `\u0E02\u0E19\u0E32\u0E14\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A ${issue.expected}`,
|
|
56
|
+
not_value: (issue) => `\u0E04\u0E48\u0E32\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A ${issue.expected}`,
|
|
57
|
+
not_words: (issue) => `\u0E08\u0E33\u0E19\u0E27\u0E19\u0E04\u0E33\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A ${issue.expected} \u0E04\u0E33`,
|
|
58
|
+
octal: () => "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E01\u0E23\u0E2D\u0E01\u0E40\u0E25\u0E02\u0E10\u0E32\u0E19\u0E41\u0E1B\u0E14",
|
|
59
|
+
partial_check: () => "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E1A\u0E32\u0E07\u0E2A\u0E48\u0E27\u0E19\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
60
|
+
regex: () => "\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
61
|
+
safe_integer: () => "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E01\u0E23\u0E2D\u0E01\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E08\u0E33\u0E19\u0E27\u0E19\u0E40\u0E15\u0E47\u0E21\u0E17\u0E35\u0E48\u0E1B\u0E25\u0E2D\u0E14\u0E20\u0E31\u0E22",
|
|
62
|
+
size: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35\u0E02\u0E19\u0E32\u0E14 ${issue.expected}`,
|
|
63
|
+
some_item: () => "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E1A\u0E32\u0E07\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
64
|
+
starts_with: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${issue.expected}"`,
|
|
65
|
+
ulid: () => "ulid \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
66
|
+
url: () => "url \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
67
|
+
uuid: () => "uuid \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
68
|
+
value: () => "\u0E04\u0E48\u0E32\u0E17\u0E35\u0E48\u0E01\u0E23\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
69
|
+
words: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35\u0E04\u0E33 ${issue.expected} \u0E04\u0E33`,
|
|
70
|
+
default: () => "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E01\u0E23\u0E2D\u0E01\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25"
|
|
71
|
+
// Fallback message
|
|
72
|
+
};
|
package/dist/runtime/plugin.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
|
|
2
2
|
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { vMaska } from "maska/vue";
|
|
2
|
+
import * as v from "valibot";
|
|
3
|
+
import { defineNuxtPlugin } from "#app";
|
|
4
|
+
import { valibotLanguageTH } from "#core/i18n/valibot";
|
|
5
|
+
export default defineNuxtPlugin((_nuxtApp) => {
|
|
6
|
+
v.setGlobalMessage((issue) => {
|
|
7
|
+
const messages = valibotLanguageTH;
|
|
8
|
+
const getMessage = messages[issue.type] || messages.default;
|
|
9
|
+
return getMessage(issue);
|
|
10
|
+
});
|
|
11
|
+
_nuxtApp.vueApp.directive("maska", vMaska);
|
|
12
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const buttonTheme = { slots: { base: "cursor-pointer" } };
|