import * as tslib_1 from "tslib";
import ADialog from './ADialog';
import { cssClass } from '../../styles';
/** @internal */
var RenameDialog = /** @class */ (function (_super) {
    tslib_1.__extends(RenameDialog, _super);
    function RenameDialog(column, dialog) {
        var _this = _super.call(this, dialog, {
            fullDialog: true
        }) || this;
        _this.column = column;
        _this.before = column.getMetaData();
        return _this;
    }
    RenameDialog.prototype.build = function (node) {
        node.classList.add(cssClass('dialog-rename'));
        node.insertAdjacentHTML('beforeend', "\n      <input type=\"text\" value=\"" + this.column.label + "\" required autofocus placeholder=\"name\">\n      <textarea class=\"" + cssClass('textarea') + "\" rows=\"5\" placeholder=\"description\">" + this.column.description + "</textarea>");
    };
    RenameDialog.prototype.reset = function () {
        this.findInput('input[type="text"]').value = this.before.label;
        this.node.querySelector('textarea').value = this.before.description;
        this.column.setMetaData(this.before);
    };
    RenameDialog.prototype.submit = function () {
        var newValue = this.findInput('input[type="text"]').value;
        var newDescription = this.node.querySelector('textarea').value;
        this.column.setMetaData({ label: newValue, description: newDescription });
        return true;
    };
    return RenameDialog;
}(ADialog));
export default RenameDialog;
//# sourceMappingURL=RenameDialog.js.map