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
|
@@ -5,6 +5,7 @@ import { addDisposableListener, DockviewEvent, Emitter, } from '../events';
|
|
|
5
5
|
import { CompositeDisposable } from '../lifecycle';
|
|
6
6
|
import { ContentContainer, } from './components/panel/content';
|
|
7
7
|
import { TabsContainer, } from './components/titlebar/tabsContainer';
|
|
8
|
+
import { DockviewUnhandledDragOverEvent, } from './options';
|
|
8
9
|
export class DockviewDidDropEvent extends DockviewEvent {
|
|
9
10
|
get nativeEvent() {
|
|
10
11
|
return this.options.nativeEvent;
|
|
@@ -40,7 +41,7 @@ export class DockviewWillDropEvent extends DockviewDidDropEvent {
|
|
|
40
41
|
}
|
|
41
42
|
export class WillShowOverlayLocationEvent {
|
|
42
43
|
get kind() {
|
|
43
|
-
return this.
|
|
44
|
+
return this.options.kind;
|
|
44
45
|
}
|
|
45
46
|
get nativeEvent() {
|
|
46
47
|
return this.event.nativeEvent;
|
|
@@ -51,12 +52,24 @@ export class WillShowOverlayLocationEvent {
|
|
|
51
52
|
get defaultPrevented() {
|
|
52
53
|
return this.event.defaultPrevented;
|
|
53
54
|
}
|
|
55
|
+
get panel() {
|
|
56
|
+
return this.options.panel;
|
|
57
|
+
}
|
|
58
|
+
get api() {
|
|
59
|
+
return this.options.api;
|
|
60
|
+
}
|
|
61
|
+
get group() {
|
|
62
|
+
return this.options.group;
|
|
63
|
+
}
|
|
54
64
|
preventDefault() {
|
|
55
65
|
this.event.preventDefault();
|
|
56
66
|
}
|
|
67
|
+
getData() {
|
|
68
|
+
return this.options.getData();
|
|
69
|
+
}
|
|
57
70
|
constructor(event, options) {
|
|
58
71
|
this.event = event;
|
|
59
|
-
this.
|
|
72
|
+
this.options = options;
|
|
60
73
|
}
|
|
61
74
|
}
|
|
62
75
|
export class DockviewGroupPanelModel extends CompositeDisposable {
|
|
@@ -170,6 +183,8 @@ export class DockviewGroupPanelModel extends CompositeDisposable {
|
|
|
170
183
|
this.onDidRemovePanel = this._onDidRemovePanel.event;
|
|
171
184
|
this._onDidActivePanelChange = new Emitter();
|
|
172
185
|
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
186
|
+
this._onUnhandledDragOverEvent = new Emitter();
|
|
187
|
+
this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
|
|
173
188
|
this._overwriteRenderContainer = null;
|
|
174
189
|
toggleClass(this.container, 'groupview', true);
|
|
175
190
|
this._api = new DockviewApi(this.accessor);
|
|
@@ -195,8 +210,12 @@ export class DockviewGroupPanelModel extends CompositeDisposable {
|
|
|
195
210
|
}), this.contentContainer.dropTarget.onWillShowOverlay((event) => {
|
|
196
211
|
this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
|
|
197
212
|
kind: 'content',
|
|
213
|
+
panel: this.activePanel,
|
|
214
|
+
api: this._api,
|
|
215
|
+
group: this.groupPanel,
|
|
216
|
+
getData: getPanelData,
|
|
198
217
|
}));
|
|
199
|
-
}), this._onMove, this._onDidChange, this._onDidDrop, this._onWillDrop, this._onDidAddPanel, this._onDidRemovePanel, this._onDidActivePanelChange);
|
|
218
|
+
}), this._onMove, this._onDidChange, this._onDidDrop, this._onWillDrop, this._onDidAddPanel, this._onDidRemovePanel, this._onDidActivePanelChange, this._onUnhandledDragOverEvent);
|
|
200
219
|
}
|
|
201
220
|
focusContent() {
|
|
202
221
|
this.contentContainer.element.focus();
|
|
@@ -227,33 +246,36 @@ export class DockviewGroupPanelModel extends CompositeDisposable {
|
|
|
227
246
|
// correctly initialized
|
|
228
247
|
this.setActive(this.isActive, true);
|
|
229
248
|
this.updateContainer();
|
|
230
|
-
if (this.accessor.options.
|
|
249
|
+
if (this.accessor.options.createRightHeaderActionComponent) {
|
|
231
250
|
this._rightHeaderActions =
|
|
232
|
-
this.accessor.options.
|
|
251
|
+
this.accessor.options.createRightHeaderActionComponent(this.groupPanel);
|
|
233
252
|
this.addDisposables(this._rightHeaderActions);
|
|
234
253
|
this._rightHeaderActions.init({
|
|
235
254
|
containerApi: this._api,
|
|
236
255
|
api: this.groupPanel.api,
|
|
256
|
+
group: this.groupPanel,
|
|
237
257
|
});
|
|
238
258
|
this.tabsContainer.setRightActionsElement(this._rightHeaderActions.element);
|
|
239
259
|
}
|
|
240
|
-
if (this.accessor.options.
|
|
260
|
+
if (this.accessor.options.createLeftHeaderActionComponent) {
|
|
241
261
|
this._leftHeaderActions =
|
|
242
|
-
this.accessor.options.
|
|
262
|
+
this.accessor.options.createLeftHeaderActionComponent(this.groupPanel);
|
|
243
263
|
this.addDisposables(this._leftHeaderActions);
|
|
244
264
|
this._leftHeaderActions.init({
|
|
245
265
|
containerApi: this._api,
|
|
246
266
|
api: this.groupPanel.api,
|
|
267
|
+
group: this.groupPanel,
|
|
247
268
|
});
|
|
248
269
|
this.tabsContainer.setLeftActionsElement(this._leftHeaderActions.element);
|
|
249
270
|
}
|
|
250
|
-
if (this.accessor.options.
|
|
271
|
+
if (this.accessor.options.createPrefixHeaderActionComponent) {
|
|
251
272
|
this._prefixHeaderActions =
|
|
252
|
-
this.accessor.options.
|
|
273
|
+
this.accessor.options.createPrefixHeaderActionComponent(this.groupPanel);
|
|
253
274
|
this.addDisposables(this._prefixHeaderActions);
|
|
254
275
|
this._prefixHeaderActions.init({
|
|
255
276
|
containerApi: this._api,
|
|
256
277
|
api: this.groupPanel.api,
|
|
278
|
+
group: this.groupPanel,
|
|
257
279
|
});
|
|
258
280
|
this.tabsContainer.setPrefixActionsElement(this._prefixHeaderActions.element);
|
|
259
281
|
}
|
|
@@ -452,7 +474,8 @@ export class DockviewGroupPanelModel extends CompositeDisposable {
|
|
|
452
474
|
this.tabsContainer.delete(panel.id);
|
|
453
475
|
this._panels.splice(index, 1);
|
|
454
476
|
if (this.mostRecentlyUsed.includes(panel)) {
|
|
455
|
-
this.mostRecentlyUsed.
|
|
477
|
+
const index = this.mostRecentlyUsed.indexOf(panel);
|
|
478
|
+
this.mostRecentlyUsed.splice(index, 1);
|
|
456
479
|
}
|
|
457
480
|
const disposable = this._panelDisposables.get(panel.id);
|
|
458
481
|
if (disposable) {
|
|
@@ -527,17 +550,9 @@ export class DockviewGroupPanelModel extends CompositeDisposable {
|
|
|
527
550
|
}
|
|
528
551
|
}
|
|
529
552
|
canDisplayOverlay(event, position, target) {
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
nativeEvent: event,
|
|
534
|
-
target,
|
|
535
|
-
group: this.accessor.getPanel(this.id),
|
|
536
|
-
position,
|
|
537
|
-
getData: getPanelData,
|
|
538
|
-
});
|
|
539
|
-
}
|
|
540
|
-
return false;
|
|
553
|
+
const firedEvent = new DockviewUnhandledDragOverEvent(event, target, position, getPanelData, this.accessor.getPanel(this.id));
|
|
554
|
+
this._onUnhandledDragOverEvent.fire(firedEvent);
|
|
555
|
+
return firedEvent.isAccepted;
|
|
541
556
|
}
|
|
542
557
|
handleDropEvent(type, event, position, index) {
|
|
543
558
|
if (this.locked === 'no-drop-target') {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { DefaultTab } from './components/tab/defaultTab';
|
|
2
|
-
import { createComponent } from '../panel/componentFactory';
|
|
3
2
|
export class DockviewPanelModel {
|
|
4
3
|
get content() {
|
|
5
4
|
return this._content;
|
|
@@ -16,7 +15,7 @@ export class DockviewPanelModel {
|
|
|
16
15
|
this._tab = this.createTabComponent(this.id, tabComponent);
|
|
17
16
|
}
|
|
18
17
|
init(params) {
|
|
19
|
-
this.content.init(
|
|
18
|
+
this.content.init(params);
|
|
20
19
|
this.tab.init(params);
|
|
21
20
|
}
|
|
22
21
|
updateParentGroup(_group, _isPanelVisible) {
|
|
@@ -37,19 +36,28 @@ export class DockviewPanelModel {
|
|
|
37
36
|
(_d = (_c = this.tab).dispose) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
38
37
|
}
|
|
39
38
|
createContentComponent(id, componentName) {
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
return this.accessor.options.createComponent({
|
|
40
|
+
id,
|
|
41
|
+
name: componentName,
|
|
42
|
+
});
|
|
42
43
|
}
|
|
43
44
|
createTabComponent(id, componentName) {
|
|
44
|
-
|
|
45
|
-
if (
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
const name = componentName !== null && componentName !== void 0 ? componentName : this.accessor.options.defaultTabComponent;
|
|
46
|
+
if (name) {
|
|
47
|
+
if (this.accessor.options.createTabComponent) {
|
|
48
|
+
const component = this.accessor.options.createTabComponent({
|
|
49
|
+
id,
|
|
50
|
+
name,
|
|
51
|
+
});
|
|
52
|
+
if (component) {
|
|
53
|
+
return component;
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
return new DefaultTab();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
console.warn(`dockview: tabComponent '${componentName}' was not found. falling back to the default tab.`);
|
|
53
60
|
}
|
|
61
|
+
return new DefaultTab();
|
|
54
62
|
}
|
|
55
63
|
}
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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,3 +1,39 @@
|
|
|
1
|
+
export class DockviewUnhandledDragOverEvent {
|
|
2
|
+
get isAccepted() {
|
|
3
|
+
return this._isAccepted;
|
|
4
|
+
}
|
|
5
|
+
constructor(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
|
+
accept() {
|
|
14
|
+
this._isAccepted = true;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export const PROPERTY_KEYS = (() => {
|
|
18
|
+
/**
|
|
19
|
+
* by readong the keys from an empty value object TypeScript will error
|
|
20
|
+
* when we add or remove new properties to `DockviewOptions`
|
|
21
|
+
*/
|
|
22
|
+
const properties = {
|
|
23
|
+
disableAutoResizing: undefined,
|
|
24
|
+
hideBorders: undefined,
|
|
25
|
+
singleTabMode: undefined,
|
|
26
|
+
disableFloatingGroups: undefined,
|
|
27
|
+
floatingGroupBounds: undefined,
|
|
28
|
+
popoutUrl: undefined,
|
|
29
|
+
defaultRenderer: undefined,
|
|
30
|
+
debug: undefined,
|
|
31
|
+
rootOverlayModel: undefined,
|
|
32
|
+
locked: undefined,
|
|
33
|
+
disableDnd: undefined,
|
|
34
|
+
};
|
|
35
|
+
return Object.keys(properties);
|
|
36
|
+
})();
|
|
1
37
|
export function isPanelOptionsWithPanel(data) {
|
|
2
38
|
if (data.referencePanel) {
|
|
3
39
|
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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/esm/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/esm/index.js
CHANGED
|
@@ -10,11 +10,11 @@ export * from './panel/componentFactory';
|
|
|
10
10
|
export * from './splitview/splitview';
|
|
11
11
|
export * from './paneview/paneview';
|
|
12
12
|
export * from './gridview/gridview';
|
|
13
|
-
export * from './dockview/dockviewGroupPanelModel';
|
|
14
13
|
export * from './gridview/baseComponentGridview';
|
|
15
14
|
export * from './paneview/draggablePaneviewPanel';
|
|
16
15
|
export * from './dockview/components/panel/content';
|
|
17
16
|
export * from './dockview/components/tab/tab';
|
|
17
|
+
export * from './dockview/dockviewGroupPanelModel';
|
|
18
18
|
export * from './dockview/types';
|
|
19
19
|
export * from './dockview/dockviewGroupPanel';
|
|
20
20
|
export * from './dockview/options';
|
|
@@ -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;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dockview-core",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Zero dependency layout manager supporting tabs, grids and splitviews
|
|
3
|
+
"version": "1.13.0",
|
|
4
|
+
"description": "Zero dependency layout manager supporting tabs, grids and splitviews",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"splitview",
|
|
7
7
|
"split-view",
|