@exxatdesignux/ui 0.2.19 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +60 -7
- package/bin/sync-extras.mjs +116 -29
- package/consumer-extras/README.md +42 -7
- package/consumer-extras/cursor-rules/exxat-accessibility.mdc +39 -0
- package/consumer-extras/cursor-rules/exxat-board-cards.mdc +26 -0
- package/consumer-extras/cursor-rules/exxat-breadcrumbs-no-back.mdc +21 -0
- package/consumer-extras/cursor-rules/exxat-card-vs-list-rows.mdc +21 -0
- package/consumer-extras/cursor-rules/exxat-centralized-list-dataset.mdc +44 -0
- package/consumer-extras/cursor-rules/exxat-collaboration-access.mdc +32 -0
- package/consumer-extras/cursor-rules/exxat-command-menu.mdc +22 -0
- package/consumer-extras/cursor-rules/exxat-dashboard-view-charts.mdc +53 -0
- package/consumer-extras/cursor-rules/exxat-data-tables.mdc +41 -0
- package/consumer-extras/cursor-rules/exxat-dedicated-search-surfaces.mdc +25 -0
- package/consumer-extras/cursor-rules/exxat-drawer-vs-dialog.mdc +22 -0
- package/consumer-extras/cursor-rules/exxat-ds-agents.mdc +56 -0
- package/consumer-extras/cursor-rules/exxat-fontawesome-icons.mdc +31 -0
- package/consumer-extras/cursor-rules/exxat-kbd-shortcuts.mdc +100 -0
- package/consumer-extras/cursor-rules/exxat-kpi-flat-band.mdc +28 -0
- package/consumer-extras/cursor-rules/exxat-kpi-max-four.mdc +21 -0
- package/consumer-extras/cursor-rules/exxat-kpi-trends.mdc +31 -0
- package/consumer-extras/cursor-rules/exxat-list-page-connected-views.mdc +24 -0
- package/consumer-extras/cursor-rules/exxat-list-page-view-shells.mdc +31 -0
- package/consumer-extras/cursor-rules/exxat-mono-ids.mdc +30 -0
- package/consumer-extras/cursor-rules/exxat-no-slds-leakage.mdc +78 -0
- package/consumer-extras/cursor-rules/exxat-no-toast.mdc +25 -0
- package/consumer-extras/cursor-rules/exxat-page-vs-drawer.mdc +23 -0
- package/consumer-extras/cursor-rules/exxat-person-identity-display.mdc +47 -0
- package/consumer-extras/cursor-rules/exxat-primary-nav-secondary-panel.mdc +52 -0
- package/consumer-extras/cursor-rules/exxat-question-bank-hub-header.mdc +28 -0
- package/consumer-extras/cursor-rules/exxat-reuse-before-custom.mdc +34 -0
- package/consumer-extras/cursor-rules/exxat-table-properties-drawer.mdc +77 -0
- package/consumer-extras/cursor-rules/exxat-token-discipline.mdc +103 -0
- package/consumer-extras/cursor-skills/exxat-accessibility/SKILL.md +1 -1
- package/consumer-extras/cursor-skills/exxat-board-cards/SKILL.md +2 -2
- package/consumer-extras/cursor-skills/exxat-centralized-list-dataset/SKILL.md +4 -15
- package/consumer-extras/cursor-skills/exxat-ds-skill/SKILL.md +13 -28
- package/consumer-extras/cursor-skills/exxat-ds-skill/references/data-table-pattern.md +1 -1
- package/consumer-extras/cursor-skills/exxat-primary-nav-secondary-panel/SKILL.md +2 -4
- package/consumer-extras/handbook/HANDBOOK.md +185 -0
- package/consumer-extras/handbook/glossary.md +57 -0
- package/consumer-extras/handbook/reference-implementations.md +126 -0
- package/consumer-extras/handbook/voice-and-tone.md +262 -0
- package/consumer-extras/patterns/command-menu-pattern.md +1 -1
- package/consumer-extras/patterns/consumer-upgrade-checklist.md +0 -20
- package/consumer-extras/patterns/data-views-pattern.md +17 -54
- package/consumer-extras/patterns/shell-surface-elevation-pattern.md +3 -5
- package/dist/components/data-table/filter-date-calendar.d.ts +10 -0
- package/dist/components/data-table/filter-date-calendar.js +280 -0
- package/dist/components/data-table/filter-date-calendar.js.map +1 -0
- package/dist/components/data-table/filter-text-value-input.d.ts +15 -0
- package/dist/components/data-table/filter-text-value-input.js +561 -0
- package/dist/components/data-table/filter-text-value-input.js.map +1 -0
- package/dist/components/data-table/index.d.ts +45 -0
- package/dist/components/data-table/index.js +3085 -0
- package/dist/components/data-table/index.js.map +1 -0
- package/dist/components/data-table/pagination.d.ts +28 -0
- package/dist/components/data-table/pagination.js +3264 -0
- package/dist/components/data-table/pagination.js.map +1 -0
- package/dist/components/data-table/types.d.ts +84 -0
- package/dist/components/data-table/types.js +3 -0
- package/dist/components/data-table/types.js.map +1 -0
- package/dist/components/data-table/use-table-state.d.ts +116 -0
- package/dist/components/data-table/use-table-state.js +670 -0
- package/dist/components/data-table/use-table-state.js.map +1 -0
- package/dist/components/data-views/board-card-primitives.d.ts +22 -0
- package/dist/components/data-views/board-card-primitives.js +84 -0
- package/dist/components/data-views/board-card-primitives.js.map +1 -0
- package/dist/components/data-views/data-row-list.d.ts +33 -0
- package/dist/components/data-views/data-row-list.js +106 -0
- package/dist/components/data-views/data-row-list.js.map +1 -0
- package/dist/components/data-views/finder-panel-view.d.ts +54 -0
- package/dist/components/data-views/finder-panel-view.js +388 -0
- package/dist/components/data-views/finder-panel-view.js.map +1 -0
- package/dist/components/data-views/folder-grid-view.d.ts +22 -0
- package/dist/components/data-views/folder-grid-view.js +58 -0
- package/dist/components/data-views/folder-grid-view.js.map +1 -0
- package/dist/components/data-views/hub-table.d.ts +167 -0
- package/dist/components/data-views/hub-table.js +5561 -0
- package/dist/components/data-views/hub-table.js.map +1 -0
- package/dist/components/data-views/index.d.ts +27 -0
- package/dist/components/data-views/index.js +6575 -0
- package/dist/components/data-views/index.js.map +1 -0
- package/dist/components/data-views/list-page-board-card.d.ts +72 -0
- package/dist/components/data-views/list-page-board-card.js +264 -0
- package/dist/components/data-views/list-page-board-card.js.map +1 -0
- package/dist/components/data-views/list-page-board-template.d.ts +24 -0
- package/dist/components/data-views/list-page-board-template.js +137 -0
- package/dist/components/data-views/list-page-board-template.js.map +1 -0
- package/dist/components/data-views/list-page-connected-view-body.d.ts +19 -0
- package/dist/components/data-views/list-page-connected-view-body.js +116 -0
- package/dist/components/data-views/list-page-connected-view-body.js.map +1 -0
- package/dist/components/data-views/list-page-split-details-placeholder.d.ts +14 -0
- package/dist/components/data-views/list-page-split-details-placeholder.js +38 -0
- package/dist/components/data-views/list-page-split-details-placeholder.js.map +1 -0
- package/dist/components/data-views/list-page-split-hub-chrome.d.ts +17 -0
- package/dist/components/data-views/list-page-split-hub-chrome.js +54 -0
- package/dist/components/data-views/list-page-split-hub-chrome.js.map +1 -0
- package/dist/components/data-views/list-page-split-hub-tokens.d.ts +12 -0
- package/dist/components/data-views/list-page-split-hub-tokens.js +8 -0
- package/dist/components/data-views/list-page-split-hub-tokens.js.map +1 -0
- package/dist/components/data-views/list-page-tree-column-header.d.ts +15 -0
- package/dist/components/data-views/list-page-tree-column-header.js +22 -0
- package/dist/components/data-views/list-page-tree-column-header.js.map +1 -0
- package/dist/components/data-views/list-page-tree-panel-shell.d.ts +25 -0
- package/dist/components/data-views/list-page-tree-panel-shell.js +146 -0
- package/dist/components/data-views/list-page-tree-panel-shell.js.map +1 -0
- package/dist/components/data-views/os-folder-glyph.d.ts +35 -0
- package/dist/components/data-views/os-folder-glyph.js +104 -0
- package/dist/components/data-views/os-folder-glyph.js.map +1 -0
- package/dist/components/data-views/outline-tree-menu.d.ts +36 -0
- package/dist/components/data-views/outline-tree-menu.js +131 -0
- package/dist/components/data-views/outline-tree-menu.js.map +1 -0
- package/dist/components/table-properties/column-row.d.ts +22 -0
- package/dist/components/table-properties/column-row.js +153 -0
- package/dist/components/table-properties/column-row.js.map +1 -0
- package/dist/components/table-properties/draggable-list.d.ts +24 -0
- package/dist/components/table-properties/draggable-list.js +53 -0
- package/dist/components/table-properties/draggable-list.js.map +1 -0
- package/dist/components/table-properties/drawer-button.d.ts +110 -0
- package/dist/components/table-properties/drawer-button.js +2748 -0
- package/dist/components/table-properties/drawer-button.js.map +1 -0
- package/dist/components/table-properties/drawer.d.ts +100 -0
- package/dist/components/table-properties/drawer.js +2595 -0
- package/dist/components/table-properties/drawer.js.map +1 -0
- package/dist/components/table-properties/filter-card.d.ts +24 -0
- package/dist/components/table-properties/filter-card.js +854 -0
- package/dist/components/table-properties/filter-card.js.map +1 -0
- package/dist/components/table-properties/index.d.ts +14 -0
- package/dist/components/table-properties/index.js +2768 -0
- package/dist/components/table-properties/index.js.map +1 -0
- package/dist/components/table-properties/sort-card.d.ts +20 -0
- package/dist/components/table-properties/sort-card.js +102 -0
- package/dist/components/table-properties/sort-card.js.map +1 -0
- package/dist/components/templates/dedicated-search-landing-template.d.ts +21 -0
- package/dist/components/templates/dedicated-search-landing-template.js +254 -0
- package/dist/components/templates/dedicated-search-landing-template.js.map +1 -0
- package/dist/components/templates/dedicated-search-results-template.d.ts +15 -0
- package/dist/components/templates/dedicated-search-results-template.js +16 -0
- package/dist/components/templates/dedicated-search-results-template.js.map +1 -0
- package/dist/components/templates/index.d.ts +9 -0
- package/dist/components/templates/index.js +2720 -0
- package/dist/components/templates/index.js.map +1 -0
- package/dist/components/templates/list-page.d.ts +83 -0
- package/dist/components/templates/list-page.js +2433 -0
- package/dist/components/templates/list-page.js.map +1 -0
- package/dist/components/templates/nested-secondary-panel-shell.d.ts +20 -0
- package/dist/components/templates/nested-secondary-panel-shell.js +54 -0
- package/dist/components/templates/nested-secondary-panel-shell.js.map +1 -0
- package/dist/components/ui/accordion.d.ts +10 -0
- package/dist/components/ui/accordion.js +74 -0
- package/dist/components/ui/accordion.js.map +1 -0
- package/dist/components/ui/alert-dialog.d.ts +37 -0
- package/dist/components/ui/alert-dialog.js +201 -0
- package/dist/components/ui/alert-dialog.js.map +1 -0
- package/dist/components/ui/avatar.d.ts +84 -0
- package/dist/components/ui/avatar.js +328 -0
- package/dist/components/ui/avatar.js.map +1 -0
- package/dist/components/ui/badge.d.ts +13 -0
- package/dist/components/ui/badge.js +49 -0
- package/dist/components/ui/badge.js.map +1 -0
- package/dist/components/ui/banner.d.ts +62 -0
- package/dist/components/ui/banner.js +364 -0
- package/dist/components/ui/banner.js.map +1 -0
- package/dist/components/ui/breadcrumb.d.ts +14 -0
- package/dist/components/ui/breadcrumb.js +114 -0
- package/dist/components/ui/breadcrumb.js.map +1 -0
- package/dist/components/ui/button.d.ts +16 -0
- package/dist/components/ui/button.js +59 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/calendar.d.ts +13 -0
- package/dist/components/ui/calendar.js +238 -0
- package/dist/components/ui/calendar.js.map +1 -0
- package/dist/components/ui/card.d.ts +14 -0
- package/dist/components/ui/card.js +102 -0
- package/dist/components/ui/card.js.map +1 -0
- package/dist/components/ui/chart.d.ts +58 -0
- package/dist/components/ui/chart.js +292 -0
- package/dist/components/ui/chart.js.map +1 -0
- package/dist/components/ui/checkbox.d.ts +23 -0
- package/dist/components/ui/checkbox.js +155 -0
- package/dist/components/ui/checkbox.js.map +1 -0
- package/dist/components/ui/coach-mark.d.ts +27 -0
- package/dist/components/ui/coach-mark.js +306 -0
- package/dist/components/ui/coach-mark.js.map +1 -0
- package/dist/components/ui/collapsible.d.ts +8 -0
- package/dist/components/ui/collapsible.js +35 -0
- package/dist/components/ui/collapsible.js.map +1 -0
- package/dist/components/ui/command.d.ts +36 -0
- package/dist/components/ui/command.js +274 -0
- package/dist/components/ui/command.js.map +1 -0
- package/dist/components/ui/context-menu.d.ts +32 -0
- package/dist/components/ui/context-menu.js +245 -0
- package/dist/components/ui/context-menu.js.map +1 -0
- package/dist/components/ui/date-picker-field.d.ts +38 -0
- package/dist/components/ui/date-picker-field.js +550 -0
- package/dist/components/ui/date-picker-field.js.map +1 -0
- package/dist/components/ui/dialog.d.ts +22 -0
- package/dist/components/ui/dialog.js +200 -0
- package/dist/components/ui/dialog.js.map +1 -0
- package/dist/components/ui/dot-pattern.d.ts +21 -0
- package/dist/components/ui/dot-pattern.js +139 -0
- package/dist/components/ui/dot-pattern.js.map +1 -0
- package/dist/components/ui/drag-handle-grip.d.ts +10 -0
- package/dist/components/ui/drag-handle-grip.js +15 -0
- package/dist/components/ui/drag-handle-grip.js.map +1 -0
- package/dist/components/ui/drawer.d.ts +16 -0
- package/dist/components/ui/drawer.js +125 -0
- package/dist/components/ui/drawer.js.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +45 -0
- package/dist/components/ui/dropdown-menu.js +353 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -0
- package/dist/components/ui/export-drawer.d.ts +11 -0
- package/dist/components/ui/export-drawer.js +1658 -0
- package/dist/components/ui/export-drawer.js.map +1 -0
- package/dist/components/ui/field.d.ts +30 -0
- package/dist/components/ui/field.js +249 -0
- package/dist/components/ui/field.js.map +1 -0
- package/dist/components/ui/form.d.ts +28 -0
- package/dist/components/ui/form.js +110 -0
- package/dist/components/ui/form.js.map +1 -0
- package/dist/components/ui/hover-card.d.ts +9 -0
- package/dist/components/ui/hover-card.js +43 -0
- package/dist/components/ui/hover-card.js.map +1 -0
- package/dist/components/ui/input-group.d.ts +20 -0
- package/dist/components/ui/input-group.js +219 -0
- package/dist/components/ui/input-group.js.map +1 -0
- package/dist/components/ui/input-mask.d.ts +39 -0
- package/dist/components/ui/input-mask.js +118 -0
- package/dist/components/ui/input-mask.js.map +1 -0
- package/dist/components/ui/input.d.ts +5 -0
- package/dist/components/ui/input.js +30 -0
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/kbd.d.ts +20 -0
- package/dist/components/ui/kbd.js +45 -0
- package/dist/components/ui/kbd.js.map +1 -0
- package/dist/components/ui/key-metrics-context.d.ts +19 -0
- package/dist/components/ui/key-metrics-context.js +26 -0
- package/dist/components/ui/key-metrics-context.js.map +1 -0
- package/dist/components/ui/key-metrics.d.ts +131 -0
- package/dist/components/ui/key-metrics.js +1015 -0
- package/dist/components/ui/key-metrics.js.map +1 -0
- package/dist/components/ui/label.d.ts +6 -0
- package/dist/components/ui/label.js +28 -0
- package/dist/components/ui/label.js.map +1 -0
- package/dist/components/ui/list-page-view-frame.d.ts +22 -0
- package/dist/components/ui/list-page-view-frame.js +24 -0
- package/dist/components/ui/list-page-view-frame.js.map +1 -0
- package/dist/components/ui/page-header.d.ts +51 -0
- package/dist/components/ui/page-header.js +372 -0
- package/dist/components/ui/page-header.js.map +1 -0
- package/dist/components/ui/payment-card-fields.d.ts +10 -0
- package/dist/components/ui/payment-card-fields.js +80 -0
- package/dist/components/ui/payment-card-fields.js.map +1 -0
- package/dist/components/ui/popover.d.ts +10 -0
- package/dist/components/ui/popover.js +47 -0
- package/dist/components/ui/popover.js.map +1 -0
- package/dist/components/ui/radio-group.d.ts +29 -0
- package/dist/components/ui/radio-group.js +190 -0
- package/dist/components/ui/radio-group.js.map +1 -0
- package/dist/components/ui/resizable.d.ts +16 -0
- package/dist/components/ui/resizable.js +51 -0
- package/dist/components/ui/resizable.js.map +1 -0
- package/dist/components/ui/scroll-area.d.ts +8 -0
- package/dist/components/ui/scroll-area.js +66 -0
- package/dist/components/ui/scroll-area.js.map +1 -0
- package/dist/components/ui/select.d.ts +18 -0
- package/dist/components/ui/select.js +186 -0
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/selection-tile-grid.d.ts +52 -0
- package/dist/components/ui/selection-tile-grid.js +347 -0
- package/dist/components/ui/selection-tile-grid.js.map +1 -0
- package/dist/components/ui/separator.d.ts +7 -0
- package/dist/components/ui/separator.js +33 -0
- package/dist/components/ui/separator.js.map +1 -0
- package/dist/components/ui/sheet.d.ts +18 -0
- package/dist/components/ui/sheet.js +181 -0
- package/dist/components/ui/sheet.js.map +1 -0
- package/dist/components/ui/sidebar.d.ts +94 -0
- package/dist/components/ui/sidebar.js +805 -0
- package/dist/components/ui/sidebar.js.map +1 -0
- package/dist/components/ui/skeleton.d.ts +5 -0
- package/dist/components/ui/skeleton.js +22 -0
- package/dist/components/ui/skeleton.js.map +1 -0
- package/dist/components/ui/slider.d.ts +7 -0
- package/dist/components/ui/slider.js +66 -0
- package/dist/components/ui/slider.js.map +1 -0
- package/dist/components/ui/sonner.d.ts +6 -0
- package/dist/components/ui/sonner.js +38 -0
- package/dist/components/ui/sonner.js.map +1 -0
- package/dist/components/ui/status-badge.d.ts +38 -0
- package/dist/components/ui/status-badge.js +77 -0
- package/dist/components/ui/status-badge.js.map +1 -0
- package/dist/components/ui/table.d.ts +13 -0
- package/dist/components/ui/table.js +115 -0
- package/dist/components/ui/table.js.map +1 -0
- package/dist/components/ui/tabs.d.ts +15 -0
- package/dist/components/ui/tabs.js +93 -0
- package/dist/components/ui/tabs.js.map +1 -0
- package/dist/components/ui/textarea.d.ts +6 -0
- package/dist/components/ui/textarea.js +25 -0
- package/dist/components/ui/textarea.js.map +1 -0
- package/dist/components/ui/tip.d.ts +12 -0
- package/dist/components/ui/tip.js +61 -0
- package/dist/components/ui/tip.js.map +1 -0
- package/dist/components/ui/toggle-group.d.ts +14 -0
- package/dist/components/ui/toggle-group.js +104 -0
- package/dist/components/ui/toggle-group.js.map +1 -0
- package/dist/components/ui/toggle-switch.d.ts +10 -0
- package/dist/components/ui/toggle-switch.js +33 -0
- package/dist/components/ui/toggle-switch.js.map +1 -0
- package/dist/components/ui/toggle.d.ts +13 -0
- package/dist/components/ui/toggle.js +51 -0
- package/dist/components/ui/toggle.js.map +1 -0
- package/dist/components/ui/tooltip.d.ts +10 -0
- package/dist/components/ui/tooltip.js +68 -0
- package/dist/components/ui/tooltip.js.map +1 -0
- package/dist/components/ui/view-segmented-control.d.ts +31 -0
- package/dist/components/ui/view-segmented-control.js +167 -0
- package/dist/components/ui/view-segmented-control.js.map +1 -0
- package/dist/data-list-view-registry-CyBoBML4.d.ts +73 -0
- package/dist/hooks/use-app-theme.d.ts +24 -0
- package/dist/hooks/use-app-theme.js +286 -0
- package/dist/hooks/use-app-theme.js.map +1 -0
- package/dist/hooks/use-coach-mark.d.ts +86 -0
- package/dist/hooks/use-coach-mark.js +218 -0
- package/dist/hooks/use-coach-mark.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +3 -0
- package/dist/hooks/use-mobile.js +29 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/hooks/use-mod-key-label.d.ts +6 -0
- package/dist/hooks/use-mod-key-label.js +25 -0
- package/dist/hooks/use-mod-key-label.js.map +1 -0
- package/dist/index.d.ts +120 -0
- package/dist/index.js +13324 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/compose-refs.d.ts +6 -0
- package/dist/lib/compose-refs.js +17 -0
- package/dist/lib/compose-refs.js.map +1 -0
- package/dist/lib/conditional-rule-match.d.ts +30 -0
- package/dist/lib/conditional-rule-match.js +66 -0
- package/dist/lib/conditional-rule-match.js.map +1 -0
- package/dist/lib/data-list-display-options.d.ts +26 -0
- package/dist/lib/data-list-display-options.js +14 -0
- package/dist/lib/data-list-display-options.js.map +1 -0
- package/dist/lib/data-list-view-registry.d.ts +2 -0
- package/dist/lib/data-list-view-registry.js +102 -0
- package/dist/lib/data-list-view-registry.js.map +1 -0
- package/dist/lib/data-list-view-surface.d.ts +2 -0
- package/dist/lib/data-list-view-surface.js +80 -0
- package/dist/lib/data-list-view-surface.js.map +1 -0
- package/dist/lib/data-list-view.d.ts +21 -0
- package/dist/lib/data-list-view.js +25 -0
- package/dist/lib/data-list-view.js.map +1 -0
- package/dist/lib/date-filter.d.ts +22 -0
- package/dist/lib/date-filter.js +61 -0
- package/dist/lib/date-filter.js.map +1 -0
- package/dist/lib/dev-log.d.ts +8 -0
- package/dist/lib/dev-log.js +10 -0
- package/dist/lib/dev-log.js.map +1 -0
- package/dist/lib/dropdown-menu-surface.d.ts +14 -0
- package/dist/lib/dropdown-menu-surface.js +6 -0
- package/dist/lib/dropdown-menu-surface.js.map +1 -0
- package/dist/lib/editable-target.d.ts +12 -0
- package/dist/lib/editable-target.js +12 -0
- package/dist/lib/editable-target.js.map +1 -0
- package/dist/lib/list-page-table-properties.d.ts +35 -0
- package/dist/lib/list-page-table-properties.js +81 -0
- package/dist/lib/list-page-table-properties.js.map +1 -0
- package/dist/lib/raf-throttle.d.ts +23 -0
- package/dist/lib/raf-throttle.js +27 -0
- package/dist/lib/raf-throttle.js.map +1 -0
- package/dist/lib/row-height.d.ts +16 -0
- package/dist/lib/row-height.js +10 -0
- package/dist/lib/row-height.js.map +1 -0
- package/dist/lib/table-properties-types.d.ts +83 -0
- package/dist/lib/table-properties-types.js +19 -0
- package/dist/lib/table-properties-types.js.map +1 -0
- package/dist/lib/utils.d.ts +5 -0
- package/dist/lib/utils.js +11 -0
- package/dist/lib/utils.js.map +1 -0
- package/package.json +83 -19
- package/src/components/data-table/filter-date-calendar.tsx +38 -0
- package/src/components/data-table/filter-text-value-input.tsx +77 -0
- package/src/components/data-table/index.tsx +1678 -0
- package/src/components/data-table/pagination.tsx +255 -0
- package/src/components/data-table/types.ts +96 -0
- package/src/components/data-table/use-table-state.ts +767 -0
- package/src/components/data-views/board-card-primitives.tsx +93 -0
- package/src/components/data-views/data-row-list.tsx +183 -0
- package/src/components/data-views/finder-panel-view.tsx +405 -0
- package/src/components/data-views/folder-grid-view.tsx +86 -0
- package/src/components/data-views/hub-table.tsx +498 -0
- package/src/components/data-views/index.ts +28 -0
- package/src/components/data-views/list-page-board-card.tsx +192 -0
- package/src/components/data-views/list-page-board-template.tsx +122 -0
- package/src/components/data-views/list-page-connected-view-body.tsx +66 -0
- package/src/components/data-views/list-page-split-details-placeholder.tsx +39 -0
- package/src/components/data-views/list-page-split-hub-chrome.tsx +60 -0
- package/src/components/data-views/list-page-split-hub-tokens.ts +16 -0
- package/src/components/data-views/list-page-tree-column-header.tsx +31 -0
- package/src/components/data-views/list-page-tree-panel-shell.tsx +91 -0
- package/src/components/data-views/os-folder-glyph.tsx +141 -0
- package/src/components/data-views/outline-tree-menu.tsx +157 -0
- package/src/components/table-properties/column-row.tsx +90 -0
- package/src/components/table-properties/draggable-list.ts +54 -0
- package/src/components/table-properties/drawer-button.tsx +300 -0
- package/src/components/table-properties/drawer.tsx +1148 -0
- package/src/components/table-properties/filter-card.tsx +251 -0
- package/src/components/table-properties/index.ts +36 -0
- package/src/components/table-properties/sort-card.tsx +63 -0
- package/src/components/templates/dedicated-search-landing-template.tsx +124 -0
- package/src/components/templates/dedicated-search-results-template.tsx +19 -0
- package/src/components/templates/index.ts +33 -0
- package/src/components/templates/list-page.tsx +602 -0
- package/src/components/templates/nested-secondary-panel-shell.tsx +70 -0
- package/src/components/ui/accordion.tsx +92 -0
- package/src/components/ui/alert-dialog.tsx +221 -0
- package/src/components/ui/avatar.tsx +13 -2
- package/src/components/ui/banner.tsx +2 -2
- package/src/components/ui/button.tsx +4 -4
- package/src/components/ui/calendar.tsx +1 -1
- package/src/components/ui/coach-mark.tsx +1 -1
- package/src/components/ui/context-menu.tsx +291 -0
- package/src/components/ui/date-picker-field.tsx +2 -2
- package/src/components/ui/dot-pattern.tsx +183 -0
- package/src/components/ui/export-drawer.tsx +375 -0
- package/src/components/ui/hover-card.tsx +66 -0
- package/src/components/ui/key-metrics-context.tsx +78 -0
- package/src/components/ui/key-metrics.tsx +1133 -0
- package/src/components/ui/list-page-view-frame.tsx +64 -0
- package/src/components/ui/page-header.tsx +244 -0
- package/src/components/ui/payment-card-fields.tsx +2 -2
- package/src/components/ui/resizable.tsx +68 -0
- package/src/components/ui/scroll-area.tsx +72 -0
- package/src/components/ui/selection-tile-grid.tsx +9 -2
- package/src/components/ui/sidebar.tsx +84 -12
- package/src/components/ui/slider.tsx +83 -0
- package/src/globals.css +2201 -7
- package/src/globals.d.ts +20 -0
- package/src/index.ts +68 -1
- package/src/lib/conditional-rule-match.ts +119 -0
- package/src/lib/data-list-display-options.ts +35 -0
- package/src/lib/data-list-view-registry.ts +104 -0
- package/src/lib/data-list-view-surface.ts +83 -0
- package/src/lib/data-list-view.ts +47 -0
- package/src/lib/dev-log.ts +10 -0
- package/src/lib/editable-target.ts +20 -0
- package/src/lib/list-page-table-properties.ts +48 -0
- package/src/lib/raf-throttle.ts +45 -0
- package/src/lib/row-height.ts +19 -0
- package/src/lib/table-properties-types.ts +98 -0
- package/template/.cursor/rules/exxat-command-menu.mdc +1 -1
- package/template/.cursor/rules/exxat-dashboard-view-charts.mdc +3 -3
- package/template/.cursor/rules/exxat-data-tables.mdc +1 -1
- package/template/.cursor/rules/exxat-ds-agents.mdc +2 -2
- package/template/.cursor/rules/exxat-kbd-shortcuts.mdc +2 -2
- package/template/.cursor/rules/exxat-table-properties-drawer.mdc +1 -1
- package/template/AGENTS.md +104 -78
- package/template/app/(app)/dashboard/loading.tsx +15 -3
- package/template/app/(app)/dashboard/page.tsx +14 -2
- package/template/app/(app)/examples/page.tsx +0 -2
- package/template/app/(app)/layout.tsx +17 -4
- package/template/app/(app)/loading.tsx +18 -1
- package/template/app/(app)/question-bank/find/page.tsx +1 -2
- package/template/app/(app)/question-bank/layout.tsx +1 -1
- package/template/app/(app)/question-bank/library/page.tsx +1 -2
- package/template/app/(app)/question-bank/list/page.tsx +1 -2
- package/template/app/(app)/question-bank/new/page.tsx +15 -20
- package/template/app/(app)/question-bank/page.tsx +1 -2
- package/template/app/(app)/settings/page.tsx +5 -4
- package/template/app/globals.css +14 -16
- package/template/components/ask-leo-sidebar.tsx +5 -1
- package/template/components/brand-color-picker.tsx +2 -2
- package/template/components/charts-overview.tsx +1 -1
- package/template/components/compliance-board-view.tsx +142 -0
- package/template/components/compliance-client.tsx +92 -0
- package/template/components/compliance-page-header.tsx +89 -0
- package/template/components/compliance-table.tsx +468 -0
- package/template/components/dashboard-report-charts.tsx +1 -1
- package/template/components/dashboard-tabs.tsx +1 -1
- package/template/components/data-table/filter-date-calendar.tsx +1 -38
- package/template/components/data-table/filter-text-value-input.tsx +1 -77
- package/template/components/data-table/index.tsx +1 -1634
- package/template/components/data-table/pagination.tsx +1 -255
- package/template/components/data-table/types.ts +1 -94
- package/template/components/data-table/use-table-state.test.ts +420 -0
- package/template/components/data-table/use-table-state.ts +1 -758
- package/template/components/data-view-dashboard-charts-compliance.tsx +963 -0
- package/template/components/data-view-dashboard-charts-team.tsx +971 -0
- package/template/components/data-view-dashboard-charts.tsx +1503 -0
- package/template/components/data-views/board-card-primitives.tsx +1 -93
- package/template/components/data-views/data-row-list.tsx +1 -183
- package/template/components/data-views/finder-panel-view.tsx +1 -405
- package/template/components/data-views/folder-grid-view.tsx +1 -86
- package/template/components/data-views/hub-table.tsx +1 -0
- package/template/components/data-views/index.ts +50 -37
- package/template/components/data-views/list-page-board-card.tsx +1 -192
- package/template/components/data-views/list-page-board-template.tsx +1 -122
- package/template/components/data-views/list-page-connected-view-body.tsx +1 -66
- package/template/components/data-views/list-page-split-details-placeholder.tsx +1 -39
- package/template/components/data-views/list-page-split-hub-chrome.tsx +1 -68
- package/template/components/data-views/list-page-split-hub-tokens.ts +1 -16
- package/template/components/data-views/list-page-tree-column-header.tsx +1 -31
- package/template/components/data-views/list-page-tree-panel-shell.tsx +1 -91
- package/template/components/data-views/list-page-view-frame.tsx +5 -53
- package/template/components/data-views/os-folder-glyph.tsx +1 -129
- package/template/components/data-views/outline-tree-menu.tsx +1 -157
- package/template/components/export-drawer.test.tsx +71 -0
- package/template/components/export-drawer.tsx +1 -375
- package/template/components/exxat-product-logo.tsx +5 -5
- package/template/components/hub-tree-panel-view.tsx +2 -2
- package/template/components/invite-collaborators-drawer.tsx +3 -3
- package/template/components/key-metrics-ask-leo-bridge.tsx +40 -0
- package/template/components/key-metrics.tsx +1 -1063
- package/template/components/leo-insight-indicator.tsx +2 -2
- package/template/components/new-placement-back-btn.tsx +28 -0
- package/template/components/new-placement-form.tsx +942 -0
- package/template/components/new-question-composer.tsx +456 -408
- package/template/components/onboarding/index.ts +9 -0
- package/template/components/onboarding/onboarding-01.tsx +1 -1
- package/template/components/onboarding/onboarding-02.tsx +1 -1
- package/template/components/onboarding/onboarding-03.tsx +1 -1
- package/template/components/onboarding/onboarding-04.tsx +1 -1
- package/template/components/page-header.tsx +8 -226
- package/template/components/placement-board-card.tsx +250 -0
- package/template/components/placement-detail.tsx +438 -0
- package/template/components/placements-board-view.tsx +397 -0
- package/template/components/placements-client.tsx +220 -0
- package/template/components/placements-list-view.tsx +124 -0
- package/template/components/placements-page-header.tsx +166 -0
- package/template/components/placements-table-cells.test.tsx +22 -0
- package/template/components/placements-table-cells.tsx +173 -0
- package/template/components/placements-table-columns.tsx +210 -0
- package/template/components/placements-table.tsx +934 -0
- package/template/components/product-switcher.tsx +3 -4
- package/template/components/product-wordmark.tsx +2 -1
- package/template/components/question-bank-client.tsx +5 -5
- package/template/components/question-bank-hub-client.tsx +1 -1
- package/template/components/question-bank-new-folder-sheet.tsx +2 -2
- package/template/components/question-bank-secondary-nav.tsx +3 -3
- package/template/components/question-bank-table.tsx +541 -431
- package/template/components/rotations-empty-state.tsx +50 -0
- package/template/components/rotations-panel-activator.tsx +8 -0
- package/template/components/settings-appearance-card.tsx +3 -4
- package/template/components/settings-client.tsx +15 -59
- package/template/components/settings-form-row.tsx +4 -9
- package/template/components/{app-sidebar-dynamic.tsx → sidebar/app-sidebar-dynamic.tsx} +1 -1
- package/template/components/{app-sidebar.tsx → sidebar/app-sidebar.tsx} +59 -74
- package/template/components/sidebar/index.ts +16 -0
- package/template/components/{secondary-nav.tsx → sidebar/secondary-nav.tsx} +2 -2
- package/template/components/{secondary-panel.tsx → sidebar/secondary-panel.tsx} +50 -7
- package/template/components/{sidebar-auto-collapse.tsx → sidebar/sidebar-auto-collapse.tsx} +6 -2
- package/template/components/{sidebar-shell.tsx → sidebar/sidebar-shell.tsx} +1 -1
- package/template/components/site-header.tsx +1 -1
- package/template/components/sites-board-view.tsx +67 -0
- package/template/components/sites-client.tsx +154 -0
- package/template/components/sites-table.tsx +249 -0
- package/template/components/table-properties/column-row.tsx +1 -90
- package/template/components/table-properties/draggable-list.ts +1 -49
- package/template/components/table-properties/drawer-button.tsx +1 -262
- package/template/components/table-properties/drawer.tsx +1 -1166
- package/template/components/table-properties/filter-card.tsx +1 -251
- package/template/components/table-properties/sort-card.tsx +1 -59
- package/template/components/table-properties/types.ts +28 -71
- package/template/components/team-board-view.tsx +122 -0
- package/template/components/team-client.tsx +100 -0
- package/template/components/team-page-header.tsx +92 -0
- package/template/components/team-table.tsx +553 -0
- package/template/components/templates/dedicated-search-landing-template.tsx +1 -124
- package/template/components/templates/dedicated-search-results-template.tsx +1 -19
- package/template/components/templates/list-page.tsx +1 -608
- package/template/components/templates/nested-secondary-panel-shell.tsx +1 -63
- package/template/components/templates/new-focus-template.tsx +659 -0
- package/template/components/templates/secondary-panel-hub-template.tsx +1 -1
- package/template/components/ui/accordion.tsx +1 -0
- package/template/components/ui/alert-dialog.tsx +1 -0
- package/template/components/ui/context-menu.tsx +1 -0
- package/template/components/ui/dot-pattern.tsx +1 -183
- package/template/components/ui/hover-card.tsx +1 -0
- package/template/components/ui/resizable.tsx +1 -68
- package/template/components/ui/scroll-area.tsx +1 -0
- package/template/components/ui/slider.tsx +1 -0
- package/template/docs/blueprints/README.md +86 -0
- package/template/docs/blueprints/_template.md +91 -0
- package/template/docs/blueprints/board-card.md +123 -0
- package/template/docs/blueprints/data-table.md +139 -0
- package/template/docs/blueprints/key-metrics.md +128 -0
- package/template/docs/blueprints/list-page-template.md +123 -0
- package/template/docs/blueprints/page-header.md +130 -0
- package/template/docs/command-menu-pattern.md +1 -1
- package/template/docs/component-selection-guide.md +224 -0
- package/template/docs/components-audit-2026-05.md +158 -0
- package/template/docs/data-views-pattern.md +17 -54
- package/template/docs/drawer-vs-dialog-pattern.md +1 -3
- package/template/docs/migrations/0001-brand-deep-alias-stabilization.md +95 -0
- package/template/docs/migrations/0002-exxat-token-namespace.md +154 -0
- package/template/docs/migrations/0003-globals-css-canonical.md +110 -0
- package/template/docs/migrations/README.md +100 -0
- package/template/docs/migrations/_template.md +64 -0
- package/template/docs/shell-surface-elevation-pattern.md +3 -5
- package/template/docs/token-taxonomy.md +416 -0
- package/template/eslint.config.mjs +27 -0
- package/template/hooks/use-secondary-panel-hub-nav.ts +1 -1
- package/template/lib/command-menu-config.ts +0 -1
- package/template/lib/command-menu-search-data.ts +27 -11
- package/template/lib/compliance-supported-views.ts +10 -0
- package/template/lib/conditional-rule-match.ts +6 -97
- package/template/lib/data-list-display-options.ts +1 -49
- package/template/lib/data-list-view-registry.ts +1 -104
- package/template/lib/data-list-view-surface.ts +1 -83
- package/template/lib/data-list-view.ts +1 -47
- package/template/lib/data-view-dashboard-placements-layout.ts +215 -0
- package/template/lib/data-view-dashboard-storage.ts +35 -38
- package/template/lib/dev-log.ts +1 -8
- package/template/lib/editable-target.ts +1 -10
- package/template/lib/list-page-table-properties.ts +1 -48
- package/template/lib/list-status-badges.ts +97 -4
- package/template/lib/mock/compliance-kpi.ts +61 -0
- package/template/lib/mock/compliance.ts +146 -0
- package/template/lib/mock/navigation.tsx +0 -9
- package/template/lib/mock/placements-kpi.ts +134 -0
- package/template/lib/mock/placements.ts +176 -0
- package/template/lib/mock/sites-directory.ts +16 -0
- package/template/lib/mock/sites-kpi.ts +25 -0
- package/template/lib/mock/team-kpi.ts +60 -0
- package/template/lib/mock/team.ts +118 -0
- package/template/lib/placement-board-card-layout.ts +79 -0
- package/template/lib/placements-supported-views.ts +12 -0
- package/template/lib/question-bank-supported-views.ts +0 -1
- package/template/lib/raf-throttle.ts +1 -45
- package/template/lib/row-height.ts +4 -10
- package/template/lib/sidebar-state-cookie.ts +11 -2
- package/template/lib/sites-supported-views.ts +10 -0
- package/template/lib/table-state-lifecycle.ts +2 -2
- package/template/lib/team-supported-views.ts +10 -0
- package/template/package.json +1 -0
- package/template/tests/setup.ts +25 -0
- package/consumer-extras/AGENTS.md +0 -76
- package/consumer-extras/cursor-skills/exxat-consumer-app/SKILL.md +0 -37
- package/consumer-extras/cursor-skills/exxat-focused-workflow-page/SKILL.md +0 -57
- package/consumer-extras/patterns/consumer-app-pattern.md +0 -39
- package/consumer-extras/patterns/focused-workflow-page-pattern.md +0 -84
- package/src/components/ui/button-group.tsx +0 -81
- package/src/theme.css +0 -16
- package/src/tokens/README.md +0 -15
- package/src/tokens/base.css +0 -337
- package/src/tokens/high-contrast.css +0 -1195
- package/src/tokens/layers.css +0 -224
- package/src/tokens/tailwind-bridge.css +0 -118
- package/src/tokens/themes.css +0 -201
- package/template/app/(app)/data-list/layout.tsx +0 -43
- package/template/app/(app)/data-list/page.tsx +0 -10
- package/template/app/(app)/examples/focused-workflow/page.tsx +0 -5
- package/template/components/app-route-loading.tsx +0 -14
- package/template/components/dashboard-onboarding-gallery.tsx +0 -13
- package/template/components/dashboard-onboarding.tsx +0 -21
- package/template/components/data-views/list-page-calendar-view.tsx +0 -593
- package/template/components/data-views/list-page-folder-columns-panel.tsx +0 -345
- package/template/components/examples/focused-workflow-showcase.tsx +0 -183
- package/template/components/list-hub-board-view.tsx +0 -68
- package/template/components/list-hub-client.tsx +0 -186
- package/template/components/list-hub-list-view.tsx +0 -36
- package/template/components/list-hub-panel-activator.tsx +0 -8
- package/template/components/list-hub-secondary-nav.tsx +0 -121
- package/template/components/list-hub-table.tsx +0 -336
- package/template/components/question-bank-folder-columns-panel.tsx +0 -104
- package/template/components/question-bank-list-view.tsx +0 -53
- package/template/components/secondary-panel/nav-link-rows.tsx +0 -83
- package/template/components/secondary-panels/list-hub-panel.tsx +0 -39
- package/template/components/secondary-panels/question-bank-panel.tsx +0 -39
- package/template/components/secondary-panels/registry.tsx +0 -15
- package/template/components/section-cards.tsx +0 -106
- package/template/components/templates/focused-workflow-layouts.tsx +0 -448
- package/template/components/templates/focused-workflow-page-template.tsx +0 -69
- package/template/components/templates/page-loading-shell.tsx +0 -262
- package/template/components/ui/button-group.tsx +0 -1
- package/template/docs/consumer-app-pattern.md +0 -39
- package/template/docs/focused-workflow-page-pattern.md +0 -84
- package/template/lib/list-hub-nav.ts +0 -121
- package/template/lib/mock/list-hub-directory.ts +0 -27
- package/template/lib/mock/list-hub-kpi.ts +0 -27
- package/template/lib/page-loading-variant.ts +0 -40
- /package/template/components/{getting-started.tsx → onboarding/getting-started.tsx} +0 -0
- /package/template/components/{nav-documents.tsx → sidebar/nav-documents.tsx} +0 -0
- /package/template/components/{nav-main.tsx → sidebar/nav-main.tsx} +0 -0
- /package/template/components/{nav-secondary.tsx → sidebar/nav-secondary.tsx} +0 -0
- /package/template/components/{nav-user.tsx → sidebar/nav-user.tsx} +0 -0
- /package/template/components/{sidebar-auto-open.tsx → sidebar/sidebar-auto-open.tsx} +0 -0
|
@@ -0,0 +1,934 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* PlacementsTable — placements hub composed on top of the centralized `<HubTable>`. Owns:
|
|
5
|
+
* placement-specific column defs / cells, board/list/folder/tree/panel/dashboard renderers,
|
|
6
|
+
* pagination chrome wrapping the table + list views, and the dashboard layout state.
|
|
7
|
+
*
|
|
8
|
+
* Single dataset rule: `HubTable` runs one `useTableState(rows, columns, …)`. Every renderer
|
|
9
|
+
* (board, list, folder, tree, panel, dashboard) reads `state.rows`/`state.pagedRows` — the same
|
|
10
|
+
* filtered/sorted/paged bag as the grid.
|
|
11
|
+
*
|
|
12
|
+
* View tabs drive `view` (table | list | board | …). One canonical column set + row bag —
|
|
13
|
+
* lifecycle segmentation has been removed; every tab sees the same placements.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import * as React from "react"
|
|
17
|
+
import dynamic from "next/dynamic"
|
|
18
|
+
import { useRouter } from "next/navigation"
|
|
19
|
+
import { cn } from "@/lib/utils"
|
|
20
|
+
import { mailtoHref } from "@/lib/mailto"
|
|
21
|
+
import { Button } from "@/components/ui/button"
|
|
22
|
+
import { Tip } from "@/components/ui/tip"
|
|
23
|
+
import { Skeleton } from "@/components/ui/skeleton"
|
|
24
|
+
import { AvatarInitials } from "@/components/ui/avatar"
|
|
25
|
+
import { CoachMark } from "@/components/ui/coach-mark"
|
|
26
|
+
import { useCoachMark } from "@/hooks/use-coach-mark"
|
|
27
|
+
import { DASHBOARD_CUSTOMIZE_COACH_STEPS } from "@/lib/dashboard-customize-coach-mark"
|
|
28
|
+
import { KEY_METRICS_KPI_COUNT_DEFAULT } from "@/lib/dashboard-layout-merge"
|
|
29
|
+
import {
|
|
30
|
+
ALL_DASHBOARD_CARDS,
|
|
31
|
+
DEFAULT_VISIBLE_CARDS,
|
|
32
|
+
DEFAULT_SPANS,
|
|
33
|
+
DEFAULT_CHART_TYPES,
|
|
34
|
+
loadDashboardLayout,
|
|
35
|
+
mergeDashboardLayout,
|
|
36
|
+
saveDashboardLayout,
|
|
37
|
+
type ChartType,
|
|
38
|
+
type DashboardLayout,
|
|
39
|
+
} from "@/lib/data-view-dashboard-placements-layout"
|
|
40
|
+
import { PlacementsBoardView, type PlacementsBoardColumnMenu } from "@/components/placements-board-view"
|
|
41
|
+
import {
|
|
42
|
+
PlacementListRowContent,
|
|
43
|
+
PLACEMENT_LIST_ESTIMATE_ROW_PX,
|
|
44
|
+
PLACEMENT_LIST_VIRTUAL_ROWS_THRESHOLD,
|
|
45
|
+
} from "@/components/placements-list-view"
|
|
46
|
+
import {
|
|
47
|
+
FolderGridView,
|
|
48
|
+
ListPageTreePanelShell,
|
|
49
|
+
HubTable,
|
|
50
|
+
type HubTableHandle,
|
|
51
|
+
type HubTableRenderers,
|
|
52
|
+
type HubTableRendererArgs,
|
|
53
|
+
} from "@/components/data-views"
|
|
54
|
+
import { DataRowList } from "@/components/data-views/data-row-list"
|
|
55
|
+
import { ListPageSplitHubChrome } from "@/components/data-views/list-page-split-hub-chrome"
|
|
56
|
+
import { ListPageTreeColumnHeader } from "@/components/data-views/list-page-tree-column-header"
|
|
57
|
+
import { FinderPanelView, type FinderGroup } from "@/components/data-views/finder-panel-view"
|
|
58
|
+
import { ListPageSplitDetailsPlaceholder } from "@/components/data-views/list-page-split-details-placeholder"
|
|
59
|
+
import { getConditionalRowBackground } from "@/lib/conditional-rule-match"
|
|
60
|
+
import { isBoardFieldActive } from "@/lib/placement-board-card-layout"
|
|
61
|
+
import { TablePropertiesDrawerButton } from "@/components/table-properties"
|
|
62
|
+
import type { DataListViewType } from "@/lib/data-list-view"
|
|
63
|
+
import {
|
|
64
|
+
DEFAULT_DATA_LIST_DISPLAY_OPTIONS,
|
|
65
|
+
type DataListDisplayOptions,
|
|
66
|
+
} from "@/lib/data-list-display-options"
|
|
67
|
+
import { StatusBadge } from "@/components/placements-table-cells"
|
|
68
|
+
import { DataTable, DataTableToolbar } from "@/components/data-table"
|
|
69
|
+
import { CountSyncer, PaginationBar } from "@/components/data-table/pagination"
|
|
70
|
+
import type { ColumnDef, ConditionalRule } from "@/components/data-table/types"
|
|
71
|
+
import { useTableState } from "@/components/data-table/use-table-state"
|
|
72
|
+
import { ALL_PLACEMENTS, type Placement, type Status } from "@/lib/mock/placements"
|
|
73
|
+
import {
|
|
74
|
+
getPlacementColumns,
|
|
75
|
+
PLACEMENT_DRAWER_LABEL,
|
|
76
|
+
PLACEMENT_EMPTY_COPY,
|
|
77
|
+
} from "@/components/placements-table-columns"
|
|
78
|
+
import { placementKpiInsightFromRows, placementKpiMetricsFromRows } from "@/lib/mock/placements-kpi"
|
|
79
|
+
import { PLACEMENTS_SUPPORTED_VIEWS } from "@/lib/placements-supported-views"
|
|
80
|
+
|
|
81
|
+
// ─── Dynamic dashboard charts section (heavy; loaded only on dashboard tab) ──
|
|
82
|
+
|
|
83
|
+
const PlacementsDashboardChartsSection = dynamic(
|
|
84
|
+
() =>
|
|
85
|
+
import("@/components/data-view-dashboard-charts").then(mod => ({
|
|
86
|
+
default: mod.PlacementsDashboardChartsSection,
|
|
87
|
+
})),
|
|
88
|
+
{
|
|
89
|
+
ssr: false,
|
|
90
|
+
loading: () => (
|
|
91
|
+
<div className="mx-4 mb-8 mt-2 flex flex-col gap-3 border border-border rounded-xl p-6 lg:mx-6">
|
|
92
|
+
<Skeleton className="h-7 w-48 max-w-full" />
|
|
93
|
+
<Skeleton className="min-h-[200px] w-full rounded-lg" />
|
|
94
|
+
<Skeleton className="min-h-[200px] w-full rounded-lg" />
|
|
95
|
+
</div>
|
|
96
|
+
),
|
|
97
|
+
},
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
// ─── Placement-specific tile for FolderGridView ──────────────────────────────
|
|
101
|
+
|
|
102
|
+
function PlacementFolderTile({
|
|
103
|
+
row,
|
|
104
|
+
hiddenColKeys,
|
|
105
|
+
boardColumns,
|
|
106
|
+
conditionalRules,
|
|
107
|
+
onClick,
|
|
108
|
+
}: {
|
|
109
|
+
row: Placement
|
|
110
|
+
hiddenColKeys: Set<string>
|
|
111
|
+
boardColumns: ColumnDef<Placement>[]
|
|
112
|
+
conditionalRules?: ConditionalRule[]
|
|
113
|
+
onClick: () => void
|
|
114
|
+
}) {
|
|
115
|
+
const ruleBg = getConditionalRowBackground(row, conditionalRules, boardColumns)
|
|
116
|
+
const showStudent = isBoardFieldActive("student", hiddenColKeys, boardColumns)
|
|
117
|
+
const showStatus = isBoardFieldActive("status", hiddenColKeys, boardColumns)
|
|
118
|
+
const showSite = isBoardFieldActive("site", hiddenColKeys, boardColumns)
|
|
119
|
+
const showSpec = isBoardFieldActive("specialization", hiddenColKeys, boardColumns)
|
|
120
|
+
const showProgram = isBoardFieldActive("program", hiddenColKeys, boardColumns)
|
|
121
|
+
const name = showStudent ? row.student : `Placement ${row.id}`
|
|
122
|
+
|
|
123
|
+
const statusDotClass: Record<Status, string> = {
|
|
124
|
+
confirmed: "bg-success",
|
|
125
|
+
pending: "bg-warning",
|
|
126
|
+
"under-review": "bg-brand",
|
|
127
|
+
completed: "bg-muted-foreground",
|
|
128
|
+
rejected: "bg-destructive",
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return (
|
|
132
|
+
<button
|
|
133
|
+
type="button"
|
|
134
|
+
onClick={onClick}
|
|
135
|
+
className={`group relative flex flex-col items-center gap-2 rounded-xl border border-border bg-card p-4 text-left hover:border-interactive-hover hover:bg-interactive-hover/30 hover:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-all duration-100 cursor-pointer select-none w-full ${ruleBg}`}
|
|
136
|
+
aria-label={`Open ${name}`}
|
|
137
|
+
>
|
|
138
|
+
<div className="relative">
|
|
139
|
+
<AvatarInitials initials={row.initials} className="size-14 rounded-full text-lg font-semibold" />
|
|
140
|
+
{showStatus && (
|
|
141
|
+
<span className="absolute -bottom-0.5 -right-1 flex size-4 items-center justify-center rounded-full bg-card ring-2 ring-card" aria-hidden="true">
|
|
142
|
+
<span className={`size-2.5 rounded-full ${statusDotClass[row.status]}`} />
|
|
143
|
+
</span>
|
|
144
|
+
)}
|
|
145
|
+
</div>
|
|
146
|
+
<p className="w-full text-center text-[13px] font-medium text-foreground leading-tight line-clamp-2">{name}</p>
|
|
147
|
+
{showStatus && <StatusBadge status={row.status} />}
|
|
148
|
+
{(showSite || showSpec || showProgram) && (
|
|
149
|
+
<div className="flex w-full flex-col gap-0.5">
|
|
150
|
+
{showSite && (
|
|
151
|
+
<p className="truncate text-center text-[11px] text-muted-foreground leading-tight">
|
|
152
|
+
<i className="fa-light fa-building me-1" aria-hidden="true" />{row.site}
|
|
153
|
+
</p>
|
|
154
|
+
)}
|
|
155
|
+
{showSpec && <p className="truncate text-center text-[11px] text-muted-foreground leading-tight">{row.specialization}</p>}
|
|
156
|
+
{showProgram && <p className="truncate text-center text-[11px] text-muted-foreground leading-tight">{row.program}</p>}
|
|
157
|
+
</div>
|
|
158
|
+
)}
|
|
159
|
+
</button>
|
|
160
|
+
)
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// ─── Placement-specific list row for FinderPanelView ─────────────────────────
|
|
164
|
+
|
|
165
|
+
function PlacementFinderListRow({
|
|
166
|
+
row,
|
|
167
|
+
isSelected,
|
|
168
|
+
hiddenColKeys,
|
|
169
|
+
boardColumns,
|
|
170
|
+
conditionalRules,
|
|
171
|
+
}: {
|
|
172
|
+
row: Placement
|
|
173
|
+
isSelected: boolean
|
|
174
|
+
hiddenColKeys: Set<string>
|
|
175
|
+
boardColumns: ColumnDef<Placement>[]
|
|
176
|
+
conditionalRules?: ConditionalRule[]
|
|
177
|
+
}) {
|
|
178
|
+
const ruleBg = getConditionalRowBackground(row, conditionalRules, boardColumns)
|
|
179
|
+
const showStudent = isBoardFieldActive("student", hiddenColKeys, boardColumns)
|
|
180
|
+
const showSite = isBoardFieldActive("site", hiddenColKeys, boardColumns)
|
|
181
|
+
const name = showStudent ? row.student : `Placement ${row.id}`
|
|
182
|
+
return (
|
|
183
|
+
<div
|
|
184
|
+
className={`flex w-full min-w-0 items-center gap-3 transition-colors duration-75 ${
|
|
185
|
+
isSelected ? "bg-transparent text-accent-foreground" : cn("text-foreground", ruleBg)
|
|
186
|
+
}`}
|
|
187
|
+
>
|
|
188
|
+
<AvatarInitials
|
|
189
|
+
initials={row.initials}
|
|
190
|
+
className={cn(
|
|
191
|
+
"size-8 shrink-0 rounded-full text-[11px] font-semibold",
|
|
192
|
+
isSelected ? "ring-2 ring-accent-foreground/35" : "",
|
|
193
|
+
)}
|
|
194
|
+
/>
|
|
195
|
+
<div className="min-w-0 flex-1">
|
|
196
|
+
<p className={cn("truncate text-[13px] font-medium leading-tight", isSelected ? "text-accent-foreground" : "text-foreground")}>
|
|
197
|
+
{name}
|
|
198
|
+
</p>
|
|
199
|
+
{showSite && (
|
|
200
|
+
<p className={cn("mt-0.5 truncate text-[11px] leading-tight", isSelected ? "text-accent-foreground/80" : "text-muted-foreground")}>
|
|
201
|
+
{row.site}
|
|
202
|
+
</p>
|
|
203
|
+
)}
|
|
204
|
+
</div>
|
|
205
|
+
{!isSelected && <StatusBadge status={row.status} />}
|
|
206
|
+
</div>
|
|
207
|
+
)
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// ─── Placement-specific detail pane for FinderPanelView ──────────────────────
|
|
211
|
+
|
|
212
|
+
function PlacementFinderDetail({
|
|
213
|
+
row,
|
|
214
|
+
hiddenColKeys,
|
|
215
|
+
boardColumns,
|
|
216
|
+
}: {
|
|
217
|
+
row: Placement
|
|
218
|
+
hiddenColKeys: Set<string>
|
|
219
|
+
boardColumns: ColumnDef<Placement>[]
|
|
220
|
+
}) {
|
|
221
|
+
const router = useRouter()
|
|
222
|
+
const show = (key: string) => isBoardFieldActive(key, hiddenColKeys, boardColumns)
|
|
223
|
+
return (
|
|
224
|
+
<div className="flex min-h-0 flex-1 flex-col overflow-hidden">
|
|
225
|
+
<div className="flex shrink-0 items-start gap-4 border-b border-border px-5 py-4">
|
|
226
|
+
<AvatarInitials initials={row.initials} className="size-14 shrink-0 rounded-full text-lg font-semibold" />
|
|
227
|
+
<div className="min-w-0 flex-1">
|
|
228
|
+
<h2 className="text-base font-semibold text-foreground leading-tight">{row.student}</h2>
|
|
229
|
+
{show("program") && <p className="mt-0.5 text-[13px] text-muted-foreground">{row.program}</p>}
|
|
230
|
+
{show("status") && <div className="mt-2"><StatusBadge status={row.status} /></div>}
|
|
231
|
+
</div>
|
|
232
|
+
<Tip side="bottom" label="Open full detail page">
|
|
233
|
+
<Button
|
|
234
|
+
type="button"
|
|
235
|
+
variant="outline"
|
|
236
|
+
size="sm"
|
|
237
|
+
className="shrink-0"
|
|
238
|
+
onClick={() => router.push(`/data-list/${row.id}`)}
|
|
239
|
+
aria-label={`Open full detail for ${row.student}`}
|
|
240
|
+
>
|
|
241
|
+
<i className="fa-light fa-arrow-up-right-from-square text-[12px]" aria-hidden="true" />
|
|
242
|
+
Open
|
|
243
|
+
</Button>
|
|
244
|
+
</Tip>
|
|
245
|
+
</div>
|
|
246
|
+
<div className="min-h-0 flex-1 overflow-y-auto px-5 py-4">
|
|
247
|
+
<dl className="grid grid-cols-1 gap-4 sm:grid-cols-2">
|
|
248
|
+
{show("email") && (
|
|
249
|
+
<div className="flex flex-col gap-0.5">
|
|
250
|
+
<dt className="text-[11px] font-medium uppercase tracking-wide text-muted-foreground flex items-center gap-1.5">
|
|
251
|
+
<i className="fa-light fa-envelope text-[10px]" aria-hidden="true" /> Email
|
|
252
|
+
</dt>
|
|
253
|
+
<dd className="text-[13px]">
|
|
254
|
+
<a href={mailtoHref(row.email)} className="text-interactive-foreground hover:underline">{row.email}</a>
|
|
255
|
+
</dd>
|
|
256
|
+
</div>
|
|
257
|
+
)}
|
|
258
|
+
{show("site") && (
|
|
259
|
+
<div className="flex flex-col gap-0.5">
|
|
260
|
+
<dt className="text-[11px] font-medium uppercase tracking-wide text-muted-foreground flex items-center gap-1.5">
|
|
261
|
+
<i className="fa-light fa-building text-[10px]" aria-hidden="true" /> Site
|
|
262
|
+
</dt>
|
|
263
|
+
<dd className="text-[13px] text-foreground">{row.site}</dd>
|
|
264
|
+
</div>
|
|
265
|
+
)}
|
|
266
|
+
{show("internship") && (
|
|
267
|
+
<div className="flex flex-col gap-0.5">
|
|
268
|
+
<dt className="text-[11px] font-medium uppercase tracking-wide text-muted-foreground flex items-center gap-1.5">
|
|
269
|
+
<i className="fa-light fa-briefcase text-[10px]" aria-hidden="true" /> Internship
|
|
270
|
+
</dt>
|
|
271
|
+
<dd className="text-[13px] text-foreground">{row.internship}</dd>
|
|
272
|
+
</div>
|
|
273
|
+
)}
|
|
274
|
+
{show("specialization") && (
|
|
275
|
+
<div className="flex flex-col gap-0.5">
|
|
276
|
+
<dt className="text-[11px] font-medium uppercase tracking-wide text-muted-foreground flex items-center gap-1.5">
|
|
277
|
+
<i className="fa-light fa-stethoscope text-[10px]" aria-hidden="true" /> Specialization
|
|
278
|
+
</dt>
|
|
279
|
+
<dd className="text-[13px] text-foreground">{row.specialization}</dd>
|
|
280
|
+
</div>
|
|
281
|
+
)}
|
|
282
|
+
{show("supervisor") && (
|
|
283
|
+
<div className="flex flex-col gap-0.5">
|
|
284
|
+
<dt className="text-[11px] font-medium uppercase tracking-wide text-muted-foreground flex items-center gap-1.5">
|
|
285
|
+
<i className="fa-light fa-user-tie text-[10px]" aria-hidden="true" /> Supervisor
|
|
286
|
+
</dt>
|
|
287
|
+
<dd className="text-[13px] text-foreground">{row.supervisor}</dd>
|
|
288
|
+
</div>
|
|
289
|
+
)}
|
|
290
|
+
{show("start") && (
|
|
291
|
+
<div className="flex flex-col gap-0.5">
|
|
292
|
+
<dt className="text-[11px] font-medium uppercase tracking-wide text-muted-foreground flex items-center gap-1.5">
|
|
293
|
+
<i className="fa-light fa-calendar text-[10px]" aria-hidden="true" /> Start Date
|
|
294
|
+
</dt>
|
|
295
|
+
<dd className="text-[13px] text-foreground">{row.start}</dd>
|
|
296
|
+
</div>
|
|
297
|
+
)}
|
|
298
|
+
{show("duration") && (
|
|
299
|
+
<div className="flex flex-col gap-0.5">
|
|
300
|
+
<dt className="text-[11px] font-medium uppercase tracking-wide text-muted-foreground flex items-center gap-1.5">
|
|
301
|
+
<i className="fa-light fa-clock text-[10px]" aria-hidden="true" /> Duration
|
|
302
|
+
</dt>
|
|
303
|
+
<dd className="text-[13px] text-foreground">{row.duration}</dd>
|
|
304
|
+
</div>
|
|
305
|
+
)}
|
|
306
|
+
{row.placementPhase === "ongoing" && (
|
|
307
|
+
<div className="flex flex-col gap-0.5 sm:col-span-2">
|
|
308
|
+
<dt className="text-[11px] font-medium uppercase tracking-wide text-muted-foreground flex items-center gap-1.5">
|
|
309
|
+
<i className="fa-light fa-chart-line text-[10px]" aria-hidden="true" /> Progress
|
|
310
|
+
</dt>
|
|
311
|
+
<dd className="text-[13px] text-foreground flex flex-col gap-1.5">
|
|
312
|
+
<span>{row.progressWeeksDone} / {row.progressWeeksTotal} weeks</span>
|
|
313
|
+
<div role="progressbar" aria-valuenow={row.progressWeeksDone} aria-valuemin={0} aria-valuemax={row.progressWeeksTotal}
|
|
314
|
+
aria-label={`${row.progressWeeksDone} of ${row.progressWeeksTotal} weeks completed`}
|
|
315
|
+
className="h-1.5 w-full overflow-hidden rounded-full bg-muted">
|
|
316
|
+
<div className="h-full rounded-full bg-primary transition-all"
|
|
317
|
+
style={{ width: `${Math.round((row.progressWeeksDone / Math.max(1, row.progressWeeksTotal)) * 100)}%` }} />
|
|
318
|
+
</div>
|
|
319
|
+
</dd>
|
|
320
|
+
</div>
|
|
321
|
+
)}
|
|
322
|
+
{row.siteAddress && (
|
|
323
|
+
<div className="flex flex-col gap-0.5 sm:col-span-2">
|
|
324
|
+
<dt className="text-[11px] font-medium uppercase tracking-wide text-muted-foreground flex items-center gap-1.5">
|
|
325
|
+
<i className="fa-light fa-location-dot text-[10px]" aria-hidden="true" /> Site Address
|
|
326
|
+
</dt>
|
|
327
|
+
<dd className="text-[13px] text-foreground">{row.siteAddress}</dd>
|
|
328
|
+
</div>
|
|
329
|
+
)}
|
|
330
|
+
</dl>
|
|
331
|
+
</div>
|
|
332
|
+
</div>
|
|
333
|
+
)
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// ─── Status groups for FinderPanelView ───────────────────────────────────────
|
|
337
|
+
|
|
338
|
+
const STATUS_GROUPS: Array<{ id: Status | "all"; label: string; accent: string }> = [
|
|
339
|
+
{ id: "all", label: "All", accent: "bg-muted-foreground" },
|
|
340
|
+
{ id: "confirmed", label: "Confirmed", accent: "bg-success" },
|
|
341
|
+
{ id: "pending", label: "Pending", accent: "bg-warning" },
|
|
342
|
+
{ id: "under-review", label: "Under Review", accent: "bg-brand" },
|
|
343
|
+
{ id: "rejected", label: "Rejected", accent: "bg-destructive" },
|
|
344
|
+
{ id: "completed", label: "Completed", accent: "bg-muted-foreground/50" },
|
|
345
|
+
]
|
|
346
|
+
|
|
347
|
+
function buildStatusGroups(rows: Placement[]): FinderGroup[] {
|
|
348
|
+
return STATUS_GROUPS.map(sg => ({
|
|
349
|
+
id: sg.id,
|
|
350
|
+
label: sg.label,
|
|
351
|
+
accent: sg.accent,
|
|
352
|
+
count: sg.id === "all" ? rows.length : rows.filter(r => r.status === sg.id).length,
|
|
353
|
+
}))
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
// ─── Tree-view body (its own selection state) ────────────────────────────────
|
|
357
|
+
|
|
358
|
+
function PlacementsTreeBody({
|
|
359
|
+
args,
|
|
360
|
+
}: {
|
|
361
|
+
args: HubTableRendererArgs<Placement>
|
|
362
|
+
}) {
|
|
363
|
+
const { state } = args
|
|
364
|
+
const listRows = state.rows as Placement[]
|
|
365
|
+
const boardColumns = state.displayCols.filter(c => c.key !== "select" && c.key !== "actions")
|
|
366
|
+
const [selectedId, setSelectedId] = React.useState<number | null>(() => listRows[0]?.id ?? null)
|
|
367
|
+
|
|
368
|
+
React.useEffect(() => {
|
|
369
|
+
if (selectedId == null) {
|
|
370
|
+
setSelectedId(listRows[0]?.id ?? null)
|
|
371
|
+
return
|
|
372
|
+
}
|
|
373
|
+
if (!listRows.some(r => r.id === selectedId)) {
|
|
374
|
+
setSelectedId(listRows[0]?.id ?? null)
|
|
375
|
+
}
|
|
376
|
+
}, [listRows, selectedId])
|
|
377
|
+
|
|
378
|
+
const selected = listRows.find(r => r.id === selectedId) ?? null
|
|
379
|
+
|
|
380
|
+
return (
|
|
381
|
+
<ListPageTreePanelShell
|
|
382
|
+
resizableGroupId="data-list-tree"
|
|
383
|
+
ariaLabel="Record outline and details"
|
|
384
|
+
tree={
|
|
385
|
+
<div className="flex min-h-0 flex-1 flex-col">
|
|
386
|
+
<ListPageTreeColumnHeader title="Records" />
|
|
387
|
+
{listRows.length === 0 ? (
|
|
388
|
+
<p className="p-3 text-sm text-muted-foreground">{PLACEMENT_EMPTY_COPY}</p>
|
|
389
|
+
) : (
|
|
390
|
+
<ul
|
|
391
|
+
role="tree"
|
|
392
|
+
aria-label="Demo records"
|
|
393
|
+
className="min-h-0 flex-1 list-none space-y-0.5 overflow-y-auto py-1"
|
|
394
|
+
>
|
|
395
|
+
{listRows.map(row => {
|
|
396
|
+
const isSel = selectedId === row.id
|
|
397
|
+
return (
|
|
398
|
+
<li key={row.id} role="none" className="py-0.5">
|
|
399
|
+
<button
|
|
400
|
+
type="button"
|
|
401
|
+
role="treeitem"
|
|
402
|
+
aria-selected={isSel}
|
|
403
|
+
tabIndex={isSel ? 0 : -1}
|
|
404
|
+
onClick={() => setSelectedId(row.id)}
|
|
405
|
+
className={cn(
|
|
406
|
+
"flex w-full min-h-8 items-center rounded-md px-3 py-2 text-left text-sm transition-colors duration-75",
|
|
407
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",
|
|
408
|
+
isSel
|
|
409
|
+
? "bg-accent font-medium text-accent-foreground"
|
|
410
|
+
: "text-foreground hover:bg-muted/50",
|
|
411
|
+
)}
|
|
412
|
+
>
|
|
413
|
+
<span className="min-w-0 truncate">{row.student}</span>
|
|
414
|
+
</button>
|
|
415
|
+
</li>
|
|
416
|
+
)
|
|
417
|
+
})}
|
|
418
|
+
</ul>
|
|
419
|
+
)}
|
|
420
|
+
</div>
|
|
421
|
+
}
|
|
422
|
+
details={
|
|
423
|
+
selected ? (
|
|
424
|
+
<div className="flex min-h-0 flex-1 flex-col overflow-hidden bg-card">
|
|
425
|
+
<ListPageTreeColumnHeader title="Details" />
|
|
426
|
+
<div className="min-h-0 flex-1 overflow-y-auto">
|
|
427
|
+
<PlacementFinderDetail
|
|
428
|
+
row={selected}
|
|
429
|
+
hiddenColKeys={state.hiddenCols}
|
|
430
|
+
boardColumns={boardColumns}
|
|
431
|
+
/>
|
|
432
|
+
</div>
|
|
433
|
+
</div>
|
|
434
|
+
) : (
|
|
435
|
+
<ListPageSplitDetailsPlaceholder title="Nothing selected" />
|
|
436
|
+
)
|
|
437
|
+
}
|
|
438
|
+
/>
|
|
439
|
+
)
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
// ─── Dashboard body (its own layout state) ───────────────────────────────────
|
|
443
|
+
|
|
444
|
+
function PlacementsDashboardBody({
|
|
445
|
+
args,
|
|
446
|
+
columns,
|
|
447
|
+
}: {
|
|
448
|
+
args: HubTableRendererArgs<Placement>
|
|
449
|
+
columns: ColumnDef<Placement>[]
|
|
450
|
+
}) {
|
|
451
|
+
const { state, drawerToolbarProps, displayOptions } = args
|
|
452
|
+
const rows = state.rows as Placement[]
|
|
453
|
+
|
|
454
|
+
const dashboardKpi = React.useMemo(
|
|
455
|
+
() => ({
|
|
456
|
+
metrics: placementKpiMetricsFromRows(rows),
|
|
457
|
+
insight: placementKpiInsightFromRows(rows),
|
|
458
|
+
}),
|
|
459
|
+
[rows],
|
|
460
|
+
)
|
|
461
|
+
|
|
462
|
+
const [visibleCards, setVisibleCards] = React.useState<string[]>(DEFAULT_VISIBLE_CARDS)
|
|
463
|
+
const [cardOrder, setCardOrder] = React.useState<string[]>(ALL_DASHBOARD_CARDS.map(c => c.id))
|
|
464
|
+
const [cardSpans, setCardSpans] = React.useState<Record<string, 1 | 2>>(() => ({ ...DEFAULT_SPANS }))
|
|
465
|
+
const [cardChartTypes, setCardChartTypes] = React.useState<Record<string, ChartType>>(() => ({ ...DEFAULT_CHART_TYPES }))
|
|
466
|
+
const [keyMetricsKpiCount, setKeyMetricsKpiCount] = React.useState<number>(KEY_METRICS_KPI_COUNT_DEFAULT)
|
|
467
|
+
const [layoutEdit, setLayoutEdit] = React.useState(false)
|
|
468
|
+
const hydrated = React.useRef(false)
|
|
469
|
+
const baselineRef = React.useRef<DashboardLayout | null>(null)
|
|
470
|
+
|
|
471
|
+
React.useEffect(() => {
|
|
472
|
+
const saved = loadDashboardLayout()
|
|
473
|
+
const m = mergeDashboardLayout(saved)
|
|
474
|
+
setVisibleCards(m.visible)
|
|
475
|
+
setCardOrder(m.order)
|
|
476
|
+
setCardSpans(m.spans ?? { ...DEFAULT_SPANS })
|
|
477
|
+
setCardChartTypes(m.chartTypes ?? { ...DEFAULT_CHART_TYPES })
|
|
478
|
+
setKeyMetricsKpiCount(m.keyMetricsKpiCount ?? KEY_METRICS_KPI_COUNT_DEFAULT)
|
|
479
|
+
hydrated.current = true
|
|
480
|
+
}, [])
|
|
481
|
+
|
|
482
|
+
React.useEffect(() => {
|
|
483
|
+
if (!hydrated.current) return
|
|
484
|
+
saveDashboardLayout({
|
|
485
|
+
visible: visibleCards,
|
|
486
|
+
order: cardOrder,
|
|
487
|
+
spans: cardSpans,
|
|
488
|
+
chartTypes: cardChartTypes,
|
|
489
|
+
keyMetricsKpiCount,
|
|
490
|
+
})
|
|
491
|
+
}, [visibleCards, cardOrder, cardSpans, cardChartTypes, keyMetricsKpiCount])
|
|
492
|
+
|
|
493
|
+
const onResetLayout = React.useCallback(() => {
|
|
494
|
+
setVisibleCards(ALL_DASHBOARD_CARDS.map(c => c.id))
|
|
495
|
+
setCardOrder(ALL_DASHBOARD_CARDS.map(c => c.id))
|
|
496
|
+
setCardSpans({ ...DEFAULT_SPANS })
|
|
497
|
+
setCardChartTypes({ ...DEFAULT_CHART_TYPES })
|
|
498
|
+
setKeyMetricsKpiCount(KEY_METRICS_KPI_COUNT_DEFAULT)
|
|
499
|
+
}, [])
|
|
500
|
+
|
|
501
|
+
const onLayoutEditStart = React.useCallback(() => {
|
|
502
|
+
baselineRef.current = {
|
|
503
|
+
visible: [...visibleCards],
|
|
504
|
+
order: [...cardOrder],
|
|
505
|
+
spans: { ...cardSpans },
|
|
506
|
+
chartTypes: { ...cardChartTypes },
|
|
507
|
+
keyMetricsKpiCount,
|
|
508
|
+
}
|
|
509
|
+
setLayoutEdit(true)
|
|
510
|
+
}, [visibleCards, cardOrder, cardSpans, cardChartTypes, keyMetricsKpiCount])
|
|
511
|
+
|
|
512
|
+
const onLayoutEditCancel = React.useCallback(() => {
|
|
513
|
+
const b = baselineRef.current
|
|
514
|
+
if (b) {
|
|
515
|
+
setVisibleCards(b.visible)
|
|
516
|
+
setCardOrder(b.order)
|
|
517
|
+
setCardSpans(b.spans ?? { ...DEFAULT_SPANS })
|
|
518
|
+
setCardChartTypes(b.chartTypes ?? { ...DEFAULT_CHART_TYPES })
|
|
519
|
+
setKeyMetricsKpiCount(b.keyMetricsKpiCount ?? KEY_METRICS_KPI_COUNT_DEFAULT)
|
|
520
|
+
}
|
|
521
|
+
setLayoutEdit(false)
|
|
522
|
+
}, [])
|
|
523
|
+
|
|
524
|
+
const coach = useCoachMark({
|
|
525
|
+
flowId: "data-list-dashboard-customize",
|
|
526
|
+
steps: DASHBOARD_CUSTOMIZE_COACH_STEPS,
|
|
527
|
+
delay: 700,
|
|
528
|
+
dependsOnDismissedFlowId: "data-list-views-tour",
|
|
529
|
+
})
|
|
530
|
+
|
|
531
|
+
return (
|
|
532
|
+
<>
|
|
533
|
+
<CoachMark state={coach} />
|
|
534
|
+
{!layoutEdit ? (
|
|
535
|
+
<DataTableToolbar
|
|
536
|
+
state={state}
|
|
537
|
+
columns={columns}
|
|
538
|
+
searchable={displayOptions.showToolbarSearch}
|
|
539
|
+
renderFilterOptionValue={drawerToolbarProps.renderFilterOptionValue}
|
|
540
|
+
searchAriaLabel="Search rows"
|
|
541
|
+
toolbarSlot={s => (
|
|
542
|
+
<TablePropertiesDrawerButton
|
|
543
|
+
{...drawerToolbarProps}
|
|
544
|
+
state={s}
|
|
545
|
+
extraActions={
|
|
546
|
+
<Tip side="bottom" label="Edit dashboard layout on canvas">
|
|
547
|
+
<Button
|
|
548
|
+
type="button"
|
|
549
|
+
variant="ghost"
|
|
550
|
+
size="icon-sm"
|
|
551
|
+
aria-label="Edit dashboard layout"
|
|
552
|
+
onClick={onLayoutEditStart}
|
|
553
|
+
className="text-muted-foreground hover:text-interactive-hover-foreground hover:bg-interactive-hover"
|
|
554
|
+
>
|
|
555
|
+
<i className="fa-light fa-pen-ruler text-[13px]" aria-hidden="true" />
|
|
556
|
+
</Button>
|
|
557
|
+
</Tip>
|
|
558
|
+
}
|
|
559
|
+
/>
|
|
560
|
+
)}
|
|
561
|
+
/>
|
|
562
|
+
) : null}
|
|
563
|
+
<PlacementsDashboardChartsSection
|
|
564
|
+
placements={rows}
|
|
565
|
+
keyMetrics={dashboardKpi}
|
|
566
|
+
visibleCards={visibleCards}
|
|
567
|
+
cardOrder={cardOrder}
|
|
568
|
+
cardSpans={cardSpans}
|
|
569
|
+
cardChartTypes={cardChartTypes}
|
|
570
|
+
keyMetricsKpiCount={keyMetricsKpiCount}
|
|
571
|
+
layoutEditMode={layoutEdit}
|
|
572
|
+
onVisibleChange={setVisibleCards}
|
|
573
|
+
onOrderChange={setCardOrder}
|
|
574
|
+
onSpanChange={(id, span) => setCardSpans(prev => ({ ...prev, [id]: span }))}
|
|
575
|
+
onChartTypeChange={(id, t) => setCardChartTypes(prev => ({ ...prev, [id]: t }))}
|
|
576
|
+
onKeyMetricsKpiCountChange={setKeyMetricsKpiCount}
|
|
577
|
+
onResetLayout={onResetLayout}
|
|
578
|
+
onLayoutEditDone={() => setLayoutEdit(false)}
|
|
579
|
+
onLayoutEditCancel={onLayoutEditCancel}
|
|
580
|
+
/>
|
|
581
|
+
</>
|
|
582
|
+
)
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
// ─── Board renderer body ─────────────────────────────────────────────────────
|
|
586
|
+
|
|
587
|
+
function PlacementsBoardBody({
|
|
588
|
+
args,
|
|
589
|
+
}: {
|
|
590
|
+
args: HubTableRendererArgs<Placement>
|
|
591
|
+
}) {
|
|
592
|
+
const { state, displayOptions, drawerToolbarProps } = args
|
|
593
|
+
const columns = state.displayCols
|
|
594
|
+
const boardColumnMenu: PlacementsBoardColumnMenu = React.useMemo(
|
|
595
|
+
() => ({
|
|
596
|
+
filterableColumns: columns.filter(c => c.filter).map(c => ({ key: c.key, label: c.label })),
|
|
597
|
+
sortableColumns: columns.filter(c => c.sortable && c.sortKey).map(c => ({ key: c.key, label: c.label })),
|
|
598
|
+
groupableColumns: columns.filter(c => c.key !== "select" && c.key !== "actions").map(c => ({ key: c.key, label: c.label })),
|
|
599
|
+
groupBy: state.groupBy,
|
|
600
|
+
onAddFilter: state.addFilter,
|
|
601
|
+
onSortByField: (fieldKey, direction) => {
|
|
602
|
+
state.setSortRules(prev => {
|
|
603
|
+
const filtered = prev.filter(r => r.fieldKey !== fieldKey)
|
|
604
|
+
return [{ id: `sort-${Date.now()}`, fieldKey, direction }, ...filtered]
|
|
605
|
+
})
|
|
606
|
+
},
|
|
607
|
+
onToggleGroupBy: (fieldKey: string) => {
|
|
608
|
+
state.setGroupBy(prev => (prev === fieldKey ? null : fieldKey))
|
|
609
|
+
},
|
|
610
|
+
onOpenProperties: () => state.setSheetOpen(true),
|
|
611
|
+
}),
|
|
612
|
+
[columns, state],
|
|
613
|
+
)
|
|
614
|
+
|
|
615
|
+
return (
|
|
616
|
+
<PlacementsBoardView
|
|
617
|
+
placements={state.rows as Placement[]}
|
|
618
|
+
boardColumnMenu={boardColumnMenu}
|
|
619
|
+
boardDisplay={{
|
|
620
|
+
lineCount: displayOptions.boardLineCount,
|
|
621
|
+
showColumnLabels: displayOptions.showColumnLabels,
|
|
622
|
+
showColumnCounts: displayOptions.showBoardColumnCounts,
|
|
623
|
+
newCardAbove: displayOptions.boardNewCardAbove,
|
|
624
|
+
}}
|
|
625
|
+
hiddenColKeys={state.hiddenCols}
|
|
626
|
+
conditionalRules={drawerToolbarProps.conditionalRules}
|
|
627
|
+
boardColumns={state.displayCols.filter(c => c.key !== "select" && c.key !== "actions")}
|
|
628
|
+
/>
|
|
629
|
+
)
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
// ─── Props ───────────────────────────────────────────────────────────────────
|
|
633
|
+
|
|
634
|
+
export interface PlacementsTableProps {
|
|
635
|
+
view?: DataListViewType
|
|
636
|
+
onViewChange?: (view: DataListViewType) => void
|
|
637
|
+
/** Shared display options (persist at page level — all view types). */
|
|
638
|
+
displayOptions?: DataListDisplayOptions
|
|
639
|
+
onDisplayOptionsChange?: (patch: Partial<DataListDisplayOptions>) => void
|
|
640
|
+
/** Panel view: custom groups builder. If not provided, uses default placement status groups. */
|
|
641
|
+
panelGroupsBuilder?: (rows: Placement[]) => FinderGroup[]
|
|
642
|
+
/** Panel view: custom list row renderer. If not provided, uses default placement row rendering. */
|
|
643
|
+
panelRenderListRow?: (row: Placement, isSelected: boolean) => React.ReactNode
|
|
644
|
+
/** Panel view: custom detail pane renderer. If not provided, uses default placement detail rendering. */
|
|
645
|
+
panelRenderDetail?: (row: Placement) => React.ReactNode
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
/** Imperative handle — open Table Properties (table view only). */
|
|
649
|
+
export type PlacementsTableHandle = HubTableHandle
|
|
650
|
+
|
|
651
|
+
// ─── Public component ───────────────────────────────────────────────────────
|
|
652
|
+
|
|
653
|
+
export const PlacementsTable = React.forwardRef<PlacementsTableHandle, PlacementsTableProps>(function PlacementsTable(
|
|
654
|
+
{
|
|
655
|
+
view = "table",
|
|
656
|
+
onViewChange,
|
|
657
|
+
displayOptions: displayOptionsProp,
|
|
658
|
+
onDisplayOptionsChange,
|
|
659
|
+
panelGroupsBuilder,
|
|
660
|
+
panelRenderListRow,
|
|
661
|
+
panelRenderDetail,
|
|
662
|
+
},
|
|
663
|
+
ref,
|
|
664
|
+
) {
|
|
665
|
+
const router = useRouter()
|
|
666
|
+
const displayOptions = React.useMemo(
|
|
667
|
+
() => ({ ...DEFAULT_DATA_LIST_DISPLAY_OPTIONS, ...displayOptionsProp }),
|
|
668
|
+
[displayOptionsProp],
|
|
669
|
+
)
|
|
670
|
+
|
|
671
|
+
const columns = React.useMemo(() => getPlacementColumns(), [])
|
|
672
|
+
const tableData = ALL_PLACEMENTS
|
|
673
|
+
|
|
674
|
+
const renderFilterOptionValue = React.useCallback(
|
|
675
|
+
(fieldKey: string, value: string): React.ReactNode => {
|
|
676
|
+
if (fieldKey === "status") return <StatusBadge status={value as Status} />
|
|
677
|
+
const col = columns.find(c => c.key === fieldKey)
|
|
678
|
+
const opt = col?.filter?.options?.find(o => o.value === value)
|
|
679
|
+
return <span className="text-foreground">{opt?.label ?? value}</span>
|
|
680
|
+
},
|
|
681
|
+
[columns],
|
|
682
|
+
)
|
|
683
|
+
|
|
684
|
+
// ─ Pagination chrome (only TABLE + LIST views) ────────────────────────────
|
|
685
|
+
const [pagination, setPagination] = React.useState(false)
|
|
686
|
+
const [paginationPage, setPaginationPage] = React.useState(1)
|
|
687
|
+
const [paginationPageSize, setPaginationPageSize] = React.useState(10)
|
|
688
|
+
const [filteredCount, setFilteredCount] = React.useState(tableData.length)
|
|
689
|
+
|
|
690
|
+
React.useEffect(() => {
|
|
691
|
+
setFilteredCount(tableData.length)
|
|
692
|
+
}, [tableData])
|
|
693
|
+
|
|
694
|
+
const totalPages = Math.max(1, Math.ceil(filteredCount / Math.max(1, paginationPageSize)))
|
|
695
|
+
const safePage = Math.min(paginationPage, totalPages)
|
|
696
|
+
|
|
697
|
+
// Pagination only applies to TABLE + LIST views (board/dashboard/folder/panel/tree-panel
|
|
698
|
+
// are not paged). Cards/boards consume `state.rows` directly.
|
|
699
|
+
const paginationEligible = view === "table" || view === "list"
|
|
700
|
+
const paginationOverride =
|
|
701
|
+
pagination && paginationEligible ? { page: safePage, pageSize: paginationPageSize } : undefined
|
|
702
|
+
|
|
703
|
+
const onPageSizeChange = React.useCallback((n: number) => {
|
|
704
|
+
setPaginationPageSize(n)
|
|
705
|
+
setPaginationPage(1)
|
|
706
|
+
}, [])
|
|
707
|
+
|
|
708
|
+
// Renderers --------------------------------------------------------------
|
|
709
|
+
const renderers: HubTableRenderers<Placement> = {
|
|
710
|
+
"board-with-toolbar": (args) =>
|
|
711
|
+
args.toolbarShell(<PlacementsBoardBody args={args} />),
|
|
712
|
+
"list-with-toolbar": (args) => {
|
|
713
|
+
const { state, toolbarShell } = args
|
|
714
|
+
const listRows = pagination ? (state.pagedRows as Placement[]) : (state.rows as Placement[])
|
|
715
|
+
const boardColumns = state.displayCols.filter(c => c.key !== "select" && c.key !== "actions")
|
|
716
|
+
return (
|
|
717
|
+
<>
|
|
718
|
+
{pagination ? (
|
|
719
|
+
<CountSyncer
|
|
720
|
+
count={state.rows.length}
|
|
721
|
+
onSync={setFilteredCount}
|
|
722
|
+
onReset={() => setPaginationPage(1)}
|
|
723
|
+
/>
|
|
724
|
+
) : null}
|
|
725
|
+
{toolbarShell(
|
|
726
|
+
<>
|
|
727
|
+
<DataRowList<Placement>
|
|
728
|
+
rows={listRows}
|
|
729
|
+
getRowId={row => row.id}
|
|
730
|
+
ariaLabel="Placements"
|
|
731
|
+
emptyState={PLACEMENT_EMPTY_COPY}
|
|
732
|
+
virtualizeThreshold={PLACEMENT_LIST_VIRTUAL_ROWS_THRESHOLD}
|
|
733
|
+
estimatedRowHeight={PLACEMENT_LIST_ESTIMATE_ROW_PX}
|
|
734
|
+
renderRow={row => (
|
|
735
|
+
<PlacementListRowContent
|
|
736
|
+
row={row}
|
|
737
|
+
hiddenColKeys={state.hiddenCols}
|
|
738
|
+
boardColumns={boardColumns}
|
|
739
|
+
conditionalRules={args.drawerToolbarProps.conditionalRules}
|
|
740
|
+
onOpen={id => router.push(`/data-list/${id}`)}
|
|
741
|
+
/>
|
|
742
|
+
)}
|
|
743
|
+
/>
|
|
744
|
+
{pagination ? (
|
|
745
|
+
<div className="mx-4 lg:mx-6 border-x border-b border-border rounded-b-lg overflow-hidden">
|
|
746
|
+
<PaginationBar
|
|
747
|
+
page={safePage}
|
|
748
|
+
pageSize={paginationPageSize}
|
|
749
|
+
total={filteredCount}
|
|
750
|
+
pageSizeOptions={[10, 25, 50, 100]}
|
|
751
|
+
onPageChange={setPaginationPage}
|
|
752
|
+
onPageSizeChange={onPageSizeChange}
|
|
753
|
+
/>
|
|
754
|
+
</div>
|
|
755
|
+
) : null}
|
|
756
|
+
</>,
|
|
757
|
+
)}
|
|
758
|
+
</>
|
|
759
|
+
)
|
|
760
|
+
},
|
|
761
|
+
"folder-with-toolbar": (args) => {
|
|
762
|
+
const { state, toolbarShell } = args
|
|
763
|
+
const boardColumns = state.displayCols.filter(c => c.key !== "select" && c.key !== "actions")
|
|
764
|
+
return toolbarShell(
|
|
765
|
+
<FolderGridView<Placement>
|
|
766
|
+
rows={state.rows as Placement[]}
|
|
767
|
+
getRowId={r => r.id}
|
|
768
|
+
ariaLabel="Demo folder view"
|
|
769
|
+
emptyContent={<p>{PLACEMENT_EMPTY_COPY}</p>}
|
|
770
|
+
renderTile={row => (
|
|
771
|
+
<PlacementFolderTile
|
|
772
|
+
row={row}
|
|
773
|
+
hiddenColKeys={state.hiddenCols}
|
|
774
|
+
boardColumns={boardColumns}
|
|
775
|
+
onClick={() => router.push(`/data-list/${row.id}`)}
|
|
776
|
+
/>
|
|
777
|
+
)}
|
|
778
|
+
/>,
|
|
779
|
+
)
|
|
780
|
+
},
|
|
781
|
+
"tree-panel-with-toolbar": (args) =>
|
|
782
|
+
args.toolbarShell(<PlacementsTreeBody args={args} />),
|
|
783
|
+
"panel-with-toolbar": (args) => {
|
|
784
|
+
const { state, toolbarShell } = args
|
|
785
|
+
const listRows = state.rows as Placement[]
|
|
786
|
+
const boardColumns = state.displayCols.filter(c => c.key !== "select" && c.key !== "actions")
|
|
787
|
+
const groups = panelGroupsBuilder ? panelGroupsBuilder(listRows) : buildStatusGroups(listRows)
|
|
788
|
+
return toolbarShell(
|
|
789
|
+
<ListPageSplitHubChrome aria-label={PLACEMENT_DRAWER_LABEL}>
|
|
790
|
+
<FinderPanelView<Placement>
|
|
791
|
+
embedded
|
|
792
|
+
groupsColumnTitle="Status"
|
|
793
|
+
groups={groups}
|
|
794
|
+
rows={listRows}
|
|
795
|
+
getRowId={r => r.id}
|
|
796
|
+
getRowGroupId={r => r.status}
|
|
797
|
+
defaultGroupId="all"
|
|
798
|
+
autoSaveId="finder-panel-view"
|
|
799
|
+
ariaLabel="Demo panel view"
|
|
800
|
+
emptyList={<p>{PLACEMENT_EMPTY_COPY}</p>}
|
|
801
|
+
renderListRow={
|
|
802
|
+
panelRenderListRow
|
|
803
|
+
? panelRenderListRow
|
|
804
|
+
: (row, isSelected) => (
|
|
805
|
+
<PlacementFinderListRow
|
|
806
|
+
row={row}
|
|
807
|
+
isSelected={isSelected}
|
|
808
|
+
hiddenColKeys={state.hiddenCols}
|
|
809
|
+
boardColumns={boardColumns}
|
|
810
|
+
/>
|
|
811
|
+
)
|
|
812
|
+
}
|
|
813
|
+
renderDetail={
|
|
814
|
+
panelRenderDetail
|
|
815
|
+
? panelRenderDetail
|
|
816
|
+
: row => (
|
|
817
|
+
<PlacementFinderDetail
|
|
818
|
+
row={row}
|
|
819
|
+
hiddenColKeys={state.hiddenCols}
|
|
820
|
+
boardColumns={boardColumns}
|
|
821
|
+
/>
|
|
822
|
+
)
|
|
823
|
+
}
|
|
824
|
+
/>
|
|
825
|
+
</ListPageSplitHubChrome>,
|
|
826
|
+
)
|
|
827
|
+
},
|
|
828
|
+
"dashboard-with-toolbar": (args) => <PlacementsDashboardBody args={args} columns={columns} />,
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
// Custom `tableRenderer` so pagination chrome (CountSyncer + PaginationBar) wraps the
|
|
832
|
+
// default DataTable when `pagination` is on. When off, falls back to a plain DataTable.
|
|
833
|
+
const tableRenderer = (args: HubTableRendererArgs<Placement>) => {
|
|
834
|
+
const { state } = args
|
|
835
|
+
return (
|
|
836
|
+
<>
|
|
837
|
+
{pagination ? (
|
|
838
|
+
<CountSyncer
|
|
839
|
+
count={state.rows.length}
|
|
840
|
+
onSync={setFilteredCount}
|
|
841
|
+
onReset={() => setPaginationPage(1)}
|
|
842
|
+
/>
|
|
843
|
+
) : null}
|
|
844
|
+
<div className="pb-6">
|
|
845
|
+
<DataTable<Placement>
|
|
846
|
+
data={tableData}
|
|
847
|
+
columns={columns}
|
|
848
|
+
getRowId={row => row.id}
|
|
849
|
+
getRowSelectionLabel={row => row.student}
|
|
850
|
+
selectable
|
|
851
|
+
searchable={displayOptions.showToolbarSearch}
|
|
852
|
+
showColumnHeaders={displayOptions.showColumnLabels}
|
|
853
|
+
defaultSort={{ key: "student" as const, dir: "asc" as const }}
|
|
854
|
+
emptyState={PLACEMENT_EMPTY_COPY}
|
|
855
|
+
renderFilterOptionValue={renderFilterOptionValue}
|
|
856
|
+
conditionalRules={args.drawerToolbarProps.conditionalRules}
|
|
857
|
+
onRowClick={row => router.push(`/data-list/${row.id}`)}
|
|
858
|
+
state={state}
|
|
859
|
+
hasFooter={pagination}
|
|
860
|
+
toolbarSlot={s => (
|
|
861
|
+
<TablePropertiesDrawerButton {...args.drawerToolbarProps} state={s} />
|
|
862
|
+
)}
|
|
863
|
+
bulkActionsSlot={(selected) => {
|
|
864
|
+
const count = selected.size
|
|
865
|
+
if (count === 0) return null
|
|
866
|
+
const contextId = "bulk-selection-context"
|
|
867
|
+
return (
|
|
868
|
+
<>
|
|
869
|
+
<span id={contextId} className="sr-only">
|
|
870
|
+
{count} {count === 1 ? "row" : "rows"} selected
|
|
871
|
+
</span>
|
|
872
|
+
<Button size="sm" variant="default" aria-describedby={contextId}>
|
|
873
|
+
<i className="fa-light fa-circle-check" aria-hidden="true" /> Confirm
|
|
874
|
+
</Button>
|
|
875
|
+
<Button size="sm" variant="outline" aria-describedby={contextId}>
|
|
876
|
+
<i className="fa-light fa-arrow-down-to-line" aria-hidden="true" /> Export
|
|
877
|
+
</Button>
|
|
878
|
+
<Button size="sm" variant="destructive" aria-describedby={contextId}>
|
|
879
|
+
<i className="fa-light fa-trash" aria-hidden="true" /> Delete
|
|
880
|
+
</Button>
|
|
881
|
+
</>
|
|
882
|
+
)
|
|
883
|
+
}}
|
|
884
|
+
/>
|
|
885
|
+
</div>
|
|
886
|
+
{pagination ? (
|
|
887
|
+
<div className="mx-4 lg:mx-6 border-x border-b border-border rounded-b-lg overflow-hidden">
|
|
888
|
+
<PaginationBar
|
|
889
|
+
page={safePage}
|
|
890
|
+
pageSize={paginationPageSize}
|
|
891
|
+
total={filteredCount}
|
|
892
|
+
pageSizeOptions={[10, 25, 50, 100]}
|
|
893
|
+
onPageChange={setPaginationPage}
|
|
894
|
+
onPageSizeChange={onPageSizeChange}
|
|
895
|
+
/>
|
|
896
|
+
</div>
|
|
897
|
+
) : null}
|
|
898
|
+
</>
|
|
899
|
+
)
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
return (
|
|
903
|
+
<HubTable<Placement>
|
|
904
|
+
rows={tableData}
|
|
905
|
+
columns={columns}
|
|
906
|
+
view={view}
|
|
907
|
+
onViewChange={onViewChange}
|
|
908
|
+
supportedViewTypes={PLACEMENTS_SUPPORTED_VIEWS}
|
|
909
|
+
hubLabel={PLACEMENT_DRAWER_LABEL}
|
|
910
|
+
lifecycleTabLabel={PLACEMENT_DRAWER_LABEL}
|
|
911
|
+
searchAriaLabel="Search rows"
|
|
912
|
+
getRowId={row => row.id}
|
|
913
|
+
getRowSelectionLabel={row => row.student}
|
|
914
|
+
defaultSort={{ key: "student", dir: "asc" }}
|
|
915
|
+
emptyState={PLACEMENT_EMPTY_COPY}
|
|
916
|
+
onRowClick={row => router.push(`/data-list/${row.id}`)}
|
|
917
|
+
displayOptions={displayOptions}
|
|
918
|
+
onDisplayOptionsChange={onDisplayOptionsChange}
|
|
919
|
+
pagination={pagination}
|
|
920
|
+
onPaginationChange={setPagination}
|
|
921
|
+
paginationOverride={paginationOverride}
|
|
922
|
+
renderFilterOptionValue={renderFilterOptionValue}
|
|
923
|
+
renderers={renderers}
|
|
924
|
+
tableRenderer={tableRenderer}
|
|
925
|
+
handleRef={ref}
|
|
926
|
+
/>
|
|
927
|
+
)
|
|
928
|
+
})
|
|
929
|
+
|
|
930
|
+
PlacementsTable.displayName = "PlacementsTable"
|
|
931
|
+
|
|
932
|
+
export type { DataListViewType } from "@/lib/data-list-view"
|
|
933
|
+
export { DATA_LIST_VIEW_TILES } from "@/lib/data-list-view"
|
|
934
|
+
export type { DataListDisplayOptions } from "@/lib/data-list-display-options"
|