Merge pull request #11481 from Budibase/budi-6298-change-form-step-should-support-bindings

Change form step should support bindings
This commit is contained in:
Andrew Kingston 2023-08-11 07:51:58 +01:00 committed by GitHub
commit 34755dfc19
3 changed files with 11 additions and 3 deletions

View File

@ -1,10 +1,12 @@
<script> <script>
import { Select, Label, Stepper } from "@budibase/bbui" import { Select, Label } from "@budibase/bbui"
import { currentAsset, store } from "builderStore" import { currentAsset, store } from "builderStore"
import { getActionProviderComponents } from "builderStore/dataBinding" import { getActionProviderComponents } from "builderStore/dataBinding"
import { onMount } from "svelte" import { onMount } from "svelte"
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
export let parameters export let parameters
export let bindings = []
$: actionProviders = getActionProviderComponents( $: actionProviders = getActionProviderComponents(
$currentAsset, $currentAsset,
@ -51,7 +53,11 @@
<Select bind:value={parameters.type} options={typeOptions} /> <Select bind:value={parameters.type} options={typeOptions} />
{#if parameters.type === "specific"} {#if parameters.type === "specific"}
<Label small>Number</Label> <Label small>Number</Label>
<Stepper bind:value={parameters.number} /> <DrawerBindableInput
{bindings}
value={parameters.number}
on:change={e => (parameters.number = e.detail)}
/>
{/if} {/if}
</div> </div>

View File

@ -2445,6 +2445,7 @@
"name": "Form Step", "name": "Form Step",
"icon": "AssetsAdded", "icon": "AssetsAdded",
"hasChildren": true, "hasChildren": true,
"requiredAncestors": ["form"],
"illegalChildren": ["section", "form", "formstep", "formblock"], "illegalChildren": ["section", "form", "formstep", "formblock"],
"styles": ["size"], "styles": ["size"],
"size": { "size": {
@ -2464,6 +2465,7 @@
"fieldgroup": { "fieldgroup": {
"name": "Field Group", "name": "Field Group",
"icon": "Group", "icon": "Group",
"requiredAncestors": ["form"],
"illegalChildren": ["section"], "illegalChildren": ["section"],
"styles": ["size"], "styles": ["size"],
"hasChildren": true, "hasChildren": true,

View File

@ -250,7 +250,7 @@
} else if (type === "first") { } else if (type === "first") {
currentStep.set(1) currentStep.set(1)
} else if (type === "specific" && number && !isNaN(number)) { } else if (type === "specific" && number && !isNaN(number)) {
currentStep.set(number) currentStep.set(parseInt(number))
} }
}, },
setStep: step => { setStep: step => {