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.esm.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
|
*/
|
|
@@ -2283,18 +2283,12 @@ class SplitviewApi {
|
|
|
2283
2283
|
removePanel(panel, sizing) {
|
|
2284
2284
|
this.component.removePanel(panel, sizing);
|
|
2285
2285
|
}
|
|
2286
|
-
setVisible(panel, isVisible) {
|
|
2287
|
-
this.component.setVisible(panel, isVisible);
|
|
2288
|
-
}
|
|
2289
2286
|
focus() {
|
|
2290
2287
|
this.component.focus();
|
|
2291
2288
|
}
|
|
2292
2289
|
getPanel(id) {
|
|
2293
2290
|
return this.component.getPanel(id);
|
|
2294
2291
|
}
|
|
2295
|
-
setActive(panel) {
|
|
2296
|
-
this.component.setActive(panel);
|
|
2297
|
-
}
|
|
2298
2292
|
layout(width, height) {
|
|
2299
2293
|
return this.component.layout(width, height);
|
|
2300
2294
|
}
|
|
@@ -2442,15 +2436,6 @@ class GridviewApi {
|
|
|
2442
2436
|
getPanel(id) {
|
|
2443
2437
|
return this.component.getPanel(id);
|
|
2444
2438
|
}
|
|
2445
|
-
toggleVisibility(panel) {
|
|
2446
|
-
this.component.toggleVisibility(panel);
|
|
2447
|
-
}
|
|
2448
|
-
setVisible(panel, visible) {
|
|
2449
|
-
this.component.setVisible(panel, visible);
|
|
2450
|
-
}
|
|
2451
|
-
setActive(panel) {
|
|
2452
|
-
this.component.setActive(panel);
|
|
2453
|
-
}
|
|
2454
2439
|
fromJSON(data) {
|
|
2455
2440
|
return this.component.fromJSON(data);
|
|
2456
2441
|
}
|
|
@@ -2687,7 +2672,7 @@ var MouseEventKind;
|
|
|
2687
2672
|
MouseEventKind["CLICK"] = "CLICK";
|
|
2688
2673
|
MouseEventKind["CONTEXT_MENU"] = "CONTEXT_MENU";
|
|
2689
2674
|
})(MouseEventKind || (MouseEventKind = {}));
|
|
2690
|
-
class Tab
|
|
2675
|
+
class Tab extends CompositeDisposable {
|
|
2691
2676
|
constructor(panelId, accessor, group) {
|
|
2692
2677
|
super();
|
|
2693
2678
|
this.panelId = panelId;
|
|
@@ -2916,7 +2901,7 @@ class TabsContainer extends CompositeDisposable {
|
|
|
2916
2901
|
if (this.tabs.find((tab) => tab.value.panelId === panel.id)) {
|
|
2917
2902
|
return;
|
|
2918
2903
|
}
|
|
2919
|
-
const tabToAdd = new Tab
|
|
2904
|
+
const tabToAdd = new Tab(panel.id, this.accessor, this.group);
|
|
2920
2905
|
if (!((_a = panel.view) === null || _a === void 0 ? void 0 : _a.tab)) {
|
|
2921
2906
|
throw new Error('invalid header component');
|
|
2922
2907
|
}
|
|
@@ -3587,10 +3572,10 @@ class PanelApiImpl extends CompositeDisposable {
|
|
|
3587
3572
|
this._isVisible = true;
|
|
3588
3573
|
this._width = 0;
|
|
3589
3574
|
this._height = 0;
|
|
3590
|
-
this.
|
|
3575
|
+
this._onDidDimensionChange = new Emitter({
|
|
3591
3576
|
replay: true,
|
|
3592
3577
|
});
|
|
3593
|
-
this.onDidDimensionsChange = this.
|
|
3578
|
+
this.onDidDimensionsChange = this._onDidDimensionChange.event;
|
|
3594
3579
|
//
|
|
3595
3580
|
this._onDidChangeFocus = new Emitter({
|
|
3596
3581
|
replay: true,
|
|
@@ -3615,7 +3600,7 @@ class PanelApiImpl extends CompositeDisposable {
|
|
|
3615
3600
|
//
|
|
3616
3601
|
this._onActiveChange = new Emitter();
|
|
3617
3602
|
this.onActiveChange = this._onActiveChange.event;
|
|
3618
|
-
this.addDisposables(this.
|
|
3603
|
+
this.addDisposables(this._onDidDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onFocusEvent, this._onActiveChange, this._onVisibilityChange, this.onDidFocusChange((event) => {
|
|
3619
3604
|
this._isFocused = event.isFocused;
|
|
3620
3605
|
}), this.onDidActiveChange((event) => {
|
|
3621
3606
|
this._isActive = event.isActive;
|
|
@@ -3839,7 +3824,7 @@ class DockviewGroupPanel extends CompositeDisposable {
|
|
|
3839
3824
|
layout(width, height) {
|
|
3840
3825
|
var _a;
|
|
3841
3826
|
// the obtain the correct dimensions of the content panel we must deduct the tab height
|
|
3842
|
-
this.api.
|
|
3827
|
+
this.api._onDidDimensionChange.fire({
|
|
3843
3828
|
width,
|
|
3844
3829
|
height: height - (this.group.model.header.height || 0),
|
|
3845
3830
|
});
|
|
@@ -3989,53 +3974,6 @@ function createComponent(id, componentName, components = {}, frameworkComponents
|
|
|
3989
3974
|
return new Component(id, componentName);
|
|
3990
3975
|
}
|
|
3991
3976
|
|
|
3992
|
-
class WrappedTab {
|
|
3993
|
-
constructor(renderer) {
|
|
3994
|
-
this.renderer = renderer;
|
|
3995
|
-
this._element = document.createElement('element');
|
|
3996
|
-
this.show();
|
|
3997
|
-
}
|
|
3998
|
-
get innerRenderer() {
|
|
3999
|
-
return this.renderer;
|
|
4000
|
-
}
|
|
4001
|
-
get element() {
|
|
4002
|
-
return this._element;
|
|
4003
|
-
}
|
|
4004
|
-
get id() {
|
|
4005
|
-
return this.renderer.id;
|
|
4006
|
-
}
|
|
4007
|
-
show() {
|
|
4008
|
-
if (!this.renderer.element.parentElement) {
|
|
4009
|
-
this._element.appendChild(this.renderer.element);
|
|
4010
|
-
}
|
|
4011
|
-
}
|
|
4012
|
-
hide() {
|
|
4013
|
-
if (this.renderer.element.parentElement) {
|
|
4014
|
-
this.renderer.element.remove();
|
|
4015
|
-
}
|
|
4016
|
-
}
|
|
4017
|
-
layout(width, height) {
|
|
4018
|
-
this.renderer.layout(width, height);
|
|
4019
|
-
}
|
|
4020
|
-
update(event) {
|
|
4021
|
-
this.renderer.update(event);
|
|
4022
|
-
}
|
|
4023
|
-
toJSON() {
|
|
4024
|
-
return this.renderer.toJSON();
|
|
4025
|
-
}
|
|
4026
|
-
focus() {
|
|
4027
|
-
this.renderer.focus();
|
|
4028
|
-
}
|
|
4029
|
-
init(parameters) {
|
|
4030
|
-
this.renderer.init(parameters);
|
|
4031
|
-
}
|
|
4032
|
-
updateParentGroup(group, isPanelVisible) {
|
|
4033
|
-
this.renderer.updateParentGroup(group, isPanelVisible);
|
|
4034
|
-
}
|
|
4035
|
-
dispose() {
|
|
4036
|
-
this.renderer.dispose();
|
|
4037
|
-
}
|
|
4038
|
-
}
|
|
4039
3977
|
class DefaultTab extends CompositeDisposable {
|
|
4040
3978
|
constructor() {
|
|
4041
3979
|
super();
|
|
@@ -4098,15 +4036,21 @@ class DefaultTab extends CompositeDisposable {
|
|
|
4098
4036
|
}
|
|
4099
4037
|
}
|
|
4100
4038
|
updateParentGroup(group, isPanelVisible) {
|
|
4039
|
+
const changed = this._isPanelVisible !== isPanelVisible ||
|
|
4040
|
+
this._isGroupActive !== group.isActive;
|
|
4101
4041
|
this._isPanelVisible = isPanelVisible;
|
|
4102
4042
|
this._isGroupActive = group.isActive;
|
|
4103
|
-
|
|
4043
|
+
if (changed) {
|
|
4044
|
+
this.render();
|
|
4045
|
+
}
|
|
4104
4046
|
}
|
|
4105
4047
|
layout(_width, _height) {
|
|
4106
4048
|
// noop
|
|
4107
4049
|
}
|
|
4108
4050
|
render() {
|
|
4109
|
-
this._content.textContent
|
|
4051
|
+
if (this._content.textContent !== this.params.title) {
|
|
4052
|
+
this._content.textContent = this.params.title;
|
|
4053
|
+
}
|
|
4110
4054
|
}
|
|
4111
4055
|
}
|
|
4112
4056
|
|
|
@@ -4150,7 +4094,7 @@ class BasePanelView extends CompositeDisposable {
|
|
|
4150
4094
|
layout(width, height) {
|
|
4151
4095
|
this._width = width;
|
|
4152
4096
|
this._height = height;
|
|
4153
|
-
this.api.
|
|
4097
|
+
this.api._onDidDimensionChange.fire({ width, height });
|
|
4154
4098
|
if (this.part) {
|
|
4155
4099
|
if (this._params) {
|
|
4156
4100
|
this.part.update(this._params.params);
|
|
@@ -4199,11 +4143,11 @@ class GridviewPanel extends BasePanelView {
|
|
|
4199
4143
|
this.onDidChange = this._onDidChange.event;
|
|
4200
4144
|
this.addDisposables(this._onDidChange, this.api.onVisibilityChange((event) => {
|
|
4201
4145
|
const { isVisible } = event;
|
|
4202
|
-
const {
|
|
4203
|
-
|
|
4146
|
+
const { accessor } = this._params;
|
|
4147
|
+
accessor.setVisible(this, isVisible);
|
|
4204
4148
|
}), this.api.onActiveChange(() => {
|
|
4205
|
-
const {
|
|
4206
|
-
|
|
4149
|
+
const { accessor } = this._params;
|
|
4150
|
+
accessor.setActive(this);
|
|
4207
4151
|
}), this.api.onDidConstraintsChangeInternal((event) => {
|
|
4208
4152
|
if (typeof event.minimumWidth === 'number' ||
|
|
4209
4153
|
typeof event.minimumWidth === 'function') {
|
|
@@ -4382,7 +4326,7 @@ class DefaultGroupPanelView {
|
|
|
4382
4326
|
constructor(renderers) {
|
|
4383
4327
|
var _a;
|
|
4384
4328
|
this._content = renderers.content;
|
|
4385
|
-
this._tab =
|
|
4329
|
+
this._tab = (_a = renderers.tab) !== null && _a !== void 0 ? _a : new DefaultTab();
|
|
4386
4330
|
this._actions =
|
|
4387
4331
|
renderers.actions ||
|
|
4388
4332
|
(this.content.actions
|
|
@@ -4422,9 +4366,7 @@ class DefaultGroupPanelView {
|
|
|
4422
4366
|
toJSON() {
|
|
4423
4367
|
return {
|
|
4424
4368
|
content: this.content.toJSON(),
|
|
4425
|
-
tab: this.tab
|
|
4426
|
-
? undefined
|
|
4427
|
-
: this.tab.toJSON(),
|
|
4369
|
+
tab: this.tab instanceof DefaultTab ? undefined : this.tab.toJSON(),
|
|
4428
4370
|
};
|
|
4429
4371
|
}
|
|
4430
4372
|
dispose() {
|
|
@@ -4812,7 +4754,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
4812
4754
|
}
|
|
4813
4755
|
}
|
|
4814
4756
|
const view = new GroupPanel(this, id, options);
|
|
4815
|
-
view.init({ params: {},
|
|
4757
|
+
view.init({ params: {}, accessor: null }); // required to initialized .part and allow for correct disposal of group
|
|
4816
4758
|
if (!this._groups.has(view.id)) {
|
|
4817
4759
|
const disposable = new CompositeDisposable(view.model.onMove((event) => {
|
|
4818
4760
|
const { groupId, itemId, target, index } = event;
|
|
@@ -4951,9 +4893,6 @@ class GridviewComponent extends BaseGrid {
|
|
|
4951
4893
|
value.value.setActive(panel === value.value);
|
|
4952
4894
|
});
|
|
4953
4895
|
}
|
|
4954
|
-
toggleVisibility(panel) {
|
|
4955
|
-
this.setVisible(panel, !this.isVisible(panel));
|
|
4956
|
-
}
|
|
4957
4896
|
focus() {
|
|
4958
4897
|
var _a;
|
|
4959
4898
|
(_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.focus();
|
|
@@ -4984,7 +4923,7 @@ class GridviewComponent extends BaseGrid {
|
|
|
4984
4923
|
maximumHeight: data.maximumHeight,
|
|
4985
4924
|
priority: data.priority,
|
|
4986
4925
|
snap: !!data.snap,
|
|
4987
|
-
|
|
4926
|
+
accessor: this,
|
|
4988
4927
|
isVisible: node.visible,
|
|
4989
4928
|
}));
|
|
4990
4929
|
this.registerPanel(view);
|
|
@@ -5050,7 +4989,7 @@ class GridviewComponent extends BaseGrid {
|
|
|
5050
4989
|
maximumHeight: options.maximumHeight,
|
|
5051
4990
|
priority: options.priority,
|
|
5052
4991
|
snap: !!options.snap,
|
|
5053
|
-
|
|
4992
|
+
accessor: this,
|
|
5054
4993
|
isVisible: true,
|
|
5055
4994
|
});
|
|
5056
4995
|
this.registerPanel(view);
|
|
@@ -5246,7 +5185,7 @@ class SplitviewComponent extends CompositeDisposable {
|
|
|
5246
5185
|
maximumSize: options.maximumSize,
|
|
5247
5186
|
snap: options.snap,
|
|
5248
5187
|
priority: options.priority,
|
|
5249
|
-
|
|
5188
|
+
accessor: this,
|
|
5250
5189
|
});
|
|
5251
5190
|
const size = typeof options.size === 'number' ? options.size : Sizing.Distribute;
|
|
5252
5191
|
const index = typeof options.index === 'number' ? options.index : undefined;
|
|
@@ -5322,7 +5261,7 @@ class SplitviewComponent extends CompositeDisposable {
|
|
|
5322
5261
|
maximumSize: data.maximumSize,
|
|
5323
5262
|
snap: view.snap,
|
|
5324
5263
|
priority: view.priority,
|
|
5325
|
-
|
|
5264
|
+
accessor: this,
|
|
5326
5265
|
});
|
|
5327
5266
|
});
|
|
5328
5267
|
panel.orientation = orientation;
|
|
@@ -5964,13 +5903,11 @@ class SplitviewPanel extends BasePanelView {
|
|
|
5964
5903
|
this.onDidChange = this._onDidChange.event;
|
|
5965
5904
|
this.addDisposables(this._onDidChange, this.api.onVisibilityChange((event) => {
|
|
5966
5905
|
const { isVisible } = event;
|
|
5967
|
-
const {
|
|
5968
|
-
|
|
5969
|
-
containerApi.setVisible(this, isVisible);
|
|
5906
|
+
const { accessor } = this._params;
|
|
5907
|
+
accessor.setVisible(this, isVisible);
|
|
5970
5908
|
}), this.api.onActiveChange(() => {
|
|
5971
|
-
const {
|
|
5972
|
-
|
|
5973
|
-
containerApi.setActive(this);
|
|
5909
|
+
const { accessor } = this._params;
|
|
5910
|
+
accessor.setActive(this);
|
|
5974
5911
|
}), this.api.onDidConstraintsChangeInternal((event) => {
|
|
5975
5912
|
if (typeof event.minimumSize === 'number' ||
|
|
5976
5913
|
typeof event.minimumSize === 'function') {
|
|
@@ -6222,9 +6159,6 @@ class ReactPanelContentPart {
|
|
|
6222
6159
|
layout(_width, _height) {
|
|
6223
6160
|
// noop
|
|
6224
6161
|
}
|
|
6225
|
-
close() {
|
|
6226
|
-
return Promise.resolve(true);
|
|
6227
|
-
}
|
|
6228
6162
|
dispose() {
|
|
6229
6163
|
var _a, _b;
|
|
6230
6164
|
this._onDidFocus.dispose();
|
|
@@ -6494,58 +6428,6 @@ const DockviewReact = React.forwardRef((props, ref) => {
|
|
|
6494
6428
|
});
|
|
6495
6429
|
DockviewReact.displayName = 'DockviewComponent';
|
|
6496
6430
|
|
|
6497
|
-
const Tab = (props) => {
|
|
6498
|
-
return React.createElement(React.Fragment, null, props.children);
|
|
6499
|
-
};
|
|
6500
|
-
const Content = (props) => {
|
|
6501
|
-
return React.createElement(React.Fragment, null, props.children);
|
|
6502
|
-
};
|
|
6503
|
-
const Actions = (props) => {
|
|
6504
|
-
return React.createElement(React.Fragment, null, props.children);
|
|
6505
|
-
};
|
|
6506
|
-
function isValidComponent(element) {
|
|
6507
|
-
return [Content, Actions, Tab].find((comp) => element.type === comp);
|
|
6508
|
-
}
|
|
6509
|
-
const Panel = (props) => {
|
|
6510
|
-
const context = React.useContext(ReactPartContext);
|
|
6511
|
-
const sections = React.useMemo(() => {
|
|
6512
|
-
var _a;
|
|
6513
|
-
const childs = ((_a = React.Children.map(props.children, (_) => _)) === null || _a === void 0 ? void 0 : _a.filter(isReactElement)) || [];
|
|
6514
|
-
const isInvalid = !!childs.find((_) => !isValidComponent(_));
|
|
6515
|
-
if (isInvalid) {
|
|
6516
|
-
throw new Error('Children of DockviewComponents.Panel must be one of the following: DockviewComponents.Content, DockviewComponents.Actions, DockviewComponents.Tab');
|
|
6517
|
-
}
|
|
6518
|
-
const body = childs.find((_) => _.type === Content);
|
|
6519
|
-
const actions = childs.find((_) => _.type === Actions);
|
|
6520
|
-
const tab = childs.find((_) => _.type === Tab);
|
|
6521
|
-
return { body, actions, tab };
|
|
6522
|
-
}, [props.children]);
|
|
6523
|
-
React.useEffect(() => {
|
|
6524
|
-
/**
|
|
6525
|
-
* hide or show the default tab behavior based on whether we want to override
|
|
6526
|
-
* with our own React tab.
|
|
6527
|
-
*/
|
|
6528
|
-
if (sections.tab) {
|
|
6529
|
-
context.tabPortalElement.hide();
|
|
6530
|
-
}
|
|
6531
|
-
else {
|
|
6532
|
-
context.tabPortalElement.show();
|
|
6533
|
-
}
|
|
6534
|
-
}, [sections.tab]);
|
|
6535
|
-
return (React.createElement(React.Fragment, null,
|
|
6536
|
-
sections.actions &&
|
|
6537
|
-
ReactDOM.createPortal(sections.actions, context.actionsPortalElement),
|
|
6538
|
-
sections.tab &&
|
|
6539
|
-
ReactDOM.createPortal(sections.tab, context.tabPortalElement.element),
|
|
6540
|
-
sections.body || props.children));
|
|
6541
|
-
};
|
|
6542
|
-
const DockviewComponents = {
|
|
6543
|
-
Tab,
|
|
6544
|
-
Content,
|
|
6545
|
-
Actions,
|
|
6546
|
-
Panel,
|
|
6547
|
-
};
|
|
6548
|
-
|
|
6549
6431
|
class ReactPanelView extends SplitviewPanel {
|
|
6550
6432
|
constructor(id, component, reactComponent, reactPortalStore) {
|
|
6551
6433
|
super(id, component);
|
|
@@ -6557,8 +6439,7 @@ class ReactPanelView extends SplitviewPanel {
|
|
|
6557
6439
|
return new ReactPart(this.element, this.reactPortalStore, this.reactComponent, {
|
|
6558
6440
|
params: ((_a = this._params) === null || _a === void 0 ? void 0 : _a.params) || {},
|
|
6559
6441
|
api: this.api,
|
|
6560
|
-
containerApi: this._params
|
|
6561
|
-
.containerApi,
|
|
6442
|
+
containerApi: new SplitviewApi(this._params.accessor),
|
|
6562
6443
|
});
|
|
6563
6444
|
}
|
|
6564
6445
|
}
|
|
@@ -6634,8 +6515,7 @@ class ReactGridPanelView extends GridviewPanel {
|
|
|
6634
6515
|
return new ReactPart(this.element, this.reactPortalStore, this.reactComponent, {
|
|
6635
6516
|
params: ((_a = this._params) === null || _a === void 0 ? void 0 : _a.params) || {},
|
|
6636
6517
|
api: this.api,
|
|
6637
|
-
containerApi: this._params
|
|
6638
|
-
.containerApi,
|
|
6518
|
+
containerApi: new GridviewApi(this._params.accessor),
|
|
6639
6519
|
});
|
|
6640
6520
|
}
|
|
6641
6521
|
}
|
|
@@ -6825,4 +6705,4 @@ const PaneviewReact = React.forwardRef((props, ref) => {
|
|
|
6825
6705
|
});
|
|
6826
6706
|
PaneviewReact.displayName = 'PaneviewComponent';
|
|
6827
6707
|
|
|
6828
|
-
export { BaseGrid, ContentContainer, DockviewApi, DockviewComponent,
|
|
6708
|
+
export { BaseGrid, ContentContainer, DockviewApi, DockviewComponent, DockviewReact, Event, Gridview, GridviewApi, GridviewComponent, GridviewPanel, GridviewReact, GroupChangeKind2, Groupview, LayoutPriority, LocalSelectionTransfer, MouseEventKind, Orientation, PaneFramework, PaneTransfer, PanelTransfer, Paneview, PaneviewApi, PaneviewComponent, PaneviewPanel, PaneviewReact, Position, ReactPanelContentPart, ReactPanelHeaderPart, ReactPart, ReactPartContext, SashState, Sizing, Splitview, SplitviewApi, SplitviewComponent, SplitviewPanel, SplitviewReact, Tab, getDirectionOrientation, getGridLocation, getLocationOrientation, getPaneData, getPanelData, getRelativeLocation, indexInParent, isGridBranchNode, isReactElement, orthogonal, toTarget, usePortalsLifecycle };
|