@finema/core 2.12.2 → 2.12.3

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "2.12.2",
3
+ "version": "2.12.3",
4
4
  "configKey": "core",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.1",
package/dist/module.mjs CHANGED
@@ -3,7 +3,7 @@ import defu from 'defu';
3
3
  import * as theme from '../dist/runtime/theme/index.js';
4
4
 
5
5
  const name = "@finema/core";
6
- const version = "2.12.2";
6
+ const version = "2.12.3";
7
7
 
8
8
  const nuxtAppOptions = {
9
9
  head: {
@@ -1,80 +1,80 @@
1
1
  <template>
2
- <div
3
- v-if="!isHideCaption || !isHideBottomPagination"
4
- class="mb-4 text-gray-500"
5
- >
6
- <span class="font-bold">ผลลัพธ์ทั้งหมด:</span>
7
- จำนวน
8
- <span class="font-bold">{{ pageOptions?.totalCount || 0 }}</span>
9
- รายการ
10
- </div>
11
- <UTable
12
- :loading="status.isLoading"
13
- :columns="uTableCompatibleColumns"
14
- :rows="rawData"
15
- v-bind="$attrs"
16
- >
17
- <template #loading-state>
18
- <div class="flex h-60 items-center justify-center">
19
- <Icon
20
- name="i-svg-spinners:180-ring-with-bg"
21
- class="size-8 text-primary"
22
- />
23
- </div>
24
- </template>
25
- <template #empty-state>
26
- <Empty />
27
- </template>
28
- <template
29
- v-for="column in columns"
30
- #[`${column.accessorKey}-data`]="{ row }"
31
- :key="column.accessorKey"
32
- >
33
- <component
34
- :is="column.type === COLUMN_TYPES.COMPONENT ? column.component : column.type ? columnTypeComponents[column.type] : void 0"
35
- v-if="column.type === COLUMN_TYPES.COMPONENT || column.type && columnTypeComponents[column.type]"
36
- :value="transformValue(column, row)"
37
- :column="column"
38
- :row="row"
39
- />
40
- <ColumnText
41
- v-else
42
- :value="transformValue(column, row)"
43
- :column="column"
44
- :row="row"
45
- />
46
- </template>
47
-
48
- <template
49
- v-for="(_, slotName) in $slots"
50
- #[slotName]="scope"
51
- >
52
- <slot
53
- :name="slotName"
54
- v-bind="scope"
55
- />
56
- </template>
57
- </UTable>
58
- <div
59
- v-if="pageOptions"
60
- class="mt-4 flex justify-between px-3"
61
- >
62
- <p class="text-sm text-gray-500">
63
- ผลลัพธ์ {{ pageBetween }} ของ {{ totalCountWithComma }} รายการ
64
- </p>
65
- <Pagination
66
- v-if="pageOptions.totalPage > 1 && !isSimplePagination && !isHideBottomPagination"
67
- v-model="page"
68
- :page-count="pageOptions.limit"
69
- :total="pageOptions.totalCount"
70
- />
71
- <SimplePagination
72
- v-if="pageOptions.totalPage > 1 && isSimplePagination"
73
- v-model="page"
74
- :page-count="pageOptions.limit"
75
- :total="pageOptions.totalCount"
76
- />
77
- </div>
2
+ <div
3
+ v-if="!isHideCaption || !isHideBottomPagination"
4
+ class="mb-4 text-gray-500"
5
+ >
6
+ <span class="font-bold">ผลลัพธ์ทั้งหมด:</span>
7
+ จำนวน
8
+ <span class="font-bold">{{ pageOptions?.totalCount || 0 }}</span>
9
+ รายการ
10
+ </div>
11
+ <UTable
12
+ :loading="status.isLoading"
13
+ :columns="uTableCompatibleColumns"
14
+ :rows="rawData"
15
+ v-bind="$attrs"
16
+ >
17
+ <template #loading-state>
18
+ <div class="flex h-60 items-center justify-center">
19
+ <Icon
20
+ name="i-svg-spinners:180-ring-with-bg"
21
+ class="text-primary size-8"
22
+ />
23
+ </div>
24
+ </template>
25
+ <template #empty-state>
26
+ <Empty />
27
+ </template>
28
+ <template
29
+ v-for="column in columns"
30
+ #[`${column.accessorKey}-data`]="{ row }"
31
+ :key="column.accessorKey"
32
+ >
33
+ <component
34
+ :is="column.type === COLUMN_TYPES.COMPONENT ? column.component : column.type ? columnTypeComponents[column.type] : void 0"
35
+ v-if="column.type === COLUMN_TYPES.COMPONENT || column.type && columnTypeComponents[column.type]"
36
+ :value="transformValue(column, row)"
37
+ :column="column"
38
+ :row="row"
39
+ />
40
+ <ColumnText
41
+ v-else
42
+ :value="transformValue(column, row)"
43
+ :column="column"
44
+ :row="row"
45
+ />
46
+ </template>
47
+
48
+ <template
49
+ v-for="(_, slotName) in $slots"
50
+ #[slotName]="scope"
51
+ >
52
+ <slot
53
+ :name="slotName"
54
+ v-bind="scope"
55
+ />
56
+ </template>
57
+ </UTable>
58
+ <div
59
+ v-if="pageOptions"
60
+ class="mt-4 flex justify-between px-3"
61
+ >
62
+ <p class="text-sm text-gray-500">
63
+ ผลลัพธ์ {{ pageBetween }} ของ {{ totalCountWithComma }} รายการ
64
+ </p>
65
+ <Pagination
66
+ v-if="pageOptions.totalPage > 1 && !isSimplePagination && !isHideBottomPagination"
67
+ v-model="page"
68
+ :page-count="pageOptions.limit"
69
+ :total="pageOptions.totalCount"
70
+ />
71
+ <SimplePagination
72
+ v-if="pageOptions.totalPage > 1 && isSimplePagination"
73
+ v-model="page"
74
+ :page-count="pageOptions.limit"
75
+ :total="pageOptions.totalCount"
76
+ />
77
+ </div>
78
78
  </template>
79
79
 
80
80
  <script setup>
@@ -113,7 +113,7 @@ const props = defineProps({
113
113
  type: Boolean,
114
114
  default: false
115
115
  },
116
- isHideBottomPagination: {
116
+ isHidePagination: {
117
117
  type: Boolean,
118
118
  default: false
119
119
  },
@@ -25,8 +25,8 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
25
25
  type: PropType<ITableOptions["isSimplePagination"]>;
26
26
  default: boolean;
27
27
  };
28
- isHideBottomPagination: {
29
- type: PropType<ITableOptions["isHideBottomPagination"]>;
28
+ isHidePagination: {
29
+ type: PropType<ITableOptions["isHidePagination"]>;
30
30
  default: boolean;
31
31
  };
32
32
  isHideCaption: {
@@ -56,8 +56,8 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
56
56
  type: PropType<ITableOptions["isSimplePagination"]>;
57
57
  default: boolean;
58
58
  };
59
- isHideBottomPagination: {
60
- type: PropType<ITableOptions["isHideBottomPagination"]>;
59
+ isHidePagination: {
60
+ type: PropType<ITableOptions["isHidePagination"]>;
61
61
  default: boolean;
62
62
  };
63
63
  isHideCaption: {
@@ -68,8 +68,8 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
68
68
  onPageChange?: ((...args: any[]) => any) | undefined;
69
69
  }>, {
70
70
  isHideCaption: boolean | undefined;
71
- isHideBottomPagination: boolean | undefined;
72
71
  isSimplePagination: boolean | undefined;
72
+ isHidePagination: boolean | undefined;
73
73
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
74
74
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
75
75
  export default _default;
@@ -1,25 +1,25 @@
1
1
  <template>
2
- <Base
3
- v-bind="$attrs"
4
- :columns="options.columns"
5
- :raw-data="itemsByPage"
6
- :status="options.status"
7
- :page-options="pageOptions"
8
- :is-simple-pagination="isShowSimplePagination"
9
- :is-hide-bottom-pagination="options.isHideBottomPagination"
10
- :is-hide-caption="options.isHideCaption"
11
- @page-change="onPageChange"
12
- >
13
- <template
14
- v-for="(_, slot) of $slots"
15
- #[slot]="slotProps"
16
- >
17
- <slot
18
- :name="slot"
19
- v-bind="slotProps || {}"
20
- />
21
- </template>
22
- </Base>
2
+ <Base
3
+ v-bind="$attrs"
4
+ :columns="options.columns"
5
+ :raw-data="itemsByPage"
6
+ :status="options.status"
7
+ :page-options="pageOptions"
8
+ :is-simple-pagination="isShowSimplePagination"
9
+ :is-hide-pagination="options.isHidePagination"
10
+ :is-hide-caption="options.isHideCaption"
11
+ @page-change="onPageChange"
12
+ >
13
+ <template
14
+ v-for="(_, slot) of $slots"
15
+ #[slot]="slotProps"
16
+ >
17
+ <slot
18
+ :name="slot"
19
+ v-bind="slotProps || {}"
20
+ />
21
+ </template>
22
+ </Base>
23
23
  </template>
24
24
 
25
25
  <script setup>
@@ -13,7 +13,7 @@
13
13
  />
14
14
  </div>
15
15
  <div
16
- v-if="!options.isHideCaption || !options.isHideBottomPagination"
16
+ v-if="!options.isHideCaption || !options.isHidePagination"
17
17
  :class="theme.captionContainer({
18
18
  class: [ui?.captionContainer]
19
19
  })"
@@ -53,7 +53,7 @@
53
53
  name="error"
54
54
  >
55
55
  <div
56
- class="flex h-[200px] items-center justify-center text-2xl text-error-400"
56
+ class="text-error-400 flex h-[200px] items-center justify-center text-2xl"
57
57
  >
58
58
  {{ StringHelper.getError(options.status.errorData) }}
59
59
  </div>
@@ -91,6 +91,7 @@
91
91
  </UTable>
92
92
 
93
93
  <div
94
+ v-if="!options.isHidePagination"
94
95
  :class="theme.paginationContainer({
95
96
  class: [ui?.paginationContainer]
96
97
  })"
@@ -100,7 +101,7 @@
100
101
  class: [ui?.paginationInfo]
101
102
  })"
102
103
  >
103
- ผลลัพธ์ {{ pageBetween }} ของ {{ totalCountWithComma }} รายการ
104
+ {{ pageBetween }} รายการ จากทั้งหมด {{ totalCountWithComma }} รายการ
104
105
  </p>
105
106
  <Pagination
106
107
  v-model:page="page"
@@ -6,7 +6,7 @@ type Slot = TableSlots<any> & {
6
6
  };
7
7
  type __VLS_Slots = Slot;
8
8
  type __VLS_Props = {
9
- options: ITableOptions;
9
+ options: ITableOptions<any>;
10
10
  ui?: typeof tableTheme['slots'];
11
11
  };
12
12
  declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
@@ -19,9 +19,8 @@ export interface IBaseTableOptions<T extends Record<string, any> = Record<string
19
19
  rawData: T[];
20
20
  status: IStatus;
21
21
  columns: TableColumn<T>[];
22
- isHideBottomPagination?: boolean;
22
+ isHidePagination?: boolean;
23
23
  isHideCaption?: boolean;
24
- isHideTopPagination?: boolean;
25
24
  isSimplePagination?: boolean;
26
25
  }
27
26
  export interface ITableOptions<T extends Record<string, any> = Record<string, any>> extends IBaseTableOptions<T> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "2.12.2",
3
+ "version": "2.12.3",
4
4
  "repository": "https://gitlab.finema.co/finema/ui-kit",
5
5
  "license": "MIT",
6
6
  "author": "Finema Dev Core Team",