1
0
Fork 0
mirror of synced 2024-07-08 07:46:10 +12:00

Remove spacer

This commit is contained in:
Keviin Åberg Kultalahti 2021-04-28 15:36:45 +02:00
parent 7a05536319
commit be01d0dbea
2 changed files with 13 additions and 12 deletions

View file

@ -134,7 +134,7 @@
editor = CodeMirror.fromTextArea(refs.editor, opts) editor = CodeMirror.fromTextArea(refs.editor, opts)
editor.on("change", instance => { editor.on("change", (instance) => {
if (!updating_externally) { if (!updating_externally) {
const value = instance.getValue() const value = instance.getValue()
dispatch("change", { value }) dispatch("change", { value })
@ -160,13 +160,12 @@
} }
function sleep(ms) { function sleep(ms) {
return new Promise(fulfil => setTimeout(fulfil, ms)) return new Promise((fulfil) => setTimeout(fulfil, ms))
} }
</script> </script>
{#if label} {#if label}
<Label small>{label}</Label> <Label small>{label}</Label>
<Spacer medium />
{/if} {/if}
<div style={`--code-mirror-height: ${editorHeight}px`}> <div style={`--code-mirror-height: ${editorHeight}px`}>
<textarea tabindex="0" bind:this={refs.editor} readonly {value} /> <textarea tabindex="0" bind:this={refs.editor} readonly {value} />

View file

@ -1,5 +1,5 @@
<script> <script>
import { Label, Spacer, Input } from "@budibase/bbui" import { Label, Layout, Input } from "@budibase/bbui"
import Editor from "./QueryEditor.svelte" import Editor from "./QueryEditor.svelte"
import KeyValueBuilder from "./KeyValueBuilder.svelte" import KeyValueBuilder from "./KeyValueBuilder.svelte"
@ -15,22 +15,22 @@
</script> </script>
<form on:submit|preventDefault> <form on:submit|preventDefault>
<div class="field"> <Layout noPadding gap="S">
{#each schemaKeys as field} {#each schemaKeys as field}
{#if schema.fields[field]?.type === 'object'} {#if schema.fields[field]?.type === "object"}
<div> <div>
<Label small>{field}</Label> <Label small>{field}</Label>
<Spacer small />
<KeyValueBuilder readOnly={!editable} bind:object={fields[field]} /> <KeyValueBuilder readOnly={!editable} bind:object={fields[field]} />
</div> </div>
{:else if schema.fields[field]?.type === 'json'} {:else if schema.fields[field]?.type === "json"}
<div> <div>
<Label extraSmall grey>{field}</Label> <Label extraSmall grey>{field}</Label>
<Editor <Editor
mode="json" mode="json"
on:change={({ detail }) => (fields[field] = detail.value)} on:change={({ detail }) => (fields[field] = detail.value)}
readOnly={!editable} readOnly={!editable}
value={fields[field]} /> value={fields[field]}
/>
</div> </div>
{:else} {:else}
<div class="horizontal"> <div class="horizontal">
@ -41,11 +41,12 @@
disabled={!editable} disabled={!editable}
type={schema.fields[field]?.type} type={schema.fields[field]?.type}
required={schema.fields[field]?.required} required={schema.fields[field]?.required}
bind:value={fields[field]} /> bind:value={fields[field]}
/>
</div> </div>
{/if} {/if}
{/each} {/each}
</div> </Layout>
</form> </form>
{#if schema.customisable} {#if schema.customisable}
<Editor <Editor
@ -53,7 +54,8 @@
mode="json" mode="json"
on:change={updateCustomFields} on:change={updateCustomFields}
readOnly={!editable} readOnly={!editable}
value={fields.customData} /> value={fields.customData}
/>
{/if} {/if}
<style> <style>