@qijenchen/design-system 0.1.0-beta.80 → 0.1.0-beta.82
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/CLAUDE.md +1 -1
- package/dist/components/Alert/alert.d.ts +5 -0
- package/dist/components/Alert/alert.d.ts.map +1 -1
- package/dist/components/Alert/alert.js +4 -1
- package/dist/components/Alert/alert.js.map +1 -1
- package/dist/components/AppShell/app-shell.d.ts +1 -1
- package/dist/components/AppShell/app-shell.js.map +1 -1
- package/dist/components/AspectRatio/aspect-ratio.d.ts +2 -1
- package/dist/components/AspectRatio/aspect-ratio.d.ts.map +1 -1
- package/dist/components/AspectRatio/aspect-ratio.js +1 -1
- package/dist/components/AspectRatio/aspect-ratio.js.map +1 -1
- package/dist/components/Avatar/avatar.d.ts +3 -2
- package/dist/components/Avatar/avatar.d.ts.map +1 -1
- package/dist/components/Avatar/avatar.js +8 -3
- package/dist/components/Avatar/avatar.js.map +1 -1
- package/dist/components/Badge/badge.d.ts.map +1 -1
- package/dist/components/Badge/badge.js +2 -1
- package/dist/components/Badge/badge.js.map +1 -1
- package/dist/components/Breadcrumb/breadcrumb.d.ts +14 -1
- package/dist/components/Breadcrumb/breadcrumb.d.ts.map +1 -1
- package/dist/components/Breadcrumb/breadcrumb.js +9 -3
- package/dist/components/Breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/BulkActionBar/bulk-action-bar.d.ts +4 -1
- package/dist/components/BulkActionBar/bulk-action-bar.d.ts.map +1 -1
- package/dist/components/BulkActionBar/bulk-action-bar.js +2 -2
- package/dist/components/BulkActionBar/bulk-action-bar.js.map +1 -1
- package/dist/components/Button/button.d.ts +4 -4
- package/dist/components/Button/button.d.ts.map +1 -1
- package/dist/components/Button/button.js +73 -44
- package/dist/components/Button/button.js.map +1 -1
- package/dist/components/Button/index.d.ts +1 -0
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +3 -0
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Calendar/calendar.d.ts +3 -1
- package/dist/components/Calendar/calendar.d.ts.map +1 -1
- package/dist/components/Calendar/calendar.js +40 -17
- package/dist/components/Calendar/calendar.js.map +1 -1
- package/dist/components/Carousel/carousel.d.ts +1 -1
- package/dist/components/Carousel/carousel.d.ts.map +1 -1
- package/dist/components/Carousel/carousel.js +3 -1
- package/dist/components/Carousel/carousel.js.map +1 -1
- package/dist/components/Chart/chart.d.ts.map +1 -1
- package/dist/components/Chart/chart.js +1 -1
- package/dist/components/Chart/chart.js.map +1 -1
- package/dist/components/Checkbox/checkbox.d.ts +6 -3
- package/dist/components/Checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox/checkbox.js +26 -4
- package/dist/components/Checkbox/checkbox.js.map +1 -1
- package/dist/components/Checkbox/index.d.ts +1 -0
- package/dist/components/Checkbox/index.d.ts.map +1 -1
- package/dist/components/Checkbox/index.js +3 -0
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/Chip/chip.d.ts +9 -3
- package/dist/components/Chip/chip.d.ts.map +1 -1
- package/dist/components/Chip/chip.js +46 -13
- package/dist/components/Chip/chip.js.map +1 -1
- package/dist/components/Coachmark/coachmark.d.ts +5 -3
- package/dist/components/Coachmark/coachmark.d.ts.map +1 -1
- package/dist/components/Coachmark/coachmark.js +10 -7
- package/dist/components/Coachmark/coachmark.js.map +1 -1
- package/dist/components/Combobox/combobox.d.ts +3 -1
- package/dist/components/Combobox/combobox.d.ts.map +1 -1
- package/dist/components/Combobox/combobox.js +11 -7
- package/dist/components/Combobox/combobox.js.map +1 -1
- package/dist/components/Command/command.d.ts +2 -2
- package/dist/components/Command/command.d.ts.map +1 -1
- package/dist/components/Command/command.js +4 -2
- package/dist/components/Command/command.js.map +1 -1
- package/dist/components/DataTable/active-editor-controller.d.ts +4 -3
- package/dist/components/DataTable/active-editor-controller.d.ts.map +1 -1
- package/dist/components/DataTable/cell-registry.d.ts.map +1 -1
- package/dist/components/DataTable/cell-registry.js +3 -0
- package/dist/components/DataTable/cell-registry.js.map +1 -1
- package/dist/components/DataTable/data-table-filter-panel.d.ts.map +1 -1
- package/dist/components/DataTable/data-table-interaction-layer.d.ts +4 -3
- package/dist/components/DataTable/data-table-interaction-layer.d.ts.map +1 -1
- package/dist/components/DataTable/data-table-interaction-layer.js.map +1 -1
- package/dist/components/DataTable/data-table.d.ts +38 -7
- package/dist/components/DataTable/data-table.d.ts.map +1 -1
- package/dist/components/DataTable/data-table.js +213 -63
- package/dist/components/DataTable/data-table.js.map +1 -1
- package/dist/components/DataTable/filter-tree.d.ts +5 -0
- package/dist/components/DataTable/filter-tree.d.ts.map +1 -1
- package/dist/components/DateGrid/date-grid.d.ts +3 -3
- package/dist/components/DateGrid/date-grid.d.ts.map +1 -1
- package/dist/components/DateGrid/date-grid.js +52 -6
- package/dist/components/DateGrid/date-grid.js.map +1 -1
- package/dist/components/DatePicker/date-picker.d.ts +2 -8
- package/dist/components/DatePicker/date-picker.d.ts.map +1 -1
- package/dist/components/DatePicker/date-picker.js +139 -109
- package/dist/components/DatePicker/date-picker.js.map +1 -1
- package/dist/components/DescriptionList/description-list.d.ts.map +1 -1
- package/dist/components/DescriptionList/description-list.js +1 -1
- package/dist/components/DescriptionList/description-list.js.map +1 -1
- package/dist/components/Dialog/dialog.d.ts +1 -1
- package/dist/components/Dialog/dialog.d.ts.map +1 -1
- package/dist/components/Dialog/dialog.js +2 -1
- package/dist/components/Dialog/dialog.js.map +1 -1
- package/dist/components/DropdownMenu/dropdown-menu.d.ts +4 -4
- package/dist/components/DropdownMenu/dropdown-menu.d.ts.map +1 -1
- package/dist/components/DropdownMenu/dropdown-menu.js +25 -8
- package/dist/components/DropdownMenu/dropdown-menu.js.map +1 -1
- package/dist/components/Empty/empty.d.ts.map +1 -1
- package/dist/components/Empty/empty.js +1 -1
- package/dist/components/Empty/empty.js.map +1 -1
- package/dist/components/Field/field-wrapper.d.ts +1 -0
- package/dist/components/Field/field-wrapper.d.ts.map +1 -1
- package/dist/components/Field/field-wrapper.js +27 -7
- package/dist/components/Field/field-wrapper.js.map +1 -1
- package/dist/components/Field/field.d.ts +1 -1
- package/dist/components/Field/field.d.ts.map +1 -1
- package/dist/components/Field/field.js +2 -1
- package/dist/components/Field/field.js.map +1 -1
- package/dist/components/Field/use-form-validation.d.ts +5 -1
- package/dist/components/Field/use-form-validation.d.ts.map +1 -1
- package/dist/components/Field/use-form-validation.js +31 -21
- package/dist/components/Field/use-form-validation.js.map +1 -1
- package/dist/components/FieldControlGroup/field-control-group.d.ts +3 -3
- package/dist/components/FieldControlGroup/field-control-group.js.map +1 -1
- package/dist/components/FileItem/file-item.d.ts.map +1 -1
- package/dist/components/FileItem/file-item.js +3 -2
- package/dist/components/FileItem/file-item.js.map +1 -1
- package/dist/components/FileUpload/file-upload.d.ts +1 -1
- package/dist/components/FileUpload/file-upload.d.ts.map +1 -1
- package/dist/components/FileUpload/file-upload.js +22 -10
- package/dist/components/FileUpload/file-upload.js.map +1 -1
- package/dist/components/FileViewer/can-render-image.d.ts +6 -0
- package/dist/components/FileViewer/can-render-image.d.ts.map +1 -0
- package/dist/components/FileViewer/can-render-image.js +11 -0
- package/dist/components/FileViewer/can-render-image.js.map +1 -0
- package/dist/components/FileViewer/file-viewer.d.ts +2 -2
- package/dist/components/FileViewer/file-viewer.d.ts.map +1 -1
- package/dist/components/FileViewer/file-viewer.js +24 -16
- package/dist/components/FileViewer/file-viewer.js.map +1 -1
- package/dist/components/FileViewer/image-renderer.d.ts +0 -5
- package/dist/components/FileViewer/image-renderer.d.ts.map +1 -1
- package/dist/components/FileViewer/image-renderer.js +1 -9
- package/dist/components/FileViewer/image-renderer.js.map +1 -1
- package/dist/components/HoverCard/hover-card.d.ts.map +1 -1
- package/dist/components/HoverCard/hover-card.js +3 -1
- package/dist/components/HoverCard/hover-card.js.map +1 -1
- package/dist/components/Input/input.d.ts +26 -3
- package/dist/components/Input/input.d.ts.map +1 -1
- package/dist/components/Input/input.js +12 -8
- package/dist/components/Input/input.js.map +1 -1
- package/dist/components/LinkInput/link-input.d.ts +3 -3
- package/dist/components/LinkInput/link-input.d.ts.map +1 -1
- package/dist/components/LinkInput/link-input.js +29 -28
- package/dist/components/LinkInput/link-input.js.map +1 -1
- package/dist/components/Menu/menu-item.d.ts.map +1 -1
- package/dist/components/Menu/menu-item.js +5 -4
- package/dist/components/Menu/menu-item.js.map +1 -1
- package/dist/components/Notice/notice.d.ts +5 -0
- package/dist/components/Notice/notice.d.ts.map +1 -1
- package/dist/components/Notice/notice.js +11 -5
- package/dist/components/Notice/notice.js.map +1 -1
- package/dist/components/NumberInput/number-input.d.ts +1 -1
- package/dist/components/NumberInput/number-input.d.ts.map +1 -1
- package/dist/components/NumberInput/number-input.js +17 -8
- package/dist/components/NumberInput/number-input.js.map +1 -1
- package/dist/components/OverflowIndicator/overflow-indicator.d.ts +1 -1
- package/dist/components/OverflowIndicator/overflow-indicator.d.ts.map +1 -1
- package/dist/components/OverflowIndicator/overflow-indicator.js +2 -1
- package/dist/components/OverflowIndicator/overflow-indicator.js.map +1 -1
- package/dist/components/Pagination/index.d.ts +2 -0
- package/dist/components/Pagination/index.d.ts.map +1 -0
- package/dist/components/Pagination/index.js +6 -0
- package/dist/components/Pagination/index.js.map +1 -0
- package/dist/components/Pagination/pagination.d.ts +49 -0
- package/dist/components/Pagination/pagination.d.ts.map +1 -0
- package/dist/components/Pagination/pagination.js +182 -0
- package/dist/components/Pagination/pagination.js.map +1 -0
- package/dist/components/PeoplePicker/people-picker.d.ts +3 -3
- package/dist/components/PeoplePicker/people-picker.d.ts.map +1 -1
- package/dist/components/PeoplePicker/people-picker.js +38 -36
- package/dist/components/PeoplePicker/people-picker.js.map +1 -1
- package/dist/components/PeoplePicker/person-display.d.ts +4 -0
- package/dist/components/PeoplePicker/person-display.d.ts.map +1 -1
- package/dist/components/PeoplePicker/person-display.js +3 -3
- package/dist/components/PeoplePicker/person-display.js.map +1 -1
- package/dist/components/Popover/popover.d.ts.map +1 -1
- package/dist/components/Popover/popover.js +58 -32
- package/dist/components/Popover/popover.js.map +1 -1
- package/dist/components/ProfileCard/profile-card.d.ts +11 -3
- package/dist/components/ProfileCard/profile-card.d.ts.map +1 -1
- package/dist/components/ProfileCard/profile-card.js +14 -4
- package/dist/components/ProfileCard/profile-card.js.map +1 -1
- package/dist/components/RadioGroup/radio-group.d.ts +1 -1
- package/dist/components/RadioGroup/radio-group.d.ts.map +1 -1
- package/dist/components/RadioGroup/radio-group.js +28 -3
- package/dist/components/RadioGroup/radio-group.js.map +1 -1
- package/dist/components/Rating/rating.js +3 -3
- package/dist/components/Rating/rating.js.map +1 -1
- package/dist/components/ScrollArea/scroll-area.d.ts +1 -1
- package/dist/components/ScrollArea/scroll-area.js +2 -2
- package/dist/components/ScrollArea/scroll-area.js.map +1 -1
- package/dist/components/SegmentedControl/segmented-control.d.ts +2 -2
- package/dist/components/SegmentedControl/segmented-control.d.ts.map +1 -1
- package/dist/components/SegmentedControl/segmented-control.js +23 -10
- package/dist/components/SegmentedControl/segmented-control.js.map +1 -1
- package/dist/components/Select/select.d.ts +10 -4
- package/dist/components/Select/select.d.ts.map +1 -1
- package/dist/components/Select/select.js +57 -14
- package/dist/components/Select/select.js.map +1 -1
- package/dist/components/SelectMenu/index.js +4 -2
- package/dist/components/SelectMenu/select-menu.d.ts +31 -6
- package/dist/components/SelectMenu/select-menu.d.ts.map +1 -1
- package/dist/components/SelectMenu/select-menu.js +169 -85
- package/dist/components/SelectMenu/select-menu.js.map +1 -1
- package/dist/components/Separator/separator.js +1 -1
- package/dist/components/Separator/separator.js.map +1 -1
- package/dist/components/Sheet/sheet.d.ts +1 -1
- package/dist/components/Sheet/sheet.d.ts.map +1 -1
- package/dist/components/Sheet/sheet.js +3 -2
- package/dist/components/Sheet/sheet.js.map +1 -1
- package/dist/components/Sidebar/sidebar.d.ts +2 -2
- package/dist/components/Sidebar/sidebar.d.ts.map +1 -1
- package/dist/components/Sidebar/sidebar.js +28 -10
- package/dist/components/Sidebar/sidebar.js.map +1 -1
- package/dist/components/Skeleton/skeleton.d.ts +1 -1
- package/dist/components/Skeleton/skeleton.js +2 -2
- package/dist/components/Skeleton/skeleton.js.map +1 -1
- package/dist/components/Slider/slider.d.ts +1 -1
- package/dist/components/Slider/slider.d.ts.map +1 -1
- package/dist/components/Slider/slider.js +7 -3
- package/dist/components/Slider/slider.js.map +1 -1
- package/dist/components/Steps/steps.d.ts.map +1 -1
- package/dist/components/Steps/steps.js +6 -3
- package/dist/components/Steps/steps.js.map +1 -1
- package/dist/components/Switch/switch.d.ts +2 -2
- package/dist/components/Switch/switch.d.ts.map +1 -1
- package/dist/components/Switch/switch.js +47 -9
- package/dist/components/Switch/switch.js.map +1 -1
- package/dist/components/Tabs/tabs.d.ts +8 -5
- package/dist/components/Tabs/tabs.d.ts.map +1 -1
- package/dist/components/Tabs/tabs.js +45 -33
- package/dist/components/Tabs/tabs.js.map +1 -1
- package/dist/components/Tag/tag.d.ts.map +1 -1
- package/dist/components/Tag/tag.js +20 -4
- package/dist/components/Tag/tag.js.map +1 -1
- package/dist/components/Textarea/textarea.d.ts +2 -1
- package/dist/components/Textarea/textarea.d.ts.map +1 -1
- package/dist/components/Textarea/textarea.js +24 -13
- package/dist/components/Textarea/textarea.js.map +1 -1
- package/dist/components/TimePicker/time-picker.d.ts +2 -2
- package/dist/components/TimePicker/time-picker.d.ts.map +1 -1
- package/dist/components/TimePicker/time-picker.js +23 -12
- package/dist/components/TimePicker/time-picker.js.map +1 -1
- package/dist/components/Toast/toast.d.ts +1 -1
- package/dist/components/Toast/toast.d.ts.map +1 -1
- package/dist/components/Toast/toast.js +7 -3
- package/dist/components/Toast/toast.js.map +1 -1
- package/dist/components/Tooltip/tooltip.js +1 -1
- package/dist/components/Tooltip/tooltip.js.map +1 -1
- package/dist/components/TreeView/tree-view.d.ts +1 -1
- package/dist/components/TreeView/tree-view.d.ts.map +1 -1
- package/dist/components/TreeView/tree-view.js +11 -5
- package/dist/components/TreeView/tree-view.js.map +1 -1
- package/dist/hooks/use-controllable.d.ts.map +1 -1
- package/dist/hooks/use-controllable.js +4 -2
- package/dist/hooks/use-controllable.js.map +1 -1
- package/dist/hooks/use-is-touch-device.d.ts.map +1 -1
- package/dist/hooks/use-is-touch-device.js +3 -1
- package/dist/hooks/use-is-touch-device.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -1
- package/dist/patterns/element-anatomy/item-anatomy.d.ts +2 -2
- package/dist/patterns/element-anatomy/item-anatomy.d.ts.map +1 -1
- package/dist/patterns/element-anatomy/item-anatomy.js.map +1 -1
- package/dist/patterns/overlay-surface/overlay-surface.js.map +1 -1
- package/dist/tokens/categorical-color.d.ts +1 -1
- package/dist/tokens/categorical-color.js.map +1 -1
- package/dist/tokens/uiSize/icon-size.d.ts +2 -2
- package/ds-canonical/fork/governance.lock +1 -1
- package/ds-canonical/fork/hooks/check_opacity_token_usage.sh +10 -1
- package/ds-canonical/hooks/check_audit_post_report_validator.sh +13 -0
- package/ds-canonical/hooks/check_full_story_visual_interaction_sweep.sh +4 -3
- package/ds-canonical/hooks/check_opacity_token_usage.sh +10 -1
- package/ds-canonical/hooks/check_plugin_fork_health.sh +30 -22
- package/ds-canonical/hooks/check_story_invariants.sh +17 -5
- package/ds-canonical/hooks/check_substantive_edit_approval_preflight.sh +5 -2
- package/ds-canonical/references/principle-dim-map.json +100 -0
- package/ds-canonical/references/story-baseline-registry.json +4 -3
- package/ds-canonical/skills/deep-audit-cross-codex/SKILL.md +1 -1
- package/ds-canonical/skills/design-system-audit/SKILL.md +2 -2
- package/ds-story-manifest.json +41 -18
- package/llms-full.txt +11 -1
- package/llms.txt +3 -1
- package/package.json +1 -1
- package/src/components/Alert/alert.anatomy.stories.tsx +9 -6
- package/src/components/Alert/alert.spec.md +3 -3
- package/src/components/Alert/alert.tsx +9 -1
- package/src/components/AppShell/app-shell.anatomy.stories.tsx +3 -0
- package/src/components/AppShell/app-shell.spec.md +3 -2
- package/src/components/AppShell/app-shell.tsx +1 -1
- package/src/components/AspectRatio/aspect-ratio.spec.md +1 -2
- package/src/components/AspectRatio/aspect-ratio.tsx +3 -2
- package/src/components/Avatar/avatar.principles.stories.tsx +1 -1
- package/src/components/Avatar/avatar.spec.md +10 -30
- package/src/components/Avatar/avatar.stories.tsx +1 -1
- package/src/components/Avatar/avatar.tsx +30 -16
- package/src/components/Badge/badge.anatomy.stories.tsx +2 -2
- package/src/components/Badge/badge.spec.md +5 -4
- package/src/components/Badge/badge.tsx +4 -1
- package/src/components/Breadcrumb/breadcrumb.anatomy.stories.tsx +2 -2
- package/src/components/Breadcrumb/breadcrumb.principles.stories.tsx +15 -10
- package/src/components/Breadcrumb/breadcrumb.spec.md +5 -3
- package/src/components/Breadcrumb/breadcrumb.tsx +10 -4
- package/src/components/BulkActionBar/bulk-action-bar.anatomy.stories.tsx +3 -2
- package/src/components/BulkActionBar/bulk-action-bar.spec.md +15 -14
- package/src/components/BulkActionBar/bulk-action-bar.tsx +10 -4
- package/src/components/Button/button.anatomy.stories.tsx +6 -6
- package/src/components/Button/button.spec.md +3 -2
- package/src/components/Button/button.tsx +67 -27
- package/src/components/Button/index.ts +1 -0
- package/src/components/Calendar/calendar.anatomy.stories.tsx +5 -3
- package/src/components/Calendar/calendar.principles.stories.tsx +3 -1
- package/src/components/Calendar/calendar.spec.md +9 -2
- package/src/components/Calendar/calendar.stories.tsx +3 -1
- package/src/components/Calendar/calendar.tsx +53 -19
- package/src/components/Carousel/carousel.principles.stories.tsx +1 -1
- package/src/components/Carousel/carousel.tsx +4 -1
- package/src/components/Chart/chart.spec.md +1 -1
- package/src/components/Chart/chart.tsx +2 -1
- package/src/components/Checkbox/checkbox.principles.stories.tsx +1 -1
- package/src/components/Checkbox/checkbox.spec.md +1 -1
- package/src/components/Checkbox/checkbox.tsx +41 -7
- package/src/components/Checkbox/index.ts +1 -0
- package/src/components/Chip/chip.anatomy.stories.tsx +9 -9
- package/src/components/Chip/chip.principles.stories.tsx +3 -3
- package/src/components/Chip/chip.spec.md +7 -4
- package/src/components/Chip/chip.tsx +60 -15
- package/src/components/CircularProgress/circular-progress.anatomy.stories.tsx +1 -1
- package/src/components/CircularProgress/circular-progress.principles.stories.tsx +7 -5
- package/src/components/CircularProgress/circular-progress.spec.md +2 -0
- package/src/components/CircularProgress/circular-progress.stories.tsx +3 -11
- package/src/components/Coachmark/coachmark.anatomy.stories.tsx +2 -2
- package/src/components/Coachmark/coachmark.principles.stories.tsx +1 -1
- package/src/components/Coachmark/coachmark.spec.md +3 -3
- package/src/components/Coachmark/coachmark.tsx +23 -13
- package/src/components/Combobox/combobox.anatomy.stories.tsx +4 -4
- package/src/components/Combobox/combobox.spec.md +1 -1
- package/src/components/Combobox/combobox.tsx +30 -17
- package/src/components/Command/command.principles.stories.tsx +10 -12
- package/src/components/Command/command.spec.md +5 -5
- package/src/components/Command/command.stories.tsx +4 -4
- package/src/components/Command/command.tsx +3 -2
- package/src/components/DataTable/active-editor-controller.ts +4 -3
- package/src/components/DataTable/cell-registry.tsx +8 -0
- package/src/components/DataTable/data-table-filter-panel.tsx +8 -2
- package/src/components/DataTable/data-table-interaction-layer.tsx +8 -7
- package/src/components/DataTable/data-table.anatomy.stories.tsx +4 -4
- package/src/components/DataTable/data-table.css +2 -2
- package/src/components/DataTable/data-table.spec.md +72 -115
- package/src/components/DataTable/data-table.stories.tsx +51 -3
- package/src/components/DataTable/data-table.tsx +348 -63
- package/src/components/DataTable/filter-operators.spec.md +4 -4
- package/src/components/DataTable/filter-tree.ts +192 -42
- package/src/components/DateGrid/date-grid.anatomy.stories.tsx +1 -1
- package/src/components/DateGrid/date-grid.spec.md +11 -8
- package/src/components/DateGrid/date-grid.tsx +63 -8
- package/src/components/DatePicker/date-picker.principles.stories.tsx +1 -1
- package/src/components/DatePicker/date-picker.spec.md +1 -0
- package/src/components/DatePicker/date-picker.stories.tsx +19 -0
- package/src/components/DatePicker/date-picker.tsx +52 -15
- package/src/components/DescriptionList/description-list.spec.md +1 -1
- package/src/components/DescriptionList/description-list.tsx +3 -1
- package/src/components/Dialog/dialog.spec.md +1 -1
- package/src/components/Dialog/dialog.tsx +2 -1
- package/src/components/DropdownMenu/dropdown-menu.anatomy.stories.tsx +3 -1
- package/src/components/DropdownMenu/dropdown-menu.spec.md +8 -5
- package/src/components/DropdownMenu/dropdown-menu.tsx +33 -7
- package/src/components/Empty/empty.anatomy.stories.tsx +1 -1
- package/src/components/Empty/empty.spec.md +2 -2
- package/src/components/Empty/empty.stories.tsx +4 -15
- package/src/components/Empty/empty.tsx +4 -1
- package/src/components/Field/field-controls.spec.md +2 -1
- package/src/components/Field/field-wrapper.tsx +28 -8
- package/src/components/Field/field.anatomy.stories.tsx +7 -7
- package/src/components/Field/field.principles.stories.tsx +1 -1
- package/src/components/Field/field.spec.md +9 -7
- package/src/components/Field/field.tsx +2 -1
- package/src/components/Field/form-validation.spec.md +6 -3
- package/src/components/Field/use-form-validation.ts +49 -21
- package/src/components/FieldControlGroup/field-control-group.anatomy.stories.tsx +11 -10
- package/src/components/FieldControlGroup/field-control-group.principles.stories.tsx +3 -3
- package/src/components/FieldControlGroup/field-control-group.spec.md +3 -3
- package/src/components/FieldControlGroup/field-control-group.tsx +3 -3
- package/src/components/FileItem/file-item.anatomy.stories.tsx +6 -4
- package/src/components/FileItem/file-item.tsx +3 -2
- package/src/components/FileUpload/file-upload.anatomy.stories.tsx +1 -1
- package/src/components/FileUpload/file-upload.spec.md +4 -1
- package/src/components/FileUpload/file-upload.tsx +36 -10
- package/src/components/FileViewer/can-render-image.ts +15 -0
- package/src/components/FileViewer/file-viewer.anatomy.stories.tsx +6 -4
- package/src/components/FileViewer/file-viewer.spec.md +2 -2
- package/src/components/FileViewer/file-viewer.tsx +47 -21
- package/src/components/FileViewer/image-renderer.tsx +3 -8
- package/src/components/HoverCard/hover-card.spec.md +1 -1
- package/src/components/HoverCard/hover-card.tsx +3 -1
- package/src/components/Input/input.anatomy.stories.tsx +4 -4
- package/src/components/Input/input.principles.stories.tsx +1 -1
- package/src/components/Input/input.spec.md +1 -1
- package/src/components/Input/input.stories.tsx +11 -5
- package/src/components/Input/input.tsx +11 -9
- package/src/components/LinkInput/link-input.anatomy.stories.tsx +2 -0
- package/src/components/LinkInput/link-input.tsx +49 -34
- package/src/components/Menu/menu-item.anatomy.stories.tsx +1 -1
- package/src/components/Menu/menu-item.spec.md +4 -3
- package/src/components/Menu/menu-item.tsx +15 -4
- package/src/components/Notice/notice.anatomy.stories.tsx +10 -5
- package/src/components/Notice/notice.spec.md +4 -3
- package/src/components/Notice/notice.tsx +22 -5
- package/src/components/NumberInput/number-input.anatomy.stories.tsx +5 -4
- package/src/components/NumberInput/number-input.principles.stories.tsx +2 -1
- package/src/components/NumberInput/number-input.spec.md +2 -1
- package/src/components/NumberInput/number-input.tsx +25 -9
- package/src/components/OverflowIndicator/overflow-indicator.anatomy.stories.tsx +3 -3
- package/src/components/OverflowIndicator/overflow-indicator.spec.md +1 -1
- package/src/components/OverflowIndicator/overflow-indicator.tsx +2 -1
- package/src/components/Pagination/index.ts +5 -0
- package/src/components/Pagination/pagination.anatomy.stories.tsx +143 -0
- package/src/components/Pagination/pagination.principles.stories.tsx +81 -0
- package/src/components/Pagination/pagination.spec.md +150 -0
- package/src/components/Pagination/pagination.stories.tsx +98 -0
- package/src/components/Pagination/pagination.tsx +263 -0
- package/src/components/PeoplePicker/people-picker.anatomy.stories.tsx +1 -1
- package/src/components/PeoplePicker/people-picker.spec.md +4 -4
- package/src/components/PeoplePicker/people-picker.stories.tsx +1 -1
- package/src/components/PeoplePicker/people-picker.tsx +65 -55
- package/src/components/PeoplePicker/person-display.tsx +10 -4
- package/src/components/Popover/popover.anatomy.stories.tsx +2 -2
- package/src/components/Popover/popover.spec.md +13 -14
- package/src/components/Popover/popover.tsx +88 -39
- package/src/components/ProfileCard/profile-card.anatomy.stories.tsx +4 -4
- package/src/components/ProfileCard/profile-card.principles.stories.tsx +2 -2
- package/src/components/ProfileCard/profile-card.spec.md +1 -2
- package/src/components/ProfileCard/profile-card.stories.tsx +1 -1
- package/src/components/ProfileCard/profile-card.tsx +29 -8
- package/src/components/RadioGroup/radio-group.principles.stories.tsx +1 -1
- package/src/components/RadioGroup/radio-group.spec.md +2 -2
- package/src/components/RadioGroup/radio-group.stories.tsx +3 -1
- package/src/components/RadioGroup/radio-group.tsx +37 -3
- package/src/components/Rating/rating.anatomy.stories.tsx +11 -8
- package/src/components/Rating/rating.principles.stories.tsx +1 -1
- package/src/components/Rating/rating.spec.md +2 -2
- package/src/components/Rating/rating.stories.tsx +1 -1
- package/src/components/Rating/rating.tsx +3 -3
- package/src/components/ScrollArea/scroll-area.spec.md +1 -0
- package/src/components/ScrollArea/scroll-area.tsx +1 -1
- package/src/components/SegmentedControl/segmented-control.anatomy.stories.tsx +3 -3
- package/src/components/SegmentedControl/segmented-control.spec.md +7 -3
- package/src/components/SegmentedControl/segmented-control.tsx +29 -11
- package/src/components/Select/select.anatomy.stories.tsx +2 -2
- package/src/components/Select/select.spec.md +3 -2
- package/src/components/Select/select.tsx +62 -19
- package/src/components/SelectMenu/select-menu.anatomy.stories.tsx +1 -1
- package/src/components/SelectMenu/select-menu.principles.stories.tsx +1 -1
- package/src/components/SelectMenu/select-menu.spec.md +12 -8
- package/src/components/SelectMenu/select-menu.tsx +176 -20
- package/src/components/SelectionControl/selection-item.anatomy.stories.tsx +1 -1
- package/src/components/SelectionControl/selection-item.principles.stories.tsx +2 -2
- package/src/components/SelectionControl/selection-item.spec.md +2 -1
- package/src/components/SelectionControl/selection-item.stories.tsx +1 -1
- package/src/components/Separator/separator.anatomy.stories.tsx +2 -2
- package/src/components/Separator/separator.tsx +1 -1
- package/src/components/Sheet/sheet.spec.md +2 -1
- package/src/components/Sheet/sheet.tsx +4 -2
- package/src/components/Sidebar/sidebar.anatomy.stories.tsx +1 -1
- package/src/components/Sidebar/sidebar.spec.md +2 -1
- package/src/components/Sidebar/sidebar.stories.tsx +6 -4
- package/src/components/Sidebar/sidebar.tsx +41 -13
- package/src/components/Skeleton/skeleton.principles.stories.tsx +1 -1
- package/src/components/Skeleton/skeleton.spec.md +1 -2
- package/src/components/Skeleton/skeleton.tsx +1 -1
- package/src/components/Slider/slider.anatomy.stories.tsx +4 -4
- package/src/components/Slider/slider.spec.md +19 -85
- package/src/components/Slider/slider.tsx +13 -5
- package/src/components/Steps/steps.anatomy.stories.tsx +1 -1
- package/src/components/Steps/steps.spec.md +6 -4
- package/src/components/Steps/steps.tsx +11 -3
- package/src/components/Switch/switch.spec.md +4 -3
- package/src/components/Switch/switch.tsx +59 -10
- package/src/components/Tabs/tabs.anatomy.stories.tsx +7 -6
- package/src/components/Tabs/tabs.principles.stories.tsx +5 -3
- package/src/components/Tabs/tabs.spec.md +15 -48
- package/src/components/Tabs/tabs.tsx +70 -34
- package/src/components/Tag/tag.principles.stories.tsx +2 -2
- package/src/components/Tag/tag.spec.md +11 -43
- package/src/components/Tag/tag.tsx +30 -4
- package/src/components/Textarea/textarea.principles.stories.tsx +2 -1
- package/src/components/Textarea/textarea.spec.md +2 -1
- package/src/components/Textarea/textarea.tsx +20 -10
- package/src/components/TimePicker/time-picker.anatomy.stories.tsx +2 -1
- package/src/components/TimePicker/time-picker.spec.md +2 -2
- package/src/components/TimePicker/time-picker.tsx +35 -16
- package/src/components/Toast/toast.anatomy.stories.tsx +5 -6
- package/src/components/Toast/toast.principles.stories.tsx +10 -11
- package/src/components/Toast/toast.spec.md +5 -5
- package/src/components/Toast/toast.stories.tsx +5 -1
- package/src/components/Toast/toast.tsx +13 -7
- package/src/components/Tooltip/tooltip.spec.md +3 -3
- package/src/components/Tooltip/tooltip.tsx +1 -1
- package/src/components/TreeView/tree-view.anatomy.stories.tsx +6 -1
- package/src/components/TreeView/tree-view.principles.stories.tsx +2 -2
- package/src/components/TreeView/tree-view.spec.md +2 -2
- package/src/components/TreeView/tree-view.tsx +27 -5
- package/src/hooks/use-controllable.ts +7 -2
- package/src/hooks/use-is-touch-device.ts +8 -1
- package/src/index.ts +2 -1
- package/src/patterns/element-anatomy/element-anatomy.spec.md +3 -3
- package/src/patterns/element-anatomy/inline-action.spec.md +1 -1
- package/src/patterns/element-anatomy/item-anatomy.spec.md +5 -14
- package/src/patterns/element-anatomy/item-anatomy.stories.tsx +1 -0
- package/src/patterns/element-anatomy/item-anatomy.tsx +5 -6
- package/src/patterns/header-canonical/header-canonical.css +1 -2
- package/src/patterns/header-canonical/header-canonical.spec.md +5 -5
- package/src/patterns/horizontal-overflow/horizontal-overflow.spec.md +5 -4
- package/src/patterns/horizontal-overflow/horizontal-overflow.stories.tsx +137 -0
- package/src/patterns/overlay-surface/overlay-surface.spec.md +8 -7
- package/src/patterns/overlay-surface/overlay-surface.stories.tsx +116 -0
- package/src/patterns/overlay-surface/overlay-surface.tsx +5 -5
- package/src/patterns/resize-handle/resize-handle.spec.md +1 -1
- package/src/tokens/categorical-color.ts +1 -1
- package/src/tokens/color/color.spec.md +11 -13
- package/src/tokens/color/color.stories.tsx +1 -1
- package/src/tokens/color/primitives.css +7 -5
- package/src/tokens/color/semantic.css +8 -2
- package/src/tokens/density/density.spec.md +2 -0
- package/src/tokens/elevation/elevation.spec.md +1 -1
- package/src/tokens/layoutSpace/layoutSpace.spec.md +2 -1
- package/src/tokens/layoutSpace/layoutSpace.stories.tsx +3 -3
- package/src/tokens/motion/motion.spec.md +1 -1
- package/src/tokens/motion/motion.stories.tsx +142 -0
- package/src/tokens/opacity/opacity.spec.md +1 -1
- package/src/tokens/opacity/opacity.stories.tsx +7 -11
- package/src/tokens/radius/radius.spec.md +1 -1
- package/src/tokens/typography/typography.css +1 -1
- package/src/tokens/typography/typography.spec.md +1 -1
- package/src/tokens/uiSize/icon-size.ts +2 -2
- package/src/tokens/uiSize/uiSize.spec.md +12 -11
- package/src/tokens/uiSize/uiSize.stories.tsx +103 -0
- package/src/tokens/utility-registry.json +5 -4
- package/dist/node_modules/react-hook-form/dist/index.esm.js +0 -1950
- package/dist/node_modules/react-hook-form/dist/index.esm.js.map +0 -1
|
@@ -2,7 +2,8 @@ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { createPortal } from "react-dom";
|
|
4
4
|
import { Empty } from "../Empty/empty.js";
|
|
5
|
-
import {
|
|
5
|
+
import { Pagination } from "../Pagination/pagination.js";
|
|
6
|
+
import { useReactTable, getPaginationRowModel, getExpandedRowModel, getSortedRowModel, getCoreRowModel, flexRender } from "@tanstack/react-table";
|
|
6
7
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
7
8
|
import { TableScrollProvider } from "../Field/field-context.js";
|
|
8
9
|
import { cva } from "class-variance-authority";
|
|
@@ -122,12 +123,11 @@ function SourceRowProvider({
|
|
|
122
123
|
droppable.setNodeRef(el);
|
|
123
124
|
}, [draggable.setNodeRef, droppable.setNodeRef]);
|
|
124
125
|
const isDragging = draggable.isDragging;
|
|
125
|
-
const style = { ...dragSourceStyle(isDragging) };
|
|
126
126
|
const handleAttrs = draggable.attributes;
|
|
127
|
-
const ctxValue = {
|
|
127
|
+
const ctxValue = React.useMemo(() => ({
|
|
128
128
|
setNodeRef: setRefs,
|
|
129
129
|
role,
|
|
130
|
-
style,
|
|
130
|
+
style: { ...dragSourceStyle(isDragging) },
|
|
131
131
|
attributes: {},
|
|
132
132
|
isDragging,
|
|
133
133
|
// row 不接 listeners(button-only),baseRowDiv `{...(extra?.listeners ?? {})}` 自動 noop
|
|
@@ -140,7 +140,7 @@ function SourceRowProvider({
|
|
|
140
140
|
handleListeners: draggable.listeners,
|
|
141
141
|
handleAttributes: handleAttrs,
|
|
142
142
|
invalidDrop
|
|
143
|
-
};
|
|
143
|
+
}), [setRefs, role, isDragging, draggable.setActivatorNodeRef, draggable.listeners, handleAttrs, invalidDrop]);
|
|
144
144
|
return /* @__PURE__ */ jsx(SortableRowCtx.Provider, { value: ctxValue, children: children(ctxValue) });
|
|
145
145
|
}
|
|
146
146
|
function MirrorRowProvider({
|
|
@@ -154,7 +154,7 @@ function MirrorRowProvider({
|
|
|
154
154
|
const droppable = useDroppable({ id, disabled, data: { type: "row" } });
|
|
155
155
|
const dndCtx = useDndContext();
|
|
156
156
|
const isDragging = ((_a = dndCtx.active) == null ? void 0 : _a.id) === id;
|
|
157
|
-
const ctxValue = {
|
|
157
|
+
const ctxValue = React.useMemo(() => ({
|
|
158
158
|
setNodeRef: droppable.setNodeRef,
|
|
159
159
|
role,
|
|
160
160
|
style: { ...dragSourceStyle(isDragging) },
|
|
@@ -166,7 +166,7 @@ function MirrorRowProvider({
|
|
|
166
166
|
handleListeners: void 0,
|
|
167
167
|
handleAttributes: {},
|
|
168
168
|
invalidDrop
|
|
169
|
-
};
|
|
169
|
+
}), [droppable.setNodeRef, role, isDragging, invalidDrop]);
|
|
170
170
|
return /* @__PURE__ */ jsx(SortableRowCtx.Provider, { value: ctxValue, children: children(ctxValue) });
|
|
171
171
|
}
|
|
172
172
|
function DraggableHeaderCell({
|
|
@@ -220,12 +220,11 @@ function RowDragHandle({ disabled, anyDragActive }) {
|
|
|
220
220
|
const rRect = rowEl.getBoundingClientRect();
|
|
221
221
|
const tRect = tableEl.getBoundingClientRect();
|
|
222
222
|
const rowHovered = rowEl.hasAttribute("data-hovered");
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
});
|
|
223
|
+
const top = rRect.top + rRect.height / 2;
|
|
224
|
+
const left = tRect.left;
|
|
225
|
+
setPos(
|
|
226
|
+
(prev) => prev && prev.top === top && prev.left === left && prev.rowHovered === rowHovered ? prev : { top, left, rowHovered }
|
|
227
|
+
);
|
|
229
228
|
};
|
|
230
229
|
update();
|
|
231
230
|
const observer = new MutationObserver(update);
|
|
@@ -281,9 +280,10 @@ function RowDragHandle({ disabled, anyDragActive }) {
|
|
|
281
280
|
// 2026-05-12 fix v2(user 抓「drag column sort 啟用時 button 不是 disable 視覺」):
|
|
282
281
|
// 前 Round 4.5 加 `aria-disabled:opacity-[var(--opacity-disabled)]` 在 Button cva
|
|
283
282
|
// 沒生效 — 因為 inline style `opacity` 永遠 win over Tailwind class。Fix:把 disabled
|
|
284
|
-
// state opacity 也 compute 進 inline style。priority order:invisible 0 → drag
|
|
285
|
-
//
|
|
286
|
-
|
|
283
|
+
// state opacity 也 compute 進 inline style。priority order:invisible 0 → drag var(--opacity-disabled)
|
|
284
|
+
// 0.45(2026-07-04 修:原硬寫 0.5 違 lib/drag-visual.ts SSOT)→ canDrag=false(sort active)
|
|
285
|
+
// disabled visual var(--opacity-disabled) 0.45 → idle 1。
|
|
286
|
+
opacity: visible ? ctx.isDragging ? "var(--opacity-disabled)" : canDrag ? 1 : "var(--opacity-disabled)" : 0,
|
|
287
287
|
pointerEvents: visible ? "auto" : "none",
|
|
288
288
|
transition: "opacity 150ms ease"
|
|
289
289
|
},
|
|
@@ -315,12 +315,52 @@ function RowDragHandle({ disabled, anyDragActive }) {
|
|
|
315
315
|
portalTarget && createPortal(wrapped, portalTarget)
|
|
316
316
|
] });
|
|
317
317
|
}
|
|
318
|
+
const EMPTY_META = {};
|
|
319
|
+
const MemoCellSlot = React.memo(function MemoCellSlot2({
|
|
320
|
+
Cell,
|
|
321
|
+
rowId,
|
|
322
|
+
colId,
|
|
323
|
+
value,
|
|
324
|
+
meta,
|
|
325
|
+
mode,
|
|
326
|
+
size,
|
|
327
|
+
autoRowHeight,
|
|
328
|
+
isEditable,
|
|
329
|
+
isDisabled,
|
|
330
|
+
onCommitCell,
|
|
331
|
+
onCancelCell,
|
|
332
|
+
onCellCommitLive,
|
|
333
|
+
onEnterEdit
|
|
334
|
+
}) {
|
|
335
|
+
const onCommit = React.useCallback((next) => onCommitCell(rowId, colId, next), [onCommitCell, rowId, colId]);
|
|
336
|
+
const onCommitLive = React.useCallback((next) => onCellCommitLive == null ? void 0 : onCellCommitLive(rowId, colId, next), [onCellCommitLive, rowId, colId]);
|
|
337
|
+
const onCancel = React.useCallback(() => onCancelCell(rowId, colId), [onCancelCell, rowId, colId]);
|
|
338
|
+
const onRequestEdit = React.useCallback(() => {
|
|
339
|
+
if (!isDisabled) onEnterEdit(rowId, colId);
|
|
340
|
+
}, [onEnterEdit, isDisabled, rowId, colId]);
|
|
341
|
+
return /* @__PURE__ */ jsx(
|
|
342
|
+
Cell,
|
|
343
|
+
{
|
|
344
|
+
value,
|
|
345
|
+
meta,
|
|
346
|
+
mode,
|
|
347
|
+
size,
|
|
348
|
+
autoRowHeight,
|
|
349
|
+
isEditable,
|
|
350
|
+
isDisabled,
|
|
351
|
+
onCommit,
|
|
352
|
+
onCommitLive,
|
|
353
|
+
onCancel,
|
|
354
|
+
onRequestEdit
|
|
355
|
+
}
|
|
356
|
+
);
|
|
357
|
+
});
|
|
318
358
|
function DataTableInner({
|
|
319
359
|
columns,
|
|
320
360
|
data,
|
|
321
361
|
size = "md",
|
|
322
362
|
autoRowHeight = false,
|
|
323
|
-
height
|
|
363
|
+
height: heightProp,
|
|
324
364
|
overscan = 5,
|
|
325
365
|
emptyState,
|
|
326
366
|
enableHover = true,
|
|
@@ -356,16 +396,14 @@ function DataTableInner({
|
|
|
356
396
|
experimentalSpreadsheetOverlay = false,
|
|
357
397
|
experimentalActiveEditorController = false,
|
|
358
398
|
spreadsheetMode = false,
|
|
399
|
+
pagination,
|
|
359
400
|
className,
|
|
360
401
|
...props
|
|
361
402
|
}, ref) {
|
|
362
403
|
var _a, _b, _c;
|
|
404
|
+
const height = heightProp ?? (pagination ? "auto" : "400px");
|
|
363
405
|
const [editingCellId, setEditingCellId] = React.useState(null);
|
|
364
406
|
const [editingDraft, setEditingDraft] = React.useState(void 0);
|
|
365
|
-
const exitEdit = React.useCallback(() => {
|
|
366
|
-
setEditingCellId(null);
|
|
367
|
-
setEditingDraft(void 0);
|
|
368
|
-
}, []);
|
|
369
407
|
const [selectedCellId, setSelectedCellId] = React.useState(null);
|
|
370
408
|
const [rangeAnchor, setRangeAnchor] = React.useState(null);
|
|
371
409
|
const [rangeFocus, setRangeFocus] = React.useState(null);
|
|
@@ -384,14 +422,36 @@ function DataTableInner({
|
|
|
384
422
|
document.addEventListener("pointerdown", handler, true);
|
|
385
423
|
return () => document.removeEventListener("pointerdown", handler, true);
|
|
386
424
|
}, [spreadsheetMode, selectedCellId, rangeAnchor]);
|
|
425
|
+
const restoreCellSelection = React.useCallback((rowId, colId) => {
|
|
426
|
+
if (!spreadsheetMode) return;
|
|
427
|
+
const cellId = `${rowId}:${colId}`;
|
|
428
|
+
setSelectedCellId(cellId);
|
|
429
|
+
setRangeAnchor(cellId);
|
|
430
|
+
setRangeFocus(null);
|
|
431
|
+
requestAnimationFrame(() => {
|
|
432
|
+
const el = tableRef.current;
|
|
433
|
+
if (!el) return;
|
|
434
|
+
const active = document.activeElement;
|
|
435
|
+
if (active === document.body || active === null) el.focus({ preventScroll: true });
|
|
436
|
+
});
|
|
437
|
+
}, [spreadsheetMode]);
|
|
387
438
|
const commitCell = React.useCallback(
|
|
388
439
|
(rowId, colId, next) => {
|
|
389
440
|
onCellCommit == null ? void 0 : onCellCommit(rowId, colId, next);
|
|
390
441
|
setEditingCellId(null);
|
|
391
442
|
setEditingDraft(void 0);
|
|
443
|
+
restoreCellSelection(rowId, colId);
|
|
392
444
|
},
|
|
393
|
-
[onCellCommit]
|
|
445
|
+
[onCellCommit, restoreCellSelection]
|
|
394
446
|
);
|
|
447
|
+
const cancelCellEdit = React.useCallback((rowId, colId) => {
|
|
448
|
+
setEditingCellId(null);
|
|
449
|
+
setEditingDraft(void 0);
|
|
450
|
+
restoreCellSelection(rowId, colId);
|
|
451
|
+
}, [restoreCellSelection]);
|
|
452
|
+
const enterCellEdit = React.useCallback((rowId, colId) => {
|
|
453
|
+
setEditingCellId(cellEditId(rowId, colId));
|
|
454
|
+
}, []);
|
|
395
455
|
const isCellEditable = React.useCallback(
|
|
396
456
|
// any-allow: free-form consumer meta — same rationale as L143 renderTypedValue
|
|
397
457
|
(meta, row) => {
|
|
@@ -470,6 +530,14 @@ function DataTableInner({
|
|
|
470
530
|
if (enabled && !out.includes(SELECT_COL_ID)) out.unshift(SELECT_COL_ID);
|
|
471
531
|
return out;
|
|
472
532
|
}, [userColumnOrder, enabled]);
|
|
533
|
+
const paginationEnabled = !!pagination;
|
|
534
|
+
const paginationOpts = typeof pagination === "object" ? pagination : void 0;
|
|
535
|
+
const [pageSizeState, setPageSizeState] = React.useState((paginationOpts == null ? void 0 : paginationOpts.pageSize) ?? 20);
|
|
536
|
+
const [currentPage, setCurrentPage] = useControllable({
|
|
537
|
+
value: paginationOpts == null ? void 0 : paginationOpts.page,
|
|
538
|
+
defaultValue: (paginationOpts == null ? void 0 : paginationOpts.defaultPage) ?? 1,
|
|
539
|
+
onChange: paginationOpts == null ? void 0 : paginationOpts.onPageChange
|
|
540
|
+
});
|
|
473
541
|
const table = useReactTable({
|
|
474
542
|
...tableOptions,
|
|
475
543
|
data,
|
|
@@ -480,7 +548,10 @@ function DataTableInner({
|
|
|
480
548
|
...tableOptions == null ? void 0 : tableOptions.state,
|
|
481
549
|
// columnPinning + columnOrder 在 user state 後 override,確保 __select__ 永遠左
|
|
482
550
|
columnPinning: { left: effectivePinnedLeft, right: pinnedRightColumns ?? [] },
|
|
483
|
-
...effectiveColumnOrder ? { columnOrder: effectiveColumnOrder } : {}
|
|
551
|
+
...effectiveColumnOrder ? { columnOrder: effectiveColumnOrder } : {},
|
|
552
|
+
// L5 分頁:必在 ...tableOptions?.state 之後 spread(同 columnPinning override 理由——
|
|
553
|
+
// 防 user state 蓋掉內建接線);頁碼變更由 <Pagination onPageChange> 驅動,不走 TanStack 內部 setter
|
|
554
|
+
...paginationEnabled ? { pagination: { pageIndex: currentPage - 1, pageSize: pageSizeState } } : {}
|
|
484
555
|
},
|
|
485
556
|
enableMultiSort,
|
|
486
557
|
// **#1 fix(2026-05-04)**:chain user `tableOptions.onSortingChange`(spread 在前被 override = 之前 bug)
|
|
@@ -500,6 +571,8 @@ function DataTableInner({
|
|
|
500
571
|
getSortedRowModel: getSortedRowModel(),
|
|
501
572
|
// L4 nested rows:啟用 expanded row model(consumer 透過 tableOptions.getSubRows + state.expanded forward)
|
|
502
573
|
getExpandedRowModel: getExpandedRowModel(),
|
|
574
|
+
// L5 分頁:條件掛載(TanStack 官方:pagination 與 virtualization 為互斥替代策略)
|
|
575
|
+
...paginationEnabled ? { getPaginationRowModel: getPaginationRowModel() } : {},
|
|
503
576
|
getRowId,
|
|
504
577
|
// 2026-05-06 v14 column resize:`onChange` mode → drag 中 column 即時跟動 cursor(world-class
|
|
505
578
|
// canonical:TanStack docs / AG Grid / Excel / Google Sheets 全部 live resize)。前 v13.2
|
|
@@ -513,9 +586,11 @@ function DataTableInner({
|
|
|
513
586
|
columnResizeMode: "onChange"
|
|
514
587
|
});
|
|
515
588
|
const columnSizingState = table.getState().columnSizing;
|
|
589
|
+
const isResizingColumn = table.getState().columnSizingInfo.isResizingColumn;
|
|
516
590
|
const prevColumnSizingRef = React.useRef(columnSizingState);
|
|
517
591
|
React.useEffect(() => {
|
|
518
592
|
if (!onColumnResize) return;
|
|
593
|
+
if (isResizingColumn) return;
|
|
519
594
|
const prev = prevColumnSizingRef.current;
|
|
520
595
|
Object.keys(columnSizingState).forEach((id) => {
|
|
521
596
|
if (columnSizingState[id] !== prev[id]) {
|
|
@@ -523,13 +598,18 @@ function DataTableInner({
|
|
|
523
598
|
}
|
|
524
599
|
});
|
|
525
600
|
prevColumnSizingRef.current = columnSizingState;
|
|
526
|
-
}, [columnSizingState, onColumnResize]);
|
|
601
|
+
}, [columnSizingState, isResizingColumn, onColumnResize]);
|
|
527
602
|
const { rows } = table.getRowModel();
|
|
528
603
|
const isEmpty = rows.length === 0;
|
|
604
|
+
const pageCount = paginationEnabled ? table.getPageCount() : 0;
|
|
605
|
+
React.useEffect(() => {
|
|
606
|
+
if (!paginationEnabled) return;
|
|
607
|
+
if (pageCount > 0 && currentPage > pageCount) setCurrentPage(pageCount);
|
|
608
|
+
}, [paginationEnabled, pageCount, currentPage, setCurrentPage]);
|
|
529
609
|
const hasHeightConstraint = height !== "auto";
|
|
530
610
|
const isFillHeight = hasHeightConstraint && /^(100%|100vh|fill)$/.test(height);
|
|
531
611
|
const VIRTUAL_THRESHOLD = 30;
|
|
532
|
-
const useVirtual = hasHeightConstraint && !isEmpty && rows.length > VIRTUAL_THRESHOLD;
|
|
612
|
+
const useVirtual = !paginationEnabled && hasHeightConstraint && !isEmpty && rows.length > VIRTUAL_THRESHOLD;
|
|
533
613
|
const hasRowActions = !!rowActions;
|
|
534
614
|
const tableRef = React.useRef(null);
|
|
535
615
|
const bodyRef = React.useRef(null);
|
|
@@ -557,6 +637,7 @@ function DataTableInner({
|
|
|
557
637
|
isScrollingResetDelay: 250
|
|
558
638
|
});
|
|
559
639
|
const [bodyMaxHeight, setBodyMaxHeight] = React.useState(null);
|
|
640
|
+
const paginationBarRef = React.useRef(null);
|
|
560
641
|
React.useLayoutEffect(() => {
|
|
561
642
|
var _a2;
|
|
562
643
|
if (!isFillHeight) {
|
|
@@ -573,7 +654,9 @@ function DataTableInner({
|
|
|
573
654
|
const slotH = (parentEl == null ? void 0 : parentEl.getBoundingClientRect().height) ?? tableRef.current.getBoundingClientRect().height;
|
|
574
655
|
const headerEl = tableRef.current.firstElementChild;
|
|
575
656
|
const headerH = (headerEl == null ? void 0 : headerEl.getBoundingClientRect().height) ?? 0;
|
|
576
|
-
const
|
|
657
|
+
const barEl = paginationBarRef.current;
|
|
658
|
+
const barFootprint = barEl ? barEl.getBoundingClientRect().height + (parseFloat(getComputedStyle(barEl.parentElement).rowGap) || 0) : 0;
|
|
659
|
+
const next = Math.max(0, slotH - headerH - barFootprint);
|
|
577
660
|
if (lastValue != null && Math.abs(next - lastValue) < 4) return;
|
|
578
661
|
lastValue = next;
|
|
579
662
|
pendingValue = next;
|
|
@@ -700,19 +783,22 @@ function DataTableInner({
|
|
|
700
783
|
const Cell = resolveCellComponent(colType);
|
|
701
784
|
const cellMode = experimentalActiveEditorController && isEditingThisCell ? "display" : isEditingThisCell && !disabled ? "edit" : "display";
|
|
702
785
|
content = /* @__PURE__ */ jsx(
|
|
703
|
-
|
|
786
|
+
MemoCellSlot,
|
|
704
787
|
{
|
|
788
|
+
Cell,
|
|
789
|
+
rowId,
|
|
790
|
+
colId,
|
|
705
791
|
value: cell.getValue(),
|
|
706
|
-
meta: meta ??
|
|
792
|
+
meta: meta ?? EMPTY_META,
|
|
707
793
|
mode: cellMode,
|
|
708
794
|
size,
|
|
709
795
|
autoRowHeight,
|
|
710
796
|
isEditable: editable,
|
|
711
797
|
isDisabled: disabled,
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
798
|
+
onCommitCell: commitCell,
|
|
799
|
+
onCancelCell: cancelCellEdit,
|
|
800
|
+
onCellCommitLive: onCellCommit,
|
|
801
|
+
onEnterEdit: enterCellEdit
|
|
716
802
|
}
|
|
717
803
|
);
|
|
718
804
|
} else {
|
|
@@ -751,7 +837,7 @@ function DataTableInner({
|
|
|
751
837
|
const rowId = cell.row.id;
|
|
752
838
|
const rowOriginal = cell.row.original;
|
|
753
839
|
const isDisabled = isRowSelectable ? !isRowSelectable(rowOriginal) : false;
|
|
754
|
-
const ariaLabel = (getRowAriaLabel == null ? void 0 : getRowAriaLabel(rowOriginal)) ?? "
|
|
840
|
+
const ariaLabel = (getRowAriaLabel == null ? void 0 : getRowAriaLabel(rowOriginal)) ?? "選取此列";
|
|
755
841
|
const checkboxSize = size === "lg" ? "lg" : "md";
|
|
756
842
|
const onCellClick = isDisabled ? void 0 : (e) => {
|
|
757
843
|
e.stopPropagation();
|
|
@@ -889,9 +975,11 @@ function DataTableInner({
|
|
|
889
975
|
// Phase 9 Issue 8 fix(2026-05-10 user 撞 + codex 重比稿 verdict ADOPT):
|
|
890
976
|
// 之前 `border-r border-divider` 只 right edge → hover overlay outline:-1px 只 right
|
|
891
977
|
// 邊壓 cell border,上左下 sub-pixel 不一致(user 抓「右 1px / 上左下 2px」bug)。
|
|
892
|
-
// 改 `dtCellGrid`
|
|
893
|
-
//
|
|
894
|
-
//
|
|
978
|
+
// 改 `dtCellGrid`(data-table.css「dtCellGrid v2/v3」段)box-shadow inset **只保右邊**
|
|
979
|
+
// `inset -1px 0 0 var(--divider)`(bottom 由 row border-b 接管、:last-child 設 none 防 2px;
|
|
980
|
+
// 2026-07-04 對齊 css 現況 — 原「4 邊 inset」敘述已被 v2/v3 取代),不佔 layout
|
|
981
|
+
// (per user verbatim「在 cell 內容起始位置不變」前提)→ 視覺 4 邊 grid line 由
|
|
982
|
+
// row border + 相鄰 cell 合成 → overlay outline:-1px 壓 cell border line。
|
|
895
983
|
// Field naked edit border 仍 own(per Field SSOT)— 編輯時 Field 自帶 border 1px,
|
|
896
984
|
// 跟 cell 4 邊 inset divider 視覺相疊(同 pixel)= 1 line visual,不雙線。
|
|
897
985
|
inlineEdit && "dtCellGrid",
|
|
@@ -1052,6 +1140,18 @@ function DataTableInner({
|
|
|
1052
1140
|
(e) => {
|
|
1053
1141
|
var _a2;
|
|
1054
1142
|
if (e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229) return;
|
|
1143
|
+
if (spreadsheetMode && selectedCellId == null && editingCellId == null && ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(e.key)) {
|
|
1144
|
+
const allRows = table.getRowModel().rows.map((r) => r.id);
|
|
1145
|
+
const allCols = table.getVisibleLeafColumns().map((c) => c.id).filter((id) => id !== SELECT_COL_ID);
|
|
1146
|
+
if (allRows.length > 0 && allCols.length > 0) {
|
|
1147
|
+
e.preventDefault();
|
|
1148
|
+
const firstCellId = `${allRows[0]}:${allCols[0]}`;
|
|
1149
|
+
setSelectedCellId(firstCellId);
|
|
1150
|
+
setRangeAnchor(firstCellId);
|
|
1151
|
+
setRangeFocus(null);
|
|
1152
|
+
}
|
|
1153
|
+
return;
|
|
1154
|
+
}
|
|
1055
1155
|
if (spreadsheetMode && selectedCellId != null && editingCellId == null) {
|
|
1056
1156
|
const navKeys = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Enter", "F2", "Escape"];
|
|
1057
1157
|
if (!navKeys.includes(e.key)) return;
|
|
@@ -1114,6 +1214,9 @@ function DataTableInner({
|
|
|
1114
1214
|
return;
|
|
1115
1215
|
}
|
|
1116
1216
|
},
|
|
1217
|
+
// D3 dep-hygiene fix(2026-07-06):handler 內(portal edit Enter 分支)呼叫的是 canEditCell,
|
|
1218
|
+
// 非 isCellEditable — 原 deps 列 isCellEditable 是靠 canEditCell identity-stable 才無實害的
|
|
1219
|
+
// stale-closure 地雷;改列真實依賴 canEditCell(其 useCallback deps 已含 isCellEditable + isCellDisabled)。
|
|
1117
1220
|
[
|
|
1118
1221
|
enabled,
|
|
1119
1222
|
mode,
|
|
@@ -1124,7 +1227,7 @@ function DataTableInner({
|
|
|
1124
1227
|
selectedCellId,
|
|
1125
1228
|
editingCellId,
|
|
1126
1229
|
table,
|
|
1127
|
-
|
|
1230
|
+
canEditCell
|
|
1128
1231
|
]
|
|
1129
1232
|
);
|
|
1130
1233
|
const headerCellEl = (header, showDivider) => {
|
|
@@ -1148,7 +1251,7 @@ function DataTableInner({
|
|
|
1148
1251
|
checked: headerCheckedState,
|
|
1149
1252
|
onClick: (e) => e.stopPropagation(),
|
|
1150
1253
|
onCheckedChange: () => toggleHeaderCheckbox(),
|
|
1151
|
-
"aria-label": "
|
|
1254
|
+
"aria-label": "全選可見列",
|
|
1152
1255
|
disabled: selectableVisibleIds.length === 0
|
|
1153
1256
|
}
|
|
1154
1257
|
)
|
|
@@ -1199,7 +1302,8 @@ function DataTableInner({
|
|
|
1199
1302
|
className: cn(
|
|
1200
1303
|
"flex items-center min-w-0 flex-1 gap-1 outline-none",
|
|
1201
1304
|
canSort && "cursor-pointer hover:text-foreground transition-colors",
|
|
1202
|
-
|
|
1305
|
+
// 2026-07-04:rounded-sm → rounded-md(radius.spec.md 設計哲學(4)rounded-sm 保留未使用,4px 一律 rounded-md)
|
|
1306
|
+
canSort && "focus-visible:ring-2 focus-visible:ring-ring rounded-md"
|
|
1203
1307
|
),
|
|
1204
1308
|
children: [
|
|
1205
1309
|
/* @__PURE__ */ jsx(TruncateCell, { className: cn("min-w-0", align === "right" && "text-right", align === "center" && "text-center"), children: header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()) }),
|
|
@@ -1314,6 +1418,14 @@ function DataTableInner({
|
|
|
1314
1418
|
return row.getVisibleCells().filter((c) => ids.has(c.column.id));
|
|
1315
1419
|
};
|
|
1316
1420
|
const [dropIndicator, setDropIndicator] = React.useState(null);
|
|
1421
|
+
const setDropIndicatorIfChanged = React.useCallback(
|
|
1422
|
+
(next) => {
|
|
1423
|
+
setDropIndicator(
|
|
1424
|
+
(prev) => prev && prev.id === next.id && prev.side === next.side && prev.type === next.type ? prev : next
|
|
1425
|
+
);
|
|
1426
|
+
},
|
|
1427
|
+
[]
|
|
1428
|
+
);
|
|
1317
1429
|
const reorderableColumnIdsRef = React.useRef([]);
|
|
1318
1430
|
const renderHeaderRow = (cols, isRight) => {
|
|
1319
1431
|
const headers = getRegionHeaders(cols);
|
|
@@ -1379,7 +1491,7 @@ function DataTableInner({
|
|
|
1379
1491
|
"data-sortable-row-id": enableRowDrag ? row.id : void 0,
|
|
1380
1492
|
"data-row-drag-source": enableRowDrag && isPrimaryRegion ? "true" : void 0,
|
|
1381
1493
|
role: "row",
|
|
1382
|
-
"aria-rowindex": idx + 2,
|
|
1494
|
+
"aria-rowindex": (paginationEnabled ? (currentPage - 1) * pageSizeState : 0) + idx + 2,
|
|
1383
1495
|
className: cn(
|
|
1384
1496
|
"group/row flex relative",
|
|
1385
1497
|
// H1 fix(2026-05-10):effectiveAutoRow 覆 global autoRowHeight,per-row 若有 cell error
|
|
@@ -1452,7 +1564,7 @@ function DataTableInner({
|
|
|
1452
1564
|
className: cn(dataTableVariants({ bordered }), isFillHeight && "flex flex-col", "outline-none focus:outline-none focus-visible:outline-none", className),
|
|
1453
1565
|
style: isFillHeight ? { maxHeight: height } : void 0,
|
|
1454
1566
|
role: "table",
|
|
1455
|
-
"aria-rowcount": rows.length + 1,
|
|
1567
|
+
"aria-rowcount": (paginationEnabled ? table.getPrePaginationRowModel().rows.length : rows.length) + 1,
|
|
1456
1568
|
tabIndex: enabled || spreadsheetMode ? 0 : void 0,
|
|
1457
1569
|
onKeyDown: enabled || spreadsheetMode ? tableKeyboardHandler : void 0,
|
|
1458
1570
|
onMouseOver: enterLeaveHandlers.onMouseOver,
|
|
@@ -1575,25 +1687,34 @@ function DataTableInner({
|
|
|
1575
1687
|
const nextMeta = (_a3 = nextColDef == null ? void 0 : nextColDef.columnDef) == null ? void 0 : _a3.meta;
|
|
1576
1688
|
if (!(nextMeta == null ? void 0 : nextMeta.type) || NON_EDIT_TYPES.includes(nextMeta.type)) continue;
|
|
1577
1689
|
if (!nextRow || !canEditCell(nextMeta, nextRow.original)) continue;
|
|
1690
|
+
if (editingDraft !== void 0) commitCell(rowId, colId, editingDraft);
|
|
1578
1691
|
setEditingCellId(cellEditId(allRows[nextRowIdx], allCols[nextColIdx]));
|
|
1692
|
+
setSelectedCellId(null);
|
|
1693
|
+
setRangeAnchor(null);
|
|
1694
|
+
setRangeFocus(null);
|
|
1579
1695
|
return;
|
|
1580
1696
|
}
|
|
1581
1697
|
};
|
|
1582
|
-
return
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1698
|
+
return (
|
|
1699
|
+
// 2026-07-05 D4 fix:key={cellId} 強制 per-cell remount — 相鄰同型欄位 Tab 過去時
|
|
1700
|
+
// uncontrolled Input / NumberCell localValue 原封不動(上一格的字跑到下一格)。
|
|
1701
|
+
// 對齊 cell-registry「mode-keyed remount canonical」(per-cell edit session 是不同 mount cycle)。
|
|
1702
|
+
/* @__PURE__ */ jsx("div", { onKeyDownCapture: handleEditTab, style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsx(
|
|
1703
|
+
Cell,
|
|
1704
|
+
{
|
|
1705
|
+
value,
|
|
1706
|
+
meta,
|
|
1707
|
+
mode: "edit",
|
|
1708
|
+
size,
|
|
1709
|
+
autoRowHeight: false,
|
|
1710
|
+
isEditable: cellEditable,
|
|
1711
|
+
onCommit: (next) => commitCell(rowId, colId, next),
|
|
1712
|
+
onCommitLive: (next) => onCellCommit == null ? void 0 : onCellCommit(rowId, colId, next),
|
|
1713
|
+
onCancel: () => cancelCellEdit(rowId, colId),
|
|
1714
|
+
onDraft: setEditingDraft
|
|
1715
|
+
}
|
|
1716
|
+
) }, cellId)
|
|
1717
|
+
);
|
|
1597
1718
|
} : void 0,
|
|
1598
1719
|
selectedCellId: spreadsheetMode ? selectedCellId : null,
|
|
1599
1720
|
rangeCellIds,
|
|
@@ -1729,7 +1850,7 @@ function DataTableInner({
|
|
|
1729
1850
|
setDropIndicator(null);
|
|
1730
1851
|
return;
|
|
1731
1852
|
}
|
|
1732
|
-
|
|
1853
|
+
setDropIndicatorIfChanged({ id: String(over.id), side, type: "column" });
|
|
1733
1854
|
} else {
|
|
1734
1855
|
const activeIdx = allRowIds.indexOf(String(active.id));
|
|
1735
1856
|
const overIdx = allRowIds.indexOf(String(over.id));
|
|
@@ -1742,9 +1863,9 @@ function DataTableInner({
|
|
|
1742
1863
|
setDropIndicator(null);
|
|
1743
1864
|
return;
|
|
1744
1865
|
}
|
|
1745
|
-
|
|
1866
|
+
setDropIndicatorIfChanged({ id: String(over.id), side, type: "row" });
|
|
1746
1867
|
}
|
|
1747
|
-
}, [allRowIds, isReorderNoop]);
|
|
1868
|
+
}, [allRowIds, isReorderNoop, setDropIndicatorIfChanged]);
|
|
1748
1869
|
const handleDragCancel = React.useCallback(() => {
|
|
1749
1870
|
setActiveDragId(null);
|
|
1750
1871
|
setActiveDragColId(null);
|
|
@@ -1759,7 +1880,7 @@ function DataTableInner({
|
|
|
1759
1880
|
const meta = (_a2 = table.getColumn(id)) == null ? void 0 : _a2.columnDef.meta;
|
|
1760
1881
|
return !(meta == null ? void 0 : meta.locked);
|
|
1761
1882
|
});
|
|
1762
|
-
}, [table, columnsWithSelection, (_c = tableOptions == null ? void 0 : tableOptions.state) == null ? void 0 : _c.columnOrder]);
|
|
1883
|
+
}, [table, columnsWithSelection, (_c = tableOptions == null ? void 0 : tableOptions.state) == null ? void 0 : _c.columnOrder, columnVisibility]);
|
|
1763
1884
|
React.useEffect(() => {
|
|
1764
1885
|
reorderableColumnIdsRef.current = reorderableColumnIds;
|
|
1765
1886
|
}, [reorderableColumnIds]);
|
|
@@ -1818,6 +1939,33 @@ function DataTableInner({
|
|
|
1818
1939
|
}
|
|
1819
1940
|
return sameParentCollisionDetection(args);
|
|
1820
1941
|
}, [sameParentCollisionDetection]);
|
|
1942
|
+
const totalRowCount = paginationEnabled ? table.getPrePaginationRowModel().rows.length : 0;
|
|
1943
|
+
const paginationBar = paginationEnabled && !isEmpty ? (
|
|
1944
|
+
// 無條件 justify-end(2026-07-07 C16:原 paginationHasExtras 判斷式 = 平行重複 Pagination
|
|
1945
|
+
// 內部 hasExtras 拼寫,未來加 extra 必 drift)——完整形態 Pagination 自帶 w-full
|
|
1946
|
+
// justify-between,justify-end 對其為 no-op;純頁碼形態靠右 = 拍板 #6(shadcn justify-end /
|
|
1947
|
+
// Ant Table bottomEnd / MUI / Carbon 4 家)。ref 供 isFillHeight bodyMaxHeight 扣 bar 高(C12)。
|
|
1948
|
+
/* @__PURE__ */ jsx("div", { ref: paginationBarRef, className: "flex justify-end", children: /* @__PURE__ */ jsx(
|
|
1949
|
+
Pagination,
|
|
1950
|
+
{
|
|
1951
|
+
total: totalRowCount,
|
|
1952
|
+
page: currentPage,
|
|
1953
|
+
onPageChange: setCurrentPage,
|
|
1954
|
+
pageSize: pageSizeState,
|
|
1955
|
+
onPageSizeChange: (next) => {
|
|
1956
|
+
var _a2;
|
|
1957
|
+
setPageSizeState(next);
|
|
1958
|
+
(_a2 = paginationOpts == null ? void 0 : paginationOpts.onPageSizeChange) == null ? void 0 : _a2.call(paginationOpts, next);
|
|
1959
|
+
},
|
|
1960
|
+
showTotal: paginationOpts == null ? void 0 : paginationOpts.showTotal,
|
|
1961
|
+
pageSizeOptions: paginationOpts == null ? void 0 : paginationOpts.pageSizeOptions
|
|
1962
|
+
}
|
|
1963
|
+
) })
|
|
1964
|
+
) : null;
|
|
1965
|
+
const composedContent = paginationBar ? /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-[var(--layout-space-tight)]", isFillHeight && "h-full min-h-0"), children: [
|
|
1966
|
+
tableContent,
|
|
1967
|
+
paginationBar
|
|
1968
|
+
] }) : tableContent;
|
|
1821
1969
|
const wrapWithDnd = (node) => {
|
|
1822
1970
|
if (!enableRowDrag && !enableColumnReorder) return node;
|
|
1823
1971
|
return /* @__PURE__ */ jsxs(
|
|
@@ -1851,11 +1999,11 @@ function DataTableInner({
|
|
|
1851
1999
|
{
|
|
1852
2000
|
value: selection.mode === "include" ? selection.ids[0] ?? "" : "",
|
|
1853
2001
|
onValueChange: (v) => v && setSelection({ mode: "include", ids: [v] }),
|
|
1854
|
-
children: wrapWithDnd(
|
|
2002
|
+
children: wrapWithDnd(composedContent)
|
|
1855
2003
|
}
|
|
1856
2004
|
);
|
|
1857
2005
|
}
|
|
1858
|
-
return wrapWithDnd(
|
|
2006
|
+
return wrapWithDnd(composedContent);
|
|
1859
2007
|
}
|
|
1860
2008
|
const DataTable = React.forwardRef(DataTableInner);
|
|
1861
2009
|
DataTable.displayName = "DataTable";
|
|
@@ -1865,7 +2013,9 @@ const dataTableMeta = {
|
|
|
1865
2013
|
// non-family composite / overlay / layout
|
|
1866
2014
|
variants: {},
|
|
1867
2015
|
sizes: {},
|
|
1868
|
-
|
|
2016
|
+
// 'active' 移除 — 全檔無 Tailwind 按壓 utility(rg `active:` 僅命中 dnd-kit `e.active` 物件),
|
|
2017
|
+
// 無按壓專屬視覺態;row action / drag handle 的按壓屬內嵌 Button meta(2026-07-07 對抗稽核補修)。
|
|
2018
|
+
states: ["default", "hover", "focus-visible", "disabled"],
|
|
1869
2019
|
tokens: {
|
|
1870
2020
|
bg: ["bg-muted", "bg-neutral-hover", "bg-surface"],
|
|
1871
2021
|
fg: ["text-fg-muted", "text-fg-secondary", "text-foreground"],
|