dockview
Version:
Zero dependency layout manager supporting tabs, grids and splitviews with ReactJS support
67 lines • 2.53 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReactWatermarkPart = void 0;
var react_1 = require("../react");
var ReactWatermarkPart = /** @class */ (function () {
function ReactWatermarkPart(id, component, reactPortalStore) {
this.id = id;
this.component = component;
this.reactPortalStore = reactPortalStore;
this._groupRef = {
value: undefined,
};
this._element = document.createElement('div');
this._element.style.height = '100%';
this._element.style.width = '100%';
}
Object.defineProperty(ReactWatermarkPart.prototype, "element", {
get: function () {
return this._element;
},
enumerable: false,
configurable: true
});
ReactWatermarkPart.prototype.init = function (parameters) {
var _this = this;
this.parameters = parameters;
this.part = new react_1.ReactPart(this.element, this.reactPortalStore, this.component, {
params: parameters.params,
api: parameters.api,
containerApi: parameters.containerApi,
close: function () {
if (_this._groupRef.value) {
parameters.containerApi.removeGroup(_this._groupRef.value);
}
},
});
};
ReactWatermarkPart.prototype.focus = function () {
// noop
};
ReactWatermarkPart.prototype.update = function (params) {
var _a, _b;
if (this.parameters) {
this.parameters.params = params.params;
}
(_a = this.part) === null || _a === void 0 ? void 0 : _a.update({ params: ((_b = this.parameters) === null || _b === void 0 ? void 0 : _b.params) || {} });
};
ReactWatermarkPart.prototype.toJSON = function () {
return {
id: this.id,
};
};
ReactWatermarkPart.prototype.layout = function (width, height) {
// noop - retrieval from api
};
ReactWatermarkPart.prototype.updateParentGroup = function (group, isPanelVisible) {
// noop - retrieval from api
this._groupRef.value = group;
};
ReactWatermarkPart.prototype.dispose = function () {
var _a;
(_a = this.part) === null || _a === void 0 ? void 0 : _a.dispose();
};
return ReactWatermarkPart;
}());
exports.ReactWatermarkPart = ReactWatermarkPart;
//# sourceMappingURL=reactWatermarkPart.js.map