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
|
@@ -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
|
*/
|
|
@@ -2273,18 +2273,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2273
2273
|
removePanel(panel, sizing) {
|
|
2274
2274
|
this.component.removePanel(panel, sizing);
|
|
2275
2275
|
}
|
|
2276
|
-
setVisible(panel, isVisible) {
|
|
2277
|
-
this.component.setVisible(panel, isVisible);
|
|
2278
|
-
}
|
|
2279
2276
|
focus() {
|
|
2280
2277
|
this.component.focus();
|
|
2281
2278
|
}
|
|
2282
2279
|
getPanel(id) {
|
|
2283
2280
|
return this.component.getPanel(id);
|
|
2284
2281
|
}
|
|
2285
|
-
setActive(panel) {
|
|
2286
|
-
this.component.setActive(panel);
|
|
2287
|
-
}
|
|
2288
2282
|
layout(width, height) {
|
|
2289
2283
|
return this.component.layout(width, height);
|
|
2290
2284
|
}
|
|
@@ -2432,15 +2426,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2432
2426
|
getPanel(id) {
|
|
2433
2427
|
return this.component.getPanel(id);
|
|
2434
2428
|
}
|
|
2435
|
-
toggleVisibility(panel) {
|
|
2436
|
-
this.component.toggleVisibility(panel);
|
|
2437
|
-
}
|
|
2438
|
-
setVisible(panel, visible) {
|
|
2439
|
-
this.component.setVisible(panel, visible);
|
|
2440
|
-
}
|
|
2441
|
-
setActive(panel) {
|
|
2442
|
-
this.component.setActive(panel);
|
|
2443
|
-
}
|
|
2444
2429
|
fromJSON(data) {
|
|
2445
2430
|
return this.component.fromJSON(data);
|
|
2446
2431
|
}
|
|
@@ -2677,7 +2662,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2677
2662
|
MouseEventKind["CLICK"] = "CLICK";
|
|
2678
2663
|
MouseEventKind["CONTEXT_MENU"] = "CONTEXT_MENU";
|
|
2679
2664
|
})(exports.MouseEventKind || (exports.MouseEventKind = {}));
|
|
2680
|
-
class Tab
|
|
2665
|
+
class Tab extends CompositeDisposable {
|
|
2681
2666
|
constructor(panelId, accessor, group) {
|
|
2682
2667
|
super();
|
|
2683
2668
|
this.panelId = panelId;
|
|
@@ -2906,7 +2891,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2906
2891
|
if (this.tabs.find((tab) => tab.value.panelId === panel.id)) {
|
|
2907
2892
|
return;
|
|
2908
2893
|
}
|
|
2909
|
-
const tabToAdd = new Tab
|
|
2894
|
+
const tabToAdd = new Tab(panel.id, this.accessor, this.group);
|
|
2910
2895
|
if (!((_a = panel.view) === null || _a === void 0 ? void 0 : _a.tab)) {
|
|
2911
2896
|
throw new Error('invalid header component');
|
|
2912
2897
|
}
|
|
@@ -3577,10 +3562,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3577
3562
|
this._isVisible = true;
|
|
3578
3563
|
this._width = 0;
|
|
3579
3564
|
this._height = 0;
|
|
3580
|
-
this.
|
|
3565
|
+
this._onDidDimensionChange = new Emitter({
|
|
3581
3566
|
replay: true,
|
|
3582
3567
|
});
|
|
3583
|
-
this.onDidDimensionsChange = this.
|
|
3568
|
+
this.onDidDimensionsChange = this._onDidDimensionChange.event;
|
|
3584
3569
|
//
|
|
3585
3570
|
this._onDidChangeFocus = new Emitter({
|
|
3586
3571
|
replay: true,
|
|
@@ -3605,7 +3590,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3605
3590
|
//
|
|
3606
3591
|
this._onActiveChange = new Emitter();
|
|
3607
3592
|
this.onActiveChange = this._onActiveChange.event;
|
|
3608
|
-
this.addDisposables(this.
|
|
3593
|
+
this.addDisposables(this._onDidDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onFocusEvent, this._onActiveChange, this._onVisibilityChange, this.onDidFocusChange((event) => {
|
|
3609
3594
|
this._isFocused = event.isFocused;
|
|
3610
3595
|
}), this.onDidActiveChange((event) => {
|
|
3611
3596
|
this._isActive = event.isActive;
|
|
@@ -3829,7 +3814,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3829
3814
|
layout(width, height) {
|
|
3830
3815
|
var _a;
|
|
3831
3816
|
// the obtain the correct dimensions of the content panel we must deduct the tab height
|
|
3832
|
-
this.api.
|
|
3817
|
+
this.api._onDidDimensionChange.fire({
|
|
3833
3818
|
width,
|
|
3834
3819
|
height: height - (this.group.model.header.height || 0),
|
|
3835
3820
|
});
|
|
@@ -3979,53 +3964,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3979
3964
|
return new Component(id, componentName);
|
|
3980
3965
|
}
|
|
3981
3966
|
|
|
3982
|
-
class WrappedTab {
|
|
3983
|
-
constructor(renderer) {
|
|
3984
|
-
this.renderer = renderer;
|
|
3985
|
-
this._element = document.createElement('element');
|
|
3986
|
-
this.show();
|
|
3987
|
-
}
|
|
3988
|
-
get innerRenderer() {
|
|
3989
|
-
return this.renderer;
|
|
3990
|
-
}
|
|
3991
|
-
get element() {
|
|
3992
|
-
return this._element;
|
|
3993
|
-
}
|
|
3994
|
-
get id() {
|
|
3995
|
-
return this.renderer.id;
|
|
3996
|
-
}
|
|
3997
|
-
show() {
|
|
3998
|
-
if (!this.renderer.element.parentElement) {
|
|
3999
|
-
this._element.appendChild(this.renderer.element);
|
|
4000
|
-
}
|
|
4001
|
-
}
|
|
4002
|
-
hide() {
|
|
4003
|
-
if (this.renderer.element.parentElement) {
|
|
4004
|
-
this.renderer.element.remove();
|
|
4005
|
-
}
|
|
4006
|
-
}
|
|
4007
|
-
layout(width, height) {
|
|
4008
|
-
this.renderer.layout(width, height);
|
|
4009
|
-
}
|
|
4010
|
-
update(event) {
|
|
4011
|
-
this.renderer.update(event);
|
|
4012
|
-
}
|
|
4013
|
-
toJSON() {
|
|
4014
|
-
return this.renderer.toJSON();
|
|
4015
|
-
}
|
|
4016
|
-
focus() {
|
|
4017
|
-
this.renderer.focus();
|
|
4018
|
-
}
|
|
4019
|
-
init(parameters) {
|
|
4020
|
-
this.renderer.init(parameters);
|
|
4021
|
-
}
|
|
4022
|
-
updateParentGroup(group, isPanelVisible) {
|
|
4023
|
-
this.renderer.updateParentGroup(group, isPanelVisible);
|
|
4024
|
-
}
|
|
4025
|
-
dispose() {
|
|
4026
|
-
this.renderer.dispose();
|
|
4027
|
-
}
|
|
4028
|
-
}
|
|
4029
3967
|
class DefaultTab extends CompositeDisposable {
|
|
4030
3968
|
constructor() {
|
|
4031
3969
|
super();
|
|
@@ -4088,15 +4026,21 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4088
4026
|
}
|
|
4089
4027
|
}
|
|
4090
4028
|
updateParentGroup(group, isPanelVisible) {
|
|
4029
|
+
const changed = this._isPanelVisible !== isPanelVisible ||
|
|
4030
|
+
this._isGroupActive !== group.isActive;
|
|
4091
4031
|
this._isPanelVisible = isPanelVisible;
|
|
4092
4032
|
this._isGroupActive = group.isActive;
|
|
4093
|
-
|
|
4033
|
+
if (changed) {
|
|
4034
|
+
this.render();
|
|
4035
|
+
}
|
|
4094
4036
|
}
|
|
4095
4037
|
layout(_width, _height) {
|
|
4096
4038
|
// noop
|
|
4097
4039
|
}
|
|
4098
4040
|
render() {
|
|
4099
|
-
this._content.textContent
|
|
4041
|
+
if (this._content.textContent !== this.params.title) {
|
|
4042
|
+
this._content.textContent = this.params.title;
|
|
4043
|
+
}
|
|
4100
4044
|
}
|
|
4101
4045
|
}
|
|
4102
4046
|
|
|
@@ -4140,7 +4084,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4140
4084
|
layout(width, height) {
|
|
4141
4085
|
this._width = width;
|
|
4142
4086
|
this._height = height;
|
|
4143
|
-
this.api.
|
|
4087
|
+
this.api._onDidDimensionChange.fire({ width, height });
|
|
4144
4088
|
if (this.part) {
|
|
4145
4089
|
if (this._params) {
|
|
4146
4090
|
this.part.update(this._params.params);
|
|
@@ -4189,11 +4133,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4189
4133
|
this.onDidChange = this._onDidChange.event;
|
|
4190
4134
|
this.addDisposables(this._onDidChange, this.api.onVisibilityChange((event) => {
|
|
4191
4135
|
const { isVisible } = event;
|
|
4192
|
-
const {
|
|
4193
|
-
|
|
4136
|
+
const { accessor } = this._params;
|
|
4137
|
+
accessor.setVisible(this, isVisible);
|
|
4194
4138
|
}), this.api.onActiveChange(() => {
|
|
4195
|
-
const {
|
|
4196
|
-
|
|
4139
|
+
const { accessor } = this._params;
|
|
4140
|
+
accessor.setActive(this);
|
|
4197
4141
|
}), this.api.onDidConstraintsChangeInternal((event) => {
|
|
4198
4142
|
if (typeof event.minimumWidth === 'number' ||
|
|
4199
4143
|
typeof event.minimumWidth === 'function') {
|
|
@@ -4372,7 +4316,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4372
4316
|
constructor(renderers) {
|
|
4373
4317
|
var _a;
|
|
4374
4318
|
this._content = renderers.content;
|
|
4375
|
-
this._tab =
|
|
4319
|
+
this._tab = (_a = renderers.tab) !== null && _a !== void 0 ? _a : new DefaultTab();
|
|
4376
4320
|
this._actions =
|
|
4377
4321
|
renderers.actions ||
|
|
4378
4322
|
(this.content.actions
|
|
@@ -4412,9 +4356,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4412
4356
|
toJSON() {
|
|
4413
4357
|
return {
|
|
4414
4358
|
content: this.content.toJSON(),
|
|
4415
|
-
tab: this.tab
|
|
4416
|
-
? undefined
|
|
4417
|
-
: this.tab.toJSON(),
|
|
4359
|
+
tab: this.tab instanceof DefaultTab ? undefined : this.tab.toJSON(),
|
|
4418
4360
|
};
|
|
4419
4361
|
}
|
|
4420
4362
|
dispose() {
|
|
@@ -4802,7 +4744,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4802
4744
|
}
|
|
4803
4745
|
}
|
|
4804
4746
|
const view = new GroupPanel(this, id, options);
|
|
4805
|
-
view.init({ params: {},
|
|
4747
|
+
view.init({ params: {}, accessor: null }); // required to initialized .part and allow for correct disposal of group
|
|
4806
4748
|
if (!this._groups.has(view.id)) {
|
|
4807
4749
|
const disposable = new CompositeDisposable(view.model.onMove((event) => {
|
|
4808
4750
|
const { groupId, itemId, target, index } = event;
|
|
@@ -4941,9 +4883,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4941
4883
|
value.value.setActive(panel === value.value);
|
|
4942
4884
|
});
|
|
4943
4885
|
}
|
|
4944
|
-
toggleVisibility(panel) {
|
|
4945
|
-
this.setVisible(panel, !this.isVisible(panel));
|
|
4946
|
-
}
|
|
4947
4886
|
focus() {
|
|
4948
4887
|
var _a;
|
|
4949
4888
|
(_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.focus();
|
|
@@ -4974,7 +4913,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4974
4913
|
maximumHeight: data.maximumHeight,
|
|
4975
4914
|
priority: data.priority,
|
|
4976
4915
|
snap: !!data.snap,
|
|
4977
|
-
|
|
4916
|
+
accessor: this,
|
|
4978
4917
|
isVisible: node.visible,
|
|
4979
4918
|
}));
|
|
4980
4919
|
this.registerPanel(view);
|
|
@@ -5040,7 +4979,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5040
4979
|
maximumHeight: options.maximumHeight,
|
|
5041
4980
|
priority: options.priority,
|
|
5042
4981
|
snap: !!options.snap,
|
|
5043
|
-
|
|
4982
|
+
accessor: this,
|
|
5044
4983
|
isVisible: true,
|
|
5045
4984
|
});
|
|
5046
4985
|
this.registerPanel(view);
|
|
@@ -5236,7 +5175,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5236
5175
|
maximumSize: options.maximumSize,
|
|
5237
5176
|
snap: options.snap,
|
|
5238
5177
|
priority: options.priority,
|
|
5239
|
-
|
|
5178
|
+
accessor: this,
|
|
5240
5179
|
});
|
|
5241
5180
|
const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
|
|
5242
5181
|
const index = typeof options.index === 'number' ? options.index : undefined;
|
|
@@ -5312,7 +5251,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5312
5251
|
maximumSize: data.maximumSize,
|
|
5313
5252
|
snap: view.snap,
|
|
5314
5253
|
priority: view.priority,
|
|
5315
|
-
|
|
5254
|
+
accessor: this,
|
|
5316
5255
|
});
|
|
5317
5256
|
});
|
|
5318
5257
|
panel.orientation = orientation;
|
|
@@ -5954,13 +5893,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5954
5893
|
this.onDidChange = this._onDidChange.event;
|
|
5955
5894
|
this.addDisposables(this._onDidChange, this.api.onVisibilityChange((event) => {
|
|
5956
5895
|
const { isVisible } = event;
|
|
5957
|
-
const {
|
|
5958
|
-
|
|
5959
|
-
containerApi.setVisible(this, isVisible);
|
|
5896
|
+
const { accessor } = this._params;
|
|
5897
|
+
accessor.setVisible(this, isVisible);
|
|
5960
5898
|
}), this.api.onActiveChange(() => {
|
|
5961
|
-
const {
|
|
5962
|
-
|
|
5963
|
-
containerApi.setActive(this);
|
|
5899
|
+
const { accessor } = this._params;
|
|
5900
|
+
accessor.setActive(this);
|
|
5964
5901
|
}), this.api.onDidConstraintsChangeInternal((event) => {
|
|
5965
5902
|
if (typeof event.minimumSize === 'number' ||
|
|
5966
5903
|
typeof event.minimumSize === 'function') {
|
|
@@ -6212,9 +6149,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6212
6149
|
layout(_width, _height) {
|
|
6213
6150
|
// noop
|
|
6214
6151
|
}
|
|
6215
|
-
close() {
|
|
6216
|
-
return Promise.resolve(true);
|
|
6217
|
-
}
|
|
6218
6152
|
dispose() {
|
|
6219
6153
|
var _a, _b;
|
|
6220
6154
|
this._onDidFocus.dispose();
|
|
@@ -6484,58 +6418,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6484
6418
|
});
|
|
6485
6419
|
DockviewReact.displayName = 'DockviewComponent';
|
|
6486
6420
|
|
|
6487
|
-
const Tab = (props) => {
|
|
6488
|
-
return React__namespace.createElement(React__namespace.Fragment, null, props.children);
|
|
6489
|
-
};
|
|
6490
|
-
const Content = (props) => {
|
|
6491
|
-
return React__namespace.createElement(React__namespace.Fragment, null, props.children);
|
|
6492
|
-
};
|
|
6493
|
-
const Actions = (props) => {
|
|
6494
|
-
return React__namespace.createElement(React__namespace.Fragment, null, props.children);
|
|
6495
|
-
};
|
|
6496
|
-
function isValidComponent(element) {
|
|
6497
|
-
return [Content, Actions, Tab].find((comp) => element.type === comp);
|
|
6498
|
-
}
|
|
6499
|
-
const Panel = (props) => {
|
|
6500
|
-
const context = React__namespace.useContext(ReactPartContext);
|
|
6501
|
-
const sections = React__namespace.useMemo(() => {
|
|
6502
|
-
var _a;
|
|
6503
|
-
const childs = ((_a = React__namespace.Children.map(props.children, (_) => _)) === null || _a === void 0 ? void 0 : _a.filter(isReactElement)) || [];
|
|
6504
|
-
const isInvalid = !!childs.find((_) => !isValidComponent(_));
|
|
6505
|
-
if (isInvalid) {
|
|
6506
|
-
throw new Error('Children of DockviewComponents.Panel must be one of the following: DockviewComponents.Content, DockviewComponents.Actions, DockviewComponents.Tab');
|
|
6507
|
-
}
|
|
6508
|
-
const body = childs.find((_) => _.type === Content);
|
|
6509
|
-
const actions = childs.find((_) => _.type === Actions);
|
|
6510
|
-
const tab = childs.find((_) => _.type === Tab);
|
|
6511
|
-
return { body, actions, tab };
|
|
6512
|
-
}, [props.children]);
|
|
6513
|
-
React__namespace.useEffect(() => {
|
|
6514
|
-
/**
|
|
6515
|
-
* hide or show the default tab behavior based on whether we want to override
|
|
6516
|
-
* with our own React tab.
|
|
6517
|
-
*/
|
|
6518
|
-
if (sections.tab) {
|
|
6519
|
-
context.tabPortalElement.hide();
|
|
6520
|
-
}
|
|
6521
|
-
else {
|
|
6522
|
-
context.tabPortalElement.show();
|
|
6523
|
-
}
|
|
6524
|
-
}, [sections.tab]);
|
|
6525
|
-
return (React__namespace.createElement(React__namespace.Fragment, null,
|
|
6526
|
-
sections.actions &&
|
|
6527
|
-
ReactDOM__namespace.createPortal(sections.actions, context.actionsPortalElement),
|
|
6528
|
-
sections.tab &&
|
|
6529
|
-
ReactDOM__namespace.createPortal(sections.tab, context.tabPortalElement.element),
|
|
6530
|
-
sections.body || props.children));
|
|
6531
|
-
};
|
|
6532
|
-
const DockviewComponents = {
|
|
6533
|
-
Tab,
|
|
6534
|
-
Content,
|
|
6535
|
-
Actions,
|
|
6536
|
-
Panel,
|
|
6537
|
-
};
|
|
6538
|
-
|
|
6539
6421
|
class ReactPanelView extends SplitviewPanel {
|
|
6540
6422
|
constructor(id, component, reactComponent, reactPortalStore) {
|
|
6541
6423
|
super(id, component);
|
|
@@ -6547,8 +6429,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6547
6429
|
return new ReactPart(this.element, this.reactPortalStore, this.reactComponent, {
|
|
6548
6430
|
params: ((_a = this._params) === null || _a === void 0 ? void 0 : _a.params) || {},
|
|
6549
6431
|
api: this.api,
|
|
6550
|
-
containerApi: this._params
|
|
6551
|
-
.containerApi,
|
|
6432
|
+
containerApi: new SplitviewApi(this._params.accessor),
|
|
6552
6433
|
});
|
|
6553
6434
|
}
|
|
6554
6435
|
}
|
|
@@ -6624,8 +6505,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6624
6505
|
return new ReactPart(this.element, this.reactPortalStore, this.reactComponent, {
|
|
6625
6506
|
params: ((_a = this._params) === null || _a === void 0 ? void 0 : _a.params) || {},
|
|
6626
6507
|
api: this.api,
|
|
6627
|
-
containerApi: this._params
|
|
6628
|
-
.containerApi,
|
|
6508
|
+
containerApi: new GridviewApi(this._params.accessor),
|
|
6629
6509
|
});
|
|
6630
6510
|
}
|
|
6631
6511
|
}
|
|
@@ -6819,7 +6699,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6819
6699
|
exports.ContentContainer = ContentContainer;
|
|
6820
6700
|
exports.DockviewApi = DockviewApi;
|
|
6821
6701
|
exports.DockviewComponent = DockviewComponent;
|
|
6822
|
-
exports.DockviewComponents = DockviewComponents;
|
|
6823
6702
|
exports.DockviewReact = DockviewReact;
|
|
6824
6703
|
exports.Gridview = Gridview;
|
|
6825
6704
|
exports.GridviewApi = GridviewApi;
|
|
@@ -6845,7 +6724,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6845
6724
|
exports.SplitviewComponent = SplitviewComponent;
|
|
6846
6725
|
exports.SplitviewPanel = SplitviewPanel;
|
|
6847
6726
|
exports.SplitviewReact = SplitviewReact;
|
|
6848
|
-
exports.Tab = Tab
|
|
6727
|
+
exports.Tab = Tab;
|
|
6849
6728
|
exports.getDirectionOrientation = getDirectionOrientation;
|
|
6850
6729
|
exports.getGridLocation = getGridLocation;
|
|
6851
6730
|
exports.getLocationOrientation = getLocationOrientation;
|