@blinkk/selective-edit
Version:
Selective structured text editor.
28 lines • 1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ColorField = 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 ColorField 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="color"
id="${this.uid}"
@blur=${this.handleBlur.bind(this)}
@input=${this.handleInput.bind(this)}
value=${value}
/>
</div>
${this.templateErrors(editor, data)}`;
}
}
exports.ColorField = ColorField;
//# sourceMappingURL=color.js.map