@povio/ui 6.0.0-rc.1 → 6.0.0-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MIGRATION.md +28 -0
- package/README.md +10 -37
- package/dist/{Accordion-DQRdeDs1.js → Accordion-ORBin0EZ.js} +12 -118
- package/dist/{Alert-Cee_nKWj.d.ts → Alert-D4X7OWiv.d.ts} +3 -3
- package/dist/{AlertDialog-uNDUIyng.d.ts → AlertDialog-DklLDjmw.d.ts} +3 -3
- package/dist/{Autocomplete-D_4gEL7D.d.ts → Autocomplete-BgFz3kuR.d.ts} +1 -1
- package/dist/{Autocomplete-CWU9Ev3J.js → Autocomplete-CsJAU233.js} +15 -12
- package/dist/{Autocomplete.bound-D0pgmsHB.js → Autocomplete.bound-CGC8m4dK.js} +2 -2
- package/dist/{Autocomplete.bound-CqhZtdd8.d.ts → Autocomplete.bound-CpHZZ3C9.d.ts} +1 -1
- package/dist/{Badge-C4HI9XX4.d.ts → Badge-Db1ndK67.d.ts} +2 -2
- package/dist/{BadgeButton-h3MeQYcp.d.ts → BadgeButton-BPhWDAnc.d.ts} +2 -2
- package/dist/{BottomSheet-BQXSdxoX.d.ts → BottomSheet-BZmDJBR-.d.ts} +1 -1
- package/dist/{BottomSheet-z5brMtDt.js → BottomSheet-CGipksM_.js} +10 -10
- package/dist/{BottomSheet.lazy-BzvLg8Ea.d.ts → BottomSheet.lazy-CuJMUeJP.d.ts} +1 -1
- package/dist/{Breadcrumbs-B9O0_VSN.d.ts → Breadcrumbs-CcB0oOF8.d.ts} +1 -1
- package/dist/{Breadcrumbs-AbUBqBTq.js → Breadcrumbs-a1-q_he0.js} +15 -12
- package/dist/{Button-f7FPTaiN.d.ts → Button-0SswSdDg.d.ts} +1 -1
- package/dist/{Button-DER_6cxv.js → Button-BaODzvZd.js} +1 -1
- package/dist/{ButtonBase-CYTFS-xK.d.ts → ButtonBase-CZuEy3Pk.d.ts} +3 -3
- package/dist/{ButtonBase-CeFSNcVs.js → ButtonBase-s-VV7oCa.js} +8 -7
- package/dist/{ButtonContent-c7lJayVQ.js → ButtonContent-Dztbuz3q.js} +5 -14
- package/dist/{Calendar-DRQ536wk.js → Calendar-Cr6B7SDx.js} +25 -181
- package/dist/Calendar.lazy-MJisXRJK.js +131 -0
- package/dist/{CheckContent-D7sZPmzx.js → CheckContent-BKLnTPZr.js} +2 -2
- package/dist/{Checkbox-BI3DQPLa.js → Checkbox-Bjsbx-wK.js} +6 -6
- package/dist/{Checkbox-CCvC7OVT.d.ts → Checkbox-w2j5hLOQ.d.ts} +1 -1
- package/dist/{Checkbox.bound-CMZnF2_d.js → Checkbox.bound-D2nBglJz.js} +2 -2
- package/dist/{Checkbox.bound-DBt33Inx.d.ts → Checkbox.bound-DD_RCjVm.d.ts} +1 -1
- package/dist/CheckboxCheckmark-DWsYVZuu.js +25 -0
- package/dist/{CheckboxGroup-DQw4hsFa.js → CheckboxGroup-B3O3IUiu.js} +10 -8
- package/dist/{CheckboxGroup-MJ6crCZk.d.ts → CheckboxGroup-BYI15Y09.d.ts} +3 -3
- package/dist/{CheckboxGroup.bound-CTCdezUN.js → CheckboxGroup.bound-DY0HKGSh.js} +2 -2
- package/dist/{CheckboxGroup.bound-j2Sc8QtU.d.ts → CheckboxGroup.bound-QiJ-P0KR.d.ts} +1 -1
- package/dist/{ComboBox-DFlz6HJ8.js → ComboBox-ChsdI0lt.js} +2 -2
- package/dist/{DatePicker-CSm9c37c.js → DatePicker-D-YXdY2z.js} +17 -14
- package/dist/{DatePicker-umTISfvn.d.ts → DatePicker-QzfQf21b.d.ts} +3 -3
- package/dist/{DatePicker.bound-KLyoWNcX.d.ts → DatePicker.bound-DoCAqhM4.d.ts} +1 -1
- package/dist/{DatePicker.bound-Yqckg7Mk.js → DatePicker.bound-a-6NJTgy.js} +2 -2
- package/dist/{DatePickerInput-Cs9RwZfy.js → DatePickerInput-2CZtsxdK.js} +41 -288
- package/dist/{DatePickerInput-DwHQvLzi.d.ts → DatePickerInput-vLlL5ATh.d.ts} +3 -3
- package/dist/{DateRangePicker-hV_U1IK0.d.ts → DateRangePicker-3pPW0ZBV.d.ts} +3 -3
- package/dist/{DateRangePicker-s_4n-F_P.js → DateRangePicker-tuM8Qyvp.js} +45 -306
- package/dist/{DateRangePicker.bound-C1klxYW0.js → DateRangePicker.bound-B5SKOkVM.js} +2 -2
- package/dist/{DateRangePicker.bound-D-GPENNe.d.ts → DateRangePicker.bound-vFyFw4wA.d.ts} +1 -1
- package/dist/{DateTimePicker-411pU7VF.js → DateTimePicker-8BVP2qeR.js} +17 -14
- package/dist/{DateTimePicker-wgV0SUeZ.d.ts → DateTimePicker-BTRIUagV.d.ts} +3 -3
- package/dist/{DateTimePicker.bound-BDyUzidV.js → DateTimePicker.bound-C3y8TqPk.js} +2 -2
- package/dist/{DateTimePicker.bound-cF2X_ncj.d.ts → DateTimePicker.bound-X4DTyQ1b.d.ts} +1 -1
- package/dist/{Dialog-DSl1Fkqi.js → Dialog-Bn43feu0.js} +9 -9
- package/dist/{Dialog-lFYX-7Ax.js → Dialog-C9H9_BmK.js} +35 -6
- package/dist/{Dialog-V-2cgGk1.d.ts → Dialog-CO9xljD3.d.ts} +1 -1
- package/dist/Disclosure-BRSkMbZQ.js +109 -0
- package/dist/{DropdownMenu-DH7E2aXb.js → DropdownMenu-DS0RaEfH.js} +11 -29
- package/dist/{DropdownMenu-Bl_C5W_E.d.ts → DropdownMenu-D_9z9ond.d.ts} +2 -2
- package/dist/{DropdownMenuDesktop-nMoCa6N5.js → DropdownMenuDesktop-DGPIfex-.js} +6 -27
- package/dist/{FileInput-Q72yXorH.d.ts → FileInput-BEaECoBS.d.ts} +7 -7
- package/dist/{FileInput-CqRrQRM-.js → FileInput-DNCKhAq-.js} +20 -19
- package/dist/{FileInput.bound-CG2G5E2K.d.ts → FileInput.bound-D2HuuqSb.d.ts} +1 -1
- package/dist/{FileInput.bound-BZ7-g-dq.js → FileInput.bound-DCSair97.js} +2 -2
- package/dist/{FileTrigger-DBX1Io6E.js → FileTrigger-DlryDp2T.js} +1 -30
- package/dist/{FileUpload-B4ibHWQn.d.ts → FileUpload-BUTSqHVk.d.ts} +1 -1
- package/dist/{FileUpload-CG60c6wM.js → FileUpload-CQFCrvCI.js} +53 -134
- package/dist/{FileUpload.bound-DQ6uuH2W.js → FileUpload.bound-BwetBdi7.js} +2 -2
- package/dist/{FileUpload.bound-C-Zy1n5Y.d.ts → FileUpload.bound-CGQXb4iT.d.ts} +2 -2
- package/dist/{FileUploadContainer-CtUhDntB.d.ts → FileUploadContainer-Dzg5aXXZ.d.ts} +1 -1
- package/dist/{FormField-BIRMlgu4.d.ts → FormField-DGyCDxOp.d.ts} +5 -2
- package/dist/{FormField-D7KKJ6kG.js → FormField-dduTMkNH.js} +58 -37
- package/dist/{FormFieldError-Bqjg9cMb.js → FormFieldError-DTT5TUQ1.js} +2 -2
- package/dist/FormFieldHeaderTooltip-Dt-g40Tc.js +17 -0
- package/dist/FormLayout-CBYgWvwW.d.ts +47 -0
- package/dist/{IconButton-BM2DUNtN.d.ts → IconButton-shH_9wcl.d.ts} +1 -1
- package/dist/{IconSlot-DSK7qNxc.js → IconSlot-CqNuZl0E.js} +4 -4
- package/dist/{iconSlot.cva-BA9NahZH.d.ts → IconSlot-DcEDPaNb.d.ts} +3 -11
- package/dist/{InlineTooltipWrapper-DBuQX2yo.js → InlineTooltipWrapper-CKTiFpZn.js} +3 -3
- package/dist/{Input-CG4Irgae.js → Input-BIuNQb5u.js} +29 -13
- package/dist/{Input-BX3sZBEp.d.ts → Input-CTp_9mS9.d.ts} +3 -3
- package/dist/{Input.bound-BE-espm0.d.ts → Input.bound-B9a62ylL.d.ts} +1 -1
- package/dist/{Input.bound-jZx8gJro.js → Input.bound-QpE3qJqT.js} +2 -2
- package/dist/{InputContent-DDFr0kml.d.ts → InputContent-BCNkN4Fx.d.ts} +4 -4
- package/dist/{InputContent-KhD4_YvO.js → InputContent-C5JlwN5b.js} +35 -22
- package/dist/{Link-Bw2m9W4B.d.ts → Link-PvYB_M-j.d.ts} +5 -3
- package/dist/{ListBox-CoUk0kkt.js → ListBox-DhR5kojP.js} +3 -3
- package/dist/{MenuItem-DPZzOqp2.d.ts → MenuItem-U3-pu1j5.d.ts} +1 -1
- package/dist/{Modal-B4p1zFqi.js → Modal-DcLWF9cB.js} +1 -1
- package/dist/{NumberField-CxwTlqud.js → NumberField-CpkLBjIM.js} +38 -14
- package/dist/{NumberField-qjvHhCfN.d.ts → NumberField-WXebfxjK.d.ts} +4 -4
- package/dist/{NumberField.bound-zySl-v_q.js → NumberField.bound-BbZLqewF.js} +2 -2
- package/dist/{NumberField.bound-DXPGF5YK.d.ts → NumberField.bound-Dy0A5iVc.d.ts} +1 -1
- package/dist/{NumberRangeInput-BrW03wC6.js → NumberRangeInput-47xOaSXq.js} +18 -17
- package/dist/{NumberRangeInput-CS4Kn427.d.ts → NumberRangeInput-BCKQaGpy.d.ts} +2 -2
- package/dist/{NumberRangeInput.bound-CKywKEKI.js → NumberRangeInput.bound-B21y7xkb.js} +2 -2
- package/dist/{NumberRangeInput.bound-C8I7m1cW.d.ts → NumberRangeInput.bound-BNXxIQ0b.d.ts} +1 -1
- package/dist/PageHeader-BwzxymWY.d.ts +58 -0
- package/dist/{Pagination-DkpAg2x6.d.ts → Pagination-BCGUVYOF.d.ts} +1 -1
- package/dist/{PaginationList-PjOxNQwB.js → PaginationList-BTmrmOGl.js} +75 -74
- package/dist/{PaginationList-DNmZRcS6.d.ts → PaginationList-CvlSkJGn.d.ts} +1 -1
- package/dist/{PasswordInput-BHPFkVbM.d.ts → PasswordInput-EhQjYyJS.d.ts} +1 -1
- package/dist/{PasswordInput.bound-DC57m4NT.d.ts → PasswordInput.bound-CK5GwKL4.d.ts} +1 -1
- package/dist/{PasswordInput.bound-CrXKvfil.js → PasswordInput.bound-DVkRv16z.js} +3 -3
- package/dist/{Popover-pjd0Hu61.d.ts → Popover-D_t1XDPA.d.ts} +2 -2
- package/dist/{Progress-1WGRZE8l.d.ts → Progress-Ckfpi_-M.d.ts} +4 -4
- package/dist/{Progress-De76pCfX.js → Progress-RiEGGxNG.js} +3 -3
- package/dist/{RadioGroup-DEwQ6B1F.d.ts → RadioGroup-6e-Z6jW8.d.ts} +3 -3
- package/dist/{RadioGroup-BPSvcre6.js → RadioGroup-IL4Y8XHO.js} +11 -9
- package/dist/{RadioGroup.bound-CN4K9dV2.js → RadioGroup.bound-BFWSq-on.js} +2 -2
- package/dist/{RadioGroup.bound-Dj6CEG6M.d.ts → RadioGroup.bound-w3SZqSkH.d.ts} +1 -1
- package/dist/RangeCalendar-CAWTz3pq.js +288 -0
- package/dist/{RichTextEditor-BYIQW8QA.js → RichTextEditor-16feWcDW.js} +32 -409
- package/dist/{RichTextEditor-hJtuB7Y6.d.ts → RichTextEditor-DHhuBeT6.d.ts} +1 -1
- package/dist/{Select-DHYddedn.d.ts → Select-C34ENdjq.d.ts} +5 -3
- package/dist/{Select-Br_3eecr.js → Select-CSdr0OcD.js} +217 -468
- package/dist/{Select.bound-CgLKMzLn.js → Select.bound-D-Wl7nLz.js} +2 -2
- package/dist/{Select.bound-CJ-tCsmX.d.ts → Select.bound-qOihchei.d.ts} +1 -1
- package/dist/SelectListBox-DeiPWhOP.js +390 -0
- package/dist/SelectionIndicator-C3hniBa2.js +18 -0
- package/dist/SharedElementTransition-CZ2bE7yo.js +96 -0
- package/dist/SidebarWorkspaces-DDHJAdNH.d.ts +132 -0
- package/dist/SidebarWorkspaces-DJknAfS9.js +1298 -0
- package/dist/{Slider-CqB2TPTR.js → Slider-DCsCCPFx.js} +10 -11
- package/dist/{Slider-CcoNTFVN.d.ts → Slider-DRg8zKRM.d.ts} +1 -1
- package/dist/{Slider.bound-Bp7Zrs9_.js → Slider.bound-CByTXPTr.js} +2 -2
- package/dist/{Slider.bound-8B5qzQ-8.d.ts → Slider.bound-CaEF19um.d.ts} +1 -1
- package/dist/{Spinner-B-crRcdG.d.ts → Spinner-Cvy_6zgD.d.ts} +5 -5
- package/dist/{Spinner-BeVTUzzx.js → Spinner-DqjP06T1.js} +29 -41
- package/dist/{SplitButton-BzhbtpFA.d.ts → SplitButton-V1f2NWfh.d.ts} +3 -3
- package/dist/{Stepper-CMw6QnCu.js → Stepper-Dyhxp0Tl.js} +13 -12
- package/dist/{Stepper-LORgYAJr.d.ts → Stepper-k91x_m-E.d.ts} +18 -18
- package/dist/{Switch-R0kAicgM.js → Switch-BfpSMMpv.js} +6 -6
- package/dist/{Switch-CSitpm4o.d.ts → Switch-ELVPkPx0.d.ts} +1 -1
- package/dist/{Switch.bound-DVjqsum1.d.ts → Switch.bound-DeEdVvZV.d.ts} +1 -1
- package/dist/{Switch.bound-Dk-BmxJd.js → Switch.bound-Dv0cHsMM.js} +2 -2
- package/dist/TableRowDetails-D8HFTghI.d.ts +109 -0
- package/dist/TabsFilters-CvYxvrud.js +223 -0
- package/dist/TabsFilters-DePddjCk.d.ts +30 -0
- package/dist/Tag-B2_ZiSE-.d.ts +44 -0
- package/dist/{TextArea-DCnqXuHC.js → TextArea-ciY0kt-D.js} +8 -7
- package/dist/{TextArea-e8sQm205.d.ts → TextArea-iqUeB2QY.d.ts} +2 -2
- package/dist/{TextArea.bound-DEZuRYm_.d.ts → TextArea.bound-BJHyCogp.d.ts} +1 -1
- package/dist/{TextArea.bound-BJZ9m_FE.js → TextArea.bound-DQ_ULvue.js} +2 -2
- package/dist/{TextArea.cva-Bb73hriz.js → TextArea.cva-ENXI55ec.js} +1 -1
- package/dist/{TimePicker-BwF-Crbg.js → TimePicker-BKRPMduC.js} +20 -18
- package/dist/{TimePicker-Zi7B6VTr.d.ts → TimePicker-BZ1ocsBX.d.ts} +2 -2
- package/dist/{TimePicker.bound-Bxtb6uJL.d.ts → TimePicker.bound-8DmjMXuE.d.ts} +1 -1
- package/dist/{TimePicker.bound-B-BVLNbk.js → TimePicker.bound-PtJTz6s3.js} +2 -2
- package/dist/{datePickerValue.utils-OAQBDk1R.js → TimePickerForm-itDjoV7V.js} +12 -16
- package/dist/{Toast-Dl6KMa58.d.ts → Toast-D9pdadZ4.d.ts} +1 -1
- package/dist/{ToastContainer-BDvta6st.js → ToastContainer-Dd0LPykL.js} +5 -5
- package/dist/{ToggleButton-Cce9bnBw.d.ts → ToggleButton-HUZ8ij6i.d.ts} +1 -1
- package/dist/{ToggleButton-DUQ8nwKY.js → ToggleButton-P1z1pxzT.js} +2 -2
- package/dist/{ToggleGroup-s5sDSB6l.js → ToggleGroup-CrDoeLN0.js} +127 -114
- package/dist/{ToggleGroup-BJ8cqXaO.d.ts → ToggleGroup-DvjnSinl.d.ts} +5 -23
- package/dist/{ToggleGroup.bound-Cv09n91n.d.ts → ToggleGroup.bound-B03ISHQ8.d.ts} +1 -1
- package/dist/{ToggleGroup.bound-DEc7rdNF.js → ToggleGroup.bound-DCnYwmBt.js} +2 -2
- package/dist/{Tooltip-BiS7isYB.d.ts → Tooltip-B8DTURLQ.d.ts} +1 -1
- package/dist/{Tooltip-CMigoyri.js → Tooltip-DRB6lo0U.js} +8 -44
- package/dist/{TooltipWrapper-D7HUZLsP.js → TooltipWrapper-BvGO_LUx.js} +21 -10
- package/dist/{Typography-LU4z2pR1.js → Typography-DCLnPa3P.js} +2 -2
- package/dist/{Typography-D2FfZr7a.d.ts → Typography-DJojwiXV.d.ts} +2 -2
- package/dist/{accordion.cva-CeBWV9EO.js → accordion.cva-DwxY-k1e.js} +17 -25
- package/dist/{badgeButton.cva-B8EQLwPv.d.ts → badgeButton.cva-CBFIhr1S.d.ts} +8 -8
- package/dist/badgeButton.cva-t5PQOH4M.js +138 -0
- package/dist/{breadcrumbs.cva-DPwJJK_D.js → breadcrumbs.cva-CnBIZUB3.js} +9 -9
- package/dist/{button.cva-CBckM91c.d.ts → button.cva-C8LGtNJ3.d.ts} +21 -16
- package/dist/button.cva-Ciga0rdG.js +267 -0
- package/dist/{buttonContent.cva-DG-4lRz4.d.ts → buttonContent.cva-BapnODby.d.ts} +2 -2
- package/dist/{checkbox.cva-CJy87xUo.d.ts → checkbox.cva-CCh_UlrC.d.ts} +6 -6
- package/dist/{checkbox.cva-D-D9Qgaf.js → checkbox.cva-aLJS7v4z.js} +24 -33
- package/dist/components/accordion.js +1 -1
- package/dist/components/alert-dialog.d.ts +1 -1
- package/dist/components/alert-dialog.js +98 -103
- package/dist/components/alert.d.ts +1 -1
- package/dist/components/alert.js +11 -11
- package/dist/components/autocomplete.d.ts +1 -1
- package/dist/components/autocomplete.js +1 -1
- package/dist/components/badge-button.d.ts +1 -1
- package/dist/components/badge-button.js +5 -5
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/badge.js +9 -9
- package/dist/components/bottom-sheet-header.d.ts +1 -1
- package/dist/components/bottom-sheet-header.js +13 -12
- package/dist/components/bottom-sheet.d.ts +2 -2
- package/dist/components/bottom-sheet.js +3 -3
- 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 +1 -1
- package/dist/components/checkbox-group.js +1 -1
- package/dist/components/checkbox.d.ts +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/date-picker.d.ts +1 -1
- package/dist/components/date-picker.js +1 -1
- package/dist/components/date-range-picker.d.ts +1 -1
- package/dist/components/date-range-picker.js +1 -1
- package/dist/components/date-time-picker.d.ts +1 -1
- 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.js +4 -4
- package/dist/components/dropdown-menu.d.ts +2 -2
- package/dist/components/dropdown-menu.js +2 -2
- package/dist/components/file-input.d.ts +1 -1
- package/dist/components/file-input.js +1 -1
- package/dist/components/file-upload-container.d.ts +2 -2
- package/dist/components/file-upload-container.js +1 -1
- package/dist/components/file-upload.d.ts +2 -2
- package/dist/components/file-upload.js +1 -1
- package/dist/components/form-field.d.ts +1 -1
- package/dist/components/form-field.js +1 -1
- package/dist/components/form-layout.d.ts +2 -0
- package/dist/components/form-layout.js +80 -0
- package/dist/components/icon-button.d.ts +1 -1
- package/dist/components/icon-button.js +2 -2
- package/dist/components/icon-slot.d.ts +2 -1
- package/dist/components/icon-slot.js +1 -1
- package/dist/components/input-frame.d.ts +5 -4
- package/dist/components/input-frame.js +48 -33
- package/dist/components/input.d.ts +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/link.d.ts +1 -1
- package/dist/components/link.js +3 -3
- package/dist/components/number-field.d.ts +1 -1
- package/dist/components/number-field.js +1 -1
- package/dist/components/number-range-input.d.ts +1 -1
- package/dist/components/number-range-input.js +1 -1
- package/dist/components/page-header.d.ts +2 -0
- package/dist/components/page-header.js +205 -0
- package/dist/components/pagination-list.d.ts +1 -1
- package/dist/components/pagination-list.js +1 -1
- package/dist/components/pagination.d.ts +1 -1
- package/dist/components/pagination.js +8 -8
- package/dist/components/password-input.d.ts +1 -1
- package/dist/components/password-input.js +3 -3
- package/dist/components/popover.d.ts +1 -1
- package/dist/components/popover.js +4 -4
- package/dist/components/progress.d.ts +1 -1
- package/dist/components/progress.js +1 -1
- package/dist/components/radio-group.d.ts +1 -1
- package/dist/components/radio-group.js +1 -1
- package/dist/components/select.d.ts +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/sidebar.d.ts +2 -0
- package/dist/components/sidebar.js +2 -0
- package/dist/components/slider.d.ts +1 -1
- package/dist/components/slider.js +1 -1
- package/dist/components/spinner.d.ts +1 -1
- package/dist/components/spinner.js +1 -1
- package/dist/components/split-button.d.ts +1 -1
- package/dist/components/split-button.js +3 -3
- package/dist/components/stepper.d.ts +1 -1
- package/dist/components/stepper.js +1 -1
- package/dist/components/style-definitions.d.ts +2 -2
- package/dist/components/style-definitions.js +31 -30
- package/dist/components/switch.d.ts +1 -1
- package/dist/components/switch.js +1 -1
- package/dist/components/tabs-filters.d.ts +2 -0
- package/dist/components/tabs-filters.js +2 -0
- package/dist/components/tag.d.ts +1 -1
- package/dist/components/tag.js +8 -8
- package/dist/components/text-area.d.ts +1 -1
- package/dist/components/text-area.js +1 -1
- package/dist/components/time-picker.d.ts +1 -1
- package/dist/components/time-picker.js +1 -1
- package/dist/components/toast.d.ts +2 -2
- package/dist/components/toast.js +2 -2
- package/dist/components/toggle-button.d.ts +1 -1
- package/dist/components/toggle-button.js +1 -1
- package/dist/components/toggle-group.d.ts +1 -1
- package/dist/components/toggle-group.js +1 -1
- package/dist/components/tooltip-ellipsis.js +2 -2
- package/dist/components/tooltip.d.ts +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/components/typography.d.ts +2 -2
- package/dist/components/typography.js +1 -1
- package/dist/components/use-toast.d.ts +1 -1
- package/dist/components/use-toast.js +2 -2
- package/dist/config/component-configuration.d.ts +2 -2
- package/dist/config/confirmation.d.ts +1 -1
- package/dist/config/confirmation.js +1 -1
- package/dist/config/link-context.d.ts +2 -2
- package/dist/config/link-context.js +1 -1
- package/dist/config/resources.d.ts +1 -1
- package/dist/config/resources.js +1 -1
- package/dist/config/theme-context.js +1 -1
- package/dist/config/ui-config.d.ts +2 -2
- package/dist/config/ui-config.js +1 -1
- package/dist/config/ui-overrides.d.ts +1 -1
- package/dist/config/ui-overrides.js +1 -1
- package/dist/config/ui-router.js +1 -1
- package/dist/{confirmation.context-BSn1s-ip.js → confirmation.context-CByUxDcn.js} +2 -2
- package/dist/{confirmation.context-B2z9A1v3.d.ts → confirmation.context-C_GDRn3a.d.ts} +1 -1
- package/dist/{datePickerInput.cva-Cd7UUN61.js → datePickerInput.cva-Du0Zn04v.js} +2 -2
- package/dist/datePickerValue.utils-CkmPaD6I.js +4 -0
- package/dist/{dialog.cva-sioU_5R7.js → dialog.cva-BIpz6HcA.js} +7 -7
- package/dist/{dist-CAFUM34b.js → dist-DEZzXa0W.js} +15 -14
- package/dist/dropdownMenu.cva-DwSOcbmR.js +31 -0
- package/dist/{fileUpload.cva-ujmStxB1.js → fileUpload.cva-BYzXGc9C.js} +11 -11
- package/dist/{fileUpload.types-BT8P1o7a.d.ts → fileUpload.types-C-ke21yY.d.ts} +2 -2
- package/dist/{form.binding-B-2id68q.js → form.binding-DOR5gIQf.js} +1 -1
- package/dist/{formFieldError.cva-CTl0VeyG.js → formFieldError.cva-BB6Ghqwq.js} +3 -3
- package/dist/formFieldHelper.cva-DRmSyRZN.js +14 -0
- package/dist/formLayout.context--CN08Mtb.js +14 -0
- package/dist/hooks/use-async-list.js +1 -1
- package/dist/hooks/use-filters.js +1 -1
- package/dist/hooks/use-local-storage.js +1 -1
- package/dist/{i18n-BjNKHh_D.js → i18n-D1FWVTPi.js} +4 -2
- package/dist/{i18n-2z5on9No.d.ts → i18n-DE45mOCM.d.ts} +6 -0
- package/dist/iconSlot.cva-CLB5Tlsr.d.ts +9 -0
- package/dist/icons.d.ts +2 -1
- package/dist/icons.js +3 -3
- package/dist/import-C14g8ng0.js +251 -0
- package/dist/index.d.ts +78 -73
- package/dist/index.js +95 -91
- package/dist/{input.cva-L7jKDv6q.d.ts → input.cva-BjuHsDGy.d.ts} +11 -11
- package/dist/input.cva-DZii82eS.js +185 -0
- package/dist/inputLayout-KdAtunGk.js +5 -0
- package/dist/label.cva-DTfT6FrX.js +85 -0
- package/dist/{link.context-C4fE_aMo.d.ts → link.context-BCHn7NSy.d.ts} +1 -1
- package/dist/link.cva-C24YVAsJ.js +16 -0
- package/dist/outline.clsx-DGGQQRkM.js +6 -0
- package/dist/popover.cva-DAbfSma6.js +5 -0
- package/dist/{progress.cva-D7iiX6Lh.js → progress.cva-CsGaGVJ-.js} +7 -7
- package/dist/{radio.cva-DO3UEac-.d.ts → radio.cva-D7M1hqLe.d.ts} +9 -5
- package/dist/{radio.cva-Ctdop1xV.js → radio.cva-DistaZtZ.js} +33 -19
- package/dist/rich-text-editor.d.ts +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/{selectDesktop.cva-RzxvSBkd.js → selectDesktop.cva-DStkOdwm.js} +2 -2
- package/dist/selectItem.cva-B6vxey2R.js +27 -0
- package/dist/{staticDateTimeSegments-Bt5wCZvg.js → staticDateTimeSegments-bPuA-a2Y.js} +12 -12
- package/dist/{status.cva-BFGMKZO_.js → status.cva-CYgi3Htz.js} +21 -21
- package/dist/{stepper.cva-CpRi0fGb.js → stepper.cva-Cecphqeo.js} +23 -35
- package/dist/{style-definitions-_RXJdSk-.d.ts → style-definitions-Dx6aFDiR.d.ts} +159 -144
- package/dist/styles/editor.css +9 -9
- package/dist/styles/input.d.ts +1 -1
- package/dist/styles/outline.js +1 -1
- package/dist/switch.cva-BT0kGRIk.js +24 -0
- package/dist/switch.cva-r6vcS25Q.d.ts +16 -0
- package/dist/table.cva-DkcsOmZG.js +147 -0
- package/dist/tag.cva-ExMNsTN-.js +24 -0
- package/dist/tanstack/autocomplete.d.ts +2 -2
- package/dist/tanstack/autocomplete.js +1 -1
- package/dist/tanstack/checkbox-group.d.ts +2 -2
- package/dist/tanstack/checkbox-group.js +1 -1
- package/dist/tanstack/checkbox.d.ts +2 -2
- package/dist/tanstack/checkbox.js +1 -1
- package/dist/tanstack/date-picker.d.ts +2 -2
- package/dist/tanstack/date-picker.js +1 -1
- package/dist/tanstack/date-range-picker.d.ts +2 -2
- package/dist/tanstack/date-range-picker.js +1 -1
- package/dist/tanstack/date-time-picker.d.ts +2 -2
- package/dist/tanstack/date-time-picker.js +1 -1
- package/dist/tanstack/file-input.d.ts +2 -2
- package/dist/tanstack/file-input.js +1 -1
- package/dist/tanstack/file-upload.d.ts +3 -3
- package/dist/tanstack/file-upload.js +1 -1
- package/dist/tanstack/form.js +2 -2
- package/dist/tanstack/input.d.ts +2 -2
- package/dist/tanstack/input.js +1 -1
- package/dist/tanstack/number-field.d.ts +2 -2
- package/dist/tanstack/number-field.js +1 -1
- package/dist/tanstack/number-range-input.d.ts +2 -2
- package/dist/tanstack/number-range-input.js +1 -1
- package/dist/tanstack/password-input.d.ts +1 -1
- package/dist/tanstack/password-input.js +1 -1
- package/dist/tanstack/radio-group.d.ts +2 -2
- package/dist/tanstack/radio-group.js +1 -1
- package/dist/tanstack/rich-text-editor.d.ts +1 -1
- package/dist/tanstack/rich-text-editor.js +2 -2
- package/dist/tanstack/select.d.ts +2 -2
- package/dist/tanstack/select.js +1 -1
- package/dist/tanstack/slider.d.ts +2 -2
- package/dist/tanstack/slider.js +1 -1
- package/dist/tanstack/switch.d.ts +2 -2
- package/dist/tanstack/switch.js +1 -1
- package/dist/tanstack/table.d.ts +3 -3
- package/dist/tanstack/table.js +1 -1
- package/dist/tanstack/text-area.d.ts +2 -2
- package/dist/tanstack/text-area.js +1 -1
- package/dist/tanstack/time-picker.d.ts +2 -2
- package/dist/tanstack/time-picker.js +1 -1
- package/dist/tanstack/toggle-group.d.ts +2 -2
- package/dist/tanstack/toggle-group.js +1 -1
- package/dist/{tanstack-CmbhAoHU.js → tanstack-Bgdv0qU1.js} +2 -1
- package/dist/{tanstack-DQu9PNjn.d.ts → tanstack-zusJduSB.d.ts} +195 -96
- package/dist/tanstack.d.ts +78 -73
- package/dist/tanstack.js +95 -91
- package/dist/{theme.context-B3wQDJ-i.js → theme.context--VEyStJB.js} +2 -2
- package/dist/{toast.cva-L0k_TBiW.d.ts → toast.cva-AmLw6Cf5.d.ts} +10 -10
- package/dist/{toast.cva-aC4NMpLb.js → toast.cva-B6NXTwbZ.js} +22 -38
- package/dist/{toast.runtime-DKOeUnk6.js → toast.runtime-Drd2IJ_j.js} +1 -1
- package/dist/toggleGroup.cva-CJ-3Ps7j.js +35 -0
- package/dist/toggleGroup.cva-DA4U21gn.d.ts +26 -0
- package/dist/{tooltip.cva-ClcaR72U.js → tooltip.cva-BEyxvcG2.js} +11 -11
- package/dist/{tooltipWrapper.cva-BBQ4ic3D.js → tooltipWrapper.cva-t4NQ9zz9.js} +1 -1
- package/dist/typography.cva-BCHlTHdM.d.ts +36 -0
- package/dist/typography.cva-CHsHX_Wp.js +31 -0
- package/dist/{uiConfig.context-CT9EVqC5.js → uiConfig.context-3DN9w6oU.js} +19 -114
- package/dist/{uiConfig.context-CQU9Tzq_.d.ts → uiConfig.context-BnCORTNm.d.ts} +22 -9
- package/dist/{uiOverrides.context-Dmev7iRS.d.ts → uiOverrides.context-DHHzLSnq.d.ts} +23 -0
- package/dist/{useBreakpoint-BzYqQEBO.js → useBreakpoint-CJ3mx7UF.js} +6 -6
- package/dist/{useFilters-HIngImwn.js → useFilters-DMi94RZK.js} +2 -2
- package/dist/{useFormAutosave-XEQqk1lK.js → useFormAutosave-BPGlChiY.js} +1 -1
- package/dist/useScrollableListBox-oYKqU3Hp.js +47 -0
- package/dist/{useStaticInputHandoff-DyYxfwv6.js → useStaticInputHandoff-BN0fOerH.js} +9 -10
- package/dist/useTableColumnConfig-D5NxR1Co.js +2060 -0
- package/dist/{useTableNav-rU9WmCj6.d.ts → useTableNav-H5DrogZU.d.ts} +29 -44
- package/dist/{useToast-DfQif03I.d.ts → useToast-DsA8CVoY.d.ts} +1 -1
- package/package.json +22 -5
- package/dist/CheckboxCheckmark-BzT6MwH5.js +0 -47
- package/dist/FormFieldHeaderTooltip-k8Snf_oM.js +0 -47
- package/dist/SelectionIndicator-B7C5Y0JM.js +0 -5
- package/dist/SharedElementTransition-DJ9CCbEa.js +0 -12
- package/dist/Tag-CoqCTZRm.d.ts +0 -44
- package/dist/badgeButton.cva-BPyVejxO.js +0 -300
- package/dist/button.cva-vO0fPUTn.js +0 -423
- package/dist/check-DYMBkp_Z.js +0 -20
- package/dist/chevron-down-B4Pr8bD3.js +0 -20
- package/dist/chevron-right-3nKJR5Bb.js +0 -20
- package/dist/chevrons-right-DJPPn2fD.js +0 -44
- package/dist/createLucideIcon-LcezOE4z.js +0 -240
- package/dist/dropdownMenu.cva-Bi3a21lO.js +0 -34
- package/dist/eye-BA4nRlMX.js +0 -57
- package/dist/formFieldHelper.cva-CxAmrG2H.js +0 -97
- package/dist/input.cva-w7ZEVQAM.js +0 -227
- package/dist/link.cva-D3XRgcAv.js +0 -12
- package/dist/outline.clsx-50W_vNDl.js +0 -6
- package/dist/popover.cva-Bhud1wnp.js +0 -5
- package/dist/selectItem.cva-BWfEkNs_.js +0 -36
- package/dist/styles/color-utilities.css +0 -20
- package/dist/switch.cva-BsJ4iAFl.js +0 -27
- package/dist/switch.cva-psw67dK9.d.ts +0 -16
- package/dist/table.cva-CmfeWLyW.d.ts +0 -84
- package/dist/table.cva-DFQM8VbM.js +0 -111
- package/dist/tag.cva-BCCH7ku3.js +0 -55
- package/dist/toggleGroup.cva-CEhjMT4j.js +0 -35
- package/dist/typography.cva-GpC6QQNx.d.ts +0 -36
- package/dist/typography.cva-iD15k56p.js +0 -51
- package/dist/useTableColumnConfig-CUINwVTR.js +0 -1348
- package/dist/x-B6vfz8Ps.js +0 -23
- package/dist/{dom.utils-BbfrA6RP.js → dom.utils-BPooTXtC.js} +1 -1
- package/dist/{link.context-J7aQtMOr.js → link.context-TPjDtjw3.js} +1 -1
- package/dist/{router.context-B4FvsTim.js → router.context-MckTbHw9.js} +1 -1
- package/dist/{uiOverrides.context-BTCH9y5a.js → uiOverrides.context-DNEQlTx0.js} +1 -1
- package/dist/{useAsyncList-yHz7twsj.js → useAsyncList-Ct74ve3i.js} +1 -1
- package/dist/{useForm-eW4KpH1u.js → useForm-Cb7KWLds.js} +1 -1
- package/dist/{useIntersectionObserver-DYfHnGGU.js → useIntersectionObserver-DFAhTsV0.js} +1 -1
- package/dist/{useLocalStorage-PlcaJ1tP.js → useLocalStorage-CctQvyqD.js} +1 -1
|
@@ -1,1348 +0,0 @@
|
|
|
1
|
-
import { t as logger } from "./logger-CqZjM-sn.js";
|
|
2
|
-
import { t as createLucideIcon } from "./createLucideIcon-LcezOE4z.js";
|
|
3
|
-
import { t as UIConfig } from "./uiConfig.context-CT9EVqC5.js";
|
|
4
|
-
import { t as ChevronDown } from "./chevron-down-B4Pr8bD3.js";
|
|
5
|
-
import { n as ChevronUp } from "./Tooltip-CMigoyri.js";
|
|
6
|
-
import { t as clsx } from "./clsx-CnD0nOiA.js";
|
|
7
|
-
import { t as UIOverrides } from "./uiOverrides.context-BTCH9y5a.js";
|
|
8
|
-
import { t as IconSlot } from "./IconSlot-DSK7qNxc.js";
|
|
9
|
-
import { t as Checkbox } from "./Checkbox-BI3DQPLa.js";
|
|
10
|
-
import { t as Typography } from "./Typography-LU4z2pR1.js";
|
|
11
|
-
import { t as Spinner } from "./Spinner-BeVTUzzx.js";
|
|
12
|
-
import { IconButton } from "./components/icon-button.js";
|
|
13
|
-
import "./i18n-BjNKHh_D.js";
|
|
14
|
-
import { t as useIntersectionObserver } from "./useIntersectionObserver-DYfHnGGU.js";
|
|
15
|
-
import { t as Dialog } from "./Dialog-DSl1Fkqi.js";
|
|
16
|
-
import { Pagination } from "./components/pagination.js";
|
|
17
|
-
import { a as tableHeadRowDefinition, c as theadDefinition, i as tableHeadDataDefinition, n as tableContainerDefinition, o as tableHeaderTextDefinition, r as tableDataDefinition, s as tableRowDefinition, t as tableCellTextDefinition } from "./table.cva-DFQM8VbM.js";
|
|
18
|
-
import { t as useTranslationMemo } from "./useTranslationMemo-CrZbeyBv.js";
|
|
19
|
-
import { t as UIRouter } from "./router.context-B4FvsTim.js";
|
|
20
|
-
import { t as RoutingUtils } from "./routing.utils-DfxEt0_Y.js";
|
|
21
|
-
import { Suspense, lazy, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
22
|
-
import { c } from "react/compiler-runtime";
|
|
23
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
24
|
-
import { useTranslation } from "react-i18next";
|
|
25
|
-
import i18next from "i18next";
|
|
26
|
-
import { createPaginatedRowModel, createSortedRowModel, flexRender, stockFeatures, tableFeatures, useTable } from "@tanstack/react-table";
|
|
27
|
-
//#region ../../node_modules/.bun/lucide-react@1.43.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/grip-vertical.mjs
|
|
28
|
-
/**
|
|
29
|
-
* @license lucide-react v1.43.0 - ISC
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the ISC license.
|
|
32
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/
|
|
34
|
-
const __iconData = {
|
|
35
|
-
name: "grip-vertical",
|
|
36
|
-
size: 24,
|
|
37
|
-
node: [
|
|
38
|
-
["circle", {
|
|
39
|
-
cx: "9",
|
|
40
|
-
cy: "12",
|
|
41
|
-
r: "1",
|
|
42
|
-
key: "1vctgf"
|
|
43
|
-
}],
|
|
44
|
-
["circle", {
|
|
45
|
-
cx: "9",
|
|
46
|
-
cy: "5",
|
|
47
|
-
r: "1",
|
|
48
|
-
key: "hp0tcf"
|
|
49
|
-
}],
|
|
50
|
-
["circle", {
|
|
51
|
-
cx: "9",
|
|
52
|
-
cy: "19",
|
|
53
|
-
r: "1",
|
|
54
|
-
key: "fkjjf6"
|
|
55
|
-
}],
|
|
56
|
-
["circle", {
|
|
57
|
-
cx: "15",
|
|
58
|
-
cy: "12",
|
|
59
|
-
r: "1",
|
|
60
|
-
key: "1tmaij"
|
|
61
|
-
}],
|
|
62
|
-
["circle", {
|
|
63
|
-
cx: "15",
|
|
64
|
-
cy: "5",
|
|
65
|
-
r: "1",
|
|
66
|
-
key: "19l28e"
|
|
67
|
-
}],
|
|
68
|
-
["circle", {
|
|
69
|
-
cx: "15",
|
|
70
|
-
cy: "19",
|
|
71
|
-
r: "1",
|
|
72
|
-
key: "f4zoj3"
|
|
73
|
-
}]
|
|
74
|
-
]
|
|
75
|
-
};
|
|
76
|
-
__iconData.node;
|
|
77
|
-
const GripVertical = createLucideIcon(__iconData);
|
|
78
|
-
//#endregion
|
|
79
|
-
//#region src/components/table/CellText.tsx
|
|
80
|
-
const CellText = (props) => {
|
|
81
|
-
const uiConfig = UIConfig.useConfig();
|
|
82
|
-
const { size = uiConfig.tableCellText.size, children, style, className } = props;
|
|
83
|
-
const cellTextCva = UIOverrides.useCva("table.cellTextCva", tableCellTextDefinition);
|
|
84
|
-
return /* @__PURE__ */ jsx(Typography, {
|
|
85
|
-
className: cellTextCva({ className }),
|
|
86
|
-
as: "span",
|
|
87
|
-
size,
|
|
88
|
-
style,
|
|
89
|
-
"data-rac": true,
|
|
90
|
-
children
|
|
91
|
-
});
|
|
92
|
-
};
|
|
93
|
-
//#endregion
|
|
94
|
-
//#region src/components/table/HeaderText.tsx
|
|
95
|
-
const HeaderText = (props) => {
|
|
96
|
-
const uiConfig = UIConfig.useConfig();
|
|
97
|
-
const { size = uiConfig.tableHeaderText.size, children, style, className } = props;
|
|
98
|
-
const headerTextCva = UIOverrides.useCva("table.headerTextCva", tableHeaderTextDefinition);
|
|
99
|
-
return /* @__PURE__ */ jsx(Typography, {
|
|
100
|
-
className: headerTextCva({ className }),
|
|
101
|
-
as: "span",
|
|
102
|
-
size,
|
|
103
|
-
style,
|
|
104
|
-
children
|
|
105
|
-
});
|
|
106
|
-
};
|
|
107
|
-
//#endregion
|
|
108
|
-
//#region src/hooks/useTableNav.ts
|
|
109
|
-
const Selectors = {
|
|
110
|
-
Cell: "[role=\"cell\"],[role=\"gridcell\"],[role=\"columnheader\"],[role=\"rowheader\"],td,th",
|
|
111
|
-
Row: "[role=\"row\"],tr",
|
|
112
|
-
RowGroup: "[role=\"rowgroup\"],thead,tbody,tfoot",
|
|
113
|
-
/** Selector from here: https://github.com/Shopify/polaris/blob/main/polaris-react/src/utilities/focus.ts#L10 */
|
|
114
|
-
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]"
|
|
115
|
-
};
|
|
116
|
-
var DataGridNav = class {
|
|
117
|
-
constructor(config = {}) {
|
|
118
|
-
this.keys = [];
|
|
119
|
-
this.activeCell = null;
|
|
120
|
-
this.debugLog = (functionName, message) => {
|
|
121
|
-
if (this.debug) logger.info(`[${functionName}]: ${message}`);
|
|
122
|
-
};
|
|
123
|
-
const { selectors = {}, pageUpDown, debug = false } = config;
|
|
124
|
-
this.selectors = {
|
|
125
|
-
...Selectors,
|
|
126
|
-
...selectors
|
|
127
|
-
};
|
|
128
|
-
this.pageUpDown = pageUpDown;
|
|
129
|
-
this.keys = [];
|
|
130
|
-
this.debug = debug;
|
|
131
|
-
this.disabled = false;
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Disables the keyboard listener in cases
|
|
135
|
-
* that elements inside the grid need to use
|
|
136
|
-
* arrows keys etc., like select dropdowns
|
|
137
|
-
*/
|
|
138
|
-
disable() {
|
|
139
|
-
this.disabled = true;
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Enables the keyboard listeners
|
|
143
|
-
*/
|
|
144
|
-
enable() {
|
|
145
|
-
this.disabled = false;
|
|
146
|
-
}
|
|
147
|
-
isFocusable(el) {
|
|
148
|
-
return el instanceof HTMLElement || el instanceof SVGElement;
|
|
149
|
-
}
|
|
150
|
-
getActiveCell() {
|
|
151
|
-
return this.activeCell;
|
|
152
|
-
}
|
|
153
|
-
/** Used as a keyboard listener for key up */
|
|
154
|
-
tableKeyUp() {
|
|
155
|
-
this.keys = [];
|
|
156
|
-
}
|
|
157
|
-
/** Used as a keyboard listener for key down */
|
|
158
|
-
tableKeyDown(e) {
|
|
159
|
-
if (this.disabled) return;
|
|
160
|
-
/**
|
|
161
|
-
* Avoid page scrolling etc.
|
|
162
|
-
* Enable default behavior for:
|
|
163
|
-
* Tab, Shift + Tab
|
|
164
|
-
* TODO: Actually it will be better to just prevent
|
|
165
|
-
* in ArrowKeys and PageKeys maybe?
|
|
166
|
-
* Or should the consumer stop propagation?!
|
|
167
|
-
* Cannot work with preventDefault as it will
|
|
168
|
-
* first capture the event from an input in cell for example
|
|
169
|
-
*/
|
|
170
|
-
if ("ArrowDown" === e.key || "ArrowUp" === e.key || "ArrowLeft" === e.key || "ArrowRight" === e.key) e.preventDefault();
|
|
171
|
-
/**
|
|
172
|
-
* Add key to the stack if it's
|
|
173
|
-
* not the same with the last (long press)
|
|
174
|
-
*/
|
|
175
|
-
if (this.keys.length === 0 || this.keys[this.keys.length - 1] !== e.key) this.keys.push(e.key);
|
|
176
|
-
/**
|
|
177
|
-
* Need to check if we are inside a grid cell
|
|
178
|
-
* or not to enable/disable Grid Navigation
|
|
179
|
-
*/
|
|
180
|
-
if (!(e.target instanceof Element)) return;
|
|
181
|
-
const cell = e.target.parentElement?.closest(`${this.selectors.Cell},${this.selectors.Row}`);
|
|
182
|
-
if (!cell) return;
|
|
183
|
-
if (cell.matches(this.selectors.Cell)) this.cellNavigation(e);
|
|
184
|
-
else this.gridNavigation(e);
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* Handles the navigation inside a cell
|
|
188
|
-
*/
|
|
189
|
-
cellNavigation(e) {
|
|
190
|
-
if (!(e.target instanceof Element)) return;
|
|
191
|
-
/**
|
|
192
|
-
* Keys: Escape
|
|
193
|
-
* Restore grid navigation
|
|
194
|
-
*/
|
|
195
|
-
if (e.key === "Escape") {
|
|
196
|
-
const cell = e.target.closest(this.selectors.Cell);
|
|
197
|
-
if (cell && this.isFocusable(cell)) {
|
|
198
|
-
cell.focus();
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* Keys: ArrowRight, ArrowDown
|
|
204
|
-
* Move to the next focusable cell, or the first one
|
|
205
|
-
*
|
|
206
|
-
* Arrow Down disabled:
|
|
207
|
-
* https://github.com/w3c/aria-practices/issues/2739#issuecomment-1613538972
|
|
208
|
-
*/
|
|
209
|
-
if (e.key === "ArrowRight" || e.key === "ArrowDown") {
|
|
210
|
-
const cell = e.target.closest(this.selectors.Cell);
|
|
211
|
-
if (!cell) return;
|
|
212
|
-
const focusableWidgets = [...cell.querySelectorAll(this.selectors.Focusable)];
|
|
213
|
-
const widgetIdx = focusableWidgets.findIndex((el) => el === e.target);
|
|
214
|
-
const widgetToFocus = focusableWidgets[widgetIdx === focusableWidgets.length - 1 ? 0 : widgetIdx + 1];
|
|
215
|
-
if (this.isFocusable(widgetToFocus)) widgetToFocus.focus();
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* Keys: ArrowLeft, ArrowUp
|
|
220
|
-
* Move to the previous focusable cell, or the last one
|
|
221
|
-
*
|
|
222
|
-
* Arrow Up disabled:
|
|
223
|
-
* https://github.com/w3c/aria-practices/issues/2739#issuecomment-1613538972
|
|
224
|
-
*/
|
|
225
|
-
if (e.key === "ArrowLeft" || e.key === "ArrowUp") {
|
|
226
|
-
const cell = e.target.closest(this.selectors.Cell);
|
|
227
|
-
if (!cell) return;
|
|
228
|
-
const focusableWidgets = [...cell.querySelectorAll(this.selectors.Focusable)];
|
|
229
|
-
const widgetIdx = focusableWidgets.findIndex((el) => el === e.target);
|
|
230
|
-
const widgetToFocus = focusableWidgets[widgetIdx === 0 ? focusableWidgets.length - 1 : widgetIdx - 1];
|
|
231
|
-
if (this.isFocusable(widgetToFocus)) widgetToFocus.focus();
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
/**
|
|
235
|
-
* Handles the navigation outside a cell
|
|
236
|
-
* on the grid level
|
|
237
|
-
*/
|
|
238
|
-
gridNavigation(e) {
|
|
239
|
-
const { target } = e;
|
|
240
|
-
if (!(e.target instanceof Element)) return;
|
|
241
|
-
if (!(target instanceof Element)) return;
|
|
242
|
-
if (this.keys.length === 1) {
|
|
243
|
-
/**
|
|
244
|
-
* Keys: Enter
|
|
245
|
-
* Should move focus inside the cell to the first focusable element:
|
|
246
|
-
* https://www.w3.org/WAI/ARIA/apg/patterns/grid/#gridNav_inside
|
|
247
|
-
*/
|
|
248
|
-
if (/^[a-zA-Z0-9]$/.test(e.key)) {
|
|
249
|
-
const cell = e.target.querySelector(this.selectors.Focusable);
|
|
250
|
-
if (cell && this.isFocusable(cell) && cell instanceof HTMLInputElement) {
|
|
251
|
-
cell.focus();
|
|
252
|
-
cell.value = `${cell.value}${e.key}`;
|
|
253
|
-
e.preventDefault();
|
|
254
|
-
}
|
|
255
|
-
return;
|
|
256
|
-
}
|
|
257
|
-
if (e.key === "Backspace") {
|
|
258
|
-
const cell = e.target.querySelector(this.selectors.Focusable);
|
|
259
|
-
if (cell && this.isFocusable(cell) && cell instanceof HTMLInputElement) {
|
|
260
|
-
const nativeInputValueSetter = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set;
|
|
261
|
-
if (nativeInputValueSetter) {
|
|
262
|
-
nativeInputValueSetter.call(cell, "");
|
|
263
|
-
const ev = new Event("input", { bubbles: true });
|
|
264
|
-
cell.dispatchEvent(ev);
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
return;
|
|
268
|
-
}
|
|
269
|
-
if (e.key === "Enter") {
|
|
270
|
-
const cell = e.target.querySelector(this.selectors.Focusable);
|
|
271
|
-
if (cell && this.isFocusable(cell)) {
|
|
272
|
-
if (cell.getAttribute("data-type") === "select-trigger") {
|
|
273
|
-
cell.click();
|
|
274
|
-
return;
|
|
275
|
-
}
|
|
276
|
-
cell.focus();
|
|
277
|
-
e.preventDefault();
|
|
278
|
-
}
|
|
279
|
-
return;
|
|
280
|
-
}
|
|
281
|
-
/**
|
|
282
|
-
* Keys: ArrowLeft, ArrowRight
|
|
283
|
-
* Should move focus to the next/previous cell
|
|
284
|
-
*/
|
|
285
|
-
if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
|
286
|
-
const direction = e.key === "ArrowLeft" ? "prev" : "next";
|
|
287
|
-
const cell = e.target.closest(this.selectors.Cell);
|
|
288
|
-
let nextCell = null;
|
|
289
|
-
if (direction === "next" && cell?.nextElementSibling instanceof HTMLElement) nextCell = cell.nextElementSibling;
|
|
290
|
-
if (direction === "prev" && cell?.previousElementSibling instanceof HTMLElement) nextCell = cell.previousElementSibling;
|
|
291
|
-
if (nextCell && this.isFocusable(nextCell)) {
|
|
292
|
-
nextCell.focus();
|
|
293
|
-
e.preventDefault();
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
/**
|
|
297
|
-
* Keys: Up,Down
|
|
298
|
-
* Should move focus to the same column of the next/previous row
|
|
299
|
-
*/
|
|
300
|
-
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
301
|
-
this.verticalCellNavigation(e);
|
|
302
|
-
return;
|
|
303
|
-
}
|
|
304
|
-
/**
|
|
305
|
-
* Keys: PageUp, PageDown
|
|
306
|
-
* Should move focus to the first/last row
|
|
307
|
-
* or a predefined number of rows if user provides a value
|
|
308
|
-
*/
|
|
309
|
-
if (e.key === "PageUp" || e.key === "PageDown") {
|
|
310
|
-
this.pageCellNavigation(e);
|
|
311
|
-
return;
|
|
312
|
-
}
|
|
313
|
-
/**
|
|
314
|
-
* Keys: Home, End
|
|
315
|
-
* Should move focus to the first/last cell of the current row
|
|
316
|
-
*/
|
|
317
|
-
if (e.key === "Home" || e.key === "End") {
|
|
318
|
-
const rowChildren = [...e.target.closest(this.selectors.Row)?.children || []];
|
|
319
|
-
if (e.key === "End") rowChildren.reverse();
|
|
320
|
-
this.focusOnFirstCell(rowChildren);
|
|
321
|
-
}
|
|
322
|
-
} else {
|
|
323
|
-
/**
|
|
324
|
-
* Keys: Control + Home, Control + End
|
|
325
|
-
* Should move focus to the first/last cell of the first/last row
|
|
326
|
-
*/
|
|
327
|
-
const [firstKey, secondKey] = this.keys;
|
|
328
|
-
if (firstKey === "Control" && (secondKey === "Home" || secondKey === "End")) {
|
|
329
|
-
const siblings = e.target.closest(this.selectors.Row).parentElement?.children;
|
|
330
|
-
if (!siblings) return;
|
|
331
|
-
const rowChildren = [...(secondKey === "Home" ? siblings[0] : siblings[siblings.length - 1])?.children || []];
|
|
332
|
-
if (secondKey === "End") rowChildren.reverse();
|
|
333
|
-
this.focusOnFirstCell(rowChildren);
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
pageCellNavigation(e) {
|
|
338
|
-
if (!(e.target instanceof Element)) return;
|
|
339
|
-
const row = e.target.closest(this.selectors.Row);
|
|
340
|
-
const cell = e.target.closest(this.selectors.Cell);
|
|
341
|
-
if (row && cell) {
|
|
342
|
-
const position = this.getColumnIndex(cell);
|
|
343
|
-
if (position === void 0) return;
|
|
344
|
-
const direction = e.key === "PageUp" ? "prev" : "next";
|
|
345
|
-
const siblings = row.parentElement?.children;
|
|
346
|
-
if (!siblings) return;
|
|
347
|
-
let destinationRow;
|
|
348
|
-
if (this.pageUpDown) {
|
|
349
|
-
const methodClbk = direction === "prev" ? "previousSibling" : "nextSibling";
|
|
350
|
-
let sibling = row[methodClbk];
|
|
351
|
-
if (sibling === null) return;
|
|
352
|
-
let lastVisitedSibling = sibling;
|
|
353
|
-
for (let i = 0; i < this.pageUpDown - 1 && sibling; i++) {
|
|
354
|
-
sibling = sibling[methodClbk];
|
|
355
|
-
if (sibling) lastVisitedSibling = sibling;
|
|
356
|
-
}
|
|
357
|
-
destinationRow = sibling || lastVisitedSibling;
|
|
358
|
-
} else destinationRow = direction === "prev" ? siblings[0] : siblings[siblings.length - 1];
|
|
359
|
-
if (!destinationRow || !(destinationRow instanceof Element)) return;
|
|
360
|
-
const child = destinationRow.children[position];
|
|
361
|
-
if (child && this.isFocusable(child)) child.focus();
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
verticalCellNavigation(e) {
|
|
365
|
-
if (!(e.target instanceof Element)) return;
|
|
366
|
-
const row = e.target.closest(this.selectors.Row);
|
|
367
|
-
const cell = e.target.closest(this.selectors.Cell);
|
|
368
|
-
if (row && cell) {
|
|
369
|
-
const cellPosition = this.getColumnIndex(cell);
|
|
370
|
-
const rowPosition = this.getRowIndex(row);
|
|
371
|
-
if (cellPosition === void 0 || rowPosition === void 0) return;
|
|
372
|
-
const direction = e.key === "ArrowUp" ? "prev" : "next";
|
|
373
|
-
/** Find previous rowgroup and focus on the proper cell */
|
|
374
|
-
if (rowPosition === 0 && direction === "prev") {
|
|
375
|
-
const currentRowGroup = row.parentElement?.closest(this.selectors.RowGroup);
|
|
376
|
-
const siblingRowGroups = [...currentRowGroup?.parentElement?.children || []];
|
|
377
|
-
const currentRowGroupIdx = siblingRowGroups.findIndex((el) => el === currentRowGroup);
|
|
378
|
-
if (currentRowGroupIdx !== 0) {
|
|
379
|
-
const rows = [...siblingRowGroups[currentRowGroupIdx - 1].querySelectorAll(this.selectors.Row)];
|
|
380
|
-
const child = rows[rows.length - 1].children[cellPosition];
|
|
381
|
-
if (child && this.isFocusable(child)) child.focus();
|
|
382
|
-
return;
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
/** Find next rowgroup and focus on the proper cell */
|
|
386
|
-
if (rowPosition === [...row.parentElement?.querySelectorAll(this.selectors.Row) || []].length - 1 && direction === "next") {
|
|
387
|
-
const currentRowGroup = row.parentElement?.closest(this.selectors.RowGroup);
|
|
388
|
-
const siblingRowGroups = [...currentRowGroup?.parentElement?.children || []];
|
|
389
|
-
const currentRowGroupIdx = siblingRowGroups.findIndex((el) => el === currentRowGroup);
|
|
390
|
-
if (currentRowGroupIdx !== siblingRowGroups.length - 1) {
|
|
391
|
-
const child = [...siblingRowGroups[currentRowGroupIdx + 1].querySelectorAll(this.selectors.Row)][0].children[cellPosition];
|
|
392
|
-
if (child && this.isFocusable(child)) child.focus();
|
|
393
|
-
return;
|
|
394
|
-
}
|
|
395
|
-
return;
|
|
396
|
-
}
|
|
397
|
-
/** Navigation in the same rowgroup */
|
|
398
|
-
const destinationRow = this.findUntil(direction, row, this.selectors.Row);
|
|
399
|
-
if (!destinationRow) return;
|
|
400
|
-
const child = destinationRow.children[cellPosition];
|
|
401
|
-
if (child && this.isFocusable(child)) child.focus();
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
/**
|
|
405
|
-
* Sending a row `Element` and then the first cell will be focused.
|
|
406
|
-
*
|
|
407
|
-
* If you want to focus the last cell then the row children can be passed in
|
|
408
|
-
* reversed order
|
|
409
|
-
*/
|
|
410
|
-
focusOnFirstCell(el) {
|
|
411
|
-
for (let i = 0; i < el.length; i++) {
|
|
412
|
-
const child = el[i];
|
|
413
|
-
if (this.isFocusable(child)) {
|
|
414
|
-
child.focus();
|
|
415
|
-
return;
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
/**
|
|
420
|
-
* Get the column index of a `cell` based on the first `row` parent.
|
|
421
|
-
* `cellIndex` could be used, but it's not supported in HTML tables.
|
|
422
|
-
*/
|
|
423
|
-
getColumnIndex(cell) {
|
|
424
|
-
let position = 0;
|
|
425
|
-
const siblings = cell?.parentNode?.children;
|
|
426
|
-
if (!siblings) return;
|
|
427
|
-
while (cell !== siblings[position] && siblings[position] !== void 0) position++;
|
|
428
|
-
if (siblings[position] === void 0) return;
|
|
429
|
-
return position;
|
|
430
|
-
}
|
|
431
|
-
/**
|
|
432
|
-
* Get the row index of a `row` based
|
|
433
|
-
* on its sibling rows
|
|
434
|
-
*/
|
|
435
|
-
getRowIndex(row) {
|
|
436
|
-
let position = 0;
|
|
437
|
-
const siblings = row?.parentNode?.children;
|
|
438
|
-
if (!siblings) return;
|
|
439
|
-
while (row !== siblings[position] && siblings[position] !== void 0) position++;
|
|
440
|
-
if (siblings[position] === void 0) return;
|
|
441
|
-
return position;
|
|
442
|
-
}
|
|
443
|
-
/**
|
|
444
|
-
* Equivalent to prevUntil/nextUntil in jQuery
|
|
445
|
-
* https://api.jquery.com/prevUntil/
|
|
446
|
-
*/
|
|
447
|
-
findUntil(direction, el, matchSelector, exitSelector) {
|
|
448
|
-
let element = el;
|
|
449
|
-
const method = direction === "next" ? "nextSibling" : "previousSibling";
|
|
450
|
-
while (element[method]) {
|
|
451
|
-
const sibling = element[method];
|
|
452
|
-
if (!sibling) return null;
|
|
453
|
-
if (exitSelector && sibling instanceof Element && sibling.matches(exitSelector)) return null;
|
|
454
|
-
if (sibling instanceof Element && sibling.matches(matchSelector)) return sibling;
|
|
455
|
-
element = sibling;
|
|
456
|
-
}
|
|
457
|
-
return null;
|
|
458
|
-
}
|
|
459
|
-
};
|
|
460
|
-
function useTableNav(options) {
|
|
461
|
-
const nav = new DataGridNav(options);
|
|
462
|
-
return {
|
|
463
|
-
listeners: {
|
|
464
|
-
onKeyDown: (e) => nav.tableKeyDown(e),
|
|
465
|
-
onKeyUp: () => nav.tableKeyUp()
|
|
466
|
-
},
|
|
467
|
-
tableNav: nav
|
|
468
|
-
};
|
|
469
|
-
}
|
|
470
|
-
//#endregion
|
|
471
|
-
//#region src/components/table/Table.tsx
|
|
472
|
-
const DndProvider = lazy(() => import("./TableDnd-CuHxANWh.js").then((module) => ({ default: module.DndProvider })));
|
|
473
|
-
const SortableRows = lazy(() => import("./TableDnd-CuHxANWh.js").then((module) => ({ default: module.SortableRows })));
|
|
474
|
-
const DraggableRow = lazy(() => import("./TableDnd-CuHxANWh.js").then((module) => ({ default: module.DraggableRow })));
|
|
475
|
-
const DragHandle = lazy(() => import("./TableDnd-CuHxANWh.js").then((module) => ({ default: module.DragHandle })));
|
|
476
|
-
const tableFeaturesConfig = tableFeatures({
|
|
477
|
-
...stockFeatures,
|
|
478
|
-
sortedRowModel: createSortedRowModel(),
|
|
479
|
-
paginatedRowModel: createPaginatedRowModel()
|
|
480
|
-
});
|
|
481
|
-
const CustomCellContext = (context) => {
|
|
482
|
-
return {
|
|
483
|
-
...context,
|
|
484
|
-
original: context.row.original,
|
|
485
|
-
data: context.row.original,
|
|
486
|
-
value: context.getValue()
|
|
487
|
-
};
|
|
488
|
-
};
|
|
489
|
-
const isPlainFunction = (Comp) => typeof Comp === "function" && !Comp.prototype?.isReactComponent;
|
|
490
|
-
const CellContent = ({ cell, props }) => {
|
|
491
|
-
const rendered = isPlainFunction(cell) ? cell(props) : flexRender(cell, props);
|
|
492
|
-
return typeof rendered === "string" || typeof rendered === "number" ? /* @__PURE__ */ jsx(CellText, { children: rendered }) : rendered;
|
|
493
|
-
};
|
|
494
|
-
const renderCell = (Comp, props) => /* @__PURE__ */ jsx(CellContent, {
|
|
495
|
-
cell: Comp,
|
|
496
|
-
props
|
|
497
|
-
});
|
|
498
|
-
const RowDragHandleCell = ({ rowId }) => {
|
|
499
|
-
return /* @__PURE__ */ jsx(DragHandle, {
|
|
500
|
-
id: rowId,
|
|
501
|
-
children: (dragProps) => /* @__PURE__ */ jsx(IconButton, {
|
|
502
|
-
...dragProps,
|
|
503
|
-
className: "cursor-move p-1",
|
|
504
|
-
label: "Drag handle",
|
|
505
|
-
icon: GripVertical,
|
|
506
|
-
variant: "text",
|
|
507
|
-
width: "hug",
|
|
508
|
-
disableTooltip: true,
|
|
509
|
-
size: "sm"
|
|
510
|
-
})
|
|
511
|
-
});
|
|
512
|
-
};
|
|
513
|
-
const AutoDragHandleCell = ({ row }) => /* @__PURE__ */ jsx(RowDragHandleCell, { rowId: row.id });
|
|
514
|
-
const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, className, variant: variantProp, containerClassName, maxHeight, scroll = "table", sorting, setSorting, columnOrder, setColumnOrder, columnVisibility, setColumnVisibility, bulkSelectionActions: ActionHeader, enableDragDrop = false, onDragEnd, onReorder, getRowId, enableRowSelection, enableMultiRowSelection = false, defaultSelectedRows, onRowSelectionChange, ...props }) => {
|
|
515
|
-
const uiConfig = UIConfig.useConfig();
|
|
516
|
-
const variant = variantProp ?? uiConfig.table.variant;
|
|
517
|
-
const showColumnBorders = showCellBorder ?? (variant !== "horizontals" && variant !== "zebra" && variant !== "striped-columns");
|
|
518
|
-
const tableContainerCva = UIOverrides.useCva("table.containerCva", tableContainerDefinition);
|
|
519
|
-
const tableRowCva = UIOverrides.useCva("table.rowCva", tableRowDefinition);
|
|
520
|
-
const theadCva = UIOverrides.useCva("table.theadCva", theadDefinition);
|
|
521
|
-
const tableHeadRowCva = UIOverrides.useCva("table.headRowCva", tableHeadRowDefinition);
|
|
522
|
-
const tableHeadDataCva = UIOverrides.useCva("table.headDataCva", tableHeadDataDefinition);
|
|
523
|
-
const tableDataCva = UIOverrides.useCva("table.dataCva", tableDataDefinition);
|
|
524
|
-
const ref = useRef(null);
|
|
525
|
-
const { listeners } = useTableNav();
|
|
526
|
-
const data = useMemo(() => items ?? [], [items]);
|
|
527
|
-
const [internalSelectedRows, setInternalSelectedRows] = useState(() => defaultSelectedRows ?? {});
|
|
528
|
-
const hasExternalRowSelection = defaultSelectedRows !== void 0 && onRowSelectionChange !== void 0;
|
|
529
|
-
const rowSelection = hasExternalRowSelection ? defaultSelectedRows : internalSelectedRows;
|
|
530
|
-
const handleRowSelectionChange = useCallback((updater) => {
|
|
531
|
-
if (!hasExternalRowSelection) setInternalSelectedRows(updater);
|
|
532
|
-
onRowSelectionChange?.(updater);
|
|
533
|
-
}, [hasExternalRowSelection, onRowSelectionChange]);
|
|
534
|
-
const baseColumns = useMemo(() => typeof columns === "function" ? columns(i18next.t) : columns, [columns]);
|
|
535
|
-
const tableColumns = useMemo(() => {
|
|
536
|
-
if (enableDragDrop && getRowId) return [{
|
|
537
|
-
id: "drag-handle",
|
|
538
|
-
header: "",
|
|
539
|
-
meta: { width: "w-12" },
|
|
540
|
-
cell: AutoDragHandleCell,
|
|
541
|
-
enableSorting: false
|
|
542
|
-
}, ...baseColumns];
|
|
543
|
-
return baseColumns;
|
|
544
|
-
}, [
|
|
545
|
-
baseColumns,
|
|
546
|
-
enableDragDrop,
|
|
547
|
-
getRowId
|
|
548
|
-
]);
|
|
549
|
-
const [isSticky, setIsSticky] = useState(false);
|
|
550
|
-
const tableRef = useRef(null);
|
|
551
|
-
const theadRef = useRef(null);
|
|
552
|
-
useEffect(() => {
|
|
553
|
-
const update = () => {
|
|
554
|
-
const tableTop = tableRef.current?.getBoundingClientRect().top;
|
|
555
|
-
const theadTop = theadRef.current?.getBoundingClientRect().top;
|
|
556
|
-
setIsSticky(tableTop !== void 0 && theadTop !== void 0 && theadTop > tableTop);
|
|
557
|
-
};
|
|
558
|
-
update();
|
|
559
|
-
document.addEventListener("scroll", update, {
|
|
560
|
-
capture: true,
|
|
561
|
-
passive: true
|
|
562
|
-
});
|
|
563
|
-
return () => document.removeEventListener("scroll", update, { capture: true });
|
|
564
|
-
}, []);
|
|
565
|
-
const table = useTable({
|
|
566
|
-
features: tableFeaturesConfig,
|
|
567
|
-
data,
|
|
568
|
-
columns: tableColumns,
|
|
569
|
-
state: {
|
|
570
|
-
sorting,
|
|
571
|
-
columnOrder,
|
|
572
|
-
columnVisibility,
|
|
573
|
-
rowSelection
|
|
574
|
-
},
|
|
575
|
-
rowCount: items.length,
|
|
576
|
-
manualPagination: true,
|
|
577
|
-
onColumnOrderChange: setColumnOrder,
|
|
578
|
-
onColumnVisibilityChange: setColumnVisibility,
|
|
579
|
-
onSortingChange: setSorting,
|
|
580
|
-
onRowSelectionChange: handleRowSelectionChange,
|
|
581
|
-
manualSorting: true,
|
|
582
|
-
autoResetPageIndex: false,
|
|
583
|
-
autoResetExpanded: false,
|
|
584
|
-
defaultColumn: { sortDescFirst: true },
|
|
585
|
-
enableRowSelection,
|
|
586
|
-
enableMultiRowSelection,
|
|
587
|
-
getRowId: getRowId ? (row) => String(getRowId(row)) : void 0
|
|
588
|
-
});
|
|
589
|
-
const dataIds = useMemo(() => {
|
|
590
|
-
if (!enableDragDrop || !getRowId) return [];
|
|
591
|
-
return data.map((item) => getRowId(item));
|
|
592
|
-
}, [
|
|
593
|
-
data,
|
|
594
|
-
enableDragDrop,
|
|
595
|
-
getRowId
|
|
596
|
-
]);
|
|
597
|
-
const handleDragEnd = useCallback((event) => {
|
|
598
|
-
const { active, over } = event;
|
|
599
|
-
if (!active || !over || active.id === over.id) return;
|
|
600
|
-
if (getRowId && (onReorder || onDragEnd)) {
|
|
601
|
-
if (onReorder) {
|
|
602
|
-
const oldIndex = items.findIndex((item_0) => getRowId(item_0) === active.id);
|
|
603
|
-
const newIndex = items.findIndex((item_1) => getRowId(item_1) === over.id);
|
|
604
|
-
if (oldIndex !== -1 && newIndex !== -1) {
|
|
605
|
-
const reorderedItems = [...items];
|
|
606
|
-
const [movedItem] = reorderedItems.splice(oldIndex, 1);
|
|
607
|
-
reorderedItems.splice(newIndex, 0, movedItem);
|
|
608
|
-
onReorder(reorderedItems);
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
onDragEnd?.(event);
|
|
612
|
-
}
|
|
613
|
-
}, [
|
|
614
|
-
onDragEnd,
|
|
615
|
-
onReorder,
|
|
616
|
-
items,
|
|
617
|
-
getRowId
|
|
618
|
-
]);
|
|
619
|
-
const selectedRows = table.getSelectedRowModel().rows;
|
|
620
|
-
const columnCount = table.getHeaderGroups()[0].headers.length;
|
|
621
|
-
const isAnyRowSelected = selectedRows.length > 0 && !!ActionHeader;
|
|
622
|
-
const hasOnClick = !!onRowClick || !!onDoubleClick;
|
|
623
|
-
const tableElement = /* @__PURE__ */ jsx("div", {
|
|
624
|
-
className: tableContainerCva({
|
|
625
|
-
variant,
|
|
626
|
-
scroll,
|
|
627
|
-
className: containerClassName
|
|
628
|
-
}),
|
|
629
|
-
style: maxHeight === void 0 || scroll === "page" ? void 0 : { maxHeight },
|
|
630
|
-
children: /* @__PURE__ */ jsxs("table", {
|
|
631
|
-
ref: tableRef,
|
|
632
|
-
className: clsx("w-full font-body text-large", className),
|
|
633
|
-
...listeners,
|
|
634
|
-
children: [/* @__PURE__ */ jsx("thead", {
|
|
635
|
-
ref: theadRef,
|
|
636
|
-
className: clsx(theadCva({})),
|
|
637
|
-
"data-is-sticky": isSticky || void 0,
|
|
638
|
-
children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx("tr", {
|
|
639
|
-
className: clsx(tableHeadRowCva({})),
|
|
640
|
-
children: headerGroup.headers.filter((header) => {
|
|
641
|
-
if (isAnyRowSelected && header.index > 0) return false;
|
|
642
|
-
return header.column.getIsVisible();
|
|
643
|
-
}).map((header_0, index) => {
|
|
644
|
-
const columnMeta = header_0.column.columnDef.meta ?? {};
|
|
645
|
-
return /* @__PURE__ */ jsx("th", {
|
|
646
|
-
colSpan: isAnyRowSelected ? columnCount : header_0.colSpan,
|
|
647
|
-
tabIndex: -1,
|
|
648
|
-
className: clsx(tableHeadDataCva({
|
|
649
|
-
variant,
|
|
650
|
-
hasRightBorder: index > 0 && showColumnBorders
|
|
651
|
-
}), columnMeta.headerClass, columnMeta.width),
|
|
652
|
-
children: isAnyRowSelected ? /* @__PURE__ */ jsx(ActionHeader, { table }) : /* @__PURE__ */ jsxs("button", {
|
|
653
|
-
type: "button",
|
|
654
|
-
"aria-label": "Sort column",
|
|
655
|
-
className: clsx("flex select-none items-center gap-1 text-content-primary", header_0.column.getCanSort() ? "-mx-1 h-6 cursor-pointer rounded-xs px-1 hover:bg-table-row-hover" : "cursor-default", columnMeta.sortClass),
|
|
656
|
-
onClick: header_0.column.getToggleSortingHandler(),
|
|
657
|
-
children: [typeof header_0.column.columnDef.header === "function" ? flexRender(header_0.column.columnDef.header, header_0.getContext()) : /* @__PURE__ */ jsx(HeaderText, { children: header_0.column.columnDef.header }), {
|
|
658
|
-
asc: /* @__PURE__ */ jsx(IconSlot, { icon: ChevronUp }),
|
|
659
|
-
desc: /* @__PURE__ */ jsx(IconSlot, { icon: ChevronDown })
|
|
660
|
-
}[header_0.column.getIsSorted()] ?? null]
|
|
661
|
-
})
|
|
662
|
-
}, header_0.id);
|
|
663
|
-
})
|
|
664
|
-
}, headerGroup.id))
|
|
665
|
-
}), /* @__PURE__ */ jsx("tbody", {
|
|
666
|
-
ref,
|
|
667
|
-
className: "relative",
|
|
668
|
-
children: enableDragDrop ? /* @__PURE__ */ jsx(SortableRows, {
|
|
669
|
-
items: dataIds,
|
|
670
|
-
children: table.getRowModel().rows.map((row_0) => /* @__PURE__ */ jsx(DraggableRow, {
|
|
671
|
-
id: row_0.id,
|
|
672
|
-
className: clsx(tableRowCva({
|
|
673
|
-
...props,
|
|
674
|
-
variant
|
|
675
|
-
})),
|
|
676
|
-
isClickable: hasOnClick || row_0.getCanSelect(),
|
|
677
|
-
isSelected: row_0.getIsSelected(),
|
|
678
|
-
onClick: () => {
|
|
679
|
-
if (onRowClick) {
|
|
680
|
-
onRowClick(row_0.original);
|
|
681
|
-
return;
|
|
682
|
-
}
|
|
683
|
-
if (row_0.getCanSelect()) row_0.toggleSelected();
|
|
684
|
-
},
|
|
685
|
-
onDoubleClick: () => onDoubleClick?.(row_0.original),
|
|
686
|
-
children: row_0.getVisibleCells().map((cell, cellIndex) => {
|
|
687
|
-
const columnMeta_0 = cell.column.columnDef.meta ?? {};
|
|
688
|
-
return /* @__PURE__ */ jsx("td", {
|
|
689
|
-
tabIndex: -1,
|
|
690
|
-
className: clsx(tableDataCva({
|
|
691
|
-
variant,
|
|
692
|
-
hasRightBorder: cellIndex > 0 && showColumnBorders
|
|
693
|
-
}), columnMeta_0.cellClass, columnMeta_0.width),
|
|
694
|
-
children: renderCell(cell.column.columnDef.cell, CustomCellContext(cell.getContext()))
|
|
695
|
-
}, cell.id);
|
|
696
|
-
})
|
|
697
|
-
}, row_0.id))
|
|
698
|
-
}) : table.getRowModel().rows.map((row_1) => {
|
|
699
|
-
return /* @__PURE__ */ jsx("tr", {
|
|
700
|
-
className: clsx(tableRowCva({
|
|
701
|
-
...props,
|
|
702
|
-
variant
|
|
703
|
-
})),
|
|
704
|
-
onClick: () => {
|
|
705
|
-
if (onRowClick) {
|
|
706
|
-
onRowClick(row_1.original);
|
|
707
|
-
return;
|
|
708
|
-
}
|
|
709
|
-
if (row_1.getCanSelect()) row_1.toggleSelected();
|
|
710
|
-
},
|
|
711
|
-
onDoubleClick: () => onDoubleClick?.(row_1.original),
|
|
712
|
-
"data-clickable": hasOnClick || row_1.getCanSelect() || void 0,
|
|
713
|
-
"data-selected": row_1.getIsSelected() || void 0,
|
|
714
|
-
children: row_1.getVisibleCells().map((cell_0, cellIndex_0) => {
|
|
715
|
-
const columnMeta_1 = cell_0.column.columnDef.meta ?? {};
|
|
716
|
-
return /* @__PURE__ */ jsx("td", {
|
|
717
|
-
tabIndex: -1,
|
|
718
|
-
className: clsx(tableDataCva({
|
|
719
|
-
variant,
|
|
720
|
-
hasRightBorder: cellIndex_0 > 0 && showColumnBorders
|
|
721
|
-
}), columnMeta_1.cellClass, columnMeta_1.width),
|
|
722
|
-
children: renderCell(cell_0.column.columnDef.cell, CustomCellContext(cell_0.getContext()))
|
|
723
|
-
}, cell_0.id);
|
|
724
|
-
})
|
|
725
|
-
}, row_1.id);
|
|
726
|
-
})
|
|
727
|
-
})]
|
|
728
|
-
})
|
|
729
|
-
});
|
|
730
|
-
if (enableDragDrop) return /* @__PURE__ */ jsx(Suspense, {
|
|
731
|
-
fallback: null,
|
|
732
|
-
children: /* @__PURE__ */ jsx(DndProvider, {
|
|
733
|
-
onDragEnd: handleDragEnd,
|
|
734
|
-
children: tableElement
|
|
735
|
-
})
|
|
736
|
-
});
|
|
737
|
-
return tableElement;
|
|
738
|
-
};
|
|
739
|
-
//#endregion
|
|
740
|
-
//#region src/components/table/ColumnConfig.tsx
|
|
741
|
-
const VisibilityCell = (t0) => {
|
|
742
|
-
const $ = c(7);
|
|
743
|
-
const { original, onToggle } = t0;
|
|
744
|
-
let t1;
|
|
745
|
-
if ($[0] !== onToggle || $[1] !== original.id) {
|
|
746
|
-
t1 = () => onToggle(original.id);
|
|
747
|
-
$[0] = onToggle;
|
|
748
|
-
$[1] = original.id;
|
|
749
|
-
$[2] = t1;
|
|
750
|
-
} else t1 = $[2];
|
|
751
|
-
const t2 = original.label;
|
|
752
|
-
let t3;
|
|
753
|
-
if ($[3] !== original.visible || $[4] !== t1 || $[5] !== t2) {
|
|
754
|
-
t3 = /* @__PURE__ */ jsx(Checkbox, {
|
|
755
|
-
isSelected: original.visible,
|
|
756
|
-
onChange: t1,
|
|
757
|
-
hideLabel: true,
|
|
758
|
-
children: t2
|
|
759
|
-
});
|
|
760
|
-
$[3] = original.visible;
|
|
761
|
-
$[4] = t1;
|
|
762
|
-
$[5] = t2;
|
|
763
|
-
$[6] = t3;
|
|
764
|
-
} else t3 = $[6];
|
|
765
|
-
return t3;
|
|
766
|
-
};
|
|
767
|
-
const getColumns = (t, handleToggleVisibility) => [{
|
|
768
|
-
id: "name",
|
|
769
|
-
header: t(($) => $.ui.table.column, { ns: "ui" }),
|
|
770
|
-
meta: { width: "flex-1" },
|
|
771
|
-
accessorKey: "label"
|
|
772
|
-
}, {
|
|
773
|
-
id: "visible",
|
|
774
|
-
header: t(($) => $.ui.table.show, { ns: "ui" }),
|
|
775
|
-
meta: { width: "w-20" },
|
|
776
|
-
cell: ({ original }) => /* @__PURE__ */ jsx(VisibilityCell, {
|
|
777
|
-
original,
|
|
778
|
-
onToggle: handleToggleVisibility
|
|
779
|
-
})
|
|
780
|
-
}];
|
|
781
|
-
function ColumnConfigModal(t0) {
|
|
782
|
-
const $ = c(27);
|
|
783
|
-
const { isOpen, onClose, configColumns, visibleColumns, onVisibilityChange, onOrderChange } = t0;
|
|
784
|
-
const { t } = useTranslation("ui");
|
|
785
|
-
let t1;
|
|
786
|
-
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
787
|
-
t1 = [];
|
|
788
|
-
$[0] = t1;
|
|
789
|
-
} else t1 = $[0];
|
|
790
|
-
const [data, setData] = useState(t1);
|
|
791
|
-
let t2;
|
|
792
|
-
let t3;
|
|
793
|
-
if ($[1] !== configColumns || $[2] !== visibleColumns) {
|
|
794
|
-
t2 = () => {
|
|
795
|
-
setData(configColumns.map((column) => {
|
|
796
|
-
const columnId = column.id ?? column.accessorKey;
|
|
797
|
-
return {
|
|
798
|
-
id: columnId,
|
|
799
|
-
label: column.header,
|
|
800
|
-
visible: visibleColumns?.[columnId] ?? true
|
|
801
|
-
};
|
|
802
|
-
}));
|
|
803
|
-
};
|
|
804
|
-
t3 = [configColumns, visibleColumns];
|
|
805
|
-
$[1] = configColumns;
|
|
806
|
-
$[2] = visibleColumns;
|
|
807
|
-
$[3] = t2;
|
|
808
|
-
$[4] = t3;
|
|
809
|
-
} else {
|
|
810
|
-
t2 = $[3];
|
|
811
|
-
t3 = $[4];
|
|
812
|
-
}
|
|
813
|
-
useEffect(t2, t3);
|
|
814
|
-
let t4;
|
|
815
|
-
if ($[5] !== onVisibilityChange || $[6] !== visibleColumns) {
|
|
816
|
-
t4 = (columnId_0) => {
|
|
817
|
-
const newVisible = {
|
|
818
|
-
...visibleColumns,
|
|
819
|
-
[columnId_0]: !visibleColumns[columnId_0]
|
|
820
|
-
};
|
|
821
|
-
onVisibilityChange(newVisible);
|
|
822
|
-
};
|
|
823
|
-
$[5] = onVisibilityChange;
|
|
824
|
-
$[6] = visibleColumns;
|
|
825
|
-
$[7] = t4;
|
|
826
|
-
} else t4 = $[7];
|
|
827
|
-
const handleToggleVisibility = t4;
|
|
828
|
-
let t5;
|
|
829
|
-
if ($[8] !== handleToggleVisibility) {
|
|
830
|
-
t5 = (translateFn) => getColumns(translateFn, handleToggleVisibility);
|
|
831
|
-
$[8] = handleToggleVisibility;
|
|
832
|
-
$[9] = t5;
|
|
833
|
-
} else t5 = $[9];
|
|
834
|
-
const columns = useTranslationMemo(t5);
|
|
835
|
-
let t6;
|
|
836
|
-
if ($[10] !== onOrderChange) {
|
|
837
|
-
t6 = (reorderedItems) => {
|
|
838
|
-
setData(reorderedItems);
|
|
839
|
-
onOrderChange(reorderedItems.map(_temp$2));
|
|
840
|
-
};
|
|
841
|
-
$[10] = onOrderChange;
|
|
842
|
-
$[11] = t6;
|
|
843
|
-
} else t6 = $[11];
|
|
844
|
-
const handleReorder = t6;
|
|
845
|
-
if (!isOpen) return null;
|
|
846
|
-
let t7;
|
|
847
|
-
if ($[12] !== t) {
|
|
848
|
-
t7 = t(_temp2$2);
|
|
849
|
-
$[12] = t;
|
|
850
|
-
$[13] = t7;
|
|
851
|
-
} else t7 = $[13];
|
|
852
|
-
let t8;
|
|
853
|
-
if ($[14] !== t7) {
|
|
854
|
-
t8 = /* @__PURE__ */ jsx(Typography, {
|
|
855
|
-
as: "h2",
|
|
856
|
-
className: "font-bold",
|
|
857
|
-
size: "lead",
|
|
858
|
-
children: t7
|
|
859
|
-
});
|
|
860
|
-
$[14] = t7;
|
|
861
|
-
$[15] = t8;
|
|
862
|
-
} else t8 = $[15];
|
|
863
|
-
let t9;
|
|
864
|
-
if ($[16] !== columns || $[17] !== data || $[18] !== handleReorder) {
|
|
865
|
-
t9 = /* @__PURE__ */ jsx("div", {
|
|
866
|
-
className: "max-h-96 overflow-y-auto",
|
|
867
|
-
children: /* @__PURE__ */ jsx(Table, {
|
|
868
|
-
items: data,
|
|
869
|
-
columns,
|
|
870
|
-
showCellBorder: true,
|
|
871
|
-
className: "w-full",
|
|
872
|
-
enableDragDrop: true,
|
|
873
|
-
getRowId: _temp3,
|
|
874
|
-
onReorder: handleReorder
|
|
875
|
-
})
|
|
876
|
-
});
|
|
877
|
-
$[16] = columns;
|
|
878
|
-
$[17] = data;
|
|
879
|
-
$[18] = handleReorder;
|
|
880
|
-
$[19] = t9;
|
|
881
|
-
} else t9 = $[19];
|
|
882
|
-
let t10;
|
|
883
|
-
if ($[20] !== t8 || $[21] !== t9) {
|
|
884
|
-
t10 = /* @__PURE__ */ jsxs("div", {
|
|
885
|
-
className: "flex flex-col gap-2 p-4",
|
|
886
|
-
children: [t8, t9]
|
|
887
|
-
});
|
|
888
|
-
$[20] = t8;
|
|
889
|
-
$[21] = t9;
|
|
890
|
-
$[22] = t10;
|
|
891
|
-
} else t10 = $[22];
|
|
892
|
-
let t11;
|
|
893
|
-
if ($[23] !== isOpen || $[24] !== onClose || $[25] !== t10) {
|
|
894
|
-
t11 = /* @__PURE__ */ jsx(Dialog, {
|
|
895
|
-
isOpen,
|
|
896
|
-
onClose,
|
|
897
|
-
showCloseIcon: true,
|
|
898
|
-
children: t10
|
|
899
|
-
});
|
|
900
|
-
$[23] = isOpen;
|
|
901
|
-
$[24] = onClose;
|
|
902
|
-
$[25] = t10;
|
|
903
|
-
$[26] = t11;
|
|
904
|
-
} else t11 = $[26];
|
|
905
|
-
return t11;
|
|
906
|
-
}
|
|
907
|
-
function _temp3(row) {
|
|
908
|
-
return row.id;
|
|
909
|
-
}
|
|
910
|
-
function _temp2$2($) {
|
|
911
|
-
return $.ui.table.configureColumns;
|
|
912
|
-
}
|
|
913
|
-
function _temp$2(item) {
|
|
914
|
-
return item.id;
|
|
915
|
-
}
|
|
916
|
-
//#endregion
|
|
917
|
-
//#region src/components/table/InfiniteTable.tsx
|
|
918
|
-
const InfiniteTable = (t0) => {
|
|
919
|
-
const $ = c(20);
|
|
920
|
-
let fetchNextPage;
|
|
921
|
-
let hasNextPage;
|
|
922
|
-
let rest;
|
|
923
|
-
let t1;
|
|
924
|
-
if ($[0] !== t0) {
|
|
925
|
-
({hasNextPage, isFetchingNextPage: t1, fetchNextPage, ...rest} = t0);
|
|
926
|
-
$[0] = t0;
|
|
927
|
-
$[1] = fetchNextPage;
|
|
928
|
-
$[2] = hasNextPage;
|
|
929
|
-
$[3] = rest;
|
|
930
|
-
$[4] = t1;
|
|
931
|
-
} else {
|
|
932
|
-
fetchNextPage = $[1];
|
|
933
|
-
hasNextPage = $[2];
|
|
934
|
-
rest = $[3];
|
|
935
|
-
t1 = $[4];
|
|
936
|
-
}
|
|
937
|
-
const isFetchingNextPage = t1 === void 0 ? false : t1;
|
|
938
|
-
let t2;
|
|
939
|
-
if ($[5] !== fetchNextPage || $[6] !== hasNextPage || $[7] !== isFetchingNextPage) {
|
|
940
|
-
t2 = () => {
|
|
941
|
-
if (!isFetchingNextPage && hasNextPage) fetchNextPage();
|
|
942
|
-
};
|
|
943
|
-
$[5] = fetchNextPage;
|
|
944
|
-
$[6] = hasNextPage;
|
|
945
|
-
$[7] = isFetchingNextPage;
|
|
946
|
-
$[8] = t2;
|
|
947
|
-
} else t2 = $[8];
|
|
948
|
-
const handleLoadMore = t2;
|
|
949
|
-
let t3;
|
|
950
|
-
if ($[9] !== handleLoadMore) {
|
|
951
|
-
t3 = {
|
|
952
|
-
onIntersection: handleLoadMore,
|
|
953
|
-
rootMargin: "100px"
|
|
954
|
-
};
|
|
955
|
-
$[9] = handleLoadMore;
|
|
956
|
-
$[10] = t3;
|
|
957
|
-
} else t3 = $[10];
|
|
958
|
-
const { ref } = useIntersectionObserver(t3);
|
|
959
|
-
let t4;
|
|
960
|
-
if ($[11] !== rest) {
|
|
961
|
-
t4 = /* @__PURE__ */ jsx(Table, { ...rest });
|
|
962
|
-
$[11] = rest;
|
|
963
|
-
$[12] = t4;
|
|
964
|
-
} else t4 = $[12];
|
|
965
|
-
let t5;
|
|
966
|
-
if ($[13] !== hasNextPage || $[14] !== isFetchingNextPage || $[15] !== ref) {
|
|
967
|
-
t5 = (hasNextPage || isFetchingNextPage) && /* @__PURE__ */ jsx("div", {
|
|
968
|
-
ref,
|
|
969
|
-
className: "flex justify-center py-4",
|
|
970
|
-
children: /* @__PURE__ */ jsx(Spinner, {})
|
|
971
|
-
});
|
|
972
|
-
$[13] = hasNextPage;
|
|
973
|
-
$[14] = isFetchingNextPage;
|
|
974
|
-
$[15] = ref;
|
|
975
|
-
$[16] = t5;
|
|
976
|
-
} else t5 = $[16];
|
|
977
|
-
let t6;
|
|
978
|
-
if ($[17] !== t4 || $[18] !== t5) {
|
|
979
|
-
t6 = /* @__PURE__ */ jsxs("div", {
|
|
980
|
-
className: "flex flex-col",
|
|
981
|
-
children: [t4, t5]
|
|
982
|
-
});
|
|
983
|
-
$[17] = t4;
|
|
984
|
-
$[18] = t5;
|
|
985
|
-
$[19] = t6;
|
|
986
|
-
} else t6 = $[19];
|
|
987
|
-
return t6;
|
|
988
|
-
};
|
|
989
|
-
//#endregion
|
|
990
|
-
//#region src/components/table/PaginatedTable.tsx
|
|
991
|
-
const PaginatedTable = (t0) => {
|
|
992
|
-
const $ = c(24);
|
|
993
|
-
let items;
|
|
994
|
-
let pagination;
|
|
995
|
-
let rest;
|
|
996
|
-
let setPagination;
|
|
997
|
-
let totalItems;
|
|
998
|
-
if ($[0] !== t0) {
|
|
999
|
-
({pagination, setPagination, items, totalItems, ...rest} = t0);
|
|
1000
|
-
$[0] = t0;
|
|
1001
|
-
$[1] = items;
|
|
1002
|
-
$[2] = pagination;
|
|
1003
|
-
$[3] = rest;
|
|
1004
|
-
$[4] = setPagination;
|
|
1005
|
-
$[5] = totalItems;
|
|
1006
|
-
} else {
|
|
1007
|
-
items = $[1];
|
|
1008
|
-
pagination = $[2];
|
|
1009
|
-
rest = $[3];
|
|
1010
|
-
setPagination = $[4];
|
|
1011
|
-
totalItems = $[5];
|
|
1012
|
-
}
|
|
1013
|
-
let t1;
|
|
1014
|
-
if ($[6] !== items) {
|
|
1015
|
-
t1 = items ?? [];
|
|
1016
|
-
$[6] = items;
|
|
1017
|
-
$[7] = t1;
|
|
1018
|
-
} else t1 = $[7];
|
|
1019
|
-
let t2;
|
|
1020
|
-
if ($[8] !== rest || $[9] !== t1) {
|
|
1021
|
-
t2 = /* @__PURE__ */ jsx(Table, {
|
|
1022
|
-
...rest,
|
|
1023
|
-
items: t1
|
|
1024
|
-
});
|
|
1025
|
-
$[8] = rest;
|
|
1026
|
-
$[9] = t1;
|
|
1027
|
-
$[10] = t2;
|
|
1028
|
-
} else t2 = $[10];
|
|
1029
|
-
const t3 = pagination.pageIndex + 1;
|
|
1030
|
-
const t4 = totalItems ?? 0;
|
|
1031
|
-
let t5;
|
|
1032
|
-
let t6;
|
|
1033
|
-
if ($[11] !== pagination || $[12] !== setPagination) {
|
|
1034
|
-
t5 = (page) => setPagination({
|
|
1035
|
-
...pagination,
|
|
1036
|
-
pageIndex: page - 1
|
|
1037
|
-
});
|
|
1038
|
-
t6 = (pageSize) => setPagination({
|
|
1039
|
-
...pagination,
|
|
1040
|
-
pageSize,
|
|
1041
|
-
pageIndex: 0
|
|
1042
|
-
});
|
|
1043
|
-
$[11] = pagination;
|
|
1044
|
-
$[12] = setPagination;
|
|
1045
|
-
$[13] = t5;
|
|
1046
|
-
$[14] = t6;
|
|
1047
|
-
} else {
|
|
1048
|
-
t5 = $[13];
|
|
1049
|
-
t6 = $[14];
|
|
1050
|
-
}
|
|
1051
|
-
let t7;
|
|
1052
|
-
if ($[15] !== pagination.pageSize || $[16] !== t3 || $[17] !== t4 || $[18] !== t5 || $[19] !== t6) {
|
|
1053
|
-
t7 = /* @__PURE__ */ jsx(Pagination, {
|
|
1054
|
-
page: t3,
|
|
1055
|
-
pageSize: pagination.pageSize,
|
|
1056
|
-
totalItems: t4,
|
|
1057
|
-
onPageChange: t5,
|
|
1058
|
-
onPageSizeChange: t6
|
|
1059
|
-
});
|
|
1060
|
-
$[15] = pagination.pageSize;
|
|
1061
|
-
$[16] = t3;
|
|
1062
|
-
$[17] = t4;
|
|
1063
|
-
$[18] = t5;
|
|
1064
|
-
$[19] = t6;
|
|
1065
|
-
$[20] = t7;
|
|
1066
|
-
} else t7 = $[20];
|
|
1067
|
-
let t8;
|
|
1068
|
-
if ($[21] !== t2 || $[22] !== t7) {
|
|
1069
|
-
t8 = /* @__PURE__ */ jsxs("div", {
|
|
1070
|
-
className: "flex min-h-0 flex-col gap-4",
|
|
1071
|
-
children: [t2, t7]
|
|
1072
|
-
});
|
|
1073
|
-
$[21] = t2;
|
|
1074
|
-
$[22] = t7;
|
|
1075
|
-
$[23] = t8;
|
|
1076
|
-
} else t8 = $[23];
|
|
1077
|
-
return t8;
|
|
1078
|
-
};
|
|
1079
|
-
//#endregion
|
|
1080
|
-
//#region src/hooks/usePagination.ts
|
|
1081
|
-
const DEFAULT_STATE = {
|
|
1082
|
-
pageIndex: 0,
|
|
1083
|
-
pageSize: 20
|
|
1084
|
-
};
|
|
1085
|
-
const parsePositiveInteger = (value, fallback) => {
|
|
1086
|
-
if (value === null || !/^\d+$/.test(value)) return fallback;
|
|
1087
|
-
const number = Number(value);
|
|
1088
|
-
return Number.isSafeInteger(number) && number > 0 ? number : fallback;
|
|
1089
|
-
};
|
|
1090
|
-
/** Zero-based TanStack state; URL `page` values remain one-based. Defaults override initial URL state. */
|
|
1091
|
-
function usePagination(defaultPagination) {
|
|
1092
|
-
const $ = c(12);
|
|
1093
|
-
const { replace, searchParams } = UIRouter.useUIRouter();
|
|
1094
|
-
let t0;
|
|
1095
|
-
if ($[0] !== defaultPagination || $[1] !== searchParams) {
|
|
1096
|
-
t0 = () => defaultPagination ?? {
|
|
1097
|
-
pageIndex: parsePositiveInteger(searchParams.get("page"), 1) - 1,
|
|
1098
|
-
pageSize: parsePositiveInteger(searchParams.get("size"), DEFAULT_STATE.pageSize)
|
|
1099
|
-
};
|
|
1100
|
-
$[0] = defaultPagination;
|
|
1101
|
-
$[1] = searchParams;
|
|
1102
|
-
$[2] = t0;
|
|
1103
|
-
} else t0 = $[2];
|
|
1104
|
-
const [pagination, setPagination] = useState(t0);
|
|
1105
|
-
let t1;
|
|
1106
|
-
if ($[3] !== pagination.pageIndex || $[4] !== pagination.pageSize || $[5] !== replace || $[6] !== searchParams) {
|
|
1107
|
-
t1 = () => {
|
|
1108
|
-
const params = new URLSearchParams(searchParams);
|
|
1109
|
-
params.delete("size");
|
|
1110
|
-
params.delete("page");
|
|
1111
|
-
if (pagination.pageSize !== DEFAULT_STATE.pageSize) params.set("size", pagination.pageSize.toString());
|
|
1112
|
-
if (pagination.pageIndex !== DEFAULT_STATE.pageIndex) params.set("page", (pagination.pageIndex + 1).toString());
|
|
1113
|
-
if (params.toString() === searchParams.toString()) return;
|
|
1114
|
-
replace(".", RoutingUtils.toRouterSearch(params));
|
|
1115
|
-
};
|
|
1116
|
-
$[3] = pagination.pageIndex;
|
|
1117
|
-
$[4] = pagination.pageSize;
|
|
1118
|
-
$[5] = replace;
|
|
1119
|
-
$[6] = searchParams;
|
|
1120
|
-
$[7] = t1;
|
|
1121
|
-
} else t1 = $[7];
|
|
1122
|
-
let t2;
|
|
1123
|
-
if ($[8] !== pagination) {
|
|
1124
|
-
t2 = [pagination];
|
|
1125
|
-
$[8] = pagination;
|
|
1126
|
-
$[9] = t2;
|
|
1127
|
-
} else t2 = $[9];
|
|
1128
|
-
useEffect(t1, t2);
|
|
1129
|
-
let t3;
|
|
1130
|
-
if ($[10] !== pagination) {
|
|
1131
|
-
t3 = {
|
|
1132
|
-
pagination,
|
|
1133
|
-
setPagination,
|
|
1134
|
-
pageIndex: pagination.pageIndex,
|
|
1135
|
-
pageSize: pagination.pageSize
|
|
1136
|
-
};
|
|
1137
|
-
$[10] = pagination;
|
|
1138
|
-
$[11] = t3;
|
|
1139
|
-
} else t3 = $[11];
|
|
1140
|
-
return t3;
|
|
1141
|
-
}
|
|
1142
|
-
//#endregion
|
|
1143
|
-
//#region src/hooks/useSorting.ts
|
|
1144
|
-
function useSorting(defaultSorting, t0) {
|
|
1145
|
-
const $ = c(16);
|
|
1146
|
-
const prefix = t0 === void 0 ? "" : t0;
|
|
1147
|
-
const { replace, searchParams } = UIRouter.useUIRouter();
|
|
1148
|
-
let t1;
|
|
1149
|
-
if ($[0] !== defaultSorting || $[1] !== prefix || $[2] !== searchParams) {
|
|
1150
|
-
t1 = defaultSorting ?? searchParams.get(`order${prefix && `-${prefix}`}`)?.split(",").map(_temp$1) ?? [];
|
|
1151
|
-
$[0] = defaultSorting;
|
|
1152
|
-
$[1] = prefix;
|
|
1153
|
-
$[2] = searchParams;
|
|
1154
|
-
$[3] = t1;
|
|
1155
|
-
} else t1 = $[3];
|
|
1156
|
-
const [sorting, setSorting] = useState(t1);
|
|
1157
|
-
let t2;
|
|
1158
|
-
if ($[4] !== sorting) {
|
|
1159
|
-
t2 = sorting.map(_temp2$1).join(",");
|
|
1160
|
-
$[4] = sorting;
|
|
1161
|
-
$[5] = t2;
|
|
1162
|
-
} else t2 = $[5];
|
|
1163
|
-
const order = t2;
|
|
1164
|
-
let t3;
|
|
1165
|
-
if ($[6] !== order || $[7] !== prefix || $[8] !== replace || $[9] !== searchParams) {
|
|
1166
|
-
t3 = () => {
|
|
1167
|
-
const params = new URLSearchParams(searchParams);
|
|
1168
|
-
const orderKey = prefix ? `order-${prefix}` : "order";
|
|
1169
|
-
params.delete(orderKey);
|
|
1170
|
-
if (order) params.set(orderKey, order);
|
|
1171
|
-
if (params.toString() === searchParams.toString()) return;
|
|
1172
|
-
replace(".", RoutingUtils.toRouterSearch(params));
|
|
1173
|
-
};
|
|
1174
|
-
$[6] = order;
|
|
1175
|
-
$[7] = prefix;
|
|
1176
|
-
$[8] = replace;
|
|
1177
|
-
$[9] = searchParams;
|
|
1178
|
-
$[10] = t3;
|
|
1179
|
-
} else t3 = $[10];
|
|
1180
|
-
let t4;
|
|
1181
|
-
if ($[11] !== order) {
|
|
1182
|
-
t4 = [order];
|
|
1183
|
-
$[11] = order;
|
|
1184
|
-
$[12] = t4;
|
|
1185
|
-
} else t4 = $[12];
|
|
1186
|
-
useEffect(t3, t4);
|
|
1187
|
-
let t5;
|
|
1188
|
-
if ($[13] !== order || $[14] !== sorting) {
|
|
1189
|
-
t5 = {
|
|
1190
|
-
sorting,
|
|
1191
|
-
setSorting,
|
|
1192
|
-
order
|
|
1193
|
-
};
|
|
1194
|
-
$[13] = order;
|
|
1195
|
-
$[14] = sorting;
|
|
1196
|
-
$[15] = t5;
|
|
1197
|
-
} else t5 = $[15];
|
|
1198
|
-
return t5;
|
|
1199
|
-
}
|
|
1200
|
-
function _temp2$1(field) {
|
|
1201
|
-
return `${field.desc ? "-" : "+"}${field.id}`;
|
|
1202
|
-
}
|
|
1203
|
-
function _temp$1(item) {
|
|
1204
|
-
if (item.startsWith("-")) return {
|
|
1205
|
-
id: item.slice(1),
|
|
1206
|
-
desc: true
|
|
1207
|
-
};
|
|
1208
|
-
if (item.startsWith("+")) return {
|
|
1209
|
-
id: item.slice(1),
|
|
1210
|
-
desc: false
|
|
1211
|
-
};
|
|
1212
|
-
return {
|
|
1213
|
-
id: item,
|
|
1214
|
-
desc: false
|
|
1215
|
-
};
|
|
1216
|
-
}
|
|
1217
|
-
//#endregion
|
|
1218
|
-
//#region src/hooks/useTableColumnConfig.ts
|
|
1219
|
-
function sortByKeyOrder(data, orderedKeys = []) {
|
|
1220
|
-
return [...data].sort((a, b) => {
|
|
1221
|
-
return orderedKeys.findIndex((key) => key === (a.id ?? a.accessorKey)) - orderedKeys.findIndex((key) => key === (b.id ?? b.accessorKey));
|
|
1222
|
-
});
|
|
1223
|
-
}
|
|
1224
|
-
function useTableColumnConfig(defaultColumns, t0) {
|
|
1225
|
-
const $ = c(31);
|
|
1226
|
-
let t1;
|
|
1227
|
-
if ($[0] !== t0) {
|
|
1228
|
-
t1 = t0 === void 0 ? {} : t0;
|
|
1229
|
-
$[0] = t0;
|
|
1230
|
-
$[1] = t1;
|
|
1231
|
-
} else t1 = $[1];
|
|
1232
|
-
const options = t1;
|
|
1233
|
-
let t2;
|
|
1234
|
-
if ($[2] !== defaultColumns) {
|
|
1235
|
-
t2 = () => defaultColumns.reduce(_temp, {});
|
|
1236
|
-
$[2] = defaultColumns;
|
|
1237
|
-
$[3] = t2;
|
|
1238
|
-
} else t2 = $[3];
|
|
1239
|
-
const [internalVisibleColumns, setInternalVisibleColumns] = useState(t2);
|
|
1240
|
-
let t3;
|
|
1241
|
-
if ($[4] !== defaultColumns) {
|
|
1242
|
-
t3 = () => defaultColumns.map(_temp2);
|
|
1243
|
-
$[4] = defaultColumns;
|
|
1244
|
-
$[5] = t3;
|
|
1245
|
-
} else t3 = $[5];
|
|
1246
|
-
const [internalColumnOrder, setInternalColumnOrder] = useState(t3);
|
|
1247
|
-
let t4;
|
|
1248
|
-
let t5;
|
|
1249
|
-
if ($[6] !== options.visibleColumns) {
|
|
1250
|
-
t4 = () => {
|
|
1251
|
-
if (options.visibleColumns) setInternalVisibleColumns(options.visibleColumns);
|
|
1252
|
-
};
|
|
1253
|
-
t5 = [options.visibleColumns];
|
|
1254
|
-
$[6] = options.visibleColumns;
|
|
1255
|
-
$[7] = t4;
|
|
1256
|
-
$[8] = t5;
|
|
1257
|
-
} else {
|
|
1258
|
-
t4 = $[7];
|
|
1259
|
-
t5 = $[8];
|
|
1260
|
-
}
|
|
1261
|
-
useEffect(t4, t5);
|
|
1262
|
-
let t6;
|
|
1263
|
-
let t7;
|
|
1264
|
-
if ($[9] !== options.columnOrder) {
|
|
1265
|
-
t6 = () => {
|
|
1266
|
-
if (options.columnOrder) setInternalColumnOrder(options.columnOrder);
|
|
1267
|
-
};
|
|
1268
|
-
t7 = [options.columnOrder];
|
|
1269
|
-
$[9] = options.columnOrder;
|
|
1270
|
-
$[10] = t6;
|
|
1271
|
-
$[11] = t7;
|
|
1272
|
-
} else {
|
|
1273
|
-
t6 = $[10];
|
|
1274
|
-
t7 = $[11];
|
|
1275
|
-
}
|
|
1276
|
-
useEffect(t6, t7);
|
|
1277
|
-
let t8;
|
|
1278
|
-
if ($[12] !== options) {
|
|
1279
|
-
t8 = (value) => {
|
|
1280
|
-
setInternalVisibleColumns(value);
|
|
1281
|
-
options?.onVisibilityChange?.(value);
|
|
1282
|
-
};
|
|
1283
|
-
$[12] = options;
|
|
1284
|
-
$[13] = t8;
|
|
1285
|
-
} else t8 = $[13];
|
|
1286
|
-
const handleVisibilityChange = t8;
|
|
1287
|
-
let t9;
|
|
1288
|
-
if ($[14] !== options) {
|
|
1289
|
-
t9 = (value_0) => {
|
|
1290
|
-
setInternalColumnOrder(value_0);
|
|
1291
|
-
options?.onOrderChange?.(value_0);
|
|
1292
|
-
};
|
|
1293
|
-
$[14] = options;
|
|
1294
|
-
$[15] = t9;
|
|
1295
|
-
} else t9 = $[15];
|
|
1296
|
-
const handleOrderChange = t9;
|
|
1297
|
-
let t10;
|
|
1298
|
-
if ($[16] !== defaultColumns || $[17] !== internalColumnOrder) {
|
|
1299
|
-
t10 = sortByKeyOrder(defaultColumns, internalColumnOrder);
|
|
1300
|
-
$[16] = defaultColumns;
|
|
1301
|
-
$[17] = internalColumnOrder;
|
|
1302
|
-
$[18] = t10;
|
|
1303
|
-
} else t10 = $[18];
|
|
1304
|
-
const configColumns = t10;
|
|
1305
|
-
let t11;
|
|
1306
|
-
if ($[19] !== configColumns || $[20] !== internalVisibleColumns) {
|
|
1307
|
-
let t12;
|
|
1308
|
-
if ($[22] !== internalVisibleColumns) {
|
|
1309
|
-
t12 = (col_1) => internalVisibleColumns?.[col_1.id ?? col_1.accessorKey] ?? true;
|
|
1310
|
-
$[22] = internalVisibleColumns;
|
|
1311
|
-
$[23] = t12;
|
|
1312
|
-
} else t12 = $[23];
|
|
1313
|
-
t11 = configColumns.filter(t12);
|
|
1314
|
-
$[19] = configColumns;
|
|
1315
|
-
$[20] = internalVisibleColumns;
|
|
1316
|
-
$[21] = t11;
|
|
1317
|
-
} else t11 = $[21];
|
|
1318
|
-
const columns = t11;
|
|
1319
|
-
let t12;
|
|
1320
|
-
if ($[24] !== columns || $[25] !== configColumns || $[26] !== handleOrderChange || $[27] !== handleVisibilityChange || $[28] !== internalColumnOrder || $[29] !== internalVisibleColumns) {
|
|
1321
|
-
t12 = {
|
|
1322
|
-
configColumns,
|
|
1323
|
-
columns,
|
|
1324
|
-
visibleColumns: internalVisibleColumns,
|
|
1325
|
-
columnOrder: internalColumnOrder,
|
|
1326
|
-
onVisibilityChange: handleVisibilityChange,
|
|
1327
|
-
onOrderChange: handleOrderChange
|
|
1328
|
-
};
|
|
1329
|
-
$[24] = columns;
|
|
1330
|
-
$[25] = configColumns;
|
|
1331
|
-
$[26] = handleOrderChange;
|
|
1332
|
-
$[27] = handleVisibilityChange;
|
|
1333
|
-
$[28] = internalColumnOrder;
|
|
1334
|
-
$[29] = internalVisibleColumns;
|
|
1335
|
-
$[30] = t12;
|
|
1336
|
-
} else t12 = $[30];
|
|
1337
|
-
return t12;
|
|
1338
|
-
}
|
|
1339
|
-
function _temp2(col_0) {
|
|
1340
|
-
return col_0.id ?? col_0.accessorKey;
|
|
1341
|
-
}
|
|
1342
|
-
function _temp(acc, col) {
|
|
1343
|
-
const key = col.id ?? col.accessorKey;
|
|
1344
|
-
acc[key] = true;
|
|
1345
|
-
return acc;
|
|
1346
|
-
}
|
|
1347
|
-
//#endregion
|
|
1348
|
-
export { InfiniteTable as a, useTableNav as c, PaginatedTable as i, HeaderText as l, useSorting as n, ColumnConfigModal as o, usePagination as r, Table as s, useTableColumnConfig as t, CellText as u };
|