dockview-core 2.1.4 → 3.0.0
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/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 +160 -159
- 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 +160 -159
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +160 -159
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +156 -159
- 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 +160 -159
- 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 +160 -159
- 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/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.0
|
|
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;
|
|
@@ -3130,15 +3173,10 @@
|
|
|
3130
3173
|
* Invoked when a Drag'n'Drop event occurs that the component was unable to handle. Exposed for custom Drag'n'Drop functionality.
|
|
3131
3174
|
*/
|
|
3132
3175
|
get onDidDrop() {
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
emitter.dispose = () => {
|
|
3138
|
-
disposable.dispose();
|
|
3139
|
-
emitter.dispose();
|
|
3140
|
-
};
|
|
3141
|
-
return emitter.event;
|
|
3176
|
+
return this.component.onDidDrop;
|
|
3177
|
+
}
|
|
3178
|
+
get onUnhandledDragOverEvent() {
|
|
3179
|
+
return this.component.onUnhandledDragOverEvent;
|
|
3142
3180
|
}
|
|
3143
3181
|
constructor(component) {
|
|
3144
3182
|
this.component = component;
|
|
@@ -4065,6 +4103,28 @@
|
|
|
4065
4103
|
return 'center';
|
|
4066
4104
|
}
|
|
4067
4105
|
|
|
4106
|
+
const PROPERTY_KEYS_PANEVIEW = (() => {
|
|
4107
|
+
/**
|
|
4108
|
+
* by readong the keys from an empty value object TypeScript will error
|
|
4109
|
+
* when we add or remove new properties to `DockviewOptions`
|
|
4110
|
+
*/
|
|
4111
|
+
const properties = {
|
|
4112
|
+
disableAutoResizing: undefined,
|
|
4113
|
+
disableDnd: undefined,
|
|
4114
|
+
className: undefined,
|
|
4115
|
+
};
|
|
4116
|
+
return Object.keys(properties);
|
|
4117
|
+
})();
|
|
4118
|
+
class PaneviewUnhandledDragOverEvent extends AcceptableEvent {
|
|
4119
|
+
constructor(nativeEvent, position, getData, panel) {
|
|
4120
|
+
super();
|
|
4121
|
+
this.nativeEvent = nativeEvent;
|
|
4122
|
+
this.position = position;
|
|
4123
|
+
this.getData = getData;
|
|
4124
|
+
this.panel = panel;
|
|
4125
|
+
}
|
|
4126
|
+
}
|
|
4127
|
+
|
|
4068
4128
|
class WillFocusEvent extends DockviewEvent {
|
|
4069
4129
|
constructor() {
|
|
4070
4130
|
super();
|
|
@@ -4488,6 +4548,9 @@
|
|
|
4488
4548
|
this.accessor = accessor;
|
|
4489
4549
|
this._onDidDrop = new Emitter();
|
|
4490
4550
|
this.onDidDrop = this._onDidDrop.event;
|
|
4551
|
+
this._onUnhandledDragOverEvent = new Emitter();
|
|
4552
|
+
this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
|
|
4553
|
+
this.addDisposables(this._onDidDrop, this._onUnhandledDragOverEvent);
|
|
4491
4554
|
if (!disableDnd) {
|
|
4492
4555
|
this.initDragFeatures();
|
|
4493
4556
|
}
|
|
@@ -4514,7 +4577,7 @@
|
|
|
4514
4577
|
overlayModel: {
|
|
4515
4578
|
activationSize: { type: 'percentage', value: 50 },
|
|
4516
4579
|
},
|
|
4517
|
-
canDisplayOverlay: (event) => {
|
|
4580
|
+
canDisplayOverlay: (event, position) => {
|
|
4518
4581
|
const data = getPaneData();
|
|
4519
4582
|
if (data) {
|
|
4520
4583
|
if (data.paneId !== this.id &&
|
|
@@ -4522,14 +4585,9 @@
|
|
|
4522
4585
|
return true;
|
|
4523
4586
|
}
|
|
4524
4587
|
}
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
getData: getPaneData,
|
|
4529
|
-
panel: this,
|
|
4530
|
-
});
|
|
4531
|
-
}
|
|
4532
|
-
return false;
|
|
4588
|
+
const firedEvent = new PaneviewUnhandledDragOverEvent(event, position, getPaneData, this);
|
|
4589
|
+
this._onUnhandledDragOverEvent.fire(firedEvent);
|
|
4590
|
+
return firedEvent.isAccepted;
|
|
4533
4591
|
},
|
|
4534
4592
|
});
|
|
4535
4593
|
this.addDisposables(this._onDidDrop, this.handler, this.target, this.target.onDrop((event) => {
|
|
@@ -4984,15 +5042,7 @@
|
|
|
4984
5042
|
this._element.appendChild(this.leftActionsContainer);
|
|
4985
5043
|
this._element.appendChild(this.voidContainer.element);
|
|
4986
5044
|
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) => {
|
|
5045
|
+
this.addDisposables(this._onWillShowOverlay, this._onDrop, this._onTabDragStart, this._onGroupDragStart, this.voidContainer, this.voidContainer.onDragStart((event) => {
|
|
4996
5046
|
this._onGroupDragStart.fire({
|
|
4997
5047
|
nativeEvent: event,
|
|
4998
5048
|
group: this.group,
|
|
@@ -5037,20 +5087,6 @@
|
|
|
5037
5087
|
setActive(_isGroupActive) {
|
|
5038
5088
|
// noop
|
|
5039
5089
|
}
|
|
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
5090
|
delete(id) {
|
|
5055
5091
|
const index = this.tabs.findIndex((tab) => tab.value.panel.id === id);
|
|
5056
5092
|
const tabToRemove = this.tabs.splice(index, 1)[0];
|
|
@@ -5058,6 +5094,7 @@
|
|
|
5058
5094
|
disposable.dispose();
|
|
5059
5095
|
value.dispose();
|
|
5060
5096
|
value.element.remove();
|
|
5097
|
+
this.updateClassnames();
|
|
5061
5098
|
}
|
|
5062
5099
|
setActivePanel(panel) {
|
|
5063
5100
|
this.tabs.forEach((tab) => {
|
|
@@ -5126,25 +5163,37 @@
|
|
|
5126
5163
|
}
|
|
5127
5164
|
this.tabs = [];
|
|
5128
5165
|
}
|
|
5166
|
+
addTab(tab, index = this.tabs.length) {
|
|
5167
|
+
if (index < 0 || index > this.tabs.length) {
|
|
5168
|
+
throw new Error('invalid location');
|
|
5169
|
+
}
|
|
5170
|
+
this.tabContainer.insertBefore(tab.value.element, this.tabContainer.children[index]);
|
|
5171
|
+
this.tabs = [
|
|
5172
|
+
...this.tabs.slice(0, index),
|
|
5173
|
+
tab,
|
|
5174
|
+
...this.tabs.slice(index),
|
|
5175
|
+
];
|
|
5176
|
+
if (this.selectedIndex < 0) {
|
|
5177
|
+
this.selectedIndex = index;
|
|
5178
|
+
}
|
|
5179
|
+
this.updateClassnames();
|
|
5180
|
+
}
|
|
5181
|
+
updateClassnames() {
|
|
5182
|
+
toggleClass(this._element, 'dv-single-tab', this.size === 1);
|
|
5183
|
+
}
|
|
5129
5184
|
}
|
|
5130
5185
|
|
|
5131
|
-
class DockviewUnhandledDragOverEvent {
|
|
5132
|
-
get isAccepted() {
|
|
5133
|
-
return this._isAccepted;
|
|
5134
|
-
}
|
|
5186
|
+
class DockviewUnhandledDragOverEvent extends AcceptableEvent {
|
|
5135
5187
|
constructor(nativeEvent, target, position, getData, group) {
|
|
5188
|
+
super();
|
|
5136
5189
|
this.nativeEvent = nativeEvent;
|
|
5137
5190
|
this.target = target;
|
|
5138
5191
|
this.position = position;
|
|
5139
5192
|
this.getData = getData;
|
|
5140
5193
|
this.group = group;
|
|
5141
|
-
this._isAccepted = false;
|
|
5142
|
-
}
|
|
5143
|
-
accept() {
|
|
5144
|
-
this._isAccepted = true;
|
|
5145
5194
|
}
|
|
5146
5195
|
}
|
|
5147
|
-
const
|
|
5196
|
+
const PROPERTY_KEYS_DOCKVIEW = (() => {
|
|
5148
5197
|
/**
|
|
5149
5198
|
* by readong the keys from an empty value object TypeScript will error
|
|
5150
5199
|
* when we add or remove new properties to `DockviewOptions`
|
|
@@ -9013,31 +9062,6 @@
|
|
|
9013
9062
|
}
|
|
9014
9063
|
}
|
|
9015
9064
|
|
|
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
9065
|
class GridviewComponent extends BaseGrid {
|
|
9042
9066
|
get orientation() {
|
|
9043
9067
|
return this.gridview.orientation;
|
|
@@ -9055,10 +9079,13 @@
|
|
|
9055
9079
|
this._deserializer = value;
|
|
9056
9080
|
}
|
|
9057
9081
|
constructor(parentElement, options) {
|
|
9082
|
+
var _a;
|
|
9058
9083
|
super(parentElement, {
|
|
9059
|
-
proportionalLayout: options.proportionalLayout,
|
|
9084
|
+
proportionalLayout: (_a = options.proportionalLayout) !== null && _a !== void 0 ? _a : true,
|
|
9060
9085
|
orientation: options.orientation,
|
|
9061
|
-
styles: options.
|
|
9086
|
+
styles: options.hideBorders
|
|
9087
|
+
? { separatorBorder: 'transparent' }
|
|
9088
|
+
: undefined,
|
|
9062
9089
|
disableAutoResizing: options.disableAutoResizing,
|
|
9063
9090
|
className: options.className,
|
|
9064
9091
|
});
|
|
@@ -9078,12 +9105,6 @@
|
|
|
9078
9105
|
}), this.onDidActiveChange((event) => {
|
|
9079
9106
|
this._onDidActiveGroupChange.fire(event);
|
|
9080
9107
|
}));
|
|
9081
|
-
if (!this.options.components) {
|
|
9082
|
-
this.options.components = {};
|
|
9083
|
-
}
|
|
9084
|
-
if (!this.options.frameworkComponents) {
|
|
9085
|
-
this.options.frameworkComponents = {};
|
|
9086
|
-
}
|
|
9087
9108
|
}
|
|
9088
9109
|
updateOptions(options) {
|
|
9089
9110
|
super.updateOptions(options);
|
|
@@ -9133,14 +9154,11 @@
|
|
|
9133
9154
|
const height = this.height;
|
|
9134
9155
|
this.gridview.deserialize(grid, {
|
|
9135
9156
|
fromJSON: (node) => {
|
|
9136
|
-
var _a, _b;
|
|
9137
9157
|
const { data } = node;
|
|
9138
|
-
const view =
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
}
|
|
9143
|
-
: undefined);
|
|
9158
|
+
const view = this.options.createComponent({
|
|
9159
|
+
id: data.id,
|
|
9160
|
+
name: data.component,
|
|
9161
|
+
});
|
|
9144
9162
|
queue.push(() => view.init({
|
|
9145
9163
|
params: data.params,
|
|
9146
9164
|
minimumWidth: data.minimumWidth,
|
|
@@ -9218,7 +9236,7 @@
|
|
|
9218
9236
|
this.doAddGroup(removedPanel, relativeLocation, options.size);
|
|
9219
9237
|
}
|
|
9220
9238
|
addPanel(options) {
|
|
9221
|
-
var _a, _b, _c, _d
|
|
9239
|
+
var _a, _b, _c, _d;
|
|
9222
9240
|
let relativeLocation = (_a = options.location) !== null && _a !== void 0 ? _a : [0];
|
|
9223
9241
|
if ((_b = options.position) === null || _b === void 0 ? void 0 : _b.referencePanel) {
|
|
9224
9242
|
const referenceGroup = (_c = this._groups.get(options.position.referencePanel)) === null || _c === void 0 ? void 0 : _c.value;
|
|
@@ -9234,14 +9252,12 @@
|
|
|
9234
9252
|
relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
|
|
9235
9253
|
}
|
|
9236
9254
|
}
|
|
9237
|
-
const view =
|
|
9238
|
-
|
|
9239
|
-
|
|
9240
|
-
|
|
9241
|
-
}
|
|
9242
|
-
: undefined);
|
|
9255
|
+
const view = this.options.createComponent({
|
|
9256
|
+
id: options.id,
|
|
9257
|
+
name: options.component,
|
|
9258
|
+
});
|
|
9243
9259
|
view.init({
|
|
9244
|
-
params: (
|
|
9260
|
+
params: (_d = options.params) !== null && _d !== void 0 ? _d : {},
|
|
9245
9261
|
minimumWidth: options.minimumWidth,
|
|
9246
9262
|
maximumWidth: options.maximumWidth,
|
|
9247
9263
|
minimumHeight: options.minimumHeight,
|
|
@@ -9369,12 +9385,6 @@
|
|
|
9369
9385
|
this._classNames = new Classnames(this.element);
|
|
9370
9386
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9371
9387
|
this._options = options;
|
|
9372
|
-
if (!options.components) {
|
|
9373
|
-
options.components = {};
|
|
9374
|
-
}
|
|
9375
|
-
if (!options.frameworkComponents) {
|
|
9376
|
-
options.frameworkComponents = {};
|
|
9377
|
-
}
|
|
9378
9388
|
this.splitview = new Splitview(this.element, options);
|
|
9379
9389
|
this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
|
|
9380
9390
|
}
|
|
@@ -9437,18 +9447,17 @@
|
|
|
9437
9447
|
return this.panels.find((view) => view.id === id);
|
|
9438
9448
|
}
|
|
9439
9449
|
addPanel(options) {
|
|
9440
|
-
var _a
|
|
9450
|
+
var _a;
|
|
9441
9451
|
if (this._panels.has(options.id)) {
|
|
9442
9452
|
throw new Error(`panel ${options.id} already exists`);
|
|
9443
9453
|
}
|
|
9444
|
-
const view =
|
|
9445
|
-
|
|
9446
|
-
|
|
9447
|
-
|
|
9448
|
-
: undefined);
|
|
9454
|
+
const view = this.options.createComponent({
|
|
9455
|
+
id: options.id,
|
|
9456
|
+
name: options.component,
|
|
9457
|
+
});
|
|
9449
9458
|
view.orientation = this.splitview.orientation;
|
|
9450
9459
|
view.init({
|
|
9451
|
-
params: (
|
|
9460
|
+
params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
|
|
9452
9461
|
minimumSize: options.minimumSize,
|
|
9453
9462
|
maximumSize: options.maximumSize,
|
|
9454
9463
|
snap: options.snap,
|
|
@@ -9510,17 +9519,14 @@
|
|
|
9510
9519
|
descriptor: {
|
|
9511
9520
|
size,
|
|
9512
9521
|
views: views.map((view) => {
|
|
9513
|
-
var _a, _b;
|
|
9514
9522
|
const data = view.data;
|
|
9515
9523
|
if (this._panels.has(data.id)) {
|
|
9516
9524
|
throw new Error(`panel ${data.id} already exists`);
|
|
9517
9525
|
}
|
|
9518
|
-
const panel =
|
|
9519
|
-
|
|
9520
|
-
|
|
9521
|
-
|
|
9522
|
-
}
|
|
9523
|
-
: undefined);
|
|
9526
|
+
const panel = this.options.createComponent({
|
|
9527
|
+
id: data.id,
|
|
9528
|
+
name: data.component,
|
|
9529
|
+
});
|
|
9524
9530
|
queue.push(() => {
|
|
9525
9531
|
var _a;
|
|
9526
9532
|
panel.init({
|
|
@@ -9703,16 +9709,12 @@
|
|
|
9703
9709
|
this.onDidAddView = this._onDidAddView.event;
|
|
9704
9710
|
this._onDidRemoveView = new Emitter();
|
|
9705
9711
|
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
9706
|
-
this.
|
|
9712
|
+
this._onUnhandledDragOverEvent = new Emitter();
|
|
9713
|
+
this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
|
|
9714
|
+
this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView, this._onUnhandledDragOverEvent);
|
|
9707
9715
|
this._classNames = new Classnames(this.element);
|
|
9708
9716
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9709
9717
|
this._options = options;
|
|
9710
|
-
if (!options.components) {
|
|
9711
|
-
options.components = {};
|
|
9712
|
-
}
|
|
9713
|
-
if (!options.frameworkComponents) {
|
|
9714
|
-
options.frameworkComponents = {};
|
|
9715
|
-
}
|
|
9716
9718
|
this.paneview = new Paneview(this.element, {
|
|
9717
9719
|
// only allow paneview in the vertical orientation for now
|
|
9718
9720
|
orientation: exports.Orientation.VERTICAL,
|
|
@@ -9737,22 +9739,19 @@
|
|
|
9737
9739
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
9738
9740
|
}
|
|
9739
9741
|
addPanel(options) {
|
|
9740
|
-
var _a
|
|
9741
|
-
const body =
|
|
9742
|
-
|
|
9743
|
-
|
|
9744
|
-
|
|
9745
|
-
: undefined);
|
|
9742
|
+
var _a;
|
|
9743
|
+
const body = this.options.createComponent({
|
|
9744
|
+
id: options.id,
|
|
9745
|
+
name: options.component,
|
|
9746
|
+
});
|
|
9746
9747
|
let header;
|
|
9747
|
-
if (options.headerComponent) {
|
|
9748
|
-
header =
|
|
9749
|
-
|
|
9750
|
-
|
|
9751
|
-
|
|
9752
|
-
}
|
|
9753
|
-
: undefined);
|
|
9748
|
+
if (options.headerComponent && this.options.createHeaderComponent) {
|
|
9749
|
+
header = this.options.createHeaderComponent({
|
|
9750
|
+
id: options.id,
|
|
9751
|
+
name: options.headerComponent,
|
|
9752
|
+
});
|
|
9754
9753
|
}
|
|
9755
|
-
|
|
9754
|
+
if (!header) {
|
|
9756
9755
|
header = new DefaultHeader();
|
|
9757
9756
|
}
|
|
9758
9757
|
const view = new PaneFramework({
|
|
@@ -9770,7 +9769,7 @@
|
|
|
9770
9769
|
const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
|
|
9771
9770
|
const index = typeof options.index === 'number' ? options.index : undefined;
|
|
9772
9771
|
view.init({
|
|
9773
|
-
params: (
|
|
9772
|
+
params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
|
|
9774
9773
|
minimumBodySize: options.minimumBodySize,
|
|
9775
9774
|
maximumBodySize: options.maximumBodySize,
|
|
9776
9775
|
isExpanded: options.isExpanded,
|
|
@@ -9835,24 +9834,20 @@
|
|
|
9835
9834
|
descriptor: {
|
|
9836
9835
|
size,
|
|
9837
9836
|
views: views.map((view) => {
|
|
9838
|
-
var _a, _b, _c, _d;
|
|
9839
9837
|
const data = view.data;
|
|
9840
|
-
const body =
|
|
9841
|
-
|
|
9842
|
-
|
|
9843
|
-
|
|
9844
|
-
}
|
|
9845
|
-
: undefined);
|
|
9838
|
+
const body = this.options.createComponent({
|
|
9839
|
+
id: data.id,
|
|
9840
|
+
name: data.component,
|
|
9841
|
+
});
|
|
9846
9842
|
let header;
|
|
9847
|
-
if (data.headerComponent
|
|
9848
|
-
|
|
9849
|
-
|
|
9850
|
-
|
|
9851
|
-
|
|
9852
|
-
|
|
9853
|
-
: undefined);
|
|
9843
|
+
if (data.headerComponent &&
|
|
9844
|
+
this.options.createHeaderComponent) {
|
|
9845
|
+
header = this.options.createHeaderComponent({
|
|
9846
|
+
id: data.id,
|
|
9847
|
+
name: data.headerComponent,
|
|
9848
|
+
});
|
|
9854
9849
|
}
|
|
9855
|
-
|
|
9850
|
+
if (!header) {
|
|
9856
9851
|
header = new DefaultHeader();
|
|
9857
9852
|
}
|
|
9858
9853
|
const panel = new PaneFramework({
|
|
@@ -9900,9 +9895,11 @@
|
|
|
9900
9895
|
this.paneview.dispose();
|
|
9901
9896
|
}
|
|
9902
9897
|
doAddPanel(panel) {
|
|
9903
|
-
const disposable = panel.onDidDrop((event) => {
|
|
9898
|
+
const disposable = new CompositeDisposable(panel.onDidDrop((event) => {
|
|
9904
9899
|
this._onDidDrop.fire(event);
|
|
9905
|
-
})
|
|
9900
|
+
}), panel.onUnhandledDragOverEvent((event) => {
|
|
9901
|
+
this._onUnhandledDragOverEvent.fire(event);
|
|
9902
|
+
}));
|
|
9906
9903
|
this._viewDisposables.set(panel.id, disposable);
|
|
9907
9904
|
}
|
|
9908
9905
|
doRemovePanel(panel) {
|
|
@@ -10064,7 +10061,10 @@
|
|
|
10064
10061
|
exports.GridviewApi = GridviewApi;
|
|
10065
10062
|
exports.GridviewComponent = GridviewComponent;
|
|
10066
10063
|
exports.GridviewPanel = GridviewPanel;
|
|
10067
|
-
exports.
|
|
10064
|
+
exports.PROPERTY_KEYS_DOCKVIEW = PROPERTY_KEYS_DOCKVIEW;
|
|
10065
|
+
exports.PROPERTY_KEYS_GRIDVIEW = PROPERTY_KEYS_GRIDVIEW;
|
|
10066
|
+
exports.PROPERTY_KEYS_PANEVIEW = PROPERTY_KEYS_PANEVIEW;
|
|
10067
|
+
exports.PROPERTY_KEYS_SPLITVIEW = PROPERTY_KEYS_SPLITVIEW;
|
|
10068
10068
|
exports.PaneFramework = PaneFramework;
|
|
10069
10069
|
exports.PaneTransfer = PaneTransfer;
|
|
10070
10070
|
exports.PanelTransfer = PanelTransfer;
|
|
@@ -10072,6 +10072,7 @@
|
|
|
10072
10072
|
exports.PaneviewApi = PaneviewApi;
|
|
10073
10073
|
exports.PaneviewComponent = PaneviewComponent;
|
|
10074
10074
|
exports.PaneviewPanel = PaneviewPanel;
|
|
10075
|
+
exports.PaneviewUnhandledDragOverEvent = PaneviewUnhandledDragOverEvent;
|
|
10075
10076
|
exports.Splitview = Splitview;
|
|
10076
10077
|
exports.SplitviewApi = SplitviewApi;
|
|
10077
10078
|
exports.SplitviewComponent = SplitviewComponent;
|