@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,40 +1,36 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
import type { TableColumn as NuxtUiTableColumn } from '@nuxt/ui';
|
|
3
|
+
import type { IPageOptions, IStatus } from '#core/types/lib';
|
|
2
4
|
export declare const enum COLUMN_TYPES {
|
|
3
5
|
COMPONENT = "COMPONENT",
|
|
4
6
|
DATE = "DATE",
|
|
5
7
|
DATE_TIME = "DATE_TIME",
|
|
6
8
|
NUMBER = "NUMBER",
|
|
7
|
-
IMAGE = "IMAGE"
|
|
9
|
+
IMAGE = "IMAGE",
|
|
10
|
+
TEXT = "TEXT"
|
|
8
11
|
}
|
|
9
|
-
export
|
|
10
|
-
[key: string]: any;
|
|
11
|
-
key: string;
|
|
12
|
-
sortable?: boolean;
|
|
13
|
-
direction?: 'asc' | 'desc';
|
|
14
|
-
class?: string;
|
|
15
|
-
component?: any;
|
|
12
|
+
export type TableColumn<T extends Record<string, any> = Record<string, any>> = NuxtUiTableColumn<T> & {
|
|
16
13
|
type?: COLUMN_TYPES;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export interface IBaseTableOptions<T = object> {
|
|
14
|
+
component?: Component;
|
|
15
|
+
accessorKey: string;
|
|
16
|
+
};
|
|
17
|
+
export interface IBaseTableOptions<T extends Record<string, any> = Record<string, any>> {
|
|
22
18
|
rawData: T[];
|
|
23
|
-
primary: string;
|
|
24
19
|
status: IStatus;
|
|
25
|
-
columns:
|
|
20
|
+
columns: TableColumn<T>[];
|
|
26
21
|
isHideBottomPagination?: boolean;
|
|
27
22
|
isHideCaption?: boolean;
|
|
28
23
|
isHideTopPagination?: boolean;
|
|
29
24
|
isSimplePagination?: boolean;
|
|
30
25
|
}
|
|
31
|
-
export interface ITableOptions<T
|
|
26
|
+
export interface ITableOptions<T extends Record<string, any> = Record<string, any>> extends IBaseTableOptions<T> {
|
|
32
27
|
pageOptions: IPageOptions;
|
|
33
28
|
isHideToolbar?: boolean;
|
|
34
29
|
isEnabledSearch?: boolean;
|
|
35
30
|
searchPlaceholder?: string;
|
|
36
31
|
isPreventRouteChange: boolean;
|
|
37
32
|
}
|
|
38
|
-
export interface ISimpleTableOptions<T
|
|
33
|
+
export interface ISimpleTableOptions<T extends Record<string, any> = Record<string, any>> extends IBaseTableOptions<T> {
|
|
39
34
|
limit?: number;
|
|
35
|
+
primary?: number;
|
|
40
36
|
}
|
|
@@ -1,40 +1,42 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<Teleport
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
isShow.value =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
observer.observe(document, {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<Teleport
|
|
3
|
+
v-if="isShow"
|
|
4
|
+
:to="target"
|
|
5
|
+
:disabled="!target || disabled"
|
|
6
|
+
>
|
|
7
|
+
<slot />
|
|
8
|
+
</Teleport>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script setup>
|
|
12
|
+
import { onBeforeUnmount, onMounted, ref } from "vue";
|
|
13
|
+
const props = defineProps({
|
|
14
|
+
to: { type: String, required: true },
|
|
15
|
+
disabled: { type: Boolean, required: false }
|
|
16
|
+
});
|
|
17
|
+
const target = ref(null);
|
|
18
|
+
const isShow = ref(false);
|
|
19
|
+
onBeforeUnmount(() => {
|
|
20
|
+
isShow.value = false;
|
|
21
|
+
});
|
|
22
|
+
onMounted(() => {
|
|
23
|
+
isShow.value = true;
|
|
24
|
+
const observer = new MutationObserver((mutationList, observer2) => {
|
|
25
|
+
for (const mutation of mutationList) {
|
|
26
|
+
if (mutation.type !== "childList") continue;
|
|
27
|
+
const el = document.querySelector(props.to);
|
|
28
|
+
if (!el) continue;
|
|
29
|
+
target.value = el;
|
|
30
|
+
observer2.disconnect();
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
observer.observe(document, {
|
|
35
|
+
childList: true,
|
|
36
|
+
subtree: true
|
|
37
|
+
});
|
|
38
|
+
return () => {
|
|
39
|
+
observer.disconnect();
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
</script>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
to: string;
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
};
|
|
5
|
+
declare var __VLS_5: {};
|
|
6
|
+
type __VLS_Slots = {} & {
|
|
7
|
+
default?: (props: typeof __VLS_5) => any;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
11
|
+
export default _default;
|
|
12
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
13
|
+
new (): {
|
|
14
|
+
$slots: S;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { type IListLoaderOptions } from '../helpers/apiListHelper';
|
|
2
|
-
import {
|
|
1
|
+
import { type IListLoaderOptions } from '../helpers/apiListHelper.js';
|
|
2
|
+
import type { IUseListLoader } from '../helpers/apiObjectHelper.js';
|
|
3
3
|
export declare const useListLoader: <T = any, O = Record<string, any>>(loaderOptions: IListLoaderOptions<T, O>) => IUseListLoader<T, O>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { reactive, computed } from "vue";
|
|
2
|
+
import { ObjectHelper } from "../utils/ObjectHelper.js";
|
|
3
|
+
import {
|
|
4
|
+
apiListHelper
|
|
5
|
+
} from "../helpers/apiListHelper.js";
|
|
6
|
+
export const useListLoader = (loaderOptions) => {
|
|
7
|
+
const result = reactive({
|
|
8
|
+
items: [],
|
|
9
|
+
status: ObjectHelper.createStatus(),
|
|
10
|
+
options: {}
|
|
11
|
+
});
|
|
12
|
+
const clear = () => {
|
|
13
|
+
result.status = ObjectHelper.createStatus();
|
|
14
|
+
result.items = [];
|
|
15
|
+
result.options = {};
|
|
16
|
+
};
|
|
17
|
+
const run = async (payload) => {
|
|
18
|
+
return apiListHelper(
|
|
19
|
+
() => result,
|
|
20
|
+
(_data) => {
|
|
21
|
+
result.status = _data;
|
|
22
|
+
},
|
|
23
|
+
(_data) => {
|
|
24
|
+
result.options = _data;
|
|
25
|
+
},
|
|
26
|
+
(_data) => {
|
|
27
|
+
result.items = _data;
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
...loaderOptions,
|
|
31
|
+
...payload
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
const setLoading = () => {
|
|
36
|
+
result.items = [];
|
|
37
|
+
result.status = ObjectHelper.toLoadingStatus(result.status);
|
|
38
|
+
};
|
|
39
|
+
const setItems = (_items) => {
|
|
40
|
+
result.items = _items;
|
|
41
|
+
};
|
|
42
|
+
return {
|
|
43
|
+
items: computed(() => result.items),
|
|
44
|
+
status: computed(() => result.status),
|
|
45
|
+
options: computed(() => result.options),
|
|
46
|
+
run,
|
|
47
|
+
clear,
|
|
48
|
+
setItems,
|
|
49
|
+
setLoading
|
|
50
|
+
};
|
|
51
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type IObjectLoaderOptions, type IUseObjectLoader } from '../helpers/apiObjectHelper';
|
|
1
|
+
import { type IObjectLoaderOptions, type IUseObjectLoader } from '../helpers/apiObjectHelper.js';
|
|
2
2
|
export declare const useObjectLoader: <T = any, B = any, O = Record<string, any>>(loaderOptions: IObjectLoaderOptions<T, B, O>) => IUseObjectLoader<T, B, O>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { reactive, computed } from "vue";
|
|
2
|
+
import { ObjectHelper } from "../utils/ObjectHelper.js";
|
|
3
|
+
import {
|
|
4
|
+
apiObjectHelper
|
|
5
|
+
} from "../helpers/apiObjectHelper.js";
|
|
6
|
+
export const useObjectLoader = (loaderOptions) => {
|
|
7
|
+
const result = reactive({
|
|
8
|
+
data: null,
|
|
9
|
+
status: ObjectHelper.createStatus(),
|
|
10
|
+
options: {}
|
|
11
|
+
});
|
|
12
|
+
const clear = () => {
|
|
13
|
+
result.status = ObjectHelper.createStatus();
|
|
14
|
+
result.data = null;
|
|
15
|
+
};
|
|
16
|
+
const run = async (payload = {}) => {
|
|
17
|
+
return await apiObjectHelper(
|
|
18
|
+
() => result,
|
|
19
|
+
(_data) => {
|
|
20
|
+
result.status = _data;
|
|
21
|
+
},
|
|
22
|
+
(_data) => {
|
|
23
|
+
result.options = _data;
|
|
24
|
+
},
|
|
25
|
+
(_data) => {
|
|
26
|
+
result.data = _data ?? null;
|
|
27
|
+
},
|
|
28
|
+
payload.data,
|
|
29
|
+
{
|
|
30
|
+
...loaderOptions,
|
|
31
|
+
...payload
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
const setLoading = () => {
|
|
36
|
+
result.status = ObjectHelper.toLoadingStatus(result.status);
|
|
37
|
+
};
|
|
38
|
+
const setData = (_data) => {
|
|
39
|
+
result.data = _data;
|
|
40
|
+
};
|
|
41
|
+
return {
|
|
42
|
+
data: computed(() => result.data),
|
|
43
|
+
status: computed(() => result.status),
|
|
44
|
+
options: computed(() => result.options),
|
|
45
|
+
run,
|
|
46
|
+
clear,
|
|
47
|
+
setLoading,
|
|
48
|
+
setData
|
|
49
|
+
};
|
|
50
|
+
};
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { IPageOptions } from '../types/lib.js';
|
|
2
|
+
import { type IPageLoaderOptions, type IUsePageLoader } from '../helpers/apiPageHelper.js';
|
|
3
|
+
/**
|
|
4
|
+
* Initialize page options with default values
|
|
5
|
+
*/
|
|
2
6
|
export declare const initPageOptions: (options: {
|
|
3
7
|
limit: number;
|
|
4
8
|
primary: string;
|
|
5
|
-
}) =>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
limit: number;
|
|
11
|
-
search: string;
|
|
12
|
-
primary: string;
|
|
13
|
-
};
|
|
14
|
-
export declare const usePageLoader: <T = any>(loaderOptions: IPageLoaderOptions<T>) => IUsePageLoader<T>;
|
|
9
|
+
}) => IPageOptions;
|
|
10
|
+
/**
|
|
11
|
+
* Create a page loader composable for handling paginated data with CRUD operations
|
|
12
|
+
*/
|
|
13
|
+
export declare const usePageLoader: <T extends Record<string, any>>(loaderOptions: IPageLoaderOptions<T>) => IUsePageLoader<T>;
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { reactive } from "vue";
|
|
2
|
+
import { ObjectHelper } from "../utils/ObjectHelper.js";
|
|
3
|
+
import {
|
|
4
|
+
apiAddHelper,
|
|
5
|
+
apiDeleteHelper,
|
|
6
|
+
apiFetchHelper,
|
|
7
|
+
apiFindHelper,
|
|
8
|
+
updateHelper
|
|
9
|
+
} from "../helpers/apiPageHelper.js";
|
|
10
|
+
import { useCoreConfig } from "./useConfig.js";
|
|
11
|
+
export const initPageOptions = (options) => ({
|
|
12
|
+
currentPageCount: 0,
|
|
13
|
+
currentPage: 1,
|
|
14
|
+
totalPage: 0,
|
|
15
|
+
totalCount: 0,
|
|
16
|
+
limit: options.limit,
|
|
17
|
+
search: "",
|
|
18
|
+
primary: options.primary
|
|
19
|
+
});
|
|
20
|
+
export const usePageLoader = (loaderOptions) => {
|
|
21
|
+
const config = useCoreConfig();
|
|
22
|
+
const fetch = reactive({
|
|
23
|
+
status: ObjectHelper.createStatus(),
|
|
24
|
+
items: [],
|
|
25
|
+
options: initPageOptions({
|
|
26
|
+
limit: config.limit_per_page,
|
|
27
|
+
primary: config.default_primary_key
|
|
28
|
+
})
|
|
29
|
+
});
|
|
30
|
+
const find = reactive({
|
|
31
|
+
status: ObjectHelper.createStatus(),
|
|
32
|
+
item: null,
|
|
33
|
+
options: {}
|
|
34
|
+
});
|
|
35
|
+
const add = reactive({
|
|
36
|
+
status: ObjectHelper.createStatus(),
|
|
37
|
+
item: null,
|
|
38
|
+
options: {}
|
|
39
|
+
});
|
|
40
|
+
const update = reactive({
|
|
41
|
+
status: ObjectHelper.createStatus(),
|
|
42
|
+
item: null,
|
|
43
|
+
options: {}
|
|
44
|
+
});
|
|
45
|
+
const del = reactive({
|
|
46
|
+
// Using 'del' as a variable name since 'delete' is a reserved keyword
|
|
47
|
+
status: ObjectHelper.createStatus(),
|
|
48
|
+
item: null,
|
|
49
|
+
options: {}
|
|
50
|
+
});
|
|
51
|
+
const clearAll = () => {
|
|
52
|
+
find.status = ObjectHelper.createStatus();
|
|
53
|
+
del.status = ObjectHelper.createStatus();
|
|
54
|
+
add.status = ObjectHelper.createStatus();
|
|
55
|
+
update.status = ObjectHelper.createStatus();
|
|
56
|
+
fetch.status = ObjectHelper.createStatus();
|
|
57
|
+
find.item = null;
|
|
58
|
+
del.item = null;
|
|
59
|
+
update.item = null;
|
|
60
|
+
add.item = null;
|
|
61
|
+
fetch.items = [];
|
|
62
|
+
fetch.options = initPageOptions({
|
|
63
|
+
limit: config.limit_per_page,
|
|
64
|
+
primary: config.default_primary_key
|
|
65
|
+
});
|
|
66
|
+
find.options = {};
|
|
67
|
+
add.options = {};
|
|
68
|
+
update.options = {};
|
|
69
|
+
del.options = {};
|
|
70
|
+
};
|
|
71
|
+
const fetchSetLoading = () => {
|
|
72
|
+
fetch.items = [];
|
|
73
|
+
fetch.status = ObjectHelper.toLoadingStatus(fetch.status);
|
|
74
|
+
};
|
|
75
|
+
const findSetLoading = () => {
|
|
76
|
+
find.status = ObjectHelper.toLoadingStatus(find.status);
|
|
77
|
+
};
|
|
78
|
+
const fetchPage = async (page = 1, query = "", opts) => {
|
|
79
|
+
return await apiFetchHelper(
|
|
80
|
+
() => ({
|
|
81
|
+
status: fetch.status,
|
|
82
|
+
items: fetch.items,
|
|
83
|
+
options: fetch.options
|
|
84
|
+
}),
|
|
85
|
+
(data) => {
|
|
86
|
+
fetch.status = data;
|
|
87
|
+
},
|
|
88
|
+
(data) => {
|
|
89
|
+
fetch.options = data;
|
|
90
|
+
},
|
|
91
|
+
(data) => {
|
|
92
|
+
fetch.items = data;
|
|
93
|
+
},
|
|
94
|
+
page,
|
|
95
|
+
query,
|
|
96
|
+
{
|
|
97
|
+
...loaderOptions,
|
|
98
|
+
...opts
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
};
|
|
102
|
+
const findRun = async (id, opts) => {
|
|
103
|
+
return await apiFindHelper(
|
|
104
|
+
() => ({
|
|
105
|
+
status: find.status,
|
|
106
|
+
data: find.item,
|
|
107
|
+
options: find.options
|
|
108
|
+
}),
|
|
109
|
+
(data) => {
|
|
110
|
+
find.status = data;
|
|
111
|
+
},
|
|
112
|
+
(data) => {
|
|
113
|
+
find.options = data;
|
|
114
|
+
},
|
|
115
|
+
(data) => {
|
|
116
|
+
find.item = data;
|
|
117
|
+
},
|
|
118
|
+
id,
|
|
119
|
+
{
|
|
120
|
+
...loaderOptions,
|
|
121
|
+
...opts
|
|
122
|
+
}
|
|
123
|
+
);
|
|
124
|
+
};
|
|
125
|
+
const addRun = async (payload) => {
|
|
126
|
+
return await apiAddHelper(
|
|
127
|
+
() => ({
|
|
128
|
+
items: fetch.items,
|
|
129
|
+
status: add.status,
|
|
130
|
+
data: add.item,
|
|
131
|
+
options: add.options
|
|
132
|
+
}),
|
|
133
|
+
(data) => {
|
|
134
|
+
add.status = data;
|
|
135
|
+
},
|
|
136
|
+
(data) => {
|
|
137
|
+
add.options = data;
|
|
138
|
+
},
|
|
139
|
+
(data) => {
|
|
140
|
+
add.item = data;
|
|
141
|
+
},
|
|
142
|
+
(data) => {
|
|
143
|
+
fetch.items = data;
|
|
144
|
+
},
|
|
145
|
+
payload.data,
|
|
146
|
+
{
|
|
147
|
+
...loaderOptions,
|
|
148
|
+
...payload
|
|
149
|
+
}
|
|
150
|
+
);
|
|
151
|
+
};
|
|
152
|
+
const updateRun = async (id, payload) => {
|
|
153
|
+
return await updateHelper(
|
|
154
|
+
() => ({
|
|
155
|
+
items: fetch.items,
|
|
156
|
+
status: update.status,
|
|
157
|
+
data: update.item,
|
|
158
|
+
oldData: find.item,
|
|
159
|
+
options: update.options
|
|
160
|
+
}),
|
|
161
|
+
(data) => {
|
|
162
|
+
update.status = data;
|
|
163
|
+
},
|
|
164
|
+
(data) => {
|
|
165
|
+
update.options = data;
|
|
166
|
+
},
|
|
167
|
+
(data) => {
|
|
168
|
+
update.item = data;
|
|
169
|
+
},
|
|
170
|
+
(data) => {
|
|
171
|
+
fetch.items = data;
|
|
172
|
+
},
|
|
173
|
+
(data) => {
|
|
174
|
+
find.item = data;
|
|
175
|
+
},
|
|
176
|
+
id,
|
|
177
|
+
payload.data,
|
|
178
|
+
{
|
|
179
|
+
...loaderOptions,
|
|
180
|
+
...payload
|
|
181
|
+
}
|
|
182
|
+
);
|
|
183
|
+
};
|
|
184
|
+
const fetchSearch = async (query = "", opts) => {
|
|
185
|
+
return fetchPage(1, query, opts);
|
|
186
|
+
};
|
|
187
|
+
const fetchPageChange = async (page, opts) => {
|
|
188
|
+
const {
|
|
189
|
+
page: _page,
|
|
190
|
+
...params
|
|
191
|
+
} = fetch.options?.request?.params || {};
|
|
192
|
+
return fetchPage(page, "", {
|
|
193
|
+
params,
|
|
194
|
+
...opts
|
|
195
|
+
});
|
|
196
|
+
};
|
|
197
|
+
const deleteRun = async (id, opts) => {
|
|
198
|
+
return await apiDeleteHelper(
|
|
199
|
+
() => ({
|
|
200
|
+
status: del.status,
|
|
201
|
+
data: del.item,
|
|
202
|
+
items: fetch.items,
|
|
203
|
+
options: del.options
|
|
204
|
+
}),
|
|
205
|
+
(data) => {
|
|
206
|
+
del.status = data;
|
|
207
|
+
},
|
|
208
|
+
(data) => {
|
|
209
|
+
del.options = data;
|
|
210
|
+
},
|
|
211
|
+
(data) => {
|
|
212
|
+
del.item = data;
|
|
213
|
+
},
|
|
214
|
+
(data) => {
|
|
215
|
+
fetch.items = data;
|
|
216
|
+
},
|
|
217
|
+
id,
|
|
218
|
+
{
|
|
219
|
+
...loaderOptions,
|
|
220
|
+
...opts
|
|
221
|
+
}
|
|
222
|
+
);
|
|
223
|
+
};
|
|
224
|
+
return {
|
|
225
|
+
// State and methods
|
|
226
|
+
fetch,
|
|
227
|
+
find,
|
|
228
|
+
add,
|
|
229
|
+
update,
|
|
230
|
+
delete: del,
|
|
231
|
+
// Rename del to delete in the return object
|
|
232
|
+
fetchPage,
|
|
233
|
+
fetchSearch,
|
|
234
|
+
fetchPageChange,
|
|
235
|
+
fetchSetLoading,
|
|
236
|
+
findSetLoading,
|
|
237
|
+
findRun,
|
|
238
|
+
addRun,
|
|
239
|
+
updateRun,
|
|
240
|
+
deleteRun,
|
|
241
|
+
clearAll
|
|
242
|
+
};
|
|
243
|
+
};
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { BreadcrumbItem } from '@nuxt/ui';
|
|
2
2
|
export interface IDefinePageItem {
|
|
3
3
|
title?: string;
|
|
4
4
|
sub_title?: string;
|
|
5
5
|
isHideBreadcrumbs?: boolean;
|
|
6
|
-
breadcrumbs?:
|
|
6
|
+
breadcrumbs?: BreadcrumbItem[];
|
|
7
7
|
}
|
|
8
8
|
export declare const useApp: import("pinia").StoreDefinition<"_app", {
|
|
9
9
|
pageMeta: IDefinePageItem;
|
|
10
|
-
sidebar:
|
|
10
|
+
sidebar: BreadcrumbItem[];
|
|
11
11
|
}, {}, {
|
|
12
12
|
definePage(payload: IDefinePageItem): void;
|
|
13
|
-
defineSidebar(items:
|
|
14
|
-
defineSEO(payload: {
|
|
15
|
-
title?: string;
|
|
16
|
-
description?: string;
|
|
17
|
-
image?: string;
|
|
18
|
-
}): void;
|
|
13
|
+
defineSidebar(items: BreadcrumbItem[]): void;
|
|
19
14
|
}>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { useCoreConfig, useSeoMeta } from "#imports";
|
|
2
1
|
import { defineStore } from "pinia";
|
|
3
2
|
export const useApp = defineStore("_app", {
|
|
4
3
|
state: () => ({
|
|
@@ -14,17 +13,6 @@ export const useApp = defineStore("_app", {
|
|
|
14
13
|
},
|
|
15
14
|
defineSidebar(items) {
|
|
16
15
|
this.sidebar = items;
|
|
17
|
-
},
|
|
18
|
-
defineSEO(payload) {
|
|
19
|
-
const coreConfig = useCoreConfig();
|
|
20
|
-
useSeoMeta({
|
|
21
|
-
title: payload.title,
|
|
22
|
-
titleTemplate: (title) => title ? `${title} | ${coreConfig.site_name}` : coreConfig.site_name,
|
|
23
|
-
ogTitle: payload.title,
|
|
24
|
-
description: payload.description,
|
|
25
|
-
ogDescription: payload.description,
|
|
26
|
-
ogImage: payload.image
|
|
27
|
-
});
|
|
28
16
|
}
|
|
29
17
|
}
|
|
30
18
|
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const useCoreConfig: () =>
|
|
3
|
-
export declare const useUiConfig:
|
|
1
|
+
import type { core as Core } from '../../core.config.js';
|
|
2
|
+
export declare const useCoreConfig: () => typeof Core;
|
|
3
|
+
export declare const useUiConfig: (config: object, name: string) => any;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { tv } from "tailwind-variants";
|
|
2
|
+
import _appConfig from "#build/app.config";
|
|
3
|
+
export const useCoreConfig = () => {
|
|
4
|
+
return _appConfig.core;
|
|
5
|
+
};
|
|
6
|
+
export const useUiConfig = (config, name) => {
|
|
7
|
+
const appConfig = _appConfig;
|
|
8
|
+
return tv({
|
|
9
|
+
extend: tv(config),
|
|
10
|
+
...appConfig.ui[name] || {}
|
|
11
|
+
});
|
|
12
|
+
};
|
|
@@ -7,20 +7,14 @@ export declare const enum DialogType {
|
|
|
7
7
|
export interface IDialogMetaItem {
|
|
8
8
|
title: string;
|
|
9
9
|
description?: string;
|
|
10
|
+
icon?: string;
|
|
10
11
|
type?: DialogType;
|
|
11
12
|
confirmText?: string;
|
|
12
13
|
cancelText?: string;
|
|
13
14
|
isShowCancelBtn?: boolean;
|
|
14
15
|
isHideIcon?: boolean;
|
|
15
|
-
confirmButtonClassName?: string;
|
|
16
|
-
cancelButtonClassName?: string;
|
|
17
16
|
}
|
|
18
17
|
export interface IDialog {
|
|
19
|
-
isShow: boolean;
|
|
20
|
-
meta: IDialogMetaItem | undefined;
|
|
21
|
-
openDialog: (meta: IDialogMetaItem) => void;
|
|
22
|
-
closeDialogCancel: () => void;
|
|
23
|
-
closeDialogProceed: () => void;
|
|
24
18
|
error: (payload: IDialogMetaItem) => Promise<boolean>;
|
|
25
19
|
info: (payload: IDialogMetaItem) => Promise<boolean>;
|
|
26
20
|
success: (payload: IDialogMetaItem) => Promise<boolean>;
|