dockview-core 1.16.1 → 1.17.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/dnd/groupDragHandler.js +1 -1
- package/dist/cjs/dockview/components/tab/defaultTab.js +2 -2
- package/dist/cjs/dockview/components/tab/tab.js +1 -1
- package/dist/cjs/dockview/components/titlebar/tabsContainer.js +2 -2
- package/dist/cjs/dockview/components/watermark/watermark.d.ts +0 -7
- package/dist/cjs/dockview/components/watermark/watermark.js +3 -18
- package/dist/cjs/dockview/deserializer.js +4 -0
- package/dist/cjs/dockview/dockviewComponent.d.ts +2 -0
- package/dist/cjs/dockview/dockviewComponent.js +76 -58
- package/dist/cjs/dockview/dockviewGroupPanel.d.ts +4 -0
- package/dist/cjs/dockview/dockviewGroupPanel.js +49 -2
- package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +4 -0
- package/dist/cjs/dockview/dockviewGroupPanelModel.js +0 -1
- package/dist/cjs/dockview/dockviewPanel.d.ts +14 -1
- package/dist/cjs/dockview/dockviewPanel.js +36 -0
- package/dist/cjs/dockview/options.d.ts +16 -9
- package/dist/cjs/dockview/types.d.ts +5 -2
- package/dist/cjs/dom.d.ts +7 -0
- package/dist/cjs/dom.js +63 -1
- package/dist/cjs/gridview/baseComponentGridview.d.ts +2 -3
- package/dist/cjs/gridview/baseComponentGridview.js +28 -51
- package/dist/cjs/gridview/gridviewComponent.js +1 -2
- package/dist/cjs/gridview/gridviewPanel.d.ts +6 -0
- package/dist/cjs/overlay/overlay.js +8 -8
- package/dist/cjs/paneview/paneviewComponent.d.ts +1 -1
- package/dist/cjs/paneview/paneviewComponent.js +25 -63
- package/dist/cjs/splitview/splitviewComponent.d.ts +1 -1
- package/dist/cjs/splitview/splitviewComponent.js +29 -69
- package/dist/dockview-core.amd.js +221 -136
- 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 +220 -135
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +221 -136
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +221 -136
- 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 +221 -136
- 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 +220 -135
- package/dist/dockview-core.noStyle.js.map +1 -1
- package/dist/esm/dnd/groupDragHandler.js +1 -1
- package/dist/esm/dockview/components/tab/defaultTab.js +2 -2
- package/dist/esm/dockview/components/tab/tab.js +1 -1
- package/dist/esm/dockview/components/titlebar/tabsContainer.js +2 -2
- package/dist/esm/dockview/components/watermark/watermark.d.ts +0 -7
- package/dist/esm/dockview/components/watermark/watermark.js +3 -18
- package/dist/esm/dockview/deserializer.js +4 -0
- package/dist/esm/dockview/dockviewComponent.d.ts +2 -0
- package/dist/esm/dockview/dockviewComponent.js +75 -54
- package/dist/esm/dockview/dockviewGroupPanel.d.ts +4 -0
- package/dist/esm/dockview/dockviewGroupPanel.js +33 -2
- package/dist/esm/dockview/dockviewGroupPanelModel.d.ts +4 -0
- package/dist/esm/dockview/dockviewGroupPanelModel.js +0 -1
- package/dist/esm/dockview/dockviewPanel.d.ts +14 -1
- package/dist/esm/dockview/dockviewPanel.js +20 -0
- package/dist/esm/dockview/options.d.ts +16 -9
- package/dist/esm/dockview/types.d.ts +5 -2
- package/dist/esm/dom.d.ts +7 -0
- package/dist/esm/dom.js +36 -0
- package/dist/esm/gridview/baseComponentGridview.d.ts +2 -3
- package/dist/esm/gridview/baseComponentGridview.js +26 -17
- package/dist/esm/gridview/gridviewComponent.js +1 -2
- package/dist/esm/gridview/gridviewPanel.d.ts +6 -0
- package/dist/esm/overlay/overlay.js +8 -8
- package/dist/esm/paneview/paneviewComponent.d.ts +1 -1
- package/dist/esm/paneview/paneviewComponent.js +8 -14
- package/dist/esm/splitview/splitviewComponent.d.ts +1 -1
- package/dist/esm/splitview/splitviewComponent.js +10 -18
- package/dist/styles/dockview.css +1 -1
- package/package.json +1 -1
|
@@ -28,7 +28,7 @@ var GroupDragHandler = /** @class */ (function (_super) {
|
|
|
28
28
|
_this.accessor = accessor;
|
|
29
29
|
_this.group = group;
|
|
30
30
|
_this.panelTransfer = dataTransfer_1.LocalSelectionTransfer.getInstance();
|
|
31
|
-
_this.addDisposables((0, events_1.addDisposableListener)(element, '
|
|
31
|
+
_this.addDisposables((0, events_1.addDisposableListener)(element, 'pointerdown', function (e) {
|
|
32
32
|
if (e.shiftKey) {
|
|
33
33
|
/**
|
|
34
34
|
* You cannot call e.preventDefault() because that will prevent drag events from firing
|
|
@@ -32,7 +32,7 @@ var DefaultTab = /** @class */ (function (_super) {
|
|
|
32
32
|
_this.action.appendChild((0, svg_1.createCloseButton)());
|
|
33
33
|
_this._element.appendChild(_this._content);
|
|
34
34
|
_this._element.appendChild(_this.action);
|
|
35
|
-
_this.addDisposables((0, events_1.addDisposableListener)(_this.action, '
|
|
35
|
+
_this.addDisposables((0, events_1.addDisposableListener)(_this.action, 'pointerdown', function (ev) {
|
|
36
36
|
ev.preventDefault();
|
|
37
37
|
}));
|
|
38
38
|
_this.render();
|
|
@@ -51,7 +51,7 @@ var DefaultTab = /** @class */ (function (_super) {
|
|
|
51
51
|
this.addDisposables(params.api.onDidTitleChange(function (event) {
|
|
52
52
|
_this._title = event.title;
|
|
53
53
|
_this.render();
|
|
54
|
-
}), (0, events_1.addDisposableListener)(this.action, '
|
|
54
|
+
}), (0, events_1.addDisposableListener)(this.action, 'pointerdown', function (ev) {
|
|
55
55
|
ev.preventDefault();
|
|
56
56
|
}), (0, events_1.addDisposableListener)(this.action, 'click', function (ev) {
|
|
57
57
|
if (ev.defaultPrevented) {
|
|
@@ -84,7 +84,7 @@ var Tab = /** @class */ (function (_super) {
|
|
|
84
84
|
_this.onWillShowOverlay = _this.dropTarget.onWillShowOverlay;
|
|
85
85
|
_this.addDisposables(_this._onChanged, _this._onDropped, _this._onDragStart, dragHandler.onDragStart(function (event) {
|
|
86
86
|
_this._onDragStart.fire(event);
|
|
87
|
-
}), dragHandler, (0, events_1.addDisposableListener)(_this._element, '
|
|
87
|
+
}), dragHandler, (0, events_1.addDisposableListener)(_this._element, 'pointerdown', function (event) {
|
|
88
88
|
if (event.defaultPrevented) {
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
@@ -119,7 +119,7 @@ var TabsContainer = /** @class */ (function (_super) {
|
|
|
119
119
|
group: _this.group,
|
|
120
120
|
getData: dataTransfer_1.getPanelData,
|
|
121
121
|
}));
|
|
122
|
-
}), (0, events_1.addDisposableListener)(_this.voidContainer.element, '
|
|
122
|
+
}), (0, events_1.addDisposableListener)(_this.voidContainer.element, 'pointerdown', function (event) {
|
|
123
123
|
var isFloatingGroupsEnabled = !_this.accessor.options.disableFloatingGroups;
|
|
124
124
|
if (isFloatingGroupsEnabled &&
|
|
125
125
|
event.shiftKey &&
|
|
@@ -133,7 +133,7 @@ var TabsContainer = /** @class */ (function (_super) {
|
|
|
133
133
|
inDragMode: true,
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
|
-
}), (0, events_1.addDisposableListener)(_this.tabContainer, '
|
|
136
|
+
}), (0, events_1.addDisposableListener)(_this.tabContainer, 'pointerdown', function (event) {
|
|
137
137
|
if (event.defaultPrevented) {
|
|
138
138
|
return;
|
|
139
139
|
}
|
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
import { IWatermarkRenderer, WatermarkRendererInitParameters } from '../../types';
|
|
2
2
|
import { CompositeDisposable } from '../../../lifecycle';
|
|
3
|
-
import { DockviewGroupPanel } from '../../dockviewGroupPanel';
|
|
4
|
-
import { PanelUpdateEvent } from '../../../panel/types';
|
|
5
3
|
export declare class Watermark extends CompositeDisposable implements IWatermarkRenderer {
|
|
6
4
|
private _element;
|
|
7
5
|
private _group;
|
|
8
6
|
private _api;
|
|
9
7
|
get element(): HTMLElement;
|
|
10
8
|
constructor();
|
|
11
|
-
update(_event: PanelUpdateEvent): void;
|
|
12
|
-
focus(): void;
|
|
13
|
-
layout(_width: number, _height: number): void;
|
|
14
9
|
init(_params: WatermarkRendererInitParameters): void;
|
|
15
|
-
updateParentGroup(group: DockviewGroupPanel, _visible: boolean): void;
|
|
16
|
-
dispose(): void;
|
|
17
10
|
private render;
|
|
18
11
|
}
|
|
@@ -42,9 +42,9 @@ var Watermark = /** @class */ (function (_super) {
|
|
|
42
42
|
actionsContainer.appendChild(closeAnchor);
|
|
43
43
|
title.appendChild(emptySpace);
|
|
44
44
|
title.appendChild(actionsContainer);
|
|
45
|
-
_this.addDisposables((0, events_1.addDisposableListener)(closeAnchor, 'click', function (
|
|
45
|
+
_this.addDisposables((0, events_1.addDisposableListener)(closeAnchor, 'click', function (event) {
|
|
46
46
|
var _a;
|
|
47
|
-
|
|
47
|
+
event.preventDefault();
|
|
48
48
|
if (_this._group) {
|
|
49
49
|
(_a = _this._api) === null || _a === void 0 ? void 0 : _a.removeGroup(_this._group);
|
|
50
50
|
}
|
|
@@ -58,26 +58,11 @@ var Watermark = /** @class */ (function (_super) {
|
|
|
58
58
|
enumerable: false,
|
|
59
59
|
configurable: true
|
|
60
60
|
});
|
|
61
|
-
Watermark.prototype.update = function (_event) {
|
|
62
|
-
// noop
|
|
63
|
-
};
|
|
64
|
-
Watermark.prototype.focus = function () {
|
|
65
|
-
// noop
|
|
66
|
-
};
|
|
67
|
-
Watermark.prototype.layout = function (_width, _height) {
|
|
68
|
-
// noop
|
|
69
|
-
};
|
|
70
61
|
Watermark.prototype.init = function (_params) {
|
|
71
62
|
this._api = _params.containerApi;
|
|
63
|
+
this._group = _params.group;
|
|
72
64
|
this.render();
|
|
73
65
|
};
|
|
74
|
-
Watermark.prototype.updateParentGroup = function (group, _visible) {
|
|
75
|
-
this._group = group;
|
|
76
|
-
this.render();
|
|
77
|
-
};
|
|
78
|
-
Watermark.prototype.dispose = function () {
|
|
79
|
-
_super.prototype.dispose.call(this);
|
|
80
|
-
};
|
|
81
66
|
Watermark.prototype.render = function () {
|
|
82
67
|
var isOneGroup = !!(this._api && this._api.size <= 1);
|
|
83
68
|
(0, dom_1.toggleClass)(this.element, 'has-actions', isOneGroup);
|
|
@@ -23,6 +23,10 @@ var DefaultDockviewDeserialzier = /** @class */ (function () {
|
|
|
23
23
|
var view = new dockviewPanelModel_1.DockviewPanelModel(this.accessor, panelId, contentComponent, tabComponent);
|
|
24
24
|
var panel = new dockviewPanel_1.DockviewPanel(panelId, contentComponent, tabComponent, this.accessor, new component_api_1.DockviewApi(this.accessor), group, view, {
|
|
25
25
|
renderer: panelData.renderer,
|
|
26
|
+
minimumWidth: panelData.minimumWidth,
|
|
27
|
+
minimumHeight: panelData.minimumHeight,
|
|
28
|
+
maximumWidth: panelData.maximumWidth,
|
|
29
|
+
maximumHeight: panelData.maximumHeight,
|
|
26
30
|
});
|
|
27
31
|
panel.init({
|
|
28
32
|
title: title !== null && title !== void 0 ? title : panelId,
|
|
@@ -220,6 +220,7 @@ export declare class DockviewComponent extends BaseGrid<DockviewGroupPanel> impl
|
|
|
220
220
|
createWatermarkComponent(): IWatermarkRenderer;
|
|
221
221
|
private updateWatermark;
|
|
222
222
|
addGroup(options?: AddGroupOptions): DockviewGroupPanel;
|
|
223
|
+
private getLocationOrientation;
|
|
223
224
|
removeGroup(group: DockviewGroupPanel, options?: {
|
|
224
225
|
skipActive?: boolean;
|
|
225
226
|
skipDispose?: boolean;
|
|
@@ -243,5 +244,6 @@ export declare class DockviewComponent extends BaseGrid<DockviewGroupPanel> impl
|
|
|
243
244
|
private createPanel;
|
|
244
245
|
private createGroupAtLocation;
|
|
245
246
|
private findGroup;
|
|
247
|
+
private orientationAtLocation;
|
|
246
248
|
}
|
|
247
249
|
export {};
|
|
@@ -104,38 +104,16 @@ function moveGroupWithoutDestroying(options) {
|
|
|
104
104
|
});
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
|
-
function getDockviewTheme(element) {
|
|
108
|
-
function toClassList(element) {
|
|
109
|
-
var list = [];
|
|
110
|
-
for (var i = 0; i < element.classList.length; i++) {
|
|
111
|
-
list.push(element.classList.item(i));
|
|
112
|
-
}
|
|
113
|
-
return list;
|
|
114
|
-
}
|
|
115
|
-
var theme = undefined;
|
|
116
|
-
var parent = element;
|
|
117
|
-
while (parent !== null) {
|
|
118
|
-
theme = toClassList(parent).find(function (cls) {
|
|
119
|
-
return cls.startsWith('dockview-theme-');
|
|
120
|
-
});
|
|
121
|
-
if (typeof theme === 'string') {
|
|
122
|
-
break;
|
|
123
|
-
}
|
|
124
|
-
parent = parent.parentElement;
|
|
125
|
-
}
|
|
126
|
-
return theme;
|
|
127
|
-
}
|
|
128
107
|
var DockviewComponent = /** @class */ (function (_super) {
|
|
129
108
|
__extends(DockviewComponent, _super);
|
|
130
109
|
function DockviewComponent(parentElement, options) {
|
|
131
110
|
var _a;
|
|
132
|
-
var _this = _super.call(this, {
|
|
111
|
+
var _this = _super.call(this, parentElement, {
|
|
133
112
|
proportionalLayout: true,
|
|
134
113
|
orientation: splitview_1.Orientation.HORIZONTAL,
|
|
135
114
|
styles: options.hideBorders
|
|
136
115
|
? { separatorBorder: 'transparent' }
|
|
137
116
|
: undefined,
|
|
138
|
-
parentElement: parentElement,
|
|
139
117
|
disableAutoResizing: options.disableAutoResizing,
|
|
140
118
|
locked: options.locked,
|
|
141
119
|
margin: options.gap,
|
|
@@ -175,9 +153,6 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
175
153
|
_this._onDidActiveGroupChange = new events_1.Emitter();
|
|
176
154
|
_this.onDidActiveGroupChange = _this._onDidActiveGroupChange.event;
|
|
177
155
|
_this._moving = false;
|
|
178
|
-
// const gready = document.createElement('div');
|
|
179
|
-
// gready.className = 'dv-overlay-render-container';
|
|
180
|
-
// this.gridview.element.appendChild(gready);
|
|
181
156
|
_this.overlayRenderContainer = new overlayRenderContainer_1.OverlayRenderContainer(_this.gridview.element, _this);
|
|
182
157
|
(0, dom_1.toggleClass)(_this.gridview.element, 'dv-dockview', true);
|
|
183
158
|
(0, dom_1.toggleClass)(_this.element, 'dv-debug', !!options.debug);
|
|
@@ -390,7 +365,7 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
390
365
|
itemToPopout.group.size === 1) {
|
|
391
366
|
return this.addPopoutGroup(itemToPopout.group, options);
|
|
392
367
|
}
|
|
393
|
-
var theme = getDockviewTheme(this.gridview.element);
|
|
368
|
+
var theme = (0, dom_1.getDockviewTheme)(this.gridview.element);
|
|
394
369
|
var element = this.element;
|
|
395
370
|
function getBox() {
|
|
396
371
|
if (options === null || options === void 0 ? void 0 : options.position) {
|
|
@@ -731,18 +706,13 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
731
706
|
};
|
|
732
707
|
DockviewComponent.prototype.updateOptions = function (options) {
|
|
733
708
|
var e_3, _a;
|
|
734
|
-
var _b, _c;
|
|
709
|
+
var _b, _c, _d, _e;
|
|
735
710
|
_super.prototype.updateOptions.call(this, options);
|
|
736
|
-
|
|
737
|
-
options.floatingGroupBounds !== this.options.floatingGroupBounds;
|
|
738
|
-
var changed_rootOverlayOptions = 'rootOverlayModel' in options &&
|
|
739
|
-
options.rootOverlayModel !== this.options.rootOverlayModel;
|
|
740
|
-
this._options = __assign(__assign({}, this.options), options);
|
|
741
|
-
if (changed_floatingGroupBounds) {
|
|
711
|
+
if ('floatingGroupBounds' in options) {
|
|
742
712
|
try {
|
|
743
|
-
for (var
|
|
744
|
-
var group =
|
|
745
|
-
switch (
|
|
713
|
+
for (var _f = __values(this._floatingGroups), _g = _f.next(); !_g.done; _g = _f.next()) {
|
|
714
|
+
var group = _g.value;
|
|
715
|
+
switch (options.floatingGroupBounds) {
|
|
746
716
|
case 'boundedWithinViewport':
|
|
747
717
|
group.overlay.minimumInViewportHeight = undefined;
|
|
748
718
|
group.overlay.minimumInViewportWidth = undefined;
|
|
@@ -755,9 +725,9 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
755
725
|
break;
|
|
756
726
|
default:
|
|
757
727
|
group.overlay.minimumInViewportHeight =
|
|
758
|
-
(_b =
|
|
728
|
+
(_b = options.floatingGroupBounds) === null || _b === void 0 ? void 0 : _b.minimumHeightWithinViewport;
|
|
759
729
|
group.overlay.minimumInViewportWidth =
|
|
760
|
-
(_c =
|
|
730
|
+
(_c = options.floatingGroupBounds) === null || _c === void 0 ? void 0 : _c.minimumWidthWithinViewport;
|
|
761
731
|
}
|
|
762
732
|
group.overlay.setBounds();
|
|
763
733
|
}
|
|
@@ -765,23 +735,18 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
765
735
|
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
766
736
|
finally {
|
|
767
737
|
try {
|
|
768
|
-
if (
|
|
738
|
+
if (_g && !_g.done && (_a = _f.return)) _a.call(_f);
|
|
769
739
|
}
|
|
770
740
|
finally { if (e_3) throw e_3.error; }
|
|
771
741
|
}
|
|
772
742
|
}
|
|
773
|
-
if (
|
|
774
|
-
this._rootDropTarget.setOverlayModel(options.rootOverlayModel);
|
|
743
|
+
if ('rootOverlayModel' in options) {
|
|
744
|
+
this._rootDropTarget.setOverlayModel((_d = options.rootOverlayModel) !== null && _d !== void 0 ? _d : DEFAULT_ROOT_OVERLAY_MODEL);
|
|
775
745
|
}
|
|
776
|
-
if (
|
|
777
|
-
|
|
778
|
-
'gap' in options &&
|
|
779
|
-
options.gap === undefined) {
|
|
780
|
-
this.gridview.margin = 0;
|
|
781
|
-
}
|
|
782
|
-
if (typeof options.gap === 'number') {
|
|
783
|
-
this.gridview.margin = options.gap;
|
|
746
|
+
if ('gap' in options) {
|
|
747
|
+
this.gridview.margin = (_e = options.gap) !== null && _e !== void 0 ? _e : 0;
|
|
784
748
|
}
|
|
749
|
+
this._options = __assign(__assign({}, this.options), options);
|
|
785
750
|
this.layout(this.gridview.width, this.gridview.height, true);
|
|
786
751
|
};
|
|
787
752
|
DockviewComponent.prototype.layout = function (width, height, forceResize) {
|
|
@@ -1156,6 +1121,10 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1156
1121
|
if (options.position && options.floating) {
|
|
1157
1122
|
throw new Error('you can only provide one of: position, floating as arguments to .addPanel(...)');
|
|
1158
1123
|
}
|
|
1124
|
+
var initial = {
|
|
1125
|
+
width: options.initialWidth,
|
|
1126
|
+
height: options.initialHeight,
|
|
1127
|
+
};
|
|
1159
1128
|
if (options.position) {
|
|
1160
1129
|
if ((0, options_1.isPanelOptionsWithPanel)(options.position)) {
|
|
1161
1130
|
var referencePanel = typeof options.position.referencePanel === 'string'
|
|
@@ -1185,6 +1154,10 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1185
1154
|
if (!options.inactive) {
|
|
1186
1155
|
this.doSetGroupAndPanelActive(group);
|
|
1187
1156
|
}
|
|
1157
|
+
group.api.setSize({
|
|
1158
|
+
height: initial === null || initial === void 0 ? void 0 : initial.height,
|
|
1159
|
+
width: initial === null || initial === void 0 ? void 0 : initial.width,
|
|
1160
|
+
});
|
|
1188
1161
|
return panel_1;
|
|
1189
1162
|
}
|
|
1190
1163
|
}
|
|
@@ -1215,6 +1188,10 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1215
1188
|
skipSetActive: options.inactive,
|
|
1216
1189
|
skipSetGroupActive: options.inactive,
|
|
1217
1190
|
});
|
|
1191
|
+
referenceGroup.api.setSize({
|
|
1192
|
+
width: initial === null || initial === void 0 ? void 0 : initial.width,
|
|
1193
|
+
height: initial === null || initial === void 0 ? void 0 : initial.height,
|
|
1194
|
+
});
|
|
1218
1195
|
if (!options.inactive) {
|
|
1219
1196
|
this.doSetGroupAndPanelActive(referenceGroup);
|
|
1220
1197
|
}
|
|
@@ -1222,7 +1199,10 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1222
1199
|
else {
|
|
1223
1200
|
var location_1 = (0, gridview_1.getGridLocation)(referenceGroup.element);
|
|
1224
1201
|
var relativeLocation = (0, gridview_1.getRelativeLocation)(this.gridview.orientation, location_1, target);
|
|
1225
|
-
var group = this.createGroupAtLocation(relativeLocation)
|
|
1202
|
+
var group = this.createGroupAtLocation(relativeLocation, this.orientationAtLocation(relativeLocation) ===
|
|
1203
|
+
splitview_1.Orientation.VERTICAL
|
|
1204
|
+
? initial === null || initial === void 0 ? void 0 : initial.height
|
|
1205
|
+
: initial === null || initial === void 0 ? void 0 : initial.width);
|
|
1226
1206
|
panel = this.createPanel(options, group);
|
|
1227
1207
|
group.model.openPanel(panel, {
|
|
1228
1208
|
skipSetActive: options.inactive,
|
|
@@ -1248,7 +1228,9 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1248
1228
|
});
|
|
1249
1229
|
}
|
|
1250
1230
|
else {
|
|
1251
|
-
var group = this.createGroupAtLocation(
|
|
1231
|
+
var group = this.createGroupAtLocation([0], this.gridview.orientation === splitview_1.Orientation.VERTICAL
|
|
1232
|
+
? initial === null || initial === void 0 ? void 0 : initial.height
|
|
1233
|
+
: initial === null || initial === void 0 ? void 0 : initial.width);
|
|
1252
1234
|
panel = this.createPanel(options, group);
|
|
1253
1235
|
group.model.openPanel(panel, {
|
|
1254
1236
|
skipSetActive: options.inactive,
|
|
@@ -1343,7 +1325,11 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1343
1325
|
var location_2 = (0, gridview_1.getGridLocation)(referenceGroup.element);
|
|
1344
1326
|
var relativeLocation = (0, gridview_1.getRelativeLocation)(this.gridview.orientation, location_2, target);
|
|
1345
1327
|
var group = this.createGroup(options);
|
|
1346
|
-
this.
|
|
1328
|
+
var size = this.getLocationOrientation(relativeLocation) ===
|
|
1329
|
+
splitview_1.Orientation.VERTICAL
|
|
1330
|
+
? options.initialHeight
|
|
1331
|
+
: options.initialWidth;
|
|
1332
|
+
this.doAddGroup(group, relativeLocation, size);
|
|
1347
1333
|
if (!options.skipSetActive) {
|
|
1348
1334
|
this.doSetGroupAndPanelActive(group);
|
|
1349
1335
|
}
|
|
@@ -1356,6 +1342,12 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1356
1342
|
return group;
|
|
1357
1343
|
}
|
|
1358
1344
|
};
|
|
1345
|
+
DockviewComponent.prototype.getLocationOrientation = function (location) {
|
|
1346
|
+
return location.length % 2 == 0 &&
|
|
1347
|
+
this.gridview.orientation === splitview_1.Orientation.HORIZONTAL
|
|
1348
|
+
? splitview_1.Orientation.HORIZONTAL
|
|
1349
|
+
: splitview_1.Orientation.VERTICAL;
|
|
1350
|
+
};
|
|
1359
1351
|
DockviewComponent.prototype.removeGroup = function (group, options) {
|
|
1360
1352
|
this.doRemoveGroup(group, options);
|
|
1361
1353
|
};
|
|
@@ -1669,7 +1661,22 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1669
1661
|
}
|
|
1670
1662
|
var referenceLocation = (0, gridview_1.getGridLocation)(to.element);
|
|
1671
1663
|
var dropLocation = (0, gridview_1.getRelativeLocation)(this.gridview.orientation, referenceLocation, target);
|
|
1672
|
-
|
|
1664
|
+
var size = void 0;
|
|
1665
|
+
switch (this.gridview.orientation) {
|
|
1666
|
+
case splitview_1.Orientation.VERTICAL:
|
|
1667
|
+
size =
|
|
1668
|
+
referenceLocation.length % 2 == 0
|
|
1669
|
+
? from.api.width
|
|
1670
|
+
: from.api.height;
|
|
1671
|
+
break;
|
|
1672
|
+
case splitview_1.Orientation.HORIZONTAL:
|
|
1673
|
+
size =
|
|
1674
|
+
referenceLocation.length % 2 == 0
|
|
1675
|
+
? from.api.height
|
|
1676
|
+
: from.api.width;
|
|
1677
|
+
break;
|
|
1678
|
+
}
|
|
1679
|
+
this.gridview.addView(from, size, dropLocation);
|
|
1673
1680
|
}
|
|
1674
1681
|
from.panels.forEach(function (panel) {
|
|
1675
1682
|
_this._onDidMovePanel.fire({ panel: panel, from: from });
|
|
@@ -1782,17 +1789,22 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1782
1789
|
var contentComponent = options.component;
|
|
1783
1790
|
var tabComponent = (_a = options.tabComponent) !== null && _a !== void 0 ? _a : this.options.defaultTabComponent;
|
|
1784
1791
|
var view = new dockviewPanelModel_1.DockviewPanelModel(this, options.id, contentComponent, tabComponent);
|
|
1785
|
-
var panel = new dockviewPanel_1.DockviewPanel(options.id, contentComponent, tabComponent, this, this._api, group, view, {
|
|
1792
|
+
var panel = new dockviewPanel_1.DockviewPanel(options.id, contentComponent, tabComponent, this, this._api, group, view, {
|
|
1793
|
+
renderer: options.renderer,
|
|
1794
|
+
minimumWidth: options.minimumWidth,
|
|
1795
|
+
minimumHeight: options.minimumHeight,
|
|
1796
|
+
maximumWidth: options.maximumWidth,
|
|
1797
|
+
maximumHeight: options.maximumHeight,
|
|
1798
|
+
});
|
|
1786
1799
|
panel.init({
|
|
1787
1800
|
title: (_b = options.title) !== null && _b !== void 0 ? _b : options.id,
|
|
1788
1801
|
params: (_c = options === null || options === void 0 ? void 0 : options.params) !== null && _c !== void 0 ? _c : {},
|
|
1789
1802
|
});
|
|
1790
1803
|
return panel;
|
|
1791
1804
|
};
|
|
1792
|
-
DockviewComponent.prototype.createGroupAtLocation = function (location) {
|
|
1793
|
-
if (location === void 0) { location = [0]; }
|
|
1805
|
+
DockviewComponent.prototype.createGroupAtLocation = function (location, size) {
|
|
1794
1806
|
var group = this.createGroup();
|
|
1795
|
-
this.doAddGroup(group, location);
|
|
1807
|
+
this.doAddGroup(group, location, size);
|
|
1796
1808
|
return group;
|
|
1797
1809
|
};
|
|
1798
1810
|
DockviewComponent.prototype.findGroup = function (panel) {
|
|
@@ -1801,6 +1813,12 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1801
1813
|
return group.value.model.containsPanel(panel);
|
|
1802
1814
|
})) === null || _a === void 0 ? void 0 : _a.value;
|
|
1803
1815
|
};
|
|
1816
|
+
DockviewComponent.prototype.orientationAtLocation = function (location) {
|
|
1817
|
+
var rootOrientation = this.gridview.orientation;
|
|
1818
|
+
return location.length % 2 == 1
|
|
1819
|
+
? rootOrientation
|
|
1820
|
+
: (0, gridview_1.orthogonal)(rootOrientation);
|
|
1821
|
+
};
|
|
1804
1822
|
return DockviewComponent;
|
|
1805
1823
|
}(baseComponentGridview_1.BaseGrid));
|
|
1806
1824
|
exports.DockviewComponent = DockviewComponent;
|
|
@@ -14,6 +14,10 @@ export interface IDockviewGroupPanel extends IGridviewPanel<DockviewGroupPanelAp
|
|
|
14
14
|
export type IDockviewGroupPanelPublic = IDockviewGroupPanel;
|
|
15
15
|
export declare class DockviewGroupPanel extends GridviewPanel<DockviewGroupPanelApiImpl> implements IDockviewGroupPanel {
|
|
16
16
|
private readonly _model;
|
|
17
|
+
get minimumWidth(): number;
|
|
18
|
+
get minimumHeight(): number;
|
|
19
|
+
get maximumWidth(): number;
|
|
20
|
+
get maximumHeight(): number;
|
|
17
21
|
get panels(): IDockviewPanel[];
|
|
18
22
|
get activePanel(): IDockviewPanel | undefined;
|
|
19
23
|
get size(): number;
|
|
@@ -24,14 +24,61 @@ var MINIMUM_DOCKVIEW_GROUP_PANEL_HEIGHT = 100;
|
|
|
24
24
|
var DockviewGroupPanel = /** @class */ (function (_super) {
|
|
25
25
|
__extends(DockviewGroupPanel, _super);
|
|
26
26
|
function DockviewGroupPanel(accessor, id, options) {
|
|
27
|
+
var _a, _b, _c, _d, _e, _f;
|
|
27
28
|
var _this = _super.call(this, id, 'groupview_default', {
|
|
28
|
-
minimumHeight: MINIMUM_DOCKVIEW_GROUP_PANEL_HEIGHT,
|
|
29
|
-
minimumWidth: MINIMUM_DOCKVIEW_GROUP_PANEL_WIDTH,
|
|
29
|
+
minimumHeight: (_b = (_a = options.constraints) === null || _a === void 0 ? void 0 : _a.minimumHeight) !== null && _b !== void 0 ? _b : MINIMUM_DOCKVIEW_GROUP_PANEL_HEIGHT,
|
|
30
|
+
minimumWidth: (_d = (_c = options.constraints) === null || _c === void 0 ? void 0 : _c.maximumHeight) !== null && _d !== void 0 ? _d : MINIMUM_DOCKVIEW_GROUP_PANEL_WIDTH,
|
|
31
|
+
maximumHeight: (_e = options.constraints) === null || _e === void 0 ? void 0 : _e.maximumHeight,
|
|
32
|
+
maximumWidth: (_f = options.constraints) === null || _f === void 0 ? void 0 : _f.maximumWidth,
|
|
30
33
|
}, new dockviewGroupPanelApi_1.DockviewGroupPanelApiImpl(id, accessor)) || this;
|
|
31
34
|
_this.api.initialize(_this); // cannot use 'this' after after 'super' call
|
|
32
35
|
_this._model = new dockviewGroupPanelModel_1.DockviewGroupPanelModel(_this.element, accessor, id, options, _this);
|
|
33
36
|
return _this;
|
|
34
37
|
}
|
|
38
|
+
Object.defineProperty(DockviewGroupPanel.prototype, "minimumWidth", {
|
|
39
|
+
get: function () {
|
|
40
|
+
var _a;
|
|
41
|
+
var activePanelMinimumWidth = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.minimumWidth;
|
|
42
|
+
return typeof activePanelMinimumWidth === 'number'
|
|
43
|
+
? activePanelMinimumWidth
|
|
44
|
+
: MINIMUM_DOCKVIEW_GROUP_PANEL_WIDTH;
|
|
45
|
+
},
|
|
46
|
+
enumerable: false,
|
|
47
|
+
configurable: true
|
|
48
|
+
});
|
|
49
|
+
Object.defineProperty(DockviewGroupPanel.prototype, "minimumHeight", {
|
|
50
|
+
get: function () {
|
|
51
|
+
var _a;
|
|
52
|
+
var activePanelMinimumHeight = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.minimumHeight;
|
|
53
|
+
return typeof activePanelMinimumHeight === 'number'
|
|
54
|
+
? activePanelMinimumHeight
|
|
55
|
+
: MINIMUM_DOCKVIEW_GROUP_PANEL_HEIGHT;
|
|
56
|
+
},
|
|
57
|
+
enumerable: false,
|
|
58
|
+
configurable: true
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(DockviewGroupPanel.prototype, "maximumWidth", {
|
|
61
|
+
get: function () {
|
|
62
|
+
var _a;
|
|
63
|
+
var activePanelMaximumWidth = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.maximumWidth;
|
|
64
|
+
return typeof activePanelMaximumWidth === 'number'
|
|
65
|
+
? activePanelMaximumWidth
|
|
66
|
+
: Number.MAX_SAFE_INTEGER;
|
|
67
|
+
},
|
|
68
|
+
enumerable: false,
|
|
69
|
+
configurable: true
|
|
70
|
+
});
|
|
71
|
+
Object.defineProperty(DockviewGroupPanel.prototype, "maximumHeight", {
|
|
72
|
+
get: function () {
|
|
73
|
+
var _a;
|
|
74
|
+
var activePanelMaximumHeight = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.maximumHeight;
|
|
75
|
+
return typeof activePanelMaximumHeight === 'number'
|
|
76
|
+
? activePanelMaximumHeight
|
|
77
|
+
: Number.MAX_SAFE_INTEGER;
|
|
78
|
+
},
|
|
79
|
+
enumerable: false,
|
|
80
|
+
configurable: true
|
|
81
|
+
});
|
|
35
82
|
Object.defineProperty(DockviewGroupPanel.prototype, "panels", {
|
|
36
83
|
get: function () {
|
|
37
84
|
return this._model.panels;
|
|
@@ -12,6 +12,7 @@ import { IDockviewPanel } from './dockviewPanel';
|
|
|
12
12
|
import { DockviewDndOverlayEvent } from './options';
|
|
13
13
|
import { OverlayRenderContainer } from '../overlay/overlayRenderContainer';
|
|
14
14
|
import { TitleEvent } from '../api/dockviewPanelApi';
|
|
15
|
+
import { Contraints } from '../gridview/gridviewPanel';
|
|
15
16
|
interface GroupMoveEvent {
|
|
16
17
|
groupId: string;
|
|
17
18
|
itemId?: string;
|
|
@@ -22,6 +23,9 @@ interface CoreGroupOptions {
|
|
|
22
23
|
locked?: DockviewGroupPanelLocked;
|
|
23
24
|
hideHeader?: boolean;
|
|
24
25
|
skipSetActive?: boolean;
|
|
26
|
+
constraints?: Partial<Contraints>;
|
|
27
|
+
initialWidth?: number;
|
|
28
|
+
initialHeight?: number;
|
|
25
29
|
}
|
|
26
30
|
export interface GroupOptions extends CoreGroupOptions {
|
|
27
31
|
readonly panels?: IDockviewPanel[];
|
|
@@ -730,7 +730,6 @@ var DockviewGroupPanelModel = /** @class */ (function (_super) {
|
|
|
730
730
|
});
|
|
731
731
|
this.tabsContainer.hide();
|
|
732
732
|
this.contentContainer.element.appendChild(this.watermark.element);
|
|
733
|
-
this.watermark.updateParentGroup(this.groupPanel, true);
|
|
734
733
|
}
|
|
735
734
|
if (!this.isEmpty && this.watermark) {
|
|
736
735
|
this.watermark.element.remove();
|
|
@@ -7,12 +7,17 @@ import { IPanel, PanelUpdateEvent, Parameters } from '../panel/types';
|
|
|
7
7
|
import { IDockviewPanelModel } from './dockviewPanelModel';
|
|
8
8
|
import { DockviewComponent } from './dockviewComponent';
|
|
9
9
|
import { DockviewPanelRenderer } from '../overlay/overlayRenderContainer';
|
|
10
|
+
import { Contraints } from '../gridview/gridviewPanel';
|
|
10
11
|
export interface IDockviewPanel extends IDisposable, IPanel {
|
|
11
12
|
readonly view: IDockviewPanelModel;
|
|
12
13
|
readonly group: DockviewGroupPanel;
|
|
13
14
|
readonly api: DockviewPanelApi;
|
|
14
15
|
readonly title: string | undefined;
|
|
15
16
|
readonly params: Parameters | undefined;
|
|
17
|
+
readonly minimumWidth?: number;
|
|
18
|
+
readonly minimumHeight?: number;
|
|
19
|
+
readonly maximumWidth?: number;
|
|
20
|
+
readonly maximumHeight?: number;
|
|
16
21
|
updateParentGroup(group: DockviewGroupPanel, options?: {
|
|
17
22
|
skipSetActive?: boolean;
|
|
18
23
|
}): void;
|
|
@@ -32,13 +37,21 @@ export declare class DockviewPanel extends CompositeDisposable implements IDockv
|
|
|
32
37
|
private _params?;
|
|
33
38
|
private _title;
|
|
34
39
|
private _renderer;
|
|
40
|
+
private _minimumWidth;
|
|
41
|
+
private _minimumHeight;
|
|
42
|
+
private _maximumWidth;
|
|
43
|
+
private _maximumHeight;
|
|
35
44
|
get params(): Parameters | undefined;
|
|
36
45
|
get title(): string | undefined;
|
|
37
46
|
get group(): DockviewGroupPanel;
|
|
38
47
|
get renderer(): DockviewPanelRenderer;
|
|
48
|
+
get minimumWidth(): number | undefined;
|
|
49
|
+
get minimumHeight(): number | undefined;
|
|
50
|
+
get maximumWidth(): number | undefined;
|
|
51
|
+
get maximumHeight(): number | undefined;
|
|
39
52
|
constructor(id: string, component: string, tabComponent: string | undefined, accessor: DockviewComponent, containerApi: DockviewApi, group: DockviewGroupPanel, view: IDockviewPanelModel, options: {
|
|
40
53
|
renderer?: DockviewPanelRenderer;
|
|
41
|
-
});
|
|
54
|
+
} & Partial<Contraints>);
|
|
42
55
|
init(params: IGroupPanelInitParameters): void;
|
|
43
56
|
focus(): void;
|
|
44
57
|
toJSON(): GroupviewPanelState;
|
|
@@ -51,6 +51,10 @@ var DockviewPanel = /** @class */ (function (_super) {
|
|
|
51
51
|
_this.view = view;
|
|
52
52
|
_this._renderer = options.renderer;
|
|
53
53
|
_this._group = group;
|
|
54
|
+
_this._minimumWidth = options.minimumWidth;
|
|
55
|
+
_this._minimumHeight = options.minimumHeight;
|
|
56
|
+
_this._maximumWidth = options.maximumWidth;
|
|
57
|
+
_this._maximumHeight = options.maximumHeight;
|
|
54
58
|
_this.api = new dockviewPanelApi_1.DockviewPanelApiImpl(_this, _this._group, accessor, component, tabComponent);
|
|
55
59
|
_this.addDisposables(_this.api.onActiveChange(function () {
|
|
56
60
|
accessor.setActivePanel(_this);
|
|
@@ -92,6 +96,34 @@ var DockviewPanel = /** @class */ (function (_super) {
|
|
|
92
96
|
enumerable: false,
|
|
93
97
|
configurable: true
|
|
94
98
|
});
|
|
99
|
+
Object.defineProperty(DockviewPanel.prototype, "minimumWidth", {
|
|
100
|
+
get: function () {
|
|
101
|
+
return this._minimumWidth;
|
|
102
|
+
},
|
|
103
|
+
enumerable: false,
|
|
104
|
+
configurable: true
|
|
105
|
+
});
|
|
106
|
+
Object.defineProperty(DockviewPanel.prototype, "minimumHeight", {
|
|
107
|
+
get: function () {
|
|
108
|
+
return this._minimumHeight;
|
|
109
|
+
},
|
|
110
|
+
enumerable: false,
|
|
111
|
+
configurable: true
|
|
112
|
+
});
|
|
113
|
+
Object.defineProperty(DockviewPanel.prototype, "maximumWidth", {
|
|
114
|
+
get: function () {
|
|
115
|
+
return this._maximumWidth;
|
|
116
|
+
},
|
|
117
|
+
enumerable: false,
|
|
118
|
+
configurable: true
|
|
119
|
+
});
|
|
120
|
+
Object.defineProperty(DockviewPanel.prototype, "maximumHeight", {
|
|
121
|
+
get: function () {
|
|
122
|
+
return this._maximumHeight;
|
|
123
|
+
},
|
|
124
|
+
enumerable: false,
|
|
125
|
+
configurable: true
|
|
126
|
+
});
|
|
95
127
|
DockviewPanel.prototype.init = function (params) {
|
|
96
128
|
this._params = params.params;
|
|
97
129
|
this.view.init(__assign(__assign({}, params), { api: this.api, containerApi: this.containerApi }));
|
|
@@ -117,6 +149,10 @@ var DockviewPanel = /** @class */ (function (_super) {
|
|
|
117
149
|
: undefined,
|
|
118
150
|
title: this.title,
|
|
119
151
|
renderer: this._renderer,
|
|
152
|
+
minimumHeight: this._minimumHeight,
|
|
153
|
+
maximumHeight: this._maximumHeight,
|
|
154
|
+
minimumWidth: this._minimumWidth,
|
|
155
|
+
maximumWidth: this._maximumWidth,
|
|
120
156
|
};
|
|
121
157
|
};
|
|
122
158
|
DockviewPanel.prototype.setTitle = function (title) {
|