UNPKG

dockview

Version:

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

21 lines (20 loc) 647 B
export class DefaultDeserializer { constructor(layout, panelDeserializer) { this.layout = layout; this.panelDeserializer = panelDeserializer; } fromJSON(node) { const children = node.data.views; const active = node.data.activeView; const panels = []; for (const child of children) { const panel = this.panelDeserializer.createPanel(child); panels.push(panel); } return this.layout.createGroup({ panels, activePanel: panels.find((p) => p.id === active), id: node.data.id, }); } }