dockview-core 1.16.0 → 1.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/api/component.api.d.ts +6 -4
- package/dist/cjs/dockview/dockviewComponent.js +1 -0
- package/dist/cjs/gridview/baseComponentGridview.d.ts +2 -0
- package/dist/cjs/gridview/baseComponentGridview.js +53 -5
- package/dist/cjs/gridview/gridviewComponent.d.ts +2 -3
- package/dist/cjs/gridview/gridviewComponent.js +1 -0
- package/dist/cjs/paneview/paneviewComponent.d.ts +1 -0
- package/dist/cjs/paneview/paneviewComponent.js +66 -20
- package/dist/cjs/splitview/splitviewComponent.d.ts +4 -4
- package/dist/cjs/splitview/splitviewComponent.js +67 -21
- package/dist/dockview-core.amd.js +51 -8
- package/dist/dockview-core.amd.js.map +1 -1
- package/dist/dockview-core.amd.min.js +2 -2
- package/dist/dockview-core.amd.min.js.map +1 -1
- package/dist/dockview-core.amd.min.noStyle.js +2 -2
- package/dist/dockview-core.amd.min.noStyle.js.map +1 -1
- package/dist/dockview-core.amd.noStyle.js +51 -8
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +51 -8
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +51 -8
- package/dist/dockview-core.esm.js.map +1 -1
- package/dist/dockview-core.esm.min.js +2 -2
- package/dist/dockview-core.esm.min.js.map +1 -1
- package/dist/dockview-core.js +51 -8
- package/dist/dockview-core.js.map +1 -1
- package/dist/dockview-core.min.js +2 -2
- package/dist/dockview-core.min.js.map +1 -1
- package/dist/dockview-core.min.noStyle.js +2 -2
- package/dist/dockview-core.min.noStyle.js.map +1 -1
- package/dist/dockview-core.noStyle.js +51 -8
- package/dist/dockview-core.noStyle.js.map +1 -1
- package/dist/esm/api/component.api.d.ts +6 -4
- package/dist/esm/dockview/dockviewComponent.js +1 -0
- package/dist/esm/gridview/baseComponentGridview.d.ts +2 -0
- package/dist/esm/gridview/baseComponentGridview.js +18 -2
- package/dist/esm/gridview/gridviewComponent.d.ts +2 -3
- package/dist/esm/gridview/gridviewComponent.js +1 -0
- package/dist/esm/paneview/paneviewComponent.d.ts +1 -0
- package/dist/esm/paneview/paneviewComponent.js +17 -3
- package/dist/esm/splitview/splitviewComponent.d.ts +4 -4
- package/dist/esm/splitview/splitviewComponent.js +16 -2
- package/package.json +1 -1
|
@@ -2,11 +2,11 @@ import { FloatingGroupOptions, IDockviewComponent, MovePanelEvent, SerializedDoc
|
|
|
2
2
|
import { AddGroupOptions, AddPanelOptions, DockviewComponentOptions, DockviewDndOverlayEvent, MovementOptions } from '../dockview/options';
|
|
3
3
|
import { Parameters } from '../panel/types';
|
|
4
4
|
import { Direction } from '../gridview/baseComponentGridview';
|
|
5
|
-
import { AddComponentOptions,
|
|
5
|
+
import { AddComponentOptions, IGridviewComponent, SerializedGridviewComponent } from '../gridview/gridviewComponent';
|
|
6
6
|
import { IGridviewPanel } from '../gridview/gridviewPanel';
|
|
7
7
|
import { AddPaneviewComponentOptions, SerializedPaneview, IPaneviewComponent } from '../paneview/paneviewComponent';
|
|
8
8
|
import { IPaneviewPanel } from '../paneview/paneviewPanel';
|
|
9
|
-
import { AddSplitviewComponentOptions, ISplitviewComponent, SerializedSplitview
|
|
9
|
+
import { AddSplitviewComponentOptions, ISplitviewComponent, SerializedSplitview } from '../splitview/splitviewComponent';
|
|
10
10
|
import { IView, Orientation, Sizing } from '../splitview/splitview';
|
|
11
11
|
import { ISplitviewPanel } from '../splitview/splitviewPanel';
|
|
12
12
|
import { DockviewGroupPanel, IDockviewGroupPanel } from '../dockview/dockviewGroupPanel';
|
|
@@ -17,6 +17,8 @@ import { GroupDragEvent, TabDragEvent } from '../dockview/components/titlebar/ta
|
|
|
17
17
|
import { Box } from '../types';
|
|
18
18
|
import { DockviewDidDropEvent, DockviewWillDropEvent, WillShowOverlayLocationEvent } from '../dockview/dockviewGroupPanelModel';
|
|
19
19
|
import { PaneviewComponentOptions } from '../paneview/options';
|
|
20
|
+
import { SplitviewComponentOptions } from '../splitview/options';
|
|
21
|
+
import { GridviewComponentOptions } from '../gridview/options';
|
|
20
22
|
export interface CommonApi<T = any> {
|
|
21
23
|
readonly height: number;
|
|
22
24
|
readonly width: number;
|
|
@@ -115,7 +117,7 @@ export declare class SplitviewApi implements CommonApi<SerializedSplitview> {
|
|
|
115
117
|
/**
|
|
116
118
|
* Update configuratable options.
|
|
117
119
|
*/
|
|
118
|
-
updateOptions(options: Partial<
|
|
120
|
+
updateOptions(options: Partial<SplitviewComponentOptions>): void;
|
|
119
121
|
/**
|
|
120
122
|
* Release resources and teardown component. Do not call when using framework versions of dockview.
|
|
121
123
|
*/
|
|
@@ -305,7 +307,7 @@ export declare class GridviewApi implements CommonApi<SerializedGridviewComponen
|
|
|
305
307
|
* Reset the component back to an empty and default state.
|
|
306
308
|
*/
|
|
307
309
|
clear(): void;
|
|
308
|
-
updateOptions(options: Partial<
|
|
310
|
+
updateOptions(options: Partial<GridviewComponentOptions>): void;
|
|
309
311
|
/**
|
|
310
312
|
* Release resources and teardown component. Do not call when using framework versions of dockview.
|
|
311
313
|
*/
|
|
@@ -732,6 +732,7 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
732
732
|
DockviewComponent.prototype.updateOptions = function (options) {
|
|
733
733
|
var e_3, _a;
|
|
734
734
|
var _b, _c;
|
|
735
|
+
_super.prototype.updateOptions.call(this, options);
|
|
735
736
|
var changed_floatingGroupBounds = 'floatingGroupBounds' in options &&
|
|
736
737
|
options.floatingGroupBounds !== this.options.floatingGroupBounds;
|
|
737
738
|
var changed_rootOverlayOptions = 'rootOverlayModel' in options &&
|
|
@@ -63,6 +63,7 @@ export declare abstract class BaseGrid<T extends IGridPanelView> extends Resizab
|
|
|
63
63
|
readonly onDidLayoutChange: Event<void>;
|
|
64
64
|
private readonly _onDidViewVisibilityChangeMicroTaskQueue;
|
|
65
65
|
readonly onDidViewVisibilityChangeMicroTaskQueue: Event<void>;
|
|
66
|
+
private classNames;
|
|
66
67
|
get id(): string;
|
|
67
68
|
get size(): number;
|
|
68
69
|
get groups(): T[];
|
|
@@ -81,6 +82,7 @@ export declare abstract class BaseGrid<T extends IGridPanelView> extends Resizab
|
|
|
81
82
|
abstract clear(): void;
|
|
82
83
|
setVisible(panel: T, visible: boolean): void;
|
|
83
84
|
isVisible(panel: T): boolean;
|
|
85
|
+
updateOptions(options: Partial<BaseGridOptions>): void;
|
|
84
86
|
maximizeGroup(panel: T): void;
|
|
85
87
|
isMaximizedGroup(panel: T): boolean;
|
|
86
88
|
exitMaximizedGroup(): void;
|
|
@@ -33,6 +33,7 @@ var lifecycle_1 = require("../lifecycle");
|
|
|
33
33
|
var math_1 = require("../math");
|
|
34
34
|
var splitview_1 = require("../splitview/splitview");
|
|
35
35
|
var resizable_1 = require("../resizable");
|
|
36
|
+
var dom_1 = require("../dom");
|
|
36
37
|
var nextLayoutId = (0, math_1.sequentialNumberGenerator)();
|
|
37
38
|
function toTarget(direction) {
|
|
38
39
|
switch (direction) {
|
|
@@ -53,6 +54,8 @@ exports.toTarget = toTarget;
|
|
|
53
54
|
var BaseGrid = /** @class */ (function (_super) {
|
|
54
55
|
__extends(BaseGrid, _super);
|
|
55
56
|
function BaseGrid(options) {
|
|
57
|
+
var e_1, _a;
|
|
58
|
+
var _b, _c;
|
|
56
59
|
var _this = _super.call(this, document.createElement('div'), options.disableAutoResizing) || this;
|
|
57
60
|
_this._id = nextLayoutId.next();
|
|
58
61
|
_this._groups = new Map();
|
|
@@ -66,10 +69,22 @@ var BaseGrid = /** @class */ (function (_super) {
|
|
|
66
69
|
_this.onDidLayoutChange = _this._bufferOnDidLayoutChange.onEvent;
|
|
67
70
|
_this._onDidViewVisibilityChangeMicroTaskQueue = new events_1.AsapEvent();
|
|
68
71
|
_this.onDidViewVisibilityChangeMicroTaskQueue = _this._onDidViewVisibilityChangeMicroTaskQueue.onEvent;
|
|
72
|
+
_this.classNames = [];
|
|
69
73
|
_this.element.style.height = '100%';
|
|
70
74
|
_this.element.style.width = '100%';
|
|
71
|
-
|
|
72
|
-
|
|
75
|
+
_this.classNames = (_c = (_b = options.className) === null || _b === void 0 ? void 0 : _b.split(' ')) !== null && _c !== void 0 ? _c : [];
|
|
76
|
+
try {
|
|
77
|
+
for (var _d = __values(_this.classNames), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
78
|
+
var className = _e.value;
|
|
79
|
+
(0, dom_1.toggleClass)(_this.element, className, true);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
83
|
+
finally {
|
|
84
|
+
try {
|
|
85
|
+
if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
|
|
86
|
+
}
|
|
87
|
+
finally { if (e_1) throw e_1.error; }
|
|
73
88
|
}
|
|
74
89
|
options.parentElement.appendChild(_this.element);
|
|
75
90
|
_this.gridview = new gridview_1.Gridview(!!options.proportionalLayout, options.styles, options.orientation, options.locked, options.margin);
|
|
@@ -177,6 +192,39 @@ var BaseGrid = /** @class */ (function (_super) {
|
|
|
177
192
|
BaseGrid.prototype.isVisible = function (panel) {
|
|
178
193
|
return this.gridview.isViewVisible((0, gridview_1.getGridLocation)(panel.element));
|
|
179
194
|
};
|
|
195
|
+
BaseGrid.prototype.updateOptions = function (options) {
|
|
196
|
+
var e_2, _a, e_3, _b;
|
|
197
|
+
var _c, _d;
|
|
198
|
+
if ('className' in options) {
|
|
199
|
+
try {
|
|
200
|
+
for (var _e = __values(this.classNames), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
201
|
+
var className = _f.value;
|
|
202
|
+
(0, dom_1.toggleClass)(this.element, className, false);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
206
|
+
finally {
|
|
207
|
+
try {
|
|
208
|
+
if (_f && !_f.done && (_a = _e.return)) _a.call(_e);
|
|
209
|
+
}
|
|
210
|
+
finally { if (e_2) throw e_2.error; }
|
|
211
|
+
}
|
|
212
|
+
this.classNames = (_d = (_c = options.className) === null || _c === void 0 ? void 0 : _c.split(' ')) !== null && _d !== void 0 ? _d : [];
|
|
213
|
+
try {
|
|
214
|
+
for (var _g = __values(this.classNames), _h = _g.next(); !_h.done; _h = _g.next()) {
|
|
215
|
+
var className = _h.value;
|
|
216
|
+
(0, dom_1.toggleClass)(this.element, className, true);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
220
|
+
finally {
|
|
221
|
+
try {
|
|
222
|
+
if (_h && !_h.done && (_b = _g.return)) _b.call(_g);
|
|
223
|
+
}
|
|
224
|
+
finally { if (e_3) throw e_3.error; }
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
};
|
|
180
228
|
BaseGrid.prototype.maximizeGroup = function (panel) {
|
|
181
229
|
this.gridview.maximizeView(panel);
|
|
182
230
|
this.doSetGroupActive(panel);
|
|
@@ -280,7 +328,7 @@ var BaseGrid = /** @class */ (function (_super) {
|
|
|
280
328
|
this.gridview.layout(width, height);
|
|
281
329
|
};
|
|
282
330
|
BaseGrid.prototype.dispose = function () {
|
|
283
|
-
var
|
|
331
|
+
var e_4, _a;
|
|
284
332
|
this._onDidActiveChange.dispose();
|
|
285
333
|
this._onDidAdd.dispose();
|
|
286
334
|
this._onDidRemove.dispose();
|
|
@@ -290,12 +338,12 @@ var BaseGrid = /** @class */ (function (_super) {
|
|
|
290
338
|
group.dispose();
|
|
291
339
|
}
|
|
292
340
|
}
|
|
293
|
-
catch (
|
|
341
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
294
342
|
finally {
|
|
295
343
|
try {
|
|
296
344
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
297
345
|
}
|
|
298
|
-
finally { if (
|
|
346
|
+
finally { if (e_4) throw e_4.error; }
|
|
299
347
|
}
|
|
300
348
|
this.gridview.dispose();
|
|
301
349
|
_super.prototype.dispose.call(this);
|
|
@@ -25,11 +25,10 @@ export interface AddComponentOptions<T extends object = Parameters> extends Base
|
|
|
25
25
|
export interface IGridPanelComponentView extends IGridPanelView {
|
|
26
26
|
init: (params: GridviewInitParameters) => void;
|
|
27
27
|
}
|
|
28
|
-
export type GridviewComponentUpdateOptions = Pick<GridviewComponentOptions, 'orientation' | 'components' | 'frameworkComponents'>;
|
|
29
28
|
export interface IGridviewComponent extends IBaseGrid<GridviewPanel> {
|
|
30
29
|
readonly orientation: Orientation;
|
|
31
30
|
readonly onDidLayoutFromJSON: Event<void>;
|
|
32
|
-
updateOptions(options: Partial<
|
|
31
|
+
updateOptions(options: Partial<GridviewComponentOptions>): void;
|
|
33
32
|
addPanel<T extends object = Parameters>(options: AddComponentOptions<T>): IGridviewPanel;
|
|
34
33
|
removePanel(panel: IGridviewPanel, sizing?: Sizing): void;
|
|
35
34
|
focus(): void;
|
|
@@ -63,7 +62,7 @@ export declare class GridviewComponent extends BaseGrid<GridviewPanel> implement
|
|
|
63
62
|
get deserializer(): IPanelDeserializer | undefined;
|
|
64
63
|
set deserializer(value: IPanelDeserializer | undefined);
|
|
65
64
|
constructor(parentElement: HTMLElement, options: GridviewComponentOptions);
|
|
66
|
-
updateOptions(options: Partial<
|
|
65
|
+
updateOptions(options: Partial<GridviewComponentOptions>): void;
|
|
67
66
|
removePanel(panel: GridviewPanel): void;
|
|
68
67
|
/**
|
|
69
68
|
* Serialize the current state of the layout
|
|
@@ -123,6 +123,7 @@ var GridviewComponent = /** @class */ (function (_super) {
|
|
|
123
123
|
configurable: true
|
|
124
124
|
});
|
|
125
125
|
GridviewComponent.prototype.updateOptions = function (options) {
|
|
126
|
+
_super.prototype.updateOptions.call(this, options);
|
|
126
127
|
var hasOrientationChanged = typeof options.orientation === 'string' &&
|
|
127
128
|
this.gridview.orientation !== options.orientation;
|
|
128
129
|
this._options = __assign(__assign({}, this.options), options);
|
|
@@ -103,6 +103,7 @@ export declare class PaneviewComponent extends Resizable implements IPaneviewCom
|
|
|
103
103
|
readonly onDidAddView: Event<PaneviewPanel>;
|
|
104
104
|
private readonly _onDidRemoveView;
|
|
105
105
|
readonly onDidRemoveView: Event<PaneviewPanel>;
|
|
106
|
+
private classNames;
|
|
106
107
|
get id(): string;
|
|
107
108
|
get panels(): PaneviewPanel[];
|
|
108
109
|
set paneview(value: Paneview);
|
|
@@ -25,6 +25,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
25
25
|
};
|
|
26
26
|
return __assign.apply(this, arguments);
|
|
27
27
|
};
|
|
28
|
+
var __values = (this && this.__values) || function(o) {
|
|
29
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
30
|
+
if (m) return m.call(o);
|
|
31
|
+
if (o && typeof o.length === "number") return {
|
|
32
|
+
next: function () {
|
|
33
|
+
if (o && i >= o.length) o = void 0;
|
|
34
|
+
return { value: o && o[i++], done: !o };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
38
|
+
};
|
|
28
39
|
var __read = (this && this.__read) || function (o, n) {
|
|
29
40
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
30
41
|
if (!m) return o;
|
|
@@ -41,17 +52,6 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
41
52
|
}
|
|
42
53
|
return ar;
|
|
43
54
|
};
|
|
44
|
-
var __values = (this && this.__values) || function(o) {
|
|
45
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
46
|
-
if (m) return m.call(o);
|
|
47
|
-
if (o && typeof o.length === "number") return {
|
|
48
|
-
next: function () {
|
|
49
|
-
if (o && i >= o.length) o = void 0;
|
|
50
|
-
return { value: o && o[i++], done: !o };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
54
|
-
};
|
|
55
55
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
56
56
|
exports.PaneviewComponent = exports.PaneFramework = void 0;
|
|
57
57
|
var component_api_1 = require("../api/component.api");
|
|
@@ -64,6 +64,7 @@ var draggablePaneviewPanel_1 = require("./draggablePaneviewPanel");
|
|
|
64
64
|
var defaultPaneviewHeader_1 = require("./defaultPaneviewHeader");
|
|
65
65
|
var math_1 = require("../math");
|
|
66
66
|
var resizable_1 = require("../resizable");
|
|
67
|
+
var dom_1 = require("../dom");
|
|
67
68
|
var nextLayoutId = (0, math_1.sequentialNumberGenerator)();
|
|
68
69
|
var PaneFramework = /** @class */ (function (_super) {
|
|
69
70
|
__extends(PaneFramework, _super);
|
|
@@ -84,6 +85,8 @@ exports.PaneFramework = PaneFramework;
|
|
|
84
85
|
var PaneviewComponent = /** @class */ (function (_super) {
|
|
85
86
|
__extends(PaneviewComponent, _super);
|
|
86
87
|
function PaneviewComponent(parentElement, options) {
|
|
88
|
+
var e_1, _a;
|
|
89
|
+
var _b, _c;
|
|
87
90
|
var _this = _super.call(this, parentElement, options.disableAutoResizing) || this;
|
|
88
91
|
_this._id = nextLayoutId.next();
|
|
89
92
|
_this._disposable = new lifecycle_1.MutableDisposable();
|
|
@@ -98,10 +101,22 @@ var PaneviewComponent = /** @class */ (function (_super) {
|
|
|
98
101
|
_this.onDidAddView = _this._onDidAddView.event;
|
|
99
102
|
_this._onDidRemoveView = new events_1.Emitter();
|
|
100
103
|
_this.onDidRemoveView = _this._onDidRemoveView.event;
|
|
101
|
-
|
|
102
|
-
_this.element.classList.add(options.className);
|
|
103
|
-
}
|
|
104
|
+
_this.classNames = [];
|
|
104
105
|
_this.addDisposables(_this._onDidLayoutChange, _this._onDidLayoutfromJSON, _this._onDidDrop, _this._onDidAddView, _this._onDidRemoveView);
|
|
106
|
+
_this.classNames = (_c = (_b = options.className) === null || _b === void 0 ? void 0 : _b.split(' ')) !== null && _c !== void 0 ? _c : [];
|
|
107
|
+
try {
|
|
108
|
+
for (var _d = __values(_this.classNames), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
109
|
+
var className = _e.value;
|
|
110
|
+
(0, dom_1.toggleClass)(_this.element, className, true);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
114
|
+
finally {
|
|
115
|
+
try {
|
|
116
|
+
if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
|
|
117
|
+
}
|
|
118
|
+
finally { if (e_1) throw e_1.error; }
|
|
119
|
+
}
|
|
105
120
|
_this._options = options;
|
|
106
121
|
if (!options.components) {
|
|
107
122
|
options.components = {};
|
|
@@ -191,6 +206,37 @@ var PaneviewComponent = /** @class */ (function (_super) {
|
|
|
191
206
|
//noop
|
|
192
207
|
};
|
|
193
208
|
PaneviewComponent.prototype.updateOptions = function (options) {
|
|
209
|
+
var e_2, _a, e_3, _b;
|
|
210
|
+
var _c, _d;
|
|
211
|
+
if ('className' in options) {
|
|
212
|
+
try {
|
|
213
|
+
for (var _e = __values(this.classNames), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
214
|
+
var className = _f.value;
|
|
215
|
+
(0, dom_1.toggleClass)(this.element, className, false);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
219
|
+
finally {
|
|
220
|
+
try {
|
|
221
|
+
if (_f && !_f.done && (_a = _e.return)) _a.call(_e);
|
|
222
|
+
}
|
|
223
|
+
finally { if (e_2) throw e_2.error; }
|
|
224
|
+
}
|
|
225
|
+
this.classNames = (_d = (_c = options.className) === null || _c === void 0 ? void 0 : _c.split(' ')) !== null && _d !== void 0 ? _d : [];
|
|
226
|
+
try {
|
|
227
|
+
for (var _g = __values(this.classNames), _h = _g.next(); !_h.done; _h = _g.next()) {
|
|
228
|
+
var className = _h.value;
|
|
229
|
+
(0, dom_1.toggleClass)(this.element, className, true);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
233
|
+
finally {
|
|
234
|
+
try {
|
|
235
|
+
if (_h && !_h.done && (_b = _g.return)) _b.call(_g);
|
|
236
|
+
}
|
|
237
|
+
finally { if (e_3) throw e_3.error; }
|
|
238
|
+
}
|
|
239
|
+
}
|
|
194
240
|
this._options = __assign(__assign({}, this.options), options);
|
|
195
241
|
};
|
|
196
242
|
PaneviewComponent.prototype.addPanel = function (options) {
|
|
@@ -354,19 +400,19 @@ var PaneviewComponent = /** @class */ (function (_super) {
|
|
|
354
400
|
this._onDidLayoutfromJSON.fire();
|
|
355
401
|
};
|
|
356
402
|
PaneviewComponent.prototype.clear = function () {
|
|
357
|
-
var
|
|
403
|
+
var e_4, _a;
|
|
358
404
|
try {
|
|
359
405
|
for (var _b = __values(this._viewDisposables.entries()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
360
406
|
var _d = __read(_c.value, 2), _ = _d[0], value = _d[1];
|
|
361
407
|
value.dispose();
|
|
362
408
|
}
|
|
363
409
|
}
|
|
364
|
-
catch (
|
|
410
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
365
411
|
finally {
|
|
366
412
|
try {
|
|
367
413
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
368
414
|
}
|
|
369
|
-
finally { if (
|
|
415
|
+
finally { if (e_4) throw e_4.error; }
|
|
370
416
|
}
|
|
371
417
|
this._viewDisposables.clear();
|
|
372
418
|
this.paneview.dispose();
|
|
@@ -386,7 +432,7 @@ var PaneviewComponent = /** @class */ (function (_super) {
|
|
|
386
432
|
}
|
|
387
433
|
};
|
|
388
434
|
PaneviewComponent.prototype.dispose = function () {
|
|
389
|
-
var
|
|
435
|
+
var e_5, _a;
|
|
390
436
|
_super.prototype.dispose.call(this);
|
|
391
437
|
try {
|
|
392
438
|
for (var _b = __values(this._viewDisposables.entries()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
@@ -394,12 +440,12 @@ var PaneviewComponent = /** @class */ (function (_super) {
|
|
|
394
440
|
value.dispose();
|
|
395
441
|
}
|
|
396
442
|
}
|
|
397
|
-
catch (
|
|
443
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
398
444
|
finally {
|
|
399
445
|
try {
|
|
400
446
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
401
447
|
}
|
|
402
|
-
finally { if (
|
|
448
|
+
finally { if (e_5) throw e_5.error; }
|
|
403
449
|
}
|
|
404
450
|
this._viewDisposables.clear();
|
|
405
451
|
this.paneview.dispose();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IDisposable } from '../lifecycle';
|
|
2
|
-
import { IView, LayoutPriority, Orientation, Sizing, Splitview } from './splitview';
|
|
2
|
+
import { IView, LayoutPriority, Orientation, Sizing, Splitview, SplitViewOptions } from './splitview';
|
|
3
3
|
import { SplitviewComponentOptions } from './options';
|
|
4
4
|
import { BaseComponentOptions, Parameters } from '../panel/types';
|
|
5
5
|
import { Event } from '../events';
|
|
@@ -31,7 +31,6 @@ export interface AddSplitviewComponentOptions<T extends Parameters = Parameters>
|
|
|
31
31
|
minimumSize?: number;
|
|
32
32
|
maximumSize?: number;
|
|
33
33
|
}
|
|
34
|
-
export type SplitviewComponentUpdateOptions = Pick<SplitviewComponentOptions, 'orientation' | 'components' | 'frameworkComponents'>;
|
|
35
34
|
export interface ISplitviewComponent extends IDisposable {
|
|
36
35
|
readonly minimumSize: number;
|
|
37
36
|
readonly maximumSize: number;
|
|
@@ -43,7 +42,7 @@ export interface ISplitviewComponent extends IDisposable {
|
|
|
43
42
|
readonly onDidRemoveView: Event<IView>;
|
|
44
43
|
readonly onDidLayoutFromJSON: Event<void>;
|
|
45
44
|
readonly panels: SplitviewPanel[];
|
|
46
|
-
updateOptions(options: Partial<
|
|
45
|
+
updateOptions(options: Partial<SplitViewOptions>): void;
|
|
47
46
|
addPanel<T extends object = Parameters>(options: AddSplitviewComponentOptions<T>): ISplitviewPanel;
|
|
48
47
|
layout(width: number, height: number): void;
|
|
49
48
|
onDidLayoutChange: Event<void>;
|
|
@@ -73,6 +72,7 @@ export declare class SplitviewComponent extends Resizable implements ISplitviewC
|
|
|
73
72
|
readonly onDidRemoveView: Event<IView>;
|
|
74
73
|
private readonly _onDidLayoutChange;
|
|
75
74
|
readonly onDidLayoutChange: Event<void>;
|
|
75
|
+
private classNames;
|
|
76
76
|
get panels(): SplitviewPanel[];
|
|
77
77
|
get options(): SplitviewComponentOptions;
|
|
78
78
|
get length(): number;
|
|
@@ -84,7 +84,7 @@ export declare class SplitviewComponent extends Resizable implements ISplitviewC
|
|
|
84
84
|
get height(): number;
|
|
85
85
|
get width(): number;
|
|
86
86
|
constructor(parentElement: HTMLElement, options: SplitviewComponentOptions);
|
|
87
|
-
updateOptions(options: Partial<
|
|
87
|
+
updateOptions(options: Partial<SplitviewComponentOptions>): void;
|
|
88
88
|
focus(): void;
|
|
89
89
|
movePanel(from: number, to: number): void;
|
|
90
90
|
setVisible(panel: SplitviewPanel, visible: boolean): void;
|
|
@@ -25,6 +25,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
25
25
|
};
|
|
26
26
|
return __assign.apply(this, arguments);
|
|
27
27
|
};
|
|
28
|
+
var __values = (this && this.__values) || function(o) {
|
|
29
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
30
|
+
if (m) return m.call(o);
|
|
31
|
+
if (o && typeof o.length === "number") return {
|
|
32
|
+
next: function () {
|
|
33
|
+
if (o && i >= o.length) o = void 0;
|
|
34
|
+
return { value: o && o[i++], done: !o };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
38
|
+
};
|
|
28
39
|
var __read = (this && this.__read) || function (o, n) {
|
|
29
40
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
30
41
|
if (!m) return o;
|
|
@@ -41,17 +52,6 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
41
52
|
}
|
|
42
53
|
return ar;
|
|
43
54
|
};
|
|
44
|
-
var __values = (this && this.__values) || function(o) {
|
|
45
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
46
|
-
if (m) return m.call(o);
|
|
47
|
-
if (o && typeof o.length === "number") return {
|
|
48
|
-
next: function () {
|
|
49
|
-
if (o && i >= o.length) o = void 0;
|
|
50
|
-
return { value: o && o[i++], done: !o };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
54
|
-
};
|
|
55
55
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
56
56
|
exports.SplitviewComponent = void 0;
|
|
57
57
|
var lifecycle_1 = require("../lifecycle");
|
|
@@ -59,12 +59,15 @@ var splitview_1 = require("./splitview");
|
|
|
59
59
|
var events_1 = require("../events");
|
|
60
60
|
var componentFactory_1 = require("../panel/componentFactory");
|
|
61
61
|
var resizable_1 = require("../resizable");
|
|
62
|
+
var dom_1 = require("../dom");
|
|
62
63
|
/**
|
|
63
64
|
* A high-level implementation of splitview that works using 'panels'
|
|
64
65
|
*/
|
|
65
66
|
var SplitviewComponent = /** @class */ (function (_super) {
|
|
66
67
|
__extends(SplitviewComponent, _super);
|
|
67
68
|
function SplitviewComponent(parentElement, options) {
|
|
69
|
+
var e_1, _a;
|
|
70
|
+
var _b, _c;
|
|
68
71
|
var _this = _super.call(this, parentElement, options.disableAutoResizing) || this;
|
|
69
72
|
_this._splitviewChangeDisposable = new lifecycle_1.MutableDisposable();
|
|
70
73
|
_this._panels = new Map();
|
|
@@ -76,8 +79,20 @@ var SplitviewComponent = /** @class */ (function (_super) {
|
|
|
76
79
|
_this.onDidRemoveView = _this._onDidRemoveView.event;
|
|
77
80
|
_this._onDidLayoutChange = new events_1.Emitter();
|
|
78
81
|
_this.onDidLayoutChange = _this._onDidLayoutChange.event;
|
|
79
|
-
|
|
80
|
-
|
|
82
|
+
_this.classNames = [];
|
|
83
|
+
_this.classNames = (_c = (_b = options.className) === null || _b === void 0 ? void 0 : _b.split(' ')) !== null && _c !== void 0 ? _c : [];
|
|
84
|
+
try {
|
|
85
|
+
for (var _d = __values(_this.classNames), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
86
|
+
var className = _e.value;
|
|
87
|
+
(0, dom_1.toggleClass)(_this.element, className, true);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
91
|
+
finally {
|
|
92
|
+
try {
|
|
93
|
+
if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
|
|
94
|
+
}
|
|
95
|
+
finally { if (e_1) throw e_1.error; }
|
|
81
96
|
}
|
|
82
97
|
_this._options = options;
|
|
83
98
|
if (!options.components) {
|
|
@@ -167,6 +182,37 @@ var SplitviewComponent = /** @class */ (function (_super) {
|
|
|
167
182
|
configurable: true
|
|
168
183
|
});
|
|
169
184
|
SplitviewComponent.prototype.updateOptions = function (options) {
|
|
185
|
+
var e_2, _a, e_3, _b;
|
|
186
|
+
var _c, _d;
|
|
187
|
+
if ('className' in options) {
|
|
188
|
+
try {
|
|
189
|
+
for (var _e = __values(this.classNames), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
190
|
+
var className = _f.value;
|
|
191
|
+
(0, dom_1.toggleClass)(this.element, className, false);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
195
|
+
finally {
|
|
196
|
+
try {
|
|
197
|
+
if (_f && !_f.done && (_a = _e.return)) _a.call(_e);
|
|
198
|
+
}
|
|
199
|
+
finally { if (e_2) throw e_2.error; }
|
|
200
|
+
}
|
|
201
|
+
this.classNames = (_d = (_c = options.className) === null || _c === void 0 ? void 0 : _c.split(' ')) !== null && _d !== void 0 ? _d : [];
|
|
202
|
+
try {
|
|
203
|
+
for (var _g = __values(this.classNames), _h = _g.next(); !_h.done; _h = _g.next()) {
|
|
204
|
+
var className = _h.value;
|
|
205
|
+
(0, dom_1.toggleClass)(this.element, className, true);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
209
|
+
finally {
|
|
210
|
+
try {
|
|
211
|
+
if (_h && !_h.done && (_b = _g.return)) _b.call(_g);
|
|
212
|
+
}
|
|
213
|
+
finally { if (e_3) throw e_3.error; }
|
|
214
|
+
}
|
|
215
|
+
}
|
|
170
216
|
var hasOrientationChanged = typeof options.orientation === 'string' &&
|
|
171
217
|
this.options.orientation !== options.orientation;
|
|
172
218
|
this._options = __assign(__assign({}, this.options), options);
|
|
@@ -339,19 +385,19 @@ var SplitviewComponent = /** @class */ (function (_super) {
|
|
|
339
385
|
this._onDidLayoutfromJSON.fire();
|
|
340
386
|
};
|
|
341
387
|
SplitviewComponent.prototype.clear = function () {
|
|
342
|
-
var
|
|
388
|
+
var e_4, _a;
|
|
343
389
|
try {
|
|
344
390
|
for (var _b = __values(this._panels.values()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
345
391
|
var disposable = _c.value;
|
|
346
392
|
disposable.dispose();
|
|
347
393
|
}
|
|
348
394
|
}
|
|
349
|
-
catch (
|
|
395
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
350
396
|
finally {
|
|
351
397
|
try {
|
|
352
398
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
353
399
|
}
|
|
354
|
-
finally { if (
|
|
400
|
+
finally { if (e_4) throw e_4.error; }
|
|
355
401
|
}
|
|
356
402
|
this._panels.clear();
|
|
357
403
|
while (this.splitview.length > 0) {
|
|
@@ -360,19 +406,19 @@ var SplitviewComponent = /** @class */ (function (_super) {
|
|
|
360
406
|
}
|
|
361
407
|
};
|
|
362
408
|
SplitviewComponent.prototype.dispose = function () {
|
|
363
|
-
var
|
|
409
|
+
var e_5, _a, e_6, _b;
|
|
364
410
|
try {
|
|
365
411
|
for (var _c = __values(this._panels.values()), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
366
412
|
var disposable = _d.value;
|
|
367
413
|
disposable.dispose();
|
|
368
414
|
}
|
|
369
415
|
}
|
|
370
|
-
catch (
|
|
416
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
371
417
|
finally {
|
|
372
418
|
try {
|
|
373
419
|
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
374
420
|
}
|
|
375
|
-
finally { if (
|
|
421
|
+
finally { if (e_5) throw e_5.error; }
|
|
376
422
|
}
|
|
377
423
|
this._panels.clear();
|
|
378
424
|
var views = this.splitview.getViews();
|
|
@@ -384,12 +430,12 @@ var SplitviewComponent = /** @class */ (function (_super) {
|
|
|
384
430
|
view.dispose();
|
|
385
431
|
}
|
|
386
432
|
}
|
|
387
|
-
catch (
|
|
433
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
388
434
|
finally {
|
|
389
435
|
try {
|
|
390
436
|
if (views_1_1 && !views_1_1.done && (_b = views_1.return)) _b.call(views_1);
|
|
391
437
|
}
|
|
392
|
-
finally { if (
|
|
438
|
+
finally { if (e_6) throw e_6.error; }
|
|
393
439
|
}
|
|
394
440
|
_super.prototype.dispose.call(this);
|
|
395
441
|
};
|