dockview-core 2.1.4 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/api/component.api.d.ts +4 -3
- package/dist/cjs/api/component.api.js +8 -22
- package/dist/cjs/dockview/components/titlebar/tabsContainer.d.ts +2 -1
- package/dist/cjs/dockview/components/titlebar/tabsContainer.js +30 -33
- package/dist/cjs/dockview/options.d.ts +4 -8
- package/dist/cjs/dockview/options.js +28 -20
- package/dist/cjs/events.d.ts +9 -0
- package/dist/cjs/events.js +18 -1
- package/dist/cjs/gridview/baseComponentGridview.js +1 -2
- package/dist/cjs/gridview/gridviewComponent.js +15 -24
- package/dist/cjs/gridview/options.d.ts +10 -12
- package/dist/cjs/gridview/options.js +15 -0
- package/dist/cjs/index.d.ts +4 -4
- package/dist/cjs/index.js +8 -1
- package/dist/cjs/paneview/defaultPaneviewHeader.d.ts +2 -2
- package/dist/cjs/paneview/draggablePaneviewPanel.d.ts +6 -2
- package/dist/cjs/paneview/draggablePaneviewPanel.js +8 -9
- package/dist/cjs/paneview/options.d.ts +25 -21
- package/dist/cjs/paneview/options.js +42 -0
- package/dist/cjs/paneview/paneviewComponent.d.ts +12 -15
- package/dist/cjs/paneview/paneviewComponent.js +30 -40
- package/dist/cjs/paneview/paneviewPanel.d.ts +3 -8
- package/dist/cjs/splitview/options.d.ts +7 -9
- package/dist/cjs/splitview/options.js +17 -0
- package/dist/cjs/splitview/splitview.d.ts +5 -5
- package/dist/cjs/splitview/splitviewComponent.js +10 -21
- package/dist/dockview-core.amd.js +161 -161
- package/dist/dockview-core.amd.js.map +1 -1
- package/dist/dockview-core.amd.min.js +2 -2
- package/dist/dockview-core.amd.min.js.map +1 -1
- package/dist/dockview-core.amd.min.noStyle.js +2 -2
- package/dist/dockview-core.amd.min.noStyle.js.map +1 -1
- package/dist/dockview-core.amd.noStyle.js +161 -161
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +161 -161
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +157 -161
- package/dist/dockview-core.esm.js.map +1 -1
- package/dist/dockview-core.esm.min.js +2 -2
- package/dist/dockview-core.esm.min.js.map +1 -1
- package/dist/dockview-core.js +161 -161
- package/dist/dockview-core.js.map +1 -1
- package/dist/dockview-core.min.js +2 -2
- package/dist/dockview-core.min.js.map +1 -1
- package/dist/dockview-core.min.noStyle.js +2 -2
- package/dist/dockview-core.min.noStyle.js.map +1 -1
- package/dist/dockview-core.noStyle.js +161 -161
- package/dist/dockview-core.noStyle.js.map +1 -1
- package/dist/esm/api/component.api.d.ts +4 -3
- package/dist/esm/api/component.api.js +4 -10
- package/dist/esm/dockview/components/titlebar/tabsContainer.d.ts +2 -1
- package/dist/esm/dockview/components/titlebar/tabsContainer.js +20 -23
- package/dist/esm/dockview/options.d.ts +4 -8
- package/dist/esm/dockview/options.js +4 -9
- package/dist/esm/events.d.ts +9 -0
- package/dist/esm/events.js +11 -0
- package/dist/esm/gridview/baseComponentGridview.js +1 -2
- package/dist/esm/gridview/gridviewComponent.js +15 -24
- package/dist/esm/gridview/options.d.ts +10 -12
- package/dist/esm/gridview/options.js +14 -1
- package/dist/esm/index.d.ts +4 -4
- package/dist/esm/index.js +3 -0
- package/dist/esm/paneview/defaultPaneviewHeader.d.ts +2 -2
- package/dist/esm/paneview/draggablePaneviewPanel.d.ts +6 -2
- package/dist/esm/paneview/draggablePaneviewPanel.js +8 -9
- package/dist/esm/paneview/options.d.ts +25 -21
- package/dist/esm/paneview/options.js +22 -1
- package/dist/esm/paneview/paneviewComponent.d.ts +12 -15
- package/dist/esm/paneview/paneviewComponent.js +30 -40
- package/dist/esm/paneview/paneviewPanel.d.ts +3 -8
- package/dist/esm/splitview/options.d.ts +7 -9
- package/dist/esm/splitview/options.js +16 -1
- package/dist/esm/splitview/splitview.d.ts +5 -5
- package/dist/esm/splitview/splitviewComponent.js +10 -21
- package/package.json +1 -1
- package/dist/cjs/panel/componentFactory.d.ts +0 -11
- package/dist/cjs/panel/componentFactory.js +0 -30
- package/dist/esm/panel/componentFactory.d.ts +0 -11
- package/dist/esm/panel/componentFactory.js +0 -24
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-core
|
|
3
|
-
* @version
|
|
3
|
+
* @version 3.0.1
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -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;
|
|
@@ -2732,7 +2775,7 @@
|
|
|
2732
2775
|
}
|
|
2733
2776
|
constructor(parentElement, options) {
|
|
2734
2777
|
var _a;
|
|
2735
|
-
super(
|
|
2778
|
+
super(parentElement, options.disableAutoResizing);
|
|
2736
2779
|
this._id = nextLayoutId$1.next();
|
|
2737
2780
|
this._groups = new Map();
|
|
2738
2781
|
this._onDidRemove = new Emitter();
|
|
@@ -2751,7 +2794,6 @@
|
|
|
2751
2794
|
this.element.style.width = '100%';
|
|
2752
2795
|
this._classNames = new Classnames(this.element);
|
|
2753
2796
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
2754
|
-
parentElement.appendChild(this.element);
|
|
2755
2797
|
this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation, options.locked, options.margin);
|
|
2756
2798
|
this.gridview.locked = !!options.locked;
|
|
2757
2799
|
this.element.appendChild(this.gridview.element);
|
|
@@ -3100,15 +3142,10 @@
|
|
|
3100
3142
|
* Invoked when a Drag'n'Drop event occurs that the component was unable to handle. Exposed for custom Drag'n'Drop functionality.
|
|
3101
3143
|
*/
|
|
3102
3144
|
get onDidDrop() {
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
emitter.dispose = () => {
|
|
3108
|
-
disposable.dispose();
|
|
3109
|
-
emitter.dispose();
|
|
3110
|
-
};
|
|
3111
|
-
return emitter.event;
|
|
3145
|
+
return this.component.onDidDrop;
|
|
3146
|
+
}
|
|
3147
|
+
get onUnhandledDragOverEvent() {
|
|
3148
|
+
return this.component.onUnhandledDragOverEvent;
|
|
3112
3149
|
}
|
|
3113
3150
|
constructor(component) {
|
|
3114
3151
|
this.component = component;
|
|
@@ -4035,6 +4072,28 @@
|
|
|
4035
4072
|
return 'center';
|
|
4036
4073
|
}
|
|
4037
4074
|
|
|
4075
|
+
const PROPERTY_KEYS_PANEVIEW = (() => {
|
|
4076
|
+
/**
|
|
4077
|
+
* by readong the keys from an empty value object TypeScript will error
|
|
4078
|
+
* when we add or remove new properties to `DockviewOptions`
|
|
4079
|
+
*/
|
|
4080
|
+
const properties = {
|
|
4081
|
+
disableAutoResizing: undefined,
|
|
4082
|
+
disableDnd: undefined,
|
|
4083
|
+
className: undefined,
|
|
4084
|
+
};
|
|
4085
|
+
return Object.keys(properties);
|
|
4086
|
+
})();
|
|
4087
|
+
class PaneviewUnhandledDragOverEvent extends AcceptableEvent {
|
|
4088
|
+
constructor(nativeEvent, position, getData, panel) {
|
|
4089
|
+
super();
|
|
4090
|
+
this.nativeEvent = nativeEvent;
|
|
4091
|
+
this.position = position;
|
|
4092
|
+
this.getData = getData;
|
|
4093
|
+
this.panel = panel;
|
|
4094
|
+
}
|
|
4095
|
+
}
|
|
4096
|
+
|
|
4038
4097
|
class WillFocusEvent extends DockviewEvent {
|
|
4039
4098
|
constructor() {
|
|
4040
4099
|
super();
|
|
@@ -4458,6 +4517,9 @@
|
|
|
4458
4517
|
this.accessor = accessor;
|
|
4459
4518
|
this._onDidDrop = new Emitter();
|
|
4460
4519
|
this.onDidDrop = this._onDidDrop.event;
|
|
4520
|
+
this._onUnhandledDragOverEvent = new Emitter();
|
|
4521
|
+
this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
|
|
4522
|
+
this.addDisposables(this._onDidDrop, this._onUnhandledDragOverEvent);
|
|
4461
4523
|
if (!disableDnd) {
|
|
4462
4524
|
this.initDragFeatures();
|
|
4463
4525
|
}
|
|
@@ -4484,7 +4546,7 @@
|
|
|
4484
4546
|
overlayModel: {
|
|
4485
4547
|
activationSize: { type: 'percentage', value: 50 },
|
|
4486
4548
|
},
|
|
4487
|
-
canDisplayOverlay: (event) => {
|
|
4549
|
+
canDisplayOverlay: (event, position) => {
|
|
4488
4550
|
const data = getPaneData();
|
|
4489
4551
|
if (data) {
|
|
4490
4552
|
if (data.paneId !== this.id &&
|
|
@@ -4492,14 +4554,9 @@
|
|
|
4492
4554
|
return true;
|
|
4493
4555
|
}
|
|
4494
4556
|
}
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
getData: getPaneData,
|
|
4499
|
-
panel: this,
|
|
4500
|
-
});
|
|
4501
|
-
}
|
|
4502
|
-
return false;
|
|
4557
|
+
const firedEvent = new PaneviewUnhandledDragOverEvent(event, position, getPaneData, this);
|
|
4558
|
+
this._onUnhandledDragOverEvent.fire(firedEvent);
|
|
4559
|
+
return firedEvent.isAccepted;
|
|
4503
4560
|
},
|
|
4504
4561
|
});
|
|
4505
4562
|
this.addDisposables(this._onDidDrop, this.handler, this.target, this.target.onDrop((event) => {
|
|
@@ -4954,15 +5011,7 @@
|
|
|
4954
5011
|
this._element.appendChild(this.leftActionsContainer);
|
|
4955
5012
|
this._element.appendChild(this.voidContainer.element);
|
|
4956
5013
|
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) => {
|
|
5014
|
+
this.addDisposables(this._onWillShowOverlay, this._onDrop, this._onTabDragStart, this._onGroupDragStart, this.voidContainer, this.voidContainer.onDragStart((event) => {
|
|
4966
5015
|
this._onGroupDragStart.fire({
|
|
4967
5016
|
nativeEvent: event,
|
|
4968
5017
|
group: this.group,
|
|
@@ -5007,20 +5056,6 @@
|
|
|
5007
5056
|
setActive(_isGroupActive) {
|
|
5008
5057
|
// noop
|
|
5009
5058
|
}
|
|
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
5059
|
delete(id) {
|
|
5025
5060
|
const index = this.tabs.findIndex((tab) => tab.value.panel.id === id);
|
|
5026
5061
|
const tabToRemove = this.tabs.splice(index, 1)[0];
|
|
@@ -5028,6 +5063,7 @@
|
|
|
5028
5063
|
disposable.dispose();
|
|
5029
5064
|
value.dispose();
|
|
5030
5065
|
value.element.remove();
|
|
5066
|
+
this.updateClassnames();
|
|
5031
5067
|
}
|
|
5032
5068
|
setActivePanel(panel) {
|
|
5033
5069
|
this.tabs.forEach((tab) => {
|
|
@@ -5096,25 +5132,37 @@
|
|
|
5096
5132
|
}
|
|
5097
5133
|
this.tabs = [];
|
|
5098
5134
|
}
|
|
5135
|
+
addTab(tab, index = this.tabs.length) {
|
|
5136
|
+
if (index < 0 || index > this.tabs.length) {
|
|
5137
|
+
throw new Error('invalid location');
|
|
5138
|
+
}
|
|
5139
|
+
this.tabContainer.insertBefore(tab.value.element, this.tabContainer.children[index]);
|
|
5140
|
+
this.tabs = [
|
|
5141
|
+
...this.tabs.slice(0, index),
|
|
5142
|
+
tab,
|
|
5143
|
+
...this.tabs.slice(index),
|
|
5144
|
+
];
|
|
5145
|
+
if (this.selectedIndex < 0) {
|
|
5146
|
+
this.selectedIndex = index;
|
|
5147
|
+
}
|
|
5148
|
+
this.updateClassnames();
|
|
5149
|
+
}
|
|
5150
|
+
updateClassnames() {
|
|
5151
|
+
toggleClass(this._element, 'dv-single-tab', this.size === 1);
|
|
5152
|
+
}
|
|
5099
5153
|
}
|
|
5100
5154
|
|
|
5101
|
-
class DockviewUnhandledDragOverEvent {
|
|
5102
|
-
get isAccepted() {
|
|
5103
|
-
return this._isAccepted;
|
|
5104
|
-
}
|
|
5155
|
+
class DockviewUnhandledDragOverEvent extends AcceptableEvent {
|
|
5105
5156
|
constructor(nativeEvent, target, position, getData, group) {
|
|
5157
|
+
super();
|
|
5106
5158
|
this.nativeEvent = nativeEvent;
|
|
5107
5159
|
this.target = target;
|
|
5108
5160
|
this.position = position;
|
|
5109
5161
|
this.getData = getData;
|
|
5110
5162
|
this.group = group;
|
|
5111
|
-
this._isAccepted = false;
|
|
5112
|
-
}
|
|
5113
|
-
accept() {
|
|
5114
|
-
this._isAccepted = true;
|
|
5115
5163
|
}
|
|
5116
5164
|
}
|
|
5117
|
-
const
|
|
5165
|
+
const PROPERTY_KEYS_DOCKVIEW = (() => {
|
|
5118
5166
|
/**
|
|
5119
5167
|
* by readong the keys from an empty value object TypeScript will error
|
|
5120
5168
|
* when we add or remove new properties to `DockviewOptions`
|
|
@@ -8983,31 +9031,6 @@
|
|
|
8983
9031
|
}
|
|
8984
9032
|
}
|
|
8985
9033
|
|
|
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
9034
|
class GridviewComponent extends BaseGrid {
|
|
9012
9035
|
get orientation() {
|
|
9013
9036
|
return this.gridview.orientation;
|
|
@@ -9025,10 +9048,13 @@
|
|
|
9025
9048
|
this._deserializer = value;
|
|
9026
9049
|
}
|
|
9027
9050
|
constructor(parentElement, options) {
|
|
9051
|
+
var _a;
|
|
9028
9052
|
super(parentElement, {
|
|
9029
|
-
proportionalLayout: options.proportionalLayout,
|
|
9053
|
+
proportionalLayout: (_a = options.proportionalLayout) !== null && _a !== void 0 ? _a : true,
|
|
9030
9054
|
orientation: options.orientation,
|
|
9031
|
-
styles: options.
|
|
9055
|
+
styles: options.hideBorders
|
|
9056
|
+
? { separatorBorder: 'transparent' }
|
|
9057
|
+
: undefined,
|
|
9032
9058
|
disableAutoResizing: options.disableAutoResizing,
|
|
9033
9059
|
className: options.className,
|
|
9034
9060
|
});
|
|
@@ -9048,12 +9074,6 @@
|
|
|
9048
9074
|
}), this.onDidActiveChange((event) => {
|
|
9049
9075
|
this._onDidActiveGroupChange.fire(event);
|
|
9050
9076
|
}));
|
|
9051
|
-
if (!this.options.components) {
|
|
9052
|
-
this.options.components = {};
|
|
9053
|
-
}
|
|
9054
|
-
if (!this.options.frameworkComponents) {
|
|
9055
|
-
this.options.frameworkComponents = {};
|
|
9056
|
-
}
|
|
9057
9077
|
}
|
|
9058
9078
|
updateOptions(options) {
|
|
9059
9079
|
super.updateOptions(options);
|
|
@@ -9103,14 +9123,11 @@
|
|
|
9103
9123
|
const height = this.height;
|
|
9104
9124
|
this.gridview.deserialize(grid, {
|
|
9105
9125
|
fromJSON: (node) => {
|
|
9106
|
-
var _a, _b;
|
|
9107
9126
|
const { data } = node;
|
|
9108
|
-
const view =
|
|
9109
|
-
|
|
9110
|
-
|
|
9111
|
-
|
|
9112
|
-
}
|
|
9113
|
-
: undefined);
|
|
9127
|
+
const view = this.options.createComponent({
|
|
9128
|
+
id: data.id,
|
|
9129
|
+
name: data.component,
|
|
9130
|
+
});
|
|
9114
9131
|
queue.push(() => view.init({
|
|
9115
9132
|
params: data.params,
|
|
9116
9133
|
minimumWidth: data.minimumWidth,
|
|
@@ -9188,7 +9205,7 @@
|
|
|
9188
9205
|
this.doAddGroup(removedPanel, relativeLocation, options.size);
|
|
9189
9206
|
}
|
|
9190
9207
|
addPanel(options) {
|
|
9191
|
-
var _a, _b, _c, _d
|
|
9208
|
+
var _a, _b, _c, _d;
|
|
9192
9209
|
let relativeLocation = (_a = options.location) !== null && _a !== void 0 ? _a : [0];
|
|
9193
9210
|
if ((_b = options.position) === null || _b === void 0 ? void 0 : _b.referencePanel) {
|
|
9194
9211
|
const referenceGroup = (_c = this._groups.get(options.position.referencePanel)) === null || _c === void 0 ? void 0 : _c.value;
|
|
@@ -9204,14 +9221,12 @@
|
|
|
9204
9221
|
relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
|
|
9205
9222
|
}
|
|
9206
9223
|
}
|
|
9207
|
-
const view =
|
|
9208
|
-
|
|
9209
|
-
|
|
9210
|
-
|
|
9211
|
-
}
|
|
9212
|
-
: undefined);
|
|
9224
|
+
const view = this.options.createComponent({
|
|
9225
|
+
id: options.id,
|
|
9226
|
+
name: options.component,
|
|
9227
|
+
});
|
|
9213
9228
|
view.init({
|
|
9214
|
-
params: (
|
|
9229
|
+
params: (_d = options.params) !== null && _d !== void 0 ? _d : {},
|
|
9215
9230
|
minimumWidth: options.minimumWidth,
|
|
9216
9231
|
maximumWidth: options.maximumWidth,
|
|
9217
9232
|
minimumHeight: options.minimumHeight,
|
|
@@ -9339,12 +9354,6 @@
|
|
|
9339
9354
|
this._classNames = new Classnames(this.element);
|
|
9340
9355
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9341
9356
|
this._options = options;
|
|
9342
|
-
if (!options.components) {
|
|
9343
|
-
options.components = {};
|
|
9344
|
-
}
|
|
9345
|
-
if (!options.frameworkComponents) {
|
|
9346
|
-
options.frameworkComponents = {};
|
|
9347
|
-
}
|
|
9348
9357
|
this.splitview = new Splitview(this.element, options);
|
|
9349
9358
|
this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
|
|
9350
9359
|
}
|
|
@@ -9407,18 +9416,17 @@
|
|
|
9407
9416
|
return this.panels.find((view) => view.id === id);
|
|
9408
9417
|
}
|
|
9409
9418
|
addPanel(options) {
|
|
9410
|
-
var _a
|
|
9419
|
+
var _a;
|
|
9411
9420
|
if (this._panels.has(options.id)) {
|
|
9412
9421
|
throw new Error(`panel ${options.id} already exists`);
|
|
9413
9422
|
}
|
|
9414
|
-
const view =
|
|
9415
|
-
|
|
9416
|
-
|
|
9417
|
-
|
|
9418
|
-
: undefined);
|
|
9423
|
+
const view = this.options.createComponent({
|
|
9424
|
+
id: options.id,
|
|
9425
|
+
name: options.component,
|
|
9426
|
+
});
|
|
9419
9427
|
view.orientation = this.splitview.orientation;
|
|
9420
9428
|
view.init({
|
|
9421
|
-
params: (
|
|
9429
|
+
params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
|
|
9422
9430
|
minimumSize: options.minimumSize,
|
|
9423
9431
|
maximumSize: options.maximumSize,
|
|
9424
9432
|
snap: options.snap,
|
|
@@ -9480,17 +9488,14 @@
|
|
|
9480
9488
|
descriptor: {
|
|
9481
9489
|
size,
|
|
9482
9490
|
views: views.map((view) => {
|
|
9483
|
-
var _a, _b;
|
|
9484
9491
|
const data = view.data;
|
|
9485
9492
|
if (this._panels.has(data.id)) {
|
|
9486
9493
|
throw new Error(`panel ${data.id} already exists`);
|
|
9487
9494
|
}
|
|
9488
|
-
const panel =
|
|
9489
|
-
|
|
9490
|
-
|
|
9491
|
-
|
|
9492
|
-
}
|
|
9493
|
-
: undefined);
|
|
9495
|
+
const panel = this.options.createComponent({
|
|
9496
|
+
id: data.id,
|
|
9497
|
+
name: data.component,
|
|
9498
|
+
});
|
|
9494
9499
|
queue.push(() => {
|
|
9495
9500
|
var _a;
|
|
9496
9501
|
panel.init({
|
|
@@ -9673,16 +9678,12 @@
|
|
|
9673
9678
|
this.onDidAddView = this._onDidAddView.event;
|
|
9674
9679
|
this._onDidRemoveView = new Emitter();
|
|
9675
9680
|
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
9676
|
-
this.
|
|
9681
|
+
this._onUnhandledDragOverEvent = new Emitter();
|
|
9682
|
+
this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
|
|
9683
|
+
this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView, this._onUnhandledDragOverEvent);
|
|
9677
9684
|
this._classNames = new Classnames(this.element);
|
|
9678
9685
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9679
9686
|
this._options = options;
|
|
9680
|
-
if (!options.components) {
|
|
9681
|
-
options.components = {};
|
|
9682
|
-
}
|
|
9683
|
-
if (!options.frameworkComponents) {
|
|
9684
|
-
options.frameworkComponents = {};
|
|
9685
|
-
}
|
|
9686
9687
|
this.paneview = new Paneview(this.element, {
|
|
9687
9688
|
// only allow paneview in the vertical orientation for now
|
|
9688
9689
|
orientation: exports.Orientation.VERTICAL,
|
|
@@ -9707,22 +9708,19 @@
|
|
|
9707
9708
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
9708
9709
|
}
|
|
9709
9710
|
addPanel(options) {
|
|
9710
|
-
var _a
|
|
9711
|
-
const body =
|
|
9712
|
-
|
|
9713
|
-
|
|
9714
|
-
|
|
9715
|
-
: undefined);
|
|
9711
|
+
var _a;
|
|
9712
|
+
const body = this.options.createComponent({
|
|
9713
|
+
id: options.id,
|
|
9714
|
+
name: options.component,
|
|
9715
|
+
});
|
|
9716
9716
|
let header;
|
|
9717
|
-
if (options.headerComponent) {
|
|
9718
|
-
header =
|
|
9719
|
-
|
|
9720
|
-
|
|
9721
|
-
|
|
9722
|
-
}
|
|
9723
|
-
: undefined);
|
|
9717
|
+
if (options.headerComponent && this.options.createHeaderComponent) {
|
|
9718
|
+
header = this.options.createHeaderComponent({
|
|
9719
|
+
id: options.id,
|
|
9720
|
+
name: options.headerComponent,
|
|
9721
|
+
});
|
|
9724
9722
|
}
|
|
9725
|
-
|
|
9723
|
+
if (!header) {
|
|
9726
9724
|
header = new DefaultHeader();
|
|
9727
9725
|
}
|
|
9728
9726
|
const view = new PaneFramework({
|
|
@@ -9740,7 +9738,7 @@
|
|
|
9740
9738
|
const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
|
|
9741
9739
|
const index = typeof options.index === 'number' ? options.index : undefined;
|
|
9742
9740
|
view.init({
|
|
9743
|
-
params: (
|
|
9741
|
+
params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
|
|
9744
9742
|
minimumBodySize: options.minimumBodySize,
|
|
9745
9743
|
maximumBodySize: options.maximumBodySize,
|
|
9746
9744
|
isExpanded: options.isExpanded,
|
|
@@ -9805,24 +9803,20 @@
|
|
|
9805
9803
|
descriptor: {
|
|
9806
9804
|
size,
|
|
9807
9805
|
views: views.map((view) => {
|
|
9808
|
-
var _a, _b, _c, _d;
|
|
9809
9806
|
const data = view.data;
|
|
9810
|
-
const body =
|
|
9811
|
-
|
|
9812
|
-
|
|
9813
|
-
|
|
9814
|
-
}
|
|
9815
|
-
: undefined);
|
|
9807
|
+
const body = this.options.createComponent({
|
|
9808
|
+
id: data.id,
|
|
9809
|
+
name: data.component,
|
|
9810
|
+
});
|
|
9816
9811
|
let header;
|
|
9817
|
-
if (data.headerComponent
|
|
9818
|
-
|
|
9819
|
-
|
|
9820
|
-
|
|
9821
|
-
|
|
9822
|
-
|
|
9823
|
-
: undefined);
|
|
9812
|
+
if (data.headerComponent &&
|
|
9813
|
+
this.options.createHeaderComponent) {
|
|
9814
|
+
header = this.options.createHeaderComponent({
|
|
9815
|
+
id: data.id,
|
|
9816
|
+
name: data.headerComponent,
|
|
9817
|
+
});
|
|
9824
9818
|
}
|
|
9825
|
-
|
|
9819
|
+
if (!header) {
|
|
9826
9820
|
header = new DefaultHeader();
|
|
9827
9821
|
}
|
|
9828
9822
|
const panel = new PaneFramework({
|
|
@@ -9870,9 +9864,11 @@
|
|
|
9870
9864
|
this.paneview.dispose();
|
|
9871
9865
|
}
|
|
9872
9866
|
doAddPanel(panel) {
|
|
9873
|
-
const disposable = panel.onDidDrop((event) => {
|
|
9867
|
+
const disposable = new CompositeDisposable(panel.onDidDrop((event) => {
|
|
9874
9868
|
this._onDidDrop.fire(event);
|
|
9875
|
-
})
|
|
9869
|
+
}), panel.onUnhandledDragOverEvent((event) => {
|
|
9870
|
+
this._onUnhandledDragOverEvent.fire(event);
|
|
9871
|
+
}));
|
|
9876
9872
|
this._viewDisposables.set(panel.id, disposable);
|
|
9877
9873
|
}
|
|
9878
9874
|
doRemovePanel(panel) {
|
|
@@ -10034,7 +10030,10 @@
|
|
|
10034
10030
|
exports.GridviewApi = GridviewApi;
|
|
10035
10031
|
exports.GridviewComponent = GridviewComponent;
|
|
10036
10032
|
exports.GridviewPanel = GridviewPanel;
|
|
10037
|
-
exports.
|
|
10033
|
+
exports.PROPERTY_KEYS_DOCKVIEW = PROPERTY_KEYS_DOCKVIEW;
|
|
10034
|
+
exports.PROPERTY_KEYS_GRIDVIEW = PROPERTY_KEYS_GRIDVIEW;
|
|
10035
|
+
exports.PROPERTY_KEYS_PANEVIEW = PROPERTY_KEYS_PANEVIEW;
|
|
10036
|
+
exports.PROPERTY_KEYS_SPLITVIEW = PROPERTY_KEYS_SPLITVIEW;
|
|
10038
10037
|
exports.PaneFramework = PaneFramework;
|
|
10039
10038
|
exports.PaneTransfer = PaneTransfer;
|
|
10040
10039
|
exports.PanelTransfer = PanelTransfer;
|
|
@@ -10042,6 +10041,7 @@
|
|
|
10042
10041
|
exports.PaneviewApi = PaneviewApi;
|
|
10043
10042
|
exports.PaneviewComponent = PaneviewComponent;
|
|
10044
10043
|
exports.PaneviewPanel = PaneviewPanel;
|
|
10044
|
+
exports.PaneviewUnhandledDragOverEvent = PaneviewUnhandledDragOverEvent;
|
|
10045
10045
|
exports.Splitview = Splitview;
|
|
10046
10046
|
exports.SplitviewApi = SplitviewApi;
|
|
10047
10047
|
exports.SplitviewComponent = SplitviewComponent;
|