@povio/ui 6.0.0-rc.11 → 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 +470 -43
- 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-DX0dVo6z.js → Calendar-DN-i_b-_.js} +19 -17
- package/dist/{Calendar.lazy-W51M56GQ.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-CqNS7lgR.js → DatePicker-DQewd1By.js} +80 -41
- package/dist/{DatePickerInput-vLlL5ATh.d.ts → DatePickerInput-B9VnExeA.d.ts} +3 -3
- package/dist/{DatePickerInput-B2Pc_aJr.js → DatePickerInput-Bp9ZIN5E.js} +37 -26
- package/dist/{DateRangePicker-C3ClfSfj.js → DateRangePicker-DRZ1hLlR.js} +93 -169
- package/dist/DateRangePicker-LX1VJlnD.d.ts +102 -0
- package/dist/DateTimePicker-D9pODhAj.d.ts +83 -0
- package/dist/{DateTimePicker-CYa2J-1r.js → DateTimePicker-DWtKPaE6.js} +70 -35
- package/dist/{Dialog-C9H9_BmK.js → Dialog-BJ13KRQo.js} +1 -1
- package/dist/{Dialog-96c4Pzfm.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-IRM0C9W6.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-UbFhc_J2.js → Input-CeRJeAoR.js} +94 -59
- package/dist/Input-onUj0DKg.d.ts +56 -0
- package/dist/{InputContent-D7lnNLWk.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-twW8zuJ9.js → NumberField-6Q9LHGSo.js} +91 -62
- package/dist/NumberField-Sb30Qao3.d.ts +41 -0
- package/dist/{NumberRangeInput-gT6gEJIz.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-CXtbMCD6.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-0W1YFZqn.js → RangeCalendar-DqCTlIuy.js} +42 -13
- package/dist/Select-CSyfDyxG.d.ts +248 -0
- package/dist/{Select-B-TuE_Fh.js → Select-D3fuXwVt.js} +435 -184
- package/dist/{SelectListBox-Dlonoc5z.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-CWUNeqYa.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-DakA3nzZ.js → TextArea-P8F0oD_A.js} +59 -32
- package/dist/TimePicker-Ai1M2TGW.d.ts +63 -0
- package/dist/{TimePicker-RFzfDezn.js → TimePicker-l4Ysk2AX.js} +99 -50
- package/dist/{TimePickerForm-DohOZViU.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-DLBksJsF.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-EDC8xyfH.d.ts → i18n-B3PeqBM7.d.ts} +100 -20
- package/dist/{i18n-BE9Wvs9L.js → i18n-DQs7jPjv.js} +99 -25
- package/dist/iconSlot.cva-DyhOI7EK.js +5 -0
- package/dist/{import-Dkfk7PHt.js → import-C73fI3WD.js} +2 -2
- package/dist/index.d.ts +64 -85
- package/dist/index.js +55 -92
- package/dist/{input.cva-DZii82eS.js → input.cva-mm1dnfKP.js} +27 -23
- package/dist/inputLayout-CIVpuUBq.js +7 -0
- package/dist/inputRow.clsx-BbcaXVta.js +6 -0
- package/dist/{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-4tIzPL8l.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 +2 -2
- package/dist/tanstack-ABeiJISz.js +10 -0
- package/dist/tanstack-bLXoUPDY.d.ts +165 -0
- package/dist/tanstack.d.ts +64 -85
- package/dist/tanstack.js +55 -92
- 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-D3KH4Rpo.js → useTableColumnConfig-B9cYBKo3.js} +956 -689
- 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 -131
- package/MIGRATION.md +0 -673
- 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-BxRjxjtp.js +0 -145
- package/dist/Autocomplete.bound-CpHZZ3C9.d.ts +0 -9
- package/dist/Autocomplete.bound-DweyHUI5.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-Dxg2LM89.js +0 -36
- package/dist/DateRangePicker-32D4pWJg.d.ts +0 -97
- package/dist/DateRangePicker.bound-CVtoVsho.d.ts +0 -9
- package/dist/DateRangePicker.bound-PR9rBoXc.js +0 -35
- package/dist/DateTimePicker-BTRIUagV.d.ts +0 -55
- package/dist/DateTimePicker.bound-CQxnRveH.js +0 -32
- package/dist/DateTimePicker.bound-X4DTyQ1b.d.ts +0 -9
- 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-CctyulN9.js +0 -30
- package/dist/FileInput.bound-D2HuuqSb.d.ts +0 -8
- package/dist/FileUpload-BUTSqHVk.d.ts +0 -11
- package/dist/FileUpload-Dfs3FvJ7.js +0 -749
- package/dist/FileUpload.bound-CGQXb4iT.d.ts +0 -16
- package/dist/FileUpload.bound-vik_sTkm.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-0iJO2-ia.js +0 -31
- package/dist/Input.bound-B9a62ylL.d.ts +0 -9
- 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-DHDsBNvI.js +0 -32
- package/dist/NumberField.bound-Dy0A5iVc.d.ts +0 -9
- package/dist/NumberRangeInput-BCKQaGpy.d.ts +0 -50
- package/dist/NumberRangeInput.bound-5Yv3Og73.js +0 -32
- package/dist/NumberRangeInput.bound-BNXxIQ0b.d.ts +0 -9
- package/dist/Pagination-BCGUVYOF.d.ts +0 -12
- package/dist/PaginationList-CvlSkJGn.d.ts +0 -18
- package/dist/PaginationList-D7SRwySe.js +0 -220
- 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-BuqZth3X.js +0 -651
- package/dist/RichTextEditor-DHhuBeT6.d.ts +0 -28
- package/dist/Select-C34ENdjq.d.ts +0 -119
- package/dist/Select.bound-CNCChZww.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-CDVPP_qb.js +0 -28
- package/dist/TimePicker-BZ1ocsBX.d.ts +0 -45
- package/dist/TimePicker.bound-8DmjMXuE.d.ts +0 -9
- package/dist/TimePicker.bound-DPia51Qs.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/components/pagination-list.d.ts +0 -2
- package/dist/components/pagination-list.js +0 -2
- package/dist/components/pagination.d.ts +0 -2
- package/dist/components/pagination.js +0 -138
- package/dist/confirmation.context-BwlIEVeF.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-CtuKX9Ss.d.ts +0 -568
- 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-H5DrogZU.d.ts +0 -215
- package/dist/useToast-DsA8CVoY.d.ts +0 -16
|
@@ -1,30 +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-96c4Pzfm.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
|
-
import { Pagination } from "./components/pagination.js";
|
|
17
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";
|
|
18
|
-
import { t as
|
|
19
|
-
import { t as
|
|
20
|
-
import { t as UIRouter } from "./router.context-MckTbHw9.js";
|
|
21
|
-
import { t as RoutingUtils } from "./routing.utils-DfxEt0_Y.js";
|
|
22
|
-
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";
|
|
23
20
|
import { c } from "react/compiler-runtime";
|
|
24
21
|
import { Fragment, Suspense, createContext, lazy, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
25
22
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
26
|
-
import
|
|
23
|
+
import { ArrowDown, ArrowUp, ArrowUpDown, ChevronRight, GripVertical, Pin, X } from "lucide-react";
|
|
27
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";
|
|
28
30
|
import { createPaginatedRowModel, createSortedRowModel, flexRender, stockFeatures, tableFeatures, useTable } from "@tanstack/react-table";
|
|
29
31
|
//#region src/components/table/CellText.tsx
|
|
30
32
|
const CellText = (props) => {
|
|
@@ -41,6 +43,360 @@ const CellText = (props) => {
|
|
|
41
43
|
});
|
|
42
44
|
};
|
|
43
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
|
|
44
400
|
//#region src/components/table/HeaderText.tsx
|
|
45
401
|
const HeaderText = (props) => {
|
|
46
402
|
const uiConfig = UIConfig.useConfig();
|
|
@@ -63,6 +419,18 @@ const Selectors = {
|
|
|
63
419
|
/** Selector from here: https://github.com/Shopify/polaris/blob/main/polaris-react/src/utilities/focus.ts#L10 */
|
|
64
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]"
|
|
65
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;
|
|
66
434
|
var DataGridNav = class {
|
|
67
435
|
constructor(config = {}) {
|
|
68
436
|
this.keys = [];
|
|
@@ -97,7 +465,10 @@ var DataGridNav = class {
|
|
|
97
465
|
}
|
|
98
466
|
tableKeyDown(e) {
|
|
99
467
|
if (this.disabled) return;
|
|
100
|
-
|
|
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();
|
|
101
472
|
if (this.keys.length === 0 || this.keys[this.keys.length - 1] !== e.key) this.keys.push(e.key);
|
|
102
473
|
if (!(e.target instanceof Element)) return;
|
|
103
474
|
const cell = e.target.parentElement?.closest(`${this.selectors.Cell},${this.selectors.Row}`);
|
|
@@ -115,35 +486,29 @@ var DataGridNav = class {
|
|
|
115
486
|
}
|
|
116
487
|
}
|
|
117
488
|
/**
|
|
118
|
-
* Keys:
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
* Arrow Down disabled:
|
|
122
|
-
* 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.
|
|
123
491
|
*/
|
|
124
|
-
if (e.key === "
|
|
125
|
-
|
|
126
|
-
if (!cell) return;
|
|
127
|
-
const focusableWidgets = [...cell.querySelectorAll(this.selectors.Focusable)];
|
|
128
|
-
const widgetIdx = focusableWidgets.findIndex((el) => el === e.target);
|
|
129
|
-
const widgetToFocus = focusableWidgets[widgetIdx === focusableWidgets.length - 1 ? 0 : widgetIdx + 1];
|
|
130
|
-
if (this.isFocusable(widgetToFocus)) widgetToFocus.focus();
|
|
492
|
+
if (e.key === "ArrowUp" || e.key === "ArrowDown") {
|
|
493
|
+
this.verticalCellNavigation(e);
|
|
131
494
|
return;
|
|
132
495
|
}
|
|
133
496
|
/**
|
|
134
|
-
* Keys:
|
|
135
|
-
* Move to the previous
|
|
136
|
-
*
|
|
137
|
-
* Arrow Up disabled:
|
|
138
|
-
* 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.
|
|
139
499
|
*/
|
|
140
|
-
if (e.key === "
|
|
500
|
+
if (e.key === "ArrowRight" || e.key === "ArrowLeft") {
|
|
141
501
|
const cell = e.target.closest(this.selectors.Cell);
|
|
142
502
|
if (!cell) return;
|
|
503
|
+
const direction = e.key === "ArrowRight" ? 1 : -1;
|
|
143
504
|
const focusableWidgets = [...cell.querySelectorAll(this.selectors.Focusable)];
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
|
|
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();
|
|
147
512
|
}
|
|
148
513
|
}
|
|
149
514
|
gridNavigation(e) {
|
|
@@ -283,6 +648,14 @@ var DataGridNav = class {
|
|
|
283
648
|
return position;
|
|
284
649
|
}
|
|
285
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
|
+
*/
|
|
286
659
|
function useTableNav(options) {
|
|
287
660
|
const nav = new DataGridNav(options);
|
|
288
661
|
return {
|
|
@@ -511,10 +884,23 @@ const RowDetailsRow = (t0) => {
|
|
|
511
884
|
} else t6 = $[17];
|
|
512
885
|
return t6;
|
|
513
886
|
};
|
|
514
|
-
|
|
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
|
+
};
|
|
515
899
|
const SidePanelContent = (t0) => {
|
|
516
|
-
const $ = c(
|
|
900
|
+
const $ = c(21);
|
|
517
901
|
const { title, onClose, children } = t0;
|
|
902
|
+
const { t } = useTranslation("ui");
|
|
903
|
+
const defaultTitle = useDefaultTitle();
|
|
518
904
|
const headerCva = UIOverrides.useCva("table.sidePanelHeaderCva", tableSidePanelHeaderDefinition);
|
|
519
905
|
const bodyCva = UIOverrides.useCva("table.sidePanelBodyCva", tableSidePanelBodyDefinition);
|
|
520
906
|
let t1;
|
|
@@ -523,7 +909,7 @@ const SidePanelContent = (t0) => {
|
|
|
523
909
|
$[0] = headerCva;
|
|
524
910
|
$[1] = t1;
|
|
525
911
|
} else t1 = $[1];
|
|
526
|
-
const t2 = title ??
|
|
912
|
+
const t2 = title ?? defaultTitle;
|
|
527
913
|
let t3;
|
|
528
914
|
if ($[2] !== t2) {
|
|
529
915
|
t3 = /* @__PURE__ */ jsx(Typography, {
|
|
@@ -536,60 +922,68 @@ const SidePanelContent = (t0) => {
|
|
|
536
922
|
$[3] = t3;
|
|
537
923
|
} else t3 = $[3];
|
|
538
924
|
let t4;
|
|
539
|
-
if ($[4] !==
|
|
540
|
-
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, {
|
|
541
933
|
variant: "text",
|
|
542
934
|
size: "sm",
|
|
543
935
|
width: "hug",
|
|
544
936
|
disableTooltip: true,
|
|
545
|
-
label:
|
|
937
|
+
label: t4,
|
|
546
938
|
icon: X,
|
|
547
939
|
className: "shrink-0 pointer-coarse:size-8",
|
|
548
940
|
onPress: onClose
|
|
549
941
|
});
|
|
550
|
-
$[
|
|
551
|
-
$[
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
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", {
|
|
556
949
|
className: t1,
|
|
557
|
-
children: [t3,
|
|
950
|
+
children: [t3, t5]
|
|
558
951
|
});
|
|
559
|
-
$[
|
|
560
|
-
$[
|
|
561
|
-
$[
|
|
562
|
-
$[
|
|
563
|
-
} else
|
|
564
|
-
let t6;
|
|
565
|
-
if ($[10] !== bodyCva) {
|
|
566
|
-
t6 = bodyCva({});
|
|
567
|
-
$[10] = bodyCva;
|
|
568
|
-
$[11] = t6;
|
|
569
|
-
} else t6 = $[11];
|
|
952
|
+
$[9] = t1;
|
|
953
|
+
$[10] = t3;
|
|
954
|
+
$[11] = t5;
|
|
955
|
+
$[12] = t6;
|
|
956
|
+
} else t6 = $[12];
|
|
570
957
|
let t7;
|
|
571
|
-
if ($[
|
|
572
|
-
t7 =
|
|
573
|
-
|
|
574
|
-
children
|
|
575
|
-
});
|
|
576
|
-
$[12] = children;
|
|
577
|
-
$[13] = t6;
|
|
958
|
+
if ($[13] !== bodyCva) {
|
|
959
|
+
t7 = bodyCva({});
|
|
960
|
+
$[13] = bodyCva;
|
|
578
961
|
$[14] = t7;
|
|
579
962
|
} else t7 = $[14];
|
|
580
963
|
let t8;
|
|
581
|
-
if ($[15] !==
|
|
582
|
-
t8 = /* @__PURE__ */
|
|
583
|
-
|
|
964
|
+
if ($[15] !== children || $[16] !== t7) {
|
|
965
|
+
t8 = /* @__PURE__ */ jsx("div", {
|
|
966
|
+
className: t7,
|
|
967
|
+
children
|
|
968
|
+
});
|
|
969
|
+
$[15] = children;
|
|
584
970
|
$[16] = t7;
|
|
585
971
|
$[17] = t8;
|
|
586
972
|
} else t8 = $[17];
|
|
587
|
-
|
|
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;
|
|
588
981
|
};
|
|
589
982
|
const RowDetailsDrawer = (t0) => {
|
|
590
983
|
const $ = c(11);
|
|
591
984
|
const { isOpen, title, onClose, children } = t0;
|
|
592
|
-
const
|
|
985
|
+
const defaultTitle = useDefaultTitle();
|
|
986
|
+
const t1 = title ?? defaultTitle;
|
|
593
987
|
let t2;
|
|
594
988
|
if ($[0] !== onClose) {
|
|
595
989
|
t2 = (open) => {
|
|
@@ -616,8 +1010,7 @@ const RowDetailsDrawer = (t0) => {
|
|
|
616
1010
|
label: t1,
|
|
617
1011
|
isOpen,
|
|
618
1012
|
onOpenChange: t2,
|
|
619
|
-
|
|
620
|
-
dialogClassName: "h-full w-[min(30rem,100vw)] overflow-y-auto",
|
|
1013
|
+
contentClassName: "h-full w-[min(30rem,100vw)] overflow-y-auto",
|
|
621
1014
|
children: t3
|
|
622
1015
|
});
|
|
623
1016
|
$[6] = isOpen;
|
|
@@ -632,7 +1025,8 @@ const RowDetailsSplitPanel = (t0) => {
|
|
|
632
1025
|
const $ = c(16);
|
|
633
1026
|
const { title, onClose, maxHeight, children } = t0;
|
|
634
1027
|
const panelCva = UIOverrides.useCva("table.sidePanelCva", tableSidePanelDefinition);
|
|
635
|
-
const
|
|
1028
|
+
const defaultTitle = useDefaultTitle();
|
|
1029
|
+
const t1 = title ?? defaultTitle;
|
|
636
1030
|
let t2;
|
|
637
1031
|
if ($[0] !== panelCva) {
|
|
638
1032
|
t2 = panelCva({});
|
|
@@ -683,6 +1077,45 @@ const RowDetailsSplitPanel = (t0) => {
|
|
|
683
1077
|
} else t6 = $[15];
|
|
684
1078
|
return t6;
|
|
685
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
|
+
};
|
|
686
1119
|
const DEFAULT_WIDTH = 150;
|
|
687
1120
|
const KEYBOARD_STEP = 10;
|
|
688
1121
|
const KEYBOARD_STEP_LARGE = 50;
|
|
@@ -728,12 +1161,12 @@ const useColumnResize = (t0) => {
|
|
|
728
1161
|
$[11] = t4;
|
|
729
1162
|
} else t4 = $[11];
|
|
730
1163
|
const tableStyle = t4;
|
|
731
|
-
const clamp = _temp$
|
|
1164
|
+
const clamp = _temp$1;
|
|
732
1165
|
let t5;
|
|
733
1166
|
if ($[12] !== columnSizing || $[13] !== columns || $[14] !== theadRef) {
|
|
734
1167
|
t5 = () => {
|
|
735
1168
|
const sizes_0 = { ...columnSizing };
|
|
736
|
-
const leafColumnIds = new Set(columns.map(_temp2$
|
|
1169
|
+
const leafColumnIds = new Set(columns.map(_temp2$1));
|
|
737
1170
|
theadRef.current?.querySelectorAll("th[data-column-id]").forEach((header) => {
|
|
738
1171
|
const columnId_0 = header.dataset.columnId;
|
|
739
1172
|
if (leafColumnIds.has(columnId_0)) sizes_0[columnId_0] = Math.round(header.getBoundingClientRect().width);
|
|
@@ -868,10 +1301,10 @@ const useColumnResize = (t0) => {
|
|
|
868
1301
|
} else t10 = $[38];
|
|
869
1302
|
return t10;
|
|
870
1303
|
};
|
|
871
|
-
function _temp$
|
|
1304
|
+
function _temp$1(column_0, width) {
|
|
872
1305
|
return Math.round(Math.min(column_0.maxSize ?? Infinity, Math.max(column_0.minSize ?? 60, width)));
|
|
873
1306
|
}
|
|
874
|
-
function _temp2$
|
|
1307
|
+
function _temp2$1(column_1) {
|
|
875
1308
|
return column_1.id;
|
|
876
1309
|
}
|
|
877
1310
|
function _temp3$1(col_0) {
|
|
@@ -879,10 +1312,10 @@ function _temp3$1(col_0) {
|
|
|
879
1312
|
}
|
|
880
1313
|
//#endregion
|
|
881
1314
|
//#region src/components/table/Table.tsx
|
|
882
|
-
const DndProvider = lazy(() =>
|
|
883
|
-
const SortableRows = lazy(() =>
|
|
884
|
-
const DraggableRow = lazy(() =>
|
|
885
|
-
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 })));
|
|
886
1319
|
const tableFeaturesConfig = tableFeatures({
|
|
887
1320
|
...stockFeatures,
|
|
888
1321
|
sortedRowModel: createSortedRowModel(),
|
|
@@ -905,40 +1338,45 @@ const renderCell = (Comp, props) => /* @__PURE__ */ jsx(CellContent, {
|
|
|
905
1338
|
cell: Comp,
|
|
906
1339
|
props
|
|
907
1340
|
});
|
|
908
|
-
const RowDragHandleCell = ({
|
|
1341
|
+
const RowDragHandleCell = ({ row }) => {
|
|
1342
|
+
const { t } = useTranslation("ui");
|
|
909
1343
|
return /* @__PURE__ */ jsx(DragHandle, {
|
|
910
|
-
id:
|
|
911
|
-
|
|
912
|
-
...dragProps,
|
|
913
|
-
className: "cursor-move p-1",
|
|
914
|
-
label: "Drag handle",
|
|
915
|
-
icon: GripVertical,
|
|
916
|
-
variant: "text",
|
|
917
|
-
width: "hug",
|
|
918
|
-
disableTooltip: true,
|
|
919
|
-
size: "sm"
|
|
920
|
-
})
|
|
1344
|
+
id: row.id,
|
|
1345
|
+
label: t(($) => $.ui.table.reorderRow, { row: row.index + 1 })
|
|
921
1346
|
});
|
|
922
1347
|
};
|
|
923
|
-
const
|
|
924
|
-
const
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
},
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
}
|
|
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";
|
|
940
1376
|
const ROW_CONTROL_SELECTOR = "button, a, input, select, textarea, label, [role=button], [role=checkbox], [role=switch], [role=combobox], [role=separator]";
|
|
941
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);
|
|
942
1380
|
const EMPTY_PINNING = {
|
|
943
1381
|
start: [],
|
|
944
1382
|
end: []
|
|
@@ -959,7 +1397,7 @@ const getPinnedProps = (column, pinnedOffsets) => {
|
|
|
959
1397
|
"data-column-id": column.id
|
|
960
1398
|
};
|
|
961
1399
|
};
|
|
962
|
-
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 }) => {
|
|
963
1401
|
const uiConfig = UIConfig.useConfig();
|
|
964
1402
|
const variant = variantProp ?? uiConfig.table.variant;
|
|
965
1403
|
const showColumnBorders = showCellBorder ?? (variant !== "horizontals" && variant !== "zebra" && variant !== "striped-columns");
|
|
@@ -969,21 +1407,60 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
969
1407
|
const tableHeadRowCva = UIOverrides.useCva("table.headRowCva", tableHeadRowDefinition);
|
|
970
1408
|
const tableHeadDataCva = UIOverrides.useCva("table.headDataCva", tableHeadDataDefinition);
|
|
971
1409
|
const tableDataCva = UIOverrides.useCva("table.dataCva", tableDataDefinition);
|
|
972
|
-
const
|
|
1410
|
+
const { t } = useTranslation("ui");
|
|
973
1411
|
const { listeners } = useTableNav({ selectors: { Row: "tr:not([data-details-row])" } });
|
|
974
1412
|
const data = useMemo(() => items ?? [], [items]);
|
|
975
|
-
const
|
|
976
|
-
const
|
|
977
|
-
|
|
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;
|
|
978
1432
|
const handleRowSelectionChange = useCallback((updater) => {
|
|
979
|
-
if (!
|
|
1433
|
+
if (!isRowSelectionControlled) setInternalRowSelection(updater);
|
|
980
1434
|
onRowSelectionChange?.(updater);
|
|
981
|
-
}, [
|
|
1435
|
+
}, [isRowSelectionControlled, onRowSelectionChange]);
|
|
982
1436
|
const baseColumns = useMemo(() => typeof columns === "function" ? columns(i18next.t) : columns, [columns]);
|
|
983
1437
|
const rowDetailsMode = rowDetails && !enableDragDrop ? rowDetails.mode ?? uiConfig.table.rowDetailsMode : void 0;
|
|
984
1438
|
const hasExpandColumn = rowDetailsMode === "expand";
|
|
1439
|
+
const hasDragColumn = enableDragDrop && !!getRowId;
|
|
1440
|
+
const hasSelectColumn = !!enableRowSelection;
|
|
985
1441
|
const tableColumns = useMemo(() => {
|
|
986
|
-
|
|
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({
|
|
987
1464
|
id: EXPAND_COLUMN_ID,
|
|
988
1465
|
header: () => /* @__PURE__ */ jsx("span", {
|
|
989
1466
|
className: "sr-only",
|
|
@@ -995,48 +1472,45 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
995
1472
|
cellClass: "px-1"
|
|
996
1473
|
},
|
|
997
1474
|
cell: RowExpandCell,
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
}, ...baseColumns];
|
|
1002
|
-
if (enableDragDrop && getRowId) return [{
|
|
1003
|
-
id: "drag-handle",
|
|
1004
|
-
header: "",
|
|
1005
|
-
meta: { width: "w-12" },
|
|
1006
|
-
cell: AutoDragHandleCell,
|
|
1007
|
-
enableSorting: false,
|
|
1008
|
-
enablePinning: false,
|
|
1009
|
-
enableResizing: false
|
|
1010
|
-
}, ...baseColumns];
|
|
1011
|
-
return baseColumns;
|
|
1475
|
+
...ownColumnOptions
|
|
1476
|
+
});
|
|
1477
|
+
return ownColumns.length > 0 ? [...ownColumns, ...baseColumns] : baseColumns;
|
|
1012
1478
|
}, [
|
|
1013
1479
|
baseColumns,
|
|
1014
|
-
|
|
1015
|
-
|
|
1480
|
+
hasDragColumn,
|
|
1481
|
+
hasSelectColumn,
|
|
1016
1482
|
hasExpandColumn
|
|
1017
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)));
|
|
1018
1491
|
const [internalColumnPinning, setInternalColumnPinning] = useState(EMPTY_PINNING);
|
|
1019
1492
|
const columnPinning = columnPinningProp ?? internalColumnPinning;
|
|
1020
|
-
const setColumnPinning =
|
|
1021
|
-
const
|
|
1022
|
-
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 ? {
|
|
1023
1497
|
...pinning,
|
|
1024
|
-
start: [
|
|
1498
|
+
start: [...pinnedOwnColumnIds, ...pinning.start]
|
|
1025
1499
|
} : pinning;
|
|
1026
|
-
const tablePinning =
|
|
1027
|
-
const handleColumnPinningChange = (
|
|
1028
|
-
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;
|
|
1029
1503
|
return {
|
|
1030
1504
|
...next,
|
|
1031
|
-
start: next.start.filter((
|
|
1505
|
+
start: next.start.filter((id_1) => !isOwnColumn(id_1))
|
|
1032
1506
|
};
|
|
1033
1507
|
});
|
|
1034
1508
|
const [internalExpanded, setInternalExpanded] = useState({});
|
|
1035
1509
|
const expanded = expandedProp ?? internalExpanded;
|
|
1036
|
-
const setExpanded =
|
|
1510
|
+
const setExpanded = onExpandedChange ?? setInternalExpanded;
|
|
1037
1511
|
const [internalColumnSizing, setInternalColumnSizing] = useState(EMPTY_SIZING);
|
|
1038
1512
|
const columnSizing = enableColumnResizing && (columnSizingProp ?? internalColumnSizing) || EMPTY_SIZING;
|
|
1039
|
-
const setColumnSizing =
|
|
1513
|
+
const setColumnSizing = onColumnSizingChange ?? setInternalColumnSizing;
|
|
1040
1514
|
const [isSticky, setIsSticky] = useState(false);
|
|
1041
1515
|
const [isStuckStart, setIsStuckStart] = useState(false);
|
|
1042
1516
|
const [isStuckEnd, setIsStuckEnd] = useState(false);
|
|
@@ -1071,7 +1545,7 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
1071
1545
|
columns: tableColumns,
|
|
1072
1546
|
state: {
|
|
1073
1547
|
sorting,
|
|
1074
|
-
columnOrder,
|
|
1548
|
+
columnOrder: columnOrder && withOwnColumns(columnOrder),
|
|
1075
1549
|
columnVisibility,
|
|
1076
1550
|
columnPinning: tablePinning,
|
|
1077
1551
|
columnSizing,
|
|
@@ -1079,38 +1553,39 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
1079
1553
|
},
|
|
1080
1554
|
rowCount: items.length,
|
|
1081
1555
|
manualPagination: true,
|
|
1082
|
-
onColumnOrderChange:
|
|
1083
|
-
onColumnVisibilityChange
|
|
1556
|
+
onColumnOrderChange: handleColumnOrderChange,
|
|
1557
|
+
onColumnVisibilityChange,
|
|
1084
1558
|
onColumnPinningChange: handleColumnPinningChange,
|
|
1085
1559
|
onColumnSizingChange: setColumnSizing,
|
|
1086
|
-
onSortingChange
|
|
1560
|
+
onSortingChange,
|
|
1087
1561
|
onRowSelectionChange: handleRowSelectionChange,
|
|
1088
1562
|
manualSorting: true,
|
|
1563
|
+
enableSorting: onSortingChange !== void 0,
|
|
1089
1564
|
autoResetPageIndex: false,
|
|
1090
1565
|
autoResetExpanded: false,
|
|
1091
1566
|
defaultColumn: {
|
|
1092
1567
|
sortDescFirst: true,
|
|
1093
1568
|
minSize: 60
|
|
1094
1569
|
},
|
|
1095
|
-
enableRowSelection,
|
|
1570
|
+
enableRowSelection: enableRowSelection ?? false,
|
|
1096
1571
|
enableMultiRowSelection,
|
|
1097
|
-
getRowId: getRowId ? (
|
|
1572
|
+
getRowId: getRowId ? (row_0) => String(getRowId(row_0)) : void 0
|
|
1098
1573
|
});
|
|
1099
1574
|
const dataIds = useMemo(() => {
|
|
1100
1575
|
if (!enableDragDrop || !getRowId) return [];
|
|
1101
|
-
return data.map((item) => getRowId(item));
|
|
1576
|
+
return data.map((item) => String(getRowId(item)));
|
|
1102
1577
|
}, [
|
|
1103
1578
|
data,
|
|
1104
1579
|
enableDragDrop,
|
|
1105
1580
|
getRowId
|
|
1106
1581
|
]);
|
|
1107
|
-
const handleDragEnd = useCallback((
|
|
1108
|
-
const { active, over } =
|
|
1582
|
+
const handleDragEnd = useCallback((event_0) => {
|
|
1583
|
+
const { active, over } = event_0;
|
|
1109
1584
|
if (!active || !over || active.id === over.id) return;
|
|
1110
1585
|
if (getRowId && (onReorder || onDragEnd)) {
|
|
1111
1586
|
if (onReorder) {
|
|
1112
|
-
const oldIndex = items.findIndex((item_0) => getRowId(item_0) === active.id);
|
|
1113
|
-
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));
|
|
1114
1589
|
if (oldIndex !== -1 && newIndex !== -1) {
|
|
1115
1590
|
const reorderedItems = [...items];
|
|
1116
1591
|
const [movedItem] = reorderedItems.splice(oldIndex, 1);
|
|
@@ -1118,7 +1593,7 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
1118
1593
|
onReorder(reorderedItems);
|
|
1119
1594
|
}
|
|
1120
1595
|
}
|
|
1121
|
-
onDragEnd?.(
|
|
1596
|
+
onDragEnd?.(event_0);
|
|
1122
1597
|
}
|
|
1123
1598
|
}, [
|
|
1124
1599
|
onDragEnd,
|
|
@@ -1129,15 +1604,15 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
1129
1604
|
const selectedRows = table.getSelectedRowModel().rows;
|
|
1130
1605
|
const columnCount = table.getHeaderGroups()[0].headers.length;
|
|
1131
1606
|
const isAnyRowSelected = selectedRows.length > 0 && !!ActionHeader;
|
|
1132
|
-
const hasOnClick = !!
|
|
1607
|
+
const hasOnClick = !!onRowAction || !!onRowDoubleClick;
|
|
1133
1608
|
const hasPinnedColumns = columnPinning.start.length > 0 || columnPinning.end.length > 0;
|
|
1134
1609
|
const rows = table.getRowModel().rows;
|
|
1135
|
-
const
|
|
1610
|
+
const unborderedIndex = hasExpandColumn ? ownColumnIds.length : 0;
|
|
1136
1611
|
const expandableRows = useExpandableRows({
|
|
1137
1612
|
rowDetails: hasExpandColumn ? rowDetails : void 0,
|
|
1138
1613
|
expanded,
|
|
1139
1614
|
setExpanded,
|
|
1140
|
-
rowIds: rows.map((
|
|
1615
|
+
rowIds: rows.map((row_1) => row_1.id),
|
|
1141
1616
|
tableRef,
|
|
1142
1617
|
scroll
|
|
1143
1618
|
});
|
|
@@ -1145,11 +1620,11 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
1145
1620
|
const isWideEnoughForSplit = useBreakpoint("lg");
|
|
1146
1621
|
const sidePanelMode = hasSidePanel && rowDetailsMode === "split" && isWideEnoughForSplit ? "split" : "drawer";
|
|
1147
1622
|
const openRowId = hasSidePanel && expanded !== true ? Object.keys(expanded).find((rowId) => expanded[rowId]) : void 0;
|
|
1148
|
-
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);
|
|
1149
1624
|
const [lastOpenRow, setLastOpenRow] = useState(openRow);
|
|
1150
1625
|
if (openRow && openRow !== lastOpenRow) setLastOpenRow(openRow);
|
|
1151
1626
|
const detailsRow = openRow ?? lastOpenRow;
|
|
1152
|
-
const canOpenDetails = (
|
|
1627
|
+
const canOpenDetails = (row_3) => hasSidePanel && (rowDetails?.canOpen?.(row_3.original) ?? true);
|
|
1153
1628
|
const openDetails = (rowId_0) => setExpanded({ [rowId_0]: true });
|
|
1154
1629
|
const closeDetails = () => setExpanded({});
|
|
1155
1630
|
const leafHeaders = table.getHeaderGroups().at(-1)?.headers ?? [];
|
|
@@ -1190,14 +1665,14 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
1190
1665
|
accumulate(startHeaders);
|
|
1191
1666
|
accumulate(endHeaders);
|
|
1192
1667
|
if (isResizing) {
|
|
1193
|
-
tableRef.current?.querySelectorAll("[data-pinned][data-column-id]").forEach((
|
|
1194
|
-
const offset_0 = offsets[
|
|
1195
|
-
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`;
|
|
1196
1671
|
});
|
|
1197
1672
|
requestAnimationFrame(updateStuck);
|
|
1198
1673
|
return;
|
|
1199
1674
|
}
|
|
1200
|
-
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);
|
|
1201
1676
|
requestAnimationFrame(updateStuck);
|
|
1202
1677
|
};
|
|
1203
1678
|
measure();
|
|
@@ -1211,7 +1686,7 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
1211
1686
|
};
|
|
1212
1687
|
}, [
|
|
1213
1688
|
columnPinning,
|
|
1214
|
-
|
|
1689
|
+
pinnedOwnColumnIds.length,
|
|
1215
1690
|
columnVisibility,
|
|
1216
1691
|
columnOrder,
|
|
1217
1692
|
isAnyRowSelected,
|
|
@@ -1230,6 +1705,7 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
1230
1705
|
ref: tableRef,
|
|
1231
1706
|
className: clsx("group/table w-full font-sans text-sm", hasPinnedColumns && "border-separate border-spacing-0", className),
|
|
1232
1707
|
style: columnResize.tableStyle,
|
|
1708
|
+
"aria-busy": isLoading || void 0,
|
|
1233
1709
|
"data-has-pinned": hasPinnedColumns || void 0,
|
|
1234
1710
|
"data-stuck-start": isStuckStart || void 0,
|
|
1235
1711
|
"data-stuck-end": isStuckEnd || void 0,
|
|
@@ -1257,6 +1733,7 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
1257
1733
|
desc: "descending"
|
|
1258
1734
|
}[header_3.column.getIsSorted()] ?? "none" : void 0;
|
|
1259
1735
|
return /* @__PURE__ */ jsx("th", {
|
|
1736
|
+
scope: "col",
|
|
1260
1737
|
colSpan: isAnyRowSelected ? columnCount : header_3.colSpan,
|
|
1261
1738
|
tabIndex: -1,
|
|
1262
1739
|
"aria-sort": ariaSort,
|
|
@@ -1264,28 +1741,39 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
1264
1741
|
...pinned ? getPinnedProps(header_3.column, pinnedOffsets) : {},
|
|
1265
1742
|
className: clsx(tableHeadDataCva({
|
|
1266
1743
|
variant,
|
|
1267
|
-
hasRightBorder: index >
|
|
1744
|
+
hasRightBorder: index > 0 && index !== unborderedIndex && showColumnBorders
|
|
1268
1745
|
}), "group/th", enableColumnResizing && "relative pointer-coarse:pr-6", columnMeta.headerClass, !columnResize.hasFixedWidths && columnMeta.width),
|
|
1269
|
-
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", {
|
|
1270
1750
|
className: "flex min-w-0 items-center gap-1",
|
|
1271
1751
|
children: [
|
|
1272
1752
|
/* @__PURE__ */ jsx("div", {
|
|
1273
1753
|
className: "flex min-w-0 flex-1",
|
|
1274
|
-
children:
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
onClick: header_3.column.getToggleSortingHandler(),
|
|
1278
|
-
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, {
|
|
1279
1757
|
className: enableColumnResizing ? "min-w-0 whitespace-nowrap" : void 0,
|
|
1280
1758
|
children: header_3.column.columnDef.header
|
|
1281
1759
|
}), {
|
|
1282
1760
|
asc: /* @__PURE__ */ jsx(IconSlot, { icon: ArrowUp }),
|
|
1283
1761
|
desc: /* @__PURE__ */ jsx(IconSlot, { icon: ArrowDown })
|
|
1284
|
-
}[header_3.column.getIsSorted()] ?? (
|
|
1762
|
+
}[header_3.column.getIsSorted()] ?? (canSort ? /* @__PURE__ */ jsx(IconSlot, {
|
|
1285
1763
|
icon: ArrowUpDown,
|
|
1286
1764
|
className: "text-foreground opacity-60"
|
|
1287
|
-
}) : null)]
|
|
1288
|
-
|
|
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
|
+
})()
|
|
1289
1777
|
}),
|
|
1290
1778
|
enableColumnPinning && header_3.column.getCanPin() && (pinned || (columnSizing[header_3.column.id] ?? Infinity) >= MIN_PINNABLE_COLUMN_WIDTH) && /* @__PURE__ */ jsx(Tooltip, {
|
|
1291
1779
|
text: `${pinned ? "Unpin" : "Pin"} ${columnName}`,
|
|
@@ -1304,15 +1792,14 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
1304
1792
|
enableColumnResizing && !header_3.isPlaceholder && header_3.column.columns.length === 0 && header_3.column.columnDef.enableResizing !== false && /* @__PURE__ */ jsx(ColumnResizeHandle, {
|
|
1305
1793
|
columnName,
|
|
1306
1794
|
isResizing: columnResize.resizingColumnId === header_3.column.id,
|
|
1307
|
-
width: columnSizing[header_3.column.id],
|
|
1308
1795
|
minWidth: header_3.column.columnDef.minSize ?? 60,
|
|
1309
1796
|
maxWidth: header_3.column.columnDef.maxSize === Number.MAX_SAFE_INTEGER ? void 0 : header_3.column.columnDef.maxSize,
|
|
1310
|
-
onPointerDown: (
|
|
1797
|
+
onPointerDown: (event_1) => columnResize.onPointerDown(event_1, {
|
|
1311
1798
|
id: header_3.column.id,
|
|
1312
1799
|
minSize: header_3.column.columnDef.minSize,
|
|
1313
1800
|
maxSize: header_3.column.columnDef.maxSize
|
|
1314
1801
|
}),
|
|
1315
|
-
onKeyDown: (
|
|
1802
|
+
onKeyDown: (event_2) => columnResize.onKeyDown(event_2, {
|
|
1316
1803
|
id: header_3.column.id,
|
|
1317
1804
|
minSize: header_3.column.columnDef.minSize,
|
|
1318
1805
|
maxSize: header_3.column.columnDef.maxSize
|
|
@@ -1325,89 +1812,125 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
1325
1812
|
}, headerGroup.id))
|
|
1326
1813
|
}),
|
|
1327
1814
|
/* @__PURE__ */ jsx("tbody", {
|
|
1328
|
-
ref,
|
|
1815
|
+
ref: syncTabStopCell,
|
|
1816
|
+
onFocus: moveTabStopCell,
|
|
1329
1817
|
className: "relative",
|
|
1330
|
-
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, {
|
|
1331
1835
|
items: dataIds,
|
|
1332
|
-
children: table.getRowModel().rows.map((
|
|
1333
|
-
id:
|
|
1836
|
+
children: table.getRowModel().rows.map((row_4) => /* @__PURE__ */ jsx(DraggableRow, {
|
|
1837
|
+
id: row_4.id,
|
|
1334
1838
|
className: clsx(tableRowCva({
|
|
1335
1839
|
...props,
|
|
1336
1840
|
variant
|
|
1337
1841
|
})),
|
|
1338
|
-
isClickable: hasOnClick ||
|
|
1339
|
-
isSelected:
|
|
1340
|
-
onClick: () => {
|
|
1341
|
-
if (
|
|
1342
|
-
|
|
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);
|
|
1343
1851
|
return;
|
|
1344
1852
|
}
|
|
1345
|
-
if (
|
|
1853
|
+
if (row_4.getCanSelect() && !isFromRowControl(event_3)) row_4.toggleSelected();
|
|
1854
|
+
},
|
|
1855
|
+
onDoubleClick: (event_4) => {
|
|
1856
|
+
if (!isFromSelectCell(event_4)) onRowDoubleClick?.(row_4.original);
|
|
1346
1857
|
},
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
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 ?? {};
|
|
1350
1863
|
return /* @__PURE__ */ jsx("td", {
|
|
1351
1864
|
tabIndex: -1,
|
|
1352
|
-
|
|
1865
|
+
"data-select-cell": cell_1.column.id === "row-select" || void 0,
|
|
1866
|
+
...getPinnedProps(cell_1.column, pinnedOffsets),
|
|
1353
1867
|
className: clsx(tableDataCva({
|
|
1354
1868
|
variant,
|
|
1355
1869
|
hasRightBorder: cellIndex > 0 && showColumnBorders
|
|
1356
1870
|
}), columnMeta_0.cellClass, !columnResize.hasFixedWidths && columnMeta_0.width),
|
|
1357
|
-
children: renderCell(
|
|
1358
|
-
},
|
|
1871
|
+
children: renderCell(cell_1.column.columnDef.cell, CustomCellContext(cell_1.getContext()))
|
|
1872
|
+
}, cell_1.id);
|
|
1359
1873
|
})
|
|
1360
|
-
},
|
|
1361
|
-
}) : rows.map((
|
|
1362
|
-
const canExpand = expandableRows.context.canExpand(
|
|
1363
|
-
const isExpanded = canExpand && expandableRows.context.isExpanded(
|
|
1364
|
-
const hasDetails = canOpenDetails(
|
|
1365
|
-
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();
|
|
1366
1880
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("tr", {
|
|
1367
1881
|
className: clsx(tableRowCva({
|
|
1368
1882
|
...props,
|
|
1369
1883
|
variant
|
|
1370
1884
|
})),
|
|
1371
|
-
onClick: (
|
|
1372
|
-
if (
|
|
1373
|
-
|
|
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);
|
|
1374
1892
|
return;
|
|
1375
1893
|
}
|
|
1376
1894
|
if (canExpand || hasDetails) {
|
|
1377
|
-
if (isFromRowControl(
|
|
1378
|
-
if (canExpand) expandableRows.context.toggle(
|
|
1379
|
-
else openDetails(
|
|
1895
|
+
if (isFromRowControl(event_6)) return;
|
|
1896
|
+
if (canExpand) expandableRows.context.toggle(row_5.id);
|
|
1897
|
+
else openDetails(row_5.id);
|
|
1380
1898
|
return;
|
|
1381
1899
|
}
|
|
1382
|
-
if (
|
|
1900
|
+
if (row_5.getCanSelect() && !isFromRowControl(event_6)) row_5.toggleSelected();
|
|
1383
1901
|
},
|
|
1384
|
-
onKeyDown:
|
|
1385
|
-
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);
|
|
1386
1906
|
} : void 0,
|
|
1387
|
-
onDoubleClick: () =>
|
|
1388
|
-
|
|
1389
|
-
|
|
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,
|
|
1390
1912
|
"data-expanded": isExpanded || void 0,
|
|
1391
|
-
"data-details-open": hasSidePanel &&
|
|
1392
|
-
children: cells.map((
|
|
1393
|
-
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 ?? {};
|
|
1394
1916
|
return /* @__PURE__ */ jsx("td", {
|
|
1395
1917
|
tabIndex: -1,
|
|
1396
|
-
|
|
1918
|
+
"data-select-cell": cell_2.column.id === "row-select" || void 0,
|
|
1919
|
+
...getPinnedProps(cell_2.column, pinnedOffsets),
|
|
1397
1920
|
className: clsx(tableDataCva({
|
|
1398
1921
|
variant,
|
|
1399
|
-
hasRightBorder: cellIndex_0 >
|
|
1922
|
+
hasRightBorder: cellIndex_0 > 0 && cellIndex_0 !== unborderedIndex && showColumnBorders
|
|
1400
1923
|
}), columnMeta_1.cellClass, !columnResize.hasFixedWidths && columnMeta_1.width),
|
|
1401
|
-
children: renderCell(
|
|
1402
|
-
},
|
|
1924
|
+
children: renderCell(cell_2.column.columnDef.cell, CustomCellContext(cell_2.getContext()))
|
|
1925
|
+
}, cell_2.id);
|
|
1403
1926
|
})
|
|
1404
1927
|
}), isExpanded && rowDetails && /* @__PURE__ */ jsx(RowDetailsRow, {
|
|
1405
|
-
id: expandableRows.context.getDetailsId(
|
|
1928
|
+
id: expandableRows.context.getDetailsId(row_5.id),
|
|
1406
1929
|
colSpan: cells.length,
|
|
1407
1930
|
variant,
|
|
1408
1931
|
panelWidth: expandableRows.panelWidth,
|
|
1409
|
-
children: rowDetails.render(
|
|
1410
|
-
})] },
|
|
1932
|
+
children: rowDetails.render(row_5.original, { close: () => expandableRows.context.toggle(row_5.id) })
|
|
1933
|
+
})] }, row_5.id);
|
|
1411
1934
|
})
|
|
1412
1935
|
})
|
|
1413
1936
|
]
|
|
@@ -1449,186 +1972,9 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
1449
1972
|
return tableElement;
|
|
1450
1973
|
};
|
|
1451
1974
|
//#endregion
|
|
1452
|
-
//#region src/components/table/ColumnConfig.tsx
|
|
1453
|
-
const VisibilityCell = (t0) => {
|
|
1454
|
-
const $ = c(7);
|
|
1455
|
-
const { original, onToggle } = t0;
|
|
1456
|
-
let t1;
|
|
1457
|
-
if ($[0] !== onToggle || $[1] !== original.id) {
|
|
1458
|
-
t1 = () => onToggle(original.id);
|
|
1459
|
-
$[0] = onToggle;
|
|
1460
|
-
$[1] = original.id;
|
|
1461
|
-
$[2] = t1;
|
|
1462
|
-
} else t1 = $[2];
|
|
1463
|
-
const t2 = original.label;
|
|
1464
|
-
let t3;
|
|
1465
|
-
if ($[3] !== original.visible || $[4] !== t1 || $[5] !== t2) {
|
|
1466
|
-
t3 = /* @__PURE__ */ jsx(Checkbox, {
|
|
1467
|
-
isSelected: original.visible,
|
|
1468
|
-
onChange: t1,
|
|
1469
|
-
hideLabel: true,
|
|
1470
|
-
children: t2
|
|
1471
|
-
});
|
|
1472
|
-
$[3] = original.visible;
|
|
1473
|
-
$[4] = t1;
|
|
1474
|
-
$[5] = t2;
|
|
1475
|
-
$[6] = t3;
|
|
1476
|
-
} else t3 = $[6];
|
|
1477
|
-
return t3;
|
|
1478
|
-
};
|
|
1479
|
-
const getColumns = (t, handleToggleVisibility) => [{
|
|
1480
|
-
id: "name",
|
|
1481
|
-
header: t(($) => $.ui.table.column, { ns: "ui" }),
|
|
1482
|
-
meta: { width: "flex-1" },
|
|
1483
|
-
accessorKey: "label"
|
|
1484
|
-
}, {
|
|
1485
|
-
id: "visible",
|
|
1486
|
-
header: t(($) => $.ui.table.show, { ns: "ui" }),
|
|
1487
|
-
meta: { width: "w-20" },
|
|
1488
|
-
cell: ({ original }) => /* @__PURE__ */ jsx(VisibilityCell, {
|
|
1489
|
-
original,
|
|
1490
|
-
onToggle: handleToggleVisibility
|
|
1491
|
-
})
|
|
1492
|
-
}];
|
|
1493
|
-
function ColumnConfigModal(t0) {
|
|
1494
|
-
const $ = c(27);
|
|
1495
|
-
const { isOpen, onClose, configColumns, visibleColumns, onVisibilityChange, onOrderChange } = t0;
|
|
1496
|
-
const { t } = useTranslation("ui");
|
|
1497
|
-
let t1;
|
|
1498
|
-
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1499
|
-
t1 = [];
|
|
1500
|
-
$[0] = t1;
|
|
1501
|
-
} else t1 = $[0];
|
|
1502
|
-
const [data, setData] = useState(t1);
|
|
1503
|
-
let t2;
|
|
1504
|
-
let t3;
|
|
1505
|
-
if ($[1] !== configColumns || $[2] !== visibleColumns) {
|
|
1506
|
-
t2 = () => {
|
|
1507
|
-
setData(configColumns.map((column) => {
|
|
1508
|
-
const columnId = column.id ?? column.accessorKey;
|
|
1509
|
-
return {
|
|
1510
|
-
id: columnId,
|
|
1511
|
-
label: column.header,
|
|
1512
|
-
visible: visibleColumns?.[columnId] ?? true
|
|
1513
|
-
};
|
|
1514
|
-
}));
|
|
1515
|
-
};
|
|
1516
|
-
t3 = [configColumns, visibleColumns];
|
|
1517
|
-
$[1] = configColumns;
|
|
1518
|
-
$[2] = visibleColumns;
|
|
1519
|
-
$[3] = t2;
|
|
1520
|
-
$[4] = t3;
|
|
1521
|
-
} else {
|
|
1522
|
-
t2 = $[3];
|
|
1523
|
-
t3 = $[4];
|
|
1524
|
-
}
|
|
1525
|
-
useEffect(t2, t3);
|
|
1526
|
-
let t4;
|
|
1527
|
-
if ($[5] !== onVisibilityChange || $[6] !== visibleColumns) {
|
|
1528
|
-
t4 = (columnId_0) => {
|
|
1529
|
-
const newVisible = {
|
|
1530
|
-
...visibleColumns,
|
|
1531
|
-
[columnId_0]: !visibleColumns[columnId_0]
|
|
1532
|
-
};
|
|
1533
|
-
onVisibilityChange(newVisible);
|
|
1534
|
-
};
|
|
1535
|
-
$[5] = onVisibilityChange;
|
|
1536
|
-
$[6] = visibleColumns;
|
|
1537
|
-
$[7] = t4;
|
|
1538
|
-
} else t4 = $[7];
|
|
1539
|
-
const handleToggleVisibility = t4;
|
|
1540
|
-
let t5;
|
|
1541
|
-
if ($[8] !== handleToggleVisibility) {
|
|
1542
|
-
t5 = (translateFn) => getColumns(translateFn, handleToggleVisibility);
|
|
1543
|
-
$[8] = handleToggleVisibility;
|
|
1544
|
-
$[9] = t5;
|
|
1545
|
-
} else t5 = $[9];
|
|
1546
|
-
const columns = useTranslationMemo(t5);
|
|
1547
|
-
let t6;
|
|
1548
|
-
if ($[10] !== onOrderChange) {
|
|
1549
|
-
t6 = (reorderedItems) => {
|
|
1550
|
-
setData(reorderedItems);
|
|
1551
|
-
onOrderChange(reorderedItems.map(_temp$2));
|
|
1552
|
-
};
|
|
1553
|
-
$[10] = onOrderChange;
|
|
1554
|
-
$[11] = t6;
|
|
1555
|
-
} else t6 = $[11];
|
|
1556
|
-
const handleReorder = t6;
|
|
1557
|
-
if (!isOpen) return null;
|
|
1558
|
-
let t7;
|
|
1559
|
-
if ($[12] !== t) {
|
|
1560
|
-
t7 = t(_temp2$2);
|
|
1561
|
-
$[12] = t;
|
|
1562
|
-
$[13] = t7;
|
|
1563
|
-
} else t7 = $[13];
|
|
1564
|
-
let t8;
|
|
1565
|
-
if ($[14] !== t7) {
|
|
1566
|
-
t8 = /* @__PURE__ */ jsx(Typography, {
|
|
1567
|
-
as: "h2",
|
|
1568
|
-
className: "font-semibold",
|
|
1569
|
-
size: "h3",
|
|
1570
|
-
children: t7
|
|
1571
|
-
});
|
|
1572
|
-
$[14] = t7;
|
|
1573
|
-
$[15] = t8;
|
|
1574
|
-
} else t8 = $[15];
|
|
1575
|
-
let t9;
|
|
1576
|
-
if ($[16] !== columns || $[17] !== data || $[18] !== handleReorder) {
|
|
1577
|
-
t9 = /* @__PURE__ */ jsx("div", {
|
|
1578
|
-
className: "max-h-96 overflow-y-auto",
|
|
1579
|
-
children: /* @__PURE__ */ jsx(Table, {
|
|
1580
|
-
items: data,
|
|
1581
|
-
columns,
|
|
1582
|
-
showCellBorder: true,
|
|
1583
|
-
className: "w-full",
|
|
1584
|
-
enableDragDrop: true,
|
|
1585
|
-
getRowId: _temp3,
|
|
1586
|
-
onReorder: handleReorder
|
|
1587
|
-
})
|
|
1588
|
-
});
|
|
1589
|
-
$[16] = columns;
|
|
1590
|
-
$[17] = data;
|
|
1591
|
-
$[18] = handleReorder;
|
|
1592
|
-
$[19] = t9;
|
|
1593
|
-
} else t9 = $[19];
|
|
1594
|
-
let t10;
|
|
1595
|
-
if ($[20] !== t8 || $[21] !== t9) {
|
|
1596
|
-
t10 = /* @__PURE__ */ jsxs("div", {
|
|
1597
|
-
className: "flex flex-col gap-2 p-4",
|
|
1598
|
-
children: [t8, t9]
|
|
1599
|
-
});
|
|
1600
|
-
$[20] = t8;
|
|
1601
|
-
$[21] = t9;
|
|
1602
|
-
$[22] = t10;
|
|
1603
|
-
} else t10 = $[22];
|
|
1604
|
-
let t11;
|
|
1605
|
-
if ($[23] !== isOpen || $[24] !== onClose || $[25] !== t10) {
|
|
1606
|
-
t11 = /* @__PURE__ */ jsx(Dialog, {
|
|
1607
|
-
isOpen,
|
|
1608
|
-
onClose,
|
|
1609
|
-
showCloseIcon: true,
|
|
1610
|
-
children: t10
|
|
1611
|
-
});
|
|
1612
|
-
$[23] = isOpen;
|
|
1613
|
-
$[24] = onClose;
|
|
1614
|
-
$[25] = t10;
|
|
1615
|
-
$[26] = t11;
|
|
1616
|
-
} else t11 = $[26];
|
|
1617
|
-
return t11;
|
|
1618
|
-
}
|
|
1619
|
-
function _temp3(row) {
|
|
1620
|
-
return row.id;
|
|
1621
|
-
}
|
|
1622
|
-
function _temp2$2($) {
|
|
1623
|
-
return $.ui.table.configureColumns;
|
|
1624
|
-
}
|
|
1625
|
-
function _temp$2(item) {
|
|
1626
|
-
return item.id;
|
|
1627
|
-
}
|
|
1628
|
-
//#endregion
|
|
1629
1975
|
//#region src/components/table/InfiniteTable.tsx
|
|
1630
1976
|
const InfiniteTable = (t0) => {
|
|
1631
|
-
const $ = c(
|
|
1977
|
+
const $ = c(35);
|
|
1632
1978
|
let fetchNextPage;
|
|
1633
1979
|
let hasNextPage;
|
|
1634
1980
|
let rest;
|
|
@@ -1647,294 +1993,195 @@ const InfiniteTable = (t0) => {
|
|
|
1647
1993
|
t1 = $[4];
|
|
1648
1994
|
}
|
|
1649
1995
|
const isFetchingNextPage = t1 === void 0 ? false : t1;
|
|
1996
|
+
const itemCount = rest.items.length;
|
|
1997
|
+
const requestedAtCountRef = useRef(null);
|
|
1650
1998
|
let t2;
|
|
1651
|
-
if ($[5] !== fetchNextPage || $[6] !== hasNextPage || $[7] !== isFetchingNextPage) {
|
|
1999
|
+
if ($[5] !== fetchNextPage || $[6] !== hasNextPage || $[7] !== isFetchingNextPage || $[8] !== itemCount || $[9] !== rest.isLoading) {
|
|
1652
2000
|
t2 = () => {
|
|
1653
|
-
if (!isFetchingNextPage && hasNextPage)
|
|
2001
|
+
if (!isFetchingNextPage && hasNextPage && !rest.isLoading) {
|
|
2002
|
+
requestedAtCountRef.current = itemCount;
|
|
2003
|
+
fetchNextPage();
|
|
2004
|
+
}
|
|
1654
2005
|
};
|
|
1655
2006
|
$[5] = fetchNextPage;
|
|
1656
2007
|
$[6] = hasNextPage;
|
|
1657
2008
|
$[7] = isFetchingNextPage;
|
|
1658
|
-
$[8] =
|
|
1659
|
-
|
|
2009
|
+
$[8] = itemCount;
|
|
2010
|
+
$[9] = rest.isLoading;
|
|
2011
|
+
$[10] = t2;
|
|
2012
|
+
} else t2 = $[10];
|
|
1660
2013
|
const handleLoadMore = t2;
|
|
1661
2014
|
let t3;
|
|
1662
|
-
if ($[
|
|
2015
|
+
if ($[11] !== handleLoadMore) {
|
|
1663
2016
|
t3 = {
|
|
1664
2017
|
onIntersection: handleLoadMore,
|
|
1665
2018
|
rootMargin: "100px"
|
|
1666
2019
|
};
|
|
1667
|
-
$[
|
|
1668
|
-
$[
|
|
1669
|
-
} else t3 = $[
|
|
1670
|
-
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);
|
|
1671
2025
|
let t4;
|
|
1672
|
-
if ($[11] !== rest) {
|
|
1673
|
-
t4 = /* @__PURE__ */ jsx(Table, { ...rest });
|
|
1674
|
-
$[11] = rest;
|
|
1675
|
-
$[12] = t4;
|
|
1676
|
-
} else t4 = $[12];
|
|
1677
2026
|
let t5;
|
|
1678
|
-
if ($[13] !==
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
$[
|
|
1685
|
-
$[
|
|
1686
|
-
$[15] = ref;
|
|
1687
|
-
$[16] = t5;
|
|
1688
|
-
} else t5 = $[16];
|
|
1689
|
-
let t6;
|
|
1690
|
-
if ($[17] !== t4 || $[18] !== t5) {
|
|
1691
|
-
t6 = /* @__PURE__ */ jsxs("div", {
|
|
1692
|
-
className: "flex flex-col",
|
|
1693
|
-
children: [t4, t5]
|
|
1694
|
-
});
|
|
1695
|
-
$[17] = t4;
|
|
1696
|
-
$[18] = t5;
|
|
1697
|
-
$[19] = t6;
|
|
1698
|
-
} else t6 = $[19];
|
|
1699
|
-
return t6;
|
|
1700
|
-
};
|
|
1701
|
-
//#endregion
|
|
1702
|
-
//#region src/components/table/PaginatedTable.tsx
|
|
1703
|
-
const PaginatedTable = (t0) => {
|
|
1704
|
-
const $ = c(24);
|
|
1705
|
-
let items;
|
|
1706
|
-
let pagination;
|
|
1707
|
-
let rest;
|
|
1708
|
-
let setPagination;
|
|
1709
|
-
let totalItems;
|
|
1710
|
-
if ($[0] !== t0) {
|
|
1711
|
-
({pagination, setPagination, items, totalItems, ...rest} = t0);
|
|
1712
|
-
$[0] = t0;
|
|
1713
|
-
$[1] = items;
|
|
1714
|
-
$[2] = pagination;
|
|
1715
|
-
$[3] = rest;
|
|
1716
|
-
$[4] = setPagination;
|
|
1717
|
-
$[5] = totalItems;
|
|
2027
|
+
if ($[13] !== handleLoadMore) {
|
|
2028
|
+
t4 = () => {
|
|
2029
|
+
handleLoadMoreRef.current = handleLoadMore;
|
|
2030
|
+
};
|
|
2031
|
+
t5 = [handleLoadMore];
|
|
2032
|
+
$[13] = handleLoadMore;
|
|
2033
|
+
$[14] = t4;
|
|
2034
|
+
$[15] = t5;
|
|
1718
2035
|
} else {
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
rest = $[3];
|
|
1722
|
-
setPagination = $[4];
|
|
1723
|
-
totalItems = $[5];
|
|
2036
|
+
t4 = $[14];
|
|
2037
|
+
t5 = $[15];
|
|
1724
2038
|
}
|
|
1725
|
-
|
|
1726
|
-
if ($[6] !== items) {
|
|
1727
|
-
t1 = items ?? [];
|
|
1728
|
-
$[6] = items;
|
|
1729
|
-
$[7] = t1;
|
|
1730
|
-
} else t1 = $[7];
|
|
1731
|
-
let t2;
|
|
1732
|
-
if ($[8] !== rest || $[9] !== t1) {
|
|
1733
|
-
t2 = /* @__PURE__ */ jsx(Table, {
|
|
1734
|
-
...rest,
|
|
1735
|
-
items: t1
|
|
1736
|
-
});
|
|
1737
|
-
$[8] = rest;
|
|
1738
|
-
$[9] = t1;
|
|
1739
|
-
$[10] = t2;
|
|
1740
|
-
} else t2 = $[10];
|
|
1741
|
-
const t3 = pagination.pageIndex + 1;
|
|
1742
|
-
const t4 = totalItems ?? 0;
|
|
1743
|
-
let t5;
|
|
2039
|
+
useEffect(t4, t5);
|
|
1744
2040
|
let t6;
|
|
1745
|
-
if ($[
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
pageIndex: 0
|
|
1754
|
-
});
|
|
1755
|
-
$[11] = pagination;
|
|
1756
|
-
$[12] = setPagination;
|
|
1757
|
-
$[13] = t5;
|
|
1758
|
-
$[14] = t6;
|
|
1759
|
-
} else {
|
|
1760
|
-
t5 = $[13];
|
|
1761
|
-
t6 = $[14];
|
|
1762
|
-
}
|
|
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];
|
|
1763
2049
|
let t7;
|
|
1764
|
-
if ($[
|
|
1765
|
-
t7 =
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
$[
|
|
1773
|
-
$[
|
|
1774
|
-
$[
|
|
1775
|
-
$[
|
|
1776
|
-
$[
|
|
1777
|
-
$[
|
|
1778
|
-
} else 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);
|
|
1779
2066
|
let t8;
|
|
1780
|
-
if ($[
|
|
1781
|
-
t8 = /* @__PURE__ */
|
|
1782
|
-
|
|
1783
|
-
|
|
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", {
|
|
2075
|
+
ref,
|
|
2076
|
+
className: "flex justify-center py-4",
|
|
2077
|
+
children: /* @__PURE__ */ jsx(Spinner, {})
|
|
1784
2078
|
});
|
|
1785
|
-
$[
|
|
1786
|
-
$[
|
|
1787
|
-
$[
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
};
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
};
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
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", {
|
|
2088
|
+
className: "flex flex-col",
|
|
2089
|
+
children: [t8, t9]
|
|
2090
|
+
});
|
|
2091
|
+
$[32] = t8;
|
|
2092
|
+
$[33] = t9;
|
|
2093
|
+
$[34] = t10;
|
|
2094
|
+
} else t10 = $[34];
|
|
2095
|
+
return t10;
|
|
1801
2096
|
};
|
|
1802
|
-
/** Zero-based TanStack state; URL `page` values remain one-based. Defaults override initial URL state. */
|
|
1803
|
-
function usePagination(defaultPagination) {
|
|
1804
|
-
const $ = c(12);
|
|
1805
|
-
const { replace, searchParams } = UIRouter.useUIRouter();
|
|
1806
|
-
let t0;
|
|
1807
|
-
if ($[0] !== defaultPagination || $[1] !== searchParams) {
|
|
1808
|
-
t0 = () => defaultPagination ?? {
|
|
1809
|
-
pageIndex: parsePositiveInteger(searchParams.get("page"), 1) - 1,
|
|
1810
|
-
pageSize: parsePositiveInteger(searchParams.get("size"), DEFAULT_STATE.pageSize)
|
|
1811
|
-
};
|
|
1812
|
-
$[0] = defaultPagination;
|
|
1813
|
-
$[1] = searchParams;
|
|
1814
|
-
$[2] = t0;
|
|
1815
|
-
} else t0 = $[2];
|
|
1816
|
-
const [pagination, setPagination] = useState(t0);
|
|
1817
|
-
let t1;
|
|
1818
|
-
if ($[3] !== pagination.pageIndex || $[4] !== pagination.pageSize || $[5] !== replace || $[6] !== searchParams) {
|
|
1819
|
-
t1 = () => {
|
|
1820
|
-
const params = new URLSearchParams(searchParams);
|
|
1821
|
-
params.delete("size");
|
|
1822
|
-
params.delete("page");
|
|
1823
|
-
if (pagination.pageSize !== DEFAULT_STATE.pageSize) params.set("size", pagination.pageSize.toString());
|
|
1824
|
-
if (pagination.pageIndex !== DEFAULT_STATE.pageIndex) params.set("page", (pagination.pageIndex + 1).toString());
|
|
1825
|
-
if (params.toString() === searchParams.toString()) return;
|
|
1826
|
-
replace(".", RoutingUtils.toRouterSearch(params));
|
|
1827
|
-
};
|
|
1828
|
-
$[3] = pagination.pageIndex;
|
|
1829
|
-
$[4] = pagination.pageSize;
|
|
1830
|
-
$[5] = replace;
|
|
1831
|
-
$[6] = searchParams;
|
|
1832
|
-
$[7] = t1;
|
|
1833
|
-
} else t1 = $[7];
|
|
1834
|
-
let t2;
|
|
1835
|
-
if ($[8] !== pagination) {
|
|
1836
|
-
t2 = [pagination];
|
|
1837
|
-
$[8] = pagination;
|
|
1838
|
-
$[9] = t2;
|
|
1839
|
-
} else t2 = $[9];
|
|
1840
|
-
useEffect(t1, t2);
|
|
1841
|
-
let t3;
|
|
1842
|
-
if ($[10] !== pagination) {
|
|
1843
|
-
t3 = {
|
|
1844
|
-
pagination,
|
|
1845
|
-
setPagination,
|
|
1846
|
-
pageIndex: pagination.pageIndex,
|
|
1847
|
-
pageSize: pagination.pageSize
|
|
1848
|
-
};
|
|
1849
|
-
$[10] = pagination;
|
|
1850
|
-
$[11] = t3;
|
|
1851
|
-
} else t3 = $[11];
|
|
1852
|
-
return t3;
|
|
1853
|
-
}
|
|
1854
2097
|
//#endregion
|
|
1855
2098
|
//#region src/hooks/useSorting.ts
|
|
1856
|
-
|
|
1857
|
-
const
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
let t1;
|
|
1861
|
-
if ($[0] !== defaultSorting || $[1] !== prefix || $[2] !== searchParams) {
|
|
1862
|
-
t1 = defaultSorting ?? searchParams.get(`order${prefix && `-${prefix}`}`)?.split(",").map(_temp$1) ?? [];
|
|
1863
|
-
$[0] = defaultSorting;
|
|
1864
|
-
$[1] = prefix;
|
|
1865
|
-
$[2] = searchParams;
|
|
1866
|
-
$[3] = t1;
|
|
1867
|
-
} else t1 = $[3];
|
|
1868
|
-
const [sorting, setSorting] = useState(t1);
|
|
1869
|
-
let t2;
|
|
1870
|
-
if ($[4] !== sorting) {
|
|
1871
|
-
t2 = sorting.map(_temp2$1).join(",");
|
|
1872
|
-
$[4] = sorting;
|
|
1873
|
-
$[5] = t2;
|
|
1874
|
-
} else t2 = $[5];
|
|
1875
|
-
const order = t2;
|
|
1876
|
-
let t3;
|
|
1877
|
-
if ($[6] !== order || $[7] !== prefix || $[8] !== replace || $[9] !== searchParams) {
|
|
1878
|
-
t3 = () => {
|
|
1879
|
-
const params = new URLSearchParams(searchParams);
|
|
1880
|
-
const orderKey = prefix ? `order-${prefix}` : "order";
|
|
1881
|
-
params.delete(orderKey);
|
|
1882
|
-
if (order) params.set(orderKey, order);
|
|
1883
|
-
if (params.toString() === searchParams.toString()) return;
|
|
1884
|
-
replace(".", RoutingUtils.toRouterSearch(params));
|
|
1885
|
-
};
|
|
1886
|
-
$[6] = order;
|
|
1887
|
-
$[7] = prefix;
|
|
1888
|
-
$[8] = replace;
|
|
1889
|
-
$[9] = searchParams;
|
|
1890
|
-
$[10] = t3;
|
|
1891
|
-
} else t3 = $[10];
|
|
1892
|
-
let t4;
|
|
1893
|
-
if ($[11] !== order) {
|
|
1894
|
-
t4 = [order];
|
|
1895
|
-
$[11] = order;
|
|
1896
|
-
$[12] = t4;
|
|
1897
|
-
} else t4 = $[12];
|
|
1898
|
-
useEffect(t3, t4);
|
|
1899
|
-
let t5;
|
|
1900
|
-
if ($[13] !== order || $[14] !== sorting) {
|
|
1901
|
-
t5 = {
|
|
1902
|
-
sorting,
|
|
1903
|
-
setSorting,
|
|
1904
|
-
order
|
|
1905
|
-
};
|
|
1906
|
-
$[13] = order;
|
|
1907
|
-
$[14] = sorting;
|
|
1908
|
-
$[15] = t5;
|
|
1909
|
-
} else t5 = $[15];
|
|
1910
|
-
return t5;
|
|
1911
|
-
}
|
|
1912
|
-
function _temp2$1(field) {
|
|
1913
|
-
return `${field.desc ? "-" : "+"}${field.id}`;
|
|
1914
|
-
}
|
|
1915
|
-
function _temp$1(item) {
|
|
1916
|
-
if (item.startsWith("-")) return {
|
|
1917
|
-
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),
|
|
1918
2103
|
desc: true
|
|
1919
2104
|
};
|
|
1920
|
-
if (
|
|
1921
|
-
id:
|
|
2105
|
+
if (field.startsWith("+")) return {
|
|
2106
|
+
id: field.slice(1),
|
|
1922
2107
|
desc: false
|
|
1923
2108
|
};
|
|
1924
2109
|
return {
|
|
1925
|
-
id:
|
|
2110
|
+
id: field,
|
|
1926
2111
|
desc: false
|
|
1927
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
|
+
};
|
|
1928
2162
|
}
|
|
1929
2163
|
//#endregion
|
|
1930
2164
|
//#region src/hooks/useTableColumnConfig.ts
|
|
2165
|
+
const getColumnKey = (column) => column.id ?? column.accessorKey;
|
|
1931
2166
|
function sortByKeyOrder(data, orderedKeys = []) {
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
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));
|
|
1935
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
|
+
*/
|
|
1936
2183
|
function useTableColumnConfig(defaultColumns, t0) {
|
|
1937
|
-
const $ = c(
|
|
2184
|
+
const $ = c(36);
|
|
1938
2185
|
let t1;
|
|
1939
2186
|
if ($[0] !== t0) {
|
|
1940
2187
|
t1 = t0 === void 0 ? {} : t0;
|
|
@@ -2007,46 +2254,66 @@ function useTableColumnConfig(defaultColumns, t0) {
|
|
|
2007
2254
|
} else t9 = $[15];
|
|
2008
2255
|
const handleOrderChange = t9;
|
|
2009
2256
|
let t10;
|
|
2010
|
-
if ($[16] !== defaultColumns || $[17] !==
|
|
2011
|
-
t10 =
|
|
2257
|
+
if ($[16] !== defaultColumns || $[17] !== handleOrderChange || $[18] !== handleVisibilityChange) {
|
|
2258
|
+
t10 = () => {
|
|
2259
|
+
handleVisibilityChange(Object.fromEntries(defaultColumns.map(_temp3)));
|
|
2260
|
+
handleOrderChange(defaultColumns.map(_temp4));
|
|
2261
|
+
};
|
|
2012
2262
|
$[16] = defaultColumns;
|
|
2013
|
-
$[17] =
|
|
2014
|
-
$[18] =
|
|
2015
|
-
|
|
2016
|
-
|
|
2263
|
+
$[17] = handleOrderChange;
|
|
2264
|
+
$[18] = handleVisibilityChange;
|
|
2265
|
+
$[19] = t10;
|
|
2266
|
+
} else t10 = $[19];
|
|
2267
|
+
const resetColumns = t10;
|
|
2017
2268
|
let t11;
|
|
2018
|
-
if ($[
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
t11 = configColumns.filter(t12);
|
|
2026
|
-
$[19] = configColumns;
|
|
2027
|
-
$[20] = internalVisibleColumns;
|
|
2028
|
-
$[21] = t11;
|
|
2029
|
-
} else t11 = $[21];
|
|
2030
|
-
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;
|
|
2031
2276
|
let t12;
|
|
2032
|
-
if ($[
|
|
2033
|
-
|
|
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 = {
|
|
2034
2293
|
configColumns,
|
|
2035
2294
|
columns,
|
|
2036
2295
|
visibleColumns: internalVisibleColumns,
|
|
2037
2296
|
columnOrder: internalColumnOrder,
|
|
2038
2297
|
onVisibilityChange: handleVisibilityChange,
|
|
2039
|
-
onOrderChange: handleOrderChange
|
|
2298
|
+
onOrderChange: handleOrderChange,
|
|
2299
|
+
resetColumns
|
|
2040
2300
|
};
|
|
2041
|
-
$[
|
|
2042
|
-
$[
|
|
2043
|
-
$[
|
|
2044
|
-
$[
|
|
2045
|
-
$[
|
|
2046
|
-
$[
|
|
2047
|
-
$[
|
|
2048
|
-
|
|
2049
|
-
|
|
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];
|
|
2050
2317
|
}
|
|
2051
2318
|
function _temp2(col_0) {
|
|
2052
2319
|
return col_0.id ?? col_0.accessorKey;
|
|
@@ -2057,4 +2324,4 @@ function _temp(acc, col) {
|
|
|
2057
2324
|
return acc;
|
|
2058
2325
|
}
|
|
2059
2326
|
//#endregion
|
|
2060
|
-
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 };
|