src/app/core/entity/schema/default-value-config.ts
Describes the default value behaviour of this field, i.e. that this field should automatically be filled with a value when creating a new entity
Properties |
|
field |
field:
|
Type : string
|
Optional |
field on the referenced Entity (identified by the id value in |
localAttribute |
localAttribute:
|
Type : string
|
Optional |
local field holding the reference to an Entity (for inherited only) |
mode |
mode:
|
Type : DefaultValueMode
|
What kind of logic is used to generate the default value: mode: inherited use the value from linked entity field mode: static use a static default value mode: dynamic use a placeholder value, see PLACEHOLDERS enum for available options |
value |
value:
|
Type : any
|
Optional |
used as default value in "static" and "dynamic" mode |
export interface DefaultValueConfig {
/**
* What kind of logic is used to generate the default value:
*
* mode: inherited
* use the value from linked entity field
*
* mode: static
* use a static default value
*
* mode: dynamic
* use a placeholder value, see PLACEHOLDERS enum for available options
*/
mode: DefaultValueMode;
/** used as default value in "static" and "dynamic" mode */
value?: any;
/** local field holding the reference to an Entity (for inherited only) */
localAttribute?: string;
/** field on the referenced Entity (identified by the id value in `localAttribute`), which is used as default value (for inherited only) */
field?: string;
}
export type DefaultValueMode = "inherited" | "static" | "dynamic";