@alepha/ui 0.27.1 → 0.29.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/README.md +31 -2
- package/dist/components/account/account-connections.d.ts.map +1 -1
- package/dist/components/account/account-connections.js +4 -1
- package/dist/components/account/account-connections.js.map +1 -1
- package/dist/components/account/account-delete-dialog.d.ts.map +1 -1
- package/dist/components/account/account-delete-dialog.js +12 -15
- package/dist/components/account/account-delete-dialog.js.map +1 -1
- package/dist/components/account/account-keys.d.ts.map +1 -1
- package/dist/components/account/account-keys.js +22 -28
- package/dist/components/account/account-keys.js.map +1 -1
- package/dist/components/account/account-layout.d.ts.map +1 -1
- package/dist/components/account/account-layout.js +8 -2
- package/dist/components/account/account-layout.js.map +1 -1
- package/dist/components/account/account-mfa-dialog.js +1 -4
- package/dist/components/account/account-mfa-dialog.js.map +1 -1
- package/dist/components/account/account-password-dialog.d.ts.map +1 -1
- package/dist/components/account/account-password-dialog.js +11 -14
- package/dist/components/account/account-password-dialog.js.map +1 -1
- package/dist/components/account/account-profile.js +3 -2
- package/dist/components/account/account-profile.js.map +1 -1
- package/dist/components/account/account-router-options.d.ts +38 -0
- package/dist/components/account/account-router-options.d.ts.map +1 -1
- package/dist/components/account/account-router-options.js.map +1 -1
- package/dist/components/account/account-router-page.d.ts +11 -1
- package/dist/components/account/account-router-page.d.ts.map +1 -1
- package/dist/components/account/account-router-page.js +11 -1
- package/dist/components/account/account-router-page.js.map +1 -1
- package/dist/components/account/account-router.d.ts +11 -0
- package/dist/components/account/account-router.d.ts.map +1 -1
- package/dist/components/account/account-router.js +16 -5
- package/dist/components/account/account-router.js.map +1 -1
- package/dist/components/admin/admin-analytics.d.ts +34 -5
- package/dist/components/admin/admin-analytics.d.ts.map +1 -1
- package/dist/components/admin/admin-analytics.js +69 -51
- package/dist/components/admin/admin-analytics.js.map +1 -1
- package/dist/components/admin/admin-audits.d.ts +14 -0
- package/dist/components/admin/admin-audits.d.ts.map +1 -1
- package/dist/components/admin/admin-audits.js +121 -37
- package/dist/components/admin/admin-audits.js.map +1 -1
- package/dist/components/admin/admin-files.d.ts.map +1 -1
- package/dist/components/admin/admin-files.js +8 -18
- package/dist/components/admin/admin-files.js.map +1 -1
- package/dist/components/admin/admin-jobs-executions-panel.d.ts.map +1 -1
- package/dist/components/admin/admin-jobs-executions-panel.js +40 -9
- package/dist/components/admin/admin-jobs-executions-panel.js.map +1 -1
- package/dist/components/admin/admin-jobs-payload-dialog.d.ts +19 -0
- package/dist/components/admin/admin-jobs-payload-dialog.d.ts.map +1 -0
- package/dist/components/admin/admin-jobs-payload-dialog.js +33 -0
- package/dist/components/admin/admin-jobs-payload-dialog.js.map +1 -0
- package/dist/components/admin/admin-jobs.js +1 -1
- package/dist/components/admin/admin-keys.d.ts.map +1 -1
- package/dist/components/admin/admin-keys.js +7 -5
- package/dist/components/admin/admin-keys.js.map +1 -1
- package/dist/components/admin/admin-notifications-channel-label.d.ts +14 -0
- package/dist/components/admin/admin-notifications-channel-label.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications-channel-label.js +26 -0
- package/dist/components/admin/admin-notifications-channel-label.js.map +1 -0
- package/dist/components/admin/admin-notifications-preview-body.d.ts.map +1 -1
- package/dist/components/admin/admin-notifications-preview-body.js +23 -13
- package/dist/components/admin/admin-notifications-preview-body.js.map +1 -1
- package/dist/components/admin/admin-notifications.d.ts.map +1 -1
- package/dist/components/admin/admin-notifications.js +12 -13
- package/dist/components/admin/admin-notifications.js.map +1 -1
- package/dist/components/admin/admin-parameters.d.ts.map +1 -1
- package/dist/components/admin/admin-parameters.js +108 -14
- package/dist/components/admin/admin-parameters.js.map +1 -1
- package/dist/components/admin/admin-payments.d.ts.map +1 -1
- package/dist/components/admin/admin-payments.js +10 -8
- package/dist/components/admin/admin-payments.js.map +1 -1
- package/dist/components/admin/admin-router-options.d.ts +12 -0
- package/dist/components/admin/admin-router-options.d.ts.map +1 -1
- package/dist/components/admin/admin-router-options.js.map +1 -1
- package/dist/components/admin/admin-router.d.ts +5 -8
- package/dist/components/admin/admin-router.d.ts.map +1 -1
- package/dist/components/admin/admin-router.js +6 -29
- package/dist/components/admin/admin-router.js.map +1 -1
- package/dist/components/admin/admin-sessions.d.ts.map +1 -1
- package/dist/components/admin/admin-sessions.js +135 -11
- package/dist/components/admin/admin-sessions.js.map +1 -1
- package/dist/components/admin/admin-user-avatar-control.d.ts +24 -0
- package/dist/components/admin/admin-user-avatar-control.d.ts.map +1 -0
- package/dist/components/admin/admin-user-avatar-control.js +84 -0
- package/dist/components/admin/admin-user-avatar-control.js.map +1 -0
- package/dist/components/admin/admin-user-detail-audits-tab.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-audits-tab.js +5 -4
- package/dist/components/admin/admin-user-detail-audits-tab.js.map +1 -1
- package/dist/components/admin/admin-user-detail-sessions-tab.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-sessions-tab.js +7 -5
- package/dist/components/admin/admin-user-detail-sessions-tab.js.map +1 -1
- package/dist/components/admin/admin-user-detail.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail.js +16 -4
- package/dist/components/admin/admin-user-detail.js.map +1 -1
- package/dist/components/admin/admin-users-roles-picker.d.ts.map +1 -1
- package/dist/components/admin/admin-users-roles-picker.js.map +1 -1
- package/dist/components/admin/admin-users.d.ts.map +1 -1
- package/dist/components/admin/admin-users.js +7 -5
- package/dist/components/admin/admin-users.js.map +1 -1
- package/dist/components/admin/analytics/AdvancedSection.d.ts +26 -0
- package/dist/components/admin/analytics/AdvancedSection.d.ts.map +1 -0
- package/dist/components/admin/analytics/AdvancedSection.js +143 -0
- package/dist/components/admin/analytics/AdvancedSection.js.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChart.d.ts +20 -0
- package/dist/components/admin/analytics/AnalyticsChart.d.ts.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChart.js +60 -0
- package/dist/components/admin/analytics/AnalyticsChart.js.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChartBars.d.ts +19 -0
- package/dist/components/admin/analytics/AnalyticsChartBars.d.ts.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChartBars.js +43 -0
- package/dist/components/admin/analytics/AnalyticsChartBars.js.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChartDonut.d.ts +11 -0
- package/dist/components/admin/analytics/AnalyticsChartDonut.d.ts.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChartDonut.js +78 -0
- package/dist/components/admin/analytics/AnalyticsChartDonut.js.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChartHeader.d.ts +20 -0
- package/dist/components/admin/analytics/AnalyticsChartHeader.d.ts.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChartHeader.js +105 -0
- package/dist/components/admin/analytics/AnalyticsChartHeader.js.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChartHeat.d.ts +10 -0
- package/dist/components/admin/analytics/AnalyticsChartHeat.d.ts.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChartHeat.js +58 -0
- package/dist/components/admin/analytics/AnalyticsChartHeat.js.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChartLegend.d.ts +9 -0
- package/dist/components/admin/analytics/AnalyticsChartLegend.d.ts.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChartLegend.js +21 -0
- package/dist/components/admin/analytics/AnalyticsChartLegend.js.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChartLine.d.ts +13 -0
- package/dist/components/admin/analytics/AnalyticsChartLine.d.ts.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChartLine.js +36 -0
- package/dist/components/admin/analytics/AnalyticsChartLine.js.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChartRank.d.ts +13 -0
- package/dist/components/admin/analytics/AnalyticsChartRank.d.ts.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChartRank.js +41 -0
- package/dist/components/admin/analytics/AnalyticsChartRank.js.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChartTicks.d.ts +13 -0
- package/dist/components/admin/analytics/AnalyticsChartTicks.d.ts.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChartTicks.js +26 -0
- package/dist/components/admin/analytics/AnalyticsChartTicks.js.map +1 -0
- package/dist/components/admin/analytics/AnalyticsEmpty.d.ts +16 -0
- package/dist/components/admin/analytics/AnalyticsEmpty.d.ts.map +1 -0
- package/dist/components/admin/analytics/AnalyticsEmpty.js +32 -0
- package/dist/components/admin/analytics/AnalyticsEmpty.js.map +1 -0
- package/dist/components/admin/analytics/ClauseLabel.d.ts +15 -0
- package/dist/components/admin/analytics/ClauseLabel.d.ts.map +1 -0
- package/dist/components/admin/analytics/ClauseLabel.js +19 -0
- package/dist/components/admin/analytics/ClauseLabel.js.map +1 -0
- package/dist/components/admin/analytics/CompareNote.d.ts +16 -0
- package/dist/components/admin/analytics/CompareNote.d.ts.map +1 -0
- package/dist/components/admin/analytics/CompareNote.js +33 -0
- package/dist/components/admin/analytics/CompareNote.js.map +1 -0
- package/dist/components/admin/analytics/DatasetSelect.d.ts +20 -0
- package/dist/components/admin/analytics/DatasetSelect.d.ts.map +1 -0
- package/dist/components/admin/analytics/DatasetSelect.js +63 -0
- package/dist/components/admin/analytics/DatasetSelect.js.map +1 -0
- package/dist/components/admin/analytics/FilterEditor.d.ts +24 -0
- package/dist/components/admin/analytics/FilterEditor.d.ts.map +1 -0
- package/dist/components/admin/analytics/FilterEditor.js +129 -0
- package/dist/components/admin/analytics/FilterEditor.js.map +1 -0
- package/dist/components/admin/analytics/FilterValuePicker.d.ts +19 -0
- package/dist/components/admin/analytics/FilterValuePicker.d.ts.map +1 -0
- package/dist/components/admin/analytics/FilterValuePicker.js +131 -0
- package/dist/components/admin/analytics/FilterValuePicker.js.map +1 -0
- package/dist/components/admin/analytics/GroupByChips.d.ts +26 -0
- package/dist/components/admin/analytics/GroupByChips.d.ts.map +1 -0
- package/dist/components/admin/analytics/GroupByChips.js +71 -0
- package/dist/components/admin/analytics/GroupByChips.js.map +1 -0
- package/dist/components/admin/analytics/MeasureChips.d.ts +18 -0
- package/dist/components/admin/analytics/MeasureChips.d.ts.map +1 -0
- package/dist/components/admin/analytics/MeasureChips.js +46 -0
- package/dist/components/admin/analytics/MeasureChips.js.map +1 -0
- package/dist/components/admin/analytics/QueryPanel.d.ts +27 -0
- package/dist/components/admin/analytics/QueryPanel.d.ts.map +1 -0
- package/dist/components/admin/analytics/QueryPanel.js +92 -0
- package/dist/components/admin/analytics/QueryPanel.js.map +1 -0
- package/dist/components/admin/analytics/RangeControl.d.ts +17 -0
- package/dist/components/admin/analytics/RangeControl.d.ts.map +1 -0
- package/dist/components/admin/analytics/RangeControl.js +43 -0
- package/dist/components/admin/analytics/RangeControl.js.map +1 -0
- package/dist/components/admin/analytics/RequestDialog.d.ts +24 -0
- package/dist/components/admin/analytics/RequestDialog.d.ts.map +1 -0
- package/dist/components/admin/analytics/RequestDialog.js +67 -0
- package/dist/components/admin/analytics/RequestDialog.js.map +1 -0
- package/dist/components/admin/analytics/ResultsPane.d.ts +15 -0
- package/dist/components/admin/analytics/ResultsPane.d.ts.map +1 -0
- package/dist/components/admin/analytics/ResultsPane.js +161 -0
- package/dist/components/admin/analytics/ResultsPane.js.map +1 -0
- package/dist/components/admin/analytics/ResultsTable.d.ts +17 -0
- package/dist/components/admin/analytics/ResultsTable.d.ts.map +1 -0
- package/dist/components/admin/analytics/ResultsTable.js +113 -0
- package/dist/components/admin/analytics/ResultsTable.js.map +1 -0
- package/dist/components/admin/analytics/RunFooter.d.ts +18 -0
- package/dist/components/admin/analytics/RunFooter.d.ts.map +1 -0
- package/dist/components/admin/analytics/RunFooter.js +78 -0
- package/dist/components/admin/analytics/RunFooter.js.map +1 -0
- package/dist/components/admin/analytics/SamplingBadge.d.ts +18 -0
- package/dist/components/admin/analytics/SamplingBadge.d.ts.map +1 -0
- package/dist/components/admin/analytics/SamplingBadge.js +35 -0
- package/dist/components/admin/analytics/SamplingBadge.js.map +1 -0
- package/dist/components/admin/analytics/ToggleChip.d.ts +28 -0
- package/dist/components/admin/analytics/ToggleChip.d.ts.map +1 -0
- package/dist/components/admin/analytics/ToggleChip.js +35 -0
- package/dist/components/admin/analytics/ToggleChip.js.map +1 -0
- package/dist/components/admin/analytics/TotalsCards.d.ts +19 -0
- package/dist/components/admin/analytics/TotalsCards.d.ts.map +1 -0
- package/dist/components/admin/analytics/TotalsCards.js +75 -0
- package/dist/components/admin/analytics/TotalsCards.js.map +1 -0
- package/dist/components/admin/analytics/TruncationBanner.d.ts +15 -0
- package/dist/components/admin/analytics/TruncationBanner.d.ts.map +1 -0
- package/dist/components/admin/analytics/TruncationBanner.js +52 -0
- package/dist/components/admin/analytics/TruncationBanner.js.map +1 -0
- package/dist/components/admin/analytics/analyticsModel.d.ts +98 -0
- package/dist/components/admin/analytics/analyticsModel.d.ts.map +1 -0
- package/dist/components/admin/analytics/analyticsModel.js +184 -0
- package/dist/components/admin/analytics/analyticsModel.js.map +1 -0
- package/dist/components/admin/analytics/analyticsTypes.d.ts +116 -0
- package/dist/components/admin/analytics/analyticsTypes.d.ts.map +1 -0
- package/dist/components/admin/analytics/analyticsTypes.js +0 -0
- package/dist/components/admin/analytics/chartModel.d.ts +149 -0
- package/dist/components/admin/analytics/chartModel.d.ts.map +1 -0
- package/dist/components/admin/analytics/chartModel.js +278 -0
- package/dist/components/admin/analytics/chartModel.js.map +1 -0
- package/dist/components/admin/analytics/useAnalyticsQuery.d.ts +62 -0
- package/dist/components/admin/analytics/useAnalyticsQuery.d.ts.map +1 -0
- package/dist/components/admin/analytics/useAnalyticsQuery.js +257 -0
- package/dist/components/admin/analytics/useAnalyticsQuery.js.map +1 -0
- package/dist/components/admin/analytics/useDismissable.d.ts +18 -0
- package/dist/components/admin/analytics/useDismissable.d.ts.map +1 -0
- package/dist/components/admin/analytics/useDismissable.js +37 -0
- package/dist/components/admin/analytics/useDismissable.js.map +1 -0
- package/dist/components/admin/analytics/useFilterValues.d.ts +37 -0
- package/dist/components/admin/analytics/useFilterValues.d.ts.map +1 -0
- package/dist/components/admin/analytics/useFilterValues.js +78 -0
- package/dist/components/admin/analytics/useFilterValues.js.map +1 -0
- package/dist/components/admin/analytics/usePanelWidth.d.ts +26 -0
- package/dist/components/admin/analytics/usePanelWidth.d.ts.map +1 -0
- package/dist/components/admin/analytics/usePanelWidth.js +61 -0
- package/dist/components/admin/analytics/usePanelWidth.js.map +1 -0
- package/dist/components/admin/analytics/useShapeLabels.d.ts +24 -0
- package/dist/components/admin/analytics/useShapeLabels.d.ts.map +1 -0
- package/dist/components/admin/analytics/useShapeLabels.js +41 -0
- package/dist/components/admin/analytics/useShapeLabels.js.map +1 -0
- package/dist/components/admin/parameter-history-item.d.ts.map +1 -1
- package/dist/components/admin/parameter-history-item.js +3 -2
- package/dist/components/admin/parameter-history-item.js.map +1 -1
- package/dist/components/alepha-table/alepha-table-bulk-menu.d.ts +22 -0
- package/dist/components/alepha-table/alepha-table-bulk-menu.d.ts.map +1 -0
- package/dist/components/alepha-table/alepha-table-bulk-menu.js +118 -0
- package/dist/components/alepha-table/alepha-table-bulk-menu.js.map +1 -0
- package/dist/components/alepha-table/alepha-table-filter-dialog.d.ts +60 -0
- package/dist/components/alepha-table/alepha-table-filter-dialog.d.ts.map +1 -0
- package/dist/components/alepha-table/alepha-table-filter-dialog.js +88 -0
- package/dist/components/alepha-table/alepha-table-filter-dialog.js.map +1 -0
- package/dist/components/alepha-table/alepha-table-filter-menu.d.ts +35 -0
- package/dist/components/alepha-table/alepha-table-filter-menu.d.ts.map +1 -0
- package/dist/components/alepha-table/alepha-table-filter-menu.js +54 -0
- package/dist/components/alepha-table/alepha-table-filter-menu.js.map +1 -0
- package/dist/components/alepha-table/alepha-table.d.ts +336 -16
- package/dist/components/alepha-table/alepha-table.d.ts.map +1 -1
- package/dist/components/alepha-table/alepha-table.js +630 -174
- package/dist/components/alepha-table/alepha-table.js.map +1 -1
- package/dist/components/alepha-table/query-filters.d.ts +73 -0
- package/dist/components/alepha-table/query-filters.d.ts.map +1 -0
- package/dist/components/alepha-table/query-filters.js +118 -0
- package/dist/components/alepha-table/query-filters.js.map +1 -0
- package/dist/components/app-actions/app-actions.d.ts +21 -0
- package/dist/components/app-actions/app-actions.d.ts.map +1 -1
- package/dist/components/app-actions/app-actions.js +11 -5
- package/dist/components/app-actions/app-actions.js.map +1 -1
- package/dist/components/app-shell/app-shell.d.ts +75 -11
- package/dist/components/app-shell/app-shell.d.ts.map +1 -1
- package/dist/components/app-shell/app-shell.js +194 -83
- package/dist/components/app-shell/app-shell.js.map +1 -1
- package/dist/components/app-shell/navigation-progress.d.ts +40 -0
- package/dist/components/app-shell/navigation-progress.d.ts.map +1 -0
- package/dist/components/app-shell/navigation-progress.js +86 -0
- package/dist/components/app-shell/navigation-progress.js.map +1 -0
- package/dist/components/auth/auth-register.d.ts +35 -0
- package/dist/components/auth/auth-register.d.ts.map +1 -1
- package/dist/components/auth/auth-register.js +43 -38
- package/dist/components/auth/auth-register.js.map +1 -1
- package/dist/components/auto-form/auto-form.d.ts.map +1 -1
- package/dist/components/auto-form/auto-form.js +69 -28
- package/dist/components/auto-form/auto-form.js.map +1 -1
- package/dist/components/button-dark/button-dark.d.ts.map +1 -1
- package/dist/components/button-dark/button-dark.js +39 -8
- package/dist/components/button-dark/button-dark.js.map +1 -1
- package/dist/components/button-inbox/button-inbox.d.ts +66 -0
- package/dist/components/button-inbox/button-inbox.d.ts.map +1 -0
- package/dist/components/button-inbox/button-inbox.js +167 -0
- package/dist/components/button-inbox/button-inbox.js.map +1 -0
- package/dist/components/button-inbox/inbox-unread-atom.d.ts +22 -0
- package/dist/components/button-inbox/inbox-unread-atom.d.ts.map +1 -0
- package/dist/components/button-inbox/inbox-unread-atom.js +29 -0
- package/dist/components/button-inbox/inbox-unread-atom.js.map +1 -0
- package/dist/components/button-theme/button-theme.d.ts +4 -3
- package/dist/components/button-theme/button-theme.d.ts.map +1 -1
- package/dist/components/button-theme/button-theme.js +8 -25
- package/dist/components/button-theme/button-theme.js.map +1 -1
- package/dist/components/button-user/button-user.d.ts +19 -0
- package/dist/components/button-user/button-user.d.ts.map +1 -1
- package/dist/components/button-user/button-user.js +1 -1
- package/dist/components/button-user/button-user.js.map +1 -1
- package/dist/components/control/control.d.ts +90 -10
- package/dist/components/control/control.d.ts.map +1 -1
- package/dist/components/control/control.js +58 -8
- package/dist/components/control/control.js.map +1 -1
- package/dist/components/control-array/control-array.js +2 -1
- package/dist/components/control-array/control-array.js.map +1 -1
- package/dist/components/control-date/control-date.d.ts +35 -0
- package/dist/components/control-date/control-date.d.ts.map +1 -1
- package/dist/components/control-date/control-date.js +38 -26
- package/dist/components/control-date/control-date.js.map +1 -1
- package/dist/components/control-date/date-only.d.ts +18 -0
- package/dist/components/control-date/date-only.d.ts.map +1 -0
- package/dist/components/control-date/date-only.js +29 -0
- package/dist/components/control-date/date-only.js.map +1 -0
- package/dist/components/control-date-range/control-date-range.d.ts +56 -0
- package/dist/components/control-date-range/control-date-range.d.ts.map +1 -0
- package/dist/components/control-date-range/control-date-range.js +148 -0
- package/dist/components/control-date-range/control-date-range.js.map +1 -0
- package/dist/components/control-object/control-object.js +2 -1
- package/dist/components/control-object/control-object.js.map +1 -1
- package/dist/components/control-select/control-select.d.ts +57 -6
- package/dist/components/control-select/control-select.d.ts.map +1 -1
- package/dist/components/control-select/control-select.js +275 -55
- package/dist/components/control-select/control-select.js.map +1 -1
- package/dist/components/control-upload/control-upload.d.ts.map +1 -1
- package/dist/components/control-upload/control-upload.js +1 -11
- package/dist/components/control-upload/control-upload.js.map +1 -1
- package/dist/components/detail/detail-aside.d.ts.map +1 -1
- package/dist/components/detail/detail-aside.js +4 -3
- package/dist/components/detail/detail-aside.js.map +1 -1
- package/dist/components/detail/detail-layout.d.ts.map +1 -1
- package/dist/components/detail/detail-layout.js +9 -6
- package/dist/components/detail/detail-layout.js.map +1 -1
- package/dist/components/file-image/file-image.js +2 -1
- package/dist/components/file-image/file-image.js.map +1 -1
- package/dist/components/markdown-view/SpoilerSpan.d.ts +28 -0
- package/dist/components/markdown-view/SpoilerSpan.d.ts.map +1 -0
- package/dist/components/markdown-view/SpoilerSpan.js +53 -0
- package/dist/components/markdown-view/SpoilerSpan.js.map +1 -0
- package/dist/components/markdown-view/diagram/MermaidFence.d.ts.map +1 -1
- package/dist/components/markdown-view/diagram/MermaidFence.js +1 -15
- package/dist/components/markdown-view/diagram/MermaidFence.js.map +1 -1
- package/dist/components/markdown-view/diagram/diagramKind.d.ts +18 -0
- package/dist/components/markdown-view/diagram/diagramKind.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/diagramKind.js +27 -0
- package/dist/components/markdown-view/diagram/diagramKind.js.map +1 -0
- package/dist/components/markdown-view/diagram/layoutSequence.js +13 -23
- package/dist/components/markdown-view/diagram/layoutSequence.js.map +1 -1
- package/dist/components/markdown-view/diagram/textMetrics.js +2 -2
- package/dist/components/markdown-view/diagram/textMetrics.js.map +1 -1
- package/dist/components/markdown-view/markdown-view.css +44 -0
- package/dist/components/markdown-view/markdown-view.d.ts +12 -0
- package/dist/components/markdown-view/markdown-view.d.ts.map +1 -1
- package/dist/components/markdown-view/markdown-view.js +22 -1
- package/dist/components/markdown-view/markdown-view.js.map +1 -1
- package/dist/components/markdown-view/remarkSpoiler.d.ts +17 -0
- package/dist/components/markdown-view/remarkSpoiler.d.ts.map +1 -0
- package/dist/components/markdown-view/remarkSpoiler.js +117 -0
- package/dist/components/markdown-view/remarkSpoiler.js.map +1 -0
- package/dist/components/permission-matrix/permission-matrix-group-rows.d.ts +34 -0
- package/dist/components/permission-matrix/permission-matrix-group-rows.d.ts.map +1 -0
- package/dist/components/permission-matrix/permission-matrix-group-rows.js +109 -0
- package/dist/components/permission-matrix/permission-matrix-group-rows.js.map +1 -0
- package/dist/components/permission-matrix/permission-matrix.d.ts +145 -0
- package/dist/components/permission-matrix/permission-matrix.d.ts.map +1 -0
- package/dist/components/permission-matrix/permission-matrix.js +113 -0
- package/dist/components/permission-matrix/permission-matrix.js.map +1 -0
- package/dist/components/plate-layout/plate-layout.d.ts +55 -0
- package/dist/components/plate-layout/plate-layout.d.ts.map +1 -0
- package/dist/components/plate-layout/plate-layout.js +38 -0
- package/dist/components/plate-layout/plate-layout.js.map +1 -0
- package/dist/components/plate-layout/plate-tab-bar.d.ts +65 -0
- package/dist/components/plate-layout/plate-tab-bar.d.ts.map +1 -0
- package/dist/components/plate-layout/plate-tab-bar.js +52 -0
- package/dist/components/plate-layout/plate-tab-bar.js.map +1 -0
- package/dist/components/settings/settings-nav.js +2 -1
- package/dist/components/settings/settings-nav.js.map +1 -1
- package/dist/components/time-ago/time-ago.d.ts +57 -0
- package/dist/components/time-ago/time-ago.d.ts.map +1 -0
- package/dist/components/time-ago/time-ago.js +60 -0
- package/dist/components/time-ago/time-ago.js.map +1 -0
- package/dist/components/tree-view/tree-model.d.ts +128 -0
- package/dist/components/tree-view/tree-model.d.ts.map +1 -0
- package/dist/components/tree-view/tree-model.js +226 -0
- package/dist/components/tree-view/tree-model.js.map +1 -0
- package/dist/components/tree-view/tree-view-rename-input.d.ts +31 -0
- package/dist/components/tree-view/tree-view-rename-input.d.ts.map +1 -0
- package/dist/components/tree-view/tree-view-rename-input.js +68 -0
- package/dist/components/tree-view/tree-view-rename-input.js.map +1 -0
- package/dist/components/tree-view/tree-view-resizer.d.ts +38 -0
- package/dist/components/tree-view/tree-view-resizer.d.ts.map +1 -0
- package/dist/components/tree-view/tree-view-resizer.js +73 -0
- package/dist/components/tree-view/tree-view-resizer.js.map +1 -0
- package/dist/components/tree-view/tree-view-row.d.ts +177 -0
- package/dist/components/tree-view/tree-view-row.d.ts.map +1 -0
- package/dist/components/tree-view/tree-view-row.js +241 -0
- package/dist/components/tree-view/tree-view-row.js.map +1 -0
- package/dist/components/tree-view/tree-view.d.ts +186 -0
- package/dist/components/tree-view/tree-view.d.ts.map +1 -0
- package/dist/components/tree-view/tree-view.js +112 -0
- package/dist/components/tree-view/tree-view.js.map +1 -0
- package/dist/components/tree-view/use-tree-state.d.ts +79 -0
- package/dist/components/tree-view/use-tree-state.d.ts.map +1 -0
- package/dist/components/tree-view/use-tree-state.js +93 -0
- package/dist/components/tree-view/use-tree-state.js.map +1 -0
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +2 -2
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/select.d.ts +7 -0
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/select.js +7 -0
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/sidebar.js +1 -1
- package/dist/components/ui/sidebar.js.map +1 -1
- package/dist/components/ui/table.js.map +1 -1
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/components/use-dialog/use-dialog.d.ts +7 -0
- package/dist/components/use-dialog/use-dialog.d.ts.map +1 -1
- package/dist/components/use-dialog/use-dialog.js +10 -1
- package/dist/components/use-dialog/use-dialog.js.map +1 -1
- package/dist/lib/i18n-fr.d.ts.map +1 -1
- package/dist/lib/i18n-fr.js +141 -54
- package/dist/lib/i18n-fr.js.map +1 -1
- package/dist/lib/utils.d.ts +22 -2
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +29 -5
- package/dist/lib/utils.js.map +1 -1
- package/dist/styles.css +300 -21
- package/package.json +16 -16
- package/src/components/account/__tests__/account-layout.browser.spec.tsx +127 -0
- package/src/components/account/__tests__/account-router.spec.ts +95 -0
- package/src/components/account/account-connections.tsx +14 -1
- package/src/components/account/account-delete-dialog.tsx +3 -2
- package/src/components/account/account-keys.tsx +11 -4
- package/src/components/account/account-layout.tsx +32 -2
- package/src/components/account/account-mfa-dialog.tsx +1 -1
- package/src/components/account/account-password-dialog.tsx +3 -2
- package/src/components/account/account-profile.tsx +1 -1
- package/src/components/account/account-router-options.tsx +45 -0
- package/src/components/account/account-router-page.tsx +11 -1
- package/src/components/account/account-router.tsx +23 -6
- package/src/components/admin/__tests__/admin-audits-action-filter.browser.spec.tsx +53 -0
- package/src/components/admin/__tests__/admin-jobs-payload-dialog.browser.spec.tsx +68 -0
- package/src/components/admin/__tests__/admin-notifications-preview-body.browser.spec.tsx +20 -4
- package/src/components/admin/__tests__/admin-status-labels.browser.spec.tsx +0 -31
- package/src/components/admin/admin-analytics.tsx +97 -83
- package/src/components/admin/admin-audits.tsx +149 -13
- package/src/components/admin/admin-files.tsx +10 -16
- package/src/components/admin/admin-jobs-executions-panel.tsx +152 -114
- package/src/components/admin/admin-jobs-payload-dialog.tsx +57 -0
- package/src/components/admin/admin-keys.tsx +9 -4
- package/src/components/admin/admin-notifications-channel-label.ts +18 -0
- package/src/components/admin/admin-notifications-preview-body.tsx +7 -2
- package/src/components/admin/admin-notifications.tsx +19 -8
- package/src/components/admin/admin-parameters.tsx +165 -12
- package/src/components/admin/admin-payments.tsx +7 -4
- package/src/components/admin/admin-router-options.tsx +12 -0
- package/src/components/admin/admin-router.tsx +5 -27
- package/src/components/admin/admin-sessions.tsx +174 -10
- package/src/components/admin/admin-user-avatar-control.tsx +130 -0
- package/src/components/admin/admin-user-detail-audits-tab.tsx +7 -4
- package/src/components/admin/admin-user-detail-sessions-tab.tsx +7 -4
- package/src/components/admin/admin-user-detail.tsx +25 -3
- package/src/components/admin/admin-users-roles-picker.tsx +4 -0
- package/src/components/admin/admin-users.tsx +6 -3
- package/src/components/admin/analytics/AdvancedSection.tsx +162 -0
- package/src/components/admin/analytics/AnalyticsChart.tsx +69 -0
- package/src/components/admin/analytics/AnalyticsChartBars.tsx +86 -0
- package/src/components/admin/analytics/AnalyticsChartDonut.tsx +78 -0
- package/src/components/admin/analytics/AnalyticsChartHeader.tsx +135 -0
- package/src/components/admin/analytics/AnalyticsChartHeat.tsx +57 -0
- package/src/components/admin/analytics/AnalyticsChartLegend.tsx +26 -0
- package/src/components/admin/analytics/AnalyticsChartLine.tsx +37 -0
- package/src/components/admin/analytics/AnalyticsChartRank.tsx +43 -0
- package/src/components/admin/analytics/AnalyticsChartTicks.tsx +38 -0
- package/src/components/admin/analytics/AnalyticsEmpty.tsx +37 -0
- package/src/components/admin/analytics/ClauseLabel.tsx +26 -0
- package/src/components/admin/analytics/CompareNote.tsx +50 -0
- package/src/components/admin/analytics/DatasetSelect.tsx +79 -0
- package/src/components/admin/analytics/FilterEditor.tsx +173 -0
- package/src/components/admin/analytics/FilterValuePicker.tsx +154 -0
- package/src/components/admin/analytics/GroupByChips.tsx +82 -0
- package/src/components/admin/analytics/MeasureChips.tsx +53 -0
- package/src/components/admin/analytics/QueryPanel.tsx +113 -0
- package/src/components/admin/analytics/RangeControl.tsx +42 -0
- package/src/components/admin/analytics/RequestDialog.tsx +91 -0
- package/src/components/admin/analytics/ResultsPane.tsx +224 -0
- package/src/components/admin/analytics/ResultsTable.tsx +176 -0
- package/src/components/admin/analytics/RunFooter.tsx +90 -0
- package/src/components/admin/analytics/SamplingBadge.tsx +46 -0
- package/src/components/admin/analytics/ToggleChip.tsx +57 -0
- package/src/components/admin/analytics/TotalsCards.tsx +79 -0
- package/src/components/admin/analytics/TruncationBanner.tsx +60 -0
- package/src/components/admin/analytics/analyticsModel.spec.ts +266 -0
- package/src/components/admin/analytics/analyticsModel.ts +263 -0
- package/src/components/admin/analytics/analyticsTypes.ts +139 -0
- package/src/components/admin/analytics/chartModel.spec.ts +240 -0
- package/src/components/admin/analytics/chartModel.ts +427 -0
- package/src/components/admin/analytics/useAnalyticsQuery.ts +401 -0
- package/src/components/admin/analytics/useDismissable.ts +48 -0
- package/src/components/admin/analytics/useFilterValues.ts +113 -0
- package/src/components/admin/analytics/usePanelWidth.ts +85 -0
- package/src/components/admin/analytics/useShapeLabels.ts +73 -0
- package/src/components/admin/parameter-history-item.tsx +4 -2
- package/src/components/alepha-table/__tests__/alepha-table-actions.browser.spec.tsx +117 -0
- package/src/components/alepha-table/__tests__/alepha-table-bulk-menu.browser.spec.tsx +177 -0
- package/src/components/alepha-table/__tests__/alepha-table-bulk-visible.browser.spec.tsx +125 -0
- package/src/components/alepha-table/__tests__/alepha-table-default-hidden.browser.spec.tsx +108 -0
- package/src/components/alepha-table/__tests__/alepha-table-empty-state.browser.spec.tsx +233 -0
- package/src/components/alepha-table/__tests__/alepha-table-persist-facets.browser.spec.tsx +177 -0
- package/src/components/alepha-table/__tests__/alepha-table-persisted-filters.browser.spec.tsx +182 -0
- package/src/components/alepha-table/__tests__/alepha-table-query-seed.browser.spec.tsx +170 -0
- package/src/components/alepha-table/__tests__/alepha-table-row-action-checked.browser.spec.tsx +210 -0
- package/src/components/alepha-table/__tests__/alepha-table-row-action-group.browser.spec.tsx +202 -0
- package/src/components/alepha-table/__tests__/alepha-table-scope.browser.spec.tsx +161 -0
- package/src/components/alepha-table/__tests__/alepha-table-share-filters.browser.spec.tsx +309 -0
- package/src/components/alepha-table/__tests__/query-filters.spec.ts +212 -0
- package/src/components/alepha-table/alepha-table-bulk-menu.tsx +170 -0
- package/src/components/alepha-table/alepha-table-filter-dialog.tsx +162 -0
- package/src/components/alepha-table/alepha-table-filter-menu.tsx +77 -0
- package/src/components/alepha-table/alepha-table.tsx +1375 -230
- package/src/components/alepha-table/query-filters.ts +159 -0
- package/src/components/app-actions/app-actions.tsx +32 -3
- package/src/components/app-shell/__tests__/navigation-progress.browser.spec.tsx +122 -0
- package/src/components/app-shell/__tests__/sidebar-nav-accordion.browser.spec.tsx +163 -0
- package/src/components/app-shell/__tests__/sidebar-nav-auto-close.browser.spec.tsx +170 -0
- package/src/components/app-shell/app-shell.tsx +390 -122
- package/src/components/app-shell/navigation-progress.tsx +110 -0
- package/src/components/auth/auth-register.tsx +72 -9
- package/src/components/auto-form/__tests__/auto-form-fill-groups.browser.spec.tsx +104 -0
- package/src/components/auto-form/__tests__/auto-form-settings-card.browser.spec.tsx +1 -1
- package/src/components/auto-form/auto-form.tsx +111 -33
- package/src/components/button-dark/button-dark.tsx +47 -8
- package/src/components/button-inbox/__tests__/button-inbox.browser.spec.tsx +247 -0
- package/src/components/button-inbox/button-inbox.tsx +303 -0
- package/src/components/button-inbox/inbox-unread-atom.ts +27 -0
- package/src/components/button-theme/button-theme.tsx +16 -29
- package/src/components/button-user/__tests__/button-user-avatar.browser.spec.tsx +88 -0
- package/src/components/button-user/button-user.tsx +24 -1
- package/src/components/control/__tests__/control-date-range.browser.spec.tsx +177 -0
- package/src/components/control/control.tsx +182 -26
- package/src/components/control-date/control-date.tsx +170 -36
- package/src/components/control-date/date-only.ts +26 -0
- package/src/components/control-date-range/control-date-range.tsx +250 -0
- package/src/components/control-select/__tests__/control-select-clear-label.browser.spec.tsx +129 -15
- package/src/components/control-select/__tests__/control-select-deselect.browser.spec.tsx +27 -6
- package/src/components/control-select/__tests__/control-select-multi.browser.spec.tsx +399 -0
- package/src/components/control-select/__tests__/control-select-searchable.browser.spec.tsx +5 -1
- package/src/components/control-select/__tests__/control-select-size-minimal.browser.spec.tsx +195 -0
- package/src/components/control-select/__tests__/control-select-trigger-props.browser.spec.tsx +89 -0
- package/src/components/control-select/control-select.tsx +554 -123
- package/src/components/control-upload/control-upload.tsx +1 -10
- package/src/components/detail/__tests__/detail-layout.browser.spec.tsx +46 -0
- package/src/components/detail/detail-aside.tsx +30 -6
- package/src/components/detail/detail-layout.tsx +37 -7
- package/src/components/markdown-view/SpoilerSpan.tsx +66 -0
- package/src/components/markdown-view/__tests__/markdown-view-spoiler.browser.spec.tsx +165 -0
- package/src/components/markdown-view/diagram/MermaidFence.tsx +1 -23
- package/src/components/markdown-view/diagram/diagramKind.ts +31 -0
- package/src/components/markdown-view/diagram/textMetrics.spec.ts +1 -1
- package/src/components/markdown-view/diagram/textMetrics.ts +2 -2
- package/src/components/markdown-view/markdown-view.css +44 -0
- package/src/components/markdown-view/markdown-view.tsx +37 -1
- package/src/components/markdown-view/remarkSpoiler.ts +150 -0
- package/src/components/permission-matrix/__tests__/permission-matrix.browser.spec.tsx +237 -0
- package/src/components/permission-matrix/permission-matrix-group-rows.tsx +240 -0
- package/src/components/permission-matrix/permission-matrix.tsx +286 -0
- package/src/components/plate-layout/__tests__/plate-layout.browser.spec.tsx +189 -0
- package/src/components/plate-layout/plate-layout.tsx +84 -0
- package/src/components/plate-layout/plate-tab-bar.tsx +148 -0
- package/src/components/time-ago/time-ago.browser.spec.tsx +110 -0
- package/src/components/time-ago/time-ago.tsx +80 -0
- package/src/components/tree-view/__tests__/tree-model.spec.ts +441 -0
- package/src/components/tree-view/__tests__/tree-view-drag.browser.spec.tsx +295 -0
- package/src/components/tree-view/__tests__/tree-view-rename.browser.spec.tsx +278 -0
- package/src/components/tree-view/__tests__/tree-view-resizer.browser.spec.tsx +112 -0
- package/src/components/tree-view/__tests__/tree-view.browser.spec.tsx +260 -0
- package/src/components/tree-view/__tests__/use-tree-state.browser.spec.tsx +238 -0
- package/src/components/tree-view/tree-model.ts +369 -0
- package/src/components/tree-view/tree-view-rename-input.tsx +95 -0
- package/src/components/tree-view/tree-view-resizer.tsx +83 -0
- package/src/components/tree-view/tree-view-row.tsx +414 -0
- package/src/components/tree-view/tree-view.tsx +300 -0
- package/src/components/tree-view/use-tree-state.ts +184 -0
- package/src/components/ui/button.tsx +80 -2
- package/src/components/ui/dropdown-menu.tsx +1 -1
- package/src/components/ui/select.tsx +7 -0
- package/src/components/ui/table.tsx +1 -1
- package/src/components/ui/tooltip.tsx +1 -1
- package/src/components/use-dialog/use-dialog.tsx +10 -0
- package/src/lib/i18n-fr.ts +155 -58
- package/src/lib/utils.ts +32 -4
- package/src/styles.css +300 -21
- package/dist/components/admin/admin-analytics-query-panel.d.ts +0 -16
- package/dist/components/admin/admin-analytics-query-panel.d.ts.map +0 -1
- package/dist/components/admin/admin-analytics-query-panel.js +0 -117
- package/dist/components/admin/admin-analytics-query-panel.js.map +0 -1
- package/dist/components/admin/admin-analytics-results.d.ts +0 -15
- package/dist/components/admin/admin-analytics-results.d.ts.map +0 -1
- package/dist/components/admin/admin-analytics-results.js +0 -56
- package/dist/components/admin/admin-analytics-results.js.map +0 -1
- package/dist/components/admin/admin-workflows-execution-sheet.d.ts +0 -11
- package/dist/components/admin/admin-workflows-execution-sheet.d.ts.map +0 -1
- package/dist/components/admin/admin-workflows-execution-sheet.js +0 -190
- package/dist/components/admin/admin-workflows-execution-sheet.js.map +0 -1
- package/dist/components/admin/admin-workflows-executions-panel.d.ts +0 -9
- package/dist/components/admin/admin-workflows-executions-panel.d.ts.map +0 -1
- package/dist/components/admin/admin-workflows-executions-panel.js +0 -121
- package/dist/components/admin/admin-workflows-executions-panel.js.map +0 -1
- package/dist/components/admin/admin-workflows-status-badge.d.ts +0 -12
- package/dist/components/admin/admin-workflows-status-badge.d.ts.map +0 -1
- package/dist/components/admin/admin-workflows-status-badge.js +0 -30
- package/dist/components/admin/admin-workflows-status-badge.js.map +0 -1
- package/dist/components/admin/admin-workflows-status-labels.d.ts +0 -19
- package/dist/components/admin/admin-workflows-status-labels.d.ts.map +0 -1
- package/dist/components/admin/admin-workflows-status-labels.js +0 -48
- package/dist/components/admin/admin-workflows-status-labels.js.map +0 -1
- package/dist/components/admin/admin-workflows.d.ts +0 -4
- package/dist/components/admin/admin-workflows.d.ts.map +0 -1
- package/dist/components/admin/admin-workflows.js +0 -145
- package/dist/components/admin/admin-workflows.js.map +0 -1
- package/src/components/admin/admin-analytics-query-panel.tsx +0 -150
- package/src/components/admin/admin-analytics-results.tsx +0 -95
- package/src/components/admin/admin-workflows-execution-sheet.tsx +0 -285
- package/src/components/admin/admin-workflows-executions-panel.tsx +0 -169
- package/src/components/admin/admin-workflows-status-badge.tsx +0 -41
- package/src/components/admin/admin-workflows-status-labels.ts +0 -51
- package/src/components/admin/admin-workflows.tsx +0 -209
|
@@ -1,17 +1,24 @@
|
|
|
1
|
+
import { useIsMobile } from "../../hooks/use-mobile.js";
|
|
1
2
|
import { cn } from "../../lib/utils.js";
|
|
2
3
|
import { Button } from "../ui/button.js";
|
|
4
|
+
import { useToast } from "../use-toast/use-toast.js";
|
|
3
5
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../ui/tooltip.js";
|
|
4
|
-
import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from "../ui/dropdown-menu.js";
|
|
6
|
+
import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "../ui/dropdown-menu.js";
|
|
7
|
+
import { Control } from "../control/control.js";
|
|
8
|
+
import { AlephaTableBulkMenu } from "./alepha-table-bulk-menu.js";
|
|
9
|
+
import { AlephaTableFilterDialog } from "./alepha-table-filter-dialog.js";
|
|
10
|
+
import { AlephaTableFilterMenu } from "./alepha-table-filter-menu.js";
|
|
5
11
|
import { Checkbox } from "../ui/checkbox.js";
|
|
6
|
-
import {
|
|
7
|
-
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../ui/select.js";
|
|
12
|
+
import { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuSeparator, ContextMenuTrigger } from "../ui/context-menu.js";
|
|
8
13
|
import { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious } from "../ui/pagination.js";
|
|
9
14
|
import { Skeleton } from "../ui/skeleton.js";
|
|
15
|
+
import { Table as Table$1, TableBody, TableCell, TableHead, TableHeader, TableRow } from "../ui/table.js";
|
|
10
16
|
import { paginateLocal } from "./paginate-local.js";
|
|
17
|
+
import { cleanFilterValues, queryToFilters, shareFiltersUrl } from "./query-filters.js";
|
|
11
18
|
import { useTableSelection } from "./use-table-selection.js";
|
|
12
19
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
13
20
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
-
import { ArrowDown, ArrowUp, ChevronsUpDown, Columns3, FunnelX, Inbox, MoreVertical, RefreshCw, X } from "lucide-react";
|
|
21
|
+
import { ArrowDown, ArrowDownAZ, ArrowUp, ArrowUpAZ, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, ChevronsUpDown, Columns3, EyeOff, FunnelX, GripVertical, Inbox, MoreVertical, RefreshCw, SearchX, X } from "lucide-react";
|
|
15
22
|
import { z } from "alepha";
|
|
16
23
|
import { useI18n } from "alepha/react/i18n";
|
|
17
24
|
import { ClientOnly, useAlepha } from "alepha/react";
|
|
@@ -31,6 +38,38 @@ const readPersisted = (key, suffix) => {
|
|
|
31
38
|
}
|
|
32
39
|
};
|
|
33
40
|
/**
|
|
41
|
+
* Reshape persisted filter values that no longer match the schema.
|
|
42
|
+
*
|
|
43
|
+
* Filters are stored in localStorage per `persistenceKey`, so a filter whose
|
|
44
|
+
* shape changes meets values written by the previous shape - on the machine
|
|
45
|
+
* of anyone who has used the page, and only there, which is precisely the
|
|
46
|
+
* class of bug no test environment contains. The first case was the Quests
|
|
47
|
+
* table going from one value per filter to many (quest #1644): a stored
|
|
48
|
+
* `area: "lore/feedback"` reaching an array field.
|
|
49
|
+
*
|
|
50
|
+
* A scalar where the schema now wants an array is WRAPPED, not dropped: the
|
|
51
|
+
* reader's filter survives the change, which is what makes the migration
|
|
52
|
+
* invisible. The reverse takes the first element, since there is no honest
|
|
53
|
+
* way to keep the rest. Anything else is left alone - this reconciles a
|
|
54
|
+
* container, not a value, and the form's own validation still has the last
|
|
55
|
+
* word.
|
|
56
|
+
*/
|
|
57
|
+
const reconcilePersistedFilters = (schema, values) => {
|
|
58
|
+
if (!schema || !values) return values;
|
|
59
|
+
const shape = z.schema.shape(schema);
|
|
60
|
+
const out = {};
|
|
61
|
+
for (const [key, value] of Object.entries(values)) {
|
|
62
|
+
const field = shape[key];
|
|
63
|
+
if (!field) continue;
|
|
64
|
+
const wantsArray = z.schema.isArray(z.schema.unwrap(field));
|
|
65
|
+
const isArray = Array.isArray(value);
|
|
66
|
+
if (wantsArray && !isArray) out[key] = value === void 0 || value === "" ? [] : [value];
|
|
67
|
+
else if (!wantsArray && isArray) out[key] = value[0];
|
|
68
|
+
else out[key] = value;
|
|
69
|
+
}
|
|
70
|
+
return out;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
34
73
|
* Synchronous localStorage write. Empty objects/null delete the key.
|
|
35
74
|
*/
|
|
36
75
|
const writePersisted = (key, suffix, value) => {
|
|
@@ -60,18 +99,109 @@ const PAGE_SIZES = [
|
|
|
60
99
|
50,
|
|
61
100
|
100
|
|
62
101
|
];
|
|
102
|
+
/**
|
|
103
|
+
* The three persisted preferences, read for one `persistenceKey`.
|
|
104
|
+
*
|
|
105
|
+
* Factored out because they are read from TWO places now: once at mount, and
|
|
106
|
+
* again whenever the key changes under a mounted table. Inline in `useState`
|
|
107
|
+
* they could only be read once, and a second copy of each rule is how the
|
|
108
|
+
* scope-change path would come to disagree with the mount path about what a
|
|
109
|
+
* stored value means.
|
|
110
|
+
*/
|
|
111
|
+
const persistedSort = (key, fallback) => {
|
|
112
|
+
return (key ? readPersisted(key, "sort") : void 0) ?? fallback ?? null;
|
|
113
|
+
};
|
|
114
|
+
const persistedSize = (key, fallback) => {
|
|
115
|
+
return (key ? readPersisted(key, "size") : void 0) ?? fallback ?? 20;
|
|
116
|
+
};
|
|
117
|
+
const persistedColumns = (key, columns) => {
|
|
118
|
+
const stored = key ? readPersisted(key, "columns") : void 0;
|
|
119
|
+
if (stored) return new Set(stored.filter((k) => k in columns));
|
|
120
|
+
return new Set(Object.keys(columns).filter((k) => !columns[k].defaultHidden));
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* The reader's column order, reconciled against what the table actually
|
|
124
|
+
* declares.
|
|
125
|
+
*
|
|
126
|
+
* Reconciliation is the whole of this function and the reason it is not just
|
|
127
|
+
* `readPersisted`. A stored array is a snapshot of the columns as they were
|
|
128
|
+
* when somebody last dragged one, and the code has moved since: a column
|
|
129
|
+
* added in a later release is missing from it, one removed is still in it.
|
|
130
|
+
* Trusting it verbatim would drop the new column from the table entirely and
|
|
131
|
+
* try to render a dead one.
|
|
132
|
+
*
|
|
133
|
+
* New keys go to the END rather than at their declared index. That is the
|
|
134
|
+
* rule with the least surprise: the reader's layout is left exactly as they
|
|
135
|
+
* arranged it, and the new column turns up somewhere predictable where the
|
|
136
|
+
* picker can find it. Splicing it in by declaration index would put it at a
|
|
137
|
+
* position matching neither the author's intent (the rest of the order is not
|
|
138
|
+
* the declared one any more) nor the reader's.
|
|
139
|
+
*/
|
|
140
|
+
const reconcileOrder = (stored, declared) => {
|
|
141
|
+
if (!stored) return declared;
|
|
142
|
+
const known = new Set(declared);
|
|
143
|
+
const kept = stored.filter((key) => known.has(key));
|
|
144
|
+
const seen = new Set(kept);
|
|
145
|
+
return [...kept, ...declared.filter((key) => !seen.has(key))];
|
|
146
|
+
};
|
|
147
|
+
const persistedOrder = (key, columns) => reconcileOrder(key ? readPersisted(key, "columnOrder") : void 0, Object.keys(columns));
|
|
63
148
|
function AlephaTable(props) {
|
|
64
|
-
|
|
149
|
+
/**
|
|
150
|
+
* `persistenceKey`, once per facet.
|
|
151
|
+
*
|
|
152
|
+
* A facet that is off gets `undefined`, which is the same value every
|
|
153
|
+
* persistence helper here already treats as "do not store" - so turning one
|
|
154
|
+
* off takes the branch a table with no key has always taken, rather than a
|
|
155
|
+
* new one. That is what keeps the default behaviour of `persistenceKey`
|
|
156
|
+
* exactly as it was: with `persist` absent, all three of these ARE
|
|
157
|
+
* `props.persistenceKey`.
|
|
158
|
+
*
|
|
159
|
+
* Primitives, so they go straight into the dependency arrays and `useState`
|
|
160
|
+
* initializers below without giving any of them a new identity per render.
|
|
161
|
+
*/
|
|
162
|
+
const filtersKey = props.persist?.filters === false ? void 0 : props.persistenceKey;
|
|
163
|
+
const columnsKey = props.persist?.columns === false ? void 0 : props.persistenceKey;
|
|
164
|
+
const sortKey = props.persist?.sort === false ? void 0 : props.persistenceKey;
|
|
165
|
+
const [size, setSize] = useState(() => persistedSize(props.persistenceKey, props.defaultSize));
|
|
65
166
|
const pageSizes = props.pageSizes ?? PAGE_SIZES;
|
|
66
167
|
const alepha = useAlepha();
|
|
67
168
|
const { tr } = useI18n();
|
|
169
|
+
const toast = useToast();
|
|
170
|
+
/**
|
|
171
|
+
* The whole of the phone layout, and deliberately one switch rather than a
|
|
172
|
+
* scattering of `max-md:` classes: the filter controls have to be rendered
|
|
173
|
+
* in exactly ONE of the two places (see `AlephaTableFilterDialog`), which
|
|
174
|
+
* CSS cannot express. Everything else below the breakpoint follows the same
|
|
175
|
+
* flag so the two halves of the layout cannot disagree.
|
|
176
|
+
*
|
|
177
|
+
* Safe against hydration because the whole table sits inside `ClientOnly`,
|
|
178
|
+
* and `useIsMobile` reads the same `MediaQueryList` it subscribes to.
|
|
179
|
+
*/
|
|
180
|
+
const isMobile = useIsMobile();
|
|
68
181
|
const persistedFilterValues = useMemo(() => {
|
|
69
|
-
if (!
|
|
70
|
-
return
|
|
71
|
-
}, [
|
|
182
|
+
if (!filtersKey || !props.filters) return void 0;
|
|
183
|
+
return reconcilePersistedFilters(props.filters.schema, readPersisted(filtersKey, "filters"));
|
|
184
|
+
}, [filtersKey, props.filters]);
|
|
185
|
+
/**
|
|
186
|
+
* Filter values the URL carries, when the caller opted in with `fromQuery`.
|
|
187
|
+
*
|
|
188
|
+
* Read from the store rather than through `useRouterState`, on purpose:
|
|
189
|
+
* this is a one-shot read at mount, so the subscription would only buy a
|
|
190
|
+
* re-render of the whole table on navigations it must not react to anyway.
|
|
191
|
+
* A missing store (a table mounted with no router at all) reads as no
|
|
192
|
+
* query, not as a crash.
|
|
193
|
+
*/
|
|
194
|
+
const queryFilterValues = useMemo(() => {
|
|
195
|
+
const fromQuery = props.filters?.fromQuery;
|
|
196
|
+
if (!fromQuery || !props.filters) return void 0;
|
|
197
|
+
const query = alepha.store.get("alepha.react.router.state")?.query;
|
|
198
|
+
if (!query) return void 0;
|
|
199
|
+
return queryToFilters(alepha, props.filters.schema, query, Array.isArray(fromQuery) ? fromQuery : void 0);
|
|
200
|
+
}, []);
|
|
72
201
|
const mergedFilterInitialValues = useMemo(() => ({
|
|
73
202
|
...props.filters?.initialValues,
|
|
74
203
|
...persistedFilterValues,
|
|
204
|
+
...queryFilterValues,
|
|
75
205
|
...props.filters?.seedValues
|
|
76
206
|
}), []);
|
|
77
207
|
const internalForm = useForm({
|
|
@@ -94,13 +224,25 @@ function AlephaTable(props) {
|
|
|
94
224
|
setPage(0);
|
|
95
225
|
if (props.persistenceKey) writePersisted(props.persistenceKey, "size", next);
|
|
96
226
|
};
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
227
|
+
/**
|
|
228
|
+
* The footer's page-size picker, as a form of one field.
|
|
229
|
+
*
|
|
230
|
+
* `Control` is form-bound and this picker is not part of any form, which is
|
|
231
|
+
* why the footer stayed on a raw `<Select>` long after everything else here
|
|
232
|
+
* moved. One field is the whole cost of joining, and it buys the picker the
|
|
233
|
+
* same trigger, popup and keyboard handling as every other select in the
|
|
234
|
+
* table. `keepDirty: false` so the re-seed below actually re-seeds: `size`
|
|
235
|
+
* can move without the picker (a persisted value on mount), and a kept
|
|
236
|
+
* "edit" would pin the trigger to a page size the table is not using.
|
|
237
|
+
*/
|
|
238
|
+
const sizeForm = useForm({
|
|
239
|
+
schema: z.object({ size: z.number() }),
|
|
240
|
+
initialValues: { size },
|
|
241
|
+
keepDirty: false,
|
|
242
|
+
handler: async () => {},
|
|
243
|
+
onChange: (_key, next) => changeSize(next)
|
|
103
244
|
});
|
|
245
|
+
const [sort, setSort] = useState(() => persistedSort(sortKey, props.defaultSort));
|
|
104
246
|
const [fetchedData, setData] = useState([]);
|
|
105
247
|
const [fetchedMeta, setMeta] = useState(null);
|
|
106
248
|
const [loading, setLoading] = useState(false);
|
|
@@ -188,9 +330,9 @@ function AlephaTable(props) {
|
|
|
188
330
|
if (page > 0 && page > totalPages - 1) setPage(Math.max(0, totalPages - 1));
|
|
189
331
|
}
|
|
190
332
|
useEffect(() => {
|
|
191
|
-
if (!
|
|
192
|
-
writePersisted(
|
|
193
|
-
}, [
|
|
333
|
+
if (!sortKey) return;
|
|
334
|
+
writePersisted(sortKey, "sort", sort);
|
|
335
|
+
}, [sortKey, sort]);
|
|
194
336
|
const refresh = useCallback(() => {
|
|
195
337
|
setPage(0);
|
|
196
338
|
setRefreshKey((k) => k + 1);
|
|
@@ -211,6 +353,34 @@ function AlephaTable(props) {
|
|
|
211
353
|
const keys = Object.keys(z.schema.shape(props.filters.schema));
|
|
212
354
|
for (const key of keys) form.input[key]?.set?.(void 0);
|
|
213
355
|
}, [form, props.filters]);
|
|
356
|
+
/**
|
|
357
|
+
* Copy a link that opens this table with these filters.
|
|
358
|
+
*
|
|
359
|
+
* The write half of `fromQuery`, and the only one: nothing puts the
|
|
360
|
+
* filters in the address bar as the reader types, so a link out of a
|
|
361
|
+
* filtered table has to be asked for. Built on the page's own URL, so the
|
|
362
|
+
* params the page owns travel with it.
|
|
363
|
+
*/
|
|
364
|
+
/**
|
|
365
|
+
* Whether a link out of this table would do anything on arrival.
|
|
366
|
+
*
|
|
367
|
+
* A table that does not read the query back would copy a URL whose params
|
|
368
|
+
* are inert, which is worse than no Share at all: it looks like it worked.
|
|
369
|
+
*/
|
|
370
|
+
const canShare = Boolean(props.filters?.fromQuery);
|
|
371
|
+
const shareFilters = useCallback(async () => {
|
|
372
|
+
if (!props.filters || !form) return;
|
|
373
|
+
const url = shareFiltersUrl(window.location.href, Object.keys(z.schema.shape(props.filters.schema)), cleanFilterValues(form.currentValues ?? {}));
|
|
374
|
+
try {
|
|
375
|
+
await navigator.clipboard.writeText(url);
|
|
376
|
+
toast.success(tr("alephaTable.shareFiltersCopied", { default: "Link copied" }));
|
|
377
|
+
} catch {}
|
|
378
|
+
}, [
|
|
379
|
+
form,
|
|
380
|
+
props.filters,
|
|
381
|
+
toast,
|
|
382
|
+
tr
|
|
383
|
+
]);
|
|
214
384
|
useEffect(() => {
|
|
215
385
|
if (!form) return;
|
|
216
386
|
return alepha.events.on("form:submit:success", (event) => {
|
|
@@ -241,23 +411,16 @@ function AlephaTable(props) {
|
|
|
241
411
|
autoApply
|
|
242
412
|
]);
|
|
243
413
|
useEffect(() => {
|
|
244
|
-
if (!
|
|
245
|
-
const
|
|
246
|
-
|
|
247
|
-
const values = form.currentValues ?? {};
|
|
248
|
-
for (const [k, v] of Object.entries(values)) {
|
|
249
|
-
if (v === void 0 || v === null || v === "") continue;
|
|
250
|
-
if (Array.isArray(v) && v.length === 0) continue;
|
|
251
|
-
clean[k] = v;
|
|
252
|
-
}
|
|
253
|
-
writePersisted(props.persistenceKey, "filters", clean);
|
|
414
|
+
if (!filtersKey || !form || !props.filters) return;
|
|
415
|
+
const writeFilters = () => {
|
|
416
|
+
writePersisted(filtersKey, "filters", cleanFilterValues(form.currentValues ?? {}));
|
|
254
417
|
};
|
|
255
418
|
const unsubs = [alepha.events.on("form:change", (event) => {
|
|
256
419
|
if (event.id !== form.id) return;
|
|
257
|
-
|
|
420
|
+
writeFilters();
|
|
258
421
|
}), alepha.events.on("form:submit:success", (event) => {
|
|
259
422
|
if (event.id !== form.id) return;
|
|
260
|
-
|
|
423
|
+
writeFilters();
|
|
261
424
|
})];
|
|
262
425
|
return () => {
|
|
263
426
|
for (const u of unsubs) u();
|
|
@@ -266,7 +429,7 @@ function AlephaTable(props) {
|
|
|
266
429
|
alepha,
|
|
267
430
|
form,
|
|
268
431
|
props.filters,
|
|
269
|
-
|
|
432
|
+
filtersKey
|
|
270
433
|
]);
|
|
271
434
|
useEffect(() => {
|
|
272
435
|
if (!props.pollMs) return;
|
|
@@ -305,7 +468,9 @@ function AlephaTable(props) {
|
|
|
305
468
|
data.forEach((item, index) => map.set(item, rowKeys[index]));
|
|
306
469
|
return map;
|
|
307
470
|
}, [data, rowKeys]);
|
|
308
|
-
const
|
|
471
|
+
const rowKey = useCallback((item) => rowKeyByItem.get(item) ?? "", [rowKeyByItem]);
|
|
472
|
+
const { selection, selectedItems, allSelected, someSelected, toggleRow, toggleAll, clearSelection } = useTableSelection(data, rowKey);
|
|
473
|
+
const visibleBulkActions = useMemo(() => (props.bulkActions ?? []).filter((action) => action.visible?.(selectedItems) ?? true), [props.bulkActions, selectedItems]);
|
|
309
474
|
const toggleSort = (col, def) => {
|
|
310
475
|
if (!def.sortable) return;
|
|
311
476
|
const field = def.sortKey ?? col;
|
|
@@ -321,27 +486,145 @@ function AlephaTable(props) {
|
|
|
321
486
|
return next;
|
|
322
487
|
});
|
|
323
488
|
};
|
|
489
|
+
/**
|
|
490
|
+
* Sort in a named direction, or clear it.
|
|
491
|
+
*
|
|
492
|
+
* The header cycles; the menu states. Both write the same state, so a
|
|
493
|
+
* column sorted from the menu shows the header's own arrow.
|
|
494
|
+
*/
|
|
495
|
+
const setSortTo = (col, def, direction) => {
|
|
496
|
+
if (!def.sortable) return;
|
|
497
|
+
const field = def.sortKey ?? col;
|
|
498
|
+
const next = direction ? {
|
|
499
|
+
field,
|
|
500
|
+
direction
|
|
501
|
+
} : null;
|
|
502
|
+
setSort(next);
|
|
503
|
+
props.onSortChange?.(next);
|
|
504
|
+
};
|
|
324
505
|
const allColumnKeys = useMemo(() => Object.keys(props.columns), [props.columns]);
|
|
325
|
-
const [visibleColumns, setVisibleColumns] = useState(() =>
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
506
|
+
const [visibleColumns, setVisibleColumns] = useState(() => persistedColumns(columnsKey, props.columns));
|
|
507
|
+
/**
|
|
508
|
+
* The reader's column order. Held as the raw preference and reconciled on
|
|
509
|
+
* every read below, so a caller adding a column at runtime is handled by
|
|
510
|
+
* the same code path as a stale stored array.
|
|
511
|
+
*/
|
|
512
|
+
const [columnOrder, setColumnOrder] = useState(() => persistedOrder(columnsKey, props.columns));
|
|
513
|
+
const orderedKeys = useMemo(() => reconcileOrder(columnOrder, allColumnKeys), [columnOrder, allColumnKeys]);
|
|
514
|
+
/**
|
|
515
|
+
* Move one column one slot, within the VISIBLE sequence.
|
|
516
|
+
*
|
|
517
|
+
* Over the visible columns and not the full order, because nudging a column
|
|
518
|
+
* past a hidden one would look like nothing happened - the reader would
|
|
519
|
+
* press "move left" and see the table unchanged. A swap rather than a
|
|
520
|
+
* splice, so the hidden columns between the two keep their places.
|
|
521
|
+
*/
|
|
522
|
+
const moveColumn = (key, delta) => {
|
|
523
|
+
const visible = orderedKeys.filter((k) => visibleColumns.has(k));
|
|
524
|
+
const at = visible.indexOf(key);
|
|
525
|
+
const target = visible[at + delta];
|
|
526
|
+
if (at < 0 || target === void 0) return;
|
|
527
|
+
const next = [...orderedKeys];
|
|
528
|
+
const from = next.indexOf(key);
|
|
529
|
+
const to = next.indexOf(target);
|
|
530
|
+
next[from] = target;
|
|
531
|
+
next[to] = key;
|
|
532
|
+
commitOrder(next);
|
|
533
|
+
setOrderAnnouncement(String(tr("alephaTable.columnMoved", {
|
|
534
|
+
default: `${String(props.columns[key]?.label ?? key)} moved to position ${at + delta + 1} of ${visible.length}`,
|
|
535
|
+
args: [
|
|
536
|
+
String(props.columns[key]?.label ?? key),
|
|
537
|
+
String(at + delta + 1),
|
|
538
|
+
String(visible.length)
|
|
539
|
+
]
|
|
540
|
+
})));
|
|
541
|
+
};
|
|
542
|
+
/**
|
|
543
|
+
* Drop `key` onto `target`'s slot, which is what a drag in the column
|
|
544
|
+
* picker means. Unlike {@link moveColumn} this walks the FULL order: the
|
|
545
|
+
* picker lists hidden columns too, so a drag there can legitimately cross
|
|
546
|
+
* one.
|
|
547
|
+
*/
|
|
548
|
+
const reorderColumn = (key, target) => {
|
|
549
|
+
if (key === target) return;
|
|
550
|
+
const next = orderedKeys.filter((k) => k !== key);
|
|
551
|
+
next.splice(next.indexOf(target), 0, key);
|
|
552
|
+
commitOrder(next);
|
|
553
|
+
};
|
|
554
|
+
const commitOrder = (next) => {
|
|
555
|
+
setColumnOrder(next);
|
|
556
|
+
if (columnsKey) writePersisted(columnsKey, "columnOrder", next);
|
|
557
|
+
};
|
|
558
|
+
/**
|
|
559
|
+
* What the live region says after a move. Cleared and re-set on each one,
|
|
560
|
+
* so two moves in a row are both announced.
|
|
561
|
+
*/
|
|
562
|
+
const [orderAnnouncement, setOrderAnnouncement] = useState("");
|
|
563
|
+
/**
|
|
564
|
+
* ⚠️ A changed `persistenceKey` is a changed SCOPE, and this is where that
|
|
565
|
+
* is handled.
|
|
566
|
+
*
|
|
567
|
+
* Every caller encodes its scope in that key - `lor.activity.${project.id}`,
|
|
568
|
+
* `lor.epics.${project.id}` - so switching project changes it. Nothing acted
|
|
569
|
+
* on that before, and `load` re-runs only on `[page, size, sortParam,
|
|
570
|
+
* refreshKey, form, alepha]`, none of which a project switch touches. The
|
|
571
|
+
* router does not remount on a param-only navigation either, so the table
|
|
572
|
+
* kept serving the PREVIOUS project's rows under the new project's name
|
|
573
|
+
* (feedback #2096).
|
|
574
|
+
*
|
|
575
|
+
* `refreshKey` is bumped rather than relying on the re-read: two projects
|
|
576
|
+
* can share a stored sort and size, and then no dependency of `load` would
|
|
577
|
+
* change and nothing would refetch. That equality is the bug's whole
|
|
578
|
+
* mechanism, so the refetch cannot be a side effect of the values moving.
|
|
579
|
+
*
|
|
580
|
+
* ⚠️ Adjusted during RENDER, not in an effect, and that is load-bearing.
|
|
581
|
+
* The sort and columns effects below are keyed on `persistenceKey` too, so
|
|
582
|
+
* on the render where it changes they would fire in the same flush and
|
|
583
|
+
* write the OUTGOING scope's state under the INCOMING key - silently
|
|
584
|
+
* overwriting the project you just opened with the one you just left. React
|
|
585
|
+
* re-renders before committing this, so by the time those effects run the
|
|
586
|
+
* state is already the new scope's and they write back what was just read.
|
|
587
|
+
*
|
|
588
|
+
* ⚠️ `props.fetch` is still NOT a dependency of `load`. That is the loop
|
|
589
|
+
* `fetchRef` exists to prevent, and several callers write a store atom from
|
|
590
|
+
* inside their fetcher.
|
|
591
|
+
*
|
|
592
|
+
* Filter VALUES are deliberately not reset here: `useForm` captures its
|
|
593
|
+
* `initialValues` once, so resetting them is form surgery rather than a
|
|
594
|
+
* state assignment. They are also not clobbered - the filter-persist effect
|
|
595
|
+
* writes only on `form:change` / `form:submit:success`, never on mount - so
|
|
596
|
+
* the stored filters of the project you left stay its own.
|
|
597
|
+
*/
|
|
598
|
+
const scopeRef = useRef(props.persistenceKey);
|
|
599
|
+
if (scopeRef.current !== props.persistenceKey) {
|
|
600
|
+
scopeRef.current = props.persistenceKey;
|
|
601
|
+
setPage(0);
|
|
602
|
+
setSize(persistedSize(props.persistenceKey, props.defaultSize));
|
|
603
|
+
setSort(persistedSort(sortKey, props.defaultSort));
|
|
604
|
+
setVisibleColumns(persistedColumns(columnsKey, props.columns));
|
|
605
|
+
setColumnOrder(persistedOrder(columnsKey, props.columns));
|
|
606
|
+
setRefreshKey((k) => k + 1);
|
|
607
|
+
}
|
|
608
|
+
/**
|
|
609
|
+
* Written on a TOGGLE, never on mount - the same rule the filter-persist
|
|
610
|
+
* effect follows above, and for the same reason.
|
|
611
|
+
*
|
|
612
|
+
* As a mount effect this stamped the current set into storage on first
|
|
613
|
+
* paint, which froze the column layout of every reader who had merely
|
|
614
|
+
* OPENED the table. A `defaultHidden` added to a column afterwards then did
|
|
615
|
+
* nothing for them, permanently and with no way to notice: the stored set
|
|
616
|
+
* had no `defaultHidden` in it to be out of date. It also made
|
|
617
|
+
* `defaultHidden` unusable as a controlled prop, since a remount read back
|
|
618
|
+
* what the previous mount had written rather than the new default.
|
|
619
|
+
*/
|
|
336
620
|
const toggleColumn = (id) => {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
});
|
|
621
|
+
const next = new Set(visibleColumns);
|
|
622
|
+
if (next.has(id)) next.delete(id);
|
|
623
|
+
else next.add(id);
|
|
624
|
+
setVisibleColumns(next);
|
|
625
|
+
if (columnsKey) writePersisted(columnsKey, "columns", [...next]);
|
|
343
626
|
};
|
|
344
|
-
const visibleCols =
|
|
627
|
+
const visibleCols = orderedKeys.map((key) => [key, props.columns[key]]).filter(([key]) => visibleColumns.has(key));
|
|
345
628
|
const hasCheckbox = Boolean(props.bulkActions?.length);
|
|
346
629
|
const hasRowActions = Boolean(props.rowActions);
|
|
347
630
|
const rowCtx = useMemo(() => ({ refresh }), [refresh]);
|
|
@@ -349,20 +632,27 @@ function AlephaTable(props) {
|
|
|
349
632
|
refresh,
|
|
350
633
|
clearSelection
|
|
351
634
|
}), [refresh, clearSelection]);
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
return
|
|
635
|
+
/**
|
|
636
|
+
* How many filters currently narrow the list — a count rather than the
|
|
637
|
+
* boolean this used to be, because on a phone the bar is behind a button
|
|
638
|
+
* and the trigger's badge is the only thing that says the table is
|
|
639
|
+
* filtered at all.
|
|
640
|
+
*/
|
|
641
|
+
const activeFilterCount = useMemo(() => {
|
|
642
|
+
if (!props.filters || !form) return 0;
|
|
643
|
+
return Object.keys(cleanFilterValues(form.currentValues ?? {})).length;
|
|
361
644
|
}, [
|
|
362
645
|
props.filters,
|
|
363
646
|
form,
|
|
364
647
|
refreshKey
|
|
365
648
|
]);
|
|
649
|
+
const hasActiveFilters = activeFilterCount > 0;
|
|
650
|
+
const emptyOverride = (hasActiveFilters ? props.noMatchState : props.emptyState) ?? {};
|
|
651
|
+
const EmptyIcon = emptyOverride.icon ?? (hasActiveFilters ? SearchX : Inbox);
|
|
652
|
+
const emptyTitle = emptyOverride.title ?? props.emptyMessage ?? String(hasActiveFilters ? tr("alephaTable.noMatchTitle", { default: "No match" }) : tr("alephaTable.emptyTitle", { default: "No items" }));
|
|
653
|
+
const isEmptyState = !loading && data.length === 0;
|
|
654
|
+
const emptyAction = emptyOverride.action;
|
|
655
|
+
const emptyDescription = emptyOverride.description ?? (props.emptyMessage ? void 0 : String(hasActiveFilters ? tr("alephaTable.noMatchDescription", { default: "Try adjusting or clearing the filters." }) : tr("alephaTable.emptyDescription", { default: "Nothing here yet." })));
|
|
366
656
|
const showToolbar = Boolean(props.filters) || Boolean(props.toolbar) || Boolean(props.actions?.length) || !props.hideColumnPicker || !props.hideActionsMenu;
|
|
367
657
|
const showColumnPicker = !props.hideColumnPicker && allColumnKeys.length > 0;
|
|
368
658
|
const showActionsMenu = !props.hideActionsMenu;
|
|
@@ -377,9 +667,9 @@ function AlephaTable(props) {
|
|
|
377
667
|
})
|
|
378
668
|
}),
|
|
379
669
|
showToolbar && /* @__PURE__ */ jsxs("div", {
|
|
380
|
-
className: "bg-muted [&_:is(input,[role=combobox])]:bg-background dark:[&_:is(input,[role=combobox])]:bg-background flex flex-wrap items-end gap-2 rounded-md rounded-b-none border p-2",
|
|
670
|
+
className: "bg-muted [&_:is(input,[role=combobox])]:bg-background dark:[&_:is(input,[role=combobox])]:bg-background flex flex-wrap items-end gap-2 rounded-md rounded-b-none border p-2 shadow-[inset_0_1px_0_0_var(--bevel)]",
|
|
381
671
|
children: [
|
|
382
|
-
props.filters && form ? /* @__PURE__ */ jsx("form", {
|
|
672
|
+
props.filters && form && !isMobile ? /* @__PURE__ */ jsx("form", {
|
|
383
673
|
...form.props,
|
|
384
674
|
className: "flex flex-1 flex-wrap items-end gap-2",
|
|
385
675
|
children: props.filters.render(form)
|
|
@@ -393,6 +683,18 @@ function AlephaTable(props) {
|
|
|
393
683
|
children: [
|
|
394
684
|
props.actions?.length ? /* @__PURE__ */ jsxs(Fragment$1, { children: [props.actions.map((action) => {
|
|
395
685
|
const ActionIcon = action.icon;
|
|
686
|
+
if (action.primary) return /* @__PURE__ */ jsxs(Button, {
|
|
687
|
+
type: "button",
|
|
688
|
+
size: "sm",
|
|
689
|
+
className: "h-9 px-3",
|
|
690
|
+
"aria-label": action.label,
|
|
691
|
+
disabled: action.disabled,
|
|
692
|
+
onClick: action.onClick,
|
|
693
|
+
children: [/* @__PURE__ */ jsx(ActionIcon, { className: "size-4" }), /* @__PURE__ */ jsx("span", {
|
|
694
|
+
className: "hidden sm:inline",
|
|
695
|
+
children: action.label
|
|
696
|
+
})]
|
|
697
|
+
}, action.label);
|
|
396
698
|
return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
397
699
|
render: /* @__PURE__ */ jsx(Button, {
|
|
398
700
|
type: "button",
|
|
@@ -409,12 +711,26 @@ function AlephaTable(props) {
|
|
|
409
711
|
"aria-hidden": true,
|
|
410
712
|
className: "bg-border mx-1 h-5 w-px self-center"
|
|
411
713
|
})] }) : null,
|
|
714
|
+
isMobile && props.filters && form && /* @__PURE__ */ jsx(AlephaTableFilterDialog, {
|
|
715
|
+
form,
|
|
716
|
+
activeCount: activeFilterCount,
|
|
717
|
+
onReset: resetFilters,
|
|
718
|
+
onShare: canShare ? shareFilters : void 0,
|
|
719
|
+
children: props.filters.render(form)
|
|
720
|
+
}),
|
|
412
721
|
showColumnPicker && /* @__PURE__ */ jsx(ColumnPicker, {
|
|
413
722
|
columns: props.columns,
|
|
723
|
+
order: orderedKeys,
|
|
414
724
|
visible: visibleColumns,
|
|
415
|
-
onToggle: toggleColumn
|
|
725
|
+
onToggle: toggleColumn,
|
|
726
|
+
onReorder: reorderColumn
|
|
416
727
|
}),
|
|
417
|
-
showActionsMenu && props.filters &&
|
|
728
|
+
showActionsMenu && props.filters && !isMobile && canShare && /* @__PURE__ */ jsx(AlephaTableFilterMenu, {
|
|
729
|
+
activeCount: activeFilterCount,
|
|
730
|
+
onShare: shareFilters,
|
|
731
|
+
onReset: resetFilters
|
|
732
|
+
}),
|
|
733
|
+
showActionsMenu && props.filters && !isMobile && !canShare && /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
418
734
|
render: /* @__PURE__ */ jsx(Button, {
|
|
419
735
|
type: "button",
|
|
420
736
|
size: "sm",
|
|
@@ -442,7 +758,7 @@ function AlephaTable(props) {
|
|
|
442
758
|
}) })
|
|
443
759
|
]
|
|
444
760
|
}),
|
|
445
|
-
hasCheckbox && selection.size > 0 && /* @__PURE__ */ jsx("div", {
|
|
761
|
+
hasCheckbox && selection.size > 0 && visibleBulkActions.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
446
762
|
className: "pointer-events-none fixed inset-x-0 bottom-6 z-40 flex justify-center",
|
|
447
763
|
children: /* @__PURE__ */ jsxs("div", {
|
|
448
764
|
className: "animate-in fade-in-0 slide-in-from-bottom-2 pointer-events-auto flex items-center gap-2 rounded-full bg-zinc-900 px-3 py-1.5 text-zinc-100 shadow-lg ring-1 ring-white/10 duration-150",
|
|
@@ -455,7 +771,12 @@ function AlephaTable(props) {
|
|
|
455
771
|
})
|
|
456
772
|
}),
|
|
457
773
|
/* @__PURE__ */ jsx("span", { className: "mx-1 h-4 w-px bg-white/20" }),
|
|
458
|
-
|
|
774
|
+
visibleBulkActions.map((action) => {
|
|
775
|
+
if ("items" in action) return /* @__PURE__ */ jsx(AlephaTableBulkMenu, {
|
|
776
|
+
action,
|
|
777
|
+
selected: selectedItems,
|
|
778
|
+
ctx: bulkCtx
|
|
779
|
+
}, action.label);
|
|
459
780
|
const ActionIcon = action.icon;
|
|
460
781
|
return /* @__PURE__ */ jsxs(Button, {
|
|
461
782
|
size: "sm",
|
|
@@ -476,112 +797,165 @@ function AlephaTable(props) {
|
|
|
476
797
|
})
|
|
477
798
|
}),
|
|
478
799
|
/* @__PURE__ */ jsx("div", {
|
|
479
|
-
className: cn("flex min-h-0 flex-1 flex-col overflow-auto rounded-md border", showToolbar && "-mt-2 rounded-t-none border-t-0", "rounded-b-none border-b-0"),
|
|
480
|
-
children: /* @__PURE__ */ jsxs(Table, {
|
|
481
|
-
className:
|
|
482
|
-
children: /* @__PURE__ */
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
indeterminate: !allSelected && someSelected,
|
|
488
|
-
onCheckedChange: () => toggleAll(),
|
|
489
|
-
"aria-label": tr("alephaTable.selectAll", { default: "Select all rows" })
|
|
490
|
-
})
|
|
491
|
-
}),
|
|
492
|
-
visibleCols.map(([key, def]) => {
|
|
493
|
-
const sorted = def.sortable && sort?.field === (def.sortKey ?? key);
|
|
494
|
-
return /* @__PURE__ */ jsx(TableHead, {
|
|
495
|
-
className: cn(def.className, def.align === "right" && "text-right", def.align === "center" && "text-center"),
|
|
496
|
-
"aria-sort": sorted ? sort?.direction === "asc" ? "ascending" : "descending" : void 0,
|
|
497
|
-
children: def.sortable ? /* @__PURE__ */ jsxs("button", {
|
|
498
|
-
type: "button",
|
|
499
|
-
onClick: () => toggleSort(key, def),
|
|
500
|
-
className: "group/sort hover:text-foreground inline-flex cursor-pointer items-center gap-1 select-none",
|
|
501
|
-
children: [def.label, sorted ? sort?.direction === "asc" ? /* @__PURE__ */ jsx(ArrowUp, {
|
|
502
|
-
className: "size-3.5",
|
|
503
|
-
"aria-hidden": true
|
|
504
|
-
}) : /* @__PURE__ */ jsx(ArrowDown, {
|
|
505
|
-
className: "size-3.5",
|
|
506
|
-
"aria-hidden": true
|
|
507
|
-
}) : /* @__PURE__ */ jsx(ChevronsUpDown, {
|
|
508
|
-
className: "size-3.5 opacity-40 transition-opacity group-hover/sort:opacity-100",
|
|
509
|
-
"aria-hidden": true
|
|
510
|
-
})]
|
|
511
|
-
}) : /* @__PURE__ */ jsx("span", {
|
|
512
|
-
className: "inline-flex items-center gap-1",
|
|
513
|
-
children: def.label
|
|
514
|
-
})
|
|
515
|
-
}, key);
|
|
516
|
-
}),
|
|
517
|
-
hasRowActions && /* @__PURE__ */ jsx(TableHead, { className: "w-10" })
|
|
518
|
-
] })
|
|
519
|
-
}), /* @__PURE__ */ jsx(TableBody, { children: loading && data.length === 0 ? /* @__PURE__ */ jsx(SkeletonRows, {
|
|
520
|
-
rows: 5,
|
|
521
|
-
cols: visibleCols.length + (hasCheckbox ? 1 : 0) + (hasRowActions ? 1 : 0)
|
|
522
|
-
}) : data.length === 0 ? /* @__PURE__ */ jsx(TableRow, {
|
|
523
|
-
className: "hover:bg-transparent",
|
|
524
|
-
children: /* @__PURE__ */ jsx(TableCell, {
|
|
525
|
-
colSpan: visibleCols.length + (hasCheckbox ? 1 : 0) + (hasRowActions ? 1 : 0),
|
|
526
|
-
className: "p-0",
|
|
527
|
-
children: props.empty ?? /* @__PURE__ */ jsxs("div", {
|
|
528
|
-
className: "text-muted-foreground flex flex-col items-center justify-center gap-2 py-12 text-center",
|
|
529
|
-
children: [/* @__PURE__ */ jsx(Inbox, { className: "size-8 opacity-40" }), /* @__PURE__ */ jsx("p", {
|
|
530
|
-
className: "text-sm",
|
|
531
|
-
children: props.emptyMessage ?? String(tr("alephaTable.empty", { default: "No results." }))
|
|
532
|
-
})]
|
|
533
|
-
})
|
|
534
|
-
})
|
|
535
|
-
}) : data.map((item, rowIndex) => {
|
|
536
|
-
const key = rowKeys[rowIndex];
|
|
537
|
-
const isSelected = selection.has(key);
|
|
538
|
-
return /* @__PURE__ */ jsxs(TableRow, {
|
|
539
|
-
onClick: () => props.onRowClick?.(item),
|
|
540
|
-
className: cn(props.onRowClick && "cursor-pointer", isSelected && "bg-muted/30"),
|
|
541
|
-
children: [
|
|
542
|
-
hasCheckbox && /* @__PURE__ */ jsx(TableCell, {
|
|
543
|
-
onClick: (e) => e.stopPropagation(),
|
|
800
|
+
className: cn("flex min-h-0 flex-1 flex-col overflow-auto rounded-md border", showToolbar && "-mt-2 rounded-t-none border-t-0", "rounded-b-none border-b-0", "[&>[data-slot=table-container]]:grow"),
|
|
801
|
+
children: /* @__PURE__ */ jsxs(Table$1, {
|
|
802
|
+
className: cn(isEmptyState && "h-full"),
|
|
803
|
+
children: [/* @__PURE__ */ jsx(TableHeader, {
|
|
804
|
+
className: "bg-muted sticky top-0 z-10 shadow-[inset_0_1px_0_0_var(--bevel),inset_0_-1px_0_0_var(--border)]",
|
|
805
|
+
children: /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
806
|
+
hasCheckbox && /* @__PURE__ */ jsx(TableHead, {
|
|
807
|
+
className: "w-10",
|
|
544
808
|
children: /* @__PURE__ */ jsx(Checkbox, {
|
|
545
|
-
checked:
|
|
546
|
-
|
|
547
|
-
|
|
809
|
+
checked: allSelected,
|
|
810
|
+
indeterminate: !allSelected && someSelected,
|
|
811
|
+
onCheckedChange: () => toggleAll(),
|
|
812
|
+
"aria-label": tr("alephaTable.selectAll", { default: "Select all rows" })
|
|
548
813
|
})
|
|
549
814
|
}),
|
|
550
|
-
visibleCols.map(([key, def]) =>
|
|
551
|
-
|
|
552
|
-
children:
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
815
|
+
visibleCols.map(([key, def], index) => {
|
|
816
|
+
const sorted = def.sortable && sort?.field === (def.sortKey ?? key);
|
|
817
|
+
return /* @__PURE__ */ jsxs(ContextMenu, { children: [/* @__PURE__ */ jsx(ContextMenuTrigger, {
|
|
818
|
+
render: /* @__PURE__ */ jsx(TableHead, {
|
|
819
|
+
tabIndex: 0,
|
|
820
|
+
className: cn(def.className, "focus-visible:ring-ring/50 outline-none focus-visible:ring-2", def.align === "right" && "text-right", def.align === "center" && "text-center"),
|
|
821
|
+
"aria-sort": sorted ? sort?.direction === "asc" ? "ascending" : "descending" : void 0
|
|
822
|
+
}),
|
|
823
|
+
children: def.sortable ? /* @__PURE__ */ jsxs("button", {
|
|
824
|
+
type: "button",
|
|
825
|
+
onClick: () => toggleSort(key, def),
|
|
826
|
+
className: "group/sort hover:text-foreground inline-flex items-center gap-1 select-none",
|
|
827
|
+
children: [def.label, sorted ? sort?.direction === "asc" ? /* @__PURE__ */ jsx(ArrowUp, {
|
|
828
|
+
className: "size-3.5",
|
|
829
|
+
"aria-hidden": true
|
|
830
|
+
}) : /* @__PURE__ */ jsx(ArrowDown, {
|
|
831
|
+
className: "size-3.5",
|
|
832
|
+
"aria-hidden": true
|
|
833
|
+
}) : /* @__PURE__ */ jsx(ChevronsUpDown, {
|
|
834
|
+
className: "size-3.5 opacity-40 transition-opacity group-hover/sort:opacity-100",
|
|
835
|
+
"aria-hidden": true
|
|
836
|
+
})]
|
|
837
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
838
|
+
className: "inline-flex items-center gap-1",
|
|
839
|
+
children: def.label
|
|
840
|
+
})
|
|
841
|
+
}), /* @__PURE__ */ jsxs(ContextMenuContent, { children: [
|
|
842
|
+
def.sortable && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
843
|
+
/* @__PURE__ */ jsxs(ContextMenuItem, {
|
|
844
|
+
onClick: () => setSortTo(key, def, "asc"),
|
|
845
|
+
children: [/* @__PURE__ */ jsx(ArrowUpAZ, { className: "size-4" }), tr("alephaTable.sortAsc", { default: "Sort ascending" })]
|
|
846
|
+
}),
|
|
847
|
+
/* @__PURE__ */ jsxs(ContextMenuItem, {
|
|
848
|
+
onClick: () => setSortTo(key, def, "desc"),
|
|
849
|
+
children: [/* @__PURE__ */ jsx(ArrowDownAZ, { className: "size-4" }), tr("alephaTable.sortDesc", { default: "Sort descending" })]
|
|
850
|
+
}),
|
|
851
|
+
/* @__PURE__ */ jsx(ContextMenuItem, {
|
|
852
|
+
disabled: !sorted,
|
|
853
|
+
onClick: () => setSortTo(key, def, null),
|
|
854
|
+
children: tr("alephaTable.sortClear", { default: "Clear sort" })
|
|
855
|
+
}),
|
|
856
|
+
/* @__PURE__ */ jsx(ContextMenuSeparator, {})
|
|
857
|
+
] }),
|
|
858
|
+
/* @__PURE__ */ jsxs(ContextMenuItem, {
|
|
859
|
+
disabled: index === 0,
|
|
860
|
+
onClick: () => moveColumn(key, -1),
|
|
861
|
+
children: [/* @__PURE__ */ jsx(ChevronLeft, { className: "size-4" }), tr("alephaTable.moveLeft", { default: "Move left" })]
|
|
862
|
+
}),
|
|
863
|
+
/* @__PURE__ */ jsxs(ContextMenuItem, {
|
|
864
|
+
disabled: index === visibleCols.length - 1,
|
|
865
|
+
onClick: () => moveColumn(key, 1),
|
|
866
|
+
children: [/* @__PURE__ */ jsx(ChevronRight, { className: "size-4" }), tr("alephaTable.moveRight", { default: "Move right" })]
|
|
867
|
+
}),
|
|
868
|
+
/* @__PURE__ */ jsx(ContextMenuSeparator, {}),
|
|
869
|
+
/* @__PURE__ */ jsxs(ContextMenuItem, {
|
|
870
|
+
disabled: visibleCols.length <= 1,
|
|
871
|
+
onClick: () => toggleColumn(key),
|
|
872
|
+
children: [/* @__PURE__ */ jsx(EyeOff, { className: "size-4" }), tr("alephaTable.hideColumn", { default: "Hide column" })]
|
|
873
|
+
})
|
|
874
|
+
] })] }, key);
|
|
875
|
+
}),
|
|
876
|
+
hasRowActions && /* @__PURE__ */ jsx(TableHead, { className: "w-10" })
|
|
877
|
+
] })
|
|
878
|
+
}), /* @__PURE__ */ jsx(TableBody, { children: loading && data.length === 0 ? /* @__PURE__ */ jsx(SkeletonRows, {
|
|
879
|
+
rows: 5,
|
|
880
|
+
cols: visibleCols.length + (hasCheckbox ? 1 : 0) + (hasRowActions ? 1 : 0)
|
|
881
|
+
}) : data.length === 0 ? /* @__PURE__ */ jsx(TableRow, {
|
|
882
|
+
className: "hover:bg-transparent",
|
|
883
|
+
children: /* @__PURE__ */ jsx(TableCell, {
|
|
884
|
+
colSpan: visibleCols.length + (hasCheckbox ? 1 : 0) + (hasRowActions ? 1 : 0),
|
|
885
|
+
className: "h-full p-0 whitespace-normal",
|
|
886
|
+
children: props.empty ?? /* @__PURE__ */ jsxs("div", {
|
|
887
|
+
className: "flex flex-col items-center justify-center gap-2 px-6 py-12 text-center",
|
|
888
|
+
children: [
|
|
889
|
+
/* @__PURE__ */ jsx(EmptyIcon, { className: "text-muted-foreground size-8 opacity-40" }),
|
|
890
|
+
/* @__PURE__ */ jsx("p", {
|
|
891
|
+
className: "text-foreground text-sm font-medium",
|
|
892
|
+
children: emptyTitle
|
|
893
|
+
}),
|
|
894
|
+
emptyDescription ? /* @__PURE__ */ jsx("p", {
|
|
895
|
+
className: "text-muted-foreground max-w-xs text-sm text-balance",
|
|
896
|
+
children: emptyDescription
|
|
897
|
+
}) : null,
|
|
898
|
+
emptyAction ? /* @__PURE__ */ jsx("div", {
|
|
899
|
+
className: "pt-2",
|
|
900
|
+
children: emptyAction
|
|
901
|
+
}) : null
|
|
902
|
+
]
|
|
562
903
|
})
|
|
563
|
-
|
|
564
|
-
},
|
|
565
|
-
|
|
904
|
+
})
|
|
905
|
+
}) : data.map((item, rowIndex) => {
|
|
906
|
+
const key = rowKeys[rowIndex];
|
|
907
|
+
const isSelected = selection.has(key);
|
|
908
|
+
return /* @__PURE__ */ jsxs(TableRow, {
|
|
909
|
+
onClick: () => props.onRowClick?.(item),
|
|
910
|
+
className: cn(props.onRowClick && "cursor-pointer", isSelected && "bg-muted/30"),
|
|
911
|
+
children: [
|
|
912
|
+
hasCheckbox && /* @__PURE__ */ jsx(TableCell, {
|
|
913
|
+
onClick: (e) => e.stopPropagation(),
|
|
914
|
+
children: /* @__PURE__ */ jsx(Checkbox, {
|
|
915
|
+
checked: isSelected,
|
|
916
|
+
onCheckedChange: () => toggleRow(item),
|
|
917
|
+
"aria-label": tr("alephaTable.selectRow", { default: "Select row" })
|
|
918
|
+
})
|
|
919
|
+
}),
|
|
920
|
+
visibleCols.map(([key, def]) => /* @__PURE__ */ jsx(TableCell, {
|
|
921
|
+
className: cn(def.className, def.align === "right" && "text-right", def.align === "center" && "text-center"),
|
|
922
|
+
children: def.cell(item)
|
|
923
|
+
}, key)),
|
|
924
|
+
hasRowActions && /* @__PURE__ */ jsx(TableCell, {
|
|
925
|
+
className: "text-right",
|
|
926
|
+
onClick: (e) => e.stopPropagation(),
|
|
927
|
+
children: /* @__PURE__ */ jsx(RowActionsMenu, {
|
|
928
|
+
actions: props.rowActions(item),
|
|
929
|
+
item,
|
|
930
|
+
ctx: rowCtx
|
|
931
|
+
})
|
|
932
|
+
})
|
|
933
|
+
]
|
|
934
|
+
}, key);
|
|
935
|
+
}) })]
|
|
936
|
+
})
|
|
937
|
+
}),
|
|
938
|
+
/* @__PURE__ */ jsx("span", {
|
|
939
|
+
"aria-live": "polite",
|
|
940
|
+
className: "sr-only",
|
|
941
|
+
children: orderAnnouncement
|
|
566
942
|
}),
|
|
567
943
|
/* @__PURE__ */ jsxs("div", {
|
|
568
|
-
className: "bg-muted -mt-2 flex flex-wrap items-center justify-between gap-2 rounded-md rounded-t-none border p-2",
|
|
944
|
+
className: "bg-muted -mt-2 flex flex-wrap items-center justify-between gap-2 rounded-md rounded-t-none border p-2 shadow-[inset_0_1px_0_0_var(--bevel)]",
|
|
569
945
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
570
946
|
className: "flex items-center gap-2",
|
|
571
|
-
children: [pageSizes.length > 0 && /* @__PURE__ */
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
children: /* @__PURE__ */ jsx(SelectValue, {})
|
|
578
|
-
}), /* @__PURE__ */ jsx(SelectContent, { children: pageSizes.map((n) => /* @__PURE__ */ jsx(SelectItem, {
|
|
947
|
+
children: [pageSizes.length > 0 && !isMobile && /* @__PURE__ */ jsx(Control, {
|
|
948
|
+
input: sizeForm.input.size,
|
|
949
|
+
label: "",
|
|
950
|
+
inputProps: { "aria-label": String(tr("table.pageSize", { default: "Rows per page" })) },
|
|
951
|
+
triggerClassName: "bg-background h-7 w-auto gap-1 text-xs",
|
|
952
|
+
items: pageSizes.map((n) => ({
|
|
579
953
|
value: String(n),
|
|
580
|
-
|
|
581
|
-
}
|
|
954
|
+
label: String(n)
|
|
955
|
+
}))
|
|
582
956
|
}), /* @__PURE__ */ jsx("p", {
|
|
583
957
|
className: "text-muted-foreground text-xs",
|
|
584
|
-
children: meta ? `Page ${meta.number + 1}${meta.totalPages ? ` of ${meta.totalPages}` : ""} · ${meta.numberOfElements} of ${meta.totalElements ?? "?"}` : "—"
|
|
958
|
+
children: meta ? `Page ${meta.number + 1}${meta.totalPages ? ` of ${meta.totalPages}` : ""}${isMobile ? "" : ` · ${meta.numberOfElements} of ${meta.totalElements ?? "?"}`}` : "—"
|
|
585
959
|
})]
|
|
586
960
|
}), meta && meta.totalPages && meta.totalPages > 1 ? /* @__PURE__ */ jsx(Pagination, {
|
|
587
961
|
className: "mx-0 w-auto justify-end",
|
|
@@ -595,7 +969,7 @@ function AlephaTable(props) {
|
|
|
595
969
|
"aria-disabled": meta.isFirst,
|
|
596
970
|
className: cn(meta.isFirst && "pointer-events-none opacity-50")
|
|
597
971
|
}) }),
|
|
598
|
-
computePageItems(meta.number + 1, meta.totalPages).map((item, idx) => item === "ellipsis" ? /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(PaginationEllipsis, {}) }, `e-${idx}`) : /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(PaginationLink, {
|
|
972
|
+
!isMobile && computePageItems(meta.number + 1, meta.totalPages).map((item, idx) => item === "ellipsis" ? /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(PaginationEllipsis, {}) }, `e-${idx}`) : /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(PaginationLink, {
|
|
599
973
|
href: "#",
|
|
600
974
|
isActive: item === meta.number + 1,
|
|
601
975
|
onClick: (e) => {
|
|
@@ -619,9 +993,23 @@ function AlephaTable(props) {
|
|
|
619
993
|
]
|
|
620
994
|
}) });
|
|
621
995
|
}
|
|
996
|
+
/**
|
|
997
|
+
* The single home for column state: what is shown, and in what order.
|
|
998
|
+
*
|
|
999
|
+
* Both live here rather than order being reachable only from the header's
|
|
1000
|
+
* context menu, and that is the shape decision. Right-click advertises
|
|
1001
|
+
* nothing and does not exist on touch, so a feature reachable only that way
|
|
1002
|
+
* is one most people never find. The menu is a fast path into this.
|
|
1003
|
+
*
|
|
1004
|
+
* Reordering is native HTML5 drag, the way Lore's folio tree does it: this
|
|
1005
|
+
* package has no drag-and-drop dependency and a column list is not worth
|
|
1006
|
+
* adding one. The arrows beside each row are not a fallback for a broken
|
|
1007
|
+
* drag - they are the keyboard and touch path, where drag does not exist.
|
|
1008
|
+
*/
|
|
622
1009
|
function ColumnPicker(props) {
|
|
623
1010
|
const { tr } = useI18n();
|
|
624
|
-
const
|
|
1011
|
+
const [dragging, setDragging] = useState(null);
|
|
1012
|
+
const entries = props.order.map((key) => [key, props.columns[key]]);
|
|
625
1013
|
const label = tr("alephaTable.toggleColumns", { default: "Toggle columns" });
|
|
626
1014
|
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
627
1015
|
render: /* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsx(Button, {
|
|
@@ -637,11 +1025,48 @@ function ColumnPicker(props) {
|
|
|
637
1025
|
children: /* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [
|
|
638
1026
|
/* @__PURE__ */ jsx(DropdownMenuLabel, { children: tr("alephaTable.columns", { default: "Columns" }) }),
|
|
639
1027
|
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
640
|
-
entries.map(([key, def]) => /* @__PURE__ */
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
1028
|
+
entries.map(([key, def], index) => /* @__PURE__ */ jsxs("div", {
|
|
1029
|
+
draggable: true,
|
|
1030
|
+
onDragStart: () => setDragging(key),
|
|
1031
|
+
onDragEnd: () => setDragging(null),
|
|
1032
|
+
onDragOver: (event) => {
|
|
1033
|
+
event.preventDefault();
|
|
1034
|
+
},
|
|
1035
|
+
onDrop: (event) => {
|
|
1036
|
+
event.preventDefault();
|
|
1037
|
+
if (dragging && dragging !== key) props.onReorder(dragging, key);
|
|
1038
|
+
setDragging(null);
|
|
1039
|
+
},
|
|
1040
|
+
className: cn("flex items-center gap-1 pr-1", dragging === key && "opacity-45"),
|
|
1041
|
+
children: [
|
|
1042
|
+
/* @__PURE__ */ jsx(GripVertical, {
|
|
1043
|
+
className: "text-muted-foreground/60 size-3.5 shrink-0 cursor-grab",
|
|
1044
|
+
"aria-hidden": true
|
|
1045
|
+
}),
|
|
1046
|
+
/* @__PURE__ */ jsx(DropdownMenuCheckboxItem, {
|
|
1047
|
+
checked: props.visible.has(key),
|
|
1048
|
+
closeOnClick: false,
|
|
1049
|
+
onCheckedChange: () => props.onToggle(key),
|
|
1050
|
+
className: "flex-1",
|
|
1051
|
+
children: def.label
|
|
1052
|
+
}),
|
|
1053
|
+
/* @__PURE__ */ jsx("button", {
|
|
1054
|
+
type: "button",
|
|
1055
|
+
disabled: index === 0,
|
|
1056
|
+
"aria-label": String(tr("alephaTable.moveUp", { default: "Move up" })),
|
|
1057
|
+
onClick: () => props.onReorder(key, entries[index - 1][0]),
|
|
1058
|
+
className: "text-muted-foreground/60 hover:text-foreground rounded p-0.5 disabled:opacity-30",
|
|
1059
|
+
children: /* @__PURE__ */ jsx(ChevronUp, { className: "size-3.5" })
|
|
1060
|
+
}),
|
|
1061
|
+
/* @__PURE__ */ jsx("button", {
|
|
1062
|
+
type: "button",
|
|
1063
|
+
disabled: index === entries.length - 1,
|
|
1064
|
+
"aria-label": String(tr("alephaTable.moveDown", { default: "Move down" })),
|
|
1065
|
+
onClick: () => props.onReorder(entries[index + 1][0], key),
|
|
1066
|
+
className: "text-muted-foreground/60 hover:text-foreground rounded p-0.5 disabled:opacity-30",
|
|
1067
|
+
children: /* @__PURE__ */ jsx(ChevronDown, { className: "size-3.5" })
|
|
1068
|
+
})
|
|
1069
|
+
]
|
|
645
1070
|
}, key))
|
|
646
1071
|
] })
|
|
647
1072
|
})] });
|
|
@@ -665,9 +1090,13 @@ function computePageItems(current, total) {
|
|
|
665
1090
|
const SkeletonRows = (props) => {
|
|
666
1091
|
return /* @__PURE__ */ jsx(Fragment$1, { children: Array.from({ length: props.rows }).map((_, i) => /* @__PURE__ */ jsx(TableRow, { children: Array.from({ length: props.cols }).map((_, j) => /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-full" }) }, j)) }, i)) });
|
|
667
1092
|
};
|
|
1093
|
+
function isRowActionGroup(entry) {
|
|
1094
|
+
return "children" in entry;
|
|
1095
|
+
}
|
|
668
1096
|
function RowActionsMenu(props) {
|
|
669
1097
|
const { tr } = useI18n();
|
|
670
|
-
|
|
1098
|
+
const effective = props.actions.filter((action) => isRowActionGroup(action) ? action.children.length > 0 : true);
|
|
1099
|
+
if (effective.length === 0) return null;
|
|
671
1100
|
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
672
1101
|
render: /* @__PURE__ */ jsx(Button, {
|
|
673
1102
|
variant: "ghost",
|
|
@@ -677,18 +1106,45 @@ function RowActionsMenu(props) {
|
|
|
677
1106
|
children: /* @__PURE__ */ jsx(MoreVertical, { className: "size-4" })
|
|
678
1107
|
}), /* @__PURE__ */ jsx(DropdownMenuContent, {
|
|
679
1108
|
align: "end",
|
|
680
|
-
children:
|
|
1109
|
+
children: effective.map((action, idx) => {
|
|
681
1110
|
const Icon = action.icon;
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
1111
|
+
if (isRowActionGroup(action)) return /* @__PURE__ */ jsxs(DropdownMenuSub, { children: [/* @__PURE__ */ jsxs(DropdownMenuSubTrigger, { children: [Icon && /* @__PURE__ */ jsx(Icon, { className: "mr-2 size-4" }), action.label] }), /* @__PURE__ */ jsx(DropdownMenuSubContent, { children: action.children.map((child) => /* @__PURE__ */ jsx(RowActionItem, {
|
|
1112
|
+
action: child,
|
|
1113
|
+
item: props.item,
|
|
1114
|
+
ctx: props.ctx
|
|
1115
|
+
}, child.label)) })] }, action.label);
|
|
1116
|
+
const previous = effective[idx - 1];
|
|
1117
|
+
const sep = idx > 0 && action.destructive && !(previous && !isRowActionGroup(previous) && previous.destructive);
|
|
1118
|
+
return /* @__PURE__ */ jsxs("span", { children: [sep && /* @__PURE__ */ jsx(DropdownMenuSeparator, {}), /* @__PURE__ */ jsx(RowActionItem, {
|
|
1119
|
+
action,
|
|
1120
|
+
item: props.item,
|
|
1121
|
+
ctx: props.ctx
|
|
688
1122
|
})] }, action.label);
|
|
689
1123
|
})
|
|
690
1124
|
})] });
|
|
691
1125
|
}
|
|
1126
|
+
/**
|
|
1127
|
+
* One menu entry, wherever it sits: at the top level of the row menu or
|
|
1128
|
+
* inside a group's submenu. Both render the same way, which is what keeps a
|
|
1129
|
+
* `checked` entry from behaving differently depending on where it was put.
|
|
1130
|
+
*/
|
|
1131
|
+
function RowActionItem(props) {
|
|
1132
|
+
const { action, item, ctx } = props;
|
|
1133
|
+
const Icon = action.icon;
|
|
1134
|
+
const disabled = action.disabled?.(item);
|
|
1135
|
+
if (action.checked) return /* @__PURE__ */ jsxs(DropdownMenuCheckboxItem, {
|
|
1136
|
+
checked: action.checked(item),
|
|
1137
|
+
disabled,
|
|
1138
|
+
onClick: () => action.onClick(item, ctx),
|
|
1139
|
+
children: [Icon && /* @__PURE__ */ jsx(Icon, { className: "mr-2 size-4" }), action.label]
|
|
1140
|
+
});
|
|
1141
|
+
return /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
1142
|
+
disabled,
|
|
1143
|
+
onClick: () => action.onClick(item, ctx),
|
|
1144
|
+
variant: action.destructive ? "destructive" : void 0,
|
|
1145
|
+
children: [Icon && /* @__PURE__ */ jsx(Icon, { className: "mr-2 size-4" }), action.label]
|
|
1146
|
+
});
|
|
1147
|
+
}
|
|
692
1148
|
//#endregion
|
|
693
1149
|
export { AlephaTable, PAGE_SIZES };
|
|
694
1150
|
|