"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BasePanel = void 0;
var aurelia_framework_1 = require("aurelia-framework");
var ui_internal_1 = require("../../utils/ui-internal");
var BasePanel = (function () {
    function BasePanel() {
        this.pinned = false;
        this.expanded = false;
        this.collapsed = false;
        this.closeable = false;
        this.expandable = false;
        this.collapsible = false;
    }
    BasePanel.prototype.close = function () {
        var _this = this;
        return ui_internal_1.UIInternal.fireCallbackEvent(this, "beforeclose").then(function (b) { return (b ? _this.remove() : false); });
    };
    BasePanel.prototype.bind = function () {
        this.closeable = !isFalse(this.closeable);
        this.expandable = !isFalse(this.expandable);
        this.collapsible = !isFalse(this.collapsible);
    };
    BasePanel.prototype.toggleExpand = function (expand) {
        this.expanded = expand;
        this.element.dispatchEvent(ui_internal_1.UIInternal.createEvent("expand", this.expanded));
    };
    BasePanel.prototype.toggleCollapse = function (collapse) {
        this.collapsed = collapse;
    };
    BasePanel.prototype.remove = function () {
        var _this = this;
        this.element.dispatchEvent(ui_internal_1.UIInternal.createEvent("close"));
        ui_internal_1.UIInternal.queueTask(function () { return aurelia_framework_1.DOM.removeNode(_this.element); });
        return true;
    };
    return BasePanel;
}());
exports.BasePanel = BasePanel;

//# sourceMappingURL=base-panel.js.map
