@povio/ui 5.0.0-rc.9 → 6.0.0-rc.2
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 +673 -0
- package/README.md +206 -55
- package/dist/{Accordion-BzwO4_ml.js → Accordion-DycXjzGK.js} +10 -10
- package/dist/{Alert-DfiJbKH0.d.ts → Alert-BpPHCE5-.d.ts} +3 -3
- package/dist/{AlertDialog-OWTbR4km.d.ts → AlertDialog-CDCbfARJ.d.ts} +3 -3
- package/dist/Autocomplete-BUslodfn.d.ts +23 -0
- package/dist/Autocomplete-DSwAc7jF.js +142 -0
- package/dist/Autocomplete.bound-Db5C6Jph.d.ts +9 -0
- package/dist/Autocomplete.bound-e5WbxlBm.js +28 -0
- package/dist/{Badge-CBNpj823.d.ts → Badge-Dp091PcC.d.ts} +2 -2
- package/dist/{BadgeButton-Ccgt3oGO.d.ts → BadgeButton-DZm_aw29.d.ts} +2 -2
- package/dist/{BottomSheet-DbQuzfAB.d.ts → BottomSheet-C-jdDmO7.d.ts} +1 -1
- package/dist/{BottomSheet-BXLE3161.js → BottomSheet-DB0Cdlgx.js} +10 -84
- package/dist/{BottomSheet.lazy-D9LCEo7s.d.ts → BottomSheet.lazy-C0_6p_UQ.d.ts} +1 -1
- package/dist/{Breadcrumbs-CUV6CU8Q.d.ts → Breadcrumbs-CuupIZuv.d.ts} +1 -1
- package/dist/{Breadcrumbs-FF8hMfXd.js → Breadcrumbs-V-Bea_bs.js} +16 -13
- package/dist/Button-BL5ils-5.d.ts +13 -0
- package/dist/{Button-D6KlWSFL.js → Button-C1YB5dOw.js} +3 -3
- package/dist/Button-DU1Q8GDB.js +16 -0
- package/dist/ButtonBase-BhlpPPDi.js +87 -0
- package/dist/ButtonBase-C_ODj77A.d.ts +32 -0
- package/dist/{ButtonContent-c7lJayVQ.js → ButtonContent-BBup-vN6.js} +4 -13
- package/dist/{Calendar-BTjajO6i.js → Calendar-ChmIflXX.js} +31 -31
- package/dist/{CheckContent-D7sZPmzx.js → CheckContent-DHKG_FY6.js} +1 -1
- package/dist/{Checkbox-DVTWaMKa.d.ts → Checkbox-BjZVQ-6_.d.ts} +9 -8
- package/dist/{Checkbox-CV1ILXXO.js → Checkbox-Bo03jrPX.js} +20 -37
- package/dist/Checkbox.bound-DN4OVaMs.js +33 -0
- package/dist/Checkbox.bound-DTO008Tl.d.ts +9 -0
- package/dist/CheckboxCheckmark-C4yFclkZ.js +44 -0
- package/dist/CheckboxGroup-B_rzZgta.d.ts +30 -0
- package/dist/CheckboxGroup-D3LxgocB.js +139 -0
- package/dist/CheckboxGroup.bound-8hjoP-xP.js +32 -0
- package/dist/CheckboxGroup.bound-CiA60XsD.d.ts +9 -0
- package/dist/ComboBox-DFlz6HJ8.js +212 -0
- package/dist/{DatePicker-8xSs_jNd.d.ts → DatePicker-B_caFHFY.d.ts} +21 -10
- package/dist/{DatePicker-DOLL7mkc.js → DatePicker-Bc_E4UZ1.js} +40 -50
- package/dist/DatePicker.bound-C5-DL4SJ.d.ts +9 -0
- package/dist/DatePicker.bound-CtBL5w-8.js +36 -0
- package/dist/{DatePickerInput-D81ZJ3fT.d.ts → DatePickerInput-8gKhZdGY.d.ts} +3 -3
- package/dist/{DatePickerInput-BLBcySA2.js → DatePickerInput-TND0rEMc.js} +68 -48
- package/dist/{DateRangePicker-BF-1CztH.js → DateRangePicker-BNMTOQ2N.js} +81 -70
- package/dist/{DateRangePicker-Bfq-yDm7.d.ts → DateRangePicker-CzWwO5bA.d.ts} +30 -10
- package/dist/DateRangePicker.bound-C4mHtr-b.d.ts +9 -0
- package/dist/DateRangePicker.bound-GeRw9Iuj.js +35 -0
- package/dist/{DateTimePicker-Cj0qvJUz.js → DateTimePicker-B3YjV4uj.js} +40 -44
- package/dist/{DateTimePicker-D4lHyf6P.d.ts → DateTimePicker-CzGdmamp.d.ts} +21 -11
- package/dist/DateTimePicker.bound-ByjHsAnf.js +32 -0
- package/dist/DateTimePicker.bound-DwClL-pe.d.ts +9 -0
- package/dist/Dialog-2XpWsphI.d.ts +21 -0
- package/dist/{Dialog-9manOgMA.js → Dialog-COvYzwNU.js} +11 -8
- package/dist/{Dialog-CKLkS00H.js → Dialog-lFYX-7Ax.js} +22 -27
- package/dist/{DropdownMenu-5jmtgLXd.js → DropdownMenu-DtZdv5mo.js} +7 -7
- package/dist/DropdownMenu-gKIXzj63.d.ts +25 -0
- package/dist/{DropdownMenuDesktop-Cl9gZVq0.js → DropdownMenuDesktop-BMkiHEuY.js} +4 -4
- package/dist/{FileInput-C4CE5kuP.d.ts → FileInput-0o8-IJUh.d.ts} +26 -22
- package/dist/{FileInput-Br5DQaGQ.js → FileInput-Bpm2HJSB.js} +34 -47
- package/dist/FileInput.bound-B6oGPCP8.js +30 -0
- package/dist/FileInput.bound-BEeceBBO.d.ts +8 -0
- package/dist/{FileTrigger-Cthk5_Wp.js → FileTrigger-DBX1Io6E.js} +36 -7
- package/dist/FileUpload--AQJW3vz.d.ts +11 -0
- package/dist/{FileUpload--7ub3EZO.js → FileUpload-G7tdtNKN.js} +276 -165
- package/dist/FileUpload.bound-DqqPejvc.js +30 -0
- package/dist/FileUpload.bound-i5zfLhoY.d.ts +16 -0
- package/dist/{FileUploadContainer-042ztsaL.d.ts → FileUploadContainer-D1eYflb2.d.ts} +1 -1
- package/dist/{Form-DlQcyN1f.js → Form-CqF1SaVw.js} +2 -2
- package/dist/{FormField-Byiehm9y.d.ts → FormField-BsR2Cjxm.d.ts} +4 -2
- package/dist/FormField-DyqEbqx3.js +119 -0
- package/dist/{FormFieldError-DeOHHLo2.js → FormFieldError-BaVgIKrv.js} +2 -13
- package/dist/FormFieldHeaderTooltip-Bxc4f9i4.js +47 -0
- package/dist/{Heading-nI1_VOaE.js → Heading-D4XFYv__.js} +2 -2
- package/dist/IconButton-DdvODpP7.d.ts +25 -0
- package/dist/{IconSlot-DSK7qNxc.js → IconSlot-Cuvpj1gd.js} +2 -2
- package/dist/{InlineTooltipWrapper-BpApaGXV.js → InlineTooltipWrapper-HDHIaQtS.js} +1 -1
- package/dist/{Input-BsbLZDtC.js → Input-BG0Xjw5X.js} +2 -2
- package/dist/Input-BdCci6BF.js +229 -0
- package/dist/{Input-DOanwj3l.d.ts → Input-Bu4G9gcn.d.ts} +13 -9
- package/dist/Input.bound-CnqI-L-b.js +31 -0
- package/dist/Input.bound-CxfKRXzI.d.ts +9 -0
- package/dist/{InputContent-CXuP1ghQ.d.ts → InputContent-BGTEvv6a.d.ts} +4 -4
- package/dist/{useFieldAccessibility-ScC6Mtd5.js → InputContent-Ca4oVqIe.js} +24 -37
- package/dist/{Label-B2-B-uFY.js → Label-BGvF9vWx.js} +2 -2
- package/dist/{Link-FupWOW1f.js → Link-Chux-Clm.js} +2 -2
- package/dist/{Link-Ow9H7kNv.d.ts → Link-D0Kk3F5w.d.ts} +3 -3
- package/dist/{ListBox-CL8Ar4Q_.js → ListBox-CoUk0kkt.js} +10 -11
- package/dist/{MenuItem-DHyqOqln.d.ts → MenuItem-Bo5a7_Nw.d.ts} +1 -1
- package/dist/{Modal-w60dVQcb.js → Modal-B4p1zFqi.js} +58 -20
- package/dist/NumberField-BLAwsjns.js +225 -0
- package/dist/{NumberField-Cb9Gf6QJ.d.ts → NumberField-DCMQZPY9.d.ts} +13 -9
- package/dist/NumberField.bound-DiDYEZM4.js +32 -0
- package/dist/NumberField.bound-fZLE6Odv.d.ts +9 -0
- package/dist/{NumberFormatter-CLDS_LRZ.js → NumberFormatter-DYarfm5F.js} +2 -36
- package/dist/{NumberRangeInput-BfbJQqzn.d.ts → NumberRangeInput-CtSYPK2e.d.ts} +13 -8
- package/dist/{NumberRangeInput-B8-LHfg3.js → NumberRangeInput-al32ZeSy.js} +23 -51
- package/dist/NumberRangeInput.bound-B0e7yUDI.js +32 -0
- package/dist/NumberRangeInput.bound-CxAk_1_K.d.ts +9 -0
- package/dist/{OverlayArrow-D8z7cCsw.js → OverlayArrow-DF0jMwul.js} +2 -2
- package/dist/{Pagination-CwQu5Py8.d.ts → Pagination-DikJEIWD.d.ts} +1 -1
- package/dist/{PaginationList-DMRUGtf8.d.ts → PaginationList-D7PVQ5WX.d.ts} +1 -1
- package/dist/PaginationList-vfqgyTIP.js +258 -0
- package/dist/PasswordInput-Dy5hMeFP.d.ts +11 -0
- package/dist/{PasswordInput-CLwFUgl0.d.ts → PasswordInput.bound-B5sHHU26.d.ts} +5 -6
- package/dist/PasswordInput.bound-Bj3WO1zC.js +23 -0
- package/dist/{Popover-BTHPteIh.d.ts → Popover-DxTsc2y6.d.ts} +2 -2
- package/dist/{Progress-CjWOR38H.d.ts → Progress-CtxPBAgr.d.ts} +4 -4
- package/dist/{Progress-B3mY9rIP.js → Progress-ZsKwo9ne.js} +3 -28
- package/dist/RadioGroup-BYS8ha2C.d.ts +26 -0
- package/dist/{RadioGroup-DOw3PRoX.js → RadioGroup-D0X47mm7.js} +13 -117
- package/dist/RadioGroup.bound-CibzUsQL.d.ts +9 -0
- package/dist/RadioGroup.bound-aK3GC6i7.js +32 -0
- package/dist/RichTextEditor-k9LvNCjg.d.ts +28 -0
- package/dist/{RichTextEditor-D4yN7Wj7.js → RichTextEditor-qoxzWBFP.js} +154 -85
- package/dist/{staticSelect.utils-uHa8f_c6.js → Select-BAlYMh4h.js} +218 -252
- package/dist/{SelectBase-Omiq2D3M.d.ts → Select-NNohxr1t.d.ts} +32 -11
- package/dist/Select.bound-CQPG2sWV.js +34 -0
- package/dist/Select.bound-Dh5kywfV.d.ts +17 -0
- package/dist/{SelectionIndicator-JblvLKCu.js → SelectionIndicator-B7C5Y0JM.js} +1 -1
- package/dist/{SharedElementTransition-Da1c_cOO.js → SharedElementTransition-DJ9CCbEa.js} +1 -1
- package/dist/{Slider-CzEmKYBF.js → Slider-DMrnZn3I.js} +16 -40
- package/dist/{Slider-EYlGCLWe.d.ts → Slider-zbLmrW6J.d.ts} +9 -8
- package/dist/Slider.bound-BaJHbE6d.d.ts +9 -0
- package/dist/Slider.bound-BoIYW8I5.js +31 -0
- package/dist/{Spinner-BeVTUzzx.js → Spinner-CFj5Iu77.js} +28 -40
- package/dist/{Spinner-DbXeDOa2.d.ts → Spinner-b365xHHG.d.ts} +5 -5
- package/dist/{SplitButton-D9ngY1rJ.d.ts → SplitButton-CzvD7LIK.d.ts} +3 -3
- package/dist/{Stepper-TATlHZhQ.d.ts → Stepper-Bk1JUf6K.d.ts} +18 -18
- package/dist/{Stepper-Cp5vbL5g.js → Stepper-DlyScdAM.js} +11 -10
- package/dist/{Switch-CqnGEdeD.js → Switch-Ck_zSDuw.js} +9 -58
- package/dist/Switch-uqTGk-H6.d.ts +24 -0
- package/dist/Switch.bound-Brw5UUA6.js +33 -0
- package/dist/Switch.bound-DWuDmr2C.d.ts +9 -0
- package/dist/Tag--FasSNEh.d.ts +44 -0
- package/dist/{Text-D2MPZ3sY.js → Text-D72yc4S6.js} +1 -1
- package/dist/{TextArea-D8WkKsGn.js → TextArea-33uOXvnc.js} +30 -33
- package/dist/{TextArea-l_keyLK7.d.ts → TextArea-t5IYaVds.d.ts} +11 -9
- package/dist/TextArea.bound-DPALjcvO.js +28 -0
- package/dist/TextArea.bound-DcflHR7X.d.ts +9 -0
- package/dist/TextArea.cva-Bb73hriz.js +5 -0
- package/dist/TimePicker-BK4AnHQa.d.ts +45 -0
- package/dist/{TimePicker-C4taAOFQ.js → TimePicker-CmBGkxDC.js} +59 -51
- package/dist/TimePicker.bound-3i1DJgrU.js +32 -0
- package/dist/TimePicker.bound-BMZWRtpJ.d.ts +9 -0
- package/dist/{Toast-ruXqONDA.d.ts → Toast-6rYk8AAG.d.ts} +1 -1
- package/dist/{ToastContainer-qgpzMFD4.js → ToastContainer-D1Jl3PPk.js} +3 -3
- package/dist/{ToggleButton-BW1ensey.js → ToggleButton-DUQ8nwKY.js} +5 -5
- package/dist/ToggleButton-DZ340rQr.d.ts +17 -0
- package/dist/{toggleGroup.types-Bp43zbSQ.d.ts → ToggleGroup-BTqYh6FH.d.ts} +16 -15
- package/dist/{ToggleGroup-DOk27fgI.js → ToggleGroup-cvzIyIhi.js} +136 -162
- package/dist/ToggleGroup.bound-BEtnF-L-.d.ts +9 -0
- package/dist/ToggleGroup.bound-DjwakG--.js +67 -0
- package/dist/{Tooltip-CpG1nz7Y.js → Tooltip-CqbyoJhl.js} +45 -10
- package/dist/Tooltip-DP5RDkXs.d.ts +16 -0
- package/dist/{TooltipWrapper-3jyN0Wss.js → TooltipWrapper-BrftXInI.js} +7 -7
- package/dist/{Typography-XljT9s02.d.ts → Typography-BD-MSuTp.d.ts} +1 -1
- package/dist/{Typography-LU4z2pR1.js → Typography-Ba5l4rmj.js} +1 -1
- package/dist/{accordion.cva-CL1bVscW.js → accordion.cva-C-gUiXk5.js} +16 -24
- package/dist/badgeButton.cva-C1BuYx1N.js +138 -0
- package/dist/{badgeButton.cva-B2bgCQP6.d.ts → badgeButton.cva-Cj5AWgfv.d.ts} +8 -8
- package/dist/{breadcrumbs.cva-7zzdDhVR.js → breadcrumbs.cva-DCAdmxWR.js} +8 -8
- package/dist/{button.cva-C7kEhgoA.d.ts → button.cva-YpNNY6C-.d.ts} +21 -16
- package/dist/button.cva-fkUW5b2d.js +267 -0
- package/dist/{buttonContent.cva-DPIlROA9.d.ts → buttonContent.cva-CxgT-rxJ.d.ts} +2 -2
- package/dist/{checkbox.cva-t1Ox50hy.d.ts → checkbox.cva-CZnnBl8g.d.ts} +6 -6
- package/dist/checkbox.cva-DCVi4-4z.js +128 -0
- package/dist/components/accordion.js +1 -1
- package/dist/components/alert-dialog.d.ts +1 -1
- package/dist/components/alert-dialog.js +102 -100
- package/dist/components/alert.d.ts +1 -1
- package/dist/components/alert.js +116 -1
- package/dist/components/autocomplete.d.ts +2 -2
- package/dist/components/autocomplete.js +1 -134
- package/dist/components/badge-button.d.ts +1 -1
- package/dist/components/badge-button.js +4 -4
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/badge.js +8 -8
- package/dist/components/bottom-sheet-header.d.ts +16 -0
- package/dist/components/bottom-sheet-header.js +80 -0
- package/dist/components/bottom-sheet.d.ts +2 -2
- package/dist/components/bottom-sheet.js +2 -2
- package/dist/components/breadcrumb/react-aria.js +1 -1
- package/dist/components/breadcrumbs.d.ts +1 -1
- package/dist/components/breadcrumbs.js +1 -1
- package/dist/components/button-group.d.ts +12 -0
- package/dist/components/button-group.js +46 -0
- package/dist/components/button.d.ts +2 -2
- package/dist/components/button.js +1 -1
- package/dist/components/checkbox-group.d.ts +2 -2
- package/dist/components/checkbox-group.js +1 -163
- package/dist/components/checkbox.d.ts +2 -2
- package/dist/components/checkbox.js +2 -2
- package/dist/components/combo-box/react-aria.js +1 -1
- package/dist/components/date-picker/react-aria.js +1 -1
- package/dist/components/date-picker.d.ts +2 -2
- package/dist/components/date-picker.js +1 -1
- package/dist/components/date-range-picker/react-aria.js +1 -1
- package/dist/components/date-range-picker.d.ts +2 -2
- package/dist/components/date-range-picker.js +1 -1
- package/dist/components/date-time-picker.d.ts +2 -2
- package/dist/components/date-time-picker.js +1 -1
- package/dist/components/dialog-trigger/react-aria.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 +2 -2
- 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 +3 -3
- 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 +17 -15
- package/dist/components/icon-slot.d.ts +1 -1
- package/dist/components/icon-slot.js +1 -1
- package/dist/components/input-frame.d.ts +93 -0
- package/dist/{useStaticInputHandoff-NeZVnci-.js → components/input-frame.js} +50 -99
- package/dist/components/input.d.ts +2 -2
- package/dist/components/input.js +1 -241
- package/dist/components/link.d.ts +1 -1
- package/dist/components/link.js +2 -2
- package/dist/components/menu-trigger/react-aria.js +1 -1
- package/dist/components/modal/react-aria.js +1 -1
- package/dist/components/modal-overlay/react-aria.js +1 -1
- package/dist/components/number-field.d.ts +2 -2
- package/dist/components/number-field.js +1 -245
- package/dist/components/number-range-input.d.ts +2 -2
- 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 +14 -10
- package/dist/components/password-input.d.ts +2 -2
- package/dist/components/password-input.js +22 -1
- package/dist/components/popover/react-aria.js +1 -1
- package/dist/components/popover.d.ts +1 -1
- package/dist/components/popover.js +39 -31
- package/dist/components/progress.d.ts +1 -1
- package/dist/components/progress.js +1 -1
- package/dist/components/radio-group.d.ts +2 -2
- package/dist/components/radio-group.js +1 -1
- package/dist/components/select/react-aria.js +1 -1
- package/dist/components/select.d.ts +2 -3
- package/dist/components/select.js +1 -1
- package/dist/components/slider.d.ts +2 -2
- package/dist/components/slider.js +1 -1
- package/dist/components/spinner.d.ts +1 -1
- package/dist/components/spinner.js +1 -1
- package/dist/components/split-button.d.ts +1 -1
- package/dist/components/split-button.js +2 -2
- package/dist/components/stepper.d.ts +1 -1
- package/dist/components/stepper.js +1 -1
- package/dist/components/style-definitions.d.ts +3 -0
- package/dist/components/style-definitions.js +121 -0
- package/dist/components/submenu-trigger/react-aria.js +1 -1
- package/dist/components/switch.d.ts +2 -2
- package/dist/components/switch.js +1 -1
- package/dist/components/tag.d.ts +1 -1
- package/dist/components/tag.js +93 -1
- package/dist/components/text-area.d.ts +2 -2
- package/dist/components/text-area.js +1 -1
- package/dist/components/time-picker.d.ts +2 -2
- package/dist/components/time-picker.js +1 -1
- package/dist/components/toast.d.ts +2 -2
- package/dist/components/toast.js +2 -2
- package/dist/components/toggle-button.d.ts +1 -1
- package/dist/components/toggle-button.js +17 -30
- package/dist/components/toggle-group.d.ts +2 -3
- 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/component-configuration.d.ts +30 -0
- package/dist/config/component-configuration.js +69 -0
- 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/resources.d.ts +1 -1
- package/dist/config/resources.js +1 -1
- package/dist/config/ui-config.d.ts +2 -2
- package/dist/config/ui-config.js +1 -1
- package/dist/config/ui-overrides.d.ts +1 -1
- package/dist/{confirmation.context-BuzgCfYl.js → confirmation.context-BSn1s-ip.js} +1 -1
- package/dist/{confirmation.context-BOeEVczb.d.ts → confirmation.context-DdxzxDWB.d.ts} +1 -1
- package/dist/{datePickerInput.cva-Cd7UUN61.js → datePickerInput.cva--gCeAsRx.js} +1 -1
- package/dist/{datePickerValue.utils-DCgoSrP3.js → datePickerValue.utils-BxHR_BQZ.js} +21 -13
- package/dist/{dialog.cva-COhDZaVl.js → dialog.cva-DzJlaK5a.js} +6 -6
- package/dist/{dist-CAdwxJbe.js → dist-D35rjADF.js} +54 -1
- package/dist/{dom.utils-D1AopHx9.js → dom.utils-BbfrA6RP.js} +1 -1
- package/dist/dropdownMenu.cva-CS5Q2b_3.js +31 -0
- package/dist/{PasswordInput-DYwUZ4-k.js → eye-BA4nRlMX.js} +1 -22
- package/dist/{fileUpload.cva-ujmStxB1.js → fileUpload.cva-DVJcCCYz.js} +10 -10
- package/dist/{fileUpload.types-n5FxK_F-.d.ts → fileUpload.types-DKICER1J.d.ts} +17 -17
- package/dist/form.binding-B-2id68q.js +49 -0
- package/dist/form.types-C8P4sznq.d.ts +22 -0
- package/dist/formFieldError.cva-Cc-dELdU.js +14 -0
- package/dist/formFieldHelper.cva-5YaiUEcL.js +97 -0
- package/dist/hooks/use-async-list.d.ts +2 -0
- package/dist/hooks/use-async-list.js +2 -0
- package/dist/hooks/use-filters.js +1 -1
- package/dist/{i18n-CX1vFM9r.d.ts → i18n-2z5on9No.d.ts} +18 -0
- package/dist/{i18n-CX2EjhJI.js → i18n-BjNKHh_D.js} +20 -2
- package/dist/{iconSlot.cva-CnpFzAOR.d.ts → iconSlot.cva-BrT0X2qq.d.ts} +4 -3
- package/dist/icons.d.ts +1 -1
- package/dist/icons.js +1 -1
- package/dist/index.d.ts +95 -91
- package/dist/index.js +87 -85
- package/dist/input.cva-AHLI_M3K.js +185 -0
- package/dist/{input.cva-BsHgYa-L.d.ts → input.cva-CEFEpKml.d.ts} +10 -10
- package/dist/{intlStrings-chfsan9H.js → intlStrings-Cu1YN1tA.js} +35 -35
- package/dist/isEqual-LFw0W5rU.js +97 -0
- package/dist/{link.context-D5qyz9Rf.d.ts → link.context-pIX2TUSb.d.ts} +1 -1
- package/dist/link.cva-isgDrId6.js +12 -0
- package/dist/{numberStatic.utils-BX50PSee.js → numberStatic.utils-BIyZuILs.js} +5 -5
- package/dist/outline.clsx-DGGQQRkM.js +6 -0
- package/dist/{popover.cva-Bhud1wnp.js → popover.cva-Ciu9Ro5G.js} +1 -1
- package/dist/progress.cva-D0PKV_ET.js +28 -0
- package/dist/radio.cva-Dn2Auqxw.js +79 -0
- package/dist/{radio.cva-DN9VQ3Kb.d.ts → radio.cva-VUie6k1Y.d.ts} +4 -4
- package/dist/rich-text-editor.d.ts +2 -2
- package/dist/rich-text-editor.js +1 -1
- package/dist/{routing.utils-UTQonIhB.js → routing.utils-DfxEt0_Y.js} +5 -0
- package/dist/selectDesktop.cva-CGBkscBY.js +14 -0
- package/dist/selectItem.cva-Ch6oK4jP.js +27 -0
- package/dist/{staticDateTimeSegments-DtU63_dw.js → staticDateTimeSegments-CA_lwN-O.js} +60 -56
- package/dist/status.cva-CUpcOT4W.js +130 -0
- package/dist/{stepper.cva-CZ0Kj-s7.js → stepper.cva-CQGechUm.js} +22 -34
- package/dist/style-definitions-DzsmGccZ.d.ts +1028 -0
- 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-C9bO_QI-.js +24 -0
- package/dist/switch.cva-x4SdjrQp.d.ts +16 -0
- package/dist/table.cva-BMIizuGy.js +111 -0
- package/dist/table.cva-HHTd92di.d.ts +84 -0
- package/dist/tag.cva-BVa0EWBU.js +24 -0
- package/dist/tanstack/autocomplete.d.ts +3 -2
- package/dist/tanstack/autocomplete.js +1 -1
- package/dist/tanstack/checkbox-group.d.ts +3 -2
- package/dist/tanstack/checkbox-group.js +1 -1
- package/dist/tanstack/checkbox.d.ts +3 -2
- package/dist/tanstack/checkbox.js +2 -2
- package/dist/tanstack/date-picker.d.ts +3 -2
- package/dist/tanstack/date-picker.js +1 -1
- package/dist/tanstack/date-range-picker.d.ts +3 -2
- package/dist/tanstack/date-range-picker.js +1 -1
- package/dist/tanstack/date-time-picker.d.ts +3 -2
- package/dist/tanstack/date-time-picker.js +1 -1
- package/dist/tanstack/file-input.d.ts +3 -2
- package/dist/tanstack/file-input.js +1 -1
- package/dist/tanstack/file-upload.d.ts +4 -3
- package/dist/tanstack/file-upload.js +1 -1
- package/dist/tanstack/form.d.ts +3 -3
- package/dist/tanstack/form.js +3 -3
- package/dist/tanstack/input.d.ts +3 -2
- package/dist/tanstack/input.js +1 -1
- package/dist/tanstack/number-field.d.ts +3 -2
- package/dist/tanstack/number-field.js +1 -1
- package/dist/tanstack/number-range-input.d.ts +3 -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 +3 -2
- package/dist/tanstack/radio-group.js +1 -1
- package/dist/tanstack/rich-text-editor.d.ts +9 -2
- package/dist/tanstack/rich-text-editor.js +27 -1
- package/dist/tanstack/select.d.ts +3 -2
- package/dist/tanstack/select.js +1 -1
- package/dist/tanstack/slider.d.ts +3 -2
- package/dist/tanstack/slider.js +1 -1
- package/dist/tanstack/switch.d.ts +3 -2
- package/dist/tanstack/switch.js +1 -1
- package/dist/tanstack/table.d.ts +3 -2
- package/dist/tanstack/table.js +2 -3
- package/dist/tanstack/text-area.d.ts +3 -2
- package/dist/tanstack/text-area.js +1 -1
- package/dist/tanstack/time-picker.d.ts +3 -2
- package/dist/tanstack/time-picker.js +1 -1
- package/dist/tanstack/toggle-group.d.ts +3 -3
- package/dist/tanstack/toggle-group.js +1 -1
- package/dist/tanstack-CSiB125i.d.ts +469 -0
- package/dist/tanstack.d.ts +79 -78
- package/dist/tanstack.js +87 -83
- package/dist/{toast.cva-By5lvAfr.d.ts → toast.cva-B8i61tEN.d.ts} +10 -10
- package/dist/{toast.cva-C_L_RffH.js → toast.cva-BMOx7_9f.js} +21 -37
- package/dist/{toast.runtime-cxex9e4E.js → toast.runtime-D18gn2Ty.js} +1 -2
- package/dist/toggleGroup.cva-C9Y5-kpk.js +26 -0
- package/dist/{tooltip.cva-BIzlOXHH.js → tooltip.cva-Clfcn_r2.js} +10 -10
- package/dist/tw-ui-plugin.js +5 -1
- package/dist/typography.cva-CKCCpIMj.d.ts +36 -0
- package/dist/typography.cva-CXolEQdT.js +31 -0
- package/dist/{uiConfig.context-DeBX2beU.d.ts → uiConfig.context-B1SCCG5j.d.ts} +12 -20
- package/dist/{uiConfig.context-BS3r_kTS.js → uiConfig.context-dxsO9puE.js} +12 -118
- package/dist/{uiOverrides.context-DEp139He.d.ts → uiOverrides.context-Dmev7iRS.d.ts} +44 -6
- package/dist/useAsyncList-Cu-Y8If2.d.ts +9 -0
- package/dist/useAsyncList-yHz7twsj.js +445 -0
- package/dist/{useBreakpoint-DQoMN-BG.js → useBreakpoint-DOUmXVZ2.js} +5 -5
- package/dist/{useControlledState-CzXkZCX8.js → useControlledState-CuU1VIh1.js} +2 -2
- package/dist/useFieldAccessibility-eZIMECmG.js +19 -0
- package/dist/{useFilters-XNH27Md2.js → useFilters-HIngImwn.js} +1 -1
- package/dist/{form.binding-DVJ5F0JE.d.ts → useForm-I6z23FXf.d.ts} +15 -15
- package/dist/{form.binding-CG1RPv6o.js → useForm-eW4KpH1u.js} +79 -42
- package/dist/useFormAutosave-BBLm3Ujo.d.ts +34 -0
- package/dist/useFormAutosave-XEQqk1lK.js +216 -0
- package/dist/useStaticInputHandoff-DyYxfwv6.js +77 -0
- package/dist/useTableColumnConfig-DoTYVxqG.js +1349 -0
- package/dist/{useTableNav-Ckj5PBRk.d.ts → useTableNav-D2zCwy63.d.ts} +34 -96
- package/dist/{useToast-yreVCUer.d.ts → useToast-CA0BGCDK.d.ts} +1 -1
- package/dist/{utils-Czcqspm7.js → utils-BkLF-JA3.js} +1 -1
- package/package.json +66 -234
- package/.rulesync/rules/ui-buttons-and-content.md +0 -56
- package/.rulesync/rules/ui-inputs-and-forms.md +0 -62
- package/.rulesync/rules/ui-overlays-navigation-and-styling.md +0 -49
- package/.rulesync/rules/ui-overview.md +0 -33
- package/dist/Alert-CnvEb1D_.js +0 -244
- package/dist/AppCanvasPage--RG31Yyv.js +0 -2421
- package/dist/AppCanvasPage-BIFYeEeS.d.ts +0 -80
- package/dist/Autocomplete-BwNHp8fy.d.ts +0 -15
- package/dist/Button-C5rv4Cr2.js +0 -506
- package/dist/Button-D-4qb0IR.d.ts +0 -42
- package/dist/CheckboxCheckmark-CpC3wlMs.js +0 -178
- package/dist/CheckboxGroup-DGF12cmB.d.ts +0 -28
- package/dist/ComponentGallery-C6exitZN.js +0 -3513
- package/dist/Dialog-CW93T9X1.d.ts +0 -56
- package/dist/DropdownMenu-JNpYT4-3.d.ts +0 -62
- package/dist/FileUpload-CR7bZxV1.d.ts +0 -7
- package/dist/Form-DbEWnCKc.d.ts +0 -49
- package/dist/FormField-B99dLt8o.js +0 -212
- package/dist/FormFieldHeaderTooltip-BV2Ju4oB.js +0 -17
- package/dist/IconButton-D4thBurp.d.ts +0 -16
- package/dist/InlineIconButton-BeJCjl-q.d.ts +0 -15
- package/dist/InputItem-CIxbTxZu.js +0 -63
- package/dist/Inputs-DJSKiaWY.js +0 -17
- package/dist/Inputs-O84btFJL.d.ts +0 -13
- package/dist/PaginationList-DtvuP63b.js +0 -220
- package/dist/QuerySelect-BGxb6Y0K.d.ts +0 -24
- package/dist/RadioGroup-CZg2kIMk.d.ts +0 -24
- package/dist/RichTextEditor-YxuRUlI7.d.ts +0 -26
- package/dist/Select-UR0ec2Ux.js +0 -154
- package/dist/Select-pHbyJdZJ.d.ts +0 -15
- package/dist/Switch-s_EPn0Jz.d.ts +0 -22
- package/dist/Table-BN2_J_Ne.js +0 -636
- package/dist/Tag-AHfV_XSf.d.ts +0 -44
- package/dist/Tag-DPg5sL1Z.js +0 -146
- package/dist/TextButton-XUhV_1s0.d.ts +0 -15
- package/dist/TimePicker-B1POvGWs.d.ts +0 -33
- package/dist/Toast-DtG3pA61.js +0 -53
- package/dist/ToggleButton-7aP8Jb11.d.ts +0 -11
- package/dist/ToggleGroup-CRFDIPGZ.d.ts +0 -7
- package/dist/Tooltip-DHv6vAqW.d.ts +0 -57
- package/dist/UIConfigurator-BwLRfe-a.js +0 -6704
- package/dist/autocomplete-DeERHN8W.d.ts +0 -16
- package/dist/badgeButton.cva-CvN4CTx5.js +0 -300
- package/dist/checkbox-DxIPDTK5.d.ts +0 -9
- package/dist/checkbox-group-B3BOVshI.d.ts +0 -9
- package/dist/chevron-left-Dgo_b9wJ.js +0 -20
- package/dist/chevron-up-D_Gqpb5M.js +0 -20
- package/dist/components/inline-icon-button.d.ts +0 -2
- package/dist/components/inline-icon-button.js +0 -40
- package/dist/components/query-autocomplete.d.ts +0 -8
- package/dist/components/query-autocomplete.js +0 -134
- package/dist/components/query-select.d.ts +0 -2
- package/dist/components/query-select.js +0 -147
- package/dist/components/text-button.d.ts +0 -2
- package/dist/components/text-button.js +0 -35
- package/dist/config/app-canvas-tanstack.d.ts +0 -23
- package/dist/config/app-canvas-tanstack.js +0 -62
- package/dist/config/app-canvas.d.ts +0 -12
- package/dist/config/app-canvas.js +0 -2
- package/dist/config/ui-configurator-theme.d.ts +0 -2
- package/dist/config/ui-configurator-theme.js +0 -2
- package/dist/config/ui-configurator-vite.d.ts +0 -10
- package/dist/config/ui-configurator-vite.js +0 -174
- package/dist/config/ui-configurator.d.ts +0 -15
- package/dist/config/ui-configurator.js +0 -3
- package/dist/configuration.context-f_FSPWhQ.d.ts +0 -926
- package/dist/date-picker-DnxDmlOW.d.ts +0 -9
- package/dist/date-range-picker-DHDOSvHN.d.ts +0 -9
- package/dist/date-time-picker-UkTa0OJ8.d.ts +0 -9
- package/dist/date.transforms-DLg-eFcE.js +0 -15
- package/dist/dropdownMenu.cva-DvEmX0bs.js +0 -34
- package/dist/dynamicInputs-ByVMnx4Z.d.ts +0 -772
- package/dist/dynamicInputs-CRMWIpHA.js +0 -194
- package/dist/dynamicInputs-m_DQu5q0.js +0 -214
- package/dist/fieldAdapter-C4sDFC8f.d.ts +0 -9
- package/dist/fieldAdapter-DjYls12j.js +0 -63
- package/dist/file-input-DkbkdI7l.d.ts +0 -9
- package/dist/file-upload-CTsPhxJk.d.ts +0 -10
- package/dist/form.types-CecYaerF.d.ts +0 -13
- package/dist/form.types-ZNGbcqJS.d.ts +0 -13
- package/dist/info-iUmX3uDk.js +0 -32
- package/dist/input-CdQNCPgH.d.ts +0 -8
- package/dist/input.cva-DJA8ovm_.js +0 -208
- package/dist/link.cva-DMTHZiJG.js +0 -12
- package/dist/number-field-CUDbenNV.d.ts +0 -8
- package/dist/number-range-input-DZGrcvjL.d.ts +0 -8
- package/dist/outline.clsx-50W_vNDl.js +0 -6
- package/dist/password-input-fYN20cQO.d.ts +0 -8
- package/dist/query-autocomplete-CfuQeiYG.d.ts +0 -14
- package/dist/query-select-CuT_sE6a.d.ts +0 -15
- package/dist/queryAutocomplete.types-tl3r6iaY.d.ts +0 -27
- package/dist/radio-group-B3ccPf0p.d.ts +0 -9
- package/dist/rhf/autocomplete.d.ts +0 -3
- package/dist/rhf/autocomplete.js +0 -8
- package/dist/rhf/checkbox-group.d.ts +0 -3
- package/dist/rhf/checkbox-group.js +0 -8
- package/dist/rhf/checkbox.d.ts +0 -3
- package/dist/rhf/checkbox.js +0 -8
- package/dist/rhf/date-picker.d.ts +0 -3
- package/dist/rhf/date-picker.js +0 -9
- package/dist/rhf/date-range-picker.d.ts +0 -3
- package/dist/rhf/date-range-picker.js +0 -9
- package/dist/rhf/date-time-picker.d.ts +0 -3
- package/dist/rhf/date-time-picker.js +0 -9
- package/dist/rhf/file-input.d.ts +0 -3
- package/dist/rhf/file-input.js +0 -6
- package/dist/rhf/file-upload.d.ts +0 -3
- package/dist/rhf/file-upload.js +0 -6
- package/dist/rhf/input.d.ts +0 -3
- package/dist/rhf/input.js +0 -6
- package/dist/rhf/inputs.d.ts +0 -4
- package/dist/rhf/inputs.js +0 -2
- package/dist/rhf/number-field.d.ts +0 -3
- package/dist/rhf/number-field.js +0 -6
- package/dist/rhf/number-range-input.d.ts +0 -3
- package/dist/rhf/number-range-input.js +0 -6
- package/dist/rhf/password-input.d.ts +0 -3
- package/dist/rhf/password-input.js +0 -6
- package/dist/rhf/query-autocomplete.d.ts +0 -2
- package/dist/rhf/query-autocomplete.js +0 -8
- package/dist/rhf/query-select.d.ts +0 -2
- package/dist/rhf/query-select.js +0 -8
- package/dist/rhf/radio-group.d.ts +0 -3
- package/dist/rhf/radio-group.js +0 -8
- package/dist/rhf/rich-text-editor.d.ts +0 -3
- package/dist/rhf/rich-text-editor.js +0 -6
- package/dist/rhf/select.d.ts +0 -3
- package/dist/rhf/select.js +0 -8
- package/dist/rhf/slider.d.ts +0 -3
- package/dist/rhf/slider.js +0 -6
- package/dist/rhf/switch.d.ts +0 -3
- package/dist/rhf/switch.js +0 -8
- package/dist/rhf/text-area.d.ts +0 -3
- package/dist/rhf/text-area.js +0 -6
- package/dist/rhf/time-picker.d.ts +0 -3
- package/dist/rhf/time-picker.js +0 -9
- package/dist/rhf/toggle-group.d.ts +0 -3
- package/dist/rhf/toggle-group.js +0 -6
- package/dist/rhf-t348TCCL.js +0 -256
- package/dist/rhf.d.ts +0 -106
- package/dist/rhf.js +0 -112
- package/dist/rich-text-editor-B-Onl7T8.d.ts +0 -8
- package/dist/select-B4a52eWW.d.ts +0 -16
- package/dist/selectDesktop.cva-CHAMxhfO.js +0 -69
- package/dist/slider-dNj9jruO.d.ts +0 -8
- package/dist/style-merge.util-zLimKwt6.d.ts +0 -40
- package/dist/styles/app-canvas.css +0 -740
- package/dist/styles/color-utilities.css +0 -20
- package/dist/styles/configurator.css +0 -3280
- package/dist/switch-C--iWnY8.d.ts +0 -9
- package/dist/switch.cva-CWNzmdRc.d.ts +0 -16
- package/dist/table.cva-D5oQ-QvA.js +0 -101
- package/dist/tanstack/inputs.d.ts +0 -5
- package/dist/tanstack/inputs.js +0 -3
- package/dist/tanstack/query-autocomplete.d.ts +0 -2
- package/dist/tanstack/query-autocomplete.js +0 -2
- package/dist/tanstack/query-select.d.ts +0 -2
- package/dist/tanstack/query-select.js +0 -2
- package/dist/text-area-DQAtpOQp.d.ts +0 -8
- package/dist/theme-model-DtYPxNvH.js +0 -406
- package/dist/theme-model-T1zIdBg8.d.ts +0 -12
- package/dist/time-picker-DoGfbil6.d.ts +0 -9
- package/dist/toggle-group-C1nMDOwz.d.ts +0 -9
- package/dist/toggleGroup.cva-MbpaEBg1.js +0 -35
- package/dist/typography.cva-D1JOEYl-.d.ts +0 -36
- package/dist/typography.cva-iD15k56p.js +0 -51
- package/dist/underline-66hmELxa.js +0 -81
- package/dist/upload-CXU83BJ4.js +0 -30
- package/dist/useFormAutosave-DfuP7drj.js +0 -198
- package/dist/useQueryAutocomplete-CraXvRm_.js +0 -152
- package/dist/useTableColumnConfig-Di0_w80v.js +0 -892
- package/dist/zod.utils-DrrPDT9v.js +0 -24
- package/rulesync.jsonc +0 -11
- package/scripts/generate-rules.mjs +0 -34
- package/src/configurator/README.md +0 -77
- package/dist/{import-BE0r63d8.js → import-D_3dPATF.js} +2 -2
- /package/dist/{queries.utils-CmbhAoHU.js → tanstack-CmbhAoHU.js} +0 -0
package/dist/Table-BN2_J_Ne.js
DELETED
|
@@ -1,636 +0,0 @@
|
|
|
1
|
-
import { t as logger } from "./logger-CqZjM-sn.js";
|
|
2
|
-
import { t as UIConfig } from "./uiConfig.context-BS3r_kTS.js";
|
|
3
|
-
import { t as ChevronDown } from "./chevron-down-B4Pr8bD3.js";
|
|
4
|
-
import { t as ChevronUp } from "./chevron-up-D_Gqpb5M.js";
|
|
5
|
-
import { a as tableHeaderTextDefinition, c as GripVertical, i as tableHeadRowDefinition, n as tableDataDefinition, o as tableRowDefinition, r as tableHeadDataDefinition, s as theadDefinition, t as tableCellTextDefinition } from "./table.cva-D5oQ-QvA.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 { Suspense, lazy, useCallback, useMemo, useRef, useState } from "react";
|
|
13
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
-
import { createPaginatedRowModel, createSortedRowModel, flexRender, stockFeatures, tableFeatures, useTable } from "@tanstack/react-table";
|
|
15
|
-
import i18next from "i18next";
|
|
16
|
-
//#region src/components/table/CellText.tsx
|
|
17
|
-
const CellText = (props) => {
|
|
18
|
-
const uiConfig = UIConfig.useConfig();
|
|
19
|
-
const { size = uiConfig.tableCellText.size, children, style, className } = props;
|
|
20
|
-
const cellTextCva = UIOverrides.useCva("table.cellTextCva", tableCellTextDefinition);
|
|
21
|
-
return /* @__PURE__ */ jsx(Typography, {
|
|
22
|
-
className: cellTextCva({ className }),
|
|
23
|
-
as: "span",
|
|
24
|
-
size,
|
|
25
|
-
style,
|
|
26
|
-
"data-rac": true,
|
|
27
|
-
children
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
//#endregion
|
|
31
|
-
//#region src/components/table/HeaderText.tsx
|
|
32
|
-
const HeaderText = (props) => {
|
|
33
|
-
const uiConfig = UIConfig.useConfig();
|
|
34
|
-
const { size = uiConfig.tableHeaderText.size, children, style, className } = props;
|
|
35
|
-
const headerTextCva = UIOverrides.useCva("table.headerTextCva", tableHeaderTextDefinition);
|
|
36
|
-
return /* @__PURE__ */ jsx(Typography, {
|
|
37
|
-
className: headerTextCva({ className }),
|
|
38
|
-
as: "span",
|
|
39
|
-
size,
|
|
40
|
-
style,
|
|
41
|
-
children
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
//#endregion
|
|
45
|
-
//#region src/hooks/useTableNav.ts
|
|
46
|
-
const Selectors = {
|
|
47
|
-
Cell: "[role=\"cell\"],[role=\"gridcell\"],[role=\"columnheader\"],[role=\"rowheader\"],td,th",
|
|
48
|
-
Row: "[role=\"row\"],tr",
|
|
49
|
-
RowGroup: "[role=\"rowgroup\"],thead,tbody,tfoot",
|
|
50
|
-
/** Selector from here: https://github.com/Shopify/polaris/blob/main/polaris-react/src/utilities/focus.ts#L10 */
|
|
51
|
-
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]"
|
|
52
|
-
};
|
|
53
|
-
var DataGridNav = class {
|
|
54
|
-
constructor(config = {}) {
|
|
55
|
-
this.keys = [];
|
|
56
|
-
this.activeCell = null;
|
|
57
|
-
this.debugLog = (functionName, message) => {
|
|
58
|
-
if (this.debug) logger.info(`[${functionName}]: ${message}`);
|
|
59
|
-
};
|
|
60
|
-
const { selectors = {}, pageUpDown, debug = false } = config;
|
|
61
|
-
this.selectors = {
|
|
62
|
-
...Selectors,
|
|
63
|
-
...selectors
|
|
64
|
-
};
|
|
65
|
-
this.pageUpDown = pageUpDown;
|
|
66
|
-
this.keys = [];
|
|
67
|
-
this.debug = debug;
|
|
68
|
-
this.disabled = false;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Disables the keyboard listener in cases
|
|
72
|
-
* that elements inside the grid need to use
|
|
73
|
-
* arrows keys etc., like select dropdowns
|
|
74
|
-
*/
|
|
75
|
-
disable() {
|
|
76
|
-
this.disabled = true;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Enables the keyboard listeners
|
|
80
|
-
*/
|
|
81
|
-
enable() {
|
|
82
|
-
this.disabled = false;
|
|
83
|
-
}
|
|
84
|
-
isFocusable(el) {
|
|
85
|
-
return el instanceof HTMLElement || el instanceof SVGElement;
|
|
86
|
-
}
|
|
87
|
-
getActiveCell() {
|
|
88
|
-
return this.activeCell;
|
|
89
|
-
}
|
|
90
|
-
/** Used as a keyboard listener for key up */
|
|
91
|
-
tableKeyUp() {
|
|
92
|
-
this.keys = [];
|
|
93
|
-
}
|
|
94
|
-
/** Used as a keyboard listener for key down */
|
|
95
|
-
tableKeyDown(e) {
|
|
96
|
-
if (this.disabled) return;
|
|
97
|
-
/**
|
|
98
|
-
* Avoid page scrolling etc.
|
|
99
|
-
* Enable default behavior for:
|
|
100
|
-
* Tab, Shift + Tab
|
|
101
|
-
* TODO: Actually it will be better to just prevent
|
|
102
|
-
* in ArrowKeys and PageKeys maybe?
|
|
103
|
-
* Or should the consumer stop propagation?!
|
|
104
|
-
* Cannot work with preventDefault as it will
|
|
105
|
-
* first capture the event from an input in cell for example
|
|
106
|
-
*/
|
|
107
|
-
if ("ArrowDown" === e.key || "ArrowUp" === e.key || "ArrowLeft" === e.key || "ArrowRight" === e.key) e.preventDefault();
|
|
108
|
-
/**
|
|
109
|
-
* Add key to the stack if it's
|
|
110
|
-
* not the same with the last (long press)
|
|
111
|
-
*/
|
|
112
|
-
if (this.keys.length === 0 || this.keys[this.keys.length - 1] !== e.key) this.keys.push(e.key);
|
|
113
|
-
/**
|
|
114
|
-
* Need to check if we are inside a grid cell
|
|
115
|
-
* or not to enable/disable Grid Navigation
|
|
116
|
-
*/
|
|
117
|
-
if (!(e.target instanceof Element)) return;
|
|
118
|
-
const cell = e.target.parentElement?.closest(`${this.selectors.Cell},${this.selectors.Row}`);
|
|
119
|
-
if (!cell) return;
|
|
120
|
-
if (cell.matches(this.selectors.Cell)) this.cellNavigation(e);
|
|
121
|
-
else this.gridNavigation(e);
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Handles the navigation inside a cell
|
|
125
|
-
*/
|
|
126
|
-
cellNavigation(e) {
|
|
127
|
-
if (!(e.target instanceof Element)) return;
|
|
128
|
-
/**
|
|
129
|
-
* Keys: Escape
|
|
130
|
-
* Restore grid navigation
|
|
131
|
-
*/
|
|
132
|
-
if (e.key === "Escape") {
|
|
133
|
-
const cell = e.target.closest(this.selectors.Cell);
|
|
134
|
-
if (cell && this.isFocusable(cell)) {
|
|
135
|
-
cell.focus();
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Keys: ArrowRight, ArrowDown
|
|
141
|
-
* Move to the next focusable cell, or the first one
|
|
142
|
-
*
|
|
143
|
-
* Arrow Down disabled:
|
|
144
|
-
* https://github.com/w3c/aria-practices/issues/2739#issuecomment-1613538972
|
|
145
|
-
*/
|
|
146
|
-
if (e.key === "ArrowRight" || e.key === "ArrowDown") {
|
|
147
|
-
const cell = e.target.closest(this.selectors.Cell);
|
|
148
|
-
if (!cell) return;
|
|
149
|
-
const focusableWidgets = [...cell.querySelectorAll(this.selectors.Focusable)];
|
|
150
|
-
const widgetIdx = focusableWidgets.findIndex((el) => el === e.target);
|
|
151
|
-
const widgetToFocus = focusableWidgets[widgetIdx === focusableWidgets.length - 1 ? 0 : widgetIdx + 1];
|
|
152
|
-
if (this.isFocusable(widgetToFocus)) widgetToFocus.focus();
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Keys: ArrowLeft, ArrowUp
|
|
157
|
-
* Move to the previous focusable cell, or the last one
|
|
158
|
-
*
|
|
159
|
-
* Arrow Up disabled:
|
|
160
|
-
* https://github.com/w3c/aria-practices/issues/2739#issuecomment-1613538972
|
|
161
|
-
*/
|
|
162
|
-
if (e.key === "ArrowLeft" || e.key === "ArrowUp") {
|
|
163
|
-
const cell = e.target.closest(this.selectors.Cell);
|
|
164
|
-
if (!cell) return;
|
|
165
|
-
const focusableWidgets = [...cell.querySelectorAll(this.selectors.Focusable)];
|
|
166
|
-
const widgetIdx = focusableWidgets.findIndex((el) => el === e.target);
|
|
167
|
-
const widgetToFocus = focusableWidgets[widgetIdx === 0 ? focusableWidgets.length - 1 : widgetIdx - 1];
|
|
168
|
-
if (this.isFocusable(widgetToFocus)) widgetToFocus.focus();
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* Handles the navigation outside a cell
|
|
173
|
-
* on the grid level
|
|
174
|
-
*/
|
|
175
|
-
gridNavigation(e) {
|
|
176
|
-
const { target } = e;
|
|
177
|
-
if (!(e.target instanceof Element)) return;
|
|
178
|
-
if (!(target instanceof Element)) return;
|
|
179
|
-
if (this.keys.length === 1) {
|
|
180
|
-
/**
|
|
181
|
-
* Keys: Enter
|
|
182
|
-
* Should move focus inside the cell to the first focusable element:
|
|
183
|
-
* https://www.w3.org/WAI/ARIA/apg/patterns/grid/#gridNav_inside
|
|
184
|
-
*/
|
|
185
|
-
if (/^[a-zA-Z0-9]$/.test(e.key)) {
|
|
186
|
-
const cell = e.target.querySelector(this.selectors.Focusable);
|
|
187
|
-
if (cell && this.isFocusable(cell) && cell instanceof HTMLInputElement) {
|
|
188
|
-
cell.focus();
|
|
189
|
-
cell.value = `${cell.value}${e.key}`;
|
|
190
|
-
e.preventDefault();
|
|
191
|
-
}
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
if (e.key === "Backspace") {
|
|
195
|
-
const cell = e.target.querySelector(this.selectors.Focusable);
|
|
196
|
-
if (cell && this.isFocusable(cell) && cell instanceof HTMLInputElement) {
|
|
197
|
-
const nativeInputValueSetter = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set;
|
|
198
|
-
if (nativeInputValueSetter) {
|
|
199
|
-
nativeInputValueSetter.call(cell, "");
|
|
200
|
-
const ev = new Event("input", { bubbles: true });
|
|
201
|
-
cell.dispatchEvent(ev);
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
if (e.key === "Enter") {
|
|
207
|
-
const cell = e.target.querySelector(this.selectors.Focusable);
|
|
208
|
-
if (cell && this.isFocusable(cell)) {
|
|
209
|
-
if (cell.getAttribute("data-type") === "select-trigger") {
|
|
210
|
-
cell.click();
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
cell.focus();
|
|
214
|
-
e.preventDefault();
|
|
215
|
-
}
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* Keys: ArrowLeft, ArrowRight
|
|
220
|
-
* Should move focus to the next/previous cell
|
|
221
|
-
*/
|
|
222
|
-
if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
|
223
|
-
const direction = e.key === "ArrowLeft" ? "prev" : "next";
|
|
224
|
-
const cell = e.target.closest(this.selectors.Cell);
|
|
225
|
-
let nextCell = null;
|
|
226
|
-
if (direction === "next" && cell?.nextElementSibling instanceof HTMLElement) nextCell = cell.nextElementSibling;
|
|
227
|
-
if (direction === "prev" && cell?.previousElementSibling instanceof HTMLElement) nextCell = cell.previousElementSibling;
|
|
228
|
-
if (nextCell && this.isFocusable(nextCell)) {
|
|
229
|
-
nextCell.focus();
|
|
230
|
-
e.preventDefault();
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* Keys: Up,Down
|
|
235
|
-
* Should move focus to the same column of the next/previous row
|
|
236
|
-
*/
|
|
237
|
-
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
238
|
-
this.verticalCellNavigation(e);
|
|
239
|
-
return;
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Keys: PageUp, PageDown
|
|
243
|
-
* Should move focus to the first/last row
|
|
244
|
-
* or a predefined number of rows if user provides a value
|
|
245
|
-
*/
|
|
246
|
-
if (e.key === "PageUp" || e.key === "PageDown") {
|
|
247
|
-
this.pageCellNavigation(e);
|
|
248
|
-
return;
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* Keys: Home, End
|
|
252
|
-
* Should move focus to the first/last cell of the current row
|
|
253
|
-
*/
|
|
254
|
-
if (e.key === "Home" || e.key === "End") {
|
|
255
|
-
const rowChildren = [...e.target.closest(this.selectors.Row)?.children || []];
|
|
256
|
-
if (e.key === "End") rowChildren.reverse();
|
|
257
|
-
this.focusOnFirstCell(rowChildren);
|
|
258
|
-
}
|
|
259
|
-
} else {
|
|
260
|
-
/**
|
|
261
|
-
* Keys: Control + Home, Control + End
|
|
262
|
-
* Should move focus to the first/last cell of the first/last row
|
|
263
|
-
*/
|
|
264
|
-
const [firstKey, secondKey] = this.keys;
|
|
265
|
-
if (firstKey === "Control" && (secondKey === "Home" || secondKey === "End")) {
|
|
266
|
-
const siblings = e.target.closest(this.selectors.Row).parentElement?.children;
|
|
267
|
-
if (!siblings) return;
|
|
268
|
-
const rowChildren = [...(secondKey === "Home" ? siblings[0] : siblings[siblings.length - 1])?.children || []];
|
|
269
|
-
if (secondKey === "End") rowChildren.reverse();
|
|
270
|
-
this.focusOnFirstCell(rowChildren);
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
pageCellNavigation(e) {
|
|
275
|
-
if (!(e.target instanceof Element)) return;
|
|
276
|
-
const row = e.target.closest(this.selectors.Row);
|
|
277
|
-
const cell = e.target.closest(this.selectors.Cell);
|
|
278
|
-
if (row && cell) {
|
|
279
|
-
const position = this.getColumnIndex(cell);
|
|
280
|
-
if (position === void 0) return;
|
|
281
|
-
const direction = e.key === "PageUp" ? "prev" : "next";
|
|
282
|
-
const siblings = row.parentElement?.children;
|
|
283
|
-
if (!siblings) return;
|
|
284
|
-
let destinationRow;
|
|
285
|
-
if (this.pageUpDown) {
|
|
286
|
-
const methodClbk = direction === "prev" ? "previousSibling" : "nextSibling";
|
|
287
|
-
let sibling = row[methodClbk];
|
|
288
|
-
if (sibling === null) return;
|
|
289
|
-
let lastVisitedSibling = sibling;
|
|
290
|
-
for (let i = 0; i < this.pageUpDown - 1 && sibling; i++) {
|
|
291
|
-
sibling = sibling[methodClbk];
|
|
292
|
-
if (sibling) lastVisitedSibling = sibling;
|
|
293
|
-
}
|
|
294
|
-
destinationRow = sibling || lastVisitedSibling;
|
|
295
|
-
} else destinationRow = direction === "prev" ? siblings[0] : siblings[siblings.length - 1];
|
|
296
|
-
if (!destinationRow || !(destinationRow instanceof Element)) return;
|
|
297
|
-
const child = destinationRow.children[position];
|
|
298
|
-
if (child && this.isFocusable(child)) child.focus();
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
verticalCellNavigation(e) {
|
|
302
|
-
if (!(e.target instanceof Element)) return;
|
|
303
|
-
const row = e.target.closest(this.selectors.Row);
|
|
304
|
-
const cell = e.target.closest(this.selectors.Cell);
|
|
305
|
-
if (row && cell) {
|
|
306
|
-
const cellPosition = this.getColumnIndex(cell);
|
|
307
|
-
const rowPosition = this.getRowIndex(row);
|
|
308
|
-
if (cellPosition === void 0 || rowPosition === void 0) return;
|
|
309
|
-
const direction = e.key === "ArrowUp" ? "prev" : "next";
|
|
310
|
-
/** Find previous rowgroup and focus on the proper cell */
|
|
311
|
-
if (rowPosition === 0 && direction === "prev") {
|
|
312
|
-
const currentRowGroup = row.parentElement?.closest(this.selectors.RowGroup);
|
|
313
|
-
const siblingRowGroups = [...currentRowGroup?.parentElement?.children || []];
|
|
314
|
-
const currentRowGroupIdx = siblingRowGroups.findIndex((el) => el === currentRowGroup);
|
|
315
|
-
if (currentRowGroupIdx !== 0) {
|
|
316
|
-
const rows = [...siblingRowGroups[currentRowGroupIdx - 1].querySelectorAll(this.selectors.Row)];
|
|
317
|
-
const child = rows[rows.length - 1].children[cellPosition];
|
|
318
|
-
if (child && this.isFocusable(child)) child.focus();
|
|
319
|
-
return;
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
/** Find next rowgroup and focus on the proper cell */
|
|
323
|
-
if (rowPosition === [...row.parentElement?.querySelectorAll(this.selectors.Row) || []].length - 1 && direction === "next") {
|
|
324
|
-
const currentRowGroup = row.parentElement?.closest(this.selectors.RowGroup);
|
|
325
|
-
const siblingRowGroups = [...currentRowGroup?.parentElement?.children || []];
|
|
326
|
-
const currentRowGroupIdx = siblingRowGroups.findIndex((el) => el === currentRowGroup);
|
|
327
|
-
if (currentRowGroupIdx !== siblingRowGroups.length - 1) {
|
|
328
|
-
const child = [...siblingRowGroups[currentRowGroupIdx + 1].querySelectorAll(this.selectors.Row)][0].children[cellPosition];
|
|
329
|
-
if (child && this.isFocusable(child)) child.focus();
|
|
330
|
-
return;
|
|
331
|
-
}
|
|
332
|
-
return;
|
|
333
|
-
}
|
|
334
|
-
/** Navigation in the same rowgroup */
|
|
335
|
-
const destinationRow = this.findUntil(direction, row, this.selectors.Row);
|
|
336
|
-
if (!destinationRow) return;
|
|
337
|
-
const child = destinationRow.children[cellPosition];
|
|
338
|
-
if (child && this.isFocusable(child)) child.focus();
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
/**
|
|
342
|
-
* Sending a row `Element` and then the first cell will be focused.
|
|
343
|
-
*
|
|
344
|
-
* If you want to focus the last cell then the row children can be passed in
|
|
345
|
-
* reversed order
|
|
346
|
-
*/
|
|
347
|
-
focusOnFirstCell(el) {
|
|
348
|
-
for (let i = 0; i < el.length; i++) {
|
|
349
|
-
const child = el[i];
|
|
350
|
-
if (this.isFocusable(child)) {
|
|
351
|
-
child.focus();
|
|
352
|
-
return;
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
/**
|
|
357
|
-
* Get the column index of a `cell` based on the first `row` parent.
|
|
358
|
-
* `cellIndex` could be used, but it's not supported in HTML tables.
|
|
359
|
-
*/
|
|
360
|
-
getColumnIndex(cell) {
|
|
361
|
-
let position = 0;
|
|
362
|
-
const siblings = cell?.parentNode?.children;
|
|
363
|
-
if (!siblings) return;
|
|
364
|
-
while (cell !== siblings[position] && siblings[position] !== void 0) position++;
|
|
365
|
-
if (siblings[position] === void 0) return;
|
|
366
|
-
return position;
|
|
367
|
-
}
|
|
368
|
-
/**
|
|
369
|
-
* Get the row index of a `row` based
|
|
370
|
-
* on its sibling rows
|
|
371
|
-
*/
|
|
372
|
-
getRowIndex(row) {
|
|
373
|
-
let position = 0;
|
|
374
|
-
const siblings = row?.parentNode?.children;
|
|
375
|
-
if (!siblings) return;
|
|
376
|
-
while (row !== siblings[position] && siblings[position] !== void 0) position++;
|
|
377
|
-
if (siblings[position] === void 0) return;
|
|
378
|
-
return position;
|
|
379
|
-
}
|
|
380
|
-
/**
|
|
381
|
-
* Equivalent to prevUntil/nextUntil in jQuery
|
|
382
|
-
* https://api.jquery.com/prevUntil/
|
|
383
|
-
*/
|
|
384
|
-
findUntil(direction, el, matchSelector, exitSelector) {
|
|
385
|
-
let element = el;
|
|
386
|
-
const method = direction === "next" ? "nextSibling" : "previousSibling";
|
|
387
|
-
while (element[method]) {
|
|
388
|
-
const sibling = element[method];
|
|
389
|
-
if (!sibling) return null;
|
|
390
|
-
if (exitSelector && sibling instanceof Element && sibling.matches(exitSelector)) return null;
|
|
391
|
-
if (sibling instanceof Element && sibling.matches(matchSelector)) return sibling;
|
|
392
|
-
element = sibling;
|
|
393
|
-
}
|
|
394
|
-
return null;
|
|
395
|
-
}
|
|
396
|
-
};
|
|
397
|
-
function useTableNav(options) {
|
|
398
|
-
const nav = new DataGridNav(options);
|
|
399
|
-
return {
|
|
400
|
-
listeners: {
|
|
401
|
-
onKeyDown: (e) => nav.tableKeyDown(e),
|
|
402
|
-
onKeyUp: () => nav.tableKeyUp()
|
|
403
|
-
},
|
|
404
|
-
tableNav: nav
|
|
405
|
-
};
|
|
406
|
-
}
|
|
407
|
-
//#endregion
|
|
408
|
-
//#region src/components/table/Table.tsx
|
|
409
|
-
const DndProvider = lazy(() => import("./TableDnd-CuHxANWh.js").then((module) => ({ default: module.DndProvider })));
|
|
410
|
-
const SortableRows = lazy(() => import("./TableDnd-CuHxANWh.js").then((module) => ({ default: module.SortableRows })));
|
|
411
|
-
const DraggableRow = lazy(() => import("./TableDnd-CuHxANWh.js").then((module) => ({ default: module.DraggableRow })));
|
|
412
|
-
const DragHandle = lazy(() => import("./TableDnd-CuHxANWh.js").then((module) => ({ default: module.DragHandle })));
|
|
413
|
-
const tableFeaturesConfig = tableFeatures({
|
|
414
|
-
...stockFeatures,
|
|
415
|
-
sortedRowModel: createSortedRowModel(),
|
|
416
|
-
paginatedRowModel: createPaginatedRowModel()
|
|
417
|
-
});
|
|
418
|
-
const CustomCellContext = (context) => {
|
|
419
|
-
return {
|
|
420
|
-
...context,
|
|
421
|
-
original: context.row.original,
|
|
422
|
-
data: context.row.original,
|
|
423
|
-
value: context.getValue()
|
|
424
|
-
};
|
|
425
|
-
};
|
|
426
|
-
const renderCell = (Comp, props) => {
|
|
427
|
-
const rendered = flexRender(Comp, props);
|
|
428
|
-
return typeof rendered === "string" ? /* @__PURE__ */ jsx(CellText, { children: rendered }) : rendered;
|
|
429
|
-
};
|
|
430
|
-
const RowDragHandleCell = ({ rowId }) => {
|
|
431
|
-
return /* @__PURE__ */ jsx(DragHandle, {
|
|
432
|
-
id: rowId,
|
|
433
|
-
children: (dragProps) => /* @__PURE__ */ jsx(InlineIconButton, {
|
|
434
|
-
...dragProps,
|
|
435
|
-
className: "cursor-move p-1",
|
|
436
|
-
label: "Drag handle",
|
|
437
|
-
icon: GripVertical
|
|
438
|
-
})
|
|
439
|
-
});
|
|
440
|
-
};
|
|
441
|
-
const AutoDragHandleCell = ({ row }) => /* @__PURE__ */ jsx(RowDragHandleCell, { rowId: row.id });
|
|
442
|
-
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 }) => {
|
|
443
|
-
const tableRowCva = UIOverrides.useCva("table.rowCva", tableRowDefinition);
|
|
444
|
-
const theadCva = UIOverrides.useCva("table.theadCva", theadDefinition);
|
|
445
|
-
const tableHeadRowCva = UIOverrides.useCva("table.headRowCva", tableHeadRowDefinition);
|
|
446
|
-
const tableHeadDataCva = UIOverrides.useCva("table.headDataCva", tableHeadDataDefinition);
|
|
447
|
-
const tableDataCva = UIOverrides.useCva("table.dataCva", tableDataDefinition);
|
|
448
|
-
const ref = useRef(null);
|
|
449
|
-
const { listeners } = useTableNav();
|
|
450
|
-
const data = useMemo(() => items ?? [], [items]);
|
|
451
|
-
const [internalSelectedRows, setInternalSelectedRows] = useState({});
|
|
452
|
-
const { rowSelection, handleRowSelectionChange } = useMemo(() => {
|
|
453
|
-
const hasExternalRowSelection = defaultSelectedRows !== void 0 && onRowSelectionChange !== void 0;
|
|
454
|
-
return {
|
|
455
|
-
rowSelection: hasExternalRowSelection ? defaultSelectedRows : internalSelectedRows,
|
|
456
|
-
handleRowSelectionChange: hasExternalRowSelection ? onRowSelectionChange : setInternalSelectedRows
|
|
457
|
-
};
|
|
458
|
-
}, [
|
|
459
|
-
defaultSelectedRows,
|
|
460
|
-
onRowSelectionChange,
|
|
461
|
-
internalSelectedRows
|
|
462
|
-
]);
|
|
463
|
-
const baseColumns = useMemo(() => typeof columns === "function" ? columns(i18next.t) : columns, [columns]);
|
|
464
|
-
const tableColumns = useMemo(() => {
|
|
465
|
-
if (enableDragDrop && getRowId) return [{
|
|
466
|
-
id: "drag-handle",
|
|
467
|
-
header: "",
|
|
468
|
-
meta: { width: "w-12" },
|
|
469
|
-
cell: AutoDragHandleCell,
|
|
470
|
-
enableSorting: false
|
|
471
|
-
}, ...baseColumns];
|
|
472
|
-
return baseColumns;
|
|
473
|
-
}, [
|
|
474
|
-
baseColumns,
|
|
475
|
-
enableDragDrop,
|
|
476
|
-
getRowId
|
|
477
|
-
]);
|
|
478
|
-
const [isSticky, setIsSticky] = useState(false);
|
|
479
|
-
const onIntersectionChange = useCallback((entry) => {
|
|
480
|
-
setIsSticky(entry.intersectionRatio < 1);
|
|
481
|
-
}, []);
|
|
482
|
-
const { ref: stickyRef } = useIntersectionObserver({ onIntersectionChange });
|
|
483
|
-
const table = useTable({
|
|
484
|
-
features: tableFeaturesConfig,
|
|
485
|
-
data,
|
|
486
|
-
columns: tableColumns,
|
|
487
|
-
state: {
|
|
488
|
-
sorting,
|
|
489
|
-
columnOrder,
|
|
490
|
-
columnVisibility,
|
|
491
|
-
rowSelection
|
|
492
|
-
},
|
|
493
|
-
rowCount: items.length,
|
|
494
|
-
manualPagination: true,
|
|
495
|
-
onColumnOrderChange: setColumnOrder,
|
|
496
|
-
onColumnVisibilityChange: setColumnVisibility,
|
|
497
|
-
onSortingChange: setSorting,
|
|
498
|
-
onRowSelectionChange: handleRowSelectionChange,
|
|
499
|
-
manualSorting: true,
|
|
500
|
-
autoResetPageIndex: false,
|
|
501
|
-
autoResetExpanded: false,
|
|
502
|
-
defaultColumn: { sortDescFirst: true },
|
|
503
|
-
enableRowSelection,
|
|
504
|
-
enableMultiRowSelection,
|
|
505
|
-
getRowId: getRowId ? (row) => String(getRowId(row)) : void 0
|
|
506
|
-
});
|
|
507
|
-
const dataIds = useMemo(() => {
|
|
508
|
-
if (!enableDragDrop || !getRowId) return [];
|
|
509
|
-
return data.map((item) => getRowId(item));
|
|
510
|
-
}, [
|
|
511
|
-
data,
|
|
512
|
-
enableDragDrop,
|
|
513
|
-
getRowId
|
|
514
|
-
]);
|
|
515
|
-
const handleDragEnd = useCallback((event) => {
|
|
516
|
-
const { active, over } = event;
|
|
517
|
-
if (!active || !over || active.id === over.id) return;
|
|
518
|
-
if (getRowId && (onReorder || onDragEnd)) {
|
|
519
|
-
if (onReorder) {
|
|
520
|
-
const oldIndex = items.findIndex((item_0) => getRowId(item_0) === active.id);
|
|
521
|
-
const newIndex = items.findIndex((item_1) => getRowId(item_1) === over.id);
|
|
522
|
-
if (oldIndex !== -1 && newIndex !== -1) {
|
|
523
|
-
const reorderedItems = [...items];
|
|
524
|
-
const [movedItem] = reorderedItems.splice(oldIndex, 1);
|
|
525
|
-
reorderedItems.splice(newIndex, 0, movedItem);
|
|
526
|
-
onReorder(reorderedItems);
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
onDragEnd?.(event);
|
|
530
|
-
}
|
|
531
|
-
}, [
|
|
532
|
-
onDragEnd,
|
|
533
|
-
onReorder,
|
|
534
|
-
items,
|
|
535
|
-
getRowId
|
|
536
|
-
]);
|
|
537
|
-
const selectedRows = table.getSelectedRowModel().rows;
|
|
538
|
-
const columnCount = table.getHeaderGroups()[0].headers.length;
|
|
539
|
-
const isAnyRowSelected = selectedRows.length > 0 && !!ActionHeader;
|
|
540
|
-
const hasOnClick = !!onRowClick || !!onDoubleClick;
|
|
541
|
-
const tableElement = /* @__PURE__ */ jsxs("table", {
|
|
542
|
-
className: clsx("w-full", className),
|
|
543
|
-
...listeners,
|
|
544
|
-
children: [/* @__PURE__ */ jsxs("thead", {
|
|
545
|
-
className: clsx(theadCva({})),
|
|
546
|
-
"data-is-sticky": isSticky || void 0,
|
|
547
|
-
children: [/* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("th", {
|
|
548
|
-
ref: stickyRef,
|
|
549
|
-
className: "-mt-px block"
|
|
550
|
-
}) }), table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx("tr", {
|
|
551
|
-
className: clsx(tableHeadRowCva({})),
|
|
552
|
-
children: headerGroup.headers.filter((header) => {
|
|
553
|
-
if (isAnyRowSelected && header.index > 0) return false;
|
|
554
|
-
return header.column.getIsVisible();
|
|
555
|
-
}).map((header_0, index) => {
|
|
556
|
-
const columnMeta = header_0.column.columnDef.meta ?? {};
|
|
557
|
-
return /* @__PURE__ */ jsx("th", {
|
|
558
|
-
colSpan: isAnyRowSelected ? columnCount : header_0.colSpan,
|
|
559
|
-
tabIndex: -1,
|
|
560
|
-
className: clsx(tableHeadDataCva({ hasRightBorder: index > 0 && showCellBorder }), columnMeta.headerClass, columnMeta.width),
|
|
561
|
-
children: isAnyRowSelected ? /* @__PURE__ */ jsx(ActionHeader, { table }) : /* @__PURE__ */ jsxs("button", {
|
|
562
|
-
type: "button",
|
|
563
|
-
"aria-label": "Sort column",
|
|
564
|
-
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),
|
|
565
|
-
onClick: header_0.column.getToggleSortingHandler(),
|
|
566
|
-
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 }), {
|
|
567
|
-
asc: /* @__PURE__ */ jsx(IconSlot, { icon: ChevronUp }),
|
|
568
|
-
desc: /* @__PURE__ */ jsx(IconSlot, { icon: ChevronDown })
|
|
569
|
-
}[header_0.column.getIsSorted()] ?? null]
|
|
570
|
-
})
|
|
571
|
-
}, header_0.id);
|
|
572
|
-
})
|
|
573
|
-
}, headerGroup.id))]
|
|
574
|
-
}), /* @__PURE__ */ jsx("tbody", {
|
|
575
|
-
ref,
|
|
576
|
-
className: "relative",
|
|
577
|
-
children: enableDragDrop ? /* @__PURE__ */ jsx(SortableRows, {
|
|
578
|
-
items: dataIds,
|
|
579
|
-
children: table.getRowModel().rows.map((row_0) => /* @__PURE__ */ jsx(DraggableRow, {
|
|
580
|
-
id: row_0.id,
|
|
581
|
-
className: clsx(tableRowCva({ ...props })),
|
|
582
|
-
isClickable: hasOnClick || row_0.getCanSelect(),
|
|
583
|
-
isSelected: row_0.getIsSelected(),
|
|
584
|
-
onClick: () => {
|
|
585
|
-
if (onRowClick) {
|
|
586
|
-
onRowClick(row_0.original);
|
|
587
|
-
return;
|
|
588
|
-
}
|
|
589
|
-
if (row_0.getCanSelect()) row_0.toggleSelected();
|
|
590
|
-
},
|
|
591
|
-
onDoubleClick: () => onDoubleClick?.(row_0.original),
|
|
592
|
-
children: row_0.getVisibleCells().map((cell, cellIndex) => {
|
|
593
|
-
const columnMeta_0 = cell.column.columnDef.meta ?? {};
|
|
594
|
-
return /* @__PURE__ */ jsx("td", {
|
|
595
|
-
tabIndex: -1,
|
|
596
|
-
className: clsx(tableDataCva({ hasRightBorder: cellIndex > 0 && showCellBorder }), columnMeta_0.cellClass, columnMeta_0.width),
|
|
597
|
-
children: renderCell(cell.column.columnDef.cell, CustomCellContext(cell.getContext()))
|
|
598
|
-
}, cell.id);
|
|
599
|
-
})
|
|
600
|
-
}, row_0.id))
|
|
601
|
-
}) : table.getRowModel().rows.map((row_1) => {
|
|
602
|
-
return /* @__PURE__ */ jsx("tr", {
|
|
603
|
-
className: clsx(tableRowCva({ ...props })),
|
|
604
|
-
onClick: () => {
|
|
605
|
-
if (onRowClick) {
|
|
606
|
-
onRowClick(row_1.original);
|
|
607
|
-
return;
|
|
608
|
-
}
|
|
609
|
-
if (row_1.getCanSelect()) row_1.toggleSelected();
|
|
610
|
-
},
|
|
611
|
-
onDoubleClick: () => onDoubleClick?.(row_1.original),
|
|
612
|
-
"data-clickable": hasOnClick || row_1.getCanSelect() || void 0,
|
|
613
|
-
"data-selected": row_1.getIsSelected() || void 0,
|
|
614
|
-
children: row_1.getVisibleCells().map((cell_0, cellIndex_0) => {
|
|
615
|
-
const columnMeta_1 = cell_0.column.columnDef.meta ?? {};
|
|
616
|
-
return /* @__PURE__ */ jsx("td", {
|
|
617
|
-
tabIndex: -1,
|
|
618
|
-
className: clsx(tableDataCva({ hasRightBorder: cellIndex_0 > 0 && showCellBorder }), columnMeta_1.cellClass, columnMeta_1.width),
|
|
619
|
-
children: renderCell(cell_0.column.columnDef.cell, CustomCellContext(cell_0.getContext()))
|
|
620
|
-
}, cell_0.id);
|
|
621
|
-
})
|
|
622
|
-
}, row_1.id);
|
|
623
|
-
})
|
|
624
|
-
})]
|
|
625
|
-
});
|
|
626
|
-
if (enableDragDrop) return /* @__PURE__ */ jsx(Suspense, {
|
|
627
|
-
fallback: null,
|
|
628
|
-
children: /* @__PURE__ */ jsx(DndProvider, {
|
|
629
|
-
onDragEnd: handleDragEnd,
|
|
630
|
-
children: tableElement
|
|
631
|
-
})
|
|
632
|
-
});
|
|
633
|
-
return tableElement;
|
|
634
|
-
};
|
|
635
|
-
//#endregion
|
|
636
|
-
export { CellText as i, useTableNav as n, HeaderText as r, Table as t };
|
package/dist/Tag-AHfV_XSf.d.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { t as StyleMergeUtils } from "./style-merge.util-zLimKwt6.js";
|
|
2
|
-
import { t as UIOverrides } from "./uiOverrides.context-DEp139He.js";
|
|
3
|
-
import { n as TypographyProps } from "./Typography-XljT9s02.js";
|
|
4
|
-
import { Ref } from "react";
|
|
5
|
-
import { ButtonProps } from "react-aria-components";
|
|
6
|
-
//#region src/components/text/Tag/tag.cva.d.ts
|
|
7
|
-
declare const tagDefinition: {
|
|
8
|
-
base: string[];
|
|
9
|
-
config: StyleMergeUtils.Config<{
|
|
10
|
-
readonly color: {
|
|
11
|
-
primary: ["bg-interactive-subtle-primary-background text-interactive-subtle-primary-foreground", "not-disabled:not-pressed:hover:bg-state-interactive-subtle-primary-background/hover not-disabled:not-pressed:hover:text-state-interactive-subtle-primary-foreground/hover", "not-disabled:pressed:bg-state-interactive-subtle-primary-background/pressed not-disabled:pressed:text-state-interactive-subtle-primary-foreground/pressed", "disabled:bg-state-interactive-subtle-primary-background/disabled disabled:text-state-interactive-subtle-primary-foreground/disabled", "focus-visible:outline-interactive-ring"];
|
|
12
|
-
secondary: ["bg-interactive-subtle-secondary-background text-interactive-subtle-secondary-foreground", "not-disabled:not-pressed:hover:bg-state-interactive-subtle-secondary-background/hover not-disabled:not-pressed:hover:text-state-interactive-subtle-secondary-foreground/hover", "not-disabled:pressed:bg-state-interactive-subtle-secondary-background/pressed not-disabled:pressed:text-state-interactive-subtle-secondary-foreground/pressed", "disabled:bg-state-interactive-subtle-secondary-background/disabled disabled:text-state-interactive-subtle-secondary-foreground/disabled", "focus-visible:outline-interactive-ring"];
|
|
13
|
-
success: ["bg-surface-success-inverted-base text-surface-success-base", "not-disabled:not-pressed:hover:bg-state-surface-success-inverted-base/hover not-disabled:not-pressed:hover:text-state-surface-success-base/hover", "not-disabled:pressed:bg-state-surface-success-inverted-base/pressed not-disabled:pressed:text-state-surface-success-base/pressed", "disabled:bg-state-surface-success-inverted-base/disabled disabled:text-state-surface-success-base/disabled", "focus-visible:outline-interactive-ring"];
|
|
14
|
-
warning: ["bg-surface-warning-inverted-base text-surface-warning-base", "not-disabled:not-pressed:hover:bg-state-surface-warning-inverted-base/hover not-disabled:not-pressed:hover:text-state-surface-warning-base/hover", "not-disabled:pressed:bg-state-surface-warning-inverted-base/pressed not-disabled:pressed:text-state-surface-warning-base/pressed", "disabled:bg-state-surface-warning-inverted-base/disabled disabled:text-state-surface-warning-base/disabled", "focus-visible:outline-interactive-ring"];
|
|
15
|
-
error: ["bg-interactive-subtle-destructive-background text-interactive-subtle-destructive-foreground", "not-disabled:not-pressed:hover:bg-state-interactive-subtle-destructive-background/hover not-disabled:not-pressed:hover:text-state-interactive-subtle-destructive-foreground/hover", "not-disabled:pressed:bg-state-interactive-subtle-destructive-background/pressed not-disabled:pressed:text-state-interactive-subtle-destructive-foreground/pressed", "disabled:bg-state-interactive-subtle-destructive-background/disabled disabled:text-state-interactive-subtle-destructive-foreground/disabled", "focus-visible:outline-interactive-ring"];
|
|
16
|
-
};
|
|
17
|
-
}>;
|
|
18
|
-
};
|
|
19
|
-
type TagConfig = NonNullable<typeof tagDefinition.config>;
|
|
20
|
-
interface TagVariantProps extends UIOverrides.VariantProps<TagConfig> {}
|
|
21
|
-
//#endregion
|
|
22
|
-
//#region src/components/text/Tag/Tag.d.ts
|
|
23
|
-
interface TagProps extends TagVariantProps {
|
|
24
|
-
className?: string;
|
|
25
|
-
children: string;
|
|
26
|
-
/** Preferred spelling. `dismissable` remains supported. */
|
|
27
|
-
dismissible?: boolean;
|
|
28
|
-
dismissable?: boolean;
|
|
29
|
-
isDisabled?: boolean;
|
|
30
|
-
disabled?: boolean;
|
|
31
|
-
contentRef?: Ref<HTMLElement>;
|
|
32
|
-
textSize?: TypographyProps["size"];
|
|
33
|
-
/** Preferred callback name. */
|
|
34
|
-
onRemove?: () => void;
|
|
35
|
-
onDismiss?: () => void;
|
|
36
|
-
/** Props applied to the actual dismiss button, when one is rendered. */
|
|
37
|
-
dismissButtonProps?: Omit<ButtonProps, "children" | "onPress">;
|
|
38
|
-
excludeFromTabOrder?: boolean;
|
|
39
|
-
/** Compatibility callback for the historical button-like prop surface. */
|
|
40
|
-
onPress?: ButtonProps["onPress"];
|
|
41
|
-
}
|
|
42
|
-
declare const Tag: ({ className, children, dismissible, dismissable, isDisabled, disabled, onRemove, onDismiss, dismissButtonProps, excludeFromTabOrder, onPress, contentRef, textSize: textSizeProp, ...appearanceProps }: TagProps) => import("react").JSX.Element;
|
|
43
|
-
//#endregion
|
|
44
|
-
export { tagDefinition as i, TagProps as n, TagVariantProps as r, Tag as t };
|