dockview-core 1.16.0 → 1.17.0
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/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 +77 -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 +3 -2
- package/dist/cjs/gridview/baseComponentGridview.js +30 -5
- package/dist/cjs/gridview/gridviewComponent.d.ts +2 -3
- package/dist/cjs/gridview/gridviewComponent.js +2 -2
- package/dist/cjs/gridview/gridviewPanel.d.ts +6 -0
- package/dist/cjs/overlay/overlay.js +6 -6
- package/dist/cjs/paneview/paneviewComponent.d.ts +1 -0
- package/dist/cjs/paneview/paneviewComponent.js +11 -3
- package/dist/cjs/splitview/splitviewComponent.d.ts +4 -4
- package/dist/cjs/splitview/splitviewComponent.js +13 -7
- package/dist/dockview-core.amd.js +231 -103
- 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 +230 -102
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +231 -103
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +231 -103
- 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 +231 -103
- 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 +230 -102
- package/dist/dockview-core.noStyle.js.map +1 -1
- package/dist/esm/api/component.api.d.ts +6 -4
- 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 +76 -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 +3 -2
- package/dist/esm/gridview/baseComponentGridview.js +30 -5
- package/dist/esm/gridview/gridviewComponent.d.ts +2 -3
- package/dist/esm/gridview/gridviewComponent.js +2 -2
- package/dist/esm/gridview/gridviewPanel.d.ts +6 -0
- package/dist/esm/overlay/overlay.js +6 -6
- package/dist/esm/paneview/paneviewComponent.d.ts +1 -0
- package/dist/esm/paneview/paneviewComponent.js +11 -3
- package/dist/esm/splitview/splitviewComponent.d.ts +4 -4
- package/dist/esm/splitview/splitviewComponent.js +13 -7
- package/dist/styles/dockview.css +1 -1
- 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
|
*/
|
|
@@ -9,7 +9,7 @@ export class GroupDragHandler extends DragHandler {
|
|
|
9
9
|
this.accessor = accessor;
|
|
10
10
|
this.group = group;
|
|
11
11
|
this.panelTransfer = LocalSelectionTransfer.getInstance();
|
|
12
|
-
this.addDisposables(addDisposableListener(element, '
|
|
12
|
+
this.addDisposables(addDisposableListener(element, 'pointerdown', (e) => {
|
|
13
13
|
if (e.shiftKey) {
|
|
14
14
|
/**
|
|
15
15
|
* You cannot call e.preventDefault() because that will prevent drag events from firing
|
|
@@ -16,7 +16,7 @@ export class DefaultTab extends CompositeDisposable {
|
|
|
16
16
|
this.action.appendChild(createCloseButton());
|
|
17
17
|
this._element.appendChild(this._content);
|
|
18
18
|
this._element.appendChild(this.action);
|
|
19
|
-
this.addDisposables(addDisposableListener(this.action, '
|
|
19
|
+
this.addDisposables(addDisposableListener(this.action, 'pointerdown', (ev) => {
|
|
20
20
|
ev.preventDefault();
|
|
21
21
|
}));
|
|
22
22
|
this.render();
|
|
@@ -26,7 +26,7 @@ export class DefaultTab extends CompositeDisposable {
|
|
|
26
26
|
this.addDisposables(params.api.onDidTitleChange((event) => {
|
|
27
27
|
this._title = event.title;
|
|
28
28
|
this.render();
|
|
29
|
-
}), addDisposableListener(this.action, '
|
|
29
|
+
}), addDisposableListener(this.action, 'pointerdown', (ev) => {
|
|
30
30
|
ev.preventDefault();
|
|
31
31
|
}), addDisposableListener(this.action, 'click', (ev) => {
|
|
32
32
|
if (ev.defaultPrevented) {
|
|
@@ -64,7 +64,7 @@ export class Tab extends CompositeDisposable {
|
|
|
64
64
|
this.onWillShowOverlay = this.dropTarget.onWillShowOverlay;
|
|
65
65
|
this.addDisposables(this._onChanged, this._onDropped, this._onDragStart, dragHandler.onDragStart((event) => {
|
|
66
66
|
this._onDragStart.fire(event);
|
|
67
|
-
}), dragHandler, addDisposableListener(this._element, '
|
|
67
|
+
}), dragHandler, addDisposableListener(this._element, 'pointerdown', (event) => {
|
|
68
68
|
if (event.defaultPrevented) {
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
@@ -134,7 +134,7 @@ export class TabsContainer extends CompositeDisposable {
|
|
|
134
134
|
group: this.group,
|
|
135
135
|
getData: getPanelData,
|
|
136
136
|
}));
|
|
137
|
-
}), addDisposableListener(this.voidContainer.element, '
|
|
137
|
+
}), addDisposableListener(this.voidContainer.element, 'pointerdown', (event) => {
|
|
138
138
|
const isFloatingGroupsEnabled = !this.accessor.options.disableFloatingGroups;
|
|
139
139
|
if (isFloatingGroupsEnabled &&
|
|
140
140
|
event.shiftKey &&
|
|
@@ -148,7 +148,7 @@ export class TabsContainer extends CompositeDisposable {
|
|
|
148
148
|
inDragMode: true,
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
|
-
}), addDisposableListener(this.tabContainer, '
|
|
151
|
+
}), addDisposableListener(this.tabContainer, 'pointerdown', (event) => {
|
|
152
152
|
if (event.defaultPrevented) {
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
@@ -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
|
}
|
|
@@ -26,34 +26,19 @@ export class Watermark extends CompositeDisposable {
|
|
|
26
26
|
actionsContainer.appendChild(closeAnchor);
|
|
27
27
|
title.appendChild(emptySpace);
|
|
28
28
|
title.appendChild(actionsContainer);
|
|
29
|
-
this.addDisposables(addDisposableListener(closeAnchor, 'click', (
|
|
29
|
+
this.addDisposables(addDisposableListener(closeAnchor, 'click', (event) => {
|
|
30
30
|
var _a;
|
|
31
|
-
|
|
31
|
+
event.preventDefault();
|
|
32
32
|
if (this._group) {
|
|
33
33
|
(_a = this._api) === null || _a === void 0 ? void 0 : _a.removeGroup(this._group);
|
|
34
34
|
}
|
|
35
35
|
}));
|
|
36
36
|
}
|
|
37
|
-
update(_event) {
|
|
38
|
-
// noop
|
|
39
|
-
}
|
|
40
|
-
focus() {
|
|
41
|
-
// noop
|
|
42
|
-
}
|
|
43
|
-
layout(_width, _height) {
|
|
44
|
-
// noop
|
|
45
|
-
}
|
|
46
37
|
init(_params) {
|
|
47
38
|
this._api = _params.containerApi;
|
|
39
|
+
this._group = _params.group;
|
|
48
40
|
this.render();
|
|
49
41
|
}
|
|
50
|
-
updateParentGroup(group, _visible) {
|
|
51
|
-
this._group = group;
|
|
52
|
-
this.render();
|
|
53
|
-
}
|
|
54
|
-
dispose() {
|
|
55
|
-
super.dispose();
|
|
56
|
-
}
|
|
57
42
|
render() {
|
|
58
43
|
const isOneGroup = !!(this._api && this._api.size <= 1);
|
|
59
44
|
toggleClass(this.element, 'has-actions', isOneGroup);
|
|
@@ -20,6 +20,10 @@ export class DefaultDockviewDeserialzier {
|
|
|
20
20
|
const view = new DockviewPanelModel(this.accessor, panelId, contentComponent, tabComponent);
|
|
21
21
|
const panel = new DockviewPanel(panelId, contentComponent, tabComponent, this.accessor, new DockviewApi(this.accessor), group, view, {
|
|
22
22
|
renderer: panelData.renderer,
|
|
23
|
+
minimumWidth: panelData.minimumWidth,
|
|
24
|
+
minimumHeight: panelData.minimumHeight,
|
|
25
|
+
maximumWidth: panelData.maximumWidth,
|
|
26
|
+
maximumHeight: panelData.maximumHeight,
|
|
23
27
|
});
|
|
24
28
|
panel.init({
|
|
25
29
|
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 {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getRelativeLocation, getGridLocation, } from '../gridview/gridview';
|
|
1
|
+
import { getRelativeLocation, getGridLocation, orthogonal, } from '../gridview/gridview';
|
|
2
2
|
import { directionToPosition, Droptarget, } from '../dnd/droptarget';
|
|
3
3
|
import { tail, sequenceEquals, remove } from '../array';
|
|
4
4
|
import { DockviewPanel } from './dockviewPanel';
|
|
@@ -10,13 +10,13 @@ import { DefaultDockviewDeserialzier } from './deserializer';
|
|
|
10
10
|
import { DockviewUnhandledDragOverEvent, isGroupOptionsWithGroup, isGroupOptionsWithPanel, isPanelOptionsWithGroup, isPanelOptionsWithPanel, } from './options';
|
|
11
11
|
import { BaseGrid, toTarget, } from '../gridview/baseComponentGridview';
|
|
12
12
|
import { DockviewApi } from '../api/component.api';
|
|
13
|
-
import { Orientation
|
|
13
|
+
import { Orientation } from '../splitview/splitview';
|
|
14
14
|
import { DockviewDidDropEvent, DockviewWillDropEvent, WillShowOverlayLocationEvent, } from './dockviewGroupPanelModel';
|
|
15
15
|
import { DockviewGroupPanel } from './dockviewGroupPanel';
|
|
16
16
|
import { DockviewPanelModel } from './dockviewPanelModel';
|
|
17
17
|
import { getPanelData } from '../dnd/dataTransfer';
|
|
18
18
|
import { Overlay } from '../overlay/overlay';
|
|
19
|
-
import { addTestId, toggleClass, watchElementResize } from '../dom';
|
|
19
|
+
import { addTestId, getDockviewTheme, toggleClass, watchElementResize, } from '../dom';
|
|
20
20
|
import { DockviewFloatingGroupPanel } from './dockviewFloatingGroupPanel';
|
|
21
21
|
import { DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE, DEFAULT_FLOATING_GROUP_POSITION, } from '../constants';
|
|
22
22
|
import { OverlayRenderContainer, } from '../overlay/overlayRenderContainer';
|
|
@@ -39,25 +39,6 @@ function moveGroupWithoutDestroying(options) {
|
|
|
39
39
|
});
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
function getDockviewTheme(element) {
|
|
43
|
-
function toClassList(element) {
|
|
44
|
-
const list = [];
|
|
45
|
-
for (let i = 0; i < element.classList.length; i++) {
|
|
46
|
-
list.push(element.classList.item(i));
|
|
47
|
-
}
|
|
48
|
-
return list;
|
|
49
|
-
}
|
|
50
|
-
let theme = undefined;
|
|
51
|
-
let parent = element;
|
|
52
|
-
while (parent !== null) {
|
|
53
|
-
theme = toClassList(parent).find((cls) => cls.startsWith('dockview-theme-'));
|
|
54
|
-
if (typeof theme === 'string') {
|
|
55
|
-
break;
|
|
56
|
-
}
|
|
57
|
-
parent = parent.parentElement;
|
|
58
|
-
}
|
|
59
|
-
return theme;
|
|
60
|
-
}
|
|
61
42
|
export class DockviewComponent extends BaseGrid {
|
|
62
43
|
get orientation() {
|
|
63
44
|
return this.gridview.orientation;
|
|
@@ -93,13 +74,12 @@ export class DockviewComponent extends BaseGrid {
|
|
|
93
74
|
}
|
|
94
75
|
constructor(parentElement, options) {
|
|
95
76
|
var _a;
|
|
96
|
-
super({
|
|
77
|
+
super(parentElement, {
|
|
97
78
|
proportionalLayout: true,
|
|
98
79
|
orientation: Orientation.HORIZONTAL,
|
|
99
80
|
styles: options.hideBorders
|
|
100
81
|
? { separatorBorder: 'transparent' }
|
|
101
82
|
: undefined,
|
|
102
|
-
parentElement: parentElement,
|
|
103
83
|
disableAutoResizing: options.disableAutoResizing,
|
|
104
84
|
locked: options.locked,
|
|
105
85
|
margin: options.gap,
|
|
@@ -139,9 +119,6 @@ export class DockviewComponent extends BaseGrid {
|
|
|
139
119
|
this._onDidActiveGroupChange = new Emitter();
|
|
140
120
|
this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
|
|
141
121
|
this._moving = false;
|
|
142
|
-
// const gready = document.createElement('div');
|
|
143
|
-
// gready.className = 'dv-overlay-render-container';
|
|
144
|
-
// this.gridview.element.appendChild(gready);
|
|
145
122
|
this.overlayRenderContainer = new OverlayRenderContainer(this.gridview.element, this);
|
|
146
123
|
toggleClass(this.gridview.element, 'dv-dockview', true);
|
|
147
124
|
toggleClass(this.element, 'dv-debug', !!options.debug);
|
|
@@ -592,15 +569,11 @@ export class DockviewComponent extends BaseGrid {
|
|
|
592
569
|
}
|
|
593
570
|
}
|
|
594
571
|
updateOptions(options) {
|
|
595
|
-
var _a, _b;
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
const changed_rootOverlayOptions = 'rootOverlayModel' in options &&
|
|
599
|
-
options.rootOverlayModel !== this.options.rootOverlayModel;
|
|
600
|
-
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
601
|
-
if (changed_floatingGroupBounds) {
|
|
572
|
+
var _a, _b, _c, _d;
|
|
573
|
+
super.updateOptions(options);
|
|
574
|
+
if ('floatingGroupBounds' in options) {
|
|
602
575
|
for (const group of this._floatingGroups) {
|
|
603
|
-
switch (
|
|
576
|
+
switch (options.floatingGroupBounds) {
|
|
604
577
|
case 'boundedWithinViewport':
|
|
605
578
|
group.overlay.minimumInViewportHeight = undefined;
|
|
606
579
|
group.overlay.minimumInViewportWidth = undefined;
|
|
@@ -613,25 +586,20 @@ export class DockviewComponent extends BaseGrid {
|
|
|
613
586
|
break;
|
|
614
587
|
default:
|
|
615
588
|
group.overlay.minimumInViewportHeight =
|
|
616
|
-
(_a =
|
|
589
|
+
(_a = options.floatingGroupBounds) === null || _a === void 0 ? void 0 : _a.minimumHeightWithinViewport;
|
|
617
590
|
group.overlay.minimumInViewportWidth =
|
|
618
|
-
(_b =
|
|
591
|
+
(_b = options.floatingGroupBounds) === null || _b === void 0 ? void 0 : _b.minimumWidthWithinViewport;
|
|
619
592
|
}
|
|
620
593
|
group.overlay.setBounds();
|
|
621
594
|
}
|
|
622
595
|
}
|
|
623
|
-
if (
|
|
624
|
-
this._rootDropTarget.setOverlayModel(options.rootOverlayModel);
|
|
625
|
-
}
|
|
626
|
-
if (
|
|
627
|
-
// if explicitly set as `undefined`
|
|
628
|
-
'gap' in options &&
|
|
629
|
-
options.gap === undefined) {
|
|
630
|
-
this.gridview.margin = 0;
|
|
596
|
+
if ('rootOverlayModel' in options) {
|
|
597
|
+
this._rootDropTarget.setOverlayModel((_c = options.rootOverlayModel) !== null && _c !== void 0 ? _c : DEFAULT_ROOT_OVERLAY_MODEL);
|
|
631
598
|
}
|
|
632
|
-
if (
|
|
633
|
-
this.gridview.margin = options.gap;
|
|
599
|
+
if ('gap' in options) {
|
|
600
|
+
this.gridview.margin = (_d = options.gap) !== null && _d !== void 0 ? _d : 0;
|
|
634
601
|
}
|
|
602
|
+
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
635
603
|
this.layout(this.gridview.width, this.gridview.height, true);
|
|
636
604
|
}
|
|
637
605
|
layout(width, height, forceResize) {
|
|
@@ -888,6 +856,10 @@ export class DockviewComponent extends BaseGrid {
|
|
|
888
856
|
if (options.position && options.floating) {
|
|
889
857
|
throw new Error('you can only provide one of: position, floating as arguments to .addPanel(...)');
|
|
890
858
|
}
|
|
859
|
+
const initial = {
|
|
860
|
+
width: options.initialWidth,
|
|
861
|
+
height: options.initialHeight,
|
|
862
|
+
};
|
|
891
863
|
if (options.position) {
|
|
892
864
|
if (isPanelOptionsWithPanel(options.position)) {
|
|
893
865
|
const referencePanel = typeof options.position.referencePanel === 'string'
|
|
@@ -917,6 +889,10 @@ export class DockviewComponent extends BaseGrid {
|
|
|
917
889
|
if (!options.inactive) {
|
|
918
890
|
this.doSetGroupAndPanelActive(group);
|
|
919
891
|
}
|
|
892
|
+
group.api.setSize({
|
|
893
|
+
height: initial === null || initial === void 0 ? void 0 : initial.height,
|
|
894
|
+
width: initial === null || initial === void 0 ? void 0 : initial.width,
|
|
895
|
+
});
|
|
920
896
|
return panel;
|
|
921
897
|
}
|
|
922
898
|
}
|
|
@@ -947,6 +923,10 @@ export class DockviewComponent extends BaseGrid {
|
|
|
947
923
|
skipSetActive: options.inactive,
|
|
948
924
|
skipSetGroupActive: options.inactive,
|
|
949
925
|
});
|
|
926
|
+
referenceGroup.api.setSize({
|
|
927
|
+
width: initial === null || initial === void 0 ? void 0 : initial.width,
|
|
928
|
+
height: initial === null || initial === void 0 ? void 0 : initial.height,
|
|
929
|
+
});
|
|
950
930
|
if (!options.inactive) {
|
|
951
931
|
this.doSetGroupAndPanelActive(referenceGroup);
|
|
952
932
|
}
|
|
@@ -954,7 +934,10 @@ export class DockviewComponent extends BaseGrid {
|
|
|
954
934
|
else {
|
|
955
935
|
const location = getGridLocation(referenceGroup.element);
|
|
956
936
|
const relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
|
|
957
|
-
const group = this.createGroupAtLocation(relativeLocation)
|
|
937
|
+
const group = this.createGroupAtLocation(relativeLocation, this.orientationAtLocation(relativeLocation) ===
|
|
938
|
+
Orientation.VERTICAL
|
|
939
|
+
? initial === null || initial === void 0 ? void 0 : initial.height
|
|
940
|
+
: initial === null || initial === void 0 ? void 0 : initial.width);
|
|
958
941
|
panel = this.createPanel(options, group);
|
|
959
942
|
group.model.openPanel(panel, {
|
|
960
943
|
skipSetActive: options.inactive,
|
|
@@ -980,7 +963,9 @@ export class DockviewComponent extends BaseGrid {
|
|
|
980
963
|
});
|
|
981
964
|
}
|
|
982
965
|
else {
|
|
983
|
-
const group = this.createGroupAtLocation(
|
|
966
|
+
const group = this.createGroupAtLocation([0], this.gridview.orientation === Orientation.VERTICAL
|
|
967
|
+
? initial === null || initial === void 0 ? void 0 : initial.height
|
|
968
|
+
: initial === null || initial === void 0 ? void 0 : initial.width);
|
|
984
969
|
panel = this.createPanel(options, group);
|
|
985
970
|
group.model.openPanel(panel, {
|
|
986
971
|
skipSetActive: options.inactive,
|
|
@@ -1074,7 +1059,11 @@ export class DockviewComponent extends BaseGrid {
|
|
|
1074
1059
|
const location = getGridLocation(referenceGroup.element);
|
|
1075
1060
|
const relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
|
|
1076
1061
|
const group = this.createGroup(options);
|
|
1077
|
-
this.
|
|
1062
|
+
const size = this.getLocationOrientation(relativeLocation) ===
|
|
1063
|
+
Orientation.VERTICAL
|
|
1064
|
+
? options.initialHeight
|
|
1065
|
+
: options.initialWidth;
|
|
1066
|
+
this.doAddGroup(group, relativeLocation, size);
|
|
1078
1067
|
if (!options.skipSetActive) {
|
|
1079
1068
|
this.doSetGroupAndPanelActive(group);
|
|
1080
1069
|
}
|
|
@@ -1087,6 +1076,12 @@ export class DockviewComponent extends BaseGrid {
|
|
|
1087
1076
|
return group;
|
|
1088
1077
|
}
|
|
1089
1078
|
}
|
|
1079
|
+
getLocationOrientation(location) {
|
|
1080
|
+
return location.length % 2 == 0 &&
|
|
1081
|
+
this.gridview.orientation === Orientation.HORIZONTAL
|
|
1082
|
+
? Orientation.HORIZONTAL
|
|
1083
|
+
: Orientation.VERTICAL;
|
|
1084
|
+
}
|
|
1090
1085
|
removeGroup(group, options) {
|
|
1091
1086
|
this.doRemoveGroup(group, options);
|
|
1092
1087
|
}
|
|
@@ -1358,7 +1353,22 @@ export class DockviewComponent extends BaseGrid {
|
|
|
1358
1353
|
}
|
|
1359
1354
|
const referenceLocation = getGridLocation(to.element);
|
|
1360
1355
|
const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, target);
|
|
1361
|
-
|
|
1356
|
+
let size;
|
|
1357
|
+
switch (this.gridview.orientation) {
|
|
1358
|
+
case Orientation.VERTICAL:
|
|
1359
|
+
size =
|
|
1360
|
+
referenceLocation.length % 2 == 0
|
|
1361
|
+
? from.api.width
|
|
1362
|
+
: from.api.height;
|
|
1363
|
+
break;
|
|
1364
|
+
case Orientation.HORIZONTAL:
|
|
1365
|
+
size =
|
|
1366
|
+
referenceLocation.length % 2 == 0
|
|
1367
|
+
? from.api.height
|
|
1368
|
+
: from.api.width;
|
|
1369
|
+
break;
|
|
1370
|
+
}
|
|
1371
|
+
this.gridview.addView(from, size, dropLocation);
|
|
1362
1372
|
}
|
|
1363
1373
|
from.panels.forEach((panel) => {
|
|
1364
1374
|
this._onDidMovePanel.fire({ panel, from });
|
|
@@ -1470,20 +1480,32 @@ export class DockviewComponent extends BaseGrid {
|
|
|
1470
1480
|
const contentComponent = options.component;
|
|
1471
1481
|
const tabComponent = (_a = options.tabComponent) !== null && _a !== void 0 ? _a : this.options.defaultTabComponent;
|
|
1472
1482
|
const view = new DockviewPanelModel(this, options.id, contentComponent, tabComponent);
|
|
1473
|
-
const panel = new DockviewPanel(options.id, contentComponent, tabComponent, this, this._api, group, view, {
|
|
1483
|
+
const panel = new DockviewPanel(options.id, contentComponent, tabComponent, this, this._api, group, view, {
|
|
1484
|
+
renderer: options.renderer,
|
|
1485
|
+
minimumWidth: options.minimumWidth,
|
|
1486
|
+
minimumHeight: options.minimumHeight,
|
|
1487
|
+
maximumWidth: options.maximumWidth,
|
|
1488
|
+
maximumHeight: options.maximumHeight,
|
|
1489
|
+
});
|
|
1474
1490
|
panel.init({
|
|
1475
1491
|
title: (_b = options.title) !== null && _b !== void 0 ? _b : options.id,
|
|
1476
1492
|
params: (_c = options === null || options === void 0 ? void 0 : options.params) !== null && _c !== void 0 ? _c : {},
|
|
1477
1493
|
});
|
|
1478
1494
|
return panel;
|
|
1479
1495
|
}
|
|
1480
|
-
createGroupAtLocation(location
|
|
1496
|
+
createGroupAtLocation(location, size) {
|
|
1481
1497
|
const group = this.createGroup();
|
|
1482
|
-
this.doAddGroup(group, location);
|
|
1498
|
+
this.doAddGroup(group, location, size);
|
|
1483
1499
|
return group;
|
|
1484
1500
|
}
|
|
1485
1501
|
findGroup(panel) {
|
|
1486
1502
|
var _a;
|
|
1487
1503
|
return (_a = Array.from(this._groups.values()).find((group) => group.value.model.containsPanel(panel))) === null || _a === void 0 ? void 0 : _a.value;
|
|
1488
1504
|
}
|
|
1505
|
+
orientationAtLocation(location) {
|
|
1506
|
+
const rootOrientation = this.gridview.orientation;
|
|
1507
|
+
return location.length % 2 == 1
|
|
1508
|
+
? rootOrientation
|
|
1509
|
+
: orthogonal(rootOrientation);
|
|
1510
|
+
}
|
|
1489
1511
|
}
|
|
@@ -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;
|
|
@@ -4,6 +4,34 @@ import { DockviewGroupPanelApiImpl, } from '../api/dockviewGroupPanelApi';
|
|
|
4
4
|
const MINIMUM_DOCKVIEW_GROUP_PANEL_WIDTH = 100;
|
|
5
5
|
const MINIMUM_DOCKVIEW_GROUP_PANEL_HEIGHT = 100;
|
|
6
6
|
export class DockviewGroupPanel extends GridviewPanel {
|
|
7
|
+
get minimumWidth() {
|
|
8
|
+
var _a;
|
|
9
|
+
const activePanelMinimumWidth = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.minimumWidth;
|
|
10
|
+
return typeof activePanelMinimumWidth === 'number'
|
|
11
|
+
? activePanelMinimumWidth
|
|
12
|
+
: MINIMUM_DOCKVIEW_GROUP_PANEL_WIDTH;
|
|
13
|
+
}
|
|
14
|
+
get minimumHeight() {
|
|
15
|
+
var _a;
|
|
16
|
+
const activePanelMinimumHeight = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.minimumHeight;
|
|
17
|
+
return typeof activePanelMinimumHeight === 'number'
|
|
18
|
+
? activePanelMinimumHeight
|
|
19
|
+
: MINIMUM_DOCKVIEW_GROUP_PANEL_HEIGHT;
|
|
20
|
+
}
|
|
21
|
+
get maximumWidth() {
|
|
22
|
+
var _a;
|
|
23
|
+
const activePanelMaximumWidth = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.maximumWidth;
|
|
24
|
+
return typeof activePanelMaximumWidth === 'number'
|
|
25
|
+
? activePanelMaximumWidth
|
|
26
|
+
: Number.MAX_SAFE_INTEGER;
|
|
27
|
+
}
|
|
28
|
+
get maximumHeight() {
|
|
29
|
+
var _a;
|
|
30
|
+
const activePanelMaximumHeight = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.maximumHeight;
|
|
31
|
+
return typeof activePanelMaximumHeight === 'number'
|
|
32
|
+
? activePanelMaximumHeight
|
|
33
|
+
: Number.MAX_SAFE_INTEGER;
|
|
34
|
+
}
|
|
7
35
|
get panels() {
|
|
8
36
|
return this._model.panels;
|
|
9
37
|
}
|
|
@@ -26,9 +54,12 @@ export class DockviewGroupPanel extends GridviewPanel {
|
|
|
26
54
|
return this._model.header;
|
|
27
55
|
}
|
|
28
56
|
constructor(accessor, id, options) {
|
|
57
|
+
var _a, _b, _c, _d, _e, _f;
|
|
29
58
|
super(id, 'groupview_default', {
|
|
30
|
-
minimumHeight: MINIMUM_DOCKVIEW_GROUP_PANEL_HEIGHT,
|
|
31
|
-
minimumWidth: MINIMUM_DOCKVIEW_GROUP_PANEL_WIDTH,
|
|
59
|
+
minimumHeight: (_b = (_a = options.constraints) === null || _a === void 0 ? void 0 : _a.minimumHeight) !== null && _b !== void 0 ? _b : MINIMUM_DOCKVIEW_GROUP_PANEL_HEIGHT,
|
|
60
|
+
minimumWidth: (_d = (_c = options.constraints) === null || _c === void 0 ? void 0 : _c.maximumHeight) !== null && _d !== void 0 ? _d : MINIMUM_DOCKVIEW_GROUP_PANEL_WIDTH,
|
|
61
|
+
maximumHeight: (_e = options.constraints) === null || _e === void 0 ? void 0 : _e.maximumHeight,
|
|
62
|
+
maximumWidth: (_f = options.constraints) === null || _f === void 0 ? void 0 : _f.maximumWidth,
|
|
32
63
|
}, new DockviewGroupPanelApiImpl(id, accessor));
|
|
33
64
|
this.api.initialize(this); // cannot use 'this' after after 'super' call
|
|
34
65
|
this._model = new DockviewGroupPanelModel(this.element, accessor, id, options, this);
|
|
@@ -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[];
|
|
@@ -540,7 +540,6 @@ export class DockviewGroupPanelModel extends CompositeDisposable {
|
|
|
540
540
|
});
|
|
541
541
|
this.tabsContainer.hide();
|
|
542
542
|
this.contentContainer.element.appendChild(this.watermark.element);
|
|
543
|
-
this.watermark.updateParentGroup(this.groupPanel, true);
|
|
544
543
|
}
|
|
545
544
|
if (!this.isEmpty && this.watermark) {
|
|
546
545
|
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;
|
|
@@ -15,6 +15,18 @@ export class DockviewPanel extends CompositeDisposable {
|
|
|
15
15
|
var _a;
|
|
16
16
|
return (_a = this._renderer) !== null && _a !== void 0 ? _a : this.accessor.renderer;
|
|
17
17
|
}
|
|
18
|
+
get minimumWidth() {
|
|
19
|
+
return this._minimumWidth;
|
|
20
|
+
}
|
|
21
|
+
get minimumHeight() {
|
|
22
|
+
return this._minimumHeight;
|
|
23
|
+
}
|
|
24
|
+
get maximumWidth() {
|
|
25
|
+
return this._maximumWidth;
|
|
26
|
+
}
|
|
27
|
+
get maximumHeight() {
|
|
28
|
+
return this._maximumHeight;
|
|
29
|
+
}
|
|
18
30
|
constructor(id, component, tabComponent, accessor, containerApi, group, view, options) {
|
|
19
31
|
super();
|
|
20
32
|
this.id = id;
|
|
@@ -23,6 +35,10 @@ export class DockviewPanel extends CompositeDisposable {
|
|
|
23
35
|
this.view = view;
|
|
24
36
|
this._renderer = options.renderer;
|
|
25
37
|
this._group = group;
|
|
38
|
+
this._minimumWidth = options.minimumWidth;
|
|
39
|
+
this._minimumHeight = options.minimumHeight;
|
|
40
|
+
this._maximumWidth = options.maximumWidth;
|
|
41
|
+
this._maximumHeight = options.maximumHeight;
|
|
26
42
|
this.api = new DockviewPanelApiImpl(this, this._group, accessor, component, tabComponent);
|
|
27
43
|
this.addDisposables(this.api.onActiveChange(() => {
|
|
28
44
|
accessor.setActivePanel(this);
|
|
@@ -59,6 +75,10 @@ export class DockviewPanel extends CompositeDisposable {
|
|
|
59
75
|
: undefined,
|
|
60
76
|
title: this.title,
|
|
61
77
|
renderer: this._renderer,
|
|
78
|
+
minimumHeight: this._minimumHeight,
|
|
79
|
+
maximumHeight: this._maximumHeight,
|
|
80
|
+
minimumWidth: this._minimumWidth,
|
|
81
|
+
maximumWidth: this._maximumWidth,
|
|
62
82
|
};
|
|
63
83
|
}
|
|
64
84
|
setTitle(title) {
|