Terminal TAST
Binding Objects
Bind also allows binding values to the properties of the fundamental TAST objects. Pad and Inlines accept the binding of any of their properties. Change the size of padding or action through binding dynamically.
Binding Pad properties
Bind sets the Pad properties width, alignment and character through their corresponding bindWidth, bindAlignment and bindCharacter counterparts.
Name |
Type |
Description |
---|---|---|
bindWidth | string | A property of the current ViewModel that contains the width for the pad. |
bindAlignment | string | A property of the current ViewModel that contains the alignment for the pad. |
bindCharacter | string | A property of the current ViewModel that contains the character for the pad. |
tast.json
[
"Hello ",
{
"type": "Pad",
"bindWidth": "lineWidth",
"bindAlignment": "from",
"bindCharacter": "space",
"children": "Scott"
},
"."
]
vm.json
{
"lineWidth": 30,
"from": "center",
"space": "ยท"
}
package.json
{
"name": "example",
"version": "1.0.0",
"orion": {
"dispatchersHelper": {
"actionCreators": {
"consumes": {
"@orion/terminals": [
"createTerminal",
"spliceTerminalTAST"
]
}
}
}
}
}
Binding Inline Properties
Bind sets the properties of Inline with their corresponding bind counterpart. See the table for more detail:
Name |
Type |
Description |
---|---|---|
bindAction | string | A property of the current ViewModel that contains an object describing the action. |
bindActions | string | A property of the current ViewModel that contains an object describing the events with their respective actions. Supported Events |
bindStyle | string | A property of the current ViewModel that contains an object describing the style. Merges new css values into the style if existing. |
bindInlineType | string | A property of the current ViewModel that contains the inlineType for the inline. |
bindThemeType | string | A property of the current ViewModel that contains the themeType for the inline. |
bindTooltip | string | A property of the current ViewModel object that contains the tooltip for the inline. |
bindIsTabStop | string | A property of the current ViewModel object that specifies if an Inline is a tabStop or not. |
bindIsVisible | string | A property of the current ViewModel object that contains the visibility for the inline. Note that it should be initially false. |
bindRef | string | A property of the current ViewModel object that contains the ref to link with another different Inline inside the same scope. |
Note that there are no binders for the properties type, children, id, and scope.
tast.json
[
"Hello ",
{
"type": "Inline",
"bindStyle": "darkStyle",
"bindAction": "addTextAction",
"children": "Xavi"
},
".\n"
]
vm.json
{
"darkStyle": { "color": "#833", "background": "#300" },
"addTextAction": {
"type": "@orion/terminals-helper/APPEND_TERMINAL_TAST",
"tast": ["- Added Text\n"]
}
}
package.json
{
"name": "example",
"version": "1.0.0",
"orion": {
"dispatchersHelper": {
"actionCreators": {
"consumes": {
"@orion/terminals": [
"createTerminal",
"spliceTerminalTAST"
]
}
}
}
}
}