@finema/core 1.4.220 → 2.1.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.
Files changed (307) hide show
  1. package/README.md +79 -60
  2. package/dist/module.d.mts +4 -24
  3. package/dist/module.json +4 -3
  4. package/dist/module.mjs +75 -213
  5. package/dist/runtime/components/App.vue +27 -0
  6. package/dist/runtime/components/App.vue.d.ts +12 -0
  7. package/dist/runtime/components/DevToolsWindow/index.vue +312 -0
  8. package/dist/runtime/components/DevToolsWindow/index.vue.d.ts +2 -0
  9. package/dist/runtime/components/Dialog/index.vue +77 -110
  10. package/dist/runtime/components/Dialog/index.vue.d.ts +10 -0
  11. package/dist/runtime/components/Empty.vue +33 -18
  12. package/dist/runtime/components/Empty.vue.d.ts +12 -0
  13. package/dist/runtime/components/FlexDeck/Base.vue +154 -159
  14. package/dist/runtime/components/FlexDeck/Base.vue.d.ts +63 -0
  15. package/dist/runtime/components/FlexDeck/index.vue +67 -68
  16. package/dist/runtime/components/FlexDeck/index.vue.d.ts +43 -0
  17. package/dist/runtime/components/Form/FieldWrapper.vue +35 -23
  18. package/dist/runtime/components/Form/FieldWrapper.vue.d.ts +16 -0
  19. package/dist/runtime/components/Form/Fields.vue +92 -230
  20. package/dist/runtime/components/Form/Fields.vue.d.ts +14 -0
  21. package/dist/runtime/components/Form/InputCheckbox/index.vue +53 -28
  22. package/dist/runtime/components/Form/InputCheckbox/index.vue.d.ts +3 -0
  23. package/dist/runtime/components/Form/InputCheckbox/types.d.ts +5 -1
  24. package/dist/runtime/components/Form/InputDateTime/date_time_field.types.d.ts +1 -1
  25. package/dist/runtime/components/Form/InputDateTime/index.vue +97 -68
  26. package/dist/runtime/components/Form/InputDateTime/index.vue.d.ts +4 -0
  27. package/dist/runtime/components/Form/InputNumber/index.vue +61 -27
  28. package/dist/runtime/components/Form/InputNumber/index.vue.d.ts +5 -0
  29. package/dist/runtime/components/Form/InputNumber/types.d.ts +10 -5
  30. package/dist/runtime/components/Form/InputSelect/index.vue +95 -55
  31. package/dist/runtime/components/Form/InputSelect/index.vue.d.ts +5 -0
  32. package/dist/runtime/components/Form/InputSelect/types.d.ts +14 -8
  33. package/dist/runtime/components/Form/InputSelectMultiple/index.vue +108 -54
  34. package/dist/runtime/components/Form/InputSelectMultiple/index.vue.d.ts +3 -0
  35. package/dist/runtime/components/Form/InputSelectMultiple/types.d.ts +9 -8
  36. package/dist/runtime/components/Form/InputText/index.vue +135 -68
  37. package/dist/runtime/components/Form/InputText/index.vue.d.ts +5 -0
  38. package/dist/runtime/components/Form/InputText/types.d.ts +4 -3
  39. package/dist/runtime/components/Form/InputTextarea/index.vue +57 -25
  40. package/dist/runtime/components/Form/InputTextarea/index.vue.d.ts +3 -0
  41. package/dist/runtime/components/Form/InputTextarea/types.d.ts +7 -2
  42. package/dist/runtime/components/Form/InputToggle/index.vue +51 -27
  43. package/dist/runtime/components/Form/InputToggle/index.vue.d.ts +3 -0
  44. package/dist/runtime/components/Form/InputToggle/types.d.ts +5 -1
  45. package/dist/runtime/components/Form/index.vue +5 -6
  46. package/dist/runtime/components/Form/index.vue.d.ts +12 -0
  47. package/dist/runtime/components/Form/types.d.ts +13 -27
  48. package/dist/runtime/components/Image.vue +51 -36
  49. package/dist/runtime/components/Image.vue.d.ts +13 -0
  50. package/dist/runtime/components/Loader.vue +29 -27
  51. package/dist/runtime/components/Loader.vue.d.ts +22 -0
  52. package/dist/runtime/components/{LogItem.vue → Log/LogItem.vue} +44 -41
  53. package/dist/runtime/components/Log/LogItem.vue.d.ts +6 -0
  54. package/dist/runtime/components/Log/index.vue +28 -0
  55. package/dist/runtime/components/Log/index.vue.d.ts +7 -0
  56. package/dist/runtime/components/Table/Base.vue +166 -161
  57. package/dist/runtime/components/Table/Base.vue.d.ts +47 -0
  58. package/dist/runtime/components/Table/ColumnDate.vue +14 -16
  59. package/dist/runtime/components/Table/ColumnDate.vue.d.ts +8 -0
  60. package/dist/runtime/components/Table/ColumnDateTime.vue +16 -18
  61. package/dist/runtime/components/Table/ColumnDateTime.vue.d.ts +8 -0
  62. package/dist/runtime/components/Table/ColumnImage.vue +16 -15
  63. package/dist/runtime/components/Table/ColumnImage.vue.d.ts +8 -0
  64. package/dist/runtime/components/Table/ColumnNumber.vue +14 -14
  65. package/dist/runtime/components/Table/ColumnNumber.vue.d.ts +8 -0
  66. package/dist/runtime/components/Table/ColumnText.vue +24 -29
  67. package/dist/runtime/components/Table/ColumnText.vue.d.ts +8 -0
  68. package/dist/runtime/components/Table/Simple.vue +69 -70
  69. package/dist/runtime/components/Table/Simple.vue.d.ts +24 -0
  70. package/dist/runtime/components/Table/index.vue +178 -65
  71. package/dist/runtime/components/Table/index.vue.d.ts +25 -0
  72. package/dist/runtime/components/Table/types.d.ts +14 -18
  73. package/dist/runtime/components/Table/{types.mjs → types.js} +1 -0
  74. package/dist/runtime/components/TeleportSafe.vue +42 -40
  75. package/dist/runtime/components/TeleportSafe.vue.d.ts +16 -0
  76. package/dist/runtime/composables/loaderList.d.ts +2 -2
  77. package/dist/runtime/composables/loaderList.js +51 -0
  78. package/dist/runtime/composables/loaderObject.d.ts +1 -1
  79. package/dist/runtime/composables/loaderObject.js +50 -0
  80. package/dist/runtime/composables/loaderPage.d.ts +10 -11
  81. package/dist/runtime/composables/loaderPage.js +243 -0
  82. package/dist/runtime/composables/useApp.d.ts +4 -9
  83. package/dist/runtime/composables/{useApp.mjs → useApp.js} +0 -12
  84. package/dist/runtime/composables/useConfig.d.ts +3 -3
  85. package/dist/runtime/composables/useConfig.js +12 -0
  86. package/dist/runtime/composables/useDialog.d.ts +1 -7
  87. package/dist/runtime/composables/useDialog.js +53 -0
  88. package/dist/runtime/composables/useFlexDeck.d.ts +1 -1
  89. package/dist/runtime/composables/{useFlexDeck.mjs → useFlexDeck.js} +5 -5
  90. package/dist/runtime/composables/useForm.d.ts +5 -2
  91. package/dist/runtime/composables/useForm.js +37 -0
  92. package/dist/runtime/composables/useNotification.d.ts +6 -22
  93. package/dist/runtime/composables/{useNotification.mjs → useNotification.js} +5 -21
  94. package/dist/runtime/composables/useTable.d.ts +12 -11
  95. package/dist/runtime/composables/{useTable.mjs → useTable.js} +3 -8
  96. package/dist/runtime/composables/useUpload.d.ts +2 -2
  97. package/dist/runtime/composables/{useUpload.mjs → useUpload.js} +1 -1
  98. package/dist/runtime/helpers/apiBaseHelper.d.ts +29 -0
  99. package/dist/runtime/helpers/apiBaseHelper.js +63 -0
  100. package/dist/runtime/helpers/apiListHelper.d.ts +4 -6
  101. package/dist/runtime/helpers/apiListHelper.js +50 -0
  102. package/dist/runtime/helpers/apiObjectHelper.d.ts +19 -20
  103. package/dist/runtime/helpers/apiObjectHelper.js +51 -0
  104. package/dist/runtime/helpers/apiPageHelper.d.ts +44 -44
  105. package/dist/runtime/helpers/apiPageHelper.js +287 -0
  106. package/dist/runtime/helpers/componentHelper.d.ts +11 -12
  107. package/dist/runtime/helpers/{componentHelper.mjs → componentHelper.js} +2 -7
  108. package/dist/runtime/i18n/valibot.d.ts +69 -0
  109. package/dist/runtime/i18n/valibot.js +72 -0
  110. package/dist/runtime/plugin.d.ts +1 -1
  111. package/dist/runtime/plugin.js +12 -0
  112. package/dist/runtime/server/tsconfig.json +3 -0
  113. package/dist/runtime/theme/button.d.ts +5 -0
  114. package/dist/runtime/theme/button.js +1 -0
  115. package/dist/runtime/theme/dialog.d.ts +31 -0
  116. package/dist/runtime/theme/dialog.js +21 -0
  117. package/dist/runtime/theme/empty.d.ts +7 -0
  118. package/dist/runtime/theme/empty.js +7 -0
  119. package/dist/runtime/theme/form.d.ts +18 -0
  120. package/dist/runtime/theme/form.js +16 -0
  121. package/dist/runtime/theme/index.d.ts +10 -0
  122. package/dist/runtime/theme/index.js +10 -0
  123. package/dist/runtime/theme/input.d.ts +8 -0
  124. package/dist/runtime/theme/input.js +4 -0
  125. package/dist/runtime/theme/inputNumber.d.ts +8 -0
  126. package/dist/runtime/theme/inputNumber.js +4 -0
  127. package/dist/runtime/theme/loader.d.ts +28 -0
  128. package/dist/runtime/theme/loader.js +18 -0
  129. package/dist/runtime/theme/selectMenu.d.ts +17 -0
  130. package/dist/runtime/theme/selectMenu.js +18 -0
  131. package/dist/runtime/theme/table.d.ts +10 -0
  132. package/dist/runtime/theme/table.js +10 -0
  133. package/dist/runtime/theme/textarea.d.ts +5 -0
  134. package/dist/runtime/theme/textarea.js +1 -0
  135. package/dist/runtime/types/lib.d.ts +1 -1
  136. package/dist/runtime/utils/ArrayHelper.d.ts +1 -1
  137. package/dist/runtime/utils/{ArrayHelper.mjs → ArrayHelper.js} +1 -1
  138. package/dist/runtime/utils/ObjectHelper.d.ts +3 -3
  139. package/dist/runtime/utils/{ObjectHelper.mjs → ObjectHelper.js} +3 -3
  140. package/dist/runtime/utils/ParamHelper.d.ts +1 -1
  141. package/dist/runtime/utils/{ParamHelper.mjs → ParamHelper.js} +1 -1
  142. package/dist/types.d.mts +2 -15
  143. package/package.json +91 -100
  144. package/dist/module.cjs +0 -5
  145. package/dist/module.d.ts +0 -50
  146. package/dist/runtime/components/Alert.vue +0 -48
  147. package/dist/runtime/components/Avatar.vue +0 -27
  148. package/dist/runtime/components/Badge.vue +0 -11
  149. package/dist/runtime/components/Breadcrumb.vue +0 -44
  150. package/dist/runtime/components/Button/Group.vue +0 -37
  151. package/dist/runtime/components/Button/index.vue +0 -75
  152. package/dist/runtime/components/Card.vue +0 -38
  153. package/dist/runtime/components/Core.vue +0 -45
  154. package/dist/runtime/components/Dropdown/index.vue +0 -70
  155. package/dist/runtime/components/Dropdown/types.d.ts +0 -2
  156. package/dist/runtime/components/Dropdown/types.mjs +0 -17
  157. package/dist/runtime/components/Form/InputDateTimeRange/date_range_time_field.types.d.ts +0 -17
  158. package/dist/runtime/components/Form/InputDateTimeRange/index.vue +0 -91
  159. package/dist/runtime/components/Form/InputRadio/index.vue +0 -27
  160. package/dist/runtime/components/Form/InputRadio/types.d.ts +0 -8
  161. package/dist/runtime/components/Form/InputStatic/index.vue +0 -16
  162. package/dist/runtime/components/Form/InputStatic/types.d.ts +0 -4
  163. package/dist/runtime/components/Form/InputTags/index.vue +0 -141
  164. package/dist/runtime/components/Form/InputTags/types.d.ts +0 -11
  165. package/dist/runtime/components/Form/InputTextarea/types.mjs +0 -0
  166. package/dist/runtime/components/Form/InputToggle/types.mjs +0 -0
  167. package/dist/runtime/components/Form/InputUploadDropzone/index.vue +0 -206
  168. package/dist/runtime/components/Form/InputUploadDropzone/types.d.ts +0 -11
  169. package/dist/runtime/components/Form/InputUploadDropzone/types.mjs +0 -0
  170. package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.vue +0 -362
  171. package/dist/runtime/components/Form/InputUploadDropzoneAuto/types.d.ts +0 -23
  172. package/dist/runtime/components/Form/InputUploadDropzoneAuto/types.mjs +0 -0
  173. package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/ItemUpload.vue +0 -241
  174. package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/ItemView.vue +0 -110
  175. package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/index.vue +0 -171
  176. package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/types.d.ts +0 -23
  177. package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/types.mjs +0 -0
  178. package/dist/runtime/components/Form/InputUploadDropzoneImageAutoMultiple/ItemUpload.vue +0 -161
  179. package/dist/runtime/components/Form/InputUploadDropzoneImageAutoMultiple/ItemView.vue +0 -64
  180. package/dist/runtime/components/Form/InputUploadDropzoneImageAutoMultiple/index.vue +0 -178
  181. package/dist/runtime/components/Form/InputUploadDropzoneImageAutoMultiple/types.d.ts +0 -21
  182. package/dist/runtime/components/Form/InputUploadDropzoneImageAutoMultiple/types.mjs +0 -0
  183. package/dist/runtime/components/Form/InputUploadFileClassic/index.vue +0 -95
  184. package/dist/runtime/components/Form/InputUploadFileClassic/types.d.ts +0 -13
  185. package/dist/runtime/components/Form/InputUploadFileClassic/types.mjs +0 -0
  186. package/dist/runtime/components/Form/InputUploadFileClassicAuto/index.vue +0 -151
  187. package/dist/runtime/components/Form/InputUploadFileClassicAuto/types.d.ts +0 -18
  188. package/dist/runtime/components/Form/InputUploadFileClassicAuto/types.mjs +0 -0
  189. package/dist/runtime/components/Form/InputUploadImageAuto/index.vue +0 -219
  190. package/dist/runtime/components/Form/InputUploadImageAuto/types.d.ts +0 -20
  191. package/dist/runtime/components/Form/InputUploadImageAuto/types.mjs +0 -0
  192. package/dist/runtime/components/Form/InputWYSIWYG/UploadImageForm.vue +0 -55
  193. package/dist/runtime/components/Form/InputWYSIWYG/index.vue +0 -230
  194. package/dist/runtime/components/Form/InputWYSIWYG/types.d.ts +0 -19
  195. package/dist/runtime/components/Form/InputWYSIWYG/types.mjs +0 -0
  196. package/dist/runtime/components/Icon.vue +0 -23
  197. package/dist/runtime/components/Log.vue +0 -22
  198. package/dist/runtime/components/Modal/index.vue +0 -146
  199. package/dist/runtime/components/OTPInput.vue +0 -127
  200. package/dist/runtime/components/QRCode.vue +0 -22
  201. package/dist/runtime/components/SimplePagination.vue +0 -96
  202. package/dist/runtime/components/Slideover/index.vue +0 -110
  203. package/dist/runtime/components/Tabs/index.vue +0 -64
  204. package/dist/runtime/composables/loaderList.mjs +0 -52
  205. package/dist/runtime/composables/loaderObject.mjs +0 -52
  206. package/dist/runtime/composables/loaderPage.mjs +0 -229
  207. package/dist/runtime/composables/useConfig.mjs +0 -9
  208. package/dist/runtime/composables/useDialog.mjs +0 -81
  209. package/dist/runtime/composables/useForm.mjs +0 -18
  210. package/dist/runtime/core.config.d.ts +0 -14
  211. package/dist/runtime/core.config.mjs +0 -14
  212. package/dist/runtime/helpers/apiListHelper.mjs +0 -44
  213. package/dist/runtime/helpers/apiObjectHelper.mjs +0 -46
  214. package/dist/runtime/helpers/apiPageHelper.mjs +0 -270
  215. package/dist/runtime/plugin.mjs +0 -149
  216. package/dist/runtime/types/common.mjs +0 -0
  217. package/dist/runtime/types/config.d.ts +0 -1
  218. package/dist/runtime/types/config.mjs +0 -0
  219. package/dist/runtime/types/lib.mjs +0 -0
  220. package/dist/runtime/ui.config/alert.d.ts +0 -3
  221. package/dist/runtime/ui.config/alert.mjs +0 -6
  222. package/dist/runtime/ui.config/badge.d.ts +0 -3
  223. package/dist/runtime/ui.config/badge.mjs +0 -1
  224. package/dist/runtime/ui.config/breadcrumb.d.ts +0 -1
  225. package/dist/runtime/ui.config/breadcrumb.mjs +0 -7
  226. package/dist/runtime/ui.config/button.d.ts +0 -3
  227. package/dist/runtime/ui.config/button.mjs +0 -8
  228. package/dist/runtime/ui.config/buttonGroup.d.ts +0 -3
  229. package/dist/runtime/ui.config/buttonGroup.mjs +0 -1
  230. package/dist/runtime/ui.config/card.d.ts +0 -1
  231. package/dist/runtime/ui.config/card.mjs +0 -2
  232. package/dist/runtime/ui.config/checkbox.d.ts +0 -3
  233. package/dist/runtime/ui.config/checkbox.mjs +0 -1
  234. package/dist/runtime/ui.config/formGroup.d.ts +0 -3
  235. package/dist/runtime/ui.config/formGroup.mjs +0 -5
  236. package/dist/runtime/ui.config/icon.d.ts +0 -3
  237. package/dist/runtime/ui.config/icon.mjs +0 -3
  238. package/dist/runtime/ui.config/index.d.ts +0 -16
  239. package/dist/runtime/ui.config/index.mjs +0 -16
  240. package/dist/runtime/ui.config/input.d.ts +0 -3
  241. package/dist/runtime/ui.config/input.mjs +0 -5
  242. package/dist/runtime/ui.config/modal.d.ts +0 -1
  243. package/dist/runtime/ui.config/modal.mjs +0 -34
  244. package/dist/runtime/ui.config/notification.d.ts +0 -11
  245. package/dist/runtime/ui.config/notification.mjs +0 -13
  246. package/dist/runtime/ui.config/notifications.d.ts +0 -3
  247. package/dist/runtime/ui.config/notifications.mjs +0 -3
  248. package/dist/runtime/ui.config/pagination.d.ts +0 -3
  249. package/dist/runtime/ui.config/pagination.mjs +0 -37
  250. package/dist/runtime/ui.config/select.d.ts +0 -3
  251. package/dist/runtime/ui.config/select.mjs +0 -5
  252. package/dist/runtime/ui.config/selectMenu.d.ts +0 -3
  253. package/dist/runtime/ui.config/selectMenu.mjs +0 -5
  254. package/dist/runtime/ui.config/slideover.d.ts +0 -1
  255. package/dist/runtime/ui.config/slideover.mjs +0 -16
  256. package/dist/runtime/ui.config/table.d.ts +0 -3
  257. package/dist/runtime/ui.config/table.mjs +0 -47
  258. package/dist/runtime/ui.config/tabs.d.ts +0 -3
  259. package/dist/runtime/ui.config/tabs.mjs +0 -4
  260. package/dist/runtime/ui.config/tags.d.ts +0 -25
  261. package/dist/runtime/ui.config/tags.mjs +0 -25
  262. package/dist/runtime/ui.config/textarea.d.ts +0 -3
  263. package/dist/runtime/ui.config/textarea.mjs +0 -5
  264. package/dist/runtime/ui.config/toggle.d.ts +0 -3
  265. package/dist/runtime/ui.config/toggle.mjs +0 -5
  266. package/dist/runtime/ui.config/uploadDropzoneImage.d.ts +0 -83
  267. package/dist/runtime/ui.config/uploadDropzoneImage.mjs +0 -26
  268. package/dist/runtime/ui.config/uploadFileDropzone.d.ts +0 -61
  269. package/dist/runtime/ui.config/uploadFileDropzone.mjs +0 -61
  270. package/dist/runtime/ui.config/uploadFileInputClassicAuto.d.ts +0 -8
  271. package/dist/runtime/ui.config/uploadFileInputClassicAuto.mjs +0 -8
  272. package/dist/runtime/ui.config/uploadImage.d.ts +0 -34
  273. package/dist/runtime/ui.config/uploadImage.mjs +0 -36
  274. package/dist/runtime/ui.css +0 -1
  275. package/dist/runtime/utils/ArrayHelper.spec.d.ts +0 -1
  276. package/dist/runtime/utils/ArrayHelper.spec.mjs +0 -112
  277. package/dist/runtime/utils/FileHelper.spec.d.ts +0 -1
  278. package/dist/runtime/utils/FileHelper.spec.mjs +0 -14
  279. package/dist/runtime/utils/ObjectHelper.spec.d.ts +0 -1
  280. package/dist/runtime/utils/ObjectHelper.spec.mjs +0 -52
  281. package/dist/runtime/utils/ParamHelper.spec.d.ts +0 -1
  282. package/dist/runtime/utils/ParamHelper.spec.mjs +0 -78
  283. package/dist/runtime/utils/StringHelper.spec.d.ts +0 -1
  284. package/dist/runtime/utils/StringHelper.spec.mjs +0 -76
  285. package/dist/runtime/utils/TimeHelper.spec.d.ts +0 -1
  286. package/dist/runtime/utils/TimeHelper.spec.mjs +0 -79
  287. package/dist/runtime/utils/TimeHelper.thai.spec.d.ts +0 -1
  288. package/dist/runtime/utils/TimeHelper.thai.spec.mjs +0 -31
  289. package/dist/types.d.ts +0 -16
  290. package/dist/runtime/components/FlexDeck/{types.mjs → types.js} +0 -0
  291. package/dist/runtime/components/Form/InputCheckbox/{types.mjs → types.js} +0 -0
  292. package/dist/runtime/components/Form/InputDateTime/{date_time_field.types.mjs → date_time_field.types.js} +0 -0
  293. package/dist/runtime/components/Form/{InputDateTimeRange/date_range_time_field.types.mjs → InputNumber/types.js} +0 -0
  294. package/dist/runtime/components/Form/{InputNumber/types.mjs → InputSelect/types.js} +0 -0
  295. package/dist/runtime/components/Form/{InputRadio/types.mjs → InputSelectMultiple/types.js} +0 -0
  296. package/dist/runtime/components/Form/{InputSelect/types.mjs → InputText/types.js} +0 -0
  297. package/dist/runtime/components/Form/{InputSelectMultiple/types.mjs → InputTextarea/types.js} +0 -0
  298. package/dist/runtime/components/Form/{InputStatic/types.mjs → InputToggle/types.js} +0 -0
  299. package/dist/runtime/components/Form/{types.mjs → types.js} +0 -0
  300. package/dist/runtime/composables/{useWatch.mjs → useWatch.js} +0 -0
  301. package/dist/runtime/lib/{Requester.mjs → Requester.js} +0 -0
  302. package/dist/runtime/{components/Form/InputTags/types.mjs → types/common.js} +0 -0
  303. package/dist/runtime/{components/Form/InputText/types.mjs → types/lib.js} +0 -0
  304. package/dist/runtime/utils/{FileHelper.mjs → FileHelper.js} +0 -0
  305. package/dist/runtime/utils/{StringHelper.mjs → StringHelper.js} +0 -0
  306. package/dist/runtime/utils/{TimeHelper.mjs → TimeHelper.js} +1 -1
  307. /package/dist/runtime/utils/{lodash.mjs → lodash.js} +0 -0
@@ -1,18 +1,16 @@
1
- <template>
2
- {{ getValue || '-' }}
3
- </template>
4
- <script lang="ts" setup>
5
- import { computed } from 'vue'
6
- import { type IColumn } from '#core/components/Table/types'
7
- import { TimeHelper } from '#core/utils/TimeHelper'
8
-
9
- const props = defineProps<{
10
- value: any
11
- row: any
12
- column: IColumn
13
- }>()
14
-
15
- const getValue = computed(() => {
16
- return TimeHelper.displayDateTime(props.value)
17
- })
18
- </script>
1
+ <template>
2
+ {{ getValue || "-" }}
3
+ </template>
4
+
5
+ <script setup>
6
+ import { computed } from "vue";
7
+ import { TimeHelper } from "#core/utils/TimeHelper";
8
+ const props = defineProps({
9
+ value: { type: null, required: true },
10
+ row: { type: null, required: true },
11
+ column: { type: null, required: true }
12
+ });
13
+ const getValue = computed(() => {
14
+ return TimeHelper.displayDateTime(props.value);
15
+ });
16
+ </script>
@@ -0,0 +1,8 @@
1
+ import type { TableColumn } from '@nuxt/ui';
2
+ type __VLS_Props = {
3
+ value: any;
4
+ row: any;
5
+ column: TableColumn<any>;
6
+ };
7
+ declare const _default: 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
+ export default _default;
@@ -1,15 +1,16 @@
1
- <template>
2
- <Image class="h-12" :src="getValue" />
3
- </template>
4
- <script lang="ts" setup>
5
- import { computed } from 'vue'
6
- import { type IColumn } from '#core/components/Table/types'
7
-
8
- const props = defineProps<{
9
- value: any
10
- row: any
11
- column: IColumn
12
- }>()
13
-
14
- const getValue = computed(() => props.value)
15
- </script>
1
+ <template>
2
+ <Image
3
+ class="h-12 rounded"
4
+ :src="getValue"
5
+ />
6
+ </template>
7
+
8
+ <script setup>
9
+ import { computed } from "vue";
10
+ const props = defineProps({
11
+ value: { type: null, required: true },
12
+ row: { type: null, required: true },
13
+ column: { type: null, required: true }
14
+ });
15
+ const getValue = computed(() => props.value);
16
+ </script>
@@ -0,0 +1,8 @@
1
+ import type { TableColumn } from '@nuxt/ui';
2
+ type __VLS_Props = {
3
+ value: any;
4
+ row: any;
5
+ column: TableColumn<any>;
6
+ };
7
+ declare const _default: 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
+ export default _default;
@@ -1,14 +1,14 @@
1
- <template>{{ getValue }}</template>
2
- <script lang="ts" setup>
3
- import { StringHelper } from '../../utils/StringHelper'
4
- import { computed } from 'vue'
5
- import { type IColumn } from '#core/components/Table/types'
6
-
7
- const props = defineProps<{
8
- value: any
9
- row: any
10
- column: IColumn
11
- }>()
12
-
13
- const getValue = computed(() => StringHelper.withComma(props.value))
14
- </script>
1
+ <template>
2
+ {{ getValue }}
3
+ </template>
4
+
5
+ <script setup>
6
+ import { computed } from "vue";
7
+ import { StringHelper } from "../../utils/StringHelper";
8
+ const props = defineProps({
9
+ value: { type: null, required: true },
10
+ row: { type: null, required: true },
11
+ column: { type: null, required: true }
12
+ });
13
+ const getValue = computed(() => StringHelper.withComma(props.value));
14
+ </script>
@@ -0,0 +1,8 @@
1
+ import type { TableColumn } from '@nuxt/ui';
2
+ type __VLS_Props = {
3
+ value: any;
4
+ row: any;
5
+ column: TableColumn<any>;
6
+ };
7
+ declare const _default: 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
+ export default _default;
@@ -1,29 +1,24 @@
1
- <template>{{ getValue }}</template>
2
- <script lang="ts" setup>
3
- import { computed } from 'vue'
4
- import { type IColumn } from '#core/components/Table/types'
5
- import { StringHelper } from '#imports'
6
-
7
- const props = defineProps<{
8
- value: any
9
- row: any
10
- column: IColumn<{
11
- max?: number
12
- }>
13
- }>()
14
-
15
- const getValue = computed<string>(() => {
16
- const value = props.value
17
- const max = props.column.props?.max
18
-
19
- if (max) {
20
- return StringHelper.truncate(value, max)
21
- }
22
-
23
- if (typeof value === 'string') {
24
- return value || '-'
25
- }
26
-
27
- return value ?? '-'
28
- })
29
- </script>
1
+ <template>
2
+ {{ getValue }}
3
+ </template>
4
+
5
+ <script setup>
6
+ import { computed } from "vue";
7
+ import { StringHelper } from "#imports";
8
+ const props = defineProps({
9
+ value: { type: null, required: true },
10
+ row: { type: null, required: true },
11
+ column: { type: null, required: true }
12
+ });
13
+ const getValue = computed(() => {
14
+ const value = props.value;
15
+ const max = props.column?.meta?.max;
16
+ if (max) {
17
+ return StringHelper.truncate(value, max);
18
+ }
19
+ if (typeof value === "string") {
20
+ return value || "-";
21
+ }
22
+ return value ?? "-";
23
+ });
24
+ </script>
@@ -0,0 +1,8 @@
1
+ import type { TableColumn } from '@nuxt/ui';
2
+ type __VLS_Props = {
3
+ value: any;
4
+ row: any;
5
+ column: TableColumn<any>;
6
+ };
7
+ declare const _default: 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
+ export default _default;
@@ -1,70 +1,69 @@
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 v-for="(_, slot) of $slots" #[slot]="slotProps">
14
- <slot :name="slot" v-bind="slotProps || {}" />
15
- </template>
16
- </Base>
17
- </template>
18
- <script lang="ts" setup>
19
- import { computed, type PropType, ref } from 'vue'
20
- import { type ISimpleTableOptions } from '#core/components/Table/types'
21
- import Base from '#core/components/Table/Base.vue'
22
- import { initPageOptions } from '#core/composables/loaderPage'
23
- import { useCoreConfig } from '#core/composables/useConfig'
24
-
25
- defineSlots<{
26
- 'empty-state': () => any
27
- 'loading-state': () => any
28
- }>()
29
-
30
- const props = defineProps({
31
- options: { type: Object as PropType<ISimpleTableOptions>, required: true },
32
- })
33
-
34
- const currentPage = ref(1)
35
- const coreConfig = useCoreConfig()
36
- const isShowSimplePagination = computed(
37
- (): boolean => props.options.isSimplePagination ?? coreConfig.is_simple_pagination
38
- )
39
-
40
- const pageOptions = computed(() => {
41
- if (!props.options?.limit) {
42
- return undefined
43
- }
44
-
45
- return {
46
- ...initPageOptions({
47
- limit: props.options.limit,
48
- primary: props.options.primary,
49
- }),
50
- totalCount: props.options.rawData.length,
51
- totalPage: Math.ceil(props.options.rawData.length / props.options.limit),
52
- currentPage: currentPage.value,
53
- }
54
- })
55
-
56
- const onPageChange = (page: number) => {
57
- currentPage.value = page
58
- }
59
-
60
- const itemsByPage = computed(() => {
61
- if (!pageOptions.value) {
62
- return props.options?.rawData
63
- }
64
-
65
- const start = (pageOptions.value.currentPage - 1) * pageOptions.value.limit
66
- const end = start + pageOptions.value.limit
67
-
68
- return props.options?.rawData.slice(start, end)
69
- })
70
- </script>
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>
23
+ </template>
24
+
25
+ <script setup>
26
+ import { computed, ref } from "vue";
27
+ import Base from "#core/components/Table/Base.vue";
28
+ import { initPageOptions } from "#core/composables/loaderPage";
29
+ import { useCoreConfig } from "#core/composables/useConfig";
30
+ defineSlots();
31
+ const props = defineProps({
32
+ options: {
33
+ type: Object,
34
+ required: true
35
+ }
36
+ });
37
+ const currentPage = ref(1);
38
+ const coreConfig = useCoreConfig();
39
+ const isShowSimplePagination = computed(
40
+ () => props.options.isSimplePagination ?? coreConfig.is_simple_pagination ?? false
41
+ );
42
+ const pageOptions = computed(() => {
43
+ if (!props.options?.limit) {
44
+ return void 0;
45
+ }
46
+ const totalCount = props.options.rawData.length;
47
+ const limit = props.options.limit;
48
+ return {
49
+ ...initPageOptions({
50
+ limit,
51
+ primary: props.options.primary
52
+ }),
53
+ totalCount,
54
+ totalPage: Math.ceil(totalCount / limit),
55
+ currentPage: currentPage.value
56
+ };
57
+ });
58
+ const onPageChange = (page) => {
59
+ currentPage.value = page;
60
+ };
61
+ const itemsByPage = computed(() => {
62
+ if (!pageOptions.value) {
63
+ return props.options?.rawData;
64
+ }
65
+ const start = (pageOptions.value.currentPage - 1) * pageOptions.value.limit;
66
+ const end = start + pageOptions.value.limit;
67
+ return props.options?.rawData.slice(start, end);
68
+ });
69
+ </script>
@@ -0,0 +1,24 @@
1
+ import { type PropType } from 'vue';
2
+ import type { ISimpleTableOptions } from '#core/components/Table/types';
3
+ type __VLS_Slots = {
4
+ 'empty-state': () => any;
5
+ 'loading-state': () => any;
6
+ };
7
+ declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
8
+ options: {
9
+ type: PropType<ISimpleTableOptions>;
10
+ required: true;
11
+ };
12
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
13
+ options: {
14
+ type: PropType<ISimpleTableOptions>;
15
+ required: true;
16
+ };
17
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
18
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
19
+ export default _default;
20
+ type __VLS_WithSlots<T, S> = T & {
21
+ new (): {
22
+ $slots: S;
23
+ };
24
+ };
@@ -1,65 +1,178 @@
1
- <template>
2
- <div>
3
- <div v-if="options.isEnabledSearch" class="mb-4 flex justify-end">
4
- <UInput
5
- v-model="q"
6
- icon="i-heroicons-magnifying-glass"
7
- :placeholder="options.searchPlaceholder || 'ค้นหา....'"
8
- />
9
- </div>
10
- <Base
11
- v-bind="$attrs"
12
- :columns="options.columns"
13
- :raw-data="options.rawData"
14
- :status="options.status"
15
- :page-options="options.pageOptions"
16
- :is-simple-pagination="isShowSimplePagination"
17
- :is-hide-bottom-pagination="options.isHideBottomPagination"
18
- @page-change="onPageChange"
19
- >
20
- <template v-for="(_, slot) of $slots" #[slot]="slotProps">
21
- <slot :name="slot" v-bind="slotProps || {}" />
22
- </template>
23
- </Base>
24
- </div>
25
- </template>
26
- <script lang="ts" setup>
27
- import { type PropType } from 'vue'
28
- import { type ITableOptions } from '#core/components/Table/types'
29
- import { _debounce, computed, ref, watch } from '#imports'
30
- import { useCoreConfig } from '#core/composables/useConfig'
31
- import Base from '#core/components/Table/Base.vue'
32
-
33
- defineSlots<{
34
- 'empty-state': () => any
35
- 'loading-state': () => any
36
- }>()
37
-
38
- const emits = defineEmits<{
39
- (event: 'pageChange', page: number): void
40
- (event: 'search', q: string): void
41
- }>()
42
-
43
- const props = defineProps({
44
- options: { type: Object as PropType<ITableOptions>, required: true },
45
- })
46
-
47
- const coreConfig = useCoreConfig()
48
-
49
- const q = ref(props.options?.pageOptions.search ?? '')
50
-
51
- const isShowSimplePagination = computed(
52
- (): boolean => props.options.isSimplePagination ?? coreConfig.is_simple_pagination
53
- )
54
-
55
- watch(
56
- q,
57
- _debounce((value) => {
58
- emits('search', value)
59
- }, 500)
60
- )
61
-
62
- const onPageChange = (page: number) => {
63
- emits('pageChange', page)
64
- }
65
- </script>
1
+ <template>
2
+ <div>
3
+ <div
4
+ v-if="options.isEnabledSearch"
5
+ :class="theme.searchContainer({
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
+ <div
16
+ v-if="!options.isHideCaption || !options.isHideBottomPagination"
17
+ :class="theme.captionContainer({
18
+ class: [ui?.captionContainer]
19
+ })"
20
+ >
21
+ <span
22
+ :class="theme.captionBoldText({
23
+ class: [ui?.captionBoldText]
24
+ })"
25
+ >
26
+ ผลลัพธ์ทั้งหมด:</span>
27
+ จำนวน
28
+ <span
29
+ :class="theme.captionBoldText({
30
+ class: [ui?.captionBoldText]
31
+ })"
32
+ >{{ options.pageOptions?.totalCount || 0 }}</span>
33
+ รายการ
34
+ </div>
35
+
36
+ <UTable
37
+ v-bind="$attrs"
38
+ :loading="options.status.isLoading"
39
+ :data="options.rawData"
40
+ :columns="options.columns"
41
+ >
42
+ <template #empty>
43
+ <slot
44
+ v-if="options.status.isLoading"
45
+ name="loading"
46
+ >
47
+ <Loader
48
+ :loading="true"
49
+ />
50
+ </slot>
51
+ <slot
52
+ v-else-if="options.status.isError"
53
+ name="error"
54
+ >
55
+ <div
56
+ class="text-error-400 text-2xl h-[200px] flex justify-center items-center"
57
+ >
58
+ {{ StringHelper.getError(options.status.errorData) }}
59
+ </div>
60
+ </slot>
61
+
62
+ <slot
63
+ v-else
64
+ name="error"
65
+ >
66
+ <Empty />
67
+ </slot>
68
+ </template>
69
+ <template
70
+ v-for="column in options.columns.filter((item) => !!item.type)"
71
+ #[`${column.accessorKey}-cell`]="{ row }"
72
+ :key="column.accessorKey"
73
+ >
74
+ <component
75
+ :is="column.type === COLUMN_TYPES.COMPONENT ? column.component : columnTypeComponents[column.type]"
76
+ v-if="column.type === COLUMN_TYPES.COMPONENT || columnTypeComponents[column.type]"
77
+ :value="transformValue(column, row)"
78
+ :column="column"
79
+ :row="row"
80
+ />
81
+ </template>
82
+ <template
83
+ v-for="(_, slotName) of $slots"
84
+ #[slotName]="slotProps"
85
+ >
86
+ <slot
87
+ :name="slotName"
88
+ v-bind="slotProps || {}"
89
+ />
90
+ </template>
91
+ </UTable>
92
+
93
+ <div
94
+ :class="theme.paginationContainer({
95
+ class: [ui?.paginationContainer]
96
+ })"
97
+ >
98
+ <p
99
+ :class="theme.paginationInfo({
100
+ class: [ui?.paginationInfo]
101
+ })"
102
+ >
103
+ ผลลัพธ์ {{ pageBetween }} ของ {{ totalCountWithComma }} รายการ
104
+ </p>
105
+ <Pagination
106
+ v-model:page="page"
107
+ :default-page="options.pageOptions?.currentPage || 1"
108
+ :items-per-page="options.pageOptions.limit"
109
+ :total="options.pageOptions.totalCount"
110
+ @update:page="emits('pageChange', $event)"
111
+ />
112
+ </div>
113
+ </div>
114
+ </template>
115
+
116
+ <script setup>
117
+ import { computed } from "vue";
118
+ import { COLUMN_TYPES } from "#core/components/Table/types";
119
+ import { _debounce, ref, useUiConfig, watch, useWatchChange } from "#imports";
120
+ import { StringHelper } from "#core/utils/StringHelper";
121
+ import ColumnDate from "#core/components/Table/ColumnDate.vue";
122
+ import ColumnDateTime from "#core/components/Table/ColumnDateTime.vue";
123
+ import ColumnImage from "#core/components/Table/ColumnImage.vue";
124
+ import ColumnText from "#core/components/Table/ColumnText.vue";
125
+ import ColumnNumber from "#core/components/Table/ColumnNumber.vue";
126
+ import { tableTheme } from "#core/theme/table";
127
+ import UTable from "#ui/components/Table";
128
+ const columnTypeComponents = {
129
+ [COLUMN_TYPES.NUMBER]: ColumnNumber,
130
+ [COLUMN_TYPES.IMAGE]: ColumnImage,
131
+ [COLUMN_TYPES.DATE_TIME]: ColumnDateTime,
132
+ [COLUMN_TYPES.DATE]: ColumnDate,
133
+ [COLUMN_TYPES.TEXT]: ColumnText
134
+ };
135
+ defineSlots();
136
+ const emits = defineEmits(["pageChange", "search"]);
137
+ const props = defineProps({
138
+ options: { type: Object, required: true },
139
+ ui: { type: null, required: false }
140
+ });
141
+ const page = ref(props.options?.pageOptions?.currentPage || 1);
142
+ const theme = computed(() => useUiConfig(tableTheme, "table")());
143
+ const q = ref(props.options?.pageOptions.search ?? "");
144
+ watch(
145
+ q,
146
+ _debounce((value) => {
147
+ emits("search", value);
148
+ }, 500)
149
+ );
150
+ useWatchChange(() => props.options?.pageOptions?.currentPage, (value) => {
151
+ page.value = value;
152
+ });
153
+ const pageBetween = computed(() => {
154
+ const rawDataLength = props.options.rawData?.length;
155
+ const pageOpts = props.options.pageOptions;
156
+ if (!rawDataLength || !pageOpts) {
157
+ return "0";
158
+ }
159
+ const currentPage = pageOpts.currentPage || 1;
160
+ const limit = pageOpts.limit;
161
+ if (limit <= 0) {
162
+ return "0";
163
+ }
164
+ const start = (currentPage - 1) * limit + 1;
165
+ const end = start + rawDataLength - 1;
166
+ return `${start} - ${end}`;
167
+ });
168
+ const totalCountWithComma = computed(() => {
169
+ const total = props.options.pageOptions?.totalCount;
170
+ if (!total || total <= 0) {
171
+ return "0";
172
+ }
173
+ return StringHelper.withComma(total);
174
+ });
175
+ const transformValue = (column, row) => {
176
+ return column.cell ? column.cell({ row }) : row.getValue(column.accessorKey);
177
+ };
178
+ </script>
@@ -0,0 +1,25 @@
1
+ import type { TableSlots } from '@nuxt/ui';
2
+ import type { ITableOptions } from '#core/components/Table/types';
3
+ import { tableTheme } from '#core/theme/table';
4
+ type Slot = TableSlots<any> & {
5
+ error: (props?: Record<string, any>) => any;
6
+ };
7
+ type __VLS_Slots = Slot;
8
+ type __VLS_Props = {
9
+ options: ITableOptions;
10
+ ui?: typeof tableTheme['slots'];
11
+ };
12
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
13
+ search: (q: string) => any;
14
+ pageChange: (page: number) => any;
15
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
16
+ onSearch?: ((q: string) => any) | undefined;
17
+ onPageChange?: ((page: number) => any) | undefined;
18
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
20
+ export default _default;
21
+ type __VLS_WithSlots<T, S> = T & {
22
+ new (): {
23
+ $slots: S;
24
+ };
25
+ };