@jimka/typescript-ui / data / Field
Class: Field
Defined in: src/typescript/lib/data/Field.ts:36
Represents a single typed field in a model's schema. Encapsulates the field's name, type, default value, raw-data mapping, description, and display order.
Constructors
new Field()
new Field(options: FieldOptions): FieldDefined in: src/typescript/lib/data/Field.ts:50
Constructs a Field from a FieldOptions object.
Parameters
options
The options object describing the field's properties.
Returns
Methods
getDefaultValue()
getDefaultValue(): anyDefined in: src/typescript/lib/data/Field.ts:82
Returns the value used when raw data does not contain this field.
Returns
any
The configured default value, or undefined if none was specified.
getDescription()
getDescription(): stringDefined in: src/typescript/lib/data/Field.ts:100
Returns the human-readable description, falling back to the field name.
Returns
string
The description string if configured, otherwise the field name.
getMapping()
getMapping(): stringDefined in: src/typescript/lib/data/Field.ts:91
Returns the raw-data property name that maps to this field.
Returns
string
The mapping key string; defaults to the field name when not explicitly configured.
getName()
getName(): stringDefined in: src/typescript/lib/data/Field.ts:64
Returns the field's logical name used as the record property key.
Returns
string
The logical name string for this field.
getOrder()
getOrder(): numberDefined in: src/typescript/lib/data/Field.ts:109
Returns the display order index; -1 means unspecified.
Returns
number
The configured order value, or -1 if no order was specified.
getType()
getType(): FieldTypeDefined in: src/typescript/lib/data/Field.ts:73
Returns the field's data type.
Returns
The FieldType value for this field.