"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DEFAULT_STYLE = void 0;
const field_1 = require("../../../../../client/field");
exports.DEFAULT_STYLE = {
    height: 'fit-content',
    width: '100%',
    color: 'inherit',
    backgroundColor: '#00000000',
    padding: '0',
    fontSize: '18px',
    // outlineColor: '#00000000',
    border: 'none',
    borderRadius: '0',
};
class TextField extends field_1.Field {
    constructor($props, $system) {
        super($props, $system, $system.api.document.createElement('input'), {
            valueKey: 'value',
            defaultStyle: exports.DEFAULT_STYLE,
            defaultValue: '',
        });
        const { flags: { defaultInputModeNone }, } = $system;
        const { maxLength, tabIndex } = $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