"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const field_1 = require("../../../../../client/field");
const style_1 = require("../../../../../client/style");
class EditableField extends field_1.Field {
    constructor($props, $system) {
        const DEFAULT_STYLE = $system.style['editablefield'];
        super($props, $system, $system.api.document.createElement('div'), {
            valueKey: 'innerText',
            defaultStyle: DEFAULT_STYLE,
            defaultValue: '',
        });
        this.$element.contentEditable = 'true';
        const { flags: { defaultInputModeNone }, } = $system;
        const { style, maxLength, tabIndex } = $props;
        this.$element.spellcheck = false;
        this.$element.autocapitalize = 'off';
        this.$element.inputMode = 'text';
        if (defaultInputModeNone) {
            this.$element.inputMode = 'none';
        }
        if (tabIndex !== undefined) {
            this.$element.tabIndex = tabIndex;
        }
        (0, style_1.applyDynamicStyle)(this, this.$element, { ...DEFAULT_STYLE, ...style });
    }
}
exports.default = EditableField;
//# sourceMappingURL=Component.js.map