@povio/ui 6.0.0-rc.12 → 6.0.0-rc.13
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 +469 -42
- package/dist/{Accordion-Cup5eRZz.d.ts → Accordion-CR9oomZY.d.ts} +29 -17
- package/dist/{Accordion-ORBin0EZ.js → Accordion-gUW7u1Zn.js} +41 -41
- package/dist/Alert-DwnALnFY.d.ts +36 -0
- package/dist/AlertDialog-BcRiqY_n.d.ts +70 -0
- package/dist/Autocomplete-CV4Aa1Ok.js +319 -0
- package/dist/Autocomplete-DRwQxx0U.d.ts +123 -0
- package/dist/Badge-CO-ZsmbR.d.ts +67 -0
- package/dist/{BottomSheet-CGipksM_.js → BottomSheet-APVu5TUd.js} +8 -8
- package/dist/BottomSheet-Be0HtQzP.d.ts +65 -0
- package/dist/{BottomSheet.lazy-CuJMUeJP.d.ts → BottomSheet.lazy-NNB7ivkW.d.ts} +1 -1
- package/dist/{Breadcrumbs-CcB0oOF8.d.ts → Breadcrumbs-Bn3fqVYx.d.ts} +6 -3
- package/dist/{Breadcrumbs-a1-q_he0.js → Breadcrumbs-Cd75RPbS.js} +33 -17
- package/dist/{Button-C1YB5dOw.js → Button-BJJkLVNj.js} +1 -5
- package/dist/{Button-BaODzvZd.js → Button-CzEs3tcV.js} +1 -1
- package/dist/{Button-0SswSdDg.d.ts → Button-Hk8zm9q_.d.ts} +2 -2
- package/dist/ButtonBase-Cp1w00t2.d.ts +47 -0
- package/dist/{ButtonBase-s-VV7oCa.js → ButtonBase-aGz6DYum.js} +10 -18
- package/dist/{ButtonContent-Dztbuz3q.js → ButtonContent-2KsbdWRO.js} +5 -5
- package/dist/{Calendar-yaQubCWK.js → Calendar-DN-i_b-_.js} +19 -17
- package/dist/{Calendar.lazy-DcVss9Bk.js → Calendar.lazy-CqmyDSND.js} +4 -4
- package/dist/{Checkbox-Bjsbx-wK.js → Checkbox-CzKXZw_w.js} +35 -9
- package/dist/Checkbox-D32MOIhF.d.ts +49 -0
- package/dist/CheckboxCheckmark-DDU_Ie7-.js +42 -0
- package/dist/CheckboxGroup-B5Mn1G3u.d.ts +52 -0
- package/dist/{CheckboxGroup-B3O3IUiu.js → CheckboxGroup-BqWt09kZ.js} +75 -35
- package/dist/DatePicker-CmoVbapu.d.ts +80 -0
- package/dist/{DatePicker-bme8zGBo.js → DatePicker-DQewd1By.js} +80 -41
- package/dist/{DatePickerInput-vLlL5ATh.d.ts → DatePickerInput-B9VnExeA.d.ts} +3 -3
- package/dist/{DatePickerInput-C2881tvS.js → DatePickerInput-Bp9ZIN5E.js} +37 -26
- package/dist/{DateRangePicker-Blg158JD.js → DateRangePicker-DRZ1hLlR.js} +86 -158
- package/dist/DateRangePicker-LX1VJlnD.d.ts +102 -0
- package/dist/DateTimePicker-D9pODhAj.d.ts +83 -0
- package/dist/{DateTimePicker-CdRFt8WM.js → DateTimePicker-DWtKPaE6.js} +70 -35
- package/dist/{Dialog-C9H9_BmK.js → Dialog-BJ13KRQo.js} +1 -1
- package/dist/{Dialog-DN5703sy.js → Dialog-BzQYDPJ9.js} +23 -19
- package/dist/Dialog-D0SeePPz.d.ts +66 -0
- package/dist/{Disclosure-BRSkMbZQ.js → Disclosure-Bjm5IOpg.js} +1 -1
- package/dist/Drawer-o018RqIt.d.ts +42 -0
- package/dist/DropdownMenu-DTr7b-XO.d.ts +51 -0
- package/dist/{DropdownMenu-DS0RaEfH.js → DropdownMenu-DrshB60h.js} +33 -21
- package/dist/{DropdownMenuDesktop-DGPIfex-.js → DropdownMenuDesktop-DxGA0yvx.js} +14 -8
- package/dist/FileInput-Bokcp9nH.d.ts +61 -0
- package/dist/{FileInput-BUwtAF2-.js → FileInput-LMhFxlqB.js} +75 -80
- package/dist/FileUpload-BqXd4_nz.d.ts +181 -0
- package/dist/FileUpload-CJZrkr_U.js +679 -0
- package/dist/{FormField-dduTMkNH.js → FormField-TI8Vx5aC.js} +10 -10
- package/dist/FormField-XQbjfGSv.d.ts +70 -0
- package/dist/{FormFieldError-BT4uxbKY.d.ts → FormFieldError-C7yOdjzQ.d.ts} +1 -0
- package/dist/FormFieldHeaderTooltip-DB7KrrcD.js +22 -0
- package/dist/HiddenFormValue-DZ2d9eoA.js +20 -0
- package/dist/IconButton-CQLHX8-Y.d.ts +24 -0
- package/dist/{IconSlot-CqNuZl0E.js → IconSlot-TAWTJ6iK.js} +2 -4
- package/dist/{InlineTooltipWrapper-CKTiFpZn.js → InlineTooltipWrapper-CjDUsi2I.js} +1 -1
- package/dist/{Input-CG5LQ0zs.js → Input-CeRJeAoR.js} +94 -59
- package/dist/Input-onUj0DKg.d.ts +56 -0
- package/dist/{InputContent-Fx2E4UXl.js → InputContent-B8OCdbVP.js} +15 -13
- package/dist/InputContent-D5ZkB9hO.d.ts +39 -0
- package/dist/Link-BdnWVYL9.d.ts +15 -0
- package/dist/{ListBox-DhR5kojP.js → ListBox-gR4iSV7N.js} +3 -3
- package/dist/{Modal-DcLWF9cB.js → Modal-DAMsCwzb.js} +1 -1
- package/dist/{NumberField-DxuikBcr.js → NumberField-6Q9LHGSo.js} +91 -62
- package/dist/NumberField-Sb30Qao3.d.ts +41 -0
- package/dist/{NumberRangeInput-8bOjNEnS.js → NumberRangeInput-BDSkcHVJ.js} +152 -101
- package/dist/NumberRangeInput-Dvq8mOUY.d.ts +89 -0
- package/dist/{PageHeader-DTfzf-dA.d.ts → PageHeader-eJk6GNK6.d.ts} +6 -5
- package/dist/{PasswordInput.bound-Dfq5c3JQ.js → PasswordInput-BcHpV0Ie.js} +6 -6
- package/dist/PasswordInput-VHzP4VPU.d.ts +16 -0
- package/dist/Popover-qplPGDnR.d.ts +51 -0
- package/dist/Progress-DH-w99MU.d.ts +26 -0
- package/dist/Progress-WzWvbvtp.js +180 -0
- package/dist/ProgressBar-BsSimmJF.js +46 -0
- package/dist/RadioGroup-CC8bKtBN.d.ts +52 -0
- package/dist/{RadioGroup-IL4Y8XHO.js → RadioGroup-PKqFHoKP.js} +66 -26
- package/dist/{RangeCalendar-DT63UD8K.js → RangeCalendar-DqCTlIuy.js} +12 -10
- package/dist/Select-CSyfDyxG.d.ts +248 -0
- package/dist/{Select-BM8PNrjC.js → Select-D3fuXwVt.js} +435 -184
- package/dist/{SelectListBox-BFSZxDSi.js → SelectListBox-DqAxkT1f.js} +46 -37
- package/dist/{SidebarWorkspaces-DJknAfS9.js → SidebarWorkspaces-BGl_PIsH.js} +280 -363
- package/dist/{SidebarWorkspaces-DDHJAdNH.d.ts → SidebarWorkspaces-CdtK2M-C.d.ts} +31 -17
- package/dist/{Slider-DCsCCPFx.js → Slider-BCUiALjE.js} +69 -12
- package/dist/Slider-DxalZD3o.d.ts +57 -0
- package/dist/Spinner-BTrEbNFy.d.ts +13 -0
- package/dist/SplitButton-Dv5l8p5t.d.ts +25 -0
- package/dist/Stepper-B1IOUcSI.d.ts +49 -0
- package/dist/{Stepper-Dyhxp0Tl.js → Stepper-DA2G546I.js} +116 -88
- package/dist/{Switch-BfpSMMpv.js → Switch-Ce-bJOVw.js} +54 -12
- package/dist/Switch-urNrop0P.d.ts +42 -0
- package/dist/{TabsFilters-DybNturW.js → TabsFilters-Cweij8He.js} +44 -33
- package/dist/TabsFilters-M5Ld7eb8.d.ts +59 -0
- package/dist/Tag-BKR1AZFa.d.ts +26 -0
- package/dist/TextArea-D7YVclaz.d.ts +33 -0
- package/dist/{TextArea-Blsip3ZC.js → TextArea-P8F0oD_A.js} +59 -32
- package/dist/TimePicker-Ai1M2TGW.d.ts +63 -0
- package/dist/{TimePicker-4hV5zbgd.js → TimePicker-l4Ysk2AX.js} +99 -50
- package/dist/{TimePickerForm-DD9VA_td.js → TimePickerForm-BMqNpDPT.js} +5 -5
- package/dist/{ToastContainer-Dd0LPykL.js → ToastContainer-BeklfvlK.js} +4 -4
- package/dist/{ToggleButton-HUZ8ij6i.d.ts → ToggleButton-DWw53pTt.d.ts} +2 -2
- package/dist/ToggleGroup-BQk3k0at.d.ts +95 -0
- package/dist/ToggleGroup-BdIgqoqA.js +500 -0
- package/dist/{Tooltip-DRB6lo0U.js → Tooltip-BkXPEBqw.js} +2 -2
- package/dist/Tooltip-H8OB7CqY.d.ts +33 -0
- package/dist/TooltipEllipsis-7QF00kXk.d.ts +21 -0
- package/dist/{TooltipWrapper-BSY31JMc.js → TooltipWrapper-ubbBHHVD.js} +6 -6
- package/dist/{Typography-DJojwiXV.d.ts → Typography-Cx1oRGxd.d.ts} +5 -1
- package/dist/{badgeButton.cva-t5PQOH4M.js → badge.cva-BpoxNggB.js} +20 -22
- package/dist/{button.cva-Ciga0rdG.js → button.cva-C2aoXMh-.js} +10 -16
- package/dist/{buttonContent.cva-BapnODby.d.ts → buttonContent.cva-Dyy_RUZU.d.ts} +1 -1
- package/dist/{checkbox.cva-aLJS7v4z.js → checkbox.cva-qU_q0lSX.js} +14 -14
- 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 +159 -81
- package/dist/components/bottom-sheet-header.d.ts +1 -1
- package/dist/components/bottom-sheet-header.js +4 -4
- 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 +29 -26
- 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 +1 -1
- 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 +2 -2
- package/dist/components/style-definitions.js +33 -18
- 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 +1 -1
- 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-router.d.ts +1 -1
- package/dist/config/ui-router.js +1 -1
- package/dist/confirmation.context-BflM4Vxg.js +93 -0
- package/dist/confirmation.context-C_js9qNv.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-DZOoWaZz.js} +63 -38
- 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-MH5ziWUe.js} +2 -2
- package/dist/form-field-Bw7U_ZPI.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-DM-PUcxQ.d.ts → i18n-B3PeqBM7.d.ts} +100 -4
- package/dist/{i18n-D8vXIoiq.js → i18n-DQs7jPjv.js} +99 -9
- package/dist/iconSlot.cva-DyhOI7EK.js +5 -0
- package/dist/{import-C7W0Wv2r.js → import-C73fI3WD.js} +2 -2
- package/dist/index.d.ts +64 -83
- package/dist/index.js +55 -90
- 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/{label.cva-DTfT6FrX.js → label.cva-DJ5Dmbz5.js} +7 -7
- package/dist/link.context-BcBuP9ZT.d.ts +20 -0
- package/dist/{link.context-TPjDtjw3.js → link.context-CD5h_b5O.js} +12 -11
- package/dist/link.cva-D6L1c2wq.d.ts +2157 -0
- package/dist/{logger-CqZjM-sn.js → logger-CW24po62.js} +10 -1
- 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/sidebar.cva-BgxTCejU.js +150 -0
- package/dist/spinner.cva-j4kGmIWC.js +17 -0
- package/dist/{staticDateTimeSegments-CVuAhDDl.js → staticDateTimeSegments-BYk1tcxs.js} +43 -13
- package/dist/{status.cva-CYgi3Htz.js → status.cva-WLEqUAjH.js} +9 -9
- package/dist/styles/input.d.ts +1 -1
- package/dist/tanstack/form.d.ts +3 -3
- package/dist/tanstack/form.js +3 -3
- package/dist/tanstack/table.d.ts +5 -3
- package/dist/tanstack/table.js +1 -1
- package/dist/tanstack-ABeiJISz.js +10 -0
- package/dist/tanstack-bLXoUPDY.d.ts +165 -0
- package/dist/tanstack.d.ts +64 -83
- package/dist/tanstack.js +55 -90
- package/dist/{toast.cva-B6NXTwbZ.js → toast.cva-C3oA7He3.js} +8 -8
- package/dist/toast.runtime-BHXdSTXV.js +25 -0
- package/dist/{toggleGroup.cva-CJ-3Ps7j.js → toggleGroup.cva-CvNS5QO1.js} +2 -2
- package/dist/uiConfig.context-CN_QgxGO.d.ts +19 -0
- package/dist/{uiConfig.context-3DN9w6oU.js → uiConfig.context-CjnLnQOo.js} +5 -7
- package/dist/{uiConfig.context-BnCORTNm.d.ts → uiConfig.types-B0sPL7nN.d.ts} +34 -34
- package/dist/{useAsyncList-Ct74ve3i.js → useAsyncList-CQgkDfjW.js} +140 -35
- package/dist/useAsyncList-F-328rtE.d.ts +25 -0
- package/dist/useAutoFocus-K-bfNxa2.js +16 -0
- package/dist/{useBreakpoint-CJ3mx7UF.js → useBreakpoint-BrJrvp9_.js} +5 -1
- package/dist/useBreakpoint-D-SVcBeQ.d.ts +9 -0
- package/dist/useDebounceCallback-BjePw6y4.js +90 -0
- package/dist/useFilters-CybBXUAA.js +217 -0
- package/dist/useFilters-DrfBFNLw.d.ts +57 -0
- package/dist/useFormAutosave-BN-zueci.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-B7qGzySj.js} +103 -2
- package/dist/useRemoveButton-B6-IGvpY.js +98 -0
- package/dist/useResolveDateRangePreset-C_L-doA6.js +26 -0
- package/dist/useResolveDateRangePreset-DOSzJR-N.d.ts +64 -0
- package/dist/{useScrollableListBox-oYKqU3Hp.js → useScrollableListBox-C8chM7c-.js} +1 -1
- package/dist/{useStaticInputHandoff-BN0fOerH.js → useStaticInputHandoff-DrNFrvD7.js} +6 -1
- package/dist/{useTableColumnConfig-CXYgj5xi.js → useTableColumnConfig-B9cYBKo3.js} +956 -535
- package/dist/useTableNav-rP1wDkhV.d.ts +372 -0
- package/dist/useToast-D2C9pROU.d.ts +78 -0
- package/dist/useToast-DSoOiSw0.js +63 -0
- package/dist/utils/file.d.ts +1 -1
- package/dist/utils/file.js +1 -1
- package/dist/utils/logger.js +1 -1
- package/llms.txt +3116 -0
- package/package.json +13 -121
- 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/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/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/useTableNav-BusSFEVC.d.ts +0 -197
- package/dist/useToast-DsA8CVoY.d.ts +0 -16
|
@@ -1,29 +1,32 @@
|
|
|
1
|
-
import { t as logger } from "./logger-
|
|
1
|
+
import { n as __exportAll, t as logger } from "./logger-CW24po62.js";
|
|
2
2
|
import { t as clsx } from "./clsx-CnD0nOiA.js";
|
|
3
3
|
import { t as UIOverrides } from "./uiOverrides.context-DNEQlTx0.js";
|
|
4
|
-
import { t as IconSlot } from "./IconSlot-
|
|
5
|
-
import { t as Checkbox } from "./Checkbox-
|
|
6
|
-
import { t as Tooltip } from "./Tooltip-
|
|
4
|
+
import { t as IconSlot } from "./IconSlot-TAWTJ6iK.js";
|
|
5
|
+
import { t as Checkbox } from "./Checkbox-CzKXZw_w.js";
|
|
6
|
+
import { t as Tooltip } from "./Tooltip-BkXPEBqw.js";
|
|
7
7
|
import { t as Typography } from "./Typography-DCLnPa3P.js";
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
8
|
+
import "./i18n-DQs7jPjv.js";
|
|
9
|
+
import { Spinner } from "./components/spinner.js";
|
|
10
|
+
import { t as UIConfig } from "./uiConfig.context-CjnLnQOo.js";
|
|
10
11
|
import { n as uiOutlineClass } from "./outline.clsx-DGGQQRkM.js";
|
|
12
|
+
import { t as Button } from "./Button-CzEs3tcV.js";
|
|
11
13
|
import { IconButton } from "./components/icon-button.js";
|
|
12
|
-
import { t as useBreakpoint } from "./useBreakpoint-
|
|
13
|
-
import "./
|
|
14
|
-
import { t as Dialog } from "./Dialog-DN5703sy.js";
|
|
14
|
+
import { t as useBreakpoint } from "./useBreakpoint-BrJrvp9_.js";
|
|
15
|
+
import { t as Dialog } from "./Dialog-BzQYDPJ9.js";
|
|
15
16
|
import { Drawer } from "./components/drawer.js";
|
|
16
17
|
import { a as tableDetailsPanelDefinition, c as tableHeaderTextDefinition, d as tableSidePanelDefinition, f as tableSidePanelHeaderDefinition, i as tableDetailsCellDefinition, l as tableRowDefinition, n as tableContainerDefinition, o as tableHeadDataDefinition, p as theadDefinition, r as tableDataDefinition, s as tableHeadRowDefinition, t as tableCellTextDefinition, u as tableSidePanelBodyDefinition } from "./table.cva-DkcsOmZG.js";
|
|
17
|
-
import { t as
|
|
18
|
-
import { t as
|
|
19
|
-
import { t as UIRouter } from "./router.context-MckTbHw9.js";
|
|
20
|
-
import { t as RoutingUtils } from "./routing.utils-DfxEt0_Y.js";
|
|
21
|
-
import { ArrowDown, ArrowUp, ArrowUpDown, ChevronRight, GripVertical, Pin, X } from "lucide-react";
|
|
18
|
+
import { t as useIntersectionObserver } from "./useIntersectionObserver-B8msnQTR.js";
|
|
19
|
+
import { t as UIRouter } from "./router.context-B6j_M4cN.js";
|
|
22
20
|
import { c } from "react/compiler-runtime";
|
|
23
21
|
import { Fragment, Suspense, createContext, lazy, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
24
22
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
25
|
-
import
|
|
23
|
+
import { ArrowDown, ArrowUp, ArrowUpDown, ChevronRight, GripVertical, Pin, X } from "lucide-react";
|
|
26
24
|
import { useTranslation } from "react-i18next";
|
|
25
|
+
import i18next from "i18next";
|
|
26
|
+
import { DndContext, KeyboardSensor, MouseSensor, TouchSensor, closestCenter, useSensor, useSensors } from "@dnd-kit/core";
|
|
27
|
+
import { restrictToVerticalAxis } from "@dnd-kit/modifiers";
|
|
28
|
+
import { SortableContext, sortableKeyboardCoordinates, useSortable, verticalListSortingStrategy } from "@dnd-kit/sortable";
|
|
29
|
+
import { CSS } from "@dnd-kit/utilities";
|
|
27
30
|
import { createPaginatedRowModel, createSortedRowModel, flexRender, stockFeatures, tableFeatures, useTable } from "@tanstack/react-table";
|
|
28
31
|
//#region src/components/table/CellText.tsx
|
|
29
32
|
const CellText = (props) => {
|
|
@@ -40,6 +43,360 @@ const CellText = (props) => {
|
|
|
40
43
|
});
|
|
41
44
|
};
|
|
42
45
|
//#endregion
|
|
46
|
+
//#region src/components/table/TableDnd.tsx
|
|
47
|
+
var TableDnd_exports = /* @__PURE__ */ __exportAll({
|
|
48
|
+
DndProvider: () => DndProvider$1,
|
|
49
|
+
DragHandle: () => DragHandle$1,
|
|
50
|
+
DragHandleButton: () => DragHandleButton,
|
|
51
|
+
DraggableRow: () => DraggableRow$1,
|
|
52
|
+
SortableItem: () => SortableItem,
|
|
53
|
+
SortableRows: () => SortableRows$1
|
|
54
|
+
});
|
|
55
|
+
const DndProvider$1 = (t0) => {
|
|
56
|
+
const $ = c(8);
|
|
57
|
+
const { children, onDragEnd, onDragStart, onDragCancel } = t0;
|
|
58
|
+
let t1;
|
|
59
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
60
|
+
t1 = { coordinateGetter: sortableKeyboardCoordinates };
|
|
61
|
+
$[0] = t1;
|
|
62
|
+
} else t1 = $[0];
|
|
63
|
+
const sensors = useSensors(useSensor(MouseSensor), useSensor(TouchSensor), useSensor(KeyboardSensor, t1));
|
|
64
|
+
let t2;
|
|
65
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
66
|
+
t2 = [restrictToVerticalAxis];
|
|
67
|
+
$[1] = t2;
|
|
68
|
+
} else t2 = $[1];
|
|
69
|
+
let t3;
|
|
70
|
+
if ($[2] !== children || $[3] !== onDragCancel || $[4] !== onDragEnd || $[5] !== onDragStart || $[6] !== sensors) {
|
|
71
|
+
t3 = /* @__PURE__ */ jsx(DndContext, {
|
|
72
|
+
collisionDetection: closestCenter,
|
|
73
|
+
modifiers: t2,
|
|
74
|
+
onDragStart,
|
|
75
|
+
onDragEnd,
|
|
76
|
+
onDragCancel,
|
|
77
|
+
sensors,
|
|
78
|
+
children
|
|
79
|
+
});
|
|
80
|
+
$[2] = children;
|
|
81
|
+
$[3] = onDragCancel;
|
|
82
|
+
$[4] = onDragEnd;
|
|
83
|
+
$[5] = onDragStart;
|
|
84
|
+
$[6] = sensors;
|
|
85
|
+
$[7] = t3;
|
|
86
|
+
} else t3 = $[7];
|
|
87
|
+
return t3;
|
|
88
|
+
};
|
|
89
|
+
const SortableRows$1 = (t0) => {
|
|
90
|
+
const $ = c(3);
|
|
91
|
+
const { children, items } = t0;
|
|
92
|
+
let t1;
|
|
93
|
+
if ($[0] !== children || $[1] !== items) {
|
|
94
|
+
t1 = /* @__PURE__ */ jsx(SortableContext, {
|
|
95
|
+
items,
|
|
96
|
+
strategy: verticalListSortingStrategy,
|
|
97
|
+
children
|
|
98
|
+
});
|
|
99
|
+
$[0] = children;
|
|
100
|
+
$[1] = items;
|
|
101
|
+
$[2] = t1;
|
|
102
|
+
} else t1 = $[2];
|
|
103
|
+
return t1;
|
|
104
|
+
};
|
|
105
|
+
const DraggableRow$1 = (t0) => {
|
|
106
|
+
const $ = c(19);
|
|
107
|
+
const { id, className, isClickable, isSelected, onClick, onDoubleClick, onKeyDown, children } = t0;
|
|
108
|
+
let t1;
|
|
109
|
+
if ($[0] !== id) {
|
|
110
|
+
t1 = { id };
|
|
111
|
+
$[0] = id;
|
|
112
|
+
$[1] = t1;
|
|
113
|
+
} else t1 = $[1];
|
|
114
|
+
const { transform, transition, setNodeRef, isDragging } = useSortable(t1);
|
|
115
|
+
let t2;
|
|
116
|
+
if ($[2] !== transform) {
|
|
117
|
+
t2 = CSS.Transform.toString(transform);
|
|
118
|
+
$[2] = transform;
|
|
119
|
+
$[3] = t2;
|
|
120
|
+
} else t2 = $[3];
|
|
121
|
+
const t3 = isDragging ? .8 : 1;
|
|
122
|
+
const t4 = isDragging ? 1 : 0;
|
|
123
|
+
let t5;
|
|
124
|
+
if ($[4] !== t2 || $[5] !== t3 || $[6] !== t4 || $[7] !== transition) {
|
|
125
|
+
t5 = {
|
|
126
|
+
transform: t2,
|
|
127
|
+
transition,
|
|
128
|
+
opacity: t3,
|
|
129
|
+
zIndex: t4,
|
|
130
|
+
position: "relative"
|
|
131
|
+
};
|
|
132
|
+
$[4] = t2;
|
|
133
|
+
$[5] = t3;
|
|
134
|
+
$[6] = t4;
|
|
135
|
+
$[7] = transition;
|
|
136
|
+
$[8] = t5;
|
|
137
|
+
} else t5 = $[8];
|
|
138
|
+
const style = t5;
|
|
139
|
+
const t6 = isClickable || void 0;
|
|
140
|
+
const t7 = isSelected || void 0;
|
|
141
|
+
let t8;
|
|
142
|
+
if ($[9] !== children || $[10] !== className || $[11] !== onClick || $[12] !== onDoubleClick || $[13] !== onKeyDown || $[14] !== setNodeRef || $[15] !== style || $[16] !== t6 || $[17] !== t7) {
|
|
143
|
+
t8 = /* @__PURE__ */ jsx("tr", {
|
|
144
|
+
ref: setNodeRef,
|
|
145
|
+
style,
|
|
146
|
+
className,
|
|
147
|
+
"data-clickable": t6,
|
|
148
|
+
"data-selected": t7,
|
|
149
|
+
onClick,
|
|
150
|
+
onDoubleClick,
|
|
151
|
+
onKeyDown,
|
|
152
|
+
children
|
|
153
|
+
});
|
|
154
|
+
$[9] = children;
|
|
155
|
+
$[10] = className;
|
|
156
|
+
$[11] = onClick;
|
|
157
|
+
$[12] = onDoubleClick;
|
|
158
|
+
$[13] = onKeyDown;
|
|
159
|
+
$[14] = setNodeRef;
|
|
160
|
+
$[15] = style;
|
|
161
|
+
$[16] = t6;
|
|
162
|
+
$[17] = t7;
|
|
163
|
+
$[18] = t8;
|
|
164
|
+
} else t8 = $[18];
|
|
165
|
+
return t8;
|
|
166
|
+
};
|
|
167
|
+
const SortableItem = (t0) => {
|
|
168
|
+
const $ = c(10);
|
|
169
|
+
const { id, children } = t0;
|
|
170
|
+
let t1;
|
|
171
|
+
if ($[0] !== id) {
|
|
172
|
+
t1 = { id };
|
|
173
|
+
$[0] = id;
|
|
174
|
+
$[1] = t1;
|
|
175
|
+
} else t1 = $[1];
|
|
176
|
+
const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable(t1);
|
|
177
|
+
let t2;
|
|
178
|
+
if ($[2] !== attributes || $[3] !== children || $[4] !== isDragging || $[5] !== listeners || $[6] !== setNodeRef || $[7] !== transform || $[8] !== transition) {
|
|
179
|
+
t2 = children({
|
|
180
|
+
ref: setNodeRef,
|
|
181
|
+
style: {
|
|
182
|
+
transform: CSS.Transform.toString(transform),
|
|
183
|
+
transition,
|
|
184
|
+
zIndex: isDragging ? 1 : 0,
|
|
185
|
+
position: "relative"
|
|
186
|
+
},
|
|
187
|
+
isDragging,
|
|
188
|
+
handleProps: {
|
|
189
|
+
...attributes,
|
|
190
|
+
...listeners
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
$[2] = attributes;
|
|
194
|
+
$[3] = children;
|
|
195
|
+
$[4] = isDragging;
|
|
196
|
+
$[5] = listeners;
|
|
197
|
+
$[6] = setNodeRef;
|
|
198
|
+
$[7] = transform;
|
|
199
|
+
$[8] = transition;
|
|
200
|
+
$[9] = t2;
|
|
201
|
+
} else t2 = $[9];
|
|
202
|
+
return t2;
|
|
203
|
+
};
|
|
204
|
+
const DragHandleButton = (t0) => {
|
|
205
|
+
const $ = c(7);
|
|
206
|
+
const { label, className, handleProps } = t0;
|
|
207
|
+
let t1;
|
|
208
|
+
if ($[0] !== className) {
|
|
209
|
+
t1 = clsx("inline-flex size-8 shrink-0 cursor-move touch-none items-center justify-center rounded-md text-muted-foreground hover:text-foreground", uiOutlineClass, className);
|
|
210
|
+
$[0] = className;
|
|
211
|
+
$[1] = t1;
|
|
212
|
+
} else t1 = $[1];
|
|
213
|
+
let t2;
|
|
214
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
215
|
+
t2 = /* @__PURE__ */ jsx(IconSlot, { icon: GripVertical });
|
|
216
|
+
$[2] = t2;
|
|
217
|
+
} else t2 = $[2];
|
|
218
|
+
let t3;
|
|
219
|
+
if ($[3] !== handleProps || $[4] !== label || $[5] !== t1) {
|
|
220
|
+
t3 = /* @__PURE__ */ jsx("button", {
|
|
221
|
+
...handleProps,
|
|
222
|
+
type: "button",
|
|
223
|
+
"aria-label": label,
|
|
224
|
+
className: t1,
|
|
225
|
+
children: t2
|
|
226
|
+
});
|
|
227
|
+
$[3] = handleProps;
|
|
228
|
+
$[4] = label;
|
|
229
|
+
$[5] = t1;
|
|
230
|
+
$[6] = t3;
|
|
231
|
+
} else t3 = $[6];
|
|
232
|
+
return t3;
|
|
233
|
+
};
|
|
234
|
+
const DragHandle$1 = (t0) => {
|
|
235
|
+
const $ = c(8);
|
|
236
|
+
const { id, label } = t0;
|
|
237
|
+
let t1;
|
|
238
|
+
if ($[0] !== id) {
|
|
239
|
+
t1 = { id };
|
|
240
|
+
$[0] = id;
|
|
241
|
+
$[1] = t1;
|
|
242
|
+
} else t1 = $[1];
|
|
243
|
+
const { attributes, listeners } = useSortable(t1);
|
|
244
|
+
let t2;
|
|
245
|
+
if ($[2] !== attributes || $[3] !== listeners) {
|
|
246
|
+
t2 = {
|
|
247
|
+
...attributes,
|
|
248
|
+
...listeners
|
|
249
|
+
};
|
|
250
|
+
$[2] = attributes;
|
|
251
|
+
$[3] = listeners;
|
|
252
|
+
$[4] = t2;
|
|
253
|
+
} else t2 = $[4];
|
|
254
|
+
let t3;
|
|
255
|
+
if ($[5] !== label || $[6] !== t2) {
|
|
256
|
+
t3 = /* @__PURE__ */ jsx(DragHandleButton, {
|
|
257
|
+
label,
|
|
258
|
+
handleProps: t2
|
|
259
|
+
});
|
|
260
|
+
$[5] = label;
|
|
261
|
+
$[6] = t2;
|
|
262
|
+
$[7] = t3;
|
|
263
|
+
} else t3 = $[7];
|
|
264
|
+
return t3;
|
|
265
|
+
};
|
|
266
|
+
//#endregion
|
|
267
|
+
//#region src/components/table/ColumnConfig.tsx
|
|
268
|
+
const getColumnId = (column) => column.id ?? column.accessorKey;
|
|
269
|
+
function ColumnConfigModal({ isOpen, onOpenChange, trigger, configColumns, visibleColumns, onVisibilityChange, onOrderChange, onReset }) {
|
|
270
|
+
const { t } = useTranslation("ui");
|
|
271
|
+
const headingId = useId();
|
|
272
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
273
|
+
const allIds = useMemo(() => configColumns.map(getColumnId), [configColumns]);
|
|
274
|
+
const items = useMemo(() => configColumns.filter((column) => column.enableHiding !== false).map((column_0) => {
|
|
275
|
+
const id = getColumnId(column_0);
|
|
276
|
+
return {
|
|
277
|
+
id,
|
|
278
|
+
label: typeof column_0.header === "string" && column_0.header ? column_0.header : id,
|
|
279
|
+
visible: visibleColumns?.[id] ?? true
|
|
280
|
+
};
|
|
281
|
+
}), [configColumns, visibleColumns]);
|
|
282
|
+
const visibleCount = items.filter((item) => item.visible).length;
|
|
283
|
+
const handleToggle = (id_0, visible) => {
|
|
284
|
+
onVisibilityChange({
|
|
285
|
+
...visibleColumns,
|
|
286
|
+
[id_0]: visible
|
|
287
|
+
});
|
|
288
|
+
};
|
|
289
|
+
const handleShowAll = () => {
|
|
290
|
+
onVisibilityChange(Object.fromEntries(items.map((item_0) => [item_0.id, true])));
|
|
291
|
+
};
|
|
292
|
+
const handleDragEnd = ({ active, over }) => {
|
|
293
|
+
setIsDragging(false);
|
|
294
|
+
if (!over || active.id === over.id) return;
|
|
295
|
+
const listedIds = items.map((item_1) => item_1.id);
|
|
296
|
+
const oldIndex = listedIds.indexOf(String(active.id));
|
|
297
|
+
const newIndex = listedIds.indexOf(String(over.id));
|
|
298
|
+
if (oldIndex === -1 || newIndex === -1) return;
|
|
299
|
+
const [moved] = listedIds.splice(oldIndex, 1);
|
|
300
|
+
listedIds.splice(newIndex, 0, moved);
|
|
301
|
+
const listed = new Set(listedIds);
|
|
302
|
+
let nextListed = 0;
|
|
303
|
+
onOrderChange(allIds.map((id_1) => listed.has(id_1) ? listedIds[nextListed++] : id_1));
|
|
304
|
+
};
|
|
305
|
+
return /* @__PURE__ */ jsx(Dialog, {
|
|
306
|
+
isOpen,
|
|
307
|
+
onOpenChange,
|
|
308
|
+
trigger,
|
|
309
|
+
showCloseIcon: true,
|
|
310
|
+
isKeyboardDismissable: !isDragging,
|
|
311
|
+
className: "w-modal",
|
|
312
|
+
closeIconClassName: "top-7.5! right-6!",
|
|
313
|
+
"aria-labelledby": headingId,
|
|
314
|
+
children: (close) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
315
|
+
/* @__PURE__ */ jsxs("div", {
|
|
316
|
+
className: "flex flex-col gap-1.5 pr-6",
|
|
317
|
+
children: [/* @__PURE__ */ jsx(Typography, {
|
|
318
|
+
as: "h2",
|
|
319
|
+
id: headingId,
|
|
320
|
+
size: "h3",
|
|
321
|
+
className: "font-semibold text-foreground",
|
|
322
|
+
children: t(($) => $.ui.table.configureColumns)
|
|
323
|
+
}), /* @__PURE__ */ jsx(Typography, {
|
|
324
|
+
size: "body",
|
|
325
|
+
className: "text-pretty text-muted-foreground",
|
|
326
|
+
children: t(($_0) => $_0.ui.table.configureColumnsDescription)
|
|
327
|
+
})]
|
|
328
|
+
}),
|
|
329
|
+
/* @__PURE__ */ jsxs("div", {
|
|
330
|
+
className: "flex flex-col gap-2",
|
|
331
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
332
|
+
className: "flex items-center justify-between",
|
|
333
|
+
children: [/* @__PURE__ */ jsx(Typography, {
|
|
334
|
+
size: "small",
|
|
335
|
+
className: "text-muted-foreground",
|
|
336
|
+
children: t(($_1) => $_1.ui.table.visibleCount, {
|
|
337
|
+
visible: visibleCount,
|
|
338
|
+
total: items.length
|
|
339
|
+
})
|
|
340
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
341
|
+
variant: "ghost",
|
|
342
|
+
color: "secondary",
|
|
343
|
+
size: "sm",
|
|
344
|
+
width: "hug",
|
|
345
|
+
isDisabled: visibleCount === items.length,
|
|
346
|
+
onPress: handleShowAll,
|
|
347
|
+
children: t(($_2) => $_2.ui.table.showAll)
|
|
348
|
+
})]
|
|
349
|
+
}), /* @__PURE__ */ jsx(DndProvider$1, {
|
|
350
|
+
onDragStart: () => setIsDragging(true),
|
|
351
|
+
onDragEnd: handleDragEnd,
|
|
352
|
+
onDragCancel: () => setIsDragging(false),
|
|
353
|
+
children: /* @__PURE__ */ jsx(SortableRows$1, {
|
|
354
|
+
items: items.map((item_2) => item_2.id),
|
|
355
|
+
children: /* @__PURE__ */ jsx("ul", {
|
|
356
|
+
className: "max-h-96 overflow-y-auto rounded-lg border border-border",
|
|
357
|
+
children: items.map((item_3) => /* @__PURE__ */ jsx(SortableItem, {
|
|
358
|
+
id: item_3.id,
|
|
359
|
+
children: ({ ref, style, isDragging: isItemDragging, handleProps }) => /* @__PURE__ */ jsxs("li", {
|
|
360
|
+
ref,
|
|
361
|
+
style,
|
|
362
|
+
className: clsx("flex h-11 items-center gap-2 border-b border-border bg-background pr-3 pl-1 last:border-b-0", isItemDragging && "shadow-md"),
|
|
363
|
+
children: [/* @__PURE__ */ jsx(DragHandleButton, {
|
|
364
|
+
handleProps,
|
|
365
|
+
label: t(($_3) => $_3.ui.table.reorderColumn, { column: item_3.label })
|
|
366
|
+
}), /* @__PURE__ */ jsx(Checkbox, {
|
|
367
|
+
isSelected: item_3.visible,
|
|
368
|
+
onChange: (isSelected) => handleToggle(item_3.id, isSelected),
|
|
369
|
+
hideError: true,
|
|
370
|
+
className: "flex-1 flex-row-reverse justify-between",
|
|
371
|
+
labelClassName: item_3.visible ? "text-foreground" : "text-muted-foreground",
|
|
372
|
+
children: item_3.label
|
|
373
|
+
})]
|
|
374
|
+
})
|
|
375
|
+
}, item_3.id))
|
|
376
|
+
})
|
|
377
|
+
})
|
|
378
|
+
})]
|
|
379
|
+
}),
|
|
380
|
+
/* @__PURE__ */ jsxs("div", {
|
|
381
|
+
className: clsx("flex items-center gap-2", onReset ? "justify-between" : "justify-end"),
|
|
382
|
+
children: [onReset && /* @__PURE__ */ jsx(Button, {
|
|
383
|
+
variant: "ghost",
|
|
384
|
+
color: "secondary",
|
|
385
|
+
width: "hug",
|
|
386
|
+
onPress: onReset,
|
|
387
|
+
children: t(($_4) => $_4.ui.table.reset)
|
|
388
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
389
|
+
variant: "contained",
|
|
390
|
+
color: "primary",
|
|
391
|
+
width: "hug",
|
|
392
|
+
onPress: close,
|
|
393
|
+
children: t(($_5) => $_5.ui.table.done)
|
|
394
|
+
})]
|
|
395
|
+
})
|
|
396
|
+
] })
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
//#endregion
|
|
43
400
|
//#region src/components/table/HeaderText.tsx
|
|
44
401
|
const HeaderText = (props) => {
|
|
45
402
|
const uiConfig = UIConfig.useConfig();
|
|
@@ -62,6 +419,18 @@ const Selectors = {
|
|
|
62
419
|
/** Selector from here: https://github.com/Shopify/polaris/blob/main/polaris-react/src/utilities/focus.ts#L10 */
|
|
63
420
|
Focusable: "a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not([aria-disabled=\"true\"]):not([tabindex=\"-1\"]):not(:disabled),*[tabindex]"
|
|
64
421
|
};
|
|
422
|
+
const NON_TEXT_INPUT_TYPES = /* @__PURE__ */ new Set([
|
|
423
|
+
"checkbox",
|
|
424
|
+
"radio",
|
|
425
|
+
"button",
|
|
426
|
+
"submit",
|
|
427
|
+
"reset",
|
|
428
|
+
"range",
|
|
429
|
+
"color",
|
|
430
|
+
"file",
|
|
431
|
+
"image"
|
|
432
|
+
]);
|
|
433
|
+
const isTextEntry = (element) => element instanceof HTMLInputElement && !NON_TEXT_INPUT_TYPES.has(element.type) || element instanceof HTMLTextAreaElement || element instanceof HTMLSelectElement || element instanceof HTMLElement && element.isContentEditable;
|
|
65
434
|
var DataGridNav = class {
|
|
66
435
|
constructor(config = {}) {
|
|
67
436
|
this.keys = [];
|
|
@@ -96,7 +465,10 @@ var DataGridNav = class {
|
|
|
96
465
|
}
|
|
97
466
|
tableKeyDown(e) {
|
|
98
467
|
if (this.disabled) return;
|
|
99
|
-
|
|
468
|
+
const isArrowKey = "ArrowDown" === e.key || "ArrowUp" === e.key || "ArrowLeft" === e.key || "ArrowRight" === e.key;
|
|
469
|
+
if (isArrowKey && e.target instanceof Element && isTextEntry(e.target)) return;
|
|
470
|
+
if (e.target instanceof Element && !e.target.closest(this.selectors.Row)) return;
|
|
471
|
+
if (isArrowKey) e.preventDefault();
|
|
100
472
|
if (this.keys.length === 0 || this.keys[this.keys.length - 1] !== e.key) this.keys.push(e.key);
|
|
101
473
|
if (!(e.target instanceof Element)) return;
|
|
102
474
|
const cell = e.target.parentElement?.closest(`${this.selectors.Cell},${this.selectors.Row}`);
|
|
@@ -114,35 +486,29 @@ var DataGridNav = class {
|
|
|
114
486
|
}
|
|
115
487
|
}
|
|
116
488
|
/**
|
|
117
|
-
* Keys:
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
* Arrow Down disabled:
|
|
121
|
-
* https://github.com/w3c/aria-practices/issues/2739#issuecomment-1613538972
|
|
489
|
+
* Keys: ArrowUp, ArrowDown
|
|
490
|
+
* Leave the widget for the cell above or below, so a header button or a row checkbox leads into the grid.
|
|
122
491
|
*/
|
|
123
|
-
if (e.key === "
|
|
124
|
-
|
|
125
|
-
if (!cell) return;
|
|
126
|
-
const focusableWidgets = [...cell.querySelectorAll(this.selectors.Focusable)];
|
|
127
|
-
const widgetIdx = focusableWidgets.findIndex((el) => el === e.target);
|
|
128
|
-
const widgetToFocus = focusableWidgets[widgetIdx === focusableWidgets.length - 1 ? 0 : widgetIdx + 1];
|
|
129
|
-
if (this.isFocusable(widgetToFocus)) widgetToFocus.focus();
|
|
492
|
+
if (e.key === "ArrowUp" || e.key === "ArrowDown") {
|
|
493
|
+
this.verticalCellNavigation(e);
|
|
130
494
|
return;
|
|
131
495
|
}
|
|
132
496
|
/**
|
|
133
|
-
* Keys:
|
|
134
|
-
* Move to the previous
|
|
135
|
-
*
|
|
136
|
-
* Arrow Up disabled:
|
|
137
|
-
* https://github.com/w3c/aria-practices/issues/2739#issuecomment-1613538972
|
|
497
|
+
* Keys: ArrowRight, ArrowLeft
|
|
498
|
+
* Move to the next or previous widget in the cell; past the cell's last or first widget, to the next or previous cell.
|
|
138
499
|
*/
|
|
139
|
-
if (e.key === "
|
|
500
|
+
if (e.key === "ArrowRight" || e.key === "ArrowLeft") {
|
|
140
501
|
const cell = e.target.closest(this.selectors.Cell);
|
|
141
502
|
if (!cell) return;
|
|
503
|
+
const direction = e.key === "ArrowRight" ? 1 : -1;
|
|
142
504
|
const focusableWidgets = [...cell.querySelectorAll(this.selectors.Focusable)];
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
|
|
505
|
+
const widgetToFocus = focusableWidgets[focusableWidgets.findIndex((el) => el === e.target) + direction];
|
|
506
|
+
if (widgetToFocus && this.isFocusable(widgetToFocus)) {
|
|
507
|
+
widgetToFocus.focus();
|
|
508
|
+
return;
|
|
509
|
+
}
|
|
510
|
+
const siblingCell = direction > 0 ? cell.nextElementSibling : cell.previousElementSibling;
|
|
511
|
+
if (siblingCell && this.isFocusable(siblingCell)) siblingCell.focus();
|
|
146
512
|
}
|
|
147
513
|
}
|
|
148
514
|
gridNavigation(e) {
|
|
@@ -282,6 +648,14 @@ var DataGridNav = class {
|
|
|
282
648
|
return position;
|
|
283
649
|
}
|
|
284
650
|
};
|
|
651
|
+
/**
|
|
652
|
+
* Arrow-key cell navigation for a hand-built `<table>` or ARIA grid: spread `listeners` on the table element.
|
|
653
|
+
* `Table` and `InfiniteTable` already use it; don't add it to them.
|
|
654
|
+
*
|
|
655
|
+
* Arrows move between cells; from a widget inside a cell, Left/Right step through the cell's widgets and then on to the
|
|
656
|
+
* next cell, and Up/Down move to the cell above or below. Escape moves from a widget to its cell. Text fields keep
|
|
657
|
+
* their arrow keys. Give one cell `tabIndex={0}` and the rest `-1` so Tab can reach the grid.
|
|
658
|
+
*/
|
|
285
659
|
function useTableNav(options) {
|
|
286
660
|
const nav = new DataGridNav(options);
|
|
287
661
|
return {
|
|
@@ -510,10 +884,23 @@ const RowDetailsRow = (t0) => {
|
|
|
510
884
|
} else t6 = $[17];
|
|
511
885
|
return t6;
|
|
512
886
|
};
|
|
513
|
-
|
|
887
|
+
/** The panel's name when the table passes no `title`. */
|
|
888
|
+
const useDefaultTitle = () => {
|
|
889
|
+
const $ = c(2);
|
|
890
|
+
const { t } = useTranslation("ui");
|
|
891
|
+
let t0;
|
|
892
|
+
if ($[0] !== t) {
|
|
893
|
+
t0 = t(_temp$2);
|
|
894
|
+
$[0] = t;
|
|
895
|
+
$[1] = t0;
|
|
896
|
+
} else t0 = $[1];
|
|
897
|
+
return t0;
|
|
898
|
+
};
|
|
514
899
|
const SidePanelContent = (t0) => {
|
|
515
|
-
const $ = c(
|
|
900
|
+
const $ = c(21);
|
|
516
901
|
const { title, onClose, children } = t0;
|
|
902
|
+
const { t } = useTranslation("ui");
|
|
903
|
+
const defaultTitle = useDefaultTitle();
|
|
517
904
|
const headerCva = UIOverrides.useCva("table.sidePanelHeaderCva", tableSidePanelHeaderDefinition);
|
|
518
905
|
const bodyCva = UIOverrides.useCva("table.sidePanelBodyCva", tableSidePanelBodyDefinition);
|
|
519
906
|
let t1;
|
|
@@ -522,7 +909,7 @@ const SidePanelContent = (t0) => {
|
|
|
522
909
|
$[0] = headerCva;
|
|
523
910
|
$[1] = t1;
|
|
524
911
|
} else t1 = $[1];
|
|
525
|
-
const t2 = title ??
|
|
912
|
+
const t2 = title ?? defaultTitle;
|
|
526
913
|
let t3;
|
|
527
914
|
if ($[2] !== t2) {
|
|
528
915
|
t3 = /* @__PURE__ */ jsx(Typography, {
|
|
@@ -535,60 +922,68 @@ const SidePanelContent = (t0) => {
|
|
|
535
922
|
$[3] = t3;
|
|
536
923
|
} else t3 = $[3];
|
|
537
924
|
let t4;
|
|
538
|
-
if ($[4] !==
|
|
539
|
-
t4 =
|
|
925
|
+
if ($[4] !== t) {
|
|
926
|
+
t4 = t(_temp2$2);
|
|
927
|
+
$[4] = t;
|
|
928
|
+
$[5] = t4;
|
|
929
|
+
} else t4 = $[5];
|
|
930
|
+
let t5;
|
|
931
|
+
if ($[6] !== onClose || $[7] !== t4) {
|
|
932
|
+
t5 = /* @__PURE__ */ jsx(IconButton, {
|
|
540
933
|
variant: "text",
|
|
541
934
|
size: "sm",
|
|
542
935
|
width: "hug",
|
|
543
936
|
disableTooltip: true,
|
|
544
|
-
label:
|
|
937
|
+
label: t4,
|
|
545
938
|
icon: X,
|
|
546
939
|
className: "shrink-0 pointer-coarse:size-8",
|
|
547
940
|
onPress: onClose
|
|
548
941
|
});
|
|
549
|
-
$[
|
|
550
|
-
$[
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
942
|
+
$[6] = onClose;
|
|
943
|
+
$[7] = t4;
|
|
944
|
+
$[8] = t5;
|
|
945
|
+
} else t5 = $[8];
|
|
946
|
+
let t6;
|
|
947
|
+
if ($[9] !== t1 || $[10] !== t3 || $[11] !== t5) {
|
|
948
|
+
t6 = /* @__PURE__ */ jsxs("div", {
|
|
555
949
|
className: t1,
|
|
556
|
-
children: [t3,
|
|
950
|
+
children: [t3, t5]
|
|
557
951
|
});
|
|
558
|
-
$[
|
|
559
|
-
$[
|
|
560
|
-
$[
|
|
561
|
-
$[
|
|
562
|
-
} else
|
|
563
|
-
let t6;
|
|
564
|
-
if ($[10] !== bodyCva) {
|
|
565
|
-
t6 = bodyCva({});
|
|
566
|
-
$[10] = bodyCva;
|
|
567
|
-
$[11] = t6;
|
|
568
|
-
} else t6 = $[11];
|
|
952
|
+
$[9] = t1;
|
|
953
|
+
$[10] = t3;
|
|
954
|
+
$[11] = t5;
|
|
955
|
+
$[12] = t6;
|
|
956
|
+
} else t6 = $[12];
|
|
569
957
|
let t7;
|
|
570
|
-
if ($[
|
|
571
|
-
t7 =
|
|
572
|
-
|
|
573
|
-
children
|
|
574
|
-
});
|
|
575
|
-
$[12] = children;
|
|
576
|
-
$[13] = t6;
|
|
958
|
+
if ($[13] !== bodyCva) {
|
|
959
|
+
t7 = bodyCva({});
|
|
960
|
+
$[13] = bodyCva;
|
|
577
961
|
$[14] = t7;
|
|
578
962
|
} else t7 = $[14];
|
|
579
963
|
let t8;
|
|
580
|
-
if ($[15] !==
|
|
581
|
-
t8 = /* @__PURE__ */
|
|
582
|
-
|
|
964
|
+
if ($[15] !== children || $[16] !== t7) {
|
|
965
|
+
t8 = /* @__PURE__ */ jsx("div", {
|
|
966
|
+
className: t7,
|
|
967
|
+
children
|
|
968
|
+
});
|
|
969
|
+
$[15] = children;
|
|
583
970
|
$[16] = t7;
|
|
584
971
|
$[17] = t8;
|
|
585
972
|
} else t8 = $[17];
|
|
586
|
-
|
|
973
|
+
let t9;
|
|
974
|
+
if ($[18] !== t6 || $[19] !== t8) {
|
|
975
|
+
t9 = /* @__PURE__ */ jsxs(Fragment$1, { children: [t6, t8] });
|
|
976
|
+
$[18] = t6;
|
|
977
|
+
$[19] = t8;
|
|
978
|
+
$[20] = t9;
|
|
979
|
+
} else t9 = $[20];
|
|
980
|
+
return t9;
|
|
587
981
|
};
|
|
588
982
|
const RowDetailsDrawer = (t0) => {
|
|
589
983
|
const $ = c(11);
|
|
590
984
|
const { isOpen, title, onClose, children } = t0;
|
|
591
|
-
const
|
|
985
|
+
const defaultTitle = useDefaultTitle();
|
|
986
|
+
const t1 = title ?? defaultTitle;
|
|
592
987
|
let t2;
|
|
593
988
|
if ($[0] !== onClose) {
|
|
594
989
|
t2 = (open) => {
|
|
@@ -615,8 +1010,7 @@ const RowDetailsDrawer = (t0) => {
|
|
|
615
1010
|
label: t1,
|
|
616
1011
|
isOpen,
|
|
617
1012
|
onOpenChange: t2,
|
|
618
|
-
|
|
619
|
-
dialogClassName: "h-full w-[min(30rem,100vw)] overflow-y-auto",
|
|
1013
|
+
contentClassName: "h-full w-[min(30rem,100vw)] overflow-y-auto",
|
|
620
1014
|
children: t3
|
|
621
1015
|
});
|
|
622
1016
|
$[6] = isOpen;
|
|
@@ -631,7 +1025,8 @@ const RowDetailsSplitPanel = (t0) => {
|
|
|
631
1025
|
const $ = c(16);
|
|
632
1026
|
const { title, onClose, maxHeight, children } = t0;
|
|
633
1027
|
const panelCva = UIOverrides.useCva("table.sidePanelCva", tableSidePanelDefinition);
|
|
634
|
-
const
|
|
1028
|
+
const defaultTitle = useDefaultTitle();
|
|
1029
|
+
const t1 = title ?? defaultTitle;
|
|
635
1030
|
let t2;
|
|
636
1031
|
if ($[0] !== panelCva) {
|
|
637
1032
|
t2 = panelCva({});
|
|
@@ -682,6 +1077,45 @@ const RowDetailsSplitPanel = (t0) => {
|
|
|
682
1077
|
} else t6 = $[15];
|
|
683
1078
|
return t6;
|
|
684
1079
|
};
|
|
1080
|
+
function _temp$2($) {
|
|
1081
|
+
return $.ui.table.rowDetails;
|
|
1082
|
+
}
|
|
1083
|
+
function _temp2$2($) {
|
|
1084
|
+
return $.ui.table.closeDetails;
|
|
1085
|
+
}
|
|
1086
|
+
//#endregion
|
|
1087
|
+
//#region src/components/table/TableRowSelection.tsx
|
|
1088
|
+
const SELECT_COLUMN_ID = "row-select";
|
|
1089
|
+
/** Header of the selection column: select-all for multi selection, a hidden column name for single selection. */
|
|
1090
|
+
const RowSelectionHeader = ({ table }) => {
|
|
1091
|
+
const { t } = useTranslation("ui");
|
|
1092
|
+
if (table.options.enableMultiRowSelection === false) return /* @__PURE__ */ jsx("span", {
|
|
1093
|
+
className: "sr-only",
|
|
1094
|
+
children: t(($) => $.ui.table.rowSelection)
|
|
1095
|
+
});
|
|
1096
|
+
const isAllSelected = table.getIsAllPageRowsSelected();
|
|
1097
|
+
const isSomeSelected = table.getIsSomePageRowsSelected();
|
|
1098
|
+
return /* @__PURE__ */ jsx(Checkbox, {
|
|
1099
|
+
isSelected: isAllSelected,
|
|
1100
|
+
isIndeterminate: isSomeSelected && !isAllSelected,
|
|
1101
|
+
isDisabled: !table.getRowModel().rows.some((row) => row.getCanSelect()),
|
|
1102
|
+
onChange: () => table.toggleAllPageRowsSelected(!isAllSelected && !isSomeSelected),
|
|
1103
|
+
hideLabel: true,
|
|
1104
|
+
hideError: true,
|
|
1105
|
+
children: t(($_0) => $_0.ui.table.selectAllRows)
|
|
1106
|
+
});
|
|
1107
|
+
};
|
|
1108
|
+
const RowSelectionCell = ({ row }) => {
|
|
1109
|
+
const { t } = useTranslation("ui");
|
|
1110
|
+
return /* @__PURE__ */ jsx(Checkbox, {
|
|
1111
|
+
isSelected: row.getIsSelected(),
|
|
1112
|
+
isDisabled: !row.getCanSelect(),
|
|
1113
|
+
onChange: (isSelected) => row.toggleSelected(isSelected),
|
|
1114
|
+
hideLabel: true,
|
|
1115
|
+
hideError: true,
|
|
1116
|
+
children: t(($) => $.ui.table.selectRow, { row: row.index + 1 })
|
|
1117
|
+
});
|
|
1118
|
+
};
|
|
685
1119
|
const DEFAULT_WIDTH = 150;
|
|
686
1120
|
const KEYBOARD_STEP = 10;
|
|
687
1121
|
const KEYBOARD_STEP_LARGE = 50;
|
|
@@ -727,12 +1161,12 @@ const useColumnResize = (t0) => {
|
|
|
727
1161
|
$[11] = t4;
|
|
728
1162
|
} else t4 = $[11];
|
|
729
1163
|
const tableStyle = t4;
|
|
730
|
-
const clamp = _temp$
|
|
1164
|
+
const clamp = _temp$1;
|
|
731
1165
|
let t5;
|
|
732
1166
|
if ($[12] !== columnSizing || $[13] !== columns || $[14] !== theadRef) {
|
|
733
1167
|
t5 = () => {
|
|
734
1168
|
const sizes_0 = { ...columnSizing };
|
|
735
|
-
const leafColumnIds = new Set(columns.map(_temp2$
|
|
1169
|
+
const leafColumnIds = new Set(columns.map(_temp2$1));
|
|
736
1170
|
theadRef.current?.querySelectorAll("th[data-column-id]").forEach((header) => {
|
|
737
1171
|
const columnId_0 = header.dataset.columnId;
|
|
738
1172
|
if (leafColumnIds.has(columnId_0)) sizes_0[columnId_0] = Math.round(header.getBoundingClientRect().width);
|
|
@@ -867,10 +1301,10 @@ const useColumnResize = (t0) => {
|
|
|
867
1301
|
} else t10 = $[38];
|
|
868
1302
|
return t10;
|
|
869
1303
|
};
|
|
870
|
-
function _temp$
|
|
1304
|
+
function _temp$1(column_0, width) {
|
|
871
1305
|
return Math.round(Math.min(column_0.maxSize ?? Infinity, Math.max(column_0.minSize ?? 60, width)));
|
|
872
1306
|
}
|
|
873
|
-
function _temp2$
|
|
1307
|
+
function _temp2$1(column_1) {
|
|
874
1308
|
return column_1.id;
|
|
875
1309
|
}
|
|
876
1310
|
function _temp3$1(col_0) {
|
|
@@ -878,10 +1312,10 @@ function _temp3$1(col_0) {
|
|
|
878
1312
|
}
|
|
879
1313
|
//#endregion
|
|
880
1314
|
//#region src/components/table/Table.tsx
|
|
881
|
-
const DndProvider = lazy(() =>
|
|
882
|
-
const SortableRows = lazy(() =>
|
|
883
|
-
const DraggableRow = lazy(() =>
|
|
884
|
-
const DragHandle = lazy(() =>
|
|
1315
|
+
const DndProvider = lazy(() => Promise.resolve().then(() => TableDnd_exports).then((module) => ({ default: module.DndProvider })));
|
|
1316
|
+
const SortableRows = lazy(() => Promise.resolve().then(() => TableDnd_exports).then((module) => ({ default: module.SortableRows })));
|
|
1317
|
+
const DraggableRow = lazy(() => Promise.resolve().then(() => TableDnd_exports).then((module) => ({ default: module.DraggableRow })));
|
|
1318
|
+
const DragHandle = lazy(() => Promise.resolve().then(() => TableDnd_exports).then((module) => ({ default: module.DragHandle })));
|
|
885
1319
|
const tableFeaturesConfig = tableFeatures({
|
|
886
1320
|
...stockFeatures,
|
|
887
1321
|
sortedRowModel: createSortedRowModel(),
|
|
@@ -904,40 +1338,45 @@ const renderCell = (Comp, props) => /* @__PURE__ */ jsx(CellContent, {
|
|
|
904
1338
|
cell: Comp,
|
|
905
1339
|
props
|
|
906
1340
|
});
|
|
907
|
-
const RowDragHandleCell = ({
|
|
1341
|
+
const RowDragHandleCell = ({ row }) => {
|
|
1342
|
+
const { t } = useTranslation("ui");
|
|
908
1343
|
return /* @__PURE__ */ jsx(DragHandle, {
|
|
909
|
-
id:
|
|
910
|
-
|
|
911
|
-
...dragProps,
|
|
912
|
-
className: "cursor-move p-1",
|
|
913
|
-
label: "Drag handle",
|
|
914
|
-
icon: GripVertical,
|
|
915
|
-
variant: "text",
|
|
916
|
-
width: "hug",
|
|
917
|
-
disableTooltip: true,
|
|
918
|
-
size: "sm"
|
|
919
|
-
})
|
|
1344
|
+
id: row.id,
|
|
1345
|
+
label: t(($) => $.ui.table.reorderRow, { row: row.index + 1 })
|
|
920
1346
|
});
|
|
921
1347
|
};
|
|
922
|
-
const
|
|
923
|
-
const
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
},
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
}
|
|
1348
|
+
const ColumnResizeHandle = ({ columnName, isResizing, minWidth, maxWidth, ...props }) => {
|
|
1349
|
+
const ref = useRef(null);
|
|
1350
|
+
const [width, setWidth] = useState();
|
|
1351
|
+
useLayoutEffect(() => {
|
|
1352
|
+
const header = ref.current?.closest("th");
|
|
1353
|
+
if (!header) return;
|
|
1354
|
+
const measure = () => setWidth(Math.round(header.getBoundingClientRect().width));
|
|
1355
|
+
measure();
|
|
1356
|
+
const observer = new ResizeObserver(measure);
|
|
1357
|
+
observer.observe(header);
|
|
1358
|
+
return () => observer.disconnect();
|
|
1359
|
+
}, []);
|
|
1360
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1361
|
+
ref,
|
|
1362
|
+
role: "separator",
|
|
1363
|
+
"aria-orientation": "vertical",
|
|
1364
|
+
"aria-label": `Resize ${columnName}`,
|
|
1365
|
+
"aria-valuenow": width,
|
|
1366
|
+
"aria-valuemin": minWidth,
|
|
1367
|
+
"aria-valuemax": maxWidth,
|
|
1368
|
+
tabIndex: 0,
|
|
1369
|
+
"data-resizing": isResizing || void 0,
|
|
1370
|
+
className: clsx("absolute inset-y-0 right-0 z-raised w-2 pointer-coarse:w-6 cursor-col-resize touch-none select-none outline-none", "after:absolute after:inset-y-1 after:right-0 after:w-0.5 after:rounded-full after:transition-colors", "hover:after:bg-card-foreground focus-visible:after:bg-ring", "data-resizing:after:bg-card-foreground"),
|
|
1371
|
+
...props
|
|
1372
|
+
});
|
|
1373
|
+
};
|
|
1374
|
+
const DRAG_COLUMN_ID = "drag-handle";
|
|
1375
|
+
const isOwnColumn = (columnId) => columnId === DRAG_COLUMN_ID || columnId === "row-select" || columnId === "row-expand";
|
|
939
1376
|
const ROW_CONTROL_SELECTOR = "button, a, input, select, textarea, label, [role=button], [role=checkbox], [role=switch], [role=combobox], [role=separator]";
|
|
940
1377
|
const isFromRowControl = (event) => event.target instanceof Element && event.target.closest(ROW_CONTROL_SELECTOR) !== null;
|
|
1378
|
+
const isFromSelectCell = (event) => event.target instanceof Element && event.target.closest("td[data-select-cell]") !== null;
|
|
1379
|
+
const isRowActionKey = (event) => event.key === "Enter" && event.target instanceof HTMLTableCellElement && !event.target.hasAttribute("data-select-cell") && !event.target.querySelector(ROW_CONTROL_SELECTOR);
|
|
941
1380
|
const EMPTY_PINNING = {
|
|
942
1381
|
start: [],
|
|
943
1382
|
end: []
|
|
@@ -958,7 +1397,7 @@ const getPinnedProps = (column, pinnedOffsets) => {
|
|
|
958
1397
|
"data-column-id": column.id
|
|
959
1398
|
};
|
|
960
1399
|
};
|
|
961
|
-
const Table = ({ items, showCellBorder, columns,
|
|
1400
|
+
const Table = ({ items, showCellBorder, columns, onRowAction, onRowDoubleClick, isLoading = false, emptyState, className, variant: variantProp, containerClassName, maxHeight, scroll = "table", sorting, onSortingChange, columnOrder, onColumnOrderChange, columnVisibility, onColumnVisibilityChange, enableColumnPinning = false, columnPinning: columnPinningProp, onColumnPinningChange, enableColumnResizing = false, columnSizing: columnSizingProp, onColumnSizingChange, rowDetails, expanded: expandedProp, onExpandedChange, bulkSelectionActions: ActionHeader, enableDragDrop = false, onDragEnd, onReorder, getRowId, enableRowSelection, enableMultiRowSelection = true, rowSelection: rowSelectionProp, defaultRowSelection, onRowSelectionChange, ...props }) => {
|
|
962
1401
|
const uiConfig = UIConfig.useConfig();
|
|
963
1402
|
const variant = variantProp ?? uiConfig.table.variant;
|
|
964
1403
|
const showColumnBorders = showCellBorder ?? (variant !== "horizontals" && variant !== "zebra" && variant !== "striped-columns");
|
|
@@ -968,21 +1407,60 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
968
1407
|
const tableHeadRowCva = UIOverrides.useCva("table.headRowCva", tableHeadRowDefinition);
|
|
969
1408
|
const tableHeadDataCva = UIOverrides.useCva("table.headDataCva", tableHeadDataDefinition);
|
|
970
1409
|
const tableDataCva = UIOverrides.useCva("table.dataCva", tableDataDefinition);
|
|
971
|
-
const
|
|
1410
|
+
const { t } = useTranslation("ui");
|
|
972
1411
|
const { listeners } = useTableNav({ selectors: { Row: "tr:not([data-details-row])" } });
|
|
973
1412
|
const data = useMemo(() => items ?? [], [items]);
|
|
974
|
-
const
|
|
975
|
-
const
|
|
976
|
-
|
|
1413
|
+
const tabStopCellRef = useRef(null);
|
|
1414
|
+
const syncTabStopCell = (tbody) => {
|
|
1415
|
+
if (!tbody) return;
|
|
1416
|
+
const current = tabStopCellRef.current;
|
|
1417
|
+
if (current?.isConnected && tbody.contains(current)) return;
|
|
1418
|
+
const first = tbody.querySelector(":scope > tr:not([data-details-row], [data-status-row]) > td");
|
|
1419
|
+
if (first) first.tabIndex = 0;
|
|
1420
|
+
tabStopCellRef.current = first;
|
|
1421
|
+
};
|
|
1422
|
+
const moveTabStopCell = (event) => {
|
|
1423
|
+
const cell = event.target.closest("td");
|
|
1424
|
+
if (!cell || cell === tabStopCellRef.current || cell.closest("tbody") !== event.currentTarget || cell.parentElement?.matches("[data-details-row], [data-status-row]")) return;
|
|
1425
|
+
if (tabStopCellRef.current) tabStopCellRef.current.tabIndex = -1;
|
|
1426
|
+
cell.tabIndex = 0;
|
|
1427
|
+
tabStopCellRef.current = cell;
|
|
1428
|
+
};
|
|
1429
|
+
const [internalRowSelection, setInternalRowSelection] = useState(() => defaultRowSelection ?? {});
|
|
1430
|
+
const isRowSelectionControlled = rowSelectionProp !== void 0;
|
|
1431
|
+
const rowSelection = rowSelectionProp ?? internalRowSelection;
|
|
977
1432
|
const handleRowSelectionChange = useCallback((updater) => {
|
|
978
|
-
if (!
|
|
1433
|
+
if (!isRowSelectionControlled) setInternalRowSelection(updater);
|
|
979
1434
|
onRowSelectionChange?.(updater);
|
|
980
|
-
}, [
|
|
1435
|
+
}, [isRowSelectionControlled, onRowSelectionChange]);
|
|
981
1436
|
const baseColumns = useMemo(() => typeof columns === "function" ? columns(i18next.t) : columns, [columns]);
|
|
982
1437
|
const rowDetailsMode = rowDetails && !enableDragDrop ? rowDetails.mode ?? uiConfig.table.rowDetailsMode : void 0;
|
|
983
1438
|
const hasExpandColumn = rowDetailsMode === "expand";
|
|
1439
|
+
const hasDragColumn = enableDragDrop && !!getRowId;
|
|
1440
|
+
const hasSelectColumn = !!enableRowSelection;
|
|
984
1441
|
const tableColumns = useMemo(() => {
|
|
985
|
-
|
|
1442
|
+
const ownColumns = [];
|
|
1443
|
+
const ownColumnOptions = {
|
|
1444
|
+
enableSorting: false,
|
|
1445
|
+
enablePinning: false,
|
|
1446
|
+
enableResizing: false,
|
|
1447
|
+
enableHiding: false
|
|
1448
|
+
};
|
|
1449
|
+
if (hasDragColumn) ownColumns.push({
|
|
1450
|
+
id: DRAG_COLUMN_ID,
|
|
1451
|
+
header: "",
|
|
1452
|
+
meta: { width: "w-12" },
|
|
1453
|
+
cell: RowDragHandleCell,
|
|
1454
|
+
...ownColumnOptions
|
|
1455
|
+
});
|
|
1456
|
+
if (hasSelectColumn) ownColumns.push({
|
|
1457
|
+
id: SELECT_COLUMN_ID,
|
|
1458
|
+
header: "",
|
|
1459
|
+
meta: { width: "w-10" },
|
|
1460
|
+
cell: ({ row }) => /* @__PURE__ */ jsx(RowSelectionCell, { row }),
|
|
1461
|
+
...ownColumnOptions
|
|
1462
|
+
});
|
|
1463
|
+
if (hasExpandColumn) ownColumns.push({
|
|
986
1464
|
id: EXPAND_COLUMN_ID,
|
|
987
1465
|
header: () => /* @__PURE__ */ jsx("span", {
|
|
988
1466
|
className: "sr-only",
|
|
@@ -994,48 +1472,45 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
994
1472
|
cellClass: "px-1"
|
|
995
1473
|
},
|
|
996
1474
|
cell: RowExpandCell,
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
}, ...baseColumns];
|
|
1001
|
-
if (enableDragDrop && getRowId) return [{
|
|
1002
|
-
id: "drag-handle",
|
|
1003
|
-
header: "",
|
|
1004
|
-
meta: { width: "w-12" },
|
|
1005
|
-
cell: AutoDragHandleCell,
|
|
1006
|
-
enableSorting: false,
|
|
1007
|
-
enablePinning: false,
|
|
1008
|
-
enableResizing: false
|
|
1009
|
-
}, ...baseColumns];
|
|
1010
|
-
return baseColumns;
|
|
1475
|
+
...ownColumnOptions
|
|
1476
|
+
});
|
|
1477
|
+
return ownColumns.length > 0 ? [...ownColumns, ...baseColumns] : baseColumns;
|
|
1011
1478
|
}, [
|
|
1012
1479
|
baseColumns,
|
|
1013
|
-
|
|
1014
|
-
|
|
1480
|
+
hasDragColumn,
|
|
1481
|
+
hasSelectColumn,
|
|
1015
1482
|
hasExpandColumn
|
|
1016
1483
|
]);
|
|
1484
|
+
const ownColumnIds = [
|
|
1485
|
+
...hasDragColumn ? [DRAG_COLUMN_ID] : [],
|
|
1486
|
+
...hasSelectColumn ? [SELECT_COLUMN_ID] : [],
|
|
1487
|
+
...hasExpandColumn ? [EXPAND_COLUMN_ID] : []
|
|
1488
|
+
];
|
|
1489
|
+
const withOwnColumns = (order) => order.length > 0 ? [...ownColumnIds, ...order.filter((id) => !isOwnColumn(id))] : order;
|
|
1490
|
+
const handleColumnOrderChange = (updater_0) => onColumnOrderChange?.((previous) => (typeof updater_0 === "function" ? updater_0(withOwnColumns(previous)) : updater_0).filter((id_0) => !isOwnColumn(id_0)));
|
|
1017
1491
|
const [internalColumnPinning, setInternalColumnPinning] = useState(EMPTY_PINNING);
|
|
1018
1492
|
const columnPinning = columnPinningProp ?? internalColumnPinning;
|
|
1019
|
-
const setColumnPinning =
|
|
1020
|
-
const
|
|
1021
|
-
const
|
|
1493
|
+
const setColumnPinning = onColumnPinningChange ?? setInternalColumnPinning;
|
|
1494
|
+
const pinnedOwnColumnIds = columnPinning.start.length > 0 ? ownColumnIds : [];
|
|
1495
|
+
const hasPinnedOwnColumns = pinnedOwnColumnIds.length > 0;
|
|
1496
|
+
const withPinnedOwnColumns = (pinning) => hasPinnedOwnColumns ? {
|
|
1022
1497
|
...pinning,
|
|
1023
|
-
start: [
|
|
1498
|
+
start: [...pinnedOwnColumnIds, ...pinning.start]
|
|
1024
1499
|
} : pinning;
|
|
1025
|
-
const tablePinning =
|
|
1026
|
-
const handleColumnPinningChange = (
|
|
1027
|
-
const next = typeof
|
|
1500
|
+
const tablePinning = withPinnedOwnColumns(columnPinning);
|
|
1501
|
+
const handleColumnPinningChange = (updater_1) => setColumnPinning((previous_0) => {
|
|
1502
|
+
const next = typeof updater_1 === "function" ? updater_1(withPinnedOwnColumns(previous_0)) : updater_1;
|
|
1028
1503
|
return {
|
|
1029
1504
|
...next,
|
|
1030
|
-
start: next.start.filter((
|
|
1505
|
+
start: next.start.filter((id_1) => !isOwnColumn(id_1))
|
|
1031
1506
|
};
|
|
1032
1507
|
});
|
|
1033
1508
|
const [internalExpanded, setInternalExpanded] = useState({});
|
|
1034
1509
|
const expanded = expandedProp ?? internalExpanded;
|
|
1035
|
-
const setExpanded =
|
|
1510
|
+
const setExpanded = onExpandedChange ?? setInternalExpanded;
|
|
1036
1511
|
const [internalColumnSizing, setInternalColumnSizing] = useState(EMPTY_SIZING);
|
|
1037
1512
|
const columnSizing = enableColumnResizing && (columnSizingProp ?? internalColumnSizing) || EMPTY_SIZING;
|
|
1038
|
-
const setColumnSizing =
|
|
1513
|
+
const setColumnSizing = onColumnSizingChange ?? setInternalColumnSizing;
|
|
1039
1514
|
const [isSticky, setIsSticky] = useState(false);
|
|
1040
1515
|
const [isStuckStart, setIsStuckStart] = useState(false);
|
|
1041
1516
|
const [isStuckEnd, setIsStuckEnd] = useState(false);
|
|
@@ -1070,7 +1545,7 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
1070
1545
|
columns: tableColumns,
|
|
1071
1546
|
state: {
|
|
1072
1547
|
sorting,
|
|
1073
|
-
columnOrder,
|
|
1548
|
+
columnOrder: columnOrder && withOwnColumns(columnOrder),
|
|
1074
1549
|
columnVisibility,
|
|
1075
1550
|
columnPinning: tablePinning,
|
|
1076
1551
|
columnSizing,
|
|
@@ -1078,38 +1553,39 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
1078
1553
|
},
|
|
1079
1554
|
rowCount: items.length,
|
|
1080
1555
|
manualPagination: true,
|
|
1081
|
-
onColumnOrderChange:
|
|
1082
|
-
onColumnVisibilityChange
|
|
1556
|
+
onColumnOrderChange: handleColumnOrderChange,
|
|
1557
|
+
onColumnVisibilityChange,
|
|
1083
1558
|
onColumnPinningChange: handleColumnPinningChange,
|
|
1084
1559
|
onColumnSizingChange: setColumnSizing,
|
|
1085
|
-
onSortingChange
|
|
1560
|
+
onSortingChange,
|
|
1086
1561
|
onRowSelectionChange: handleRowSelectionChange,
|
|
1087
1562
|
manualSorting: true,
|
|
1563
|
+
enableSorting: onSortingChange !== void 0,
|
|
1088
1564
|
autoResetPageIndex: false,
|
|
1089
1565
|
autoResetExpanded: false,
|
|
1090
1566
|
defaultColumn: {
|
|
1091
1567
|
sortDescFirst: true,
|
|
1092
1568
|
minSize: 60
|
|
1093
1569
|
},
|
|
1094
|
-
enableRowSelection,
|
|
1570
|
+
enableRowSelection: enableRowSelection ?? false,
|
|
1095
1571
|
enableMultiRowSelection,
|
|
1096
|
-
getRowId: getRowId ? (
|
|
1572
|
+
getRowId: getRowId ? (row_0) => String(getRowId(row_0)) : void 0
|
|
1097
1573
|
});
|
|
1098
1574
|
const dataIds = useMemo(() => {
|
|
1099
1575
|
if (!enableDragDrop || !getRowId) return [];
|
|
1100
|
-
return data.map((item) => getRowId(item));
|
|
1576
|
+
return data.map((item) => String(getRowId(item)));
|
|
1101
1577
|
}, [
|
|
1102
1578
|
data,
|
|
1103
1579
|
enableDragDrop,
|
|
1104
1580
|
getRowId
|
|
1105
1581
|
]);
|
|
1106
|
-
const handleDragEnd = useCallback((
|
|
1107
|
-
const { active, over } =
|
|
1582
|
+
const handleDragEnd = useCallback((event_0) => {
|
|
1583
|
+
const { active, over } = event_0;
|
|
1108
1584
|
if (!active || !over || active.id === over.id) return;
|
|
1109
1585
|
if (getRowId && (onReorder || onDragEnd)) {
|
|
1110
1586
|
if (onReorder) {
|
|
1111
|
-
const oldIndex = items.findIndex((item_0) => getRowId(item_0) === active.id);
|
|
1112
|
-
const newIndex = items.findIndex((item_1) => getRowId(item_1) === over.id);
|
|
1587
|
+
const oldIndex = items.findIndex((item_0) => String(getRowId(item_0)) === String(active.id));
|
|
1588
|
+
const newIndex = items.findIndex((item_1) => String(getRowId(item_1)) === String(over.id));
|
|
1113
1589
|
if (oldIndex !== -1 && newIndex !== -1) {
|
|
1114
1590
|
const reorderedItems = [...items];
|
|
1115
1591
|
const [movedItem] = reorderedItems.splice(oldIndex, 1);
|
|
@@ -1117,7 +1593,7 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
1117
1593
|
onReorder(reorderedItems);
|
|
1118
1594
|
}
|
|
1119
1595
|
}
|
|
1120
|
-
onDragEnd?.(
|
|
1596
|
+
onDragEnd?.(event_0);
|
|
1121
1597
|
}
|
|
1122
1598
|
}, [
|
|
1123
1599
|
onDragEnd,
|
|
@@ -1128,15 +1604,15 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
1128
1604
|
const selectedRows = table.getSelectedRowModel().rows;
|
|
1129
1605
|
const columnCount = table.getHeaderGroups()[0].headers.length;
|
|
1130
1606
|
const isAnyRowSelected = selectedRows.length > 0 && !!ActionHeader;
|
|
1131
|
-
const hasOnClick = !!
|
|
1607
|
+
const hasOnClick = !!onRowAction || !!onRowDoubleClick;
|
|
1132
1608
|
const hasPinnedColumns = columnPinning.start.length > 0 || columnPinning.end.length > 0;
|
|
1133
1609
|
const rows = table.getRowModel().rows;
|
|
1134
|
-
const
|
|
1610
|
+
const unborderedIndex = hasExpandColumn ? ownColumnIds.length : 0;
|
|
1135
1611
|
const expandableRows = useExpandableRows({
|
|
1136
1612
|
rowDetails: hasExpandColumn ? rowDetails : void 0,
|
|
1137
1613
|
expanded,
|
|
1138
1614
|
setExpanded,
|
|
1139
|
-
rowIds: rows.map((
|
|
1615
|
+
rowIds: rows.map((row_1) => row_1.id),
|
|
1140
1616
|
tableRef,
|
|
1141
1617
|
scroll
|
|
1142
1618
|
});
|
|
@@ -1144,11 +1620,11 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
1144
1620
|
const isWideEnoughForSplit = useBreakpoint("lg");
|
|
1145
1621
|
const sidePanelMode = hasSidePanel && rowDetailsMode === "split" && isWideEnoughForSplit ? "split" : "drawer";
|
|
1146
1622
|
const openRowId = hasSidePanel && expanded !== true ? Object.keys(expanded).find((rowId) => expanded[rowId]) : void 0;
|
|
1147
|
-
const openRow = openRowId === void 0 ? void 0 : rows.find((
|
|
1623
|
+
const openRow = openRowId === void 0 ? void 0 : rows.find((row_2) => row_2.id === openRowId);
|
|
1148
1624
|
const [lastOpenRow, setLastOpenRow] = useState(openRow);
|
|
1149
1625
|
if (openRow && openRow !== lastOpenRow) setLastOpenRow(openRow);
|
|
1150
1626
|
const detailsRow = openRow ?? lastOpenRow;
|
|
1151
|
-
const canOpenDetails = (
|
|
1627
|
+
const canOpenDetails = (row_3) => hasSidePanel && (rowDetails?.canOpen?.(row_3.original) ?? true);
|
|
1152
1628
|
const openDetails = (rowId_0) => setExpanded({ [rowId_0]: true });
|
|
1153
1629
|
const closeDetails = () => setExpanded({});
|
|
1154
1630
|
const leafHeaders = table.getHeaderGroups().at(-1)?.headers ?? [];
|
|
@@ -1189,14 +1665,14 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
1189
1665
|
accumulate(startHeaders);
|
|
1190
1666
|
accumulate(endHeaders);
|
|
1191
1667
|
if (isResizing) {
|
|
1192
|
-
tableRef.current?.querySelectorAll("[data-pinned][data-column-id]").forEach((
|
|
1193
|
-
const offset_0 = offsets[
|
|
1194
|
-
if (offset_0 !== void 0)
|
|
1668
|
+
tableRef.current?.querySelectorAll("[data-pinned][data-column-id]").forEach((cell_0) => {
|
|
1669
|
+
const offset_0 = offsets[cell_0.dataset.columnId];
|
|
1670
|
+
if (offset_0 !== void 0) cell_0.style[cell_0.dataset.pinned === "start" ? "left" : "right"] = `${offset_0}px`;
|
|
1195
1671
|
});
|
|
1196
1672
|
requestAnimationFrame(updateStuck);
|
|
1197
1673
|
return;
|
|
1198
1674
|
}
|
|
1199
|
-
setPinnedOffsets((
|
|
1675
|
+
setPinnedOffsets((previous_1) => Object.keys(offsets).length === Object.keys(previous_1).length && Object.entries(offsets).every(([id_2, offset_1]) => previous_1[id_2] === offset_1) ? previous_1 : offsets);
|
|
1200
1676
|
requestAnimationFrame(updateStuck);
|
|
1201
1677
|
};
|
|
1202
1678
|
measure();
|
|
@@ -1210,7 +1686,7 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
1210
1686
|
};
|
|
1211
1687
|
}, [
|
|
1212
1688
|
columnPinning,
|
|
1213
|
-
|
|
1689
|
+
pinnedOwnColumnIds.length,
|
|
1214
1690
|
columnVisibility,
|
|
1215
1691
|
columnOrder,
|
|
1216
1692
|
isAnyRowSelected,
|
|
@@ -1229,6 +1705,7 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
1229
1705
|
ref: tableRef,
|
|
1230
1706
|
className: clsx("group/table w-full font-sans text-sm", hasPinnedColumns && "border-separate border-spacing-0", className),
|
|
1231
1707
|
style: columnResize.tableStyle,
|
|
1708
|
+
"aria-busy": isLoading || void 0,
|
|
1232
1709
|
"data-has-pinned": hasPinnedColumns || void 0,
|
|
1233
1710
|
"data-stuck-start": isStuckStart || void 0,
|
|
1234
1711
|
"data-stuck-end": isStuckEnd || void 0,
|
|
@@ -1256,6 +1733,7 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
1256
1733
|
desc: "descending"
|
|
1257
1734
|
}[header_3.column.getIsSorted()] ?? "none" : void 0;
|
|
1258
1735
|
return /* @__PURE__ */ jsx("th", {
|
|
1736
|
+
scope: "col",
|
|
1259
1737
|
colSpan: isAnyRowSelected ? columnCount : header_3.colSpan,
|
|
1260
1738
|
tabIndex: -1,
|
|
1261
1739
|
"aria-sort": ariaSort,
|
|
@@ -1263,28 +1741,39 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
1263
1741
|
...pinned ? getPinnedProps(header_3.column, pinnedOffsets) : {},
|
|
1264
1742
|
className: clsx(tableHeadDataCva({
|
|
1265
1743
|
variant,
|
|
1266
|
-
hasRightBorder: index >
|
|
1744
|
+
hasRightBorder: index > 0 && index !== unborderedIndex && showColumnBorders
|
|
1267
1745
|
}), "group/th", enableColumnResizing && "relative pointer-coarse:pr-6", columnMeta.headerClass, !columnResize.hasFixedWidths && columnMeta.width),
|
|
1268
|
-
children: isAnyRowSelected ?
|
|
1746
|
+
children: isAnyRowSelected ? hasSelectColumn ? /* @__PURE__ */ jsxs("div", {
|
|
1747
|
+
className: "flex items-center gap-4",
|
|
1748
|
+
children: [/* @__PURE__ */ jsx(RowSelectionHeader, { table }), /* @__PURE__ */ jsx(ActionHeader, { table })]
|
|
1749
|
+
}) : /* @__PURE__ */ jsx(ActionHeader, { table }) : header_3.column.id === "row-select" ? /* @__PURE__ */ jsx(RowSelectionHeader, { table }) : /* @__PURE__ */ jsxs("div", {
|
|
1269
1750
|
className: "flex min-w-0 items-center gap-1",
|
|
1270
1751
|
children: [
|
|
1271
1752
|
/* @__PURE__ */ jsx("div", {
|
|
1272
1753
|
className: "flex min-w-0 flex-1",
|
|
1273
|
-
children:
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
onClick: header_3.column.getToggleSortingHandler(),
|
|
1277
|
-
children: [typeof header_3.column.columnDef.header === "function" ? flexRender(header_3.column.columnDef.header, header_3.getContext()) : /* @__PURE__ */ jsx(HeaderText, {
|
|
1754
|
+
children: (() => {
|
|
1755
|
+
const canSort = header_3.column.getCanSort();
|
|
1756
|
+
const content = /* @__PURE__ */ jsxs(Fragment$1, { children: [typeof header_3.column.columnDef.header === "function" ? flexRender(header_3.column.columnDef.header, header_3.getContext()) : /* @__PURE__ */ jsx(HeaderText, {
|
|
1278
1757
|
className: enableColumnResizing ? "min-w-0 whitespace-nowrap" : void 0,
|
|
1279
1758
|
children: header_3.column.columnDef.header
|
|
1280
1759
|
}), {
|
|
1281
1760
|
asc: /* @__PURE__ */ jsx(IconSlot, { icon: ArrowUp }),
|
|
1282
1761
|
desc: /* @__PURE__ */ jsx(IconSlot, { icon: ArrowDown })
|
|
1283
|
-
}[header_3.column.getIsSorted()] ?? (
|
|
1762
|
+
}[header_3.column.getIsSorted()] ?? (canSort ? /* @__PURE__ */ jsx(IconSlot, {
|
|
1284
1763
|
icon: ArrowUpDown,
|
|
1285
1764
|
className: "text-foreground opacity-60"
|
|
1286
|
-
}) : null)]
|
|
1287
|
-
|
|
1765
|
+
}) : null)] });
|
|
1766
|
+
const contentClassName = clsx("flex min-w-0 select-none items-center gap-1 text-card-foreground", canSort && [uiOutlineClass, "-mx-1 h-6 cursor-pointer rounded-xs px-1 hover:bg-muted/50"], columnMeta.sortClass);
|
|
1767
|
+
return canSort ? /* @__PURE__ */ jsx("button", {
|
|
1768
|
+
type: "button",
|
|
1769
|
+
className: contentClassName,
|
|
1770
|
+
onClick: header_3.column.getToggleSortingHandler(),
|
|
1771
|
+
children: content
|
|
1772
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
1773
|
+
className: contentClassName,
|
|
1774
|
+
children: content
|
|
1775
|
+
});
|
|
1776
|
+
})()
|
|
1288
1777
|
}),
|
|
1289
1778
|
enableColumnPinning && header_3.column.getCanPin() && (pinned || (columnSizing[header_3.column.id] ?? Infinity) >= MIN_PINNABLE_COLUMN_WIDTH) && /* @__PURE__ */ jsx(Tooltip, {
|
|
1290
1779
|
text: `${pinned ? "Unpin" : "Pin"} ${columnName}`,
|
|
@@ -1303,15 +1792,14 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
1303
1792
|
enableColumnResizing && !header_3.isPlaceholder && header_3.column.columns.length === 0 && header_3.column.columnDef.enableResizing !== false && /* @__PURE__ */ jsx(ColumnResizeHandle, {
|
|
1304
1793
|
columnName,
|
|
1305
1794
|
isResizing: columnResize.resizingColumnId === header_3.column.id,
|
|
1306
|
-
width: columnSizing[header_3.column.id],
|
|
1307
1795
|
minWidth: header_3.column.columnDef.minSize ?? 60,
|
|
1308
1796
|
maxWidth: header_3.column.columnDef.maxSize === Number.MAX_SAFE_INTEGER ? void 0 : header_3.column.columnDef.maxSize,
|
|
1309
|
-
onPointerDown: (
|
|
1797
|
+
onPointerDown: (event_1) => columnResize.onPointerDown(event_1, {
|
|
1310
1798
|
id: header_3.column.id,
|
|
1311
1799
|
minSize: header_3.column.columnDef.minSize,
|
|
1312
1800
|
maxSize: header_3.column.columnDef.maxSize
|
|
1313
1801
|
}),
|
|
1314
|
-
onKeyDown: (
|
|
1802
|
+
onKeyDown: (event_2) => columnResize.onKeyDown(event_2, {
|
|
1315
1803
|
id: header_3.column.id,
|
|
1316
1804
|
minSize: header_3.column.columnDef.minSize,
|
|
1317
1805
|
maxSize: header_3.column.columnDef.maxSize
|
|
@@ -1324,89 +1812,125 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
1324
1812
|
}, headerGroup.id))
|
|
1325
1813
|
}),
|
|
1326
1814
|
/* @__PURE__ */ jsx("tbody", {
|
|
1327
|
-
ref,
|
|
1815
|
+
ref: syncTabStopCell,
|
|
1816
|
+
onFocus: moveTabStopCell,
|
|
1328
1817
|
className: "relative",
|
|
1329
|
-
children:
|
|
1818
|
+
children: isLoading || rows.length === 0 ? /* @__PURE__ */ jsx("tr", {
|
|
1819
|
+
"data-status-row": true,
|
|
1820
|
+
children: /* @__PURE__ */ jsx("td", {
|
|
1821
|
+
colSpan: table.getVisibleLeafColumns().length,
|
|
1822
|
+
className: clsx(tableDataCva({
|
|
1823
|
+
variant,
|
|
1824
|
+
hasRightBorder: false
|
|
1825
|
+
}), "py-8 text-center whitespace-normal text-muted-foreground"),
|
|
1826
|
+
children: isLoading ? /* @__PURE__ */ jsxs("div", {
|
|
1827
|
+
className: "flex justify-center",
|
|
1828
|
+
children: [/* @__PURE__ */ jsx(Spinner, {}), /* @__PURE__ */ jsx("span", {
|
|
1829
|
+
className: "sr-only",
|
|
1830
|
+
children: t(($) => $.ui.loadingState.text)
|
|
1831
|
+
})]
|
|
1832
|
+
}) : emptyState ?? t(($_0) => $_0.ui.table.noResults)
|
|
1833
|
+
})
|
|
1834
|
+
}) : enableDragDrop ? /* @__PURE__ */ jsx(SortableRows, {
|
|
1330
1835
|
items: dataIds,
|
|
1331
|
-
children: table.getRowModel().rows.map((
|
|
1332
|
-
id:
|
|
1836
|
+
children: table.getRowModel().rows.map((row_4) => /* @__PURE__ */ jsx(DraggableRow, {
|
|
1837
|
+
id: row_4.id,
|
|
1333
1838
|
className: clsx(tableRowCva({
|
|
1334
1839
|
...props,
|
|
1335
1840
|
variant
|
|
1336
1841
|
})),
|
|
1337
|
-
isClickable: hasOnClick ||
|
|
1338
|
-
isSelected:
|
|
1339
|
-
onClick: () => {
|
|
1340
|
-
if (
|
|
1341
|
-
|
|
1842
|
+
isClickable: hasOnClick || row_4.getCanSelect(),
|
|
1843
|
+
isSelected: row_4.getIsSelected(),
|
|
1844
|
+
onClick: (event_3) => {
|
|
1845
|
+
if (isFromSelectCell(event_3)) {
|
|
1846
|
+
if (!isFromRowControl(event_3) && row_4.getCanSelect()) row_4.toggleSelected();
|
|
1847
|
+
return;
|
|
1848
|
+
}
|
|
1849
|
+
if (onRowAction) {
|
|
1850
|
+
onRowAction(row_4.original);
|
|
1342
1851
|
return;
|
|
1343
1852
|
}
|
|
1344
|
-
if (
|
|
1853
|
+
if (row_4.getCanSelect() && !isFromRowControl(event_3)) row_4.toggleSelected();
|
|
1345
1854
|
},
|
|
1346
|
-
onDoubleClick: () =>
|
|
1347
|
-
|
|
1348
|
-
|
|
1855
|
+
onDoubleClick: (event_4) => {
|
|
1856
|
+
if (!isFromSelectCell(event_4)) onRowDoubleClick?.(row_4.original);
|
|
1857
|
+
},
|
|
1858
|
+
onKeyDown: onRowAction ? (event_5) => {
|
|
1859
|
+
if (isRowActionKey(event_5)) onRowAction(row_4.original);
|
|
1860
|
+
} : void 0,
|
|
1861
|
+
children: row_4.getVisibleCells().map((cell_1, cellIndex) => {
|
|
1862
|
+
const columnMeta_0 = cell_1.column.columnDef.meta ?? {};
|
|
1349
1863
|
return /* @__PURE__ */ jsx("td", {
|
|
1350
1864
|
tabIndex: -1,
|
|
1351
|
-
|
|
1865
|
+
"data-select-cell": cell_1.column.id === "row-select" || void 0,
|
|
1866
|
+
...getPinnedProps(cell_1.column, pinnedOffsets),
|
|
1352
1867
|
className: clsx(tableDataCva({
|
|
1353
1868
|
variant,
|
|
1354
1869
|
hasRightBorder: cellIndex > 0 && showColumnBorders
|
|
1355
1870
|
}), columnMeta_0.cellClass, !columnResize.hasFixedWidths && columnMeta_0.width),
|
|
1356
|
-
children: renderCell(
|
|
1357
|
-
},
|
|
1871
|
+
children: renderCell(cell_1.column.columnDef.cell, CustomCellContext(cell_1.getContext()))
|
|
1872
|
+
}, cell_1.id);
|
|
1358
1873
|
})
|
|
1359
|
-
},
|
|
1360
|
-
}) : rows.map((
|
|
1361
|
-
const canExpand = expandableRows.context.canExpand(
|
|
1362
|
-
const isExpanded = canExpand && expandableRows.context.isExpanded(
|
|
1363
|
-
const hasDetails = canOpenDetails(
|
|
1364
|
-
const cells =
|
|
1874
|
+
}, row_4.id))
|
|
1875
|
+
}) : rows.map((row_5) => {
|
|
1876
|
+
const canExpand = expandableRows.context.canExpand(row_5.original);
|
|
1877
|
+
const isExpanded = canExpand && expandableRows.context.isExpanded(row_5.id);
|
|
1878
|
+
const hasDetails = canOpenDetails(row_5);
|
|
1879
|
+
const cells = row_5.getVisibleCells();
|
|
1365
1880
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("tr", {
|
|
1366
1881
|
className: clsx(tableRowCva({
|
|
1367
1882
|
...props,
|
|
1368
1883
|
variant
|
|
1369
1884
|
})),
|
|
1370
|
-
onClick: (
|
|
1371
|
-
if (
|
|
1372
|
-
|
|
1885
|
+
onClick: (event_6) => {
|
|
1886
|
+
if (isFromSelectCell(event_6)) {
|
|
1887
|
+
if (!isFromRowControl(event_6) && row_5.getCanSelect()) row_5.toggleSelected();
|
|
1888
|
+
return;
|
|
1889
|
+
}
|
|
1890
|
+
if (onRowAction) {
|
|
1891
|
+
onRowAction(row_5.original);
|
|
1373
1892
|
return;
|
|
1374
1893
|
}
|
|
1375
1894
|
if (canExpand || hasDetails) {
|
|
1376
|
-
if (isFromRowControl(
|
|
1377
|
-
if (canExpand) expandableRows.context.toggle(
|
|
1378
|
-
else openDetails(
|
|
1895
|
+
if (isFromRowControl(event_6)) return;
|
|
1896
|
+
if (canExpand) expandableRows.context.toggle(row_5.id);
|
|
1897
|
+
else openDetails(row_5.id);
|
|
1379
1898
|
return;
|
|
1380
1899
|
}
|
|
1381
|
-
if (
|
|
1900
|
+
if (row_5.getCanSelect() && !isFromRowControl(event_6)) row_5.toggleSelected();
|
|
1382
1901
|
},
|
|
1383
|
-
onKeyDown:
|
|
1384
|
-
if (
|
|
1902
|
+
onKeyDown: onRowAction || hasDetails ? (event_7) => {
|
|
1903
|
+
if (!isRowActionKey(event_7)) return;
|
|
1904
|
+
if (onRowAction) onRowAction(row_5.original);
|
|
1905
|
+
else openDetails(row_5.id);
|
|
1385
1906
|
} : void 0,
|
|
1386
|
-
onDoubleClick: () =>
|
|
1387
|
-
|
|
1388
|
-
|
|
1907
|
+
onDoubleClick: (event_8) => {
|
|
1908
|
+
if (!isFromSelectCell(event_8)) onRowDoubleClick?.(row_5.original);
|
|
1909
|
+
},
|
|
1910
|
+
"data-clickable": hasOnClick || canExpand || hasDetails || row_5.getCanSelect() || void 0,
|
|
1911
|
+
"data-selected": row_5.getIsSelected() || void 0,
|
|
1389
1912
|
"data-expanded": isExpanded || void 0,
|
|
1390
|
-
"data-details-open": hasSidePanel &&
|
|
1391
|
-
children: cells.map((
|
|
1392
|
-
const columnMeta_1 =
|
|
1913
|
+
"data-details-open": hasSidePanel && row_5.id === openRowId || void 0,
|
|
1914
|
+
children: cells.map((cell_2, cellIndex_0) => {
|
|
1915
|
+
const columnMeta_1 = cell_2.column.columnDef.meta ?? {};
|
|
1393
1916
|
return /* @__PURE__ */ jsx("td", {
|
|
1394
1917
|
tabIndex: -1,
|
|
1395
|
-
|
|
1918
|
+
"data-select-cell": cell_2.column.id === "row-select" || void 0,
|
|
1919
|
+
...getPinnedProps(cell_2.column, pinnedOffsets),
|
|
1396
1920
|
className: clsx(tableDataCva({
|
|
1397
1921
|
variant,
|
|
1398
|
-
hasRightBorder: cellIndex_0 >
|
|
1922
|
+
hasRightBorder: cellIndex_0 > 0 && cellIndex_0 !== unborderedIndex && showColumnBorders
|
|
1399
1923
|
}), columnMeta_1.cellClass, !columnResize.hasFixedWidths && columnMeta_1.width),
|
|
1400
|
-
children: renderCell(
|
|
1401
|
-
},
|
|
1924
|
+
children: renderCell(cell_2.column.columnDef.cell, CustomCellContext(cell_2.getContext()))
|
|
1925
|
+
}, cell_2.id);
|
|
1402
1926
|
})
|
|
1403
1927
|
}), isExpanded && rowDetails && /* @__PURE__ */ jsx(RowDetailsRow, {
|
|
1404
|
-
id: expandableRows.context.getDetailsId(
|
|
1928
|
+
id: expandableRows.context.getDetailsId(row_5.id),
|
|
1405
1929
|
colSpan: cells.length,
|
|
1406
1930
|
variant,
|
|
1407
1931
|
panelWidth: expandableRows.panelWidth,
|
|
1408
|
-
children: rowDetails.render(
|
|
1409
|
-
})] },
|
|
1932
|
+
children: rowDetails.render(row_5.original, { close: () => expandableRows.context.toggle(row_5.id) })
|
|
1933
|
+
})] }, row_5.id);
|
|
1410
1934
|
})
|
|
1411
1935
|
})
|
|
1412
1936
|
]
|
|
@@ -1448,186 +1972,9 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
1448
1972
|
return tableElement;
|
|
1449
1973
|
};
|
|
1450
1974
|
//#endregion
|
|
1451
|
-
//#region src/components/table/ColumnConfig.tsx
|
|
1452
|
-
const VisibilityCell = (t0) => {
|
|
1453
|
-
const $ = c(7);
|
|
1454
|
-
const { original, onToggle } = t0;
|
|
1455
|
-
let t1;
|
|
1456
|
-
if ($[0] !== onToggle || $[1] !== original.id) {
|
|
1457
|
-
t1 = () => onToggle(original.id);
|
|
1458
|
-
$[0] = onToggle;
|
|
1459
|
-
$[1] = original.id;
|
|
1460
|
-
$[2] = t1;
|
|
1461
|
-
} else t1 = $[2];
|
|
1462
|
-
const t2 = original.label;
|
|
1463
|
-
let t3;
|
|
1464
|
-
if ($[3] !== original.visible || $[4] !== t1 || $[5] !== t2) {
|
|
1465
|
-
t3 = /* @__PURE__ */ jsx(Checkbox, {
|
|
1466
|
-
isSelected: original.visible,
|
|
1467
|
-
onChange: t1,
|
|
1468
|
-
hideLabel: true,
|
|
1469
|
-
children: t2
|
|
1470
|
-
});
|
|
1471
|
-
$[3] = original.visible;
|
|
1472
|
-
$[4] = t1;
|
|
1473
|
-
$[5] = t2;
|
|
1474
|
-
$[6] = t3;
|
|
1475
|
-
} else t3 = $[6];
|
|
1476
|
-
return t3;
|
|
1477
|
-
};
|
|
1478
|
-
const getColumns = (t, handleToggleVisibility) => [{
|
|
1479
|
-
id: "name",
|
|
1480
|
-
header: t(($) => $.ui.table.column, { ns: "ui" }),
|
|
1481
|
-
meta: { width: "flex-1" },
|
|
1482
|
-
accessorKey: "label"
|
|
1483
|
-
}, {
|
|
1484
|
-
id: "visible",
|
|
1485
|
-
header: t(($) => $.ui.table.show, { ns: "ui" }),
|
|
1486
|
-
meta: { width: "w-20" },
|
|
1487
|
-
cell: ({ original }) => /* @__PURE__ */ jsx(VisibilityCell, {
|
|
1488
|
-
original,
|
|
1489
|
-
onToggle: handleToggleVisibility
|
|
1490
|
-
})
|
|
1491
|
-
}];
|
|
1492
|
-
function ColumnConfigModal(t0) {
|
|
1493
|
-
const $ = c(27);
|
|
1494
|
-
const { isOpen, onClose, configColumns, visibleColumns, onVisibilityChange, onOrderChange } = t0;
|
|
1495
|
-
const { t } = useTranslation("ui");
|
|
1496
|
-
let t1;
|
|
1497
|
-
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1498
|
-
t1 = [];
|
|
1499
|
-
$[0] = t1;
|
|
1500
|
-
} else t1 = $[0];
|
|
1501
|
-
const [data, setData] = useState(t1);
|
|
1502
|
-
let t2;
|
|
1503
|
-
let t3;
|
|
1504
|
-
if ($[1] !== configColumns || $[2] !== visibleColumns) {
|
|
1505
|
-
t2 = () => {
|
|
1506
|
-
setData(configColumns.map((column) => {
|
|
1507
|
-
const columnId = column.id ?? column.accessorKey;
|
|
1508
|
-
return {
|
|
1509
|
-
id: columnId,
|
|
1510
|
-
label: column.header,
|
|
1511
|
-
visible: visibleColumns?.[columnId] ?? true
|
|
1512
|
-
};
|
|
1513
|
-
}));
|
|
1514
|
-
};
|
|
1515
|
-
t3 = [configColumns, visibleColumns];
|
|
1516
|
-
$[1] = configColumns;
|
|
1517
|
-
$[2] = visibleColumns;
|
|
1518
|
-
$[3] = t2;
|
|
1519
|
-
$[4] = t3;
|
|
1520
|
-
} else {
|
|
1521
|
-
t2 = $[3];
|
|
1522
|
-
t3 = $[4];
|
|
1523
|
-
}
|
|
1524
|
-
useEffect(t2, t3);
|
|
1525
|
-
let t4;
|
|
1526
|
-
if ($[5] !== onVisibilityChange || $[6] !== visibleColumns) {
|
|
1527
|
-
t4 = (columnId_0) => {
|
|
1528
|
-
const newVisible = {
|
|
1529
|
-
...visibleColumns,
|
|
1530
|
-
[columnId_0]: !visibleColumns[columnId_0]
|
|
1531
|
-
};
|
|
1532
|
-
onVisibilityChange(newVisible);
|
|
1533
|
-
};
|
|
1534
|
-
$[5] = onVisibilityChange;
|
|
1535
|
-
$[6] = visibleColumns;
|
|
1536
|
-
$[7] = t4;
|
|
1537
|
-
} else t4 = $[7];
|
|
1538
|
-
const handleToggleVisibility = t4;
|
|
1539
|
-
let t5;
|
|
1540
|
-
if ($[8] !== handleToggleVisibility) {
|
|
1541
|
-
t5 = (translateFn) => getColumns(translateFn, handleToggleVisibility);
|
|
1542
|
-
$[8] = handleToggleVisibility;
|
|
1543
|
-
$[9] = t5;
|
|
1544
|
-
} else t5 = $[9];
|
|
1545
|
-
const columns = useTranslationMemo(t5);
|
|
1546
|
-
let t6;
|
|
1547
|
-
if ($[10] !== onOrderChange) {
|
|
1548
|
-
t6 = (reorderedItems) => {
|
|
1549
|
-
setData(reorderedItems);
|
|
1550
|
-
onOrderChange(reorderedItems.map(_temp$2));
|
|
1551
|
-
};
|
|
1552
|
-
$[10] = onOrderChange;
|
|
1553
|
-
$[11] = t6;
|
|
1554
|
-
} else t6 = $[11];
|
|
1555
|
-
const handleReorder = t6;
|
|
1556
|
-
if (!isOpen) return null;
|
|
1557
|
-
let t7;
|
|
1558
|
-
if ($[12] !== t) {
|
|
1559
|
-
t7 = t(_temp2$2);
|
|
1560
|
-
$[12] = t;
|
|
1561
|
-
$[13] = t7;
|
|
1562
|
-
} else t7 = $[13];
|
|
1563
|
-
let t8;
|
|
1564
|
-
if ($[14] !== t7) {
|
|
1565
|
-
t8 = /* @__PURE__ */ jsx(Typography, {
|
|
1566
|
-
as: "h2",
|
|
1567
|
-
className: "font-semibold",
|
|
1568
|
-
size: "h3",
|
|
1569
|
-
children: t7
|
|
1570
|
-
});
|
|
1571
|
-
$[14] = t7;
|
|
1572
|
-
$[15] = t8;
|
|
1573
|
-
} else t8 = $[15];
|
|
1574
|
-
let t9;
|
|
1575
|
-
if ($[16] !== columns || $[17] !== data || $[18] !== handleReorder) {
|
|
1576
|
-
t9 = /* @__PURE__ */ jsx("div", {
|
|
1577
|
-
className: "max-h-96 overflow-y-auto",
|
|
1578
|
-
children: /* @__PURE__ */ jsx(Table, {
|
|
1579
|
-
items: data,
|
|
1580
|
-
columns,
|
|
1581
|
-
showCellBorder: true,
|
|
1582
|
-
className: "w-full",
|
|
1583
|
-
enableDragDrop: true,
|
|
1584
|
-
getRowId: _temp3,
|
|
1585
|
-
onReorder: handleReorder
|
|
1586
|
-
})
|
|
1587
|
-
});
|
|
1588
|
-
$[16] = columns;
|
|
1589
|
-
$[17] = data;
|
|
1590
|
-
$[18] = handleReorder;
|
|
1591
|
-
$[19] = t9;
|
|
1592
|
-
} else t9 = $[19];
|
|
1593
|
-
let t10;
|
|
1594
|
-
if ($[20] !== t8 || $[21] !== t9) {
|
|
1595
|
-
t10 = /* @__PURE__ */ jsxs("div", {
|
|
1596
|
-
className: "flex flex-col gap-2 p-4",
|
|
1597
|
-
children: [t8, t9]
|
|
1598
|
-
});
|
|
1599
|
-
$[20] = t8;
|
|
1600
|
-
$[21] = t9;
|
|
1601
|
-
$[22] = t10;
|
|
1602
|
-
} else t10 = $[22];
|
|
1603
|
-
let t11;
|
|
1604
|
-
if ($[23] !== isOpen || $[24] !== onClose || $[25] !== t10) {
|
|
1605
|
-
t11 = /* @__PURE__ */ jsx(Dialog, {
|
|
1606
|
-
isOpen,
|
|
1607
|
-
onClose,
|
|
1608
|
-
showCloseIcon: true,
|
|
1609
|
-
children: t10
|
|
1610
|
-
});
|
|
1611
|
-
$[23] = isOpen;
|
|
1612
|
-
$[24] = onClose;
|
|
1613
|
-
$[25] = t10;
|
|
1614
|
-
$[26] = t11;
|
|
1615
|
-
} else t11 = $[26];
|
|
1616
|
-
return t11;
|
|
1617
|
-
}
|
|
1618
|
-
function _temp3(row) {
|
|
1619
|
-
return row.id;
|
|
1620
|
-
}
|
|
1621
|
-
function _temp2$2($) {
|
|
1622
|
-
return $.ui.table.configureColumns;
|
|
1623
|
-
}
|
|
1624
|
-
function _temp$2(item) {
|
|
1625
|
-
return item.id;
|
|
1626
|
-
}
|
|
1627
|
-
//#endregion
|
|
1628
1975
|
//#region src/components/table/InfiniteTable.tsx
|
|
1629
1976
|
const InfiniteTable = (t0) => {
|
|
1630
|
-
const $ = c(
|
|
1977
|
+
const $ = c(35);
|
|
1631
1978
|
let fetchNextPage;
|
|
1632
1979
|
let hasNextPage;
|
|
1633
1980
|
let rest;
|
|
@@ -1646,141 +1993,195 @@ const InfiniteTable = (t0) => {
|
|
|
1646
1993
|
t1 = $[4];
|
|
1647
1994
|
}
|
|
1648
1995
|
const isFetchingNextPage = t1 === void 0 ? false : t1;
|
|
1996
|
+
const itemCount = rest.items.length;
|
|
1997
|
+
const requestedAtCountRef = useRef(null);
|
|
1649
1998
|
let t2;
|
|
1650
|
-
if ($[5] !== fetchNextPage || $[6] !== hasNextPage || $[7] !== isFetchingNextPage) {
|
|
1999
|
+
if ($[5] !== fetchNextPage || $[6] !== hasNextPage || $[7] !== isFetchingNextPage || $[8] !== itemCount || $[9] !== rest.isLoading) {
|
|
1651
2000
|
t2 = () => {
|
|
1652
|
-
if (!isFetchingNextPage && hasNextPage)
|
|
2001
|
+
if (!isFetchingNextPage && hasNextPage && !rest.isLoading) {
|
|
2002
|
+
requestedAtCountRef.current = itemCount;
|
|
2003
|
+
fetchNextPage();
|
|
2004
|
+
}
|
|
1653
2005
|
};
|
|
1654
2006
|
$[5] = fetchNextPage;
|
|
1655
2007
|
$[6] = hasNextPage;
|
|
1656
2008
|
$[7] = isFetchingNextPage;
|
|
1657
|
-
$[8] =
|
|
1658
|
-
|
|
2009
|
+
$[8] = itemCount;
|
|
2010
|
+
$[9] = rest.isLoading;
|
|
2011
|
+
$[10] = t2;
|
|
2012
|
+
} else t2 = $[10];
|
|
1659
2013
|
const handleLoadMore = t2;
|
|
1660
2014
|
let t3;
|
|
1661
|
-
if ($[
|
|
2015
|
+
if ($[11] !== handleLoadMore) {
|
|
1662
2016
|
t3 = {
|
|
1663
2017
|
onIntersection: handleLoadMore,
|
|
1664
2018
|
rootMargin: "100px"
|
|
1665
2019
|
};
|
|
1666
|
-
$[
|
|
1667
|
-
$[
|
|
1668
|
-
} else t3 = $[
|
|
1669
|
-
const { ref } = useIntersectionObserver(t3);
|
|
2020
|
+
$[11] = handleLoadMore;
|
|
2021
|
+
$[12] = t3;
|
|
2022
|
+
} else t3 = $[12];
|
|
2023
|
+
const { ref, getIsIntersecting } = useIntersectionObserver(t3);
|
|
2024
|
+
const handleLoadMoreRef = useRef(handleLoadMore);
|
|
1670
2025
|
let t4;
|
|
1671
|
-
if ($[11] !== rest) {
|
|
1672
|
-
t4 = /* @__PURE__ */ jsx(Table, { ...rest });
|
|
1673
|
-
$[11] = rest;
|
|
1674
|
-
$[12] = t4;
|
|
1675
|
-
} else t4 = $[12];
|
|
1676
2026
|
let t5;
|
|
1677
|
-
if ($[13] !==
|
|
1678
|
-
|
|
2027
|
+
if ($[13] !== handleLoadMore) {
|
|
2028
|
+
t4 = () => {
|
|
2029
|
+
handleLoadMoreRef.current = handleLoadMore;
|
|
2030
|
+
};
|
|
2031
|
+
t5 = [handleLoadMore];
|
|
2032
|
+
$[13] = handleLoadMore;
|
|
2033
|
+
$[14] = t4;
|
|
2034
|
+
$[15] = t5;
|
|
2035
|
+
} else {
|
|
2036
|
+
t4 = $[14];
|
|
2037
|
+
t5 = $[15];
|
|
2038
|
+
}
|
|
2039
|
+
useEffect(t4, t5);
|
|
2040
|
+
let t6;
|
|
2041
|
+
if ($[16] !== getIsIntersecting || $[17] !== itemCount) {
|
|
2042
|
+
t6 = () => {
|
|
2043
|
+
if (getIsIntersecting() && requestedAtCountRef.current !== itemCount) handleLoadMoreRef.current();
|
|
2044
|
+
};
|
|
2045
|
+
$[16] = getIsIntersecting;
|
|
2046
|
+
$[17] = itemCount;
|
|
2047
|
+
$[18] = t6;
|
|
2048
|
+
} else t6 = $[18];
|
|
2049
|
+
let t7;
|
|
2050
|
+
if ($[19] !== getIsIntersecting || $[20] !== hasNextPage || $[21] !== isFetchingNextPage || $[22] !== itemCount || $[23] !== rest.isLoading) {
|
|
2051
|
+
t7 = [
|
|
2052
|
+
getIsIntersecting,
|
|
2053
|
+
itemCount,
|
|
2054
|
+
hasNextPage,
|
|
2055
|
+
isFetchingNextPage,
|
|
2056
|
+
rest.isLoading
|
|
2057
|
+
];
|
|
2058
|
+
$[19] = getIsIntersecting;
|
|
2059
|
+
$[20] = hasNextPage;
|
|
2060
|
+
$[21] = isFetchingNextPage;
|
|
2061
|
+
$[22] = itemCount;
|
|
2062
|
+
$[23] = rest.isLoading;
|
|
2063
|
+
$[24] = t7;
|
|
2064
|
+
} else t7 = $[24];
|
|
2065
|
+
useEffect(t6, t7);
|
|
2066
|
+
let t8;
|
|
2067
|
+
if ($[25] !== rest) {
|
|
2068
|
+
t8 = /* @__PURE__ */ jsx(Table, { ...rest });
|
|
2069
|
+
$[25] = rest;
|
|
2070
|
+
$[26] = t8;
|
|
2071
|
+
} else t8 = $[26];
|
|
2072
|
+
let t9;
|
|
2073
|
+
if ($[27] !== hasNextPage || $[28] !== isFetchingNextPage || $[29] !== ref || $[30] !== rest.isLoading) {
|
|
2074
|
+
t9 = (hasNextPage || isFetchingNextPage) && !rest.isLoading && /* @__PURE__ */ jsx("div", {
|
|
1679
2075
|
ref,
|
|
1680
2076
|
className: "flex justify-center py-4",
|
|
1681
2077
|
children: /* @__PURE__ */ jsx(Spinner, {})
|
|
1682
2078
|
});
|
|
1683
|
-
$[
|
|
1684
|
-
$[
|
|
1685
|
-
$[
|
|
1686
|
-
$[
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
2079
|
+
$[27] = hasNextPage;
|
|
2080
|
+
$[28] = isFetchingNextPage;
|
|
2081
|
+
$[29] = ref;
|
|
2082
|
+
$[30] = rest.isLoading;
|
|
2083
|
+
$[31] = t9;
|
|
2084
|
+
} else t9 = $[31];
|
|
2085
|
+
let t10;
|
|
2086
|
+
if ($[32] !== t8 || $[33] !== t9) {
|
|
2087
|
+
t10 = /* @__PURE__ */ jsxs("div", {
|
|
1691
2088
|
className: "flex flex-col",
|
|
1692
|
-
children: [
|
|
2089
|
+
children: [t8, t9]
|
|
1693
2090
|
});
|
|
1694
|
-
$[
|
|
1695
|
-
$[
|
|
1696
|
-
$[
|
|
1697
|
-
} else
|
|
1698
|
-
return
|
|
2091
|
+
$[32] = t8;
|
|
2092
|
+
$[33] = t9;
|
|
2093
|
+
$[34] = t10;
|
|
2094
|
+
} else t10 = $[34];
|
|
2095
|
+
return t10;
|
|
1699
2096
|
};
|
|
1700
2097
|
//#endregion
|
|
1701
2098
|
//#region src/hooks/useSorting.ts
|
|
1702
|
-
|
|
1703
|
-
const
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
let t1;
|
|
1707
|
-
if ($[0] !== defaultSorting || $[1] !== prefix || $[2] !== searchParams) {
|
|
1708
|
-
t1 = defaultSorting ?? searchParams.get(`order${prefix && `-${prefix}`}`)?.split(",").map(_temp$1) ?? [];
|
|
1709
|
-
$[0] = defaultSorting;
|
|
1710
|
-
$[1] = prefix;
|
|
1711
|
-
$[2] = searchParams;
|
|
1712
|
-
$[3] = t1;
|
|
1713
|
-
} else t1 = $[3];
|
|
1714
|
-
const [sorting, setSorting] = useState(t1);
|
|
1715
|
-
let t2;
|
|
1716
|
-
if ($[4] !== sorting) {
|
|
1717
|
-
t2 = sorting.map(_temp2$1).join(",");
|
|
1718
|
-
$[4] = sorting;
|
|
1719
|
-
$[5] = t2;
|
|
1720
|
-
} else t2 = $[5];
|
|
1721
|
-
const order = t2;
|
|
1722
|
-
let t3;
|
|
1723
|
-
if ($[6] !== order || $[7] !== prefix || $[8] !== replace || $[9] !== searchParams) {
|
|
1724
|
-
t3 = () => {
|
|
1725
|
-
const params = new URLSearchParams(searchParams);
|
|
1726
|
-
const orderKey = prefix ? `order-${prefix}` : "order";
|
|
1727
|
-
params.delete(orderKey);
|
|
1728
|
-
if (order) params.set(orderKey, order);
|
|
1729
|
-
if (params.toString() === searchParams.toString()) return;
|
|
1730
|
-
replace(".", RoutingUtils.toRouterSearch(params));
|
|
1731
|
-
};
|
|
1732
|
-
$[6] = order;
|
|
1733
|
-
$[7] = prefix;
|
|
1734
|
-
$[8] = replace;
|
|
1735
|
-
$[9] = searchParams;
|
|
1736
|
-
$[10] = t3;
|
|
1737
|
-
} else t3 = $[10];
|
|
1738
|
-
let t4;
|
|
1739
|
-
if ($[11] !== order) {
|
|
1740
|
-
t4 = [order];
|
|
1741
|
-
$[11] = order;
|
|
1742
|
-
$[12] = t4;
|
|
1743
|
-
} else t4 = $[12];
|
|
1744
|
-
useEffect(t3, t4);
|
|
1745
|
-
let t5;
|
|
1746
|
-
if ($[13] !== order || $[14] !== sorting) {
|
|
1747
|
-
t5 = {
|
|
1748
|
-
sorting,
|
|
1749
|
-
setSorting,
|
|
1750
|
-
order
|
|
1751
|
-
};
|
|
1752
|
-
$[13] = order;
|
|
1753
|
-
$[14] = sorting;
|
|
1754
|
-
$[15] = t5;
|
|
1755
|
-
} else t5 = $[15];
|
|
1756
|
-
return t5;
|
|
1757
|
-
}
|
|
1758
|
-
function _temp2$1(field) {
|
|
1759
|
-
return `${field.desc ? "-" : "+"}${field.id}`;
|
|
1760
|
-
}
|
|
1761
|
-
function _temp$1(item) {
|
|
1762
|
-
if (item.startsWith("-")) return {
|
|
1763
|
-
id: item.slice(1),
|
|
2099
|
+
const parseOrder = (order) => order.split(",").map((item) => {
|
|
2100
|
+
const field = item.trim();
|
|
2101
|
+
if (field.startsWith("-")) return {
|
|
2102
|
+
id: field.slice(1),
|
|
1764
2103
|
desc: true
|
|
1765
2104
|
};
|
|
1766
|
-
if (
|
|
1767
|
-
id:
|
|
2105
|
+
if (field.startsWith("+")) return {
|
|
2106
|
+
id: field.slice(1),
|
|
1768
2107
|
desc: false
|
|
1769
2108
|
};
|
|
1770
2109
|
return {
|
|
1771
|
-
id:
|
|
2110
|
+
id: field,
|
|
1772
2111
|
desc: false
|
|
1773
2112
|
};
|
|
2113
|
+
}).filter(({ id }) => id !== "");
|
|
2114
|
+
const serializeOrder = (sorting) => sorting.map((field) => `${field.desc ? "-" : "+"}${field.id}`).join(",");
|
|
2115
|
+
const fromUrl = (urlOrder, defaultSorting) => {
|
|
2116
|
+
const urlSorting = parseOrder(urlOrder);
|
|
2117
|
+
return urlSorting.length > 0 ? urlSorting : defaultSorting ?? [];
|
|
2118
|
+
};
|
|
2119
|
+
/**
|
|
2120
|
+
* Table sorting state kept in the URL query (`order`). The table only shows the sort: pass `order`
|
|
2121
|
+
* (`"-createdAt,+name"`) to the list request so the server sorts the rows. Needs `UIRouter.UIRouterProvider` from
|
|
2122
|
+
* `@povio/ui/ui-router` above it, which connects the app router.
|
|
2123
|
+
*
|
|
2124
|
+
* @example
|
|
2125
|
+
* const { sorting, setSorting, order } = useSorting({ defaultSorting: [{ id: "createdAt", desc: true }] });
|
|
2126
|
+
* const { data } = useOrders({ order });
|
|
2127
|
+
* <Table items={data} columns={columns} sorting={sorting} onSortingChange={setSorting} />
|
|
2128
|
+
*/
|
|
2129
|
+
function useSorting({ defaultSorting, prefix = "" } = {}) {
|
|
2130
|
+
const { searchParams, updateSearch } = UIRouter.useUIRouter();
|
|
2131
|
+
const orderKey = prefix ? `order-${prefix}` : "order";
|
|
2132
|
+
const urlOrder = searchParams.get(orderKey) ?? "";
|
|
2133
|
+
const defaultSortingRef = useRef(defaultSorting);
|
|
2134
|
+
const writtenOrderRef = useRef(null);
|
|
2135
|
+
const [sorting, setSorting] = useState(() => fromUrl(urlOrder, defaultSorting));
|
|
2136
|
+
const order = useMemo(() => serializeOrder(sorting), [sorting]);
|
|
2137
|
+
useEffect(() => {
|
|
2138
|
+
defaultSortingRef.current = defaultSorting;
|
|
2139
|
+
});
|
|
2140
|
+
useEffect(() => {
|
|
2141
|
+
if (urlOrder === writtenOrderRef.current) return;
|
|
2142
|
+
const next = fromUrl(urlOrder, defaultSortingRef.current);
|
|
2143
|
+
setSorting((current) => serializeOrder(current) === serializeOrder(next) ? current : next);
|
|
2144
|
+
}, [urlOrder]);
|
|
2145
|
+
useEffect(() => {
|
|
2146
|
+
writtenOrderRef.current = order;
|
|
2147
|
+
updateSearch((search) => {
|
|
2148
|
+
const current_0 = search[orderKey];
|
|
2149
|
+
if ((typeof current_0 === "string" || typeof current_0 === "number" ? `${current_0}` : "") === order) return search;
|
|
2150
|
+
const { [orderKey]: _previous, ...rest } = search;
|
|
2151
|
+
return order ? {
|
|
2152
|
+
...rest,
|
|
2153
|
+
[orderKey]: order
|
|
2154
|
+
} : rest;
|
|
2155
|
+
});
|
|
2156
|
+
}, [order]);
|
|
2157
|
+
return {
|
|
2158
|
+
sorting,
|
|
2159
|
+
setSorting,
|
|
2160
|
+
order
|
|
2161
|
+
};
|
|
1774
2162
|
}
|
|
1775
2163
|
//#endregion
|
|
1776
2164
|
//#region src/hooks/useTableColumnConfig.ts
|
|
2165
|
+
const getColumnKey = (column) => column.id ?? column.accessorKey;
|
|
1777
2166
|
function sortByKeyOrder(data, orderedKeys = []) {
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
2167
|
+
const rank = (column) => {
|
|
2168
|
+
const index = orderedKeys.indexOf(getColumnKey(column));
|
|
2169
|
+
return index === -1 ? orderedKeys.length : index;
|
|
2170
|
+
};
|
|
2171
|
+
return [...data].sort((a, b) => rank(a) - rank(b));
|
|
1781
2172
|
}
|
|
2173
|
+
/**
|
|
2174
|
+
* State for a user-configurable column set: which columns show and in what order.
|
|
2175
|
+
* Pass `columns` to the table (already filtered and ordered) and the rest to `ColumnConfigModal`. Columns with
|
|
2176
|
+
* `enableHiding: false` (row actions, for example) always show and are not listed in the modal.
|
|
2177
|
+
*
|
|
2178
|
+
* @example
|
|
2179
|
+
* const columnConfig = useTableColumnConfig(columns);
|
|
2180
|
+
* <Table items={items} columns={columnConfig.columns} />
|
|
2181
|
+
* <ColumnConfigModal trigger={<Button>Columns</Button>} {...columnConfig} onReset={columnConfig.resetColumns} />
|
|
2182
|
+
*/
|
|
1782
2183
|
function useTableColumnConfig(defaultColumns, t0) {
|
|
1783
|
-
const $ = c(
|
|
2184
|
+
const $ = c(36);
|
|
1784
2185
|
let t1;
|
|
1785
2186
|
if ($[0] !== t0) {
|
|
1786
2187
|
t1 = t0 === void 0 ? {} : t0;
|
|
@@ -1853,46 +2254,66 @@ function useTableColumnConfig(defaultColumns, t0) {
|
|
|
1853
2254
|
} else t9 = $[15];
|
|
1854
2255
|
const handleOrderChange = t9;
|
|
1855
2256
|
let t10;
|
|
1856
|
-
if ($[16] !== defaultColumns || $[17] !==
|
|
1857
|
-
t10 =
|
|
2257
|
+
if ($[16] !== defaultColumns || $[17] !== handleOrderChange || $[18] !== handleVisibilityChange) {
|
|
2258
|
+
t10 = () => {
|
|
2259
|
+
handleVisibilityChange(Object.fromEntries(defaultColumns.map(_temp3)));
|
|
2260
|
+
handleOrderChange(defaultColumns.map(_temp4));
|
|
2261
|
+
};
|
|
1858
2262
|
$[16] = defaultColumns;
|
|
1859
|
-
$[17] =
|
|
1860
|
-
$[18] =
|
|
1861
|
-
|
|
1862
|
-
|
|
2263
|
+
$[17] = handleOrderChange;
|
|
2264
|
+
$[18] = handleVisibilityChange;
|
|
2265
|
+
$[19] = t10;
|
|
2266
|
+
} else t10 = $[19];
|
|
2267
|
+
const resetColumns = t10;
|
|
1863
2268
|
let t11;
|
|
1864
|
-
if ($[
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
t11 = configColumns.filter(t12);
|
|
1872
|
-
$[19] = configColumns;
|
|
1873
|
-
$[20] = internalVisibleColumns;
|
|
1874
|
-
$[21] = t11;
|
|
1875
|
-
} else t11 = $[21];
|
|
1876
|
-
const columns = t11;
|
|
2269
|
+
if ($[20] !== defaultColumns || $[21] !== internalColumnOrder) {
|
|
2270
|
+
t11 = sortByKeyOrder(defaultColumns, internalColumnOrder);
|
|
2271
|
+
$[20] = defaultColumns;
|
|
2272
|
+
$[21] = internalColumnOrder;
|
|
2273
|
+
$[22] = t11;
|
|
2274
|
+
} else t11 = $[22];
|
|
2275
|
+
const configColumns = t11;
|
|
1877
2276
|
let t12;
|
|
1878
|
-
if ($[
|
|
1879
|
-
|
|
2277
|
+
if ($[23] !== configColumns || $[24] !== internalVisibleColumns) {
|
|
2278
|
+
let t13;
|
|
2279
|
+
if ($[26] !== internalVisibleColumns) {
|
|
2280
|
+
t13 = (col_3) => col_3.enableHiding === false || (internalVisibleColumns?.[getColumnKey(col_3)] ?? true);
|
|
2281
|
+
$[26] = internalVisibleColumns;
|
|
2282
|
+
$[27] = t13;
|
|
2283
|
+
} else t13 = $[27];
|
|
2284
|
+
t12 = configColumns.filter(t13);
|
|
2285
|
+
$[23] = configColumns;
|
|
2286
|
+
$[24] = internalVisibleColumns;
|
|
2287
|
+
$[25] = t12;
|
|
2288
|
+
} else t12 = $[25];
|
|
2289
|
+
const columns = t12;
|
|
2290
|
+
let t13;
|
|
2291
|
+
if ($[28] !== columns || $[29] !== configColumns || $[30] !== handleOrderChange || $[31] !== handleVisibilityChange || $[32] !== internalColumnOrder || $[33] !== internalVisibleColumns || $[34] !== resetColumns) {
|
|
2292
|
+
t13 = {
|
|
1880
2293
|
configColumns,
|
|
1881
2294
|
columns,
|
|
1882
2295
|
visibleColumns: internalVisibleColumns,
|
|
1883
2296
|
columnOrder: internalColumnOrder,
|
|
1884
2297
|
onVisibilityChange: handleVisibilityChange,
|
|
1885
|
-
onOrderChange: handleOrderChange
|
|
2298
|
+
onOrderChange: handleOrderChange,
|
|
2299
|
+
resetColumns
|
|
1886
2300
|
};
|
|
1887
|
-
$[
|
|
1888
|
-
$[
|
|
1889
|
-
$[
|
|
1890
|
-
$[
|
|
1891
|
-
$[
|
|
1892
|
-
$[
|
|
1893
|
-
$[
|
|
1894
|
-
|
|
1895
|
-
|
|
2301
|
+
$[28] = columns;
|
|
2302
|
+
$[29] = configColumns;
|
|
2303
|
+
$[30] = handleOrderChange;
|
|
2304
|
+
$[31] = handleVisibilityChange;
|
|
2305
|
+
$[32] = internalColumnOrder;
|
|
2306
|
+
$[33] = internalVisibleColumns;
|
|
2307
|
+
$[34] = resetColumns;
|
|
2308
|
+
$[35] = t13;
|
|
2309
|
+
} else t13 = $[35];
|
|
2310
|
+
return t13;
|
|
2311
|
+
}
|
|
2312
|
+
function _temp4(col_2) {
|
|
2313
|
+
return col_2.id ?? col_2.accessorKey;
|
|
2314
|
+
}
|
|
2315
|
+
function _temp3(col_1) {
|
|
2316
|
+
return [col_1.id ?? col_1.accessorKey, true];
|
|
1896
2317
|
}
|
|
1897
2318
|
function _temp2(col_0) {
|
|
1898
2319
|
return col_0.id ?? col_0.accessorKey;
|
|
@@ -1903,4 +2324,4 @@ function _temp(acc, col) {
|
|
|
1903
2324
|
return acc;
|
|
1904
2325
|
}
|
|
1905
2326
|
//#endregion
|
|
1906
|
-
export {
|
|
2327
|
+
export { useTableNav as a, CellText as c, Table as i, useSorting as n, HeaderText as o, InfiniteTable as r, ColumnConfigModal as s, useTableColumnConfig as t };
|