@fuf-stack/uniform 1.10.3 → 1.11.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.
- package/dist/Checkboxes/index.cjs +4 -18
- package/dist/Checkboxes/index.d.cts +2 -11
- package/dist/Checkboxes/index.d.ts +2 -11
- package/dist/Checkboxes/index.js +3 -19
- package/dist/Checkboxes-CGWhnpBp.js +115 -0
- package/dist/Checkboxes-CGWhnpBp.js.map +1 -0
- package/dist/Checkboxes-Ds6bzl6p.cjs +127 -0
- package/dist/Checkboxes-Ds6bzl6p.cjs.map +1 -0
- package/dist/FieldArray/index.cjs +4 -21
- package/dist/FieldArray/index.d.cts +2 -10
- package/dist/FieldArray/index.d.ts +2 -10
- package/dist/FieldArray/index.js +3 -22
- package/dist/FieldArray-BexXN9bO.cjs +515 -0
- package/dist/FieldArray-BexXN9bO.cjs.map +1 -0
- package/dist/FieldArray-D3iUaRLo.js +503 -0
- package/dist/FieldArray-D3iUaRLo.js.map +1 -0
- package/dist/FieldCard/index.cjs +3 -18
- package/dist/FieldCard/index.d.cts +2 -97
- package/dist/FieldCard/index.d.ts +2 -97
- package/dist/FieldCard/index.js +3 -19
- package/dist/FieldCard-mpmErfDK.js +121 -0
- package/dist/FieldCard-mpmErfDK.js.map +1 -0
- package/dist/FieldCard-pP7aniZU.cjs +133 -0
- package/dist/FieldCard-pP7aniZU.cjs.map +1 -0
- package/dist/FieldCopyTestIdButton-AaLwu_8y.cjs +41 -0
- package/dist/FieldCopyTestIdButton-AaLwu_8y.cjs.map +1 -0
- package/dist/FieldCopyTestIdButton-Cx8AXJhO.js +29 -0
- package/dist/FieldCopyTestIdButton-Cx8AXJhO.js.map +1 -0
- package/dist/FieldValidationError-Cq6aI0tE.cjs +65 -0
- package/dist/FieldValidationError-Cq6aI0tE.cjs.map +1 -0
- package/dist/FieldValidationError-D86DPSOH.js +53 -0
- package/dist/FieldValidationError-D86DPSOH.js.map +1 -0
- package/dist/Form/index.cjs +4 -13
- package/dist/Form/index.d.cts +2 -11
- package/dist/Form/index.d.ts +3 -11
- package/dist/Form/index.js +3 -14
- package/dist/Form-CFmCTl60.js +119 -0
- package/dist/Form-CFmCTl60.js.map +1 -0
- package/dist/Form-FvN3SXfF.cjs +130 -0
- package/dist/Form-FvN3SXfF.cjs.map +1 -0
- package/dist/FormContext-C2_WMi_v.d.ts +18 -0
- package/dist/FormContext-C2_WMi_v.d.ts.map +1 -0
- package/dist/FormContext-C3GymQOA.cjs +275 -0
- package/dist/FormContext-C3GymQOA.cjs.map +1 -0
- package/dist/FormContext-CN9n_KdE.js +229 -0
- package/dist/FormContext-CN9n_KdE.js.map +1 -0
- package/dist/FormContext-Dl7KL_wl.d.cts +18 -0
- package/dist/FormContext-Dl7KL_wl.d.cts.map +1 -0
- package/dist/Grid/index.cjs +4 -9
- package/dist/Grid/index.d.cts +2 -8
- package/dist/Grid/index.d.ts +2 -8
- package/dist/Grid/index.js +3 -10
- package/dist/Grid-DEH7Sezi.js +23 -0
- package/dist/Grid-DEH7Sezi.js.map +1 -0
- package/dist/Grid-DG60vYYG.cjs +35 -0
- package/dist/Grid-DG60vYYG.cjs.map +1 -0
- package/dist/Input/index.cjs +4 -19
- package/dist/Input/index.d.cts +2 -11
- package/dist/Input/index.d.ts +2 -11
- package/dist/Input/index.js +3 -20
- package/dist/Input--h5t7Sbl.js +94 -0
- package/dist/Input--h5t7Sbl.js.map +1 -0
- package/dist/Input-DKfFFOpo.cjs +106 -0
- package/dist/Input-DKfFFOpo.cjs.map +1 -0
- package/dist/RadioBoxes/index.cjs +5 -20
- package/dist/RadioBoxes/index.d.cts +2 -10
- package/dist/RadioBoxes/index.d.ts +2 -10
- package/dist/RadioBoxes/index.js +3 -21
- package/dist/RadioBoxes-7qdHj3ti.js +138 -0
- package/dist/RadioBoxes-7qdHj3ti.js.map +1 -0
- package/dist/RadioBoxes-Bd9ahl4i.cjs +156 -0
- package/dist/RadioBoxes-Bd9ahl4i.cjs.map +1 -0
- package/dist/RadioTabs/index.cjs +4 -18
- package/dist/RadioTabs/index.d.cts +2 -10
- package/dist/RadioTabs/index.d.ts +2 -10
- package/dist/RadioTabs/index.js +3 -19
- package/dist/RadioTabs-DXs98jng.js +119 -0
- package/dist/RadioTabs-DXs98jng.js.map +1 -0
- package/dist/RadioTabs-DcEUdW7r.cjs +132 -0
- package/dist/RadioTabs-DcEUdW7r.cjs.map +1 -0
- package/dist/Radios/index.cjs +4 -18
- package/dist/Radios/index.d.cts +2 -9
- package/dist/Radios/index.d.ts +2 -9
- package/dist/Radios/index.js +3 -19
- package/dist/Radios-BIx06mzU.js +75 -0
- package/dist/Radios-BIx06mzU.js.map +1 -0
- package/dist/Radios-CIPNqPzi.cjs +87 -0
- package/dist/Radios-CIPNqPzi.cjs.map +1 -0
- package/dist/Select/index.cjs +4 -19
- package/dist/Select/index.d.cts +2 -11
- package/dist/Select/index.d.ts +2 -11
- package/dist/Select/index.js +3 -20
- package/dist/Select-BsL7qn2v.cjs +246 -0
- package/dist/Select-BsL7qn2v.cjs.map +1 -0
- package/dist/Select-CBjqYDcs.js +233 -0
- package/dist/Select-CBjqYDcs.js.map +1 -0
- package/dist/Slider/index.cjs +4 -18
- package/dist/Slider/index.d.cts +2 -10
- package/dist/Slider/index.d.ts +2 -10
- package/dist/Slider/index.js +3 -19
- package/dist/Slider-BDLbD7d5.cjs +123 -0
- package/dist/Slider-BDLbD7d5.cjs.map +1 -0
- package/dist/Slider-BHjHSoIk.js +111 -0
- package/dist/Slider-BHjHSoIk.js.map +1 -0
- package/dist/SubmitButton/index.cjs +4 -13
- package/dist/SubmitButton/index.d.cts +2 -9
- package/dist/SubmitButton/index.d.ts +2 -9
- package/dist/SubmitButton/index.js +3 -14
- package/dist/SubmitButton-7iOaKzhB.js +34 -0
- package/dist/SubmitButton-7iOaKzhB.js.map +1 -0
- package/dist/SubmitButton-DhtPJuro.cjs +46 -0
- package/dist/SubmitButton-DhtPJuro.cjs.map +1 -0
- package/dist/Switch/index.cjs +4 -18
- package/dist/Switch/index.d.cts +2 -11
- package/dist/Switch/index.d.ts +2 -11
- package/dist/Switch/index.js +3 -19
- package/dist/Switch-DCxAgt_L.js +84 -0
- package/dist/Switch-DCxAgt_L.js.map +1 -0
- package/dist/Switch-Dczzog3v.cjs +96 -0
- package/dist/Switch-Dczzog3v.cjs.map +1 -0
- package/dist/SwitchBox/index.cjs +5 -20
- package/dist/SwitchBox/index.d.cts +2 -11
- package/dist/SwitchBox/index.d.ts +2 -11
- package/dist/SwitchBox/index.js +3 -21
- package/dist/SwitchBox-DPHryDOM.js +156 -0
- package/dist/SwitchBox-DPHryDOM.js.map +1 -0
- package/dist/SwitchBox-DqVmZYId.cjs +174 -0
- package/dist/SwitchBox-DqVmZYId.cjs.map +1 -0
- package/dist/TextArea/index.cjs +4 -19
- package/dist/TextArea/index.d.cts +2 -10
- package/dist/TextArea/index.d.ts +2 -10
- package/dist/TextArea/index.js +3 -20
- package/dist/TextArea-BR6e-Fio.js +64 -0
- package/dist/TextArea-BR6e-Fio.js.map +1 -0
- package/dist/TextArea-CH-F6_ax.cjs +76 -0
- package/dist/TextArea-CH-F6_ax.cjs.map +1 -0
- package/dist/helpers/index.cjs +8 -18
- package/dist/helpers/index.d.cts +2 -132
- package/dist/helpers/index.d.ts +2 -132
- package/dist/helpers/index.js +3 -18
- package/dist/helpers-B-CJOBt3.js +236 -0
- package/dist/helpers-B-CJOBt3.js.map +1 -0
- package/dist/helpers-KTgXi0lA.cjs +272 -0
- package/dist/helpers-KTgXi0lA.cjs.map +1 -0
- package/dist/hooks/useClientValidation/index.cjs +6 -10
- package/dist/hooks/useClientValidation/index.cjs.map +1 -1
- package/dist/hooks/useClientValidation/index.d.cts +2 -147
- package/dist/hooks/useClientValidation/index.d.ts +2 -147
- package/dist/hooks/useClientValidation/index.js +7 -12
- package/dist/hooks/useClientValidation/index.js.map +1 -1
- package/dist/hooks/useController/index.cjs +5 -7
- package/dist/hooks/useController/index.cjs.map +1 -1
- package/dist/hooks/useController/index.d.cts +2 -29
- package/dist/hooks/useController/index.d.ts +3 -29
- package/dist/hooks/useController/index.js +7 -9
- package/dist/hooks/useController/index.js.map +1 -1
- package/dist/hooks/useFormContext/index.cjs +3 -12
- package/dist/hooks/useFormContext/index.d.cts +2 -62
- package/dist/hooks/useFormContext/index.d.ts +4 -62
- package/dist/hooks/useFormContext/index.js +3 -13
- package/dist/hooks/useInput/index.cjs +11 -5
- package/dist/hooks/useInput/index.cjs.map +1 -1
- package/dist/hooks/useInput/index.d.cts +2 -1
- package/dist/hooks/useInput/index.d.ts +2 -1
- package/dist/hooks/useInput/index.js +7 -7
- package/dist/hooks/useInput/index.js.map +1 -1
- package/dist/hooks/useInputValueDebounce/index.cjs +2 -7
- package/dist/hooks/useInputValueDebounce/index.d.cts +2 -55
- package/dist/hooks/useInputValueDebounce/index.d.ts +2 -55
- package/dist/hooks/useInputValueDebounce/index.js +3 -8
- package/dist/hooks/useInputValueTransform/index.cjs +5 -5
- package/dist/hooks/useInputValueTransform/index.cjs.map +1 -1
- package/dist/hooks/useInputValueTransform/index.d.cts +2 -102
- package/dist/hooks/useInputValueTransform/index.d.ts +2 -102
- package/dist/hooks/useInputValueTransform/index.js +7 -7
- package/dist/hooks/useInputValueTransform/index.js.map +1 -1
- package/dist/hooks/useUniformField/index.cjs +2 -15
- package/dist/hooks/useUniformField/index.d.cts +2 -98
- package/dist/hooks/useUniformField/index.d.ts +6 -98
- package/dist/hooks/useUniformField/index.js +3 -16
- package/dist/hooks/useUniformFieldArray/index.cjs +2 -17
- package/dist/hooks/useUniformFieldArray/index.d.cts +2 -71
- package/dist/hooks/useUniformFieldArray/index.d.ts +7 -71
- package/dist/hooks/useUniformFieldArray/index.js +3 -18
- package/dist/hooks/useWatchUserChange/index.cjs +5 -8
- package/dist/hooks/useWatchUserChange/index.cjs.map +1 -1
- package/dist/hooks/useWatchUserChange/index.d.cts +2 -73
- package/dist/hooks/useWatchUserChange/index.d.ts +2 -73
- package/dist/hooks/useWatchUserChange/index.js +7 -10
- package/dist/hooks/useWatchUserChange/index.js.map +1 -1
- package/dist/index-1gPh6Uoh.d.cts +16 -0
- package/dist/index-1gPh6Uoh.d.cts.map +1 -0
- package/dist/index-B3Z8gdjC.d.ts +1 -0
- package/dist/index-B4Wkijem.d.ts +169 -0
- package/dist/index-B4Wkijem.d.ts.map +1 -0
- package/dist/index-B74QlCAy.d.cts +169 -0
- package/dist/index-B74QlCAy.d.cts.map +1 -0
- package/dist/index-BLREDRDJ.d.cts +1 -0
- package/dist/index-BM4XWo1K.d.ts +118 -0
- package/dist/index-BM4XWo1K.d.ts.map +1 -0
- package/dist/index-BMN2XNyT.d.cts +23 -0
- package/dist/index-BMN2XNyT.d.cts.map +1 -0
- package/dist/index-BOI0cy-n.d.cts +118 -0
- package/dist/index-BOI0cy-n.d.cts.map +1 -0
- package/dist/index-BTEsKen4.d.ts +264 -0
- package/dist/index-BTEsKen4.d.ts.map +1 -0
- package/dist/index-BW9EUWZE.d.cts +23 -0
- package/dist/index-BW9EUWZE.d.cts.map +1 -0
- package/dist/index-BXpMZvwA.d.cts +1 -0
- package/dist/index-BYrmFhKl.d.ts +1 -0
- package/dist/index-BaBZGCqS.d.cts +177 -0
- package/dist/index-BaBZGCqS.d.cts.map +1 -0
- package/dist/index-C1fYmoY0.d.ts +123 -0
- package/dist/index-C1fYmoY0.d.ts.map +1 -0
- package/dist/index-C56I3SOi.d.cts +148 -0
- package/dist/index-C56I3SOi.d.cts.map +1 -0
- package/dist/index-CHmS3ri3.d.ts +16 -0
- package/dist/index-CHmS3ri3.d.ts.map +1 -0
- package/dist/index-CI9QBUoM.d.cts +97 -0
- package/dist/index-CI9QBUoM.d.cts.map +1 -0
- package/dist/index-CJNLQVjx.d.ts +1 -0
- package/dist/index-CO-l7RmT.d.cts +181 -0
- package/dist/index-CO-l7RmT.d.cts.map +1 -0
- package/dist/index-CQWoxgWk.d.ts +23 -0
- package/dist/index-CQWoxgWk.d.ts.map +1 -0
- package/dist/index-CVY05bZf.d.ts +39 -0
- package/dist/index-CVY05bZf.d.ts.map +1 -0
- package/dist/index-C_ATGeaX.d.ts +104 -0
- package/dist/index-C_ATGeaX.d.ts.map +1 -0
- package/dist/index-CbAh0Kfo.d.cts +39 -0
- package/dist/index-CbAh0Kfo.d.cts.map +1 -0
- package/dist/index-CqV2Q3da.d.cts +264 -0
- package/dist/index-CqV2Q3da.d.cts.map +1 -0
- package/dist/index-CraZe1qS.d.ts +97 -0
- package/dist/index-CraZe1qS.d.ts.map +1 -0
- package/dist/index-CvA5yKx9.d.ts +177 -0
- package/dist/index-CvA5yKx9.d.ts.map +1 -0
- package/dist/index-CwSIy_W-.d.cts +1 -0
- package/dist/index-CzypMcVS.d.cts +104 -0
- package/dist/index-CzypMcVS.d.cts.map +1 -0
- package/dist/index-D6RB3b5L.d.ts +148 -0
- package/dist/index-D6RB3b5L.d.ts.map +1 -0
- package/dist/index-DA5um0u6.d.cts +123 -0
- package/dist/index-DA5um0u6.d.cts.map +1 -0
- package/dist/index-DHHBSmJb.d.ts +23 -0
- package/dist/index-DHHBSmJb.d.ts.map +1 -0
- package/dist/index-DhMSgdwM.d.ts +156 -0
- package/dist/index-DhMSgdwM.d.ts.map +1 -0
- package/dist/index-Dklb-p_1.d.cts +156 -0
- package/dist/index-Dklb-p_1.d.cts.map +1 -0
- package/dist/index-DpD4MxGD.d.cts +177 -0
- package/dist/index-DpD4MxGD.d.cts.map +1 -0
- package/dist/index-Drl7euco.d.ts +115 -0
- package/dist/index-Drl7euco.d.ts.map +1 -0
- package/dist/index-DzuP5q-2.d.ts +181 -0
- package/dist/index-DzuP5q-2.d.ts.map +1 -0
- package/dist/index-G0IgQWoU.d.cts +134 -0
- package/dist/index-G0IgQWoU.d.cts.map +1 -0
- package/dist/index-RvYO46Vg.d.ts +178 -0
- package/dist/index-RvYO46Vg.d.ts.map +1 -0
- package/dist/index-UjKqRe-8.d.ts +134 -0
- package/dist/index-UjKqRe-8.d.ts.map +1 -0
- package/dist/index-aHcGnXHf.d.ts +44 -0
- package/dist/index-aHcGnXHf.d.ts.map +1 -0
- package/dist/index-iuLEYAix.d.cts +115 -0
- package/dist/index-iuLEYAix.d.cts.map +1 -0
- package/dist/index-jmQP58tO.d.cts +44 -0
- package/dist/index-jmQP58tO.d.cts.map +1 -0
- package/dist/index.cjs +75 -133
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -38
- package/dist/index.d.ts +31 -38
- package/dist/index.js +33 -133
- package/dist/index.js.map +1 -1
- package/dist/partials/FieldCopyTestIdButton/index.cjs +4 -9
- package/dist/partials/FieldCopyTestIdButton/index.d.cts +2 -7
- package/dist/partials/FieldCopyTestIdButton/index.d.ts +2 -7
- package/dist/partials/FieldCopyTestIdButton/index.js +3 -10
- package/dist/partials/FieldValidationError/index.cjs +4 -9
- package/dist/partials/FieldValidationError/index.d.cts +2 -8
- package/dist/partials/FieldValidationError/index.d.ts +2 -8
- package/dist/partials/FieldValidationError/index.js +3 -10
- package/dist/useClientValidation-BnnscAEe.js +179 -0
- package/dist/useClientValidation-BnnscAEe.js.map +1 -0
- package/dist/useClientValidation-C3Q5UCy9.d.cts +150 -0
- package/dist/useClientValidation-C3Q5UCy9.d.cts.map +1 -0
- package/dist/useClientValidation-CkBtUSco.d.ts +150 -0
- package/dist/useClientValidation-CkBtUSco.d.ts.map +1 -0
- package/dist/useClientValidation-oZd4_ocQ.cjs +191 -0
- package/dist/useClientValidation-oZd4_ocQ.cjs.map +1 -0
- package/dist/useController-BzkCcbSo.cjs +48 -0
- package/dist/useController-BzkCcbSo.cjs.map +1 -0
- package/dist/useController-C_MZLZIp.d.cts +31 -0
- package/dist/useController-C_MZLZIp.d.cts.map +1 -0
- package/dist/useController-CumIERks.js +43 -0
- package/dist/useController-CumIERks.js.map +1 -0
- package/dist/useController-hjpJQf0w.d.ts +31 -0
- package/dist/useController-hjpJQf0w.d.ts.map +1 -0
- package/dist/useFormContext-356X5XAY.js +6 -0
- package/dist/useFormContext-356X5XAY.js.map +1 -0
- package/dist/useFormContext-3AAPT6eZ.d.ts +64 -0
- package/dist/useFormContext-3AAPT6eZ.d.ts.map +1 -0
- package/dist/useFormContext-CWuN-_7P.cjs +134 -0
- package/dist/useFormContext-CWuN-_7P.cjs.map +1 -0
- package/dist/useFormContext-CZh7pv8f.d.cts +64 -0
- package/dist/useFormContext-CZh7pv8f.d.cts.map +1 -0
- package/dist/useFormContext-CkeSOfWD.cjs +6 -0
- package/dist/useFormContext-CkeSOfWD.cjs.map +1 -0
- package/dist/useFormContext-JCm1UR_e.js +123 -0
- package/dist/useFormContext-JCm1UR_e.js.map +1 -0
- package/dist/useInput-DZ6KGBxw.js +3 -0
- package/dist/useInput-IGJqJ2tR.d.ts +2 -0
- package/dist/useInput-NMHJNZ5A.d.cts +2 -0
- package/dist/useInputValueDebounce-B2RzCWty.d.cts +62 -0
- package/dist/useInputValueDebounce-B2RzCWty.d.cts.map +1 -0
- package/dist/useInputValueDebounce-C7_bvNGH.d.ts +62 -0
- package/dist/useInputValueDebounce-C7_bvNGH.d.ts.map +1 -0
- package/dist/useInputValueDebounce-DaH5ONlQ.js +84 -0
- package/dist/useInputValueDebounce-DaH5ONlQ.js.map +1 -0
- package/dist/useInputValueDebounce-tL8maIp8.cjs +90 -0
- package/dist/useInputValueDebounce-tL8maIp8.cjs.map +1 -0
- package/dist/useInputValueTransform-BID-CQ-y.d.cts +107 -0
- package/dist/useInputValueTransform-BID-CQ-y.d.cts.map +1 -0
- package/dist/useInputValueTransform-C-uSW8Y3.cjs +116 -0
- package/dist/useInputValueTransform-C-uSW8Y3.cjs.map +1 -0
- package/dist/useInputValueTransform-D7LfyYRe.d.ts +107 -0
- package/dist/useInputValueTransform-D7LfyYRe.d.ts.map +1 -0
- package/dist/useInputValueTransform-aiIf8lq5.js +110 -0
- package/dist/useInputValueTransform-aiIf8lq5.js.map +1 -0
- package/dist/useUniformField-BMvnRC_r.cjs +136 -0
- package/dist/useUniformField-BMvnRC_r.cjs.map +1 -0
- package/dist/useUniformField-Be3kdnhK.d.cts +98 -0
- package/dist/useUniformField-Be3kdnhK.d.cts.map +1 -0
- package/dist/useUniformField-ClprfrES.js +129 -0
- package/dist/useUniformField-ClprfrES.js.map +1 -0
- package/dist/useUniformField-DDHQ5B11.d.ts +98 -0
- package/dist/useUniformField-DDHQ5B11.d.ts.map +1 -0
- package/dist/useUniformFieldArray-BBFw08qL.d.cts +79 -0
- package/dist/useUniformFieldArray-BBFw08qL.d.cts.map +1 -0
- package/dist/useUniformFieldArray-BhPi3gPv.d.ts +79 -0
- package/dist/useUniformFieldArray-BhPi3gPv.d.ts.map +1 -0
- package/dist/useUniformFieldArray-C-0OXG3N.js +84 -0
- package/dist/useUniformFieldArray-C-0OXG3N.js.map +1 -0
- package/dist/useUniformFieldArray-btjvJdZ6.cjs +90 -0
- package/dist/useUniformFieldArray-btjvJdZ6.cjs.map +1 -0
- package/dist/useWatchUserChange-BAdiqg2q.d.ts +78 -0
- package/dist/useWatchUserChange-BAdiqg2q.d.ts.map +1 -0
- package/dist/useWatchUserChange-C1ezpj0t.js +83 -0
- package/dist/useWatchUserChange-C1ezpj0t.js.map +1 -0
- package/dist/useWatchUserChange-C5dr12By.cjs +89 -0
- package/dist/useWatchUserChange-C5dr12By.cjs.map +1 -0
- package/dist/useWatchUserChange-COVdHmki.d.cts +78 -0
- package/dist/useWatchUserChange-COVdHmki.d.cts.map +1 -0
- package/package.json +73 -100
- package/dist/Checkboxes/index.cjs.map +0 -1
- package/dist/Checkboxes/index.js.map +0 -1
- package/dist/Checkboxes-CBgO9itq.d.cts +0 -171
- package/dist/Checkboxes-CFbsc6zg.d.ts +0 -171
- package/dist/FieldArray/index.cjs.map +0 -1
- package/dist/FieldArray/index.js.map +0 -1
- package/dist/FieldArray-72vn2MG9.d.cts +0 -160
- package/dist/FieldArray-72vn2MG9.d.ts +0 -160
- package/dist/FieldCard/index.cjs.map +0 -1
- package/dist/FieldCard/index.js.map +0 -1
- package/dist/FieldCopyTestIdButton-_TDlmw0L.d.cts +0 -11
- package/dist/FieldCopyTestIdButton-_TDlmw0L.d.ts +0 -11
- package/dist/FieldValidationError-DwtLkGMo.d.cts +0 -17
- package/dist/FieldValidationError-DwtLkGMo.d.ts +0 -17
- package/dist/Form/index.cjs.map +0 -1
- package/dist/Form/index.js.map +0 -1
- package/dist/Form-BZZJPLsi.d.cts +0 -32
- package/dist/Form-zsUjI2yq.d.ts +0 -32
- package/dist/FormContext-9Firwt4k.d.cts +0 -14
- package/dist/FormContext-9Firwt4k.d.ts +0 -14
- package/dist/Grid/index.cjs.map +0 -1
- package/dist/Grid/index.js.map +0 -1
- package/dist/Grid-DF3L9NF3.d.cts +0 -17
- package/dist/Grid-DF3L9NF3.d.ts +0 -17
- package/dist/Input/index.cjs.map +0 -1
- package/dist/Input/index.js.map +0 -1
- package/dist/Input-BGYDOpbo.d.cts +0 -101
- package/dist/Input-__SqMh2n.d.ts +0 -101
- package/dist/RadioBox-DnqCiTR1.d.cts +0 -168
- package/dist/RadioBox-DnqCiTR1.d.ts +0 -168
- package/dist/RadioBoxes/index.cjs.map +0 -1
- package/dist/RadioBoxes/index.js.map +0 -1
- package/dist/RadioTabs/index.cjs.map +0 -1
- package/dist/RadioTabs/index.js.map +0 -1
- package/dist/RadioTabs-DkR5fvl4.d.cts +0 -138
- package/dist/RadioTabs-DkR5fvl4.d.ts +0 -138
- package/dist/Radios/index.cjs.map +0 -1
- package/dist/Radios/index.js.map +0 -1
- package/dist/Radios-lLVlvY_B.d.cts +0 -115
- package/dist/Radios-lLVlvY_B.d.ts +0 -115
- package/dist/Select/index.cjs.map +0 -1
- package/dist/Select/index.js.map +0 -1
- package/dist/Select-DWlnKj5c.d.cts +0 -249
- package/dist/Select-DWlnKj5c.d.ts +0 -249
- package/dist/Slider/index.cjs.map +0 -1
- package/dist/Slider/index.js.map +0 -1
- package/dist/Slider-CxHvafJA.d.cts +0 -155
- package/dist/Slider-CxHvafJA.d.ts +0 -155
- package/dist/SubmitButton/index.cjs.map +0 -1
- package/dist/SubmitButton/index.js.map +0 -1
- package/dist/SubmitButton-DqaxyVpp.d.cts +0 -28
- package/dist/SubmitButton-DqaxyVpp.d.ts +0 -28
- package/dist/Switch/index.cjs.map +0 -1
- package/dist/Switch/index.js.map +0 -1
- package/dist/Switch-B4AuHAMX.d.cts +0 -108
- package/dist/Switch-B4AuHAMX.d.ts +0 -108
- package/dist/SwitchBox/index.cjs.map +0 -1
- package/dist/SwitchBox/index.js.map +0 -1
- package/dist/SwitchBox-q1I7a0NX.d.cts +0 -146
- package/dist/SwitchBox-q1I7a0NX.d.ts +0 -146
- package/dist/TextArea/index.cjs.map +0 -1
- package/dist/TextArea/index.js.map +0 -1
- package/dist/TextArea-CYcFOcun.d.cts +0 -88
- package/dist/TextArea-CYcFOcun.d.ts +0 -88
- package/dist/chunk-264VRHMT.js +0 -105
- package/dist/chunk-264VRHMT.js.map +0 -1
- package/dist/chunk-26VE4IGU.js +0 -68
- package/dist/chunk-26VE4IGU.js.map +0 -1
- package/dist/chunk-2HDXHQOC.js +0 -215
- package/dist/chunk-2HDXHQOC.js.map +0 -1
- package/dist/chunk-2UQCRQEJ.cjs +0 -68
- package/dist/chunk-2UQCRQEJ.cjs.map +0 -1
- package/dist/chunk-36LBVB45.js +0 -1
- package/dist/chunk-36LBVB45.js.map +0 -1
- package/dist/chunk-3JAVQAL5.cjs +0 -1
- package/dist/chunk-3JAVQAL5.cjs.map +0 -1
- package/dist/chunk-3ZQXSGR2.cjs +0 -67
- package/dist/chunk-3ZQXSGR2.cjs.map +0 -1
- package/dist/chunk-4CQWTUQR.js +0 -292
- package/dist/chunk-4CQWTUQR.js.map +0 -1
- package/dist/chunk-4HFPBJ3O.cjs +0 -171
- package/dist/chunk-4HFPBJ3O.cjs.map +0 -1
- package/dist/chunk-4RQJCFM7.js +0 -154
- package/dist/chunk-4RQJCFM7.js.map +0 -1
- package/dist/chunk-555JRYCS.cjs +0 -61
- package/dist/chunk-555JRYCS.cjs.map +0 -1
- package/dist/chunk-55VJM3KD.cjs +0 -118
- package/dist/chunk-55VJM3KD.cjs.map +0 -1
- package/dist/chunk-56TQOKG7.cjs +0 -48
- package/dist/chunk-56TQOKG7.cjs.map +0 -1
- package/dist/chunk-5MTIQ6WD.js +0 -41
- package/dist/chunk-5MTIQ6WD.js.map +0 -1
- package/dist/chunk-6AWHOBNL.cjs +0 -41
- package/dist/chunk-6AWHOBNL.cjs.map +0 -1
- package/dist/chunk-6GN62PBG.cjs +0 -182
- package/dist/chunk-6GN62PBG.cjs.map +0 -1
- package/dist/chunk-7MOAXLQZ.js +0 -103
- package/dist/chunk-7MOAXLQZ.js.map +0 -1
- package/dist/chunk-7OMJ26AT.js +0 -165
- package/dist/chunk-7OMJ26AT.js.map +0 -1
- package/dist/chunk-7ZE7IZ5R.cjs +0 -103
- package/dist/chunk-7ZE7IZ5R.cjs.map +0 -1
- package/dist/chunk-AHJJIANM.js +0 -7
- package/dist/chunk-AHJJIANM.js.map +0 -1
- package/dist/chunk-AQJLKHAE.cjs +0 -277
- package/dist/chunk-AQJLKHAE.cjs.map +0 -1
- package/dist/chunk-B62HKKMS.js +0 -20
- package/dist/chunk-B62HKKMS.js.map +0 -1
- package/dist/chunk-C6WYP35Z.js +0 -219
- package/dist/chunk-C6WYP35Z.js.map +0 -1
- package/dist/chunk-CNTOODUQ.js +0 -48
- package/dist/chunk-CNTOODUQ.js.map +0 -1
- package/dist/chunk-ECUVOZGQ.cjs +0 -148
- package/dist/chunk-ECUVOZGQ.cjs.map +0 -1
- package/dist/chunk-ELYGQTXB.js +0 -47
- package/dist/chunk-ELYGQTXB.js.map +0 -1
- package/dist/chunk-EVASKP6Q.js +0 -148
- package/dist/chunk-EVASKP6Q.js.map +0 -1
- package/dist/chunk-FYN7ZWLW.cjs +0 -115
- package/dist/chunk-FYN7ZWLW.cjs.map +0 -1
- package/dist/chunk-GEC75GNL.js +0 -137
- package/dist/chunk-GEC75GNL.js.map +0 -1
- package/dist/chunk-HEPNEBRF.cjs +0 -26
- package/dist/chunk-HEPNEBRF.cjs.map +0 -1
- package/dist/chunk-IR75YRIZ.js +0 -171
- package/dist/chunk-IR75YRIZ.js.map +0 -1
- package/dist/chunk-IV45K4WU.js +0 -277
- package/dist/chunk-IV45K4WU.js.map +0 -1
- package/dist/chunk-K2V4ULA2.js +0 -61
- package/dist/chunk-K2V4ULA2.js.map +0 -1
- package/dist/chunk-KBKMMDLM.js +0 -118
- package/dist/chunk-KBKMMDLM.js.map +0 -1
- package/dist/chunk-KDNO5YO5.cjs +0 -105
- package/dist/chunk-KDNO5YO5.cjs.map +0 -1
- package/dist/chunk-LEMQGDFE.js +0 -67
- package/dist/chunk-LEMQGDFE.js.map +0 -1
- package/dist/chunk-LO7UKHOS.js +0 -26
- package/dist/chunk-LO7UKHOS.js.map +0 -1
- package/dist/chunk-LWPZZ2AW.cjs +0 -172
- package/dist/chunk-LWPZZ2AW.cjs.map +0 -1
- package/dist/chunk-NG3CJ3UE.js +0 -699
- package/dist/chunk-NG3CJ3UE.js.map +0 -1
- package/dist/chunk-NHEZXA4H.cjs +0 -47
- package/dist/chunk-NHEZXA4H.cjs.map +0 -1
- package/dist/chunk-NTDKZW4E.js +0 -35
- package/dist/chunk-NTDKZW4E.js.map +0 -1
- package/dist/chunk-O2XJNQQK.js +0 -154
- package/dist/chunk-O2XJNQQK.js.map +0 -1
- package/dist/chunk-OE5BOGGX.cjs +0 -35
- package/dist/chunk-OE5BOGGX.cjs.map +0 -1
- package/dist/chunk-OKJWLH7T.cjs +0 -154
- package/dist/chunk-OKJWLH7T.cjs.map +0 -1
- package/dist/chunk-OORASWXL.js +0 -49
- package/dist/chunk-OORASWXL.js.map +0 -1
- package/dist/chunk-OT3A4LEE.cjs +0 -154
- package/dist/chunk-OT3A4LEE.cjs.map +0 -1
- package/dist/chunk-PCTYJUY7.cjs +0 -7
- package/dist/chunk-PCTYJUY7.cjs.map +0 -1
- package/dist/chunk-PRUIH5LI.js +0 -131
- package/dist/chunk-PRUIH5LI.js.map +0 -1
- package/dist/chunk-QLNJZDVF.js +0 -182
- package/dist/chunk-QLNJZDVF.js.map +0 -1
- package/dist/chunk-RVBTLB5G.cjs +0 -131
- package/dist/chunk-RVBTLB5G.cjs.map +0 -1
- package/dist/chunk-SJWL6EMI.js +0 -115
- package/dist/chunk-SJWL6EMI.js.map +0 -1
- package/dist/chunk-SW3NGBCE.cjs +0 -215
- package/dist/chunk-SW3NGBCE.cjs.map +0 -1
- package/dist/chunk-THDHNYP7.cjs +0 -219
- package/dist/chunk-THDHNYP7.cjs.map +0 -1
- package/dist/chunk-TTD3KL6E.cjs +0 -20
- package/dist/chunk-TTD3KL6E.cjs.map +0 -1
- package/dist/chunk-UB7CSOZU.js +0 -172
- package/dist/chunk-UB7CSOZU.js.map +0 -1
- package/dist/chunk-V3M7HL26.cjs +0 -137
- package/dist/chunk-V3M7HL26.cjs.map +0 -1
- package/dist/chunk-WXSISX5Y.cjs +0 -49
- package/dist/chunk-WXSISX5Y.cjs.map +0 -1
- package/dist/chunk-WYM6IAIJ.cjs +0 -292
- package/dist/chunk-WYM6IAIJ.cjs.map +0 -1
- package/dist/chunk-YYR23V5P.cjs +0 -165
- package/dist/chunk-YYR23V5P.cjs.map +0 -1
- package/dist/chunk-Z6QACVK7.cjs +0 -699
- package/dist/chunk-Z6QACVK7.cjs.map +0 -1
- package/dist/helpers/index.cjs.map +0 -1
- package/dist/helpers/index.js.map +0 -1
- package/dist/hooks/useFormContext/index.cjs.map +0 -1
- package/dist/hooks/useFormContext/index.js.map +0 -1
- package/dist/hooks/useInputValueDebounce/index.cjs.map +0 -1
- package/dist/hooks/useInputValueDebounce/index.js.map +0 -1
- package/dist/hooks/useUniformField/index.cjs.map +0 -1
- package/dist/hooks/useUniformField/index.js.map +0 -1
- package/dist/hooks/useUniformFieldArray/index.cjs.map +0 -1
- package/dist/hooks/useUniformFieldArray/index.js.map +0 -1
- package/dist/partials/FieldCopyTestIdButton/index.cjs.map +0 -1
- package/dist/partials/FieldCopyTestIdButton/index.js.map +0 -1
- package/dist/partials/FieldValidationError/index.cjs.map +0 -1
- package/dist/partials/FieldValidationError/index.js.map +0 -1
|
@@ -0,0 +1,107 @@
|
|
|
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
|
+
* initialValue: field.value,
|
|
92
|
+
* debounceDelay: 300,
|
|
93
|
+
* onBlur: field.onBlur,
|
|
94
|
+
* onChange: field.onChange,
|
|
95
|
+
* });
|
|
96
|
+
*
|
|
97
|
+
* return <input value={value} onChange={onChange} onBlur={onBlur} />;
|
|
98
|
+
* };
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
declare const useInputValueTransform: <TDisplay = unknown>({
|
|
102
|
+
type,
|
|
103
|
+
transform
|
|
104
|
+
}: UseInputValueTransformOptions<TDisplay>) => UseInputValueTransformReturn<TDisplay>;
|
|
105
|
+
//#endregion
|
|
106
|
+
export { useInputValueTransform as i, UseInputValueTransformOptions as n, UseInputValueTransformReturn as r, InputValueTransform as t };
|
|
107
|
+
//# sourceMappingURL=useInputValueTransform-BID-CQ-y.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInputValueTransform-BID-CQ-y.d.cts","names":[],"sources":["../src/hooks/useInputValueTransform/useInputValueTransform.ts"],"sourcesContent":[],"mappings":";UAEiB;EAAA;EAOA,cAAA,EAAA,CAAA,KAAA,EAAA,OAAA,EAA6B,GALR,QAKQ;EAO7B;EAwFJ,WAAA,EAAA,CAAA,KAAA,EAlGU,QA0JtB,EAAA,GAAA,OAAA;;AAxD0D,UA/F1C,6BA+F0C,CAAA,WAAA,OAAA,CAAA,CAAA;EAG1B;EAA9B,IAAA,CAAA,EAAA,MAAA,GAAA,QAAA,GAAA,UAAA;EAAuE;EAA7B,SAAA,CAAA,EA9F/B,mBA8F+B,CA9FX,QA8FW,CAAA;;UA3F5B;;0CAEyB;;8BAEZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAoFjB;;;GAGV,8BAA8B,cAAY,6BAA6B"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
const require_FormContext = require('./FormContext-C3GymQOA.cjs');
|
|
2
|
+
let react = require("react");
|
|
3
|
+
|
|
4
|
+
//#region src/hooks/useInputValueTransform/useInputValueTransform.ts
|
|
5
|
+
/**
|
|
6
|
+
* Custom hook providing utility functions for value transformations between display and form values.
|
|
7
|
+
*
|
|
8
|
+
* This hook provides pure conversion functions without any state management. It's useful for:
|
|
9
|
+
* - Currency formatting ($1,000 display vs 1000 stored)
|
|
10
|
+
* - Number inputs with special handling
|
|
11
|
+
* - Date formatting (MM/DD/YYYY display vs ISO date stored)
|
|
12
|
+
* - Phone number formatting ((555) 123-4567 display vs 5551234567 stored)
|
|
13
|
+
* - Array/Object transformations (single value ↔ array, nested structures)
|
|
14
|
+
*
|
|
15
|
+
* **Key Features:**
|
|
16
|
+
* - Pure conversion functions (no state)
|
|
17
|
+
* - Generic support for any data type (strings, numbers, arrays, objects)
|
|
18
|
+
* - Special number input handling (empty string preservation)
|
|
19
|
+
* - Bidirectional value transformations
|
|
20
|
+
* - Memoized functions for performance
|
|
21
|
+
*
|
|
22
|
+
* @param options Configuration for value transformation
|
|
23
|
+
* @returns Pure conversion utility functions
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```tsx
|
|
27
|
+
* // Currency formatting
|
|
28
|
+
* const currencyTransform = {
|
|
29
|
+
* toDisplayValue: (val) => val ? `$${Number(val).toLocaleString()}` : '',
|
|
30
|
+
* toFormValue: (val) => parseFloat(val.replace(/[$,]/g, '')) || 0
|
|
31
|
+
* };
|
|
32
|
+
*
|
|
33
|
+
* const { toDisplayValue, toFormValue } = useInputValueTransform({
|
|
34
|
+
* transform: currencyTransform
|
|
35
|
+
* });
|
|
36
|
+
*
|
|
37
|
+
* const displayVal = toDisplayValue(1000); // "$1,000"
|
|
38
|
+
* const formVal = toFormValue("$1,500"); // 1500
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* // Number input (no transforms needed)
|
|
44
|
+
* const { toDisplayValue, toFormValue } = useInputValueTransform({
|
|
45
|
+
* type: 'number'
|
|
46
|
+
* });
|
|
47
|
+
*
|
|
48
|
+
* // Handles empty string → empty string (not NaN)
|
|
49
|
+
* // Handles "123" → 123 (string to number conversion)
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```tsx
|
|
54
|
+
* // Array to single value (for single checkbox)
|
|
55
|
+
* const singleValueTransform = {
|
|
56
|
+
* toDisplayValue: (val: string[]) => val?.[0] || '',
|
|
57
|
+
* toFormValue: (val: string) => val ? [val] : []
|
|
58
|
+
* };
|
|
59
|
+
*
|
|
60
|
+
* const { toDisplayValue, toFormValue } = useInputValueTransform({
|
|
61
|
+
* transform: singleValueTransform
|
|
62
|
+
* });
|
|
63
|
+
*
|
|
64
|
+
* const displayVal = toDisplayValue(['option1']); // "option1"
|
|
65
|
+
* const formVal = toFormValue("option2"); // ["option2"]
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```tsx
|
|
70
|
+
* // Integration with debouncing
|
|
71
|
+
* const MyInput = ({ field, transform }) => {
|
|
72
|
+
* const transform = useInputValueTransform({ transform });
|
|
73
|
+
*
|
|
74
|
+
* const { onChange, onBlur, value } = useInputValueDebounce({
|
|
75
|
+
* ...transform,
|
|
76
|
+
* initialValue: field.value,
|
|
77
|
+
* debounceDelay: 300,
|
|
78
|
+
* onBlur: field.onBlur,
|
|
79
|
+
* onChange: field.onChange,
|
|
80
|
+
* });
|
|
81
|
+
*
|
|
82
|
+
* return <input value={value} onChange={onChange} onBlur={onBlur} />;
|
|
83
|
+
* };
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
const useInputValueTransform = ({ type, transform }) => {
|
|
87
|
+
return {
|
|
88
|
+
toDisplayValue: (0, react.useCallback)((formValue) => {
|
|
89
|
+
if (transform?.toDisplayValue) return transform.toDisplayValue(formValue);
|
|
90
|
+
if (type === "number") {
|
|
91
|
+
if (formValue === "") return "";
|
|
92
|
+
const numValue = Number(formValue);
|
|
93
|
+
return Number.isNaN(numValue) ? formValue : numValue;
|
|
94
|
+
}
|
|
95
|
+
return formValue ?? "";
|
|
96
|
+
}, [type, transform]),
|
|
97
|
+
toFormValue: (0, react.useCallback)((displayValue) => {
|
|
98
|
+
if (transform?.toFormValue) return transform.toFormValue(displayValue);
|
|
99
|
+
if (type === "number") {
|
|
100
|
+
if (displayValue === "") return "";
|
|
101
|
+
const numValue = Number(displayValue);
|
|
102
|
+
return Number.isNaN(numValue) ? displayValue : numValue;
|
|
103
|
+
}
|
|
104
|
+
return displayValue;
|
|
105
|
+
}, [type, transform])
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
//#endregion
|
|
110
|
+
Object.defineProperty(exports, 'useInputValueTransform', {
|
|
111
|
+
enumerable: true,
|
|
112
|
+
get: function () {
|
|
113
|
+
return useInputValueTransform;
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
//# sourceMappingURL=useInputValueTransform-C-uSW8Y3.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInputValueTransform-C-uSW8Y3.cjs","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 * initialValue: field.value,\n * debounceDelay: 300,\n * onBlur: field.onBlur,\n * onChange: field.onChange,\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwGA,MAAa,0BAA8C,EACzD,MACA,gBACqF;AAiDrF,QAAO;EACL,wCA7CC,cAAiC;AAChC,OAAI,WAAW,eACb,QAAO,UAAU,eAAe,UAAU;AAI5C,OAAI,SAAS,UAAU;AACrB,QAAI,cAAc,GAChB,QAAO;IAET,MAAM,WAAW,OAAO,UAAU;AAClC,WAAQ,OAAO,MAAM,SAAS,GAAG,YAAY;;AAI/C,UAAQ,aAAa;KAEvB,CAAC,MAAM,UAAU,CAClB;EA4BC,qCAtBC,iBAAoC;AACnC,OAAI,WAAW,YACb,QAAO,UAAU,YAAY,aAAa;AAI5C,OAAI,SAAS,UAAU;AACrB,QAAI,iBAAiB,GACnB,QAAO;IAET,MAAM,WAAW,OAAO,aAAa;AACrC,WAAO,OAAO,MAAM,SAAS,GAAG,eAAe;;AAIjD,UAAO;KAET,CAAC,MAAM,UAAU,CAClB;EAKA"}
|
|
@@ -0,0 +1,107 @@
|
|
|
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
|
+
* initialValue: field.value,
|
|
92
|
+
* debounceDelay: 300,
|
|
93
|
+
* onBlur: field.onBlur,
|
|
94
|
+
* onChange: field.onChange,
|
|
95
|
+
* });
|
|
96
|
+
*
|
|
97
|
+
* return <input value={value} onChange={onChange} onBlur={onBlur} />;
|
|
98
|
+
* };
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
declare const useInputValueTransform: <TDisplay = unknown>({
|
|
102
|
+
type,
|
|
103
|
+
transform
|
|
104
|
+
}: UseInputValueTransformOptions<TDisplay>) => UseInputValueTransformReturn<TDisplay>;
|
|
105
|
+
//#endregion
|
|
106
|
+
export { useInputValueTransform as i, UseInputValueTransformOptions as n, UseInputValueTransformReturn as r, InputValueTransform as t };
|
|
107
|
+
//# sourceMappingURL=useInputValueTransform-D7LfyYRe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInputValueTransform-D7LfyYRe.d.ts","names":[],"sources":["../src/hooks/useInputValueTransform/useInputValueTransform.ts"],"sourcesContent":[],"mappings":";UAEiB;EAAA;EAOA,cAAA,EAAA,CAAA,KAAA,EAAA,OAAA,EAA6B,GALR,QAKQ;EAO7B;EAwFJ,WAAA,EAAA,CAAA,KAAA,EAlGU,QA0JtB,EAAA,GAAA,OAAA;;AAxD0D,UA/F1C,6BA+F0C,CAAA,WAAA,OAAA,CAAA,CAAA;EAG1B;EAA9B,IAAA,CAAA,EAAA,MAAA,GAAA,QAAA,GAAA,UAAA;EAAuE;EAA7B,SAAA,CAAA,EA9F/B,mBA8F+B,CA9FX,QA8FW,CAAA;;UA3F5B;;0CAEyB;;8BAEZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAoFjB;;;GAGV,8BAA8B,cAAY,6BAA6B"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { useCallback } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/hooks/useInputValueTransform/useInputValueTransform.ts
|
|
4
|
+
/**
|
|
5
|
+
* Custom hook providing utility functions for value transformations between display and form values.
|
|
6
|
+
*
|
|
7
|
+
* This hook provides pure conversion functions without any state management. It's useful for:
|
|
8
|
+
* - Currency formatting ($1,000 display vs 1000 stored)
|
|
9
|
+
* - Number inputs with special handling
|
|
10
|
+
* - Date formatting (MM/DD/YYYY display vs ISO date stored)
|
|
11
|
+
* - Phone number formatting ((555) 123-4567 display vs 5551234567 stored)
|
|
12
|
+
* - Array/Object transformations (single value ↔ array, nested structures)
|
|
13
|
+
*
|
|
14
|
+
* **Key Features:**
|
|
15
|
+
* - Pure conversion functions (no state)
|
|
16
|
+
* - Generic support for any data type (strings, numbers, arrays, objects)
|
|
17
|
+
* - Special number input handling (empty string preservation)
|
|
18
|
+
* - Bidirectional value transformations
|
|
19
|
+
* - Memoized functions for performance
|
|
20
|
+
*
|
|
21
|
+
* @param options Configuration for value transformation
|
|
22
|
+
* @returns Pure conversion utility functions
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* // Currency formatting
|
|
27
|
+
* const currencyTransform = {
|
|
28
|
+
* toDisplayValue: (val) => val ? `$${Number(val).toLocaleString()}` : '',
|
|
29
|
+
* toFormValue: (val) => parseFloat(val.replace(/[$,]/g, '')) || 0
|
|
30
|
+
* };
|
|
31
|
+
*
|
|
32
|
+
* const { toDisplayValue, toFormValue } = useInputValueTransform({
|
|
33
|
+
* transform: currencyTransform
|
|
34
|
+
* });
|
|
35
|
+
*
|
|
36
|
+
* const displayVal = toDisplayValue(1000); // "$1,000"
|
|
37
|
+
* const formVal = toFormValue("$1,500"); // 1500
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* // Number input (no transforms needed)
|
|
43
|
+
* const { toDisplayValue, toFormValue } = useInputValueTransform({
|
|
44
|
+
* type: 'number'
|
|
45
|
+
* });
|
|
46
|
+
*
|
|
47
|
+
* // Handles empty string → empty string (not NaN)
|
|
48
|
+
* // Handles "123" → 123 (string to number conversion)
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```tsx
|
|
53
|
+
* // Array to single value (for single checkbox)
|
|
54
|
+
* const singleValueTransform = {
|
|
55
|
+
* toDisplayValue: (val: string[]) => val?.[0] || '',
|
|
56
|
+
* toFormValue: (val: string) => val ? [val] : []
|
|
57
|
+
* };
|
|
58
|
+
*
|
|
59
|
+
* const { toDisplayValue, toFormValue } = useInputValueTransform({
|
|
60
|
+
* transform: singleValueTransform
|
|
61
|
+
* });
|
|
62
|
+
*
|
|
63
|
+
* const displayVal = toDisplayValue(['option1']); // "option1"
|
|
64
|
+
* const formVal = toFormValue("option2"); // ["option2"]
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```tsx
|
|
69
|
+
* // Integration with debouncing
|
|
70
|
+
* const MyInput = ({ field, transform }) => {
|
|
71
|
+
* const transform = useInputValueTransform({ transform });
|
|
72
|
+
*
|
|
73
|
+
* const { onChange, onBlur, value } = useInputValueDebounce({
|
|
74
|
+
* ...transform,
|
|
75
|
+
* initialValue: field.value,
|
|
76
|
+
* debounceDelay: 300,
|
|
77
|
+
* onBlur: field.onBlur,
|
|
78
|
+
* onChange: field.onChange,
|
|
79
|
+
* });
|
|
80
|
+
*
|
|
81
|
+
* return <input value={value} onChange={onChange} onBlur={onBlur} />;
|
|
82
|
+
* };
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
const useInputValueTransform = ({ type, transform }) => {
|
|
86
|
+
return {
|
|
87
|
+
toDisplayValue: 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: 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
|
+
|
|
108
|
+
//#endregion
|
|
109
|
+
export { useInputValueTransform as t };
|
|
110
|
+
//# sourceMappingURL=useInputValueTransform-aiIf8lq5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInputValueTransform-aiIf8lq5.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 * initialValue: field.value,\n * debounceDelay: 300,\n * onBlur: field.onBlur,\n * onChange: field.onChange,\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwGA,MAAa,0BAA8C,EACzD,MACA,gBACqF;AAiDrF,QAAO;EACL,gBA9CqB,aACpB,cAAiC;AAChC,OAAI,WAAW,eACb,QAAO,UAAU,eAAe,UAAU;AAI5C,OAAI,SAAS,UAAU;AACrB,QAAI,cAAc,GAChB,QAAO;IAET,MAAM,WAAW,OAAO,UAAU;AAClC,WAAQ,OAAO,MAAM,SAAS,GAAG,YAAY;;AAI/C,UAAQ,aAAa;KAEvB,CAAC,MAAM,UAAU,CAClB;EA4BC,aAvBkB,aACjB,iBAAoC;AACnC,OAAI,WAAW,YACb,QAAO,UAAU,YAAY,aAAa;AAI5C,OAAI,SAAS,UAAU;AACrB,QAAI,iBAAiB,GACnB,QAAO;IAET,MAAM,WAAW,OAAO,aAAa;AACrC,WAAO,OAAO,MAAM,SAAS,GAAG,eAAe;;AAIjD,UAAO;KAET,CAAC,MAAM,UAAU,CAClB;EAKA"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
const require_FormContext = require('./FormContext-C3GymQOA.cjs');
|
|
2
|
+
const require_FieldCopyTestIdButton = require('./FieldCopyTestIdButton-AaLwu_8y.cjs');
|
|
3
|
+
const require_FieldValidationError = require('./FieldValidationError-Cq6aI0tE.cjs');
|
|
4
|
+
const require_useController = require('./useController-BzkCcbSo.cjs');
|
|
5
|
+
const require_useFormContext = require('./useFormContext-CWuN-_7P.cjs');
|
|
6
|
+
const require_useInputValueTransform = require('./useInputValueTransform-C-uSW8Y3.cjs');
|
|
7
|
+
let __fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
|
|
8
|
+
let react = require("react");
|
|
9
|
+
react = require_FormContext.__toESM(react);
|
|
10
|
+
let __fuf_stack_pixels = require("@fuf-stack/pixels");
|
|
11
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
12
|
+
let __heroui_input = require("@heroui/input");
|
|
13
|
+
|
|
14
|
+
//#region src/hooks/useUniformField/useUniformField.tsx
|
|
15
|
+
/**
|
|
16
|
+
* Debounce invalid state changes to prevent UI flicker on rapid changes.
|
|
17
|
+
*
|
|
18
|
+
* Primary purpose: Reduce UI flicker when validation state changes rapidly
|
|
19
|
+
* (e.g., during fast typing). Without debouncing, error messages would flash
|
|
20
|
+
* in/out rapidly, creating a poor UX.
|
|
21
|
+
*
|
|
22
|
+
* Secondary benefit: When animations are enabled (default), gives time for
|
|
23
|
+
* enter/exit animations to complete smoothly.
|
|
24
|
+
*
|
|
25
|
+
* Behavior:
|
|
26
|
+
* - Debounces both true → false and false → true transitions by `delayMs`
|
|
27
|
+
* - Disabled in test environments for immediate snapshots
|
|
28
|
+
*/
|
|
29
|
+
const useDebouncedInvalid = (invalid, delayMs) => {
|
|
30
|
+
const debouncedInvalid = (0, __fuf_stack_pixels.useDebounce)(invalid, delayMs);
|
|
31
|
+
if ((0, __fuf_stack_pixel_utils.isTestEnvironment)()) return invalid;
|
|
32
|
+
return debouncedInvalid;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Combines frequently used form field logic into a single hook.
|
|
36
|
+
*
|
|
37
|
+
* Provides:
|
|
38
|
+
* - Enhanced form context (validation-aware state, `testId`, value transforms)
|
|
39
|
+
* - Controller field with nullish conversion handling
|
|
40
|
+
* - Value transformation via `transform` prop:
|
|
41
|
+
* • Allows disentangled display and form values (e.g., string ↔ object, boolean ↔ array)
|
|
42
|
+
* • Automatically applies `toDisplayValue` to field value for components
|
|
43
|
+
* • Automatically applies `toFormValue` to display value when onChange is called
|
|
44
|
+
* • Works with `type` prop for automatic number/string conversion
|
|
45
|
+
* • Examples: storing objects while displaying strings, storing booleans as arrays, enriching values with metadata
|
|
46
|
+
* - Debounced `invalid` state with smart timing:
|
|
47
|
+
* • `true` (field becomes invalid): applies immediately so errors show right away
|
|
48
|
+
* • `false` (field becomes valid): delayed 200ms to allow smooth exit animations
|
|
49
|
+
* • Respects `prefers-reduced-motion` by skipping delays when user prefers reduced motion
|
|
50
|
+
* - Smart `invalid` visibility (via `showInvalid`):
|
|
51
|
+
* • Shows errors when field is dirty OR touched OR form has been submitted
|
|
52
|
+
* • Prevents showing errors on pristine/untouched fields for better UX
|
|
53
|
+
* • Works well for all field types (text inputs, checkboxes, radios, arrays)
|
|
54
|
+
* - Prebuilt `errorMessage` React node using `FieldValidationError`
|
|
55
|
+
* - Computed `label` node which appends a `FieldCopyTestIdButton` in
|
|
56
|
+
* `debug-testids` mode
|
|
57
|
+
* - `defaultValue` for uncontrolled defaults and all usual field handlers
|
|
58
|
+
* - Access to form utilities: `control`, `getValues`, `resetField`
|
|
59
|
+
* - Presentation helpers: `getLabelProps`, `getErrorMessageProps`,
|
|
60
|
+
* `getHelperWrapperProps` for consistent wiring to underlying UI components
|
|
61
|
+
*/
|
|
62
|
+
const useUniformField = (params) => {
|
|
63
|
+
const { name, ariaLabel: customAriaLabel, disabled = false, testId: explicitTestId, label, type, transform } = params;
|
|
64
|
+
const { control, debugMode, formState: { submitCount }, getFieldState, getValues, resetField } = require_useFormContext.useFormContext();
|
|
65
|
+
const { error, invalid: rawInvalid, isDirty, isTouched, required, testId } = getFieldState(name, explicitTestId);
|
|
66
|
+
const { field } = require_useController.useController({
|
|
67
|
+
control,
|
|
68
|
+
disabled,
|
|
69
|
+
name
|
|
70
|
+
});
|
|
71
|
+
const { onChange: fieldOnChange, value: fieldValue, disabled: isDisabled, onBlur, ref } = field;
|
|
72
|
+
const { toDisplayValue, toFormValue } = require_useInputValueTransform.useInputValueTransform({
|
|
73
|
+
type,
|
|
74
|
+
transform
|
|
75
|
+
});
|
|
76
|
+
const transformedValue = toDisplayValue(fieldValue);
|
|
77
|
+
const transformedOnChange = (eventOrValue) => {
|
|
78
|
+
fieldOnChange(toFormValue(eventOrValue?.target?.value ?? eventOrValue));
|
|
79
|
+
};
|
|
80
|
+
const defaultValue = getValues()?.[name];
|
|
81
|
+
const invalid = useDebouncedInvalid(rawInvalid && (isDirty || isTouched || submitCount > 0), 200);
|
|
82
|
+
const showTestIdCopyButton = debugMode === "debug-testids";
|
|
83
|
+
const labelNode = !!label || showTestIdCopyButton ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [label !== false ? label : null, showTestIdCopyButton ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FieldCopyTestIdButton.FieldCopyTestIdButton_default$1, { testId }) : null] }) : null;
|
|
84
|
+
const errorMessage = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FieldValidationError.FieldValidationError_default$1, {
|
|
85
|
+
error,
|
|
86
|
+
testId
|
|
87
|
+
});
|
|
88
|
+
const { getErrorMessageProps, getLabelProps, getHelperWrapperProps } = (0, __heroui_input.useInput)({
|
|
89
|
+
ref,
|
|
90
|
+
classNames: { helperWrapper: "p-0" },
|
|
91
|
+
errorMessage: JSON.stringify(error),
|
|
92
|
+
isInvalid: invalid,
|
|
93
|
+
isRequired: required,
|
|
94
|
+
label,
|
|
95
|
+
labelPlacement: "outside"
|
|
96
|
+
});
|
|
97
|
+
return {
|
|
98
|
+
ariaLabel: customAriaLabel ?? (typeof label === "string" ? label : name),
|
|
99
|
+
control,
|
|
100
|
+
debugMode,
|
|
101
|
+
defaultValue,
|
|
102
|
+
disabled: isDisabled,
|
|
103
|
+
error,
|
|
104
|
+
errorMessage,
|
|
105
|
+
field: {
|
|
106
|
+
...field,
|
|
107
|
+
value: transformedValue,
|
|
108
|
+
onChange: transformedOnChange
|
|
109
|
+
},
|
|
110
|
+
getErrorMessageProps,
|
|
111
|
+
getHelperWrapperProps,
|
|
112
|
+
getLabelProps,
|
|
113
|
+
getValues,
|
|
114
|
+
invalid,
|
|
115
|
+
label: labelNode,
|
|
116
|
+
onBlur,
|
|
117
|
+
onChange: transformedOnChange,
|
|
118
|
+
ref,
|
|
119
|
+
required,
|
|
120
|
+
resetField,
|
|
121
|
+
testId
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
//#endregion
|
|
126
|
+
//#region src/hooks/useUniformField/index.ts
|
|
127
|
+
/* v8 ignore stop */
|
|
128
|
+
|
|
129
|
+
//#endregion
|
|
130
|
+
Object.defineProperty(exports, 'useUniformField', {
|
|
131
|
+
enumerable: true,
|
|
132
|
+
get: function () {
|
|
133
|
+
return useUniformField;
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
//# sourceMappingURL=useUniformField-BMvnRC_r.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUniformField-BMvnRC_r.cjs","names":["useFormContext","useController","useInputValueTransform","labelNode: ReactNode | null","FieldCopyTestIdButton","FieldValidationError"],"sources":["../src/hooks/useUniformField/useUniformField.tsx","../src/hooks/useUniformField/index.ts"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { FieldError, FieldValues, Path } from 'react-hook-form';\nimport type { InputValueTransform } from '../useInputValueTransform/useInputValueTransform';\n\nimport React from 'react';\n\nimport { isTestEnvironment } from '@fuf-stack/pixel-utils';\nimport { useDebounce } from '@fuf-stack/pixels';\n\nimport { FieldCopyTestIdButton } from '../../partials/FieldCopyTestIdButton';\nimport { FieldValidationError } from '../../partials/FieldValidationError';\nimport { useController } from '../useController/useController';\nimport { useFormContext } from '../useFormContext/useFormContext';\nimport { useInput } from '../useInput/useInput';\nimport { useInputValueTransform } from '../useInputValueTransform/useInputValueTransform';\n\n/**\n * Debounce invalid state changes to prevent UI flicker on rapid changes.\n *\n * Primary purpose: Reduce UI flicker when validation state changes rapidly\n * (e.g., during fast typing). Without debouncing, error messages would flash\n * in/out rapidly, creating a poor UX.\n *\n * Secondary benefit: When animations are enabled (default), gives time for\n * enter/exit animations to complete smoothly.\n *\n * Behavior:\n * - Debounces both true → false and false → true transitions by `delayMs`\n * - Disabled in test environments for immediate snapshots\n */\nconst useDebouncedInvalid = (invalid: boolean, delayMs: number) => {\n const debouncedInvalid = useDebounce(invalid, delayMs);\n\n // Disable debouncing in test environments for immediate snapshots\n if (isTestEnvironment()) {\n return invalid;\n }\n\n return debouncedInvalid;\n};\n\nexport interface UseUniformFieldParams<\n TFieldValues extends FieldValues = FieldValues,\n TDisplay = unknown,\n> {\n /** Form field name */\n name: Path<TFieldValues> & string;\n /** Custom aria-label for accessibility. If not provided, falls back to field name when no visible label exists */\n ariaLabel?: string;\n /** Disable the field */\n disabled?: boolean;\n /** Optional label content */\n label?: ReactNode;\n /** Optional explicit test id used to build stable test ids */\n testId?: string;\n /** Optional value transformation between form and display values */\n transform?: InputValueTransform<TDisplay>;\n /** Input type for special number handling */\n type?: 'text' | 'number' | 'password';\n}\n\nexport interface UseUniformFieldReturn<\n TFieldValues extends FieldValues = FieldValues,\n> {\n /** Computed aria-label fallback (field name) when no visible label exists. Components can override based on their accessibility needs (e.g., if placeholder provides sufficient context) */\n ariaLabel: string | undefined;\n /** react-hook-form control instance for advanced integrations */\n control: ReturnType<typeof useFormContext<TFieldValues>>['control'];\n /** Debug mode from Uniform provider */\n debugMode: ReturnType<typeof useFormContext<TFieldValues>>['debugMode'];\n /** Current value used to initialize uncontrolled components */\n defaultValue: unknown;\n /** Whether the field is currently disabled (from RHF) */\n disabled: boolean | undefined;\n /** Validation error(s) for the field */\n error: FieldError[] | undefined;\n /** Pre-built errorMessage node to plug into components */\n errorMessage: ReactNode | null;\n /** RHF controller field with transformed value/onChange (use this for simple components) */\n field: ReturnType<typeof useController<TFieldValues>>['field'];\n /** Helper to spread standardized error message props to underlying components */\n getErrorMessageProps: ReturnType<typeof useInput>['getErrorMessageProps'];\n /** Helper to spread standardized helper wrapper props (for spacing/animation) */\n getHelperWrapperProps: ReturnType<typeof useInput>['getHelperWrapperProps'];\n /** Helper to spread standardized label props to underlying components */\n getLabelProps: ReturnType<typeof useInput>['getLabelProps'];\n /** Access current form values (converted to validation-friendly format) */\n getValues: ReturnType<typeof useFormContext<TFieldValues>>['getValues'];\n /** Whether the field should show invalid state (debounced for smooth animations). True when field is invalid AND (dirty OR touched OR submitted) */\n invalid: boolean;\n /** Computed label node including optional test id copy button */\n label: ReactNode | null;\n /** onBlur handler from controller */\n onBlur: ReturnType<typeof useController<TFieldValues>>['field']['onBlur'];\n /** onChange handler from controller (with transform applied) */\n onChange: ReturnType<typeof useController<TFieldValues>>['field']['onChange'];\n /** Ref to forward to underlying control */\n ref: ReturnType<typeof useController<TFieldValues>>['field']['ref'];\n /** Whether the field is required according to validation schema */\n required: boolean;\n /** Reset a specific field in the form */\n resetField: ReturnType<typeof useFormContext<TFieldValues>>['resetField'];\n /** Generated HTML data-testid for the field */\n testId: string;\n}\n\n/**\n * Combines frequently used form field logic into a single hook.\n *\n * Provides:\n * - Enhanced form context (validation-aware state, `testId`, value transforms)\n * - Controller field with nullish conversion handling\n * - Value transformation via `transform` prop:\n * • Allows disentangled display and form values (e.g., string ↔ object, boolean ↔ array)\n * • Automatically applies `toDisplayValue` to field value for components\n * • Automatically applies `toFormValue` to display value when onChange is called\n * • Works with `type` prop for automatic number/string conversion\n * • Examples: storing objects while displaying strings, storing booleans as arrays, enriching values with metadata\n * - Debounced `invalid` state with smart timing:\n * • `true` (field becomes invalid): applies immediately so errors show right away\n * • `false` (field becomes valid): delayed 200ms to allow smooth exit animations\n * • Respects `prefers-reduced-motion` by skipping delays when user prefers reduced motion\n * - Smart `invalid` visibility (via `showInvalid`):\n * • Shows errors when field is dirty OR touched OR form has been submitted\n * • Prevents showing errors on pristine/untouched fields for better UX\n * • Works well for all field types (text inputs, checkboxes, radios, arrays)\n * - Prebuilt `errorMessage` React node using `FieldValidationError`\n * - Computed `label` node which appends a `FieldCopyTestIdButton` in\n * `debug-testids` mode\n * - `defaultValue` for uncontrolled defaults and all usual field handlers\n * - Access to form utilities: `control`, `getValues`, `resetField`\n * - Presentation helpers: `getLabelProps`, `getErrorMessageProps`,\n * `getHelperWrapperProps` for consistent wiring to underlying UI components\n */\nexport const useUniformField = <\n TFieldValues extends FieldValues = FieldValues,\n TDisplay = unknown,\n>(\n params: UseUniformFieldParams<TFieldValues, TDisplay>,\n): UseUniformFieldReturn<TFieldValues> => {\n const {\n name,\n ariaLabel: customAriaLabel,\n disabled = false,\n testId: explicitTestId,\n label,\n type,\n transform,\n } = params;\n\n const {\n control,\n debugMode,\n formState: { submitCount },\n getFieldState,\n getValues,\n resetField,\n } = useFormContext<TFieldValues>();\n\n const {\n error,\n invalid: rawInvalid,\n isDirty,\n isTouched,\n required,\n testId,\n } = getFieldState(name, explicitTestId);\n\n const { field } = useController<TFieldValues>({\n control,\n disabled,\n name,\n });\n const {\n onChange: fieldOnChange,\n value: fieldValue,\n disabled: isDisabled,\n onBlur,\n ref,\n } = field;\n\n // Get transform utilities (but don't apply them automatically)\n // Components can choose how to use them (directly or via useInputValueDebounce)\n const { toDisplayValue, toFormValue } = useInputValueTransform<TDisplay>({\n type,\n transform,\n });\n\n // For components without special needs: apply transform to value and onChange\n const transformedValue = toDisplayValue(fieldValue);\n const transformedOnChange = (eventOrValue: TDisplay | React.ChangeEvent) => {\n // Extract value from event or use value directly\n const displayValue =\n (eventOrValue as React.ChangeEvent<HTMLInputElement>)?.target?.value ??\n eventOrValue;\n const formValue = toFormValue(displayValue as TDisplay);\n fieldOnChange(formValue as typeof fieldValue);\n };\n\n const defaultValue = (getValues() as Record<string, unknown>)?.[\n name as string\n ];\n\n /**\n * Determine when to show the invalid state to the user.\n *\n * Show errors when the field is invalid AND any of these conditions are met:\n * - Field is dirty (value changed from initial) - good for checkboxes/radios/arrays\n * - Field is touched (focused and blurred) - good for text inputs\n * - Form has been submitted - shows all errors after submit attempt\n *\n * This prevents showing errors on pristine/untouched fields for better UX.\n * Examples:\n * - Text input: User loads form with empty required field → no error shown yet\n * - Text input: User focuses and blurs → error shows (via isTouched)\n * - Checkbox group: User clicks first checkbox → error shows immediately (via isDirty)\n * - Any field: User submits form → all errors show (via submitCount)\n *\n * The entire condition is debounced to prevent flickering and allow smooth animations\n * when any of the states (invalid, isDirty, isTouched, submitCount) change.\n */\n const showInvalid = rawInvalid && (isDirty || isTouched || submitCount > 0);\n const invalid = useDebouncedInvalid(showInvalid, 200);\n\n // Build a label node that:\n // - shows the provided label (unless explicitly set to false)\n // - appends a copy-to-clipboard button for the test id in `debug-testids` mode\n // Consumers can pass this directly to component `label` props\n const showTestIdCopyButton = debugMode === 'debug-testids';\n const labelNode: ReactNode | null =\n !!label || showTestIdCopyButton ? (\n <>\n {label !== false ? label : null}\n {showTestIdCopyButton ? (\n <FieldCopyTestIdButton testId={testId} />\n ) : null}\n </>\n ) : null;\n\n // Ready-to-render error message; consumers can drop this into their\n // component `errorMessage` prop without repeating mapping/markup\n const errorMessage = <FieldValidationError error={error} testId={testId} />;\n\n // Generate standardized props for label, helper wrapper and error message\n // so consumers can spread them directly into UI components (e.g. HeroUI),\n // keeping animations/spacing consistent across fields\n const { getErrorMessageProps, getLabelProps, getHelperWrapperProps } =\n useInput({\n ref,\n classNames: {\n // set padding to 0 for error message exit animation\n helperWrapper: 'p-0',\n },\n errorMessage: JSON.stringify(error),\n isInvalid: invalid,\n isRequired: required,\n label,\n labelPlacement: 'outside',\n });\n\n // Compute aria-label: prefer custom prop, then use string label if available, otherwise field name\n // Components can further override this based on their specific accessibility needs\n // (e.g., Input/TextArea may skip this if they have a meaningful placeholder)\n const ariaLabel =\n customAriaLabel ?? (typeof label === 'string' ? label : name);\n\n return {\n ariaLabel,\n control,\n debugMode,\n defaultValue,\n disabled: isDisabled,\n error,\n errorMessage,\n field: {\n ...field,\n value: transformedValue as typeof field.value,\n onChange: transformedOnChange as typeof field.onChange,\n },\n getErrorMessageProps,\n getHelperWrapperProps,\n getLabelProps,\n getValues,\n invalid,\n label: labelNode,\n onBlur,\n onChange: transformedOnChange as typeof field.onChange,\n ref,\n required,\n resetField,\n testId,\n };\n};\n","/* v8 ignore start */\n\nexport * from './useUniformField';\n\n/* v8 ignore stop */\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAM,uBAAuB,SAAkB,YAAoB;CACjE,MAAM,uDAA+B,SAAS,QAAQ;AAGtD,qDAAuB,CACrB,QAAO;AAGT,QAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgGT,MAAa,mBAIX,WACwC;CACxC,MAAM,EACJ,MACA,WAAW,iBACX,WAAW,OACX,QAAQ,gBACR,OACA,MACA,cACE;CAEJ,MAAM,EACJ,SACA,WACA,WAAW,EAAE,eACb,eACA,WACA,eACEA,uCAA8B;CAElC,MAAM,EACJ,OACA,SAAS,YACT,SACA,WACA,UACA,WACE,cAAc,MAAM,eAAe;CAEvC,MAAM,EAAE,UAAUC,oCAA4B;EAC5C;EACA;EACA;EACD,CAAC;CACF,MAAM,EACJ,UAAU,eACV,OAAO,YACP,UAAU,YACV,QACA,QACE;CAIJ,MAAM,EAAE,gBAAgB,gBAAgBC,sDAAiC;EACvE;EACA;EACD,CAAC;CAGF,MAAM,mBAAmB,eAAe,WAAW;CACnD,MAAM,uBAAuB,iBAA+C;AAM1E,gBADkB,YAFf,cAAsD,QAAQ,SAC/D,aACqD,CACV;;CAG/C,MAAM,eAAgB,WAAW,GAC/B;CAsBF,MAAM,UAAU,oBADI,eAAe,WAAW,aAAa,cAAc,IACxB,IAAI;CAMrD,MAAM,uBAAuB,cAAc;CAC3C,MAAMC,YACJ,CAAC,CAAC,SAAS,uBACT,qFACG,UAAU,QAAQ,QAAQ,MAC1B,uBACC,2CAACC,iEAA8B,SAAU,GACvC,QACH,GACD;CAIN,MAAM,eAAe,2CAACC;EAA4B;EAAe;GAAU;CAK3E,MAAM,EAAE,sBAAsB,eAAe,uDAClC;EACP;EACA,YAAY,EAEV,eAAe,OAChB;EACD,cAAc,KAAK,UAAU,MAAM;EACnC,WAAW;EACX,YAAY;EACZ;EACA,gBAAgB;EACjB,CAAC;AAQJ,QAAO;EACL,WAHA,oBAAoB,OAAO,UAAU,WAAW,QAAQ;EAIxD;EACA;EACA;EACA,UAAU;EACV;EACA;EACA,OAAO;GACL,GAAG;GACH,OAAO;GACP,UAAU;GACX;EACD;EACA;EACA;EACA;EACA;EACA,OAAO;EACP;EACA,UAAU;EACV;EACA;EACA;EACA;EACD"}
|