dockview
Version:
Zero dependency layout manager supporting tabs, grids and splitviews with ReactJS support
89 lines • 3.52 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReactPanelContentPart = void 0;
var react_1 = require("../react");
var events_1 = require("../../events");
var ReactPanelContentPart = /** @class */ (function () {
function ReactPanelContentPart(id, component, reactPortalStore) {
this.id = id;
this.component = component;
this.reactPortalStore = reactPortalStore;
// private hostedContainer: HostedContainer;
this._onDidFocus = new events_1.Emitter();
this.onDidFocus = this._onDidFocus.event;
this._onDidBlur = new events_1.Emitter();
this.onDidBlur = this._onDidBlur.event;
this._element = document.createElement('div');
this._element.style.height = '100%';
this._element.style.width = '100%';
// this.hostedContainer = new HostedContainer({
// id,
// });
// this.hostedContainer.onDidFocus(() => this._onDidFocus.fire());
// this.hostedContainer.onDidBlur(() => this._onDidBlur.fire());
this._actionsElement = document.createElement('div');
this._actionsElement.style.height = '100%';
this._actionsElement.style.width = '100%';
}
Object.defineProperty(ReactPanelContentPart.prototype, "element", {
get: function () {
return this._element;
},
enumerable: false,
configurable: true
});
Object.defineProperty(ReactPanelContentPart.prototype, "actions", {
get: function () {
return this._actionsElement;
},
enumerable: false,
configurable: true
});
ReactPanelContentPart.prototype.focus = function () {
// TODO
};
ReactPanelContentPart.prototype.init = function (parameters) {
var context = {
api: parameters.api,
containerApi: parameters.containerApi,
actionsPortalElement: this._actionsElement,
tabPortalElement: parameters.tab,
};
this.part = new react_1.ReactPart(this.element, this.reactPortalStore, this.component, {
params: parameters.params,
api: parameters.api,
containerApi: parameters.containerApi,
}, context);
};
ReactPanelContentPart.prototype.toJSON = function () {
return {
id: this.id,
};
};
ReactPanelContentPart.prototype.update = function (event) {
var _a;
(_a = this.part) === null || _a === void 0 ? void 0 : _a.update(event.params);
};
ReactPanelContentPart.prototype.updateParentGroup = function (group, isPanelVisible) {
this._group = group;
};
ReactPanelContentPart.prototype.layout = function (width, height) {
// noop
// this.hostedContainer.layout(
// this.element
// // { width, height }
// );
};
ReactPanelContentPart.prototype.close = function () {
return Promise.resolve(true);
};
ReactPanelContentPart.prototype.dispose = function () {
var _a, _b;
(_a = this.part) === null || _a === void 0 ? void 0 : _a.dispose();
// this.hostedContainer?.dispose();
(_b = this.actionsPart) === null || _b === void 0 ? void 0 : _b.dispose();
};
return ReactPanelContentPart;
}());
exports.ReactPanelContentPart = ReactPanelContentPart;
//# sourceMappingURL=reactContentPart.js.map