@tsed/react-formio 3.0.0-alpha.8 → 3.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (447) hide show
  1. package/dist/all.d.ts +0 -0
  2. package/dist/all.js +38 -0
  3. package/dist/all.js.map +1 -0
  4. package/dist/atoms/icon/Icon.d.ts +4 -3
  5. package/dist/atoms/icon/Icon.js +9 -8
  6. package/dist/atoms/icon/Icon.js.map +1 -1
  7. package/dist/chunks/_commonjsHelpers.js +30 -3
  8. package/dist/chunks/_commonjsHelpers.js.map +1 -1
  9. package/dist/chunks/index.js +33 -30
  10. package/dist/chunks/index.js.map +1 -1
  11. package/dist/chunks/index.module.js +16 -16
  12. package/dist/chunks/index.module.js.map +1 -1
  13. package/dist/chunks/index2.js +56953 -0
  14. package/dist/chunks/index2.js.map +1 -0
  15. package/dist/chunks/react-select-animated.esm.js +3616 -0
  16. package/dist/chunks/react-select-animated.esm.js.map +1 -0
  17. package/dist/contexts/FormioContext.d.ts +19 -0
  18. package/dist/contexts/FormioContext.js +35 -0
  19. package/dist/contexts/FormioContext.js.map +1 -0
  20. package/dist/hooks/keyboard.constants.d.ts +38 -0
  21. package/dist/hooks/keyboard.constants.js +7 -0
  22. package/dist/hooks/keyboard.constants.js.map +1 -0
  23. package/dist/hooks/useFormioContext.d.ts +10 -0
  24. package/dist/hooks/useFormioContext.js +12 -0
  25. package/dist/hooks/useFormioContext.js.map +1 -0
  26. package/dist/hooks/useI18n.d.ts +4 -0
  27. package/dist/hooks/useI18n.js +9 -0
  28. package/dist/hooks/useI18n.js.map +1 -0
  29. package/dist/hooks/useKeyboardControls.d.ts +12 -0
  30. package/dist/hooks/useKeyboardControls.js +35 -0
  31. package/dist/hooks/useKeyboardControls.js.map +1 -0
  32. package/dist/hooks/useTooltip.js.map +1 -1
  33. package/dist/index.d.ts +1 -6
  34. package/dist/index.js +18 -13
  35. package/dist/index.js.map +1 -1
  36. package/dist/interfaces/ComponentType.d.ts +6 -2
  37. package/dist/interfaces/FormBuilderOptions.d.ts +7 -0
  38. package/dist/interfaces/FormBuilderOptions.js +2 -0
  39. package/dist/interfaces/FormBuilderOptions.js.map +1 -0
  40. package/dist/interfaces/FormOptions.d.ts +6 -13
  41. package/dist/interfaces/FormType.d.ts +4 -11
  42. package/dist/interfaces/Operation.d.ts +13 -4
  43. package/dist/interfaces/SubmissionType.d.ts +5 -10
  44. package/dist/interfaces/index.d.ts +1 -0
  45. package/dist/molecules/alert/Alert.js.map +1 -1
  46. package/dist/molecules/button/Button.d.ts +18 -5
  47. package/dist/molecules/button/Button.js +24 -28
  48. package/dist/molecules/button/Button.js.map +1 -1
  49. package/dist/molecules/card/Card.js +9 -7
  50. package/dist/molecules/card/Card.js.map +1 -1
  51. package/dist/molecules/forms/form-control/FormControl.d.ts +14 -12
  52. package/dist/molecules/forms/form-control/FormControl.js +46 -22
  53. package/dist/molecules/forms/form-control/FormControl.js.map +1 -1
  54. package/dist/molecules/forms/input-tags/InputTags.d.ts +2 -8
  55. package/dist/molecules/forms/input-tags/InputTags.interface.d.ts +7 -0
  56. package/dist/molecules/forms/input-tags/InputTags.interface.js +2 -0
  57. package/dist/molecules/forms/input-tags/InputTags.interface.js.map +1 -0
  58. package/dist/molecules/forms/input-tags/InputTags.js +21 -27
  59. package/dist/molecules/forms/input-tags/InputTags.js.map +1 -1
  60. package/dist/molecules/forms/input-tags/all.d.ts +2 -0
  61. package/dist/molecules/forms/input-tags/all.js +9 -0
  62. package/dist/molecules/forms/input-tags/all.js.map +1 -0
  63. package/dist/molecules/forms/input-tags/components/ChoicesTags.d.ts +307 -0
  64. package/dist/molecules/forms/input-tags/components/ChoicesTags.js +51 -0
  65. package/dist/molecules/forms/input-tags/components/ChoicesTags.js.map +1 -0
  66. package/dist/molecules/forms/input-tags/components/ReactTags.d.ts +2 -0
  67. package/dist/molecules/forms/input-tags/components/ReactTags.js +1926 -0
  68. package/dist/molecules/forms/input-tags/components/ReactTags.js.map +1 -0
  69. package/dist/molecules/forms/input-text/InputText.d.ts +2 -14
  70. package/dist/molecules/forms/input-text/InputText.interface.d.ts +4 -0
  71. package/dist/molecules/forms/input-text/InputText.interface.js +2 -0
  72. package/dist/molecules/forms/input-text/InputText.interface.js.map +1 -0
  73. package/dist/molecules/forms/input-text/InputText.js +46 -56
  74. package/dist/molecules/forms/input-text/InputText.js.map +1 -1
  75. package/dist/molecules/forms/select/Select.d.ts +1 -1
  76. package/dist/molecules/forms/select/{Select.interfaces.d.ts → Select.interface.d.ts} +8 -10
  77. package/dist/molecules/forms/select/Select.interface.js +2 -0
  78. package/dist/molecules/forms/select/Select.interface.js.map +1 -0
  79. package/dist/molecules/forms/select/Select.js +9 -10
  80. package/dist/molecules/forms/select/Select.js.map +1 -1
  81. package/dist/molecules/forms/select/all.d.ts +1 -1
  82. package/dist/molecules/forms/select/all.js +1 -0
  83. package/dist/molecules/forms/select/all.js.map +1 -1
  84. package/dist/molecules/forms/select/components/ChoicesSelect.d.ts +1 -1
  85. package/dist/molecules/forms/select/components/ChoicesSelect.js +72 -83
  86. package/dist/molecules/forms/select/components/ChoicesSelect.js.map +1 -1
  87. package/dist/molecules/forms/select/components/HtmlSelect.d.ts +1 -1
  88. package/dist/molecules/forms/select/components/HtmlSelect.js +17 -16
  89. package/dist/molecules/forms/select/components/HtmlSelect.js.map +1 -1
  90. package/dist/molecules/forms/select/components/ReactSelect.d.ts +1 -1
  91. package/dist/molecules/forms/select/components/ReactSelect.js +28 -3034
  92. package/dist/molecules/forms/select/components/ReactSelect.js.map +1 -1
  93. package/dist/molecules/forms/select/components/choices.template.js +2340 -2257
  94. package/dist/molecules/forms/select/components/choices.template.js.map +1 -1
  95. package/dist/molecules/forms/select/hooks/useOptions.d.ts +3 -3
  96. package/dist/molecules/forms/select/hooks/useOptions.js +15 -15
  97. package/dist/molecules/forms/select/hooks/useOptions.js.map +1 -1
  98. package/dist/molecules/loader/Loader.d.ts +4 -4
  99. package/dist/molecules/loader/Loader.js +16 -8
  100. package/dist/molecules/loader/Loader.js.map +1 -1
  101. package/dist/molecules/modal/Modal.js +23 -24
  102. package/dist/molecules/modal/Modal.js.map +1 -1
  103. package/dist/molecules/pagination/Pagination.d.ts +7 -6
  104. package/dist/molecules/pagination/Pagination.js +48 -57
  105. package/dist/molecules/pagination/Pagination.js.map +1 -1
  106. package/dist/molecules/pagination/PaginationButton.js +10 -10
  107. package/dist/molecules/pagination/PaginationButton.js.map +1 -1
  108. package/dist/molecules/pagination/all.js +5 -4
  109. package/dist/molecules/pagination/all.js.map +1 -1
  110. package/dist/molecules/pagination/utils/getPageNumbers.js.map +1 -0
  111. package/dist/molecules/table/Table.d.ts +16 -2
  112. package/dist/molecules/table/Table.js +53 -77
  113. package/dist/molecules/table/Table.js.map +1 -1
  114. package/dist/molecules/table/all.d.ts +0 -0
  115. package/dist/molecules/table/all.js +19 -0
  116. package/dist/molecules/table/all.js.map +1 -0
  117. package/dist/molecules/table/components/DefaultArrowSort.d.ts +5 -1
  118. package/dist/molecules/table/components/DefaultArrowSort.js +17 -5
  119. package/dist/molecules/table/components/DefaultArrowSort.js.map +1 -1
  120. package/dist/molecules/table/components/DefaultCell.d.ts +5 -1
  121. package/dist/molecules/table/components/DefaultCell.js +8 -6
  122. package/dist/molecules/table/components/DefaultCell.js.map +1 -1
  123. package/dist/molecules/table/components/DefaultCellFooter.d.ts +6 -0
  124. package/dist/molecules/table/components/DefaultCellFooter.js +12 -0
  125. package/dist/molecules/table/components/DefaultCellFooter.js.map +1 -0
  126. package/dist/molecules/table/components/DefaultCellHeader.d.ts +5 -8
  127. package/dist/molecules/table/components/DefaultCellHeader.js +25 -9
  128. package/dist/molecules/table/components/DefaultCellHeader.js.map +1 -1
  129. package/dist/molecules/table/components/DefaultCellOperations.d.ts +16 -10
  130. package/dist/molecules/table/components/DefaultCellOperations.js +23 -14
  131. package/dist/molecules/table/components/DefaultCellOperations.js.map +1 -1
  132. package/dist/molecules/table/components/DefaultFilter.d.ts +11 -0
  133. package/dist/molecules/table/components/DefaultFilter.js +15 -0
  134. package/dist/molecules/table/components/DefaultFilter.js.map +1 -0
  135. package/dist/molecules/table/components/DefaultOperationButton.d.ts +16 -12
  136. package/dist/molecules/table/components/DefaultOperationButton.js +16 -31
  137. package/dist/molecules/table/components/DefaultOperationButton.js.map +1 -1
  138. package/dist/molecules/table/filters/Filters.d.js +2 -0
  139. package/dist/molecules/table/filters/Filters.d.js.map +1 -0
  140. package/dist/molecules/table/filters/RangeFilter.d.ts +3 -0
  141. package/dist/molecules/table/filters/RangeFilter.js +41 -0
  142. package/dist/molecules/table/filters/RangeFilter.js.map +1 -0
  143. package/dist/molecules/table/filters/SelectFilter.d.ts +3 -0
  144. package/dist/molecules/table/filters/SelectFilter.js +33 -0
  145. package/dist/molecules/table/filters/SelectFilter.js.map +1 -0
  146. package/dist/molecules/table/filters/TextFieldFilter.d.ts +3 -0
  147. package/dist/molecules/table/filters/TextFieldFilter.js +27 -0
  148. package/dist/molecules/table/filters/TextFieldFilter.js.map +1 -0
  149. package/dist/molecules/table/hooks/useTable.d.ts +23 -0
  150. package/dist/molecules/table/hooks/useTable.js +35 -0
  151. package/dist/molecules/table/hooks/useTable.js.map +1 -0
  152. package/dist/molecules/table/hooks/useUniqValues.d.ts +5 -0
  153. package/dist/molecules/table/hooks/useUniqValues.js +11 -0
  154. package/dist/molecules/table/hooks/useUniqValues.js.map +1 -0
  155. package/dist/molecules/table/interfaces/extends.d.ts +14 -0
  156. package/dist/molecules/table/interfaces/extends.js +2 -0
  157. package/dist/molecules/table/interfaces/extends.js.map +1 -0
  158. package/dist/molecules/table/utils/mapFormToColumns.d.ts +2 -2
  159. package/dist/molecules/table/utils/mapFormToColumns.js +34 -18
  160. package/dist/molecules/table/utils/mapFormToColumns.js.map +1 -1
  161. package/dist/molecules/tabs/Tab.d.ts +13 -0
  162. package/dist/molecules/tabs/Tab.js +66 -0
  163. package/dist/molecules/tabs/Tab.js.map +1 -0
  164. package/dist/molecules/tabs/TabList.d.ts +2 -0
  165. package/dist/molecules/tabs/TabList.js +23 -0
  166. package/dist/molecules/tabs/TabList.js.map +1 -0
  167. package/dist/molecules/tabs/TabPanel.d.ts +9 -0
  168. package/dist/molecules/tabs/TabPanel.js +27 -0
  169. package/dist/molecules/tabs/TabPanel.js.map +1 -0
  170. package/dist/molecules/tabs/Tabs.d.ts +4 -16
  171. package/dist/molecules/tabs/Tabs.js +7 -67
  172. package/dist/molecules/tabs/Tabs.js.map +1 -1
  173. package/dist/molecules/tabs/TabsBody.d.ts +1 -0
  174. package/dist/molecules/tabs/TabsBody.js +10 -0
  175. package/dist/molecules/tabs/TabsBody.js.map +1 -0
  176. package/dist/molecules/tabs/TabsLegacy.d.ts +18 -0
  177. package/dist/molecules/tabs/TabsLegacy.js +49 -0
  178. package/dist/molecules/tabs/TabsLegacy.js.map +1 -0
  179. package/dist/molecules/tabs/all.d.ts +5 -0
  180. package/dist/molecules/tabs/all.js +13 -0
  181. package/dist/molecules/tabs/all.js.map +1 -0
  182. package/dist/molecules/tabs/context/TabControl.d.ts +52 -0
  183. package/dist/molecules/tabs/context/TabControl.js +85 -0
  184. package/dist/molecules/tabs/context/TabControl.js.map +1 -0
  185. package/dist/molecules/tabs/hooks/tabControl.d.ts +44 -0
  186. package/dist/molecules/tabs/hooks/tabControl.js +34 -0
  187. package/dist/molecules/tabs/hooks/tabControl.js.map +1 -0
  188. package/dist/organisms/form/Form.js.map +1 -1
  189. package/dist/organisms/form/access/FormAccess.js +41 -41
  190. package/dist/organisms/form/access/FormAccess.js.map +1 -1
  191. package/dist/organisms/form/access/FormAccess.schema.js +1 -0
  192. package/dist/organisms/form/access/FormAccess.schema.js.map +1 -1
  193. package/dist/organisms/form/access/FormAccess.utils.js +2 -2
  194. package/dist/organisms/form/access/FormAccess.utils.js.map +1 -1
  195. package/dist/organisms/form/actions/FormAction.js +34 -0
  196. package/dist/organisms/form/actions/FormAction.js.map +1 -0
  197. package/dist/organisms/form/builder/FormBuilder.js.map +1 -1
  198. package/dist/organisms/form/builder/FormEdit.d.ts +7 -3
  199. package/dist/organisms/form/builder/FormEdit.js +46 -42
  200. package/dist/organisms/form/builder/FormEdit.js.map +1 -1
  201. package/dist/organisms/form/builder/FormEdit.reducer.js.map +1 -1
  202. package/dist/organisms/form/builder/FormEditCtas.d.ts +2 -2
  203. package/dist/organisms/form/builder/FormEditCtas.js +36 -35
  204. package/dist/organisms/form/builder/FormEditCtas.js.map +1 -1
  205. package/dist/organisms/form/builder/FormParameters.d.ts +3 -2
  206. package/dist/organisms/form/builder/FormParameters.js +19 -18
  207. package/dist/organisms/form/builder/FormParameters.js.map +1 -1
  208. package/dist/organisms/form/builder/all.js +17 -13
  209. package/dist/organisms/form/builder/all.js.map +1 -1
  210. package/dist/organisms/form/builder/useFormBuilder.d.ts +4 -4
  211. package/dist/organisms/form/builder/useFormBuilder.js +36 -33
  212. package/dist/organisms/form/builder/useFormBuilder.js.map +1 -1
  213. package/dist/organisms/form/builder/useFormEdit.d.ts +2 -2
  214. package/dist/organisms/form/builder/useFormEdit.js +1 -1
  215. package/dist/organisms/form/builder/useFormEdit.js.map +1 -1
  216. package/dist/organisms/form/exports/FormExport.d.ts +6 -0
  217. package/dist/organisms/form/exports/FormExport.js +56 -0
  218. package/dist/organisms/form/exports/FormExport.js.map +1 -0
  219. package/dist/organisms/form/preview/FormPreview.d.ts +6 -0
  220. package/dist/organisms/form/preview/FormPreview.js +12 -0
  221. package/dist/organisms/form/preview/FormPreview.js.map +1 -0
  222. package/dist/organisms/form/settings/FormSettings.js +28 -28
  223. package/dist/organisms/form/settings/FormSettings.js.map +1 -1
  224. package/dist/organisms/form/settings/FormSettings.schema.js.map +1 -1
  225. package/dist/organisms/form/settings/FormSettings.utils.js.map +1 -1
  226. package/dist/organisms/form/useForm.d.ts +2 -1
  227. package/dist/organisms/form/useForm.js +664 -661
  228. package/dist/organisms/form/useForm.js.map +1 -1
  229. package/dist/organisms/modal/RemoveModal.js +16 -17
  230. package/dist/organisms/modal/RemoveModal.js.map +1 -1
  231. package/dist/organisms/table/actions/ActionsTable.d.ts +4 -3
  232. package/dist/organisms/table/actions/ActionsTable.js +21 -33
  233. package/dist/organisms/table/actions/ActionsTable.js.map +1 -1
  234. package/dist/organisms/table/forms/FormsTable.d.ts +2 -3
  235. package/dist/organisms/table/forms/FormsTable.js +48 -27
  236. package/dist/organisms/table/forms/FormsTable.js.map +1 -1
  237. package/dist/organisms/table/forms/components/FormsCell.d.ts +5 -0
  238. package/dist/organisms/table/forms/components/FormsCell.js +50 -0
  239. package/dist/organisms/table/forms/components/FormsCell.js.map +1 -0
  240. package/dist/organisms/table/submissions/SubmissionsTable.d.ts +12 -4
  241. package/dist/organisms/table/submissions/SubmissionsTable.js +10 -17
  242. package/dist/organisms/table/submissions/SubmissionsTable.js.map +1 -1
  243. package/dist/organisms/views/FormViews.d.ts +24 -0
  244. package/dist/organisms/views/FormViews.js +97 -0
  245. package/dist/organisms/views/FormViews.js.map +1 -0
  246. package/dist/registries/components.js +12 -11
  247. package/dist/registries/components.js.map +1 -1
  248. package/dist/utils/getEventValue.js.map +1 -1
  249. package/dist/utils/iconClass.js +4 -5
  250. package/dist/utils/iconClass.js.map +1 -1
  251. package/dist/utils/mapPagination.js.map +1 -1
  252. package/dist/utils/stopPropagationWrapper.js.map +1 -1
  253. package/package.json +10 -8
  254. package/readme.md +7 -8
  255. package/src/all.ts +34 -0
  256. package/src/atoms/icon/Icon.stories.tsx +71 -22
  257. package/src/atoms/icon/Icon.tsx +14 -4
  258. package/src/contexts/FormioContext.tsx +89 -0
  259. package/src/hooks/keyboard.constants.ts +40 -0
  260. package/src/hooks/useFormioContext.ts +13 -0
  261. package/src/hooks/useI18n.ts +9 -0
  262. package/src/hooks/useKeyboardControls.spec.tsx +208 -0
  263. package/src/hooks/useKeyboardControls.ts +84 -0
  264. package/src/index.ts +17 -13
  265. package/src/interfaces/ComponentType.ts +2 -2
  266. package/src/interfaces/FormBuilderOptions.ts +9 -0
  267. package/src/interfaces/FormOptions.ts +7 -13
  268. package/src/interfaces/FormType.ts +5 -11
  269. package/src/interfaces/Operation.ts +10 -4
  270. package/src/interfaces/SubmissionType.ts +9 -8
  271. package/src/interfaces/index.ts +1 -0
  272. package/src/molecules/__fixtures__/build.js +28 -0
  273. package/src/molecules/__fixtures__/form-schema.json +76 -195
  274. package/src/molecules/__fixtures__/form-submissions.json +11846 -46
  275. package/src/molecules/__fixtures__/products.json +81539 -0
  276. package/src/molecules/button/Button.stories.tsx +1 -1
  277. package/src/molecules/button/Button.tsx +43 -24
  278. package/src/molecules/card/Card.tsx +4 -0
  279. package/src/molecules/forms/form-control/FormControl.spec.tsx +7 -4
  280. package/src/molecules/forms/form-control/FormControl.stories.tsx +4 -4
  281. package/src/molecules/forms/form-control/FormControl.tsx +46 -20
  282. package/src/molecules/forms/input-tags/InputTags.interface.ts +9 -0
  283. package/src/molecules/forms/input-tags/InputTags.tsx +20 -42
  284. package/src/molecules/forms/input-tags/all.ts +6 -0
  285. package/src/molecules/forms/input-tags/components/ChoicesTags.stories.tsx +110 -0
  286. package/src/molecules/forms/input-tags/components/ChoicesTags.tsx +72 -0
  287. package/src/molecules/forms/input-tags/components/ReactTags.stories.tsx +140 -0
  288. package/src/molecules/forms/input-tags/components/ReactTags.tsx +38 -0
  289. package/src/molecules/forms/input-text/InputText.interface.ts +5 -0
  290. package/src/molecules/forms/input-text/InputText.spec.tsx +1 -1
  291. package/src/molecules/forms/input-text/InputText.stories.tsx +4 -4
  292. package/src/molecules/forms/input-text/InputText.tsx +38 -53
  293. package/src/molecules/forms/select/{Select.interfaces.ts → Select.interface.ts} +8 -10
  294. package/src/molecules/forms/select/Select.tsx +5 -3
  295. package/src/molecules/forms/select/all.ts +2 -1
  296. package/src/molecules/forms/select/components/ChoicesSelect.stories.tsx +8 -7
  297. package/src/molecules/forms/select/components/ChoicesSelect.tsx +9 -18
  298. package/src/molecules/forms/select/components/HtmlSelect.stories.tsx +7 -7
  299. package/src/molecules/forms/select/components/HtmlSelect.tsx +3 -2
  300. package/src/molecules/forms/select/components/ReactSelect.stories.tsx +10 -8
  301. package/src/molecules/forms/select/components/ReactSelect.tsx +1 -1
  302. package/src/molecules/forms/select/hooks/useOptions.ts +6 -2
  303. package/src/molecules/loader/Loader.spec.tsx +2 -2
  304. package/src/molecules/loader/Loader.stories.tsx +7 -4
  305. package/src/molecules/loader/Loader.tsx +16 -6
  306. package/src/molecules/modal/Modal.stories.tsx +1 -1
  307. package/src/molecules/pagination/Pagination.spec.tsx +11 -11
  308. package/src/molecules/pagination/Pagination.stories.tsx +32 -10
  309. package/src/molecules/pagination/Pagination.tsx +29 -26
  310. package/src/molecules/table/Table.stories.tsx +284 -101
  311. package/src/molecules/table/Table.tsx +91 -86
  312. package/src/molecules/table/all.ts +16 -0
  313. package/src/molecules/table/components/DefaultArrowSort.tsx +20 -4
  314. package/src/molecules/table/components/DefaultCell.tsx +10 -1
  315. package/src/molecules/table/components/DefaultCellFooter.tsx +16 -0
  316. package/src/molecules/table/components/DefaultCellHeader.tsx +33 -13
  317. package/src/molecules/table/components/DefaultCellOperations.tsx +31 -20
  318. package/src/molecules/table/components/DefaultFilter.tsx +42 -0
  319. package/src/molecules/table/components/DefaultOperationButton.tsx +19 -34
  320. package/src/molecules/table/filters/Filters.d.ts +31 -0
  321. package/src/molecules/table/filters/RangeFilter.tsx +43 -0
  322. package/src/molecules/table/filters/SelectFilter.tsx +47 -0
  323. package/src/molecules/table/filters/TextFieldFilter.tsx +36 -0
  324. package/src/molecules/table/hooks/useTable.tsx +76 -0
  325. package/src/molecules/table/hooks/useUniqValues.tsx +10 -0
  326. package/src/molecules/table/interfaces/extends.ts +18 -0
  327. package/src/molecules/table/utils/mapFormToColumns.tsx +69 -26
  328. package/src/molecules/tabs/Tab.tsx +106 -0
  329. package/src/molecules/tabs/TabList.tsx +37 -0
  330. package/src/molecules/tabs/TabPanel.tsx +37 -0
  331. package/src/molecules/tabs/Tabs.spec.tsx +126 -73
  332. package/src/molecules/tabs/Tabs.stories.tsx +298 -65
  333. package/src/molecules/tabs/Tabs.tsx +10 -81
  334. package/src/molecules/tabs/TabsBody.tsx +11 -0
  335. package/src/molecules/tabs/TabsLegacy.stories.tsx +103 -0
  336. package/src/molecules/tabs/TabsLegacy.tsx +86 -0
  337. package/src/molecules/tabs/all.ts +5 -0
  338. package/src/molecules/tabs/context/TabControl.tsx +166 -0
  339. package/src/molecules/tabs/hooks/tabControl.spec.tsx +388 -0
  340. package/src/molecules/tabs/hooks/tabControl.ts +52 -0
  341. package/src/organisms/__fixtures__/form-firstname.fixture.json +1 -0
  342. package/src/organisms/__fixtures__/form.fixture.json +1 -0
  343. package/src/organisms/form/Form.stories.tsx +104 -124
  344. package/src/organisms/form/access/FormAccess.schema.ts +1 -0
  345. package/src/organisms/form/access/FormAccess.stories.tsx +6 -4
  346. package/src/organisms/form/actions/FormAction.stories.tsx +426 -0
  347. package/src/organisms/form/{action → actions}/FormAction.tsx +2 -2
  348. package/src/organisms/form/builder/FormBuilder.stories.tsx +7 -4
  349. package/src/organisms/form/builder/FormEdit.reducer.spec.ts +136 -0
  350. package/src/organisms/form/builder/FormEdit.stories.tsx +16 -13
  351. package/src/organisms/form/builder/FormEdit.tsx +15 -7
  352. package/src/organisms/form/builder/FormEditCtas.tsx +10 -10
  353. package/src/organisms/form/builder/FormParameters.tsx +8 -4
  354. package/src/organisms/form/builder/all.ts +4 -0
  355. package/src/organisms/form/builder/useFormBuilder.ts +12 -7
  356. package/src/organisms/form/builder/useFormEdit.ts +3 -3
  357. package/src/organisms/form/exports/FormExport.stories.tsx +68 -0
  358. package/src/organisms/form/exports/FormExport.tsx +61 -0
  359. package/src/organisms/form/preview/FormPreview.stories.tsx +58 -0
  360. package/src/organisms/form/preview/FormPreview.tsx +23 -0
  361. package/src/organisms/form/settings/FormSettings.component.spec.tsx +3 -1
  362. package/src/organisms/form/settings/FormSettings.stories.tsx +2 -2
  363. package/src/organisms/form/settings/FormSettings.tsx +6 -6
  364. package/src/organisms/form/useForm.ts +2 -3
  365. package/src/organisms/modal/RemoveModal.stories.tsx +1 -1
  366. package/src/organisms/table/actions/ActionsTable.spec.tsx +7 -5
  367. package/src/organisms/table/actions/ActionsTable.stories.tsx +48 -45
  368. package/src/organisms/table/actions/ActionsTable.tsx +14 -18
  369. package/src/organisms/table/forms/FormsTable.stories.tsx +2 -0
  370. package/src/organisms/table/forms/FormsTable.tsx +53 -23
  371. package/src/organisms/table/forms/components/FormsCell.tsx +53 -0
  372. package/src/organisms/table/submissions/SubmissionsTable.stories.tsx +101 -57
  373. package/src/organisms/table/submissions/SubmissionsTable.tsx +12 -5
  374. package/src/organisms/views/FormViews.stories.tsx +221 -0
  375. package/src/organisms/views/FormViews.tsx +148 -0
  376. package/src/registries/components.ts +7 -1
  377. package/src/utils/iconClass.ts +1 -3
  378. package/vite.config.mts +2 -2
  379. package/dist/molecules/forms/select/Select.interfaces.js +0 -2
  380. package/dist/molecules/forms/select/Select.interfaces.js.map +0 -1
  381. package/dist/molecules/table/components/DefaultCells.d.ts +0 -4
  382. package/dist/molecules/table/components/DefaultCells.js +0 -23
  383. package/dist/molecules/table/components/DefaultCells.js.map +0 -1
  384. package/dist/molecules/table/components/DefaultRow.d.ts +0 -12
  385. package/dist/molecules/table/components/DefaultRow.js +0 -26
  386. package/dist/molecules/table/components/DefaultRow.js.map +0 -1
  387. package/dist/molecules/table/components/DragNDropContainer.d.ts +0 -4
  388. package/dist/molecules/table/components/DragNDropContainer.js +0 -10
  389. package/dist/molecules/table/components/DragNDropContainer.js.map +0 -1
  390. package/dist/molecules/table/filters/DefaultColumnFilter.d.ts +0 -10
  391. package/dist/molecules/table/filters/DefaultColumnFilter.js +0 -29
  392. package/dist/molecules/table/filters/DefaultColumnFilter.js.map +0 -1
  393. package/dist/molecules/table/filters/SelectColumnFilter.d.ts +0 -10
  394. package/dist/molecules/table/filters/SelectColumnFilter.js +0 -34
  395. package/dist/molecules/table/filters/SelectColumnFilter.js.map +0 -1
  396. package/dist/molecules/table/filters/SliderColumnFilter.d.ts +0 -9
  397. package/dist/molecules/table/filters/SliderColumnFilter.js +0 -27
  398. package/dist/molecules/table/filters/SliderColumnFilter.js.map +0 -1
  399. package/dist/molecules/table/hooks/useCustomTable.d.ts +0 -128
  400. package/dist/molecules/table/hooks/useCustomTable.js +0 -130
  401. package/dist/molecules/table/hooks/useCustomTable.js.map +0 -1
  402. package/dist/molecules/table/hooks/useDragnDropRow.d.ts +0 -272
  403. package/dist/molecules/table/hooks/useDragnDropRow.js +0 -40
  404. package/dist/molecules/table/hooks/useDragnDropRow.js.map +0 -1
  405. package/dist/molecules/table/hooks/useOperations.d.ts +0 -11
  406. package/dist/molecules/table/hooks/useOperations.js +0 -25
  407. package/dist/molecules/table/hooks/useOperations.js.map +0 -1
  408. package/dist/molecules/table/index.d.ts +0 -15
  409. package/dist/molecules/table/index.js +0 -35
  410. package/dist/molecules/table/index.js.map +0 -1
  411. package/dist/molecules/table/utils/getPageNumbers.js.map +0 -1
  412. package/dist/molecules/table/utils/swapElements.d.ts +0 -1
  413. package/dist/molecules/table/utils/swapElements.js +0 -5
  414. package/dist/molecules/table/utils/swapElements.js.map +0 -1
  415. package/dist/organisms/form/action/FormAction.js +0 -32
  416. package/dist/organisms/form/action/FormAction.js.map +0 -1
  417. package/dist/organisms/table/forms/components/FormCell.d.ts +0 -6
  418. package/dist/organisms/table/forms/components/FormCell.js +0 -50
  419. package/dist/organisms/table/forms/components/FormCell.js.map +0 -1
  420. package/dist/typings.d.js +0 -2
  421. package/dist/typings.d.js.map +0 -1
  422. package/src/molecules/forms/input-tags/InputTags.stories.tsx +0 -81
  423. package/src/molecules/table/components/DefaultCells.tsx +0 -30
  424. package/src/molecules/table/components/DefaultRow.tsx +0 -52
  425. package/src/molecules/table/components/DragNDropContainer.tsx +0 -7
  426. package/src/molecules/table/filters/DefaultColumnFilter.spec.tsx +0 -33
  427. package/src/molecules/table/filters/DefaultColumnFilter.tsx +0 -38
  428. package/src/molecules/table/filters/SelectColumnFilter.spec.tsx +0 -68
  429. package/src/molecules/table/filters/SelectColumnFilter.tsx +0 -51
  430. package/src/molecules/table/filters/SliderColumnFilter.tsx +0 -28
  431. package/src/molecules/table/hooks/useCustomTable.tsx +0 -268
  432. package/src/molecules/table/hooks/useDragnDropRow.ts +0 -80
  433. package/src/molecules/table/hooks/useOperations.tsx +0 -39
  434. package/src/molecules/table/index.ts +0 -15
  435. package/src/molecules/table/utils/swapElements.spec.ts +0 -7
  436. package/src/molecules/table/utils/swapElements.ts +0 -7
  437. package/src/organisms/form/action/FormAction.stories.tsx +0 -364
  438. package/src/organisms/table/forms/components/FormCell.tsx +0 -47
  439. package/src/typings.d.ts +0 -3
  440. package/tsconfig.app.json +0 -11
  441. package/tsconfig.json +0 -21
  442. package/tsconfig.node.json +0 -13
  443. package/tsconfig.spec.json +0 -14
  444. /package/dist/molecules/{table → pagination}/utils/getPageNumbers.d.ts +0 -0
  445. /package/dist/molecules/{table → pagination}/utils/getPageNumbers.js +0 -0
  446. /package/dist/organisms/form/{action → actions}/FormAction.d.ts +0 -0
  447. /package/src/molecules/{table → pagination}/utils/getPageNumbers.ts +0 -0
@@ -1,27 +1,51 @@
1
- import { jsxs as d, jsx as r } from "react/jsx-runtime";
2
- import { c as m } from "../../../chunks/index.js";
3
- function f({
4
- children: i,
5
- name: t,
6
- id: l = t,
7
- required: c,
8
- prefix: o,
9
- suffix: e,
10
- description: a,
11
- label: s,
12
- className: n
1
+ import { jsxs as d, jsx as o } from "react/jsx-runtime";
2
+ import { c } from "../../../chunks/index.js";
3
+ import u from "lodash/omit";
4
+ import { registerComponent as f } from "../../../registries/components.js";
5
+ function C(t, r = []) {
6
+ return u(t, ["label", "description", "prefix", "suffix", "size", "shadow", ...r]);
7
+ }
8
+ function h({
9
+ children: t,
10
+ name: r = "",
11
+ id: n = r,
12
+ required: m,
13
+ before: i,
14
+ after: e,
15
+ description: s,
16
+ label: l,
17
+ size: a,
18
+ className: p
13
19
  }) {
14
- return /* @__PURE__ */ d("div", { "data-testid": t && `form-group-${t}`, id: `form-group-${t || ""}`, className: m("form-group", n), children: [
15
- s && /* @__PURE__ */ r("label", { htmlFor: l, "data-testid": "form-control-label", className: `col-form-label ${c ? " field-required" : ""}`, children: s }),
16
- /* @__PURE__ */ d("div", { className: "input-group", children: [
17
- o && /* @__PURE__ */ r("div", { className: "input-group-prepend", children: /* @__PURE__ */ r("span", { className: "input-group-text", "data-testid": "form-control-prefix", children: o }) }),
18
- i,
19
- e && /* @__PURE__ */ r("div", { className: "input-group-append", children: /* @__PURE__ */ r("span", { className: "input-group-text", "data-testid": "form-control-suffix", children: e }) })
20
- ] }),
21
- a && /* @__PURE__ */ r("div", { "data-testid": "form-control-description", className: "form-text text-muted", children: a })
22
- ] });
20
+ return /* @__PURE__ */ d(
21
+ "div",
22
+ {
23
+ "data-testid": r && `form-group-${r}`,
24
+ id: `form-group-${r || ""}`,
25
+ className: c(
26
+ "form-group",
27
+ {
28
+ "-with-before": !!i,
29
+ "-with-after": !!e
30
+ },
31
+ a && `-size-${a}`,
32
+ p
33
+ ),
34
+ children: [
35
+ l && /* @__PURE__ */ o("label", { htmlFor: n, "data-testid": "form-control-label", className: `col-form-label ${m ? " field-required" : ""}`, children: l }),
36
+ /* @__PURE__ */ d("div", { className: "input-group", children: [
37
+ i && /* @__PURE__ */ o("div", { className: "input-group-prepend", children: /* @__PURE__ */ o("span", { className: "input-group-text", "data-testid": "form-control-prefix", children: i }) }),
38
+ t,
39
+ e && /* @__PURE__ */ o("div", { className: "input-group-append", children: /* @__PURE__ */ o("span", { className: "input-group-text", "data-testid": "form-control-suffix", children: e }) })
40
+ ] }),
41
+ s && /* @__PURE__ */ o("div", { "data-testid": "form-control-description", className: "form-text text-muted", children: s })
42
+ ]
43
+ }
44
+ );
23
45
  }
46
+ f("FormControl", h);
24
47
  export {
25
- f as FormControl
48
+ h as FormControl,
49
+ C as cleanFormControlProps
26
50
  };
27
51
  //# sourceMappingURL=FormControl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormControl.js","sources":["../../../../src/molecules/forms/form-control/FormControl.tsx"],"sourcesContent":["import classnames from \"classnames\";\nimport type { PropsWithChildren, ReactNode } from \"react\";\n\nexport interface FormControlProps<Data = any> {\n id?: string;\n name: string;\n value?: Data;\n required?: boolean;\n label?: string;\n className?: string;\n onChange?: (name: string, value: any) => void;\n description?: string | ReactNode;\n prefix?: ReactNode | string;\n suffix?: ReactNode | string;\n shadow?: boolean;\n}\n\nexport function FormControl({\n children,\n name,\n id = name,\n required,\n prefix,\n suffix,\n description,\n label,\n className\n}: PropsWithChildren<FormControlProps>) {\n return (\n <div data-testid={name && `form-group-${name}`} id={`form-group-${name || \"\"}`} className={classnames(\"form-group\", className)}>\n {label && (\n <label htmlFor={id} data-testid='form-control-label' className={`col-form-label ${required ? \" field-required\" : \"\"}`}>\n {label}\n </label>\n )}\n <div className={\"input-group\"}>\n {prefix && (\n <div className='input-group-prepend'>\n <span className='input-group-text' data-testid='form-control-prefix'>\n {prefix}\n </span>\n </div>\n )}\n {children}\n {suffix && (\n <div className='input-group-append'>\n <span className='input-group-text' data-testid='form-control-suffix'>\n {suffix}\n </span>\n </div>\n )}\n </div>\n {description && (\n <div data-testid='form-control-description' className='form-text text-muted'>\n {description}\n </div>\n )}\n </div>\n );\n}\n"],"names":["FormControl","children","name","id","required","prefix","suffix","description","label","className","classnames","jsx","jsxs"],"mappings":";;AAiBO,SAASA,EAAY;AAAA,EAC1B,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,IAAAC,IAAKD;AAAA,EACL,UAAAE;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC;AACF,GAAwC;AACtC,2BACG,OAAI,EAAA,eAAaP,KAAQ,cAAcA,CAAI,IAAI,IAAI,cAAcA,KAAQ,EAAE,IAAI,WAAWQ,EAAW,cAAcD,CAAS,GAC1H,UAAA;AAAA,IAAAD,KACE,gBAAAG,EAAA,SAAA,EAAM,SAASR,GAAI,eAAY,sBAAqB,WAAW,kBAAkBC,IAAW,oBAAoB,EAAE,IAChH,UACHI,GAAA;AAAA,IAEF,gBAAAI,EAAC,OAAI,EAAA,WAAW,eACb,UAAA;AAAA,MACCP,KAAA,gBAAAM,EAAC,OAAI,EAAA,WAAU,uBACb,UAAA,gBAAAA,EAAC,QAAK,EAAA,WAAU,oBAAmB,eAAY,uBAC5C,UAAAN,EACH,CAAA,GACF;AAAA,MAEDJ;AAAA,MACAK,KACC,gBAAAK,EAAC,OAAI,EAAA,WAAU,sBACb,UAAA,gBAAAA,EAAC,QAAK,EAAA,WAAU,oBAAmB,eAAY,uBAC5C,UAAAL,EAAA,CACH,EACF,CAAA;AAAA,IAAA,GAEJ;AAAA,IACCC,KACE,gBAAAI,EAAA,OAAA,EAAI,eAAY,4BAA2B,WAAU,wBACnD,UACHJ,EAAA,CAAA;AAAA,EAAA,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"FormControl.js","sources":["../../../../src/molecules/forms/form-control/FormControl.tsx"],"sourcesContent":["import classnames from \"classnames\";\nimport omit from \"lodash/omit\";\nimport { HTMLAttributes, InputHTMLAttributes, PropsWithChildren, ReactNode } from \"react\";\n\nimport { registerComponent } from \"../../../registries/components\";\n\nexport type BaseFormControlProps<Value = unknown> = {\n label?: string;\n description?: string | ReactNode;\n before?: ReactNode | string;\n after?: ReactNode | string;\n shadow?: boolean;\n value?: Value;\n onChange?: (name: string | undefined, value: Value) => void;\n /**\n * The input size\n */\n size?: \"small\" | string;\n};\nexport type FormControlProps<\n Value = unknown,\n Attributes extends HTMLAttributes<HTMLElement> = InputHTMLAttributes<HTMLInputElement>\n> = BaseFormControlProps<Value> & Omit<Attributes, \"onChange\" | \"value\" | \"size\">;\n\nexport function cleanFormControlProps(props: FormControlProps, omitted: string[] = []): any {\n return omit(props, [\"label\", \"description\", \"prefix\", \"suffix\", \"size\", \"shadow\", ...omitted]);\n}\n\nexport function FormControl<Value = unknown>({\n children,\n name = \"\",\n id = name,\n required,\n before,\n after,\n description,\n label,\n size,\n className\n}: PropsWithChildren<FormControlProps<Value>>) {\n return (\n <div\n data-testid={name && `form-group-${name}`}\n id={`form-group-${name || \"\"}`}\n className={classnames(\n \"form-group\",\n {\n \"-with-before\": !!before,\n \"-with-after\": !!after\n },\n size && `-size-${size}`,\n className\n )}\n >\n {label && (\n <label htmlFor={id} data-testid='form-control-label' className={`col-form-label ${required ? \" field-required\" : \"\"}`}>\n {label}\n </label>\n )}\n <div className={\"input-group\"}>\n {before && (\n <div className='input-group-prepend'>\n <span className='input-group-text' data-testid='form-control-prefix'>\n {before}\n </span>\n </div>\n )}\n {children}\n {after && (\n <div className='input-group-append'>\n <span className='input-group-text' data-testid='form-control-suffix'>\n {after}\n </span>\n </div>\n )}\n </div>\n {description && (\n <div data-testid='form-control-description' className='form-text text-muted'>\n {description}\n </div>\n )}\n </div>\n );\n}\n\nregisterComponent(\"FormControl\", FormControl);\n"],"names":["cleanFormControlProps","props","omitted","omit","FormControl","children","name","id","required","before","after","description","label","size","className","jsxs","classnames","jsx","registerComponent"],"mappings":";;;;AAwBO,SAASA,EAAsBC,GAAyBC,IAAoB,IAAS;AAC1F,SAAOC,EAAKF,GAAO,CAAC,SAAS,eAAe,UAAU,UAAU,QAAQ,UAAU,GAAGC,CAAO,CAAC;AAC/F;AAEO,SAASE,EAA6B;AAAA,EAC3C,UAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,IAAAC,IAAKD;AAAA,EACL,UAAAE;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,WAAAC;AACF,GAA+C;AAC7C,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,eAAaT,KAAQ,cAAcA,CAAI;AAAA,MACvC,IAAI,cAAcA,KAAQ,EAAE;AAAA,MAC5B,WAAWU;AAAAA,QACT;AAAA,QACA;AAAA,UACE,gBAAgB,CAAC,CAACP;AAAA,UAClB,eAAe,CAAC,CAACC;AAAA,QAAA;AAAA,QAEnBG,KAAQ,SAASA,CAAI;AAAA,QACrBC;AAAA,MAAA;AAAA,MAGD,UAAA;AAAA,QAAAF,KACC,gBAAAK,EAAC,SAAA,EAAM,SAASV,GAAI,eAAY,sBAAqB,WAAW,kBAAkBC,IAAW,oBAAoB,EAAE,IAChH,UAAAI,GACH;AAAA,QAEF,gBAAAG,EAAC,OAAA,EAAI,WAAW,eACb,UAAA;AAAA,UAAAN,KACC,gBAAAQ,EAAC,OAAA,EAAI,WAAU,uBACb,UAAA,gBAAAA,EAAC,QAAA,EAAK,WAAU,oBAAmB,eAAY,uBAC5C,UAAAR,EAAA,CACH,GACF;AAAA,UAEDJ;AAAA,UACAK,KACC,gBAAAO,EAAC,OAAA,EAAI,WAAU,sBACb,UAAA,gBAAAA,EAAC,QAAA,EAAK,WAAU,oBAAmB,eAAY,uBAC5C,UAAAP,EAAA,CACH,EAAA,CACF;AAAA,QAAA,GAEJ;AAAA,QACCC,KACC,gBAAAM,EAAC,OAAA,EAAI,eAAY,4BAA2B,WAAU,wBACnD,UAAAN,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;AAEAO,EAAkB,eAAed,CAAW;"}
@@ -1,8 +1,2 @@
1
- import { FormControlProps } from '../form-control/FormControl';
2
- export interface InputTagsProps<T = any> extends Omit<FormControlProps, "description" | "prefix" | "suffix"> {
3
- value?: T;
4
- onChange?: (name: string, value: T) => void;
5
- placeholder?: string;
6
- [key: string]: any;
7
- }
8
- export declare function InputTags({ name, value, label, onChange, required, description, prefix, suffix, ...props }: InputTagsProps): import("react/jsx-runtime").JSX.Element;
1
+ import { InputTagsProps } from './InputTags.interface';
2
+ export declare function InputTags<Data = string>(props: InputTagsProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ import { FormControlProps } from '../form-control/FormControl';
3
+ export interface InputTagsProps<Data = string> extends FormControlProps<Data[], InputHTMLAttributes<HTMLInputElement>> {
4
+ layout?: "html5" | "react" | "choicesjs";
5
+ delimiter?: string;
6
+ customProperties?: Record<string, any>;
7
+ }
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=InputTags.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InputTags.interface.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,31 +1,25 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import a from "@formio/choices.js";
3
- import I from "lodash/uniq";
4
- import { useRef as E, useEffect as v } from "react";
5
- import { registerComponent as x } from "../../../registries/components.js";
6
- import { FormControl as y } from "../form-control/FormControl.js";
7
- function L({ name: t, value: o = [], label: d, onChange: e, required: i, description: p, prefix: u, suffix: c, ...f }) {
8
- const n = E();
9
- return v(() => {
10
- const r = new a(n.current, {
11
- delimiter: ",",
12
- editItems: !0,
13
- removeItemButton: !0
14
- });
15
- return r.setValue([].concat(o, [])), r.passedElement.element.addEventListener("addItem", (m) => {
16
- e && e(t, I(o.concat(m.detail.value)));
17
- }), r.passedElement.element.addEventListener("removeItem", (m) => {
18
- e && e(
19
- t,
20
- o.filter((l) => l !== m.detail.value)
21
- );
22
- }), () => {
23
- r.destroy();
24
- };
25
- }, []), /* @__PURE__ */ s(y, { name: t, label: d, required: i, description: p, prefix: u, suffix: c, children: /* @__PURE__ */ s("input", { ref: n, type: "text", ...f, id: t, required: i }) });
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { registerComponent as d, getComponent as r } from "../../../registries/components.js";
3
+ function I(s) {
4
+ const { name: o, id: t = o, label: p, required: e, description: i, before: m, after: a, size: c, className: u, layout: l = "choicesjs", ...f } = s, g = r("FormControl"), C = r([`InputTags.${l}`, "Input"]);
5
+ return /* @__PURE__ */ n(
6
+ g,
7
+ {
8
+ id: t,
9
+ name: o,
10
+ label: p,
11
+ required: e,
12
+ description: i,
13
+ before: m,
14
+ after: a,
15
+ size: c,
16
+ className: u,
17
+ children: /* @__PURE__ */ n(C, { ...f, id: t, name: o, required: e })
18
+ }
19
+ );
26
20
  }
27
- x("InputTags", L);
21
+ d("InputTags", I);
28
22
  export {
29
- L as InputTags
23
+ I as InputTags
30
24
  };
31
25
  //# sourceMappingURL=InputTags.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InputTags.js","sources":["../../../../src/molecules/forms/input-tags/InputTags.tsx"],"sourcesContent":["import Choices from \"@formio/choices.js\";\nimport uniq from \"lodash/uniq\";\nimport { useEffect, useRef } from \"react\";\n\nimport { registerComponent } from \"../../../registries/components\";\nimport { FormControl, FormControlProps } from \"../form-control/FormControl\";\n\nexport interface InputTagsProps<T = any> extends Omit<FormControlProps, \"description\" | \"prefix\" | \"suffix\"> {\n value?: T;\n onChange?: (name: string, value: T) => void;\n placeholder?: string;\n\n [key: string]: any;\n}\n\nexport function InputTags({ name, value = [], label, onChange, required, description, prefix, suffix, ...props }: InputTagsProps) {\n const ref: any = useRef();\n\n useEffect(() => {\n const instance = new Choices(ref.current, {\n delimiter: \",\",\n editItems: true,\n removeItemButton: true\n });\n\n instance.setValue([].concat(value, []));\n\n instance.passedElement.element.addEventListener(\"addItem\", (event: any) => {\n onChange && onChange(name, uniq(value.concat(event.detail.value)));\n });\n\n instance.passedElement.element.addEventListener(\"removeItem\", (event: any) => {\n onChange &&\n onChange(\n name,\n value.filter((v: string) => v !== event.detail.value)\n );\n });\n\n return () => {\n instance.destroy();\n };\n }, []);\n\n return (\n <FormControl name={name} label={label} required={required} description={description} prefix={prefix} suffix={suffix}>\n <input ref={ref} type='text' {...props} id={name} required={required} />\n </FormControl>\n );\n}\n\nregisterComponent(\"InputTags\", InputTags);\n"],"names":["InputTags","name","value","label","onChange","required","description","prefix","suffix","props","ref","useRef","useEffect","instance","Choices","event","uniq","v","FormControl","jsx","registerComponent"],"mappings":";;;;;;AAeO,SAASA,EAAU,EAAE,MAAAC,GAAM,OAAAC,IAAQ,CAAA,GAAI,OAAAC,GAAO,UAAAC,GAAU,UAAAC,GAAU,aAAAC,GAAa,QAAAC,GAAQ,QAAAC,GAAQ,GAAGC,KAAyB;AAChI,QAAMC,IAAWC,EAAO;AAExB,SAAAC,EAAU,MAAM;AACd,UAAMC,IAAW,IAAIC,EAAQJ,EAAI,SAAS;AAAA,MACxC,WAAW;AAAA,MACX,WAAW;AAAA,MACX,kBAAkB;AAAA,IAAA,CACnB;AAED,WAAAG,EAAS,SAAS,CAAC,EAAE,OAAOX,GAAO,CAAE,CAAA,CAAC,GAEtCW,EAAS,cAAc,QAAQ,iBAAiB,WAAW,CAACE,MAAe;AAC7D,MAAAX,KAAAA,EAASH,GAAMe,EAAKd,EAAM,OAAOa,EAAM,OAAO,KAAK,CAAC,CAAC;AAAA,IAAA,CAClE,GAEDF,EAAS,cAAc,QAAQ,iBAAiB,cAAc,CAACE,MAAe;AAE1E,MAAAX,KAAAA;AAAA,QACEH;AAAA,QACAC,EAAM,OAAO,CAACe,MAAcA,MAAMF,EAAM,OAAO,KAAK;AAAA,MACtD;AAAA,IAAA,CACH,GAEM,MAAM;AACX,MAAAF,EAAS,QAAQ;AAAA,IACnB;AAAA,EACF,GAAG,EAAE,qBAGFK,GAAY,EAAA,MAAAjB,GAAY,OAAAE,GAAc,UAAAE,GAAoB,aAAAC,GAA0B,QAAAC,GAAgB,QAAAC,GACnG,UAAA,gBAAAW,EAAC,SAAM,EAAA,KAAAT,GAAU,MAAK,QAAQ,GAAGD,GAAO,IAAIR,GAAM,UAAAI,EAAoB,CAAA,GACxE;AAEJ;AAEAe,EAAkB,aAAapB,CAAS;"}
1
+ {"version":3,"file":"InputTags.js","sources":["../../../../src/molecules/forms/input-tags/InputTags.tsx"],"sourcesContent":["import { ComponentType } from \"react\";\n\nimport { getComponent, registerComponent } from \"../../../registries/components\";\nimport { type FormControl as DefaultFormControl } from \"../form-control/FormControl\";\nimport type { InputTagsProps } from \"./InputTags.interface\";\n\nexport function InputTags<Data = string>(props: InputTagsProps) {\n const { name, id = name, label, required, description, before, after, size, className, layout = \"choicesjs\", ...otherProps } = props;\n\n const FormControl = getComponent<typeof DefaultFormControl>(\"FormControl\");\n const Component = getComponent<ComponentType<InputTagsProps<Data>>>([`InputTags.${layout}`, \"Input\"]);\n\n return (\n <FormControl\n id={id}\n name={name}\n label={label}\n required={required}\n description={description}\n before={before}\n after={after}\n size={size}\n className={className}\n >\n <Component {...(otherProps as any)} id={id} name={name} required={required} />\n </FormControl>\n );\n}\n\nregisterComponent(\"InputTags\", InputTags);\n"],"names":["InputTags","props","name","id","label","required","description","before","after","size","className","layout","otherProps","FormControl","getComponent","Component","jsx","registerComponent"],"mappings":";;AAMO,SAASA,EAAyBC,GAAuB;AAC9D,QAAM,EAAE,MAAAC,GAAM,IAAAC,IAAKD,GAAM,OAAAE,GAAO,UAAAC,GAAU,aAAAC,GAAa,QAAAC,GAAQ,OAAAC,GAAO,MAAAC,GAAM,WAAAC,GAAW,QAAAC,IAAS,aAAa,GAAGC,MAAeX,GAEzHY,IAAcC,EAAwC,aAAa,GACnEC,IAAYD,EAAkD,CAAC,aAAaH,CAAM,IAAI,OAAO,CAAC;AAEpG,SACE,gBAAAK;AAAA,IAACH;AAAA,IAAA;AAAA,MACC,IAAAV;AAAA,MACA,MAAAD;AAAA,MACA,OAAAE;AAAA,MACA,UAAAC;AAAA,MACA,aAAAC;AAAA,MACA,QAAAC;AAAA,MACA,OAAAC;AAAA,MACA,MAAAC;AAAA,MACA,WAAAC;AAAA,MAEA,4BAACK,GAAA,EAAW,GAAIH,GAAoB,IAAAT,GAAQ,MAAAD,GAAY,UAAAG,EAAA,CAAoB;AAAA,IAAA;AAAA,EAAA;AAGlF;AAEAY,EAAkB,aAAajB,CAAS;"}
@@ -0,0 +1,2 @@
1
+ export * from './InputTags';
2
+ export * from './InputTags.interface';
@@ -0,0 +1,9 @@
1
+ import "../form-control/FormControl.js";
2
+ import "./components/ChoicesTags.js";
3
+ import "./components/ReactTags.js";
4
+ import "../input-text/InputText.js";
5
+ import { InputTags as a } from "./InputTags.js";
6
+ export {
7
+ a as InputTags
8
+ };
9
+ //# sourceMappingURL=all.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"all.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -0,0 +1,307 @@
1
+ import { default as Choices } from '@formio/choices.js';
2
+ import { InputTagsProps } from '../InputTags.interface';
3
+ export declare function useChoiceTags<Data = string>(props: InputTagsProps<Data>): {
4
+ otherProps: {
5
+ name: string;
6
+ layout?: "html5" | "react" | "choicesjs";
7
+ label?: string;
8
+ description?: string | import('react').ReactNode;
9
+ before?: import('react').ReactNode | string;
10
+ after?: import('react').ReactNode | string;
11
+ shadow?: boolean;
12
+ size?: "small" | string;
13
+ resource?: string | undefined | undefined;
14
+ type?: import('react').HTMLInputTypeAttribute | undefined;
15
+ placeholder?: string | undefined | undefined;
16
+ prefix?: string | undefined | undefined;
17
+ multiple?: boolean | undefined | undefined;
18
+ hidden?: boolean | undefined | undefined;
19
+ disabled?: boolean | undefined | undefined;
20
+ defaultValue?: string | number | readonly string[] | undefined;
21
+ src?: string | undefined | undefined;
22
+ form?: string | undefined | undefined;
23
+ content?: string | undefined | undefined;
24
+ inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | undefined;
25
+ width?: number | string | undefined | undefined;
26
+ height?: number | string | undefined | undefined;
27
+ title?: string | undefined | undefined;
28
+ onClick?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
29
+ defaultChecked?: boolean | undefined | undefined;
30
+ suppressContentEditableWarning?: boolean | undefined | undefined;
31
+ suppressHydrationWarning?: boolean | undefined | undefined;
32
+ accessKey?: string | undefined | undefined;
33
+ autoFocus?: boolean | undefined | undefined;
34
+ className?: string | undefined | undefined;
35
+ contentEditable?: (boolean | "true" | "false") | "inherit" | undefined;
36
+ contextMenu?: string | undefined | undefined;
37
+ dir?: string | undefined | undefined;
38
+ draggable?: (boolean | "true" | "false") | undefined;
39
+ id?: string | undefined | undefined;
40
+ lang?: string | undefined | undefined;
41
+ nonce?: string | undefined | undefined;
42
+ slot?: string | undefined | undefined;
43
+ spellCheck?: (boolean | "true" | "false") | undefined;
44
+ style?: import('react').CSSProperties | undefined;
45
+ tabIndex?: number | undefined | undefined;
46
+ translate?: "yes" | "no" | undefined | undefined;
47
+ radioGroup?: string | undefined | undefined;
48
+ role?: import('react').AriaRole | undefined;
49
+ about?: string | undefined | undefined;
50
+ datatype?: string | undefined | undefined;
51
+ inlist?: any;
52
+ property?: string | undefined | undefined;
53
+ rel?: string | undefined | undefined;
54
+ rev?: string | undefined | undefined;
55
+ typeof?: string | undefined | undefined;
56
+ vocab?: string | undefined | undefined;
57
+ autoCapitalize?: string | undefined | undefined;
58
+ autoCorrect?: string | undefined | undefined;
59
+ autoSave?: string | undefined | undefined;
60
+ color?: string | undefined | undefined;
61
+ itemProp?: string | undefined | undefined;
62
+ itemScope?: boolean | undefined | undefined;
63
+ itemType?: string | undefined | undefined;
64
+ itemID?: string | undefined | undefined;
65
+ itemRef?: string | undefined | undefined;
66
+ results?: number | undefined | undefined;
67
+ security?: string | undefined | undefined;
68
+ unselectable?: "on" | "off" | undefined | undefined;
69
+ is?: string | undefined | undefined;
70
+ 'aria-activedescendant'?: string | undefined | undefined;
71
+ 'aria-atomic'?: (boolean | "true" | "false") | undefined;
72
+ 'aria-autocomplete'?: "none" | "inline" | "list" | "both" | undefined | undefined;
73
+ 'aria-busy'?: (boolean | "true" | "false") | undefined;
74
+ 'aria-checked'?: boolean | "false" | "mixed" | "true" | undefined | undefined;
75
+ 'aria-colcount'?: number | undefined | undefined;
76
+ 'aria-colindex'?: number | undefined | undefined;
77
+ 'aria-colspan'?: number | undefined | undefined;
78
+ 'aria-controls'?: string | undefined | undefined;
79
+ 'aria-current'?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined | undefined;
80
+ 'aria-describedby'?: string | undefined | undefined;
81
+ 'aria-details'?: string | undefined | undefined;
82
+ 'aria-disabled'?: (boolean | "true" | "false") | undefined;
83
+ 'aria-dropeffect'?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined | undefined;
84
+ 'aria-errormessage'?: string | undefined | undefined;
85
+ 'aria-expanded'?: (boolean | "true" | "false") | undefined;
86
+ 'aria-flowto'?: string | undefined | undefined;
87
+ 'aria-grabbed'?: (boolean | "true" | "false") | undefined;
88
+ 'aria-haspopup'?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined | undefined;
89
+ 'aria-hidden'?: (boolean | "true" | "false") | undefined;
90
+ 'aria-invalid'?: boolean | "false" | "true" | "grammar" | "spelling" | undefined | undefined;
91
+ 'aria-keyshortcuts'?: string | undefined | undefined;
92
+ 'aria-label'?: string | undefined | undefined;
93
+ 'aria-labelledby'?: string | undefined | undefined;
94
+ 'aria-level'?: number | undefined | undefined;
95
+ 'aria-live'?: "off" | "assertive" | "polite" | undefined | undefined;
96
+ 'aria-modal'?: (boolean | "true" | "false") | undefined;
97
+ 'aria-multiline'?: (boolean | "true" | "false") | undefined;
98
+ 'aria-multiselectable'?: (boolean | "true" | "false") | undefined;
99
+ 'aria-orientation'?: "horizontal" | "vertical" | undefined | undefined;
100
+ 'aria-owns'?: string | undefined | undefined;
101
+ 'aria-placeholder'?: string | undefined | undefined;
102
+ 'aria-posinset'?: number | undefined | undefined;
103
+ 'aria-pressed'?: boolean | "false" | "mixed" | "true" | undefined | undefined;
104
+ 'aria-readonly'?: (boolean | "true" | "false") | undefined;
105
+ 'aria-relevant'?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined | undefined;
106
+ 'aria-required'?: (boolean | "true" | "false") | undefined;
107
+ 'aria-roledescription'?: string | undefined | undefined;
108
+ 'aria-rowcount'?: number | undefined | undefined;
109
+ 'aria-rowindex'?: number | undefined | undefined;
110
+ 'aria-rowspan'?: number | undefined | undefined;
111
+ 'aria-selected'?: (boolean | "true" | "false") | undefined;
112
+ 'aria-setsize'?: number | undefined | undefined;
113
+ 'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined | undefined;
114
+ 'aria-valuemax'?: number | undefined | undefined;
115
+ 'aria-valuemin'?: number | undefined | undefined;
116
+ 'aria-valuenow'?: number | undefined | undefined;
117
+ 'aria-valuetext'?: string | undefined | undefined;
118
+ children?: import('react').ReactNode;
119
+ dangerouslySetInnerHTML?: {
120
+ __html: string | TrustedHTML;
121
+ } | undefined | undefined;
122
+ onCopy?: import('react').ClipboardEventHandler<HTMLInputElement> | undefined;
123
+ onCopyCapture?: import('react').ClipboardEventHandler<HTMLInputElement> | undefined;
124
+ onCut?: import('react').ClipboardEventHandler<HTMLInputElement> | undefined;
125
+ onCutCapture?: import('react').ClipboardEventHandler<HTMLInputElement> | undefined;
126
+ onPaste?: import('react').ClipboardEventHandler<HTMLInputElement> | undefined;
127
+ onPasteCapture?: import('react').ClipboardEventHandler<HTMLInputElement> | undefined;
128
+ onCompositionEnd?: import('react').CompositionEventHandler<HTMLInputElement> | undefined;
129
+ onCompositionEndCapture?: import('react').CompositionEventHandler<HTMLInputElement> | undefined;
130
+ onCompositionStart?: import('react').CompositionEventHandler<HTMLInputElement> | undefined;
131
+ onCompositionStartCapture?: import('react').CompositionEventHandler<HTMLInputElement> | undefined;
132
+ onCompositionUpdate?: import('react').CompositionEventHandler<HTMLInputElement> | undefined;
133
+ onCompositionUpdateCapture?: import('react').CompositionEventHandler<HTMLInputElement> | undefined;
134
+ onFocus?: import('react').FocusEventHandler<HTMLInputElement> | undefined;
135
+ onFocusCapture?: import('react').FocusEventHandler<HTMLInputElement> | undefined;
136
+ onBlur?: import('react').FocusEventHandler<HTMLInputElement> | undefined;
137
+ onBlurCapture?: import('react').FocusEventHandler<HTMLInputElement> | undefined;
138
+ onChangeCapture?: import('react').FormEventHandler<HTMLInputElement> | undefined;
139
+ onBeforeInput?: import('react').FormEventHandler<HTMLInputElement> | undefined;
140
+ onBeforeInputCapture?: import('react').FormEventHandler<HTMLInputElement> | undefined;
141
+ onInput?: import('react').FormEventHandler<HTMLInputElement> | undefined;
142
+ onInputCapture?: import('react').FormEventHandler<HTMLInputElement> | undefined;
143
+ onReset?: import('react').FormEventHandler<HTMLInputElement> | undefined;
144
+ onResetCapture?: import('react').FormEventHandler<HTMLInputElement> | undefined;
145
+ onSubmit?: import('react').FormEventHandler<HTMLInputElement> | undefined;
146
+ onSubmitCapture?: import('react').FormEventHandler<HTMLInputElement> | undefined;
147
+ onInvalid?: import('react').FormEventHandler<HTMLInputElement> | undefined;
148
+ onInvalidCapture?: import('react').FormEventHandler<HTMLInputElement> | undefined;
149
+ onLoad?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
150
+ onLoadCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
151
+ onError?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
152
+ onErrorCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
153
+ onKeyDown?: import('react').KeyboardEventHandler<HTMLInputElement> | undefined;
154
+ onKeyDownCapture?: import('react').KeyboardEventHandler<HTMLInputElement> | undefined;
155
+ onKeyPress?: import('react').KeyboardEventHandler<HTMLInputElement> | undefined;
156
+ onKeyPressCapture?: import('react').KeyboardEventHandler<HTMLInputElement> | undefined;
157
+ onKeyUp?: import('react').KeyboardEventHandler<HTMLInputElement> | undefined;
158
+ onKeyUpCapture?: import('react').KeyboardEventHandler<HTMLInputElement> | undefined;
159
+ onAbort?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
160
+ onAbortCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
161
+ onCanPlay?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
162
+ onCanPlayCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
163
+ onCanPlayThrough?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
164
+ onCanPlayThroughCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
165
+ onDurationChange?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
166
+ onDurationChangeCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
167
+ onEmptied?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
168
+ onEmptiedCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
169
+ onEncrypted?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
170
+ onEncryptedCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
171
+ onEnded?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
172
+ onEndedCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
173
+ onLoadedData?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
174
+ onLoadedDataCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
175
+ onLoadedMetadata?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
176
+ onLoadedMetadataCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
177
+ onLoadStart?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
178
+ onLoadStartCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
179
+ onPause?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
180
+ onPauseCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
181
+ onPlay?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
182
+ onPlayCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
183
+ onPlaying?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
184
+ onPlayingCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
185
+ onProgress?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
186
+ onProgressCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
187
+ onRateChange?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
188
+ onRateChangeCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
189
+ onResize?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
190
+ onResizeCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
191
+ onSeeked?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
192
+ onSeekedCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
193
+ onSeeking?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
194
+ onSeekingCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
195
+ onStalled?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
196
+ onStalledCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
197
+ onSuspend?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
198
+ onSuspendCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
199
+ onTimeUpdate?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
200
+ onTimeUpdateCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
201
+ onVolumeChange?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
202
+ onVolumeChangeCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
203
+ onWaiting?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
204
+ onWaitingCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
205
+ onAuxClick?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
206
+ onAuxClickCapture?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
207
+ onClickCapture?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
208
+ onContextMenu?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
209
+ onContextMenuCapture?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
210
+ onDoubleClick?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
211
+ onDoubleClickCapture?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
212
+ onDrag?: import('react').DragEventHandler<HTMLInputElement> | undefined;
213
+ onDragCapture?: import('react').DragEventHandler<HTMLInputElement> | undefined;
214
+ onDragEnd?: import('react').DragEventHandler<HTMLInputElement> | undefined;
215
+ onDragEndCapture?: import('react').DragEventHandler<HTMLInputElement> | undefined;
216
+ onDragEnter?: import('react').DragEventHandler<HTMLInputElement> | undefined;
217
+ onDragEnterCapture?: import('react').DragEventHandler<HTMLInputElement> | undefined;
218
+ onDragExit?: import('react').DragEventHandler<HTMLInputElement> | undefined;
219
+ onDragExitCapture?: import('react').DragEventHandler<HTMLInputElement> | undefined;
220
+ onDragLeave?: import('react').DragEventHandler<HTMLInputElement> | undefined;
221
+ onDragLeaveCapture?: import('react').DragEventHandler<HTMLInputElement> | undefined;
222
+ onDragOver?: import('react').DragEventHandler<HTMLInputElement> | undefined;
223
+ onDragOverCapture?: import('react').DragEventHandler<HTMLInputElement> | undefined;
224
+ onDragStart?: import('react').DragEventHandler<HTMLInputElement> | undefined;
225
+ onDragStartCapture?: import('react').DragEventHandler<HTMLInputElement> | undefined;
226
+ onDrop?: import('react').DragEventHandler<HTMLInputElement> | undefined;
227
+ onDropCapture?: import('react').DragEventHandler<HTMLInputElement> | undefined;
228
+ onMouseDown?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
229
+ onMouseDownCapture?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
230
+ onMouseEnter?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
231
+ onMouseLeave?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
232
+ onMouseMove?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
233
+ onMouseMoveCapture?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
234
+ onMouseOut?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
235
+ onMouseOutCapture?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
236
+ onMouseOver?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
237
+ onMouseOverCapture?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
238
+ onMouseUp?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
239
+ onMouseUpCapture?: import('react').MouseEventHandler<HTMLInputElement> | undefined;
240
+ onSelect?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
241
+ onSelectCapture?: import('react').ReactEventHandler<HTMLInputElement> | undefined;
242
+ onTouchCancel?: import('react').TouchEventHandler<HTMLInputElement> | undefined;
243
+ onTouchCancelCapture?: import('react').TouchEventHandler<HTMLInputElement> | undefined;
244
+ onTouchEnd?: import('react').TouchEventHandler<HTMLInputElement> | undefined;
245
+ onTouchEndCapture?: import('react').TouchEventHandler<HTMLInputElement> | undefined;
246
+ onTouchMove?: import('react').TouchEventHandler<HTMLInputElement> | undefined;
247
+ onTouchMoveCapture?: import('react').TouchEventHandler<HTMLInputElement> | undefined;
248
+ onTouchStart?: import('react').TouchEventHandler<HTMLInputElement> | undefined;
249
+ onTouchStartCapture?: import('react').TouchEventHandler<HTMLInputElement> | undefined;
250
+ onPointerDown?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
251
+ onPointerDownCapture?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
252
+ onPointerMove?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
253
+ onPointerMoveCapture?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
254
+ onPointerUp?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
255
+ onPointerUpCapture?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
256
+ onPointerCancel?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
257
+ onPointerCancelCapture?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
258
+ onPointerEnter?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
259
+ onPointerEnterCapture?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
260
+ onPointerLeave?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
261
+ onPointerLeaveCapture?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
262
+ onPointerOver?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
263
+ onPointerOverCapture?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
264
+ onPointerOut?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
265
+ onPointerOutCapture?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
266
+ onGotPointerCapture?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
267
+ onGotPointerCaptureCapture?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
268
+ onLostPointerCapture?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
269
+ onLostPointerCaptureCapture?: import('react').PointerEventHandler<HTMLInputElement> | undefined;
270
+ onScroll?: import('react').UIEventHandler<HTMLInputElement> | undefined;
271
+ onScrollCapture?: import('react').UIEventHandler<HTMLInputElement> | undefined;
272
+ onWheel?: import('react').WheelEventHandler<HTMLInputElement> | undefined;
273
+ onWheelCapture?: import('react').WheelEventHandler<HTMLInputElement> | undefined;
274
+ onAnimationStart?: import('react').AnimationEventHandler<HTMLInputElement> | undefined;
275
+ onAnimationStartCapture?: import('react').AnimationEventHandler<HTMLInputElement> | undefined;
276
+ onAnimationEnd?: import('react').AnimationEventHandler<HTMLInputElement> | undefined;
277
+ onAnimationEndCapture?: import('react').AnimationEventHandler<HTMLInputElement> | undefined;
278
+ onAnimationIteration?: import('react').AnimationEventHandler<HTMLInputElement> | undefined;
279
+ onAnimationIterationCapture?: import('react').AnimationEventHandler<HTMLInputElement> | undefined;
280
+ onTransitionEnd?: import('react').TransitionEventHandler<HTMLInputElement> | undefined;
281
+ onTransitionEndCapture?: import('react').TransitionEventHandler<HTMLInputElement> | undefined;
282
+ pattern?: string | undefined | undefined;
283
+ list?: string | undefined | undefined;
284
+ step?: number | string | undefined | undefined;
285
+ formAction?: string | undefined;
286
+ formEncType?: string | undefined | undefined;
287
+ formMethod?: string | undefined | undefined;
288
+ formNoValidate?: boolean | undefined | undefined;
289
+ formTarget?: string | undefined | undefined;
290
+ accept?: string | undefined | undefined;
291
+ alt?: string | undefined | undefined;
292
+ autoComplete?: string | undefined | undefined;
293
+ capture?: boolean | "user" | "environment" | undefined | undefined;
294
+ checked?: boolean | undefined | undefined;
295
+ crossOrigin?: "anonymous" | "use-credentials" | "" | undefined | undefined;
296
+ enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
297
+ max?: number | string | undefined | undefined;
298
+ maxLength?: number | undefined | undefined;
299
+ min?: number | string | undefined | undefined;
300
+ minLength?: number | undefined | undefined;
301
+ readOnly?: boolean | undefined | undefined;
302
+ required?: boolean | undefined | undefined;
303
+ };
304
+ ref: import('react').MutableRefObject<HTMLInputElement | null>;
305
+ instanceRef: import('react').MutableRefObject<Choices | null>;
306
+ };
307
+ export declare function ChoicesTags<Data = string>(props: InputTagsProps<Data>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,51 @@
1
+ import { jsx as h } from "react/jsx-runtime";
2
+ import g from "@formio/choices.js";
3
+ import { useRef as i, useEffect as C } from "react";
4
+ import { c as a } from "../../../../chunks/index.module.js";
5
+ import { registerComponent as I } from "../../../../registries/components.js";
6
+ import { cleanFormControlProps as E } from "../../form-control/FormControl.js";
7
+ function P(s) {
8
+ const { value: r, onChange: o, name: c = "", delimiter: u, customProperties: l, ...p } = s, m = i(null), n = i(null), f = a((e) => {
9
+ const t = (r || []).concat(e);
10
+ o?.(c, [...t]);
11
+ }, 100), d = a((e) => {
12
+ const t = (r || []).filter((v) => v !== e);
13
+ o?.(c, [...t]);
14
+ });
15
+ return C(() => {
16
+ if (m.current) {
17
+ const e = new g(m.current, {
18
+ duplicateItemsAllowed: !1,
19
+ ...l,
20
+ delimiter: u,
21
+ editItems: !0,
22
+ removeItemButton: !0
23
+ });
24
+ e.setValue(r || []), n.current = e, e.passedElement.element.addEventListener("addItem", (t) => {
25
+ f(t.target.value);
26
+ }), e.passedElement.element.addEventListener("removeItem", (t) => {
27
+ d(t.target.value);
28
+ });
29
+ }
30
+ return () => {
31
+ n.current && n.current.destroy();
32
+ };
33
+ }, [u]), {
34
+ otherProps: {
35
+ ...p,
36
+ name: c
37
+ },
38
+ ref: m,
39
+ instanceRef: n
40
+ };
41
+ }
42
+ function x(s) {
43
+ const { ref: r, otherProps: o } = P(s);
44
+ return /* @__PURE__ */ h("input", { type: "text", ...E(o), ref: r });
45
+ }
46
+ I("InputTags.choicesjs", x);
47
+ export {
48
+ x as ChoicesTags,
49
+ P as useChoiceTags
50
+ };
51
+ //# sourceMappingURL=ChoicesTags.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChoicesTags.js","sources":["../../../../../src/molecules/forms/input-tags/components/ChoicesTags.tsx"],"sourcesContent":["import Choices from \"@formio/choices.js\";\nimport { useEffect, useRef } from \"react\";\nimport { useDebouncedCallback } from \"use-debounce\";\n\nimport { registerComponent } from \"../../../../registries/components\";\nimport { cleanFormControlProps } from \"../../form-control/FormControl\";\nimport type { InputTagsProps } from \"../InputTags.interface\";\n\nexport function useChoiceTags<Data = string>(props: InputTagsProps<Data>) {\n const { value, onChange, name = \"\", delimiter, customProperties, ...otherProps } = props;\n const ref = useRef<HTMLInputElement | null>(null);\n const instanceRef = useRef<Choices | null>(null);\n\n const onAdd = useDebouncedCallback((add: Data) => {\n const values = ((value || []) as Data[]).concat(add);\n\n onChange?.(name, [...values]);\n }, 100);\n\n const onDelete = useDebouncedCallback((remove: Data) => {\n const values = (value || []).filter((v) => v !== remove);\n\n onChange?.(name, [...values]);\n });\n\n useEffect(() => {\n if (ref.current) {\n const instance = new Choices(ref.current!, {\n duplicateItemsAllowed: false,\n ...customProperties,\n delimiter,\n editItems: true,\n removeItemButton: true\n });\n\n instance.setValue((value || []) as string[]);\n\n instanceRef.current = instance;\n\n instance.passedElement.element.addEventListener(\"addItem\", (event) => {\n onAdd((event.target as any).value as Data);\n });\n\n instance.passedElement.element.addEventListener(\"removeItem\", (event) => {\n onDelete((event.target as any).value as Data);\n });\n }\n\n return () => {\n if (instanceRef.current) {\n instanceRef.current.destroy();\n }\n };\n }, [delimiter]);\n\n return {\n otherProps: {\n ...otherProps,\n name\n },\n ref,\n instanceRef\n };\n}\n\nexport function ChoicesTags<Data = string>(props: InputTagsProps<Data>) {\n const { ref, otherProps } = useChoiceTags<Data>(props);\n\n return <input type='text' {...cleanFormControlProps(otherProps)} ref={ref} />;\n}\n\nregisterComponent(\"InputTags.choicesjs\", ChoicesTags);\n"],"names":["useChoiceTags","props","value","onChange","name","delimiter","customProperties","otherProps","ref","useRef","instanceRef","onAdd","useDebouncedCallback","add","values","onDelete","remove","useEffect","instance","Choices","event","ChoicesTags","jsx","cleanFormControlProps","registerComponent"],"mappings":";;;;;;AAQO,SAASA,EAA6BC,GAA6B;AACxE,QAAM,EAAE,OAAAC,GAAO,UAAAC,GAAU,MAAAC,IAAO,IAAI,WAAAC,GAAW,kBAAAC,GAAkB,GAAGC,EAAA,IAAeN,GAC7EO,IAAMC,EAAgC,IAAI,GAC1CC,IAAcD,EAAuB,IAAI,GAEzCE,IAAQC,EAAqB,CAACC,MAAc;AAChD,UAAMC,KAAWZ,KAAS,CAAA,GAAe,OAAOW,CAAG;AAEnD,IAAAV,IAAWC,GAAM,CAAC,GAAGU,CAAM,CAAC;AAAA,EAC9B,GAAG,GAAG,GAEAC,IAAWH,EAAqB,CAACI,MAAiB;AACtD,UAAMF,KAAUZ,KAAS,CAAA,GAAI,OAAO,CAAC,MAAM,MAAMc,CAAM;AAEvD,IAAAb,IAAWC,GAAM,CAAC,GAAGU,CAAM,CAAC;AAAA,EAC9B,CAAC;AAED,SAAAG,EAAU,MAAM;AACd,QAAIT,EAAI,SAAS;AACf,YAAMU,IAAW,IAAIC,EAAQX,EAAI,SAAU;AAAA,QACzC,uBAAuB;AAAA,QACvB,GAAGF;AAAA,QACH,WAAAD;AAAA,QACA,WAAW;AAAA,QACX,kBAAkB;AAAA,MAAA,CACnB;AAED,MAAAa,EAAS,SAAUhB,KAAS,EAAe,GAE3CQ,EAAY,UAAUQ,GAEtBA,EAAS,cAAc,QAAQ,iBAAiB,WAAW,CAACE,MAAU;AACpE,QAAAT,EAAOS,EAAM,OAAe,KAAa;AAAA,MAC3C,CAAC,GAEDF,EAAS,cAAc,QAAQ,iBAAiB,cAAc,CAACE,MAAU;AACvE,QAAAL,EAAUK,EAAM,OAAe,KAAa;AAAA,MAC9C,CAAC;AAAA,IACH;AAEA,WAAO,MAAM;AACX,MAAIV,EAAY,WACdA,EAAY,QAAQ,QAAA;AAAA,IAExB;AAAA,EACF,GAAG,CAACL,CAAS,CAAC,GAEP;AAAA,IACL,YAAY;AAAA,MACV,GAAGE;AAAA,MACH,MAAAH;AAAA,IAAA;AAAA,IAEF,KAAAI;AAAA,IACA,aAAAE;AAAA,EAAA;AAEJ;AAEO,SAASW,EAA2BpB,GAA6B;AACtE,QAAM,EAAE,KAAAO,GAAK,YAAAD,MAAeP,EAAoBC,CAAK;AAErD,SAAO,gBAAAqB,EAAC,WAAM,MAAK,QAAQ,GAAGC,EAAsBhB,CAAU,GAAG,KAAAC,GAAU;AAC7E;AAEAgB,EAAkB,uBAAuBH,CAAW;"}
@@ -0,0 +1,2 @@
1
+ import { InputTagsProps } from '../InputTags.interface';
2
+ export declare function ReactTags(props: InputTagsProps): import("react/jsx-runtime").JSX.Element;