dockview-core 1.10.0 → 1.10.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 +10 -2
- package/dist/cjs/api/component.api.js +10 -2
- package/dist/cjs/api/dockviewPanelApi.d.ts +1 -0
- package/dist/cjs/api/dockviewPanelApi.js +33 -24
- package/dist/cjs/api/panelApi.d.ts +4 -13
- package/dist/cjs/api/panelApi.js +5 -15
- package/dist/cjs/dockview/components/panel/content.js +1 -1
- package/dist/cjs/dockview/components/titlebar/voidContainer.js +1 -1
- package/dist/cjs/dockview/dockviewComponent.js +15 -7
- package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +3 -4
- package/dist/cjs/dockview/options.d.ts +3 -3
- package/dist/cjs/dockview/types.d.ts +0 -1
- package/dist/cjs/gridview/gridviewPanel.js +3 -3
- package/dist/cjs/lifecycle.d.ts +1 -1
- package/dist/cjs/paneview/paneview.d.ts +1 -0
- package/dist/cjs/paneview/paneview.js +3 -0
- package/dist/cjs/paneview/paneviewComponent.d.ts +2 -0
- package/dist/cjs/paneview/paneviewComponent.js +6 -0
- package/dist/cjs/paneview/paneviewPanel.d.ts +2 -0
- package/dist/cjs/paneview/paneviewPanel.js +5 -1
- package/dist/cjs/splitview/splitviewComponent.d.ts +1 -1
- package/dist/cjs/splitview/splitviewComponent.js +5 -5
- package/dist/cjs/splitview/splitviewPanel.js +3 -3
- package/dist/dockview-core.amd.js +90 -58
- 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 +90 -58
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +90 -58
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +90 -58
- 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 +90 -58
- 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 +90 -58
- package/dist/dockview-core.noStyle.js.map +1 -1
- package/dist/esm/api/component.api.d.ts +10 -2
- package/dist/esm/api/component.api.js +10 -2
- package/dist/esm/api/dockviewPanelApi.d.ts +1 -0
- package/dist/esm/api/dockviewPanelApi.js +32 -23
- package/dist/esm/api/panelApi.d.ts +4 -13
- package/dist/esm/api/panelApi.js +5 -11
- package/dist/esm/dockview/components/panel/content.js +1 -1
- package/dist/esm/dockview/components/titlebar/voidContainer.js +1 -1
- package/dist/esm/dockview/dockviewComponent.js +16 -8
- package/dist/esm/dockview/dockviewGroupPanelModel.d.ts +3 -4
- package/dist/esm/dockview/options.d.ts +3 -3
- package/dist/esm/dockview/types.d.ts +0 -1
- package/dist/esm/gridview/gridviewPanel.js +3 -3
- package/dist/esm/lifecycle.d.ts +1 -1
- package/dist/esm/paneview/paneview.d.ts +1 -0
- package/dist/esm/paneview/paneview.js +3 -0
- package/dist/esm/paneview/paneviewComponent.d.ts +2 -0
- package/dist/esm/paneview/paneviewComponent.js +6 -0
- package/dist/esm/paneview/paneviewPanel.d.ts +2 -0
- package/dist/esm/paneview/paneviewPanel.js +5 -1
- package/dist/esm/splitview/splitviewComponent.d.ts +1 -1
- package/dist/esm/splitview/splitviewComponent.js +5 -5
- package/dist/esm/splitview/splitviewPanel.js +3 -3
- package/package.json +1 -1
|
@@ -374,15 +374,23 @@ export declare class DockviewApi implements CommonApi<SerializedDockview> {
|
|
|
374
374
|
*/
|
|
375
375
|
get onWillDrop(): Event<DockviewWillDropEvent>;
|
|
376
376
|
/**
|
|
377
|
+
* Invoked before an overlay is shown indicating a drop target.
|
|
377
378
|
*
|
|
379
|
+
* Calling `event.preventDefault()` will prevent the overlay being shown and prevent
|
|
380
|
+
* the any subsequent drop event.
|
|
378
381
|
*/
|
|
379
382
|
get onWillShowOverlay(): Event<WillShowOverlayLocationEvent>;
|
|
380
383
|
/**
|
|
381
|
-
* Invoked before a group is dragged.
|
|
384
|
+
* Invoked before a group is dragged.
|
|
385
|
+
*
|
|
386
|
+
* Calling `event.nativeEvent.preventDefault()` will prevent the group drag starting.
|
|
387
|
+
*
|
|
382
388
|
*/
|
|
383
389
|
get onWillDragGroup(): Event<GroupDragEvent>;
|
|
384
390
|
/**
|
|
385
|
-
* Invoked before a panel is dragged.
|
|
391
|
+
* Invoked before a panel is dragged.
|
|
392
|
+
*
|
|
393
|
+
* Calling `event.nativeEvent.preventDefault()` will prevent the panel drag starting.
|
|
386
394
|
*/
|
|
387
395
|
get onWillDragPanel(): Event<TabDragEvent>;
|
|
388
396
|
/**
|
|
@@ -516,19 +516,27 @@ export class DockviewApi {
|
|
|
516
516
|
return this.component.onWillDrop;
|
|
517
517
|
}
|
|
518
518
|
/**
|
|
519
|
+
* Invoked before an overlay is shown indicating a drop target.
|
|
519
520
|
*
|
|
521
|
+
* Calling `event.preventDefault()` will prevent the overlay being shown and prevent
|
|
522
|
+
* the any subsequent drop event.
|
|
520
523
|
*/
|
|
521
524
|
get onWillShowOverlay() {
|
|
522
525
|
return this.component.onWillShowOverlay;
|
|
523
526
|
}
|
|
524
527
|
/**
|
|
525
|
-
* Invoked before a group is dragged.
|
|
528
|
+
* Invoked before a group is dragged.
|
|
529
|
+
*
|
|
530
|
+
* Calling `event.nativeEvent.preventDefault()` will prevent the group drag starting.
|
|
531
|
+
*
|
|
526
532
|
*/
|
|
527
533
|
get onWillDragGroup() {
|
|
528
534
|
return this.component.onWillDragGroup;
|
|
529
535
|
}
|
|
530
536
|
/**
|
|
531
|
-
* Invoked before a panel is dragged.
|
|
537
|
+
* Invoked before a panel is dragged.
|
|
538
|
+
*
|
|
539
|
+
* Calling `event.nativeEvent.preventDefault()` will prevent the panel drag starting.
|
|
532
540
|
*/
|
|
533
541
|
get onWillDragPanel() {
|
|
534
542
|
return this.component.onWillDragPanel;
|
|
@@ -15,32 +15,11 @@ export class DockviewPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
15
15
|
return this.panel.renderer;
|
|
16
16
|
}
|
|
17
17
|
set group(value) {
|
|
18
|
-
const
|
|
18
|
+
const oldGroup = this._group;
|
|
19
19
|
if (this._group !== value) {
|
|
20
20
|
this._group = value;
|
|
21
21
|
this._onDidGroupChange.fire({});
|
|
22
|
-
|
|
23
|
-
this.groupEventsDisposable.value = new CompositeDisposable(this.group.api.onDidLocationChange((event) => {
|
|
24
|
-
if (this.group !== this.panel.group) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
this._onDidLocationChange.fire(event);
|
|
28
|
-
}), this.group.api.onDidActiveChange(() => {
|
|
29
|
-
if (this.group !== this.panel.group) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
if (_trackGroupActive !== this.isGroupActive) {
|
|
33
|
-
_trackGroupActive = this.isGroupActive;
|
|
34
|
-
this._onDidActiveGroupChange.fire({
|
|
35
|
-
isActive: this.isGroupActive,
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
}));
|
|
39
|
-
// if (this.isGroupActive !== isOldGroupActive) {
|
|
40
|
-
// this._onDidActiveGroupChange.fire({
|
|
41
|
-
// isActive: this.isGroupActive,
|
|
42
|
-
// });
|
|
43
|
-
// }
|
|
22
|
+
this.setupGroupEventListeners(oldGroup);
|
|
44
23
|
this._onDidLocationChange.fire({
|
|
45
24
|
location: this.group.api.location,
|
|
46
25
|
});
|
|
@@ -66,6 +45,7 @@ export class DockviewPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
66
45
|
this.groupEventsDisposable = new MutableDisposable();
|
|
67
46
|
this.initialize(panel);
|
|
68
47
|
this._group = group;
|
|
48
|
+
this.setupGroupEventListeners();
|
|
69
49
|
this.addDisposables(this.groupEventsDisposable, this._onDidRendererChange, this._onDidTitleChange, this._onDidGroupChange, this._onDidActiveGroupChange, this._onDidLocationChange);
|
|
70
50
|
}
|
|
71
51
|
getWindow() {
|
|
@@ -100,4 +80,33 @@ export class DockviewPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
100
80
|
exitMaximized() {
|
|
101
81
|
this.group.api.exitMaximized();
|
|
102
82
|
}
|
|
83
|
+
setupGroupEventListeners(previousGroup) {
|
|
84
|
+
var _a;
|
|
85
|
+
let _trackGroupActive = (_a = previousGroup === null || previousGroup === void 0 ? void 0 : previousGroup.isActive) !== null && _a !== void 0 ? _a : false; // prevent duplicate events with same state
|
|
86
|
+
this.groupEventsDisposable.value = new CompositeDisposable(this.group.api.onDidVisibilityChange((event) => {
|
|
87
|
+
if (!event.isVisible && this.isVisible) {
|
|
88
|
+
this._onDidVisibilityChange.fire(event);
|
|
89
|
+
}
|
|
90
|
+
else if (event.isVisible &&
|
|
91
|
+
!this.isVisible &&
|
|
92
|
+
this.group.model.isPanelActive(this.panel)) {
|
|
93
|
+
this._onDidVisibilityChange.fire(event);
|
|
94
|
+
}
|
|
95
|
+
}), this.group.api.onDidLocationChange((event) => {
|
|
96
|
+
if (this.group !== this.panel.group) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
this._onDidLocationChange.fire(event);
|
|
100
|
+
}), this.group.api.onDidActiveChange(() => {
|
|
101
|
+
if (this.group !== this.panel.group) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (_trackGroupActive !== this.isGroupActive) {
|
|
105
|
+
_trackGroupActive = this.isGroupActive;
|
|
106
|
+
this._onDidActiveGroupChange.fire({
|
|
107
|
+
isActive: this.isGroupActive,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}));
|
|
111
|
+
}
|
|
103
112
|
}
|
|
@@ -11,9 +11,6 @@ export interface PanelDimensionChangeEvent {
|
|
|
11
11
|
export interface VisibilityEvent {
|
|
12
12
|
readonly isVisible: boolean;
|
|
13
13
|
}
|
|
14
|
-
export interface HiddenEvent {
|
|
15
|
-
readonly isHidden: boolean;
|
|
16
|
-
}
|
|
17
14
|
export interface ActiveEvent {
|
|
18
15
|
readonly isActive: boolean;
|
|
19
16
|
}
|
|
@@ -22,8 +19,8 @@ export interface PanelApi {
|
|
|
22
19
|
readonly onDidFocusChange: Event<FocusEvent>;
|
|
23
20
|
readonly onDidVisibilityChange: Event<VisibilityEvent>;
|
|
24
21
|
readonly onDidActiveChange: Event<ActiveEvent>;
|
|
25
|
-
readonly onDidHiddenChange: Event<HiddenEvent>;
|
|
26
22
|
setActive(): void;
|
|
23
|
+
setVisible(isVisible: boolean): void;
|
|
27
24
|
updateParameters(parameters: Parameters): void;
|
|
28
25
|
/**
|
|
29
26
|
* The id of the panel that would have been assigned when the panel was created
|
|
@@ -41,10 +38,6 @@ export interface PanelApi {
|
|
|
41
38
|
* Whether the panel is visible
|
|
42
39
|
*/
|
|
43
40
|
readonly isVisible: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* Whether the panel is hidden
|
|
46
|
-
*/
|
|
47
|
-
readonly isHidden: boolean;
|
|
48
41
|
/**
|
|
49
42
|
* The panel width in pixels
|
|
50
43
|
*/
|
|
@@ -66,7 +59,6 @@ export declare class PanelApiImpl extends CompositeDisposable implements PanelAp
|
|
|
66
59
|
private _isFocused;
|
|
67
60
|
private _isActive;
|
|
68
61
|
private _isVisible;
|
|
69
|
-
private _isHidden;
|
|
70
62
|
private _width;
|
|
71
63
|
private _height;
|
|
72
64
|
private readonly panelUpdatesDisposable;
|
|
@@ -78,8 +70,8 @@ export declare class PanelApiImpl extends CompositeDisposable implements PanelAp
|
|
|
78
70
|
readonly onWillFocus: Event<WillFocusEvent>;
|
|
79
71
|
readonly _onDidVisibilityChange: Emitter<VisibilityEvent>;
|
|
80
72
|
readonly onDidVisibilityChange: Event<VisibilityEvent>;
|
|
81
|
-
readonly
|
|
82
|
-
readonly
|
|
73
|
+
readonly _onWillVisibilityChange: Emitter<VisibilityEvent>;
|
|
74
|
+
readonly onWillVisibilityChange: Event<VisibilityEvent>;
|
|
83
75
|
readonly _onDidActiveChange: Emitter<ActiveEvent>;
|
|
84
76
|
readonly onDidActiveChange: Event<ActiveEvent>;
|
|
85
77
|
readonly _onActiveChange: Emitter<void>;
|
|
@@ -89,12 +81,11 @@ export declare class PanelApiImpl extends CompositeDisposable implements PanelAp
|
|
|
89
81
|
get isFocused(): boolean;
|
|
90
82
|
get isActive(): boolean;
|
|
91
83
|
get isVisible(): boolean;
|
|
92
|
-
get isHidden(): boolean;
|
|
93
84
|
get width(): number;
|
|
94
85
|
get height(): number;
|
|
95
86
|
constructor(id: string);
|
|
96
87
|
initialize(panel: IPanel): void;
|
|
97
|
-
|
|
88
|
+
setVisible(isVisible: boolean): void;
|
|
98
89
|
setActive(): void;
|
|
99
90
|
updateParameters(parameters: Parameters): void;
|
|
100
91
|
}
|
package/dist/esm/api/panelApi.js
CHANGED
|
@@ -18,9 +18,6 @@ export class PanelApiImpl extends CompositeDisposable {
|
|
|
18
18
|
get isVisible() {
|
|
19
19
|
return this._isVisible;
|
|
20
20
|
}
|
|
21
|
-
get isHidden() {
|
|
22
|
-
return this._isHidden;
|
|
23
|
-
}
|
|
24
21
|
get width() {
|
|
25
22
|
return this._width;
|
|
26
23
|
}
|
|
@@ -33,7 +30,6 @@ export class PanelApiImpl extends CompositeDisposable {
|
|
|
33
30
|
this._isFocused = false;
|
|
34
31
|
this._isActive = false;
|
|
35
32
|
this._isVisible = true;
|
|
36
|
-
this._isHidden = false;
|
|
37
33
|
this._width = 0;
|
|
38
34
|
this._height = 0;
|
|
39
35
|
this.panelUpdatesDisposable = new MutableDisposable();
|
|
@@ -47,8 +43,8 @@ export class PanelApiImpl extends CompositeDisposable {
|
|
|
47
43
|
//
|
|
48
44
|
this._onDidVisibilityChange = new Emitter();
|
|
49
45
|
this.onDidVisibilityChange = this._onDidVisibilityChange.event;
|
|
50
|
-
this.
|
|
51
|
-
this.
|
|
46
|
+
this._onWillVisibilityChange = new Emitter();
|
|
47
|
+
this.onWillVisibilityChange = this._onWillVisibilityChange.event;
|
|
52
48
|
this._onDidActiveChange = new Emitter();
|
|
53
49
|
this.onDidActiveChange = this._onDidActiveChange.event;
|
|
54
50
|
this._onActiveChange = new Emitter();
|
|
@@ -61,12 +57,10 @@ export class PanelApiImpl extends CompositeDisposable {
|
|
|
61
57
|
this._isActive = event.isActive;
|
|
62
58
|
}), this.onDidVisibilityChange((event) => {
|
|
63
59
|
this._isVisible = event.isVisible;
|
|
64
|
-
}), this.onDidHiddenChange((event) => {
|
|
65
|
-
this._isHidden = event.isHidden;
|
|
66
60
|
}), this.onDidDimensionsChange((event) => {
|
|
67
61
|
this._width = event.width;
|
|
68
62
|
this._height = event.height;
|
|
69
|
-
}), this.panelUpdatesDisposable, this._onDidDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onWillFocus, this._onActiveChange, this._onUpdateParameters, this._onWillFocus, this.
|
|
63
|
+
}), this.panelUpdatesDisposable, this._onDidDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onWillFocus, this._onActiveChange, this._onUpdateParameters, this._onWillFocus, this._onWillVisibilityChange, this._onUpdateParameters);
|
|
70
64
|
}
|
|
71
65
|
initialize(panel) {
|
|
72
66
|
this.panelUpdatesDisposable.value = this._onUpdateParameters.event((parameters) => {
|
|
@@ -75,8 +69,8 @@ export class PanelApiImpl extends CompositeDisposable {
|
|
|
75
69
|
});
|
|
76
70
|
});
|
|
77
71
|
}
|
|
78
|
-
|
|
79
|
-
this.
|
|
72
|
+
setVisible(isVisible) {
|
|
73
|
+
this._onWillVisibilityChange.fire({ isVisible });
|
|
80
74
|
}
|
|
81
75
|
setActive() {
|
|
82
76
|
this._onActiveChange.fire();
|
|
@@ -48,7 +48,7 @@ export class ContentContainer extends CompositeDisposable {
|
|
|
48
48
|
data.groupId === this.group.id;
|
|
49
49
|
return !groupHasOnePanelAndIsActiveDragElement;
|
|
50
50
|
}
|
|
51
|
-
return this.group.canDisplayOverlay(event, position, '
|
|
51
|
+
return this.group.canDisplayOverlay(event, position, 'content');
|
|
52
52
|
},
|
|
53
53
|
});
|
|
54
54
|
this.addDisposables(this.dropTarget);
|
|
@@ -38,7 +38,7 @@ export class VoidContainer extends CompositeDisposable {
|
|
|
38
38
|
// don't show the overlay if the tab being dragged is the last panel of this group
|
|
39
39
|
return ((_a = last(this.group.panels)) === null || _a === void 0 ? void 0 : _a.id) !== data.panelId;
|
|
40
40
|
}
|
|
41
|
-
return group.model.canDisplayOverlay(event, position, '
|
|
41
|
+
return group.model.canDisplayOverlay(event, position, 'header_space');
|
|
42
42
|
},
|
|
43
43
|
});
|
|
44
44
|
this.onWillShowOverlay = this.dropTraget.onWillShowOverlay;
|
|
@@ -12,7 +12,7 @@ import { isGroupOptionsWithGroup, isGroupOptionsWithPanel, isPanelOptionsWithGro
|
|
|
12
12
|
import { BaseGrid, toTarget, } from '../gridview/baseComponentGridview';
|
|
13
13
|
import { DockviewApi } from '../api/component.api';
|
|
14
14
|
import { Orientation, Sizing } from '../splitview/splitview';
|
|
15
|
-
import { DockviewDidDropEvent, DockviewWillDropEvent, } from './dockviewGroupPanelModel';
|
|
15
|
+
import { DockviewDidDropEvent, DockviewWillDropEvent, WillShowOverlayLocationEvent, } from './dockviewGroupPanelModel';
|
|
16
16
|
import { DockviewGroupPanel } from './dockviewGroupPanel';
|
|
17
17
|
import { DockviewPanelModel } from './dockviewPanelModel';
|
|
18
18
|
import { getPanelData } from '../dnd/dataTransfer';
|
|
@@ -269,7 +269,15 @@ export class DockviewComponent extends BaseGrid {
|
|
|
269
269
|
acceptedTargetZones: ['top', 'bottom', 'left', 'right', 'center'],
|
|
270
270
|
overlayModel: (_b = this.options.rootOverlayModel) !== null && _b !== void 0 ? _b : DEFAULT_ROOT_OVERLAY_MODEL,
|
|
271
271
|
});
|
|
272
|
-
this.addDisposables(this._rootDropTarget.
|
|
272
|
+
this.addDisposables(this._rootDropTarget, this._rootDropTarget.onWillShowOverlay((event) => {
|
|
273
|
+
if (this.gridview.length > 0 && event.position === 'center') {
|
|
274
|
+
// option only available when no panels in primary grid
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
|
|
278
|
+
kind: 'edge',
|
|
279
|
+
}));
|
|
280
|
+
}), this._rootDropTarget.onDrop((event) => {
|
|
273
281
|
var _a;
|
|
274
282
|
const willDropEvent = new DockviewWillDropEvent({
|
|
275
283
|
nativeEvent: event.nativeEvent,
|
|
@@ -278,7 +286,7 @@ export class DockviewComponent extends BaseGrid {
|
|
|
278
286
|
api: this._api,
|
|
279
287
|
group: undefined,
|
|
280
288
|
getData: getPanelData,
|
|
281
|
-
kind: '
|
|
289
|
+
kind: 'edge',
|
|
282
290
|
});
|
|
283
291
|
this._onWillDrop.fire(willDropEvent);
|
|
284
292
|
if (willDropEvent.defaultPrevented) {
|
|
@@ -334,7 +342,7 @@ export class DockviewComponent extends BaseGrid {
|
|
|
334
342
|
const box = getBox();
|
|
335
343
|
const groupId = (_b = (_a = options === null || options === void 0 ? void 0 : options.overridePopoutGroup) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : this.getNextGroupId(); //item.id;
|
|
336
344
|
if (itemToPopout.api.location.type === 'grid') {
|
|
337
|
-
itemToPopout.api.
|
|
345
|
+
itemToPopout.api.setVisible(false);
|
|
338
346
|
}
|
|
339
347
|
const _window = new PopoutWindow(`${this.id}-${groupId}`, // unique id
|
|
340
348
|
theme !== null && theme !== void 0 ? theme : '', {
|
|
@@ -385,7 +393,7 @@ export class DockviewComponent extends BaseGrid {
|
|
|
385
393
|
}));
|
|
386
394
|
switch (referenceLocation) {
|
|
387
395
|
case 'grid':
|
|
388
|
-
referenceGroup.api.
|
|
396
|
+
referenceGroup.api.setVisible(false);
|
|
389
397
|
break;
|
|
390
398
|
case 'floating':
|
|
391
399
|
case 'popout':
|
|
@@ -439,8 +447,8 @@ export class DockviewComponent extends BaseGrid {
|
|
|
439
447
|
from: group,
|
|
440
448
|
to: referenceGroup,
|
|
441
449
|
}));
|
|
442
|
-
if (referenceGroup.api.
|
|
443
|
-
referenceGroup.api.
|
|
450
|
+
if (!referenceGroup.api.isVisible) {
|
|
451
|
+
referenceGroup.api.setVisible(true);
|
|
444
452
|
}
|
|
445
453
|
if (this.getPanel(group.id)) {
|
|
446
454
|
this.doRemoveGroup(group, {
|
|
@@ -1015,7 +1023,7 @@ export class DockviewComponent extends BaseGrid {
|
|
|
1015
1023
|
}
|
|
1016
1024
|
updateWatermark() {
|
|
1017
1025
|
var _a, _b;
|
|
1018
|
-
if (this.groups.filter((x) => x.api.location.type === 'grid' &&
|
|
1026
|
+
if (this.groups.filter((x) => x.api.location.type === 'grid' && x.api.isVisible).length === 0) {
|
|
1019
1027
|
if (!this.watermark) {
|
|
1020
1028
|
this.watermark = this.createWatermarkComponent();
|
|
1021
1029
|
this.watermark.init({
|
|
@@ -7,7 +7,6 @@ import { IViewSize } from '../gridview/gridview';
|
|
|
7
7
|
import { CompositeDisposable } from '../lifecycle';
|
|
8
8
|
import { IPanel, PanelInitParameters, PanelUpdateEvent } from '../panel/types';
|
|
9
9
|
import { GroupDragEvent, TabDragEvent } from './components/titlebar/tabsContainer';
|
|
10
|
-
import { DockviewDropTargets } from './types';
|
|
11
10
|
import { DockviewGroupPanel } from './dockviewGroupPanel';
|
|
12
11
|
import { IDockviewPanel } from './dockviewPanel';
|
|
13
12
|
import { OverlayRenderContainer } from '../overlayRenderContainer';
|
|
@@ -69,7 +68,7 @@ export interface IHeader {
|
|
|
69
68
|
hidden: boolean;
|
|
70
69
|
}
|
|
71
70
|
export type DockviewGroupPanelLocked = boolean | 'no-drop-target';
|
|
72
|
-
export type DockviewGroupDropLocation = 'tab' | 'header_space' | 'content';
|
|
71
|
+
export type DockviewGroupDropLocation = 'tab' | 'header_space' | 'content' | 'edge';
|
|
73
72
|
export interface IDockviewGroupPanelModel extends IPanel {
|
|
74
73
|
readonly isActive: boolean;
|
|
75
74
|
readonly size: number;
|
|
@@ -106,7 +105,7 @@ export interface IDockviewGroupPanelModel extends IPanel {
|
|
|
106
105
|
panel?: IDockviewPanel;
|
|
107
106
|
suppressRoll?: boolean;
|
|
108
107
|
}): void;
|
|
109
|
-
canDisplayOverlay(event: DragEvent, position: Position, target:
|
|
108
|
+
canDisplayOverlay(event: DragEvent, position: Position, target: DockviewGroupDropLocation): boolean;
|
|
110
109
|
}
|
|
111
110
|
export type DockviewGroupLocation = {
|
|
112
111
|
type: 'grid';
|
|
@@ -225,7 +224,7 @@ export declare class DockviewGroupPanelModel extends CompositeDisposable impleme
|
|
|
225
224
|
private doSetActivePanel;
|
|
226
225
|
private updateMru;
|
|
227
226
|
private updateContainer;
|
|
228
|
-
canDisplayOverlay(event: DragEvent, position: Position, target:
|
|
227
|
+
canDisplayOverlay(event: DragEvent, position: Position, target: DockviewGroupDropLocation): boolean;
|
|
229
228
|
private handleDropEvent;
|
|
230
229
|
dispose(): void;
|
|
231
230
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { DockviewApi } from '../api/component.api';
|
|
2
2
|
import { Direction } from '../gridview/baseComponentGridview';
|
|
3
3
|
import { IGridView } from '../gridview/gridview';
|
|
4
|
-
import { IContentRenderer, ITabRenderer, WatermarkConstructor, IWatermarkRenderer
|
|
4
|
+
import { IContentRenderer, ITabRenderer, WatermarkConstructor, IWatermarkRenderer } from './types';
|
|
5
5
|
import { Parameters } from '../panel/types';
|
|
6
6
|
import { DockviewGroupPanel } from './dockviewGroupPanel';
|
|
7
7
|
import { ISplitviewStyles, Orientation } from '../splitview/splitview';
|
|
8
8
|
import { PanelTransfer } from '../dnd/dataTransfer';
|
|
9
9
|
import { IDisposable } from '../lifecycle';
|
|
10
10
|
import { DroptargetOverlayModel, Position } from '../dnd/droptarget';
|
|
11
|
-
import { GroupOptions } from './dockviewGroupPanelModel';
|
|
11
|
+
import { DockviewGroupDropLocation, GroupOptions } from './dockviewGroupPanelModel';
|
|
12
12
|
import { IDockviewPanel } from './dockviewPanel';
|
|
13
13
|
import { ComponentConstructor, FrameworkFactory } from '../panel/componentFactory';
|
|
14
14
|
import { DockviewGroupPanelApi } from '../api/dockviewGroupPanelApi';
|
|
@@ -50,7 +50,7 @@ export interface ViewFactoryData {
|
|
|
50
50
|
}
|
|
51
51
|
export interface DockviewDndOverlayEvent {
|
|
52
52
|
nativeEvent: DragEvent;
|
|
53
|
-
target:
|
|
53
|
+
target: DockviewGroupDropLocation;
|
|
54
54
|
position: Position;
|
|
55
55
|
group?: DockviewGroupPanel;
|
|
56
56
|
getData: () => PanelTransfer | undefined;
|
|
@@ -6,7 +6,6 @@ import { Event } from '../events';
|
|
|
6
6
|
import { Optional } from '../types';
|
|
7
7
|
import { DockviewGroupPanel, IDockviewGroupPanel } from './dockviewGroupPanel';
|
|
8
8
|
import { DockviewPanelRenderer } from '../overlayRenderContainer';
|
|
9
|
-
export type DockviewDropTargets = 'tab' | 'panel' | 'tabContainer' | 'edge';
|
|
10
9
|
export interface HeaderPartInitParameters {
|
|
11
10
|
title: string;
|
|
12
11
|
}
|
|
@@ -77,10 +77,10 @@ export class GridviewPanel extends BasePanelView {
|
|
|
77
77
|
this._maximumHeight = options.maximumHeight;
|
|
78
78
|
}
|
|
79
79
|
this.api.initialize(this); // TODO: required to by-pass 'super before this' requirement
|
|
80
|
-
this.addDisposables(this.api.
|
|
81
|
-
const {
|
|
80
|
+
this.addDisposables(this.api.onWillVisibilityChange((event) => {
|
|
81
|
+
const { isVisible } = event;
|
|
82
82
|
const { accessor } = this._params;
|
|
83
|
-
accessor.setVisible(this,
|
|
83
|
+
accessor.setVisible(this, isVisible);
|
|
84
84
|
}), this.api.onActiveChange(() => {
|
|
85
85
|
const { accessor } = this._params;
|
|
86
86
|
accessor.doSetGroupActive(this);
|
package/dist/esm/lifecycle.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export declare class Paneview extends CompositeDisposable implements IDisposable
|
|
|
26
26
|
orientation: Orientation;
|
|
27
27
|
descriptor?: ISplitViewDescriptor;
|
|
28
28
|
});
|
|
29
|
+
setViewVisible(index: number, visible: boolean): void;
|
|
29
30
|
addPane(pane: PaneviewPanel, size?: number | Sizing, index?: number, skipLayout?: boolean): void;
|
|
30
31
|
getViewSize(index: number): number;
|
|
31
32
|
getPanes(): PaneviewPanel[];
|
|
@@ -66,6 +66,9 @@ export class Paneview extends CompositeDisposable {
|
|
|
66
66
|
this._onDidChange.fire();
|
|
67
67
|
}));
|
|
68
68
|
}
|
|
69
|
+
setViewVisible(index, visible) {
|
|
70
|
+
this.splitview.setViewVisible(index, visible);
|
|
71
|
+
}
|
|
69
72
|
addPane(pane, size, index = this.splitview.length, skipLayout = false) {
|
|
70
73
|
const disposable = pane.onDidChangeExpansionState(() => {
|
|
71
74
|
this.setupAnimation();
|
|
@@ -84,6 +84,7 @@ export interface IPaneviewComponent extends IDisposable {
|
|
|
84
84
|
getPanel(id: string): IPaneviewPanel | undefined;
|
|
85
85
|
movePanel(from: number, to: number): void;
|
|
86
86
|
updateOptions(options: Partial<PaneviewComponentOptions>): void;
|
|
87
|
+
setVisible(panel: IPaneviewPanel, visible: boolean): void;
|
|
87
88
|
clear(): void;
|
|
88
89
|
}
|
|
89
90
|
export declare class PaneviewComponent extends Resizable implements IPaneviewComponent {
|
|
@@ -112,6 +113,7 @@ export declare class PaneviewComponent extends Resizable implements IPaneviewCom
|
|
|
112
113
|
get width(): number;
|
|
113
114
|
get options(): PaneviewComponentOptions;
|
|
114
115
|
constructor(options: PaneviewComponentOptions);
|
|
116
|
+
setVisible(panel: PaneviewPanel, visible: boolean): void;
|
|
115
117
|
focus(): void;
|
|
116
118
|
updateOptions(options: Partial<PaneviewComponentOptions>): void;
|
|
117
119
|
addPanel<T extends object = Parameters>(options: AddPaneviewComponentOptions<T>): IPaneviewPanel;
|
|
@@ -85,6 +85,10 @@ export class PaneviewComponent extends Resizable {
|
|
|
85
85
|
});
|
|
86
86
|
this.addDisposables(this._disposable);
|
|
87
87
|
}
|
|
88
|
+
setVisible(panel, visible) {
|
|
89
|
+
const index = this.panels.indexOf(panel);
|
|
90
|
+
this.paneview.setViewVisible(index, visible);
|
|
91
|
+
}
|
|
88
92
|
focus() {
|
|
89
93
|
//noop
|
|
90
94
|
}
|
|
@@ -131,6 +135,7 @@ export class PaneviewComponent extends Resizable {
|
|
|
131
135
|
isExpanded: options.isExpanded,
|
|
132
136
|
title: options.title,
|
|
133
137
|
containerApi: new PaneviewApi(this),
|
|
138
|
+
accessor: this,
|
|
134
139
|
});
|
|
135
140
|
this.paneview.addPane(view, size, index);
|
|
136
141
|
view.orientation = this.paneview.orientation;
|
|
@@ -230,6 +235,7 @@ export class PaneviewComponent extends Resizable {
|
|
|
230
235
|
title: data.title,
|
|
231
236
|
isExpanded: !!view.expanded,
|
|
232
237
|
containerApi: new PaneviewApi(this),
|
|
238
|
+
accessor: this,
|
|
233
239
|
});
|
|
234
240
|
panel.orientation = this.paneview.orientation;
|
|
235
241
|
});
|
|
@@ -5,6 +5,7 @@ import { BasePanelView, BasePanelViewExported, BasePanelViewState } from '../gri
|
|
|
5
5
|
import { IDisposable } from '../lifecycle';
|
|
6
6
|
import { IFrameworkPart, PanelInitParameters, PanelUpdateEvent } from '../panel/types';
|
|
7
7
|
import { IView, Orientation } from '../splitview/splitview';
|
|
8
|
+
import { PaneviewComponent } from './paneviewComponent';
|
|
8
9
|
export interface PanePanelViewState extends BasePanelViewState {
|
|
9
10
|
headerComponent?: string;
|
|
10
11
|
title: string;
|
|
@@ -15,6 +16,7 @@ export interface PanePanelInitParameter extends PanelInitParameters {
|
|
|
15
16
|
isExpanded?: boolean;
|
|
16
17
|
title: string;
|
|
17
18
|
containerApi: PaneviewApi;
|
|
19
|
+
accessor: PaneviewComponent;
|
|
18
20
|
}
|
|
19
21
|
export interface PanePanelComponentInitParameter extends PanePanelInitParameter {
|
|
20
22
|
api: PaneviewPanelApiImpl;
|
|
@@ -72,7 +72,11 @@ export class PaneviewPanel extends BasePanelView {
|
|
|
72
72
|
this._onDidChangeExpansionState.fire(this.isExpanded()); // initialize value
|
|
73
73
|
this._orientation = orientation;
|
|
74
74
|
this.element.classList.add('pane');
|
|
75
|
-
this.addDisposables(this.api.
|
|
75
|
+
this.addDisposables(this.api.onWillVisibilityChange((event) => {
|
|
76
|
+
const { isVisible } = event;
|
|
77
|
+
const { accessor } = this._params;
|
|
78
|
+
accessor.setVisible(this, isVisible);
|
|
79
|
+
}), this.api.onDidSizeChange((event) => {
|
|
76
80
|
this._onDidChange.fire({ size: event.size });
|
|
77
81
|
}), addDisposableListener(this.element, 'mouseenter', (ev) => {
|
|
78
82
|
this.api._onMouseEnter.fire(ev);
|
|
@@ -88,7 +88,7 @@ export declare class SplitviewComponent extends Resizable implements ISplitviewC
|
|
|
88
88
|
focus(): void;
|
|
89
89
|
movePanel(from: number, to: number): void;
|
|
90
90
|
setVisible(panel: SplitviewPanel, visible: boolean): void;
|
|
91
|
-
setActive(
|
|
91
|
+
setActive(panel: SplitviewPanel, skipFocus?: boolean): void;
|
|
92
92
|
removePanel(panel: SplitviewPanel, sizing?: Sizing): void;
|
|
93
93
|
getPanel(id: string): SplitviewPanel | undefined;
|
|
94
94
|
addPanel<T extends object = Parameters>(options: AddSplitviewComponentOptions<T>): SplitviewPanel;
|
|
@@ -86,19 +86,19 @@ export class SplitviewComponent extends Resizable {
|
|
|
86
86
|
const index = this.panels.indexOf(panel);
|
|
87
87
|
this.splitview.setViewVisible(index, visible);
|
|
88
88
|
}
|
|
89
|
-
setActive(
|
|
90
|
-
this._activePanel =
|
|
89
|
+
setActive(panel, skipFocus) {
|
|
90
|
+
this._activePanel = panel;
|
|
91
91
|
this.panels
|
|
92
|
-
.filter((v) => v !==
|
|
92
|
+
.filter((v) => v !== panel)
|
|
93
93
|
.forEach((v) => {
|
|
94
94
|
v.api._onDidActiveChange.fire({ isActive: false });
|
|
95
95
|
if (!skipFocus) {
|
|
96
96
|
v.focus();
|
|
97
97
|
}
|
|
98
98
|
});
|
|
99
|
-
|
|
99
|
+
panel.api._onDidActiveChange.fire({ isActive: true });
|
|
100
100
|
if (!skipFocus) {
|
|
101
|
-
|
|
101
|
+
panel.focus();
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
removePanel(panel, sizing) {
|
|
@@ -45,10 +45,10 @@ export class SplitviewPanel extends BasePanelView {
|
|
|
45
45
|
this._onDidChange = new Emitter();
|
|
46
46
|
this.onDidChange = this._onDidChange.event;
|
|
47
47
|
this.api.initialize(this);
|
|
48
|
-
this.addDisposables(this._onDidChange, this.api.
|
|
49
|
-
const {
|
|
48
|
+
this.addDisposables(this._onDidChange, this.api.onWillVisibilityChange((event) => {
|
|
49
|
+
const { isVisible } = event;
|
|
50
50
|
const { accessor } = this._params;
|
|
51
|
-
accessor.setVisible(this,
|
|
51
|
+
accessor.setVisible(this, isVisible);
|
|
52
52
|
}), this.api.onActiveChange(() => {
|
|
53
53
|
const { accessor } = this._params;
|
|
54
54
|
accessor.setActive(this);
|