@finema/core 3.22.0 → 3.23.2
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/dist/module.d.mts +2 -0
- package/dist/module.json +2 -2
- package/dist/module.mjs +16 -2
- package/dist/runtime/components/App.vue +1 -1
- package/dist/runtime/components/DevToolsWindow/index.vue +1 -1
- package/dist/runtime/components/Dialog/index.d.vue.ts +1 -4
- package/dist/runtime/components/Dialog/index.vue +9 -10
- package/dist/runtime/components/Dialog/index.vue.d.ts +1 -4
- package/dist/runtime/components/Empty.d.vue.ts +0 -1
- package/dist/runtime/components/Empty.vue +6 -2
- package/dist/runtime/components/Empty.vue.d.ts +0 -1
- package/dist/runtime/components/FlexDeck/index.vue +86 -81
- package/dist/runtime/components/Form/FieldWrapper.vue +14 -14
- package/dist/runtime/components/Form/Fields.vue +10 -10
- package/dist/runtime/components/Form/InputCheckbox/index.vue +20 -19
- package/dist/runtime/components/Form/InputCheckboxGroup/index.vue +2 -1
- package/dist/runtime/components/Form/InputComponent/index.vue +2 -1
- package/dist/runtime/components/Form/InputCurrency/index.vue +51 -50
- package/dist/runtime/components/Form/InputDateTime/date_time_field.types.d.ts +1 -1
- package/dist/runtime/components/Form/InputDateTime/index.vue +69 -64
- package/dist/runtime/components/Form/InputDateTimeRange/date_range_time_field.types.d.ts +1 -1
- package/dist/runtime/components/Form/InputDateTimeRange/index.vue +62 -57
- package/dist/runtime/components/Form/InputMonth/index.vue +10 -5
- package/dist/runtime/components/Form/InputMonth/types.d.ts +1 -1
- package/dist/runtime/components/Form/InputNumber/index.vue +22 -21
- package/dist/runtime/components/Form/InputRadio/index.d.vue.ts +1 -1
- package/dist/runtime/components/Form/InputRadio/index.vue +2 -1
- package/dist/runtime/components/Form/InputRadio/index.vue.d.ts +1 -1
- package/dist/runtime/components/Form/InputRating/index.vue +2 -1
- package/dist/runtime/components/Form/InputSearch/index.vue +7 -2
- package/dist/runtime/components/Form/InputSelect/index.vue +112 -111
- package/dist/runtime/components/Form/InputSelectMultiple/index.vue +120 -119
- package/dist/runtime/components/Form/InputTags/index.vue +56 -55
- package/dist/runtime/components/Form/InputText/index.vue +88 -87
- package/dist/runtime/components/Form/InputTextarea/index.vue +20 -19
- package/dist/runtime/components/Form/InputTime/index.vue +45 -40
- package/dist/runtime/components/Form/InputTime/types.d.ts +1 -1
- package/dist/runtime/components/Form/InputToggle/index.vue +19 -18
- package/dist/runtime/components/Form/InputUploadDropzone/index.d.vue.ts +1 -4
- package/dist/runtime/components/Form/InputUploadDropzone/index.vue +40 -35
- package/dist/runtime/components/Form/InputUploadDropzone/index.vue.d.ts +1 -4
- package/dist/runtime/components/Form/InputUploadDropzone/types.d.ts +2 -2
- package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.d.vue.ts +0 -5
- package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.vue +63 -58
- package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.vue.d.ts +0 -5
- package/dist/runtime/components/Form/InputUploadDropzoneAuto/types.d.ts +3 -3
- package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/index.d.vue.ts +0 -5
- package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/index.vue +69 -60
- package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/index.vue.d.ts +0 -5
- package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/types.d.ts +3 -3
- package/dist/runtime/components/Form/InputUploadImageAuto/index.d.vue.ts +1 -6
- package/dist/runtime/components/Form/InputUploadImageAuto/index.vue +63 -58
- package/dist/runtime/components/Form/InputUploadImageAuto/index.vue.d.ts +1 -6
- package/dist/runtime/components/Form/InputUploadImageAuto/types.d.ts +3 -3
- package/dist/runtime/components/Form/InputWYSIWYG/EditorImageUploadNode.vue +18 -18
- package/dist/runtime/components/Form/InputWYSIWYG/EditorLinkPopover.vue +65 -65
- package/dist/runtime/components/Form/InputWYSIWYG/README.md +96 -96
- package/dist/runtime/components/Form/InputWYSIWYG/index.vue +43 -42
- package/dist/runtime/components/Form/fileState/EmptyState.vue +21 -21
- package/dist/runtime/components/Form/fileState/FailedState.vue +37 -33
- package/dist/runtime/components/Form/fileState/LoadingState.vue +24 -24
- package/dist/runtime/components/Form/fileState/MultipleFilesState.d.vue.ts +4 -4
- package/dist/runtime/components/Form/fileState/MultipleFilesState.vue +79 -75
- package/dist/runtime/components/Form/fileState/MultipleFilesState.vue.d.ts +4 -4
- package/dist/runtime/components/Form/fileState/PreviewModal.vue +23 -23
- package/dist/runtime/components/Form/fileState/SuccessState.d.vue.ts +2 -2
- package/dist/runtime/components/Form/fileState/SuccessState.vue +8 -4
- package/dist/runtime/components/Form/fileState/SuccessState.vue.d.ts +2 -2
- package/dist/runtime/components/Form/fileState/useFilePicker.d.ts +34 -0
- package/dist/runtime/components/Form/fileState/useFilePicker.js +48 -0
- package/dist/runtime/components/Form/fileState/useFileState.d.ts +7 -9
- package/dist/runtime/components/Form/fileState/useFileState.js +40 -120
- package/dist/runtime/components/Form/fileState/useUploadImageState.d.ts +7 -8
- package/dist/runtime/components/Form/fileState/useUploadImageState.js +28 -300
- package/dist/runtime/components/Form/fileState/useUploadState.d.ts +11 -7
- package/dist/runtime/components/Form/fileState/useUploadState.js +58 -131
- package/dist/runtime/components/Form/fileState/useUploadStateMultiple.d.ts +12 -18
- package/dist/runtime/components/Form/fileState/useUploadStateMultiple.js +89 -222
- package/dist/runtime/components/Form/index.vue +5 -5
- package/dist/runtime/components/Form/types.d.ts +2 -0
- package/dist/runtime/components/Image.vue +28 -28
- package/dist/runtime/components/Loader.d.vue.ts +1 -0
- package/dist/runtime/components/Loader.vue.d.ts +1 -0
- package/dist/runtime/components/Table/Base.d.vue.ts +15 -1
- package/dist/runtime/components/Table/Base.vue +118 -118
- package/dist/runtime/components/Table/Base.vue.d.ts +15 -1
- package/dist/runtime/components/Table/ColumnDate.vue +1 -1
- package/dist/runtime/components/Table/ColumnDateTime.vue +1 -1
- package/dist/runtime/components/Table/ColumnImage.vue +4 -4
- package/dist/runtime/components/Table/ColumnText.d.vue.ts +2 -3
- package/dist/runtime/components/Table/ColumnText.vue +11 -11
- package/dist/runtime/components/Table/ColumnText.vue.d.ts +2 -3
- package/dist/runtime/components/Table/Pagination.vue +70 -67
- package/dist/runtime/components/Table/Simple.vue +19 -19
- package/dist/runtime/components/Table/index.d.vue.ts +1 -1
- package/dist/runtime/components/Table/index.vue +37 -33
- package/dist/runtime/components/Table/index.vue.d.ts +1 -1
- package/dist/runtime/composables/loaderList.d.ts +2 -1
- package/dist/runtime/composables/loaderList.js +2 -1
- package/dist/runtime/composables/loaderObject.d.ts +2 -1
- package/dist/runtime/composables/loaderObject.js +2 -1
- package/dist/runtime/composables/loaderPage.js +194 -344
- package/dist/runtime/composables/useConfig.js +4 -3
- package/dist/runtime/composables/useDialog.js +5 -1
- package/dist/runtime/composables/useForm.d.ts +1 -1
- package/dist/runtime/composables/useForm.js +1 -1
- package/dist/runtime/composables/useMessages.d.ts +10 -0
- package/dist/runtime/composables/useMessages.js +10 -0
- package/dist/runtime/helpers/apiPageHelper.d.ts +0 -1
- package/dist/runtime/helpers/uploadCore.d.ts +54 -0
- package/dist/runtime/helpers/uploadCore.js +84 -0
- package/dist/runtime/i18n/valibot.d.ts +5 -68
- package/dist/runtime/i18n/valibot.js +33 -29
- package/dist/runtime/locale/en.d.ts +2 -0
- package/dist/runtime/locale/en.js +42 -0
- package/dist/runtime/locale/index.d.ts +7 -0
- package/dist/runtime/locale/index.js +8 -0
- package/dist/runtime/locale/th.d.ts +43 -0
- package/dist/runtime/locale/th.js +42 -0
- package/dist/runtime/server/tsconfig.json +3 -3
- package/dist/runtime/utils/ParamHelper.js +1 -1
- package/dist/runtime/utils/StringHelper.js +1 -4
- package/dist/runtime/utils/TimeHelper.js +2 -2
- package/dist/runtime/utils/lodash.js +2 -2
- package/package.json +20 -12
|
@@ -1,131 +1,131 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
3
|
:class="
|
|
4
4
|
theme.rootWrapper({
|
|
5
5
|
class: [ui?.rootWrapper]
|
|
6
6
|
})
|
|
7
|
-
"
|
|
8
|
-
>
|
|
9
|
-
<Pagination
|
|
10
|
-
v-if="!options.isHidePagination && !options.isHidePaginationTop"
|
|
11
|
-
:options="options"
|
|
12
|
-
:ui="ui"
|
|
13
|
-
:page="page"
|
|
14
|
-
:page-limit="pageLimit"
|
|
15
|
-
class="border-b border-[#EAECF0]"
|
|
16
|
-
@pageChange="onPageChange"
|
|
17
|
-
@search="emits('search')"
|
|
18
|
-
@pageLimitChange="changePageLimit"
|
|
19
|
-
/>
|
|
20
|
-
<UTable
|
|
21
|
-
:loading="options.status.isLoading"
|
|
22
|
-
:columns="uTableCompatibleColumns"
|
|
23
|
-
:data="options.rawData"
|
|
24
|
-
v-bind="$attrs"
|
|
25
|
-
:ui="ui"
|
|
26
|
-
>
|
|
27
|
-
<template #loading>
|
|
28
|
-
<Loader :loading="true" />
|
|
29
|
-
</template>
|
|
30
|
-
<template #empty>
|
|
31
|
-
<slot
|
|
32
|
-
v-if="options.status.isLoading"
|
|
33
|
-
name="loading"
|
|
34
|
-
>
|
|
35
|
-
<Loader :loading="true" />
|
|
36
|
-
</slot>
|
|
37
|
-
<slot
|
|
38
|
-
v-else-if="options.status.isError"
|
|
39
|
-
name="error"
|
|
40
|
-
>
|
|
41
|
-
<div
|
|
42
|
-
class="text-error-400 flex h-[200px] items-center justify-center text-2xl"
|
|
43
|
-
>
|
|
44
|
-
{{ StringHelper.getError(options.status.errorData) }}
|
|
45
|
-
</div>
|
|
46
|
-
</slot>
|
|
47
|
-
|
|
48
|
-
<slot
|
|
49
|
-
v-else
|
|
50
|
-
name="error"
|
|
51
|
-
>
|
|
52
|
-
<Empty />
|
|
53
|
-
</slot>
|
|
54
|
-
</template>
|
|
55
|
-
<template
|
|
56
|
-
v-for="column in options.columns"
|
|
57
|
-
#[`${column.accessorKey}-cell`]="slotProps"
|
|
58
|
-
:key="column.accessorKey"
|
|
59
|
-
>
|
|
60
|
-
<NuxtLink
|
|
61
|
-
v-if="to && column.accessorKey !== 'actions'"
|
|
62
|
-
:to="resolveTo(slotProps.row.original)"
|
|
63
|
-
:target="resolveTarget(slotProps.row.original)"
|
|
7
|
+
"
|
|
8
|
+
>
|
|
9
|
+
<Pagination
|
|
10
|
+
v-if="!options.isHidePagination && !options.isHidePaginationTop"
|
|
11
|
+
:options="options"
|
|
12
|
+
:ui="ui"
|
|
13
|
+
:page="page"
|
|
14
|
+
:page-limit="pageLimit"
|
|
15
|
+
class="border-b border-[#EAECF0]"
|
|
16
|
+
@pageChange="onPageChange"
|
|
17
|
+
@search="emits('search')"
|
|
18
|
+
@pageLimitChange="changePageLimit"
|
|
19
|
+
/>
|
|
20
|
+
<UTable
|
|
21
|
+
:loading="options.status.isLoading"
|
|
22
|
+
:columns="uTableCompatibleColumns"
|
|
23
|
+
:data="options.rawData"
|
|
24
|
+
v-bind="$attrs"
|
|
25
|
+
:ui="ui"
|
|
26
|
+
>
|
|
27
|
+
<template #loading>
|
|
28
|
+
<Loader :loading="true" />
|
|
29
|
+
</template>
|
|
30
|
+
<template #empty>
|
|
31
|
+
<slot
|
|
32
|
+
v-if="options.status.isLoading"
|
|
33
|
+
name="loading"
|
|
34
|
+
>
|
|
35
|
+
<Loader :loading="true" />
|
|
36
|
+
</slot>
|
|
37
|
+
<slot
|
|
38
|
+
v-else-if="options.status.isError"
|
|
39
|
+
name="error"
|
|
40
|
+
>
|
|
41
|
+
<div
|
|
42
|
+
class="text-error-400 flex h-[200px] items-center justify-center text-2xl"
|
|
43
|
+
>
|
|
44
|
+
{{ StringHelper.getError(options.status.errorData) }}
|
|
45
|
+
</div>
|
|
46
|
+
</slot>
|
|
47
|
+
|
|
48
|
+
<slot
|
|
49
|
+
v-else
|
|
50
|
+
name="error"
|
|
51
|
+
>
|
|
52
|
+
<Empty />
|
|
53
|
+
</slot>
|
|
54
|
+
</template>
|
|
55
|
+
<template
|
|
56
|
+
v-for="column in options.columns"
|
|
57
|
+
#[`${column.accessorKey}-cell`]="slotProps"
|
|
58
|
+
:key="column.accessorKey"
|
|
59
|
+
>
|
|
60
|
+
<NuxtLink
|
|
61
|
+
v-if="to && column.accessorKey !== 'actions'"
|
|
62
|
+
:to="resolveTo(slotProps.row.original)"
|
|
63
|
+
:target="resolveTarget(slotProps.row.original)"
|
|
64
64
|
:rel="
|
|
65
65
|
resolveTarget(slotProps.row.original) === '_blank' ? 'noopener noreferrer' : void 0
|
|
66
|
-
"
|
|
67
|
-
class="absolute inset-0"
|
|
68
|
-
tabindex="-1"
|
|
69
|
-
aria-hidden="true"
|
|
70
|
-
/>
|
|
71
|
-
<div
|
|
66
|
+
"
|
|
67
|
+
class="absolute inset-0"
|
|
68
|
+
tabindex="-1"
|
|
69
|
+
aria-hidden="true"
|
|
70
|
+
/>
|
|
71
|
+
<div
|
|
72
72
|
:class="
|
|
73
73
|
to && column.accessorKey !== 'actions' ? 'pointer-events-none relative z-10' : 'relative z-10'
|
|
74
|
-
"
|
|
75
|
-
>
|
|
76
|
-
<slot
|
|
77
|
-
:name="`${column.accessorKey}-cell`"
|
|
78
|
-
v-bind="slotProps"
|
|
79
|
-
>
|
|
80
|
-
<component
|
|
81
|
-
:is="column.component"
|
|
82
|
-
v-if="column.type === COLUMN_TYPES.COMPONENT && column.component"
|
|
83
|
-
:value="transformValue(column, slotProps.row)"
|
|
84
|
-
:column="column"
|
|
85
|
-
:row="slotProps.row"
|
|
86
|
-
/>
|
|
87
|
-
<component
|
|
88
|
-
:is="columnTypeComponents[column.type]"
|
|
74
|
+
"
|
|
75
|
+
>
|
|
76
|
+
<slot
|
|
77
|
+
:name="`${column.accessorKey}-cell`"
|
|
78
|
+
v-bind="slotProps"
|
|
79
|
+
>
|
|
80
|
+
<component
|
|
81
|
+
:is="column.component"
|
|
82
|
+
v-if="column.type === COLUMN_TYPES.COMPONENT && column.component"
|
|
83
|
+
:value="transformValue(column, slotProps.row)"
|
|
84
|
+
:column="column"
|
|
85
|
+
:row="slotProps.row"
|
|
86
|
+
/>
|
|
87
|
+
<component
|
|
88
|
+
:is="columnTypeComponents[column.type]"
|
|
89
89
|
v-else-if="
|
|
90
90
|
column.type !== COLUMN_TYPES.COMPONENT && columnTypeComponents[column.type]
|
|
91
|
-
"
|
|
92
|
-
:value="transformValue(column, slotProps.row)"
|
|
93
|
-
:column="column"
|
|
94
|
-
:row="slotProps.row"
|
|
95
|
-
/>
|
|
96
|
-
<VNodeRenderer
|
|
97
|
-
v-else-if="typeof column.cell === 'function'"
|
|
98
|
-
:vnode="transformValue(column, slotProps.row)"
|
|
99
|
-
/>
|
|
100
|
-
<template v-else>
|
|
101
|
-
{{ transformValue(column, slotProps.row) }}
|
|
102
|
-
</template>
|
|
103
|
-
</slot>
|
|
104
|
-
</div>
|
|
105
|
-
</template>
|
|
106
|
-
<template
|
|
107
|
-
v-for="slotName in forwardedSlotNames"
|
|
108
|
-
:key="slotName"
|
|
109
|
-
#[slotName]="slotProps"
|
|
110
|
-
>
|
|
111
|
-
<slot
|
|
112
|
-
:name="slotName"
|
|
113
|
-
v-bind="slotProps || {}"
|
|
114
|
-
/>
|
|
115
|
-
</template>
|
|
116
|
-
</UTable>
|
|
117
|
-
<Pagination
|
|
118
|
-
v-if="!options.isHidePagination && !options.isHidePaginationBottom"
|
|
119
|
-
:options="options"
|
|
120
|
-
:ui="ui"
|
|
121
|
-
:page="page"
|
|
122
|
-
:page-limit="pageLimit"
|
|
123
|
-
class="rounded-b-lg border-t border-[#EAECF0]"
|
|
124
|
-
@pageChange="onPageChange"
|
|
125
|
-
@search="emits('search')"
|
|
126
|
-
@pageLimitChange="changePageLimit"
|
|
127
|
-
/>
|
|
128
|
-
</div>
|
|
91
|
+
"
|
|
92
|
+
:value="transformValue(column, slotProps.row)"
|
|
93
|
+
:column="column"
|
|
94
|
+
:row="slotProps.row"
|
|
95
|
+
/>
|
|
96
|
+
<VNodeRenderer
|
|
97
|
+
v-else-if="typeof column.cell === 'function'"
|
|
98
|
+
:vnode="transformValue(column, slotProps.row)"
|
|
99
|
+
/>
|
|
100
|
+
<template v-else>
|
|
101
|
+
{{ transformValue(column, slotProps.row) }}
|
|
102
|
+
</template>
|
|
103
|
+
</slot>
|
|
104
|
+
</div>
|
|
105
|
+
</template>
|
|
106
|
+
<template
|
|
107
|
+
v-for="slotName in forwardedSlotNames"
|
|
108
|
+
:key="slotName"
|
|
109
|
+
#[slotName]="slotProps"
|
|
110
|
+
>
|
|
111
|
+
<slot
|
|
112
|
+
:name="slotName"
|
|
113
|
+
v-bind="slotProps || {}"
|
|
114
|
+
/>
|
|
115
|
+
</template>
|
|
116
|
+
</UTable>
|
|
117
|
+
<Pagination
|
|
118
|
+
v-if="!options.isHidePagination && !options.isHidePaginationBottom"
|
|
119
|
+
:options="options"
|
|
120
|
+
:ui="ui"
|
|
121
|
+
:page="page"
|
|
122
|
+
:page-limit="pageLimit"
|
|
123
|
+
class="rounded-b-lg border-t border-[#EAECF0]"
|
|
124
|
+
@pageChange="onPageChange"
|
|
125
|
+
@search="emits('search')"
|
|
126
|
+
@pageLimitChange="changePageLimit"
|
|
127
|
+
/>
|
|
128
|
+
</div>
|
|
129
129
|
</template>
|
|
130
130
|
|
|
131
131
|
<script setup>
|
|
@@ -146,7 +146,7 @@ import ColumnDateTime from "#core/components/Table/ColumnDateTime.vue";
|
|
|
146
146
|
import Empty from "#core/components/Empty.vue";
|
|
147
147
|
import ColumnDate from "#core/components/Table/ColumnDate.vue";
|
|
148
148
|
import ColumnText from "#core/components/Table/ColumnText.vue";
|
|
149
|
-
import UTable from "#ui/components/Table";
|
|
149
|
+
import UTable from "#ui/components/Table.vue";
|
|
150
150
|
import Pagination from "./Pagination.vue";
|
|
151
151
|
import { tableTheme } from "#core/theme/table";
|
|
152
152
|
const emits = defineEmits(["pageChange", "search"]);
|
|
@@ -7,7 +7,21 @@ type __VLS_Props = {
|
|
|
7
7
|
target?: string | ((row: any) => string | undefined);
|
|
8
8
|
preserveQuery?: boolean;
|
|
9
9
|
};
|
|
10
|
-
declare var __VLS_21: {}, __VLS_28: {}, __VLS_30: {}, __VLS_44: `${string}-cell`, __VLS_45:
|
|
10
|
+
declare var __VLS_21: {}, __VLS_28: {}, __VLS_30: {}, __VLS_44: `${string}-cell`, __VLS_45: {
|
|
11
|
+
cell: import("@tanstack/table-core").Cell<any, unknown>;
|
|
12
|
+
column: import("@tanstack/table-core").Column<any, unknown>;
|
|
13
|
+
getValue: import("@tanstack/table-core").Getter<unknown>;
|
|
14
|
+
renderValue: import("@tanstack/table-core").Getter<unknown>;
|
|
15
|
+
row: import("@tanstack/table-core").Row<any>;
|
|
16
|
+
table: import("@tanstack/table-core").Table<any>;
|
|
17
|
+
}, __VLS_64: string, __VLS_65: {
|
|
18
|
+
cell: import("@tanstack/table-core").Cell<any, unknown>;
|
|
19
|
+
column: import("@tanstack/table-core").Column<any, unknown>;
|
|
20
|
+
getValue: import("@tanstack/table-core").Getter<unknown>;
|
|
21
|
+
renderValue: import("@tanstack/table-core").Getter<unknown>;
|
|
22
|
+
row: import("@tanstack/table-core").Row<any>;
|
|
23
|
+
table: import("@tanstack/table-core").Table<any>;
|
|
24
|
+
};
|
|
11
25
|
type __VLS_Slots = {} & {
|
|
12
26
|
[K in NonNullable<typeof __VLS_44>]?: (props: typeof __VLS_45) => any;
|
|
13
27
|
} & {
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { type ComponentProps } from 'vue';
|
|
2
1
|
import type { TableColumn } from '@nuxt/ui';
|
|
3
|
-
import
|
|
2
|
+
import type { NuxtLinkProps } from '#app';
|
|
4
3
|
type __VLS_Props = {
|
|
5
4
|
value: any;
|
|
6
5
|
row: any;
|
|
7
6
|
column: TableColumn<any> & {
|
|
8
7
|
meta: {
|
|
9
8
|
max: number;
|
|
10
|
-
link?:
|
|
9
|
+
link?: NuxtLinkProps;
|
|
11
10
|
};
|
|
12
11
|
};
|
|
13
12
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<NuxtLink
|
|
3
|
-
v-if="column.meta?.link"
|
|
4
|
-
v-bind="column.meta.link"
|
|
5
|
-
>
|
|
6
|
-
{{ getValue }}
|
|
7
|
-
</NuxtLink>
|
|
8
|
-
|
|
9
|
-
<span v-else>
|
|
10
|
-
{{ getValue }}
|
|
11
|
-
</span>
|
|
2
|
+
<NuxtLink
|
|
3
|
+
v-if="column.meta?.link"
|
|
4
|
+
v-bind="column.meta.link"
|
|
5
|
+
>
|
|
6
|
+
{{ getValue }}
|
|
7
|
+
</NuxtLink>
|
|
8
|
+
|
|
9
|
+
<span v-else>
|
|
10
|
+
{{ getValue }}
|
|
11
|
+
</span>
|
|
12
12
|
</template>
|
|
13
13
|
|
|
14
14
|
<script setup>
|
|
@@ -24,7 +24,7 @@ const getValue = computed(() => {
|
|
|
24
24
|
const value = props.value;
|
|
25
25
|
const max = props.column?.meta?.max;
|
|
26
26
|
if (max) {
|
|
27
|
-
return StringHelper.truncate(value, max);
|
|
27
|
+
return StringHelper.truncate(value, max) || "-";
|
|
28
28
|
}
|
|
29
29
|
if (typeof value === "string") {
|
|
30
30
|
return value || "-";
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { type ComponentProps } from 'vue';
|
|
2
1
|
import type { TableColumn } from '@nuxt/ui';
|
|
3
|
-
import
|
|
2
|
+
import type { NuxtLinkProps } from '#app';
|
|
4
3
|
type __VLS_Props = {
|
|
5
4
|
value: any;
|
|
6
5
|
row: any;
|
|
7
6
|
column: TableColumn<any> & {
|
|
8
7
|
meta: {
|
|
9
8
|
max: number;
|
|
10
|
-
link?:
|
|
9
|
+
link?: NuxtLinkProps;
|
|
11
10
|
};
|
|
12
11
|
};
|
|
13
12
|
};
|
|
@@ -1,101 +1,102 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
3
|
:class="
|
|
4
4
|
theme.paginationContainer({
|
|
5
5
|
class: [ui?.paginationContainer]
|
|
6
6
|
})
|
|
7
|
-
"
|
|
8
|
-
>
|
|
9
|
-
<div
|
|
7
|
+
"
|
|
8
|
+
>
|
|
9
|
+
<div
|
|
10
10
|
:class="
|
|
11
11
|
theme.paginationInfoWrapper({
|
|
12
12
|
class: [ui?.paginationInfoWrapper]
|
|
13
13
|
})
|
|
14
|
-
"
|
|
15
|
-
>
|
|
16
|
-
<USelect
|
|
17
|
-
v-if="options.pageOptions && !options.isHideLimitSelect"
|
|
18
|
-
size="lg"
|
|
19
|
-
trailing
|
|
14
|
+
"
|
|
15
|
+
>
|
|
16
|
+
<USelect
|
|
17
|
+
v-if="options.pageOptions && !options.isHideLimitSelect"
|
|
18
|
+
size="lg"
|
|
19
|
+
trailing
|
|
20
20
|
:class="
|
|
21
21
|
theme.paginationLimitSelect({
|
|
22
22
|
class: [ui?.paginationLimitSelect, 'cursor-pointer']
|
|
23
23
|
})
|
|
24
|
-
"
|
|
25
|
-
:items="pageLimitItems"
|
|
26
|
-
:model-value="pageLimit"
|
|
27
|
-
@update:modelValue="emits('pageLimitChange', $event)"
|
|
28
|
-
>
|
|
29
|
-
<template #default="{ modelValue }">
|
|
30
|
-
<p
|
|
24
|
+
"
|
|
25
|
+
:items="pageLimitItems"
|
|
26
|
+
:model-value="pageLimit"
|
|
27
|
+
@update:modelValue="emits('pageLimitChange', $event)"
|
|
28
|
+
>
|
|
29
|
+
<template #default="{ modelValue }">
|
|
30
|
+
<p
|
|
31
31
|
:class="
|
|
32
32
|
theme.paginationLimitSelectLabel({
|
|
33
33
|
class: [ui?.paginationLimitSelectLabel]
|
|
34
34
|
})
|
|
35
|
-
"
|
|
36
|
-
>
|
|
37
|
-
{{ modelValue }}
|
|
38
|
-
{{
|
|
39
|
-
</p>
|
|
40
|
-
</template>
|
|
41
|
-
</USelect>
|
|
42
|
-
<p
|
|
35
|
+
"
|
|
36
|
+
>
|
|
37
|
+
{{ modelValue }}
|
|
38
|
+
{{ messages.pagination.items }}
|
|
39
|
+
</p>
|
|
40
|
+
</template>
|
|
41
|
+
</USelect>
|
|
42
|
+
<p
|
|
43
43
|
:class="
|
|
44
44
|
theme.paginationInfo({
|
|
45
45
|
class: [ui?.paginationInfo, '']
|
|
46
46
|
})
|
|
47
|
-
"
|
|
48
|
-
>
|
|
49
|
-
<span v-if="options.pageOptions">{{ pageBetween }}
|
|
50
|
-
{{
|
|
51
|
-
{{ totalCountWithComma }}</span>
|
|
52
|
-
<span v-else>{{
|
|
53
|
-
{{ options.rawData.length }}
|
|
54
|
-
{{
|
|
55
|
-
</p>
|
|
56
|
-
</div>
|
|
57
|
-
<UPagination
|
|
58
|
-
v-if="options.pageOptions && options.pageOptions.totalPage > 1"
|
|
59
|
-
:page="page"
|
|
60
|
-
:default-page="options.pageOptions?.currentPage || 1"
|
|
61
|
-
:items-per-page="options.pageOptions.limit"
|
|
62
|
-
:total="options.pageOptions.totalCount"
|
|
63
|
-
:to="options.isRouteChange ? to : void 0"
|
|
64
|
-
show-edges
|
|
65
|
-
variant="outline"
|
|
66
|
-
color="neutral"
|
|
67
|
-
active-color="neutral"
|
|
68
|
-
active-variant="subtle"
|
|
69
|
-
@update:page="emits('pageChange', $event)"
|
|
70
|
-
>
|
|
71
|
-
<template #item="{ item, page }">
|
|
72
|
-
<Button
|
|
73
|
-
|
|
74
|
-
:
|
|
75
|
-
:
|
|
76
|
-
:
|
|
77
|
-
|
|
78
|
-
|
|
47
|
+
"
|
|
48
|
+
>
|
|
49
|
+
<span v-if="options.pageOptions">{{ pageBetween }}
|
|
50
|
+
{{ messages.pagination.ofTotal }}
|
|
51
|
+
{{ totalCountWithComma }}</span>
|
|
52
|
+
<span v-else>{{ messages.pagination.total }}
|
|
53
|
+
{{ options.rawData.length }}
|
|
54
|
+
{{ messages.pagination.items }}</span>
|
|
55
|
+
</p>
|
|
56
|
+
</div>
|
|
57
|
+
<UPagination
|
|
58
|
+
v-if="options.pageOptions && options.pageOptions.totalPage > 1"
|
|
59
|
+
:page="page"
|
|
60
|
+
:default-page="options.pageOptions?.currentPage || 1"
|
|
61
|
+
:items-per-page="options.pageOptions.limit"
|
|
62
|
+
:total="options.pageOptions.totalCount"
|
|
63
|
+
:to="options.isRouteChange ? to : void 0"
|
|
64
|
+
show-edges
|
|
65
|
+
variant="outline"
|
|
66
|
+
color="neutral"
|
|
67
|
+
active-color="neutral"
|
|
68
|
+
active-variant="subtle"
|
|
69
|
+
@update:page="emits('pageChange', $event)"
|
|
70
|
+
>
|
|
71
|
+
<template #item="{ item, page }">
|
|
72
|
+
<Button
|
|
73
|
+
v-if="item.type === 'page'"
|
|
74
|
+
:variant="page === item.value ? 'subtle' : 'outline'"
|
|
75
|
+
:color="page === item.value ? 'neutral' : 'neutral'"
|
|
76
|
+
:label="String(NumberHelper.withComma(item.value))"
|
|
77
|
+
:ui="{ label: themePagination.label }"
|
|
78
|
+
square
|
|
79
|
+
:to="options.isRouteChange ? to?.(item.value) : void 0"
|
|
79
80
|
:class="
|
|
80
81
|
theme.buttonPagination({
|
|
81
82
|
class: [ui?.buttonPagination]
|
|
82
83
|
})
|
|
83
|
-
"
|
|
84
|
-
/>
|
|
85
|
-
</template>
|
|
86
|
-
</UPagination>
|
|
87
|
-
</div>
|
|
84
|
+
"
|
|
85
|
+
/>
|
|
86
|
+
</template>
|
|
87
|
+
</UPagination>
|
|
88
|
+
</div>
|
|
88
89
|
</template>
|
|
89
90
|
|
|
90
91
|
<script setup>
|
|
92
|
+
import { useCoreMessages } from "#core/composables/useMessages";
|
|
91
93
|
import {
|
|
92
94
|
computed,
|
|
93
95
|
NumberHelper,
|
|
94
|
-
useUiConfig
|
|
95
|
-
useAppConfig
|
|
96
|
+
useUiConfig
|
|
96
97
|
} from "#imports";
|
|
97
|
-
import UPagination from "#ui/components/Pagination";
|
|
98
|
-
import USelect from "#ui/components/Select";
|
|
98
|
+
import UPagination from "#ui/components/Pagination.vue";
|
|
99
|
+
import USelect from "#ui/components/Select.vue";
|
|
99
100
|
import { tableTheme } from "../../theme/table";
|
|
100
101
|
import { paginationTheme } from "../../theme/pagination";
|
|
101
102
|
const emits = defineEmits(["pageChange", "search", "pageLimitChange"]);
|
|
@@ -108,7 +109,6 @@ const props = defineProps({
|
|
|
108
109
|
const themePagination = computed(
|
|
109
110
|
() => useUiConfig(paginationTheme, "pagination")()
|
|
110
111
|
);
|
|
111
|
-
const appConfig = useAppConfig();
|
|
112
112
|
const pageLimitItems = [
|
|
113
113
|
{
|
|
114
114
|
label: "10",
|
|
@@ -164,4 +164,7 @@ const to = (page) => {
|
|
|
164
164
|
}
|
|
165
165
|
};
|
|
166
166
|
};
|
|
167
|
+
const {
|
|
168
|
+
messages
|
|
169
|
+
} = useCoreMessages();
|
|
167
170
|
</script>
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Base
|
|
3
|
-
v-bind="$attrs"
|
|
2
|
+
<Base
|
|
3
|
+
v-bind="$attrs"
|
|
4
4
|
:options="{
|
|
5
5
|
...options,
|
|
6
6
|
pageOptions,
|
|
7
7
|
isHideLimitSelect: true,
|
|
8
8
|
rawData: itemsByPage
|
|
9
|
-
}"
|
|
10
|
-
:ui="computedUi"
|
|
11
|
-
:to="to"
|
|
12
|
-
:target="target"
|
|
13
|
-
:preserve-query="preserveQuery"
|
|
14
|
-
@page-change="onPageChange"
|
|
15
|
-
>
|
|
16
|
-
<template
|
|
17
|
-
v-for="(_, slot) of $slots"
|
|
18
|
-
#[slot]="slotProps"
|
|
19
|
-
>
|
|
20
|
-
<slot
|
|
21
|
-
:name="slot"
|
|
22
|
-
v-bind="slotProps || {}"
|
|
23
|
-
/>
|
|
24
|
-
</template>
|
|
25
|
-
</Base>
|
|
9
|
+
}"
|
|
10
|
+
:ui="computedUi"
|
|
11
|
+
:to="to"
|
|
12
|
+
:target="target"
|
|
13
|
+
:preserve-query="preserveQuery"
|
|
14
|
+
@page-change="onPageChange"
|
|
15
|
+
>
|
|
16
|
+
<template
|
|
17
|
+
v-for="(_, slot) of $slots"
|
|
18
|
+
#[slot]="slotProps"
|
|
19
|
+
>
|
|
20
|
+
<slot
|
|
21
|
+
:name="slot"
|
|
22
|
+
v-bind="slotProps || {}"
|
|
23
|
+
/>
|
|
24
|
+
</template>
|
|
25
|
+
</Base>
|
|
26
26
|
</template>
|
|
27
27
|
|
|
28
28
|
<script setup>
|
|
@@ -32,11 +32,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
32
32
|
right: string[];
|
|
33
33
|
}) => any) | undefined;
|
|
34
34
|
}>, {
|
|
35
|
-
isPinAction: boolean;
|
|
36
35
|
columnPinning: {
|
|
37
36
|
left: string[];
|
|
38
37
|
right: string[];
|
|
39
38
|
};
|
|
39
|
+
isPinAction: boolean;
|
|
40
40
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
41
41
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
42
42
|
declare const _default: typeof __VLS_export;
|