Layout - DictStructTableFinalizer
Layout.DictStructTableFinalizerDefine a UI Table from a
Stream within a LayoutBuilder.Type parameters
| Name | Type |
|---|---|
Inputs | extends Record = Record |
T | extends DictType = DictType |
Fields | extends Record = Record |
Layout
array
▸ array(name, value, def, config?):
DictStructTableFinalizer<Inputs, T, Fields & { [K in string]: ColumnType }>
Define a
ArrayType input in a TableBuilder within a LayoutBuilder.Type parameters
| Name | Type |
|---|---|
Name | extends string |
F | extends (fields: TypeToFields) => Variable<ArrayType> |
Parameters
| Name | Type | Description |
|---|---|---|
name | Name extends keyof Fields ? never : Name | the display name for the column |
value | F | - |
def | (builder: FieldFinalizer<ReturnType["type"]["value"], Inputs, >) => FieldFinalizer<ReturnType["type"]["value"], Inputs, Record> | the definition of the column |
config? | Object | - |
config.hidden? | boolean | - |
config.hidden_detail? | boolean | - |
config.readonly? | boolean | (fields: TypeToFields, inputs: Inputs) => EastFunction | - |
Returns
DictStructTableFinalizer<Inputs, T, Fields & { [K in string]: ColumnType }>
Example
// use a DictType stream
const stream = Stream(
"My Stream",
DictType(
StringType,
StructType({
array: ArrayType(StructType({
string: StringType
})),
})
)
);
// create a form in a layout
const layout = new LayoutBuilder("My Layout")
.table("My Table", builder => builder
.fromStream(stream)
.array("Array", fields => fields.array, builder =>
builder.string("String", fields => fields.string)
)
)
.toTemplate()
boolean
▸ boolean(name, def):
DictStructTableFinalizer<Inputs, T, Fields & { [K in string]: ColumnType }>
Create a
BooleanType column in the TableBuilder within a LayoutBuilder.Type parameters
| Name | Type |
|---|---|
Name | extends string |
Parameters
| Name | Type | Description |
|---|---|---|
name | Name extends keyof Fields ? never : Name | the display name for the column |
def | Object | the definition of the column |
def.background? | string | (fields: TypeToFields) => EastFunction | The cell background color Variable * |
def.color? | string | (fields: TypeToFields) => EastFunction | The cell text color Variable * |
def.display? | (fields: TypeToFields, inputs: Inputs) => EastFunction | The string value Variable to display. * |
def.hidden? | boolean | The visibility of the field * |
def.hidden_detail? | boolean | The visibility of the field in a detail view * |
def.readonly? | boolean | (fields: TypeToFields, inputs: Inputs) => EastFunction | The column is read only. * |
def.target? | boolean | (fields: TypeToFields, inputs: Inputs) => EastFunction | The input target value Variable * |
def.target_display? | (fields: TypeToFields, inputs: Inputs) => EastFunction | The string value Variable to display. * |
def.tooltip? | ValueTypeOf | (fields: TypeToFields) => EastFunction | The cell tooltip Variable * |
def.value | (fields: TypeToFields) => Variable | The Variable to display. * |
Returns
DictStructTableFinalizer<Inputs, T, Fields & { [K in string]: ColumnType }>
Example
// use a DictType stream
const stream = Stream(
"My Stream",
DictType(
StringType,
StructType({
boolean: BooleanType,
})
)
);
// create a table in a layout
const layout = new LayoutBuilder("My Layout")
.table("My Table", builder => builder
.fromStream(stream)
.boolean("Boolean", fields => fields.boolean)
)
.toTemplate()
columns
▸ columns(def?):
DictStructTableFinalizer<Inputs, T, Fields & { [K in string | number | symbol]: ColumnType } | { [K in string | number | symbol]: ColumnType }>
Create multiple value columns in the
TableBuilder within a LayoutBuilder.Type parameters
| Name | Type |
|---|---|
S | extends Record<string, (fields: TypeToFields) => Variable> |
Parameters
| Name | Type |
|---|---|
def? | S |
Returns
DictStructTableFinalizer<Inputs, T, Fields & { [K in string | number | symbol]: ColumnType } | { [K in string | number | symbol]: ColumnType }>
Example
// use a DictType stream
const stream = Stream(
"My Stream",
DictType(
StringType,
StructType({
string: StringType,
date: DateTimeType,
float: FloatType,
integer: IntegerType,
boolean: BooleanType,
struct: Nullable(StructType({
string: Nullable(StringType),
date: DateTimeType,
float: FloatType,
integer: Nullable(IntegerType),
boolean: Nullable(BooleanType),
array: Nullable(ArrayType(FloatType)),
struct: Nullable(
StructType({
string: Nullable(StringType),
date: DateTimeType,
float: FloatType,
integer: Nullable(IntegerType),
boolean: Nullable(BooleanType),
})),
})),
})
)
);
// create a table with all columns
const layout = new LayoutBuilder("My Layout")
.table("My Table", builder => builder
.fromStream(stream)
.columns()
)
.toTemplate()
// create a table with some columns
const layout2 = new LayoutBuilder("My Layout")
.table("My Table", builder => builder
.fromStream(stream)
.columns({
"Date": (fields) => fields.date,
"Integer": (fields) => fields.integer,
"Float": (fields) => fields.float,
"String": (fields) => fields.string,
"Boolean": (fields) => fields.boolean,
"Array": (fields) => fields.array,
"Struct": (fields) => fields.struct
})
)
.toTemplate()
date
▸ date(name, def):
DictStructTableFinalizer<Inputs, T, Fields & { [K in string]: ColumnType }>
Create a
DateTimeType column in the TableBuilder within a LayoutBuilder.Type parameters
| Name | Type |
|---|---|
Name | extends string |
Parameters
| Name | Type | Description |
|---|---|---|
name | Name extends keyof Fields ? never : Name | the display name for the column |
def | Object | the definition of the column |
def.background? | string | (fields: TypeToFields) => EastFunction | The cell background color Variable * |
def.color? | string | (fields: TypeToFields) => EastFunction | The cell text color Variable * |
def.display? | (fields: TypeToFields, inputs: Inputs) => EastFunction | The string value Variable to display. * |
def.hidden? | boolean | The visibility of the field * |
def.hidden_detail? | boolean | The visibility of the field in a detail view * |
def.max? | Date | (fields: TypeToFields, inputs: Inputs) => EastFunction | The maximum Variable to allow as input. * |
def.min? | Date | (fields: TypeToFields, inputs: Inputs) => EastFunction | The minimum Variable to allow as input. * |
def.readonly? | boolean | (fields: TypeToFields, inputs: Inputs) => EastFunction | The column is read only. * |
def.target? | Date | (fields: TypeToFields, inputs: Inputs) => EastFunction | The input target value Variable * |
def.target_display? | (fields: TypeToFields, inputs: Inputs) => EastFunction | The string value Variable to display. * |
def.tooltip? | ValueTypeOf | (fields: TypeToFields) => EastFunction | The cell tooltip Variable * |
def.value | (fields: TypeToFields) => Variable | The Variable to display. * |
Returns
DictStructTableFinalizer<Inputs, T, Fields & { [K in string]: ColumnType }>
Example
// use a DictType stream
const stream = Stream(
"My Stream",
DictType(
StringType,
StructType({
date: DateTimeType,
})
)
);
// create a table in a layout
const layout = new LayoutBuilder("My Layout")
.table("My Table", builder => builder
.fromStream(stream)
.date("Date", fields => fields.date)
)
.toTemplate()
dict
▸ dict(name, value, def, config?):
DictStructTableFinalizer<Inputs, T, Fields & { [K in string]: ColumnType }>
Define a
DictType input in a TableBuilder within a LayoutBuilder.Type parameters
| Name | Type |
|---|---|
Name | extends string |
F | extends (fields: TypeToFields) => Variable<DictType> |
Parameters
| Name | Type | Description |
|---|---|---|
name | Name extends keyof Fields ? never : Name | the display name for the column |
value | F | - |
def | (builder: FieldFinalizer<ReturnType["type"]["value"]["value"], Inputs, >) => FieldFinalizer<ReturnType["type"]["value"]["value"], Inputs, Record> | the definition of the column |
config? | Object | - |
config.hidden? | boolean | - |
config.hidden_detail? | boolean | - |
config.readonly? | boolean | (fields: TypeToFields, inputs: Inputs) => EastFunction | - |
Returns
DictStructTableFinalizer<Inputs, T, Fields & { [K in string]: ColumnType }>
Example
// use a DictType stream
const stream = Stream(
"My Stream",
DictType(
StringType,
StructType({
dict: DictType(
StringType,
StructType({
string: StringType
})
),
})
)
);
// create a form in a layout
const layout = new LayoutBuilder("My Layout")
.table("My Table", builder => builder
.fromStream(stream)
.dict("Dict", fields => fields.dict, builder =>
builder.string("String", fields => fields.string)
)
)
.toTemplate()
disableAdd
▸ disableAdd():
DictStructTableFinalizer
Disable row add for the
TableBuilder within a LayoutBuilder.Returns
DictStructTableFinalizer
Remarks
only valid if the input stream is writable
Example
// use a DictType stream
const stream = Stream(
"My Stream",
DictType(
StringType,
StructType({
string: StringType,
date: DateTimeType,
})
)
);
// create a table in a layout
const layout = new LayoutBuilder("My Layout")
.table("My Table", builder => builder
.fromStream(stream)
.date("Date", fields => fields.date)
.string("String", fields => fields.string)
.disableAdd()
)
.toTemplate()
disableRemove
▸ disableRemove():
DictStructTableFinalizer
Disable row remove for the
TableBuilder within a LayoutBuilder.Returns
DictStructTableFinalizer
Remarks
only valid if the input stream is writable
Example
// use a DictType stream
const stream = Stream(
"My Stream",
DictType(
StringType,
StructType({
string: StringType,
date: DateTimeType,
})
)
);
// create a table in a layout
const layout = new LayoutBuilder("My Layout")
.table("My Table", builder => builder
.fromStream(stream)
.date("Date", fields => fields.date)
.string("String", fields => fields.string)
.disableRemove()
)
.toTemplate()
disableUndo
▸ disableUndo():
DictStructTableFinalizer
Disable row remove for the
TableBuilder within a LayoutBuilder.Returns
DictStructTableFinalizer
Remarks
only valid if the input stream is writable
Example
// use a DictType stream
const stream = Stream(
"My Stream",
DictType(
StringType,
StructType({
string: StringType,
date: DateTimeType,
})
)
);
// create a table in a layout
const layout = new LayoutBuilder("My Layout")
.table("My Table", builder => builder
.fromStream(stream)
.date("Date", fields => fields.date)
.string("String", fields => fields.string)
.disableRemove()
)
.toTemplate()
disableUpdate
▸ disableUpdate():
DictStructTableFinalizer
Disable row update for the
TableBuilder within a LayoutBuilder.Returns
DictStructTableFinalizer
Remarks
only valid if the input stream is writable
Example
// use a DictType stream
const stream = Stream(
"My Stream",
DictType(
StringType,
StructType({
string: StringType,
date: DateTimeType,
})
)
);
// create a table in a layout
const layout = new LayoutBuilder("My Layout")
.table("My Table", builder => builder
.fromStream(stream)
.date("Date", fields => fields.date)
.string("String", fields => fields.string)
.disableUpdate()
)
.toTemplate()
float
▸ float(name, def):
DictStructTableFinalizer<Inputs, T, Fields & { [K in string]: ColumnType }>
Create a
FloatType column in the TableBuilder within a LayoutBuilder.Type parameters
| Name | Type |
|---|---|
Name | extends string |
Parameters
| Name | Type | Description |
|---|---|---|
name | Name extends keyof Fields ? never : Name | the display name for the column |
def | Object | the definition of the column |
def.background? | string | (fields: TypeToFields) => EastFunction | The cell background color Variable * |
def.color? | string | (fields: TypeToFields) => EastFunction | The cell text color Variable * |
def.display? | (fields: TypeToFields, inputs: Inputs) => EastFunction | The string value Variable to display. * |
def.hidden? | boolean | The visibility of the field * |
def.hidden_detail? | boolean | The visibility of the field in a detail view * |
def.max? | number | (fields: TypeToFields, inputs: Inputs) => EastFunction | The maximum Variable to allow as input. * |
def.min? | number | (fields: TypeToFields, inputs: Inputs) => EastFunction | The minimum Variable to allow as input. * |
def.readonly? | boolean | (fields: TypeToFields, inputs: Inputs) => EastFunction | The column is read only. * |
def.target? | number | (fields: TypeToFields, inputs: Inputs) => EastFunction | The input target value Variable * |
def.target_display? | (fields: TypeToFields, inputs: Inputs) => EastFunction | The string value Variable to display. * |
def.tooltip? | ValueTypeOf | (fields: TypeToFields) => EastFunction | The cell tooltip Variable * |
def.value | (fields: TypeToFields) => Variable | The Variable to display. * |
Returns
DictStructTableFinalizer<Inputs, T, Fields & { [K in string]: ColumnType }>
Example
// use a DictType stream
const stream = Stream(
"My Stream",
DictType(
StringType,
StructType({
float: FloatType,
})
)
);
// create a table in a layout
const layout = new LayoutBuilder("My Layout")
.table("My Table", builder => builder
.fromStream(stream)
.float("Float", fields => fields.float)
)
.toTemplate()
input
▸ input(config):
DictStructTableFinalizer<Inputs & { [K in string]: Variable }, T, Fields>
Add an additional named input
Stream to the Visual.Type parameters
| Name | Type |
|---|---|
Name | extends string |
I | extends EastType |
Parameters
| Name | Type | Description |
|---|---|---|
config | Object | the input stream and the resulting variable name |
config.name | Name extends "input" | keyof Inputs ? never : Name | The name of the input. * |
config.stream | Stream | The Stream to input. * |
Returns
DictStructTableFinalizer<Inputs & { [K in string]: Variable }, T, Fields>
a new
LayoutBuilderExample
// use a DictType stream
const stream = Stream(
"My Stream",
DictType(
StringType,
StructType({
string: StringType,
date: DateTimeType,
})
)
);
const value = Stream("Value", StringType);
// create a table in a layout
const layout = new LayoutBuilder("My Layout")
.table("My Table", builder => builder
.fromStream(stream)
.date("Date", fields => fields.date)
.input({ name: "value", stream: value })
.string("String", {
value: fields => fields.string,
target: (_fields, inputs) => inputs.value
)
)
.toTemplate()
integer
▸ integer(name, def):
DictStructTableFinalizer<Inputs, T, Fields & { [K in string]: ColumnType }>
Create a
IntegerType column in the TableBuilder within a LayoutBuilder.Type parameters
| Name | Type |
|---|---|
Name | extends string |
Parameters
| Name | Type | Description |
|---|---|---|
name | Name extends keyof Fields ? never : Name | the display name for the column |
def | Object | the definition of the column |
def.background? | string | (fields: TypeToFields) => EastFunction | The cell background color Variable * |
def.color? | string | (fields: TypeToFields) => EastFunction | The cell text color Variable * |
def.display? | (fields: TypeToFields, inputs: Inputs) => EastFunction | The string value Variable to display. * |
def.hidden? | boolean | The visibility of the field * |
def.hidden_detail? | boolean | The visibility of the field in a detail view * |
def.max? | bigint | (fields: TypeToFields, inputs: Inputs) => EastFunction | The maximum Variable to allow as input. * |
def.min? | bigint | (fields: TypeToFields, inputs: Inputs) => EastFunction | The minimum Variable to allow as input. * |
def.readonly? | boolean | (fields: TypeToFields, inputs: Inputs) => EastFunction | The column is read only. * |
def.target? | bigint | (fields: TypeToFields, inputs: Inputs) => EastFunction | The input target value Variable * |
def.target_display? | (fields: TypeToFields, inputs: Inputs) => EastFunction | The string value Variable to display. * |
def.tooltip? | ValueTypeOf | (fields: TypeToFields) => EastFunction | The cell tooltip Variable * |
def.value | (fields: TypeToFields) => Variable | The Variable to display. * |
Returns
DictStructTableFinalizer<Inputs, T, Fields & { [K in string]: ColumnType }>
Example
// use a DictType stream
const stream = Stream(
"My Stream",
DictType(
StringType,
StructType({
integer: IntegerType,
})
)
);
// create a table in a layout
const layout = new LayoutBuilder("My Layout")
.table("My Table", builder => builder
.fromStream(stream)
.integer("Integer", fields => fields.integer)
)
.toTemplate()
set
▸ set(name, def):
DictStructTableFinalizer<Inputs, T, Fields & { [K in string]: ColumnType }>
Create a
SetType column in the TableBuilder within a LayoutBuilder.Type parameters
| Name | Type |
|---|---|
Name | extends string |
Parameters
| Name | Type | Description |
|---|---|---|
name | Name extends keyof Fields ? never : Name | the display name for the column |
def | Object | the definition of the column |
def.background? | string | (fields: TypeToFields) => EastFunction | The cell background color Variable * |
def.color? | string | (fields: TypeToFields) => EastFunction | The cell text color Variable * |
def.display? | (fields: TypeToFields, inputs: Inputs) => EastFunction | The string value Variable to display. * |
def.hidden? | boolean | The visibility of the field * |
def.hidden_detail? | boolean | The visibility of the field in a detail view * |
def.range? | Set | Map<string, Set> | (fields: TypeToFields, inputs: Inputs) => EastFunction<SetType> | EastFunction<DictType<StringType, SetType>> | The range Variable to allow as input. * |
def.readonly? | boolean | (fields: TypeToFields, inputs: Inputs) => EastFunction | The column is read only. * |
def.target? | Set | (fields: TypeToFields, inputs: Inputs) => EastFunction | The input target value Variable * |
def.target_display? | (fields: TypeToFields, inputs: Inputs) => EastFunction | The string value Variable to display. * |
def.tooltip? | ValueTypeOf<PrimitiveType | SetType> | (fields: TypeToFields) => EastFunction<PrimitiveType | SetType> | The cell tooltip Variable * |
def.value | (fields: TypeToFields) => Variable | The Variable to display. * |
Returns
DictStructTableFinalizer<Inputs, T, Fields & { [K in string]: ColumnType }>
Example
// use a DictType stream
const stream = Stream(
"My Stream",
DictType(
StringType,
StructType({
set: SetType(StringType),
})
)
);
// create a table in a layout
const layout = new LayoutBuilder("My Layout")
.table("My Table", builder => builder
.fromStream(stream)
.set("Set", fields => fields.set)
)
.toTemplate()
showKey
▸ showKey(label):
DictStructTableFinalizer<Inputs, T, Fields & { [K in string]: ColumnType }>
Define if the
Stream key should be visible in the TableBuilder within a LayoutBuilder.Type parameters
| Name | Type |
|---|---|
Name | extends string |
Parameters
| Name | Type |
|---|---|
label | Name |
Returns
DictStructTableFinalizer<Inputs, T, Fields & { [K in string]: ColumnType }>
Example
// use a DictType stream
const stream = Stream(
"My Stream",
DictType(
StringType,
StructType({
string: StringType,
date: DateTimeType,
})
)
);
// create a table in a layout
const layout = new LayoutBuilder("My Layout")
.table("My Table", builder => builder
.fromStream(stream)
.date("Date", fields => fields.date)
.string("String", fields => fields.string)
.showKey("Key")
)
.toTemplate()
string
▸ string(name, def):
DictStructTableFinalizer<Inputs, T, Fields & { [K in string]: ColumnType }>
Create a
StringType column in the TableBuilder within a LayoutBuilder.Type parameters
| Name | Type |
|---|---|
Name | extends string |
Parameters
| Name | Type | Description |
|---|---|---|
name | Name extends keyof Fields ? never : Name | the display name for the column |
def | Object | the definition of the column |
def.background? | string | (fields: TypeToFields) => EastFunction | The cell background color Variable * |
def.color? | string | (fields: TypeToFields) => EastFunction | The cell text color Variable * |
def.display? | (fields: TypeToFields, inputs: Inputs) => EastFunction | The string value Variable to display. * |
def.hidden? | boolean | The visibility of the field * |
def.hidden_detail? | boolean | The visibility of the field in a detail view * |
def.range? | Set | Map<string, Set> | (fields: TypeToFields, inputs: Inputs) => EastFunction<SetType> | EastFunction<DictType<StringType, SetType>> | The range Variable to allow as input. * |
def.readonly? | boolean | (fields: TypeToFields, inputs: Inputs) => EastFunction | The column is read only. * |
def.target? | string | (fields: TypeToFields, inputs: Inputs) => EastFunction | The input target value Variable * |
def.target_display? | (fields: TypeToFields, inputs: Inputs) => EastFunction | The string value Variable to display. * |
def.tooltip? | ValueTypeOf | (fields: TypeToFields) => EastFunction | The cell tooltip Variable * |
def.value | (fields: TypeToFields) => Variable | The Variable to display. * |
Returns
DictStructTableFinalizer<Inputs, T, Fields & { [K in string]: ColumnType }>
Example
// use a DictType stream
const stream = Stream(
"My Stream",
DictType(
StringType,
StructType({
string: StringType,
})
)
);
// create a table in a layout
const layout = new LayoutBuilder("My Layout")
.table("My Table", builder => builder
.fromStream(stream)
.string("String", fields => fields.string)
)
.toTemplate()