|
|
@ -1,6 +1,14 @@ |
|
|
<script> |
|
|
<script> |
|
|
import groupBy from "lodash/fp/groupBy" |
|
|
import groupBy from "lodash/fp/groupBy" |
|
|
import { Search, TextArea, DrawerContent, Tabs, Tab } from "@budibase/bbui" |
|
|
import { |
|
|
|
|
|
Search, |
|
|
|
|
|
TextArea, |
|
|
|
|
|
DrawerContent, |
|
|
|
|
|
Tabs, |
|
|
|
|
|
Tab, |
|
|
|
|
|
Body, |
|
|
|
|
|
Layout, |
|
|
|
|
|
} from "@budibase/bbui" |
|
|
import { createEventDispatcher } from "svelte" |
|
|
import { createEventDispatcher } from "svelte" |
|
|
import { |
|
|
import { |
|
|
isValid, |
|
|
isValid, |
|
|
@ -17,7 +25,7 @@ |
|
|
export let bindableProperties |
|
|
export let bindableProperties |
|
|
export let value = "" |
|
|
export let value = "" |
|
|
export let valid |
|
|
export let valid |
|
|
export let allowJS = true |
|
|
export let allowJS = false |
|
|
|
|
|
|
|
|
let helpers = handlebarsCompletions() |
|
|
let helpers = handlebarsCompletions() |
|
|
let getCaretPosition |
|
|
let getCaretPosition |
|
|
@ -138,13 +146,19 @@ |
|
|
{#if allowJS} |
|
|
{#if allowJS} |
|
|
<Tab title="JavaScript"> |
|
|
<Tab title="JavaScript"> |
|
|
<div class="main-content"> |
|
|
<div class="main-content"> |
|
|
<CodeMirrorEditor |
|
|
<Layout noPadding gap="XS"> |
|
|
bind:getCaretPosition |
|
|
<CodeMirrorEditor |
|
|
height={200} |
|
|
bind:getCaretPosition |
|
|
value={decodeJSBinding(jsValue)} |
|
|
height={200} |
|
|
on:change={onChangeJSValue} |
|
|
value={decodeJSBinding(jsValue)} |
|
|
hints={context?.map(x => `$("${x.readableBinding}")`)} |
|
|
on:change={onChangeJSValue} |
|
|
/> |
|
|
hints={context?.map(x => `$("${x.readableBinding}")`)} |
|
|
|
|
|
/> |
|
|
|
|
|
<Body size="S"> |
|
|
|
|
|
JavaScript expressions are executed as functions, so ensure that |
|
|
|
|
|
your expression returns a value. |
|
|
|
|
|
</Body> |
|
|
|
|
|
</Layout> |
|
|
</div> |
|
|
</div> |
|
|
</Tab> |
|
|
</Tab> |
|
|
{/if} |
|
|
{/if} |
|
|
|