@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
@@ -0,0 +1,312 @@
1
+ <template>
2
+ <div
3
+ v-show="isShowDevTools"
4
+ ref="devToolsRef"
5
+ class="fixed z-50 overflow-hidden rounded-lg border border-neutral-300 bg-white opacity-80 shadow-2xl"
6
+ :style="devToolsDynamicStyles"
7
+ >
8
+ <!-- Draggable Title Bar -->
9
+ <div class="flex items-center justify-between px-2 py-1 select-none">
10
+ <p
11
+ class="text-sm font-semibold cursor-move flex-grow"
12
+ @mousedown.prevent="handleDragStart"
13
+ >
14
+ Debug Tools
15
+ </p>
16
+ <div class="flex items-center">
17
+ <Button
18
+ icon="i-heroicons-arrow-path"
19
+ size="xs"
20
+ color="neutral"
21
+ variant="ghost"
22
+ class="mr-1"
23
+ title="Reset Position & Size"
24
+ @click.stop="resetDevToolsState"
25
+ />
26
+ <Button
27
+ icon="i-heroicons-x-mark"
28
+ size="xs"
29
+ color="neutral"
30
+ variant="ghost"
31
+ title="Close DevTools"
32
+ @click.stop="closeDevTools"
33
+ />
34
+ </div>
35
+ </div>
36
+ <hr class="text-neutral-300" />
37
+ <!-- Content Area Target for Logs -->
38
+ <div
39
+ id="dev-logs"
40
+ class="flex flex-col flex-1 space-y-1 p-2 overflow-auto"
41
+ :style="{ height: `calc(${devToolsHeight} - 40px)` }"
42
+ />
43
+
44
+ <!-- Resize Handles -->
45
+ <div
46
+ v-if="!isDragging"
47
+ class="resize-handles"
48
+ >
49
+ <div
50
+ class="resize-handle top-left"
51
+ @mousedown.prevent="handleResizeStart('top-left', $event)"
52
+ />
53
+ <div
54
+ class="resize-handle top-center"
55
+ @mousedown.prevent="handleResizeStart('top', $event)"
56
+ />
57
+ <div
58
+ class="resize-handle top-right"
59
+ @mousedown.prevent="handleResizeStart('top-right', $event)"
60
+ />
61
+ <div
62
+ class="resize-handle middle-left"
63
+ @mousedown.prevent="handleResizeStart('left', $event)"
64
+ />
65
+ <div
66
+ class="resize-handle middle-right"
67
+ @mousedown.prevent="handleResizeStart('right', $event)"
68
+ />
69
+ <div
70
+ class="resize-handle bottom-left"
71
+ @mousedown.prevent="handleResizeStart('bottom-left', $event)"
72
+ />
73
+ <div
74
+ class="resize-handle bottom-center"
75
+ @mousedown.prevent="handleResizeStart('bottom', $event)"
76
+ />
77
+ <div
78
+ class="resize-handle bottom-right"
79
+ @mousedown.prevent="handleResizeStart('bottom-right', $event)"
80
+ />
81
+ </div>
82
+ </div>
83
+
84
+ <!-- Toggle button for this DevToolsWindow -->
85
+ <div
86
+ class="fixed bottom-1 right-1 z-[99999]"
87
+ >
88
+ <Button
89
+ :icon="isShowDevTools ? 'heroicons:x-mark' : 'heroicons:information-circle'"
90
+ color="info"
91
+ square
92
+ size="sm"
93
+ :ui="{ base: 'rounded-full' }"
94
+ @click="toggleDevTools"
95
+ />
96
+ </div>
97
+ </template>
98
+
99
+ <script setup>
100
+ import { ref, onMounted, watch, onUnmounted, computed } from "vue";
101
+ import { useStorage } from "@vueuse/core";
102
+ const isShowDevTools = useStorage("isShowDevTools", false);
103
+ const DEFAULT_WIDTH = "300px";
104
+ const DEFAULT_HEIGHT = "400px";
105
+ const DEFAULT_POSITION = {
106
+ top: "auto",
107
+ left: "auto",
108
+ bottom: "2.5rem",
109
+ right: "0.5rem"
110
+ };
111
+ const devToolsWidth = useStorage("devToolsWidth", DEFAULT_WIDTH);
112
+ const devToolsHeight = useStorage("devToolsHeight", DEFAULT_HEIGHT);
113
+ const devToolsPosition = useStorage("devToolsPosition", JSON.parse(JSON.stringify(DEFAULT_POSITION)));
114
+ const devToolsRef = ref(null);
115
+ const isDragging = ref(false);
116
+ const dragStartX = ref(0);
117
+ const dragStartY = ref(0);
118
+ const initialDragPosition = ref({
119
+ top: 0,
120
+ left: 0
121
+ });
122
+ const isResizing = ref(false);
123
+ const activeResizeHandle = ref(null);
124
+ const initialResizeState = ref({
125
+ width: 0,
126
+ height: 0,
127
+ top: 0,
128
+ left: 0,
129
+ mouseX: 0,
130
+ mouseY: 0
131
+ });
132
+ const MIN_WIDTH = 150;
133
+ const MIN_HEIGHT = 100;
134
+ const devToolsDynamicStyles = computed(() => {
135
+ const styles = {
136
+ width: devToolsWidth.value,
137
+ height: devToolsHeight.value,
138
+ maxWidth: "100vw",
139
+ maxHeight: "100vh"
140
+ };
141
+ if (devToolsPosition.value.top !== "auto") {
142
+ styles.top = devToolsPosition.value.top;
143
+ styles.bottom = "auto";
144
+ } else {
145
+ styles.bottom = devToolsPosition.value.bottom;
146
+ }
147
+ if (devToolsPosition.value.left !== "auto") {
148
+ styles.left = devToolsPosition.value.left;
149
+ styles.right = "auto";
150
+ } else {
151
+ styles.right = devToolsPosition.value.right;
152
+ }
153
+ return styles;
154
+ });
155
+ const toggleDevTools = () => {
156
+ isShowDevTools.value = !isShowDevTools.value;
157
+ };
158
+ const closeDevTools = () => {
159
+ isShowDevTools.value = false;
160
+ };
161
+ const handleDragStart = (event) => {
162
+ if (!devToolsRef.value || event.button !== 0) return;
163
+ isDragging.value = true;
164
+ const rect = devToolsRef.value.getBoundingClientRect();
165
+ initialDragPosition.value = {
166
+ top: rect.top,
167
+ left: rect.left
168
+ };
169
+ dragStartX.value = event.clientX;
170
+ dragStartY.value = event.clientY;
171
+ document.addEventListener("mousemove", handleDragMove);
172
+ document.addEventListener("mouseup", handleDragEnd);
173
+ };
174
+ const handleDragMove = (event) => {
175
+ if (!isDragging.value || !devToolsRef.value) return;
176
+ const deltaX = event.clientX - dragStartX.value;
177
+ const deltaY = event.clientY - dragStartY.value;
178
+ let newTop = initialDragPosition.value.top + deltaY;
179
+ let newLeft = initialDragPosition.value.left + deltaX;
180
+ const elHeight = devToolsRef.value.offsetHeight;
181
+ const elWidth = devToolsRef.value.offsetWidth;
182
+ newTop = Math.max(0, Math.min(newTop, window.innerHeight - elHeight));
183
+ newLeft = Math.max(0, Math.min(newLeft, window.innerWidth - elWidth));
184
+ devToolsPosition.value = {
185
+ top: `${newTop}px`,
186
+ left: `${newLeft}px`,
187
+ bottom: "auto",
188
+ right: "auto"
189
+ };
190
+ };
191
+ const handleDragEnd = () => {
192
+ isDragging.value = false;
193
+ document.removeEventListener("mousemove", handleDragMove);
194
+ document.removeEventListener("mouseup", handleDragEnd);
195
+ };
196
+ const handleResizeStart = (handle, event) => {
197
+ if (!devToolsRef.value || event.button !== 0) return;
198
+ isResizing.value = true;
199
+ activeResizeHandle.value = handle;
200
+ const rect = devToolsRef.value.getBoundingClientRect();
201
+ initialResizeState.value = {
202
+ width: rect.width,
203
+ height: rect.height,
204
+ top: rect.top,
205
+ left: rect.left,
206
+ mouseX: event.clientX,
207
+ mouseY: event.clientY
208
+ };
209
+ document.addEventListener("mousemove", handleResizeMove);
210
+ document.addEventListener("mouseup", handleResizeEnd);
211
+ };
212
+ const handleResizeMove = (event) => {
213
+ if (!isResizing.value || !devToolsRef.value || !activeResizeHandle.value) return;
214
+ const {
215
+ width,
216
+ height,
217
+ top,
218
+ left,
219
+ mouseX,
220
+ mouseY
221
+ } = initialResizeState.value;
222
+ const deltaX = event.clientX - mouseX;
223
+ const deltaY = event.clientY - mouseY;
224
+ let newWidth = width;
225
+ let newHeight = height;
226
+ let newTop = top;
227
+ let newLeft = left;
228
+ if (activeResizeHandle.value.includes("right")) {
229
+ newWidth = Math.max(MIN_WIDTH, width + deltaX);
230
+ }
231
+ if (activeResizeHandle.value.includes("bottom")) {
232
+ newHeight = Math.max(MIN_HEIGHT, height + deltaY);
233
+ }
234
+ if (activeResizeHandle.value.includes("left")) {
235
+ newWidth = Math.max(MIN_WIDTH, width - deltaX);
236
+ if (newWidth > MIN_WIDTH) {
237
+ newLeft = left + deltaX;
238
+ } else {
239
+ newLeft = left + (width - MIN_WIDTH);
240
+ }
241
+ }
242
+ if (activeResizeHandle.value.includes("top")) {
243
+ newHeight = Math.max(MIN_HEIGHT, height - deltaY);
244
+ if (newHeight > MIN_HEIGHT) {
245
+ newTop = top + deltaY;
246
+ } else {
247
+ newTop = top + (height - MIN_HEIGHT);
248
+ }
249
+ }
250
+ if (newTop !== top || newLeft !== left) {
251
+ devToolsPosition.value = {
252
+ top: `${newTop}px`,
253
+ left: `${newLeft}px`,
254
+ bottom: "auto",
255
+ right: "auto"
256
+ };
257
+ }
258
+ devToolsWidth.value = `${newWidth}px`;
259
+ devToolsHeight.value = `${newHeight}px`;
260
+ };
261
+ const handleResizeEnd = () => {
262
+ isResizing.value = false;
263
+ activeResizeHandle.value = null;
264
+ document.removeEventListener("mousemove", handleResizeMove);
265
+ document.removeEventListener("mouseup", handleResizeEnd);
266
+ };
267
+ const resetDevToolsState = () => {
268
+ devToolsWidth.value = DEFAULT_WIDTH;
269
+ devToolsHeight.value = DEFAULT_HEIGHT;
270
+ devToolsPosition.value = JSON.parse(JSON.stringify(DEFAULT_POSITION));
271
+ if (devToolsRef.value) {
272
+ const newStyles = {
273
+ width: DEFAULT_WIDTH,
274
+ height: DEFAULT_HEIGHT,
275
+ ...DEFAULT_POSITION
276
+ };
277
+ Object.keys(newStyles).forEach((key) => {
278
+ devToolsRef.value.style[key] = newStyles[key];
279
+ });
280
+ if (newStyles.top === "auto") {
281
+ devToolsRef.value.style.bottom = newStyles.bottom;
282
+ } else {
283
+ devToolsRef.value.style.bottom = "auto";
284
+ }
285
+ if (newStyles.left === "auto") {
286
+ devToolsRef.value.style.right = newStyles.right;
287
+ } else {
288
+ devToolsRef.value.style.right = "auto";
289
+ }
290
+ }
291
+ };
292
+ onMounted(() => {
293
+ watch(isShowDevTools, (newValue) => {
294
+ if (newValue && devToolsRef.value) {
295
+ const currentStyle = devToolsDynamicStyles.value;
296
+ Object.keys(currentStyle).forEach((key) => {
297
+ if (devToolsRef.value) {
298
+ devToolsRef.value.style[key] = currentStyle[key];
299
+ }
300
+ });
301
+ }
302
+ }, { immediate: true });
303
+ });
304
+ onUnmounted(() => {
305
+ if (isDragging.value) handleDragEnd();
306
+ if (isResizing.value) handleResizeEnd();
307
+ });
308
+ </script>
309
+
310
+ <style scoped>
311
+ .resize-handles div{height:10px;position:absolute;width:10px;z-index:1}.resize-handle.top-left{cursor:nwse-resize;left:-5px;top:-5px}.resize-handle.top-center{cursor:ns-resize;left:50%;top:-5px;transform:translateX(-50%)}.resize-handle.top-right{cursor:nesw-resize;right:-5px;top:-5px}.resize-handle.middle-left{cursor:ew-resize;left:-5px;top:50%;transform:translateY(-50%)}.resize-handle.middle-right{cursor:ew-resize;right:-5px;top:50%;transform:translateY(-50%)}.resize-handle.bottom-left{bottom:-5px;cursor:nesw-resize;left:-5px}.resize-handle.bottom-center{bottom:-5px;cursor:ns-resize;left:50%;transform:translateX(-50%)}.resize-handle.bottom-right{bottom:-5px;cursor:nwse-resize;right:-5px}#dev-logs{overscroll-behavior:contain}#dev-logs:empty{align-items:center;display:flex;height:100%;justify-content:center}#dev-logs:empty:before{color:#9ca3af;content:"No logs to display.";font-style:italic}
312
+ </style>
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -1,110 +1,77 @@
1
- <template>
2
- <Modal
3
- v-if="dialog.meta?.type"
4
- v-model="dialog.isShow"
5
- :ui="{
6
- innerWrapper: 'p-6',
7
- }"
8
- is-hide-close-btn
9
- prevent-close
10
- >
11
- <UNotification
12
- :ui="{
13
- padding: '',
14
- shadow: '',
15
- ring: '',
16
- icon: {
17
- base: 'flex-shrink-0 w-10 h-10',
18
- },
19
- }"
20
- :icon="getIcon"
21
- :description="dialog.meta?.description"
22
- :timeout="0"
23
- :title="dialog.meta?.title"
24
- :color="getColor"
25
- close-button=""
26
- />
27
- <div :class="[uiConfig.actionGroup?.wrapper]">
28
- <Button
29
- v-if="dialog.meta?.isShowCancelBtn"
30
- :color="uiConfig.actionGroup?.cancelColor"
31
- :variant="uiConfig.actionGroup?.cancelVariant"
32
- :class="[dialog.meta.cancelButtonClassName]"
33
- type="button"
34
- @click="dialog.closeDialogCancel"
35
- >
36
- {{ dialog.meta?.cancelText || 'ยกเลิก' }}
37
- </Button>
38
- <Button
39
- :color="uiConfig.actionGroup?.confirmColor"
40
- :variant="uiConfig.actionGroup?.confirmVariant"
41
- :class="[
42
- {
43
- 'btn-success': dialog.meta?.type === DialogType.SUCCESS,
44
- 'btn-danger': dialog.meta?.type === DialogType.ERROR,
45
- 'btn-info': dialog.meta?.type === DialogType.INFO,
46
- 'btn-warning': dialog.meta?.type === DialogType.WARNING,
47
- 'mr-3': dialog.meta.isShowCancelBtn,
48
- },
49
- dialog.meta.confirmButtonClassName,
50
- ]"
51
- @click="dialog.closeDialogProceed"
52
- >
53
- {{ dialog.meta?.confirmText || 'ตกลง' }}
54
- </Button>
55
- </div>
56
- </Modal>
57
- </template>
58
- <script lang="tsx" setup>
59
- import { DialogType, useDialog } from '#core/composables/useDialog'
60
- import { computed } from 'vue'
61
- import { useUiConfig } from '#core/composables/useConfig'
62
- import { notification } from '#core/ui.config/notification'
63
-
64
- const dialog = useDialog()
65
- const uiConfig = useUiConfig<typeof notification>(notification, 'notification')
66
-
67
- const getColor = computed(() => {
68
- if (dialog.meta?.type === DialogType.SUCCESS) {
69
- return 'success'
70
- }
71
-
72
- if (dialog.meta?.type === DialogType.ERROR) {
73
- return 'danger'
74
- }
75
-
76
- if (dialog.meta?.type === DialogType.INFO) {
77
- return 'info'
78
- }
79
-
80
- if (dialog.meta?.type === DialogType.WARNING) {
81
- return 'warning'
82
- }
83
-
84
- return ''
85
- })
86
-
87
- const getIcon = computed(() => {
88
- if (dialog.meta?.isHideIcon) {
89
- return ''
90
- }
91
-
92
- if (dialog.meta?.type === DialogType.SUCCESS) {
93
- return 'i-heroicons-check-circle'
94
- }
95
-
96
- if (dialog.meta?.type === DialogType.ERROR) {
97
- return 'i-heroicons-x-circle'
98
- }
99
-
100
- if (dialog.meta?.type === DialogType.INFO) {
101
- return 'i-heroicons-information-circle'
102
- }
103
-
104
- if (dialog.meta?.type === DialogType.WARNING) {
105
- return 'i-heroicons-exclamation-circle'
106
- }
107
-
108
- return ''
109
- })
110
- </script>
1
+ <template>
2
+ <Modal
3
+ :dismissible="false"
4
+ :close="false"
5
+ >
6
+ <template #body>
7
+ <div :class="ui.base()">
8
+ <Icon
9
+ v-if="!isHideIcon"
10
+ :name="getIcon"
11
+ :class="ui.icon()"
12
+ />
13
+ <div :class="ui.wrapper()">
14
+ <p :class="ui.title()">
15
+ {{ title }}
16
+ </p>
17
+ <p
18
+ v-if="description"
19
+ :class="ui.description()"
20
+ >
21
+ {{ description }}
22
+ </p>
23
+ <div :class="ui.buttonGroup()">
24
+ <Button
25
+ v-if="isShowCancelBtn"
26
+ type="button"
27
+ color="neutral"
28
+ variant="outline"
29
+ :class="ui.cancelButton()"
30
+ @click="emits('close', false)"
31
+ >
32
+ {{ cancelText }}
33
+ </Button>
34
+ <Button
35
+ type="button"
36
+ :color="type"
37
+ :class="ui.confirmButton()"
38
+ @click="emits('close', true)"
39
+ >
40
+ {{ confirmText }}
41
+ </Button>
42
+ </div>
43
+ </div>
44
+ </div>
45
+ </template>
46
+ </Modal>
47
+ </template>
48
+
49
+ <script setup>
50
+ import { computed } from "vue";
51
+ import { DialogType } from "#core/composables/useDialog";
52
+ import { useUiConfig } from "#core/composables/useConfig";
53
+ import { dialogTheme } from "#core/theme/dialog";
54
+ const emits = defineEmits();
55
+ const props = withDefaults(defineProps(), {
56
+ confirmText: "\u0E15\u0E01\u0E25\u0E07",
57
+ cancelText: "\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01"
58
+ });
59
+ const getIcon = computed(() => {
60
+ if (props.icon) {
61
+ return props.icon;
62
+ }
63
+ switch (props.type) {
64
+ case DialogType.SUCCESS:
65
+ return "i-heroicons-check-circle";
66
+ case DialogType.ERROR:
67
+ return "i-heroicons-x-circle";
68
+ case DialogType.INFO:
69
+ return "i-heroicons-information-circle";
70
+ case DialogType.WARNING:
71
+ return "i-heroicons-exclamation-circle";
72
+ default:
73
+ return "";
74
+ }
75
+ });
76
+ const ui = computed(() => useUiConfig(dialogTheme, "dialog")({ color: props.type }));
77
+ </script>
@@ -0,0 +1,10 @@
1
+ import { type IDialogMetaItem } from '#core/composables/useDialog';
2
+ declare const _default: import("vue").DefineComponent<IDialogMetaItem, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
3
+ close: (args_0: boolean) => any;
4
+ }, string, import("vue").PublicProps, Readonly<IDialogMetaItem> & Readonly<{
5
+ onClose?: ((args_0: boolean) => any) | undefined;
6
+ }>, {
7
+ confirmText: string;
8
+ cancelText: string;
9
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ export default _default;
@@ -1,18 +1,33 @@
1
- <template>
2
- <div class="flex flex-col items-center justify-center py-6 text-gray-400">
3
- <Icon :name="icon!" class="text-[72px]" />
4
- <p class="mt-2" v-html="message!" />
5
- </div>
6
- </template>
7
- <script lang="ts" setup>
8
- withDefaults(
9
- defineProps<{
10
- message?: any
11
- icon?: string
12
- }>(),
13
- {
14
- message: 'ไม่พบข้อมูล!',
15
- icon: 'ph:table-thin',
16
- }
17
- )
18
- </script>
1
+ <template>
2
+ <div
3
+ :class="theme.base({
4
+ class: [ui?.base, props.class]
5
+ })"
6
+ >
7
+ <Icon
8
+ :name="icon"
9
+ :class="theme.icon({
10
+ class: [ui?.icon]
11
+ })"
12
+ />
13
+ <p
14
+ :class="theme.message({
15
+ class: [ui?.message]
16
+ })"
17
+ v-html="message"
18
+ />
19
+ </div>
20
+ </template>
21
+
22
+ <script setup>
23
+ import { computed } from "vue";
24
+ import { useUiConfig } from "#core/composables/useConfig";
25
+ import { emptyTheme } from "#core/theme/empty";
26
+ const props = defineProps({
27
+ message: { type: null, required: false, default: "\u0E44\u0E21\u0E48\u0E1E\u0E1A\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25!" },
28
+ icon: { type: String, required: false, default: "ph:table-thin" },
29
+ ui: { type: null, required: false },
30
+ class: { type: null, required: false }
31
+ });
32
+ const theme = computed(() => useUiConfig(emptyTheme, "empty")());
33
+ </script>
@@ -0,0 +1,12 @@
1
+ import { emptyTheme } from '#core/theme/empty';
2
+ type __VLS_Props = {
3
+ message?: any;
4
+ icon?: string;
5
+ ui?: typeof emptyTheme['slots'];
6
+ class?: any;
7
+ };
8
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
9
+ icon: string;
10
+ message: any;
11
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ export default _default;