dockview-core 1.8.2 → 1.8.4
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 +8 -4
- package/dist/cjs/api/component.api.d.ts.map +1 -1
- package/dist/cjs/api/component.api.js +14 -0
- package/dist/cjs/api/component.api.js.map +1 -1
- package/dist/cjs/dnd/abstractDragHandler.d.ts +2 -2
- package/dist/cjs/dnd/abstractDragHandler.d.ts.map +1 -1
- package/dist/cjs/dnd/abstractDragHandler.js +16 -12
- package/dist/cjs/dnd/abstractDragHandler.js.map +1 -1
- package/dist/cjs/dnd/groupDragHandler.d.ts +4 -3
- package/dist/cjs/dnd/groupDragHandler.d.ts.map +1 -1
- package/dist/cjs/dnd/groupDragHandler.js +5 -4
- package/dist/cjs/dnd/groupDragHandler.js.map +1 -1
- package/dist/cjs/dnd/overlay.d.ts +6 -2
- package/dist/cjs/dnd/overlay.d.ts.map +1 -1
- package/dist/cjs/dnd/overlay.js +54 -23
- package/dist/cjs/dnd/overlay.js.map +1 -1
- package/dist/cjs/dockview/components/tab/tab.d.ts +7 -4
- package/dist/cjs/dockview/components/tab/tab.d.ts.map +1 -1
- package/dist/cjs/dockview/components/tab/tab.js +36 -28
- package/dist/cjs/dockview/components/tab/tab.js.map +1 -1
- package/dist/cjs/dockview/components/titlebar/tabsContainer.d.ts +19 -1
- package/dist/cjs/dockview/components/titlebar/tabsContainer.d.ts.map +1 -1
- package/dist/cjs/dockview/components/titlebar/tabsContainer.js +42 -15
- package/dist/cjs/dockview/components/titlebar/tabsContainer.js.map +1 -1
- package/dist/cjs/dockview/components/titlebar/voidContainer.d.ts +2 -0
- package/dist/cjs/dockview/components/titlebar/voidContainer.d.ts.map +1 -1
- package/dist/cjs/dockview/components/titlebar/voidContainer.js +7 -3
- package/dist/cjs/dockview/components/titlebar/voidContainer.js.map +1 -1
- package/dist/cjs/dockview/dockviewComponent.d.ts +11 -4
- package/dist/cjs/dockview/dockviewComponent.d.ts.map +1 -1
- package/dist/cjs/dockview/dockviewComponent.js +288 -92
- package/dist/cjs/dockview/dockviewComponent.js.map +1 -1
- package/dist/cjs/dockview/dockviewGroupPanel.d.ts +4 -4
- package/dist/cjs/dockview/dockviewGroupPanel.d.ts.map +1 -1
- package/dist/cjs/dockview/dockviewGroupPanel.js.map +1 -1
- package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +11 -4
- package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts.map +1 -1
- package/dist/cjs/dockview/dockviewGroupPanelModel.js +28 -6
- package/dist/cjs/dockview/dockviewGroupPanelModel.js.map +1 -1
- package/dist/cjs/dockview/dockviewPanel.d.ts +1 -1
- package/dist/cjs/dockview/dockviewPanel.d.ts.map +1 -1
- package/dist/cjs/dockview/options.d.ts +9 -5
- package/dist/cjs/dockview/options.d.ts.map +1 -1
- package/dist/cjs/dockview/options.js.map +1 -1
- package/dist/cjs/gridview/baseComponentGridview.d.ts +1 -1
- package/dist/cjs/gridview/baseComponentGridview.d.ts.map +1 -1
- package/dist/cjs/gridview/baseComponentGridview.js.map +1 -1
- package/dist/cjs/gridview/basePanelView.d.ts +4 -4
- package/dist/cjs/gridview/basePanelView.d.ts.map +1 -1
- package/dist/cjs/gridview/basePanelView.js.map +1 -1
- package/dist/cjs/gridview/branchNode.d.ts.map +1 -1
- package/dist/cjs/gridview/branchNode.js +1 -0
- package/dist/cjs/gridview/branchNode.js.map +1 -1
- package/dist/cjs/gridview/gridview.d.ts.map +1 -1
- package/dist/cjs/gridview/gridview.js +8 -0
- package/dist/cjs/gridview/gridview.js.map +1 -1
- package/dist/cjs/gridview/gridviewComponent.d.ts +4 -4
- package/dist/cjs/gridview/gridviewComponent.d.ts.map +1 -1
- package/dist/cjs/gridview/gridviewComponent.js +71 -39
- package/dist/cjs/gridview/gridviewComponent.js.map +1 -1
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/lifecycle.d.ts +0 -1
- package/dist/cjs/lifecycle.d.ts.map +1 -1
- package/dist/cjs/lifecycle.js +0 -32
- package/dist/cjs/lifecycle.js.map +1 -1
- package/dist/cjs/panel/types.d.ts +2 -2
- package/dist/cjs/panel/types.d.ts.map +1 -1
- package/dist/cjs/paneview/paneviewComponent.d.ts +5 -6
- package/dist/cjs/paneview/paneviewComponent.d.ts.map +1 -1
- package/dist/cjs/paneview/paneviewComponent.js.map +1 -1
- package/dist/cjs/resizable.d.ts.map +1 -1
- package/dist/cjs/resizable.js +8 -0
- package/dist/cjs/resizable.js.map +1 -1
- package/dist/cjs/splitview/splitview.d.ts.map +1 -1
- package/dist/cjs/splitview/splitview.js +11 -1
- package/dist/cjs/splitview/splitview.js.map +1 -1
- package/dist/cjs/splitview/splitviewComponent.d.ts +4 -4
- package/dist/cjs/splitview/splitviewComponent.d.ts.map +1 -1
- package/dist/cjs/splitview/splitviewComponent.js.map +1 -1
- package/dist/cjs/splitview/splitviewPanel.d.ts +1 -1
- package/dist/dockview-core.amd.js +411 -186
- 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 +411 -186
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +411 -186
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +411 -186
- 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 +411 -186
- 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 +411 -186
- package/dist/dockview-core.noStyle.js.map +1 -1
- package/dist/esm/api/component.api.d.ts +8 -4
- package/dist/esm/api/component.api.d.ts.map +1 -1
- package/dist/esm/api/component.api.js +6 -0
- package/dist/esm/api/component.api.js.map +1 -1
- package/dist/esm/dnd/abstractDragHandler.d.ts +2 -2
- package/dist/esm/dnd/abstractDragHandler.d.ts.map +1 -1
- package/dist/esm/dnd/abstractDragHandler.js +16 -12
- package/dist/esm/dnd/abstractDragHandler.js.map +1 -1
- package/dist/esm/dnd/groupDragHandler.d.ts +4 -3
- package/dist/esm/dnd/groupDragHandler.d.ts.map +1 -1
- package/dist/esm/dnd/groupDragHandler.js +5 -4
- package/dist/esm/dnd/groupDragHandler.js.map +1 -1
- package/dist/esm/dnd/overlay.d.ts +6 -2
- package/dist/esm/dnd/overlay.d.ts.map +1 -1
- package/dist/esm/dnd/overlay.js +46 -23
- package/dist/esm/dnd/overlay.js.map +1 -1
- package/dist/esm/dockview/components/tab/tab.d.ts +7 -4
- package/dist/esm/dockview/components/tab/tab.d.ts.map +1 -1
- package/dist/esm/dockview/components/tab/tab.js +32 -24
- package/dist/esm/dockview/components/tab/tab.js.map +1 -1
- package/dist/esm/dockview/components/titlebar/tabsContainer.d.ts +19 -1
- package/dist/esm/dockview/components/titlebar/tabsContainer.d.ts.map +1 -1
- package/dist/esm/dockview/components/titlebar/tabsContainer.js +42 -15
- package/dist/esm/dockview/components/titlebar/tabsContainer.js.map +1 -1
- package/dist/esm/dockview/components/titlebar/voidContainer.d.ts +2 -0
- package/dist/esm/dockview/components/titlebar/voidContainer.d.ts.map +1 -1
- package/dist/esm/dockview/components/titlebar/voidContainer.js +7 -3
- package/dist/esm/dockview/components/titlebar/voidContainer.js.map +1 -1
- package/dist/esm/dockview/dockviewComponent.d.ts +11 -4
- package/dist/esm/dockview/dockviewComponent.d.ts.map +1 -1
- package/dist/esm/dockview/dockviewComponent.js +204 -59
- package/dist/esm/dockview/dockviewComponent.js.map +1 -1
- package/dist/esm/dockview/dockviewGroupPanel.d.ts +4 -4
- package/dist/esm/dockview/dockviewGroupPanel.d.ts.map +1 -1
- package/dist/esm/dockview/dockviewGroupPanel.js.map +1 -1
- package/dist/esm/dockview/dockviewGroupPanelModel.d.ts +11 -4
- package/dist/esm/dockview/dockviewGroupPanelModel.d.ts.map +1 -1
- package/dist/esm/dockview/dockviewGroupPanelModel.js +28 -6
- package/dist/esm/dockview/dockviewGroupPanelModel.js.map +1 -1
- package/dist/esm/dockview/dockviewPanel.d.ts +1 -1
- package/dist/esm/dockview/dockviewPanel.d.ts.map +1 -1
- package/dist/esm/dockview/options.d.ts +9 -5
- package/dist/esm/dockview/options.d.ts.map +1 -1
- package/dist/esm/dockview/options.js.map +1 -1
- package/dist/esm/gridview/baseComponentGridview.d.ts +1 -1
- package/dist/esm/gridview/baseComponentGridview.d.ts.map +1 -1
- package/dist/esm/gridview/baseComponentGridview.js.map +1 -1
- package/dist/esm/gridview/basePanelView.d.ts +4 -4
- package/dist/esm/gridview/basePanelView.d.ts.map +1 -1
- package/dist/esm/gridview/basePanelView.js.map +1 -1
- package/dist/esm/gridview/branchNode.d.ts.map +1 -1
- package/dist/esm/gridview/branchNode.js +1 -0
- package/dist/esm/gridview/branchNode.js.map +1 -1
- package/dist/esm/gridview/gridview.d.ts.map +1 -1
- package/dist/esm/gridview/gridview.js +8 -0
- package/dist/esm/gridview/gridview.js.map +1 -1
- package/dist/esm/gridview/gridviewComponent.d.ts +4 -4
- package/dist/esm/gridview/gridviewComponent.d.ts.map +1 -1
- package/dist/esm/gridview/gridviewComponent.js +56 -35
- package/dist/esm/gridview/gridviewComponent.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lifecycle.d.ts +0 -1
- package/dist/esm/lifecycle.d.ts.map +1 -1
- package/dist/esm/lifecycle.js +0 -3
- package/dist/esm/lifecycle.js.map +1 -1
- package/dist/esm/panel/types.d.ts +2 -2
- package/dist/esm/panel/types.d.ts.map +1 -1
- package/dist/esm/paneview/paneviewComponent.d.ts +5 -6
- package/dist/esm/paneview/paneviewComponent.d.ts.map +1 -1
- package/dist/esm/paneview/paneviewComponent.js.map +1 -1
- package/dist/esm/resizable.d.ts.map +1 -1
- package/dist/esm/resizable.js +8 -0
- package/dist/esm/resizable.js.map +1 -1
- package/dist/esm/splitview/splitview.d.ts.map +1 -1
- package/dist/esm/splitview/splitview.js +11 -1
- package/dist/esm/splitview/splitview.js.map +1 -1
- package/dist/esm/splitview/splitviewComponent.d.ts +4 -4
- package/dist/esm/splitview/splitviewComponent.d.ts.map +1 -1
- package/dist/esm/splitview/splitviewComponent.js.map +1 -1
- package/dist/esm/splitview/splitviewPanel.d.ts +1 -1
- package/package.json +3 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-core
|
|
3
|
-
* @version 1.8.
|
|
3
|
+
* @version 1.8.4
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -240,9 +240,6 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
240
240
|
get isDisposed() {
|
|
241
241
|
return this._isDisposed;
|
|
242
242
|
}
|
|
243
|
-
static from(...args) {
|
|
244
|
-
return new CompositeDisposable(...args);
|
|
245
|
-
}
|
|
246
243
|
constructor(...args) {
|
|
247
244
|
this._isDisposed = false;
|
|
248
245
|
this._disposables = args;
|
|
@@ -871,7 +868,17 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
871
868
|
size = typeof size === 'number' ? size : item.size;
|
|
872
869
|
size = clamp(size, item.minimumSize, item.maximumSize);
|
|
873
870
|
item.size = size;
|
|
874
|
-
this.
|
|
871
|
+
const indexes = range(this.viewItems.length).filter((i) => i !== index);
|
|
872
|
+
const lowPriorityIndexes = [
|
|
873
|
+
...indexes.filter((i) => this.viewItems[i].priority === exports.LayoutPriority.Low),
|
|
874
|
+
index,
|
|
875
|
+
];
|
|
876
|
+
const highPriorityIndexes = indexes.filter((i) => this.viewItems[i].priority === exports.LayoutPriority.High);
|
|
877
|
+
/**
|
|
878
|
+
* add this view we are changing to the low-index list since we have determined the size
|
|
879
|
+
* here and don't want it changed
|
|
880
|
+
*/
|
|
881
|
+
this.relayout([...lowPriorityIndexes, index], highPriorityIndexes);
|
|
875
882
|
}
|
|
876
883
|
addView(view, size = { type: 'distribute' }, index = this.viewItems.length, skipLayout) {
|
|
877
884
|
const container = document.createElement('div');
|
|
@@ -1628,6 +1635,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
1628
1635
|
orientation: this.orientation,
|
|
1629
1636
|
descriptor,
|
|
1630
1637
|
proportionalLayout,
|
|
1638
|
+
styles,
|
|
1631
1639
|
});
|
|
1632
1640
|
}
|
|
1633
1641
|
this.addDisposables(this._onDidChange, this.splitview.onDidSashEnd(() => {
|
|
@@ -2139,6 +2147,14 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2139
2147
|
const child = sibling.children[i];
|
|
2140
2148
|
grandParent.addChild(child, child.size, parentIndex + i);
|
|
2141
2149
|
}
|
|
2150
|
+
/**
|
|
2151
|
+
* clean down the branch node since we need to dipose of it and
|
|
2152
|
+
* when .dispose() it called on a branch it will dispose of any
|
|
2153
|
+
* views it is holding onto.
|
|
2154
|
+
*/
|
|
2155
|
+
while (sibling.children.length > 0) {
|
|
2156
|
+
sibling.removeChild(0);
|
|
2157
|
+
}
|
|
2142
2158
|
}
|
|
2143
2159
|
else {
|
|
2144
2160
|
// otherwise create a new leaf node and add that to the grandparent
|
|
@@ -2446,6 +2462,12 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2446
2462
|
get onDidDrop() {
|
|
2447
2463
|
return this.component.onDidDrop;
|
|
2448
2464
|
}
|
|
2465
|
+
get onWillDragGroup() {
|
|
2466
|
+
return this.component.onWillDragGroup;
|
|
2467
|
+
}
|
|
2468
|
+
get onWillDragPanel() {
|
|
2469
|
+
return this.component.onWillDragPanel;
|
|
2470
|
+
}
|
|
2449
2471
|
get panels() {
|
|
2450
2472
|
return this.component.panels;
|
|
2451
2473
|
}
|
|
@@ -2908,7 +2930,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2908
2930
|
}
|
|
2909
2931
|
configure() {
|
|
2910
2932
|
this.addDisposables(this._onDragStart, addDisposableListener(this.el, 'dragstart', (event) => {
|
|
2911
|
-
if (this.isCancelled(event)) {
|
|
2933
|
+
if (event.defaultPrevented || this.isCancelled(event)) {
|
|
2912
2934
|
event.preventDefault();
|
|
2913
2935
|
return;
|
|
2914
2936
|
}
|
|
@@ -2928,19 +2950,23 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2928
2950
|
}
|
|
2929
2951
|
this.el.classList.add('dv-dragged');
|
|
2930
2952
|
setTimeout(() => this.el.classList.remove('dv-dragged'), 0);
|
|
2931
|
-
this.dataDisposable.value = this.getData(event
|
|
2953
|
+
this.dataDisposable.value = this.getData(event);
|
|
2954
|
+
this._onDragStart.fire(event);
|
|
2932
2955
|
if (event.dataTransfer) {
|
|
2933
2956
|
event.dataTransfer.effectAllowed = 'move';
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2957
|
+
const hasData = event.dataTransfer.items.length > 0;
|
|
2958
|
+
if (!hasData) {
|
|
2959
|
+
/**
|
|
2960
|
+
* Although this is not used by dockview many third party dnd libraries will check
|
|
2961
|
+
* dataTransfer.types to determine valid drag events.
|
|
2962
|
+
*
|
|
2963
|
+
* For example: in react-dnd if dataTransfer.types is not set then the dragStart event will be cancelled
|
|
2964
|
+
* through .preventDefault(). Since this is applied globally to all drag events this would break dockviews
|
|
2965
|
+
* dnd logic. You can see the code at
|
|
2966
|
+
* https://github.com/react-dnd/react-dnd/blob/main/packages/backend-html5/src/HTML5BackendImpl.ts#L542
|
|
2967
|
+
*/
|
|
2968
|
+
event.dataTransfer.setData('text/plain', '__dockview_internal_drag_event__');
|
|
2969
|
+
}
|
|
2944
2970
|
}
|
|
2945
2971
|
}), addDisposableListener(this.el, 'dragend', () => {
|
|
2946
2972
|
this.pointerEventsDisposable.dispose();
|
|
@@ -2949,44 +2975,45 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2949
2975
|
}
|
|
2950
2976
|
}
|
|
2951
2977
|
|
|
2978
|
+
class TabDragHandler extends DragHandler {
|
|
2979
|
+
constructor(element, accessor, group, panel) {
|
|
2980
|
+
super(element);
|
|
2981
|
+
this.accessor = accessor;
|
|
2982
|
+
this.group = group;
|
|
2983
|
+
this.panel = panel;
|
|
2984
|
+
this.panelTransfer = LocalSelectionTransfer.getInstance();
|
|
2985
|
+
}
|
|
2986
|
+
getData(event) {
|
|
2987
|
+
this.panelTransfer.setData([new PanelTransfer(this.accessor.id, this.group.id, this.panel.id)], PanelTransfer.prototype);
|
|
2988
|
+
return {
|
|
2989
|
+
dispose: () => {
|
|
2990
|
+
this.panelTransfer.clearData(PanelTransfer.prototype);
|
|
2991
|
+
},
|
|
2992
|
+
};
|
|
2993
|
+
}
|
|
2994
|
+
}
|
|
2952
2995
|
class Tab extends CompositeDisposable {
|
|
2953
2996
|
get element() {
|
|
2954
2997
|
return this._element;
|
|
2955
2998
|
}
|
|
2956
|
-
constructor(
|
|
2999
|
+
constructor(panel, accessor, group) {
|
|
2957
3000
|
super();
|
|
2958
|
-
this.
|
|
3001
|
+
this.panel = panel;
|
|
2959
3002
|
this.accessor = accessor;
|
|
2960
3003
|
this.group = group;
|
|
3004
|
+
this.content = undefined;
|
|
2961
3005
|
this._onChanged = new Emitter();
|
|
2962
3006
|
this.onChanged = this._onChanged.event;
|
|
2963
3007
|
this._onDropped = new Emitter();
|
|
2964
3008
|
this.onDrop = this._onDropped.event;
|
|
3009
|
+
this._onDragStart = new Emitter();
|
|
3010
|
+
this.onDragStart = this._onDragStart.event;
|
|
2965
3011
|
this._element = document.createElement('div');
|
|
2966
3012
|
this._element.className = 'tab';
|
|
2967
3013
|
this._element.tabIndex = 0;
|
|
2968
3014
|
this._element.draggable = true;
|
|
2969
3015
|
toggleClass(this.element, 'inactive-tab', true);
|
|
2970
|
-
this.
|
|
2971
|
-
constructor() {
|
|
2972
|
-
super(...arguments);
|
|
2973
|
-
this.panelTransfer = LocalSelectionTransfer.getInstance();
|
|
2974
|
-
}
|
|
2975
|
-
getData() {
|
|
2976
|
-
this.panelTransfer.setData([new PanelTransfer(accessor.id, group.id, panelId)], PanelTransfer.prototype);
|
|
2977
|
-
return {
|
|
2978
|
-
dispose: () => {
|
|
2979
|
-
this.panelTransfer.clearData(PanelTransfer.prototype);
|
|
2980
|
-
},
|
|
2981
|
-
};
|
|
2982
|
-
}
|
|
2983
|
-
})(this._element));
|
|
2984
|
-
this.addDisposables(addDisposableListener(this._element, 'mousedown', (event) => {
|
|
2985
|
-
if (event.defaultPrevented) {
|
|
2986
|
-
return;
|
|
2987
|
-
}
|
|
2988
|
-
this._onChanged.fire(event);
|
|
2989
|
-
}));
|
|
3016
|
+
const dragHandler = new TabDragHandler(this._element, this.accessor, this.group, this.panel);
|
|
2990
3017
|
this.droptarget = new Droptarget(this._element, {
|
|
2991
3018
|
acceptedTargetZones: ['center'],
|
|
2992
3019
|
canDisplayOverlay: (event, position) => {
|
|
@@ -3000,12 +3027,19 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3000
3027
|
// don't allow group move to drop on self
|
|
3001
3028
|
return false;
|
|
3002
3029
|
}
|
|
3003
|
-
return this.
|
|
3030
|
+
return this.panel.id !== data.panelId;
|
|
3004
3031
|
}
|
|
3005
3032
|
return this.group.model.canDisplayOverlay(event, position, exports.DockviewDropTargets.Tab);
|
|
3006
3033
|
},
|
|
3007
3034
|
});
|
|
3008
|
-
this.addDisposables(this.
|
|
3035
|
+
this.addDisposables(this._onChanged, this._onDropped, this._onDragStart, dragHandler.onDragStart((event) => {
|
|
3036
|
+
this._onDragStart.fire(event);
|
|
3037
|
+
}), dragHandler, addDisposableListener(this._element, 'mousedown', (event) => {
|
|
3038
|
+
if (event.defaultPrevented) {
|
|
3039
|
+
return;
|
|
3040
|
+
}
|
|
3041
|
+
this._onChanged.fire(event);
|
|
3042
|
+
}), this.droptarget.onDrop((event) => {
|
|
3009
3043
|
this._onDropped.fire(event);
|
|
3010
3044
|
}), this.droptarget);
|
|
3011
3045
|
}
|
|
@@ -3037,9 +3071,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3037
3071
|
}
|
|
3038
3072
|
|
|
3039
3073
|
class GroupDragHandler extends DragHandler {
|
|
3040
|
-
constructor(element,
|
|
3074
|
+
constructor(element, accessor, group) {
|
|
3041
3075
|
super(element);
|
|
3042
|
-
this.
|
|
3076
|
+
this.accessor = accessor;
|
|
3043
3077
|
this.group = group;
|
|
3044
3078
|
this.panelTransfer = LocalSelectionTransfer.getInstance();
|
|
3045
3079
|
this.addDisposables(addDisposableListener(element, 'mousedown', (e) => {
|
|
@@ -3059,8 +3093,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3059
3093
|
}
|
|
3060
3094
|
return false;
|
|
3061
3095
|
}
|
|
3062
|
-
getData(
|
|
3063
|
-
|
|
3096
|
+
getData(dragEvent) {
|
|
3097
|
+
const dataTransfer = dragEvent.dataTransfer;
|
|
3098
|
+
this.panelTransfer.setData([new PanelTransfer(this.accessor.id, this.group.id, null)], PanelTransfer.prototype);
|
|
3064
3099
|
const style = window.getComputedStyle(this.el);
|
|
3065
3100
|
const bgColor = style.getPropertyValue('--dv-activegroup-visiblepanel-tab-background-color');
|
|
3066
3101
|
const color = style.getPropertyValue('--dv-activegroup-visiblepanel-tab-color');
|
|
@@ -3095,14 +3130,16 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3095
3130
|
this.group = group;
|
|
3096
3131
|
this._onDrop = new Emitter();
|
|
3097
3132
|
this.onDrop = this._onDrop.event;
|
|
3133
|
+
this._onDragStart = new Emitter();
|
|
3134
|
+
this.onDragStart = this._onDragStart.event;
|
|
3098
3135
|
this._element = document.createElement('div');
|
|
3099
3136
|
this._element.className = 'void-container';
|
|
3100
3137
|
this._element.tabIndex = 0;
|
|
3101
3138
|
this._element.draggable = true;
|
|
3102
|
-
this.addDisposables(this._onDrop, addDisposableListener(this._element, 'click', () => {
|
|
3139
|
+
this.addDisposables(this._onDrop, this._onDragStart, addDisposableListener(this._element, 'click', () => {
|
|
3103
3140
|
this.accessor.doSetGroupActive(this.group);
|
|
3104
3141
|
}));
|
|
3105
|
-
const handler = new GroupDragHandler(this._element, accessor
|
|
3142
|
+
const handler = new GroupDragHandler(this._element, accessor, group);
|
|
3106
3143
|
this.voidDropTarget = new Droptarget(this._element, {
|
|
3107
3144
|
acceptedTargetZones: ['center'],
|
|
3108
3145
|
canDisplayOverlay: (event, position) => {
|
|
@@ -3120,7 +3157,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3120
3157
|
return group.model.canDisplayOverlay(event, position, exports.DockviewDropTargets.Panel);
|
|
3121
3158
|
},
|
|
3122
3159
|
});
|
|
3123
|
-
this.addDisposables(handler,
|
|
3160
|
+
this.addDisposables(handler, handler.onDragStart((event) => {
|
|
3161
|
+
this._onDragStart.fire(event);
|
|
3162
|
+
}), this.voidDropTarget.onDrop((event) => {
|
|
3124
3163
|
this._onDrop.fire(event);
|
|
3125
3164
|
}), this.voidDropTarget);
|
|
3126
3165
|
}
|
|
@@ -3128,7 +3167,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3128
3167
|
|
|
3129
3168
|
class TabsContainer extends CompositeDisposable {
|
|
3130
3169
|
get panels() {
|
|
3131
|
-
return this.tabs.map((_) => _.value.
|
|
3170
|
+
return this.tabs.map((_) => _.value.panel.id);
|
|
3132
3171
|
}
|
|
3133
3172
|
get size() {
|
|
3134
3173
|
return this.tabs.length;
|
|
@@ -3174,6 +3213,19 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3174
3213
|
this.leftActions = element;
|
|
3175
3214
|
}
|
|
3176
3215
|
}
|
|
3216
|
+
setPrefixActionsElement(element) {
|
|
3217
|
+
if (this.preActions === element) {
|
|
3218
|
+
return;
|
|
3219
|
+
}
|
|
3220
|
+
if (this.preActions) {
|
|
3221
|
+
this.preActions.remove();
|
|
3222
|
+
this.preActions = undefined;
|
|
3223
|
+
}
|
|
3224
|
+
if (element) {
|
|
3225
|
+
this.preActionsContainer.appendChild(element);
|
|
3226
|
+
this.preActions = element;
|
|
3227
|
+
}
|
|
3228
|
+
}
|
|
3177
3229
|
get element() {
|
|
3178
3230
|
return this._element;
|
|
3179
3231
|
}
|
|
@@ -3182,7 +3234,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3182
3234
|
this.tabs[this.selectedIndex].value === tab);
|
|
3183
3235
|
}
|
|
3184
3236
|
indexOf(id) {
|
|
3185
|
-
return this.tabs.findIndex((tab) => tab.value.
|
|
3237
|
+
return this.tabs.findIndex((tab) => tab.value.panel.id === id);
|
|
3186
3238
|
}
|
|
3187
3239
|
constructor(accessor, group) {
|
|
3188
3240
|
super();
|
|
@@ -3193,7 +3245,11 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3193
3245
|
this._hidden = false;
|
|
3194
3246
|
this._onDrop = new Emitter();
|
|
3195
3247
|
this.onDrop = this._onDrop.event;
|
|
3196
|
-
this.
|
|
3248
|
+
this._onTabDragStart = new Emitter();
|
|
3249
|
+
this.onTabDragStart = this._onTabDragStart.event;
|
|
3250
|
+
this._onGroupDragStart = new Emitter();
|
|
3251
|
+
this.onGroupDragStart = this._onGroupDragStart.event;
|
|
3252
|
+
this.addDisposables(this._onDrop, this._onTabDragStart, this._onGroupDragStart);
|
|
3197
3253
|
this._element = document.createElement('div');
|
|
3198
3254
|
this._element.className = 'tabs-and-actions-container';
|
|
3199
3255
|
toggleClass(this._element, 'dv-full-width-single-tab', this.accessor.options.singleTabMode === 'fullwidth');
|
|
@@ -3210,14 +3266,22 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3210
3266
|
this.rightActionsContainer.className = 'right-actions-container';
|
|
3211
3267
|
this.leftActionsContainer = document.createElement('div');
|
|
3212
3268
|
this.leftActionsContainer.className = 'left-actions-container';
|
|
3269
|
+
this.preActionsContainer = document.createElement('div');
|
|
3270
|
+
this.preActionsContainer.className = 'pre-actions-container';
|
|
3213
3271
|
this.tabContainer = document.createElement('div');
|
|
3214
3272
|
this.tabContainer.className = 'tabs-container';
|
|
3215
3273
|
this.voidContainer = new VoidContainer(this.accessor, this.group);
|
|
3274
|
+
this._element.appendChild(this.preActionsContainer);
|
|
3216
3275
|
this._element.appendChild(this.tabContainer);
|
|
3217
3276
|
this._element.appendChild(this.leftActionsContainer);
|
|
3218
3277
|
this._element.appendChild(this.voidContainer.element);
|
|
3219
3278
|
this._element.appendChild(this.rightActionsContainer);
|
|
3220
|
-
this.addDisposables(this.voidContainer, this.voidContainer.
|
|
3279
|
+
this.addDisposables(this.voidContainer, this.voidContainer.onDragStart((event) => {
|
|
3280
|
+
this._onGroupDragStart.fire({
|
|
3281
|
+
nativeEvent: event,
|
|
3282
|
+
group: this.group,
|
|
3283
|
+
});
|
|
3284
|
+
}), this.voidContainer.onDrop((event) => {
|
|
3221
3285
|
this._onDrop.fire({
|
|
3222
3286
|
event: event.nativeEvent,
|
|
3223
3287
|
index: this.tabs.length,
|
|
@@ -3263,7 +3327,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3263
3327
|
}
|
|
3264
3328
|
}
|
|
3265
3329
|
delete(id) {
|
|
3266
|
-
const index = this.tabs.findIndex((tab) => tab.value.
|
|
3330
|
+
const index = this.tabs.findIndex((tab) => tab.value.panel.id === id);
|
|
3267
3331
|
const tabToRemove = this.tabs.splice(index, 1)[0];
|
|
3268
3332
|
const { value, disposable } = tabToRemove;
|
|
3269
3333
|
disposable.dispose();
|
|
@@ -3272,21 +3336,23 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3272
3336
|
}
|
|
3273
3337
|
setActivePanel(panel) {
|
|
3274
3338
|
this.tabs.forEach((tab) => {
|
|
3275
|
-
const isActivePanel = panel.id === tab.value.
|
|
3339
|
+
const isActivePanel = panel.id === tab.value.panel.id;
|
|
3276
3340
|
tab.value.setActive(isActivePanel);
|
|
3277
3341
|
});
|
|
3278
3342
|
}
|
|
3279
3343
|
openPanel(panel, index = this.tabs.length) {
|
|
3280
3344
|
var _a;
|
|
3281
|
-
if (this.tabs.find((tab) => tab.value.
|
|
3345
|
+
if (this.tabs.find((tab) => tab.value.panel.id === panel.id)) {
|
|
3282
3346
|
return;
|
|
3283
3347
|
}
|
|
3284
|
-
const
|
|
3348
|
+
const tab = new Tab(panel, this.accessor, this.group);
|
|
3285
3349
|
if (!((_a = panel.view) === null || _a === void 0 ? void 0 : _a.tab)) {
|
|
3286
3350
|
throw new Error('invalid header component');
|
|
3287
3351
|
}
|
|
3288
|
-
|
|
3289
|
-
const disposable = CompositeDisposable
|
|
3352
|
+
tab.setContent(panel.view.tab);
|
|
3353
|
+
const disposable = new CompositeDisposable(tab.onDragStart((event) => {
|
|
3354
|
+
this._onTabDragStart.fire({ nativeEvent: event, panel });
|
|
3355
|
+
}), tab.onChanged((event) => {
|
|
3290
3356
|
var _a;
|
|
3291
3357
|
const isFloatingGroupsEnabled = !this.accessor.options.disableFloatingGroups;
|
|
3292
3358
|
const isFloatingWithOnePanel = this.group.api.isFloating && this.size === 1;
|
|
@@ -3294,8 +3360,8 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3294
3360
|
!isFloatingWithOnePanel &&
|
|
3295
3361
|
event.shiftKey) {
|
|
3296
3362
|
event.preventDefault();
|
|
3297
|
-
const panel = this.accessor.getGroupPanel(
|
|
3298
|
-
const { top, left } =
|
|
3363
|
+
const panel = this.accessor.getGroupPanel(tab.panel.id);
|
|
3364
|
+
const { top, left } = tab.element.getBoundingClientRect();
|
|
3299
3365
|
const { top: rootTop, left: rootLeft } = this.accessor.element.getBoundingClientRect();
|
|
3300
3366
|
this.accessor.addFloatingGroup(panel, {
|
|
3301
3367
|
x: left - rootLeft,
|
|
@@ -3312,13 +3378,13 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3312
3378
|
this.group.model.openPanel(panel, {
|
|
3313
3379
|
skipFocus: alreadyFocused,
|
|
3314
3380
|
});
|
|
3315
|
-
}),
|
|
3381
|
+
}), tab.onDrop((event) => {
|
|
3316
3382
|
this._onDrop.fire({
|
|
3317
3383
|
event: event.nativeEvent,
|
|
3318
|
-
index: this.tabs.findIndex((x) => x.value ===
|
|
3384
|
+
index: this.tabs.findIndex((x) => x.value === tab),
|
|
3319
3385
|
});
|
|
3320
3386
|
}));
|
|
3321
|
-
const value = { value:
|
|
3387
|
+
const value = { value: tab, disposable };
|
|
3322
3388
|
this.addTab(value, index);
|
|
3323
3389
|
}
|
|
3324
3390
|
closePanel(panel) {
|
|
@@ -3346,7 +3412,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3346
3412
|
}
|
|
3347
3413
|
set locked(value) {
|
|
3348
3414
|
this._locked = value;
|
|
3349
|
-
toggleClass(this.container, 'locked-groupview', value);
|
|
3415
|
+
toggleClass(this.container, 'locked-groupview', value === 'no-drop-target' || value);
|
|
3350
3416
|
}
|
|
3351
3417
|
get isActive() {
|
|
3352
3418
|
return this._isGroupActive;
|
|
@@ -3403,6 +3469,10 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3403
3469
|
this.onMove = this._onMove.event;
|
|
3404
3470
|
this._onDidDrop = new Emitter();
|
|
3405
3471
|
this.onDidDrop = this._onDidDrop.event;
|
|
3472
|
+
this._onTabDragStart = new Emitter();
|
|
3473
|
+
this.onTabDragStart = this._onTabDragStart.event;
|
|
3474
|
+
this._onGroupDragStart = new Emitter();
|
|
3475
|
+
this.onGroupDragStart = this._onGroupDragStart.event;
|
|
3406
3476
|
this._onDidAddPanel = new Emitter();
|
|
3407
3477
|
this.onDidAddPanel = this._onDidAddPanel.event;
|
|
3408
3478
|
this._onDidRemovePanel = new Emitter();
|
|
@@ -3415,7 +3485,8 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3415
3485
|
this.dropTarget = new Droptarget(this.contentContainer.element, {
|
|
3416
3486
|
acceptedTargetZones: ['top', 'bottom', 'left', 'right', 'center'],
|
|
3417
3487
|
canDisplayOverlay: (event, position) => {
|
|
3418
|
-
if (this.locked
|
|
3488
|
+
if (this.locked === 'no-drop-target' ||
|
|
3489
|
+
(this.locked && position === 'center')) {
|
|
3419
3490
|
return false;
|
|
3420
3491
|
}
|
|
3421
3492
|
const data = getPanelData();
|
|
@@ -3441,8 +3512,12 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3441
3512
|
});
|
|
3442
3513
|
container.append(this.tabsContainer.element, this.contentContainer.element);
|
|
3443
3514
|
this.header.hidden = !!options.hideHeader;
|
|
3444
|
-
this.locked =
|
|
3445
|
-
this.addDisposables(this.tabsContainer.
|
|
3515
|
+
this.locked = options.locked || false;
|
|
3516
|
+
this.addDisposables(this._onTabDragStart, this._onGroupDragStart, this.tabsContainer.onTabDragStart((event) => {
|
|
3517
|
+
this._onTabDragStart.fire(event);
|
|
3518
|
+
}), this.tabsContainer.onGroupDragStart((event) => {
|
|
3519
|
+
this._onGroupDragStart.fire(event);
|
|
3520
|
+
}), this.tabsContainer.onDrop((event) => {
|
|
3446
3521
|
this.handleDropEvent(event.event, 'center', event.index);
|
|
3447
3522
|
}), this.contentContainer.onDidFocus(() => {
|
|
3448
3523
|
this.accessor.doSetGroupActive(this.groupPanel, true);
|
|
@@ -3486,6 +3561,16 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3486
3561
|
});
|
|
3487
3562
|
this.tabsContainer.setLeftActionsElement(this._leftHeaderActions.element);
|
|
3488
3563
|
}
|
|
3564
|
+
if (this.accessor.options.createPrefixHeaderActionsElement) {
|
|
3565
|
+
this._prefixHeaderActions =
|
|
3566
|
+
this.accessor.options.createPrefixHeaderActionsElement(this.groupPanel);
|
|
3567
|
+
this.addDisposables(this._prefixHeaderActions);
|
|
3568
|
+
this._prefixHeaderActions.init({
|
|
3569
|
+
containerApi: new DockviewApi(this.accessor),
|
|
3570
|
+
api: this.groupPanel.api,
|
|
3571
|
+
});
|
|
3572
|
+
this.tabsContainer.setPrefixActionsElement(this._prefixHeaderActions.element);
|
|
3573
|
+
}
|
|
3489
3574
|
}
|
|
3490
3575
|
indexOf(panel) {
|
|
3491
3576
|
return this.tabsContainer.indexOf(panel.id);
|
|
@@ -3497,8 +3582,8 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3497
3582
|
activeView: (_a = this._activePanel) === null || _a === void 0 ? void 0 : _a.id,
|
|
3498
3583
|
id: this.id,
|
|
3499
3584
|
};
|
|
3500
|
-
if (this.locked) {
|
|
3501
|
-
result.locked =
|
|
3585
|
+
if (this.locked !== false) {
|
|
3586
|
+
result.locked = this.locked;
|
|
3502
3587
|
}
|
|
3503
3588
|
if (this.header.hidden) {
|
|
3504
3589
|
result.hideHeader = true;
|
|
@@ -3748,6 +3833,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3748
3833
|
return false;
|
|
3749
3834
|
}
|
|
3750
3835
|
handleDropEvent(event, position, index) {
|
|
3836
|
+
if (this.locked === 'no-drop-target') {
|
|
3837
|
+
return;
|
|
3838
|
+
}
|
|
3751
3839
|
const data = getPanelData();
|
|
3752
3840
|
if (data && data.viewId === this.accessor.id) {
|
|
3753
3841
|
if (data.panelId === null) {
|
|
@@ -3825,6 +3913,14 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3825
3913
|
*/
|
|
3826
3914
|
return;
|
|
3827
3915
|
}
|
|
3916
|
+
if (!document.body.contains(this._element)) {
|
|
3917
|
+
/**
|
|
3918
|
+
* since the event is dispatched through requestAnimationFrame there is a small chance
|
|
3919
|
+
* the component is no longer attached to the DOM, if that is the case the dimensions
|
|
3920
|
+
* are mostly likely all zero and meaningless. we should skip this case.
|
|
3921
|
+
*/
|
|
3922
|
+
return;
|
|
3923
|
+
}
|
|
3828
3924
|
const { width, height } = entry.contentRect;
|
|
3829
3925
|
this.layout(width, height);
|
|
3830
3926
|
}));
|
|
@@ -5205,6 +5301,12 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5205
5301
|
return pushToTop;
|
|
5206
5302
|
})();
|
|
5207
5303
|
class Overlay extends CompositeDisposable {
|
|
5304
|
+
set minimumInViewportWidth(value) {
|
|
5305
|
+
this.options.minimumInViewportWidth = value;
|
|
5306
|
+
}
|
|
5307
|
+
set minimumInViewportHeight(value) {
|
|
5308
|
+
this.options.minimumInViewportHeight = value;
|
|
5309
|
+
}
|
|
5208
5310
|
constructor(options) {
|
|
5209
5311
|
super();
|
|
5210
5312
|
this.options = options;
|
|
@@ -5250,9 +5352,11 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5250
5352
|
const overlayRect = this._element.getBoundingClientRect();
|
|
5251
5353
|
// region: ensure bounds within allowable limits
|
|
5252
5354
|
// a minimum width of minimumViewportWidth must be inside the viewport
|
|
5253
|
-
const xOffset = Math.max(0, overlayRect.width
|
|
5355
|
+
const xOffset = Math.max(0, this.getMinimumWidth(overlayRect.width));
|
|
5254
5356
|
// a minimum height of minimumViewportHeight must be inside the viewport
|
|
5255
|
-
const yOffset =
|
|
5357
|
+
const yOffset = typeof this.options.minimumInViewportHeight === 'number'
|
|
5358
|
+
? Math.max(0, this.getMinimumHeight(overlayRect.height))
|
|
5359
|
+
: 0;
|
|
5256
5360
|
const left = clamp(overlayRect.left - containerRect.left, -xOffset, Math.max(0, containerRect.width - overlayRect.width + xOffset));
|
|
5257
5361
|
const top = clamp(overlayRect.top - containerRect.top, -yOffset, Math.max(0, containerRect.height - overlayRect.height + yOffset));
|
|
5258
5362
|
this._element.style.left = `${left}px`;
|
|
@@ -5298,9 +5402,10 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5298
5402
|
y: e.clientY - overlayRect.top,
|
|
5299
5403
|
};
|
|
5300
5404
|
}
|
|
5301
|
-
const xOffset = Math.max(0, overlayRect.width
|
|
5302
|
-
const yOffset = Math.max(0,
|
|
5303
|
-
this.
|
|
5405
|
+
const xOffset = Math.max(0, this.getMinimumWidth(overlayRect.width));
|
|
5406
|
+
const yOffset = Math.max(0, this.options.minimumInViewportHeight
|
|
5407
|
+
? this.getMinimumHeight(overlayRect.height)
|
|
5408
|
+
: 0);
|
|
5304
5409
|
const left = clamp(x - offset.x, -xOffset, Math.max(0, containerRect.width - overlayRect.width + xOffset));
|
|
5305
5410
|
const top = clamp(y - offset.y, -yOffset, Math.max(0, containerRect.height - overlayRect.height + yOffset));
|
|
5306
5411
|
this.setBounds({ top, left });
|
|
@@ -5374,14 +5479,11 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5374
5479
|
let height = undefined;
|
|
5375
5480
|
let left = undefined;
|
|
5376
5481
|
let width = undefined;
|
|
5377
|
-
const
|
|
5378
|
-
const minimumInViewportWidth = this.options.minimumInViewportWidth;
|
|
5379
|
-
function moveTop() {
|
|
5482
|
+
const moveTop = () => {
|
|
5380
5483
|
top = clamp(y, -Number.MAX_VALUE, startPosition.originalY +
|
|
5381
5484
|
startPosition.originalHeight >
|
|
5382
5485
|
containerRect.height
|
|
5383
|
-
? containerRect.height
|
|
5384
|
-
minimumInViewportHeight
|
|
5486
|
+
? this.getMinimumHeight(containerRect.height)
|
|
5385
5487
|
: Math.max(0, startPosition.originalY +
|
|
5386
5488
|
startPosition.originalHeight -
|
|
5387
5489
|
Overlay.MINIMUM_HEIGHT));
|
|
@@ -5389,21 +5491,23 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5389
5491
|
startPosition.originalY +
|
|
5390
5492
|
startPosition.originalHeight -
|
|
5391
5493
|
top;
|
|
5392
|
-
}
|
|
5393
|
-
|
|
5494
|
+
};
|
|
5495
|
+
const moveBottom = () => {
|
|
5394
5496
|
top =
|
|
5395
5497
|
startPosition.originalY -
|
|
5396
5498
|
startPosition.originalHeight;
|
|
5397
|
-
height = clamp(y - top, top < 0
|
|
5398
|
-
|
|
5499
|
+
height = clamp(y - top, top < 0 &&
|
|
5500
|
+
typeof this.options
|
|
5501
|
+
.minimumInViewportHeight === 'number'
|
|
5502
|
+
? -top +
|
|
5503
|
+
this.options.minimumInViewportHeight
|
|
5399
5504
|
: Overlay.MINIMUM_HEIGHT, Number.MAX_VALUE);
|
|
5400
|
-
}
|
|
5401
|
-
|
|
5505
|
+
};
|
|
5506
|
+
const moveLeft = () => {
|
|
5402
5507
|
left = clamp(x, -Number.MAX_VALUE, startPosition.originalX +
|
|
5403
5508
|
startPosition.originalWidth >
|
|
5404
5509
|
containerRect.width
|
|
5405
|
-
? containerRect.width
|
|
5406
|
-
minimumInViewportWidth
|
|
5510
|
+
? this.getMinimumWidth(containerRect.width)
|
|
5407
5511
|
: Math.max(0, startPosition.originalX +
|
|
5408
5512
|
startPosition.originalWidth -
|
|
5409
5513
|
Overlay.MINIMUM_WIDTH));
|
|
@@ -5411,15 +5515,18 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5411
5515
|
startPosition.originalX +
|
|
5412
5516
|
startPosition.originalWidth -
|
|
5413
5517
|
left;
|
|
5414
|
-
}
|
|
5415
|
-
|
|
5518
|
+
};
|
|
5519
|
+
const moveRight = () => {
|
|
5416
5520
|
left =
|
|
5417
5521
|
startPosition.originalX -
|
|
5418
5522
|
startPosition.originalWidth;
|
|
5419
|
-
width = clamp(x - left, left < 0
|
|
5420
|
-
|
|
5523
|
+
width = clamp(x - left, left < 0 &&
|
|
5524
|
+
typeof this.options
|
|
5525
|
+
.minimumInViewportWidth === 'number'
|
|
5526
|
+
? -left +
|
|
5527
|
+
this.options.minimumInViewportWidth
|
|
5421
5528
|
: Overlay.MINIMUM_WIDTH, Number.MAX_VALUE);
|
|
5422
|
-
}
|
|
5529
|
+
};
|
|
5423
5530
|
switch (direction) {
|
|
5424
5531
|
case 'top':
|
|
5425
5532
|
moveTop();
|
|
@@ -5463,6 +5570,18 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5463
5570
|
}));
|
|
5464
5571
|
}));
|
|
5465
5572
|
}
|
|
5573
|
+
getMinimumWidth(width) {
|
|
5574
|
+
if (typeof this.options.minimumInViewportWidth === 'number') {
|
|
5575
|
+
return width - this.options.minimumInViewportWidth;
|
|
5576
|
+
}
|
|
5577
|
+
return 0;
|
|
5578
|
+
}
|
|
5579
|
+
getMinimumHeight(height) {
|
|
5580
|
+
if (typeof this.options.minimumInViewportHeight === 'number') {
|
|
5581
|
+
return height - this.options.minimumInViewportHeight;
|
|
5582
|
+
}
|
|
5583
|
+
return height;
|
|
5584
|
+
}
|
|
5466
5585
|
dispose() {
|
|
5467
5586
|
this._element.remove();
|
|
5468
5587
|
super.dispose();
|
|
@@ -5483,6 +5602,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5483
5602
|
}
|
|
5484
5603
|
}
|
|
5485
5604
|
|
|
5605
|
+
const DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE = 100;
|
|
5486
5606
|
class DockviewComponent extends BaseGrid {
|
|
5487
5607
|
get orientation() {
|
|
5488
5608
|
return this.gridview.orientation;
|
|
@@ -5513,6 +5633,10 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5513
5633
|
this.nextGroupId = sequentialNumberGenerator();
|
|
5514
5634
|
this._deserializer = new DefaultDockviewDeserialzier(this);
|
|
5515
5635
|
this.watermark = null;
|
|
5636
|
+
this._onWillDragPanel = new Emitter();
|
|
5637
|
+
this.onWillDragPanel = this._onWillDragPanel.event;
|
|
5638
|
+
this._onWillDragGroup = new Emitter();
|
|
5639
|
+
this.onWillDragGroup = this._onWillDragGroup.event;
|
|
5516
5640
|
this._onDidDrop = new Emitter();
|
|
5517
5641
|
this.onDidDrop = this._onDidDrop.event;
|
|
5518
5642
|
this._onDidRemovePanel = new Emitter();
|
|
@@ -5525,7 +5649,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5525
5649
|
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
5526
5650
|
this.floatingGroups = [];
|
|
5527
5651
|
toggleClass(this.gridview.element, 'dv-dockview', true);
|
|
5528
|
-
this.addDisposables(this._onDidDrop, exports.DockviewEvent.any(this.onDidAddGroup, this.onDidRemoveGroup)(() => {
|
|
5652
|
+
this.addDisposables(this._onWillDragPanel, this._onWillDragGroup, this._onDidActivePanelChange, this._onDidAddPanel, this._onDidRemovePanel, this._onDidLayoutFromJSON, this._onDidDrop, exports.DockviewEvent.any(this.onDidAddGroup, this.onDidRemoveGroup)(() => {
|
|
5529
5653
|
this.updateWatermark();
|
|
5530
5654
|
}), exports.DockviewEvent.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidActivePanelChange)(() => {
|
|
5531
5655
|
this._bufferOnDidLayoutChange.fire();
|
|
@@ -5598,7 +5722,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5598
5722
|
this.updateWatermark();
|
|
5599
5723
|
}
|
|
5600
5724
|
addFloatingGroup(item, coord, options) {
|
|
5601
|
-
var _a, _b;
|
|
5725
|
+
var _a, _b, _c, _d, _e, _f;
|
|
5602
5726
|
let group;
|
|
5603
5727
|
if (item instanceof DockviewPanel) {
|
|
5604
5728
|
group = this.createGroup();
|
|
@@ -5626,8 +5750,12 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5626
5750
|
width: (_b = coord === null || coord === void 0 ? void 0 : coord.width) !== null && _b !== void 0 ? _b : 300,
|
|
5627
5751
|
left: overlayLeft,
|
|
5628
5752
|
top: overlayTop,
|
|
5629
|
-
minimumInViewportWidth:
|
|
5630
|
-
|
|
5753
|
+
minimumInViewportWidth: this.options.floatingGroupBounds === 'boundedWithinViewport'
|
|
5754
|
+
? undefined
|
|
5755
|
+
: (_d = (_c = this.options.floatingGroupBounds) === null || _c === void 0 ? void 0 : _c.minimumWidthWithinViewport) !== null && _d !== void 0 ? _d : DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE,
|
|
5756
|
+
minimumInViewportHeight: this.options.floatingGroupBounds === 'boundedWithinViewport'
|
|
5757
|
+
? undefined
|
|
5758
|
+
: (_f = (_e = this.options.floatingGroupBounds) === null || _e === void 0 ? void 0 : _e.minimumHeightWithinViewport) !== null && _f !== void 0 ? _f : DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE,
|
|
5631
5759
|
});
|
|
5632
5760
|
const el = group.element.querySelector('.void-container');
|
|
5633
5761
|
if (!el) {
|
|
@@ -5698,12 +5826,37 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5698
5826
|
}
|
|
5699
5827
|
}
|
|
5700
5828
|
updateOptions(options) {
|
|
5829
|
+
var _a, _b;
|
|
5701
5830
|
const hasOrientationChanged = typeof options.orientation === 'string' &&
|
|
5702
5831
|
this.gridview.orientation !== options.orientation;
|
|
5832
|
+
const hasFloatingGroupOptionsChanged = options.floatingGroupBounds !== undefined &&
|
|
5833
|
+
options.floatingGroupBounds !== this.options.floatingGroupBounds;
|
|
5703
5834
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
5704
5835
|
if (hasOrientationChanged) {
|
|
5705
5836
|
this.gridview.orientation = options.orientation;
|
|
5706
5837
|
}
|
|
5838
|
+
if (hasFloatingGroupOptionsChanged) {
|
|
5839
|
+
for (const group of this.floatingGroups) {
|
|
5840
|
+
switch (this.options.floatingGroupBounds) {
|
|
5841
|
+
case 'boundedWithinViewport':
|
|
5842
|
+
group.overlay.minimumInViewportHeight = undefined;
|
|
5843
|
+
group.overlay.minimumInViewportWidth = undefined;
|
|
5844
|
+
break;
|
|
5845
|
+
case undefined:
|
|
5846
|
+
group.overlay.minimumInViewportHeight =
|
|
5847
|
+
DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE;
|
|
5848
|
+
group.overlay.minimumInViewportWidth =
|
|
5849
|
+
DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE;
|
|
5850
|
+
break;
|
|
5851
|
+
default:
|
|
5852
|
+
group.overlay.minimumInViewportHeight =
|
|
5853
|
+
(_a = this.options.floatingGroupBounds) === null || _a === void 0 ? void 0 : _a.minimumHeightWithinViewport;
|
|
5854
|
+
group.overlay.minimumInViewportWidth =
|
|
5855
|
+
(_b = this.options.floatingGroupBounds) === null || _b === void 0 ? void 0 : _b.minimumWidthWithinViewport;
|
|
5856
|
+
}
|
|
5857
|
+
group.overlay.setBounds({});
|
|
5858
|
+
}
|
|
5859
|
+
}
|
|
5707
5860
|
this.layout(this.gridview.width, this.gridview.height, true);
|
|
5708
5861
|
}
|
|
5709
5862
|
layout(width, height, forceResize) {
|
|
@@ -5796,61 +5949,114 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5796
5949
|
fromJSON(data) {
|
|
5797
5950
|
var _a;
|
|
5798
5951
|
this.clear();
|
|
5952
|
+
if (typeof data !== 'object' || data === null) {
|
|
5953
|
+
throw new Error('serialized layout must be a non-null object');
|
|
5954
|
+
}
|
|
5799
5955
|
const { grid, panels, activeGroup } = data;
|
|
5800
5956
|
if (grid.root.type !== 'branch' || !Array.isArray(grid.root.data)) {
|
|
5801
5957
|
throw new Error('root must be of type branch');
|
|
5802
5958
|
}
|
|
5803
|
-
|
|
5804
|
-
|
|
5805
|
-
|
|
5806
|
-
|
|
5807
|
-
const
|
|
5808
|
-
|
|
5809
|
-
id
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
const isActive = typeof activeView === 'string' && activeView === panel.id;
|
|
5817
|
-
group.model.openPanel(panel, {
|
|
5818
|
-
skipSetPanelActive: !isActive,
|
|
5819
|
-
skipSetGroupActive: true,
|
|
5959
|
+
try {
|
|
5960
|
+
// take note of the existing dimensions
|
|
5961
|
+
const width = this.width;
|
|
5962
|
+
const height = this.height;
|
|
5963
|
+
const createGroupFromSerializedState = (data) => {
|
|
5964
|
+
const { id, locked, hideHeader, views, activeView } = data;
|
|
5965
|
+
if (typeof id !== 'string') {
|
|
5966
|
+
throw new Error('group id must be of type string');
|
|
5967
|
+
}
|
|
5968
|
+
const group = this.createGroup({
|
|
5969
|
+
id,
|
|
5970
|
+
locked: !!locked,
|
|
5971
|
+
hideHeader: !!hideHeader,
|
|
5820
5972
|
});
|
|
5973
|
+
const createdPanels = [];
|
|
5974
|
+
for (const child of views) {
|
|
5975
|
+
/**
|
|
5976
|
+
* Run the deserializer step seperately since this may fail to due corrupted external state.
|
|
5977
|
+
* In running this section first we avoid firing lots of 'add' events in the event of a failure
|
|
5978
|
+
* due to a corruption of input data.
|
|
5979
|
+
*/
|
|
5980
|
+
const panel = this._deserializer.fromJSON(panels[child], group);
|
|
5981
|
+
createdPanels.push(panel);
|
|
5982
|
+
}
|
|
5983
|
+
this._onDidAddGroup.fire(group);
|
|
5984
|
+
for (let i = 0; i < views.length; i++) {
|
|
5985
|
+
const panel = createdPanels[i];
|
|
5986
|
+
const isActive = typeof activeView === 'string' &&
|
|
5987
|
+
activeView === panel.id;
|
|
5988
|
+
group.model.openPanel(panel, {
|
|
5989
|
+
skipSetPanelActive: !isActive,
|
|
5990
|
+
skipSetGroupActive: true,
|
|
5991
|
+
});
|
|
5992
|
+
}
|
|
5993
|
+
if (!group.activePanel && group.panels.length > 0) {
|
|
5994
|
+
group.model.openPanel(group.panels[group.panels.length - 1], {
|
|
5995
|
+
skipSetGroupActive: true,
|
|
5996
|
+
});
|
|
5997
|
+
}
|
|
5998
|
+
return group;
|
|
5999
|
+
};
|
|
6000
|
+
this.gridview.deserialize(grid, {
|
|
6001
|
+
fromJSON: (node) => {
|
|
6002
|
+
return createGroupFromSerializedState(node.data);
|
|
6003
|
+
},
|
|
6004
|
+
});
|
|
6005
|
+
this.layout(width, height, true);
|
|
6006
|
+
const serializedFloatingGroups = (_a = data.floatingGroups) !== null && _a !== void 0 ? _a : [];
|
|
6007
|
+
for (const serializedFloatingGroup of serializedFloatingGroups) {
|
|
6008
|
+
const { data, position } = serializedFloatingGroup;
|
|
6009
|
+
const group = createGroupFromSerializedState(data);
|
|
6010
|
+
this.addFloatingGroup(group, {
|
|
6011
|
+
x: position.left,
|
|
6012
|
+
y: position.top,
|
|
6013
|
+
height: position.height,
|
|
6014
|
+
width: position.width,
|
|
6015
|
+
}, { skipRemoveGroup: true, inDragMode: false });
|
|
6016
|
+
}
|
|
6017
|
+
for (const floatingGroup of this.floatingGroups) {
|
|
6018
|
+
floatingGroup.overlay.setBounds();
|
|
6019
|
+
}
|
|
6020
|
+
if (typeof activeGroup === 'string') {
|
|
6021
|
+
const panel = this.getPanel(activeGroup);
|
|
6022
|
+
if (panel) {
|
|
6023
|
+
this.doSetGroupActive(panel);
|
|
6024
|
+
}
|
|
5821
6025
|
}
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
6026
|
+
}
|
|
6027
|
+
catch (err) {
|
|
6028
|
+
/**
|
|
6029
|
+
* Takes all the successfully created groups and remove all of their panels.
|
|
6030
|
+
*/
|
|
6031
|
+
for (const group of this.groups) {
|
|
6032
|
+
for (const panel of group.panels) {
|
|
6033
|
+
this.removePanel(panel, {
|
|
6034
|
+
removeEmptyGroup: false,
|
|
6035
|
+
skipDispose: false,
|
|
6036
|
+
});
|
|
6037
|
+
}
|
|
5826
6038
|
}
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
const serializedFloatingGroups = (_a = data.floatingGroups) !== null && _a !== void 0 ? _a : [];
|
|
5836
|
-
for (const serializedFloatingGroup of serializedFloatingGroups) {
|
|
5837
|
-
const { data, position } = serializedFloatingGroup;
|
|
5838
|
-
const group = createGroupFromSerializedState(data);
|
|
5839
|
-
this.addFloatingGroup(group, {
|
|
5840
|
-
x: position.left,
|
|
5841
|
-
y: position.top,
|
|
5842
|
-
height: position.height,
|
|
5843
|
-
width: position.width,
|
|
5844
|
-
}, { skipRemoveGroup: true, inDragMode: false });
|
|
5845
|
-
}
|
|
5846
|
-
for (const floatingGroup of this.floatingGroups) {
|
|
5847
|
-
floatingGroup.overlay.setBounds();
|
|
5848
|
-
}
|
|
5849
|
-
if (typeof activeGroup === 'string') {
|
|
5850
|
-
const panel = this.getPanel(activeGroup);
|
|
5851
|
-
if (panel) {
|
|
5852
|
-
this.doSetGroupActive(panel);
|
|
6039
|
+
/**
|
|
6040
|
+
* To remove a group we cannot call this.removeGroup(...) since this makes assumptions about
|
|
6041
|
+
* the underlying HTMLElement existing in the Gridview.
|
|
6042
|
+
*/
|
|
6043
|
+
for (const group of this.groups) {
|
|
6044
|
+
group.dispose();
|
|
6045
|
+
this._groups.delete(group.id);
|
|
6046
|
+
this._onDidRemoveGroup.fire(group);
|
|
5853
6047
|
}
|
|
6048
|
+
// iterate over a reassigned array since original array will be modified
|
|
6049
|
+
for (const floatingGroup of [...this.floatingGroups]) {
|
|
6050
|
+
floatingGroup.dispose();
|
|
6051
|
+
}
|
|
6052
|
+
// fires clean-up events and clears the underlying HTML gridview.
|
|
6053
|
+
this.clear();
|
|
6054
|
+
/**
|
|
6055
|
+
* even though we have cleaned-up we still want to inform the caller of their error
|
|
6056
|
+
* and we'll do this through re-throwing the original error since afterall you would
|
|
6057
|
+
* expect trying to load a corrupted layout to result in an error and not silently fail...
|
|
6058
|
+
*/
|
|
6059
|
+
throw err;
|
|
5854
6060
|
}
|
|
5855
6061
|
this._onDidLayoutFromJSON.fire();
|
|
5856
6062
|
}
|
|
@@ -6064,6 +6270,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
6064
6270
|
if (!(options === null || options === void 0 ? void 0 : options.skipDispose)) {
|
|
6065
6271
|
floatingGroup.group.dispose();
|
|
6066
6272
|
this._groups.delete(group.id);
|
|
6273
|
+
// TODO: fire group removed event?
|
|
6067
6274
|
}
|
|
6068
6275
|
floatingGroup.dispose();
|
|
6069
6276
|
return floatingGroup.group;
|
|
@@ -6186,7 +6393,11 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
6186
6393
|
const view = new DockviewGroupPanel(this, id, options);
|
|
6187
6394
|
view.init({ params: {}, accessor: null }); // required to initialized .part and allow for correct disposal of group
|
|
6188
6395
|
if (!this._groups.has(view.id)) {
|
|
6189
|
-
const disposable = new CompositeDisposable(view.model.
|
|
6396
|
+
const disposable = new CompositeDisposable(view.model.onTabDragStart((event) => {
|
|
6397
|
+
this._onWillDragPanel.fire(event);
|
|
6398
|
+
}), view.model.onGroupDragStart((event) => {
|
|
6399
|
+
this._onWillDragGroup.fire(event);
|
|
6400
|
+
}), view.model.onMove((event) => {
|
|
6190
6401
|
const { groupId, itemId, target, index } = event;
|
|
6191
6402
|
this.moveGroupOrPanel(view, groupId, itemId, target, index);
|
|
6192
6403
|
}), view.model.onDidDrop((event) => {
|
|
@@ -6225,13 +6436,6 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
6225
6436
|
var _a;
|
|
6226
6437
|
return (_a = Array.from(this._groups.values()).find((group) => group.value.model.containsPanel(panel))) === null || _a === void 0 ? void 0 : _a.value;
|
|
6227
6438
|
}
|
|
6228
|
-
dispose() {
|
|
6229
|
-
this._onDidActivePanelChange.dispose();
|
|
6230
|
-
this._onDidAddPanel.dispose();
|
|
6231
|
-
this._onDidRemovePanel.dispose();
|
|
6232
|
-
this._onDidLayoutFromJSON.dispose();
|
|
6233
|
-
super.dispose();
|
|
6234
|
-
}
|
|
6235
6439
|
}
|
|
6236
6440
|
|
|
6237
6441
|
class GridviewComponent extends BaseGrid {
|
|
@@ -6307,43 +6511,64 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
6307
6511
|
fromJSON(serializedGridview) {
|
|
6308
6512
|
this.clear();
|
|
6309
6513
|
const { grid, activePanel } = serializedGridview;
|
|
6310
|
-
|
|
6311
|
-
|
|
6312
|
-
|
|
6313
|
-
|
|
6314
|
-
|
|
6315
|
-
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
.
|
|
6321
|
-
|
|
6322
|
-
|
|
6323
|
-
|
|
6324
|
-
|
|
6325
|
-
|
|
6326
|
-
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
|
-
|
|
6330
|
-
|
|
6331
|
-
|
|
6332
|
-
|
|
6333
|
-
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
|
|
6344
|
-
|
|
6514
|
+
try {
|
|
6515
|
+
const queue = [];
|
|
6516
|
+
// take note of the existing dimensions
|
|
6517
|
+
const width = this.width;
|
|
6518
|
+
const height = this.height;
|
|
6519
|
+
this.gridview.deserialize(grid, {
|
|
6520
|
+
fromJSON: (node) => {
|
|
6521
|
+
const { data } = node;
|
|
6522
|
+
const view = createComponent(data.id, data.component, this.options.components || {}, this.options.frameworkComponents || {}, this.options.frameworkComponentFactory
|
|
6523
|
+
? {
|
|
6524
|
+
createComponent: this.options.frameworkComponentFactory
|
|
6525
|
+
.createComponent,
|
|
6526
|
+
}
|
|
6527
|
+
: undefined);
|
|
6528
|
+
queue.push(() => view.init({
|
|
6529
|
+
params: data.params,
|
|
6530
|
+
minimumWidth: data.minimumWidth,
|
|
6531
|
+
maximumWidth: data.maximumWidth,
|
|
6532
|
+
minimumHeight: data.minimumHeight,
|
|
6533
|
+
maximumHeight: data.maximumHeight,
|
|
6534
|
+
priority: data.priority,
|
|
6535
|
+
snap: !!data.snap,
|
|
6536
|
+
accessor: this,
|
|
6537
|
+
isVisible: node.visible,
|
|
6538
|
+
}));
|
|
6539
|
+
this._onDidAddGroup.fire(view);
|
|
6540
|
+
this.registerPanel(view);
|
|
6541
|
+
return view;
|
|
6542
|
+
},
|
|
6543
|
+
});
|
|
6544
|
+
this.layout(width, height, true);
|
|
6545
|
+
queue.forEach((f) => f());
|
|
6546
|
+
if (typeof activePanel === 'string') {
|
|
6547
|
+
const panel = this.getPanel(activePanel);
|
|
6548
|
+
if (panel) {
|
|
6549
|
+
this.doSetGroupActive(panel);
|
|
6550
|
+
}
|
|
6345
6551
|
}
|
|
6346
6552
|
}
|
|
6553
|
+
catch (err) {
|
|
6554
|
+
/**
|
|
6555
|
+
* To remove a group we cannot call this.removeGroup(...) since this makes assumptions about
|
|
6556
|
+
* the underlying HTMLElement existing in the Gridview.
|
|
6557
|
+
*/
|
|
6558
|
+
for (const group of this.groups) {
|
|
6559
|
+
group.dispose();
|
|
6560
|
+
this._groups.delete(group.id);
|
|
6561
|
+
this._onDidRemoveGroup.fire(group);
|
|
6562
|
+
}
|
|
6563
|
+
// fires clean-up events and clears the underlying HTML gridview.
|
|
6564
|
+
this.clear();
|
|
6565
|
+
/**
|
|
6566
|
+
* even though we have cleaned-up we still want to inform the caller of their error
|
|
6567
|
+
* and we'll do this through re-throwing the original error since afterall you would
|
|
6568
|
+
* expect trying to load a corrupted layout to result in an error and not silently fail...
|
|
6569
|
+
*/
|
|
6570
|
+
throw err;
|
|
6571
|
+
}
|
|
6347
6572
|
this._onDidLayoutfromJSON.fire();
|
|
6348
6573
|
}
|
|
6349
6574
|
clear() {
|