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
|
/**
|
|
@@ -754,7 +754,10 @@ var DockviewApi = /** @class */ (function () {
|
|
|
754
754
|
});
|
|
755
755
|
Object.defineProperty(DockviewApi.prototype, "onWillShowOverlay", {
|
|
756
756
|
/**
|
|
757
|
+
* Invoked before an overlay is shown indicating a drop target.
|
|
757
758
|
*
|
|
759
|
+
* Calling `event.preventDefault()` will prevent the overlay being shown and prevent
|
|
760
|
+
* the any subsequent drop event.
|
|
758
761
|
*/
|
|
759
762
|
get: function () {
|
|
760
763
|
return this.component.onWillShowOverlay;
|
|
@@ -764,7 +767,10 @@ var DockviewApi = /** @class */ (function () {
|
|
|
764
767
|
});
|
|
765
768
|
Object.defineProperty(DockviewApi.prototype, "onWillDragGroup", {
|
|
766
769
|
/**
|
|
767
|
-
* Invoked before a group is dragged.
|
|
770
|
+
* Invoked before a group is dragged.
|
|
771
|
+
*
|
|
772
|
+
* Calling `event.nativeEvent.preventDefault()` will prevent the group drag starting.
|
|
773
|
+
*
|
|
768
774
|
*/
|
|
769
775
|
get: function () {
|
|
770
776
|
return this.component.onWillDragGroup;
|
|
@@ -774,7 +780,9 @@ var DockviewApi = /** @class */ (function () {
|
|
|
774
780
|
});
|
|
775
781
|
Object.defineProperty(DockviewApi.prototype, "onWillDragPanel", {
|
|
776
782
|
/**
|
|
777
|
-
* Invoked before a panel is dragged.
|
|
783
|
+
* Invoked before a panel is dragged.
|
|
784
|
+
*
|
|
785
|
+
* Calling `event.nativeEvent.preventDefault()` will prevent the panel drag starting.
|
|
778
786
|
*/
|
|
779
787
|
get: function () {
|
|
780
788
|
return this.component.onWillDragPanel;
|
|
@@ -38,6 +38,7 @@ var DockviewPanelApiImpl = /** @class */ (function (_super) {
|
|
|
38
38
|
_this.groupEventsDisposable = new lifecycle_1.MutableDisposable();
|
|
39
39
|
_this.initialize(panel);
|
|
40
40
|
_this._group = group;
|
|
41
|
+
_this.setupGroupEventListeners();
|
|
41
42
|
_this.addDisposables(_this.groupEventsDisposable, _this._onDidRendererChange, _this._onDidTitleChange, _this._onDidGroupChange, _this._onDidActiveGroupChange, _this._onDidLocationChange);
|
|
42
43
|
return _this;
|
|
43
44
|
}
|
|
@@ -74,33 +75,11 @@ var DockviewPanelApiImpl = /** @class */ (function (_super) {
|
|
|
74
75
|
return this._group;
|
|
75
76
|
},
|
|
76
77
|
set: function (value) {
|
|
77
|
-
var
|
|
78
|
-
var isOldGroupActive = this.isGroupActive;
|
|
78
|
+
var oldGroup = this._group;
|
|
79
79
|
if (this._group !== value) {
|
|
80
80
|
this._group = value;
|
|
81
81
|
this._onDidGroupChange.fire({});
|
|
82
|
-
|
|
83
|
-
this.groupEventsDisposable.value = new lifecycle_1.CompositeDisposable(this.group.api.onDidLocationChange(function (event) {
|
|
84
|
-
if (_this.group !== _this.panel.group) {
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
_this._onDidLocationChange.fire(event);
|
|
88
|
-
}), this.group.api.onDidActiveChange(function () {
|
|
89
|
-
if (_this.group !== _this.panel.group) {
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
if (_trackGroupActive_1 !== _this.isGroupActive) {
|
|
93
|
-
_trackGroupActive_1 = _this.isGroupActive;
|
|
94
|
-
_this._onDidActiveGroupChange.fire({
|
|
95
|
-
isActive: _this.isGroupActive,
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
}));
|
|
99
|
-
// if (this.isGroupActive !== isOldGroupActive) {
|
|
100
|
-
// this._onDidActiveGroupChange.fire({
|
|
101
|
-
// isActive: this.isGroupActive,
|
|
102
|
-
// });
|
|
103
|
-
// }
|
|
82
|
+
this.setupGroupEventListeners(oldGroup);
|
|
104
83
|
this._onDidLocationChange.fire({
|
|
105
84
|
location: this.group.api.location,
|
|
106
85
|
});
|
|
@@ -141,6 +120,36 @@ var DockviewPanelApiImpl = /** @class */ (function (_super) {
|
|
|
141
120
|
DockviewPanelApiImpl.prototype.exitMaximized = function () {
|
|
142
121
|
this.group.api.exitMaximized();
|
|
143
122
|
};
|
|
123
|
+
DockviewPanelApiImpl.prototype.setupGroupEventListeners = function (previousGroup) {
|
|
124
|
+
var _this = this;
|
|
125
|
+
var _a;
|
|
126
|
+
var _trackGroupActive = (_a = previousGroup === null || previousGroup === void 0 ? void 0 : previousGroup.isActive) !== null && _a !== void 0 ? _a : false; // prevent duplicate events with same state
|
|
127
|
+
this.groupEventsDisposable.value = new lifecycle_1.CompositeDisposable(this.group.api.onDidVisibilityChange(function (event) {
|
|
128
|
+
if (!event.isVisible && _this.isVisible) {
|
|
129
|
+
_this._onDidVisibilityChange.fire(event);
|
|
130
|
+
}
|
|
131
|
+
else if (event.isVisible &&
|
|
132
|
+
!_this.isVisible &&
|
|
133
|
+
_this.group.model.isPanelActive(_this.panel)) {
|
|
134
|
+
_this._onDidVisibilityChange.fire(event);
|
|
135
|
+
}
|
|
136
|
+
}), this.group.api.onDidLocationChange(function (event) {
|
|
137
|
+
if (_this.group !== _this.panel.group) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
_this._onDidLocationChange.fire(event);
|
|
141
|
+
}), this.group.api.onDidActiveChange(function () {
|
|
142
|
+
if (_this.group !== _this.panel.group) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
if (_trackGroupActive !== _this.isGroupActive) {
|
|
146
|
+
_trackGroupActive = _this.isGroupActive;
|
|
147
|
+
_this._onDidActiveGroupChange.fire({
|
|
148
|
+
isActive: _this.isGroupActive,
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
}));
|
|
152
|
+
};
|
|
144
153
|
return DockviewPanelApiImpl;
|
|
145
154
|
}(gridviewPanelApi_1.GridviewPanelApiImpl));
|
|
146
155
|
exports.DockviewPanelApiImpl = DockviewPanelApiImpl;
|
|
@@ -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/cjs/api/panelApi.js
CHANGED
|
@@ -37,7 +37,6 @@ var PanelApiImpl = /** @class */ (function (_super) {
|
|
|
37
37
|
_this._isFocused = false;
|
|
38
38
|
_this._isActive = false;
|
|
39
39
|
_this._isVisible = true;
|
|
40
|
-
_this._isHidden = false;
|
|
41
40
|
_this._width = 0;
|
|
42
41
|
_this._height = 0;
|
|
43
42
|
_this.panelUpdatesDisposable = new lifecycle_1.MutableDisposable();
|
|
@@ -51,8 +50,8 @@ var PanelApiImpl = /** @class */ (function (_super) {
|
|
|
51
50
|
//
|
|
52
51
|
_this._onDidVisibilityChange = new events_1.Emitter();
|
|
53
52
|
_this.onDidVisibilityChange = _this._onDidVisibilityChange.event;
|
|
54
|
-
_this.
|
|
55
|
-
_this.
|
|
53
|
+
_this._onWillVisibilityChange = new events_1.Emitter();
|
|
54
|
+
_this.onWillVisibilityChange = _this._onWillVisibilityChange.event;
|
|
56
55
|
_this._onDidActiveChange = new events_1.Emitter();
|
|
57
56
|
_this.onDidActiveChange = _this._onDidActiveChange.event;
|
|
58
57
|
_this._onActiveChange = new events_1.Emitter();
|
|
@@ -65,12 +64,10 @@ var PanelApiImpl = /** @class */ (function (_super) {
|
|
|
65
64
|
_this._isActive = event.isActive;
|
|
66
65
|
}), _this.onDidVisibilityChange(function (event) {
|
|
67
66
|
_this._isVisible = event.isVisible;
|
|
68
|
-
}), _this.onDidHiddenChange(function (event) {
|
|
69
|
-
_this._isHidden = event.isHidden;
|
|
70
67
|
}), _this.onDidDimensionsChange(function (event) {
|
|
71
68
|
_this._width = event.width;
|
|
72
69
|
_this._height = event.height;
|
|
73
|
-
}), _this.panelUpdatesDisposable, _this._onDidDimensionChange, _this._onDidChangeFocus, _this._onDidVisibilityChange, _this._onDidActiveChange, _this._onWillFocus, _this._onActiveChange, _this._onUpdateParameters, _this._onWillFocus, _this.
|
|
70
|
+
}), _this.panelUpdatesDisposable, _this._onDidDimensionChange, _this._onDidChangeFocus, _this._onDidVisibilityChange, _this._onDidActiveChange, _this._onWillFocus, _this._onActiveChange, _this._onUpdateParameters, _this._onWillFocus, _this._onWillVisibilityChange, _this._onUpdateParameters);
|
|
74
71
|
return _this;
|
|
75
72
|
}
|
|
76
73
|
Object.defineProperty(PanelApiImpl.prototype, "isFocused", {
|
|
@@ -94,13 +91,6 @@ var PanelApiImpl = /** @class */ (function (_super) {
|
|
|
94
91
|
enumerable: false,
|
|
95
92
|
configurable: true
|
|
96
93
|
});
|
|
97
|
-
Object.defineProperty(PanelApiImpl.prototype, "isHidden", {
|
|
98
|
-
get: function () {
|
|
99
|
-
return this._isHidden;
|
|
100
|
-
},
|
|
101
|
-
enumerable: false,
|
|
102
|
-
configurable: true
|
|
103
|
-
});
|
|
104
94
|
Object.defineProperty(PanelApiImpl.prototype, "width", {
|
|
105
95
|
get: function () {
|
|
106
96
|
return this._width;
|
|
@@ -122,8 +112,8 @@ var PanelApiImpl = /** @class */ (function (_super) {
|
|
|
122
112
|
});
|
|
123
113
|
});
|
|
124
114
|
};
|
|
125
|
-
PanelApiImpl.prototype.
|
|
126
|
-
this.
|
|
115
|
+
PanelApiImpl.prototype.setVisible = function (isVisible) {
|
|
116
|
+
this._onWillVisibilityChange.fire({ isVisible: isVisible });
|
|
127
117
|
};
|
|
128
118
|
PanelApiImpl.prototype.setActive = function () {
|
|
129
119
|
this._onActiveChange.fire();
|
|
@@ -64,7 +64,7 @@ var ContentContainer = /** @class */ (function (_super) {
|
|
|
64
64
|
data.groupId === _this.group.id;
|
|
65
65
|
return !groupHasOnePanelAndIsActiveDragElement;
|
|
66
66
|
}
|
|
67
|
-
return _this.group.canDisplayOverlay(event, position, '
|
|
67
|
+
return _this.group.canDisplayOverlay(event, position, 'content');
|
|
68
68
|
},
|
|
69
69
|
});
|
|
70
70
|
_this.addDisposables(_this.dropTarget);
|
|
@@ -54,7 +54,7 @@ var VoidContainer = /** @class */ (function (_super) {
|
|
|
54
54
|
// don't show the overlay if the tab being dragged is the last panel of this group
|
|
55
55
|
return ((_a = (0, array_1.last)(_this.group.panels)) === null || _a === void 0 ? void 0 : _a.id) !== data.panelId;
|
|
56
56
|
}
|
|
57
|
-
return group.model.canDisplayOverlay(event, position, '
|
|
57
|
+
return group.model.canDisplayOverlay(event, position, 'header_space');
|
|
58
58
|
},
|
|
59
59
|
});
|
|
60
60
|
_this.onWillShowOverlay = _this.dropTraget.onWillShowOverlay;
|
|
@@ -335,7 +335,15 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
335
335
|
acceptedTargetZones: ['top', 'bottom', 'left', 'right', 'center'],
|
|
336
336
|
overlayModel: (_b = _this.options.rootOverlayModel) !== null && _b !== void 0 ? _b : DEFAULT_ROOT_OVERLAY_MODEL,
|
|
337
337
|
});
|
|
338
|
-
_this.addDisposables(_this._rootDropTarget.
|
|
338
|
+
_this.addDisposables(_this._rootDropTarget, _this._rootDropTarget.onWillShowOverlay(function (event) {
|
|
339
|
+
if (_this.gridview.length > 0 && event.position === 'center') {
|
|
340
|
+
// option only available when no panels in primary grid
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
_this._onWillShowOverlay.fire(new dockviewGroupPanelModel_1.WillShowOverlayLocationEvent(event, {
|
|
344
|
+
kind: 'edge',
|
|
345
|
+
}));
|
|
346
|
+
}), _this._rootDropTarget.onDrop(function (event) {
|
|
339
347
|
var _a;
|
|
340
348
|
var willDropEvent = new dockviewGroupPanelModel_1.DockviewWillDropEvent({
|
|
341
349
|
nativeEvent: event.nativeEvent,
|
|
@@ -344,7 +352,7 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
344
352
|
api: _this._api,
|
|
345
353
|
group: undefined,
|
|
346
354
|
getData: dataTransfer_1.getPanelData,
|
|
347
|
-
kind: '
|
|
355
|
+
kind: 'edge',
|
|
348
356
|
});
|
|
349
357
|
_this._onWillDrop.fire(willDropEvent);
|
|
350
358
|
if (willDropEvent.defaultPrevented) {
|
|
@@ -449,7 +457,7 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
449
457
|
var box = getBox();
|
|
450
458
|
var 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;
|
|
451
459
|
if (itemToPopout.api.location.type === 'grid') {
|
|
452
|
-
itemToPopout.api.
|
|
460
|
+
itemToPopout.api.setVisible(false);
|
|
453
461
|
}
|
|
454
462
|
var _window = new popoutWindow_1.PopoutWindow("".concat(this.id, "-").concat(groupId), // unique id
|
|
455
463
|
theme !== null && theme !== void 0 ? theme : '', {
|
|
@@ -502,7 +510,7 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
502
510
|
});
|
|
503
511
|
switch (referenceLocation) {
|
|
504
512
|
case 'grid':
|
|
505
|
-
referenceGroup.api.
|
|
513
|
+
referenceGroup.api.setVisible(false);
|
|
506
514
|
break;
|
|
507
515
|
case 'floating':
|
|
508
516
|
case 'popout':
|
|
@@ -558,8 +566,8 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
558
566
|
to: referenceGroup,
|
|
559
567
|
});
|
|
560
568
|
});
|
|
561
|
-
if (referenceGroup.api.
|
|
562
|
-
referenceGroup.api.
|
|
569
|
+
if (!referenceGroup.api.isVisible) {
|
|
570
|
+
referenceGroup.api.setVisible(true);
|
|
563
571
|
}
|
|
564
572
|
if (_this.getPanel(group.id)) {
|
|
565
573
|
_this.doRemoveGroup(group, {
|
|
@@ -1269,7 +1277,7 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1269
1277
|
};
|
|
1270
1278
|
DockviewComponent.prototype.updateWatermark = function () {
|
|
1271
1279
|
var _a, _b;
|
|
1272
|
-
if (this.groups.filter(function (x) { return x.api.location.type === 'grid' &&
|
|
1280
|
+
if (this.groups.filter(function (x) { return x.api.location.type === 'grid' && x.api.isVisible; }).length === 0) {
|
|
1273
1281
|
if (!this.watermark) {
|
|
1274
1282
|
this.watermark = this.createWatermarkComponent();
|
|
1275
1283
|
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
|
}
|
|
@@ -58,10 +58,10 @@ var GridviewPanel = /** @class */ (function (_super) {
|
|
|
58
58
|
_this._maximumHeight = options.maximumHeight;
|
|
59
59
|
}
|
|
60
60
|
_this.api.initialize(_this); // TODO: required to by-pass 'super before this' requirement
|
|
61
|
-
_this.addDisposables(_this.api.
|
|
62
|
-
var
|
|
61
|
+
_this.addDisposables(_this.api.onWillVisibilityChange(function (event) {
|
|
62
|
+
var isVisible = event.isVisible;
|
|
63
63
|
var accessor = _this._params.accessor;
|
|
64
|
-
accessor.setVisible(_this,
|
|
64
|
+
accessor.setVisible(_this, isVisible);
|
|
65
65
|
}), _this.api.onActiveChange(function () {
|
|
66
66
|
var accessor = _this._params.accessor;
|
|
67
67
|
accessor.doSetGroupActive(_this);
|
package/dist/cjs/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[];
|
|
@@ -114,6 +114,9 @@ var Paneview = /** @class */ (function (_super) {
|
|
|
114
114
|
enumerable: false,
|
|
115
115
|
configurable: true
|
|
116
116
|
});
|
|
117
|
+
Paneview.prototype.setViewVisible = function (index, visible) {
|
|
118
|
+
this.splitview.setViewVisible(index, visible);
|
|
119
|
+
};
|
|
117
120
|
Paneview.prototype.addPane = function (pane, size, index, skipLayout) {
|
|
118
121
|
var _this = this;
|
|
119
122
|
if (index === void 0) { index = this.splitview.length; }
|
|
@@ -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;
|
|
@@ -180,6 +180,10 @@ var PaneviewComponent = /** @class */ (function (_super) {
|
|
|
180
180
|
enumerable: false,
|
|
181
181
|
configurable: true
|
|
182
182
|
});
|
|
183
|
+
PaneviewComponent.prototype.setVisible = function (panel, visible) {
|
|
184
|
+
var index = this.panels.indexOf(panel);
|
|
185
|
+
this.paneview.setViewVisible(index, visible);
|
|
186
|
+
};
|
|
183
187
|
PaneviewComponent.prototype.focus = function () {
|
|
184
188
|
//noop
|
|
185
189
|
};
|
|
@@ -226,6 +230,7 @@ var PaneviewComponent = /** @class */ (function (_super) {
|
|
|
226
230
|
isExpanded: options.isExpanded,
|
|
227
231
|
title: options.title,
|
|
228
232
|
containerApi: new component_api_1.PaneviewApi(this),
|
|
233
|
+
accessor: this,
|
|
229
234
|
});
|
|
230
235
|
this.paneview.addPane(view, size, index);
|
|
231
236
|
view.orientation = this.paneview.orientation;
|
|
@@ -329,6 +334,7 @@ var PaneviewComponent = /** @class */ (function (_super) {
|
|
|
329
334
|
title: data.title,
|
|
330
335
|
isExpanded: !!view.expanded,
|
|
331
336
|
containerApi: new component_api_1.PaneviewApi(_this),
|
|
337
|
+
accessor: _this,
|
|
332
338
|
});
|
|
333
339
|
panel.orientation = _this.paneview.orientation;
|
|
334
340
|
});
|
|
@@ -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;
|
|
@@ -71,7 +71,11 @@ var PaneviewPanel = /** @class */ (function (_super) {
|
|
|
71
71
|
_this._onDidChangeExpansionState.fire(_this.isExpanded()); // initialize value
|
|
72
72
|
_this._orientation = orientation;
|
|
73
73
|
_this.element.classList.add('pane');
|
|
74
|
-
_this.addDisposables(_this.api.
|
|
74
|
+
_this.addDisposables(_this.api.onWillVisibilityChange(function (event) {
|
|
75
|
+
var isVisible = event.isVisible;
|
|
76
|
+
var accessor = _this._params.accessor;
|
|
77
|
+
accessor.setVisible(_this, isVisible);
|
|
78
|
+
}), _this.api.onDidSizeChange(function (event) {
|
|
75
79
|
_this._onDidChange.fire({ size: event.size });
|
|
76
80
|
}), (0, events_1.addDisposableListener)(_this.element, 'mouseenter', function (ev) {
|
|
77
81
|
_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;
|
|
@@ -183,19 +183,19 @@ var SplitviewComponent = /** @class */ (function (_super) {
|
|
|
183
183
|
var index = this.panels.indexOf(panel);
|
|
184
184
|
this.splitview.setViewVisible(index, visible);
|
|
185
185
|
};
|
|
186
|
-
SplitviewComponent.prototype.setActive = function (
|
|
187
|
-
this._activePanel =
|
|
186
|
+
SplitviewComponent.prototype.setActive = function (panel, skipFocus) {
|
|
187
|
+
this._activePanel = panel;
|
|
188
188
|
this.panels
|
|
189
|
-
.filter(function (v) { return v !==
|
|
189
|
+
.filter(function (v) { return v !== panel; })
|
|
190
190
|
.forEach(function (v) {
|
|
191
191
|
v.api._onDidActiveChange.fire({ isActive: false });
|
|
192
192
|
if (!skipFocus) {
|
|
193
193
|
v.focus();
|
|
194
194
|
}
|
|
195
195
|
});
|
|
196
|
-
|
|
196
|
+
panel.api._onDidActiveChange.fire({ isActive: true });
|
|
197
197
|
if (!skipFocus) {
|
|
198
|
-
|
|
198
|
+
panel.focus();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
201
|
SplitviewComponent.prototype.removePanel = function (panel, sizing) {
|
|
@@ -59,10 +59,10 @@ var SplitviewPanel = /** @class */ (function (_super) {
|
|
|
59
59
|
_this._onDidChange = new events_1.Emitter();
|
|
60
60
|
_this.onDidChange = _this._onDidChange.event;
|
|
61
61
|
_this.api.initialize(_this);
|
|
62
|
-
_this.addDisposables(_this._onDidChange, _this.api.
|
|
63
|
-
var
|
|
62
|
+
_this.addDisposables(_this._onDidChange, _this.api.onWillVisibilityChange(function (event) {
|
|
63
|
+
var isVisible = event.isVisible;
|
|
64
64
|
var accessor = _this._params.accessor;
|
|
65
|
-
accessor.setVisible(_this,
|
|
65
|
+
accessor.setVisible(_this, isVisible);
|
|
66
66
|
}), _this.api.onActiveChange(function () {
|
|
67
67
|
var accessor = _this._params.accessor;
|
|
68
68
|
accessor.setActive(_this);
|