MCPcopy
hub / github.com/mathuo/dockview / Gridview

Class Gridview

packages/dockview-core/src/gridview/gridview.ts:318–1143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

316}
317
318export class Gridview implements IDisposable {
319 readonly element: HTMLElement;
320
321 private _root: BranchNode | undefined;
322 private _locked = false;
323 private _margin = 0;
324 private _maximizedNode:
325 | { leaf: LeafNode; hiddenOnMaximize: LeafNode[] }
326 | undefined = undefined;
327 private readonly disposable: MutableDisposable = new MutableDisposable();
328
329 private readonly _onDidChange = new Emitter<{
330 size?: number;
331 orthogonalSize?: number;
332 }>();
333 readonly onDidChange: Event<{ size?: number; orthogonalSize?: number }> =
334 this._onDidChange.event;
335
336 private readonly _onDidViewVisibilityChange = new Emitter<void>();
337 readonly onDidViewVisibilityChange = this._onDidViewVisibilityChange.event;
338
339 private readonly _onDidMaximizedNodeChange =
340 new Emitter<MaximizedViewChanged>();
341 readonly onDidMaximizedNodeChange = this._onDidMaximizedNodeChange.event;
342
343 public get length(): number {
344 return this._root ? this._root.children.length : 0;
345 }
346
347 public get orientation(): Orientation {
348 return this.root.orientation;
349 }
350
351 public set orientation(orientation: Orientation) {
352 if (this.root.orientation === orientation) {
353 return;
354 }
355
356 const { size, orthogonalSize } = this.root;
357 this.root = flipNode(this.root, orthogonalSize, size);
358 this.root.layout(size, orthogonalSize);
359 }
360
361 get width(): number {
362 return this.root.width;
363 }
364
365 get height(): number {
366 return this.root.height;
367 }
368
369 get minimumWidth(): number {
370 return this.root.minimumWidth;
371 }
372
373 get minimumHeight(): number {
374 return this.root.minimumHeight;
375 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…