@alepha/ui 0.26.0 → 0.27.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 +86 -12
- package/dist/components/account/account-connections.js +5 -5
- package/dist/components/account/account-connections.js.map +1 -1
- package/dist/components/account/account-delete-dialog.js +4 -4
- package/dist/components/account/account-header.d.ts.map +1 -1
- package/dist/components/account/account-header.js +3 -1
- package/dist/components/account/account-header.js.map +1 -1
- package/dist/components/account/account-keys.js +7 -7
- 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 +7 -4
- package/dist/components/account/account-layout.js.map +1 -1
- package/dist/components/account/account-password-dialog.js +3 -3
- package/dist/components/account/account-profile.js +8 -8
- package/dist/components/account/account-profile.js.map +1 -1
- 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.map +1 -1
- package/dist/components/account/account-router-page.js.map +1 -1
- package/dist/components/account/account-router.d.ts +3 -2
- package/dist/components/account/account-router.d.ts.map +1 -1
- package/dist/components/account/account-router.js +4 -3
- package/dist/components/account/account-router.js.map +1 -1
- package/dist/components/account/account-security.d.ts.map +1 -1
- package/dist/components/account/account-security.js +6 -6
- package/dist/components/account/account-security.js.map +1 -1
- package/dist/components/account/account-sessions.d.ts.map +1 -1
- package/dist/components/account/account-sessions.js +19 -6
- package/dist/components/account/account-sessions.js.map +1 -1
- package/dist/components/admin/admin-analytics-query-panel.d.ts +1 -1
- package/dist/components/admin/admin-analytics-query-panel.d.ts.map +1 -1
- package/dist/components/admin/admin-analytics-query-panel.js +5 -5
- package/dist/components/admin/admin-analytics-query-panel.js.map +1 -1
- package/dist/components/admin/admin-analytics-results.d.ts +1 -1
- package/dist/components/admin/admin-analytics-results.d.ts.map +1 -1
- package/dist/components/admin/admin-analytics-results.js +2 -2
- package/dist/components/admin/admin-analytics-results.js.map +1 -1
- package/dist/components/admin/admin-analytics.d.ts +1 -1
- package/dist/components/admin/admin-analytics.d.ts.map +1 -1
- package/dist/components/admin/admin-analytics.js +3 -3
- package/dist/components/admin/admin-analytics.js.map +1 -1
- package/dist/components/admin/admin-audits.d.ts +1 -1
- package/dist/components/admin/admin-audits.d.ts.map +1 -1
- package/dist/components/admin/admin-audits.js +4 -4
- package/dist/components/admin/admin-audits.js.map +1 -1
- package/dist/components/admin/admin-dashboard-card.d.ts +42 -0
- package/dist/components/admin/admin-dashboard-card.d.ts.map +1 -0
- package/dist/components/admin/admin-dashboard-card.js +0 -0
- package/dist/components/admin/admin-dashboard-count-card.d.ts +34 -0
- package/dist/components/admin/admin-dashboard-count-card.d.ts.map +1 -0
- package/dist/components/admin/admin-dashboard-count-card.js +42 -0
- package/dist/components/admin/admin-dashboard-count-card.js.map +1 -0
- package/dist/components/admin/admin-dashboard.d.ts +20 -0
- package/dist/components/admin/admin-dashboard.d.ts.map +1 -0
- package/dist/components/admin/admin-dashboard.js +32 -0
- package/dist/components/admin/admin-dashboard.js.map +1 -0
- package/dist/components/admin/admin-files.d.ts +1 -1
- package/dist/components/admin/admin-files.d.ts.map +1 -1
- package/dist/components/admin/admin-files.js +3 -3
- package/dist/components/admin/admin-files.js.map +1 -1
- package/dist/components/admin/admin-jobs-executions-panel.d.ts +2 -2
- package/dist/components/admin/admin-jobs-executions-panel.d.ts.map +1 -1
- package/dist/components/admin/admin-jobs-executions-panel.js +16 -31
- package/dist/components/admin/admin-jobs-executions-panel.js.map +1 -1
- package/dist/components/admin/admin-jobs-status-badge.d.ts +2 -2
- package/dist/components/admin/admin-jobs-status-badge.d.ts.map +1 -1
- package/dist/components/admin/admin-jobs-status-badge.js +2 -2
- package/dist/components/admin/admin-jobs-status-badge.js.map +1 -1
- package/dist/components/admin/admin-jobs.d.ts +1 -1
- package/dist/components/admin/admin-jobs.d.ts.map +1 -1
- package/dist/components/admin/admin-jobs.js +5 -5
- package/dist/components/admin/admin-jobs.js.map +1 -1
- package/dist/components/admin/admin-keys-token-dialog.js +3 -3
- package/dist/components/admin/admin-keys-token-dialog.js.map +1 -1
- package/dist/components/admin/admin-keys.d.ts +1 -1
- package/dist/components/admin/admin-keys.d.ts.map +1 -1
- package/dist/components/admin/admin-keys.js +4 -4
- package/dist/components/admin/admin-keys.js.map +1 -1
- package/dist/components/admin/admin-layout.d.ts.map +1 -1
- package/dist/components/admin/admin-layout.js +1 -3
- package/dist/components/admin/admin-layout.js.map +1 -1
- package/dist/components/admin/admin-notifications.d.ts +1 -1
- package/dist/components/admin/admin-notifications.d.ts.map +1 -1
- package/dist/components/admin/admin-notifications.js +3 -3
- package/dist/components/admin/admin-notifications.js.map +1 -1
- package/dist/components/admin/admin-parameters.d.ts +1 -1
- package/dist/components/admin/admin-parameters.d.ts.map +1 -1
- package/dist/components/admin/admin-parameters.js +10 -10
- package/dist/components/admin/admin-parameters.js.map +1 -1
- package/dist/components/admin/admin-payments.d.ts +1 -1
- package/dist/components/admin/admin-payments.d.ts.map +1 -1
- package/dist/components/admin/admin-payments.js +3 -3
- package/dist/components/admin/admin-payments.js.map +1 -1
- package/dist/components/admin/admin-router-options.d.ts +13 -10
- 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-page.d.ts +7 -5
- package/dist/components/admin/admin-router-page.d.ts.map +1 -1
- package/dist/components/admin/admin-router-page.js +7 -5
- package/dist/components/admin/admin-router-page.js.map +1 -1
- package/dist/components/admin/admin-router.d.ts +72 -27
- package/dist/components/admin/admin-router.d.ts.map +1 -1
- package/dist/components/admin/admin-router.js +103 -40
- package/dist/components/admin/admin-router.js.map +1 -1
- package/dist/components/admin/admin-sessions.d.ts +1 -1
- package/dist/components/admin/admin-sessions.d.ts.map +1 -1
- package/dist/components/admin/admin-sessions.js +12 -4
- package/dist/components/admin/admin-sessions.js.map +1 -1
- package/dist/components/admin/admin-user-detail-audits-tab.d.ts +2 -2
- package/dist/components/admin/admin-user-detail-audits-tab.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-audits-tab.js.map +1 -1
- package/dist/components/admin/admin-user-detail-identity-aside.d.ts +4 -3
- package/dist/components/admin/admin-user-detail-identity-aside.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-identity-aside.js +13 -69
- package/dist/components/admin/admin-user-detail-identity-aside.js.map +1 -1
- package/dist/components/admin/admin-user-detail-overview-tab.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-overview-tab.js.map +1 -1
- package/dist/components/admin/admin-user-detail-password-dialog.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-password-dialog.js.map +1 -1
- package/dist/components/admin/admin-user-detail-profile-policy.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-profile-policy.js.map +1 -1
- package/dist/components/admin/admin-user-detail-security-tab.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-security-tab.js +2 -2
- package/dist/components/admin/admin-user-detail-security-tab.js.map +1 -1
- package/dist/components/admin/admin-user-detail-sessions-tab.d.ts +2 -2
- package/dist/components/admin/admin-user-detail-sessions-tab.d.ts.map +1 -1
- 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 +68 -111
- package/dist/components/admin/admin-user-detail.js.map +1 -1
- package/dist/components/admin/admin-users-roles-picker.d.ts +6 -1
- package/dist/components/admin/admin-users-roles-picker.d.ts.map +1 -1
- package/dist/components/admin/admin-users-roles-picker.js +11 -8
- 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 +9 -12
- package/dist/components/admin/admin-users.js.map +1 -1
- package/dist/components/admin/admin-workflows-execution-sheet.d.ts +2 -2
- package/dist/components/admin/admin-workflows-execution-sheet.d.ts.map +1 -1
- package/dist/components/admin/admin-workflows-execution-sheet.js +10 -10
- package/dist/components/admin/admin-workflows-execution-sheet.js.map +1 -1
- package/dist/components/admin/admin-workflows-executions-panel.d.ts +2 -2
- package/dist/components/admin/admin-workflows-executions-panel.d.ts.map +1 -1
- package/dist/components/admin/admin-workflows-executions-panel.js +20 -44
- package/dist/components/admin/admin-workflows-executions-panel.js.map +1 -1
- package/dist/components/admin/admin-workflows-status-badge.d.ts +2 -2
- package/dist/components/admin/admin-workflows-status-badge.d.ts.map +1 -1
- package/dist/components/admin/admin-workflows-status-badge.js +2 -2
- package/dist/components/admin/admin-workflows-status-badge.js.map +1 -1
- package/dist/components/admin/admin-workflows.d.ts +1 -1
- package/dist/components/admin/admin-workflows.d.ts.map +1 -1
- package/dist/components/admin/admin-workflows.js +5 -5
- package/dist/components/admin/admin-workflows.js.map +1 -1
- package/dist/components/admin/diff-lines.js +1 -1
- package/dist/components/admin/diff-lines.js.map +1 -1
- package/dist/components/admin/parameter-diff-dialog.d.ts.map +1 -1
- package/dist/components/admin/parameter-diff-dialog.js +1 -1
- package/dist/components/admin/parameter-diff-dialog.js.map +1 -1
- package/dist/components/admin/parameter-history-item.d.ts.map +1 -1
- package/dist/components/admin/parameter-history-item.js +4 -4
- package/dist/components/admin/parameter-history-item.js.map +1 -1
- package/dist/components/admin/parameter-json-dialog.js +1 -1
- package/dist/components/admin/parameter-save-dialog.js +2 -2
- package/dist/components/admin/use-confirmed-action.js +1 -1
- package/dist/components/alepha-table/alepha-table.d.ts +103 -8
- package/dist/components/alepha-table/alepha-table.d.ts.map +1 -1
- package/dist/components/alepha-table/alepha-table.js +128 -26
- package/dist/components/alepha-table/alepha-table.js.map +1 -1
- package/dist/components/alepha-table/paginate-local.d.ts +43 -0
- package/dist/components/alepha-table/paginate-local.d.ts.map +1 -0
- package/dist/components/alepha-table/paginate-local.js +84 -0
- package/dist/components/alepha-table/paginate-local.js.map +1 -0
- package/dist/components/app-actions/app-actions.js +1 -1
- package/dist/components/app-shell/app-shell.d.ts +10 -1
- package/dist/components/app-shell/app-shell.d.ts.map +1 -1
- package/dist/components/app-shell/app-shell.js +27 -20
- package/dist/components/app-shell/app-shell.js.map +1 -1
- package/dist/components/auth/auth-login.d.ts +1 -1
- package/dist/components/auth/auth-login.d.ts.map +1 -1
- package/dist/components/auth/auth-login.js +7 -18
- package/dist/components/auth/auth-login.js.map +1 -1
- package/dist/components/auth/auth-register.d.ts +1 -1
- package/dist/components/auth/auth-register.d.ts.map +1 -1
- package/dist/components/auth/auth-register.js +20 -21
- package/dist/components/auth/auth-register.js.map +1 -1
- package/dist/components/auth/auth-reset-password.d.ts +1 -1
- package/dist/components/auth/auth-reset-password.d.ts.map +1 -1
- package/dist/components/auth/auth-reset-password.js +16 -13
- package/dist/components/auth/auth-reset-password.js.map +1 -1
- package/dist/components/auth/auth-router.d.ts +3 -3
- package/dist/components/auth/auth-router.d.ts.map +1 -1
- package/dist/components/auth/auth-router.js +3 -3
- package/dist/components/auth/auth-router.js.map +1 -1
- package/dist/components/auth/auth-verify-email.d.ts +1 -1
- package/dist/components/auth/auth-verify-email.d.ts.map +1 -1
- package/dist/components/auth/auth-verify-email.js +8 -8
- package/dist/components/auth/auth-verify-email.js.map +1 -1
- package/dist/components/auth/safe-redirect.d.ts +9 -0
- package/dist/components/auth/safe-redirect.d.ts.map +1 -0
- package/dist/components/auth/safe-redirect.js +19 -0
- package/dist/components/auth/safe-redirect.js.map +1 -0
- package/dist/components/auto-form/auto-form.d.ts.map +1 -1
- package/dist/components/auto-form/auto-form.js +32 -32
- package/dist/components/auto-form/auto-form.js.map +1 -1
- package/dist/components/brand-icon/brand-icon.d.ts +1 -1
- package/dist/components/brand-icon/brand-icon.d.ts.map +1 -1
- package/dist/components/brand-icon/brand-icon.js +2 -2
- package/dist/components/brand-icon/brand-icon.js.map +1 -1
- package/dist/components/button-dark/button-dark.d.ts +1 -1
- package/dist/components/button-dark/button-dark.d.ts.map +1 -1
- package/dist/components/button-dark/button-dark.js +2 -2
- package/dist/components/button-dark/button-dark.js.map +1 -1
- package/dist/components/button-language/button-language.d.ts +1 -1
- package/dist/components/button-language/button-language.d.ts.map +1 -1
- package/dist/components/button-language/button-language.js +2 -2
- package/dist/components/button-language/button-language.js.map +1 -1
- package/dist/components/button-theme/button-theme.d.ts +1 -1
- package/dist/components/button-theme/button-theme.d.ts.map +1 -1
- package/dist/components/button-theme/button-theme.js +3 -3
- package/dist/components/button-theme/button-theme.js.map +1 -1
- package/dist/components/button-user/button-user.d.ts +2 -20
- package/dist/components/button-user/button-user.d.ts.map +1 -1
- package/dist/components/button-user/button-user.js +3 -3
- package/dist/components/button-user/button-user.js.map +1 -1
- package/dist/components/captcha/turnstile-widget.d.ts +2 -2
- package/dist/components/captcha/turnstile-widget.d.ts.map +1 -1
- package/dist/components/captcha/turnstile-widget.js +5 -4
- package/dist/components/captcha/turnstile-widget.js.map +1 -1
- package/dist/components/control/control.d.ts +1 -1
- package/dist/components/control/control.d.ts.map +1 -1
- package/dist/components/control/control.js +8 -11
- package/dist/components/control/control.js.map +1 -1
- package/dist/components/control-array/control-array.d.ts +1 -1
- package/dist/components/control-array/control-array.d.ts.map +1 -1
- package/dist/components/control-array/control-array.js +23 -16
- package/dist/components/control-array/control-array.js.map +1 -1
- package/dist/components/control-base/field-i18n.d.ts +5 -3
- package/dist/components/control-base/field-i18n.d.ts.map +1 -1
- package/dist/components/control-base/field-i18n.js +4 -2
- package/dist/components/control-base/field-i18n.js.map +1 -1
- package/dist/components/control-base/form-field.d.ts +7 -7
- package/dist/components/control-base/form-field.d.ts.map +1 -1
- package/dist/components/control-base/form-field.js +10 -10
- package/dist/components/control-base/form-field.js.map +1 -1
- package/dist/components/control-base/icon-hint.d.ts +1 -1
- package/dist/components/control-base/icon-hint.d.ts.map +1 -1
- package/dist/components/control-base/icon-hint.js.map +1 -1
- package/dist/components/control-date/control-date.d.ts +1 -1
- package/dist/components/control-date/control-date.d.ts.map +1 -1
- package/dist/components/control-date/control-date.js +23 -7
- package/dist/components/control-date/control-date.js.map +1 -1
- package/dist/components/control-number/control-number.d.ts +2 -2
- package/dist/components/control-number/control-number.d.ts.map +1 -1
- package/dist/components/control-number/control-number.js +3 -3
- package/dist/components/control-number/control-number.js.map +1 -1
- package/dist/components/control-object/control-object.d.ts +4 -2
- package/dist/components/control-object/control-object.d.ts.map +1 -1
- package/dist/components/control-object/control-object.js +8 -8
- package/dist/components/control-object/control-object.js.map +1 -1
- package/dist/components/control-password/control-password.js +2 -3
- package/dist/components/control-password/control-password.js.map +1 -1
- package/dist/components/control-select/control-select.d.ts +2 -2
- package/dist/components/control-select/control-select.d.ts.map +1 -1
- package/dist/components/control-select/control-select.js +17 -17
- package/dist/components/control-select/control-select.js.map +1 -1
- package/dist/components/control-upload/control-upload.d.ts +1 -1
- package/dist/components/control-upload/control-upload.d.ts.map +1 -1
- package/dist/components/control-upload/control-upload.js +11 -11
- package/dist/components/control-upload/control-upload.js.map +1 -1
- package/dist/components/detail/detail-aside.d.ts +58 -0
- package/dist/components/detail/detail-aside.d.ts.map +1 -0
- package/dist/components/detail/detail-aside.js +95 -0
- package/dist/components/detail/detail-aside.js.map +1 -0
- package/dist/components/detail/detail-layout.d.ts +90 -0
- package/dist/components/detail/detail-layout.d.ts.map +1 -0
- package/dist/components/detail/detail-layout.js +102 -0
- package/dist/components/detail/detail-layout.js.map +1 -0
- package/dist/components/detail/use-detail-tab.d.ts +15 -0
- package/dist/components/detail/use-detail-tab.d.ts.map +1 -0
- package/dist/components/detail/use-detail-tab.js +37 -0
- package/dist/components/detail/use-detail-tab.js.map +1 -0
- package/dist/components/file-image/file-image.d.ts.map +1 -1
- package/dist/components/file-image/file-image.js.map +1 -1
- package/dist/components/language-toggle/language-toggle.d.ts +1 -1
- package/dist/components/language-toggle/language-toggle.d.ts.map +1 -1
- package/dist/components/language-toggle/language-toggle.js +2 -2
- package/dist/components/language-toggle/language-toggle.js.map +1 -1
- package/dist/components/markdown-view/diagram/DiagramErrorBoundary.d.ts +28 -0
- package/dist/components/markdown-view/diagram/DiagramErrorBoundary.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/DiagramErrorBoundary.js +25 -0
- package/dist/components/markdown-view/diagram/DiagramErrorBoundary.js.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagram.d.ts +44 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagram.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagram.js +98 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagram.js.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramCluster.d.ts +14 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramCluster.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramCluster.js +45 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramCluster.js.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramEdge.d.ts +19 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramEdge.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramEdge.js +69 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramEdge.js.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramLabel.d.ts +23 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramLabel.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramLabel.js +34 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramLabel.js.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramNode.d.ts +17 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramNode.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramNode.js +63 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramNode.js.map +1 -0
- package/dist/components/markdown-view/diagram/MermaidFence.d.ts +30 -0
- package/dist/components/markdown-view/diagram/MermaidFence.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/MermaidFence.js +30 -0
- package/dist/components/markdown-view/diagram/MermaidFence.js.map +1 -0
- package/dist/components/markdown-view/diagram/flowchartParser.d.ts +18 -0
- package/dist/components/markdown-view/diagram/flowchartParser.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/flowchartParser.js +370 -0
- package/dist/components/markdown-view/diagram/flowchartParser.js.map +1 -0
- package/dist/components/markdown-view/diagram/graphModel.d.ts +67 -0
- package/dist/components/markdown-view/diagram/graphModel.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/graphModel.js +0 -0
- package/dist/components/markdown-view/diagram/layoutFlowchart.d.ts +109 -0
- package/dist/components/markdown-view/diagram/layoutFlowchart.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/layoutFlowchart.js +185 -0
- package/dist/components/markdown-view/diagram/layoutFlowchart.js.map +1 -0
- package/dist/components/markdown-view/diagram/textMetrics.d.ts +63 -0
- package/dist/components/markdown-view/diagram/textMetrics.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/textMetrics.js +228 -0
- package/dist/components/markdown-view/diagram/textMetrics.js.map +1 -0
- package/dist/components/markdown-view/markdown-view.d.ts +32 -0
- package/dist/components/markdown-view/markdown-view.d.ts.map +1 -1
- package/dist/components/markdown-view/markdown-view.js +85 -9
- package/dist/components/markdown-view/markdown-view.js.map +1 -1
- package/dist/components/nav-shell/nav-shell.d.ts +1 -1
- package/dist/components/nav-shell/nav-shell.d.ts.map +1 -1
- package/dist/components/nav-shell/nav-shell.js +1 -1
- package/dist/components/nav-shell/nav-shell.js.map +1 -1
- package/dist/components/nav-shell/spotlight.d.ts.map +1 -1
- package/dist/components/nav-shell/spotlight.js.map +1 -1
- package/dist/components/nav-shell/use-nav-breadcrumbs.d.ts.map +1 -1
- package/dist/components/nav-shell/use-nav-breadcrumbs.js.map +1 -1
- package/dist/components/nav-shell/use-nav-entries.d.ts +15 -5
- package/dist/components/nav-shell/use-nav-entries.d.ts.map +1 -1
- package/dist/components/nav-shell/use-nav-entries.js +1 -1
- package/dist/components/nav-shell/use-nav-entries.js.map +1 -1
- package/dist/components/nav-shell/use-nav-tree.d.ts.map +1 -1
- package/dist/components/nav-shell/use-nav-tree.js.map +1 -1
- package/dist/components/settings/settings-card-edge.d.ts +25 -0
- package/dist/components/settings/settings-card-edge.d.ts.map +1 -0
- package/dist/components/settings/settings-card-edge.js +29 -0
- package/dist/components/settings/settings-card-edge.js.map +1 -0
- package/dist/components/settings/settings-danger-section.d.ts.map +1 -1
- package/dist/components/settings/settings-danger-section.js +2 -1
- package/dist/components/settings/settings-danger-section.js.map +1 -1
- package/dist/components/settings/settings-layout.d.ts.map +1 -1
- package/dist/components/settings/settings-layout.js +1 -1
- package/dist/components/settings/settings-layout.js.map +1 -1
- package/dist/components/settings/settings-nav.d.ts.map +1 -1
- package/dist/components/settings/settings-nav.js +3 -3
- package/dist/components/settings/settings-nav.js.map +1 -1
- package/dist/components/settings/settings-row.js +2 -2
- package/dist/components/settings/settings-row.js.map +1 -1
- package/dist/components/settings/settings-section.d.ts.map +1 -1
- package/dist/components/settings/settings-section.js +3 -2
- package/dist/components/settings/settings-section.js.map +1 -1
- package/dist/components/ui/accordion.js +3 -3
- package/dist/components/ui/accordion.js.map +1 -1
- package/dist/components/ui/alert-dialog.js +5 -5
- package/dist/components/ui/alert-dialog.js.map +1 -1
- package/dist/components/ui/alert.js +2 -2
- package/dist/components/ui/alert.js.map +1 -1
- package/dist/components/ui/avatar.js +5 -5
- package/dist/components/ui/avatar.js.map +1 -1
- package/dist/components/ui/badge.d.ts +13 -2
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/badge.js +51 -12
- package/dist/components/ui/badge.js.map +1 -1
- package/dist/components/ui/breadcrumb.js +3 -3
- package/dist/components/ui/breadcrumb.js.map +1 -1
- package/dist/components/ui/button-group.js +2 -2
- package/dist/components/ui/button-group.js.map +1 -1
- package/dist/components/ui/button.js +2 -2
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/calendar.js +8 -8
- package/dist/components/ui/calendar.js.map +1 -1
- package/dist/components/ui/card.js +3 -3
- package/dist/components/ui/card.js.map +1 -1
- package/dist/components/ui/carousel.d.ts.map +1 -1
- package/dist/components/ui/carousel.js +20 -10
- package/dist/components/ui/carousel.js.map +1 -1
- package/dist/components/ui/chart.d.ts.map +1 -1
- package/dist/components/ui/chart.js +7 -6
- package/dist/components/ui/chart.js.map +1 -1
- package/dist/components/ui/checkbox.js +1 -1
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/combobox.d.ts.map +1 -1
- package/dist/components/ui/combobox.js +8 -8
- package/dist/components/ui/combobox.js.map +1 -1
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/command.js +6 -6
- package/dist/components/ui/command.js.map +1 -1
- package/dist/components/ui/context-menu.js +8 -8
- package/dist/components/ui/context-menu.js.map +1 -1
- package/dist/components/ui/dialog.js +4 -4
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/drawer.js +4 -4
- package/dist/components/ui/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu.js +9 -9
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/empty.js +2 -2
- package/dist/components/ui/empty.js.map +1 -1
- package/dist/components/ui/hover-card.js +1 -1
- package/dist/components/ui/hover-card.js.map +1 -1
- package/dist/components/ui/input-group.d.ts.map +1 -1
- package/dist/components/ui/input-group.js +3 -3
- package/dist/components/ui/input-group.js.map +1 -1
- package/dist/components/ui/input-otp.js +3 -3
- package/dist/components/ui/input-otp.js.map +1 -1
- package/dist/components/ui/input.js +1 -1
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/item.js +3 -3
- package/dist/components/ui/item.js.map +1 -1
- package/dist/components/ui/kbd.js +1 -1
- package/dist/components/ui/kbd.js.map +1 -1
- package/dist/components/ui/label.d.ts.map +1 -1
- package/dist/components/ui/label.js.map +1 -1
- package/dist/components/ui/menubar.js +9 -9
- package/dist/components/ui/menubar.js.map +1 -1
- package/dist/components/ui/navigation-menu.js +7 -7
- package/dist/components/ui/navigation-menu.js.map +1 -1
- package/dist/components/ui/pagination.d.ts.map +1 -1
- package/dist/components/ui/pagination.js.map +1 -1
- package/dist/components/ui/popover.js +1 -1
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/progress.js +3 -3
- package/dist/components/ui/progress.js.map +1 -1
- package/dist/components/ui/radio-group.js +2 -2
- package/dist/components/ui/radio-group.js.map +1 -1
- package/dist/components/ui/resizable.js +2 -2
- package/dist/components/ui/resizable.js.map +1 -1
- package/dist/components/ui/scroll-area.js +2 -2
- package/dist/components/ui/scroll-area.js.map +1 -1
- package/dist/components/ui/segmented.d.ts.map +1 -1
- package/dist/components/ui/segmented.js +1 -1
- package/dist/components/ui/segmented.js.map +1 -1
- package/dist/components/ui/select.js +8 -8
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/separator.js +1 -1
- package/dist/components/ui/separator.js.map +1 -1
- package/dist/components/ui/sheet.js +3 -3
- package/dist/components/ui/sheet.js.map +1 -1
- package/dist/components/ui/sidebar.js +17 -17
- package/dist/components/ui/sidebar.js.map +1 -1
- package/dist/components/ui/skeleton.js +1 -1
- package/dist/components/ui/skeleton.js.map +1 -1
- package/dist/components/ui/slider.js +2 -2
- package/dist/components/ui/slider.js.map +1 -1
- package/dist/components/ui/sonner.js +1 -1
- package/dist/components/ui/switch.js +2 -2
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/table.js +5 -5
- package/dist/components/ui/table.js.map +1 -1
- package/dist/components/ui/tabs.js +2 -2
- package/dist/components/ui/tabs.js.map +1 -1
- package/dist/components/ui/textarea.js +1 -1
- package/dist/components/ui/textarea.js.map +1 -1
- package/dist/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/components/ui/toggle-group.js +13 -7
- package/dist/components/ui/toggle-group.js.map +1 -1
- package/dist/components/ui/toggle.js +2 -2
- package/dist/components/ui/toggle.js.map +1 -1
- package/dist/components/ui/tooltip.d.ts +10 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip.js +13 -3
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/components/use-dialog/use-dialog.d.ts +2 -2
- package/dist/components/use-dialog/use-dialog.d.ts.map +1 -1
- package/dist/components/use-dialog/use-dialog.js +10 -6
- package/dist/components/use-dialog/use-dialog.js.map +1 -1
- package/dist/components/use-toast/use-toast.d.ts +9 -3
- package/dist/components/use-toast/use-toast.d.ts.map +1 -1
- package/dist/components/use-toast/use-toast.js +23 -22
- package/dist/components/use-toast/use-toast.js.map +1 -1
- package/dist/hooks/use-mobile.d.ts +10 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -1
- package/dist/hooks/use-mobile.js +19 -12
- package/dist/hooks/use-mobile.js.map +1 -1
- package/dist/lib/i18n-fr.d.ts +3 -3
- package/dist/lib/i18n-fr.d.ts.map +1 -1
- package/dist/lib/i18n-fr.js +13 -8
- package/dist/lib/i18n-fr.js.map +1 -1
- package/dist/styles.css +5 -5
- package/package.json +46 -45
- package/src/components/account/__tests__/account-router.spec.ts +4 -2
- package/src/components/account/account-connections.tsx +1 -1
- package/src/components/account/account-header.tsx +6 -1
- package/src/components/account/account-keys.tsx +1 -1
- package/src/components/account/account-layout.tsx +8 -1
- package/src/components/account/account-profile.tsx +3 -3
- package/src/components/account/account-router-options.tsx +1 -0
- package/src/components/account/account-router-page.tsx +1 -0
- package/src/components/account/account-router.tsx +4 -2
- package/src/components/account/account-security.tsx +1 -0
- package/src/components/account/account-sessions.tsx +21 -4
- package/src/components/admin/__tests__/admin-keys-token-dialog.browser.spec.tsx +1 -0
- package/src/components/admin/__tests__/admin-layout.browser.spec.tsx +2 -1
- package/src/components/admin/__tests__/admin-router-page.spec.ts +2 -1
- package/src/components/admin/__tests__/admin-router.spec.ts +57 -1
- package/src/components/admin/__tests__/admin-user-cell.browser.spec.tsx +1 -0
- package/src/components/admin/__tests__/admin-user-detail.spec.ts +1 -0
- package/src/components/admin/admin-analytics-query-panel.tsx +4 -3
- package/src/components/admin/admin-analytics-results.tsx +2 -2
- package/src/components/admin/admin-analytics.tsx +3 -3
- package/src/components/admin/admin-audits.tsx +3 -3
- package/src/components/admin/admin-dashboard-card.tsx +45 -0
- package/src/components/admin/admin-dashboard-count-card.tsx +89 -0
- package/src/components/admin/admin-dashboard.tsx +60 -0
- package/src/components/admin/admin-files.tsx +2 -2
- package/src/components/admin/admin-jobs-executions-panel.tsx +19 -12
- package/src/components/admin/admin-jobs-status-badge.tsx +2 -2
- package/src/components/admin/admin-jobs.tsx +4 -4
- package/src/components/admin/admin-keys-token-dialog.tsx +2 -2
- package/src/components/admin/admin-keys.tsx +2 -2
- package/src/components/admin/admin-layout.tsx +1 -2
- package/src/components/admin/admin-notifications.tsx +2 -2
- package/src/components/admin/admin-parameters.tsx +16 -9
- package/src/components/admin/admin-payments.tsx +2 -2
- package/src/components/admin/admin-router-options.tsx +14 -10
- package/src/components/admin/admin-router-page.tsx +8 -5
- package/src/components/admin/admin-router.tsx +112 -40
- package/src/components/admin/admin-sessions.tsx +13 -2
- package/src/components/admin/admin-user-detail-audits-tab.tsx +5 -2
- package/src/components/admin/admin-user-detail-identity-aside.tsx +16 -93
- package/src/components/admin/admin-user-detail-overview-tab.tsx +1 -0
- package/src/components/admin/admin-user-detail-password-dialog.tsx +1 -0
- package/src/components/admin/admin-user-detail-profile-policy.spec.ts +1 -0
- package/src/components/admin/admin-user-detail-profile-policy.ts +1 -0
- package/src/components/admin/admin-user-detail-security-tab.tsx +1 -0
- package/src/components/admin/admin-user-detail-sessions-tab.tsx +5 -2
- package/src/components/admin/admin-user-detail.tsx +49 -87
- package/src/components/admin/admin-users-roles-picker.tsx +22 -15
- package/src/components/admin/admin-users.tsx +8 -14
- package/src/components/admin/admin-workflows-execution-sheet.tsx +18 -10
- package/src/components/admin/admin-workflows-executions-panel.tsx +24 -17
- package/src/components/admin/admin-workflows-status-badge.tsx +4 -2
- package/src/components/admin/admin-workflows.tsx +6 -4
- package/src/components/admin/diff-lines.spec.ts +1 -0
- package/src/components/admin/diff-lines.ts +1 -1
- package/src/components/admin/parameter-diff-dialog.tsx +3 -2
- package/src/components/admin/parameter-history-item.tsx +6 -5
- package/src/components/alepha-table/__tests__/alepha-table-static.browser.spec.tsx +190 -0
- package/src/components/alepha-table/__tests__/paginate-local.spec.ts +286 -0
- package/src/components/alepha-table/__tests__/use-table-selection.browser.spec.tsx +1 -0
- package/src/components/alepha-table/alepha-table.tsx +362 -79
- package/src/components/alepha-table/paginate-local.ts +174 -0
- package/src/components/app-actions/__tests__/app-actions.browser.spec.tsx +1 -0
- package/src/components/app-shell/app-shell.tsx +42 -19
- package/src/components/auth/__tests__/auth-router.spec.ts +2 -1
- package/src/components/auth/auth-login.tsx +5 -16
- package/src/components/auth/auth-register.tsx +26 -25
- package/src/components/auth/auth-reset-password.tsx +24 -17
- package/src/components/auth/auth-router.tsx +4 -3
- package/src/components/auth/auth-verify-email.tsx +7 -7
- package/src/components/auth/safe-redirect.ts +14 -0
- package/src/components/auto-form/__tests__/auto-form-settings-card.browser.spec.tsx +1 -0
- package/src/components/auto-form/auto-form.tsx +60 -39
- package/src/components/brand-icon/brand-icon.tsx +2 -2
- package/src/components/button-dark/button-dark.tsx +2 -2
- package/src/components/button-language/button-language.tsx +2 -2
- package/src/components/button-theme/button-theme.tsx +2 -2
- package/src/components/button-user/button-user.tsx +4 -4
- package/src/components/captcha/turnstile-widget.tsx +6 -5
- package/src/components/control/control.tsx +6 -6
- package/src/components/control-array/control-array.tsx +28 -15
- package/src/components/control-base/__tests__/form-field-a11y.browser.spec.tsx +1 -0
- package/src/components/control-base/field-i18n.ts +5 -3
- package/src/components/control-base/form-field.tsx +13 -13
- package/src/components/control-base/icon-hint.tsx +1 -1
- package/src/components/control-date/control-date.tsx +29 -6
- package/src/components/control-number/control-number.tsx +3 -3
- package/src/components/control-object/control-object.tsx +11 -8
- package/src/components/control-password/control-password.tsx +2 -2
- package/src/components/control-select/__tests__/control-select-clear-label.browser.spec.tsx +1 -0
- package/src/components/control-select/__tests__/control-select-deselect.browser.spec.tsx +1 -0
- package/src/components/control-select/__tests__/control-select-searchable.browser.spec.tsx +1 -0
- package/src/components/control-select/control-select.tsx +32 -18
- package/src/components/control-upload/control-upload.tsx +16 -10
- package/src/components/detail/__tests__/detail-aside.browser.spec.tsx +135 -0
- package/src/components/detail/__tests__/detail-layout.browser.spec.tsx +151 -0
- package/src/components/detail/detail-aside.tsx +198 -0
- package/src/components/detail/detail-layout.tsx +181 -0
- package/src/components/detail/use-detail-tab.tsx +41 -0
- package/src/components/file-image/file-image.tsx +4 -2
- package/src/components/language-toggle/language-toggle.tsx +2 -2
- package/src/components/markdown-view/__tests__/markdown-view-mermaid.browser.spec.tsx +148 -0
- package/src/components/markdown-view/__tests__/markdown-view-raw-html.browser.spec.tsx +1 -0
- package/src/components/markdown-view/diagram/DiagramErrorBoundary.tsx +42 -0
- package/src/components/markdown-view/diagram/FlowchartDiagram.tsx +136 -0
- package/src/components/markdown-view/diagram/FlowchartDiagramCluster.tsx +59 -0
- package/src/components/markdown-view/diagram/FlowchartDiagramEdge.tsx +95 -0
- package/src/components/markdown-view/diagram/FlowchartDiagramLabel.tsx +58 -0
- package/src/components/markdown-view/diagram/FlowchartDiagramNode.tsx +78 -0
- package/src/components/markdown-view/diagram/MermaidFence.tsx +46 -0
- package/src/components/markdown-view/diagram/__tests__/flowchart-diagram.browser.spec.tsx +210 -0
- package/src/components/markdown-view/diagram/flowchartParser.spec.ts +379 -0
- package/src/components/markdown-view/diagram/flowchartParser.ts +475 -0
- package/src/components/markdown-view/diagram/graphModel.ts +72 -0
- package/src/components/markdown-view/diagram/layoutFlowchart.spec.ts +235 -0
- package/src/components/markdown-view/diagram/layoutFlowchart.ts +324 -0
- package/src/components/markdown-view/diagram/textMetrics.spec.ts +128 -0
- package/src/components/markdown-view/diagram/textMetrics.ts +296 -0
- package/src/components/markdown-view/markdown-view.tsx +128 -9
- package/src/components/nav-shell/__tests__/nav-tree-util.spec.ts +1 -0
- package/src/components/nav-shell/nav-shell.tsx +6 -3
- package/src/components/nav-shell/spotlight.tsx +2 -1
- package/src/components/nav-shell/use-nav-breadcrumbs.ts +1 -0
- package/src/components/nav-shell/use-nav-entries.ts +16 -5
- package/src/components/nav-shell/use-nav-tree.ts +1 -0
- package/src/components/settings/__tests__/settings-nav.browser.spec.tsx +1 -0
- package/src/components/settings/__tests__/settings-section.browser.spec.tsx +1 -0
- package/src/components/settings/settings-card-edge.ts +24 -0
- package/src/components/settings/settings-danger-section.tsx +7 -1
- package/src/components/settings/settings-layout.tsx +16 -1
- package/src/components/settings/settings-nav.tsx +12 -3
- package/src/components/settings/settings-row.tsx +2 -2
- package/src/components/settings/settings-section.tsx +2 -1
- package/src/components/ui/accordion.tsx +3 -3
- package/src/components/ui/alert-dialog.tsx +5 -5
- package/src/components/ui/alert.tsx +2 -2
- package/src/components/ui/avatar.tsx +5 -5
- package/src/components/ui/badge.tsx +48 -2
- package/src/components/ui/breadcrumb.tsx +3 -3
- package/src/components/ui/button-group.tsx +2 -2
- package/src/components/ui/button.tsx +2 -2
- package/src/components/ui/calendar.tsx +8 -8
- package/src/components/ui/card.tsx +3 -3
- package/src/components/ui/carousel.tsx +30 -13
- package/src/components/ui/chart.tsx +18 -6
- package/src/components/ui/checkbox.tsx +1 -1
- package/src/components/ui/combobox.tsx +8 -9
- package/src/components/ui/command.tsx +6 -7
- package/src/components/ui/context-menu.tsx +8 -8
- package/src/components/ui/dialog.tsx +4 -4
- package/src/components/ui/drawer.tsx +4 -4
- package/src/components/ui/dropdown-menu.tsx +9 -9
- package/src/components/ui/empty.tsx +2 -2
- package/src/components/ui/hover-card.tsx +1 -1
- package/src/components/ui/input-group.tsx +6 -3
- package/src/components/ui/input-otp.tsx +3 -3
- package/src/components/ui/input.tsx +1 -1
- package/src/components/ui/item.tsx +3 -3
- package/src/components/ui/kbd.tsx +1 -1
- package/src/components/ui/label.tsx +3 -0
- package/src/components/ui/menubar.tsx +9 -9
- package/src/components/ui/navigation-menu.tsx +7 -7
- package/src/components/ui/pagination.tsx +0 -1
- package/src/components/ui/popover.tsx +1 -1
- package/src/components/ui/progress.tsx +3 -3
- package/src/components/ui/radio-group.tsx +2 -2
- package/src/components/ui/resizable.tsx +2 -2
- package/src/components/ui/scroll-area.tsx +2 -2
- package/src/components/ui/segmented.tsx +8 -3
- package/src/components/ui/select.tsx +8 -8
- package/src/components/ui/separator.tsx +1 -1
- package/src/components/ui/sheet.tsx +3 -3
- package/src/components/ui/sidebar.tsx +20 -20
- package/src/components/ui/skeleton.tsx +1 -1
- package/src/components/ui/slider.tsx +2 -2
- package/src/components/ui/switch.tsx +2 -2
- package/src/components/ui/table.tsx +10 -5
- package/src/components/ui/tabs.tsx +3 -3
- package/src/components/ui/textarea.tsx +1 -1
- package/src/components/ui/toggle-group.tsx +9 -4
- package/src/components/ui/toggle.tsx +2 -2
- package/src/components/ui/tooltip.tsx +13 -3
- package/src/components/use-dialog/use-dialog.tsx +19 -6
- package/src/components/use-toast/__tests__/use-toast.browser.spec.tsx +19 -0
- package/src/components/use-toast/use-toast.tsx +38 -26
- package/src/hooks/use-mobile.ts +27 -14
- package/src/lib/__tests__/i18n-fr.spec.ts +5 -1
- package/src/lib/i18n-fr.ts +18 -10
- package/src/styles.css +5 -5
|
@@ -23,6 +23,13 @@ import {
|
|
|
23
23
|
PaginationNext,
|
|
24
24
|
PaginationPrevious,
|
|
25
25
|
} from "@alepha/ui/components/ui/pagination";
|
|
26
|
+
import {
|
|
27
|
+
Select,
|
|
28
|
+
SelectContent,
|
|
29
|
+
SelectItem,
|
|
30
|
+
SelectTrigger,
|
|
31
|
+
SelectValue,
|
|
32
|
+
} from "@alepha/ui/components/ui/select";
|
|
26
33
|
import { Skeleton } from "@alepha/ui/components/ui/skeleton";
|
|
27
34
|
import {
|
|
28
35
|
Table,
|
|
@@ -44,6 +51,9 @@ import { ClientOnly, useAlepha } from "alepha/react";
|
|
|
44
51
|
import { type FormModel, useForm } from "alepha/react/form";
|
|
45
52
|
import { useI18n } from "alepha/react/i18n";
|
|
46
53
|
import {
|
|
54
|
+
ArrowDown,
|
|
55
|
+
ArrowUp,
|
|
56
|
+
ChevronsUpDown,
|
|
47
57
|
Columns3,
|
|
48
58
|
FunnelX,
|
|
49
59
|
Inbox,
|
|
@@ -61,6 +71,8 @@ import {
|
|
|
61
71
|
useRef,
|
|
62
72
|
useState,
|
|
63
73
|
} from "react";
|
|
74
|
+
|
|
75
|
+
import { paginateLocal } from "./paginate-local.ts";
|
|
64
76
|
import { useTableSelection } from "./use-table-selection.ts";
|
|
65
77
|
|
|
66
78
|
type IconType = ComponentType<SVGProps<SVGSVGElement>>;
|
|
@@ -73,6 +85,14 @@ export interface ColumnDef<T> {
|
|
|
73
85
|
* Sort key sent to the API. Defaults to the column key.
|
|
74
86
|
*/
|
|
75
87
|
sortKey?: string;
|
|
88
|
+
/**
|
|
89
|
+
* Static-data mode only: the value this column sorts on, for a column
|
|
90
|
+
* whose sort key is not a plain property of the row (a derived total, a
|
|
91
|
+
* joined label). Defaults to `item[sortKey]`.
|
|
92
|
+
*
|
|
93
|
+
* Ignored when the table fetches: there the server owns the ordering.
|
|
94
|
+
*/
|
|
95
|
+
sortValue?: (item: T) => unknown;
|
|
76
96
|
/**
|
|
77
97
|
* When true, the column starts hidden. The user can still toggle it
|
|
78
98
|
* on via the built-in column picker. Pass `hideColumnPicker` on the
|
|
@@ -87,6 +107,11 @@ export interface ColumnDef<T> {
|
|
|
87
107
|
* Context passed to every row-action `onClick`. `refresh()` re-fires the
|
|
88
108
|
* current fetch with the current filters/sort — call it after a mutation
|
|
89
109
|
* so the table reflects the new state without a manual reload.
|
|
110
|
+
*
|
|
111
|
+
* ⚠️ In static-data mode there is no fetch to re-fire, so `refresh()` only
|
|
112
|
+
* returns to page 0: the rows belong to the caller, and a mutation has to
|
|
113
|
+
* be written back into the array passed as `data`. The table renders the
|
|
114
|
+
* new array on the same render, without it.
|
|
90
115
|
*/
|
|
91
116
|
export interface RowActionContext {
|
|
92
117
|
refresh: () => void;
|
|
@@ -142,6 +167,27 @@ export interface TableAction {
|
|
|
142
167
|
export interface AlephaTableFilters {
|
|
143
168
|
schema: ZObject;
|
|
144
169
|
initialValues?: Record<string, any>;
|
|
170
|
+
/**
|
|
171
|
+
* Filter values that outrank the persisted ones on mount.
|
|
172
|
+
*
|
|
173
|
+
* `initialValues` is what the table starts from when the reader has never
|
|
174
|
+
* chosen anything; a persisted choice wins over it, which is the right
|
|
175
|
+
* default for a preference. This is the opposite case: values the caller
|
|
176
|
+
* derived from *how the reader got here* — typically a URL param on a
|
|
177
|
+
* drill-through link — where landing on last week's stored filter instead
|
|
178
|
+
* would ignore the link that was just clicked.
|
|
179
|
+
*
|
|
180
|
+
* Read once, at mount, exactly like `initialValues`. Change the
|
|
181
|
+
* component's `key` to re-seed on a later arrival.
|
|
182
|
+
*
|
|
183
|
+
* **Transient, and by construction.** Persistence is written from
|
|
184
|
+
* `form:change` / `form:submit:success` only, never on mount — so a seed
|
|
185
|
+
* shows in the toolbar and narrows the fetch without overwriting the
|
|
186
|
+
* filter the reader chose for themselves last time. Touch any control and
|
|
187
|
+
* the resulting values (seed included) become the stored choice, which is
|
|
188
|
+
* the right moment for it: that is the reader choosing.
|
|
189
|
+
*/
|
|
190
|
+
seedValues?: Record<string, any>;
|
|
145
191
|
render: (form: FormModel<ZObject>) => ReactNode;
|
|
146
192
|
}
|
|
147
193
|
|
|
@@ -150,17 +196,61 @@ interface SortState {
|
|
|
150
196
|
direction: "asc" | "desc";
|
|
151
197
|
}
|
|
152
198
|
|
|
153
|
-
export
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
199
|
+
export type TableFetcher<T> = (params: {
|
|
200
|
+
page: number;
|
|
201
|
+
size: number;
|
|
202
|
+
sort?: string;
|
|
203
|
+
filters?: Record<string, any>;
|
|
204
|
+
}) => Promise<Page<T>>;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Where the rows come from. Exactly one of the two.
|
|
208
|
+
*
|
|
209
|
+
* `data` is not sugar over `fetch`: a fetcher closing over an in-memory
|
|
210
|
+
* array cannot work, because the table holds `fetch` in a ref that is
|
|
211
|
+
* deliberately excluded from its load effect (see `fetchRef`), so the
|
|
212
|
+
* closure goes stale the moment the caller's array changes. Static rows
|
|
213
|
+
* therefore bypass the fetch path entirely and are derived synchronously.
|
|
214
|
+
*/
|
|
215
|
+
export type AlephaTableSource<T> =
|
|
216
|
+
| {
|
|
217
|
+
/**
|
|
218
|
+
* Fetcher invoked with paging + sort + filters. Should return an
|
|
219
|
+
* Alepha `Page<T>`.
|
|
220
|
+
*/
|
|
221
|
+
fetch: TableFetcher<T>;
|
|
222
|
+
data?: never;
|
|
223
|
+
filter?: never;
|
|
224
|
+
}
|
|
225
|
+
| {
|
|
226
|
+
/**
|
|
227
|
+
* Rows the caller already holds. The table filters, sorts and pages
|
|
228
|
+
* them in memory and never issues a request.
|
|
229
|
+
*
|
|
230
|
+
* Use it when the array is the page's data rather than the table's —
|
|
231
|
+
* shared with a chart, a count, an aside — so that one array stays
|
|
232
|
+
* the single source of truth. For anything the reader can outgrow,
|
|
233
|
+
* pass `fetch` and let the server page it.
|
|
234
|
+
*/
|
|
235
|
+
data: T[];
|
|
236
|
+
/**
|
|
237
|
+
* Static-data mode only: predicate replacing the built-in field
|
|
238
|
+
* matching, which pairs each filter value with the same-named
|
|
239
|
+
* property (strings as a case-insensitive substring, arrays by
|
|
240
|
+
* membership, everything else strictly).
|
|
241
|
+
*
|
|
242
|
+
* Reach for it as soon as a filter is not a field: a `search` box
|
|
243
|
+
* spanning several columns, a range, a joined label. Only ever
|
|
244
|
+
* called with filter values that are actually set.
|
|
245
|
+
*/
|
|
246
|
+
filter?: (item: T, filters: Record<string, any>) => boolean;
|
|
247
|
+
fetch?: never;
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
export type AlephaTableProps<T> = AlephaTableBaseProps<T> &
|
|
251
|
+
AlephaTableSource<T>;
|
|
252
|
+
|
|
253
|
+
export interface AlephaTableBaseProps<T> {
|
|
164
254
|
/**
|
|
165
255
|
* Column definitions, keyed by the property name they read from.
|
|
166
256
|
*/
|
|
@@ -176,9 +266,17 @@ export interface AlephaTableProps<T> {
|
|
|
176
266
|
*/
|
|
177
267
|
bulkActions?: BulkAction<T>[];
|
|
178
268
|
/**
|
|
179
|
-
*
|
|
269
|
+
* Page size the table opens on. The reader can change it from the footer;
|
|
270
|
+
* with `persistenceKey` set, their choice is remembered and wins over this.
|
|
180
271
|
*/
|
|
181
272
|
defaultSize?: number;
|
|
273
|
+
/**
|
|
274
|
+
* Sizes offered in the footer picker. Defaults to {@link PAGE_SIZES}.
|
|
275
|
+
*
|
|
276
|
+
* Pass `[]` to hide the picker entirely, for a table whose page size is
|
|
277
|
+
* not the reader's business.
|
|
278
|
+
*/
|
|
279
|
+
pageSizes?: number[];
|
|
182
280
|
/**
|
|
183
281
|
* Stable row identifier. Defaults to `item.id`.
|
|
184
282
|
*/
|
|
@@ -190,6 +288,9 @@ export interface AlephaTableProps<T> {
|
|
|
190
288
|
onRowClick?: (item: T) => void;
|
|
191
289
|
/**
|
|
192
290
|
* Auto-refresh interval in ms (only when document is visible).
|
|
291
|
+
*
|
|
292
|
+
* Meaningless in static-data mode — there is no request to repeat, and a
|
|
293
|
+
* changed `data` array is already on screen the render it changes.
|
|
193
294
|
*/
|
|
194
295
|
pollMs?: number;
|
|
195
296
|
/**
|
|
@@ -199,6 +300,9 @@ export interface AlephaTableProps<T> {
|
|
|
199
300
|
* already get `ctx.refresh()`; this is the escape hatch for everything
|
|
200
301
|
* else. Changing it resets to page 0 and refetches; the initial value
|
|
201
302
|
* is ignored (the table fetches on mount regardless).
|
|
303
|
+
*
|
|
304
|
+
* Not needed in static-data mode: a new `data` array is picked up on its
|
|
305
|
+
* own. Bumping this there only resets to page 0.
|
|
202
306
|
*/
|
|
203
307
|
refreshSignal?: number | string;
|
|
204
308
|
/**
|
|
@@ -285,11 +389,16 @@ export interface AlephaTableProps<T> {
|
|
|
285
389
|
}
|
|
286
390
|
|
|
287
391
|
const defaultRowKey = (item: unknown): string =>
|
|
392
|
+
// Coercion at a boundary: the value is a form/route/chart primitive whose
|
|
393
|
+
// declared type is wider than what can reach here.
|
|
394
|
+
// oxlint-disable-next-line typescript/no-base-to-string
|
|
288
395
|
String((item as { id?: unknown })?.id ?? Math.random());
|
|
289
396
|
|
|
290
397
|
const EMPTY_FILTERS_SCHEMA = z.object({}) as ZObject;
|
|
291
398
|
|
|
292
|
-
/**
|
|
399
|
+
/**
|
|
400
|
+
* Synchronous localStorage read. Returns undefined on miss or error.
|
|
401
|
+
*/
|
|
293
402
|
const readPersisted = <V,>(key: string, suffix: string): V | undefined => {
|
|
294
403
|
if (typeof window === "undefined") return undefined;
|
|
295
404
|
try {
|
|
@@ -300,7 +409,9 @@ const readPersisted = <V,>(key: string, suffix: string): V | undefined => {
|
|
|
300
409
|
}
|
|
301
410
|
};
|
|
302
411
|
|
|
303
|
-
/**
|
|
412
|
+
/**
|
|
413
|
+
* Synchronous localStorage write. Empty objects/null delete the key.
|
|
414
|
+
*/
|
|
304
415
|
const writePersisted = (key: string, suffix: string, value: unknown): void => {
|
|
305
416
|
if (typeof window === "undefined") return;
|
|
306
417
|
const fullKey = `${key}.${suffix}`;
|
|
@@ -326,9 +437,31 @@ const writePersisted = (key: string, suffix: string, value: unknown): void => {
|
|
|
326
437
|
}
|
|
327
438
|
};
|
|
328
439
|
|
|
440
|
+
/**
|
|
441
|
+
* Page sizes the footer offers.
|
|
442
|
+
*
|
|
443
|
+
* No "all". Pagination here is server-side, so an unbounded fetch is a query
|
|
444
|
+
* whose cost grows with the biggest table in the product and is paid by the
|
|
445
|
+
* reader who can least afford it. 100 covers "let me scan the lot" without
|
|
446
|
+
* that.
|
|
447
|
+
*/
|
|
448
|
+
export const PAGE_SIZES = [10, 20, 50, 100];
|
|
449
|
+
|
|
329
450
|
export function AlephaTable<T>(props: AlephaTableProps<T>) {
|
|
330
451
|
const rowKey = props.rowKey ?? defaultRowKey;
|
|
331
|
-
|
|
452
|
+
|
|
453
|
+
// State, not a constant. It was `props.defaultSize ?? 20` read once, so a
|
|
454
|
+
// reader had no way to see more rows than the call site had decided for
|
|
455
|
+
// them. Already in `load`'s dependency array, so changing it refetches.
|
|
456
|
+
const [size, setSize] = useState<number>(
|
|
457
|
+
() =>
|
|
458
|
+
(props.persistenceKey
|
|
459
|
+
? readPersisted<number>(props.persistenceKey, "size")
|
|
460
|
+
: undefined) ??
|
|
461
|
+
props.defaultSize ??
|
|
462
|
+
20,
|
|
463
|
+
);
|
|
464
|
+
const pageSizes = props.pageSizes ?? PAGE_SIZES;
|
|
332
465
|
const alepha = useAlepha();
|
|
333
466
|
const { tr } = useI18n();
|
|
334
467
|
|
|
@@ -344,10 +477,13 @@ export function AlephaTable<T>(props: AlephaTableProps<T>) {
|
|
|
344
477
|
|
|
345
478
|
const mergedFilterInitialValues = useMemo<Record<string, any>>(
|
|
346
479
|
() => ({
|
|
347
|
-
...
|
|
348
|
-
...
|
|
480
|
+
...props.filters?.initialValues,
|
|
481
|
+
...persistedFilterValues,
|
|
482
|
+
// Last, so it beats the stored choice — see `seedValues`. A drill-through
|
|
483
|
+
// link that lost to a filter the reader set last week would be a link
|
|
484
|
+
// that does nothing.
|
|
485
|
+
...props.filters?.seedValues,
|
|
349
486
|
}),
|
|
350
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
351
487
|
[],
|
|
352
488
|
);
|
|
353
489
|
|
|
@@ -367,6 +503,22 @@ export function AlephaTable<T>(props: AlephaTableProps<T>) {
|
|
|
367
503
|
// -- Paging / sort / data --------------------------------------------------
|
|
368
504
|
|
|
369
505
|
const [page, setPage] = useState(0);
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* Change the page size and go back to the first page.
|
|
509
|
+
*
|
|
510
|
+
* The reset is the whole point: raising the size while on page 5 can put
|
|
511
|
+
* the reader past the last page, which renders an empty table with no
|
|
512
|
+
* visible cause. Persisted so the choice survives a reload, alongside the
|
|
513
|
+
* filters, sort and columns this table already remembers.
|
|
514
|
+
*/
|
|
515
|
+
const changeSize = (next: number) => {
|
|
516
|
+
setSize(next);
|
|
517
|
+
setPage(0);
|
|
518
|
+
if (props.persistenceKey) {
|
|
519
|
+
writePersisted(props.persistenceKey, "size", next);
|
|
520
|
+
}
|
|
521
|
+
};
|
|
370
522
|
const [sort, setSort] = useState<SortState | null>(() => {
|
|
371
523
|
if (props.persistenceKey) {
|
|
372
524
|
const persisted = readPersisted<SortState>(props.persistenceKey, "sort");
|
|
@@ -374,8 +526,8 @@ export function AlephaTable<T>(props: AlephaTableProps<T>) {
|
|
|
374
526
|
}
|
|
375
527
|
return props.defaultSort ?? null;
|
|
376
528
|
});
|
|
377
|
-
const [
|
|
378
|
-
const [
|
|
529
|
+
const [fetchedData, setData] = useState<T[]>([]);
|
|
530
|
+
const [fetchedMeta, setMeta] = useState<Page<T>["page"] | null>(null);
|
|
379
531
|
const [loading, setLoading] = useState(false);
|
|
380
532
|
const [refreshKey, setRefreshKey] = useState(0);
|
|
381
533
|
const [isRefreshing, setIsRefreshing] = useState(false);
|
|
@@ -400,9 +552,13 @@ export function AlephaTable<T>(props: AlephaTableProps<T>) {
|
|
|
400
552
|
fetchRef.current = props.fetch;
|
|
401
553
|
|
|
402
554
|
const load = useCallback(async () => {
|
|
555
|
+
// Static mode owns no request. Bail before touching `loading` too, so a
|
|
556
|
+
// table fed an array never flashes the skeleton over rows it already has.
|
|
557
|
+
const fetcher = fetchRef.current;
|
|
558
|
+
if (!fetcher) return;
|
|
403
559
|
setLoading(true);
|
|
404
560
|
try {
|
|
405
|
-
const res = await
|
|
561
|
+
const res = await fetcher({
|
|
406
562
|
page,
|
|
407
563
|
size,
|
|
408
564
|
sort: sortParam,
|
|
@@ -428,6 +584,66 @@ export function AlephaTable<T>(props: AlephaTableProps<T>) {
|
|
|
428
584
|
void load();
|
|
429
585
|
}, [load]);
|
|
430
586
|
|
|
587
|
+
/**
|
|
588
|
+
* Static mode's equivalent of `load` — derived, not stored.
|
|
589
|
+
*
|
|
590
|
+
* Deliberately NOT routed through `load`: putting `props.data` in that
|
|
591
|
+
* effect's dependencies reproduces the exact loop `fetchRef` exists to
|
|
592
|
+
* prevent (load → setData → re-render → new inline array → new load).
|
|
593
|
+
* Computed synchronously there is no state to go stale, an inline
|
|
594
|
+
* `data={rows.filter(…)}` is safe, and a changed array is on screen in
|
|
595
|
+
* the same render.
|
|
596
|
+
*/
|
|
597
|
+
const staticPage = useMemo(() => {
|
|
598
|
+
if (!props.data) return null;
|
|
599
|
+
const sortValues: Record<string, (item: T) => unknown> = {};
|
|
600
|
+
for (const [key, column] of Object.entries(props.columns)) {
|
|
601
|
+
if (column.sortValue) {
|
|
602
|
+
sortValues[column.sortKey ?? key] = column.sortValue;
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
return paginateLocal(props.data, {
|
|
606
|
+
page,
|
|
607
|
+
size,
|
|
608
|
+
sort: sortParam,
|
|
609
|
+
sortValues,
|
|
610
|
+
filters: form?.currentValues,
|
|
611
|
+
filter: props.filter,
|
|
612
|
+
});
|
|
613
|
+
// `refreshKey` is what the filter-form subscriptions bump, so it is how
|
|
614
|
+
// a filter change reaches this memo — `form.currentValues` is mutated in
|
|
615
|
+
// place and its identity never changes.
|
|
616
|
+
}, [
|
|
617
|
+
props.data,
|
|
618
|
+
props.columns,
|
|
619
|
+
props.filter,
|
|
620
|
+
page,
|
|
621
|
+
size,
|
|
622
|
+
sortParam,
|
|
623
|
+
refreshKey,
|
|
624
|
+
form,
|
|
625
|
+
]);
|
|
626
|
+
|
|
627
|
+
const data = staticPage ? staticPage.content : fetchedData;
|
|
628
|
+
const meta = staticPage ? staticPage.page : fetchedMeta;
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* Rows vanish under the reader in static mode: the caller detaches one and
|
|
632
|
+
* the page they are on stops existing. Nothing fetches, so nothing else
|
|
633
|
+
* would notice — the table would sit on an empty page with no visible
|
|
634
|
+
* cause. Fetch mode has the same hole, but there the server round-trip
|
|
635
|
+
* needed to see it makes this the wrong place to close it.
|
|
636
|
+
*/
|
|
637
|
+
if (staticPage) {
|
|
638
|
+
const totalPages = staticPage.page.totalPages ?? 0;
|
|
639
|
+
if (page > 0 && page > totalPages - 1) {
|
|
640
|
+
// Guarded on `page`, so it settles in one pass and does not need an
|
|
641
|
+
// effect: the clamp lands before the rows render against a page that no
|
|
642
|
+
// longer exists.
|
|
643
|
+
setPage(Math.max(0, totalPages - 1));
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
|
|
431
647
|
// Persist sort to localStorage on every change.
|
|
432
648
|
useEffect(() => {
|
|
433
649
|
if (!props.persistenceKey) return;
|
|
@@ -672,7 +888,7 @@ export function AlephaTable<T>(props: AlephaTableProps<T>) {
|
|
|
672
888
|
// WHITE wash that leaves the field lighter than the bar. Only the
|
|
673
889
|
// dark-scoped rule (0,3,0) outranks it, and without it the two
|
|
674
890
|
// controls disagreed: the trigger went dark, the input stayed light.
|
|
675
|
-
<div className="bg-muted
|
|
891
|
+
<div 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">
|
|
676
892
|
{props.filters && form ? (
|
|
677
893
|
<form
|
|
678
894
|
{...form.props}
|
|
@@ -800,52 +1016,53 @@ export function AlephaTable<T>(props: AlephaTableProps<T>) {
|
|
|
800
1016
|
</div>
|
|
801
1017
|
)}
|
|
802
1018
|
|
|
803
|
-
{hasCheckbox &&
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
<div className="pointer-events-
|
|
810
|
-
<
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
<span className="mx-1 h-4 w-px bg-white/20" />
|
|
836
|
-
<Button
|
|
837
|
-
size="icon"
|
|
838
|
-
className="size-8 bg-transparent text-zinc-300 hover:bg-white/10 hover:text-zinc-100"
|
|
839
|
-
onClick={clearSelection}
|
|
840
|
-
aria-label={tr("alephaTable.clearSelection", {
|
|
841
|
-
default: "Clear selection",
|
|
1019
|
+
{hasCheckbox &&
|
|
1020
|
+
selection.size > 0 && (
|
|
1021
|
+
// Linear-style floating action pill: fixed at the bottom-center of
|
|
1022
|
+
// the viewport, dark surface that stays readable in both themes
|
|
1023
|
+
// because the colors are hard-coded (theme-relative `bg-foreground`
|
|
1024
|
+
// inverts awkwardly against a white container in dark mode).
|
|
1025
|
+
<div className="pointer-events-none fixed inset-x-0 bottom-6 z-40 flex justify-center">
|
|
1026
|
+
<div 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">
|
|
1027
|
+
<span className="pl-2 text-sm">
|
|
1028
|
+
{tr("alephaTable.selected", {
|
|
1029
|
+
default: `${selection.size} selected`,
|
|
1030
|
+
args: [String(selection.size)],
|
|
1031
|
+
})}
|
|
1032
|
+
</span>
|
|
1033
|
+
<span className="mx-1 h-4 w-px bg-white/20" />
|
|
1034
|
+
{props.bulkActions?.map((action) => {
|
|
1035
|
+
const ActionIcon = action.icon;
|
|
1036
|
+
return (
|
|
1037
|
+
<Button
|
|
1038
|
+
key={action.label}
|
|
1039
|
+
size="sm"
|
|
1040
|
+
className={
|
|
1041
|
+
action.destructive
|
|
1042
|
+
? "h-8 bg-red-600 text-white hover:bg-red-500"
|
|
1043
|
+
: "h-8 bg-transparent text-zinc-100 hover:bg-white/10 hover:text-zinc-100"
|
|
1044
|
+
}
|
|
1045
|
+
onClick={() => action.onClick(selectedItems, bulkCtx)}
|
|
1046
|
+
>
|
|
1047
|
+
{ActionIcon && <ActionIcon className="size-4" />}
|
|
1048
|
+
{action.label}
|
|
1049
|
+
</Button>
|
|
1050
|
+
);
|
|
842
1051
|
})}
|
|
843
|
-
|
|
844
|
-
<
|
|
845
|
-
|
|
1052
|
+
<span className="mx-1 h-4 w-px bg-white/20" />
|
|
1053
|
+
<Button
|
|
1054
|
+
size="icon"
|
|
1055
|
+
className="size-8 bg-transparent text-zinc-300 hover:bg-white/10 hover:text-zinc-100"
|
|
1056
|
+
onClick={clearSelection}
|
|
1057
|
+
aria-label={tr("alephaTable.clearSelection", {
|
|
1058
|
+
default: "Clear selection",
|
|
1059
|
+
})}
|
|
1060
|
+
>
|
|
1061
|
+
<X className="size-4" />
|
|
1062
|
+
</Button>
|
|
1063
|
+
</div>
|
|
846
1064
|
</div>
|
|
847
|
-
|
|
848
|
-
)}
|
|
1065
|
+
)}
|
|
849
1066
|
|
|
850
1067
|
{/*
|
|
851
1068
|
The toolbar, the rows and the footer are one panel: each facing edge
|
|
@@ -864,7 +1081,11 @@ export function AlephaTable<T>(props: AlephaTableProps<T>) {
|
|
|
864
1081
|
)}
|
|
865
1082
|
>
|
|
866
1083
|
<Table>
|
|
867
|
-
|
|
1084
|
+
{/* `bg-muted`, fully opaque, NOT the base header's `bg-muted/50`:
|
|
1085
|
+
this header is sticky, so anything translucent lets the rows
|
|
1086
|
+
scroll visibly through the column labels. Same tint, no
|
|
1087
|
+
transparency. */}
|
|
1088
|
+
<TableHeader className="bg-muted sticky top-0 z-10 shadow-[inset_0_-1px_0_0_var(--border)]">
|
|
868
1089
|
<TableRow>
|
|
869
1090
|
{hasCheckbox && (
|
|
870
1091
|
<TableHead className="w-10">
|
|
@@ -903,13 +1124,35 @@ export function AlephaTable<T>(props: AlephaTableProps<T>) {
|
|
|
903
1124
|
<button
|
|
904
1125
|
type="button"
|
|
905
1126
|
onClick={() => toggleSort(key, def)}
|
|
906
|
-
className="hover:text-foreground inline-flex cursor-pointer
|
|
1127
|
+
className="group/sort hover:text-foreground inline-flex cursor-pointer items-center gap-1 select-none"
|
|
907
1128
|
>
|
|
908
1129
|
{def.label}
|
|
909
|
-
{
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
1130
|
+
{/* A sortable column says so at rest. The arrow
|
|
1131
|
+
used to appear only once a column WAS sorted,
|
|
1132
|
+
so an unsorted sortable header and a dead one
|
|
1133
|
+
were indistinguishable until you happened to
|
|
1134
|
+
hover one. The neutral glyph is dimmed so a row
|
|
1135
|
+
of them does not shout, and brightens under the
|
|
1136
|
+
cursor.
|
|
1137
|
+
|
|
1138
|
+
Lucide, not the `↑` / `↓` characters this
|
|
1139
|
+
replaced: those render in the text font at text
|
|
1140
|
+
weight and sat visibly apart from every other
|
|
1141
|
+
icon in the table.
|
|
1142
|
+
|
|
1143
|
+
`aria-hidden` throughout: `aria-sort` on the
|
|
1144
|
+
`th` already states this to assistive tech. */}
|
|
1145
|
+
{sorted ? (
|
|
1146
|
+
sort?.direction === "asc" ? (
|
|
1147
|
+
<ArrowUp className="size-3.5" aria-hidden />
|
|
1148
|
+
) : (
|
|
1149
|
+
<ArrowDown className="size-3.5" aria-hidden />
|
|
1150
|
+
)
|
|
1151
|
+
) : (
|
|
1152
|
+
<ChevronsUpDown
|
|
1153
|
+
className="size-3.5 opacity-40 transition-opacity group-hover/sort:opacity-100"
|
|
1154
|
+
aria-hidden
|
|
1155
|
+
/>
|
|
913
1156
|
)}
|
|
914
1157
|
</button>
|
|
915
1158
|
) : (
|
|
@@ -1016,11 +1259,51 @@ export function AlephaTable<T>(props: AlephaTableProps<T>) {
|
|
|
1016
1259
|
|
|
1017
1260
|
{/* `bg-muted`, paired with the filter bar above — see the note there. */}
|
|
1018
1261
|
<div className="bg-muted -mt-2 flex flex-wrap items-center justify-between gap-2 rounded-md rounded-t-none border p-2">
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1262
|
+
{/* The size picker sits with the count, not in the toolbar above:
|
|
1263
|
+
this line already answers "how many, where am I", while the
|
|
1264
|
+
toolbar answers "which rows". Mixing the two turns the toolbar
|
|
1265
|
+
into a junk drawer. */}
|
|
1266
|
+
<div className="flex items-center gap-2">
|
|
1267
|
+
{pageSizes.length > 0 && (
|
|
1268
|
+
// The same Select the filter bar's controls are built on, not
|
|
1269
|
+
// a bare `<select>`: a native control renders in the OS widget
|
|
1270
|
+
// set and sat visibly apart from every other trigger in this
|
|
1271
|
+
// table. `Control` itself is form-bound, so the picker uses the
|
|
1272
|
+
// component underneath it.
|
|
1273
|
+
<Select
|
|
1274
|
+
value={String(size)}
|
|
1275
|
+
onValueChange={(value) => changeSize(Number(value))}
|
|
1276
|
+
>
|
|
1277
|
+
<SelectTrigger
|
|
1278
|
+
// `bg-background`, because this bar is `bg-muted` and the
|
|
1279
|
+
// trigger is `bg-transparent` by default: on a plain form
|
|
1280
|
+
// surface that blending is right, on a tinted bar it made
|
|
1281
|
+
// the picker read as part of the bar while the pagination
|
|
1282
|
+
// buttons beside it sat on their own plane. Overridden here
|
|
1283
|
+
// rather than in `SelectTrigger`, which every form still
|
|
1284
|
+
// wants transparent.
|
|
1285
|
+
className="bg-background h-7 w-auto gap-1 text-xs"
|
|
1286
|
+
aria-label={String(
|
|
1287
|
+
tr("table.pageSize", { default: "Rows per page" }),
|
|
1288
|
+
)}
|
|
1289
|
+
>
|
|
1290
|
+
<SelectValue />
|
|
1291
|
+
</SelectTrigger>
|
|
1292
|
+
<SelectContent>
|
|
1293
|
+
{pageSizes.map((n) => (
|
|
1294
|
+
<SelectItem key={n} value={String(n)}>
|
|
1295
|
+
{n}
|
|
1296
|
+
</SelectItem>
|
|
1297
|
+
))}
|
|
1298
|
+
</SelectContent>
|
|
1299
|
+
</Select>
|
|
1300
|
+
)}
|
|
1301
|
+
<p className="text-muted-foreground text-xs">
|
|
1302
|
+
{meta
|
|
1303
|
+
? `Page ${meta.number + 1}${meta.totalPages ? ` of ${meta.totalPages}` : ""} · ${meta.numberOfElements} of ${meta.totalElements ?? "?"}`
|
|
1304
|
+
: "—"}
|
|
1305
|
+
</p>
|
|
1306
|
+
</div>
|
|
1024
1307
|
{meta && meta.totalPages && meta.totalPages > 1 ? (
|
|
1025
1308
|
<Pagination className="mx-0 w-auto justify-end">
|
|
1026
1309
|
<PaginationContent>
|
|
@@ -1164,7 +1447,7 @@ function computePageItems(
|
|
|
1164
1447
|
return items;
|
|
1165
1448
|
}
|
|
1166
1449
|
|
|
1167
|
-
|
|
1450
|
+
const SkeletonRows = (props: { rows: number; cols: number }) => {
|
|
1168
1451
|
return (
|
|
1169
1452
|
<>
|
|
1170
1453
|
{Array.from({ length: props.rows }).map((_, i) => (
|
|
@@ -1178,7 +1461,7 @@ function SkeletonRows(props: { rows: number; cols: number }) {
|
|
|
1178
1461
|
))}
|
|
1179
1462
|
</>
|
|
1180
1463
|
);
|
|
1181
|
-
}
|
|
1464
|
+
};
|
|
1182
1465
|
|
|
1183
1466
|
function RowActionsMenu<T>(props: {
|
|
1184
1467
|
actions: RowAction<T>[];
|