2021-12-01 18:41:49 +00:00
|
|
|
<div ...attributes>
|
2021-12-17 03:44:29 +00:00
|
|
|
{{#if this.getShowToolbar}}
|
|
|
|
<div data-test-component="json-editor-toolbar">
|
|
|
|
<Toolbar>
|
|
|
|
<label class="is-label" data-test-component="json-editor-title">
|
|
|
|
{{@title}}
|
|
|
|
{{#if @subTitle}}
|
|
|
|
<span class="is-size-9 is-lowercase has-text-grey">({{@subTitle}})</span>
|
|
|
|
{{/if}}
|
|
|
|
</label>
|
|
|
|
<ToolbarActions>
|
|
|
|
{{yield}}
|
|
|
|
<div class="toolbar-separator"></div>
|
|
|
|
<CopyButton
|
|
|
|
class="button is-transparent"
|
|
|
|
@clipboardText={{@value}}
|
|
|
|
@buttonType="button"
|
|
|
|
@success={{action (set-flash-message "Data copied!")}}
|
|
|
|
>
|
|
|
|
<Icon @name="clipboard-copy" aria-label="Copy" />
|
|
|
|
</CopyButton>
|
|
|
|
</ToolbarActions>
|
|
|
|
</Toolbar>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
2022-03-29 16:25:16 +00:00
|
|
|
<div
|
|
|
|
{{code-mirror
|
|
|
|
content=@value
|
|
|
|
extraKeys=@extraKeys
|
|
|
|
gutters=@gutters
|
|
|
|
lineNumbers=(if @readOnly false true)
|
|
|
|
mode=@mode
|
|
|
|
readOnly=@readOnly
|
|
|
|
theme=@theme
|
|
|
|
viewportMarg=@viewportMargin
|
|
|
|
onUpdate=this.onUpdate
|
|
|
|
onFocus=this.onFocus
|
|
|
|
}}
|
|
|
|
class={{if @readOnly "readonly-codemirror"}}
|
|
|
|
data-test-component="code-mirror-modifier"
|
|
|
|
></div>
|
2021-12-01 18:41:49 +00:00
|
|
|
|
2021-12-17 03:44:29 +00:00
|
|
|
{{#if @helpText}}
|
|
|
|
<div class="box is-shadowless is-fullwidth has-short-padding">
|
|
|
|
<p class="sub-text">{{@helpText}}</p>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
2021-12-07 17:05:14 +00:00
|
|
|
</div>
|