dockview-solid
Version:
Zero dependency layout manager supporting tabs, grids and splitviews
36 lines (35 loc) • 1.05 kB
JavaScript
import { SolidPart } from '../solid';
/**
* SolidJS implementation of pane panel section for Dockview paneview integration.
*/
export class SolidPanePanelSection {
constructor(id, componentFn) {
this.id = id;
this.componentFn = componentFn;
this.element = document.createElement('div');
this.element.style.height = '100%';
this.element.style.width = '100%';
}
init(parameters) {
const { params, api, title, containerApi } = parameters;
const adaptedApi = api;
const adaptedParams = {
params,
api: adaptedApi,
title,
containerApi,
};
this.part = new SolidPart(this.element, this.componentFn, adaptedParams);
}
toJSON() {
return { id: this.id };
}
update(event) {
var _a;
(_a = this.part) === null || _a === void 0 ? void 0 : _a.update(event.params);
}
dispose() {
var _a;
(_a = this.part) === null || _a === void 0 ? void 0 : _a.dispose();
}
}