"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: Object.getOwnPropertyDescriptor(all, name).get
    });
}
_export(exports, {
    get EDITOR_TYPE () {
        return EDITOR_TYPE;
    },
    get PasswordEditor () {
        return PasswordEditor;
    }
});
const _textEditor = require("../textEditor");
const _autoResize = require("../../utils/autoResize");
const _element = require("../../helpers/dom/element");
const _a11y = require("../../helpers/a11y");
const EDITOR_TYPE = 'password';
class PasswordEditor extends _textEditor.TextEditor {
    static get EDITOR_TYPE() {
        return EDITOR_TYPE;
    }
    createElements() {
        super.createElements();
        this.TEXTAREA = this.hot.rootDocument.createElement('input');
        this.TEXTAREA.setAttribute('type', 'password');
        this.TEXTAREA.setAttribute('data-hot-input', ''); // Makes the element recognizable by Hot as its own component's element.
        this.TEXTAREA.className = 'handsontableInput';
        this.textareaStyle = this.TEXTAREA.style;
        this.textareaStyle.width = 0;
        this.textareaStyle.height = 0;
        (0, _element.empty)(this.TEXTAREA_PARENT);
        this.TEXTAREA.setAttribute(...(0, _a11y.A11Y_TABINDEX)(-1));
        this.TEXTAREA_PARENT.appendChild(this.TEXTAREA);
    }
    constructor(...args){
        super(...args), /**
   * Autoresize instance for resizing the editor to the size of the entered text. Its overwrites the default
   * resizer of the TextEditor.
   *
   * @private
   * @type {Function}
   */ this.autoResize = (0, _autoResize.createInputElementResizer)(this.hot.rootDocument, {
            textContent: (element)=>'•'.repeat(element.value.length)
        });
    }
}
