web: re-format with prettier
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
@ -1,4 +1,12 @@
|
||||
import { css, CSSResult, customElement, html, LitElement, property, TemplateResult } from "lit-element";
|
||||
import {
|
||||
css,
|
||||
CSSResult,
|
||||
customElement,
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
|
||||
import CodeMirror from "codemirror";
|
||||
import "codemirror/addon/display/autorefresh";
|
||||
@ -13,13 +21,13 @@ import "codemirror/mode/python/python.js";
|
||||
import CodeMirrorStyle from "codemirror/lib/codemirror.css";
|
||||
import CodeMirrorTheme from "codemirror/theme/monokai.css";
|
||||
import CodeMirrorDialogStyle from "codemirror/addon/dialog/dialog.css";
|
||||
import CodeMirrorShowHintStyle from "codemirror/addon/hint/show-hint.css";
|
||||
import CodeMirrorShowHintStyle from "codemirror/addon/hint/show-hint.css";
|
||||
import { ifDefined } from "lit-html/directives/if-defined";
|
||||
import YAML from "yaml";
|
||||
|
||||
@customElement("ak-codemirror")
|
||||
export class CodeMirrorTextarea extends LitElement {
|
||||
@property({type: Boolean})
|
||||
@property({ type: Boolean })
|
||||
readOnly = false;
|
||||
|
||||
@property()
|
||||
@ -83,11 +91,17 @@ export class CodeMirrorTextarea extends LitElement {
|
||||
}
|
||||
|
||||
static get styles(): CSSResult[] {
|
||||
return [CodeMirrorStyle, CodeMirrorTheme, CodeMirrorDialogStyle, CodeMirrorShowHintStyle, css`
|
||||
.CodeMirror-wrap pre {
|
||||
word-break: break-word !important;
|
||||
}
|
||||
`];
|
||||
return [
|
||||
CodeMirrorStyle,
|
||||
CodeMirrorTheme,
|
||||
CodeMirrorDialogStyle,
|
||||
CodeMirrorShowHintStyle,
|
||||
css`
|
||||
.CodeMirror-wrap pre {
|
||||
word-break: break-word !important;
|
||||
}
|
||||
`,
|
||||
];
|
||||
}
|
||||
|
||||
firstUpdated(): void {
|
||||
@ -102,7 +116,7 @@ export class CodeMirrorTextarea extends LitElement {
|
||||
readOnly: this.readOnly,
|
||||
autoRefresh: true,
|
||||
lineWrapping: true,
|
||||
value: this._value
|
||||
value: this._value,
|
||||
});
|
||||
this.editor.on("blur", () => {
|
||||
this.editor?.save();
|
||||
|
||||
Reference in New Issue
Block a user