dockview-core 1.14.2 → 1.15.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 +5 -5
- package/dist/cjs/api/component.api.js +19 -2
- package/dist/cjs/constants.d.ts +2 -0
- package/dist/cjs/constants.js +1 -1
- package/dist/cjs/dnd/overlay.d.ts +6 -4
- package/dist/cjs/dnd/overlay.js +119 -28
- package/dist/cjs/dockview/components/titlebar/tabsContainer.js +4 -2
- package/dist/cjs/dockview/dockviewComponent.d.ts +24 -17
- package/dist/cjs/dockview/dockviewComponent.js +104 -47
- package/dist/cjs/dockview/dockviewFloatingGroupPanel.d.ts +3 -12
- package/dist/cjs/dockview/options.d.ts +10 -6
- package/dist/cjs/dockview/options.js +1 -0
- package/dist/cjs/dom.d.ts +1 -0
- package/dist/cjs/dom.js +5 -1
- package/dist/cjs/gridview/baseComponentGridview.d.ts +3 -0
- package/dist/cjs/gridview/baseComponentGridview.js +8 -2
- package/dist/cjs/gridview/branchNode.d.ts +7 -3
- package/dist/cjs/gridview/branchNode.js +24 -29
- package/dist/cjs/gridview/gridview.d.ts +7 -1
- package/dist/cjs/gridview/gridview.js +31 -8
- package/dist/cjs/gridview/gridviewPanel.d.ts +1 -0
- package/dist/cjs/gridview/gridviewPanel.js +7 -0
- package/dist/cjs/math.js +5 -1
- package/dist/cjs/splitview/splitview.d.ts +13 -0
- package/dist/cjs/splitview/splitview.js +42 -12
- package/dist/cjs/types.d.ts +23 -0
- package/dist/dockview-core.amd.js +328 -112
- 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 +327 -111
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +328 -112
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +328 -112
- 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 +328 -112
- 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 +327 -111
- package/dist/dockview-core.noStyle.js.map +1 -1
- package/dist/esm/api/component.api.d.ts +5 -5
- package/dist/esm/api/component.api.js +11 -2
- package/dist/esm/constants.d.ts +2 -0
- package/dist/esm/constants.js +1 -1
- package/dist/esm/dnd/overlay.d.ts +6 -4
- package/dist/esm/dnd/overlay.js +108 -28
- package/dist/esm/dockview/components/titlebar/tabsContainer.js +4 -2
- package/dist/esm/dockview/dockviewComponent.d.ts +24 -17
- package/dist/esm/dockview/dockviewComponent.js +101 -48
- package/dist/esm/dockview/dockviewFloatingGroupPanel.d.ts +3 -12
- package/dist/esm/dockview/options.d.ts +10 -6
- package/dist/esm/dockview/options.js +1 -0
- package/dist/esm/dom.d.ts +1 -0
- package/dist/esm/dom.js +3 -0
- package/dist/esm/gridview/baseComponentGridview.d.ts +3 -0
- package/dist/esm/gridview/baseComponentGridview.js +6 -2
- package/dist/esm/gridview/branchNode.d.ts +7 -3
- package/dist/esm/gridview/branchNode.js +19 -7
- package/dist/esm/gridview/gridview.d.ts +7 -1
- package/dist/esm/gridview/gridview.js +27 -8
- package/dist/esm/gridview/gridviewPanel.d.ts +1 -0
- package/dist/esm/gridview/gridviewPanel.js +3 -0
- package/dist/esm/math.js +5 -1
- package/dist/esm/splitview/splitview.d.ts +13 -0
- package/dist/esm/splitview/splitview.js +38 -12
- package/dist/esm/types.d.ts +23 -0
- package/dist/styles/dockview.css +0 -13
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IDockviewComponent, SerializedDockview } from '../dockview/dockviewComponent';
|
|
1
|
+
import { FloatingGroupOptions, IDockviewComponent, MovePanelEvent, SerializedDockview } from '../dockview/dockviewComponent';
|
|
2
2
|
import { AddGroupOptions, AddPanelOptions, DockviewDndOverlayEvent, MovementOptions } from '../dockview/options';
|
|
3
3
|
import { Parameters } from '../panel/types';
|
|
4
4
|
import { Direction } from '../gridview/baseComponentGridview';
|
|
@@ -330,6 +330,7 @@ export declare class DockviewApi implements CommonApi<SerializedDockview> {
|
|
|
330
330
|
* Total number of panels.
|
|
331
331
|
*/
|
|
332
332
|
get totalPanels(): number;
|
|
333
|
+
get gap(): number;
|
|
333
334
|
/**
|
|
334
335
|
* Invoked when the active group changes. May be undefined if no group is active.
|
|
335
336
|
*/
|
|
@@ -354,6 +355,7 @@ export declare class DockviewApi implements CommonApi<SerializedDockview> {
|
|
|
354
355
|
* Invoked when a panel is removed. May be called multiple times when moving panels.
|
|
355
356
|
*/
|
|
356
357
|
get onDidRemovePanel(): Event<IDockviewPanel>;
|
|
358
|
+
get onDidMovePanel(): Event<MovePanelEvent>;
|
|
357
359
|
/**
|
|
358
360
|
* Invoked after a layout is deserialzied using the `fromJSON` method.
|
|
359
361
|
*/
|
|
@@ -450,10 +452,7 @@ export declare class DockviewApi implements CommonApi<SerializedDockview> {
|
|
|
450
452
|
/**
|
|
451
453
|
* Add a floating group
|
|
452
454
|
*/
|
|
453
|
-
addFloatingGroup(item: IDockviewPanel | DockviewGroupPanel,
|
|
454
|
-
x: number;
|
|
455
|
-
y: number;
|
|
456
|
-
}): void;
|
|
455
|
+
addFloatingGroup(item: IDockviewPanel | DockviewGroupPanel, options?: FloatingGroupOptions): void;
|
|
457
456
|
/**
|
|
458
457
|
* Create a component from a serialized object.
|
|
459
458
|
*/
|
|
@@ -493,4 +492,5 @@ export declare class DockviewApi implements CommonApi<SerializedDockview> {
|
|
|
493
492
|
window: Window;
|
|
494
493
|
}) => void;
|
|
495
494
|
}): Promise<void>;
|
|
495
|
+
setGap(gap: number | undefined): void;
|
|
496
496
|
}
|
|
@@ -649,6 +649,13 @@ var DockviewApi = /** @class */ (function () {
|
|
|
649
649
|
enumerable: false,
|
|
650
650
|
configurable: true
|
|
651
651
|
});
|
|
652
|
+
Object.defineProperty(DockviewApi.prototype, "gap", {
|
|
653
|
+
get: function () {
|
|
654
|
+
return this.component.gap;
|
|
655
|
+
},
|
|
656
|
+
enumerable: false,
|
|
657
|
+
configurable: true
|
|
658
|
+
});
|
|
652
659
|
Object.defineProperty(DockviewApi.prototype, "onDidActiveGroupChange", {
|
|
653
660
|
/**
|
|
654
661
|
* Invoked when the active group changes. May be undefined if no group is active.
|
|
@@ -709,6 +716,13 @@ var DockviewApi = /** @class */ (function () {
|
|
|
709
716
|
enumerable: false,
|
|
710
717
|
configurable: true
|
|
711
718
|
});
|
|
719
|
+
Object.defineProperty(DockviewApi.prototype, "onDidMovePanel", {
|
|
720
|
+
get: function () {
|
|
721
|
+
return this.component.onDidMovePanel;
|
|
722
|
+
},
|
|
723
|
+
enumerable: false,
|
|
724
|
+
configurable: true
|
|
725
|
+
});
|
|
712
726
|
Object.defineProperty(DockviewApi.prototype, "onDidLayoutFromJSON", {
|
|
713
727
|
/**
|
|
714
728
|
* Invoked after a layout is deserialzied using the `fromJSON` method.
|
|
@@ -895,8 +909,8 @@ var DockviewApi = /** @class */ (function () {
|
|
|
895
909
|
/**
|
|
896
910
|
* Add a floating group
|
|
897
911
|
*/
|
|
898
|
-
DockviewApi.prototype.addFloatingGroup = function (item,
|
|
899
|
-
return this.component.addFloatingGroup(item,
|
|
912
|
+
DockviewApi.prototype.addFloatingGroup = function (item, options) {
|
|
913
|
+
return this.component.addFloatingGroup(item, options);
|
|
900
914
|
};
|
|
901
915
|
/**
|
|
902
916
|
* Create a component from a serialized object.
|
|
@@ -950,6 +964,9 @@ var DockviewApi = /** @class */ (function () {
|
|
|
950
964
|
DockviewApi.prototype.addPopoutGroup = function (item, options) {
|
|
951
965
|
return this.component.addPopoutGroup(item, options);
|
|
952
966
|
};
|
|
967
|
+
DockviewApi.prototype.setGap = function (gap) {
|
|
968
|
+
this.component.updateOptions({ gap: gap });
|
|
969
|
+
};
|
|
953
970
|
return DockviewApi;
|
|
954
971
|
}());
|
|
955
972
|
exports.DockviewApi = DockviewApi;
|
package/dist/cjs/constants.d.ts
CHANGED
package/dist/cjs/constants.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DEFAULT_FLOATING_GROUP_POSITION = exports.DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE = void 0;
|
|
4
4
|
exports.DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE = 100;
|
|
5
|
-
exports.DEFAULT_FLOATING_GROUP_POSITION = { left: 100, top: 100 };
|
|
5
|
+
exports.DEFAULT_FLOATING_GROUP_POSITION = { left: 100, top: 100, width: 300, height: 300 };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Event } from '../events';
|
|
2
2
|
import { CompositeDisposable } from '../lifecycle';
|
|
3
|
-
import {
|
|
3
|
+
import { AnchoredBox } from '../types';
|
|
4
4
|
export declare class Overlay extends CompositeDisposable {
|
|
5
5
|
private readonly options;
|
|
6
6
|
private _element;
|
|
@@ -10,16 +10,18 @@ export declare class Overlay extends CompositeDisposable {
|
|
|
10
10
|
readonly onDidChangeEnd: Event<void>;
|
|
11
11
|
private static MINIMUM_HEIGHT;
|
|
12
12
|
private static MINIMUM_WIDTH;
|
|
13
|
+
private verticalAlignment;
|
|
14
|
+
private horiziontalAlignment;
|
|
13
15
|
set minimumInViewportWidth(value: number | undefined);
|
|
14
16
|
set minimumInViewportHeight(value: number | undefined);
|
|
15
|
-
constructor(options:
|
|
17
|
+
constructor(options: AnchoredBox & {
|
|
16
18
|
container: HTMLElement;
|
|
17
19
|
content: HTMLElement;
|
|
18
20
|
minimumInViewportWidth?: number;
|
|
19
21
|
minimumInViewportHeight?: number;
|
|
20
22
|
});
|
|
21
|
-
setBounds(bounds?: Partial<
|
|
22
|
-
toJSON():
|
|
23
|
+
setBounds(bounds?: Partial<AnchoredBox>): void;
|
|
24
|
+
toJSON(): AnchoredBox;
|
|
23
25
|
setupDrag(dragTarget: HTMLElement, options?: {
|
|
24
26
|
inDragMode: boolean;
|
|
25
27
|
}): void;
|
package/dist/cjs/dnd/overlay.js
CHANGED
|
@@ -14,6 +14,17 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
15
|
};
|
|
16
16
|
})();
|
|
17
|
+
var __assign = (this && this.__assign) || function () {
|
|
18
|
+
__assign = Object.assign || function(t) {
|
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
+
s = arguments[i];
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
+
t[p] = s[p];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
17
28
|
var __read = (this && this.__read) || function (o, n) {
|
|
18
29
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
19
30
|
if (!m) return o;
|
|
@@ -90,12 +101,7 @@ var Overlay = /** @class */ (function (_super) {
|
|
|
90
101
|
_this._element.appendChild(_this.options.content);
|
|
91
102
|
_this.options.container.appendChild(_this._element);
|
|
92
103
|
// if input bad resize within acceptable boundaries
|
|
93
|
-
_this.setBounds({
|
|
94
|
-
height: _this.options.height,
|
|
95
|
-
width: _this.options.width,
|
|
96
|
-
top: _this.options.top,
|
|
97
|
-
left: _this.options.left,
|
|
98
|
-
});
|
|
104
|
+
_this.setBounds(__assign(__assign(__assign(__assign({ height: _this.options.height, width: _this.options.width }, ('top' in _this.options && { top: _this.options.top })), ('bottom' in _this.options && { bottom: _this.options.bottom })), ('left' in _this.options && { left: _this.options.left })), ('right' in _this.options && { right: _this.options.right })));
|
|
99
105
|
return _this;
|
|
100
106
|
}
|
|
101
107
|
Object.defineProperty(Overlay.prototype, "minimumInViewportWidth", {
|
|
@@ -120,11 +126,25 @@ var Overlay = /** @class */ (function (_super) {
|
|
|
120
126
|
if (typeof bounds.width === 'number') {
|
|
121
127
|
this._element.style.width = "".concat(bounds.width, "px");
|
|
122
128
|
}
|
|
123
|
-
if (typeof bounds.top === 'number') {
|
|
129
|
+
if ('top' in bounds && typeof bounds.top === 'number') {
|
|
124
130
|
this._element.style.top = "".concat(bounds.top, "px");
|
|
131
|
+
this._element.style.bottom = 'auto';
|
|
132
|
+
this.verticalAlignment = 'top';
|
|
133
|
+
}
|
|
134
|
+
if ('bottom' in bounds && typeof bounds.bottom === 'number') {
|
|
135
|
+
this._element.style.bottom = "".concat(bounds.bottom, "px");
|
|
136
|
+
this._element.style.top = 'auto';
|
|
137
|
+
this.verticalAlignment = 'bottom';
|
|
125
138
|
}
|
|
126
|
-
if (typeof bounds.left === 'number') {
|
|
139
|
+
if ('left' in bounds && typeof bounds.left === 'number') {
|
|
127
140
|
this._element.style.left = "".concat(bounds.left, "px");
|
|
141
|
+
this._element.style.right = 'auto';
|
|
142
|
+
this.horiziontalAlignment = 'left';
|
|
143
|
+
}
|
|
144
|
+
if ('right' in bounds && typeof bounds.right === 'number') {
|
|
145
|
+
this._element.style.right = "".concat(bounds.right, "px");
|
|
146
|
+
this._element.style.left = 'auto';
|
|
147
|
+
this.horiziontalAlignment = 'right';
|
|
128
148
|
}
|
|
129
149
|
var containerRect = this.options.container.getBoundingClientRect();
|
|
130
150
|
var overlayRect = this._element.getBoundingClientRect();
|
|
@@ -132,24 +152,54 @@ var Overlay = /** @class */ (function (_super) {
|
|
|
132
152
|
// a minimum width of minimumViewportWidth must be inside the viewport
|
|
133
153
|
var xOffset = Math.max(0, this.getMinimumWidth(overlayRect.width));
|
|
134
154
|
// a minimum height of minimumViewportHeight must be inside the viewport
|
|
135
|
-
var yOffset =
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
this.
|
|
155
|
+
var yOffset = Math.max(0, this.getMinimumHeight(overlayRect.height));
|
|
156
|
+
if (this.verticalAlignment === 'top') {
|
|
157
|
+
var top_1 = (0, math_1.clamp)(overlayRect.top - containerRect.top, -yOffset, Math.max(0, containerRect.height - overlayRect.height + yOffset));
|
|
158
|
+
this._element.style.top = "".concat(top_1, "px");
|
|
159
|
+
this._element.style.bottom = 'auto';
|
|
160
|
+
}
|
|
161
|
+
if (this.verticalAlignment === 'bottom') {
|
|
162
|
+
var bottom = (0, math_1.clamp)(containerRect.bottom - overlayRect.bottom, -yOffset, Math.max(0, containerRect.height - overlayRect.height + yOffset));
|
|
163
|
+
this._element.style.bottom = "".concat(bottom, "px");
|
|
164
|
+
this._element.style.top = 'auto';
|
|
165
|
+
}
|
|
166
|
+
if (this.horiziontalAlignment === 'left') {
|
|
167
|
+
var left = (0, math_1.clamp)(overlayRect.left - containerRect.left, -xOffset, Math.max(0, containerRect.width - overlayRect.width + xOffset));
|
|
168
|
+
this._element.style.left = "".concat(left, "px");
|
|
169
|
+
this._element.style.right = 'auto';
|
|
170
|
+
}
|
|
171
|
+
if (this.horiziontalAlignment === 'right') {
|
|
172
|
+
var right = (0, math_1.clamp)(containerRect.right - overlayRect.right, -xOffset, Math.max(0, containerRect.width - overlayRect.width + xOffset));
|
|
173
|
+
this._element.style.right = "".concat(right, "px");
|
|
174
|
+
this._element.style.left = 'auto';
|
|
175
|
+
}
|
|
142
176
|
this._onDidChange.fire();
|
|
143
177
|
};
|
|
144
178
|
Overlay.prototype.toJSON = function () {
|
|
145
179
|
var container = this.options.container.getBoundingClientRect();
|
|
146
180
|
var element = this._element.getBoundingClientRect();
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
181
|
+
var result = {};
|
|
182
|
+
if (this.verticalAlignment === 'top') {
|
|
183
|
+
result.top = parseFloat(this._element.style.top);
|
|
184
|
+
}
|
|
185
|
+
else if (this.verticalAlignment === 'bottom') {
|
|
186
|
+
result.bottom = parseFloat(this._element.style.bottom);
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
result.top = element.top - container.top;
|
|
190
|
+
}
|
|
191
|
+
if (this.horiziontalAlignment === 'left') {
|
|
192
|
+
result.left = parseFloat(this._element.style.left);
|
|
193
|
+
}
|
|
194
|
+
else if (this.horiziontalAlignment === 'right') {
|
|
195
|
+
result.right = parseFloat(this._element.style.right);
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
result.left = element.left - container.left;
|
|
199
|
+
}
|
|
200
|
+
result.width = element.width;
|
|
201
|
+
result.height = element.height;
|
|
202
|
+
return result;
|
|
153
203
|
};
|
|
154
204
|
Overlay.prototype.setupDrag = function (dragTarget, options) {
|
|
155
205
|
var _this = this;
|
|
@@ -202,12 +252,30 @@ var Overlay = /** @class */ (function (_super) {
|
|
|
202
252
|
};
|
|
203
253
|
}
|
|
204
254
|
var xOffset = Math.max(0, _this.getMinimumWidth(overlayRect.width));
|
|
205
|
-
var yOffset = Math.max(0, _this.
|
|
206
|
-
? _this.getMinimumHeight(overlayRect.height)
|
|
207
|
-
: 0);
|
|
208
|
-
var left = (0, math_1.clamp)(x - offset.x, -xOffset, Math.max(0, containerRect.width - overlayRect.width + xOffset));
|
|
255
|
+
var yOffset = Math.max(0, _this.getMinimumHeight(overlayRect.height));
|
|
209
256
|
var top = (0, math_1.clamp)(y - offset.y, -yOffset, Math.max(0, containerRect.height - overlayRect.height + yOffset));
|
|
210
|
-
|
|
257
|
+
var bottom = (0, math_1.clamp)(offset.y -
|
|
258
|
+
y +
|
|
259
|
+
containerRect.height -
|
|
260
|
+
overlayRect.height, -yOffset, Math.max(0, containerRect.height - overlayRect.height + yOffset));
|
|
261
|
+
var left = (0, math_1.clamp)(x - offset.x, -xOffset, Math.max(0, containerRect.width - overlayRect.width + xOffset));
|
|
262
|
+
var right = (0, math_1.clamp)(offset.x - x + containerRect.width - overlayRect.width, -xOffset, Math.max(0, containerRect.width - overlayRect.width + xOffset));
|
|
263
|
+
var bounds = {};
|
|
264
|
+
// Anchor to top or to bottom depending on which one is closer
|
|
265
|
+
if (top <= bottom) {
|
|
266
|
+
bounds.top = top;
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
bounds.bottom = bottom;
|
|
270
|
+
}
|
|
271
|
+
// Anchor to left or to right depending on which one is closer
|
|
272
|
+
if (left <= right) {
|
|
273
|
+
bounds.left = left;
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
bounds.right = right;
|
|
277
|
+
}
|
|
278
|
+
_this.setBounds(bounds);
|
|
211
279
|
}), (0, events_1.addDisposableWindowListener)(window, 'mouseup', function () {
|
|
212
280
|
(0, dom_1.toggleClass)(_this._element, 'dv-resize-container-dragging', false);
|
|
213
281
|
move.dispose();
|
|
@@ -284,8 +352,10 @@ var Overlay = /** @class */ (function (_super) {
|
|
|
284
352
|
};
|
|
285
353
|
}
|
|
286
354
|
var top = undefined;
|
|
355
|
+
var bottom = undefined;
|
|
287
356
|
var height = undefined;
|
|
288
357
|
var left = undefined;
|
|
358
|
+
var right = undefined;
|
|
289
359
|
var width = undefined;
|
|
290
360
|
var moveTop = function () {
|
|
291
361
|
top = (0, math_1.clamp)(y, -Number.MAX_VALUE, startPosition.originalY +
|
|
@@ -299,6 +369,7 @@ var Overlay = /** @class */ (function (_super) {
|
|
|
299
369
|
startPosition.originalY +
|
|
300
370
|
startPosition.originalHeight -
|
|
301
371
|
top;
|
|
372
|
+
bottom = containerRect.height - top - height;
|
|
302
373
|
};
|
|
303
374
|
var moveBottom = function () {
|
|
304
375
|
top =
|
|
@@ -310,6 +381,7 @@ var Overlay = /** @class */ (function (_super) {
|
|
|
310
381
|
? -top +
|
|
311
382
|
_this.options.minimumInViewportHeight
|
|
312
383
|
: Overlay.MINIMUM_HEIGHT, Number.MAX_VALUE);
|
|
384
|
+
bottom = containerRect.height - top - height;
|
|
313
385
|
};
|
|
314
386
|
var moveLeft = function () {
|
|
315
387
|
left = (0, math_1.clamp)(x, -Number.MAX_VALUE, startPosition.originalX +
|
|
@@ -323,6 +395,7 @@ var Overlay = /** @class */ (function (_super) {
|
|
|
323
395
|
startPosition.originalX +
|
|
324
396
|
startPosition.originalWidth -
|
|
325
397
|
left;
|
|
398
|
+
right = containerRect.width - left - width;
|
|
326
399
|
};
|
|
327
400
|
var moveRight = function () {
|
|
328
401
|
left =
|
|
@@ -334,6 +407,7 @@ var Overlay = /** @class */ (function (_super) {
|
|
|
334
407
|
? -left +
|
|
335
408
|
_this.options.minimumInViewportWidth
|
|
336
409
|
: Overlay.MINIMUM_WIDTH, Number.MAX_VALUE);
|
|
410
|
+
right = containerRect.width - left - width;
|
|
337
411
|
};
|
|
338
412
|
switch (direction) {
|
|
339
413
|
case 'top':
|
|
@@ -365,7 +439,24 @@ var Overlay = /** @class */ (function (_super) {
|
|
|
365
439
|
moveRight();
|
|
366
440
|
break;
|
|
367
441
|
}
|
|
368
|
-
|
|
442
|
+
var bounds = {};
|
|
443
|
+
// Anchor to top or to bottom depending on which one is closer
|
|
444
|
+
if (top <= bottom) {
|
|
445
|
+
bounds.top = top;
|
|
446
|
+
}
|
|
447
|
+
else {
|
|
448
|
+
bounds.bottom = bottom;
|
|
449
|
+
}
|
|
450
|
+
// Anchor to left or to right depending on which one is closer
|
|
451
|
+
if (left <= right) {
|
|
452
|
+
bounds.left = left;
|
|
453
|
+
}
|
|
454
|
+
else {
|
|
455
|
+
bounds.right = right;
|
|
456
|
+
}
|
|
457
|
+
bounds.height = height;
|
|
458
|
+
bounds.width = width;
|
|
459
|
+
_this.setBounds(bounds);
|
|
369
460
|
}), {
|
|
370
461
|
dispose: function () {
|
|
371
462
|
var e_4, _a;
|
|
@@ -399,7 +490,7 @@ var Overlay = /** @class */ (function (_super) {
|
|
|
399
490
|
if (typeof this.options.minimumInViewportHeight === 'number') {
|
|
400
491
|
return height - this.options.minimumInViewportHeight;
|
|
401
492
|
}
|
|
402
|
-
return
|
|
493
|
+
return 0;
|
|
403
494
|
};
|
|
404
495
|
Overlay.prototype.dispose = function () {
|
|
405
496
|
this._element.remove();
|
|
@@ -130,7 +130,8 @@ var TabsContainer = /** @class */ (function (_super) {
|
|
|
130
130
|
_this.accessor.addFloatingGroup(_this.group, {
|
|
131
131
|
x: left - rootLeft + 20,
|
|
132
132
|
y: top_1 - rootTop + 20,
|
|
133
|
-
|
|
133
|
+
inDragMode: true,
|
|
134
|
+
});
|
|
134
135
|
}
|
|
135
136
|
}), (0, events_1.addDisposableListener)(_this.tabContainer, 'mousedown', function (event) {
|
|
136
137
|
if (event.defaultPrevented) {
|
|
@@ -287,7 +288,8 @@ var TabsContainer = /** @class */ (function (_super) {
|
|
|
287
288
|
_this.accessor.addFloatingGroup(panel_1, {
|
|
288
289
|
x: left - rootLeft,
|
|
289
290
|
y: top_2 - rootTop,
|
|
290
|
-
|
|
291
|
+
inDragMode: true,
|
|
292
|
+
});
|
|
291
293
|
return;
|
|
292
294
|
}
|
|
293
295
|
var isLeftClick = event.button === 0;
|
|
@@ -11,7 +11,7 @@ import { GroupOptions, GroupPanelViewState, DockviewDidDropEvent, DockviewWillDr
|
|
|
11
11
|
import { DockviewGroupPanel } from './dockviewGroupPanel';
|
|
12
12
|
import { Parameters } from '../panel/types';
|
|
13
13
|
import { GroupDragEvent, TabDragEvent } from './components/titlebar/tabsContainer';
|
|
14
|
-
import { Box } from '../types';
|
|
14
|
+
import { AnchoredBox, AnchorPosition, Box } from '../types';
|
|
15
15
|
import { DockviewPanelRenderer, OverlayRenderContainer } from '../overlayRenderContainer';
|
|
16
16
|
export interface PanelReference {
|
|
17
17
|
update: (event: {
|
|
@@ -23,7 +23,7 @@ export interface PanelReference {
|
|
|
23
23
|
}
|
|
24
24
|
export interface SerializedFloatingGroup {
|
|
25
25
|
data: GroupPanelViewState;
|
|
26
|
-
position:
|
|
26
|
+
position: AnchoredBox;
|
|
27
27
|
}
|
|
28
28
|
export interface SerializedPopoutGroup {
|
|
29
29
|
data: GroupPanelViewState;
|
|
@@ -42,6 +42,10 @@ export interface SerializedDockview {
|
|
|
42
42
|
floatingGroups?: SerializedFloatingGroup[];
|
|
43
43
|
popoutGroups?: SerializedPopoutGroup[];
|
|
44
44
|
}
|
|
45
|
+
export interface MovePanelEvent {
|
|
46
|
+
panel: IDockviewPanel;
|
|
47
|
+
from: DockviewGroupPanel;
|
|
48
|
+
}
|
|
45
49
|
type MoveGroupOptions = {
|
|
46
50
|
from: {
|
|
47
51
|
group: DockviewGroupPanel;
|
|
@@ -62,11 +66,24 @@ type MoveGroupOrPanelOptions = {
|
|
|
62
66
|
index?: number;
|
|
63
67
|
};
|
|
64
68
|
};
|
|
69
|
+
export interface FloatingGroupOptions {
|
|
70
|
+
x?: number;
|
|
71
|
+
y?: number;
|
|
72
|
+
height?: number;
|
|
73
|
+
width?: number;
|
|
74
|
+
position?: AnchorPosition;
|
|
75
|
+
}
|
|
76
|
+
export interface FloatingGroupOptionsInternal extends FloatingGroupOptions {
|
|
77
|
+
skipRemoveGroup?: boolean;
|
|
78
|
+
inDragMode?: boolean;
|
|
79
|
+
skipActiveGroup?: boolean;
|
|
80
|
+
}
|
|
65
81
|
export interface IDockviewComponent extends IBaseGrid<DockviewGroupPanel> {
|
|
66
82
|
readonly activePanel: IDockviewPanel | undefined;
|
|
67
83
|
readonly totalPanels: number;
|
|
68
84
|
readonly panels: IDockviewPanel[];
|
|
69
85
|
readonly orientation: Orientation;
|
|
86
|
+
readonly gap: number;
|
|
70
87
|
readonly onDidDrop: Event<DockviewDidDropEvent>;
|
|
71
88
|
readonly onWillDrop: Event<DockviewWillDropEvent>;
|
|
72
89
|
readonly onWillShowOverlay: Event<WillShowOverlayLocationEvent>;
|
|
@@ -80,6 +97,7 @@ export interface IDockviewComponent extends IBaseGrid<DockviewGroupPanel> {
|
|
|
80
97
|
readonly onDidAddGroup: Event<DockviewGroupPanel>;
|
|
81
98
|
readonly onDidActiveGroupChange: Event<DockviewGroupPanel | undefined>;
|
|
82
99
|
readonly onUnhandledDragOverEvent: Event<DockviewDndOverlayEvent>;
|
|
100
|
+
readonly onDidMovePanel: Event<MovePanelEvent>;
|
|
83
101
|
readonly options: DockviewComponentOptions;
|
|
84
102
|
updateOptions(options: DockviewOptions): void;
|
|
85
103
|
moveGroupOrPanel(options: MoveGroupOrPanelOptions): void;
|
|
@@ -98,10 +116,7 @@ export interface IDockviewComponent extends IBaseGrid<DockviewGroupPanel> {
|
|
|
98
116
|
focus(): void;
|
|
99
117
|
toJSON(): SerializedDockview;
|
|
100
118
|
fromJSON(data: SerializedDockview): void;
|
|
101
|
-
addFloatingGroup(item: IDockviewPanel | DockviewGroupPanel,
|
|
102
|
-
x: number;
|
|
103
|
-
y: number;
|
|
104
|
-
}): void;
|
|
119
|
+
addFloatingGroup(item: IDockviewPanel | DockviewGroupPanel, options?: FloatingGroupOptions): void;
|
|
105
120
|
addPopoutGroup(item: IDockviewPanel | DockviewGroupPanel, options?: {
|
|
106
121
|
position?: Box;
|
|
107
122
|
popoutUrl?: string;
|
|
@@ -143,10 +158,10 @@ export declare class DockviewComponent extends BaseGrid<DockviewGroupPanel> impl
|
|
|
143
158
|
private readonly _onDidActivePanelChange;
|
|
144
159
|
readonly onDidActivePanelChange: Event<IDockviewPanel | undefined>;
|
|
145
160
|
private readonly _onDidMovePanel;
|
|
161
|
+
readonly onDidMovePanel: Event<MovePanelEvent>;
|
|
146
162
|
private readonly _floatingGroups;
|
|
147
163
|
private readonly _popoutGroups;
|
|
148
164
|
private readonly _rootDropTarget;
|
|
149
|
-
private _ignoreEvents;
|
|
150
165
|
private readonly _onDidRemoveGroup;
|
|
151
166
|
readonly onDidRemoveGroup: Event<DockviewGroupPanel>;
|
|
152
167
|
protected readonly _onDidAddGroup: Emitter<DockviewGroupPanel>;
|
|
@@ -160,6 +175,7 @@ export declare class DockviewComponent extends BaseGrid<DockviewGroupPanel> impl
|
|
|
160
175
|
get activePanel(): IDockviewPanel | undefined;
|
|
161
176
|
get renderer(): DockviewPanelRenderer;
|
|
162
177
|
get api(): DockviewApi;
|
|
178
|
+
get gap(): number;
|
|
163
179
|
constructor(options: DockviewComponentOptions);
|
|
164
180
|
addPopoutGroup(itemToPopout: DockviewPanel | DockviewGroupPanel, options?: {
|
|
165
181
|
skipRemoveGroup?: boolean;
|
|
@@ -175,16 +191,7 @@ export declare class DockviewComponent extends BaseGrid<DockviewGroupPanel> impl
|
|
|
175
191
|
}) => void;
|
|
176
192
|
overridePopoutGroup?: DockviewGroupPanel;
|
|
177
193
|
}): Promise<void>;
|
|
178
|
-
addFloatingGroup(item: DockviewPanel | DockviewGroupPanel,
|
|
179
|
-
x?: number;
|
|
180
|
-
y?: number;
|
|
181
|
-
height?: number;
|
|
182
|
-
width?: number;
|
|
183
|
-
}, options?: {
|
|
184
|
-
skipRemoveGroup?: boolean;
|
|
185
|
-
inDragMode: boolean;
|
|
186
|
-
skipActiveGroup?: boolean;
|
|
187
|
-
}): void;
|
|
194
|
+
addFloatingGroup(item: DockviewPanel | DockviewGroupPanel, options?: FloatingGroupOptionsInternal): void;
|
|
188
195
|
private orthogonalize;
|
|
189
196
|
updateOptions(options: Partial<DockviewComponentOptions>): void;
|
|
190
197
|
layout(width: number, height: number, forceResize?: boolean | undefined): void;
|