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
|
@@ -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
|
*/
|
|
@@ -103,6 +103,17 @@
|
|
|
103
103
|
this._defaultPrevented = true;
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
+
class AcceptableEvent {
|
|
107
|
+
constructor() {
|
|
108
|
+
this._isAccepted = false;
|
|
109
|
+
}
|
|
110
|
+
get isAccepted() {
|
|
111
|
+
return this._isAccepted;
|
|
112
|
+
}
|
|
113
|
+
accept() {
|
|
114
|
+
this._isAccepted = true;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
106
117
|
class LeakageMonitor {
|
|
107
118
|
constructor() {
|
|
108
119
|
this.events = new Map();
|
|
@@ -1494,6 +1505,23 @@
|
|
|
1494
1505
|
}
|
|
1495
1506
|
}
|
|
1496
1507
|
|
|
1508
|
+
const PROPERTY_KEYS_SPLITVIEW = (() => {
|
|
1509
|
+
/**
|
|
1510
|
+
* by readong the keys from an empty value object TypeScript will error
|
|
1511
|
+
* when we add or remove new properties to `DockviewOptions`
|
|
1512
|
+
*/
|
|
1513
|
+
const properties = {
|
|
1514
|
+
orientation: undefined,
|
|
1515
|
+
descriptor: undefined,
|
|
1516
|
+
proportionalLayout: undefined,
|
|
1517
|
+
styles: undefined,
|
|
1518
|
+
margin: undefined,
|
|
1519
|
+
disableAutoResizing: undefined,
|
|
1520
|
+
className: undefined,
|
|
1521
|
+
};
|
|
1522
|
+
return Object.keys(properties);
|
|
1523
|
+
})();
|
|
1524
|
+
|
|
1497
1525
|
class Paneview extends CompositeDisposable {
|
|
1498
1526
|
get onDidAddView() {
|
|
1499
1527
|
return this.splitview.onDidAddView;
|
|
@@ -2623,6 +2651,21 @@
|
|
|
2623
2651
|
}
|
|
2624
2652
|
}
|
|
2625
2653
|
|
|
2654
|
+
const PROPERTY_KEYS_GRIDVIEW = (() => {
|
|
2655
|
+
/**
|
|
2656
|
+
* by readong the keys from an empty value object TypeScript will error
|
|
2657
|
+
* when we add or remove new properties to `DockviewOptions`
|
|
2658
|
+
*/
|
|
2659
|
+
const properties = {
|
|
2660
|
+
disableAutoResizing: undefined,
|
|
2661
|
+
proportionalLayout: undefined,
|
|
2662
|
+
orientation: undefined,
|
|
2663
|
+
hideBorders: undefined,
|
|
2664
|
+
className: undefined,
|
|
2665
|
+
};
|
|
2666
|
+
return Object.keys(properties);
|
|
2667
|
+
})();
|
|
2668
|
+
|
|
2626
2669
|
class Resizable extends CompositeDisposable {
|
|
2627
2670
|
get element() {
|
|
2628
2671
|
return this._element;
|
|
@@ -3100,15 +3143,10 @@
|
|
|
3100
3143
|
* Invoked when a Drag'n'Drop event occurs that the component was unable to handle. Exposed for custom Drag'n'Drop functionality.
|
|
3101
3144
|
*/
|
|
3102
3145
|
get onDidDrop() {
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
emitter.dispose = () => {
|
|
3108
|
-
disposable.dispose();
|
|
3109
|
-
emitter.dispose();
|
|
3110
|
-
};
|
|
3111
|
-
return emitter.event;
|
|
3146
|
+
return this.component.onDidDrop;
|
|
3147
|
+
}
|
|
3148
|
+
get onUnhandledDragOverEvent() {
|
|
3149
|
+
return this.component.onUnhandledDragOverEvent;
|
|
3112
3150
|
}
|
|
3113
3151
|
constructor(component) {
|
|
3114
3152
|
this.component = component;
|
|
@@ -4035,6 +4073,28 @@
|
|
|
4035
4073
|
return 'center';
|
|
4036
4074
|
}
|
|
4037
4075
|
|
|
4076
|
+
const PROPERTY_KEYS_PANEVIEW = (() => {
|
|
4077
|
+
/**
|
|
4078
|
+
* by readong the keys from an empty value object TypeScript will error
|
|
4079
|
+
* when we add or remove new properties to `DockviewOptions`
|
|
4080
|
+
*/
|
|
4081
|
+
const properties = {
|
|
4082
|
+
disableAutoResizing: undefined,
|
|
4083
|
+
disableDnd: undefined,
|
|
4084
|
+
className: undefined,
|
|
4085
|
+
};
|
|
4086
|
+
return Object.keys(properties);
|
|
4087
|
+
})();
|
|
4088
|
+
class PaneviewUnhandledDragOverEvent extends AcceptableEvent {
|
|
4089
|
+
constructor(nativeEvent, position, getData, panel) {
|
|
4090
|
+
super();
|
|
4091
|
+
this.nativeEvent = nativeEvent;
|
|
4092
|
+
this.position = position;
|
|
4093
|
+
this.getData = getData;
|
|
4094
|
+
this.panel = panel;
|
|
4095
|
+
}
|
|
4096
|
+
}
|
|
4097
|
+
|
|
4038
4098
|
class WillFocusEvent extends DockviewEvent {
|
|
4039
4099
|
constructor() {
|
|
4040
4100
|
super();
|
|
@@ -4458,6 +4518,9 @@
|
|
|
4458
4518
|
this.accessor = accessor;
|
|
4459
4519
|
this._onDidDrop = new Emitter();
|
|
4460
4520
|
this.onDidDrop = this._onDidDrop.event;
|
|
4521
|
+
this._onUnhandledDragOverEvent = new Emitter();
|
|
4522
|
+
this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
|
|
4523
|
+
this.addDisposables(this._onDidDrop, this._onUnhandledDragOverEvent);
|
|
4461
4524
|
if (!disableDnd) {
|
|
4462
4525
|
this.initDragFeatures();
|
|
4463
4526
|
}
|
|
@@ -4484,7 +4547,7 @@
|
|
|
4484
4547
|
overlayModel: {
|
|
4485
4548
|
activationSize: { type: 'percentage', value: 50 },
|
|
4486
4549
|
},
|
|
4487
|
-
canDisplayOverlay: (event) => {
|
|
4550
|
+
canDisplayOverlay: (event, position) => {
|
|
4488
4551
|
const data = getPaneData();
|
|
4489
4552
|
if (data) {
|
|
4490
4553
|
if (data.paneId !== this.id &&
|
|
@@ -4492,14 +4555,9 @@
|
|
|
4492
4555
|
return true;
|
|
4493
4556
|
}
|
|
4494
4557
|
}
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
getData: getPaneData,
|
|
4499
|
-
panel: this,
|
|
4500
|
-
});
|
|
4501
|
-
}
|
|
4502
|
-
return false;
|
|
4558
|
+
const firedEvent = new PaneviewUnhandledDragOverEvent(event, position, getPaneData, this);
|
|
4559
|
+
this._onUnhandledDragOverEvent.fire(firedEvent);
|
|
4560
|
+
return firedEvent.isAccepted;
|
|
4503
4561
|
},
|
|
4504
4562
|
});
|
|
4505
4563
|
this.addDisposables(this._onDidDrop, this.handler, this.target, this.target.onDrop((event) => {
|
|
@@ -4954,15 +5012,7 @@
|
|
|
4954
5012
|
this._element.appendChild(this.leftActionsContainer);
|
|
4955
5013
|
this._element.appendChild(this.voidContainer.element);
|
|
4956
5014
|
this._element.appendChild(this.rightActionsContainer);
|
|
4957
|
-
this.addDisposables(this.
|
|
4958
|
-
if (e.api.group === this.group) {
|
|
4959
|
-
toggleClass(this._element, 'dv-single-tab', this.size === 1);
|
|
4960
|
-
}
|
|
4961
|
-
}), this.accessor.onDidRemovePanel((e) => {
|
|
4962
|
-
if (e.api.group === this.group) {
|
|
4963
|
-
toggleClass(this._element, 'dv-single-tab', this.size === 1);
|
|
4964
|
-
}
|
|
4965
|
-
}), this._onWillShowOverlay, this._onDrop, this._onTabDragStart, this._onGroupDragStart, this.voidContainer, this.voidContainer.onDragStart((event) => {
|
|
5015
|
+
this.addDisposables(this._onWillShowOverlay, this._onDrop, this._onTabDragStart, this._onGroupDragStart, this.voidContainer, this.voidContainer.onDragStart((event) => {
|
|
4966
5016
|
this._onGroupDragStart.fire({
|
|
4967
5017
|
nativeEvent: event,
|
|
4968
5018
|
group: this.group,
|
|
@@ -5007,20 +5057,6 @@
|
|
|
5007
5057
|
setActive(_isGroupActive) {
|
|
5008
5058
|
// noop
|
|
5009
5059
|
}
|
|
5010
|
-
addTab(tab, index = this.tabs.length) {
|
|
5011
|
-
if (index < 0 || index > this.tabs.length) {
|
|
5012
|
-
throw new Error('invalid location');
|
|
5013
|
-
}
|
|
5014
|
-
this.tabContainer.insertBefore(tab.value.element, this.tabContainer.children[index]);
|
|
5015
|
-
this.tabs = [
|
|
5016
|
-
...this.tabs.slice(0, index),
|
|
5017
|
-
tab,
|
|
5018
|
-
...this.tabs.slice(index),
|
|
5019
|
-
];
|
|
5020
|
-
if (this.selectedIndex < 0) {
|
|
5021
|
-
this.selectedIndex = index;
|
|
5022
|
-
}
|
|
5023
|
-
}
|
|
5024
5060
|
delete(id) {
|
|
5025
5061
|
const index = this.tabs.findIndex((tab) => tab.value.panel.id === id);
|
|
5026
5062
|
const tabToRemove = this.tabs.splice(index, 1)[0];
|
|
@@ -5028,6 +5064,7 @@
|
|
|
5028
5064
|
disposable.dispose();
|
|
5029
5065
|
value.dispose();
|
|
5030
5066
|
value.element.remove();
|
|
5067
|
+
this.updateClassnames();
|
|
5031
5068
|
}
|
|
5032
5069
|
setActivePanel(panel) {
|
|
5033
5070
|
this.tabs.forEach((tab) => {
|
|
@@ -5096,25 +5133,37 @@
|
|
|
5096
5133
|
}
|
|
5097
5134
|
this.tabs = [];
|
|
5098
5135
|
}
|
|
5136
|
+
addTab(tab, index = this.tabs.length) {
|
|
5137
|
+
if (index < 0 || index > this.tabs.length) {
|
|
5138
|
+
throw new Error('invalid location');
|
|
5139
|
+
}
|
|
5140
|
+
this.tabContainer.insertBefore(tab.value.element, this.tabContainer.children[index]);
|
|
5141
|
+
this.tabs = [
|
|
5142
|
+
...this.tabs.slice(0, index),
|
|
5143
|
+
tab,
|
|
5144
|
+
...this.tabs.slice(index),
|
|
5145
|
+
];
|
|
5146
|
+
if (this.selectedIndex < 0) {
|
|
5147
|
+
this.selectedIndex = index;
|
|
5148
|
+
}
|
|
5149
|
+
this.updateClassnames();
|
|
5150
|
+
}
|
|
5151
|
+
updateClassnames() {
|
|
5152
|
+
toggleClass(this._element, 'dv-single-tab', this.size === 1);
|
|
5153
|
+
}
|
|
5099
5154
|
}
|
|
5100
5155
|
|
|
5101
|
-
class DockviewUnhandledDragOverEvent {
|
|
5102
|
-
get isAccepted() {
|
|
5103
|
-
return this._isAccepted;
|
|
5104
|
-
}
|
|
5156
|
+
class DockviewUnhandledDragOverEvent extends AcceptableEvent {
|
|
5105
5157
|
constructor(nativeEvent, target, position, getData, group) {
|
|
5158
|
+
super();
|
|
5106
5159
|
this.nativeEvent = nativeEvent;
|
|
5107
5160
|
this.target = target;
|
|
5108
5161
|
this.position = position;
|
|
5109
5162
|
this.getData = getData;
|
|
5110
5163
|
this.group = group;
|
|
5111
|
-
this._isAccepted = false;
|
|
5112
|
-
}
|
|
5113
|
-
accept() {
|
|
5114
|
-
this._isAccepted = true;
|
|
5115
5164
|
}
|
|
5116
5165
|
}
|
|
5117
|
-
const
|
|
5166
|
+
const PROPERTY_KEYS_DOCKVIEW = (() => {
|
|
5118
5167
|
/**
|
|
5119
5168
|
* by readong the keys from an empty value object TypeScript will error
|
|
5120
5169
|
* when we add or remove new properties to `DockviewOptions`
|
|
@@ -8983,31 +9032,6 @@
|
|
|
8983
9032
|
}
|
|
8984
9033
|
}
|
|
8985
9034
|
|
|
8986
|
-
function createComponent(id, componentName, components = {}, frameworkComponents = {}, createFrameworkComponent, fallback) {
|
|
8987
|
-
const Component = typeof componentName === 'string'
|
|
8988
|
-
? components[componentName]
|
|
8989
|
-
: undefined;
|
|
8990
|
-
const FrameworkComponent = typeof componentName === 'string'
|
|
8991
|
-
? frameworkComponents[componentName]
|
|
8992
|
-
: undefined;
|
|
8993
|
-
if (Component && FrameworkComponent) {
|
|
8994
|
-
throw new Error(`Cannot create '${id}'. component '${componentName}' registered as both a component and frameworkComponent`);
|
|
8995
|
-
}
|
|
8996
|
-
if (FrameworkComponent) {
|
|
8997
|
-
if (!createFrameworkComponent) {
|
|
8998
|
-
throw new Error(`Cannot create '${id}' for framework component '${componentName}'. you must register a frameworkPanelWrapper to use framework components`);
|
|
8999
|
-
}
|
|
9000
|
-
return createFrameworkComponent.createComponent(id, componentName, FrameworkComponent);
|
|
9001
|
-
}
|
|
9002
|
-
if (!Component) {
|
|
9003
|
-
if (fallback) {
|
|
9004
|
-
return fallback();
|
|
9005
|
-
}
|
|
9006
|
-
throw new Error(`Cannot create '${id}', no component '${componentName}' provided`);
|
|
9007
|
-
}
|
|
9008
|
-
return new Component(id, componentName);
|
|
9009
|
-
}
|
|
9010
|
-
|
|
9011
9035
|
class GridviewComponent extends BaseGrid {
|
|
9012
9036
|
get orientation() {
|
|
9013
9037
|
return this.gridview.orientation;
|
|
@@ -9025,10 +9049,13 @@
|
|
|
9025
9049
|
this._deserializer = value;
|
|
9026
9050
|
}
|
|
9027
9051
|
constructor(parentElement, options) {
|
|
9052
|
+
var _a;
|
|
9028
9053
|
super(parentElement, {
|
|
9029
|
-
proportionalLayout: options.proportionalLayout,
|
|
9054
|
+
proportionalLayout: (_a = options.proportionalLayout) !== null && _a !== void 0 ? _a : true,
|
|
9030
9055
|
orientation: options.orientation,
|
|
9031
|
-
styles: options.
|
|
9056
|
+
styles: options.hideBorders
|
|
9057
|
+
? { separatorBorder: 'transparent' }
|
|
9058
|
+
: undefined,
|
|
9032
9059
|
disableAutoResizing: options.disableAutoResizing,
|
|
9033
9060
|
className: options.className,
|
|
9034
9061
|
});
|
|
@@ -9048,12 +9075,6 @@
|
|
|
9048
9075
|
}), this.onDidActiveChange((event) => {
|
|
9049
9076
|
this._onDidActiveGroupChange.fire(event);
|
|
9050
9077
|
}));
|
|
9051
|
-
if (!this.options.components) {
|
|
9052
|
-
this.options.components = {};
|
|
9053
|
-
}
|
|
9054
|
-
if (!this.options.frameworkComponents) {
|
|
9055
|
-
this.options.frameworkComponents = {};
|
|
9056
|
-
}
|
|
9057
9078
|
}
|
|
9058
9079
|
updateOptions(options) {
|
|
9059
9080
|
super.updateOptions(options);
|
|
@@ -9103,14 +9124,11 @@
|
|
|
9103
9124
|
const height = this.height;
|
|
9104
9125
|
this.gridview.deserialize(grid, {
|
|
9105
9126
|
fromJSON: (node) => {
|
|
9106
|
-
var _a, _b;
|
|
9107
9127
|
const { data } = node;
|
|
9108
|
-
const view =
|
|
9109
|
-
|
|
9110
|
-
|
|
9111
|
-
|
|
9112
|
-
}
|
|
9113
|
-
: undefined);
|
|
9128
|
+
const view = this.options.createComponent({
|
|
9129
|
+
id: data.id,
|
|
9130
|
+
name: data.component,
|
|
9131
|
+
});
|
|
9114
9132
|
queue.push(() => view.init({
|
|
9115
9133
|
params: data.params,
|
|
9116
9134
|
minimumWidth: data.minimumWidth,
|
|
@@ -9188,7 +9206,7 @@
|
|
|
9188
9206
|
this.doAddGroup(removedPanel, relativeLocation, options.size);
|
|
9189
9207
|
}
|
|
9190
9208
|
addPanel(options) {
|
|
9191
|
-
var _a, _b, _c, _d
|
|
9209
|
+
var _a, _b, _c, _d;
|
|
9192
9210
|
let relativeLocation = (_a = options.location) !== null && _a !== void 0 ? _a : [0];
|
|
9193
9211
|
if ((_b = options.position) === null || _b === void 0 ? void 0 : _b.referencePanel) {
|
|
9194
9212
|
const referenceGroup = (_c = this._groups.get(options.position.referencePanel)) === null || _c === void 0 ? void 0 : _c.value;
|
|
@@ -9204,14 +9222,12 @@
|
|
|
9204
9222
|
relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
|
|
9205
9223
|
}
|
|
9206
9224
|
}
|
|
9207
|
-
const view =
|
|
9208
|
-
|
|
9209
|
-
|
|
9210
|
-
|
|
9211
|
-
}
|
|
9212
|
-
: undefined);
|
|
9225
|
+
const view = this.options.createComponent({
|
|
9226
|
+
id: options.id,
|
|
9227
|
+
name: options.component,
|
|
9228
|
+
});
|
|
9213
9229
|
view.init({
|
|
9214
|
-
params: (
|
|
9230
|
+
params: (_d = options.params) !== null && _d !== void 0 ? _d : {},
|
|
9215
9231
|
minimumWidth: options.minimumWidth,
|
|
9216
9232
|
maximumWidth: options.maximumWidth,
|
|
9217
9233
|
minimumHeight: options.minimumHeight,
|
|
@@ -9339,12 +9355,6 @@
|
|
|
9339
9355
|
this._classNames = new Classnames(this.element);
|
|
9340
9356
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9341
9357
|
this._options = options;
|
|
9342
|
-
if (!options.components) {
|
|
9343
|
-
options.components = {};
|
|
9344
|
-
}
|
|
9345
|
-
if (!options.frameworkComponents) {
|
|
9346
|
-
options.frameworkComponents = {};
|
|
9347
|
-
}
|
|
9348
9358
|
this.splitview = new Splitview(this.element, options);
|
|
9349
9359
|
this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
|
|
9350
9360
|
}
|
|
@@ -9407,18 +9417,17 @@
|
|
|
9407
9417
|
return this.panels.find((view) => view.id === id);
|
|
9408
9418
|
}
|
|
9409
9419
|
addPanel(options) {
|
|
9410
|
-
var _a
|
|
9420
|
+
var _a;
|
|
9411
9421
|
if (this._panels.has(options.id)) {
|
|
9412
9422
|
throw new Error(`panel ${options.id} already exists`);
|
|
9413
9423
|
}
|
|
9414
|
-
const view =
|
|
9415
|
-
|
|
9416
|
-
|
|
9417
|
-
|
|
9418
|
-
: undefined);
|
|
9424
|
+
const view = this.options.createComponent({
|
|
9425
|
+
id: options.id,
|
|
9426
|
+
name: options.component,
|
|
9427
|
+
});
|
|
9419
9428
|
view.orientation = this.splitview.orientation;
|
|
9420
9429
|
view.init({
|
|
9421
|
-
params: (
|
|
9430
|
+
params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
|
|
9422
9431
|
minimumSize: options.minimumSize,
|
|
9423
9432
|
maximumSize: options.maximumSize,
|
|
9424
9433
|
snap: options.snap,
|
|
@@ -9480,17 +9489,14 @@
|
|
|
9480
9489
|
descriptor: {
|
|
9481
9490
|
size,
|
|
9482
9491
|
views: views.map((view) => {
|
|
9483
|
-
var _a, _b;
|
|
9484
9492
|
const data = view.data;
|
|
9485
9493
|
if (this._panels.has(data.id)) {
|
|
9486
9494
|
throw new Error(`panel ${data.id} already exists`);
|
|
9487
9495
|
}
|
|
9488
|
-
const panel =
|
|
9489
|
-
|
|
9490
|
-
|
|
9491
|
-
|
|
9492
|
-
}
|
|
9493
|
-
: undefined);
|
|
9496
|
+
const panel = this.options.createComponent({
|
|
9497
|
+
id: data.id,
|
|
9498
|
+
name: data.component,
|
|
9499
|
+
});
|
|
9494
9500
|
queue.push(() => {
|
|
9495
9501
|
var _a;
|
|
9496
9502
|
panel.init({
|
|
@@ -9673,16 +9679,12 @@
|
|
|
9673
9679
|
this.onDidAddView = this._onDidAddView.event;
|
|
9674
9680
|
this._onDidRemoveView = new Emitter();
|
|
9675
9681
|
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
9676
|
-
this.
|
|
9682
|
+
this._onUnhandledDragOverEvent = new Emitter();
|
|
9683
|
+
this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
|
|
9684
|
+
this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView, this._onUnhandledDragOverEvent);
|
|
9677
9685
|
this._classNames = new Classnames(this.element);
|
|
9678
9686
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9679
9687
|
this._options = options;
|
|
9680
|
-
if (!options.components) {
|
|
9681
|
-
options.components = {};
|
|
9682
|
-
}
|
|
9683
|
-
if (!options.frameworkComponents) {
|
|
9684
|
-
options.frameworkComponents = {};
|
|
9685
|
-
}
|
|
9686
9688
|
this.paneview = new Paneview(this.element, {
|
|
9687
9689
|
// only allow paneview in the vertical orientation for now
|
|
9688
9690
|
orientation: exports.Orientation.VERTICAL,
|
|
@@ -9707,22 +9709,19 @@
|
|
|
9707
9709
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
9708
9710
|
}
|
|
9709
9711
|
addPanel(options) {
|
|
9710
|
-
var _a
|
|
9711
|
-
const body =
|
|
9712
|
-
|
|
9713
|
-
|
|
9714
|
-
|
|
9715
|
-
: undefined);
|
|
9712
|
+
var _a;
|
|
9713
|
+
const body = this.options.createComponent({
|
|
9714
|
+
id: options.id,
|
|
9715
|
+
name: options.component,
|
|
9716
|
+
});
|
|
9716
9717
|
let header;
|
|
9717
|
-
if (options.headerComponent) {
|
|
9718
|
-
header =
|
|
9719
|
-
|
|
9720
|
-
|
|
9721
|
-
|
|
9722
|
-
}
|
|
9723
|
-
: undefined);
|
|
9718
|
+
if (options.headerComponent && this.options.createHeaderComponent) {
|
|
9719
|
+
header = this.options.createHeaderComponent({
|
|
9720
|
+
id: options.id,
|
|
9721
|
+
name: options.headerComponent,
|
|
9722
|
+
});
|
|
9724
9723
|
}
|
|
9725
|
-
|
|
9724
|
+
if (!header) {
|
|
9726
9725
|
header = new DefaultHeader();
|
|
9727
9726
|
}
|
|
9728
9727
|
const view = new PaneFramework({
|
|
@@ -9740,7 +9739,7 @@
|
|
|
9740
9739
|
const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
|
|
9741
9740
|
const index = typeof options.index === 'number' ? options.index : undefined;
|
|
9742
9741
|
view.init({
|
|
9743
|
-
params: (
|
|
9742
|
+
params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
|
|
9744
9743
|
minimumBodySize: options.minimumBodySize,
|
|
9745
9744
|
maximumBodySize: options.maximumBodySize,
|
|
9746
9745
|
isExpanded: options.isExpanded,
|
|
@@ -9805,24 +9804,20 @@
|
|
|
9805
9804
|
descriptor: {
|
|
9806
9805
|
size,
|
|
9807
9806
|
views: views.map((view) => {
|
|
9808
|
-
var _a, _b, _c, _d;
|
|
9809
9807
|
const data = view.data;
|
|
9810
|
-
const body =
|
|
9811
|
-
|
|
9812
|
-
|
|
9813
|
-
|
|
9814
|
-
}
|
|
9815
|
-
: undefined);
|
|
9808
|
+
const body = this.options.createComponent({
|
|
9809
|
+
id: data.id,
|
|
9810
|
+
name: data.component,
|
|
9811
|
+
});
|
|
9816
9812
|
let header;
|
|
9817
|
-
if (data.headerComponent
|
|
9818
|
-
|
|
9819
|
-
|
|
9820
|
-
|
|
9821
|
-
|
|
9822
|
-
|
|
9823
|
-
: undefined);
|
|
9813
|
+
if (data.headerComponent &&
|
|
9814
|
+
this.options.createHeaderComponent) {
|
|
9815
|
+
header = this.options.createHeaderComponent({
|
|
9816
|
+
id: data.id,
|
|
9817
|
+
name: data.headerComponent,
|
|
9818
|
+
});
|
|
9824
9819
|
}
|
|
9825
|
-
|
|
9820
|
+
if (!header) {
|
|
9826
9821
|
header = new DefaultHeader();
|
|
9827
9822
|
}
|
|
9828
9823
|
const panel = new PaneFramework({
|
|
@@ -9870,9 +9865,11 @@
|
|
|
9870
9865
|
this.paneview.dispose();
|
|
9871
9866
|
}
|
|
9872
9867
|
doAddPanel(panel) {
|
|
9873
|
-
const disposable = panel.onDidDrop((event) => {
|
|
9868
|
+
const disposable = new CompositeDisposable(panel.onDidDrop((event) => {
|
|
9874
9869
|
this._onDidDrop.fire(event);
|
|
9875
|
-
})
|
|
9870
|
+
}), panel.onUnhandledDragOverEvent((event) => {
|
|
9871
|
+
this._onUnhandledDragOverEvent.fire(event);
|
|
9872
|
+
}));
|
|
9876
9873
|
this._viewDisposables.set(panel.id, disposable);
|
|
9877
9874
|
}
|
|
9878
9875
|
doRemovePanel(panel) {
|
|
@@ -10034,7 +10031,10 @@
|
|
|
10034
10031
|
exports.GridviewApi = GridviewApi;
|
|
10035
10032
|
exports.GridviewComponent = GridviewComponent;
|
|
10036
10033
|
exports.GridviewPanel = GridviewPanel;
|
|
10037
|
-
exports.
|
|
10034
|
+
exports.PROPERTY_KEYS_DOCKVIEW = PROPERTY_KEYS_DOCKVIEW;
|
|
10035
|
+
exports.PROPERTY_KEYS_GRIDVIEW = PROPERTY_KEYS_GRIDVIEW;
|
|
10036
|
+
exports.PROPERTY_KEYS_PANEVIEW = PROPERTY_KEYS_PANEVIEW;
|
|
10037
|
+
exports.PROPERTY_KEYS_SPLITVIEW = PROPERTY_KEYS_SPLITVIEW;
|
|
10038
10038
|
exports.PaneFramework = PaneFramework;
|
|
10039
10039
|
exports.PaneTransfer = PaneTransfer;
|
|
10040
10040
|
exports.PanelTransfer = PanelTransfer;
|
|
@@ -10042,6 +10042,7 @@
|
|
|
10042
10042
|
exports.PaneviewApi = PaneviewApi;
|
|
10043
10043
|
exports.PaneviewComponent = PaneviewComponent;
|
|
10044
10044
|
exports.PaneviewPanel = PaneviewPanel;
|
|
10045
|
+
exports.PaneviewUnhandledDragOverEvent = PaneviewUnhandledDragOverEvent;
|
|
10045
10046
|
exports.Splitview = Splitview;
|
|
10046
10047
|
exports.SplitviewApi = SplitviewApi;
|
|
10047
10048
|
exports.SplitviewComponent = SplitviewComponent;
|