@finema/core 3.23.2 → 3.24.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 +22 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +3 -14
- package/dist/runtime/components/DevToolsWindow/index.vue +24 -26
- package/dist/runtime/components/Dialog/index.vue +11 -10
- package/dist/runtime/components/Empty.d.vue.ts +1 -1
- package/dist/runtime/components/Empty.vue +16 -12
- package/dist/runtime/components/Empty.vue.d.ts +1 -1
- package/dist/runtime/components/FlexDeck/index.vue +85 -92
- package/dist/runtime/components/Form/FieldWrapper.vue +13 -13
- package/dist/runtime/components/Form/Fields.d.vue.ts +1 -1
- package/dist/runtime/components/Form/Fields.vue +17 -11
- package/dist/runtime/components/Form/Fields.vue.d.ts +1 -1
- package/dist/runtime/components/Form/InputCheckbox/index.vue +19 -23
- package/dist/runtime/components/Form/InputCheckboxGroup/index.vue +1 -5
- package/dist/runtime/components/Form/InputCurrency/index.vue +56 -57
- package/dist/runtime/components/Form/InputDateTime/date_time_field.types.d.ts +2 -0
- package/dist/runtime/components/Form/InputDateTime/index.vue +70 -80
- package/dist/runtime/components/Form/InputDateTimeRange/index.vue +78 -75
- package/dist/runtime/components/Form/InputMonth/index.vue +7 -10
- package/dist/runtime/components/Form/InputNumber/index.vue +21 -25
- package/dist/runtime/components/Form/InputRadio/index.d.vue.ts +1 -1
- package/dist/runtime/components/Form/InputRadio/index.vue +1 -5
- package/dist/runtime/components/Form/InputRadio/index.vue.d.ts +1 -1
- package/dist/runtime/components/Form/InputRating/index.vue +1 -5
- package/dist/runtime/components/Form/InputSearch/index.vue +2 -8
- package/dist/runtime/components/Form/InputSelect/index.vue +112 -122
- package/dist/runtime/components/Form/InputSelectMultiple/index.vue +121 -133
- package/dist/runtime/components/Form/InputTags/index.vue +55 -59
- package/dist/runtime/components/Form/InputText/index.vue +122 -133
- package/dist/runtime/components/Form/InputTextarea/index.vue +19 -23
- package/dist/runtime/components/Form/InputTime/index.vue +63 -63
- package/dist/runtime/components/Form/InputToggle/index.vue +18 -21
- package/dist/runtime/components/Form/InputUploadDropzone/index.vue +46 -49
- package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.vue +57 -63
- package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/index.vue +57 -64
- package/dist/runtime/components/Form/InputUploadImageAuto/index.vue +57 -63
- package/dist/runtime/components/Form/InputWYSIWYG/EditorImagePasteExtension.js +7 -6
- package/dist/runtime/components/Form/InputWYSIWYG/EditorImageUploadExtension.js +13 -12
- package/dist/runtime/components/Form/InputWYSIWYG/EditorImageUploadNode.vue +21 -19
- package/dist/runtime/components/Form/InputWYSIWYG/EditorLinkPopover.vue +85 -87
- package/dist/runtime/components/Form/InputWYSIWYG/README.md +96 -96
- package/dist/runtime/components/Form/InputWYSIWYG/index.vue +178 -157
- package/dist/runtime/components/Form/fileState/EmptyState.vue +21 -21
- package/dist/runtime/components/Form/fileState/FailedState.vue +34 -36
- package/dist/runtime/components/Form/fileState/LoadingState.vue +24 -24
- package/dist/runtime/components/Form/fileState/MultipleFilesState.vue +74 -78
- package/dist/runtime/components/Form/fileState/PreviewModal.vue +23 -23
- package/dist/runtime/components/Form/fileState/SuccessState.vue +3 -12
- package/dist/runtime/components/Form/fileState/useFileState.js +2 -10
- package/dist/runtime/components/Form/fileState/useUploadImageState.js +1 -3
- package/dist/runtime/components/Form/fileState/useUploadState.js +8 -19
- package/dist/runtime/components/Form/fileState/useUploadStateMultiple.js +25 -30
- package/dist/runtime/components/Form/index.vue +5 -5
- package/dist/runtime/components/Image.vue +22 -28
- package/dist/runtime/components/Loader.d.vue.ts +1 -1
- package/dist/runtime/components/Loader.vue +10 -7
- package/dist/runtime/components/Loader.vue.d.ts +1 -1
- package/dist/runtime/components/Log/LogItem.vue +1 -3
- package/dist/runtime/components/Log/index.vue +1 -3
- package/dist/runtime/components/Table/Base.vue +117 -137
- 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.vue +10 -10
- package/dist/runtime/components/Table/Pagination.vue +71 -77
- package/dist/runtime/components/Table/Simple.vue +19 -19
- package/dist/runtime/components/Table/index.vue +36 -42
- package/dist/runtime/composables/loaderList.js +1 -3
- package/dist/runtime/composables/loaderPage.js +156 -133
- package/dist/runtime/composables/useConfig.js +1 -1
- package/dist/runtime/composables/useDialog.js +1 -3
- package/dist/runtime/composables/useForm.d.ts +1 -1
- package/dist/runtime/composables/useForm.js +1 -3
- package/dist/runtime/composables/useTable.js +2 -14
- package/dist/runtime/helpers/apiBaseHelper.js +6 -24
- package/dist/runtime/helpers/apiListHelper.js +2 -5
- package/dist/runtime/helpers/apiObjectHelper.js +2 -5
- package/dist/runtime/helpers/apiPageHelper.js +19 -38
- package/dist/runtime/helpers/componentHelper.js +2 -6
- package/dist/runtime/helpers/uploadCore.js +1 -4
- package/dist/runtime/locale/index.js +1 -4
- package/dist/runtime/server/tsconfig.json +3 -3
- package/dist/runtime/styles/main.css +1 -1
- package/package.json +39 -26
|
@@ -1,131 +1,121 @@
|
|
|
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
|
-
|
|
43
|
-
>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
>
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
:
|
|
84
|
-
:
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
:
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
</template>
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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>
|
|
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 class="flex h-[200px] items-center justify-center text-2xl text-error-400">
|
|
42
|
+
{{ StringHelper.getError(options.status.errorData) }}
|
|
43
|
+
</div>
|
|
44
|
+
</slot>
|
|
45
|
+
|
|
46
|
+
<slot
|
|
47
|
+
v-else
|
|
48
|
+
name="error"
|
|
49
|
+
>
|
|
50
|
+
<Empty />
|
|
51
|
+
</slot>
|
|
52
|
+
</template>
|
|
53
|
+
<template
|
|
54
|
+
v-for="column in options.columns"
|
|
55
|
+
#[`${column.accessorKey}-cell`]="slotProps"
|
|
56
|
+
:key="column.accessorKey"
|
|
57
|
+
>
|
|
58
|
+
<NuxtLink
|
|
59
|
+
v-if="to && column.accessorKey !== 'actions'"
|
|
60
|
+
:to="resolveTo(slotProps.row.original)"
|
|
61
|
+
:target="resolveTarget(slotProps.row.original)"
|
|
62
|
+
:rel="resolveTarget(slotProps.row.original) === '_blank' ? 'noopener noreferrer' : void 0"
|
|
63
|
+
class="absolute inset-0"
|
|
64
|
+
tabindex="-1"
|
|
65
|
+
aria-hidden="true"
|
|
66
|
+
/>
|
|
67
|
+
<div :class="to && column.accessorKey !== 'actions' ? 'pointer-events-none relative z-10' : 'relative z-10'">
|
|
68
|
+
<slot
|
|
69
|
+
:name="`${column.accessorKey}-cell`"
|
|
70
|
+
v-bind="slotProps"
|
|
71
|
+
>
|
|
72
|
+
<component
|
|
73
|
+
:is="column.component"
|
|
74
|
+
v-if="column.type === COLUMN_TYPES.COMPONENT && column.component"
|
|
75
|
+
:value="transformValue(column, slotProps.row)"
|
|
76
|
+
:column="column"
|
|
77
|
+
:row="slotProps.row"
|
|
78
|
+
/>
|
|
79
|
+
<component
|
|
80
|
+
:is="columnTypeComponents[column.type]"
|
|
81
|
+
v-else-if="column.type !== COLUMN_TYPES.COMPONENT && columnTypeComponents[column.type]"
|
|
82
|
+
:value="transformValue(column, slotProps.row)"
|
|
83
|
+
:column="column"
|
|
84
|
+
:row="slotProps.row"
|
|
85
|
+
/>
|
|
86
|
+
<VNodeRenderer
|
|
87
|
+
v-else-if="typeof column.cell === 'function'"
|
|
88
|
+
:vnode="transformValue(column, slotProps.row)"
|
|
89
|
+
/>
|
|
90
|
+
<template v-else>
|
|
91
|
+
{{ transformValue(column, slotProps.row) }}
|
|
92
|
+
</template>
|
|
93
|
+
</slot>
|
|
94
|
+
</div>
|
|
95
|
+
</template>
|
|
96
|
+
<template
|
|
97
|
+
v-for="slotName in forwardedSlotNames"
|
|
98
|
+
:key="slotName"
|
|
99
|
+
#[slotName]="slotProps"
|
|
100
|
+
>
|
|
101
|
+
<slot
|
|
102
|
+
:name="slotName"
|
|
103
|
+
v-bind="slotProps || {}"
|
|
104
|
+
/>
|
|
105
|
+
</template>
|
|
106
|
+
</UTable>
|
|
107
|
+
<Pagination
|
|
108
|
+
v-if="!options.isHidePagination && !options.isHidePaginationBottom"
|
|
109
|
+
:options="options"
|
|
110
|
+
:ui="ui"
|
|
111
|
+
:page="page"
|
|
112
|
+
:page-limit="pageLimit"
|
|
113
|
+
class="rounded-b-lg border-t border-[#EAECF0]"
|
|
114
|
+
@pageChange="onPageChange"
|
|
115
|
+
@search="emits('search')"
|
|
116
|
+
@pageLimitChange="changePageLimit"
|
|
117
|
+
/>
|
|
118
|
+
</div>
|
|
129
119
|
</template>
|
|
130
120
|
|
|
131
121
|
<script setup>
|
|
@@ -135,13 +125,7 @@ import {
|
|
|
135
125
|
} from "#core/components/Table/types";
|
|
136
126
|
import ColumnNumber from "#core/components/Table/ColumnNumber.vue";
|
|
137
127
|
import ColumnImage from "#core/components/Table/ColumnImage.vue";
|
|
138
|
-
import {
|
|
139
|
-
useAppConfig,
|
|
140
|
-
useRoute,
|
|
141
|
-
useUiConfig,
|
|
142
|
-
useWatchChange,
|
|
143
|
-
StringHelper
|
|
144
|
-
} from "#imports";
|
|
128
|
+
import { useAppConfig, useRoute, useUiConfig, useWatchChange, StringHelper } from "#imports";
|
|
145
129
|
import ColumnDateTime from "#core/components/Table/ColumnDateTime.vue";
|
|
146
130
|
import Empty from "#core/components/Empty.vue";
|
|
147
131
|
import ColumnDate from "#core/components/Table/ColumnDate.vue";
|
|
@@ -170,9 +154,7 @@ const VNodeRenderer = defineComponent({
|
|
|
170
154
|
});
|
|
171
155
|
const route = useRoute();
|
|
172
156
|
const slots = useSlots();
|
|
173
|
-
const forwardedSlotNames = computed(
|
|
174
|
-
() => Object.keys(slots).filter((name) => !name.endsWith("-cell"))
|
|
175
|
-
);
|
|
157
|
+
const forwardedSlotNames = computed(() => Object.keys(slots).filter((name) => !name.endsWith("-cell")));
|
|
176
158
|
const columnTypeComponents = {
|
|
177
159
|
[COLUMN_TYPES.NUMBER]: ColumnNumber,
|
|
178
160
|
[COLUMN_TYPES.IMAGE]: ColumnImage,
|
|
@@ -183,9 +165,7 @@ const columnTypeComponents = {
|
|
|
183
165
|
const theme = computed(() => useUiConfig(tableTheme, "table")());
|
|
184
166
|
const config = useAppConfig();
|
|
185
167
|
const page = ref(props.options.pageOptions?.currentPage || 1);
|
|
186
|
-
const pageLimit = ref(
|
|
187
|
-
props.options.pageOptions?.limit || config.core.limit_per_page
|
|
188
|
-
);
|
|
168
|
+
const pageLimit = ref(props.options.pageOptions?.limit || config.core.limit_per_page);
|
|
189
169
|
const uTableCompatibleColumns = computed(
|
|
190
170
|
() => props.options.columns.map((col) => ({
|
|
191
171
|
...col,
|
|
@@ -216,7 +196,7 @@ const resolveTo = (rowOriginal) => {
|
|
|
216
196
|
...resolved,
|
|
217
197
|
query: {
|
|
218
198
|
...route.query,
|
|
219
|
-
...resolved.query
|
|
199
|
+
...resolved.query
|
|
220
200
|
}
|
|
221
201
|
};
|
|
222
202
|
};
|
|
@@ -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>
|
|
@@ -1,100 +1,100 @@
|
|
|
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
|
-
{{ messages.pagination.items }}
|
|
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">
|
|
50
|
-
{{
|
|
51
|
-
{{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
:
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
:
|
|
47
|
+
"
|
|
48
|
+
>
|
|
49
|
+
<span v-if="options.pageOptions">
|
|
50
|
+
{{ pageBetween }}
|
|
51
|
+
{{ messages.pagination.ofTotal }}
|
|
52
|
+
{{ totalCountWithComma }}
|
|
53
|
+
</span>
|
|
54
|
+
<span v-else>
|
|
55
|
+
{{ messages.pagination.total }}
|
|
56
|
+
{{ options.rawData.length }}
|
|
57
|
+
{{ messages.pagination.items }}
|
|
58
|
+
</span>
|
|
59
|
+
</p>
|
|
60
|
+
</div>
|
|
61
|
+
<UPagination
|
|
62
|
+
v-if="options.pageOptions && options.pageOptions.totalPage > 1"
|
|
63
|
+
:page="page"
|
|
64
|
+
:default-page="options.pageOptions?.currentPage || 1"
|
|
65
|
+
:items-per-page="options.pageOptions.limit"
|
|
66
|
+
:total="options.pageOptions.totalCount"
|
|
67
|
+
:to="options.isRouteChange ? to : void 0"
|
|
68
|
+
show-edges
|
|
69
|
+
variant="outline"
|
|
70
|
+
color="neutral"
|
|
71
|
+
active-color="neutral"
|
|
72
|
+
active-variant="subtle"
|
|
73
|
+
@update:page="emits('pageChange', $event)"
|
|
74
|
+
>
|
|
75
|
+
<template #item="{ item, page }">
|
|
76
|
+
<Button
|
|
77
|
+
v-if="item.type === 'page'"
|
|
78
|
+
:variant="page === item.value ? 'subtle' : 'outline'"
|
|
79
|
+
:color="page === item.value ? 'neutral' : 'neutral'"
|
|
80
|
+
:label="String(NumberHelper.withComma(item.value))"
|
|
81
|
+
:ui="{ label: themePagination.label }"
|
|
82
|
+
square
|
|
83
|
+
:to="options.isRouteChange ? to?.(item.value) : void 0"
|
|
80
84
|
:class="
|
|
81
85
|
theme.buttonPagination({
|
|
82
86
|
class: [ui?.buttonPagination]
|
|
83
87
|
})
|
|
84
|
-
"
|
|
85
|
-
/>
|
|
86
|
-
</template>
|
|
87
|
-
</UPagination>
|
|
88
|
-
</div>
|
|
88
|
+
"
|
|
89
|
+
/>
|
|
90
|
+
</template>
|
|
91
|
+
</UPagination>
|
|
92
|
+
</div>
|
|
89
93
|
</template>
|
|
90
94
|
|
|
91
95
|
<script setup>
|
|
92
96
|
import { useCoreMessages } from "#core/composables/useMessages";
|
|
93
|
-
import {
|
|
94
|
-
computed,
|
|
95
|
-
NumberHelper,
|
|
96
|
-
useUiConfig
|
|
97
|
-
} from "#imports";
|
|
97
|
+
import { computed, NumberHelper, useUiConfig } from "#imports";
|
|
98
98
|
import UPagination from "#ui/components/Pagination.vue";
|
|
99
99
|
import USelect from "#ui/components/Select.vue";
|
|
100
100
|
import { tableTheme } from "../../theme/table";
|
|
@@ -106,9 +106,7 @@ const props = defineProps({
|
|
|
106
106
|
options: { type: Object, required: true },
|
|
107
107
|
ui: { type: null, required: false }
|
|
108
108
|
});
|
|
109
|
-
const themePagination = computed(
|
|
110
|
-
() => useUiConfig(paginationTheme, "pagination")()
|
|
111
|
-
);
|
|
109
|
+
const themePagination = computed(() => useUiConfig(paginationTheme, "pagination")());
|
|
112
110
|
const pageLimitItems = [
|
|
113
111
|
{
|
|
114
112
|
label: "10",
|
|
@@ -153,9 +151,7 @@ const totalCountWithComma = computed(() => {
|
|
|
153
151
|
const to = (page) => {
|
|
154
152
|
const params = props.options.pageOptions?.request?.params || {};
|
|
155
153
|
const cleanParams = Object.fromEntries(
|
|
156
|
-
Object.entries(params).filter(
|
|
157
|
-
([key, value]) => value !== null && value !== void 0 && value !== ""
|
|
158
|
-
)
|
|
154
|
+
Object.entries(params).filter(([key, value]) => value !== null && value !== void 0 && value !== "")
|
|
159
155
|
);
|
|
160
156
|
return {
|
|
161
157
|
query: {
|
|
@@ -164,7 +160,5 @@ const to = (page) => {
|
|
|
164
160
|
}
|
|
165
161
|
};
|
|
166
162
|
};
|
|
167
|
-
const {
|
|
168
|
-
messages
|
|
169
|
-
} = useCoreMessages();
|
|
163
|
+
const { messages } = useCoreMessages();
|
|
170
164
|
</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>
|