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
|
*/
|
|
@@ -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;
|
|
@@ -2446,6 +2443,12 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2446
2443
|
get onDidDrop() {
|
|
2447
2444
|
return this.component.onDidDrop;
|
|
2448
2445
|
}
|
|
2446
|
+
get onWillDragGroup() {
|
|
2447
|
+
return this.component.onWillDragGroup;
|
|
2448
|
+
}
|
|
2449
|
+
get onWillDragPanel() {
|
|
2450
|
+
return this.component.onWillDragPanel;
|
|
2451
|
+
}
|
|
2449
2452
|
get panels() {
|
|
2450
2453
|
return this.component.panels;
|
|
2451
2454
|
}
|
|
@@ -2908,7 +2911,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2908
2911
|
}
|
|
2909
2912
|
configure() {
|
|
2910
2913
|
this.addDisposables(this._onDragStart, addDisposableListener(this.el, 'dragstart', (event) => {
|
|
2911
|
-
if (this.isCancelled(event)) {
|
|
2914
|
+
if (event.defaultPrevented || this.isCancelled(event)) {
|
|
2912
2915
|
event.preventDefault();
|
|
2913
2916
|
return;
|
|
2914
2917
|
}
|
|
@@ -2928,19 +2931,23 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2928
2931
|
}
|
|
2929
2932
|
this.el.classList.add('dv-dragged');
|
|
2930
2933
|
setTimeout(() => this.el.classList.remove('dv-dragged'), 0);
|
|
2931
|
-
this.dataDisposable.value = this.getData(event
|
|
2934
|
+
this.dataDisposable.value = this.getData(event);
|
|
2935
|
+
this._onDragStart.fire(event);
|
|
2932
2936
|
if (event.dataTransfer) {
|
|
2933
2937
|
event.dataTransfer.effectAllowed = 'move';
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2938
|
+
const hasData = event.dataTransfer.items.length > 0;
|
|
2939
|
+
if (!hasData) {
|
|
2940
|
+
/**
|
|
2941
|
+
* Although this is not used by dockview many third party dnd libraries will check
|
|
2942
|
+
* dataTransfer.types to determine valid drag events.
|
|
2943
|
+
*
|
|
2944
|
+
* For example: in react-dnd if dataTransfer.types is not set then the dragStart event will be cancelled
|
|
2945
|
+
* through .preventDefault(). Since this is applied globally to all drag events this would break dockviews
|
|
2946
|
+
* dnd logic. You can see the code at
|
|
2947
|
+
* https://github.com/react-dnd/react-dnd/blob/main/packages/backend-html5/src/HTML5BackendImpl.ts#L542
|
|
2948
|
+
*/
|
|
2949
|
+
event.dataTransfer.setData('text/plain', '__dockview_internal_drag_event__');
|
|
2950
|
+
}
|
|
2944
2951
|
}
|
|
2945
2952
|
}), addDisposableListener(this.el, 'dragend', () => {
|
|
2946
2953
|
this.pointerEventsDisposable.dispose();
|
|
@@ -2949,44 +2956,45 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2949
2956
|
}
|
|
2950
2957
|
}
|
|
2951
2958
|
|
|
2959
|
+
class TabDragHandler extends DragHandler {
|
|
2960
|
+
constructor(element, accessor, group, panel) {
|
|
2961
|
+
super(element);
|
|
2962
|
+
this.accessor = accessor;
|
|
2963
|
+
this.group = group;
|
|
2964
|
+
this.panel = panel;
|
|
2965
|
+
this.panelTransfer = LocalSelectionTransfer.getInstance();
|
|
2966
|
+
}
|
|
2967
|
+
getData(event) {
|
|
2968
|
+
this.panelTransfer.setData([new PanelTransfer(this.accessor.id, this.group.id, this.panel.id)], PanelTransfer.prototype);
|
|
2969
|
+
return {
|
|
2970
|
+
dispose: () => {
|
|
2971
|
+
this.panelTransfer.clearData(PanelTransfer.prototype);
|
|
2972
|
+
},
|
|
2973
|
+
};
|
|
2974
|
+
}
|
|
2975
|
+
}
|
|
2952
2976
|
class Tab extends CompositeDisposable {
|
|
2953
2977
|
get element() {
|
|
2954
2978
|
return this._element;
|
|
2955
2979
|
}
|
|
2956
|
-
constructor(
|
|
2980
|
+
constructor(panel, accessor, group) {
|
|
2957
2981
|
super();
|
|
2958
|
-
this.
|
|
2982
|
+
this.panel = panel;
|
|
2959
2983
|
this.accessor = accessor;
|
|
2960
2984
|
this.group = group;
|
|
2985
|
+
this.content = undefined;
|
|
2961
2986
|
this._onChanged = new Emitter();
|
|
2962
2987
|
this.onChanged = this._onChanged.event;
|
|
2963
2988
|
this._onDropped = new Emitter();
|
|
2964
2989
|
this.onDrop = this._onDropped.event;
|
|
2990
|
+
this._onDragStart = new Emitter();
|
|
2991
|
+
this.onDragStart = this._onDragStart.event;
|
|
2965
2992
|
this._element = document.createElement('div');
|
|
2966
2993
|
this._element.className = 'tab';
|
|
2967
2994
|
this._element.tabIndex = 0;
|
|
2968
2995
|
this._element.draggable = true;
|
|
2969
2996
|
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
|
-
}));
|
|
2997
|
+
const dragHandler = new TabDragHandler(this._element, this.accessor, this.group, this.panel);
|
|
2990
2998
|
this.droptarget = new Droptarget(this._element, {
|
|
2991
2999
|
acceptedTargetZones: ['center'],
|
|
2992
3000
|
canDisplayOverlay: (event, position) => {
|
|
@@ -3000,12 +3008,19 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3000
3008
|
// don't allow group move to drop on self
|
|
3001
3009
|
return false;
|
|
3002
3010
|
}
|
|
3003
|
-
return this.
|
|
3011
|
+
return this.panel.id !== data.panelId;
|
|
3004
3012
|
}
|
|
3005
3013
|
return this.group.model.canDisplayOverlay(event, position, exports.DockviewDropTargets.Tab);
|
|
3006
3014
|
},
|
|
3007
3015
|
});
|
|
3008
|
-
this.addDisposables(this.
|
|
3016
|
+
this.addDisposables(this._onChanged, this._onDropped, this._onDragStart, dragHandler.onDragStart((event) => {
|
|
3017
|
+
this._onDragStart.fire(event);
|
|
3018
|
+
}), dragHandler, addDisposableListener(this._element, 'mousedown', (event) => {
|
|
3019
|
+
if (event.defaultPrevented) {
|
|
3020
|
+
return;
|
|
3021
|
+
}
|
|
3022
|
+
this._onChanged.fire(event);
|
|
3023
|
+
}), this.droptarget.onDrop((event) => {
|
|
3009
3024
|
this._onDropped.fire(event);
|
|
3010
3025
|
}), this.droptarget);
|
|
3011
3026
|
}
|
|
@@ -3037,9 +3052,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3037
3052
|
}
|
|
3038
3053
|
|
|
3039
3054
|
class GroupDragHandler extends DragHandler {
|
|
3040
|
-
constructor(element,
|
|
3055
|
+
constructor(element, accessor, group) {
|
|
3041
3056
|
super(element);
|
|
3042
|
-
this.
|
|
3057
|
+
this.accessor = accessor;
|
|
3043
3058
|
this.group = group;
|
|
3044
3059
|
this.panelTransfer = LocalSelectionTransfer.getInstance();
|
|
3045
3060
|
this.addDisposables(addDisposableListener(element, 'mousedown', (e) => {
|
|
@@ -3059,8 +3074,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3059
3074
|
}
|
|
3060
3075
|
return false;
|
|
3061
3076
|
}
|
|
3062
|
-
getData(
|
|
3063
|
-
|
|
3077
|
+
getData(dragEvent) {
|
|
3078
|
+
const dataTransfer = dragEvent.dataTransfer;
|
|
3079
|
+
this.panelTransfer.setData([new PanelTransfer(this.accessor.id, this.group.id, null)], PanelTransfer.prototype);
|
|
3064
3080
|
const style = window.getComputedStyle(this.el);
|
|
3065
3081
|
const bgColor = style.getPropertyValue('--dv-activegroup-visiblepanel-tab-background-color');
|
|
3066
3082
|
const color = style.getPropertyValue('--dv-activegroup-visiblepanel-tab-color');
|
|
@@ -3095,14 +3111,16 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3095
3111
|
this.group = group;
|
|
3096
3112
|
this._onDrop = new Emitter();
|
|
3097
3113
|
this.onDrop = this._onDrop.event;
|
|
3114
|
+
this._onDragStart = new Emitter();
|
|
3115
|
+
this.onDragStart = this._onDragStart.event;
|
|
3098
3116
|
this._element = document.createElement('div');
|
|
3099
3117
|
this._element.className = 'void-container';
|
|
3100
3118
|
this._element.tabIndex = 0;
|
|
3101
3119
|
this._element.draggable = true;
|
|
3102
|
-
this.addDisposables(this._onDrop, addDisposableListener(this._element, 'click', () => {
|
|
3120
|
+
this.addDisposables(this._onDrop, this._onDragStart, addDisposableListener(this._element, 'click', () => {
|
|
3103
3121
|
this.accessor.doSetGroupActive(this.group);
|
|
3104
3122
|
}));
|
|
3105
|
-
const handler = new GroupDragHandler(this._element, accessor
|
|
3123
|
+
const handler = new GroupDragHandler(this._element, accessor, group);
|
|
3106
3124
|
this.voidDropTarget = new Droptarget(this._element, {
|
|
3107
3125
|
acceptedTargetZones: ['center'],
|
|
3108
3126
|
canDisplayOverlay: (event, position) => {
|
|
@@ -3120,7 +3138,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3120
3138
|
return group.model.canDisplayOverlay(event, position, exports.DockviewDropTargets.Panel);
|
|
3121
3139
|
},
|
|
3122
3140
|
});
|
|
3123
|
-
this.addDisposables(handler,
|
|
3141
|
+
this.addDisposables(handler, handler.onDragStart((event) => {
|
|
3142
|
+
this._onDragStart.fire(event);
|
|
3143
|
+
}), this.voidDropTarget.onDrop((event) => {
|
|
3124
3144
|
this._onDrop.fire(event);
|
|
3125
3145
|
}), this.voidDropTarget);
|
|
3126
3146
|
}
|
|
@@ -3128,7 +3148,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3128
3148
|
|
|
3129
3149
|
class TabsContainer extends CompositeDisposable {
|
|
3130
3150
|
get panels() {
|
|
3131
|
-
return this.tabs.map((_) => _.value.
|
|
3151
|
+
return this.tabs.map((_) => _.value.panel.id);
|
|
3132
3152
|
}
|
|
3133
3153
|
get size() {
|
|
3134
3154
|
return this.tabs.length;
|
|
@@ -3182,7 +3202,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3182
3202
|
this.tabs[this.selectedIndex].value === tab);
|
|
3183
3203
|
}
|
|
3184
3204
|
indexOf(id) {
|
|
3185
|
-
return this.tabs.findIndex((tab) => tab.value.
|
|
3205
|
+
return this.tabs.findIndex((tab) => tab.value.panel.id === id);
|
|
3186
3206
|
}
|
|
3187
3207
|
constructor(accessor, group) {
|
|
3188
3208
|
super();
|
|
@@ -3193,7 +3213,11 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3193
3213
|
this._hidden = false;
|
|
3194
3214
|
this._onDrop = new Emitter();
|
|
3195
3215
|
this.onDrop = this._onDrop.event;
|
|
3196
|
-
this.
|
|
3216
|
+
this._onTabDragStart = new Emitter();
|
|
3217
|
+
this.onTabDragStart = this._onTabDragStart.event;
|
|
3218
|
+
this._onGroupDragStart = new Emitter();
|
|
3219
|
+
this.onGroupDragStart = this._onGroupDragStart.event;
|
|
3220
|
+
this.addDisposables(this._onDrop, this._onTabDragStart, this._onGroupDragStart);
|
|
3197
3221
|
this._element = document.createElement('div');
|
|
3198
3222
|
this._element.className = 'tabs-and-actions-container';
|
|
3199
3223
|
toggleClass(this._element, 'dv-full-width-single-tab', this.accessor.options.singleTabMode === 'fullwidth');
|
|
@@ -3217,7 +3241,12 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3217
3241
|
this._element.appendChild(this.leftActionsContainer);
|
|
3218
3242
|
this._element.appendChild(this.voidContainer.element);
|
|
3219
3243
|
this._element.appendChild(this.rightActionsContainer);
|
|
3220
|
-
this.addDisposables(this.voidContainer, this.voidContainer.
|
|
3244
|
+
this.addDisposables(this.voidContainer, this.voidContainer.onDragStart((event) => {
|
|
3245
|
+
this._onGroupDragStart.fire({
|
|
3246
|
+
nativeEvent: event,
|
|
3247
|
+
group: this.group,
|
|
3248
|
+
});
|
|
3249
|
+
}), this.voidContainer.onDrop((event) => {
|
|
3221
3250
|
this._onDrop.fire({
|
|
3222
3251
|
event: event.nativeEvent,
|
|
3223
3252
|
index: this.tabs.length,
|
|
@@ -3263,7 +3292,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3263
3292
|
}
|
|
3264
3293
|
}
|
|
3265
3294
|
delete(id) {
|
|
3266
|
-
const index = this.tabs.findIndex((tab) => tab.value.
|
|
3295
|
+
const index = this.tabs.findIndex((tab) => tab.value.panel.id === id);
|
|
3267
3296
|
const tabToRemove = this.tabs.splice(index, 1)[0];
|
|
3268
3297
|
const { value, disposable } = tabToRemove;
|
|
3269
3298
|
disposable.dispose();
|
|
@@ -3272,21 +3301,23 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3272
3301
|
}
|
|
3273
3302
|
setActivePanel(panel) {
|
|
3274
3303
|
this.tabs.forEach((tab) => {
|
|
3275
|
-
const isActivePanel = panel.id === tab.value.
|
|
3304
|
+
const isActivePanel = panel.id === tab.value.panel.id;
|
|
3276
3305
|
tab.value.setActive(isActivePanel);
|
|
3277
3306
|
});
|
|
3278
3307
|
}
|
|
3279
3308
|
openPanel(panel, index = this.tabs.length) {
|
|
3280
3309
|
var _a;
|
|
3281
|
-
if (this.tabs.find((tab) => tab.value.
|
|
3310
|
+
if (this.tabs.find((tab) => tab.value.panel.id === panel.id)) {
|
|
3282
3311
|
return;
|
|
3283
3312
|
}
|
|
3284
|
-
const
|
|
3313
|
+
const tab = new Tab(panel, this.accessor, this.group);
|
|
3285
3314
|
if (!((_a = panel.view) === null || _a === void 0 ? void 0 : _a.tab)) {
|
|
3286
3315
|
throw new Error('invalid header component');
|
|
3287
3316
|
}
|
|
3288
|
-
|
|
3289
|
-
const disposable = CompositeDisposable
|
|
3317
|
+
tab.setContent(panel.view.tab);
|
|
3318
|
+
const disposable = new CompositeDisposable(tab.onDragStart((event) => {
|
|
3319
|
+
this._onTabDragStart.fire({ nativeEvent: event, panel });
|
|
3320
|
+
}), tab.onChanged((event) => {
|
|
3290
3321
|
var _a;
|
|
3291
3322
|
const isFloatingGroupsEnabled = !this.accessor.options.disableFloatingGroups;
|
|
3292
3323
|
const isFloatingWithOnePanel = this.group.api.isFloating && this.size === 1;
|
|
@@ -3294,8 +3325,8 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3294
3325
|
!isFloatingWithOnePanel &&
|
|
3295
3326
|
event.shiftKey) {
|
|
3296
3327
|
event.preventDefault();
|
|
3297
|
-
const panel = this.accessor.getGroupPanel(
|
|
3298
|
-
const { top, left } =
|
|
3328
|
+
const panel = this.accessor.getGroupPanel(tab.panel.id);
|
|
3329
|
+
const { top, left } = tab.element.getBoundingClientRect();
|
|
3299
3330
|
const { top: rootTop, left: rootLeft } = this.accessor.element.getBoundingClientRect();
|
|
3300
3331
|
this.accessor.addFloatingGroup(panel, {
|
|
3301
3332
|
x: left - rootLeft,
|
|
@@ -3312,13 +3343,13 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3312
3343
|
this.group.model.openPanel(panel, {
|
|
3313
3344
|
skipFocus: alreadyFocused,
|
|
3314
3345
|
});
|
|
3315
|
-
}),
|
|
3346
|
+
}), tab.onDrop((event) => {
|
|
3316
3347
|
this._onDrop.fire({
|
|
3317
3348
|
event: event.nativeEvent,
|
|
3318
|
-
index: this.tabs.findIndex((x) => x.value ===
|
|
3349
|
+
index: this.tabs.findIndex((x) => x.value === tab),
|
|
3319
3350
|
});
|
|
3320
3351
|
}));
|
|
3321
|
-
const value = { value:
|
|
3352
|
+
const value = { value: tab, disposable };
|
|
3322
3353
|
this.addTab(value, index);
|
|
3323
3354
|
}
|
|
3324
3355
|
closePanel(panel) {
|
|
@@ -3346,7 +3377,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3346
3377
|
}
|
|
3347
3378
|
set locked(value) {
|
|
3348
3379
|
this._locked = value;
|
|
3349
|
-
toggleClass(this.container, 'locked-groupview', value);
|
|
3380
|
+
toggleClass(this.container, 'locked-groupview', value === 'no-drop-target' || value);
|
|
3350
3381
|
}
|
|
3351
3382
|
get isActive() {
|
|
3352
3383
|
return this._isGroupActive;
|
|
@@ -3403,6 +3434,10 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3403
3434
|
this.onMove = this._onMove.event;
|
|
3404
3435
|
this._onDidDrop = new Emitter();
|
|
3405
3436
|
this.onDidDrop = this._onDidDrop.event;
|
|
3437
|
+
this._onTabDragStart = new Emitter();
|
|
3438
|
+
this.onTabDragStart = this._onTabDragStart.event;
|
|
3439
|
+
this._onGroupDragStart = new Emitter();
|
|
3440
|
+
this.onGroupDragStart = this._onGroupDragStart.event;
|
|
3406
3441
|
this._onDidAddPanel = new Emitter();
|
|
3407
3442
|
this.onDidAddPanel = this._onDidAddPanel.event;
|
|
3408
3443
|
this._onDidRemovePanel = new Emitter();
|
|
@@ -3415,7 +3450,8 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3415
3450
|
this.dropTarget = new Droptarget(this.contentContainer.element, {
|
|
3416
3451
|
acceptedTargetZones: ['top', 'bottom', 'left', 'right', 'center'],
|
|
3417
3452
|
canDisplayOverlay: (event, position) => {
|
|
3418
|
-
if (this.locked
|
|
3453
|
+
if (this.locked === 'no-drop-target' ||
|
|
3454
|
+
(this.locked && position === 'center')) {
|
|
3419
3455
|
return false;
|
|
3420
3456
|
}
|
|
3421
3457
|
const data = getPanelData();
|
|
@@ -3441,8 +3477,12 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3441
3477
|
});
|
|
3442
3478
|
container.append(this.tabsContainer.element, this.contentContainer.element);
|
|
3443
3479
|
this.header.hidden = !!options.hideHeader;
|
|
3444
|
-
this.locked =
|
|
3445
|
-
this.addDisposables(this.tabsContainer.
|
|
3480
|
+
this.locked = options.locked || false;
|
|
3481
|
+
this.addDisposables(this._onTabDragStart, this._onGroupDragStart, this.tabsContainer.onTabDragStart((event) => {
|
|
3482
|
+
this._onTabDragStart.fire(event);
|
|
3483
|
+
}), this.tabsContainer.onGroupDragStart((event) => {
|
|
3484
|
+
this._onGroupDragStart.fire(event);
|
|
3485
|
+
}), this.tabsContainer.onDrop((event) => {
|
|
3446
3486
|
this.handleDropEvent(event.event, 'center', event.index);
|
|
3447
3487
|
}), this.contentContainer.onDidFocus(() => {
|
|
3448
3488
|
this.accessor.doSetGroupActive(this.groupPanel, true);
|
|
@@ -3497,8 +3537,8 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3497
3537
|
activeView: (_a = this._activePanel) === null || _a === void 0 ? void 0 : _a.id,
|
|
3498
3538
|
id: this.id,
|
|
3499
3539
|
};
|
|
3500
|
-
if (this.locked) {
|
|
3501
|
-
result.locked =
|
|
3540
|
+
if (this.locked !== false) {
|
|
3541
|
+
result.locked = this.locked;
|
|
3502
3542
|
}
|
|
3503
3543
|
if (this.header.hidden) {
|
|
3504
3544
|
result.hideHeader = true;
|
|
@@ -3748,6 +3788,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3748
3788
|
return false;
|
|
3749
3789
|
}
|
|
3750
3790
|
handleDropEvent(event, position, index) {
|
|
3791
|
+
if (this.locked === 'no-drop-target') {
|
|
3792
|
+
return;
|
|
3793
|
+
}
|
|
3751
3794
|
const data = getPanelData();
|
|
3752
3795
|
if (data && data.viewId === this.accessor.id) {
|
|
3753
3796
|
if (data.panelId === null) {
|
|
@@ -5205,6 +5248,12 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5205
5248
|
return pushToTop;
|
|
5206
5249
|
})();
|
|
5207
5250
|
class Overlay extends CompositeDisposable {
|
|
5251
|
+
set minimumInViewportWidth(value) {
|
|
5252
|
+
this.options.minimumInViewportWidth = value;
|
|
5253
|
+
}
|
|
5254
|
+
set minimumInViewportHeight(value) {
|
|
5255
|
+
this.options.minimumInViewportHeight = value;
|
|
5256
|
+
}
|
|
5208
5257
|
constructor(options) {
|
|
5209
5258
|
super();
|
|
5210
5259
|
this.options = options;
|
|
@@ -5250,9 +5299,11 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5250
5299
|
const overlayRect = this._element.getBoundingClientRect();
|
|
5251
5300
|
// region: ensure bounds within allowable limits
|
|
5252
5301
|
// a minimum width of minimumViewportWidth must be inside the viewport
|
|
5253
|
-
const xOffset = Math.max(0, overlayRect.width
|
|
5302
|
+
const xOffset = Math.max(0, this.getMinimumWidth(overlayRect.width));
|
|
5254
5303
|
// a minimum height of minimumViewportHeight must be inside the viewport
|
|
5255
|
-
const yOffset =
|
|
5304
|
+
const yOffset = typeof this.options.minimumInViewportHeight === 'number'
|
|
5305
|
+
? Math.max(0, this.getMinimumHeight(overlayRect.height))
|
|
5306
|
+
: 0;
|
|
5256
5307
|
const left = clamp(overlayRect.left - containerRect.left, -xOffset, Math.max(0, containerRect.width - overlayRect.width + xOffset));
|
|
5257
5308
|
const top = clamp(overlayRect.top - containerRect.top, -yOffset, Math.max(0, containerRect.height - overlayRect.height + yOffset));
|
|
5258
5309
|
this._element.style.left = `${left}px`;
|
|
@@ -5298,9 +5349,10 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5298
5349
|
y: e.clientY - overlayRect.top,
|
|
5299
5350
|
};
|
|
5300
5351
|
}
|
|
5301
|
-
const xOffset = Math.max(0, overlayRect.width
|
|
5302
|
-
const yOffset = Math.max(0,
|
|
5303
|
-
this.
|
|
5352
|
+
const xOffset = Math.max(0, this.getMinimumWidth(overlayRect.width));
|
|
5353
|
+
const yOffset = Math.max(0, this.options.minimumInViewportHeight
|
|
5354
|
+
? this.getMinimumHeight(overlayRect.height)
|
|
5355
|
+
: 0);
|
|
5304
5356
|
const left = clamp(x - offset.x, -xOffset, Math.max(0, containerRect.width - overlayRect.width + xOffset));
|
|
5305
5357
|
const top = clamp(y - offset.y, -yOffset, Math.max(0, containerRect.height - overlayRect.height + yOffset));
|
|
5306
5358
|
this.setBounds({ top, left });
|
|
@@ -5374,14 +5426,11 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5374
5426
|
let height = undefined;
|
|
5375
5427
|
let left = undefined;
|
|
5376
5428
|
let width = undefined;
|
|
5377
|
-
const
|
|
5378
|
-
const minimumInViewportWidth = this.options.minimumInViewportWidth;
|
|
5379
|
-
function moveTop() {
|
|
5429
|
+
const moveTop = () => {
|
|
5380
5430
|
top = clamp(y, -Number.MAX_VALUE, startPosition.originalY +
|
|
5381
5431
|
startPosition.originalHeight >
|
|
5382
5432
|
containerRect.height
|
|
5383
|
-
? containerRect.height
|
|
5384
|
-
minimumInViewportHeight
|
|
5433
|
+
? this.getMinimumHeight(containerRect.height)
|
|
5385
5434
|
: Math.max(0, startPosition.originalY +
|
|
5386
5435
|
startPosition.originalHeight -
|
|
5387
5436
|
Overlay.MINIMUM_HEIGHT));
|
|
@@ -5389,21 +5438,23 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5389
5438
|
startPosition.originalY +
|
|
5390
5439
|
startPosition.originalHeight -
|
|
5391
5440
|
top;
|
|
5392
|
-
}
|
|
5393
|
-
|
|
5441
|
+
};
|
|
5442
|
+
const moveBottom = () => {
|
|
5394
5443
|
top =
|
|
5395
5444
|
startPosition.originalY -
|
|
5396
5445
|
startPosition.originalHeight;
|
|
5397
|
-
height = clamp(y - top, top < 0
|
|
5398
|
-
|
|
5446
|
+
height = clamp(y - top, top < 0 &&
|
|
5447
|
+
typeof this.options
|
|
5448
|
+
.minimumInViewportHeight === 'number'
|
|
5449
|
+
? -top +
|
|
5450
|
+
this.options.minimumInViewportHeight
|
|
5399
5451
|
: Overlay.MINIMUM_HEIGHT, Number.MAX_VALUE);
|
|
5400
|
-
}
|
|
5401
|
-
|
|
5452
|
+
};
|
|
5453
|
+
const moveLeft = () => {
|
|
5402
5454
|
left = clamp(x, -Number.MAX_VALUE, startPosition.originalX +
|
|
5403
5455
|
startPosition.originalWidth >
|
|
5404
5456
|
containerRect.width
|
|
5405
|
-
? containerRect.width
|
|
5406
|
-
minimumInViewportWidth
|
|
5457
|
+
? this.getMinimumWidth(containerRect.width)
|
|
5407
5458
|
: Math.max(0, startPosition.originalX +
|
|
5408
5459
|
startPosition.originalWidth -
|
|
5409
5460
|
Overlay.MINIMUM_WIDTH));
|
|
@@ -5411,15 +5462,18 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5411
5462
|
startPosition.originalX +
|
|
5412
5463
|
startPosition.originalWidth -
|
|
5413
5464
|
left;
|
|
5414
|
-
}
|
|
5415
|
-
|
|
5465
|
+
};
|
|
5466
|
+
const moveRight = () => {
|
|
5416
5467
|
left =
|
|
5417
5468
|
startPosition.originalX -
|
|
5418
5469
|
startPosition.originalWidth;
|
|
5419
|
-
width = clamp(x - left, left < 0
|
|
5420
|
-
|
|
5470
|
+
width = clamp(x - left, left < 0 &&
|
|
5471
|
+
typeof this.options
|
|
5472
|
+
.minimumInViewportWidth === 'number'
|
|
5473
|
+
? -left +
|
|
5474
|
+
this.options.minimumInViewportWidth
|
|
5421
5475
|
: Overlay.MINIMUM_WIDTH, Number.MAX_VALUE);
|
|
5422
|
-
}
|
|
5476
|
+
};
|
|
5423
5477
|
switch (direction) {
|
|
5424
5478
|
case 'top':
|
|
5425
5479
|
moveTop();
|
|
@@ -5463,6 +5517,18 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5463
5517
|
}));
|
|
5464
5518
|
}));
|
|
5465
5519
|
}
|
|
5520
|
+
getMinimumWidth(width) {
|
|
5521
|
+
if (typeof this.options.minimumInViewportWidth === 'number') {
|
|
5522
|
+
return width - this.options.minimumInViewportWidth;
|
|
5523
|
+
}
|
|
5524
|
+
return 0;
|
|
5525
|
+
}
|
|
5526
|
+
getMinimumHeight(height) {
|
|
5527
|
+
if (typeof this.options.minimumInViewportHeight === 'number') {
|
|
5528
|
+
return height - this.options.minimumInViewportHeight;
|
|
5529
|
+
}
|
|
5530
|
+
return height;
|
|
5531
|
+
}
|
|
5466
5532
|
dispose() {
|
|
5467
5533
|
this._element.remove();
|
|
5468
5534
|
super.dispose();
|
|
@@ -5483,6 +5549,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5483
5549
|
}
|
|
5484
5550
|
}
|
|
5485
5551
|
|
|
5552
|
+
const DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE = 100;
|
|
5486
5553
|
class DockviewComponent extends BaseGrid {
|
|
5487
5554
|
get orientation() {
|
|
5488
5555
|
return this.gridview.orientation;
|
|
@@ -5513,6 +5580,10 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5513
5580
|
this.nextGroupId = sequentialNumberGenerator();
|
|
5514
5581
|
this._deserializer = new DefaultDockviewDeserialzier(this);
|
|
5515
5582
|
this.watermark = null;
|
|
5583
|
+
this._onWillDragPanel = new Emitter();
|
|
5584
|
+
this.onWillDragPanel = this._onWillDragPanel.event;
|
|
5585
|
+
this._onWillDragGroup = new Emitter();
|
|
5586
|
+
this.onWillDragGroup = this._onWillDragGroup.event;
|
|
5516
5587
|
this._onDidDrop = new Emitter();
|
|
5517
5588
|
this.onDidDrop = this._onDidDrop.event;
|
|
5518
5589
|
this._onDidRemovePanel = new Emitter();
|
|
@@ -5525,7 +5596,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5525
5596
|
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
5526
5597
|
this.floatingGroups = [];
|
|
5527
5598
|
toggleClass(this.gridview.element, 'dv-dockview', true);
|
|
5528
|
-
this.addDisposables(this._onDidDrop, exports.DockviewEvent.any(this.onDidAddGroup, this.onDidRemoveGroup)(() => {
|
|
5599
|
+
this.addDisposables(this._onWillDragPanel, this._onWillDragGroup, this._onDidActivePanelChange, this._onDidAddPanel, this._onDidRemovePanel, this._onDidLayoutFromJSON, this._onDidDrop, exports.DockviewEvent.any(this.onDidAddGroup, this.onDidRemoveGroup)(() => {
|
|
5529
5600
|
this.updateWatermark();
|
|
5530
5601
|
}), exports.DockviewEvent.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidActivePanelChange)(() => {
|
|
5531
5602
|
this._bufferOnDidLayoutChange.fire();
|
|
@@ -5562,7 +5633,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5562
5633
|
return true;
|
|
5563
5634
|
}
|
|
5564
5635
|
if (this.options.showDndOverlay) {
|
|
5565
|
-
if (position === 'center') {
|
|
5636
|
+
if (position === 'center' && this.gridview.length !== 0) {
|
|
5566
5637
|
/**
|
|
5567
5638
|
* for external events only show the four-corner drag overlays, disable
|
|
5568
5639
|
* the center position so that external drag events can fall through to the group
|
|
@@ -5598,7 +5669,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5598
5669
|
this.updateWatermark();
|
|
5599
5670
|
}
|
|
5600
5671
|
addFloatingGroup(item, coord, options) {
|
|
5601
|
-
var _a, _b;
|
|
5672
|
+
var _a, _b, _c, _d, _e, _f;
|
|
5602
5673
|
let group;
|
|
5603
5674
|
if (item instanceof DockviewPanel) {
|
|
5604
5675
|
group = this.createGroup();
|
|
@@ -5626,8 +5697,12 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5626
5697
|
width: (_b = coord === null || coord === void 0 ? void 0 : coord.width) !== null && _b !== void 0 ? _b : 300,
|
|
5627
5698
|
left: overlayLeft,
|
|
5628
5699
|
top: overlayTop,
|
|
5629
|
-
minimumInViewportWidth:
|
|
5630
|
-
|
|
5700
|
+
minimumInViewportWidth: this.options.floatingGroupBounds === 'boundedWithinViewport'
|
|
5701
|
+
? undefined
|
|
5702
|
+
: (_d = (_c = this.options.floatingGroupBounds) === null || _c === void 0 ? void 0 : _c.minimumWidthWithinViewport) !== null && _d !== void 0 ? _d : DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE,
|
|
5703
|
+
minimumInViewportHeight: this.options.floatingGroupBounds === 'boundedWithinViewport'
|
|
5704
|
+
? undefined
|
|
5705
|
+
: (_f = (_e = this.options.floatingGroupBounds) === null || _e === void 0 ? void 0 : _e.minimumHeightWithinViewport) !== null && _f !== void 0 ? _f : DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE,
|
|
5631
5706
|
});
|
|
5632
5707
|
const el = group.element.querySelector('.void-container');
|
|
5633
5708
|
if (!el) {
|
|
@@ -5698,12 +5773,37 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5698
5773
|
}
|
|
5699
5774
|
}
|
|
5700
5775
|
updateOptions(options) {
|
|
5776
|
+
var _a, _b;
|
|
5701
5777
|
const hasOrientationChanged = typeof options.orientation === 'string' &&
|
|
5702
5778
|
this.gridview.orientation !== options.orientation;
|
|
5779
|
+
const hasFloatingGroupOptionsChanged = options.floatingGroupBounds !== undefined &&
|
|
5780
|
+
options.floatingGroupBounds !== this.options.floatingGroupBounds;
|
|
5703
5781
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
5704
5782
|
if (hasOrientationChanged) {
|
|
5705
5783
|
this.gridview.orientation = options.orientation;
|
|
5706
5784
|
}
|
|
5785
|
+
if (hasFloatingGroupOptionsChanged) {
|
|
5786
|
+
for (const group of this.floatingGroups) {
|
|
5787
|
+
switch (this.options.floatingGroupBounds) {
|
|
5788
|
+
case 'boundedWithinViewport':
|
|
5789
|
+
group.overlay.minimumInViewportHeight = undefined;
|
|
5790
|
+
group.overlay.minimumInViewportWidth = undefined;
|
|
5791
|
+
break;
|
|
5792
|
+
case undefined:
|
|
5793
|
+
group.overlay.minimumInViewportHeight =
|
|
5794
|
+
DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE;
|
|
5795
|
+
group.overlay.minimumInViewportWidth =
|
|
5796
|
+
DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE;
|
|
5797
|
+
break;
|
|
5798
|
+
default:
|
|
5799
|
+
group.overlay.minimumInViewportHeight =
|
|
5800
|
+
(_a = this.options.floatingGroupBounds) === null || _a === void 0 ? void 0 : _a.minimumHeightWithinViewport;
|
|
5801
|
+
group.overlay.minimumInViewportWidth =
|
|
5802
|
+
(_b = this.options.floatingGroupBounds) === null || _b === void 0 ? void 0 : _b.minimumWidthWithinViewport;
|
|
5803
|
+
}
|
|
5804
|
+
group.overlay.setBounds({});
|
|
5805
|
+
}
|
|
5806
|
+
}
|
|
5707
5807
|
this.layout(this.gridview.width, this.gridview.height, true);
|
|
5708
5808
|
}
|
|
5709
5809
|
layout(width, height, forceResize) {
|
|
@@ -6186,7 +6286,11 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
6186
6286
|
const view = new DockviewGroupPanel(this, id, options);
|
|
6187
6287
|
view.init({ params: {}, accessor: null }); // required to initialized .part and allow for correct disposal of group
|
|
6188
6288
|
if (!this._groups.has(view.id)) {
|
|
6189
|
-
const disposable = new CompositeDisposable(view.model.
|
|
6289
|
+
const disposable = new CompositeDisposable(view.model.onTabDragStart((event) => {
|
|
6290
|
+
this._onWillDragPanel.fire(event);
|
|
6291
|
+
}), view.model.onGroupDragStart((event) => {
|
|
6292
|
+
this._onWillDragGroup.fire(event);
|
|
6293
|
+
}), view.model.onMove((event) => {
|
|
6190
6294
|
const { groupId, itemId, target, index } = event;
|
|
6191
6295
|
this.moveGroupOrPanel(view, groupId, itemId, target, index);
|
|
6192
6296
|
}), view.model.onDidDrop((event) => {
|
|
@@ -6225,13 +6329,6 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
6225
6329
|
var _a;
|
|
6226
6330
|
return (_a = Array.from(this._groups.values()).find((group) => group.value.model.containsPanel(panel))) === null || _a === void 0 ? void 0 : _a.value;
|
|
6227
6331
|
}
|
|
6228
|
-
dispose() {
|
|
6229
|
-
this._onDidActivePanelChange.dispose();
|
|
6230
|
-
this._onDidAddPanel.dispose();
|
|
6231
|
-
this._onDidRemovePanel.dispose();
|
|
6232
|
-
this._onDidLayoutFromJSON.dispose();
|
|
6233
|
-
super.dispose();
|
|
6234
|
-
}
|
|
6235
6332
|
}
|
|
6236
6333
|
|
|
6237
6334
|
class GridviewComponent extends BaseGrid {
|