Use multiselect for options fields in conditions using the 'in' operator
This commit is contained in:
parent
98d55db959
commit
dbe321155f
|
@ -9,6 +9,7 @@
|
||||||
Icon,
|
Icon,
|
||||||
DatePicker,
|
DatePicker,
|
||||||
Combobox,
|
Combobox,
|
||||||
|
Multiselect,
|
||||||
} from "@budibase/bbui"
|
} from "@budibase/bbui"
|
||||||
import { createEventDispatcher } from "svelte"
|
import { createEventDispatcher } from "svelte"
|
||||||
import { cloneDeep } from "lodash"
|
import { cloneDeep } from "lodash"
|
||||||
|
@ -116,7 +117,7 @@
|
||||||
Constants.OperatorOptions.NotEmpty.value,
|
Constants.OperatorOptions.NotEmpty.value,
|
||||||
]
|
]
|
||||||
condition.noValue = noValueOptions.includes(newOperator)
|
condition.noValue = noValueOptions.includes(newOperator)
|
||||||
if (condition.noValue || newOperator === "oneOf") {
|
if (condition.noValue) {
|
||||||
condition.referenceValue = null
|
condition.referenceValue = null
|
||||||
condition.valueType = "string"
|
condition.valueType = "string"
|
||||||
}
|
}
|
||||||
|
@ -202,8 +203,7 @@
|
||||||
/>
|
/>
|
||||||
{#if hasValueOption}
|
{#if hasValueOption}
|
||||||
<Select
|
<Select
|
||||||
disabled={condition.noValue ||
|
disabled={condition.noValue}
|
||||||
condition.operator === "oneOf"}
|
|
||||||
options={valueTypeOptions}
|
options={valueTypeOptions}
|
||||||
bind:value={condition.valueType}
|
bind:value={condition.valueType}
|
||||||
placeholder={null}
|
placeholder={null}
|
||||||
|
@ -224,12 +224,23 @@
|
||||||
bind:value={condition.referenceValue}
|
bind:value={condition.referenceValue}
|
||||||
/>
|
/>
|
||||||
{:else if (type === FieldType.OPTIONS || type === FieldType.ARRAY) && condition.valueType === type}
|
{:else if (type === FieldType.OPTIONS || type === FieldType.ARRAY) && condition.valueType === type}
|
||||||
<Combobox
|
{#if condition.operator === Constants.OperatorOptions.In.value}
|
||||||
disabled={condition.noValue}
|
<Multiselect
|
||||||
options={componentInstance.schema?.[componentInstance.field]
|
disabled={condition.noValue}
|
||||||
?.constraints?.inclusion || []}
|
options={componentInstance.schema?.[
|
||||||
bind:value={condition.referenceValue}
|
componentInstance.field
|
||||||
/>
|
]?.constraints?.inclusion || []}
|
||||||
|
bind:value={condition.referenceValue}
|
||||||
|
/>
|
||||||
|
{:else}
|
||||||
|
<Combobox
|
||||||
|
disabled={condition.noValue}
|
||||||
|
options={componentInstance.schema?.[
|
||||||
|
componentInstance.field
|
||||||
|
]?.constraints?.inclusion || []}
|
||||||
|
bind:value={condition.referenceValue}
|
||||||
|
/>
|
||||||
|
{/if}
|
||||||
{:else if (type === FieldType.BB_REFERENCE || type === FieldType.BB_REFERENCE_SINGLE) && condition.valueType === type}
|
{:else if (type === FieldType.BB_REFERENCE || type === FieldType.BB_REFERENCE_SINGLE) && condition.valueType === type}
|
||||||
<FilterUsers
|
<FilterUsers
|
||||||
bind:value={condition.referenceValue}
|
bind:value={condition.referenceValue}
|
||||||
|
|
Loading…
Reference in New Issue