diff --git a/packages/bbui/src/Table/ArrayRenderer.svelte b/packages/bbui/src/Table/ArrayRenderer.svelte
new file mode 100644
index 0000000000..679973a03a
--- /dev/null
+++ b/packages/bbui/src/Table/ArrayRenderer.svelte
@@ -0,0 +1,17 @@
+
+
+{#each badges as badge}
+ {badge}
+{/each}
+{#if leftover}
+
+{leftover} more
+{/if}
diff --git a/packages/bbui/src/Table/CellRenderer.svelte b/packages/bbui/src/Table/CellRenderer.svelte
index 2d073b7782..d6a2f3196d 100644
--- a/packages/bbui/src/Table/CellRenderer.svelte
+++ b/packages/bbui/src/Table/CellRenderer.svelte
@@ -4,7 +4,7 @@
import DateTimeRenderer from "./DateTimeRenderer.svelte"
import RelationshipRenderer from "./RelationshipRenderer.svelte"
import AttachmentRenderer from "./AttachmentRenderer.svelte"
-
+ import ArrayRenderer from "./ArrayRenderer.svelte"
export let row
export let schema
export let value
@@ -19,6 +19,7 @@
options: StringRenderer,
number: StringRenderer,
longform: StringRenderer,
+ array: ArrayRenderer,
}
$: type = schema?.type ?? "string"
$: customRenderer = customRenderers?.find(x => x.column === schema?.name)
diff --git a/packages/builder/src/builderStore/store/screenTemplates/utils/commonComponents.js b/packages/builder/src/builderStore/store/screenTemplates/utils/commonComponents.js
index 1a64a8958f..5b3bc041ff 100644
--- a/packages/builder/src/builderStore/store/screenTemplates/utils/commonComponents.js
+++ b/packages/builder/src/builderStore/store/screenTemplates/utils/commonComponents.js
@@ -131,6 +131,7 @@ const fieldTypeToComponentMap = {
string: "stringfield",
number: "numberfield",
options: "optionsfield",
+ array: "multifieldselect",
boolean: "booleanfield",
longform: "longformfield",
datetime: "datetimefield",
@@ -167,6 +168,13 @@ export function makeDatasourceFormComponents(datasource) {
optionsSource: "schema",
})
}
+ if (fieldType === "array") {
+ component.customProps({
+ placeholder: "Choose an option",
+ optionsSource: "schema",
+ })
+ }
+
if (fieldType === "link") {
let placeholder =
fieldSchema.relationshipType === "one-to-many"
diff --git a/packages/builder/src/components/backend/DataTable/RowFieldControl.svelte b/packages/builder/src/components/backend/DataTable/RowFieldControl.svelte
index 0724016679..e82c55679a 100644
--- a/packages/builder/src/components/backend/DataTable/RowFieldControl.svelte
+++ b/packages/builder/src/components/backend/DataTable/RowFieldControl.svelte
@@ -1,5 +1,12 @@
diff --git a/packages/builder/src/components/design/AppPreview/componentStructure.json b/packages/builder/src/components/design/AppPreview/componentStructure.json
index cea20a7dcf..3bc2554fde 100644
--- a/packages/builder/src/components/design/AppPreview/componentStructure.json
+++ b/packages/builder/src/components/design/AppPreview/componentStructure.json
@@ -21,7 +21,8 @@
"datetimefield",
"attachmentfield",
"relationshipfield",
- "daterangepicker"
+ "daterangepicker",
+ "multifieldselect"
]
},
{
diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FilterEditor/FilterDrawer.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FilterEditor/FilterDrawer.svelte
index d41d28e4e3..ad647d1550 100644
--- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FilterEditor/FilterDrawer.svelte
+++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FilterEditor/FilterDrawer.svelte
@@ -59,6 +59,14 @@
expression.operator = validOperators[0] ?? OperatorOptions.Equals.value
onOperatorChange(expression, expression.operator)
}
+
+ // if changed to an array, change default value to empty array
+ const idx = filters.findIndex(x => x.field === field)
+ if (expression.type === "array") {
+ filters[idx].value = []
+ } else {
+ filters[idx].value = null
+ }
}
const onOperatorChange = (expression, operator) => {
@@ -74,7 +82,9 @@
const getFieldOptions = field => {
const schema = schemaFields.find(x => x.name === field)
- return schema?.constraints?.inclusion || []
+ const opt = schema?.constraints?.inclusion || []
+
+ return opt
}
@@ -122,7 +132,7 @@
/>
{:else if ["string", "longform", "number"].includes(filter.type)}
- {:else if filter.type === "options"}
+ {:else if filter.type === "options" || "array"}
{
return ConstraintMap[type]
}
@@ -190,6 +196,7 @@
valueType: "Binding",
type: fieldType,
id: generate(),
+ value: fieldType == "array" ? [] : null,
},
]
}
@@ -275,7 +282,7 @@
disabled={rule.constraint === "required"}
on:change={e => (rule.value = e.detail)}
/>
- {:else if ["maxLength", "minLength", "regex", "notRegex", "contains", "notContains"].includes(rule.constraint)}
+ {:else if rule.type !== "array" && ["maxLength", "minLength", "regex", "notRegex", "contains", "notContains"].includes(rule.constraint)}
+ {:else if rule.type === "array"}
+