import * as tslib_1 from "tslib";
import ADialog from './ADialog';
import { cssClass } from '../../styles';
/** @internal */
var ScriptEditDialog = /** @class */ (function (_super) {
    tslib_1.__extends(ScriptEditDialog, _super);
    function ScriptEditDialog(column, dialog) {
        var _this = _super.call(this, dialog, {
            fullDialog: true
        }) || this;
        _this.column = column;
        _this.before = column.getScript();
        return _this;
    }
    ScriptEditDialog.prototype.build = function (node) {
        node.insertAdjacentHTML('beforeend', "<textarea class=\"" + cssClass('textarea') + "\" autofocus=\"true\" rows=\"5\" autofocus=\"autofocus\" style=\"width: 95%;\">" + this.column.getScript() + "</textarea>");
    };
    ScriptEditDialog.prototype.reset = function () {
        this.node.querySelector('textarea').value = this.before;
        this.column.setScript(this.before);
    };
    ScriptEditDialog.prototype.submit = function () {
        this.column.setScript(this.node.querySelector('textarea').value);
        return true;
    };
    return ScriptEditDialog;
}(ADialog));
export default ScriptEditDialog;
//# sourceMappingURL=ScriptEditDialog.js.map