@antify/ui-module 1.7.3 → 1.8.2

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 (364) hide show
  1. package/README.md +43 -52
  2. package/dist/module.d.mts +1 -251
  3. package/dist/module.d.ts +1 -251
  4. package/dist/module.json +1 -1
  5. package/dist/module.mjs +97 -418
  6. package/dist/runtime/composables/useUiClient.d.ts +2 -2
  7. package/dist/runtime/composables/useUiClient.mjs +1 -2
  8. package/dist/runtime/plugins/ui-module.mjs +3 -2
  9. package/dist/runtime/tailwind.config.d.ts +2 -3
  10. package/dist/runtime/tailwind.config.mjs +20 -204
  11. package/dist/types.d.mts +1 -1
  12. package/dist/types.d.ts +1 -1
  13. package/package.json +10 -41
  14. package/dist/runtime/components/AntAccordion.vue +0 -64
  15. package/dist/runtime/components/AntAccordionItem.vue +0 -81
  16. package/dist/runtime/components/AntAlert.vue +0 -146
  17. package/dist/runtime/components/AntCard.vue +0 -34
  18. package/dist/runtime/components/AntContent.vue +0 -16
  19. package/dist/runtime/components/AntDropdown.vue +0 -79
  20. package/dist/runtime/components/AntIcon.vue +0 -56
  21. package/dist/runtime/components/AntKeycap.vue +0 -45
  22. package/dist/runtime/components/AntListGroup.vue +0 -24
  23. package/dist/runtime/components/AntListGroupItem.vue +0 -83
  24. package/dist/runtime/components/AntModal.vue +0 -88
  25. package/dist/runtime/components/AntPagination.vue +0 -206
  26. package/dist/runtime/components/AntPopover.vue +0 -114
  27. package/dist/runtime/components/AntSkeleton.vue +0 -38
  28. package/dist/runtime/components/AntSpinner.vue +0 -101
  29. package/dist/runtime/components/AntTag.vue +0 -114
  30. package/dist/runtime/components/AntToast.vue +0 -119
  31. package/dist/runtime/components/AntToaster.vue +0 -51
  32. package/dist/runtime/components/AntTooltip.vue +0 -189
  33. package/dist/runtime/components/Main.mdx +0 -11
  34. package/dist/runtime/components/Main.stories.d.ts +0 -7
  35. package/dist/runtime/components/Main.stories.mjs +0 -8
  36. package/dist/runtime/components/__stories/AntAccordion.stories.d.ts +0 -9
  37. package/dist/runtime/components/__stories/AntAccordion.stories.mjs +0 -101
  38. package/dist/runtime/components/__stories/AntAlert.stories.d.ts +0 -11
  39. package/dist/runtime/components/__stories/AntAlert.stories.mjs +0 -81
  40. package/dist/runtime/components/__stories/AntCard.stories.d.ts +0 -7
  41. package/dist/runtime/components/__stories/AntCard.stories.mjs +0 -87
  42. package/dist/runtime/components/__stories/AntContent.stories.d.ts +0 -6
  43. package/dist/runtime/components/__stories/AntContent.stories.mjs +0 -26
  44. package/dist/runtime/components/__stories/AntDropdown.stories.d.ts +0 -6
  45. package/dist/runtime/components/__stories/AntDropdown.stories.mjs +0 -52
  46. package/dist/runtime/components/__stories/AntIcon.stories.d.ts +0 -8
  47. package/dist/runtime/components/__stories/AntIcon.stories.mjs +0 -93
  48. package/dist/runtime/components/__stories/AntKeycap.stories.d.ts +0 -9
  49. package/dist/runtime/components/__stories/AntKeycap.stories.mjs +0 -69
  50. package/dist/runtime/components/__stories/AntListGroup.stories.d.ts +0 -7
  51. package/dist/runtime/components/__stories/AntListGroup.stories.mjs +0 -36
  52. package/dist/runtime/components/__stories/AntListGroupItem.stories.d.ts +0 -10
  53. package/dist/runtime/components/__stories/AntListGroupItem.stories.mjs +0 -62
  54. package/dist/runtime/components/__stories/AntModal.stories.d.ts +0 -7
  55. package/dist/runtime/components/__stories/AntModal.stories.mjs +0 -78
  56. package/dist/runtime/components/__stories/AntPagination.stories.d.ts +0 -8
  57. package/dist/runtime/components/__stories/AntPagination.stories.mjs +0 -39
  58. package/dist/runtime/components/__stories/AntPopover.stories.d.ts +0 -6
  59. package/dist/runtime/components/__stories/AntPopover.stories.mjs +0 -47
  60. package/dist/runtime/components/__stories/AntSkeleton.stories.d.ts +0 -8
  61. package/dist/runtime/components/__stories/AntSkeleton.stories.mjs +0 -43
  62. package/dist/runtime/components/__stories/AntSpinner.stories.d.ts +0 -6
  63. package/dist/runtime/components/__stories/AntSpinner.stories.mjs +0 -34
  64. package/dist/runtime/components/__stories/AntTag.stories.d.ts +0 -7
  65. package/dist/runtime/components/__stories/AntTag.stories.mjs +0 -43
  66. package/dist/runtime/components/__stories/AntToast.stories.d.ts +0 -8
  67. package/dist/runtime/components/__stories/AntToast.stories.mjs +0 -66
  68. package/dist/runtime/components/__stories/AntToaster.stories.d.ts +0 -34
  69. package/dist/runtime/components/__stories/AntToaster.stories.mjs +0 -42
  70. package/dist/runtime/components/__stories/AntTooltip.stories.d.ts +0 -16
  71. package/dist/runtime/components/__stories/AntTooltip.stories.mjs +0 -241
  72. package/dist/runtime/components/__types/AntAccordion.types.d.ts +0 -4
  73. package/dist/runtime/components/__types/AntAccordion.types.mjs +0 -5
  74. package/dist/runtime/components/__types/AntIcon.types.d.ts +0 -8
  75. package/dist/runtime/components/__types/AntIcon.types.mjs +0 -9
  76. package/dist/runtime/components/__types/AntKeycap.types.d.ts +0 -4
  77. package/dist/runtime/components/__types/AntKeycap.types.mjs +0 -5
  78. package/dist/runtime/components/__types/AntListGroupItem.types.d.ts +0 -9
  79. package/dist/runtime/components/__types/AntListGroupItem.types.mjs +0 -10
  80. package/dist/runtime/components/__types/AntSpinner.types.d.ts +0 -10
  81. package/dist/runtime/components/__types/AntSpinner.types.mjs +0 -11
  82. package/dist/runtime/components/__types/AntTag.types.d.ts +0 -17
  83. package/dist/runtime/components/__types/AntTag.types.mjs +0 -19
  84. package/dist/runtime/components/__types/AntToaster.types.d.ts +0 -8
  85. package/dist/runtime/components/__types/AntToaster.types.mjs +0 -0
  86. package/dist/runtime/components/__types/index.d.ts +0 -7
  87. package/dist/runtime/components/__types/index.mjs +0 -7
  88. package/dist/runtime/components/buttons/AntActionButton.vue +0 -74
  89. package/dist/runtime/components/buttons/AntButton.vue +0 -257
  90. package/dist/runtime/components/buttons/AntCreateButton.vue +0 -54
  91. package/dist/runtime/components/buttons/AntDeleteButton.vue +0 -54
  92. package/dist/runtime/components/buttons/AntDuplicateButton.vue +0 -54
  93. package/dist/runtime/components/buttons/AntEditButton.vue +0 -54
  94. package/dist/runtime/components/buttons/AntSaveAndNewButton.vue +0 -56
  95. package/dist/runtime/components/buttons/AntSaveButton.vue +0 -55
  96. package/dist/runtime/components/buttons/__stories/AntActionButton.stories.d.ts +0 -11
  97. package/dist/runtime/components/buttons/__stories/AntActionButton.stories.mjs +0 -86
  98. package/dist/runtime/components/buttons/__stories/AntButton.stories.d.ts +0 -16
  99. package/dist/runtime/components/buttons/__stories/AntButton.stories.mjs +0 -313
  100. package/dist/runtime/components/buttons/__stories/AntCreateButton.stories.d.ts +0 -12
  101. package/dist/runtime/components/buttons/__stories/AntCreateButton.stories.mjs +0 -76
  102. package/dist/runtime/components/buttons/__stories/AntDeleteButton.stories.d.ts +0 -12
  103. package/dist/runtime/components/buttons/__stories/AntDeleteButton.stories.mjs +0 -76
  104. package/dist/runtime/components/buttons/__stories/AntDuplicateButton.stories.d.ts +0 -12
  105. package/dist/runtime/components/buttons/__stories/AntDuplicateButton.stories.mjs +0 -76
  106. package/dist/runtime/components/buttons/__stories/AntEditButton.stories.d.ts +0 -12
  107. package/dist/runtime/components/buttons/__stories/AntEditButton.stories.mjs +0 -76
  108. package/dist/runtime/components/buttons/__stories/AntSaveAndNewButton.stories.d.ts +0 -12
  109. package/dist/runtime/components/buttons/__stories/AntSaveAndNewButton.stories.mjs +0 -76
  110. package/dist/runtime/components/buttons/__stories/AntSaveButton.stories.d.ts +0 -12
  111. package/dist/runtime/components/buttons/__stories/AntSaveButton.stories.mjs +0 -76
  112. package/dist/runtime/components/buttons/__types/AntButton.types.d.ts +0 -4
  113. package/dist/runtime/components/buttons/__types/AntButton.types.mjs +0 -5
  114. package/dist/runtime/components/buttons/__types/index.d.ts +0 -1
  115. package/dist/runtime/components/buttons/__types/index.mjs +0 -1
  116. package/dist/runtime/components/crud/AntCrud.vue +0 -45
  117. package/dist/runtime/components/crud/AntCrudDetail.vue +0 -11
  118. package/dist/runtime/components/crud/AntCrudDetailActions.vue +0 -58
  119. package/dist/runtime/components/crud/AntCrudDetailNav.vue +0 -64
  120. package/dist/runtime/components/crud/AntCrudTableFilter.vue +0 -122
  121. package/dist/runtime/components/crud/AntCrudTableNav.vue +0 -149
  122. package/dist/runtime/components/crud/__stories/AntCrud.stories.d.ts +0 -6
  123. package/dist/runtime/components/crud/__stories/AntCrud.stories.mjs +0 -126
  124. package/dist/runtime/components/crud/__stories/AntCrudDetail.stories.d.ts +0 -7
  125. package/dist/runtime/components/crud/__stories/AntCrudDetail.stories.mjs +0 -80
  126. package/dist/runtime/components/crud/__stories/AntCrudDetailActions.stories.d.ts +0 -6
  127. package/dist/runtime/components/crud/__stories/AntCrudDetailActions.stories.mjs +0 -25
  128. package/dist/runtime/components/crud/__stories/AntCrudDetailNav.stories.d.ts +0 -6
  129. package/dist/runtime/components/crud/__stories/AntCrudDetailNav.stories.mjs +0 -41
  130. package/dist/runtime/components/crud/__stories/AntCrudTableFilter.stories.d.ts +0 -6
  131. package/dist/runtime/components/crud/__stories/AntCrudTableFilter.stories.mjs +0 -25
  132. package/dist/runtime/components/crud/__stories/AntCrudTableNav.stories.d.ts +0 -8
  133. package/dist/runtime/components/crud/__stories/AntCrudTableNav.stories.mjs +0 -56
  134. package/dist/runtime/components/dialogs/AntDeleteDialog.vue +0 -29
  135. package/dist/runtime/components/dialogs/AntDialog.vue +0 -147
  136. package/dist/runtime/components/dialogs/__stories/AndDeleteDialog.stories.d.ts +0 -6
  137. package/dist/runtime/components/dialogs/__stories/AndDeleteDialog.stories.mjs +0 -32
  138. package/dist/runtime/components/dialogs/__stories/AntDialog.stories.d.ts +0 -6
  139. package/dist/runtime/components/dialogs/__stories/AntDialog.stories.mjs +0 -60
  140. package/dist/runtime/components/forms/AntField.vue +0 -123
  141. package/dist/runtime/components/forms/AntFormGroup.vue +0 -36
  142. package/dist/runtime/components/forms/AntFormGroupLabel.vue +0 -5
  143. package/dist/runtime/components/forms/__stories/AntField.stories.d.ts +0 -6
  144. package/dist/runtime/components/forms/__stories/AntField.stories.mjs +0 -80
  145. package/dist/runtime/components/forms/__stories/AntFormGroup.stories.d.ts +0 -6
  146. package/dist/runtime/components/forms/__stories/AntFormGroup.stories.mjs +0 -33
  147. package/dist/runtime/components/forms/__stories/AntFormGroupLabel.stories.d.ts +0 -6
  148. package/dist/runtime/components/forms/__stories/AntFormGroupLabel.stories.mjs +0 -20
  149. package/dist/runtime/components/index.d.ts +0 -62
  150. package/dist/runtime/components/index.mjs +0 -124
  151. package/dist/runtime/components/inputs/AntCheckbox.vue +0 -182
  152. package/dist/runtime/components/inputs/AntCheckboxGroup.vue +0 -117
  153. package/dist/runtime/components/inputs/AntDateInput.vue +0 -104
  154. package/dist/runtime/components/inputs/AntNumberInput.vue +0 -157
  155. package/dist/runtime/components/inputs/AntPasswordInput.vue +0 -107
  156. package/dist/runtime/components/inputs/AntRadio.vue +0 -206
  157. package/dist/runtime/components/inputs/AntRadioGroup.vue +0 -127
  158. package/dist/runtime/components/inputs/AntRangeSlider.vue +0 -101
  159. package/dist/runtime/components/inputs/AntRichTextEditor.vue +0 -237
  160. package/dist/runtime/components/inputs/AntSearch.vue +0 -75
  161. package/dist/runtime/components/inputs/AntSelect.vue +0 -319
  162. package/dist/runtime/components/inputs/AntSwitch.vue +0 -192
  163. package/dist/runtime/components/inputs/AntSwitcher.vue +0 -196
  164. package/dist/runtime/components/inputs/AntTagInput.vue +0 -339
  165. package/dist/runtime/components/inputs/AntTextInput.vue +0 -75
  166. package/dist/runtime/components/inputs/AntTextarea.vue +0 -191
  167. package/dist/runtime/components/inputs/AntUnitInput.vue +0 -96
  168. package/dist/runtime/components/inputs/Elements/AntBaseInput.vue +0 -271
  169. package/dist/runtime/components/inputs/Elements/AntDropDown.vue +0 -189
  170. package/dist/runtime/components/inputs/Elements/AntInputDescription.vue +0 -58
  171. package/dist/runtime/components/inputs/Elements/AntInputLabel.vue +0 -62
  172. package/dist/runtime/components/inputs/Elements/AntInputLimiter.vue +0 -58
  173. package/dist/runtime/components/inputs/Elements/__stories/AntBaseInput.stories.d.ts +0 -11
  174. package/dist/runtime/components/inputs/Elements/__stories/AntBaseInput.stories.mjs +0 -234
  175. package/dist/runtime/components/inputs/Elements/__stories/AntInputDescription.stories.d.ts +0 -6
  176. package/dist/runtime/components/inputs/Elements/__stories/AntInputDescription.stories.mjs +0 -34
  177. package/dist/runtime/components/inputs/Elements/__stories/AntInputLabel.stories.d.ts +0 -7
  178. package/dist/runtime/components/inputs/Elements/__stories/AntInputLabel.stories.mjs +0 -46
  179. package/dist/runtime/components/inputs/Elements/__stories/AntInputLimiter.stories.d.ts +0 -6
  180. package/dist/runtime/components/inputs/Elements/__stories/AntInputLimiter.stories.mjs +0 -37
  181. package/dist/runtime/components/inputs/Elements/__types/AntBaseInput.types.d.ts +0 -17
  182. package/dist/runtime/components/inputs/Elements/__types/AntBaseInput.types.mjs +0 -18
  183. package/dist/runtime/components/inputs/Elements/__types/index.d.ts +0 -1
  184. package/dist/runtime/components/inputs/Elements/__types/index.mjs +0 -1
  185. package/dist/runtime/components/inputs/Elements/index.d.ts +0 -6
  186. package/dist/runtime/components/inputs/Elements/index.mjs +0 -12
  187. package/dist/runtime/components/inputs/__stories/AntCheckbox.stories.d.ts +0 -8
  188. package/dist/runtime/components/inputs/__stories/AntCheckbox.stories.mjs +0 -382
  189. package/dist/runtime/components/inputs/__stories/AntCheckboxGroup.stories.d.ts +0 -7
  190. package/dist/runtime/components/inputs/__stories/AntCheckboxGroup.stories.mjs +0 -84
  191. package/dist/runtime/components/inputs/__stories/AntDateInput.stories.d.ts +0 -8
  192. package/dist/runtime/components/inputs/__stories/AntDateInput.stories.mjs +0 -193
  193. package/dist/runtime/components/inputs/__stories/AntNumberInput.stories.d.ts +0 -10
  194. package/dist/runtime/components/inputs/__stories/AntNumberInput.stories.mjs +0 -246
  195. package/dist/runtime/components/inputs/__stories/AntPasswordInput.stories.d.ts +0 -8
  196. package/dist/runtime/components/inputs/__stories/AntPasswordInput.stories.mjs +0 -156
  197. package/dist/runtime/components/inputs/__stories/AntRadioGroup.stories.d.ts +0 -8
  198. package/dist/runtime/components/inputs/__stories/AntRadioGroup.stories.mjs +0 -251
  199. package/dist/runtime/components/inputs/__stories/AntRangeSlider.stories.d.ts +0 -7
  200. package/dist/runtime/components/inputs/__stories/AntRangeSlider.stories.mjs +0 -67
  201. package/dist/runtime/components/inputs/__stories/AntRichTextEditor.stories-old.d.ts +0 -0
  202. package/dist/runtime/components/inputs/__stories/AntRichTextEditor.stories-old.mjs +0 -0
  203. package/dist/runtime/components/inputs/__stories/AntSearch.stories.d.ts +0 -7
  204. package/dist/runtime/components/inputs/__stories/AntSearch.stories.mjs +0 -103
  205. package/dist/runtime/components/inputs/__stories/AntSelect.stories.d.ts +0 -13
  206. package/dist/runtime/components/inputs/__stories/AntSelect.stories.mjs +0 -255
  207. package/dist/runtime/components/inputs/__stories/AntSwitch.stories.d.ts +0 -8
  208. package/dist/runtime/components/inputs/__stories/AntSwitch.stories.mjs +0 -344
  209. package/dist/runtime/components/inputs/__stories/AntSwitcher.stories.d.ts +0 -8
  210. package/dist/runtime/components/inputs/__stories/AntSwitcher.stories.mjs +0 -235
  211. package/dist/runtime/components/inputs/__stories/AntTagInput.stories.d.ts +0 -9
  212. package/dist/runtime/components/inputs/__stories/AntTagInput.stories.mjs +0 -228
  213. package/dist/runtime/components/inputs/__stories/AntTextInput.stories.d.ts +0 -9
  214. package/dist/runtime/components/inputs/__stories/AntTextInput.stories.mjs +0 -225
  215. package/dist/runtime/components/inputs/__stories/AntTextarea.stories.d.ts +0 -9
  216. package/dist/runtime/components/inputs/__stories/AntTextarea.stories.mjs +0 -144
  217. package/dist/runtime/components/inputs/__stories/AntUnitInput.stories.d.ts +0 -9
  218. package/dist/runtime/components/inputs/__stories/AntUnitInput.stories.mjs +0 -116
  219. package/dist/runtime/components/inputs/__types/AntCheckbox.types.d.ts +0 -6
  220. package/dist/runtime/components/inputs/__types/AntCheckbox.types.mjs +0 -0
  221. package/dist/runtime/components/inputs/__types/AntDateInput.types.d.ts +0 -7
  222. package/dist/runtime/components/inputs/__types/AntDateInput.types.mjs +0 -8
  223. package/dist/runtime/components/inputs/__types/AntRadio.types.d.ts +0 -9
  224. package/dist/runtime/components/inputs/__types/AntRadio.types.mjs +0 -0
  225. package/dist/runtime/components/inputs/__types/AntSelect.types.d.ts +0 -4
  226. package/dist/runtime/components/inputs/__types/AntSelect.types.mjs +0 -0
  227. package/dist/runtime/components/inputs/__types/AntSwitcher.types.d.ts +0 -4
  228. package/dist/runtime/components/inputs/__types/AntSwitcher.types.mjs +0 -0
  229. package/dist/runtime/components/inputs/__types/AntTagInput.types.d.ts +0 -5
  230. package/dist/runtime/components/inputs/__types/AntTagInput.types.mjs +0 -6
  231. package/dist/runtime/components/inputs/__types/AntTextInput.types.d.ts +0 -6
  232. package/dist/runtime/components/inputs/__types/AntTextInput.types.mjs +0 -7
  233. package/dist/runtime/components/inputs/__types/index.d.ts +0 -7
  234. package/dist/runtime/components/inputs/__types/index.mjs +0 -7
  235. package/dist/runtime/components/layouts/AntNavLeftLayout.vue +0 -36
  236. package/dist/runtime/components/layouts/__stories/AntNavLeftLayout.stories.d.ts +0 -7
  237. package/dist/runtime/components/layouts/__stories/AntNavLeftLayout.stories.mjs +0 -68
  238. package/dist/runtime/components/navbar/AntNavbar.vue +0 -25
  239. package/dist/runtime/components/navbar/AntNavbarItem.vue +0 -78
  240. package/dist/runtime/components/navbar/__stories/AntNavbar.stories.d.ts +0 -6
  241. package/dist/runtime/components/navbar/__stories/AntNavbar.stories.mjs +0 -66
  242. package/dist/runtime/components/navbar/__types/NavbarItem.types.d.ts +0 -10
  243. package/dist/runtime/components/navbar/__types/NavbarItem.types.mjs +0 -0
  244. package/dist/runtime/components/navbar/__types/index.d.ts +0 -1
  245. package/dist/runtime/components/navbar/__types/index.mjs +0 -1
  246. package/dist/runtime/components/table/AntTable.vue +0 -218
  247. package/dist/runtime/components/table/AntTableSortButton.vue +0 -48
  248. package/dist/runtime/components/table/AntTd.vue +0 -81
  249. package/dist/runtime/components/table/AntTh.vue +0 -78
  250. package/dist/runtime/components/table/__stories/AntTable.stories.d.ts +0 -9
  251. package/dist/runtime/components/table/__stories/AntTable.stories.mjs +0 -273
  252. package/dist/runtime/components/table/__types/TableHeader.types.d.ts +0 -36
  253. package/dist/runtime/components/table/__types/TableHeader.types.mjs +0 -25
  254. package/dist/runtime/components/table/__types/index.d.ts +0 -1
  255. package/dist/runtime/components/table/__types/index.mjs +0 -1
  256. package/dist/runtime/components/tabs/AntTabItem.vue +0 -118
  257. package/dist/runtime/components/tabs/AntTabs.vue +0 -47
  258. package/dist/runtime/components/tabs/__stories/AntTabItem.stories.d.ts +0 -6
  259. package/dist/runtime/components/tabs/__stories/AntTabItem.stories.mjs +0 -32
  260. package/dist/runtime/components/tabs/__stories/AntTabs.stories.d.ts +0 -9
  261. package/dist/runtime/components/tabs/__stories/AntTabs.stories.mjs +0 -173
  262. package/dist/runtime/components/tabs/__types/AntTabItem.types.d.ts +0 -17
  263. package/dist/runtime/components/tabs/__types/AntTabItem.types.mjs +0 -6
  264. package/dist/runtime/components/tabs/__types/index.d.ts +0 -1
  265. package/dist/runtime/components/tabs/__types/index.mjs +0 -1
  266. package/dist/runtime/components/transitions/AntTransitionCollapseHeight.vue +0 -92
  267. package/dist/runtime/composables/useUi.d.ts +0 -20
  268. package/dist/runtime/composables/useUi.mjs +0 -31
  269. package/dist/runtime/composables/useValidator.d.ts +0 -1
  270. package/dist/runtime/composables/useValidator.mjs +0 -1
  271. package/dist/runtime/enums/Direction.enum.d.ts +0 -4
  272. package/dist/runtime/enums/Direction.enum.mjs +0 -5
  273. package/dist/runtime/enums/Grouped.enum.d.ts +0 -6
  274. package/dist/runtime/enums/Grouped.enum.mjs +0 -7
  275. package/dist/runtime/enums/Position.enum.d.ts +0 -12
  276. package/dist/runtime/enums/Position.enum.mjs +0 -14
  277. package/dist/runtime/enums/Size.enum.d.ts +0 -7
  278. package/dist/runtime/enums/Size.enum.mjs +0 -8
  279. package/dist/runtime/enums/State.enum.d.ts +0 -16
  280. package/dist/runtime/enums/State.enum.mjs +0 -18
  281. package/dist/runtime/enums/index.d.ts +0 -5
  282. package/dist/runtime/enums/index.mjs +0 -5
  283. package/dist/runtime/env.d.ts +0 -8
  284. package/dist/runtime/handler.d.ts +0 -1
  285. package/dist/runtime/handler.mjs +0 -5
  286. package/dist/runtime/plugins/toaster.d.ts +0 -22
  287. package/dist/runtime/plugins/toaster.mjs +0 -53
  288. package/dist/runtime/shims/vue.d.ts +0 -5
  289. package/dist/runtime/types.d.ts +0 -8
  290. package/dist/runtime/types.mjs +0 -8
  291. package/dist/runtime/utils/helper.d.ts +0 -4
  292. package/dist/runtime/utils/helper.mjs +0 -12
  293. package/dist/runtime/utils.d.ts +0 -20
  294. package/dist/runtime/utils.mjs +0 -41
  295. package/src/runtime/components/AntAccordion.vue +0 -64
  296. package/src/runtime/components/AntAccordionItem.vue +0 -119
  297. package/src/runtime/components/AntAlert.vue +0 -146
  298. package/src/runtime/components/AntCard.vue +0 -34
  299. package/src/runtime/components/AntContent.vue +0 -16
  300. package/src/runtime/components/AntDropdown.vue +0 -100
  301. package/src/runtime/components/AntIcon.vue +0 -56
  302. package/src/runtime/components/AntKeycap.vue +0 -45
  303. package/src/runtime/components/AntListGroup.vue +0 -24
  304. package/src/runtime/components/AntListGroupItem.vue +0 -83
  305. package/src/runtime/components/AntModal.vue +0 -130
  306. package/src/runtime/components/AntPagination.vue +0 -206
  307. package/src/runtime/components/AntPopover.vue +0 -135
  308. package/src/runtime/components/AntSkeleton.vue +0 -38
  309. package/src/runtime/components/AntSpinner.vue +0 -101
  310. package/src/runtime/components/AntTag.vue +0 -114
  311. package/src/runtime/components/AntToast.vue +0 -119
  312. package/src/runtime/components/AntToaster.vue +0 -70
  313. package/src/runtime/components/AntTooltip.vue +0 -189
  314. package/src/runtime/components/buttons/AntActionButton.vue +0 -74
  315. package/src/runtime/components/buttons/AntButton.vue +0 -257
  316. package/src/runtime/components/buttons/AntCreateButton.vue +0 -54
  317. package/src/runtime/components/buttons/AntDeleteButton.vue +0 -54
  318. package/src/runtime/components/buttons/AntDuplicateButton.vue +0 -54
  319. package/src/runtime/components/buttons/AntEditButton.vue +0 -54
  320. package/src/runtime/components/buttons/AntSaveAndNewButton.vue +0 -56
  321. package/src/runtime/components/buttons/AntSaveButton.vue +0 -55
  322. package/src/runtime/components/crud/AntCrud.vue +0 -69
  323. package/src/runtime/components/crud/AntCrudDetail.vue +0 -11
  324. package/src/runtime/components/crud/AntCrudDetailActions.vue +0 -58
  325. package/src/runtime/components/crud/AntCrudDetailNav.vue +0 -64
  326. package/src/runtime/components/crud/AntCrudTableFilter.vue +0 -122
  327. package/src/runtime/components/crud/AntCrudTableNav.vue +0 -149
  328. package/src/runtime/components/dialogs/AntDeleteDialog.vue +0 -29
  329. package/src/runtime/components/dialogs/AntDialog.vue +0 -181
  330. package/src/runtime/components/forms/AntField.vue +0 -123
  331. package/src/runtime/components/forms/AntFormGroup.vue +0 -36
  332. package/src/runtime/components/forms/AntFormGroupLabel.vue +0 -5
  333. package/src/runtime/components/inputs/AntCheckbox.vue +0 -201
  334. package/src/runtime/components/inputs/AntCheckboxGroup.vue +0 -117
  335. package/src/runtime/components/inputs/AntDateInput.vue +0 -104
  336. package/src/runtime/components/inputs/AntNumberInput.vue +0 -157
  337. package/src/runtime/components/inputs/AntPasswordInput.vue +0 -107
  338. package/src/runtime/components/inputs/AntRadio.vue +0 -214
  339. package/src/runtime/components/inputs/AntRadioGroup.vue +0 -127
  340. package/src/runtime/components/inputs/AntRangeSlider.vue +0 -121
  341. package/src/runtime/components/inputs/AntRichTextEditor.vue +0 -237
  342. package/src/runtime/components/inputs/AntSearch.vue +0 -75
  343. package/src/runtime/components/inputs/AntSelect.vue +0 -319
  344. package/src/runtime/components/inputs/AntSwitch.vue +0 -192
  345. package/src/runtime/components/inputs/AntSwitcher.vue +0 -196
  346. package/src/runtime/components/inputs/AntTagInput.vue +0 -339
  347. package/src/runtime/components/inputs/AntTextInput.vue +0 -75
  348. package/src/runtime/components/inputs/AntTextarea.vue +0 -191
  349. package/src/runtime/components/inputs/AntUnitInput.vue +0 -96
  350. package/src/runtime/components/inputs/Elements/AntBaseInput.vue +0 -319
  351. package/src/runtime/components/inputs/Elements/AntDropDown.vue +0 -189
  352. package/src/runtime/components/inputs/Elements/AntInputDescription.vue +0 -58
  353. package/src/runtime/components/inputs/Elements/AntInputLabel.vue +0 -62
  354. package/src/runtime/components/inputs/Elements/AntInputLimiter.vue +0 -58
  355. package/src/runtime/components/layouts/AntNavLeftLayout.vue +0 -36
  356. package/src/runtime/components/navbar/AntNavbar.vue +0 -25
  357. package/src/runtime/components/navbar/AntNavbarItem.vue +0 -78
  358. package/src/runtime/components/table/AntTable.vue +0 -218
  359. package/src/runtime/components/table/AntTableSortButton.vue +0 -48
  360. package/src/runtime/components/table/AntTd.vue +0 -81
  361. package/src/runtime/components/table/AntTh.vue +0 -78
  362. package/src/runtime/components/tabs/AntTabItem.vue +0 -118
  363. package/src/runtime/components/tabs/AntTabs.vue +0 -47
  364. package/src/runtime/components/transitions/AntTransitionCollapseHeight.vue +0 -96
@@ -1,339 +0,0 @@
1
- <script setup lang="ts">
2
- import {AntField} from './Elements';
3
- import type {SelectOption} from './__types';
4
- import {Grouped, InputState, Size} from '../../enums';
5
- import {useVModel} from '@vueuse/core';
6
- import {faChevronRight, type IconDefinition} from '@fortawesome/free-solid-svg-icons';
7
- import {computed, onMounted, type Ref, ref, watch} from 'vue';
8
- import AntTag from '../AntTag.vue';
9
- import AntIcon from '../AntIcon.vue';
10
- import {AntTagSize, IconSize} from '../__types';
11
- import AntDropDown from './Elements/AntDropDown.vue';
12
- import AntSkeleton from '../AntSkeleton.vue';
13
- import {vOnClickOutside} from '@vueuse/components';
14
- import {AntTagInputSize} from './__types/AntTagInput.types';
15
- import type {TagState} from '../__types/AntTag.types';
16
-
17
- const emit = defineEmits(['update:modelValue', 'blur', 'validate']);
18
- const props = withDefaults(
19
- defineProps<{
20
- modelValue: (string | number)[] | null;
21
- options: SelectOption[];
22
- label?: string;
23
- description?: string;
24
- placeholder?: string;
25
- size?: AntTagInputSize;
26
- state?: InputState;
27
- disabled?: boolean;
28
- readonly?: boolean;
29
- skeleton?: boolean;
30
- name?: string;
31
- expanded?: boolean;
32
- icon?: IconDefinition;
33
- grouped?: Grouped;
34
- nullable?: boolean;
35
- messages?: string[];
36
- allowCreate?: boolean;
37
- allowDuplicates?: boolean;
38
- openOnFocus?: boolean;
39
- autoCloseAfterSelection?: boolean;
40
- createCallback?: (item: string) => Promise<SelectOption>;
41
- }>(), {
42
- size: AntTagInputSize.md,
43
- state: InputState.base,
44
- icon: () => faChevronRight,
45
- messages: () => [],
46
- grouped: Grouped.none,
47
- allowCreate: false,
48
- allowDuplicates: false,
49
- openOnFocus: true,
50
- readonly: false,
51
- disabled: false,
52
- skeleton: false,
53
- autoCloseAfterSelection: false,
54
- placeholder: 'Add new tag'
55
- }
56
- );
57
-
58
- const _modelValue: Ref<(string | number)[] | null> = useVModel(props, 'modelValue', emit);
59
- const _skeleton = useVModel(props, 'skeleton', emit);
60
- const dropDownOpen = ref(false);
61
- const hasInputState = computed(() => props.skeleton || props.readonly || props.disabled);
62
- const focusedDropDownItem: Ref<string | number | null> = ref(null);
63
- const tagInput = ref('');
64
- const filteredOptions = ref(props.options);
65
- const inputRef: Ref<HTMLElement | null> = ref(null);
66
- const inputContainerClasses = computed(() => {
67
- const variants: Record<InputState, string> = {
68
- [InputState.base]: 'outline-neutral-300 focus-within:outline-neutral-300 focus-within:ring-primary-200 bg-white',
69
- [InputState.danger]: 'outline-danger-500 focus-within:outline-danger-500 focus-within:ring-danger-200 bg-danger-100',
70
- [InputState.info]: 'outline-info-500 focus-within:outline-info-500 focus-within:ring-info-200 bg-info-100',
71
- [InputState.success]: 'outline-success-500 focus-within:outline-success-500 focus-within:ring-success-200 bg-success-100',
72
- [InputState.warning]: 'outline-warning-500 focus-within:outline-warning-500 focus-within:ring-warning-200 bg-warning-100',
73
- };
74
-
75
- return {
76
- 'flex items-center flex-wrap': true,
77
- 'transition-colors relative border-none outline w-full focus-within:z-10': true,
78
- 'outline-offset-[-1px] outline-1 focus-within:outline-offset-[-1px] focus-within:outline-1': true,
79
- 'opacity-50 cursor-not-allowed': props.disabled,
80
- [variants[props.state]]: true,
81
- // AntTagInputSize
82
- 'p-1.5 text-sm': props.size === AntTagInputSize.sm,
83
- 'p-2 text-sm': props.size === AntTagInputSize.md,
84
- 'p-2.5 text-sm': props.size === AntTagInputSize.lg,
85
- 'focus-within:ring-2': !hasInputState.value && props.size === AntTagInputSize.sm,
86
- 'focus-within:ring-4': !hasInputState.value && (props.size === AntTagInputSize.lg || props.size === AntTagInputSize.md),
87
- // Grouping
88
- 'rounded-tl-md rounded-bl-md rounded-tr-none rounded-br-none': props.grouped === Grouped.left,
89
- 'rounded-none': props.grouped === Grouped.center,
90
- 'rounded-tl-none rounded-bl-none rounded-tr-md rounded-br-md': props.grouped === Grouped.right,
91
- 'rounded-md': props.grouped === Grouped.none,
92
- 'rounded-bl-none rounded-br-none': dropDownOpen.value && (!props.options || props.options.length > 0) && !props.readonly,
93
- 'invisible': props.skeleton,
94
- };
95
- });
96
- const inputClasses = computed(() => {
97
- const variants: Record<InputState, string> = {
98
- [InputState.base]: 'placeholder:text-neutral-500',
99
- [InputState.danger]: 'placeholder:text-danger-700',
100
- [InputState.info]: 'placeholder:text-info-700',
101
- [InputState.success]: 'placeholder:text-success-700',
102
- [InputState.warning]: 'placeholder:text-warning-700',
103
- };
104
-
105
- return {
106
- 'outline-0 border:none ring:none bg-transparent w-full': true,
107
- 'opacity-50 cursor-not-allowed': props.disabled,
108
- [variants[props.state]]: true,
109
- };
110
- });
111
- const skeletonGrouped = computed(() => {
112
- if (!props.nullable || (props.nullable && _modelValue.value === null)) {
113
- return props.grouped;
114
- }
115
-
116
- if (props.grouped === Grouped.right || props.grouped === Grouped.center) {
117
- return Grouped.center;
118
- } else {
119
- return Grouped.left;
120
- }
121
- });
122
-
123
- function onClickOutside() {
124
- if (!dropDownOpen.value) {
125
- return;
126
- }
127
-
128
- dropDownOpen.value = false;
129
- }
130
-
131
- async function checkCreateTag(item: string): Promise<void> {
132
- if (props.allowCreate && focusedDropDownItem.value) {
133
- // If allowCreate is active but a item is focused inside the dropdown do nothing here.
134
- return;
135
- }
136
-
137
- if (item && props.allowCreate && props.createCallback) {
138
- const newOption: SelectOption = await props.createCallback(item);
139
-
140
- addTag(newOption.value);
141
- }
142
- }
143
-
144
- function addTagFromOptions(item: string | number) {
145
- if (props.allowCreate && !focusedDropDownItem.value) {
146
- // If allowCreate is active we don't need to add it here.
147
- return;
148
- }
149
-
150
- const option = props.options?.find(option => option.value === item);
151
-
152
- if (option) {
153
- addTag(item);
154
-
155
- if (props.autoCloseAfterSelection) {
156
- dropDownOpen.value = false;
157
- }
158
- }
159
- }
160
-
161
- function addTag(tagValue: string | number): void {
162
- _modelValue.value = _modelValue.value || [];
163
-
164
- if (!props.allowDuplicates && _modelValue.value?.includes(tagValue) || !tagValue) {
165
- return;
166
- }
167
-
168
- if (Array.isArray(_modelValue.value)) {
169
- _modelValue.value.push(tagValue);
170
- } else {
171
- _modelValue.value = [tagValue];
172
- }
173
-
174
- tagInput.value = '';
175
-
176
- filterDropDown();
177
- }
178
-
179
- function removeLastTag() {
180
- if (tagInput.value === '' && Array.isArray(_modelValue.value) && _modelValue.value.length > 0) {
181
- _modelValue.value.splice(-1, 1);
182
-
183
- filterDropDown();
184
- }
185
- }
186
-
187
- function removeTag(tag: string | number) {
188
- if (_modelValue.value && !props.disabled && !props.skeleton && !props.readonly) {
189
- _modelValue.value.splice(_modelValue.value.findIndex((_value) => _value === tag), 1);
190
-
191
- filterDropDown();
192
- }
193
- }
194
-
195
- function changeFocus() {
196
- if (props.openOnFocus) {
197
- dropDownOpen.value = true;
198
- }
199
- }
200
-
201
- function filterDropDown() {
202
- if (!props.options) {
203
- return;
204
- }
205
-
206
- if (props.allowCreate) {
207
- focusedDropDownItem.value = null;
208
- }
209
-
210
- dropDownOpen.value = true;
211
-
212
- filteredOptions.value = props.options.filter(option => option.label.toLowerCase().includes(tagInput.value.toLowerCase()));
213
-
214
- // Remove all elements that are in modelValue from the filtered options
215
- if (_modelValue.value && !props.allowDuplicates) {
216
- filteredOptions.value = filteredOptions.value.filter(option => !_modelValue.value?.includes(option.value));
217
- }
218
-
219
- if (!props.allowCreate && filteredOptions.value.length > 0) {
220
- focusedDropDownItem.value = filteredOptions.value[0]?.value;
221
- }
222
- }
223
-
224
- function onBlur(e: FocusEvent) {
225
- emit('validate', props.modelValue);
226
- emit('blur', e);
227
- }
228
-
229
- /**
230
- * Validate default value if given after delayed data fetching.
231
- */
232
- watch(() => props.skeleton, (val) => {
233
- if (!val && props.modelValue !== null) {
234
- emit('validate', props.modelValue);
235
- }
236
- });
237
- watch(_modelValue, (val) => {
238
- if ([InputState.danger, InputState.warning, InputState.info].includes(props.state)) {
239
- emit('validate', val);
240
- }
241
- }, {deep: true});
242
-
243
- onMounted(() => {
244
- /**
245
- * Validate default value without delayed data fetching.
246
- */
247
- if (!props.skeleton && props.modelValue !== null) {
248
- emit('validate', props.modelValue);
249
- }
250
- });
251
- </script>
252
-
253
- <template>
254
- <AntField
255
- :label="label"
256
- :size="size as unknown as Size"
257
- :skeleton="_skeleton"
258
- :description="description"
259
- :state="state"
260
- :expanded="expanded"
261
- :messages="messages"
262
- >
263
- <div
264
- v-on-click-outside="onClickOutside"
265
- class="relative w-full"
266
- >
267
- <AntSkeleton
268
- v-if="skeleton"
269
- absolute
270
- rounded
271
- :grouped="skeletonGrouped"
272
- />
273
-
274
- <div
275
- :class="inputContainerClasses"
276
- class="w-full flex items-center"
277
- >
278
- <div
279
- class="flex gap-2.5 items-center"
280
- >
281
- <AntTag
282
- v-for="(tag, index) in _modelValue"
283
- :key="`tag-input-tag-${index}`"
284
- :size="AntTagSize.xs3"
285
- :state="state as unknown as TagState"
286
- :dismiss="!readonly"
287
- @close="removeTag(tag)"
288
- >
289
- {{ options.find((option: SelectOption) => option.value === tag)?.label }}
290
- </AntTag>
291
- </div>
292
-
293
- <!-- Input -->
294
- <div class="flex items-center w-32 shrink grow">
295
- <AntIcon
296
- :icon="icon"
297
- :size="size === AntTagInputSize.sm ? IconSize.xs : IconSize.sm"
298
- />
299
-
300
- <input
301
- ref="inputRef"
302
- v-model="tagInput"
303
- type="text"
304
- :placeholder="placeholder"
305
- :class="inputClasses"
306
- :disabled="disabled"
307
- :readonly="readonly"
308
- @focus="changeFocus"
309
- @input="filterDropDown"
310
- @keydown.delete="removeLastTag"
311
- @keydown.enter.prevent="checkCreateTag(tagInput)"
312
- @blur="onBlur"
313
- />
314
- </div>
315
- </div>
316
-
317
- <AntDropDown
318
- v-if="filteredOptions && !disabled && !readonly"
319
- ref="dropDownRef"
320
- v-model:focused="focusedDropDownItem"
321
- v-model:open="dropDownOpen"
322
- :model-value="null"
323
- :auto-select-first-on-open="!allowCreate"
324
- :options="filteredOptions"
325
- :input-ref="inputRef"
326
- :size="size as unknown as Size"
327
- :state="state"
328
- :focus-on-open="false"
329
- @select-element="addTagFromOptions"
330
- >
331
- <template #empty>
332
- <span v-if="allowCreate">
333
- No tag found, create now
334
- </span>
335
- </template>
336
- </AntDropDown>
337
- </div>
338
- </AntField>
339
- </template>
@@ -1,75 +0,0 @@
1
- <script lang="ts" setup>
2
- import {onMounted} from 'vue';
3
- import AntField from '../forms/AntField.vue';
4
- import AntBaseInput from './Elements/AntBaseInput.vue';
5
- import {Size} from '../../enums/Size.enum';
6
- import {TextInputType} from './__types/AntTextInput.types';
7
- import {handleEnumValidation} from '../../handler';
8
- import {useVModel} from '@vueuse/core';
9
- import {InputState} from '../../enums';
10
- import {BaseInputType} from './Elements/__types';
11
-
12
- defineOptions({inheritAttrs: false});
13
-
14
- const emit = defineEmits(['update:modelValue', 'update:skeleton', 'validate']);
15
- const props = withDefaults(defineProps<{
16
- modelValue: string | null;
17
- label?: string;
18
- placeholder?: string;
19
- description?: string;
20
- size?: Size;
21
- state?: InputState;
22
- disabled?: boolean;
23
- readonly?: boolean;
24
- skeleton?: boolean;
25
- type?: TextInputType;
26
- limiter?: boolean;
27
- max?: number;
28
- messages?: string[];
29
- }>(), {
30
- state: InputState.base,
31
- disabled: false,
32
- readonly: false,
33
- skeleton: false,
34
- size: Size.md,
35
- type: TextInputType.text,
36
- limiter: false,
37
- messages: () => []
38
- });
39
-
40
- const _value = useVModel(props, 'modelValue', emit);
41
-
42
- onMounted(() => {
43
- handleEnumValidation(props.size, Size, 'size');
44
- handleEnumValidation(props.state, InputState, 'state');
45
- handleEnumValidation(props.type, TextInputType, 'type');
46
- });
47
- </script>
48
-
49
- <template>
50
- <AntField
51
- :label="label"
52
- :size="size"
53
- :skeleton="skeleton"
54
- :description="description"
55
- :state="state"
56
- :limiter-max-value="limiter && max !== undefined ? max : undefined"
57
- :limiter-value="limiter ? _value?.length : undefined"
58
- :messages="messages"
59
- >
60
- <AntBaseInput
61
- v-model="_value"
62
- :type="type as unknown as BaseInputType"
63
- wrapper-class="flex-grow"
64
- :state="state"
65
- :size="size"
66
- :skeleton="skeleton"
67
- :disabled="disabled"
68
- :readonly="readonly"
69
- :placeholder="placeholder !== undefined ? placeholder : label"
70
- :show-icon="true"
71
- v-bind="$attrs"
72
- @validate="val => $emit('validate', val)"
73
- />
74
- </AntField>
75
- </template>
@@ -1,191 +0,0 @@
1
- <script lang="ts" setup>
2
- import {computed, onMounted, watch} from 'vue';
3
- import {Size} from '../../enums/Size.enum';
4
- import AntSkeleton from '../AntSkeleton.vue';
5
- import AntIcon from '../AntIcon.vue';
6
- import {Grouped} from '../../enums/Grouped.enum';
7
- import {
8
- faExclamationTriangle,
9
- faExclamationCircle,
10
- faCircleCheck,
11
- faCircleInfo
12
- } from '@fortawesome/free-solid-svg-icons';
13
- import {handleEnumValidation} from '../../handler';
14
- import {classesToObjectSyntax} from '../../utils';
15
- import AntField from '../forms/AntField.vue';
16
- import {useVModel} from '@vueuse/core';
17
- import {InputState} from '../../enums';
18
- import {IconSize} from '../__types';
19
-
20
- defineOptions({inheritAttrs: false});
21
-
22
- const emit = defineEmits(['update:modelValue', 'validate', 'blur']);
23
- const props = withDefaults(defineProps<{
24
- modelValue: string | null;
25
- size?: Size;
26
- state?: InputState;
27
- disabled?: boolean;
28
- readonly?: boolean;
29
- skeleton?: boolean;
30
- grouped?: Grouped;
31
- wrapperClass?: string | Record<string, boolean>;
32
- showIcon?: boolean;
33
- label?: string;
34
- placeholder?: string;
35
- description?: string;
36
- limiter?: boolean;
37
- max?: number;
38
- messages?: string[];
39
- }>(), {
40
- state: InputState.base,
41
- disabled: false,
42
- readonly: false,
43
- size: Size.md,
44
- skeleton: false,
45
- grouped: Grouped.none,
46
- showIcon: true,
47
- limiter: false,
48
- messages: () => []
49
- });
50
- const _modelValue = useVModel(props, 'modelValue', emit);
51
- const hasInputState = computed(() => props.skeleton || props.readonly || props.disabled);
52
- const icons = {
53
- [InputState.info]: faCircleInfo,
54
- [InputState.warning]: faExclamationTriangle,
55
- [InputState.danger]: faExclamationCircle,
56
- [InputState.success]: faCircleCheck,
57
- [InputState.base]: null,
58
- };
59
- /*TODO #59:: If the scrollbar is showing than the pr is moving and the gap between icon and text is bigger and the icon is stuck in the scrollbar*/
60
- const inputClasses = computed(() => {
61
- const variants: Record<InputState, string> = {
62
- [InputState.base]: 'outline-neutral-300 focus:ring-primary-200 bg-white placeholder:text-neutral-500',
63
- [InputState.danger]: 'outline-danger-500 focus:ring-danger-200 bg-danger-100 placeholder:text-danger-700',
64
- [InputState.info]: 'outline-info-500 focus:ring-info-200 bg-info-100 placeholder:text-info-700',
65
- [InputState.success]: 'outline-success-500 focus:ring-success-200 bg-success-100 placeholder:text-success-700',
66
- [InputState.warning]: 'outline-warning-500 focus:ring-warning-200 bg-warning-100 placeholder:text-warning-700',
67
- };
68
-
69
- return {
70
- 'block transition-colors relative border-none outline w-full focus:z-10': true,
71
- 'outline-offset-[-1px] outline-1 focus:outline-offset-[-1px] focus:outline-1': true,
72
- 'disabled:opacity-50 disabled:cursor-not-allowed': props.disabled,
73
- [variants[props.state]]: true,
74
- // Size
75
- 'p-1 text-xs': props.size === Size.xs2,
76
- 'p-1.5 text-xs': props.size === Size.xs,
77
- 'p-1.5 text-sm': props.size === Size.sm,
78
- 'p-2 text-sm': props.size === Size.md,
79
- 'p-2.5 text-sm': props.size === Size.lg,
80
- 'focus:ring-2': !hasInputState.value && (props.size === Size.sm || props.size === Size.xs || props.size === Size.xs2),
81
- 'focus:ring-4': !hasInputState.value && (props.size === Size.lg || props.size === Size.md),
82
- // Icon right
83
- 'pr-6': props.size === Size.xs2 && props.showIcon && icon.value,
84
- 'pr-7': props.size === Size.xs && props.showIcon && icon.value,
85
- 'pr-8': props.size === Size.sm && props.showIcon && icon.value,
86
- 'pr-9': props.size === Size.md && props.showIcon && icon.value,
87
- 'pr-10': props.size === Size.lg && props.showIcon && icon.value,
88
- // Grouped
89
- 'rounded-tl-md rounded-bl-md rounded-tr-none rounded-br-none': props.grouped === Grouped.left,
90
- 'rounded-none': props.grouped === Grouped.center,
91
- 'rounded-tl-none rounded-bl-none rounded-tr-md rounded-br-md': props.grouped === Grouped.right,
92
- 'rounded-md': props.grouped === Grouped.none,
93
- 'invisible': props.skeleton
94
- };
95
- });
96
- const iconColor = computed(() => {
97
- const variants = {
98
- 'base': undefined,
99
- 'danger': 'text-danger-500',
100
- 'info': 'text-info-500',
101
- 'primary': 'text-primary-500',
102
- 'secondary': 'text-secondary-500',
103
- 'success': 'text-success-500',
104
- 'warning': 'text-warning-500',
105
- };
106
-
107
- return variants[props.state];
108
- });
109
- const _wrapperClass = computed(() => classesToObjectSyntax(props.wrapperClass));
110
- const icon = computed(() => icons[props.state]);
111
- const getIconSize = computed(() => {
112
- if (props.size === Size.xs || props.size === Size.xs2) {
113
- return IconSize.xs;
114
- } else {
115
- return IconSize.sm;
116
- }
117
- });
118
-
119
- onMounted(() => {
120
- handleEnumValidation(props.size, Size, 'size');
121
- handleEnumValidation(props.grouped, Grouped, 'grouped');
122
- handleEnumValidation(props.state, InputState, 'state');
123
-
124
- if (!props.skeleton && props.modelValue !== null) {
125
- emit('validate', props.modelValue);
126
- }
127
- });
128
-
129
- watch(_modelValue, (val) => {
130
- if ([InputState.danger, InputState.warning, InputState.info].includes(props.state)) {
131
- emit('validate', val);
132
- }
133
- }, {deep: true});
134
- watch(() => props.skeleton, (val) => {
135
- if (!val && props.modelValue !== null) {
136
- emit('validate', props.modelValue);
137
- }
138
- });
139
-
140
- function onBlur(e: FocusEvent) {
141
- emit('validate', props.modelValue);
142
- emit('blur', e);
143
- }
144
- </script>
145
-
146
- <template>
147
- <AntField
148
- :label="label"
149
- :size="size"
150
- :skeleton="skeleton"
151
- :description="description"
152
- :state="state"
153
- :limiter-max-value="limiter && max !== undefined ? max : undefined"
154
- :limiter-value="limiter ? _modelValue?.length : undefined"
155
- :messages="messages"
156
- >
157
- <div
158
- class="block relative w-full"
159
- :class="{...{'-mr-px': grouped !== Grouped.none}, ..._wrapperClass}"
160
- >
161
- <textarea
162
- v-model="_modelValue"
163
- :class="inputClasses"
164
- :placeholder="placeholder !== undefined ? placeholder : label"
165
- :disabled="disabled || skeleton"
166
- :readonly="readonly"
167
- v-bind="$attrs"
168
- @blur="onBlur"
169
- />
170
-
171
- <div
172
- v-if="showIcon && icon"
173
- class="absolute flex h-[95%] right-0 top-0 transition-all z-20"
174
- :class="{'p-1': size === Size.xs2, 'p-1.5': size === Size.sm || size === Size.xs, 'p-2': size === Size.md, 'p-2.5': size === Size.lg}"
175
- >
176
- <AntIcon
177
- :icon="icon"
178
- :size="getIconSize"
179
- :color="iconColor"
180
- />
181
- </div>
182
-
183
- <AntSkeleton
184
- v-if="skeleton"
185
- absolute
186
- :grouped="grouped"
187
- rounded
188
- />
189
- </div>
190
- </AntField>
191
- </template>
@@ -1,96 +0,0 @@
1
- <script lang="ts" setup>
2
- import {onMounted} from 'vue';
3
- import AntButton from '../buttons/AntButton.vue';
4
- import AntField from '../forms/AntField.vue';
5
- import AntBaseInput from './Elements/AntBaseInput.vue';
6
- import {Size} from '../../enums/Size.enum';
7
- import {type IconDefinition} from '@fortawesome/free-solid-svg-icons';
8
- import {useVModel} from '@vueuse/core';
9
- import {State, InputState} from '../../enums';
10
- import {Grouped} from '../../enums/Grouped.enum';
11
- import {BaseInputType} from './Elements/__types';
12
- import {handleEnumValidation} from '../../handler';
13
-
14
- defineOptions({inheritAttrs: false});
15
-
16
- const props = withDefaults(defineProps<{
17
- modelValue: number | null;
18
- unit: string | IconDefinition;
19
- label?: string;
20
- placeholder?: string;
21
- description?: string;
22
- limiter?: boolean;
23
- min?: number;
24
- max?: number;
25
- size?: Size;
26
- state?: InputState;
27
- disabled?: boolean;
28
- readonly?: boolean;
29
- skeleton?: boolean;
30
- wrapperClass?: string | Record<string, boolean>;
31
- messages?: string[];
32
- }>(), {
33
- state: InputState.base,
34
- disabled: false,
35
- readonly: false,
36
- skeleton: false,
37
- size: Size.md,
38
- limiter: false,
39
- messages: () => []
40
- });
41
- const emit = defineEmits(['update:modelValue', 'validate']);
42
- const _modelValue = useVModel(props, 'modelValue', emit);
43
-
44
- onMounted(() => {
45
- handleEnumValidation(props.state, InputState, 'state');
46
- handleEnumValidation(props.size, Size, 'size');
47
- });
48
- </script>
49
-
50
- <template>
51
- <AntField
52
- :label="label"
53
- :size="size"
54
- :skeleton="skeleton"
55
- :description="description"
56
- :state="state"
57
- :limiter-max-value="limiter && max !== undefined ? max : undefined"
58
- :limiter-value="limiter && _modelValue !== undefined && _modelValue !== null ? _modelValue : undefined"
59
- :messages="messages"
60
- >
61
- <div
62
- class="flex relative"
63
- >
64
- <AntBaseInput
65
- v-model="_modelValue"
66
- :type="BaseInputType.number"
67
- :grouped="Grouped.left"
68
- wrapper-class="flex-grow"
69
- :state="state"
70
- :size="size"
71
- :min="min"
72
- :max="max"
73
- :skeleton="skeleton"
74
- :disabled="disabled"
75
- :readonly="readonly"
76
- :placeholder="placeholder || label"
77
- :show-icon="false"
78
- v-bind="$attrs"
79
- @validate="val => $emit('validate', val)"
80
- />
81
-
82
- <AntButton
83
- :icon-left="typeof unit === 'object' ? unit : undefined"
84
- :grouped="Grouped.right"
85
- :state="state as unknown as State"
86
- :size="size"
87
- :skeleton="skeleton"
88
- :readonly="true"
89
- >
90
- <span v-if="typeof unit === 'string'">
91
- {{ unit }}
92
- </span>
93
- </AntButton>
94
- </div>
95
- </AntField>
96
- </template>