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.amd.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
|
*/
|
|
@@ -2303,18 +2303,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2303
2303
|
removePanel(panel, sizing) {
|
|
2304
2304
|
this.component.removePanel(panel, sizing);
|
|
2305
2305
|
}
|
|
2306
|
-
setVisible(panel, isVisible) {
|
|
2307
|
-
this.component.setVisible(panel, isVisible);
|
|
2308
|
-
}
|
|
2309
2306
|
focus() {
|
|
2310
2307
|
this.component.focus();
|
|
2311
2308
|
}
|
|
2312
2309
|
getPanel(id) {
|
|
2313
2310
|
return this.component.getPanel(id);
|
|
2314
2311
|
}
|
|
2315
|
-
setActive(panel) {
|
|
2316
|
-
this.component.setActive(panel);
|
|
2317
|
-
}
|
|
2318
2312
|
layout(width, height) {
|
|
2319
2313
|
return this.component.layout(width, height);
|
|
2320
2314
|
}
|
|
@@ -2462,15 +2456,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2462
2456
|
getPanel(id) {
|
|
2463
2457
|
return this.component.getPanel(id);
|
|
2464
2458
|
}
|
|
2465
|
-
toggleVisibility(panel) {
|
|
2466
|
-
this.component.toggleVisibility(panel);
|
|
2467
|
-
}
|
|
2468
|
-
setVisible(panel, visible) {
|
|
2469
|
-
this.component.setVisible(panel, visible);
|
|
2470
|
-
}
|
|
2471
|
-
setActive(panel) {
|
|
2472
|
-
this.component.setActive(panel);
|
|
2473
|
-
}
|
|
2474
2459
|
fromJSON(data) {
|
|
2475
2460
|
return this.component.fromJSON(data);
|
|
2476
2461
|
}
|
|
@@ -2707,7 +2692,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2707
2692
|
MouseEventKind["CLICK"] = "CLICK";
|
|
2708
2693
|
MouseEventKind["CONTEXT_MENU"] = "CONTEXT_MENU";
|
|
2709
2694
|
})(exports.MouseEventKind || (exports.MouseEventKind = {}));
|
|
2710
|
-
class Tab
|
|
2695
|
+
class Tab extends CompositeDisposable {
|
|
2711
2696
|
constructor(panelId, accessor, group) {
|
|
2712
2697
|
super();
|
|
2713
2698
|
this.panelId = panelId;
|
|
@@ -2936,7 +2921,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2936
2921
|
if (this.tabs.find((tab) => tab.value.panelId === panel.id)) {
|
|
2937
2922
|
return;
|
|
2938
2923
|
}
|
|
2939
|
-
const tabToAdd = new Tab
|
|
2924
|
+
const tabToAdd = new Tab(panel.id, this.accessor, this.group);
|
|
2940
2925
|
if (!((_a = panel.view) === null || _a === void 0 ? void 0 : _a.tab)) {
|
|
2941
2926
|
throw new Error('invalid header component');
|
|
2942
2927
|
}
|
|
@@ -3607,10 +3592,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3607
3592
|
this._isVisible = true;
|
|
3608
3593
|
this._width = 0;
|
|
3609
3594
|
this._height = 0;
|
|
3610
|
-
this.
|
|
3595
|
+
this._onDidDimensionChange = new Emitter({
|
|
3611
3596
|
replay: true,
|
|
3612
3597
|
});
|
|
3613
|
-
this.onDidDimensionsChange = this.
|
|
3598
|
+
this.onDidDimensionsChange = this._onDidDimensionChange.event;
|
|
3614
3599
|
//
|
|
3615
3600
|
this._onDidChangeFocus = new Emitter({
|
|
3616
3601
|
replay: true,
|
|
@@ -3635,7 +3620,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3635
3620
|
//
|
|
3636
3621
|
this._onActiveChange = new Emitter();
|
|
3637
3622
|
this.onActiveChange = this._onActiveChange.event;
|
|
3638
|
-
this.addDisposables(this.
|
|
3623
|
+
this.addDisposables(this._onDidDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onFocusEvent, this._onActiveChange, this._onVisibilityChange, this.onDidFocusChange((event) => {
|
|
3639
3624
|
this._isFocused = event.isFocused;
|
|
3640
3625
|
}), this.onDidActiveChange((event) => {
|
|
3641
3626
|
this._isActive = event.isActive;
|
|
@@ -3859,7 +3844,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3859
3844
|
layout(width, height) {
|
|
3860
3845
|
var _a;
|
|
3861
3846
|
// the obtain the correct dimensions of the content panel we must deduct the tab height
|
|
3862
|
-
this.api.
|
|
3847
|
+
this.api._onDidDimensionChange.fire({
|
|
3863
3848
|
width,
|
|
3864
3849
|
height: height - (this.group.model.header.height || 0),
|
|
3865
3850
|
});
|
|
@@ -4009,53 +3994,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4009
3994
|
return new Component(id, componentName);
|
|
4010
3995
|
}
|
|
4011
3996
|
|
|
4012
|
-
class WrappedTab {
|
|
4013
|
-
constructor(renderer) {
|
|
4014
|
-
this.renderer = renderer;
|
|
4015
|
-
this._element = document.createElement('element');
|
|
4016
|
-
this.show();
|
|
4017
|
-
}
|
|
4018
|
-
get innerRenderer() {
|
|
4019
|
-
return this.renderer;
|
|
4020
|
-
}
|
|
4021
|
-
get element() {
|
|
4022
|
-
return this._element;
|
|
4023
|
-
}
|
|
4024
|
-
get id() {
|
|
4025
|
-
return this.renderer.id;
|
|
4026
|
-
}
|
|
4027
|
-
show() {
|
|
4028
|
-
if (!this.renderer.element.parentElement) {
|
|
4029
|
-
this._element.appendChild(this.renderer.element);
|
|
4030
|
-
}
|
|
4031
|
-
}
|
|
4032
|
-
hide() {
|
|
4033
|
-
if (this.renderer.element.parentElement) {
|
|
4034
|
-
this.renderer.element.remove();
|
|
4035
|
-
}
|
|
4036
|
-
}
|
|
4037
|
-
layout(width, height) {
|
|
4038
|
-
this.renderer.layout(width, height);
|
|
4039
|
-
}
|
|
4040
|
-
update(event) {
|
|
4041
|
-
this.renderer.update(event);
|
|
4042
|
-
}
|
|
4043
|
-
toJSON() {
|
|
4044
|
-
return this.renderer.toJSON();
|
|
4045
|
-
}
|
|
4046
|
-
focus() {
|
|
4047
|
-
this.renderer.focus();
|
|
4048
|
-
}
|
|
4049
|
-
init(parameters) {
|
|
4050
|
-
this.renderer.init(parameters);
|
|
4051
|
-
}
|
|
4052
|
-
updateParentGroup(group, isPanelVisible) {
|
|
4053
|
-
this.renderer.updateParentGroup(group, isPanelVisible);
|
|
4054
|
-
}
|
|
4055
|
-
dispose() {
|
|
4056
|
-
this.renderer.dispose();
|
|
4057
|
-
}
|
|
4058
|
-
}
|
|
4059
3997
|
class DefaultTab extends CompositeDisposable {
|
|
4060
3998
|
constructor() {
|
|
4061
3999
|
super();
|
|
@@ -4118,15 +4056,21 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4118
4056
|
}
|
|
4119
4057
|
}
|
|
4120
4058
|
updateParentGroup(group, isPanelVisible) {
|
|
4059
|
+
const changed = this._isPanelVisible !== isPanelVisible ||
|
|
4060
|
+
this._isGroupActive !== group.isActive;
|
|
4121
4061
|
this._isPanelVisible = isPanelVisible;
|
|
4122
4062
|
this._isGroupActive = group.isActive;
|
|
4123
|
-
|
|
4063
|
+
if (changed) {
|
|
4064
|
+
this.render();
|
|
4065
|
+
}
|
|
4124
4066
|
}
|
|
4125
4067
|
layout(_width, _height) {
|
|
4126
4068
|
// noop
|
|
4127
4069
|
}
|
|
4128
4070
|
render() {
|
|
4129
|
-
this._content.textContent
|
|
4071
|
+
if (this._content.textContent !== this.params.title) {
|
|
4072
|
+
this._content.textContent = this.params.title;
|
|
4073
|
+
}
|
|
4130
4074
|
}
|
|
4131
4075
|
}
|
|
4132
4076
|
|
|
@@ -4170,7 +4114,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4170
4114
|
layout(width, height) {
|
|
4171
4115
|
this._width = width;
|
|
4172
4116
|
this._height = height;
|
|
4173
|
-
this.api.
|
|
4117
|
+
this.api._onDidDimensionChange.fire({ width, height });
|
|
4174
4118
|
if (this.part) {
|
|
4175
4119
|
if (this._params) {
|
|
4176
4120
|
this.part.update(this._params.params);
|
|
@@ -4219,11 +4163,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4219
4163
|
this.onDidChange = this._onDidChange.event;
|
|
4220
4164
|
this.addDisposables(this._onDidChange, this.api.onVisibilityChange((event) => {
|
|
4221
4165
|
const { isVisible } = event;
|
|
4222
|
-
const {
|
|
4223
|
-
|
|
4166
|
+
const { accessor } = this._params;
|
|
4167
|
+
accessor.setVisible(this, isVisible);
|
|
4224
4168
|
}), this.api.onActiveChange(() => {
|
|
4225
|
-
const {
|
|
4226
|
-
|
|
4169
|
+
const { accessor } = this._params;
|
|
4170
|
+
accessor.setActive(this);
|
|
4227
4171
|
}), this.api.onDidConstraintsChangeInternal((event) => {
|
|
4228
4172
|
if (typeof event.minimumWidth === 'number' ||
|
|
4229
4173
|
typeof event.minimumWidth === 'function') {
|
|
@@ -4402,7 +4346,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4402
4346
|
constructor(renderers) {
|
|
4403
4347
|
var _a;
|
|
4404
4348
|
this._content = renderers.content;
|
|
4405
|
-
this._tab =
|
|
4349
|
+
this._tab = (_a = renderers.tab) !== null && _a !== void 0 ? _a : new DefaultTab();
|
|
4406
4350
|
this._actions =
|
|
4407
4351
|
renderers.actions ||
|
|
4408
4352
|
(this.content.actions
|
|
@@ -4442,9 +4386,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4442
4386
|
toJSON() {
|
|
4443
4387
|
return {
|
|
4444
4388
|
content: this.content.toJSON(),
|
|
4445
|
-
tab: this.tab
|
|
4446
|
-
? undefined
|
|
4447
|
-
: this.tab.toJSON(),
|
|
4389
|
+
tab: this.tab instanceof DefaultTab ? undefined : this.tab.toJSON(),
|
|
4448
4390
|
};
|
|
4449
4391
|
}
|
|
4450
4392
|
dispose() {
|
|
@@ -4832,7 +4774,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4832
4774
|
}
|
|
4833
4775
|
}
|
|
4834
4776
|
const view = new GroupPanel(this, id, options);
|
|
4835
|
-
view.init({ params: {},
|
|
4777
|
+
view.init({ params: {}, accessor: null }); // required to initialized .part and allow for correct disposal of group
|
|
4836
4778
|
if (!this._groups.has(view.id)) {
|
|
4837
4779
|
const disposable = new CompositeDisposable(view.model.onMove((event) => {
|
|
4838
4780
|
const { groupId, itemId, target, index } = event;
|
|
@@ -4971,9 +4913,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4971
4913
|
value.value.setActive(panel === value.value);
|
|
4972
4914
|
});
|
|
4973
4915
|
}
|
|
4974
|
-
toggleVisibility(panel) {
|
|
4975
|
-
this.setVisible(panel, !this.isVisible(panel));
|
|
4976
|
-
}
|
|
4977
4916
|
focus() {
|
|
4978
4917
|
var _a;
|
|
4979
4918
|
(_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.focus();
|
|
@@ -5004,7 +4943,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5004
4943
|
maximumHeight: data.maximumHeight,
|
|
5005
4944
|
priority: data.priority,
|
|
5006
4945
|
snap: !!data.snap,
|
|
5007
|
-
|
|
4946
|
+
accessor: this,
|
|
5008
4947
|
isVisible: node.visible,
|
|
5009
4948
|
}));
|
|
5010
4949
|
this.registerPanel(view);
|
|
@@ -5070,7 +5009,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5070
5009
|
maximumHeight: options.maximumHeight,
|
|
5071
5010
|
priority: options.priority,
|
|
5072
5011
|
snap: !!options.snap,
|
|
5073
|
-
|
|
5012
|
+
accessor: this,
|
|
5074
5013
|
isVisible: true,
|
|
5075
5014
|
});
|
|
5076
5015
|
this.registerPanel(view);
|
|
@@ -5266,7 +5205,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5266
5205
|
maximumSize: options.maximumSize,
|
|
5267
5206
|
snap: options.snap,
|
|
5268
5207
|
priority: options.priority,
|
|
5269
|
-
|
|
5208
|
+
accessor: this,
|
|
5270
5209
|
});
|
|
5271
5210
|
const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
|
|
5272
5211
|
const index = typeof options.index === 'number' ? options.index : undefined;
|
|
@@ -5342,7 +5281,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5342
5281
|
maximumSize: data.maximumSize,
|
|
5343
5282
|
snap: view.snap,
|
|
5344
5283
|
priority: view.priority,
|
|
5345
|
-
|
|
5284
|
+
accessor: this,
|
|
5346
5285
|
});
|
|
5347
5286
|
});
|
|
5348
5287
|
panel.orientation = orientation;
|
|
@@ -5984,13 +5923,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5984
5923
|
this.onDidChange = this._onDidChange.event;
|
|
5985
5924
|
this.addDisposables(this._onDidChange, this.api.onVisibilityChange((event) => {
|
|
5986
5925
|
const { isVisible } = event;
|
|
5987
|
-
const {
|
|
5988
|
-
|
|
5989
|
-
containerApi.setVisible(this, isVisible);
|
|
5926
|
+
const { accessor } = this._params;
|
|
5927
|
+
accessor.setVisible(this, isVisible);
|
|
5990
5928
|
}), this.api.onActiveChange(() => {
|
|
5991
|
-
const {
|
|
5992
|
-
|
|
5993
|
-
containerApi.setActive(this);
|
|
5929
|
+
const { accessor } = this._params;
|
|
5930
|
+
accessor.setActive(this);
|
|
5994
5931
|
}), this.api.onDidConstraintsChangeInternal((event) => {
|
|
5995
5932
|
if (typeof event.minimumSize === 'number' ||
|
|
5996
5933
|
typeof event.minimumSize === 'function') {
|
|
@@ -6242,9 +6179,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6242
6179
|
layout(_width, _height) {
|
|
6243
6180
|
// noop
|
|
6244
6181
|
}
|
|
6245
|
-
close() {
|
|
6246
|
-
return Promise.resolve(true);
|
|
6247
|
-
}
|
|
6248
6182
|
dispose() {
|
|
6249
6183
|
var _a, _b;
|
|
6250
6184
|
this._onDidFocus.dispose();
|
|
@@ -6514,58 +6448,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6514
6448
|
});
|
|
6515
6449
|
DockviewReact.displayName = 'DockviewComponent';
|
|
6516
6450
|
|
|
6517
|
-
const Tab = (props) => {
|
|
6518
|
-
return React__namespace.createElement(React__namespace.Fragment, null, props.children);
|
|
6519
|
-
};
|
|
6520
|
-
const Content = (props) => {
|
|
6521
|
-
return React__namespace.createElement(React__namespace.Fragment, null, props.children);
|
|
6522
|
-
};
|
|
6523
|
-
const Actions = (props) => {
|
|
6524
|
-
return React__namespace.createElement(React__namespace.Fragment, null, props.children);
|
|
6525
|
-
};
|
|
6526
|
-
function isValidComponent(element) {
|
|
6527
|
-
return [Content, Actions, Tab].find((comp) => element.type === comp);
|
|
6528
|
-
}
|
|
6529
|
-
const Panel = (props) => {
|
|
6530
|
-
const context = React__namespace.useContext(ReactPartContext);
|
|
6531
|
-
const sections = React__namespace.useMemo(() => {
|
|
6532
|
-
var _a;
|
|
6533
|
-
const childs = ((_a = React__namespace.Children.map(props.children, (_) => _)) === null || _a === void 0 ? void 0 : _a.filter(isReactElement)) || [];
|
|
6534
|
-
const isInvalid = !!childs.find((_) => !isValidComponent(_));
|
|
6535
|
-
if (isInvalid) {
|
|
6536
|
-
throw new Error('Children of DockviewComponents.Panel must be one of the following: DockviewComponents.Content, DockviewComponents.Actions, DockviewComponents.Tab');
|
|
6537
|
-
}
|
|
6538
|
-
const body = childs.find((_) => _.type === Content);
|
|
6539
|
-
const actions = childs.find((_) => _.type === Actions);
|
|
6540
|
-
const tab = childs.find((_) => _.type === Tab);
|
|
6541
|
-
return { body, actions, tab };
|
|
6542
|
-
}, [props.children]);
|
|
6543
|
-
React__namespace.useEffect(() => {
|
|
6544
|
-
/**
|
|
6545
|
-
* hide or show the default tab behavior based on whether we want to override
|
|
6546
|
-
* with our own React tab.
|
|
6547
|
-
*/
|
|
6548
|
-
if (sections.tab) {
|
|
6549
|
-
context.tabPortalElement.hide();
|
|
6550
|
-
}
|
|
6551
|
-
else {
|
|
6552
|
-
context.tabPortalElement.show();
|
|
6553
|
-
}
|
|
6554
|
-
}, [sections.tab]);
|
|
6555
|
-
return (React__namespace.createElement(React__namespace.Fragment, null,
|
|
6556
|
-
sections.actions &&
|
|
6557
|
-
ReactDOM__namespace.createPortal(sections.actions, context.actionsPortalElement),
|
|
6558
|
-
sections.tab &&
|
|
6559
|
-
ReactDOM__namespace.createPortal(sections.tab, context.tabPortalElement.element),
|
|
6560
|
-
sections.body || props.children));
|
|
6561
|
-
};
|
|
6562
|
-
const DockviewComponents = {
|
|
6563
|
-
Tab,
|
|
6564
|
-
Content,
|
|
6565
|
-
Actions,
|
|
6566
|
-
Panel,
|
|
6567
|
-
};
|
|
6568
|
-
|
|
6569
6451
|
class ReactPanelView extends SplitviewPanel {
|
|
6570
6452
|
constructor(id, component, reactComponent, reactPortalStore) {
|
|
6571
6453
|
super(id, component);
|
|
@@ -6577,8 +6459,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6577
6459
|
return new ReactPart(this.element, this.reactPortalStore, this.reactComponent, {
|
|
6578
6460
|
params: ((_a = this._params) === null || _a === void 0 ? void 0 : _a.params) || {},
|
|
6579
6461
|
api: this.api,
|
|
6580
|
-
containerApi: this._params
|
|
6581
|
-
.containerApi,
|
|
6462
|
+
containerApi: new SplitviewApi(this._params.accessor),
|
|
6582
6463
|
});
|
|
6583
6464
|
}
|
|
6584
6465
|
}
|
|
@@ -6654,8 +6535,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6654
6535
|
return new ReactPart(this.element, this.reactPortalStore, this.reactComponent, {
|
|
6655
6536
|
params: ((_a = this._params) === null || _a === void 0 ? void 0 : _a.params) || {},
|
|
6656
6537
|
api: this.api,
|
|
6657
|
-
containerApi: this._params
|
|
6658
|
-
.containerApi,
|
|
6538
|
+
containerApi: new GridviewApi(this._params.accessor),
|
|
6659
6539
|
});
|
|
6660
6540
|
}
|
|
6661
6541
|
}
|
|
@@ -6849,7 +6729,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6849
6729
|
exports.ContentContainer = ContentContainer;
|
|
6850
6730
|
exports.DockviewApi = DockviewApi;
|
|
6851
6731
|
exports.DockviewComponent = DockviewComponent;
|
|
6852
|
-
exports.DockviewComponents = DockviewComponents;
|
|
6853
6732
|
exports.DockviewReact = DockviewReact;
|
|
6854
6733
|
exports.Gridview = Gridview;
|
|
6855
6734
|
exports.GridviewApi = GridviewApi;
|
|
@@ -6875,7 +6754,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6875
6754
|
exports.SplitviewComponent = SplitviewComponent;
|
|
6876
6755
|
exports.SplitviewPanel = SplitviewPanel;
|
|
6877
6756
|
exports.SplitviewReact = SplitviewReact;
|
|
6878
|
-
exports.Tab = Tab
|
|
6757
|
+
exports.Tab = Tab;
|
|
6879
6758
|
exports.getDirectionOrientation = getDirectionOrientation;
|
|
6880
6759
|
exports.getGridLocation = getGridLocation;
|
|
6881
6760
|
exports.getLocationOrientation = getLocationOrientation;
|