dockview-core 1.11.0 → 1.13.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 +2 -1
- package/dist/cjs/api/component.api.js +7 -0
- package/dist/cjs/api/dockviewGroupPanelApi.d.ts +5 -1
- package/dist/cjs/api/dockviewGroupPanelApi.js +19 -1
- package/dist/cjs/api/dockviewPanelApi.d.ts +6 -0
- package/dist/cjs/api/panelApi.d.ts +4 -0
- package/dist/cjs/dnd/droptarget.d.ts +1 -1
- package/dist/cjs/dnd/droptarget.js +4 -10
- package/dist/cjs/dockview/components/panel/content.js +2 -10
- package/dist/cjs/dockview/components/titlebar/tabsContainer.js +12 -1
- package/dist/cjs/dockview/dockviewComponent.d.ts +8 -4
- package/dist/cjs/dockview/dockviewComponent.js +83 -68
- package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +12 -1
- package/dist/cjs/dockview/dockviewGroupPanelModel.js +48 -21
- package/dist/cjs/dockview/dockviewPanelModel.js +21 -24
- package/dist/cjs/dockview/framework.d.ts +38 -0
- package/dist/cjs/dockview/framework.js +2 -0
- package/dist/cjs/dockview/options.d.ts +68 -46
- package/dist/cjs/dockview/options.js +43 -1
- package/dist/cjs/dockview/types.d.ts +4 -10
- package/dist/cjs/framwork.d.ts +4 -0
- package/dist/cjs/framwork.js +2 -0
- package/dist/cjs/index.d.ts +2 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/overlayRenderContainer.d.ts +1 -1
- package/dist/dockview-core.amd.js +1972 -1886
- 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 +1972 -1886
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +1972 -1886
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +1971 -1887
- 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 +1972 -1886
- 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 +1972 -1886
- package/dist/dockview-core.noStyle.js.map +1 -1
- package/dist/esm/api/component.api.d.ts +2 -1
- package/dist/esm/api/component.api.js +3 -0
- package/dist/esm/api/dockviewGroupPanelApi.d.ts +5 -1
- package/dist/esm/api/dockviewGroupPanelApi.js +18 -1
- package/dist/esm/api/dockviewPanelApi.d.ts +6 -0
- package/dist/esm/api/panelApi.d.ts +4 -0
- package/dist/esm/dnd/droptarget.d.ts +1 -1
- package/dist/esm/dnd/droptarget.js +4 -10
- package/dist/esm/dockview/components/panel/content.js +2 -10
- package/dist/esm/dockview/components/titlebar/tabsContainer.js +12 -1
- package/dist/esm/dockview/dockviewComponent.d.ts +8 -4
- package/dist/esm/dockview/dockviewComponent.js +78 -69
- package/dist/esm/dockview/dockviewGroupPanelModel.d.ts +12 -1
- package/dist/esm/dockview/dockviewGroupPanelModel.js +36 -21
- package/dist/esm/dockview/dockviewPanelModel.js +21 -13
- package/dist/esm/dockview/framework.d.ts +38 -0
- package/dist/esm/dockview/framework.js +1 -0
- package/dist/esm/dockview/options.d.ts +68 -46
- package/dist/esm/dockview/options.js +36 -0
- package/dist/esm/dockview/types.d.ts +4 -10
- package/dist/esm/framwork.d.ts +4 -0
- package/dist/esm/framwork.js +1 -0
- package/dist/esm/index.d.ts +2 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/overlayRenderContainer.d.ts +1 -1
- package/package.json +2 -2
|
@@ -59,6 +59,7 @@ var events_1 = require("../events");
|
|
|
59
59
|
var lifecycle_1 = require("../lifecycle");
|
|
60
60
|
var content_1 = require("./components/panel/content");
|
|
61
61
|
var tabsContainer_1 = require("./components/titlebar/tabsContainer");
|
|
62
|
+
var options_1 = require("./options");
|
|
62
63
|
var DockviewDidDropEvent = /** @class */ (function (_super) {
|
|
63
64
|
__extends(DockviewDidDropEvent, _super);
|
|
64
65
|
function DockviewDidDropEvent(options) {
|
|
@@ -127,11 +128,11 @@ exports.DockviewWillDropEvent = DockviewWillDropEvent;
|
|
|
127
128
|
var WillShowOverlayLocationEvent = /** @class */ (function () {
|
|
128
129
|
function WillShowOverlayLocationEvent(event, options) {
|
|
129
130
|
this.event = event;
|
|
130
|
-
this.
|
|
131
|
+
this.options = options;
|
|
131
132
|
}
|
|
132
133
|
Object.defineProperty(WillShowOverlayLocationEvent.prototype, "kind", {
|
|
133
134
|
get: function () {
|
|
134
|
-
return this.
|
|
135
|
+
return this.options.kind;
|
|
135
136
|
},
|
|
136
137
|
enumerable: false,
|
|
137
138
|
configurable: true
|
|
@@ -157,9 +158,33 @@ var WillShowOverlayLocationEvent = /** @class */ (function () {
|
|
|
157
158
|
enumerable: false,
|
|
158
159
|
configurable: true
|
|
159
160
|
});
|
|
161
|
+
Object.defineProperty(WillShowOverlayLocationEvent.prototype, "panel", {
|
|
162
|
+
get: function () {
|
|
163
|
+
return this.options.panel;
|
|
164
|
+
},
|
|
165
|
+
enumerable: false,
|
|
166
|
+
configurable: true
|
|
167
|
+
});
|
|
168
|
+
Object.defineProperty(WillShowOverlayLocationEvent.prototype, "api", {
|
|
169
|
+
get: function () {
|
|
170
|
+
return this.options.api;
|
|
171
|
+
},
|
|
172
|
+
enumerable: false,
|
|
173
|
+
configurable: true
|
|
174
|
+
});
|
|
175
|
+
Object.defineProperty(WillShowOverlayLocationEvent.prototype, "group", {
|
|
176
|
+
get: function () {
|
|
177
|
+
return this.options.group;
|
|
178
|
+
},
|
|
179
|
+
enumerable: false,
|
|
180
|
+
configurable: true
|
|
181
|
+
});
|
|
160
182
|
WillShowOverlayLocationEvent.prototype.preventDefault = function () {
|
|
161
183
|
this.event.preventDefault();
|
|
162
184
|
};
|
|
185
|
+
WillShowOverlayLocationEvent.prototype.getData = function () {
|
|
186
|
+
return this.options.getData();
|
|
187
|
+
};
|
|
163
188
|
return WillShowOverlayLocationEvent;
|
|
164
189
|
}());
|
|
165
190
|
exports.WillShowOverlayLocationEvent = WillShowOverlayLocationEvent;
|
|
@@ -205,6 +230,8 @@ var DockviewGroupPanelModel = /** @class */ (function (_super) {
|
|
|
205
230
|
_this.onDidRemovePanel = _this._onDidRemovePanel.event;
|
|
206
231
|
_this._onDidActivePanelChange = new events_1.Emitter();
|
|
207
232
|
_this.onDidActivePanelChange = _this._onDidActivePanelChange.event;
|
|
233
|
+
_this._onUnhandledDragOverEvent = new events_1.Emitter();
|
|
234
|
+
_this.onUnhandledDragOverEvent = _this._onUnhandledDragOverEvent.event;
|
|
208
235
|
_this._overwriteRenderContainer = null;
|
|
209
236
|
(0, dom_1.toggleClass)(_this.container, 'groupview', true);
|
|
210
237
|
_this._api = new component_api_1.DockviewApi(_this.accessor);
|
|
@@ -230,8 +257,12 @@ var DockviewGroupPanelModel = /** @class */ (function (_super) {
|
|
|
230
257
|
}), _this.contentContainer.dropTarget.onWillShowOverlay(function (event) {
|
|
231
258
|
_this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
|
|
232
259
|
kind: 'content',
|
|
260
|
+
panel: _this.activePanel,
|
|
261
|
+
api: _this._api,
|
|
262
|
+
group: _this.groupPanel,
|
|
263
|
+
getData: dataTransfer_1.getPanelData,
|
|
233
264
|
}));
|
|
234
|
-
}), _this._onMove, _this._onDidChange, _this._onDidDrop, _this._onWillDrop, _this._onDidAddPanel, _this._onDidRemovePanel, _this._onDidActivePanelChange);
|
|
265
|
+
}), _this._onMove, _this._onDidChange, _this._onDidDrop, _this._onWillDrop, _this._onDidAddPanel, _this._onDidRemovePanel, _this._onDidActivePanelChange, _this._onUnhandledDragOverEvent);
|
|
235
266
|
return _this;
|
|
236
267
|
}
|
|
237
268
|
Object.defineProperty(DockviewGroupPanelModel.prototype, "element", {
|
|
@@ -383,33 +414,36 @@ var DockviewGroupPanelModel = /** @class */ (function (_super) {
|
|
|
383
414
|
// correctly initialized
|
|
384
415
|
this.setActive(this.isActive, true);
|
|
385
416
|
this.updateContainer();
|
|
386
|
-
if (this.accessor.options.
|
|
417
|
+
if (this.accessor.options.createRightHeaderActionComponent) {
|
|
387
418
|
this._rightHeaderActions =
|
|
388
|
-
this.accessor.options.
|
|
419
|
+
this.accessor.options.createRightHeaderActionComponent(this.groupPanel);
|
|
389
420
|
this.addDisposables(this._rightHeaderActions);
|
|
390
421
|
this._rightHeaderActions.init({
|
|
391
422
|
containerApi: this._api,
|
|
392
423
|
api: this.groupPanel.api,
|
|
424
|
+
group: this.groupPanel,
|
|
393
425
|
});
|
|
394
426
|
this.tabsContainer.setRightActionsElement(this._rightHeaderActions.element);
|
|
395
427
|
}
|
|
396
|
-
if (this.accessor.options.
|
|
428
|
+
if (this.accessor.options.createLeftHeaderActionComponent) {
|
|
397
429
|
this._leftHeaderActions =
|
|
398
|
-
this.accessor.options.
|
|
430
|
+
this.accessor.options.createLeftHeaderActionComponent(this.groupPanel);
|
|
399
431
|
this.addDisposables(this._leftHeaderActions);
|
|
400
432
|
this._leftHeaderActions.init({
|
|
401
433
|
containerApi: this._api,
|
|
402
434
|
api: this.groupPanel.api,
|
|
435
|
+
group: this.groupPanel,
|
|
403
436
|
});
|
|
404
437
|
this.tabsContainer.setLeftActionsElement(this._leftHeaderActions.element);
|
|
405
438
|
}
|
|
406
|
-
if (this.accessor.options.
|
|
439
|
+
if (this.accessor.options.createPrefixHeaderActionComponent) {
|
|
407
440
|
this._prefixHeaderActions =
|
|
408
|
-
this.accessor.options.
|
|
441
|
+
this.accessor.options.createPrefixHeaderActionComponent(this.groupPanel);
|
|
409
442
|
this.addDisposables(this._prefixHeaderActions);
|
|
410
443
|
this._prefixHeaderActions.init({
|
|
411
444
|
containerApi: this._api,
|
|
412
445
|
api: this.groupPanel.api,
|
|
446
|
+
group: this.groupPanel,
|
|
413
447
|
});
|
|
414
448
|
this.tabsContainer.setPrefixActionsElement(this._prefixHeaderActions.element);
|
|
415
449
|
}
|
|
@@ -622,7 +656,8 @@ var DockviewGroupPanelModel = /** @class */ (function (_super) {
|
|
|
622
656
|
this.tabsContainer.delete(panel.id);
|
|
623
657
|
this._panels.splice(index, 1);
|
|
624
658
|
if (this.mostRecentlyUsed.includes(panel)) {
|
|
625
|
-
this.mostRecentlyUsed.
|
|
659
|
+
var index_1 = this.mostRecentlyUsed.indexOf(panel);
|
|
660
|
+
this.mostRecentlyUsed.splice(index_1, 1);
|
|
626
661
|
}
|
|
627
662
|
var disposable = this._panelDisposables.get(panel.id);
|
|
628
663
|
if (disposable) {
|
|
@@ -705,17 +740,9 @@ var DockviewGroupPanelModel = /** @class */ (function (_super) {
|
|
|
705
740
|
}
|
|
706
741
|
};
|
|
707
742
|
DockviewGroupPanelModel.prototype.canDisplayOverlay = function (event, position, target) {
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
nativeEvent: event,
|
|
712
|
-
target: target,
|
|
713
|
-
group: this.accessor.getPanel(this.id),
|
|
714
|
-
position: position,
|
|
715
|
-
getData: dataTransfer_1.getPanelData,
|
|
716
|
-
});
|
|
717
|
-
}
|
|
718
|
-
return false;
|
|
743
|
+
var firedEvent = new options_1.DockviewUnhandledDragOverEvent(event, target, position, dataTransfer_1.getPanelData, this.accessor.getPanel(this.id));
|
|
744
|
+
this._onUnhandledDragOverEvent.fire(firedEvent);
|
|
745
|
+
return firedEvent.isAccepted;
|
|
719
746
|
};
|
|
720
747
|
DockviewGroupPanelModel.prototype.handleDropEvent = function (type, event, position, index) {
|
|
721
748
|
if (this.locked === 'no-drop-target') {
|
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.DockviewPanelModel = void 0;
|
|
15
4
|
var defaultTab_1 = require("./components/tab/defaultTab");
|
|
16
|
-
var componentFactory_1 = require("../panel/componentFactory");
|
|
17
5
|
var DockviewPanelModel = /** @class */ (function () {
|
|
18
6
|
function DockviewPanelModel(accessor, id, contentComponent, tabComponent) {
|
|
19
7
|
this.accessor = accessor;
|
|
@@ -38,7 +26,7 @@ var DockviewPanelModel = /** @class */ (function () {
|
|
|
38
26
|
configurable: true
|
|
39
27
|
});
|
|
40
28
|
DockviewPanelModel.prototype.init = function (params) {
|
|
41
|
-
this.content.init(
|
|
29
|
+
this.content.init(params);
|
|
42
30
|
this.tab.init(params);
|
|
43
31
|
};
|
|
44
32
|
DockviewPanelModel.prototype.updateParentGroup = function (_group, _isPanelVisible) {
|
|
@@ -59,20 +47,29 @@ var DockviewPanelModel = /** @class */ (function () {
|
|
|
59
47
|
(_d = (_c = this.tab).dispose) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
60
48
|
};
|
|
61
49
|
DockviewPanelModel.prototype.createContentComponent = function (id, componentName) {
|
|
62
|
-
|
|
63
|
-
|
|
50
|
+
return this.accessor.options.createComponent({
|
|
51
|
+
id: id,
|
|
52
|
+
name: componentName,
|
|
53
|
+
});
|
|
64
54
|
};
|
|
65
55
|
DockviewPanelModel.prototype.createTabComponent = function (id, componentName) {
|
|
66
|
-
var
|
|
67
|
-
if (
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
56
|
+
var name = componentName !== null && componentName !== void 0 ? componentName : this.accessor.options.defaultTabComponent;
|
|
57
|
+
if (name) {
|
|
58
|
+
if (this.accessor.options.createTabComponent) {
|
|
59
|
+
var component = this.accessor.options.createTabComponent({
|
|
60
|
+
id: id,
|
|
61
|
+
name: name,
|
|
62
|
+
});
|
|
63
|
+
if (component) {
|
|
64
|
+
return component;
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
return new defaultTab_1.DefaultTab();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
console.warn("dockview: tabComponent '".concat(componentName, "' was not found. falling back to the default tab."));
|
|
75
71
|
}
|
|
72
|
+
return new defaultTab_1.DefaultTab();
|
|
76
73
|
};
|
|
77
74
|
return DockviewPanelModel;
|
|
78
75
|
}());
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { DockviewApi } from '../api/component.api';
|
|
2
|
+
import { DockviewGroupPanelApi } from '../api/dockviewGroupPanelApi';
|
|
3
|
+
import { DockviewPanelApi } from '../api/dockviewPanelApi';
|
|
4
|
+
import { PanelParameters } from '../framwork';
|
|
5
|
+
import { DockviewGroupPanel, IDockviewGroupPanel } from './dockviewGroupPanel';
|
|
6
|
+
import { IDockviewPanel } from './dockviewPanel';
|
|
7
|
+
export interface IGroupPanelBaseProps<T extends {
|
|
8
|
+
[index: string]: any;
|
|
9
|
+
} = any> extends PanelParameters<T> {
|
|
10
|
+
api: DockviewPanelApi;
|
|
11
|
+
containerApi: DockviewApi;
|
|
12
|
+
}
|
|
13
|
+
export type IDockviewPanelHeaderProps<T extends {
|
|
14
|
+
[index: string]: any;
|
|
15
|
+
} = any> = IGroupPanelBaseProps<T>;
|
|
16
|
+
export type IDockviewPanelProps<T extends {
|
|
17
|
+
[index: string]: any;
|
|
18
|
+
} = any> = IGroupPanelBaseProps<T>;
|
|
19
|
+
export interface IDockviewHeaderActionsProps {
|
|
20
|
+
api: DockviewGroupPanelApi;
|
|
21
|
+
containerApi: DockviewApi;
|
|
22
|
+
panels: IDockviewPanel[];
|
|
23
|
+
activePanel: IDockviewPanel | undefined;
|
|
24
|
+
isGroupActive: boolean;
|
|
25
|
+
group: DockviewGroupPanel;
|
|
26
|
+
}
|
|
27
|
+
export interface IGroupHeaderProps {
|
|
28
|
+
api: DockviewGroupPanelApi;
|
|
29
|
+
containerApi: DockviewApi;
|
|
30
|
+
group: IDockviewGroupPanel;
|
|
31
|
+
}
|
|
32
|
+
export interface IWatermarkPanelProps {
|
|
33
|
+
containerApi: DockviewApi;
|
|
34
|
+
group?: IDockviewGroupPanel;
|
|
35
|
+
}
|
|
36
|
+
export interface DockviewReadyEvent {
|
|
37
|
+
api: DockviewApi;
|
|
38
|
+
}
|
|
@@ -1,74 +1,33 @@
|
|
|
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,
|
|
4
|
+
import { IContentRenderer, ITabRenderer, IWatermarkRenderer } from './types';
|
|
5
5
|
import { Parameters } from '../panel/types';
|
|
6
6
|
import { DockviewGroupPanel } from './dockviewGroupPanel';
|
|
7
|
-
import { ISplitviewStyles, Orientation } from '../splitview/splitview';
|
|
8
7
|
import { PanelTransfer } from '../dnd/dataTransfer';
|
|
9
8
|
import { IDisposable } from '../lifecycle';
|
|
10
9
|
import { DroptargetOverlayModel, Position } from '../dnd/droptarget';
|
|
11
10
|
import { DockviewGroupDropLocation, GroupOptions } from './dockviewGroupPanelModel';
|
|
12
11
|
import { IDockviewPanel } from './dockviewPanel';
|
|
13
|
-
import { ComponentConstructor, FrameworkFactory } from '../panel/componentFactory';
|
|
14
|
-
import { DockviewGroupPanelApi } from '../api/dockviewGroupPanelApi';
|
|
15
12
|
import { DockviewPanelRenderer } from '../overlayRenderContainer';
|
|
13
|
+
import { IGroupHeaderProps } from './framework';
|
|
16
14
|
export interface IHeaderActionsRenderer extends IDisposable {
|
|
17
15
|
readonly element: HTMLElement;
|
|
18
|
-
init(params:
|
|
19
|
-
containerApi: DockviewApi;
|
|
20
|
-
api: DockviewGroupPanelApi;
|
|
21
|
-
}): void;
|
|
22
|
-
}
|
|
23
|
-
export interface GroupPanelFrameworkComponentFactory {
|
|
24
|
-
content: FrameworkFactory<IContentRenderer>;
|
|
25
|
-
tab: FrameworkFactory<ITabRenderer>;
|
|
26
|
-
watermark: FrameworkFactory<IWatermarkRenderer>;
|
|
16
|
+
init(params: IGroupHeaderProps): void;
|
|
27
17
|
}
|
|
28
18
|
export interface TabContextMenuEvent {
|
|
29
19
|
event: MouseEvent;
|
|
30
20
|
api: DockviewApi;
|
|
31
21
|
panel: IDockviewPanel;
|
|
32
22
|
}
|
|
33
|
-
export interface DockviewRenderFunctions {
|
|
34
|
-
tabComponents?: {
|
|
35
|
-
[componentName: string]: ComponentConstructor<ITabRenderer>;
|
|
36
|
-
};
|
|
37
|
-
components?: {
|
|
38
|
-
[componentName: string]: ComponentConstructor<IContentRenderer>;
|
|
39
|
-
};
|
|
40
|
-
frameworkTabComponents?: {
|
|
41
|
-
[componentName: string]: any;
|
|
42
|
-
};
|
|
43
|
-
frameworkComponents?: {
|
|
44
|
-
[componentName: string]: any;
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
23
|
export interface ViewFactoryData {
|
|
48
24
|
content: string;
|
|
49
25
|
tab?: string;
|
|
50
26
|
}
|
|
51
|
-
export interface
|
|
52
|
-
nativeEvent: DragEvent;
|
|
53
|
-
target: DockviewGroupDropLocation;
|
|
54
|
-
position: Position;
|
|
55
|
-
group?: DockviewGroupPanel;
|
|
56
|
-
getData: () => PanelTransfer | undefined;
|
|
57
|
-
}
|
|
58
|
-
export interface DockviewComponentOptions extends DockviewRenderFunctions {
|
|
27
|
+
export interface DockviewOptions {
|
|
59
28
|
disableAutoResizing?: boolean;
|
|
60
|
-
|
|
61
|
-
watermarkFrameworkComponent?: any;
|
|
62
|
-
frameworkComponentFactory?: GroupPanelFrameworkComponentFactory;
|
|
63
|
-
orientation?: Orientation;
|
|
64
|
-
styles?: ISplitviewStyles;
|
|
65
|
-
defaultTabComponent?: string;
|
|
66
|
-
showDndOverlay?: (event: DockviewDndOverlayEvent) => boolean;
|
|
67
|
-
createRightHeaderActionsElement?: (group: DockviewGroupPanel) => IHeaderActionsRenderer;
|
|
68
|
-
createLeftHeaderActionsElement?: (group: DockviewGroupPanel) => IHeaderActionsRenderer;
|
|
69
|
-
createPrefixHeaderActionsElement?: (group: DockviewGroupPanel) => IHeaderActionsRenderer;
|
|
29
|
+
hideBorders?: boolean;
|
|
70
30
|
singleTabMode?: 'fullwidth' | 'default';
|
|
71
|
-
parentElement: HTMLElement;
|
|
72
31
|
disableFloatingGroups?: boolean;
|
|
73
32
|
floatingGroupBounds?: 'boundedWithinViewport' | {
|
|
74
33
|
minimumHeightWithinViewport?: number;
|
|
@@ -81,6 +40,44 @@ export interface DockviewComponentOptions extends DockviewRenderFunctions {
|
|
|
81
40
|
locked?: boolean;
|
|
82
41
|
disableDnd?: boolean;
|
|
83
42
|
}
|
|
43
|
+
export interface DockviewDndOverlayEvent {
|
|
44
|
+
nativeEvent: DragEvent;
|
|
45
|
+
target: DockviewGroupDropLocation;
|
|
46
|
+
position: Position;
|
|
47
|
+
group?: DockviewGroupPanel;
|
|
48
|
+
getData: () => PanelTransfer | undefined;
|
|
49
|
+
isAccepted: boolean;
|
|
50
|
+
accept(): void;
|
|
51
|
+
}
|
|
52
|
+
export declare class DockviewUnhandledDragOverEvent implements DockviewDndOverlayEvent {
|
|
53
|
+
readonly nativeEvent: DragEvent;
|
|
54
|
+
readonly target: DockviewGroupDropLocation;
|
|
55
|
+
readonly position: Position;
|
|
56
|
+
readonly getData: () => PanelTransfer | undefined;
|
|
57
|
+
readonly group?: DockviewGroupPanel | undefined;
|
|
58
|
+
private _isAccepted;
|
|
59
|
+
get isAccepted(): boolean;
|
|
60
|
+
constructor(nativeEvent: DragEvent, target: DockviewGroupDropLocation, position: Position, getData: () => PanelTransfer | undefined, group?: DockviewGroupPanel | undefined);
|
|
61
|
+
accept(): void;
|
|
62
|
+
}
|
|
63
|
+
export declare const PROPERTY_KEYS: (keyof DockviewOptions)[];
|
|
64
|
+
export interface DockviewFrameworkOptions {
|
|
65
|
+
parentElement: HTMLElement;
|
|
66
|
+
defaultTabComponent?: string;
|
|
67
|
+
createRightHeaderActionComponent?: (group: DockviewGroupPanel) => IHeaderActionsRenderer;
|
|
68
|
+
createLeftHeaderActionComponent?: (group: DockviewGroupPanel) => IHeaderActionsRenderer;
|
|
69
|
+
createPrefixHeaderActionComponent?: (group: DockviewGroupPanel) => IHeaderActionsRenderer;
|
|
70
|
+
createTabComponent?: (options: {
|
|
71
|
+
id: string;
|
|
72
|
+
name: string;
|
|
73
|
+
}) => ITabRenderer | undefined;
|
|
74
|
+
createComponent: (options: {
|
|
75
|
+
id: string;
|
|
76
|
+
name: string;
|
|
77
|
+
}) => IContentRenderer;
|
|
78
|
+
createWatermarkComponent?: () => IWatermarkRenderer;
|
|
79
|
+
}
|
|
80
|
+
export type DockviewComponentOptions = DockviewOptions & DockviewFrameworkOptions;
|
|
84
81
|
export interface PanelOptions<P extends object = Parameters> {
|
|
85
82
|
component: string;
|
|
86
83
|
tabComponent?: string;
|
|
@@ -118,11 +115,36 @@ type AddPanelPositionUnion = {
|
|
|
118
115
|
type AddPanelOptionsUnion = AddPanelFloatingGroupUnion | AddPanelPositionUnion;
|
|
119
116
|
export type AddPanelOptions<P extends object = Parameters> = {
|
|
120
117
|
params?: P;
|
|
118
|
+
/**
|
|
119
|
+
* The unique id for the panel
|
|
120
|
+
*/
|
|
121
121
|
id: string;
|
|
122
|
+
/**
|
|
123
|
+
* The title for the panel which can be accessed within both the tab and component.
|
|
124
|
+
*
|
|
125
|
+
* If using the default tab renderer this title will be displayed in the tab.
|
|
126
|
+
*/
|
|
122
127
|
title?: string;
|
|
128
|
+
/**
|
|
129
|
+
* The id of the component renderer
|
|
130
|
+
*/
|
|
123
131
|
component: string;
|
|
132
|
+
/**
|
|
133
|
+
* The id of the tab componnet renderer
|
|
134
|
+
*/
|
|
124
135
|
tabComponent?: string;
|
|
136
|
+
/**
|
|
137
|
+
* The rendering mode of the panel.
|
|
138
|
+
*
|
|
139
|
+
* This dictates what happens to the HTML of the panel when it is hidden.
|
|
140
|
+
*/
|
|
125
141
|
renderer?: DockviewPanelRenderer;
|
|
142
|
+
/**
|
|
143
|
+
* If true then add the panel without setting it as the active panel.
|
|
144
|
+
*
|
|
145
|
+
* Defaults to `false` which forces newly added panels to become active.
|
|
146
|
+
*/
|
|
147
|
+
inactive?: boolean;
|
|
126
148
|
} & Partial<AddPanelOptionsUnion>;
|
|
127
149
|
type AddGroupOptionsWithPanel = {
|
|
128
150
|
referencePanel: string | IDockviewPanel;
|
|
@@ -1,6 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isGroupOptionsWithGroup = exports.isGroupOptionsWithPanel = exports.isPanelOptionsWithGroup = exports.isPanelOptionsWithPanel = void 0;
|
|
3
|
+
exports.isGroupOptionsWithGroup = exports.isGroupOptionsWithPanel = exports.isPanelOptionsWithGroup = exports.isPanelOptionsWithPanel = exports.PROPERTY_KEYS = exports.DockviewUnhandledDragOverEvent = void 0;
|
|
4
|
+
var DockviewUnhandledDragOverEvent = /** @class */ (function () {
|
|
5
|
+
function DockviewUnhandledDragOverEvent(nativeEvent, target, position, getData, group) {
|
|
6
|
+
this.nativeEvent = nativeEvent;
|
|
7
|
+
this.target = target;
|
|
8
|
+
this.position = position;
|
|
9
|
+
this.getData = getData;
|
|
10
|
+
this.group = group;
|
|
11
|
+
this._isAccepted = false;
|
|
12
|
+
}
|
|
13
|
+
Object.defineProperty(DockviewUnhandledDragOverEvent.prototype, "isAccepted", {
|
|
14
|
+
get: function () {
|
|
15
|
+
return this._isAccepted;
|
|
16
|
+
},
|
|
17
|
+
enumerable: false,
|
|
18
|
+
configurable: true
|
|
19
|
+
});
|
|
20
|
+
DockviewUnhandledDragOverEvent.prototype.accept = function () {
|
|
21
|
+
this._isAccepted = true;
|
|
22
|
+
};
|
|
23
|
+
return DockviewUnhandledDragOverEvent;
|
|
24
|
+
}());
|
|
25
|
+
exports.DockviewUnhandledDragOverEvent = DockviewUnhandledDragOverEvent;
|
|
26
|
+
exports.PROPERTY_KEYS = (function () {
|
|
27
|
+
/**
|
|
28
|
+
* by readong the keys from an empty value object TypeScript will error
|
|
29
|
+
* when we add or remove new properties to `DockviewOptions`
|
|
30
|
+
*/
|
|
31
|
+
var properties = {
|
|
32
|
+
disableAutoResizing: undefined,
|
|
33
|
+
hideBorders: undefined,
|
|
34
|
+
singleTabMode: undefined,
|
|
35
|
+
disableFloatingGroups: undefined,
|
|
36
|
+
floatingGroupBounds: undefined,
|
|
37
|
+
popoutUrl: undefined,
|
|
38
|
+
defaultRenderer: undefined,
|
|
39
|
+
debug: undefined,
|
|
40
|
+
rootOverlayModel: undefined,
|
|
41
|
+
locked: undefined,
|
|
42
|
+
disableDnd: undefined,
|
|
43
|
+
};
|
|
44
|
+
return Object.keys(properties);
|
|
45
|
+
})();
|
|
4
46
|
function isPanelOptionsWithPanel(data) {
|
|
5
47
|
if (data.referencePanel) {
|
|
6
48
|
return true;
|
|
@@ -2,7 +2,6 @@ import { IDockviewComponent } from './dockviewComponent';
|
|
|
2
2
|
import { DockviewPanelApi } from '../api/dockviewPanelApi';
|
|
3
3
|
import { PanelInitParameters, IPanel } from '../panel/types';
|
|
4
4
|
import { DockviewApi } from '../api/component.api';
|
|
5
|
-
import { Event } from '../events';
|
|
6
5
|
import { Optional } from '../types';
|
|
7
6
|
import { DockviewGroupPanel, IDockviewGroupPanel } from './dockviewGroupPanel';
|
|
8
7
|
import { DockviewPanelRenderer } from '../overlayRenderContainer';
|
|
@@ -13,27 +12,22 @@ export interface GroupPanelPartInitParameters extends PanelInitParameters, Heade
|
|
|
13
12
|
api: DockviewPanelApi;
|
|
14
13
|
containerApi: DockviewApi;
|
|
15
14
|
}
|
|
16
|
-
export interface GroupPanelContentPartInitParameters extends GroupPanelPartInitParameters {
|
|
17
|
-
tab: ITabRenderer;
|
|
18
|
-
}
|
|
19
15
|
export interface WatermarkRendererInitParameters {
|
|
20
16
|
containerApi: DockviewApi;
|
|
21
17
|
group?: IDockviewGroupPanel;
|
|
22
18
|
}
|
|
23
|
-
export interface IWatermarkRenderer extends Optional<Omit<IPanel, 'id' | 'init'>, 'dispose' | 'update' | 'layout' | 'toJSON'> {
|
|
19
|
+
export interface IWatermarkRenderer extends Optional<Omit<IPanel, 'id' | 'init'>, 'dispose' | 'update' | 'layout' | 'toJSON' | 'focus'> {
|
|
24
20
|
readonly element: HTMLElement;
|
|
25
21
|
init: (params: WatermarkRendererInitParameters) => void;
|
|
26
22
|
updateParentGroup(group: DockviewGroupPanel, visible: boolean): void;
|
|
27
23
|
}
|
|
28
|
-
export interface ITabRenderer extends Optional<Omit<IPanel, 'id'>, 'dispose' | 'update' | 'layout' | 'toJSON'> {
|
|
24
|
+
export interface ITabRenderer extends Optional<Omit<IPanel, 'id'>, 'dispose' | 'update' | 'layout' | 'toJSON' | 'focus'> {
|
|
29
25
|
readonly element: HTMLElement;
|
|
30
26
|
init(parameters: GroupPanelPartInitParameters): void;
|
|
31
27
|
}
|
|
32
|
-
export interface IContentRenderer extends Optional<Omit<IPanel, 'id'>, 'dispose' | 'update' | 'layout' | 'toJSON'> {
|
|
28
|
+
export interface IContentRenderer extends Optional<Omit<IPanel, 'id'>, 'dispose' | 'update' | 'layout' | 'toJSON' | 'focus'> {
|
|
33
29
|
readonly element: HTMLElement;
|
|
34
|
-
|
|
35
|
-
readonly onDidBlur?: Event<void>;
|
|
36
|
-
init(parameters: GroupPanelContentPartInitParameters): void;
|
|
30
|
+
init(parameters: GroupPanelPartInitParameters): void;
|
|
37
31
|
}
|
|
38
32
|
export interface WatermarkPartInitParameters {
|
|
39
33
|
accessor: IDockviewComponent;
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -12,14 +12,15 @@ export { SplitviewComponentOptions, PanelViewInitParameters, } from './splitview
|
|
|
12
12
|
export * from './paneview/paneview';
|
|
13
13
|
export * from './gridview/gridview';
|
|
14
14
|
export { GridviewComponentOptions } from './gridview/options';
|
|
15
|
-
export * from './dockview/dockviewGroupPanelModel';
|
|
16
15
|
export * from './gridview/baseComponentGridview';
|
|
17
16
|
export * from './paneview/draggablePaneviewPanel';
|
|
18
17
|
export * from './dockview/components/panel/content';
|
|
19
18
|
export * from './dockview/components/tab/tab';
|
|
19
|
+
export * from './dockview/dockviewGroupPanelModel';
|
|
20
20
|
export { TabDragEvent, GroupDragEvent, } from './dockview/components/titlebar/tabsContainer';
|
|
21
21
|
export * from './dockview/types';
|
|
22
22
|
export * from './dockview/dockviewGroupPanel';
|
|
23
|
+
export { IGroupPanelBaseProps, IDockviewPanelHeaderProps, IDockviewPanelProps, IDockviewHeaderActionsProps, IGroupHeaderProps, IWatermarkPanelProps, DockviewReadyEvent, } from './dockview/framework';
|
|
23
24
|
export * from './dockview/options';
|
|
24
25
|
export * from './dockview/dockviewPanel';
|
|
25
26
|
export * from './dockview/components/tab/defaultTab';
|
package/dist/cjs/index.js
CHANGED
|
@@ -31,11 +31,11 @@ __exportStar(require("./panel/componentFactory"), exports);
|
|
|
31
31
|
__exportStar(require("./splitview/splitview"), exports);
|
|
32
32
|
__exportStar(require("./paneview/paneview"), exports);
|
|
33
33
|
__exportStar(require("./gridview/gridview"), exports);
|
|
34
|
-
__exportStar(require("./dockview/dockviewGroupPanelModel"), exports);
|
|
35
34
|
__exportStar(require("./gridview/baseComponentGridview"), exports);
|
|
36
35
|
__exportStar(require("./paneview/draggablePaneviewPanel"), exports);
|
|
37
36
|
__exportStar(require("./dockview/components/panel/content"), exports);
|
|
38
37
|
__exportStar(require("./dockview/components/tab/tab"), exports);
|
|
38
|
+
__exportStar(require("./dockview/dockviewGroupPanelModel"), exports);
|
|
39
39
|
__exportStar(require("./dockview/types"), exports);
|
|
40
40
|
__exportStar(require("./dockview/dockviewGroupPanel"), exports);
|
|
41
41
|
__exportStar(require("./dockview/options"), exports);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Droptarget } from './dnd/droptarget';
|
|
2
2
|
import { CompositeDisposable } from './lifecycle';
|
|
3
3
|
import { IDockviewPanel } from './dockview/dockviewPanel';
|
|
4
|
-
export type DockviewPanelRenderer = '
|
|
4
|
+
export type DockviewPanelRenderer = 'onlyWhenVisible' | 'always';
|
|
5
5
|
export interface IRenderable {
|
|
6
6
|
readonly element: HTMLElement;
|
|
7
7
|
readonly dropTarget: Droptarget;
|