dockview 1.4.0 → 1.4.1
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 +1 -1
- package/dist/cjs/api/component.api.d.ts +0 -5
- package/dist/cjs/api/component.api.js +0 -15
- package/dist/cjs/api/component.api.js.map +1 -1
- package/dist/cjs/api/panelApi.d.ts +1 -2
- package/dist/cjs/api/panelApi.js +3 -3
- package/dist/cjs/api/panelApi.js.map +1 -1
- package/dist/cjs/dockview/components/tab/defaultTab.d.ts +0 -17
- package/dist/cjs/dockview/components/tab/defaultTab.js +9 -64
- package/dist/cjs/dockview/components/tab/defaultTab.js.map +1 -1
- package/dist/cjs/dockview/defaultGroupPanelView.d.ts +1 -2
- package/dist/cjs/dockview/defaultGroupPanelView.js +2 -4
- package/dist/cjs/dockview/defaultGroupPanelView.js.map +1 -1
- package/dist/cjs/dockview/dockviewComponent.js +2 -2
- package/dist/cjs/dockview/dockviewComponent.js.map +1 -1
- package/dist/cjs/dockview/dockviewGroupPanel.js +1 -1
- package/dist/cjs/dockview/dockviewGroupPanel.js.map +1 -1
- package/dist/cjs/gridview/basePanelView.js +1 -1
- package/dist/cjs/gridview/basePanelView.js.map +1 -1
- package/dist/cjs/gridview/gridview.js +1 -1
- package/dist/cjs/gridview/gridview.js.map +1 -1
- package/dist/cjs/gridview/gridviewComponent.d.ts +0 -2
- package/dist/cjs/gridview/gridviewComponent.js +2 -6
- package/dist/cjs/gridview/gridviewComponent.js.map +1 -1
- package/dist/cjs/gridview/gridviewPanel.d.ts +2 -3
- package/dist/cjs/gridview/gridviewPanel.js +4 -4
- package/dist/cjs/gridview/gridviewPanel.js.map +1 -1
- package/dist/cjs/groupview/types.d.ts +1 -3
- package/dist/cjs/paneview/paneviewComponent.js +2 -2
- package/dist/cjs/paneview/paneviewComponent.js.map +1 -1
- package/dist/cjs/react/dockview/reactContentPart.d.ts +2 -4
- package/dist/cjs/react/dockview/reactContentPart.js +0 -3
- package/dist/cjs/react/dockview/reactContentPart.js.map +1 -1
- package/dist/cjs/react/dockview/v2/reactContentRenderer.d.ts +0 -1
- package/dist/cjs/react/dockview/v2/reactContentRenderer.js +0 -3
- package/dist/cjs/react/dockview/v2/reactContentRenderer.js.map +1 -1
- package/dist/cjs/react/gridview/view.js +2 -2
- package/dist/cjs/react/gridview/view.js.map +1 -1
- package/dist/cjs/react/index.d.ts +0 -1
- package/dist/cjs/react/index.js +0 -1
- package/dist/cjs/react/index.js.map +1 -1
- package/dist/cjs/react/splitview/view.js +2 -2
- package/dist/cjs/react/splitview/view.js.map +1 -1
- package/dist/cjs/splitview/core/options.d.ts +2 -2
- package/dist/cjs/splitview/splitviewComponent.d.ts +0 -1
- package/dist/cjs/splitview/splitviewComponent.js +4 -5
- package/dist/cjs/splitview/splitviewComponent.js.map +1 -1
- package/dist/cjs/splitview/splitviewPanel.js +4 -6
- package/dist/cjs/splitview/splitviewPanel.js.map +1 -1
- package/dist/dockview.amd.js +34 -155
- package/dist/dockview.amd.min.js +2 -2
- package/dist/dockview.amd.min.noStyle.js +2 -2
- package/dist/dockview.amd.noStyle.js +34 -155
- package/dist/dockview.cjs.js +34 -155
- package/dist/dockview.esm.js +34 -154
- package/dist/dockview.esm.min.js +2 -2
- package/dist/dockview.js +34 -155
- package/dist/dockview.min.js +2 -2
- package/dist/dockview.min.noStyle.js +2 -2
- package/dist/dockview.noStyle.js +34 -155
- package/dist/esm/api/component.api.d.ts +0 -5
- package/dist/esm/api/component.api.js +0 -15
- package/dist/esm/api/panelApi.d.ts +1 -2
- package/dist/esm/api/panelApi.js +3 -3
- package/dist/esm/dockview/components/tab/defaultTab.d.ts +0 -17
- package/dist/esm/dockview/components/tab/defaultTab.js +8 -49
- package/dist/esm/dockview/defaultGroupPanelView.d.ts +1 -2
- package/dist/esm/dockview/defaultGroupPanelView.js +3 -5
- package/dist/esm/dockview/dockviewComponent.js +1 -1
- package/dist/esm/dockview/dockviewGroupPanel.js +1 -1
- package/dist/esm/gridview/basePanelView.js +1 -1
- package/dist/esm/gridview/gridviewComponent.d.ts +0 -2
- package/dist/esm/gridview/gridviewComponent.js +2 -6
- package/dist/esm/gridview/gridviewPanel.d.ts +2 -3
- package/dist/esm/gridview/gridviewPanel.js +4 -4
- package/dist/esm/groupview/types.d.ts +1 -3
- package/dist/esm/react/dockview/reactContentPart.d.ts +2 -4
- package/dist/esm/react/dockview/reactContentPart.js +0 -3
- package/dist/esm/react/dockview/v2/reactContentRenderer.d.ts +0 -1
- package/dist/esm/react/dockview/v2/reactContentRenderer.js +0 -3
- package/dist/esm/react/gridview/view.js +2 -2
- package/dist/esm/react/index.d.ts +0 -1
- package/dist/esm/react/index.js +0 -1
- package/dist/esm/react/splitview/view.js +2 -2
- package/dist/esm/splitview/core/options.d.ts +2 -2
- package/dist/esm/splitview/splitviewComponent.d.ts +0 -1
- package/dist/esm/splitview/splitviewComponent.js +2 -3
- package/dist/esm/splitview/splitviewPanel.js +4 -6
- package/package.json +2 -2
- package/dist/cjs/react/dockview/components.d.ts +0 -11
- package/dist/cjs/react/dockview/components.js +0 -81
- package/dist/cjs/react/dockview/components.js.map +0 -1
- package/dist/esm/react/dockview/components.d.ts +0 -11
- package/dist/esm/react/dockview/components.js +0 -54
package/dist/dockview.noStyle.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview
|
|
3
|
-
* @version 1.4.
|
|
3
|
+
* @version 1.4.1
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -2277,18 +2277,12 @@
|
|
|
2277
2277
|
removePanel(panel, sizing) {
|
|
2278
2278
|
this.component.removePanel(panel, sizing);
|
|
2279
2279
|
}
|
|
2280
|
-
setVisible(panel, isVisible) {
|
|
2281
|
-
this.component.setVisible(panel, isVisible);
|
|
2282
|
-
}
|
|
2283
2280
|
focus() {
|
|
2284
2281
|
this.component.focus();
|
|
2285
2282
|
}
|
|
2286
2283
|
getPanel(id) {
|
|
2287
2284
|
return this.component.getPanel(id);
|
|
2288
2285
|
}
|
|
2289
|
-
setActive(panel) {
|
|
2290
|
-
this.component.setActive(panel);
|
|
2291
|
-
}
|
|
2292
2286
|
layout(width, height) {
|
|
2293
2287
|
return this.component.layout(width, height);
|
|
2294
2288
|
}
|
|
@@ -2436,15 +2430,6 @@
|
|
|
2436
2430
|
getPanel(id) {
|
|
2437
2431
|
return this.component.getPanel(id);
|
|
2438
2432
|
}
|
|
2439
|
-
toggleVisibility(panel) {
|
|
2440
|
-
this.component.toggleVisibility(panel);
|
|
2441
|
-
}
|
|
2442
|
-
setVisible(panel, visible) {
|
|
2443
|
-
this.component.setVisible(panel, visible);
|
|
2444
|
-
}
|
|
2445
|
-
setActive(panel) {
|
|
2446
|
-
this.component.setActive(panel);
|
|
2447
|
-
}
|
|
2448
2433
|
fromJSON(data) {
|
|
2449
2434
|
return this.component.fromJSON(data);
|
|
2450
2435
|
}
|
|
@@ -2681,7 +2666,7 @@
|
|
|
2681
2666
|
MouseEventKind["CLICK"] = "CLICK";
|
|
2682
2667
|
MouseEventKind["CONTEXT_MENU"] = "CONTEXT_MENU";
|
|
2683
2668
|
})(exports.MouseEventKind || (exports.MouseEventKind = {}));
|
|
2684
|
-
class Tab
|
|
2669
|
+
class Tab extends CompositeDisposable {
|
|
2685
2670
|
constructor(panelId, accessor, group) {
|
|
2686
2671
|
super();
|
|
2687
2672
|
this.panelId = panelId;
|
|
@@ -2910,7 +2895,7 @@
|
|
|
2910
2895
|
if (this.tabs.find((tab) => tab.value.panelId === panel.id)) {
|
|
2911
2896
|
return;
|
|
2912
2897
|
}
|
|
2913
|
-
const tabToAdd = new Tab
|
|
2898
|
+
const tabToAdd = new Tab(panel.id, this.accessor, this.group);
|
|
2914
2899
|
if (!((_a = panel.view) === null || _a === void 0 ? void 0 : _a.tab)) {
|
|
2915
2900
|
throw new Error('invalid header component');
|
|
2916
2901
|
}
|
|
@@ -3581,10 +3566,10 @@
|
|
|
3581
3566
|
this._isVisible = true;
|
|
3582
3567
|
this._width = 0;
|
|
3583
3568
|
this._height = 0;
|
|
3584
|
-
this.
|
|
3569
|
+
this._onDidDimensionChange = new Emitter({
|
|
3585
3570
|
replay: true,
|
|
3586
3571
|
});
|
|
3587
|
-
this.onDidDimensionsChange = this.
|
|
3572
|
+
this.onDidDimensionsChange = this._onDidDimensionChange.event;
|
|
3588
3573
|
//
|
|
3589
3574
|
this._onDidChangeFocus = new Emitter({
|
|
3590
3575
|
replay: true,
|
|
@@ -3609,7 +3594,7 @@
|
|
|
3609
3594
|
//
|
|
3610
3595
|
this._onActiveChange = new Emitter();
|
|
3611
3596
|
this.onActiveChange = this._onActiveChange.event;
|
|
3612
|
-
this.addDisposables(this.
|
|
3597
|
+
this.addDisposables(this._onDidDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onFocusEvent, this._onActiveChange, this._onVisibilityChange, this.onDidFocusChange((event) => {
|
|
3613
3598
|
this._isFocused = event.isFocused;
|
|
3614
3599
|
}), this.onDidActiveChange((event) => {
|
|
3615
3600
|
this._isActive = event.isActive;
|
|
@@ -3833,7 +3818,7 @@
|
|
|
3833
3818
|
layout(width, height) {
|
|
3834
3819
|
var _a;
|
|
3835
3820
|
// the obtain the correct dimensions of the content panel we must deduct the tab height
|
|
3836
|
-
this.api.
|
|
3821
|
+
this.api._onDidDimensionChange.fire({
|
|
3837
3822
|
width,
|
|
3838
3823
|
height: height - (this.group.model.header.height || 0),
|
|
3839
3824
|
});
|
|
@@ -3983,53 +3968,6 @@
|
|
|
3983
3968
|
return new Component(id, componentName);
|
|
3984
3969
|
}
|
|
3985
3970
|
|
|
3986
|
-
class WrappedTab {
|
|
3987
|
-
constructor(renderer) {
|
|
3988
|
-
this.renderer = renderer;
|
|
3989
|
-
this._element = document.createElement('element');
|
|
3990
|
-
this.show();
|
|
3991
|
-
}
|
|
3992
|
-
get innerRenderer() {
|
|
3993
|
-
return this.renderer;
|
|
3994
|
-
}
|
|
3995
|
-
get element() {
|
|
3996
|
-
return this._element;
|
|
3997
|
-
}
|
|
3998
|
-
get id() {
|
|
3999
|
-
return this.renderer.id;
|
|
4000
|
-
}
|
|
4001
|
-
show() {
|
|
4002
|
-
if (!this.renderer.element.parentElement) {
|
|
4003
|
-
this._element.appendChild(this.renderer.element);
|
|
4004
|
-
}
|
|
4005
|
-
}
|
|
4006
|
-
hide() {
|
|
4007
|
-
if (this.renderer.element.parentElement) {
|
|
4008
|
-
this.renderer.element.remove();
|
|
4009
|
-
}
|
|
4010
|
-
}
|
|
4011
|
-
layout(width, height) {
|
|
4012
|
-
this.renderer.layout(width, height);
|
|
4013
|
-
}
|
|
4014
|
-
update(event) {
|
|
4015
|
-
this.renderer.update(event);
|
|
4016
|
-
}
|
|
4017
|
-
toJSON() {
|
|
4018
|
-
return this.renderer.toJSON();
|
|
4019
|
-
}
|
|
4020
|
-
focus() {
|
|
4021
|
-
this.renderer.focus();
|
|
4022
|
-
}
|
|
4023
|
-
init(parameters) {
|
|
4024
|
-
this.renderer.init(parameters);
|
|
4025
|
-
}
|
|
4026
|
-
updateParentGroup(group, isPanelVisible) {
|
|
4027
|
-
this.renderer.updateParentGroup(group, isPanelVisible);
|
|
4028
|
-
}
|
|
4029
|
-
dispose() {
|
|
4030
|
-
this.renderer.dispose();
|
|
4031
|
-
}
|
|
4032
|
-
}
|
|
4033
3971
|
class DefaultTab extends CompositeDisposable {
|
|
4034
3972
|
constructor() {
|
|
4035
3973
|
super();
|
|
@@ -4092,15 +4030,21 @@
|
|
|
4092
4030
|
}
|
|
4093
4031
|
}
|
|
4094
4032
|
updateParentGroup(group, isPanelVisible) {
|
|
4033
|
+
const changed = this._isPanelVisible !== isPanelVisible ||
|
|
4034
|
+
this._isGroupActive !== group.isActive;
|
|
4095
4035
|
this._isPanelVisible = isPanelVisible;
|
|
4096
4036
|
this._isGroupActive = group.isActive;
|
|
4097
|
-
|
|
4037
|
+
if (changed) {
|
|
4038
|
+
this.render();
|
|
4039
|
+
}
|
|
4098
4040
|
}
|
|
4099
4041
|
layout(_width, _height) {
|
|
4100
4042
|
// noop
|
|
4101
4043
|
}
|
|
4102
4044
|
render() {
|
|
4103
|
-
this._content.textContent
|
|
4045
|
+
if (this._content.textContent !== this.params.title) {
|
|
4046
|
+
this._content.textContent = this.params.title;
|
|
4047
|
+
}
|
|
4104
4048
|
}
|
|
4105
4049
|
}
|
|
4106
4050
|
|
|
@@ -4144,7 +4088,7 @@
|
|
|
4144
4088
|
layout(width, height) {
|
|
4145
4089
|
this._width = width;
|
|
4146
4090
|
this._height = height;
|
|
4147
|
-
this.api.
|
|
4091
|
+
this.api._onDidDimensionChange.fire({ width, height });
|
|
4148
4092
|
if (this.part) {
|
|
4149
4093
|
if (this._params) {
|
|
4150
4094
|
this.part.update(this._params.params);
|
|
@@ -4193,11 +4137,11 @@
|
|
|
4193
4137
|
this.onDidChange = this._onDidChange.event;
|
|
4194
4138
|
this.addDisposables(this._onDidChange, this.api.onVisibilityChange((event) => {
|
|
4195
4139
|
const { isVisible } = event;
|
|
4196
|
-
const {
|
|
4197
|
-
|
|
4140
|
+
const { accessor } = this._params;
|
|
4141
|
+
accessor.setVisible(this, isVisible);
|
|
4198
4142
|
}), this.api.onActiveChange(() => {
|
|
4199
|
-
const {
|
|
4200
|
-
|
|
4143
|
+
const { accessor } = this._params;
|
|
4144
|
+
accessor.setActive(this);
|
|
4201
4145
|
}), this.api.onDidConstraintsChangeInternal((event) => {
|
|
4202
4146
|
if (typeof event.minimumWidth === 'number' ||
|
|
4203
4147
|
typeof event.minimumWidth === 'function') {
|
|
@@ -4376,7 +4320,7 @@
|
|
|
4376
4320
|
constructor(renderers) {
|
|
4377
4321
|
var _a;
|
|
4378
4322
|
this._content = renderers.content;
|
|
4379
|
-
this._tab =
|
|
4323
|
+
this._tab = (_a = renderers.tab) !== null && _a !== void 0 ? _a : new DefaultTab();
|
|
4380
4324
|
this._actions =
|
|
4381
4325
|
renderers.actions ||
|
|
4382
4326
|
(this.content.actions
|
|
@@ -4416,9 +4360,7 @@
|
|
|
4416
4360
|
toJSON() {
|
|
4417
4361
|
return {
|
|
4418
4362
|
content: this.content.toJSON(),
|
|
4419
|
-
tab: this.tab
|
|
4420
|
-
? undefined
|
|
4421
|
-
: this.tab.toJSON(),
|
|
4363
|
+
tab: this.tab instanceof DefaultTab ? undefined : this.tab.toJSON(),
|
|
4422
4364
|
};
|
|
4423
4365
|
}
|
|
4424
4366
|
dispose() {
|
|
@@ -4806,7 +4748,7 @@
|
|
|
4806
4748
|
}
|
|
4807
4749
|
}
|
|
4808
4750
|
const view = new GroupPanel(this, id, options);
|
|
4809
|
-
view.init({ params: {},
|
|
4751
|
+
view.init({ params: {}, accessor: null }); // required to initialized .part and allow for correct disposal of group
|
|
4810
4752
|
if (!this._groups.has(view.id)) {
|
|
4811
4753
|
const disposable = new CompositeDisposable(view.model.onMove((event) => {
|
|
4812
4754
|
const { groupId, itemId, target, index } = event;
|
|
@@ -4945,9 +4887,6 @@
|
|
|
4945
4887
|
value.value.setActive(panel === value.value);
|
|
4946
4888
|
});
|
|
4947
4889
|
}
|
|
4948
|
-
toggleVisibility(panel) {
|
|
4949
|
-
this.setVisible(panel, !this.isVisible(panel));
|
|
4950
|
-
}
|
|
4951
4890
|
focus() {
|
|
4952
4891
|
var _a;
|
|
4953
4892
|
(_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.focus();
|
|
@@ -4978,7 +4917,7 @@
|
|
|
4978
4917
|
maximumHeight: data.maximumHeight,
|
|
4979
4918
|
priority: data.priority,
|
|
4980
4919
|
snap: !!data.snap,
|
|
4981
|
-
|
|
4920
|
+
accessor: this,
|
|
4982
4921
|
isVisible: node.visible,
|
|
4983
4922
|
}));
|
|
4984
4923
|
this.registerPanel(view);
|
|
@@ -5044,7 +4983,7 @@
|
|
|
5044
4983
|
maximumHeight: options.maximumHeight,
|
|
5045
4984
|
priority: options.priority,
|
|
5046
4985
|
snap: !!options.snap,
|
|
5047
|
-
|
|
4986
|
+
accessor: this,
|
|
5048
4987
|
isVisible: true,
|
|
5049
4988
|
});
|
|
5050
4989
|
this.registerPanel(view);
|
|
@@ -5240,7 +5179,7 @@
|
|
|
5240
5179
|
maximumSize: options.maximumSize,
|
|
5241
5180
|
snap: options.snap,
|
|
5242
5181
|
priority: options.priority,
|
|
5243
|
-
|
|
5182
|
+
accessor: this,
|
|
5244
5183
|
});
|
|
5245
5184
|
const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
|
|
5246
5185
|
const index = typeof options.index === 'number' ? options.index : undefined;
|
|
@@ -5316,7 +5255,7 @@
|
|
|
5316
5255
|
maximumSize: data.maximumSize,
|
|
5317
5256
|
snap: view.snap,
|
|
5318
5257
|
priority: view.priority,
|
|
5319
|
-
|
|
5258
|
+
accessor: this,
|
|
5320
5259
|
});
|
|
5321
5260
|
});
|
|
5322
5261
|
panel.orientation = orientation;
|
|
@@ -5958,13 +5897,11 @@
|
|
|
5958
5897
|
this.onDidChange = this._onDidChange.event;
|
|
5959
5898
|
this.addDisposables(this._onDidChange, this.api.onVisibilityChange((event) => {
|
|
5960
5899
|
const { isVisible } = event;
|
|
5961
|
-
const {
|
|
5962
|
-
|
|
5963
|
-
containerApi.setVisible(this, isVisible);
|
|
5900
|
+
const { accessor } = this._params;
|
|
5901
|
+
accessor.setVisible(this, isVisible);
|
|
5964
5902
|
}), this.api.onActiveChange(() => {
|
|
5965
|
-
const {
|
|
5966
|
-
|
|
5967
|
-
containerApi.setActive(this);
|
|
5903
|
+
const { accessor } = this._params;
|
|
5904
|
+
accessor.setActive(this);
|
|
5968
5905
|
}), this.api.onDidConstraintsChangeInternal((event) => {
|
|
5969
5906
|
if (typeof event.minimumSize === 'number' ||
|
|
5970
5907
|
typeof event.minimumSize === 'function') {
|
|
@@ -6216,9 +6153,6 @@
|
|
|
6216
6153
|
layout(_width, _height) {
|
|
6217
6154
|
// noop
|
|
6218
6155
|
}
|
|
6219
|
-
close() {
|
|
6220
|
-
return Promise.resolve(true);
|
|
6221
|
-
}
|
|
6222
6156
|
dispose() {
|
|
6223
6157
|
var _a, _b;
|
|
6224
6158
|
this._onDidFocus.dispose();
|
|
@@ -6488,58 +6422,6 @@
|
|
|
6488
6422
|
});
|
|
6489
6423
|
DockviewReact.displayName = 'DockviewComponent';
|
|
6490
6424
|
|
|
6491
|
-
const Tab = (props) => {
|
|
6492
|
-
return React__namespace.createElement(React__namespace.Fragment, null, props.children);
|
|
6493
|
-
};
|
|
6494
|
-
const Content = (props) => {
|
|
6495
|
-
return React__namespace.createElement(React__namespace.Fragment, null, props.children);
|
|
6496
|
-
};
|
|
6497
|
-
const Actions = (props) => {
|
|
6498
|
-
return React__namespace.createElement(React__namespace.Fragment, null, props.children);
|
|
6499
|
-
};
|
|
6500
|
-
function isValidComponent(element) {
|
|
6501
|
-
return [Content, Actions, Tab].find((comp) => element.type === comp);
|
|
6502
|
-
}
|
|
6503
|
-
const Panel = (props) => {
|
|
6504
|
-
const context = React__namespace.useContext(ReactPartContext);
|
|
6505
|
-
const sections = React__namespace.useMemo(() => {
|
|
6506
|
-
var _a;
|
|
6507
|
-
const childs = ((_a = React__namespace.Children.map(props.children, (_) => _)) === null || _a === void 0 ? void 0 : _a.filter(isReactElement)) || [];
|
|
6508
|
-
const isInvalid = !!childs.find((_) => !isValidComponent(_));
|
|
6509
|
-
if (isInvalid) {
|
|
6510
|
-
throw new Error('Children of DockviewComponents.Panel must be one of the following: DockviewComponents.Content, DockviewComponents.Actions, DockviewComponents.Tab');
|
|
6511
|
-
}
|
|
6512
|
-
const body = childs.find((_) => _.type === Content);
|
|
6513
|
-
const actions = childs.find((_) => _.type === Actions);
|
|
6514
|
-
const tab = childs.find((_) => _.type === Tab);
|
|
6515
|
-
return { body, actions, tab };
|
|
6516
|
-
}, [props.children]);
|
|
6517
|
-
React__namespace.useEffect(() => {
|
|
6518
|
-
/**
|
|
6519
|
-
* hide or show the default tab behavior based on whether we want to override
|
|
6520
|
-
* with our own React tab.
|
|
6521
|
-
*/
|
|
6522
|
-
if (sections.tab) {
|
|
6523
|
-
context.tabPortalElement.hide();
|
|
6524
|
-
}
|
|
6525
|
-
else {
|
|
6526
|
-
context.tabPortalElement.show();
|
|
6527
|
-
}
|
|
6528
|
-
}, [sections.tab]);
|
|
6529
|
-
return (React__namespace.createElement(React__namespace.Fragment, null,
|
|
6530
|
-
sections.actions &&
|
|
6531
|
-
ReactDOM__namespace.createPortal(sections.actions, context.actionsPortalElement),
|
|
6532
|
-
sections.tab &&
|
|
6533
|
-
ReactDOM__namespace.createPortal(sections.tab, context.tabPortalElement.element),
|
|
6534
|
-
sections.body || props.children));
|
|
6535
|
-
};
|
|
6536
|
-
const DockviewComponents = {
|
|
6537
|
-
Tab,
|
|
6538
|
-
Content,
|
|
6539
|
-
Actions,
|
|
6540
|
-
Panel,
|
|
6541
|
-
};
|
|
6542
|
-
|
|
6543
6425
|
class ReactPanelView extends SplitviewPanel {
|
|
6544
6426
|
constructor(id, component, reactComponent, reactPortalStore) {
|
|
6545
6427
|
super(id, component);
|
|
@@ -6551,8 +6433,7 @@
|
|
|
6551
6433
|
return new ReactPart(this.element, this.reactPortalStore, this.reactComponent, {
|
|
6552
6434
|
params: ((_a = this._params) === null || _a === void 0 ? void 0 : _a.params) || {},
|
|
6553
6435
|
api: this.api,
|
|
6554
|
-
containerApi: this._params
|
|
6555
|
-
.containerApi,
|
|
6436
|
+
containerApi: new SplitviewApi(this._params.accessor),
|
|
6556
6437
|
});
|
|
6557
6438
|
}
|
|
6558
6439
|
}
|
|
@@ -6628,8 +6509,7 @@
|
|
|
6628
6509
|
return new ReactPart(this.element, this.reactPortalStore, this.reactComponent, {
|
|
6629
6510
|
params: ((_a = this._params) === null || _a === void 0 ? void 0 : _a.params) || {},
|
|
6630
6511
|
api: this.api,
|
|
6631
|
-
containerApi: this._params
|
|
6632
|
-
.containerApi,
|
|
6512
|
+
containerApi: new GridviewApi(this._params.accessor),
|
|
6633
6513
|
});
|
|
6634
6514
|
}
|
|
6635
6515
|
}
|
|
@@ -6823,7 +6703,6 @@
|
|
|
6823
6703
|
exports.ContentContainer = ContentContainer;
|
|
6824
6704
|
exports.DockviewApi = DockviewApi;
|
|
6825
6705
|
exports.DockviewComponent = DockviewComponent;
|
|
6826
|
-
exports.DockviewComponents = DockviewComponents;
|
|
6827
6706
|
exports.DockviewReact = DockviewReact;
|
|
6828
6707
|
exports.Gridview = Gridview;
|
|
6829
6708
|
exports.GridviewApi = GridviewApi;
|
|
@@ -6849,7 +6728,7 @@
|
|
|
6849
6728
|
exports.SplitviewComponent = SplitviewComponent;
|
|
6850
6729
|
exports.SplitviewPanel = SplitviewPanel;
|
|
6851
6730
|
exports.SplitviewReact = SplitviewReact;
|
|
6852
|
-
exports.Tab = Tab
|
|
6731
|
+
exports.Tab = Tab;
|
|
6853
6732
|
exports.getDirectionOrientation = getDirectionOrientation;
|
|
6854
6733
|
exports.getGridLocation = getGridLocation;
|
|
6855
6734
|
exports.getLocationOrientation = getLocationOrientation;
|
|
@@ -38,10 +38,8 @@ export declare class SplitviewApi implements CommonApi<SerializedSplitview> {
|
|
|
38
38
|
constructor(component: ISplitviewComponent);
|
|
39
39
|
updateOptions(options: SplitviewComponentUpdateOptions): void;
|
|
40
40
|
removePanel(panel: ISplitviewPanel, sizing?: Sizing): void;
|
|
41
|
-
setVisible(panel: ISplitviewPanel, isVisible: boolean): void;
|
|
42
41
|
focus(): void;
|
|
43
42
|
getPanel(id: string): ISplitviewPanel | undefined;
|
|
44
|
-
setActive(panel: ISplitviewPanel): void;
|
|
45
43
|
layout(width: number, height: number): void;
|
|
46
44
|
addPanel(options: AddSplitviewComponentOptions): ISplitviewPanel;
|
|
47
45
|
movePanel(from: number, to: number): void;
|
|
@@ -97,9 +95,6 @@ export declare class GridviewApi implements CommonApi<SerializedGridview> {
|
|
|
97
95
|
size?: number;
|
|
98
96
|
}): void;
|
|
99
97
|
getPanel(id: string): IGridviewPanel | undefined;
|
|
100
|
-
toggleVisibility(panel: IGridviewPanel): void;
|
|
101
|
-
setVisible(panel: IGridviewPanel, visible: boolean): void;
|
|
102
|
-
setActive(panel: IGridviewPanel): void;
|
|
103
98
|
fromJSON(data: SerializedGridview): void;
|
|
104
99
|
toJSON(): SerializedGridview;
|
|
105
100
|
}
|
|
@@ -42,18 +42,12 @@ export class SplitviewApi {
|
|
|
42
42
|
removePanel(panel, sizing) {
|
|
43
43
|
this.component.removePanel(panel, sizing);
|
|
44
44
|
}
|
|
45
|
-
setVisible(panel, isVisible) {
|
|
46
|
-
this.component.setVisible(panel, isVisible);
|
|
47
|
-
}
|
|
48
45
|
focus() {
|
|
49
46
|
this.component.focus();
|
|
50
47
|
}
|
|
51
48
|
getPanel(id) {
|
|
52
49
|
return this.component.getPanel(id);
|
|
53
50
|
}
|
|
54
|
-
setActive(panel) {
|
|
55
|
-
this.component.setActive(panel);
|
|
56
|
-
}
|
|
57
51
|
layout(width, height) {
|
|
58
52
|
return this.component.layout(width, height);
|
|
59
53
|
}
|
|
@@ -201,15 +195,6 @@ export class GridviewApi {
|
|
|
201
195
|
getPanel(id) {
|
|
202
196
|
return this.component.getPanel(id);
|
|
203
197
|
}
|
|
204
|
-
toggleVisibility(panel) {
|
|
205
|
-
this.component.toggleVisibility(panel);
|
|
206
|
-
}
|
|
207
|
-
setVisible(panel, visible) {
|
|
208
|
-
this.component.setVisible(panel, visible);
|
|
209
|
-
}
|
|
210
|
-
setActive(panel) {
|
|
211
|
-
this.component.setActive(panel);
|
|
212
|
-
}
|
|
213
198
|
fromJSON(data) {
|
|
214
199
|
return this.component.fromJSON(data);
|
|
215
200
|
}
|
|
@@ -18,7 +18,6 @@ export interface PanelApi {
|
|
|
18
18
|
readonly onDidFocusChange: Event<FocusEvent>;
|
|
19
19
|
readonly onDidVisibilityChange: Event<VisibilityEvent>;
|
|
20
20
|
readonly onDidActiveChange: Event<ActiveEvent>;
|
|
21
|
-
readonly onFocusEvent: Event<void>;
|
|
22
21
|
setVisible(isVisible: boolean): void;
|
|
23
22
|
setActive(): void;
|
|
24
23
|
/**
|
|
@@ -56,7 +55,7 @@ export declare class PanelApiImpl extends CompositeDisposable implements PanelAp
|
|
|
56
55
|
private _isVisible;
|
|
57
56
|
private _width;
|
|
58
57
|
private _height;
|
|
59
|
-
readonly
|
|
58
|
+
readonly _onDidDimensionChange: Emitter<PanelDimensionChangeEvent>;
|
|
60
59
|
readonly onDidDimensionsChange: Event<PanelDimensionChangeEvent>;
|
|
61
60
|
readonly _onDidChangeFocus: Emitter<FocusEvent>;
|
|
62
61
|
readonly onDidFocusChange: Event<FocusEvent>;
|
package/dist/esm/api/panelApi.js
CHANGED
|
@@ -12,10 +12,10 @@ export class PanelApiImpl extends CompositeDisposable {
|
|
|
12
12
|
this._isVisible = true;
|
|
13
13
|
this._width = 0;
|
|
14
14
|
this._height = 0;
|
|
15
|
-
this.
|
|
15
|
+
this._onDidDimensionChange = new Emitter({
|
|
16
16
|
replay: true,
|
|
17
17
|
});
|
|
18
|
-
this.onDidDimensionsChange = this.
|
|
18
|
+
this.onDidDimensionsChange = this._onDidDimensionChange.event;
|
|
19
19
|
//
|
|
20
20
|
this._onDidChangeFocus = new Emitter({
|
|
21
21
|
replay: true,
|
|
@@ -40,7 +40,7 @@ export class PanelApiImpl extends CompositeDisposable {
|
|
|
40
40
|
//
|
|
41
41
|
this._onActiveChange = new Emitter();
|
|
42
42
|
this.onActiveChange = this._onActiveChange.event;
|
|
43
|
-
this.addDisposables(this.
|
|
43
|
+
this.addDisposables(this._onDidDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onFocusEvent, this._onActiveChange, this._onVisibilityChange, this.onDidFocusChange((event) => {
|
|
44
44
|
this._isFocused = event.isFocused;
|
|
45
45
|
}), this.onDidActiveChange((event) => {
|
|
46
46
|
this._isActive = event.isActive;
|
|
@@ -2,23 +2,6 @@ import { CompositeDisposable } from '../../../lifecycle';
|
|
|
2
2
|
import { ITabRenderer, GroupPanelPartInitParameters } from '../../../groupview/types';
|
|
3
3
|
import { PanelUpdateEvent } from '../../../panel/types';
|
|
4
4
|
import { GroupPanel } from '../../../groupview/groupviewPanel';
|
|
5
|
-
export declare class WrappedTab implements ITabRenderer {
|
|
6
|
-
private readonly renderer;
|
|
7
|
-
private readonly _element;
|
|
8
|
-
constructor(renderer: ITabRenderer);
|
|
9
|
-
get innerRenderer(): ITabRenderer;
|
|
10
|
-
get element(): HTMLElement;
|
|
11
|
-
get id(): string;
|
|
12
|
-
show(): void;
|
|
13
|
-
hide(): void;
|
|
14
|
-
layout(width: number, height: number): void;
|
|
15
|
-
update(event: PanelUpdateEvent): void;
|
|
16
|
-
toJSON(): object;
|
|
17
|
-
focus(): void;
|
|
18
|
-
init(parameters: GroupPanelPartInitParameters): void;
|
|
19
|
-
updateParentGroup(group: GroupPanel, isPanelVisible: boolean): void;
|
|
20
|
-
dispose(): void;
|
|
21
|
-
}
|
|
22
5
|
export declare class DefaultTab extends CompositeDisposable implements ITabRenderer {
|
|
23
6
|
private _element;
|
|
24
7
|
private _isPanelVisible;
|
|
@@ -1,52 +1,5 @@
|
|
|
1
1
|
import { CompositeDisposable } from '../../../lifecycle';
|
|
2
2
|
import { addDisposableListener } from '../../../events';
|
|
3
|
-
export class WrappedTab {
|
|
4
|
-
constructor(renderer) {
|
|
5
|
-
this.renderer = renderer;
|
|
6
|
-
this._element = document.createElement('element');
|
|
7
|
-
this.show();
|
|
8
|
-
}
|
|
9
|
-
get innerRenderer() {
|
|
10
|
-
return this.renderer;
|
|
11
|
-
}
|
|
12
|
-
get element() {
|
|
13
|
-
return this._element;
|
|
14
|
-
}
|
|
15
|
-
get id() {
|
|
16
|
-
return this.renderer.id;
|
|
17
|
-
}
|
|
18
|
-
show() {
|
|
19
|
-
if (!this.renderer.element.parentElement) {
|
|
20
|
-
this._element.appendChild(this.renderer.element);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
hide() {
|
|
24
|
-
if (this.renderer.element.parentElement) {
|
|
25
|
-
this.renderer.element.remove();
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
layout(width, height) {
|
|
29
|
-
this.renderer.layout(width, height);
|
|
30
|
-
}
|
|
31
|
-
update(event) {
|
|
32
|
-
this.renderer.update(event);
|
|
33
|
-
}
|
|
34
|
-
toJSON() {
|
|
35
|
-
return this.renderer.toJSON();
|
|
36
|
-
}
|
|
37
|
-
focus() {
|
|
38
|
-
this.renderer.focus();
|
|
39
|
-
}
|
|
40
|
-
init(parameters) {
|
|
41
|
-
this.renderer.init(parameters);
|
|
42
|
-
}
|
|
43
|
-
updateParentGroup(group, isPanelVisible) {
|
|
44
|
-
this.renderer.updateParentGroup(group, isPanelVisible);
|
|
45
|
-
}
|
|
46
|
-
dispose() {
|
|
47
|
-
this.renderer.dispose();
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
3
|
export class DefaultTab extends CompositeDisposable {
|
|
51
4
|
constructor() {
|
|
52
5
|
super();
|
|
@@ -109,14 +62,20 @@ export class DefaultTab extends CompositeDisposable {
|
|
|
109
62
|
}
|
|
110
63
|
}
|
|
111
64
|
updateParentGroup(group, isPanelVisible) {
|
|
65
|
+
const changed = this._isPanelVisible !== isPanelVisible ||
|
|
66
|
+
this._isGroupActive !== group.isActive;
|
|
112
67
|
this._isPanelVisible = isPanelVisible;
|
|
113
68
|
this._isGroupActive = group.isActive;
|
|
114
|
-
|
|
69
|
+
if (changed) {
|
|
70
|
+
this.render();
|
|
71
|
+
}
|
|
115
72
|
}
|
|
116
73
|
layout(_width, _height) {
|
|
117
74
|
// noop
|
|
118
75
|
}
|
|
119
76
|
render() {
|
|
120
|
-
this._content.textContent
|
|
77
|
+
if (this._content.textContent !== this.params.title) {
|
|
78
|
+
this._content.textContent = this.params.title;
|
|
79
|
+
}
|
|
121
80
|
}
|
|
122
81
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { WrappedTab } from './components/tab/defaultTab';
|
|
2
1
|
import { GroupPanelPartInitParameters, IActionsRenderer, IContentRenderer, ITabRenderer } from '../groupview/types';
|
|
3
2
|
import { GroupPanel } from '../groupview/groupviewPanel';
|
|
4
3
|
import { IDisposable } from '../lifecycle';
|
|
@@ -18,7 +17,7 @@ export declare class DefaultGroupPanelView implements IGroupPanelView {
|
|
|
18
17
|
private readonly _tab;
|
|
19
18
|
private readonly _actions;
|
|
20
19
|
get content(): IContentRenderer;
|
|
21
|
-
get tab():
|
|
20
|
+
get tab(): ITabRenderer;
|
|
22
21
|
get actions(): IActionsRenderer | undefined;
|
|
23
22
|
constructor(renderers: {
|
|
24
23
|
content: IContentRenderer;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { DefaultTab
|
|
1
|
+
import { DefaultTab } from './components/tab/defaultTab';
|
|
2
2
|
export class DefaultGroupPanelView {
|
|
3
3
|
constructor(renderers) {
|
|
4
4
|
var _a;
|
|
5
5
|
this._content = renderers.content;
|
|
6
|
-
this._tab =
|
|
6
|
+
this._tab = (_a = renderers.tab) !== null && _a !== void 0 ? _a : new DefaultTab();
|
|
7
7
|
this._actions =
|
|
8
8
|
renderers.actions ||
|
|
9
9
|
(this.content.actions
|
|
@@ -43,9 +43,7 @@ export class DefaultGroupPanelView {
|
|
|
43
43
|
toJSON() {
|
|
44
44
|
return {
|
|
45
45
|
content: this.content.toJSON(),
|
|
46
|
-
tab: this.tab
|
|
47
|
-
? undefined
|
|
48
|
-
: this.tab.toJSON(),
|
|
46
|
+
tab: this.tab instanceof DefaultTab ? undefined : this.tab.toJSON(),
|
|
49
47
|
};
|
|
50
48
|
}
|
|
51
49
|
dispose() {
|
|
@@ -393,7 +393,7 @@ export class DockviewComponent extends BaseGrid {
|
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
395
|
const view = new GroupPanel(this, id, options);
|
|
396
|
-
view.init({ params: {},
|
|
396
|
+
view.init({ params: {}, accessor: null }); // required to initialized .part and allow for correct disposal of group
|
|
397
397
|
if (!this._groups.has(view.id)) {
|
|
398
398
|
const disposable = new CompositeDisposable(view.model.onMove((event) => {
|
|
399
399
|
const { groupId, itemId, target, index } = event;
|
|
@@ -107,7 +107,7 @@ export class DockviewGroupPanel extends CompositeDisposable {
|
|
|
107
107
|
layout(width, height) {
|
|
108
108
|
var _a;
|
|
109
109
|
// the obtain the correct dimensions of the content panel we must deduct the tab height
|
|
110
|
-
this.api.
|
|
110
|
+
this.api._onDidDimensionChange.fire({
|
|
111
111
|
width,
|
|
112
112
|
height: height - (this.group.model.header.height || 0),
|
|
113
113
|
});
|
|
@@ -40,7 +40,7 @@ export class BasePanelView extends CompositeDisposable {
|
|
|
40
40
|
layout(width, height) {
|
|
41
41
|
this._width = width;
|
|
42
42
|
this._height = height;
|
|
43
|
-
this.api.
|
|
43
|
+
this.api._onDidDimensionChange.fire({ width, height });
|
|
44
44
|
if (this.part) {
|
|
45
45
|
if (this._params) {
|
|
46
46
|
this.part.update(this._params.params);
|
|
@@ -37,7 +37,6 @@ export interface IGridviewComponent extends IBaseGrid<GridviewPanel> {
|
|
|
37
37
|
updateOptions(options: Partial<GridviewComponentUpdateOptions>): void;
|
|
38
38
|
addPanel(options: AddComponentOptions): IGridviewPanel;
|
|
39
39
|
removePanel(panel: IGridviewPanel, sizing?: Sizing): void;
|
|
40
|
-
toggleVisibility(panel: IGridviewPanel): void;
|
|
41
40
|
focus(): void;
|
|
42
41
|
fromJSON(serializedGridview: SerializedGridview): void;
|
|
43
42
|
toJSON(): SerializedGridview;
|
|
@@ -70,7 +69,6 @@ export declare class GridviewComponent extends BaseGrid<GridviewPanel> implement
|
|
|
70
69
|
toJSON(): SerializedGridview;
|
|
71
70
|
setVisible(panel: GridviewPanel, visible: boolean): void;
|
|
72
71
|
setActive(panel: GridviewPanel): void;
|
|
73
|
-
toggleVisibility(panel: GridviewPanel): void;
|
|
74
72
|
focus(): void;
|
|
75
73
|
fromJSON(serializedGridview: SerializedGridview): void;
|
|
76
74
|
movePanel(panel: GridviewPanel, options: {
|