dockview-core 2.1.4 → 3.0.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/dist/cjs/api/component.api.d.ts +4 -3
- package/dist/cjs/api/component.api.js +8 -22
- package/dist/cjs/dockview/components/titlebar/tabsContainer.d.ts +2 -1
- package/dist/cjs/dockview/components/titlebar/tabsContainer.js +30 -33
- package/dist/cjs/dockview/options.d.ts +4 -8
- package/dist/cjs/dockview/options.js +28 -20
- package/dist/cjs/events.d.ts +9 -0
- package/dist/cjs/events.js +18 -1
- package/dist/cjs/gridview/baseComponentGridview.js +1 -2
- package/dist/cjs/gridview/gridviewComponent.js +15 -24
- package/dist/cjs/gridview/options.d.ts +10 -12
- package/dist/cjs/gridview/options.js +15 -0
- package/dist/cjs/index.d.ts +4 -4
- package/dist/cjs/index.js +8 -1
- package/dist/cjs/paneview/defaultPaneviewHeader.d.ts +2 -2
- package/dist/cjs/paneview/draggablePaneviewPanel.d.ts +6 -2
- package/dist/cjs/paneview/draggablePaneviewPanel.js +8 -9
- package/dist/cjs/paneview/options.d.ts +25 -21
- package/dist/cjs/paneview/options.js +42 -0
- package/dist/cjs/paneview/paneviewComponent.d.ts +12 -15
- package/dist/cjs/paneview/paneviewComponent.js +30 -40
- package/dist/cjs/paneview/paneviewPanel.d.ts +3 -8
- package/dist/cjs/splitview/options.d.ts +7 -9
- package/dist/cjs/splitview/options.js +17 -0
- package/dist/cjs/splitview/splitview.d.ts +5 -5
- package/dist/cjs/splitview/splitviewComponent.js +10 -21
- package/dist/dockview-core.amd.js +161 -161
- package/dist/dockview-core.amd.js.map +1 -1
- package/dist/dockview-core.amd.min.js +2 -2
- package/dist/dockview-core.amd.min.js.map +1 -1
- package/dist/dockview-core.amd.min.noStyle.js +2 -2
- package/dist/dockview-core.amd.min.noStyle.js.map +1 -1
- package/dist/dockview-core.amd.noStyle.js +161 -161
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +161 -161
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +157 -161
- package/dist/dockview-core.esm.js.map +1 -1
- package/dist/dockview-core.esm.min.js +2 -2
- package/dist/dockview-core.esm.min.js.map +1 -1
- package/dist/dockview-core.js +161 -161
- package/dist/dockview-core.js.map +1 -1
- package/dist/dockview-core.min.js +2 -2
- package/dist/dockview-core.min.js.map +1 -1
- package/dist/dockview-core.min.noStyle.js +2 -2
- package/dist/dockview-core.min.noStyle.js.map +1 -1
- package/dist/dockview-core.noStyle.js +161 -161
- package/dist/dockview-core.noStyle.js.map +1 -1
- package/dist/esm/api/component.api.d.ts +4 -3
- package/dist/esm/api/component.api.js +4 -10
- package/dist/esm/dockview/components/titlebar/tabsContainer.d.ts +2 -1
- package/dist/esm/dockview/components/titlebar/tabsContainer.js +20 -23
- package/dist/esm/dockview/options.d.ts +4 -8
- package/dist/esm/dockview/options.js +4 -9
- package/dist/esm/events.d.ts +9 -0
- package/dist/esm/events.js +11 -0
- package/dist/esm/gridview/baseComponentGridview.js +1 -2
- package/dist/esm/gridview/gridviewComponent.js +15 -24
- package/dist/esm/gridview/options.d.ts +10 -12
- package/dist/esm/gridview/options.js +14 -1
- package/dist/esm/index.d.ts +4 -4
- package/dist/esm/index.js +3 -0
- package/dist/esm/paneview/defaultPaneviewHeader.d.ts +2 -2
- package/dist/esm/paneview/draggablePaneviewPanel.d.ts +6 -2
- package/dist/esm/paneview/draggablePaneviewPanel.js +8 -9
- package/dist/esm/paneview/options.d.ts +25 -21
- package/dist/esm/paneview/options.js +22 -1
- package/dist/esm/paneview/paneviewComponent.d.ts +12 -15
- package/dist/esm/paneview/paneviewComponent.js +30 -40
- package/dist/esm/paneview/paneviewPanel.d.ts +3 -8
- package/dist/esm/splitview/options.d.ts +7 -9
- package/dist/esm/splitview/options.js +16 -1
- package/dist/esm/splitview/splitview.d.ts +5 -5
- package/dist/esm/splitview/splitviewComponent.js +10 -21
- package/package.json +1 -1
- package/dist/cjs/panel/componentFactory.d.ts +0 -11
- package/dist/cjs/panel/componentFactory.js +0 -30
- package/dist/esm/panel/componentFactory.d.ts +0 -11
- package/dist/esm/panel/componentFactory.js +0 -24
package/dist/dockview-core.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-core
|
|
3
|
-
* @version
|
|
3
|
+
* @version 3.0.1
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -133,6 +133,17 @@
|
|
|
133
133
|
this._defaultPrevented = true;
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
|
+
class AcceptableEvent {
|
|
137
|
+
constructor() {
|
|
138
|
+
this._isAccepted = false;
|
|
139
|
+
}
|
|
140
|
+
get isAccepted() {
|
|
141
|
+
return this._isAccepted;
|
|
142
|
+
}
|
|
143
|
+
accept() {
|
|
144
|
+
this._isAccepted = true;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
136
147
|
class LeakageMonitor {
|
|
137
148
|
constructor() {
|
|
138
149
|
this.events = new Map();
|
|
@@ -1524,6 +1535,23 @@
|
|
|
1524
1535
|
}
|
|
1525
1536
|
}
|
|
1526
1537
|
|
|
1538
|
+
const PROPERTY_KEYS_SPLITVIEW = (() => {
|
|
1539
|
+
/**
|
|
1540
|
+
* by readong the keys from an empty value object TypeScript will error
|
|
1541
|
+
* when we add or remove new properties to `DockviewOptions`
|
|
1542
|
+
*/
|
|
1543
|
+
const properties = {
|
|
1544
|
+
orientation: undefined,
|
|
1545
|
+
descriptor: undefined,
|
|
1546
|
+
proportionalLayout: undefined,
|
|
1547
|
+
styles: undefined,
|
|
1548
|
+
margin: undefined,
|
|
1549
|
+
disableAutoResizing: undefined,
|
|
1550
|
+
className: undefined,
|
|
1551
|
+
};
|
|
1552
|
+
return Object.keys(properties);
|
|
1553
|
+
})();
|
|
1554
|
+
|
|
1527
1555
|
class Paneview extends CompositeDisposable {
|
|
1528
1556
|
get onDidAddView() {
|
|
1529
1557
|
return this.splitview.onDidAddView;
|
|
@@ -2653,6 +2681,21 @@
|
|
|
2653
2681
|
}
|
|
2654
2682
|
}
|
|
2655
2683
|
|
|
2684
|
+
const PROPERTY_KEYS_GRIDVIEW = (() => {
|
|
2685
|
+
/**
|
|
2686
|
+
* by readong the keys from an empty value object TypeScript will error
|
|
2687
|
+
* when we add or remove new properties to `DockviewOptions`
|
|
2688
|
+
*/
|
|
2689
|
+
const properties = {
|
|
2690
|
+
disableAutoResizing: undefined,
|
|
2691
|
+
proportionalLayout: undefined,
|
|
2692
|
+
orientation: undefined,
|
|
2693
|
+
hideBorders: undefined,
|
|
2694
|
+
className: undefined,
|
|
2695
|
+
};
|
|
2696
|
+
return Object.keys(properties);
|
|
2697
|
+
})();
|
|
2698
|
+
|
|
2656
2699
|
class Resizable extends CompositeDisposable {
|
|
2657
2700
|
get element() {
|
|
2658
2701
|
return this._element;
|
|
@@ -2762,7 +2805,7 @@
|
|
|
2762
2805
|
}
|
|
2763
2806
|
constructor(parentElement, options) {
|
|
2764
2807
|
var _a;
|
|
2765
|
-
super(
|
|
2808
|
+
super(parentElement, options.disableAutoResizing);
|
|
2766
2809
|
this._id = nextLayoutId$1.next();
|
|
2767
2810
|
this._groups = new Map();
|
|
2768
2811
|
this._onDidRemove = new Emitter();
|
|
@@ -2781,7 +2824,6 @@
|
|
|
2781
2824
|
this.element.style.width = '100%';
|
|
2782
2825
|
this._classNames = new Classnames(this.element);
|
|
2783
2826
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
2784
|
-
parentElement.appendChild(this.element);
|
|
2785
2827
|
this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation, options.locked, options.margin);
|
|
2786
2828
|
this.gridview.locked = !!options.locked;
|
|
2787
2829
|
this.element.appendChild(this.gridview.element);
|
|
@@ -3130,15 +3172,10 @@
|
|
|
3130
3172
|
* Invoked when a Drag'n'Drop event occurs that the component was unable to handle. Exposed for custom Drag'n'Drop functionality.
|
|
3131
3173
|
*/
|
|
3132
3174
|
get onDidDrop() {
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
emitter.dispose = () => {
|
|
3138
|
-
disposable.dispose();
|
|
3139
|
-
emitter.dispose();
|
|
3140
|
-
};
|
|
3141
|
-
return emitter.event;
|
|
3175
|
+
return this.component.onDidDrop;
|
|
3176
|
+
}
|
|
3177
|
+
get onUnhandledDragOverEvent() {
|
|
3178
|
+
return this.component.onUnhandledDragOverEvent;
|
|
3142
3179
|
}
|
|
3143
3180
|
constructor(component) {
|
|
3144
3181
|
this.component = component;
|
|
@@ -4065,6 +4102,28 @@
|
|
|
4065
4102
|
return 'center';
|
|
4066
4103
|
}
|
|
4067
4104
|
|
|
4105
|
+
const PROPERTY_KEYS_PANEVIEW = (() => {
|
|
4106
|
+
/**
|
|
4107
|
+
* by readong the keys from an empty value object TypeScript will error
|
|
4108
|
+
* when we add or remove new properties to `DockviewOptions`
|
|
4109
|
+
*/
|
|
4110
|
+
const properties = {
|
|
4111
|
+
disableAutoResizing: undefined,
|
|
4112
|
+
disableDnd: undefined,
|
|
4113
|
+
className: undefined,
|
|
4114
|
+
};
|
|
4115
|
+
return Object.keys(properties);
|
|
4116
|
+
})();
|
|
4117
|
+
class PaneviewUnhandledDragOverEvent extends AcceptableEvent {
|
|
4118
|
+
constructor(nativeEvent, position, getData, panel) {
|
|
4119
|
+
super();
|
|
4120
|
+
this.nativeEvent = nativeEvent;
|
|
4121
|
+
this.position = position;
|
|
4122
|
+
this.getData = getData;
|
|
4123
|
+
this.panel = panel;
|
|
4124
|
+
}
|
|
4125
|
+
}
|
|
4126
|
+
|
|
4068
4127
|
class WillFocusEvent extends DockviewEvent {
|
|
4069
4128
|
constructor() {
|
|
4070
4129
|
super();
|
|
@@ -4488,6 +4547,9 @@
|
|
|
4488
4547
|
this.accessor = accessor;
|
|
4489
4548
|
this._onDidDrop = new Emitter();
|
|
4490
4549
|
this.onDidDrop = this._onDidDrop.event;
|
|
4550
|
+
this._onUnhandledDragOverEvent = new Emitter();
|
|
4551
|
+
this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
|
|
4552
|
+
this.addDisposables(this._onDidDrop, this._onUnhandledDragOverEvent);
|
|
4491
4553
|
if (!disableDnd) {
|
|
4492
4554
|
this.initDragFeatures();
|
|
4493
4555
|
}
|
|
@@ -4514,7 +4576,7 @@
|
|
|
4514
4576
|
overlayModel: {
|
|
4515
4577
|
activationSize: { type: 'percentage', value: 50 },
|
|
4516
4578
|
},
|
|
4517
|
-
canDisplayOverlay: (event) => {
|
|
4579
|
+
canDisplayOverlay: (event, position) => {
|
|
4518
4580
|
const data = getPaneData();
|
|
4519
4581
|
if (data) {
|
|
4520
4582
|
if (data.paneId !== this.id &&
|
|
@@ -4522,14 +4584,9 @@
|
|
|
4522
4584
|
return true;
|
|
4523
4585
|
}
|
|
4524
4586
|
}
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
getData: getPaneData,
|
|
4529
|
-
panel: this,
|
|
4530
|
-
});
|
|
4531
|
-
}
|
|
4532
|
-
return false;
|
|
4587
|
+
const firedEvent = new PaneviewUnhandledDragOverEvent(event, position, getPaneData, this);
|
|
4588
|
+
this._onUnhandledDragOverEvent.fire(firedEvent);
|
|
4589
|
+
return firedEvent.isAccepted;
|
|
4533
4590
|
},
|
|
4534
4591
|
});
|
|
4535
4592
|
this.addDisposables(this._onDidDrop, this.handler, this.target, this.target.onDrop((event) => {
|
|
@@ -4984,15 +5041,7 @@
|
|
|
4984
5041
|
this._element.appendChild(this.leftActionsContainer);
|
|
4985
5042
|
this._element.appendChild(this.voidContainer.element);
|
|
4986
5043
|
this._element.appendChild(this.rightActionsContainer);
|
|
4987
|
-
this.addDisposables(this.
|
|
4988
|
-
if (e.api.group === this.group) {
|
|
4989
|
-
toggleClass(this._element, 'dv-single-tab', this.size === 1);
|
|
4990
|
-
}
|
|
4991
|
-
}), this.accessor.onDidRemovePanel((e) => {
|
|
4992
|
-
if (e.api.group === this.group) {
|
|
4993
|
-
toggleClass(this._element, 'dv-single-tab', this.size === 1);
|
|
4994
|
-
}
|
|
4995
|
-
}), this._onWillShowOverlay, this._onDrop, this._onTabDragStart, this._onGroupDragStart, this.voidContainer, this.voidContainer.onDragStart((event) => {
|
|
5044
|
+
this.addDisposables(this._onWillShowOverlay, this._onDrop, this._onTabDragStart, this._onGroupDragStart, this.voidContainer, this.voidContainer.onDragStart((event) => {
|
|
4996
5045
|
this._onGroupDragStart.fire({
|
|
4997
5046
|
nativeEvent: event,
|
|
4998
5047
|
group: this.group,
|
|
@@ -5037,20 +5086,6 @@
|
|
|
5037
5086
|
setActive(_isGroupActive) {
|
|
5038
5087
|
// noop
|
|
5039
5088
|
}
|
|
5040
|
-
addTab(tab, index = this.tabs.length) {
|
|
5041
|
-
if (index < 0 || index > this.tabs.length) {
|
|
5042
|
-
throw new Error('invalid location');
|
|
5043
|
-
}
|
|
5044
|
-
this.tabContainer.insertBefore(tab.value.element, this.tabContainer.children[index]);
|
|
5045
|
-
this.tabs = [
|
|
5046
|
-
...this.tabs.slice(0, index),
|
|
5047
|
-
tab,
|
|
5048
|
-
...this.tabs.slice(index),
|
|
5049
|
-
];
|
|
5050
|
-
if (this.selectedIndex < 0) {
|
|
5051
|
-
this.selectedIndex = index;
|
|
5052
|
-
}
|
|
5053
|
-
}
|
|
5054
5089
|
delete(id) {
|
|
5055
5090
|
const index = this.tabs.findIndex((tab) => tab.value.panel.id === id);
|
|
5056
5091
|
const tabToRemove = this.tabs.splice(index, 1)[0];
|
|
@@ -5058,6 +5093,7 @@
|
|
|
5058
5093
|
disposable.dispose();
|
|
5059
5094
|
value.dispose();
|
|
5060
5095
|
value.element.remove();
|
|
5096
|
+
this.updateClassnames();
|
|
5061
5097
|
}
|
|
5062
5098
|
setActivePanel(panel) {
|
|
5063
5099
|
this.tabs.forEach((tab) => {
|
|
@@ -5126,25 +5162,37 @@
|
|
|
5126
5162
|
}
|
|
5127
5163
|
this.tabs = [];
|
|
5128
5164
|
}
|
|
5165
|
+
addTab(tab, index = this.tabs.length) {
|
|
5166
|
+
if (index < 0 || index > this.tabs.length) {
|
|
5167
|
+
throw new Error('invalid location');
|
|
5168
|
+
}
|
|
5169
|
+
this.tabContainer.insertBefore(tab.value.element, this.tabContainer.children[index]);
|
|
5170
|
+
this.tabs = [
|
|
5171
|
+
...this.tabs.slice(0, index),
|
|
5172
|
+
tab,
|
|
5173
|
+
...this.tabs.slice(index),
|
|
5174
|
+
];
|
|
5175
|
+
if (this.selectedIndex < 0) {
|
|
5176
|
+
this.selectedIndex = index;
|
|
5177
|
+
}
|
|
5178
|
+
this.updateClassnames();
|
|
5179
|
+
}
|
|
5180
|
+
updateClassnames() {
|
|
5181
|
+
toggleClass(this._element, 'dv-single-tab', this.size === 1);
|
|
5182
|
+
}
|
|
5129
5183
|
}
|
|
5130
5184
|
|
|
5131
|
-
class DockviewUnhandledDragOverEvent {
|
|
5132
|
-
get isAccepted() {
|
|
5133
|
-
return this._isAccepted;
|
|
5134
|
-
}
|
|
5185
|
+
class DockviewUnhandledDragOverEvent extends AcceptableEvent {
|
|
5135
5186
|
constructor(nativeEvent, target, position, getData, group) {
|
|
5187
|
+
super();
|
|
5136
5188
|
this.nativeEvent = nativeEvent;
|
|
5137
5189
|
this.target = target;
|
|
5138
5190
|
this.position = position;
|
|
5139
5191
|
this.getData = getData;
|
|
5140
5192
|
this.group = group;
|
|
5141
|
-
this._isAccepted = false;
|
|
5142
|
-
}
|
|
5143
|
-
accept() {
|
|
5144
|
-
this._isAccepted = true;
|
|
5145
5193
|
}
|
|
5146
5194
|
}
|
|
5147
|
-
const
|
|
5195
|
+
const PROPERTY_KEYS_DOCKVIEW = (() => {
|
|
5148
5196
|
/**
|
|
5149
5197
|
* by readong the keys from an empty value object TypeScript will error
|
|
5150
5198
|
* when we add or remove new properties to `DockviewOptions`
|
|
@@ -9013,31 +9061,6 @@
|
|
|
9013
9061
|
}
|
|
9014
9062
|
}
|
|
9015
9063
|
|
|
9016
|
-
function createComponent(id, componentName, components = {}, frameworkComponents = {}, createFrameworkComponent, fallback) {
|
|
9017
|
-
const Component = typeof componentName === 'string'
|
|
9018
|
-
? components[componentName]
|
|
9019
|
-
: undefined;
|
|
9020
|
-
const FrameworkComponent = typeof componentName === 'string'
|
|
9021
|
-
? frameworkComponents[componentName]
|
|
9022
|
-
: undefined;
|
|
9023
|
-
if (Component && FrameworkComponent) {
|
|
9024
|
-
throw new Error(`Cannot create '${id}'. component '${componentName}' registered as both a component and frameworkComponent`);
|
|
9025
|
-
}
|
|
9026
|
-
if (FrameworkComponent) {
|
|
9027
|
-
if (!createFrameworkComponent) {
|
|
9028
|
-
throw new Error(`Cannot create '${id}' for framework component '${componentName}'. you must register a frameworkPanelWrapper to use framework components`);
|
|
9029
|
-
}
|
|
9030
|
-
return createFrameworkComponent.createComponent(id, componentName, FrameworkComponent);
|
|
9031
|
-
}
|
|
9032
|
-
if (!Component) {
|
|
9033
|
-
if (fallback) {
|
|
9034
|
-
return fallback();
|
|
9035
|
-
}
|
|
9036
|
-
throw new Error(`Cannot create '${id}', no component '${componentName}' provided`);
|
|
9037
|
-
}
|
|
9038
|
-
return new Component(id, componentName);
|
|
9039
|
-
}
|
|
9040
|
-
|
|
9041
9064
|
class GridviewComponent extends BaseGrid {
|
|
9042
9065
|
get orientation() {
|
|
9043
9066
|
return this.gridview.orientation;
|
|
@@ -9055,10 +9078,13 @@
|
|
|
9055
9078
|
this._deserializer = value;
|
|
9056
9079
|
}
|
|
9057
9080
|
constructor(parentElement, options) {
|
|
9081
|
+
var _a;
|
|
9058
9082
|
super(parentElement, {
|
|
9059
|
-
proportionalLayout: options.proportionalLayout,
|
|
9083
|
+
proportionalLayout: (_a = options.proportionalLayout) !== null && _a !== void 0 ? _a : true,
|
|
9060
9084
|
orientation: options.orientation,
|
|
9061
|
-
styles: options.
|
|
9085
|
+
styles: options.hideBorders
|
|
9086
|
+
? { separatorBorder: 'transparent' }
|
|
9087
|
+
: undefined,
|
|
9062
9088
|
disableAutoResizing: options.disableAutoResizing,
|
|
9063
9089
|
className: options.className,
|
|
9064
9090
|
});
|
|
@@ -9078,12 +9104,6 @@
|
|
|
9078
9104
|
}), this.onDidActiveChange((event) => {
|
|
9079
9105
|
this._onDidActiveGroupChange.fire(event);
|
|
9080
9106
|
}));
|
|
9081
|
-
if (!this.options.components) {
|
|
9082
|
-
this.options.components = {};
|
|
9083
|
-
}
|
|
9084
|
-
if (!this.options.frameworkComponents) {
|
|
9085
|
-
this.options.frameworkComponents = {};
|
|
9086
|
-
}
|
|
9087
9107
|
}
|
|
9088
9108
|
updateOptions(options) {
|
|
9089
9109
|
super.updateOptions(options);
|
|
@@ -9133,14 +9153,11 @@
|
|
|
9133
9153
|
const height = this.height;
|
|
9134
9154
|
this.gridview.deserialize(grid, {
|
|
9135
9155
|
fromJSON: (node) => {
|
|
9136
|
-
var _a, _b;
|
|
9137
9156
|
const { data } = node;
|
|
9138
|
-
const view =
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
}
|
|
9143
|
-
: undefined);
|
|
9157
|
+
const view = this.options.createComponent({
|
|
9158
|
+
id: data.id,
|
|
9159
|
+
name: data.component,
|
|
9160
|
+
});
|
|
9144
9161
|
queue.push(() => view.init({
|
|
9145
9162
|
params: data.params,
|
|
9146
9163
|
minimumWidth: data.minimumWidth,
|
|
@@ -9218,7 +9235,7 @@
|
|
|
9218
9235
|
this.doAddGroup(removedPanel, relativeLocation, options.size);
|
|
9219
9236
|
}
|
|
9220
9237
|
addPanel(options) {
|
|
9221
|
-
var _a, _b, _c, _d
|
|
9238
|
+
var _a, _b, _c, _d;
|
|
9222
9239
|
let relativeLocation = (_a = options.location) !== null && _a !== void 0 ? _a : [0];
|
|
9223
9240
|
if ((_b = options.position) === null || _b === void 0 ? void 0 : _b.referencePanel) {
|
|
9224
9241
|
const referenceGroup = (_c = this._groups.get(options.position.referencePanel)) === null || _c === void 0 ? void 0 : _c.value;
|
|
@@ -9234,14 +9251,12 @@
|
|
|
9234
9251
|
relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
|
|
9235
9252
|
}
|
|
9236
9253
|
}
|
|
9237
|
-
const view =
|
|
9238
|
-
|
|
9239
|
-
|
|
9240
|
-
|
|
9241
|
-
}
|
|
9242
|
-
: undefined);
|
|
9254
|
+
const view = this.options.createComponent({
|
|
9255
|
+
id: options.id,
|
|
9256
|
+
name: options.component,
|
|
9257
|
+
});
|
|
9243
9258
|
view.init({
|
|
9244
|
-
params: (
|
|
9259
|
+
params: (_d = options.params) !== null && _d !== void 0 ? _d : {},
|
|
9245
9260
|
minimumWidth: options.minimumWidth,
|
|
9246
9261
|
maximumWidth: options.maximumWidth,
|
|
9247
9262
|
minimumHeight: options.minimumHeight,
|
|
@@ -9369,12 +9384,6 @@
|
|
|
9369
9384
|
this._classNames = new Classnames(this.element);
|
|
9370
9385
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9371
9386
|
this._options = options;
|
|
9372
|
-
if (!options.components) {
|
|
9373
|
-
options.components = {};
|
|
9374
|
-
}
|
|
9375
|
-
if (!options.frameworkComponents) {
|
|
9376
|
-
options.frameworkComponents = {};
|
|
9377
|
-
}
|
|
9378
9387
|
this.splitview = new Splitview(this.element, options);
|
|
9379
9388
|
this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
|
|
9380
9389
|
}
|
|
@@ -9437,18 +9446,17 @@
|
|
|
9437
9446
|
return this.panels.find((view) => view.id === id);
|
|
9438
9447
|
}
|
|
9439
9448
|
addPanel(options) {
|
|
9440
|
-
var _a
|
|
9449
|
+
var _a;
|
|
9441
9450
|
if (this._panels.has(options.id)) {
|
|
9442
9451
|
throw new Error(`panel ${options.id} already exists`);
|
|
9443
9452
|
}
|
|
9444
|
-
const view =
|
|
9445
|
-
|
|
9446
|
-
|
|
9447
|
-
|
|
9448
|
-
: undefined);
|
|
9453
|
+
const view = this.options.createComponent({
|
|
9454
|
+
id: options.id,
|
|
9455
|
+
name: options.component,
|
|
9456
|
+
});
|
|
9449
9457
|
view.orientation = this.splitview.orientation;
|
|
9450
9458
|
view.init({
|
|
9451
|
-
params: (
|
|
9459
|
+
params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
|
|
9452
9460
|
minimumSize: options.minimumSize,
|
|
9453
9461
|
maximumSize: options.maximumSize,
|
|
9454
9462
|
snap: options.snap,
|
|
@@ -9510,17 +9518,14 @@
|
|
|
9510
9518
|
descriptor: {
|
|
9511
9519
|
size,
|
|
9512
9520
|
views: views.map((view) => {
|
|
9513
|
-
var _a, _b;
|
|
9514
9521
|
const data = view.data;
|
|
9515
9522
|
if (this._panels.has(data.id)) {
|
|
9516
9523
|
throw new Error(`panel ${data.id} already exists`);
|
|
9517
9524
|
}
|
|
9518
|
-
const panel =
|
|
9519
|
-
|
|
9520
|
-
|
|
9521
|
-
|
|
9522
|
-
}
|
|
9523
|
-
: undefined);
|
|
9525
|
+
const panel = this.options.createComponent({
|
|
9526
|
+
id: data.id,
|
|
9527
|
+
name: data.component,
|
|
9528
|
+
});
|
|
9524
9529
|
queue.push(() => {
|
|
9525
9530
|
var _a;
|
|
9526
9531
|
panel.init({
|
|
@@ -9703,16 +9708,12 @@
|
|
|
9703
9708
|
this.onDidAddView = this._onDidAddView.event;
|
|
9704
9709
|
this._onDidRemoveView = new Emitter();
|
|
9705
9710
|
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
9706
|
-
this.
|
|
9711
|
+
this._onUnhandledDragOverEvent = new Emitter();
|
|
9712
|
+
this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
|
|
9713
|
+
this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView, this._onUnhandledDragOverEvent);
|
|
9707
9714
|
this._classNames = new Classnames(this.element);
|
|
9708
9715
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9709
9716
|
this._options = options;
|
|
9710
|
-
if (!options.components) {
|
|
9711
|
-
options.components = {};
|
|
9712
|
-
}
|
|
9713
|
-
if (!options.frameworkComponents) {
|
|
9714
|
-
options.frameworkComponents = {};
|
|
9715
|
-
}
|
|
9716
9717
|
this.paneview = new Paneview(this.element, {
|
|
9717
9718
|
// only allow paneview in the vertical orientation for now
|
|
9718
9719
|
orientation: exports.Orientation.VERTICAL,
|
|
@@ -9737,22 +9738,19 @@
|
|
|
9737
9738
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
9738
9739
|
}
|
|
9739
9740
|
addPanel(options) {
|
|
9740
|
-
var _a
|
|
9741
|
-
const body =
|
|
9742
|
-
|
|
9743
|
-
|
|
9744
|
-
|
|
9745
|
-
: undefined);
|
|
9741
|
+
var _a;
|
|
9742
|
+
const body = this.options.createComponent({
|
|
9743
|
+
id: options.id,
|
|
9744
|
+
name: options.component,
|
|
9745
|
+
});
|
|
9746
9746
|
let header;
|
|
9747
|
-
if (options.headerComponent) {
|
|
9748
|
-
header =
|
|
9749
|
-
|
|
9750
|
-
|
|
9751
|
-
|
|
9752
|
-
}
|
|
9753
|
-
: undefined);
|
|
9747
|
+
if (options.headerComponent && this.options.createHeaderComponent) {
|
|
9748
|
+
header = this.options.createHeaderComponent({
|
|
9749
|
+
id: options.id,
|
|
9750
|
+
name: options.headerComponent,
|
|
9751
|
+
});
|
|
9754
9752
|
}
|
|
9755
|
-
|
|
9753
|
+
if (!header) {
|
|
9756
9754
|
header = new DefaultHeader();
|
|
9757
9755
|
}
|
|
9758
9756
|
const view = new PaneFramework({
|
|
@@ -9770,7 +9768,7 @@
|
|
|
9770
9768
|
const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
|
|
9771
9769
|
const index = typeof options.index === 'number' ? options.index : undefined;
|
|
9772
9770
|
view.init({
|
|
9773
|
-
params: (
|
|
9771
|
+
params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
|
|
9774
9772
|
minimumBodySize: options.minimumBodySize,
|
|
9775
9773
|
maximumBodySize: options.maximumBodySize,
|
|
9776
9774
|
isExpanded: options.isExpanded,
|
|
@@ -9835,24 +9833,20 @@
|
|
|
9835
9833
|
descriptor: {
|
|
9836
9834
|
size,
|
|
9837
9835
|
views: views.map((view) => {
|
|
9838
|
-
var _a, _b, _c, _d;
|
|
9839
9836
|
const data = view.data;
|
|
9840
|
-
const body =
|
|
9841
|
-
|
|
9842
|
-
|
|
9843
|
-
|
|
9844
|
-
}
|
|
9845
|
-
: undefined);
|
|
9837
|
+
const body = this.options.createComponent({
|
|
9838
|
+
id: data.id,
|
|
9839
|
+
name: data.component,
|
|
9840
|
+
});
|
|
9846
9841
|
let header;
|
|
9847
|
-
if (data.headerComponent
|
|
9848
|
-
|
|
9849
|
-
|
|
9850
|
-
|
|
9851
|
-
|
|
9852
|
-
|
|
9853
|
-
: undefined);
|
|
9842
|
+
if (data.headerComponent &&
|
|
9843
|
+
this.options.createHeaderComponent) {
|
|
9844
|
+
header = this.options.createHeaderComponent({
|
|
9845
|
+
id: data.id,
|
|
9846
|
+
name: data.headerComponent,
|
|
9847
|
+
});
|
|
9854
9848
|
}
|
|
9855
|
-
|
|
9849
|
+
if (!header) {
|
|
9856
9850
|
header = new DefaultHeader();
|
|
9857
9851
|
}
|
|
9858
9852
|
const panel = new PaneFramework({
|
|
@@ -9900,9 +9894,11 @@
|
|
|
9900
9894
|
this.paneview.dispose();
|
|
9901
9895
|
}
|
|
9902
9896
|
doAddPanel(panel) {
|
|
9903
|
-
const disposable = panel.onDidDrop((event) => {
|
|
9897
|
+
const disposable = new CompositeDisposable(panel.onDidDrop((event) => {
|
|
9904
9898
|
this._onDidDrop.fire(event);
|
|
9905
|
-
})
|
|
9899
|
+
}), panel.onUnhandledDragOverEvent((event) => {
|
|
9900
|
+
this._onUnhandledDragOverEvent.fire(event);
|
|
9901
|
+
}));
|
|
9906
9902
|
this._viewDisposables.set(panel.id, disposable);
|
|
9907
9903
|
}
|
|
9908
9904
|
doRemovePanel(panel) {
|
|
@@ -10064,7 +10060,10 @@
|
|
|
10064
10060
|
exports.GridviewApi = GridviewApi;
|
|
10065
10061
|
exports.GridviewComponent = GridviewComponent;
|
|
10066
10062
|
exports.GridviewPanel = GridviewPanel;
|
|
10067
|
-
exports.
|
|
10063
|
+
exports.PROPERTY_KEYS_DOCKVIEW = PROPERTY_KEYS_DOCKVIEW;
|
|
10064
|
+
exports.PROPERTY_KEYS_GRIDVIEW = PROPERTY_KEYS_GRIDVIEW;
|
|
10065
|
+
exports.PROPERTY_KEYS_PANEVIEW = PROPERTY_KEYS_PANEVIEW;
|
|
10066
|
+
exports.PROPERTY_KEYS_SPLITVIEW = PROPERTY_KEYS_SPLITVIEW;
|
|
10068
10067
|
exports.PaneFramework = PaneFramework;
|
|
10069
10068
|
exports.PaneTransfer = PaneTransfer;
|
|
10070
10069
|
exports.PanelTransfer = PanelTransfer;
|
|
@@ -10072,6 +10071,7 @@
|
|
|
10072
10071
|
exports.PaneviewApi = PaneviewApi;
|
|
10073
10072
|
exports.PaneviewComponent = PaneviewComponent;
|
|
10074
10073
|
exports.PaneviewPanel = PaneviewPanel;
|
|
10074
|
+
exports.PaneviewUnhandledDragOverEvent = PaneviewUnhandledDragOverEvent;
|
|
10075
10075
|
exports.Splitview = Splitview;
|
|
10076
10076
|
exports.SplitviewApi = SplitviewApi;
|
|
10077
10077
|
exports.SplitviewComponent = SplitviewComponent;
|