@povio/ui 5.0.0-rc.9 → 6.0.0-rc.10
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/MIGRATION.md +673 -0
- package/README.md +206 -55
- package/dist/{Accordion-BzwO4_ml.js → Accordion-ORBin0EZ.js} +13 -119
- package/dist/{Alert-DfiJbKH0.d.ts → Alert-D4X7OWiv.d.ts} +3 -3
- package/dist/{AlertDialog-OWTbR4km.d.ts → AlertDialog-DklLDjmw.d.ts} +3 -3
- package/dist/Autocomplete-BgFz3kuR.d.ts +23 -0
- package/dist/Autocomplete-CsJAU233.js +145 -0
- package/dist/Autocomplete.bound-CGC8m4dK.js +28 -0
- package/dist/Autocomplete.bound-CpHZZ3C9.d.ts +9 -0
- package/dist/{Badge-CBNpj823.d.ts → Badge-Db1ndK67.d.ts} +2 -2
- package/dist/{BadgeButton-Ccgt3oGO.d.ts → BadgeButton-BPhWDAnc.d.ts} +2 -2
- package/dist/{BottomSheet-DbQuzfAB.d.ts → BottomSheet-BZmDJBR-.d.ts} +1 -1
- package/dist/{BottomSheet-BXLE3161.js → BottomSheet-CGipksM_.js} +12 -86
- package/dist/{BottomSheet.lazy-D9LCEo7s.d.ts → BottomSheet.lazy-CuJMUeJP.d.ts} +1 -1
- package/dist/{Breadcrumbs-CUV6CU8Q.d.ts → Breadcrumbs-CcB0oOF8.d.ts} +1 -1
- package/dist/{Breadcrumbs-FF8hMfXd.js → Breadcrumbs-a1-q_he0.js} +20 -17
- package/dist/Button-0SswSdDg.d.ts +13 -0
- package/dist/Button-BaODzvZd.js +16 -0
- package/dist/{Button-D6KlWSFL.js → Button-C1YB5dOw.js} +3 -3
- package/dist/ButtonBase-CZuEy3Pk.d.ts +32 -0
- package/dist/ButtonBase-s-VV7oCa.js +87 -0
- package/dist/{ButtonContent-c7lJayVQ.js → ButtonContent-Dztbuz3q.js} +5 -14
- package/dist/{Calendar-BTjajO6i.js → Calendar-Cr6B7SDx.js} +29 -181
- package/dist/Calendar.lazy-MJisXRJK.js +131 -0
- package/dist/{CheckContent-D7sZPmzx.js → CheckContent-BKLnTPZr.js} +2 -2
- package/dist/{Checkbox-CV1ILXXO.js → Checkbox-Bjsbx-wK.js} +21 -38
- package/dist/{Checkbox-DVTWaMKa.d.ts → Checkbox-w2j5hLOQ.d.ts} +9 -8
- package/dist/Checkbox.bound-D2nBglJz.js +33 -0
- package/dist/Checkbox.bound-DD_RCjVm.d.ts +9 -0
- package/dist/CheckboxCheckmark-DWsYVZuu.js +25 -0
- package/dist/CheckboxGroup-B3O3IUiu.js +141 -0
- package/dist/CheckboxGroup-BYI15Y09.d.ts +30 -0
- package/dist/CheckboxGroup.bound-DY0HKGSh.js +32 -0
- package/dist/CheckboxGroup.bound-QiJ-P0KR.d.ts +9 -0
- package/dist/ComboBox-ChsdI0lt.js +212 -0
- package/dist/{DatePicker-DOLL7mkc.js → DatePicker-D-YXdY2z.js} +47 -54
- package/dist/{DatePicker-8xSs_jNd.d.ts → DatePicker-QzfQf21b.d.ts} +21 -10
- package/dist/DatePicker.bound-DoCAqhM4.d.ts +9 -0
- package/dist/DatePicker.bound-a-6NJTgy.js +36 -0
- package/dist/{DatePickerInput-BLBcySA2.js → DatePickerInput-2CZtsxdK.js} +66 -301
- package/dist/{DatePickerInput-D81ZJ3fT.d.ts → DatePickerInput-vLlL5ATh.d.ts} +3 -3
- package/dist/{DateRangePicker-Bfq-yDm7.d.ts → DateRangePicker-3pPW0ZBV.d.ts} +30 -10
- package/dist/{DateRangePicker-BF-1CztH.js → DateRangePicker-tuM8Qyvp.js} +80 -330
- package/dist/DateRangePicker.bound-B5SKOkVM.js +35 -0
- package/dist/DateRangePicker.bound-vFyFw4wA.d.ts +9 -0
- package/dist/{DateTimePicker-Cj0qvJUz.js → DateTimePicker-8BVP2qeR.js} +47 -48
- package/dist/{DateTimePicker-D4lHyf6P.d.ts → DateTimePicker-BTRIUagV.d.ts} +21 -11
- package/dist/DateTimePicker.bound-C3y8TqPk.js +32 -0
- package/dist/DateTimePicker.bound-X4DTyQ1b.d.ts +9 -0
- package/dist/{Dialog-9manOgMA.js → Dialog-Bn43feu0.js} +13 -10
- package/dist/{Dialog-CKLkS00H.js → Dialog-C9H9_BmK.js} +53 -29
- package/dist/Dialog-CO9xljD3.d.ts +21 -0
- package/dist/Disclosure-BRSkMbZQ.js +109 -0
- package/dist/{DropdownMenu-5jmtgLXd.js → DropdownMenu-DS0RaEfH.js} +13 -31
- package/dist/DropdownMenu-D_9z9ond.d.ts +25 -0
- package/dist/{DropdownMenuDesktop-Cl9gZVq0.js → DropdownMenuDesktop-DGPIfex-.js} +7 -28
- package/dist/{FileInput-C4CE5kuP.d.ts → FileInput-BEaECoBS.d.ts} +26 -22
- package/dist/{FileInput-Br5DQaGQ.js → FileInput-DNCKhAq-.js} +36 -49
- package/dist/FileInput.bound-D2HuuqSb.d.ts +8 -0
- package/dist/FileInput.bound-DCSair97.js +30 -0
- package/dist/{FileTrigger-Cthk5_Wp.js → FileTrigger-DlryDp2T.js} +6 -6
- package/dist/FileUpload-BUTSqHVk.d.ts +11 -0
- package/dist/{FileUpload--7ub3EZO.js → FileUpload-CQFCrvCI.js} +279 -249
- package/dist/FileUpload.bound-BwetBdi7.js +30 -0
- package/dist/FileUpload.bound-CGQXb4iT.d.ts +16 -0
- package/dist/{FileUploadContainer-042ztsaL.d.ts → FileUploadContainer-Dzg5aXXZ.d.ts} +1 -1
- package/dist/{Form-DlQcyN1f.js → Form-CqF1SaVw.js} +2 -2
- package/dist/{FormField-Byiehm9y.d.ts → FormField-DGyCDxOp.d.ts} +7 -2
- package/dist/FormField-dduTMkNH.js +142 -0
- package/dist/{FormFieldError-DeOHHLo2.js → FormFieldError-DTT5TUQ1.js} +3 -14
- package/dist/{FormFieldHeaderTooltip-BV2Ju4oB.js → FormFieldHeaderTooltip-Dt-g40Tc.js} +4 -4
- package/dist/FormLayout-CBYgWvwW.d.ts +47 -0
- package/dist/{Heading-nI1_VOaE.js → Heading-D4XFYv__.js} +2 -2
- package/dist/IconButton-shH_9wcl.d.ts +25 -0
- package/dist/{IconSlot-DSK7qNxc.js → IconSlot-CqNuZl0E.js} +4 -4
- package/dist/{iconSlot.cva-CnpFzAOR.d.ts → IconSlot-DcEDPaNb.d.ts} +3 -10
- package/dist/{InlineTooltipWrapper-BpApaGXV.js → InlineTooltipWrapper-CKTiFpZn.js} +3 -3
- package/dist/{Input-BsbLZDtC.js → Input-BG0Xjw5X.js} +2 -2
- package/dist/Input-BIuNQb5u.js +245 -0
- package/dist/{Input-DOanwj3l.d.ts → Input-CTp_9mS9.d.ts} +13 -9
- package/dist/Input.bound-B9a62ylL.d.ts +9 -0
- package/dist/Input.bound-QpE3qJqT.js +31 -0
- package/dist/{InputContent-CXuP1ghQ.d.ts → InputContent-BCNkN4Fx.d.ts} +5 -5
- package/dist/InputContent-C5JlwN5b.js +102 -0
- package/dist/{Label-B2-B-uFY.js → Label-BGvF9vWx.js} +2 -2
- package/dist/{Link-FupWOW1f.js → Link-Chux-Clm.js} +2 -2
- package/dist/{Link-Ow9H7kNv.d.ts → Link-PvYB_M-j.d.ts} +5 -3
- package/dist/{ListBox-CL8Ar4Q_.js → ListBox-DhR5kojP.js} +10 -11
- package/dist/{MenuItem-DHyqOqln.d.ts → MenuItem-U3-pu1j5.d.ts} +1 -1
- package/dist/{Modal-w60dVQcb.js → Modal-DcLWF9cB.js} +58 -20
- package/dist/NumberField-CpkLBjIM.js +249 -0
- package/dist/{NumberField-Cb9Gf6QJ.d.ts → NumberField-WXebfxjK.d.ts} +13 -9
- package/dist/NumberField.bound-BbZLqewF.js +32 -0
- package/dist/NumberField.bound-Dy0A5iVc.d.ts +9 -0
- package/dist/{NumberFormatter-CLDS_LRZ.js → NumberFormatter-DYarfm5F.js} +2 -36
- package/dist/{NumberRangeInput-B8-LHfg3.js → NumberRangeInput-47xOaSXq.js} +28 -55
- package/dist/{NumberRangeInput-BfbJQqzn.d.ts → NumberRangeInput-BCKQaGpy.d.ts} +13 -8
- package/dist/NumberRangeInput.bound-B21y7xkb.js +32 -0
- package/dist/NumberRangeInput.bound-BNXxIQ0b.d.ts +9 -0
- package/dist/{OverlayArrow-D8z7cCsw.js → OverlayArrow-DF0jMwul.js} +2 -2
- package/dist/PageHeader-BwzxymWY.d.ts +58 -0
- package/dist/{Pagination-CwQu5Py8.d.ts → Pagination-BCGUVYOF.d.ts} +1 -1
- package/dist/PaginationList-BTmrmOGl.js +220 -0
- package/dist/{PaginationList-DMRUGtf8.d.ts → PaginationList-CvlSkJGn.d.ts} +1 -1
- package/dist/PasswordInput-EhQjYyJS.d.ts +11 -0
- package/dist/{PasswordInput-CLwFUgl0.d.ts → PasswordInput.bound-CK5GwKL4.d.ts} +5 -6
- package/dist/PasswordInput.bound-DVkRv16z.js +23 -0
- package/dist/{Popover-BTHPteIh.d.ts → Popover-D_t1XDPA.d.ts} +2 -2
- package/dist/{Progress-CjWOR38H.d.ts → Progress-Ckfpi_-M.d.ts} +4 -4
- package/dist/{Progress-B3mY9rIP.js → Progress-RiEGGxNG.js} +4 -29
- package/dist/RadioGroup-6e-Z6jW8.d.ts +26 -0
- package/dist/{RadioGroup-DOw3PRoX.js → RadioGroup-IL4Y8XHO.js} +18 -120
- package/dist/RadioGroup.bound-BFWSq-on.js +32 -0
- package/dist/RadioGroup.bound-w3SZqSkH.d.ts +9 -0
- package/dist/RangeCalendar-CAWTz3pq.js +288 -0
- package/dist/{RichTextEditor-D4yN7Wj7.js → RichTextEditor-16feWcDW.js} +57 -365
- package/dist/RichTextEditor-DHhuBeT6.d.ts +28 -0
- package/dist/{SelectBase-Omiq2D3M.d.ts → Select-C34ENdjq.d.ts} +34 -11
- package/dist/{staticSelect.utils-uHa8f_c6.js → Select-CSdr0OcD.js} +343 -635
- package/dist/Select.bound-D-Wl7nLz.js +34 -0
- package/dist/Select.bound-qOihchei.d.ts +17 -0
- package/dist/SelectListBox-DeiPWhOP.js +390 -0
- package/dist/SelectionIndicator-C3hniBa2.js +18 -0
- package/dist/SharedElementTransition-CZ2bE7yo.js +96 -0
- package/dist/SidebarWorkspaces-DDHJAdNH.d.ts +132 -0
- package/dist/SidebarWorkspaces-DJknAfS9.js +1298 -0
- package/dist/{Slider-CzEmKYBF.js → Slider-DCsCCPFx.js} +18 -42
- package/dist/{Slider-EYlGCLWe.d.ts → Slider-DRg8zKRM.d.ts} +9 -8
- package/dist/Slider.bound-CByTXPTr.js +31 -0
- package/dist/Slider.bound-CaEF19um.d.ts +9 -0
- package/dist/{Spinner-DbXeDOa2.d.ts → Spinner-Cvy_6zgD.d.ts} +5 -5
- package/dist/{Spinner-BeVTUzzx.js → Spinner-DqjP06T1.js} +29 -41
- package/dist/{SplitButton-D9ngY1rJ.d.ts → SplitButton-V1f2NWfh.d.ts} +3 -3
- package/dist/{Stepper-Cp5vbL5g.js → Stepper-Dyhxp0Tl.js} +14 -13
- package/dist/{Stepper-TATlHZhQ.d.ts → Stepper-k91x_m-E.d.ts} +18 -18
- package/dist/{Switch-CqnGEdeD.js → Switch-BfpSMMpv.js} +10 -59
- package/dist/Switch-ELVPkPx0.d.ts +24 -0
- package/dist/Switch.bound-DeEdVvZV.d.ts +9 -0
- package/dist/Switch.bound-Dv0cHsMM.js +33 -0
- package/dist/TableRowDetails-D8HFTghI.d.ts +109 -0
- package/dist/TabsFilters-CvYxvrud.js +223 -0
- package/dist/TabsFilters-DePddjCk.d.ts +30 -0
- package/dist/Tag-B2_ZiSE-.d.ts +44 -0
- package/dist/{Text-D2MPZ3sY.js → Text-D72yc4S6.js} +1 -1
- package/dist/{TextArea-D8WkKsGn.js → TextArea-ciY0kt-D.js} +33 -35
- package/dist/{TextArea-l_keyLK7.d.ts → TextArea-iqUeB2QY.d.ts} +11 -9
- package/dist/TextArea.bound-BJHyCogp.d.ts +9 -0
- package/dist/TextArea.bound-DQ_ULvue.js +28 -0
- package/dist/TextArea.cva-ENXI55ec.js +5 -0
- package/dist/{TimePicker-C4taAOFQ.js → TimePicker-BKRPMduC.js} +65 -55
- package/dist/TimePicker-BZ1ocsBX.d.ts +45 -0
- package/dist/TimePicker.bound-8DmjMXuE.d.ts +9 -0
- package/dist/TimePicker.bound-PtJTz6s3.js +32 -0
- package/dist/{datePickerValue.utils-DCgoSrP3.js → TimePickerForm-itDjoV7V.js} +23 -19
- package/dist/{Toast-ruXqONDA.d.ts → Toast-D9pdadZ4.d.ts} +1 -1
- package/dist/{ToastContainer-qgpzMFD4.js → ToastContainer-Dd0LPykL.js} +5 -5
- package/dist/ToggleButton-HUZ8ij6i.d.ts +17 -0
- package/dist/{ToggleButton-BW1ensey.js → ToggleButton-P1z1pxzT.js} +5 -5
- package/dist/ToggleGroup-CrDoeLN0.js +333 -0
- package/dist/ToggleGroup-DvjnSinl.d.ts +42 -0
- package/dist/ToggleGroup.bound-B03ISHQ8.d.ts +9 -0
- package/dist/ToggleGroup.bound-DCnYwmBt.js +67 -0
- package/dist/Tooltip-B8DTURLQ.d.ts +16 -0
- package/dist/{Tooltip-CpG1nz7Y.js → Tooltip-DRB6lo0U.js} +10 -11
- package/dist/{TooltipWrapper-3jyN0Wss.js → TooltipWrapper-BvGO_LUx.js} +21 -10
- package/dist/{Typography-LU4z2pR1.js → Typography-DCLnPa3P.js} +2 -2
- package/dist/{Typography-XljT9s02.d.ts → Typography-DJojwiXV.d.ts} +2 -2
- package/dist/{accordion.cva-CL1bVscW.js → accordion.cva-DwxY-k1e.js} +17 -25
- package/dist/{badgeButton.cva-B2bgCQP6.d.ts → badgeButton.cva-CBFIhr1S.d.ts} +8 -8
- package/dist/badgeButton.cva-t5PQOH4M.js +138 -0
- package/dist/{breadcrumbs.cva-7zzdDhVR.js → breadcrumbs.cva-CnBIZUB3.js} +9 -9
- package/dist/{button.cva-C7kEhgoA.d.ts → button.cva-C8LGtNJ3.d.ts} +21 -16
- package/dist/button.cva-Ciga0rdG.js +267 -0
- package/dist/{buttonContent.cva-DPIlROA9.d.ts → buttonContent.cva-BapnODby.d.ts} +2 -2
- package/dist/{checkbox.cva-t1Ox50hy.d.ts → checkbox.cva-CCh_UlrC.d.ts} +6 -6
- package/dist/checkbox.cva-aLJS7v4z.js +128 -0
- package/dist/components/accordion.js +1 -1
- package/dist/components/alert-dialog.d.ts +1 -1
- package/dist/components/alert-dialog.js +102 -100
- package/dist/components/alert.d.ts +1 -1
- package/dist/components/alert.js +116 -1
- package/dist/components/autocomplete.d.ts +2 -2
- package/dist/components/autocomplete.js +1 -134
- package/dist/components/badge-button.d.ts +1 -1
- package/dist/components/badge-button.js +6 -6
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/badge.js +10 -10
- package/dist/components/bottom-sheet-header.d.ts +16 -0
- package/dist/components/bottom-sheet-header.js +80 -0
- package/dist/components/bottom-sheet.d.ts +2 -2
- package/dist/components/bottom-sheet.js +3 -3
- package/dist/components/breadcrumb/react-aria.js +1 -1
- package/dist/components/breadcrumbs.d.ts +1 -1
- package/dist/components/breadcrumbs.js +1 -1
- package/dist/components/button-group.d.ts +12 -0
- package/dist/components/button-group.js +46 -0
- package/dist/components/button.d.ts +2 -2
- package/dist/components/button.js +1 -1
- package/dist/components/checkbox-group.d.ts +2 -2
- package/dist/components/checkbox-group.js +1 -163
- package/dist/components/checkbox.d.ts +2 -2
- package/dist/components/checkbox.js +2 -2
- package/dist/components/combo-box/react-aria.js +1 -1
- package/dist/components/date-picker/react-aria.js +1 -1
- package/dist/components/date-picker.d.ts +2 -2
- package/dist/components/date-picker.js +1 -1
- package/dist/components/date-range-picker/react-aria.js +1 -1
- package/dist/components/date-range-picker.d.ts +2 -2
- package/dist/components/date-range-picker.js +1 -1
- package/dist/components/date-time-picker.d.ts +2 -2
- package/dist/components/date-time-picker.js +1 -1
- package/dist/components/dialog-trigger/react-aria.js +1 -1
- package/dist/components/dialog.d.ts +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/drawer.js +4 -4
- package/dist/components/dropdown-menu.d.ts +2 -2
- package/dist/components/dropdown-menu.js +2 -2
- package/dist/components/file-input.d.ts +2 -2
- package/dist/components/file-input.js +1 -1
- package/dist/components/file-upload-container.d.ts +2 -2
- package/dist/components/file-upload-container.js +1 -1
- package/dist/components/file-upload.d.ts +3 -3
- package/dist/components/file-upload.js +1 -1
- package/dist/components/form-field.d.ts +1 -1
- package/dist/components/form-field.js +1 -1
- package/dist/components/form-layout.d.ts +2 -0
- package/dist/components/form-layout.js +80 -0
- package/dist/components/icon-button.d.ts +1 -1
- package/dist/components/icon-button.js +17 -15
- package/dist/components/icon-slot.d.ts +2 -1
- package/dist/components/icon-slot.js +1 -1
- package/dist/components/input-frame.d.ts +94 -0
- package/dist/{useStaticInputHandoff-NeZVnci-.js → components/input-frame.js} +82 -116
- package/dist/components/input.d.ts +2 -2
- package/dist/components/input.js +1 -241
- package/dist/components/link.d.ts +1 -1
- package/dist/components/link.js +4 -4
- package/dist/components/menu-trigger/react-aria.js +1 -1
- package/dist/components/modal/react-aria.js +1 -1
- package/dist/components/modal-overlay/react-aria.js +1 -1
- package/dist/components/number-field.d.ts +2 -2
- package/dist/components/number-field.js +1 -245
- package/dist/components/number-range-input.d.ts +2 -2
- package/dist/components/number-range-input.js +1 -1
- package/dist/components/page-header.d.ts +2 -0
- package/dist/components/page-header.js +205 -0
- package/dist/components/pagination-list.d.ts +1 -1
- package/dist/components/pagination-list.js +1 -1
- package/dist/components/pagination.d.ts +1 -1
- package/dist/components/pagination.js +14 -10
- package/dist/components/password-input.d.ts +2 -2
- package/dist/components/password-input.js +22 -1
- package/dist/components/popover/react-aria.js +1 -1
- package/dist/components/popover.d.ts +1 -1
- package/dist/components/popover.js +40 -32
- package/dist/components/progress.d.ts +1 -1
- package/dist/components/progress.js +1 -1
- package/dist/components/radio-group.d.ts +2 -2
- package/dist/components/radio-group.js +1 -1
- package/dist/components/select/react-aria.js +1 -1
- package/dist/components/select.d.ts +2 -3
- package/dist/components/select.js +1 -1
- package/dist/components/sidebar.d.ts +2 -0
- package/dist/components/sidebar.js +2 -0
- package/dist/components/slider.d.ts +2 -2
- package/dist/components/slider.js +1 -1
- package/dist/components/spinner.d.ts +1 -1
- package/dist/components/spinner.js +1 -1
- package/dist/components/split-button.d.ts +1 -1
- package/dist/components/split-button.js +3 -3
- package/dist/components/stepper.d.ts +1 -1
- package/dist/components/stepper.js +1 -1
- package/dist/components/style-definitions.d.ts +3 -0
- package/dist/components/style-definitions.js +122 -0
- package/dist/components/submenu-trigger/react-aria.js +1 -1
- package/dist/components/switch.d.ts +2 -2
- package/dist/components/switch.js +1 -1
- package/dist/components/tabs-filters.d.ts +2 -0
- package/dist/components/tabs-filters.js +2 -0
- package/dist/components/tag.d.ts +1 -1
- package/dist/components/tag.js +93 -1
- package/dist/components/text-area.d.ts +2 -2
- package/dist/components/text-area.js +1 -1
- package/dist/components/time-picker.d.ts +2 -2
- package/dist/components/time-picker.js +1 -1
- package/dist/components/toast.d.ts +2 -2
- package/dist/components/toast.js +2 -2
- package/dist/components/toggle-button.d.ts +1 -1
- package/dist/components/toggle-button.js +17 -30
- package/dist/components/toggle-group.d.ts +2 -3
- package/dist/components/toggle-group.js +1 -1
- package/dist/components/tooltip-ellipsis.js +2 -2
- package/dist/components/tooltip.d.ts +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/components/typography.d.ts +2 -2
- package/dist/components/typography.js +1 -1
- package/dist/components/use-toast.d.ts +1 -1
- package/dist/components/use-toast.js +2 -2
- package/dist/config/component-configuration.d.ts +30 -0
- package/dist/config/component-configuration.js +69 -0
- package/dist/config/confirmation.d.ts +1 -1
- package/dist/config/confirmation.js +1 -1
- package/dist/config/link-context.d.ts +2 -2
- package/dist/config/link-context.js +1 -1
- package/dist/config/resources.d.ts +1 -1
- package/dist/config/resources.js +1 -1
- package/dist/config/theme-context.js +1 -1
- package/dist/config/ui-config.d.ts +2 -2
- package/dist/config/ui-config.js +1 -1
- package/dist/config/ui-overrides.d.ts +1 -1
- package/dist/config/ui-overrides.js +1 -1
- package/dist/config/ui-router.js +1 -1
- package/dist/{confirmation.context-BuzgCfYl.js → confirmation.context-CByUxDcn.js} +2 -2
- package/dist/{confirmation.context-BOeEVczb.d.ts → confirmation.context-C_GDRn3a.d.ts} +1 -1
- package/dist/{datePickerInput.cva-Cd7UUN61.js → datePickerInput.cva-Du0Zn04v.js} +2 -2
- package/dist/datePickerValue.utils-CkmPaD6I.js +4 -0
- package/dist/{dialog.cva-COhDZaVl.js → dialog.cva-BIpz6HcA.js} +7 -7
- package/dist/{dist-CAdwxJbe.js → dist-DEZzXa0W.js} +54 -1
- package/dist/{dom.utils-D1AopHx9.js → dom.utils-BPooTXtC.js} +2 -2
- package/dist/dropdownMenu.cva-DwSOcbmR.js +31 -0
- package/dist/{fileUpload.cva-ujmStxB1.js → fileUpload.cva-BYzXGc9C.js} +11 -11
- package/dist/{fileUpload.types-n5FxK_F-.d.ts → fileUpload.types-C-ke21yY.d.ts} +17 -17
- package/dist/form.binding-DOR5gIQf.js +49 -0
- package/dist/form.types-C8P4sznq.d.ts +22 -0
- package/dist/formFieldError.cva-BB6Ghqwq.js +14 -0
- package/dist/formFieldHelper.cva-DRmSyRZN.js +14 -0
- package/dist/formLayout.context--CN08Mtb.js +14 -0
- package/dist/hooks/use-async-list.d.ts +2 -0
- package/dist/hooks/use-async-list.js +2 -0
- package/dist/hooks/use-filters.js +1 -1
- package/dist/hooks/use-local-storage.js +1 -1
- package/dist/{i18n-CX2EjhJI.js → i18n-D1FWVTPi.js} +24 -4
- package/dist/{i18n-CX1vFM9r.d.ts → i18n-DE45mOCM.d.ts} +24 -0
- package/dist/iconSlot.cva-CLB5Tlsr.d.ts +9 -0
- package/dist/icons.d.ts +2 -1
- package/dist/icons.js +3 -3
- package/dist/import-C14g8ng0.js +251 -0
- package/dist/index.d.ts +100 -91
- package/dist/index.js +100 -94
- package/dist/{input.cva-BsHgYa-L.d.ts → input.cva-BjuHsDGy.d.ts} +11 -11
- package/dist/input.cva-DZii82eS.js +185 -0
- package/dist/inputLayout-KdAtunGk.js +5 -0
- package/dist/{intlStrings-chfsan9H.js → intlStrings-Cu1YN1tA.js} +35 -35
- package/dist/isEqual-LFw0W5rU.js +97 -0
- package/dist/label.cva-DTfT6FrX.js +85 -0
- package/dist/{link.context-D5qyz9Rf.d.ts → link.context-BCHn7NSy.d.ts} +1 -1
- package/dist/link.cva-C24YVAsJ.js +16 -0
- package/dist/{numberStatic.utils-BX50PSee.js → numberStatic.utils-BIyZuILs.js} +5 -5
- package/dist/outline.clsx-DGGQQRkM.js +6 -0
- package/dist/popover.cva-DAbfSma6.js +5 -0
- package/dist/progress.cva-CsGaGVJ-.js +28 -0
- package/dist/{radio.cva-DN9VQ3Kb.d.ts → radio.cva-D7M1hqLe.d.ts} +9 -5
- package/dist/radio.cva-DistaZtZ.js +96 -0
- package/dist/rich-text-editor.d.ts +2 -2
- package/dist/rich-text-editor.js +1 -1
- package/dist/{routing.utils-UTQonIhB.js → routing.utils-DfxEt0_Y.js} +5 -0
- package/dist/selectDesktop.cva-DStkOdwm.js +14 -0
- package/dist/selectItem.cva-B6vxey2R.js +27 -0
- package/dist/{staticDateTimeSegments-DtU63_dw.js → staticDateTimeSegments-bPuA-a2Y.js} +61 -57
- package/dist/status.cva-CYgi3Htz.js +130 -0
- package/dist/stepper.cva-Cecphqeo.js +104 -0
- package/dist/style-definitions-Dx6aFDiR.d.ts +1038 -0
- package/dist/styles/editor.css +9 -9
- package/dist/styles/input.d.ts +1 -1
- package/dist/styles/outline.js +1 -1
- package/dist/switch.cva-BT0kGRIk.js +24 -0
- package/dist/switch.cva-r6vcS25Q.d.ts +16 -0
- package/dist/table.cva-DkcsOmZG.js +147 -0
- package/dist/tag.cva-ExMNsTN-.js +24 -0
- package/dist/tanstack/autocomplete.d.ts +3 -2
- package/dist/tanstack/autocomplete.js +1 -1
- package/dist/tanstack/checkbox-group.d.ts +3 -2
- package/dist/tanstack/checkbox-group.js +1 -1
- package/dist/tanstack/checkbox.d.ts +3 -2
- package/dist/tanstack/checkbox.js +2 -2
- package/dist/tanstack/date-picker.d.ts +3 -2
- package/dist/tanstack/date-picker.js +1 -1
- package/dist/tanstack/date-range-picker.d.ts +3 -2
- package/dist/tanstack/date-range-picker.js +1 -1
- package/dist/tanstack/date-time-picker.d.ts +3 -2
- package/dist/tanstack/date-time-picker.js +1 -1
- package/dist/tanstack/file-input.d.ts +3 -2
- package/dist/tanstack/file-input.js +1 -1
- package/dist/tanstack/file-upload.d.ts +4 -3
- package/dist/tanstack/file-upload.js +1 -1
- package/dist/tanstack/form.d.ts +3 -3
- package/dist/tanstack/form.js +3 -3
- package/dist/tanstack/input.d.ts +3 -2
- package/dist/tanstack/input.js +1 -1
- package/dist/tanstack/number-field.d.ts +3 -2
- package/dist/tanstack/number-field.js +1 -1
- package/dist/tanstack/number-range-input.d.ts +3 -2
- package/dist/tanstack/number-range-input.js +1 -1
- package/dist/tanstack/password-input.d.ts +1 -1
- package/dist/tanstack/password-input.js +1 -1
- package/dist/tanstack/radio-group.d.ts +3 -2
- package/dist/tanstack/radio-group.js +1 -1
- package/dist/tanstack/rich-text-editor.d.ts +9 -2
- package/dist/tanstack/rich-text-editor.js +27 -1
- package/dist/tanstack/select.d.ts +3 -2
- package/dist/tanstack/select.js +1 -1
- package/dist/tanstack/slider.d.ts +3 -2
- package/dist/tanstack/slider.js +1 -1
- package/dist/tanstack/switch.d.ts +3 -2
- package/dist/tanstack/switch.js +1 -1
- package/dist/tanstack/table.d.ts +3 -2
- package/dist/tanstack/table.js +2 -3
- package/dist/tanstack/text-area.d.ts +3 -2
- package/dist/tanstack/text-area.js +1 -1
- package/dist/tanstack/time-picker.d.ts +3 -2
- package/dist/tanstack/time-picker.js +1 -1
- package/dist/tanstack/toggle-group.d.ts +3 -3
- package/dist/tanstack/toggle-group.js +1 -1
- package/dist/{queries.utils-CmbhAoHU.js → tanstack-Bgdv0qU1.js} +2 -1
- package/dist/tanstack-zusJduSB.d.ts +568 -0
- package/dist/tanstack.d.ts +84 -78
- package/dist/tanstack.js +100 -92
- package/dist/{theme.context-B3wQDJ-i.js → theme.context--VEyStJB.js} +2 -2
- package/dist/{toast.cva-By5lvAfr.d.ts → toast.cva-AmLw6Cf5.d.ts} +10 -10
- package/dist/{toast.cva-C_L_RffH.js → toast.cva-B6NXTwbZ.js} +22 -38
- package/dist/{toast.runtime-cxex9e4E.js → toast.runtime-Drd2IJ_j.js} +1 -2
- package/dist/toggleGroup.cva-CJ-3Ps7j.js +35 -0
- package/dist/toggleGroup.cva-DA4U21gn.d.ts +26 -0
- package/dist/{tooltip.cva-BIzlOXHH.js → tooltip.cva-BEyxvcG2.js} +11 -11
- package/dist/{tooltipWrapper.cva-BBQ4ic3D.js → tooltipWrapper.cva-t4NQ9zz9.js} +1 -1
- package/dist/tw-ui-plugin.js +5 -1
- package/dist/typography.cva-BCHlTHdM.d.ts +36 -0
- package/dist/typography.cva-CHsHX_Wp.js +31 -0
- package/dist/uiConfig.context-3DN9w6oU.js +180 -0
- package/dist/{uiConfig.context-DeBX2beU.d.ts → uiConfig.context-BnCORTNm.d.ts} +25 -20
- package/dist/{uiOverrides.context-DEp139He.d.ts → uiOverrides.context-DHHzLSnq.d.ts} +67 -6
- package/dist/useAsyncList-Ct74ve3i.js +445 -0
- package/dist/useAsyncList-Cu-Y8If2.d.ts +9 -0
- package/dist/{useBreakpoint-DQoMN-BG.js → useBreakpoint-CJ3mx7UF.js} +6 -6
- package/dist/{useControlledState-CzXkZCX8.js → useControlledState-CuU1VIh1.js} +2 -2
- package/dist/useFieldAccessibility-eZIMECmG.js +19 -0
- package/dist/{useFilters-XNH27Md2.js → useFilters-DMi94RZK.js} +3 -3
- package/dist/{form.binding-CG1RPv6o.js → useForm-Cb7KWLds.js} +80 -43
- package/dist/{form.binding-DVJ5F0JE.d.ts → useForm-I6z23FXf.d.ts} +15 -15
- package/dist/useFormAutosave-BBLm3Ujo.d.ts +34 -0
- package/dist/useFormAutosave-BPGlChiY.js +216 -0
- package/dist/useScrollableListBox-oYKqU3Hp.js +47 -0
- package/dist/useStaticInputHandoff-BN0fOerH.js +76 -0
- package/dist/useTableColumnConfig-D5NxR1Co.js +2060 -0
- package/dist/useTableNav-H5DrogZU.d.ts +215 -0
- package/dist/{useToast-yreVCUer.d.ts → useToast-DsA8CVoY.d.ts} +1 -1
- package/dist/{utils-Czcqspm7.js → utils-BkLF-JA3.js} +1 -1
- package/package.json +86 -236
- package/.rulesync/rules/ui-buttons-and-content.md +0 -56
- package/.rulesync/rules/ui-inputs-and-forms.md +0 -62
- package/.rulesync/rules/ui-overlays-navigation-and-styling.md +0 -49
- package/.rulesync/rules/ui-overview.md +0 -33
- package/dist/Alert-CnvEb1D_.js +0 -244
- package/dist/AppCanvasPage--RG31Yyv.js +0 -2421
- package/dist/AppCanvasPage-BIFYeEeS.d.ts +0 -80
- package/dist/Autocomplete-BwNHp8fy.d.ts +0 -15
- package/dist/Button-C5rv4Cr2.js +0 -506
- package/dist/Button-D-4qb0IR.d.ts +0 -42
- package/dist/CheckboxCheckmark-CpC3wlMs.js +0 -178
- package/dist/CheckboxGroup-DGF12cmB.d.ts +0 -28
- package/dist/ComponentGallery-C6exitZN.js +0 -3513
- package/dist/Dialog-CW93T9X1.d.ts +0 -56
- package/dist/DropdownMenu-JNpYT4-3.d.ts +0 -62
- package/dist/FileUpload-CR7bZxV1.d.ts +0 -7
- package/dist/Form-DbEWnCKc.d.ts +0 -49
- package/dist/FormField-B99dLt8o.js +0 -212
- package/dist/IconButton-D4thBurp.d.ts +0 -16
- package/dist/InlineIconButton-BeJCjl-q.d.ts +0 -15
- package/dist/InputItem-CIxbTxZu.js +0 -63
- package/dist/Inputs-DJSKiaWY.js +0 -17
- package/dist/Inputs-O84btFJL.d.ts +0 -13
- package/dist/PaginationList-DtvuP63b.js +0 -220
- package/dist/PasswordInput-DYwUZ4-k.js +0 -78
- package/dist/QuerySelect-BGxb6Y0K.d.ts +0 -24
- package/dist/RadioGroup-CZg2kIMk.d.ts +0 -24
- package/dist/RichTextEditor-YxuRUlI7.d.ts +0 -26
- package/dist/Select-UR0ec2Ux.js +0 -154
- package/dist/Select-pHbyJdZJ.d.ts +0 -15
- package/dist/SelectionIndicator-JblvLKCu.js +0 -5
- package/dist/SharedElementTransition-Da1c_cOO.js +0 -12
- package/dist/Switch-s_EPn0Jz.d.ts +0 -22
- package/dist/Table-BN2_J_Ne.js +0 -636
- package/dist/Tag-AHfV_XSf.d.ts +0 -44
- package/dist/Tag-DPg5sL1Z.js +0 -146
- package/dist/TextButton-XUhV_1s0.d.ts +0 -15
- package/dist/TimePicker-B1POvGWs.d.ts +0 -33
- package/dist/Toast-DtG3pA61.js +0 -53
- package/dist/ToggleButton-7aP8Jb11.d.ts +0 -11
- package/dist/ToggleGroup-CRFDIPGZ.d.ts +0 -7
- package/dist/ToggleGroup-DOk27fgI.js +0 -346
- package/dist/Tooltip-DHv6vAqW.d.ts +0 -57
- package/dist/UIConfigurator-BwLRfe-a.js +0 -6704
- package/dist/autocomplete-DeERHN8W.d.ts +0 -16
- package/dist/badgeButton.cva-CvN4CTx5.js +0 -300
- package/dist/check-DYMBkp_Z.js +0 -20
- package/dist/checkbox-DxIPDTK5.d.ts +0 -9
- package/dist/checkbox-group-B3BOVshI.d.ts +0 -9
- package/dist/chevron-down-B4Pr8bD3.js +0 -20
- package/dist/chevron-left-Dgo_b9wJ.js +0 -20
- package/dist/chevron-right-3nKJR5Bb.js +0 -20
- package/dist/chevron-up-D_Gqpb5M.js +0 -20
- package/dist/chevrons-right-DJPPn2fD.js +0 -44
- package/dist/components/inline-icon-button.d.ts +0 -2
- package/dist/components/inline-icon-button.js +0 -40
- package/dist/components/query-autocomplete.d.ts +0 -8
- package/dist/components/query-autocomplete.js +0 -134
- package/dist/components/query-select.d.ts +0 -2
- package/dist/components/query-select.js +0 -147
- package/dist/components/text-button.d.ts +0 -2
- package/dist/components/text-button.js +0 -35
- package/dist/config/app-canvas-tanstack.d.ts +0 -23
- package/dist/config/app-canvas-tanstack.js +0 -62
- package/dist/config/app-canvas.d.ts +0 -12
- package/dist/config/app-canvas.js +0 -2
- package/dist/config/ui-configurator-theme.d.ts +0 -2
- package/dist/config/ui-configurator-theme.js +0 -2
- package/dist/config/ui-configurator-vite.d.ts +0 -10
- package/dist/config/ui-configurator-vite.js +0 -174
- package/dist/config/ui-configurator.d.ts +0 -15
- package/dist/config/ui-configurator.js +0 -3
- package/dist/configuration.context-f_FSPWhQ.d.ts +0 -926
- package/dist/createLucideIcon-LcezOE4z.js +0 -240
- package/dist/date-picker-DnxDmlOW.d.ts +0 -9
- package/dist/date-range-picker-DHDOSvHN.d.ts +0 -9
- package/dist/date-time-picker-UkTa0OJ8.d.ts +0 -9
- package/dist/date.transforms-DLg-eFcE.js +0 -15
- package/dist/dropdownMenu.cva-DvEmX0bs.js +0 -34
- package/dist/dynamicInputs-ByVMnx4Z.d.ts +0 -772
- package/dist/dynamicInputs-CRMWIpHA.js +0 -194
- package/dist/dynamicInputs-m_DQu5q0.js +0 -214
- package/dist/fieldAdapter-C4sDFC8f.d.ts +0 -9
- package/dist/fieldAdapter-DjYls12j.js +0 -63
- package/dist/file-input-DkbkdI7l.d.ts +0 -9
- package/dist/file-upload-CTsPhxJk.d.ts +0 -10
- package/dist/form.types-CecYaerF.d.ts +0 -13
- package/dist/form.types-ZNGbcqJS.d.ts +0 -13
- package/dist/info-iUmX3uDk.js +0 -32
- package/dist/input-CdQNCPgH.d.ts +0 -8
- package/dist/input.cva-DJA8ovm_.js +0 -208
- package/dist/link.cva-DMTHZiJG.js +0 -12
- package/dist/number-field-CUDbenNV.d.ts +0 -8
- package/dist/number-range-input-DZGrcvjL.d.ts +0 -8
- package/dist/outline.clsx-50W_vNDl.js +0 -6
- package/dist/password-input-fYN20cQO.d.ts +0 -8
- package/dist/popover.cva-Bhud1wnp.js +0 -5
- package/dist/query-autocomplete-CfuQeiYG.d.ts +0 -14
- package/dist/query-select-CuT_sE6a.d.ts +0 -15
- package/dist/queryAutocomplete.types-tl3r6iaY.d.ts +0 -27
- package/dist/radio-group-B3ccPf0p.d.ts +0 -9
- package/dist/rhf/autocomplete.d.ts +0 -3
- package/dist/rhf/autocomplete.js +0 -8
- package/dist/rhf/checkbox-group.d.ts +0 -3
- package/dist/rhf/checkbox-group.js +0 -8
- package/dist/rhf/checkbox.d.ts +0 -3
- package/dist/rhf/checkbox.js +0 -8
- package/dist/rhf/date-picker.d.ts +0 -3
- package/dist/rhf/date-picker.js +0 -9
- package/dist/rhf/date-range-picker.d.ts +0 -3
- package/dist/rhf/date-range-picker.js +0 -9
- package/dist/rhf/date-time-picker.d.ts +0 -3
- package/dist/rhf/date-time-picker.js +0 -9
- package/dist/rhf/file-input.d.ts +0 -3
- package/dist/rhf/file-input.js +0 -6
- package/dist/rhf/file-upload.d.ts +0 -3
- package/dist/rhf/file-upload.js +0 -6
- package/dist/rhf/input.d.ts +0 -3
- package/dist/rhf/input.js +0 -6
- package/dist/rhf/inputs.d.ts +0 -4
- package/dist/rhf/inputs.js +0 -2
- package/dist/rhf/number-field.d.ts +0 -3
- package/dist/rhf/number-field.js +0 -6
- package/dist/rhf/number-range-input.d.ts +0 -3
- package/dist/rhf/number-range-input.js +0 -6
- package/dist/rhf/password-input.d.ts +0 -3
- package/dist/rhf/password-input.js +0 -6
- package/dist/rhf/query-autocomplete.d.ts +0 -2
- package/dist/rhf/query-autocomplete.js +0 -8
- package/dist/rhf/query-select.d.ts +0 -2
- package/dist/rhf/query-select.js +0 -8
- package/dist/rhf/radio-group.d.ts +0 -3
- package/dist/rhf/radio-group.js +0 -8
- package/dist/rhf/rich-text-editor.d.ts +0 -3
- package/dist/rhf/rich-text-editor.js +0 -6
- package/dist/rhf/select.d.ts +0 -3
- package/dist/rhf/select.js +0 -8
- package/dist/rhf/slider.d.ts +0 -3
- package/dist/rhf/slider.js +0 -6
- package/dist/rhf/switch.d.ts +0 -3
- package/dist/rhf/switch.js +0 -8
- package/dist/rhf/text-area.d.ts +0 -3
- package/dist/rhf/text-area.js +0 -6
- package/dist/rhf/time-picker.d.ts +0 -3
- package/dist/rhf/time-picker.js +0 -9
- package/dist/rhf/toggle-group.d.ts +0 -3
- package/dist/rhf/toggle-group.js +0 -6
- package/dist/rhf-t348TCCL.js +0 -256
- package/dist/rhf.d.ts +0 -106
- package/dist/rhf.js +0 -112
- package/dist/rich-text-editor-B-Onl7T8.d.ts +0 -8
- package/dist/select-B4a52eWW.d.ts +0 -16
- package/dist/selectDesktop.cva-CHAMxhfO.js +0 -69
- package/dist/slider-dNj9jruO.d.ts +0 -8
- package/dist/stepper.cva-CZ0Kj-s7.js +0 -116
- package/dist/style-merge.util-zLimKwt6.d.ts +0 -40
- package/dist/styles/app-canvas.css +0 -740
- package/dist/styles/color-utilities.css +0 -20
- package/dist/styles/configurator.css +0 -3280
- package/dist/switch-C--iWnY8.d.ts +0 -9
- package/dist/switch.cva-CWNzmdRc.d.ts +0 -16
- package/dist/table.cva-D5oQ-QvA.js +0 -101
- package/dist/tanstack/inputs.d.ts +0 -5
- package/dist/tanstack/inputs.js +0 -3
- package/dist/tanstack/query-autocomplete.d.ts +0 -2
- package/dist/tanstack/query-autocomplete.js +0 -2
- package/dist/tanstack/query-select.d.ts +0 -2
- package/dist/tanstack/query-select.js +0 -2
- package/dist/text-area-DQAtpOQp.d.ts +0 -8
- package/dist/theme-model-DtYPxNvH.js +0 -406
- package/dist/theme-model-T1zIdBg8.d.ts +0 -12
- package/dist/time-picker-DoGfbil6.d.ts +0 -9
- package/dist/toggle-group-C1nMDOwz.d.ts +0 -9
- package/dist/toggleGroup.cva-MbpaEBg1.js +0 -35
- package/dist/toggleGroup.types-Bp43zbSQ.d.ts +0 -59
- package/dist/typography.cva-D1JOEYl-.d.ts +0 -36
- package/dist/typography.cva-iD15k56p.js +0 -51
- package/dist/uiConfig.context-BS3r_kTS.js +0 -381
- package/dist/underline-66hmELxa.js +0 -81
- package/dist/upload-CXU83BJ4.js +0 -30
- package/dist/useFieldAccessibility-ScC6Mtd5.js +0 -102
- package/dist/useFormAutosave-DfuP7drj.js +0 -198
- package/dist/useQueryAutocomplete-CraXvRm_.js +0 -152
- package/dist/useTableColumnConfig-Di0_w80v.js +0 -892
- package/dist/useTableNav-Ckj5PBRk.d.ts +0 -292
- package/dist/x-B6vfz8Ps.js +0 -23
- package/dist/zod.utils-DrrPDT9v.js +0 -24
- package/rulesync.jsonc +0 -11
- package/scripts/generate-rules.mjs +0 -34
- package/src/configurator/README.md +0 -77
- package/dist/{import-BE0r63d8.js → import-D_3dPATF.js} +2 -2
- package/dist/{link.context-J7aQtMOr.js → link.context-TPjDtjw3.js} +1 -1
- package/dist/{router.context-B4FvsTim.js → router.context-MckTbHw9.js} +1 -1
- package/dist/{uiOverrides.context-BTCH9y5a.js → uiOverrides.context-DNEQlTx0.js} +1 -1
- package/dist/{useIntersectionObserver-DYfHnGGU.js → useIntersectionObserver-DFAhTsV0.js} +1 -1
- package/dist/{useLocalStorage-PlcaJ1tP.js → useLocalStorage-CctQvyqD.js} +1 -1
|
@@ -1,8 +1,67 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as logger } from "./logger-CqZjM-sn.js";
|
|
2
|
+
import { n as ObjectUtils, t as isEqual } from "./isEqual-LFw0W5rU.js";
|
|
2
3
|
import { c } from "react/compiler-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import { useForm, useStore } from "@tanstack/react-form";
|
|
4
|
+
import { useEffect, useLayoutEffect, useMemo, useRef } from "react";
|
|
5
|
+
import { getBy, setBy, useForm, useStore } from "@tanstack/react-form";
|
|
5
6
|
import { Store } from "@tanstack/store";
|
|
7
|
+
//#region src/hooks/autosaveFields.ts
|
|
8
|
+
/** Raw fields edited since a submitted snapshot. Arrays and dates are replaced whole. */
|
|
9
|
+
function getChangedAutosaveFields(current, submitted, path = "") {
|
|
10
|
+
if (isEqual(current, submitted)) return [];
|
|
11
|
+
if (!ObjectUtils.isObject(current) || Array.isArray(current) || ObjectUtils.isDate(current) || ObjectUtils.isRegExp(current) || ObjectUtils.isEmpty(current)) return [[path, current]];
|
|
12
|
+
const values = current;
|
|
13
|
+
const previous = ObjectUtils.isObject(submitted) ? submitted : {};
|
|
14
|
+
return [.../* @__PURE__ */ new Set([...Object.keys(values), ...Object.keys(previous)])].flatMap((key) => getChangedAutosaveFields(values[key], previous[key], path ? `${path}.${key}` : key));
|
|
15
|
+
}
|
|
16
|
+
/** Select raw field paths included by a parsed patch, stopping at atomic raw fields. */
|
|
17
|
+
function getSubmittedAutosaveFields(patch, raw, path = "") {
|
|
18
|
+
if (!ObjectUtils.isObject(raw) || Array.isArray(raw) || ObjectUtils.isDate(raw) || ObjectUtils.isRegExp(raw) || !ObjectUtils.isObject(patch) || Array.isArray(patch)) return [[path, raw]];
|
|
19
|
+
return Object.entries(patch).flatMap(([key, value]) => getSubmittedAutosaveFields(value, raw[key], path ? `${path}.${key}` : key));
|
|
20
|
+
}
|
|
21
|
+
/** Project raw changes into parsed values, retaining explicit undefined clears. */
|
|
22
|
+
function getAutosavePatch(parsed, changes) {
|
|
23
|
+
let patch = {};
|
|
24
|
+
for (const [path] of changes) {
|
|
25
|
+
if (!path) return parsed;
|
|
26
|
+
patch = setBy(patch, path, getBy(parsed, path));
|
|
27
|
+
}
|
|
28
|
+
return patch;
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/hooks/formReset.ts
|
|
32
|
+
const listeners = /* @__PURE__ */ new WeakMap();
|
|
33
|
+
const refreshing = /* @__PURE__ */ new WeakSet();
|
|
34
|
+
const versions = /* @__PURE__ */ new WeakMap();
|
|
35
|
+
function getFormResetVersion(form) {
|
|
36
|
+
return versions.get(form) ?? 0;
|
|
37
|
+
}
|
|
38
|
+
function subscribeFormReset(form, listener) {
|
|
39
|
+
let callbacks = listeners.get(form);
|
|
40
|
+
if (!callbacks) {
|
|
41
|
+
callbacks = /* @__PURE__ */ new Set();
|
|
42
|
+
listeners.set(form, callbacks);
|
|
43
|
+
}
|
|
44
|
+
callbacks.add(listener);
|
|
45
|
+
return () => callbacks.delete(listener);
|
|
46
|
+
}
|
|
47
|
+
function notifyFormReset(form) {
|
|
48
|
+
if (refreshing.has(form)) return;
|
|
49
|
+
versions.set(form, getFormResetVersion(form) + 1);
|
|
50
|
+
listeners.get(form)?.forEach((listener) => listener());
|
|
51
|
+
}
|
|
52
|
+
function refreshAutosaveForm(form, baseline, refresh, acknowledged = []) {
|
|
53
|
+
refreshing.add(form);
|
|
54
|
+
try {
|
|
55
|
+
refresh();
|
|
56
|
+
} finally {
|
|
57
|
+
refreshing.delete(form);
|
|
58
|
+
}
|
|
59
|
+
listeners.get(form)?.forEach((listener) => listener({
|
|
60
|
+
baseline,
|
|
61
|
+
acknowledged
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
6
65
|
//#region src/hooks/useForm.ts
|
|
7
66
|
const disabledStores = /* @__PURE__ */ new WeakMap();
|
|
8
67
|
function useForm$1({ defaultValues, disabled = false, mode = "onSubmit", onSubmitAsync, zodSchema } = {}) {
|
|
@@ -82,6 +141,7 @@ function useForm$1({ defaultValues, disabled = false, mode = "onSubmit", onSubmi
|
|
|
82
141
|
touchedFieldsRef.current.clear();
|
|
83
142
|
if (args[0] !== void 0 && !args[1]?.keepDefaultValues) defaultValuesRef.current = args[0];
|
|
84
143
|
originalReset(...args);
|
|
144
|
+
notifyFormReset(uiForm);
|
|
85
145
|
};
|
|
86
146
|
uiForm.subscribeBlur = (listener_0) => {
|
|
87
147
|
blurListenersRef.current.add(listener_0);
|
|
@@ -95,7 +155,22 @@ function useForm$1({ defaultValues, disabled = false, mode = "onSubmit", onSubmi
|
|
|
95
155
|
await originalHandleSubmit();
|
|
96
156
|
};
|
|
97
157
|
useEffect(() => {
|
|
98
|
-
|
|
158
|
+
let active = true;
|
|
159
|
+
const revision = getFormResetVersion(form);
|
|
160
|
+
const valuesAtLoad = structuredClone(form.state.values);
|
|
161
|
+
if (typeof initialDefaultValues === "function") initialDefaultValues().then((values_0) => {
|
|
162
|
+
if (!active || revision !== getFormResetVersion(form)) return;
|
|
163
|
+
const edits = getChangedAutosaveFields(form.state.values, valuesAtLoad);
|
|
164
|
+
form.reset(values_0);
|
|
165
|
+
for (const [path, value_3] of edits) {
|
|
166
|
+
if (!path) continue;
|
|
167
|
+
const name_1 = path;
|
|
168
|
+
form.setFieldValue(name_1, value_3);
|
|
169
|
+
}
|
|
170
|
+
}).catch((error) => logger.warn("Unable to load form defaults", error));
|
|
171
|
+
return () => {
|
|
172
|
+
active = false;
|
|
173
|
+
};
|
|
99
174
|
}, [form, initialDefaultValues]);
|
|
100
175
|
useLayoutEffect(() => {
|
|
101
176
|
if (disabledStore.state !== disabled) disabledStore.setState(() => disabled);
|
|
@@ -139,42 +214,4 @@ const getSchemaAtPath = (rootSchema, path) => {
|
|
|
139
214
|
const parsePath = (path) => path.replaceAll("[", ".").replaceAll("]", "").split(".").filter(Boolean).map((segment) => /^\d+$/.test(segment) ? Number(segment) : segment);
|
|
140
215
|
const pathToString = (path) => path.reduce((result, segment) => typeof segment === "number" ? `${result}[${segment}]` : result ? `${result}.${String(segment)}` : String(segment), "");
|
|
141
216
|
//#endregion
|
|
142
|
-
|
|
143
|
-
const getFieldError = (errors) => errors.flatMap((error) => {
|
|
144
|
-
if (typeof error === "string") return [error];
|
|
145
|
-
if (error && typeof error === "object" && "message" in error) return [String(error.message)];
|
|
146
|
-
return [];
|
|
147
|
-
}).at(0);
|
|
148
|
-
//#endregion
|
|
149
|
-
//#region src/components/inputs/shared/form.binding.tsx
|
|
150
|
-
function FieldController({ control: form, name, render }) {
|
|
151
|
-
const isFormDisabled = useFormDisabled(form);
|
|
152
|
-
const submissionAttempts = useFormState(form, (state) => state.submissionAttempts);
|
|
153
|
-
return /* @__PURE__ */ jsx(form.Field, {
|
|
154
|
-
name,
|
|
155
|
-
validators: form.getFieldValidators(name),
|
|
156
|
-
children: (field) => {
|
|
157
|
-
const validators = form.getFieldValidators(name);
|
|
158
|
-
const validationError = submissionAttempts > 0 ? getFieldError(field.state.meta.errors) : validators?.onChange && field.state.meta.isDirty ? validators.onChange({ value: field.state.value }) : validators?.onBlur && field.state.meta.isTouched ? validators.onBlur({ value: field.state.value }) : void 0;
|
|
159
|
-
return render({
|
|
160
|
-
field: {
|
|
161
|
-
disabled: isFormDisabled,
|
|
162
|
-
name: field.name,
|
|
163
|
-
onBlur: () => {
|
|
164
|
-
field.handleBlur();
|
|
165
|
-
form.notifyBlur(name);
|
|
166
|
-
},
|
|
167
|
-
onChange: field.handleChange,
|
|
168
|
-
ref: () => void 0,
|
|
169
|
-
value: field.state.value
|
|
170
|
-
},
|
|
171
|
-
fieldState: {
|
|
172
|
-
error: validationError ? { message: validationError } : void 0,
|
|
173
|
-
isDirty: field.state.meta.isDirty
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
//#endregion
|
|
180
|
-
export { useFormValue as i, useForm$1 as n, useFormState as r, FieldController as t };
|
|
217
|
+
export { getFormResetVersion as a, getAutosavePatch as c, useFormValue as i, getChangedAutosaveFields as l, useFormDisabled as n, refreshAutosaveForm as o, useFormState as r, subscribeFormReset as s, useForm$1 as t, getSubmittedAutosaveFields as u };
|
|
@@ -13,20 +13,20 @@ type FieldValidators = {
|
|
|
13
13
|
type FormSubmitHandler<TValues> = (values: TValues) => void | Promise<void>;
|
|
14
14
|
type FormSubmitErrorHandler<TValues> = (errors: unknown, values: TValues) => unknown;
|
|
15
15
|
type TanStackForm<TFieldValues> = ReactFormExtendedApi<TFieldValues, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, never>;
|
|
16
|
-
type UIForm<TFieldValues extends Record<string, unknown> = Record<string, unknown
|
|
16
|
+
type UIForm<TFieldValues extends Record<string, unknown> = Record<string, unknown>, TTransformedValues = TFieldValues> = Omit<TanStackForm<TFieldValues>, "handleSubmit"> & {
|
|
17
17
|
readonly disabled: boolean;
|
|
18
18
|
getFieldValidators: (name: DeepKeys<TFieldValues>) => FieldValidators | undefined;
|
|
19
19
|
notifyBlur: (name: DeepKeys<TFieldValues>) => void;
|
|
20
|
-
parseValues: (values: TFieldValues) =>
|
|
20
|
+
parseValues: (values: TFieldValues) => TTransformedValues;
|
|
21
21
|
subscribeBlur: (listener: (name: DeepKeys<TFieldValues>) => void) => () => void;
|
|
22
|
-
handleSubmit: (onValid: FormSubmitHandler<
|
|
22
|
+
handleSubmit: (onValid: FormSubmitHandler<TTransformedValues>, onInvalid?: FormSubmitErrorHandler<TFieldValues>) => (event?: {
|
|
23
23
|
preventDefault?: () => void;
|
|
24
24
|
stopPropagation?: () => void;
|
|
25
25
|
}) => Promise<void>;
|
|
26
26
|
};
|
|
27
27
|
type AsyncDefaultValues<TFieldValues> = (payload?: unknown) => Promise<TFieldValues>;
|
|
28
28
|
type NullableDefaults<T> = T extends Date | File | Blob ? T : T extends Array<infer TItem> ? Array<NullableDefaults<TItem>> : T extends object ? { [K in keyof T]?: NullableDefaults<T[K]> | null; } : T | null;
|
|
29
|
-
interface
|
|
29
|
+
interface BaseUseFormProps<TFieldValues, TTransformedValues = TFieldValues> {
|
|
30
30
|
/** Initial form values. Changes after mount are ignored; use `form.reset()` to replace form values. */
|
|
31
31
|
defaultValues?: NullableDefaults<TFieldValues> | AsyncDefaultValues<TFieldValues>;
|
|
32
32
|
disabled?: boolean;
|
|
@@ -36,16 +36,16 @@ interface UseFormProps<TFieldValues, TTransformedValues = TFieldValues> {
|
|
|
36
36
|
}) => Promise<unknown>;
|
|
37
37
|
zodSchema?: z.ZodType<TTransformedValues, TFieldValues>;
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
/** A distinct parsed output requires the schema that produces it. */
|
|
40
|
+
type UseFormProps<TFieldValues, TTransformedValues = TFieldValues> = BaseUseFormProps<TFieldValues, TTransformedValues> & ([TFieldValues] extends [TTransformedValues] ? unknown : {
|
|
41
|
+
zodSchema: z.ZodType<TTransformedValues, TFieldValues>;
|
|
42
|
+
});
|
|
43
|
+
type UseFormArguments<TFieldValues, TTransformedValues> = [TFieldValues] extends [TTransformedValues] ? [props?: UseFormProps<TFieldValues, TTransformedValues>] : [props: UseFormProps<TFieldValues, TTransformedValues>];
|
|
44
|
+
declare function useForm<TSchema extends z.ZodType<unknown, Record<string, unknown>>>(props: UseFormProps<z.input<NoInfer<TSchema>>, z.output<NoInfer<TSchema>>> & {
|
|
40
45
|
zodSchema: TSchema;
|
|
41
|
-
}): UIForm<z.input<TSchema>>;
|
|
42
|
-
declare function useForm<TFieldValues extends Record<string, unknown> = Record<string, unknown>,
|
|
43
|
-
declare const useFormValue: <TFieldValues extends Record<string, unknown>, TSelected>(form: UIForm<TFieldValues>, selector: (values: TFieldValues) => TSelected) => TSelected;
|
|
44
|
-
declare const useFormState: <TFieldValues extends Record<string, unknown>, TSelected>(form: UIForm<TFieldValues>, selector: (state: UIForm<TFieldValues>["state"]) => TSelected) => TSelected;
|
|
46
|
+
}): UIForm<z.input<TSchema>, z.output<TSchema>>;
|
|
47
|
+
declare function useForm<TFieldValues extends Record<string, unknown> = Record<string, unknown>, TTransformedValues = TFieldValues>(...args: UseFormArguments<TFieldValues, TTransformedValues>): UIForm<TFieldValues, TTransformedValues>;
|
|
48
|
+
declare const useFormValue: <TFieldValues extends Record<string, unknown>, TSelected>(form: UIForm<TFieldValues, unknown>, selector: (values: TFieldValues) => TSelected) => TSelected;
|
|
49
|
+
declare const useFormState: <TFieldValues extends Record<string, unknown>, TSelected>(form: UIForm<TFieldValues, unknown>, selector: (state: UIForm<TFieldValues>["state"]) => TSelected) => TSelected;
|
|
45
50
|
//#endregion
|
|
46
|
-
|
|
47
|
-
type FieldValues = Record<string, any>;
|
|
48
|
-
type FieldPath<TFieldValues extends FieldValues> = DeepKeys<TFieldValues>;
|
|
49
|
-
type FormInstance<TFieldValues extends FieldValues> = UIForm<TFieldValues>;
|
|
50
|
-
//#endregion
|
|
51
|
-
export { DeepValue as a, UIForm as c, useFormState as d, useFormValue as f, DeepKeys as i, UseFormProps as l, FieldValues as n, FormSubmitErrorHandler as o, FormInstance as r, FormSubmitHandler as s, FieldPath as t, useForm as u };
|
|
51
|
+
export { UIForm as a, useFormState as c, FormSubmitHandler as i, useFormValue as l, DeepValue as n, UseFormProps as o, FormSubmitErrorHandler as r, useForm as s, DeepKeys as t };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { a as UIForm, o as UseFormProps } from "./useForm-I6z23FXf.js";
|
|
2
|
+
import { DependencyList } from "react";
|
|
3
|
+
//#region src/hooks/useAutosave.d.ts
|
|
4
|
+
type MissingOutputKeys<TInput, TOutput> = TInput extends Date | RegExp | readonly unknown[] ? never : TInput extends object ? TOutput extends object ? { [K in keyof TInput]-?: K extends keyof TOutput ? MissingOutputKeys<NonNullable<TInput[K]>, NonNullable<TOutput[K]>> : K; }[keyof TInput] : keyof TInput : never;
|
|
5
|
+
/** Changed object paths are recursive patches; arrays, dates and regular expressions are replaced whole. */
|
|
6
|
+
type AutosavePatch<T> = T extends Date | RegExp | readonly unknown[] ? T : T extends object ? { [K in keyof T]?: AutosavePatch<T[K]>; } : T;
|
|
7
|
+
type AutosaveHandler<TInput, TOutput, TResponse> = [TOutput] extends [object] ? [MissingOutputKeys<TInput, TOutput>] extends [never] ? (data: AutosavePatch<TOutput>) => Promise<TResponse> : never : never;
|
|
8
|
+
interface UseAutosaveProps<TFieldValues extends Record<string, unknown>, TTransformedValues = TFieldValues, TResponse = unknown> {
|
|
9
|
+
form: UIForm<TFieldValues, TTransformedValues>;
|
|
10
|
+
delay?: number;
|
|
11
|
+
enabled?: boolean;
|
|
12
|
+
trigger?: "change" | "blur";
|
|
13
|
+
/** Parsed output must remain an object preserving every raw field path; optional output fields are supported. */
|
|
14
|
+
onSave: AutosaveHandler<TFieldValues, TTransformedValues, TResponse>;
|
|
15
|
+
onSaveSuccess?: () => void;
|
|
16
|
+
}
|
|
17
|
+
/** Autosaves changed fields only. Schemas must preserve raw field paths in their object output. */
|
|
18
|
+
declare function useAutosave<TFieldValues extends Record<string, unknown>, TTransformedValues = TFieldValues, TResponse = unknown>({ form, delay, enabled, trigger, onSave, onSaveSuccess }: UseAutosaveProps<TFieldValues, TTransformedValues, TResponse>): void;
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/hooks/useFormAutosave.d.ts
|
|
21
|
+
type UseFormAutosaveProps<TFieldValues extends Record<string, unknown> = Record<string, unknown>, TTransformedValues = TFieldValues, TResponse = unknown> = Omit<UseFormProps<TFieldValues, TTransformedValues>, "defaultValues"> & {
|
|
22
|
+
autosaveDelay?: UseAutosaveProps<TFieldValues, TTransformedValues, TResponse>["delay"];
|
|
23
|
+
enableAutosave?: UseAutosaveProps<TFieldValues, TTransformedValues, TResponse>["enabled"];
|
|
24
|
+
autosaveOn?: UseAutosaveProps<TFieldValues, TTransformedValues, TResponse>["trigger"];
|
|
25
|
+
normalizeAutosaveData?: (data: AutosavePatch<NoInfer<TTransformedValues>>) => AutosavePatch<NoInfer<TTransformedValues>> | undefined;
|
|
26
|
+
onAutosave: UseAutosaveProps<TFieldValues, TTransformedValues, TResponse>["onSave"];
|
|
27
|
+
getResetValues: () => UseFormProps<TFieldValues, TTransformedValues>["defaultValues"];
|
|
28
|
+
resetDeps: DependencyList;
|
|
29
|
+
resetTimeout?: number;
|
|
30
|
+
};
|
|
31
|
+
/** Autosave schemas must produce objects preserving every raw field path, including optional fields. */
|
|
32
|
+
declare function useFormAutosave<TFieldValues extends Record<string, unknown> = Record<string, unknown>, TTransformedValues = TFieldValues, TResponse = unknown>({ autosaveDelay, enableAutosave, autosaveOn, normalizeAutosaveData, onAutosave, getResetValues, resetDeps, resetTimeout, ...props }: UseFormAutosaveProps<TFieldValues, TTransformedValues, TResponse>): UIForm<TFieldValues, TTransformedValues>;
|
|
33
|
+
//#endregion
|
|
34
|
+
export { UseAutosaveProps as a, AutosavePatch as i, useFormAutosave as n, useAutosave as o, AutosaveHandler as r, UseFormAutosaveProps as t };
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { t as logger } from "./logger-CqZjM-sn.js";
|
|
2
|
+
import { n as ObjectUtils, t as isEqual } from "./isEqual-LFw0W5rU.js";
|
|
3
|
+
import { a as getFormResetVersion, c as getAutosavePatch, l as getChangedAutosaveFields, o as refreshAutosaveForm, s as subscribeFormReset, t as useForm$1, u as getSubmittedAutosaveFields } from "./useForm-Cb7KWLds.js";
|
|
4
|
+
import { useCallback, useEffect, useRef } from "react";
|
|
5
|
+
import { getBy, setBy } from "@tanstack/react-form";
|
|
6
|
+
//#region src/hooks/useAutosave.ts
|
|
7
|
+
const snapshot = (value) => structuredClone(value);
|
|
8
|
+
/** Autosaves changed fields only. Schemas must preserve raw field paths in their object output. */
|
|
9
|
+
function useAutosave({ form, delay = 500, enabled = true, trigger = "change", onSave, onSaveSuccess }) {
|
|
10
|
+
const timeoutRef = useRef(void 0);
|
|
11
|
+
const savedSnapshotRef = useRef(snapshot(form.state.values));
|
|
12
|
+
const saveQueueRef = useRef(Promise.resolve());
|
|
13
|
+
const acknowledgedFieldsRef = useRef(/* @__PURE__ */ new Map());
|
|
14
|
+
const resetRevisionRef = useRef(getFormResetVersion(form));
|
|
15
|
+
const latestSaveRef = useRef({
|
|
16
|
+
onSave,
|
|
17
|
+
onSaveSuccess
|
|
18
|
+
});
|
|
19
|
+
latestSaveRef.current = {
|
|
20
|
+
onSave,
|
|
21
|
+
onSaveSuccess
|
|
22
|
+
};
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
let active = true;
|
|
25
|
+
const clearPending = () => {
|
|
26
|
+
if (timeoutRef.current) {
|
|
27
|
+
clearTimeout(timeoutRef.current);
|
|
28
|
+
timeoutRef.current = void 0;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const queueSave = () => {
|
|
32
|
+
if (!enabled) return;
|
|
33
|
+
clearPending();
|
|
34
|
+
const revision = resetRevisionRef.current;
|
|
35
|
+
timeoutRef.current = setTimeout(() => {
|
|
36
|
+
saveQueueRef.current = saveQueueRef.current.then(async () => {
|
|
37
|
+
if (!active || revision !== resetRevisionRef.current) return;
|
|
38
|
+
const valuesAtSaveTime = snapshot(form.state.values);
|
|
39
|
+
const previousSavedValues = savedSnapshotRef.current;
|
|
40
|
+
const changedFields = getChangedAutosaveFields(valuesAtSaveTime, previousSavedValues);
|
|
41
|
+
if (changedFields.length === 0) return;
|
|
42
|
+
let transformedValues;
|
|
43
|
+
try {
|
|
44
|
+
transformedValues = form.parseValues(valuesAtSaveTime);
|
|
45
|
+
} catch {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const payload = getAutosavePatch(transformedValues, changedFields);
|
|
49
|
+
if (ObjectUtils.isEmpty(payload)) return;
|
|
50
|
+
acknowledgedFieldsRef.current.clear();
|
|
51
|
+
try {
|
|
52
|
+
await latestSaveRef.current.onSave(payload);
|
|
53
|
+
if (!active || revision !== resetRevisionRef.current) return;
|
|
54
|
+
for (const [path, value] of getChangedAutosaveFields(valuesAtSaveTime, previousSavedValues)) {
|
|
55
|
+
if (acknowledgedFieldsRef.current.has(path) && isEqual(acknowledgedFieldsRef.current.get(path), value)) continue;
|
|
56
|
+
savedSnapshotRef.current = setBy(savedSnapshotRef.current, path, value);
|
|
57
|
+
}
|
|
58
|
+
for (const name of Object.keys(form.state.fieldMeta)) {
|
|
59
|
+
const submittedValue = getBy(valuesAtSaveTime, name);
|
|
60
|
+
if (!isEqual(getBy(previousSavedValues, name), submittedValue) && isEqual(form.getFieldValue(name), submittedValue)) form.setFieldMeta(name, (meta) => ({
|
|
61
|
+
...meta,
|
|
62
|
+
isDirty: false
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
latestSaveRef.current.onSaveSuccess?.();
|
|
66
|
+
} catch {}
|
|
67
|
+
});
|
|
68
|
+
}, delay);
|
|
69
|
+
};
|
|
70
|
+
const unsubscribeStore = trigger === "change" ? form.store.subscribe(() => {
|
|
71
|
+
if (!isEqual(form.state.values, savedSnapshotRef.current)) queueSave();
|
|
72
|
+
}) : void 0;
|
|
73
|
+
const unsubscribeBlur = trigger === "blur" ? form.subscribeBlur(queueSave) : void 0;
|
|
74
|
+
const syncReset = (refresh) => {
|
|
75
|
+
if (refresh) {
|
|
76
|
+
for (const [path_0, value_0] of refresh.acknowledged) acknowledgedFieldsRef.current.set(path_0, value_0);
|
|
77
|
+
savedSnapshotRef.current = snapshot(refresh.baseline);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
resetRevisionRef.current = getFormResetVersion(form);
|
|
81
|
+
acknowledgedFieldsRef.current.clear();
|
|
82
|
+
clearPending();
|
|
83
|
+
savedSnapshotRef.current = snapshot(form.state.values);
|
|
84
|
+
};
|
|
85
|
+
if (resetRevisionRef.current !== getFormResetVersion(form)) syncReset();
|
|
86
|
+
const unsubscribeReset = subscribeFormReset(form, syncReset);
|
|
87
|
+
return () => {
|
|
88
|
+
active = false;
|
|
89
|
+
clearPending();
|
|
90
|
+
unsubscribeStore?.unsubscribe();
|
|
91
|
+
unsubscribeBlur?.();
|
|
92
|
+
unsubscribeReset();
|
|
93
|
+
};
|
|
94
|
+
}, [
|
|
95
|
+
delay,
|
|
96
|
+
enabled,
|
|
97
|
+
form,
|
|
98
|
+
trigger
|
|
99
|
+
]);
|
|
100
|
+
}
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region src/hooks/useFormAutosave.ts
|
|
103
|
+
const getResetTimeoutErrorMessage = (resetTimeout) => `Form Reset Timeout (${resetTimeout}ms) - Action Required
|
|
104
|
+
Problem: Form values weren't reset after submission.
|
|
105
|
+
|
|
106
|
+
Likely causes:
|
|
107
|
+
• Missing variables in reset dependency array
|
|
108
|
+
• Reset dependencies not updating after form save
|
|
109
|
+
• Async operations blocking timely reset
|
|
110
|
+
|
|
111
|
+
Solutions:
|
|
112
|
+
1. Ensure reset dependencies include all relevant state variables
|
|
113
|
+
2. Confirm your submission handler updates state properly (check query invalidation)
|
|
114
|
+
3. For slower operations, consider increasing the timeout threshold`;
|
|
115
|
+
/** Autosave schemas must produce objects preserving every raw field path, including optional fields. */
|
|
116
|
+
function useFormAutosave({ autosaveDelay, enableAutosave, autosaveOn = "change", normalizeAutosaveData, onAutosave, getResetValues, resetDeps, resetTimeout = 5e3, ...props }) {
|
|
117
|
+
const initialValues = getResetValues();
|
|
118
|
+
const form = useForm$1(...[{
|
|
119
|
+
...props,
|
|
120
|
+
defaultValues: typeof initialValues === "function" ? void 0 : initialValues
|
|
121
|
+
}]);
|
|
122
|
+
const serverBaselineRef = useRef(structuredClone(form.state.values));
|
|
123
|
+
const pendingRefreshesRef = useRef([]);
|
|
124
|
+
const resetFormValuesTimeoutRef = useRef(void 0);
|
|
125
|
+
useEffect(() => {
|
|
126
|
+
const clearRefreshes = () => {
|
|
127
|
+
pendingRefreshesRef.current = [];
|
|
128
|
+
if (resetFormValuesTimeoutRef.current) clearTimeout(resetFormValuesTimeoutRef.current);
|
|
129
|
+
};
|
|
130
|
+
const unsubscribe = subscribeFormReset(form, (refresh) => {
|
|
131
|
+
if (!refresh) {
|
|
132
|
+
serverBaselineRef.current = structuredClone(form.state.values);
|
|
133
|
+
clearRefreshes();
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
return () => {
|
|
137
|
+
unsubscribe();
|
|
138
|
+
clearRefreshes();
|
|
139
|
+
};
|
|
140
|
+
}, [form]);
|
|
141
|
+
useEffect(() => {
|
|
142
|
+
const resetValues = getResetValues();
|
|
143
|
+
if (resetValues === void 0) return;
|
|
144
|
+
let active = true;
|
|
145
|
+
const revision = getFormResetVersion(form);
|
|
146
|
+
const resetFormValues = async () => {
|
|
147
|
+
let values;
|
|
148
|
+
if (ObjectUtils.isFunction(resetValues)) values = await resetValues();
|
|
149
|
+
else values = resetValues;
|
|
150
|
+
if (!active || revision !== getFormResetVersion(form)) return;
|
|
151
|
+
const refreshedIndex = Math.max(0, pendingRefreshesRef.current.findLastIndex((pending) => pending.completed));
|
|
152
|
+
const submitted = pendingRefreshesRef.current[refreshedIndex];
|
|
153
|
+
pendingRefreshesRef.current.splice(0, refreshedIndex + 1);
|
|
154
|
+
const edits = getChangedAutosaveFields(form.state.values, submitted?.values ?? serverBaselineRef.current);
|
|
155
|
+
serverBaselineRef.current = structuredClone(values);
|
|
156
|
+
for (const pending_0 of pendingRefreshesRef.current) {
|
|
157
|
+
pending_0.values = structuredClone(values);
|
|
158
|
+
for (const [path, value] of pending_0.fields) pending_0.values = setBy(pending_0.values, path, value);
|
|
159
|
+
}
|
|
160
|
+
const applyRefresh = () => {
|
|
161
|
+
form.reset(values);
|
|
162
|
+
for (const [path_0, value_0] of edits) {
|
|
163
|
+
const name = path_0;
|
|
164
|
+
form.setFieldValue(name, value_0);
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
refreshAutosaveForm(form, values, applyRefresh, submitted?.fields);
|
|
168
|
+
if (pendingRefreshesRef.current.length === 0 && resetFormValuesTimeoutRef.current) clearTimeout(resetFormValuesTimeoutRef.current);
|
|
169
|
+
};
|
|
170
|
+
resetFormValues().catch((error) => logger.warn("Unable to refresh autosave form", error));
|
|
171
|
+
return () => {
|
|
172
|
+
active = false;
|
|
173
|
+
};
|
|
174
|
+
}, [...resetDeps]);
|
|
175
|
+
const prepareForSaveReset = () => {
|
|
176
|
+
if (resetFormValuesTimeoutRef.current) clearTimeout(resetFormValuesTimeoutRef.current);
|
|
177
|
+
resetFormValuesTimeoutRef.current = setTimeout(() => {
|
|
178
|
+
if (pendingRefreshesRef.current.length > 0) logger.warn(getResetTimeoutErrorMessage(resetTimeout));
|
|
179
|
+
}, resetTimeout);
|
|
180
|
+
};
|
|
181
|
+
useAutosave({
|
|
182
|
+
form,
|
|
183
|
+
delay: autosaveDelay,
|
|
184
|
+
enabled: enableAutosave,
|
|
185
|
+
trigger: autosaveOn,
|
|
186
|
+
onSave: useCallback(async (data) => {
|
|
187
|
+
const normalizedData = normalizeAutosaveData ? normalizeAutosaveData(data) : data;
|
|
188
|
+
if (!normalizedData || ObjectUtils.isEmpty(normalizedData)) return;
|
|
189
|
+
const values_0 = structuredClone(form.state.values);
|
|
190
|
+
const submitted_0 = {
|
|
191
|
+
values: values_0,
|
|
192
|
+
fields: getSubmittedAutosaveFields(normalizedData, values_0),
|
|
193
|
+
completed: false
|
|
194
|
+
};
|
|
195
|
+
pendingRefreshesRef.current.push(submitted_0);
|
|
196
|
+
prepareForSaveReset();
|
|
197
|
+
try {
|
|
198
|
+
const response = await onAutosave(normalizedData);
|
|
199
|
+
submitted_0.completed = true;
|
|
200
|
+
pendingRefreshesRef.current = pendingRefreshesRef.current.filter((pending_2) => !pending_2.completed || pending_2 === submitted_0);
|
|
201
|
+
return response;
|
|
202
|
+
} catch (error_0) {
|
|
203
|
+
pendingRefreshesRef.current = pendingRefreshesRef.current.filter((pending_1) => pending_1 !== submitted_0);
|
|
204
|
+
if (pendingRefreshesRef.current.length === 0 && resetFormValuesTimeoutRef.current) clearTimeout(resetFormValuesTimeoutRef.current);
|
|
205
|
+
throw error_0;
|
|
206
|
+
}
|
|
207
|
+
}, [
|
|
208
|
+
normalizeAutosaveData,
|
|
209
|
+
onAutosave,
|
|
210
|
+
resetTimeout
|
|
211
|
+
])
|
|
212
|
+
});
|
|
213
|
+
return form;
|
|
214
|
+
}
|
|
215
|
+
//#endregion
|
|
216
|
+
export { useAutosave as n, useFormAutosave as t };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { t as useBreakpoint } from "./useBreakpoint-CJ3mx7UF.js";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { useEffect, useRef } from "react";
|
|
4
|
+
//#region src/hooks/useScrollableListBox.ts
|
|
5
|
+
function useScrollableListBox() {
|
|
6
|
+
const $ = c(4);
|
|
7
|
+
const ref = useRef(null);
|
|
8
|
+
const isDesktop = useBreakpoint("md");
|
|
9
|
+
let t0;
|
|
10
|
+
let t1;
|
|
11
|
+
if ($[0] !== isDesktop) {
|
|
12
|
+
t0 = () => {
|
|
13
|
+
const node = ref.current;
|
|
14
|
+
if (!node || isDesktop) return;
|
|
15
|
+
const onPointerDownCapture = _temp;
|
|
16
|
+
const onClickCapture = _temp2;
|
|
17
|
+
node.addEventListener("pointerdown", onPointerDownCapture);
|
|
18
|
+
node.addEventListener("click", onClickCapture);
|
|
19
|
+
return () => {
|
|
20
|
+
node.removeEventListener("pointerdown", onPointerDownCapture);
|
|
21
|
+
node.removeEventListener("click", onClickCapture);
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
t1 = [ref, isDesktop];
|
|
25
|
+
$[0] = isDesktop;
|
|
26
|
+
$[1] = t0;
|
|
27
|
+
$[2] = t1;
|
|
28
|
+
} else {
|
|
29
|
+
t0 = $[1];
|
|
30
|
+
t1 = $[2];
|
|
31
|
+
}
|
|
32
|
+
useEffect(t0, t1);
|
|
33
|
+
let t2;
|
|
34
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
35
|
+
t2 = { ref };
|
|
36
|
+
$[3] = t2;
|
|
37
|
+
} else t2 = $[3];
|
|
38
|
+
return t2;
|
|
39
|
+
}
|
|
40
|
+
function _temp2(e_0) {
|
|
41
|
+
if (e_0.currentTarget?.contains(e_0.target) && e_0.target !== e_0.currentTarget) e_0.target.click();
|
|
42
|
+
}
|
|
43
|
+
function _temp(e) {
|
|
44
|
+
e.stopPropagation();
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { useScrollableListBox as t };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { useLayoutEffect, useRef } from "react";
|
|
2
|
+
import { useFocusRing as $32daac5f69beb98a$re_export$useFocusRing } from "react-aria/useFocusRing";
|
|
3
|
+
import "react-aria/FocusScope";
|
|
4
|
+
import "react-aria/private/interactions/focusSafely";
|
|
5
|
+
import "react-aria/private/utils/isFocusable";
|
|
6
|
+
import "react-aria/private/interactions/useFocusable";
|
|
7
|
+
import "react-aria/Focusable";
|
|
8
|
+
import { getFocusableTreeWalker as $32daac5f69beb98a$re_export$getFocusableTreeWalker } from "react-aria/private/focus/FocusScope";
|
|
9
|
+
import "react-aria/FocusRing";
|
|
10
|
+
import "react-aria/private/focus/useHasTabbableChild";
|
|
11
|
+
import "react-aria/private/focus/virtualFocus";
|
|
12
|
+
import "react-aria/useFocusable";
|
|
13
|
+
//#region src/components/inputs/shared/useStaticInputHandoff.ts
|
|
14
|
+
const useStaticInputHandoff = ({ inputRef, renderInput, setRenderInput, getFocusTarget, getPressTarget }) => {
|
|
15
|
+
const shouldFocusRef = useRef(false);
|
|
16
|
+
const pendingStaticChangeRef = useRef(null);
|
|
17
|
+
const pendingStaticFocusTargetRef = useRef(null);
|
|
18
|
+
const focusFromEndRef = useRef(false);
|
|
19
|
+
const shouldReplayStaticPressRef = useRef(false);
|
|
20
|
+
useLayoutEffect(() => {
|
|
21
|
+
if (!renderInput || !shouldFocusRef.current) return;
|
|
22
|
+
const input = inputRef.current;
|
|
23
|
+
if (!input) return;
|
|
24
|
+
const pendingValue = pendingStaticChangeRef.current;
|
|
25
|
+
const focusTarget = getFocusTarget?.(input, pendingStaticFocusTargetRef.current, focusFromEndRef.current) ?? (input instanceof HTMLElement ? getStaticInputFocusTarget(input, focusFromEndRef.current) : input);
|
|
26
|
+
const replayPress = shouldReplayStaticPressRef.current;
|
|
27
|
+
pendingStaticChangeRef.current = null;
|
|
28
|
+
pendingStaticFocusTargetRef.current = null;
|
|
29
|
+
shouldReplayStaticPressRef.current = false;
|
|
30
|
+
shouldFocusRef.current = false;
|
|
31
|
+
if (focusTarget instanceof HTMLInputElement && pendingValue != null) {
|
|
32
|
+
(Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")?.set)?.call(focusTarget, pendingValue);
|
|
33
|
+
focusTarget.dispatchEvent(new Event("input", { bubbles: true }));
|
|
34
|
+
}
|
|
35
|
+
focusTarget?.focus();
|
|
36
|
+
if (replayPress) (getPressTarget?.(input) ?? focusTarget)?.click();
|
|
37
|
+
}, [
|
|
38
|
+
getFocusTarget,
|
|
39
|
+
getPressTarget,
|
|
40
|
+
inputRef,
|
|
41
|
+
renderInput
|
|
42
|
+
]);
|
|
43
|
+
return {
|
|
44
|
+
renderRealInput: (focus, target, fromEnd = false) => {
|
|
45
|
+
if (!focus && shouldFocusRef.current) return;
|
|
46
|
+
focusFromEndRef.current = fromEnd;
|
|
47
|
+
pendingStaticFocusTargetRef.current = target ?? null;
|
|
48
|
+
shouldFocusRef.current = focus;
|
|
49
|
+
setRenderInput(true);
|
|
50
|
+
},
|
|
51
|
+
replayStaticInputChange: (value) => {
|
|
52
|
+
pendingStaticChangeRef.current = value;
|
|
53
|
+
shouldFocusRef.current = true;
|
|
54
|
+
setRenderInput(true);
|
|
55
|
+
},
|
|
56
|
+
replayStaticInputPress: () => {
|
|
57
|
+
shouldReplayStaticPressRef.current = true;
|
|
58
|
+
shouldFocusRef.current = true;
|
|
59
|
+
setRenderInput(true);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
const getStaticInputFocusTarget = (container, fromEnd = false) => {
|
|
64
|
+
const walker = $32daac5f69beb98a$re_export$getFocusableTreeWalker(container, { tabbable: true });
|
|
65
|
+
let target = walker.nextNode();
|
|
66
|
+
if (fromEnd) {
|
|
67
|
+
let next = walker.nextNode();
|
|
68
|
+
while (next) {
|
|
69
|
+
target = next;
|
|
70
|
+
next = walker.nextNode();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return target ?? container;
|
|
74
|
+
};
|
|
75
|
+
//#endregion
|
|
76
|
+
export { useStaticInputHandoff as n, $32daac5f69beb98a$re_export$useFocusRing as r, getStaticInputFocusTarget as t };
|