wip: fixes a couple of drawers

This commit is contained in:
Keviin Åberg Kultalahti 2021-04-22 16:34:18 +02:00
parent 77bbb440cb
commit e03d49ce53
3 changed files with 27 additions and 43 deletions

View File

@ -40,9 +40,9 @@
<Heading xs>{title}</Heading> <Heading xs>{title}</Heading>
<Body xxs><slot name="description" /></Body> <Body xxs><slot name="description" /></Body>
</div> </div>
<div class="controls"> <div class="buttons">
<slot name="buttons" /> <slot name="buttons" />
<ActionButton quiet icon="Close" on:click={hide} /> <ActionButton selected quiet icon="Close" on:click={hide} />
</div> </div>
</header> </header>
<slot name="body" /> <slot name="body" />
@ -66,22 +66,17 @@
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
border-bottom: var(--border-light); border-bottom: var(--border-light);
padding: 0 var(--spectrum-alias-item-padding-s) ; padding: var(--spectrum-alias-item-padding-s) 0;
} }
header :global(*) + :global(*) { header :global(*) + :global(*) {
margin: var(--spectrum-alias-grid-baseline); margin: 0 var(--spectrum-alias-grid-baseline);
} }
.controls {
display: grid;
grid-auto-flow: column;
grid-gap: var(--spectrum-alias-item-padding-s);
align-items: center;
}
.text { .text {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
margin-left: var(--spectrum-alias-item-padding-s);
} }
</style> </style>

View File

@ -1,5 +1,5 @@
<script> <script>
import { Icon, Input, Drawer, Body, Button } from "@budibase/bbui" import { Icon, Input, Drawer, Button } from "@budibase/bbui"
import { import {
readableToRuntimeBinding, readableToRuntimeBinding,
runtimeToReadableBinding, runtimeToReadableBinding,
@ -10,7 +10,6 @@
export let panel = BindingPanel export let panel = BindingPanel
export let value = "" export let value = ""
export let bindings = [] export let bindings = []
export let thin = true
export let title = "Bindings" export let title = "Bindings"
export let placeholder export let placeholder
export let label export let label
@ -41,22 +40,17 @@
</div> </div>
</div> </div>
<Drawer bind:this={bindingDrawer} {title}> <Drawer bind:this={bindingDrawer} {title}>
<div slot="description"> <svelte:fragment slot="description">
<Body extraSmall grey>
Add the objects on the left to enrich your text. Add the objects on the left to enrich your text.
</Body> </svelte:fragment>
</div> <Button cta slot="buttons" on:click={handleClose}>Save</Button>
<heading slot="buttons">
<Button thin blue on:click={handleClose}>Save</Button>
</heading>
<div slot="body">
<svelte:component <svelte:component
slot="body"
this={panel} this={panel}
value={readableValue} value={readableValue}
close={handleClose} close={handleClose}
on:update={event => (tempValue = event.detail)} on:update={event => (tempValue = event.detail)}
bindableProperties={bindings} /> bindableProperties={bindings} />
</div>
</Drawer> </Drawer>
<style> <style>

View File

@ -90,22 +90,17 @@
<Icon s name="FlashOn" /> <Icon s name="FlashOn" />
</div> </div>
<Drawer bind:this={bindingDrawer} title={capitalise(key)}> <Drawer bind:this={bindingDrawer} title={capitalise(key)}>
<div slot="description"> <svelte:fragment slot="description">
<Body extraSmall grey>
Add the objects on the left to enrich your text. Add the objects on the left to enrich your text.
</Body> </svelte:fragment>
</div> <Button cta slot="buttons" disabled={!valid} on:click={handleClose}>Save</Button>
<heading slot="buttons">
<Button thin blue disabled={!valid} on:click={handleClose}>Save</Button>
</heading>
<div slot="body">
<BindingPanel <BindingPanel
slot="body"
bind:valid bind:valid
value={safeValue} value={safeValue}
close={handleClose} close={handleClose}
on:update={e => (temporaryBindableValue = e.detail)} on:update={e => (temporaryBindableValue = e.detail)}
{bindableProperties} /> {bindableProperties} />
</div>
</Drawer> </Drawer>
{/if} {/if}
</div> </div>