Skip to content

Commit

Permalink
fix: add example of optionActions and expand the addChild modal confi…
Browse files Browse the repository at this point in the history
…guration
  • Loading branch information
michel committed Dec 24, 2024
1 parent eb56b2f commit 9c0a6ea
Showing 1 changed file with 73 additions and 1 deletion.
74 changes: 73 additions & 1 deletion src/prefabs/structures/TextInput/options/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
buttongroup,
hideIf,
option,
optionTemplateOptions,
Expand Down Expand Up @@ -44,16 +45,87 @@ export const options = {
export const optionTemplates = {
addChild: {
options: optionTemplateOptions({
propertyBased: buttongroup(
'Type',
[
['Property-based', 'true'],
['Non-property-based', 'false'],
],
{
value: 'true',
showInAddChild: true,
configuration: {
showOnDrop: true,
},
},
),
actionVariableId: option('ACTION_JS_VARIABLE', {
label: 'Action input variable',
value: '',
showInAddChild: true,
configuration: {
condition: showIf('propertyBased', 'EQ', 'false'),
showOnDrop: true,
},
}),

property: property('Property', {
value: '',
showInReconfigure: true,
showInAddChild: true,
configuration: {
allowedKinds: ['TEXT', 'URL', 'IBAN', 'STRING'],
disabled: true,
condition: hideIf('property', 'EQ', ''),
condition: showIf('propertyBased', 'EQ', 'true'),
showOnDrop: true,
},
}),
}),
// optionActions: {
// propertyBased: {
// onchange: [
// {
// action: 'clearPropertyOption',
// target: 'propterty',
// condition: ['propertyBased', 'EQ', 'false'],
// },
// {
// action: 'clearActionVariableOption',
// target: 'actionVariableId',
// condition: ['propertyBased', 'EQ', 'true'],
// },
// ],
// },
// actionVariableId: {
// onCreate: [
// {
// action: 'createAndSetActionInputVariable',
// target: 'actionVariableId',
// },
// ],
// },
// property: {
// onchange: [
// {
// action: 'setVariableOptionWithPropertyLabel',
// target: 'label',
// },
// {
// action: 'setVariableOptionWithPropertyValue',
// target: 'value',
// },
// {
// action: 'createAndSetActionInputVariable',
// target: 'actionVariableId',
// },
// ],
// onCreate: [
// {
// action: 'createAndSetPropertyValue',
// target: 'property',
// },
// ],
// },
// },
},
};

0 comments on commit 9c0a6ea

Please sign in to comment.