Delegate
The <sdpi-delegate>
component enables the invocation of a sendToPlugin
event, allowing for the persisted setting to be delegated to the plugin, and then rendered within this component.
The <sdpi-delegate>
component is useful for functionality that is not native to the property inspector, e.g. browsing for a folder.
Exampleâ
<sdpi-item label="Delegate">
<sdpi-delegate
setting="delegated_value"
invoke="eventName"
label="...">
</sdpi-delegate>
</sdpi-item>
Resultâ
Unlike other components, the value of the <sdpi-delegate>
component is determined by the plugin. When the component is invoked, a payload containing the invoke
attribute is sent to the plugin using sendToPlugin
with the following structure.
{
action,
event,
context,
payload: {
event: "eventName"
}
}
Once the plugin has set the persisted value, it is then rendered within the <sdpi-delegate>
component using .toString()
.
Configurationâ
The component supports the following configuration.
Name | Type | Description |
---|---|---|
default | string | The default value; shown when the persisted value is undefined. |
disabled | boolean | Determines whether the input is disabled. |
format-type | string | Type of formatting to be used when rendering the value (see Formatting). |
label | string | Label text shown within the button; defaults to an ellipsis. |
invoke | string | The payload.event name supplied to the plugin when the delegate is invoked. |
value | unknown | The value of the component, and the persisted setting. |
Formattingâ
Supported format-type
are:
path
- The value is parsed as a local path, and the directory or file name is rendered.
Persistenceâ
The value of the component can be automatically persisted to the Stream Deck with the following configuration.
Name | Type | Description |
global | boolean | When present, the value will be persisted to the global settings. |
setting | string | The path of the property where the value should be persisted in the settings. |
The setting
represents the path of a property. If required, this path can denote a nested property within the settings, e.g. if the setting
were foo.bar.prop
, the value would be saved to:
{
"foo": {
"bar": {
"prop": <value>
}
}
}