Add size option back to forms

This commit is contained in:
Andrew Kingston 2021-08-25 09:53:43 +01:00
parent c0c4b3ba3b
commit 8d4f3c8100
2 changed files with 17 additions and 1 deletions

View File

@ -1725,6 +1725,21 @@
"label": "Custom" "label": "Custom"
} }
}, },
{
"type": "select",
"label": "Size",
"key": "size",
"options": [
{
"label": "Medium",
"value": "spectrum--medium"
}, {
"label": "Large",
"value": "spectrum--large"
}
],
"defaultValue": "spectrum--medium"
},
{ {
"type": "boolean", "type": "boolean",
"label": "Disabled", "label": "Disabled",

View File

@ -7,6 +7,7 @@
export let dataSource export let dataSource
export let disabled = false export let disabled = false
export let initialValues export let initialValues
export let size
const component = getContext("component") const component = getContext("component")
const { styleable, API, Provider, ActionTypes } = getContext("sdk") const { styleable, API, Provider, ActionTypes } = getContext("sdk")
@ -231,7 +232,7 @@
{actions} {actions}
data={{ ...$formState.values, tableId: dataSource?.tableId }} data={{ ...$formState.values, tableId: dataSource?.tableId }}
> >
<div use:styleable={$component.styles}> <div use:styleable={$component.styles} class={size}>
{#if loaded} {#if loaded}
<slot /> <slot />
{/if} {/if}