@kumix/ui 0.3.12 → 0.3.13
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 +1 -1
- package/dist/components/agents/agent-activity/activity-row.js +2 -2
- package/dist/components/agents/agent-activity/activity-row.js.map +1 -1
- package/dist/components/agents/agent-activity/index.js +2 -2
- package/dist/components/agents/agent-activity/index.js.map +1 -1
- package/dist/components/agents/agent-code.d.ts.map +1 -1
- package/dist/components/agents/agent-code.js +2 -2
- package/dist/components/agents/agent-code.js.map +1 -1
- package/dist/components/agents/agent-disclosure.js +1 -1
- package/dist/components/agents/agent-disclosure.js.map +1 -1
- package/dist/components/agents/ai-sidebar.js +2 -2
- package/dist/components/agents/ai-sidebar.js.map +1 -1
- package/dist/components/agents/approval-card/index.js +2 -2
- package/dist/components/agents/approval-card/index.js.map +1 -1
- package/dist/components/agents/chat-app.js +1 -1
- package/dist/components/agents/chat-app.js.map +1 -1
- package/dist/components/agents/citations.js +2 -2
- package/dist/components/agents/citations.js.map +1 -1
- package/dist/components/agents/code-block.js +2 -2
- package/dist/components/agents/code-block.js.map +1 -1
- package/dist/components/agents/file-diff.js +2 -2
- package/dist/components/agents/file-diff.js.map +1 -1
- package/dist/components/agents/image-generation.js +2 -2
- package/dist/components/agents/image-generation.js.map +1 -1
- package/dist/components/agents/loading-states/agent-progress.js +1 -1
- package/dist/components/agents/loading-states/agent-progress.js.map +1 -1
- package/dist/components/agents/loading-states/reasoning-text.js +1 -1
- package/dist/components/agents/loading-states/reasoning-text.js.map +1 -1
- package/dist/components/agents/loading-states/thinking-shimmer.js +1 -1
- package/dist/components/agents/loading-states/thinking-shimmer.js.map +1 -1
- package/dist/components/agents/message-bubble.js +2 -2
- package/dist/components/agents/message-bubble.js.map +1 -1
- package/dist/components/agents/message-scroller.js +1 -1
- package/dist/components/agents/message-scroller.js.map +1 -1
- package/dist/components/agents/message.js +1 -1
- package/dist/components/agents/message.js.map +1 -1
- package/dist/components/agents/prompt-input.js +2 -2
- package/dist/components/agents/prompt-input.js.map +1 -1
- package/dist/components/agents/streaming-response.js +2 -2
- package/dist/components/agents/streaming-response.js.map +1 -1
- package/dist/components/agents/todo-list.js +2 -2
- package/dist/components/agents/todo-list.js.map +1 -1
- package/dist/components/agents/tool-approval.js +2 -2
- package/dist/components/agents/tool-approval.js.map +1 -1
- package/dist/components/agents/tool-result.js +2 -2
- package/dist/components/agents/tool-result.js.map +1 -1
- package/dist/components/custom/confirm-dialog.js +1 -1
- package/dist/components/motion/action-swap.js +1 -1
- package/dist/components/motion/action-swap.js.map +1 -1
- package/dist/components/motion/adaptive-stepper.js +2 -2
- package/dist/components/motion/adaptive-stepper.js.map +1 -1
- package/dist/components/motion/animated-badge.js +2 -2
- package/dist/components/motion/animated-badge.js.map +1 -1
- package/dist/components/motion/animated-number.js +1 -1
- package/dist/components/motion/animated-number.js.map +1 -1
- package/dist/components/motion/animated-sidebar.js +2 -2
- package/dist/components/motion/animated-sidebar.js.map +1 -1
- package/dist/components/motion/animated-toast-stack.js +2 -2
- package/dist/components/motion/animated-toast-stack.js.map +1 -1
- package/dist/components/motion/attachment-upload.js +2 -2
- package/dist/components/motion/attachment-upload.js.map +1 -1
- package/dist/components/motion/availability-scheduler/copy-menu.js +1 -1
- package/dist/components/motion/availability-scheduler/day-row.js +2 -2
- package/dist/components/motion/availability-scheduler/icon-button.js +1 -1
- package/dist/components/motion/availability-scheduler/icon-button.js.map +1 -1
- package/dist/components/motion/availability-scheduler/index.js +2 -2
- package/dist/components/motion/availability-scheduler/index.js.map +1 -1
- package/dist/components/motion/bloom-menu.js +2 -2
- package/dist/components/motion/bloom-menu.js.map +1 -1
- package/dist/components/motion/bottom-sheet.js +1 -1
- package/dist/components/motion/bottom-sheet.js.map +1 -1
- package/dist/components/motion/bounce-sidebar.d.ts.map +1 -1
- package/dist/components/motion/bounce-sidebar.js +1 -1
- package/dist/components/motion/bounce-sidebar.js.map +1 -1
- package/dist/components/motion/bouncy-accordion.js +2 -2
- package/dist/components/motion/bouncy-accordion.js.map +1 -1
- package/dist/components/motion/button/base.js +1 -1
- package/dist/components/motion/button/base.js.map +1 -1
- package/dist/components/motion/button/metallic.js +1 -1
- package/dist/components/motion/button/metallic.js.map +1 -1
- package/dist/components/motion/button/stateful.js +1 -1
- package/dist/components/motion/card-folder.d.ts +30 -0
- package/dist/components/motion/card-folder.d.ts.map +1 -0
- package/dist/components/motion/card-folder.js +254 -0
- package/dist/components/motion/card-folder.js.map +1 -0
- package/dist/components/motion/center-morph-modal.js +2 -2
- package/dist/components/motion/center-morph-modal.js.map +1 -1
- package/dist/components/motion/checkbox.js +1 -1
- package/dist/components/motion/checkbox.js.map +1 -1
- package/dist/components/motion/chromatic-text-reveal.js +1 -1
- package/dist/components/motion/chromatic-text-reveal.js.map +1 -1
- package/dist/components/motion/combobox/content.js +1 -1
- package/dist/components/motion/combobox/content.js.map +1 -1
- package/dist/components/motion/combobox/context.js +1 -1
- package/dist/components/motion/combobox/context.js.map +1 -1
- package/dist/components/motion/combobox/list.js +2 -2
- package/dist/components/motion/combobox/list.js.map +1 -1
- package/dist/components/motion/combobox/trigger.js +2 -2
- package/dist/components/motion/combobox/trigger.js.map +1 -1
- package/dist/components/motion/command-palette.js +2 -2
- package/dist/components/motion/command-palette.js.map +1 -1
- package/dist/components/motion/context-menu.js +2 -2
- package/dist/components/motion/context-menu.js.map +1 -1
- package/dist/components/motion/cylinder-carousel.js +1 -1
- package/dist/components/motion/cylinder-carousel.js.map +1 -1
- package/dist/components/motion/digit-swap.d.ts +23 -0
- package/dist/components/motion/digit-swap.d.ts.map +1 -0
- package/dist/components/motion/digit-swap.js +77 -0
- package/dist/components/motion/digit-swap.js.map +1 -0
- package/dist/components/motion/dock.js +1 -1
- package/dist/components/motion/dock.js.map +1 -1
- package/dist/components/motion/drawer.js +1 -1
- package/dist/components/motion/drawer.js.map +1 -1
- package/dist/components/motion/dynamic-island.js +1 -1
- package/dist/components/motion/dynamic-island.js.map +1 -1
- package/dist/components/motion/expandable-action-bar.js +1 -1
- package/dist/components/motion/expandable-action-bar.js.map +1 -1
- package/dist/components/motion/expandable-control.d.ts.map +1 -1
- package/dist/components/motion/expandable-control.js +1 -1
- package/dist/components/motion/expandable-control.js.map +1 -1
- package/dist/components/motion/expandable-tabs.js +1 -1
- package/dist/components/motion/expandable-tabs.js.map +1 -1
- package/dist/components/motion/expanding-arrow-button.js +1 -1
- package/dist/components/motion/expanding-arrow-button.js.map +1 -1
- package/dist/components/motion/feedback-widget.js +2 -2
- package/dist/components/motion/feedback-widget.js.map +1 -1
- package/dist/components/motion/file-tree.js +2 -2
- package/dist/components/motion/file-tree.js.map +1 -1
- package/dist/components/motion/file-upload.js +2 -2
- package/dist/components/motion/file-upload.js.map +1 -1
- package/dist/components/motion/hold-action-button.js +1 -1
- package/dist/components/motion/hold-action-button.js.map +1 -1
- package/dist/components/motion/infinite-masonry.js +2 -2
- package/dist/components/motion/infinite-masonry.js.map +1 -1
- package/dist/components/motion/input.d.ts.map +1 -1
- package/dist/components/motion/input.js +1 -1
- package/dist/components/motion/input.js.map +1 -1
- package/dist/components/motion/liquid.js +1 -1
- package/dist/components/motion/liquid.js.map +1 -1
- package/dist/components/motion/loader.js +1 -1
- package/dist/components/motion/loader.js.map +1 -1
- package/dist/components/motion/magnetic.js +1 -1
- package/dist/components/motion/magnetic.js.map +1 -1
- package/dist/components/motion/marquee.d.ts.map +1 -1
- package/dist/components/motion/marquee.js +1 -1
- package/dist/components/motion/marquee.js.map +1 -1
- package/dist/components/motion/morphing-modal.js +1 -1
- package/dist/components/motion/morphing-modal.js.map +1 -1
- package/dist/components/motion/morphing-search.js +2 -2
- package/dist/components/motion/morphing-search.js.map +1 -1
- package/dist/components/motion/morphing-tabs.js +2 -2
- package/dist/components/motion/morphing-tabs.js.map +1 -1
- package/dist/components/motion/multi-select/content.js +1 -1
- package/dist/components/motion/multi-select/content.js.map +1 -1
- package/dist/components/motion/multi-select/context.js +1 -1
- package/dist/components/motion/multi-select/context.js.map +1 -1
- package/dist/components/motion/multi-select/list.js +2 -2
- package/dist/components/motion/multi-select/list.js.map +1 -1
- package/dist/components/motion/multi-select/trigger.js +2 -2
- package/dist/components/motion/multi-select/trigger.js.map +1 -1
- package/dist/components/motion/not-found/magnetic.d.ts.map +1 -1
- package/dist/components/motion/not-found/magnetic.js +1 -1
- package/dist/components/motion/not-found/magnetic.js.map +1 -1
- package/dist/components/motion/not-found/shared.js +1 -1
- package/dist/components/motion/not-found/shared.js.map +1 -1
- package/dist/components/motion/not-found/spotlight.js +1 -1
- package/dist/components/motion/not-found/spotlight.js.map +1 -1
- package/dist/components/motion/notification-stack.js +2 -2
- package/dist/components/motion/notification-stack.js.map +1 -1
- package/dist/components/motion/number-ticker.js +1 -1
- package/dist/components/motion/number-ticker.js.map +1 -1
- package/dist/components/motion/otp-input.js +1 -1
- package/dist/components/motion/otp-input.js.map +1 -1
- package/dist/components/motion/overflow-actions.js +2 -2
- package/dist/components/motion/overflow-actions.js.map +1 -1
- package/dist/components/motion/parallax.d.ts.map +1 -1
- package/dist/components/motion/parallax.js +1 -1
- package/dist/components/motion/parallax.js.map +1 -1
- package/dist/components/motion/popover-morph.js +1 -1
- package/dist/components/motion/popover-morph.js.map +1 -1
- package/dist/components/motion/popover.js +1 -1
- package/dist/components/motion/popover.js.map +1 -1
- package/dist/components/motion/preview-rail.js +1 -1
- package/dist/components/motion/preview-rail.js.map +1 -1
- package/dist/components/motion/project-folder.js +2 -2
- package/dist/components/motion/project-folder.js.map +1 -1
- package/dist/components/motion/pull-to-refresh.js +1 -1
- package/dist/components/motion/pull-to-refresh.js.map +1 -1
- package/dist/components/motion/radio.js +1 -1
- package/dist/components/motion/radio.js.map +1 -1
- package/dist/components/motion/range-slider-bubble.js +1 -1
- package/dist/components/motion/range-slider-bubble.js.map +1 -1
- package/dist/components/motion/range-slider-fluid.js +1 -1
- package/dist/components/motion/range-slider-fluid.js.map +1 -1
- package/dist/components/motion/range-slider-ruler.js +1 -1
- package/dist/components/motion/range-slider-ruler.js.map +1 -1
- package/dist/components/motion/range-slider-wave.js +1 -1
- package/dist/components/motion/range-slider-wave.js.map +1 -1
- package/dist/components/motion/range-slider.js +1 -1
- package/dist/components/motion/range-slider.js.map +1 -1
- package/dist/components/motion/scroll-progress.js +1 -1
- package/dist/components/motion/scroll-progress.js.map +1 -1
- package/dist/components/motion/scroll-reveal.js +1 -1
- package/dist/components/motion/scroll-reveal.js.map +1 -1
- package/dist/components/motion/scroll-to.js +1 -1
- package/dist/components/motion/scroll-to.js.map +1 -1
- package/dist/components/motion/select-morph.d.ts.map +1 -1
- package/dist/components/motion/select-morph.js +2 -2
- package/dist/components/motion/select-morph.js.map +1 -1
- package/dist/components/motion/select.js +2 -2
- package/dist/components/motion/select.js.map +1 -1
- package/dist/components/motion/shader-background.d.ts.map +1 -1
- package/dist/components/motion/shader-background.js +1 -1
- package/dist/components/motion/shader-background.js.map +1 -1
- package/dist/components/motion/shared-layout-bg.js +1 -1
- package/dist/components/motion/shared-layout-bg.js.map +1 -1
- package/dist/components/motion/signup-form.js +2 -2
- package/dist/components/motion/signup-form.js.map +1 -1
- package/dist/components/motion/slide-action-button.js +1 -1
- package/dist/components/motion/slide-action-button.js.map +1 -1
- package/dist/components/motion/swipeable-list.js +1 -1
- package/dist/components/motion/swipeable-list.js.map +1 -1
- package/dist/components/motion/switch.d.ts.map +1 -1
- package/dist/components/motion/switch.js +1 -1
- package/dist/components/motion/switch.js.map +1 -1
- package/dist/components/motion/table/index.js +1 -1
- package/dist/components/motion/table/index.js.map +1 -1
- package/dist/components/motion/table/row-handle.js +1 -1
- package/dist/components/motion/table/skeleton-rows.d.ts.map +1 -1
- package/dist/components/motion/table/skeleton-rows.js +1 -1
- package/dist/components/motion/table/skeleton-rows.js.map +1 -1
- package/dist/components/motion/table/table-header.js +2 -2
- package/dist/components/motion/table/table-header.js.map +1 -1
- package/dist/components/motion/table/table-menu.js +1 -1
- package/dist/components/motion/table/table-menu.js.map +1 -1
- package/dist/components/motion/tabs.js +1 -1
- package/dist/components/motion/tabs.js.map +1 -1
- package/dist/components/motion/text-reveal.js +1 -1
- package/dist/components/motion/text-reveal.js.map +1 -1
- package/dist/components/motion/text-scramble.d.ts.map +1 -1
- package/dist/components/motion/text-scramble.js +1 -1
- package/dist/components/motion/text-scramble.js.map +1 -1
- package/dist/components/motion/text-shimmer.js +1 -1
- package/dist/components/motion/text-shimmer.js.map +1 -1
- package/dist/components/motion/theme-toggle.js +2 -2
- package/dist/components/motion/theme-toggle.js.map +1 -1
- package/dist/components/motion/tilt-card.js +1 -1
- package/dist/components/motion/tilt-card.js.map +1 -1
- package/dist/components/motion/tooltip.js +1 -1
- package/dist/components/motion/tooltip.js.map +1 -1
- package/dist/components/motion/wheel-picker.js +1 -1
- package/dist/components/motion/wheel-picker.js.map +1 -1
- package/dist/components/reui/alert.d.ts +1 -1
- package/dist/components/reui/alert.d.ts.map +1 -1
- package/dist/components/reui/alert.js +2 -2
- package/dist/components/reui/alert.js.map +1 -1
- package/dist/components/reui/autocomplete.d.ts +1 -1
- package/dist/components/reui/autocomplete.js +2 -2
- package/dist/components/reui/autocomplete.js.map +1 -1
- package/dist/components/reui/badge.d.ts +2 -2
- package/dist/components/reui/badge.d.ts.map +1 -1
- package/dist/components/reui/badge.js +1 -1
- package/dist/components/reui/badge.js.map +1 -1
- package/dist/components/reui/cascader/cascader-columns.js +2 -2
- package/dist/components/reui/cascader/cascader-columns.js.map +1 -1
- package/dist/components/reui/cascader/cascader-footer.js +2 -2
- package/dist/components/reui/cascader/cascader-footer.js.map +1 -1
- package/dist/components/reui/cascader/cascader-item.js +2 -2
- package/dist/components/reui/cascader/cascader-item.js.map +1 -1
- package/dist/components/reui/cascader/cascader-nav.js +2 -2
- package/dist/components/reui/cascader/cascader-nav.js.map +1 -1
- package/dist/components/reui/cascader/cascader.js +2 -2
- package/dist/components/reui/cascader/cascader.js.map +1 -1
- package/dist/components/reui/code-block/code-block.js +1 -1
- package/dist/components/reui/code-block/code-block.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-cell-selection.js +1 -1
- package/dist/components/reui/data-grid/data-grid-cell-selection.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-filter.js +2 -2
- package/dist/components/reui/data-grid/data-grid-column-filter.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-header.js +2 -2
- package/dist/components/reui/data-grid/data-grid-column-header.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-pagination.js +2 -2
- package/dist/components/reui/data-grid/data-grid-pagination.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-scroll-area.js +1 -1
- package/dist/components/reui/data-grid/data-grid-scroll-area.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js +2 -2
- package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd.js +1 -1
- package/dist/components/reui/data-grid/data-grid-table-virtual.js +1 -1
- package/dist/components/reui/data-grid/data-grid-table-virtual.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table.js +2 -2
- package/dist/components/reui/data-grid/data-grid-table.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid.js +1 -1
- package/dist/components/reui/data-grid/data-grid.js.map +1 -1
- package/dist/components/reui/date-selector.js +2 -2
- package/dist/components/reui/date-selector.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-agenda-view.js +2 -2
- package/dist/components/reui/event-calendar/event-calendar-agenda-view.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-content.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar-content.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-event.js +2 -2
- package/dist/components/reui/event-calendar/event-calendar-event.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-month-view.js +2 -2
- package/dist/components/reui/event-calendar/event-calendar-month-view.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-nav.js +2 -2
- package/dist/components/reui/event-calendar/event-calendar-nav.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-resource-view.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar-resource-view.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-time-grid.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar-time-grid.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar.js.map +1 -1
- package/dist/components/reui/filters/filters-advanced.js +2 -2
- package/dist/components/reui/filters/filters-advanced.js.map +1 -1
- package/dist/components/reui/filters/filters-builder.js +3 -3
- package/dist/components/reui/filters/filters-builder.js.map +1 -1
- package/dist/components/reui/filters/filters-chip.js +2 -2
- package/dist/components/reui/filters/filters-chip.js.map +1 -1
- package/dist/components/reui/filters/filters-editors.js +3 -3
- package/dist/components/reui/filters/filters-editors.js.map +1 -1
- package/dist/components/reui/filters/filters.js +2 -2
- package/dist/components/reui/filters/filters.js.map +1 -1
- package/dist/components/reui/frame.d.ts +2 -2
- package/dist/components/reui/frame.d.ts.map +1 -1
- package/dist/components/reui/frame.js +2 -2
- package/dist/components/reui/frame.js.map +1 -1
- package/dist/components/reui/gantt/gantt-bar.js +2 -2
- package/dist/components/reui/gantt/gantt-bar.js.map +1 -1
- package/dist/components/reui/gantt/gantt-nav.js +2 -2
- package/dist/components/reui/gantt/gantt-nav.js.map +1 -1
- package/dist/components/reui/gantt/gantt-view.js +2 -2
- package/dist/components/reui/gantt/gantt-view.js.map +1 -1
- package/dist/components/reui/gantt/gantt.js +1 -1
- package/dist/components/reui/gantt/gantt.js.map +1 -1
- package/dist/components/reui/icon-stack.js +1 -1
- package/dist/components/reui/icon-stack.js.map +1 -1
- package/dist/components/reui/icon-tile.d.ts +2 -2
- package/dist/components/reui/icon-tile.d.ts.map +1 -1
- package/dist/components/reui/icon-tile.js +1 -1
- package/dist/components/reui/icon-tile.js.map +1 -1
- package/dist/components/reui/kanban.d.ts.map +1 -1
- package/dist/components/reui/kanban.js +1 -1
- package/dist/components/reui/kanban.js.map +1 -1
- package/dist/components/reui/number-field.d.ts +3 -3
- package/dist/components/reui/number-field.js +2 -2
- package/dist/components/reui/number-field.js.map +1 -1
- package/dist/components/reui/phone-input.js +2 -2
- package/dist/components/reui/phone-input.js.map +1 -1
- package/dist/components/reui/rating.d.ts +1 -1
- package/dist/components/reui/rating.d.ts.map +1 -1
- package/dist/components/reui/rating.js +2 -2
- package/dist/components/reui/rating.js.map +1 -1
- package/dist/components/reui/sortable.d.ts.map +1 -1
- package/dist/components/reui/sortable.js +1 -1
- package/dist/components/reui/sortable.js.map +1 -1
- package/dist/components/reui/stepper.d.ts.map +1 -1
- package/dist/components/reui/stepper.js +1 -1
- package/dist/components/reui/stepper.js.map +1 -1
- package/dist/components/reui/timeline.d.ts.map +1 -1
- package/dist/components/reui/timeline.js +1 -1
- package/dist/components/reui/timeline.js.map +1 -1
- package/dist/components/reui/tree.d.ts.map +1 -1
- package/dist/components/reui/tree.js +2 -2
- package/dist/components/reui/tree.js.map +1 -1
- package/dist/components/ui/accordion.d.ts.map +1 -1
- package/dist/components/ui/accordion.js +2 -2
- package/dist/components/ui/accordion.js.map +1 -1
- package/dist/components/ui/alert-dialog.js +2 -2
- package/dist/components/ui/alert-dialog.js.map +1 -1
- package/dist/components/ui/alert.d.ts.map +1 -1
- package/dist/components/ui/alert.js +2 -2
- package/dist/components/ui/alert.js.map +1 -1
- package/dist/components/ui/aspect-ratio.js +1 -1
- package/dist/components/ui/aspect-ratio.js.map +1 -1
- package/dist/components/ui/attachment.d.ts +1 -1
- package/dist/components/ui/attachment.js +2 -2
- package/dist/components/ui/attachment.js.map +1 -1
- package/dist/components/ui/avatar.d.ts.map +1 -1
- package/dist/components/ui/avatar.js +1 -1
- package/dist/components/ui/avatar.js.map +1 -1
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/badge.js +1 -1
- package/dist/components/ui/badge.js.map +1 -1
- package/dist/components/ui/breadcrumb.d.ts.map +1 -1
- package/dist/components/ui/breadcrumb.js +2 -2
- package/dist/components/ui/breadcrumb.js.map +1 -1
- package/dist/components/ui/bubble.d.ts +1 -1
- package/dist/components/ui/bubble.d.ts.map +1 -1
- package/dist/components/ui/bubble.js +2 -2
- package/dist/components/ui/bubble.js.map +1 -1
- package/dist/components/ui/button-group.js +2 -2
- package/dist/components/ui/button-group.js.map +1 -1
- package/dist/components/ui/button.d.ts +2 -2
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +2 -2
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/calendar.js +2 -2
- package/dist/components/ui/calendar.js.map +1 -1
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/components/ui/card.js +1 -1
- package/dist/components/ui/card.js.map +1 -1
- package/dist/components/ui/carousel.js +2 -2
- package/dist/components/ui/carousel.js.map +1 -1
- package/dist/components/ui/chart.d.ts.map +1 -1
- package/dist/components/ui/chart.js +1 -1
- package/dist/components/ui/chart.js.map +1 -1
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox.js +3 -3
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/combobox.js +2 -2
- package/dist/components/ui/combobox.js.map +1 -1
- package/dist/components/ui/command.js +2 -2
- package/dist/components/ui/command.js.map +1 -1
- package/dist/components/ui/context-menu.d.ts.map +1 -1
- package/dist/components/ui/context-menu.js +2 -2
- package/dist/components/ui/context-menu.js.map +1 -1
- package/dist/components/ui/dialog.js +2 -2
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/drawer.d.ts.map +1 -1
- package/dist/components/ui/drawer.js +1 -1
- package/dist/components/ui/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.js +2 -2
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/empty.d.ts.map +1 -1
- package/dist/components/ui/empty.js +2 -2
- package/dist/components/ui/empty.js.map +1 -1
- package/dist/components/ui/field.js +3 -3
- package/dist/components/ui/field.js.map +1 -1
- package/dist/components/ui/hover-card.d.ts.map +1 -1
- package/dist/components/ui/hover-card.js +1 -1
- package/dist/components/ui/hover-card.js.map +1 -1
- package/dist/components/ui/input-group.d.ts +1 -1
- package/dist/components/ui/input-group.js +2 -2
- package/dist/components/ui/input-group.js.map +1 -1
- package/dist/components/ui/input-otp.d.ts.map +1 -1
- package/dist/components/ui/input-otp.js +2 -2
- package/dist/components/ui/input-otp.js.map +1 -1
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/input.js +1 -1
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/item.d.ts +1 -1
- package/dist/components/ui/item.js +2 -2
- package/dist/components/ui/item.js.map +1 -1
- package/dist/components/ui/kbd.js +1 -1
- package/dist/components/ui/kbd.js.map +1 -1
- package/dist/components/ui/label.d.ts.map +1 -1
- package/dist/components/ui/label.js +1 -1
- package/dist/components/ui/label.js.map +1 -1
- package/dist/components/ui/marker.d.ts.map +1 -1
- package/dist/components/ui/marker.js +2 -2
- package/dist/components/ui/marker.js.map +1 -1
- package/dist/components/ui/menubar.js +2 -2
- package/dist/components/ui/menubar.js.map +1 -1
- package/dist/components/ui/message-scroller.js +2 -2
- package/dist/components/ui/message-scroller.js.map +1 -1
- package/dist/components/ui/message.d.ts.map +1 -1
- package/dist/components/ui/message.js +1 -1
- package/dist/components/ui/message.js.map +1 -1
- package/dist/components/ui/native-select.d.ts.map +1 -1
- package/dist/components/ui/native-select.js +2 -2
- package/dist/components/ui/native-select.js.map +1 -1
- package/dist/components/ui/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu.js +2 -2
- package/dist/components/ui/navigation-menu.js.map +1 -1
- package/dist/components/ui/pagination.js +2 -2
- package/dist/components/ui/pagination.js.map +1 -1
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/popover.js +1 -1
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/progress.d.ts.map +1 -1
- package/dist/components/ui/progress.js +1 -1
- package/dist/components/ui/progress.js.map +1 -1
- package/dist/components/ui/questionnaire.js +4 -4
- package/dist/components/ui/questionnaire.js.map +1 -1
- package/dist/components/ui/radio-group.d.ts.map +1 -1
- package/dist/components/ui/radio-group.js +2 -2
- package/dist/components/ui/radio-group.js.map +1 -1
- package/dist/components/ui/resizable.d.ts.map +1 -1
- package/dist/components/ui/resizable.js +1 -1
- package/dist/components/ui/resizable.js.map +1 -1
- package/dist/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/scroll-area.js +1 -1
- package/dist/components/ui/scroll-area.js.map +1 -1
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/select.js +2 -2
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/separator.d.ts.map +1 -1
- package/dist/components/ui/separator.js +1 -1
- package/dist/components/ui/separator.js.map +1 -1
- package/dist/components/ui/sheet.js +2 -2
- package/dist/components/ui/sheet.js.map +1 -1
- package/dist/components/ui/sidebar.d.ts +1 -1
- package/dist/components/ui/sidebar.js +2 -2
- package/dist/components/ui/sidebar.js.map +1 -1
- package/dist/components/ui/skeleton.js +1 -1
- package/dist/components/ui/skeleton.js.map +1 -1
- package/dist/components/ui/slider.d.ts.map +1 -1
- package/dist/components/ui/slider.js +1 -1
- package/dist/components/ui/slider.js.map +1 -1
- package/dist/components/ui/spinner.d.ts.map +1 -1
- package/dist/components/ui/spinner.js +2 -2
- package/dist/components/ui/spinner.js.map +1 -1
- package/dist/components/ui/switch.d.ts.map +1 -1
- package/dist/components/ui/switch.js +2 -2
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/table.js +1 -1
- package/dist/components/ui/table.js.map +1 -1
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/components/ui/tabs.js +2 -2
- package/dist/components/ui/tabs.js.map +1 -1
- package/dist/components/ui/textarea.d.ts.map +1 -1
- package/dist/components/ui/textarea.js +1 -1
- package/dist/components/ui/textarea.js.map +1 -1
- package/dist/components/ui/toast.js +3 -3
- package/dist/components/ui/toast.js.map +1 -1
- package/dist/components/ui/toggle-group.js +1 -1
- package/dist/components/ui/toggle-group.js.map +1 -1
- package/dist/components/ui/toggle.d.ts +1 -1
- package/dist/components/ui/toggle.d.ts.map +1 -1
- package/dist/components/ui/toggle.js +2 -2
- package/dist/components/ui/toggle.js.map +1 -1
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip.js +1 -1
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/{copy-menu-TIKvPaAZ.js → copy-menu-C5GaT4Z-.js} +2 -2
- package/dist/{copy-menu-TIKvPaAZ.js.map → copy-menu-C5GaT4Z-.js.map} +1 -1
- package/package.json +5 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-grid-table.js","names":[],"sources":["../../../../src/components/reui/data-grid/data-grid-table.tsx"],"sourcesContent":["\"use client\";\n\nimport type {\n CSSProperties,\n MouseEvent as ReactMouseEvent,\n ReactNode,\n TouchEvent as ReactTouchEvent,\n Ref,\n RefObject,\n} from \"react\";\nimport { Fragment, memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef } from \"react\";\nimport type { Cell, Column, Header, Row } from \"@tanstack/react-table\";\nimport { flexRender, Subscribe } from \"@tanstack/react-table\";\nimport { PlusIcon } from \"lucide-react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { Button } from \"../../ui/button\";\nimport { Checkbox } from \"../../ui/checkbox\";\nimport { Spinner } from \"../../ui/spinner\";\nimport type { DataGridFeatures, DataGridTableInstance } from \"./data-grid\";\nimport {\n dataGridCellSelectionCellClasses,\n getDataGridCellSelectionCellAttrs,\n toDataGridDomId,\n useDataGrid,\n} from \"./data-grid\";\n\n// Static spacing lookups; called once per cell, so they stay plain string\n// picks instead of runtime variant machinery.\nconst headerCellSpacingVariants = ({ size }: { size?: \"dense\" | \"default\" }) =>\n size === \"dense\" ? \"px-2 h-8\" : \"px-3\";\n\nconst bodyCellSpacingVariants = ({ size }: { size?: \"dense\" | \"default\" }) =>\n size === \"dense\" ? \"px-2 py-1.5\" : \"px-3 py-2\";\n\n// The truncation wrapper used when cell selection is on: it consumes the\n// td padding with negative margins and restores it as its own, so its\n// overflow clips at exactly the boundary the td's `truncate` used to clip\n// at - including custom cells that pull into the padding the same way.\nconst bodyCellTruncateWrapVariants = ({ size }: { size?: \"dense\" | \"default\" }) =>\n size === \"dense\" ? \"-mx-2 -my-1.5 truncate px-2 py-1.5\" : \"-mx-3 -my-2 truncate px-3 py-2\";\n\nconst footerCellSpacingVariants = ({ size }: { size?: \"dense\" | \"default\" }) =>\n size === \"dense\" ? \"px-2 py-1.5\" : \"px-3 py-2\";\n\nfunction getPinningStyles<TData extends object>(\n column: Column<DataGridFeatures, TData, unknown>,\n): CSSProperties {\n const isPinned = column.getIsPinned();\n\n return {\n // Logical offsets: TanStack's \"left\"/\"right\" buckets are start/end\n // semantics, so pinned columns stick to the correct edge in RTL too\n // (identical to left/right in LTR).\n insetInlineStart: isPinned === \"start\" ? `${column.getStart(\"start\")}px` : undefined,\n insetInlineEnd: isPinned === \"end\" ? `${column.getAfter(\"end\")}px` : undefined,\n position: isPinned ? \"sticky\" : undefined,\n transform: isPinned ? \"translateZ(0)\" : undefined,\n contain: isPinned ? \"paint\" : undefined,\n width: column.getSize(),\n zIndex: isPinned ? 30 : undefined,\n backgroundClip: isPinned ? \"padding-box\" : undefined,\n };\n}\n\n// Shared indent contract for tree rows: DataGridTableRowExpand consumes it,\n// and fully custom cells can reuse it for depth alignment without the\n// built-in toggle.\nfunction getDataGridTreeIndentStyle<TData extends object>(\n row: Row<DataGridFeatures, TData>,\n indent: number = 20,\n): CSSProperties {\n return {\n \"--data-grid-tree-padding\": `${row.depth * indent}px`,\n } as CSSProperties;\n}\n\nfunction assignRef<T>(ref: Ref<T> | undefined, value: T | null) {\n if (!ref) return;\n\n if (typeof ref === \"function\") {\n ref(value);\n return;\n }\n\n (ref as { current: T | null }).current = value;\n}\n\n/**\n * Nearest scroll-area viewport that belongs to THIS grid. A viewport outside\n * the grid's own container (e.g. a page-level ScrollArea) would make the\n * width measurement - and the virtualizer - bind the wrong box.\n */\nfunction getDataGridScrollAreaViewport(node: HTMLElement): HTMLElement | null {\n const scrollViewport = node.closest('[data-slot=\"scroll-area-viewport\"]') as HTMLElement | null;\n\n if (!scrollViewport) return null;\n\n const gridContainer = node.closest('[data-slot=\"data-grid\"]');\n if (gridContainer && !gridContainer.contains(scrollViewport)) return null;\n\n return scrollViewport;\n}\n\ntype DataGridResizeStartEvent = ReactMouseEvent<HTMLElement> | ReactTouchEvent<HTMLElement>;\n\ntype DataGridResizeDocumentEvent = globalThis.MouseEvent | globalThis.TouchEvent;\n\nfunction isDataGridTouchEvent(\n event: DataGridResizeStartEvent | DataGridResizeDocumentEvent,\n): event is ReactTouchEvent<HTMLElement> | globalThis.TouchEvent {\n return \"touches\" in event;\n}\n\ntype DataGridTouchListLike = {\n length: number;\n item: (index: number) => { identifier: number; clientX: number } | null;\n};\n\nfunction findTouchClientX(list: DataGridTouchListLike, identifier: number) {\n for (let i = 0; i < list.length; i++) {\n const touch = list.item(i);\n if (touch && touch.identifier === identifier) return touch.clientX;\n }\n\n return undefined;\n}\n\nfunction getDataGridResizeEventClientX(\n event: DataGridResizeStartEvent | DataGridResizeDocumentEvent,\n touchIdentifier?: number,\n) {\n if (isDataGridTouchEvent(event)) {\n if (typeof touchIdentifier === \"number\") {\n return (\n findTouchClientX(event.touches, touchIdentifier) ??\n findTouchClientX(event.changedTouches, touchIdentifier)\n );\n }\n\n return event.touches[0]?.clientX ?? event.changedTouches[0]?.clientX;\n }\n\n return event.clientX;\n}\n\nfunction startDataGridColumnResizeOnEnd<TData extends object>(\n event: DataGridResizeStartEvent,\n header: Header<DataGridFeatures, TData, unknown>,\n table: DataGridTableInstance<TData>,\n /**\n * Live mode: per-move width updates go straight to the table element's\n * `--col/--header` variables, so cells track the pointer with ZERO React\n * renders; state is written twice per drag (start marker, release commit)\n * instead of per mousemove - which re-renders the consumer's whole tree.\n */\n live = false,\n): (() => void) | undefined {\n const column = table.getColumn(header.column.id);\n\n if (!column?.getCanResize()) return;\n const isTouchSession = isDataGridTouchEvent(event);\n if (isTouchSession && event.touches.length > 1) return;\n\n event.persist?.();\n\n const ownerDocument = event.currentTarget.ownerDocument;\n const ownerWindow = ownerDocument.defaultView;\n const previousBodyCursor = ownerDocument.body.style.cursor;\n const previousDocumentCursor = ownerDocument.documentElement.style.cursor;\n const startSize = header.getSize();\n // Track the initiating finger so a second touch cannot move or commit the\n // resize with the wrong clientX.\n const touchIdentifier = isTouchSession ? event.touches[0]?.identifier : undefined;\n const dragStartClientX = getDataGridResizeEventClientX(event, touchIdentifier);\n const headerCell = event.currentTarget.closest(\"th\");\n const headerRect = headerCell?.getBoundingClientRect();\n const liveTableElement = live ? headerCell?.closest(\"table\") : null;\n // An end-pinned column is anchored at its end edge and grows from its\n // START edge, so its whole resize geometry runs mirrored, exactly like\n // RTL: the anchor is the opposite edge and the drag direction inverts.\n const resizeRtl =\n (table.options.columnResizeDirection === \"rtl\") !== (column.getIsPinned() === \"end\");\n const startOffset =\n headerRect && Number.isFinite(resizeRtl ? headerRect.left : headerRect.right)\n ? resizeRtl\n ? headerRect.left\n : headerRect.right\n : dragStartClientX;\n\n if (typeof dragStartClientX !== \"number\" || typeof startOffset !== \"number\") {\n return;\n }\n\n ownerDocument.body.style.cursor = \"col-resize\";\n ownerDocument.documentElement.style.cursor = \"col-resize\";\n\n const columnSizingStart = header\n .getLeafHeaders()\n .map((leafHeader) => [leafHeader.column.id, leafHeader.column.getSize()] as [string, number]);\n const directionMultiplier = resizeRtl ? -1 : 1;\n\n // Clamp the drag to the leaf columns' min/max sizes so the preview\n // indicator matches what the commit will produce (no overshoot followed by\n // a snap-back on release). columnDef always carries resolved defaults.\n let minDeltaPercentage = -0.999999;\n let maxDeltaPercentage = Number.POSITIVE_INFINITY;\n columnSizingStart.forEach(([columnId, headerSize]) => {\n if (headerSize <= 0) return;\n\n const leafColumn = table.getColumn(columnId);\n const minSize = leafColumn?.columnDef.minSize;\n const maxSize = leafColumn?.columnDef.maxSize;\n\n if (typeof minSize === \"number\") {\n minDeltaPercentage = Math.max(minDeltaPercentage, minSize / headerSize - 1);\n }\n if (typeof maxSize === \"number\" && Number.isFinite(maxSize)) {\n maxDeltaPercentage = Math.min(maxDeltaPercentage, maxSize / headerSize - 1);\n }\n });\n\n let lastClientX = dragStartClientX;\n let ended = false;\n const stopListeners: Array<() => void> = [];\n\n const updateOffset = (clientXPos?: number, commit = false) => {\n if (typeof clientXPos !== \"number\") return;\n\n lastClientX = clientXPos;\n\n const nextColumnSizing: Record<string, number> = {};\n const deltaPercentage = Math.min(\n Math.max(\n ((clientXPos - dragStartClientX) * directionMultiplier) / startSize,\n minDeltaPercentage,\n ),\n maxDeltaPercentage,\n );\n const deltaOffset = deltaPercentage * startSize;\n\n columnSizingStart.forEach(([columnId, headerSize]) => {\n nextColumnSizing[columnId] =\n Math.round(Math.max(headerSize + headerSize * deltaPercentage, 0) * 100) / 100;\n });\n\n if (liveTableElement) {\n columnSizingStart.forEach(([columnId]) => {\n const nextSize = nextColumnSizing[columnId];\n if (typeof nextSize !== \"number\") return;\n liveTableElement.style.setProperty(`--col-${columnId}-size`, String(nextSize));\n liveTableElement.style.setProperty(`--header-${columnId}-size`, String(nextSize));\n });\n } else {\n table.setColumnResizing((old) => ({\n ...old,\n startOffset,\n startSize,\n deltaOffset,\n deltaPercentage,\n columnSizingStart,\n isResizingColumn: column.id,\n }));\n }\n\n if (commit) {\n table.setColumnSizing((old) => ({\n ...old,\n ...nextColumnSizing,\n }));\n }\n };\n\n // Single teardown path: commits at the given position, removes every\n // document/window listener, and restores cursors. Safe to call more than\n // once (blur + mouseup + unmount can race).\n const endResize = (clientXPos?: number) => {\n if (ended) return;\n ended = true;\n\n for (const stop of stopListeners) stop();\n updateOffset(clientXPos, true);\n table.setColumnResizing((old) => ({\n ...old,\n isResizingColumn: false,\n startOffset: null,\n startSize: null,\n deltaOffset: null,\n deltaPercentage: null,\n columnSizingStart: [],\n }));\n ownerDocument.body.style.cursor = previousBodyCursor;\n ownerDocument.documentElement.style.cursor = previousDocumentCursor;\n };\n\n const mouseMoveHandler = (moveEvent: globalThis.MouseEvent) => {\n updateOffset(moveEvent.clientX);\n };\n const mouseUpHandler = (upEvent: globalThis.MouseEvent) => {\n endResize(upEvent.clientX);\n };\n const touchMoveHandler = (moveEvent: globalThis.TouchEvent) => {\n if (moveEvent.cancelable) {\n moveEvent.preventDefault();\n moveEvent.stopPropagation();\n }\n\n updateOffset(getDataGridResizeEventClientX(moveEvent, touchIdentifier));\n };\n const touchEndHandler = (endEvent: globalThis.TouchEvent) => {\n // Ignore other fingers lifting; only the initiating touch ends the drag.\n const clientXPos =\n typeof touchIdentifier === \"number\"\n ? findTouchClientX(endEvent.changedTouches, touchIdentifier)\n : getDataGridResizeEventClientX(endEvent);\n\n if (typeof clientXPos !== \"number\") return;\n\n if (endEvent.cancelable) {\n endEvent.preventDefault();\n endEvent.stopPropagation();\n }\n\n endResize(clientXPos);\n };\n // System-interrupted gestures and window focus loss would otherwise leave\n // the session (and its document listeners) live with no pointer held.\n const touchCancelHandler = () => {\n endResize(lastClientX);\n };\n const windowBlurHandler = () => {\n endResize(lastClientX);\n };\n\n const passiveIfSupported = { passive: false } as const;\n\n if (isTouchSession) {\n ownerDocument.addEventListener(\"touchmove\", touchMoveHandler, passiveIfSupported);\n ownerDocument.addEventListener(\"touchend\", touchEndHandler, passiveIfSupported);\n ownerDocument.addEventListener(\"touchcancel\", touchCancelHandler);\n stopListeners.push(() => {\n ownerDocument.removeEventListener(\"touchmove\", touchMoveHandler);\n ownerDocument.removeEventListener(\"touchend\", touchEndHandler);\n ownerDocument.removeEventListener(\"touchcancel\", touchCancelHandler);\n });\n } else {\n ownerDocument.addEventListener(\"mousemove\", mouseMoveHandler, passiveIfSupported);\n ownerDocument.addEventListener(\"mouseup\", mouseUpHandler, passiveIfSupported);\n stopListeners.push(() => {\n ownerDocument.removeEventListener(\"mousemove\", mouseMoveHandler);\n ownerDocument.removeEventListener(\"mouseup\", mouseUpHandler);\n });\n }\n\n if (ownerWindow) {\n ownerWindow.addEventListener(\"blur\", windowBlurHandler);\n stopListeners.push(() => ownerWindow.removeEventListener(\"blur\", windowBlurHandler));\n }\n\n table.setColumnResizing((old) => ({\n ...old,\n startOffset,\n startSize,\n deltaOffset: 0,\n deltaPercentage: 0,\n columnSizingStart,\n isResizingColumn: column.id,\n }));\n\n return () => endResize(lastClientX);\n}\n\ntype DataGridTablePinnedBoundary = \"top\" | \"bottom\";\n\nfunction getDataGridTableRowSections<TData extends object>(\n table: DataGridTableInstance<TData>,\n rowsPinnable?: boolean,\n) {\n if (!rowsPinnable) {\n return {\n topRows: [] as Row<DataGridFeatures, TData>[],\n centerRows: table.getRowModel().rows as Row<DataGridFeatures, TData>[],\n bottomRows: [] as Row<DataGridFeatures, TData>[],\n };\n }\n\n return {\n topRows: table.getTopRows() as Row<DataGridFeatures, TData>[],\n centerRows: table.getCenterRows() as Row<DataGridFeatures, TData>[],\n bottomRows: table.getBottomRows() as Row<DataGridFeatures, TData>[],\n };\n}\n\nfunction getDataGridTableResolvedRows<TData extends object>(\n table: DataGridTableInstance<TData>,\n rowsPinnable?: boolean,\n) {\n const { topRows, centerRows, bottomRows } = getDataGridTableRowSections(table, rowsPinnable);\n const resolvedRows: Array<{\n row: Row<DataGridFeatures, TData>;\n pinnedBoundary?: DataGridTablePinnedBoundary;\n }> = [];\n\n topRows.forEach((row, index) => {\n resolvedRows.push({\n row,\n pinnedBoundary:\n index === topRows.length - 1 && (centerRows.length > 0 || bottomRows.length > 0)\n ? \"top\"\n : undefined,\n });\n });\n\n centerRows.forEach((row) => {\n resolvedRows.push({ row });\n });\n\n bottomRows.forEach((row, index) => {\n resolvedRows.push({\n row,\n pinnedBoundary:\n index === 0 && (centerRows.length > 0 || topRows.length > 0) ? \"bottom\" : undefined,\n });\n });\n\n return resolvedRows;\n}\n\nfunction getDataGridTableOrderedVisibleColumns<TData extends object>(\n table: DataGridTableInstance<TData>,\n) {\n return [\n ...table.getStartVisibleLeafColumns(),\n ...table.getCenterVisibleLeafColumns(),\n ...table.getEndVisibleLeafColumns(),\n ] as Column<DataGridFeatures, TData, unknown>[];\n}\n\nfunction getDataGridTableOrderedVisibleCells<TData extends object>(\n row: Row<DataGridFeatures, TData>,\n) {\n return [\n ...row.getStartVisibleCells(),\n ...row.getCenterVisibleCells(),\n ...row.getEndVisibleCells(),\n ] as Cell<DataGridFeatures, TData, unknown>[];\n}\n\nfunction getDataGridTableMergedHeaderGroups<TData extends object>(\n table: DataGridTableInstance<TData>,\n) {\n const leftHeaderGroups = table.getStartHeaderGroups();\n const centerHeaderGroups = table.getCenterHeaderGroups();\n const rightHeaderGroups = table.getEndHeaderGroups();\n const headerGroupCount = Math.max(\n leftHeaderGroups.length,\n centerHeaderGroups.length,\n rightHeaderGroups.length,\n );\n\n return Array.from({ length: headerGroupCount }, (_, index) => {\n const leftGroup = leftHeaderGroups[index];\n const centerGroup = centerHeaderGroups[index];\n const rightGroup = rightHeaderGroups[index];\n\n return {\n id:\n [leftGroup?.id, centerGroup?.id, rightGroup?.id].filter(Boolean).join(\":\") ||\n `header-group-${index}`,\n headers: [\n ...(leftGroup?.headers ?? []),\n ...(centerGroup?.headers ?? []),\n ...(rightGroup?.headers ?? []),\n ] as Header<DataGridFeatures, TData, unknown>[],\n };\n });\n}\n\nfunction hasDataGridTableRightPinnedColumns<TData extends object>(\n table: DataGridTableInstance<TData>,\n) {\n return (table.state.columnPinning.end?.length ?? 0) > 0;\n}\n\n// A meta.fillWidth column absorbs the free space itself, so the fill cells\n// must collapse or the strip would be counted twice.\nfunction hasDataGridFillColumn<TData extends object>(table: DataGridTableInstance<TData>) {\n return table.getVisibleLeafColumns().some((column) => column.columnDef.meta?.fillWidth);\n}\n\nfunction DataGridTableFillCol() {\n const { props, table } = useDataGrid();\n\n if (!props.tableLayout?.columnsResizable) return null;\n\n return (\n <col\n data-slot=\"data-grid-table-fill-col\"\n style={{\n width: hasDataGridFillColumn(table) ? 0 : \"var(--data-grid-fill-size, 0px)\",\n }}\n />\n );\n}\n\nfunction DataGridTableFillHeadCell() {\n const { props, table } = useDataGrid();\n\n if (!props.tableLayout?.columnsResizable) return null;\n\n return (\n <th\n data-slot=\"data-grid-table-fill-head-cell\"\n style={{\n width: hasDataGridFillColumn(table) ? 0 : \"var(--data-grid-fill-size, 0px)\",\n }}\n className={cn(\"p-0\", props.tableLayout?.headerBackground && \"bg-muted\")}\n />\n );\n}\n\nfunction DataGridTableFillBodyCell() {\n const { props, table } = useDataGrid();\n\n if (!props.tableLayout?.columnsResizable) return null;\n\n return (\n <td\n aria-hidden=\"true\"\n data-slot=\"data-grid-table-fill-body-cell\"\n style={{\n width: hasDataGridFillColumn(table) ? 0 : \"var(--data-grid-fill-size, 0px)\",\n }}\n className=\"p-0\"\n />\n );\n}\n\nfunction DataGridTableFillFootCell() {\n const { props, table } = useDataGrid();\n\n if (!props.tableLayout?.columnsResizable) return null;\n\n return (\n <td\n aria-hidden=\"true\"\n data-slot=\"data-grid-table-fill-foot-cell\"\n style={{\n width: hasDataGridFillColumn(table) ? 0 : \"var(--data-grid-fill-size, 0px)\",\n }}\n className=\"p-0\"\n />\n );\n}\n\n/**\n * The quick-create affordance, rendered as the body's last row when\n * `onRowCreate` is set: one full-width ghost button, the Notion/Airtable\n * \"+ New\" idiom. What the click creates stays consumer-owned.\n */\nfunction DataGridTableAddRow() {\n const { i18n, props, table } = useDataGrid();\n\n if (!props.onRowCreate) return null;\n\n return (\n <tr\n data-slot=\"data-grid-table-add-row\"\n className={cn(\n \"hover:bg-muted/40 [thead+tbody_&:first-child]:border-t\",\n props.tableClassNames?.rowCreate,\n )}\n >\n <td\n // The extra column is the filler strip, rendered only when columns\n // are resizable.\n colSpan={\n table.getVisibleLeafColumns().length + (props.tableLayout?.columnsResizable ? 1 : 0)\n }\n className=\"p-0\"\n >\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n // Block-level flex: inline-flex would sit on the cell's text\n // baseline and push the icon and label off vertical center.\n className={cn(\n \"flex w-full items-center justify-start rounded-none px-3 text-muted-foreground\",\n props.tableLayout?.dense ? \"h-8 px-2\" : \"h-9\",\n )}\n onClick={(event) => {\n // Creating often unmounts this affordance (a draft row takes\n // its place); focus would fall to the body and strand the\n // keyboard. Hand it to the grid's focus target instead - but\n // only when it was actually lost, so a consumer that keeps\n // the button mounted keeps repeated Enter presses working.\n // A timer, not rAF: timers also run in background tabs.\n const button = event.currentTarget;\n const grid = button.closest(\"table\");\n props.onRowCreate?.();\n setTimeout(() => {\n if (\n !button.isConnected &&\n grid?.isConnected &&\n grid.tabIndex >= 0 &&\n (document.activeElement === document.body || !document.activeElement)\n ) {\n grid.focus();\n }\n }, 0);\n }}\n >\n <PlusIcon className=\"size-4\" aria-hidden=\"true\" />\n {props.rowCreateLabel ?? i18n.labels.rowCreate}\n </Button>\n </td>\n </tr>\n );\n}\n\nfunction DataGridTableBase({ children }: { children: ReactNode }) {\n const { props, table, recordCount } = useDataGrid();\n const leftVisibleColumns = table.getStartVisibleLeafColumns();\n const centerVisibleColumns = table.getCenterVisibleLeafColumns();\n const rightVisibleColumns = table.getEndVisibleLeafColumns();\n const hasRightPinnedColumns = hasDataGridTableRightPinnedColumns(table);\n\n /**\n * Compute column widths as CSS custom properties once upfront (memoized).\n * Cells reference these via calc(var(--col-X-size) * 1px) so the browser\n * handles width propagation without per-cell getSize() calls or React\n * re-renders of the body.\n */\n const columnSizeVars = useMemo(() => {\n if (!props.tableLayout?.columnsResizable) return undefined;\n const headers = table.getFlatHeaders();\n // A meta.fillWidth column absorbs the filler strip: its size variable\n // carries the unitless fill amount, so every consumer of\n // calc(var(--col-X-size) * 1px) stretches with the container while the\n // fill cells collapse to zero.\n const fillColumnId = table\n .getVisibleLeafColumns()\n .find((column) => column.columnDef.meta?.fillWidth)?.id;\n const colSizes: Record<string, number | string> = {};\n for (let i = 0; i < headers.length; i++) {\n const header = headers[i]!;\n colSizes[`--header-${header.id}-size`] = header.getSize();\n colSizes[`--col-${header.column.id}-size`] =\n header.column.id === fillColumnId\n ? `calc(${header.column.getSize()} + var(--data-grid-fill, 0))`\n : header.column.getSize();\n }\n return colSizes;\n }, [props.tableLayout?.columnsResizable, table.getFlatHeaders, table.getVisibleLeafColumns]);\n\n // With cell selection on, the table announces as a grid so the tds compute\n // as gridcells and aria-selected applies; existing grids keep their plain\n // semantic table untouched.\n const cellSelectionOn = !!props.tableLayout?.cellSelection && table.atoms.cellSelection != null;\n\n return (\n <table\n data-slot=\"data-grid-table\"\n role={cellSelectionOn ? \"grid\" : undefined}\n aria-multiselectable={\n cellSelectionOn && props.tableLayout?.cellSelectionMode !== \"single\" ? true : undefined\n }\n // recordCount can undercount the rows actually present (a pinned\n // draft row a consumer keeps out of its totals), and aria-rowindex\n // is computed from the full display order; the union keeps every\n // announced index inside the announced count.\n aria-rowcount={\n cellSelectionOn\n ? Math.max(recordCount, table.getRowsInDisplayOrder().length) + 1\n : undefined\n }\n className={cn(\n \"caption-bottom text-left align-middle font-normal text-foreground text-sm rtl:text-right\",\n props.tableLayout?.columnsResizable ? \"min-w-0\" : \"w-full min-w-full\",\n props.tableLayout?.width === \"auto\" ? \"table-auto\" : \"table-fixed\",\n !props.tableLayout?.columnsResizable && \"\",\n !props.tableLayout?.columnsDraggable && \"border-separate border-spacing-0\",\n props.tableClassNames?.base,\n )}\n style={\n props.tableLayout?.columnsResizable\n ? {\n ...columnSizeVars,\n width: `calc(${table.getTotalSize()}px + var(--data-grid-fill-size, 0px))`,\n }\n : undefined\n }\n >\n <colgroup>\n {[...leftVisibleColumns, ...centerVisibleColumns].map((column) => (\n <col\n key={column.id}\n style={\n props.tableLayout?.columnsResizable\n ? { width: `calc(var(--col-${column.id}-size) * 1px)` }\n : props.tableLayout?.width === \"fixed\"\n ? { width: column.getSize() }\n : undefined\n }\n />\n ))}\n {hasRightPinnedColumns ? <DataGridTableFillCol /> : null}\n {rightVisibleColumns.map((column) => (\n <col\n key={column.id}\n style={\n props.tableLayout?.columnsResizable\n ? { width: `calc(var(--col-${column.id}-size) * 1px)` }\n : props.tableLayout?.width === \"fixed\"\n ? { width: column.getSize() }\n : undefined\n }\n />\n ))}\n {!hasRightPinnedColumns ? <DataGridTableFillCol /> : null}\n </colgroup>\n {children}\n </table>\n );\n}\n\nfunction DataGridTableViewport({\n children,\n className,\n viewportRef,\n style,\n}: {\n children: ReactNode;\n className?: string;\n viewportRef?: Ref<HTMLDivElement>;\n style?: CSSProperties;\n}) {\n const { props, table, autoSize } = useDataGrid();\n const isColumnsResizable = !!props.tableLayout?.columnsResizable;\n const viewportNodeRef = useRef<HTMLDivElement | null>(null);\n const fillStateRef = useRef({ containerWidth: 0, appliedFill: -1 });\n const stopContainerObserverRef = useRef<(() => void) | null>(null);\n\n // Free space is written as a CSS variable directly on the viewport node\n // instead of React state, so container resizes and column-size commits\n // reach the fill column without re-rendering the grid.\n const syncFillWidth = useCallback(() => {\n const node = viewportNodeRef.current;\n if (!node) return;\n\n const freeSpace = fillStateRef.current.containerWidth - table.getTotalSize();\n const fillWidth = Math.max(0, freeSpace);\n\n if (fillStateRef.current.appliedFill !== fillWidth) {\n fillStateRef.current.appliedFill = fillWidth;\n node.style.setProperty(\"--data-grid-fill-size\", `${fillWidth}px`);\n // Unitless twin for the meta.fillWidth column, whose size variable\n // participates in a calc that multiplies by 1px afterwards.\n node.style.setProperty(\"--data-grid-fill\", String(fillWidth));\n }\n\n // Signed on purpose: a shrinking container drives the free space\n // NEGATIVE, which is exactly what tells a meta.autoSize column to hand\n // its absorbed width back.\n autoSize?.apply(freeSpace);\n }, [autoSize, table]);\n\n const handleViewportRef = useCallback(\n (node: HTMLDivElement | null) => {\n stopContainerObserverRef.current?.();\n stopContainerObserverRef.current = null;\n viewportNodeRef.current = node;\n assignRef(viewportRef, node);\n\n if (!node) return;\n\n if (!isColumnsResizable) {\n fillStateRef.current.appliedFill = -1;\n node.style.removeProperty(\"--data-grid-fill-size\");\n node.style.removeProperty(\"--data-grid-fill\");\n return;\n }\n\n const scrollViewport = getDataGridScrollAreaViewport(node) ?? node.parentElement;\n const measurementTarget = scrollViewport ?? node;\n\n const measure = () => {\n fillStateRef.current.containerWidth = measurementTarget.clientWidth;\n syncFillWidth();\n };\n\n // First measure runs inside the mount commit, before paint, so the fill\n // column and any meta.autoSize growth land in the first painted frame.\n measure();\n\n if (typeof ResizeObserver !== \"undefined\") {\n const observer = new ResizeObserver(measure);\n observer.observe(measurementTarget);\n stopContainerObserverRef.current = () => observer.disconnect();\n }\n },\n [isColumnsResizable, syncFillWidth, viewportRef],\n );\n\n // Column sizing commits and visibility changes alter the table's total size\n // without moving the container, so the fill var must re-sync after renders\n // the ResizeObserver never sees. No-ops when the value is unchanged.\n useLayoutEffect(() => {\n if (!isColumnsResizable) return;\n syncFillWidth();\n });\n\n return (\n <div\n data-slot=\"data-grid-table-viewport\"\n ref={handleViewportRef}\n className={cn(\"relative min-w-full align-top\", className)}\n style={{\n ...(isColumnsResizable\n ? {\n width: `calc(${table.getTotalSize()}px + var(--data-grid-fill-size, 0px))`,\n }\n : undefined),\n ...style,\n }}\n >\n {children}\n <DataGridTableResizeIndicator viewportNodeRef={viewportNodeRef} />\n </div>\n );\n}\n\nfunction DataGridTableHead({ children }: { children: ReactNode }) {\n const { props } = useDataGrid();\n\n return (\n <thead\n className={cn(\n props.tableClassNames?.header,\n props.tableLayout?.headerSticky && props.tableClassNames?.headerSticky,\n )}\n >\n {children}\n </thead>\n );\n}\n\nfunction DataGridTableHeadRow({ children }: { children: ReactNode; rowId: string }) {\n const { props } = useDataGrid();\n\n return (\n <tr\n aria-rowindex={props.tableLayout?.cellSelection ? 1 : undefined}\n className={cn(\n props.tableLayout?.headerBorder && \"[&>th]:border-b\",\n props.tableLayout?.cellBorder && \"*:last:border-e-0\",\n props.tableLayout?.stripped && \"bg-transparent\",\n props.tableLayout?.headerBackground === false && \"bg-transparent\",\n props.tableClassNames?.headerRow,\n )}\n >\n {children}\n </tr>\n );\n}\n\nfunction DataGridTableHeadRowCell<TData extends object>({\n children,\n header,\n dndRef,\n dndStyle,\n}: {\n children: ReactNode;\n header: Header<DataGridFeatures, TData, unknown>;\n dndRef?: React.Ref<HTMLTableCellElement>;\n dndStyle?: CSSProperties;\n}) {\n const { props, table } = useDataGrid();\n\n const { column } = header;\n const isPinned = column.getIsPinned();\n const isFirstStartPinned = isPinned === \"start\" && column.getIsFirstColumn(\"start\");\n const isLastStartPinned = isPinned === \"start\" && column.getIsLastColumn(\"start\");\n const isFirstEndPinned = isPinned === \"end\" && column.getIsFirstColumn(\"end\");\n const isLastEndPinned = isPinned === \"end\" && column.getIsLastColumn(\"end\");\n const isLastVisibleColumn =\n column.getIndex() === header.getContext().table.getVisibleLeafColumns().length - 1;\n const headerCellSpacing = headerCellSpacingVariants({\n size: props.tableLayout?.dense ? \"dense\" : \"default\",\n });\n\n const sortDirection = column.getIsSorted();\n\n return (\n <th\n ref={dndRef}\n scope=\"col\"\n colSpan={header.colSpan > 1 ? header.colSpan : undefined}\n aria-sort={\n sortDirection === \"asc\"\n ? \"ascending\"\n : sortDirection === \"desc\"\n ? \"descending\"\n : column.getCanSort()\n ? \"none\"\n : undefined\n }\n aria-colindex={props.tableLayout?.cellSelection ? column.getIndex() + 1 : undefined}\n data-col-id={column.id}\n style={{\n ...(props.tableLayout?.width === \"fixed\" &&\n !props.tableLayout?.columnsResizable && {\n width: header.getSize(),\n }),\n ...(props.tableLayout?.columnsPinnable && column.getCanPin() && getPinningStyles(column)),\n // A sticky child does not ride a sticky ancestor: under a sticky\n // header the pinned cell's own position:sticky (horizontal) opts it\n // out of the thead's vertical stickiness, and the corner scrolls\n // away while its non-positioned siblings stick. Pin both axes on\n // the cell itself.\n ...(props.tableLayout?.headerSticky && isPinned && { top: 0 }),\n ...(props.tableLayout?.columnsResizable && {\n width: `calc(var(--header-${header.id}-size) * 1px)`,\n }),\n ...(dndStyle ? dndStyle : null),\n }}\n data-pinned={isPinned || undefined}\n data-outer-pinned-col={isFirstStartPinned ? \"start\" : isLastEndPinned ? \"end\" : undefined}\n data-last-col={isLastStartPinned ? \"start\" : isFirstEndPinned ? \"end\" : undefined}\n className={cn(\n \"relative h-10 text-left align-middle font-medium text-foreground rtl:text-right [&:has([role=checkbox])]:pe-0\",\n headerCellSpacing,\n props.tableLayout?.headerBackground && \"bg-muted\",\n props.tableLayout?.cellBorder && \"border-e\",\n // The resize filler column follows the center group, and a border on\n // the last center cell would float against that empty strip.\n props.tableLayout?.cellBorder &&\n props.tableLayout?.columnsResizable &&\n // With end-pinned columns but no pin affordance, the pinned edge\n // draws no separator of its own; keep the border then.\n (props.tableLayout?.columnsPinnable || !hasDataGridTableRightPinnedColumns(table)) &&\n !isPinned &&\n column.getIsLastColumn(\"center\") &&\n \"border-e-0\",\n props.tableLayout?.columnsResizable &&\n column.getCanResize() &&\n (isPinned ? \"overflow-hidden\" : \"overflow-visible\"),\n props.tableLayout?.columnsResizable &&\n column.getCanResize() &&\n isLastVisibleColumn &&\n \"pe-8\",\n props.tableLayout?.columnsPinnable &&\n column.getCanPin() &&\n cn(\n \"data-pinned:isolate data-pinned:bg-muted data-outer-pinned-col:bg-clip-padding\",\n \"[&[data-pinned=end]:last-child_div.cursor-col-resize:last-child]:opacity-0 [&[data-pinned=end][data-last-col=end]]:shadow-[inset_1px_0_0_0_var(--border)] [&[data-pinned=start][data-last-col=start]]:shadow-[inset_-1px_0_0_0_var(--border)]\",\n \"[&:not([data-pinned]):has(+[data-pinned])_div.cursor-col-resize:last-child]:opacity-0 [&[data-last-col=start]_div.cursor-col-resize:last-child]:opacity-0\",\n ),\n header.column.columnDef.meta?.headerClassName,\n // Edge detection spans the full visible leaf order; the header's own\n // group only covers one pinning bucket.\n column.getIndex() === 0 || isLastVisibleColumn ? props.tableClassNames?.edgeCell : \"\",\n )}\n >\n {children}\n </th>\n );\n}\n\n/**\n * TanStack's own default, restated here on purpose.\n *\n * v8 merged each feature's default table options into `table.options`, so\n * reading `table.options.columnResizeMode` gave you `\"onEnd\"` even when the\n * consumer never set it. v9 resolves feature defaults internally and leaves\n * the option `undefined` on the instance, so the old `?? table.options...`\n * fallback quietly produced `undefined` - and every grid that had not opted\n * into a mode explicitly lost the onEnd drag session: no cursor lock, no\n * vertical indicator, and an immediate commit instead of a deferred one.\n */\nconst DATA_GRID_DEFAULT_COLUMN_RESIZE_MODE = \"onEnd\" as const;\n\nfunction getDataGridColumnResizeMode(\n layoutMode: \"onChange\" | \"onEnd\" | undefined,\n tableMode: \"onChange\" | \"onEnd\" | undefined,\n) {\n return layoutMode ?? tableMode ?? DATA_GRID_DEFAULT_COLUMN_RESIZE_MODE;\n}\n\nfunction DataGridTableHeadRowCellResize<TData extends object>({\n header,\n}: {\n header: Header<DataGridFeatures, TData, unknown>;\n}) {\n const { props, table } = useDataGrid<TData>();\n const { column } = header;\n const isPinned = column.getIsPinned();\n const isLastVisibleColumn =\n column.getIndex() === header.getContext().table.getVisibleLeafColumns().length - 1;\n const isResizeModeOnEnd =\n getDataGridColumnResizeMode(\n props.tableLayout?.columnsResizeMode,\n table.options.columnResizeMode,\n ) === \"onEnd\";\n const stopResizeSessionRef = useRef<(() => void) | undefined>(undefined);\n\n // End a live drag if the handle unmounts mid-resize so document listeners\n // and the app-wide col-resize cursor don't outlive the grid.\n useEffect(() => {\n return () => {\n stopResizeSessionRef.current?.();\n stopResizeSessionRef.current = undefined;\n };\n }, []);\n\n const handleMouseDown = (event: ReactMouseEvent<HTMLElement>) => {\n // Only the primary button starts a resize; guard before preventDefault so\n // right-click still opens the context menu.\n if (event.button !== 0) return;\n\n event.preventDefault();\n event.stopPropagation();\n\n stopResizeSessionRef.current?.();\n stopResizeSessionRef.current = startDataGridColumnResizeOnEnd(\n event,\n header,\n table,\n !isResizeModeOnEnd,\n );\n };\n\n const handleTouchStart = (event: ReactTouchEvent<HTMLElement>) => {\n event.preventDefault();\n event.stopPropagation();\n\n stopResizeSessionRef.current?.();\n stopResizeSessionRef.current = startDataGridColumnResizeOnEnd(\n event,\n header,\n table,\n !isResizeModeOnEnd,\n );\n };\n\n return (\n // A span, deliberately: consumers stretch end-aligned header CONTENT\n // with `[&>div]:w-full` on headerClassName, and that compiled child\n // selector (0,1,1) beats the handle's own w-5 (0,1,0) - a div handle\n // then covers the whole cell and swallows the menu click. Hardening\n // w-5 with ! was rejected: the tag change removes the fight instead\n // of escalating it.\n <span\n data-slot=\"data-grid-table-resize-handle\"\n {...{\n onDoubleClick: () => column.resetSize(),\n onMouseDown: handleMouseDown,\n onTouchStart: handleTouchStart,\n className: cn(\n \"user-select-none absolute top-0 z-10 flex h-full cursor-col-resize touch-none\",\n isPinned === \"end\"\n ? cn(\n // An end-pinned column grows from its START edge (its end is\n // anchored), so the handle lives there, inside the sticky\n // cell.\n \"start-0 w-5 justify-start\",\n props.tableLayout?.columnsPinnable\n ? \"before:hidden\"\n : \"before:absolute before:inset-y-0 before:start-0 before:w-px before:bg-border\",\n )\n : isLastVisibleColumn\n ? \"end-0 w-5 justify-end before:hidden\"\n : isPinned\n ? cn(\n // A pinned column is sticky, so the handle sits inside the\n // cell instead of straddling the boundary, where the next\n // sticky cell would paint over it.\n \"end-0 w-5 justify-end\",\n // With the pin affordance on, the pinned edge already draws\n // its own separator and a resize line would double it. But\n // pinning is also usable purely as an ordering lock, with no\n // affordance and no separator -- and there this line is the\n // only thing marking the edge, so hiding it left a resizable\n // column showing a resize cursor and no indicator at all.\n props.tableLayout?.columnsPinnable\n ? \"before:hidden\"\n : \"before:absolute before:inset-y-0 before:end-0 before:w-px before:bg-border\",\n )\n : cn(\n \"-end-2 w-5 justify-center\",\n // With cell borders on, the th border-e already marks every\n // boundary and this always-on line would double it; the wide\n // hit area and resize cursor stay.\n props.tableLayout?.cellBorder\n ? \"before:hidden\"\n : \"before:absolute before:inset-y-0 before:w-px before:-translate-x-px before:bg-border\",\n ),\n column.getIsResizing() &&\n (isResizeModeOnEnd\n ? \"opacity-100\"\n : isLastVisibleColumn\n ? \"opacity-100 before:absolute before:inset-y-0 before:end-0 before:block before:w-0.5 before:bg-primary\"\n : \"opacity-100 before:block before:w-0.5 before:bg-primary\"),\n ),\n }}\n />\n );\n}\n\nfunction DataGridTableResizeIndicator({\n viewportNodeRef,\n}: {\n viewportNodeRef: RefObject<HTMLDivElement | null>;\n}) {\n const { props, table } = useDataGrid();\n const indicatorRef = useRef<HTMLDivElement | null>(null);\n const indicatorHeadRef = useRef<HTMLDivElement | null>(null);\n // Header height is stable for the duration of a drag; caching it per\n // session avoids a forced layout (querySelector + getBoundingClientRect)\n // on every mousemove.\n const headerHeightCacheRef = useRef<{\n key: string | false;\n value: number;\n }>({ key: false, value: 0 });\n const columnResizing = table.state.columnResizing;\n const resizingColumnId = columnResizing.isResizingColumn;\n const resizeMode = getDataGridColumnResizeMode(\n props.tableLayout?.columnsResizeMode,\n table.options.columnResizeMode,\n );\n const isActive = !!(\n props.tableLayout?.columnsResizable &&\n resizeMode === \"onEnd\" &&\n resizingColumnId\n );\n\n // Positioning happens imperatively after each drag-frame render: layout\n // reads (viewport rect, thead height) and ref access belong outside render,\n // and writing styles directly avoids holding the viewport node in React\n // state, which would cost every grid a second render pass at mount.\n useLayoutEffect(() => {\n const indicator = indicatorRef.current;\n const indicatorHead = indicatorHeadRef.current;\n const viewportElement = viewportNodeRef.current;\n\n if (!isActive || !indicator || !indicatorHead || !resizingColumnId) return;\n\n const resizingHeader = table\n .getFlatHeaders()\n .find((header) => header.column.id === resizingColumnId || header.id === resizingColumnId);\n\n if (!resizingHeader) return;\n\n // deltaOffset is a logical delta (already direction-adjusted); translate\n // by the physical pointer movement so the indicator follows the cursor\n // instead of mirroring it. End-pinned columns resize mirrored (see the\n // session), so the multiplier matches theirs.\n const directionMultiplier =\n (table.options.columnResizeDirection === \"rtl\") !==\n (resizingHeader.column.getIsPinned() === \"end\")\n ? -1\n : 1;\n const deltaOffset = (columnResizing.deltaOffset ?? 0) * directionMultiplier;\n\n if (headerHeightCacheRef.current.key !== resizingColumnId) {\n headerHeightCacheRef.current = {\n key: resizingColumnId,\n value:\n viewportElement\n ?.querySelector('[data-slot=\"data-grid-table\"] thead')\n ?.getBoundingClientRect().height ?? 0,\n };\n }\n\n const headerHeight = headerHeightCacheRef.current.value;\n // Anchor on the live header cell: content math (getStart) cannot place a\n // STICKY pinned column, while the DOM rect is right for every column at\n // any scroll position. The state offset and content math stay as\n // fallbacks for a header that is not in the DOM.\n const viewportRoot =\n viewportElement ?? indicator.closest<HTMLElement>('[data-slot=\"data-grid-table-viewport\"]');\n const headerCellElement = viewportRoot?.querySelector<HTMLElement>(\n `thead th[data-col-id=\"${CSS.escape(resizingHeader.column.id)}\"]`,\n );\n let indicatorLeft: number;\n if (headerCellElement && viewportRoot) {\n const anchorRect = headerCellElement.getBoundingClientRect();\n const edgeClientX =\n (table.options.columnResizeDirection === \"rtl\") !==\n (resizingHeader.column.getIsPinned() === \"end\")\n ? anchorRect.left\n : anchorRect.right;\n indicatorLeft = edgeClientX - viewportRoot.getBoundingClientRect().left;\n } else if (typeof columnResizing.startOffset === \"number\" && viewportElement) {\n indicatorLeft = columnResizing.startOffset - viewportElement.getBoundingClientRect().left;\n } else {\n indicatorLeft = resizingHeader.getStart() + resizingHeader.getSize();\n }\n\n indicator.style.left = `${indicatorLeft}px`;\n indicator.style.transform = `translateX(${deltaOffset}px)`;\n indicatorHead.style.height = `${Math.max(headerHeight, 6)}px`;\n });\n\n if (!isActive) return null;\n\n return (\n <div\n ref={indicatorRef}\n aria-hidden=\"true\"\n data-slot=\"data-grid-table-resize-indicator\"\n className=\"pointer-events-none absolute inset-y-0 z-50\"\n >\n <div className=\"absolute inset-y-0 left-0 w-px -translate-x-1/2 bg-primary/85\" />\n <div\n ref={indicatorHeadRef}\n className=\"absolute top-0 left-0 -translate-x-1/2 rounded-b-sm bg-primary shadow-xs\"\n style={{ width: 5 }}\n />\n </div>\n );\n}\n\nfunction DataGridTableRowSpacer() {\n return <tbody aria-hidden=\"true\" className=\"h-2\" data-slot=\"data-grid-table-body-spacer\" />;\n}\n\nfunction DataGridTableBody({ children }: { children: ReactNode }) {\n const { props } = useDataGrid();\n\n return (\n <tbody\n data-slot=\"data-grid-table-body\"\n className={cn(\n props.tableLayout?.rowRounded && \"[&_td:first-child]:rounded-l-lg\",\n props.tableLayout?.rowRounded && \"[&_td:last-child]:rounded-r-lg\",\n props.tableClassNames?.body,\n )}\n >\n {children}\n </tbody>\n );\n}\n\nfunction DataGridTableFoot({ children }: { children: ReactNode }) {\n const { props } = useDataGrid();\n return (\n <tfoot data-slot=\"data-grid-table-foot\" className={cn(props.tableClassNames?.footer)}>\n {children}\n </tfoot>\n );\n}\n\nfunction DataGridTableFootRow({ children }: { children: ReactNode }) {\n const { props, table } = useDataGrid();\n const footRowBottomBorderClasses = \"[&:not(:last-child)>td]:border-b\";\n\n return (\n <tr\n data-slot=\"data-grid-table-foot-row\"\n className={cn(\n props.tableLayout?.footerBackground && \"bg-muted/40 dark:bg-background\",\n props.tableLayout?.rowBorder && footRowBottomBorderClasses,\n props.tableLayout?.cellBorder && \"*:last:border-e-0\",\n // The fill foot cell is the :last child, so the rule above only\n // strips the filler; the real last cell needs the same treatment or\n // its border floats into the strip while thead and tbody suppress\n // theirs. Same pin-affordance gate as the cell-level suppressors.\n props.tableLayout?.cellBorder &&\n props.tableLayout?.columnsResizable &&\n (props.tableLayout?.columnsPinnable || !hasDataGridTableRightPinnedColumns(table)) &&\n \"[&>td:has(+td[data-slot=data-grid-table-fill-foot-cell])]:border-e-0\",\n )}\n >\n {children}\n <DataGridTableFillFootCell />\n </tr>\n );\n}\n\nfunction DataGridTableFootRowCell({\n children,\n colSpan,\n className,\n}: {\n children?: ReactNode;\n colSpan?: number;\n className?: string;\n}) {\n const { props } = useDataGrid();\n const spacing = footerCellSpacingVariants({\n size: props.tableLayout?.dense ? \"dense\" : \"default\",\n });\n return (\n <td\n colSpan={colSpan}\n className={cn(\n \"align-middle font-medium text-secondary-foreground/80\",\n spacing,\n props.tableLayout?.footerBackground && \"bg-muted/40 dark:bg-background\",\n props.tableLayout?.cellBorder && \"border-e\",\n className,\n )}\n >\n {children}\n </td>\n );\n}\n\nfunction DataGridTableBodyRowSkeleton({ children }: { children: ReactNode }) {\n const { props } = useDataGrid();\n\n return (\n <tr\n className={cn(\n \"hover:bg-muted/40 data-[state=selected]:bg-muted/50\",\n props.onRowClick && \"cursor-pointer\",\n !props.tableLayout?.stripped &&\n props.tableLayout?.rowBorder &&\n \"border-border border-b [&:not(:last-child)>td]:border-b\",\n props.tableLayout?.cellBorder && \"*:last:border-e-0\",\n props.tableLayout?.stripped && \"odd:bg-muted/90 hover:bg-transparent odd:hover:bg-muted\",\n props.tableClassNames?.bodyRow,\n )}\n >\n {children}\n </tr>\n );\n}\n\nfunction DataGridTableBodyRowSkeletonCell<TData extends object>({\n children,\n column,\n}: {\n children: ReactNode;\n column: Column<DataGridFeatures, TData, unknown>;\n}) {\n const { props, table } = useDataGrid();\n const bodyCellSpacing = bodyCellSpacingVariants({\n size: props.tableLayout?.dense ? \"dense\" : \"default\",\n });\n\n return (\n <td\n style={\n props.tableLayout?.columnsResizable\n ? { width: `calc(var(--col-${column.id}-size) * 1px)` }\n : undefined\n }\n className={cn(\n \"align-middle\",\n bodyCellSpacing,\n props.tableLayout?.cellBorder && \"border-e\",\n props.tableLayout?.cellBorder &&\n props.tableLayout?.columnsResizable &&\n // With end-pinned columns but no pin affordance, the pinned edge\n // draws no separator of its own; keep the border then.\n (props.tableLayout?.columnsPinnable || !hasDataGridTableRightPinnedColumns(table)) &&\n !column.getIsPinned() &&\n column.getIsLastColumn(\"center\") &&\n \"border-e-0\",\n props.tableLayout?.columnsResizable && column.getCanResize() && \"truncate\",\n column.columnDef.meta?.cellClassName,\n props.tableLayout?.columnsPinnable &&\n column.getCanPin() &&\n \"data-pinned:isolate data-pinned:bg-background [&[data-pinned=end][data-last-col=end]]:shadow-[inset_1px_0_0_0_var(--border)] [&[data-pinned=start][data-last-col=start]]:shadow-[inset_-1px_0_0_0_var(--border)]\",\n column.getIndex() === 0 || column.getIndex() === table.getVisibleLeafColumns().length - 1\n ? props.tableClassNames?.edgeCell\n : \"\",\n )}\n >\n {children}\n </td>\n );\n}\n\nfunction DataGridTableBodyRow<TData extends object>({\n children,\n row,\n pinnedBoundary,\n rowRef,\n dndRef,\n dndStyle,\n dataIndex,\n}: {\n children: ReactNode;\n row: Row<DataGridFeatures, TData>;\n pinnedBoundary?: DataGridTablePinnedBoundary;\n rowRef?: React.Ref<HTMLTableRowElement>;\n dndRef?: React.Ref<HTMLTableRowElement>;\n dndStyle?: CSSProperties;\n dataIndex?: number;\n}) {\n const { props, table } = useDataGrid();\n const isRowPinned = row.getIsPinned();\n const rowStatus = props.getRowStatus?.(row.original);\n\n const bodyRowBottomBorderClasses =\n \"[&:not(:last-child)>td]:border-b [tbody:has(+tfoot)_&:last-child>td]:border-b [*:has(>[data-slot=data-grid]+[data-slot=data-grid-pagination])_[data-slot=data-grid]_&:last-child>td]:border-b\";\n\n return (\n <tr\n ref={(node) => {\n assignRef(rowRef, node);\n assignRef(dndRef, node);\n }}\n style={{ ...(dndStyle ? dndStyle : null) }}\n data-state={table.options.enableRowSelection && row.getIsSelected() ? \"selected\" : undefined}\n data-index={dataIndex}\n data-row-id={row.id}\n data-depth={row.depth || undefined}\n data-row-pinned={isRowPinned || undefined}\n data-row-pinned-boundary={pinnedBoundary}\n data-row-status={rowStatus}\n // 1-based after the header row; row.index is the position in the data,\n // so the announced index stays absolute across pagination.\n aria-rowindex={props.tableLayout?.cellSelection ? row.index + 2 : undefined}\n onClick={() => props.onRowClick?.(row.original)}\n className={cn(\n \"hover:bg-muted/40 data-[state=selected]:bg-muted/50\",\n /* Pinned cells hide scrolled content behind an OPAQUE background,\n which also hides the row's translucent hover and selected tints;\n they get the same tints premixed over the background instead,\n the row-status treatment. */\n \"hover:[&>td[data-pinned]]:bg-[color-mix(in_oklab,var(--muted)_40%,var(--background))]\",\n \"data-[state=selected]:[&>td[data-pinned]]:bg-[color-mix(in_oklab,var(--muted)_50%,var(--background))]\",\n props.onRowClick && \"cursor-pointer\",\n // Optional CRUD indications, active only when getRowStatus is\n // wired; the warning-muted defaults yield to tableClassNames\n // overrides per status. Pinned cells must stay OPAQUE (they hide\n // scrolled content), so they get the same tint pre-mixed over the\n // background instead of inheriting the translucent row fill.\n props.getRowStatus &&\n \"data-[row-status=deleted]:bg-destructive/5 data-[row-status=dirty]:bg-amber-500/5 data-[row-status=new]:bg-green-500/5 data-[row-status=deleted]:opacity-60 data-[row-status=deleted]:[&_td]:line-through\",\n props.getRowStatus &&\n \"data-[row-status=deleted]:[&>td[data-pinned]]:bg-[color-mix(in_oklab,var(--destructive)_5%,var(--background))] data-[row-status=dirty]:[&>td[data-pinned]]:bg-[color-mix(in_oklab,var(--color-amber-500)_5%,var(--background))] data-[row-status=new]:[&>td[data-pinned]]:bg-[color-mix(in_oklab,var(--color-green-500)_5%,var(--background))]\",\n rowStatus === \"new\" && props.tableClassNames?.rowNew,\n rowStatus === \"dirty\" && props.tableClassNames?.rowDirty,\n rowStatus === \"deleted\" && props.tableClassNames?.rowDeleted,\n !props.tableLayout?.stripped && props.tableLayout?.rowBorder && bodyRowBottomBorderClasses,\n props.tableLayout?.cellBorder && `*:last:border-e-0 ${bodyRowBottomBorderClasses}`,\n // Virtualized rows stripe by absolute row index (CSS :nth-child\n // parity flips as spacer rows resize while scrolling).\n props.tableLayout?.stripped &&\n (typeof dataIndex === \"number\"\n ? cn(\"hover:bg-transparent\", dataIndex % 2 === 0 && \"bg-muted/90 hover:bg-muted\")\n : \"odd:bg-muted/90 hover:bg-transparent odd:hover:bg-muted\"),\n props.tableLayout?.rowsPinnable && isRowPinned && \"bg-muted/30 hover:bg-muted/50\",\n pinnedBoundary === \"top\" &&\n \"[&>td]:shadow-[0_2px_0_rgba(0,0,0,0.03)] dark:[&>td]:shadow-[0_2px_0_rgba(255,255,255,0.06)]\",\n // A bottom-pinned row borders scrolled content along its TOP edge,\n // so its separator shadow casts upward.\n pinnedBoundary === \"bottom\" &&\n \"[&>td]:shadow-[0_-2px_0_rgba(0,0,0,0.03)] dark:[&>td]:shadow-[0_-2px_0_rgba(255,255,255,0.06)]\",\n props.tableLayout?.rowsPinnable && isRowPinned && props.tableClassNames?.rowPinned,\n props.tableClassNames?.bodyRow,\n )}\n >\n {children}\n </tr>\n );\n}\n\nfunction DataGridTableBodyRowExpandded<TData extends object>({\n row,\n}: {\n row: Row<DataGridFeatures, TData>;\n}) {\n const { props, table } = useDataGrid();\n const expandedContent = table\n .getAllColumns()\n .find((column) => column.columnDef.meta?.expandedContent)?.columnDef.meta?.expandedContent;\n\n // Tree and grouped rows share row.getIsExpanded() with detail expansion.\n // Without a detail column there is nothing to render, and an empty <tr>\n // would break striping parity, rowBorder, and virtual row measurement.\n if (!expandedContent) return null;\n\n const bodyRowBottomBorderClasses =\n \"[&:not(:last-child)>td]:border-b [tbody:has(+tfoot)_&:last-child>td]:border-b [*:has(>[data-slot=data-grid]+[data-slot=data-grid-pagination])_[data-slot=data-grid]_&:last-child>td]:border-b\";\n\n return (\n <tr className={cn(props.tableLayout?.rowBorder && bodyRowBottomBorderClasses)}>\n <td\n colSpan={\n getDataGridTableOrderedVisibleCells(row).length +\n (props.tableLayout?.columnsResizable ? 1 : 0)\n }\n >\n {expandedContent(row.original)}\n </td>\n </tr>\n );\n}\n\n/**\n * Interactive descendants keep their own mousedown semantics: a click on a\n * button, link, editor or checkbox inside a cell must never start or replace\n * a range. One selector also covers the row-dnd grip (a button), the expand\n * toggle, and `data-cell-interactive` - the documented opt-out for custom\n * widgets built from elements the tag list cannot know about.\n */\nfunction isDataGridCellInteractiveTarget(target: EventTarget | null): boolean {\n return (\n target instanceof Element &&\n target.closest(\n 'button, a, input, select, textarea, [contenteditable], [role=\"checkbox\"], [data-cell-interactive], [data-slot=\"data-grid-table-row-expand\"], [data-slot=\"data-grid-cell-fill-handle\"]',\n ) != null\n );\n}\n\nfunction DataGridTableBodyRowCell<TData extends object>({\n children,\n cell,\n dndRef,\n dndStyle,\n columnIndex,\n}: {\n children: ReactNode;\n cell: Cell<DataGridFeatures, TData, unknown>;\n dndRef?: React.Ref<HTMLTableCellElement>;\n dndStyle?: CSSProperties;\n /** Center-column index under column virtualization; data-column-index. */\n columnIndex?: number;\n}) {\n const { props, table, gridId } = useDataGrid();\n\n const { column, row } = cell;\n const isPinned = column.getIsPinned();\n const isLastStartPinned = isPinned === \"start\" && column.getIsLastColumn(\"start\");\n const isFirstEndPinned = isPinned === \"end\" && column.getIsFirstColumn(\"end\");\n const bodyCellSpacing = bodyCellSpacingVariants({\n size: props.tableLayout?.dense ? \"dense\" : \"default\",\n });\n\n // The atom check backs up the flag: consumers may hand the grid a leaner\n // bundle without cellSelectionFeature, and the flag alone must not make the\n // renderer call prototype APIs that were never assigned.\n const cellSelectionOn = !!props.tableLayout?.cellSelection && table.atoms.cellSelection != null;\n const rangeSelectionOn = cellSelectionOn && props.tableLayout?.cellSelectionMode !== \"single\";\n\n const renderTd = (selection: ReturnType<typeof getDataGridCellSelectionCellAttrs> | null) => (\n <td\n ref={dndRef}\n // The id is what the controller's aria-activedescendant points at, so\n // a screen reader tracks the focused cell through the container-focus\n // model.\n id={\n cellSelectionOn\n ? `${gridId}c-${toDataGridDomId(row.id)}-${toDataGridDomId(column.id)}`\n : undefined\n }\n aria-colindex={cellSelectionOn ? column.getIndex() + 1 : undefined}\n style={{\n ...(props.tableLayout?.columnsPinnable && column.getCanPin() && getPinningStyles(column)),\n // Paint containment clips at the padding edge, which would erase\n // the ::before selection chrome on pinned cells.\n ...(cellSelectionOn ? { contain: undefined } : null),\n ...(props.tableLayout?.columnsResizable && {\n width: `calc(var(--col-${column.id}-size) * 1px)`,\n }),\n ...(dndStyle ? dndStyle : null),\n }}\n data-pinned={isPinned || undefined}\n data-last-col={isLastStartPinned ? \"start\" : isFirstEndPinned ? \"end\" : undefined}\n data-cell-status={props.getCellStatus?.(row.original, column.id)}\n data-column-index={columnIndex}\n {...(selection ? selection : null)}\n onMouseDown={\n selection\n ? (event) => {\n if (event.button !== 0) return;\n if (isDataGridCellInteractiveTarget(event.target)) {\n // A modifier click is a SELECTION gesture even on a control:\n // Shift extends and Ctrl/Cmd adds, exactly as on a plain\n // cell, so no column is unreachable for ranges.\n if (\n rangeSelectionOn &&\n (event.shiftKey || event.metaKey || event.ctrlKey) &&\n cell.getCanSelect()\n ) {\n event.preventDefault();\n cell.getSelectionStartHandler()(event);\n return;\n }\n // The press starts the range session exactly like a plain\n // cell: the cell focuses, a drag extends from it, and a\n // motionless press still ends in the control's own click\n // (this is why drag releases are squelched upstream, in the\n // controller, once a drag actually grew the range).\n if (cell.getCanSelect()) {\n if (rangeSelectionOn) {\n cell.getSelectionStartHandler()(event);\n } else {\n table.setFocusedCell(row.id, column.id);\n }\n }\n return;\n }\n if (!rangeSelectionOn) {\n // Single mode: every gesture collapses to the one cell.\n if (cell.getCanSelect()) {\n table.setFocusedCell(row.id, column.id);\n }\n return;\n }\n cell.getSelectionStartHandler()(event);\n }\n : undefined\n }\n onMouseEnter={\n rangeSelectionOn ? (event) => cell.getSelectionExtendHandler()(event) : undefined\n }\n className={cn(\n \"align-middle\",\n bodyCellSpacing,\n // The classic edited-cell corner mark, active only when\n // getCellStatus is wired: amber for \"dirty\", destructive for\n // \"invalid\".\n props.getCellStatus &&\n \"data-cell-status:relative data-cell-status:after:absolute data-cell-status:after:end-0 data-cell-status:after:top-0 data-cell-status:after:size-0 data-cell-status:after:border-s-[5px] data-cell-status:after:border-s-transparent data-[cell-status=dirty]:after:border-t-amber-500 data-[cell-status=invalid]:after:border-t-destructive data-cell-status:after:border-t-[5px] data-cell-status:after:content-['']\",\n props.tableLayout?.cellBorder && \"border-e\",\n // Mirror of the head cell rule: no floating border against the\n // resize filler strip.\n props.tableLayout?.cellBorder &&\n props.tableLayout?.columnsResizable &&\n // With end-pinned columns but no pin affordance, the pinned edge\n // draws no separator of its own; keep the border then.\n (props.tableLayout?.columnsPinnable || !hasDataGridTableRightPinnedColumns(table)) &&\n !isPinned &&\n column.getIsLastColumn(\"center\") &&\n \"border-e-0\",\n props.tableLayout?.columnsResizable &&\n column.getCanResize() &&\n !cellSelectionOn &&\n \"truncate\",\n cell.column.columnDef.meta?.cellClassName,\n props.tableLayout?.columnsPinnable &&\n column.getCanPin() &&\n cn(\n \"data-pinned:isolate data-pinned:bg-background\",\n \"[&[data-pinned=start][data-last-col=start]]:shadow-[inset_-1px_0_0_0_var(--border)]\",\n \"[&[data-pinned=end][data-last-col=end]]:shadow-[inset_1px_0_0_0_var(--border)]\",\n ),\n column.getIndex() === 0 || column.getIndex() === row.getVisibleCells().length - 1\n ? props.tableClassNames?.edgeCell\n : \"\",\n selection && dataGridCellSelectionCellClasses,\n )}\n >\n {/* With cell selection on, the td must not clip (its ::before paints\n the selection chrome 1px outside the cell), so the resize\n truncation moves to an inner wrapper that clips at the same\n boundary the td used to. */}\n {cellSelectionOn && props.tableLayout?.columnsResizable && column.getCanResize() ? (\n <div\n className={bodyCellTruncateWrapVariants({\n size: props.tableLayout?.dense ? \"dense\" : \"default\",\n })}\n >\n {children}\n </div>\n ) : (\n children\n )}\n {props.tableLayout?.cellFillHandle &&\n selection?.[\"data-cell-edge-bottom\"] &&\n selection[\"data-cell-edge-right\"] && (\n <span\n data-slot=\"data-grid-cell-fill-handle\"\n /* \"dot\" stays fully inside the cell corner; \"ring\" rides the\n corner point the way Sheets draws it. Either way the handle\n clamps where straddling would break: at the grid's own\n boundary (last row, last cell, a last cell followed only by\n the filler strip), where an overhang would extend the scroll\n content and clip the selection chrome, and beside a PINNED\n column, whose sticky layer (z 30) would otherwise paint over\n the straddling half - raising the handle instead would float\n it above the pinned column during horizontal scroll. */\n className={cn(\n \"absolute z-10 in-data-cell-editing:hidden in-data-cell-selecting:hidden cursor-crosshair\",\n props.tableLayout?.cellFillHandleVariant === \"ring\"\n ? \"-end-[5px] in-[td:has(+[data-slot=data-grid-table-fill-body-cell]+td[data-pinned])]:end-0 in-[td:has(+[data-slot=data-grid-table-fill-body-cell]:last-child)]:end-0 in-[td:has(+td[data-pinned])]:end-0 in-[td:last-child]:end-0 -bottom-[5px] in-[tr:last-child]:bottom-0 size-[11px] rounded-full border-2 border-primary bg-background\"\n : props.tableLayout?.cellFillHandleVariant === \"square\"\n ? /* Abutting the cell borders from inside: no gap and no\n overlap, so the square cannot merge with a gridline\n into a wider-than-tall blob, and it can never leave\n the grid, which is why it needs no boundary clamps. */\n \"end-0 bottom-0 size-[5px] bg-primary\"\n : \"end-0 bottom-0 size-[9px] rounded-full border border-background bg-primary\",\n props.tableClassNames?.cellFillHandle,\n )}\n />\n )}\n </td>\n );\n\n if (!cellSelectionOn) return renderTd(null);\n\n // Per-cell subscription with a projecting selector: the atom writes once\n // per cell crossed during a drag, and shallow-comparing this tuple limits\n // the re-render to cells whose selection state actually changed.\n return (\n <Subscribe\n source={table.atoms.cellSelection}\n selector={() => getDataGridCellSelectionCellAttrs(cell)}\n >\n {(selection) => renderTd(selection)}\n </Subscribe>\n );\n}\n\nfunction DataGridTableRenderedRow<TData extends object>({\n row,\n pinnedBoundary,\n rowRef,\n rowIndex,\n centerWindow,\n}: {\n row: Row<DataGridFeatures, TData>;\n pinnedBoundary?: DataGridTablePinnedBoundary;\n rowRef?: React.Ref<HTMLTableRowElement>;\n /** Virtualized list index, rendered as data-index for measureElement. */\n rowIndex?: number;\n /**\n * Column-virtualization window over the CENTER cells: only the inclusive\n * [start, end] slice renders, and each flank collapses into one colSpan\n * spacer. The spacers carry no width of their own - the colgroup stays\n * complete, so under table-fixed the browser sizes them from the col\n * elements they span and the layout cannot drift.\n */\n centerWindow?: { start: number; end: number };\n}) {\n const { props, table } = useDataGrid();\n const startVisibleCells = row.getStartVisibleCells();\n const centerVisibleCells = row.getCenterVisibleCells();\n const endVisibleCells = row.getEndVisibleCells();\n const hasRightPinnedColumns = hasDataGridTableRightPinnedColumns(table);\n const windowedCenterCells = centerWindow\n ? centerVisibleCells.slice(centerWindow.start, centerWindow.end + 1)\n : centerVisibleCells;\n const leadingSpacerSpan = centerWindow ? centerWindow.start : 0;\n const trailingSpacerSpan = centerWindow\n ? Math.max(0, centerVisibleCells.length - 1 - centerWindow.end)\n : 0;\n\n return (\n <Fragment>\n <DataGridTableBodyRow\n row={row}\n pinnedBoundary={pinnedBoundary}\n rowRef={rowRef}\n dataIndex={rowIndex}\n >\n {startVisibleCells.map((cell: Cell<DataGridFeatures, TData, unknown>) => (\n <DataGridTableBodyRowCell cell={cell} key={cell.id}>\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n </DataGridTableBodyRowCell>\n ))}\n {leadingSpacerSpan > 0 && (\n <td\n aria-hidden=\"true\"\n data-slot=\"data-grid-table-virtual-col-spacer\"\n colSpan={leadingSpacerSpan}\n />\n )}\n {windowedCenterCells.map((cell: Cell<DataGridFeatures, TData, unknown>, cellIndex) => (\n <DataGridTableBodyRowCell\n cell={cell}\n key={cell.id}\n columnIndex={centerWindow ? centerWindow.start + cellIndex : undefined}\n >\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n </DataGridTableBodyRowCell>\n ))}\n {trailingSpacerSpan > 0 && (\n <td\n aria-hidden=\"true\"\n data-slot=\"data-grid-table-virtual-col-spacer\"\n colSpan={trailingSpacerSpan}\n />\n )}\n {props.tableLayout?.columnsResizable && hasRightPinnedColumns ? (\n <DataGridTableFillBodyCell />\n ) : null}\n {endVisibleCells.map((cell: Cell<DataGridFeatures, TData, unknown>) => (\n <DataGridTableBodyRowCell cell={cell} key={cell.id}>\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n </DataGridTableBodyRowCell>\n ))}\n {props.tableLayout?.columnsResizable && !hasRightPinnedColumns ? (\n <DataGridTableFillBodyCell />\n ) : null}\n </DataGridTableBodyRow>\n {row.getIsExpanded() && <DataGridTableBodyRowExpandded row={row} />}\n </Fragment>\n );\n}\n\nfunction DataGridTableEmpty() {\n const { i18n, table, props } = useDataGrid();\n const visibleColumnCount =\n getDataGridTableOrderedVisibleColumns(table).length +\n (props.tableLayout?.columnsResizable ? 1 : 0);\n\n return (\n <tr>\n <td\n colSpan={Math.max(visibleColumnCount, 1)}\n className=\"py-6 text-center text-muted-foreground text-sm\"\n >\n {props.emptyMessage || i18n.labels.empty}\n </td>\n </tr>\n );\n}\n\nfunction DataGridTableLoader() {\n const { i18n, props } = useDataGrid();\n\n return (\n <div className=\"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2\">\n <div className=\"flex items-center gap-2 rounded-lg border bg-card px-4 py-2 font-medium text-muted-foreground text-sm leading-none\">\n <Spinner className=\"size-5 opacity-60\" />\n {props.loadingMessage || i18n.labels.loading}\n </div>\n </div>\n );\n}\n\nfunction DataGridTableRowPin<TData extends object>({ row }: { row: Row<DataGridFeatures, TData> }) {\n const { i18n } = useDataGrid();\n const isPinned = row.getIsPinned();\n\n return (\n <button\n type=\"button\"\n aria-label={isPinned ? i18n.labels.unpinRow : i18n.labels.pinRow}\n onClick={(event) => {\n // Pinning must not bubble into the row's onRowClick handler.\n event.stopPropagation();\n\n if (isPinned) {\n row.pin(false);\n } else {\n row.pin(\"top\");\n }\n }}\n className={cn(\n \"inline-flex size-7 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:text-foreground\",\n isPinned && \"text-primary hover:text-primary/80\",\n )}\n >\n {isPinned ? (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n stroke=\"none\"\n >\n <path d=\"M16 2l4.585 4.586-2.122 2.121L17.05 7.293l-3.535 3.536 1.413 5.658-2.12 2.121-4.244-4.243L4.322 18.6l-1.414-1.41 4.242-4.244-4.243-4.243 2.122-2.121 5.656 1.414 3.536-3.536-1.414-1.414z\" />\n </svg>\n ) : (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <line x1=\"12\" y1=\"17\" x2=\"12\" y2=\"22\" />\n <path d=\"M5 17h14v-1.76a2 2 0 00-1.11-1.79l-1.78-.9A2 2 0 0115 10.76V6h1a2 2 0 000-4H8a2 2 0 000 4h1v4.76a2 2 0 01-1.11 1.79l-1.78.9A2 2 0 005 15.24z\" />\n </svg>\n )}\n </button>\n );\n}\n\n/**\n * Selection cell.\n *\n * The `Subscribe` wrapper is the v9 fix for React Compiler, and it is why this\n * file no longer needs `\"use no memo\"`. `useTable` hands back a fresh table on\n * every state change, which covers anything read through `table`, but this\n * component reads selection through `row.getIsSelected()` - a builder call\n * that hides its state dependency from the compiler. Rendered inside a column\n * `cell` template it receives a *stable* row, so the compiler is free to\n * memoize this JSX and never re-run those reads, which shows up as checkboxes\n * that do not respond to clicks.\n *\n * Subscribing to the row-selection atom gives the compiler a dependency it can\n * see. Note the standalone `Subscribe` rather than `table.Subscribe`: inside a\n * cell template the `table` handed to the column def is the core `Table`, which\n * has no `Subscribe` attached.\n */\nfunction DataGridTableRowSelect<TData extends object>({\n row,\n}: {\n row: Row<DataGridFeatures, TData>;\n}) {\n const { i18n } = useDataGrid();\n return (\n <Subscribe source={row.table.atoms.rowSelection}>\n {() => (\n <>\n <Checkbox\n checked={row.getIsSelected()}\n indeterminate={row.getIsSomeSelected() && !row.getIsSelected()}\n onCheckedChange={(value) => row.toggleSelected(!!value)}\n onClick={(event) => {\n // Selection must not bubble into the row's onRowClick handler.\n event.stopPropagation();\n }}\n aria-label={i18n.labels.selectRow}\n className=\"align-[inherit]\"\n />\n </>\n )}\n </Subscribe>\n );\n}\n\nfunction DataGridTableRowSelectAll() {\n const { i18n, table, recordCount, isLoading } = useDataGrid();\n\n // `getIsSomePageRowsSelected()` means \"at least one\" in v9, where v8 meant\n // \"some but not all\", so the all-selected case has to be excluded explicitly\n // or the header checkbox stays indeterminate once every row is checked.\n return (\n <Subscribe source={table.atoms.rowSelection}>\n {() => {\n const isAllSelected = table.getIsAllPageRowsSelected();\n const isSomeSelected = table.getIsSomePageRowsSelected();\n\n return (\n <Checkbox\n checked={isAllSelected}\n indeterminate={isSomeSelected && !isAllSelected}\n disabled={isLoading || recordCount === 0}\n onCheckedChange={(value) => table.toggleAllPageRowsSelected(!!value)}\n aria-label={i18n.labels.selectAll}\n className=\"align-[inherit]\"\n />\n );\n }}\n </Subscribe>\n );\n}\n\nfunction DataGridTableRowExpand<TData extends object>({\n row,\n indent = 20,\n className,\n children,\n}: {\n row: Row<DataGridFeatures, TData>;\n /** Horizontal offset in px applied per tree depth level. */\n indent?: number;\n className?: string;\n /** Custom toggle icon; replaces the default chevron. */\n children?: ReactNode;\n}) {\n const { i18n, props } = useDataGrid();\n const isExpanded = row.getIsExpanded();\n const controlSize = props.tableLayout?.dense ? \"size-6\" : \"size-7\";\n\n return (\n <span\n data-slot=\"data-grid-table-row-expand\"\n style={getDataGridTreeIndentStyle(row, indent)}\n className={cn(\n \"inline-flex shrink-0 items-center ps-(--data-grid-tree-padding) align-middle\",\n className,\n )}\n >\n {row.getCanExpand() ? (\n <button\n type=\"button\"\n aria-expanded={isExpanded}\n aria-label={isExpanded ? i18n.labels.collapseRow : i18n.labels.expandRow}\n onClick={(event) => {\n // Expansion must not bubble into the row's onRowClick handler.\n event.stopPropagation();\n row.toggleExpanded();\n }}\n className={cn(\n \"inline-flex items-center justify-center rounded-lg text-muted-foreground transition-colors hover:text-foreground\",\n controlSize,\n )}\n >\n {children ?? (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n className=\"in-aria-[expanded=false]:-rotate-90 transition-transform duration-200 rtl:in-aria-[expanded=false]:rotate-90\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n )}\n </button>\n ) : (\n // Leaf spacer: compact by design so leaf content sits near the\n // parent label instead of a full toggle width deeper.\n <span aria-hidden=\"true\" className=\"w-2 shrink-0\" />\n )}\n </span>\n );\n}\n\nfunction DataGridTableBodyRows<TData extends object>({\n table,\n}: {\n table: DataGridTableInstance<TData>;\n}) {\n const { i18n, isLoading, props } = useDataGrid();\n const pagination = table.state.pagination;\n\n if (isLoading && props.loadingMode === \"skeleton\" && pagination?.pageSize) {\n const leftVisibleColumns = table.getStartVisibleLeafColumns();\n const centerVisibleColumns = table.getCenterVisibleLeafColumns();\n const rightVisibleColumns = table.getEndVisibleLeafColumns();\n const hasRightPinnedColumns = hasDataGridTableRightPinnedColumns(table);\n\n return (\n <>\n {Array.from({ length: pagination.pageSize }).map((_, rowIndex) => (\n <DataGridTableBodyRowSkeleton key={rowIndex}>\n {[...leftVisibleColumns, ...centerVisibleColumns].map((column) => (\n <DataGridTableBodyRowSkeletonCell column={column} key={column.id}>\n {column.columnDef.meta?.skeleton}\n </DataGridTableBodyRowSkeletonCell>\n ))}\n {props.tableLayout?.columnsResizable && hasRightPinnedColumns ? (\n <DataGridTableFillBodyCell />\n ) : null}\n {rightVisibleColumns.map((column) => (\n <DataGridTableBodyRowSkeletonCell column={column} key={column.id}>\n {column.columnDef.meta?.skeleton}\n </DataGridTableBodyRowSkeletonCell>\n ))}\n {props.tableLayout?.columnsResizable && !hasRightPinnedColumns ? (\n <DataGridTableFillBodyCell />\n ) : null}\n </DataGridTableBodyRowSkeleton>\n ))}\n </>\n );\n }\n\n if (isLoading && props.loadingMode === \"spinner\") {\n return (\n <tr>\n <td\n colSpan={\n table.getVisibleFlatColumns().length + (props.tableLayout?.columnsResizable ? 1 : 0)\n }\n className=\"p-8\"\n >\n <div className=\"flex items-center justify-center\">\n <svg\n className=\"mr-3 -ml-1 h-5 w-5 animate-spin text-muted-foreground\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n className=\"opacity-25\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n />\n <path\n className=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n />\n </svg>\n {props.loadingMessage || i18n.labels.loading}\n </div>\n </td>\n </tr>\n );\n }\n\n const resolvedRows = getDataGridTableResolvedRows(table, props.tableLayout?.rowsPinnable);\n\n if (!resolvedRows.length) return <DataGridTableEmpty />;\n\n return (\n <>\n {resolvedRows.map(({ row, pinnedBoundary }) => (\n <DataGridTableRenderedRow key={row.id} row={row} pinnedBoundary={pinnedBoundary} />\n ))}\n </>\n );\n}\n\n/**\n * Memoized body rows: skip re-renders during active column resize.\n * Column widths update via CSS variables on the <table> element,\n * so the browser handles width changes without React re-renders.\n * A cell-selection drag gets the same treatment: the root re-renders once per\n * cell crossed, but painting goes through each cell's own Subscribe, so row\n * reconciliation during the drag is pure waste.\n */\nconst MemoizedDataGridTableBodyRows = memo(\n DataGridTableBodyRows,\n (_prev, next) =>\n !!next.table.state.columnResizing.isResizingColumn || next.table._isSelectingCells === true,\n) as typeof DataGridTableBodyRows;\n\nfunction DataGridTableHeader<_TData extends object>() {\n const { table, props } = useDataGrid();\n const mergedHeaderGroups = getDataGridTableMergedHeaderGroups(table);\n const hasRightPinnedColumns = hasDataGridTableRightPinnedColumns(table);\n\n return (\n <DataGridTableViewport>\n <DataGridTableBase>\n <DataGridTableHead>\n {mergedHeaderGroups.map((headerGroup) => {\n return (\n <DataGridTableHeadRow key={headerGroup.id} rowId={headerGroup.id}>\n {headerGroup.headers\n .filter((header) => header.column.getIsPinned() !== \"end\")\n .map((header) => {\n const { column } = header;\n\n return (\n <DataGridTableHeadRowCell header={header} key={header.id}>\n {header.isPlaceholder\n ? null\n : flexRender(header.column.columnDef.header, header.getContext())}\n {props.tableLayout?.columnsResizable && column.getCanResize() && (\n <DataGridTableHeadRowCellResize header={header} />\n )}\n </DataGridTableHeadRowCell>\n );\n })}\n {props.tableLayout?.columnsResizable && hasRightPinnedColumns ? (\n <DataGridTableFillHeadCell />\n ) : null}\n {headerGroup.headers\n .filter((header) => header.column.getIsPinned() === \"end\")\n .map((header) => {\n const { column } = header;\n\n return (\n <DataGridTableHeadRowCell header={header} key={header.id}>\n {header.isPlaceholder\n ? null\n : flexRender(header.column.columnDef.header, header.getContext())}\n {props.tableLayout?.columnsResizable && column.getCanResize() && (\n <DataGridTableHeadRowCellResize header={header} />\n )}\n </DataGridTableHeadRowCell>\n );\n })}\n {props.tableLayout?.columnsResizable && !hasRightPinnedColumns ? (\n <DataGridTableFillHeadCell />\n ) : null}\n </DataGridTableHeadRow>\n );\n })}\n </DataGridTableHead>\n </DataGridTableBase>\n </DataGridTableViewport>\n );\n}\n\nfunction DataGridTable<_TData extends object>({\n footerContent,\n renderHeader = true,\n}: {\n footerContent?: ReactNode;\n renderHeader?: boolean;\n}) {\n const { table, props } = useDataGrid();\n const mergedHeaderGroups = getDataGridTableMergedHeaderGroups(table);\n const hasRightPinnedColumns = hasDataGridTableRightPinnedColumns(table);\n\n return (\n <DataGridTableViewport>\n <DataGridTableBase>\n {renderHeader && (\n <DataGridTableHead>\n {mergedHeaderGroups.map((headerGroup) => {\n return (\n <DataGridTableHeadRow key={headerGroup.id} rowId={headerGroup.id}>\n {headerGroup.headers\n .filter((header) => header.column.getIsPinned() !== \"end\")\n .map((header) => {\n const { column } = header;\n\n return (\n <DataGridTableHeadRowCell header={header} key={header.id}>\n {header.isPlaceholder\n ? null\n : flexRender(header.column.columnDef.header, header.getContext())}\n {props.tableLayout?.columnsResizable && column.getCanResize() && (\n <DataGridTableHeadRowCellResize header={header} />\n )}\n </DataGridTableHeadRowCell>\n );\n })}\n {props.tableLayout?.columnsResizable && hasRightPinnedColumns ? (\n <DataGridTableFillHeadCell />\n ) : null}\n {headerGroup.headers\n .filter((header) => header.column.getIsPinned() === \"end\")\n .map((header) => {\n const { column } = header;\n\n return (\n <DataGridTableHeadRowCell header={header} key={header.id}>\n {header.isPlaceholder\n ? null\n : flexRender(header.column.columnDef.header, header.getContext())}\n {props.tableLayout?.columnsResizable && column.getCanResize() && (\n <DataGridTableHeadRowCellResize header={header} />\n )}\n </DataGridTableHeadRowCell>\n );\n })}\n {props.tableLayout?.columnsResizable && !hasRightPinnedColumns ? (\n <DataGridTableFillHeadCell />\n ) : null}\n </DataGridTableHeadRow>\n );\n })}\n </DataGridTableHead>\n )}\n\n {renderHeader && (props.tableLayout?.stripped || !props.tableLayout?.rowBorder) && (\n <DataGridTableRowSpacer />\n )}\n\n <DataGridTableBody>\n <MemoizedDataGridTableBodyRows table={table} />\n {props.appendRow}\n <DataGridTableAddRow />\n </DataGridTableBody>\n\n {footerContent && <DataGridTableFoot>{footerContent}</DataGridTableFoot>}\n </DataGridTableBase>\n </DataGridTableViewport>\n );\n}\n\nexport type { DataGridTablePinnedBoundary };\nexport {\n DataGridTable,\n DataGridTableAddRow,\n DataGridTableBase,\n DataGridTableBody,\n DataGridTableBodyRow,\n DataGridTableBodyRowCell,\n DataGridTableBodyRowExpandded,\n DataGridTableBodyRowSkeleton,\n DataGridTableBodyRowSkeletonCell,\n DataGridTableEmpty,\n DataGridTableFillBodyCell,\n DataGridTableFillHeadCell,\n DataGridTableFoot,\n DataGridTableFootRow,\n DataGridTableFootRowCell,\n DataGridTableHead,\n DataGridTableHeader,\n DataGridTableHeadRow,\n DataGridTableHeadRowCell,\n DataGridTableHeadRowCellResize,\n DataGridTableLoader,\n DataGridTableRenderedRow,\n DataGridTableRowExpand,\n DataGridTableRowPin,\n DataGridTableRowSelect,\n DataGridTableRowSelectAll,\n DataGridTableRowSpacer,\n DataGridTableViewport,\n getDataGridScrollAreaViewport,\n getDataGridTableMergedHeaderGroups,\n getDataGridTableResolvedRows,\n getDataGridTableRowSections,\n getDataGridTreeIndentStyle,\n getPinningStyles,\n hasDataGridTableRightPinnedColumns,\n};\n"],"mappings":";;;;;;;;;;;AA6BA,MAAM,6BAA6B,EAAE,WACnC,SAAS,UAAU,aAAa;AAElC,MAAM,2BAA2B,EAAE,WACjC,SAAS,UAAU,gBAAgB;AAMrC,MAAM,gCAAgC,EAAE,WACtC,SAAS,UAAU,uCAAuC;AAE5D,MAAM,6BAA6B,EAAE,WACnC,SAAS,UAAU,gBAAgB;AAErC,SAAS,iBACP,QACe;CACf,MAAM,WAAW,OAAO,YAAY;CAEpC,OAAO;EAIL,kBAAkB,aAAa,UAAU,GAAG,OAAO,SAAS,OAAO,EAAE,MAAM,KAAA;EAC3E,gBAAgB,aAAa,QAAQ,GAAG,OAAO,SAAS,KAAK,EAAE,MAAM,KAAA;EACrE,UAAU,WAAW,WAAW,KAAA;EAChC,WAAW,WAAW,kBAAkB,KAAA;EACxC,SAAS,WAAW,UAAU,KAAA;EAC9B,OAAO,OAAO,QAAQ;EACtB,QAAQ,WAAW,KAAK,KAAA;EACxB,gBAAgB,WAAW,gBAAgB,KAAA;CAC7C;AACF;AAKA,SAAS,2BACP,KACA,SAAiB,IACF;CACf,OAAO,EACL,4BAA4B,GAAG,IAAI,QAAQ,OAAO,IACpD;AACF;AAEA,SAAS,UAAa,KAAyB,OAAiB;CAC9D,IAAI,CAAC,KAAK;CAEV,IAAI,OAAO,QAAQ,YAAY;EAC7B,IAAI,KAAK;EACT;CACF;CAEA,IAA+B,UAAU;AAC3C;;;;;;AAOA,SAAS,8BAA8B,MAAuC;CAC5E,MAAM,iBAAiB,KAAK,QAAQ,sCAAoC;CAExE,IAAI,CAAC,gBAAgB,OAAO;CAE5B,MAAM,gBAAgB,KAAK,QAAQ,2BAAyB;CAC5D,IAAI,iBAAiB,CAAC,cAAc,SAAS,cAAc,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EAAA,UAAA;GACE,oBAAC,+BAAD,EAAsC,MAAQ,CAAA;GAC7C,MAAM;GACP,oBAAC,qBAAD,CAAsB,CAAA;EACL,EAAA,CAAA;EAElB,iBAAiB,oBAAC,mBAAD,EAAA,UAAoB,cAAiC,CAAA;CACtD,EAAA,CAAA,EACE,CAAA;AAE3B"}
|
|
1
|
+
{"version":3,"file":"data-grid-table.js","names":[],"sources":["../../../../src/components/reui/data-grid/data-grid-table.tsx"],"sourcesContent":["\"use client\";\n\nimport type {\n CSSProperties,\n MouseEvent as ReactMouseEvent,\n ReactNode,\n TouchEvent as ReactTouchEvent,\n Ref,\n RefObject,\n} from \"react\";\nimport { Fragment, memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef } from \"react\";\nimport type { Cell, Column, Header, Row } from \"@tanstack/react-table\";\nimport { flexRender, Subscribe } from \"@tanstack/react-table\";\nimport { cn } from \"cn\";\nimport { PlusIcon } from \"lucide-react\";\n\nimport { Button } from \"../../ui/button\";\nimport { Checkbox } from \"../../ui/checkbox\";\nimport { Spinner } from \"../../ui/spinner\";\nimport type { DataGridFeatures, DataGridTableInstance } from \"./data-grid\";\nimport {\n dataGridCellSelectionCellClasses,\n getDataGridCellSelectionCellAttrs,\n toDataGridDomId,\n useDataGrid,\n} from \"./data-grid\";\n\n// Static spacing lookups; called once per cell, so they stay plain string\n// picks instead of runtime variant machinery.\nconst headerCellSpacingVariants = ({ size }: { size?: \"dense\" | \"default\" }) =>\n size === \"dense\" ? \"px-2 h-8\" : \"px-3\";\n\nconst bodyCellSpacingVariants = ({ size }: { size?: \"dense\" | \"default\" }) =>\n size === \"dense\" ? \"px-2 py-1.5\" : \"px-3 py-2\";\n\n// The truncation wrapper used when cell selection is on: it consumes the\n// td padding with negative margins and restores it as its own, so its\n// overflow clips at exactly the boundary the td's `truncate` used to clip\n// at - including custom cells that pull into the padding the same way.\nconst bodyCellTruncateWrapVariants = ({ size }: { size?: \"dense\" | \"default\" }) =>\n size === \"dense\" ? \"-mx-2 -my-1.5 truncate px-2 py-1.5\" : \"-mx-3 -my-2 truncate px-3 py-2\";\n\nconst footerCellSpacingVariants = ({ size }: { size?: \"dense\" | \"default\" }) =>\n size === \"dense\" ? \"px-2 py-1.5\" : \"px-3 py-2\";\n\nfunction getPinningStyles<TData extends object>(\n column: Column<DataGridFeatures, TData, unknown>,\n): CSSProperties {\n const isPinned = column.getIsPinned();\n\n return {\n // Logical offsets: TanStack's \"left\"/\"right\" buckets are start/end\n // semantics, so pinned columns stick to the correct edge in RTL too\n // (identical to left/right in LTR).\n insetInlineStart: isPinned === \"start\" ? `${column.getStart(\"start\")}px` : undefined,\n insetInlineEnd: isPinned === \"end\" ? `${column.getAfter(\"end\")}px` : undefined,\n position: isPinned ? \"sticky\" : undefined,\n transform: isPinned ? \"translateZ(0)\" : undefined,\n contain: isPinned ? \"paint\" : undefined,\n width: column.getSize(),\n zIndex: isPinned ? 30 : undefined,\n backgroundClip: isPinned ? \"padding-box\" : undefined,\n };\n}\n\n// Shared indent contract for tree rows: DataGridTableRowExpand consumes it,\n// and fully custom cells can reuse it for depth alignment without the\n// built-in toggle.\nfunction getDataGridTreeIndentStyle<TData extends object>(\n row: Row<DataGridFeatures, TData>,\n indent: number = 20,\n): CSSProperties {\n return {\n \"--data-grid-tree-padding\": `${row.depth * indent}px`,\n } as CSSProperties;\n}\n\nfunction assignRef<T>(ref: Ref<T> | undefined, value: T | null) {\n if (!ref) return;\n\n if (typeof ref === \"function\") {\n ref(value);\n return;\n }\n\n (ref as { current: T | null }).current = value;\n}\n\n/**\n * Nearest scroll-area viewport that belongs to THIS grid. A viewport outside\n * the grid's own container (e.g. a page-level ScrollArea) would make the\n * width measurement - and the virtualizer - bind the wrong box.\n */\nfunction getDataGridScrollAreaViewport(node: HTMLElement): HTMLElement | null {\n const scrollViewport = node.closest('[data-slot=\"scroll-area-viewport\"]') as HTMLElement | null;\n\n if (!scrollViewport) return null;\n\n const gridContainer = node.closest('[data-slot=\"data-grid\"]');\n if (gridContainer && !gridContainer.contains(scrollViewport)) return null;\n\n return scrollViewport;\n}\n\ntype DataGridResizeStartEvent = ReactMouseEvent<HTMLElement> | ReactTouchEvent<HTMLElement>;\n\ntype DataGridResizeDocumentEvent = globalThis.MouseEvent | globalThis.TouchEvent;\n\nfunction isDataGridTouchEvent(\n event: DataGridResizeStartEvent | DataGridResizeDocumentEvent,\n): event is ReactTouchEvent<HTMLElement> | globalThis.TouchEvent {\n return \"touches\" in event;\n}\n\ntype DataGridTouchListLike = {\n length: number;\n item: (index: number) => { identifier: number; clientX: number } | null;\n};\n\nfunction findTouchClientX(list: DataGridTouchListLike, identifier: number) {\n for (let i = 0; i < list.length; i++) {\n const touch = list.item(i);\n if (touch && touch.identifier === identifier) return touch.clientX;\n }\n\n return undefined;\n}\n\nfunction getDataGridResizeEventClientX(\n event: DataGridResizeStartEvent | DataGridResizeDocumentEvent,\n touchIdentifier?: number,\n) {\n if (isDataGridTouchEvent(event)) {\n if (typeof touchIdentifier === \"number\") {\n return (\n findTouchClientX(event.touches, touchIdentifier) ??\n findTouchClientX(event.changedTouches, touchIdentifier)\n );\n }\n\n return event.touches[0]?.clientX ?? event.changedTouches[0]?.clientX;\n }\n\n return event.clientX;\n}\n\nfunction startDataGridColumnResizeOnEnd<TData extends object>(\n event: DataGridResizeStartEvent,\n header: Header<DataGridFeatures, TData, unknown>,\n table: DataGridTableInstance<TData>,\n /**\n * Live mode: per-move width updates go straight to the table element's\n * `--col/--header` variables, so cells track the pointer with ZERO React\n * renders; state is written twice per drag (start marker, release commit)\n * instead of per mousemove - which re-renders the consumer's whole tree.\n */\n live = false,\n): (() => void) | undefined {\n const column = table.getColumn(header.column.id);\n\n if (!column?.getCanResize()) return;\n const isTouchSession = isDataGridTouchEvent(event);\n if (isTouchSession && event.touches.length > 1) return;\n\n event.persist?.();\n\n const ownerDocument = event.currentTarget.ownerDocument;\n const ownerWindow = ownerDocument.defaultView;\n const previousBodyCursor = ownerDocument.body.style.cursor;\n const previousDocumentCursor = ownerDocument.documentElement.style.cursor;\n const startSize = header.getSize();\n // Track the initiating finger so a second touch cannot move or commit the\n // resize with the wrong clientX.\n const touchIdentifier = isTouchSession ? event.touches[0]?.identifier : undefined;\n const dragStartClientX = getDataGridResizeEventClientX(event, touchIdentifier);\n const headerCell = event.currentTarget.closest(\"th\");\n const headerRect = headerCell?.getBoundingClientRect();\n const liveTableElement = live ? headerCell?.closest(\"table\") : null;\n // An end-pinned column is anchored at its end edge and grows from its\n // START edge, so its whole resize geometry runs mirrored, exactly like\n // RTL: the anchor is the opposite edge and the drag direction inverts.\n const resizeRtl =\n (table.options.columnResizeDirection === \"rtl\") !== (column.getIsPinned() === \"end\");\n const startOffset =\n headerRect && Number.isFinite(resizeRtl ? headerRect.left : headerRect.right)\n ? resizeRtl\n ? headerRect.left\n : headerRect.right\n : dragStartClientX;\n\n if (typeof dragStartClientX !== \"number\" || typeof startOffset !== \"number\") {\n return;\n }\n\n ownerDocument.body.style.cursor = \"col-resize\";\n ownerDocument.documentElement.style.cursor = \"col-resize\";\n\n const columnSizingStart = header\n .getLeafHeaders()\n .map((leafHeader) => [leafHeader.column.id, leafHeader.column.getSize()] as [string, number]);\n const directionMultiplier = resizeRtl ? -1 : 1;\n\n // Clamp the drag to the leaf columns' min/max sizes so the preview\n // indicator matches what the commit will produce (no overshoot followed by\n // a snap-back on release). columnDef always carries resolved defaults.\n let minDeltaPercentage = -0.999999;\n let maxDeltaPercentage = Number.POSITIVE_INFINITY;\n columnSizingStart.forEach(([columnId, headerSize]) => {\n if (headerSize <= 0) return;\n\n const leafColumn = table.getColumn(columnId);\n const minSize = leafColumn?.columnDef.minSize;\n const maxSize = leafColumn?.columnDef.maxSize;\n\n if (typeof minSize === \"number\") {\n minDeltaPercentage = Math.max(minDeltaPercentage, minSize / headerSize - 1);\n }\n if (typeof maxSize === \"number\" && Number.isFinite(maxSize)) {\n maxDeltaPercentage = Math.min(maxDeltaPercentage, maxSize / headerSize - 1);\n }\n });\n\n let lastClientX = dragStartClientX;\n let ended = false;\n const stopListeners: Array<() => void> = [];\n\n const updateOffset = (clientXPos?: number, commit = false) => {\n if (typeof clientXPos !== \"number\") return;\n\n lastClientX = clientXPos;\n\n const nextColumnSizing: Record<string, number> = {};\n const deltaPercentage = Math.min(\n Math.max(\n ((clientXPos - dragStartClientX) * directionMultiplier) / startSize,\n minDeltaPercentage,\n ),\n maxDeltaPercentage,\n );\n const deltaOffset = deltaPercentage * startSize;\n\n columnSizingStart.forEach(([columnId, headerSize]) => {\n nextColumnSizing[columnId] =\n Math.round(Math.max(headerSize + headerSize * deltaPercentage, 0) * 100) / 100;\n });\n\n if (liveTableElement) {\n columnSizingStart.forEach(([columnId]) => {\n const nextSize = nextColumnSizing[columnId];\n if (typeof nextSize !== \"number\") return;\n liveTableElement.style.setProperty(`--col-${columnId}-size`, String(nextSize));\n liveTableElement.style.setProperty(`--header-${columnId}-size`, String(nextSize));\n });\n } else {\n table.setColumnResizing((old) => ({\n ...old,\n startOffset,\n startSize,\n deltaOffset,\n deltaPercentage,\n columnSizingStart,\n isResizingColumn: column.id,\n }));\n }\n\n if (commit) {\n table.setColumnSizing((old) => ({\n ...old,\n ...nextColumnSizing,\n }));\n }\n };\n\n // Single teardown path: commits at the given position, removes every\n // document/window listener, and restores cursors. Safe to call more than\n // once (blur + mouseup + unmount can race).\n const endResize = (clientXPos?: number) => {\n if (ended) return;\n ended = true;\n\n for (const stop of stopListeners) stop();\n updateOffset(clientXPos, true);\n table.setColumnResizing((old) => ({\n ...old,\n isResizingColumn: false,\n startOffset: null,\n startSize: null,\n deltaOffset: null,\n deltaPercentage: null,\n columnSizingStart: [],\n }));\n ownerDocument.body.style.cursor = previousBodyCursor;\n ownerDocument.documentElement.style.cursor = previousDocumentCursor;\n };\n\n const mouseMoveHandler = (moveEvent: globalThis.MouseEvent) => {\n updateOffset(moveEvent.clientX);\n };\n const mouseUpHandler = (upEvent: globalThis.MouseEvent) => {\n endResize(upEvent.clientX);\n };\n const touchMoveHandler = (moveEvent: globalThis.TouchEvent) => {\n if (moveEvent.cancelable) {\n moveEvent.preventDefault();\n moveEvent.stopPropagation();\n }\n\n updateOffset(getDataGridResizeEventClientX(moveEvent, touchIdentifier));\n };\n const touchEndHandler = (endEvent: globalThis.TouchEvent) => {\n // Ignore other fingers lifting; only the initiating touch ends the drag.\n const clientXPos =\n typeof touchIdentifier === \"number\"\n ? findTouchClientX(endEvent.changedTouches, touchIdentifier)\n : getDataGridResizeEventClientX(endEvent);\n\n if (typeof clientXPos !== \"number\") return;\n\n if (endEvent.cancelable) {\n endEvent.preventDefault();\n endEvent.stopPropagation();\n }\n\n endResize(clientXPos);\n };\n // System-interrupted gestures and window focus loss would otherwise leave\n // the session (and its document listeners) live with no pointer held.\n const touchCancelHandler = () => {\n endResize(lastClientX);\n };\n const windowBlurHandler = () => {\n endResize(lastClientX);\n };\n\n const passiveIfSupported = { passive: false } as const;\n\n if (isTouchSession) {\n ownerDocument.addEventListener(\"touchmove\", touchMoveHandler, passiveIfSupported);\n ownerDocument.addEventListener(\"touchend\", touchEndHandler, passiveIfSupported);\n ownerDocument.addEventListener(\"touchcancel\", touchCancelHandler);\n stopListeners.push(() => {\n ownerDocument.removeEventListener(\"touchmove\", touchMoveHandler);\n ownerDocument.removeEventListener(\"touchend\", touchEndHandler);\n ownerDocument.removeEventListener(\"touchcancel\", touchCancelHandler);\n });\n } else {\n ownerDocument.addEventListener(\"mousemove\", mouseMoveHandler, passiveIfSupported);\n ownerDocument.addEventListener(\"mouseup\", mouseUpHandler, passiveIfSupported);\n stopListeners.push(() => {\n ownerDocument.removeEventListener(\"mousemove\", mouseMoveHandler);\n ownerDocument.removeEventListener(\"mouseup\", mouseUpHandler);\n });\n }\n\n if (ownerWindow) {\n ownerWindow.addEventListener(\"blur\", windowBlurHandler);\n stopListeners.push(() => ownerWindow.removeEventListener(\"blur\", windowBlurHandler));\n }\n\n table.setColumnResizing((old) => ({\n ...old,\n startOffset,\n startSize,\n deltaOffset: 0,\n deltaPercentage: 0,\n columnSizingStart,\n isResizingColumn: column.id,\n }));\n\n return () => endResize(lastClientX);\n}\n\ntype DataGridTablePinnedBoundary = \"top\" | \"bottom\";\n\nfunction getDataGridTableRowSections<TData extends object>(\n table: DataGridTableInstance<TData>,\n rowsPinnable?: boolean,\n) {\n if (!rowsPinnable) {\n return {\n topRows: [] as Row<DataGridFeatures, TData>[],\n centerRows: table.getRowModel().rows as Row<DataGridFeatures, TData>[],\n bottomRows: [] as Row<DataGridFeatures, TData>[],\n };\n }\n\n return {\n topRows: table.getTopRows() as Row<DataGridFeatures, TData>[],\n centerRows: table.getCenterRows() as Row<DataGridFeatures, TData>[],\n bottomRows: table.getBottomRows() as Row<DataGridFeatures, TData>[],\n };\n}\n\nfunction getDataGridTableResolvedRows<TData extends object>(\n table: DataGridTableInstance<TData>,\n rowsPinnable?: boolean,\n) {\n const { topRows, centerRows, bottomRows } = getDataGridTableRowSections(table, rowsPinnable);\n const resolvedRows: Array<{\n row: Row<DataGridFeatures, TData>;\n pinnedBoundary?: DataGridTablePinnedBoundary;\n }> = [];\n\n topRows.forEach((row, index) => {\n resolvedRows.push({\n row,\n pinnedBoundary:\n index === topRows.length - 1 && (centerRows.length > 0 || bottomRows.length > 0)\n ? \"top\"\n : undefined,\n });\n });\n\n centerRows.forEach((row) => {\n resolvedRows.push({ row });\n });\n\n bottomRows.forEach((row, index) => {\n resolvedRows.push({\n row,\n pinnedBoundary:\n index === 0 && (centerRows.length > 0 || topRows.length > 0) ? \"bottom\" : undefined,\n });\n });\n\n return resolvedRows;\n}\n\nfunction getDataGridTableOrderedVisibleColumns<TData extends object>(\n table: DataGridTableInstance<TData>,\n) {\n return [\n ...table.getStartVisibleLeafColumns(),\n ...table.getCenterVisibleLeafColumns(),\n ...table.getEndVisibleLeafColumns(),\n ] as Column<DataGridFeatures, TData, unknown>[];\n}\n\nfunction getDataGridTableOrderedVisibleCells<TData extends object>(\n row: Row<DataGridFeatures, TData>,\n) {\n return [\n ...row.getStartVisibleCells(),\n ...row.getCenterVisibleCells(),\n ...row.getEndVisibleCells(),\n ] as Cell<DataGridFeatures, TData, unknown>[];\n}\n\nfunction getDataGridTableMergedHeaderGroups<TData extends object>(\n table: DataGridTableInstance<TData>,\n) {\n const leftHeaderGroups = table.getStartHeaderGroups();\n const centerHeaderGroups = table.getCenterHeaderGroups();\n const rightHeaderGroups = table.getEndHeaderGroups();\n const headerGroupCount = Math.max(\n leftHeaderGroups.length,\n centerHeaderGroups.length,\n rightHeaderGroups.length,\n );\n\n return Array.from({ length: headerGroupCount }, (_, index) => {\n const leftGroup = leftHeaderGroups[index];\n const centerGroup = centerHeaderGroups[index];\n const rightGroup = rightHeaderGroups[index];\n\n return {\n id:\n [leftGroup?.id, centerGroup?.id, rightGroup?.id].filter(Boolean).join(\":\") ||\n `header-group-${index}`,\n headers: [\n ...(leftGroup?.headers ?? []),\n ...(centerGroup?.headers ?? []),\n ...(rightGroup?.headers ?? []),\n ] as Header<DataGridFeatures, TData, unknown>[],\n };\n });\n}\n\nfunction hasDataGridTableRightPinnedColumns<TData extends object>(\n table: DataGridTableInstance<TData>,\n) {\n return (table.state.columnPinning.end?.length ?? 0) > 0;\n}\n\n// A meta.fillWidth column absorbs the free space itself, so the fill cells\n// must collapse or the strip would be counted twice.\nfunction hasDataGridFillColumn<TData extends object>(table: DataGridTableInstance<TData>) {\n return table.getVisibleLeafColumns().some((column) => column.columnDef.meta?.fillWidth);\n}\n\nfunction DataGridTableFillCol() {\n const { props, table } = useDataGrid();\n\n if (!props.tableLayout?.columnsResizable) return null;\n\n return (\n <col\n data-slot=\"data-grid-table-fill-col\"\n style={{\n width: hasDataGridFillColumn(table) ? 0 : \"var(--data-grid-fill-size, 0px)\",\n }}\n />\n );\n}\n\nfunction DataGridTableFillHeadCell() {\n const { props, table } = useDataGrid();\n\n if (!props.tableLayout?.columnsResizable) return null;\n\n return (\n <th\n data-slot=\"data-grid-table-fill-head-cell\"\n style={{\n width: hasDataGridFillColumn(table) ? 0 : \"var(--data-grid-fill-size, 0px)\",\n }}\n className={cn(\"p-0\", props.tableLayout?.headerBackground && \"bg-muted\")}\n />\n );\n}\n\nfunction DataGridTableFillBodyCell() {\n const { props, table } = useDataGrid();\n\n if (!props.tableLayout?.columnsResizable) return null;\n\n return (\n <td\n aria-hidden=\"true\"\n data-slot=\"data-grid-table-fill-body-cell\"\n style={{\n width: hasDataGridFillColumn(table) ? 0 : \"var(--data-grid-fill-size, 0px)\",\n }}\n className=\"p-0\"\n />\n );\n}\n\nfunction DataGridTableFillFootCell() {\n const { props, table } = useDataGrid();\n\n if (!props.tableLayout?.columnsResizable) return null;\n\n return (\n <td\n aria-hidden=\"true\"\n data-slot=\"data-grid-table-fill-foot-cell\"\n style={{\n width: hasDataGridFillColumn(table) ? 0 : \"var(--data-grid-fill-size, 0px)\",\n }}\n className=\"p-0\"\n />\n );\n}\n\n/**\n * The quick-create affordance, rendered as the body's last row when\n * `onRowCreate` is set: one full-width ghost button, the Notion/Airtable\n * \"+ New\" idiom. What the click creates stays consumer-owned.\n */\nfunction DataGridTableAddRow() {\n const { i18n, props, table } = useDataGrid();\n\n if (!props.onRowCreate) return null;\n\n return (\n <tr\n data-slot=\"data-grid-table-add-row\"\n className={cn(\n \"hover:bg-muted/40 [thead+tbody_&:first-child]:border-t\",\n props.tableClassNames?.rowCreate,\n )}\n >\n <td\n // The extra column is the filler strip, rendered only when columns\n // are resizable.\n colSpan={\n table.getVisibleLeafColumns().length + (props.tableLayout?.columnsResizable ? 1 : 0)\n }\n className=\"p-0\"\n >\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n // Block-level flex: inline-flex would sit on the cell's text\n // baseline and push the icon and label off vertical center.\n className={cn(\n \"flex w-full items-center justify-start rounded-none px-3 text-muted-foreground\",\n props.tableLayout?.dense ? \"h-8 px-2\" : \"h-9\",\n )}\n onClick={(event) => {\n // Creating often unmounts this affordance (a draft row takes\n // its place); focus would fall to the body and strand the\n // keyboard. Hand it to the grid's focus target instead - but\n // only when it was actually lost, so a consumer that keeps\n // the button mounted keeps repeated Enter presses working.\n // A timer, not rAF: timers also run in background tabs.\n const button = event.currentTarget;\n const grid = button.closest(\"table\");\n props.onRowCreate?.();\n setTimeout(() => {\n if (\n !button.isConnected &&\n grid?.isConnected &&\n grid.tabIndex >= 0 &&\n (document.activeElement === document.body || !document.activeElement)\n ) {\n grid.focus();\n }\n }, 0);\n }}\n >\n <PlusIcon className=\"size-4\" aria-hidden=\"true\" />\n {props.rowCreateLabel ?? i18n.labels.rowCreate}\n </Button>\n </td>\n </tr>\n );\n}\n\nfunction DataGridTableBase({ children }: { children: ReactNode }) {\n const { props, table, recordCount } = useDataGrid();\n const leftVisibleColumns = table.getStartVisibleLeafColumns();\n const centerVisibleColumns = table.getCenterVisibleLeafColumns();\n const rightVisibleColumns = table.getEndVisibleLeafColumns();\n const hasRightPinnedColumns = hasDataGridTableRightPinnedColumns(table);\n\n /**\n * Compute column widths as CSS custom properties once upfront (memoized).\n * Cells reference these via calc(var(--col-X-size) * 1px) so the browser\n * handles width propagation without per-cell getSize() calls or React\n * re-renders of the body.\n */\n const columnSizeVars = useMemo(() => {\n if (!props.tableLayout?.columnsResizable) return undefined;\n const headers = table.getFlatHeaders();\n // A meta.fillWidth column absorbs the filler strip: its size variable\n // carries the unitless fill amount, so every consumer of\n // calc(var(--col-X-size) * 1px) stretches with the container while the\n // fill cells collapse to zero.\n const fillColumnId = table\n .getVisibleLeafColumns()\n .find((column) => column.columnDef.meta?.fillWidth)?.id;\n const colSizes: Record<string, number | string> = {};\n for (let i = 0; i < headers.length; i++) {\n const header = headers[i]!;\n colSizes[`--header-${header.id}-size`] = header.getSize();\n colSizes[`--col-${header.column.id}-size`] =\n header.column.id === fillColumnId\n ? `calc(${header.column.getSize()} + var(--data-grid-fill, 0))`\n : header.column.getSize();\n }\n return colSizes;\n }, [props.tableLayout?.columnsResizable, table.getFlatHeaders, table.getVisibleLeafColumns]);\n\n // With cell selection on, the table announces as a grid so the tds compute\n // as gridcells and aria-selected applies; existing grids keep their plain\n // semantic table untouched.\n const cellSelectionOn = !!props.tableLayout?.cellSelection && table.atoms.cellSelection != null;\n\n return (\n <table\n data-slot=\"data-grid-table\"\n role={cellSelectionOn ? \"grid\" : undefined}\n aria-multiselectable={\n cellSelectionOn && props.tableLayout?.cellSelectionMode !== \"single\" ? true : undefined\n }\n // recordCount can undercount the rows actually present (a pinned\n // draft row a consumer keeps out of its totals), and aria-rowindex\n // is computed from the full display order; the union keeps every\n // announced index inside the announced count.\n aria-rowcount={\n cellSelectionOn\n ? Math.max(recordCount, table.getRowsInDisplayOrder().length) + 1\n : undefined\n }\n className={cn(\n \"caption-bottom text-left align-middle font-normal text-foreground text-sm rtl:text-right\",\n props.tableLayout?.columnsResizable ? \"min-w-0\" : \"w-full min-w-full\",\n props.tableLayout?.width === \"auto\" ? \"table-auto\" : \"table-fixed\",\n !props.tableLayout?.columnsResizable && \"\",\n !props.tableLayout?.columnsDraggable && \"border-separate border-spacing-0\",\n props.tableClassNames?.base,\n )}\n style={\n props.tableLayout?.columnsResizable\n ? {\n ...columnSizeVars,\n width: `calc(${table.getTotalSize()}px + var(--data-grid-fill-size, 0px))`,\n }\n : undefined\n }\n >\n <colgroup>\n {[...leftVisibleColumns, ...centerVisibleColumns].map((column) => (\n <col\n key={column.id}\n style={\n props.tableLayout?.columnsResizable\n ? { width: `calc(var(--col-${column.id}-size) * 1px)` }\n : props.tableLayout?.width === \"fixed\"\n ? { width: column.getSize() }\n : undefined\n }\n />\n ))}\n {hasRightPinnedColumns ? <DataGridTableFillCol /> : null}\n {rightVisibleColumns.map((column) => (\n <col\n key={column.id}\n style={\n props.tableLayout?.columnsResizable\n ? { width: `calc(var(--col-${column.id}-size) * 1px)` }\n : props.tableLayout?.width === \"fixed\"\n ? { width: column.getSize() }\n : undefined\n }\n />\n ))}\n {!hasRightPinnedColumns ? <DataGridTableFillCol /> : null}\n </colgroup>\n {children}\n </table>\n );\n}\n\nfunction DataGridTableViewport({\n children,\n className,\n viewportRef,\n style,\n}: {\n children: ReactNode;\n className?: string;\n viewportRef?: Ref<HTMLDivElement>;\n style?: CSSProperties;\n}) {\n const { props, table, autoSize } = useDataGrid();\n const isColumnsResizable = !!props.tableLayout?.columnsResizable;\n const viewportNodeRef = useRef<HTMLDivElement | null>(null);\n const fillStateRef = useRef({ containerWidth: 0, appliedFill: -1 });\n const stopContainerObserverRef = useRef<(() => void) | null>(null);\n\n // Free space is written as a CSS variable directly on the viewport node\n // instead of React state, so container resizes and column-size commits\n // reach the fill column without re-rendering the grid.\n const syncFillWidth = useCallback(() => {\n const node = viewportNodeRef.current;\n if (!node) return;\n\n const freeSpace = fillStateRef.current.containerWidth - table.getTotalSize();\n const fillWidth = Math.max(0, freeSpace);\n\n if (fillStateRef.current.appliedFill !== fillWidth) {\n fillStateRef.current.appliedFill = fillWidth;\n node.style.setProperty(\"--data-grid-fill-size\", `${fillWidth}px`);\n // Unitless twin for the meta.fillWidth column, whose size variable\n // participates in a calc that multiplies by 1px afterwards.\n node.style.setProperty(\"--data-grid-fill\", String(fillWidth));\n }\n\n // Signed on purpose: a shrinking container drives the free space\n // NEGATIVE, which is exactly what tells a meta.autoSize column to hand\n // its absorbed width back.\n autoSize?.apply(freeSpace);\n }, [autoSize, table]);\n\n const handleViewportRef = useCallback(\n (node: HTMLDivElement | null) => {\n stopContainerObserverRef.current?.();\n stopContainerObserverRef.current = null;\n viewportNodeRef.current = node;\n assignRef(viewportRef, node);\n\n if (!node) return;\n\n if (!isColumnsResizable) {\n fillStateRef.current.appliedFill = -1;\n node.style.removeProperty(\"--data-grid-fill-size\");\n node.style.removeProperty(\"--data-grid-fill\");\n return;\n }\n\n const scrollViewport = getDataGridScrollAreaViewport(node) ?? node.parentElement;\n const measurementTarget = scrollViewport ?? node;\n\n const measure = () => {\n fillStateRef.current.containerWidth = measurementTarget.clientWidth;\n syncFillWidth();\n };\n\n // First measure runs inside the mount commit, before paint, so the fill\n // column and any meta.autoSize growth land in the first painted frame.\n measure();\n\n if (typeof ResizeObserver !== \"undefined\") {\n const observer = new ResizeObserver(measure);\n observer.observe(measurementTarget);\n stopContainerObserverRef.current = () => observer.disconnect();\n }\n },\n [isColumnsResizable, syncFillWidth, viewportRef],\n );\n\n // Column sizing commits and visibility changes alter the table's total size\n // without moving the container, so the fill var must re-sync after renders\n // the ResizeObserver never sees. No-ops when the value is unchanged.\n useLayoutEffect(() => {\n if (!isColumnsResizable) return;\n syncFillWidth();\n });\n\n return (\n <div\n data-slot=\"data-grid-table-viewport\"\n ref={handleViewportRef}\n className={cn(\"relative min-w-full align-top\", className)}\n style={{\n ...(isColumnsResizable\n ? {\n width: `calc(${table.getTotalSize()}px + var(--data-grid-fill-size, 0px))`,\n }\n : undefined),\n ...style,\n }}\n >\n {children}\n <DataGridTableResizeIndicator viewportNodeRef={viewportNodeRef} />\n </div>\n );\n}\n\nfunction DataGridTableHead({ children }: { children: ReactNode }) {\n const { props } = useDataGrid();\n\n return (\n <thead\n className={cn(\n props.tableClassNames?.header,\n props.tableLayout?.headerSticky && props.tableClassNames?.headerSticky,\n )}\n >\n {children}\n </thead>\n );\n}\n\nfunction DataGridTableHeadRow({ children }: { children: ReactNode; rowId: string }) {\n const { props } = useDataGrid();\n\n return (\n <tr\n aria-rowindex={props.tableLayout?.cellSelection ? 1 : undefined}\n className={cn(\n props.tableLayout?.headerBorder && \"[&>th]:border-b\",\n props.tableLayout?.cellBorder && \"*:last:border-e-0\",\n props.tableLayout?.stripped && \"bg-transparent\",\n props.tableLayout?.headerBackground === false && \"bg-transparent\",\n props.tableClassNames?.headerRow,\n )}\n >\n {children}\n </tr>\n );\n}\n\nfunction DataGridTableHeadRowCell<TData extends object>({\n children,\n header,\n dndRef,\n dndStyle,\n}: {\n children: ReactNode;\n header: Header<DataGridFeatures, TData, unknown>;\n dndRef?: React.Ref<HTMLTableCellElement>;\n dndStyle?: CSSProperties;\n}) {\n const { props, table } = useDataGrid();\n\n const { column } = header;\n const isPinned = column.getIsPinned();\n const isFirstStartPinned = isPinned === \"start\" && column.getIsFirstColumn(\"start\");\n const isLastStartPinned = isPinned === \"start\" && column.getIsLastColumn(\"start\");\n const isFirstEndPinned = isPinned === \"end\" && column.getIsFirstColumn(\"end\");\n const isLastEndPinned = isPinned === \"end\" && column.getIsLastColumn(\"end\");\n const isLastVisibleColumn =\n column.getIndex() === header.getContext().table.getVisibleLeafColumns().length - 1;\n const headerCellSpacing = headerCellSpacingVariants({\n size: props.tableLayout?.dense ? \"dense\" : \"default\",\n });\n\n const sortDirection = column.getIsSorted();\n\n return (\n <th\n ref={dndRef}\n scope=\"col\"\n colSpan={header.colSpan > 1 ? header.colSpan : undefined}\n aria-sort={\n sortDirection === \"asc\"\n ? \"ascending\"\n : sortDirection === \"desc\"\n ? \"descending\"\n : column.getCanSort()\n ? \"none\"\n : undefined\n }\n aria-colindex={props.tableLayout?.cellSelection ? column.getIndex() + 1 : undefined}\n data-col-id={column.id}\n style={{\n ...(props.tableLayout?.width === \"fixed\" &&\n !props.tableLayout?.columnsResizable && {\n width: header.getSize(),\n }),\n ...(props.tableLayout?.columnsPinnable && column.getCanPin() && getPinningStyles(column)),\n // A sticky child does not ride a sticky ancestor: under a sticky\n // header the pinned cell's own position:sticky (horizontal) opts it\n // out of the thead's vertical stickiness, and the corner scrolls\n // away while its non-positioned siblings stick. Pin both axes on\n // the cell itself.\n ...(props.tableLayout?.headerSticky && isPinned && { top: 0 }),\n ...(props.tableLayout?.columnsResizable && {\n width: `calc(var(--header-${header.id}-size) * 1px)`,\n }),\n ...(dndStyle ? dndStyle : null),\n }}\n data-pinned={isPinned || undefined}\n data-outer-pinned-col={isFirstStartPinned ? \"start\" : isLastEndPinned ? \"end\" : undefined}\n data-last-col={isLastStartPinned ? \"start\" : isFirstEndPinned ? \"end\" : undefined}\n className={cn(\n \"relative h-10 text-left align-middle font-medium text-foreground rtl:text-right [&:has([role=checkbox])]:pe-0\",\n headerCellSpacing,\n props.tableLayout?.headerBackground && \"bg-muted\",\n props.tableLayout?.cellBorder && \"border-e\",\n // The resize filler column follows the center group, and a border on\n // the last center cell would float against that empty strip.\n props.tableLayout?.cellBorder &&\n props.tableLayout?.columnsResizable &&\n // With end-pinned columns but no pin affordance, the pinned edge\n // draws no separator of its own; keep the border then.\n (props.tableLayout?.columnsPinnable || !hasDataGridTableRightPinnedColumns(table)) &&\n !isPinned &&\n column.getIsLastColumn(\"center\") &&\n \"border-e-0\",\n props.tableLayout?.columnsResizable &&\n column.getCanResize() &&\n (isPinned ? \"overflow-hidden\" : \"overflow-visible\"),\n props.tableLayout?.columnsResizable &&\n column.getCanResize() &&\n isLastVisibleColumn &&\n \"pe-8\",\n props.tableLayout?.columnsPinnable &&\n column.getCanPin() &&\n cn(\n \"data-pinned:isolate data-pinned:bg-muted data-outer-pinned-col:bg-clip-padding\",\n \"[&[data-pinned=end]:last-child_div.cursor-col-resize:last-child]:opacity-0 [&[data-pinned=end][data-last-col=end]]:shadow-[inset_1px_0_0_0_var(--border)] [&[data-pinned=start][data-last-col=start]]:shadow-[inset_-1px_0_0_0_var(--border)]\",\n \"[&:not([data-pinned]):has(+[data-pinned])_div.cursor-col-resize:last-child]:opacity-0 [&[data-last-col=start]_div.cursor-col-resize:last-child]:opacity-0\",\n ),\n header.column.columnDef.meta?.headerClassName,\n // Edge detection spans the full visible leaf order; the header's own\n // group only covers one pinning bucket.\n column.getIndex() === 0 || isLastVisibleColumn ? props.tableClassNames?.edgeCell : \"\",\n )}\n >\n {children}\n </th>\n );\n}\n\n/**\n * TanStack's own default, restated here on purpose.\n *\n * v8 merged each feature's default table options into `table.options`, so\n * reading `table.options.columnResizeMode` gave you `\"onEnd\"` even when the\n * consumer never set it. v9 resolves feature defaults internally and leaves\n * the option `undefined` on the instance, so the old `?? table.options...`\n * fallback quietly produced `undefined` - and every grid that had not opted\n * into a mode explicitly lost the onEnd drag session: no cursor lock, no\n * vertical indicator, and an immediate commit instead of a deferred one.\n */\nconst DATA_GRID_DEFAULT_COLUMN_RESIZE_MODE = \"onEnd\" as const;\n\nfunction getDataGridColumnResizeMode(\n layoutMode: \"onChange\" | \"onEnd\" | undefined,\n tableMode: \"onChange\" | \"onEnd\" | undefined,\n) {\n return layoutMode ?? tableMode ?? DATA_GRID_DEFAULT_COLUMN_RESIZE_MODE;\n}\n\nfunction DataGridTableHeadRowCellResize<TData extends object>({\n header,\n}: {\n header: Header<DataGridFeatures, TData, unknown>;\n}) {\n const { props, table } = useDataGrid<TData>();\n const { column } = header;\n const isPinned = column.getIsPinned();\n const isLastVisibleColumn =\n column.getIndex() === header.getContext().table.getVisibleLeafColumns().length - 1;\n const isResizeModeOnEnd =\n getDataGridColumnResizeMode(\n props.tableLayout?.columnsResizeMode,\n table.options.columnResizeMode,\n ) === \"onEnd\";\n const stopResizeSessionRef = useRef<(() => void) | undefined>(undefined);\n\n // End a live drag if the handle unmounts mid-resize so document listeners\n // and the app-wide col-resize cursor don't outlive the grid.\n useEffect(() => {\n return () => {\n stopResizeSessionRef.current?.();\n stopResizeSessionRef.current = undefined;\n };\n }, []);\n\n const handleMouseDown = (event: ReactMouseEvent<HTMLElement>) => {\n // Only the primary button starts a resize; guard before preventDefault so\n // right-click still opens the context menu.\n if (event.button !== 0) return;\n\n event.preventDefault();\n event.stopPropagation();\n\n stopResizeSessionRef.current?.();\n stopResizeSessionRef.current = startDataGridColumnResizeOnEnd(\n event,\n header,\n table,\n !isResizeModeOnEnd,\n );\n };\n\n const handleTouchStart = (event: ReactTouchEvent<HTMLElement>) => {\n event.preventDefault();\n event.stopPropagation();\n\n stopResizeSessionRef.current?.();\n stopResizeSessionRef.current = startDataGridColumnResizeOnEnd(\n event,\n header,\n table,\n !isResizeModeOnEnd,\n );\n };\n\n return (\n // A span, deliberately: consumers stretch end-aligned header CONTENT\n // with `[&>div]:w-full` on headerClassName, and that compiled child\n // selector (0,1,1) beats the handle's own w-5 (0,1,0) - a div handle\n // then covers the whole cell and swallows the menu click. Hardening\n // w-5 with ! was rejected: the tag change removes the fight instead\n // of escalating it.\n <span\n data-slot=\"data-grid-table-resize-handle\"\n {...{\n onDoubleClick: () => column.resetSize(),\n onMouseDown: handleMouseDown,\n onTouchStart: handleTouchStart,\n className: cn(\n \"user-select-none absolute top-0 z-10 flex h-full cursor-col-resize touch-none\",\n isPinned === \"end\"\n ? cn(\n // An end-pinned column grows from its START edge (its end is\n // anchored), so the handle lives there, inside the sticky\n // cell.\n \"start-0 w-5 justify-start\",\n props.tableLayout?.columnsPinnable\n ? \"before:hidden\"\n : \"before:absolute before:inset-y-0 before:start-0 before:w-px before:bg-border\",\n )\n : isLastVisibleColumn\n ? \"end-0 w-5 justify-end before:hidden\"\n : isPinned\n ? cn(\n // A pinned column is sticky, so the handle sits inside the\n // cell instead of straddling the boundary, where the next\n // sticky cell would paint over it.\n \"end-0 w-5 justify-end\",\n // With the pin affordance on, the pinned edge already draws\n // its own separator and a resize line would double it. But\n // pinning is also usable purely as an ordering lock, with no\n // affordance and no separator -- and there this line is the\n // only thing marking the edge, so hiding it left a resizable\n // column showing a resize cursor and no indicator at all.\n props.tableLayout?.columnsPinnable\n ? \"before:hidden\"\n : \"before:absolute before:inset-y-0 before:end-0 before:w-px before:bg-border\",\n )\n : cn(\n \"-end-2 w-5 justify-center\",\n // With cell borders on, the th border-e already marks every\n // boundary and this always-on line would double it; the wide\n // hit area and resize cursor stay.\n props.tableLayout?.cellBorder\n ? \"before:hidden\"\n : \"before:absolute before:inset-y-0 before:w-px before:-translate-x-px before:bg-border\",\n ),\n column.getIsResizing() &&\n (isResizeModeOnEnd\n ? \"opacity-100\"\n : isLastVisibleColumn\n ? \"opacity-100 before:absolute before:inset-y-0 before:end-0 before:block before:w-0.5 before:bg-primary\"\n : \"opacity-100 before:block before:w-0.5 before:bg-primary\"),\n ),\n }}\n />\n );\n}\n\nfunction DataGridTableResizeIndicator({\n viewportNodeRef,\n}: {\n viewportNodeRef: RefObject<HTMLDivElement | null>;\n}) {\n const { props, table } = useDataGrid();\n const indicatorRef = useRef<HTMLDivElement | null>(null);\n const indicatorHeadRef = useRef<HTMLDivElement | null>(null);\n // Header height is stable for the duration of a drag; caching it per\n // session avoids a forced layout (querySelector + getBoundingClientRect)\n // on every mousemove.\n const headerHeightCacheRef = useRef<{\n key: string | false;\n value: number;\n }>({ key: false, value: 0 });\n const columnResizing = table.state.columnResizing;\n const resizingColumnId = columnResizing.isResizingColumn;\n const resizeMode = getDataGridColumnResizeMode(\n props.tableLayout?.columnsResizeMode,\n table.options.columnResizeMode,\n );\n const isActive = !!(\n props.tableLayout?.columnsResizable &&\n resizeMode === \"onEnd\" &&\n resizingColumnId\n );\n\n // Positioning happens imperatively after each drag-frame render: layout\n // reads (viewport rect, thead height) and ref access belong outside render,\n // and writing styles directly avoids holding the viewport node in React\n // state, which would cost every grid a second render pass at mount.\n useLayoutEffect(() => {\n const indicator = indicatorRef.current;\n const indicatorHead = indicatorHeadRef.current;\n const viewportElement = viewportNodeRef.current;\n\n if (!isActive || !indicator || !indicatorHead || !resizingColumnId) return;\n\n const resizingHeader = table\n .getFlatHeaders()\n .find((header) => header.column.id === resizingColumnId || header.id === resizingColumnId);\n\n if (!resizingHeader) return;\n\n // deltaOffset is a logical delta (already direction-adjusted); translate\n // by the physical pointer movement so the indicator follows the cursor\n // instead of mirroring it. End-pinned columns resize mirrored (see the\n // session), so the multiplier matches theirs.\n const directionMultiplier =\n (table.options.columnResizeDirection === \"rtl\") !==\n (resizingHeader.column.getIsPinned() === \"end\")\n ? -1\n : 1;\n const deltaOffset = (columnResizing.deltaOffset ?? 0) * directionMultiplier;\n\n if (headerHeightCacheRef.current.key !== resizingColumnId) {\n headerHeightCacheRef.current = {\n key: resizingColumnId,\n value:\n viewportElement\n ?.querySelector('[data-slot=\"data-grid-table\"] thead')\n ?.getBoundingClientRect().height ?? 0,\n };\n }\n\n const headerHeight = headerHeightCacheRef.current.value;\n // Anchor on the live header cell: content math (getStart) cannot place a\n // STICKY pinned column, while the DOM rect is right for every column at\n // any scroll position. The state offset and content math stay as\n // fallbacks for a header that is not in the DOM.\n const viewportRoot =\n viewportElement ?? indicator.closest<HTMLElement>('[data-slot=\"data-grid-table-viewport\"]');\n const headerCellElement = viewportRoot?.querySelector<HTMLElement>(\n `thead th[data-col-id=\"${CSS.escape(resizingHeader.column.id)}\"]`,\n );\n let indicatorLeft: number;\n if (headerCellElement && viewportRoot) {\n const anchorRect = headerCellElement.getBoundingClientRect();\n const edgeClientX =\n (table.options.columnResizeDirection === \"rtl\") !==\n (resizingHeader.column.getIsPinned() === \"end\")\n ? anchorRect.left\n : anchorRect.right;\n indicatorLeft = edgeClientX - viewportRoot.getBoundingClientRect().left;\n } else if (typeof columnResizing.startOffset === \"number\" && viewportElement) {\n indicatorLeft = columnResizing.startOffset - viewportElement.getBoundingClientRect().left;\n } else {\n indicatorLeft = resizingHeader.getStart() + resizingHeader.getSize();\n }\n\n indicator.style.left = `${indicatorLeft}px`;\n indicator.style.transform = `translateX(${deltaOffset}px)`;\n indicatorHead.style.height = `${Math.max(headerHeight, 6)}px`;\n });\n\n if (!isActive) return null;\n\n return (\n <div\n ref={indicatorRef}\n aria-hidden=\"true\"\n data-slot=\"data-grid-table-resize-indicator\"\n className=\"pointer-events-none absolute inset-y-0 z-50\"\n >\n <div className=\"absolute inset-y-0 left-0 w-px -translate-x-1/2 bg-primary/85\" />\n <div\n ref={indicatorHeadRef}\n className=\"absolute top-0 left-0 -translate-x-1/2 rounded-b-sm bg-primary shadow-xs\"\n style={{ width: 5 }}\n />\n </div>\n );\n}\n\nfunction DataGridTableRowSpacer() {\n return <tbody aria-hidden=\"true\" className=\"h-2\" data-slot=\"data-grid-table-body-spacer\" />;\n}\n\nfunction DataGridTableBody({ children }: { children: ReactNode }) {\n const { props } = useDataGrid();\n\n return (\n <tbody\n data-slot=\"data-grid-table-body\"\n className={cn(\n props.tableLayout?.rowRounded && \"[&_td:first-child]:rounded-l-lg\",\n props.tableLayout?.rowRounded && \"[&_td:last-child]:rounded-r-lg\",\n props.tableClassNames?.body,\n )}\n >\n {children}\n </tbody>\n );\n}\n\nfunction DataGridTableFoot({ children }: { children: ReactNode }) {\n const { props } = useDataGrid();\n return (\n <tfoot data-slot=\"data-grid-table-foot\" className={cn(props.tableClassNames?.footer)}>\n {children}\n </tfoot>\n );\n}\n\nfunction DataGridTableFootRow({ children }: { children: ReactNode }) {\n const { props, table } = useDataGrid();\n const footRowBottomBorderClasses = \"[&:not(:last-child)>td]:border-b\";\n\n return (\n <tr\n data-slot=\"data-grid-table-foot-row\"\n className={cn(\n props.tableLayout?.footerBackground && \"bg-muted/40 dark:bg-background\",\n props.tableLayout?.rowBorder && footRowBottomBorderClasses,\n props.tableLayout?.cellBorder && \"*:last:border-e-0\",\n // The fill foot cell is the :last child, so the rule above only\n // strips the filler; the real last cell needs the same treatment or\n // its border floats into the strip while thead and tbody suppress\n // theirs. Same pin-affordance gate as the cell-level suppressors.\n props.tableLayout?.cellBorder &&\n props.tableLayout?.columnsResizable &&\n (props.tableLayout?.columnsPinnable || !hasDataGridTableRightPinnedColumns(table)) &&\n \"[&>td:has(+td[data-slot=data-grid-table-fill-foot-cell])]:border-e-0\",\n )}\n >\n {children}\n <DataGridTableFillFootCell />\n </tr>\n );\n}\n\nfunction DataGridTableFootRowCell({\n children,\n colSpan,\n className,\n}: {\n children?: ReactNode;\n colSpan?: number;\n className?: string;\n}) {\n const { props } = useDataGrid();\n const spacing = footerCellSpacingVariants({\n size: props.tableLayout?.dense ? \"dense\" : \"default\",\n });\n return (\n <td\n colSpan={colSpan}\n className={cn(\n \"align-middle font-medium text-secondary-foreground/80\",\n spacing,\n props.tableLayout?.footerBackground && \"bg-muted/40 dark:bg-background\",\n props.tableLayout?.cellBorder && \"border-e\",\n className,\n )}\n >\n {children}\n </td>\n );\n}\n\nfunction DataGridTableBodyRowSkeleton({ children }: { children: ReactNode }) {\n const { props } = useDataGrid();\n\n return (\n <tr\n className={cn(\n \"hover:bg-muted/40 data-[state=selected]:bg-muted/50\",\n props.onRowClick && \"cursor-pointer\",\n !props.tableLayout?.stripped &&\n props.tableLayout?.rowBorder &&\n \"border-border border-b [&:not(:last-child)>td]:border-b\",\n props.tableLayout?.cellBorder && \"*:last:border-e-0\",\n props.tableLayout?.stripped && \"odd:bg-muted/90 hover:bg-transparent odd:hover:bg-muted\",\n props.tableClassNames?.bodyRow,\n )}\n >\n {children}\n </tr>\n );\n}\n\nfunction DataGridTableBodyRowSkeletonCell<TData extends object>({\n children,\n column,\n}: {\n children: ReactNode;\n column: Column<DataGridFeatures, TData, unknown>;\n}) {\n const { props, table } = useDataGrid();\n const bodyCellSpacing = bodyCellSpacingVariants({\n size: props.tableLayout?.dense ? \"dense\" : \"default\",\n });\n\n return (\n <td\n style={\n props.tableLayout?.columnsResizable\n ? { width: `calc(var(--col-${column.id}-size) * 1px)` }\n : undefined\n }\n className={cn(\n \"align-middle\",\n bodyCellSpacing,\n props.tableLayout?.cellBorder && \"border-e\",\n props.tableLayout?.cellBorder &&\n props.tableLayout?.columnsResizable &&\n // With end-pinned columns but no pin affordance, the pinned edge\n // draws no separator of its own; keep the border then.\n (props.tableLayout?.columnsPinnable || !hasDataGridTableRightPinnedColumns(table)) &&\n !column.getIsPinned() &&\n column.getIsLastColumn(\"center\") &&\n \"border-e-0\",\n props.tableLayout?.columnsResizable && column.getCanResize() && \"truncate\",\n column.columnDef.meta?.cellClassName,\n props.tableLayout?.columnsPinnable &&\n column.getCanPin() &&\n \"data-pinned:isolate data-pinned:bg-background [&[data-pinned=end][data-last-col=end]]:shadow-[inset_1px_0_0_0_var(--border)] [&[data-pinned=start][data-last-col=start]]:shadow-[inset_-1px_0_0_0_var(--border)]\",\n column.getIndex() === 0 || column.getIndex() === table.getVisibleLeafColumns().length - 1\n ? props.tableClassNames?.edgeCell\n : \"\",\n )}\n >\n {children}\n </td>\n );\n}\n\nfunction DataGridTableBodyRow<TData extends object>({\n children,\n row,\n pinnedBoundary,\n rowRef,\n dndRef,\n dndStyle,\n dataIndex,\n}: {\n children: ReactNode;\n row: Row<DataGridFeatures, TData>;\n pinnedBoundary?: DataGridTablePinnedBoundary;\n rowRef?: React.Ref<HTMLTableRowElement>;\n dndRef?: React.Ref<HTMLTableRowElement>;\n dndStyle?: CSSProperties;\n dataIndex?: number;\n}) {\n const { props, table } = useDataGrid();\n const isRowPinned = row.getIsPinned();\n const rowStatus = props.getRowStatus?.(row.original);\n\n const bodyRowBottomBorderClasses =\n \"[&:not(:last-child)>td]:border-b [tbody:has(+tfoot)_&:last-child>td]:border-b [*:has(>[data-slot=data-grid]+[data-slot=data-grid-pagination])_[data-slot=data-grid]_&:last-child>td]:border-b\";\n\n return (\n <tr\n ref={(node) => {\n assignRef(rowRef, node);\n assignRef(dndRef, node);\n }}\n style={{ ...(dndStyle ? dndStyle : null) }}\n data-state={table.options.enableRowSelection && row.getIsSelected() ? \"selected\" : undefined}\n data-index={dataIndex}\n data-row-id={row.id}\n data-depth={row.depth || undefined}\n data-row-pinned={isRowPinned || undefined}\n data-row-pinned-boundary={pinnedBoundary}\n data-row-status={rowStatus}\n // 1-based after the header row; row.index is the position in the data,\n // so the announced index stays absolute across pagination.\n aria-rowindex={props.tableLayout?.cellSelection ? row.index + 2 : undefined}\n onClick={() => props.onRowClick?.(row.original)}\n className={cn(\n \"hover:bg-muted/40 data-[state=selected]:bg-muted/50\",\n /* Pinned cells hide scrolled content behind an OPAQUE background,\n which also hides the row's translucent hover and selected tints;\n they get the same tints premixed over the background instead,\n the row-status treatment. */\n \"hover:[&>td[data-pinned]]:bg-[color-mix(in_oklab,var(--muted)_40%,var(--background))]\",\n \"data-[state=selected]:[&>td[data-pinned]]:bg-[color-mix(in_oklab,var(--muted)_50%,var(--background))]\",\n props.onRowClick && \"cursor-pointer\",\n // Optional CRUD indications, active only when getRowStatus is\n // wired; the warning-muted defaults yield to tableClassNames\n // overrides per status. Pinned cells must stay OPAQUE (they hide\n // scrolled content), so they get the same tint pre-mixed over the\n // background instead of inheriting the translucent row fill.\n props.getRowStatus &&\n \"data-[row-status=deleted]:bg-destructive/5 data-[row-status=dirty]:bg-amber-500/5 data-[row-status=new]:bg-green-500/5 data-[row-status=deleted]:opacity-60 data-[row-status=deleted]:[&_td]:line-through\",\n props.getRowStatus &&\n \"data-[row-status=deleted]:[&>td[data-pinned]]:bg-[color-mix(in_oklab,var(--destructive)_5%,var(--background))] data-[row-status=dirty]:[&>td[data-pinned]]:bg-[color-mix(in_oklab,var(--color-amber-500)_5%,var(--background))] data-[row-status=new]:[&>td[data-pinned]]:bg-[color-mix(in_oklab,var(--color-green-500)_5%,var(--background))]\",\n rowStatus === \"new\" && props.tableClassNames?.rowNew,\n rowStatus === \"dirty\" && props.tableClassNames?.rowDirty,\n rowStatus === \"deleted\" && props.tableClassNames?.rowDeleted,\n !props.tableLayout?.stripped && props.tableLayout?.rowBorder && bodyRowBottomBorderClasses,\n props.tableLayout?.cellBorder && `*:last:border-e-0 ${bodyRowBottomBorderClasses}`,\n // Virtualized rows stripe by absolute row index (CSS :nth-child\n // parity flips as spacer rows resize while scrolling).\n props.tableLayout?.stripped &&\n (typeof dataIndex === \"number\"\n ? cn(\"hover:bg-transparent\", dataIndex % 2 === 0 && \"bg-muted/90 hover:bg-muted\")\n : \"odd:bg-muted/90 hover:bg-transparent odd:hover:bg-muted\"),\n props.tableLayout?.rowsPinnable && isRowPinned && \"bg-muted/30 hover:bg-muted/50\",\n pinnedBoundary === \"top\" &&\n \"[&>td]:shadow-[0_2px_0_rgba(0,0,0,0.03)] dark:[&>td]:shadow-[0_2px_0_rgba(255,255,255,0.06)]\",\n // A bottom-pinned row borders scrolled content along its TOP edge,\n // so its separator shadow casts upward.\n pinnedBoundary === \"bottom\" &&\n \"[&>td]:shadow-[0_-2px_0_rgba(0,0,0,0.03)] dark:[&>td]:shadow-[0_-2px_0_rgba(255,255,255,0.06)]\",\n props.tableLayout?.rowsPinnable && isRowPinned && props.tableClassNames?.rowPinned,\n props.tableClassNames?.bodyRow,\n )}\n >\n {children}\n </tr>\n );\n}\n\nfunction DataGridTableBodyRowExpandded<TData extends object>({\n row,\n}: {\n row: Row<DataGridFeatures, TData>;\n}) {\n const { props, table } = useDataGrid();\n const expandedContent = table\n .getAllColumns()\n .find((column) => column.columnDef.meta?.expandedContent)?.columnDef.meta?.expandedContent;\n\n // Tree and grouped rows share row.getIsExpanded() with detail expansion.\n // Without a detail column there is nothing to render, and an empty <tr>\n // would break striping parity, rowBorder, and virtual row measurement.\n if (!expandedContent) return null;\n\n const bodyRowBottomBorderClasses =\n \"[&:not(:last-child)>td]:border-b [tbody:has(+tfoot)_&:last-child>td]:border-b [*:has(>[data-slot=data-grid]+[data-slot=data-grid-pagination])_[data-slot=data-grid]_&:last-child>td]:border-b\";\n\n return (\n <tr className={cn(props.tableLayout?.rowBorder && bodyRowBottomBorderClasses)}>\n <td\n colSpan={\n getDataGridTableOrderedVisibleCells(row).length +\n (props.tableLayout?.columnsResizable ? 1 : 0)\n }\n >\n {expandedContent(row.original)}\n </td>\n </tr>\n );\n}\n\n/**\n * Interactive descendants keep their own mousedown semantics: a click on a\n * button, link, editor or checkbox inside a cell must never start or replace\n * a range. One selector also covers the row-dnd grip (a button), the expand\n * toggle, and `data-cell-interactive` - the documented opt-out for custom\n * widgets built from elements the tag list cannot know about.\n */\nfunction isDataGridCellInteractiveTarget(target: EventTarget | null): boolean {\n return (\n target instanceof Element &&\n target.closest(\n 'button, a, input, select, textarea, [contenteditable], [role=\"checkbox\"], [data-cell-interactive], [data-slot=\"data-grid-table-row-expand\"], [data-slot=\"data-grid-cell-fill-handle\"]',\n ) != null\n );\n}\n\nfunction DataGridTableBodyRowCell<TData extends object>({\n children,\n cell,\n dndRef,\n dndStyle,\n columnIndex,\n}: {\n children: ReactNode;\n cell: Cell<DataGridFeatures, TData, unknown>;\n dndRef?: React.Ref<HTMLTableCellElement>;\n dndStyle?: CSSProperties;\n /** Center-column index under column virtualization; data-column-index. */\n columnIndex?: number;\n}) {\n const { props, table, gridId } = useDataGrid();\n\n const { column, row } = cell;\n const isPinned = column.getIsPinned();\n const isLastStartPinned = isPinned === \"start\" && column.getIsLastColumn(\"start\");\n const isFirstEndPinned = isPinned === \"end\" && column.getIsFirstColumn(\"end\");\n const bodyCellSpacing = bodyCellSpacingVariants({\n size: props.tableLayout?.dense ? \"dense\" : \"default\",\n });\n\n // The atom check backs up the flag: consumers may hand the grid a leaner\n // bundle without cellSelectionFeature, and the flag alone must not make the\n // renderer call prototype APIs that were never assigned.\n const cellSelectionOn = !!props.tableLayout?.cellSelection && table.atoms.cellSelection != null;\n const rangeSelectionOn = cellSelectionOn && props.tableLayout?.cellSelectionMode !== \"single\";\n\n const renderTd = (selection: ReturnType<typeof getDataGridCellSelectionCellAttrs> | null) => (\n <td\n ref={dndRef}\n // The id is what the controller's aria-activedescendant points at, so\n // a screen reader tracks the focused cell through the container-focus\n // model.\n id={\n cellSelectionOn\n ? `${gridId}c-${toDataGridDomId(row.id)}-${toDataGridDomId(column.id)}`\n : undefined\n }\n aria-colindex={cellSelectionOn ? column.getIndex() + 1 : undefined}\n style={{\n ...(props.tableLayout?.columnsPinnable && column.getCanPin() && getPinningStyles(column)),\n // Paint containment clips at the padding edge, which would erase\n // the ::before selection chrome on pinned cells.\n ...(cellSelectionOn ? { contain: undefined } : null),\n ...(props.tableLayout?.columnsResizable && {\n width: `calc(var(--col-${column.id}-size) * 1px)`,\n }),\n ...(dndStyle ? dndStyle : null),\n }}\n data-pinned={isPinned || undefined}\n data-last-col={isLastStartPinned ? \"start\" : isFirstEndPinned ? \"end\" : undefined}\n data-cell-status={props.getCellStatus?.(row.original, column.id)}\n data-column-index={columnIndex}\n {...(selection ? selection : null)}\n onMouseDown={\n selection\n ? (event) => {\n if (event.button !== 0) return;\n if (isDataGridCellInteractiveTarget(event.target)) {\n // A modifier click is a SELECTION gesture even on a control:\n // Shift extends and Ctrl/Cmd adds, exactly as on a plain\n // cell, so no column is unreachable for ranges.\n if (\n rangeSelectionOn &&\n (event.shiftKey || event.metaKey || event.ctrlKey) &&\n cell.getCanSelect()\n ) {\n event.preventDefault();\n cell.getSelectionStartHandler()(event);\n return;\n }\n // The press starts the range session exactly like a plain\n // cell: the cell focuses, a drag extends from it, and a\n // motionless press still ends in the control's own click\n // (this is why drag releases are squelched upstream, in the\n // controller, once a drag actually grew the range).\n if (cell.getCanSelect()) {\n if (rangeSelectionOn) {\n cell.getSelectionStartHandler()(event);\n } else {\n table.setFocusedCell(row.id, column.id);\n }\n }\n return;\n }\n if (!rangeSelectionOn) {\n // Single mode: every gesture collapses to the one cell.\n if (cell.getCanSelect()) {\n table.setFocusedCell(row.id, column.id);\n }\n return;\n }\n cell.getSelectionStartHandler()(event);\n }\n : undefined\n }\n onMouseEnter={\n rangeSelectionOn ? (event) => cell.getSelectionExtendHandler()(event) : undefined\n }\n className={cn(\n \"align-middle\",\n bodyCellSpacing,\n // The classic edited-cell corner mark, active only when\n // getCellStatus is wired: amber for \"dirty\", destructive for\n // \"invalid\".\n props.getCellStatus &&\n \"data-cell-status:relative data-cell-status:after:absolute data-cell-status:after:end-0 data-cell-status:after:top-0 data-cell-status:after:size-0 data-cell-status:after:border-s-[5px] data-cell-status:after:border-s-transparent data-[cell-status=dirty]:after:border-t-amber-500 data-[cell-status=invalid]:after:border-t-destructive data-cell-status:after:border-t-[5px] data-cell-status:after:content-['']\",\n props.tableLayout?.cellBorder && \"border-e\",\n // Mirror of the head cell rule: no floating border against the\n // resize filler strip.\n props.tableLayout?.cellBorder &&\n props.tableLayout?.columnsResizable &&\n // With end-pinned columns but no pin affordance, the pinned edge\n // draws no separator of its own; keep the border then.\n (props.tableLayout?.columnsPinnable || !hasDataGridTableRightPinnedColumns(table)) &&\n !isPinned &&\n column.getIsLastColumn(\"center\") &&\n \"border-e-0\",\n props.tableLayout?.columnsResizable &&\n column.getCanResize() &&\n !cellSelectionOn &&\n \"truncate\",\n cell.column.columnDef.meta?.cellClassName,\n props.tableLayout?.columnsPinnable &&\n column.getCanPin() &&\n cn(\n \"data-pinned:isolate data-pinned:bg-background\",\n \"[&[data-pinned=start][data-last-col=start]]:shadow-[inset_-1px_0_0_0_var(--border)]\",\n \"[&[data-pinned=end][data-last-col=end]]:shadow-[inset_1px_0_0_0_var(--border)]\",\n ),\n column.getIndex() === 0 || column.getIndex() === row.getVisibleCells().length - 1\n ? props.tableClassNames?.edgeCell\n : \"\",\n selection && dataGridCellSelectionCellClasses,\n )}\n >\n {/* With cell selection on, the td must not clip (its ::before paints\n the selection chrome 1px outside the cell), so the resize\n truncation moves to an inner wrapper that clips at the same\n boundary the td used to. */}\n {cellSelectionOn && props.tableLayout?.columnsResizable && column.getCanResize() ? (\n <div\n className={bodyCellTruncateWrapVariants({\n size: props.tableLayout?.dense ? \"dense\" : \"default\",\n })}\n >\n {children}\n </div>\n ) : (\n children\n )}\n {props.tableLayout?.cellFillHandle &&\n selection?.[\"data-cell-edge-bottom\"] &&\n selection[\"data-cell-edge-right\"] && (\n <span\n data-slot=\"data-grid-cell-fill-handle\"\n /* \"dot\" stays fully inside the cell corner; \"ring\" rides the\n corner point the way Sheets draws it. Either way the handle\n clamps where straddling would break: at the grid's own\n boundary (last row, last cell, a last cell followed only by\n the filler strip), where an overhang would extend the scroll\n content and clip the selection chrome, and beside a PINNED\n column, whose sticky layer (z 30) would otherwise paint over\n the straddling half - raising the handle instead would float\n it above the pinned column during horizontal scroll. */\n className={cn(\n \"absolute z-10 in-data-cell-editing:hidden in-data-cell-selecting:hidden cursor-crosshair\",\n props.tableLayout?.cellFillHandleVariant === \"ring\"\n ? \"-end-[5px] in-[td:has(+[data-slot=data-grid-table-fill-body-cell]+td[data-pinned])]:end-0 in-[td:has(+[data-slot=data-grid-table-fill-body-cell]:last-child)]:end-0 in-[td:has(+td[data-pinned])]:end-0 in-[td:last-child]:end-0 -bottom-[5px] in-[tr:last-child]:bottom-0 size-[11px] rounded-full border-2 border-primary bg-background\"\n : props.tableLayout?.cellFillHandleVariant === \"square\"\n ? /* Abutting the cell borders from inside: no gap and no\n overlap, so the square cannot merge with a gridline\n into a wider-than-tall blob, and it can never leave\n the grid, which is why it needs no boundary clamps. */\n \"end-0 bottom-0 size-[5px] bg-primary\"\n : \"end-0 bottom-0 size-[9px] rounded-full border border-background bg-primary\",\n props.tableClassNames?.cellFillHandle,\n )}\n />\n )}\n </td>\n );\n\n if (!cellSelectionOn) return renderTd(null);\n\n // Per-cell subscription with a projecting selector: the atom writes once\n // per cell crossed during a drag, and shallow-comparing this tuple limits\n // the re-render to cells whose selection state actually changed.\n return (\n <Subscribe\n source={table.atoms.cellSelection}\n selector={() => getDataGridCellSelectionCellAttrs(cell)}\n >\n {(selection) => renderTd(selection)}\n </Subscribe>\n );\n}\n\nfunction DataGridTableRenderedRow<TData extends object>({\n row,\n pinnedBoundary,\n rowRef,\n rowIndex,\n centerWindow,\n}: {\n row: Row<DataGridFeatures, TData>;\n pinnedBoundary?: DataGridTablePinnedBoundary;\n rowRef?: React.Ref<HTMLTableRowElement>;\n /** Virtualized list index, rendered as data-index for measureElement. */\n rowIndex?: number;\n /**\n * Column-virtualization window over the CENTER cells: only the inclusive\n * [start, end] slice renders, and each flank collapses into one colSpan\n * spacer. The spacers carry no width of their own - the colgroup stays\n * complete, so under table-fixed the browser sizes them from the col\n * elements they span and the layout cannot drift.\n */\n centerWindow?: { start: number; end: number };\n}) {\n const { props, table } = useDataGrid();\n const startVisibleCells = row.getStartVisibleCells();\n const centerVisibleCells = row.getCenterVisibleCells();\n const endVisibleCells = row.getEndVisibleCells();\n const hasRightPinnedColumns = hasDataGridTableRightPinnedColumns(table);\n const windowedCenterCells = centerWindow\n ? centerVisibleCells.slice(centerWindow.start, centerWindow.end + 1)\n : centerVisibleCells;\n const leadingSpacerSpan = centerWindow ? centerWindow.start : 0;\n const trailingSpacerSpan = centerWindow\n ? Math.max(0, centerVisibleCells.length - 1 - centerWindow.end)\n : 0;\n\n return (\n <Fragment>\n <DataGridTableBodyRow\n row={row}\n pinnedBoundary={pinnedBoundary}\n rowRef={rowRef}\n dataIndex={rowIndex}\n >\n {startVisibleCells.map((cell: Cell<DataGridFeatures, TData, unknown>) => (\n <DataGridTableBodyRowCell cell={cell} key={cell.id}>\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n </DataGridTableBodyRowCell>\n ))}\n {leadingSpacerSpan > 0 && (\n <td\n aria-hidden=\"true\"\n data-slot=\"data-grid-table-virtual-col-spacer\"\n colSpan={leadingSpacerSpan}\n />\n )}\n {windowedCenterCells.map((cell: Cell<DataGridFeatures, TData, unknown>, cellIndex) => (\n <DataGridTableBodyRowCell\n cell={cell}\n key={cell.id}\n columnIndex={centerWindow ? centerWindow.start + cellIndex : undefined}\n >\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n </DataGridTableBodyRowCell>\n ))}\n {trailingSpacerSpan > 0 && (\n <td\n aria-hidden=\"true\"\n data-slot=\"data-grid-table-virtual-col-spacer\"\n colSpan={trailingSpacerSpan}\n />\n )}\n {props.tableLayout?.columnsResizable && hasRightPinnedColumns ? (\n <DataGridTableFillBodyCell />\n ) : null}\n {endVisibleCells.map((cell: Cell<DataGridFeatures, TData, unknown>) => (\n <DataGridTableBodyRowCell cell={cell} key={cell.id}>\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n </DataGridTableBodyRowCell>\n ))}\n {props.tableLayout?.columnsResizable && !hasRightPinnedColumns ? (\n <DataGridTableFillBodyCell />\n ) : null}\n </DataGridTableBodyRow>\n {row.getIsExpanded() && <DataGridTableBodyRowExpandded row={row} />}\n </Fragment>\n );\n}\n\nfunction DataGridTableEmpty() {\n const { i18n, table, props } = useDataGrid();\n const visibleColumnCount =\n getDataGridTableOrderedVisibleColumns(table).length +\n (props.tableLayout?.columnsResizable ? 1 : 0);\n\n return (\n <tr>\n <td\n colSpan={Math.max(visibleColumnCount, 1)}\n className=\"py-6 text-center text-muted-foreground text-sm\"\n >\n {props.emptyMessage || i18n.labels.empty}\n </td>\n </tr>\n );\n}\n\nfunction DataGridTableLoader() {\n const { i18n, props } = useDataGrid();\n\n return (\n <div className=\"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2\">\n <div className=\"flex items-center gap-2 rounded-lg border bg-card px-4 py-2 font-medium text-muted-foreground text-sm leading-none\">\n <Spinner className=\"size-5 opacity-60\" />\n {props.loadingMessage || i18n.labels.loading}\n </div>\n </div>\n );\n}\n\nfunction DataGridTableRowPin<TData extends object>({ row }: { row: Row<DataGridFeatures, TData> }) {\n const { i18n } = useDataGrid();\n const isPinned = row.getIsPinned();\n\n return (\n <button\n type=\"button\"\n aria-label={isPinned ? i18n.labels.unpinRow : i18n.labels.pinRow}\n onClick={(event) => {\n // Pinning must not bubble into the row's onRowClick handler.\n event.stopPropagation();\n\n if (isPinned) {\n row.pin(false);\n } else {\n row.pin(\"top\");\n }\n }}\n className={cn(\n \"inline-flex size-7 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:text-foreground\",\n isPinned && \"text-primary hover:text-primary/80\",\n )}\n >\n {isPinned ? (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n stroke=\"none\"\n >\n <path d=\"M16 2l4.585 4.586-2.122 2.121L17.05 7.293l-3.535 3.536 1.413 5.658-2.12 2.121-4.244-4.243L4.322 18.6l-1.414-1.41 4.242-4.244-4.243-4.243 2.122-2.121 5.656 1.414 3.536-3.536-1.414-1.414z\" />\n </svg>\n ) : (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <line x1=\"12\" y1=\"17\" x2=\"12\" y2=\"22\" />\n <path d=\"M5 17h14v-1.76a2 2 0 00-1.11-1.79l-1.78-.9A2 2 0 0115 10.76V6h1a2 2 0 000-4H8a2 2 0 000 4h1v4.76a2 2 0 01-1.11 1.79l-1.78.9A2 2 0 005 15.24z\" />\n </svg>\n )}\n </button>\n );\n}\n\n/**\n * Selection cell.\n *\n * The `Subscribe` wrapper is the v9 fix for React Compiler, and it is why this\n * file no longer needs `\"use no memo\"`. `useTable` hands back a fresh table on\n * every state change, which covers anything read through `table`, but this\n * component reads selection through `row.getIsSelected()` - a builder call\n * that hides its state dependency from the compiler. Rendered inside a column\n * `cell` template it receives a *stable* row, so the compiler is free to\n * memoize this JSX and never re-run those reads, which shows up as checkboxes\n * that do not respond to clicks.\n *\n * Subscribing to the row-selection atom gives the compiler a dependency it can\n * see. Note the standalone `Subscribe` rather than `table.Subscribe`: inside a\n * cell template the `table` handed to the column def is the core `Table`, which\n * has no `Subscribe` attached.\n */\nfunction DataGridTableRowSelect<TData extends object>({\n row,\n}: {\n row: Row<DataGridFeatures, TData>;\n}) {\n const { i18n } = useDataGrid();\n return (\n <Subscribe source={row.table.atoms.rowSelection}>\n {() => (\n <>\n <Checkbox\n checked={row.getIsSelected()}\n indeterminate={row.getIsSomeSelected() && !row.getIsSelected()}\n onCheckedChange={(value) => row.toggleSelected(!!value)}\n onClick={(event) => {\n // Selection must not bubble into the row's onRowClick handler.\n event.stopPropagation();\n }}\n aria-label={i18n.labels.selectRow}\n className=\"align-[inherit]\"\n />\n </>\n )}\n </Subscribe>\n );\n}\n\nfunction DataGridTableRowSelectAll() {\n const { i18n, table, recordCount, isLoading } = useDataGrid();\n\n // `getIsSomePageRowsSelected()` means \"at least one\" in v9, where v8 meant\n // \"some but not all\", so the all-selected case has to be excluded explicitly\n // or the header checkbox stays indeterminate once every row is checked.\n return (\n <Subscribe source={table.atoms.rowSelection}>\n {() => {\n const isAllSelected = table.getIsAllPageRowsSelected();\n const isSomeSelected = table.getIsSomePageRowsSelected();\n\n return (\n <Checkbox\n checked={isAllSelected}\n indeterminate={isSomeSelected && !isAllSelected}\n disabled={isLoading || recordCount === 0}\n onCheckedChange={(value) => table.toggleAllPageRowsSelected(!!value)}\n aria-label={i18n.labels.selectAll}\n className=\"align-[inherit]\"\n />\n );\n }}\n </Subscribe>\n );\n}\n\nfunction DataGridTableRowExpand<TData extends object>({\n row,\n indent = 20,\n className,\n children,\n}: {\n row: Row<DataGridFeatures, TData>;\n /** Horizontal offset in px applied per tree depth level. */\n indent?: number;\n className?: string;\n /** Custom toggle icon; replaces the default chevron. */\n children?: ReactNode;\n}) {\n const { i18n, props } = useDataGrid();\n const isExpanded = row.getIsExpanded();\n const controlSize = props.tableLayout?.dense ? \"size-6\" : \"size-7\";\n\n return (\n <span\n data-slot=\"data-grid-table-row-expand\"\n style={getDataGridTreeIndentStyle(row, indent)}\n className={cn(\n \"inline-flex shrink-0 items-center ps-(--data-grid-tree-padding) align-middle\",\n className,\n )}\n >\n {row.getCanExpand() ? (\n <button\n type=\"button\"\n aria-expanded={isExpanded}\n aria-label={isExpanded ? i18n.labels.collapseRow : i18n.labels.expandRow}\n onClick={(event) => {\n // Expansion must not bubble into the row's onRowClick handler.\n event.stopPropagation();\n row.toggleExpanded();\n }}\n className={cn(\n \"inline-flex items-center justify-center rounded-lg text-muted-foreground transition-colors hover:text-foreground\",\n controlSize,\n )}\n >\n {children ?? (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n className=\"in-aria-[expanded=false]:-rotate-90 transition-transform duration-200 rtl:in-aria-[expanded=false]:rotate-90\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n )}\n </button>\n ) : (\n // Leaf spacer: compact by design so leaf content sits near the\n // parent label instead of a full toggle width deeper.\n <span aria-hidden=\"true\" className=\"w-2 shrink-0\" />\n )}\n </span>\n );\n}\n\nfunction DataGridTableBodyRows<TData extends object>({\n table,\n}: {\n table: DataGridTableInstance<TData>;\n}) {\n const { i18n, isLoading, props } = useDataGrid();\n const pagination = table.state.pagination;\n\n if (isLoading && props.loadingMode === \"skeleton\" && pagination?.pageSize) {\n const leftVisibleColumns = table.getStartVisibleLeafColumns();\n const centerVisibleColumns = table.getCenterVisibleLeafColumns();\n const rightVisibleColumns = table.getEndVisibleLeafColumns();\n const hasRightPinnedColumns = hasDataGridTableRightPinnedColumns(table);\n\n return (\n <>\n {Array.from({ length: pagination.pageSize }).map((_, rowIndex) => (\n <DataGridTableBodyRowSkeleton key={rowIndex}>\n {[...leftVisibleColumns, ...centerVisibleColumns].map((column) => (\n <DataGridTableBodyRowSkeletonCell column={column} key={column.id}>\n {column.columnDef.meta?.skeleton}\n </DataGridTableBodyRowSkeletonCell>\n ))}\n {props.tableLayout?.columnsResizable && hasRightPinnedColumns ? (\n <DataGridTableFillBodyCell />\n ) : null}\n {rightVisibleColumns.map((column) => (\n <DataGridTableBodyRowSkeletonCell column={column} key={column.id}>\n {column.columnDef.meta?.skeleton}\n </DataGridTableBodyRowSkeletonCell>\n ))}\n {props.tableLayout?.columnsResizable && !hasRightPinnedColumns ? (\n <DataGridTableFillBodyCell />\n ) : null}\n </DataGridTableBodyRowSkeleton>\n ))}\n </>\n );\n }\n\n if (isLoading && props.loadingMode === \"spinner\") {\n return (\n <tr>\n <td\n colSpan={\n table.getVisibleFlatColumns().length + (props.tableLayout?.columnsResizable ? 1 : 0)\n }\n className=\"p-8\"\n >\n <div className=\"flex items-center justify-center\">\n <svg\n className=\"mr-3 -ml-1 h-5 w-5 animate-spin text-muted-foreground\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n className=\"opacity-25\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n />\n <path\n className=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n />\n </svg>\n {props.loadingMessage || i18n.labels.loading}\n </div>\n </td>\n </tr>\n );\n }\n\n const resolvedRows = getDataGridTableResolvedRows(table, props.tableLayout?.rowsPinnable);\n\n if (!resolvedRows.length) return <DataGridTableEmpty />;\n\n return (\n <>\n {resolvedRows.map(({ row, pinnedBoundary }) => (\n <DataGridTableRenderedRow key={row.id} row={row} pinnedBoundary={pinnedBoundary} />\n ))}\n </>\n );\n}\n\n/**\n * Memoized body rows: skip re-renders during active column resize.\n * Column widths update via CSS variables on the <table> element,\n * so the browser handles width changes without React re-renders.\n * A cell-selection drag gets the same treatment: the root re-renders once per\n * cell crossed, but painting goes through each cell's own Subscribe, so row\n * reconciliation during the drag is pure waste.\n */\nconst MemoizedDataGridTableBodyRows = memo(\n DataGridTableBodyRows,\n (_prev, next) =>\n !!next.table.state.columnResizing.isResizingColumn || next.table._isSelectingCells === true,\n) as typeof DataGridTableBodyRows;\n\nfunction DataGridTableHeader<_TData extends object>() {\n const { table, props } = useDataGrid();\n const mergedHeaderGroups = getDataGridTableMergedHeaderGroups(table);\n const hasRightPinnedColumns = hasDataGridTableRightPinnedColumns(table);\n\n return (\n <DataGridTableViewport>\n <DataGridTableBase>\n <DataGridTableHead>\n {mergedHeaderGroups.map((headerGroup) => {\n return (\n <DataGridTableHeadRow key={headerGroup.id} rowId={headerGroup.id}>\n {headerGroup.headers\n .filter((header) => header.column.getIsPinned() !== \"end\")\n .map((header) => {\n const { column } = header;\n\n return (\n <DataGridTableHeadRowCell header={header} key={header.id}>\n {header.isPlaceholder\n ? null\n : flexRender(header.column.columnDef.header, header.getContext())}\n {props.tableLayout?.columnsResizable && column.getCanResize() && (\n <DataGridTableHeadRowCellResize header={header} />\n )}\n </DataGridTableHeadRowCell>\n );\n })}\n {props.tableLayout?.columnsResizable && hasRightPinnedColumns ? (\n <DataGridTableFillHeadCell />\n ) : null}\n {headerGroup.headers\n .filter((header) => header.column.getIsPinned() === \"end\")\n .map((header) => {\n const { column } = header;\n\n return (\n <DataGridTableHeadRowCell header={header} key={header.id}>\n {header.isPlaceholder\n ? null\n : flexRender(header.column.columnDef.header, header.getContext())}\n {props.tableLayout?.columnsResizable && column.getCanResize() && (\n <DataGridTableHeadRowCellResize header={header} />\n )}\n </DataGridTableHeadRowCell>\n );\n })}\n {props.tableLayout?.columnsResizable && !hasRightPinnedColumns ? (\n <DataGridTableFillHeadCell />\n ) : null}\n </DataGridTableHeadRow>\n );\n })}\n </DataGridTableHead>\n </DataGridTableBase>\n </DataGridTableViewport>\n );\n}\n\nfunction DataGridTable<_TData extends object>({\n footerContent,\n renderHeader = true,\n}: {\n footerContent?: ReactNode;\n renderHeader?: boolean;\n}) {\n const { table, props } = useDataGrid();\n const mergedHeaderGroups = getDataGridTableMergedHeaderGroups(table);\n const hasRightPinnedColumns = hasDataGridTableRightPinnedColumns(table);\n\n return (\n <DataGridTableViewport>\n <DataGridTableBase>\n {renderHeader && (\n <DataGridTableHead>\n {mergedHeaderGroups.map((headerGroup) => {\n return (\n <DataGridTableHeadRow key={headerGroup.id} rowId={headerGroup.id}>\n {headerGroup.headers\n .filter((header) => header.column.getIsPinned() !== \"end\")\n .map((header) => {\n const { column } = header;\n\n return (\n <DataGridTableHeadRowCell header={header} key={header.id}>\n {header.isPlaceholder\n ? null\n : flexRender(header.column.columnDef.header, header.getContext())}\n {props.tableLayout?.columnsResizable && column.getCanResize() && (\n <DataGridTableHeadRowCellResize header={header} />\n )}\n </DataGridTableHeadRowCell>\n );\n })}\n {props.tableLayout?.columnsResizable && hasRightPinnedColumns ? (\n <DataGridTableFillHeadCell />\n ) : null}\n {headerGroup.headers\n .filter((header) => header.column.getIsPinned() === \"end\")\n .map((header) => {\n const { column } = header;\n\n return (\n <DataGridTableHeadRowCell header={header} key={header.id}>\n {header.isPlaceholder\n ? null\n : flexRender(header.column.columnDef.header, header.getContext())}\n {props.tableLayout?.columnsResizable && column.getCanResize() && (\n <DataGridTableHeadRowCellResize header={header} />\n )}\n </DataGridTableHeadRowCell>\n );\n })}\n {props.tableLayout?.columnsResizable && !hasRightPinnedColumns ? (\n <DataGridTableFillHeadCell />\n ) : null}\n </DataGridTableHeadRow>\n );\n })}\n </DataGridTableHead>\n )}\n\n {renderHeader && (props.tableLayout?.stripped || !props.tableLayout?.rowBorder) && (\n <DataGridTableRowSpacer />\n )}\n\n <DataGridTableBody>\n <MemoizedDataGridTableBodyRows table={table} />\n {props.appendRow}\n <DataGridTableAddRow />\n </DataGridTableBody>\n\n {footerContent && <DataGridTableFoot>{footerContent}</DataGridTableFoot>}\n </DataGridTableBase>\n </DataGridTableViewport>\n );\n}\n\nexport type { DataGridTablePinnedBoundary };\nexport {\n DataGridTable,\n DataGridTableAddRow,\n DataGridTableBase,\n DataGridTableBody,\n DataGridTableBodyRow,\n DataGridTableBodyRowCell,\n DataGridTableBodyRowExpandded,\n DataGridTableBodyRowSkeleton,\n DataGridTableBodyRowSkeletonCell,\n DataGridTableEmpty,\n DataGridTableFillBodyCell,\n DataGridTableFillHeadCell,\n DataGridTableFoot,\n DataGridTableFootRow,\n DataGridTableFootRowCell,\n DataGridTableHead,\n DataGridTableHeader,\n DataGridTableHeadRow,\n DataGridTableHeadRowCell,\n DataGridTableHeadRowCellResize,\n DataGridTableLoader,\n DataGridTableRenderedRow,\n DataGridTableRowExpand,\n DataGridTableRowPin,\n DataGridTableRowSelect,\n DataGridTableRowSelectAll,\n DataGridTableRowSpacer,\n DataGridTableViewport,\n getDataGridScrollAreaViewport,\n getDataGridTableMergedHeaderGroups,\n getDataGridTableResolvedRows,\n getDataGridTableRowSections,\n getDataGridTreeIndentStyle,\n getPinningStyles,\n hasDataGridTableRightPinnedColumns,\n};\n"],"mappings":";;;;;;;;;;;AA6BA,MAAM,6BAA6B,EAAE,WACnC,SAAS,UAAU,aAAa;AAElC,MAAM,2BAA2B,EAAE,WACjC,SAAS,UAAU,gBAAgB;AAMrC,MAAM,gCAAgC,EAAE,WACtC,SAAS,UAAU,uCAAuC;AAE5D,MAAM,6BAA6B,EAAE,WACnC,SAAS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