import type { UiSchema } from '@genesislcap/foundation-forms'; import { CrudMenuPosition } from '../types'; import { EntityManagement } from './entities'; /** * A focused form dialog component that renders a single trigger button which opens a modal * containing an auto-generated form. * * @remarks * `smart-form-modal` is a trimmed-down variant of {@link EntityManagement} intended for * single-action use cases — approval submissions, bespoke inserts — * where you want a button that opens a form modal without the accompanying data grid. * * The component inherits the full `entity-management` API but exposes a purpose-fit surface * of its own: * * | `smart-form-modal` attr | Underlying property | Notes | * |---|---|---| * | `event` | `createEvent` | The Genesis event handler that processes the form submission | * | `button-label` | `createLabel` | Button and modal title text; replaces the default "Add {entityLabel}" | * | `form-ui-schema` (`:formUiSchema`) | `createFormUiSchema` | UI schema passed as a property binding | * | `success-notification-title` | — | Overrides the toast title shown on successful submit | * | `success-notification-body` | — | Overrides the toast body shown on successful submit | * * The underlying `entity-management` attributes (`createEvent`, `createFormUiSchema`, * `create-label`, `confirmation-message`, `default-entity-values`, `design-system-prefix`, * `set-approval-message`, `approval-message-label`, `form-renderers`, * `additional-form-renderers`, `readonly`) all continue to work — the aliases listed above * are simply the preferred vocabulary for this component. * * Attributes that belong to the grid (`updateEvent`, `deleteEvent`, `columns`, `gridOptions`, * `datasource-config`, `resource-name`, `enable-search-bar`, `enable-filter-bar`, etc.) are * inherited but have no effect because the grid is always hidden. * * **Defaults that differ from `entity-management`:** * - `modalPosition` defaults to `'centre'` (entity-management defaults to `'right'`) * - `crudMenuPosition` defaults to `'top'` (entity-management defaults to `'column'`) * * @example * Minimal usage — form fields are auto-generated from the event schema: * ```html * * ``` * * @example * Custom action label with styled button via CSS part: * ```html * * ``` * ```css * smart-form-modal::part(create-button) { * background-color: #d32f2f; * color: #fff; * } * ``` * * @example * Controlled form layout via `formUiSchema` property binding: * ```html * * ``` * * @example * Confirmation dialog before submit: * ```html * * ``` * * @example * Read-only view mode: * ```html * * ``` * * @csspart create-button - The trigger button that opens the modal. Style via `::part(create-button)`. * * @fires submit-success - Fired when the form is submitted successfully. detail: `SubmitSuccessEventDetail` * @fires submit-failure - Fired when the form submission returns an error. detail: `SubmitFailureEventDetail` * * @public */ export declare class SmartFormModal extends EntityManagement { /** @internal */ gridVisible: boolean; /** @internal */ modalPosition: 'centre' | 'left' | 'right'; /** @internal */ crudMenuPosition: CrudMenuPosition; /** * The Genesis event handler that processes the form submission. * * @remarks * Alias for `createEvent`. Prefer `event` when using `smart-form-modal` — it reads more * naturally for single-action components where the CRUD framing of `createEvent` does not apply. * * @example * ```html * * ``` * @public */ event: string; eventChanged(_: string, next: string): void; /** * Label appended to the default button text, producing "Add {entity-label}". * * @remarks * Re-declares the inherited `entityLabel` attr explicitly so FAST observes it on this element. * Has no effect when `button-label` is also set — `button-label` takes full precedence. * * @example * ```html * * ``` * @public */ entityLabel: string; /** * UI schema that controls the layout and visibility of form fields. * * @remarks * Alias for `createFormUiSchema`. Must be set as a property binding (`:formUiSchema`) since it * accepts a `UiSchema` object, not a plain string attribute. * * When omitted, the form is auto-generated from the event's server-side schema. * * @example * ```html * * ``` * @public */ formUiSchema: UiSchema; formUiSchemaChanged(_: UiSchema, next: UiSchema): void; /** * Text displayed on the trigger button and as the modal title. * * @remarks * Alias for `create-label`. When set, the default "Add {entityLabel}" text is replaced * entirely and the `+` icon is hidden so the label stands alone. * * @example * ```html * * ``` * @public */ buttonLabel: string; buttonLabelChanged(_: string, next: string): void; } //# sourceMappingURL=smartFormModal.d.ts.map