ivt 0.7.2 → 0.7.4
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/accordion/index.mjs +13 -15
- package/dist/accordion/index.mjs.map +1 -1
- package/dist/accordion-table/index.mjs +26 -28
- package/dist/accordion-table/index.mjs.map +1 -1
- package/dist/alert/index.mjs +3 -3
- package/dist/alert-dialog/index.mjs +15 -17
- package/dist/alert-dialog/index.mjs.map +1 -1
- package/dist/aspect-ratio/index.mjs +42 -3
- package/dist/aspect-ratio/index.mjs.map +1 -1
- package/dist/auto-complete-multi-select/index.mjs +31 -33
- package/dist/auto-complete-multi-select/index.mjs.map +1 -1
- package/dist/avatar/index.mjs +130 -8
- package/dist/avatar/index.mjs.map +1 -1
- package/dist/badge/index.d.ts +1 -1
- package/dist/badge/index.mjs +3 -3
- package/dist/base/index.mjs +57 -142
- package/dist/base/index.mjs.map +1 -1
- package/dist/breadcrumb/index.mjs +5 -5
- package/dist/button/index.d.ts +1 -1
- package/dist/button/index.mjs +3 -3
- package/dist/button-group/index.mjs +3 -4
- package/dist/button-group/index.mjs.map +1 -1
- package/dist/calendar/index.mjs +9 -9
- package/dist/card/index.mjs +3 -3
- package/dist/carousel/index.mjs +4 -4
- package/dist/chart/index.mjs +2869 -1282
- package/dist/chart/index.mjs.map +1 -1
- package/dist/checkbox/index.mjs +12 -14
- package/dist/checkbox/index.mjs.map +1 -1
- package/dist/chunks/AutoComplete-qFuwmV53.mjs +95 -0
- package/dist/chunks/AutoComplete-qFuwmV53.mjs.map +1 -0
- package/dist/chunks/{CalendarRange-k63hDccF.mjs → CalendarRange-Ce7PiNfq.mjs} +8 -8
- package/dist/chunks/{CalendarRange-k63hDccF.mjs.map → CalendarRange-Ce7PiNfq.mjs.map} +1 -1
- package/dist/chunks/{ComboboxField-5Glf1Ozh.mjs → ComboboxField-DaRpRraW.mjs} +9 -9
- package/dist/chunks/{ComboboxField-5Glf1Ozh.mjs.map → ComboboxField-DaRpRraW.mjs.map} +1 -1
- package/dist/chunks/{Container-Cv6NG9kb.mjs → Container-DwaAaEiC.mjs} +2 -2
- package/dist/chunks/{Container-Cv6NG9kb.mjs.map → Container-DwaAaEiC.mjs.map} +1 -1
- package/dist/chunks/{DeleteConfirmationModal-DRseBzq7.mjs → DeleteConfirmationModal-BwTbbBAw.mjs} +4 -4
- package/dist/chunks/{DeleteConfirmationModal-DRseBzq7.mjs.map → DeleteConfirmationModal-BwTbbBAw.mjs.map} +1 -1
- package/dist/chunks/{ListItem-eGWDX0GP.mjs → ListItem-zxS4CZdq.mjs} +4 -4
- package/dist/chunks/{ListItem-eGWDX0GP.mjs.map → ListItem-zxS4CZdq.mjs.map} +1 -1
- package/dist/chunks/{TooltipIndicator-BjtHYQzo.mjs → TooltipIndicator-CwGGAeRz.mjs} +4 -4
- package/dist/chunks/{TooltipIndicator-BjtHYQzo.mjs.map → TooltipIndicator-CwGGAeRz.mjs.map} +1 -1
- package/dist/chunks/{_commonjsHelpers-D3vrMN3C.mjs → _commonjsHelpers-B2Be7UYW.mjs} +1 -1
- package/dist/chunks/_commonjsHelpers-B2Be7UYW.mjs.map +1 -0
- package/dist/chunks/{accordion-BsbSmZP2.mjs → accordion-D4JVALAO.mjs} +9 -11
- package/dist/chunks/{accordion-BsbSmZP2.mjs.map → accordion-D4JVALAO.mjs.map} +1 -1
- package/dist/chunks/{alert-Cw-E3eta.mjs → alert-D-E6nsVK.mjs} +2 -2
- package/dist/chunks/{alert-Cw-E3eta.mjs.map → alert-D-E6nsVK.mjs.map} +1 -1
- package/dist/chunks/{badge-DTn1AQbT.mjs → badge-C6mkl9yr.mjs} +2 -2
- package/dist/chunks/{badge-DTn1AQbT.mjs.map → badge-C6mkl9yr.mjs.map} +1 -1
- package/dist/chunks/{bundle-mjs-Lvc-Dri9.mjs → bundle-mjs-B1dpl-bk.mjs} +228 -154
- package/dist/chunks/bundle-mjs-B1dpl-bk.mjs.map +1 -0
- package/dist/chunks/{button-Cve1c7GQ.mjs → button-DsgJkgEz.mjs} +2 -2
- package/dist/chunks/{button-Cve1c7GQ.mjs.map → button-DsgJkgEz.mjs.map} +1 -1
- package/dist/chunks/{calendar-BTfcQ69r.mjs → calendar-Co99lCn4.mjs} +550 -166
- package/dist/chunks/calendar-Co99lCn4.mjs.map +1 -0
- package/dist/chunks/{calendar-days-D95Vh8Id.mjs → calendar-days-BF4GDmMr.mjs} +2 -2
- package/dist/chunks/{calendar-days-D95Vh8Id.mjs.map → calendar-days-BF4GDmMr.mjs.map} +1 -1
- package/dist/chunks/{card-BCce9vjU.mjs → card-Cuo7NL8y.mjs} +2 -2
- package/dist/chunks/{card-BCce9vjU.mjs.map → card-Cuo7NL8y.mjs.map} +1 -1
- package/dist/chunks/{check-F6R3Zyjv.mjs → check-CzKqQLNR.mjs} +2 -2
- package/dist/chunks/{check-F6R3Zyjv.mjs.map → check-CzKqQLNR.mjs.map} +1 -1
- package/dist/chunks/{checkbox-BONbXOR8.mjs → checkbox-C7RUdsIS.mjs} +9 -11
- package/dist/chunks/{checkbox-BONbXOR8.mjs.map → checkbox-C7RUdsIS.mjs.map} +1 -1
- package/dist/chunks/{chevron-down-CAAkkaxH.mjs → chevron-down-CZjN_vyX.mjs} +2 -2
- package/dist/chunks/{chevron-down-CAAkkaxH.mjs.map → chevron-down-CZjN_vyX.mjs.map} +1 -1
- package/dist/chunks/{chevron-left-D9H1SFsq.mjs → chevron-left-BpfBwM4S.mjs} +2 -2
- package/dist/chunks/{chevron-left-D9H1SFsq.mjs.map → chevron-left-BpfBwM4S.mjs.map} +1 -1
- package/dist/chunks/{chevron-right-BBzqWfgU.mjs → chevron-right-uq-O8rwC.mjs} +2 -2
- package/dist/chunks/{chevron-right-BBzqWfgU.mjs.map → chevron-right-uq-O8rwC.mjs.map} +1 -1
- package/dist/chunks/{chevrons-up-down-qNyleCLF.mjs → chevrons-up-down-DKM8h8j_.mjs} +2 -2
- package/dist/chunks/{chevrons-up-down-qNyleCLF.mjs.map → chevrons-up-down-DKM8h8j_.mjs.map} +1 -1
- package/dist/chunks/{command-IbA1nxIb.mjs → command-CAS791lb.mjs} +8 -8
- package/dist/chunks/{command-IbA1nxIb.mjs.map → command-CAS791lb.mjs.map} +1 -1
- package/dist/chunks/{createLucideIcon-0uwxvfEG.mjs → createLucideIcon-xkRZC0aJ.mjs} +1 -1
- package/dist/chunks/{createLucideIcon-0uwxvfEG.mjs.map → createLucideIcon-xkRZC0aJ.mjs.map} +1 -1
- package/dist/chunks/{date-BBTPAd8S.mjs → date-DYEUxjwi.mjs} +2 -2
- package/dist/chunks/{date-BBTPAd8S.mjs.map → date-DYEUxjwi.mjs.map} +1 -1
- package/dist/chunks/{dialog-B2DUrpTa.mjs → dialog-Dt_M700u.mjs} +4 -4
- package/dist/chunks/{dialog-B2DUrpTa.mjs.map → dialog-Dt_M700u.mjs.map} +1 -1
- package/dist/chunks/{ellipsis-DvX337aw.mjs → ellipsis-BcRZkfZw.mjs} +2 -2
- package/dist/chunks/{ellipsis-DvX337aw.mjs.map → ellipsis-BcRZkfZw.mjs.map} +1 -1
- package/dist/chunks/{form-CChLO9RR.mjs → form-CJnoOgoH.mjs} +299 -150
- package/dist/chunks/form-CJnoOgoH.mjs.map +1 -0
- package/dist/chunks/{format-4Jz4C5tC.mjs → format-BSPAt__h.mjs} +1 -1
- package/dist/chunks/{format-4Jz4C5tC.mjs.map → format-BSPAt__h.mjs.map} +1 -1
- package/dist/chunks/{format-numbers-BhgU0ZHz.mjs → format-numbers-BpGX211b.mjs} +2 -6
- package/dist/chunks/format-numbers-BpGX211b.mjs.map +1 -0
- package/dist/chunks/{hover-card-DX4d068Z.mjs → hover-card-DKMcpBnt.mjs} +9 -11
- package/dist/chunks/{hover-card-DX4d068Z.mjs.map → hover-card-DKMcpBnt.mjs.map} +1 -1
- package/dist/chunks/{index-6TVIC1_R.mjs → index-0DBJW078.mjs} +2 -2
- package/dist/chunks/{index-6TVIC1_R.mjs.map → index-0DBJW078.mjs.map} +1 -1
- package/dist/chunks/{index-Bx0xXTid.mjs → index-7wUPkpwA.mjs} +9 -11
- package/dist/chunks/{index-Bx0xXTid.mjs.map → index-7wUPkpwA.mjs.map} +1 -1
- package/dist/chunks/{index-Bewwph0a.mjs → index-9921_a2g.mjs} +1 -1
- package/dist/chunks/{index-Bewwph0a.mjs.map → index-9921_a2g.mjs.map} +1 -1
- package/dist/chunks/{index-CkRZ2gKz.mjs → index-B49Rv10M.mjs} +1 -1
- package/dist/chunks/{index-CkRZ2gKz.mjs.map → index-B49Rv10M.mjs.map} +1 -1
- package/dist/chunks/{index-na6H-GCB.mjs → index-B8pOe-bI.mjs} +13 -15
- package/dist/chunks/{index-na6H-GCB.mjs.map → index-B8pOe-bI.mjs.map} +1 -1
- package/dist/chunks/{index-DpW61g8q.mjs → index-B8zlei3I.mjs} +1 -1
- package/dist/chunks/{index-DpW61g8q.mjs.map → index-B8zlei3I.mjs.map} +1 -1
- package/dist/chunks/{index-CWI00LgK.mjs → index-BpZD69GD.mjs} +2 -2
- package/dist/chunks/{index-CWI00LgK.mjs.map → index-BpZD69GD.mjs.map} +1 -1
- package/dist/chunks/{index-BSGOnYAL.mjs → index-BtdTgi0_.mjs} +1 -1
- package/dist/chunks/{index-BSGOnYAL.mjs.map → index-BtdTgi0_.mjs.map} +1 -1
- package/dist/chunks/{index-YaCKvBnb.mjs → index-Cm5-jAR7.mjs} +38 -2
- package/dist/chunks/index-Cm5-jAR7.mjs.map +1 -0
- package/dist/chunks/{index-Ch8cepWA.mjs → index-CsC-dafu.mjs} +3 -3
- package/dist/chunks/{index-Ch8cepWA.mjs.map → index-CsC-dafu.mjs.map} +1 -1
- package/dist/chunks/{index-DR3ok_zE.mjs → index-CuEeN4AG.mjs} +6 -7
- package/dist/chunks/{index-DR3ok_zE.mjs.map → index-CuEeN4AG.mjs.map} +1 -1
- package/dist/chunks/{index-CO3WOWY2.mjs → index-CvWc6WZ4.mjs} +7 -9
- package/dist/chunks/{index-CO3WOWY2.mjs.map → index-CvWc6WZ4.mjs.map} +1 -1
- package/dist/chunks/{index-CYpZ8qGv.mjs → index-DSBOi0JP.mjs} +4 -5
- package/dist/chunks/{index-CYpZ8qGv.mjs.map → index-DSBOi0JP.mjs.map} +1 -1
- package/dist/chunks/{index-F1Vay3hL.mjs → index-DWtzT31F.mjs} +2 -2
- package/dist/chunks/{index-F1Vay3hL.mjs.map → index-DWtzT31F.mjs.map} +1 -1
- package/dist/chunks/{index-DCv7HM9c.mjs → index-DaifcY5X.mjs} +7 -9
- package/dist/chunks/{index-DCv7HM9c.mjs.map → index-DaifcY5X.mjs.map} +1 -1
- package/dist/chunks/{index-BrfogwJw.mjs → index-DjoMuta5.mjs} +1 -1
- package/dist/chunks/{index-BrfogwJw.mjs.map → index-DjoMuta5.mjs.map} +1 -1
- package/dist/chunks/{index-utzX5BKz.mjs → index-Dn87UbZu.mjs} +2 -2
- package/dist/chunks/{index-utzX5BKz.mjs.map → index-Dn87UbZu.mjs.map} +1 -1
- package/dist/chunks/{index-CrXpydfv.mjs → index-G8uUqzC7.mjs} +12 -2
- package/dist/chunks/index-G8uUqzC7.mjs.map +1 -0
- package/dist/chunks/{index-D2G_PixC.mjs → index-SJQIKyxi.mjs} +1 -1
- package/dist/chunks/{index-D2G_PixC.mjs.map → index-SJQIKyxi.mjs.map} +1 -1
- package/dist/chunks/{index-Dw0VFoXM.mjs → index-fcmnzZn6.mjs} +12 -5
- package/dist/chunks/index-fcmnzZn6.mjs.map +1 -0
- package/dist/chunks/{index-cxmuS08t.mjs → index-zv8c0UAU.mjs} +3 -3
- package/dist/chunks/{index-cxmuS08t.mjs.map → index-zv8c0UAU.mjs.map} +1 -1
- package/dist/chunks/index.module-B_Z75X1e.mjs +73 -0
- package/dist/chunks/index.module-B_Z75X1e.mjs.map +1 -0
- package/dist/chunks/{input-DA9gkhwB.mjs → input-NILUGijL.mjs} +2 -2
- package/dist/chunks/{input-DA9gkhwB.mjs.map → input-NILUGijL.mjs.map} +1 -1
- package/dist/chunks/input-otp-b-7MmY2H.mjs +455 -0
- package/dist/chunks/input-otp-b-7MmY2H.mjs.map +1 -0
- package/dist/chunks/{label-BgC413_9.mjs → label-81mjh4Q4.mjs} +44 -3
- package/dist/chunks/label-81mjh4Q4.mjs.map +1 -0
- package/dist/chunks/{loader-circle-CmQoMw39.mjs → loader-circle-sGBNpyP3.mjs} +2 -2
- package/dist/chunks/{loader-circle-CmQoMw39.mjs.map → loader-circle-sGBNpyP3.mjs.map} +1 -1
- package/dist/chunks/{menubar-DU7jMSAY.mjs → menubar-Dz5biTZv.mjs} +11 -13
- package/dist/chunks/{menubar-DU7jMSAY.mjs.map → menubar-Dz5biTZv.mjs.map} +1 -1
- package/dist/chunks/{multi-select-QKfLMC0m.mjs → multi-select-DeW-tL6j.mjs} +13 -13
- package/dist/chunks/{multi-select-QKfLMC0m.mjs.map → multi-select-DeW-tL6j.mjs.map} +1 -1
- package/dist/chunks/{pagination-zyJ5vFmL.mjs → pagination-0W2Kek6Z.mjs} +6 -6
- package/dist/chunks/{pagination-zyJ5vFmL.mjs.map → pagination-0W2Kek6Z.mjs.map} +1 -1
- package/dist/chunks/{popover-RcJ808cy.mjs → popover-ChoMUAP9.mjs} +11 -13
- package/dist/chunks/{popover-RcJ808cy.mjs.map → popover-ChoMUAP9.mjs.map} +1 -1
- package/dist/chunks/progress-zrBdDKEV.mjs +223 -0
- package/dist/chunks/progress-zrBdDKEV.mjs.map +1 -0
- package/dist/chunks/radio-group-r3ejuIom.mjs +258 -0
- package/dist/chunks/radio-group-r3ejuIom.mjs.map +1 -0
- package/dist/chunks/{react-number-format.es-CyaQTuwn.mjs → react-number-format.es-rRpdCutF.mjs} +1 -1
- package/dist/chunks/{react-number-format.es-CyaQTuwn.mjs.map → react-number-format.es-rRpdCutF.mjs.map} +1 -1
- package/dist/chunks/{scroll-area-DUSbQJic.mjs → scroll-area-DjtXX0pm.mjs} +9 -11
- package/dist/chunks/{scroll-area-DUSbQJic.mjs.map → scroll-area-DjtXX0pm.mjs.map} +1 -1
- package/dist/chunks/{select-DqpIJliN.mjs → select-CICQavYx.mjs} +5 -5
- package/dist/chunks/{select-DqpIJliN.mjs.map → select-CICQavYx.mjs.map} +1 -1
- package/dist/chunks/{separator-h4204yqZ.mjs → separator-CL28DVoA.mjs} +44 -3
- package/dist/chunks/separator-CL28DVoA.mjs.map +1 -0
- package/dist/chunks/{sheet-ChrvUpAV.mjs → sheet-BIN5Bwkz.mjs} +4 -4
- package/dist/chunks/{sheet-ChrvUpAV.mjs.map → sheet-BIN5Bwkz.mjs.map} +1 -1
- package/dist/chunks/{skeleton-DYRcDQga.mjs → skeleton-DEo09dsp.mjs} +2 -2
- package/dist/chunks/{skeleton-DYRcDQga.mjs.map → skeleton-DEo09dsp.mjs.map} +1 -1
- package/dist/chunks/slider-C_afdOBq.mjs +588 -0
- package/dist/chunks/slider-C_afdOBq.mjs.map +1 -0
- package/dist/chunks/{sortable-B9EKkKQQ.mjs → sortable-Hz2p-hG_.mjs} +3 -3
- package/dist/chunks/{sortable-B9EKkKQQ.mjs.map → sortable-Hz2p-hG_.mjs.map} +1 -1
- package/dist/chunks/styles-DQr_CtBg.mjs +6 -0
- package/dist/chunks/styles-DQr_CtBg.mjs.map +1 -0
- package/dist/chunks/switch-CoxjUYji.mjs +138 -0
- package/dist/chunks/switch-CoxjUYji.mjs.map +1 -0
- package/dist/chunks/{table-Bf_4RiC6.mjs → table-CaTzvnGO.mjs} +2 -2
- package/dist/chunks/{table-Bf_4RiC6.mjs.map → table-CaTzvnGO.mjs.map} +1 -1
- package/dist/chunks/{tabs-BH56W9Uk.mjs → tabs-DbcqE74l.mjs} +9 -10
- package/dist/chunks/{tabs-BH56W9Uk.mjs.map → tabs-DbcqE74l.mjs.map} +1 -1
- package/dist/chunks/{textarea-D1VTvn_8.mjs → textarea-C99bTFre.mjs} +2 -2
- package/dist/chunks/{textarea-D1VTvn_8.mjs.map → textarea-C99bTFre.mjs.map} +1 -1
- package/dist/chunks/{toggle-DPn3fWo1.mjs → toggle-x7-6JYvP.mjs} +4 -5
- package/dist/chunks/{toggle-DPn3fWo1.mjs.map → toggle-x7-6JYvP.mjs.map} +1 -1
- package/dist/chunks/{tooltip-DL6xVJHi.mjs → tooltip-aCFcTWvT.mjs} +11 -13
- package/dist/chunks/{tooltip-DL6xVJHi.mjs.map → tooltip-aCFcTWvT.mjs.map} +1 -1
- package/dist/chunks/{trash-2-B6-kuqxf.mjs → trash-2-BRTBRPsE.mjs} +2 -2
- package/dist/chunks/{trash-2-B6-kuqxf.mjs.map → trash-2-BRTBRPsE.mjs.map} +1 -1
- package/dist/chunks/{triangle-alert-Gr8soT6b.mjs → triangle-alert-DEr_0gbo.mjs} +2 -2
- package/dist/chunks/{triangle-alert-Gr8soT6b.mjs.map → triangle-alert-DEr_0gbo.mjs.map} +1 -1
- package/dist/chunks/{tslib.es6-Bf7t9JE-.mjs → tslib.es6-9fTryOSE.mjs} +1 -1
- package/dist/chunks/{tslib.es6-Bf7t9JE-.mjs.map → tslib.es6-9fTryOSE.mjs.map} +1 -1
- package/dist/chunks/{utils-BOlqGJrg.mjs → utils-M7D-rn0u.mjs} +2 -2
- package/dist/chunks/{utils-BOlqGJrg.mjs.map → utils-M7D-rn0u.mjs.map} +1 -1
- package/dist/chunks/{wand-sparkles-BOLdCXYe.mjs → wand-sparkles-cr6EaHA_.mjs} +2 -2
- package/dist/chunks/{wand-sparkles-BOLdCXYe.mjs.map → wand-sparkles-cr6EaHA_.mjs.map} +1 -1
- package/dist/chunks/{x-DWHixXf6.mjs → x-Heb3hHKJ.mjs} +2 -2
- package/dist/chunks/{x-DWHixXf6.mjs.map → x-Heb3hHKJ.mjs.map} +1 -1
- package/dist/collapsible/index.mjs +8 -10
- package/dist/collapsible/index.mjs.map +1 -1
- package/dist/combobox/index.mjs +25 -27
- package/dist/combobox/index.mjs.map +1 -1
- package/dist/command/index.mjs +19 -21
- package/dist/command/index.mjs.map +1 -1
- package/dist/context-menu/index.mjs +21 -23
- package/dist/context-menu/index.mjs.map +1 -1
- package/dist/dash/index.mjs +25 -26
- package/dist/dash/index.mjs.map +1 -1
- package/dist/data-table/index.mjs +33 -35
- package/dist/data-table/index.mjs.map +1 -1
- package/dist/date-picker/index.mjs +26 -28
- package/dist/date-picker/index.mjs.map +1 -1
- package/dist/dialog/index.mjs +18 -20
- package/dist/dialog/index.mjs.map +1 -1
- package/dist/drawer/index.mjs +15 -17
- package/dist/drawer/index.mjs.map +1 -1
- package/dist/dropdown-menu/index.mjs +21 -23
- package/dist/dropdown-menu/index.mjs.map +1 -1
- package/dist/dropzone/index.mjs +16 -18
- package/dist/dropzone/index.mjs.map +1 -1
- package/dist/editable-table/index.mjs +52 -30
- package/dist/editable-table/index.mjs.map +1 -1
- package/dist/empty/index.mjs +2 -2
- package/dist/field/index.mjs +4 -5
- package/dist/field/index.mjs.map +1 -1
- package/dist/form/index.mjs +4 -5
- package/dist/form/index.mjs.map +1 -1
- package/dist/form-fields/index.mjs +27 -29
- package/dist/form-fields/index.mjs.map +1 -1
- package/dist/form-layout/index.d.ts +85 -0
- package/dist/form-layout/index.mjs +534 -0
- package/dist/form-layout/index.mjs.map +1 -0
- package/dist/hover-card/index.mjs +14 -16
- package/dist/hover-card/index.mjs.map +1 -1
- package/dist/icon/index.mjs +1 -1
- package/dist/index.css +1 -1
- package/dist/input/index.mjs +3 -3
- package/dist/input-group/index.mjs +5 -5
- package/dist/input-otp/index.mjs +5 -455
- package/dist/input-otp/index.mjs.map +1 -1
- package/dist/item/index.mjs +3 -4
- package/dist/item/index.mjs.map +1 -1
- package/dist/ivt.css +1 -1
- package/dist/kbd/index.mjs +2 -2
- package/dist/label/index.mjs +3 -4
- package/dist/label/index.mjs.map +1 -1
- package/dist/layout/index.mjs +22 -24
- package/dist/layout/index.mjs.map +1 -1
- package/dist/menubar/index.mjs +22 -24
- package/dist/menubar/index.mjs.map +1 -1
- package/dist/multi-input-list/index.d.ts +0 -1
- package/dist/multi-input-list/index.mjs +31 -39
- package/dist/multi-input-list/index.mjs.map +1 -1
- package/dist/multi-select/index.mjs +32 -34
- package/dist/multi-select/index.mjs.map +1 -1
- package/dist/navigation-menu/index.mjs +15 -17
- package/dist/navigation-menu/index.mjs.map +1 -1
- package/dist/pagination/index.mjs +8 -8
- package/dist/popover/index.mjs +17 -19
- package/dist/popover/index.mjs.map +1 -1
- package/dist/progress/index.mjs +3 -5
- package/dist/progress/index.mjs.map +1 -1
- package/dist/radio-group/index.mjs +18 -264
- package/dist/radio-group/index.mjs.map +1 -1
- package/dist/resizable/index.mjs +3 -3
- package/dist/scroll-area/index.mjs +10 -12
- package/dist/scroll-area/index.mjs.map +1 -1
- package/dist/select/index.mjs +6 -6
- package/dist/separator/index.mjs +3 -4
- package/dist/separator/index.mjs.map +1 -1
- package/dist/shared/index.mjs +5 -5
- package/dist/sheet/index.mjs +18 -20
- package/dist/sheet/index.mjs.map +1 -1
- package/dist/sidebar/index.mjs +26 -28
- package/dist/sidebar/index.mjs.map +1 -1
- package/dist/skeleton/index.mjs +3 -3
- package/dist/skeleton-component/index.mjs +4 -4
- package/dist/slider/index.mjs +14 -591
- package/dist/slider/index.mjs.map +1 -1
- package/dist/sortable/index.mjs +4 -4
- package/dist/spinner/index.mjs +4 -4
- package/dist/switch/index.mjs +11 -141
- package/dist/switch/index.mjs.map +1 -1
- package/dist/table/index.mjs +3 -3
- package/dist/table-filter/index.mjs +53 -54
- package/dist/table-filter/index.mjs.map +1 -1
- package/dist/tabs/index.mjs +14 -16
- package/dist/tabs/index.mjs.map +1 -1
- package/dist/textarea/index.mjs +3 -3
- package/dist/toast/index.mjs +13 -15
- package/dist/toast/index.mjs.map +1 -1
- package/dist/toggle/index.mjs +6 -7
- package/dist/toggle/index.mjs.map +1 -1
- package/dist/toggle-group/index.mjs +11 -13
- package/dist/toggle-group/index.mjs.map +1 -1
- package/dist/tooltip/index.mjs +16 -18
- package/dist/tooltip/index.mjs.map +1 -1
- package/package.json +475 -470
- package/dist/chunks/_commonjsHelpers-D3vrMN3C.mjs.map +0 -1
- package/dist/chunks/bundle-mjs-Lvc-Dri9.mjs.map +0 -1
- package/dist/chunks/calendar-BTfcQ69r.mjs.map +0 -1
- package/dist/chunks/form-CChLO9RR.mjs.map +0 -1
- package/dist/chunks/format-numbers-BhgU0ZHz.mjs.map +0 -1
- package/dist/chunks/index-BeWMIyGj.mjs +0 -12
- package/dist/chunks/index-BeWMIyGj.mjs.map +0 -1
- package/dist/chunks/index-CrXpydfv.mjs.map +0 -1
- package/dist/chunks/index-D5BJ_0bf.mjs +0 -40
- package/dist/chunks/index-D5BJ_0bf.mjs.map +0 -1
- package/dist/chunks/index-Dw0VFoXM.mjs.map +0 -1
- package/dist/chunks/index-YaCKvBnb.mjs.map +0 -1
- package/dist/chunks/index.module-DOV7zOvH.mjs +0 -68
- package/dist/chunks/index.module-DOV7zOvH.mjs.map +0 -1
- package/dist/chunks/label-BgC413_9.mjs.map +0 -1
- package/dist/chunks/progress-BcHalZVV.mjs +0 -99
- package/dist/chunks/progress-BcHalZVV.mjs.map +0 -1
- package/dist/chunks/separator-h4204yqZ.mjs.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Slot } from '@radix-ui/react-slot';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import React__default from 'react';
|
|
4
|
-
import { c as cn } from './utils-
|
|
5
|
-
import { L as Label } from './label-
|
|
4
|
+
import { c as cn } from './utils-M7D-rn0u.mjs';
|
|
5
|
+
import { L as Label } from './label-81mjh4Q4.mjs';
|
|
6
6
|
|
|
7
7
|
var isCheckBoxInput = (element)=>element.type === 'checkbox';
|
|
8
8
|
var isDateObject = (value1)=>value1 instanceof Date;
|
|
@@ -18,25 +18,23 @@ var isPlainObject = (tempObject)=>{
|
|
|
18
18
|
};
|
|
19
19
|
var isWeb = typeof window !== 'undefined' && typeof window.HTMLElement !== 'undefined' && typeof document !== 'undefined';
|
|
20
20
|
function cloneObject(data) {
|
|
21
|
-
let copy;
|
|
22
|
-
const isArray = Array.isArray(data);
|
|
23
|
-
const isFileListInstance = typeof FileList !== 'undefined' ? data instanceof FileList : false;
|
|
24
21
|
if (data instanceof Date) {
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
copy[key] = cloneObject(data[key]);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
} else {
|
|
22
|
+
return new Date(data);
|
|
23
|
+
}
|
|
24
|
+
const isFileListInstance = typeof FileList !== 'undefined' && data instanceof FileList;
|
|
25
|
+
if (isWeb && (data instanceof Blob || isFileListInstance)) {
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
const isArray = Array.isArray(data);
|
|
29
|
+
if (!isArray && !(isObject(data) && isPlainObject(data))) {
|
|
38
30
|
return data;
|
|
39
31
|
}
|
|
32
|
+
const copy = isArray ? [] : Object.create(Object.getPrototypeOf(data));
|
|
33
|
+
for(const key in data){
|
|
34
|
+
if (Object.prototype.hasOwnProperty.call(data, key)) {
|
|
35
|
+
copy[key] = cloneObject(data[key]);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
40
38
|
return copy;
|
|
41
39
|
}
|
|
42
40
|
var isKey = (value1)=>/^\w*$/.test(value1);
|
|
@@ -53,6 +51,7 @@ var get = (object, path, defaultValue)=>{
|
|
|
53
51
|
return isUndefined(result) || result === object ? isUndefined(object[path]) ? defaultValue : object[path] : result;
|
|
54
52
|
};
|
|
55
53
|
var isBoolean = (value1)=>typeof value1 === 'boolean';
|
|
54
|
+
var isFunction = (value1)=>typeof value1 === 'function';
|
|
56
55
|
var set = (object, path, value1)=>{
|
|
57
56
|
let index = -1;
|
|
58
57
|
const tempPath = isKey(path) ? [
|
|
@@ -95,73 +94,14 @@ const INPUT_VALIDATION_RULES = {
|
|
|
95
94
|
required: 'required',
|
|
96
95
|
validate: 'validate'
|
|
97
96
|
};
|
|
98
|
-
const HookFormContext = React__default.createContext(null);
|
|
99
|
-
HookFormContext.displayName = 'HookFormContext';
|
|
100
97
|
/**
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
*
|
|
106
|
-
* @returns return all useForm methods
|
|
107
|
-
*
|
|
108
|
-
* @example
|
|
109
|
-
* ```tsx
|
|
110
|
-
* function App() {
|
|
111
|
-
* const methods = useForm();
|
|
112
|
-
* const onSubmit = data => console.log(data);
|
|
113
|
-
*
|
|
114
|
-
* return (
|
|
115
|
-
* <FormProvider {...methods} >
|
|
116
|
-
* <form onSubmit={methods.handleSubmit(onSubmit)}>
|
|
117
|
-
* <NestedInput />
|
|
118
|
-
* <input type="submit" />
|
|
119
|
-
* </form>
|
|
120
|
-
* </FormProvider>
|
|
121
|
-
* );
|
|
122
|
-
* }
|
|
123
|
-
*
|
|
124
|
-
* function NestedInput() {
|
|
125
|
-
* const { register } = useFormContext(); // retrieve all hook methods
|
|
126
|
-
* return <input {...register("test")} />;
|
|
127
|
-
* }
|
|
128
|
-
* ```
|
|
129
|
-
*/ const useFormContext = ()=>React__default.useContext(HookFormContext);
|
|
98
|
+
* Separate context for `control` to prevent unnecessary rerenders.
|
|
99
|
+
* Internal hooks that only need control use this instead of full form context.
|
|
100
|
+
*/ const HookFormControlContext = React__default.createContext(null);
|
|
101
|
+
HookFormControlContext.displayName = 'HookFormControlContext';
|
|
130
102
|
/**
|
|
131
|
-
*
|
|
132
|
-
|
|
133
|
-
* @remarks
|
|
134
|
-
* [API](https://react-hook-form.com/docs/useformcontext) • [Demo](https://codesandbox.io/s/react-hook-form-v7-form-context-ytudi)
|
|
135
|
-
*
|
|
136
|
-
* @param props - all useForm methods
|
|
137
|
-
*
|
|
138
|
-
* @example
|
|
139
|
-
* ```tsx
|
|
140
|
-
* function App() {
|
|
141
|
-
* const methods = useForm();
|
|
142
|
-
* const onSubmit = data => console.log(data);
|
|
143
|
-
*
|
|
144
|
-
* return (
|
|
145
|
-
* <FormProvider {...methods} >
|
|
146
|
-
* <form onSubmit={methods.handleSubmit(onSubmit)}>
|
|
147
|
-
* <NestedInput />
|
|
148
|
-
* <input type="submit" />
|
|
149
|
-
* </form>
|
|
150
|
-
* </FormProvider>
|
|
151
|
-
* );
|
|
152
|
-
* }
|
|
153
|
-
*
|
|
154
|
-
* function NestedInput() {
|
|
155
|
-
* const { register } = useFormContext(); // retrieve all hook methods
|
|
156
|
-
* return <input {...register("test")} />;
|
|
157
|
-
* }
|
|
158
|
-
* ```
|
|
159
|
-
*/ const FormProvider = (props)=>{
|
|
160
|
-
const { children, ...data } = props;
|
|
161
|
-
return React__default.createElement(HookFormContext.Provider, {
|
|
162
|
-
value: data
|
|
163
|
-
}, children);
|
|
164
|
-
};
|
|
103
|
+
* @internal Internal hook to access only control from context.
|
|
104
|
+
*/ const useFormControlContext = ()=>React__default.useContext(HookFormControlContext);
|
|
165
105
|
var getProxyFormState = (formState, control, localProxyFormState, isRoot = true)=>{
|
|
166
106
|
const result = {
|
|
167
107
|
defaultValues: control._defaultValues
|
|
@@ -211,8 +151,8 @@ const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React__default
|
|
|
211
151
|
* }
|
|
212
152
|
* ```
|
|
213
153
|
*/ function useFormState(props) {
|
|
214
|
-
const
|
|
215
|
-
const { control =
|
|
154
|
+
const formControl = useFormControlContext();
|
|
155
|
+
const { control = formControl, disabled, name, exact } = props || {};
|
|
216
156
|
const [formState, updateFormState] = React__default.useState(control._formState);
|
|
217
157
|
const _localProxyFormState = React__default.useRef({
|
|
218
158
|
isDirty: false,
|
|
@@ -264,10 +204,10 @@ var generateWatchOutput = (names, _names, formValues, isGlobal, defaultValue)=>{
|
|
|
264
204
|
var isPrimitive = (value1)=>isNullOrUndefined(value1) || !isObjectType(value1);
|
|
265
205
|
function deepEqual(object1, object2, _internal_visited = new WeakSet()) {
|
|
266
206
|
if (isPrimitive(object1) || isPrimitive(object2)) {
|
|
267
|
-
return object1
|
|
207
|
+
return Object.is(object1, object2);
|
|
268
208
|
}
|
|
269
209
|
if (isDateObject(object1) && isDateObject(object2)) {
|
|
270
|
-
return object1.getTime()
|
|
210
|
+
return Object.is(object1.getTime(), object2.getTime());
|
|
271
211
|
}
|
|
272
212
|
const keys1 = Object.keys(object1);
|
|
273
213
|
const keys2 = Object.keys(object2);
|
|
@@ -286,7 +226,7 @@ function deepEqual(object1, object2, _internal_visited = new WeakSet()) {
|
|
|
286
226
|
}
|
|
287
227
|
if (key !== 'ref') {
|
|
288
228
|
const val2 = object2[key];
|
|
289
|
-
if (isDateObject(val1) && isDateObject(val2) || isObject(val1) && isObject(val2) || Array.isArray(val1) && Array.isArray(val2) ? !deepEqual(val1, val2, _internal_visited) : val1
|
|
229
|
+
if (isDateObject(val1) && isDateObject(val2) || isObject(val1) && isObject(val2) || Array.isArray(val1) && Array.isArray(val2) ? !deepEqual(val1, val2, _internal_visited) : !Object.is(val1, val2)) {
|
|
290
230
|
return false;
|
|
291
231
|
}
|
|
292
232
|
}
|
|
@@ -309,45 +249,91 @@ function deepEqual(object1, object2, _internal_visited = new WeakSet()) {
|
|
|
309
249
|
* })
|
|
310
250
|
* ```
|
|
311
251
|
*/ function useWatch(props) {
|
|
312
|
-
const
|
|
313
|
-
const { control =
|
|
252
|
+
const formControl = useFormControlContext();
|
|
253
|
+
const { control = formControl, name, defaultValue, disabled, exact, compute } = props || {};
|
|
314
254
|
const _defaultValue = React__default.useRef(defaultValue);
|
|
315
255
|
const _compute = React__default.useRef(compute);
|
|
316
256
|
const _computeFormValues = React__default.useRef(undefined);
|
|
257
|
+
const _prevControl = React__default.useRef(control);
|
|
258
|
+
const _prevName = React__default.useRef(name);
|
|
317
259
|
_compute.current = compute;
|
|
318
|
-
const
|
|
319
|
-
control,
|
|
260
|
+
const [value1, updateValue] = React__default.useState(()=>{
|
|
261
|
+
const defaultValue = control._getWatch(name, _defaultValue.current);
|
|
262
|
+
return _compute.current ? _compute.current(defaultValue) : defaultValue;
|
|
263
|
+
});
|
|
264
|
+
const getCurrentOutput = React__default.useCallback((values)=>{
|
|
265
|
+
const formValues = generateWatchOutput(name, control._names, values || control._formValues, false, _defaultValue.current);
|
|
266
|
+
return _compute.current ? _compute.current(formValues) : formValues;
|
|
267
|
+
}, [
|
|
268
|
+
control._formValues,
|
|
269
|
+
control._names,
|
|
320
270
|
name
|
|
321
271
|
]);
|
|
322
|
-
const
|
|
323
|
-
|
|
272
|
+
const refreshValue = React__default.useCallback((values)=>{
|
|
273
|
+
if (!disabled) {
|
|
274
|
+
const formValues = generateWatchOutput(name, control._names, values || control._formValues, false, _defaultValue.current);
|
|
275
|
+
if (_compute.current) {
|
|
276
|
+
const computedFormValues = _compute.current(formValues);
|
|
277
|
+
if (!deepEqual(computedFormValues, _computeFormValues.current)) {
|
|
278
|
+
updateValue(computedFormValues);
|
|
279
|
+
_computeFormValues.current = computedFormValues;
|
|
280
|
+
}
|
|
281
|
+
} else {
|
|
282
|
+
updateValue(formValues);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}, [
|
|
286
|
+
control._formValues,
|
|
287
|
+
control._names,
|
|
288
|
+
disabled,
|
|
289
|
+
name
|
|
290
|
+
]);
|
|
291
|
+
useIsomorphicLayoutEffect(()=>{
|
|
292
|
+
if (_prevControl.current !== control || !deepEqual(_prevName.current, name)) {
|
|
293
|
+
_prevControl.current = control;
|
|
294
|
+
_prevName.current = name;
|
|
295
|
+
refreshValue();
|
|
296
|
+
}
|
|
297
|
+
return control._subscribe({
|
|
324
298
|
name,
|
|
325
299
|
formState: {
|
|
326
300
|
values: true
|
|
327
301
|
},
|
|
328
302
|
exact,
|
|
329
303
|
callback: (formState)=>{
|
|
330
|
-
|
|
331
|
-
const formValues = generateWatchOutput(name, control._names, formState.values || control._formValues, false, _defaultValue.current);
|
|
332
|
-
if (_compute.current) {
|
|
333
|
-
const computedFormValues = _compute.current(formValues);
|
|
334
|
-
if (!deepEqual(computedFormValues, _computeFormValues.current)) {
|
|
335
|
-
updateValue(computedFormValues);
|
|
336
|
-
_computeFormValues.current = computedFormValues;
|
|
337
|
-
}
|
|
338
|
-
} else {
|
|
339
|
-
updateValue(formValues);
|
|
340
|
-
}
|
|
341
|
-
}
|
|
304
|
+
refreshValue(formState.values);
|
|
342
305
|
}
|
|
343
|
-
})
|
|
306
|
+
});
|
|
307
|
+
}, [
|
|
344
308
|
control,
|
|
345
|
-
|
|
309
|
+
exact,
|
|
346
310
|
name,
|
|
347
|
-
|
|
311
|
+
refreshValue
|
|
348
312
|
]);
|
|
349
313
|
React__default.useEffect(()=>control._removeUnmounted());
|
|
350
|
-
|
|
314
|
+
// If name or control changed for this render, synchronously reflect the
|
|
315
|
+
// latest value so callers (like useController) see the correct value
|
|
316
|
+
// immediately on the same render.
|
|
317
|
+
// Optimize: Check control reference first before expensive deepEqual
|
|
318
|
+
const controlChanged = _prevControl.current !== control;
|
|
319
|
+
const prevName = _prevName.current;
|
|
320
|
+
// Cache the computed output to avoid duplicate calls within the same render
|
|
321
|
+
// We include shouldReturnImmediate in deps to ensure proper recomputation
|
|
322
|
+
const computedOutput = React__default.useMemo(()=>{
|
|
323
|
+
if (disabled) {
|
|
324
|
+
return null;
|
|
325
|
+
}
|
|
326
|
+
const nameChanged = !controlChanged && !deepEqual(prevName, name);
|
|
327
|
+
const shouldReturnImmediate = controlChanged || nameChanged;
|
|
328
|
+
return shouldReturnImmediate ? getCurrentOutput() : null;
|
|
329
|
+
}, [
|
|
330
|
+
disabled,
|
|
331
|
+
controlChanged,
|
|
332
|
+
name,
|
|
333
|
+
prevName,
|
|
334
|
+
getCurrentOutput
|
|
335
|
+
]);
|
|
336
|
+
return computedOutput !== null ? computedOutput : value1;
|
|
351
337
|
}
|
|
352
338
|
/**
|
|
353
339
|
* Custom hook to work with controlled component, this function provide you with both form and field level state. Re-render is isolated at the hook level.
|
|
@@ -373,8 +359,8 @@ function deepEqual(object1, object2, _internal_visited = new WeakSet()) {
|
|
|
373
359
|
* }
|
|
374
360
|
* ```
|
|
375
361
|
*/ function useController(props) {
|
|
376
|
-
const
|
|
377
|
-
const { name, disabled, control =
|
|
362
|
+
const formControl = useFormControlContext();
|
|
363
|
+
const { name, disabled, control = formControl, shouldUnregister, defaultValue, exact = true } = props;
|
|
378
364
|
const isArrayField = isNameInFieldArray(control._names.array, name);
|
|
379
365
|
const defaultValueMemo = React__default.useMemo(()=>get(control._formValues, name, get(control._defaultValues, name, defaultValue)), [
|
|
380
366
|
control,
|
|
@@ -385,12 +371,12 @@ function deepEqual(object1, object2, _internal_visited = new WeakSet()) {
|
|
|
385
371
|
control,
|
|
386
372
|
name,
|
|
387
373
|
defaultValue: defaultValueMemo,
|
|
388
|
-
exact
|
|
374
|
+
exact
|
|
389
375
|
});
|
|
390
376
|
const formState = useFormState({
|
|
391
377
|
control,
|
|
392
378
|
name,
|
|
393
|
-
exact
|
|
379
|
+
exact
|
|
394
380
|
});
|
|
395
381
|
const _props = React__default.useRef(props);
|
|
396
382
|
const _previousNameRef = React__default.useRef(undefined);
|
|
@@ -448,12 +434,12 @@ function deepEqual(object1, object2, _internal_visited = new WeakSet()) {
|
|
|
448
434
|
]);
|
|
449
435
|
const ref = React__default.useCallback((elm)=>{
|
|
450
436
|
const field = get(control._fields, name);
|
|
451
|
-
if (field && elm) {
|
|
437
|
+
if (field && field._f && elm) {
|
|
452
438
|
field._f.ref = {
|
|
453
|
-
focus: ()=>elm.focus && elm.focus(),
|
|
454
|
-
select: ()=>elm.select && elm.select(),
|
|
455
|
-
setCustomValidity: (message)=>elm.setCustomValidity(message),
|
|
456
|
-
reportValidity: ()=>elm.reportValidity()
|
|
439
|
+
focus: ()=>isFunction(elm.focus) && elm.focus(),
|
|
440
|
+
select: ()=>isFunction(elm.select) && elm.select(),
|
|
441
|
+
setCustomValidity: (message)=>isFunction(elm.setCustomValidity) && elm.setCustomValidity(message),
|
|
442
|
+
reportValidity: ()=>isFunction(elm.reportValidity) && elm.reportValidity()
|
|
457
443
|
};
|
|
458
444
|
}
|
|
459
445
|
}, [
|
|
@@ -577,6 +563,109 @@ function deepEqual(object1, object2, _internal_visited = new WeakSet()) {
|
|
|
577
563
|
* }
|
|
578
564
|
* ```
|
|
579
565
|
*/ const Controller = (props)=>props.render(useController(props));
|
|
566
|
+
const HookFormContext = React__default.createContext(null);
|
|
567
|
+
HookFormContext.displayName = 'HookFormContext';
|
|
568
|
+
/**
|
|
569
|
+
* This custom hook allows you to access the form context. useFormContext is intended to be used in deeply nested structures, where it would become inconvenient to pass the context as a prop. To be used with {@link FormProvider}.
|
|
570
|
+
*
|
|
571
|
+
* @remarks
|
|
572
|
+
* [API](https://react-hook-form.com/docs/useformcontext) • [Demo](https://codesandbox.io/s/react-hook-form-v7-form-context-ytudi)
|
|
573
|
+
*
|
|
574
|
+
* @returns return all useForm methods
|
|
575
|
+
*
|
|
576
|
+
* @example
|
|
577
|
+
* ```tsx
|
|
578
|
+
* function App() {
|
|
579
|
+
* const methods = useForm();
|
|
580
|
+
* const onSubmit = data => console.log(data);
|
|
581
|
+
*
|
|
582
|
+
* return (
|
|
583
|
+
* <FormProvider {...methods} >
|
|
584
|
+
* <form onSubmit={methods.handleSubmit(onSubmit)}>
|
|
585
|
+
* <NestedInput />
|
|
586
|
+
* <input type="submit" />
|
|
587
|
+
* </form>
|
|
588
|
+
* </FormProvider>
|
|
589
|
+
* );
|
|
590
|
+
* }
|
|
591
|
+
*
|
|
592
|
+
* function NestedInput() {
|
|
593
|
+
* const { register } = useFormContext(); // retrieve all hook methods
|
|
594
|
+
* return <input {...register("test")} />;
|
|
595
|
+
* }
|
|
596
|
+
* ```
|
|
597
|
+
*/ const useFormContext = ()=>React__default.useContext(HookFormContext);
|
|
598
|
+
/**
|
|
599
|
+
* A provider component that propagates the `useForm` methods to all children components via [React Context](https://react.dev/reference/react/useContext) API. To be used with {@link useFormContext}.
|
|
600
|
+
*
|
|
601
|
+
* @remarks
|
|
602
|
+
* [API](https://react-hook-form.com/docs/useformcontext) • [Demo](https://codesandbox.io/s/react-hook-form-v7-form-context-ytudi)
|
|
603
|
+
*
|
|
604
|
+
* @param props - all useForm methods
|
|
605
|
+
*
|
|
606
|
+
* @example
|
|
607
|
+
* ```tsx
|
|
608
|
+
* function App() {
|
|
609
|
+
* const methods = useForm();
|
|
610
|
+
* const onSubmit = data => console.log(data);
|
|
611
|
+
*
|
|
612
|
+
* return (
|
|
613
|
+
* <FormProvider {...methods} >
|
|
614
|
+
* <form onSubmit={methods.handleSubmit(onSubmit)}>
|
|
615
|
+
* <NestedInput />
|
|
616
|
+
* <input type="submit" />
|
|
617
|
+
* </form>
|
|
618
|
+
* </FormProvider>
|
|
619
|
+
* );
|
|
620
|
+
* }
|
|
621
|
+
*
|
|
622
|
+
* function NestedInput() {
|
|
623
|
+
* const { register } = useFormContext(); // retrieve all hook methods
|
|
624
|
+
* return <input {...register("test")} />;
|
|
625
|
+
* }
|
|
626
|
+
* ```
|
|
627
|
+
*/ const FormProvider = (props)=>{
|
|
628
|
+
const { children, watch, getValues, getFieldState, setError, clearErrors, setValue, trigger, formState, resetField, reset, handleSubmit, unregister, control, register, setFocus, subscribe } = props;
|
|
629
|
+
return React__default.createElement(HookFormContext.Provider, {
|
|
630
|
+
value: React__default.useMemo(()=>({
|
|
631
|
+
watch,
|
|
632
|
+
getValues,
|
|
633
|
+
getFieldState,
|
|
634
|
+
setError,
|
|
635
|
+
clearErrors,
|
|
636
|
+
setValue,
|
|
637
|
+
trigger,
|
|
638
|
+
formState,
|
|
639
|
+
resetField,
|
|
640
|
+
reset,
|
|
641
|
+
handleSubmit,
|
|
642
|
+
unregister,
|
|
643
|
+
control,
|
|
644
|
+
register,
|
|
645
|
+
setFocus,
|
|
646
|
+
subscribe
|
|
647
|
+
}), [
|
|
648
|
+
clearErrors,
|
|
649
|
+
control,
|
|
650
|
+
formState,
|
|
651
|
+
getFieldState,
|
|
652
|
+
getValues,
|
|
653
|
+
handleSubmit,
|
|
654
|
+
register,
|
|
655
|
+
reset,
|
|
656
|
+
resetField,
|
|
657
|
+
setError,
|
|
658
|
+
setFocus,
|
|
659
|
+
setValue,
|
|
660
|
+
subscribe,
|
|
661
|
+
trigger,
|
|
662
|
+
unregister,
|
|
663
|
+
watch
|
|
664
|
+
])
|
|
665
|
+
}, React__default.createElement(HookFormControlContext.Provider, {
|
|
666
|
+
value: control
|
|
667
|
+
}, children));
|
|
668
|
+
};
|
|
580
669
|
var appendErrors = (name, validateAllFieldCriteria, errors, type, message)=>validateAllFieldCriteria ? {
|
|
581
670
|
...errors[name],
|
|
582
671
|
types: {
|
|
@@ -634,7 +723,6 @@ function extractFormValues(fieldsState, formValues) {
|
|
|
634
723
|
}
|
|
635
724
|
var isEmptyObject = (value1)=>isObject(value1) && !Object.keys(value1).length;
|
|
636
725
|
var isFileInput = (element)=>element.type === 'file';
|
|
637
|
-
var isFunction = (value1)=>typeof value1 === 'function';
|
|
638
726
|
var isHTMLElement = (value1)=>{
|
|
639
727
|
if (!isWeb) {
|
|
640
728
|
return false;
|
|
@@ -690,10 +778,11 @@ function isTraversable(value1) {
|
|
|
690
778
|
}
|
|
691
779
|
function markFieldsDirty(data, fields = {}) {
|
|
692
780
|
for(const key in data){
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
781
|
+
const value1 = data[key];
|
|
782
|
+
if (isTraversable(value1)) {
|
|
783
|
+
fields[key] = Array.isArray(value1) ? [] : {};
|
|
784
|
+
markFieldsDirty(value1, fields[key]);
|
|
785
|
+
} else if (!isUndefined(value1)) {
|
|
697
786
|
fields[key] = true;
|
|
698
787
|
}
|
|
699
788
|
}
|
|
@@ -704,14 +793,16 @@ function getDirtyFields(data, formValues, dirtyFieldsFromValues) {
|
|
|
704
793
|
dirtyFieldsFromValues = markFieldsDirty(formValues);
|
|
705
794
|
}
|
|
706
795
|
for(const key in data){
|
|
707
|
-
|
|
796
|
+
const value1 = data[key];
|
|
797
|
+
if (isTraversable(value1)) {
|
|
708
798
|
if (isUndefined(formValues) || isPrimitive(dirtyFieldsFromValues[key])) {
|
|
709
|
-
dirtyFieldsFromValues[key] = markFieldsDirty(
|
|
799
|
+
dirtyFieldsFromValues[key] = markFieldsDirty(value1, Array.isArray(value1) ? [] : {});
|
|
710
800
|
} else {
|
|
711
|
-
getDirtyFields(
|
|
801
|
+
getDirtyFields(value1, isNullOrUndefined(formValues) ? {} : formValues[key], dirtyFieldsFromValues[key]);
|
|
712
802
|
}
|
|
713
803
|
} else {
|
|
714
|
-
|
|
804
|
+
const formValue = formValues[key];
|
|
805
|
+
dirtyFieldsFromValues[key] = !deepEqual(value1, formValue);
|
|
715
806
|
}
|
|
716
807
|
}
|
|
717
808
|
return dirtyFieldsFromValues;
|
|
@@ -1080,7 +1171,8 @@ function createFormControl(props = {}) {
|
|
|
1080
1171
|
let _state = {
|
|
1081
1172
|
action: false,
|
|
1082
1173
|
mount: false,
|
|
1083
|
-
watch: false
|
|
1174
|
+
watch: false,
|
|
1175
|
+
keepIsValid: false
|
|
1084
1176
|
};
|
|
1085
1177
|
let _names = {
|
|
1086
1178
|
mount: new Set(),
|
|
@@ -1091,7 +1183,7 @@ function createFormControl(props = {}) {
|
|
|
1091
1183
|
};
|
|
1092
1184
|
let delayErrorCallback;
|
|
1093
1185
|
let timer = 0;
|
|
1094
|
-
const
|
|
1186
|
+
const defaultProxyFormState = {
|
|
1095
1187
|
isDirty: false,
|
|
1096
1188
|
dirtyFields: false,
|
|
1097
1189
|
validatingFields: false,
|
|
@@ -1100,6 +1192,9 @@ function createFormControl(props = {}) {
|
|
|
1100
1192
|
isValid: false,
|
|
1101
1193
|
errors: false
|
|
1102
1194
|
};
|
|
1195
|
+
const _proxyFormState = {
|
|
1196
|
+
...defaultProxyFormState
|
|
1197
|
+
};
|
|
1103
1198
|
let _proxySubscribeFormState = {
|
|
1104
1199
|
..._proxyFormState
|
|
1105
1200
|
};
|
|
@@ -1113,8 +1208,17 @@ function createFormControl(props = {}) {
|
|
|
1113
1208
|
timer = setTimeout(callback, wait);
|
|
1114
1209
|
};
|
|
1115
1210
|
const _setValid = async (shouldUpdateValid)=>{
|
|
1211
|
+
if (_state.keepIsValid) {
|
|
1212
|
+
return;
|
|
1213
|
+
}
|
|
1116
1214
|
if (!_options.disabled && (_proxyFormState.isValid || _proxySubscribeFormState.isValid || shouldUpdateValid)) {
|
|
1117
|
-
|
|
1215
|
+
let isValid;
|
|
1216
|
+
if (_options.resolver) {
|
|
1217
|
+
isValid = isEmptyObject((await _runSchema()).errors);
|
|
1218
|
+
_updateIsValidating();
|
|
1219
|
+
} else {
|
|
1220
|
+
isValid = await executeBuiltInValidation(_fields, true);
|
|
1221
|
+
}
|
|
1118
1222
|
if (isValid !== _formState.isValid) {
|
|
1119
1223
|
_subjects.state.next({
|
|
1120
1224
|
isValid
|
|
@@ -1183,7 +1287,7 @@ function createFormControl(props = {}) {
|
|
|
1183
1287
|
if (field) {
|
|
1184
1288
|
const defaultValue = get(_formValues, name, isUndefined(value1) ? get(_defaultValues, name) : value1);
|
|
1185
1289
|
isUndefined(defaultValue) || ref && ref.defaultChecked || shouldSkipSetValueAs ? set(_formValues, name, shouldSkipSetValueAs ? defaultValue : getFieldValue(field._f)) : setFieldValue(name, defaultValue);
|
|
1186
|
-
_state.mount && _setValid();
|
|
1290
|
+
_state.mount && !_state.action && _setValid();
|
|
1187
1291
|
}
|
|
1188
1292
|
};
|
|
1189
1293
|
const updateTouchAndDirty = (name, fieldValue, isBlurEvent, shouldDirty, shouldRender)=>{
|
|
@@ -1247,11 +1351,11 @@ function createFormControl(props = {}) {
|
|
|
1247
1351
|
const _runSchema = async (name)=>{
|
|
1248
1352
|
_updateIsValidating(name, true);
|
|
1249
1353
|
const result = await _options.resolver(_formValues, _options.context, getResolverOptions(name || _names.mount, _fields, _options.criteriaMode, _options.shouldUseNativeValidation));
|
|
1250
|
-
_updateIsValidating(name);
|
|
1251
1354
|
return result;
|
|
1252
1355
|
};
|
|
1253
1356
|
const executeSchemaAndUpdateState = async (names)=>{
|
|
1254
1357
|
const { errors } = await _runSchema(names);
|
|
1358
|
+
_updateIsValidating(names);
|
|
1255
1359
|
if (names) {
|
|
1256
1360
|
for (const name of names){
|
|
1257
1361
|
const error = get(errors, name);
|
|
@@ -1285,7 +1389,7 @@ function createFormControl(props = {}) {
|
|
|
1285
1389
|
}
|
|
1286
1390
|
if (fieldError[_f.name]) {
|
|
1287
1391
|
context.valid = false;
|
|
1288
|
-
if (shouldOnlyCheckValid) {
|
|
1392
|
+
if (shouldOnlyCheckValid || props.shouldUseNativeValidation) {
|
|
1289
1393
|
break;
|
|
1290
1394
|
}
|
|
1291
1395
|
}
|
|
@@ -1383,14 +1487,18 @@ function createFormControl(props = {}) {
|
|
|
1383
1487
|
} else {
|
|
1384
1488
|
field && !field._f && !isNullOrUndefined(cloneValue) ? setValues(name, cloneValue, options) : setFieldValue(name, cloneValue, options);
|
|
1385
1489
|
}
|
|
1386
|
-
isWatched(name, _names)
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1490
|
+
if (isWatched(name, _names)) {
|
|
1491
|
+
_subjects.state.next({
|
|
1492
|
+
..._formState,
|
|
1493
|
+
name,
|
|
1494
|
+
values: cloneObject(_formValues)
|
|
1495
|
+
});
|
|
1496
|
+
} else {
|
|
1497
|
+
_subjects.state.next({
|
|
1498
|
+
name: _state.mount ? name : undefined,
|
|
1499
|
+
values: cloneObject(_formValues)
|
|
1500
|
+
});
|
|
1501
|
+
}
|
|
1394
1502
|
};
|
|
1395
1503
|
const onChange = async (event)=>{
|
|
1396
1504
|
_state.mount = true;
|
|
@@ -1448,6 +1556,9 @@ function createFormControl(props = {}) {
|
|
|
1448
1556
|
const { errors } = await _runSchema([
|
|
1449
1557
|
name
|
|
1450
1558
|
]);
|
|
1559
|
+
_updateIsValidating([
|
|
1560
|
+
name
|
|
1561
|
+
]);
|
|
1451
1562
|
_updateIsFieldValueUpdated(fieldValue);
|
|
1452
1563
|
if (isFieldValueUpdated) {
|
|
1453
1564
|
const previousErrorLookupResult = schemaErrorLookup(_formState.errors, _fields, name);
|
|
@@ -1583,7 +1694,10 @@ function createFormControl(props = {}) {
|
|
|
1583
1694
|
};
|
|
1584
1695
|
return _subscribe({
|
|
1585
1696
|
...props,
|
|
1586
|
-
formState:
|
|
1697
|
+
formState: {
|
|
1698
|
+
...defaultProxyFormState,
|
|
1699
|
+
...props.formState
|
|
1700
|
+
}
|
|
1587
1701
|
});
|
|
1588
1702
|
};
|
|
1589
1703
|
const unregister = (name, options = {})=>{
|
|
@@ -1613,7 +1727,11 @@ function createFormControl(props = {}) {
|
|
|
1613
1727
|
};
|
|
1614
1728
|
const _setDisabledField = ({ disabled, name })=>{
|
|
1615
1729
|
if (isBoolean(disabled) && _state.mount || !!disabled || _names.disabled.has(name)) {
|
|
1730
|
+
const wasDisabled = _names.disabled.has(name);
|
|
1731
|
+
const isDisabled = !!disabled;
|
|
1732
|
+
const disabledStateChanged = wasDisabled !== isDisabled;
|
|
1616
1733
|
disabled ? _names.disabled.add(name) : _names.disabled.delete(name);
|
|
1734
|
+
disabledStateChanged && _state.mount && !_state.action && _setValid();
|
|
1617
1735
|
}
|
|
1618
1736
|
};
|
|
1619
1737
|
const register = (name, options = {})=>{
|
|
@@ -1728,6 +1846,7 @@ function createFormControl(props = {}) {
|
|
|
1728
1846
|
});
|
|
1729
1847
|
if (_options.resolver) {
|
|
1730
1848
|
const { errors, values } = await _runSchema();
|
|
1849
|
+
_updateIsValidating();
|
|
1731
1850
|
_formState.errors = errors;
|
|
1732
1851
|
fieldValues = cloneObject(values);
|
|
1733
1852
|
} else {
|
|
@@ -1807,7 +1926,14 @@ function createFormControl(props = {}) {
|
|
|
1807
1926
|
...Object.keys(getDirtyFields(_defaultValues, _formValues))
|
|
1808
1927
|
]);
|
|
1809
1928
|
for (const fieldName of Array.from(fieldsToCheck)){
|
|
1810
|
-
get(_formState.dirtyFields, fieldName)
|
|
1929
|
+
const isDirty = get(_formState.dirtyFields, fieldName);
|
|
1930
|
+
const existingValue = get(_formValues, fieldName);
|
|
1931
|
+
const newValue = get(values, fieldName);
|
|
1932
|
+
if (isDirty && !isUndefined(existingValue)) {
|
|
1933
|
+
set(values, fieldName, existingValue);
|
|
1934
|
+
} else if (!isDirty && !isUndefined(newValue)) {
|
|
1935
|
+
setValue(fieldName, newValue);
|
|
1936
|
+
}
|
|
1811
1937
|
}
|
|
1812
1938
|
} else {
|
|
1813
1939
|
if (isWeb && isUndefined(formValues)) {
|
|
@@ -1854,8 +1980,16 @@ function createFormControl(props = {}) {
|
|
|
1854
1980
|
watchAll: false,
|
|
1855
1981
|
focus: ''
|
|
1856
1982
|
};
|
|
1857
|
-
_state.mount = !_proxyFormState.isValid || !!keepStateOptions.keepIsValid || !!keepStateOptions.keepDirtyValues;
|
|
1983
|
+
_state.mount = !_proxyFormState.isValid || !!keepStateOptions.keepIsValid || !!keepStateOptions.keepDirtyValues || !_options.shouldUnregister && !isEmptyObject(values);
|
|
1858
1984
|
_state.watch = !!_options.shouldUnregister;
|
|
1985
|
+
_state.keepIsValid = !!keepStateOptions.keepIsValid;
|
|
1986
|
+
_state.action = false;
|
|
1987
|
+
// Clear errors synchronously to prevent validation errors on subsequent submissions
|
|
1988
|
+
// This fixes the issue where form.reset() causes validation errors on subsequent
|
|
1989
|
+
// submissions in Next.js 16 with Server Actions
|
|
1990
|
+
if (!keepStateOptions.keepErrors) {
|
|
1991
|
+
_formState.errors = {};
|
|
1992
|
+
}
|
|
1859
1993
|
_subjects.state.next({
|
|
1860
1994
|
submitCount: keepStateOptions.keepSubmitCount ? _formState.submitCount : 0,
|
|
1861
1995
|
isDirty: isEmptyResetValues ? false : keepStateOptions.keepDirty ? _formState.isDirty : !!(keepStateOptions.keepDefaultValues && !deepEqual(formValues, _defaultValues)),
|
|
@@ -1868,15 +2002,22 @@ function createFormControl(props = {}) {
|
|
|
1868
2002
|
defaultValues: _defaultValues
|
|
1869
2003
|
});
|
|
1870
2004
|
};
|
|
1871
|
-
const reset = (formValues, keepStateOptions)=>_reset(isFunction(formValues) ? formValues(_formValues) : formValues,
|
|
2005
|
+
const reset = (formValues, keepStateOptions)=>_reset(isFunction(formValues) ? formValues(_formValues) : formValues, {
|
|
2006
|
+
..._options.resetOptions,
|
|
2007
|
+
...keepStateOptions
|
|
2008
|
+
});
|
|
1872
2009
|
const setFocus = (name, options = {})=>{
|
|
1873
2010
|
const field = get(_fields, name);
|
|
1874
2011
|
const fieldReference = field && field._f;
|
|
1875
2012
|
if (fieldReference) {
|
|
1876
2013
|
const fieldRef = fieldReference.refs ? fieldReference.refs[0] : fieldReference.ref;
|
|
1877
2014
|
if (fieldRef.focus) {
|
|
1878
|
-
|
|
1879
|
-
|
|
2015
|
+
// Use setTimeout to ensure focus happens after any pending state updates
|
|
2016
|
+
// This fixes the issue where setFocus doesn't work immediately after setError
|
|
2017
|
+
setTimeout(()=>{
|
|
2018
|
+
fieldRef.focus();
|
|
2019
|
+
options.shouldSelect && isFunction(fieldRef.select) && fieldRef.select();
|
|
2020
|
+
});
|
|
1880
2021
|
}
|
|
1881
2022
|
}
|
|
1882
2023
|
};
|
|
@@ -1901,6 +2042,7 @@ function createFormControl(props = {}) {
|
|
|
1901
2042
|
setError,
|
|
1902
2043
|
_subscribe,
|
|
1903
2044
|
_runSchema,
|
|
2045
|
+
_updateIsValidating,
|
|
1904
2046
|
_focusError,
|
|
1905
2047
|
_getWatch,
|
|
1906
2048
|
_getDirty,
|
|
@@ -2100,11 +2242,15 @@ function createFormControl(props = {}) {
|
|
|
2100
2242
|
formState.isDirty
|
|
2101
2243
|
]);
|
|
2102
2244
|
React__default.useEffect(()=>{
|
|
2245
|
+
var _a;
|
|
2103
2246
|
if (props.values && !deepEqual(props.values, _values.current)) {
|
|
2104
2247
|
control._reset(props.values, {
|
|
2105
2248
|
keepFieldsRef: true,
|
|
2106
2249
|
...control._options.resetOptions
|
|
2107
2250
|
});
|
|
2251
|
+
if (!((_a = control._options.resetOptions) === null || _a === void 0 ? void 0 : _a.keepIsValid)) {
|
|
2252
|
+
control._setValid();
|
|
2253
|
+
}
|
|
2108
2254
|
_values.current = props.values;
|
|
2109
2255
|
updateFormState((state)=>({
|
|
2110
2256
|
...state
|
|
@@ -2129,7 +2275,10 @@ function createFormControl(props = {}) {
|
|
|
2129
2275
|
}
|
|
2130
2276
|
control._removeUnmounted();
|
|
2131
2277
|
});
|
|
2132
|
-
_formControl.current.formState = getProxyFormState(formState, control)
|
|
2278
|
+
_formControl.current.formState = React__default.useMemo(()=>getProxyFormState(formState, control), [
|
|
2279
|
+
control,
|
|
2280
|
+
formState
|
|
2281
|
+
]);
|
|
2133
2282
|
return _formControl.current;
|
|
2134
2283
|
}
|
|
2135
2284
|
|
|
@@ -2220,4 +2369,4 @@ function FormMessage({ className, ...props }) {
|
|
|
2220
2369
|
}
|
|
2221
2370
|
|
|
2222
2371
|
export { Form as F, FormItem as a, FormLabel as b, FormControl as c, FormDescription as d, FormMessage as e, FormField as f, get as g, appendErrors as h, useForm as i, set as s, useFormField as u };
|
|
2223
|
-
//# sourceMappingURL=form-
|
|
2372
|
+
//# sourceMappingURL=form-CJnoOgoH.mjs.map
|