@kumix/ui 0.3.10 → 0.3.12
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 +25 -25
- package/dist/components/agents/agent-activity/activity-row.d.ts +1 -2
- package/dist/components/agents/agent-activity/activity-row.d.ts.map +1 -1
- package/dist/components/agents/agent-activity/activity-row.js +1 -1
- package/dist/components/agents/agent-activity/index.d.ts +2 -2
- package/dist/components/agents/agent-activity/index.d.ts.map +1 -1
- package/dist/components/agents/agent-activity/index.js +1 -1
- package/dist/components/agents/agent-code.d.ts +8 -9
- package/dist/components/agents/agent-code.d.ts.map +1 -1
- package/dist/components/agents/agent-code.js +1 -1
- package/dist/components/agents/agent-disclosure.d.ts +2 -3
- package/dist/components/agents/agent-disclosure.d.ts.map +1 -1
- package/dist/components/agents/ai-sidebar.d.ts +8 -9
- package/dist/components/agents/ai-sidebar.d.ts.map +1 -1
- package/dist/components/agents/ai-sidebar.js +1 -1
- package/dist/components/agents/approval-card/index.d.ts +2 -2
- package/dist/components/agents/approval-card/index.d.ts.map +1 -1
- package/dist/components/agents/approval-card/index.js +1 -1
- package/dist/components/agents/chat-app.d.ts +2 -3
- package/dist/components/agents/chat-app.d.ts.map +1 -1
- package/dist/components/agents/citations.d.ts +10 -11
- package/dist/components/agents/citations.d.ts.map +1 -1
- package/dist/components/agents/citations.js +1 -1
- package/dist/components/agents/code-block.d.ts +3 -4
- package/dist/components/agents/code-block.d.ts.map +1 -1
- package/dist/components/agents/code-block.js +1 -1
- package/dist/components/agents/file-diff.d.ts +5 -6
- package/dist/components/agents/file-diff.d.ts.map +1 -1
- package/dist/components/agents/file-diff.js +1 -1
- package/dist/components/agents/image-generation.d.ts +3 -4
- package/dist/components/agents/image-generation.d.ts.map +1 -1
- package/dist/components/agents/image-generation.js +1 -1
- package/dist/components/agents/loading-states/agent-progress.d.ts +2 -3
- package/dist/components/agents/loading-states/agent-progress.d.ts.map +1 -1
- package/dist/components/agents/loading-states/reasoning-text.d.ts +3 -4
- package/dist/components/agents/loading-states/reasoning-text.d.ts.map +1 -1
- package/dist/components/agents/loading-states/thinking-shimmer.d.ts +2 -3
- package/dist/components/agents/loading-states/thinking-shimmer.d.ts.map +1 -1
- package/dist/components/agents/message-bubble.d.ts +10 -11
- package/dist/components/agents/message-bubble.d.ts.map +1 -1
- package/dist/components/agents/message-bubble.js +1 -1
- package/dist/components/agents/message-context.d.ts +2 -3
- package/dist/components/agents/message-context.d.ts.map +1 -1
- package/dist/components/agents/message-scroller.d.ts +2 -3
- package/dist/components/agents/message-scroller.d.ts.map +1 -1
- package/dist/components/agents/message.d.ts +18 -18
- package/dist/components/agents/message.d.ts.map +1 -1
- package/dist/components/agents/prompt-input.d.ts +4 -5
- package/dist/components/agents/prompt-input.d.ts.map +1 -1
- package/dist/components/agents/prompt-input.js +1 -1
- package/dist/components/agents/streaming-response.d.ts +4 -5
- package/dist/components/agents/streaming-response.d.ts.map +1 -1
- package/dist/components/agents/streaming-response.js +1 -1
- package/dist/components/agents/todo-list.d.ts +4 -5
- package/dist/components/agents/todo-list.d.ts.map +1 -1
- package/dist/components/agents/todo-list.js +1 -1
- package/dist/components/agents/tool-approval.d.ts +6 -7
- package/dist/components/agents/tool-approval.d.ts.map +1 -1
- package/dist/components/agents/tool-approval.js +1 -1
- package/dist/components/agents/tool-result.d.ts +6 -7
- package/dist/components/agents/tool-result.d.ts.map +1 -1
- package/dist/components/agents/tool-result.js +1 -1
- package/dist/components/custom/confirm-dialog.d.ts +2 -3
- package/dist/components/custom/confirm-dialog.d.ts.map +1 -1
- package/dist/components/custom/confirm-dialog.js +1 -1
- package/dist/components/custom/toast.d.ts +6 -7
- package/dist/components/custom/toast.d.ts.map +1 -1
- package/dist/components/motion/action-swap-blur.d.ts +7 -7
- package/dist/components/motion/action-swap-blur.d.ts.map +1 -1
- package/dist/components/motion/action-swap-cascade.d.ts +7 -7
- package/dist/components/motion/action-swap-cascade.d.ts.map +1 -1
- package/dist/components/motion/action-swap-roll.d.ts +7 -7
- package/dist/components/motion/action-swap-roll.d.ts.map +1 -1
- package/dist/components/motion/action-swap.d.ts +10 -11
- package/dist/components/motion/action-swap.d.ts.map +1 -1
- package/dist/components/motion/adaptive-stepper.d.ts +31 -0
- package/dist/components/motion/adaptive-stepper.d.ts.map +1 -0
- package/dist/components/motion/adaptive-stepper.js +302 -0
- package/dist/components/motion/adaptive-stepper.js.map +1 -0
- package/dist/components/motion/animated-badge.d.ts +4 -5
- package/dist/components/motion/animated-badge.d.ts.map +1 -1
- package/dist/components/motion/animated-badge.js +1 -1
- package/dist/components/motion/animated-number.d.ts +2 -3
- package/dist/components/motion/animated-number.d.ts.map +1 -1
- package/dist/components/motion/animated-sidebar.d.ts +28 -29
- package/dist/components/motion/animated-sidebar.d.ts.map +1 -1
- package/dist/components/motion/animated-sidebar.js +1 -1
- package/dist/components/motion/animated-toast-stack.d.ts +10 -11
- package/dist/components/motion/animated-toast-stack.d.ts.map +1 -1
- package/dist/components/motion/animated-toast-stack.js +1 -1
- package/dist/components/motion/attachment-upload.d.ts +7 -8
- package/dist/components/motion/attachment-upload.d.ts.map +1 -1
- package/dist/components/motion/attachment-upload.js +1 -1
- package/dist/components/motion/availability-scheduler/copy-menu.d.ts +1 -2
- package/dist/components/motion/availability-scheduler/copy-menu.d.ts.map +1 -1
- package/dist/components/motion/availability-scheduler/copy-menu.js +1 -1
- package/dist/components/motion/availability-scheduler/day-row.d.ts +1 -2
- package/dist/components/motion/availability-scheduler/day-row.d.ts.map +1 -1
- package/dist/components/motion/availability-scheduler/day-row.js +2 -2
- package/dist/components/motion/availability-scheduler/icon-button.d.ts +1 -2
- package/dist/components/motion/availability-scheduler/icon-button.d.ts.map +1 -1
- package/dist/components/motion/availability-scheduler/index.d.ts +3 -3
- package/dist/components/motion/availability-scheduler/index.d.ts.map +1 -1
- package/dist/components/motion/availability-scheduler/index.js +1 -1
- package/dist/components/motion/availability-scheduler/time-select.d.ts +1 -2
- package/dist/components/motion/availability-scheduler/time-select.d.ts.map +1 -1
- package/dist/components/motion/bloom-menu.d.ts +2 -3
- package/dist/components/motion/bloom-menu.d.ts.map +1 -1
- package/dist/components/motion/bloom-menu.js +1 -1
- package/dist/components/motion/bottom-sheet.d.ts +2 -3
- package/dist/components/motion/bottom-sheet.d.ts.map +1 -1
- package/dist/components/motion/bounce-sidebar.d.ts +3 -4
- package/dist/components/motion/bounce-sidebar.d.ts.map +1 -1
- package/dist/components/motion/bouncy-accordion.d.ts +4 -5
- package/dist/components/motion/bouncy-accordion.d.ts.map +1 -1
- package/dist/components/motion/bouncy-accordion.js +1 -1
- package/dist/components/motion/button/base.d.ts +6 -7
- package/dist/components/motion/button/base.d.ts.map +1 -1
- package/dist/components/motion/button/magnetic.d.ts +2 -3
- package/dist/components/motion/button/magnetic.d.ts.map +1 -1
- package/dist/components/motion/button/metallic.d.ts +2 -3
- package/dist/components/motion/button/metallic.d.ts.map +1 -1
- package/dist/components/motion/button/stateful.d.ts +3 -4
- package/dist/components/motion/button/stateful.d.ts.map +1 -1
- package/dist/components/motion/button/stateful.js +1 -1
- package/dist/components/motion/center-morph-modal.d.ts +8 -9
- package/dist/components/motion/center-morph-modal.d.ts.map +1 -1
- package/dist/components/motion/center-morph-modal.js +1 -1
- package/dist/components/motion/checkbox.d.ts +2 -3
- package/dist/components/motion/checkbox.d.ts.map +1 -1
- package/dist/components/motion/chromatic-text-reveal.d.ts +2 -3
- package/dist/components/motion/chromatic-text-reveal.d.ts.map +1 -1
- package/dist/components/motion/combobox/content.d.ts +2 -3
- package/dist/components/motion/combobox/content.d.ts.map +1 -1
- package/dist/components/motion/combobox/content.js +1 -1
- package/dist/components/motion/combobox/context.d.ts +9 -10
- package/dist/components/motion/combobox/context.d.ts.map +1 -1
- package/dist/components/motion/combobox/context.js +216 -1
- package/dist/components/motion/combobox/context.js.map +1 -0
- package/dist/components/motion/combobox/list.d.ts +12 -13
- package/dist/components/motion/combobox/list.d.ts.map +1 -1
- package/dist/components/motion/combobox/list.js +2 -2
- package/dist/components/motion/combobox/trigger.d.ts +6 -7
- package/dist/components/motion/combobox/trigger.d.ts.map +1 -1
- package/dist/components/motion/combobox/trigger.js +2 -2
- package/dist/components/motion/combobox.js +1 -1
- package/dist/components/motion/command-palette.d.ts +3 -4
- package/dist/components/motion/command-palette.d.ts.map +1 -1
- package/dist/components/motion/command-palette.js +1 -1
- package/dist/components/motion/context-menu.d.ts +20 -21
- package/dist/components/motion/context-menu.d.ts.map +1 -1
- package/dist/components/motion/context-menu.js +1 -1
- package/dist/components/motion/cylinder-carousel.d.ts +2 -3
- package/dist/components/motion/cylinder-carousel.d.ts.map +1 -1
- package/dist/components/motion/dock.d.ts +5 -6
- package/dist/components/motion/dock.d.ts.map +1 -1
- package/dist/components/motion/drawer.d.ts +2 -3
- package/dist/components/motion/drawer.d.ts.map +1 -1
- package/dist/components/motion/dynamic-island.d.ts +4 -5
- package/dist/components/motion/dynamic-island.d.ts.map +1 -1
- package/dist/components/motion/expandable-action-bar.d.ts +6 -7
- package/dist/components/motion/expandable-action-bar.d.ts.map +1 -1
- package/dist/components/motion/expandable-control.d.ts +4 -5
- package/dist/components/motion/expandable-control.d.ts.map +1 -1
- package/dist/components/motion/expandable-tabs.d.ts +4 -5
- package/dist/components/motion/expandable-tabs.d.ts.map +1 -1
- package/dist/components/motion/expanding-arrow-button.d.ts +2 -3
- package/dist/components/motion/expanding-arrow-button.d.ts.map +1 -1
- package/dist/components/motion/feedback-widget.d.ts +3 -4
- package/dist/components/motion/feedback-widget.d.ts.map +1 -1
- package/dist/components/motion/feedback-widget.js +1 -1
- package/dist/components/motion/file-tree.d.ts +7 -8
- package/dist/components/motion/file-tree.d.ts.map +1 -1
- package/dist/components/motion/file-tree.js +1 -1
- package/dist/components/motion/file-upload.d.ts +7 -8
- package/dist/components/motion/file-upload.d.ts.map +1 -1
- package/dist/components/motion/file-upload.js +1 -1
- package/dist/components/motion/hold-action-button.d.ts +2 -3
- package/dist/components/motion/hold-action-button.d.ts.map +1 -1
- package/dist/components/motion/infinite-masonry.d.ts +3 -4
- package/dist/components/motion/infinite-masonry.d.ts.map +1 -1
- package/dist/components/motion/infinite-masonry.js +1 -1
- package/dist/components/motion/input.d.ts +5 -4
- package/dist/components/motion/input.d.ts.map +1 -1
- package/dist/components/motion/input.js +28 -25
- package/dist/components/motion/input.js.map +1 -1
- package/dist/components/motion/liquid.d.ts +29 -0
- package/dist/components/motion/liquid.d.ts.map +1 -0
- package/dist/components/motion/liquid.js +248 -0
- package/dist/components/motion/liquid.js.map +1 -0
- package/dist/components/motion/loader.d.ts +3 -4
- package/dist/components/motion/loader.d.ts.map +1 -1
- package/dist/components/motion/magnetic.d.ts +2 -3
- package/dist/components/motion/magnetic.d.ts.map +1 -1
- package/dist/components/motion/marquee.d.ts +2 -3
- package/dist/components/motion/marquee.d.ts.map +1 -1
- package/dist/components/motion/morphing-modal.d.ts +2 -3
- package/dist/components/motion/morphing-modal.d.ts.map +1 -1
- package/dist/components/motion/morphing-search.d.ts +3 -4
- package/dist/components/motion/morphing-search.d.ts.map +1 -1
- package/dist/components/motion/morphing-search.js +1 -1
- package/dist/components/motion/morphing-tabs.d.ts +4 -5
- package/dist/components/motion/morphing-tabs.d.ts.map +1 -1
- package/dist/components/motion/morphing-tabs.js +1 -1
- package/dist/components/motion/multi-select/content.d.ts +15 -0
- package/dist/components/motion/multi-select/content.d.ts.map +1 -0
- package/dist/components/motion/multi-select/content.js +91 -0
- package/dist/components/motion/multi-select/content.js.map +1 -0
- package/dist/components/motion/multi-select/context.d.ts +63 -0
- package/dist/components/motion/multi-select/context.d.ts.map +1 -0
- package/dist/{context-BizvUNZv.js → components/motion/multi-select/context.js} +44 -114
- package/dist/components/motion/multi-select/context.js.map +1 -0
- package/dist/components/motion/multi-select/index.d.ts +5 -0
- package/dist/components/motion/multi-select/index.js +6 -0
- package/dist/components/motion/multi-select/list.d.ts +39 -0
- package/dist/components/motion/multi-select/list.d.ts.map +1 -0
- package/dist/components/motion/multi-select/list.js +144 -0
- package/dist/components/motion/multi-select/list.js.map +1 -0
- package/dist/components/motion/multi-select/trigger.d.ts +21 -0
- package/dist/components/motion/multi-select/trigger.d.ts.map +1 -0
- package/dist/components/motion/multi-select/trigger.js +185 -0
- package/dist/components/motion/multi-select/trigger.js.map +1 -0
- package/dist/components/motion/not-found/glitch.d.ts +1 -2
- package/dist/components/motion/not-found/glitch.d.ts.map +1 -1
- package/dist/components/motion/not-found/magnetic.d.ts +1 -2
- package/dist/components/motion/not-found/magnetic.d.ts.map +1 -1
- package/dist/components/motion/not-found/shared.d.ts +4 -5
- package/dist/components/motion/not-found/shared.d.ts.map +1 -1
- package/dist/components/motion/not-found/spotlight.d.ts +1 -2
- package/dist/components/motion/not-found/spotlight.d.ts.map +1 -1
- package/dist/components/motion/not-found/stacked.d.ts +1 -2
- package/dist/components/motion/not-found/stacked.d.ts.map +1 -1
- package/dist/components/motion/not-found/terminal.d.ts +1 -2
- package/dist/components/motion/not-found/terminal.d.ts.map +1 -1
- package/dist/components/motion/notification-stack.d.ts +4 -5
- package/dist/components/motion/notification-stack.d.ts.map +1 -1
- package/dist/components/motion/notification-stack.js +1 -1
- package/dist/components/motion/number-ticker.d.ts +2 -3
- package/dist/components/motion/number-ticker.d.ts.map +1 -1
- package/dist/components/motion/otp-input.d.ts +3 -4
- package/dist/components/motion/otp-input.d.ts.map +1 -1
- package/dist/components/motion/overflow-actions.d.ts +5 -6
- package/dist/components/motion/overflow-actions.d.ts.map +1 -1
- package/dist/components/motion/overflow-actions.js +1 -1
- package/dist/components/motion/parallax.d.ts +2 -3
- package/dist/components/motion/parallax.d.ts.map +1 -1
- package/dist/components/motion/popover-morph.d.ts +6 -7
- package/dist/components/motion/popover-morph.d.ts.map +1 -1
- package/dist/components/motion/popover.d.ts +6 -7
- package/dist/components/motion/popover.d.ts.map +1 -1
- package/dist/components/motion/preview-rail.d.ts +3 -4
- package/dist/components/motion/preview-rail.d.ts.map +1 -1
- package/dist/components/motion/project-folder.d.ts +3 -4
- package/dist/components/motion/project-folder.d.ts.map +1 -1
- package/dist/components/motion/project-folder.js +1 -1
- package/dist/components/motion/pull-to-refresh.d.ts +3 -4
- package/dist/components/motion/pull-to-refresh.d.ts.map +1 -1
- package/dist/components/motion/radio.d.ts +4 -5
- package/dist/components/motion/radio.d.ts.map +1 -1
- package/dist/components/motion/range-slider-bubble.d.ts +2 -3
- package/dist/components/motion/range-slider-bubble.d.ts.map +1 -1
- package/dist/components/motion/range-slider-fluid.d.ts +2 -3
- package/dist/components/motion/range-slider-fluid.d.ts.map +1 -1
- package/dist/components/motion/range-slider-ruler.d.ts +2 -3
- package/dist/components/motion/range-slider-ruler.d.ts.map +1 -1
- package/dist/components/motion/range-slider-wave.d.ts +2 -3
- package/dist/components/motion/range-slider-wave.d.ts.map +1 -1
- package/dist/components/motion/range-slider.d.ts +2 -3
- package/dist/components/motion/range-slider.d.ts.map +1 -1
- package/dist/components/motion/scroll-progress.d.ts +4 -5
- package/dist/components/motion/scroll-progress.d.ts.map +1 -1
- package/dist/components/motion/scroll-reveal.d.ts +2 -3
- package/dist/components/motion/scroll-reveal.d.ts.map +1 -1
- package/dist/components/motion/scroll-to.d.ts +2 -3
- package/dist/components/motion/scroll-to.d.ts.map +1 -1
- package/dist/components/motion/select-morph.d.ts +10 -11
- package/dist/components/motion/select-morph.d.ts.map +1 -1
- package/dist/components/motion/select-morph.js +1 -1
- package/dist/components/motion/select.d.ts +10 -11
- package/dist/components/motion/select.d.ts.map +1 -1
- package/dist/components/motion/select.js +1 -1
- package/dist/components/motion/shader-background.d.ts +4 -5
- package/dist/components/motion/shader-background.d.ts.map +1 -1
- package/dist/components/motion/shared-layout-bg.d.ts +2 -3
- package/dist/components/motion/shared-layout-bg.d.ts.map +1 -1
- package/dist/components/motion/signup-form.d.ts +7 -8
- package/dist/components/motion/signup-form.d.ts.map +1 -1
- package/dist/components/motion/signup-form.js +7 -3
- package/dist/components/motion/signup-form.js.map +1 -1
- package/dist/components/motion/slide-action-button.d.ts +2 -3
- package/dist/components/motion/slide-action-button.d.ts.map +1 -1
- package/dist/components/motion/smooth-scroll.d.ts +6 -7
- package/dist/components/motion/smooth-scroll.d.ts.map +1 -1
- package/dist/components/motion/swipeable-list.d.ts +8 -9
- package/dist/components/motion/swipeable-list.d.ts.map +1 -1
- package/dist/components/motion/switch.d.ts +2 -3
- package/dist/components/motion/switch.d.ts.map +1 -1
- package/dist/components/motion/table/editable-cell.d.ts +1 -2
- package/dist/components/motion/table/editable-cell.d.ts.map +1 -1
- package/dist/components/motion/table/index.d.ts +2 -2
- package/dist/components/motion/table/index.d.ts.map +1 -1
- package/dist/components/motion/table/index.js.map +1 -1
- package/dist/components/motion/table/row-handle.d.ts +1 -2
- package/dist/components/motion/table/row-handle.d.ts.map +1 -1
- package/dist/components/motion/table/row-handle.js +1 -1
- package/dist/components/motion/table/skeleton-rows.d.ts +1 -2
- package/dist/components/motion/table/skeleton-rows.d.ts.map +1 -1
- package/dist/components/motion/table/table-header.d.ts +2 -3
- package/dist/components/motion/table/table-header.d.ts.map +1 -1
- package/dist/components/motion/table/table-header.js +1 -1
- package/dist/components/motion/table/table-menu.d.ts +2 -3
- package/dist/components/motion/table/table-menu.d.ts.map +1 -1
- package/dist/components/motion/tabs.d.ts +4 -5
- package/dist/components/motion/tabs.d.ts.map +1 -1
- package/dist/components/motion/text-cascade.d.ts +2 -3
- package/dist/components/motion/text-cascade.d.ts.map +1 -1
- package/dist/components/motion/text-reveal.d.ts +2 -3
- package/dist/components/motion/text-reveal.d.ts.map +1 -1
- package/dist/components/motion/text-scramble.d.ts +2 -3
- package/dist/components/motion/text-scramble.d.ts.map +1 -1
- package/dist/components/motion/text-shimmer.d.ts +2 -3
- package/dist/components/motion/text-shimmer.d.ts.map +1 -1
- package/dist/components/motion/theme-toggle.d.ts +5 -6
- package/dist/components/motion/theme-toggle.d.ts.map +1 -1
- package/dist/components/motion/theme-toggle.js +1 -1
- package/dist/components/motion/tilt-card.d.ts +2 -3
- package/dist/components/motion/tilt-card.d.ts.map +1 -1
- package/dist/components/motion/tooltip.d.ts +2 -3
- package/dist/components/motion/tooltip.d.ts.map +1 -1
- package/dist/components/motion/wheel-picker.d.ts +3 -4
- package/dist/components/motion/wheel-picker.d.ts.map +1 -1
- package/dist/components/reui/alert.d.ts +1 -1
- package/dist/components/reui/alert.js +1 -1
- package/dist/components/reui/autocomplete.d.ts +3 -3
- package/dist/components/reui/autocomplete.d.ts.map +1 -1
- package/dist/components/reui/autocomplete.js +1 -1
- package/dist/components/reui/badge.d.ts +2 -2
- package/dist/components/reui/cascader/cascader-async.d.ts +8 -9
- package/dist/components/reui/cascader/cascader-async.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-async.js.map +1 -1
- package/dist/components/reui/cascader/cascader-columns.d.ts +3 -3
- package/dist/components/reui/cascader/cascader-columns.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-columns.js +1 -1
- package/dist/components/reui/cascader/cascader-context.d.ts +13 -13
- package/dist/components/reui/cascader/cascader-context.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-footer.d.ts +8 -8
- package/dist/components/reui/cascader/cascader-footer.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-footer.js +1 -1
- package/dist/components/reui/cascader/cascader-i18n.d.ts +3 -4
- package/dist/components/reui/cascader/cascader-i18n.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-item.d.ts +9 -9
- package/dist/components/reui/cascader/cascader-item.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-item.js +1 -1
- package/dist/components/reui/cascader/cascader-lib.d.ts +38 -39
- package/dist/components/reui/cascader/cascader-lib.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-nav.d.ts +6 -6
- package/dist/components/reui/cascader/cascader-nav.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-nav.js +1 -1
- package/dist/components/reui/cascader/cascader-virtual.d.ts +6 -6
- package/dist/components/reui/cascader/cascader-virtual.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-virtual.js.map +1 -1
- package/dist/components/reui/cascader/cascader.d.ts +19 -19
- package/dist/components/reui/cascader/cascader.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader.js +1 -1
- package/dist/components/reui/cascader/cascader.js.map +1 -1
- package/dist/components/reui/code-block/code-block-highlight.d.ts +32 -33
- package/dist/components/reui/code-block/code-block-highlight.d.ts.map +1 -1
- package/dist/components/reui/code-block/code-block.d.ts +7 -7
- package/dist/components/reui/code-block/code-block.d.ts.map +1 -1
- package/dist/components/reui/code-block/code-block.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-cell-selection.d.ts +117 -0
- package/dist/components/reui/data-grid/data-grid-cell-selection.d.ts.map +1 -0
- package/dist/components/reui/data-grid/data-grid-cell-selection.js +1554 -0
- package/dist/components/reui/data-grid/data-grid-cell-selection.js.map +1 -0
- package/dist/components/reui/data-grid/data-grid-column-filter.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-filter.js +7 -5
- package/dist/components/reui/data-grid/data-grid-column-filter.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-header.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-header.js +19 -13
- package/dist/components/reui/data-grid/data-grid-column-header.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-visibility.js +3 -2
- package/dist/components/reui/data-grid/data-grid-column-visibility.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-i18n.d.ts +2 -0
- package/dist/components/reui/data-grid/data-grid-i18n.js +53 -0
- package/dist/components/reui/data-grid/data-grid-i18n.js.map +1 -0
- package/dist/components/reui/data-grid/data-grid-pagination.js +15 -9
- package/dist/components/reui/data-grid/data-grid-pagination.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-scroll-area.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-scroll-area.js +3 -3
- 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.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js +7 -5
- 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 +3 -3
- package/dist/components/reui/data-grid/data-grid-table-dnd.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-virtual.d.ts +17 -1
- package/dist/components/reui/data-grid/data-grid-table-virtual.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-virtual.js +146 -50
- package/dist/components/reui/data-grid/data-grid-table-virtual.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table.d.ts +23 -4
- package/dist/components/reui/data-grid/data-grid-table.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table.js +215 -68
- package/dist/components/reui/data-grid/data-grid-table.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid.d.ts +288 -18
- package/dist/components/reui/data-grid/data-grid.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid.js +150 -15
- package/dist/components/reui/data-grid/data-grid.js.map +1 -1
- package/dist/components/reui/date-selector.d.ts +11 -12
- package/dist/components/reui/date-selector.d.ts.map +1 -1
- package/dist/components/reui/date-selector.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar-agenda-view.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar-event.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar-month-view.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar-nav.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar.js.map +1 -1
- package/dist/components/reui/filters/filters-advanced.d.ts +6 -7
- package/dist/components/reui/filters/filters-advanced.d.ts.map +1 -1
- package/dist/components/reui/filters/filters-advanced.js +1 -1
- package/dist/components/reui/filters/filters-advanced.js.map +1 -1
- package/dist/components/reui/filters/filters-builder.d.ts +5 -5
- package/dist/components/reui/filters/filters-builder.d.ts.map +1 -1
- package/dist/components/reui/filters/filters-builder.js +2 -2
- package/dist/components/reui/filters/filters-chip.d.ts +10 -11
- package/dist/components/reui/filters/filters-chip.d.ts.map +1 -1
- package/dist/components/reui/filters/filters-chip.js +1 -1
- package/dist/components/reui/filters/filters-chip.js.map +1 -1
- package/dist/components/reui/filters/filters-context.d.ts +30 -30
- package/dist/components/reui/filters/filters-context.d.ts.map +1 -1
- package/dist/components/reui/filters/filters-date.d.ts +13 -14
- package/dist/components/reui/filters/filters-date.d.ts.map +1 -1
- package/dist/components/reui/filters/filters-dnd.d.ts +15 -16
- package/dist/components/reui/filters/filters-dnd.d.ts.map +1 -1
- package/dist/components/reui/filters/filters-editors.d.ts +14 -14
- package/dist/components/reui/filters/filters-editors.d.ts.map +1 -1
- package/dist/components/reui/filters/filters-editors.js +2 -2
- package/dist/components/reui/filters/filters-i18n.d.ts +4 -5
- package/dist/components/reui/filters/filters-i18n.d.ts.map +1 -1
- package/dist/components/reui/filters/filters-lib.d.ts +34 -35
- package/dist/components/reui/filters/filters-lib.d.ts.map +1 -1
- package/dist/components/reui/filters/filters-operators.d.ts +13 -14
- package/dist/components/reui/filters/filters-operators.d.ts.map +1 -1
- package/dist/components/reui/filters/filters-query.d.ts +29 -30
- package/dist/components/reui/filters/filters-query.d.ts.map +1 -1
- package/dist/components/reui/filters/filters-types.d.ts +31 -32
- package/dist/components/reui/filters/filters-types.d.ts.map +1 -1
- package/dist/components/reui/filters/filters.d.ts +5 -5
- package/dist/components/reui/filters/filters.d.ts.map +1 -1
- package/dist/components/reui/filters/filters.js +1 -1
- package/dist/components/reui/filters/filters.js.map +1 -1
- package/dist/components/reui/frame.d.ts +1 -1
- package/dist/components/reui/frame.js +1 -1
- package/dist/components/reui/gantt/gantt-bar.js +1 -1
- package/dist/components/reui/gantt/gantt-nav.js +1 -1
- package/dist/components/reui/gantt/gantt-view.js +1 -1
- package/dist/components/reui/gantt/gantt.d.ts.map +1 -1
- package/dist/components/reui/gantt/gantt.js.map +1 -1
- package/dist/components/reui/icon-tile.d.ts +2 -2
- package/dist/components/reui/kanban.d.ts +11 -11
- package/dist/components/reui/kanban.d.ts.map +1 -1
- package/dist/components/reui/number-field.d.ts +3 -3
- package/dist/components/reui/number-field.js +1 -1
- package/dist/components/reui/phone-input.js +1 -1
- package/dist/components/reui/rating.d.ts +1 -1
- package/dist/components/reui/rating.js +1 -1
- package/dist/components/reui/scrollspy.d.ts +1 -2
- package/dist/components/reui/scrollspy.d.ts.map +1 -1
- package/dist/components/reui/sortable.d.ts +6 -6
- package/dist/components/reui/sortable.d.ts.map +1 -1
- package/dist/components/reui/tree.js +1 -1
- package/dist/components/ui/accordion.js +1 -1
- package/dist/components/ui/alert-dialog.js +1 -1
- package/dist/components/ui/alert.js +1 -1
- package/dist/components/ui/attachment.d.ts +1 -1
- package/dist/components/ui/attachment.js +1 -1
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/breadcrumb.js +1 -1
- package/dist/components/ui/bubble.d.ts +1 -1
- package/dist/components/ui/bubble.js +1 -1
- package/dist/components/ui/button-group.js +1 -1
- package/dist/components/ui/button.d.ts +2 -2
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/calendar.js +1 -1
- package/dist/components/ui/carousel.js +1 -1
- package/dist/components/ui/chart.d.ts +2 -2
- package/dist/components/ui/chart.d.ts.map +1 -1
- package/dist/components/ui/checkbox.js +1 -1
- package/dist/components/ui/combobox.js +1 -1
- package/dist/components/ui/command.js +1 -1
- package/dist/components/ui/context-menu.js +1 -1
- package/dist/components/ui/dialog.js +1 -1
- package/dist/components/ui/dropdown-menu.js +1 -1
- package/dist/components/ui/empty.js +1 -1
- package/dist/components/ui/field.js +1 -1
- package/dist/components/ui/input-group.d.ts +1 -1
- package/dist/components/ui/input-group.js +1 -1
- package/dist/components/ui/input-otp.js +1 -1
- package/dist/components/ui/item.d.ts +2 -2
- package/dist/components/ui/item.js +1 -1
- package/dist/components/ui/marker.js +1 -1
- package/dist/components/ui/menubar.js +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/native-select.js +1 -1
- package/dist/components/ui/navigation-menu.js +1 -1
- package/dist/components/ui/pagination.js +1 -1
- package/dist/components/ui/questionnaire.js +1 -1
- package/dist/components/ui/select.js +1 -1
- package/dist/components/ui/sheet.js +1 -1
- package/dist/components/ui/sidebar.d.ts +2 -2
- package/dist/components/ui/sidebar.js +1 -1
- package/dist/components/ui/spinner.js +1 -1
- package/dist/components/ui/tabs.js +1 -1
- package/dist/components/ui/toast.js +1 -1
- package/dist/components/ui/toggle.d.ts +2 -2
- package/dist/components/ui/toggle.js +1 -1
- package/dist/{copy-menu-C5GaT4Z-.js → copy-menu-TIKvPaAZ.js} +2 -2
- package/dist/{copy-menu-C5GaT4Z-.js.map → copy-menu-TIKvPaAZ.js.map} +1 -1
- package/dist/data-grid-i18n-TQR2PZlU.d.ts +54 -0
- package/dist/data-grid-i18n-TQR2PZlU.d.ts.map +1 -0
- package/dist/hooks/use-body-classes.d.ts +1 -2
- package/dist/hooks/use-body-classes.d.ts.map +1 -1
- package/dist/hooks/use-copy-to-clipboard.d.ts +1 -2
- package/dist/hooks/use-copy-to-clipboard.d.ts.map +1 -1
- package/dist/hooks/use-dismiss.d.ts +3 -4
- package/dist/hooks/use-dismiss.d.ts.map +1 -1
- package/dist/hooks/use-favicon.d.ts +1 -2
- package/dist/hooks/use-favicon.d.ts.map +1 -1
- package/dist/hooks/use-file-upload.d.ts +7 -8
- package/dist/hooks/use-file-upload.d.ts.map +1 -1
- package/dist/hooks/use-hover-capable.d.ts +1 -2
- package/dist/hooks/use-hover-capable.d.ts.map +1 -1
- package/dist/hooks/use-hover-gesture.d.ts +2 -3
- package/dist/hooks/use-hover-gesture.d.ts.map +1 -1
- package/dist/hooks/use-hydrated.d.ts +1 -2
- package/dist/hooks/use-hydrated.d.ts.map +1 -1
- package/dist/hooks/use-intersection-observer.d.ts +1 -2
- package/dist/hooks/use-intersection-observer.d.ts.map +1 -1
- package/dist/hooks/use-is-mac.d.ts +1 -2
- package/dist/hooks/use-is-mac.d.ts.map +1 -1
- package/dist/hooks/use-media-query.d.ts +1 -2
- package/dist/hooks/use-media-query.d.ts.map +1 -1
- package/dist/hooks/use-meta-color.d.ts +1 -2
- package/dist/hooks/use-meta-color.d.ts.map +1 -1
- package/dist/hooks/use-mobile.d.ts +1 -2
- package/dist/hooks/use-mobile.d.ts.map +1 -1
- package/dist/hooks/use-mutation-observer.d.ts +1 -2
- package/dist/hooks/use-mutation-observer.d.ts.map +1 -1
- package/dist/hooks/use-on-open.d.ts +1 -2
- package/dist/hooks/use-on-open.d.ts.map +1 -1
- package/dist/hooks/use-row-cursor.d.ts +1 -2
- package/dist/hooks/use-row-cursor.d.ts.map +1 -1
- package/dist/hooks/use-scroll-position.d.ts +1 -2
- package/dist/hooks/use-scroll-position.d.ts.map +1 -1
- package/dist/hooks/use-slider-input.d.ts +1 -2
- package/dist/hooks/use-slider-input.d.ts.map +1 -1
- package/dist/hooks/use-slider.d.ts +3 -4
- package/dist/hooks/use-slider.d.ts.map +1 -1
- package/dist/hooks/use-tap-gesture.d.ts +3 -4
- package/dist/hooks/use-tap-gesture.d.ts.map +1 -1
- package/dist/hooks/use-touch-capable.d.ts +1 -2
- package/dist/hooks/use-touch-capable.d.ts.map +1 -1
- package/dist/hooks/use-viewport.d.ts +1 -2
- package/dist/hooks/use-viewport.d.ts.map +1 -1
- package/dist/lib/ease.d.ts +10 -11
- package/dist/lib/ease.d.ts.map +1 -1
- package/dist/lib/favicon.d.ts +1 -2
- package/dist/lib/favicon.d.ts.map +1 -1
- package/dist/lib/text-shimmer.d.ts +3 -4
- package/dist/lib/text-shimmer.d.ts.map +1 -1
- package/dist/lib/tick-sound.d.ts +1 -2
- package/dist/lib/tick-sound.d.ts.map +1 -1
- package/dist/lib/touch.d.ts +6 -7
- package/dist/lib/touch.d.ts.map +1 -1
- package/dist/use-active-option-CmX6Z-4S.js +86 -0
- package/dist/use-active-option-CmX6Z-4S.js.map +1 -0
- package/package.json +6 -6
- package/dist/context-BizvUNZv.js.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { r as DataGridI18nOverrides, t as DataGridI18nConfig } from "../../../data-grid-i18n-TQR2PZlU.js";
|
|
1
2
|
import { ReactNode } from "react";
|
|
2
|
-
import { Column, ColumnFiltersState, ReactTable, RowData, SortingState, Table, TableFeatures } from "@tanstack/react-table";
|
|
3
|
+
import { Cell, Column, ColumnFiltersState, ReactTable, RowData, SortingState, Table, TableFeatures } from "@tanstack/react-table";
|
|
3
4
|
//#region src/components/reui/data-grid/data-grid.d.ts
|
|
4
5
|
/**
|
|
5
6
|
* Per-column extras the grid reads off `columnDef.meta`.
|
|
@@ -9,13 +10,54 @@ import { Column, ColumnFiltersState, ReactTable, RowData, SortingState, Table, T
|
|
|
9
10
|
* installing the data grid no longer widens `ColumnMeta` for every other
|
|
10
11
|
* table in the consuming app.
|
|
11
12
|
*/
|
|
12
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Per-column write contract for the spreadsheet operations (paste, fill,
|
|
15
|
+
* clear, cut). Presence marks the column writable; every write still flows
|
|
16
|
+
* through `onCellsChange`, so the consumer's state stays the only data owner.
|
|
17
|
+
*/
|
|
18
|
+
export interface DataGridColumnCellEdit<TData> {
|
|
19
|
+
/**
|
|
20
|
+
* Set false for a column that formats clipboard output but is never
|
|
21
|
+
* written; a function decides per row, so locked rows (archived, another
|
|
22
|
+
* user's, a totals row) reject like any read-only cell. Defaults to true.
|
|
23
|
+
*/
|
|
24
|
+
editable?: boolean | ((row: TData) => boolean);
|
|
25
|
+
/**
|
|
26
|
+
* Clipboard or fill string to typed value. Return undefined to reject the
|
|
27
|
+
* cell into `rejected`. Without it the raw string passes through unchanged -
|
|
28
|
+
* a deliberate non-coercion, so a number column receives strings only when
|
|
29
|
+
* the consumer chose not to parse.
|
|
30
|
+
*/
|
|
31
|
+
parse?: (raw: string, row: TData) => unknown;
|
|
32
|
+
/** Typed value to clipboard string. Fallback: String(value ?? ""). */
|
|
33
|
+
format?: (value: unknown, row: TData) => string;
|
|
34
|
+
/** Value dispatched by Delete/Backspace and cut. Defaults to null. */
|
|
35
|
+
clearValue?: unknown;
|
|
36
|
+
/**
|
|
37
|
+
* Opt into the grid's built-in free-text editor: an overlay input (or
|
|
38
|
+
* auto-growing textarea) flush over the focused cell, opened by Enter, F2,
|
|
39
|
+
* typing, or double-click, committing through `onCellsChange` as source
|
|
40
|
+
* `"edit"` with `parse` applied. Columns without it stay consumer-edited
|
|
41
|
+
* via `onCellEditRequest` or their own cell renderers.
|
|
42
|
+
*/
|
|
43
|
+
control?: "text" | "textarea";
|
|
44
|
+
}
|
|
45
|
+
export interface DataGridColumnMeta<TData> {
|
|
13
46
|
headerTitle?: string;
|
|
14
47
|
headerClassName?: string;
|
|
15
48
|
cellClassName?: string;
|
|
16
49
|
skeleton?: ReactNode;
|
|
17
50
|
expandedContent?: (row: TData) => ReactNode;
|
|
18
51
|
autoSize?: boolean;
|
|
52
|
+
cellEdit?: DataGridColumnCellEdit<TData>;
|
|
53
|
+
/**
|
|
54
|
+
* Under `columnsResizable`, this column absorbs the free space the filler
|
|
55
|
+
* strip would otherwise hold, so the grid always reads full-width and the
|
|
56
|
+
* built-in editor covers the whole cell. One column per grid; while free
|
|
57
|
+
* space remains, manual resizing of this column is visually a no-op (the
|
|
58
|
+
* absorbed space compensates), the flex-column trade-off.
|
|
59
|
+
*/
|
|
60
|
+
fillWidth?: boolean;
|
|
19
61
|
}
|
|
20
62
|
/**
|
|
21
63
|
* The batteries-included feature bundle every ReUI data-grid example builds
|
|
@@ -44,7 +86,7 @@ interface DataGridColumnMeta<TData> {
|
|
|
44
86
|
* Or drop it entirely and hand `<DataGrid>` a leaner table - the components
|
|
45
87
|
* accept any bundle, so you keep full ownership of the TanStack core.
|
|
46
88
|
*/
|
|
47
|
-
declare const dataGridFeatures: {
|
|
89
|
+
export declare const dataGridFeatures: {
|
|
48
90
|
columnVisibilityFeature: import("@tanstack/react-table").TableFeature;
|
|
49
91
|
columnOrderingFeature: import("@tanstack/react-table").TableFeature;
|
|
50
92
|
columnPinningFeature: import("@tanstack/react-table").TableFeature;
|
|
@@ -58,6 +100,7 @@ declare const dataGridFeatures: {
|
|
|
58
100
|
rowSelectionFeature: import("@tanstack/react-table").TableFeature;
|
|
59
101
|
rowExpandingFeature: import("@tanstack/react-table").TableFeature;
|
|
60
102
|
rowPinningFeature: import("@tanstack/react-table").TableFeature;
|
|
103
|
+
cellSelectionFeature: import("@tanstack/react-table").TableFeature;
|
|
61
104
|
sortedRowModel: (table: Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
62
105
|
filteredRowModel: (table: Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
63
106
|
paginatedRowModel: (table: Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
@@ -75,7 +118,7 @@ declare const dataGridFeatures: {
|
|
|
75
118
|
columnMeta: DataGridColumnMeta<any>;
|
|
76
119
|
};
|
|
77
120
|
/** The feature set `dataGridFeatures` registers. */
|
|
78
|
-
type DataGridFeatures = typeof dataGridFeatures;
|
|
121
|
+
export type DataGridFeatures = typeof dataGridFeatures;
|
|
79
122
|
/**
|
|
80
123
|
* The grid's internal view of the table.
|
|
81
124
|
*
|
|
@@ -86,17 +129,43 @@ type DataGridFeatures = typeof dataGridFeatures;
|
|
|
86
129
|
* table is widened to this concrete type exactly once, on the way into
|
|
87
130
|
* context, and every internal component reads it from there.
|
|
88
131
|
*/
|
|
89
|
-
type DataGridTableInstance<TData extends object> = ReactTable<DataGridFeatures, TData>;
|
|
132
|
+
export type DataGridTableInstance<TData extends object> = ReactTable<DataGridFeatures, TData>;
|
|
90
133
|
/** Label for headers / column visibility: `meta.headerTitle`, string `columnDef.header`, or `column.id`. */
|
|
91
|
-
declare function getColumnHeaderLabel<TData extends RowData, TValue>(column: Column<DataGridFeatures, TData, TValue>): string;
|
|
92
|
-
|
|
134
|
+
export declare function getColumnHeaderLabel<TData extends RowData, TValue>(column: Column<DataGridFeatures, TData, TValue>): string;
|
|
135
|
+
/**
|
|
136
|
+
* The td contract for spreadsheet selection. Call inside a
|
|
137
|
+
* `Subscribe source={table.atoms.cellSelection}` render only: the reads are
|
|
138
|
+
* builder calls whose state dependency React Compiler cannot see, exactly the
|
|
139
|
+
* trap the row-selection checkbox documents.
|
|
140
|
+
*/
|
|
141
|
+
export declare function getDataGridCellSelectionCellAttrs<TData extends object>(cell: Cell<DataGridFeatures, TData, unknown>): {
|
|
142
|
+
"aria-selected": boolean;
|
|
143
|
+
"data-col-id": string;
|
|
144
|
+
"data-cell-selected": true | undefined;
|
|
145
|
+
"data-cell-focused": true | undefined;
|
|
146
|
+
"data-cell-edge-top": true | undefined;
|
|
147
|
+
"data-cell-edge-right": true | undefined;
|
|
148
|
+
"data-cell-edge-bottom": true | undefined;
|
|
149
|
+
"data-cell-edge-left": true | undefined;
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Selection chrome for a body td, activated by the data attributes above plus
|
|
153
|
+
* the imperatively toggled `data-cell-fill-target` (fill-drag preview, written
|
|
154
|
+
* outside React like the resize indicator). A ::before overlay, not outline
|
|
155
|
+
* or box-shadow: an outline ring hugs the cell box and cannot line up with
|
|
156
|
+
* the gridlines the perimeter paints on, and the pinned-column dividers
|
|
157
|
+
* already own the cell's shadow slot (tailwind-merge would collapse a second
|
|
158
|
+
* shadow-[...] into it).
|
|
159
|
+
*/
|
|
160
|
+
export declare const dataGridCellSelectionCellClasses: string;
|
|
161
|
+
export type DataGridApiFetchParams = {
|
|
93
162
|
pageIndex: number;
|
|
94
163
|
pageSize: number;
|
|
95
164
|
sorting?: SortingState;
|
|
96
165
|
filters?: ColumnFiltersState;
|
|
97
166
|
searchQuery?: string;
|
|
98
167
|
};
|
|
99
|
-
type DataGridApiResponse<T> = {
|
|
168
|
+
export type DataGridApiResponse<T> = {
|
|
100
169
|
data: T[];
|
|
101
170
|
empty: boolean;
|
|
102
171
|
pagination: {
|
|
@@ -109,39 +178,196 @@ type DataGridApiResponse<T> = {
|
|
|
109
178
|
* itself. Kept feature-agnostic: layout and messaging never depend on which
|
|
110
179
|
* TanStack features the consumer registered.
|
|
111
180
|
*/
|
|
112
|
-
type DataGridLayoutProps<TData extends object> = Omit<DataGridProps<TableFeatures, TData>, "table" | "children">;
|
|
113
|
-
interface DataGridContextProps<TData extends object> {
|
|
181
|
+
export type DataGridLayoutProps<TData extends object> = Omit<DataGridProps<TableFeatures, TData>, "table" | "children">;
|
|
182
|
+
export interface DataGridContextProps<TData extends object> {
|
|
114
183
|
props: DataGridLayoutProps<TData>;
|
|
115
184
|
table: DataGridTableInstance<TData>;
|
|
116
185
|
recordCount: number;
|
|
117
186
|
isLoading: boolean;
|
|
187
|
+
/** Stable per-grid prefix for the DOM ids ARIA relations point at. */
|
|
188
|
+
gridId: string;
|
|
189
|
+
/** The merged label set; components read `i18n.labels.<key>`. */
|
|
190
|
+
i18n: DataGridI18nConfig;
|
|
118
191
|
/**
|
|
119
192
|
* Internal coordinator for `meta.autoSize` columns. Lives at the core level
|
|
120
193
|
* so every table variant and viewport instance shares one application state.
|
|
121
194
|
*/
|
|
122
195
|
autoSize?: DataGridAutoSizeController;
|
|
123
196
|
}
|
|
124
|
-
|
|
197
|
+
/**
|
|
198
|
+
* Row and column ids are consumer strings; DOM ids cannot carry spaces or
|
|
199
|
+
* quotes. One shared sanitizer so `aria-activedescendant` writers and the id
|
|
200
|
+
* renderers always agree on the same encoding.
|
|
201
|
+
*/
|
|
202
|
+
export declare function toDataGridDomId(value: string): string;
|
|
203
|
+
export type DataGridAutoSizeController = {
|
|
125
204
|
/**
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
205
|
+
* Feeds the controller one viewport measurement: the SIGNED free space
|
|
206
|
+
* between the scroll container and the table, negative while the table
|
|
207
|
+
* overflows. The first sight of a `meta.autoSize` column absorbs the
|
|
208
|
+
* free space into its width; after that, every measurement REFLOWS the
|
|
209
|
+
* same growth - a wider window widens the column, a narrower one gives
|
|
210
|
+
* the space back down to the column's `minSize` (or its starting width
|
|
211
|
+
* when none is set) - so the grid tracks its container live. Commits
|
|
212
|
+
* are coalesced for performance: sub-pixel deltas are dropped, a
|
|
213
|
+
* streaming resize gets one leading commit plus one trailing commit at
|
|
214
|
+
* settle, and a width the user dragged is never touched. Safe to call
|
|
215
|
+
* from every viewport measurement; returns true when a sizing update
|
|
216
|
+
* was dispatched.
|
|
129
217
|
*/
|
|
130
|
-
apply: (
|
|
218
|
+
apply: (freeSpace: number) => boolean;
|
|
131
219
|
};
|
|
132
|
-
type DataGridRequestParams = {
|
|
220
|
+
export type DataGridRequestParams = {
|
|
133
221
|
pageIndex: number;
|
|
134
222
|
pageSize: number;
|
|
135
223
|
sorting?: SortingState;
|
|
136
224
|
columnFilters?: ColumnFiltersState;
|
|
137
225
|
};
|
|
138
|
-
|
|
226
|
+
/** Which spreadsheet operation produced a cell change batch. */
|
|
227
|
+
export type DataGridCellsChangeSource = "paste" | "cut" | "clear" | "fill" | "edit";
|
|
228
|
+
export interface DataGridCellChange<TData> {
|
|
229
|
+
rowId: string;
|
|
230
|
+
columnId: string;
|
|
231
|
+
/** The consumer's row object, so immutable write-back needs no second lookup. */
|
|
232
|
+
row: TData;
|
|
233
|
+
/** Accessor value at dispatch time; enables consumer-side undo stacks. */
|
|
234
|
+
previousValue: unknown;
|
|
235
|
+
/** Typed value produced by `meta.cellEdit.parse`, or `clearValue` for clear/cut. */
|
|
236
|
+
value: unknown;
|
|
237
|
+
}
|
|
238
|
+
/** What onCellsCopy receives after the grid writes the clipboard. */
|
|
239
|
+
export interface DataGridCopyDetails {
|
|
240
|
+
/** The TSV text that reached the clipboard. */
|
|
241
|
+
text: string;
|
|
242
|
+
/** The same content as a row-major grid of formatted fields. */
|
|
243
|
+
grid: string[][];
|
|
244
|
+
/** True when the write came from a cut, which clears the region next. */
|
|
245
|
+
cut: boolean;
|
|
246
|
+
}
|
|
247
|
+
/** One resolved positive region, in pre-paginated display indexes. */
|
|
248
|
+
export interface DataGridCellSelectionBound {
|
|
249
|
+
minRowIndex: number;
|
|
250
|
+
maxRowIndex: number;
|
|
251
|
+
minColumnIndex: number;
|
|
252
|
+
maxColumnIndex: number;
|
|
253
|
+
}
|
|
254
|
+
/** What onCellSelectionChange receives, resolved from the live selection. */
|
|
255
|
+
export interface DataGridCellSelectionSnapshot {
|
|
256
|
+
/** The virtually focused cell, the active range's anchor. Null when clear. */
|
|
257
|
+
focused: {
|
|
258
|
+
rowId: string;
|
|
259
|
+
columnId: string;
|
|
260
|
+
} | null;
|
|
261
|
+
/** Every positive region, geometric order. */
|
|
262
|
+
bounds: DataGridCellSelectionBound[];
|
|
263
|
+
/** The most recent region, the one copy and paste act on. */
|
|
264
|
+
activeBound: DataGridCellSelectionBound | null;
|
|
265
|
+
/**
|
|
266
|
+
* Cells of the selection the view can show - the count that matches the
|
|
267
|
+
* painted range and what a batch will touch.
|
|
268
|
+
*/
|
|
269
|
+
visibleCellCount: number;
|
|
270
|
+
}
|
|
271
|
+
export interface DataGridCellRejection {
|
|
272
|
+
rowId: string;
|
|
273
|
+
columnId: string;
|
|
274
|
+
raw: string;
|
|
275
|
+
reason: "readonly" | "invalid";
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Lifecycle of a row for the optional CRUD indications: "new" and "dirty"
|
|
279
|
+
* tint the row, "deleted" mutes and strikes it. Purely presentational - the
|
|
280
|
+
* consumer's state stays the only owner of what the statuses mean.
|
|
281
|
+
*/
|
|
282
|
+
export type DataGridRowStatus = "new" | "dirty" | "deleted";
|
|
283
|
+
/**
|
|
284
|
+
* Lifecycle of a cell for the optional CRUD indications: a corner mark in
|
|
285
|
+
* the amber tone for "dirty", the destructive tone for "invalid".
|
|
286
|
+
*/
|
|
287
|
+
export type DataGridCellStatus = "dirty" | "invalid";
|
|
288
|
+
/**
|
|
289
|
+
* Asks the consumer to open its editor for the focused cell: Enter or F2, or
|
|
290
|
+
* a typed printable character (then `initialText` carries it, the
|
|
291
|
+
* Notion/Airtable type-to-replace flow). Dispatched only for cells whose
|
|
292
|
+
* column is writable via `meta.cellEdit`.
|
|
293
|
+
*/
|
|
294
|
+
export interface DataGridCellEditRequest<TData> {
|
|
295
|
+
rowId: string;
|
|
296
|
+
columnId: string;
|
|
297
|
+
row: TData;
|
|
298
|
+
previousValue: unknown;
|
|
299
|
+
/** The typed character that started the edit; absent for Enter and F2. */
|
|
300
|
+
initialText?: string;
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* One batch per operation, however many cells it spans: a 10k-cell paste is
|
|
304
|
+
* one callback, one consumer setState, one table rebuild. The grid never
|
|
305
|
+
* writes data itself.
|
|
306
|
+
*/
|
|
307
|
+
export interface DataGridCellsChangeDetails<TData> {
|
|
308
|
+
source: DataGridCellsChangeSource;
|
|
309
|
+
changes: DataGridCellChange<TData>[];
|
|
310
|
+
rejected: DataGridCellRejection[];
|
|
311
|
+
}
|
|
312
|
+
export interface DataGridProps<TFeatures extends TableFeatures, TData extends object> {
|
|
139
313
|
className?: string;
|
|
140
314
|
table?: Table<TFeatures, TData>;
|
|
141
315
|
recordCount: number;
|
|
142
316
|
children?: ReactNode;
|
|
143
317
|
onRowClick?: (row: TData) => void;
|
|
318
|
+
/**
|
|
319
|
+
* Receives every spreadsheet write batch (paste, cut, clear, fill, edit).
|
|
320
|
+
* Served through the props getter like `onRowClick`, so an inline identity
|
|
321
|
+
* never republishes the context. Absent: copy still works, writes no-op.
|
|
322
|
+
*/
|
|
323
|
+
onCellsChange?: (details: DataGridCellsChangeDetails<TData>) => void;
|
|
324
|
+
/**
|
|
325
|
+
* Opens the consumer's editor from the keyboard: Enter, F2, or typing on
|
|
326
|
+
* the focused cell. Absent: Enter keeps moving down, typing does nothing.
|
|
327
|
+
*/
|
|
328
|
+
onCellEditRequest?: (request: DataGridCellEditRequest<TData>) => void;
|
|
329
|
+
/**
|
|
330
|
+
* Fires on every cell-selection change (focus moves, ranges grow or
|
|
331
|
+
* clear) with a resolved snapshot, so a selection count, formula bar or
|
|
332
|
+
* context panel needs no reach into TanStack internals.
|
|
333
|
+
*/
|
|
334
|
+
onCellSelectionChange?: (snapshot: DataGridCellSelectionSnapshot) => void;
|
|
335
|
+
/**
|
|
336
|
+
* Fires after the grid writes the clipboard (Cmd/Ctrl+C or X, or the
|
|
337
|
+
* native copy and cut events), e.g. to confirm with a toast.
|
|
338
|
+
*/
|
|
339
|
+
onCellsCopy?: (details: DataGridCopyDetails) => void;
|
|
340
|
+
/**
|
|
341
|
+
* Renders an "Add row" affordance as the table body's last row; clicking
|
|
342
|
+
* it is the consumer's cue to start creating a row. Absent: no row.
|
|
343
|
+
*/
|
|
344
|
+
onRowCreate?: () => void;
|
|
345
|
+
/** Label of the onRowCreate affordance. Defaults to "Add row". */
|
|
346
|
+
rowCreateLabel?: ReactNode;
|
|
347
|
+
/**
|
|
348
|
+
* Rendered inside the table body after the data rows: the slot a DRAFT
|
|
349
|
+
* row lives in while it is being created, before it joins `data` and the
|
|
350
|
+
* pagination math. Supply a `<tr>` of cells; the colgroup sizes them.
|
|
351
|
+
*/
|
|
352
|
+
appendRow?: ReactNode;
|
|
353
|
+
/**
|
|
354
|
+
* Optional CRUD indication per row. Return undefined for no indication;
|
|
355
|
+
* omit the prop entirely to render none anywhere.
|
|
356
|
+
*/
|
|
357
|
+
getRowStatus?: (row: TData) => DataGridRowStatus | undefined;
|
|
358
|
+
/**
|
|
359
|
+
* Optional CRUD indication per cell: the classic corner mark on cells the
|
|
360
|
+
* consumer tracks as edited or invalid.
|
|
361
|
+
*/
|
|
362
|
+
getCellStatus?: (row: TData, columnId: string) => DataGridCellStatus | undefined;
|
|
144
363
|
isLoading?: boolean;
|
|
364
|
+
/**
|
|
365
|
+
* Overrides for every built-in string: menu items, aria labels,
|
|
366
|
+
* pagination copy, state messages. Merged over the defaults; a more
|
|
367
|
+
* specific component prop (`rowCreateLabel`, `loadingMessage`, the
|
|
368
|
+
* pagination label props) still wins over its `i18n` counterpart.
|
|
369
|
+
*/
|
|
370
|
+
i18n?: DataGridI18nOverrides;
|
|
145
371
|
loadingMode?: "skeleton" | "spinner";
|
|
146
372
|
loadingMessage?: ReactNode | string;
|
|
147
373
|
fetchingMoreMessage?: ReactNode | string;
|
|
@@ -166,6 +392,36 @@ interface DataGridProps<TFeatures extends TableFeatures, TData extends object> {
|
|
|
166
392
|
columnsDraggable?: boolean;
|
|
167
393
|
rowsDraggable?: boolean;
|
|
168
394
|
rowsPinnable?: boolean;
|
|
395
|
+
/** Spreadsheet cell range selection: mouse ranges, keyboard, clipboard chrome. */
|
|
396
|
+
cellSelection?: boolean;
|
|
397
|
+
/**
|
|
398
|
+
* "range" (default): drag, Shift and Ctrl/Cmd gestures and Shift+keys
|
|
399
|
+
* grow multi-cell regions. "single": one focused cell only - every
|
|
400
|
+
* gesture collapses to it and Ctrl/Cmd+A is inert.
|
|
401
|
+
*/
|
|
402
|
+
cellSelectionMode?: "single" | "range";
|
|
403
|
+
/** Drag-to-fill handle on the selection corner. Requires cellSelection. */
|
|
404
|
+
cellFillHandle?: boolean;
|
|
405
|
+
/**
|
|
406
|
+
* How a cell opens its editor from the mouse: "dblclick" (default,
|
|
407
|
+
* the spreadsheet standard - first click focuses, second edits) or
|
|
408
|
+
* "click", opening the editor as soon as a plain click lands on the
|
|
409
|
+
* focused cell; modifier clicks and drags still select.
|
|
410
|
+
*/
|
|
411
|
+
cellEditMode?: "dblclick" | "click";
|
|
412
|
+
/**
|
|
413
|
+
* When true, committing an edit with Enter moves focus down (Shift+Enter
|
|
414
|
+
* up), the Sheets and Excel convention. Off by default: the commit keeps
|
|
415
|
+
* focus on the edited cell. Tab always commits and moves across.
|
|
416
|
+
*/
|
|
417
|
+
cellEditEnterAdvance?: boolean;
|
|
418
|
+
/**
|
|
419
|
+
* The handle's look: "dot" is a solid primary dot kept inside the
|
|
420
|
+
* cell corner; "ring" is the Sheets-style hollow circle riding the
|
|
421
|
+
* corner point, clamped at the grid's own boundary; "square" is the
|
|
422
|
+
* Excel-style solid square inside the corner. Default "dot".
|
|
423
|
+
*/
|
|
424
|
+
cellFillHandleVariant?: "dot" | "ring" | "square";
|
|
169
425
|
};
|
|
170
426
|
tableClassNames?: {
|
|
171
427
|
base?: string;
|
|
@@ -176,6 +432,20 @@ interface DataGridProps<TFeatures extends TableFeatures, TData extends object> {
|
|
|
176
432
|
bodyRow?: string;
|
|
177
433
|
footer?: string;
|
|
178
434
|
edgeCell?: string;
|
|
435
|
+
/** Override the getRowStatus tints; defaults are the warning-muted set. */
|
|
436
|
+
rowNew?: string;
|
|
437
|
+
rowDirty?: string;
|
|
438
|
+
rowDeleted?: string;
|
|
439
|
+
/**
|
|
440
|
+
* Override the pinned-row chrome (muted tint, boundary shadow). A grid
|
|
441
|
+
* that pins a draft row for quick-create wants it to read as an active
|
|
442
|
+
* row, not a muted one.
|
|
443
|
+
*/
|
|
444
|
+
rowPinned?: string;
|
|
445
|
+
/** The onRowCreate affordance row, e.g. to match the grid's row height. */
|
|
446
|
+
rowCreate?: string;
|
|
447
|
+
/** The fill handle, e.g. to restyle or resize it beyond the built-in variants. */
|
|
448
|
+
cellFillHandle?: string;
|
|
179
449
|
};
|
|
180
450
|
}
|
|
181
451
|
/**
|
|
@@ -197,5 +467,5 @@ declare function DataGridContainer({ children, className }: {
|
|
|
197
467
|
border?: boolean;
|
|
198
468
|
}): import("react").JSX.Element;
|
|
199
469
|
//#endregion
|
|
200
|
-
export { DataGrid,
|
|
470
|
+
export { DataGrid, DataGridContainer, DataGridProvider, useDataGrid };
|
|
201
471
|
//# sourceMappingURL=data-grid.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-grid.d.ts","names":[],"sources":["../../../../src/components/reui/data-grid/data-grid.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"data-grid.d.ts","names":[],"sources":["../../../../src/components/reui/data-grid/data-grid.tsx"],"mappings":";;;;;;;;;;;;;;;;;iBAiEiB,uBAAuB;;;;;;EAMtC,uBAAuB,KAAK;;;;;;;EAO5B,SAAS,aAAa,KAAK;;EAE3B,UAAU,gBAAgB,KAAK;;EAE/B;;;;;;;;EAQA;;iBAGe,mBAAmB;EAClC;EACA;EACA;EACA,WAAW;EACX,mBAAmB,KAAK,UAAU;EAClC;EACA,WAAW,uBAAuB;;;;;;;;EAQlC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA8BW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA+CD,0BAA0B;;;;;;;;;;;YAY1B,sBAAsB,wBAAwB,WAAW,kBAAkB;;wBAGvE,qBAAqB,cAAc,SAAS,QAC1D,QAAQ,OAAO,kBAAkB,OAAO;;;;;;;wBAe1B,kCAAkC,sBAChD,MAAM,KAAK,kBAAkB;EAE7B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;;;;;;;;;qBAyBW;YAoFD;EACV;EACA;EACA,UAAU;EACV,UAAU;EACV;;YAGU,oBAAoB;EAC9B,MAAM;EACN;EACA;IACE;IACA;;;;;;;;YASQ,oBAAoB,wBAAwB,KACtD,cAAc,eAAe;iBAId,qBAAqB;EACpC,OAAO,oBAAoB;EAC3B,OAAO,sBAAsB;EAC7B;EACA;;EAEA;;EAEA,MAAM;;;;;EAKN,WAAW;;;;;;;wBAQG,gBAAgB;YAIpB;;;;;;;;;;;;;;;EAeV,QAAQ;;YA8KE;EACV;EACA;EACA,UAAU;EACV,gBAAgB;;;YAIN;iBAEK,mBAAmB;EAClC;EACA;;EAEA,KAAK;;EAEL;;EAEA;;;iBAIe;;EAEf;;EAEA;;EAEA;;;iBAIe;EACf;EACA;EACA;EACA;;;iBAIe;;EAEf;IAAW;IAAe;;;EAE1B,QAAQ;;EAER,aAAa;;;;;EAKb;;iBAGe;EACf;EACA;EACA;EACA;;;;;;;YAQU;;;;;YAMA;;;;;;;iBAQK,wBAAwB;EACvC;EACA;EACA,KAAK;EACL;;EAEA;;;;;;;iBAQe,2BAA2B;EAC1C,QAAQ;EACR,SAAS,mBAAmB;EAC5B,UAAU;;iBAGK,cAAc,kBAAkB,eAAe;EAC9D;EACA,QAAQ,MAAM,WAAW;EACzB;EACA,WAAW;EACX,cAAc,KAAK;;;;;;EAMnB,iBAAiB,SAAS,2BAA2B;;;;;EAKrD,qBAAqB,SAAS,wBAAwB;;;;;;EAMtD,yBAAyB,UAAU;;;;;EAKnC,eAAe,SAAS;;;;;EAKxB;;EAEA,iBAAiB;;;;;;EAMjB,YAAY;;;;;EAKZ,gBAAgB,KAAK,UAAU;;;;;EAK/B,iBAAiB,KAAK,OAAO,qBAAqB;EAClD;;;;;;;EAOA,OAAO;EACP;EACA,iBAAiB;EACjB,sBAAsB;EACtB,uBAAuB;EACvB,eAAe;EACf;IACE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IAEA;;;;;;IAMA;;IAEA;;;;;;;IAOA;;;;;;IAMA;;;;;;;IAOA;;EAEF;IACE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IAEA;IACA;IACA;;;;;;IAMA;;IAEA;;IAEA;;;;;;;;;iBAcK,YAEP,+BACG,qBAAqB;iBAQjB,iBAAiB,wBACxB,UACA,UACG,SACF,oBAAoB;EACrB,OAAO,sBAAsB;EAC7B,WAAW;oBACZ,IAAA;iBA4GQ,SAAS,kBAAkB,eAAe,wBACjD,UACA,UACG,SACF,cAAc,WAAW,yBAAM,IAAA;iBAyEzB,oBACP,UACA;EAEA,UAAU;EACV;;EAEA;oBACD,IAAA"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { mergeDataGridI18n } from "./data-grid-i18n.js";
|
|
3
|
+
import { createContext, useContext, useEffect, useId, useMemo, useRef } from "react";
|
|
3
4
|
import { cn } from "@kumix/utils";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
import { columnFacetingFeature, columnFilteringFeature, columnOrderingFeature, columnPinningFeature, columnResizingFeature, columnSizingFeature, columnVisibilityFeature, createExpandedRowModel, createFacetedRowModel, createFacetedUniqueValues, createFilteredRowModel, createPaginatedRowModel, createSortedRowModel, globalFilteringFeature, metaHelper, rowExpandingFeature, rowPaginationFeature, rowPinningFeature, rowSelectionFeature, rowSortingFeature, sortFn_alphanumeric, sortFn_alphanumericCaseSensitive, sortFn_basic, sortFn_datetime, sortFn_text, sortFn_textCaseSensitive, tableFeatures } from "@tanstack/react-table";
|
|
6
|
+
import { cellSelectionFeature, columnFacetingFeature, columnFilteringFeature, columnOrderingFeature, columnPinningFeature, columnResizingFeature, columnSizingFeature, columnVisibilityFeature, createExpandedRowModel, createFacetedRowModel, createFacetedUniqueValues, createFilteredRowModel, createPaginatedRowModel, createSortedRowModel, globalFilteringFeature, metaHelper, rowExpandingFeature, rowPaginationFeature, rowPinningFeature, rowSelectionFeature, rowSortingFeature, sortFn_alphanumeric, sortFn_alphanumericCaseSensitive, sortFn_basic, sortFn_datetime, sortFn_text, sortFn_textCaseSensitive, tableFeatures } from "@tanstack/react-table";
|
|
6
7
|
//#region src/components/reui/data-grid/data-grid.tsx
|
|
7
8
|
/**
|
|
8
9
|
* The batteries-included feature bundle every ReUI data-grid example builds
|
|
@@ -45,6 +46,7 @@ const dataGridFeatures = tableFeatures({
|
|
|
45
46
|
rowSelectionFeature,
|
|
46
47
|
rowExpandingFeature,
|
|
47
48
|
rowPinningFeature,
|
|
49
|
+
cellSelectionFeature,
|
|
48
50
|
sortedRowModel: createSortedRowModel(),
|
|
49
51
|
filteredRowModel: createFilteredRowModel(),
|
|
50
52
|
paginatedRowModel: createPaginatedRowModel(),
|
|
@@ -69,21 +71,122 @@ function getColumnHeaderLabel(column) {
|
|
|
69
71
|
if (typeof defHeader === "string") return defHeader;
|
|
70
72
|
return String(column.id);
|
|
71
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* The td contract for spreadsheet selection. Call inside a
|
|
76
|
+
* `Subscribe source={table.atoms.cellSelection}` render only: the reads are
|
|
77
|
+
* builder calls whose state dependency React Compiler cannot see, exactly the
|
|
78
|
+
* trap the row-selection checkbox documents.
|
|
79
|
+
*/
|
|
80
|
+
function getDataGridCellSelectionCellAttrs(cell) {
|
|
81
|
+
const selected = cell.getIsSelected();
|
|
82
|
+
const edges = cell.getSelectionEdges();
|
|
83
|
+
return {
|
|
84
|
+
"aria-selected": selected,
|
|
85
|
+
"data-col-id": cell.column.id,
|
|
86
|
+
"data-cell-selected": selected || void 0,
|
|
87
|
+
"data-cell-focused": cell.getIsFocused() || void 0,
|
|
88
|
+
"data-cell-edge-top": edges.top || void 0,
|
|
89
|
+
"data-cell-edge-right": edges.right || void 0,
|
|
90
|
+
"data-cell-edge-bottom": edges.bottom || void 0,
|
|
91
|
+
"data-cell-edge-left": edges.left || void 0
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Selection chrome for a body td, activated by the data attributes above plus
|
|
96
|
+
* the imperatively toggled `data-cell-fill-target` (fill-drag preview, written
|
|
97
|
+
* outside React like the resize indicator). A ::before overlay, not outline
|
|
98
|
+
* or box-shadow: an outline ring hugs the cell box and cannot line up with
|
|
99
|
+
* the gridlines the perimeter paints on, and the pinned-column dividers
|
|
100
|
+
* already own the cell's shadow slot (tailwind-merge would collapse a second
|
|
101
|
+
* shadow-[...] into it).
|
|
102
|
+
*/
|
|
103
|
+
const dataGridCellSelectionCellClasses = cn("relative select-none", "data-[cell-selected]:bg-primary/4", "data-[cell-selected]:data-pinned:bg-[color-mix(in_oklab,var(--primary)_4%,var(--background))]", "data-[cell-focused]:bg-transparent!", "data-[cell-focused]:data-pinned:bg-background!", "data-[cell-selected]:before:pointer-events-none data-[cell-selected]:before:absolute data-[cell-selected]:before:start-[var(--data-grid-overlay-start,-1px)] data-[cell-selected]:before:end-[var(--data-grid-overlay-end,-1px)] data-[cell-selected]:before:top-[var(--data-grid-overlay-top,-1px)] data-[cell-selected]:before:bottom-[var(--data-grid-overlay-bottom,-1px)] data-[cell-selected]:before:border-primary data-[cell-selected]:before:content-['']", "data-[cell-focused]:before:pointer-events-none data-[cell-focused]:before:absolute data-[cell-focused]:before:start-[var(--data-grid-overlay-start,-1px)] data-[cell-focused]:before:end-[var(--data-grid-overlay-end,-1px)] data-[cell-focused]:before:top-[var(--data-grid-overlay-top,-1px)] data-[cell-focused]:before:bottom-[var(--data-grid-overlay-bottom,-1px)] data-[cell-focused]:before:border-primary data-[cell-focused]:before:content-['']", "data-[cell-selected]:before:border-e data-[cell-selected]:before:border-b", "data-[cell-selected]:not-data-[cell-edge-right]:before:border-e-border", "data-[cell-selected]:not-data-[cell-edge-bottom]:before:border-b-border", "data-[cell-focused]:not-data-[cell-selected]:before:border", "data-[cell-edge-left]:before:border-s data-[cell-edge-right]:before:border-e data-[cell-edge-top]:before:border-t data-[cell-edge-bottom]:before:border-b", "in-data-[cell-filling]:data-[cell-selected]:before:hidden", "in-data-[cell-filling]:data-[cell-focused]:before:hidden", "in-data-[cell-editing]:data-[cell-focused]:before:hidden", "in-[tr:last-child]:[--data-grid-overlay-bottom:0px]", "in-[tr:first-child]:[--data-grid-overlay-top:0px]", "first:[--data-grid-overlay-start:0px]", "last:[--data-grid-overlay-end:0px]", "[&:has(+td[data-pinned])]:[--data-grid-overlay-end:0px]", "[&:has(+[data-slot=data-grid-table-fill-body-cell]:last-child)]:[--data-grid-overlay-end:0px]", "[&:has(+[data-slot=data-grid-table-fill-body-cell]+td[data-pinned])]:[--data-grid-overlay-end:0px]", "[td[data-pinned]+&]:[--data-grid-overlay-start:0px]", "data-[cell-fill-target]:bg-primary/4", "data-[cell-fill-target]:data-pinned:bg-[color-mix(in_oklab,var(--primary)_4%,var(--background))]");
|
|
104
|
+
/**
|
|
105
|
+
* Row and column ids are consumer strings; DOM ids cannot carry spaces or
|
|
106
|
+
* quotes. One shared sanitizer so `aria-activedescendant` writers and the id
|
|
107
|
+
* renderers always agree on the same encoding.
|
|
108
|
+
*/
|
|
109
|
+
function toDataGridDomId(value) {
|
|
110
|
+
return value.replace(/[^\w-]/g, "_");
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Bookkeeping keyed on the TABLE STORE, never on a React instance: dev
|
|
114
|
+
* StrictMode double-mounts the tree, so two controller instances serve one
|
|
115
|
+
* page and only the first would remember what it absorbed - the second
|
|
116
|
+
* reads the grown width as a user drag and freezes the column. The store
|
|
117
|
+
* object is the one identity that provably survives that dance (the
|
|
118
|
+
* absorbed sizing rides inside it), and the WeakMap lets a discarded
|
|
119
|
+
* table take its bookkeeping with it.
|
|
120
|
+
*/
|
|
121
|
+
const dataGridAutoSizeStates = /* @__PURE__ */ new WeakMap();
|
|
122
|
+
function getDataGridAutoSizeState(store) {
|
|
123
|
+
let state = dataGridAutoSizeStates.get(store);
|
|
124
|
+
if (!state) {
|
|
125
|
+
state = {
|
|
126
|
+
applied: null,
|
|
127
|
+
settleTimer: null,
|
|
128
|
+
pendingFreeSpace: 0,
|
|
129
|
+
lastCommitAt: 0
|
|
130
|
+
};
|
|
131
|
+
dataGridAutoSizeStates.set(store, state);
|
|
132
|
+
}
|
|
133
|
+
return state;
|
|
134
|
+
}
|
|
72
135
|
function createDataGridAutoSizeController(getTable) {
|
|
73
|
-
|
|
74
|
-
|
|
136
|
+
const SETTLE_MS = 150;
|
|
137
|
+
const reflow = (freeSpace) => {
|
|
75
138
|
const table = getTable();
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
if (
|
|
139
|
+
const state = getDataGridAutoSizeState(table.store);
|
|
140
|
+
const columnSizing = table.atoms.columnSizing?.get() ?? table.state.columnSizing;
|
|
141
|
+
if (!state.applied) return false;
|
|
142
|
+
const autoSizeColumn = table.getVisibleLeafColumns().find((column) => column.columnDef.meta?.autoSize && column.getCanResize());
|
|
143
|
+
if (!autoSizeColumn || autoSizeColumn.id !== state.applied.columnId) return false;
|
|
144
|
+
const currentSize = columnSizing[state.applied.columnId];
|
|
145
|
+
if (currentSize !== void 0 && currentSize !== state.applied.grown) return false;
|
|
146
|
+
const freeAtBase = freeSpace + (state.applied.grown - state.applied.base);
|
|
147
|
+
const floor = autoSizeColumn.columnDef.minSize ?? state.applied.base;
|
|
148
|
+
const target = Math.max(floor, state.applied.base + freeAtBase);
|
|
149
|
+
if (Math.abs(target - state.applied.grown) < 1) return false;
|
|
150
|
+
state.applied = {
|
|
151
|
+
...state.applied,
|
|
152
|
+
grown: target
|
|
153
|
+
};
|
|
154
|
+
table.setColumnSizing((old) => ({
|
|
155
|
+
...old,
|
|
156
|
+
[state.applied.columnId]: target
|
|
157
|
+
}));
|
|
158
|
+
return true;
|
|
159
|
+
};
|
|
160
|
+
return { apply(freeSpace) {
|
|
161
|
+
const table = getTable();
|
|
162
|
+
const state = getDataGridAutoSizeState(table.store);
|
|
163
|
+
const columnSizing = table.atoms.columnSizing?.get() ?? table.state.columnSizing;
|
|
164
|
+
if (state.applied && columnSizing[state.applied.columnId] === void 0) state.applied = null;
|
|
79
165
|
const autoSizeColumn = table.getVisibleLeafColumns().find((column) => column.columnDef.meta?.autoSize && column.getCanResize());
|
|
80
|
-
if (
|
|
166
|
+
if (autoSizeColumn && state.applied?.columnId === autoSizeColumn.id) {
|
|
167
|
+
state.pendingFreeSpace = freeSpace;
|
|
168
|
+
const now = Date.now();
|
|
169
|
+
if (now - state.lastCommitAt > SETTLE_MS) {
|
|
170
|
+
state.lastCommitAt = now;
|
|
171
|
+
return reflow(freeSpace);
|
|
172
|
+
}
|
|
173
|
+
if (state.settleTimer !== null) clearTimeout(state.settleTimer);
|
|
174
|
+
state.settleTimer = setTimeout(() => {
|
|
175
|
+
state.settleTimer = null;
|
|
176
|
+
state.lastCommitAt = Date.now();
|
|
177
|
+
reflow(state.pendingFreeSpace);
|
|
178
|
+
}, SETTLE_MS);
|
|
179
|
+
return false;
|
|
180
|
+
}
|
|
181
|
+
const fillWidth = Math.max(0, freeSpace);
|
|
182
|
+
if (fillWidth <= 0) return false;
|
|
183
|
+
if (!autoSizeColumn) return false;
|
|
81
184
|
const currentSize = columnSizing[autoSizeColumn.id];
|
|
82
|
-
if (currentSize !== void 0 && currentSize !== applied?.grown) return false;
|
|
83
|
-
const revert = applied && columnSizing[applied.columnId] === applied.grown ? applied : null;
|
|
185
|
+
if (currentSize !== void 0 && currentSize !== state.applied?.grown) return false;
|
|
186
|
+
const revert = state.applied && columnSizing[state.applied.columnId] === state.applied.grown ? state.applied : null;
|
|
84
187
|
const base = columnSizing[autoSizeColumn.id] ?? autoSizeColumn.getSize();
|
|
85
188
|
const grown = base + fillWidth;
|
|
86
|
-
applied = {
|
|
189
|
+
state.applied = {
|
|
87
190
|
columnId: autoSizeColumn.id,
|
|
88
191
|
base,
|
|
89
192
|
grown
|
|
@@ -112,8 +215,12 @@ function useDataGrid() {
|
|
|
112
215
|
return context;
|
|
113
216
|
}
|
|
114
217
|
function DataGridProvider({ children, table, ...props }) {
|
|
218
|
+
const gridId = useId();
|
|
115
219
|
const propsRef = useRef(props);
|
|
116
220
|
propsRef.current = props;
|
|
221
|
+
const i18n = mergeDataGridI18n(props.i18n);
|
|
222
|
+
const i18nRef = useRef(i18n);
|
|
223
|
+
i18nRef.current = i18n;
|
|
117
224
|
const tableRef = useRef(table);
|
|
118
225
|
tableRef.current = table;
|
|
119
226
|
const resizeMode = props.tableLayout?.columnsResizable && props.tableLayout.columnsResizeMode ? props.tableLayout.columnsResizeMode : void 0;
|
|
@@ -125,6 +232,27 @@ function DataGridProvider({ children, table, ...props }) {
|
|
|
125
232
|
columnResizeMode: resizeMode
|
|
126
233
|
}));
|
|
127
234
|
}, [table, resizeMode]);
|
|
235
|
+
const cellSelectionOn = !!props.tableLayout?.cellSelection;
|
|
236
|
+
useEffect(() => {
|
|
237
|
+
if (!cellSelectionOn || table.atoms.cellSelection == null) return;
|
|
238
|
+
if (table.options.autoResetCellSelection === false) return;
|
|
239
|
+
table.setOptions((old) => ({
|
|
240
|
+
...old,
|
|
241
|
+
autoResetCellSelection: false
|
|
242
|
+
}));
|
|
243
|
+
}, [table, cellSelectionOn]);
|
|
244
|
+
const pageKey = `${table.state.pagination?.pageIndex}:${table.state.pagination?.pageSize}`;
|
|
245
|
+
const previousPageKeyRef = useRef(pageKey);
|
|
246
|
+
useEffect(() => {
|
|
247
|
+
if (previousPageKeyRef.current === pageKey) return;
|
|
248
|
+
previousPageKeyRef.current = pageKey;
|
|
249
|
+
if (!cellSelectionOn || table.atoms.cellSelection == null) return;
|
|
250
|
+
tableRef.current.resetCellSelection(true);
|
|
251
|
+
}, [
|
|
252
|
+
pageKey,
|
|
253
|
+
cellSelectionOn,
|
|
254
|
+
table.atoms.cellSelection
|
|
255
|
+
]);
|
|
128
256
|
const autoSize = useMemo(() => createDataGridAutoSizeController(() => tableRef.current), []);
|
|
129
257
|
const value = useMemo(() => ({
|
|
130
258
|
get props() {
|
|
@@ -133,13 +261,18 @@ function DataGridProvider({ children, table, ...props }) {
|
|
|
133
261
|
get table() {
|
|
134
262
|
return tableRef.current;
|
|
135
263
|
},
|
|
264
|
+
get i18n() {
|
|
265
|
+
return i18nRef.current;
|
|
266
|
+
},
|
|
136
267
|
recordCount: props.recordCount,
|
|
137
268
|
isLoading: props.isLoading || false,
|
|
269
|
+
gridId,
|
|
138
270
|
autoSize
|
|
139
271
|
}), [
|
|
140
272
|
autoSize,
|
|
141
273
|
props.recordCount,
|
|
142
|
-
props.isLoading
|
|
274
|
+
props.isLoading,
|
|
275
|
+
gridId
|
|
143
276
|
]);
|
|
144
277
|
return /* @__PURE__ */ jsx(DataGridContext.Provider, {
|
|
145
278
|
value,
|
|
@@ -166,7 +299,9 @@ function DataGrid({ children, table, ...props }) {
|
|
|
166
299
|
columnsMovable: false,
|
|
167
300
|
columnsDraggable: false,
|
|
168
301
|
rowsDraggable: false,
|
|
169
|
-
rowsPinnable: false
|
|
302
|
+
rowsPinnable: false,
|
|
303
|
+
cellSelection: false,
|
|
304
|
+
cellFillHandle: false
|
|
170
305
|
},
|
|
171
306
|
tableClassNames: {
|
|
172
307
|
base: "",
|
|
@@ -201,11 +336,11 @@ function DataGrid({ children, table, ...props }) {
|
|
|
201
336
|
function DataGridContainer({ children, className }) {
|
|
202
337
|
return /* @__PURE__ */ jsx("div", {
|
|
203
338
|
"data-slot": "data-grid",
|
|
204
|
-
className: cn("w-full overflow-hidden", className),
|
|
339
|
+
className: cn("relative w-full overflow-hidden", className),
|
|
205
340
|
children
|
|
206
341
|
});
|
|
207
342
|
}
|
|
208
343
|
//#endregion
|
|
209
|
-
export { DataGrid, DataGridContainer, DataGridProvider, dataGridFeatures, getColumnHeaderLabel, useDataGrid };
|
|
344
|
+
export { DataGrid, DataGridContainer, DataGridProvider, dataGridCellSelectionCellClasses, dataGridFeatures, getColumnHeaderLabel, getDataGridCellSelectionCellAttrs, toDataGridDomId, useDataGrid };
|
|
210
345
|
|
|
211
346
|
//# sourceMappingURL=data-grid.js.map
|