dockview-core 4.13.1 → 5.1.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 +2 -1
- package/dist/cjs/dockview/dockviewComponent.js +73 -47
- 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/overlay/overlayRenderContainer.js +8 -0
- package/dist/cjs/scrollbar.d.ts +5 -2
- package/dist/cjs/scrollbar.js +88 -26
- package/dist/dockview-core.js +273 -66
- 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 +272 -65
- 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 +2 -1
- package/dist/esm/dockview/dockviewComponent.js +15 -3
- 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/overlay/overlayRenderContainer.js +8 -0
- 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} +273 -66
- 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} +273 -66
- package/dist/styles/dockview.css +63 -7
- package/package.json +63 -53
- package/dist/dockview-core.amd.js +0 -11373
- 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 -11343
- 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
|
@@ -374,6 +374,14 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
374
374
|
enumerable: false,
|
|
375
375
|
configurable: true
|
|
376
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
|
+
});
|
|
377
385
|
Object.defineProperty(DockviewComponent.prototype, "api", {
|
|
378
386
|
get: function () {
|
|
379
387
|
return this._api;
|
|
@@ -777,9 +785,9 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
777
785
|
var anchoredBox = getAnchoredBox();
|
|
778
786
|
var overlay = new overlay_1.Overlay(__assign(__assign({ container: this.gridview.element, content: group.element }, anchoredBox), { minimumInViewportWidth: this.options.floatingGroupBounds === 'boundedWithinViewport'
|
|
779
787
|
? undefined
|
|
780
|
-
: (_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'
|
|
781
789
|
? undefined
|
|
782
|
-
: (_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) }));
|
|
783
791
|
var el = group.element.querySelector('.dv-void-container');
|
|
784
792
|
if (!el) {
|
|
785
793
|
throw new Error('dockview: failed to find drag handle');
|
|
@@ -860,13 +868,13 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
860
868
|
}
|
|
861
869
|
};
|
|
862
870
|
DockviewComponent.prototype.updateOptions = function (options) {
|
|
863
|
-
var e_3, _a;
|
|
864
|
-
var
|
|
871
|
+
var e_3, _a, e_4, _b;
|
|
872
|
+
var _c, _d;
|
|
865
873
|
_super.prototype.updateOptions.call(this, options);
|
|
866
874
|
if ('floatingGroupBounds' in options) {
|
|
867
875
|
try {
|
|
868
|
-
for (var
|
|
869
|
-
var group =
|
|
876
|
+
for (var _e = __values(this._floatingGroups), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
877
|
+
var group = _f.value;
|
|
870
878
|
switch (options.floatingGroupBounds) {
|
|
871
879
|
case 'boundedWithinViewport':
|
|
872
880
|
group.overlay.minimumInViewportHeight = undefined;
|
|
@@ -880,9 +888,9 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
880
888
|
break;
|
|
881
889
|
default:
|
|
882
890
|
group.overlay.minimumInViewportHeight =
|
|
883
|
-
(
|
|
891
|
+
(_c = options.floatingGroupBounds) === null || _c === void 0 ? void 0 : _c.minimumHeightWithinViewport;
|
|
884
892
|
group.overlay.minimumInViewportWidth =
|
|
885
|
-
(
|
|
893
|
+
(_d = options.floatingGroupBounds) === null || _d === void 0 ? void 0 : _d.minimumWidthWithinViewport;
|
|
886
894
|
}
|
|
887
895
|
group.overlay.setBounds();
|
|
888
896
|
}
|
|
@@ -890,7 +898,7 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
890
898
|
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
891
899
|
finally {
|
|
892
900
|
try {
|
|
893
|
-
if (
|
|
901
|
+
if (_f && !_f.done && (_a = _e.return)) _a.call(_e);
|
|
894
902
|
}
|
|
895
903
|
finally { if (e_3) throw e_3.error; }
|
|
896
904
|
}
|
|
@@ -905,10 +913,27 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
905
913
|
if ('theme' in options) {
|
|
906
914
|
this.updateTheme();
|
|
907
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
|
+
}
|
|
908
933
|
this.layout(this.gridview.width, this.gridview.height, true);
|
|
909
934
|
};
|
|
910
935
|
DockviewComponent.prototype.layout = function (width, height, forceResize) {
|
|
911
|
-
var
|
|
936
|
+
var e_5, _a;
|
|
912
937
|
_super.prototype.layout.call(this, width, height, forceResize);
|
|
913
938
|
if (this._floatingGroups) {
|
|
914
939
|
try {
|
|
@@ -918,17 +943,17 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
918
943
|
floating.overlay.setBounds();
|
|
919
944
|
}
|
|
920
945
|
}
|
|
921
|
-
catch (
|
|
946
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
922
947
|
finally {
|
|
923
948
|
try {
|
|
924
949
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
925
950
|
}
|
|
926
|
-
finally { if (
|
|
951
|
+
finally { if (e_5) throw e_5.error; }
|
|
927
952
|
}
|
|
928
953
|
}
|
|
929
954
|
};
|
|
930
955
|
DockviewComponent.prototype.updateDragAndDropState = function () {
|
|
931
|
-
var
|
|
956
|
+
var e_6, _a;
|
|
932
957
|
try {
|
|
933
958
|
// Update draggable state for all tabs and void containers
|
|
934
959
|
for (var _b = __values(this.groups), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
@@ -936,12 +961,12 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
936
961
|
group.model.updateDragAndDropState();
|
|
937
962
|
}
|
|
938
963
|
}
|
|
939
|
-
catch (
|
|
964
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
940
965
|
finally {
|
|
941
966
|
try {
|
|
942
967
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
943
968
|
}
|
|
944
|
-
finally { if (
|
|
969
|
+
finally { if (e_6) throw e_6.error; }
|
|
945
970
|
}
|
|
946
971
|
};
|
|
947
972
|
DockviewComponent.prototype.focus = function () {
|
|
@@ -1038,7 +1063,7 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1038
1063
|
return result;
|
|
1039
1064
|
};
|
|
1040
1065
|
DockviewComponent.prototype.fromJSON = function (data, options) {
|
|
1041
|
-
var
|
|
1066
|
+
var e_7, _a, e_8, _b, e_9, _c, e_10, _d, e_11, _e, e_12, _f, e_13, _g;
|
|
1042
1067
|
var _this = this;
|
|
1043
1068
|
var _h, _j;
|
|
1044
1069
|
var existingPanels = new Map();
|
|
@@ -1061,12 +1086,12 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1061
1086
|
}
|
|
1062
1087
|
}
|
|
1063
1088
|
}
|
|
1064
|
-
catch (
|
|
1089
|
+
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
1065
1090
|
finally {
|
|
1066
1091
|
try {
|
|
1067
1092
|
if (_l && !_l.done && (_a = _k.return)) _a.call(_k);
|
|
1068
1093
|
}
|
|
1069
|
-
finally { if (
|
|
1094
|
+
finally { if (e_7) throw e_7.error; }
|
|
1070
1095
|
}
|
|
1071
1096
|
this.movingLock(function () {
|
|
1072
1097
|
Array.from(existingPanels.values()).forEach(function (panel) {
|
|
@@ -1097,8 +1122,8 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1097
1122
|
var width = this.width;
|
|
1098
1123
|
var height = this.height;
|
|
1099
1124
|
var createGroupFromSerializedState_1 = function (data) {
|
|
1100
|
-
var
|
|
1101
|
-
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;
|
|
1102
1127
|
if (typeof id !== 'string') {
|
|
1103
1128
|
throw new Error('dockview: group id must be of type string');
|
|
1104
1129
|
}
|
|
@@ -1106,6 +1131,7 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1106
1131
|
id: id,
|
|
1107
1132
|
locked: !!locked,
|
|
1108
1133
|
hideHeader: !!hideHeader,
|
|
1134
|
+
headerPosition: headerPosition,
|
|
1109
1135
|
});
|
|
1110
1136
|
_this._onDidAddGroup.fire(group);
|
|
1111
1137
|
var createdPanels = [];
|
|
@@ -1134,12 +1160,12 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1134
1160
|
_loop_1(child);
|
|
1135
1161
|
}
|
|
1136
1162
|
}
|
|
1137
|
-
catch (
|
|
1163
|
+
catch (e_14_1) { e_14 = { error: e_14_1 }; }
|
|
1138
1164
|
finally {
|
|
1139
1165
|
try {
|
|
1140
1166
|
if (views_1_1 && !views_1_1.done && (_a = views_1.return)) _a.call(views_1);
|
|
1141
1167
|
}
|
|
1142
|
-
finally { if (
|
|
1168
|
+
finally { if (e_14) throw e_14.error; }
|
|
1143
1169
|
}
|
|
1144
1170
|
var _loop_2 = function (i) {
|
|
1145
1171
|
var panel = createdPanels[i];
|
|
@@ -1192,12 +1218,12 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1192
1218
|
});
|
|
1193
1219
|
}
|
|
1194
1220
|
}
|
|
1195
|
-
catch (
|
|
1221
|
+
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
1196
1222
|
finally {
|
|
1197
1223
|
try {
|
|
1198
1224
|
if (serializedFloatingGroups_1_1 && !serializedFloatingGroups_1_1.done && (_b = serializedFloatingGroups_1.return)) _b.call(serializedFloatingGroups_1);
|
|
1199
1225
|
}
|
|
1200
|
-
finally { if (
|
|
1226
|
+
finally { if (e_8) throw e_8.error; }
|
|
1201
1227
|
}
|
|
1202
1228
|
var serializedPopoutGroups = (_j = data.popoutGroups) !== null && _j !== void 0 ? _j : [];
|
|
1203
1229
|
// Create a promise that resolves when all popout groups are created
|
|
@@ -1232,12 +1258,12 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1232
1258
|
floatingGroup.overlay.setBounds();
|
|
1233
1259
|
}
|
|
1234
1260
|
}
|
|
1235
|
-
catch (
|
|
1261
|
+
catch (e_9_1) { e_9 = { error: e_9_1 }; }
|
|
1236
1262
|
finally {
|
|
1237
1263
|
try {
|
|
1238
1264
|
if (_o && !_o.done && (_c = _m.return)) _c.call(_m);
|
|
1239
1265
|
}
|
|
1240
|
-
finally { if (
|
|
1266
|
+
finally { if (e_9) throw e_9.error; }
|
|
1241
1267
|
}
|
|
1242
1268
|
if (typeof activeGroup === 'string') {
|
|
1243
1269
|
var panel = this.getPanel(activeGroup);
|
|
@@ -1255,7 +1281,7 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1255
1281
|
for (var _p = __values(this.groups), _q = _p.next(); !_q.done; _q = _p.next()) {
|
|
1256
1282
|
var group = _q.value;
|
|
1257
1283
|
try {
|
|
1258
|
-
for (var _r = (
|
|
1284
|
+
for (var _r = (e_11 = void 0, __values(group.panels)), _s = _r.next(); !_s.done; _s = _r.next()) {
|
|
1259
1285
|
var panel = _s.value;
|
|
1260
1286
|
this.removePanel(panel, {
|
|
1261
1287
|
removeEmptyGroup: false,
|
|
@@ -1263,21 +1289,21 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1263
1289
|
});
|
|
1264
1290
|
}
|
|
1265
1291
|
}
|
|
1266
|
-
catch (
|
|
1292
|
+
catch (e_11_1) { e_11 = { error: e_11_1 }; }
|
|
1267
1293
|
finally {
|
|
1268
1294
|
try {
|
|
1269
1295
|
if (_s && !_s.done && (_e = _r.return)) _e.call(_r);
|
|
1270
1296
|
}
|
|
1271
|
-
finally { if (
|
|
1297
|
+
finally { if (e_11) throw e_11.error; }
|
|
1272
1298
|
}
|
|
1273
1299
|
}
|
|
1274
1300
|
}
|
|
1275
|
-
catch (
|
|
1301
|
+
catch (e_10_1) { e_10 = { error: e_10_1 }; }
|
|
1276
1302
|
finally {
|
|
1277
1303
|
try {
|
|
1278
1304
|
if (_q && !_q.done && (_d = _p.return)) _d.call(_p);
|
|
1279
1305
|
}
|
|
1280
|
-
finally { if (
|
|
1306
|
+
finally { if (e_10) throw e_10.error; }
|
|
1281
1307
|
}
|
|
1282
1308
|
try {
|
|
1283
1309
|
/**
|
|
@@ -1291,12 +1317,12 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1291
1317
|
this._onDidRemoveGroup.fire(group);
|
|
1292
1318
|
}
|
|
1293
1319
|
}
|
|
1294
|
-
catch (
|
|
1320
|
+
catch (e_12_1) { e_12 = { error: e_12_1 }; }
|
|
1295
1321
|
finally {
|
|
1296
1322
|
try {
|
|
1297
1323
|
if (_u && !_u.done && (_f = _t.return)) _f.call(_t);
|
|
1298
1324
|
}
|
|
1299
|
-
finally { if (
|
|
1325
|
+
finally { if (e_12) throw e_12.error; }
|
|
1300
1326
|
}
|
|
1301
1327
|
try {
|
|
1302
1328
|
// iterate over a reassigned array since original array will be modified
|
|
@@ -1305,12 +1331,12 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1305
1331
|
floatingGroup.dispose();
|
|
1306
1332
|
}
|
|
1307
1333
|
}
|
|
1308
|
-
catch (
|
|
1334
|
+
catch (e_13_1) { e_13 = { error: e_13_1 }; }
|
|
1309
1335
|
finally {
|
|
1310
1336
|
try {
|
|
1311
1337
|
if (_w && !_w.done && (_g = _v.return)) _g.call(_v);
|
|
1312
1338
|
}
|
|
1313
|
-
finally { if (
|
|
1339
|
+
finally { if (e_13) throw e_13.error; }
|
|
1314
1340
|
}
|
|
1315
1341
|
// fires clean-up events and clears the underlying HTML gridview.
|
|
1316
1342
|
this.clear();
|
|
@@ -1327,7 +1353,7 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1327
1353
|
this._onDidLayoutFromJSON.fire();
|
|
1328
1354
|
};
|
|
1329
1355
|
DockviewComponent.prototype.clear = function () {
|
|
1330
|
-
var
|
|
1356
|
+
var e_15, _a;
|
|
1331
1357
|
var groups = Array.from(this._groups.values()).map(function (_) { return _.value; });
|
|
1332
1358
|
var hasActiveGroup = !!this.activeGroup;
|
|
1333
1359
|
try {
|
|
@@ -1337,12 +1363,12 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1337
1363
|
this.removeGroup(group, { skipActive: true });
|
|
1338
1364
|
}
|
|
1339
1365
|
}
|
|
1340
|
-
catch (
|
|
1366
|
+
catch (e_15_1) { e_15 = { error: e_15_1 }; }
|
|
1341
1367
|
finally {
|
|
1342
1368
|
try {
|
|
1343
1369
|
if (groups_1_1 && !groups_1_1.done && (_a = groups_1.return)) _a.call(groups_1);
|
|
1344
1370
|
}
|
|
1345
|
-
finally { if (
|
|
1371
|
+
finally { if (e_15) throw e_15.error; }
|
|
1346
1372
|
}
|
|
1347
1373
|
if (hasActiveGroup) {
|
|
1348
1374
|
this.doSetGroupAndPanelActive(undefined);
|
|
@@ -1350,7 +1376,7 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1350
1376
|
this.gridview.clear();
|
|
1351
1377
|
};
|
|
1352
1378
|
DockviewComponent.prototype.closeAllGroups = function () {
|
|
1353
|
-
var
|
|
1379
|
+
var e_16, _a;
|
|
1354
1380
|
try {
|
|
1355
1381
|
for (var _b = __values(this._groups.entries()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1356
1382
|
var entry = _c.value;
|
|
@@ -1358,12 +1384,12 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1358
1384
|
group.value.model.closeAllPanels();
|
|
1359
1385
|
}
|
|
1360
1386
|
}
|
|
1361
|
-
catch (
|
|
1387
|
+
catch (e_16_1) { e_16 = { error: e_16_1 }; }
|
|
1362
1388
|
finally {
|
|
1363
1389
|
try {
|
|
1364
1390
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1365
1391
|
}
|
|
1366
|
-
finally { if (
|
|
1392
|
+
finally { if (e_16) throw e_16.error; }
|
|
1367
1393
|
}
|
|
1368
1394
|
};
|
|
1369
1395
|
DockviewComponent.prototype.addPanel = function (options) {
|
|
@@ -1614,7 +1640,7 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1614
1640
|
this.doRemoveGroup(group, options);
|
|
1615
1641
|
};
|
|
1616
1642
|
DockviewComponent.prototype.doRemoveGroup = function (group, options) {
|
|
1617
|
-
var
|
|
1643
|
+
var e_17, _a;
|
|
1618
1644
|
var _b;
|
|
1619
1645
|
var panels = __spreadArray([], __read(group.panels), false); // reassign since group panels will mutate
|
|
1620
1646
|
if (!(options === null || options === void 0 ? void 0 : options.skipDispose)) {
|
|
@@ -1627,12 +1653,12 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1627
1653
|
});
|
|
1628
1654
|
}
|
|
1629
1655
|
}
|
|
1630
|
-
catch (
|
|
1656
|
+
catch (e_17_1) { e_17 = { error: e_17_1 }; }
|
|
1631
1657
|
finally {
|
|
1632
1658
|
try {
|
|
1633
1659
|
if (panels_1_1 && !panels_1_1.done && (_a = panels_1.return)) _a.call(panels_1);
|
|
1634
1660
|
}
|
|
1635
|
-
finally { if (
|
|
1661
|
+
finally { if (e_17) throw e_17.error; }
|
|
1636
1662
|
}
|
|
1637
1663
|
}
|
|
1638
1664
|
var activePanel = this.activePanel;
|
|
@@ -1898,7 +1924,7 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1898
1924
|
this.doRemoveGroup(from, { skipActive: true });
|
|
1899
1925
|
}
|
|
1900
1926
|
this.movingLock(function () {
|
|
1901
|
-
var
|
|
1927
|
+
var e_18, _a;
|
|
1902
1928
|
try {
|
|
1903
1929
|
for (var panels_3 = __values(panels_2), panels_3_1 = panels_3.next(); !panels_3_1.done; panels_3_1 = panels_3.next()) {
|
|
1904
1930
|
var panel = panels_3_1.value;
|
|
@@ -1908,12 +1934,12 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1908
1934
|
});
|
|
1909
1935
|
}
|
|
1910
1936
|
}
|
|
1911
|
-
catch (
|
|
1937
|
+
catch (e_18_1) { e_18 = { error: e_18_1 }; }
|
|
1912
1938
|
finally {
|
|
1913
1939
|
try {
|
|
1914
1940
|
if (panels_3_1 && !panels_3_1.done && (_a = panels_3.return)) _a.call(panels_3);
|
|
1915
1941
|
}
|
|
1916
|
-
finally { if (
|
|
1942
|
+
finally { if (e_18) throw e_18.error; }
|
|
1917
1943
|
}
|
|
1918
1944
|
});
|
|
1919
1945
|
// Ensure group becomes active after move
|
|
@@ -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;
|
|
@@ -129,7 +129,7 @@ exports.DockviewWillDropEvent = DockviewWillDropEvent;
|
|
|
129
129
|
var DockviewGroupPanelModel = /** @class */ (function (_super) {
|
|
130
130
|
__extends(DockviewGroupPanelModel, _super);
|
|
131
131
|
function DockviewGroupPanelModel(container, accessor, id, options, groupPanel) {
|
|
132
|
-
var _a;
|
|
132
|
+
var _a, _b;
|
|
133
133
|
var _this = _super.call(this) || this;
|
|
134
134
|
_this.container = container;
|
|
135
135
|
_this.accessor = accessor;
|
|
@@ -138,6 +138,9 @@ var DockviewGroupPanelModel = /** @class */ (function (_super) {
|
|
|
138
138
|
_this.groupPanel = groupPanel;
|
|
139
139
|
_this._isGroupActive = false;
|
|
140
140
|
_this._locked = false;
|
|
141
|
+
_this._rightHeaderActionsDisposable = new lifecycle_1.MutableDisposable();
|
|
142
|
+
_this._leftHeaderActionsDisposable = new lifecycle_1.MutableDisposable();
|
|
143
|
+
_this._prefixHeaderActionsDisposable = new lifecycle_1.MutableDisposable();
|
|
141
144
|
_this._location = { type: 'grid' };
|
|
142
145
|
_this.mostRecentlyUsed = [];
|
|
143
146
|
_this._overwriteRenderContainer = null;
|
|
@@ -179,7 +182,9 @@ var DockviewGroupPanelModel = /** @class */ (function (_super) {
|
|
|
179
182
|
container.append(_this.tabsContainer.element, _this.contentContainer.element);
|
|
180
183
|
_this.header.hidden = !!options.hideHeader;
|
|
181
184
|
_this.locked = (_a = options.locked) !== null && _a !== void 0 ? _a : false;
|
|
182
|
-
_this.
|
|
185
|
+
_this.headerPosition =
|
|
186
|
+
(_b = options.headerPosition) !== null && _b !== void 0 ? _b : accessor.defaultHeaderPosition;
|
|
187
|
+
_this.addDisposables(_this._onTabDragStart, _this._onGroupDragStart, _this._onWillShowOverlay, _this._rightHeaderActionsDisposable, _this._leftHeaderActionsDisposable, _this._prefixHeaderActionsDisposable, _this.tabsContainer.onTabDragStart(function (event) {
|
|
183
188
|
_this._onTabDragStart.fire(event);
|
|
184
189
|
}), _this.tabsContainer.onGroupDragStart(function (event) {
|
|
185
190
|
_this._onGroupDragStart.fire(event);
|
|
@@ -281,6 +286,33 @@ var DockviewGroupPanelModel = /** @class */ (function (_super) {
|
|
|
281
286
|
enumerable: false,
|
|
282
287
|
configurable: true
|
|
283
288
|
});
|
|
289
|
+
Object.defineProperty(DockviewGroupPanelModel.prototype, "headerPosition", {
|
|
290
|
+
get: function () {
|
|
291
|
+
var _a;
|
|
292
|
+
return (_a = this._headerPosition) !== null && _a !== void 0 ? _a : 'top';
|
|
293
|
+
},
|
|
294
|
+
set: function (value) {
|
|
295
|
+
var _a;
|
|
296
|
+
this._headerPosition = value;
|
|
297
|
+
(0, dom_1.removeClasses)(this.container, 'dv-groupview-header-top', 'dv-groupview-header-bottom', 'dv-groupview-header-left', 'dv-groupview-header-right');
|
|
298
|
+
(0, dom_1.addClasses)(this.container, "dv-groupview-header-".concat(value));
|
|
299
|
+
var direction = value === 'top' || value === 'bottom' ? 'horizontal' : 'vertical';
|
|
300
|
+
this.tabsContainer.direction = direction;
|
|
301
|
+
this.header.direction = direction;
|
|
302
|
+
// resize the active panel to fit the new header direction
|
|
303
|
+
// if not, the panel will overflow the tabs container
|
|
304
|
+
if ((_a = this._activePanel) === null || _a === void 0 ? void 0 : _a.layout) {
|
|
305
|
+
this._activePanel.layout(this._width, this._height);
|
|
306
|
+
}
|
|
307
|
+
if (this._leftHeaderActions ||
|
|
308
|
+
this._rightHeaderActions ||
|
|
309
|
+
this._prefixHeaderActions) {
|
|
310
|
+
this.updateHeaderActions();
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
enumerable: false,
|
|
314
|
+
configurable: true
|
|
315
|
+
});
|
|
284
316
|
Object.defineProperty(DockviewGroupPanelModel.prototype, "location", {
|
|
285
317
|
get: function () {
|
|
286
318
|
return this._location;
|
|
@@ -364,10 +396,13 @@ var DockviewGroupPanelModel = /** @class */ (function (_super) {
|
|
|
364
396
|
// correctly initialized
|
|
365
397
|
this.setActive(this.isActive, true);
|
|
366
398
|
this.updateContainer();
|
|
399
|
+
this.updateHeaderActions();
|
|
400
|
+
};
|
|
401
|
+
DockviewGroupPanelModel.prototype.updateHeaderActions = function () {
|
|
367
402
|
if (this.accessor.options.createRightHeaderActionComponent) {
|
|
368
403
|
this._rightHeaderActions =
|
|
369
404
|
this.accessor.options.createRightHeaderActionComponent(this.groupPanel);
|
|
370
|
-
this.
|
|
405
|
+
this._rightHeaderActionsDisposable.value = this._rightHeaderActions;
|
|
371
406
|
this._rightHeaderActions.init({
|
|
372
407
|
containerApi: this._api,
|
|
373
408
|
api: this.groupPanel.api,
|
|
@@ -375,10 +410,15 @@ var DockviewGroupPanelModel = /** @class */ (function (_super) {
|
|
|
375
410
|
});
|
|
376
411
|
this.tabsContainer.setRightActionsElement(this._rightHeaderActions.element);
|
|
377
412
|
}
|
|
413
|
+
else {
|
|
414
|
+
this._rightHeaderActions = undefined;
|
|
415
|
+
this._rightHeaderActionsDisposable.dispose();
|
|
416
|
+
this.tabsContainer.setRightActionsElement(undefined);
|
|
417
|
+
}
|
|
378
418
|
if (this.accessor.options.createLeftHeaderActionComponent) {
|
|
379
419
|
this._leftHeaderActions =
|
|
380
420
|
this.accessor.options.createLeftHeaderActionComponent(this.groupPanel);
|
|
381
|
-
this.
|
|
421
|
+
this._leftHeaderActionsDisposable.value = this._leftHeaderActions;
|
|
382
422
|
this._leftHeaderActions.init({
|
|
383
423
|
containerApi: this._api,
|
|
384
424
|
api: this.groupPanel.api,
|
|
@@ -386,10 +426,16 @@ var DockviewGroupPanelModel = /** @class */ (function (_super) {
|
|
|
386
426
|
});
|
|
387
427
|
this.tabsContainer.setLeftActionsElement(this._leftHeaderActions.element);
|
|
388
428
|
}
|
|
429
|
+
else {
|
|
430
|
+
this._leftHeaderActions = undefined;
|
|
431
|
+
this._leftHeaderActionsDisposable.dispose();
|
|
432
|
+
this.tabsContainer.setLeftActionsElement(undefined);
|
|
433
|
+
}
|
|
389
434
|
if (this.accessor.options.createPrefixHeaderActionComponent) {
|
|
390
435
|
this._prefixHeaderActions =
|
|
391
436
|
this.accessor.options.createPrefixHeaderActionComponent(this.groupPanel);
|
|
392
|
-
this.
|
|
437
|
+
this._prefixHeaderActionsDisposable.value =
|
|
438
|
+
this._prefixHeaderActions;
|
|
393
439
|
this._prefixHeaderActions.init({
|
|
394
440
|
containerApi: this._api,
|
|
395
441
|
api: this.groupPanel.api,
|
|
@@ -397,6 +443,11 @@ var DockviewGroupPanelModel = /** @class */ (function (_super) {
|
|
|
397
443
|
});
|
|
398
444
|
this.tabsContainer.setPrefixActionsElement(this._prefixHeaderActions.element);
|
|
399
445
|
}
|
|
446
|
+
else {
|
|
447
|
+
this._prefixHeaderActions = undefined;
|
|
448
|
+
this._prefixHeaderActionsDisposable.dispose();
|
|
449
|
+
this.tabsContainer.setPrefixActionsElement(undefined);
|
|
450
|
+
}
|
|
400
451
|
};
|
|
401
452
|
DockviewGroupPanelModel.prototype.rerender = function (panel) {
|
|
402
453
|
this.contentContainer.renderPanel(panel, { asActive: false });
|
|
@@ -417,6 +468,9 @@ var DockviewGroupPanelModel = /** @class */ (function (_super) {
|
|
|
417
468
|
if (this.header.hidden) {
|
|
418
469
|
result.hideHeader = true;
|
|
419
470
|
}
|
|
471
|
+
if (this.headerPosition !== 'top') {
|
|
472
|
+
result.headerPosition = this.headerPosition;
|
|
473
|
+
}
|
|
420
474
|
return result;
|
|
421
475
|
};
|
|
422
476
|
DockviewGroupPanelModel.prototype.moveToNext = function (options) {
|
|
@@ -631,6 +685,9 @@ var DockviewGroupPanelModel = /** @class */ (function (_super) {
|
|
|
631
685
|
if (!options.skipSetActive) {
|
|
632
686
|
this.contentContainer.openPanel(panel);
|
|
633
687
|
}
|
|
688
|
+
else if (panel.api.renderer === 'always') {
|
|
689
|
+
this.contentContainer.renderPanel(panel, { asActive: false });
|
|
690
|
+
}
|
|
634
691
|
if (hasExistingPanel) {
|
|
635
692
|
// TODO - need to ensure ordering hasn't changed and if it has need to re-order this.panels
|
|
636
693
|
return;
|
|
@@ -4,6 +4,7 @@ import { DockviewPanelApi } from '../api/dockviewPanelApi';
|
|
|
4
4
|
import { PanelParameters } from '../framwork';
|
|
5
5
|
import { DockviewGroupPanel, IDockviewGroupPanel } from './dockviewGroupPanel';
|
|
6
6
|
import { IDockviewPanel } from './dockviewPanel';
|
|
7
|
+
import { DockviewHeaderPosition } from './options';
|
|
7
8
|
export interface IGroupPanelBaseProps<T extends {
|
|
8
9
|
[index: string]: any;
|
|
9
10
|
} = any> extends PanelParameters<T> {
|
|
@@ -26,6 +27,7 @@ export interface IDockviewHeaderActionsProps {
|
|
|
26
27
|
activePanel: IDockviewPanel | undefined;
|
|
27
28
|
isGroupActive: boolean;
|
|
28
29
|
group: DockviewGroupPanel;
|
|
30
|
+
headerPosition: DockviewHeaderPosition;
|
|
29
31
|
}
|
|
30
32
|
export interface IGroupHeaderProps {
|
|
31
33
|
api: DockviewGroupPanelApi;
|
|
@@ -29,6 +29,8 @@ export interface ViewFactoryData {
|
|
|
29
29
|
content: string;
|
|
30
30
|
tab?: string;
|
|
31
31
|
}
|
|
32
|
+
export type DockviewHeaderPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
33
|
+
export type DockviewHeaderDirection = 'horizontal' | 'vertical';
|
|
32
34
|
export interface DockviewOptions {
|
|
33
35
|
/**
|
|
34
36
|
* Disable the auto-resizing which is controlled through a `ResizeObserver`.
|
|
@@ -44,6 +46,7 @@ export interface DockviewOptions {
|
|
|
44
46
|
};
|
|
45
47
|
popoutUrl?: string;
|
|
46
48
|
defaultRenderer?: DockviewPanelRenderer;
|
|
49
|
+
defaultHeaderPosition?: DockviewHeaderPosition;
|
|
47
50
|
debug?: boolean;
|
|
48
51
|
dndEdges?: false | DroptargetOverlayModel;
|
|
49
52
|
/**
|