@mohou/ui 1.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/lib/types/blocks/activity-feed.d.ts +12 -0
- package/lib/types/blocks/activity-feed.d.ts.map +1 -0
- package/lib/types/blocks/app-shell.d.ts +17 -0
- package/lib/types/blocks/app-shell.d.ts.map +1 -0
- package/lib/types/blocks/attachment-gallery.d.ts +15 -0
- package/lib/types/blocks/attachment-gallery.d.ts.map +1 -0
- package/lib/types/blocks/bar-chart.d.ts +19 -0
- package/lib/types/blocks/bar-chart.d.ts.map +1 -0
- package/lib/types/blocks/comment-thread.d.ts +17 -0
- package/lib/types/blocks/comment-thread.d.ts.map +1 -0
- package/lib/types/blocks/dashboard-shell.d.ts +35 -0
- package/lib/types/blocks/dashboard-shell.d.ts.map +1 -0
- package/lib/types/blocks/description-list.d.ts +14 -0
- package/lib/types/blocks/description-list.d.ts.map +1 -0
- package/lib/types/blocks/detail-panel.d.ts +16 -0
- package/lib/types/blocks/detail-panel.d.ts.map +1 -0
- package/lib/types/blocks/donut-chart.d.ts +21 -0
- package/lib/types/blocks/donut-chart.d.ts.map +1 -0
- package/lib/types/blocks/env-badge.d.ts +11 -0
- package/lib/types/blocks/env-badge.d.ts.map +1 -0
- package/lib/types/blocks/env-table.d.ts +29 -0
- package/lib/types/blocks/env-table.d.ts.map +1 -0
- package/lib/types/blocks/file-tree.d.ts +12 -0
- package/lib/types/blocks/file-tree.d.ts.map +1 -0
- package/lib/types/blocks/filter-bar.d.ts +15 -0
- package/lib/types/blocks/filter-bar.d.ts.map +1 -0
- package/lib/types/blocks/form-sheet.d.ts +47 -0
- package/lib/types/blocks/form-sheet.d.ts.map +1 -0
- package/lib/types/blocks/gauge.d.ts +14 -0
- package/lib/types/blocks/gauge.d.ts.map +1 -0
- package/lib/types/blocks/list-detail.d.ts +42 -0
- package/lib/types/blocks/list-detail.d.ts.map +1 -0
- package/lib/types/blocks/notification-center.d.ts +16 -0
- package/lib/types/blocks/notification-center.d.ts.map +1 -0
- package/lib/types/blocks/page-header.d.ts +15 -0
- package/lib/types/blocks/page-header.d.ts.map +1 -0
- package/lib/types/blocks/progress-ring.d.ts +13 -0
- package/lib/types/blocks/progress-ring.d.ts.map +1 -0
- package/lib/types/blocks/radar-chart.d.ts +19 -0
- package/lib/types/blocks/radar-chart.d.ts.map +1 -0
- package/lib/types/blocks/request-inspector.d.ts +14 -0
- package/lib/types/blocks/request-inspector.d.ts.map +1 -0
- package/lib/types/blocks/reveal.d.ts +30 -0
- package/lib/types/blocks/reveal.d.ts.map +1 -0
- package/lib/types/blocks/run-timeline.d.ts +12 -0
- package/lib/types/blocks/run-timeline.d.ts.map +1 -0
- package/lib/types/blocks/scrollspy.d.ts +15 -0
- package/lib/types/blocks/scrollspy.d.ts.map +1 -0
- package/lib/types/blocks/settings-split.d.ts +47 -0
- package/lib/types/blocks/settings-split.d.ts.map +1 -0
- package/lib/types/blocks/severity-chip.d.ts +23 -0
- package/lib/types/blocks/severity-chip.d.ts.map +1 -0
- package/lib/types/blocks/sparkline.d.ts +14 -0
- package/lib/types/blocks/sparkline.d.ts.map +1 -0
- package/lib/types/blocks/stat-card.d.ts +17 -0
- package/lib/types/blocks/stat-card.d.ts.map +1 -0
- package/lib/types/blocks/status-badge.d.ts +21 -0
- package/lib/types/blocks/status-badge.d.ts.map +1 -0
- package/lib/types/blocks/table-page.d.ts +35 -0
- package/lib/types/blocks/table-page.d.ts.map +1 -0
- package/lib/types/blocks/terminal.d.ts +12 -0
- package/lib/types/blocks/terminal.d.ts.map +1 -0
- package/lib/types/blocks/test-step-list.d.ts +17 -0
- package/lib/types/blocks/test-step-list.d.ts.map +1 -0
- package/lib/types/blocks/trend-card.d.ts +20 -0
- package/lib/types/blocks/trend-card.d.ts.map +1 -0
- package/lib/types/blocks/wizard-shell.d.ts +47 -0
- package/lib/types/blocks/wizard-shell.d.ts.map +1 -0
- package/lib/types/components/accordion.d.ts +14 -0
- package/lib/types/components/accordion.d.ts.map +1 -0
- package/lib/types/components/alert-dialog.d.ts +26 -0
- package/lib/types/components/alert-dialog.d.ts.map +1 -0
- package/lib/types/components/alert.d.ts +18 -0
- package/lib/types/components/alert.d.ts.map +1 -0
- package/lib/types/components/aspect-ratio.d.ts +9 -0
- package/lib/types/components/aspect-ratio.d.ts.map +1 -0
- package/lib/types/components/attachment.d.ts +28 -0
- package/lib/types/components/attachment.d.ts.map +1 -0
- package/lib/types/components/avatar.d.ts +16 -0
- package/lib/types/components/avatar.d.ts.map +1 -0
- package/lib/types/components/badge.d.ts +15 -0
- package/lib/types/components/badge.d.ts.map +1 -0
- package/lib/types/components/breadcrumb.d.ts +15 -0
- package/lib/types/components/breadcrumb.d.ts.map +1 -0
- package/lib/types/components/bubble.d.ts +21 -0
- package/lib/types/components/bubble.d.ts.map +1 -0
- package/lib/types/components/button-group.d.ts +17 -0
- package/lib/types/components/button-group.d.ts.map +1 -0
- package/lib/types/components/button.d.ts +16 -0
- package/lib/types/components/button.d.ts.map +1 -0
- package/lib/types/components/calendar.d.ts +15 -0
- package/lib/types/components/calendar.d.ts.map +1 -0
- package/lib/types/components/card.d.ts +19 -0
- package/lib/types/components/card.d.ts.map +1 -0
- package/lib/types/components/chart.d.ts +52 -0
- package/lib/types/components/chart.d.ts.map +1 -0
- package/lib/types/components/checkbox.d.ts +9 -0
- package/lib/types/components/checkbox.d.ts.map +1 -0
- package/lib/types/components/collapsible.d.ts +10 -0
- package/lib/types/components/collapsible.d.ts.map +1 -0
- package/lib/types/components/combobox.d.ts +29 -0
- package/lib/types/components/combobox.d.ts.map +1 -0
- package/lib/types/components/command.d.ts +26 -0
- package/lib/types/components/command.d.ts.map +1 -0
- package/lib/types/components/context-menu.d.ts +34 -0
- package/lib/types/components/context-menu.d.ts.map +1 -0
- package/lib/types/components/dialog.d.ts +30 -0
- package/lib/types/components/dialog.d.ts.map +1 -0
- package/lib/types/components/drawer.d.ts +21 -0
- package/lib/types/components/drawer.d.ts.map +1 -0
- package/lib/types/components/dropdown-menu.d.ts +37 -0
- package/lib/types/components/dropdown-menu.d.ts.map +1 -0
- package/lib/types/components/empty.d.ts +24 -0
- package/lib/types/components/empty.d.ts.map +1 -0
- package/lib/types/components/field.d.ts +31 -0
- package/lib/types/components/field.d.ts.map +1 -0
- package/lib/types/components/hover-card.d.ts +10 -0
- package/lib/types/components/hover-card.d.ts.map +1 -0
- package/lib/types/components/input-group.d.ts +23 -0
- package/lib/types/components/input-group.d.ts.map +1 -0
- package/lib/types/components/input.d.ts +11 -0
- package/lib/types/components/input.d.ts.map +1 -0
- package/lib/types/components/item.d.ts +27 -0
- package/lib/types/components/item.d.ts.map +1 -0
- package/lib/types/components/kbd.d.ts +8 -0
- package/lib/types/components/kbd.d.ts.map +1 -0
- package/lib/types/components/label.d.ts +11 -0
- package/lib/types/components/label.d.ts.map +1 -0
- package/lib/types/components/marker.d.ts +15 -0
- package/lib/types/components/marker.d.ts.map +1 -0
- package/lib/types/components/menubar.d.ts +34 -0
- package/lib/types/components/menubar.d.ts.map +1 -0
- package/lib/types/components/message-scroller.d.ts +15 -0
- package/lib/types/components/message-scroller.d.ts.map +1 -0
- package/lib/types/components/message.d.ts +15 -0
- package/lib/types/components/message.d.ts.map +1 -0
- package/lib/types/components/native-select.d.ts +13 -0
- package/lib/types/components/native-select.d.ts.map +1 -0
- package/lib/types/components/navigation-menu.d.ts +16 -0
- package/lib/types/components/navigation-menu.d.ts.map +1 -0
- package/lib/types/components/pagination.d.ts +22 -0
- package/lib/types/components/pagination.d.ts.map +1 -0
- package/lib/types/components/popover.d.ts +17 -0
- package/lib/types/components/popover.d.ts.map +1 -0
- package/lib/types/components/progress.d.ts +15 -0
- package/lib/types/components/progress.d.ts.map +1 -0
- package/lib/types/components/questionnaire.d.ts +24 -0
- package/lib/types/components/questionnaire.d.ts.map +1 -0
- package/lib/types/components/radio-group.d.ts +10 -0
- package/lib/types/components/radio-group.d.ts.map +1 -0
- package/lib/types/components/resizable.d.ts +15 -0
- package/lib/types/components/resizable.d.ts.map +1 -0
- package/lib/types/components/scroll-area.d.ts +9 -0
- package/lib/types/components/scroll-area.d.ts.map +1 -0
- package/lib/types/components/select.d.ts +23 -0
- package/lib/types/components/select.d.ts.map +1 -0
- package/lib/types/components/separator.d.ts +9 -0
- package/lib/types/components/separator.d.ts.map +1 -0
- package/lib/types/components/sheet.d.ts +28 -0
- package/lib/types/components/sheet.d.ts.map +1 -0
- package/lib/types/components/sidebar.d.ts +68 -0
- package/lib/types/components/sidebar.d.ts.map +1 -0
- package/lib/types/components/skeleton.d.ts +10 -0
- package/lib/types/components/skeleton.d.ts.map +1 -0
- package/lib/types/components/slider.d.ts +8 -0
- package/lib/types/components/slider.d.ts.map +1 -0
- package/lib/types/components/spinner.d.ts +9 -0
- package/lib/types/components/spinner.d.ts.map +1 -0
- package/lib/types/components/switch.d.ts +13 -0
- package/lib/types/components/switch.d.ts.map +1 -0
- package/lib/types/components/table.d.ts +18 -0
- package/lib/types/components/table.d.ts.map +1 -0
- package/lib/types/components/tabs.d.ts +18 -0
- package/lib/types/components/tabs.d.ts.map +1 -0
- package/lib/types/components/textarea.d.ts +11 -0
- package/lib/types/components/textarea.d.ts.map +1 -0
- package/lib/types/components/toast.d.ts +35 -0
- package/lib/types/components/toast.d.ts.map +1 -0
- package/lib/types/components/toggle-group.d.ts +16 -0
- package/lib/types/components/toggle-group.d.ts.map +1 -0
- package/lib/types/components/toggle.d.ts +13 -0
- package/lib/types/components/toggle.d.ts.map +1 -0
- package/lib/types/components/tooltip.d.ts +14 -0
- package/lib/types/components/tooltip.d.ts.map +1 -0
- package/lib/types/composites/autocomplete.d.ts +15 -0
- package/lib/types/composites/autocomplete.d.ts.map +1 -0
- package/lib/types/composites/cascader.d.ts +18 -0
- package/lib/types/composites/cascader.d.ts.map +1 -0
- package/lib/types/composites/color-picker.d.ts +12 -0
- package/lib/types/composites/color-picker.d.ts.map +1 -0
- package/lib/types/composites/confirm-dialog.d.ts +17 -0
- package/lib/types/composites/confirm-dialog.d.ts.map +1 -0
- package/lib/types/composites/copyable.d.ts +12 -0
- package/lib/types/composites/copyable.d.ts.map +1 -0
- package/lib/types/composites/currency-input.d.ts +13 -0
- package/lib/types/composites/currency-input.d.ts.map +1 -0
- package/lib/types/composites/date-chrome.d.ts +8 -0
- package/lib/types/composites/date-chrome.d.ts.map +1 -0
- package/lib/types/composites/date-picker.d.ts +17 -0
- package/lib/types/composites/date-picker.d.ts.map +1 -0
- package/lib/types/composites/date-range-picker.d.ts +18 -0
- package/lib/types/composites/date-range-picker.d.ts.map +1 -0
- package/lib/types/composites/date-time-picker.d.ts +18 -0
- package/lib/types/composites/date-time-picker.d.ts.map +1 -0
- package/lib/types/composites/date-time-range-picker.d.ts +17 -0
- package/lib/types/composites/date-time-range-picker.d.ts.map +1 -0
- package/lib/types/composites/duration-input.d.ts +14 -0
- package/lib/types/composites/duration-input.d.ts.map +1 -0
- package/lib/types/composites/live-refresh.d.ts +46 -0
- package/lib/types/composites/live-refresh.d.ts.map +1 -0
- package/lib/types/composites/mini-calendar.d.ts +13 -0
- package/lib/types/composites/mini-calendar.d.ts.map +1 -0
- package/lib/types/composites/number-field.d.ts +15 -0
- package/lib/types/composites/number-field.d.ts.map +1 -0
- package/lib/types/composites/password-field.d.ts +13 -0
- package/lib/types/composites/password-field.d.ts.map +1 -0
- package/lib/types/composites/phone-input.d.ts +12 -0
- package/lib/types/composites/phone-input.d.ts.map +1 -0
- package/lib/types/composites/rating.d.ts +13 -0
- package/lib/types/composites/rating.d.ts.map +1 -0
- package/lib/types/composites/relative-date-picker.d.ts +16 -0
- package/lib/types/composites/relative-date-picker.d.ts.map +1 -0
- package/lib/types/composites/search-input.d.ts +16 -0
- package/lib/types/composites/search-input.d.ts.map +1 -0
- package/lib/types/composites/slider-range.d.ts +14 -0
- package/lib/types/composites/slider-range.d.ts.map +1 -0
- package/lib/types/composites/tag-input.d.ts +14 -0
- package/lib/types/composites/tag-input.d.ts.map +1 -0
- package/lib/types/composites/time-picker.d.ts +28 -0
- package/lib/types/composites/time-picker.d.ts.map +1 -0
- package/lib/types/composites/time-range-picker.d.ts +16 -0
- package/lib/types/composites/time-range-picker.d.ts.map +1 -0
- package/lib/types/composites/timezone-select.d.ts +22 -0
- package/lib/types/composites/timezone-select.d.ts.map +1 -0
- package/lib/types/composites/transfer.d.ts +17 -0
- package/lib/types/composites/transfer.d.ts.map +1 -0
- package/lib/types/composites/user-picker.d.ts +17 -0
- package/lib/types/composites/user-picker.d.ts.map +1 -0
- package/lib/types/hooks/use-html-dark.d.ts +4 -0
- package/lib/types/hooks/use-html-dark.d.ts.map +1 -0
- package/lib/types/hooks/use-mobile.d.ts +2 -0
- package/lib/types/hooks/use-mobile.d.ts.map +1 -0
- package/lib/types/i18n/context.d.ts +310 -0
- package/lib/types/i18n/context.d.ts.map +1 -0
- package/lib/types/i18n/en.d.ts +290 -0
- package/lib/types/i18n/en.d.ts.map +1 -0
- package/lib/types/i18n/zh.d.ts +3 -0
- package/lib/types/i18n/zh.d.ts.map +1 -0
- package/lib/types/index.d.ts +151 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/lib/clipboard.d.ts +3 -0
- package/lib/types/lib/clipboard.d.ts.map +1 -0
- package/lib/types/lib/defined.d.ts +3 -0
- package/lib/types/lib/defined.d.ts.map +1 -0
- package/lib/types/lib/icons.d.ts +16 -0
- package/lib/types/lib/icons.d.ts.map +1 -0
- package/lib/types/lib/illustrations.d.ts +18 -0
- package/lib/types/lib/illustrations.d.ts.map +1 -0
- package/lib/types/lib/utils.d.ts +3 -0
- package/lib/types/lib/utils.d.ts.map +1 -0
- package/lib/types/products/cells.d.ts +13 -0
- package/lib/types/products/cells.d.ts.map +1 -0
- package/lib/types/products/code-block.d.ts +14 -0
- package/lib/types/products/code-block.d.ts.map +1 -0
- package/lib/types/products/code-editor.d.ts +21 -0
- package/lib/types/products/code-editor.d.ts.map +1 -0
- package/lib/types/products/commit-graph.d.ts +38 -0
- package/lib/types/products/commit-graph.d.ts.map +1 -0
- package/lib/types/products/data-grid.d.ts +79 -0
- package/lib/types/products/data-grid.d.ts.map +1 -0
- package/lib/types/products/diff-viewer.d.ts +15 -0
- package/lib/types/products/diff-viewer.d.ts.map +1 -0
- package/lib/types/products/event-calendar.d.ts +23 -0
- package/lib/types/products/event-calendar.d.ts.map +1 -0
- package/lib/types/products/export-csv.d.ts +2 -0
- package/lib/types/products/export-csv.d.ts.map +1 -0
- package/lib/types/products/file-dropzone.d.ts +12 -0
- package/lib/types/products/file-dropzone.d.ts.map +1 -0
- package/lib/types/products/full-calendar/animations.d.ts +12 -0
- package/lib/types/products/full-calendar/animations.d.ts.map +1 -0
- package/lib/types/products/full-calendar/calendar-body.d.ts +2 -0
- package/lib/types/products/full-calendar/calendar-body.d.ts.map +1 -0
- package/lib/types/products/full-calendar/constants.d.ts +3 -0
- package/lib/types/products/full-calendar/constants.d.ts.map +1 -0
- package/lib/types/products/full-calendar/contexts/calendar-context.d.ts +42 -0
- package/lib/types/products/full-calendar/contexts/calendar-context.d.ts.map +1 -0
- package/lib/types/products/full-calendar/contexts/dnd-context.d.ts +16 -0
- package/lib/types/products/full-calendar/contexts/dnd-context.d.ts.map +1 -0
- package/lib/types/products/full-calendar/dialogs/add-edit-event-dialog.d.ts +21 -0
- package/lib/types/products/full-calendar/dialogs/add-edit-event-dialog.d.ts.map +1 -0
- package/lib/types/products/full-calendar/dialogs/delete-event-dialog.d.ts +4 -0
- package/lib/types/products/full-calendar/dialogs/delete-event-dialog.d.ts.map +1 -0
- package/lib/types/products/full-calendar/dialogs/event-details-dialog.d.ts +7 -0
- package/lib/types/products/full-calendar/dialogs/event-details-dialog.d.ts.map +1 -0
- package/lib/types/products/full-calendar/dialogs/events-list-dialog.d.ts +9 -0
- package/lib/types/products/full-calendar/dialogs/events-list-dialog.d.ts.map +1 -0
- package/lib/types/products/full-calendar/dnd/draggable-event.d.ts +11 -0
- package/lib/types/products/full-calendar/dnd/draggable-event.d.ts.map +1 -0
- package/lib/types/products/full-calendar/dnd/droppable-area.d.ts +11 -0
- package/lib/types/products/full-calendar/dnd/droppable-area.d.ts.map +1 -0
- package/lib/types/products/full-calendar/dnd/resizable-event.d.ts +10 -0
- package/lib/types/products/full-calendar/dnd/resizable-event.d.ts.map +1 -0
- package/lib/types/products/full-calendar/header/calendar-header.d.ts +2 -0
- package/lib/types/products/full-calendar/header/calendar-header.d.ts.map +1 -0
- package/lib/types/products/full-calendar/header/date-navigator.d.ts +9 -0
- package/lib/types/products/full-calendar/header/date-navigator.d.ts.map +1 -0
- package/lib/types/products/full-calendar/header/filter.d.ts +2 -0
- package/lib/types/products/full-calendar/header/filter.d.ts.map +1 -0
- package/lib/types/products/full-calendar/header/today-button.d.ts +2 -0
- package/lib/types/products/full-calendar/header/today-button.d.ts.map +1 -0
- package/lib/types/products/full-calendar/header/user-select.d.ts +2 -0
- package/lib/types/products/full-calendar/header/user-select.d.ts.map +1 -0
- package/lib/types/products/full-calendar/header/view-tabs.d.ts +4 -0
- package/lib/types/products/full-calendar/header/view-tabs.d.ts.map +1 -0
- package/lib/types/products/full-calendar/helpers.d.ts +42 -0
- package/lib/types/products/full-calendar/helpers.d.ts.map +1 -0
- package/lib/types/products/full-calendar/hooks/use-time-range-create.d.ts +25 -0
- package/lib/types/products/full-calendar/hooks/use-time-range-create.d.ts.map +1 -0
- package/lib/types/products/full-calendar/hooks.d.ts +11 -0
- package/lib/types/products/full-calendar/hooks.d.ts.map +1 -0
- package/lib/types/products/full-calendar/interfaces.d.ts +21 -0
- package/lib/types/products/full-calendar/interfaces.d.ts.map +1 -0
- package/lib/types/products/full-calendar/settings/settings.d.ts +2 -0
- package/lib/types/products/full-calendar/settings/settings.d.ts.map +1 -0
- package/lib/types/products/full-calendar/shims/avatar-group.d.ts +7 -0
- package/lib/types/products/full-calendar/shims/avatar-group.d.ts.map +1 -0
- package/lib/types/products/full-calendar/shims/day-picker.d.ts +2 -0
- package/lib/types/products/full-calendar/shims/day-picker.d.ts.map +1 -0
- package/lib/types/products/full-calendar/shims/motion.d.ts +32 -0
- package/lib/types/products/full-calendar/shims/motion.d.ts.map +1 -0
- package/lib/types/products/full-calendar/shims/next-themes.d.ts +5 -0
- package/lib/types/products/full-calendar/shims/next-themes.d.ts.map +1 -0
- package/lib/types/products/full-calendar/shims/re-resizable.d.ts +19 -0
- package/lib/types/products/full-calendar/shims/re-resizable.d.ts.map +1 -0
- package/lib/types/products/full-calendar/shims/sonner.d.ts +5 -0
- package/lib/types/products/full-calendar/shims/sonner.d.ts.map +1 -0
- package/lib/types/products/full-calendar/types.d.ts +3 -0
- package/lib/types/products/full-calendar/types.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/agenda-view/agenda-events.d.ts +3 -0
- package/lib/types/products/full-calendar/views/agenda-view/agenda-events.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/month-view/calendar-month-view.d.ts +8 -0
- package/lib/types/products/full-calendar/views/month-view/calendar-month-view.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/month-view/day-cell.d.ts +12 -0
- package/lib/types/products/full-calendar/views/month-view/day-cell.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/month-view/event-bullet.d.ts +6 -0
- package/lib/types/products/full-calendar/views/month-view/event-bullet.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/month-view/month-event-badge.d.ts +17 -0
- package/lib/types/products/full-calendar/views/month-view/month-event-badge.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/calendar-day-view.d.ts +8 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/calendar-day-view.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/calendar-time-line.d.ts +2 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/calendar-time-line.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/calendar-week-view.d.ts +8 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/calendar-week-view.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/day-view-multi-day-events-row.d.ts +8 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/day-view-multi-day-events-row.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/event-block.d.ts +12 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/event-block.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/render-grouped-events.d.ts +8 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/render-grouped-events.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/week-view-multi-day-events-row.d.ts +8 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/week-view-multi-day-events-row.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/year-view/calendar-year-view.d.ts +8 -0
- package/lib/types/products/full-calendar/views/year-view/calendar-year-view.d.ts.map +1 -0
- package/lib/types/products/gantt.d.ts +17 -0
- package/lib/types/products/gantt.d.ts.map +1 -0
- package/lib/types/products/jira-wiki-parse.d.ts +55 -0
- package/lib/types/products/jira-wiki-parse.d.ts.map +1 -0
- package/lib/types/products/jira-wiki.d.ts +39 -0
- package/lib/types/products/jira-wiki.d.ts.map +1 -0
- package/lib/types/products/jql-input.d.ts +22 -0
- package/lib/types/products/jql-input.d.ts.map +1 -0
- package/lib/types/products/json-viewer.d.ts +12 -0
- package/lib/types/products/json-viewer.d.ts.map +1 -0
- package/lib/types/products/kanban-issue-panel.d.ts +15 -0
- package/lib/types/products/kanban-issue-panel.d.ts.map +1 -0
- package/lib/types/products/kanban.d.ts +43 -0
- package/lib/types/products/kanban.d.ts.map +1 -0
- package/lib/types/products/log-viewer.d.ts +25 -0
- package/lib/types/products/log-viewer.d.ts.map +1 -0
- package/lib/types/products/markdown-editor.d.ts +16 -0
- package/lib/types/products/markdown-editor.d.ts.map +1 -0
- package/lib/types/products/markdown.d.ts +13 -0
- package/lib/types/products/markdown.d.ts.map +1 -0
- package/lib/types/products/rich-text-editor.d.ts +13 -0
- package/lib/types/products/rich-text-editor.d.ts.map +1 -0
- package/lib/types/products/sortable-list.d.ts +16 -0
- package/lib/types/products/sortable-list.d.ts.map +1 -0
- package/lib/types/products/stepper.d.ts +39 -0
- package/lib/types/products/stepper.d.ts.map +1 -0
- package/lib/types/products/timeline.d.ts +17 -0
- package/lib/types/products/timeline.d.ts.map +1 -0
- package/lib/types/products/tree-view.d.ts +17 -0
- package/lib/types/products/tree-view.d.ts.map +1 -0
- package/lib/types/sdk/app-error-boundary.d.ts +33 -0
- package/lib/types/sdk/app-error-boundary.d.ts.map +1 -0
- package/lib/types/sdk/app-id.d.ts +6 -0
- package/lib/types/sdk/app-id.d.ts.map +1 -0
- package/lib/types/sdk/use-app.d.ts +32 -0
- package/lib/types/sdk/use-app.d.ts.map +1 -0
- package/package.json +67 -0
- package/src/blocks/activity-feed.tsx +16 -0
- package/src/blocks/app-shell.tsx +38 -0
- package/src/blocks/attachment-gallery.tsx +36 -0
- package/src/blocks/bar-chart.tsx +46 -0
- package/src/blocks/comment-thread.tsx +37 -0
- package/src/blocks/dashboard-shell.tsx +108 -0
- package/src/blocks/description-list.tsx +23 -0
- package/src/blocks/detail-panel.tsx +43 -0
- package/src/blocks/donut-chart.tsx +54 -0
- package/src/blocks/env-badge.tsx +30 -0
- package/src/blocks/env-table.tsx +315 -0
- package/src/blocks/file-tree.tsx +12 -0
- package/src/blocks/filter-bar.tsx +22 -0
- package/src/blocks/form-sheet.tsx +159 -0
- package/src/blocks/gauge.tsx +36 -0
- package/src/blocks/list-detail.tsx +120 -0
- package/src/blocks/notification-center.tsx +29 -0
- package/src/blocks/page-header.tsx +31 -0
- package/src/blocks/progress-ring.tsx +43 -0
- package/src/blocks/radar-chart.tsx +47 -0
- package/src/blocks/request-inspector.tsx +41 -0
- package/src/blocks/reveal.tsx +56 -0
- package/src/blocks/run-timeline.tsx +12 -0
- package/src/blocks/scrollspy.tsx +48 -0
- package/src/blocks/settings-split.tsx +153 -0
- package/src/blocks/severity-chip.tsx +34 -0
- package/src/blocks/sparkline.tsx +27 -0
- package/src/blocks/stat-card.tsx +50 -0
- package/src/blocks/status-badge.tsx +40 -0
- package/src/blocks/table-page.tsx +82 -0
- package/src/blocks/terminal.tsx +28 -0
- package/src/blocks/test-step-list.tsx +26 -0
- package/src/blocks/trend-card.tsx +57 -0
- package/src/blocks/wizard-shell.tsx +131 -0
- package/src/cdn-modules.d.ts +5 -0
- package/src/components/accordion.tsx +79 -0
- package/src/components/alert-dialog.tsx +192 -0
- package/src/components/alert.tsx +83 -0
- package/src/components/aspect-ratio.tsx +26 -0
- package/src/components/attachment.tsx +211 -0
- package/src/components/avatar.tsx +111 -0
- package/src/components/badge.tsx +59 -0
- package/src/components/breadcrumb.tsx +129 -0
- package/src/components/bubble.tsx +132 -0
- package/src/components/button-group.tsx +93 -0
- package/src/components/button.tsx +65 -0
- package/src/components/calendar.tsx +224 -0
- package/src/components/card.tsx +110 -0
- package/src/components/chart.tsx +378 -0
- package/src/components/checkbox.tsx +33 -0
- package/src/components/collapsible.tsx +23 -0
- package/src/components/combobox.tsx +299 -0
- package/src/components/command.tsx +201 -0
- package/src/components/context-menu.tsx +274 -0
- package/src/components/dialog.tsx +179 -0
- package/src/components/drawer.tsx +230 -0
- package/src/components/dropdown-menu.tsx +274 -0
- package/src/components/empty.tsx +130 -0
- package/src/components/field.tsx +242 -0
- package/src/components/hover-card.tsx +53 -0
- package/src/components/input-group.tsx +161 -0
- package/src/components/input.tsx +27 -0
- package/src/components/item.tsx +205 -0
- package/src/components/kbd.tsx +30 -0
- package/src/components/label.tsx +26 -0
- package/src/components/marker.tsx +75 -0
- package/src/components/menubar.tsx +283 -0
- package/src/components/message-scroller.tsx +133 -0
- package/src/components/message.tsx +96 -0
- package/src/components/native-select.tsx +65 -0
- package/src/components/navigation-menu.tsx +172 -0
- package/src/components/pagination.tsx +138 -0
- package/src/components/popover.tsx +95 -0
- package/src/components/progress.tsx +89 -0
- package/src/components/questionnaire.tsx +332 -0
- package/src/components/radio-group.tsx +40 -0
- package/src/components/resizable.tsx +56 -0
- package/src/components/scroll-area.tsx +56 -0
- package/src/components/select.tsx +207 -0
- package/src/components/separator.tsx +28 -0
- package/src/components/sheet.tsx +158 -0
- package/src/components/sidebar.tsx +725 -0
- package/src/components/skeleton.tsx +20 -0
- package/src/components/slider.tsx +56 -0
- package/src/components/spinner.tsx +16 -0
- package/src/components/switch.tsx +38 -0
- package/src/components/table.tsx +121 -0
- package/src/components/tabs.tsx +88 -0
- package/src/components/textarea.tsx +25 -0
- package/src/components/toast.tsx +273 -0
- package/src/components/toggle-group.tsx +92 -0
- package/src/components/toggle.tsx +47 -0
- package/src/components/tooltip.tsx +72 -0
- package/src/composites/autocomplete.tsx +61 -0
- package/src/composites/cascader.tsx +52 -0
- package/src/composites/color-picker.tsx +25 -0
- package/src/composites/confirm-dialog.tsx +62 -0
- package/src/composites/copyable.tsx +44 -0
- package/src/composites/currency-input.tsx +37 -0
- package/src/composites/date-chrome.tsx +156 -0
- package/src/composites/date-picker.tsx +97 -0
- package/src/composites/date-range-picker.tsx +99 -0
- package/src/composites/date-time-picker.tsx +121 -0
- package/src/composites/date-time-range-picker.tsx +57 -0
- package/src/composites/duration-input.tsx +128 -0
- package/src/composites/live-refresh.tsx +348 -0
- package/src/composites/mini-calendar.tsx +30 -0
- package/src/composites/number-field.tsx +59 -0
- package/src/composites/password-field.tsx +50 -0
- package/src/composites/phone-input.tsx +28 -0
- package/src/composites/rating.tsx +45 -0
- package/src/composites/relative-date-picker.tsx +68 -0
- package/src/composites/search-input.tsx +55 -0
- package/src/composites/slider-range.tsx +36 -0
- package/src/composites/tag-input.tsx +62 -0
- package/src/composites/time-picker.tsx +208 -0
- package/src/composites/time-range-picker.tsx +31 -0
- package/src/composites/timezone-select.tsx +257 -0
- package/src/composites/transfer.tsx +58 -0
- package/src/composites/user-picker.tsx +46 -0
- package/src/hooks/use-html-dark.ts +36 -0
- package/src/hooks/use-mobile.ts +22 -0
- package/src/i18n/context.tsx +71 -0
- package/src/i18n/en.ts +308 -0
- package/src/i18n/zh.ts +290 -0
- package/src/index.ts +151 -0
- package/src/lib/clipboard.ts +10 -0
- package/src/lib/defined.ts +8 -0
- package/src/lib/icons.tsx +16 -0
- package/src/lib/illustrations.tsx +573 -0
- package/src/lib/utils.ts +6 -0
- package/src/products/cells.tsx +18 -0
- package/src/products/code-block.tsx +91 -0
- package/src/products/code-editor.tsx +271 -0
- package/src/products/column-meta.d.ts +9 -0
- package/src/products/commit-graph.tsx +643 -0
- package/src/products/data-grid.tsx +692 -0
- package/src/products/diff-viewer.tsx +224 -0
- package/src/products/event-calendar.tsx +49 -0
- package/src/products/export-csv.ts +26 -0
- package/src/products/file-dropzone.tsx +47 -0
- package/src/products/full-calendar/animations.ts +38 -0
- package/src/products/full-calendar/calendar-body.tsx +76 -0
- package/src/products/full-calendar/constants.ts +10 -0
- package/src/products/full-calendar/contexts/calendar-context.tsx +254 -0
- package/src/products/full-calendar/contexts/dnd-context.tsx +156 -0
- package/src/products/full-calendar/dialogs/add-edit-event-dialog.tsx +186 -0
- package/src/products/full-calendar/dialogs/delete-event-dialog.tsx +39 -0
- package/src/products/full-calendar/dialogs/event-details-dialog.tsx +99 -0
- package/src/products/full-calendar/dialogs/events-list-dialog.tsx +86 -0
- package/src/products/full-calendar/dnd/draggable-event.tsx +45 -0
- package/src/products/full-calendar/dnd/droppable-area.tsx +45 -0
- package/src/products/full-calendar/dnd/resizable-event.tsx +178 -0
- package/src/products/full-calendar/header/calendar-header.tsx +64 -0
- package/src/products/full-calendar/header/date-navigator.tsx +110 -0
- package/src/products/full-calendar/header/filter.tsx +58 -0
- package/src/products/full-calendar/header/today-button.tsx +45 -0
- package/src/products/full-calendar/header/user-select.tsx +64 -0
- package/src/products/full-calendar/header/view-tabs.tsx +36 -0
- package/src/products/full-calendar/helpers.ts +463 -0
- package/src/products/full-calendar/hooks/use-time-range-create.ts +152 -0
- package/src/products/full-calendar/hooks.ts +70 -0
- package/src/products/full-calendar/interfaces.ts +23 -0
- package/src/products/full-calendar/settings/settings.tsx +80 -0
- package/src/products/full-calendar/shims/avatar-group.tsx +16 -0
- package/src/products/full-calendar/shims/day-picker.tsx +1 -0
- package/src/products/full-calendar/shims/motion.tsx +97 -0
- package/src/products/full-calendar/shims/next-themes.ts +6 -0
- package/src/products/full-calendar/shims/re-resizable.tsx +25 -0
- package/src/products/full-calendar/shims/sonner.ts +4 -0
- package/src/products/full-calendar/types.ts +8 -0
- package/src/products/full-calendar/views/agenda-view/agenda-events.tsx +140 -0
- package/src/products/full-calendar/views/month-view/calendar-month-view.tsx +69 -0
- package/src/products/full-calendar/views/month-view/day-cell.tsx +200 -0
- package/src/products/full-calendar/views/month-view/event-bullet.tsx +40 -0
- package/src/products/full-calendar/views/month-view/month-event-badge.tsx +143 -0
- package/src/products/full-calendar/views/week-and-day-view/calendar-day-view.tsx +295 -0
- package/src/products/full-calendar/views/week-and-day-view/calendar-time-line.tsx +35 -0
- package/src/products/full-calendar/views/week-and-day-view/calendar-week-view.tsx +251 -0
- package/src/products/full-calendar/views/week-and-day-view/day-view-multi-day-events-row.tsx +73 -0
- package/src/products/full-calendar/views/week-and-day-view/event-block.tsx +114 -0
- package/src/products/full-calendar/views/week-and-day-view/render-grouped-events.tsx +49 -0
- package/src/products/full-calendar/views/week-and-day-view/week-view-multi-day-events-row.tsx +145 -0
- package/src/products/full-calendar/views/year-view/calendar-year-view.tsx +161 -0
- package/src/products/gantt.tsx +47 -0
- package/src/products/jira-wiki-parse.ts +197 -0
- package/src/products/jira-wiki.tsx +287 -0
- package/src/products/jql-input.tsx +391 -0
- package/src/products/json-viewer.tsx +43 -0
- package/src/products/kanban-issue-panel.tsx +104 -0
- package/src/products/kanban.tsx +245 -0
- package/src/products/log-viewer.tsx +404 -0
- package/src/products/markdown-editor.tsx +77 -0
- package/src/products/markdown.tsx +50 -0
- package/src/products/rich-text-editor.tsx +89 -0
- package/src/products/sortable-list.tsx +67 -0
- package/src/products/stepper.tsx +237 -0
- package/src/products/timeline.tsx +39 -0
- package/src/products/tree-view.tsx +62 -0
- package/src/sdk/app-error-boundary.tsx +240 -0
- package/src/sdk/app-id.ts +7 -0
- package/src/sdk/use-app.ts +43 -0
|
@@ -0,0 +1,692 @@
|
|
|
1
|
+
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
import {
|
|
4
|
+
flexRender,
|
|
5
|
+
getCoreRowModel,
|
|
6
|
+
getFilteredRowModel,
|
|
7
|
+
getPaginationRowModel,
|
|
8
|
+
getSortedRowModel,
|
|
9
|
+
useReactTable,
|
|
10
|
+
type Column,
|
|
11
|
+
type ColumnDef,
|
|
12
|
+
type ColumnFiltersState,
|
|
13
|
+
type RowSelectionState,
|
|
14
|
+
type SortingState,
|
|
15
|
+
type Table as TanstackTable,
|
|
16
|
+
type VisibilityState,
|
|
17
|
+
} from '@tanstack/react-table'
|
|
18
|
+
import {
|
|
19
|
+
ArrowDown,
|
|
20
|
+
ArrowUp,
|
|
21
|
+
ChevronLeft,
|
|
22
|
+
ChevronRight,
|
|
23
|
+
ChevronsUpDown,
|
|
24
|
+
Download,
|
|
25
|
+
ListFilter,
|
|
26
|
+
Search,
|
|
27
|
+
Settings2,
|
|
28
|
+
X,
|
|
29
|
+
} from 'lucide-react'
|
|
30
|
+
|
|
31
|
+
import { Button } from '@mohou/ui/components/button'
|
|
32
|
+
import { Checkbox } from '@mohou/ui/components/checkbox'
|
|
33
|
+
import {
|
|
34
|
+
DropdownMenu,
|
|
35
|
+
DropdownMenuCheckboxItem,
|
|
36
|
+
DropdownMenuContent,
|
|
37
|
+
DropdownMenuGroup,
|
|
38
|
+
DropdownMenuLabel,
|
|
39
|
+
DropdownMenuTrigger,
|
|
40
|
+
} from '@mohou/ui/components/dropdown-menu'
|
|
41
|
+
import {
|
|
42
|
+
Empty,
|
|
43
|
+
EmptyDescription,
|
|
44
|
+
EmptyHeader,
|
|
45
|
+
EmptyTitle,
|
|
46
|
+
} from '@mohou/ui/components/empty'
|
|
47
|
+
import {
|
|
48
|
+
InputGroup,
|
|
49
|
+
InputGroupAddon,
|
|
50
|
+
InputGroupInput,
|
|
51
|
+
} from '@mohou/ui/components/input-group'
|
|
52
|
+
import { NativeSelect, NativeSelectOption } from '@mohou/ui/components/native-select'
|
|
53
|
+
import {
|
|
54
|
+
Popover,
|
|
55
|
+
PopoverContent,
|
|
56
|
+
PopoverTrigger,
|
|
57
|
+
} from '@mohou/ui/components/popover'
|
|
58
|
+
import {
|
|
59
|
+
Table,
|
|
60
|
+
TableBody,
|
|
61
|
+
TableCell,
|
|
62
|
+
TableHead,
|
|
63
|
+
TableHeader,
|
|
64
|
+
TableRow,
|
|
65
|
+
} from '@mohou/ui/components/table'
|
|
66
|
+
import { cn } from '@mohou/ui/lib/utils'
|
|
67
|
+
import { useLabels } from '@mohou/ui/i18n/context'
|
|
68
|
+
import { skipUndef } from '../lib/defined'
|
|
69
|
+
import { exportCsv } from './export-csv'
|
|
70
|
+
|
|
71
|
+
export type { ColumnDef } from '@tanstack/react-table'
|
|
72
|
+
|
|
73
|
+
export type SearchVariant = 'text' | 'number' | 'select' | 'none'
|
|
74
|
+
|
|
75
|
+
export type DataGridColumnMeta = {
|
|
76
|
+
sort?: boolean | undefined
|
|
77
|
+
search?: SearchVariant | undefined
|
|
78
|
+
label?: string | undefined
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export type DataGridFeatures = {
|
|
82
|
+
sorting?: boolean
|
|
83
|
+
columnSearch?: boolean
|
|
84
|
+
globalSearch?: boolean
|
|
85
|
+
pagination?: boolean
|
|
86
|
+
columnVisibility?: boolean
|
|
87
|
+
rowSelection?: boolean
|
|
88
|
+
columnResize?: boolean
|
|
89
|
+
csvExport?: boolean
|
|
90
|
+
/**
|
|
91
|
+
* TanStack `autoResetPageIndex` — reset to page 1 when the `data` array
|
|
92
|
+
* reference changes (default true). Turn off for inline edits / appends that
|
|
93
|
+
* must keep the current page; pair with a `key` remount for structural loads.
|
|
94
|
+
*/
|
|
95
|
+
autoResetPageIndex?: boolean
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export type DataGridProps<TData> = {
|
|
99
|
+
columns: ColumnDef<TData, unknown>[]
|
|
100
|
+
data: TData[]
|
|
101
|
+
features?: DataGridFeatures | undefined
|
|
102
|
+
pageSize?: number | undefined
|
|
103
|
+
/** Controlled current page (0-based). Omit for internal state. */
|
|
104
|
+
pageIndex?: number | undefined
|
|
105
|
+
/** Fired on every page change (also when the user flips pages). */
|
|
106
|
+
onPageIndexChange?: (pageIndex: number) => void
|
|
107
|
+
searchPlaceholder?: string | undefined
|
|
108
|
+
toolbar?: React.ReactNode | undefined
|
|
109
|
+
getRowId?: (row: TData) => string
|
|
110
|
+
renderExpanded?: (row: TData) => React.ReactNode
|
|
111
|
+
/** Fired when a row is clicked, with the row's data. */
|
|
112
|
+
onRowClick?: (row: TData) => void
|
|
113
|
+
onStateChange?: (state: {
|
|
114
|
+
sorting: SortingState
|
|
115
|
+
columnFilters: ColumnFiltersState
|
|
116
|
+
globalFilter: string
|
|
117
|
+
pagination: { pageIndex: number; pageSize: number }
|
|
118
|
+
}) => void
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function columnLabel<TData>(column: Column<TData, unknown>) {
|
|
122
|
+
const meta = column.columnDef.meta as DataGridColumnMeta | undefined
|
|
123
|
+
if (meta?.label) return meta.label
|
|
124
|
+
if (typeof column.columnDef.header === 'string') return column.columnDef.header
|
|
125
|
+
return column.id
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function ColumnHeader<TData>({
|
|
129
|
+
column,
|
|
130
|
+
canSort,
|
|
131
|
+
canFilter,
|
|
132
|
+
}: {
|
|
133
|
+
column: Column<TData, unknown>
|
|
134
|
+
canSort: boolean
|
|
135
|
+
canFilter: boolean
|
|
136
|
+
}) {
|
|
137
|
+
const t = useLabels('dataGrid')
|
|
138
|
+
const sorted = column.getIsSorted()
|
|
139
|
+
const filterValue = (column.getFilterValue() as string) ?? ''
|
|
140
|
+
const filtered = filterValue.length > 0
|
|
141
|
+
const label = columnLabel(column)
|
|
142
|
+
|
|
143
|
+
return (
|
|
144
|
+
<div className="flex min-w-0 items-center gap-0.5">
|
|
145
|
+
{canSort ? (
|
|
146
|
+
<button
|
|
147
|
+
type="button"
|
|
148
|
+
data-testid={`sort-${column.id}`}
|
|
149
|
+
className="flex min-w-0 flex-1 items-center gap-1 rounded-md px-1 py-0.5 text-left text-xs font-medium tracking-wide text-muted-foreground uppercase hover:text-foreground"
|
|
150
|
+
onClick={() => {
|
|
151
|
+
if (sorted === 'desc') column.clearSorting()
|
|
152
|
+
else column.toggleSorting(sorted === 'asc')
|
|
153
|
+
}}
|
|
154
|
+
>
|
|
155
|
+
<span className="truncate">{label}</span>
|
|
156
|
+
{sorted === 'asc' ? (
|
|
157
|
+
<ArrowUp className="size-3.5 shrink-0 text-foreground" />
|
|
158
|
+
) : sorted === 'desc' ? (
|
|
159
|
+
<ArrowDown className="size-3.5 shrink-0 text-foreground" />
|
|
160
|
+
) : (
|
|
161
|
+
<ChevronsUpDown className="size-3.5 shrink-0 opacity-0 group-hover/th:opacity-40" />
|
|
162
|
+
)}
|
|
163
|
+
</button>
|
|
164
|
+
) : (
|
|
165
|
+
<span className="truncate px-1 text-xs font-medium tracking-wide text-muted-foreground uppercase">
|
|
166
|
+
{label}
|
|
167
|
+
</span>
|
|
168
|
+
)}
|
|
169
|
+
|
|
170
|
+
{canFilter ? (
|
|
171
|
+
<Popover>
|
|
172
|
+
<PopoverTrigger
|
|
173
|
+
render={
|
|
174
|
+
<Button
|
|
175
|
+
variant="ghost"
|
|
176
|
+
size="icon-xs"
|
|
177
|
+
data-testid={`column-filter-${column.id}`}
|
|
178
|
+
aria-label={t.filterColumn(label)}
|
|
179
|
+
className={cn(
|
|
180
|
+
'shrink-0 text-muted-foreground',
|
|
181
|
+
filtered
|
|
182
|
+
? 'text-foreground'
|
|
183
|
+
: 'opacity-0 group-hover/th:opacity-100 data-popup-open:opacity-100'
|
|
184
|
+
)}
|
|
185
|
+
/>
|
|
186
|
+
}
|
|
187
|
+
>
|
|
188
|
+
<ListFilter className="size-3.5" />
|
|
189
|
+
</PopoverTrigger>
|
|
190
|
+
<PopoverContent align="start" className="w-56 p-2">
|
|
191
|
+
<InputGroup>
|
|
192
|
+
<InputGroupAddon>
|
|
193
|
+
<Search className="size-3.5" />
|
|
194
|
+
</InputGroupAddon>
|
|
195
|
+
<InputGroupInput
|
|
196
|
+
autoFocus
|
|
197
|
+
data-testid={`column-search-${column.id}`}
|
|
198
|
+
placeholder={t.filterColumn(label)}
|
|
199
|
+
value={filterValue}
|
|
200
|
+
onChange={event => column.setFilterValue(event.target.value)}
|
|
201
|
+
/>
|
|
202
|
+
</InputGroup>
|
|
203
|
+
{filtered ? (
|
|
204
|
+
<Button
|
|
205
|
+
variant="ghost"
|
|
206
|
+
size="sm"
|
|
207
|
+
className="mt-1.5 w-full"
|
|
208
|
+
onClick={() => column.setFilterValue('')}
|
|
209
|
+
>
|
|
210
|
+
{t.clear}
|
|
211
|
+
</Button>
|
|
212
|
+
) : null}
|
|
213
|
+
</PopoverContent>
|
|
214
|
+
</Popover>
|
|
215
|
+
) : null}
|
|
216
|
+
</div>
|
|
217
|
+
)
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function GridToolbar<TData>({
|
|
221
|
+
table,
|
|
222
|
+
enabled,
|
|
223
|
+
searchPlaceholder,
|
|
224
|
+
toolbar,
|
|
225
|
+
}: {
|
|
226
|
+
table: TanstackTable<TData>
|
|
227
|
+
enabled: Required<DataGridFeatures>
|
|
228
|
+
searchPlaceholder: string
|
|
229
|
+
toolbar?: React.ReactNode | undefined
|
|
230
|
+
}) {
|
|
231
|
+
const t = useLabels('dataGrid')
|
|
232
|
+
const globalFilter = (table.getState().globalFilter as string) ?? ''
|
|
233
|
+
const hideable = table
|
|
234
|
+
.getAllColumns()
|
|
235
|
+
.filter(column => column.getCanHide() && column.accessorFn)
|
|
236
|
+
|
|
237
|
+
const chips = table.getState().columnFilters.filter(
|
|
238
|
+
filter => String(filter.value ?? '').length > 0,
|
|
239
|
+
)
|
|
240
|
+
|
|
241
|
+
return (
|
|
242
|
+
<div className="flex flex-col gap-2">
|
|
243
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
244
|
+
{enabled.globalSearch ? (
|
|
245
|
+
<InputGroup className="max-w-xs">
|
|
246
|
+
<InputGroupAddon>
|
|
247
|
+
<Search className="size-3.5" />
|
|
248
|
+
</InputGroupAddon>
|
|
249
|
+
<InputGroupInput
|
|
250
|
+
data-testid="data-grid-global-search"
|
|
251
|
+
placeholder={searchPlaceholder}
|
|
252
|
+
value={globalFilter}
|
|
253
|
+
onChange={event => table.setGlobalFilter(event.target.value)}
|
|
254
|
+
/>
|
|
255
|
+
</InputGroup>
|
|
256
|
+
) : null}
|
|
257
|
+
|
|
258
|
+
<div className="ml-auto flex items-center gap-2">
|
|
259
|
+
{enabled.csvExport ? (
|
|
260
|
+
<Button
|
|
261
|
+
variant="outline"
|
|
262
|
+
size="sm"
|
|
263
|
+
data-testid="data-grid-export"
|
|
264
|
+
onClick={() =>
|
|
265
|
+
exportCsv(
|
|
266
|
+
table.getFilteredRowModel().rows.map(row => row.original as Record<string, unknown>),
|
|
267
|
+
)
|
|
268
|
+
}
|
|
269
|
+
>
|
|
270
|
+
<Download />
|
|
271
|
+
{t.export}
|
|
272
|
+
</Button>
|
|
273
|
+
) : null}
|
|
274
|
+
{toolbar}
|
|
275
|
+
{enabled.columnVisibility && hideable.length > 0 ? (
|
|
276
|
+
<DropdownMenu>
|
|
277
|
+
<DropdownMenuTrigger
|
|
278
|
+
render={<Button variant="outline" size="sm" />}
|
|
279
|
+
>
|
|
280
|
+
<Settings2 />
|
|
281
|
+
{t.view}
|
|
282
|
+
</DropdownMenuTrigger>
|
|
283
|
+
<DropdownMenuContent align="end" className="w-44">
|
|
284
|
+
<DropdownMenuGroup>
|
|
285
|
+
<DropdownMenuLabel>{t.columns}</DropdownMenuLabel>
|
|
286
|
+
{hideable.map(column => (
|
|
287
|
+
<DropdownMenuCheckboxItem
|
|
288
|
+
key={column.id}
|
|
289
|
+
checked={column.getIsVisible()}
|
|
290
|
+
onCheckedChange={value =>
|
|
291
|
+
column.toggleVisibility(!!value)
|
|
292
|
+
}
|
|
293
|
+
className="capitalize"
|
|
294
|
+
>
|
|
295
|
+
{columnLabel(column)}
|
|
296
|
+
</DropdownMenuCheckboxItem>
|
|
297
|
+
))}
|
|
298
|
+
</DropdownMenuGroup>
|
|
299
|
+
</DropdownMenuContent>
|
|
300
|
+
</DropdownMenu>
|
|
301
|
+
) : null}
|
|
302
|
+
</div>
|
|
303
|
+
</div>
|
|
304
|
+
|
|
305
|
+
{chips.length > 0 ? (
|
|
306
|
+
<div className="flex flex-wrap items-center gap-1.5">
|
|
307
|
+
{chips.map((filter) => {
|
|
308
|
+
const column = table.getColumn(filter.id)
|
|
309
|
+
if (!column) return null
|
|
310
|
+
return (
|
|
311
|
+
<button
|
|
312
|
+
key={filter.id}
|
|
313
|
+
type="button"
|
|
314
|
+
className="inline-flex h-6 items-center gap-1 rounded-md border bg-muted/60 px-1.5 text-xs text-muted-foreground hover:text-foreground"
|
|
315
|
+
onClick={() => column.setFilterValue('')}
|
|
316
|
+
>
|
|
317
|
+
<span className="font-medium text-foreground">
|
|
318
|
+
{columnLabel(column)}
|
|
319
|
+
</span>
|
|
320
|
+
<span className="max-w-28 truncate">{String(filter.value)}</span>
|
|
321
|
+
<X className="size-3" />
|
|
322
|
+
</button>
|
|
323
|
+
)
|
|
324
|
+
})}
|
|
325
|
+
</div>
|
|
326
|
+
) : null}
|
|
327
|
+
</div>
|
|
328
|
+
)
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Product table: sort, column filter popover, global search, pagination.
|
|
333
|
+
* @when Any list/table of rows — prefer over raw Table*
|
|
334
|
+
* @example
|
|
335
|
+
* const columns: ColumnDef<Row>[] = [
|
|
336
|
+
* { accessorKey: "name", header: "Name", meta: { sort: true, search: "text" } },
|
|
337
|
+
* ]
|
|
338
|
+
* <DataGrid columns={columns} data={rows} pageSize={20} />
|
|
339
|
+
*
|
|
340
|
+
* Pagination resets to page 1 whenever the `data` reference changes
|
|
341
|
+
* (TanStack `autoResetPageIndex`, default true) — right for filter/refresh
|
|
342
|
+
* flows. For inline edits / streaming appends that must keep the current page,
|
|
343
|
+
* set `features={{ autoResetPageIndex: false }}` and drive page resets with
|
|
344
|
+
* the controlled `pageIndex` prop:
|
|
345
|
+
*
|
|
346
|
+
* @example
|
|
347
|
+
* const [page, setPage] = useState(0)
|
|
348
|
+
* <DataGrid
|
|
349
|
+
* columns={columns}
|
|
350
|
+
* data={rows}
|
|
351
|
+
* features={{ autoResetPageIndex: false }}
|
|
352
|
+
* pageIndex={page}
|
|
353
|
+
* onPageIndexChange={setPage}
|
|
354
|
+
* />
|
|
355
|
+
* // “back to page 1” button: setPage(0); for a structural reload you can also remount via key
|
|
356
|
+
* @family Data & tables
|
|
357
|
+
*/
|
|
358
|
+
export function DataGrid<TData>({
|
|
359
|
+
columns,
|
|
360
|
+
data,
|
|
361
|
+
features,
|
|
362
|
+
pageSize = 10,
|
|
363
|
+
pageIndex,
|
|
364
|
+
onPageIndexChange,
|
|
365
|
+
searchPlaceholder,
|
|
366
|
+
toolbar,
|
|
367
|
+
getRowId,
|
|
368
|
+
renderExpanded,
|
|
369
|
+
onRowClick,
|
|
370
|
+
onStateChange,
|
|
371
|
+
}: DataGridProps<TData>) {
|
|
372
|
+
const t = useLabels('dataGrid')
|
|
373
|
+
const enabled: Required<DataGridFeatures> = {
|
|
374
|
+
sorting: features?.sorting ?? true,
|
|
375
|
+
columnSearch: features?.columnSearch ?? true,
|
|
376
|
+
globalSearch: features?.globalSearch ?? true,
|
|
377
|
+
pagination: features?.pagination ?? true,
|
|
378
|
+
columnVisibility: features?.columnVisibility ?? true,
|
|
379
|
+
rowSelection: features?.rowSelection ?? false,
|
|
380
|
+
columnResize: features?.columnResize ?? false,
|
|
381
|
+
csvExport: features?.csvExport ?? false,
|
|
382
|
+
autoResetPageIndex: features?.autoResetPageIndex ?? true,
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
const [sorting, setSorting] = React.useState<SortingState>([])
|
|
386
|
+
const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>(
|
|
387
|
+
[],
|
|
388
|
+
)
|
|
389
|
+
const [globalFilter, setGlobalFilter] = React.useState('')
|
|
390
|
+
const [columnVisibility, setColumnVisibility] =
|
|
391
|
+
React.useState<VisibilityState>({})
|
|
392
|
+
const [rowSelection, setRowSelection] = React.useState<RowSelectionState>({})
|
|
393
|
+
const [expandedId, setExpandedId] = React.useState<string | null>(null)
|
|
394
|
+
|
|
395
|
+
const selectionColumn = React.useMemo<ColumnDef<TData, unknown>[]>(() => {
|
|
396
|
+
if (!enabled.rowSelection) return []
|
|
397
|
+
return [
|
|
398
|
+
{
|
|
399
|
+
id: '_select',
|
|
400
|
+
header: ({ table }) => (
|
|
401
|
+
<Checkbox
|
|
402
|
+
checked={table.getIsAllPageRowsSelected()}
|
|
403
|
+
onCheckedChange={value => table.toggleAllPageRowsSelected(!!value)}
|
|
404
|
+
aria-label={t.selectAll}
|
|
405
|
+
/>
|
|
406
|
+
),
|
|
407
|
+
cell: ({ row }) => (
|
|
408
|
+
<Checkbox
|
|
409
|
+
checked={row.getIsSelected()}
|
|
410
|
+
onCheckedChange={value => row.toggleSelected(!!value)}
|
|
411
|
+
aria-label={t.selectRow}
|
|
412
|
+
/>
|
|
413
|
+
),
|
|
414
|
+
enableSorting: false,
|
|
415
|
+
enableHiding: false,
|
|
416
|
+
},
|
|
417
|
+
]
|
|
418
|
+
}, [enabled.rowSelection, t.selectAll, t.selectRow])
|
|
419
|
+
|
|
420
|
+
const [internalPagination, setInternalPagination] = React.useState({
|
|
421
|
+
pageIndex: 0,
|
|
422
|
+
pageSize,
|
|
423
|
+
})
|
|
424
|
+
const pagination =
|
|
425
|
+
pageIndex != null
|
|
426
|
+
? { ...internalPagination, pageIndex }
|
|
427
|
+
: internalPagination
|
|
428
|
+
|
|
429
|
+
const table = useReactTable({
|
|
430
|
+
data,
|
|
431
|
+
columns: [...selectionColumn, ...columns],
|
|
432
|
+
state: {
|
|
433
|
+
sorting: enabled.sorting ? sorting : [],
|
|
434
|
+
columnFilters: enabled.columnSearch ? columnFilters : [],
|
|
435
|
+
globalFilter: enabled.globalSearch ? globalFilter : '',
|
|
436
|
+
columnVisibility,
|
|
437
|
+
rowSelection,
|
|
438
|
+
pagination,
|
|
439
|
+
},
|
|
440
|
+
onPaginationChange: (updater) => {
|
|
441
|
+
const next =
|
|
442
|
+
typeof updater === 'function'
|
|
443
|
+
? updater(pagination)
|
|
444
|
+
: updater
|
|
445
|
+
setInternalPagination(next)
|
|
446
|
+
onPageIndexChange?.(next.pageIndex)
|
|
447
|
+
},
|
|
448
|
+
onSortingChange: setSorting,
|
|
449
|
+
onColumnFiltersChange: setColumnFilters,
|
|
450
|
+
onGlobalFilterChange: setGlobalFilter,
|
|
451
|
+
onColumnVisibilityChange: setColumnVisibility,
|
|
452
|
+
onRowSelectionChange: setRowSelection,
|
|
453
|
+
getCoreRowModel: getCoreRowModel(),
|
|
454
|
+
getSortedRowModel: getSortedRowModel(),
|
|
455
|
+
getFilteredRowModel: getFilteredRowModel(),
|
|
456
|
+
getPaginationRowModel: getPaginationRowModel(),
|
|
457
|
+
enableSorting: enabled.sorting,
|
|
458
|
+
enableFilters: enabled.columnSearch,
|
|
459
|
+
enableGlobalFilter: enabled.globalSearch,
|
|
460
|
+
enableRowSelection: enabled.rowSelection,
|
|
461
|
+
enableColumnResizing: enabled.columnResize,
|
|
462
|
+
columnResizeMode: 'onChange',
|
|
463
|
+
...skipUndef({
|
|
464
|
+
getRowId,
|
|
465
|
+
autoResetPageIndex: enabled.autoResetPageIndex,
|
|
466
|
+
}),
|
|
467
|
+
})
|
|
468
|
+
|
|
469
|
+
React.useEffect(() => {
|
|
470
|
+
onStateChange?.({
|
|
471
|
+
sorting,
|
|
472
|
+
columnFilters,
|
|
473
|
+
globalFilter,
|
|
474
|
+
pagination: table.getState().pagination,
|
|
475
|
+
})
|
|
476
|
+
}, [sorting, columnFilters, globalFilter, table.getState().pagination.pageIndex, table.getState().pagination.pageSize])
|
|
477
|
+
|
|
478
|
+
const rows = table.getRowModel().rows
|
|
479
|
+
const filtered = table.getFilteredRowModel().rows.length
|
|
480
|
+
const pageCount = table.getPageCount() || 1
|
|
481
|
+
const currentPageIndex = table.getState().pagination.pageIndex
|
|
482
|
+
const selectedCount = table.getFilteredSelectedRowModel().rows.length
|
|
483
|
+
|
|
484
|
+
return (
|
|
485
|
+
<div
|
|
486
|
+
className="overflow-hidden rounded-xl border bg-card"
|
|
487
|
+
data-testid="data-grid"
|
|
488
|
+
>
|
|
489
|
+
<div className="border-b px-3 py-2">
|
|
490
|
+
<GridToolbar
|
|
491
|
+
table={table}
|
|
492
|
+
enabled={enabled}
|
|
493
|
+
searchPlaceholder={searchPlaceholder ?? t.search}
|
|
494
|
+
toolbar={toolbar}
|
|
495
|
+
/>
|
|
496
|
+
</div>
|
|
497
|
+
|
|
498
|
+
<div className="overflow-x-auto">
|
|
499
|
+
<Table>
|
|
500
|
+
<TableHeader className="sticky top-0 z-10 bg-muted/40">
|
|
501
|
+
{table.getHeaderGroups().map(headerGroup => (
|
|
502
|
+
<TableRow key={headerGroup.id} className="hover:bg-transparent">
|
|
503
|
+
{headerGroup.headers.map((header) => {
|
|
504
|
+
const meta = header.column.columnDef.meta as
|
|
505
|
+
| DataGridColumnMeta
|
|
506
|
+
| undefined
|
|
507
|
+
const canSort =
|
|
508
|
+
enabled.sorting &&
|
|
509
|
+
header.column.getCanSort() &&
|
|
510
|
+
meta?.sort !== false
|
|
511
|
+
const search = meta?.search ?? 'text'
|
|
512
|
+
const canFilter =
|
|
513
|
+
enabled.columnSearch &&
|
|
514
|
+
search !== 'none' &&
|
|
515
|
+
header.column.getCanFilter()
|
|
516
|
+
|
|
517
|
+
return (
|
|
518
|
+
<TableHead
|
|
519
|
+
key={header.id}
|
|
520
|
+
className="group/th relative h-9 px-3"
|
|
521
|
+
style={{ width: header.getSize() }}
|
|
522
|
+
>
|
|
523
|
+
{header.isPlaceholder ? null : typeof header.column
|
|
524
|
+
.columnDef.header === 'function' &&
|
|
525
|
+
!canSort &&
|
|
526
|
+
!canFilter ? (
|
|
527
|
+
flexRender(
|
|
528
|
+
header.column.columnDef.header,
|
|
529
|
+
header.getContext(),
|
|
530
|
+
)
|
|
531
|
+
) : (
|
|
532
|
+
<ColumnHeader
|
|
533
|
+
column={header.column}
|
|
534
|
+
canSort={canSort}
|
|
535
|
+
canFilter={canFilter}
|
|
536
|
+
/>
|
|
537
|
+
)}
|
|
538
|
+
{enabled.columnResize && header.column.getCanResize() ? (
|
|
539
|
+
<div
|
|
540
|
+
onMouseDown={header.getResizeHandler()}
|
|
541
|
+
className="absolute top-0 right-0 h-full w-1 cursor-col-resize"
|
|
542
|
+
/>
|
|
543
|
+
) : null}
|
|
544
|
+
</TableHead>
|
|
545
|
+
)
|
|
546
|
+
})}
|
|
547
|
+
</TableRow>
|
|
548
|
+
))}
|
|
549
|
+
</TableHeader>
|
|
550
|
+
<TableBody>
|
|
551
|
+
{rows.length ? (
|
|
552
|
+
rows.map(row => (
|
|
553
|
+
<React.Fragment key={row.id}>
|
|
554
|
+
<TableRow
|
|
555
|
+
data-testid="data-grid-row"
|
|
556
|
+
className="h-10"
|
|
557
|
+
data-state={row.getIsSelected() && 'selected'}
|
|
558
|
+
onClick={() => {
|
|
559
|
+
onRowClick?.(row.original)
|
|
560
|
+
if (renderExpanded) setExpandedId(id => (id === row.id ? null : row.id))
|
|
561
|
+
}}
|
|
562
|
+
>
|
|
563
|
+
{row.getVisibleCells().map(cell => (
|
|
564
|
+
<TableCell key={cell.id} className="px-3 py-0">
|
|
565
|
+
{flexRender(
|
|
566
|
+
cell.column.columnDef.cell,
|
|
567
|
+
cell.getContext(),
|
|
568
|
+
)}
|
|
569
|
+
</TableCell>
|
|
570
|
+
))}
|
|
571
|
+
</TableRow>
|
|
572
|
+
{renderExpanded && expandedId === row.id ? (
|
|
573
|
+
<TableRow className="hover:bg-transparent">
|
|
574
|
+
<TableCell colSpan={row.getVisibleCells().length} className="bg-muted/30 px-3 py-3">
|
|
575
|
+
{renderExpanded(row.original)}
|
|
576
|
+
</TableCell>
|
|
577
|
+
</TableRow>
|
|
578
|
+
) : null}
|
|
579
|
+
</React.Fragment>
|
|
580
|
+
))
|
|
581
|
+
) : (
|
|
582
|
+
<TableRow className="hover:bg-transparent">
|
|
583
|
+
<TableCell
|
|
584
|
+
colSpan={columns.length}
|
|
585
|
+
className="h-auto p-0"
|
|
586
|
+
data-testid="data-grid-empty"
|
|
587
|
+
>
|
|
588
|
+
<Empty className="border-0 py-14">
|
|
589
|
+
<EmptyHeader>
|
|
590
|
+
<EmptyTitle>{t.noResults}</EmptyTitle>
|
|
591
|
+
<EmptyDescription>
|
|
592
|
+
{t.noResultsHint}
|
|
593
|
+
</EmptyDescription>
|
|
594
|
+
</EmptyHeader>
|
|
595
|
+
{filtered === 0 && data.length > 0 ? (
|
|
596
|
+
<Button
|
|
597
|
+
variant="outline"
|
|
598
|
+
size="sm"
|
|
599
|
+
onClick={() => {
|
|
600
|
+
table.resetColumnFilters()
|
|
601
|
+
table.setGlobalFilter('')
|
|
602
|
+
}}
|
|
603
|
+
>
|
|
604
|
+
{t.clearFilters}
|
|
605
|
+
</Button>
|
|
606
|
+
) : null}
|
|
607
|
+
</Empty>
|
|
608
|
+
</TableCell>
|
|
609
|
+
</TableRow>
|
|
610
|
+
)}
|
|
611
|
+
</TableBody>
|
|
612
|
+
</Table>
|
|
613
|
+
</div>
|
|
614
|
+
|
|
615
|
+
{enabled.pagination || selectedCount > 0 ? (
|
|
616
|
+
<div className="flex h-11 flex-wrap items-center justify-between gap-3 border-t px-3 text-xs text-muted-foreground">
|
|
617
|
+
<div className="flex items-center gap-2.5">
|
|
618
|
+
{enabled.pagination ? (
|
|
619
|
+
<span className="tabular-nums">
|
|
620
|
+
<span className="font-medium text-foreground">{filtered}</span>{' '}
|
|
621
|
+
{filtered === 1 ? t.row : t.rows}
|
|
622
|
+
</span>
|
|
623
|
+
) : null}
|
|
624
|
+
{selectedCount > 0 ? (
|
|
625
|
+
<span
|
|
626
|
+
className="inline-flex items-center gap-1.5 rounded-md border bg-muted/50 py-0.5 pr-0.5 pl-2 text-foreground"
|
|
627
|
+
data-testid="data-grid-action-bar"
|
|
628
|
+
>
|
|
629
|
+
<span className="tabular-nums font-medium">{t.selected(selectedCount)}</span>
|
|
630
|
+
<Button
|
|
631
|
+
size="sm"
|
|
632
|
+
variant="ghost"
|
|
633
|
+
className="text-muted-foreground hover:text-foreground h-6 gap-1 px-1.5 text-xs"
|
|
634
|
+
aria-label={t.clear}
|
|
635
|
+
onClick={() => table.resetRowSelection()}
|
|
636
|
+
>
|
|
637
|
+
<X className="size-3" />
|
|
638
|
+
{t.clear}
|
|
639
|
+
</Button>
|
|
640
|
+
</span>
|
|
641
|
+
) : null}
|
|
642
|
+
</div>
|
|
643
|
+
{enabled.pagination ? (
|
|
644
|
+
<div className="flex items-center gap-3">
|
|
645
|
+
<label className="flex items-center gap-2">
|
|
646
|
+
<span className="hidden sm:inline">{t.rowsLabel}</span>
|
|
647
|
+
<NativeSelect
|
|
648
|
+
size="sm"
|
|
649
|
+
value={String(table.getState().pagination.pageSize)}
|
|
650
|
+
onChange={event =>
|
|
651
|
+
table.setPageSize(Number(event.target.value))
|
|
652
|
+
}
|
|
653
|
+
>
|
|
654
|
+
{[10, 20, 30, 50].map(size => (
|
|
655
|
+
<NativeSelectOption key={size} value={String(size)}>
|
|
656
|
+
{size}
|
|
657
|
+
</NativeSelectOption>
|
|
658
|
+
))}
|
|
659
|
+
</NativeSelect>
|
|
660
|
+
</label>
|
|
661
|
+
<span data-testid="data-grid-page">
|
|
662
|
+
{currentPageIndex + 1} / {pageCount}
|
|
663
|
+
</span>
|
|
664
|
+
<div className="flex items-center gap-1">
|
|
665
|
+
<Button
|
|
666
|
+
variant="outline"
|
|
667
|
+
size="icon-xs"
|
|
668
|
+
data-testid="data-grid-prev"
|
|
669
|
+
aria-label={t.previousPage}
|
|
670
|
+
onClick={() => table.previousPage()}
|
|
671
|
+
disabled={!table.getCanPreviousPage()}
|
|
672
|
+
>
|
|
673
|
+
<ChevronLeft className="size-3.5" />
|
|
674
|
+
</Button>
|
|
675
|
+
<Button
|
|
676
|
+
variant="outline"
|
|
677
|
+
size="icon-xs"
|
|
678
|
+
data-testid="data-grid-next"
|
|
679
|
+
aria-label={t.nextPage}
|
|
680
|
+
onClick={() => table.nextPage()}
|
|
681
|
+
disabled={!table.getCanNextPage()}
|
|
682
|
+
>
|
|
683
|
+
<ChevronRight className="size-3.5" />
|
|
684
|
+
</Button>
|
|
685
|
+
</div>
|
|
686
|
+
</div>
|
|
687
|
+
) : null}
|
|
688
|
+
</div>
|
|
689
|
+
) : null}
|
|
690
|
+
</div>
|
|
691
|
+
)
|
|
692
|
+
}
|