@finema/core 2.18.1 → 2.18.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.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,98 +1,98 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div ref="tableContainer">
|
|
3
|
-
<div
|
|
4
|
-
v-if="options.isEnabledSearch"
|
|
2
|
+
<div ref="tableContainer">
|
|
3
|
+
<div
|
|
4
|
+
v-if="options.isEnabledSearch"
|
|
5
5
|
:class="theme.searchContainer({
|
|
6
6
|
class: [ui?.searchContainer]
|
|
7
|
-
})"
|
|
8
|
-
>
|
|
9
|
-
<Input
|
|
10
|
-
v-model="q"
|
|
11
|
-
icon="i-heroicons-magnifying-glass"
|
|
12
|
-
:placeholder="options.searchPlaceholder || '\u0E04\u0E49\u0E19\u0E2B\u0E32....'"
|
|
13
|
-
/>
|
|
14
|
-
</div>
|
|
15
|
-
<UTable
|
|
16
|
-
v-bind="$attrs"
|
|
17
|
-
:loading="options.status.isLoading"
|
|
18
|
-
:data="options.rawData"
|
|
19
|
-
:columns="options.columns"
|
|
20
|
-
>
|
|
21
|
-
<template #empty>
|
|
22
|
-
<slot
|
|
23
|
-
v-if="options.status.isLoading"
|
|
24
|
-
name="loading"
|
|
25
|
-
>
|
|
26
|
-
<Loader
|
|
27
|
-
:loading="true"
|
|
28
|
-
/>
|
|
29
|
-
</slot>
|
|
30
|
-
<slot
|
|
31
|
-
v-else-if="options.status.isError"
|
|
32
|
-
name="error"
|
|
33
|
-
>
|
|
34
|
-
<div
|
|
35
|
-
class="flex h-[200px] items-center justify-center text-2xl text-error-400"
|
|
36
|
-
>
|
|
37
|
-
{{ StringHelper.getError(options.status.errorData) }}
|
|
38
|
-
</div>
|
|
39
|
-
</slot>
|
|
40
|
-
|
|
41
|
-
<slot
|
|
42
|
-
v-else
|
|
43
|
-
name="error"
|
|
44
|
-
>
|
|
45
|
-
<Empty />
|
|
46
|
-
</slot>
|
|
47
|
-
</template>
|
|
48
|
-
<template
|
|
49
|
-
v-for="column in options.columns.filter((item) => !!item.type)"
|
|
50
|
-
#[`${column.accessorKey}-cell`]="{ row }"
|
|
51
|
-
:key="column.accessorKey"
|
|
52
|
-
>
|
|
53
|
-
<component
|
|
54
|
-
:is="column.type === COLUMN_TYPES.COMPONENT ? column.component : columnTypeComponents[column.type]"
|
|
55
|
-
v-if="column.type === COLUMN_TYPES.COMPONENT || columnTypeComponents[column.type]"
|
|
56
|
-
:value="transformValue(column, row)"
|
|
57
|
-
:column="column"
|
|
58
|
-
:row="row"
|
|
59
|
-
/>
|
|
60
|
-
</template>
|
|
61
|
-
<template
|
|
62
|
-
v-for="(_, slotName) of $slots"
|
|
63
|
-
#[slotName]="slotProps"
|
|
64
|
-
>
|
|
65
|
-
<slot
|
|
66
|
-
:name="slotName"
|
|
67
|
-
v-bind="slotProps || {}"
|
|
68
|
-
/>
|
|
69
|
-
</template>
|
|
70
|
-
</UTable>
|
|
71
|
-
|
|
72
|
-
<div
|
|
73
|
-
v-if="!options.isHidePagination"
|
|
7
|
+
})"
|
|
8
|
+
>
|
|
9
|
+
<Input
|
|
10
|
+
v-model="q"
|
|
11
|
+
icon="i-heroicons-magnifying-glass"
|
|
12
|
+
:placeholder="options.searchPlaceholder || '\u0E04\u0E49\u0E19\u0E2B\u0E32....'"
|
|
13
|
+
/>
|
|
14
|
+
</div>
|
|
15
|
+
<UTable
|
|
16
|
+
v-bind="$attrs"
|
|
17
|
+
:loading="options.status.isLoading"
|
|
18
|
+
:data="options.rawData"
|
|
19
|
+
:columns="options.columns"
|
|
20
|
+
>
|
|
21
|
+
<template #empty>
|
|
22
|
+
<slot
|
|
23
|
+
v-if="options.status.isLoading"
|
|
24
|
+
name="loading"
|
|
25
|
+
>
|
|
26
|
+
<Loader
|
|
27
|
+
:loading="true"
|
|
28
|
+
/>
|
|
29
|
+
</slot>
|
|
30
|
+
<slot
|
|
31
|
+
v-else-if="options.status.isError"
|
|
32
|
+
name="error"
|
|
33
|
+
>
|
|
34
|
+
<div
|
|
35
|
+
class="flex h-[200px] items-center justify-center text-2xl text-error-400"
|
|
36
|
+
>
|
|
37
|
+
{{ StringHelper.getError(options.status.errorData) }}
|
|
38
|
+
</div>
|
|
39
|
+
</slot>
|
|
40
|
+
|
|
41
|
+
<slot
|
|
42
|
+
v-else
|
|
43
|
+
name="error"
|
|
44
|
+
>
|
|
45
|
+
<Empty />
|
|
46
|
+
</slot>
|
|
47
|
+
</template>
|
|
48
|
+
<template
|
|
49
|
+
v-for="column in options.columns.filter((item) => !!item.type)"
|
|
50
|
+
#[`${column.accessorKey}-cell`]="{ row }"
|
|
51
|
+
:key="column.accessorKey"
|
|
52
|
+
>
|
|
53
|
+
<component
|
|
54
|
+
:is="column.type === COLUMN_TYPES.COMPONENT ? column.component : columnTypeComponents[column.type]"
|
|
55
|
+
v-if="column.type === COLUMN_TYPES.COMPONENT || columnTypeComponents[column.type]"
|
|
56
|
+
:value="transformValue(column, row)"
|
|
57
|
+
:column="column"
|
|
58
|
+
:row="row"
|
|
59
|
+
/>
|
|
60
|
+
</template>
|
|
61
|
+
<template
|
|
62
|
+
v-for="(_, slotName) of $slots"
|
|
63
|
+
#[slotName]="slotProps"
|
|
64
|
+
>
|
|
65
|
+
<slot
|
|
66
|
+
:name="slotName"
|
|
67
|
+
v-bind="slotProps || {}"
|
|
68
|
+
/>
|
|
69
|
+
</template>
|
|
70
|
+
</UTable>
|
|
71
|
+
|
|
72
|
+
<div
|
|
73
|
+
v-if="!options.isHidePagination"
|
|
74
74
|
:class="theme.paginationContainer({
|
|
75
75
|
class: [ui?.paginationContainer]
|
|
76
|
-
})"
|
|
77
|
-
>
|
|
78
|
-
<p
|
|
76
|
+
})"
|
|
77
|
+
>
|
|
78
|
+
<p
|
|
79
79
|
:class="theme.paginationInfo({
|
|
80
80
|
class: [ui?.paginationInfo]
|
|
81
|
-
})"
|
|
82
|
-
>
|
|
83
|
-
{{ pageBetween }} รายการ จากทั้งหมด {{ totalCountWithComma }} รายการ
|
|
84
|
-
</p>
|
|
85
|
-
<Pagination
|
|
86
|
-
v-if="options.pageOptions.totalPage > 1"
|
|
87
|
-
v-model:page="page"
|
|
88
|
-
:default-page="options.pageOptions?.currentPage || 1"
|
|
89
|
-
:items-per-page="options.pageOptions.limit"
|
|
90
|
-
:total="options.pageOptions.totalCount"
|
|
91
|
-
:to="options.isPreventRouteChange ? void 0 : to"
|
|
92
|
-
@update:page="onPageChange"
|
|
93
|
-
/>
|
|
94
|
-
</div>
|
|
95
|
-
</div>
|
|
81
|
+
})"
|
|
82
|
+
>
|
|
83
|
+
{{ pageBetween }} รายการ จากทั้งหมด {{ totalCountWithComma }} รายการ
|
|
84
|
+
</p>
|
|
85
|
+
<Pagination
|
|
86
|
+
v-if="options.pageOptions.totalPage > 1"
|
|
87
|
+
v-model:page="page"
|
|
88
|
+
:default-page="options.pageOptions?.currentPage || 1"
|
|
89
|
+
:items-per-page="options.pageOptions.limit"
|
|
90
|
+
:total="options.pageOptions.totalCount"
|
|
91
|
+
:to="options.isPreventRouteChange ? void 0 : to"
|
|
92
|
+
@update:page="onPageChange"
|
|
93
|
+
/>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
96
|
</template>
|
|
97
97
|
|
|
98
98
|
<script setup>
|
|
@@ -134,14 +134,14 @@ export const apiFetchHelper = async (state, onUpdateStatus, onUpdateOptions, onU
|
|
|
134
134
|
...opts.getBaseRequestOptions?.() || {},
|
|
135
135
|
...opts.fetch?.getRequestOptions?.(page, query, opts) || {}
|
|
136
136
|
};
|
|
137
|
-
const limit = baseRequestOptions.params?.limit || config.limit_per_page;
|
|
137
|
+
const limit = Number(baseRequestOptions.params?.limit || config.limit_per_page);
|
|
138
138
|
const requestOptions = prepareRequestOptions(
|
|
139
139
|
baseRequestOptions,
|
|
140
140
|
{
|
|
141
141
|
params: {
|
|
142
142
|
limit,
|
|
143
143
|
q: (query || "").trim(),
|
|
144
|
-
page
|
|
144
|
+
page: Number(page)
|
|
145
145
|
}
|
|
146
146
|
},
|
|
147
147
|
opts.params
|