dockview-core 2.1.3 → 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/dockviewComponent.d.ts +0 -1
- package/dist/cjs/dockview/dockviewComponent.js +8 -13
- 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 +168 -172
- 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 +168 -172
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +168 -172
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +164 -172
- 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 +168 -172
- 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 +168 -172
- 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/dockviewComponent.d.ts +0 -1
- package/dist/esm/dockview/dockviewComponent.js +8 -13
- 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`
|
|
@@ -7667,10 +7716,6 @@
|
|
|
7667
7716
|
this._api = new DockviewApi(this);
|
|
7668
7717
|
this.updateWatermark();
|
|
7669
7718
|
}
|
|
7670
|
-
dispose() {
|
|
7671
|
-
this.clear(); // explicitly clear the layout before cleaning up
|
|
7672
|
-
super.dispose();
|
|
7673
|
-
}
|
|
7674
7719
|
setVisible(panel, visible) {
|
|
7675
7720
|
switch (panel.api.location.type) {
|
|
7676
7721
|
case 'grid':
|
|
@@ -7854,30 +7899,29 @@
|
|
|
7854
7899
|
}
|
|
7855
7900
|
}
|
|
7856
7901
|
else if (this.getPanel(group.id)) {
|
|
7857
|
-
|
|
7902
|
+
group.model.renderContainer =
|
|
7903
|
+
this.overlayRenderContainer;
|
|
7904
|
+
returnedGroup = group;
|
|
7858
7905
|
if (floatingBox) {
|
|
7859
|
-
this.addFloatingGroup(
|
|
7906
|
+
this.addFloatingGroup(group, {
|
|
7860
7907
|
height: floatingBox.height,
|
|
7861
7908
|
width: floatingBox.width,
|
|
7862
7909
|
position: floatingBox,
|
|
7863
7910
|
});
|
|
7864
7911
|
}
|
|
7865
7912
|
else {
|
|
7866
|
-
this.doRemoveGroup(
|
|
7913
|
+
this.doRemoveGroup(group, {
|
|
7867
7914
|
skipDispose: true,
|
|
7868
7915
|
skipActive: true,
|
|
7869
7916
|
skipPopoutReturn: true,
|
|
7870
7917
|
});
|
|
7871
|
-
|
|
7872
|
-
this.overlayRenderContainer;
|
|
7873
|
-
removedGroup.model.location = { type: 'grid' };
|
|
7874
|
-
returnedGroup = removedGroup;
|
|
7918
|
+
group.model.location = { type: 'grid' };
|
|
7875
7919
|
this.movingLock(() => {
|
|
7876
7920
|
// suppress group add events since the group already exists
|
|
7877
|
-
this.doAddGroup(
|
|
7921
|
+
this.doAddGroup(group, [0]);
|
|
7878
7922
|
});
|
|
7879
7923
|
}
|
|
7880
|
-
this.doSetGroupAndPanelActive(
|
|
7924
|
+
this.doSetGroupAndPanelActive(group);
|
|
7881
7925
|
}
|
|
7882
7926
|
}));
|
|
7883
7927
|
this._popoutGroups.push(value);
|
|
@@ -9018,31 +9062,6 @@
|
|
|
9018
9062
|
}
|
|
9019
9063
|
}
|
|
9020
9064
|
|
|
9021
|
-
function createComponent(id, componentName, components = {}, frameworkComponents = {}, createFrameworkComponent, fallback) {
|
|
9022
|
-
const Component = typeof componentName === 'string'
|
|
9023
|
-
? components[componentName]
|
|
9024
|
-
: undefined;
|
|
9025
|
-
const FrameworkComponent = typeof componentName === 'string'
|
|
9026
|
-
? frameworkComponents[componentName]
|
|
9027
|
-
: undefined;
|
|
9028
|
-
if (Component && FrameworkComponent) {
|
|
9029
|
-
throw new Error(`Cannot create '${id}'. component '${componentName}' registered as both a component and frameworkComponent`);
|
|
9030
|
-
}
|
|
9031
|
-
if (FrameworkComponent) {
|
|
9032
|
-
if (!createFrameworkComponent) {
|
|
9033
|
-
throw new Error(`Cannot create '${id}' for framework component '${componentName}'. you must register a frameworkPanelWrapper to use framework components`);
|
|
9034
|
-
}
|
|
9035
|
-
return createFrameworkComponent.createComponent(id, componentName, FrameworkComponent);
|
|
9036
|
-
}
|
|
9037
|
-
if (!Component) {
|
|
9038
|
-
if (fallback) {
|
|
9039
|
-
return fallback();
|
|
9040
|
-
}
|
|
9041
|
-
throw new Error(`Cannot create '${id}', no component '${componentName}' provided`);
|
|
9042
|
-
}
|
|
9043
|
-
return new Component(id, componentName);
|
|
9044
|
-
}
|
|
9045
|
-
|
|
9046
9065
|
class GridviewComponent extends BaseGrid {
|
|
9047
9066
|
get orientation() {
|
|
9048
9067
|
return this.gridview.orientation;
|
|
@@ -9060,10 +9079,13 @@
|
|
|
9060
9079
|
this._deserializer = value;
|
|
9061
9080
|
}
|
|
9062
9081
|
constructor(parentElement, options) {
|
|
9082
|
+
var _a;
|
|
9063
9083
|
super(parentElement, {
|
|
9064
|
-
proportionalLayout: options.proportionalLayout,
|
|
9084
|
+
proportionalLayout: (_a = options.proportionalLayout) !== null && _a !== void 0 ? _a : true,
|
|
9065
9085
|
orientation: options.orientation,
|
|
9066
|
-
styles: options.
|
|
9086
|
+
styles: options.hideBorders
|
|
9087
|
+
? { separatorBorder: 'transparent' }
|
|
9088
|
+
: undefined,
|
|
9067
9089
|
disableAutoResizing: options.disableAutoResizing,
|
|
9068
9090
|
className: options.className,
|
|
9069
9091
|
});
|
|
@@ -9083,12 +9105,6 @@
|
|
|
9083
9105
|
}), this.onDidActiveChange((event) => {
|
|
9084
9106
|
this._onDidActiveGroupChange.fire(event);
|
|
9085
9107
|
}));
|
|
9086
|
-
if (!this.options.components) {
|
|
9087
|
-
this.options.components = {};
|
|
9088
|
-
}
|
|
9089
|
-
if (!this.options.frameworkComponents) {
|
|
9090
|
-
this.options.frameworkComponents = {};
|
|
9091
|
-
}
|
|
9092
9108
|
}
|
|
9093
9109
|
updateOptions(options) {
|
|
9094
9110
|
super.updateOptions(options);
|
|
@@ -9138,14 +9154,11 @@
|
|
|
9138
9154
|
const height = this.height;
|
|
9139
9155
|
this.gridview.deserialize(grid, {
|
|
9140
9156
|
fromJSON: (node) => {
|
|
9141
|
-
var _a, _b;
|
|
9142
9157
|
const { data } = node;
|
|
9143
|
-
const view =
|
|
9144
|
-
|
|
9145
|
-
|
|
9146
|
-
|
|
9147
|
-
}
|
|
9148
|
-
: undefined);
|
|
9158
|
+
const view = this.options.createComponent({
|
|
9159
|
+
id: data.id,
|
|
9160
|
+
name: data.component,
|
|
9161
|
+
});
|
|
9149
9162
|
queue.push(() => view.init({
|
|
9150
9163
|
params: data.params,
|
|
9151
9164
|
minimumWidth: data.minimumWidth,
|
|
@@ -9223,7 +9236,7 @@
|
|
|
9223
9236
|
this.doAddGroup(removedPanel, relativeLocation, options.size);
|
|
9224
9237
|
}
|
|
9225
9238
|
addPanel(options) {
|
|
9226
|
-
var _a, _b, _c, _d
|
|
9239
|
+
var _a, _b, _c, _d;
|
|
9227
9240
|
let relativeLocation = (_a = options.location) !== null && _a !== void 0 ? _a : [0];
|
|
9228
9241
|
if ((_b = options.position) === null || _b === void 0 ? void 0 : _b.referencePanel) {
|
|
9229
9242
|
const referenceGroup = (_c = this._groups.get(options.position.referencePanel)) === null || _c === void 0 ? void 0 : _c.value;
|
|
@@ -9239,14 +9252,12 @@
|
|
|
9239
9252
|
relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
|
|
9240
9253
|
}
|
|
9241
9254
|
}
|
|
9242
|
-
const view =
|
|
9243
|
-
|
|
9244
|
-
|
|
9245
|
-
|
|
9246
|
-
}
|
|
9247
|
-
: undefined);
|
|
9255
|
+
const view = this.options.createComponent({
|
|
9256
|
+
id: options.id,
|
|
9257
|
+
name: options.component,
|
|
9258
|
+
});
|
|
9248
9259
|
view.init({
|
|
9249
|
-
params: (
|
|
9260
|
+
params: (_d = options.params) !== null && _d !== void 0 ? _d : {},
|
|
9250
9261
|
minimumWidth: options.minimumWidth,
|
|
9251
9262
|
maximumWidth: options.maximumWidth,
|
|
9252
9263
|
minimumHeight: options.minimumHeight,
|
|
@@ -9374,12 +9385,6 @@
|
|
|
9374
9385
|
this._classNames = new Classnames(this.element);
|
|
9375
9386
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9376
9387
|
this._options = options;
|
|
9377
|
-
if (!options.components) {
|
|
9378
|
-
options.components = {};
|
|
9379
|
-
}
|
|
9380
|
-
if (!options.frameworkComponents) {
|
|
9381
|
-
options.frameworkComponents = {};
|
|
9382
|
-
}
|
|
9383
9388
|
this.splitview = new Splitview(this.element, options);
|
|
9384
9389
|
this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
|
|
9385
9390
|
}
|
|
@@ -9442,18 +9447,17 @@
|
|
|
9442
9447
|
return this.panels.find((view) => view.id === id);
|
|
9443
9448
|
}
|
|
9444
9449
|
addPanel(options) {
|
|
9445
|
-
var _a
|
|
9450
|
+
var _a;
|
|
9446
9451
|
if (this._panels.has(options.id)) {
|
|
9447
9452
|
throw new Error(`panel ${options.id} already exists`);
|
|
9448
9453
|
}
|
|
9449
|
-
const view =
|
|
9450
|
-
|
|
9451
|
-
|
|
9452
|
-
|
|
9453
|
-
: undefined);
|
|
9454
|
+
const view = this.options.createComponent({
|
|
9455
|
+
id: options.id,
|
|
9456
|
+
name: options.component,
|
|
9457
|
+
});
|
|
9454
9458
|
view.orientation = this.splitview.orientation;
|
|
9455
9459
|
view.init({
|
|
9456
|
-
params: (
|
|
9460
|
+
params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
|
|
9457
9461
|
minimumSize: options.minimumSize,
|
|
9458
9462
|
maximumSize: options.maximumSize,
|
|
9459
9463
|
snap: options.snap,
|
|
@@ -9515,17 +9519,14 @@
|
|
|
9515
9519
|
descriptor: {
|
|
9516
9520
|
size,
|
|
9517
9521
|
views: views.map((view) => {
|
|
9518
|
-
var _a, _b;
|
|
9519
9522
|
const data = view.data;
|
|
9520
9523
|
if (this._panels.has(data.id)) {
|
|
9521
9524
|
throw new Error(`panel ${data.id} already exists`);
|
|
9522
9525
|
}
|
|
9523
|
-
const panel =
|
|
9524
|
-
|
|
9525
|
-
|
|
9526
|
-
|
|
9527
|
-
}
|
|
9528
|
-
: undefined);
|
|
9526
|
+
const panel = this.options.createComponent({
|
|
9527
|
+
id: data.id,
|
|
9528
|
+
name: data.component,
|
|
9529
|
+
});
|
|
9529
9530
|
queue.push(() => {
|
|
9530
9531
|
var _a;
|
|
9531
9532
|
panel.init({
|
|
@@ -9708,16 +9709,12 @@
|
|
|
9708
9709
|
this.onDidAddView = this._onDidAddView.event;
|
|
9709
9710
|
this._onDidRemoveView = new Emitter();
|
|
9710
9711
|
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
9711
|
-
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);
|
|
9712
9715
|
this._classNames = new Classnames(this.element);
|
|
9713
9716
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9714
9717
|
this._options = options;
|
|
9715
|
-
if (!options.components) {
|
|
9716
|
-
options.components = {};
|
|
9717
|
-
}
|
|
9718
|
-
if (!options.frameworkComponents) {
|
|
9719
|
-
options.frameworkComponents = {};
|
|
9720
|
-
}
|
|
9721
9718
|
this.paneview = new Paneview(this.element, {
|
|
9722
9719
|
// only allow paneview in the vertical orientation for now
|
|
9723
9720
|
orientation: exports.Orientation.VERTICAL,
|
|
@@ -9742,22 +9739,19 @@
|
|
|
9742
9739
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
9743
9740
|
}
|
|
9744
9741
|
addPanel(options) {
|
|
9745
|
-
var _a
|
|
9746
|
-
const body =
|
|
9747
|
-
|
|
9748
|
-
|
|
9749
|
-
|
|
9750
|
-
: undefined);
|
|
9742
|
+
var _a;
|
|
9743
|
+
const body = this.options.createComponent({
|
|
9744
|
+
id: options.id,
|
|
9745
|
+
name: options.component,
|
|
9746
|
+
});
|
|
9751
9747
|
let header;
|
|
9752
|
-
if (options.headerComponent) {
|
|
9753
|
-
header =
|
|
9754
|
-
|
|
9755
|
-
|
|
9756
|
-
|
|
9757
|
-
}
|
|
9758
|
-
: undefined);
|
|
9748
|
+
if (options.headerComponent && this.options.createHeaderComponent) {
|
|
9749
|
+
header = this.options.createHeaderComponent({
|
|
9750
|
+
id: options.id,
|
|
9751
|
+
name: options.headerComponent,
|
|
9752
|
+
});
|
|
9759
9753
|
}
|
|
9760
|
-
|
|
9754
|
+
if (!header) {
|
|
9761
9755
|
header = new DefaultHeader();
|
|
9762
9756
|
}
|
|
9763
9757
|
const view = new PaneFramework({
|
|
@@ -9775,7 +9769,7 @@
|
|
|
9775
9769
|
const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
|
|
9776
9770
|
const index = typeof options.index === 'number' ? options.index : undefined;
|
|
9777
9771
|
view.init({
|
|
9778
|
-
params: (
|
|
9772
|
+
params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
|
|
9779
9773
|
minimumBodySize: options.minimumBodySize,
|
|
9780
9774
|
maximumBodySize: options.maximumBodySize,
|
|
9781
9775
|
isExpanded: options.isExpanded,
|
|
@@ -9840,24 +9834,20 @@
|
|
|
9840
9834
|
descriptor: {
|
|
9841
9835
|
size,
|
|
9842
9836
|
views: views.map((view) => {
|
|
9843
|
-
var _a, _b, _c, _d;
|
|
9844
9837
|
const data = view.data;
|
|
9845
|
-
const body =
|
|
9846
|
-
|
|
9847
|
-
|
|
9848
|
-
|
|
9849
|
-
}
|
|
9850
|
-
: undefined);
|
|
9838
|
+
const body = this.options.createComponent({
|
|
9839
|
+
id: data.id,
|
|
9840
|
+
name: data.component,
|
|
9841
|
+
});
|
|
9851
9842
|
let header;
|
|
9852
|
-
if (data.headerComponent
|
|
9853
|
-
|
|
9854
|
-
|
|
9855
|
-
|
|
9856
|
-
|
|
9857
|
-
|
|
9858
|
-
: undefined);
|
|
9843
|
+
if (data.headerComponent &&
|
|
9844
|
+
this.options.createHeaderComponent) {
|
|
9845
|
+
header = this.options.createHeaderComponent({
|
|
9846
|
+
id: data.id,
|
|
9847
|
+
name: data.headerComponent,
|
|
9848
|
+
});
|
|
9859
9849
|
}
|
|
9860
|
-
|
|
9850
|
+
if (!header) {
|
|
9861
9851
|
header = new DefaultHeader();
|
|
9862
9852
|
}
|
|
9863
9853
|
const panel = new PaneFramework({
|
|
@@ -9905,9 +9895,11 @@
|
|
|
9905
9895
|
this.paneview.dispose();
|
|
9906
9896
|
}
|
|
9907
9897
|
doAddPanel(panel) {
|
|
9908
|
-
const disposable = panel.onDidDrop((event) => {
|
|
9898
|
+
const disposable = new CompositeDisposable(panel.onDidDrop((event) => {
|
|
9909
9899
|
this._onDidDrop.fire(event);
|
|
9910
|
-
})
|
|
9900
|
+
}), panel.onUnhandledDragOverEvent((event) => {
|
|
9901
|
+
this._onUnhandledDragOverEvent.fire(event);
|
|
9902
|
+
}));
|
|
9911
9903
|
this._viewDisposables.set(panel.id, disposable);
|
|
9912
9904
|
}
|
|
9913
9905
|
doRemovePanel(panel) {
|
|
@@ -10069,7 +10061,10 @@
|
|
|
10069
10061
|
exports.GridviewApi = GridviewApi;
|
|
10070
10062
|
exports.GridviewComponent = GridviewComponent;
|
|
10071
10063
|
exports.GridviewPanel = GridviewPanel;
|
|
10072
|
-
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;
|
|
10073
10068
|
exports.PaneFramework = PaneFramework;
|
|
10074
10069
|
exports.PaneTransfer = PaneTransfer;
|
|
10075
10070
|
exports.PanelTransfer = PanelTransfer;
|
|
@@ -10077,6 +10072,7 @@
|
|
|
10077
10072
|
exports.PaneviewApi = PaneviewApi;
|
|
10078
10073
|
exports.PaneviewComponent = PaneviewComponent;
|
|
10079
10074
|
exports.PaneviewPanel = PaneviewPanel;
|
|
10075
|
+
exports.PaneviewUnhandledDragOverEvent = PaneviewUnhandledDragOverEvent;
|
|
10080
10076
|
exports.Splitview = Splitview;
|
|
10081
10077
|
exports.SplitviewApi = SplitviewApi;
|
|
10082
10078
|
exports.SplitviewComponent = SplitviewComponent;
|