@povio/ui 5.0.0-rc.1 → 5.0.0-rc.3
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/.rulesync/rules/ui-buttons-and-content.md +56 -0
- package/.rulesync/rules/ui-inputs-and-forms.md +62 -0
- package/.rulesync/rules/ui-overlays-navigation-and-styling.md +49 -0
- package/.rulesync/rules/ui-overview.md +33 -0
- package/README.md +49 -16
- package/dist/{Accordion-CzFKi8Bp.js → Accordion-BzwO4_ml.js} +20 -136
- package/dist/{Alert-T25LY8ZL.js → Alert-CnvEb1D_.js} +16 -12
- package/dist/{Alert-f1dG-4Uy.d.ts → Alert-DfiJbKH0.d.ts} +2 -1
- package/dist/{AlertDialog-B6R2MbNg.d.ts → AlertDialog-OWTbR4km.d.ts} +3 -3
- package/dist/{Autocomplete-CQ63Cynd.d.ts → Autocomplete-BwNHp8fy.d.ts} +1 -1
- package/dist/{Badge-YKlKz-Jy.d.ts → Badge-CBNpj823.d.ts} +8 -5
- package/dist/BadgeButton-Ccgt3oGO.d.ts +15 -0
- package/dist/{BottomSheet-DvqBvth_.js → BottomSheet-BXLE3161.js} +7 -6
- package/dist/{BottomSheet-xaymO7aQ.d.ts → BottomSheet-DbQuzfAB.d.ts} +1 -1
- package/dist/{BottomSheet.lazy-CGBRPve_.d.ts → BottomSheet.lazy-D9LCEo7s.d.ts} +1 -1
- package/dist/{Breadcrumbs-DyriI-Bi.d.ts → Breadcrumbs-CUV6CU8Q.d.ts} +1 -1
- package/dist/{Breadcrumbs-DiIYJAWf.js → Breadcrumbs-CbKzAq1v.js} +24 -38
- package/dist/Button-C5rv4Cr2.js +506 -0
- package/dist/{Button-BZ3is6IU.d.ts → Button-D-4qb0IR.d.ts} +3 -3
- package/dist/{ButtonContent-B2_dZ6vA.js → ButtonContent-c7lJayVQ.js} +10 -8
- package/dist/{Calendar-DzQApBCy.js → Calendar-CVSQH-rC.js} +22 -15
- package/dist/{CheckContent-DZ7Gk8GS.js → CheckContent-D7sZPmzx.js} +2 -2
- package/dist/{Checkbox-BepzfVfK.js → Checkbox-BU0d702K.js} +6 -6
- package/dist/{Checkbox-CHpgW3fI.d.ts → Checkbox-DVTWaMKa.d.ts} +1 -1
- package/dist/{CheckboxCheckmark-B3lnOjsU.js → CheckboxCheckmark-usHsolNj.js} +10 -10
- package/dist/{CheckboxGroup-CXrR3A-c.d.ts → CheckboxGroup-DGF12cmB.d.ts} +3 -3
- package/dist/ComponentGallery-DIFeJqGx.js +2528 -0
- package/dist/{DatePicker-B3l9TEjW.d.ts → DatePicker-8xSs_jNd.d.ts} +3 -3
- package/dist/{DatePicker-CI87jC4_.js → DatePicker-D95gDPhg.js} +12 -11
- package/dist/{DatePickerInput-UBZcTmdv.js → DatePickerInput-CX6NYim4.js} +12 -23
- package/dist/{DatePickerInput-CZTEsrS0.d.ts → DatePickerInput-D81ZJ3fT.d.ts} +3 -3
- package/dist/{DateRangePicker-DKkc2B3n.d.ts → DateRangePicker-Bfq-yDm7.d.ts} +3 -3
- package/dist/{DateRangePicker-BX2O5zA8.js → DateRangePicker-_uTQk_ae.js} +16 -15
- package/dist/{DateTimePicker-CVfkp45w.js → DateTimePicker-BB058Z34.js} +11 -10
- package/dist/{DateTimePicker-IHr-wPq8.d.ts → DateTimePicker-D4lHyf6P.d.ts} +3 -3
- package/dist/{Dialog-DdRP4YFC.js → Dialog-9manOgMA.js} +4 -4
- package/dist/{Dialog-CXoVeIkU.js → Dialog-CKLkS00H.js} +10 -2
- package/dist/{Dialog-DEbI_9S-.d.ts → Dialog-CW93T9X1.d.ts} +3 -2
- package/dist/{DropdownMenu-zrodtd44.js → DropdownMenu-5jmtgLXd.js} +8 -6
- package/dist/{DropdownMenu-CWDhk3XA.d.ts → DropdownMenu-JNpYT4-3.d.ts} +3 -2
- package/dist/{DropdownMenuDesktop-CGYxsavQ.js → DropdownMenuDesktop-Cl9gZVq0.js} +9 -38
- package/dist/{FileInput-Dz1eESr_.js → FileInput-C0-6bw4w.js} +8 -8
- package/dist/{FileInput-BQbn77bE.d.ts → FileInput-C4CE5kuP.d.ts} +5 -4
- package/dist/{FileUpload-qySCMcLn.d.ts → FileUpload-CR7bZxV1.d.ts} +1 -1
- package/dist/{FileUpload-D3Io7Is5.js → FileUpload-DDpYMn8f.js} +51 -139
- package/dist/{FileUploadContainer-qOyGvb5J.d.ts → FileUploadContainer-042ztsaL.d.ts} +1 -1
- package/dist/{Form-u_N_6mwo.d.ts → Form-BJ12MjE-.d.ts} +1 -1
- package/dist/{FormField-B0miX3gu.d.ts → FormField-Byiehm9y.d.ts} +1 -1
- package/dist/{FormField-CHD4OJOt.js → FormField-U_-d4V_g.js} +9 -9
- package/dist/{FormFieldError-QRAFHUTt.js → FormFieldError-DeOHHLo2.js} +1 -1
- package/dist/FormFieldHeaderTooltip-DXbuu88v.js +17 -0
- package/dist/{IconButton-KXecZgYX.d.ts → IconButton-D4thBurp.d.ts} +2 -2
- package/dist/IconSlot-DSK7qNxc.js +79 -0
- package/dist/{InlineIconButton-CbKZ2U_a.d.ts → InlineIconButton-BeJCjl-q.d.ts} +2 -2
- package/dist/{InlineTooltipWrapper-g5yoeH1B.js → InlineTooltipWrapper-Bpmd--e7.js} +3 -3
- package/dist/{Input-efmPwk8f.d.ts → Input-DOanwj3l.d.ts} +3 -3
- package/dist/{InputContent-DuBa9FuI.d.ts → InputContent-CXuP1ghQ.d.ts} +3 -3
- package/dist/{InputItem-2zf6QI5L.js → InputItem-D-KuiNSc.js} +11 -11
- package/dist/{Inputs-C-w03Q_F.d.ts → Inputs-DA73LmLc.d.ts} +1 -1
- package/dist/{Inputs-BceDTmdT.js → Inputs-j3JmcLWR.js} +1 -1
- package/dist/{Link-QYpprkN1.d.ts → Link-Ow9H7kNv.d.ts} +3 -2
- package/dist/{ListBox-B7DW1S7n.js → ListBox-CL8Ar4Q_.js} +5 -4
- package/dist/{MenuItem--Mjd_yK8.d.ts → MenuItem-DHyqOqln.d.ts} +1 -1
- package/dist/{Modal-CoFt5PGP.js → Modal-w60dVQcb.js} +1 -1
- package/dist/{NumberField-z2JatYK0.d.ts → NumberField-Cb9Gf6QJ.d.ts} +3 -3
- package/dist/{NumberRangeInput-Chai3iEi.d.ts → NumberRangeInput-BfbJQqzn.d.ts} +2 -2
- package/dist/{NumberRangeInput-BxVrHq8R.js → NumberRangeInput-C-8U05wF.js} +6 -6
- package/dist/{Pagination-CXtIDclf.d.ts → Pagination-CwQu5Py8.d.ts} +1 -1
- package/dist/{PaginationList-CXG4jWFD.d.ts → PaginationList-DMRUGtf8.d.ts} +1 -1
- package/dist/{PaginationList-0bAmvXC0.js → PaginationList-DtvuP63b.js} +2 -2
- package/dist/{PasswordInput-ub2TQxef.d.ts → PasswordInput-CLwFUgl0.d.ts} +1 -1
- package/dist/{Popover-DUKH0q9u.d.ts → Popover-BTHPteIh.d.ts} +2 -2
- package/dist/{Progress-DQWiFP0L.js → Progress-B3mY9rIP.js} +2 -2
- package/dist/{Progress-Dho39FDs.d.ts → Progress-CjWOR38H.d.ts} +2 -1
- package/dist/{QuerySelect-Bo1K6gi_.d.ts → QuerySelect-BGxb6Y0K.d.ts} +2 -2
- package/dist/{RadioGroup-SSZYch-J.js → RadioGroup-B7_pNwn9.js} +13 -13
- package/dist/{RadioGroup-B_zJdn4y.d.ts → RadioGroup-CZg2kIMk.d.ts} +3 -3
- package/dist/{RichTextEditor-D6RewmRj.js → RichTextEditor-D9-B1Cze.js} +52 -133
- package/dist/{RichTextEditor-B_JX3nor.d.ts → RichTextEditor-YxuRUlI7.d.ts} +1 -1
- package/dist/{Select-CuZDkeQs.js → Select-CkujlTjm.js} +5 -4
- package/dist/{Select-DeapZMYx.d.ts → Select-pHbyJdZJ.d.ts} +1 -1
- package/dist/{SelectBase-7SE9Za2r.d.ts → SelectBase-Omiq2D3M.d.ts} +3 -3
- package/dist/{Slider-DJ9K_a-x.js → Slider-BHPl0OPy.js} +11 -11
- package/dist/{Slider-BFViQmM3.d.ts → Slider-EYlGCLWe.d.ts} +1 -1
- package/dist/{Spinner-BEYBu85B.js → Spinner-BeVTUzzx.js} +1 -1
- package/dist/{Spinner-BbcI6IOb.d.ts → Spinner-DbXeDOa2.d.ts} +2 -1
- package/dist/{SplitButton-lL87EcBL.d.ts → SplitButton-D9ngY1rJ.d.ts} +3 -3
- package/dist/{Stepper-C1YPgTBG.js → Stepper-Cp5vbL5g.js} +4 -117
- package/dist/{Stepper-hlhViuaK.d.ts → Stepper-TATlHZhQ.d.ts} +9 -8
- package/dist/{Switch-JxRmH1dX.js → Switch-CqnGEdeD.js} +11 -11
- package/dist/{Switch-DPftmB1b.d.ts → Switch-s_EPn0Jz.d.ts} +1 -1
- package/dist/Table-BDNSuEWc.js +689 -0
- package/dist/Tag-AHfV_XSf.d.ts +44 -0
- package/dist/{Tag-HiDH438e.js → Tag-DPg5sL1Z.js} +22 -21
- package/dist/{TextArea-gikUKKDl.js → TextArea-DqHDiRGJ.js} +6 -6
- package/dist/{TextArea-BhrCBGbq.d.ts → TextArea-l_keyLK7.d.ts} +2 -2
- package/dist/{TextButton-DnXRykhF.d.ts → TextButton-XUhV_1s0.d.ts} +4 -4
- package/dist/{TimePicker-CmT89X7v.d.ts → TimePicker-B1POvGWs.d.ts} +2 -2
- package/dist/{TimePicker-DtNTOOGr.js → TimePicker-DQ6JCkGB.js} +10 -10
- package/dist/Toast-DtG3pA61.js +53 -0
- package/dist/{Toast-B4cXs2rj.d.ts → Toast-ruXqONDA.d.ts} +1 -1
- package/dist/{ToastContainer-BbsMIwtC.js → ToastContainer-qgpzMFD4.js} +4 -3
- package/dist/{ToggleButton-BGuzPJDO.d.ts → ToggleButton-7aP8Jb11.d.ts} +2 -2
- package/dist/{ToggleGroup-D9CFdM5-.d.ts → ToggleGroup-CRFDIPGZ.d.ts} +1 -1
- package/dist/{ToggleGroup-Cl0NS3fe.js → ToggleGroup-DX0VYXwP.js} +25 -58
- package/dist/{Tooltip-aE1Vswxz.js → Tooltip-B9DKcYvr.js} +6 -47
- package/dist/{Tooltip-D7dNwGy9.d.ts → Tooltip-DHv6vAqW.d.ts} +6 -5
- package/dist/{TooltipWrapper-CRf-JFeo.js → TooltipWrapper-DznDgVJB.js} +4 -4
- package/dist/{Typography-B0Gp1lpc.js → Typography-LU4z2pR1.js} +2 -2
- package/dist/{Typography-BiuidzDC.d.ts → Typography-XljT9s02.d.ts} +1 -1
- package/dist/accordion.cva-CL1bVscW.js +129 -0
- package/dist/{autocomplete-BJ7rqWa4.d.ts → autocomplete-DeERHN8W.d.ts} +2 -2
- package/dist/badgeButton.cva-B2bgCQP6.d.ts +41 -0
- package/dist/badgeButton.cva-CvN4CTx5.js +300 -0
- package/dist/breadcrumbs.cva-7zzdDhVR.js +27 -0
- package/dist/{button.cva-BvRI-3Gn.d.ts → button.cva-C7kEhgoA.d.ts} +7 -6
- package/dist/{buttonContent.cva-BDT_CReI.d.ts → buttonContent.cva-DPIlROA9.d.ts} +2 -2
- package/dist/{checkbox-BfcE8J5P.d.ts → checkbox-DxIPDTK5.d.ts} +1 -1
- package/dist/{checkbox-group-CHs2wFHS.d.ts → checkbox-group-B3BOVshI.d.ts} +1 -1
- package/dist/{checkbox.cva-gv87kr1W.d.ts → checkbox.cva-t1Ox50hy.d.ts} +4 -3
- package/dist/components/accordion.js +1 -1
- package/dist/components/alert-dialog.d.ts +1 -1
- package/dist/components/alert-dialog.js +4 -4
- package/dist/components/alert.d.ts +1 -1
- package/dist/components/alert.js +1 -1
- package/dist/components/autocomplete.d.ts +1 -1
- package/dist/components/autocomplete.js +5 -4
- package/dist/components/badge-button.d.ts +2 -0
- package/dist/components/{pill-button.js → badge-button.js} +13 -12
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/badge.js +56 -37
- 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 +1 -1
- package/dist/components/checkbox-group.js +6 -6
- 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 +3 -3
- 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/icon-button.d.ts +1 -1
- package/dist/components/icon-button.js +2 -2
- package/dist/components/icon-slot.d.ts +2 -0
- package/dist/components/icon-slot.js +2 -0
- package/dist/components/inline-icon-button.d.ts +1 -1
- package/dist/components/inline-icon-button.js +1 -1
- package/dist/components/input.d.ts +1 -1
- package/dist/components/input.js +7 -7
- package/dist/components/link.d.ts +1 -1
- package/dist/components/link.js +32 -1
- package/dist/components/number-field.d.ts +1 -1
- package/dist/components/number-field.js +7 -7
- package/dist/components/number-range-input.d.ts +1 -1
- package/dist/components/number-range-input.js +1 -1
- 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 +2 -2
- package/dist/components/password-input.d.ts +1 -1
- package/dist/components/popover.d.ts +1 -1
- package/dist/components/popover.js +6 -5
- package/dist/components/progress.d.ts +1 -1
- package/dist/components/progress.js +1 -1
- package/dist/components/query-autocomplete.d.ts +2 -2
- package/dist/components/query-autocomplete.js +2 -2
- package/dist/components/query-select.d.ts +1 -1
- package/dist/components/query-select.js +3 -3
- package/dist/components/radio-group.d.ts +1 -1
- 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/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/switch.d.ts +1 -1
- package/dist/components/switch.js +1 -1
- package/dist/components/tag.d.ts +1 -1
- package/dist/components/tag.js +1 -1
- package/dist/components/text-area.d.ts +1 -1
- package/dist/components/text-area.js +1 -1
- package/dist/components/text-button.d.ts +1 -1
- package/dist/components/text-button.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 +2 -2
- package/dist/components/toggle-group.js +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/typography.js +1 -1
- package/dist/components/use-toast.d.ts +1 -1
- package/dist/components/use-toast.js +2 -2
- package/dist/config/confirmation.d.ts +1 -1
- package/dist/config/link-context.d.ts +2 -2
- package/dist/config/ui-config.d.ts +2 -2
- package/dist/config/ui-config.js +1 -1
- package/dist/config/ui-configurator-theme.d.ts +2 -0
- package/dist/config/ui-configurator-theme.js +2 -0
- package/dist/config/ui-configurator-vite.d.ts +10 -0
- package/dist/config/ui-configurator-vite.js +174 -0
- package/dist/config/ui-configurator.d.ts +934 -0
- package/dist/config/ui-configurator.js +3731 -0
- package/dist/config/ui-overrides.d.ts +1 -1
- package/dist/config/ui-overrides.js +1 -1
- package/dist/{confirmation.context-DPAKsLYl.d.ts → confirmation.context-BOeEVczb.d.ts} +1 -1
- package/dist/{date-picker-BYFWSbN8.d.ts → date-picker-DnxDmlOW.d.ts} +1 -1
- package/dist/{date-range-picker-BaaXOObm.d.ts → date-range-picker-DHDOSvHN.d.ts} +1 -1
- package/dist/{date-time-picker-D42cTCgx.d.ts → date-time-picker-UkTa0OJ8.d.ts} +1 -1
- package/dist/datePickerInput.cva-Cd7UUN61.js +14 -0
- package/dist/{datePickerValue.utils-CFCY-fRJ.js → datePickerValue.utils-CUzkWie8.js} +5 -5
- package/dist/{dialog.cva---xiOXMQ.js → dialog.cva-COhDZaVl.js} +4 -4
- package/dist/{dist-B8h0VT0E.js → dist-CAdwxJbe.js} +1 -208
- package/dist/{dom.utils-DjuRTR6U.js → dom.utils-D1AopHx9.js} +1 -1
- package/dist/dropdownMenu.cva-DvEmX0bs.js +34 -0
- package/dist/{dynamicInputs-wEEikYeg.d.ts → dynamicInputs-iP39lVKf.d.ts} +102 -100
- package/dist/{fieldAdapter-C0lCFmf0.js → fieldAdapter-DjYls12j.js} +1 -1
- package/dist/{file-input-C56GXRwz.d.ts → file-input-DkbkdI7l.d.ts} +1 -1
- package/dist/{file-upload-Bx0X534g.d.ts → file-upload-CTsPhxJk.d.ts} +2 -2
- package/dist/fileUpload.cva-ujmStxB1.js +42 -0
- package/dist/{fileUpload.types-DWuQKA2l.d.ts → fileUpload.types-n5FxK_F-.d.ts} +2 -2
- package/dist/iconSlot.cva-CnpFzAOR.d.ts +21 -0
- package/dist/icons.d.ts +2 -1
- package/dist/icons.js +2 -1
- package/dist/index.d.ts +87 -86
- package/dist/index.js +55 -44
- package/dist/info-iUmX3uDk.js +32 -0
- package/dist/{input-D2kGX0hW.d.ts → input-CdQNCPgH.d.ts} +1 -1
- package/dist/{input.cva-BhDJxc7r.d.ts → input.cva-BsHgYa-L.d.ts} +3 -2
- package/dist/{input.cva-BcXyC1vZ.js → input.cva-DJA8ovm_.js} +9 -9
- package/dist/{link.context-CDZn6oL2.d.ts → link.context-D5qyz9Rf.d.ts} +1 -1
- package/dist/link.cva-DMTHZiJG.js +12 -0
- package/dist/{number-field-Bw2GKr0s.d.ts → number-field-CUDbenNV.d.ts} +1 -1
- package/dist/{number-range-input-Dqe6x2dR.d.ts → number-range-input-DZGrcvjL.d.ts} +1 -1
- package/dist/{password-input-DepKyhh3.d.ts → password-input-fYN20cQO.d.ts} +1 -1
- package/dist/{popover.cva-BJSkLndY.js → popover.cva-Bhud1wnp.js} +1 -1
- package/dist/popoverAnimation-DEZSvKP8.js +4 -0
- package/dist/{query-autocomplete-BSpHin_R.d.ts → query-autocomplete-CfuQeiYG.d.ts} +2 -2
- package/dist/{query-select-m1DCp4UF.d.ts → query-select-CuT_sE6a.d.ts} +2 -2
- package/dist/{queryAutocomplete.types-CrbVUmvl.d.ts → queryAutocomplete.types-tl3r6iaY.d.ts} +2 -2
- package/dist/{radio-group-Civ3Fb70.d.ts → radio-group-B3ccPf0p.d.ts} +1 -1
- package/dist/{radio.cva-BlOrmxzf.d.ts → radio.cva-DN9VQ3Kb.d.ts} +4 -3
- package/dist/rhf/autocomplete.d.ts +2 -2
- package/dist/rhf/autocomplete.js +1 -1
- package/dist/rhf/checkbox-group.d.ts +2 -2
- package/dist/rhf/checkbox-group.js +1 -1
- package/dist/rhf/checkbox.d.ts +2 -2
- package/dist/rhf/checkbox.js +2 -2
- package/dist/rhf/date-picker.d.ts +2 -2
- package/dist/rhf/date-picker.js +2 -2
- package/dist/rhf/date-range-picker.d.ts +2 -2
- package/dist/rhf/date-range-picker.js +2 -2
- package/dist/rhf/date-time-picker.d.ts +2 -2
- package/dist/rhf/date-time-picker.js +2 -2
- package/dist/rhf/file-input.d.ts +2 -2
- package/dist/rhf/file-input.js +2 -2
- package/dist/rhf/file-upload.d.ts +2 -2
- package/dist/rhf/file-upload.js +2 -2
- package/dist/rhf/input.d.ts +2 -2
- package/dist/rhf/input.js +1 -1
- package/dist/rhf/inputs.d.ts +2 -2
- package/dist/rhf/number-field.d.ts +2 -2
- package/dist/rhf/number-field.js +1 -1
- package/dist/rhf/number-range-input.d.ts +2 -2
- package/dist/rhf/number-range-input.js +2 -2
- package/dist/rhf/password-input.d.ts +2 -2
- package/dist/rhf/password-input.js +1 -1
- package/dist/rhf/query-autocomplete.d.ts +1 -1
- package/dist/rhf/query-autocomplete.js +1 -1
- package/dist/rhf/query-select.d.ts +1 -1
- package/dist/rhf/query-select.js +1 -1
- package/dist/rhf/radio-group.d.ts +2 -2
- package/dist/rhf/radio-group.js +2 -2
- package/dist/rhf/rich-text-editor.d.ts +2 -2
- package/dist/rhf/rich-text-editor.js +2 -2
- package/dist/rhf/select.d.ts +2 -2
- package/dist/rhf/select.js +2 -2
- package/dist/rhf/slider.d.ts +2 -2
- package/dist/rhf/slider.js +2 -2
- package/dist/rhf/switch.d.ts +2 -2
- package/dist/rhf/switch.js +2 -2
- package/dist/rhf/text-area.d.ts +2 -2
- package/dist/rhf/text-area.js +2 -2
- package/dist/rhf/time-picker.d.ts +2 -2
- package/dist/rhf/time-picker.js +2 -2
- package/dist/rhf/toggle-group.d.ts +2 -2
- package/dist/rhf/toggle-group.js +2 -2
- package/dist/{rhf-D8B7mLO1.js → rhf-t348TCCL.js} +1 -1
- package/dist/rhf.d.ts +87 -86
- package/dist/rhf.js +55 -44
- package/dist/{rich-text-editor-DvNEOIux.d.ts → rich-text-editor-B-Onl7T8.d.ts} +1 -1
- package/dist/rich-text-editor.d.ts +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/{select-DY5QtwqI.d.ts → select-B4a52eWW.d.ts} +2 -2
- package/dist/selectDesktop.cva-CHAMxhfO.js +69 -0
- package/dist/{slider-CrB-Gkcv.d.ts → slider-dNj9jruO.d.ts} +1 -1
- package/dist/{staticDateTimeSegments-DR8bJw-F.js → staticDateTimeSegments-CsCE9Buo.js} +26 -27
- package/dist/{staticSelect.utils-Cm7MoDVG.js → staticSelect.utils-BemUyaaA.js} +31 -90
- package/dist/stepper.cva-CZ0Kj-s7.js +116 -0
- package/dist/style-merge.util-zLimKwt6.d.ts +40 -0
- package/dist/styles/color-utilities.css +13 -25
- package/dist/styles/configurator.css +1852 -0
- package/dist/styles/input.d.ts +1 -1
- package/dist/{switch-8WzXfTS8.d.ts → switch-C--iWnY8.d.ts} +1 -1
- package/dist/switch.cva-CWNzmdRc.d.ts +16 -0
- package/dist/table.cva-BikE8qJH.js +49 -0
- package/dist/tanstack/autocomplete.d.ts +1 -1
- package/dist/tanstack/checkbox-group.d.ts +1 -1
- package/dist/tanstack/checkbox.d.ts +1 -1
- package/dist/tanstack/checkbox.js +1 -1
- package/dist/tanstack/date-picker.d.ts +1 -1
- package/dist/tanstack/date-picker.js +1 -1
- package/dist/tanstack/date-range-picker.d.ts +1 -1
- package/dist/tanstack/date-range-picker.js +1 -1
- package/dist/tanstack/date-time-picker.d.ts +1 -1
- package/dist/tanstack/date-time-picker.js +1 -1
- package/dist/tanstack/file-input.d.ts +1 -1
- package/dist/tanstack/file-input.js +1 -1
- package/dist/tanstack/file-upload.d.ts +2 -2
- package/dist/tanstack/file-upload.js +1 -1
- package/dist/tanstack/form.d.ts +1 -1
- package/dist/tanstack/form.js +1 -1
- package/dist/tanstack/input.d.ts +1 -1
- package/dist/tanstack/inputs.d.ts +3 -3
- package/dist/tanstack/inputs.js +1 -1
- package/dist/tanstack/number-field.d.ts +1 -1
- package/dist/tanstack/number-range-input.d.ts +1 -1
- package/dist/tanstack/number-range-input.js +1 -1
- package/dist/tanstack/password-input.d.ts +1 -1
- package/dist/tanstack/query-select.d.ts +1 -1
- package/dist/tanstack/radio-group.d.ts +1 -1
- 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 +1 -1
- package/dist/tanstack/select.d.ts +1 -1
- package/dist/tanstack/select.js +1 -1
- package/dist/tanstack/slider.d.ts +1 -1
- package/dist/tanstack/slider.js +1 -1
- package/dist/tanstack/switch.d.ts +1 -1
- package/dist/tanstack/switch.js +1 -1
- package/dist/tanstack/table.d.ts +1 -1
- package/dist/tanstack/table.js +2 -1
- package/dist/tanstack/text-area.d.ts +1 -1
- package/dist/tanstack/text-area.js +1 -1
- package/dist/tanstack/time-picker.d.ts +1 -1
- 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.d.ts +71 -70
- package/dist/tanstack.js +66 -53
- package/dist/{text-area-CqnKRWKq.d.ts → text-area-DQAtpOQp.d.ts} +1 -1
- package/dist/theme-model-C-QMCksE.js +136 -0
- package/dist/theme-model-T1zIdBg8.d.ts +12 -0
- package/dist/{time-picker-Cz1GIzpF.d.ts → time-picker-DoGfbil6.d.ts} +1 -1
- package/dist/{toast.cva-Cj6o2Rmu.d.ts → toast.cva-By5lvAfr.d.ts} +3 -2
- package/dist/toast.cva-C_L_RffH.js +163 -0
- package/dist/{toast.runtime-CIKvmkjo.js → toast.runtime-cxex9e4E.js} +2 -1
- package/dist/{toggle-group-CPkKHm1t.d.ts → toggle-group-C1nMDOwz.d.ts} +1 -1
- package/dist/toggleGroup.cva-MbpaEBg1.js +35 -0
- package/dist/{toggleGroup.types-DD6uRI5G.d.ts → toggleGroup.types-Bp43zbSQ.d.ts} +2 -1
- package/dist/tooltip.cva-BIzlOXHH.js +48 -0
- package/dist/{tooltipWrapper.cva-CUu8pI-a.js → tooltipWrapper.cva-BBQ4ic3D.js} +1 -1
- package/dist/{typography.cva-jtp6WWUH.d.ts → typography.cva-D1JOEYl-.d.ts} +2 -1
- package/dist/{typography.cva-CJZZSGXW.js → typography.cva-iD15k56p.js} +1 -1
- package/dist/{uiConfig.context-D2eUIPHn.js → uiConfig.context-BS3r_kTS.js} +1 -1
- package/dist/{uiConfig.context-aoarCLYX.d.ts → uiConfig.context-DeBX2beU.d.ts} +8 -8
- package/dist/{uiOverrides.context-Bfm2n-n8.js → uiOverrides.context-BTCH9y5a.js} +2 -2
- package/dist/{uiOverrides.context-C3xb4Ttq.d.ts → uiOverrides.context-DEp139He.d.ts} +11 -44
- package/dist/underline-66hmELxa.js +81 -0
- package/dist/{useBreakpoint-BOA-MyoT.js → useBreakpoint-DQoMN-BG.js} +1 -1
- package/dist/{useFieldAccessibility-D2_Qm26-.js → useFieldAccessibility-B4MVL6fz.js} +15 -8
- package/dist/{useFormAutosave-BYFn3LH8.js → useFormAutosave-Mg-tdwMh.js} +2 -2
- package/dist/{useStaticInputHandoff-DB9PgioW.js → useStaticInputHandoff-CvSBPUB3.js} +13 -10
- package/dist/useTableColumnConfig-gfVame8v.js +892 -0
- package/dist/{useTableNav-D9mICzNW.d.ts → useTableNav-Ckj5PBRk.d.ts} +3 -2
- package/dist/{useToast-DMSm59Y6.d.ts → useToast-yreVCUer.d.ts} +1 -1
- package/package.json +38 -6
- package/rulesync.jsonc +11 -0
- package/scripts/generate-rules.mjs +34 -0
- package/src/configurator/README.md +71 -0
- package/dist/Button-sn52l1Yv.js +0 -506
- package/dist/FormFieldHeaderTooltip-Dl24v4_j.js +0 -45
- package/dist/Link-Btxj2gzg.js +0 -42
- package/dist/PillButton-DASBXLFB.d.ts +0 -15
- package/dist/Tag-Cch_68QO.d.ts +0 -43
- package/dist/components/pill-button.d.ts +0 -2
- package/dist/pillButton.cva-BEWuu0qm.d.ts +0 -34
- package/dist/pillButton.cva-DlP5tOT5.js +0 -197
- package/dist/switch.cva-8T0fw31t.d.ts +0 -15
- package/dist/useTableColumnConfig-CcJxu14U.js +0 -1625
|
@@ -0,0 +1,689 @@
|
|
|
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-BS3r_kTS.js";
|
|
4
|
+
import { t as ChevronDown } from "./chevron-down-B4Pr8bD3.js";
|
|
5
|
+
import { t as ChevronUp } from "./chevron-up-D_Gqpb5M.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 Typography } from "./Typography-LU4z2pR1.js";
|
|
10
|
+
import { InlineIconButton } from "./components/inline-icon-button.js";
|
|
11
|
+
import { t as useIntersectionObserver } from "./useIntersectionObserver-DYfHnGGU.js";
|
|
12
|
+
import { a as tableHeaderTextDefinition, i as tableHeadRowDefinition, n as tableDataDefinition, o as tableRowDefinition, r as tableHeadDataDefinition, s as theadDefinition, t as tableCellTextDefinition } from "./table.cva-BikE8qJH.js";
|
|
13
|
+
import { Suspense, lazy, useCallback, useMemo, useRef, useState } from "react";
|
|
14
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
import { createPaginatedRowModel, createSortedRowModel, flexRender, stockFeatures, tableFeatures, useTable } from "@tanstack/react-table";
|
|
16
|
+
import i18next from "i18next";
|
|
17
|
+
//#region ../../node_modules/.bun/lucide-react@1.43.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/grip-vertical.mjs
|
|
18
|
+
/**
|
|
19
|
+
* @license lucide-react v1.43.0 - ISC
|
|
20
|
+
*
|
|
21
|
+
* This source code is licensed under the ISC license.
|
|
22
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
23
|
+
*/
|
|
24
|
+
const __iconData = {
|
|
25
|
+
name: "grip-vertical",
|
|
26
|
+
size: 24,
|
|
27
|
+
node: [
|
|
28
|
+
["circle", {
|
|
29
|
+
cx: "9",
|
|
30
|
+
cy: "12",
|
|
31
|
+
r: "1",
|
|
32
|
+
key: "1vctgf"
|
|
33
|
+
}],
|
|
34
|
+
["circle", {
|
|
35
|
+
cx: "9",
|
|
36
|
+
cy: "5",
|
|
37
|
+
r: "1",
|
|
38
|
+
key: "hp0tcf"
|
|
39
|
+
}],
|
|
40
|
+
["circle", {
|
|
41
|
+
cx: "9",
|
|
42
|
+
cy: "19",
|
|
43
|
+
r: "1",
|
|
44
|
+
key: "fkjjf6"
|
|
45
|
+
}],
|
|
46
|
+
["circle", {
|
|
47
|
+
cx: "15",
|
|
48
|
+
cy: "12",
|
|
49
|
+
r: "1",
|
|
50
|
+
key: "1tmaij"
|
|
51
|
+
}],
|
|
52
|
+
["circle", {
|
|
53
|
+
cx: "15",
|
|
54
|
+
cy: "5",
|
|
55
|
+
r: "1",
|
|
56
|
+
key: "19l28e"
|
|
57
|
+
}],
|
|
58
|
+
["circle", {
|
|
59
|
+
cx: "15",
|
|
60
|
+
cy: "19",
|
|
61
|
+
r: "1",
|
|
62
|
+
key: "f4zoj3"
|
|
63
|
+
}]
|
|
64
|
+
]
|
|
65
|
+
};
|
|
66
|
+
__iconData.node;
|
|
67
|
+
const GripVertical = createLucideIcon(__iconData);
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/components/table/CellText.tsx
|
|
70
|
+
const CellText = (props) => {
|
|
71
|
+
const uiConfig = UIConfig.useConfig();
|
|
72
|
+
const { size = uiConfig.tableCellText.size, children, style, className } = props;
|
|
73
|
+
const cellTextCva = UIOverrides.useCva("table.cellTextCva", tableCellTextDefinition);
|
|
74
|
+
return /* @__PURE__ */ jsx(Typography, {
|
|
75
|
+
className: cellTextCva({ className }),
|
|
76
|
+
as: "span",
|
|
77
|
+
size,
|
|
78
|
+
style,
|
|
79
|
+
"data-rac": true,
|
|
80
|
+
children
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region src/components/table/HeaderText.tsx
|
|
85
|
+
const HeaderText = (props) => {
|
|
86
|
+
const uiConfig = UIConfig.useConfig();
|
|
87
|
+
const { size = uiConfig.tableHeaderText.size, children, style, className } = props;
|
|
88
|
+
const headerTextCva = UIOverrides.useCva("table.headerTextCva", tableHeaderTextDefinition);
|
|
89
|
+
return /* @__PURE__ */ jsx(Typography, {
|
|
90
|
+
className: headerTextCva({ className }),
|
|
91
|
+
as: "span",
|
|
92
|
+
size,
|
|
93
|
+
style,
|
|
94
|
+
children
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region src/hooks/useTableNav.ts
|
|
99
|
+
const Selectors = {
|
|
100
|
+
Cell: "[role=\"cell\"],[role=\"gridcell\"],[role=\"columnheader\"],[role=\"rowheader\"],td,th",
|
|
101
|
+
Row: "[role=\"row\"],tr",
|
|
102
|
+
RowGroup: "[role=\"rowgroup\"],thead,tbody,tfoot",
|
|
103
|
+
/** Selector from here: https://github.com/Shopify/polaris/blob/main/polaris-react/src/utilities/focus.ts#L10 */
|
|
104
|
+
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]"
|
|
105
|
+
};
|
|
106
|
+
var DataGridNav = class {
|
|
107
|
+
constructor(config = {}) {
|
|
108
|
+
this.keys = [];
|
|
109
|
+
this.activeCell = null;
|
|
110
|
+
this.debugLog = (functionName, message) => {
|
|
111
|
+
if (this.debug) logger.info(`[${functionName}]: ${message}`);
|
|
112
|
+
};
|
|
113
|
+
const { selectors = {}, pageUpDown, debug = false } = config;
|
|
114
|
+
this.selectors = {
|
|
115
|
+
...Selectors,
|
|
116
|
+
...selectors
|
|
117
|
+
};
|
|
118
|
+
this.pageUpDown = pageUpDown;
|
|
119
|
+
this.keys = [];
|
|
120
|
+
this.debug = debug;
|
|
121
|
+
this.disabled = false;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Disables the keyboard listener in cases
|
|
125
|
+
* that elements inside the grid need to use
|
|
126
|
+
* arrows keys etc., like select dropdowns
|
|
127
|
+
*/
|
|
128
|
+
disable() {
|
|
129
|
+
this.disabled = true;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Enables the keyboard listeners
|
|
133
|
+
*/
|
|
134
|
+
enable() {
|
|
135
|
+
this.disabled = false;
|
|
136
|
+
}
|
|
137
|
+
isFocusable(el) {
|
|
138
|
+
return el instanceof HTMLElement || el instanceof SVGElement;
|
|
139
|
+
}
|
|
140
|
+
getActiveCell() {
|
|
141
|
+
return this.activeCell;
|
|
142
|
+
}
|
|
143
|
+
/** Used as a keyboard listener for key up */
|
|
144
|
+
tableKeyUp() {
|
|
145
|
+
this.keys = [];
|
|
146
|
+
}
|
|
147
|
+
/** Used as a keyboard listener for key down */
|
|
148
|
+
tableKeyDown(e) {
|
|
149
|
+
if (this.disabled) return;
|
|
150
|
+
/**
|
|
151
|
+
* Avoid page scrolling etc.
|
|
152
|
+
* Enable default behavior for:
|
|
153
|
+
* Tab, Shift + Tab
|
|
154
|
+
* TODO: Actually it will be better to just prevent
|
|
155
|
+
* in ArrowKeys and PageKeys maybe?
|
|
156
|
+
* Or should the consumer stop propagation?!
|
|
157
|
+
* Cannot work with preventDefault as it will
|
|
158
|
+
* first capture the event from an input in cell for example
|
|
159
|
+
*/
|
|
160
|
+
if ("ArrowDown" === e.key || "ArrowUp" === e.key || "ArrowLeft" === e.key || "ArrowRight" === e.key) e.preventDefault();
|
|
161
|
+
/**
|
|
162
|
+
* Add key to the stack if it's
|
|
163
|
+
* not the same with the last (long press)
|
|
164
|
+
*/
|
|
165
|
+
if (this.keys.length === 0 || this.keys[this.keys.length - 1] !== e.key) this.keys.push(e.key);
|
|
166
|
+
/**
|
|
167
|
+
* Need to check if we are inside a grid cell
|
|
168
|
+
* or not to enable/disable Grid Navigation
|
|
169
|
+
*/
|
|
170
|
+
if (!(e.target instanceof Element)) return;
|
|
171
|
+
const cell = e.target.parentElement?.closest(`${this.selectors.Cell},${this.selectors.Row}`);
|
|
172
|
+
if (!cell) return;
|
|
173
|
+
if (cell.matches(this.selectors.Cell)) this.cellNavigation(e);
|
|
174
|
+
else this.gridNavigation(e);
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Handles the navigation inside a cell
|
|
178
|
+
*/
|
|
179
|
+
cellNavigation(e) {
|
|
180
|
+
if (!(e.target instanceof Element)) return;
|
|
181
|
+
/**
|
|
182
|
+
* Keys: Escape
|
|
183
|
+
* Restore grid navigation
|
|
184
|
+
*/
|
|
185
|
+
if (e.key === "Escape") {
|
|
186
|
+
const cell = e.target.closest(this.selectors.Cell);
|
|
187
|
+
if (cell && this.isFocusable(cell)) {
|
|
188
|
+
cell.focus();
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Keys: ArrowRight, ArrowDown
|
|
194
|
+
* Move to the next focusable cell, or the first one
|
|
195
|
+
*
|
|
196
|
+
* Arrow Down disabled:
|
|
197
|
+
* https://github.com/w3c/aria-practices/issues/2739#issuecomment-1613538972
|
|
198
|
+
*/
|
|
199
|
+
if (e.key === "ArrowRight" || e.key === "ArrowDown") {
|
|
200
|
+
const cell = e.target.closest(this.selectors.Cell);
|
|
201
|
+
if (!cell) return;
|
|
202
|
+
const focusableWidgets = [...cell.querySelectorAll(this.selectors.Focusable)];
|
|
203
|
+
const widgetIdx = focusableWidgets.findIndex((el) => el === e.target);
|
|
204
|
+
const widgetToFocus = focusableWidgets[widgetIdx === focusableWidgets.length - 1 ? 0 : widgetIdx + 1];
|
|
205
|
+
if (this.isFocusable(widgetToFocus)) widgetToFocus.focus();
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Keys: ArrowLeft, ArrowUp
|
|
210
|
+
* Move to the previous focusable cell, or the last one
|
|
211
|
+
*
|
|
212
|
+
* Arrow Up disabled:
|
|
213
|
+
* https://github.com/w3c/aria-practices/issues/2739#issuecomment-1613538972
|
|
214
|
+
*/
|
|
215
|
+
if (e.key === "ArrowLeft" || e.key === "ArrowUp") {
|
|
216
|
+
const cell = e.target.closest(this.selectors.Cell);
|
|
217
|
+
if (!cell) return;
|
|
218
|
+
const focusableWidgets = [...cell.querySelectorAll(this.selectors.Focusable)];
|
|
219
|
+
const widgetIdx = focusableWidgets.findIndex((el) => el === e.target);
|
|
220
|
+
const widgetToFocus = focusableWidgets[widgetIdx === 0 ? focusableWidgets.length - 1 : widgetIdx - 1];
|
|
221
|
+
if (this.isFocusable(widgetToFocus)) widgetToFocus.focus();
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Handles the navigation outside a cell
|
|
226
|
+
* on the grid level
|
|
227
|
+
*/
|
|
228
|
+
gridNavigation(e) {
|
|
229
|
+
const { target } = e;
|
|
230
|
+
if (!(e.target instanceof Element)) return;
|
|
231
|
+
if (!(target instanceof Element)) return;
|
|
232
|
+
if (this.keys.length === 1) {
|
|
233
|
+
/**
|
|
234
|
+
* Keys: Enter
|
|
235
|
+
* Should move focus inside the cell to the first focusable element:
|
|
236
|
+
* https://www.w3.org/WAI/ARIA/apg/patterns/grid/#gridNav_inside
|
|
237
|
+
*/
|
|
238
|
+
if (/^[a-zA-Z0-9]$/.test(e.key)) {
|
|
239
|
+
const cell = e.target.querySelector(this.selectors.Focusable);
|
|
240
|
+
if (cell && this.isFocusable(cell) && cell instanceof HTMLInputElement) {
|
|
241
|
+
cell.focus();
|
|
242
|
+
cell.value = `${cell.value}${e.key}`;
|
|
243
|
+
e.preventDefault();
|
|
244
|
+
}
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
if (e.key === "Backspace") {
|
|
248
|
+
const cell = e.target.querySelector(this.selectors.Focusable);
|
|
249
|
+
if (cell && this.isFocusable(cell) && cell instanceof HTMLInputElement) {
|
|
250
|
+
const nativeInputValueSetter = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set;
|
|
251
|
+
if (nativeInputValueSetter) {
|
|
252
|
+
nativeInputValueSetter.call(cell, "");
|
|
253
|
+
const ev = new Event("input", { bubbles: true });
|
|
254
|
+
cell.dispatchEvent(ev);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
if (e.key === "Enter") {
|
|
260
|
+
const cell = e.target.querySelector(this.selectors.Focusable);
|
|
261
|
+
if (cell && this.isFocusable(cell)) {
|
|
262
|
+
if (cell.getAttribute("data-type") === "select-trigger") {
|
|
263
|
+
cell.click();
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
cell.focus();
|
|
267
|
+
e.preventDefault();
|
|
268
|
+
}
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Keys: ArrowLeft, ArrowRight
|
|
273
|
+
* Should move focus to the next/previous cell
|
|
274
|
+
*/
|
|
275
|
+
if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
|
276
|
+
const direction = e.key === "ArrowLeft" ? "prev" : "next";
|
|
277
|
+
const cell = e.target.closest(this.selectors.Cell);
|
|
278
|
+
let nextCell = null;
|
|
279
|
+
if (direction === "next" && cell?.nextElementSibling instanceof HTMLElement) nextCell = cell.nextElementSibling;
|
|
280
|
+
if (direction === "prev" && cell?.previousElementSibling instanceof HTMLElement) nextCell = cell.previousElementSibling;
|
|
281
|
+
if (nextCell && this.isFocusable(nextCell)) {
|
|
282
|
+
nextCell.focus();
|
|
283
|
+
e.preventDefault();
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Keys: Up,Down
|
|
288
|
+
* Should move focus to the same column of the next/previous row
|
|
289
|
+
*/
|
|
290
|
+
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
291
|
+
this.verticalCellNavigation(e);
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Keys: PageUp, PageDown
|
|
296
|
+
* Should move focus to the first/last row
|
|
297
|
+
* or a predefined number of rows if user provides a value
|
|
298
|
+
*/
|
|
299
|
+
if (e.key === "PageUp" || e.key === "PageDown") {
|
|
300
|
+
this.pageCellNavigation(e);
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Keys: Home, End
|
|
305
|
+
* Should move focus to the first/last cell of the current row
|
|
306
|
+
*/
|
|
307
|
+
if (e.key === "Home" || e.key === "End") {
|
|
308
|
+
const rowChildren = [...e.target.closest(this.selectors.Row)?.children || []];
|
|
309
|
+
if (e.key === "End") rowChildren.reverse();
|
|
310
|
+
this.focusOnFirstCell(rowChildren);
|
|
311
|
+
}
|
|
312
|
+
} else {
|
|
313
|
+
/**
|
|
314
|
+
* Keys: Control + Home, Control + End
|
|
315
|
+
* Should move focus to the first/last cell of the first/last row
|
|
316
|
+
*/
|
|
317
|
+
const [firstKey, secondKey] = this.keys;
|
|
318
|
+
if (firstKey === "Control" && (secondKey === "Home" || secondKey === "End")) {
|
|
319
|
+
const siblings = e.target.closest(this.selectors.Row).parentElement?.children;
|
|
320
|
+
if (!siblings) return;
|
|
321
|
+
const rowChildren = [...(secondKey === "Home" ? siblings[0] : siblings[siblings.length - 1])?.children || []];
|
|
322
|
+
if (secondKey === "End") rowChildren.reverse();
|
|
323
|
+
this.focusOnFirstCell(rowChildren);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
pageCellNavigation(e) {
|
|
328
|
+
if (!(e.target instanceof Element)) return;
|
|
329
|
+
const row = e.target.closest(this.selectors.Row);
|
|
330
|
+
const cell = e.target.closest(this.selectors.Cell);
|
|
331
|
+
if (row && cell) {
|
|
332
|
+
const position = this.getColumnIndex(cell);
|
|
333
|
+
if (position === void 0) return;
|
|
334
|
+
const direction = e.key === "PageUp" ? "prev" : "next";
|
|
335
|
+
const siblings = row.parentElement?.children;
|
|
336
|
+
if (!siblings) return;
|
|
337
|
+
let destinationRow;
|
|
338
|
+
if (this.pageUpDown) {
|
|
339
|
+
const methodClbk = direction === "prev" ? "previousSibling" : "nextSibling";
|
|
340
|
+
let sibling = row[methodClbk];
|
|
341
|
+
if (sibling === null) return;
|
|
342
|
+
let lastVisitedSibling = sibling;
|
|
343
|
+
for (let i = 0; i < this.pageUpDown - 1 && sibling; i++) {
|
|
344
|
+
sibling = sibling[methodClbk];
|
|
345
|
+
if (sibling) lastVisitedSibling = sibling;
|
|
346
|
+
}
|
|
347
|
+
destinationRow = sibling || lastVisitedSibling;
|
|
348
|
+
} else destinationRow = direction === "prev" ? siblings[0] : siblings[siblings.length - 1];
|
|
349
|
+
if (!destinationRow || !(destinationRow instanceof Element)) return;
|
|
350
|
+
const child = destinationRow.children[position];
|
|
351
|
+
if (child && this.isFocusable(child)) child.focus();
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
verticalCellNavigation(e) {
|
|
355
|
+
if (!(e.target instanceof Element)) return;
|
|
356
|
+
const row = e.target.closest(this.selectors.Row);
|
|
357
|
+
const cell = e.target.closest(this.selectors.Cell);
|
|
358
|
+
if (row && cell) {
|
|
359
|
+
const cellPosition = this.getColumnIndex(cell);
|
|
360
|
+
const rowPosition = this.getRowIndex(row);
|
|
361
|
+
if (cellPosition === void 0 || rowPosition === void 0) return;
|
|
362
|
+
const direction = e.key === "ArrowUp" ? "prev" : "next";
|
|
363
|
+
/** Find previous rowgroup and focus on the proper cell */
|
|
364
|
+
if (rowPosition === 0 && direction === "prev") {
|
|
365
|
+
const currentRowGroup = row.parentElement?.closest(this.selectors.RowGroup);
|
|
366
|
+
const siblingRowGroups = [...currentRowGroup?.parentElement?.children || []];
|
|
367
|
+
const currentRowGroupIdx = siblingRowGroups.findIndex((el) => el === currentRowGroup);
|
|
368
|
+
if (currentRowGroupIdx !== 0) {
|
|
369
|
+
const rows = [...siblingRowGroups[currentRowGroupIdx - 1].querySelectorAll(this.selectors.Row)];
|
|
370
|
+
const child = rows[rows.length - 1].children[cellPosition];
|
|
371
|
+
if (child && this.isFocusable(child)) child.focus();
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
/** Find next rowgroup and focus on the proper cell */
|
|
376
|
+
if (rowPosition === [...row.parentElement?.querySelectorAll(this.selectors.Row) || []].length - 1 && direction === "next") {
|
|
377
|
+
const currentRowGroup = row.parentElement?.closest(this.selectors.RowGroup);
|
|
378
|
+
const siblingRowGroups = [...currentRowGroup?.parentElement?.children || []];
|
|
379
|
+
const currentRowGroupIdx = siblingRowGroups.findIndex((el) => el === currentRowGroup);
|
|
380
|
+
if (currentRowGroupIdx !== siblingRowGroups.length - 1) {
|
|
381
|
+
const child = [...siblingRowGroups[currentRowGroupIdx + 1].querySelectorAll(this.selectors.Row)][0].children[cellPosition];
|
|
382
|
+
if (child && this.isFocusable(child)) child.focus();
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
/** Navigation in the same rowgroup */
|
|
388
|
+
const destinationRow = this.findUntil(direction, row, this.selectors.Row);
|
|
389
|
+
if (!destinationRow) return;
|
|
390
|
+
const child = destinationRow.children[cellPosition];
|
|
391
|
+
if (child && this.isFocusable(child)) child.focus();
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* Sending a row `Element` and then the first cell will be focused.
|
|
396
|
+
*
|
|
397
|
+
* If you want to focus the last cell then the row children can be passed in
|
|
398
|
+
* reversed order
|
|
399
|
+
*/
|
|
400
|
+
focusOnFirstCell(el) {
|
|
401
|
+
for (let i = 0; i < el.length; i++) {
|
|
402
|
+
const child = el[i];
|
|
403
|
+
if (this.isFocusable(child)) {
|
|
404
|
+
child.focus();
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Get the column index of a `cell` based on the first `row` parent.
|
|
411
|
+
* `cellIndex` could be used, but it's not supported in HTML tables.
|
|
412
|
+
*/
|
|
413
|
+
getColumnIndex(cell) {
|
|
414
|
+
let position = 0;
|
|
415
|
+
const siblings = cell?.parentNode?.children;
|
|
416
|
+
if (!siblings) return;
|
|
417
|
+
while (cell !== siblings[position] && siblings[position] !== void 0) position++;
|
|
418
|
+
if (siblings[position] === void 0) return;
|
|
419
|
+
return position;
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Get the row index of a `row` based
|
|
423
|
+
* on its sibling rows
|
|
424
|
+
*/
|
|
425
|
+
getRowIndex(row) {
|
|
426
|
+
let position = 0;
|
|
427
|
+
const siblings = row?.parentNode?.children;
|
|
428
|
+
if (!siblings) return;
|
|
429
|
+
while (row !== siblings[position] && siblings[position] !== void 0) position++;
|
|
430
|
+
if (siblings[position] === void 0) return;
|
|
431
|
+
return position;
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Equivalent to prevUntil/nextUntil in jQuery
|
|
435
|
+
* https://api.jquery.com/prevUntil/
|
|
436
|
+
*/
|
|
437
|
+
findUntil(direction, el, matchSelector, exitSelector) {
|
|
438
|
+
let element = el;
|
|
439
|
+
const method = direction === "next" ? "nextSibling" : "previousSibling";
|
|
440
|
+
while (element[method]) {
|
|
441
|
+
const sibling = element[method];
|
|
442
|
+
if (!sibling) return null;
|
|
443
|
+
if (exitSelector && sibling instanceof Element && sibling.matches(exitSelector)) return null;
|
|
444
|
+
if (sibling instanceof Element && sibling.matches(matchSelector)) return sibling;
|
|
445
|
+
element = sibling;
|
|
446
|
+
}
|
|
447
|
+
return null;
|
|
448
|
+
}
|
|
449
|
+
};
|
|
450
|
+
function useTableNav(options) {
|
|
451
|
+
const nav = new DataGridNav(options);
|
|
452
|
+
return {
|
|
453
|
+
listeners: {
|
|
454
|
+
onKeyDown: (e) => nav.tableKeyDown(e),
|
|
455
|
+
onKeyUp: () => nav.tableKeyUp()
|
|
456
|
+
},
|
|
457
|
+
tableNav: nav
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
//#endregion
|
|
461
|
+
//#region src/components/table/Table.tsx
|
|
462
|
+
const DndProvider = lazy(() => import("./TableDnd-CuHxANWh.js").then((module) => ({ default: module.DndProvider })));
|
|
463
|
+
const SortableRows = lazy(() => import("./TableDnd-CuHxANWh.js").then((module) => ({ default: module.SortableRows })));
|
|
464
|
+
const DraggableRow = lazy(() => import("./TableDnd-CuHxANWh.js").then((module) => ({ default: module.DraggableRow })));
|
|
465
|
+
const DragHandle = lazy(() => import("./TableDnd-CuHxANWh.js").then((module) => ({ default: module.DragHandle })));
|
|
466
|
+
const tableFeaturesConfig = tableFeatures({
|
|
467
|
+
...stockFeatures,
|
|
468
|
+
sortedRowModel: createSortedRowModel(),
|
|
469
|
+
paginatedRowModel: createPaginatedRowModel()
|
|
470
|
+
});
|
|
471
|
+
const CustomCellContext = (context) => {
|
|
472
|
+
return {
|
|
473
|
+
...context,
|
|
474
|
+
original: context.row.original,
|
|
475
|
+
data: context.row.original,
|
|
476
|
+
value: context.getValue()
|
|
477
|
+
};
|
|
478
|
+
};
|
|
479
|
+
const renderCell = (Comp, props) => {
|
|
480
|
+
const rendered = flexRender(Comp, props);
|
|
481
|
+
return typeof rendered === "string" ? /* @__PURE__ */ jsx(CellText, { children: rendered }) : rendered;
|
|
482
|
+
};
|
|
483
|
+
const RowDragHandleCell = ({ rowId }) => {
|
|
484
|
+
return /* @__PURE__ */ jsx(DragHandle, {
|
|
485
|
+
id: rowId,
|
|
486
|
+
children: (dragProps) => /* @__PURE__ */ jsx(InlineIconButton, {
|
|
487
|
+
...dragProps,
|
|
488
|
+
className: "cursor-move p-1",
|
|
489
|
+
label: "Drag handle",
|
|
490
|
+
icon: GripVertical
|
|
491
|
+
})
|
|
492
|
+
});
|
|
493
|
+
};
|
|
494
|
+
const AutoDragHandleCell = ({ row }) => /* @__PURE__ */ jsx(RowDragHandleCell, { rowId: row.id });
|
|
495
|
+
const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, className, sorting, setSorting, columnOrder, setColumnOrder, columnVisibility, setColumnVisibility, bulkSelectionActions: ActionHeader, enableDragDrop = false, onDragEnd, onReorder, getRowId, enableRowSelection, enableMultiRowSelection = false, defaultSelectedRows, onRowSelectionChange, ...props }) => {
|
|
496
|
+
const tableRowCva = UIOverrides.useCva("table.rowCva", tableRowDefinition);
|
|
497
|
+
const theadCva = UIOverrides.useCva("table.theadCva", theadDefinition);
|
|
498
|
+
const tableHeadRowCva = UIOverrides.useCva("table.headRowCva", tableHeadRowDefinition);
|
|
499
|
+
const tableHeadDataCva = UIOverrides.useCva("table.headDataCva", tableHeadDataDefinition);
|
|
500
|
+
const tableDataCva = UIOverrides.useCva("table.dataCva", tableDataDefinition);
|
|
501
|
+
const ref = useRef(null);
|
|
502
|
+
const { listeners } = useTableNav();
|
|
503
|
+
const data = useMemo(() => items ?? [], [items]);
|
|
504
|
+
const [internalSelectedRows, setInternalSelectedRows] = useState({});
|
|
505
|
+
const { rowSelection, handleRowSelectionChange } = useMemo(() => {
|
|
506
|
+
const hasExternalRowSelection = defaultSelectedRows !== void 0 && onRowSelectionChange !== void 0;
|
|
507
|
+
return {
|
|
508
|
+
rowSelection: hasExternalRowSelection ? defaultSelectedRows : internalSelectedRows,
|
|
509
|
+
handleRowSelectionChange: hasExternalRowSelection ? onRowSelectionChange : setInternalSelectedRows
|
|
510
|
+
};
|
|
511
|
+
}, [
|
|
512
|
+
defaultSelectedRows,
|
|
513
|
+
onRowSelectionChange,
|
|
514
|
+
internalSelectedRows
|
|
515
|
+
]);
|
|
516
|
+
const baseColumns = useMemo(() => typeof columns === "function" ? columns(i18next.t) : columns, [columns]);
|
|
517
|
+
const tableColumns = useMemo(() => {
|
|
518
|
+
if (enableDragDrop && getRowId) return [{
|
|
519
|
+
id: "drag-handle",
|
|
520
|
+
header: "",
|
|
521
|
+
meta: { width: "w-12" },
|
|
522
|
+
cell: AutoDragHandleCell,
|
|
523
|
+
enableSorting: false
|
|
524
|
+
}, ...baseColumns];
|
|
525
|
+
return baseColumns;
|
|
526
|
+
}, [
|
|
527
|
+
baseColumns,
|
|
528
|
+
enableDragDrop,
|
|
529
|
+
getRowId
|
|
530
|
+
]);
|
|
531
|
+
const [isSticky, setIsSticky] = useState(false);
|
|
532
|
+
const onIntersectionChange = useCallback((entry) => {
|
|
533
|
+
setIsSticky(entry.intersectionRatio < 1);
|
|
534
|
+
}, []);
|
|
535
|
+
const { ref: stickyRef } = useIntersectionObserver({ onIntersectionChange });
|
|
536
|
+
const table = useTable({
|
|
537
|
+
features: tableFeaturesConfig,
|
|
538
|
+
data,
|
|
539
|
+
columns: tableColumns,
|
|
540
|
+
state: {
|
|
541
|
+
sorting,
|
|
542
|
+
columnOrder,
|
|
543
|
+
columnVisibility,
|
|
544
|
+
rowSelection
|
|
545
|
+
},
|
|
546
|
+
rowCount: items.length,
|
|
547
|
+
manualPagination: true,
|
|
548
|
+
onColumnOrderChange: setColumnOrder,
|
|
549
|
+
onColumnVisibilityChange: setColumnVisibility,
|
|
550
|
+
onSortingChange: setSorting,
|
|
551
|
+
onRowSelectionChange: handleRowSelectionChange,
|
|
552
|
+
manualSorting: true,
|
|
553
|
+
autoResetPageIndex: false,
|
|
554
|
+
autoResetExpanded: false,
|
|
555
|
+
defaultColumn: { sortDescFirst: true },
|
|
556
|
+
enableRowSelection,
|
|
557
|
+
enableMultiRowSelection,
|
|
558
|
+
getRowId: getRowId ? (row) => String(getRowId(row)) : void 0
|
|
559
|
+
});
|
|
560
|
+
const dataIds = useMemo(() => {
|
|
561
|
+
if (!enableDragDrop || !getRowId) return [];
|
|
562
|
+
return data.map((item) => getRowId(item));
|
|
563
|
+
}, [
|
|
564
|
+
data,
|
|
565
|
+
enableDragDrop,
|
|
566
|
+
getRowId
|
|
567
|
+
]);
|
|
568
|
+
const handleDragEnd = useCallback((event) => {
|
|
569
|
+
const { active, over } = event;
|
|
570
|
+
if (!active || !over || active.id === over.id) return;
|
|
571
|
+
if (getRowId && (onReorder || onDragEnd)) {
|
|
572
|
+
if (onReorder) {
|
|
573
|
+
const oldIndex = items.findIndex((item_0) => getRowId(item_0) === active.id);
|
|
574
|
+
const newIndex = items.findIndex((item_1) => getRowId(item_1) === over.id);
|
|
575
|
+
if (oldIndex !== -1 && newIndex !== -1) {
|
|
576
|
+
const reorderedItems = [...items];
|
|
577
|
+
const [movedItem] = reorderedItems.splice(oldIndex, 1);
|
|
578
|
+
reorderedItems.splice(newIndex, 0, movedItem);
|
|
579
|
+
onReorder(reorderedItems);
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
onDragEnd?.(event);
|
|
583
|
+
}
|
|
584
|
+
}, [
|
|
585
|
+
onDragEnd,
|
|
586
|
+
onReorder,
|
|
587
|
+
items,
|
|
588
|
+
getRowId
|
|
589
|
+
]);
|
|
590
|
+
const selectedRows = table.getSelectedRowModel().rows;
|
|
591
|
+
const columnCount = table.getHeaderGroups()[0].headers.length;
|
|
592
|
+
const isAnyRowSelected = selectedRows.length > 0 && !!ActionHeader;
|
|
593
|
+
const hasOnClick = !!onRowClick || !!onDoubleClick;
|
|
594
|
+
const tableElement = /* @__PURE__ */ jsxs("table", {
|
|
595
|
+
className: clsx("w-full", className),
|
|
596
|
+
...listeners,
|
|
597
|
+
children: [/* @__PURE__ */ jsxs("thead", {
|
|
598
|
+
className: clsx(theadCva({})),
|
|
599
|
+
"data-is-sticky": isSticky || void 0,
|
|
600
|
+
children: [/* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("th", {
|
|
601
|
+
ref: stickyRef,
|
|
602
|
+
className: "-mt-px block"
|
|
603
|
+
}) }), table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx("tr", {
|
|
604
|
+
className: clsx(tableHeadRowCva({})),
|
|
605
|
+
children: headerGroup.headers.filter((header) => {
|
|
606
|
+
if (isAnyRowSelected && header.index > 0) return false;
|
|
607
|
+
return header.column.getIsVisible();
|
|
608
|
+
}).map((header_0, index) => {
|
|
609
|
+
const columnMeta = header_0.column.columnDef.meta ?? {};
|
|
610
|
+
return /* @__PURE__ */ jsx("th", {
|
|
611
|
+
colSpan: isAnyRowSelected ? columnCount : header_0.colSpan,
|
|
612
|
+
tabIndex: -1,
|
|
613
|
+
className: clsx(tableHeadDataCva({ hasRightBorder: index > 0 && showCellBorder }), columnMeta.headerClass, columnMeta.width),
|
|
614
|
+
children: isAnyRowSelected ? /* @__PURE__ */ jsx(ActionHeader, { table }) : /* @__PURE__ */ jsxs("button", {
|
|
615
|
+
type: "button",
|
|
616
|
+
"aria-label": "Sort column",
|
|
617
|
+
className: clsx("flex select-none items-center gap-1 text-surface-default-card-foreground", header_0.column.getCanSort() ? "h-6 cursor-pointer rounded-xs px-1 hover:bg-surface-default-background" : "cursor-default", columnMeta.sortClass),
|
|
618
|
+
onClick: header_0.column.getToggleSortingHandler(),
|
|
619
|
+
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 }), {
|
|
620
|
+
asc: /* @__PURE__ */ jsx(IconSlot, { icon: ChevronUp }),
|
|
621
|
+
desc: /* @__PURE__ */ jsx(IconSlot, { icon: ChevronDown })
|
|
622
|
+
}[header_0.column.getIsSorted()] ?? null]
|
|
623
|
+
})
|
|
624
|
+
}, header_0.id);
|
|
625
|
+
})
|
|
626
|
+
}, headerGroup.id))]
|
|
627
|
+
}), /* @__PURE__ */ jsx("tbody", {
|
|
628
|
+
ref,
|
|
629
|
+
className: "relative",
|
|
630
|
+
children: enableDragDrop ? /* @__PURE__ */ jsx(SortableRows, {
|
|
631
|
+
items: dataIds,
|
|
632
|
+
children: table.getRowModel().rows.map((row_0) => /* @__PURE__ */ jsx(DraggableRow, {
|
|
633
|
+
id: row_0.id,
|
|
634
|
+
className: clsx(tableRowCva({ ...props })),
|
|
635
|
+
isClickable: hasOnClick || row_0.getCanSelect(),
|
|
636
|
+
isSelected: row_0.getIsSelected(),
|
|
637
|
+
onClick: () => {
|
|
638
|
+
if (onRowClick) {
|
|
639
|
+
onRowClick(row_0.original);
|
|
640
|
+
return;
|
|
641
|
+
}
|
|
642
|
+
if (row_0.getCanSelect()) row_0.toggleSelected();
|
|
643
|
+
},
|
|
644
|
+
onDoubleClick: () => onDoubleClick?.(row_0.original),
|
|
645
|
+
children: row_0.getVisibleCells().map((cell, cellIndex) => {
|
|
646
|
+
const columnMeta_0 = cell.column.columnDef.meta ?? {};
|
|
647
|
+
return /* @__PURE__ */ jsx("td", {
|
|
648
|
+
tabIndex: -1,
|
|
649
|
+
className: clsx(tableDataCva({ hasRightBorder: cellIndex > 0 && showCellBorder }), columnMeta_0.cellClass, columnMeta_0.width),
|
|
650
|
+
children: renderCell(cell.column.columnDef.cell, CustomCellContext(cell.getContext()))
|
|
651
|
+
}, cell.id);
|
|
652
|
+
})
|
|
653
|
+
}, row_0.id))
|
|
654
|
+
}) : table.getRowModel().rows.map((row_1) => {
|
|
655
|
+
return /* @__PURE__ */ jsx("tr", {
|
|
656
|
+
className: clsx(tableRowCva({ ...props })),
|
|
657
|
+
onClick: () => {
|
|
658
|
+
if (onRowClick) {
|
|
659
|
+
onRowClick(row_1.original);
|
|
660
|
+
return;
|
|
661
|
+
}
|
|
662
|
+
if (row_1.getCanSelect()) row_1.toggleSelected();
|
|
663
|
+
},
|
|
664
|
+
onDoubleClick: () => onDoubleClick?.(row_1.original),
|
|
665
|
+
"data-clickable": hasOnClick || row_1.getCanSelect() || void 0,
|
|
666
|
+
"data-selected": row_1.getIsSelected() || void 0,
|
|
667
|
+
children: row_1.getVisibleCells().map((cell_0, cellIndex_0) => {
|
|
668
|
+
const columnMeta_1 = cell_0.column.columnDef.meta ?? {};
|
|
669
|
+
return /* @__PURE__ */ jsx("td", {
|
|
670
|
+
tabIndex: -1,
|
|
671
|
+
className: clsx(tableDataCva({ hasRightBorder: cellIndex_0 > 0 && showCellBorder }), columnMeta_1.cellClass, columnMeta_1.width),
|
|
672
|
+
children: renderCell(cell_0.column.columnDef.cell, CustomCellContext(cell_0.getContext()))
|
|
673
|
+
}, cell_0.id);
|
|
674
|
+
})
|
|
675
|
+
}, row_1.id);
|
|
676
|
+
})
|
|
677
|
+
})]
|
|
678
|
+
});
|
|
679
|
+
if (enableDragDrop) return /* @__PURE__ */ jsx(Suspense, {
|
|
680
|
+
fallback: null,
|
|
681
|
+
children: /* @__PURE__ */ jsx(DndProvider, {
|
|
682
|
+
onDragEnd: handleDragEnd,
|
|
683
|
+
children: tableElement
|
|
684
|
+
})
|
|
685
|
+
});
|
|
686
|
+
return tableElement;
|
|
687
|
+
};
|
|
688
|
+
//#endregion
|
|
689
|
+
export { CellText as i, useTableNav as n, HeaderText as r, Table as t };
|