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