Add options picker for values when configuring conditions on options columns
This commit is contained in:
parent
d774e30a0a
commit
26a552ac5c
|
@ -10,7 +10,6 @@
|
||||||
export let componentBindings
|
export let componentBindings
|
||||||
export let bindings
|
export let bindings
|
||||||
export let parseSettings
|
export let parseSettings
|
||||||
export let disabled
|
|
||||||
|
|
||||||
const draggable = getContext("draggable")
|
const draggable = getContext("draggable")
|
||||||
const dispatch = createEventDispatcher()
|
const dispatch = createEventDispatcher()
|
||||||
|
|
|
@ -108,12 +108,12 @@ const getColumns = ({
|
||||||
createComponent,
|
createComponent,
|
||||||
schema
|
schema
|
||||||
)
|
)
|
||||||
const primary = draggableList.find(
|
const primary = draggableList
|
||||||
entry => entry.field === primaryDisplayColumnName
|
.filter(entry => entry.field === primaryDisplayColumnName)
|
||||||
)
|
.map(instance => ({ ...instance, schema }))[0]
|
||||||
const sortable = draggableList.filter(
|
const sortable = draggableList
|
||||||
entry => entry.field !== primaryDisplayColumnName
|
.filter(entry => entry.field !== primaryDisplayColumnName)
|
||||||
)
|
.map(instance => ({ ...instance, schema }))
|
||||||
|
|
||||||
return {
|
return {
|
||||||
primary,
|
primary,
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
Select,
|
Select,
|
||||||
Icon,
|
Icon,
|
||||||
DatePicker,
|
DatePicker,
|
||||||
|
Combobox,
|
||||||
} from "@budibase/bbui"
|
} from "@budibase/bbui"
|
||||||
import { createEventDispatcher } from "svelte"
|
import { createEventDispatcher } from "svelte"
|
||||||
import { cloneDeep } from "lodash"
|
import { cloneDeep } from "lodash"
|
||||||
|
@ -18,6 +19,8 @@
|
||||||
import { FieldType, FormulaType } from "@budibase/types"
|
import { FieldType, FormulaType } from "@budibase/types"
|
||||||
import { dndzone } from "svelte-dnd-action"
|
import { dndzone } from "svelte-dnd-action"
|
||||||
import { flip } from "svelte/animate"
|
import { flip } from "svelte/animate"
|
||||||
|
import { getDatasourceForProvider } from "dataBinding"
|
||||||
|
import { selectedScreen } from "stores/builder"
|
||||||
|
|
||||||
export let componentInstance
|
export let componentInstance
|
||||||
export let bindings
|
export let bindings
|
||||||
|
@ -62,6 +65,8 @@
|
||||||
// on the page, so adding this ensures formula columns get operators
|
// on the page, so adding this ensures formula columns get operators
|
||||||
formulaType: FormulaType.STATIC,
|
formulaType: FormulaType.STATIC,
|
||||||
})
|
})
|
||||||
|
$: datasource = getDatasourceForProvider($selectedScreen, componentInstance)
|
||||||
|
$: console.log(componentInstance)
|
||||||
|
|
||||||
const getValueTypeOptions = type => {
|
const getValueTypeOptions = type => {
|
||||||
let options = [
|
let options = [
|
||||||
|
@ -222,6 +227,13 @@
|
||||||
options={["True", "False"]}
|
options={["True", "False"]}
|
||||||
bind:value={condition.referenceValue}
|
bind:value={condition.referenceValue}
|
||||||
/>
|
/>
|
||||||
|
{:else if type === FieldType.OPTIONS && condition.valueType === type}
|
||||||
|
<Combobox
|
||||||
|
disabled={condition.noValue}
|
||||||
|
options={componentInstance.schema?.[componentInstance.field]
|
||||||
|
?.constraints?.inclusion || []}
|
||||||
|
bind:value={condition.referenceValue}
|
||||||
|
/>
|
||||||
{:else}
|
{:else}
|
||||||
<DrawerBindableInput
|
<DrawerBindableInput
|
||||||
{bindings}
|
{bindings}
|
||||||
|
|
Loading…
Reference in New Issue