@alepha/ui 0.25.1 → 0.26.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/LICENSE +21 -0
- package/README.md +136 -2
- package/dist/components/account/account-connections.d.ts +16 -0
- package/dist/components/account/account-connections.d.ts.map +1 -0
- package/dist/components/account/account-connections.js +76 -0
- package/dist/components/account/account-connections.js.map +1 -0
- package/dist/components/account/account-delete-dialog.d.ts +44 -0
- package/dist/components/account/account-delete-dialog.d.ts.map +1 -0
- package/dist/components/account/account-delete-dialog.js +126 -0
- package/dist/components/account/account-delete-dialog.js.map +1 -0
- package/dist/components/account/account-header.d.ts +33 -0
- package/dist/components/account/account-header.d.ts.map +1 -0
- package/dist/components/account/account-header.js +41 -0
- package/dist/components/account/account-header.js.map +1 -0
- package/dist/components/account/account-keys.d.ts +23 -0
- package/dist/components/account/account-keys.d.ts.map +1 -0
- package/dist/components/account/account-keys.js +168 -0
- package/dist/components/account/account-keys.js.map +1 -0
- package/dist/components/account/account-layout.d.ts +32 -0
- package/dist/components/account/account-layout.d.ts.map +1 -0
- package/dist/components/account/account-layout.js +53 -0
- package/dist/components/account/account-layout.js.map +1 -0
- package/dist/components/account/account-password-dialog.d.ts +31 -0
- package/dist/components/account/account-password-dialog.d.ts.map +1 -0
- package/dist/components/account/account-password-dialog.js +120 -0
- package/dist/components/account/account-password-dialog.js.map +1 -0
- package/dist/components/account/account-profile.d.ts +27 -0
- package/dist/components/account/account-profile.d.ts.map +1 -0
- package/dist/components/account/account-profile.js +217 -0
- package/dist/components/account/account-profile.js.map +1 -0
- package/dist/components/account/account-router-options.d.ts +77 -0
- package/dist/components/account/account-router-options.d.ts.map +1 -0
- package/dist/components/account/account-router-options.js +22 -0
- package/dist/components/account/account-router-options.js.map +1 -0
- package/dist/components/account/account-router-page.d.ts +49 -0
- package/dist/components/account/account-router-page.d.ts.map +1 -0
- package/dist/components/account/account-router-page.js +61 -0
- package/dist/components/account/account-router-page.js.map +1 -0
- package/dist/components/account/account-router.d.ts +214 -0
- package/dist/components/account/account-router.d.ts.map +1 -0
- package/dist/components/account/account-router.js +216 -0
- package/dist/components/account/account-router.js.map +1 -0
- package/dist/components/account/account-security.d.ts +22 -0
- package/dist/components/account/account-security.d.ts.map +1 -0
- package/dist/components/account/account-security.js +107 -0
- package/dist/components/account/account-security.js.map +1 -0
- package/dist/components/account/account-sessions.d.ts +17 -0
- package/dist/components/account/account-sessions.d.ts.map +1 -0
- package/dist/components/account/account-sessions.js +108 -0
- package/dist/components/account/account-sessions.js.map +1 -0
- package/dist/components/action-error-toaster/action-error-toaster.d.ts +39 -0
- package/dist/components/action-error-toaster/action-error-toaster.d.ts.map +1 -0
- package/dist/components/action-error-toaster/action-error-toaster.js +40 -0
- package/dist/components/action-error-toaster/action-error-toaster.js.map +1 -0
- package/dist/components/admin/admin-analytics-query-panel.d.ts +16 -0
- package/dist/components/admin/admin-analytics-query-panel.d.ts.map +1 -0
- package/dist/components/admin/admin-analytics-query-panel.js +117 -0
- package/dist/components/admin/admin-analytics-query-panel.js.map +1 -0
- package/dist/components/admin/admin-analytics-results.d.ts +15 -0
- package/dist/components/admin/admin-analytics-results.d.ts.map +1 -0
- package/dist/components/admin/admin-analytics-results.js +56 -0
- package/dist/components/admin/admin-analytics-results.js.map +1 -0
- package/dist/components/admin/admin-analytics.d.ts +9 -0
- package/dist/components/admin/admin-analytics.d.ts.map +1 -0
- package/dist/components/admin/admin-analytics.js +66 -0
- package/dist/components/admin/admin-analytics.js.map +1 -0
- package/dist/components/admin/admin-audits.d.ts +4 -0
- package/dist/components/admin/admin-audits.d.ts.map +1 -0
- package/dist/components/admin/admin-audits.js +173 -0
- package/dist/components/admin/admin-audits.js.map +1 -0
- package/dist/components/admin/admin-files.d.ts +4 -0
- package/dist/components/admin/admin-files.d.ts.map +1 -0
- package/dist/components/admin/admin-files.js +237 -0
- package/dist/components/admin/admin-files.js.map +1 -0
- package/dist/components/admin/admin-jobs-executions-panel.d.ts +11 -0
- package/dist/components/admin/admin-jobs-executions-panel.d.ts.map +1 -0
- package/dist/components/admin/admin-jobs-executions-panel.js +200 -0
- package/dist/components/admin/admin-jobs-executions-panel.js.map +1 -0
- package/dist/components/admin/admin-jobs-status-badge.d.ts +9 -0
- package/dist/components/admin/admin-jobs-status-badge.d.ts.map +1 -0
- package/dist/components/admin/admin-jobs-status-badge.js +26 -0
- package/dist/components/admin/admin-jobs-status-badge.js.map +1 -0
- package/dist/components/admin/admin-jobs.d.ts +4 -0
- package/dist/components/admin/admin-jobs.d.ts.map +1 -0
- package/dist/components/admin/admin-jobs.js +248 -0
- package/dist/components/admin/admin-jobs.js.map +1 -0
- package/dist/components/admin/admin-keys-token-dialog.d.ts +15 -0
- package/dist/components/admin/admin-keys-token-dialog.d.ts.map +1 -0
- package/dist/components/admin/admin-keys-token-dialog.js +66 -0
- package/dist/components/admin/admin-keys-token-dialog.js.map +1 -0
- package/dist/components/admin/admin-keys.d.ts +4 -0
- package/dist/components/admin/admin-keys.d.ts.map +1 -0
- package/dist/components/admin/admin-keys.js +161 -0
- package/dist/components/admin/admin-keys.js.map +1 -0
- package/dist/components/admin/admin-layout.d.ts +33 -0
- package/dist/components/admin/admin-layout.d.ts.map +1 -0
- package/dist/components/admin/admin-layout.js +101 -0
- package/dist/components/admin/admin-layout.js.map +1 -0
- package/dist/components/admin/admin-notifications.d.ts +4 -0
- package/dist/components/admin/admin-notifications.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications.js +99 -0
- package/dist/components/admin/admin-notifications.js.map +1 -0
- package/dist/components/admin/admin-page.d.ts +16 -0
- package/dist/components/admin/admin-page.d.ts.map +1 -0
- package/dist/components/admin/admin-page.js +15 -0
- package/dist/components/admin/admin-page.js.map +1 -0
- package/dist/components/admin/admin-parameters.d.ts +26 -0
- package/dist/components/admin/admin-parameters.d.ts.map +1 -0
- package/dist/components/admin/admin-parameters.js +560 -0
- package/dist/components/admin/admin-parameters.js.map +1 -0
- package/dist/components/admin/admin-payments.d.ts +4 -0
- package/dist/components/admin/admin-payments.d.ts.map +1 -0
- package/dist/components/admin/admin-payments.js +72 -0
- package/dist/components/admin/admin-payments.js.map +1 -0
- package/dist/components/admin/admin-router-options.d.ts +135 -0
- package/dist/components/admin/admin-router-options.d.ts.map +1 -0
- package/dist/components/admin/admin-router-options.js +29 -0
- package/dist/components/admin/admin-router-options.js.map +1 -0
- package/dist/components/admin/admin-router-page.d.ts +54 -0
- package/dist/components/admin/admin-router-page.d.ts.map +1 -0
- package/dist/components/admin/admin-router-page.js +66 -0
- package/dist/components/admin/admin-router-page.js.map +1 -0
- package/dist/components/admin/admin-router.d.ts +169 -0
- package/dist/components/admin/admin-router.d.ts.map +1 -0
- package/dist/components/admin/admin-router.js +346 -0
- package/dist/components/admin/admin-router.js.map +1 -0
- package/dist/components/admin/admin-sessions.d.ts +4 -0
- package/dist/components/admin/admin-sessions.d.ts.map +1 -0
- package/dist/components/admin/admin-sessions.js +124 -0
- package/dist/components/admin/admin-sessions.js.map +1 -0
- package/dist/components/admin/admin-user-cell.d.ts +37 -0
- package/dist/components/admin/admin-user-cell.d.ts.map +1 -0
- package/dist/components/admin/admin-user-cell.js +35 -0
- package/dist/components/admin/admin-user-cell.js.map +1 -0
- package/dist/components/admin/admin-user-detail-audits-tab.d.ts +15 -0
- package/dist/components/admin/admin-user-detail-audits-tab.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-audits-tab.js +55 -0
- package/dist/components/admin/admin-user-detail-audits-tab.js.map +1 -0
- package/dist/components/admin/admin-user-detail-identity-aside.d.ts +14 -0
- package/dist/components/admin/admin-user-detail-identity-aside.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-identity-aside.js +162 -0
- package/dist/components/admin/admin-user-detail-identity-aside.js.map +1 -0
- package/dist/components/admin/admin-user-detail-overview-tab.d.ts +26 -0
- package/dist/components/admin/admin-user-detail-overview-tab.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-overview-tab.js +60 -0
- package/dist/components/admin/admin-user-detail-overview-tab.js.map +1 -0
- package/dist/components/admin/admin-user-detail-password-dialog.d.ts +15 -0
- package/dist/components/admin/admin-user-detail-password-dialog.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-password-dialog.js +47 -0
- package/dist/components/admin/admin-user-detail-password-dialog.js.map +1 -0
- package/dist/components/admin/admin-user-detail-password-schema.d.ts +10 -0
- package/dist/components/admin/admin-user-detail-password-schema.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-password-schema.js +13 -0
- package/dist/components/admin/admin-user-detail-password-schema.js.map +1 -0
- package/dist/components/admin/admin-user-detail-profile-policy.d.ts +56 -0
- package/dist/components/admin/admin-user-detail-profile-policy.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-profile-policy.js +73 -0
- package/dist/components/admin/admin-user-detail-profile-policy.js.map +1 -0
- package/dist/components/admin/admin-user-detail-profile-schema.d.ts +18 -0
- package/dist/components/admin/admin-user-detail-profile-schema.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-profile-schema.js +21 -0
- package/dist/components/admin/admin-user-detail-profile-schema.js.map +1 -0
- package/dist/components/admin/admin-user-detail-security-tab.d.ts +20 -0
- package/dist/components/admin/admin-user-detail-security-tab.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-security-tab.js +70 -0
- package/dist/components/admin/admin-user-detail-security-tab.js.map +1 -0
- package/dist/components/admin/admin-user-detail-sessions-tab.d.ts +25 -0
- package/dist/components/admin/admin-user-detail-sessions-tab.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-sessions-tab.js +64 -0
- package/dist/components/admin/admin-user-detail-sessions-tab.js.map +1 -0
- package/dist/components/admin/admin-user-detail.d.ts +39 -0
- package/dist/components/admin/admin-user-detail.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail.js +386 -0
- package/dist/components/admin/admin-user-detail.js.map +1 -0
- package/dist/components/admin/admin-users-roles-picker.d.ts +23 -0
- package/dist/components/admin/admin-users-roles-picker.d.ts.map +1 -0
- package/dist/components/admin/admin-users-roles-picker.js +77 -0
- package/dist/components/admin/admin-users-roles-picker.js.map +1 -0
- package/dist/components/admin/admin-users-status-filter.d.ts +13 -0
- package/dist/components/admin/admin-users-status-filter.d.ts.map +1 -0
- package/dist/components/admin/admin-users-status-filter.js +41 -0
- package/dist/components/admin/admin-users-status-filter.js.map +1 -0
- package/dist/components/admin/admin-users.d.ts +16 -0
- package/dist/components/admin/admin-users.d.ts.map +1 -0
- package/dist/components/admin/admin-users.js +325 -0
- package/dist/components/admin/admin-users.js.map +1 -0
- package/dist/components/admin/admin-workflows-execution-sheet.d.ts +11 -0
- package/dist/components/admin/admin-workflows-execution-sheet.d.ts.map +1 -0
- package/dist/components/admin/admin-workflows-execution-sheet.js +190 -0
- package/dist/components/admin/admin-workflows-execution-sheet.js.map +1 -0
- package/dist/components/admin/admin-workflows-executions-panel.d.ts +9 -0
- package/dist/components/admin/admin-workflows-executions-panel.d.ts.map +1 -0
- package/dist/components/admin/admin-workflows-executions-panel.js +153 -0
- package/dist/components/admin/admin-workflows-executions-panel.js.map +1 -0
- package/dist/components/admin/admin-workflows-status-badge.d.ts +12 -0
- package/dist/components/admin/admin-workflows-status-badge.d.ts.map +1 -0
- package/dist/components/admin/admin-workflows-status-badge.js +30 -0
- package/dist/components/admin/admin-workflows-status-badge.js.map +1 -0
- package/dist/components/admin/admin-workflows.d.ts +4 -0
- package/dist/components/admin/admin-workflows.d.ts.map +1 -0
- package/dist/components/admin/admin-workflows.js +145 -0
- package/dist/components/admin/admin-workflows.js.map +1 -0
- package/dist/components/admin/diff-lines.d.ts +13 -0
- package/dist/components/admin/diff-lines.d.ts.map +1 -0
- package/dist/components/admin/diff-lines.js +57 -0
- package/dist/components/admin/diff-lines.js.map +1 -0
- package/dist/components/admin/parameter-diff-dialog.d.ts +36 -0
- package/dist/components/admin/parameter-diff-dialog.d.ts.map +1 -0
- package/dist/components/admin/parameter-diff-dialog.js +58 -0
- package/dist/components/admin/parameter-diff-dialog.js.map +1 -0
- package/dist/components/admin/parameter-history-item.d.ts +17 -0
- package/dist/components/admin/parameter-history-item.d.ts.map +1 -0
- package/dist/components/admin/parameter-history-item.js +177 -0
- package/dist/components/admin/parameter-history-item.js.map +1 -0
- package/dist/components/admin/parameter-json-dialog.d.ts +13 -0
- package/dist/components/admin/parameter-json-dialog.d.ts.map +1 -0
- package/dist/components/admin/parameter-json-dialog.js +63 -0
- package/dist/components/admin/parameter-json-dialog.js.map +1 -0
- package/dist/components/admin/parameter-save-dialog.d.ts +26 -0
- package/dist/components/admin/parameter-save-dialog.d.ts.map +1 -0
- package/dist/components/admin/parameter-save-dialog.js +74 -0
- package/dist/components/admin/parameter-save-dialog.js.map +1 -0
- package/dist/components/admin/use-confirmed-action.d.ts +53 -0
- package/dist/components/admin/use-confirmed-action.d.ts.map +1 -0
- package/dist/components/admin/use-confirmed-action.js +50 -0
- package/dist/components/admin/use-confirmed-action.js.map +1 -0
- package/dist/components/alepha-table/alepha-table.d.ts +218 -0
- package/dist/components/alepha-table/alepha-table.d.ts.map +1 -0
- package/dist/components/alepha-table/alepha-table.js +565 -0
- package/dist/components/alepha-table/alepha-table.js.map +1 -0
- package/dist/components/alepha-table/use-table-selection.d.ts +34 -0
- package/dist/components/alepha-table/use-table-selection.d.ts.map +1 -0
- package/dist/components/alepha-table/use-table-selection.js +45 -0
- package/dist/components/alepha-table/use-table-selection.js.map +1 -0
- package/dist/components/app-actions/app-actions.d.ts +74 -0
- package/dist/components/app-actions/app-actions.d.ts.map +1 -0
- package/dist/components/app-actions/app-actions.js +77 -0
- package/dist/components/app-actions/app-actions.js.map +1 -0
- package/dist/components/app-shell/app-shell.d.ts +135 -0
- package/dist/components/app-shell/app-shell.d.ts.map +1 -0
- package/dist/components/app-shell/app-shell.js +276 -0
- package/dist/components/app-shell/app-shell.js.map +1 -0
- package/dist/components/auth/auth-login.d.ts +40 -0
- package/dist/components/auth/auth-login.d.ts.map +1 -0
- package/dist/components/auth/auth-login.js +237 -0
- package/dist/components/auth/auth-login.js.map +1 -0
- package/dist/components/auth/auth-register.d.ts +35 -0
- package/dist/components/auth/auth-register.d.ts.map +1 -0
- package/dist/components/auth/auth-register.js +478 -0
- package/dist/components/auth/auth-register.js.map +1 -0
- package/dist/components/auth/auth-reset-password.d.ts +21 -0
- package/dist/components/auth/auth-reset-password.d.ts.map +1 -0
- package/dist/components/auth/auth-reset-password.js +283 -0
- package/dist/components/auth/auth-reset-password.js.map +1 -0
- package/dist/components/auth/auth-router.d.ts +245 -0
- package/dist/components/auth/auth-router.d.ts.map +1 -0
- package/dist/components/auth/auth-router.js +117 -0
- package/dist/components/auth/auth-router.js.map +1 -0
- package/dist/components/auth/auth-verify-email.d.ts +19 -0
- package/dist/components/auth/auth-verify-email.d.ts.map +1 -0
- package/dist/components/auth/auth-verify-email.js +124 -0
- package/dist/components/auth/auth-verify-email.js.map +1 -0
- package/dist/components/auth/provider-labels.d.ts +9 -0
- package/dist/components/auth/provider-labels.d.ts.map +1 -0
- package/dist/components/auth/provider-labels.js +20 -0
- package/dist/components/auth/provider-labels.js.map +1 -0
- package/dist/components/auto-form/auto-form.d.ts +219 -0
- package/dist/components/auto-form/auto-form.d.ts.map +1 -0
- package/dist/components/auto-form/auto-form.js +412 -0
- package/dist/components/auto-form/auto-form.js.map +1 -0
- package/dist/components/brand-icon/brand-icon.d.ts +18 -0
- package/dist/components/brand-icon/brand-icon.d.ts.map +1 -0
- package/dist/components/brand-icon/brand-icon.js +84 -0
- package/dist/components/brand-icon/brand-icon.js.map +1 -0
- package/dist/components/button-dark/button-dark.d.ts +25 -0
- package/dist/components/button-dark/button-dark.d.ts.map +1 -0
- package/dist/components/button-dark/button-dark.js +44 -0
- package/dist/components/button-dark/button-dark.js.map +1 -0
- package/dist/components/button-language/button-language.d.ts +24 -0
- package/dist/components/button-language/button-language.d.ts.map +1 -0
- package/dist/components/button-language/button-language.js +50 -0
- package/dist/components/button-language/button-language.js.map +1 -0
- package/dist/components/button-theme/button-theme.d.ts +33 -0
- package/dist/components/button-theme/button-theme.d.ts.map +1 -0
- package/dist/components/button-theme/button-theme.js +90 -0
- package/dist/components/button-theme/button-theme.js.map +1 -0
- package/dist/components/button-user/button-user.d.ts +147 -0
- package/dist/components/button-user/button-user.d.ts.map +1 -0
- package/dist/components/button-user/button-user.js +147 -0
- package/dist/components/button-user/button-user.js.map +1 -0
- package/dist/components/captcha/turnstile-widget.d.ts +59 -0
- package/dist/components/captcha/turnstile-widget.d.ts.map +1 -0
- package/dist/components/captcha/turnstile-widget.js +97 -0
- package/dist/components/captcha/turnstile-widget.js.map +1 -0
- package/dist/components/control/control.d.ts +200 -0
- package/dist/components/control/control.d.ts.map +1 -0
- package/dist/components/control/control.js +300 -0
- package/dist/components/control/control.js.map +1 -0
- package/dist/components/control-array/control-array.d.ts +77 -0
- package/dist/components/control-array/control-array.d.ts.map +1 -0
- package/dist/components/control-array/control-array.js +444 -0
- package/dist/components/control-array/control-array.js.map +1 -0
- package/dist/components/control-base/field-i18n.d.ts +30 -0
- package/dist/components/control-base/field-i18n.d.ts.map +1 -0
- package/dist/components/control-base/field-i18n.js +27 -0
- package/dist/components/control-base/field-i18n.js.map +1 -0
- package/dist/components/control-base/form-field.d.ts +128 -0
- package/dist/components/control-base/form-field.d.ts.map +1 -0
- package/dist/components/control-base/form-field.js +208 -0
- package/dist/components/control-base/form-field.js.map +1 -0
- package/dist/components/control-base/grid.d.ts +18 -0
- package/dist/components/control-base/grid.d.ts.map +1 -0
- package/dist/components/control-base/grid.js +46 -0
- package/dist/components/control-base/grid.js.map +1 -0
- package/dist/components/control-base/icon-hint.d.ts +9 -0
- package/dist/components/control-base/icon-hint.d.ts.map +1 -0
- package/dist/components/control-base/icon-hint.js +35 -0
- package/dist/components/control-base/icon-hint.js.map +1 -0
- package/dist/components/control-date/control-date.d.ts +34 -0
- package/dist/components/control-date/control-date.d.ts.map +1 -0
- package/dist/components/control-date/control-date.js +111 -0
- package/dist/components/control-date/control-date.js.map +1 -0
- package/dist/components/control-number/control-number.d.ts +38 -0
- package/dist/components/control-number/control-number.d.ts.map +1 -0
- package/dist/components/control-number/control-number.js +77 -0
- package/dist/components/control-number/control-number.js.map +1 -0
- package/dist/components/control-object/control-object.d.ts +45 -0
- package/dist/components/control-object/control-object.d.ts.map +1 -0
- package/dist/components/control-object/control-object.js +110 -0
- package/dist/components/control-object/control-object.js.map +1 -0
- package/dist/components/control-password/control-password.d.ts +28 -0
- package/dist/components/control-password/control-password.d.ts.map +1 -0
- package/dist/components/control-password/control-password.js +65 -0
- package/dist/components/control-password/control-password.js.map +1 -0
- package/dist/components/control-select/control-select.d.ts +128 -0
- package/dist/components/control-select/control-select.d.ts.map +1 -0
- package/dist/components/control-select/control-select.js +363 -0
- package/dist/components/control-select/control-select.js.map +1 -0
- package/dist/components/control-upload/control-upload.d.ts +67 -0
- package/dist/components/control-upload/control-upload.d.ts.map +1 -0
- package/dist/components/control-upload/control-upload.js +294 -0
- package/dist/components/control-upload/control-upload.js.map +1 -0
- package/dist/components/file-image/file-image.d.ts +31 -0
- package/dist/components/file-image/file-image.d.ts.map +1 -0
- package/dist/components/file-image/file-image.js +27 -0
- package/dist/components/file-image/file-image.js.map +1 -0
- package/dist/components/language-toggle/language-toggle.d.ts +8 -0
- package/dist/components/language-toggle/language-toggle.d.ts.map +1 -0
- package/dist/components/language-toggle/language-toggle.js +49 -0
- package/dist/components/language-toggle/language-toggle.js.map +1 -0
- package/dist/components/markdown-view/markdown-view.css +114 -0
- package/dist/components/markdown-view/markdown-view.d.ts +21 -0
- package/dist/components/markdown-view/markdown-view.d.ts.map +1 -0
- package/dist/components/markdown-view/markdown-view.js +104 -0
- package/dist/components/markdown-view/markdown-view.js.map +1 -0
- package/dist/components/nav-shell/nav-page.d.ts +24 -0
- package/dist/components/nav-shell/nav-page.d.ts.map +1 -0
- package/dist/components/nav-shell/nav-page.js +28 -0
- package/dist/components/nav-shell/nav-page.js.map +1 -0
- package/dist/components/nav-shell/nav-shell.d.ts +26 -0
- package/dist/components/nav-shell/nav-shell.d.ts.map +1 -0
- package/dist/components/nav-shell/nav-shell.js +53 -0
- package/dist/components/nav-shell/nav-shell.js.map +1 -0
- package/dist/components/nav-shell/nav-tree-util.d.ts +65 -0
- package/dist/components/nav-shell/nav-tree-util.d.ts.map +1 -0
- package/dist/components/nav-shell/nav-tree-util.js +87 -0
- package/dist/components/nav-shell/nav-tree-util.js.map +1 -0
- package/dist/components/nav-shell/spotlight.d.ts +37 -0
- package/dist/components/nav-shell/spotlight.d.ts.map +1 -0
- package/dist/components/nav-shell/spotlight.js +102 -0
- package/dist/components/nav-shell/spotlight.js.map +1 -0
- package/dist/components/nav-shell/use-nav-breadcrumbs.d.ts +24 -0
- package/dist/components/nav-shell/use-nav-breadcrumbs.d.ts.map +1 -0
- package/dist/components/nav-shell/use-nav-breadcrumbs.js +36 -0
- package/dist/components/nav-shell/use-nav-breadcrumbs.js.map +1 -0
- package/dist/components/nav-shell/use-nav-entries.d.ts +45 -0
- package/dist/components/nav-shell/use-nav-entries.d.ts.map +1 -0
- package/dist/components/nav-shell/use-nav-entries.js +60 -0
- package/dist/components/nav-shell/use-nav-entries.js.map +1 -0
- package/dist/components/nav-shell/use-nav-tree.d.ts +21 -0
- package/dist/components/nav-shell/use-nav-tree.d.ts.map +1 -0
- package/dist/components/nav-shell/use-nav-tree.js +48 -0
- package/dist/components/nav-shell/use-nav-tree.js.map +1 -0
- package/dist/components/settings/settings-danger-section.d.ts +35 -0
- package/dist/components/settings/settings-danger-section.d.ts.map +1 -0
- package/dist/components/settings/settings-danger-section.js +42 -0
- package/dist/components/settings/settings-danger-section.js.map +1 -0
- package/dist/components/settings/settings-heading.d.ts +36 -0
- package/dist/components/settings/settings-heading.d.ts.map +1 -0
- package/dist/components/settings/settings-heading.js +39 -0
- package/dist/components/settings/settings-heading.js.map +1 -0
- package/dist/components/settings/settings-layout.d.ts +81 -0
- package/dist/components/settings/settings-layout.d.ts.map +1 -0
- package/dist/components/settings/settings-layout.js +56 -0
- package/dist/components/settings/settings-layout.js.map +1 -0
- package/dist/components/settings/settings-nav.d.ts +85 -0
- package/dist/components/settings/settings-nav.d.ts.map +1 -0
- package/dist/components/settings/settings-nav.js +91 -0
- package/dist/components/settings/settings-nav.js.map +1 -0
- package/dist/components/settings/settings-row.d.ts +45 -0
- package/dist/components/settings/settings-row.d.ts.map +1 -0
- package/dist/components/settings/settings-row.js +44 -0
- package/dist/components/settings/settings-row.js.map +1 -0
- package/dist/components/settings/settings-section.d.ts +36 -0
- package/dist/components/settings/settings-section.d.ts.map +1 -0
- package/dist/components/settings/settings-section.js +36 -0
- package/dist/components/settings/settings-section.js.map +1 -0
- package/dist/components/ui/accordion.d.ts +7 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/accordion.js +55 -0
- package/dist/components/ui/accordion.js.map +1 -0
- package/dist/components/ui/alert-dialog.d.ts +19 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog.js +96 -0
- package/dist/components/ui/alert-dialog.js.map +1 -0
- package/dist/components/ui/alert.d.ts +11 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/alert.js +44 -0
- package/dist/components/ui/alert.js.map +1 -0
- package/dist/components/ui/aspect-ratio.d.ts +5 -0
- package/dist/components/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/components/ui/aspect-ratio.js +15 -0
- package/dist/components/ui/aspect-ratio.js.map +1 -0
- package/dist/components/ui/avatar.d.ts +12 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/avatar.js +52 -0
- package/dist/components/ui/avatar.js.map +1 -0
- package/dist/components/ui/badge.d.ts +8 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/badge.js +31 -0
- package/dist/components/ui/badge.js.map +1 -0
- package/dist/components/ui/breadcrumb.d.ts +11 -0
- package/dist/components/ui/breadcrumb.d.ts.map +1 -0
- package/dist/components/ui/breadcrumb.js +73 -0
- package/dist/components/ui/breadcrumb.js.map +1 -0
- package/dist/components/ui/button-group.d.ts +11 -0
- package/dist/components/ui/button-group.d.ts.map +1 -0
- package/dist/components/ui/button-group.js +43 -0
- package/dist/components/ui/button-group.js.map +1 -0
- package/dist/components/ui/button.d.ts +18 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +60 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/calendar.d.ts +11 -0
- package/dist/components/ui/calendar.d.ts.map +1 -0
- package/dist/components/ui/calendar.js +119 -0
- package/dist/components/ui/calendar.js.map +1 -0
- package/dist/components/ui/card.d.ts +12 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/card.js +57 -0
- package/dist/components/ui/card.js.map +1 -0
- package/dist/components/ui/carousel.d.ts +29 -0
- package/dist/components/ui/carousel.d.ts.map +1 -0
- package/dist/components/ui/carousel.js +134 -0
- package/dist/components/ui/carousel.js.map +1 -0
- package/dist/components/ui/chart.d.ts +45 -0
- package/dist/components/ui/chart.d.ts.map +1 -0
- package/dist/components/ui/chart.js +151 -0
- package/dist/components/ui/chart.js.map +1 -0
- package/dist/components/ui/checkbox.d.ts +4 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/checkbox.js +22 -0
- package/dist/components/ui/checkbox.js.map +1 -0
- package/dist/components/ui/collapsible.d.ts +6 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/collapsible.js +26 -0
- package/dist/components/ui/collapsible.js.map +1 -0
- package/dist/components/ui/combobox.d.ts +25 -0
- package/dist/components/ui/combobox.d.ts.map +1 -0
- package/dist/components/ui/combobox.js +164 -0
- package/dist/components/ui/combobox.js.map +1 -0
- package/dist/components/ui/command.d.ts +20 -0
- package/dist/components/ui/command.d.ts.map +1 -0
- package/dist/components/ui/command.js +89 -0
- package/dist/components/ui/command.js.map +1 -0
- package/dist/components/ui/context-menu.d.ts +30 -0
- package/dist/components/ui/context-menu.d.ts.map +1 -0
- package/dist/components/ui/context-menu.js +134 -0
- package/dist/components/ui/context-menu.js.map +1 -0
- package/dist/components/ui/dialog.d.ts +18 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/dialog.js +93 -0
- package/dist/components/ui/dialog.js.map +1 -0
- package/dist/components/ui/direction.d.ts +2 -0
- package/dist/components/ui/direction.d.ts.map +1 -0
- package/dist/components/ui/direction.js +3 -0
- package/dist/components/ui/drawer.d.ts +17 -0
- package/dist/components/ui/drawer.d.ts.map +1 -0
- package/dist/components/ui/drawer.js +125 -0
- package/dist/components/ui/drawer.js.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +30 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.js +138 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -0
- package/dist/components/ui/empty.d.ts +12 -0
- package/dist/components/ui/empty.d.ts.map +1 -0
- package/dist/components/ui/empty.js +61 -0
- package/dist/components/ui/empty.js.map +1 -0
- package/dist/components/ui/hover-card.d.ts +6 -0
- package/dist/components/ui/hover-card.d.ts.map +1 -0
- package/dist/components/ui/hover-card.js +38 -0
- package/dist/components/ui/hover-card.js.map +1 -0
- package/dist/components/ui/input-group.d.ts +19 -0
- package/dist/components/ui/input-group.d.ts.map +1 -0
- package/dist/components/ui/input-group.js +80 -0
- package/dist/components/ui/input-group.js.map +1 -0
- package/dist/components/ui/input-otp.d.ts +12 -0
- package/dist/components/ui/input-otp.d.ts.map +1 -0
- package/dist/components/ui/input-otp.js +49 -0
- package/dist/components/ui/input-otp.js.map +1 -0
- package/dist/components/ui/input.d.ts +4 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.js +16 -0
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/item.d.ts +23 -0
- package/dist/components/ui/item.d.ts.map +1 -0
- package/dist/components/ui/item.js +122 -0
- package/dist/components/ui/item.js.map +1 -0
- package/dist/components/ui/kbd.d.ts +4 -0
- package/dist/components/ui/kbd.d.ts.map +1 -0
- package/dist/components/ui/kbd.js +21 -0
- package/dist/components/ui/kbd.js.map +1 -0
- package/dist/components/ui/label.d.ts +4 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/label.js +15 -0
- package/dist/components/ui/label.js.map +1 -0
- package/dist/components/ui/menubar.d.ts +30 -0
- package/dist/components/ui/menubar.d.ts.map +1 -0
- package/dist/components/ui/menubar.js +137 -0
- package/dist/components/ui/menubar.js.map +1 -0
- package/dist/components/ui/navigation-menu.d.ts +12 -0
- package/dist/components/ui/navigation-menu.d.ts.map +1 -0
- package/dist/components/ui/navigation-menu.js +84 -0
- package/dist/components/ui/navigation-menu.js.map +1 -0
- package/dist/components/ui/pagination.d.ts +18 -0
- package/dist/components/ui/pagination.d.ts.map +1 -0
- package/dist/components/ui/pagination.js +87 -0
- package/dist/components/ui/pagination.js.map +1 -0
- package/dist/components/ui/popover.d.ts +10 -0
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/popover.js +56 -0
- package/dist/components/ui/popover.js.map +1 -0
- package/dist/components/ui/progress.d.ts +8 -0
- package/dist/components/ui/progress.d.ts.map +1 -0
- package/dist/components/ui/progress.js +46 -0
- package/dist/components/ui/progress.js.map +1 -0
- package/dist/components/ui/radio-group.d.ts +6 -0
- package/dist/components/ui/radio-group.d.ts.map +1 -0
- package/dist/components/ui/radio-group.js +29 -0
- package/dist/components/ui/radio-group.js.map +1 -0
- package/dist/components/ui/resizable.d.ts +8 -0
- package/dist/components/ui/resizable.d.ts.map +1 -0
- package/dist/components/ui/resizable.js +30 -0
- package/dist/components/ui/resizable.js.map +1 -0
- package/dist/components/ui/scroll-area.d.ts +5 -0
- package/dist/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/scroll-area.js +38 -0
- package/dist/components/ui/scroll-area.js.map +1 -0
- package/dist/components/ui/segmented.d.ts +46 -0
- package/dist/components/ui/segmented.d.ts.map +1 -0
- package/dist/components/ui/segmented.js +119 -0
- package/dist/components/ui/segmented.js.map +1 -0
- package/dist/components/ui/select.d.ts +16 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/select.js +99 -0
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.js +17 -0
- package/dist/components/ui/separator.js.map +1 -0
- package/dist/components/ui/sheet.d.ts +15 -0
- package/dist/components/ui/sheet.d.ts.map +1 -0
- package/dist/components/ui/sheet.js +90 -0
- package/dist/components/ui/sheet.js.map +1 -0
- package/dist/components/ui/sidebar.d.ts +64 -0
- package/dist/components/ui/sidebar.d.ts.map +1 -0
- package/dist/components/ui/sidebar.js +388 -0
- package/dist/components/ui/sidebar.js.map +1 -0
- package/dist/components/ui/skeleton.d.ts +3 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeleton.js +14 -0
- package/dist/components/ui/skeleton.js.map +1 -0
- package/dist/components/ui/slider.d.ts +4 -0
- package/dist/components/ui/slider.d.ts.map +1 -0
- package/dist/components/ui/slider.js +35 -0
- package/dist/components/ui/slider.js.map +1 -0
- package/dist/components/ui/sonner.d.ts +4 -0
- package/dist/components/ui/sonner.d.ts.map +1 -0
- package/dist/components/ui/sonner.js +33 -0
- package/dist/components/ui/sonner.js.map +1 -0
- package/dist/components/ui/spinner.d.ts +3 -0
- package/dist/components/ui/spinner.d.ts.map +1 -0
- package/dist/components/ui/spinner.js +17 -0
- package/dist/components/ui/spinner.js.map +1 -0
- package/dist/components/ui/switch.d.ts +6 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/switch.js +21 -0
- package/dist/components/ui/switch.js.map +1 -0
- package/dist/components/ui/table.d.ts +11 -0
- package/dist/components/ui/table.d.ts.map +1 -0
- package/dist/components/ui/table.js +68 -0
- package/dist/components/ui/table.js.map +1 -0
- package/dist/components/ui/tabs.d.ts +11 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/tabs.js +47 -0
- package/dist/components/ui/tabs.js.map +1 -0
- package/dist/components/ui/textarea.d.ts +4 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/textarea.js +14 -0
- package/dist/components/ui/textarea.js.map +1 -0
- package/dist/components/ui/toggle-group.d.ts +12 -0
- package/dist/components/ui/toggle-group.d.ts.map +1 -0
- package/dist/components/ui/toggle-group.js +54 -0
- package/dist/components/ui/toggle-group.js.map +1 -0
- package/dist/components/ui/toggle.d.ts +9 -0
- package/dist/components/ui/toggle.d.ts.map +1 -0
- package/dist/components/ui/toggle.js +38 -0
- package/dist/components/ui/toggle.js.map +1 -0
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip.js +43 -0
- package/dist/components/ui/tooltip.js.map +1 -0
- package/dist/components/use-dialog/use-dialog.d.ts +61 -0
- package/dist/components/use-dialog/use-dialog.d.ts.map +1 -0
- package/dist/components/use-dialog/use-dialog.js +139 -0
- package/dist/components/use-dialog/use-dialog.js.map +1 -0
- package/dist/components/use-toast/use-toast.d.ts +37 -0
- package/dist/components/use-toast/use-toast.d.ts.map +1 -0
- package/dist/components/use-toast/use-toast.js +32 -0
- package/dist/components/use-toast/use-toast.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +20 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/lib/i18n-fr.d.ts +46 -0
- package/dist/lib/i18n-fr.d.ts.map +1 -0
- package/dist/lib/i18n-fr.js +505 -0
- package/dist/lib/i18n-fr.js.map +1 -0
- package/dist/lib/resize-image.d.ts +50 -0
- package/dist/lib/resize-image.d.ts.map +1 -0
- package/dist/lib/resize-image.js +68 -0
- package/dist/lib/resize-image.js.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +10 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/styles.css +254 -0
- package/package.json +46 -15
- package/src/components/account/__tests__/account-router.spec.ts +201 -0
- package/src/components/account/account-connections.tsx +111 -0
- package/src/components/account/account-delete-dialog.tsx +184 -0
- package/src/components/account/account-header.tsx +57 -0
- package/src/components/account/account-keys.tsx +221 -0
- package/src/components/account/account-layout.tsx +66 -0
- package/src/components/account/account-password-dialog.tsx +152 -0
- package/src/components/account/account-profile.tsx +342 -0
- package/src/components/account/account-router-options.tsx +88 -0
- package/src/components/account/account-router-page.tsx +69 -0
- package/src/components/account/account-router.tsx +233 -0
- package/src/components/account/account-security.tsx +150 -0
- package/src/components/account/account-sessions.tsx +140 -0
- package/src/components/admin/__tests__/admin-keys-token-dialog.browser.spec.tsx +62 -0
- package/src/components/admin/__tests__/admin-layout.browser.spec.tsx +82 -0
- package/src/components/admin/__tests__/admin-router-page.spec.ts +54 -0
- package/src/components/admin/__tests__/admin-router.spec.ts +208 -0
- package/src/components/admin/__tests__/admin-user-cell.browser.spec.tsx +99 -0
- package/src/components/admin/__tests__/admin-user-detail.spec.ts +29 -0
- package/src/components/admin/admin-analytics-query-panel.tsx +149 -0
- package/src/components/admin/admin-analytics-results.tsx +95 -0
- package/src/components/admin/admin-analytics.tsx +104 -0
- package/src/components/admin/admin-audits.tsx +12 -15
- package/src/components/admin/admin-files.tsx +10 -18
- package/src/components/admin/admin-jobs-executions-panel.tsx +2 -1
- package/src/components/admin/admin-jobs.tsx +3 -1
- package/src/components/admin/admin-keys-token-dialog.tsx +123 -0
- package/src/components/admin/admin-keys.tsx +54 -3
- package/src/components/admin/admin-layout.tsx +107 -0
- package/src/components/admin/admin-payments.tsx +4 -5
- package/src/components/admin/admin-router-options.tsx +150 -0
- package/src/components/admin/admin-router-page.tsx +74 -0
- package/src/components/admin/admin-router.tsx +379 -0
- package/src/components/admin/admin-sessions.tsx +2 -16
- package/src/components/admin/admin-user-cell.tsx +70 -0
- package/src/components/admin/admin-user-detail-overview-tab.tsx +28 -0
- package/src/components/admin/admin-user-detail-profile-policy.spec.ts +146 -0
- package/src/components/admin/admin-user-detail-profile-policy.ts +147 -0
- package/src/components/admin/admin-user-detail-security-tab.tsx +1 -1
- package/src/components/admin/admin-user-detail.tsx +76 -32
- package/src/components/admin/admin-users-status-filter.tsx +2 -0
- package/src/components/admin/admin-workflows-execution-sheet.tsx +277 -0
- package/src/components/admin/admin-workflows-executions-panel.tsx +170 -0
- package/src/components/admin/admin-workflows-status-badge.tsx +40 -0
- package/src/components/admin/admin-workflows.tsx +207 -0
- package/src/components/alepha-table/alepha-table.tsx +91 -19
- package/src/components/app-actions/__tests__/app-actions.browser.spec.tsx +79 -0
- package/src/components/app-actions/app-actions.tsx +118 -0
- package/src/components/app-shell/app-shell.tsx +122 -0
- package/src/components/auth/auth-register.tsx +55 -17
- package/src/components/auth/auth-reset-password.tsx +81 -8
- package/src/components/auto-form/__tests__/auto-form-settings-card.browser.spec.tsx +237 -0
- package/src/components/auto-form/auto-form.tsx +113 -27
- package/src/components/button-user/button-user.tsx +121 -5
- package/src/components/control/control.tsx +47 -79
- package/src/components/control-base/form-field.tsx +60 -3
- package/src/components/control-password/control-password.tsx +87 -0
- package/src/components/control-select/__tests__/control-select-clear-label.browser.spec.tsx +101 -0
- package/src/components/control-select/__tests__/control-select-searchable.browser.spec.tsx +142 -0
- package/src/components/control-select/control-select.tsx +78 -111
- package/src/components/control-upload/control-upload.tsx +27 -1
- package/src/components/markdown-view/__tests__/markdown-view-raw-html.browser.spec.tsx +48 -0
- package/src/components/markdown-view/markdown-view.tsx +14 -0
- package/src/components/nav-shell/__tests__/nav-tree-util.spec.ts +88 -0
- package/src/components/nav-shell/nav-page.tsx +3 -3
- package/src/components/nav-shell/nav-tree-util.ts +48 -0
- package/src/components/nav-shell/use-nav-entries.ts +11 -2
- package/src/components/settings/__tests__/settings-nav.browser.spec.tsx +123 -0
- package/src/components/settings/__tests__/settings-section.browser.spec.tsx +130 -0
- package/src/components/settings/settings-danger-section.tsx +59 -0
- package/src/components/settings/settings-heading.tsx +55 -0
- package/src/components/settings/settings-layout.tsx +115 -0
- package/src/components/settings/settings-nav.tsx +175 -0
- package/src/components/settings/settings-row.tsx +81 -0
- package/src/components/settings/settings-section.tsx +52 -0
- package/src/components/ui/dropdown-menu.tsx +9 -1
- package/src/components/ui/segmented.tsx +19 -2
- package/src/lib/i18n-fr.ts +68 -0
- package/src/lib/resize-image.ts +135 -0
- package/src/styles.css +126 -1
- /package/src/components/{admin/admin-user-detail-provider-labels.ts → auth/provider-labels.ts} +0 -0
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type ControlProps } from "@alepha/ui/components/control/control";
|
|
3
|
+
import { type ZObject } from "alepha";
|
|
4
|
+
import { type FormModel } from "alepha/react/form";
|
|
5
|
+
import { type ReactNode } from "react";
|
|
6
|
+
export interface AutoFormGroup {
|
|
7
|
+
/**
|
|
8
|
+
* Group title shown in the header.
|
|
9
|
+
*/
|
|
10
|
+
title?: string;
|
|
11
|
+
/**
|
|
12
|
+
* One line under the title, for context the fields should not each repeat.
|
|
13
|
+
*
|
|
14
|
+
* Only rendered in `layout="row"`, where the heading sits above the card
|
|
15
|
+
* and there is room for it — the boxed group bar the grid layout uses is a
|
|
16
|
+
* single line by construction.
|
|
17
|
+
*/
|
|
18
|
+
description?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Icon name (lucide) for the group header.
|
|
21
|
+
*/
|
|
22
|
+
icon?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Visibility predicate. Group is omitted when this returns false.
|
|
25
|
+
*/
|
|
26
|
+
can?: () => boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Field names from the form schema. Each renders as a `<Control>`.
|
|
29
|
+
* Use the object form `{ name, ...controlProps }` for per-field overrides
|
|
30
|
+
* (width, icon, custom, etc.).
|
|
31
|
+
*/
|
|
32
|
+
fields: Array<string | (Partial<Omit<ControlProps, "input">> & {
|
|
33
|
+
name: string;
|
|
34
|
+
})>;
|
|
35
|
+
}
|
|
36
|
+
export interface AutoFormAction {
|
|
37
|
+
label: string;
|
|
38
|
+
icon?: string;
|
|
39
|
+
variant?: "default" | "outline" | "ghost" | "destructive" | "secondary";
|
|
40
|
+
onClick: () => void | Promise<void>;
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
}
|
|
43
|
+
export interface AutoFormProps<T extends ZObject> {
|
|
44
|
+
/**
|
|
45
|
+
* Form model returned by `useForm()`. The schema drives every field.
|
|
46
|
+
*/
|
|
47
|
+
form: FormModel<T>;
|
|
48
|
+
/**
|
|
49
|
+
* Header icon (lucide name).
|
|
50
|
+
*/
|
|
51
|
+
icon?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Header title.
|
|
54
|
+
*/
|
|
55
|
+
title?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Header description / subtitle.
|
|
58
|
+
*/
|
|
59
|
+
description?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Extra content rendered on the right of the header (e.g. a status badge).
|
|
62
|
+
* In `card` mode it renders as the `CardAction`; otherwise it is pushed to
|
|
63
|
+
* the right edge of the header box.
|
|
64
|
+
*/
|
|
65
|
+
headerAction?: ReactNode;
|
|
66
|
+
/**
|
|
67
|
+
* Manual layout: list of groups, each with its own fields.
|
|
68
|
+
* If neither `groups` nor `autoGroup` is set, every top-level schema
|
|
69
|
+
* field is rendered in a single ungrouped column.
|
|
70
|
+
*/
|
|
71
|
+
groups?: AutoFormGroup[];
|
|
72
|
+
/**
|
|
73
|
+
* Auto-group: scan the schema, primitive fields land in a "General"
|
|
74
|
+
* group, each object/array-of-objects becomes its own group.
|
|
75
|
+
*/
|
|
76
|
+
autoGroup?: boolean | {
|
|
77
|
+
defaultTitle?: string;
|
|
78
|
+
defaultIcon?: string;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Per-field control overrides keyed by field name (also works without groups).
|
|
82
|
+
*/
|
|
83
|
+
fields?: Partial<Record<keyof T["shape"] & string, Partial<Omit<ControlProps, "input">>>>;
|
|
84
|
+
/**
|
|
85
|
+
* Localize field labels the schema doesn't carry. When set, each field's
|
|
86
|
+
* label is resolved from the app dictionary via
|
|
87
|
+
* `tr(\`${i18nPrefix}.${fieldName}\`)` and its description via
|
|
88
|
+
* `tr(\`${i18nPrefix}.${fieldName}.desc\`)`, falling back to the
|
|
89
|
+
* schema-derived label/description when the key is absent. Lets a generic
|
|
90
|
+
* AutoForm (e.g. the parameters admin, whose schemas rarely set `title`)
|
|
91
|
+
* render translated labels without per-schema annotations. Explicit
|
|
92
|
+
* `fields[name].label` overrides still win.
|
|
93
|
+
*/
|
|
94
|
+
i18nPrefix?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Submit button label.
|
|
97
|
+
*/
|
|
98
|
+
submitLabel?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Hide built-in submit button.
|
|
101
|
+
*/
|
|
102
|
+
noSubmit?: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Disable submit when form is pristine (not dirty).
|
|
105
|
+
*/
|
|
106
|
+
disabledIfPristine?: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Disable the entire form (cascades to controls).
|
|
109
|
+
*/
|
|
110
|
+
disabled?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* Show the red `*` next to the label of every required field.
|
|
113
|
+
*
|
|
114
|
+
* Set `false` on a form where the marker is not news — one whose fields are
|
|
115
|
+
* nearly all required, or where the one required field is self-evidently so
|
|
116
|
+
* (a project's Name). A page of asterisks tells the reader nothing about
|
|
117
|
+
* which field to be careful with, which is the only thing the marker is for.
|
|
118
|
+
*
|
|
119
|
+
* Purely visual. `aria-required` still comes from the schema, so a screen
|
|
120
|
+
* reader announces the field as required either way — the marker itself is
|
|
121
|
+
* `aria-hidden` and never carried that.
|
|
122
|
+
*
|
|
123
|
+
* @default true
|
|
124
|
+
*/
|
|
125
|
+
requiredMarker?: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Cancel button — hidden when omitted.
|
|
128
|
+
*/
|
|
129
|
+
onCancel?: () => void;
|
|
130
|
+
/**
|
|
131
|
+
* Skip the reset button in the bottom bar.
|
|
132
|
+
*/
|
|
133
|
+
skipReset?: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* Skip the entire bottom bar.
|
|
136
|
+
*/
|
|
137
|
+
skipBottomBar?: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Extra action buttons in the bottom bar (left side).
|
|
140
|
+
*/
|
|
141
|
+
actions?: AutoFormAction[];
|
|
142
|
+
/**
|
|
143
|
+
* Extra content rendered above the bottom bar.
|
|
144
|
+
*/
|
|
145
|
+
footer?: ReactNode;
|
|
146
|
+
/**
|
|
147
|
+
* Extra classes applied to the form wrapper.
|
|
148
|
+
*/
|
|
149
|
+
className?: string;
|
|
150
|
+
/**
|
|
151
|
+
* Override the column classes of each field group's grid. By default fields
|
|
152
|
+
* lay out on a fixed 12-column grid and each field's span is derived from
|
|
153
|
+
* width heuristics (`$control.width`, type, …).
|
|
154
|
+
*
|
|
155
|
+
* Pass responsive column classes — e.g.
|
|
156
|
+
* `"grid-cols-1 md:grid-cols-2 xl:grid-cols-3"` — to get N equal columns per
|
|
157
|
+
* breakpoint instead; when set, every field occupies a single cell and the
|
|
158
|
+
* per-field width heuristics are ignored.
|
|
159
|
+
*/
|
|
160
|
+
gridClassName?: string;
|
|
161
|
+
/**
|
|
162
|
+
* Wrap the form in a `<Card>`:
|
|
163
|
+
* - the header (icon + title/description) renders as the `CardHeader`,
|
|
164
|
+
* - the field groups render as the `CardContent`,
|
|
165
|
+
* - the action bar (cancel / reset / actions / submit) renders as the
|
|
166
|
+
* `CardFooter`.
|
|
167
|
+
*
|
|
168
|
+
* When omitted, the form uses its default chrome (a muted header box and a
|
|
169
|
+
* standalone bottom bar). The footer is hidden in `autoSave` mode just like
|
|
170
|
+
* the default bottom bar.
|
|
171
|
+
*
|
|
172
|
+
* Pass a string to override the `<Card>` className (e.g. `"rounded-none"` to
|
|
173
|
+
* make the card sit flush against neighbouring panes).
|
|
174
|
+
*/
|
|
175
|
+
card?: boolean | string;
|
|
176
|
+
/**
|
|
177
|
+
* Fill the available height: the card stretches to `100%` of its container
|
|
178
|
+
* and the body (field groups) scrolls while the header and footer stay
|
|
179
|
+
* pinned. Only meaningful in `card` mode.
|
|
180
|
+
*/
|
|
181
|
+
fill?: boolean;
|
|
182
|
+
/**
|
|
183
|
+
* Visual layout for every nested Control.
|
|
184
|
+
* - `"stack"` (default): label on top, control below — the classic form look.
|
|
185
|
+
* - `"row"`: settings-style — each control sits on its own line with the
|
|
186
|
+
* label/description on the left and the control on the right. Each
|
|
187
|
+
* group renders as a bordered card with horizontal dividers.
|
|
188
|
+
*
|
|
189
|
+
* `"row"` **is** the settings-card shape, not an approximation of it: the
|
|
190
|
+
* rows render the same markup as {@link SettingsRow}, the card the same as
|
|
191
|
+
* {@link SettingsSection}, the heading through the same
|
|
192
|
+
* {@link SettingsHeading}, and the action bar as the card's own last
|
|
193
|
+
* divided row. So a settings card whose rows are form fields should be an
|
|
194
|
+
* `AutoForm`, and reach for `SettingsSection` only for the rows that are
|
|
195
|
+
* *not* fields — an avatar picker, a read-only value, a lone button.
|
|
196
|
+
*/
|
|
197
|
+
layout?: "stack" | "row";
|
|
198
|
+
/**
|
|
199
|
+
* Auto-commit edits instead of showing a Save button.
|
|
200
|
+
*
|
|
201
|
+
* When enabled, every field change schedules a debounced `form.submit()`
|
|
202
|
+
* and the bottom bar is hidden by default. Pass an options object to
|
|
203
|
+
* customize the debounce delay (default 600ms).
|
|
204
|
+
*
|
|
205
|
+
* The `handler` you pass to `useForm` is the auto-commit target — it
|
|
206
|
+
* runs once per quiescent edit, and any thrown error stops the loop
|
|
207
|
+
* until the user edits again.
|
|
208
|
+
*/
|
|
209
|
+
autoSave?: boolean | {
|
|
210
|
+
delay?: number;
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Schema-driven form with optional grouping, header chrome, and bottom
|
|
215
|
+
* bar. Every input field is resolved through `<Control>`, so schemas
|
|
216
|
+
* carrying `$control` metadata configure themselves.
|
|
217
|
+
*/
|
|
218
|
+
export declare function AutoForm<T extends ZObject>(props: AutoFormProps<T>): React.JSX.Element;
|
|
219
|
+
//# sourceMappingURL=auto-form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-form.d.ts","sourceRoot":"","sources":["../../../src/components/auto-form/auto-form.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAEL,KAAK,YAAY,EAClB,MAAM,uCAAuC,CAAC;AAuB/C,OAAO,EAAE,KAAK,OAAO,EAAK,MAAM,QAAQ,CAAC;AAEzC,OAAO,EAEL,KAAK,SAAS,EAGf,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,KAAK,SAAS,EAAgC,MAAM,OAAO,CAAC;AAiDrE,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,OAAO,CAAC;IACpB;;;;OAIG;IACH,MAAM,EAAE,KAAK,CACX,MAAM,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CACnE,CAAC;CACH;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,aAAa,GAAG,WAAW,CAAC;IACxE,OAAO,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,OAAO;IAC9C;;OAEG;IACH,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IAEnB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IAEzB;;;;OAIG;IACH,MAAM,CAAC,EAAE,aAAa,EAAE,CAAC;IAEzB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG;QAAE,YAAY,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAEtE;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CACd,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,GAAG,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,CACxE,CAAC;IAEF;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;;;;;;;;;OAaG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,EAAE,CAAC;IAE3B;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;;;;OASG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;;;;;;;;;;OAaG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAExB;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IAEzB;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACzC;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,OAAO,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,qBAqPlE"}
|
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import { Button } from "../ui/button.js";
|
|
3
|
+
import { FormFieldAutoSaveProvider, FormFieldLayoutProvider, FormFieldRequiredMarkerProvider } from "../control-base/form-field.js";
|
|
4
|
+
import { iconFor } from "../control-base/icon-hint.js";
|
|
5
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover.js";
|
|
6
|
+
import { spanClass, widthFor } from "../control-base/grid.js";
|
|
7
|
+
import { Control } from "../control/control.js";
|
|
8
|
+
import { SettingsHeading } from "../settings/settings-heading.js";
|
|
9
|
+
import { Card, CardContent, CardDescription, CardFooter, CardTitle } from "../ui/card.js";
|
|
10
|
+
import { useEffect, useMemo, useState } from "react";
|
|
11
|
+
import { useAlepha } from "alepha/react";
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { AlertCircle, X } from "lucide-react";
|
|
14
|
+
import { z } from "alepha";
|
|
15
|
+
import { isObjectOrUnionOfObjects, useFormState } from "alepha/react/form";
|
|
16
|
+
import { useI18n } from "alepha/react/i18n";
|
|
17
|
+
//#region src/components/auto-form/auto-form.tsx
|
|
18
|
+
/**
|
|
19
|
+
* Detect a `z.string()` schema (incl. optional/nullable wrappers) so the
|
|
20
|
+
* auto-save effect can skip keystroke commits on text fields.
|
|
21
|
+
*/
|
|
22
|
+
function isStringSchema(schema) {
|
|
23
|
+
if (!schema || typeof schema !== "object") return false;
|
|
24
|
+
const s = schema;
|
|
25
|
+
if (s.type === "string") return true;
|
|
26
|
+
if (Array.isArray(s.anyOf)) return s.anyOf.some(isStringSchema);
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Detect an enum schema (incl. optional/nullable wrappers). Enum fields
|
|
31
|
+
* render as a `<Select>`, so they must auto-commit on change like any
|
|
32
|
+
* other select — never get lumped in with free-text string fields.
|
|
33
|
+
*/
|
|
34
|
+
function isEnumSchema(schema) {
|
|
35
|
+
if (!schema || typeof schema !== "object") return false;
|
|
36
|
+
const s = schema;
|
|
37
|
+
if (Array.isArray(s.enum)) return true;
|
|
38
|
+
if (Array.isArray(s.anyOf)) return s.anyOf.some(isEnumSchema);
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Resolve the effective `<Control>` config for a field, merging the
|
|
43
|
+
* `fields` map with any per-field override carried on a `groups` entry —
|
|
44
|
+
* the same precedence `GroupBlock` applies when rendering.
|
|
45
|
+
*/
|
|
46
|
+
function resolveControlConfig(name, fields, groups) {
|
|
47
|
+
const fromMap = fields?.[name] ?? {};
|
|
48
|
+
let fromGroup = {};
|
|
49
|
+
for (const group of groups ?? []) for (const field of group.fields) if (typeof field === "object" && field.name === name) fromGroup = field;
|
|
50
|
+
return {
|
|
51
|
+
...fromMap,
|
|
52
|
+
...fromGroup
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Schema-driven form with optional grouping, header chrome, and bottom
|
|
57
|
+
* bar. Every input field is resolved through `<Control>`, so schemas
|
|
58
|
+
* carrying `$control` metadata configure themselves.
|
|
59
|
+
*/
|
|
60
|
+
function AutoForm(props) {
|
|
61
|
+
const { tr } = useI18n();
|
|
62
|
+
const { dirty, loading } = useFormState(props.form, ["dirty", "loading"]);
|
|
63
|
+
const inputs = props.form.input;
|
|
64
|
+
const schema = props.form.options.schema ?? z.object({});
|
|
65
|
+
const autoSave = props.autoSave;
|
|
66
|
+
const autoSaveDelay = typeof autoSave === "object" ? autoSave?.delay ?? 600 : 600;
|
|
67
|
+
const autoSaveEnabled = !!autoSave;
|
|
68
|
+
const alepha = useAlepha();
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
if (!autoSaveEnabled) return;
|
|
71
|
+
let handle;
|
|
72
|
+
const off = alepha.events.on("form:change", (ev) => {
|
|
73
|
+
if (ev.id !== props.form.id) return;
|
|
74
|
+
if (ev.initial) return;
|
|
75
|
+
const top = ev.path.replace(/^\//, "").split("/")[0];
|
|
76
|
+
const fieldSchema = z.schema.shape(schema)[top];
|
|
77
|
+
const fieldConfig = resolveControlConfig(top, props.fields, props.groups);
|
|
78
|
+
const rendersAsSelect = !!fieldConfig.select || !!fieldConfig.combobox || !!fieldConfig.segmented || fieldConfig.items != null || isEnumSchema(fieldSchema);
|
|
79
|
+
if (!fieldConfig.upload && !rendersAsSelect && isStringSchema(fieldSchema)) return;
|
|
80
|
+
if (handle) clearTimeout(handle);
|
|
81
|
+
handle = setTimeout(() => props.form.submit(), autoSaveDelay);
|
|
82
|
+
});
|
|
83
|
+
return () => {
|
|
84
|
+
off();
|
|
85
|
+
if (handle) clearTimeout(handle);
|
|
86
|
+
};
|
|
87
|
+
}, [
|
|
88
|
+
alepha,
|
|
89
|
+
autoSaveEnabled,
|
|
90
|
+
autoSaveDelay,
|
|
91
|
+
props.form,
|
|
92
|
+
props.fields,
|
|
93
|
+
props.groups,
|
|
94
|
+
schema
|
|
95
|
+
]);
|
|
96
|
+
const skipBottomBar = props.skipBottomBar ?? autoSaveEnabled;
|
|
97
|
+
const resolvedGroups = useMemo(() => {
|
|
98
|
+
if (props.groups) return props.groups.filter((g) => g.can?.() !== false);
|
|
99
|
+
if (props.autoGroup) {
|
|
100
|
+
const opts = typeof props.autoGroup === "object" ? props.autoGroup : {};
|
|
101
|
+
return autoGroupSchema(schema, {
|
|
102
|
+
tr,
|
|
103
|
+
...opts
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
return [{ fields: Object.keys(z.schema.shape(schema)) }];
|
|
107
|
+
}, [
|
|
108
|
+
props.groups,
|
|
109
|
+
props.autoGroup,
|
|
110
|
+
schema
|
|
111
|
+
]);
|
|
112
|
+
const HeaderIcon = props.icon ? iconFor(props.icon) : void 0;
|
|
113
|
+
const hasHeader = !!(props.title || props.description || HeaderIcon || props.headerAction);
|
|
114
|
+
const layout = props.layout ?? "stack";
|
|
115
|
+
const bottomBarProps = {
|
|
116
|
+
form: props.form,
|
|
117
|
+
dirty,
|
|
118
|
+
loading,
|
|
119
|
+
disabled: props.disabled,
|
|
120
|
+
disabledIfPristine: props.disabledIfPristine,
|
|
121
|
+
submitLabel: props.submitLabel,
|
|
122
|
+
noSubmit: props.noSubmit,
|
|
123
|
+
onCancel: props.onCancel,
|
|
124
|
+
skipReset: props.skipReset,
|
|
125
|
+
actions: props.actions
|
|
126
|
+
};
|
|
127
|
+
const inCardBottomBar = layout === "row" && !props.card && !skipBottomBar && resolvedGroups.length ? /* @__PURE__ */ jsx(BottomBar, {
|
|
128
|
+
...bottomBarProps,
|
|
129
|
+
bare: true
|
|
130
|
+
}) : void 0;
|
|
131
|
+
const fieldGroups = /* @__PURE__ */ jsx(FormFieldLayoutProvider, {
|
|
132
|
+
value: layout,
|
|
133
|
+
children: /* @__PURE__ */ jsx(FormFieldRequiredMarkerProvider, {
|
|
134
|
+
value: props.requiredMarker ?? true,
|
|
135
|
+
children: /* @__PURE__ */ jsx(FormFieldAutoSaveProvider, {
|
|
136
|
+
value: autoSaveEnabled,
|
|
137
|
+
children: resolvedGroups.map((group, gi) => /* @__PURE__ */ jsx(GroupBlock, {
|
|
138
|
+
group,
|
|
139
|
+
inputs,
|
|
140
|
+
disabled: props.disabled,
|
|
141
|
+
fields: props.fields,
|
|
142
|
+
i18nPrefix: props.i18nPrefix,
|
|
143
|
+
multiGroup: resolvedGroups.length > 1,
|
|
144
|
+
layout,
|
|
145
|
+
gridClassName: props.gridClassName,
|
|
146
|
+
bottomBar: gi === resolvedGroups.length - 1 ? inCardBottomBar : void 0
|
|
147
|
+
}, gi))
|
|
148
|
+
})
|
|
149
|
+
})
|
|
150
|
+
});
|
|
151
|
+
if (props.card) {
|
|
152
|
+
const cardClassName = typeof props.card === "string" ? props.card : void 0;
|
|
153
|
+
return /* @__PURE__ */ jsx("form", {
|
|
154
|
+
...props.form.props,
|
|
155
|
+
className: cn(props.fill && "flex h-full min-h-0 flex-col", props.className),
|
|
156
|
+
children: /* @__PURE__ */ jsxs(Card, {
|
|
157
|
+
className: cn(props.fill && "min-h-0 flex-1", hasHeader && "pt-3", cardClassName),
|
|
158
|
+
children: [
|
|
159
|
+
hasHeader && /* @__PURE__ */ jsxs("div", {
|
|
160
|
+
"data-slot": "card-header",
|
|
161
|
+
className: "flex items-start justify-between gap-3 border-b px-4 pb-3",
|
|
162
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
163
|
+
className: "flex items-center gap-3",
|
|
164
|
+
children: [HeaderIcon && /* @__PURE__ */ jsx("div", {
|
|
165
|
+
className: "bg-primary/10 text-primary flex size-10 shrink-0 items-center justify-center rounded-full",
|
|
166
|
+
children: /* @__PURE__ */ jsx(HeaderIcon, { className: "size-5" })
|
|
167
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
168
|
+
className: "flex flex-col gap-0",
|
|
169
|
+
children: [props.title && /* @__PURE__ */ jsx(CardTitle, { children: props.title }), props.description && /* @__PURE__ */ jsx(CardDescription, { children: props.description })]
|
|
170
|
+
})]
|
|
171
|
+
}), props.headerAction && /* @__PURE__ */ jsx("div", {
|
|
172
|
+
className: "shrink-0",
|
|
173
|
+
children: props.headerAction
|
|
174
|
+
})]
|
|
175
|
+
}),
|
|
176
|
+
/* @__PURE__ */ jsxs(CardContent, {
|
|
177
|
+
className: cn("flex flex-col gap-4", props.fill && "min-h-0 flex-1 overflow-y-auto"),
|
|
178
|
+
children: [fieldGroups, props.footer]
|
|
179
|
+
}),
|
|
180
|
+
!skipBottomBar && /* @__PURE__ */ jsx(CardFooter, { children: /* @__PURE__ */ jsx(BottomBar, {
|
|
181
|
+
...bottomBarProps,
|
|
182
|
+
bare: true
|
|
183
|
+
}) })
|
|
184
|
+
]
|
|
185
|
+
})
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
return /* @__PURE__ */ jsx("form", {
|
|
189
|
+
...props.form.props,
|
|
190
|
+
className: props.className,
|
|
191
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
192
|
+
className: "flex flex-col gap-4",
|
|
193
|
+
children: [
|
|
194
|
+
hasHeader && /* @__PURE__ */ jsxs("div", {
|
|
195
|
+
className: "bg-muted/40 border rounded-md p-4 flex items-start gap-3",
|
|
196
|
+
children: [
|
|
197
|
+
HeaderIcon && /* @__PURE__ */ jsx("div", {
|
|
198
|
+
className: "bg-primary/10 text-primary flex size-10 shrink-0 items-center justify-center rounded-full",
|
|
199
|
+
children: /* @__PURE__ */ jsx(HeaderIcon, { className: "size-5" })
|
|
200
|
+
}),
|
|
201
|
+
/* @__PURE__ */ jsxs("div", {
|
|
202
|
+
className: "flex flex-col gap-1",
|
|
203
|
+
children: [props.title && /* @__PURE__ */ jsx("h2", {
|
|
204
|
+
className: "text-base font-semibold",
|
|
205
|
+
children: props.title
|
|
206
|
+
}), props.description && /* @__PURE__ */ jsx("p", {
|
|
207
|
+
className: "text-muted-foreground text-sm",
|
|
208
|
+
children: props.description
|
|
209
|
+
})]
|
|
210
|
+
}),
|
|
211
|
+
props.headerAction && /* @__PURE__ */ jsx("div", {
|
|
212
|
+
className: "ml-auto",
|
|
213
|
+
children: props.headerAction
|
|
214
|
+
})
|
|
215
|
+
]
|
|
216
|
+
}),
|
|
217
|
+
fieldGroups,
|
|
218
|
+
props.footer,
|
|
219
|
+
!skipBottomBar && !inCardBottomBar && /* @__PURE__ */ jsx(BottomBar, { ...bottomBarProps })
|
|
220
|
+
]
|
|
221
|
+
})
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
function GroupBlock(props) {
|
|
225
|
+
const { group } = props;
|
|
226
|
+
const { tr } = useI18n();
|
|
227
|
+
const Icon = group.icon ? iconFor(group.icon) : void 0;
|
|
228
|
+
const items = group.fields.map((entry) => {
|
|
229
|
+
const name = typeof entry === "string" ? entry : entry.name;
|
|
230
|
+
const override = typeof entry === "object" ? entry : {};
|
|
231
|
+
const input = props.inputs[name];
|
|
232
|
+
if (!input) return null;
|
|
233
|
+
const merged = {
|
|
234
|
+
...props.fields?.[name] ?? {},
|
|
235
|
+
...override
|
|
236
|
+
};
|
|
237
|
+
if (props.i18nPrefix && merged.label === void 0) {
|
|
238
|
+
const key = `${props.i18nPrefix}.${name}`;
|
|
239
|
+
const label = tr(key, { default: "" });
|
|
240
|
+
if (label && label !== key) merged.label = label;
|
|
241
|
+
}
|
|
242
|
+
if (props.i18nPrefix && merged.description === void 0) {
|
|
243
|
+
const key = `${props.i18nPrefix}.${name}.desc`;
|
|
244
|
+
const desc = tr(key, { default: "" });
|
|
245
|
+
if (desc && desc !== key) merged.description = desc;
|
|
246
|
+
}
|
|
247
|
+
if (props.i18nPrefix && merged.i18nPrefix === void 0) merged.i18nPrefix = `${props.i18nPrefix}.${name}`;
|
|
248
|
+
return {
|
|
249
|
+
name,
|
|
250
|
+
input,
|
|
251
|
+
props: merged
|
|
252
|
+
};
|
|
253
|
+
}).filter(Boolean);
|
|
254
|
+
if (!items.length && !props.multiGroup && !props.bottomBar) return null;
|
|
255
|
+
const isNaked = !group.title && !Icon;
|
|
256
|
+
if (props.layout === "row") return /* @__PURE__ */ jsxs("div", { children: [!!(group.title || group.description) && /* @__PURE__ */ jsxs("div", {
|
|
257
|
+
className: "mb-2 flex items-start gap-2",
|
|
258
|
+
children: [Icon && /* @__PURE__ */ jsx(Icon, { className: "text-muted-foreground mt-0.5 size-4 shrink-0" }), /* @__PURE__ */ jsx(SettingsHeading, {
|
|
259
|
+
title: group.title,
|
|
260
|
+
description: group.description
|
|
261
|
+
})]
|
|
262
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
263
|
+
className: "bg-card divide-y rounded-lg border shadow-sm",
|
|
264
|
+
children: [items.map((it) => /* @__PURE__ */ jsx(Control, {
|
|
265
|
+
input: it.input,
|
|
266
|
+
...it.props,
|
|
267
|
+
disabled: props.disabled || it.props.disabled
|
|
268
|
+
}, it.name)), props.bottomBar && /* @__PURE__ */ jsx("div", {
|
|
269
|
+
className: "px-4 py-3",
|
|
270
|
+
children: props.bottomBar
|
|
271
|
+
})]
|
|
272
|
+
})] });
|
|
273
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
274
|
+
className: props.multiGroup && !isNaked ? "border rounded-md overflow-hidden" : "",
|
|
275
|
+
children: [props.multiGroup && !isNaked && /* @__PURE__ */ jsxs("div", {
|
|
276
|
+
className: "bg-muted/40 flex items-center gap-2 border-b px-3 py-2",
|
|
277
|
+
children: [Icon && /* @__PURE__ */ jsx(Icon, { className: "text-muted-foreground size-4" }), group.title && /* @__PURE__ */ jsx("span", {
|
|
278
|
+
className: "text-sm font-medium",
|
|
279
|
+
children: group.title
|
|
280
|
+
})]
|
|
281
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
282
|
+
className: cn("grid gap-3", props.gridClassName ?? "grid-cols-12", !isNaked && "p-3"),
|
|
283
|
+
children: items.map((it) => /* @__PURE__ */ jsx("div", {
|
|
284
|
+
className: props.gridClassName ? widthFor(it.input, it.props.width) >= 100 ? "col-span-full" : void 0 : spanClass(widthFor(it.input, it.props.width)),
|
|
285
|
+
children: /* @__PURE__ */ jsx(Control, {
|
|
286
|
+
input: it.input,
|
|
287
|
+
...it.props,
|
|
288
|
+
disabled: props.disabled || it.props.disabled
|
|
289
|
+
})
|
|
290
|
+
}, it.name))
|
|
291
|
+
})]
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
function BottomBar(props) {
|
|
295
|
+
const { tr } = useI18n();
|
|
296
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
297
|
+
className: props.bare ? "flex w-full items-center gap-2" : "bg-card flex items-center gap-2 border rounded-md p-2",
|
|
298
|
+
children: [
|
|
299
|
+
props.onCancel && /* @__PURE__ */ jsxs(Button, {
|
|
300
|
+
type: "button",
|
|
301
|
+
variant: "ghost",
|
|
302
|
+
onClick: props.onCancel,
|
|
303
|
+
disabled: props.disabled,
|
|
304
|
+
children: [/* @__PURE__ */ jsx(X, { className: "size-4 mr-1" }), tr("autoForm.cancel", { default: "Cancel" })]
|
|
305
|
+
}),
|
|
306
|
+
!props.skipReset && /* @__PURE__ */ jsx(Button, {
|
|
307
|
+
type: "button",
|
|
308
|
+
variant: "ghost",
|
|
309
|
+
onClick: () => props.form.reset(),
|
|
310
|
+
disabled: props.disabled || !props.dirty,
|
|
311
|
+
children: tr("autoForm.reset", { default: "Reset" })
|
|
312
|
+
}),
|
|
313
|
+
props.actions?.map((action, i) => {
|
|
314
|
+
const Icon = action.icon ? iconFor(action.icon) : void 0;
|
|
315
|
+
return /* @__PURE__ */ jsxs(Button, {
|
|
316
|
+
type: "button",
|
|
317
|
+
variant: action.variant ?? "ghost",
|
|
318
|
+
onClick: () => action.onClick(),
|
|
319
|
+
disabled: props.disabled || action.disabled,
|
|
320
|
+
children: [Icon && /* @__PURE__ */ jsx(Icon, { className: "size-4 mr-1" }), action.label]
|
|
321
|
+
}, i);
|
|
322
|
+
}),
|
|
323
|
+
/* @__PURE__ */ jsxs("div", {
|
|
324
|
+
className: "ml-auto flex items-center gap-2",
|
|
325
|
+
children: [/* @__PURE__ */ jsx(FormErrorPopover, { form: props.form }), !props.noSubmit && /* @__PURE__ */ jsx(Button, {
|
|
326
|
+
type: "submit",
|
|
327
|
+
loading: props.loading,
|
|
328
|
+
disabled: props.disabled || props.disabledIfPristine && !props.dirty,
|
|
329
|
+
children: props.submitLabel ?? tr("autoForm.save", { default: "Save" })
|
|
330
|
+
})]
|
|
331
|
+
})
|
|
332
|
+
]
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
function FormErrorPopover(props) {
|
|
336
|
+
const { error } = useFormState(props.form, ["error"]);
|
|
337
|
+
const { tr } = useI18n();
|
|
338
|
+
const [open, setOpen] = useState(false);
|
|
339
|
+
useEffect(() => {
|
|
340
|
+
if (!error && open) setOpen(false);
|
|
341
|
+
}, [error, open]);
|
|
342
|
+
if (!error) return null;
|
|
343
|
+
const items = collectErrors(error);
|
|
344
|
+
return /* @__PURE__ */ jsxs(Popover, {
|
|
345
|
+
open,
|
|
346
|
+
onOpenChange: setOpen,
|
|
347
|
+
children: [/* @__PURE__ */ jsx(PopoverTrigger, {
|
|
348
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
349
|
+
type: "button",
|
|
350
|
+
variant: "ghost",
|
|
351
|
+
size: "icon",
|
|
352
|
+
"aria-label": tr("autoForm.errors", { default: "Form errors" }),
|
|
353
|
+
className: "text-destructive"
|
|
354
|
+
}),
|
|
355
|
+
children: /* @__PURE__ */ jsx(AlertCircle, { className: "size-4" })
|
|
356
|
+
}), /* @__PURE__ */ jsxs(PopoverContent, {
|
|
357
|
+
align: "end",
|
|
358
|
+
className: "w-80 p-2",
|
|
359
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
360
|
+
className: "text-destructive text-sm font-medium px-2 py-1",
|
|
361
|
+
children: items.length === 1 ? tr("autoForm.error", { default: "Error" }) : tr("autoForm.errors", { default: "Errors" })
|
|
362
|
+
}), /* @__PURE__ */ jsx("ul", {
|
|
363
|
+
className: "flex flex-col gap-1",
|
|
364
|
+
children: items.map((it, i) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs("button", {
|
|
365
|
+
type: "button",
|
|
366
|
+
onClick: () => focusError(it.path, props.form.id),
|
|
367
|
+
className: "hover:bg-accent w-full rounded text-left text-xs px-2 py-1",
|
|
368
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
369
|
+
className: "font-medium",
|
|
370
|
+
children: it.path || tr("autoForm.formLabel", { default: "Form" })
|
|
371
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
372
|
+
className: "text-muted-foreground",
|
|
373
|
+
children: [" — ", it.message]
|
|
374
|
+
})]
|
|
375
|
+
}) }, i))
|
|
376
|
+
})]
|
|
377
|
+
})]
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
const collectErrors = (error) => {
|
|
381
|
+
const anyErr = error;
|
|
382
|
+
return [{
|
|
383
|
+
path: anyErr.value?.path ?? "",
|
|
384
|
+
message: anyErr.value?.message ?? error.message ?? "Invalid"
|
|
385
|
+
}];
|
|
386
|
+
};
|
|
387
|
+
const focusError = (path, formId) => {
|
|
388
|
+
const fieldName = path.replace(/^\//, "").replace(/\//g, ".");
|
|
389
|
+
if (!fieldName) return;
|
|
390
|
+
(document.getElementById(`${formId}-${fieldName}`) ?? document.querySelector(`[name="${fieldName}"]`))?.focus();
|
|
391
|
+
};
|
|
392
|
+
const autoGroupSchema = (schema, opts) => {
|
|
393
|
+
const general = {
|
|
394
|
+
title: opts.defaultTitle ?? opts.tr?.("autoForm.general", { default: "General" }) ?? "General",
|
|
395
|
+
icon: opts.defaultIcon ?? "cog",
|
|
396
|
+
fields: []
|
|
397
|
+
};
|
|
398
|
+
const groups = [];
|
|
399
|
+
for (const [key, prop] of Object.entries(z.schema.shape(schema))) {
|
|
400
|
+
const p = prop;
|
|
401
|
+
const isObject = p.type === "object";
|
|
402
|
+
const isArrayOfObjects = p.type === "array" && isObjectOrUnionOfObjects(p.element);
|
|
403
|
+
if (isObject || isArrayOfObjects) groups.push({ fields: [key] });
|
|
404
|
+
else general.fields.push(key);
|
|
405
|
+
}
|
|
406
|
+
if (general.fields.length === 0) return groups;
|
|
407
|
+
return [general, ...groups];
|
|
408
|
+
};
|
|
409
|
+
//#endregion
|
|
410
|
+
export { AutoForm };
|
|
411
|
+
|
|
412
|
+
//# sourceMappingURL=auto-form.js.map
|