@finema/core 3.3.0 → 3.5.1

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.
Files changed (54) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +1 -1
  3. package/dist/runtime/components/Form/FieldWrapper.vue +13 -13
  4. package/dist/runtime/components/Form/Fields.vue +18 -13
  5. package/dist/runtime/components/Form/InputCheckbox/index.vue +18 -18
  6. package/dist/runtime/components/Form/InputCheckboxGroup/index.d.vue.ts +8 -0
  7. package/dist/runtime/components/Form/InputCheckboxGroup/index.vue +59 -0
  8. package/dist/runtime/components/Form/InputCheckboxGroup/index.vue.d.ts +8 -0
  9. package/dist/runtime/components/Form/InputCheckboxGroup/types.d.ts +21 -0
  10. package/dist/runtime/components/Form/InputCheckboxGroup/types.js +0 -0
  11. package/dist/runtime/components/Form/InputCurrency/index.vue +49 -49
  12. package/dist/runtime/components/Form/InputDateTime/index.vue +53 -52
  13. package/dist/runtime/components/Form/InputDateTimeRange/index.vue +56 -55
  14. package/dist/runtime/components/Form/InputNumber/index.vue +20 -20
  15. package/dist/runtime/components/Form/InputSelect/index.vue +46 -38
  16. package/dist/runtime/components/Form/InputSelectMultiple/index.vue +62 -43
  17. package/dist/runtime/components/Form/InputTags/index.d.vue.ts +2 -0
  18. package/dist/runtime/components/Form/InputTags/index.vue +179 -25
  19. package/dist/runtime/components/Form/InputTags/index.vue.d.ts +2 -0
  20. package/dist/runtime/components/Form/InputTags/types.d.ts +5 -3
  21. package/dist/runtime/components/Form/InputTextarea/index.vue +18 -18
  22. package/dist/runtime/components/Form/InputTime/index.vue +38 -38
  23. package/dist/runtime/components/Form/InputToggle/index.vue +17 -17
  24. package/dist/runtime/components/Form/InputUploadDropzone/index.vue +30 -30
  25. package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.vue +50 -50
  26. package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/index.d.vue.ts +2 -2
  27. package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/index.vue +63 -32
  28. package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/index.vue.d.ts +2 -2
  29. package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/types.d.ts +2 -2
  30. package/dist/runtime/components/Form/InputUploadImageAuto/index.vue +50 -50
  31. package/dist/runtime/components/Form/fileState/EmptyState.vue +21 -21
  32. package/dist/runtime/components/Form/fileState/FailedState.vue +33 -33
  33. package/dist/runtime/components/Form/fileState/LoadingState.vue +24 -24
  34. package/dist/runtime/components/Form/fileState/MultipleFilesState.vue +75 -155
  35. package/dist/runtime/components/Form/fileState/PreviewModal.vue +23 -23
  36. package/dist/runtime/components/Form/fileState/useUploadStateMultiple.js +2 -10
  37. package/dist/runtime/components/Form/index.vue +5 -5
  38. package/dist/runtime/components/Form/types.d.ts +3 -1
  39. package/dist/runtime/components/Form/types.js +1 -0
  40. package/dist/runtime/components/Image.vue +28 -28
  41. package/dist/runtime/components/Log/index.vue +17 -17
  42. package/dist/runtime/components/Table/ColumnDate.vue +1 -1
  43. package/dist/runtime/components/Table/ColumnDateTime.vue +1 -1
  44. package/dist/runtime/components/Table/ColumnImage.vue +4 -4
  45. package/dist/runtime/components/Table/ColumnText.d.vue.ts +5 -1
  46. package/dist/runtime/components/Table/ColumnText.vue +1 -1
  47. package/dist/runtime/components/Table/ColumnText.vue.d.ts +5 -1
  48. package/dist/runtime/components/Table/Pagination.vue +46 -46
  49. package/dist/runtime/components/Table/Simple.vue +17 -17
  50. package/dist/runtime/server/tsconfig.json +3 -3
  51. package/dist/runtime/styles/main.css +1 -1
  52. package/dist/runtime/theme/selectMenu.js +2 -2
  53. package/dist/runtime/theme/table.js +1 -1
  54. package/package.json +2 -2
@@ -1,158 +1,82 @@
1
1
  <template>
2
- <div :class="theme.multipleFilesWrapper()">
3
- <div
4
- v-for="(item, index) in fileItems"
5
- :key="index"
6
- :class="theme.fileItemWrapper()"
7
- >
8
- <!-- Uploading State -->
9
- <div
10
- v-if="item.state === UploadState.UPLOADING"
11
- :class="theme.uploadingItemWrapper()"
12
- >
13
- <div :class="theme.uploadingIconWrapper()">
14
- <Icon
15
- :name="icons.filePreviewIcon"
16
- :class="theme.uploadingIconClass()"
17
- />
18
- </div>
19
- <div :class="theme.uploadingTextWrapper()">
20
- <h1 class="truncate font-bold">
21
- {{ item.file.name }}
22
- </h1>
23
- <div class="flex items-center gap-2">
24
- <div :class="theme.progressBarWrapper()">
25
- <div
26
- :class="theme.progressBarFill()"
27
- :style="{ width: `${item.progress}%` }"
28
- />
29
- </div>
30
- <p class="text-sm text-gray-400">
31
- {{ item.progress }}%
32
- </p>
33
- </div>
34
- </div>
35
- </div>
36
-
37
- <!-- Success State -->
38
- <div
39
- v-else-if="item.state === UploadState.SUCCESS && item.value"
40
- :class="theme.successItemWrapper()"
41
- >
42
- <div
43
- v-if="isImageFromPath(item.value.path)"
44
- :class="theme.successImgWrapper()"
45
- >
46
- <img
47
- :src="item.value.url"
48
- :class="theme.successImgClass()"
49
- alt="img-preview"
50
- />
51
- </div>
52
- <div
53
- v-else
54
- :class="theme.successFileWrapper()"
55
- >
56
- <Icon
57
- :name="icons.filePreviewIcon"
58
- :class="theme.successFileClass()"
59
- />
60
- </div>
61
- <div :class="theme.successTextWrapper()">
62
- <div class="truncate">
63
- <h1 class="truncate font-bold">
64
- {{ item.value.name }}
65
- </h1>
66
- <p class="truncate text-sm font-light text-gray-400">
67
- {{ getFileSizeFromValue(item.value) }}
68
- </p>
69
- </div>
70
- <div :class="theme.actionWrapper()">
71
- <a
72
- v-if="isPDFFromPath(item.value.path)"
73
- :href="item.value.url"
74
- target="_blank"
75
- class="flex"
76
- >
77
- <Icon
78
- :name="icons.actionPreviewIcon"
79
- :class="theme.actionIconClass()"
80
- title="ดูตัวอย่าง"
81
- />
82
- </a>
83
- <Icon
84
- v-if="isImageFromPath(item.value.path) || isVideoFromPath(item.value.path)"
85
- :name="icons.actionPreviewIcon"
86
- :class="theme.actionIconClass()"
87
- title="ดูตัวอย่าง"
88
- @click="$emit('preview', item.value)"
89
- />
90
- <Icon
91
- :name="icons.actionDownloadIcon"
92
- :class="theme.actionIconClass()"
93
- title="ดาวน์โหลดไฟล์"
94
- @click="$emit('download', item.value)"
95
- />
96
- <Icon
97
- v-if="!disabled && !readonly"
98
- :name="icons.actionDeleteIcon"
99
- :class="theme.actionIconClass()"
100
- title="ลบไฟล์"
101
- @click="$emit('delete', index)"
102
- />
103
- </div>
104
- </div>
105
- </div>
106
-
107
- <!-- Error State -->
108
- <div
109
- v-else-if="item.state === UploadState.ERROR"
110
- :class="theme.errorItemWrapper()"
111
- >
112
- <div :class="theme.errorIconWrapper()">
113
- <Icon
114
- :name="icons.errorIcon"
115
- :class="theme.errorIconClass()"
116
- />
117
- </div>
118
- <div :class="theme.errorTextWrapper()">
119
- <h1 class="truncate font-bold">
120
- {{ item.file.name }}
121
- </h1>
122
- <p class="text-error-500 text-sm">
123
- {{ item.error || uploadFailedLabel }}
124
- </p>
125
- </div>
126
- <div :class="theme.errorActionWrapper()">
127
- <Button
128
- variant="link"
129
- :icon="icons.actionRetryIcon"
130
- :class="theme.actionRetryBtnClass()"
131
- color="primary"
132
- @click="$emit('retry', index)"
133
- >
134
- {{ retryLabel }}
135
- </Button>
136
- <Icon
137
- v-if="!disabled && !readonly"
138
- :name="icons.actionDeleteIcon"
139
- :class="theme.actionIconClass()"
140
- title="ลบไฟล์"
141
- @click="$emit('delete', index)"
142
- />
143
- </div>
144
- </div>
145
- </div>
146
- </div>
2
+ <div :class="theme.multipleFilesWrapper()">
3
+ <div
4
+ v-for="(item, index) in fileItems"
5
+ :key="index"
6
+ :class="theme.fileItemWrapper()"
7
+ >
8
+ <!-- Uploading State -->
9
+ <div
10
+ v-if="item.state === UploadState.UPLOADING"
11
+ :class="theme.uploadingItemWrapper()"
12
+ >
13
+ <div :class="theme.uploadingIconWrapper()">
14
+ <Icon
15
+ :name="icons.filePreviewIcon"
16
+ :class="theme.uploadingIconClass()"
17
+ />
18
+ </div>
19
+ <div :class="theme.uploadingTextWrapper()">
20
+ <h1 class="truncate font-bold">
21
+ {{ item.file.name }}
22
+ </h1>
23
+ <div class="flex items-center gap-2">
24
+ <div :class="theme.progressBarWrapper()">
25
+ <div
26
+ :class="theme.progressBarFill()"
27
+ :style="{ width: `${item.progress}%` }"
28
+ />
29
+ </div>
30
+ <p class="text-sm text-gray-400">
31
+ {{ item.progress }}%
32
+ </p>
33
+ </div>
34
+ </div>
35
+ </div>
36
+
37
+ <!-- Error State -->
38
+ <div
39
+ v-else-if="item.state === UploadState.ERROR"
40
+ :class="theme.errorItemWrapper()"
41
+ >
42
+ <div :class="theme.errorIconWrapper()">
43
+ <Icon
44
+ :name="icons.errorIcon"
45
+ :class="theme.errorIconClass()"
46
+ />
47
+ </div>
48
+ <div :class="theme.errorTextWrapper()">
49
+ <h1 class="truncate font-bold">
50
+ {{ item.file.name }}
51
+ </h1>
52
+ <p class="text-error-500 text-sm">
53
+ {{ item.error || uploadFailedLabel }}
54
+ </p>
55
+ </div>
56
+ <div :class="theme.errorActionWrapper()">
57
+ <Button
58
+ variant="link"
59
+ :icon="icons.actionRetryIcon"
60
+ :class="theme.actionRetryBtnClass()"
61
+ color="primary"
62
+ @click="$emit('retry', index)"
63
+ >
64
+ {{ retryLabel }}
65
+ </Button>
66
+ <Icon
67
+ v-if="!disabled && !readonly"
68
+ :name="icons.actionDeleteIcon"
69
+ :class="theme.actionIconClass()"
70
+ title="ลบไฟล์"
71
+ @click="$emit('delete', index)"
72
+ />
73
+ </div>
74
+ </div>
75
+ </div>
76
+ </div>
147
77
  </template>
148
78
 
149
79
  <script setup>
150
- import {
151
- isImageFromPath,
152
- isPDFFromPath,
153
- isVideoFromPath,
154
- useFileSize
155
- } from "#core/helpers/componentHelper";
156
80
  import { useUiIconConfig } from "#core/composables/useConfig";
157
81
  import { UploadState } from "./useUploadStateMultiple";
158
82
  defineEmits(["preview", "download", "delete", "retry"]);
@@ -165,8 +89,4 @@ defineProps({
165
89
  retryLabel: { type: String, required: false }
166
90
  });
167
91
  const icons = useUiIconConfig("uploadFileDropzone");
168
- const getFileSizeFromValue = (fileValue) => {
169
- const allocate = useFileSize(fileValue.size || 0);
170
- return allocate.isSelectedFileUseMb.value ? `${allocate.selectedFileSizeMb.value} MB` : `${allocate.selectedFileSizeKb.value} KB`;
171
- };
172
92
  </script>
@@ -1,29 +1,29 @@
1
1
  <template>
2
- <Modal
3
- :close="{ onClick: () => emits('close', false) }"
4
- :dismissible="false"
5
- :title="value?.name"
2
+ <Modal
3
+ :close="{ onClick: () => emits('close', false) }"
4
+ :dismissible="false"
5
+ :title="value?.name"
6
6
  :ui="{
7
7
  content: 'max-w-3xl'
8
- }"
9
- >
10
- <template #body>
11
- <div class="flex justify-center">
12
- <img
13
- v-if="value && isImageFromPath(value.path)"
14
- :src="value.url"
15
- alt="img-preview"
16
- class="max-h-96 max-w-full rounded-lg"
17
- />
18
- <video
19
- v-else-if="value && isVideoFromPath(value.path)"
20
- :src="value.url"
21
- controls
22
- class="max-h-96 max-w-full"
23
- />
24
- </div>
25
- </template>
26
- </Modal>
8
+ }"
9
+ >
10
+ <template #body>
11
+ <div class="flex justify-center">
12
+ <img
13
+ v-if="value && isImageFromPath(value.path)"
14
+ :src="value.url"
15
+ alt="img-preview"
16
+ class="max-h-96 max-w-full rounded-lg"
17
+ />
18
+ <video
19
+ v-else-if="value && isVideoFromPath(value.path)"
20
+ :src="value.url"
21
+ controls
22
+ class="max-h-96 max-w-full"
23
+ />
24
+ </div>
25
+ </template>
26
+ </Modal>
27
27
  </template>
28
28
 
29
29
  <script setup>
@@ -98,11 +98,8 @@ export const useUploadStateMultiple = (props, emits, onChange, setErrors, value,
98
98
  size: Number(_get(uploadLoader.data.value, props.responseSize) || fileItem.file.size),
99
99
  id: _get(uploadLoader.data.value, props.responseID)
100
100
  };
101
- updateFileItem(index, {
102
- value: fileValue,
103
- state: "success" /* SUCCESS */
104
- });
105
- updateFormValue();
101
+ fileItems.value.splice(index, 1);
102
+ onChange([fileValue, ...value.value]);
106
103
  emits("success", fileValue);
107
104
  stopProgressWatch();
108
105
  stopSuccessWatch();
@@ -154,10 +151,6 @@ export const useUploadStateMultiple = (props, emits, onChange, setErrors, value,
154
151
  });
155
152
  emits("change", fileItems.value.map((item) => item.file));
156
153
  };
157
- const updateFormValue = () => {
158
- const successfulFiles = fileItems.value.filter((item) => item.state === "success" /* SUCCESS */ && item.value).map((item) => item.value);
159
- onChange(successfulFiles.length > 0 ? successfulFiles : void 0);
160
- };
161
154
  const handleFileDrop = (files) => {
162
155
  if (wrapperProps.value.disabled || wrapperProps.value.readonly || !files?.length) return;
163
156
  files.forEach((file) => processFile(file));
@@ -195,7 +188,6 @@ export const useUploadStateMultiple = (props, emits, onChange, setErrors, value,
195
188
  };
196
189
  const handleDeleteFile = (index) => {
197
190
  fileItems.value.splice(index, 1);
198
- updateFormValue();
199
191
  if (fileItems.value.length === 0) {
200
192
  setErrors("");
201
193
  }
@@ -1,5 +1,5 @@
1
- <template>
2
- <form class="form">
3
- <slot />
4
- </form>
5
- </template>
1
+ <template>
2
+ <form class="form">
3
+ <slot />
4
+ </form>
5
+ </template>
@@ -21,6 +21,7 @@ import type { IWYSIWYGField } from '#core/components/Form/InputWYSIWYG/types';
21
21
  import type { IComponentField } from '#core/components/Form/InputComponent/types';
22
22
  import type { ITagsField } from '#core/components/Form/InputTags/types';
23
23
  import type { ICurrencyField } from '#core/components/Form/InputCurrency/types';
24
+ import type { ICheckboxGroupField } from '#core/components/Form/InputCheckboxGroup/types';
24
25
  export declare enum INPUT_TYPES {
25
26
  TEXT = "TEXT",
26
27
  SEARCH = "SEARCH",
@@ -36,6 +37,7 @@ export declare enum INPUT_TYPES {
36
37
  SELECT_MULTIPLE = "SELECT_MULTIPLE",
37
38
  RADIO = "RADIO",
38
39
  CHECKBOX = "CHECKBOX",
40
+ CHECKBOX_GROUP = "CHECKBOX_GROUP",
39
41
  DATE_TIME = "DATE_TIME",
40
42
  TIME = "TIME",
41
43
  DATE = "DATE",
@@ -77,7 +79,7 @@ export interface IFormFieldBase<I extends INPUT_TYPES, P extends IFieldProps, O>
77
79
  props: P;
78
80
  on?: O;
79
81
  }
80
- export type IFormField = ITextField | ISearchField | INumberField | ICurrencyField | ITextareaField | IToggleField | ISelectField | ICheckboxField | ISelectMultipleField | IRadioField | IDateTimeField | ITimeField | IMonthField | IDateTimeRangeField | IUploadDropzoneField | IUploadDropzoneAutoField | IUploadDropzoneAutoMultipleField | IUploadImageAutoField | IWYSIWYGField | IComponentField | ITagsField | IFormFieldBase<INPUT_TYPES.COMPONENT, any, any>;
82
+ export type IFormField = ITextField | ISearchField | INumberField | ICurrencyField | ITextareaField | IToggleField | ISelectField | ICheckboxField | ICheckboxGroupField | ISelectMultipleField | IRadioField | IDateTimeField | ITimeField | IMonthField | IDateTimeRangeField | IUploadDropzoneField | IUploadDropzoneAutoField | IUploadDropzoneAutoMultipleField | IUploadImageAutoField | IWYSIWYGField | IComponentField | ITagsField | IFormFieldBase<INPUT_TYPES.COMPONENT, any, any>;
81
83
  export interface IFileValue {
82
84
  url: string;
83
85
  path?: string;
@@ -13,6 +13,7 @@ export var INPUT_TYPES = /* @__PURE__ */ ((INPUT_TYPES2) => {
13
13
  INPUT_TYPES2["SELECT_MULTIPLE"] = "SELECT_MULTIPLE";
14
14
  INPUT_TYPES2["RADIO"] = "RADIO";
15
15
  INPUT_TYPES2["CHECKBOX"] = "CHECKBOX";
16
+ INPUT_TYPES2["CHECKBOX_GROUP"] = "CHECKBOX_GROUP";
16
17
  INPUT_TYPES2["DATE_TIME"] = "DATE_TIME";
17
18
  INPUT_TYPES2["TIME"] = "TIME";
18
19
  INPUT_TYPES2["DATE"] = "DATE";
@@ -1,32 +1,32 @@
1
1
  <template>
2
- <UseImage v-bind="$props">
3
- <template #loading>
4
- <slot name="loading">
5
- <div
6
- class="flex h-full w-full items-center justify-center"
7
- >
8
- <Loader
9
- :loading="true"
10
- />
11
- </div>
12
- </slot>
13
- </template>
14
-
15
- <template #error>
16
- <slot name="error">
17
- <div
18
- class="flex h-full w-full items-center justify-center"
19
- >
20
- <p class="text-error-400">
21
- <Icon
22
- name="i-heroicons:exclamation-circle-solid"
23
- class="text-error-400 size-8"
24
- />
25
- </p>
26
- </div>
27
- </slot>
28
- </template>
29
- </UseImage>
2
+ <UseImage v-bind="$props">
3
+ <template #loading>
4
+ <slot name="loading">
5
+ <div
6
+ class="flex h-full w-full items-center justify-center"
7
+ >
8
+ <Loader
9
+ :loading="true"
10
+ />
11
+ </div>
12
+ </slot>
13
+ </template>
14
+
15
+ <template #error>
16
+ <slot name="error">
17
+ <div
18
+ class="flex h-full w-full items-center justify-center"
19
+ >
20
+ <p class="text-error-400">
21
+ <Icon
22
+ name="i-heroicons:exclamation-circle-solid"
23
+ class="text-error-400 size-8"
24
+ />
25
+ </p>
26
+ </div>
27
+ </slot>
28
+ </template>
29
+ </UseImage>
30
30
  </template>
31
31
 
32
32
  <script setup>
@@ -1,21 +1,21 @@
1
1
  <template>
2
- <DevOnly>
3
- <TeleportSafe
4
- to="#dev-logs"
5
- >
6
- <LogItem
7
- v-if="typeof data !== 'undefined'"
8
- :data="data"
9
- :title="title"
10
- />
11
- <LogItem
12
- v-for="(item, index) in dataItems"
13
- :key="index"
14
- :data="item"
15
- :title="`${title} #${index + 1}`"
16
- />
17
- </TeleportSafe>
18
- </DevOnly>
2
+ <DevOnly>
3
+ <TeleportSafe
4
+ to="#dev-logs"
5
+ >
6
+ <LogItem
7
+ v-if="typeof data !== 'undefined'"
8
+ :data="data"
9
+ :title="title"
10
+ />
11
+ <LogItem
12
+ v-for="(item, index) in dataItems"
13
+ :key="index"
14
+ :data="item"
15
+ :title="`${title} #${index + 1}`"
16
+ />
17
+ </TeleportSafe>
18
+ </DevOnly>
19
19
  </template>
20
20
 
21
21
  <script setup>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- {{ getValue || "-" }}
2
+ {{ getValue || "-" }}
3
3
  </template>
4
4
 
5
5
  <script setup>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- {{ getValue || "-" }}
2
+ {{ getValue || "-" }}
3
3
  </template>
4
4
 
5
5
  <script setup>
@@ -1,8 +1,8 @@
1
1
  <template>
2
- <Image
3
- class="h-12 rounded"
4
- :src="getValue"
5
- />
2
+ <Image
3
+ class="h-12 rounded"
4
+ :src="getValue"
5
+ />
6
6
  </template>
7
7
 
8
8
  <script setup>
@@ -2,7 +2,11 @@ import type { TableColumn } from '@nuxt/ui';
2
2
  type __VLS_Props = {
3
3
  value: any;
4
4
  row: any;
5
- column: TableColumn<any>;
5
+ column: TableColumn<any> & {
6
+ meta: {
7
+ max: number;
8
+ };
9
+ };
6
10
  };
7
11
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
12
  declare const _default: typeof __VLS_export;
@@ -1,5 +1,5 @@
1
1
  <template>
2
- {{ getValue }}
2
+ {{ getValue }}
3
3
  </template>
4
4
 
5
5
  <script setup>
@@ -2,7 +2,11 @@ import type { TableColumn } from '@nuxt/ui';
2
2
  type __VLS_Props = {
3
3
  value: any;
4
4
  row: any;
5
- column: TableColumn<any>;
5
+ column: TableColumn<any> & {
6
+ meta: {
7
+ max: number;
8
+ };
9
+ };
6
10
  };
7
11
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
12
  declare const _default: typeof __VLS_export;
@@ -1,70 +1,70 @@
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
- </p>
39
- </template>
40
- </USelect>
41
- <p
35
+ "
36
+ >
37
+ {{ modelValue }} รายการ
38
+ </p>
39
+ </template>
40
+ </USelect>
41
+ <p
42
42
  :class="
43
43
  theme.paginationInfo({
44
44
  class: [ui?.paginationInfo, '']
45
45
  })
46
- "
47
- >
48
- <span v-if="options.pageOptions">{{ pageBetween }} จากทั้งหมด {{ totalCountWithComma }}</span>
49
- <span v-else>ทั้งหมด {{ options.rawData.length }} รายการ</span>
50
- </p>
51
- </div>
52
-
53
- <UPagination
54
- v-if="options.pageOptions && options.pageOptions.totalPage > 1"
55
- :page="page"
56
- :default-page="options.pageOptions?.currentPage || 1"
57
- :items-per-page="options.pageOptions.limit"
58
- :total="options.pageOptions.totalCount"
59
- :to="options.isRouteChange ? to : void 0"
60
- show-edges
61
- variant="outline"
62
- color="neutral"
63
- active-color="neutral"
64
- active-variant="subtle"
65
- @update:page="emits('pageChange', $event)"
66
- />
67
- </div>
46
+ "
47
+ >
48
+ <span v-if="options.pageOptions">{{ pageBetween }} จากทั้งหมด {{ totalCountWithComma }}</span>
49
+ <span v-else>ทั้งหมด {{ options.rawData.length }} รายการ</span>
50
+ </p>
51
+ </div>
52
+
53
+ <UPagination
54
+ v-if="options.pageOptions && options.pageOptions.totalPage > 1"
55
+ :page="page"
56
+ :default-page="options.pageOptions?.currentPage || 1"
57
+ :items-per-page="options.pageOptions.limit"
58
+ :total="options.pageOptions.totalCount"
59
+ :to="options.isRouteChange ? to : void 0"
60
+ show-edges
61
+ variant="outline"
62
+ color="neutral"
63
+ active-color="neutral"
64
+ active-variant="subtle"
65
+ @update:page="emits('pageChange', $event)"
66
+ />
67
+ </div>
68
68
  </template>
69
69
 
70
70
  <script setup>