foundation-forms.form
Home > @genesislcap/foundation-forms > Form
Form class
Foundation form component for automatically generated forms based on json schema obtained from the api, supplied initial data or supplied JSON schema. Allowing customisable form elements using UI schema and set of custom renderers
submit - Fired when the form is submitted (includes payload and validation errors) submit-failure - Fired when submit fails (server or client validation) submit-success - Fired when submit succeeds submit-partial-success - Fired when bulk submit partially succeeds row-status-changed - Fired when row submit status changes bulk-submit-complete - Fired when bulk submit completes row-submit-failure - Fired when a single row submit fails row-submit-success - Fired when a single row submit succeeds data-change - Fired when form data changes csv-parse-error - Fired when CSV import parsing fails csv-imported - Fired when CSV data is imported successfully csv-template-error - Fired when CSV template cannot be generated csv-template-downloaded - Fired when CSV template is downloaded
Signature:
export declare class Form extends Form_base
Extends: Form_base
Properties
|
Property |
Modifiers |
Type |
Description |
|---|---|---|---|
|
Allows to provide a set of additional renderers used by the form. | |||
|
string |
Label for the approval message field in the approval dialog. | ||
|
boolean |
When enabled, transforms the form into bulk insert mode where multiple records can be added. The JSON schema will be wrapped as an array, and each item will be submitted separately. | ||
|
number | undefined |
Maximum number of items allowed in bulk insert mode. If not set, no maximum is enforced. | ||
|
number |
Minimum number of items required in bulk insert mode. | ||
|
string |
Optional confirmation message to display before form submission. If set, a confirmation dialog will be shown when the user clicks submit. | ||
|
any |
Initial data for the form. | ||
|
boolean |
Controls the visibility of the submit button. | ||
|
JSONSchema7 |
Alternatively to providing Form.resourceName you can hardcode the JSON schema on the client. | ||
|
string |
Name of the design system prefix that will be used in renderers. | ||
|
boolean |
Allows you to enable read-only mode, which disables all input on the form and hides the submit button. | ||
|
Allows to provide the main set of renderers used by the form. If not provided, the built-in renderers will be used by default. | |||
|
string |
Name of the backend resource which will provide metadata used to generate form and later used for submitting data | ||
|
Map<number, BulkRowStatus> |
Tracks the submission status for each row in bulk insert mode. Key is the row index, value is the status object. | ||
|
boolean |
When enabled, adds an APPROVAL_MESSAGE field to the form schema. This field will be sent at root level alongside DETAILS when submitting. | ||
|
UI schema used to define configuration of the layout and elements in the form Check UiSchema for possible options |
Methods
|
Method |
Modifiers |
Description |
|---|---|---|
|
Clears all row submit statuses, typically called when resetting the form. | ||
|
Downloads a CSV template file with headers and sample data based on the schema. If a UI schema is provided, it will be used to determine which fields to include and in what order. Hidden fields will be excluded from the template. | ||
|
Handles CSV file selection for bulk import. Parses the CSV content and appends it to existing form items. | ||
|
Reset the form state | ||
|
Submits a single row in bulk insert mode. |