@fuf-stack/uniform 1.11.2 → 1.11.3
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 +1 -1
- package/dist/Checkboxes/index.d.cts +1 -1
- package/dist/Checkboxes/index.d.ts +1 -1
- package/dist/Checkboxes/index.js +1 -1
- package/dist/{Checkboxes-BY4UK0Xf.js → Checkboxes-BvW4D5Nm.js} +3 -3
- package/dist/{Checkboxes-BY4UK0Xf.js.map → Checkboxes-BvW4D5Nm.js.map} +1 -1
- package/dist/{Checkboxes-DgCK-Wq-.cjs → Checkboxes-Cvdazf25.cjs} +4 -4
- package/dist/{Checkboxes-DgCK-Wq-.cjs.map → Checkboxes-Cvdazf25.cjs.map} +1 -1
- package/dist/FieldArray/index.cjs +1 -1
- package/dist/FieldArray/index.d.cts +1 -1
- package/dist/FieldArray/index.d.ts +1 -1
- package/dist/FieldArray/index.js +1 -1
- package/dist/{FieldArray-DBsyUQkU.cjs → FieldArray-CJpDgK_t.cjs} +7 -7
- package/dist/{FieldArray-DBsyUQkU.cjs.map → FieldArray-CJpDgK_t.cjs.map} +1 -1
- package/dist/{FieldArray-CDLaGvNj.js → FieldArray-omRNwxgy.js} +5 -5
- package/dist/{FieldArray-CDLaGvNj.js.map → FieldArray-omRNwxgy.js.map} +1 -1
- package/dist/FieldCard/index.cjs +1 -1
- package/dist/FieldCard/index.d.cts +1 -1
- package/dist/FieldCard/index.d.ts +1 -1
- package/dist/FieldCard/index.js +1 -1
- package/dist/{FieldCard-NKF358fO.cjs → FieldCard-Dt6QU7o7.cjs} +4 -4
- package/dist/{FieldCard-NKF358fO.cjs.map → FieldCard-Dt6QU7o7.cjs.map} +1 -1
- package/dist/{FieldCard-C1MCSbPW.js → FieldCard-Dyi-2qr6.js} +3 -3
- package/dist/{FieldCard-C1MCSbPW.js.map → FieldCard-Dyi-2qr6.js.map} +1 -1
- package/dist/{FieldCopyTestIdButton-BSYcSo2o.cjs → FieldCopyTestIdButton-By-hEZgA.cjs} +2 -2
- package/dist/{FieldCopyTestIdButton-BSYcSo2o.cjs.map → FieldCopyTestIdButton-By-hEZgA.cjs.map} +1 -1
- package/dist/{FieldCopyTestIdButton-DWPCDJ-s.js → FieldCopyTestIdButton-D9f1B-VS.js} +1 -1
- package/dist/{FieldCopyTestIdButton-DWPCDJ-s.js.map → FieldCopyTestIdButton-D9f1B-VS.js.map} +1 -1
- package/dist/{FieldValidationError-1hiDEFew.js → FieldValidationError-BYwitb_B.js} +1 -1
- package/dist/{FieldValidationError-1hiDEFew.js.map → FieldValidationError-BYwitb_B.js.map} +1 -1
- package/dist/{FieldValidationError-CE8R8qry.cjs → FieldValidationError-D64j5gnH.cjs} +2 -2
- package/dist/{FieldValidationError-CE8R8qry.cjs.map → FieldValidationError-D64j5gnH.cjs.map} +1 -1
- package/dist/Form/index.cjs +1 -1
- package/dist/Form/index.d.cts +1 -1
- package/dist/Form/index.d.ts +1 -1
- package/dist/Form/index.js +1 -1
- package/dist/{Form-DRNEwHsi.js → Form-B1fvbnxi.js} +3 -3
- package/dist/{Form-DRNEwHsi.js.map → Form-B1fvbnxi.js.map} +1 -1
- package/dist/{Form-BsD69fql.cjs → Form-CvnnGF45.cjs} +3 -3
- package/dist/{Form-BsD69fql.cjs.map → Form-CvnnGF45.cjs.map} +1 -1
- package/dist/{FormContext-CN9n_KdE.js → FormContext-Dl3k1r_k.js} +2 -2
- package/dist/{FormContext-CN9n_KdE.js.map → FormContext-Dl3k1r_k.js.map} +1 -1
- package/dist/{FormContext-Bb6d8hdG.cjs → FormContext-Lw4YL4-B.cjs} +2 -2
- package/dist/{FormContext-Bb6d8hdG.cjs.map → FormContext-Lw4YL4-B.cjs.map} +1 -1
- package/dist/Grid/index.cjs +1 -1
- package/dist/Grid/index.d.cts +1 -1
- package/dist/Grid/index.d.ts +1 -1
- package/dist/{Grid-D84e76CE.cjs → Grid-DezBAZbx.cjs} +2 -2
- package/dist/{Grid-D84e76CE.cjs.map → Grid-DezBAZbx.cjs.map} +1 -1
- package/dist/Input/index.cjs +1 -1
- package/dist/Input/index.d.cts +1 -1
- package/dist/Input/index.d.ts +1 -1
- package/dist/Input/index.js +1 -1
- package/dist/{Input-DeTpxiK_.cjs → Input-DR0gCf9q.cjs} +5 -4
- package/dist/Input-DR0gCf9q.cjs.map +1 -0
- package/dist/{Input-DXMWGTBh.js → Input-DksaHK1Y.js} +4 -3
- package/dist/Input-DksaHK1Y.js.map +1 -0
- package/dist/RadioBoxes/index.cjs +1 -1
- package/dist/RadioBoxes/index.d.cts +1 -1
- package/dist/RadioBoxes/index.d.ts +1 -1
- package/dist/RadioBoxes/index.js +1 -1
- package/dist/{RadioBoxes-BEln4a-B.js → RadioBoxes-DdIHH6B5.js} +2 -2
- package/dist/{RadioBoxes-BEln4a-B.js.map → RadioBoxes-DdIHH6B5.js.map} +1 -1
- package/dist/{RadioBoxes-gsQGqQCd.cjs → RadioBoxes-h-VLhJ9d.cjs} +3 -3
- package/dist/{RadioBoxes-gsQGqQCd.cjs.map → RadioBoxes-h-VLhJ9d.cjs.map} +1 -1
- package/dist/RadioTabs/index.cjs +1 -1
- package/dist/RadioTabs/index.d.cts +1 -1
- package/dist/RadioTabs/index.d.ts +1 -1
- package/dist/RadioTabs/index.js +1 -1
- package/dist/{RadioTabs-BYpP0tKA.cjs → RadioTabs-D6yF9jE3.cjs} +3 -3
- package/dist/{RadioTabs-BYpP0tKA.cjs.map → RadioTabs-D6yF9jE3.cjs.map} +1 -1
- package/dist/{RadioTabs-DLr9QiXI.js → RadioTabs-dLdlF91p.js} +2 -2
- package/dist/{RadioTabs-DLr9QiXI.js.map → RadioTabs-dLdlF91p.js.map} +1 -1
- package/dist/Radios/index.cjs +1 -1
- package/dist/Radios/index.d.cts +1 -1
- package/dist/Radios/index.d.ts +1 -1
- package/dist/Radios/index.js +1 -1
- package/dist/{Radios-BCOfnTke.cjs → Radios-D8alyG2f.cjs} +3 -3
- package/dist/{Radios-BCOfnTke.cjs.map → Radios-D8alyG2f.cjs.map} +1 -1
- package/dist/{Radios-DCXI2kMf.js → Radios-DiZ0Dfmp.js} +2 -2
- package/dist/{Radios-DCXI2kMf.js.map → Radios-DiZ0Dfmp.js.map} +1 -1
- package/dist/Select/index.cjs +1 -1
- package/dist/Select/index.d.cts +1 -1
- package/dist/Select/index.d.ts +1 -1
- package/dist/Select/index.js +1 -1
- package/dist/{Select-CyfEmWiD.js → Select-C9otN8uu.js} +3 -3
- package/dist/{Select-CyfEmWiD.js.map → Select-C9otN8uu.js.map} +1 -1
- package/dist/{Select-KnPGOO27.cjs → Select-DQVskslz.cjs} +4 -4
- package/dist/{Select-KnPGOO27.cjs.map → Select-DQVskslz.cjs.map} +1 -1
- package/dist/Slider/index.cjs +1 -1
- package/dist/Slider/index.d.cts +1 -1
- package/dist/Slider/index.d.ts +1 -1
- package/dist/Slider/index.js +1 -1
- package/dist/{Slider-C7xxYPgR.cjs → Slider-DwfyCQDM.cjs} +3 -3
- package/dist/{Slider-C7xxYPgR.cjs.map → Slider-DwfyCQDM.cjs.map} +1 -1
- package/dist/{Slider-Dlhb-9hC.js → Slider-meuLEC2k.js} +2 -2
- package/dist/{Slider-Dlhb-9hC.js.map → Slider-meuLEC2k.js.map} +1 -1
- package/dist/SubmitButton/index.cjs +1 -1
- package/dist/SubmitButton/index.d.cts +1 -1
- package/dist/SubmitButton/index.d.ts +1 -1
- package/dist/SubmitButton/index.js +1 -1
- package/dist/{SubmitButton-CUBItcBn.cjs → SubmitButton-B0kvUqkd.cjs} +3 -3
- package/dist/{SubmitButton-CUBItcBn.cjs.map → SubmitButton-B0kvUqkd.cjs.map} +1 -1
- package/dist/{SubmitButton-C5f6j0N4.js → SubmitButton-BHP9J9ml.js} +2 -2
- package/dist/{SubmitButton-C5f6j0N4.js.map → SubmitButton-BHP9J9ml.js.map} +1 -1
- package/dist/Switch/index.cjs +1 -1
- package/dist/Switch/index.d.cts +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/Switch/index.js +1 -1
- package/dist/{Switch--m02Xcq8.js → Switch-DkciIYnD.js} +2 -2
- package/dist/{Switch--m02Xcq8.js.map → Switch-DkciIYnD.js.map} +1 -1
- package/dist/{Switch-6LyeZHJh.cjs → Switch-Ds0gDzjR.cjs} +3 -3
- package/dist/{Switch-6LyeZHJh.cjs.map → Switch-Ds0gDzjR.cjs.map} +1 -1
- package/dist/SwitchBox/index.cjs +1 -1
- package/dist/SwitchBox/index.d.cts +1 -1
- package/dist/SwitchBox/index.d.ts +1 -1
- package/dist/SwitchBox/index.js +1 -1
- package/dist/{SwitchBox-D0-e-pbM.js → SwitchBox-B6Z4rtWt.js} +2 -2
- package/dist/{SwitchBox-D0-e-pbM.js.map → SwitchBox-B6Z4rtWt.js.map} +1 -1
- package/dist/{SwitchBox-CtGiQdys.cjs → SwitchBox-B9JqwDtN.cjs} +3 -3
- package/dist/{SwitchBox-CtGiQdys.cjs.map → SwitchBox-B9JqwDtN.cjs.map} +1 -1
- package/dist/TextArea/index.cjs +1 -1
- package/dist/TextArea/index.d.cts +1 -1
- package/dist/TextArea/index.js +1 -1
- package/dist/{TextArea-PtdSABZS.cjs → TextArea-BqQtlPSV.cjs} +5 -4
- package/dist/{TextArea-PtdSABZS.cjs.map → TextArea-BqQtlPSV.cjs.map} +1 -1
- package/dist/{TextArea-BiSnvJ69.js → TextArea-DAx49KI6.js} +4 -3
- package/dist/{TextArea-BiSnvJ69.js.map → TextArea-DAx49KI6.js.map} +1 -1
- package/dist/helpers/index.cjs +2 -1
- package/dist/helpers/index.d.cts +164 -2
- package/dist/helpers/index.d.cts.map +1 -0
- package/dist/helpers/index.d.ts +164 -2
- package/dist/helpers/index.d.ts.map +1 -0
- package/dist/helpers/index.js +2 -2
- package/dist/{helpers-B-CJOBt3.js → helpers-CCINRgQk.js} +43 -2
- package/dist/helpers-CCINRgQk.js.map +1 -0
- package/dist/{helpers-B84E9vHd.cjs → helpers-nYTmL2gX.cjs} +49 -2
- package/dist/helpers-nYTmL2gX.cjs.map +1 -0
- package/dist/hooks/useClientValidation/index.cjs +1 -1
- package/dist/hooks/useClientValidation/index.d.cts +1 -1
- package/dist/hooks/useClientValidation/index.d.ts +1 -1
- package/dist/hooks/useClientValidation/index.js +1 -1
- package/dist/hooks/useController/index.cjs +1 -1
- package/dist/hooks/useController/index.d.cts +1 -1
- package/dist/hooks/useController/index.d.ts +2 -1
- package/dist/hooks/useController/index.js +1 -1
- package/dist/hooks/useFormContext/index.cjs +1 -1
- package/dist/hooks/useFormContext/index.d.cts +1 -1
- package/dist/hooks/useFormContext/index.d.ts +1 -1
- package/dist/hooks/useFormContext/index.js +1 -1
- package/dist/hooks/useInput/index.cjs +1 -1
- package/dist/hooks/useInputValueDebounce/index.cjs +1 -1
- package/dist/hooks/useInputValueDebounce/index.d.cts +1 -1
- package/dist/hooks/useInputValueDebounce/index.d.ts +1 -1
- package/dist/hooks/useInputValueDebounce/index.js +1 -1
- package/dist/hooks/useInputValueTransform/index.cjs +1 -1
- package/dist/hooks/useInputValueTransform/index.d.cts +1 -1
- package/dist/hooks/useInputValueTransform/index.d.ts +1 -1
- package/dist/hooks/useInputValueTransform/index.js +1 -1
- package/dist/hooks/useUniformField/index.cjs +1 -1
- package/dist/hooks/useUniformField/index.d.cts +1 -1
- package/dist/hooks/useUniformField/index.d.ts +3 -3
- package/dist/hooks/useUniformField/index.js +1 -1
- package/dist/hooks/useUniformFieldArray/index.cjs +1 -1
- package/dist/hooks/useUniformFieldArray/index.d.cts +1 -1
- package/dist/hooks/useUniformFieldArray/index.d.ts +4 -24
- package/dist/hooks/useUniformFieldArray/index.js +1 -1
- package/dist/hooks/useWatchUserChange/index.cjs +1 -1
- package/dist/hooks/useWatchUserChange/index.d.cts +1 -1
- package/dist/hooks/useWatchUserChange/index.d.ts +1 -1
- package/dist/hooks/useWatchUserChange/index.js +1 -1
- package/dist/{index-C1PUx1tH.d.ts → index-0wXxS5M7.d.ts} +7 -7
- package/dist/index-0wXxS5M7.d.ts.map +1 -0
- package/dist/{index-DvB46QAb.d.ts → index-1Egh73pR.d.ts} +3 -3
- package/dist/{index-DvB46QAb.d.ts.map → index-1Egh73pR.d.ts.map} +1 -1
- package/dist/{index-DmMenZfj.d.ts → index-3v_vja2i.d.ts} +6 -6
- package/dist/{index-DmMenZfj.d.ts.map → index-3v_vja2i.d.ts.map} +1 -1
- package/dist/{index-BTTo_ufh.d.ts → index-7mx-IcDp.d.ts} +3 -3
- package/dist/{index-BTTo_ufh.d.ts.map → index-7mx-IcDp.d.ts.map} +1 -1
- package/dist/{index-WogV9uVV.d.cts → index-BDV3JVoX.d.cts} +7 -7
- package/dist/{index-WogV9uVV.d.cts.map → index-BDV3JVoX.d.cts.map} +1 -1
- package/dist/{index-DxdaxM3o.d.cts → index-BFLKkqA3.d.ts} +2 -2
- package/dist/{index-Edx7MxXu.d.ts.map → index-BFLKkqA3.d.ts.map} +1 -1
- package/dist/{index-DG9C0kHA.d.ts → index-BGXgvZKr.d.ts} +35 -35
- package/dist/{index-DG9C0kHA.d.ts.map → index-BGXgvZKr.d.ts.map} +1 -1
- package/dist/{index-CVnn6mEI.d.ts → index-BSjUaHEO.d.cts} +4 -4
- package/dist/{index-BITJ-CZL.d.cts.map → index-BSjUaHEO.d.cts.map} +1 -1
- package/dist/{index-jmQP58tO.d.cts → index-B_aIzCcx.d.cts} +3 -3
- package/dist/{index-jmQP58tO.d.cts.map → index-B_aIzCcx.d.cts.map} +1 -1
- package/dist/{index-BITJ-CZL.d.cts → index-Bcppi5O7.d.ts} +4 -4
- package/dist/{index-CVnn6mEI.d.ts.map → index-Bcppi5O7.d.ts.map} +1 -1
- package/dist/{index-Bj_lpc5r.d.cts → index-C2A_i57R.d.cts} +21 -21
- package/dist/index-C2A_i57R.d.cts.map +1 -0
- package/dist/index-CFBmva_r.d.ts +1 -0
- package/dist/{index-CSBE6Et0.d.cts → index-CHNp5R5N.d.cts} +6 -6
- package/dist/{index-CSBE6Et0.d.cts.map → index-CHNp5R5N.d.cts.map} +1 -1
- package/dist/{index-BL0DnIzh.d.ts → index-CHXv_rNR.d.ts} +3 -3
- package/dist/{index-BL0DnIzh.d.ts.map → index-CHXv_rNR.d.ts.map} +1 -1
- package/dist/{index--E2ZsMya.d.ts → index-CTp4vdDb.d.ts} +6 -6
- package/dist/{index--E2ZsMya.d.ts.map → index-CTp4vdDb.d.ts.map} +1 -1
- package/dist/{index-F11geOHD.d.ts → index-CUn9q5KD.d.ts} +6 -6
- package/dist/{index-F11geOHD.d.ts.map → index-CUn9q5KD.d.ts.map} +1 -1
- package/dist/{index-BxA_pJWn.d.cts → index-CZyNkPDq.d.ts} +22 -22
- package/dist/{index-C-2nxT8D.d.ts.map → index-CZyNkPDq.d.ts.map} +1 -1
- package/dist/{index-C-2nxT8D.d.ts → index-CeYRsehb.d.cts} +22 -22
- package/dist/index-CeYRsehb.d.cts.map +1 -0
- package/dist/{index-DRij_w43.d.cts → index-CiF2KXB7.d.cts} +6 -6
- package/dist/{index-DRij_w43.d.cts.map → index-CiF2KXB7.d.cts.map} +1 -1
- package/dist/{index-DNkZrb7P.d.cts → index-CjJHVJwD.d.cts} +35 -35
- package/dist/{index-DNkZrb7P.d.cts.map → index-CjJHVJwD.d.cts.map} +1 -1
- package/dist/{index-D38wOL-M.d.ts → index-CnsR8nkm.d.cts} +34 -34
- package/dist/index-CnsR8nkm.d.cts.map +1 -0
- package/dist/{index-CGnr_e53.d.ts → index-CqGabrzW.d.cts} +38 -38
- package/dist/index-CqGabrzW.d.cts.map +1 -0
- package/dist/{index-CYdvpGJF.d.cts → index-CuvvZMop.d.cts} +3 -3
- package/dist/{index-CYdvpGJF.d.cts.map → index-CuvvZMop.d.cts.map} +1 -1
- package/dist/{index-BWNJdLDV.d.ts → index-DNFUttM8.d.ts} +21 -21
- package/dist/{index-BWNJdLDV.d.ts.map → index-DNFUttM8.d.ts.map} +1 -1
- package/dist/{index-BQDEnYTq.d.ts → index-DVRtBywt.d.ts} +1 -1
- package/dist/{index-BQDEnYTq.d.ts.map → index-DVRtBywt.d.ts.map} +1 -1
- package/dist/{index-oyX8xu0F.d.cts → index-D_WidR7r.d.cts} +6 -6
- package/dist/{index-oyX8xu0F.d.cts.map → index-D_WidR7r.d.cts.map} +1 -1
- package/dist/index-D_egu-QT.d.cts +264 -0
- package/dist/index-D_egu-QT.d.cts.map +1 -0
- package/dist/index-DajjPPWM.d.ts +264 -0
- package/dist/index-DajjPPWM.d.ts.map +1 -0
- package/dist/{index-Bo_n9sse.d.cts → index-DcYFLiul.d.cts} +48 -48
- package/dist/index-DcYFLiul.d.cts.map +1 -0
- package/dist/index-DnzC0GCS.d.ts.map +1 -1
- package/dist/{index-Edx7MxXu.d.ts → index-DvF_C1Bz.d.cts} +3 -3
- package/dist/{index-DxdaxM3o.d.cts.map → index-DvF_C1Bz.d.cts.map} +1 -1
- package/dist/{index-Cb0AgRRa.d.cts → index-cadUZZIY.d.cts} +3 -3
- package/dist/{index-Cb0AgRRa.d.cts.map → index-cadUZZIY.d.cts.map} +1 -1
- package/dist/{index-PU5WNOH9.d.cts → index-g9TZhGnE.d.cts} +3 -3
- package/dist/{index-PU5WNOH9.d.cts.map → index-g9TZhGnE.d.cts.map} +1 -1
- package/dist/index-lQ_hGQ08.d.cts +1 -0
- package/dist/{index-C0L7GvgN.d.cts → index-op7zETAQ.d.ts} +34 -34
- package/dist/index-op7zETAQ.d.ts.map +1 -0
- package/dist/{index-DoS0lVRe.d.cts → index-yVkU2v6b.d.ts} +37 -37
- package/dist/{index-CGnr_e53.d.ts.map → index-yVkU2v6b.d.ts.map} +1 -1
- package/dist/index.cjs +28 -27
- package/dist/index.d.cts +27 -27
- package/dist/index.d.ts +27 -26
- package/dist/index.js +26 -26
- package/dist/partials/FieldCopyTestIdButton/index.cjs +1 -1
- package/dist/partials/FieldCopyTestIdButton/index.d.cts +1 -1
- package/dist/partials/FieldCopyTestIdButton/index.d.ts +1 -1
- package/dist/partials/FieldCopyTestIdButton/index.js +1 -1
- package/dist/partials/FieldValidationError/index.cjs +1 -1
- package/dist/partials/FieldValidationError/index.d.cts +1 -1
- package/dist/partials/FieldValidationError/index.d.ts +1 -1
- package/dist/partials/FieldValidationError/index.js +1 -1
- package/dist/{useClientValidation-DJ4JuN_9.d.ts → useClientValidation-Bg0q3Axc.d.ts} +3 -3
- package/dist/{useClientValidation-DJ4JuN_9.d.ts.map → useClientValidation-Bg0q3Axc.d.ts.map} +1 -1
- package/dist/{useClientValidation-BnnscAEe.js → useClientValidation-BrTtRnqi.js} +3 -3
- package/dist/{useClientValidation-BnnscAEe.js.map → useClientValidation-BrTtRnqi.js.map} +1 -1
- package/dist/{useClientValidation-BQqwz628.d.cts → useClientValidation-BvPDQmf6.d.cts} +3 -3
- package/dist/{useClientValidation-BQqwz628.d.cts.map → useClientValidation-BvPDQmf6.d.cts.map} +1 -1
- package/dist/{useClientValidation-CmYVGlLr.cjs → useClientValidation-CdC7lEYP.cjs} +4 -4
- package/dist/{useClientValidation-CmYVGlLr.cjs.map → useClientValidation-CdC7lEYP.cjs.map} +1 -1
- package/dist/{useController-C_MZLZIp.d.cts → useController-BArZd2Vp.d.cts} +1 -1
- package/dist/{useController-C_MZLZIp.d.cts.map → useController-BArZd2Vp.d.cts.map} +1 -1
- package/dist/{useController-CkmO5CLh.cjs → useController-BBxji1nQ.cjs} +3 -3
- package/dist/{useController-CkmO5CLh.cjs.map → useController-BBxji1nQ.cjs.map} +1 -1
- package/dist/{useController-hjpJQf0w.d.ts → useController-MVHJ7WFp.d.ts} +1 -1
- package/dist/{useController-hjpJQf0w.d.ts.map → useController-MVHJ7WFp.d.ts.map} +1 -1
- package/dist/{useController-CumIERks.js → useController-g0AlWM__.js} +3 -3
- package/dist/{useController-CumIERks.js.map → useController-g0AlWM__.js.map} +1 -1
- package/dist/{useFormContext-B083Y-kw.d.cts → useFormContext--yod5xzQ.d.cts} +3 -3
- package/dist/useFormContext--yod5xzQ.d.cts.map +1 -0
- package/dist/{useFormContext-JCm1UR_e.js → useFormContext-BFoXZNkp.js} +3 -3
- package/dist/{useFormContext-JCm1UR_e.js.map → useFormContext-BFoXZNkp.js.map} +1 -1
- package/dist/{useFormContext-Bp0EODoO.cjs → useFormContext-CEr3zcL6.cjs} +3 -3
- package/dist/{useFormContext-Bp0EODoO.cjs.map → useFormContext-CEr3zcL6.cjs.map} +1 -1
- package/dist/{useFormContext-B2TS6xq0.d.ts → useFormContext-Cw6aAhos.d.ts} +3 -3
- package/dist/useFormContext-Cw6aAhos.d.ts.map +1 -0
- package/dist/{useInputValueDebounce-B5b-v8Hc.d.cts → useInputValueDebounce-DI1C6oaU.d.cts} +5 -1
- package/dist/useInputValueDebounce-DI1C6oaU.d.cts.map +1 -0
- package/dist/{useInputValueDebounce-DaH5ONlQ.js → useInputValueDebounce-Dop_8_OK.js} +12 -3
- package/dist/useInputValueDebounce-Dop_8_OK.js.map +1 -0
- package/dist/{useInputValueDebounce-BcUyaS94.cjs → useInputValueDebounce-TiNR4jtG.cjs} +13 -4
- package/dist/useInputValueDebounce-TiNR4jtG.cjs.map +1 -0
- package/dist/{useInputValueDebounce-DoRuSF6R.d.ts → useInputValueDebounce-fhmVn1aO.d.ts} +5 -1
- package/dist/useInputValueDebounce-fhmVn1aO.d.ts.map +1 -0
- package/dist/{useInputValueTransform-DFPA3KVy.cjs → useInputValueTransform-BNmfaj5D.cjs} +4 -3
- package/dist/{useInputValueTransform-DFPA3KVy.cjs.map → useInputValueTransform-BNmfaj5D.cjs.map} +1 -1
- package/dist/{useInputValueTransform-D7LfyYRe.d.ts → useInputValueTransform-BV8o0PMI.d.cts} +3 -2
- package/dist/useInputValueTransform-BV8o0PMI.d.cts.map +1 -0
- package/dist/{useInputValueTransform-aiIf8lq5.js → useInputValueTransform-CMNC21vX.js} +3 -2
- package/dist/{useInputValueTransform-aiIf8lq5.js.map → useInputValueTransform-CMNC21vX.js.map} +1 -1
- package/dist/{useInputValueTransform-BID-CQ-y.d.cts → useInputValueTransform-Cc0qEsnS.d.ts} +3 -2
- package/dist/useInputValueTransform-Cc0qEsnS.d.ts.map +1 -0
- package/dist/{useUniformField-B2OZ-Z1G.d.cts → useUniformField-B2zQtEbr.d.cts} +4 -4
- package/dist/{useUniformField-B2OZ-Z1G.d.cts.map → useUniformField-B2zQtEbr.d.cts.map} +1 -1
- package/dist/{useUniformField-gU4qYUwL.js → useUniformField-BKVVns0E.js} +34 -8
- package/dist/useUniformField-BKVVns0E.js.map +1 -0
- package/dist/{useUniformField-Bj23Kvbs.cjs → useUniformField-D6fwSjrH.cjs} +35 -9
- package/dist/useUniformField-D6fwSjrH.cjs.map +1 -0
- package/dist/{useUniformField-CwEHonNe.d.ts → useUniformField-RxZqXMuD.d.ts} +4 -4
- package/dist/{useUniformField-CwEHonNe.d.ts.map → useUniformField-RxZqXMuD.d.ts.map} +1 -1
- package/dist/{useUniformFieldArray-CXoWvu6m.d.ts → useUniformFieldArray-B_c55CnX.d.ts} +4 -4
- package/dist/useUniformFieldArray-B_c55CnX.d.ts.map +1 -0
- package/dist/{useUniformFieldArray-B5PyxL1P.js → useUniformFieldArray-BwE634m6.js} +4 -4
- package/dist/useUniformFieldArray-BwE634m6.js.map +1 -0
- package/dist/{useUniformFieldArray-G1lokW7x.cjs → useUniformFieldArray-Byfmzq97.cjs} +5 -5
- package/dist/useUniformFieldArray-Byfmzq97.cjs.map +1 -0
- package/dist/{useUniformFieldArray-qtJMEosJ.d.cts → useUniformFieldArray-WRuIMhw6.d.cts} +4 -4
- package/dist/useUniformFieldArray-WRuIMhw6.d.cts.map +1 -0
- package/dist/{useWatchUserChange-BAdiqg2q.d.ts → useWatchUserChange-Bf5JKDJJ.d.ts} +1 -1
- package/dist/{useWatchUserChange-BAdiqg2q.d.ts.map → useWatchUserChange-Bf5JKDJJ.d.ts.map} +1 -1
- package/dist/{useWatchUserChange-COVdHmki.d.cts → useWatchUserChange-Br4Q7syM.d.cts} +1 -1
- package/dist/{useWatchUserChange-COVdHmki.d.cts.map → useWatchUserChange-Br4Q7syM.d.cts.map} +1 -1
- package/dist/{useWatchUserChange-BnxYE-0b.cjs → useWatchUserChange-TMfaTCcp.cjs} +3 -3
- package/dist/{useWatchUserChange-BnxYE-0b.cjs.map → useWatchUserChange-TMfaTCcp.cjs.map} +1 -1
- package/dist/{useWatchUserChange-C1ezpj0t.js → useWatchUserChange-fZy6nGtD.js} +2 -2
- package/dist/{useWatchUserChange-C1ezpj0t.js.map → useWatchUserChange-fZy6nGtD.js.map} +1 -1
- package/package.json +3 -3
- package/dist/Input-DXMWGTBh.js.map +0 -1
- package/dist/Input-DeTpxiK_.cjs.map +0 -1
- package/dist/helpers-B-CJOBt3.js.map +0 -1
- package/dist/helpers-B84E9vHd.cjs.map +0 -1
- package/dist/index-Bj_lpc5r.d.cts.map +0 -1
- package/dist/index-Bo_n9sse.d.cts.map +0 -1
- package/dist/index-BxA_pJWn.d.cts.map +0 -1
- package/dist/index-C0L7GvgN.d.cts.map +0 -1
- package/dist/index-C1PUx1tH.d.ts.map +0 -1
- package/dist/index-CADnFWHq.d.ts +0 -264
- package/dist/index-CADnFWHq.d.ts.map +0 -1
- package/dist/index-D38wOL-M.d.ts.map +0 -1
- package/dist/index-DoS0lVRe.d.cts.map +0 -1
- package/dist/index-G0IgQWoU.d.cts +0 -134
- package/dist/index-G0IgQWoU.d.cts.map +0 -1
- package/dist/index-UjKqRe-8.d.ts +0 -134
- package/dist/index-UjKqRe-8.d.ts.map +0 -1
- package/dist/index-sJZ434Sg.d.cts +0 -264
- package/dist/index-sJZ434Sg.d.cts.map +0 -1
- package/dist/useFormContext-B083Y-kw.d.cts.map +0 -1
- package/dist/useFormContext-B2TS6xq0.d.ts.map +0 -1
- package/dist/useInputValueDebounce-B5b-v8Hc.d.cts.map +0 -1
- package/dist/useInputValueDebounce-BcUyaS94.cjs.map +0 -1
- package/dist/useInputValueDebounce-DaH5ONlQ.js.map +0 -1
- package/dist/useInputValueDebounce-DoRuSF6R.d.ts.map +0 -1
- package/dist/useInputValueTransform-BID-CQ-y.d.cts.map +0 -1
- package/dist/useInputValueTransform-D7LfyYRe.d.ts.map +0 -1
- package/dist/useUniformField-Bj23Kvbs.cjs.map +0 -1
- package/dist/useUniformField-gU4qYUwL.js.map +0 -1
- package/dist/useUniformFieldArray-B5PyxL1P.js.map +0 -1
- package/dist/useUniformFieldArray-CXoWvu6m.d.ts.map +0 -1
- package/dist/useUniformFieldArray-G1lokW7x.cjs.map +0 -1
- package/dist/useUniformFieldArray-qtJMEosJ.d.cts.map +0 -1
package/dist/index-UjKqRe-8.d.ts
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
//#region src/helpers/nullishFields/nullishFields.d.ts
|
|
2
|
-
/** Key used to wrap flat array elements when converting to form format */
|
|
3
|
-
declare const flatArrayKey = "__FLAT__";
|
|
4
|
-
/**
|
|
5
|
-
* Converts marker strings back to their original values when processing arrays
|
|
6
|
-
*/
|
|
7
|
-
declare const fromNullishString: (value: unknown) => unknown;
|
|
8
|
-
/**
|
|
9
|
-
* Converts null/falsy values to marker strings for JSON processing
|
|
10
|
-
*/
|
|
11
|
-
declare const toNullishString: (value: unknown) => unknown;
|
|
12
|
-
/**
|
|
13
|
-
* Converts field values to a format suitable for forms by:
|
|
14
|
-
* - Wrapping arrays of primitives as objects using the flatArrayKey `__FLAT__`
|
|
15
|
-
* to satisfy RHF's requirement that array fields contain objects
|
|
16
|
-
* - Removing empty strings and null values from objects
|
|
17
|
-
*
|
|
18
|
-
* This conversion is required because React Hook Form does not support arrays with
|
|
19
|
-
* flat values (string, number, boolean, null). Array fields must contain objects.
|
|
20
|
-
* We work around this by wrapping primitive entries: `{ __FLAT__: <value> }`.
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* const fields = {
|
|
24
|
-
* name: 'John',
|
|
25
|
-
* scores: [0, null, 75, false],
|
|
26
|
-
* scoresDetailed: [
|
|
27
|
-
* { score: 1 },
|
|
28
|
-
* { score: null },
|
|
29
|
-
* { score: 0 },
|
|
30
|
-
* { score: false },
|
|
31
|
-
* { score: '' },
|
|
32
|
-
* ],
|
|
33
|
-
* contact: {
|
|
34
|
-
* email: '',
|
|
35
|
-
* phone: null,
|
|
36
|
-
* address: '123 Main St'
|
|
37
|
-
* }
|
|
38
|
-
* };
|
|
39
|
-
*
|
|
40
|
-
* // Result:
|
|
41
|
-
* {
|
|
42
|
-
* name: 'John',
|
|
43
|
-
* scores: [
|
|
44
|
-
* { __FLAT__: 0 },
|
|
45
|
-
* { __FLAT__: null },
|
|
46
|
-
* { __FLAT__: 75 },
|
|
47
|
-
* { __FLAT__: false }
|
|
48
|
-
* ],
|
|
49
|
-
* // Arrays of objects are left as objects; empty/null properties are removed
|
|
50
|
-
* scoresDetailed: [
|
|
51
|
-
* { score: 1 },
|
|
52
|
-
* {}, // null score removed
|
|
53
|
-
* { score: 0 },
|
|
54
|
-
* { score: false },
|
|
55
|
-
* {}, // empty string removed
|
|
56
|
-
* ],
|
|
57
|
-
* contact: {
|
|
58
|
-
* address: '123 Main St'
|
|
59
|
-
* }
|
|
60
|
-
* }
|
|
61
|
-
*/
|
|
62
|
-
declare const toFormFormat: (fields: Record<string, unknown>) => Record<string, unknown>;
|
|
63
|
-
/**
|
|
64
|
-
* Converts form state to a format suitable for validation by:
|
|
65
|
-
* - Unwrapping flat array wrappers `{ __FLAT__: <value> }` back to primitives
|
|
66
|
-
* - Converting legacy string markers (__NULL__, __FALSE__, __ZERO__) back to their original values
|
|
67
|
-
* - Removing fields whose converted value is empty string or null
|
|
68
|
-
* - Removing empty arrays
|
|
69
|
-
*
|
|
70
|
-
* @example
|
|
71
|
-
* const formState = {
|
|
72
|
-
* name: 'John',
|
|
73
|
-
* scores: [
|
|
74
|
-
* { __FLAT__: 75 },
|
|
75
|
-
* { __FLAT__: 0 },
|
|
76
|
-
* { __FLAT__: null },
|
|
77
|
-
* { __FLAT__: false }
|
|
78
|
-
* ],
|
|
79
|
-
* emptyArray: [],
|
|
80
|
-
* scoresDetailed: [
|
|
81
|
-
* { score: 1 },
|
|
82
|
-
* {},
|
|
83
|
-
* { score: 0 },
|
|
84
|
-
* { score: false },
|
|
85
|
-
* {},
|
|
86
|
-
* ],
|
|
87
|
-
* contact: {
|
|
88
|
-
* address: '123 Main St',
|
|
89
|
-
* fax: null
|
|
90
|
-
* }
|
|
91
|
-
* };
|
|
92
|
-
*
|
|
93
|
-
* // Result:
|
|
94
|
-
* {
|
|
95
|
-
* name: 'John',
|
|
96
|
-
* scores: [75, 0, null, false],
|
|
97
|
-
* // emptyArray is removed
|
|
98
|
-
* // Objects inside arrays remain objects; empty entries remain empty objects
|
|
99
|
-
* scoresDetailed: [
|
|
100
|
-
* { score: 1 },
|
|
101
|
-
* {},
|
|
102
|
-
* { score: 0 },
|
|
103
|
-
* { score: false },
|
|
104
|
-
* {},
|
|
105
|
-
* ],
|
|
106
|
-
* contact: {
|
|
107
|
-
* address: '123 Main St'
|
|
108
|
-
* }
|
|
109
|
-
* }
|
|
110
|
-
*/
|
|
111
|
-
declare const toValidationFormat: (formState: Record<string, unknown> | null | undefined) => Record<string, unknown> | null | undefined;
|
|
112
|
-
/**
|
|
113
|
-
* Converts a field name to a testId by removing flat array key segments and slugifying.
|
|
114
|
-
* Removes all occurrences of `flatArrayKey` from the field name and applies slugify transformation.
|
|
115
|
-
*
|
|
116
|
-
* This is used to generate stable testIds for form fields that don't include
|
|
117
|
-
* the internal `__FLAT__` marker used for flat arrays.
|
|
118
|
-
*
|
|
119
|
-
* @param name - The field name as a string (e.g., 'tags.0.__FLAT__') or array path (e.g., ['tags', '0', '__FLAT__'])
|
|
120
|
-
* @returns The slugified field name with all flat array key segments removed (e.g., 'tags_0')
|
|
121
|
-
*
|
|
122
|
-
* @example
|
|
123
|
-
* ```ts
|
|
124
|
-
* nameToTestId('tags.0.__FLAT__') // => 'tags_0'
|
|
125
|
-
* nameToTestId('array.0.__FLAT__') // => 'array_0'
|
|
126
|
-
* nameToTestId('nested.array.0.__FLAT__.field') // => 'nested_array_0_field'
|
|
127
|
-
* nameToTestId('simple.field') // => 'simple_field'
|
|
128
|
-
* nameToTestId(['tags', '0', '__FLAT__']) // => 'tags_0'
|
|
129
|
-
* ```
|
|
130
|
-
*/
|
|
131
|
-
declare const nameToTestId: (name: string | readonly string[]) => string;
|
|
132
|
-
//#endregion
|
|
133
|
-
export { toNullishString as a, toFormFormat as i, fromNullishString as n, toValidationFormat as o, nameToTestId as r, flatArrayKey as t };
|
|
134
|
-
//# sourceMappingURL=index-UjKqRe-8.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-UjKqRe-8.d.ts","names":[],"sources":["../src/helpers/nullishFields/nullishFields.ts"],"sourcesContent":[],"mappings":";;AAGa,cAAA,YAAA,GAAY,UAAA;AAYzB;AAsCA;AA6EA;AA2Ea,cA9LA,iBA+LA,EAAA,CAAA,KACV,EAAA,OAAM,EAAA,GAAA,OAAA;AAgGT;;;cA1Pa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA6EA,uBAAwB,4BAwBE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAmD1B,gCACA,+CACV;;;;;;;;;;;;;;;;;;;;cAgGU"}
|
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
import * as tailwind_variants128 from "tailwind-variants";
|
|
2
|
-
import * as react_jsx_runtime5 from "react/jsx-runtime";
|
|
3
|
-
import { TVClassName, TVProps } from "@fuf-stack/pixel-utils";
|
|
4
|
-
import { ReactNode } from "react";
|
|
5
|
-
import { Props } from "react-select";
|
|
6
|
-
|
|
7
|
-
//#region src/Select/Select.d.ts
|
|
8
|
-
declare const selectVariants: tailwind_variants128.TVReturnType<{
|
|
9
|
-
[key: string]: {
|
|
10
|
-
[key: string]: tailwind_variants128.ClassValue | {
|
|
11
|
-
base?: tailwind_variants128.ClassValue;
|
|
12
|
-
label?: tailwind_variants128.ClassValue;
|
|
13
|
-
group?: tailwind_variants128.ClassValue;
|
|
14
|
-
control?: tailwind_variants128.ClassValue;
|
|
15
|
-
placeholder?: tailwind_variants128.ClassValue;
|
|
16
|
-
input?: tailwind_variants128.ClassValue;
|
|
17
|
-
menu?: tailwind_variants128.ClassValue;
|
|
18
|
-
option?: tailwind_variants128.ClassValue;
|
|
19
|
-
clearIndicator?: tailwind_variants128.ClassValue;
|
|
20
|
-
control_focused?: tailwind_variants128.ClassValue;
|
|
21
|
-
crossIcon?: tailwind_variants128.ClassValue;
|
|
22
|
-
downChevron?: tailwind_variants128.ClassValue;
|
|
23
|
-
dropdownIndicator?: tailwind_variants128.ClassValue;
|
|
24
|
-
groupHeading?: tailwind_variants128.ClassValue;
|
|
25
|
-
indicatorsContainer?: tailwind_variants128.ClassValue;
|
|
26
|
-
indicatorSeparator?: tailwind_variants128.ClassValue;
|
|
27
|
-
loadingIndicator?: tailwind_variants128.ClassValue;
|
|
28
|
-
loadingMessage?: tailwind_variants128.ClassValue;
|
|
29
|
-
menuList?: tailwind_variants128.ClassValue;
|
|
30
|
-
menuPortal?: tailwind_variants128.ClassValue;
|
|
31
|
-
multiValue?: tailwind_variants128.ClassValue;
|
|
32
|
-
multiValueContainer?: tailwind_variants128.ClassValue;
|
|
33
|
-
multiValueLabel?: tailwind_variants128.ClassValue;
|
|
34
|
-
multiValueRemove?: tailwind_variants128.ClassValue;
|
|
35
|
-
noOptionsMessage?: tailwind_variants128.ClassValue;
|
|
36
|
-
option_focused?: tailwind_variants128.ClassValue;
|
|
37
|
-
option_selected?: tailwind_variants128.ClassValue;
|
|
38
|
-
selectContainer?: tailwind_variants128.ClassValue;
|
|
39
|
-
singleValue?: tailwind_variants128.ClassValue;
|
|
40
|
-
valueContainer?: tailwind_variants128.ClassValue;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
} | {
|
|
44
|
-
[x: string]: {
|
|
45
|
-
[x: string]: tailwind_variants128.ClassValue | {
|
|
46
|
-
base?: tailwind_variants128.ClassValue;
|
|
47
|
-
label?: tailwind_variants128.ClassValue;
|
|
48
|
-
group?: tailwind_variants128.ClassValue;
|
|
49
|
-
control?: tailwind_variants128.ClassValue;
|
|
50
|
-
placeholder?: tailwind_variants128.ClassValue;
|
|
51
|
-
input?: tailwind_variants128.ClassValue;
|
|
52
|
-
menu?: tailwind_variants128.ClassValue;
|
|
53
|
-
option?: tailwind_variants128.ClassValue;
|
|
54
|
-
clearIndicator?: tailwind_variants128.ClassValue;
|
|
55
|
-
control_focused?: tailwind_variants128.ClassValue;
|
|
56
|
-
crossIcon?: tailwind_variants128.ClassValue;
|
|
57
|
-
downChevron?: tailwind_variants128.ClassValue;
|
|
58
|
-
dropdownIndicator?: tailwind_variants128.ClassValue;
|
|
59
|
-
groupHeading?: tailwind_variants128.ClassValue;
|
|
60
|
-
indicatorsContainer?: tailwind_variants128.ClassValue;
|
|
61
|
-
indicatorSeparator?: tailwind_variants128.ClassValue;
|
|
62
|
-
loadingIndicator?: tailwind_variants128.ClassValue;
|
|
63
|
-
loadingMessage?: tailwind_variants128.ClassValue;
|
|
64
|
-
menuList?: tailwind_variants128.ClassValue;
|
|
65
|
-
menuPortal?: tailwind_variants128.ClassValue;
|
|
66
|
-
multiValue?: tailwind_variants128.ClassValue;
|
|
67
|
-
multiValueContainer?: tailwind_variants128.ClassValue;
|
|
68
|
-
multiValueLabel?: tailwind_variants128.ClassValue;
|
|
69
|
-
multiValueRemove?: tailwind_variants128.ClassValue;
|
|
70
|
-
noOptionsMessage?: tailwind_variants128.ClassValue;
|
|
71
|
-
option_focused?: tailwind_variants128.ClassValue;
|
|
72
|
-
option_selected?: tailwind_variants128.ClassValue;
|
|
73
|
-
selectContainer?: tailwind_variants128.ClassValue;
|
|
74
|
-
singleValue?: tailwind_variants128.ClassValue;
|
|
75
|
-
valueContainer?: tailwind_variants128.ClassValue;
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
} | {}, {
|
|
79
|
-
base: string;
|
|
80
|
-
clearIndicator: string;
|
|
81
|
-
control: string;
|
|
82
|
-
control_focused: string;
|
|
83
|
-
crossIcon: string;
|
|
84
|
-
downChevron: string;
|
|
85
|
-
dropdownIndicator: string;
|
|
86
|
-
group: string;
|
|
87
|
-
groupHeading: string;
|
|
88
|
-
indicatorsContainer: string;
|
|
89
|
-
indicatorSeparator: string;
|
|
90
|
-
input: string;
|
|
91
|
-
label: string;
|
|
92
|
-
loadingIndicator: string;
|
|
93
|
-
loadingMessage: string;
|
|
94
|
-
menu: string;
|
|
95
|
-
menuList: string;
|
|
96
|
-
menuPortal: string;
|
|
97
|
-
multiValue: string;
|
|
98
|
-
multiValueContainer: string;
|
|
99
|
-
multiValueLabel: string;
|
|
100
|
-
multiValueRemove: string;
|
|
101
|
-
noOptionsMessage: string;
|
|
102
|
-
option_focused: string;
|
|
103
|
-
option_selected: string;
|
|
104
|
-
option: string;
|
|
105
|
-
placeholder: string;
|
|
106
|
-
selectContainer: string;
|
|
107
|
-
singleValue: string;
|
|
108
|
-
valueContainer: string;
|
|
109
|
-
}, undefined, {
|
|
110
|
-
[key: string]: {
|
|
111
|
-
[key: string]: tailwind_variants128.ClassValue | {
|
|
112
|
-
base?: tailwind_variants128.ClassValue;
|
|
113
|
-
label?: tailwind_variants128.ClassValue;
|
|
114
|
-
group?: tailwind_variants128.ClassValue;
|
|
115
|
-
control?: tailwind_variants128.ClassValue;
|
|
116
|
-
placeholder?: tailwind_variants128.ClassValue;
|
|
117
|
-
input?: tailwind_variants128.ClassValue;
|
|
118
|
-
menu?: tailwind_variants128.ClassValue;
|
|
119
|
-
option?: tailwind_variants128.ClassValue;
|
|
120
|
-
clearIndicator?: tailwind_variants128.ClassValue;
|
|
121
|
-
control_focused?: tailwind_variants128.ClassValue;
|
|
122
|
-
crossIcon?: tailwind_variants128.ClassValue;
|
|
123
|
-
downChevron?: tailwind_variants128.ClassValue;
|
|
124
|
-
dropdownIndicator?: tailwind_variants128.ClassValue;
|
|
125
|
-
groupHeading?: tailwind_variants128.ClassValue;
|
|
126
|
-
indicatorsContainer?: tailwind_variants128.ClassValue;
|
|
127
|
-
indicatorSeparator?: tailwind_variants128.ClassValue;
|
|
128
|
-
loadingIndicator?: tailwind_variants128.ClassValue;
|
|
129
|
-
loadingMessage?: tailwind_variants128.ClassValue;
|
|
130
|
-
menuList?: tailwind_variants128.ClassValue;
|
|
131
|
-
menuPortal?: tailwind_variants128.ClassValue;
|
|
132
|
-
multiValue?: tailwind_variants128.ClassValue;
|
|
133
|
-
multiValueContainer?: tailwind_variants128.ClassValue;
|
|
134
|
-
multiValueLabel?: tailwind_variants128.ClassValue;
|
|
135
|
-
multiValueRemove?: tailwind_variants128.ClassValue;
|
|
136
|
-
noOptionsMessage?: tailwind_variants128.ClassValue;
|
|
137
|
-
option_focused?: tailwind_variants128.ClassValue;
|
|
138
|
-
option_selected?: tailwind_variants128.ClassValue;
|
|
139
|
-
selectContainer?: tailwind_variants128.ClassValue;
|
|
140
|
-
singleValue?: tailwind_variants128.ClassValue;
|
|
141
|
-
valueContainer?: tailwind_variants128.ClassValue;
|
|
142
|
-
};
|
|
143
|
-
};
|
|
144
|
-
} | {}, {
|
|
145
|
-
base: string;
|
|
146
|
-
clearIndicator: string;
|
|
147
|
-
control: string;
|
|
148
|
-
control_focused: string;
|
|
149
|
-
crossIcon: string;
|
|
150
|
-
downChevron: string;
|
|
151
|
-
dropdownIndicator: string;
|
|
152
|
-
group: string;
|
|
153
|
-
groupHeading: string;
|
|
154
|
-
indicatorsContainer: string;
|
|
155
|
-
indicatorSeparator: string;
|
|
156
|
-
input: string;
|
|
157
|
-
label: string;
|
|
158
|
-
loadingIndicator: string;
|
|
159
|
-
loadingMessage: string;
|
|
160
|
-
menu: string;
|
|
161
|
-
menuList: string;
|
|
162
|
-
menuPortal: string;
|
|
163
|
-
multiValue: string;
|
|
164
|
-
multiValueContainer: string;
|
|
165
|
-
multiValueLabel: string;
|
|
166
|
-
multiValueRemove: string;
|
|
167
|
-
noOptionsMessage: string;
|
|
168
|
-
option_focused: string;
|
|
169
|
-
option_selected: string;
|
|
170
|
-
option: string;
|
|
171
|
-
placeholder: string;
|
|
172
|
-
selectContainer: string;
|
|
173
|
-
singleValue: string;
|
|
174
|
-
valueContainer: string;
|
|
175
|
-
}, tailwind_variants128.TVReturnType<unknown, {
|
|
176
|
-
base: string;
|
|
177
|
-
clearIndicator: string;
|
|
178
|
-
control: string;
|
|
179
|
-
control_focused: string;
|
|
180
|
-
crossIcon: string;
|
|
181
|
-
downChevron: string;
|
|
182
|
-
dropdownIndicator: string;
|
|
183
|
-
group: string;
|
|
184
|
-
groupHeading: string;
|
|
185
|
-
indicatorsContainer: string;
|
|
186
|
-
indicatorSeparator: string;
|
|
187
|
-
input: string;
|
|
188
|
-
label: string;
|
|
189
|
-
loadingIndicator: string;
|
|
190
|
-
loadingMessage: string;
|
|
191
|
-
menu: string;
|
|
192
|
-
menuList: string;
|
|
193
|
-
menuPortal: string;
|
|
194
|
-
multiValue: string;
|
|
195
|
-
multiValueContainer: string;
|
|
196
|
-
multiValueLabel: string;
|
|
197
|
-
multiValueRemove: string;
|
|
198
|
-
noOptionsMessage: string;
|
|
199
|
-
option_focused: string;
|
|
200
|
-
option_selected: string;
|
|
201
|
-
option: string;
|
|
202
|
-
placeholder: string;
|
|
203
|
-
selectContainer: string;
|
|
204
|
-
singleValue: string;
|
|
205
|
-
valueContainer: string;
|
|
206
|
-
}, undefined, unknown, unknown, undefined>>;
|
|
207
|
-
interface SelectOption {
|
|
208
|
-
/** option label */
|
|
209
|
-
label?: ReactNode;
|
|
210
|
-
/** option value */
|
|
211
|
-
value: string;
|
|
212
|
-
}
|
|
213
|
-
type VariantProps = TVProps<typeof selectVariants>;
|
|
214
|
-
type ClassName = TVClassName<typeof selectVariants>;
|
|
215
|
-
interface SelectProps extends VariantProps {
|
|
216
|
-
/** Custom aria-label for accessibility. If not provided, falls back to field name when no visible label exists */
|
|
217
|
-
ariaLabel?: string;
|
|
218
|
-
/** CSS class name */
|
|
219
|
-
className?: ClassName;
|
|
220
|
-
/** Determine if the */
|
|
221
|
-
clearable?: boolean;
|
|
222
|
-
/** Set the select to disabled state. */
|
|
223
|
-
disabled?: boolean;
|
|
224
|
-
/** Filter Select Options */
|
|
225
|
-
filterOption?: undefined | ((option?: SelectOption, inputValue?: string) => boolean);
|
|
226
|
-
/** Format the label of the option */
|
|
227
|
-
renderOptionLabel?: undefined | Props['formatOptionLabel'];
|
|
228
|
-
/** The value of the search input */
|
|
229
|
-
inputValue?: string;
|
|
230
|
-
/** Label that should be associated with the select. */
|
|
231
|
-
label?: ReactNode;
|
|
232
|
-
/** Set the select to a loading state. */
|
|
233
|
-
loading?: boolean;
|
|
234
|
-
/** switch between single and multi select mode. */
|
|
235
|
-
multiSelect?: boolean;
|
|
236
|
-
/** The name for the Select component, used by react-hook-form */
|
|
237
|
-
name: string;
|
|
238
|
-
/** Placeholder that is displayed when nothing is selected */
|
|
239
|
-
placeholder?: string;
|
|
240
|
-
/** The options for the Select component */
|
|
241
|
-
options: SelectOption[];
|
|
242
|
-
/** Handle change events on the input */
|
|
243
|
-
onInputChange?: Props['onInputChange'];
|
|
244
|
-
/** HTML data-testid attribute used in e2e tests */
|
|
245
|
-
testId?: string;
|
|
246
|
-
}
|
|
247
|
-
/** Select component based on [HeroUI Select](https://www.heroui.com//docs/components/select) and [React-Select](https://react-select.com/home) */
|
|
248
|
-
declare const Select: ({
|
|
249
|
-
className,
|
|
250
|
-
clearable,
|
|
251
|
-
filterOption,
|
|
252
|
-
renderOptionLabel,
|
|
253
|
-
inputValue,
|
|
254
|
-
loading,
|
|
255
|
-
multiSelect,
|
|
256
|
-
name,
|
|
257
|
-
onInputChange,
|
|
258
|
-
options,
|
|
259
|
-
placeholder,
|
|
260
|
-
...uniformFieldProps
|
|
261
|
-
}: SelectProps) => react_jsx_runtime5.JSX.Element;
|
|
262
|
-
//#endregion
|
|
263
|
-
export { SelectProps as n, Select as t };
|
|
264
|
-
//# sourceMappingURL=index-sJZ434Sg.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-sJZ434Sg.d.cts","names":[],"sources":["../src/Select/Select.tsx"],"sourcesContent":[],"mappings":";;;;;;;cAca,qCAAc;;mBA0CzB,oBAAA,CAAA,UAAA;;MA1CW,KAAA,CAAA,iCA0CX;MAAA,KAAA,CAAA,iCAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA1CyB;EAAA,cAAA,EAAA,MAAA;AA0CxB,CAAA,EAAA,SAEO,EAAA;EAOL,CAAA,GAAA,EAAA,MAAA,CAAA,EAAY;IACZ,CAAA,GAAA,EAAA,MAAS,CAAA,oCAAc;MAEX,IAAA,CAAA,iCAAY;MAIf,KAAA,CAAA,iCAAA;MAQG,KAAA,CAAA,iCAAA;MAEiB,OAAA,CAAA,iCAAA;MAIxB,WAAA,CAAA,iCAAA;MAUC,KAAA,CAAA,iCAAA;MAEO,IAAA,CAAA,iCAAA;MA9BmB,MAAA,CAAA,iCAAA;MAAY,cAAA,CAAA,iCAAA;MAkF3C,eA4NL,CAAA,iCAAA;MA5Ne,SAAA,CAAA,iCAAA;MAAA,WAAA,CAAA,iCAAA;MAAA,iBAAA,CAAA,iCAAA;MAAA,YAAA,CAAA,iCAAA;MAAA,mBAAA,CAAA,iCAAA;MAAA,kBAAA,CAAA,iCAAA;MAAA,gBAAA,CAAA,iCAAA;MAAA,cAAA,CAAA,iCAAA;MAAA,QAAA,CAAA,iCAAA;MAAA,UAAA,CAAA,iCAAA;MAAA,UAAA,CAAA,iCAAA;MAab,mBAAA,CAAA,iCAAA;MAAW,eAAA,CAAA,iCAAA;MA+Mb,gBAAA,CAAA,iCAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAxTS,YAAA;;UAEA;;;;KAKL,YAAA,GAAe,eAAe;KAC9B,SAAA,GAAY,mBAAmB;UAEnB,WAAA,SAAoB;;;;cAIvB;;;;;;wCAQG;;kCAEiB;;;;UAIxB;;;;;;;;;;WAUC;;kBAEO;;;;;cAoDZ;;;;;;;;;;;;;GAaH,gBAAW,kBAAA,CAAA,GAAA,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFormContext-B083Y-kw.d.cts","names":[],"sources":["../src/hooks/useFormContext/useFormContext.ts"],"sourcesContent":[],"mappings":";;;;;;;;;cAYa,mCACC;;;;;AADd;AAqEA;;;;;cAAa,sCACU,cAAc,kDAEd;EAwBa,SAAA,4BAAA,aAAA,CAAA;EAAL,aAAA,EAAA,CAAA,IAAA,EAAA,IAAA,CAAK,YAAL,CAAA,EAAA,MAAA,CAAA,EAAA,MAAA,EAAA,GAAA;;;;;;;;;WAWO,mCAAA,aAAA,CAAA;EAAA,SAAA,mCAAA,aAAA,CAAA;EAAA,KAAA,+BAAA,aAAA,CAAA;EAyBpC,SAAA,EAAA,UAAA,GAAA,OAAA,GAAA,eAAA,GAAA,KAAA;EACyB,iBAAA,CAAA,mBAAA;EAAwE,aAAA,EAAA,CAAA,OAAA,EAAA,OAAA,EAAA,GAAA,IAAA;EAAA,YAAA,EAAA,CAAA,SAAA,EAAA,UAAA,GAAA,OAAA,GAAA,eAAA,GAAA,KAAA,EAAA,GAAA,IAAA;6BA1B7D,uBAAA;;0BAAA;;;;mBAyBpC;eACyB;aAAwE;qDAAA,gBAAA,CAAA,WAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFormContext-B2TS6xq0.d.ts","names":[],"sources":["../src/hooks/useFormContext/useFormContext.ts"],"sourcesContent":[],"mappings":";;;;;;;;;cAYa,mCACC;;;;;AADd;AAqEA;;;;;cAAa,wCACU,cAAc,kDAEd;EAwBa,SAAA,4BAAA,aAAA,CAAA;EAAL,aAAA,EAAA,CAAA,IAAA,EAAA,IAAA,CAAK,YAAL,CAAA,EAAA,MAAA,CAAA,EAAA,MAAA,EAAA,GAAA;;;;;;;;;WAWO,mCAAA,aAAA,CAAA;EAAA,SAAA,mCAAA,aAAA,CAAA;EAAA,KAAA,+BAAA,aAAA,CAAA;EAyBpC,SAAA,EAAA,UAAA,GAAA,OAAA,GAAA,eAAA,GAAA,KAAA;EACyB,iBAAA,CAAA,mBAAA;EAAwE,aAAA,EAAA,CAAA,OAAA,EAAA,OAAA,EAAA,GAAA,IAAA;EAAA,YAAA,EAAA,CAAA,SAAA,EAAA,UAAA,GAAA,OAAA,GAAA,eAAA,GAAA,KAAA,EAAA,GAAA,IAAA;6BA1B7D,uBAAA;;0BAAA;;;;mBAyBpC;eACyB;aAAwE;qDAAA,gBAAA,CAAA,WAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useInputValueDebounce-B5b-v8Hc.d.cts","names":[],"sources":["../src/hooks/useInputValueDebounce/useInputValueDebounce.ts"],"sourcesContent":[],"mappings":";UAEiB;EAAA;EAYA,aAAA,CAAA,EAAA,MAAA;EA4CJ;EAA2C,MAAA,EAAA,GAAA,GAAA,IAAA;EAAA;EAAA,QAAA,EAAA,CAAA,GAAA,KAAA,EAAA,GAAA,EAAA,EAAA,GAAA,IAAA;EAAA;EAKxB,KAAA,EApDvB,MAoDuB;;AAAsC,UAjDrD,2BAiDqD,CAAA,SAAA,OAAA,CAAA,CAAA;EAA5B;EAA2B,QAAA,EAAA,CAAA,GAAA,KAAA,EAAA,GAAA,EAAA,EAAA,GAAA,IAAA;;;;SA1C5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAqCI;;;;;GAKV,6BAA6B,YAAU,4BAA4B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useInputValueDebounce-BcUyaS94.cjs","names":[],"sources":["../src/hooks/useInputValueDebounce/useInputValueDebounce.ts","../src/hooks/useInputValueDebounce/index.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\n\nexport interface UseInputValueDebounceOptions<TValue = unknown> {\n /** Debounce delay in milliseconds (default: 300) */\n debounceDelay?: number;\n /** The onBlur function to call after flushing debounced value */\n onBlur: () => void;\n /** The onChange function to call with debounced value */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onChange: (...event: any[]) => void;\n /** The field value */\n value: TValue;\n}\n\nexport interface UseInputValueDebounceReturn<TValue = unknown> {\n /** Enhanced onChange function with debouncing */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onChange: (...event: any[]) => void;\n /** Enhanced onBlur function that flushes current value immediately */\n onBlur: () => void;\n /** The field value that is displayed - updates immediately */\n value: TValue;\n}\n\n/**\n * Custom hook for debouncing value changes with immediate blur support.\n *\n * Provides immediate visual feedback by updating the value instantly,\n * while debouncing the actual onChange calls. When focus is lost,\n * any pending debounced changes are immediately flushed.\n *\n * **Key Features:**\n * - **Debouncing**: Delays onChange calls until user stops typing\n * - **Generic type support**: Works with any data type (strings, numbers, arrays, objects)\n * - **Immediate value updates**: UI stays responsive during debouncing\n * - **Blur flushing**: Immediately applies pending changes on blur\n *\n * **Note:** Value transformations should be handled at the `useUniformField` level,\n * not in this hook. This hook only handles debouncing timing.\n *\n * @param options Configuration for debounced value handling\n * @param options.debounceDelay Delay in milliseconds (default: 300)\n * @param options.onBlur Function to call after flushing debounced value\n * @param options.onChange Function to call with debounced value\n * @param options.value The field value\n * @returns Object containing enhanced onChange, onBlur, and immediate value\n *\n * @example\n * Basic usage with debouncing:\n * ```tsx\n * const { onChange, onBlur, value } = useInputValueDebounce({\n * debounceDelay: 300,\n * onBlur: field.onBlur,\n * onChange: field.onChange,\n * value: field.value,\n * });\n * ```\n */\nexport const useInputValueDebounce = <TValue = unknown>({\n debounceDelay = 300,\n onBlur,\n onChange,\n value,\n}: UseInputValueDebounceOptions<TValue>): UseInputValueDebounceReturn<TValue> => {\n // Track value for synchronous updates\n const [currentValue, setCurrentValue] = useState<TValue>(value);\n\n const timeoutRef = useRef<NodeJS.Timeout | null>(null);\n\n // Sync with external value changes\n useEffect(() => {\n setCurrentValue(value);\n }, [value]);\n\n // Enhanced onChange handler with debouncing\n const handleChange = useCallback(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (...event: any[]) => {\n // Extract the raw value\n const newValue = (event[0]?.target?.value ?? event[0]) as TValue;\n setCurrentValue(newValue);\n\n // Clear existing timeout\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n\n const executeOnChange = () => {\n // Preserve event structure if original was an event\n if (event[0]?.target) {\n const convertedEvent = {\n ...event[0],\n target: {\n ...event[0].target,\n value: newValue,\n },\n };\n onChange(convertedEvent, ...event.slice(1));\n } else {\n onChange(newValue);\n }\n };\n\n // Execute immediately or after delay\n if (debounceDelay <= 0) {\n executeOnChange();\n } else {\n timeoutRef.current = setTimeout(executeOnChange, debounceDelay);\n }\n },\n [onChange, debounceDelay],\n );\n\n // Enhanced blur handler\n const handleBlur = useCallback(() => {\n // Flush pending changes\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = null;\n onChange(currentValue);\n }\n onBlur();\n }, [onChange, onBlur, currentValue]);\n\n return {\n onChange: handleChange,\n onBlur: handleBlur,\n value: currentValue,\n };\n};\n","/* v8 ignore start */\n\nexport * from './useInputValueDebounce';\n\n/* v8 ignore stop */\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0DA,MAAa,yBAA2C,EACtD,gBAAgB,KAChB,QACA,UACA,YAC+E;CAE/E,MAAM,CAAC,cAAc,uCAAoC,MAAM;CAE/D,MAAM,+BAA2C,KAAK;AAGtD,4BAAgB;AACd,kBAAgB,MAAM;IACrB,CAAC,MAAM,CAAC;AAoDX,QAAO;EACL,kCAhDC,GAAG,UAAiB;GAEnB,MAAM,WAAY,MAAM,IAAI,QAAQ,SAAS,MAAM;AACnD,mBAAgB,SAAS;AAGzB,OAAI,WAAW,QACb,cAAa,WAAW,QAAQ;GAGlC,MAAM,wBAAwB;AAE5B,QAAI,MAAM,IAAI,OAQZ,UAPuB;KACrB,GAAG,MAAM;KACT,QAAQ;MACN,GAAG,MAAM,GAAG;MACZ,OAAO;MACR;KACF,EACwB,GAAG,MAAM,MAAM,EAAE,CAAC;QAE3C,UAAS,SAAS;;AAKtB,OAAI,iBAAiB,EACnB,kBAAiB;OAEjB,YAAW,UAAU,WAAW,iBAAiB,cAAc;KAGnE,CAAC,UAAU,cAAc,CAC1B;EAeC,qCAZmC;AAEnC,OAAI,WAAW,SAAS;AACtB,iBAAa,WAAW,QAAQ;AAChC,eAAW,UAAU;AACrB,aAAS,aAAa;;AAExB,WAAQ;KACP;GAAC;GAAU;GAAQ;GAAa,CAAC;EAKlC,OAAO;EACR"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useInputValueDebounce-DaH5ONlQ.js","names":[],"sources":["../src/hooks/useInputValueDebounce/useInputValueDebounce.ts","../src/hooks/useInputValueDebounce/index.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\n\nexport interface UseInputValueDebounceOptions<TValue = unknown> {\n /** Debounce delay in milliseconds (default: 300) */\n debounceDelay?: number;\n /** The onBlur function to call after flushing debounced value */\n onBlur: () => void;\n /** The onChange function to call with debounced value */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onChange: (...event: any[]) => void;\n /** The field value */\n value: TValue;\n}\n\nexport interface UseInputValueDebounceReturn<TValue = unknown> {\n /** Enhanced onChange function with debouncing */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onChange: (...event: any[]) => void;\n /** Enhanced onBlur function that flushes current value immediately */\n onBlur: () => void;\n /** The field value that is displayed - updates immediately */\n value: TValue;\n}\n\n/**\n * Custom hook for debouncing value changes with immediate blur support.\n *\n * Provides immediate visual feedback by updating the value instantly,\n * while debouncing the actual onChange calls. When focus is lost,\n * any pending debounced changes are immediately flushed.\n *\n * **Key Features:**\n * - **Debouncing**: Delays onChange calls until user stops typing\n * - **Generic type support**: Works with any data type (strings, numbers, arrays, objects)\n * - **Immediate value updates**: UI stays responsive during debouncing\n * - **Blur flushing**: Immediately applies pending changes on blur\n *\n * **Note:** Value transformations should be handled at the `useUniformField` level,\n * not in this hook. This hook only handles debouncing timing.\n *\n * @param options Configuration for debounced value handling\n * @param options.debounceDelay Delay in milliseconds (default: 300)\n * @param options.onBlur Function to call after flushing debounced value\n * @param options.onChange Function to call with debounced value\n * @param options.value The field value\n * @returns Object containing enhanced onChange, onBlur, and immediate value\n *\n * @example\n * Basic usage with debouncing:\n * ```tsx\n * const { onChange, onBlur, value } = useInputValueDebounce({\n * debounceDelay: 300,\n * onBlur: field.onBlur,\n * onChange: field.onChange,\n * value: field.value,\n * });\n * ```\n */\nexport const useInputValueDebounce = <TValue = unknown>({\n debounceDelay = 300,\n onBlur,\n onChange,\n value,\n}: UseInputValueDebounceOptions<TValue>): UseInputValueDebounceReturn<TValue> => {\n // Track value for synchronous updates\n const [currentValue, setCurrentValue] = useState<TValue>(value);\n\n const timeoutRef = useRef<NodeJS.Timeout | null>(null);\n\n // Sync with external value changes\n useEffect(() => {\n setCurrentValue(value);\n }, [value]);\n\n // Enhanced onChange handler with debouncing\n const handleChange = useCallback(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (...event: any[]) => {\n // Extract the raw value\n const newValue = (event[0]?.target?.value ?? event[0]) as TValue;\n setCurrentValue(newValue);\n\n // Clear existing timeout\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n\n const executeOnChange = () => {\n // Preserve event structure if original was an event\n if (event[0]?.target) {\n const convertedEvent = {\n ...event[0],\n target: {\n ...event[0].target,\n value: newValue,\n },\n };\n onChange(convertedEvent, ...event.slice(1));\n } else {\n onChange(newValue);\n }\n };\n\n // Execute immediately or after delay\n if (debounceDelay <= 0) {\n executeOnChange();\n } else {\n timeoutRef.current = setTimeout(executeOnChange, debounceDelay);\n }\n },\n [onChange, debounceDelay],\n );\n\n // Enhanced blur handler\n const handleBlur = useCallback(() => {\n // Flush pending changes\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = null;\n onChange(currentValue);\n }\n onBlur();\n }, [onChange, onBlur, currentValue]);\n\n return {\n onChange: handleChange,\n onBlur: handleBlur,\n value: currentValue,\n };\n};\n","/* v8 ignore start */\n\nexport * from './useInputValueDebounce';\n\n/* v8 ignore stop */\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0DA,MAAa,yBAA2C,EACtD,gBAAgB,KAChB,QACA,UACA,YAC+E;CAE/E,MAAM,CAAC,cAAc,mBAAmB,SAAiB,MAAM;CAE/D,MAAM,aAAa,OAA8B,KAAK;AAGtD,iBAAgB;AACd,kBAAgB,MAAM;IACrB,CAAC,MAAM,CAAC;AAoDX,QAAO;EACL,UAlDmB,aAElB,GAAG,UAAiB;GAEnB,MAAM,WAAY,MAAM,IAAI,QAAQ,SAAS,MAAM;AACnD,mBAAgB,SAAS;AAGzB,OAAI,WAAW,QACb,cAAa,WAAW,QAAQ;GAGlC,MAAM,wBAAwB;AAE5B,QAAI,MAAM,IAAI,OAQZ,UAPuB;KACrB,GAAG,MAAM;KACT,QAAQ;MACN,GAAG,MAAM,GAAG;MACZ,OAAO;MACR;KACF,EACwB,GAAG,MAAM,MAAM,EAAE,CAAC;QAE3C,UAAS,SAAS;;AAKtB,OAAI,iBAAiB,EACnB,kBAAiB;OAEjB,YAAW,UAAU,WAAW,iBAAiB,cAAc;KAGnE,CAAC,UAAU,cAAc,CAC1B;EAeC,QAZiB,kBAAkB;AAEnC,OAAI,WAAW,SAAS;AACtB,iBAAa,WAAW,QAAQ;AAChC,eAAW,UAAU;AACrB,aAAS,aAAa;;AAExB,WAAQ;KACP;GAAC;GAAU;GAAQ;GAAa,CAAC;EAKlC,OAAO;EACR"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useInputValueDebounce-DoRuSF6R.d.ts","names":[],"sources":["../src/hooks/useInputValueDebounce/useInputValueDebounce.ts"],"sourcesContent":[],"mappings":";UAEiB;EAAA;EAYA,aAAA,CAAA,EAAA,MAAA;EA4CJ;EAA2C,MAAA,EAAA,GAAA,GAAA,IAAA;EAAA;EAAA,QAAA,EAAA,CAAA,GAAA,KAAA,EAAA,GAAA,EAAA,EAAA,GAAA,IAAA;EAAA;EAKxB,KAAA,EApDvB,MAoDuB;;AAAsC,UAjDrD,2BAiDqD,CAAA,SAAA,OAAA,CAAA,CAAA;EAA5B;EAA2B,QAAA,EAAA,CAAA,GAAA,KAAA,EAAA,GAAA,EAAA,EAAA,GAAA,IAAA;;;;SA1C5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAqCI;;;;;GAKV,6BAA6B,YAAU,4BAA4B"}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useUniformField-Bj23Kvbs.cjs","names":["useFormContext","useController","useInputValueTransform","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,sDAA+B,SAAS,QAAQ;AAGtD,oDAAuB,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,MAAM,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,sDAClC;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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useUniformField-gU4qYUwL.js","names":["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,mBAAmB,YAAY,SAAS,QAAQ;AAGtD,KAAI,mBAAmB,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,eACE,gBAA8B;CAElC,MAAM,EACJ,OACA,SAAS,YACT,SACA,WACA,UACA,WACE,cAAc,MAAM,eAAe;CAEvC,MAAM,EAAE,UAAU,cAA4B;EAC5C;EACA;EACA;EACD,CAAC;CACF,MAAM,EACJ,UAAU,eACV,OAAO,YACP,UAAU,YACV,QACA,QACE;CAIJ,MAAM,EAAE,gBAAgB,gBAAgB,uBAAiC;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,MAAM,YACJ,CAAC,CAAC,SAAS,uBACT,4CACG,UAAU,QAAQ,QAAQ,MAC1B,uBACC,oBAACA,iCAA8B,SAAU,GACvC,QACH,GACD;CAIN,MAAM,eAAe,oBAACC;EAA4B;EAAe;GAAU;CAK3E,MAAM,EAAE,sBAAsB,eAAe,0BAC3C,SAAS;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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useUniformFieldArray-B5PyxL1P.js","names":["useRHFFieldArray","useFormContext"],"sources":["../src/hooks/useUniformFieldArray/useUniformFieldArray.ts","../src/hooks/useUniformFieldArray/index.ts"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { ArrayPath, FieldValues, Path } from 'react-hook-form';\n\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport { useFieldArray as useRHFFieldArray } from 'react-hook-form';\n\nimport { useReducedMotion } from '@fuf-stack/pixel-motion';\n\nimport { flatArrayKey } from '../../helpers';\nimport { useFormContext } from '../useFormContext';\nimport { useUniformField } from '../useUniformField';\n\nexport interface UseUniformFieldArrayProps<\n TFieldValues extends FieldValues = FieldValues,\n> {\n /** Field name for the array */\n name: ArrayPath<TFieldValues>;\n /** Whether this is a flat array (array of primitives) */\n flat?: boolean;\n /** Initial value for new array elements */\n elementInitialValue?: unknown;\n /** Whether the last element cannot be removed (always maintain at least one element) */\n lastElementNotRemovable?: boolean;\n /** Disable the field */\n disabled?: boolean;\n /** Optional explicit test id used to build stable test ids */\n testId?: string;\n /** Optional label content */\n label?: ReactNode;\n}\n\n/**\n * Enhanced useFieldArray hook with initialization and animation logic.\n * Based on React Hook Form's useFieldArray with additional features:\n * - Automatic initialization when lastElementNotRemovable is set\n * - Animation control (disabled during initialization)\n * - Support for flat arrays (arrays of primitives)\n *\n * Note: Automatic validation triggering on length change is disabled to prevent\n * triggering form-wide validation. Array validation still runs on form submission.\n *\n * @see https://react-hook-form.com/docs/usefieldarray\n */\nexport const useUniformFieldArray = <\n TFieldValues extends FieldValues = FieldValues,\n>({\n name,\n flat = false,\n elementInitialValue: _elementInitialValue = null,\n lastElementNotRemovable = false,\n disabled,\n testId: explicitTestId,\n label,\n}: UseUniformFieldArrayProps<TFieldValues>) => {\n // Get uniform field state and utilities\n const uniformField = useUniformField<TFieldValues>({\n name: name as Path<TFieldValues> & string,\n disabled,\n testId: explicitTestId,\n label,\n });\n\n const { control } = uniformField;\n\n const { fields, append, remove, insert, move } = useRHFFieldArray({\n control,\n name,\n });\n\n const { trigger, setValue } = useFormContext<TFieldValues>();\n\n // Determine if initialization is needed (initially or after reset).\n // This flag automatically handles both scenarios:\n // - Initial mount: fields.length starts at 0\n // - Form reset: fields.length becomes 0 again\n // Additional initialization conditions can be added here later (e.g., minElements > 0)\n // Using useMemo ensures this value is properly tracked by React and effects can depend on it\n const needsInitialize = useMemo(() => {\n return lastElementNotRemovable && fields.length === 0;\n }, [lastElementNotRemovable, fields.length]);\n\n // Track whether initialization has completed. Initialized contextually:\n // - If initialization IS needed (needsInitialize = true): starts as false, set to true after init\n // - If initialization is NOT needed (needsInitialize = false): starts as true (already initialized)\n // This ref is used to:\n // 1. Skip validation during initialization/re-initialization\n // 2. Gate animation enabling until after initialization\n // 3. Gate motion preference effect until after initialization\n const hasInitialized = useRef(!needsInitialize);\n\n // Reset initialization flag when needsInitialize changes to true.\n // This handles form reset: when fields become empty (needsInitialize becomes true),\n // hasInitialized is reset to false, triggering re-initialization in the effect below.\n useEffect(() => {\n if (needsInitialize) {\n hasInitialized.current = false;\n }\n }, [needsInitialize]);\n\n // Validate array-level constraints (min/max items) when length changes.\n // Skip validation during initialization/re-initialization to avoid showing errors prematurely.\n useEffect(() => {\n if (hasInitialized.current) {\n setTimeout(() => {\n // Trigger validation so min/max errors appear instantly when user adds/removes items\n trigger(name as Path<TFieldValues>);\n }, 200);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [fields.length]);\n\n // Animation control: Start with animations disabled to prevent animating in initial elements.\n // Will be enabled after initialization completes (unless user prefers reduced motion).\n const [disableAnimation, setDisableAnimation] = useState(true);\n\n // Respond to user's motion preference changes (after initialization).\n // During initialization, animations stay disabled regardless of preference.\n const prefersReducedMotion = useReducedMotion();\n useEffect(() => {\n if (hasInitialized.current) {\n setDisableAnimation(!!prefersReducedMotion);\n }\n }, [prefersReducedMotion]);\n\n // Prepare initial element value based on mode\n // - flat=true: arrays of primitives → object with flatArrayKey and null value by default\n // - flat=false: arrays of objects → empty object by default\n const elementInitialValue = useMemo(() => {\n return flat\n ? { [flatArrayKey]: _elementInitialValue ?? null }\n : (_elementInitialValue ?? {});\n }, [flat, _elementInitialValue]);\n\n // Initialization/Re-initialization: Add initial element when needed.\n // This handles both initial mount and form reset scenarios by reacting to needsInitialize.\n // CRITICAL: This effect MUST be the LAST hook in this component.\n // It sets hasInitialized.current = true, which acts as a gate for other effects.\n // If this runs before other effects, hasInitialized will be true during their first run,\n // causing them to execute logic meant only for post-initialization (e.g., validation,\n // animation enabling). By placing this last, all other effects run first with\n // hasInitialized = false, allowing them to skip initialization-phase logic.\n useEffect(\n () => {\n if (needsInitialize) {\n // use setValue instead of append to avoid focusing the added element\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setValue(name as Path<TFieldValues>, [elementInitialValue] as any, {\n shouldDirty: false,\n shouldTouch: false,\n });\n\n // Mark initialization as complete\n hasInitialized.current = true;\n\n // Enable animations after a brief delay (unless user prefers reduced motion or animations are already enabled).\n // This only runs on initial mount when animations start disabled.\n // On reset, disableAnimation is typically false, so this setTimeout won't run and animations stay enabled.\n if (!prefersReducedMotion && disableAnimation) {\n setTimeout(() => {\n setDisableAnimation(false);\n }, 1);\n }\n }\n },\n // Run when needsInitialize changes (initial mount or reset)\n // needsInitialize is memoized based on fields.length and lastElementNotRemovable\n // Other dependencies are intentionally omitted:\n // - append, setValue, trigger, setDisableAnimation are stable refs/functions\n // - elementInitialValue, name, flat, prefersReducedMotion, disableAnimation are props/stable values\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [needsInitialize],\n );\n\n return {\n // Field array methods and state\n fields,\n append,\n remove,\n insert,\n move,\n disableAnimation,\n elementInitialValue,\n // Uniform field state and utilities (spread all)\n ...uniformField,\n };\n};\n","/* v8 ignore start */\n\nexport * from './useUniformFieldArray';\n\n/* v8 ignore stop */\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2CA,MAAa,wBAEX,EACA,MACA,OAAO,OACP,qBAAqB,uBAAuB,MAC5C,0BAA0B,OAC1B,UACA,QAAQ,gBACR,YAC6C;CAE7C,MAAM,eAAe,gBAA8B;EAC3C;EACN;EACA,QAAQ;EACR;EACD,CAAC;CAEF,MAAM,EAAE,YAAY;CAEpB,MAAM,EAAE,QAAQ,QAAQ,QAAQ,QAAQ,SAASA,cAAiB;EAChE;EACA;EACD,CAAC;CAEF,MAAM,EAAE,SAAS,aAAaC,kBAA8B;CAQ5D,MAAM,kBAAkB,cAAc;AACpC,SAAO,2BAA2B,OAAO,WAAW;IACnD,CAAC,yBAAyB,OAAO,OAAO,CAAC;CAS5C,MAAM,iBAAiB,OAAO,CAAC,gBAAgB;AAK/C,iBAAgB;AACd,MAAI,gBACF,gBAAe,UAAU;IAE1B,CAAC,gBAAgB,CAAC;AAIrB,iBAAgB;AACd,MAAI,eAAe,QACjB,kBAAiB;AAEf,WAAQ,KAA2B;KAClC,IAAI;IAGR,CAAC,OAAO,OAAO,CAAC;CAInB,MAAM,CAAC,kBAAkB,uBAAuB,SAAS,KAAK;CAI9D,MAAM,uBAAuB,kBAAkB;AAC/C,iBAAgB;AACd,MAAI,eAAe,QACjB,qBAAoB,CAAC,CAAC,qBAAqB;IAE5C,CAAC,qBAAqB,CAAC;CAK1B,MAAM,sBAAsB,cAAc;AACxC,SAAO,OACH,GAAG,eAAe,wBAAwB,MAAM,GAC/C,wBAAwB,EAAE;IAC9B,CAAC,MAAM,qBAAqB,CAAC;AAUhC,iBACQ;AACJ,MAAI,iBAAiB;AAGnB,YAAS,MAA4B,CAAC,oBAAoB,EAAS;IACjE,aAAa;IACb,aAAa;IACd,CAAC;AAGF,kBAAe,UAAU;AAKzB,OAAI,CAAC,wBAAwB,iBAC3B,kBAAiB;AACf,wBAAoB,MAAM;MACzB,EAAE;;IAUX,CAAC,gBAAgB,CAClB;AAED,QAAO;EAEL;EACA;EACA;EACA;EACA;EACA;EACA;EAEA,GAAG;EACJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useUniformFieldArray-CXoWvu6m.d.ts","names":[],"sources":["../src/hooks/useUniformFieldArray/useUniformFieldArray.ts"],"sourcesContent":[],"mappings":";;;;;;;;UAYiB,+CACM,cAAc;;QAG7B,UAAU;;;EAJD;EACM,mBAAA,CAAA,EAAA,OAAA;EAAc;EAGnB,uBAAA,CAAA,EAAA,OAAA;EAAV;EAYE,QAAA,CAAA,EAAA,OAAA;EAAS;EAeN,MAAA,CAAA,EAAA,MAAA;EACU;EAAc,KAAA,CAAA,EAhB3B,SAgB2B;;;;;;;;;;;;;;cADxB,4CACU,cAAc;;;uBACnC;;;UAAA;;GAQC,0BAA0B;;;;;;;;;;;;;;;;;EA0DF,KAAA,WAAA,GAAA,IAAA;EAAA,MAAA,EAAA,UAAA,CAAA,sBAAA,CAAA,CAAA,OAAA,CAAA,CAAA,QAAA,CAAA;EACiD,QAAA,EAAA,UAAA,CAAA,OADjD,eACiD,CAAA,CAAA,OAAA,CAAA,CAAA,UAAA,CAAA;EAAA,GAAA,EAGnC,UAHmC,CAAA,OAAA,eAAA,CAAA,CAAA,OAAA,CAAA,CAAA,KAAA,CAAA;EAGnC,QAAA,EAAA,OAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useUniformFieldArray-G1lokW7x.cjs","names":["useUniformField","useFormContext","flatArrayKey"],"sources":["../src/hooks/useUniformFieldArray/useUniformFieldArray.ts","../src/hooks/useUniformFieldArray/index.ts"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { ArrayPath, FieldValues, Path } from 'react-hook-form';\n\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport { useFieldArray as useRHFFieldArray } from 'react-hook-form';\n\nimport { useReducedMotion } from '@fuf-stack/pixel-motion';\n\nimport { flatArrayKey } from '../../helpers';\nimport { useFormContext } from '../useFormContext';\nimport { useUniformField } from '../useUniformField';\n\nexport interface UseUniformFieldArrayProps<\n TFieldValues extends FieldValues = FieldValues,\n> {\n /** Field name for the array */\n name: ArrayPath<TFieldValues>;\n /** Whether this is a flat array (array of primitives) */\n flat?: boolean;\n /** Initial value for new array elements */\n elementInitialValue?: unknown;\n /** Whether the last element cannot be removed (always maintain at least one element) */\n lastElementNotRemovable?: boolean;\n /** Disable the field */\n disabled?: boolean;\n /** Optional explicit test id used to build stable test ids */\n testId?: string;\n /** Optional label content */\n label?: ReactNode;\n}\n\n/**\n * Enhanced useFieldArray hook with initialization and animation logic.\n * Based on React Hook Form's useFieldArray with additional features:\n * - Automatic initialization when lastElementNotRemovable is set\n * - Animation control (disabled during initialization)\n * - Support for flat arrays (arrays of primitives)\n *\n * Note: Automatic validation triggering on length change is disabled to prevent\n * triggering form-wide validation. Array validation still runs on form submission.\n *\n * @see https://react-hook-form.com/docs/usefieldarray\n */\nexport const useUniformFieldArray = <\n TFieldValues extends FieldValues = FieldValues,\n>({\n name,\n flat = false,\n elementInitialValue: _elementInitialValue = null,\n lastElementNotRemovable = false,\n disabled,\n testId: explicitTestId,\n label,\n}: UseUniformFieldArrayProps<TFieldValues>) => {\n // Get uniform field state and utilities\n const uniformField = useUniformField<TFieldValues>({\n name: name as Path<TFieldValues> & string,\n disabled,\n testId: explicitTestId,\n label,\n });\n\n const { control } = uniformField;\n\n const { fields, append, remove, insert, move } = useRHFFieldArray({\n control,\n name,\n });\n\n const { trigger, setValue } = useFormContext<TFieldValues>();\n\n // Determine if initialization is needed (initially or after reset).\n // This flag automatically handles both scenarios:\n // - Initial mount: fields.length starts at 0\n // - Form reset: fields.length becomes 0 again\n // Additional initialization conditions can be added here later (e.g., minElements > 0)\n // Using useMemo ensures this value is properly tracked by React and effects can depend on it\n const needsInitialize = useMemo(() => {\n return lastElementNotRemovable && fields.length === 0;\n }, [lastElementNotRemovable, fields.length]);\n\n // Track whether initialization has completed. Initialized contextually:\n // - If initialization IS needed (needsInitialize = true): starts as false, set to true after init\n // - If initialization is NOT needed (needsInitialize = false): starts as true (already initialized)\n // This ref is used to:\n // 1. Skip validation during initialization/re-initialization\n // 2. Gate animation enabling until after initialization\n // 3. Gate motion preference effect until after initialization\n const hasInitialized = useRef(!needsInitialize);\n\n // Reset initialization flag when needsInitialize changes to true.\n // This handles form reset: when fields become empty (needsInitialize becomes true),\n // hasInitialized is reset to false, triggering re-initialization in the effect below.\n useEffect(() => {\n if (needsInitialize) {\n hasInitialized.current = false;\n }\n }, [needsInitialize]);\n\n // Validate array-level constraints (min/max items) when length changes.\n // Skip validation during initialization/re-initialization to avoid showing errors prematurely.\n useEffect(() => {\n if (hasInitialized.current) {\n setTimeout(() => {\n // Trigger validation so min/max errors appear instantly when user adds/removes items\n trigger(name as Path<TFieldValues>);\n }, 200);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [fields.length]);\n\n // Animation control: Start with animations disabled to prevent animating in initial elements.\n // Will be enabled after initialization completes (unless user prefers reduced motion).\n const [disableAnimation, setDisableAnimation] = useState(true);\n\n // Respond to user's motion preference changes (after initialization).\n // During initialization, animations stay disabled regardless of preference.\n const prefersReducedMotion = useReducedMotion();\n useEffect(() => {\n if (hasInitialized.current) {\n setDisableAnimation(!!prefersReducedMotion);\n }\n }, [prefersReducedMotion]);\n\n // Prepare initial element value based on mode\n // - flat=true: arrays of primitives → object with flatArrayKey and null value by default\n // - flat=false: arrays of objects → empty object by default\n const elementInitialValue = useMemo(() => {\n return flat\n ? { [flatArrayKey]: _elementInitialValue ?? null }\n : (_elementInitialValue ?? {});\n }, [flat, _elementInitialValue]);\n\n // Initialization/Re-initialization: Add initial element when needed.\n // This handles both initial mount and form reset scenarios by reacting to needsInitialize.\n // CRITICAL: This effect MUST be the LAST hook in this component.\n // It sets hasInitialized.current = true, which acts as a gate for other effects.\n // If this runs before other effects, hasInitialized will be true during their first run,\n // causing them to execute logic meant only for post-initialization (e.g., validation,\n // animation enabling). By placing this last, all other effects run first with\n // hasInitialized = false, allowing them to skip initialization-phase logic.\n useEffect(\n () => {\n if (needsInitialize) {\n // use setValue instead of append to avoid focusing the added element\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setValue(name as Path<TFieldValues>, [elementInitialValue] as any, {\n shouldDirty: false,\n shouldTouch: false,\n });\n\n // Mark initialization as complete\n hasInitialized.current = true;\n\n // Enable animations after a brief delay (unless user prefers reduced motion or animations are already enabled).\n // This only runs on initial mount when animations start disabled.\n // On reset, disableAnimation is typically false, so this setTimeout won't run and animations stay enabled.\n if (!prefersReducedMotion && disableAnimation) {\n setTimeout(() => {\n setDisableAnimation(false);\n }, 1);\n }\n }\n },\n // Run when needsInitialize changes (initial mount or reset)\n // needsInitialize is memoized based on fields.length and lastElementNotRemovable\n // Other dependencies are intentionally omitted:\n // - append, setValue, trigger, setDisableAnimation are stable refs/functions\n // - elementInitialValue, name, flat, prefersReducedMotion, disableAnimation are props/stable values\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [needsInitialize],\n );\n\n return {\n // Field array methods and state\n fields,\n append,\n remove,\n insert,\n move,\n disableAnimation,\n elementInitialValue,\n // Uniform field state and utilities (spread all)\n ...uniformField,\n };\n};\n","/* v8 ignore start */\n\nexport * from './useUniformFieldArray';\n\n/* v8 ignore stop */\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA2CA,MAAa,wBAEX,EACA,MACA,OAAO,OACP,qBAAqB,uBAAuB,MAC5C,0BAA0B,OAC1B,UACA,QAAQ,gBACR,YAC6C;CAE7C,MAAM,eAAeA,wCAA8B;EAC3C;EACN;EACA,QAAQ;EACR;EACD,CAAC;CAEF,MAAM,EAAE,YAAY;CAEpB,MAAM,EAAE,QAAQ,QAAQ,QAAQ,QAAQ,4CAA0B;EAChE;EACA;EACD,CAAC;CAEF,MAAM,EAAE,SAAS,aAAaC,uCAA8B;CAQ5D,MAAM,2CAAgC;AACpC,SAAO,2BAA2B,OAAO,WAAW;IACnD,CAAC,yBAAyB,OAAO,OAAO,CAAC;CAS5C,MAAM,mCAAwB,CAAC,gBAAgB;AAK/C,4BAAgB;AACd,MAAI,gBACF,gBAAe,UAAU;IAE1B,CAAC,gBAAgB,CAAC;AAIrB,4BAAgB;AACd,MAAI,eAAe,QACjB,kBAAiB;AAEf,WAAQ,KAA2B;KAClC,IAAI;IAGR,CAAC,OAAO,OAAO,CAAC;CAInB,MAAM,CAAC,kBAAkB,2CAAgC,KAAK;CAI9D,MAAM,sEAAyC;AAC/C,4BAAgB;AACd,MAAI,eAAe,QACjB,qBAAoB,CAAC,CAAC,qBAAqB;IAE5C,CAAC,qBAAqB,CAAC;CAK1B,MAAM,+CAAoC;AACxC,SAAO,OACH,GAAGC,+BAAe,wBAAwB,MAAM,GAC/C,wBAAwB,EAAE;IAC9B,CAAC,MAAM,qBAAqB,CAAC;AAUhC,4BACQ;AACJ,MAAI,iBAAiB;AAGnB,YAAS,MAA4B,CAAC,oBAAoB,EAAS;IACjE,aAAa;IACb,aAAa;IACd,CAAC;AAGF,kBAAe,UAAU;AAKzB,OAAI,CAAC,wBAAwB,iBAC3B,kBAAiB;AACf,wBAAoB,MAAM;MACzB,EAAE;;IAUX,CAAC,gBAAgB,CAClB;AAED,QAAO;EAEL;EACA;EACA;EACA;EACA;EACA;EACA;EAEA,GAAG;EACJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useUniformFieldArray-qtJMEosJ.d.cts","names":[],"sources":["../src/hooks/useUniformFieldArray/useUniformFieldArray.ts"],"sourcesContent":[],"mappings":";;;;;;;;UAYiB,+CACM,cAAc;;QAG7B,UAAU;;;EAJD;EACM,mBAAA,CAAA,EAAA,OAAA;EAAc;EAGnB,uBAAA,CAAA,EAAA,OAAA;EAAV;EAYE,QAAA,CAAA,EAAA,OAAA;EAAS;EAeN,MAAA,CAAA,EAAA,MAAA;EACU;EAAc,KAAA,CAAA,EAhB3B,SAgB2B;;;;;;;;;;;;;;cADxB,4CACU,cAAc;;;uBACnC;;;UAAA;;GAQC,0BAA0B;;;;;;;;;;;;;;;;;EA0DF,KAAA,WAAA,GAAA,IAAA;EAAA,MAAA,EAAA,UAAA,CAAA,oBAAA,CAAA,CAAA,OAAA,CAAA,CAAA,QAAA,CAAA;EACiD,QAAA,EAAA,UAAA,CAAA,OADjD,aACiD,CAAA,CAAA,OAAA,CAAA,CAAA,UAAA,CAAA;EAAA,GAAA,EAGnC,UAHmC,CAAA,OAAA,aAAA,CAAA,CAAA,OAAA,CAAA,CAAA,KAAA,CAAA;EAGnC,QAAA,EAAA,OAAA"}
|