Skip to main content

Layout - DictStructTableFinalizer

Layout.DictStructTableFinalizer

Define a UI Table from a

Stream within a LayoutBuilder.

Type parameters

NameType
Inputsextends Record = Record
Textends DictType = DictType
Fieldsextends 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

NameType
Nameextends string
Fextends (fields: TypeToFields) => Variable<ArrayType>

Parameters

NameTypeDescription
nameName extends keyof Fields ? never : Namethe display name for the column
valueF-
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

NameType
Nameextends string

Parameters

NameTypeDescription
nameName extends keyof Fields ? never : Namethe display name for the column
defObjectthe definition of the column
def.background?string | (fields: TypeToFields) => EastFunctionThe cell background color Variable *
def.color?string | (fields: TypeToFields) => EastFunctionThe cell text color Variable *
def.display?(fields: TypeToFields, inputs: Inputs) => EastFunctionThe string value Variable to display. *
def.hidden?booleanThe visibility of the field *
def.hidden_detail?booleanThe visibility of the field in a detail view *
def.readonly?boolean | (fields: TypeToFields, inputs: Inputs) => EastFunctionThe column is read only. *
def.target?boolean | (fields: TypeToFields, inputs: Inputs) => EastFunctionThe input target value Variable *
def.target_display?(fields: TypeToFields, inputs: Inputs) => EastFunctionThe string value Variable to display. *
def.tooltip?ValueTypeOf | (fields: TypeToFields) => EastFunctionThe cell tooltip Variable *
def.value(fields: TypeToFields) => VariableThe 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

NameType
Sextends Record<string, (fields: TypeToFields) => Variable>

Parameters

NameType
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

NameType
Nameextends string

Parameters

NameTypeDescription
nameName extends keyof Fields ? never : Namethe display name for the column
defObjectthe definition of the column
def.background?string | (fields: TypeToFields) => EastFunctionThe cell background color Variable *
def.color?string | (fields: TypeToFields) => EastFunctionThe cell text color Variable *
def.display?(fields: TypeToFields, inputs: Inputs) => EastFunctionThe string value Variable to display. *
def.hidden?booleanThe visibility of the field *
def.hidden_detail?booleanThe visibility of the field in a detail view *
def.max?Date | (fields: TypeToFields, inputs: Inputs) => EastFunctionThe maximum Variable to allow as input. *
def.min?Date | (fields: TypeToFields, inputs: Inputs) => EastFunctionThe minimum Variable to allow as input. *
def.readonly?boolean | (fields: TypeToFields, inputs: Inputs) => EastFunctionThe column is read only. *
def.target?Date | (fields: TypeToFields, inputs: Inputs) => EastFunctionThe input target value Variable *
def.target_display?(fields: TypeToFields, inputs: Inputs) => EastFunctionThe string value Variable to display. *
def.tooltip?ValueTypeOf | (fields: TypeToFields) => EastFunctionThe cell tooltip Variable *
def.value(fields: TypeToFields) => VariableThe 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

NameType
Nameextends string
Fextends (fields: TypeToFields) => Variable<DictType>

Parameters

NameTypeDescription
nameName extends keyof Fields ? never : Namethe display name for the column
valueF-
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

NameType
Nameextends string

Parameters

NameTypeDescription
nameName extends keyof Fields ? never : Namethe display name for the column
defObjectthe definition of the column
def.background?string | (fields: TypeToFields) => EastFunctionThe cell background color Variable *
def.color?string | (fields: TypeToFields) => EastFunctionThe cell text color Variable *
def.display?(fields: TypeToFields, inputs: Inputs) => EastFunctionThe string value Variable to display. *
def.hidden?booleanThe visibility of the field *
def.hidden_detail?booleanThe visibility of the field in a detail view *
def.max?number | (fields: TypeToFields, inputs: Inputs) => EastFunctionThe maximum Variable to allow as input. *
def.min?number | (fields: TypeToFields, inputs: Inputs) => EastFunctionThe minimum Variable to allow as input. *
def.readonly?boolean | (fields: TypeToFields, inputs: Inputs) => EastFunctionThe column is read only. *
def.target?number | (fields: TypeToFields, inputs: Inputs) => EastFunctionThe input target value Variable *
def.target_display?(fields: TypeToFields, inputs: Inputs) => EastFunctionThe string value Variable to display. *
def.tooltip?ValueTypeOf | (fields: TypeToFields) => EastFunctionThe cell tooltip Variable *
def.value(fields: TypeToFields) => VariableThe 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

NameType
Nameextends string
Iextends EastType

Parameters

NameTypeDescription
configObjectthe input stream and the resulting variable name
config.nameName extends "input" | keyof Inputs ? never : NameThe name of the input. *
config.streamStreamThe Stream to input. *

Returns

DictStructTableFinalizer<Inputs & { [K in string]: Variable }, T, Fields>

a new

LayoutBuilder

Example

  // 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

NameType
Nameextends string

Parameters

NameTypeDescription
nameName extends keyof Fields ? never : Namethe display name for the column
defObjectthe definition of the column
def.background?string | (fields: TypeToFields) => EastFunctionThe cell background color Variable *
def.color?string | (fields: TypeToFields) => EastFunctionThe cell text color Variable *
def.display?(fields: TypeToFields, inputs: Inputs) => EastFunctionThe string value Variable to display. *
def.hidden?booleanThe visibility of the field *
def.hidden_detail?booleanThe visibility of the field in a detail view *
def.max?bigint | (fields: TypeToFields, inputs: Inputs) => EastFunctionThe maximum Variable to allow as input. *
def.min?bigint | (fields: TypeToFields, inputs: Inputs) => EastFunctionThe minimum Variable to allow as input. *
def.readonly?boolean | (fields: TypeToFields, inputs: Inputs) => EastFunctionThe column is read only. *
def.target?bigint | (fields: TypeToFields, inputs: Inputs) => EastFunctionThe input target value Variable *
def.target_display?(fields: TypeToFields, inputs: Inputs) => EastFunctionThe string value Variable to display. *
def.tooltip?ValueTypeOf | (fields: TypeToFields) => EastFunctionThe cell tooltip Variable *
def.value(fields: TypeToFields) => VariableThe 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

NameType
Nameextends string

Parameters

NameTypeDescription
nameName extends keyof Fields ? never : Namethe display name for the column
defObjectthe definition of the column
def.background?string | (fields: TypeToFields) => EastFunctionThe cell background color Variable *
def.color?string | (fields: TypeToFields) => EastFunctionThe cell text color Variable *
def.display?(fields: TypeToFields, inputs: Inputs) => EastFunctionThe string value Variable to display. *
def.hidden?booleanThe visibility of the field *
def.hidden_detail?booleanThe 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) => EastFunctionThe column is read only. *
def.target?Set | (fields: TypeToFields, inputs: Inputs) => EastFunctionThe input target value Variable *
def.target_display?(fields: TypeToFields, inputs: Inputs) => EastFunctionThe string value Variable to display. *
def.tooltip?ValueTypeOf<PrimitiveType | SetType> | (fields: TypeToFields) => EastFunction<PrimitiveType | SetType>The cell tooltip Variable *
def.value(fields: TypeToFields) => VariableThe 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

NameType
Nameextends string

Parameters

NameType
labelName

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

NameType
Nameextends string

Parameters

NameTypeDescription
nameName extends keyof Fields ? never : Namethe display name for the column
defObjectthe definition of the column
def.background?string | (fields: TypeToFields) => EastFunctionThe cell background color Variable *
def.color?string | (fields: TypeToFields) => EastFunctionThe cell text color Variable *
def.display?(fields: TypeToFields, inputs: Inputs) => EastFunctionThe string value Variable to display. *
def.hidden?booleanThe visibility of the field *
def.hidden_detail?booleanThe 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) => EastFunctionThe column is read only. *
def.target?string | (fields: TypeToFields, inputs: Inputs) => EastFunctionThe input target value Variable *
def.target_display?(fields: TypeToFields, inputs: Inputs) => EastFunctionThe string value Variable to display. *
def.tooltip?ValueTypeOf | (fields: TypeToFields) => EastFunctionThe cell tooltip Variable *
def.value(fields: TypeToFields) => VariableThe 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()