dockview-core 4.13.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -8
- package/dist/cjs/api/dockviewGroupPanelApi.d.ts +5 -0
- package/dist/cjs/api/dockviewGroupPanelApi.js +13 -1
- package/dist/cjs/api/dockviewPanelApi.js +1 -1
- package/dist/cjs/constants.js +6 -1
- package/dist/cjs/dnd/abstractDragHandler.js +3 -1
- package/dist/cjs/dnd/droptarget.js +2 -2
- package/dist/cjs/dockview/components/popupService.js +2 -0
- package/dist/cjs/dockview/components/titlebar/tabs.d.ts +5 -0
- package/dist/cjs/dockview/components/titlebar/tabs.js +31 -4
- package/dist/cjs/dockview/components/titlebar/tabsContainer.d.ts +5 -0
- package/dist/cjs/dockview/components/titlebar/tabsContainer.js +21 -0
- package/dist/cjs/dockview/deserializer.js +1 -1
- package/dist/cjs/dockview/dockviewComponent.d.ts +4 -1
- package/dist/cjs/dockview/dockviewComponent.js +93 -58
- package/dist/cjs/dockview/dockviewGroupPanel.js +16 -13
- package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +11 -1
- package/dist/cjs/dockview/dockviewGroupPanelModel.js +62 -5
- package/dist/cjs/dockview/framework.d.ts +2 -0
- package/dist/cjs/dockview/options.d.ts +3 -0
- package/dist/cjs/dockview/options.js +1 -0
- package/dist/cjs/dom.js +9 -1
- package/dist/cjs/framwork.d.ts +1 -1
- package/dist/cjs/lifecycle.d.ts +2 -1
- package/dist/cjs/lifecycle.js +6 -3
- package/dist/cjs/overlay/overlay.js +2 -1
- package/dist/cjs/scrollbar.d.ts +5 -2
- package/dist/cjs/scrollbar.js +88 -26
- package/dist/dockview-core.js +284 -77
- 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 +283 -76
- package/dist/esm/api/dockviewGroupPanelApi.d.ts +5 -0
- package/dist/esm/api/dockviewGroupPanelApi.js +14 -2
- package/dist/esm/api/dockviewPanelApi.js +1 -1
- package/dist/esm/constants.js +6 -1
- package/dist/esm/dnd/abstractDragHandler.js +3 -1
- package/dist/esm/dnd/droptarget.js +2 -2
- package/dist/esm/dockview/components/popupService.js +2 -0
- package/dist/esm/dockview/components/titlebar/tabs.d.ts +5 -0
- package/dist/esm/dockview/components/titlebar/tabs.js +28 -5
- package/dist/esm/dockview/components/titlebar/tabsContainer.d.ts +5 -0
- package/dist/esm/dockview/components/titlebar/tabsContainer.js +18 -1
- package/dist/esm/dockview/deserializer.js +1 -1
- package/dist/esm/dockview/dockviewComponent.d.ts +4 -1
- package/dist/esm/dockview/dockviewComponent.js +34 -14
- package/dist/esm/dockview/dockviewGroupPanel.js +17 -14
- package/dist/esm/dockview/dockviewGroupPanelModel.d.ts +11 -1
- package/dist/esm/dockview/dockviewGroupPanelModel.js +61 -8
- package/dist/esm/dockview/framework.d.ts +2 -0
- package/dist/esm/dockview/options.d.ts +3 -0
- package/dist/esm/dockview/options.js +1 -0
- package/dist/esm/dom.js +9 -1
- package/dist/esm/framwork.d.ts +1 -1
- package/dist/esm/lifecycle.d.ts +2 -1
- package/dist/esm/lifecycle.js +6 -3
- package/dist/esm/overlay/overlay.js +2 -1
- package/dist/esm/scrollbar.d.ts +5 -2
- package/dist/esm/scrollbar.js +85 -27
- package/dist/{dockview-core.cjs.js → package/main.cjs.js} +284 -77
- package/dist/package/main.cjs.min.js +7 -0
- package/dist/package/main.esm.min.mjs +7 -0
- package/dist/{dockview-core.esm.js → package/main.esm.mjs} +284 -77
- package/dist/styles/dockview.css +63 -7
- package/package.json +63 -53
- package/dist/dockview-core.amd.js +0 -11365
- package/dist/dockview-core.amd.js.map +0 -1
- package/dist/dockview-core.amd.min.js +0 -8
- package/dist/dockview-core.amd.min.js.map +0 -1
- package/dist/dockview-core.amd.min.noStyle.js +0 -8
- package/dist/dockview-core.amd.min.noStyle.js.map +0 -1
- package/dist/dockview-core.amd.noStyle.js +0 -11335
- package/dist/dockview-core.amd.noStyle.js.map +0 -1
- package/dist/dockview-core.cjs.js.map +0 -1
- package/dist/dockview-core.esm.js.map +0 -1
- package/dist/dockview-core.esm.min.js +0 -8
- package/dist/dockview-core.esm.min.js.map +0 -1
- package/dist/dockview-core.js.map +0 -1
- package/dist/dockview-core.noStyle.js.map +0 -1
|
@@ -214,7 +214,14 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
214
214
|
if (options.debug) {
|
|
215
215
|
_this.addDisposables(new strictEventsSequencing_1.StrictEventsSequencing(_this));
|
|
216
216
|
}
|
|
217
|
-
_this.addDisposables(_this.rootDropTargetContainer, _this.overlayRenderContainer, _this._onWillDragPanel, _this._onWillDragGroup, _this._onWillShowOverlay, _this._onDidActivePanelChange, _this._onDidAddPanel, _this._onDidRemovePanel, _this._onDidLayoutFromJSON, _this._onDidDrop, _this._onWillDrop, _this._onDidMovePanel, _this.
|
|
217
|
+
_this.addDisposables(_this.rootDropTargetContainer, _this.overlayRenderContainer, _this._onWillDragPanel, _this._onWillDragGroup, _this._onWillShowOverlay, _this._onDidActivePanelChange, _this._onDidAddPanel, _this._onDidRemovePanel, _this._onDidLayoutFromJSON, _this._onDidDrop, _this._onWillDrop, _this._onDidMovePanel, _this._onDidMovePanel.event(function () {
|
|
218
|
+
/**
|
|
219
|
+
* Update overlay positions after DOM layout completes to prevent 0×0 dimensions.
|
|
220
|
+
* With defaultRenderer="always" this results in panel content not showing after move operations.
|
|
221
|
+
* Debounced to avoid multiple calls when moving groups with multiple panels.
|
|
222
|
+
*/
|
|
223
|
+
_this.debouncedUpdateAllPositions();
|
|
224
|
+
}), _this._onDidAddGroup, _this._onDidRemoveGroup, _this._onDidActiveGroupChange, _this._onUnhandledDragOverEvent, _this._onDidMaximizedGroupChange, _this._onDidOptionsChange, _this._onDidPopoutGroupSizeChange, _this._onDidPopoutGroupPositionChange, _this._onDidOpenPopoutWindowFail, _this.onDidViewVisibilityChangeMicroTaskQueue(function () {
|
|
218
225
|
_this.updateWatermark();
|
|
219
226
|
}), _this.onDidAdd(function (event) {
|
|
220
227
|
if (!_this._moving) {
|
|
@@ -367,6 +374,14 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
367
374
|
enumerable: false,
|
|
368
375
|
configurable: true
|
|
369
376
|
});
|
|
377
|
+
Object.defineProperty(DockviewComponent.prototype, "defaultHeaderPosition", {
|
|
378
|
+
get: function () {
|
|
379
|
+
var _a;
|
|
380
|
+
return (_a = this.options.defaultHeaderPosition) !== null && _a !== void 0 ? _a : 'top';
|
|
381
|
+
},
|
|
382
|
+
enumerable: false,
|
|
383
|
+
configurable: true
|
|
384
|
+
});
|
|
370
385
|
Object.defineProperty(DockviewComponent.prototype, "api", {
|
|
371
386
|
get: function () {
|
|
372
387
|
return this._api;
|
|
@@ -770,9 +785,9 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
770
785
|
var anchoredBox = getAnchoredBox();
|
|
771
786
|
var overlay = new overlay_1.Overlay(__assign(__assign({ container: this.gridview.element, content: group.element }, anchoredBox), { minimumInViewportWidth: this.options.floatingGroupBounds === 'boundedWithinViewport'
|
|
772
787
|
? undefined
|
|
773
|
-
: (_c = (_b = this.options.floatingGroupBounds) === null || _b === void 0 ? void 0 : _b.minimumWidthWithinViewport) !== null && _c !== void 0 ? _c : constants_1.DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE, minimumInViewportHeight: this.options.floatingGroupBounds === 'boundedWithinViewport'
|
|
788
|
+
: ((_c = (_b = this.options.floatingGroupBounds) === null || _b === void 0 ? void 0 : _b.minimumWidthWithinViewport) !== null && _c !== void 0 ? _c : constants_1.DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE), minimumInViewportHeight: this.options.floatingGroupBounds === 'boundedWithinViewport'
|
|
774
789
|
? undefined
|
|
775
|
-
: (_e = (_d = this.options.floatingGroupBounds) === null || _d === void 0 ? void 0 : _d.minimumHeightWithinViewport) !== null && _e !== void 0 ? _e : constants_1.DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE }));
|
|
790
|
+
: ((_e = (_d = this.options.floatingGroupBounds) === null || _d === void 0 ? void 0 : _d.minimumHeightWithinViewport) !== null && _e !== void 0 ? _e : constants_1.DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE) }));
|
|
776
791
|
var el = group.element.querySelector('.dv-void-container');
|
|
777
792
|
if (!el) {
|
|
778
793
|
throw new Error('dockview: failed to find drag handle');
|
|
@@ -853,13 +868,13 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
853
868
|
}
|
|
854
869
|
};
|
|
855
870
|
DockviewComponent.prototype.updateOptions = function (options) {
|
|
856
|
-
var e_3, _a;
|
|
857
|
-
var
|
|
871
|
+
var e_3, _a, e_4, _b;
|
|
872
|
+
var _c, _d;
|
|
858
873
|
_super.prototype.updateOptions.call(this, options);
|
|
859
874
|
if ('floatingGroupBounds' in options) {
|
|
860
875
|
try {
|
|
861
|
-
for (var
|
|
862
|
-
var group =
|
|
876
|
+
for (var _e = __values(this._floatingGroups), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
877
|
+
var group = _f.value;
|
|
863
878
|
switch (options.floatingGroupBounds) {
|
|
864
879
|
case 'boundedWithinViewport':
|
|
865
880
|
group.overlay.minimumInViewportHeight = undefined;
|
|
@@ -873,9 +888,9 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
873
888
|
break;
|
|
874
889
|
default:
|
|
875
890
|
group.overlay.minimumInViewportHeight =
|
|
876
|
-
(
|
|
891
|
+
(_c = options.floatingGroupBounds) === null || _c === void 0 ? void 0 : _c.minimumHeightWithinViewport;
|
|
877
892
|
group.overlay.minimumInViewportWidth =
|
|
878
|
-
(
|
|
893
|
+
(_d = options.floatingGroupBounds) === null || _d === void 0 ? void 0 : _d.minimumWidthWithinViewport;
|
|
879
894
|
}
|
|
880
895
|
group.overlay.setBounds();
|
|
881
896
|
}
|
|
@@ -883,7 +898,7 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
883
898
|
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
884
899
|
finally {
|
|
885
900
|
try {
|
|
886
|
-
if (
|
|
901
|
+
if (_f && !_f.done && (_a = _e.return)) _a.call(_e);
|
|
887
902
|
}
|
|
888
903
|
finally { if (e_3) throw e_3.error; }
|
|
889
904
|
}
|
|
@@ -898,10 +913,27 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
898
913
|
if ('theme' in options) {
|
|
899
914
|
this.updateTheme();
|
|
900
915
|
}
|
|
916
|
+
if ('createRightHeaderActionComponent' in options ||
|
|
917
|
+
'createLeftHeaderActionComponent' in options ||
|
|
918
|
+
'createPrefixHeaderActionComponent' in options) {
|
|
919
|
+
try {
|
|
920
|
+
for (var _g = __values(this.groups), _h = _g.next(); !_h.done; _h = _g.next()) {
|
|
921
|
+
var group = _h.value;
|
|
922
|
+
group.model.updateHeaderActions();
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
926
|
+
finally {
|
|
927
|
+
try {
|
|
928
|
+
if (_h && !_h.done && (_b = _g.return)) _b.call(_g);
|
|
929
|
+
}
|
|
930
|
+
finally { if (e_4) throw e_4.error; }
|
|
931
|
+
}
|
|
932
|
+
}
|
|
901
933
|
this.layout(this.gridview.width, this.gridview.height, true);
|
|
902
934
|
};
|
|
903
935
|
DockviewComponent.prototype.layout = function (width, height, forceResize) {
|
|
904
|
-
var
|
|
936
|
+
var e_5, _a;
|
|
905
937
|
_super.prototype.layout.call(this, width, height, forceResize);
|
|
906
938
|
if (this._floatingGroups) {
|
|
907
939
|
try {
|
|
@@ -911,17 +943,17 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
911
943
|
floating.overlay.setBounds();
|
|
912
944
|
}
|
|
913
945
|
}
|
|
914
|
-
catch (
|
|
946
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
915
947
|
finally {
|
|
916
948
|
try {
|
|
917
949
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
918
950
|
}
|
|
919
|
-
finally { if (
|
|
951
|
+
finally { if (e_5) throw e_5.error; }
|
|
920
952
|
}
|
|
921
953
|
}
|
|
922
954
|
};
|
|
923
955
|
DockviewComponent.prototype.updateDragAndDropState = function () {
|
|
924
|
-
var
|
|
956
|
+
var e_6, _a;
|
|
925
957
|
try {
|
|
926
958
|
// Update draggable state for all tabs and void containers
|
|
927
959
|
for (var _b = __values(this.groups), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
@@ -929,12 +961,12 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
929
961
|
group.model.updateDragAndDropState();
|
|
930
962
|
}
|
|
931
963
|
}
|
|
932
|
-
catch (
|
|
964
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
933
965
|
finally {
|
|
934
966
|
try {
|
|
935
967
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
936
968
|
}
|
|
937
|
-
finally { if (
|
|
969
|
+
finally { if (e_6) throw e_6.error; }
|
|
938
970
|
}
|
|
939
971
|
};
|
|
940
972
|
DockviewComponent.prototype.focus = function () {
|
|
@@ -1031,7 +1063,7 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1031
1063
|
return result;
|
|
1032
1064
|
};
|
|
1033
1065
|
DockviewComponent.prototype.fromJSON = function (data, options) {
|
|
1034
|
-
var
|
|
1066
|
+
var e_7, _a, e_8, _b, e_9, _c, e_10, _d, e_11, _e, e_12, _f, e_13, _g;
|
|
1035
1067
|
var _this = this;
|
|
1036
1068
|
var _h, _j;
|
|
1037
1069
|
var existingPanels = new Map();
|
|
@@ -1054,12 +1086,12 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1054
1086
|
}
|
|
1055
1087
|
}
|
|
1056
1088
|
}
|
|
1057
|
-
catch (
|
|
1089
|
+
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
1058
1090
|
finally {
|
|
1059
1091
|
try {
|
|
1060
1092
|
if (_l && !_l.done && (_a = _k.return)) _a.call(_k);
|
|
1061
1093
|
}
|
|
1062
|
-
finally { if (
|
|
1094
|
+
finally { if (e_7) throw e_7.error; }
|
|
1063
1095
|
}
|
|
1064
1096
|
this.movingLock(function () {
|
|
1065
1097
|
Array.from(existingPanels.values()).forEach(function (panel) {
|
|
@@ -1090,8 +1122,8 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1090
1122
|
var width = this.width;
|
|
1091
1123
|
var height = this.height;
|
|
1092
1124
|
var createGroupFromSerializedState_1 = function (data) {
|
|
1093
|
-
var
|
|
1094
|
-
var id = data.id, locked = data.locked, hideHeader = data.hideHeader, views = data.views, activeView = data.activeView;
|
|
1125
|
+
var e_14, _a;
|
|
1126
|
+
var id = data.id, locked = data.locked, hideHeader = data.hideHeader, headerPosition = data.headerPosition, views = data.views, activeView = data.activeView;
|
|
1095
1127
|
if (typeof id !== 'string') {
|
|
1096
1128
|
throw new Error('dockview: group id must be of type string');
|
|
1097
1129
|
}
|
|
@@ -1099,6 +1131,7 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1099
1131
|
id: id,
|
|
1100
1132
|
locked: !!locked,
|
|
1101
1133
|
hideHeader: !!hideHeader,
|
|
1134
|
+
headerPosition: headerPosition,
|
|
1102
1135
|
});
|
|
1103
1136
|
_this._onDidAddGroup.fire(group);
|
|
1104
1137
|
var createdPanels = [];
|
|
@@ -1127,12 +1160,12 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1127
1160
|
_loop_1(child);
|
|
1128
1161
|
}
|
|
1129
1162
|
}
|
|
1130
|
-
catch (
|
|
1163
|
+
catch (e_14_1) { e_14 = { error: e_14_1 }; }
|
|
1131
1164
|
finally {
|
|
1132
1165
|
try {
|
|
1133
1166
|
if (views_1_1 && !views_1_1.done && (_a = views_1.return)) _a.call(views_1);
|
|
1134
1167
|
}
|
|
1135
|
-
finally { if (
|
|
1168
|
+
finally { if (e_14) throw e_14.error; }
|
|
1136
1169
|
}
|
|
1137
1170
|
var _loop_2 = function (i) {
|
|
1138
1171
|
var panel = createdPanels[i];
|
|
@@ -1185,12 +1218,12 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1185
1218
|
});
|
|
1186
1219
|
}
|
|
1187
1220
|
}
|
|
1188
|
-
catch (
|
|
1221
|
+
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
1189
1222
|
finally {
|
|
1190
1223
|
try {
|
|
1191
1224
|
if (serializedFloatingGroups_1_1 && !serializedFloatingGroups_1_1.done && (_b = serializedFloatingGroups_1.return)) _b.call(serializedFloatingGroups_1);
|
|
1192
1225
|
}
|
|
1193
|
-
finally { if (
|
|
1226
|
+
finally { if (e_8) throw e_8.error; }
|
|
1194
1227
|
}
|
|
1195
1228
|
var serializedPopoutGroups = (_j = data.popoutGroups) !== null && _j !== void 0 ? _j : [];
|
|
1196
1229
|
// Create a promise that resolves when all popout groups are created
|
|
@@ -1225,12 +1258,12 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1225
1258
|
floatingGroup.overlay.setBounds();
|
|
1226
1259
|
}
|
|
1227
1260
|
}
|
|
1228
|
-
catch (
|
|
1261
|
+
catch (e_9_1) { e_9 = { error: e_9_1 }; }
|
|
1229
1262
|
finally {
|
|
1230
1263
|
try {
|
|
1231
1264
|
if (_o && !_o.done && (_c = _m.return)) _c.call(_m);
|
|
1232
1265
|
}
|
|
1233
|
-
finally { if (
|
|
1266
|
+
finally { if (e_9) throw e_9.error; }
|
|
1234
1267
|
}
|
|
1235
1268
|
if (typeof activeGroup === 'string') {
|
|
1236
1269
|
var panel = this.getPanel(activeGroup);
|
|
@@ -1248,7 +1281,7 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1248
1281
|
for (var _p = __values(this.groups), _q = _p.next(); !_q.done; _q = _p.next()) {
|
|
1249
1282
|
var group = _q.value;
|
|
1250
1283
|
try {
|
|
1251
|
-
for (var _r = (
|
|
1284
|
+
for (var _r = (e_11 = void 0, __values(group.panels)), _s = _r.next(); !_s.done; _s = _r.next()) {
|
|
1252
1285
|
var panel = _s.value;
|
|
1253
1286
|
this.removePanel(panel, {
|
|
1254
1287
|
removeEmptyGroup: false,
|
|
@@ -1256,21 +1289,21 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1256
1289
|
});
|
|
1257
1290
|
}
|
|
1258
1291
|
}
|
|
1259
|
-
catch (
|
|
1292
|
+
catch (e_11_1) { e_11 = { error: e_11_1 }; }
|
|
1260
1293
|
finally {
|
|
1261
1294
|
try {
|
|
1262
1295
|
if (_s && !_s.done && (_e = _r.return)) _e.call(_r);
|
|
1263
1296
|
}
|
|
1264
|
-
finally { if (
|
|
1297
|
+
finally { if (e_11) throw e_11.error; }
|
|
1265
1298
|
}
|
|
1266
1299
|
}
|
|
1267
1300
|
}
|
|
1268
|
-
catch (
|
|
1301
|
+
catch (e_10_1) { e_10 = { error: e_10_1 }; }
|
|
1269
1302
|
finally {
|
|
1270
1303
|
try {
|
|
1271
1304
|
if (_q && !_q.done && (_d = _p.return)) _d.call(_p);
|
|
1272
1305
|
}
|
|
1273
|
-
finally { if (
|
|
1306
|
+
finally { if (e_10) throw e_10.error; }
|
|
1274
1307
|
}
|
|
1275
1308
|
try {
|
|
1276
1309
|
/**
|
|
@@ -1284,12 +1317,12 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1284
1317
|
this._onDidRemoveGroup.fire(group);
|
|
1285
1318
|
}
|
|
1286
1319
|
}
|
|
1287
|
-
catch (
|
|
1320
|
+
catch (e_12_1) { e_12 = { error: e_12_1 }; }
|
|
1288
1321
|
finally {
|
|
1289
1322
|
try {
|
|
1290
1323
|
if (_u && !_u.done && (_f = _t.return)) _f.call(_t);
|
|
1291
1324
|
}
|
|
1292
|
-
finally { if (
|
|
1325
|
+
finally { if (e_12) throw e_12.error; }
|
|
1293
1326
|
}
|
|
1294
1327
|
try {
|
|
1295
1328
|
// iterate over a reassigned array since original array will be modified
|
|
@@ -1298,12 +1331,12 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1298
1331
|
floatingGroup.dispose();
|
|
1299
1332
|
}
|
|
1300
1333
|
}
|
|
1301
|
-
catch (
|
|
1334
|
+
catch (e_13_1) { e_13 = { error: e_13_1 }; }
|
|
1302
1335
|
finally {
|
|
1303
1336
|
try {
|
|
1304
1337
|
if (_w && !_w.done && (_g = _v.return)) _g.call(_v);
|
|
1305
1338
|
}
|
|
1306
|
-
finally { if (
|
|
1339
|
+
finally { if (e_13) throw e_13.error; }
|
|
1307
1340
|
}
|
|
1308
1341
|
// fires clean-up events and clears the underlying HTML gridview.
|
|
1309
1342
|
this.clear();
|
|
@@ -1316,13 +1349,11 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1316
1349
|
}
|
|
1317
1350
|
this.updateWatermark();
|
|
1318
1351
|
// Force position updates for always visible panels after DOM layout is complete
|
|
1319
|
-
|
|
1320
|
-
_this.overlayRenderContainer.updateAllPositions();
|
|
1321
|
-
});
|
|
1352
|
+
this.debouncedUpdateAllPositions();
|
|
1322
1353
|
this._onDidLayoutFromJSON.fire();
|
|
1323
1354
|
};
|
|
1324
1355
|
DockviewComponent.prototype.clear = function () {
|
|
1325
|
-
var
|
|
1356
|
+
var e_15, _a;
|
|
1326
1357
|
var groups = Array.from(this._groups.values()).map(function (_) { return _.value; });
|
|
1327
1358
|
var hasActiveGroup = !!this.activeGroup;
|
|
1328
1359
|
try {
|
|
@@ -1332,12 +1363,12 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1332
1363
|
this.removeGroup(group, { skipActive: true });
|
|
1333
1364
|
}
|
|
1334
1365
|
}
|
|
1335
|
-
catch (
|
|
1366
|
+
catch (e_15_1) { e_15 = { error: e_15_1 }; }
|
|
1336
1367
|
finally {
|
|
1337
1368
|
try {
|
|
1338
1369
|
if (groups_1_1 && !groups_1_1.done && (_a = groups_1.return)) _a.call(groups_1);
|
|
1339
1370
|
}
|
|
1340
|
-
finally { if (
|
|
1371
|
+
finally { if (e_15) throw e_15.error; }
|
|
1341
1372
|
}
|
|
1342
1373
|
if (hasActiveGroup) {
|
|
1343
1374
|
this.doSetGroupAndPanelActive(undefined);
|
|
@@ -1345,7 +1376,7 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1345
1376
|
this.gridview.clear();
|
|
1346
1377
|
};
|
|
1347
1378
|
DockviewComponent.prototype.closeAllGroups = function () {
|
|
1348
|
-
var
|
|
1379
|
+
var e_16, _a;
|
|
1349
1380
|
try {
|
|
1350
1381
|
for (var _b = __values(this._groups.entries()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1351
1382
|
var entry = _c.value;
|
|
@@ -1353,12 +1384,12 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1353
1384
|
group.value.model.closeAllPanels();
|
|
1354
1385
|
}
|
|
1355
1386
|
}
|
|
1356
|
-
catch (
|
|
1387
|
+
catch (e_16_1) { e_16 = { error: e_16_1 }; }
|
|
1357
1388
|
finally {
|
|
1358
1389
|
try {
|
|
1359
1390
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1360
1391
|
}
|
|
1361
|
-
finally { if (
|
|
1392
|
+
finally { if (e_16) throw e_16.error; }
|
|
1362
1393
|
}
|
|
1363
1394
|
};
|
|
1364
1395
|
DockviewComponent.prototype.addPanel = function (options) {
|
|
@@ -1609,7 +1640,7 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1609
1640
|
this.doRemoveGroup(group, options);
|
|
1610
1641
|
};
|
|
1611
1642
|
DockviewComponent.prototype.doRemoveGroup = function (group, options) {
|
|
1612
|
-
var
|
|
1643
|
+
var e_17, _a;
|
|
1613
1644
|
var _b;
|
|
1614
1645
|
var panels = __spreadArray([], __read(group.panels), false); // reassign since group panels will mutate
|
|
1615
1646
|
if (!(options === null || options === void 0 ? void 0 : options.skipDispose)) {
|
|
@@ -1622,12 +1653,12 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1622
1653
|
});
|
|
1623
1654
|
}
|
|
1624
1655
|
}
|
|
1625
|
-
catch (
|
|
1656
|
+
catch (e_17_1) { e_17 = { error: e_17_1 }; }
|
|
1626
1657
|
finally {
|
|
1627
1658
|
try {
|
|
1628
1659
|
if (panels_1_1 && !panels_1_1.done && (_a = panels_1.return)) _a.call(panels_1);
|
|
1629
1660
|
}
|
|
1630
|
-
finally { if (
|
|
1661
|
+
finally { if (e_17) throw e_17.error; }
|
|
1631
1662
|
}
|
|
1632
1663
|
}
|
|
1633
1664
|
var activePanel = this.activePanel;
|
|
@@ -1688,6 +1719,16 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1688
1719
|
}
|
|
1689
1720
|
return re;
|
|
1690
1721
|
};
|
|
1722
|
+
DockviewComponent.prototype.debouncedUpdateAllPositions = function () {
|
|
1723
|
+
var _this = this;
|
|
1724
|
+
if (this._updatePositionsFrameId !== undefined) {
|
|
1725
|
+
cancelAnimationFrame(this._updatePositionsFrameId);
|
|
1726
|
+
}
|
|
1727
|
+
this._updatePositionsFrameId = requestAnimationFrame(function () {
|
|
1728
|
+
_this._updatePositionsFrameId = undefined;
|
|
1729
|
+
_this.overlayRenderContainer.updateAllPositions();
|
|
1730
|
+
});
|
|
1731
|
+
};
|
|
1691
1732
|
DockviewComponent.prototype.movingLock = function (func) {
|
|
1692
1733
|
var isMoving = this._moving;
|
|
1693
1734
|
try {
|
|
@@ -1761,13 +1802,6 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1761
1802
|
panel: removedPanel_1,
|
|
1762
1803
|
from: sourceGroup,
|
|
1763
1804
|
});
|
|
1764
|
-
/**
|
|
1765
|
-
* Update overlay positions after DOM layout completes to prevent 0×0 dimensions.
|
|
1766
|
-
* With defaultRenderer="always" this results in panel content not showing after move operations.
|
|
1767
|
-
*/
|
|
1768
|
-
requestAnimationFrame(function () {
|
|
1769
|
-
_this.overlayRenderContainer.updateAllPositions();
|
|
1770
|
-
});
|
|
1771
1805
|
}
|
|
1772
1806
|
else {
|
|
1773
1807
|
/**
|
|
@@ -1890,7 +1924,7 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1890
1924
|
this.doRemoveGroup(from, { skipActive: true });
|
|
1891
1925
|
}
|
|
1892
1926
|
this.movingLock(function () {
|
|
1893
|
-
var
|
|
1927
|
+
var e_18, _a;
|
|
1894
1928
|
try {
|
|
1895
1929
|
for (var panels_3 = __values(panels_2), panels_3_1 = panels_3.next(); !panels_3_1.done; panels_3_1 = panels_3.next()) {
|
|
1896
1930
|
var panel = panels_3_1.value;
|
|
@@ -1900,12 +1934,12 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1900
1934
|
});
|
|
1901
1935
|
}
|
|
1902
1936
|
}
|
|
1903
|
-
catch (
|
|
1937
|
+
catch (e_18_1) { e_18 = { error: e_18_1 }; }
|
|
1904
1938
|
finally {
|
|
1905
1939
|
try {
|
|
1906
1940
|
if (panels_3_1 && !panels_3_1.done && (_a = panels_3.return)) _a.call(panels_3);
|
|
1907
1941
|
}
|
|
1908
|
-
finally { if (
|
|
1942
|
+
finally { if (e_18) throw e_18.error; }
|
|
1909
1943
|
}
|
|
1910
1944
|
});
|
|
1911
1945
|
// Ensure group becomes active after move
|
|
@@ -2034,6 +2068,7 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
2034
2068
|
from.panels.forEach(function (panel) {
|
|
2035
2069
|
_this._onDidMovePanel.fire({ panel: panel, from: from });
|
|
2036
2070
|
});
|
|
2071
|
+
this.debouncedUpdateAllPositions();
|
|
2037
2072
|
// Ensure group becomes active after move
|
|
2038
2073
|
if (options.skipSetActive === false) {
|
|
2039
2074
|
// Only activate when explicitly requested (skipSetActive: false)
|
|
@@ -19,7 +19,6 @@ exports.DockviewGroupPanel = void 0;
|
|
|
19
19
|
var dockviewGroupPanelModel_1 = require("./dockviewGroupPanelModel");
|
|
20
20
|
var gridviewPanel_1 = require("../gridview/gridviewPanel");
|
|
21
21
|
var dockviewGroupPanelApi_1 = require("../api/dockviewGroupPanelApi");
|
|
22
|
-
// GridConstraintChangeEvent2 is not exported, so we'll type it manually
|
|
23
22
|
var MINIMUM_DOCKVIEW_GROUP_PANEL_WIDTH = 100;
|
|
24
23
|
var MINIMUM_DOCKVIEW_GROUP_PANEL_HEIGHT = 100;
|
|
25
24
|
var DockviewGroupPanel = /** @class */ (function (_super) {
|
|
@@ -42,24 +41,28 @@ var DockviewGroupPanel = /** @class */ (function (_super) {
|
|
|
42
41
|
// Track explicitly set constraints to override panel constraints
|
|
43
42
|
// Extract numeric values from functions or values
|
|
44
43
|
if (event.minimumWidth !== undefined) {
|
|
45
|
-
_this._explicitConstraints.minimumWidth =
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
_this._explicitConstraints.minimumWidth =
|
|
45
|
+
typeof event.minimumWidth === 'function'
|
|
46
|
+
? event.minimumWidth()
|
|
47
|
+
: event.minimumWidth;
|
|
48
48
|
}
|
|
49
49
|
if (event.minimumHeight !== undefined) {
|
|
50
|
-
_this._explicitConstraints.minimumHeight =
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
_this._explicitConstraints.minimumHeight =
|
|
51
|
+
typeof event.minimumHeight === 'function'
|
|
52
|
+
? event.minimumHeight()
|
|
53
|
+
: event.minimumHeight;
|
|
53
54
|
}
|
|
54
55
|
if (event.maximumWidth !== undefined) {
|
|
55
|
-
_this._explicitConstraints.maximumWidth =
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
_this._explicitConstraints.maximumWidth =
|
|
57
|
+
typeof event.maximumWidth === 'function'
|
|
58
|
+
? event.maximumWidth()
|
|
59
|
+
: event.maximumWidth;
|
|
58
60
|
}
|
|
59
61
|
if (event.maximumHeight !== undefined) {
|
|
60
|
-
_this._explicitConstraints.maximumHeight =
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
_this._explicitConstraints.maximumHeight =
|
|
63
|
+
typeof event.maximumHeight === 'function'
|
|
64
|
+
? event.maximumHeight()
|
|
65
|
+
: event.maximumHeight;
|
|
63
66
|
}
|
|
64
67
|
}));
|
|
65
68
|
return _this;
|
|
@@ -10,7 +10,7 @@ import { IPanel, PanelInitParameters, PanelUpdateEvent, Parameters } from '../pa
|
|
|
10
10
|
import { GroupDragEvent, TabDragEvent } from './components/titlebar/tabsContainer';
|
|
11
11
|
import { DockviewGroupPanel } from './dockviewGroupPanel';
|
|
12
12
|
import { IDockviewPanel } from './dockviewPanel';
|
|
13
|
-
import { DockviewDndOverlayEvent } from './options';
|
|
13
|
+
import { DockviewDndOverlayEvent, DockviewHeaderDirection, DockviewHeaderPosition } from './options';
|
|
14
14
|
import { OverlayRenderContainer } from '../overlay/overlayRenderContainer';
|
|
15
15
|
import { TitleEvent } from '../api/dockviewPanelApi';
|
|
16
16
|
import { Contraints } from '../gridview/gridviewPanel';
|
|
@@ -24,6 +24,7 @@ interface GroupMoveEvent {
|
|
|
24
24
|
interface CoreGroupOptions {
|
|
25
25
|
locked?: DockviewGroupPanelLocked;
|
|
26
26
|
hideHeader?: boolean;
|
|
27
|
+
headerPosition?: 'top' | 'bottom' | 'left' | 'right';
|
|
27
28
|
skipSetActive?: boolean;
|
|
28
29
|
constraints?: Partial<Contraints>;
|
|
29
30
|
initialWidth?: number;
|
|
@@ -74,6 +75,7 @@ export declare class DockviewWillDropEvent extends DockviewDidDropEvent {
|
|
|
74
75
|
}
|
|
75
76
|
export interface IHeader {
|
|
76
77
|
hidden: boolean;
|
|
78
|
+
direction: DockviewHeaderDirection;
|
|
77
79
|
}
|
|
78
80
|
export type DockviewGroupPanelLocked = boolean | 'no-drop-target';
|
|
79
81
|
export interface IDockviewGroupPanelModel extends IPanel {
|
|
@@ -90,6 +92,7 @@ export interface IDockviewGroupPanelModel extends IPanel {
|
|
|
90
92
|
readonly onDidActivePanelChange: Event<DockviewGroupChangeEvent>;
|
|
91
93
|
readonly onMove: Event<GroupMoveEvent>;
|
|
92
94
|
locked: DockviewGroupPanelLocked;
|
|
95
|
+
headerPosition: DockviewHeaderPosition;
|
|
93
96
|
setActive(isActive: boolean): void;
|
|
94
97
|
initialize(): void;
|
|
95
98
|
isPanelActive: (panel: IDockviewPanel) => boolean;
|
|
@@ -138,6 +141,10 @@ export declare class DockviewGroupPanelModel extends CompositeDisposable impleme
|
|
|
138
141
|
private _rightHeaderActions;
|
|
139
142
|
private _leftHeaderActions;
|
|
140
143
|
private _prefixHeaderActions;
|
|
144
|
+
private readonly _rightHeaderActionsDisposable;
|
|
145
|
+
private readonly _leftHeaderActionsDisposable;
|
|
146
|
+
private readonly _prefixHeaderActionsDisposable;
|
|
147
|
+
private _headerPosition;
|
|
141
148
|
private _location;
|
|
142
149
|
private mostRecentlyUsed;
|
|
143
150
|
private _overwriteRenderContainer;
|
|
@@ -184,6 +191,8 @@ export declare class DockviewGroupPanelModel extends CompositeDisposable impleme
|
|
|
184
191
|
get hasWatermark(): boolean;
|
|
185
192
|
get header(): IHeader;
|
|
186
193
|
get isContentFocused(): boolean;
|
|
194
|
+
get headerPosition(): DockviewHeaderPosition;
|
|
195
|
+
set headerPosition(value: DockviewHeaderPosition);
|
|
187
196
|
get location(): DockviewGroupLocation;
|
|
188
197
|
set location(value: DockviewGroupLocation);
|
|
189
198
|
constructor(container: HTMLElement, accessor: DockviewComponent, id: string, options: GroupOptions, groupPanel: DockviewGroupPanel);
|
|
@@ -193,6 +202,7 @@ export declare class DockviewGroupPanelModel extends CompositeDisposable impleme
|
|
|
193
202
|
set dropTargetContainer(value: DropTargetAnchorContainer | null);
|
|
194
203
|
get dropTargetContainer(): DropTargetAnchorContainer | null;
|
|
195
204
|
initialize(): void;
|
|
205
|
+
updateHeaderActions(): void;
|
|
196
206
|
rerender(panel: IDockviewPanel): void;
|
|
197
207
|
indexOf(panel: IDockviewPanel): number;
|
|
198
208
|
toJSON(): GroupPanelViewState;
|