UNPKG

dockview

Version:

Zero dependency layout manager supporting tabs, grids and splitviews with ReactJS support

56 lines (55 loc) 1.64 kB
import { DefaultTab, WrappedTab } from './components/tab/defaultTab'; export class DefaultGroupPanelView { constructor(renderers) { var _a; this._content = renderers.content; this._tab = new WrappedTab((_a = renderers.tab) !== null && _a !== void 0 ? _a : new DefaultTab()); this._actions = renderers.actions || (this.content.actions ? { element: this.content.actions, dispose: () => { // }, } : undefined); } get content() { return this._content; } get tab() { return this._tab; } get actions() { return this._actions; } init(params) { this.content.init(Object.assign(Object.assign({}, params), { tab: this.tab })); this.tab.init(params); } updateParentGroup(group, isPanelVisible) { // TODO } layout(width, height) { this.content.layout(width, height); } update(event) { this.content.update(event); this.tab.update(event); } toJSON() { return { content: this.content.toJSON(), tab: this.tab.innerRenderer instanceof DefaultTab ? undefined : this.tab.toJSON(), }; } dispose() { var _a; this.content.dispose(); this.tab.dispose(); (_a = this.actions) === null || _a === void 0 ? void 0 : _a.dispose(); } }