dockview
Version:
Zero dependency layout manager supporting tabs, grids and splitviews with ReactJS support
95 lines • 3.9 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.DockviewPanelApiImpl = void 0;
var events_1 = require("../events");
var gridviewPanelApi_1 = require("./gridviewPanelApi");
var DockviewPanelApiImpl = /** @class */ (function (_super) {
__extends(DockviewPanelApiImpl, _super);
function DockviewPanelApiImpl(panel, group) {
var _this = _super.call(this, panel.id) || this;
_this.panel = panel;
_this._onDidDirtyChange = new events_1.Emitter();
_this.onDidDirtyChange = _this._onDidDirtyChange.event;
_this._onDidTitleChange = new events_1.Emitter();
_this.onDidTitleChange = _this._onDidTitleChange.event;
_this._titleChanged = new events_1.Emitter();
_this.titleChanged = _this._titleChanged.event;
_this._suppressClosableChanged = new events_1.Emitter();
_this.suppressClosableChanged = _this._suppressClosableChanged.event;
_this._group = group;
_this.addDisposables(_this._onDidDirtyChange);
return _this;
}
Object.defineProperty(DockviewPanelApiImpl.prototype, "tryClose", {
get: function () {
return this._interceptor;
},
enumerable: false,
configurable: true
});
Object.defineProperty(DockviewPanelApiImpl.prototype, "title", {
get: function () {
return this.panel.title;
},
enumerable: false,
configurable: true
});
Object.defineProperty(DockviewPanelApiImpl.prototype, "suppressClosable", {
get: function () {
return !!this.panel.suppressClosable;
},
enumerable: false,
configurable: true
});
Object.defineProperty(DockviewPanelApiImpl.prototype, "isGroupActive", {
get: function () {
var _a;
return !!((_a = this.group) === null || _a === void 0 ? void 0 : _a.isActive);
},
enumerable: false,
configurable: true
});
Object.defineProperty(DockviewPanelApiImpl.prototype, "group", {
get: function () {
return this._group;
},
set: function (value) {
this._group = value;
},
enumerable: false,
configurable: true
});
DockviewPanelApiImpl.prototype.setTitle = function (title) {
this._onDidTitleChange.fire({ title: title });
};
DockviewPanelApiImpl.prototype.close = function () {
if (!this.group) {
throw new Error("panel ".concat(this.id, " has no group"));
}
return this.group.model.closePanel(this.panel);
};
DockviewPanelApiImpl.prototype.interceptOnCloseAction = function (interceptor) {
this._interceptor = interceptor;
};
DockviewPanelApiImpl.prototype.dispose = function () {
_super.prototype.dispose.call(this);
};
return DockviewPanelApiImpl;
}(gridviewPanelApi_1.GridviewPanelApiImpl));
exports.DockviewPanelApiImpl = DockviewPanelApiImpl;
//# sourceMappingURL=groupPanelApi.js.map