@fuf-stack/uniform 1.24.12 → 1.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (341) hide show
  1. package/dist/Checkboxes/{index.d.ts → index.d.mts} +112 -119
  2. package/dist/Checkboxes/index.d.mts.map +1 -0
  3. package/dist/Checkboxes/{index.js → index.mjs} +2 -2
  4. package/dist/Checkboxes/index.mjs.map +1 -0
  5. package/dist/DatePicker/{index.d.cts → index.d.mts} +425 -417
  6. package/dist/{Slider/index.d.cts.map → DatePicker/index.d.mts.map} +1 -1
  7. package/dist/DatePicker/{index.js → index.mjs} +2 -2
  8. package/dist/DatePicker/index.mjs.map +1 -0
  9. package/dist/FieldArray/{index.d.cts → index.d.mts} +177 -164
  10. package/dist/FieldArray/index.d.mts.map +1 -0
  11. package/dist/FieldArray/{index.js → index.mjs} +6 -6
  12. package/dist/FieldArray/index.mjs.map +1 -0
  13. package/dist/FieldCard/{index.d.cts → index.d.mts} +84 -80
  14. package/dist/FieldCard/index.d.mts.map +1 -0
  15. package/dist/FieldCard/{index.js → index.mjs} +4 -4
  16. package/dist/FieldCard/index.mjs.map +1 -0
  17. package/dist/{FieldCopyTestIdButton-CRJBix9D.js → FieldCopyTestIdButton-CRJBix9D.mjs} +1 -1
  18. package/dist/FieldCopyTestIdButton-CRJBix9D.mjs.map +1 -0
  19. package/dist/{FieldValidationError-ByRoIxaM.js → FieldValidationError-ByRoIxaM.mjs} +1 -1
  20. package/dist/FieldValidationError-ByRoIxaM.mjs.map +1 -0
  21. package/dist/{Time/index.d.ts → Form/index.d.mts} +333 -332
  22. package/dist/Form/index.d.mts.map +1 -0
  23. package/dist/Form/index.mjs +159 -0
  24. package/dist/Form/index.mjs.map +1 -0
  25. package/dist/{FormContext-LgzrDWu1.d.ts → FormContext-CsFiNvuJ.d.mts} +1 -2
  26. package/dist/FormContext-CsFiNvuJ.d.mts.map +1 -0
  27. package/dist/{FormContext-DjJOJKxj.js → FormContext-gHSwOlcy.mjs} +2 -2
  28. package/dist/FormContext-gHSwOlcy.mjs.map +1 -0
  29. package/dist/Grid/{index.d.ts → index.d.mts} +2 -7
  30. package/dist/Grid/index.d.mts.map +1 -0
  31. package/dist/Grid/index.mjs +2 -0
  32. package/dist/{Grid-CTs-Rb9G.js → Grid-CTs-Rb9G.mjs} +1 -1
  33. package/dist/{Grid-BbqCRkuY.cjs.map → Grid-CTs-Rb9G.mjs.map} +1 -1
  34. package/dist/Input/{index.d.cts → index.d.mts} +178 -183
  35. package/dist/Input/index.d.mts.map +1 -0
  36. package/dist/Input/{index.js → index.mjs} +3 -3
  37. package/dist/Input/index.mjs.map +1 -0
  38. package/dist/RadioBoxes/{index.d.cts → index.d.mts} +366 -371
  39. package/dist/{Switch/index.d.ts.map → RadioBoxes/index.d.mts.map} +1 -1
  40. package/dist/RadioBoxes/{index.js → index.mjs} +3 -3
  41. package/dist/RadioBoxes/{index.cjs.map → index.mjs.map} +1 -1
  42. package/dist/RadioTabs/{index.d.cts → index.d.mts} +116 -125
  43. package/dist/RadioTabs/index.d.mts.map +1 -0
  44. package/dist/RadioTabs/{index.js → index.mjs} +3 -3
  45. package/dist/RadioTabs/index.mjs.map +1 -0
  46. package/dist/Radios/{index.d.cts → index.d.mts} +360 -365
  47. package/dist/{DatePicker/index.d.ts.map → Radios/index.d.mts.map} +1 -1
  48. package/dist/Radios/{index.js → index.mjs} +3 -3
  49. package/dist/Radios/index.mjs.map +1 -0
  50. package/dist/Select/{index.d.cts → index.d.mts} +1028 -1045
  51. package/dist/Select/{index.d.ts.map → index.d.mts.map} +1 -1
  52. package/dist/Select/{index.js → index.mjs} +5 -6
  53. package/dist/Select/index.mjs.map +1 -0
  54. package/dist/Slider/{index.d.cts → index.d.mts} +451 -464
  55. package/dist/Slider/{index.d.ts.map → index.d.mts.map} +1 -1
  56. package/dist/Slider/{index.js → index.mjs} +2 -2
  57. package/dist/Slider/index.mjs.map +1 -0
  58. package/dist/SubmitButton/index.d.mts +44 -0
  59. package/dist/SubmitButton/index.d.mts.map +1 -0
  60. package/dist/SubmitButton/index.mjs +40 -0
  61. package/dist/SubmitButton/index.mjs.map +1 -0
  62. package/dist/Switch/{index.d.cts → index.d.mts} +323 -332
  63. package/dist/Switch/{index.d.cts.map → index.d.mts.map} +1 -1
  64. package/dist/Switch/{index.js → index.mjs} +2 -2
  65. package/dist/Switch/index.mjs.map +1 -0
  66. package/dist/SwitchBox/{index.d.cts → index.d.mts} +115 -124
  67. package/dist/SwitchBox/index.d.mts.map +1 -0
  68. package/dist/SwitchBox/{index.js → index.mjs} +2 -2
  69. package/dist/SwitchBox/index.mjs.map +1 -0
  70. package/dist/TextArea/{index.d.cts → index.d.mts} +177 -177
  71. package/dist/TextArea/index.d.mts.map +1 -0
  72. package/dist/TextArea/{index.js → index.mjs} +3 -3
  73. package/dist/TextArea/index.mjs.map +1 -0
  74. package/dist/Time/{index.d.cts → index.d.mts} +285 -282
  75. package/dist/Time/index.d.mts.map +1 -0
  76. package/dist/Time/{index.js → index.mjs} +2 -2
  77. package/dist/Time/index.mjs.map +1 -0
  78. package/dist/helpers/{index.d.ts → index.d.mts} +1 -2
  79. package/dist/helpers/index.d.mts.map +1 -0
  80. package/dist/helpers/{index.js → index.mjs} +1 -1
  81. package/dist/helpers/{index.cjs.map → index.mjs.map} +1 -1
  82. package/dist/hooks/useClientValidation/{index.d.ts → index.d.mts} +1 -2
  83. package/dist/hooks/useClientValidation/index.d.mts.map +1 -0
  84. package/dist/hooks/useClientValidation/{index.js → index.mjs} +3 -3
  85. package/dist/hooks/useClientValidation/index.mjs.map +1 -0
  86. package/dist/hooks/useController/{index.d.cts → index.d.mts} +2 -1
  87. package/dist/hooks/useController/index.mjs +7 -0
  88. package/dist/hooks/useController/{index.cjs.map → index.mjs.map} +1 -1
  89. package/dist/hooks/useFormContext/index.d.mts +3 -0
  90. package/dist/hooks/useFormContext/{index.js → index.mjs} +2 -2
  91. package/dist/hooks/useFormContext/{index.cjs.map → index.mjs.map} +1 -1
  92. package/dist/hooks/useInput/index.d.mts +2 -0
  93. package/dist/hooks/useInput/index.mjs +7 -0
  94. package/dist/hooks/useInput/{index.cjs.map → index.mjs.map} +1 -1
  95. package/dist/hooks/useInputValueDebounce/{index.d.ts → index.d.mts} +2 -8
  96. package/dist/hooks/useInputValueDebounce/index.d.mts.map +1 -0
  97. package/dist/hooks/useInputValueDebounce/{index.js → index.mjs} +2 -2
  98. package/dist/hooks/useInputValueDebounce/index.mjs.map +1 -0
  99. package/dist/hooks/useInputValueTransform/{index.d.cts → index.d.mts} +2 -1
  100. package/dist/hooks/useInputValueTransform/{index.js → index.mjs} +2 -2
  101. package/dist/hooks/useInputValueTransform/{index.cjs.map → index.mjs.map} +1 -1
  102. package/dist/hooks/useUniformField/{index.d.ts → index.d.mts} +5 -6
  103. package/dist/hooks/useUniformField/index.d.mts.map +1 -0
  104. package/dist/hooks/useUniformField/{index.js → index.mjs} +8 -8
  105. package/dist/hooks/useUniformField/index.mjs.map +1 -0
  106. package/dist/hooks/useUniformFieldArray/{index.d.ts → index.d.mts} +6 -13
  107. package/dist/hooks/useUniformFieldArray/index.d.mts.map +1 -0
  108. package/dist/hooks/useUniformFieldArray/{index.js → index.mjs} +5 -5
  109. package/dist/hooks/useUniformFieldArray/index.mjs.map +1 -0
  110. package/dist/hooks/useWatchFormReset/{index.d.ts → index.d.mts} +2 -4
  111. package/dist/hooks/useWatchFormReset/index.d.mts.map +1 -0
  112. package/dist/hooks/useWatchFormReset/{index.js → index.mjs} +2 -2
  113. package/dist/hooks/useWatchFormReset/index.mjs.map +1 -0
  114. package/dist/hooks/useWatchUserChange/{index.d.ts → index.d.mts} +2 -6
  115. package/dist/hooks/useWatchUserChange/index.d.mts.map +1 -0
  116. package/dist/hooks/useWatchUserChange/{index.js → index.mjs} +2 -2
  117. package/dist/hooks/useWatchUserChange/index.mjs.map +1 -0
  118. package/dist/index-CAdGtKE_.d.mts +1 -0
  119. package/dist/index-CaxrMD1A.d.mts +1 -0
  120. package/dist/index-CwJo1b4Z.d.mts +1 -0
  121. package/dist/partials/FieldCopyTestIdButton/{index.d.ts → index.d.mts} +2 -5
  122. package/dist/partials/FieldCopyTestIdButton/index.d.mts.map +1 -0
  123. package/dist/partials/FieldCopyTestIdButton/{index.js → index.mjs} +1 -1
  124. package/dist/partials/FieldValidationError/{index.d.ts → index.d.mts} +2 -7
  125. package/dist/partials/FieldValidationError/index.d.mts.map +1 -0
  126. package/dist/partials/FieldValidationError/{index.js → index.mjs} +1 -1
  127. package/dist/{useController-DxFS0u7c.js → useController-CK39i6HI.mjs} +3 -3
  128. package/dist/useController-CK39i6HI.mjs.map +1 -0
  129. package/dist/{useController-CvQqCvFJ.d.ts → useController-DcK2YHbw.d.mts} +1 -2
  130. package/dist/useController-DcK2YHbw.d.mts.map +1 -0
  131. package/dist/{useFormContext-CJ9027lh.d.ts → useFormContext-BegmYvGA.d.mts} +4 -5
  132. package/dist/useFormContext-BegmYvGA.d.mts.map +1 -0
  133. package/dist/{useFormContext-BUSoUBUP.js → useFormContext-Bw4LokAf.mjs} +3 -3
  134. package/dist/useFormContext-Bw4LokAf.mjs.map +1 -0
  135. package/dist/{useInputValueTransform-DJ5zkqSy.js → useInputValueTransform-DJ5zkqSy.mjs} +1 -1
  136. package/dist/{useInputValueTransform-P62UUZBl.cjs.map → useInputValueTransform-DJ5zkqSy.mjs.map} +1 -1
  137. package/dist/{useInputValueTransform-DCXXb2Lp.d.ts → useInputValueTransform-LOaEim7k.d.mts} +2 -5
  138. package/dist/useInputValueTransform-LOaEim7k.d.mts.map +1 -0
  139. package/package.json +41 -131
  140. package/dist/Checkboxes/index.cjs +0 -129
  141. package/dist/Checkboxes/index.cjs.map +0 -1
  142. package/dist/Checkboxes/index.d.cts +0 -551
  143. package/dist/Checkboxes/index.d.cts.map +0 -1
  144. package/dist/Checkboxes/index.d.ts.map +0 -1
  145. package/dist/Checkboxes/index.js.map +0 -1
  146. package/dist/DatePicker/index.cjs +0 -202
  147. package/dist/DatePicker/index.cjs.map +0 -1
  148. package/dist/DatePicker/index.d.cts.map +0 -1
  149. package/dist/DatePicker/index.d.ts +0 -1532
  150. package/dist/DatePicker/index.js.map +0 -1
  151. package/dist/FieldArray/index.cjs +0 -499
  152. package/dist/FieldArray/index.cjs.map +0 -1
  153. package/dist/FieldArray/index.d.cts.map +0 -1
  154. package/dist/FieldArray/index.d.ts +0 -539
  155. package/dist/FieldArray/index.d.ts.map +0 -1
  156. package/dist/FieldArray/index.js.map +0 -1
  157. package/dist/FieldCard/index.cjs +0 -231
  158. package/dist/FieldCard/index.cjs.map +0 -1
  159. package/dist/FieldCard/index.d.cts.map +0 -1
  160. package/dist/FieldCard/index.d.ts +0 -314
  161. package/dist/FieldCard/index.d.ts.map +0 -1
  162. package/dist/FieldCard/index.js.map +0 -1
  163. package/dist/FieldCopyTestIdButton-CRJBix9D.js.map +0 -1
  164. package/dist/FieldCopyTestIdButton-D3D_LmJh.cjs +0 -31
  165. package/dist/FieldCopyTestIdButton-D3D_LmJh.cjs.map +0 -1
  166. package/dist/FieldValidationError-ByRoIxaM.js.map +0 -1
  167. package/dist/FieldValidationError-CfYKzl7P.cjs +0 -61
  168. package/dist/FieldValidationError-CfYKzl7P.cjs.map +0 -1
  169. package/dist/Form/index.cjs +0 -120
  170. package/dist/Form/index.cjs.map +0 -1
  171. package/dist/Form/index.d.cts +0 -43
  172. package/dist/Form/index.d.cts.map +0 -1
  173. package/dist/Form/index.d.ts +0 -43
  174. package/dist/Form/index.d.ts.map +0 -1
  175. package/dist/Form/index.js +0 -116
  176. package/dist/Form/index.js.map +0 -1
  177. package/dist/FormContext-BLWS7bhO.d.cts +0 -20
  178. package/dist/FormContext-BLWS7bhO.d.cts.map +0 -1
  179. package/dist/FormContext-DjJOJKxj.js.map +0 -1
  180. package/dist/FormContext-LgzrDWu1.d.ts.map +0 -1
  181. package/dist/FormContext-eCnp-y2P.cjs +0 -319
  182. package/dist/FormContext-eCnp-y2P.cjs.map +0 -1
  183. package/dist/Grid/index.cjs +0 -6
  184. package/dist/Grid/index.d.cts +0 -22
  185. package/dist/Grid/index.d.cts.map +0 -1
  186. package/dist/Grid/index.d.ts.map +0 -1
  187. package/dist/Grid/index.js +0 -2
  188. package/dist/Grid-BbqCRkuY.cjs +0 -25
  189. package/dist/Grid-CTs-Rb9G.js.map +0 -1
  190. package/dist/Input/index.cjs +0 -100
  191. package/dist/Input/index.cjs.map +0 -1
  192. package/dist/Input/index.d.cts.map +0 -1
  193. package/dist/Input/index.d.ts +0 -677
  194. package/dist/Input/index.d.ts.map +0 -1
  195. package/dist/Input/index.js.map +0 -1
  196. package/dist/RadioBoxes/index.cjs +0 -147
  197. package/dist/RadioBoxes/index.d.cts.map +0 -1
  198. package/dist/RadioBoxes/index.d.ts +0 -1477
  199. package/dist/RadioBoxes/index.d.ts.map +0 -1
  200. package/dist/RadioBoxes/index.js.map +0 -1
  201. package/dist/RadioTabs/index.cjs +0 -132
  202. package/dist/RadioTabs/index.cjs.map +0 -1
  203. package/dist/RadioTabs/index.d.cts.map +0 -1
  204. package/dist/RadioTabs/index.d.ts +0 -585
  205. package/dist/RadioTabs/index.d.ts.map +0 -1
  206. package/dist/RadioTabs/index.js.map +0 -1
  207. package/dist/Radios/index.cjs +0 -97
  208. package/dist/Radios/index.cjs.map +0 -1
  209. package/dist/Radios/index.d.cts.map +0 -1
  210. package/dist/Radios/index.d.ts +0 -1399
  211. package/dist/Radios/index.d.ts.map +0 -1
  212. package/dist/Radios/index.js.map +0 -1
  213. package/dist/Select/index.cjs +0 -303
  214. package/dist/Select/index.cjs.map +0 -1
  215. package/dist/Select/index.d.cts.map +0 -1
  216. package/dist/Select/index.d.ts +0 -3920
  217. package/dist/Select/index.js.map +0 -1
  218. package/dist/Slider/index.cjs +0 -117
  219. package/dist/Slider/index.cjs.map +0 -1
  220. package/dist/Slider/index.d.ts +0 -1760
  221. package/dist/Slider/index.js.map +0 -1
  222. package/dist/SubmitButton/index.cjs +0 -35
  223. package/dist/SubmitButton/index.cjs.map +0 -1
  224. package/dist/SubmitButton/index.d.cts +0 -38
  225. package/dist/SubmitButton/index.d.cts.map +0 -1
  226. package/dist/SubmitButton/index.d.ts +0 -38
  227. package/dist/SubmitButton/index.d.ts.map +0 -1
  228. package/dist/SubmitButton/index.js +0 -31
  229. package/dist/SubmitButton/index.js.map +0 -1
  230. package/dist/Switch/index.cjs +0 -86
  231. package/dist/Switch/index.cjs.map +0 -1
  232. package/dist/Switch/index.d.ts +0 -1257
  233. package/dist/Switch/index.js.map +0 -1
  234. package/dist/SwitchBox/index.cjs +0 -158
  235. package/dist/SwitchBox/index.cjs.map +0 -1
  236. package/dist/SwitchBox/index.d.cts.map +0 -1
  237. package/dist/SwitchBox/index.d.ts +0 -473
  238. package/dist/SwitchBox/index.d.ts.map +0 -1
  239. package/dist/SwitchBox/index.js.map +0 -1
  240. package/dist/TextArea/index.cjs +0 -70
  241. package/dist/TextArea/index.cjs.map +0 -1
  242. package/dist/TextArea/index.d.cts.map +0 -1
  243. package/dist/TextArea/index.d.ts +0 -659
  244. package/dist/TextArea/index.d.ts.map +0 -1
  245. package/dist/TextArea/index.js.map +0 -1
  246. package/dist/Time/index.cjs +0 -228
  247. package/dist/Time/index.cjs.map +0 -1
  248. package/dist/Time/index.d.cts.map +0 -1
  249. package/dist/Time/index.d.ts.map +0 -1
  250. package/dist/Time/index.js.map +0 -1
  251. package/dist/helpers/index.cjs +0 -430
  252. package/dist/helpers/index.d.cts +0 -238
  253. package/dist/helpers/index.d.cts.map +0 -1
  254. package/dist/helpers/index.d.ts.map +0 -1
  255. package/dist/helpers/index.js.map +0 -1
  256. package/dist/hooks/useClientValidation/index.cjs +0 -185
  257. package/dist/hooks/useClientValidation/index.cjs.map +0 -1
  258. package/dist/hooks/useClientValidation/index.d.cts +0 -148
  259. package/dist/hooks/useClientValidation/index.d.cts.map +0 -1
  260. package/dist/hooks/useClientValidation/index.d.ts.map +0 -1
  261. package/dist/hooks/useClientValidation/index.js.map +0 -1
  262. package/dist/hooks/useController/index.cjs +0 -8
  263. package/dist/hooks/useController/index.d.ts +0 -2
  264. package/dist/hooks/useController/index.js +0 -7
  265. package/dist/hooks/useController/index.js.map +0 -1
  266. package/dist/hooks/useFormContext/index.cjs +0 -9
  267. package/dist/hooks/useFormContext/index.d.cts +0 -2
  268. package/dist/hooks/useFormContext/index.d.ts +0 -2
  269. package/dist/hooks/useFormContext/index.js.map +0 -1
  270. package/dist/hooks/useInput/index.cjs +0 -13
  271. package/dist/hooks/useInput/index.d.cts +0 -2
  272. package/dist/hooks/useInput/index.d.ts +0 -2
  273. package/dist/hooks/useInput/index.js +0 -7
  274. package/dist/hooks/useInput/index.js.map +0 -1
  275. package/dist/hooks/useInputValueDebounce/index.cjs +0 -92
  276. package/dist/hooks/useInputValueDebounce/index.cjs.map +0 -1
  277. package/dist/hooks/useInputValueDebounce/index.d.cts +0 -66
  278. package/dist/hooks/useInputValueDebounce/index.d.cts.map +0 -1
  279. package/dist/hooks/useInputValueDebounce/index.d.ts.map +0 -1
  280. package/dist/hooks/useInputValueDebounce/index.js.map +0 -1
  281. package/dist/hooks/useInputValueTransform/index.cjs +0 -8
  282. package/dist/hooks/useInputValueTransform/index.d.ts +0 -2
  283. package/dist/hooks/useInputValueTransform/index.js.map +0 -1
  284. package/dist/hooks/useUniformField/index.cjs +0 -139
  285. package/dist/hooks/useUniformField/index.cjs.map +0 -1
  286. package/dist/hooks/useUniformField/index.d.cts +0 -100
  287. package/dist/hooks/useUniformField/index.d.cts.map +0 -1
  288. package/dist/hooks/useUniformField/index.d.ts.map +0 -1
  289. package/dist/hooks/useUniformField/index.js.map +0 -1
  290. package/dist/hooks/useUniformFieldArray/index.cjs +0 -102
  291. package/dist/hooks/useUniformFieldArray/index.cjs.map +0 -1
  292. package/dist/hooks/useUniformFieldArray/index.d.cts +0 -81
  293. package/dist/hooks/useUniformFieldArray/index.d.cts.map +0 -1
  294. package/dist/hooks/useUniformFieldArray/index.d.ts.map +0 -1
  295. package/dist/hooks/useUniformFieldArray/index.js.map +0 -1
  296. package/dist/hooks/useWatchFormReset/index.cjs +0 -38
  297. package/dist/hooks/useWatchFormReset/index.cjs.map +0 -1
  298. package/dist/hooks/useWatchFormReset/index.d.cts +0 -38
  299. package/dist/hooks/useWatchFormReset/index.d.cts.map +0 -1
  300. package/dist/hooks/useWatchFormReset/index.d.ts.map +0 -1
  301. package/dist/hooks/useWatchFormReset/index.js.map +0 -1
  302. package/dist/hooks/useWatchUserChange/index.cjs +0 -88
  303. package/dist/hooks/useWatchUserChange/index.cjs.map +0 -1
  304. package/dist/hooks/useWatchUserChange/index.d.cts +0 -80
  305. package/dist/hooks/useWatchUserChange/index.d.cts.map +0 -1
  306. package/dist/hooks/useWatchUserChange/index.d.ts.map +0 -1
  307. package/dist/hooks/useWatchUserChange/index.js.map +0 -1
  308. package/dist/index-BKZ67WMa.d.cts +0 -1
  309. package/dist/index-BKZ67WMa.d.ts +0 -1
  310. package/dist/index-BVVgDSdq.d.cts +0 -1
  311. package/dist/index-BVVgDSdq.d.ts +0 -1
  312. package/dist/index-DmtQKWjk.d.cts +0 -1
  313. package/dist/index-DmtQKWjk.d.ts +0 -1
  314. package/dist/partials/FieldCopyTestIdButton/index.cjs +0 -6
  315. package/dist/partials/FieldCopyTestIdButton/index.d.cts +0 -14
  316. package/dist/partials/FieldCopyTestIdButton/index.d.cts.map +0 -1
  317. package/dist/partials/FieldCopyTestIdButton/index.d.ts.map +0 -1
  318. package/dist/partials/FieldValidationError/index.cjs +0 -6
  319. package/dist/partials/FieldValidationError/index.d.cts +0 -22
  320. package/dist/partials/FieldValidationError/index.d.cts.map +0 -1
  321. package/dist/partials/FieldValidationError/index.d.ts.map +0 -1
  322. package/dist/useController-CvQqCvFJ.d.ts.map +0 -1
  323. package/dist/useController-D87H3etM.cjs +0 -50
  324. package/dist/useController-D87H3etM.cjs.map +0 -1
  325. package/dist/useController-DxFS0u7c.js.map +0 -1
  326. package/dist/useController-fblEApv_.d.cts +0 -33
  327. package/dist/useController-fblEApv_.d.cts.map +0 -1
  328. package/dist/useFormContext-BSIXyfbo.cjs +0 -146
  329. package/dist/useFormContext-BSIXyfbo.cjs.map +0 -1
  330. package/dist/useFormContext-BUSoUBUP.js.map +0 -1
  331. package/dist/useFormContext-CJ9027lh.d.ts.map +0 -1
  332. package/dist/useFormContext-D84GPAdx.d.cts +0 -67
  333. package/dist/useFormContext-D84GPAdx.d.cts.map +0 -1
  334. package/dist/useInput-ClpHDPdr.d.ts +0 -2
  335. package/dist/useInputValueTransform-DCXXb2Lp.d.cts +0 -108
  336. package/dist/useInputValueTransform-DCXXb2Lp.d.cts.map +0 -1
  337. package/dist/useInputValueTransform-DCXXb2Lp.d.ts.map +0 -1
  338. package/dist/useInputValueTransform-DJ5zkqSy.js.map +0 -1
  339. package/dist/useInputValueTransform-P62UUZBl.cjs +0 -115
  340. /package/dist/{useInput-C0aJaAGe.js → useInput-C0aJaAGe.mjs} +0 -0
  341. /package/dist/{useInput-ClpHDPdr.d.cts → useInput-ClpHDPdr.d.mts} +0 -0
@@ -1,146 +0,0 @@
1
- const require_FormContext = require("./FormContext-eCnp-y2P.cjs");
2
- const require_helpers_index = require("./helpers/index.cjs");
3
- let react = require("react");
4
- let react_hook_form = require("react-hook-form");
5
- //#region src/hooks/useFormContext/useFormContext.ts
6
- /** Schema check whether a field is required or optional */
7
- const checkFieldIsRequired = (validation, path) => {
8
- const checkPath = path[path.length - 1] === "__FLAT__" ? path.slice(0, -1) : path;
9
- const checkRequired = (schema) => {
10
- if (schema.type === "array") {
11
- if (schema.isOptional || schema.isNullable) return false;
12
- return true;
13
- }
14
- return !schema.isOptional && !schema.isNullable;
15
- };
16
- return validation.checkSchemaPath(checkRequired, checkPath);
17
- };
18
- /**
19
- * Resolve validation errors for a given field path.
20
- *
21
- * Traverses a nested `VetoFormattedError` structure using a dotted path
22
- * (for example: "user.address.0.street") and returns the matching
23
- * `FieldError[]` if present. If no error exists at the path, returns
24
- * `undefined`.
25
- *
26
- * @param errors - The formatted validation errors from Uniform's context
27
- * @param name - The dotted field path to resolve
28
- * @returns An array of `FieldError` entries for the field, or `undefined`
29
- */
30
- const getValidationErrorsByName = (errors, name) => {
31
- const keys = name.split(".").filter((k) => {
32
- return k !== require_helpers_index.flatArrayKey;
33
- });
34
- let current = errors;
35
- keys.forEach((key) => {
36
- if (current && typeof current === "object") current = current[key];
37
- else current = void 0;
38
- });
39
- return current;
40
- };
41
- /**
42
- * Custom hook that extends react-hook-form's useFormContext to add validation and state management.
43
- *
44
- * Key features:
45
- * - Enhanced `getFieldState` that includes validation schema-based "required" status and testId generation
46
- * - Automatic conversion of form values via `getValues`, `watch`, and `subscribe`:
47
- * - Unwraps flat array wrappers (`{ __FLAT__: value }` → `value`)
48
- * - Converts nullish string markers (`__NULL__` → `null`, `__FALSE__` → `false`, `__ZERO__` → `0`)
49
- * - Filters out empty/null values
50
- */
51
- const useFormContext = () => {
52
- const { formState, getFieldState: getFieldStateOrig, getValues: getValuesOrig, watch: watchOrig, subscribe: subscribeOrig, reset: resetOrig, ...otherMethods } = (0, react_hook_form.useFormContext)();
53
- const uniformContext = (0, react.useContext)(require_FormContext.UniformContext);
54
- /**
55
- * Wrap react-hook-form's `reset` so the uniform context is notified about
56
- * programmatic resets. Field components (e.g. FieldArray) use this signal to
57
- * normalize their state on reset instead of inferring it from field contents.
58
- */
59
- const notifyReset = uniformContext?.formReset?.notify;
60
- const reset = ((...args) => {
61
- resetOrig(...args);
62
- notifyReset?.();
63
- });
64
- /**
65
- * Updated getFieldState method which returns:
66
- * - Whether the field is required by checking the validation schema
67
- * - Existing field state information (errors, etc.)
68
- * - A testId generated from the field name (with flat array keys removed and slugified)
69
- *
70
- * @param name - The field path (string or array)
71
- * @param testId - Optional explicit testId. If provided, will be slugified. If not provided, generated from name.
72
- */
73
- const getFieldState = (name, testId) => {
74
- const fieldPath = typeof name === "string" ? name.replace(/\[\d+\]/g, "").split(".") : name;
75
- const validationInstance = uniformContext?.validation.baseInstance ?? uniformContext?.validation.instance;
76
- const required = validationInstance ? checkFieldIsRequired(validationInstance, fieldPath) : false;
77
- const error = getValidationErrorsByName(uniformContext?.validation.errors ?? {}, name);
78
- return {
79
- ...getFieldStateOrig(name, formState),
80
- error,
81
- invalid: !!error,
82
- required,
83
- testId: require_helpers_index.nameToTestId(testId ?? name)
84
- };
85
- };
86
- /**
87
- * Wrap form value accessor methods to automatically convert from internal storage format
88
- * to component-friendly format:
89
- *
90
- * - Unwrap flat array wrappers: `{ __FLAT__: value }` → `value`
91
- * - Convert nullish string markers: `__NULL__` → `null`, `__FALSE__` → `false`, `__ZERO__` → `0`
92
- * - Filter out empty/null values: fields with converted null/empty values are removed entirely
93
- *
94
- * This ensures components receive clean, predictable data without needing to handle
95
- * the internal nullish string conversion system or flat array wrapping manually.
96
- */
97
- const getValues = ((...args) => {
98
- return require_helpers_index.toValidationFormat(getValuesOrig(...args));
99
- });
100
- const watch = ((...args) => {
101
- return require_helpers_index.toValidationFormat(watchOrig(...args));
102
- });
103
- const subscribe = ((...args) => {
104
- const [options] = args;
105
- if (options?.callback) {
106
- const originalCallback = options.callback;
107
- const wrappedOptions = {
108
- ...options,
109
- callback: (subscribeFormState) => {
110
- const convertedFormState = {
111
- ...subscribeFormState,
112
- ...subscribeFormState.values && { values: require_helpers_index.toValidationFormat(subscribeFormState.values) }
113
- };
114
- return originalCallback(convertedFormState);
115
- }
116
- };
117
- return subscribeOrig(wrappedOptions);
118
- }
119
- return subscribeOrig(...args);
120
- });
121
- return {
122
- ...otherMethods,
123
- ...uniformContext,
124
- formState,
125
- getFieldState,
126
- getValues,
127
- reset,
128
- subscribe,
129
- watch
130
- };
131
- };
132
- //#endregion
133
- Object.defineProperty(exports, "checkFieldIsRequired", {
134
- enumerable: true,
135
- get: function() {
136
- return checkFieldIsRequired;
137
- }
138
- });
139
- Object.defineProperty(exports, "useFormContext", {
140
- enumerable: true,
141
- get: function() {
142
- return useFormContext;
143
- }
144
- });
145
-
146
- //# sourceMappingURL=useFormContext-BSIXyfbo.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useFormContext-BSIXyfbo.cjs","names":["flatArrayKey","UniformContext","nameToTestId","toValidationFormat"],"sources":["../src/hooks/useFormContext/useFormContext.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { VetoFormattedError, VetoInstance } from '@fuf-stack/veto';\nimport type { FieldError, FieldValues, Path } from 'react-hook-form';\n\nimport { useContext } from 'react';\nimport { useFormContext as useHookFormContext } from 'react-hook-form';\n\nimport { UniformContext } from '../../Form/subcomponents/FormContext';\nimport { flatArrayKey, nameToTestId, toValidationFormat } from '../../helpers';\n\n/** Schema check whether a field is required or optional */\nexport const checkFieldIsRequired = (\n validation: VetoInstance,\n path: string[],\n): boolean => {\n // Handle flat array paths: strip the flatArrayKey to check the array element schema\n // e.g., ['arrayField', '0', '__FLAT__'] -> check schema at ['arrayField', '0']\n const checkPath =\n path[path.length - 1] === flatArrayKey ? path.slice(0, -1) : path;\n\n const checkRequired = (schema: any) => {\n // arrays ...\n if (schema.type === 'array') {\n // ... if array is optional or nullable it is not required\n if (schema.isOptional || schema.isNullable) {\n return false;\n }\n // ... otherwise arrays are required (display logic wise -> no asterisk in the label)\n return true;\n }\n\n // all other fields are required if they are\n // not optional and not nullable\n return !schema.isOptional && !schema.isNullable;\n };\n\n return validation.checkSchemaPath(checkRequired, checkPath);\n};\n\n/**\n * Resolve validation errors for a given field path.\n *\n * Traverses a nested `VetoFormattedError` structure using a dotted path\n * (for example: \"user.address.0.street\") and returns the matching\n * `FieldError[]` if present. If no error exists at the path, returns\n * `undefined`.\n *\n * @param errors - The formatted validation errors from Uniform's context\n * @param name - The dotted field path to resolve\n * @returns An array of `FieldError` entries for the field, or `undefined`\n */\nconst getValidationErrorsByName = (\n errors: VetoFormattedError,\n name: string,\n) => {\n // Traverse nested error structure; ignore flat array wrapper key\n const keys = name.split('.').filter((k) => {\n return k !== flatArrayKey;\n });\n let current: unknown = errors;\n keys.forEach((key) => {\n if (current && typeof current === 'object') {\n current = (current as Record<string, unknown>)[key];\n } else {\n current = undefined;\n }\n });\n return current as FieldError[] | undefined;\n};\n\n/**\n * Custom hook that extends react-hook-form's useFormContext to add validation and state management.\n *\n * Key features:\n * - Enhanced `getFieldState` that includes validation schema-based \"required\" status and testId generation\n * - Automatic conversion of form values via `getValues`, `watch`, and `subscribe`:\n * - Unwraps flat array wrappers (`{ __FLAT__: value }` → `value`)\n * - Converts nullish string markers (`__NULL__` → `null`, `__FALSE__` → `false`, `__ZERO__` → `0`)\n * - Filters out empty/null values\n */\nexport const useFormContext = <\n TFieldValues extends FieldValues = FieldValues,\n TContext = any,\n TTransformedValues = TFieldValues,\n>() => {\n const {\n formState,\n // some methods that will be enhanced below\n getFieldState: getFieldStateOrig,\n getValues: getValuesOrig,\n watch: watchOrig,\n subscribe: subscribeOrig,\n reset: resetOrig,\n // the rest of the methods pass through unchanged\n ...otherMethods\n } = useHookFormContext<TFieldValues, TContext, TTransformedValues>();\n\n const uniformContext = useContext(UniformContext);\n\n /**\n * Wrap react-hook-form's `reset` so the uniform context is notified about\n * programmatic resets. Field components (e.g. FieldArray) use this signal to\n * normalize their state on reset instead of inferring it from field contents.\n */\n const notifyReset = uniformContext?.formReset?.notify;\n const reset = ((...args: Parameters<typeof resetOrig>) => {\n resetOrig(...args);\n notifyReset?.();\n }) as typeof resetOrig;\n\n /**\n * Updated getFieldState method which returns:\n * - Whether the field is required by checking the validation schema\n * - Existing field state information (errors, etc.)\n * - A testId generated from the field name (with flat array keys removed and slugified)\n *\n * @param name - The field path (string or array)\n * @param testId - Optional explicit testId. If provided, will be slugified. If not provided, generated from name.\n */\n const getFieldState = (name: Path<TFieldValues>, testId?: string) => {\n const fieldPath =\n typeof name === 'string' ? name.replace(/\\[\\d+\\]/g, '').split('.') : name;\n\n // Use base validation instance for checking \"required\" status\n // Client validation often uses .nullish() which would incorrectly mark fields as optional\n const validationInstance =\n uniformContext?.validation.baseInstance ??\n uniformContext?.validation.instance;\n\n // Check if the field is required using the validation schema\n const required = validationInstance\n ? checkFieldIsRequired(validationInstance, fieldPath)\n : false;\n\n const error = getValidationErrorsByName(\n uniformContext?.validation.errors ?? {},\n name,\n );\n\n // Get everything but the error from the original field state\n const fieldState = getFieldStateOrig(name, formState);\n\n return {\n ...fieldState,\n error,\n invalid: !!error,\n required,\n testId: nameToTestId(testId ?? name),\n };\n };\n\n /**\n * Wrap form value accessor methods to automatically convert from internal storage format\n * to component-friendly format:\n *\n * - Unwrap flat array wrappers: `{ __FLAT__: value }` → `value`\n * - Convert nullish string markers: `__NULL__` → `null`, `__FALSE__` → `false`, `__ZERO__` → `0`\n * - Filter out empty/null values: fields with converted null/empty values are removed entirely\n *\n * This ensures components receive clean, predictable data without needing to handle\n * the internal nullish string conversion system or flat array wrapping manually.\n */\n const getValues = ((...args: any[]) => {\n const result = (getValuesOrig as any)(...args);\n return toValidationFormat(result);\n }) as typeof getValuesOrig;\n\n const watch = ((...args: any[]) => {\n const result = (watchOrig as any)(...args);\n return toValidationFormat(result);\n }) as typeof watchOrig;\n\n const subscribe = ((...args: any[]) => {\n // For subscribe, we need to wrap the callback to convert the values property\n const [options] = args;\n if (options?.callback) {\n const originalCallback = options.callback;\n const wrappedOptions = {\n ...options,\n callback: (subscribeFormState: any) => {\n // Convert the values property if it exists\n const convertedFormState = {\n ...subscribeFormState,\n ...(subscribeFormState.values && {\n values: toValidationFormat(subscribeFormState.values),\n }),\n };\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return originalCallback(convertedFormState);\n },\n };\n return subscribeOrig(wrappedOptions);\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return (subscribeOrig as any)(...args);\n }) as typeof subscribeOrig;\n\n return {\n ...otherMethods,\n ...uniformContext,\n formState,\n getFieldState,\n getValues,\n reset,\n subscribe,\n watch,\n };\n};\n"],"mappings":";;;;;;AAYA,MAAa,wBACX,YACA,SACY;CAGZ,MAAM,YACJ,KAAK,KAAK,SAAS,OAAA,aAAsB,KAAK,MAAM,GAAG,EAAE,IAAI;CAE/D,MAAM,iBAAiB,WAAgB;EAErC,IAAI,OAAO,SAAS,SAAS;GAE3B,IAAI,OAAO,cAAc,OAAO,YAC9B,OAAO;GAGT,OAAO;EACT;EAIA,OAAO,CAAC,OAAO,cAAc,CAAC,OAAO;CACvC;CAEA,OAAO,WAAW,gBAAgB,eAAe,SAAS;AAC5D;;;;;;;;;;;;;AAcA,MAAM,6BACJ,QACA,SACG;CAEH,MAAM,OAAO,KAAK,MAAM,GAAG,CAAC,CAAC,QAAQ,MAAM;EACzC,OAAO,MAAMA,sBAAAA;CACf,CAAC;CACD,IAAI,UAAmB;CACvB,KAAK,SAAS,QAAQ;EACpB,IAAI,WAAW,OAAO,YAAY,UAChC,UAAW,QAAoC;OAE/C,UAAU,KAAA;CAEd,CAAC;CACD,OAAO;AACT;;;;;;;;;;;AAYA,MAAa,uBAIN;CACL,MAAM,EACJ,WAEA,eAAe,mBACf,WAAW,eACX,OAAO,WACP,WAAW,eACX,OAAO,WAEP,GAAG,kBAAA,GAAA,gBAAA,eAAA,CAC8D;CAEnE,MAAM,kBAAA,GAAA,MAAA,WAAA,CAA4BC,oBAAAA,cAAc;;;;;;CAOhD,MAAM,cAAc,gBAAgB,WAAW;CAC/C,MAAM,UAAU,GAAG,SAAuC;EACxD,UAAU,GAAG,IAAI;EACjB,cAAc;CAChB;;;;;;;;;;CAWA,MAAM,iBAAiB,MAA0B,WAAoB;EACnE,MAAM,YACJ,OAAO,SAAS,WAAW,KAAK,QAAQ,YAAY,EAAE,CAAC,CAAC,MAAM,GAAG,IAAI;EAIvE,MAAM,qBACJ,gBAAgB,WAAW,gBAC3B,gBAAgB,WAAW;EAG7B,MAAM,WAAW,qBACb,qBAAqB,oBAAoB,SAAS,IAClD;EAEJ,MAAM,QAAQ,0BACZ,gBAAgB,WAAW,UAAU,CAAC,GACtC,IACF;EAKA,OAAO;GACL,GAHiB,kBAAkB,MAAM,SAG7B;GACZ;GACA,SAAS,CAAC,CAAC;GACX;GACA,QAAQC,sBAAAA,aAAa,UAAU,IAAI;EACrC;CACF;;;;;;;;;;;;CAaA,MAAM,cAAc,GAAG,SAAgB;EAErC,OAAOC,sBAAAA,mBADS,cAAsB,GAAG,IACV,CAAC;CAClC;CAEA,MAAM,UAAU,GAAG,SAAgB;EAEjC,OAAOA,sBAAAA,mBADS,UAAkB,GAAG,IACN,CAAC;CAClC;CAEA,MAAM,cAAc,GAAG,SAAgB;EAErC,MAAM,CAAC,WAAW;EAClB,IAAI,SAAS,UAAU;GACrB,MAAM,mBAAmB,QAAQ;GACjC,MAAM,iBAAiB;IACrB,GAAG;IACH,WAAW,uBAA4B;KAErC,MAAM,qBAAqB;MACzB,GAAG;MACH,GAAI,mBAAmB,UAAU,EAC/B,QAAQA,sBAAAA,mBAAmB,mBAAmB,MAAM,EACtD;KACF;KAEA,OAAO,iBAAiB,kBAAkB;IAC5C;GACF;GACA,OAAO,cAAc,cAAc;EACrC;EAEA,OAAQ,cAAsB,GAAG,IAAI;CACvC;CAEA,OAAO;EACL,GAAG;EACH,GAAG;EACH;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useFormContext-BUSoUBUP.js","names":["useFormContext","useHookFormContext"],"sources":["../src/hooks/useFormContext/useFormContext.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { VetoFormattedError, VetoInstance } from '@fuf-stack/veto';\nimport type { FieldError, FieldValues, Path } from 'react-hook-form';\n\nimport { useContext } from 'react';\nimport { useFormContext as useHookFormContext } from 'react-hook-form';\n\nimport { UniformContext } from '../../Form/subcomponents/FormContext';\nimport { flatArrayKey, nameToTestId, toValidationFormat } from '../../helpers';\n\n/** Schema check whether a field is required or optional */\nexport const checkFieldIsRequired = (\n validation: VetoInstance,\n path: string[],\n): boolean => {\n // Handle flat array paths: strip the flatArrayKey to check the array element schema\n // e.g., ['arrayField', '0', '__FLAT__'] -> check schema at ['arrayField', '0']\n const checkPath =\n path[path.length - 1] === flatArrayKey ? path.slice(0, -1) : path;\n\n const checkRequired = (schema: any) => {\n // arrays ...\n if (schema.type === 'array') {\n // ... if array is optional or nullable it is not required\n if (schema.isOptional || schema.isNullable) {\n return false;\n }\n // ... otherwise arrays are required (display logic wise -> no asterisk in the label)\n return true;\n }\n\n // all other fields are required if they are\n // not optional and not nullable\n return !schema.isOptional && !schema.isNullable;\n };\n\n return validation.checkSchemaPath(checkRequired, checkPath);\n};\n\n/**\n * Resolve validation errors for a given field path.\n *\n * Traverses a nested `VetoFormattedError` structure using a dotted path\n * (for example: \"user.address.0.street\") and returns the matching\n * `FieldError[]` if present. If no error exists at the path, returns\n * `undefined`.\n *\n * @param errors - The formatted validation errors from Uniform's context\n * @param name - The dotted field path to resolve\n * @returns An array of `FieldError` entries for the field, or `undefined`\n */\nconst getValidationErrorsByName = (\n errors: VetoFormattedError,\n name: string,\n) => {\n // Traverse nested error structure; ignore flat array wrapper key\n const keys = name.split('.').filter((k) => {\n return k !== flatArrayKey;\n });\n let current: unknown = errors;\n keys.forEach((key) => {\n if (current && typeof current === 'object') {\n current = (current as Record<string, unknown>)[key];\n } else {\n current = undefined;\n }\n });\n return current as FieldError[] | undefined;\n};\n\n/**\n * Custom hook that extends react-hook-form's useFormContext to add validation and state management.\n *\n * Key features:\n * - Enhanced `getFieldState` that includes validation schema-based \"required\" status and testId generation\n * - Automatic conversion of form values via `getValues`, `watch`, and `subscribe`:\n * - Unwraps flat array wrappers (`{ __FLAT__: value }` → `value`)\n * - Converts nullish string markers (`__NULL__` → `null`, `__FALSE__` → `false`, `__ZERO__` → `0`)\n * - Filters out empty/null values\n */\nexport const useFormContext = <\n TFieldValues extends FieldValues = FieldValues,\n TContext = any,\n TTransformedValues = TFieldValues,\n>() => {\n const {\n formState,\n // some methods that will be enhanced below\n getFieldState: getFieldStateOrig,\n getValues: getValuesOrig,\n watch: watchOrig,\n subscribe: subscribeOrig,\n reset: resetOrig,\n // the rest of the methods pass through unchanged\n ...otherMethods\n } = useHookFormContext<TFieldValues, TContext, TTransformedValues>();\n\n const uniformContext = useContext(UniformContext);\n\n /**\n * Wrap react-hook-form's `reset` so the uniform context is notified about\n * programmatic resets. Field components (e.g. FieldArray) use this signal to\n * normalize their state on reset instead of inferring it from field contents.\n */\n const notifyReset = uniformContext?.formReset?.notify;\n const reset = ((...args: Parameters<typeof resetOrig>) => {\n resetOrig(...args);\n notifyReset?.();\n }) as typeof resetOrig;\n\n /**\n * Updated getFieldState method which returns:\n * - Whether the field is required by checking the validation schema\n * - Existing field state information (errors, etc.)\n * - A testId generated from the field name (with flat array keys removed and slugified)\n *\n * @param name - The field path (string or array)\n * @param testId - Optional explicit testId. If provided, will be slugified. If not provided, generated from name.\n */\n const getFieldState = (name: Path<TFieldValues>, testId?: string) => {\n const fieldPath =\n typeof name === 'string' ? name.replace(/\\[\\d+\\]/g, '').split('.') : name;\n\n // Use base validation instance for checking \"required\" status\n // Client validation often uses .nullish() which would incorrectly mark fields as optional\n const validationInstance =\n uniformContext?.validation.baseInstance ??\n uniformContext?.validation.instance;\n\n // Check if the field is required using the validation schema\n const required = validationInstance\n ? checkFieldIsRequired(validationInstance, fieldPath)\n : false;\n\n const error = getValidationErrorsByName(\n uniformContext?.validation.errors ?? {},\n name,\n );\n\n // Get everything but the error from the original field state\n const fieldState = getFieldStateOrig(name, formState);\n\n return {\n ...fieldState,\n error,\n invalid: !!error,\n required,\n testId: nameToTestId(testId ?? name),\n };\n };\n\n /**\n * Wrap form value accessor methods to automatically convert from internal storage format\n * to component-friendly format:\n *\n * - Unwrap flat array wrappers: `{ __FLAT__: value }` → `value`\n * - Convert nullish string markers: `__NULL__` → `null`, `__FALSE__` → `false`, `__ZERO__` → `0`\n * - Filter out empty/null values: fields with converted null/empty values are removed entirely\n *\n * This ensures components receive clean, predictable data without needing to handle\n * the internal nullish string conversion system or flat array wrapping manually.\n */\n const getValues = ((...args: any[]) => {\n const result = (getValuesOrig as any)(...args);\n return toValidationFormat(result);\n }) as typeof getValuesOrig;\n\n const watch = ((...args: any[]) => {\n const result = (watchOrig as any)(...args);\n return toValidationFormat(result);\n }) as typeof watchOrig;\n\n const subscribe = ((...args: any[]) => {\n // For subscribe, we need to wrap the callback to convert the values property\n const [options] = args;\n if (options?.callback) {\n const originalCallback = options.callback;\n const wrappedOptions = {\n ...options,\n callback: (subscribeFormState: any) => {\n // Convert the values property if it exists\n const convertedFormState = {\n ...subscribeFormState,\n ...(subscribeFormState.values && {\n values: toValidationFormat(subscribeFormState.values),\n }),\n };\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return originalCallback(convertedFormState);\n },\n };\n return subscribeOrig(wrappedOptions);\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return (subscribeOrig as any)(...args);\n }) as typeof subscribeOrig;\n\n return {\n ...otherMethods,\n ...uniformContext,\n formState,\n getFieldState,\n getValues,\n reset,\n subscribe,\n watch,\n };\n};\n"],"mappings":";;;;;;AAYA,MAAa,wBACX,YACA,SACY;CAGZ,MAAM,YACJ,KAAK,KAAK,SAAS,OAAA,aAAsB,KAAK,MAAM,GAAG,EAAE,IAAI;CAE/D,MAAM,iBAAiB,WAAgB;EAErC,IAAI,OAAO,SAAS,SAAS;GAE3B,IAAI,OAAO,cAAc,OAAO,YAC9B,OAAO;GAGT,OAAO;EACT;EAIA,OAAO,CAAC,OAAO,cAAc,CAAC,OAAO;CACvC;CAEA,OAAO,WAAW,gBAAgB,eAAe,SAAS;AAC5D;;;;;;;;;;;;;AAcA,MAAM,6BACJ,QACA,SACG;CAEH,MAAM,OAAO,KAAK,MAAM,GAAG,CAAC,CAAC,QAAQ,MAAM;EACzC,OAAO,MAAM;CACf,CAAC;CACD,IAAI,UAAmB;CACvB,KAAK,SAAS,QAAQ;EACpB,IAAI,WAAW,OAAO,YAAY,UAChC,UAAW,QAAoC;OAE/C,UAAU,KAAA;CAEd,CAAC;CACD,OAAO;AACT;;;;;;;;;;;AAYA,MAAaA,yBAIN;CACL,MAAM,EACJ,WAEA,eAAe,mBACf,WAAW,eACX,OAAO,WACP,WAAW,eACX,OAAO,WAEP,GAAG,iBACDC,eAA+D;CAEnE,MAAM,iBAAiB,WAAW,cAAc;;;;;;CAOhD,MAAM,cAAc,gBAAgB,WAAW;CAC/C,MAAM,UAAU,GAAG,SAAuC;EACxD,UAAU,GAAG,IAAI;EACjB,cAAc;CAChB;;;;;;;;;;CAWA,MAAM,iBAAiB,MAA0B,WAAoB;EACnE,MAAM,YACJ,OAAO,SAAS,WAAW,KAAK,QAAQ,YAAY,EAAE,CAAC,CAAC,MAAM,GAAG,IAAI;EAIvE,MAAM,qBACJ,gBAAgB,WAAW,gBAC3B,gBAAgB,WAAW;EAG7B,MAAM,WAAW,qBACb,qBAAqB,oBAAoB,SAAS,IAClD;EAEJ,MAAM,QAAQ,0BACZ,gBAAgB,WAAW,UAAU,CAAC,GACtC,IACF;EAKA,OAAO;GACL,GAHiB,kBAAkB,MAAM,SAG7B;GACZ;GACA,SAAS,CAAC,CAAC;GACX;GACA,QAAQ,aAAa,UAAU,IAAI;EACrC;CACF;;;;;;;;;;;;CAaA,MAAM,cAAc,GAAG,SAAgB;EAErC,OAAO,mBADS,cAAsB,GAAG,IACV,CAAC;CAClC;CAEA,MAAM,UAAU,GAAG,SAAgB;EAEjC,OAAO,mBADS,UAAkB,GAAG,IACN,CAAC;CAClC;CAEA,MAAM,cAAc,GAAG,SAAgB;EAErC,MAAM,CAAC,WAAW;EAClB,IAAI,SAAS,UAAU;GACrB,MAAM,mBAAmB,QAAQ;GACjC,MAAM,iBAAiB;IACrB,GAAG;IACH,WAAW,uBAA4B;KAErC,MAAM,qBAAqB;MACzB,GAAG;MACH,GAAI,mBAAmB,UAAU,EAC/B,QAAQ,mBAAmB,mBAAmB,MAAM,EACtD;KACF;KAEA,OAAO,iBAAiB,kBAAkB;IAC5C;GACF;GACA,OAAO,cAAc,cAAc;EACrC;EAEA,OAAQ,cAAsB,GAAG,IAAI;CACvC;CAEA,OAAO;EACL,GAAG;EACH,GAAG;EACH;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useFormContext-CJ9027lh.d.ts","names":[],"sources":["../src/hooks/useFormContext/useFormContext.ts"],"mappings":";;;;;;cAYa,oBAAA,GACX,UAAA,EAAY,YAAY,EACxB,IAAA;;AAFF;;;;;;;;AAEgB;cAmEH,gBAAA,wBACU,WAAA,GAAc,WAAA,uCAEd,YAAA;;wBAoCQ,IAAA,CAAK,YAAA,GAAa,MAAA;;;;;;;;;;;;;;;;;;;;;sCAwB3C,kBAAA,KAAA,OAAA;;0BAAA,kBAAA;;;;mBAiBa,YAAA;eAEE,YAAA;aAC6B,kBAAA"}
@@ -1,67 +0,0 @@
1
- import { n as FormResetListener, r as UserChangeListener, t as DebugModeSettings } from "./FormContext-BLWS7bhO.cjs";
2
- import { VetoFormattedError, VetoInstance } from "@fuf-stack/veto";
3
- import { FieldError, FieldValues, Path } from "react-hook-form";
4
-
5
- //#region src/hooks/useFormContext/useFormContext.d.ts
6
- /** Schema check whether a field is required or optional */
7
- declare const checkFieldIsRequired: (validation: VetoInstance, path: string[]) => boolean;
8
- /**
9
- * Custom hook that extends react-hook-form's useFormContext to add validation and state management.
10
- *
11
- * Key features:
12
- * - Enhanced `getFieldState` that includes validation schema-based "required" status and testId generation
13
- * - Automatic conversion of form values via `getValues`, `watch`, and `subscribe`:
14
- * - Unwraps flat array wrappers (`{ __FLAT__: value }` → `value`)
15
- * - Converts nullish string markers (`__NULL__` → `null`, `__FALSE__` → `false`, `__ZERO__` → `0`)
16
- * - Filters out empty/null values
17
- */
18
- declare const useFormContext: <TFieldValues extends FieldValues = FieldValues, TContext = any, TTransformedValues = TFieldValues>() => {
19
- formState: import("react-hook-form").FormState<TFieldValues>;
20
- getFieldState: (name: Path<TFieldValues>, testId?: string) => {
21
- error: FieldError[] | undefined;
22
- invalid: boolean;
23
- required: boolean;
24
- testId: string;
25
- isDirty: boolean;
26
- isTouched: boolean;
27
- isValidating: boolean;
28
- };
29
- getValues: import("react-hook-form").UseFormGetValues<TFieldValues>;
30
- reset: import("react-hook-form").UseFormReset<TFieldValues>;
31
- subscribe: import("react-hook-form").UseFormSubscribe<TFieldValues>;
32
- watch: import("react-hook-form").UseFormWatch<TFieldValues>;
33
- debugMode: "disabled" | "debug" | "debug-testids" | "off";
34
- debugModeSettings?: DebugModeSettings;
35
- formReset: {
36
- subscribe: (listener: FormResetListener) => () => void;
37
- notify: () => void;
38
- };
39
- preventSubmit: (prevent: boolean) => void;
40
- setDebugMode: (debugMode: "disabled" | "debug" | "debug-testids" | "off") => void;
41
- triggerSubmit: (e?: import("react").BaseSyntheticEvent) => Promise<void> | void;
42
- userChange: {
43
- subscribe: (listener: UserChangeListener) => () => void;
44
- notify: (fieldName: string, value: unknown) => void;
45
- };
46
- validation: {
47
- baseInstance?: VetoInstance;
48
- instance?: VetoInstance;
49
- errors?: VetoFormattedError;
50
- setClientValidationSchema: (key: string, schema: import("@fuf-stack/veto").VetoTypeAny | null) => void;
51
- };
52
- setError: import("react-hook-form").UseFormSetError<TFieldValues>;
53
- clearErrors: import("react-hook-form").UseFormClearErrors<TFieldValues>;
54
- setValue: import("react-hook-form").UseFormSetValue<TFieldValues>;
55
- setValues: import("react-hook-form").UseFormSetValues<TFieldValues>;
56
- trigger: import("react-hook-form").UseFormTrigger<TFieldValues>;
57
- resetField: import("react-hook-form").UseFormResetField<TFieldValues>;
58
- resetDefaultValues: import("react-hook-form").UseFormResetDefaultValues<TFieldValues>;
59
- handleSubmit: import("react-hook-form").UseFormHandleSubmit<TFieldValues, TTransformedValues>;
60
- unregister: import("react-hook-form").UseFormUnregister<TFieldValues>;
61
- control: import("react-hook-form").Control<TFieldValues, TContext, TTransformedValues>;
62
- register: import("react-hook-form").UseFormRegister<TFieldValues>;
63
- setFocus: import("react-hook-form").UseFormSetFocus<TFieldValues>;
64
- };
65
- //#endregion
66
- export { useFormContext as n, checkFieldIsRequired as t };
67
- //# sourceMappingURL=useFormContext-D84GPAdx.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useFormContext-D84GPAdx.d.cts","names":[],"sources":["../src/hooks/useFormContext/useFormContext.ts"],"mappings":";;;;;;cAYa,oBAAA,GACX,UAAA,EAAY,YAAY,EACxB,IAAA;;AAFF;;;;;;;;AAEgB;cAmEH,cAAA,wBACU,WAAA,GAAc,WAAA,uCAEd,YAAA;;wBAoCQ,IAAA,CAAK,YAAA,GAAa,MAAA;;;;;;;;;;;;;;;;;;;;;sCAwB3C,kBAAA,KAAA,OAAA;;0BAAA,kBAAA;;;;mBAiBa,YAAA;eAEE,YAAA;aAC6B,kBAAA"}
@@ -1,2 +0,0 @@
1
- import { useInput } from "@heroui/input";
2
- export { useInput as t };
@@ -1,108 +0,0 @@
1
- //#region src/hooks/useInputValueTransform/useInputValueTransform.d.ts
2
- interface InputValueTransform<TDisplay = unknown> {
3
- /** Transforms the form value to display value (e.g., 1000 → "$1,000" or 'a' → ['a']) */
4
- toDisplayValue: (value: unknown) => TDisplay;
5
- /** Transforms the display value to form value (e.g., "$1,000" → 1000 or ['a'] → 'a') */
6
- toFormValue: (value: TDisplay) => unknown;
7
- }
8
- interface UseInputValueTransformOptions<TDisplay = unknown> {
9
- /** Input type for special number handling */
10
- type?: 'text' | 'number' | 'password';
11
- /** Value transformation functions */
12
- transform?: InputValueTransform<TDisplay>;
13
- }
14
- interface UseInputValueTransformReturn<TDisplay = unknown> {
15
- /** Converts any form value to display value */
16
- toDisplayValue: (formValue: unknown) => TDisplay;
17
- /** Converts any display value to form value */
18
- toFormValue: (displayValue: TDisplay) => unknown;
19
- }
20
- /**
21
- * Custom hook providing utility functions for value transformations between display and form values.
22
- *
23
- * This hook provides pure conversion functions without any state management. It's useful for:
24
- * - Currency formatting ($1,000 display vs 1000 stored)
25
- * - Number inputs with special handling
26
- * - Date formatting (MM/DD/YYYY display vs ISO date stored)
27
- * - Phone number formatting ((555) 123-4567 display vs 5551234567 stored)
28
- * - Array/Object transformations (single value ↔ array, nested structures)
29
- *
30
- * **Key Features:**
31
- * - Pure conversion functions (no state)
32
- * - Generic support for any data type (strings, numbers, arrays, objects)
33
- * - Special number input handling (empty string preservation)
34
- * - Bidirectional value transformations
35
- * - Memoized functions for performance
36
- *
37
- * @param options Configuration for value transformation
38
- * @returns Pure conversion utility functions
39
- *
40
- * @example
41
- * ```tsx
42
- * // Currency formatting
43
- * const currencyTransform = {
44
- * toDisplayValue: (val) => val ? `$${Number(val).toLocaleString()}` : '',
45
- * toFormValue: (val) => parseFloat(val.replace(/[$,]/g, '')) || 0
46
- * };
47
- *
48
- * const { toDisplayValue, toFormValue } = useInputValueTransform({
49
- * transform: currencyTransform
50
- * });
51
- *
52
- * const displayVal = toDisplayValue(1000); // "$1,000"
53
- * const formVal = toFormValue("$1,500"); // 1500
54
- * ```
55
- *
56
- * @example
57
- * ```tsx
58
- * // Number input (no transforms needed)
59
- * const { toDisplayValue, toFormValue } = useInputValueTransform({
60
- * type: 'number'
61
- * });
62
- *
63
- * // Handles empty string → empty string (not NaN)
64
- * // Handles "123" → 123 (string to number conversion)
65
- * ```
66
- *
67
- * @example
68
- * ```tsx
69
- * // Array to single value (for single checkbox)
70
- * const singleValueTransform = {
71
- * toDisplayValue: (val: string[]) => val?.[0] || '',
72
- * toFormValue: (val: string) => val ? [val] : []
73
- * };
74
- *
75
- * const { toDisplayValue, toFormValue } = useInputValueTransform({
76
- * transform: singleValueTransform
77
- * });
78
- *
79
- * const displayVal = toDisplayValue(['option1']); // "option1"
80
- * const formVal = toFormValue("option2"); // ["option2"]
81
- * ```
82
- *
83
- * @example
84
- * ```tsx
85
- * // Integration with debouncing
86
- * const MyInput = ({ field, transform }) => {
87
- * const transform = useInputValueTransform({ transform });
88
- *
89
- * const { onChange, onBlur, value } = useInputValueDebounce({
90
- * ...transform,
91
- * debounceDelay: 300,
92
- * name: 'fieldName',
93
- * onBlur: field.onBlur,
94
- * onChange: field.onChange,
95
- * value: field.value,
96
- * });
97
- *
98
- * return <input value={value} onChange={onChange} onBlur={onBlur} />;
99
- * };
100
- * ```
101
- */
102
- declare const useInputValueTransform: <TDisplay = unknown>({
103
- type,
104
- transform
105
- }: UseInputValueTransformOptions<TDisplay>) => UseInputValueTransformReturn<TDisplay>;
106
- //#endregion
107
- export { useInputValueTransform as i, UseInputValueTransformOptions as n, UseInputValueTransformReturn as r, InputValueTransform as t };
108
- //# sourceMappingURL=useInputValueTransform-DCXXb2Lp.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useInputValueTransform-DCXXb2Lp.d.cts","names":[],"sources":["../src/hooks/useInputValueTransform/useInputValueTransform.ts"],"mappings":";UAEiB,mBAAA;EAAA;EAEf,cAAA,GAAiB,KAAA,cAAmB,QAAA;EAFF;EAIlC,WAAA,GAAc,KAAA,EAAO,QAAQ;AAAA;AAAA,UAGd,6BAAA;EALE;EAOjB,IAAA;EALA;EAOA,SAAA,GAAY,mBAAmB,CAAC,QAAA;AAAA;AAAA,UAGjB,4BAAA;EAVc;EAY7B,cAAA,GAAiB,SAAA,cAAuB,QAAA;EATI;EAW5C,WAAA,GAAc,YAAA,EAAc,QAAQ;AAAA;;;;;;;AAPI;AAG1C;;;;;;;;;;;;AAIsC;AAqFtC;;;;;;;;;;;;;;;;;;;;;AAGkF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAHrE,sBAAA;EAA8C,IAAA;EAAA;AAAA,GAGxD,6BAAA,CAA8B,QAAA,MAAY,4BAAA,CAA6B,QAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useInputValueTransform-DCXXb2Lp.d.ts","names":[],"sources":["../src/hooks/useInputValueTransform/useInputValueTransform.ts"],"mappings":";UAEiB,mBAAA;EAAA;EAEf,cAAA,GAAiB,KAAA,cAAmB,QAAA;EAFF;EAIlC,WAAA,GAAc,KAAA,EAAO,QAAQ;AAAA;AAAA,UAGd,6BAAA;EALE;EAOjB,IAAA;EALA;EAOA,SAAA,GAAY,mBAAmB,CAAC,QAAA;AAAA;AAAA,UAGjB,4BAAA;EAVc;EAY7B,cAAA,GAAiB,SAAA,cAAuB,QAAA;EATI;EAW5C,WAAA,GAAc,YAAA,EAAc,QAAQ;AAAA;;;;;;;AAPI;AAG1C;;;;;;;;;;;;AAIsC;AAqFtC;;;;;;;;;;;;;;;;;;;;;AAGkF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAHrE,sBAAA;EAA8C,IAAA;EAAA;AAAA,GAGxD,6BAAA,CAA8B,QAAA,MAAY,4BAAA,CAA6B,QAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useInputValueTransform-DJ5zkqSy.js","names":[],"sources":["../src/hooks/useInputValueTransform/useInputValueTransform.ts"],"sourcesContent":["import { useCallback } from 'react';\n\nexport interface InputValueTransform<TDisplay = unknown> {\n /** Transforms the form value to display value (e.g., 1000 → \"$1,000\" or 'a' → ['a']) */\n toDisplayValue: (value: unknown) => TDisplay;\n /** Transforms the display value to form value (e.g., \"$1,000\" → 1000 or ['a'] → 'a') */\n toFormValue: (value: TDisplay) => unknown;\n}\n\nexport interface UseInputValueTransformOptions<TDisplay = unknown> {\n /** Input type for special number handling */\n type?: 'text' | 'number' | 'password';\n /** Value transformation functions */\n transform?: InputValueTransform<TDisplay>;\n}\n\nexport interface UseInputValueTransformReturn<TDisplay = unknown> {\n /** Converts any form value to display value */\n toDisplayValue: (formValue: unknown) => TDisplay;\n /** Converts any display value to form value */\n toFormValue: (displayValue: TDisplay) => unknown;\n}\n\n/**\n * Custom hook providing utility functions for value transformations between display and form values.\n *\n * This hook provides pure conversion functions without any state management. It's useful for:\n * - Currency formatting ($1,000 display vs 1000 stored)\n * - Number inputs with special handling\n * - Date formatting (MM/DD/YYYY display vs ISO date stored)\n * - Phone number formatting ((555) 123-4567 display vs 5551234567 stored)\n * - Array/Object transformations (single value ↔ array, nested structures)\n *\n * **Key Features:**\n * - Pure conversion functions (no state)\n * - Generic support for any data type (strings, numbers, arrays, objects)\n * - Special number input handling (empty string preservation)\n * - Bidirectional value transformations\n * - Memoized functions for performance\n *\n * @param options Configuration for value transformation\n * @returns Pure conversion utility functions\n *\n * @example\n * ```tsx\n * // Currency formatting\n * const currencyTransform = {\n * toDisplayValue: (val) => val ? `$${Number(val).toLocaleString()}` : '',\n * toFormValue: (val) => parseFloat(val.replace(/[$,]/g, '')) || 0\n * };\n *\n * const { toDisplayValue, toFormValue } = useInputValueTransform({\n * transform: currencyTransform\n * });\n *\n * const displayVal = toDisplayValue(1000); // \"$1,000\"\n * const formVal = toFormValue(\"$1,500\"); // 1500\n * ```\n *\n * @example\n * ```tsx\n * // Number input (no transforms needed)\n * const { toDisplayValue, toFormValue } = useInputValueTransform({\n * type: 'number'\n * });\n *\n * // Handles empty string → empty string (not NaN)\n * // Handles \"123\" → 123 (string to number conversion)\n * ```\n *\n * @example\n * ```tsx\n * // Array to single value (for single checkbox)\n * const singleValueTransform = {\n * toDisplayValue: (val: string[]) => val?.[0] || '',\n * toFormValue: (val: string) => val ? [val] : []\n * };\n *\n * const { toDisplayValue, toFormValue } = useInputValueTransform({\n * transform: singleValueTransform\n * });\n *\n * const displayVal = toDisplayValue(['option1']); // \"option1\"\n * const formVal = toFormValue(\"option2\"); // [\"option2\"]\n * ```\n *\n * @example\n * ```tsx\n * // Integration with debouncing\n * const MyInput = ({ field, transform }) => {\n * const transform = useInputValueTransform({ transform });\n *\n * const { onChange, onBlur, value } = useInputValueDebounce({\n * ...transform,\n * debounceDelay: 300,\n * name: 'fieldName',\n * onBlur: field.onBlur,\n * onChange: field.onChange,\n * value: field.value,\n * });\n *\n * return <input value={value} onChange={onChange} onBlur={onBlur} />;\n * };\n * ```\n */\nexport const useInputValueTransform = <TDisplay = unknown>({\n type,\n transform,\n}: UseInputValueTransformOptions<TDisplay>): UseInputValueTransformReturn<TDisplay> => {\n /**\n * Converts any form value to display value\n */\n const toDisplayValue = useCallback(\n (formValue: unknown): TDisplay => {\n if (transform?.toDisplayValue) {\n return transform.toDisplayValue(formValue);\n }\n\n // For number type, convert valid strings to numbers for display\n if (type === 'number') {\n if (formValue === '') {\n return '' as TDisplay;\n }\n const numValue = Number(formValue);\n return (Number.isNaN(numValue) ? formValue : numValue) as TDisplay;\n }\n\n // Default: pass through (handles primitives, arrays, objects, etc.)\n return (formValue ?? '') as TDisplay;\n },\n [type, transform],\n );\n\n /**\n * Converts any display value to form value\n */\n const toFormValue = useCallback(\n (displayValue: TDisplay): unknown => {\n if (transform?.toFormValue) {\n return transform.toFormValue(displayValue);\n }\n\n // For number type, convert strings to numbers\n if (type === 'number') {\n if (displayValue === '') {\n return '';\n }\n const numValue = Number(displayValue);\n return Number.isNaN(numValue) ? displayValue : numValue;\n }\n\n // Default: pass through (handles primitives, arrays, objects, etc.)\n return displayValue;\n },\n [type, transform],\n );\n\n return {\n toDisplayValue,\n toFormValue,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyGA,MAAa,0BAA8C,EACzD,MACA,gBACqF;CAiDrF,OAAO;EACL,gBA9CqB,aACpB,cAAiC;GAChC,IAAI,WAAW,gBACb,OAAO,UAAU,eAAe,SAAS;GAI3C,IAAI,SAAS,UAAU;IACrB,IAAI,cAAc,IAChB,OAAO;IAET,MAAM,WAAW,OAAO,SAAS;IACjC,OAAQ,OAAO,MAAM,QAAQ,IAAI,YAAY;GAC/C;GAGA,OAAQ,aAAa;EACvB,GACA,CAAC,MAAM,SAAS,CA4BH;EACb,aAvBkB,aACjB,iBAAoC;GACnC,IAAI,WAAW,aACb,OAAO,UAAU,YAAY,YAAY;GAI3C,IAAI,SAAS,UAAU;IACrB,IAAI,iBAAiB,IACnB,OAAO;IAET,MAAM,WAAW,OAAO,YAAY;IACpC,OAAO,OAAO,MAAM,QAAQ,IAAI,eAAe;GACjD;GAGA,OAAO;EACT,GACA,CAAC,MAAM,SAAS,CAKN;CACZ;AACF"}
@@ -1,115 +0,0 @@
1
- let react = require("react");
2
- //#region src/hooks/useInputValueTransform/useInputValueTransform.ts
3
- /**
4
- * Custom hook providing utility functions for value transformations between display and form values.
5
- *
6
- * This hook provides pure conversion functions without any state management. It's useful for:
7
- * - Currency formatting ($1,000 display vs 1000 stored)
8
- * - Number inputs with special handling
9
- * - Date formatting (MM/DD/YYYY display vs ISO date stored)
10
- * - Phone number formatting ((555) 123-4567 display vs 5551234567 stored)
11
- * - Array/Object transformations (single value ↔ array, nested structures)
12
- *
13
- * **Key Features:**
14
- * - Pure conversion functions (no state)
15
- * - Generic support for any data type (strings, numbers, arrays, objects)
16
- * - Special number input handling (empty string preservation)
17
- * - Bidirectional value transformations
18
- * - Memoized functions for performance
19
- *
20
- * @param options Configuration for value transformation
21
- * @returns Pure conversion utility functions
22
- *
23
- * @example
24
- * ```tsx
25
- * // Currency formatting
26
- * const currencyTransform = {
27
- * toDisplayValue: (val) => val ? `$${Number(val).toLocaleString()}` : '',
28
- * toFormValue: (val) => parseFloat(val.replace(/[$,]/g, '')) || 0
29
- * };
30
- *
31
- * const { toDisplayValue, toFormValue } = useInputValueTransform({
32
- * transform: currencyTransform
33
- * });
34
- *
35
- * const displayVal = toDisplayValue(1000); // "$1,000"
36
- * const formVal = toFormValue("$1,500"); // 1500
37
- * ```
38
- *
39
- * @example
40
- * ```tsx
41
- * // Number input (no transforms needed)
42
- * const { toDisplayValue, toFormValue } = useInputValueTransform({
43
- * type: 'number'
44
- * });
45
- *
46
- * // Handles empty string → empty string (not NaN)
47
- * // Handles "123" → 123 (string to number conversion)
48
- * ```
49
- *
50
- * @example
51
- * ```tsx
52
- * // Array to single value (for single checkbox)
53
- * const singleValueTransform = {
54
- * toDisplayValue: (val: string[]) => val?.[0] || '',
55
- * toFormValue: (val: string) => val ? [val] : []
56
- * };
57
- *
58
- * const { toDisplayValue, toFormValue } = useInputValueTransform({
59
- * transform: singleValueTransform
60
- * });
61
- *
62
- * const displayVal = toDisplayValue(['option1']); // "option1"
63
- * const formVal = toFormValue("option2"); // ["option2"]
64
- * ```
65
- *
66
- * @example
67
- * ```tsx
68
- * // Integration with debouncing
69
- * const MyInput = ({ field, transform }) => {
70
- * const transform = useInputValueTransform({ transform });
71
- *
72
- * const { onChange, onBlur, value } = useInputValueDebounce({
73
- * ...transform,
74
- * debounceDelay: 300,
75
- * name: 'fieldName',
76
- * onBlur: field.onBlur,
77
- * onChange: field.onChange,
78
- * value: field.value,
79
- * });
80
- *
81
- * return <input value={value} onChange={onChange} onBlur={onBlur} />;
82
- * };
83
- * ```
84
- */
85
- const useInputValueTransform = ({ type, transform }) => {
86
- return {
87
- toDisplayValue: (0, react.useCallback)((formValue) => {
88
- if (transform?.toDisplayValue) return transform.toDisplayValue(formValue);
89
- if (type === "number") {
90
- if (formValue === "") return "";
91
- const numValue = Number(formValue);
92
- return Number.isNaN(numValue) ? formValue : numValue;
93
- }
94
- return formValue ?? "";
95
- }, [type, transform]),
96
- toFormValue: (0, react.useCallback)((displayValue) => {
97
- if (transform?.toFormValue) return transform.toFormValue(displayValue);
98
- if (type === "number") {
99
- if (displayValue === "") return "";
100
- const numValue = Number(displayValue);
101
- return Number.isNaN(numValue) ? displayValue : numValue;
102
- }
103
- return displayValue;
104
- }, [type, transform])
105
- };
106
- };
107
- //#endregion
108
- Object.defineProperty(exports, "useInputValueTransform", {
109
- enumerable: true,
110
- get: function() {
111
- return useInputValueTransform;
112
- }
113
- });
114
-
115
- //# sourceMappingURL=useInputValueTransform-P62UUZBl.cjs.map