UNPKG

dockview-core

Version:

Zero dependency layout manager supporting tabs, groups, grids and splitviews for vanilla TypeScript

71 lines (70 loc) 3.09 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.DockviewFloatingGroupPanel = void 0; var lifecycle_1 = require("../lifecycle"); var DockviewFloatingGroupPanel = /** @class */ (function (_super) { __extends(DockviewFloatingGroupPanel, _super); function DockviewFloatingGroupPanel(group, overlay, /** * The floating window hosts its own gridview so it can hold a nested * splitview layout of groups, not just a single group. */ gridview) { var _this = _super.call(this) || this; _this.overlay = overlay; _this.gridview = gridview; _this._group = group; _this.addDisposables(overlay, { // The gridview owns the floating window's DOM subtree (mounted as // the overlay's content). Disposing it tears down the splitview; // it does NOT dispose the leaf views (groups) — their lifecycle is // owned by the component's `_groups` map. dispose: function () { return _this.gridview.dispose(); }, }); return _this; } Object.defineProperty(DockviewFloatingGroupPanel.prototype, "group", { /** * The window's representative/anchor group. A floating window can host a * nested layout of several groups; the anchor is used for back-compat * single-group APIs and is reassigned if it leaves the window. */ get: function () { return this._group; }, enumerable: false, configurable: true }); /** * Register the dedicated title bar (if any) so anchor reassignment keeps * its drag handle pointed at a group that still lives in this window. */ DockviewFloatingGroupPanel.prototype.setTitleBar = function (titleBar) { this._titleBar = titleBar; }; DockviewFloatingGroupPanel.prototype.setAnchorGroup = function (group) { var _a; this._group = group; (_a = this._titleBar) === null || _a === void 0 ? void 0 : _a.setGroup(group); }; DockviewFloatingGroupPanel.prototype.position = function (bounds) { this.overlay.setBounds(bounds); }; return DockviewFloatingGroupPanel; }(lifecycle_1.CompositeDisposable)); exports.DockviewFloatingGroupPanel = DockviewFloatingGroupPanel;