@povio/ui 6.0.0-rc.12 → 6.0.0-rc.14
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/README.md +523 -42
- package/dist/{Accordion-ORBin0EZ.js → Accordion-BNHpv7Zj.js} +42 -42
- package/dist/{Accordion-Cup5eRZz.d.ts → Accordion-CR9oomZY.d.ts} +29 -17
- package/dist/Alert-xHGPLUpt.d.ts +36 -0
- package/dist/AlertDialog-CKcUZ6l9.d.ts +70 -0
- package/dist/Autocomplete-CkWTSFoj.d.ts +123 -0
- package/dist/Autocomplete-CrNDRxvg.js +319 -0
- package/dist/Badge-B25YEMEw.d.ts +67 -0
- package/dist/BottomSheet-CtcPZG82.d.ts +65 -0
- package/dist/{BottomSheet-CGipksM_.js → BottomSheet-tUXH3NjS.js} +9 -9
- package/dist/{BottomSheet.lazy-CuJMUeJP.d.ts → BottomSheet.lazy-DuwAJSaI.d.ts} +1 -1
- package/dist/{Breadcrumbs-CcB0oOF8.d.ts → Breadcrumbs-BrtRh_dX.d.ts} +6 -3
- package/dist/{Breadcrumbs-a1-q_he0.js → Breadcrumbs-D8WXqOLN.js} +36 -20
- package/dist/{Button-BaODzvZd.js → Button-C1Jv1Plk.js} +1 -1
- package/dist/{Button-0SswSdDg.d.ts → Button-DDuk3hJ3.d.ts} +2 -2
- package/dist/{Button-C1YB5dOw.js → Button-DF6sbTuF.js} +3 -7
- package/dist/{ButtonBase-s-VV7oCa.js → ButtonBase-BYJz1JkH.js} +12 -20
- package/dist/ButtonBase-Bn_FT89h.d.ts +47 -0
- package/dist/{ButtonContent-Dztbuz3q.js → ButtonContent-2KsbdWRO.js} +5 -5
- package/dist/{Calendar-yaQubCWK.js → Calendar-DdneUEhM.js} +71 -35
- package/dist/{Calendar.lazy-DcVss9Bk.js → Calendar.lazy-BY0kLoYH.js} +7 -7
- package/dist/Checkbox-Bwl6MA-V.d.ts +49 -0
- package/dist/{Checkbox-Bjsbx-wK.js → Checkbox-E2bns_n0.js} +40 -14
- package/dist/CheckboxCheckmark-Beu8T1g9.js +42 -0
- package/dist/CheckboxGroup-0rzsn-bA.d.ts +52 -0
- package/dist/{CheckboxGroup-B3O3IUiu.js → CheckboxGroup-C7epIEpW.js} +75 -35
- package/dist/ColumnConfigContent-LNq-6Brf.js +1025 -0
- package/dist/ColumnListContent-Dzze5R7T.js +133 -0
- package/dist/DatePicker-B70SCKfT.d.ts +80 -0
- package/dist/{DatePicker-bme8zGBo.js → DatePicker-BU-34fCk.js} +117 -46
- package/dist/{DatePickerInput-vLlL5ATh.d.ts → DatePickerInput-BCuz08Ws.d.ts} +3 -3
- package/dist/{DatePickerInput-C2881tvS.js → DatePickerInput-CMEJmZSQ.js} +41 -30
- package/dist/{DateRangePicker-Blg158JD.js → DateRangePicker-D0RtqeBM.js} +90 -162
- package/dist/DateRangePicker-jovxcWGk.d.ts +102 -0
- package/dist/{DateTimePicker-CdRFt8WM.js → DateTimePicker-Cbdt76CL.js} +94 -40
- package/dist/DateTimePicker-Cfi3ruFy.d.ts +83 -0
- package/dist/Dialog-BWNQjIgo.d.ts +66 -0
- package/dist/{Dialog-C9H9_BmK.js → Dialog-Bpwr1nuy.js} +15 -15
- package/dist/{Dialog-DN5703sy.js → Dialog-ebjPH22i.js} +23 -19
- package/dist/{Disclosure-BRSkMbZQ.js → Disclosure-D_aym2zh.js} +3 -3
- package/dist/Drawer-o018RqIt.d.ts +42 -0
- package/dist/DropdownMenu-3V-G7fZ7.d.ts +51 -0
- package/dist/{DropdownMenu-DS0RaEfH.js → DropdownMenu-C4WitobV.js} +33 -21
- package/dist/{DropdownMenuDesktop-DGPIfex-.js → DropdownMenuDesktop-BM7659Sk.js} +14 -8
- package/dist/{FileInput-BUwtAF2-.js → FileInput-Bc_E1M1X.js} +76 -81
- package/dist/FileInput-CWRW7OzZ.d.ts +61 -0
- package/dist/{FileTrigger-DlryDp2T.js → FileTrigger-tGSUFrb2.js} +6 -6
- package/dist/FileUpload-DVnp9xxv.d.ts +181 -0
- package/dist/FileUpload-Dk6ZmgWF.js +1105 -0
- package/dist/{Form-CqF1SaVw.js → Form-4jZarkjk.js} +2 -2
- package/dist/FormField-BgiWLGjf.d.ts +70 -0
- package/dist/{FormField-dduTMkNH.js → FormField-DOZ7eXjA.js} +11 -11
- package/dist/{FormFieldError-BT4uxbKY.d.ts → FormFieldError-C7yOdjzQ.d.ts} +1 -0
- package/dist/FormFieldHeaderTooltip-DW9sqJWl.js +22 -0
- package/dist/{Heading-D4XFYv__.js → Heading-B9G3z6Es.js} +2 -2
- package/dist/HiddenFormValue-DZ2d9eoA.js +20 -0
- package/dist/IconButton-Bjjf5cQL.d.ts +24 -0
- package/dist/{IconSlot-CqNuZl0E.js → IconSlot-TAWTJ6iK.js} +2 -4
- package/dist/{InlineTooltipWrapper-CKTiFpZn.js → InlineTooltipWrapper-CcdpMJa6.js} +1 -1
- package/dist/{Input-BG0Xjw5X.js → Input-BkR3jkvt.js} +2 -2
- package/dist/{Input-CG5LQ0zs.js → Input-CvYyjMWx.js} +95 -60
- package/dist/Input-lppNS8wM.d.ts +56 -0
- package/dist/{InputContent-Fx2E4UXl.js → InputContent-B5YjsLDE.js} +15 -13
- package/dist/InputContent-Bgalf6R1.d.ts +39 -0
- package/dist/{Label-BGvF9vWx.js → Label-VTcaaLO8.js} +2 -2
- package/dist/{Link-Chux-Clm.js → Link-8zP_NC_c.js} +2 -2
- package/dist/Link-HJ4y-xiW.d.ts +15 -0
- package/dist/{ListBox-DhR5kojP.js → ListBox-Ck-B1Jae.js} +9 -9
- package/dist/{Modal-DcLWF9cB.js → Modal-xT-Wz5GH.js} +3 -3
- package/dist/{NumberField-DxuikBcr.js → NumberField-BXLzNb2T.js} +92 -63
- package/dist/NumberField-Q-4y3jpb.d.ts +41 -0
- package/dist/{NumberFormatter-DYarfm5F.js → NumberFormatter-D5csbNXm.js} +1 -1
- package/dist/{NumberRangeInput-8bOjNEnS.js → NumberRangeInput-BBzZCC54.js} +153 -102
- package/dist/NumberRangeInput-DuWOdSdU.d.ts +89 -0
- package/dist/{OverlayArrow-DF0jMwul.js → OverlayArrow-BptI-A_7.js} +2 -2
- package/dist/{PageHeader-DTfzf-dA.d.ts → PageHeader-jVaC3Z9L.d.ts} +6 -5
- package/dist/PasswordInput-DtTnGHRD.d.ts +16 -0
- package/dist/{PasswordInput.bound-Dfq5c3JQ.js → PasswordInput-U0QhNsMp.js} +6 -6
- package/dist/Popover-ClCEOP3e.d.ts +51 -0
- package/dist/Progress-DlXY0dv_.js +180 -0
- package/dist/Progress-VkkXbIh7.d.ts +26 -0
- package/dist/ProgressBar-mpNpV7ow.js +46 -0
- package/dist/{RadioGroup-IL4Y8XHO.js → RadioGroup-BPPJyA1s.js} +72 -32
- package/dist/RadioGroup-BbcrP56w.d.ts +52 -0
- package/dist/{RangeCalendar-DT63UD8K.js → RangeCalendar-DIVjIl0T.js} +12 -10
- package/dist/Select-D1qIWZCv.d.ts +248 -0
- package/dist/{Select-BM8PNrjC.js → Select-DlbVDCz8.js} +452 -191
- package/dist/{SelectListBox-BFSZxDSi.js → SelectListBox-CCr5YY86.js} +55 -43
- package/dist/{SelectionIndicator-C3hniBa2.js → SelectionIndicator-CvuKjZRP.js} +3 -3
- package/dist/{SharedElementTransition-CZ2bE7yo.js → SharedElementTransition-BkyYit3Q.js} +2 -2
- package/dist/{SidebarWorkspaces-DJknAfS9.js → SidebarWorkspaces-CIpFJGOa.js} +283 -366
- package/dist/{SidebarWorkspaces-DDHJAdNH.d.ts → SidebarWorkspaces-DcwA_jv7.d.ts} +31 -17
- package/dist/Slider-CLViwkE1.d.ts +57 -0
- package/dist/{Slider-DCsCCPFx.js → Slider-_RsgBJcg.js} +72 -15
- package/dist/Spinner-GMEauCHv.d.ts +13 -0
- package/dist/SplitButton-BdP4xjFQ.d.ts +25 -0
- package/dist/{Stepper-Dyhxp0Tl.js → Stepper-D4z7JNsD.js} +116 -88
- package/dist/Stepper-DBb0qfla.d.ts +49 -0
- package/dist/{Switch-BfpSMMpv.js → Switch-Bi3_bUw1.js} +56 -14
- package/dist/Switch-DCxONL2Q.d.ts +42 -0
- package/dist/TableDnd-CG1yOlxh.js +238 -0
- package/dist/TableDragHandle-CXApnuUm.js +51 -0
- package/dist/{TabsFilters-DybNturW.js → TabsFilters-BPogry73.js} +46 -35
- package/dist/TabsFilters-CPfGBODw.d.ts +59 -0
- package/dist/Tag-xhcJOv_X.d.ts +26 -0
- package/dist/{Text-D72yc4S6.js → Text-D7Nqkw1l.js} +1 -1
- package/dist/TextArea-BYX9Kk_v.d.ts +33 -0
- package/dist/{TextArea-Blsip3ZC.js → TextArea-CuJS3-Nv.js} +62 -35
- package/dist/{TimePicker-4hV5zbgd.js → TimePicker-ByfjqkLp.js} +120 -56
- package/dist/TimePicker-UTo9C6gz.d.ts +64 -0
- package/dist/TimePickerForm-CaIHR0PV.js +532 -0
- package/dist/{ToastContainer-Dd0LPykL.js → ToastContainer-tr7Zxahc.js} +4 -4
- package/dist/{ToggleButton-HUZ8ij6i.d.ts → ToggleButton-BX8o7ECO.d.ts} +2 -2
- package/dist/{ToggleButton-P1z1pxzT.js → ToggleButton-D8BT67FO.js} +5 -5
- package/dist/ToggleGroup-18c-FZ_r.js +500 -0
- package/dist/ToggleGroup-UazUtgU1.d.ts +95 -0
- package/dist/{Tooltip-DRB6lo0U.js → Tooltip-Dl3sf8fq.js} +5 -5
- package/dist/Tooltip-FcJ29dhq.d.ts +33 -0
- package/dist/TooltipEllipsis-7QF00kXk.d.ts +21 -0
- package/dist/{TooltipWrapper-BSY31JMc.js → TooltipWrapper-bvNpM6ku.js} +6 -6
- package/dist/{Typography-DJojwiXV.d.ts → Typography-auHWN282.d.ts} +5 -1
- package/dist/{badgeButton.cva-t5PQOH4M.js → badge.cva-C9mE8CMf.js} +23 -24
- package/dist/{button.cva-Ciga0rdG.js → button.cva-C2aoXMh-.js} +10 -16
- package/dist/{buttonContent.cva-BapnODby.d.ts → buttonContent.cva-CeGnrjoA.d.ts} +2 -2
- package/dist/calendarHeader.cva-D3sXR7ox.js +23 -0
- package/dist/{checkbox.cva-aLJS7v4z.js → checkbox.cva-qU_q0lSX.js} +14 -14
- package/dist/columnConfig.cva-CERwSZRN.js +29 -0
- package/dist/components/accordion.d.ts +1 -1
- package/dist/components/accordion.js +1 -1
- package/dist/components/alert-dialog.d.ts +2 -2
- package/dist/components/alert-dialog.js +174 -128
- package/dist/components/alert.d.ts +1 -1
- package/dist/components/alert.js +17 -15
- package/dist/components/autocomplete.d.ts +2 -2
- package/dist/components/autocomplete.js +1 -1
- package/dist/components/badge.d.ts +2 -2
- package/dist/components/badge.js +166 -81
- package/dist/components/bottom-sheet-header.d.ts +1 -1
- package/dist/components/bottom-sheet-header.js +25 -21
- package/dist/components/bottom-sheet.d.ts +2 -2
- package/dist/components/bottom-sheet.js +2 -2
- package/dist/components/breadcrumbs.d.ts +1 -1
- package/dist/components/breadcrumbs.js +1 -1
- 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 -1
- package/dist/components/checkbox.d.ts +2 -2
- package/dist/components/checkbox.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.d.ts +4 -41
- package/dist/components/date-range-picker.js +4 -2
- package/dist/components/date-range-presets.d.ts +2 -0
- package/dist/components/date-range-presets.js +3 -0
- package/dist/components/date-time-picker.d.ts +2 -2
- package/dist/components/date-time-picker.js +1 -1
- package/dist/components/dialog.d.ts +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/drawer.d.ts +1 -1
- package/dist/components/drawer.js +16 -80
- package/dist/components/dropdown-menu.d.ts +2 -3
- package/dist/components/dropdown-menu.js +2 -3
- package/dist/components/file-input.d.ts +2 -2
- package/dist/components/file-input.js +1 -1
- package/dist/components/file-upload.d.ts +2 -3
- package/dist/components/file-upload.js +1 -1
- package/dist/components/form-field.d.ts +3 -2
- package/dist/components/form-field.js +1 -1
- package/dist/components/icon-button.d.ts +1 -1
- package/dist/components/icon-button.js +22 -25
- package/dist/components/icon-slot.d.ts +1 -2
- package/dist/components/icon-slot.js +2 -2
- package/dist/components/input-frame.d.ts +6 -10
- package/dist/components/input-frame.js +31 -28
- package/dist/components/input.d.ts +2 -2
- package/dist/components/input.js +2 -2
- package/dist/components/link.d.ts +1 -1
- package/dist/components/link.js +2 -2
- package/dist/components/number-field.d.ts +2 -2
- package/dist/components/number-field.js +2 -2
- 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 +1 -1
- package/dist/components/page-header.js +5 -5
- package/dist/components/password-input.d.ts +2 -2
- package/dist/components/password-input.js +1 -22
- package/dist/components/popover.d.ts +1 -1
- package/dist/components/popover.js +105 -87
- package/dist/components/progress.d.ts +2 -2
- 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.d.ts +2 -2
- package/dist/components/select.js +1 -1
- package/dist/components/sidebar.d.ts +1 -1
- package/dist/components/sidebar.js +1 -1
- 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 +71 -1
- package/dist/components/split-button.d.ts +1 -1
- package/dist/components/split-button.js +15 -4
- package/dist/components/stepper.d.ts +1 -1
- package/dist/components/stepper.js +1 -1
- package/dist/components/style-definitions.d.ts +3 -3
- package/dist/components/style-definitions.js +62 -20
- package/dist/components/switch.d.ts +2 -2
- package/dist/components/switch.js +1 -1
- package/dist/components/tabs-filters.d.ts +1 -1
- package/dist/components/tabs-filters.js +1 -1
- package/dist/components/tag.d.ts +1 -1
- package/dist/components/tag.js +50 -64
- 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 +3 -3
- package/dist/components/toast.js +4 -3
- package/dist/components/toggle-button.d.ts +1 -1
- package/dist/components/toggle-button.js +1 -1
- package/dist/components/toggle-group.d.ts +2 -2
- package/dist/components/toggle-group.js +1 -1
- package/dist/components/tooltip-ellipsis.d.ts +1 -1
- package/dist/components/tooltip-ellipsis.js +1 -1
- 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/use-toast.d.ts +2 -2
- package/dist/components/use-toast.js +1 -41
- package/dist/config/component-configuration.d.ts +2 -2
- package/dist/config/component-configuration.js +53 -2
- package/dist/config/confirmation.d.ts +1 -1
- package/dist/config/confirmation.js +1 -1
- package/dist/config/link-context.d.ts +3 -3
- 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/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-router.d.ts +1 -1
- package/dist/config/ui-router.js +1 -1
- package/dist/confirmation.context-C_-uADGJ.js +93 -0
- package/dist/confirmation.context-DkWyR2aT.d.ts +32 -0
- package/dist/{datePickerInput.cva-Du0Zn04v.js → datePickerInput.cva-CWkV2fut.js} +1 -1
- package/dist/dateRangePreset.utils-Bnb-rjTt.js +116 -0
- package/dist/{dialog.cva-BIpz6HcA.js → dialog.cva-BjVggO5l.js} +1 -1
- package/dist/{dist-DEZzXa0W.js → dist-CP6vV22I.js} +68 -39
- package/dist/{dom.utils-BPooTXtC.js → dom.utils-CqejLWIQ.js} +1 -1
- package/dist/{dropdownMenu.cva-DwSOcbmR.js → dropdownMenu.cva-BopsvbOy.js} +19 -7
- package/dist/{exports-BNrTn8Tj.js → exports-DeBGRThC.js} +3 -3
- package/dist/{file.utils-Crb-mIHs.d.ts → file.utils-DUADtzdt.d.ts} +3 -3
- package/dist/{file.utils-DqQxnuAm.js → file.utils-X6tkeWaz.js} +2 -6
- package/dist/fileInputButton.cva-gbqRUf1g.js +39 -0
- package/dist/{fileUpload.cva-BYzXGc9C.js → fileUpload.cva-SrF6v406.js} +3 -3
- package/dist/form-field-C735uXsi.d.ts +1 -0
- package/dist/form.binding-Brdjq2yr.js +161 -0
- package/dist/form.binding-DSXB2AOD.d.ts +127 -0
- package/dist/form.types-a2WVJDQX.d.ts +43 -0
- package/dist/formReset-CnZl_yze.js +35 -0
- package/dist/hints-B09_WDhL.d.ts +17 -0
- package/dist/hooks/use-async-list.d.ts +1 -1
- package/dist/hooks/use-async-list.js +1 -1
- package/dist/hooks/use-breakpoint.d.ts +3 -0
- package/dist/hooks/use-breakpoint.js +2 -0
- package/dist/hooks/use-filters.d.ts +2 -2
- package/dist/hooks/use-filters.js +1 -1
- package/dist/{i18n-D8vXIoiq.js → i18n-DaIHnR2n.js} +123 -9
- package/dist/{i18n-DM-PUcxQ.d.ts → i18n-xXkHgzet.d.ts} +124 -4
- package/dist/iconSlot.cva-DyhOI7EK.js +5 -0
- package/dist/{import-C7W0Wv2r.js → import-Cz8NlFqm.js} +40 -16
- package/dist/index.d.ts +66 -84
- package/dist/index.js +57 -92
- package/dist/{input.cva-DZii82eS.js → input.cva-mm1dnfKP.js} +27 -23
- package/dist/inputLayout-CIVpuUBq.js +7 -0
- package/dist/inputRow.clsx-BbcaXVta.js +6 -0
- package/dist/{intlStrings-Cu1YN1tA.js → intlStrings-ClpdCJmU.js} +35 -35
- package/dist/{isEqual-LFw0W5rU.js → isEqual-BdJdNr5O.js} +1 -1
- package/dist/{label.cva-DTfT6FrX.js → label.cva-DJ5Dmbz5.js} +7 -7
- package/dist/link.context-BxVK2yQ5.d.ts +20 -0
- package/dist/{link.context-TPjDtjw3.js → link.context-CD5h_b5O.js} +12 -11
- package/dist/link.cva-ZhpQz3P0.d.ts +2277 -0
- package/dist/{progress.cva-CsGaGVJ-.js → progress.cva-mkJxrrac.js} +2 -2
- package/dist/{radio.cva-DistaZtZ.js → radio.cva-Dt5N2ul2.js} +7 -7
- package/dist/rich-text-editor.d.ts +44 -2
- package/dist/rich-text-editor.js +733 -1
- package/dist/router.context-B6j_M4cN.js +151 -0
- package/dist/router.context-CSd9JYQ4.d.ts +33 -0
- package/dist/{selectDesktop.cva-DStkOdwm.js → selectDesktop.cva-30JAvtgB.js} +1 -1
- package/dist/{selectItem.cva-B6vxey2R.js → selectItem.cva-DsOZSSPx.js} +2 -1
- package/dist/sidebar.cva-BgxTCejU.js +150 -0
- package/dist/spinner.cva-j4kGmIWC.js +17 -0
- package/dist/{staticDateTimeSegments-CVuAhDDl.js → staticDateTimeSegments-BgUrcqXD.js} +379 -94
- package/dist/{status.cva-CYgi3Htz.js → status.cva-WLEqUAjH.js} +9 -9
- package/dist/styles/input.d.ts +1 -1
- package/dist/{table.cva-DkcsOmZG.js → table.cva-n9TO_vu1.js} +68 -17
- package/dist/tableCells.cva-Br0_kgRM.js +18 -0
- package/dist/tableColumnConfigStorage-Cciq8gVe.js +215 -0
- package/dist/tableVirtualStore-whSmFzTV.js +67 -0
- package/dist/tanstack/form.d.ts +3 -3
- package/dist/tanstack/form.js +3 -3
- package/dist/tanstack/table-context.d.ts +2 -0
- package/dist/tanstack/table-context.js +2 -0
- package/dist/tanstack/table-types.d.ts +55 -0
- package/dist/tanstack/table.d.ts +5 -3
- package/dist/tanstack/table.js +3 -2
- package/dist/tanstack-JB8VmS9j.js +73 -0
- package/dist/tanstack-cQOW9-Q2.d.ts +165 -0
- package/dist/tanstack-table-DdWYwCZM.d.ts +858 -0
- package/dist/tanstack-table-M1M26UQJ.js +5299 -0
- package/dist/tanstack.d.ts +66 -84
- package/dist/tanstack.js +57 -92
- package/dist/{toast.cva-B6NXTwbZ.js → toast.cva-DusQwZw-.js} +13 -9
- package/dist/toast.runtime-ZN5q4T9X.js +25 -0
- package/dist/{toggleGroup.cva-CJ-3Ps7j.js → toggleGroup.cva-CvNS5QO1.js} +2 -2
- package/dist/{uiConfig.context-3DN9w6oU.js → uiConfig.context-NWmBJ2Hc.js} +72 -10
- package/dist/uiConfig.context-ykH4E2js.d.ts +19 -0
- package/dist/uiConfig.types-BsyPKepP.d.ts +291 -0
- package/dist/{uiOverrides.context-DHHzLSnq.d.ts → uiOverrides.context-C5Maic5Q.d.ts} +106 -0
- package/dist/{useAsyncList-Ct74ve3i.js → useAsyncList-DkIjhlce.js} +142 -37
- package/dist/useAsyncList-F-328rtE.d.ts +25 -0
- package/dist/useAutoFocus-K-bfNxa2.js +16 -0
- package/dist/useBreakpoint-BPrZNuNl.d.ts +9 -0
- package/dist/{useBreakpoint-CJ3mx7UF.js → useBreakpoint-DtYSRweq.js} +6 -2
- package/dist/{useControlledState-CuU1VIh1.js → useControlledState-C1-Mt2i0.js} +1 -1
- package/dist/useDebounceCallback-C7YKfjXW.js +96 -0
- package/dist/useFilters-CybBXUAA.js +217 -0
- package/dist/useFilters-DrfBFNLw.d.ts +57 -0
- package/dist/useFormAutosave-BzCGqFqi.js +419 -0
- package/dist/{useFormAutosave-BBLm3Ujo.d.ts → useFormAutosave-ClMnzVE7.d.ts} +1 -1
- package/dist/{useIntersectionObserver-DFAhTsV0.js → useIntersectionObserver-B8msnQTR.js} +15 -3
- package/dist/{numberStatic.utils-BIyZuILs.js → useLiveNumberFieldState-npiqOvyB.js} +107 -6
- package/dist/useRemoveButton-zhlA1Pbc.js +98 -0
- package/dist/useResolveDateRangePreset-DOSzJR-N.d.ts +64 -0
- package/dist/useResolveDateRangePreset-k_h_XJBG.js +26 -0
- package/dist/{useScrollableListBox-oYKqU3Hp.js → useScrollableListBox-4pieApqz.js} +1 -1
- package/dist/{useStaticInputHandoff-BN0fOerH.js → useStaticInputHandoff-DrNFrvD7.js} +6 -1
- package/dist/useTableVirtualizer-sFInQiH-.d.ts +162 -0
- package/dist/useToast-BHqkSByv.d.ts +78 -0
- package/dist/useToast-DgqC6Ta_.js +63 -0
- package/dist/utils/file.d.ts +1 -1
- package/dist/utils/file.js +1 -1
- package/dist/{utils-BkLF-JA3.js → utils-Q5Oc6oX2.js} +1 -1
- package/llms.txt +3201 -0
- package/package.json +22 -118
- package/MIGRATION.md +0 -655
- package/dist/Alert-D4X7OWiv.d.ts +0 -34
- package/dist/AlertDialog-DklLDjmw.d.ts +0 -26
- package/dist/Autocomplete-BgFz3kuR.d.ts +0 -23
- package/dist/Autocomplete-Bn13u0zu.js +0 -145
- package/dist/Autocomplete.bound-CpHZZ3C9.d.ts +0 -9
- package/dist/Autocomplete.bound-Dwh__y-Z.js +0 -28
- package/dist/Badge-Db1ndK67.d.ts +0 -30
- package/dist/BadgeButton-BPhWDAnc.d.ts +0 -15
- package/dist/BottomSheet-BZmDJBR-.d.ts +0 -33
- package/dist/ButtonBase-CZuEy3Pk.d.ts +0 -32
- package/dist/Checkbox-w2j5hLOQ.d.ts +0 -27
- package/dist/Checkbox.bound-D2nBglJz.js +0 -33
- package/dist/Checkbox.bound-DD_RCjVm.d.ts +0 -9
- package/dist/CheckboxCheckmark-DWsYVZuu.js +0 -25
- package/dist/CheckboxGroup-BYI15Y09.d.ts +0 -30
- package/dist/CheckboxGroup.bound-DY0HKGSh.js +0 -32
- package/dist/CheckboxGroup.bound-QiJ-P0KR.d.ts +0 -9
- package/dist/ComboBox-ChsdI0lt.js +0 -212
- package/dist/DatePicker-QzfQf21b.d.ts +0 -56
- package/dist/DatePicker.bound-DoCAqhM4.d.ts +0 -9
- package/dist/DatePicker.bound-M2cjR37s.js +0 -36
- package/dist/DateRangePicker-32D4pWJg.d.ts +0 -97
- package/dist/DateRangePicker.bound-CVtoVsho.d.ts +0 -9
- package/dist/DateRangePicker.bound-CkIDsAUf.js +0 -35
- package/dist/DateTimePicker-BTRIUagV.d.ts +0 -55
- package/dist/DateTimePicker.bound-X4DTyQ1b.d.ts +0 -9
- package/dist/DateTimePicker.bound-nSCVUqd0.js +0 -32
- package/dist/Dialog-CO9xljD3.d.ts +0 -21
- package/dist/Drawer-D1cHiBFO.d.ts +0 -18
- package/dist/DropdownMenu-D_9z9ond.d.ts +0 -25
- package/dist/FileInput-BEaECoBS.d.ts +0 -75
- package/dist/FileInput.bound-C12mOKpg.js +0 -30
- package/dist/FileInput.bound-D2HuuqSb.d.ts +0 -8
- package/dist/FileUpload-BUTSqHVk.d.ts +0 -11
- package/dist/FileUpload-D7FMYm-k.js +0 -749
- package/dist/FileUpload.bound-CGQXb4iT.d.ts +0 -16
- package/dist/FileUpload.bound-DmkuulOi.js +0 -30
- package/dist/FileUploadContainer-Dzg5aXXZ.d.ts +0 -5
- package/dist/FormField-DGyCDxOp.d.ts +0 -42
- package/dist/FormFieldHeaderTooltip-Dt-g40Tc.js +0 -17
- package/dist/IconButton-shH_9wcl.d.ts +0 -25
- package/dist/Input-CTp_9mS9.d.ts +0 -34
- package/dist/Input.bound-B9a62ylL.d.ts +0 -9
- package/dist/Input.bound-DYoXyRGy.js +0 -31
- package/dist/InputContent-BCNkN4Fx.d.ts +0 -27
- package/dist/Link-PvYB_M-j.d.ts +0 -30
- package/dist/MenuItem-U3-pu1j5.d.ts +0 -6
- package/dist/NumberField-WXebfxjK.d.ts +0 -34
- package/dist/NumberField.bound-ChJnNyJS.js +0 -32
- package/dist/NumberField.bound-Dy0A5iVc.d.ts +0 -9
- package/dist/NumberRangeInput-BCKQaGpy.d.ts +0 -50
- package/dist/NumberRangeInput.bound-BF6P_ega.js +0 -32
- package/dist/NumberRangeInput.bound-BNXxIQ0b.d.ts +0 -9
- package/dist/PasswordInput-EhQjYyJS.d.ts +0 -11
- package/dist/PasswordInput.bound-CK5GwKL4.d.ts +0 -9
- package/dist/Popover-D_t1XDPA.d.ts +0 -20
- package/dist/Progress-Ckfpi_-M.d.ts +0 -45
- package/dist/Progress-RiEGGxNG.js +0 -119
- package/dist/RadioGroup-6e-Z6jW8.d.ts +0 -26
- package/dist/RadioGroup.bound-BFWSq-on.js +0 -32
- package/dist/RadioGroup.bound-w3SZqSkH.d.ts +0 -9
- package/dist/RichTextEditor-DHhuBeT6.d.ts +0 -28
- package/dist/RichTextEditor-DfwVdm45.js +0 -651
- package/dist/Select-C34ENdjq.d.ts +0 -119
- package/dist/Select.bound--Az1Xwgm.js +0 -34
- package/dist/Select.bound-qOihchei.d.ts +0 -17
- package/dist/Slider-DRg8zKRM.d.ts +0 -23
- package/dist/Slider.bound-CByTXPTr.js +0 -31
- package/dist/Slider.bound-CaEF19um.d.ts +0 -9
- package/dist/Spinner-Cvy_6zgD.d.ts +0 -30
- package/dist/Spinner-DqjP06T1.js +0 -101
- package/dist/SplitButton-V1f2NWfh.d.ts +0 -15
- package/dist/Stepper-k91x_m-E.d.ts +0 -114
- package/dist/Switch-ELVPkPx0.d.ts +0 -24
- package/dist/Switch.bound-DeEdVvZV.d.ts +0 -9
- package/dist/Switch.bound-Dv0cHsMM.js +0 -33
- package/dist/TableDnd-CuHxANWh.js +0 -133
- package/dist/TableRowDetails-D8HFTghI.d.ts +0 -109
- package/dist/TabsFilters-DePddjCk.d.ts +0 -30
- package/dist/Tag-B2_ZiSE-.d.ts +0 -44
- package/dist/TextArea-iqUeB2QY.d.ts +0 -26
- package/dist/TextArea.bound-BJHyCogp.d.ts +0 -9
- package/dist/TextArea.bound-DeaskY6r.js +0 -28
- package/dist/TimePicker-BZ1ocsBX.d.ts +0 -45
- package/dist/TimePicker.bound-8DmjMXuE.d.ts +0 -9
- package/dist/TimePicker.bound-BFSXJvE_.js +0 -32
- package/dist/TimePickerForm-DD9VA_td.js +0 -225
- package/dist/Toast-D9pdadZ4.d.ts +0 -16
- package/dist/ToggleGroup-CrDoeLN0.js +0 -333
- package/dist/ToggleGroup-DvjnSinl.d.ts +0 -42
- package/dist/ToggleGroup.bound-B03ISHQ8.d.ts +0 -9
- package/dist/ToggleGroup.bound-DCnYwmBt.js +0 -67
- package/dist/Tooltip-B8DTURLQ.d.ts +0 -16
- package/dist/TooltipEllipsis-Di9Dvd4x.d.ts +0 -11
- package/dist/badgeButton.cva-CBFIhr1S.d.ts +0 -41
- package/dist/button.cva-C8LGtNJ3.d.ts +0 -94
- package/dist/checkbox.cva-CCh_UlrC.d.ts +0 -76
- package/dist/components/badge-button.d.ts +0 -2
- package/dist/components/badge-button.js +0 -74
- package/dist/components/file-upload-container.d.ts +0 -3
- package/dist/components/file-upload-container.js +0 -15
- package/dist/confirmation.context-Bc2yEVp_.js +0 -114
- package/dist/confirmation.context-C_GDRn3a.d.ts +0 -23
- package/dist/fileUpload.types-C-ke21yY.d.ts +0 -110
- package/dist/form.binding-DOR5gIQf.js +0 -49
- package/dist/form.types-C8P4sznq.d.ts +0 -22
- package/dist/formFieldHelper.cva-DRmSyRZN.js +0 -14
- package/dist/iconSlot.cva-CLB5Tlsr.d.ts +0 -9
- package/dist/icons.d.ts +0 -4
- package/dist/icons.js +0 -3
- package/dist/input.cva-BjuHsDGy.d.ts +0 -80
- package/dist/inputLayout-KdAtunGk.js +0 -5
- package/dist/link.context-BCHn7NSy.d.ts +0 -12
- package/dist/radio.cva-D7M1hqLe.d.ts +0 -56
- package/dist/router.context-CtafjXV7.d.ts +0 -16
- package/dist/router.context-MckTbHw9.js +0 -63
- package/dist/routing.utils-DfxEt0_Y.js +0 -30
- package/dist/style-definitions-Dx6aFDiR.d.ts +0 -1038
- package/dist/switch.cva-r6vcS25Q.d.ts +0 -16
- package/dist/tanstack/autocomplete.d.ts +0 -3
- package/dist/tanstack/autocomplete.js +0 -2
- package/dist/tanstack/checkbox-group.d.ts +0 -3
- package/dist/tanstack/checkbox-group.js +0 -2
- package/dist/tanstack/checkbox.d.ts +0 -3
- package/dist/tanstack/checkbox.js +0 -2
- package/dist/tanstack/date-picker.d.ts +0 -3
- package/dist/tanstack/date-picker.js +0 -2
- package/dist/tanstack/date-range-picker.d.ts +0 -3
- package/dist/tanstack/date-range-picker.js +0 -2
- package/dist/tanstack/date-time-picker.d.ts +0 -3
- package/dist/tanstack/date-time-picker.js +0 -2
- package/dist/tanstack/file-input.d.ts +0 -3
- package/dist/tanstack/file-input.js +0 -2
- package/dist/tanstack/file-upload.d.ts +0 -4
- package/dist/tanstack/file-upload.js +0 -2
- package/dist/tanstack/input.d.ts +0 -3
- package/dist/tanstack/input.js +0 -2
- package/dist/tanstack/number-field.d.ts +0 -3
- package/dist/tanstack/number-field.js +0 -2
- package/dist/tanstack/number-range-input.d.ts +0 -3
- package/dist/tanstack/number-range-input.js +0 -2
- package/dist/tanstack/password-input.d.ts +0 -2
- package/dist/tanstack/password-input.js +0 -2
- package/dist/tanstack/radio-group.d.ts +0 -3
- package/dist/tanstack/radio-group.js +0 -2
- package/dist/tanstack/rich-text-editor.d.ts +0 -9
- package/dist/tanstack/rich-text-editor.js +0 -28
- package/dist/tanstack/select.d.ts +0 -3
- package/dist/tanstack/select.js +0 -2
- package/dist/tanstack/slider.d.ts +0 -3
- package/dist/tanstack/slider.js +0 -2
- package/dist/tanstack/switch.d.ts +0 -3
- package/dist/tanstack/switch.js +0 -2
- package/dist/tanstack/text-area.d.ts +0 -3
- package/dist/tanstack/text-area.js +0 -2
- package/dist/tanstack/time-picker.d.ts +0 -3
- package/dist/tanstack/time-picker.js +0 -2
- package/dist/tanstack/toggle-group.d.ts +0 -3
- package/dist/tanstack/toggle-group.js +0 -2
- package/dist/tanstack-Bgdv0qU1.js +0 -19
- package/dist/tanstack-wNbE6b-h.d.ts +0 -566
- package/dist/toast.cva-AmLw6Cf5.d.ts +0 -61
- package/dist/toast.runtime-Drd2IJ_j.js +0 -17
- package/dist/toastActivation.store-BELtcr76.js +0 -16
- package/dist/toggleGroup.cva-DA4U21gn.d.ts +0 -26
- package/dist/typography.cva-BCHlTHdM.d.ts +0 -36
- package/dist/uiConfig.context-BnCORTNm.d.ts +0 -132
- package/dist/useAsyncList-Cu-Y8If2.d.ts +0 -9
- package/dist/useFilters-BxRScJdn.d.ts +0 -11
- package/dist/useFilters-DMi94RZK.js +0 -190
- package/dist/useForm-Cb7KWLds.js +0 -217
- package/dist/useForm-I6z23FXf.d.ts +0 -51
- package/dist/useFormAutosave-BPGlChiY.js +0 -216
- package/dist/useTableColumnConfig-CXYgj5xi.js +0 -1906
- package/dist/useTableNav-BusSFEVC.d.ts +0 -197
- package/dist/useToast-DsA8CVoY.d.ts +0 -16
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c } from "react/compiler-runtime";
|
|
2
|
-
import { useEffect, useReducer, useRef, useState } from "react";
|
|
3
|
-
//#region ../../node_modules/.bun/react-stately@3.51.0+
|
|
2
|
+
import { useEffect, useLayoutEffect, useReducer, useRef, useState } from "react";
|
|
3
|
+
//#region ../../node_modules/.bun/react-stately@3.51.0+62547eec5a2188e3/node_modules/react-stately/dist/private/data/useListData.mjs
|
|
4
4
|
function $232f8dea1b0a4f2f$export$79c0c687a5963b0a(opts, dispatch) {
|
|
5
5
|
let { cursor, getKey } = opts;
|
|
6
6
|
return {
|
|
@@ -190,7 +190,7 @@ function $232f8dea1b0a4f2f$var$move(state, indices, toIndex) {
|
|
|
190
190
|
};
|
|
191
191
|
}
|
|
192
192
|
//#endregion
|
|
193
|
-
//#region ../../node_modules/.bun/react-stately@3.51.0+
|
|
193
|
+
//#region ../../node_modules/.bun/react-stately@3.51.0+62547eec5a2188e3/node_modules/react-stately/dist/private/data/useAsyncList.mjs
|
|
194
194
|
function $c73d3f3d5ec90946$var$reducer(data, action) {
|
|
195
195
|
let selectedKeys;
|
|
196
196
|
switch (data.state) {
|
|
@@ -396,50 +396,155 @@ function $c73d3f3d5ec90946$export$bc3384a35de93d66(options) {
|
|
|
396
396
|
//#endregion
|
|
397
397
|
//#region src/hooks/useAsyncList.ts
|
|
398
398
|
function useAsyncList(options) {
|
|
399
|
-
const $ = c(
|
|
400
|
-
const [
|
|
401
|
-
const
|
|
399
|
+
const $ = c(33);
|
|
400
|
+
const [hasCursor, setHasCursor] = useState(false);
|
|
401
|
+
const fetchNextPageRef = useRef(void 0);
|
|
402
|
+
const isNextPagePendingRef = useRef(false);
|
|
403
|
+
const loadRef = useRef(options.load);
|
|
404
|
+
const sortRef = useRef(options.sort);
|
|
402
405
|
let t0;
|
|
403
|
-
if ($[0] !== sort) {
|
|
404
|
-
t0 =
|
|
405
|
-
|
|
406
|
-
|
|
406
|
+
if ($[0] !== options.load || $[1] !== options.sort) {
|
|
407
|
+
t0 = () => {
|
|
408
|
+
loadRef.current = options.load;
|
|
409
|
+
sortRef.current = options.sort;
|
|
410
|
+
};
|
|
411
|
+
$[0] = options.load;
|
|
412
|
+
$[1] = options.sort;
|
|
413
|
+
$[2] = t0;
|
|
414
|
+
} else t0 = $[2];
|
|
415
|
+
useLayoutEffect(t0);
|
|
416
|
+
let t1;
|
|
417
|
+
if ($[3] !== options.sort) {
|
|
418
|
+
t1 = options.sort ? async (args) => {
|
|
419
|
+
const result = await (sortRef.current ?? loadRef.current)(args);
|
|
420
|
+
if (!args.signal.aborted) setHasCursor(result.cursor != null);
|
|
407
421
|
return result;
|
|
408
422
|
} : void 0;
|
|
409
|
-
$[
|
|
410
|
-
$[
|
|
411
|
-
} else
|
|
412
|
-
let
|
|
413
|
-
if ($[
|
|
414
|
-
|
|
423
|
+
$[3] = options.sort;
|
|
424
|
+
$[4] = t1;
|
|
425
|
+
} else t1 = $[4];
|
|
426
|
+
let t2;
|
|
427
|
+
if ($[5] !== options || $[6] !== t1) {
|
|
428
|
+
t2 = {
|
|
415
429
|
...options,
|
|
416
|
-
sort:
|
|
430
|
+
sort: t1,
|
|
417
431
|
async load(args_0) {
|
|
418
|
-
const result_0 = await
|
|
419
|
-
if (!args_0.signal.aborted)
|
|
432
|
+
const result_0 = await loadRef.current(args_0);
|
|
433
|
+
if (!args_0.signal.aborted) setHasCursor(result_0.cursor != null);
|
|
420
434
|
return result_0;
|
|
421
435
|
}
|
|
422
436
|
};
|
|
423
|
-
$[
|
|
424
|
-
$[
|
|
425
|
-
$[
|
|
426
|
-
} else
|
|
427
|
-
const list = $c73d3f3d5ec90946$export$bc3384a35de93d66(
|
|
428
|
-
|
|
429
|
-
const t3 = hasMore && list.loadingState !== "error";
|
|
437
|
+
$[5] = options;
|
|
438
|
+
$[6] = t1;
|
|
439
|
+
$[7] = t2;
|
|
440
|
+
} else t2 = $[7];
|
|
441
|
+
const list = $c73d3f3d5ec90946$export$bc3384a35de93d66(t2);
|
|
442
|
+
let t3;
|
|
430
443
|
let t4;
|
|
431
|
-
if ($[
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
444
|
+
if ($[8] !== hasCursor || $[9] !== list) {
|
|
445
|
+
t3 = () => {
|
|
446
|
+
fetchNextPageRef.current = hasCursor && !list.isLoading ? () => list.loadMore() : void 0;
|
|
447
|
+
return () => {
|
|
448
|
+
fetchNextPageRef.current = void 0;
|
|
449
|
+
};
|
|
450
|
+
};
|
|
451
|
+
t4 = [hasCursor, list];
|
|
452
|
+
$[8] = hasCursor;
|
|
453
|
+
$[9] = list;
|
|
454
|
+
$[10] = t3;
|
|
455
|
+
$[11] = t4;
|
|
456
|
+
} else {
|
|
457
|
+
t3 = $[10];
|
|
458
|
+
t4 = $[11];
|
|
459
|
+
}
|
|
460
|
+
useLayoutEffect(t3, t4);
|
|
461
|
+
let t5;
|
|
462
|
+
if ($[12] !== list.isLoading) {
|
|
463
|
+
t5 = () => {
|
|
464
|
+
if (!list.isLoading) isNextPagePendingRef.current = false;
|
|
465
|
+
};
|
|
466
|
+
$[12] = list.isLoading;
|
|
467
|
+
$[13] = t5;
|
|
468
|
+
} else t5 = $[13];
|
|
469
|
+
let t6;
|
|
470
|
+
if ($[14] !== list.isLoading || $[15] !== list.items || $[16] !== list.loadingState) {
|
|
471
|
+
t6 = [
|
|
472
|
+
list.items,
|
|
473
|
+
list.loadingState,
|
|
474
|
+
list.isLoading
|
|
475
|
+
];
|
|
476
|
+
$[14] = list.isLoading;
|
|
477
|
+
$[15] = list.items;
|
|
478
|
+
$[16] = list.loadingState;
|
|
479
|
+
$[17] = t6;
|
|
480
|
+
} else t6 = $[17];
|
|
481
|
+
useLayoutEffect(t5, t6);
|
|
482
|
+
let t7;
|
|
483
|
+
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
484
|
+
t7 = () => {
|
|
485
|
+
if (!fetchNextPageRef.current || isNextPagePendingRef.current) return;
|
|
486
|
+
isNextPagePendingRef.current = true;
|
|
487
|
+
fetchNextPageRef.current();
|
|
436
488
|
};
|
|
437
|
-
$[
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
489
|
+
$[18] = t7;
|
|
490
|
+
} else t7 = $[18];
|
|
491
|
+
const fetchNextPage = t7;
|
|
492
|
+
const [reloadRequests, setReloadRequests] = useState(0);
|
|
493
|
+
let t8;
|
|
494
|
+
if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
|
|
495
|
+
t8 = () => setReloadRequests(_temp);
|
|
496
|
+
$[19] = t8;
|
|
497
|
+
} else t8 = $[19];
|
|
498
|
+
const reload = t8;
|
|
499
|
+
let t9;
|
|
500
|
+
if ($[20] !== list || $[21] !== reloadRequests) {
|
|
501
|
+
t9 = () => {
|
|
502
|
+
if (reloadRequests > 0) list.reload();
|
|
503
|
+
};
|
|
504
|
+
$[20] = list;
|
|
505
|
+
$[21] = reloadRequests;
|
|
506
|
+
$[22] = t9;
|
|
507
|
+
} else t9 = $[22];
|
|
508
|
+
let t10;
|
|
509
|
+
if ($[23] !== reloadRequests) {
|
|
510
|
+
t10 = [reloadRequests];
|
|
511
|
+
$[23] = reloadRequests;
|
|
512
|
+
$[24] = t10;
|
|
513
|
+
} else t10 = $[24];
|
|
514
|
+
useLayoutEffect(t9, t10);
|
|
515
|
+
let data;
|
|
516
|
+
if ($[25] !== list) {
|
|
517
|
+
const { loadMore: _loadMore, isLoading: _isLoading, reload: _reload, ...t11 } = list;
|
|
518
|
+
data = t11;
|
|
519
|
+
$[25] = list;
|
|
520
|
+
$[26] = data;
|
|
521
|
+
} else data = $[26];
|
|
522
|
+
const isFetchingNextPage = list.loadingState === "loadingMore";
|
|
523
|
+
const t11 = list.isLoading && !isFetchingNextPage;
|
|
524
|
+
const t12 = list.loadingState === "error" ? list.error : void 0;
|
|
525
|
+
const t13 = hasCursor && list.loadingState !== "error";
|
|
526
|
+
let t14;
|
|
527
|
+
if ($[27] !== data || $[28] !== isFetchingNextPage || $[29] !== t11 || $[30] !== t12 || $[31] !== t13) {
|
|
528
|
+
t14 = {
|
|
529
|
+
...data,
|
|
530
|
+
reload,
|
|
531
|
+
isLoading: t11,
|
|
532
|
+
error: t12,
|
|
533
|
+
hasNextPage: t13,
|
|
534
|
+
fetchNextPage,
|
|
535
|
+
isFetchingNextPage
|
|
536
|
+
};
|
|
537
|
+
$[27] = data;
|
|
538
|
+
$[28] = isFetchingNextPage;
|
|
539
|
+
$[29] = t11;
|
|
540
|
+
$[30] = t12;
|
|
541
|
+
$[31] = t13;
|
|
542
|
+
$[32] = t14;
|
|
543
|
+
} else t14 = $[32];
|
|
544
|
+
return t14;
|
|
545
|
+
}
|
|
546
|
+
function _temp(count) {
|
|
547
|
+
return count + 1;
|
|
443
548
|
}
|
|
444
549
|
//#endregion
|
|
445
550
|
export { useAsyncList as t };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AsyncListData, AsyncListData as AsyncListData$1, AsyncListLoadFunction, AsyncListLoadOptions, AsyncListOptions, AsyncListOptions as AsyncListOptions$1 } from "react-stately";
|
|
2
|
+
//#region src/hooks/useAsyncList.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* React Aria's async list with its loading and pagination named as on a TanStack infinite query. `Select` and
|
|
5
|
+
* `Autocomplete` take the whole list (`list={list}`); `InfiniteTable` takes no `list`, so pass it `items`, `isLoading`,
|
|
6
|
+
* `hasNextPage`, `fetchNextPage` and `isFetchingNextPage` one by one.
|
|
7
|
+
*/
|
|
8
|
+
type AsyncList<T> = Omit<AsyncListData<T>, "isLoading" | "loadMore" | "reload"> & {
|
|
9
|
+
/**
|
|
10
|
+
* Loads the first page again, keeping the current filter text. It runs after the next render, with the loader from
|
|
11
|
+
* that render, so it can be called in the same handler that changes the loader's inputs (`field.onValueChange`).
|
|
12
|
+
*/
|
|
13
|
+
reload: () => void;
|
|
14
|
+
/** The first page is loading, or the list is reloading after a filter or sort change. */
|
|
15
|
+
isLoading: boolean;
|
|
16
|
+
/** The loader returned a `cursor`, so another page exists. */
|
|
17
|
+
hasNextPage: boolean;
|
|
18
|
+
/** Loads the next page. Does nothing while a page is loading or after the last page. */
|
|
19
|
+
fetchNextPage: () => void;
|
|
20
|
+
/** The next page is loading; the loaded items stay in `items`. */
|
|
21
|
+
isFetchingNextPage: boolean;
|
|
22
|
+
};
|
|
23
|
+
declare function useAsyncList<T, C = string>(options: AsyncListOptions<T, C>): AsyncList<T>;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { AsyncListOptions$1 as a, AsyncListLoadOptions as i, AsyncListData$1 as n, useAsyncList as o, AsyncListLoadFunction as r, AsyncList as t };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useEffect, useRef } from "react";
|
|
2
|
+
import { focusSafely } from "@react-aria/interactions";
|
|
3
|
+
//#region src/components/inputs/shared/useAutoFocus.ts
|
|
4
|
+
/**
|
|
5
|
+
* Focuses the element once after mount when `autoFocus` is set, as React Aria's `useFocusable` does, for fields whose
|
|
6
|
+
* React Aria ref is not the rendered element. Runs after layout effects, so a popover is positioned before focus.
|
|
7
|
+
*/
|
|
8
|
+
const useAutoFocus = (ref, autoFocus) => {
|
|
9
|
+
const autoFocusRef = useRef(autoFocus);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
if (autoFocusRef.current && ref.current) focusSafely(ref.current);
|
|
12
|
+
autoFocusRef.current = false;
|
|
13
|
+
}, [ref]);
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { useAutoFocus as t };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { t as Breakpoint } from "./uiConfig.types-BsyPKepP.js";
|
|
2
|
+
//#region src/hooks/useBreakpoint.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Whether the viewport is at least as wide as the app's Tailwind breakpoint (`--breakpoint-*`), updated on resize.
|
|
5
|
+
* During server rendering it returns `UIConfig.responsive.ssrMatches[breakpoint]`, `false` by default.
|
|
6
|
+
*/
|
|
7
|
+
declare function useBreakpoint(breakpointKey: Breakpoint): boolean;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { useBreakpoint as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as UIConfig } from "./uiConfig.context-
|
|
1
|
+
import { t as UIConfig } from "./uiConfig.context-NWmBJ2Hc.js";
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
3
|
import { useSyncExternalStore } from "react";
|
|
4
4
|
//#region src/hooks/useBreakpoint.ts
|
|
@@ -22,6 +22,10 @@ function getBreakpoints() {
|
|
|
22
22
|
breakpoints = Object.fromEntries(entries);
|
|
23
23
|
return breakpoints;
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Whether the viewport is at least as wide as the app's Tailwind breakpoint (`--breakpoint-*`), updated on resize.
|
|
27
|
+
* During server rendering it returns `UIConfig.responsive.ssrMatches[breakpoint]`, `false` by default.
|
|
28
|
+
*/
|
|
25
29
|
function useBreakpoint(breakpointKey) {
|
|
26
30
|
const $ = c(10);
|
|
27
31
|
const ui = UIConfig.useConfig();
|
|
@@ -35,7 +39,7 @@ function useBreakpoint(breakpointKey) {
|
|
|
35
39
|
const query = `(min-width: ${breakpoints[breakpointKey]})`;
|
|
36
40
|
let t1;
|
|
37
41
|
if ($[1] !== query) {
|
|
38
|
-
t1 = typeof window === "undefined" ? null : window.matchMedia(query);
|
|
42
|
+
t1 = typeof window === "undefined" || typeof window.matchMedia !== "function" ? null : window.matchMedia(query);
|
|
39
43
|
$[1] = query;
|
|
40
44
|
$[2] = t1;
|
|
41
45
|
} else t1 = $[2];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import $ahdqC$react, { useCallback, useEffect, useReducer, useRef, useState } from "react";
|
|
2
|
-
//#region ../../node_modules/.bun/react-stately@3.51.0+
|
|
2
|
+
//#region ../../node_modules/.bun/react-stately@3.51.0+62547eec5a2188e3/node_modules/react-stately/dist/private/utils/useControlledState.mjs
|
|
3
3
|
const $3e6197669829fe11$var$useEarlyEffect = typeof document !== "undefined" || parseInt($ahdqC$react.version, 10) >= 19 ? $ahdqC$react["useInsertionEffect"] ?? $ahdqC$react.useLayoutEffect : () => {};
|
|
4
4
|
function $3e6197669829fe11$export$40bfa8c7b0832715(value, defaultValue, onChange) {
|
|
5
5
|
let [stateValue, setStateValue] = useState(value || defaultValue);
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { t as clsx } from "./clsx-CnD0nOiA.js";
|
|
2
|
+
import { Tag } from "./components/tag.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
5
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/inputs/Selection/shared/SelectInputTags.tsx
|
|
7
|
+
const removeButtonProps = {
|
|
8
|
+
"data-static-clear-action": "",
|
|
9
|
+
slot: null,
|
|
10
|
+
preventFocusOnPress: true
|
|
11
|
+
};
|
|
12
|
+
const SelectInputTags = ({ selectedItems, isDisabled, selectedTagsType, collapseAfter, onRemove, tagClassName }) => {
|
|
13
|
+
const { displayedItems, remainingCount } = useMemo(() => {
|
|
14
|
+
if (!collapseAfter || selectedItems.length <= collapseAfter) return {
|
|
15
|
+
displayedItems: selectedItems,
|
|
16
|
+
remainingCount: 0
|
|
17
|
+
};
|
|
18
|
+
return {
|
|
19
|
+
displayedItems: selectedItems.slice(0, collapseAfter - 1),
|
|
20
|
+
remainingCount: selectedItems.length - (collapseAfter - 1)
|
|
21
|
+
};
|
|
22
|
+
}, [selectedItems, collapseAfter]);
|
|
23
|
+
if (selectedTagsType === "tags") return /* @__PURE__ */ jsxs(Fragment$1, { children: [displayedItems.map((item) => /* @__PURE__ */ jsx(Tag, {
|
|
24
|
+
color: item.color,
|
|
25
|
+
isDisabled,
|
|
26
|
+
onRemove: onRemove && (() => onRemove(item.id)),
|
|
27
|
+
removeButtonProps,
|
|
28
|
+
excludeFromTabOrder: true,
|
|
29
|
+
className: clsx("z-raised h-5 py-0!", tagClassName),
|
|
30
|
+
children: item.label
|
|
31
|
+
}, item.id)), remainingCount > 0 && /* @__PURE__ */ jsx(Tag, {
|
|
32
|
+
isDisabled,
|
|
33
|
+
excludeFromTabOrder: true,
|
|
34
|
+
className: "h-5 py-0!",
|
|
35
|
+
children: `+${remainingCount} more`
|
|
36
|
+
}, "remaining-count")] });
|
|
37
|
+
return /* @__PURE__ */ jsx("p", { children: selectedItems.map((item) => item.label).join(", ") });
|
|
38
|
+
};
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/hooks/useDebounceCallback.ts
|
|
41
|
+
function useDebounceCallback(callback, t0) {
|
|
42
|
+
const $ = c(10);
|
|
43
|
+
let t1;
|
|
44
|
+
if ($[0] !== t0) {
|
|
45
|
+
t1 = t0 === void 0 ? {} : t0;
|
|
46
|
+
$[0] = t0;
|
|
47
|
+
$[1] = t1;
|
|
48
|
+
} else t1 = $[1];
|
|
49
|
+
const { delay: t2 } = t1;
|
|
50
|
+
const delay = t2 === void 0 ? 500 : t2;
|
|
51
|
+
const timeoutRef = useRef(null);
|
|
52
|
+
const [isDebouncing, setIsDebouncing] = useState(false);
|
|
53
|
+
let t3;
|
|
54
|
+
if ($[2] !== callback || $[3] !== delay) {
|
|
55
|
+
t3 = (...t4) => {
|
|
56
|
+
const args = t4;
|
|
57
|
+
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
58
|
+
setIsDebouncing(true);
|
|
59
|
+
timeoutRef.current = setTimeout(() => {
|
|
60
|
+
setIsDebouncing(false);
|
|
61
|
+
callback?.(...args);
|
|
62
|
+
}, delay);
|
|
63
|
+
};
|
|
64
|
+
$[2] = callback;
|
|
65
|
+
$[3] = delay;
|
|
66
|
+
$[4] = t3;
|
|
67
|
+
} else t3 = $[4];
|
|
68
|
+
const debouncedCallback = t3;
|
|
69
|
+
let t4;
|
|
70
|
+
let t5;
|
|
71
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
72
|
+
t4 = () => () => {
|
|
73
|
+
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
74
|
+
};
|
|
75
|
+
t5 = [];
|
|
76
|
+
$[5] = t4;
|
|
77
|
+
$[6] = t5;
|
|
78
|
+
} else {
|
|
79
|
+
t4 = $[5];
|
|
80
|
+
t5 = $[6];
|
|
81
|
+
}
|
|
82
|
+
useEffect(t4, t5);
|
|
83
|
+
let t6;
|
|
84
|
+
if ($[7] !== debouncedCallback || $[8] !== isDebouncing) {
|
|
85
|
+
t6 = {
|
|
86
|
+
callback: debouncedCallback,
|
|
87
|
+
isDebouncing
|
|
88
|
+
};
|
|
89
|
+
$[7] = debouncedCallback;
|
|
90
|
+
$[8] = isDebouncing;
|
|
91
|
+
$[9] = t6;
|
|
92
|
+
} else t6 = $[9];
|
|
93
|
+
return t6;
|
|
94
|
+
}
|
|
95
|
+
//#endregion
|
|
96
|
+
export { SelectInputTags as n, useDebounceCallback as t };
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { n as RoutingUtils, t as UIRouter } from "./router.context-B6j_M4cN.js";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
//#region src/hooks/useFilters.ts
|
|
5
|
+
const NUMBER_TEXT = /^-?(0|[1-9]\d*)(\.\d+)?([eE][+-]?\d+)?$/;
|
|
6
|
+
const ISO_DATE_TEXT = /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:\d{2})?)?$/;
|
|
7
|
+
const mapDeep = (value, map) => {
|
|
8
|
+
if (Array.isArray(value)) return value.map((item) => mapDeep(item, map));
|
|
9
|
+
if (value !== null && typeof value === "object" && Object.getPrototypeOf(value) === Object.prototype) return Object.fromEntries(Object.entries(value).map(([key, item]) => [key, mapDeep(item, map)]));
|
|
10
|
+
return map(value);
|
|
11
|
+
};
|
|
12
|
+
const toUrlValue = (value) => mapDeep(value, (leaf) => leaf instanceof Date ? leaf.toISOString() : leaf);
|
|
13
|
+
const reviveDates = (value) => mapDeep(value, (leaf) => typeof leaf === "string" && ISO_DATE_TEXT.test(leaf) && !Number.isNaN(Date.parse(leaf)) ? new Date(leaf) : leaf);
|
|
14
|
+
const getReadings = (decoded, raw) => {
|
|
15
|
+
const text = typeof decoded === "string" ? decoded : raw;
|
|
16
|
+
const readings = [decoded, raw];
|
|
17
|
+
if (NUMBER_TEXT.test(text) && Number.isFinite(Number(text))) readings.push(Number(text));
|
|
18
|
+
if (text === "true" || text === "false") readings.push(text === "true");
|
|
19
|
+
readings.push(reviveDates(decoded));
|
|
20
|
+
return readings;
|
|
21
|
+
};
|
|
22
|
+
const parseField = (fieldSchema, decoded, raw) => {
|
|
23
|
+
for (const reading of getReadings(decoded, raw)) try {
|
|
24
|
+
const result = fieldSchema.safeParse(reading);
|
|
25
|
+
if (result.success) return { value: result.data };
|
|
26
|
+
} catch {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const toSearchKey = (prefix, key) => prefix ? `filter[${prefix}][${key}]` : `filter[${key}]`;
|
|
31
|
+
const toFilterKey = (prefix, searchKey) => {
|
|
32
|
+
const head = prefix ? `filter[${prefix}][` : "filter[";
|
|
33
|
+
if (!searchKey.startsWith(head) || !searchKey.endsWith("]")) return;
|
|
34
|
+
const key = searchKey.slice(head.length, -1);
|
|
35
|
+
return key === "" || key.includes("[") || key.includes("]") ? void 0 : key;
|
|
36
|
+
};
|
|
37
|
+
const serializeFiltersToQuery = (filterData, prefix) => {
|
|
38
|
+
const query = {};
|
|
39
|
+
for (const [key, value] of Object.entries(filterData)) {
|
|
40
|
+
if (value === null || value === void 0) continue;
|
|
41
|
+
query[toSearchKey(prefix, key)] = toUrlValue(value);
|
|
42
|
+
}
|
|
43
|
+
return query;
|
|
44
|
+
};
|
|
45
|
+
const parseFilterFromQuery = (searchParams, prefix, schema) => {
|
|
46
|
+
const filter = {};
|
|
47
|
+
const shape = schema?.shape;
|
|
48
|
+
const rawValues = new Map(searchParams.entries());
|
|
49
|
+
for (const [key, value] of Object.entries(RoutingUtils.toRouterSearch(searchParams))) {
|
|
50
|
+
const filterKey = toFilterKey(prefix, key);
|
|
51
|
+
if (filterKey === void 0 || filterKey === "__proto__") continue;
|
|
52
|
+
if (!shape) {
|
|
53
|
+
filter[filterKey] = value;
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
if (!Object.hasOwn(shape, filterKey)) continue;
|
|
57
|
+
const field = parseField(shape[filterKey], value, rawValues.get(key) ?? "");
|
|
58
|
+
if (field) filter[filterKey] = field.value;
|
|
59
|
+
}
|
|
60
|
+
return filter;
|
|
61
|
+
};
|
|
62
|
+
function useFilters(t0) {
|
|
63
|
+
const $ = c(37);
|
|
64
|
+
let t1;
|
|
65
|
+
if ($[0] !== t0) {
|
|
66
|
+
t1 = t0 === void 0 ? {} : t0;
|
|
67
|
+
$[0] = t0;
|
|
68
|
+
$[1] = t1;
|
|
69
|
+
} else t1 = $[1];
|
|
70
|
+
const { defaultValues: defaultFilterValues, prefix: t2, schema: schemaOption } = t1;
|
|
71
|
+
const prefix = t2 === void 0 ? "" : t2;
|
|
72
|
+
const schema = schemaOption;
|
|
73
|
+
const { searchParams, updateSearch } = UIRouter.useUIRouter();
|
|
74
|
+
let t3;
|
|
75
|
+
if ($[2] !== prefix || $[3] !== schema || $[4] !== searchParams) {
|
|
76
|
+
t3 = () => parseFilterFromQuery(searchParams, prefix, schema);
|
|
77
|
+
$[2] = prefix;
|
|
78
|
+
$[3] = schema;
|
|
79
|
+
$[4] = searchParams;
|
|
80
|
+
$[5] = t3;
|
|
81
|
+
} else t3 = $[5];
|
|
82
|
+
const [filterData, setFilterData] = useState(t3);
|
|
83
|
+
const writtenRef = useRef(null);
|
|
84
|
+
let t4;
|
|
85
|
+
if ($[6] !== defaultFilterValues || $[7] !== prefix || $[8] !== schema || $[9] !== searchParams || $[10] !== updateSearch) {
|
|
86
|
+
t4 = () => {
|
|
87
|
+
if (!defaultFilterValues || Object.keys(parseFilterFromQuery(searchParams, prefix, schema)).length > 0) return;
|
|
88
|
+
const defaultQuery = serializeFiltersToQuery(defaultFilterValues, prefix);
|
|
89
|
+
writtenRef.current = {
|
|
90
|
+
searchParams,
|
|
91
|
+
prefix,
|
|
92
|
+
filters: { ...defaultFilterValues }
|
|
93
|
+
};
|
|
94
|
+
updateSearch((search) => ({
|
|
95
|
+
...search,
|
|
96
|
+
...defaultQuery
|
|
97
|
+
}));
|
|
98
|
+
};
|
|
99
|
+
$[6] = defaultFilterValues;
|
|
100
|
+
$[7] = prefix;
|
|
101
|
+
$[8] = schema;
|
|
102
|
+
$[9] = searchParams;
|
|
103
|
+
$[10] = updateSearch;
|
|
104
|
+
$[11] = t4;
|
|
105
|
+
} else t4 = $[11];
|
|
106
|
+
let t5;
|
|
107
|
+
if ($[12] !== defaultFilterValues || $[13] !== prefix || $[14] !== schema) {
|
|
108
|
+
t5 = [
|
|
109
|
+
defaultFilterValues,
|
|
110
|
+
prefix,
|
|
111
|
+
schema
|
|
112
|
+
];
|
|
113
|
+
$[12] = defaultFilterValues;
|
|
114
|
+
$[13] = prefix;
|
|
115
|
+
$[14] = schema;
|
|
116
|
+
$[15] = t5;
|
|
117
|
+
} else t5 = $[15];
|
|
118
|
+
useEffect(t4, t5);
|
|
119
|
+
let t6;
|
|
120
|
+
let t7;
|
|
121
|
+
if ($[16] !== prefix || $[17] !== schema || $[18] !== searchParams) {
|
|
122
|
+
t6 = () => {
|
|
123
|
+
const newQueryFilters = parseFilterFromQuery(searchParams, prefix, schema);
|
|
124
|
+
setFilterData(newQueryFilters);
|
|
125
|
+
};
|
|
126
|
+
t7 = [
|
|
127
|
+
searchParams,
|
|
128
|
+
prefix,
|
|
129
|
+
schema
|
|
130
|
+
];
|
|
131
|
+
$[16] = prefix;
|
|
132
|
+
$[17] = schema;
|
|
133
|
+
$[18] = searchParams;
|
|
134
|
+
$[19] = t6;
|
|
135
|
+
$[20] = t7;
|
|
136
|
+
} else {
|
|
137
|
+
t6 = $[19];
|
|
138
|
+
t7 = $[20];
|
|
139
|
+
}
|
|
140
|
+
useEffect(t6, t7);
|
|
141
|
+
let t8;
|
|
142
|
+
if ($[21] !== defaultFilterValues || $[22] !== filterData || $[23] !== prefix || $[24] !== searchParams || $[25] !== updateSearch) {
|
|
143
|
+
t8 = (data) => {
|
|
144
|
+
const written = writtenRef.current;
|
|
145
|
+
let newFilters = { ...written?.searchParams === searchParams && written.prefix === prefix ? written.filters : filterData };
|
|
146
|
+
const isReset = Object.keys(data).length === 0;
|
|
147
|
+
if (data === defaultFilterValues) newFilters = { ...defaultFilterValues };
|
|
148
|
+
else if (isReset) newFilters = {};
|
|
149
|
+
else Object.entries(data).forEach((t9) => {
|
|
150
|
+
const [key, value] = t9;
|
|
151
|
+
if (value === void 0) delete newFilters[key];
|
|
152
|
+
else newFilters[key] = value;
|
|
153
|
+
});
|
|
154
|
+
const filterQuery = serializeFiltersToQuery(newFilters, prefix);
|
|
155
|
+
writtenRef.current = {
|
|
156
|
+
searchParams,
|
|
157
|
+
prefix,
|
|
158
|
+
filters: newFilters
|
|
159
|
+
};
|
|
160
|
+
updateSearch((search_0) => ({
|
|
161
|
+
...Object.fromEntries(Object.entries(search_0).filter((t10) => {
|
|
162
|
+
const [key_0] = t10;
|
|
163
|
+
return toFilterKey(prefix, key_0) === void 0;
|
|
164
|
+
})),
|
|
165
|
+
...filterQuery
|
|
166
|
+
}));
|
|
167
|
+
setFilterData(newFilters);
|
|
168
|
+
};
|
|
169
|
+
$[21] = defaultFilterValues;
|
|
170
|
+
$[22] = filterData;
|
|
171
|
+
$[23] = prefix;
|
|
172
|
+
$[24] = searchParams;
|
|
173
|
+
$[25] = updateSearch;
|
|
174
|
+
$[26] = t8;
|
|
175
|
+
} else t8 = $[26];
|
|
176
|
+
const setFilterValue = t8;
|
|
177
|
+
let t9;
|
|
178
|
+
if ($[27] !== filterData) {
|
|
179
|
+
t9 = (keys) => {
|
|
180
|
+
const result = {};
|
|
181
|
+
keys.forEach((key_1) => {
|
|
182
|
+
result[key_1] = filterData[key_1];
|
|
183
|
+
});
|
|
184
|
+
return result;
|
|
185
|
+
};
|
|
186
|
+
$[27] = filterData;
|
|
187
|
+
$[28] = t9;
|
|
188
|
+
} else t9 = $[28];
|
|
189
|
+
const getFilterValue = t9;
|
|
190
|
+
let t10;
|
|
191
|
+
if ($[29] !== defaultFilterValues || $[30] !== setFilterValue) {
|
|
192
|
+
t10 = () => {
|
|
193
|
+
setFilterValue(defaultFilterValues ?? {});
|
|
194
|
+
};
|
|
195
|
+
$[29] = defaultFilterValues;
|
|
196
|
+
$[30] = setFilterValue;
|
|
197
|
+
$[31] = t10;
|
|
198
|
+
} else t10 = $[31];
|
|
199
|
+
const clearAllFilters = t10;
|
|
200
|
+
let t11;
|
|
201
|
+
if ($[32] !== clearAllFilters || $[33] !== filterData || $[34] !== getFilterValue || $[35] !== setFilterValue) {
|
|
202
|
+
t11 = {
|
|
203
|
+
filterData,
|
|
204
|
+
setFilterValue,
|
|
205
|
+
getFilterValue,
|
|
206
|
+
clearAllFilters
|
|
207
|
+
};
|
|
208
|
+
$[32] = clearAllFilters;
|
|
209
|
+
$[33] = filterData;
|
|
210
|
+
$[34] = getFilterValue;
|
|
211
|
+
$[35] = setFilterValue;
|
|
212
|
+
$[36] = t11;
|
|
213
|
+
} else t11 = $[36];
|
|
214
|
+
return t11;
|
|
215
|
+
}
|
|
216
|
+
//#endregion
|
|
217
|
+
export { useFilters as t };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { t as Hint } from "./hints-B09_WDhL.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/hooks/useFilters.d.ts
|
|
4
|
+
/** A Zod object schema whose output is `TFilterData`. */
|
|
5
|
+
type FilterSchema<TFilterData> = z.ZodObject & z.ZodType<TFilterData, unknown>;
|
|
6
|
+
interface FilterStore<TFilterData> {
|
|
7
|
+
/**
|
|
8
|
+
* The filters in the URL. Any key can be missing: the URL may lack it, and with a `schema` values that fail it and keys
|
|
9
|
+
* outside it are left out.
|
|
10
|
+
*/
|
|
11
|
+
filterData: Partial<TFilterData>;
|
|
12
|
+
/**
|
|
13
|
+
* Merges `data` into the filters and writes them to the URL. A key set to `undefined` is removed; `{}` clears all.
|
|
14
|
+
* Calls in one handler build on each other.
|
|
15
|
+
*/
|
|
16
|
+
setFilterValue: (data: Partial<TFilterData>) => void;
|
|
17
|
+
getFilterValue: (keys: (keyof TFilterData)[]) => Partial<TFilterData>;
|
|
18
|
+
/** Restores `defaultValues`, or removes every filter when there are none. */
|
|
19
|
+
clearAllFilters: () => void;
|
|
20
|
+
}
|
|
21
|
+
interface UseFiltersOptions<TFilterData> {
|
|
22
|
+
/**
|
|
23
|
+
* Filters written to the URL when it holds none, and restored by `clearAllFilters`. Define it outside the component
|
|
24
|
+
* so the reference stays stable.
|
|
25
|
+
*/
|
|
26
|
+
defaultValues?: NoInfer<Partial<TFilterData>>;
|
|
27
|
+
/**
|
|
28
|
+
* Namespaces the query keys (`filter[<prefix>][<key>]`) so several filter sets can share one page. Every store reads
|
|
29
|
+
* and writes only its own keys. A prefix holds no `[` or `]`.
|
|
30
|
+
*/
|
|
31
|
+
prefix?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Zod object of the filters; the store is typed from it. Each URL value is checked against its field, with numbers,
|
|
34
|
+
* booleans and ISO dates (for `z.date()`) read back from URL text. Values that fail and keys outside the schema are
|
|
35
|
+
* left out of `filterData`, never thrown. Define it outside the component so the reference stays stable.
|
|
36
|
+
*/
|
|
37
|
+
schema?: FilterSchema<TFilterData>;
|
|
38
|
+
}
|
|
39
|
+
type UntypedFilters = Record<string, unknown>;
|
|
40
|
+
/**
|
|
41
|
+
* Filter state kept in the URL query: `filter[<key>]`, or `filter[<prefix>][<key>]` with a `prefix`. Needs
|
|
42
|
+
* `UIRouter.UIRouterProvider` from `@povio/ui/ui-router` above it, which connects the app router.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* const orderFiltersSchema = z.object({ status: z.string().optional(), minTotal: z.number().optional() });
|
|
46
|
+
* const filters = useFilters({ schema: orderFiltersSchema });
|
|
47
|
+
* filters.filterData.minTotal; // number | undefined
|
|
48
|
+
*/
|
|
49
|
+
declare function useFilters<TFilterData extends object>(options: UseFiltersOptions<TFilterData> & {
|
|
50
|
+
schema: FilterSchema<TFilterData> | Hint<"Pass `schema`: without it URL values are only decoded (`1` becomes the number 1) and never checked against the type argument">;
|
|
51
|
+
}): FilterStore<TFilterData>;
|
|
52
|
+
/** Without a `schema` every `filter[...]` key of the store is kept, with values only decoded from the URL. */
|
|
53
|
+
declare function useFilters(options?: Omit<UseFiltersOptions<UntypedFilters>, "schema"> & {
|
|
54
|
+
schema?: undefined | Hint<"A `schema` that may be `undefined` matches neither form: branch on it, or always pass one">;
|
|
55
|
+
}): FilterStore<UntypedFilters>;
|
|
56
|
+
//#endregion
|
|
57
|
+
export { UseFiltersOptions as n, useFilters as r, FilterStore as t };
|