@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
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
Trash2,
|
|
34
34
|
} from "lucide-react";
|
|
35
35
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
36
|
+
|
|
36
37
|
import {
|
|
37
38
|
childI18nPrefix,
|
|
38
39
|
resolveFieldI18n,
|
|
@@ -189,7 +190,9 @@ const objectVariants = (itemSchema: ZType): ZObject[] | null => {
|
|
|
189
190
|
return objects.length === variants.length ? objects : null;
|
|
190
191
|
};
|
|
191
192
|
|
|
192
|
-
/**
|
|
193
|
+
/**
|
|
194
|
+
* The property whose value identifies the variant (a literal in every variant).
|
|
195
|
+
*/
|
|
193
196
|
const discriminantOf = (variants: ZObject[]): string | null => {
|
|
194
197
|
const [first] = variants;
|
|
195
198
|
if (!first) return null;
|
|
@@ -205,7 +208,9 @@ const discriminantOf = (variants: ZObject[]): string | null => {
|
|
|
205
208
|
return null;
|
|
206
209
|
};
|
|
207
210
|
|
|
208
|
-
/**
|
|
211
|
+
/**
|
|
212
|
+
* The single allowed value of a literal/const schema, if it is one.
|
|
213
|
+
*/
|
|
209
214
|
const literalValueOf = (schema: unknown): unknown => {
|
|
210
215
|
if (!schema) return undefined;
|
|
211
216
|
const inner = z.schema.unwrap(schema as ZType) as {
|
|
@@ -222,7 +227,9 @@ const literalValueOf = (schema: unknown): unknown => {
|
|
|
222
227
|
return values?.length === 1 ? values[0] : undefined;
|
|
223
228
|
};
|
|
224
229
|
|
|
225
|
-
/**
|
|
230
|
+
/**
|
|
231
|
+
* Label for a variant: its discriminant value, else its index.
|
|
232
|
+
*/
|
|
226
233
|
const variantLabel = (
|
|
227
234
|
variant: ZObject,
|
|
228
235
|
discriminant: string | null,
|
|
@@ -273,7 +280,7 @@ const buildFieldInput = (
|
|
|
273
280
|
set: (v: unknown) => onFieldChange(fieldName, v),
|
|
274
281
|
});
|
|
275
282
|
|
|
276
|
-
export
|
|
283
|
+
export const ControlArray = (props: ControlArrayProps) => {
|
|
277
284
|
const form = useFormState(props.input, ["error"]);
|
|
278
285
|
const { tr } = useI18n();
|
|
279
286
|
const { items, setItems, nextKey } = useArrayItems(props.input);
|
|
@@ -329,9 +336,15 @@ export function ControlArray(props: ControlArrayProps) {
|
|
|
329
336
|
? Object.keys(z.schema.shape(objectItemSchema))
|
|
330
337
|
: [];
|
|
331
338
|
|
|
332
|
-
// Schema-driven max/min if present
|
|
333
|
-
|
|
334
|
-
const
|
|
339
|
+
// Schema-driven max/min if present: `z.array().max(3)` lands in zod's
|
|
340
|
+
// constraint bag, the JSON-schema `maxItems` names never existed here.
|
|
341
|
+
const bounds =
|
|
342
|
+
(z.schema.unwrap(schema) as { _zod?: { bag?: Record<string, unknown> } })
|
|
343
|
+
._zod?.bag ?? {};
|
|
344
|
+
const schemaMax =
|
|
345
|
+
typeof bounds.maximum === "number" ? bounds.maximum : undefined;
|
|
346
|
+
const schemaMin =
|
|
347
|
+
typeof bounds.minimum === "number" ? bounds.minimum : undefined;
|
|
335
348
|
const min = props.min ?? schemaMin ?? 0;
|
|
336
349
|
const max = props.max ?? schemaMax ?? Number.POSITIVE_INFINITY;
|
|
337
350
|
const columns = props.columns ?? 1;
|
|
@@ -339,8 +352,8 @@ export function ControlArray(props: ControlArrayProps) {
|
|
|
339
352
|
// Tabs heuristic: forced or nested complex item or many items
|
|
340
353
|
const hasComplexFields = objectItemSchema
|
|
341
354
|
? fieldNames.some((n) => {
|
|
342
|
-
const
|
|
343
|
-
return
|
|
355
|
+
const inner = z.schema.unwrap(z.schema.shape(objectItemSchema)[n]);
|
|
356
|
+
return z.schema.isObject(inner) || z.schema.isArray(inner);
|
|
344
357
|
})
|
|
345
358
|
: false;
|
|
346
359
|
const useTabs =
|
|
@@ -429,7 +442,7 @@ export function ControlArray(props: ControlArrayProps) {
|
|
|
429
442
|
<div className={`grid gap-3 ${colsClass[columns]}`}>
|
|
430
443
|
{itemFieldNames.map((name) => {
|
|
431
444
|
const fieldProps = {
|
|
432
|
-
...
|
|
445
|
+
...props.controlProps?.[name],
|
|
433
446
|
...resolveFieldI18n(
|
|
434
447
|
tr as never,
|
|
435
448
|
props.i18nPrefix,
|
|
@@ -517,7 +530,7 @@ export function ControlArray(props: ControlArrayProps) {
|
|
|
517
530
|
key={item.key}
|
|
518
531
|
className="bg-muted/30 flex items-start gap-2 rounded-md border p-3"
|
|
519
532
|
>
|
|
520
|
-
<div className="
|
|
533
|
+
<div className="min-w-0 flex-1">{renderItemBody(item, index)}</div>
|
|
521
534
|
{itemActions(index)}
|
|
522
535
|
</div>
|
|
523
536
|
))}
|
|
@@ -541,7 +554,7 @@ export function ControlArray(props: ControlArrayProps) {
|
|
|
541
554
|
</div>
|
|
542
555
|
{items[activeTab] && (
|
|
543
556
|
<div className="bg-muted/30 flex items-start gap-2 rounded-md border p-3">
|
|
544
|
-
<div className="
|
|
557
|
+
<div className="min-w-0 flex-1">
|
|
545
558
|
{renderItemBody(items[activeTab], activeTab)}
|
|
546
559
|
</div>
|
|
547
560
|
{itemActions(activeTab)}
|
|
@@ -590,8 +603,8 @@ export function ControlArray(props: ControlArrayProps) {
|
|
|
590
603
|
<Plus className="size-4" />
|
|
591
604
|
</Button>
|
|
592
605
|
)}
|
|
593
|
-
<div className="flex
|
|
594
|
-
<div className="text-sm font-medium
|
|
606
|
+
<div className="flex min-w-0 flex-1 flex-col">
|
|
607
|
+
<div className="text-sm leading-tight font-medium">
|
|
595
608
|
{meta.label}
|
|
596
609
|
{meta.required && <span className="text-destructive ml-0.5">*</span>}
|
|
597
610
|
<span className="text-muted-foreground ml-2 text-xs">
|
|
@@ -697,4 +710,4 @@ export function ControlArray(props: ControlArrayProps) {
|
|
|
697
710
|
{confirmContent}
|
|
698
711
|
</fieldset>
|
|
699
712
|
);
|
|
700
|
-
}
|
|
713
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Dictionary-driven labels and help text for schema-generated fields.
|
|
3
3
|
*
|
|
4
|
-
* A generated form can only prettify a property name
|
|
4
|
+
* A generated form can only prettify a property name: `reducedFactor` becomes
|
|
5
5
|
* "Reduced Factor", which tells an operator nothing. Given a prefix, every
|
|
6
6
|
* field can instead read a human label from `<prefix>.<field>` and help text
|
|
7
7
|
* from `<prefix>.<field>.desc`, translated like the rest of the app.
|
|
@@ -20,7 +20,7 @@ export interface FieldI18nProps {
|
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Fill `label`/`description` from the dictionary when the caller left them
|
|
23
|
-
* unset. A missing key makes `tr` echo the key back, so compare against it
|
|
23
|
+
* unset. A missing key makes `tr` echo the key back, so compare against it:
|
|
24
24
|
* an absent entry must leave the field to its schema/pretty-name fallback.
|
|
25
25
|
*/
|
|
26
26
|
export const resolveFieldI18n = (
|
|
@@ -53,7 +53,9 @@ export const resolveFieldI18n = (
|
|
|
53
53
|
return next;
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* Prefix for a child of `name`: `parameters.x.payg` + `dailyCapCents`.
|
|
58
|
+
*/
|
|
57
59
|
export const childI18nPrefix = (
|
|
58
60
|
prefix: string | undefined,
|
|
59
61
|
name: string,
|
|
@@ -15,16 +15,16 @@ export type FormFieldLayout = "stack" | "row";
|
|
|
15
15
|
*/
|
|
16
16
|
const FormFieldLayoutContext = createContext<FormFieldLayout>("stack");
|
|
17
17
|
|
|
18
|
-
export
|
|
18
|
+
export const FormFieldLayoutProvider = (props: {
|
|
19
19
|
value: FormFieldLayout;
|
|
20
20
|
children: ReactNode;
|
|
21
|
-
}) {
|
|
21
|
+
}) => {
|
|
22
22
|
return (
|
|
23
23
|
<FormFieldLayoutContext.Provider value={props.value}>
|
|
24
24
|
{props.children}
|
|
25
25
|
</FormFieldLayoutContext.Provider>
|
|
26
26
|
);
|
|
27
|
-
}
|
|
27
|
+
};
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* Read the ambient layout (see {@link FormFieldLayoutProvider}).
|
|
@@ -44,16 +44,16 @@ export function useFormFieldLayout(): FormFieldLayout {
|
|
|
44
44
|
*/
|
|
45
45
|
const FormFieldAutoSaveContext = createContext<boolean>(false);
|
|
46
46
|
|
|
47
|
-
export
|
|
47
|
+
export const FormFieldAutoSaveProvider = (props: {
|
|
48
48
|
value: boolean;
|
|
49
49
|
children: ReactNode;
|
|
50
|
-
}) {
|
|
50
|
+
}) => {
|
|
51
51
|
return (
|
|
52
52
|
<FormFieldAutoSaveContext.Provider value={props.value}>
|
|
53
53
|
{props.children}
|
|
54
54
|
</FormFieldAutoSaveContext.Provider>
|
|
55
55
|
);
|
|
56
|
-
}
|
|
56
|
+
};
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
59
|
* Read the ambient auto-save flag (see {@link FormFieldAutoSaveProvider}).
|
|
@@ -76,16 +76,16 @@ export function useFormFieldAutoSave(): boolean {
|
|
|
76
76
|
*/
|
|
77
77
|
const FormFieldRequiredMarkerContext = createContext<boolean>(true);
|
|
78
78
|
|
|
79
|
-
export
|
|
79
|
+
export const FormFieldRequiredMarkerProvider = (props: {
|
|
80
80
|
value: boolean;
|
|
81
81
|
children: ReactNode;
|
|
82
|
-
}) {
|
|
82
|
+
}) => {
|
|
83
83
|
return (
|
|
84
84
|
<FormFieldRequiredMarkerContext.Provider value={props.value}>
|
|
85
85
|
{props.children}
|
|
86
86
|
</FormFieldRequiredMarkerContext.Provider>
|
|
87
87
|
);
|
|
88
|
-
}
|
|
88
|
+
};
|
|
89
89
|
|
|
90
90
|
/**
|
|
91
91
|
* Read the ambient required-marker flag (see
|
|
@@ -221,7 +221,7 @@ export interface FormFieldProps {
|
|
|
221
221
|
* `<textarea>`, or trigger button via the `data-invalid` attribute (so we
|
|
222
222
|
* don't have to thread `error` through every leaf widget).
|
|
223
223
|
*/
|
|
224
|
-
export
|
|
224
|
+
export const FormField = (props: FormFieldProps) => {
|
|
225
225
|
const ambient = useContext(FormFieldLayoutContext);
|
|
226
226
|
const layout = props.layout ?? ambient;
|
|
227
227
|
// Hook first, `&&` after: `props.required && useFormFieldRequiredMarker()`
|
|
@@ -281,7 +281,7 @@ export function FormField(props: FormFieldProps) {
|
|
|
281
281
|
{props.error && (
|
|
282
282
|
<p
|
|
283
283
|
id={errorId}
|
|
284
|
-
className="text-destructive
|
|
284
|
+
className="text-destructive flex items-center gap-1 text-xs"
|
|
285
285
|
role="alert"
|
|
286
286
|
>
|
|
287
287
|
<span aria-hidden>⚠</span>
|
|
@@ -320,7 +320,7 @@ export function FormField(props: FormFieldProps) {
|
|
|
320
320
|
{props.error && (
|
|
321
321
|
<p
|
|
322
322
|
id={errorId}
|
|
323
|
-
className="text-destructive
|
|
323
|
+
className="text-destructive flex items-center gap-1 text-xs"
|
|
324
324
|
role="alert"
|
|
325
325
|
>
|
|
326
326
|
<span aria-hidden>⚠</span>
|
|
@@ -329,4 +329,4 @@ export function FormField(props: FormFieldProps) {
|
|
|
329
329
|
)}
|
|
330
330
|
</div>
|
|
331
331
|
);
|
|
332
|
-
}
|
|
332
|
+
};
|
|
@@ -57,7 +57,7 @@ const namedIcons: Record<string, IconComponent> = {
|
|
|
57
57
|
* component. Returns `undefined` if not found.
|
|
58
58
|
*/
|
|
59
59
|
export const iconFor = (
|
|
60
|
-
hint?: IconHint | string | null,
|
|
60
|
+
hint?: IconHint | (string & {}) | null,
|
|
61
61
|
): IconComponent | undefined => {
|
|
62
62
|
if (!hint) return undefined;
|
|
63
63
|
return namedIcons[hint as string];
|
|
@@ -52,7 +52,7 @@ export interface ControlDateProps {
|
|
|
52
52
|
disabled?: boolean;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
export
|
|
55
|
+
export const ControlDate = (props: ControlDateProps) => {
|
|
56
56
|
const form = useFormState(props.input, ["error"]);
|
|
57
57
|
const [value, setValue] = useFieldValue(props.input);
|
|
58
58
|
|
|
@@ -109,7 +109,7 @@ export function ControlDate(props: ControlDateProps) {
|
|
|
109
109
|
/>
|
|
110
110
|
</FormField>
|
|
111
111
|
);
|
|
112
|
-
}
|
|
112
|
+
};
|
|
113
113
|
|
|
114
114
|
interface DatePopoverProps {
|
|
115
115
|
id?: string;
|
|
@@ -119,9 +119,32 @@ interface DatePopoverProps {
|
|
|
119
119
|
onChange: (value: string | undefined) => void;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
/**
|
|
123
|
+
* A date-only value (`YYYY-MM-DD`) names a calendar day, so it is parsed
|
|
124
|
+
* and formatted in local parts: `new Date("2026-08-23")` is UTC midnight,
|
|
125
|
+
* which displays as the 22nd west of Greenwich, and `toISOString()` on a
|
|
126
|
+
* local midnight stores the previous day east of it.
|
|
127
|
+
*/
|
|
128
|
+
const parseDateOnly = (value: string): Date => {
|
|
129
|
+
const [year, month, day] = value.split("-").map(Number);
|
|
130
|
+
return new Date(year, month - 1, day);
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
const formatDateOnly = (date: Date): string => {
|
|
134
|
+
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
135
|
+
const day = String(date.getDate()).padStart(2, "0");
|
|
136
|
+
return `${date.getFullYear()}-${month}-${day}`;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
const DATE_ONLY = /^\d{4}-\d{2}-\d{2}$/;
|
|
140
|
+
|
|
141
|
+
const DatePopover = (props: DatePopoverProps) => {
|
|
123
142
|
const [open, setOpen] = useState(false);
|
|
124
|
-
const date = props.value
|
|
143
|
+
const date = props.value
|
|
144
|
+
? !props.withTime && DATE_ONLY.test(props.value)
|
|
145
|
+
? parseDateOnly(props.value)
|
|
146
|
+
: new Date(props.value)
|
|
147
|
+
: undefined;
|
|
125
148
|
|
|
126
149
|
const formatted = date
|
|
127
150
|
? props.withTime
|
|
@@ -137,7 +160,7 @@ function DatePopover(props: DatePopoverProps) {
|
|
|
137
160
|
if (props.withTime) {
|
|
138
161
|
props.onChange(d.toISOString());
|
|
139
162
|
} else {
|
|
140
|
-
props.onChange(d
|
|
163
|
+
props.onChange(formatDateOnly(d));
|
|
141
164
|
setOpen(false);
|
|
142
165
|
}
|
|
143
166
|
};
|
|
@@ -187,4 +210,4 @@ function DatePopover(props: DatePopoverProps) {
|
|
|
187
210
|
</PopoverContent>
|
|
188
211
|
</Popover>
|
|
189
212
|
);
|
|
190
|
-
}
|
|
213
|
+
};
|
|
@@ -39,7 +39,7 @@ export interface ControlNumberProps {
|
|
|
39
39
|
*/
|
|
40
40
|
max?: number;
|
|
41
41
|
/**
|
|
42
|
-
* Step size.
|
|
42
|
+
* Step size. Defaults to 1.
|
|
43
43
|
*/
|
|
44
44
|
step?: number;
|
|
45
45
|
/**
|
|
@@ -48,7 +48,7 @@ export interface ControlNumberProps {
|
|
|
48
48
|
disabled?: boolean;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
export
|
|
51
|
+
export const ControlNumber = (props: ControlNumberProps) => {
|
|
52
52
|
const form = useFormState(props.input, ["error"]);
|
|
53
53
|
const [value, setValue] = useFieldValue(props.input);
|
|
54
54
|
|
|
@@ -133,4 +133,4 @@ export function ControlNumber(props: ControlNumberProps) {
|
|
|
133
133
|
</div>
|
|
134
134
|
</FormField>
|
|
135
135
|
);
|
|
136
|
-
}
|
|
136
|
+
};
|
|
@@ -2,11 +2,11 @@ import * as React from "react";
|
|
|
2
2
|
|
|
3
3
|
void React;
|
|
4
4
|
|
|
5
|
+
import { spanClass, widthFor } from "@alepha/ui/components/control-base/grid";
|
|
5
6
|
import {
|
|
6
7
|
Control,
|
|
7
8
|
type ControlProps,
|
|
8
9
|
} from "@alepha/ui/components/control/control";
|
|
9
|
-
import { spanClass, widthFor } from "@alepha/ui/components/control-base/grid";
|
|
10
10
|
import { Button } from "@alepha/ui/components/ui/button";
|
|
11
11
|
import { type ZObject, z } from "alepha";
|
|
12
12
|
import {
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
import { useI18n } from "alepha/react/i18n";
|
|
20
20
|
import { ChevronDown, ChevronRight, Plus, Trash2 } from "lucide-react";
|
|
21
21
|
import { useState } from "react";
|
|
22
|
+
|
|
22
23
|
import {
|
|
23
24
|
childI18nPrefix,
|
|
24
25
|
resolveFieldI18n,
|
|
@@ -57,7 +58,9 @@ export interface ControlObjectProps {
|
|
|
57
58
|
* Default expanded state. @default true
|
|
58
59
|
*/
|
|
59
60
|
defaultExpanded?: boolean;
|
|
60
|
-
/**
|
|
61
|
+
/**
|
|
62
|
+
* Dictionary prefix for this object's children (see `resolveFieldI18n`).
|
|
63
|
+
*/
|
|
61
64
|
i18nPrefix?: string;
|
|
62
65
|
/**
|
|
63
66
|
* Allow the user to clear the object (sets value to undefined).
|
|
@@ -65,7 +68,7 @@ export interface ControlObjectProps {
|
|
|
65
68
|
clearable?: boolean;
|
|
66
69
|
}
|
|
67
70
|
|
|
68
|
-
export
|
|
71
|
+
export const ControlObject = (props: ControlObjectProps) => {
|
|
69
72
|
const form = useFormState(props.input, ["error"]);
|
|
70
73
|
const [value, setValue] = useFieldValue(props.input);
|
|
71
74
|
const [expanded, setExpanded] = useState(props.defaultExpanded ?? true);
|
|
@@ -93,12 +96,12 @@ export function ControlObject(props: ControlObjectProps) {
|
|
|
93
96
|
| undefined;
|
|
94
97
|
|
|
95
98
|
const grid = (
|
|
96
|
-
<div className="grid
|
|
99
|
+
<div className="grid grid-cols-12 gap-3">
|
|
97
100
|
{fieldNames.map((name) => {
|
|
98
101
|
const field = nestedItems?.[name];
|
|
99
102
|
if (!field) return null;
|
|
100
103
|
const fieldProps = {
|
|
101
|
-
...
|
|
104
|
+
...props.controlProps?.[name],
|
|
102
105
|
...resolveFieldI18n(
|
|
103
106
|
tr as never,
|
|
104
107
|
props.i18nPrefix,
|
|
@@ -153,9 +156,9 @@ export function ControlObject(props: ControlObjectProps) {
|
|
|
153
156
|
) : (
|
|
154
157
|
<div className="size-8 shrink-0" />
|
|
155
158
|
)}
|
|
156
|
-
<div className="flex
|
|
159
|
+
<div className="flex min-w-0 flex-1 flex-col">
|
|
157
160
|
{meta.label && (
|
|
158
|
-
<legend className="text-sm font-medium
|
|
161
|
+
<legend className="text-sm leading-tight font-medium">
|
|
159
162
|
{meta.label}
|
|
160
163
|
{meta.required && (
|
|
161
164
|
<span className="text-destructive ml-0.5">*</span>
|
|
@@ -197,4 +200,4 @@ export function ControlObject(props: ControlObjectProps) {
|
|
|
197
200
|
{expanded && isInitialized && <div className="mt-3">{grid}</div>}
|
|
198
201
|
</fieldset>
|
|
199
202
|
);
|
|
200
|
-
}
|
|
203
|
+
};
|
|
@@ -46,7 +46,7 @@ export const ControlPassword = (props: ControlPasswordProps) => {
|
|
|
46
46
|
>
|
|
47
47
|
<div className="relative">
|
|
48
48
|
{Icon && (
|
|
49
|
-
<Icon className="text-muted-foreground absolute top-1/2 left-3 size-4 -translate-y-1/2
|
|
49
|
+
<Icon className="text-muted-foreground pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2" />
|
|
50
50
|
)}
|
|
51
51
|
<Input
|
|
52
52
|
{...props.inputProps}
|
|
@@ -59,7 +59,7 @@ export const ControlPassword = (props: ControlPasswordProps) => {
|
|
|
59
59
|
name={props.name}
|
|
60
60
|
type={reveal ? "text" : "password"}
|
|
61
61
|
autoComplete={props.autoComplete ?? "current-password"}
|
|
62
|
-
|
|
62
|
+
|
|
63
63
|
disabled={props.disabled}
|
|
64
64
|
required={props.required}
|
|
65
65
|
minLength={props.minLength}
|
|
@@ -6,6 +6,7 @@ import { type BaseInputField, useFieldValue, useForm } from "alepha/react/form";
|
|
|
6
6
|
import { AlephaReactI18n } from "alepha/react/i18n";
|
|
7
7
|
import type { ReactNode } from "react";
|
|
8
8
|
import { describe, expect, it } from "vitest";
|
|
9
|
+
|
|
9
10
|
import { ControlSelect } from "../control-select.tsx";
|
|
10
11
|
|
|
11
12
|
/**
|
|
@@ -6,6 +6,7 @@ import { type BaseInputField, useFieldValue, useForm } from "alepha/react/form";
|
|
|
6
6
|
import { AlephaReactI18n } from "alepha/react/i18n";
|
|
7
7
|
import type { ReactNode } from "react";
|
|
8
8
|
import { describe, expect, it } from "vitest";
|
|
9
|
+
|
|
9
10
|
import { ControlSelect } from "../control-select.tsx";
|
|
10
11
|
|
|
11
12
|
/**
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
} from "alepha/react/form";
|
|
30
30
|
import { useI18n } from "alepha/react/i18n";
|
|
31
31
|
import { Loader2 } from "lucide-react";
|
|
32
|
-
import { type ReactNode,
|
|
32
|
+
import { type ReactNode, useMemo, useRef, useState } from "react";
|
|
33
33
|
|
|
34
34
|
export type SelectOption =
|
|
35
35
|
| string
|
|
@@ -94,7 +94,7 @@ export interface ControlSelectProps {
|
|
|
94
94
|
*/
|
|
95
95
|
loader?: (search: string, resolve?: string[]) => Async<SelectOption[]>;
|
|
96
96
|
/**
|
|
97
|
-
* Option count above which `loader` is invoked on every search instead of once. Defaults to
|
|
97
|
+
* Option count above which `loader` is invoked on every search instead of once. Defaults to 100.
|
|
98
98
|
*/
|
|
99
99
|
loaderThreshold?: number;
|
|
100
100
|
/**
|
|
@@ -194,7 +194,7 @@ const titlecase = (s: string) =>
|
|
|
194
194
|
const segmentedLabel = (o: SelectOption) =>
|
|
195
195
|
typeof o === "string" ? titlecase(o) : o.label;
|
|
196
196
|
|
|
197
|
-
export
|
|
197
|
+
export const ControlSelect = (props: ControlSelectProps) => {
|
|
198
198
|
const { tr } = useI18n();
|
|
199
199
|
const form = useFormState(props.input, ["error"]);
|
|
200
200
|
const [value, setValue] = useFieldValue(props.input);
|
|
@@ -235,18 +235,24 @@ export function ControlSelect(props: ControlSelectProps) {
|
|
|
235
235
|
props.input.initialValue,
|
|
236
236
|
);
|
|
237
237
|
|
|
238
|
-
|
|
239
|
-
|
|
238
|
+
// Labels and `disabled` flags are part of the identity: keying on the
|
|
239
|
+
// joined values alone collided (`["ab","c"]` vs `["a","bc"]`) and kept a
|
|
240
|
+
// stale list when only the labels changed.
|
|
241
|
+
const enumKey = JSON.stringify(enumValues);
|
|
240
242
|
const min = meta.constraints.minimum;
|
|
241
243
|
const max = meta.constraints.maximum;
|
|
242
|
-
|
|
243
|
-
|
|
244
|
+
// Derived, not stored: this is a pure function of the schema. As state
|
|
245
|
+
// filled in by an effect, the first paint of every boolean or ranged select
|
|
246
|
+
// was an EMPTY list, corrected one render later.
|
|
247
|
+
const staticData = useMemo<SelectOption[]>(() => {
|
|
248
|
+
if (effectiveLoader) return [];
|
|
244
249
|
if (isBoolean && enumValues.length === 0) {
|
|
245
|
-
|
|
250
|
+
return [
|
|
246
251
|
{ value: "true", label: tr("controlSelect.yes", { default: "Yes" }) },
|
|
247
252
|
{ value: "false", label: tr("controlSelect.no", { default: "No" }) },
|
|
248
|
-
]
|
|
249
|
-
}
|
|
253
|
+
];
|
|
254
|
+
}
|
|
255
|
+
if (
|
|
250
256
|
isNumeric &&
|
|
251
257
|
enumValues.length === 0 &&
|
|
252
258
|
typeof min === "number" &&
|
|
@@ -255,10 +261,9 @@ export function ControlSelect(props: ControlSelectProps) {
|
|
|
255
261
|
) {
|
|
256
262
|
const range: SelectOption[] = [];
|
|
257
263
|
for (let i = min; i <= max; i++) range.push(String(i));
|
|
258
|
-
|
|
259
|
-
} else {
|
|
260
|
-
setStaticData(enumValues);
|
|
264
|
+
return range;
|
|
261
265
|
}
|
|
266
|
+
return enumValues;
|
|
262
267
|
}, [effectiveLoader, enumKey, isBoolean, isNumeric, min, max, tr]);
|
|
263
268
|
|
|
264
269
|
const data = effectiveLoader ? asyncData : staticData;
|
|
@@ -347,7 +352,7 @@ export function ControlSelect(props: ControlSelectProps) {
|
|
|
347
352
|
/>
|
|
348
353
|
</FormField>
|
|
349
354
|
);
|
|
350
|
-
}
|
|
355
|
+
};
|
|
351
356
|
|
|
352
357
|
interface ComboboxProps {
|
|
353
358
|
id?: string;
|
|
@@ -451,7 +456,10 @@ function Combobox(props: ComboboxProps) {
|
|
|
451
456
|
? (props.value as unknown[]).map(String)
|
|
452
457
|
: []
|
|
453
458
|
: props.value != null
|
|
454
|
-
?
|
|
459
|
+
? // Coercion at a boundary: the value is a form/route/chart primitive whose
|
|
460
|
+
// declared type is wider than what can reach here.
|
|
461
|
+
// oxlint-disable-next-line typescript/no-base-to-string
|
|
462
|
+
[String(props.value)]
|
|
455
463
|
: [];
|
|
456
464
|
|
|
457
465
|
const labelFor = (val: string) =>
|
|
@@ -600,14 +608,14 @@ function Combobox(props: ComboboxProps) {
|
|
|
600
608
|
<div className="flex min-w-0 flex-1 flex-col">
|
|
601
609
|
<div className="flex items-center gap-1.5">
|
|
602
610
|
{opt.tag && (
|
|
603
|
-
<span className="bg-muted text-muted-foreground rounded px-1 text-[10px]
|
|
611
|
+
<span className="bg-muted text-muted-foreground rounded px-1 text-[10px] tracking-wide uppercase">
|
|
604
612
|
{opt.tag}
|
|
605
613
|
</span>
|
|
606
614
|
)}
|
|
607
615
|
<span className="truncate">{opt.label}</span>
|
|
608
616
|
</div>
|
|
609
617
|
{opt.description && (
|
|
610
|
-
<span className="text-muted-foreground text-xs
|
|
618
|
+
<span className="text-muted-foreground truncate text-xs">
|
|
611
619
|
{opt.description}
|
|
612
620
|
</span>
|
|
613
621
|
)}
|
|
@@ -685,7 +693,7 @@ function Combobox(props: ComboboxProps) {
|
|
|
685
693
|
id={props.id}
|
|
686
694
|
disabled={props.disabled}
|
|
687
695
|
className={cn(
|
|
688
|
-
"flex h-8 w-full items-center justify-between gap-1.5 rounded-lg border
|
|
696
|
+
"border-input focus-visible:border-ring focus-visible:ring-ring/50 dark:bg-input/30 dark:hover:bg-input/50 flex h-8 w-full items-center justify-between gap-1.5 rounded-lg border bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50",
|
|
689
697
|
// Muted means "nothing chosen yet", which is only true without
|
|
690
698
|
// a clear row. WITH one, empty is a selected value — the popup
|
|
691
699
|
// already puts the check mark on it (see `cbValue`), and the
|
|
@@ -750,7 +758,13 @@ const useAsyncLoader = (
|
|
|
750
758
|
cache.current.set("", result);
|
|
751
759
|
setData(result);
|
|
752
760
|
|
|
761
|
+
// Coercion at a boundary: the value is a form/route/chart primitive whose
|
|
762
|
+
// declared type is wider than what can reach here.
|
|
763
|
+
// oxlint-disable-next-line typescript/no-base-to-string
|
|
753
764
|
if (!isShort && defaultValue != null && String(defaultValue) !== "") {
|
|
765
|
+
// Coercion at a boundary: the value is a form/route/chart primitive whose
|
|
766
|
+
// declared type is wider than what can reach here.
|
|
767
|
+
// oxlint-disable-next-line typescript/no-base-to-string
|
|
754
768
|
const resolved = await loader("", [String(defaultValue)]);
|
|
755
769
|
if (resolved.length > 0) {
|
|
756
770
|
setData((prev) => {
|