src/app/core/common-components/entity-form/FormConfig.ts
The general configuration for fields in tables and forms. This defines which property is displayed and how it should be displayed.
You can just provide the id as string or overwrite any EntitySchemaField property here as necessary.
No results matching.
Properties |
|
| forTable |
forTable:
|
Type : boolean
|
| Optional |
|
An internal flag that will be automatically set in the entity subrecord in order to adapt the view/edit components. |
| hideFromForm |
hideFromForm:
|
Type : boolean
|
| Optional |
|
If true, the field will only be shown in tables and excluded from forms and popups. You can also use this to include a hidden form in a Public Form. The form field is still generated but hidden in the UI, so default values can be applied to such hidden fields. |
| hideFromTable |
hideFromTable:
|
Type : boolean
|
| Optional |
|
If true, the field will only be shown in forms and popups, but not in tables. |
| id |
id:
|
Type : string
|
|
The id of the entity which should be accessed |
| noSorting |
noSorting:
|
Type : boolean
|
| Optional |
|
When set to true, the sorting of this column will be disabled. Should be used when the sorting will not work correctly/does not make sense. E.g. when displaying a list of entities |
| additional |
additional:
|
Type : any
|
| Optional |
|
(Optional) Assign any custom "extension" configuration you need for a specific datatype extension. You can pass any kind of value here to allow complex custom datatype transformations that are not part of the core datatypes and therefore not included in this core interface. |
| dataType |
dataType:
|
Type : string
|
| Optional |
|
The datatype of this field. This will trigger to matching datatype transformer when saving/loading the entity. If you don't set this explicitly, the dataType is inferred from the TypeScript type of the property that is annotated. |
| defaultValue |
defaultValue:
|
Type : DefaultValueConfig
|
| Optional |
|
Configure the default value mode of this field. Default values are applied to form fields, if field is empty The form will be disabled, until all default value configs are applied |
| description |
description:
|
Type : string
|
| Optional |
|
A further description of the property which can be displayed in tooltips. |
| displayFullLengthLabel |
displayFullLengthLabel:
|
Type : boolean
|
| Optional |
|
If set to |
| displayFullLengthOptionLabel |
displayFullLengthOptionLabel:
|
Type : boolean
|
| Optional |
|
If set to |
| editComponent |
editComponent:
|
Type : string
|
| Optional |
|
(Optional) Define using which component this property should be editable in lists and forms. The edit component has to be a registered component. Components that are registered contain the |
| entityReferenceRole |
entityReferenceRole:
|
Type : EntityReferenceRole
|
| Optional |
|
(Optional) If the dataType of this field references another entity, define the role of this relationship for the entity containing this field. i.e. how "important" is the entity this field is referencing? Does this the entity containing this field (not the referenced entity) still have meaning after the referenced entity has been deleted? see options of the |
| generateIndex |
generateIndex:
|
Type : boolean
|
| Optional |
|
Set to true to make the framework automatically create an index to retrieve/filter Entities quickly based on this field not implemented yet |
| isArray |
isArray:
|
Type : boolean
|
| Optional |
|
If the dataType can hold multiple values, as an array of the given dataType. |
| isInternalField |
isInternalField:
|
Type : boolean
|
| Optional |
|
If true, this field is an internal system field (e.g., _id, _rev, created, updated) that should not be shown in the admin form builder or saved to config. |
| label |
label:
|
Type : string
|
| Optional |
|
A label which explains this value in a human-readable way |
| labelShort |
labelShort:
|
Type : string
|
| Optional |
|
A short label which can be used in tables. If nothing is specified, the long name will be used. |
| searchable |
searchable:
|
Type : boolean
|
| Optional |
|
If set to |
| showInDetailsView |
showInDetailsView:
|
Type : boolean
|
| Optional |
|
whether to show this field in the default details view |
| trim |
trim:
|
Type : boolean
|
| Optional |
|
If set to false, leading/trailing whitespace will NOT be automatically trimmed when saving this field. Defaults to true (trimming enabled) for string fields. |
| validators |
validators:
|
Type : FormValidatorConfig
|
| Optional |
| viewComponent |
viewComponent:
|
Type : string
|
| Optional |
|
(Optional) Define using which component this property should be displayed in lists and forms. The edit component has to be a registered component. Components that are registered contain the |
import { EntitySchemaField } from "../../entity/schema/entity-schema-field";
/**
* The general configuration for fields in tables and forms.
* This defines which property is displayed and how it should be displayed.
*
* You can just provide the id as string or overwrite any EntitySchemaField property here as necessary.
*/
export interface FormFieldConfig extends EntitySchemaField {
/**
* The id of the entity which should be accessed
*/
id: string;
/**
* When set to true, the sorting of this column will be disabled.
* Should be used when the sorting will not work correctly/does not make sense.
* E.g. when displaying a list of entities
*/
noSorting?: boolean;
/**
* visibleFrom The minimal screen size where the column is shown.
* screen size classes: xs 'screen and (max-width: 599px)'
* sm 'screen and (min-width: 600px) and (max-width: 959px)'
* md 'screen and (min-width: 960px) and (max-width: 1279px)'
* lg 'screen and (min-width: 1280px) and (max-width: 1919px)'
* xl 'screen and (min-width: 1920px) and (max-width: 5000px)'
*/
visibleFrom?: "xs" | "sm" | "md" | "lg" | "xl";
/**
* If true, the field will only be shown in forms and popups, but not in tables.
*/
hideFromTable?: boolean;
/**
* If true, the field will only be shown in tables and excluded from forms and popups.
* You can also use this to include a hidden form in a Public Form.
*
* The form field is still generated but hidden in the UI,
* so default values can be applied to such hidden fields.
*/
hideFromForm?: boolean;
/**
* An internal flag that will be automatically set in the entity subrecord in order to adapt the view/edit components.
*/
forTable?: boolean;
}
/**
* Type for the definition of a single column in the EntitySubrecord
*/
export type ColumnConfig = string | FormFieldConfig;
export function toFormFieldConfig(column: ColumnConfig): FormFieldConfig {
if (typeof column === "string") {
return { id: column };
} else {
return column;
}
}