@fuf-stack/uniform 1.18.3 → 1.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Checkboxes/index.cjs +7 -5
- package/dist/Checkboxes/index.d.cts +1 -1
- package/dist/Checkboxes/index.d.ts +1 -1
- package/dist/Checkboxes/index.js +2 -3
- package/dist/{Checkboxes-BGrK_mwQ.js → Checkboxes-D1hppxDE.js} +7 -10
- package/dist/Checkboxes-D1hppxDE.js.map +1 -0
- package/dist/{Checkboxes-Dk7yyRVR.cjs → Checkboxes-DegQ22uN.cjs} +18 -21
- package/dist/Checkboxes-DegQ22uN.cjs.map +1 -0
- package/dist/FieldArray/index.cjs +7 -5
- package/dist/FieldArray/index.d.cts +1 -1
- package/dist/FieldArray/index.d.ts +1 -1
- package/dist/FieldArray/index.js +2 -3
- package/dist/{FieldArray-Bs2ViU8m.js → FieldArray-BVL5Tz0Q.js} +51 -71
- package/dist/FieldArray-BVL5Tz0Q.js.map +1 -0
- package/dist/{FieldArray-C6RHZcKa.cjs → FieldArray-CeiNCobX.cjs} +66 -86
- package/dist/FieldArray-CeiNCobX.cjs.map +1 -0
- package/dist/FieldCard/index.cjs +4 -4
- package/dist/FieldCard/index.d.cts +1 -1
- package/dist/FieldCard/index.d.ts +1 -1
- package/dist/FieldCard/index.js +2 -3
- package/dist/{FieldCard-BxK_IJOR.cjs → FieldCard-C0kNSLj7.cjs} +20 -24
- package/dist/FieldCard-C0kNSLj7.cjs.map +1 -0
- package/dist/{FieldCard-16yCF83m.js → FieldCard-SjYNs4sL.js} +8 -12
- package/dist/FieldCard-SjYNs4sL.js.map +1 -0
- package/dist/{FieldCopyTestIdButton-BoEdlzLs.js → FieldCopyTestIdButton-Dpmo0uBV.js} +4 -7
- package/dist/FieldCopyTestIdButton-Dpmo0uBV.js.map +1 -0
- package/dist/{FieldCopyTestIdButton-4uupFq1U.cjs → FieldCopyTestIdButton-DrUzXwTo.cjs} +14 -17
- package/dist/FieldCopyTestIdButton-DrUzXwTo.cjs.map +1 -0
- package/dist/{FieldValidationError-Br6iopZj.cjs → FieldValidationError-8H8LxDjk.cjs} +14 -17
- package/dist/FieldValidationError-8H8LxDjk.cjs.map +1 -0
- package/dist/{FieldValidationError-XQaViV52.js → FieldValidationError-ktTyyyip.js} +4 -7
- package/dist/FieldValidationError-ktTyyyip.js.map +1 -0
- package/dist/Form/index.cjs +7 -5
- package/dist/Form/index.d.cts +1 -1
- package/dist/Form/index.d.ts +1 -2
- package/dist/Form/index.js +2 -3
- package/dist/{Form--SsSvsxl.cjs → Form-Dqa1b7Y7.cjs} +17 -22
- package/dist/Form-Dqa1b7Y7.cjs.map +1 -0
- package/dist/{Form-ccsEssie.js → Form-Wzy7pBVt.js} +8 -13
- package/dist/Form-Wzy7pBVt.js.map +1 -0
- package/dist/{FormContext-CCe8drkp.d.ts → FormContext-B4KQxdl7.d.ts} +1 -1
- package/dist/{FormContext-CCe8drkp.d.ts.map → FormContext-B4KQxdl7.d.ts.map} +1 -1
- package/dist/{FormContext-BSLO2-sO.cjs → FormContext-BrY1FQYR.cjs} +29 -37
- package/dist/{FormContext-BSLO2-sO.cjs.map → FormContext-BrY1FQYR.cjs.map} +1 -1
- package/dist/{FormContext-RSA21aDt.d.cts → FormContext-BuG3xZFe.d.cts} +1 -1
- package/dist/{FormContext-RSA21aDt.d.cts.map → FormContext-BuG3xZFe.d.cts.map} +1 -1
- package/dist/{FormContext-kE3YKhp_.js → FormContext-CLfMWHQM.js} +4 -7
- package/dist/{FormContext-kE3YKhp_.js.map → FormContext-CLfMWHQM.js.map} +1 -1
- package/dist/Grid/index.cjs +7 -5
- package/dist/Grid/index.d.cts +1 -1
- package/dist/Grid/index.d.ts +1 -1
- package/dist/Grid/index.js +2 -3
- package/dist/{Grid-BaqBa1ku.js → Grid-Bzyi97Cx.js} +4 -7
- package/dist/Grid-Bzyi97Cx.js.map +1 -0
- package/dist/{Grid-D5Yf0nD_.cjs → Grid-DdYQQ_UM.cjs} +14 -17
- package/dist/Grid-DdYQQ_UM.cjs.map +1 -0
- package/dist/Input/index.cjs +7 -5
- package/dist/Input/index.d.cts +1 -1
- package/dist/Input/index.d.ts +1 -1
- package/dist/Input/index.js +2 -3
- package/dist/{Input-BCs_eyJ9.js → Input-BDWP4hOr.js} +6 -9
- package/dist/{Input-BCs_eyJ9.js.map → Input-BDWP4hOr.js.map} +1 -1
- package/dist/{Input-B3p_4ntD.cjs → Input-BXJ4DSha.cjs} +18 -21
- package/dist/Input-BXJ4DSha.cjs.map +1 -0
- package/dist/RadioBoxes/index.cjs +7 -5
- package/dist/RadioBoxes/index.d.cts +1 -1
- package/dist/RadioBoxes/index.d.ts +1 -1
- package/dist/RadioBoxes/index.js +2 -3
- package/dist/{RadioBoxes-C3Cwrn2I.js → RadioBoxes-BR3X986V.js} +16 -23
- package/dist/RadioBoxes-BR3X986V.js.map +1 -0
- package/dist/{RadioBoxes-xRvNe5U8.cjs → RadioBoxes-Cim3InDW.cjs} +33 -40
- package/dist/RadioBoxes-Cim3InDW.cjs.map +1 -0
- package/dist/RadioTabs/index.cjs +7 -5
- package/dist/RadioTabs/index.d.cts +1 -1
- package/dist/RadioTabs/index.d.ts +1 -1
- package/dist/RadioTabs/index.js +2 -3
- package/dist/{RadioTabs-DfOGIsEf.js → RadioTabs-CsVqYCE9.js} +6 -9
- package/dist/RadioTabs-CsVqYCE9.js.map +1 -0
- package/dist/{RadioTabs-BaHvYcd-.cjs → RadioTabs-t-x2XnuI.cjs} +18 -21
- package/dist/RadioTabs-t-x2XnuI.cjs.map +1 -0
- package/dist/Radios/index.cjs +7 -5
- package/dist/Radios/index.d.cts +1 -1
- package/dist/Radios/index.d.ts +1 -1
- package/dist/Radios/index.js +2 -3
- package/dist/{Radios-xM-09vB5.js → Radios-CYwW3bZa.js} +13 -19
- package/dist/Radios-CYwW3bZa.js.map +1 -0
- package/dist/{Radios-BfA3uL35.cjs → Radios-CjEFdyD6.cjs} +25 -31
- package/dist/Radios-CjEFdyD6.cjs.map +1 -0
- package/dist/Select/index.cjs +7 -5
- package/dist/Select/index.d.cts +1 -1
- package/dist/Select/index.d.ts +1 -1
- package/dist/Select/index.js +2 -3
- package/dist/{Select-DH_YaruM.cjs → Select-BEed8xan.cjs} +23 -28
- package/dist/Select-BEed8xan.cjs.map +1 -0
- package/dist/{Select-DlEUzYl6.js → Select-BILyyM7Z.js} +9 -14
- package/dist/Select-BILyyM7Z.js.map +1 -0
- package/dist/Slider/index.cjs +7 -5
- package/dist/Slider/index.d.cts +1 -1
- package/dist/Slider/index.d.ts +1 -1
- package/dist/Slider/index.js +2 -3
- package/dist/{Slider-C-dMrJZ6.cjs → Slider-CFYP86ku.cjs} +16 -19
- package/dist/Slider-CFYP86ku.cjs.map +1 -0
- package/dist/{Slider-CTFuVrp2.js → Slider-DxRcLu-j.js} +5 -8
- package/dist/{Slider-CTFuVrp2.js.map → Slider-DxRcLu-j.js.map} +1 -1
- package/dist/SubmitButton/index.cjs +7 -5
- package/dist/SubmitButton/index.d.cts +1 -1
- package/dist/SubmitButton/index.d.ts +1 -1
- package/dist/SubmitButton/index.js +2 -3
- package/dist/{SubmitButton-Bh1RN0F1.js → SubmitButton-Bu3NNFyt.js} +5 -8
- package/dist/SubmitButton-Bu3NNFyt.js.map +1 -0
- package/dist/{SubmitButton-CJ6s1mZr.cjs → SubmitButton-D7xacDyS.cjs} +15 -18
- package/dist/SubmitButton-D7xacDyS.cjs.map +1 -0
- package/dist/Switch/index.cjs +7 -5
- package/dist/Switch/index.d.cts +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/Switch/index.js +2 -3
- package/dist/{Switch-CXrz-M3V.js → Switch-CMpXZdLc.js} +5 -8
- package/dist/{Switch-CXrz-M3V.js.map → Switch-CMpXZdLc.js.map} +1 -1
- package/dist/{Switch-CeUMwheZ.cjs → Switch-Dt9TGQ8d.cjs} +16 -19
- package/dist/Switch-Dt9TGQ8d.cjs.map +1 -0
- package/dist/SwitchBox/index.cjs +7 -5
- package/dist/SwitchBox/index.d.cts +1 -1
- package/dist/SwitchBox/index.d.ts +1 -1
- package/dist/SwitchBox/index.js +2 -3
- package/dist/{SwitchBox-C-aLl2nX.js → SwitchBox-Cg7NPfp_.js} +5 -8
- package/dist/SwitchBox-Cg7NPfp_.js.map +1 -0
- package/dist/{SwitchBox-mGUPvJE0.cjs → SwitchBox-DMPp_Ed-.cjs} +21 -24
- package/dist/SwitchBox-DMPp_Ed-.cjs.map +1 -0
- package/dist/TextArea/index.cjs +7 -5
- package/dist/TextArea/index.d.cts +1 -1
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextArea/index.js +2 -3
- package/dist/{TextArea-BLkVYmHZ.js → TextArea-Bxi2pXvY.js} +6 -9
- package/dist/TextArea-Bxi2pXvY.js.map +1 -0
- package/dist/{TextArea-BYEuk4Ng.cjs → TextArea-DDwzXW-y.cjs} +18 -21
- package/dist/TextArea-DDwzXW-y.cjs.map +1 -0
- package/dist/helpers/index.cjs +397 -10
- package/dist/helpers/index.cjs.map +1 -0
- package/dist/helpers/index.d.cts +224 -2
- package/dist/helpers/index.d.cts.map +1 -0
- package/dist/helpers/index.d.ts +224 -2
- package/dist/helpers/index.d.ts.map +1 -0
- package/dist/helpers/index.js +387 -2
- package/dist/helpers/index.js.map +1 -0
- package/dist/hooks/useClientValidation/index.cjs +3 -3
- package/dist/hooks/useClientValidation/index.d.cts +1 -1
- package/dist/hooks/useClientValidation/index.d.ts +1 -1
- package/dist/hooks/useClientValidation/index.js +2 -3
- package/dist/hooks/useController/index.cjs +3 -3
- package/dist/hooks/useController/index.d.cts +1 -1
- package/dist/hooks/useController/index.d.ts +1 -1
- package/dist/hooks/useController/index.js +2 -3
- package/dist/hooks/useFormContext/index.cjs +8 -3
- package/dist/hooks/useFormContext/index.cjs.map +1 -0
- package/dist/hooks/useFormContext/index.d.cts +1 -1
- package/dist/hooks/useFormContext/index.d.ts +1 -3
- package/dist/hooks/useFormContext/index.js +6 -2
- package/dist/hooks/useFormContext/index.js.map +1 -0
- package/dist/hooks/useInput/index.cjs +8 -8
- package/dist/hooks/useInput/index.d.cts +1 -1
- package/dist/hooks/useInput/index.d.ts +1 -1
- package/dist/hooks/useInput/index.js +2 -3
- package/dist/hooks/useInputValueDebounce/index.cjs +92 -2
- package/dist/hooks/useInputValueDebounce/index.cjs.map +1 -0
- package/dist/hooks/useInputValueDebounce/index.d.cts +1 -1
- package/dist/hooks/useInputValueDebounce/index.d.ts +1 -1
- package/dist/hooks/useInputValueDebounce/index.js +90 -2
- package/dist/hooks/useInputValueDebounce/index.js.map +1 -0
- package/dist/hooks/useInputValueTransform/index.cjs +3 -3
- package/dist/hooks/useInputValueTransform/index.d.cts +1 -1
- package/dist/hooks/useInputValueTransform/index.d.ts +1 -1
- package/dist/hooks/useInputValueTransform/index.js +2 -3
- package/dist/hooks/useUniformField/index.cjs +135 -2
- package/dist/hooks/useUniformField/index.cjs.map +1 -0
- package/dist/hooks/useUniformField/index.d.cts +1 -1
- package/dist/hooks/useUniformField/index.d.ts +1 -5
- package/dist/hooks/useUniformField/index.js +132 -2
- package/dist/hooks/useUniformField/index.js.map +1 -0
- package/dist/hooks/useUniformFieldArray/index.cjs +83 -2
- package/dist/hooks/useUniformFieldArray/index.cjs.map +1 -0
- package/dist/hooks/useUniformFieldArray/index.d.cts +1 -1
- package/dist/hooks/useUniformFieldArray/index.d.ts +1 -26
- package/dist/hooks/useUniformFieldArray/index.js +81 -2
- package/dist/hooks/useUniformFieldArray/index.js.map +1 -0
- package/dist/hooks/useWatchUserChange/index.cjs +3 -3
- package/dist/hooks/useWatchUserChange/index.d.cts +1 -1
- package/dist/hooks/useWatchUserChange/index.d.ts +1 -1
- package/dist/hooks/useWatchUserChange/index.js +2 -3
- package/dist/{index-TmijvCD0.d.ts → index-25CYKzg4.d.cts} +22 -22
- package/dist/index-25CYKzg4.d.cts.map +1 -0
- package/dist/{index-CeiIXmAI.d.cts → index-3e3711-8.d.cts} +36 -36
- package/dist/index-3e3711-8.d.cts.map +1 -0
- package/dist/{index-E6etS7_8.d.ts → index-6hu79Fof.d.ts} +34 -34
- package/dist/index-6hu79Fof.d.ts.map +1 -0
- package/dist/index-AmOFlE3L.d.cts +278 -0
- package/dist/index-AmOFlE3L.d.cts.map +1 -0
- package/dist/{index-wwmQClW-.d.cts → index-B-6CMF1H.d.ts} +21 -21
- package/dist/index-B-6CMF1H.d.ts.map +1 -0
- package/dist/{index-ahxY6Q0X.d.cts → index-B6WwxkLx2.d.ts} +3 -3
- package/dist/index-B6WwxkLx2.d.ts.map +1 -0
- package/dist/{index-BlJFGN_o.d.ts → index-B9lVf5LI.d.ts} +48 -48
- package/dist/index-B9lVf5LI.d.ts.map +1 -0
- package/dist/{index-ttNINAv3.d.ts → index-BV1VKQdy.d.cts} +3 -3
- package/dist/{index-qo0Ta_R3.d.cts.map → index-BV1VKQdy.d.cts.map} +1 -1
- package/dist/{index-C1-F9Ga-.d.cts → index-BdYKQ59a.d.cts} +7 -7
- package/dist/index-BdYKQ59a.d.cts.map +1 -0
- package/dist/{index-Bl1Adhfx.d.ts → index-BwAI1VFS.d.ts} +6 -6
- package/dist/index-BwAI1VFS.d.ts.map +1 -0
- package/dist/{index-BsCPUK2g.d.cts → index-BzIB-MQg.d.cts} +48 -48
- package/dist/index-BzIB-MQg.d.cts.map +1 -0
- package/dist/{index-DFzyOxvt.d.cts → index-C-DiLZRu.d.cts} +6 -6
- package/dist/index-C-DiLZRu.d.cts.map +1 -0
- package/dist/{index-BKQc5PQn.d.cts → index-C9up4f3f.d.cts} +34 -34
- package/dist/index-C9up4f3f.d.cts.map +1 -0
- package/dist/{index-Dty4h2eA.d.ts → index-CE0aQlFw.d.ts} +7 -7
- package/dist/index-CE0aQlFw.d.ts.map +1 -0
- package/dist/{index-BrMk3Wee.d.ts → index-CY2Mpaz3.d.cts} +4 -4
- package/dist/index-CY2Mpaz3.d.cts.map +1 -0
- package/dist/index-CuRn5Thx.d.ts +278 -0
- package/dist/index-CuRn5Thx.d.ts.map +1 -0
- package/dist/{index-qo0Ta_R3.d.cts → index-Cv4ERj3i.d.ts} +3 -3
- package/dist/{index-ttNINAv3.d.ts.map → index-Cv4ERj3i.d.ts.map} +1 -1
- package/dist/{index-ByyEP8UR.d.cts → index-D6XwSwTP.d.cts} +6 -6
- package/dist/{index-ByyEP8UR.d.cts.map → index-D6XwSwTP.d.cts.map} +1 -1
- package/dist/{index-Dr06SNZN.d.cts → index-DD_RPe91.d.ts} +4 -4
- package/dist/index-DD_RPe91.d.ts.map +1 -0
- package/dist/{index-DLR8z1lG.d.cts → index-DFWSHdua.d.ts} +3 -3
- package/dist/{index-CPkTYivq.d.ts.map → index-DFWSHdua.d.ts.map} +1 -1
- package/dist/{index-B0rp5NJy.d.cts → index-DMwNV_Br.d.cts} +35 -36
- package/dist/index-DMwNV_Br.d.cts.map +1 -0
- package/dist/index-DeEmP3Jc.d.cts +1 -0
- package/dist/{index-mmk9VKYu.d.ts → index-DiD7s23-.d.cts} +21 -21
- package/dist/index-DiD7s23-.d.cts.map +1 -0
- package/dist/{index--NM5Ctp6.d.ts → index-Dj3NDj0T.d.ts} +4 -4
- package/dist/{index--NM5Ctp6.d.ts.map → index-Dj3NDj0T.d.ts.map} +1 -1
- package/dist/{index-CPkTYivq.d.ts → index-DkiQkdCW.d.cts} +3 -3
- package/dist/{index-DLR8z1lG.d.cts.map → index-DkiQkdCW.d.cts.map} +1 -1
- package/dist/{index-CI0AWMsR.d.ts → index-DkxqHE_P2.d.ts} +3 -3
- package/dist/{index-B7Xz_OY2.d.cts.map → index-DkxqHE_P2.d.ts.map} +1 -1
- package/dist/{index-B7Xz_OY2.d.cts → index-Dld6NP_K.d.cts} +3 -3
- package/dist/index-Dld6NP_K.d.cts.map +1 -0
- package/dist/{index-CZq5eXSP.d.ts → index-DlebotZ4.d.ts} +36 -36
- package/dist/index-DlebotZ4.d.ts.map +1 -0
- package/dist/index-DsC0y6kU.d.cts +70 -0
- package/dist/index-DsC0y6kU.d.cts.map +1 -0
- package/dist/index-DwqOejxR.d.ts +70 -0
- package/dist/index-DwqOejxR.d.ts.map +1 -0
- package/dist/{index-BaxXDaOZ.d.ts → index-Gs3zrYoY.d.ts} +35 -37
- package/dist/index-Gs3zrYoY.d.ts.map +1 -0
- package/dist/{index-BlX_mF6D.d.cts → index-N5wvPOq3.d.ts} +22 -22
- package/dist/index-N5wvPOq3.d.ts.map +1 -0
- package/dist/{index-BNYtqtXt.d.cts → index-NjKV8LJD.d.cts} +4 -4
- package/dist/{index-BNYtqtXt.d.cts.map → index-NjKV8LJD.d.cts.map} +1 -1
- package/dist/{index-DVZCz730.d.ts → index-fgARdsoB.d.ts} +6 -6
- package/dist/{index-DVZCz730.d.ts.map → index-fgARdsoB.d.ts.map} +1 -1
- package/dist/{index-CMehV9mc.d.ts → index-jCfJAgDc.d.cts} +3 -3
- package/dist/index-jCfJAgDc.d.cts.map +1 -0
- package/dist/{index--KhDRPu3.d.cts → index-pwXVq8hR.d.cts} +6 -6
- package/dist/index-pwXVq8hR.d.cts.map +1 -0
- package/dist/index-sQecLSpR.d.cts +1 -0
- package/dist/{index-BgyvEfYZ.d.ts → index-wV1E_PkS.d.ts} +6 -6
- package/dist/index-wV1E_PkS.d.ts.map +1 -0
- package/dist/index.cjs +63 -63
- package/dist/index.d.cts +27 -27
- package/dist/index.d.ts +27 -29
- package/dist/index.js +29 -30
- package/dist/partials/FieldCopyTestIdButton/index.cjs +7 -5
- package/dist/partials/FieldCopyTestIdButton/index.d.cts +1 -1
- package/dist/partials/FieldCopyTestIdButton/index.d.ts +1 -1
- package/dist/partials/FieldCopyTestIdButton/index.js +2 -3
- package/dist/partials/FieldValidationError/index.cjs +7 -5
- package/dist/partials/FieldValidationError/index.d.cts +1 -1
- package/dist/partials/FieldValidationError/index.d.ts +1 -1
- package/dist/partials/FieldValidationError/index.js +2 -3
- package/dist/{useClientValidation-B4xrGBJZ.d.ts → useClientValidation-BWElhQ91.d.ts} +2 -3
- package/dist/useClientValidation-BWElhQ91.d.ts.map +1 -0
- package/dist/{useClientValidation-DksyV18M.js → useClientValidation-Dn_kJkE5.js} +5 -6
- package/dist/{useClientValidation-DksyV18M.js.map → useClientValidation-Dn_kJkE5.js.map} +1 -1
- package/dist/{useClientValidation-B_dYQB5o.d.cts → useClientValidation-DtnfCE5T.d.cts} +2 -3
- package/dist/{useClientValidation-B4xrGBJZ.d.ts.map → useClientValidation-DtnfCE5T.d.cts.map} +1 -1
- package/dist/{useClientValidation-Dnj_wuwf.cjs → useClientValidation-NKOuXuHV.cjs} +16 -17
- package/dist/useClientValidation-NKOuXuHV.cjs.map +1 -0
- package/dist/{useController-NjuthTyL.js → useController-B-6PzFna.js} +4 -5
- package/dist/{useController-NjuthTyL.js.map → useController-B-6PzFna.js.map} +1 -1
- package/dist/{useController-D8MEXnmB.d.cts → useController-CNiqy_2D.d.cts} +1 -1
- package/dist/{useController-D8MEXnmB.d.cts.map → useController-CNiqy_2D.d.cts.map} +1 -1
- package/dist/{useController-CHOpoCoz.d.ts → useController-Cc0UNQMm.d.ts} +1 -1
- package/dist/{useController-CHOpoCoz.d.ts.map → useController-Cc0UNQMm.d.ts.map} +1 -1
- package/dist/{useController-B_SSp5Z5.cjs → useController-DVRh86Zy.cjs} +11 -12
- package/dist/{useController-B_SSp5Z5.cjs.map → useController-DVRh86Zy.cjs.map} +1 -1
- package/dist/{useFormContext-vdeeDsAs.cjs → useFormContext-Bum4VP1o.cjs} +20 -21
- package/dist/{useFormContext-vdeeDsAs.cjs.map → useFormContext-Bum4VP1o.cjs.map} +1 -1
- package/dist/{useFormContext-Di67HIf7.js → useFormContext-Bzpyonu6.js} +5 -6
- package/dist/{useFormContext-Di67HIf7.js.map → useFormContext-Bzpyonu6.js.map} +1 -1
- package/dist/{useFormContext-C6OOtqZ5.d.ts → useFormContext-DEMm-bsc.d.ts} +22 -22
- package/dist/useFormContext-DEMm-bsc.d.ts.map +1 -0
- package/dist/{useFormContext-Dh97YG47.d.cts → useFormContext-Dey5DbWr.d.cts} +22 -22
- package/dist/useFormContext-Dey5DbWr.d.cts.map +1 -0
- package/dist/{useInput-BWzvIUpW.js → useInput-CVm3tP78.js} +1 -2
- package/dist/{useInputValueDebounce-ZLyAmuXV.d.cts → useInputValueDebounce-puGRVJ6t.d.cts} +1 -1
- package/dist/{useInputValueDebounce-ZLyAmuXV.d.cts.map → useInputValueDebounce-puGRVJ6t.d.cts.map} +1 -1
- package/dist/{useInputValueDebounce-Dhlv1NUY.d.ts → useInputValueDebounce-sFOlecIQ.d.ts} +1 -1
- package/dist/{useInputValueDebounce-Dhlv1NUY.d.ts.map → useInputValueDebounce-sFOlecIQ.d.ts.map} +1 -1
- package/dist/{useInputValueTransform-CNCBU7a9.d.cts → useInputValueTransform-BwAfw8Xb.d.cts} +1 -1
- package/dist/{useInputValueTransform-CNCBU7a9.d.cts.map → useInputValueTransform-BwAfw8Xb.d.cts.map} +1 -1
- package/dist/{useInputValueTransform-C-fmz3ke.js → useInputValueTransform-CXdmtc0Q.js} +2 -3
- package/dist/{useInputValueTransform-C-fmz3ke.js.map → useInputValueTransform-CXdmtc0Q.js.map} +1 -1
- package/dist/{useInputValueTransform-tsMNM7g_.d.ts → useInputValueTransform-CdoaxNyD.d.ts} +1 -1
- package/dist/{useInputValueTransform-tsMNM7g_.d.ts.map → useInputValueTransform-CdoaxNyD.d.ts.map} +1 -1
- package/dist/{useInputValueTransform-BBRvvhDe.cjs → useInputValueTransform-DKH-7F9D.cjs} +8 -9
- package/dist/{useInputValueTransform-BBRvvhDe.cjs.map → useInputValueTransform-DKH-7F9D.cjs.map} +1 -1
- package/dist/{useUniformField-Bd_oDkYE.d.cts → useUniformField-DB8jF52F.d.cts} +5 -5
- package/dist/{useUniformField-Bd_oDkYE.d.cts.map → useUniformField-DB8jF52F.d.cts.map} +1 -1
- package/dist/{useUniformField-BDKjYBKu.d.ts → useUniformField-iHk8xYXN.d.ts} +5 -5
- package/dist/{useUniformField-BDKjYBKu.d.ts.map → useUniformField-iHk8xYXN.d.ts.map} +1 -1
- package/dist/{useUniformFieldArray-lV3Nbum2.d.ts → useUniformFieldArray-B0SPtHeT.d.ts} +18 -18
- package/dist/useUniformFieldArray-B0SPtHeT.d.ts.map +1 -0
- package/dist/{useUniformFieldArray-CWiaXKO6.d.cts → useUniformFieldArray-okvikMJp.d.cts} +18 -18
- package/dist/useUniformFieldArray-okvikMJp.d.cts.map +1 -0
- package/dist/{useWatchUserChange-C1Kluht2.cjs → useWatchUserChange-CBuIa5kU.cjs} +9 -10
- package/dist/{useWatchUserChange-C1Kluht2.cjs.map → useWatchUserChange-CBuIa5kU.cjs.map} +1 -1
- package/dist/{useWatchUserChange-BnnrFjyq.d.ts → useWatchUserChange-CH4x16_r.d.ts} +1 -1
- package/dist/{useWatchUserChange-BnnrFjyq.d.ts.map → useWatchUserChange-CH4x16_r.d.ts.map} +1 -1
- package/dist/{useWatchUserChange-Dj9Imxfi.js → useWatchUserChange-CLgLc5W4.js} +3 -4
- package/dist/{useWatchUserChange-Dj9Imxfi.js.map → useWatchUserChange-CLgLc5W4.js.map} +1 -1
- package/dist/{useWatchUserChange-DalJOKBC.d.cts → useWatchUserChange-CZu_ZZ38.d.cts} +1 -1
- package/dist/{useWatchUserChange-DalJOKBC.d.cts.map → useWatchUserChange-CZu_ZZ38.d.cts.map} +1 -1
- package/package.json +74 -70
- package/dist/Checkboxes-BGrK_mwQ.js.map +0 -1
- package/dist/Checkboxes-Dk7yyRVR.cjs.map +0 -1
- package/dist/FieldArray-Bs2ViU8m.js.map +0 -1
- package/dist/FieldArray-C6RHZcKa.cjs.map +0 -1
- package/dist/FieldCard-16yCF83m.js.map +0 -1
- package/dist/FieldCard-BxK_IJOR.cjs.map +0 -1
- package/dist/FieldCopyTestIdButton-4uupFq1U.cjs.map +0 -1
- package/dist/FieldCopyTestIdButton-BoEdlzLs.js.map +0 -1
- package/dist/FieldValidationError-Br6iopZj.cjs.map +0 -1
- package/dist/FieldValidationError-XQaViV52.js.map +0 -1
- package/dist/Form--SsSvsxl.cjs.map +0 -1
- package/dist/Form-ccsEssie.js.map +0 -1
- package/dist/Grid-BaqBa1ku.js.map +0 -1
- package/dist/Grid-D5Yf0nD_.cjs.map +0 -1
- package/dist/Input-B3p_4ntD.cjs.map +0 -1
- package/dist/RadioBoxes-C3Cwrn2I.js.map +0 -1
- package/dist/RadioBoxes-xRvNe5U8.cjs.map +0 -1
- package/dist/RadioTabs-BaHvYcd-.cjs.map +0 -1
- package/dist/RadioTabs-DfOGIsEf.js.map +0 -1
- package/dist/Radios-BfA3uL35.cjs.map +0 -1
- package/dist/Radios-xM-09vB5.js.map +0 -1
- package/dist/Select-DH_YaruM.cjs.map +0 -1
- package/dist/Select-DlEUzYl6.js.map +0 -1
- package/dist/Slider-C-dMrJZ6.cjs.map +0 -1
- package/dist/SubmitButton-Bh1RN0F1.js.map +0 -1
- package/dist/SubmitButton-CJ6s1mZr.cjs.map +0 -1
- package/dist/Switch-CeUMwheZ.cjs.map +0 -1
- package/dist/SwitchBox-C-aLl2nX.js.map +0 -1
- package/dist/SwitchBox-mGUPvJE0.cjs.map +0 -1
- package/dist/TextArea-BLkVYmHZ.js.map +0 -1
- package/dist/TextArea-BYEuk4Ng.cjs.map +0 -1
- package/dist/helpers-33jajRcN.js +0 -390
- package/dist/helpers-33jajRcN.js.map +0 -1
- package/dist/helpers-Bd_QpqXg.cjs +0 -444
- package/dist/helpers-Bd_QpqXg.cjs.map +0 -1
- package/dist/index--KhDRPu3.d.cts.map +0 -1
- package/dist/index-B0rp5NJy.d.cts.map +0 -1
- package/dist/index-BBw9RSKy.d.ts +0 -278
- package/dist/index-BBw9RSKy.d.ts.map +0 -1
- package/dist/index-BKQc5PQn.d.cts.map +0 -1
- package/dist/index-BLgXFM85.d.cts +0 -224
- package/dist/index-BLgXFM85.d.cts.map +0 -1
- package/dist/index-BaxXDaOZ.d.ts.map +0 -1
- package/dist/index-BgyvEfYZ.d.ts.map +0 -1
- package/dist/index-BjHnNRSC.d.cts +0 -278
- package/dist/index-BjHnNRSC.d.cts.map +0 -1
- package/dist/index-Bl1Adhfx.d.ts.map +0 -1
- package/dist/index-BlJFGN_o.d.ts.map +0 -1
- package/dist/index-BlX_mF6D.d.cts.map +0 -1
- package/dist/index-BrMk3Wee.d.ts.map +0 -1
- package/dist/index-BsCPUK2g.d.cts.map +0 -1
- package/dist/index-C1-F9Ga-.d.cts.map +0 -1
- package/dist/index-CI0AWMsR.d.ts.map +0 -1
- package/dist/index-CMehV9mc.d.ts.map +0 -1
- package/dist/index-CZq5eXSP.d.ts.map +0 -1
- package/dist/index-CeiIXmAI.d.cts.map +0 -1
- package/dist/index-DFzyOxvt.d.cts.map +0 -1
- package/dist/index-Dr06SNZN.d.cts.map +0 -1
- package/dist/index-Dty4h2eA.d.ts.map +0 -1
- package/dist/index-E6etS7_8.d.ts.map +0 -1
- package/dist/index-TmijvCD0.d.ts.map +0 -1
- package/dist/index-ahxY6Q0X.d.cts.map +0 -1
- package/dist/index-mmk9VKYu.d.ts.map +0 -1
- package/dist/index-w8E8Koak.d.ts +0 -224
- package/dist/index-w8E8Koak.d.ts.map +0 -1
- package/dist/index-wwmQClW-.d.cts.map +0 -1
- package/dist/useClientValidation-B_dYQB5o.d.cts.map +0 -1
- package/dist/useClientValidation-Dnj_wuwf.cjs.map +0 -1
- package/dist/useFormContext-C6OOtqZ5.d.ts.map +0 -1
- package/dist/useFormContext-CLymm_7t.js +0 -6
- package/dist/useFormContext-CLymm_7t.js.map +0 -1
- package/dist/useFormContext-CkeSOfWD.cjs +0 -6
- package/dist/useFormContext-CkeSOfWD.cjs.map +0 -1
- package/dist/useFormContext-Dh97YG47.d.cts.map +0 -1
- package/dist/useInputValueDebounce-CRaM7HEM.cjs +0 -99
- package/dist/useInputValueDebounce-CRaM7HEM.cjs.map +0 -1
- package/dist/useInputValueDebounce-DJO5uzLb.js +0 -93
- package/dist/useInputValueDebounce-DJO5uzLb.js.map +0 -1
- package/dist/useUniformField-6c4OCAfb.cjs +0 -142
- package/dist/useUniformField-6c4OCAfb.cjs.map +0 -1
- package/dist/useUniformField-C-Xyu-8v.js +0 -135
- package/dist/useUniformField-C-Xyu-8v.js.map +0 -1
- package/dist/useUniformFieldArray-BKvA0FQW.js +0 -84
- package/dist/useUniformFieldArray-BKvA0FQW.js.map +0 -1
- package/dist/useUniformFieldArray-CRCbV1J2.cjs +0 -90
- package/dist/useUniformFieldArray-CRCbV1J2.cjs.map +0 -1
- package/dist/useUniformFieldArray-CWiaXKO6.d.cts.map +0 -1
- package/dist/useUniformFieldArray-lV3Nbum2.d.ts.map +0 -1
- /package/dist/{index-BMCcWGYS.d.ts → index--okzibnx.d.ts} +0 -0
- /package/dist/{index-C8k_zgEm.d.cts → index-B2TCFhpj.d.ts} +0 -0
- /package/dist/{index-DDRpa5CJ.d.cts → index-BtBZHVmz.d.cts} +0 -0
- /package/dist/{index-GGHuYh77.d.ts → index-CI4LJief.d.ts} +0 -0
- /package/dist/{useInput-BVZvtfNg.d.ts → useInput-93TCCrkB.d.cts} +0 -0
- /package/dist/{useInput-CKmKH9Ij.d.cts → useInput-C_fY--wx.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldCard-SjYNs4sL.js","names":[],"sources":["../src/FieldCard/subcomponents/FieldCardValidationError.tsx","../src/FieldCard/FieldCard.tsx"],"sourcesContent":["import type { FieldError } from 'react-hook-form';\n\nimport {\n AnimatePresence,\n motion,\n useReducedMotion,\n} from '@fuf-stack/pixel-motion';\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../../hooks/useUniformField';\nimport FieldValidationError from '../../partials/FieldValidationError/FieldValidationError';\n\nexport interface FieldCardValidationErrorProps {\n /** CSS class name for the error footer wrapper */\n className?: string;\n /** Error object from parent FieldCard (passed directly to avoid duplicate hook calls) */\n error?: FieldError[] | undefined;\n /** CSS class name for the error text (controls color based on invalid state) */\n errorTextClassName?: string;\n /** Field name */\n name: string;\n}\n\n/**\n * Renders validation errors in the footer of a FieldCard component.\n *\n * This component handles displaying field-level validation errors with proper\n * accessibility attributes and animates them in/out using Framer Motion.\n *\n * Note: Object-level errors (_errors) are always shown when they exist,\n * but the danger styling is controlled by the parent FieldCard based on\n * whether child fields have been touched.\n */\nconst FieldCardValidationError = ({\n className = undefined,\n error = undefined,\n errorTextClassName = undefined,\n name,\n}: FieldCardValidationErrorProps) => {\n const { getErrorMessageProps, getHelperWrapperProps, testId } =\n useUniformField({\n name,\n });\n\n // disable all animation if user prefers reduced motion\n const disableAnimation = useReducedMotion();\n\n // Always show object-level errors (_errors) when they exist\n // @ts-expect-error - error._errors exists but not typed\n const hasErrors = !!error?._errors;\n\n return (\n <AnimatePresence initial={!disableAnimation}>\n {hasErrors ? (\n <motion.div\n key=\"field-card-errors\"\n exit={disableAnimation ? undefined : { opacity: 0, height: 0 }}\n initial={disableAnimation ? false : { height: 0, opacity: 0 }}\n style={{ overflow: 'hidden' }}\n transition={{ duration: 0.4, ease: 'circOut' }}\n animate={\n disableAnimation ? undefined : { opacity: 1, height: 'auto' }\n }\n >\n <div\n {...getHelperWrapperProps()}\n className={cn(getHelperWrapperProps()?.className, className)}\n >\n <div\n {...getErrorMessageProps()}\n className={cn(\n getErrorMessageProps()?.className,\n errorTextClassName,\n )}\n >\n <FieldValidationError\n // @ts-expect-error - error._errors exists but not typed\n error={error._errors}\n testId={testId}\n />\n </div>\n </div>\n </motion.div>\n ) : null}\n </AnimatePresence>\n );\n};\n\nexport default FieldCardValidationError;\n","import type { TVClassName } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\nimport { useDebounce } from '@fuf-stack/pixels';\n\nimport { checkFieldIsRequired, useFormContext } from '../hooks/useFormContext';\nimport { useUniformField } from '../hooks/useUniformField';\nimport FieldCardValidationError from './subcomponents/FieldCardValidationError';\n\n/**\n * Recursively checks if any child field has an error (regardless of touched state).\n * Returns true if at least one child has an error.\n */\nexport const hasAnyChildErrors = (\n errors: Record<string, unknown> | undefined,\n): boolean => {\n if (!errors) {\n return false;\n }\n\n return Object.keys(errors)\n .filter((key) => {\n return key !== '_errors';\n })\n .some((key) => {\n const errorValue = errors[key];\n if (errorValue === undefined) {\n return false;\n }\n // If errorValue is an array, it's a leaf field error\n if (Array.isArray(errorValue)) {\n return true;\n }\n // Recursively check nested objects\n if (typeof errorValue === 'object' && errorValue !== null) {\n return hasAnyChildErrors(errorValue as Record<string, unknown>);\n }\n return false;\n });\n};\n\n/**\n * Recursively checks if any child field is touched.\n * Returns true if at least one child is touched.\n */\nexport const hasAnyChildTouched = (\n touched: Record<string, unknown> | undefined,\n): boolean => {\n if (!touched) {\n return false;\n }\n\n return Object.keys(touched)\n .filter((key) => {\n return key !== '_errors';\n })\n .some((key) => {\n const touchedValue = touched[key];\n if (touchedValue === undefined) {\n return false;\n }\n // If touchedValue is truthy (boolean true), field is touched\n if (touchedValue === true) {\n return true;\n }\n // Recursively check nested objects\n if (typeof touchedValue === 'object' && touchedValue !== null) {\n return hasAnyChildTouched(touchedValue as Record<string, unknown>);\n }\n return false;\n });\n};\n\n/**\n * Recursively checks if any child field with an error is also touched.\n * Returns true if at least one touched child has an error.\n */\nexport const hasVisibleChildErrors = (\n errors: Record<string, unknown> | undefined,\n touched: Record<string, unknown> | undefined,\n): boolean => {\n if (!errors || !touched) {\n return false;\n }\n\n return Object.keys(errors)\n .filter((key) => {\n // Skip object-level errors (_errors) - those are handled separately\n return key !== '_errors';\n })\n .some((key) => {\n const errorValue = errors[key];\n const touchedValue = touched[key];\n\n // If this key doesn't exist in both errors and touched, skip\n if (errorValue === undefined || touchedValue === undefined) {\n return false;\n }\n\n // If errorValue is an array, it's a leaf field error\n if (Array.isArray(errorValue)) {\n // touchedValue being truthy means the field is touched\n return !!touchedValue;\n }\n\n // Recursively check nested objects\n if (typeof errorValue === 'object' && errorValue !== null) {\n return hasVisibleChildErrors(\n errorValue as Record<string, unknown>,\n touchedValue as Record<string, unknown>,\n );\n }\n\n return false;\n });\n};\n\nexport const fieldCardVariants = tv({\n slots: {\n /** base class for the field card wrapper */\n base: [\n // base styles\n 'overflow-hidden rounded-small border bg-content1',\n // animate border color change, respect reduced motion\n 'transition-colors duration-150 motion-reduce:transition-none',\n ],\n /** class for the label/header */\n label: [\n // override HeroUI label positioning and display\n 'pointer-events-auto! static! z-auto! block! w-full!',\n // reset any transforms or translations\n 'translate-x-0! translate-y-0! transform-none!',\n // card header styling - use text-medium (16px) for proper header size\n 'rounded-t-small border-b p-3 font-semibold text-medium',\n // animate border and text color change, respect reduced motion\n 'transition-colors duration-150 motion-reduce:transition-none',\n ],\n /** class for the content */\n content: [\n // same as p-3 of Card component\n 'p-3',\n // default grid for form components (see Grid component)\n 'grid gap-4',\n ],\n /** class for the error footer wrapper */\n errorFooter: [\n 'border-t',\n // force helper to be visible and add padding (pt-1 to compensate for inner content's top padding)\n 'block px-3 pb-2 pt-1',\n // animate border color change, respect reduced motion\n 'transition-colors duration-150 motion-reduce:transition-none',\n ],\n /** class for the error text (empty base, color controlled by variant) */\n errorText: [],\n },\n variants: {\n invalid: {\n true: {\n base: 'border-danger-200',\n label: 'border-danger-200 text-danger',\n errorFooter: 'border-danger-200',\n errorText: '!text-danger text-tiny',\n },\n false: {\n base: 'border-divider',\n label: 'border-divider text-foreground',\n errorFooter: 'border-divider',\n errorText: '!text-foreground-500 text-tiny',\n },\n },\n },\n defaultVariants: {\n invalid: false,\n },\n});\n\ntype ClassName = TVClassName<typeof fieldCardVariants>;\n\nexport interface FieldCardProps {\n /** Content to render inside the card */\n children: ReactNode;\n /** CSS class name */\n className?: ClassName;\n /** Label content for the card header */\n label: ReactNode;\n /** Field name for validation */\n name: string;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * FieldCard component - A card-styled container with label header and error footer\n *\n * Displays form field content in a card layout with:\n * - Label/title in the header\n * - Content in the body\n * - Validation errors in the footer\n * - Danger outline when validation errors exist\n */\nconst FieldCard = ({\n children,\n className: _className = undefined,\n name,\n ...uniformFieldProps\n}: FieldCardProps) => {\n const { error, getLabelProps, label } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n const {\n control,\n formState: { touchedFields, submitCount },\n validation,\n } = useFormContext();\n\n // Check if any registered child field is required\n const validationInstance = validation?.baseInstance ?? validation?.instance;\n const registeredFields: string[] = Array.from(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (control as any)._names?.mount ?? [],\n );\n const childFieldPrefix = `${name}.`;\n const isRequired = validationInstance\n ? registeredFields\n .filter((f) => {\n return f.startsWith(childFieldPrefix);\n })\n .some((f) => {\n return checkFieldIsRequired(\n validationInstance,\n f.split('.').filter((k) => {\n return k !== '';\n }),\n );\n })\n : false;\n\n // Get touched state for this field's children by traversing the path\n const getNestedValue = (\n obj: Record<string, unknown> | undefined,\n path: string,\n ): Record<string, unknown> | undefined => {\n if (!obj) {\n return undefined;\n }\n const keys = path.split('.');\n let current: unknown = obj;\n keys.every((key) => {\n if (current && typeof current === 'object') {\n current = (current as Record<string, unknown>)[key];\n return true;\n }\n current = undefined;\n return false;\n });\n return current as Record<string, unknown> | undefined;\n };\n\n const fieldTouched = getNestedValue(\n touchedFields as Record<string, unknown>,\n name,\n );\n\n // Check for object-level errors (_errors)\n // @ts-expect-error - error._errors exists but not typed\n const hasObjectErrors = !!error?._errors;\n\n const errorRecord = error as unknown as Record<string, unknown>;\n\n // Check if any child field has errors (regardless of touched state)\n const hasChildErrors = hasAnyChildErrors(errorRecord);\n // Check if any child field is touched\n const isAnyChildTouched = hasAnyChildTouched(fieldTouched);\n\n // Show invalid styling (danger border/header/error text) when:\n // 1. Any child field has an error AND (it's touched OR form was submitted), OR\n // 2. Object-level _errors exists AND no child errors AND (any child touched OR submitted)\n const rawShowInvalid =\n (hasChildErrors &&\n (hasVisibleChildErrors(errorRecord, fieldTouched) || submitCount > 0)) ||\n (hasObjectErrors &&\n !hasChildErrors &&\n (isAnyChildTouched || submitCount > 0));\n\n // Debounce to prevent flickering during rapid state changes\n const showInvalid = useDebounce(rawShowInvalid, 200);\n\n // className from slots\n const variants = fieldCardVariants({ invalid: showInvalid });\n const className = variantsToClassNames(variants, _className, 'base');\n\n return (\n <div className={className.base}>\n {/* card header with label */}\n {label ? (\n <div\n {...getLabelProps()}\n aria-level={3}\n // Override getLabelProps className to use our own invalid styling based on hasErrors,\n // not HeroUI's which is based on any child field being invalid\n className={className.label}\n role=\"heading\"\n >\n {label}\n {/* Manual asterisk: getLabelProps uses schema-required for the object itself,\n but FieldCard needs asterisk based on whether any CHILD field is required */}\n {isRequired ? (\n <span aria-hidden=\"true\" className=\"ml-0.5 text-danger\">\n *\n </span>\n ) : null}\n </div>\n ) : null}\n\n {/* card content */}\n <div className={className.content}>{children}</div>\n\n {/* card footer with validation errors - always show _errors, but danger styling controlled by showInvalid */}\n <FieldCardValidationError\n className={className.errorFooter}\n error={error}\n errorTextClassName={className.errorText}\n name={name}\n />\n </div>\n );\n};\n\nexport default FieldCard;\n"],"mappings":"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"}
|
|
@@ -2,7 +2,6 @@ import { cn } from "@fuf-stack/pixel-utils";
|
|
|
2
2
|
import { Button } from "@fuf-stack/pixels";
|
|
3
3
|
import { FaBullseye } from "react-icons/fa6";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
|
|
6
5
|
//#region src/partials/FieldCopyTestIdButton/FieldCopyTestIdButton.tsx
|
|
7
6
|
const FieldCopyTestIdButton = ({ className = void 0, testId }) => {
|
|
8
7
|
const copyToClipboard = () => {
|
|
@@ -18,12 +17,10 @@ const FieldCopyTestIdButton = ({ className = void 0, testId }) => {
|
|
|
18
17
|
variant: "light"
|
|
19
18
|
});
|
|
20
19
|
};
|
|
21
|
-
var FieldCopyTestIdButton_default$1 = FieldCopyTestIdButton;
|
|
22
|
-
|
|
23
20
|
//#endregion
|
|
24
21
|
//#region src/partials/FieldCopyTestIdButton/index.ts
|
|
25
|
-
var FieldCopyTestIdButton_default =
|
|
26
|
-
|
|
22
|
+
var FieldCopyTestIdButton_default = FieldCopyTestIdButton;
|
|
27
23
|
//#endregion
|
|
28
|
-
export {
|
|
29
|
-
|
|
24
|
+
export { FieldCopyTestIdButton as n, FieldCopyTestIdButton_default as t };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=FieldCopyTestIdButton-Dpmo0uBV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldCopyTestIdButton-Dpmo0uBV.js","names":[],"sources":["../src/partials/FieldCopyTestIdButton/FieldCopyTestIdButton.tsx","../src/partials/FieldCopyTestIdButton/index.ts"],"sourcesContent":["import { FaBullseye } from 'react-icons/fa6';\n\nimport { cn } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels';\n\nexport interface FieldCopyTestIdButtonProps {\n /** CSS class name */\n className?: string;\n /** HTML data-testid attribute used in e2e tests */\n testId: string;\n}\n\nconst FieldCopyTestIdButton = ({\n className = undefined,\n testId,\n}: FieldCopyTestIdButtonProps) => {\n const copyToClipboard = () => {\n navigator.clipboard.writeText(testId).catch((err) => {\n console.error('Error copying TestId to clipboard', err);\n });\n };\n\n return (\n <Button\n className={cn(className, 'pointer-events-auto')}\n icon={<FaBullseye />}\n onClick={copyToClipboard}\n size=\"sm\"\n variant=\"light\"\n />\n );\n};\nexport default FieldCopyTestIdButton;\n","import FieldCopyTestIdButton from './FieldCopyTestIdButton';\n\nexport type { FieldCopyTestIdButtonProps } from './FieldCopyTestIdButton';\n\nexport { FieldCopyTestIdButton };\n\nexport default FieldCopyTestIdButton;\n"],"mappings":";;;;;AAYA,MAAM,yBAAyB,EAC7B,YAAY,KAAA,GACZ,aACgC;CAChC,MAAM,wBAAwB;AAC5B,YAAU,UAAU,UAAU,OAAO,CAAC,OAAO,QAAQ;AACnD,WAAQ,MAAM,qCAAqC,IAAI;IACvD;;AAGJ,QACE,oBAAC,QAAD;EACE,WAAW,GAAG,WAAW,sBAAsB;EAC/C,MAAM,oBAAC,YAAD,EAAc,CAAA;EACpB,SAAS;EACT,MAAK;EACL,SAAQ;EACR,CAAA;;;;ACvBN,IAAA,gCAAe"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
require("./FormContext-BrY1FQYR.cjs");
|
|
2
2
|
let _fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
|
|
3
3
|
let _fuf_stack_pixels = require("@fuf-stack/pixels");
|
|
4
4
|
let react_icons_fa6 = require("react-icons/fa6");
|
|
5
5
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
-
|
|
7
6
|
//#region src/partials/FieldCopyTestIdButton/FieldCopyTestIdButton.tsx
|
|
8
7
|
const FieldCopyTestIdButton = ({ className = void 0, testId }) => {
|
|
9
8
|
const copyToClipboard = () => {
|
|
@@ -19,23 +18,21 @@ const FieldCopyTestIdButton = ({ className = void 0, testId }) => {
|
|
|
19
18
|
variant: "light"
|
|
20
19
|
});
|
|
21
20
|
};
|
|
22
|
-
var FieldCopyTestIdButton_default$1 = FieldCopyTestIdButton;
|
|
23
|
-
|
|
24
21
|
//#endregion
|
|
25
22
|
//#region src/partials/FieldCopyTestIdButton/index.ts
|
|
26
|
-
var FieldCopyTestIdButton_default =
|
|
27
|
-
|
|
23
|
+
var FieldCopyTestIdButton_default = FieldCopyTestIdButton;
|
|
28
24
|
//#endregion
|
|
29
|
-
Object.defineProperty(exports,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
Object.defineProperty(exports, "FieldCopyTestIdButton", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function() {
|
|
28
|
+
return FieldCopyTestIdButton;
|
|
29
|
+
}
|
|
34
30
|
});
|
|
35
|
-
Object.defineProperty(exports,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
Object.defineProperty(exports, "FieldCopyTestIdButton_default", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function() {
|
|
34
|
+
return FieldCopyTestIdButton_default;
|
|
35
|
+
}
|
|
40
36
|
});
|
|
41
|
-
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=FieldCopyTestIdButton-DrUzXwTo.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldCopyTestIdButton-DrUzXwTo.cjs","names":["Button","FaBullseye"],"sources":["../src/partials/FieldCopyTestIdButton/FieldCopyTestIdButton.tsx","../src/partials/FieldCopyTestIdButton/index.ts"],"sourcesContent":["import { FaBullseye } from 'react-icons/fa6';\n\nimport { cn } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels';\n\nexport interface FieldCopyTestIdButtonProps {\n /** CSS class name */\n className?: string;\n /** HTML data-testid attribute used in e2e tests */\n testId: string;\n}\n\nconst FieldCopyTestIdButton = ({\n className = undefined,\n testId,\n}: FieldCopyTestIdButtonProps) => {\n const copyToClipboard = () => {\n navigator.clipboard.writeText(testId).catch((err) => {\n console.error('Error copying TestId to clipboard', err);\n });\n };\n\n return (\n <Button\n className={cn(className, 'pointer-events-auto')}\n icon={<FaBullseye />}\n onClick={copyToClipboard}\n size=\"sm\"\n variant=\"light\"\n />\n );\n};\nexport default FieldCopyTestIdButton;\n","import FieldCopyTestIdButton from './FieldCopyTestIdButton';\n\nexport type { FieldCopyTestIdButtonProps } from './FieldCopyTestIdButton';\n\nexport { FieldCopyTestIdButton };\n\nexport default FieldCopyTestIdButton;\n"],"mappings":";;;;;;AAYA,MAAM,yBAAyB,EAC7B,YAAY,KAAA,GACZ,aACgC;CAChC,MAAM,wBAAwB;AAC5B,YAAU,UAAU,UAAU,OAAO,CAAC,OAAO,QAAQ;AACnD,WAAQ,MAAM,qCAAqC,IAAI;IACvD;;AAGJ,QACE,iBAAA,GAAA,kBAAA,KAACA,kBAAAA,QAAD;EACE,YAAA,GAAA,uBAAA,IAAc,WAAW,sBAAsB;EAC/C,MAAM,iBAAA,GAAA,kBAAA,KAACC,gBAAAA,YAAD,EAAc,CAAA;EACpB,SAAS;EACT,MAAK;EACL,SAAQ;EACR,CAAA;;;;ACvBN,IAAA,gCAAe"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
require("./FormContext-BrY1FQYR.cjs");
|
|
2
2
|
let _fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
|
|
3
3
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
4
|
let _fuf_stack_pixel_motion = require("@fuf-stack/pixel-motion");
|
|
5
|
-
|
|
6
5
|
//#region src/partials/FieldValidationError/FieldValidationError.tsx
|
|
7
6
|
/**
|
|
8
7
|
* Renders a validation error of a field
|
|
@@ -43,23 +42,21 @@ const FieldValidationError = ({ className = void 0, error = void 0, testId }) =>
|
|
|
43
42
|
})
|
|
44
43
|
});
|
|
45
44
|
};
|
|
46
|
-
var FieldValidationError_default$1 = FieldValidationError;
|
|
47
|
-
|
|
48
45
|
//#endregion
|
|
49
46
|
//#region src/partials/FieldValidationError/index.ts
|
|
50
|
-
var FieldValidationError_default =
|
|
51
|
-
|
|
47
|
+
var FieldValidationError_default = FieldValidationError;
|
|
52
48
|
//#endregion
|
|
53
|
-
Object.defineProperty(exports,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
49
|
+
Object.defineProperty(exports, "FieldValidationError", {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
get: function() {
|
|
52
|
+
return FieldValidationError;
|
|
53
|
+
}
|
|
58
54
|
});
|
|
59
|
-
Object.defineProperty(exports,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
55
|
+
Object.defineProperty(exports, "FieldValidationError_default", {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
get: function() {
|
|
58
|
+
return FieldValidationError_default;
|
|
59
|
+
}
|
|
64
60
|
});
|
|
65
|
-
|
|
61
|
+
|
|
62
|
+
//# sourceMappingURL=FieldValidationError-8H8LxDjk.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldValidationError-8H8LxDjk.cjs","names":["AnimatePresence","motion"],"sources":["../src/partials/FieldValidationError/FieldValidationError.tsx","../src/partials/FieldValidationError/index.ts"],"sourcesContent":["import type { FieldError } from 'react-hook-form';\n\nimport {\n AnimatePresence,\n motion,\n useReducedMotion,\n} from '@fuf-stack/pixel-motion';\nimport { slugify } from '@fuf-stack/pixel-utils';\n\nexport interface FieldValidationErrorProps {\n /** CSS class name */\n className?: string;\n /** Field errors */\n error?: FieldError[];\n /** HTML data-testid attribute used in e2e tests */\n testId: string;\n}\n\n/**\n * Renders a validation error of a field\n */\nconst FieldValidationError = ({\n className = undefined,\n error = undefined,\n testId,\n}: FieldValidationErrorProps) => {\n // disable all animation if user prefers reduced motion\n const disableAnimation = useReducedMotion();\n\n return (\n <ul\n aria-label={`Validation errors of field ${testId}`}\n className={className}\n data-testid={slugify(`${testId}_error`)}\n >\n <AnimatePresence initial={!disableAnimation}>\n {error?.map(({ message }, i) => {\n return (\n <motion.li\n key={slugify(`${testId}_error_${i}`)}\n exit={disableAnimation ? undefined : { opacity: 0, height: 0 }}\n initial={disableAnimation ? false : { height: 0, opacity: 0 }}\n style={{ overflow: 'hidden' }}\n transition={{ duration: 0.2, ease: 'circOut' }}\n animate={\n disableAnimation ? undefined : { opacity: 1, height: 'auto' }\n }\n >\n {/* wrap in div to apply padding and animation does not jump */}\n <div className=\"px-1 pt-1\">{message}</div>\n </motion.li>\n );\n })}\n </AnimatePresence>\n </ul>\n );\n};\n\nexport default FieldValidationError;\n","import FieldValidationError from './FieldValidationError';\n\nexport type { FieldValidationErrorProps } from './FieldValidationError';\n\nexport { FieldValidationError };\n\nexport default FieldValidationError;\n"],"mappings":";;;;;;;;AAqBA,MAAM,wBAAwB,EAC5B,YAAY,KAAA,GACZ,QAAQ,KAAA,GACR,aAC+B;CAE/B,MAAM,oBAAA,GAAA,wBAAA,mBAAqC;AAE3C,QACE,iBAAA,GAAA,kBAAA,KAAC,MAAD;EACE,cAAY,8BAA8B;EAC/B;EACX,gBAAA,GAAA,uBAAA,SAAqB,GAAG,OAAO,QAAQ;YAEvC,iBAAA,GAAA,kBAAA,KAACA,wBAAAA,iBAAD;GAAiB,SAAS,CAAC;aACxB,OAAO,KAAK,EAAE,WAAW,MAAM;AAC9B,WACE,iBAAA,GAAA,kBAAA,KAACC,wBAAAA,OAAO,IAAR;KAEE,MAAM,mBAAmB,KAAA,IAAY;MAAE,SAAS;MAAG,QAAQ;MAAG;KAC9D,SAAS,mBAAmB,QAAQ;MAAE,QAAQ;MAAG,SAAS;MAAG;KAC7D,OAAO,EAAE,UAAU,UAAU;KAC7B,YAAY;MAAE,UAAU;MAAK,MAAM;MAAW;KAC9C,SACE,mBAAmB,KAAA,IAAY;MAAE,SAAS;MAAG,QAAQ;MAAQ;eAI/D,iBAAA,GAAA,kBAAA,KAAC,OAAD;MAAK,WAAU;gBAAa;MAAc,CAAA;KAChC,GAAA,GAAA,uBAAA,SAXG,GAAG,OAAO,SAAS,IAAI,CAW1B;KAEd;GACc,CAAA;EACf,CAAA;;;;AChDT,IAAA,+BAAe"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { slugify } from "@fuf-stack/pixel-utils";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { AnimatePresence, motion, useReducedMotion } from "@fuf-stack/pixel-motion";
|
|
4
|
-
|
|
5
4
|
//#region src/partials/FieldValidationError/FieldValidationError.tsx
|
|
6
5
|
/**
|
|
7
6
|
* Renders a validation error of a field
|
|
@@ -42,12 +41,10 @@ const FieldValidationError = ({ className = void 0, error = void 0, testId }) =>
|
|
|
42
41
|
})
|
|
43
42
|
});
|
|
44
43
|
};
|
|
45
|
-
var FieldValidationError_default$1 = FieldValidationError;
|
|
46
|
-
|
|
47
44
|
//#endregion
|
|
48
45
|
//#region src/partials/FieldValidationError/index.ts
|
|
49
|
-
var FieldValidationError_default =
|
|
50
|
-
|
|
46
|
+
var FieldValidationError_default = FieldValidationError;
|
|
51
47
|
//#endregion
|
|
52
|
-
export {
|
|
53
|
-
|
|
48
|
+
export { FieldValidationError as n, FieldValidationError_default as t };
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=FieldValidationError-ktTyyyip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldValidationError-ktTyyyip.js","names":[],"sources":["../src/partials/FieldValidationError/FieldValidationError.tsx","../src/partials/FieldValidationError/index.ts"],"sourcesContent":["import type { FieldError } from 'react-hook-form';\n\nimport {\n AnimatePresence,\n motion,\n useReducedMotion,\n} from '@fuf-stack/pixel-motion';\nimport { slugify } from '@fuf-stack/pixel-utils';\n\nexport interface FieldValidationErrorProps {\n /** CSS class name */\n className?: string;\n /** Field errors */\n error?: FieldError[];\n /** HTML data-testid attribute used in e2e tests */\n testId: string;\n}\n\n/**\n * Renders a validation error of a field\n */\nconst FieldValidationError = ({\n className = undefined,\n error = undefined,\n testId,\n}: FieldValidationErrorProps) => {\n // disable all animation if user prefers reduced motion\n const disableAnimation = useReducedMotion();\n\n return (\n <ul\n aria-label={`Validation errors of field ${testId}`}\n className={className}\n data-testid={slugify(`${testId}_error`)}\n >\n <AnimatePresence initial={!disableAnimation}>\n {error?.map(({ message }, i) => {\n return (\n <motion.li\n key={slugify(`${testId}_error_${i}`)}\n exit={disableAnimation ? undefined : { opacity: 0, height: 0 }}\n initial={disableAnimation ? false : { height: 0, opacity: 0 }}\n style={{ overflow: 'hidden' }}\n transition={{ duration: 0.2, ease: 'circOut' }}\n animate={\n disableAnimation ? undefined : { opacity: 1, height: 'auto' }\n }\n >\n {/* wrap in div to apply padding and animation does not jump */}\n <div className=\"px-1 pt-1\">{message}</div>\n </motion.li>\n );\n })}\n </AnimatePresence>\n </ul>\n );\n};\n\nexport default FieldValidationError;\n","import FieldValidationError from './FieldValidationError';\n\nexport type { FieldValidationErrorProps } from './FieldValidationError';\n\nexport { FieldValidationError };\n\nexport default FieldValidationError;\n"],"mappings":";;;;;;;AAqBA,MAAM,wBAAwB,EAC5B,YAAY,KAAA,GACZ,QAAQ,KAAA,GACR,aAC+B;CAE/B,MAAM,mBAAmB,kBAAkB;AAE3C,QACE,oBAAC,MAAD;EACE,cAAY,8BAA8B;EAC/B;EACX,eAAa,QAAQ,GAAG,OAAO,QAAQ;YAEvC,oBAAC,iBAAD;GAAiB,SAAS,CAAC;aACxB,OAAO,KAAK,EAAE,WAAW,MAAM;AAC9B,WACE,oBAAC,OAAO,IAAR;KAEE,MAAM,mBAAmB,KAAA,IAAY;MAAE,SAAS;MAAG,QAAQ;MAAG;KAC9D,SAAS,mBAAmB,QAAQ;MAAE,QAAQ;MAAG,SAAS;MAAG;KAC7D,OAAO,EAAE,UAAU,UAAU;KAC7B,YAAY;MAAE,UAAU;MAAK,MAAM;MAAW;KAC9C,SACE,mBAAmB,KAAA,IAAY;MAAE,SAAS;MAAG,QAAQ;MAAQ;eAI/D,oBAAC,OAAD;MAAK,WAAU;gBAAa;MAAc,CAAA;KAChC,EAXL,QAAQ,GAAG,OAAO,SAAS,IAAI,CAW1B;KAEd;GACc,CAAA;EACf,CAAA;;;;AChDT,IAAA,+BAAe"}
|
package/dist/Form/index.cjs
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
Object.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
5
|
+
const require_Form = require("../Form-Dqa1b7Y7.cjs");
|
|
6
|
+
exports.Form = require_Form.Form;
|
|
7
|
+
exports.default = require_Form.Form_default;
|
package/dist/Form/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as FormProps, t as Form } from "../index-
|
|
1
|
+
import { n as FormProps, t as Form } from "../index-NjKV8LJD.cjs";
|
|
2
2
|
export { Form, Form as default, FormProps };
|
package/dist/Form/index.d.ts
CHANGED
package/dist/Form/index.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
|
|
3
|
-
export { Form_default as Form, Form_default$1 as default };
|
|
1
|
+
import { n as Form, t as Form_default } from "../Form-Wzy7pBVt.js";
|
|
2
|
+
export { Form, Form_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_FormContext = require(
|
|
2
|
-
const require_useFormContext = require(
|
|
1
|
+
const require_FormContext = require("./FormContext-BrY1FQYR.cjs");
|
|
2
|
+
const require_useFormContext = require("./useFormContext-Bum4VP1o.cjs");
|
|
3
3
|
let _fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
|
|
4
4
|
let react = require("react");
|
|
5
5
|
let react_icons_fa6 = require("react-icons/fa6");
|
|
@@ -9,7 +9,6 @@ let _fuf_stack_pixels_Button = require("@fuf-stack/pixels/Button");
|
|
|
9
9
|
let _fuf_stack_pixels_Card = require("@fuf-stack/pixels/Card");
|
|
10
10
|
let _fuf_stack_pixels_Json = require("@fuf-stack/pixels/Json");
|
|
11
11
|
require("@fuf-stack/pixels/Json.css");
|
|
12
|
-
|
|
13
12
|
//#region src/Form/subcomponents/FormDebugViewer.tsx
|
|
14
13
|
/** Renders a form debug panel with information about the current form state */
|
|
15
14
|
const FormDebugViewer = ({ className = void 0 }) => {
|
|
@@ -78,8 +77,6 @@ const FormDebugViewer = ({ className = void 0 }) => {
|
|
|
78
77
|
} })]
|
|
79
78
|
});
|
|
80
79
|
};
|
|
81
|
-
var FormDebugViewer_default = FormDebugViewer;
|
|
82
|
-
|
|
83
80
|
//#endregion
|
|
84
81
|
//#region src/Form/Form.tsx
|
|
85
82
|
const IS_TEST = process.env.NODE_ENV === "test";
|
|
@@ -87,7 +84,7 @@ const IS_TEST = process.env.NODE_ENV === "test";
|
|
|
87
84
|
* Form component that has to wrap every uniform
|
|
88
85
|
*/
|
|
89
86
|
const Form = ({ children, className = void 0, debug = void 0, initialValues = void 0, name = void 0, onSubmit, testId = void 0, validation = void 0, validationTrigger = "all" }) => {
|
|
90
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FormContext.
|
|
87
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FormContext.FormProvider, {
|
|
91
88
|
debugModeSettings: debug,
|
|
92
89
|
initialValues,
|
|
93
90
|
onSubmit,
|
|
@@ -103,28 +100,26 @@ const Form = ({ children, className = void 0, debug = void 0, initialValues = vo
|
|
|
103
100
|
name,
|
|
104
101
|
onSubmit: handleSubmit,
|
|
105
102
|
children
|
|
106
|
-
}), !IS_TEST && !debug?.disable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
103
|
+
}), !IS_TEST && !debug?.disable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FormDebugViewer, { className: "w-96 shrink" })]
|
|
107
104
|
});
|
|
108
105
|
}
|
|
109
106
|
});
|
|
110
107
|
};
|
|
111
|
-
var Form_default$1 = Form;
|
|
112
|
-
|
|
113
108
|
//#endregion
|
|
114
109
|
//#region src/Form/index.ts
|
|
115
|
-
var Form_default =
|
|
116
|
-
|
|
110
|
+
var Form_default = Form;
|
|
117
111
|
//#endregion
|
|
118
|
-
Object.defineProperty(exports,
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
112
|
+
Object.defineProperty(exports, "Form", {
|
|
113
|
+
enumerable: true,
|
|
114
|
+
get: function() {
|
|
115
|
+
return Form;
|
|
116
|
+
}
|
|
123
117
|
});
|
|
124
|
-
Object.defineProperty(exports,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
118
|
+
Object.defineProperty(exports, "Form_default", {
|
|
119
|
+
enumerable: true,
|
|
120
|
+
get: function() {
|
|
121
|
+
return Form_default;
|
|
122
|
+
}
|
|
129
123
|
});
|
|
130
|
-
|
|
124
|
+
|
|
125
|
+
//# sourceMappingURL=Form-Dqa1b7Y7.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Form-Dqa1b7Y7.cjs","names":["useFormContext","Button","FaBug","Card","FaTimes","FaBullseye","Json","FormProvider"],"sources":["../src/Form/subcomponents/FormDebugViewer.tsx","../src/Form/Form.tsx","../src/Form/index.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport { FaTimes } from 'react-icons/fa';\nimport { FaBug, FaBullseye } from 'react-icons/fa6';\n\nimport { cn } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels/Button';\nimport { Card } from '@fuf-stack/pixels/Card';\nimport { Json } from '@fuf-stack/pixels/Json';\n\nimport { useFormContext } from '../../hooks/useFormContext';\n\n// import Json css (theme)\nimport '@fuf-stack/pixels/Json.css';\n\ninterface FormDebugViewerProps {\n /** CSS class name */\n className?: string;\n}\n\n/** Renders a form debug panel with information about the current form state */\nconst FormDebugViewer = ({ className = undefined }: FormDebugViewerProps) => {\n const {\n debugMode,\n formState: { isValid, isSubmitting, submitCount, isSubmitSuccessful },\n getValues,\n setDebugMode,\n validation: { errors },\n subscribe,\n } = useFormContext();\n\n const showDebugButton = debugMode === 'off';\n const showDebugCard = debugMode === 'debug' || debugMode === 'debug-testids';\n const showDebugTestIds = debugMode === 'debug-testids';\n\n // Use subscribe instead of watch() to avoid triggering re-renders on parent components.\n // This component manages its own state and only updates itself when form values change.\n const [values, setValues] = useState<Record<string, unknown>>({});\n\n useEffect(() => {\n // Only subscribe when debug card is visible\n if (!showDebugCard) {\n return undefined;\n }\n\n // Initialize with current values when debug card is opened\n setValues(getValues() ?? {});\n\n const subscription = subscribe({\n formState: { values: true },\n callback: (state) => {\n setValues(state.values ?? {});\n },\n });\n\n return () => {\n subscription();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [showDebugCard]);\n\n if (showDebugButton) {\n return (\n <Button\n ariaLabel=\"Enable form debug mode\"\n className=\"fixed bottom-2.5 right-2.5 w-5 text-default-400\"\n icon={<FaBug />}\n variant=\"light\"\n onClick={() => {\n setDebugMode('debug');\n }}\n />\n );\n }\n\n // do not show card\n if (!showDebugCard) {\n return null;\n }\n\n return (\n <Card\n className={cn(className)}\n header={\n <div className=\"flex w-full flex-row justify-between\">\n <span className=\"text-lg\">Debug Mode</span>\n <Button\n color=\"danger\"\n icon={<FaTimes />}\n size=\"sm\"\n variant=\"light\"\n onClick={() => {\n setDebugMode('off');\n }}\n />\n </div>\n }\n >\n <Button\n className=\"mb-4 ml-auto mr-auto\"\n icon={<FaBullseye />}\n variant={showDebugTestIds ? 'solid' : 'light'}\n onClick={() => {\n setDebugMode(debugMode === 'debug' ? 'debug-testids' : 'debug');\n }}\n >\n {showDebugTestIds ? 'Hide CopyButton' : 'Show CopyButton'}\n </Button>\n <Json\n value={{\n values,\n errors: errors ?? null,\n submit: {\n isValid,\n isSubmitting,\n isSubmitSuccessful,\n submitCount,\n },\n }}\n />\n </Card>\n );\n};\n\nexport default FormDebugViewer;\n","import type { VetoInstance } from '@fuf-stack/veto';\nimport type { ReactNode } from 'react';\nimport type { FieldValues, SubmitHandler } from 'react-hook-form';\nimport type { DebugModeSettings } from './subcomponents/FormContext';\n\nimport { cn, slugify } from '@fuf-stack/pixel-utils';\n\nimport FormProvider from './subcomponents/FormContext';\nimport FormDebugViewer from './subcomponents/FormDebugViewer';\n\nconst IS_TEST = process.env.NODE_ENV === 'test';\n\nexport interface FormProps {\n /** form children */\n children: ReactNode | ReactNode[];\n /** CSS class name */\n className?: string | string[];\n /** settings for from debug mode */\n debug?: DebugModeSettings;\n /** initial form values */\n initialValues?: FieldValues;\n /** name of the form */\n name?: string;\n /** form submit handler */\n onSubmit: SubmitHandler<FieldValues>;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** veto validation schema */\n validation?: VetoInstance;\n /** when the validation should be triggered */\n validationTrigger?: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';\n}\n\n/**\n * Form component that has to wrap every uniform\n */\nconst Form = ({\n children,\n className = undefined,\n debug = undefined,\n initialValues = undefined,\n name = undefined,\n onSubmit,\n testId = undefined,\n validation = undefined,\n validationTrigger = 'all',\n}: FormProps) => {\n return (\n <FormProvider\n debugModeSettings={debug}\n initialValues={initialValues}\n onSubmit={onSubmit}\n validation={validation}\n validationTrigger={validationTrigger}\n >\n {({ handleSubmit, isValid }) => {\n return (\n <div className=\"flex w-full flex-row justify-between gap-6\">\n <form\n className={cn('grow', className)}\n data-form-is-valid={isValid}\n data-testid={slugify(testId ?? name ?? '')}\n name={name}\n onSubmit={handleSubmit}\n >\n {children}\n </form>\n {/* render debug viewer when not in test environment and debug not disabled */}\n {!IS_TEST && !debug?.disable && (\n <FormDebugViewer className=\"w-96 shrink\" />\n )}\n </div>\n );\n }}\n </FormProvider>\n );\n};\n\nexport default Form;\n","import Form from './Form';\n\nexport type { FormProps } from './Form';\n\nexport { Form };\n\nexport default Form;\n"],"mappings":"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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { n as useFormContext } from "./useFormContext-
|
|
1
|
+
import { t as FormProvider } from "./FormContext-CLfMWHQM.js";
|
|
2
|
+
import { n as useFormContext } from "./useFormContext-Bzpyonu6.js";
|
|
3
3
|
import { cn, slugify } from "@fuf-stack/pixel-utils";
|
|
4
4
|
import { useEffect, useState } from "react";
|
|
5
5
|
import { FaBug, FaBullseye } from "react-icons/fa6";
|
|
@@ -9,7 +9,6 @@ import { Button } from "@fuf-stack/pixels/Button";
|
|
|
9
9
|
import { Card } from "@fuf-stack/pixels/Card";
|
|
10
10
|
import { Json } from "@fuf-stack/pixels/Json";
|
|
11
11
|
import "@fuf-stack/pixels/Json.css";
|
|
12
|
-
|
|
13
12
|
//#region src/Form/subcomponents/FormDebugViewer.tsx
|
|
14
13
|
/** Renders a form debug panel with information about the current form state */
|
|
15
14
|
const FormDebugViewer = ({ className = void 0 }) => {
|
|
@@ -78,8 +77,6 @@ const FormDebugViewer = ({ className = void 0 }) => {
|
|
|
78
77
|
} })]
|
|
79
78
|
});
|
|
80
79
|
};
|
|
81
|
-
var FormDebugViewer_default = FormDebugViewer;
|
|
82
|
-
|
|
83
80
|
//#endregion
|
|
84
81
|
//#region src/Form/Form.tsx
|
|
85
82
|
const IS_TEST = process.env.NODE_ENV === "test";
|
|
@@ -87,7 +84,7 @@ const IS_TEST = process.env.NODE_ENV === "test";
|
|
|
87
84
|
* Form component that has to wrap every uniform
|
|
88
85
|
*/
|
|
89
86
|
const Form = ({ children, className = void 0, debug = void 0, initialValues = void 0, name = void 0, onSubmit, testId = void 0, validation = void 0, validationTrigger = "all" }) => {
|
|
90
|
-
return /* @__PURE__ */ jsx(
|
|
87
|
+
return /* @__PURE__ */ jsx(FormProvider, {
|
|
91
88
|
debugModeSettings: debug,
|
|
92
89
|
initialValues,
|
|
93
90
|
onSubmit,
|
|
@@ -103,17 +100,15 @@ const Form = ({ children, className = void 0, debug = void 0, initialValues = vo
|
|
|
103
100
|
name,
|
|
104
101
|
onSubmit: handleSubmit,
|
|
105
102
|
children
|
|
106
|
-
}), !IS_TEST && !debug?.disable && /* @__PURE__ */ jsx(
|
|
103
|
+
}), !IS_TEST && !debug?.disable && /* @__PURE__ */ jsx(FormDebugViewer, { className: "w-96 shrink" })]
|
|
107
104
|
});
|
|
108
105
|
}
|
|
109
106
|
});
|
|
110
107
|
};
|
|
111
|
-
var Form_default$1 = Form;
|
|
112
|
-
|
|
113
108
|
//#endregion
|
|
114
109
|
//#region src/Form/index.ts
|
|
115
|
-
var Form_default =
|
|
116
|
-
|
|
110
|
+
var Form_default = Form;
|
|
117
111
|
//#endregion
|
|
118
|
-
export {
|
|
119
|
-
|
|
112
|
+
export { Form as n, Form_default as t };
|
|
113
|
+
|
|
114
|
+
//# sourceMappingURL=Form-Wzy7pBVt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Form-Wzy7pBVt.js","names":[],"sources":["../src/Form/subcomponents/FormDebugViewer.tsx","../src/Form/Form.tsx","../src/Form/index.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport { FaTimes } from 'react-icons/fa';\nimport { FaBug, FaBullseye } from 'react-icons/fa6';\n\nimport { cn } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels/Button';\nimport { Card } from '@fuf-stack/pixels/Card';\nimport { Json } from '@fuf-stack/pixels/Json';\n\nimport { useFormContext } from '../../hooks/useFormContext';\n\n// import Json css (theme)\nimport '@fuf-stack/pixels/Json.css';\n\ninterface FormDebugViewerProps {\n /** CSS class name */\n className?: string;\n}\n\n/** Renders a form debug panel with information about the current form state */\nconst FormDebugViewer = ({ className = undefined }: FormDebugViewerProps) => {\n const {\n debugMode,\n formState: { isValid, isSubmitting, submitCount, isSubmitSuccessful },\n getValues,\n setDebugMode,\n validation: { errors },\n subscribe,\n } = useFormContext();\n\n const showDebugButton = debugMode === 'off';\n const showDebugCard = debugMode === 'debug' || debugMode === 'debug-testids';\n const showDebugTestIds = debugMode === 'debug-testids';\n\n // Use subscribe instead of watch() to avoid triggering re-renders on parent components.\n // This component manages its own state and only updates itself when form values change.\n const [values, setValues] = useState<Record<string, unknown>>({});\n\n useEffect(() => {\n // Only subscribe when debug card is visible\n if (!showDebugCard) {\n return undefined;\n }\n\n // Initialize with current values when debug card is opened\n setValues(getValues() ?? {});\n\n const subscription = subscribe({\n formState: { values: true },\n callback: (state) => {\n setValues(state.values ?? {});\n },\n });\n\n return () => {\n subscription();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [showDebugCard]);\n\n if (showDebugButton) {\n return (\n <Button\n ariaLabel=\"Enable form debug mode\"\n className=\"fixed bottom-2.5 right-2.5 w-5 text-default-400\"\n icon={<FaBug />}\n variant=\"light\"\n onClick={() => {\n setDebugMode('debug');\n }}\n />\n );\n }\n\n // do not show card\n if (!showDebugCard) {\n return null;\n }\n\n return (\n <Card\n className={cn(className)}\n header={\n <div className=\"flex w-full flex-row justify-between\">\n <span className=\"text-lg\">Debug Mode</span>\n <Button\n color=\"danger\"\n icon={<FaTimes />}\n size=\"sm\"\n variant=\"light\"\n onClick={() => {\n setDebugMode('off');\n }}\n />\n </div>\n }\n >\n <Button\n className=\"mb-4 ml-auto mr-auto\"\n icon={<FaBullseye />}\n variant={showDebugTestIds ? 'solid' : 'light'}\n onClick={() => {\n setDebugMode(debugMode === 'debug' ? 'debug-testids' : 'debug');\n }}\n >\n {showDebugTestIds ? 'Hide CopyButton' : 'Show CopyButton'}\n </Button>\n <Json\n value={{\n values,\n errors: errors ?? null,\n submit: {\n isValid,\n isSubmitting,\n isSubmitSuccessful,\n submitCount,\n },\n }}\n />\n </Card>\n );\n};\n\nexport default FormDebugViewer;\n","import type { VetoInstance } from '@fuf-stack/veto';\nimport type { ReactNode } from 'react';\nimport type { FieldValues, SubmitHandler } from 'react-hook-form';\nimport type { DebugModeSettings } from './subcomponents/FormContext';\n\nimport { cn, slugify } from '@fuf-stack/pixel-utils';\n\nimport FormProvider from './subcomponents/FormContext';\nimport FormDebugViewer from './subcomponents/FormDebugViewer';\n\nconst IS_TEST = process.env.NODE_ENV === 'test';\n\nexport interface FormProps {\n /** form children */\n children: ReactNode | ReactNode[];\n /** CSS class name */\n className?: string | string[];\n /** settings for from debug mode */\n debug?: DebugModeSettings;\n /** initial form values */\n initialValues?: FieldValues;\n /** name of the form */\n name?: string;\n /** form submit handler */\n onSubmit: SubmitHandler<FieldValues>;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** veto validation schema */\n validation?: VetoInstance;\n /** when the validation should be triggered */\n validationTrigger?: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';\n}\n\n/**\n * Form component that has to wrap every uniform\n */\nconst Form = ({\n children,\n className = undefined,\n debug = undefined,\n initialValues = undefined,\n name = undefined,\n onSubmit,\n testId = undefined,\n validation = undefined,\n validationTrigger = 'all',\n}: FormProps) => {\n return (\n <FormProvider\n debugModeSettings={debug}\n initialValues={initialValues}\n onSubmit={onSubmit}\n validation={validation}\n validationTrigger={validationTrigger}\n >\n {({ handleSubmit, isValid }) => {\n return (\n <div className=\"flex w-full flex-row justify-between gap-6\">\n <form\n className={cn('grow', className)}\n data-form-is-valid={isValid}\n data-testid={slugify(testId ?? name ?? '')}\n name={name}\n onSubmit={handleSubmit}\n >\n {children}\n </form>\n {/* render debug viewer when not in test environment and debug not disabled */}\n {!IS_TEST && !debug?.disable && (\n <FormDebugViewer className=\"w-96 shrink\" />\n )}\n </div>\n );\n }}\n </FormProvider>\n );\n};\n\nexport default Form;\n","import Form from './Form';\n\nexport type { FormProps } from './Form';\n\nexport { Form };\n\nexport default Form;\n"],"mappings":";;;;;;;;;;;;;AAoBA,MAAM,mBAAmB,EAAE,YAAY,KAAA,QAAsC;CAC3E,MAAM,EACJ,WACA,WAAW,EAAE,SAAS,cAAc,aAAa,sBACjD,WACA,cACA,YAAY,EAAE,UACd,cACE,gBAAgB;CAEpB,MAAM,kBAAkB,cAAc;CACtC,MAAM,gBAAgB,cAAc,WAAW,cAAc;CAC7D,MAAM,mBAAmB,cAAc;CAIvC,MAAM,CAAC,QAAQ,aAAa,SAAkC,EAAE,CAAC;AAEjE,iBAAgB;AAEd,MAAI,CAAC,cACH;AAIF,YAAU,WAAW,IAAI,EAAE,CAAC;EAE5B,MAAM,eAAe,UAAU;GAC7B,WAAW,EAAE,QAAQ,MAAM;GAC3B,WAAW,UAAU;AACnB,cAAU,MAAM,UAAU,EAAE,CAAC;;GAEhC,CAAC;AAEF,eAAa;AACX,iBAAc;;IAGf,CAAC,cAAc,CAAC;AAEnB,KAAI,gBACF,QACE,oBAAC,QAAD;EACE,WAAU;EACV,WAAU;EACV,MAAM,oBAAC,OAAD,EAAS,CAAA;EACf,SAAQ;EACR,eAAe;AACb,gBAAa,QAAQ;;EAEvB,CAAA;AAKN,KAAI,CAAC,cACH,QAAO;AAGT,QACE,qBAAC,MAAD;EACE,WAAW,GAAG,UAAU;EACxB,QACE,qBAAC,OAAD;GAAK,WAAU;aAAf,CACE,oBAAC,QAAD;IAAM,WAAU;cAAU;IAAiB,CAAA,EAC3C,oBAAC,QAAD;IACE,OAAM;IACN,MAAM,oBAAC,SAAD,EAAW,CAAA;IACjB,MAAK;IACL,SAAQ;IACR,eAAe;AACb,kBAAa,MAAM;;IAErB,CAAA,CACE;;YAdV,CAiBE,oBAAC,QAAD;GACE,WAAU;GACV,MAAM,oBAAC,YAAD,EAAc,CAAA;GACpB,SAAS,mBAAmB,UAAU;GACtC,eAAe;AACb,iBAAa,cAAc,UAAU,kBAAkB,QAAQ;;aAGhE,mBAAmB,oBAAoB;GACjC,CAAA,EACT,oBAAC,MAAD,EACE,OAAO;GACL;GACA,QAAQ,UAAU;GAClB,QAAQ;IACN;IACA;IACA;IACA;IACD;GACF,EACD,CAAA,CACG;;;;;AC7GX,MAAM,UAAU,QAAQ,IAAI,aAAa;;;;AA0BzC,MAAM,QAAQ,EACZ,UACA,YAAY,KAAA,GACZ,QAAQ,KAAA,GACR,gBAAgB,KAAA,GAChB,OAAO,KAAA,GACP,UACA,SAAS,KAAA,GACT,aAAa,KAAA,GACb,oBAAoB,YACL;AACf,QACE,oBAAC,cAAD;EACE,mBAAmB;EACJ;EACL;EACE;EACO;aAEjB,EAAE,cAAc,cAAc;AAC9B,UACE,qBAAC,OAAD;IAAK,WAAU;cAAf,CACE,oBAAC,QAAD;KACE,WAAW,GAAG,QAAQ,UAAU;KAChC,sBAAoB;KACpB,eAAa,QAAQ,UAAU,QAAQ,GAAG;KACpC;KACN,UAAU;KAET;KACI,CAAA,EAEN,CAAC,WAAW,CAAC,OAAO,WACnB,oBAAC,iBAAD,EAAiB,WAAU,eAAgB,CAAA,CAEzC;;;EAGG,CAAA;;;;ACpEnB,IAAA,eAAe"}
|
|
@@ -15,4 +15,4 @@ interface DebugModeSettings {
|
|
|
15
15
|
type UserChangeListener<TFieldValues extends object = object> = (fieldName: Path<TFieldValues>, value: unknown) => void;
|
|
16
16
|
//#endregion
|
|
17
17
|
export { UserChangeListener as n, DebugModeSettings as t };
|
|
18
|
-
//# sourceMappingURL=FormContext-
|
|
18
|
+
//# sourceMappingURL=FormContext-B4KQxdl7.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormContext-
|
|
1
|
+
{"version":3,"file":"FormContext-B4KQxdl7.d.ts","names":[],"sources":["../src/Form/subcomponents/FormContext.tsx"],"mappings":";;;;;UAsBiB,iBAAA;EAAiB;EAEhC,OAAA;EAAA;EAEA,eAAA;AAAA;;;;KAMU,kBAAA,0CACV,SAAA,EAAW,IAAA,CAAK,YAAA,GAChB,KAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -6,16 +6,12 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
8
|
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
}
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
19
15
|
}
|
|
20
16
|
return to;
|
|
21
17
|
};
|
|
@@ -23,18 +19,16 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
23
19
|
value: mod,
|
|
24
20
|
enumerable: true
|
|
25
21
|
}) : target, mod));
|
|
26
|
-
|
|
27
22
|
//#endregion
|
|
28
|
-
const
|
|
23
|
+
const require_helpers_index = require("./helpers/index.cjs");
|
|
29
24
|
let react = require("react");
|
|
30
|
-
react = __toESM(react);
|
|
25
|
+
react = __toESM(react, 1);
|
|
31
26
|
let _fuf_stack_pixels = require("@fuf-stack/pixels");
|
|
32
27
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
33
28
|
let react_hook_form = require("react-hook-form");
|
|
34
29
|
let debug = require("debug");
|
|
35
30
|
debug = __toESM(debug);
|
|
36
31
|
let _fuf_stack_veto = require("@fuf-stack/veto");
|
|
37
|
-
|
|
38
32
|
//#region src/Form/subcomponents/FormResolver.ts
|
|
39
33
|
/**
|
|
40
34
|
* Hook that manages client validation schemas state.
|
|
@@ -105,7 +99,7 @@ const useFormResolver = (extendedValidation) => {
|
|
|
105
99
|
const resolver = (0, react.useMemo)(() => {
|
|
106
100
|
if (!extendedValidation) return;
|
|
107
101
|
return async (values) => {
|
|
108
|
-
const validationValues =
|
|
102
|
+
const validationValues = require_helpers_index.toValidationFormat(values) ?? {};
|
|
109
103
|
const result = await extendedValidation.validateAsync(validationValues);
|
|
110
104
|
validationErrors.current = result.errors ?? void 0;
|
|
111
105
|
return {
|
|
@@ -121,7 +115,6 @@ const useFormResolver = (extendedValidation) => {
|
|
|
121
115
|
validationErrorsHash
|
|
122
116
|
};
|
|
123
117
|
};
|
|
124
|
-
|
|
125
118
|
//#endregion
|
|
126
119
|
//#region src/Form/subcomponents/FormContext.tsx
|
|
127
120
|
const debug$1 = (0, debug.default)("uniform:FormContext");
|
|
@@ -161,7 +154,7 @@ const FormProvider = ({ children, debugModeSettings = void 0, initialValues = vo
|
|
|
161
154
|
const { extendedValidation, setClientValidationSchema } = useExtendedValidation(baseValidation);
|
|
162
155
|
const { resolver, validationErrors, validationErrorsHash } = useFormResolver(extendedValidation);
|
|
163
156
|
const methods = (0, react_hook_form.useForm)({
|
|
164
|
-
defaultValues: initialValues ?
|
|
157
|
+
defaultValues: initialValues ? require_helpers_index.toFormFormat(initialValues) : initialValues,
|
|
165
158
|
mode: validationTrigger,
|
|
166
159
|
resolver
|
|
167
160
|
});
|
|
@@ -202,7 +195,7 @@ const FormProvider = ({ children, debugModeSettings = void 0, initialValues = vo
|
|
|
202
195
|
reason: !methods.formState.isValid ? "Form is invalid (will trigger validation and show errors)" : "Form is valid and preventSubmit is false"
|
|
203
196
|
});
|
|
204
197
|
const wrappedOnSubmit = (data, event) => {
|
|
205
|
-
const submitData =
|
|
198
|
+
const submitData = require_helpers_index.toSubmitFormat(data) ?? {};
|
|
206
199
|
debug$1("onSubmit callback called", { submitData });
|
|
207
200
|
return onSubmit(submitData, event);
|
|
208
201
|
};
|
|
@@ -251,25 +244,24 @@ const FormProvider = ({ children, debugModeSettings = void 0, initialValues = vo
|
|
|
251
244
|
})
|
|
252
245
|
});
|
|
253
246
|
};
|
|
254
|
-
var FormContext_default = FormProvider;
|
|
255
|
-
|
|
256
247
|
//#endregion
|
|
257
|
-
Object.defineProperty(exports,
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
248
|
+
Object.defineProperty(exports, "FormProvider", {
|
|
249
|
+
enumerable: true,
|
|
250
|
+
get: function() {
|
|
251
|
+
return FormProvider;
|
|
252
|
+
}
|
|
262
253
|
});
|
|
263
|
-
Object.defineProperty(exports,
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
254
|
+
Object.defineProperty(exports, "UniformContext", {
|
|
255
|
+
enumerable: true,
|
|
256
|
+
get: function() {
|
|
257
|
+
return UniformContext;
|
|
258
|
+
}
|
|
268
259
|
});
|
|
269
|
-
Object.defineProperty(exports,
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
260
|
+
Object.defineProperty(exports, "__toESM", {
|
|
261
|
+
enumerable: true,
|
|
262
|
+
get: function() {
|
|
263
|
+
return __toESM;
|
|
264
|
+
}
|
|
274
265
|
});
|
|
275
|
-
|
|
266
|
+
|
|
267
|
+
//# sourceMappingURL=FormContext-BrY1FQYR.cjs.map
|