"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const field_1 = require("../../../../../client/field");
class TextField extends field_1.Field {
    constructor($props, $system) {
        const DEFAULT_STYLE = $system.style['textfield'];
        super($props, $system, $system.api.document.createElement('input'), {
            valueKey: 'value',
            defaultStyle: DEFAULT_STYLE,
            defaultValue: '',
        });
        const { flags: { defaultInputModeNone }, } = $system;
        const { maxLength, tabIndex, attr } = $props;
        this.$element.type = 'text';
        this.$element.spellcheck = false;
        this.$element.autocomplete = 'off';
        // this.$element.autocomplete = 'disabled'
        // this.$element.autocorrect = 'off'
        this.$element.autocapitalize = 'off';
        this.$element.inputMode = 'text';
        // this.$element.autofocus = false
        if (defaultInputModeNone) {
            this.$element.inputMode = 'none';
        }
        if (maxLength !== undefined) {
            this.$element.maxLength = maxLength;
        }
        if (tabIndex !== undefined) {
            this.$element.tabIndex = tabIndex;
        }
    }
    setSelectionRange(start, end, direction) {
        this.$element.setSelectionRange(start, end, direction);
    }
}
exports.default = TextField;
//# sourceMappingURL=Component.js.map