UNPKG

@blinkk/selective-edit

Version:
31 lines 1.18 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TextareaField = void 0; const field_1 = require("../field"); const lit_html_1 = require("lit-html"); const class_map_js_1 = require("lit-html/directives/class-map.js"); class TextareaField extends field_1.Field { constructor(types, config, globalConfig, fieldType = 'textarea') { super(types, config, globalConfig, fieldType); this.config = config; } templateInput(editor, data) { const value = this.currentValue || ''; return (0, lit_html_1.html) ` ${this.templateHelp(editor, data)} <div class=${(0, class_map_js_1.classMap)(this.classesForInput())}> <textarea id=${this.uid} rows=${this.config.rows || 6} placeholder=${this.config.placeholder || ''} @blur=${this.handleBlur.bind(this)} @input=${this.handleInput.bind(this)} wrap=${this.config.wrap === undefined ? 'soft' : this.config.wrap} > ${value}</textarea > </div> ${this.templateErrors(editor, data)}`; } } exports.TextareaField = TextareaField; //# sourceMappingURL=textarea.js.map