diff --git a/packages/builder/src/components/design/settings/componentSettings.js b/packages/builder/src/components/design/settings/componentSettings.js index e174a2e6f7..3540c8b990 100644 --- a/packages/builder/src/components/design/settings/componentSettings.js +++ b/packages/builder/src/components/design/settings/componentSettings.js @@ -30,6 +30,7 @@ import RelationshipFilterEditor from "./controls/RelationshipFilterEditor.svelte import FormStepConfiguration from "./controls/FormStepConfiguration.svelte" import FormStepControls from "./controls/FormStepControls.svelte" import PaywalledSetting from "./controls/PaywalledSetting.svelte" +import CellConditionEditor from "./controls/CellConditionEditor.svelte" const componentMap = { text: DrawerBindableInput, @@ -61,6 +62,7 @@ const componentMap = { columns: ColumnEditor, "columns/basic": BasicColumnEditor, "columns/grid": GridColumnEditor, + cellConditions: CellConditionEditor, "field/sortable": SortableFieldSelect, "field/string": FormFieldSelect, "field/number": FormFieldSelect, diff --git a/packages/builder/src/components/design/settings/controls/CellConditionEditor.svelte b/packages/builder/src/components/design/settings/controls/CellConditionEditor.svelte new file mode 100644 index 0000000000..fb0c98df9e --- /dev/null +++ b/packages/builder/src/components/design/settings/controls/CellConditionEditor.svelte @@ -0,0 +1,183 @@ + + +{conditionText} + + + + +
+ + {#if tempValue.length} +
+ {#each tempValue as condition} + Set background color to + (condition.color = e.detail)} + /> + if value + onValueTypeChange(condition, e.detail)} + /> + (condition.referenceValue = e.detail)} + /> + duplicateCondition(condition)} + /> + removeCondition(condition)} + /> + {/each} +
+ {/if} +
+ +
+
+
+
+
+ + diff --git a/packages/builder/src/components/design/settings/controls/GridColumnConfiguration/getColumns.js b/packages/builder/src/components/design/settings/controls/GridColumnConfiguration/getColumns.js index 4af3e48110..4fbe6fc9e7 100644 --- a/packages/builder/src/components/design/settings/controls/GridColumnConfiguration/getColumns.js +++ b/packages/builder/src/components/design/settings/controls/GridColumnConfiguration/getColumns.js @@ -68,6 +68,7 @@ const toGridFormat = draggableListColumns => { field: entry.field, active: entry.active, width: entry.width, + conditions: entry.conditions, })) } @@ -83,6 +84,7 @@ const toDraggableListFormat = (gridFormatColumns, createComponent, schema) => { label: column.label, columnType: schema[column.field].type, width: column.width, + conditions: column.conditions, }, {} ) diff --git a/packages/client/manifest.json b/packages/client/manifest.json index 7a9d1a5695..c8a5f8e1a4 100644 --- a/packages/client/manifest.json +++ b/packages/client/manifest.json @@ -2879,6 +2879,11 @@ "placeholder": "Auto", "min": 80, "max": 9999 + }, + { + "type": "cellConditions", + "label": "Conditions", + "key": "conditions" } ] },