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
|
@@ -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
|
*/
|
|
@@ -129,6 +129,17 @@ class DockviewEvent {
|
|
|
129
129
|
this._defaultPrevented = true;
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
+
class AcceptableEvent {
|
|
133
|
+
constructor() {
|
|
134
|
+
this._isAccepted = false;
|
|
135
|
+
}
|
|
136
|
+
get isAccepted() {
|
|
137
|
+
return this._isAccepted;
|
|
138
|
+
}
|
|
139
|
+
accept() {
|
|
140
|
+
this._isAccepted = true;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
132
143
|
class LeakageMonitor {
|
|
133
144
|
constructor() {
|
|
134
145
|
this.events = new Map();
|
|
@@ -1520,6 +1531,23 @@ class Splitview {
|
|
|
1520
1531
|
}
|
|
1521
1532
|
}
|
|
1522
1533
|
|
|
1534
|
+
const PROPERTY_KEYS_SPLITVIEW = (() => {
|
|
1535
|
+
/**
|
|
1536
|
+
* by readong the keys from an empty value object TypeScript will error
|
|
1537
|
+
* when we add or remove new properties to `DockviewOptions`
|
|
1538
|
+
*/
|
|
1539
|
+
const properties = {
|
|
1540
|
+
orientation: undefined,
|
|
1541
|
+
descriptor: undefined,
|
|
1542
|
+
proportionalLayout: undefined,
|
|
1543
|
+
styles: undefined,
|
|
1544
|
+
margin: undefined,
|
|
1545
|
+
disableAutoResizing: undefined,
|
|
1546
|
+
className: undefined,
|
|
1547
|
+
};
|
|
1548
|
+
return Object.keys(properties);
|
|
1549
|
+
})();
|
|
1550
|
+
|
|
1523
1551
|
class Paneview extends CompositeDisposable {
|
|
1524
1552
|
get onDidAddView() {
|
|
1525
1553
|
return this.splitview.onDidAddView;
|
|
@@ -2649,6 +2677,21 @@ class Gridview {
|
|
|
2649
2677
|
}
|
|
2650
2678
|
}
|
|
2651
2679
|
|
|
2680
|
+
const PROPERTY_KEYS_GRIDVIEW = (() => {
|
|
2681
|
+
/**
|
|
2682
|
+
* by readong the keys from an empty value object TypeScript will error
|
|
2683
|
+
* when we add or remove new properties to `DockviewOptions`
|
|
2684
|
+
*/
|
|
2685
|
+
const properties = {
|
|
2686
|
+
disableAutoResizing: undefined,
|
|
2687
|
+
proportionalLayout: undefined,
|
|
2688
|
+
orientation: undefined,
|
|
2689
|
+
hideBorders: undefined,
|
|
2690
|
+
className: undefined,
|
|
2691
|
+
};
|
|
2692
|
+
return Object.keys(properties);
|
|
2693
|
+
})();
|
|
2694
|
+
|
|
2652
2695
|
class Resizable extends CompositeDisposable {
|
|
2653
2696
|
get element() {
|
|
2654
2697
|
return this._element;
|
|
@@ -3126,15 +3169,10 @@ class PaneviewApi {
|
|
|
3126
3169
|
* Invoked when a Drag'n'Drop event occurs that the component was unable to handle. Exposed for custom Drag'n'Drop functionality.
|
|
3127
3170
|
*/
|
|
3128
3171
|
get onDidDrop() {
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
emitter.dispose = () => {
|
|
3134
|
-
disposable.dispose();
|
|
3135
|
-
emitter.dispose();
|
|
3136
|
-
};
|
|
3137
|
-
return emitter.event;
|
|
3172
|
+
return this.component.onDidDrop;
|
|
3173
|
+
}
|
|
3174
|
+
get onUnhandledDragOverEvent() {
|
|
3175
|
+
return this.component.onUnhandledDragOverEvent;
|
|
3138
3176
|
}
|
|
3139
3177
|
constructor(component) {
|
|
3140
3178
|
this.component = component;
|
|
@@ -4061,6 +4099,28 @@ function calculateQuadrantAsPixels(overlayType, x, y, width, height, threshold)
|
|
|
4061
4099
|
return 'center';
|
|
4062
4100
|
}
|
|
4063
4101
|
|
|
4102
|
+
const PROPERTY_KEYS_PANEVIEW = (() => {
|
|
4103
|
+
/**
|
|
4104
|
+
* by readong the keys from an empty value object TypeScript will error
|
|
4105
|
+
* when we add or remove new properties to `DockviewOptions`
|
|
4106
|
+
*/
|
|
4107
|
+
const properties = {
|
|
4108
|
+
disableAutoResizing: undefined,
|
|
4109
|
+
disableDnd: undefined,
|
|
4110
|
+
className: undefined,
|
|
4111
|
+
};
|
|
4112
|
+
return Object.keys(properties);
|
|
4113
|
+
})();
|
|
4114
|
+
class PaneviewUnhandledDragOverEvent extends AcceptableEvent {
|
|
4115
|
+
constructor(nativeEvent, position, getData, panel) {
|
|
4116
|
+
super();
|
|
4117
|
+
this.nativeEvent = nativeEvent;
|
|
4118
|
+
this.position = position;
|
|
4119
|
+
this.getData = getData;
|
|
4120
|
+
this.panel = panel;
|
|
4121
|
+
}
|
|
4122
|
+
}
|
|
4123
|
+
|
|
4064
4124
|
class WillFocusEvent extends DockviewEvent {
|
|
4065
4125
|
constructor() {
|
|
4066
4126
|
super();
|
|
@@ -4484,6 +4544,9 @@ class DraggablePaneviewPanel extends PaneviewPanel {
|
|
|
4484
4544
|
this.accessor = accessor;
|
|
4485
4545
|
this._onDidDrop = new Emitter();
|
|
4486
4546
|
this.onDidDrop = this._onDidDrop.event;
|
|
4547
|
+
this._onUnhandledDragOverEvent = new Emitter();
|
|
4548
|
+
this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
|
|
4549
|
+
this.addDisposables(this._onDidDrop, this._onUnhandledDragOverEvent);
|
|
4487
4550
|
if (!disableDnd) {
|
|
4488
4551
|
this.initDragFeatures();
|
|
4489
4552
|
}
|
|
@@ -4510,7 +4573,7 @@ class DraggablePaneviewPanel extends PaneviewPanel {
|
|
|
4510
4573
|
overlayModel: {
|
|
4511
4574
|
activationSize: { type: 'percentage', value: 50 },
|
|
4512
4575
|
},
|
|
4513
|
-
canDisplayOverlay: (event) => {
|
|
4576
|
+
canDisplayOverlay: (event, position) => {
|
|
4514
4577
|
const data = getPaneData();
|
|
4515
4578
|
if (data) {
|
|
4516
4579
|
if (data.paneId !== this.id &&
|
|
@@ -4518,14 +4581,9 @@ class DraggablePaneviewPanel extends PaneviewPanel {
|
|
|
4518
4581
|
return true;
|
|
4519
4582
|
}
|
|
4520
4583
|
}
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
getData: getPaneData,
|
|
4525
|
-
panel: this,
|
|
4526
|
-
});
|
|
4527
|
-
}
|
|
4528
|
-
return false;
|
|
4584
|
+
const firedEvent = new PaneviewUnhandledDragOverEvent(event, position, getPaneData, this);
|
|
4585
|
+
this._onUnhandledDragOverEvent.fire(firedEvent);
|
|
4586
|
+
return firedEvent.isAccepted;
|
|
4529
4587
|
},
|
|
4530
4588
|
});
|
|
4531
4589
|
this.addDisposables(this._onDidDrop, this.handler, this.target, this.target.onDrop((event) => {
|
|
@@ -4980,15 +5038,7 @@ class TabsContainer extends CompositeDisposable {
|
|
|
4980
5038
|
this._element.appendChild(this.leftActionsContainer);
|
|
4981
5039
|
this._element.appendChild(this.voidContainer.element);
|
|
4982
5040
|
this._element.appendChild(this.rightActionsContainer);
|
|
4983
|
-
this.addDisposables(this.
|
|
4984
|
-
if (e.api.group === this.group) {
|
|
4985
|
-
toggleClass(this._element, 'dv-single-tab', this.size === 1);
|
|
4986
|
-
}
|
|
4987
|
-
}), this.accessor.onDidRemovePanel((e) => {
|
|
4988
|
-
if (e.api.group === this.group) {
|
|
4989
|
-
toggleClass(this._element, 'dv-single-tab', this.size === 1);
|
|
4990
|
-
}
|
|
4991
|
-
}), this._onWillShowOverlay, this._onDrop, this._onTabDragStart, this._onGroupDragStart, this.voidContainer, this.voidContainer.onDragStart((event) => {
|
|
5041
|
+
this.addDisposables(this._onWillShowOverlay, this._onDrop, this._onTabDragStart, this._onGroupDragStart, this.voidContainer, this.voidContainer.onDragStart((event) => {
|
|
4992
5042
|
this._onGroupDragStart.fire({
|
|
4993
5043
|
nativeEvent: event,
|
|
4994
5044
|
group: this.group,
|
|
@@ -5033,20 +5083,6 @@ class TabsContainer extends CompositeDisposable {
|
|
|
5033
5083
|
setActive(_isGroupActive) {
|
|
5034
5084
|
// noop
|
|
5035
5085
|
}
|
|
5036
|
-
addTab(tab, index = this.tabs.length) {
|
|
5037
|
-
if (index < 0 || index > this.tabs.length) {
|
|
5038
|
-
throw new Error('invalid location');
|
|
5039
|
-
}
|
|
5040
|
-
this.tabContainer.insertBefore(tab.value.element, this.tabContainer.children[index]);
|
|
5041
|
-
this.tabs = [
|
|
5042
|
-
...this.tabs.slice(0, index),
|
|
5043
|
-
tab,
|
|
5044
|
-
...this.tabs.slice(index),
|
|
5045
|
-
];
|
|
5046
|
-
if (this.selectedIndex < 0) {
|
|
5047
|
-
this.selectedIndex = index;
|
|
5048
|
-
}
|
|
5049
|
-
}
|
|
5050
5086
|
delete(id) {
|
|
5051
5087
|
const index = this.tabs.findIndex((tab) => tab.value.panel.id === id);
|
|
5052
5088
|
const tabToRemove = this.tabs.splice(index, 1)[0];
|
|
@@ -5054,6 +5090,7 @@ class TabsContainer extends CompositeDisposable {
|
|
|
5054
5090
|
disposable.dispose();
|
|
5055
5091
|
value.dispose();
|
|
5056
5092
|
value.element.remove();
|
|
5093
|
+
this.updateClassnames();
|
|
5057
5094
|
}
|
|
5058
5095
|
setActivePanel(panel) {
|
|
5059
5096
|
this.tabs.forEach((tab) => {
|
|
@@ -5122,25 +5159,37 @@ class TabsContainer extends CompositeDisposable {
|
|
|
5122
5159
|
}
|
|
5123
5160
|
this.tabs = [];
|
|
5124
5161
|
}
|
|
5162
|
+
addTab(tab, index = this.tabs.length) {
|
|
5163
|
+
if (index < 0 || index > this.tabs.length) {
|
|
5164
|
+
throw new Error('invalid location');
|
|
5165
|
+
}
|
|
5166
|
+
this.tabContainer.insertBefore(tab.value.element, this.tabContainer.children[index]);
|
|
5167
|
+
this.tabs = [
|
|
5168
|
+
...this.tabs.slice(0, index),
|
|
5169
|
+
tab,
|
|
5170
|
+
...this.tabs.slice(index),
|
|
5171
|
+
];
|
|
5172
|
+
if (this.selectedIndex < 0) {
|
|
5173
|
+
this.selectedIndex = index;
|
|
5174
|
+
}
|
|
5175
|
+
this.updateClassnames();
|
|
5176
|
+
}
|
|
5177
|
+
updateClassnames() {
|
|
5178
|
+
toggleClass(this._element, 'dv-single-tab', this.size === 1);
|
|
5179
|
+
}
|
|
5125
5180
|
}
|
|
5126
5181
|
|
|
5127
|
-
class DockviewUnhandledDragOverEvent {
|
|
5128
|
-
get isAccepted() {
|
|
5129
|
-
return this._isAccepted;
|
|
5130
|
-
}
|
|
5182
|
+
class DockviewUnhandledDragOverEvent extends AcceptableEvent {
|
|
5131
5183
|
constructor(nativeEvent, target, position, getData, group) {
|
|
5184
|
+
super();
|
|
5132
5185
|
this.nativeEvent = nativeEvent;
|
|
5133
5186
|
this.target = target;
|
|
5134
5187
|
this.position = position;
|
|
5135
5188
|
this.getData = getData;
|
|
5136
5189
|
this.group = group;
|
|
5137
|
-
this._isAccepted = false;
|
|
5138
|
-
}
|
|
5139
|
-
accept() {
|
|
5140
|
-
this._isAccepted = true;
|
|
5141
5190
|
}
|
|
5142
5191
|
}
|
|
5143
|
-
const
|
|
5192
|
+
const PROPERTY_KEYS_DOCKVIEW = (() => {
|
|
5144
5193
|
/**
|
|
5145
5194
|
* by readong the keys from an empty value object TypeScript will error
|
|
5146
5195
|
* when we add or remove new properties to `DockviewOptions`
|
|
@@ -7663,10 +7712,6 @@ class DockviewComponent extends BaseGrid {
|
|
|
7663
7712
|
this._api = new DockviewApi(this);
|
|
7664
7713
|
this.updateWatermark();
|
|
7665
7714
|
}
|
|
7666
|
-
dispose() {
|
|
7667
|
-
this.clear(); // explicitly clear the layout before cleaning up
|
|
7668
|
-
super.dispose();
|
|
7669
|
-
}
|
|
7670
7715
|
setVisible(panel, visible) {
|
|
7671
7716
|
switch (panel.api.location.type) {
|
|
7672
7717
|
case 'grid':
|
|
@@ -7850,30 +7895,29 @@ class DockviewComponent extends BaseGrid {
|
|
|
7850
7895
|
}
|
|
7851
7896
|
}
|
|
7852
7897
|
else if (this.getPanel(group.id)) {
|
|
7853
|
-
|
|
7898
|
+
group.model.renderContainer =
|
|
7899
|
+
this.overlayRenderContainer;
|
|
7900
|
+
returnedGroup = group;
|
|
7854
7901
|
if (floatingBox) {
|
|
7855
|
-
this.addFloatingGroup(
|
|
7902
|
+
this.addFloatingGroup(group, {
|
|
7856
7903
|
height: floatingBox.height,
|
|
7857
7904
|
width: floatingBox.width,
|
|
7858
7905
|
position: floatingBox,
|
|
7859
7906
|
});
|
|
7860
7907
|
}
|
|
7861
7908
|
else {
|
|
7862
|
-
this.doRemoveGroup(
|
|
7909
|
+
this.doRemoveGroup(group, {
|
|
7863
7910
|
skipDispose: true,
|
|
7864
7911
|
skipActive: true,
|
|
7865
7912
|
skipPopoutReturn: true,
|
|
7866
7913
|
});
|
|
7867
|
-
|
|
7868
|
-
this.overlayRenderContainer;
|
|
7869
|
-
removedGroup.model.location = { type: 'grid' };
|
|
7870
|
-
returnedGroup = removedGroup;
|
|
7914
|
+
group.model.location = { type: 'grid' };
|
|
7871
7915
|
this.movingLock(() => {
|
|
7872
7916
|
// suppress group add events since the group already exists
|
|
7873
|
-
this.doAddGroup(
|
|
7917
|
+
this.doAddGroup(group, [0]);
|
|
7874
7918
|
});
|
|
7875
7919
|
}
|
|
7876
|
-
this.doSetGroupAndPanelActive(
|
|
7920
|
+
this.doSetGroupAndPanelActive(group);
|
|
7877
7921
|
}
|
|
7878
7922
|
}));
|
|
7879
7923
|
this._popoutGroups.push(value);
|
|
@@ -9014,31 +9058,6 @@ class DockviewComponent extends BaseGrid {
|
|
|
9014
9058
|
}
|
|
9015
9059
|
}
|
|
9016
9060
|
|
|
9017
|
-
function createComponent(id, componentName, components = {}, frameworkComponents = {}, createFrameworkComponent, fallback) {
|
|
9018
|
-
const Component = typeof componentName === 'string'
|
|
9019
|
-
? components[componentName]
|
|
9020
|
-
: undefined;
|
|
9021
|
-
const FrameworkComponent = typeof componentName === 'string'
|
|
9022
|
-
? frameworkComponents[componentName]
|
|
9023
|
-
: undefined;
|
|
9024
|
-
if (Component && FrameworkComponent) {
|
|
9025
|
-
throw new Error(`Cannot create '${id}'. component '${componentName}' registered as both a component and frameworkComponent`);
|
|
9026
|
-
}
|
|
9027
|
-
if (FrameworkComponent) {
|
|
9028
|
-
if (!createFrameworkComponent) {
|
|
9029
|
-
throw new Error(`Cannot create '${id}' for framework component '${componentName}'. you must register a frameworkPanelWrapper to use framework components`);
|
|
9030
|
-
}
|
|
9031
|
-
return createFrameworkComponent.createComponent(id, componentName, FrameworkComponent);
|
|
9032
|
-
}
|
|
9033
|
-
if (!Component) {
|
|
9034
|
-
if (fallback) {
|
|
9035
|
-
return fallback();
|
|
9036
|
-
}
|
|
9037
|
-
throw new Error(`Cannot create '${id}', no component '${componentName}' provided`);
|
|
9038
|
-
}
|
|
9039
|
-
return new Component(id, componentName);
|
|
9040
|
-
}
|
|
9041
|
-
|
|
9042
9061
|
class GridviewComponent extends BaseGrid {
|
|
9043
9062
|
get orientation() {
|
|
9044
9063
|
return this.gridview.orientation;
|
|
@@ -9056,10 +9075,13 @@ class GridviewComponent extends BaseGrid {
|
|
|
9056
9075
|
this._deserializer = value;
|
|
9057
9076
|
}
|
|
9058
9077
|
constructor(parentElement, options) {
|
|
9078
|
+
var _a;
|
|
9059
9079
|
super(parentElement, {
|
|
9060
|
-
proportionalLayout: options.proportionalLayout,
|
|
9080
|
+
proportionalLayout: (_a = options.proportionalLayout) !== null && _a !== void 0 ? _a : true,
|
|
9061
9081
|
orientation: options.orientation,
|
|
9062
|
-
styles: options.
|
|
9082
|
+
styles: options.hideBorders
|
|
9083
|
+
? { separatorBorder: 'transparent' }
|
|
9084
|
+
: undefined,
|
|
9063
9085
|
disableAutoResizing: options.disableAutoResizing,
|
|
9064
9086
|
className: options.className,
|
|
9065
9087
|
});
|
|
@@ -9079,12 +9101,6 @@ class GridviewComponent extends BaseGrid {
|
|
|
9079
9101
|
}), this.onDidActiveChange((event) => {
|
|
9080
9102
|
this._onDidActiveGroupChange.fire(event);
|
|
9081
9103
|
}));
|
|
9082
|
-
if (!this.options.components) {
|
|
9083
|
-
this.options.components = {};
|
|
9084
|
-
}
|
|
9085
|
-
if (!this.options.frameworkComponents) {
|
|
9086
|
-
this.options.frameworkComponents = {};
|
|
9087
|
-
}
|
|
9088
9104
|
}
|
|
9089
9105
|
updateOptions(options) {
|
|
9090
9106
|
super.updateOptions(options);
|
|
@@ -9134,14 +9150,11 @@ class GridviewComponent extends BaseGrid {
|
|
|
9134
9150
|
const height = this.height;
|
|
9135
9151
|
this.gridview.deserialize(grid, {
|
|
9136
9152
|
fromJSON: (node) => {
|
|
9137
|
-
var _a, _b;
|
|
9138
9153
|
const { data } = node;
|
|
9139
|
-
const view =
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
|
|
9143
|
-
}
|
|
9144
|
-
: undefined);
|
|
9154
|
+
const view = this.options.createComponent({
|
|
9155
|
+
id: data.id,
|
|
9156
|
+
name: data.component,
|
|
9157
|
+
});
|
|
9145
9158
|
queue.push(() => view.init({
|
|
9146
9159
|
params: data.params,
|
|
9147
9160
|
minimumWidth: data.minimumWidth,
|
|
@@ -9219,7 +9232,7 @@ class GridviewComponent extends BaseGrid {
|
|
|
9219
9232
|
this.doAddGroup(removedPanel, relativeLocation, options.size);
|
|
9220
9233
|
}
|
|
9221
9234
|
addPanel(options) {
|
|
9222
|
-
var _a, _b, _c, _d
|
|
9235
|
+
var _a, _b, _c, _d;
|
|
9223
9236
|
let relativeLocation = (_a = options.location) !== null && _a !== void 0 ? _a : [0];
|
|
9224
9237
|
if ((_b = options.position) === null || _b === void 0 ? void 0 : _b.referencePanel) {
|
|
9225
9238
|
const referenceGroup = (_c = this._groups.get(options.position.referencePanel)) === null || _c === void 0 ? void 0 : _c.value;
|
|
@@ -9235,14 +9248,12 @@ class GridviewComponent extends BaseGrid {
|
|
|
9235
9248
|
relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
|
|
9236
9249
|
}
|
|
9237
9250
|
}
|
|
9238
|
-
const view =
|
|
9239
|
-
|
|
9240
|
-
|
|
9241
|
-
|
|
9242
|
-
}
|
|
9243
|
-
: undefined);
|
|
9251
|
+
const view = this.options.createComponent({
|
|
9252
|
+
id: options.id,
|
|
9253
|
+
name: options.component,
|
|
9254
|
+
});
|
|
9244
9255
|
view.init({
|
|
9245
|
-
params: (
|
|
9256
|
+
params: (_d = options.params) !== null && _d !== void 0 ? _d : {},
|
|
9246
9257
|
minimumWidth: options.minimumWidth,
|
|
9247
9258
|
maximumWidth: options.maximumWidth,
|
|
9248
9259
|
minimumHeight: options.minimumHeight,
|
|
@@ -9370,12 +9381,6 @@ class SplitviewComponent extends Resizable {
|
|
|
9370
9381
|
this._classNames = new Classnames(this.element);
|
|
9371
9382
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9372
9383
|
this._options = options;
|
|
9373
|
-
if (!options.components) {
|
|
9374
|
-
options.components = {};
|
|
9375
|
-
}
|
|
9376
|
-
if (!options.frameworkComponents) {
|
|
9377
|
-
options.frameworkComponents = {};
|
|
9378
|
-
}
|
|
9379
9384
|
this.splitview = new Splitview(this.element, options);
|
|
9380
9385
|
this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
|
|
9381
9386
|
}
|
|
@@ -9438,18 +9443,17 @@ class SplitviewComponent extends Resizable {
|
|
|
9438
9443
|
return this.panels.find((view) => view.id === id);
|
|
9439
9444
|
}
|
|
9440
9445
|
addPanel(options) {
|
|
9441
|
-
var _a
|
|
9446
|
+
var _a;
|
|
9442
9447
|
if (this._panels.has(options.id)) {
|
|
9443
9448
|
throw new Error(`panel ${options.id} already exists`);
|
|
9444
9449
|
}
|
|
9445
|
-
const view =
|
|
9446
|
-
|
|
9447
|
-
|
|
9448
|
-
|
|
9449
|
-
: undefined);
|
|
9450
|
+
const view = this.options.createComponent({
|
|
9451
|
+
id: options.id,
|
|
9452
|
+
name: options.component,
|
|
9453
|
+
});
|
|
9450
9454
|
view.orientation = this.splitview.orientation;
|
|
9451
9455
|
view.init({
|
|
9452
|
-
params: (
|
|
9456
|
+
params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
|
|
9453
9457
|
minimumSize: options.minimumSize,
|
|
9454
9458
|
maximumSize: options.maximumSize,
|
|
9455
9459
|
snap: options.snap,
|
|
@@ -9511,17 +9515,14 @@ class SplitviewComponent extends Resizable {
|
|
|
9511
9515
|
descriptor: {
|
|
9512
9516
|
size,
|
|
9513
9517
|
views: views.map((view) => {
|
|
9514
|
-
var _a, _b;
|
|
9515
9518
|
const data = view.data;
|
|
9516
9519
|
if (this._panels.has(data.id)) {
|
|
9517
9520
|
throw new Error(`panel ${data.id} already exists`);
|
|
9518
9521
|
}
|
|
9519
|
-
const panel =
|
|
9520
|
-
|
|
9521
|
-
|
|
9522
|
-
|
|
9523
|
-
}
|
|
9524
|
-
: undefined);
|
|
9522
|
+
const panel = this.options.createComponent({
|
|
9523
|
+
id: data.id,
|
|
9524
|
+
name: data.component,
|
|
9525
|
+
});
|
|
9525
9526
|
queue.push(() => {
|
|
9526
9527
|
var _a;
|
|
9527
9528
|
panel.init({
|
|
@@ -9704,16 +9705,12 @@ class PaneviewComponent extends Resizable {
|
|
|
9704
9705
|
this.onDidAddView = this._onDidAddView.event;
|
|
9705
9706
|
this._onDidRemoveView = new Emitter();
|
|
9706
9707
|
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
9707
|
-
this.
|
|
9708
|
+
this._onUnhandledDragOverEvent = new Emitter();
|
|
9709
|
+
this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
|
|
9710
|
+
this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView, this._onUnhandledDragOverEvent);
|
|
9708
9711
|
this._classNames = new Classnames(this.element);
|
|
9709
9712
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9710
9713
|
this._options = options;
|
|
9711
|
-
if (!options.components) {
|
|
9712
|
-
options.components = {};
|
|
9713
|
-
}
|
|
9714
|
-
if (!options.frameworkComponents) {
|
|
9715
|
-
options.frameworkComponents = {};
|
|
9716
|
-
}
|
|
9717
9714
|
this.paneview = new Paneview(this.element, {
|
|
9718
9715
|
// only allow paneview in the vertical orientation for now
|
|
9719
9716
|
orientation: exports.Orientation.VERTICAL,
|
|
@@ -9738,22 +9735,19 @@ class PaneviewComponent extends Resizable {
|
|
|
9738
9735
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
9739
9736
|
}
|
|
9740
9737
|
addPanel(options) {
|
|
9741
|
-
var _a
|
|
9742
|
-
const body =
|
|
9743
|
-
|
|
9744
|
-
|
|
9745
|
-
|
|
9746
|
-
: undefined);
|
|
9738
|
+
var _a;
|
|
9739
|
+
const body = this.options.createComponent({
|
|
9740
|
+
id: options.id,
|
|
9741
|
+
name: options.component,
|
|
9742
|
+
});
|
|
9747
9743
|
let header;
|
|
9748
|
-
if (options.headerComponent) {
|
|
9749
|
-
header =
|
|
9750
|
-
|
|
9751
|
-
|
|
9752
|
-
|
|
9753
|
-
}
|
|
9754
|
-
: undefined);
|
|
9744
|
+
if (options.headerComponent && this.options.createHeaderComponent) {
|
|
9745
|
+
header = this.options.createHeaderComponent({
|
|
9746
|
+
id: options.id,
|
|
9747
|
+
name: options.headerComponent,
|
|
9748
|
+
});
|
|
9755
9749
|
}
|
|
9756
|
-
|
|
9750
|
+
if (!header) {
|
|
9757
9751
|
header = new DefaultHeader();
|
|
9758
9752
|
}
|
|
9759
9753
|
const view = new PaneFramework({
|
|
@@ -9771,7 +9765,7 @@ class PaneviewComponent extends Resizable {
|
|
|
9771
9765
|
const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
|
|
9772
9766
|
const index = typeof options.index === 'number' ? options.index : undefined;
|
|
9773
9767
|
view.init({
|
|
9774
|
-
params: (
|
|
9768
|
+
params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
|
|
9775
9769
|
minimumBodySize: options.minimumBodySize,
|
|
9776
9770
|
maximumBodySize: options.maximumBodySize,
|
|
9777
9771
|
isExpanded: options.isExpanded,
|
|
@@ -9836,24 +9830,20 @@ class PaneviewComponent extends Resizable {
|
|
|
9836
9830
|
descriptor: {
|
|
9837
9831
|
size,
|
|
9838
9832
|
views: views.map((view) => {
|
|
9839
|
-
var _a, _b, _c, _d;
|
|
9840
9833
|
const data = view.data;
|
|
9841
|
-
const body =
|
|
9842
|
-
|
|
9843
|
-
|
|
9844
|
-
|
|
9845
|
-
}
|
|
9846
|
-
: undefined);
|
|
9834
|
+
const body = this.options.createComponent({
|
|
9835
|
+
id: data.id,
|
|
9836
|
+
name: data.component,
|
|
9837
|
+
});
|
|
9847
9838
|
let header;
|
|
9848
|
-
if (data.headerComponent
|
|
9849
|
-
|
|
9850
|
-
|
|
9851
|
-
|
|
9852
|
-
|
|
9853
|
-
|
|
9854
|
-
: undefined);
|
|
9839
|
+
if (data.headerComponent &&
|
|
9840
|
+
this.options.createHeaderComponent) {
|
|
9841
|
+
header = this.options.createHeaderComponent({
|
|
9842
|
+
id: data.id,
|
|
9843
|
+
name: data.headerComponent,
|
|
9844
|
+
});
|
|
9855
9845
|
}
|
|
9856
|
-
|
|
9846
|
+
if (!header) {
|
|
9857
9847
|
header = new DefaultHeader();
|
|
9858
9848
|
}
|
|
9859
9849
|
const panel = new PaneFramework({
|
|
@@ -9901,9 +9891,11 @@ class PaneviewComponent extends Resizable {
|
|
|
9901
9891
|
this.paneview.dispose();
|
|
9902
9892
|
}
|
|
9903
9893
|
doAddPanel(panel) {
|
|
9904
|
-
const disposable = panel.onDidDrop((event) => {
|
|
9894
|
+
const disposable = new CompositeDisposable(panel.onDidDrop((event) => {
|
|
9905
9895
|
this._onDidDrop.fire(event);
|
|
9906
|
-
})
|
|
9896
|
+
}), panel.onUnhandledDragOverEvent((event) => {
|
|
9897
|
+
this._onUnhandledDragOverEvent.fire(event);
|
|
9898
|
+
}));
|
|
9907
9899
|
this._viewDisposables.set(panel.id, disposable);
|
|
9908
9900
|
}
|
|
9909
9901
|
doRemovePanel(panel) {
|
|
@@ -10065,7 +10057,10 @@ exports.Gridview = Gridview;
|
|
|
10065
10057
|
exports.GridviewApi = GridviewApi;
|
|
10066
10058
|
exports.GridviewComponent = GridviewComponent;
|
|
10067
10059
|
exports.GridviewPanel = GridviewPanel;
|
|
10068
|
-
exports.
|
|
10060
|
+
exports.PROPERTY_KEYS_DOCKVIEW = PROPERTY_KEYS_DOCKVIEW;
|
|
10061
|
+
exports.PROPERTY_KEYS_GRIDVIEW = PROPERTY_KEYS_GRIDVIEW;
|
|
10062
|
+
exports.PROPERTY_KEYS_PANEVIEW = PROPERTY_KEYS_PANEVIEW;
|
|
10063
|
+
exports.PROPERTY_KEYS_SPLITVIEW = PROPERTY_KEYS_SPLITVIEW;
|
|
10069
10064
|
exports.PaneFramework = PaneFramework;
|
|
10070
10065
|
exports.PaneTransfer = PaneTransfer;
|
|
10071
10066
|
exports.PanelTransfer = PanelTransfer;
|
|
@@ -10073,6 +10068,7 @@ exports.Paneview = Paneview;
|
|
|
10073
10068
|
exports.PaneviewApi = PaneviewApi;
|
|
10074
10069
|
exports.PaneviewComponent = PaneviewComponent;
|
|
10075
10070
|
exports.PaneviewPanel = PaneviewPanel;
|
|
10071
|
+
exports.PaneviewUnhandledDragOverEvent = PaneviewUnhandledDragOverEvent;
|
|
10076
10072
|
exports.Splitview = Splitview;
|
|
10077
10073
|
exports.SplitviewApi = SplitviewApi;
|
|
10078
10074
|
exports.SplitviewComponent = SplitviewComponent;
|