Components:Prefabs:ComponentConfiguration - bettyblocks/cli GitHub Wiki
Component Configurations are defined in the structure
of a Prefab, and recursively in the descendants
of another Component Configuration.
The ComponentConfiguration can be one of the following types COMPONENT
, WRAPPER
or PARTIAL
.
With each its own behaviour explained in the next sections.
Type
ComponentConfiguration:
type ComponentConfiguration = Component | Wrapper | Partial
Component:
interface Component {
type: 'COMPONENT';
label?: string;
descendants: ComponentConfiguration[];
name: string;
optionCategories: OptionCategories[],
options: ComponentOption[];
}
Wrapper:
interface Wrapper {
type: 'WRAPPER';
label?: string;
optionCategories: OptionCategories[],
options: LinkedOption[];
descendants: ComponentConfiguration[];
}
Partial:
interface Partial {
type: 'PARTIAL';
partialId: string;
}
Component keys
type (optional)
The type field is used to determine the behaviour of the component.
By default its set to COMPONENT
by the CLI.
When this field is set to WRAPPER
or PARTIAL
read the next sections about their keys and behaviour.
label (optional)
An descriptive name for the component to give context to the no-coder. This will be displayed in the IDE instead of the name when this field has been set.
The label has type string
.
name
Name of the Component. Has to correspond to the name of one of the Components in the Component Set.
The name has type string
.
descendants
An array of nested Component Configurations, as described in the current section.
The descendants have type ComponentConfiguration[]
.
optionCategories
An array of option Categories to organize your options available within the component.
Read more about Component Option Categories.
optionCategories have type OptionCategories[]
options
An array of Component Options. These represent the Options available within the Component. Read more about Component Options.
Options have type Option[]
.
Wrapper keys
type
The type field is used to determine its behaviour.
When this is set to WRAPPER
it will behave as a box component. It is a container for a complex structure.
This means the wrapper will lock his descendants structure for the no-coder, but is still able to access it by unlocking the wrapper.
besides that the wrapper only can have options of type LINKED_OPTION
. Giving the no-coder easy access to the most used options within this wrapper structure.
label (optional)
An descriptive name for the component to give context to the no-coder. This will be displayed in the IDE instead of the name when this field has been set.
The label has type string
.
descendants
An array of nested Component Configurations, as described in the current section.
The descendants have type ComponentConfiguration[]
.
optionCategories
An array of option Categories to organize your options available within the component.
Read more about Component Option Categories.
optionCategories have type OptionCategories[]
options
An array of Linked Options. These represent the Options available within the Wrapper sidebar giving the no-coder fast access to options within the locked structure.
Read more about Wrapper Options.
Options have type LinkedOption[]
.
Keys Partial
type
The type field is used to determine its behaviour.
When this is set to PARTIAL
it will behave as a partial container.
partialId
This field is not ment to be set manual and is generated as a empty string by the CLI. And is required to be configured through the before-create flow.