UNPKG

@blinkk/selective-edit

Version:
29 lines 1.05 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TextField = 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 TextField extends field_1.Field { constructor(types, config, globalConfig, fieldType = 'text') { 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())}> <input type="text" id="${this.uid}" placeholder=${this.config.placeholder || ''} @blur=${this.handleBlur.bind(this)} @input=${this.handleInput.bind(this)} value=${value} /> </div> ${this.templateErrors(editor, data)}`; } } exports.TextField = TextField; //# sourceMappingURL=text.js.map