@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,146 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<UModal
|
|
3
|
-
v-bind="attrs"
|
|
4
|
-
:model-value="modelValue"
|
|
5
|
-
:class="$props.class"
|
|
6
|
-
:overlay="overlay"
|
|
7
|
-
:transition="transition"
|
|
8
|
-
:prevent-close="preventClose"
|
|
9
|
-
:fullscreen="fullscreen"
|
|
10
|
-
:initial-focus="modalWrapper"
|
|
11
|
-
:ui="ui"
|
|
12
|
-
@update:model-value="$emit('update:modelValue', $event)"
|
|
13
|
-
>
|
|
14
|
-
<div
|
|
15
|
-
v-if="title"
|
|
16
|
-
:class="[ui.header, { 'flex items-center justify-between': !isHideCloseBtn }]"
|
|
17
|
-
>
|
|
18
|
-
<h1 class="text-lg font-semibold">{{ title }}</h1>
|
|
19
|
-
<Icon
|
|
20
|
-
v-if="!isHideCloseBtn"
|
|
21
|
-
name="i-heroicons-x-mark"
|
|
22
|
-
class="size-6 cursor-pointer opacity-50"
|
|
23
|
-
@click="close"
|
|
24
|
-
/>
|
|
25
|
-
</div>
|
|
26
|
-
|
|
27
|
-
<div
|
|
28
|
-
v-if="(!title && !isHideCloseBtn && preventClose) || fullscreen"
|
|
29
|
-
class="absolute right-0 m-4"
|
|
30
|
-
>
|
|
31
|
-
<Icon
|
|
32
|
-
v-if="!isHideCloseBtn"
|
|
33
|
-
name="i-heroicons-x-mark"
|
|
34
|
-
class="size-6 cursor-pointer opacity-50"
|
|
35
|
-
@click="close"
|
|
36
|
-
/>
|
|
37
|
-
</div>
|
|
38
|
-
|
|
39
|
-
<div ref="modalWrapper" :class="[ui.innerWrapper]">
|
|
40
|
-
<slot />
|
|
41
|
-
</div>
|
|
42
|
-
</UModal>
|
|
43
|
-
</template>
|
|
44
|
-
|
|
45
|
-
<script lang="ts" setup>
|
|
46
|
-
import { type PropType, defineShortcuts, ref, toRef, watch } from '#imports'
|
|
47
|
-
import { useUI } from '#ui/composables/useUI'
|
|
48
|
-
import { modal } from '#core/ui.config'
|
|
49
|
-
import { useUiConfig } from '#core/composables/useConfig'
|
|
50
|
-
import type { Strategy } from '#ui/types'
|
|
51
|
-
|
|
52
|
-
const config = useUiConfig<typeof modal>(modal, 'modal')
|
|
53
|
-
|
|
54
|
-
const props = defineProps({
|
|
55
|
-
modelValue: {
|
|
56
|
-
type: Boolean,
|
|
57
|
-
default: false,
|
|
58
|
-
},
|
|
59
|
-
overlay: {
|
|
60
|
-
type: Boolean,
|
|
61
|
-
default: true,
|
|
62
|
-
},
|
|
63
|
-
transition: {
|
|
64
|
-
type: Boolean,
|
|
65
|
-
default: true,
|
|
66
|
-
},
|
|
67
|
-
preventClose: {
|
|
68
|
-
type: Boolean,
|
|
69
|
-
default: false,
|
|
70
|
-
},
|
|
71
|
-
fullscreen: {
|
|
72
|
-
type: Boolean,
|
|
73
|
-
default: false,
|
|
74
|
-
},
|
|
75
|
-
scrollable: {
|
|
76
|
-
type: Boolean,
|
|
77
|
-
default: false,
|
|
78
|
-
},
|
|
79
|
-
title: {
|
|
80
|
-
type: String,
|
|
81
|
-
default: '',
|
|
82
|
-
},
|
|
83
|
-
isHideCloseBtn: {
|
|
84
|
-
type: Boolean,
|
|
85
|
-
default: false,
|
|
86
|
-
},
|
|
87
|
-
size: {
|
|
88
|
-
type: String as PropType<keyof typeof modal.size>,
|
|
89
|
-
default: () => modal.default.size,
|
|
90
|
-
},
|
|
91
|
-
position: {
|
|
92
|
-
type: String as PropType<keyof typeof modal.position>,
|
|
93
|
-
default: () => modal.default.position,
|
|
94
|
-
},
|
|
95
|
-
fixHeightSize: {
|
|
96
|
-
type: String as PropType<keyof typeof modal.fixHeightSize>,
|
|
97
|
-
default: () => modal.default.fixHeightSize,
|
|
98
|
-
},
|
|
99
|
-
class: {
|
|
100
|
-
type: [String, Array, Object] as PropType<any>,
|
|
101
|
-
default: undefined,
|
|
102
|
-
},
|
|
103
|
-
ui: {
|
|
104
|
-
type: Object as PropType<Partial<typeof config & { strategy?: Strategy }>>,
|
|
105
|
-
default: undefined,
|
|
106
|
-
},
|
|
107
|
-
})
|
|
108
|
-
|
|
109
|
-
const emits = defineEmits(['update:modelValue'])
|
|
110
|
-
|
|
111
|
-
defineShortcuts({
|
|
112
|
-
escape: {
|
|
113
|
-
usingInput: true,
|
|
114
|
-
handler: () => {
|
|
115
|
-
if (props.preventClose) return
|
|
116
|
-
emits('update:modelValue', false)
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
})
|
|
120
|
-
|
|
121
|
-
const modalWrapper = ref<HTMLElement | null>(null)
|
|
122
|
-
|
|
123
|
-
const close = () => {
|
|
124
|
-
emits('update:modelValue', false)
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
const { ui, attrs } = useUI('modal', toRef(props, 'ui'), config, toRef(props, 'class'))
|
|
128
|
-
|
|
129
|
-
watch(
|
|
130
|
-
() => props.modelValue,
|
|
131
|
-
() => {
|
|
132
|
-
if (props.modelValue) {
|
|
133
|
-
const size = config.size[props.size]
|
|
134
|
-
const fixHeightSize = config.fixHeightSize[props.fixHeightSize]
|
|
135
|
-
const position = config.position[props.position]
|
|
136
|
-
|
|
137
|
-
ui.value.width = size
|
|
138
|
-
ui.value.container = position
|
|
139
|
-
|
|
140
|
-
if (props.scrollable) {
|
|
141
|
-
ui.value.height = fixHeightSize
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
)
|
|
146
|
-
</script>
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :class="containerClass">
|
|
3
|
-
<input
|
|
4
|
-
v-for="(_, index) in length"
|
|
5
|
-
:key="index"
|
|
6
|
-
:ref="(el) => setInputRef(index, el)"
|
|
7
|
-
v-model="otp[index]"
|
|
8
|
-
:type="isPassword ? 'password' : 'text'"
|
|
9
|
-
:class="inputClass"
|
|
10
|
-
maxlength="1"
|
|
11
|
-
:autofocus="autoFocus && index === 0"
|
|
12
|
-
@input="handleInput(index)"
|
|
13
|
-
@focus="handleFocus($event)"
|
|
14
|
-
@paste="handlePaste"
|
|
15
|
-
@keydown="handleKeydown(index, $event)"
|
|
16
|
-
/>
|
|
17
|
-
</div>
|
|
18
|
-
</template>
|
|
19
|
-
<script lang="ts" setup>
|
|
20
|
-
import { type Ref, ref } from 'vue'
|
|
21
|
-
import { watch } from '#imports'
|
|
22
|
-
|
|
23
|
-
const emits = defineEmits(['update:modelValue'])
|
|
24
|
-
const props = defineProps({
|
|
25
|
-
length: {
|
|
26
|
-
type: Number,
|
|
27
|
-
required: true,
|
|
28
|
-
},
|
|
29
|
-
autoFocus: {
|
|
30
|
-
type: Boolean,
|
|
31
|
-
default: false,
|
|
32
|
-
},
|
|
33
|
-
isPassword: {
|
|
34
|
-
type: Boolean,
|
|
35
|
-
default: false,
|
|
36
|
-
},
|
|
37
|
-
isOnlyNumber: {
|
|
38
|
-
type: Boolean,
|
|
39
|
-
default: false,
|
|
40
|
-
},
|
|
41
|
-
modelValue: {
|
|
42
|
-
type: String,
|
|
43
|
-
default: '',
|
|
44
|
-
},
|
|
45
|
-
containerClass: {
|
|
46
|
-
type: String,
|
|
47
|
-
default: 'flex space-x-3',
|
|
48
|
-
},
|
|
49
|
-
inputClass: {
|
|
50
|
-
type: String,
|
|
51
|
-
default:
|
|
52
|
-
'h-12 w-12 relative flex flex-col items-center justify-center text-center ' +
|
|
53
|
-
'disabled:cursor-not-allowed disabled:opacity-75 focus:outline-none border-0 form-input ' +
|
|
54
|
-
'rounded-md placeholder-gray-400 text-sm px-3.5 py-2.5 shadow-sm bg-white text-gray-900 ' +
|
|
55
|
-
'ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-primary-500',
|
|
56
|
-
},
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
const otp: Ref<string[]> = ref(Array(props.length).fill(''))
|
|
60
|
-
const inputRefs: Ref<HTMLInputElement[]> = ref([])
|
|
61
|
-
|
|
62
|
-
const setInputRef = (index: number, el: HTMLInputElement) => {
|
|
63
|
-
if (el) {
|
|
64
|
-
inputRefs.value[index] = el
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const focusNext = (index: number): void => {
|
|
69
|
-
if (index < props.length - 1) {
|
|
70
|
-
inputRefs.value[index + 1].focus()
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const focusPrevious = (index: number): void => {
|
|
75
|
-
if (index > 0) {
|
|
76
|
-
inputRefs.value[index - 1].focus()
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const isNumeric = (str: string): boolean => {
|
|
81
|
-
return /^\d+$/.test(str)
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
const handleInput = (index: number): void => {
|
|
85
|
-
if (props.isOnlyNumber && !isNumeric(otp.value[index])) {
|
|
86
|
-
otp.value[index] = ''
|
|
87
|
-
|
|
88
|
-
return
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
if (otp.value[index].length === 1) {
|
|
92
|
-
focusNext(index)
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
const handleFocus = (event: FocusEvent): void => {
|
|
97
|
-
const target = event.target as HTMLInputElement
|
|
98
|
-
|
|
99
|
-
target.select()
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
const handlePaste = (event: ClipboardEvent): void => {
|
|
103
|
-
const paste = event.clipboardData?.getData('text') || ''
|
|
104
|
-
|
|
105
|
-
if (paste.length === props.length) {
|
|
106
|
-
paste.split('').forEach((char, idx) => {
|
|
107
|
-
otp.value[idx] = char
|
|
108
|
-
})
|
|
109
|
-
|
|
110
|
-
focusNext(paste.length - 2)
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const handleKeydown = (index: number, event: KeyboardEvent): void => {
|
|
115
|
-
// Focus the previous field if backspace is pressed on an empty field
|
|
116
|
-
if (event.key === 'Backspace' && otp.value[index] === '') {
|
|
117
|
-
focusPrevious(index)
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
watch(
|
|
122
|
-
() => otp.value.join(''),
|
|
123
|
-
(newValue) => {
|
|
124
|
-
emits('update:modelValue', newValue)
|
|
125
|
-
}
|
|
126
|
-
)
|
|
127
|
-
</script>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<QrcodeVue :value="value" :level="level" :render-as="renderAs" class="size-[350px]" />
|
|
3
|
-
</template>
|
|
4
|
-
<script lang="ts" setup>
|
|
5
|
-
import QrcodeVue, { type RenderAs } from 'qrcode.vue'
|
|
6
|
-
import { type PropType } from 'vue'
|
|
7
|
-
|
|
8
|
-
defineProps({
|
|
9
|
-
value: {
|
|
10
|
-
type: String,
|
|
11
|
-
required: true,
|
|
12
|
-
},
|
|
13
|
-
level: {
|
|
14
|
-
type: String,
|
|
15
|
-
default: 'M',
|
|
16
|
-
},
|
|
17
|
-
renderAs: {
|
|
18
|
-
type: String as PropType<RenderAs>,
|
|
19
|
-
default: 'svg',
|
|
20
|
-
},
|
|
21
|
-
})
|
|
22
|
-
</script>
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<Button
|
|
4
|
-
:size="size"
|
|
5
|
-
:disabled="!canGoFirstOrPrev || disabled"
|
|
6
|
-
:class="[ui.base, ui.rounded]"
|
|
7
|
-
v-bind="{ ...((ui.default?.prevButton as object) || {}) }"
|
|
8
|
-
:ui="{ rounded: '' }"
|
|
9
|
-
aria-label="Prev"
|
|
10
|
-
@click="onClickPrev"
|
|
11
|
-
/>
|
|
12
|
-
|
|
13
|
-
<Button
|
|
14
|
-
:size="size"
|
|
15
|
-
:disabled="!canGoLastOrNext || disabled"
|
|
16
|
-
:class="[ui.base, ui.rounded]"
|
|
17
|
-
v-bind="{ ...((ui.default?.nextButton as object) || {}) }"
|
|
18
|
-
:ui="{ rounded: '' }"
|
|
19
|
-
aria-label="Next"
|
|
20
|
-
@click="onClickNext"
|
|
21
|
-
/>
|
|
22
|
-
</div>
|
|
23
|
-
</template>
|
|
24
|
-
|
|
25
|
-
<script lang="ts" setup>
|
|
26
|
-
import { useUiConfig } from '../composables/useConfig'
|
|
27
|
-
import { pagination } from '#core/ui.config'
|
|
28
|
-
import { useUI, type PropType, toRef, computed } from '#imports'
|
|
29
|
-
import type { ButtonSize } from '#ui/types/button'
|
|
30
|
-
import type { Strategy } from '#ui/types'
|
|
31
|
-
|
|
32
|
-
const config = useUiConfig<typeof pagination>(pagination, 'pagination')
|
|
33
|
-
|
|
34
|
-
const emits = defineEmits(['update:modelValue'])
|
|
35
|
-
|
|
36
|
-
const props = defineProps({
|
|
37
|
-
modelValue: {
|
|
38
|
-
type: Number,
|
|
39
|
-
required: true,
|
|
40
|
-
},
|
|
41
|
-
pageCount: {
|
|
42
|
-
type: Number,
|
|
43
|
-
default: 10,
|
|
44
|
-
},
|
|
45
|
-
total: {
|
|
46
|
-
type: Number,
|
|
47
|
-
required: true,
|
|
48
|
-
},
|
|
49
|
-
disabled: {
|
|
50
|
-
type: Boolean,
|
|
51
|
-
default: false,
|
|
52
|
-
},
|
|
53
|
-
size: {
|
|
54
|
-
type: String as PropType<ButtonSize>,
|
|
55
|
-
default: () => pagination.default?.size,
|
|
56
|
-
},
|
|
57
|
-
class: {
|
|
58
|
-
type: [String, Object, Array] as PropType<any>,
|
|
59
|
-
default: () => '',
|
|
60
|
-
},
|
|
61
|
-
ui: {
|
|
62
|
-
type: Object as PropType<Partial<typeof config> & { strategy?: Strategy }>,
|
|
63
|
-
default: () => ({}),
|
|
64
|
-
},
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
const { ui } = useUI('pagination', toRef(props, 'ui'), config, toRef(props, 'class'))
|
|
68
|
-
|
|
69
|
-
const currentPage = computed({
|
|
70
|
-
get() {
|
|
71
|
-
return props.modelValue
|
|
72
|
-
},
|
|
73
|
-
set(value: number) {
|
|
74
|
-
emits('update:modelValue', value)
|
|
75
|
-
},
|
|
76
|
-
})
|
|
77
|
-
|
|
78
|
-
const pages = computed(() =>
|
|
79
|
-
Array.from({ length: Math.ceil(props.total / props.pageCount) }, (_, i) => i + 1)
|
|
80
|
-
)
|
|
81
|
-
|
|
82
|
-
const canGoFirstOrPrev = computed(() => currentPage.value > 1)
|
|
83
|
-
const canGoLastOrNext = computed(() => currentPage.value < pages.value.length)
|
|
84
|
-
|
|
85
|
-
const onClickPrev = () => {
|
|
86
|
-
if (canGoFirstOrPrev.value) {
|
|
87
|
-
currentPage.value--
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
const onClickNext = () => {
|
|
92
|
-
if (canGoLastOrNext.value) {
|
|
93
|
-
currentPage.value++
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
</script>
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<USlideover
|
|
3
|
-
v-bind="attrs"
|
|
4
|
-
:model-value="modelValue"
|
|
5
|
-
:class="$props.class"
|
|
6
|
-
:prevent-close="preventClose"
|
|
7
|
-
:overlay="overlay"
|
|
8
|
-
:transition="transition"
|
|
9
|
-
:side="side"
|
|
10
|
-
:initial-focus="emptyFocusRef"
|
|
11
|
-
:ui="ui"
|
|
12
|
-
@update:model-value="$emit('update:modelValue', $event)"
|
|
13
|
-
>
|
|
14
|
-
<div v-if="!isHideCloseBtn && preventClose" class="absolute right-0 m-4">
|
|
15
|
-
<Icon
|
|
16
|
-
v-if="!isHideCloseBtn"
|
|
17
|
-
name="i-heroicons-x-mark"
|
|
18
|
-
class="size-6 cursor-pointer"
|
|
19
|
-
@click="close"
|
|
20
|
-
/>
|
|
21
|
-
</div>
|
|
22
|
-
|
|
23
|
-
<div :class="['overflow-y-auto', ui.bodyWrapper]">
|
|
24
|
-
<slot />
|
|
25
|
-
</div>
|
|
26
|
-
</USlideover>
|
|
27
|
-
|
|
28
|
-
<div ref="emptyFocusRef" />
|
|
29
|
-
</template>
|
|
30
|
-
|
|
31
|
-
<script lang="ts" setup>
|
|
32
|
-
import { ref, type PropType, toRef, defineShortcuts, watch } from '#imports'
|
|
33
|
-
import { useUI } from '#ui/composables/useUI'
|
|
34
|
-
import { slideover } from '#core/ui.config'
|
|
35
|
-
import { useUiConfig } from '#core/composables/useConfig'
|
|
36
|
-
import type { Strategy } from '#ui/types'
|
|
37
|
-
|
|
38
|
-
const config = useUiConfig<typeof slideover>(slideover, 'slideover')
|
|
39
|
-
|
|
40
|
-
const props = defineProps({
|
|
41
|
-
modelValue: {
|
|
42
|
-
type: Boolean as PropType<boolean>,
|
|
43
|
-
default: false,
|
|
44
|
-
},
|
|
45
|
-
side: {
|
|
46
|
-
type: String as PropType<'left' | 'right'>,
|
|
47
|
-
default: 'right',
|
|
48
|
-
validator: (value: string) => ['left', 'right'].includes(value),
|
|
49
|
-
},
|
|
50
|
-
overlay: {
|
|
51
|
-
type: Boolean,
|
|
52
|
-
default: true,
|
|
53
|
-
},
|
|
54
|
-
preventClose: {
|
|
55
|
-
type: Boolean,
|
|
56
|
-
default: false,
|
|
57
|
-
},
|
|
58
|
-
isHideCloseBtn: {
|
|
59
|
-
type: Boolean,
|
|
60
|
-
default: false,
|
|
61
|
-
},
|
|
62
|
-
transition: {
|
|
63
|
-
type: Boolean,
|
|
64
|
-
default: true,
|
|
65
|
-
},
|
|
66
|
-
size: {
|
|
67
|
-
type: String as PropType<keyof typeof slideover.size>,
|
|
68
|
-
default: () => slideover.default.size,
|
|
69
|
-
},
|
|
70
|
-
class: {
|
|
71
|
-
type: [String, Array, Object] as PropType<any>,
|
|
72
|
-
default: undefined,
|
|
73
|
-
},
|
|
74
|
-
ui: {
|
|
75
|
-
type: Object as PropType<Partial<typeof config & { strategy?: Strategy }>>,
|
|
76
|
-
default: undefined,
|
|
77
|
-
},
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
const emits = defineEmits(['update:modelValue'])
|
|
81
|
-
|
|
82
|
-
const emptyFocusRef = ref<HTMLElement | null>(null)
|
|
83
|
-
|
|
84
|
-
defineShortcuts({
|
|
85
|
-
escape: {
|
|
86
|
-
usingInput: true,
|
|
87
|
-
handler: () => {
|
|
88
|
-
if (props.preventClose) return
|
|
89
|
-
emits('update:modelValue', false)
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
})
|
|
93
|
-
|
|
94
|
-
const close = () => {
|
|
95
|
-
emits('update:modelValue', false)
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
const { ui, attrs } = useUI('slideover', toRef(props, 'ui'), config, toRef(props, 'class'))
|
|
99
|
-
|
|
100
|
-
watch(
|
|
101
|
-
() => props.modelValue,
|
|
102
|
-
() => {
|
|
103
|
-
if (props.modelValue) {
|
|
104
|
-
const size = config.size[props.size]
|
|
105
|
-
|
|
106
|
-
ui.value.width = size
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
)
|
|
110
|
-
</script>
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<UTabs
|
|
3
|
-
v-bind="attrs"
|
|
4
|
-
:model-value="modelValue"
|
|
5
|
-
:class="$props.class"
|
|
6
|
-
:items="items"
|
|
7
|
-
:orientation="orientation"
|
|
8
|
-
:default-index="defaultIndex"
|
|
9
|
-
:ui="ui"
|
|
10
|
-
@change="change"
|
|
11
|
-
>
|
|
12
|
-
<template #default="{ item, index, selected }">
|
|
13
|
-
<slot name="default" :item="item" :index="index" :selected="selected" />
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<template #item="{ item, index, selected }">
|
|
17
|
-
<slot name="item" :item="item" :index="index" :selected="selected" />
|
|
18
|
-
</template>
|
|
19
|
-
</UTabs>
|
|
20
|
-
</template>
|
|
21
|
-
|
|
22
|
-
<script setup lang="ts">
|
|
23
|
-
import { useUiConfig, type PropType, useUI, toRef } from '#imports'
|
|
24
|
-
import { tabs } from '#core/ui.config'
|
|
25
|
-
import type { Strategy, TabItem } from '#ui/types'
|
|
26
|
-
|
|
27
|
-
const config = useUiConfig<typeof tabs>(tabs, 'tabs')
|
|
28
|
-
|
|
29
|
-
const props = defineProps({
|
|
30
|
-
modelValue: {
|
|
31
|
-
type: Number,
|
|
32
|
-
default: undefined,
|
|
33
|
-
},
|
|
34
|
-
items: {
|
|
35
|
-
type: Array as PropType<TabItem[]>,
|
|
36
|
-
default: () => [],
|
|
37
|
-
},
|
|
38
|
-
orientation: {
|
|
39
|
-
type: String as PropType<'horizontal' | 'vertical'>,
|
|
40
|
-
default: 'horizontal',
|
|
41
|
-
validator: (value: string) => ['horizontal', 'vertical'].includes(value),
|
|
42
|
-
},
|
|
43
|
-
defaultIndex: {
|
|
44
|
-
type: Number,
|
|
45
|
-
default: 0,
|
|
46
|
-
},
|
|
47
|
-
class: {
|
|
48
|
-
type: [String, Object, Array] as PropType<any>,
|
|
49
|
-
default: () => '',
|
|
50
|
-
},
|
|
51
|
-
ui: {
|
|
52
|
-
type: Object as PropType<Partial<typeof config> & { strategy?: Strategy }>,
|
|
53
|
-
default: () => ({}),
|
|
54
|
-
},
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
const emits = defineEmits(['update:modelValue', 'change'])
|
|
58
|
-
|
|
59
|
-
const change = (index: number) => {
|
|
60
|
-
emits('change', index)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const { ui, attrs } = useUI('tabs', toRef(props, 'ui'), config, toRef(props, 'class'))
|
|
64
|
-
</script>
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { ref } from "vue";
|
|
2
|
-
import { ObjectHelper } from "../utils/ObjectHelper.mjs";
|
|
3
|
-
import {
|
|
4
|
-
apiListHelper
|
|
5
|
-
} from "../helpers/apiListHelper.mjs";
|
|
6
|
-
export const useListLoader = (loaderOptions) => {
|
|
7
|
-
const status = ref(ObjectHelper.createStatus());
|
|
8
|
-
const items = ref([]);
|
|
9
|
-
const options = ref({});
|
|
10
|
-
const clear = () => {
|
|
11
|
-
status.value = ObjectHelper.createStatus();
|
|
12
|
-
items.value = [];
|
|
13
|
-
};
|
|
14
|
-
const run = async (opts) => {
|
|
15
|
-
return apiListHelper(
|
|
16
|
-
() => ({
|
|
17
|
-
status: status.value,
|
|
18
|
-
items: items.value,
|
|
19
|
-
options: options.value
|
|
20
|
-
}),
|
|
21
|
-
(_data) => {
|
|
22
|
-
status.value = _data;
|
|
23
|
-
},
|
|
24
|
-
(_data) => {
|
|
25
|
-
options.value = _data;
|
|
26
|
-
},
|
|
27
|
-
(_data) => {
|
|
28
|
-
items.value = _data;
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
...loaderOptions,
|
|
32
|
-
...opts
|
|
33
|
-
}
|
|
34
|
-
);
|
|
35
|
-
};
|
|
36
|
-
const setLoading = () => {
|
|
37
|
-
items.value = [];
|
|
38
|
-
status.value = ObjectHelper.toLoadingStatus(status.value);
|
|
39
|
-
};
|
|
40
|
-
const setItems = (_items) => {
|
|
41
|
-
items.value = _items;
|
|
42
|
-
};
|
|
43
|
-
return {
|
|
44
|
-
items,
|
|
45
|
-
status,
|
|
46
|
-
options,
|
|
47
|
-
run,
|
|
48
|
-
clear,
|
|
49
|
-
setItems,
|
|
50
|
-
setLoading
|
|
51
|
-
};
|
|
52
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { ref } from "vue";
|
|
2
|
-
import { ObjectHelper } from "../utils/ObjectHelper.mjs";
|
|
3
|
-
import {
|
|
4
|
-
apiObjectHelper
|
|
5
|
-
} from "../helpers/apiObjectHelper.mjs";
|
|
6
|
-
export const useObjectLoader = (loaderOptions) => {
|
|
7
|
-
const status = ref(ObjectHelper.createStatus());
|
|
8
|
-
const data = ref(null);
|
|
9
|
-
const options = ref({});
|
|
10
|
-
const clear = () => {
|
|
11
|
-
status.value = ObjectHelper.createStatus();
|
|
12
|
-
data.value = null;
|
|
13
|
-
};
|
|
14
|
-
const run = async (payload, opts = {}) => {
|
|
15
|
-
await apiObjectHelper(
|
|
16
|
-
() => ({
|
|
17
|
-
status: status.value,
|
|
18
|
-
data: data.value,
|
|
19
|
-
options: options.value
|
|
20
|
-
}),
|
|
21
|
-
(_data) => {
|
|
22
|
-
status.value = _data;
|
|
23
|
-
},
|
|
24
|
-
(_data) => {
|
|
25
|
-
options.value = _data;
|
|
26
|
-
},
|
|
27
|
-
(_data) => {
|
|
28
|
-
data.value = _data;
|
|
29
|
-
},
|
|
30
|
-
payload,
|
|
31
|
-
{
|
|
32
|
-
...loaderOptions,
|
|
33
|
-
...opts
|
|
34
|
-
}
|
|
35
|
-
);
|
|
36
|
-
};
|
|
37
|
-
const setLoading = () => {
|
|
38
|
-
status.value = ObjectHelper.toLoadingStatus(status.value);
|
|
39
|
-
};
|
|
40
|
-
const setData = (_data) => {
|
|
41
|
-
data.value = _data;
|
|
42
|
-
};
|
|
43
|
-
return {
|
|
44
|
-
data,
|
|
45
|
-
status,
|
|
46
|
-
options,
|
|
47
|
-
run,
|
|
48
|
-
clear,
|
|
49
|
-
setLoading,
|
|
50
|
-
setData
|
|
51
|
-
};
|
|
52
|
-
};
|