|
|
|
@ -21,42 +21,51 @@ |
|
|
|
} |
|
|
|
|
|
|
|
$: ({ instance, context } = groupBy("type", bindableProperties)) |
|
|
|
$: hasBindableProperties = !!bindableProperties?.length |
|
|
|
</script> |
|
|
|
|
|
|
|
<div class="container" data-cy="binding-dropdown-modal"> |
|
|
|
<div class="list"> |
|
|
|
<Heading extraSmall>Objects</Heading> |
|
|
|
<Spacer medium /> |
|
|
|
{#if context} |
|
|
|
<Heading extraSmall>Tables</Heading> |
|
|
|
<ul> |
|
|
|
{#each context as { readableBinding }} |
|
|
|
<li on:click={() => addToText(readableBinding)}>{readableBinding}</li> |
|
|
|
{/each} |
|
|
|
</ul> |
|
|
|
{/if} |
|
|
|
{#if instance} |
|
|
|
<Heading extraSmall>Components</Heading> |
|
|
|
<ul> |
|
|
|
{#each instance as { readableBinding }} |
|
|
|
<li on:click={() => addToText(readableBinding)}>{readableBinding}</li> |
|
|
|
{/each} |
|
|
|
</ul> |
|
|
|
{#if hasBindableProperties} |
|
|
|
{#if context} |
|
|
|
<Heading extraSmall>Contexts</Heading> |
|
|
|
<Spacer small /> |
|
|
|
<ul> |
|
|
|
{#each context as { readableBinding }} |
|
|
|
<li on:click={() => addToText(readableBinding)}> |
|
|
|
{readableBinding} |
|
|
|
</li> |
|
|
|
{/each} |
|
|
|
</ul> |
|
|
|
{/if} |
|
|
|
{#if instance} |
|
|
|
<Spacer medium /> |
|
|
|
<Heading extraSmall>Components</Heading> |
|
|
|
<Spacer small /> |
|
|
|
<ul> |
|
|
|
{#each instance as { readableBinding }} |
|
|
|
<li on:click={() => addToText(readableBinding)}> |
|
|
|
{readableBinding} |
|
|
|
</li> |
|
|
|
{/each} |
|
|
|
</ul> |
|
|
|
{/if} |
|
|
|
{:else} |
|
|
|
<div class="empty">There aren't any bindable properties available.</div> |
|
|
|
{/if} |
|
|
|
</div> |
|
|
|
<div class="text"> |
|
|
|
<Heading extraSmall>Data binding</Heading> |
|
|
|
<Heading extraSmall>Data Binding</Heading> |
|
|
|
<Spacer small /> |
|
|
|
<Body extraSmall lh> |
|
|
|
Binding connects one piece of data to another and makes it dynamic. Click |
|
|
|
the objects on the left, to add them to the textbox. |
|
|
|
the objects on the left to add them to the extbox. |
|
|
|
</Body> |
|
|
|
<Spacer large /> |
|
|
|
<TextArea |
|
|
|
thin |
|
|
|
bind:value |
|
|
|
placeholder="Add text, or click the objects on the left to add them to the |
|
|
|
textbox." /> |
|
|
|
placeholder="Add text, or click the objects on the left to add them to the textbox." /> |
|
|
|
<div class="controls"> |
|
|
|
<a href="https://docs.budibase.com/design/binding"> |
|
|
|
<Body small grey>Learn more about binding</Body> |
|
|
|
@ -84,9 +93,11 @@ |
|
|
|
grid-template-columns: 1fr auto auto; |
|
|
|
} |
|
|
|
.list { |
|
|
|
width: 150px; |
|
|
|
width: 200px; |
|
|
|
border-right: 1.5px solid var(--grey-4); |
|
|
|
padding: var(--spacing-xl); |
|
|
|
max-height: 300px; |
|
|
|
overflow: auto; |
|
|
|
} |
|
|
|
.text { |
|
|
|
width: 600px; |
|
|
|
@ -96,9 +107,11 @@ |
|
|
|
.text :global(p) { |
|
|
|
margin: 0; |
|
|
|
} |
|
|
|
.text :global(textarea) { |
|
|
|
min-height: 50px; |
|
|
|
} |
|
|
|
ul { |
|
|
|
list-style: none; |
|
|
|
padding-left: 0; |
|
|
|
margin: 0; |
|
|
|
padding: 0; |
|
|
|
} |
|
|
|
@ -108,7 +121,7 @@ |
|
|
|
font-family: var(--font-sans); |
|
|
|
font-size: var(--font-size-xs); |
|
|
|
color: var(--grey-7); |
|
|
|
padding: var(--spacing-s) 0; |
|
|
|
padding: var(--spacing-xs) 0; |
|
|
|
margin: auto 0px; |
|
|
|
align-items: center; |
|
|
|
cursor: pointer; |
|
|
|
@ -116,10 +129,14 @@ |
|
|
|
|
|
|
|
li:hover { |
|
|
|
color: var(--ink); |
|
|
|
font-weight: 500; |
|
|
|
} |
|
|
|
|
|
|
|
li:active { |
|
|
|
color: var(--blue); |
|
|
|
} |
|
|
|
|
|
|
|
div.empty { |
|
|
|
font-size: var(--font-size-xs); |
|
|
|
color: var(--grey-5); |
|
|
|
} |
|
|
|
</style> |
|
|
|
|