binding and json changes

This commit is contained in:
Gerard Burns 2024-04-15 06:22:49 +01:00
parent bfa2d53e39
commit 4d2109008b
5 changed files with 16 additions and 5 deletions

View File

@ -1,5 +1,5 @@
<script>
import { BindingProperty, Block, Subject, JSONProperty, Property, Section } from './components'
import { BindingValue, Block, Subject, JSONValue, Property, Section } from './components'
export let schema
export let columnName
@ -63,7 +63,7 @@
{/each}
{:else if schema.type === "json"}
<Property name="Schema">
<JSONProperty
<JSONValue
value={JSON.stringify(schema?.schema ?? {}, null, 2)}
/>
</Property>
@ -73,7 +73,7 @@
value={schema?.formulaType === "dynamic" ? "Dynamic" : "Static"}
/>
<Property name="Formula">
<BindingProperty
<BindingValue
value={schema?.formula}
/>
</Property>

View File

@ -26,6 +26,7 @@
$: isJs = value?.startsWith?.("{{ js ")
</script>
<div class="editor">
<CodeEditor
readonly
readonlyLineNumbers
@ -33,6 +34,12 @@
jsBindingWrapping={isJs}
mode={isJs ? EditorModes.JS :EditorModes.Handlebars}
/>
</div>
<style>
.editor {
border: 1px solid var(--grey-2);
border-radius: 2px;
overflow: hidden;
}
</style>

View File

@ -21,6 +21,7 @@
<style>
.property {
max-width: 100%;
margin-bottom: 5px;
}
.truncate {

View File

@ -1,6 +1,6 @@
export { default as Subject } from "./Subject.svelte"
export { default as Property } from "./Property.svelte"
export { default as JSONProperty } from "./JSONProperty.svelte"
export { default as BindingProperty } from "./BindingProperty.svelte"
export { default as JSONValue } from "./JSONValue.svelte"
export { default as BindingValue } from "./BindingValue.svelte"
export { default as Section } from "./Section.svelte"
export { default as Block } from "./Block.svelte"