Layout - CalendarFinalizer
Layout.CalendarFinalizerDefine a UI Calendar from a
Stream within a LayoutBuilder.Type parameters
Name | Type |
---|---|
Inputs | extends Record = Record |
T | extends DictType = DictType |
Layout
events
▸ events(def
):
CalendarFinalizer
Create an event in the
CalendarBuilder within a LayoutBuilder.Parameters
Name | Type | Description |
---|---|---|
def | (fields : TypeToFields , inputs : Inputs ) => EastFunction <CalendarEventType | ArrayType | DictType > | A function that takes an East Function describing the a CalendarEventType, or ArrayType or DictType containing one or more CalendarEventTypes The following properties are defined for a CalendarEventType: |
Returns
CalendarFinalizer
Example
// use a DictType stream
const stream = Stream(
"My Stream",
DictType(
StringType,
StructType({
events: ArrayType(
StructType({
start: DateTimeType,
end: DateTimeType,
label: StringType,
})
)
event: StructType({
start: DateTimeType,
end: DateTimeType,
label: StringType,
})
})
)
);
// create a table in a layout
const layout = new LayoutBuilder("My Layout")
.calendar("calendar", builder =>
builder
.fromStream(stream)
.calendar()
.events((fields, inputs) => fields.events)
.events((fields, inputs) => fields.event)
)
.toTemplate()
input
▸ input(config
):
CalendarFinalizer
<Inputs
& { [K in string]: Variable }, T
>
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
CalendarFinalizer
<Inputs
& { [K in string]: Variable }, T
>
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()