dockview 1.5.2 → 1.6.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 +3 -2
- package/dist/cjs/api/component.api.js +9 -2
- package/dist/cjs/api/component.api.js.map +1 -1
- package/dist/cjs/api/{groupPanelApi.d.ts → dockviewPanelApi.d.ts} +2 -2
- package/dist/cjs/api/{groupPanelApi.js → dockviewPanelApi.js} +4 -6
- package/dist/cjs/api/dockviewPanelApi.js.map +1 -0
- package/dist/cjs/api/gridviewPanelApi.d.ts +4 -3
- package/dist/cjs/api/gridviewPanelApi.js +4 -4
- package/dist/cjs/api/gridviewPanelApi.js.map +1 -1
- package/dist/cjs/api/panelApi.d.ts +7 -0
- package/dist/cjs/api/panelApi.js +17 -1
- package/dist/cjs/api/panelApi.js.map +1 -1
- package/dist/cjs/array.d.ts +1 -1
- package/dist/cjs/dnd/abstractDragHandler.d.ts +2 -2
- package/dist/cjs/dnd/abstractDragHandler.js +3 -3
- package/dist/cjs/dnd/abstractDragHandler.js.map +1 -1
- package/dist/cjs/dnd/dataTransfer.d.ts +2 -2
- package/dist/cjs/dnd/dataTransfer.js.map +1 -1
- package/dist/cjs/dnd/dnd.d.ts +1 -1
- package/dist/cjs/dnd/dnd.js +7 -12
- package/dist/cjs/dnd/dnd.js.map +1 -1
- package/dist/cjs/dnd/droptarget.d.ts +20 -15
- package/dist/cjs/dnd/droptarget.js +152 -74
- package/dist/cjs/dnd/droptarget.js.map +1 -1
- package/dist/cjs/dnd/ghost.d.ts +1 -0
- package/dist/cjs/dnd/ghost.js +15 -0
- package/dist/cjs/dnd/ghost.js.map +1 -0
- package/dist/cjs/dnd/groupDragHandler.d.ts +11 -0
- package/dist/cjs/dnd/groupDragHandler.js +62 -0
- package/dist/cjs/dnd/groupDragHandler.js.map +1 -0
- package/dist/cjs/dockview/defaultGroupPanelView.d.ts +1 -1
- package/dist/cjs/dockview/deserializer.d.ts +2 -1
- package/dist/cjs/dockview/dockviewComponent.d.ts +15 -7
- package/dist/cjs/dockview/dockviewComponent.js +215 -34
- package/dist/cjs/dockview/dockviewComponent.js.map +1 -1
- package/dist/{esm/dockview/dockviewGroupPanel.d.ts → cjs/dockview/dockviewPanel.d.ts} +16 -5
- package/dist/cjs/dockview/{dockviewGroupPanel.js → dockviewPanel.js} +25 -21
- package/dist/cjs/dockview/dockviewPanel.js.map +1 -0
- package/dist/cjs/dockview/options.d.ts +32 -10
- package/dist/cjs/dockview/options.js +29 -0
- package/dist/cjs/dockview/options.js.map +1 -1
- package/dist/cjs/dockview/validation.d.ts +2 -0
- package/dist/cjs/dockview/validation.js +135 -0
- package/dist/cjs/dockview/validation.js.map +1 -0
- package/dist/cjs/gridview/baseComponentGridview.d.ts +1 -1
- package/dist/cjs/gridview/baseComponentGridview.js +5 -6
- package/dist/cjs/gridview/baseComponentGridview.js.map +1 -1
- package/dist/cjs/gridview/basePanelView.d.ts +2 -2
- package/dist/cjs/gridview/gridview.d.ts +9 -3
- package/dist/cjs/gridview/gridview.js +38 -7
- package/dist/cjs/gridview/gridview.js.map +1 -1
- package/dist/cjs/gridview/gridviewComponent.d.ts +2 -2
- package/dist/cjs/gridview/gridviewComponent.js +2 -3
- package/dist/cjs/gridview/gridviewComponent.js.map +1 -1
- package/dist/cjs/gridview/gridviewPanel.d.ts +3 -3
- package/dist/cjs/gridview/gridviewPanel.js +1 -2
- package/dist/cjs/gridview/gridviewPanel.js.map +1 -1
- package/dist/cjs/gridview/types.d.ts +1 -1
- package/dist/cjs/groupview/dnd.d.ts +2 -1
- package/dist/cjs/groupview/dnd.js +1 -0
- package/dist/cjs/groupview/dnd.js.map +1 -1
- package/dist/cjs/groupview/groupview.d.ts +6 -6
- package/dist/cjs/groupview/groupview.js +43 -25
- package/dist/cjs/groupview/groupview.js.map +1 -1
- package/dist/cjs/groupview/groupviewPanel.d.ts +3 -3
- package/dist/cjs/groupview/panel/content.d.ts +1 -1
- package/dist/cjs/groupview/tab.d.ts +2 -12
- package/dist/cjs/groupview/tab.js +13 -9
- package/dist/cjs/groupview/tab.js.map +1 -1
- package/dist/cjs/groupview/titlebar/tabsContainer.d.ts +5 -8
- package/dist/cjs/groupview/titlebar/tabsContainer.js +23 -30
- package/dist/cjs/groupview/titlebar/tabsContainer.js.map +1 -1
- package/dist/cjs/groupview/titlebar/voidContainer.d.ts +15 -0
- package/dist/cjs/groupview/titlebar/voidContainer.js +74 -0
- package/dist/cjs/groupview/titlebar/voidContainer.js.map +1 -0
- package/dist/cjs/groupview/types.d.ts +18 -2
- package/dist/cjs/index.d.ts +3 -3
- package/dist/cjs/index.js +4 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/paneview/draggablePaneviewPanel.js +6 -5
- package/dist/cjs/paneview/draggablePaneviewPanel.js.map +1 -1
- package/dist/cjs/paneview/paneviewComponent.js +2 -2
- package/dist/cjs/paneview/paneviewComponent.js.map +1 -1
- package/dist/cjs/paneview/paneviewPanel.js +1 -0
- package/dist/cjs/paneview/paneviewPanel.js.map +1 -1
- package/dist/cjs/react/deserializer.d.ts +2 -1
- package/dist/cjs/react/deserializer.js +2 -2
- package/dist/cjs/react/deserializer.js.map +1 -1
- package/dist/cjs/react/dockview/defaultTab.d.ts +1 -1
- package/dist/cjs/react/dockview/dockview.d.ts +5 -4
- package/dist/cjs/react/dockview/dockview.js +1 -0
- package/dist/cjs/react/dockview/dockview.js.map +1 -1
- package/dist/cjs/react/dockview/groupControlsRenderer.d.ts +1 -1
- package/dist/cjs/react/gridview/view.js +2 -1
- package/dist/cjs/react/gridview/view.js.map +1 -1
- package/dist/cjs/react/react.d.ts +1 -1
- package/dist/cjs/splitview/core/splitview.d.ts +4 -4
- package/dist/cjs/splitview/splitviewComponent.d.ts +1 -1
- package/dist/cjs/splitview/splitviewComponent.js +2 -2
- package/dist/cjs/splitview/splitviewComponent.js.map +1 -1
- package/dist/cjs/splitview/splitviewPanel.js +1 -0
- package/dist/cjs/splitview/splitviewPanel.js.map +1 -1
- package/dist/cjs/types.d.ts +2 -1
- package/dist/cjs/types.js +5 -0
- package/dist/cjs/types.js.map +1 -1
- package/dist/dockview.amd.js +1411 -987
- package/dist/dockview.amd.min.js +2 -2
- package/dist/dockview.amd.min.noStyle.js +2 -2
- package/dist/dockview.amd.noStyle.js +1410 -986
- package/dist/dockview.cjs.js +1394 -970
- package/dist/dockview.esm.js +1385 -964
- package/dist/dockview.esm.min.js +2 -2
- package/dist/dockview.js +1411 -987
- package/dist/dockview.min.js +2 -2
- package/dist/dockview.min.noStyle.js +2 -2
- package/dist/dockview.noStyle.js +1410 -986
- package/dist/esm/actionbar/actionsContainer.js +3 -3
- package/dist/esm/api/component.api.d.ts +3 -2
- package/dist/esm/api/component.api.js +16 -13
- package/dist/esm/api/{groupPanelApi.d.ts → dockviewPanelApi.d.ts} +2 -2
- package/dist/esm/api/{groupPanelApi.js → dockviewPanelApi.js} +16 -18
- package/dist/esm/api/gridviewPanelApi.d.ts +4 -3
- package/dist/esm/api/gridviewPanelApi.js +4 -4
- package/dist/esm/api/panelApi.d.ts +7 -0
- package/dist/esm/api/panelApi.js +33 -17
- package/dist/esm/api/paneviewPanelApi.js +3 -3
- package/dist/esm/array.d.ts +1 -1
- package/dist/esm/dnd/abstractDragHandler.d.ts +2 -2
- package/dist/esm/dnd/abstractDragHandler.js +3 -3
- package/dist/esm/dnd/dataTransfer.d.ts +2 -2
- package/dist/esm/dnd/dnd.d.ts +1 -1
- package/dist/esm/dnd/dnd.js +7 -12
- package/dist/esm/dnd/droptarget.d.ts +20 -15
- package/dist/esm/dnd/droptarget.js +149 -67
- package/dist/esm/dnd/ghost.d.ts +1 -0
- package/dist/esm/dnd/ghost.js +10 -0
- package/dist/esm/dnd/groupDragHandler.d.ts +11 -0
- package/dist/esm/dnd/groupDragHandler.js +38 -0
- package/dist/esm/dockview/components/tab/defaultTab.js +6 -6
- package/dist/esm/dockview/components/watermark/watermark.js +3 -3
- package/dist/esm/dockview/defaultGroupPanelView.d.ts +1 -1
- package/dist/esm/dockview/defaultGroupPanelView.js +5 -5
- package/dist/esm/dockview/deserializer.d.ts +2 -1
- package/dist/esm/dockview/dockviewComponent.d.ts +15 -7
- package/dist/esm/dockview/dockviewComponent.js +229 -65
- package/dist/{cjs/dockview/dockviewGroupPanel.d.ts → esm/dockview/dockviewPanel.d.ts} +16 -5
- package/dist/esm/dockview/{dockviewGroupPanel.js → dockviewPanel.js} +19 -15
- package/dist/esm/dockview/options.d.ts +32 -10
- package/dist/esm/dockview/options.js +24 -1
- package/dist/esm/dockview/validation.d.ts +2 -0
- package/dist/esm/dockview/validation.js +86 -0
- package/dist/esm/gridview/baseComponentGridview.d.ts +1 -1
- package/dist/esm/gridview/baseComponentGridview.js +31 -32
- package/dist/esm/gridview/basePanelView.d.ts +2 -2
- package/dist/esm/gridview/basePanelView.js +13 -13
- package/dist/esm/gridview/branchNode.js +47 -47
- package/dist/esm/gridview/gridview.d.ts +9 -3
- package/dist/esm/gridview/gridview.js +41 -15
- package/dist/esm/gridview/gridviewComponent.d.ts +2 -2
- package/dist/esm/gridview/gridviewComponent.js +17 -18
- package/dist/esm/gridview/gridviewPanel.d.ts +3 -3
- package/dist/esm/gridview/gridviewPanel.js +45 -45
- package/dist/esm/gridview/leafNode.js +23 -23
- package/dist/esm/gridview/types.d.ts +1 -1
- package/dist/esm/groupview/dnd.d.ts +2 -1
- package/dist/esm/groupview/dnd.js +1 -0
- package/dist/esm/groupview/groupview.d.ts +6 -6
- package/dist/esm/groupview/groupview.js +90 -72
- package/dist/esm/groupview/groupviewPanel.d.ts +3 -3
- package/dist/esm/groupview/groupviewPanel.js +4 -4
- package/dist/esm/groupview/panel/content.d.ts +1 -1
- package/dist/esm/groupview/panel/content.js +3 -3
- package/dist/esm/groupview/tab.d.ts +2 -12
- package/dist/esm/groupview/tab.js +15 -11
- package/dist/esm/groupview/titlebar/tabsContainer.d.ts +5 -8
- package/dist/esm/groupview/titlebar/tabsContainer.js +54 -61
- package/dist/esm/groupview/titlebar/voidContainer.d.ts +15 -0
- package/dist/esm/groupview/titlebar/voidContainer.js +47 -0
- package/dist/esm/groupview/types.d.ts +18 -2
- package/dist/esm/hostedContainer.js +3 -3
- package/dist/esm/index.d.ts +3 -3
- package/dist/esm/index.js +2 -2
- package/dist/esm/lifecycle.js +3 -3
- package/dist/esm/paneview/defaultPaneviewHeader.js +3 -3
- package/dist/esm/paneview/draggablePaneviewPanel.js +7 -6
- package/dist/esm/paneview/paneview.js +21 -21
- package/dist/esm/paneview/paneviewComponent.js +30 -30
- package/dist/esm/paneview/paneviewPanel.js +45 -44
- package/dist/esm/react/deserializer.d.ts +2 -1
- package/dist/esm/react/deserializer.js +2 -2
- package/dist/esm/react/dockview/defaultTab.d.ts +1 -1
- package/dist/esm/react/dockview/dockview.d.ts +5 -4
- package/dist/esm/react/dockview/dockview.js +1 -0
- package/dist/esm/react/dockview/groupControlsRenderer.d.ts +1 -1
- package/dist/esm/react/dockview/groupControlsRenderer.js +8 -8
- package/dist/esm/react/dockview/reactContentPart.js +3 -3
- package/dist/esm/react/dockview/reactHeaderPart.js +3 -3
- package/dist/esm/react/dockview/reactWatermarkPart.js +3 -3
- package/dist/esm/react/dockview/v2/reactContentRenderer.js +9 -9
- package/dist/esm/react/dockview/v2/webviewContentRenderer.js +3 -3
- package/dist/esm/react/gridview/view.js +2 -1
- package/dist/esm/react/paneview/view.js +3 -3
- package/dist/esm/react/react.d.ts +1 -1
- package/dist/esm/splitview/core/splitview.d.ts +4 -4
- package/dist/esm/splitview/core/splitview.js +59 -59
- package/dist/esm/splitview/core/viewItem.js +15 -15
- package/dist/esm/splitview/splitviewComponent.d.ts +1 -1
- package/dist/esm/splitview/splitviewComponent.js +23 -23
- package/dist/esm/splitview/splitviewPanel.js +31 -30
- package/dist/esm/types.d.ts +2 -1
- package/dist/esm/types.js +3 -1
- package/dist/styles/dockview.css +23 -26
- package/package.json +12 -16
- package/dist/cjs/api/groupPanelApi.js.map +0 -1
- package/dist/cjs/dockview/dockviewGroupPanel.js.map +0 -1
- package/dist/cjs/groupview/groupPanel.d.ts +0 -32
- package/dist/cjs/groupview/groupPanel.js +0 -3
- package/dist/cjs/groupview/groupPanel.js.map +0 -1
- package/dist/esm/groupview/groupPanel.d.ts +0 -32
- package/dist/esm/groupview/groupPanel.js +0 -1
|
@@ -1,26 +1,64 @@
|
|
|
1
1
|
import { getRelativeLocation, getGridLocation, } from '../gridview/gridview';
|
|
2
|
-
import {
|
|
2
|
+
import { directionToPosition, Droptarget } from '../dnd/droptarget';
|
|
3
3
|
import { tail, sequenceEquals } from '../array';
|
|
4
|
-
import {
|
|
4
|
+
import { DockviewPanel } from './dockviewPanel';
|
|
5
5
|
import { CompositeDisposable } from '../lifecycle';
|
|
6
6
|
import { Event, Emitter } from '../events';
|
|
7
7
|
import { Watermark } from './components/watermark/watermark';
|
|
8
8
|
import { sequentialNumberGenerator } from '../math';
|
|
9
9
|
import { createComponent } from '../panel/componentFactory';
|
|
10
|
+
import { isGroupOptionsWithGroup, isGroupOptionsWithPanel, isPanelOptionsWithGroup, isPanelOptionsWithPanel, } from './options';
|
|
10
11
|
import { BaseGrid, toTarget, } from '../gridview/baseComponentGridview';
|
|
11
12
|
import { DockviewApi } from '../api/component.api';
|
|
12
|
-
import { Orientation } from '../splitview/core/splitview';
|
|
13
|
+
import { Orientation, Sizing } from '../splitview/core/splitview';
|
|
13
14
|
import { DefaultTab } from './components/tab/defaultTab';
|
|
14
15
|
import { GroupPanel } from '../groupview/groupviewPanel';
|
|
15
16
|
import { DefaultGroupPanelView } from './defaultGroupPanelView';
|
|
16
|
-
|
|
17
|
+
import { getPanelData } from '../dnd/dataTransfer';
|
|
18
|
+
import { DockviewDropTargets } from '../groupview/dnd';
|
|
17
19
|
export class DockviewComponent extends BaseGrid {
|
|
20
|
+
get orientation() {
|
|
21
|
+
return this.gridview.orientation;
|
|
22
|
+
}
|
|
23
|
+
get totalPanels() {
|
|
24
|
+
return this.panels.length;
|
|
25
|
+
}
|
|
26
|
+
get panels() {
|
|
27
|
+
return this.groups.flatMap((group) => group.panels);
|
|
28
|
+
}
|
|
29
|
+
get deserializer() {
|
|
30
|
+
return this._deserializer;
|
|
31
|
+
}
|
|
32
|
+
set deserializer(value) {
|
|
33
|
+
this._deserializer = value;
|
|
34
|
+
}
|
|
35
|
+
get options() {
|
|
36
|
+
return this._options;
|
|
37
|
+
}
|
|
38
|
+
get activePanel() {
|
|
39
|
+
const activeGroup = this.activeGroup;
|
|
40
|
+
if (!activeGroup) {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
return activeGroup.activePanel;
|
|
44
|
+
}
|
|
45
|
+
set tabHeight(height) {
|
|
46
|
+
this.options.tabHeight = height;
|
|
47
|
+
this._groups.forEach((value) => {
|
|
48
|
+
value.value.model.header.height = height;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
get tabHeight() {
|
|
52
|
+
return this.options.tabHeight;
|
|
53
|
+
}
|
|
18
54
|
constructor(element, options) {
|
|
19
55
|
super(element, {
|
|
20
56
|
proportionalLayout: true,
|
|
21
57
|
orientation: options.orientation || Orientation.HORIZONTAL,
|
|
22
58
|
styles: options.styles,
|
|
23
59
|
});
|
|
60
|
+
this.nextGroupId = sequentialNumberGenerator();
|
|
61
|
+
this.watermark = null;
|
|
24
62
|
this._onDidDrop = new Emitter();
|
|
25
63
|
this.onDidDrop = this._onDidDrop.event;
|
|
26
64
|
this._onDidRemovePanel = new Emitter();
|
|
@@ -31,7 +69,10 @@ export class DockviewComponent extends BaseGrid {
|
|
|
31
69
|
this.onDidLayoutFromJSON = this._onDidLayoutFromJSON.event;
|
|
32
70
|
this._onDidActivePanelChange = new Emitter();
|
|
33
71
|
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
34
|
-
this.
|
|
72
|
+
this.element.classList.add('dv-dockview');
|
|
73
|
+
this.addDisposables(this._onDidDrop, Event.any(this.onDidAddGroup, this.onDidRemoveGroup)(() => {
|
|
74
|
+
this.updateWatermark();
|
|
75
|
+
}), Event.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidActivePanelChange)(() => {
|
|
35
76
|
this._bufferOnDidLayoutChange.fire();
|
|
36
77
|
}));
|
|
37
78
|
this._options = options;
|
|
@@ -51,38 +92,74 @@ export class DockviewComponent extends BaseGrid {
|
|
|
51
92
|
!this.options.watermarkFrameworkComponent) {
|
|
52
93
|
this.options.watermarkComponent = Watermark;
|
|
53
94
|
}
|
|
95
|
+
const dropTarget = new Droptarget(this.element, {
|
|
96
|
+
canDisplayOverlay: (event, position) => {
|
|
97
|
+
const data = getPanelData();
|
|
98
|
+
if (data) {
|
|
99
|
+
if (data.viewId !== this.id) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
if (this.options.showDndOverlay) {
|
|
105
|
+
return this.options.showDndOverlay({
|
|
106
|
+
nativeEvent: event,
|
|
107
|
+
position: position,
|
|
108
|
+
target: DockviewDropTargets.Edge,
|
|
109
|
+
getData: getPanelData,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
return false;
|
|
113
|
+
},
|
|
114
|
+
acceptedTargetZones: ['top', 'bottom', 'left', 'right'],
|
|
115
|
+
overlayModel: {
|
|
116
|
+
activationSize: { type: 'pixels', value: 10 },
|
|
117
|
+
size: { type: 'pixels', value: 20 },
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
this.addDisposables(dropTarget, dropTarget.onDrop((event) => {
|
|
121
|
+
const data = getPanelData();
|
|
122
|
+
if (data) {
|
|
123
|
+
this.moveGroupOrPanel(this.orthogonalize(event.position), data.groupId, data.panelId || undefined, 'center');
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { api: this._api, group: null, getData: getPanelData }));
|
|
127
|
+
}
|
|
128
|
+
}));
|
|
54
129
|
this._api = new DockviewApi(this);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
130
|
+
this.updateWatermark();
|
|
131
|
+
}
|
|
132
|
+
orthogonalize(position) {
|
|
133
|
+
switch (position) {
|
|
134
|
+
case 'top':
|
|
135
|
+
case 'bottom':
|
|
136
|
+
if (this.gridview.orientation === Orientation.HORIZONTAL) {
|
|
137
|
+
// we need to add to a vertical splitview but the current root is a horizontal splitview.
|
|
138
|
+
// insert a vertical splitview at the root level and add the existing view as a child
|
|
139
|
+
this.gridview.insertOrthogonalSplitviewAtRoot();
|
|
140
|
+
}
|
|
141
|
+
break;
|
|
142
|
+
case 'left':
|
|
143
|
+
case 'right':
|
|
144
|
+
if (this.gridview.orientation === Orientation.VERTICAL) {
|
|
145
|
+
// we need to add to a horizontal splitview but the current root is a vertical splitview.
|
|
146
|
+
// insert a horiziontal splitview at the root level and add the existing view as a child
|
|
147
|
+
this.gridview.insertOrthogonalSplitviewAtRoot();
|
|
148
|
+
}
|
|
149
|
+
break;
|
|
150
|
+
default:
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
switch (position) {
|
|
154
|
+
case 'top':
|
|
155
|
+
case 'left':
|
|
156
|
+
return this.createGroupAtLocation([0]); // insert into first position
|
|
157
|
+
case 'bottom':
|
|
158
|
+
case 'right':
|
|
159
|
+
return this.createGroupAtLocation([this.gridview.length]); // insert into last position
|
|
160
|
+
default:
|
|
161
|
+
throw new Error(`unsupported position ${position}`);
|
|
75
162
|
}
|
|
76
|
-
return activeGroup.activePanel;
|
|
77
|
-
}
|
|
78
|
-
set tabHeight(height) {
|
|
79
|
-
this.options.tabHeight = height;
|
|
80
|
-
this._groups.forEach((value) => {
|
|
81
|
-
value.value.model.header.height = height;
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
get tabHeight() {
|
|
85
|
-
return this.options.tabHeight;
|
|
86
163
|
}
|
|
87
164
|
updateOptions(options) {
|
|
88
165
|
const hasOrientationChanged = typeof options.orientation === 'string' &&
|
|
@@ -132,8 +209,7 @@ export class DockviewComponent extends BaseGrid {
|
|
|
132
209
|
options.group = this.activeGroup;
|
|
133
210
|
}
|
|
134
211
|
if (options.includePanel && options.group) {
|
|
135
|
-
if (options.group.activePanel !==
|
|
136
|
-
options.group.panels[0]) {
|
|
212
|
+
if (options.group.activePanel !== options.group.panels[0]) {
|
|
137
213
|
options.group.model.moveToPrevious({ suppressRoll: true });
|
|
138
214
|
return;
|
|
139
215
|
}
|
|
@@ -166,14 +242,14 @@ export class DockviewComponent extends BaseGrid {
|
|
|
166
242
|
fromJSON(data) {
|
|
167
243
|
this.clear();
|
|
168
244
|
if (!this.deserializer) {
|
|
169
|
-
throw new Error('
|
|
245
|
+
throw new Error('no deserializer provided');
|
|
170
246
|
}
|
|
171
247
|
const { grid, panels, options, activeGroup } = data;
|
|
172
248
|
if (typeof (options === null || options === void 0 ? void 0 : options.tabHeight) === 'number') {
|
|
173
249
|
this.tabHeight = options.tabHeight;
|
|
174
250
|
}
|
|
175
|
-
if (!
|
|
176
|
-
throw new Error('
|
|
251
|
+
if (grid.root.type !== 'branch' || !Array.isArray(grid.root.data)) {
|
|
252
|
+
throw new Error('root must be of type branch');
|
|
177
253
|
}
|
|
178
254
|
this.gridview.deserialize(grid, {
|
|
179
255
|
fromJSON: (node) => {
|
|
@@ -186,19 +262,20 @@ export class DockviewComponent extends BaseGrid {
|
|
|
186
262
|
this._onDidAddGroup.fire(group);
|
|
187
263
|
for (const child of views) {
|
|
188
264
|
const panel = this.deserializer.fromJSON(panels[child], group);
|
|
189
|
-
const isActive = typeof activeView === 'string' &&
|
|
265
|
+
const isActive = typeof activeView === 'string' &&
|
|
266
|
+
activeView === panel.id;
|
|
190
267
|
group.model.openPanel(panel, {
|
|
191
268
|
skipSetPanelActive: !isActive,
|
|
192
|
-
skipSetGroupActive: true
|
|
269
|
+
skipSetGroupActive: true,
|
|
193
270
|
});
|
|
194
271
|
}
|
|
195
272
|
if (!group.activePanel && group.panels.length > 0) {
|
|
196
273
|
group.model.openPanel(group.panels[group.panels.length - 1], {
|
|
197
|
-
skipSetGroupActive: true
|
|
274
|
+
skipSetGroupActive: true,
|
|
198
275
|
});
|
|
199
276
|
}
|
|
200
277
|
return group;
|
|
201
|
-
}
|
|
278
|
+
},
|
|
202
279
|
});
|
|
203
280
|
if (typeof activeGroup === 'string') {
|
|
204
281
|
const panel = this.getPanel(activeGroup);
|
|
@@ -237,12 +314,31 @@ export class DockviewComponent extends BaseGrid {
|
|
|
237
314
|
throw new Error(`panel with id ${options.id} already exists`);
|
|
238
315
|
}
|
|
239
316
|
let referenceGroup;
|
|
240
|
-
if (
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
317
|
+
if (options.position) {
|
|
318
|
+
if (isPanelOptionsWithPanel(options.position)) {
|
|
319
|
+
const referencePanel = typeof options.position.referencePanel === 'string'
|
|
320
|
+
? this.getGroupPanel(options.position.referencePanel)
|
|
321
|
+
: options.position.referencePanel;
|
|
322
|
+
if (!referencePanel) {
|
|
323
|
+
throw new Error(`referencePanel ${options.position.referencePanel} does not exist`);
|
|
324
|
+
}
|
|
325
|
+
referenceGroup = this.findGroup(referencePanel);
|
|
326
|
+
}
|
|
327
|
+
else if (isPanelOptionsWithGroup(options.position)) {
|
|
328
|
+
referenceGroup =
|
|
329
|
+
typeof options.position.referenceGroup === 'string'
|
|
330
|
+
? (_a = this._groups.get(options.position.referenceGroup)) === null || _a === void 0 ? void 0 : _a.value
|
|
331
|
+
: options.position.referenceGroup;
|
|
332
|
+
if (!referenceGroup) {
|
|
333
|
+
throw new Error(`referencePanel ${options.position.referenceGroup} does not exist`);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
else {
|
|
337
|
+
const group = this.orthogonalize(directionToPosition(options.position.direction));
|
|
338
|
+
const panel = this.createPanel(options, group);
|
|
339
|
+
group.model.openPanel(panel);
|
|
340
|
+
return panel;
|
|
244
341
|
}
|
|
245
|
-
referenceGroup = this.findGroup(referencePanel);
|
|
246
342
|
}
|
|
247
343
|
else {
|
|
248
344
|
referenceGroup = this.activeGroup;
|
|
@@ -250,7 +346,7 @@ export class DockviewComponent extends BaseGrid {
|
|
|
250
346
|
let panel;
|
|
251
347
|
if (referenceGroup) {
|
|
252
348
|
const target = toTarget(((_b = options.position) === null || _b === void 0 ? void 0 : _b.direction) || 'within');
|
|
253
|
-
if (target ===
|
|
349
|
+
if (target === 'center') {
|
|
254
350
|
panel = this.createPanel(options, referenceGroup);
|
|
255
351
|
referenceGroup.model.openPanel(panel);
|
|
256
352
|
}
|
|
@@ -279,10 +375,7 @@ export class DockviewComponent extends BaseGrid {
|
|
|
279
375
|
}
|
|
280
376
|
group.model.removePanel(panel);
|
|
281
377
|
panel.dispose();
|
|
282
|
-
|
|
283
|
-
if (!retainGroupForWatermark &&
|
|
284
|
-
group.size === 0 &&
|
|
285
|
-
options.removeEmptyGroup) {
|
|
378
|
+
if (group.size === 0 && options.removeEmptyGroup) {
|
|
286
379
|
this.removeGroup(group);
|
|
287
380
|
}
|
|
288
381
|
}
|
|
@@ -294,24 +387,67 @@ export class DockviewComponent extends BaseGrid {
|
|
|
294
387
|
? { 'watermark-name': this.options.watermarkFrameworkComponent }
|
|
295
388
|
: {}, (_a = this.options.frameworkComponentFactory) === null || _a === void 0 ? void 0 : _a.watermark);
|
|
296
389
|
}
|
|
297
|
-
|
|
390
|
+
updateWatermark() {
|
|
391
|
+
if (this.groups.length === 0) {
|
|
392
|
+
if (!this.watermark) {
|
|
393
|
+
this.watermark = this.createWatermarkComponent();
|
|
394
|
+
this.watermark.init({
|
|
395
|
+
containerApi: new DockviewApi(this),
|
|
396
|
+
params: {},
|
|
397
|
+
title: '',
|
|
398
|
+
api: null,
|
|
399
|
+
});
|
|
400
|
+
const watermarkContainer = document.createElement('div');
|
|
401
|
+
watermarkContainer.className = 'dv-watermark-container';
|
|
402
|
+
watermarkContainer.appendChild(this.watermark.element);
|
|
403
|
+
this.element.appendChild(watermarkContainer);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
else if (this.watermark) {
|
|
407
|
+
this.watermark.element.parentElement.remove();
|
|
408
|
+
this.watermark.dispose();
|
|
409
|
+
this.watermark = null;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
addGroup(options) {
|
|
413
|
+
var _a;
|
|
298
414
|
const group = this.createGroup();
|
|
299
415
|
if (options) {
|
|
300
|
-
|
|
301
|
-
if (
|
|
302
|
-
|
|
416
|
+
let referenceGroup;
|
|
417
|
+
if (isGroupOptionsWithPanel(options)) {
|
|
418
|
+
const referencePanel = typeof options.referencePanel === 'string'
|
|
419
|
+
? this.panels.find((panel) => panel.id === options.referencePanel)
|
|
420
|
+
: options.referencePanel;
|
|
421
|
+
if (!referencePanel) {
|
|
422
|
+
throw new Error(`reference panel ${options.referencePanel} does not exist`);
|
|
423
|
+
}
|
|
424
|
+
referenceGroup = this.findGroup(referencePanel);
|
|
425
|
+
if (!referenceGroup) {
|
|
426
|
+
throw new Error(`reference group for reference panel ${options.referencePanel} does not exist`);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
else if (isGroupOptionsWithGroup(options)) {
|
|
430
|
+
referenceGroup =
|
|
431
|
+
typeof options.referenceGroup === 'string'
|
|
432
|
+
? (_a = this._groups.get(options.referenceGroup)) === null || _a === void 0 ? void 0 : _a.value
|
|
433
|
+
: options.referenceGroup;
|
|
434
|
+
if (!referenceGroup) {
|
|
435
|
+
throw new Error(`reference group ${options.referenceGroup} does not exist`);
|
|
436
|
+
}
|
|
303
437
|
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
438
|
+
else {
|
|
439
|
+
const group = this.orthogonalize(directionToPosition(options.direction));
|
|
440
|
+
return group;
|
|
307
441
|
}
|
|
308
442
|
const target = toTarget(options.direction || 'within');
|
|
309
443
|
const location = getGridLocation(referenceGroup.element);
|
|
310
444
|
const relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
|
|
311
445
|
this.doAddGroup(group, relativeLocation);
|
|
446
|
+
return group;
|
|
312
447
|
}
|
|
313
448
|
else {
|
|
314
449
|
this.doAddGroup(group);
|
|
450
|
+
return group;
|
|
315
451
|
}
|
|
316
452
|
}
|
|
317
453
|
removeGroup(group, skipActive = false) {
|
|
@@ -329,7 +465,13 @@ export class DockviewComponent extends BaseGrid {
|
|
|
329
465
|
const sourceGroup = groupId
|
|
330
466
|
? (_a = this._groups.get(groupId)) === null || _a === void 0 ? void 0 : _a.value
|
|
331
467
|
: undefined;
|
|
332
|
-
if (
|
|
468
|
+
if (itemId === undefined) {
|
|
469
|
+
if (sourceGroup) {
|
|
470
|
+
this.moveGroup(sourceGroup, referenceGroup, target);
|
|
471
|
+
}
|
|
472
|
+
return;
|
|
473
|
+
}
|
|
474
|
+
if (!target || target === 'center') {
|
|
333
475
|
const groupItem = (sourceGroup === null || sourceGroup === void 0 ? void 0 : sourceGroup.model.removePanel(itemId)) ||
|
|
334
476
|
this.panels.find((panel) => panel.id === itemId);
|
|
335
477
|
if (!groupItem) {
|
|
@@ -377,6 +519,28 @@ export class DockviewComponent extends BaseGrid {
|
|
|
377
519
|
}
|
|
378
520
|
}
|
|
379
521
|
}
|
|
522
|
+
moveGroup(sourceGroup, referenceGroup, target) {
|
|
523
|
+
if (sourceGroup) {
|
|
524
|
+
if (!target || target === 'center') {
|
|
525
|
+
const activePanel = sourceGroup.activePanel;
|
|
526
|
+
const panels = [...sourceGroup.panels].map((p) => sourceGroup.model.removePanel(p.id));
|
|
527
|
+
if ((sourceGroup === null || sourceGroup === void 0 ? void 0 : sourceGroup.model.size) === 0) {
|
|
528
|
+
this.doRemoveGroup(sourceGroup);
|
|
529
|
+
}
|
|
530
|
+
for (const panel of panels) {
|
|
531
|
+
referenceGroup.model.openPanel(panel, {
|
|
532
|
+
skipSetPanelActive: panel !== activePanel,
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
else {
|
|
537
|
+
this.gridview.removeView(getGridLocation(sourceGroup.element));
|
|
538
|
+
const referenceLocation = getGridLocation(referenceGroup.element);
|
|
539
|
+
const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, target);
|
|
540
|
+
this.gridview.addView(sourceGroup, Sizing.Distribute, dropLocation);
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
}
|
|
380
544
|
doSetGroupActive(group, skipFocus) {
|
|
381
545
|
var _a, _b;
|
|
382
546
|
const isGroupAlreadyFocused = this._activeGroup === group;
|
|
@@ -398,9 +562,9 @@ export class DockviewComponent extends BaseGrid {
|
|
|
398
562
|
id = undefined;
|
|
399
563
|
}
|
|
400
564
|
if (!id) {
|
|
401
|
-
id = nextGroupId.next();
|
|
565
|
+
id = this.nextGroupId.next();
|
|
402
566
|
while (this._groups.has(id)) {
|
|
403
|
-
id = nextGroupId.next();
|
|
567
|
+
id = this.nextGroupId.next();
|
|
404
568
|
}
|
|
405
569
|
}
|
|
406
570
|
const view = new GroupPanel(this, id, options);
|
|
@@ -433,7 +597,7 @@ export class DockviewComponent extends BaseGrid {
|
|
|
433
597
|
content: this.createContentComponent(options.id, options.component),
|
|
434
598
|
tab: this.createTabComponent(options.id, options.tabComponent || this.options.defaultTabComponent),
|
|
435
599
|
});
|
|
436
|
-
const panel = new
|
|
600
|
+
const panel = new DockviewPanel(options.id, this, this._api, group);
|
|
437
601
|
panel.init({
|
|
438
602
|
view,
|
|
439
603
|
title: options.title || options.id,
|
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
import { DockviewApi } from '../api/component.api';
|
|
2
|
-
import { DockviewPanelApiImpl } from '../api/
|
|
3
|
-
import { GroupPanelUpdateEvent, GroupviewPanelState,
|
|
2
|
+
import { DockviewPanelApi, DockviewPanelApiImpl } from '../api/dockviewPanelApi';
|
|
3
|
+
import { GroupPanelUpdateEvent, GroupviewPanelState, IGroupPanelInitParameters } from '../groupview/types';
|
|
4
4
|
import { GroupPanel } from '../groupview/groupviewPanel';
|
|
5
|
-
import { CompositeDisposable } from '../lifecycle';
|
|
6
|
-
import { Parameters } from '../panel/types';
|
|
5
|
+
import { CompositeDisposable, IDisposable } from '../lifecycle';
|
|
6
|
+
import { IPanel, Parameters } from '../panel/types';
|
|
7
7
|
import { IGroupPanelView } from './defaultGroupPanelView';
|
|
8
8
|
import { DockviewComponent } from './dockviewComponent';
|
|
9
|
-
export
|
|
9
|
+
export interface IDockviewPanel extends IDisposable, IPanel {
|
|
10
|
+
readonly view?: IGroupPanelView;
|
|
11
|
+
readonly group: GroupPanel;
|
|
12
|
+
readonly api: DockviewPanelApi;
|
|
13
|
+
readonly title: string;
|
|
14
|
+
readonly params: Record<string, any> | undefined;
|
|
15
|
+
updateParentGroup(group: GroupPanel, isGroupActive: boolean): void;
|
|
16
|
+
init(params: IGroupPanelInitParameters): void;
|
|
17
|
+
toJSON(): GroupviewPanelState;
|
|
18
|
+
update(event: GroupPanelUpdateEvent): void;
|
|
19
|
+
}
|
|
20
|
+
export declare class DockviewPanel extends CompositeDisposable implements IDockviewPanel {
|
|
10
21
|
readonly id: string;
|
|
11
22
|
private readonly containerApi;
|
|
12
23
|
private readonly mutableDisposable;
|
|
@@ -1,18 +1,6 @@
|
|
|
1
|
-
import { DockviewPanelApiImpl } from '../api/
|
|
2
|
-
import { CompositeDisposable, MutableDisposable } from '../lifecycle';
|
|
3
|
-
export class
|
|
4
|
-
constructor(id, accessor, containerApi, group) {
|
|
5
|
-
super();
|
|
6
|
-
this.id = id;
|
|
7
|
-
this.containerApi = containerApi;
|
|
8
|
-
this.mutableDisposable = new MutableDisposable();
|
|
9
|
-
this._title = '';
|
|
10
|
-
this._group = group;
|
|
11
|
-
this.api = new DockviewPanelApiImpl(this, this._group);
|
|
12
|
-
this.addDisposables(this.api.onActiveChange(() => {
|
|
13
|
-
accessor.setActivePanel(this);
|
|
14
|
-
}));
|
|
15
|
-
}
|
|
1
|
+
import { DockviewPanelApiImpl, } from '../api/dockviewPanelApi';
|
|
2
|
+
import { CompositeDisposable, MutableDisposable, } from '../lifecycle';
|
|
3
|
+
export class DockviewPanel extends CompositeDisposable {
|
|
16
4
|
get params() {
|
|
17
5
|
return this._params;
|
|
18
6
|
}
|
|
@@ -25,6 +13,22 @@ export class DockviewGroupPanel extends CompositeDisposable {
|
|
|
25
13
|
get view() {
|
|
26
14
|
return this._view;
|
|
27
15
|
}
|
|
16
|
+
constructor(id, accessor, containerApi, group) {
|
|
17
|
+
super();
|
|
18
|
+
this.id = id;
|
|
19
|
+
this.containerApi = containerApi;
|
|
20
|
+
this.mutableDisposable = new MutableDisposable();
|
|
21
|
+
this._title = '';
|
|
22
|
+
this._group = group;
|
|
23
|
+
this.api = new DockviewPanelApiImpl(this, this._group);
|
|
24
|
+
this.addDisposables(this.api.onActiveChange(() => {
|
|
25
|
+
accessor.setActivePanel(this);
|
|
26
|
+
}), this.api.onDidSizeChange((event) => {
|
|
27
|
+
// forward the resize event to the group since if you want to resize a panel
|
|
28
|
+
// you are actually just resizing the panels parent which is the group
|
|
29
|
+
this.group.api.setSize(event);
|
|
30
|
+
}));
|
|
31
|
+
}
|
|
28
32
|
init(params) {
|
|
29
33
|
var _a;
|
|
30
34
|
this._params = params.params;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { DockviewApi } from '../api/component.api';
|
|
2
2
|
import { Direction } from '../gridview/baseComponentGridview';
|
|
3
3
|
import { IGridView } from '../gridview/gridview';
|
|
4
|
-
import { IDockviewPanel } from '../groupview/groupPanel';
|
|
5
4
|
import { IContentRenderer, ITabRenderer, WatermarkConstructor, IWatermarkRenderer } from '../groupview/types';
|
|
6
5
|
import { GroupPanel } from '../groupview/groupviewPanel';
|
|
7
6
|
import { ISplitviewStyles, Orientation } from '../splitview/core/splitview';
|
|
@@ -9,6 +8,8 @@ import { FrameworkFactory } from '../types';
|
|
|
9
8
|
import { DockviewDropTargets } from '../groupview/dnd';
|
|
10
9
|
import { PanelTransfer } from '../dnd/dataTransfer';
|
|
11
10
|
import { IGroupControlRenderer } from '../react/dockview/groupControlsRenderer';
|
|
11
|
+
import { Position } from '../dnd/droptarget';
|
|
12
|
+
import { IDockviewPanel } from './dockviewPanel';
|
|
12
13
|
export interface GroupPanelFrameworkComponentFactory {
|
|
13
14
|
content: FrameworkFactory<IContentRenderer>;
|
|
14
15
|
tab: FrameworkFactory<ITabRenderer>;
|
|
@@ -44,7 +45,8 @@ export interface ViewFactoryData {
|
|
|
44
45
|
export interface DockviewDndOverlayEvent {
|
|
45
46
|
nativeEvent: DragEvent;
|
|
46
47
|
target: DockviewDropTargets;
|
|
47
|
-
|
|
48
|
+
position: Position;
|
|
49
|
+
group?: GroupPanel;
|
|
48
50
|
getData: () => PanelTransfer | undefined;
|
|
49
51
|
}
|
|
50
52
|
export interface DockviewComponentOptions extends DockviewRenderFunctions {
|
|
@@ -57,6 +59,7 @@ export interface DockviewComponentOptions extends DockviewRenderFunctions {
|
|
|
57
59
|
defaultTabComponent?: string;
|
|
58
60
|
showDndOverlay?: (event: DockviewDndOverlayEvent) => boolean;
|
|
59
61
|
createGroupControlElement?: (group: GroupPanel) => IGroupControlRenderer;
|
|
62
|
+
singleTabMode?: 'fullwidth' | 'default';
|
|
60
63
|
}
|
|
61
64
|
export interface PanelOptions {
|
|
62
65
|
component: string;
|
|
@@ -67,18 +70,36 @@ export interface PanelOptions {
|
|
|
67
70
|
id: string;
|
|
68
71
|
title?: string;
|
|
69
72
|
}
|
|
73
|
+
type RelativePanel = {
|
|
74
|
+
direction?: Direction;
|
|
75
|
+
referencePanel: string | IDockviewPanel;
|
|
76
|
+
};
|
|
77
|
+
type RelativeGroup = {
|
|
78
|
+
direction?: Direction;
|
|
79
|
+
referenceGroup: string | GroupPanel;
|
|
80
|
+
};
|
|
81
|
+
type AbsolutePosition = {
|
|
82
|
+
direction: Omit<Direction, 'within'>;
|
|
83
|
+
};
|
|
84
|
+
export type AddPanelPositionOptions = RelativePanel | RelativeGroup | AbsolutePosition;
|
|
85
|
+
export declare function isPanelOptionsWithPanel(data: AddPanelPositionOptions): data is RelativePanel;
|
|
86
|
+
export declare function isPanelOptionsWithGroup(data: AddPanelPositionOptions): data is RelativeGroup;
|
|
70
87
|
export interface AddPanelOptions extends Omit<PanelOptions, 'component' | 'tabComponent'> {
|
|
71
88
|
component: string;
|
|
72
89
|
tabComponent?: string;
|
|
73
|
-
position?:
|
|
74
|
-
direction?: Direction;
|
|
75
|
-
referencePanel?: string;
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
export interface AddGroupOptions {
|
|
79
|
-
direction?: 'left' | 'right' | 'above' | 'below';
|
|
80
|
-
referencePanel: string;
|
|
90
|
+
position?: AddPanelPositionOptions;
|
|
81
91
|
}
|
|
92
|
+
type AddGroupOptionsWithPanel = {
|
|
93
|
+
referencePanel: string | IDockviewPanel;
|
|
94
|
+
direction?: Omit<Direction, 'within'>;
|
|
95
|
+
};
|
|
96
|
+
type AddGroupOptionsWithGroup = {
|
|
97
|
+
referenceGroup: string | GroupPanel;
|
|
98
|
+
direction?: Omit<Direction, 'within'>;
|
|
99
|
+
};
|
|
100
|
+
export type AddGroupOptions = AddGroupOptionsWithGroup | AddGroupOptionsWithPanel | AbsolutePosition;
|
|
101
|
+
export declare function isGroupOptionsWithPanel(data: AddGroupOptions): data is AddGroupOptionsWithPanel;
|
|
102
|
+
export declare function isGroupOptionsWithGroup(data: AddGroupOptions): data is AddGroupOptionsWithGroup;
|
|
82
103
|
export interface MovementOptions2 {
|
|
83
104
|
group?: IGridView;
|
|
84
105
|
}
|
|
@@ -86,3 +107,4 @@ export interface MovementOptions extends MovementOptions2 {
|
|
|
86
107
|
includePanel?: boolean;
|
|
87
108
|
group?: GroupPanel;
|
|
88
109
|
}
|
|
110
|
+
export {};
|
|
@@ -1 +1,24 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export function isPanelOptionsWithPanel(data) {
|
|
2
|
+
if (data.referencePanel) {
|
|
3
|
+
return true;
|
|
4
|
+
}
|
|
5
|
+
return false;
|
|
6
|
+
}
|
|
7
|
+
export function isPanelOptionsWithGroup(data) {
|
|
8
|
+
if (data.referenceGroup) {
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
export function isGroupOptionsWithPanel(data) {
|
|
14
|
+
if (data.referencePanel) {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
export function isGroupOptionsWithGroup(data) {
|
|
20
|
+
if (data.referenceGroup) {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
return false;
|
|
24
|
+
}
|