dockview-core 1.8.1 → 1.8.3
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 +15 -1
- package/dist/cjs/dockview/components/titlebar/tabsContainer.d.ts.map +1 -1
- package/dist/cjs/dockview/components/titlebar/tabsContainer.js +26 -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 +78 -36
- 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 +10 -4
- package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts.map +1 -1
- package/dist/cjs/dockview/dockviewGroupPanelModel.js +18 -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 +8 -5
- package/dist/cjs/dockview/options.d.ts.map +1 -1
- package/dist/cjs/dockview/options.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/gridviewComponent.d.ts +4 -4
- package/dist/cjs/gridview/gridviewComponent.d.ts.map +1 -1
- package/dist/cjs/gridview/gridviewComponent.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/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 +201 -104
- 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 +201 -104
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +201 -104
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +201 -104
- 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 +201 -104
- 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 +201 -104
- 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 +15 -1
- package/dist/esm/dockview/components/titlebar/tabsContainer.d.ts.map +1 -1
- package/dist/esm/dockview/components/titlebar/tabsContainer.js +26 -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 +44 -13
- 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 +10 -4
- package/dist/esm/dockview/dockviewGroupPanelModel.d.ts.map +1 -1
- package/dist/esm/dockview/dockviewGroupPanelModel.js +18 -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 +8 -5
- package/dist/esm/dockview/options.d.ts.map +1 -1
- package/dist/esm/dockview/options.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/gridviewComponent.d.ts +4 -4
- package/dist/esm/gridview/gridviewComponent.d.ts.map +1 -1
- package/dist/esm/gridview/gridviewComponent.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/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 +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-core
|
|
3
|
-
* @version 1.8.
|
|
3
|
+
* @version 1.8.3
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -268,9 +268,6 @@ class CompositeDisposable {
|
|
|
268
268
|
get isDisposed() {
|
|
269
269
|
return this._isDisposed;
|
|
270
270
|
}
|
|
271
|
-
static from(...args) {
|
|
272
|
-
return new CompositeDisposable(...args);
|
|
273
|
-
}
|
|
274
271
|
constructor(...args) {
|
|
275
272
|
this._isDisposed = false;
|
|
276
273
|
this._disposables = args;
|
|
@@ -2474,6 +2471,12 @@ class DockviewApi {
|
|
|
2474
2471
|
get onDidDrop() {
|
|
2475
2472
|
return this.component.onDidDrop;
|
|
2476
2473
|
}
|
|
2474
|
+
get onWillDragGroup() {
|
|
2475
|
+
return this.component.onWillDragGroup;
|
|
2476
|
+
}
|
|
2477
|
+
get onWillDragPanel() {
|
|
2478
|
+
return this.component.onWillDragPanel;
|
|
2479
|
+
}
|
|
2477
2480
|
get panels() {
|
|
2478
2481
|
return this.component.panels;
|
|
2479
2482
|
}
|
|
@@ -2936,7 +2939,7 @@ class DragHandler extends CompositeDisposable {
|
|
|
2936
2939
|
}
|
|
2937
2940
|
configure() {
|
|
2938
2941
|
this.addDisposables(this._onDragStart, addDisposableListener(this.el, 'dragstart', (event) => {
|
|
2939
|
-
if (this.isCancelled(event)) {
|
|
2942
|
+
if (event.defaultPrevented || this.isCancelled(event)) {
|
|
2940
2943
|
event.preventDefault();
|
|
2941
2944
|
return;
|
|
2942
2945
|
}
|
|
@@ -2956,19 +2959,23 @@ class DragHandler extends CompositeDisposable {
|
|
|
2956
2959
|
}
|
|
2957
2960
|
this.el.classList.add('dv-dragged');
|
|
2958
2961
|
setTimeout(() => this.el.classList.remove('dv-dragged'), 0);
|
|
2959
|
-
this.dataDisposable.value = this.getData(event
|
|
2962
|
+
this.dataDisposable.value = this.getData(event);
|
|
2963
|
+
this._onDragStart.fire(event);
|
|
2960
2964
|
if (event.dataTransfer) {
|
|
2961
2965
|
event.dataTransfer.effectAllowed = 'move';
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2966
|
+
const hasData = event.dataTransfer.items.length > 0;
|
|
2967
|
+
if (!hasData) {
|
|
2968
|
+
/**
|
|
2969
|
+
* Although this is not used by dockview many third party dnd libraries will check
|
|
2970
|
+
* dataTransfer.types to determine valid drag events.
|
|
2971
|
+
*
|
|
2972
|
+
* For example: in react-dnd if dataTransfer.types is not set then the dragStart event will be cancelled
|
|
2973
|
+
* through .preventDefault(). Since this is applied globally to all drag events this would break dockviews
|
|
2974
|
+
* dnd logic. You can see the code at
|
|
2975
|
+
* https://github.com/react-dnd/react-dnd/blob/main/packages/backend-html5/src/HTML5BackendImpl.ts#L542
|
|
2976
|
+
*/
|
|
2977
|
+
event.dataTransfer.setData('text/plain', '__dockview_internal_drag_event__');
|
|
2978
|
+
}
|
|
2972
2979
|
}
|
|
2973
2980
|
}), addDisposableListener(this.el, 'dragend', () => {
|
|
2974
2981
|
this.pointerEventsDisposable.dispose();
|
|
@@ -2977,44 +2984,45 @@ class DragHandler extends CompositeDisposable {
|
|
|
2977
2984
|
}
|
|
2978
2985
|
}
|
|
2979
2986
|
|
|
2987
|
+
class TabDragHandler extends DragHandler {
|
|
2988
|
+
constructor(element, accessor, group, panel) {
|
|
2989
|
+
super(element);
|
|
2990
|
+
this.accessor = accessor;
|
|
2991
|
+
this.group = group;
|
|
2992
|
+
this.panel = panel;
|
|
2993
|
+
this.panelTransfer = LocalSelectionTransfer.getInstance();
|
|
2994
|
+
}
|
|
2995
|
+
getData(event) {
|
|
2996
|
+
this.panelTransfer.setData([new PanelTransfer(this.accessor.id, this.group.id, this.panel.id)], PanelTransfer.prototype);
|
|
2997
|
+
return {
|
|
2998
|
+
dispose: () => {
|
|
2999
|
+
this.panelTransfer.clearData(PanelTransfer.prototype);
|
|
3000
|
+
},
|
|
3001
|
+
};
|
|
3002
|
+
}
|
|
3003
|
+
}
|
|
2980
3004
|
class Tab extends CompositeDisposable {
|
|
2981
3005
|
get element() {
|
|
2982
3006
|
return this._element;
|
|
2983
3007
|
}
|
|
2984
|
-
constructor(
|
|
3008
|
+
constructor(panel, accessor, group) {
|
|
2985
3009
|
super();
|
|
2986
|
-
this.
|
|
3010
|
+
this.panel = panel;
|
|
2987
3011
|
this.accessor = accessor;
|
|
2988
3012
|
this.group = group;
|
|
3013
|
+
this.content = undefined;
|
|
2989
3014
|
this._onChanged = new Emitter();
|
|
2990
3015
|
this.onChanged = this._onChanged.event;
|
|
2991
3016
|
this._onDropped = new Emitter();
|
|
2992
3017
|
this.onDrop = this._onDropped.event;
|
|
3018
|
+
this._onDragStart = new Emitter();
|
|
3019
|
+
this.onDragStart = this._onDragStart.event;
|
|
2993
3020
|
this._element = document.createElement('div');
|
|
2994
3021
|
this._element.className = 'tab';
|
|
2995
3022
|
this._element.tabIndex = 0;
|
|
2996
3023
|
this._element.draggable = true;
|
|
2997
3024
|
toggleClass(this.element, 'inactive-tab', true);
|
|
2998
|
-
this.
|
|
2999
|
-
constructor() {
|
|
3000
|
-
super(...arguments);
|
|
3001
|
-
this.panelTransfer = LocalSelectionTransfer.getInstance();
|
|
3002
|
-
}
|
|
3003
|
-
getData() {
|
|
3004
|
-
this.panelTransfer.setData([new PanelTransfer(accessor.id, group.id, panelId)], PanelTransfer.prototype);
|
|
3005
|
-
return {
|
|
3006
|
-
dispose: () => {
|
|
3007
|
-
this.panelTransfer.clearData(PanelTransfer.prototype);
|
|
3008
|
-
},
|
|
3009
|
-
};
|
|
3010
|
-
}
|
|
3011
|
-
})(this._element));
|
|
3012
|
-
this.addDisposables(addDisposableListener(this._element, 'mousedown', (event) => {
|
|
3013
|
-
if (event.defaultPrevented) {
|
|
3014
|
-
return;
|
|
3015
|
-
}
|
|
3016
|
-
this._onChanged.fire(event);
|
|
3017
|
-
}));
|
|
3025
|
+
const dragHandler = new TabDragHandler(this._element, this.accessor, this.group, this.panel);
|
|
3018
3026
|
this.droptarget = new Droptarget(this._element, {
|
|
3019
3027
|
acceptedTargetZones: ['center'],
|
|
3020
3028
|
canDisplayOverlay: (event, position) => {
|
|
@@ -3028,12 +3036,19 @@ class Tab extends CompositeDisposable {
|
|
|
3028
3036
|
// don't allow group move to drop on self
|
|
3029
3037
|
return false;
|
|
3030
3038
|
}
|
|
3031
|
-
return this.
|
|
3039
|
+
return this.panel.id !== data.panelId;
|
|
3032
3040
|
}
|
|
3033
3041
|
return this.group.model.canDisplayOverlay(event, position, DockviewDropTargets.Tab);
|
|
3034
3042
|
},
|
|
3035
3043
|
});
|
|
3036
|
-
this.addDisposables(this.
|
|
3044
|
+
this.addDisposables(this._onChanged, this._onDropped, this._onDragStart, dragHandler.onDragStart((event) => {
|
|
3045
|
+
this._onDragStart.fire(event);
|
|
3046
|
+
}), dragHandler, addDisposableListener(this._element, 'mousedown', (event) => {
|
|
3047
|
+
if (event.defaultPrevented) {
|
|
3048
|
+
return;
|
|
3049
|
+
}
|
|
3050
|
+
this._onChanged.fire(event);
|
|
3051
|
+
}), this.droptarget.onDrop((event) => {
|
|
3037
3052
|
this._onDropped.fire(event);
|
|
3038
3053
|
}), this.droptarget);
|
|
3039
3054
|
}
|
|
@@ -3065,9 +3080,9 @@ function addGhostImage(dataTransfer, ghostElement) {
|
|
|
3065
3080
|
}
|
|
3066
3081
|
|
|
3067
3082
|
class GroupDragHandler extends DragHandler {
|
|
3068
|
-
constructor(element,
|
|
3083
|
+
constructor(element, accessor, group) {
|
|
3069
3084
|
super(element);
|
|
3070
|
-
this.
|
|
3085
|
+
this.accessor = accessor;
|
|
3071
3086
|
this.group = group;
|
|
3072
3087
|
this.panelTransfer = LocalSelectionTransfer.getInstance();
|
|
3073
3088
|
this.addDisposables(addDisposableListener(element, 'mousedown', (e) => {
|
|
@@ -3087,8 +3102,9 @@ class GroupDragHandler extends DragHandler {
|
|
|
3087
3102
|
}
|
|
3088
3103
|
return false;
|
|
3089
3104
|
}
|
|
3090
|
-
getData(
|
|
3091
|
-
|
|
3105
|
+
getData(dragEvent) {
|
|
3106
|
+
const dataTransfer = dragEvent.dataTransfer;
|
|
3107
|
+
this.panelTransfer.setData([new PanelTransfer(this.accessor.id, this.group.id, null)], PanelTransfer.prototype);
|
|
3092
3108
|
const style = window.getComputedStyle(this.el);
|
|
3093
3109
|
const bgColor = style.getPropertyValue('--dv-activegroup-visiblepanel-tab-background-color');
|
|
3094
3110
|
const color = style.getPropertyValue('--dv-activegroup-visiblepanel-tab-color');
|
|
@@ -3123,14 +3139,16 @@ class VoidContainer extends CompositeDisposable {
|
|
|
3123
3139
|
this.group = group;
|
|
3124
3140
|
this._onDrop = new Emitter();
|
|
3125
3141
|
this.onDrop = this._onDrop.event;
|
|
3142
|
+
this._onDragStart = new Emitter();
|
|
3143
|
+
this.onDragStart = this._onDragStart.event;
|
|
3126
3144
|
this._element = document.createElement('div');
|
|
3127
3145
|
this._element.className = 'void-container';
|
|
3128
3146
|
this._element.tabIndex = 0;
|
|
3129
3147
|
this._element.draggable = true;
|
|
3130
|
-
this.addDisposables(this._onDrop, addDisposableListener(this._element, 'click', () => {
|
|
3148
|
+
this.addDisposables(this._onDrop, this._onDragStart, addDisposableListener(this._element, 'click', () => {
|
|
3131
3149
|
this.accessor.doSetGroupActive(this.group);
|
|
3132
3150
|
}));
|
|
3133
|
-
const handler = new GroupDragHandler(this._element, accessor
|
|
3151
|
+
const handler = new GroupDragHandler(this._element, accessor, group);
|
|
3134
3152
|
this.voidDropTarget = new Droptarget(this._element, {
|
|
3135
3153
|
acceptedTargetZones: ['center'],
|
|
3136
3154
|
canDisplayOverlay: (event, position) => {
|
|
@@ -3148,7 +3166,9 @@ class VoidContainer extends CompositeDisposable {
|
|
|
3148
3166
|
return group.model.canDisplayOverlay(event, position, DockviewDropTargets.Panel);
|
|
3149
3167
|
},
|
|
3150
3168
|
});
|
|
3151
|
-
this.addDisposables(handler,
|
|
3169
|
+
this.addDisposables(handler, handler.onDragStart((event) => {
|
|
3170
|
+
this._onDragStart.fire(event);
|
|
3171
|
+
}), this.voidDropTarget.onDrop((event) => {
|
|
3152
3172
|
this._onDrop.fire(event);
|
|
3153
3173
|
}), this.voidDropTarget);
|
|
3154
3174
|
}
|
|
@@ -3156,7 +3176,7 @@ class VoidContainer extends CompositeDisposable {
|
|
|
3156
3176
|
|
|
3157
3177
|
class TabsContainer extends CompositeDisposable {
|
|
3158
3178
|
get panels() {
|
|
3159
|
-
return this.tabs.map((_) => _.value.
|
|
3179
|
+
return this.tabs.map((_) => _.value.panel.id);
|
|
3160
3180
|
}
|
|
3161
3181
|
get size() {
|
|
3162
3182
|
return this.tabs.length;
|
|
@@ -3210,7 +3230,7 @@ class TabsContainer extends CompositeDisposable {
|
|
|
3210
3230
|
this.tabs[this.selectedIndex].value === tab);
|
|
3211
3231
|
}
|
|
3212
3232
|
indexOf(id) {
|
|
3213
|
-
return this.tabs.findIndex((tab) => tab.value.
|
|
3233
|
+
return this.tabs.findIndex((tab) => tab.value.panel.id === id);
|
|
3214
3234
|
}
|
|
3215
3235
|
constructor(accessor, group) {
|
|
3216
3236
|
super();
|
|
@@ -3221,7 +3241,11 @@ class TabsContainer extends CompositeDisposable {
|
|
|
3221
3241
|
this._hidden = false;
|
|
3222
3242
|
this._onDrop = new Emitter();
|
|
3223
3243
|
this.onDrop = this._onDrop.event;
|
|
3224
|
-
this.
|
|
3244
|
+
this._onTabDragStart = new Emitter();
|
|
3245
|
+
this.onTabDragStart = this._onTabDragStart.event;
|
|
3246
|
+
this._onGroupDragStart = new Emitter();
|
|
3247
|
+
this.onGroupDragStart = this._onGroupDragStart.event;
|
|
3248
|
+
this.addDisposables(this._onDrop, this._onTabDragStart, this._onGroupDragStart);
|
|
3225
3249
|
this._element = document.createElement('div');
|
|
3226
3250
|
this._element.className = 'tabs-and-actions-container';
|
|
3227
3251
|
toggleClass(this._element, 'dv-full-width-single-tab', this.accessor.options.singleTabMode === 'fullwidth');
|
|
@@ -3245,7 +3269,12 @@ class TabsContainer extends CompositeDisposable {
|
|
|
3245
3269
|
this._element.appendChild(this.leftActionsContainer);
|
|
3246
3270
|
this._element.appendChild(this.voidContainer.element);
|
|
3247
3271
|
this._element.appendChild(this.rightActionsContainer);
|
|
3248
|
-
this.addDisposables(this.voidContainer, this.voidContainer.
|
|
3272
|
+
this.addDisposables(this.voidContainer, this.voidContainer.onDragStart((event) => {
|
|
3273
|
+
this._onGroupDragStart.fire({
|
|
3274
|
+
nativeEvent: event,
|
|
3275
|
+
group: this.group,
|
|
3276
|
+
});
|
|
3277
|
+
}), this.voidContainer.onDrop((event) => {
|
|
3249
3278
|
this._onDrop.fire({
|
|
3250
3279
|
event: event.nativeEvent,
|
|
3251
3280
|
index: this.tabs.length,
|
|
@@ -3291,7 +3320,7 @@ class TabsContainer extends CompositeDisposable {
|
|
|
3291
3320
|
}
|
|
3292
3321
|
}
|
|
3293
3322
|
delete(id) {
|
|
3294
|
-
const index = this.tabs.findIndex((tab) => tab.value.
|
|
3323
|
+
const index = this.tabs.findIndex((tab) => tab.value.panel.id === id);
|
|
3295
3324
|
const tabToRemove = this.tabs.splice(index, 1)[0];
|
|
3296
3325
|
const { value, disposable } = tabToRemove;
|
|
3297
3326
|
disposable.dispose();
|
|
@@ -3300,21 +3329,23 @@ class TabsContainer extends CompositeDisposable {
|
|
|
3300
3329
|
}
|
|
3301
3330
|
setActivePanel(panel) {
|
|
3302
3331
|
this.tabs.forEach((tab) => {
|
|
3303
|
-
const isActivePanel = panel.id === tab.value.
|
|
3332
|
+
const isActivePanel = panel.id === tab.value.panel.id;
|
|
3304
3333
|
tab.value.setActive(isActivePanel);
|
|
3305
3334
|
});
|
|
3306
3335
|
}
|
|
3307
3336
|
openPanel(panel, index = this.tabs.length) {
|
|
3308
3337
|
var _a;
|
|
3309
|
-
if (this.tabs.find((tab) => tab.value.
|
|
3338
|
+
if (this.tabs.find((tab) => tab.value.panel.id === panel.id)) {
|
|
3310
3339
|
return;
|
|
3311
3340
|
}
|
|
3312
|
-
const
|
|
3341
|
+
const tab = new Tab(panel, this.accessor, this.group);
|
|
3313
3342
|
if (!((_a = panel.view) === null || _a === void 0 ? void 0 : _a.tab)) {
|
|
3314
3343
|
throw new Error('invalid header component');
|
|
3315
3344
|
}
|
|
3316
|
-
|
|
3317
|
-
const disposable = CompositeDisposable
|
|
3345
|
+
tab.setContent(panel.view.tab);
|
|
3346
|
+
const disposable = new CompositeDisposable(tab.onDragStart((event) => {
|
|
3347
|
+
this._onTabDragStart.fire({ nativeEvent: event, panel });
|
|
3348
|
+
}), tab.onChanged((event) => {
|
|
3318
3349
|
var _a;
|
|
3319
3350
|
const isFloatingGroupsEnabled = !this.accessor.options.disableFloatingGroups;
|
|
3320
3351
|
const isFloatingWithOnePanel = this.group.api.isFloating && this.size === 1;
|
|
@@ -3322,8 +3353,8 @@ class TabsContainer extends CompositeDisposable {
|
|
|
3322
3353
|
!isFloatingWithOnePanel &&
|
|
3323
3354
|
event.shiftKey) {
|
|
3324
3355
|
event.preventDefault();
|
|
3325
|
-
const panel = this.accessor.getGroupPanel(
|
|
3326
|
-
const { top, left } =
|
|
3356
|
+
const panel = this.accessor.getGroupPanel(tab.panel.id);
|
|
3357
|
+
const { top, left } = tab.element.getBoundingClientRect();
|
|
3327
3358
|
const { top: rootTop, left: rootLeft } = this.accessor.element.getBoundingClientRect();
|
|
3328
3359
|
this.accessor.addFloatingGroup(panel, {
|
|
3329
3360
|
x: left - rootLeft,
|
|
@@ -3340,13 +3371,13 @@ class TabsContainer extends CompositeDisposable {
|
|
|
3340
3371
|
this.group.model.openPanel(panel, {
|
|
3341
3372
|
skipFocus: alreadyFocused,
|
|
3342
3373
|
});
|
|
3343
|
-
}),
|
|
3374
|
+
}), tab.onDrop((event) => {
|
|
3344
3375
|
this._onDrop.fire({
|
|
3345
3376
|
event: event.nativeEvent,
|
|
3346
|
-
index: this.tabs.findIndex((x) => x.value ===
|
|
3377
|
+
index: this.tabs.findIndex((x) => x.value === tab),
|
|
3347
3378
|
});
|
|
3348
3379
|
}));
|
|
3349
|
-
const value = { value:
|
|
3380
|
+
const value = { value: tab, disposable };
|
|
3350
3381
|
this.addTab(value, index);
|
|
3351
3382
|
}
|
|
3352
3383
|
closePanel(panel) {
|
|
@@ -3374,7 +3405,7 @@ class DockviewGroupPanelModel extends CompositeDisposable {
|
|
|
3374
3405
|
}
|
|
3375
3406
|
set locked(value) {
|
|
3376
3407
|
this._locked = value;
|
|
3377
|
-
toggleClass(this.container, 'locked-groupview', value);
|
|
3408
|
+
toggleClass(this.container, 'locked-groupview', value === 'no-drop-target' || value);
|
|
3378
3409
|
}
|
|
3379
3410
|
get isActive() {
|
|
3380
3411
|
return this._isGroupActive;
|
|
@@ -3431,6 +3462,10 @@ class DockviewGroupPanelModel extends CompositeDisposable {
|
|
|
3431
3462
|
this.onMove = this._onMove.event;
|
|
3432
3463
|
this._onDidDrop = new Emitter();
|
|
3433
3464
|
this.onDidDrop = this._onDidDrop.event;
|
|
3465
|
+
this._onTabDragStart = new Emitter();
|
|
3466
|
+
this.onTabDragStart = this._onTabDragStart.event;
|
|
3467
|
+
this._onGroupDragStart = new Emitter();
|
|
3468
|
+
this.onGroupDragStart = this._onGroupDragStart.event;
|
|
3434
3469
|
this._onDidAddPanel = new Emitter();
|
|
3435
3470
|
this.onDidAddPanel = this._onDidAddPanel.event;
|
|
3436
3471
|
this._onDidRemovePanel = new Emitter();
|
|
@@ -3443,7 +3478,8 @@ class DockviewGroupPanelModel extends CompositeDisposable {
|
|
|
3443
3478
|
this.dropTarget = new Droptarget(this.contentContainer.element, {
|
|
3444
3479
|
acceptedTargetZones: ['top', 'bottom', 'left', 'right', 'center'],
|
|
3445
3480
|
canDisplayOverlay: (event, position) => {
|
|
3446
|
-
if (this.locked
|
|
3481
|
+
if (this.locked === 'no-drop-target' ||
|
|
3482
|
+
(this.locked && position === 'center')) {
|
|
3447
3483
|
return false;
|
|
3448
3484
|
}
|
|
3449
3485
|
const data = getPanelData();
|
|
@@ -3469,8 +3505,12 @@ class DockviewGroupPanelModel extends CompositeDisposable {
|
|
|
3469
3505
|
});
|
|
3470
3506
|
container.append(this.tabsContainer.element, this.contentContainer.element);
|
|
3471
3507
|
this.header.hidden = !!options.hideHeader;
|
|
3472
|
-
this.locked =
|
|
3473
|
-
this.addDisposables(this.tabsContainer.
|
|
3508
|
+
this.locked = options.locked || false;
|
|
3509
|
+
this.addDisposables(this._onTabDragStart, this._onGroupDragStart, this.tabsContainer.onTabDragStart((event) => {
|
|
3510
|
+
this._onTabDragStart.fire(event);
|
|
3511
|
+
}), this.tabsContainer.onGroupDragStart((event) => {
|
|
3512
|
+
this._onGroupDragStart.fire(event);
|
|
3513
|
+
}), this.tabsContainer.onDrop((event) => {
|
|
3474
3514
|
this.handleDropEvent(event.event, 'center', event.index);
|
|
3475
3515
|
}), this.contentContainer.onDidFocus(() => {
|
|
3476
3516
|
this.accessor.doSetGroupActive(this.groupPanel, true);
|
|
@@ -3525,8 +3565,8 @@ class DockviewGroupPanelModel extends CompositeDisposable {
|
|
|
3525
3565
|
activeView: (_a = this._activePanel) === null || _a === void 0 ? void 0 : _a.id,
|
|
3526
3566
|
id: this.id,
|
|
3527
3567
|
};
|
|
3528
|
-
if (this.locked) {
|
|
3529
|
-
result.locked =
|
|
3568
|
+
if (this.locked !== false) {
|
|
3569
|
+
result.locked = this.locked;
|
|
3530
3570
|
}
|
|
3531
3571
|
if (this.header.hidden) {
|
|
3532
3572
|
result.hideHeader = true;
|
|
@@ -3776,6 +3816,9 @@ class DockviewGroupPanelModel extends CompositeDisposable {
|
|
|
3776
3816
|
return false;
|
|
3777
3817
|
}
|
|
3778
3818
|
handleDropEvent(event, position, index) {
|
|
3819
|
+
if (this.locked === 'no-drop-target') {
|
|
3820
|
+
return;
|
|
3821
|
+
}
|
|
3779
3822
|
const data = getPanelData();
|
|
3780
3823
|
if (data && data.viewId === this.accessor.id) {
|
|
3781
3824
|
if (data.panelId === null) {
|
|
@@ -5233,6 +5276,12 @@ const bringElementToFront = (() => {
|
|
|
5233
5276
|
return pushToTop;
|
|
5234
5277
|
})();
|
|
5235
5278
|
class Overlay extends CompositeDisposable {
|
|
5279
|
+
set minimumInViewportWidth(value) {
|
|
5280
|
+
this.options.minimumInViewportWidth = value;
|
|
5281
|
+
}
|
|
5282
|
+
set minimumInViewportHeight(value) {
|
|
5283
|
+
this.options.minimumInViewportHeight = value;
|
|
5284
|
+
}
|
|
5236
5285
|
constructor(options) {
|
|
5237
5286
|
super();
|
|
5238
5287
|
this.options = options;
|
|
@@ -5278,9 +5327,11 @@ class Overlay extends CompositeDisposable {
|
|
|
5278
5327
|
const overlayRect = this._element.getBoundingClientRect();
|
|
5279
5328
|
// region: ensure bounds within allowable limits
|
|
5280
5329
|
// a minimum width of minimumViewportWidth must be inside the viewport
|
|
5281
|
-
const xOffset = Math.max(0, overlayRect.width
|
|
5330
|
+
const xOffset = Math.max(0, this.getMinimumWidth(overlayRect.width));
|
|
5282
5331
|
// a minimum height of minimumViewportHeight must be inside the viewport
|
|
5283
|
-
const yOffset =
|
|
5332
|
+
const yOffset = typeof this.options.minimumInViewportHeight === 'number'
|
|
5333
|
+
? Math.max(0, this.getMinimumHeight(overlayRect.height))
|
|
5334
|
+
: 0;
|
|
5284
5335
|
const left = clamp(overlayRect.left - containerRect.left, -xOffset, Math.max(0, containerRect.width - overlayRect.width + xOffset));
|
|
5285
5336
|
const top = clamp(overlayRect.top - containerRect.top, -yOffset, Math.max(0, containerRect.height - overlayRect.height + yOffset));
|
|
5286
5337
|
this._element.style.left = `${left}px`;
|
|
@@ -5326,9 +5377,10 @@ class Overlay extends CompositeDisposable {
|
|
|
5326
5377
|
y: e.clientY - overlayRect.top,
|
|
5327
5378
|
};
|
|
5328
5379
|
}
|
|
5329
|
-
const xOffset = Math.max(0, overlayRect.width
|
|
5330
|
-
const yOffset = Math.max(0,
|
|
5331
|
-
this.
|
|
5380
|
+
const xOffset = Math.max(0, this.getMinimumWidth(overlayRect.width));
|
|
5381
|
+
const yOffset = Math.max(0, this.options.minimumInViewportHeight
|
|
5382
|
+
? this.getMinimumHeight(overlayRect.height)
|
|
5383
|
+
: 0);
|
|
5332
5384
|
const left = clamp(x - offset.x, -xOffset, Math.max(0, containerRect.width - overlayRect.width + xOffset));
|
|
5333
5385
|
const top = clamp(y - offset.y, -yOffset, Math.max(0, containerRect.height - overlayRect.height + yOffset));
|
|
5334
5386
|
this.setBounds({ top, left });
|
|
@@ -5402,14 +5454,11 @@ class Overlay extends CompositeDisposable {
|
|
|
5402
5454
|
let height = undefined;
|
|
5403
5455
|
let left = undefined;
|
|
5404
5456
|
let width = undefined;
|
|
5405
|
-
const
|
|
5406
|
-
const minimumInViewportWidth = this.options.minimumInViewportWidth;
|
|
5407
|
-
function moveTop() {
|
|
5457
|
+
const moveTop = () => {
|
|
5408
5458
|
top = clamp(y, -Number.MAX_VALUE, startPosition.originalY +
|
|
5409
5459
|
startPosition.originalHeight >
|
|
5410
5460
|
containerRect.height
|
|
5411
|
-
? containerRect.height
|
|
5412
|
-
minimumInViewportHeight
|
|
5461
|
+
? this.getMinimumHeight(containerRect.height)
|
|
5413
5462
|
: Math.max(0, startPosition.originalY +
|
|
5414
5463
|
startPosition.originalHeight -
|
|
5415
5464
|
Overlay.MINIMUM_HEIGHT));
|
|
@@ -5417,21 +5466,23 @@ class Overlay extends CompositeDisposable {
|
|
|
5417
5466
|
startPosition.originalY +
|
|
5418
5467
|
startPosition.originalHeight -
|
|
5419
5468
|
top;
|
|
5420
|
-
}
|
|
5421
|
-
|
|
5469
|
+
};
|
|
5470
|
+
const moveBottom = () => {
|
|
5422
5471
|
top =
|
|
5423
5472
|
startPosition.originalY -
|
|
5424
5473
|
startPosition.originalHeight;
|
|
5425
|
-
height = clamp(y - top, top < 0
|
|
5426
|
-
|
|
5474
|
+
height = clamp(y - top, top < 0 &&
|
|
5475
|
+
typeof this.options
|
|
5476
|
+
.minimumInViewportHeight === 'number'
|
|
5477
|
+
? -top +
|
|
5478
|
+
this.options.minimumInViewportHeight
|
|
5427
5479
|
: Overlay.MINIMUM_HEIGHT, Number.MAX_VALUE);
|
|
5428
|
-
}
|
|
5429
|
-
|
|
5480
|
+
};
|
|
5481
|
+
const moveLeft = () => {
|
|
5430
5482
|
left = clamp(x, -Number.MAX_VALUE, startPosition.originalX +
|
|
5431
5483
|
startPosition.originalWidth >
|
|
5432
5484
|
containerRect.width
|
|
5433
|
-
? containerRect.width
|
|
5434
|
-
minimumInViewportWidth
|
|
5485
|
+
? this.getMinimumWidth(containerRect.width)
|
|
5435
5486
|
: Math.max(0, startPosition.originalX +
|
|
5436
5487
|
startPosition.originalWidth -
|
|
5437
5488
|
Overlay.MINIMUM_WIDTH));
|
|
@@ -5439,15 +5490,18 @@ class Overlay extends CompositeDisposable {
|
|
|
5439
5490
|
startPosition.originalX +
|
|
5440
5491
|
startPosition.originalWidth -
|
|
5441
5492
|
left;
|
|
5442
|
-
}
|
|
5443
|
-
|
|
5493
|
+
};
|
|
5494
|
+
const moveRight = () => {
|
|
5444
5495
|
left =
|
|
5445
5496
|
startPosition.originalX -
|
|
5446
5497
|
startPosition.originalWidth;
|
|
5447
|
-
width = clamp(x - left, left < 0
|
|
5448
|
-
|
|
5498
|
+
width = clamp(x - left, left < 0 &&
|
|
5499
|
+
typeof this.options
|
|
5500
|
+
.minimumInViewportWidth === 'number'
|
|
5501
|
+
? -left +
|
|
5502
|
+
this.options.minimumInViewportWidth
|
|
5449
5503
|
: Overlay.MINIMUM_WIDTH, Number.MAX_VALUE);
|
|
5450
|
-
}
|
|
5504
|
+
};
|
|
5451
5505
|
switch (direction) {
|
|
5452
5506
|
case 'top':
|
|
5453
5507
|
moveTop();
|
|
@@ -5491,6 +5545,18 @@ class Overlay extends CompositeDisposable {
|
|
|
5491
5545
|
}));
|
|
5492
5546
|
}));
|
|
5493
5547
|
}
|
|
5548
|
+
getMinimumWidth(width) {
|
|
5549
|
+
if (typeof this.options.minimumInViewportWidth === 'number') {
|
|
5550
|
+
return width - this.options.minimumInViewportWidth;
|
|
5551
|
+
}
|
|
5552
|
+
return 0;
|
|
5553
|
+
}
|
|
5554
|
+
getMinimumHeight(height) {
|
|
5555
|
+
if (typeof this.options.minimumInViewportHeight === 'number') {
|
|
5556
|
+
return height - this.options.minimumInViewportHeight;
|
|
5557
|
+
}
|
|
5558
|
+
return height;
|
|
5559
|
+
}
|
|
5494
5560
|
dispose() {
|
|
5495
5561
|
this._element.remove();
|
|
5496
5562
|
super.dispose();
|
|
@@ -5511,6 +5577,7 @@ class DockviewFloatingGroupPanel extends CompositeDisposable {
|
|
|
5511
5577
|
}
|
|
5512
5578
|
}
|
|
5513
5579
|
|
|
5580
|
+
const DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE = 100;
|
|
5514
5581
|
class DockviewComponent extends BaseGrid {
|
|
5515
5582
|
get orientation() {
|
|
5516
5583
|
return this.gridview.orientation;
|
|
@@ -5541,6 +5608,10 @@ class DockviewComponent extends BaseGrid {
|
|
|
5541
5608
|
this.nextGroupId = sequentialNumberGenerator();
|
|
5542
5609
|
this._deserializer = new DefaultDockviewDeserialzier(this);
|
|
5543
5610
|
this.watermark = null;
|
|
5611
|
+
this._onWillDragPanel = new Emitter();
|
|
5612
|
+
this.onWillDragPanel = this._onWillDragPanel.event;
|
|
5613
|
+
this._onWillDragGroup = new Emitter();
|
|
5614
|
+
this.onWillDragGroup = this._onWillDragGroup.event;
|
|
5544
5615
|
this._onDidDrop = new Emitter();
|
|
5545
5616
|
this.onDidDrop = this._onDidDrop.event;
|
|
5546
5617
|
this._onDidRemovePanel = new Emitter();
|
|
@@ -5553,7 +5624,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
5553
5624
|
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
5554
5625
|
this.floatingGroups = [];
|
|
5555
5626
|
toggleClass(this.gridview.element, 'dv-dockview', true);
|
|
5556
|
-
this.addDisposables(this._onDidDrop, Event.any(this.onDidAddGroup, this.onDidRemoveGroup)(() => {
|
|
5627
|
+
this.addDisposables(this._onWillDragPanel, this._onWillDragGroup, this._onDidActivePanelChange, this._onDidAddPanel, this._onDidRemovePanel, this._onDidLayoutFromJSON, this._onDidDrop, Event.any(this.onDidAddGroup, this.onDidRemoveGroup)(() => {
|
|
5557
5628
|
this.updateWatermark();
|
|
5558
5629
|
}), Event.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidActivePanelChange)(() => {
|
|
5559
5630
|
this._bufferOnDidLayoutChange.fire();
|
|
@@ -5590,7 +5661,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
5590
5661
|
return true;
|
|
5591
5662
|
}
|
|
5592
5663
|
if (this.options.showDndOverlay) {
|
|
5593
|
-
if (position === 'center') {
|
|
5664
|
+
if (position === 'center' && this.gridview.length !== 0) {
|
|
5594
5665
|
/**
|
|
5595
5666
|
* for external events only show the four-corner drag overlays, disable
|
|
5596
5667
|
* the center position so that external drag events can fall through to the group
|
|
@@ -5626,7 +5697,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
5626
5697
|
this.updateWatermark();
|
|
5627
5698
|
}
|
|
5628
5699
|
addFloatingGroup(item, coord, options) {
|
|
5629
|
-
var _a, _b;
|
|
5700
|
+
var _a, _b, _c, _d, _e, _f;
|
|
5630
5701
|
let group;
|
|
5631
5702
|
if (item instanceof DockviewPanel) {
|
|
5632
5703
|
group = this.createGroup();
|
|
@@ -5654,8 +5725,12 @@ class DockviewComponent extends BaseGrid {
|
|
|
5654
5725
|
width: (_b = coord === null || coord === void 0 ? void 0 : coord.width) !== null && _b !== void 0 ? _b : 300,
|
|
5655
5726
|
left: overlayLeft,
|
|
5656
5727
|
top: overlayTop,
|
|
5657
|
-
minimumInViewportWidth:
|
|
5658
|
-
|
|
5728
|
+
minimumInViewportWidth: this.options.floatingGroupBounds === 'boundedWithinViewport'
|
|
5729
|
+
? undefined
|
|
5730
|
+
: (_d = (_c = this.options.floatingGroupBounds) === null || _c === void 0 ? void 0 : _c.minimumWidthWithinViewport) !== null && _d !== void 0 ? _d : DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE,
|
|
5731
|
+
minimumInViewportHeight: this.options.floatingGroupBounds === 'boundedWithinViewport'
|
|
5732
|
+
? undefined
|
|
5733
|
+
: (_f = (_e = this.options.floatingGroupBounds) === null || _e === void 0 ? void 0 : _e.minimumHeightWithinViewport) !== null && _f !== void 0 ? _f : DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE,
|
|
5659
5734
|
});
|
|
5660
5735
|
const el = group.element.querySelector('.void-container');
|
|
5661
5736
|
if (!el) {
|
|
@@ -5726,12 +5801,37 @@ class DockviewComponent extends BaseGrid {
|
|
|
5726
5801
|
}
|
|
5727
5802
|
}
|
|
5728
5803
|
updateOptions(options) {
|
|
5804
|
+
var _a, _b;
|
|
5729
5805
|
const hasOrientationChanged = typeof options.orientation === 'string' &&
|
|
5730
5806
|
this.gridview.orientation !== options.orientation;
|
|
5807
|
+
const hasFloatingGroupOptionsChanged = options.floatingGroupBounds !== undefined &&
|
|
5808
|
+
options.floatingGroupBounds !== this.options.floatingGroupBounds;
|
|
5731
5809
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
5732
5810
|
if (hasOrientationChanged) {
|
|
5733
5811
|
this.gridview.orientation = options.orientation;
|
|
5734
5812
|
}
|
|
5813
|
+
if (hasFloatingGroupOptionsChanged) {
|
|
5814
|
+
for (const group of this.floatingGroups) {
|
|
5815
|
+
switch (this.options.floatingGroupBounds) {
|
|
5816
|
+
case 'boundedWithinViewport':
|
|
5817
|
+
group.overlay.minimumInViewportHeight = undefined;
|
|
5818
|
+
group.overlay.minimumInViewportWidth = undefined;
|
|
5819
|
+
break;
|
|
5820
|
+
case undefined:
|
|
5821
|
+
group.overlay.minimumInViewportHeight =
|
|
5822
|
+
DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE;
|
|
5823
|
+
group.overlay.minimumInViewportWidth =
|
|
5824
|
+
DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE;
|
|
5825
|
+
break;
|
|
5826
|
+
default:
|
|
5827
|
+
group.overlay.minimumInViewportHeight =
|
|
5828
|
+
(_a = this.options.floatingGroupBounds) === null || _a === void 0 ? void 0 : _a.minimumHeightWithinViewport;
|
|
5829
|
+
group.overlay.minimumInViewportWidth =
|
|
5830
|
+
(_b = this.options.floatingGroupBounds) === null || _b === void 0 ? void 0 : _b.minimumWidthWithinViewport;
|
|
5831
|
+
}
|
|
5832
|
+
group.overlay.setBounds({});
|
|
5833
|
+
}
|
|
5834
|
+
}
|
|
5735
5835
|
this.layout(this.gridview.width, this.gridview.height, true);
|
|
5736
5836
|
}
|
|
5737
5837
|
layout(width, height, forceResize) {
|
|
@@ -6214,7 +6314,11 @@ class DockviewComponent extends BaseGrid {
|
|
|
6214
6314
|
const view = new DockviewGroupPanel(this, id, options);
|
|
6215
6315
|
view.init({ params: {}, accessor: null }); // required to initialized .part and allow for correct disposal of group
|
|
6216
6316
|
if (!this._groups.has(view.id)) {
|
|
6217
|
-
const disposable = new CompositeDisposable(view.model.
|
|
6317
|
+
const disposable = new CompositeDisposable(view.model.onTabDragStart((event) => {
|
|
6318
|
+
this._onWillDragPanel.fire(event);
|
|
6319
|
+
}), view.model.onGroupDragStart((event) => {
|
|
6320
|
+
this._onWillDragGroup.fire(event);
|
|
6321
|
+
}), view.model.onMove((event) => {
|
|
6218
6322
|
const { groupId, itemId, target, index } = event;
|
|
6219
6323
|
this.moveGroupOrPanel(view, groupId, itemId, target, index);
|
|
6220
6324
|
}), view.model.onDidDrop((event) => {
|
|
@@ -6253,13 +6357,6 @@ class DockviewComponent extends BaseGrid {
|
|
|
6253
6357
|
var _a;
|
|
6254
6358
|
return (_a = Array.from(this._groups.values()).find((group) => group.value.model.containsPanel(panel))) === null || _a === void 0 ? void 0 : _a.value;
|
|
6255
6359
|
}
|
|
6256
|
-
dispose() {
|
|
6257
|
-
this._onDidActivePanelChange.dispose();
|
|
6258
|
-
this._onDidAddPanel.dispose();
|
|
6259
|
-
this._onDidRemovePanel.dispose();
|
|
6260
|
-
this._onDidLayoutFromJSON.dispose();
|
|
6261
|
-
super.dispose();
|
|
6262
|
-
}
|
|
6263
6360
|
}
|
|
6264
6361
|
|
|
6265
6362
|
class GridviewComponent extends BaseGrid {
|