@42-central/ui-react 0.18.1 → 0.19.0
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/dist/{chunk-YXE4B6X3.js → chunk-2NNZHVKD.js} +3 -3
- package/dist/{chunk-YXE4B6X3.js.map → chunk-2NNZHVKD.js.map} +1 -1
- package/dist/{chunk-5JHDSVEZ.js → chunk-4NNGTNPV.js} +10 -8
- package/dist/chunk-4NNGTNPV.js.map +1 -0
- package/dist/{chunk-7NZSTCJO.js → chunk-57BTVRRB.js} +4 -9
- package/dist/chunk-57BTVRRB.js.map +1 -0
- package/dist/{chunk-S2HWWR2H.js → chunk-64T6Z7BA.js} +3 -3
- package/dist/{chunk-S2HWWR2H.js.map → chunk-64T6Z7BA.js.map} +1 -1
- package/dist/{chunk-MI2WZRK3.js → chunk-A6MYJTJI.js} +4 -4
- package/dist/{chunk-MI2WZRK3.js.map → chunk-A6MYJTJI.js.map} +1 -1
- package/dist/{chunk-RQL7FVCS.js → chunk-BTFBBNRW.js} +11 -6
- package/dist/chunk-BTFBBNRW.js.map +1 -0
- package/dist/{chunk-OWG4BCQR.js → chunk-CYWMES5P.js} +4 -4
- package/dist/{chunk-OWG4BCQR.js.map → chunk-CYWMES5P.js.map} +1 -1
- package/dist/{chunk-YBJB7FGE.js → chunk-CZEKZ5HR.js} +6 -6
- package/dist/chunk-CZEKZ5HR.js.map +1 -0
- package/dist/{chunk-HAQJQFE6.js → chunk-DBTJEBMO.js} +11 -4
- package/dist/{chunk-HAQJQFE6.js.map → chunk-DBTJEBMO.js.map} +1 -1
- package/dist/{chunk-AE7QTLJ5.js → chunk-FAOBC4IS.js} +4 -4
- package/dist/{chunk-AE7QTLJ5.js.map → chunk-FAOBC4IS.js.map} +1 -1
- package/dist/{chunk-NF5JM2YO.js → chunk-FOMR74VE.js} +3 -3
- package/dist/{chunk-NF5JM2YO.js.map → chunk-FOMR74VE.js.map} +1 -1
- package/dist/{chunk-FZIHZT5R.js → chunk-GCGX4FEF.js} +16 -10
- package/dist/chunk-GCGX4FEF.js.map +1 -0
- package/dist/{chunk-B2YJKRNQ.js → chunk-HCYULRWT.js} +13 -9
- package/dist/chunk-HCYULRWT.js.map +1 -0
- package/dist/{chunk-B2LCHXUB.js → chunk-INJUILCN.js} +9 -4
- package/dist/chunk-INJUILCN.js.map +1 -0
- package/dist/{chunk-ZDXQ64A7.js → chunk-K5UWVH6P.js} +5 -5
- package/dist/{chunk-ZDXQ64A7.js.map → chunk-K5UWVH6P.js.map} +1 -1
- package/dist/{chunk-6GDMSENK.js → chunk-LM6F6DLR.js} +3 -24
- package/dist/chunk-LM6F6DLR.js.map +1 -0
- package/dist/{chunk-KHMFNH3X.js → chunk-MQO42HZL.js} +7 -7
- package/dist/chunk-MQO42HZL.js.map +1 -0
- package/dist/chunk-OC7I2CTA.js +8 -0
- package/dist/chunk-OC7I2CTA.js.map +1 -0
- package/dist/{chunk-O23Y5ML4.js → chunk-OGJFDNIS.js} +249 -231
- package/dist/chunk-OGJFDNIS.js.map +1 -0
- package/dist/{chunk-6OLTJYSX.js → chunk-PINENGML.js} +12 -5
- package/dist/chunk-PINENGML.js.map +1 -0
- package/dist/{chunk-NSDM3FEB.js → chunk-PS2PZFXH.js} +5 -3
- package/dist/chunk-PS2PZFXH.js.map +1 -0
- package/dist/{chunk-RAUOFTUH.js → chunk-QIDAXFKK.js} +4 -4
- package/dist/{chunk-RAUOFTUH.js.map → chunk-QIDAXFKK.js.map} +1 -1
- package/dist/{chunk-S7N4LGLZ.js → chunk-RIP5G47F.js} +4 -4
- package/dist/{chunk-S7N4LGLZ.js.map → chunk-RIP5G47F.js.map} +1 -1
- package/dist/{chunk-Z2Z5EXVT.js → chunk-RKYXG6X7.js} +3 -3
- package/dist/{chunk-Z2Z5EXVT.js.map → chunk-RKYXG6X7.js.map} +1 -1
- package/dist/{chunk-WQN64ZHG.js → chunk-SVKU3GUN.js} +10 -6
- package/dist/chunk-SVKU3GUN.js.map +1 -0
- package/dist/{chunk-FHG54IT5.js → chunk-TBTSEPGP.js} +13 -4
- package/dist/chunk-TBTSEPGP.js.map +1 -0
- package/dist/{chunk-HT5JAHR3.js → chunk-UJZIF2BA.js} +20 -9
- package/dist/chunk-UJZIF2BA.js.map +1 -0
- package/dist/{chunk-UHNRAI6V.js → chunk-VZBUQNLX.js} +68 -29
- package/dist/chunk-VZBUQNLX.js.map +1 -0
- package/dist/{chunk-JITF6I7N.js → chunk-WJOHNCYY.js} +11 -4
- package/dist/{chunk-JITF6I7N.js.map → chunk-WJOHNCYY.js.map} +1 -1
- package/dist/{chunk-EBREIC3L.js → chunk-YQHOKMSV.js} +26 -8
- package/dist/chunk-YQHOKMSV.js.map +1 -0
- package/dist/{chunk-WHKKN3ZK.js → chunk-YW6Q6ERX.js} +10 -8
- package/dist/chunk-YW6Q6ERX.js.map +1 -0
- package/dist/{chunk-PH354ECN.js → chunk-Z43YWH4R.js} +13 -4
- package/dist/chunk-Z43YWH4R.js.map +1 -0
- package/dist/{chunk-5OQLFX47.js → chunk-Z6RPMRFH.js} +3 -3
- package/dist/{chunk-5OQLFX47.js.map → chunk-Z6RPMRFH.js.map} +1 -1
- package/dist/{chunk-TCWYBVIL.js → chunk-ZB5VMGKB.js} +10 -7
- package/dist/chunk-ZB5VMGKB.js.map +1 -0
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/action-icon/index.js +3 -3
- package/dist/components/alert/index.js +3 -3
- package/dist/components/app-shell/index.js +4 -4
- package/dist/components/autocomplete/autocomplete.d.ts +8 -1
- package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/index.d.ts +1 -1
- package/dist/components/autocomplete/index.d.ts.map +1 -1
- package/dist/components/autocomplete/index.js +10 -7
- package/dist/components/autocomplete/index.js.map +1 -1
- package/dist/components/badge/index.js +1 -1
- package/dist/components/button/index.js +3 -3
- package/dist/components/button-multi-select/index.js +5 -5
- package/dist/components/button-select/index.js +5 -5
- package/dist/components/calendar/calendar-zone-sync.d.ts +41 -0
- package/dist/components/calendar/calendar-zone-sync.d.ts.map +1 -0
- package/dist/components/calendar/calendar.d.ts +6 -5
- package/dist/components/calendar/calendar.d.ts.map +1 -1
- package/dist/components/calendar/index.js +8 -5
- package/dist/components/chart/chart.d.ts +17 -10
- package/dist/components/chart/chart.d.ts.map +1 -1
- package/dist/components/chart/index.js +50 -7
- package/dist/components/chart/index.js.map +1 -1
- package/dist/components/chart/styles.css +100 -0
- package/dist/components/checkbox/index.js +4 -4
- package/dist/components/choice-card-group/index.d.ts.map +1 -1
- package/dist/components/choice-card-group/index.js +4 -3
- package/dist/components/circular-progress/circular-progress.d.ts.map +1 -1
- package/dist/components/circular-progress/index.js.map +1 -1
- package/dist/components/clipboard/clipboard.d.ts.map +1 -1
- package/dist/components/clipboard/copy.d.ts.map +1 -1
- package/dist/components/clipboard/index.js +5 -5
- package/dist/components/clipboard/index.js.map +1 -1
- package/dist/components/code-block/chrome.js +4 -4
- package/dist/components/code-block/index.js +5 -5
- package/dist/components/combobox/combobox.d.ts +20 -1
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/index.d.ts +1 -1
- package/dist/components/combobox/index.d.ts.map +1 -1
- package/dist/components/combobox/index.js +4 -4
- package/dist/components/combobox-list/combobox-list.d.ts +8 -1
- package/dist/components/combobox-list/combobox-list.d.ts.map +1 -1
- package/dist/components/combobox-list/index.d.ts +1 -1
- package/dist/components/combobox-list/index.d.ts.map +1 -1
- package/dist/components/combobox-list/index.js +5 -5
- package/dist/components/data-table/data-table-filter/data-table-date-filter.d.ts.map +1 -1
- package/dist/components/data-table/data-table-filter/data-table-number-filter.d.ts +4 -1
- package/dist/components/data-table/data-table-filter/data-table-number-filter.d.ts.map +1 -1
- package/dist/components/data-table/data-table-filter/data-table-select-filter.d.ts +4 -1
- package/dist/components/data-table/data-table-filter/data-table-select-filter.d.ts.map +1 -1
- package/dist/components/data-table/data-table-filter/index.d.ts +5 -1
- package/dist/components/data-table/data-table-filter/index.d.ts.map +1 -1
- package/dist/components/data-table/data-table-header-cell.d.ts +11 -15
- package/dist/components/data-table/data-table-header-cell.d.ts.map +1 -1
- package/dist/components/data-table/data-table-meta.d.ts +2 -2
- package/dist/components/data-table/data-table-meta.d.ts.map +1 -1
- package/dist/components/data-table/data-table-pagination.d.ts +3 -0
- package/dist/components/data-table/data-table-pagination.d.ts.map +1 -1
- package/dist/components/data-table/data-table-stack.d.ts +6 -3
- package/dist/components/data-table/data-table-stack.d.ts.map +1 -1
- package/dist/components/data-table/data-table-toolbar.d.ts +3 -1
- package/dist/components/data-table/data-table-toolbar.d.ts.map +1 -1
- package/dist/components/data-table/data-table-translations.d.ts +68 -0
- package/dist/components/data-table/data-table-translations.d.ts.map +1 -0
- package/dist/components/data-table/data-table.d.ts +5 -8
- package/dist/components/data-table/data-table.d.ts.map +1 -1
- package/dist/components/data-table/index.d.ts +2 -1
- package/dist/components/data-table/index.d.ts.map +1 -1
- package/dist/components/data-table/index.js +206 -84
- package/dist/components/data-table/index.js.map +1 -1
- package/dist/components/date-picker/date-picker.d.ts +13 -9
- package/dist/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/date-picker/index.js +16 -15
- package/dist/components/date-picker/index.js.map +1 -1
- package/dist/components/drawer/drawer.d.ts +9 -1
- package/dist/components/drawer/drawer.d.ts.map +1 -1
- package/dist/components/drawer/index.d.ts +1 -1
- package/dist/components/drawer/index.d.ts.map +1 -1
- package/dist/components/drawer/index.js +4 -4
- package/dist/components/field/field.d.ts +9 -2
- package/dist/components/field/field.d.ts.map +1 -1
- package/dist/components/field/index.js +1 -1
- package/dist/components/file-upload/file-upload.d.ts +13 -2
- package/dist/components/file-upload/file-upload.d.ts.map +1 -1
- package/dist/components/file-upload/index.d.ts +1 -1
- package/dist/components/file-upload/index.d.ts.map +1 -1
- package/dist/components/file-upload/index.js +16 -7
- package/dist/components/file-upload/index.js.map +1 -1
- package/dist/components/hover-card/index.js +1 -1
- package/dist/components/input/index.js +2 -2
- package/dist/components/kbd/index.js +30 -15
- package/dist/components/kbd/index.js.map +1 -1
- package/dist/components/kbd/kbd.d.ts.map +1 -1
- package/dist/components/menu/index.js +2 -2
- package/dist/components/modal/index.d.ts +1 -1
- package/dist/components/modal/index.d.ts.map +1 -1
- package/dist/components/modal/index.js +4 -4
- package/dist/components/modal/modal.d.ts +9 -1
- package/dist/components/modal/modal.d.ts.map +1 -1
- package/dist/components/multi-combobox-list/index.d.ts +1 -1
- package/dist/components/multi-combobox-list/index.d.ts.map +1 -1
- package/dist/components/multi-combobox-list/index.js +7 -5
- package/dist/components/multi-combobox-list/multi-combobox-list.d.ts +8 -1
- package/dist/components/multi-combobox-list/multi-combobox-list.d.ts.map +1 -1
- package/dist/components/multi-select/index.d.ts +1 -1
- package/dist/components/multi-select/index.d.ts.map +1 -1
- package/dist/components/multi-select/index.js +20 -9
- package/dist/components/multi-select/index.js.map +1 -1
- package/dist/components/multi-select/multi-select.d.ts +11 -1
- package/dist/components/multi-select/multi-select.d.ts.map +1 -1
- package/dist/components/nav-link/index.d.ts +1 -1
- package/dist/components/nav-link/index.d.ts.map +1 -1
- package/dist/components/nav-link/index.js +2 -2
- package/dist/components/nav-link/nav-link.d.ts +12 -0
- package/dist/components/nav-link/nav-link.d.ts.map +1 -1
- package/dist/components/nav-link/navigation.d.ts +3 -1
- package/dist/components/nav-link/navigation.d.ts.map +1 -1
- package/dist/components/nav-link/tanstack.js +2 -2
- package/dist/components/notification/create-notifier.d.ts +12 -1
- package/dist/components/notification/create-notifier.d.ts.map +1 -1
- package/dist/components/notification/index.d.ts +2 -2
- package/dist/components/notification/index.d.ts.map +1 -1
- package/dist/components/notification/index.js +9 -6
- package/dist/components/notification/index.js.map +1 -1
- package/dist/components/notification/notification.d.ts +14 -1
- package/dist/components/notification/notification.d.ts.map +1 -1
- package/dist/components/number-input/index.d.ts +1 -1
- package/dist/components/number-input/index.d.ts.map +1 -1
- package/dist/components/number-input/index.js +4 -4
- package/dist/components/number-input/number-input.d.ts +20 -2
- package/dist/components/number-input/number-input.d.ts.map +1 -1
- package/dist/components/overlays/index.js +6 -6
- package/dist/components/password-input/index.d.ts +1 -1
- package/dist/components/password-input/index.d.ts.map +1 -1
- package/dist/components/password-input/index.js +68 -7
- package/dist/components/password-input/index.js.map +1 -1
- package/dist/components/password-input/password-input.d.ts +45 -6
- package/dist/components/password-input/password-input.d.ts.map +1 -1
- package/dist/components/pill/index.js +2 -2
- package/dist/components/pills-input/index.js +5 -5
- package/dist/components/pin-input/index.js +2 -2
- package/dist/components/popover/index.js +1 -1
- package/dist/components/popover/popover.d.ts +0 -10
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/progress/index.js.map +1 -1
- package/dist/components/progress/progress.d.ts.map +1 -1
- package/dist/components/radio-group/index.js +3 -3
- package/dist/components/rating/index.js +2 -2
- package/dist/components/rating/index.js.map +1 -1
- package/dist/components/rating/rating.d.ts.map +1 -1
- package/dist/components/schedule/index.js +62 -49
- package/dist/components/schedule/index.js.map +1 -1
- package/dist/components/schedule/now-cursor-line.d.ts +10 -5
- package/dist/components/schedule/now-cursor-line.d.ts.map +1 -1
- package/dist/components/schedule/schedule-dates.d.ts +11 -26
- package/dist/components/schedule/schedule-dates.d.ts.map +1 -1
- package/dist/components/schedule/schedule-event-chip.d.ts +4 -1
- package/dist/components/schedule/schedule-event-chip.d.ts.map +1 -1
- package/dist/components/schedule/schedule-event-details.d.ts +3 -2
- package/dist/components/schedule/schedule-event-details.d.ts.map +1 -1
- package/dist/components/schedule/schedule-geometry.d.ts +20 -21
- package/dist/components/schedule/schedule-geometry.d.ts.map +1 -1
- package/dist/components/schedule/schedule-grid-gesture.d.ts +5 -9
- package/dist/components/schedule/schedule-grid-gesture.d.ts.map +1 -1
- package/dist/components/schedule/schedule-segments.d.ts +2 -3
- package/dist/components/schedule/schedule-segments.d.ts.map +1 -1
- package/dist/components/schedule/schedule-timed-grid.d.ts.map +1 -1
- package/dist/components/schedule/use-event-resize.d.ts.map +1 -1
- package/dist/components/segment-group/index.js +4 -3
- package/dist/components/segment-group/segment-group.d.ts +3 -2
- package/dist/components/segment-group/segment-group.d.ts.map +1 -1
- package/dist/components/select/index.d.ts +1 -1
- package/dist/components/select/index.d.ts.map +1 -1
- package/dist/components/select/index.js +6 -4
- package/dist/components/select/select.d.ts +12 -2
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/slider/index.js +2 -2
- package/dist/components/spinner/index.js +1 -1
- package/dist/components/spinner/spinner.d.ts.map +1 -1
- package/dist/components/switch/index.js +3 -3
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/switch/switch.d.ts +2 -0
- package/dist/components/switch/switch.d.ts.map +1 -1
- package/dist/components/table/index.js +1 -1
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/tabs/index.js +4 -3
- package/dist/components/tabs/tabs.d.ts +3 -1
- package/dist/components/tabs/tabs.d.ts.map +1 -1
- package/dist/components/tags-input/index.d.ts +1 -1
- package/dist/components/tags-input/index.d.ts.map +1 -1
- package/dist/components/tags-input/index.js +9 -7
- package/dist/components/tags-input/index.js.map +1 -1
- package/dist/components/tags-input/tags-input.d.ts +9 -2
- package/dist/components/tags-input/tags-input.d.ts.map +1 -1
- package/dist/components/text-input/index.js +2 -2
- package/dist/components/textarea/index.js +2 -2
- package/dist/components/theme-icon/index.js +2 -2
- package/dist/components/theme-icon/theme-icon.d.ts.map +1 -1
- package/dist/components/time-input/index.js +24 -8
- package/dist/components/time-input/index.js.map +1 -1
- package/dist/components/time-input/time-input.d.ts.map +1 -1
- package/dist/components/time-input/time-row.d.ts +16 -3
- package/dist/components/time-input/time-row.d.ts.map +1 -1
- package/dist/components/timeline/index.js +6 -3
- package/dist/components/timeline/index.js.map +1 -1
- package/dist/components/timeline/timeline.d.ts.map +1 -1
- package/dist/components/tooltip/index.js +2 -2
- package/dist/components/tree-multi-select/index.d.ts +1 -1
- package/dist/components/tree-multi-select/index.d.ts.map +1 -1
- package/dist/components/tree-multi-select/index.js +62 -44
- package/dist/components/tree-multi-select/index.js.map +1 -1
- package/dist/components/tree-multi-select/tree-multi-select.d.ts +10 -1
- package/dist/components/tree-multi-select/tree-multi-select.d.ts.map +1 -1
- package/dist/components/tree-select/index.d.ts +1 -1
- package/dist/components/tree-select/index.d.ts.map +1 -1
- package/dist/components/tree-select/index.js +45 -15
- package/dist/components/tree-select/index.js.map +1 -1
- package/dist/components/tree-select/tree-select.d.ts +10 -1
- package/dist/components/tree-select/tree-select.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/date-value.d.ts +14 -1
- package/dist/lib/date-value.d.ts.map +1 -1
- package/dist/lib/focus-styles.d.ts +13 -5
- package/dist/lib/focus-styles.d.ts.map +1 -1
- package/dist/theme.css +1 -2
- package/package.json +1 -1
- package/src/components/autocomplete/autocomplete.test.tsx +32 -0
- package/src/components/autocomplete/autocomplete.tsx +17 -5
- package/src/components/autocomplete/index.ts +5 -1
- package/src/components/button/button.test.tsx +6 -0
- package/src/components/calendar/calendar-zone-sync.tsx +79 -0
- package/src/components/calendar/calendar.test.tsx +134 -14
- package/src/components/calendar/calendar.tsx +36 -22
- package/src/components/chart/chart.test.tsx +115 -8
- package/src/components/chart/chart.tsx +115 -25
- package/src/components/chart/styles.css +100 -0
- package/src/components/choice-card-group/index.ts +2 -0
- package/src/components/circular-progress/circular-progress.tsx +2 -0
- package/src/components/clipboard/clipboard.test.tsx +54 -22
- package/src/components/clipboard/clipboard.tsx +2 -0
- package/src/components/clipboard/copy.tsx +2 -0
- package/src/components/clipboard/index.ts +3 -3
- package/src/components/combobox/combobox.test.tsx +22 -0
- package/src/components/combobox/combobox.tsx +20 -0
- package/src/components/combobox/index.ts +1 -0
- package/src/components/combobox-list/combobox-list.test.tsx +19 -0
- package/src/components/combobox-list/combobox-list.tsx +16 -2
- package/src/components/combobox-list/index.ts +5 -1
- package/src/components/data-table/data-table-filter/data-table-date-filter.tsx +5 -4
- package/src/components/data-table/data-table-filter/data-table-number-filter.tsx +16 -2
- package/src/components/data-table/data-table-filter/data-table-select-filter.tsx +9 -1
- package/src/components/data-table/data-table-filter/index.tsx +15 -1
- package/src/components/data-table/data-table-filter.test.tsx +33 -0
- package/src/components/data-table/data-table-header-cell.tsx +37 -22
- package/src/components/data-table/data-table-meta.ts +2 -2
- package/src/components/data-table/data-table-pagination.tsx +6 -0
- package/src/components/data-table/data-table-stack.tsx +31 -17
- package/src/components/data-table/data-table-toolbar.tsx +4 -1
- package/src/components/data-table/data-table-translations.ts +105 -0
- package/src/components/data-table/data-table.test.tsx +212 -0
- package/src/components/data-table/data-table.tsx +92 -23
- package/src/components/data-table/index.ts +9 -1
- package/src/components/date-picker/date-picker.test.tsx +197 -5
- package/src/components/date-picker/date-picker.tsx +42 -16
- package/src/components/drawer/drawer.tsx +14 -1
- package/src/components/drawer/index.ts +1 -0
- package/src/components/field/field.tsx +29 -3
- package/src/components/file-upload/file-upload.test.tsx +21 -0
- package/src/components/file-upload/file-upload.tsx +26 -3
- package/src/components/file-upload/index.ts +1 -1
- package/src/components/kbd/kbd.test.tsx +31 -0
- package/src/components/kbd/kbd.tsx +29 -14
- package/src/components/modal/index.ts +1 -0
- package/src/components/modal/modal-translations.test.tsx +27 -0
- package/src/components/modal/modal.tsx +14 -1
- package/src/components/multi-combobox-list/index.ts +5 -1
- package/src/components/multi-combobox-list/multi-combobox-list.test.tsx +19 -0
- package/src/components/multi-combobox-list/multi-combobox-list.tsx +26 -4
- package/src/components/multi-select/index.ts +1 -1
- package/src/components/multi-select/multi-select.test.tsx +38 -0
- package/src/components/multi-select/multi-select.tsx +28 -4
- package/src/components/nav-link/index.ts +6 -1
- package/src/components/nav-link/nav-link.test.tsx +16 -0
- package/src/components/nav-link/nav-link.tsx +19 -1
- package/src/components/nav-link/navigation.test.tsx +18 -0
- package/src/components/nav-link/navigation.tsx +8 -4
- package/src/components/notification/create-notifier.tsx +20 -4
- package/src/components/notification/index.ts +7 -1
- package/src/components/notification/notification.test.tsx +49 -0
- package/src/components/notification/notification.tsx +39 -5
- package/src/components/number-input/index.ts +1 -1
- package/src/components/number-input/number-input.test.tsx +37 -0
- package/src/components/number-input/number-input.tsx +33 -4
- package/src/components/password-input/index.ts +5 -1
- package/src/components/password-input/password-input.test.tsx +201 -4
- package/src/components/password-input/password-input.tsx +162 -13
- package/src/components/popover/popover.tsx +0 -29
- package/src/components/progress/index.ts +3 -3
- package/src/components/progress/progress.tsx +2 -0
- package/src/components/rating/rating.tsx +2 -0
- package/src/components/schedule/now-cursor-line.test.tsx +74 -27
- package/src/components/schedule/now-cursor-line.tsx +40 -17
- package/src/components/schedule/schedule-agenda-view.test.tsx +1 -1
- package/src/components/schedule/schedule-dates.test.ts +19 -0
- package/src/components/schedule/schedule-dates.ts +16 -30
- package/src/components/schedule/schedule-details-popover.test.tsx +77 -6
- package/src/components/schedule/schedule-event-chip.tsx +17 -6
- package/src/components/schedule/schedule-event-details.test.tsx +38 -0
- package/src/components/schedule/schedule-event-details.tsx +7 -5
- package/src/components/schedule/schedule-geometry.test.ts +21 -18
- package/src/components/schedule/schedule-geometry.ts +37 -24
- package/src/components/schedule/schedule-grid-gesture.ts +5 -9
- package/src/components/schedule/schedule-segments.ts +2 -3
- package/src/components/schedule/schedule-timed-grid.tsx +43 -20
- package/src/components/schedule/schedule.test.tsx +34 -11
- package/src/components/schedule/use-event-resize.ts +6 -13
- package/src/components/segment-group/segment-group.test.tsx +23 -0
- package/src/components/segment-group/segment-group.tsx +13 -7
- package/src/components/select/index.ts +1 -1
- package/src/components/select/select.test.tsx +32 -0
- package/src/components/select/select.tsx +15 -1
- package/src/components/spinner/spinner.test.tsx +26 -0
- package/src/components/spinner/spinner.tsx +4 -1
- package/src/components/switch/switch.test.tsx +12 -0
- package/src/components/switch/switch.tsx +3 -1
- package/src/components/table/table.test.tsx +13 -0
- package/src/components/table/table.tsx +9 -5
- package/src/components/tabs/tabs.test.tsx +11 -0
- package/src/components/tabs/tabs.tsx +6 -4
- package/src/components/tags-input/index.ts +1 -1
- package/src/components/tags-input/tags-input.test.tsx +28 -0
- package/src/components/tags-input/tags-input.tsx +17 -1
- package/src/components/theme-icon/theme-icon.tsx +8 -3
- package/src/components/time-input/time-input.test.tsx +75 -0
- package/src/components/time-input/time-input.tsx +27 -3
- package/src/components/time-input/time-row.tsx +27 -3
- package/src/components/timeline/timeline.tsx +6 -3
- package/src/components/tree-multi-select/index.ts +5 -1
- package/src/components/tree-multi-select/tree-multi-select.test.tsx +72 -0
- package/src/components/tree-multi-select/tree-multi-select.tsx +156 -115
- package/src/components/tree-select/index.ts +1 -1
- package/src/components/tree-select/tree-select.test.tsx +69 -0
- package/src/components/tree-select/tree-select.tsx +128 -74
- package/src/lib/date-value.test.ts +19 -0
- package/src/lib/date-value.ts +21 -5
- package/src/lib/focus-styles.test.ts +21 -2
- package/src/lib/focus-styles.ts +24 -5
- package/src/theme.css +1 -2
- package/src/use-client-barrels.test.ts +80 -0
- package/dist/chunk-5JHDSVEZ.js.map +0 -1
- package/dist/chunk-6GDMSENK.js.map +0 -1
- package/dist/chunk-6OLTJYSX.js.map +0 -1
- package/dist/chunk-7NZSTCJO.js.map +0 -1
- package/dist/chunk-B2LCHXUB.js.map +0 -1
- package/dist/chunk-B2YJKRNQ.js.map +0 -1
- package/dist/chunk-EBREIC3L.js.map +0 -1
- package/dist/chunk-FHG54IT5.js.map +0 -1
- package/dist/chunk-FZIHZT5R.js.map +0 -1
- package/dist/chunk-HT5JAHR3.js.map +0 -1
- package/dist/chunk-KHMFNH3X.js.map +0 -1
- package/dist/chunk-NSDM3FEB.js.map +0 -1
- package/dist/chunk-O23Y5ML4.js.map +0 -1
- package/dist/chunk-PH354ECN.js.map +0 -1
- package/dist/chunk-RQL7FVCS.js.map +0 -1
- package/dist/chunk-TCWYBVIL.js.map +0 -1
- package/dist/chunk-UHNRAI6V.js.map +0 -1
- package/dist/chunk-WHKKN3ZK.js.map +0 -1
- package/dist/chunk-WQN64ZHG.js.map +0 -1
- package/dist/chunk-YBJB7FGE.js.map +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { fireEvent, render, screen, waitFor, within } from "@testing-library/react"
|
|
2
|
+
import { createPortal } from "react-dom"
|
|
2
3
|
import { describe, expect, it, vi } from "vitest"
|
|
3
4
|
import { DATA_TABLE_DEFAULT_EMPTY, DataTable } from "./data-table"
|
|
4
5
|
import { createColumnHelper } from "./data-table-features"
|
|
@@ -188,6 +189,96 @@ describe("DataTable", () => {
|
|
|
188
189
|
expect(onRowClick).not.toHaveBeenCalled()
|
|
189
190
|
})
|
|
190
191
|
|
|
192
|
+
it("fires onRowClick when an ancestor of the table carries a role (#304)", () => {
|
|
193
|
+
const onRowClick = vi.fn()
|
|
194
|
+
render(
|
|
195
|
+
<div role="tabpanel">
|
|
196
|
+
<DataTable columns={columns} data={USERS} onRowClick={onRowClick} />
|
|
197
|
+
</div>,
|
|
198
|
+
)
|
|
199
|
+
fireEvent.click(screen.getByText("Ada"))
|
|
200
|
+
expect(onRowClick).toHaveBeenCalledWith(USERS[0])
|
|
201
|
+
})
|
|
202
|
+
|
|
203
|
+
it("fires onRowClick through a non-widget role inside the row", () => {
|
|
204
|
+
const onRowClick = vi.fn()
|
|
205
|
+
const c = createColumnHelper<User>()
|
|
206
|
+
const cols = [
|
|
207
|
+
c.accessor("name", { header: "Name" }),
|
|
208
|
+
c.display({ id: "status", cell: () => <span role="img">●</span> }),
|
|
209
|
+
]
|
|
210
|
+
render(<DataTable columns={cols} data={USERS} onRowClick={onRowClick} />)
|
|
211
|
+
fireEvent.click(screen.getAllByRole("img")[0] as HTMLElement)
|
|
212
|
+
expect(onRowClick).toHaveBeenCalledWith(USERS[0])
|
|
213
|
+
})
|
|
214
|
+
|
|
215
|
+
it("still ignores a nested button when an ancestor carries a role", () => {
|
|
216
|
+
const onRowClick = vi.fn()
|
|
217
|
+
const c = createColumnHelper<User>()
|
|
218
|
+
const cols = [
|
|
219
|
+
c.accessor("name", { header: "Name" }),
|
|
220
|
+
c.display({ id: "actions", cell: () => <button type="button">Edit</button> }),
|
|
221
|
+
]
|
|
222
|
+
render(
|
|
223
|
+
<div role="tabpanel">
|
|
224
|
+
<DataTable columns={cols} data={USERS} onRowClick={onRowClick} />
|
|
225
|
+
</div>,
|
|
226
|
+
)
|
|
227
|
+
fireEvent.click(screen.getAllByText("Edit")[0] as HTMLElement)
|
|
228
|
+
expect(onRowClick).not.toHaveBeenCalled()
|
|
229
|
+
})
|
|
230
|
+
|
|
231
|
+
it("ignores clicks on content a cell portals out of the row", () => {
|
|
232
|
+
const onRowClick = vi.fn()
|
|
233
|
+
const c = createColumnHelper<User>()
|
|
234
|
+
const cols = [
|
|
235
|
+
c.accessor("name", { header: "Name" }),
|
|
236
|
+
c.display({
|
|
237
|
+
id: "menu",
|
|
238
|
+
cell: ({ row }) => createPortal(<p>Menu of {row.original.name}</p>, document.body),
|
|
239
|
+
}),
|
|
240
|
+
]
|
|
241
|
+
render(<DataTable columns={cols} data={USERS} onRowClick={onRowClick} />)
|
|
242
|
+
fireEvent.click(screen.getByText("Menu of Ada"))
|
|
243
|
+
expect(onRowClick).not.toHaveBeenCalled()
|
|
244
|
+
})
|
|
245
|
+
|
|
246
|
+
it("fires onRowClick from a stacked card when an ancestor carries a role", () => {
|
|
247
|
+
const onRowClick = vi.fn()
|
|
248
|
+
render(
|
|
249
|
+
<div role="tabpanel">
|
|
250
|
+
<DataTable columns={columns} data={USERS} responsive="stack" onRowClick={onRowClick} />
|
|
251
|
+
</div>,
|
|
252
|
+
)
|
|
253
|
+
const cardCell = screen.getAllByText("Ada").find((el) => el.closest("tr") == null)
|
|
254
|
+
fireEvent.click(cardCell as HTMLElement)
|
|
255
|
+
expect(onRowClick).toHaveBeenCalledWith(USERS[0])
|
|
256
|
+
})
|
|
257
|
+
|
|
258
|
+
it("ignores the click that ends a text selection inside the row", () => {
|
|
259
|
+
const onRowClick = vi.fn()
|
|
260
|
+
render(<DataTable columns={columns} data={USERS} onRowClick={onRowClick} />)
|
|
261
|
+
const cell = screen.getByText("Ada")
|
|
262
|
+
document.getSelection()?.selectAllChildren(cell)
|
|
263
|
+
fireEvent.click(cell)
|
|
264
|
+
document.getSelection()?.removeAllRanges()
|
|
265
|
+
expect(onRowClick).not.toHaveBeenCalled()
|
|
266
|
+
})
|
|
267
|
+
|
|
268
|
+
it("still fires onRowClick while text outside the row is selected", () => {
|
|
269
|
+
const onRowClick = vi.fn()
|
|
270
|
+
render(
|
|
271
|
+
<>
|
|
272
|
+
<p>Elsewhere</p>
|
|
273
|
+
<DataTable columns={columns} data={USERS} onRowClick={onRowClick} />
|
|
274
|
+
</>,
|
|
275
|
+
)
|
|
276
|
+
document.getSelection()?.selectAllChildren(screen.getByText("Elsewhere"))
|
|
277
|
+
fireEvent.click(screen.getByText("Ada"))
|
|
278
|
+
document.getSelection()?.removeAllRanges()
|
|
279
|
+
expect(onRowClick).toHaveBeenCalledWith(USERS[0])
|
|
280
|
+
})
|
|
281
|
+
|
|
191
282
|
it("forwards size/striped/sticky to the underlying Table", () => {
|
|
192
283
|
const { container } = render(
|
|
193
284
|
<DataTable columns={columns} data={USERS} size="sm" striped stickyHeader />,
|
|
@@ -1141,3 +1232,124 @@ describe('DataTable sizing="auto"', () => {
|
|
|
1141
1232
|
expect(sort?.className).not.toContain("outline-0")
|
|
1142
1233
|
})
|
|
1143
1234
|
})
|
|
1235
|
+
|
|
1236
|
+
describe("DataTable own translations", () => {
|
|
1237
|
+
const filterColumns = [
|
|
1238
|
+
col.accessor("name", { header: "Name" }),
|
|
1239
|
+
col.accessor("age", { header: "Age", meta: { filter: { type: "number" } } }),
|
|
1240
|
+
]
|
|
1241
|
+
const renderFull = (translations?: Parameters<typeof DataTable<User>>[0]["translations"]) =>
|
|
1242
|
+
render(
|
|
1243
|
+
<DataTable
|
|
1244
|
+
columns={filterColumns}
|
|
1245
|
+
data={USERS}
|
|
1246
|
+
enableRowSelection
|
|
1247
|
+
enableColumnVisibility
|
|
1248
|
+
enableColumnResizing
|
|
1249
|
+
title="Users"
|
|
1250
|
+
translations={translations}
|
|
1251
|
+
/>,
|
|
1252
|
+
)
|
|
1253
|
+
|
|
1254
|
+
it("uses the English defaults for every header control and checkbox", () => {
|
|
1255
|
+
renderFull()
|
|
1256
|
+
expect(screen.getByRole("checkbox", { name: "Select all rows" })).toBeTruthy()
|
|
1257
|
+
expect(screen.getByRole("checkbox", { name: "Select row 0" })).toBeTruthy()
|
|
1258
|
+
expect(screen.getByRole("button", { name: "Toggle column visibility" })).toBeTruthy()
|
|
1259
|
+
expect(screen.getByRole("button", { name: "Sort Name (none)" })).toBeTruthy()
|
|
1260
|
+
expect(screen.getByRole("separator", { name: "Resize Name column" })).toBeTruthy()
|
|
1261
|
+
expect(screen.getByRole("button", { name: "Filter Age" })).toBeTruthy()
|
|
1262
|
+
})
|
|
1263
|
+
|
|
1264
|
+
it("routes every own key into the matching accessible name", async () => {
|
|
1265
|
+
renderFull({
|
|
1266
|
+
selectAllRows: "Tout sélectionner",
|
|
1267
|
+
selectRow: (id) => `Sélectionner la ligne ${id}`,
|
|
1268
|
+
columnVisibility: "Colonnes visibles",
|
|
1269
|
+
sortColumn: (label, mode) => `Trier ${label} [${mode}]`,
|
|
1270
|
+
resizeColumn: (label) => `Redimensionner ${label}`,
|
|
1271
|
+
filterColumn: (label, active) => `Filtrer ${label}${active ? " *" : ""}`,
|
|
1272
|
+
min: "Minimum",
|
|
1273
|
+
max: "Maximum",
|
|
1274
|
+
})
|
|
1275
|
+
expect(screen.getByRole("checkbox", { name: "Tout sélectionner" })).toBeTruthy()
|
|
1276
|
+
expect(screen.getByRole("checkbox", { name: "Sélectionner la ligne 0" })).toBeTruthy()
|
|
1277
|
+
expect(screen.getByRole("button", { name: "Colonnes visibles" })).toBeTruthy()
|
|
1278
|
+
expect(screen.getByRole("separator", { name: "Redimensionner Name" })).toBeTruthy()
|
|
1279
|
+
|
|
1280
|
+
fireEvent.click(screen.getByRole("button", { name: "Trier Name [none]" }))
|
|
1281
|
+
expect(await screen.findByRole("button", { name: "Trier Name [asc]" })).toBeTruthy()
|
|
1282
|
+
|
|
1283
|
+
fireEvent.click(screen.getByRole("button", { name: "Filtrer Age" }))
|
|
1284
|
+
expect(await screen.findByPlaceholderText("Minimum")).toBeTruthy()
|
|
1285
|
+
expect(screen.getByPlaceholderText("Maximum")).toBeTruthy()
|
|
1286
|
+
})
|
|
1287
|
+
|
|
1288
|
+
it("keeps the English default for any own key a partial override omits", () => {
|
|
1289
|
+
renderFull({ selectAllRows: "Tout sélectionner" })
|
|
1290
|
+
expect(screen.getByRole("checkbox", { name: "Tout sélectionner" })).toBeTruthy()
|
|
1291
|
+
expect(screen.getByRole("checkbox", { name: "Select row 0" })).toBeTruthy()
|
|
1292
|
+
expect(screen.getByRole("button", { name: "Sort Name (none)" })).toBeTruthy()
|
|
1293
|
+
expect(screen.getByRole("button", { name: "Next page" })).toBeTruthy()
|
|
1294
|
+
})
|
|
1295
|
+
|
|
1296
|
+
it("forwards the child controls' keys to the filters and the page-size Select", async () => {
|
|
1297
|
+
render(
|
|
1298
|
+
<DataTable
|
|
1299
|
+
columns={[
|
|
1300
|
+
col.accessor("name", {
|
|
1301
|
+
header: "Name",
|
|
1302
|
+
meta: { filter: { type: "select", options: ["Ada", "Grace"] } },
|
|
1303
|
+
}),
|
|
1304
|
+
col.accessor("age", { header: "Age", meta: { filter: { type: "number" } } }),
|
|
1305
|
+
]}
|
|
1306
|
+
data={USERS}
|
|
1307
|
+
initialState={{ filters: [{ id: "name", value: "Ada" }] }}
|
|
1308
|
+
translations={{
|
|
1309
|
+
triggerLabel: "Afficher les options",
|
|
1310
|
+
clearTriggerLabel: "Effacer",
|
|
1311
|
+
incrementLabel: "Augmenter",
|
|
1312
|
+
}}
|
|
1313
|
+
/>,
|
|
1314
|
+
)
|
|
1315
|
+
expect(screen.getByRole("button", { name: "Afficher les options" })).toBeTruthy()
|
|
1316
|
+
|
|
1317
|
+
fireEvent.click(screen.getByRole("button", { name: "Filter Name (active)" }))
|
|
1318
|
+
expect(await screen.findByRole("button", { name: "Effacer" })).toBeTruthy()
|
|
1319
|
+
|
|
1320
|
+
fireEvent.click(screen.getByRole("button", { name: "Filter Age" }))
|
|
1321
|
+
expect((await screen.findAllByRole("button", { name: "Augmenter" })).length).toBe(2)
|
|
1322
|
+
expect(screen.getAllByRole("button", { name: "Decrement" }).length).toBe(2)
|
|
1323
|
+
})
|
|
1324
|
+
|
|
1325
|
+
it("translates the stacked layout's options button and drawer", async () => {
|
|
1326
|
+
render(
|
|
1327
|
+
<DataTable
|
|
1328
|
+
columns={filterColumns}
|
|
1329
|
+
data={USERS}
|
|
1330
|
+
responsive="stack"
|
|
1331
|
+
translations={{ tableOptions: "Options du tableau", closeTriggerLabel: "Fermer" }}
|
|
1332
|
+
/>,
|
|
1333
|
+
)
|
|
1334
|
+
fireEvent.click(screen.getByRole("button", { name: "Options du tableau" }))
|
|
1335
|
+
expect(await screen.findByRole("button", { name: "Fermer" })).toBeTruthy()
|
|
1336
|
+
})
|
|
1337
|
+
|
|
1338
|
+
it("translates the empty and error state actions", () => {
|
|
1339
|
+
const { unmount } = render(
|
|
1340
|
+
<DataTable columns={columns} data={[]} translations={{ clearFilters: "Effacer" }} />,
|
|
1341
|
+
)
|
|
1342
|
+
expect(screen.getByRole("button", { name: "Effacer" })).toBeTruthy()
|
|
1343
|
+
unmount()
|
|
1344
|
+
render(
|
|
1345
|
+
<DataTable
|
|
1346
|
+
columns={columns}
|
|
1347
|
+
data={USERS}
|
|
1348
|
+
error="Oops"
|
|
1349
|
+
onRetry={() => {}}
|
|
1350
|
+
translations={{ retry: "Réessayer" }}
|
|
1351
|
+
/>,
|
|
1352
|
+
)
|
|
1353
|
+
expect(screen.getByRole("button", { name: "Réessayer" })).toBeTruthy()
|
|
1354
|
+
})
|
|
1355
|
+
})
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
useTable,
|
|
15
15
|
} from "@tanstack/react-table"
|
|
16
16
|
import type { MouseEvent, ReactNode } from "react"
|
|
17
|
-
import { useMemo } from "react"
|
|
17
|
+
import { useMemo, useRef } from "react"
|
|
18
18
|
import { cn } from "../../lib/cn"
|
|
19
19
|
import type { WithTestId } from "../../lib/test-id"
|
|
20
20
|
import { Checkbox } from "../checkbox/checkbox"
|
|
@@ -31,7 +31,7 @@ import { useUncontrolled } from "../../lib/use-uncontrolled"
|
|
|
31
31
|
import { Button } from "../button"
|
|
32
32
|
import { Skeleton } from "../skeleton"
|
|
33
33
|
import { ThemeIcon } from "../theme-icon"
|
|
34
|
-
import { DataTablePagination
|
|
34
|
+
import { DataTablePagination } from "./data-table-pagination"
|
|
35
35
|
import {
|
|
36
36
|
type DataTablePlaceholder,
|
|
37
37
|
type DataTableView,
|
|
@@ -39,13 +39,11 @@ import {
|
|
|
39
39
|
} from "./data-table-placeholder"
|
|
40
40
|
import { DataTableStackedRows, DataTableStackOptions } from "./data-table-stack"
|
|
41
41
|
import { DataTableColumnVisibilityMenu, DataTableGlobalFilter } from "./data-table-toolbar"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
* `TimeRowTranslations`). */
|
|
48
|
-
export type DataTableTranslations = DataTablePaginationTranslations
|
|
42
|
+
import {
|
|
43
|
+
type DataTableTranslations,
|
|
44
|
+
type ResolvedDataTableTranslations,
|
|
45
|
+
resolveDataTableTranslations,
|
|
46
|
+
} from "./data-table-translations"
|
|
49
47
|
|
|
50
48
|
/** Multi-slot styling — merged with `cn` alongside each part's own classes. */
|
|
51
49
|
export type DataTableClassNames = {
|
|
@@ -137,7 +135,9 @@ export type DataTableProps<TEntity extends RowData> = WithTestId & {
|
|
|
137
135
|
hasNextPage?: boolean
|
|
138
136
|
/** Page-size choices for the pagination `Select`. Default `[10, 20, 50]`. */
|
|
139
137
|
pageSizeOptions?: number[]
|
|
140
|
-
/** Overrides the
|
|
138
|
+
/** Overrides the table's wording — the pagination footer, the header controls' accessible
|
|
139
|
+
* names, the empty/error actions and the stacked options drawer. English defaults ship in
|
|
140
|
+
* the kit; a partial override only replaces the keys it sets. */
|
|
141
141
|
translations?: DataTableTranslations
|
|
142
142
|
/** Controls how the pagination footer shows the row range/total — see
|
|
143
143
|
* `DataTable.Pagination`'s own `paginationMode` doc. Default `"page"`. */
|
|
@@ -216,13 +216,62 @@ export type DataTableProps<TEntity extends RowData> = WithTestId & {
|
|
|
216
216
|
classNames?: DataTableClassNames
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
+
/** Native controls plus the ARIA widget roles — not a bare `[role]`, which
|
|
220
|
+
* would also match a cell's `role="img"` spinner or `role="progressbar"`. */
|
|
221
|
+
const INTERACTIVE_SELECTOR = [
|
|
222
|
+
"a[href]",
|
|
223
|
+
"button",
|
|
224
|
+
"input",
|
|
225
|
+
"label",
|
|
226
|
+
"select",
|
|
227
|
+
"textarea",
|
|
228
|
+
"summary",
|
|
229
|
+
"[contenteditable]",
|
|
230
|
+
...[
|
|
231
|
+
"button",
|
|
232
|
+
"link",
|
|
233
|
+
"checkbox",
|
|
234
|
+
"radio",
|
|
235
|
+
"switch",
|
|
236
|
+
"menuitem",
|
|
237
|
+
"menuitemcheckbox",
|
|
238
|
+
"menuitemradio",
|
|
239
|
+
"tab",
|
|
240
|
+
"option",
|
|
241
|
+
"combobox",
|
|
242
|
+
"slider",
|
|
243
|
+
"spinbutton",
|
|
244
|
+
"textbox",
|
|
245
|
+
"searchbox",
|
|
246
|
+
].map((role) => `[role="${role}"]`),
|
|
247
|
+
].join(",")
|
|
248
|
+
|
|
219
249
|
/** A click landing on a nested interactive element shouldn't also fire
|
|
220
250
|
* `onRowClick` — a `<tr>` with a link / menu / checkbox can't itself be a
|
|
221
251
|
* button (nested interactives break keyboard + SR semantics), so the row
|
|
222
|
-
* handler only fires when the event target isn't one.
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
252
|
+
* handler only fires when the event target isn't one.
|
|
253
|
+
*
|
|
254
|
+
* The search stops at `row`: an ancestor of the table (a `role="tabpanel"`,
|
|
255
|
+
* a dialog) must not count. A target outside the row's DOM is portaled
|
|
256
|
+
* content — a cell's Menu or Dialog, whose clicks still bubble through the
|
|
257
|
+
* React tree to the row — and never counts as a row click.
|
|
258
|
+
*
|
|
259
|
+
* A click that ends a drag-selection over the row is the user copying a
|
|
260
|
+
* value, not opening the row, so it is ignored too. */
|
|
261
|
+
const isRowClickIgnored = (target: EventTarget | null, row: Element): boolean => {
|
|
262
|
+
const selection = row.ownerDocument.getSelection()
|
|
263
|
+
const selectsRow =
|
|
264
|
+
selection != null &&
|
|
265
|
+
!selection.isCollapsed &&
|
|
266
|
+
Array.from({ length: selection.rangeCount }, (_, i) => selection.getRangeAt(i)).some((range) =>
|
|
267
|
+
range.intersectsNode(row),
|
|
268
|
+
)
|
|
269
|
+
if (selectsRow) return true
|
|
270
|
+
if (!(target instanceof Element)) return false
|
|
271
|
+
if (!row.contains(target)) return true
|
|
272
|
+
const hit = target.closest(INTERACTIVE_SELECTOR)
|
|
273
|
+
return hit != null && hit !== row && row.contains(hit)
|
|
274
|
+
}
|
|
226
275
|
|
|
227
276
|
/** Utility to resolve aria-sort from table state
|
|
228
277
|
*
|
|
@@ -274,6 +323,13 @@ const SELECT_CHECKBOX_PX: Record<TableSize, number> = { xs: 14, sm: 16, md: 18,
|
|
|
274
323
|
* variants in table/table.tsx. */
|
|
275
324
|
const SELECT_CELL_PADDING_PX: Record<TableSize, number> = { xs: 8, sm: 10, md: 12, lg: 16, xl: 16 }
|
|
276
325
|
|
|
326
|
+
/** The select column's labels, behind a ref: the column is memoized, and an inline
|
|
327
|
+
* `translations` prop is a new object every render. The header/cell renderers run during
|
|
328
|
+
* DataTable's own render, so they always read the current labels. */
|
|
329
|
+
type SelectColumnLabels = {
|
|
330
|
+
readonly current: Pick<ResolvedDataTableTranslations, "selectAllRows" | "selectRow">
|
|
331
|
+
}
|
|
332
|
+
|
|
277
333
|
/** Auto-injected leading column when `enableRowSelection` is set (RFC §9).
|
|
278
334
|
* Sized from the table's own density so the checkbox — which scales with
|
|
279
335
|
* `size` too — always has exactly enough room; a static width clipped it
|
|
@@ -288,7 +344,7 @@ const SELECT_CELL_PADDING_PX: Record<TableSize, number> = { xs: 8, sm: 10, md: 1
|
|
|
288
344
|
* `any` convention for a column that's structurally identical for every
|
|
289
345
|
* entity. */
|
|
290
346
|
// biome-ignore lint/suspicious/noExplicitAny: a selection column has no entity-specific shape
|
|
291
|
-
function createSelectColumn(size: TableSize): ColumnDef<any, unknown> {
|
|
347
|
+
function createSelectColumn(size: TableSize, labels: SelectColumnLabels): ColumnDef<any, unknown> {
|
|
292
348
|
const width = SELECT_CHECKBOX_PX[size] + SELECT_CELL_PADDING_PX[size] * 2
|
|
293
349
|
return {
|
|
294
350
|
id: "__select__",
|
|
@@ -313,7 +369,7 @@ function createSelectColumn(size: TableSize): ColumnDef<any, unknown> {
|
|
|
313
369
|
: false
|
|
314
370
|
}
|
|
315
371
|
onCheckedChange={(checked) => table.toggleAllPageRowsSelected(checked === true)}
|
|
316
|
-
label=
|
|
372
|
+
label={labels.current.selectAllRows}
|
|
317
373
|
classNames={{ label: "sr-only" }}
|
|
318
374
|
/>
|
|
319
375
|
) : null,
|
|
@@ -324,7 +380,7 @@ function createSelectColumn(size: TableSize): ColumnDef<any, unknown> {
|
|
|
324
380
|
checked={row.getIsSelected()}
|
|
325
381
|
onCheckedChange={(checked) => row.toggleSelected(checked === true)}
|
|
326
382
|
disabled={!row.getCanSelect()}
|
|
327
|
-
label={
|
|
383
|
+
label={labels.current.selectRow(row.id)}
|
|
328
384
|
classNames={{ label: "sr-only" }}
|
|
329
385
|
/>
|
|
330
386
|
</span>
|
|
@@ -466,6 +522,9 @@ function DataTableComponent<TEntity extends RowData>({
|
|
|
466
522
|
defaultValue: initialState?.columnSizing ?? {},
|
|
467
523
|
})
|
|
468
524
|
|
|
525
|
+
const resolvedTranslations = resolveDataTableTranslations(translations)
|
|
526
|
+
const resolvedTranslationsRef = useRef(resolvedTranslations)
|
|
527
|
+
resolvedTranslationsRef.current = resolvedTranslations
|
|
469
528
|
const tableColumns = useMemo(() => {
|
|
470
529
|
// react-table's own `filterFn: "auto"` default resolves purely off the
|
|
471
530
|
// first row's runtime value type — coincidentally right for `text`, wrong
|
|
@@ -478,8 +537,9 @@ function DataTableComponent<TEntity extends RowData>({
|
|
|
478
537
|
return { ...col, filterFn: resolveFilterFn(filter) }
|
|
479
538
|
})
|
|
480
539
|
if (!enableRowSelection) return withFilterFns
|
|
540
|
+
const selectColumn = createSelectColumn(size ?? "md", resolvedTranslationsRef)
|
|
481
541
|
// biome-ignore lint/suspicious/noExplicitAny: matches the ColumnDef<TEntity, any> prop type above
|
|
482
|
-
return [
|
|
542
|
+
return [selectColumn as ColumnDef<TEntity, any>, ...withFilterFns]
|
|
483
543
|
}, [columns, enableRowSelection, size])
|
|
484
544
|
|
|
485
545
|
const table = useTable({
|
|
@@ -527,7 +587,7 @@ function DataTableComponent<TEntity extends RowData>({
|
|
|
527
587
|
const skeletonRowCount = Math.min(Math.max(pagination.pageSize, 1), 100)
|
|
528
588
|
|
|
529
589
|
const handleRowClick = (row: TEntity) => (event: MouseEvent<HTMLTableRowElement>) => {
|
|
530
|
-
if (!onRowClick ||
|
|
590
|
+
if (!onRowClick || isRowClickIgnored(event.target, event.currentTarget)) return
|
|
531
591
|
onRowClick(row)
|
|
532
592
|
}
|
|
533
593
|
|
|
@@ -592,6 +652,7 @@ function DataTableComponent<TEntity extends RowData>({
|
|
|
592
652
|
{enableColumnVisibility && (
|
|
593
653
|
<DataTableColumnVisibilityMenu
|
|
594
654
|
table={table}
|
|
655
|
+
label={resolvedTranslations.columnVisibility}
|
|
595
656
|
className={isStacked ? "hidden @lg:flex" : undefined}
|
|
596
657
|
/>
|
|
597
658
|
)}
|
|
@@ -645,9 +706,15 @@ function DataTableComponent<TEntity extends RowData>({
|
|
|
645
706
|
<>
|
|
646
707
|
<DataTableHeaderCell
|
|
647
708
|
header={header}
|
|
709
|
+
translations={resolvedTranslations}
|
|
648
710
|
truncate={isFixedSizing && header.column.id !== "__select__"}
|
|
649
711
|
/>
|
|
650
|
-
{resizable &&
|
|
712
|
+
{resizable && (
|
|
713
|
+
<DataTableColumnResizeHandle
|
|
714
|
+
header={header}
|
|
715
|
+
translations={resolvedTranslations}
|
|
716
|
+
/>
|
|
717
|
+
)}
|
|
651
718
|
</>
|
|
652
719
|
)}
|
|
653
720
|
</Table.HeaderCell>
|
|
@@ -686,7 +753,7 @@ function DataTableComponent<TEntity extends RowData>({
|
|
|
686
753
|
startSlot={<RotateCwIcon />}
|
|
687
754
|
onClick={onRetry}
|
|
688
755
|
>
|
|
689
|
-
|
|
756
|
+
{resolvedTranslations.retry}
|
|
690
757
|
</Button>
|
|
691
758
|
)
|
|
692
759
|
}
|
|
@@ -715,7 +782,7 @@ function DataTableComponent<TEntity extends RowData>({
|
|
|
715
782
|
startSlot={<EraserIcon />}
|
|
716
783
|
onClick={() => table.resetColumnFilters()}
|
|
717
784
|
>
|
|
718
|
-
|
|
785
|
+
{resolvedTranslations.clearFilters}
|
|
719
786
|
</Button>
|
|
720
787
|
}
|
|
721
788
|
/>
|
|
@@ -793,6 +860,7 @@ function DataTableComponent<TEntity extends RowData>({
|
|
|
793
860
|
<DataTableStackOptions
|
|
794
861
|
table={table}
|
|
795
862
|
enableColumnVisibility={enableColumnVisibility}
|
|
863
|
+
translations={resolvedTranslations}
|
|
796
864
|
className="@lg:hidden"
|
|
797
865
|
/>
|
|
798
866
|
<DataTableStackedRows
|
|
@@ -802,10 +870,11 @@ function DataTableComponent<TEntity extends RowData>({
|
|
|
802
870
|
refetching={isRefetching}
|
|
803
871
|
empty={empty}
|
|
804
872
|
onRowClick={onRowClick}
|
|
805
|
-
|
|
873
|
+
isRowClickIgnored={isRowClickIgnored}
|
|
806
874
|
onRetry={onRetry}
|
|
807
875
|
table={table}
|
|
808
876
|
skeletonRowCount={skeletonRowCount}
|
|
877
|
+
translations={resolvedTranslations}
|
|
809
878
|
className="@lg:hidden"
|
|
810
879
|
/>
|
|
811
880
|
</>
|
|
@@ -41,6 +41,14 @@ export {
|
|
|
41
41
|
type Row,
|
|
42
42
|
} from "./data-table-features"
|
|
43
43
|
export type { DataTableColumnFilter } from "./data-table-meta"
|
|
44
|
-
export type {
|
|
44
|
+
export type {
|
|
45
|
+
DataTablePaginationProps,
|
|
46
|
+
DataTablePaginationTranslations,
|
|
47
|
+
} from "./data-table-pagination"
|
|
45
48
|
export { columnHelperFor, type InferEntity } from "./data-table-schema"
|
|
46
49
|
export { DATA_TABLE_SKELETON_CLASS } from "./data-table-skeleton"
|
|
50
|
+
export type {
|
|
51
|
+
DataTableOwnTranslations,
|
|
52
|
+
DataTableSortMode,
|
|
53
|
+
DataTableTranslations,
|
|
54
|
+
} from "./data-table-translations"
|