@finema/core 1.4.219 → 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 +58 -39
  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 +67 -100
  10. package/dist/runtime/components/Dialog/index.vue.d.ts +10 -0
  11. package/dist/runtime/components/Empty.vue +29 -14
  12. package/dist/runtime/components/Empty.vue.d.ts +12 -0
  13. package/dist/runtime/components/FlexDeck/Base.vue +82 -87
  14. package/dist/runtime/components/FlexDeck/Base.vue.d.ts +63 -0
  15. package/dist/runtime/components/FlexDeck/index.vue +38 -39
  16. package/dist/runtime/components/FlexDeck/index.vue.d.ts +43 -0
  17. package/dist/runtime/components/Form/FieldWrapper.vue +21 -9
  18. package/dist/runtime/components/Form/FieldWrapper.vue.d.ts +16 -0
  19. package/dist/runtime/components/Form/Fields.vue +84 -222
  20. package/dist/runtime/components/Form/Fields.vue.d.ts +14 -0
  21. package/dist/runtime/components/Form/InputCheckbox/index.vue +43 -18
  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 +59 -30
  26. package/dist/runtime/components/Form/InputDateTime/index.vue.d.ts +4 -0
  27. package/dist/runtime/components/Form/InputNumber/index.vue +51 -17
  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 +77 -37
  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 +91 -37
  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 +103 -36
  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 +43 -11
  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 +41 -17
  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 +0 -1
  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 +47 -32
  49. package/dist/runtime/components/Image.vue.d.ts +13 -0
  50. package/dist/runtime/components/Loader.vue +21 -19
  51. package/dist/runtime/components/Loader.vue.d.ts +22 -0
  52. package/dist/runtime/components/{LogItem.vue → Log/LogItem.vue} +19 -16
  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 +103 -98
  57. package/dist/runtime/components/Table/Base.vue.d.ts +47 -0
  58. package/dist/runtime/components/Table/ColumnDate.vue +10 -12
  59. package/dist/runtime/components/Table/ColumnDate.vue.d.ts +8 -0
  60. package/dist/runtime/components/Table/ColumnDateTime.vue +11 -13
  61. package/dist/runtime/components/Table/ColumnDateTime.vue.d.ts +8 -0
  62. package/dist/runtime/components/Table/ColumnImage.vue +12 -11
  63. package/dist/runtime/components/Table/ColumnImage.vue.d.ts +8 -0
  64. package/dist/runtime/components/Table/ColumnNumber.vue +12 -12
  65. package/dist/runtime/components/Table/ColumnNumber.vue.d.ts +8 -0
  66. package/dist/runtime/components/Table/ColumnText.vue +19 -24
  67. package/dist/runtime/components/Table/ColumnText.vue.d.ts +8 -0
  68. package/dist/runtime/components/Table/Simple.vue +41 -42
  69. package/dist/runtime/components/Table/Simple.vue.d.ts +24 -0
  70. package/dist/runtime/components/Table/index.vue +159 -46
  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 +31 -29
  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 +54 -63
  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,11 +1,17 @@
1
1
  <template>
2
- <div v-if="!isHideCaption || !isHideBottomPagination" class="mb-4 text-gray-500">
2
+ <div
3
+ v-if="!isHideCaption || !isHideBottomPagination"
4
+ class="mb-4 text-gray-500"
5
+ >
3
6
  <span class="font-bold">ผลลัพธ์ทั้งหมด:</span>
4
7
  จำนวน
5
8
  <span class="font-bold">{{ pageOptions?.totalCount || 0 }}</span>
6
9
  รายการ
7
10
  </div>
8
- <slot v-if="!status.isLoading && rawData.length === 0" name="empty-state">
11
+ <slot
12
+ v-if="!status.isLoading && rawData.length === 0"
13
+ name="empty-state"
14
+ >
9
15
  <Empty />
10
16
  </slot>
11
17
 
@@ -19,25 +25,39 @@
19
25
  </div>
20
26
 
21
27
  <div :class="containerClass">
22
- <slot v-for="(row, index) in innerRawData" :key="index" :row="row" />
28
+ <slot
29
+ v-for="(row, index) in innerRawData"
30
+ :key="index"
31
+ :row="row"
32
+ />
23
33
  <div ref="bottomEdgeElement" />
24
34
  </div>
25
35
 
26
- <slot v-if="status.isLoading" name="loading-state">
36
+ <slot
37
+ v-if="status.isLoading"
38
+ name="loading-state"
39
+ >
27
40
  <div class="flex h-60 items-center justify-center">
28
- <Icon name="i-svg-spinners:180-ring-with-bg" class="text-primary size-8" />
41
+ <Icon
42
+ name="i-svg-spinners:180-ring-with-bg"
43
+ class="text-primary size-8"
44
+ />
29
45
  </div>
30
46
  </slot>
31
47
 
32
- <div v-if="pageOptions && !isEnableInfiniteScroll" class="mt-4 flex justify-between px-3">
48
+ <div
49
+ v-if="pageOptions && !isEnableInfiniteScroll"
50
+ class="mt-4 flex justify-between px-3"
51
+ >
33
52
  <p class="text-xs text-gray-500">
34
53
  ผลลัพธ์ {{ pageBetween }} ของ {{ totalCountWithComma }} รายการ
35
54
  </p>
36
- <UPagination
55
+ <Pagination
37
56
  v-if="pageOptions.totalPage > 1 && !isSimplePagination && !isHideBottomPagination"
38
- v-model="page"
39
- :page-count="pageOptions.limit"
57
+ :default-page="pageOptions?.currentPage || 1"
58
+ :items-per-page="pageOptions.limit"
40
59
  :total="pageOptions.totalCount"
60
+ @update:page="emits('pageChange', $event)"
41
61
  />
42
62
  <SimplePagination
43
63
  v-if="pageOptions.totalPage > 1 && isSimplePagination"
@@ -48,112 +68,87 @@
48
68
  </div>
49
69
  </template>
50
70
 
51
- <script lang="ts" setup>
52
- import { computed, type PropType } from 'vue'
53
- import { useElementVisibility } from '@vueuse/core'
54
- import { StringHelper } from '#core/utils/StringHelper'
55
- import { ref, useWatchChange, useWatchTrue, watch } from '#imports'
56
- import type { IFlexDeckOptions } from '#core/components/FlexDeck/types'
57
- import Empty from '#core/components/Empty.vue'
58
-
59
- const emits = defineEmits(['pageChange'])
60
-
71
+ <script setup>
72
+ import { computed } from "vue";
73
+ import { useElementVisibility } from "@vueuse/core";
74
+ import { StringHelper } from "#core/utils/StringHelper";
75
+ import { ref, useWatchChange, useWatchTrue, watch } from "#imports";
76
+ import Empty from "#core/components/Empty.vue";
77
+ const emits = defineEmits(["pageChange"]);
61
78
  const props = defineProps({
62
79
  status: {
63
- type: Object as PropType<IFlexDeckOptions['status']>,
64
- required: true,
80
+ type: Object,
81
+ required: true
65
82
  },
66
83
  pageOptions: {
67
- type: Object as PropType<IFlexDeckOptions['pageOptions']>,
68
- required: false,
84
+ type: Object,
85
+ required: false
69
86
  },
70
87
  rawData: {
71
- type: Array as PropType<IFlexDeckOptions['rawData']>,
72
- required: true,
88
+ type: Array,
89
+ required: true
73
90
  },
74
91
  isSimplePagination: {
75
- type: Boolean as PropType<IFlexDeckOptions['isSimplePagination']>,
76
- default: false,
92
+ type: Boolean,
93
+ default: false
77
94
  },
78
95
  isHideTopPagination: {
79
- type: Boolean as PropType<IFlexDeckOptions['isHideTopPagination']>,
80
- default: false,
96
+ type: Boolean,
97
+ default: false
81
98
  },
82
99
  isHideBottomPagination: {
83
- type: Boolean as PropType<IFlexDeckOptions['isHideBottomPagination']>,
84
- default: false,
100
+ type: Boolean,
101
+ default: false
85
102
  },
86
103
  isEnableInfiniteScroll: {
87
- type: Boolean as PropType<IFlexDeckOptions['isEnableInfiniteScroll']>,
88
- default: false,
104
+ type: Boolean,
105
+ default: false
89
106
  },
90
107
  isHideCaption: {
91
- type: Boolean as PropType<IFlexDeckOptions['isHideCaption']>,
92
- default: false,
108
+ type: Boolean,
109
+ default: false
93
110
  },
94
- containerClass: { type: [String, Array, Object] },
95
- })
96
-
97
- const bottomEdgeElement = ref<HTMLElement | null>(null)
98
-
99
- const page = ref(props.pageOptions?.currentPage || 1)
100
-
101
- const innerRawData = ref<object[]>([])
102
-
103
- const targetElement = useElementVisibility(bottomEdgeElement)
104
-
105
- const pageBetween = computed((): string => {
106
- const length = props.rawData?.length
107
-
111
+ containerClass: { type: [String, Array, Object] }
112
+ });
113
+ const bottomEdgeElement = ref(null);
114
+ const page = ref(props.pageOptions?.currentPage || 1);
115
+ const innerRawData = ref([]);
116
+ const targetElement = useElementVisibility(bottomEdgeElement);
117
+ const pageBetween = computed(() => {
118
+ const length = props.rawData?.length;
108
119
  if (length === 0) {
109
- return '0'
120
+ return "0";
110
121
  }
111
-
112
- const start = (props.pageOptions!.currentPage - 1) * props.pageOptions!.limit + 1
113
- const end = start + length - 1
114
-
115
- return `${start} - ${end}`
116
- })
117
-
118
- const totalCountWithComma = computed((): string => {
119
- return !props.pageOptions!.totalCount
120
- ? '0'
121
- : StringHelper.withComma(props.pageOptions!.totalCount)
122
- })
123
-
124
- const totalInnerRawData = computed((): number => {
125
- return innerRawData.value?.length || 0
126
- })
127
-
122
+ const start = (props.pageOptions.currentPage - 1) * props.pageOptions.limit + 1;
123
+ const end = start + length - 1;
124
+ return `${start} - ${end}`;
125
+ });
126
+ const totalCountWithComma = computed(() => {
127
+ return !props.pageOptions.totalCount ? "0" : StringHelper.withComma(props.pageOptions.totalCount);
128
+ });
129
+ const totalInnerRawData = computed(() => {
130
+ return innerRawData.value?.length || 0;
131
+ });
128
132
  useWatchChange(
129
133
  () => props.pageOptions?.currentPage,
130
- (value: number) => {
131
- page.value = value
134
+ (value) => {
135
+ page.value = value;
132
136
  }
133
- )
134
-
137
+ );
135
138
  useWatchTrue(
136
139
  () => props.status.isSuccess,
137
140
  () => {
138
141
  if (props.isEnableInfiniteScroll) {
139
- innerRawData.value = [...(innerRawData.value || []), ...props.rawData]
140
-
141
- return
142
+ innerRawData.value = [...innerRawData.value || [], ...props.rawData];
143
+ return;
142
144
  }
143
-
144
- innerRawData.value = props.rawData
145
+ innerRawData.value = props.rawData;
145
146
  }
146
- )
147
-
148
- watch(page, () => {
149
- emits('pageChange', page.value)
150
- })
151
-
147
+ );
152
148
  watch(targetElement, (value) => {
153
- if (props.status.isLoading || !props.isEnableInfiniteScroll) return
154
-
155
- if (page.value < props.pageOptions!.totalPage && value) {
156
- page.value++
149
+ if (props.status.isLoading || !props.isEnableInfiniteScroll) return;
150
+ if (page.value < props.pageOptions.totalPage && value) {
151
+ page.value++;
157
152
  }
158
- })
153
+ });
159
154
  </script>
@@ -0,0 +1,63 @@
1
+ import { type PropType } from 'vue';
2
+ import type { IFlexDeckOptions } from '#core/components/FlexDeck/types';
3
+ declare var __VLS_1: {}, __VLS_6: {
4
+ key: any;
5
+ row: any;
6
+ }, __VLS_8: {};
7
+ type __VLS_Slots = {} & {
8
+ 'empty-state'?: (props: typeof __VLS_1) => any;
9
+ } & {
10
+ default?: (props: typeof __VLS_6) => any;
11
+ } & {
12
+ 'loading-state'?: (props: typeof __VLS_8) => any;
13
+ };
14
+ declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
15
+ status: {
16
+ type: PropType<IFlexDeckOptions["status"]>;
17
+ required: true;
18
+ };
19
+ pageOptions: {
20
+ type: PropType<IFlexDeckOptions["pageOptions"]>;
21
+ required: false;
22
+ };
23
+ rawData: {
24
+ type: PropType<IFlexDeckOptions["rawData"]>;
25
+ required: true;
26
+ };
27
+ isSimplePagination: {
28
+ type: PropType<IFlexDeckOptions["isSimplePagination"]>;
29
+ default: boolean;
30
+ };
31
+ isHideTopPagination: {
32
+ type: PropType<IFlexDeckOptions["isHideTopPagination"]>;
33
+ default: boolean;
34
+ };
35
+ isHideBottomPagination: {
36
+ type: PropType<IFlexDeckOptions["isHideBottomPagination"]>;
37
+ default: boolean;
38
+ };
39
+ isEnableInfiniteScroll: {
40
+ type: PropType<IFlexDeckOptions["isEnableInfiniteScroll"]>;
41
+ default: boolean;
42
+ };
43
+ isHideCaption: {
44
+ type: PropType<IFlexDeckOptions["isHideCaption"]>;
45
+ default: boolean;
46
+ };
47
+ containerClass: {
48
+ type: (ArrayConstructor | ObjectConstructor | StringConstructor)[];
49
+ };
50
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any, string, import("vue").PublicProps, any, {
51
+ isHideCaption: boolean | undefined;
52
+ isHideBottomPagination: boolean | undefined;
53
+ isHideTopPagination: boolean | undefined;
54
+ isSimplePagination: boolean | undefined;
55
+ isEnableInfiniteScroll: boolean | undefined;
56
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
57
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
58
+ export default _default;
59
+ type __VLS_WithSlots<T, S> = T & {
60
+ new (): {
61
+ $slots: S;
62
+ };
63
+ };
@@ -1,10 +1,13 @@
1
1
  <template>
2
2
  <div>
3
- <div v-if="options.isEnabledSearch" class="mb-4 flex justify-end">
4
- <UInput
3
+ <div
4
+ v-if="options.isEnabledSearch"
5
+ class="mb-4 flex justify-end"
6
+ >
7
+ <Input
5
8
  v-model="q"
6
9
  icon="i-heroicons-magnifying-glass"
7
- :placeholder="options.searchPlaceholder || 'ค้นหา...'"
10
+ :placeholder="options.searchPlaceholder || '\u0E04\u0E49\u0E19\u0E2B\u0E32...'"
8
11
  />
9
12
  </div>
10
13
  <Base
@@ -18,51 +21,47 @@
18
21
  :container-class="containerClass"
19
22
  @page-change="onPageChange"
20
23
  >
21
- <template v-for="(_, slot) of $slots" #[slot]="slotProps">
22
- <slot :name="slot" v-bind="slotProps || {}" />
24
+ <template
25
+ v-for="(_, slot) of $slots"
26
+ #[slot]="slotProps"
27
+ >
28
+ <slot
29
+ :name="slot"
30
+ v-bind="slotProps || {}"
31
+ />
23
32
  </template>
24
33
  </Base>
25
34
  </div>
26
35
  </template>
27
- <script lang="ts" setup>
28
- import { type PropType } from 'vue'
29
- import { _debounce, computed, ref, watch } from '#imports'
30
- import { useCoreConfig } from '#core/composables/useConfig'
31
- import Base from '#core/components/FlexDeck/Base.vue'
32
- import type { IFlexDeckOptions } from '#core/components/FlexDeck/types'
33
-
34
- defineSlots<{
35
- default: (props: { row: any }) => any
36
- 'empty-state': () => any
37
- 'loading-state': () => any
38
- }>()
39
-
40
- const emits = defineEmits<{
41
- (event: 'pageChange', page: number): void
42
- (event: 'search', q: string): void
43
- }>()
44
36
 
37
+ <script setup>
38
+ import { _debounce, computed, ref, watch } from "#imports";
39
+ import { useCoreConfig } from "#core/composables/useConfig";
40
+ import Base from "#core/components/FlexDeck/Base.vue";
41
+ defineSlots();
42
+ const emits = defineEmits(["pageChange", "search"]);
45
43
  const props = defineProps({
46
- options: { type: Object as PropType<IFlexDeckOptions>, required: true },
47
- containerClass: { type: [String, Array, Object], default: '' },
48
- })
49
-
50
- const coreConfig = useCoreConfig()
51
-
52
- const q = ref(props.options?.pageOptions.search ?? '')
53
-
44
+ options: {
45
+ type: Object,
46
+ required: true
47
+ },
48
+ containerClass: {
49
+ type: [String, Array, Object],
50
+ default: ""
51
+ }
52
+ });
53
+ const coreConfig = useCoreConfig();
54
+ const q = ref(props.options?.pageOptions.search ?? "");
54
55
  const isShowSimplePagination = computed(
55
- (): boolean => props.options.isSimplePagination ?? coreConfig.is_simple_pagination
56
- )
57
-
56
+ () => props.options.isSimplePagination ?? coreConfig.is_simple_pagination
57
+ );
58
58
  watch(
59
59
  q,
60
60
  _debounce((value) => {
61
- emits('search', value)
61
+ emits("search", value);
62
62
  }, 500)
63
- )
64
-
65
- const onPageChange = (page: number) => {
66
- emits('pageChange', page)
67
- }
63
+ );
64
+ const onPageChange = (page) => {
65
+ emits("pageChange", page);
66
+ };
68
67
  </script>
@@ -0,0 +1,43 @@
1
+ import type { PropType } from 'vue';
2
+ import type { IFlexDeckOptions } from '#core/components/FlexDeck/types';
3
+ type __VLS_Slots = {
4
+ 'default': (props: {
5
+ row: any;
6
+ }) => any;
7
+ 'empty-state': () => any;
8
+ 'loading-state': () => any;
9
+ };
10
+ declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
11
+ options: {
12
+ type: PropType<IFlexDeckOptions>;
13
+ required: true;
14
+ };
15
+ containerClass: {
16
+ type: (ArrayConstructor | ObjectConstructor | StringConstructor)[];
17
+ default: string;
18
+ };
19
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
20
+ search: (q: string) => any;
21
+ pageChange: (page: number) => any;
22
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
23
+ options: {
24
+ type: PropType<IFlexDeckOptions>;
25
+ required: true;
26
+ };
27
+ containerClass: {
28
+ type: (ArrayConstructor | ObjectConstructor | StringConstructor)[];
29
+ default: string;
30
+ };
31
+ }>> & Readonly<{
32
+ onSearch?: ((q: string) => any) | undefined;
33
+ onPageChange?: ((page: number) => any) | undefined;
34
+ }>, {
35
+ containerClass: string | Record<string, any> | unknown[];
36
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
37
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
38
+ export default _default;
39
+ type __VLS_WithSlots<T, S> = T & {
40
+ new (): {
41
+ $slots: S;
42
+ };
43
+ };
@@ -1,23 +1,35 @@
1
1
  <template>
2
- <UFormGroup
2
+ <FormField
3
3
  :label="label"
4
4
  :name="name"
5
5
  :description="description"
6
6
  :hint="hint"
7
- :size="size as FormGroupSize"
8
7
  :data-testid="name"
9
8
  :help="help"
10
9
  :error="errorMessage"
11
- :required="!!isRequired"
10
+ :required="!!required"
12
11
  :ui="containerUi"
13
12
  >
14
13
  <slot />
15
- </UFormGroup>
14
+ </FormField>
16
15
  </template>
17
16
 
18
- <script lang="ts" setup>
19
- import { type IFieldProps } from '#core/components/Form/types'
20
- import type { FormGroupSize } from '#ui/types'
21
-
22
- defineProps<IFieldProps>()
17
+ <script setup>
18
+ defineProps({
19
+ form: { type: Object, required: false },
20
+ name: { type: String, required: true },
21
+ errorMessage: { type: String, required: false },
22
+ label: { type: null, required: false },
23
+ description: { type: String, required: false },
24
+ hint: { type: String, required: false },
25
+ rules: { type: null, required: false },
26
+ autoFocus: { type: Boolean, required: false },
27
+ placeholder: { type: String, required: false },
28
+ disabled: { type: Boolean, required: false },
29
+ readonly: { type: Boolean, required: false },
30
+ required: { type: Boolean, required: false },
31
+ help: { type: String, required: false },
32
+ ui: { type: null, required: false },
33
+ containerUi: { type: null, required: false }
34
+ });
23
35
  </script>
@@ -0,0 +1,16 @@
1
+ import type { IFieldProps } from '#core/components/Form/types';
2
+ type __VLS_Props = IFieldProps & {
3
+ containerUi?: any;
4
+ };
5
+ declare var __VLS_6: {};
6
+ type __VLS_Slots = {} & {
7
+ default?: (props: typeof __VLS_6) => any;
8
+ };
9
+ declare const __VLS_component: 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>;
10
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
11
+ export default _default;
12
+ type __VLS_WithSlots<T, S> = T & {
13
+ new (): {
14
+ $slots: S;
15
+ };
16
+ };