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
|
*/
|
|
@@ -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`
|
|
@@ -9009,31 +9058,6 @@ class DockviewComponent extends BaseGrid {
|
|
|
9009
9058
|
}
|
|
9010
9059
|
}
|
|
9011
9060
|
|
|
9012
|
-
function createComponent(id, componentName, components = {}, frameworkComponents = {}, createFrameworkComponent, fallback) {
|
|
9013
|
-
const Component = typeof componentName === 'string'
|
|
9014
|
-
? components[componentName]
|
|
9015
|
-
: undefined;
|
|
9016
|
-
const FrameworkComponent = typeof componentName === 'string'
|
|
9017
|
-
? frameworkComponents[componentName]
|
|
9018
|
-
: undefined;
|
|
9019
|
-
if (Component && FrameworkComponent) {
|
|
9020
|
-
throw new Error(`Cannot create '${id}'. component '${componentName}' registered as both a component and frameworkComponent`);
|
|
9021
|
-
}
|
|
9022
|
-
if (FrameworkComponent) {
|
|
9023
|
-
if (!createFrameworkComponent) {
|
|
9024
|
-
throw new Error(`Cannot create '${id}' for framework component '${componentName}'. you must register a frameworkPanelWrapper to use framework components`);
|
|
9025
|
-
}
|
|
9026
|
-
return createFrameworkComponent.createComponent(id, componentName, FrameworkComponent);
|
|
9027
|
-
}
|
|
9028
|
-
if (!Component) {
|
|
9029
|
-
if (fallback) {
|
|
9030
|
-
return fallback();
|
|
9031
|
-
}
|
|
9032
|
-
throw new Error(`Cannot create '${id}', no component '${componentName}' provided`);
|
|
9033
|
-
}
|
|
9034
|
-
return new Component(id, componentName);
|
|
9035
|
-
}
|
|
9036
|
-
|
|
9037
9061
|
class GridviewComponent extends BaseGrid {
|
|
9038
9062
|
get orientation() {
|
|
9039
9063
|
return this.gridview.orientation;
|
|
@@ -9051,10 +9075,13 @@ class GridviewComponent extends BaseGrid {
|
|
|
9051
9075
|
this._deserializer = value;
|
|
9052
9076
|
}
|
|
9053
9077
|
constructor(parentElement, options) {
|
|
9078
|
+
var _a;
|
|
9054
9079
|
super(parentElement, {
|
|
9055
|
-
proportionalLayout: options.proportionalLayout,
|
|
9080
|
+
proportionalLayout: (_a = options.proportionalLayout) !== null && _a !== void 0 ? _a : true,
|
|
9056
9081
|
orientation: options.orientation,
|
|
9057
|
-
styles: options.
|
|
9082
|
+
styles: options.hideBorders
|
|
9083
|
+
? { separatorBorder: 'transparent' }
|
|
9084
|
+
: undefined,
|
|
9058
9085
|
disableAutoResizing: options.disableAutoResizing,
|
|
9059
9086
|
className: options.className,
|
|
9060
9087
|
});
|
|
@@ -9074,12 +9101,6 @@ class GridviewComponent extends BaseGrid {
|
|
|
9074
9101
|
}), this.onDidActiveChange((event) => {
|
|
9075
9102
|
this._onDidActiveGroupChange.fire(event);
|
|
9076
9103
|
}));
|
|
9077
|
-
if (!this.options.components) {
|
|
9078
|
-
this.options.components = {};
|
|
9079
|
-
}
|
|
9080
|
-
if (!this.options.frameworkComponents) {
|
|
9081
|
-
this.options.frameworkComponents = {};
|
|
9082
|
-
}
|
|
9083
9104
|
}
|
|
9084
9105
|
updateOptions(options) {
|
|
9085
9106
|
super.updateOptions(options);
|
|
@@ -9129,14 +9150,11 @@ class GridviewComponent extends BaseGrid {
|
|
|
9129
9150
|
const height = this.height;
|
|
9130
9151
|
this.gridview.deserialize(grid, {
|
|
9131
9152
|
fromJSON: (node) => {
|
|
9132
|
-
var _a, _b;
|
|
9133
9153
|
const { data } = node;
|
|
9134
|
-
const view =
|
|
9135
|
-
|
|
9136
|
-
|
|
9137
|
-
|
|
9138
|
-
}
|
|
9139
|
-
: undefined);
|
|
9154
|
+
const view = this.options.createComponent({
|
|
9155
|
+
id: data.id,
|
|
9156
|
+
name: data.component,
|
|
9157
|
+
});
|
|
9140
9158
|
queue.push(() => view.init({
|
|
9141
9159
|
params: data.params,
|
|
9142
9160
|
minimumWidth: data.minimumWidth,
|
|
@@ -9214,7 +9232,7 @@ class GridviewComponent extends BaseGrid {
|
|
|
9214
9232
|
this.doAddGroup(removedPanel, relativeLocation, options.size);
|
|
9215
9233
|
}
|
|
9216
9234
|
addPanel(options) {
|
|
9217
|
-
var _a, _b, _c, _d
|
|
9235
|
+
var _a, _b, _c, _d;
|
|
9218
9236
|
let relativeLocation = (_a = options.location) !== null && _a !== void 0 ? _a : [0];
|
|
9219
9237
|
if ((_b = options.position) === null || _b === void 0 ? void 0 : _b.referencePanel) {
|
|
9220
9238
|
const referenceGroup = (_c = this._groups.get(options.position.referencePanel)) === null || _c === void 0 ? void 0 : _c.value;
|
|
@@ -9230,14 +9248,12 @@ class GridviewComponent extends BaseGrid {
|
|
|
9230
9248
|
relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
|
|
9231
9249
|
}
|
|
9232
9250
|
}
|
|
9233
|
-
const view =
|
|
9234
|
-
|
|
9235
|
-
|
|
9236
|
-
|
|
9237
|
-
}
|
|
9238
|
-
: undefined);
|
|
9251
|
+
const view = this.options.createComponent({
|
|
9252
|
+
id: options.id,
|
|
9253
|
+
name: options.component,
|
|
9254
|
+
});
|
|
9239
9255
|
view.init({
|
|
9240
|
-
params: (
|
|
9256
|
+
params: (_d = options.params) !== null && _d !== void 0 ? _d : {},
|
|
9241
9257
|
minimumWidth: options.minimumWidth,
|
|
9242
9258
|
maximumWidth: options.maximumWidth,
|
|
9243
9259
|
minimumHeight: options.minimumHeight,
|
|
@@ -9365,12 +9381,6 @@ class SplitviewComponent extends Resizable {
|
|
|
9365
9381
|
this._classNames = new Classnames(this.element);
|
|
9366
9382
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9367
9383
|
this._options = options;
|
|
9368
|
-
if (!options.components) {
|
|
9369
|
-
options.components = {};
|
|
9370
|
-
}
|
|
9371
|
-
if (!options.frameworkComponents) {
|
|
9372
|
-
options.frameworkComponents = {};
|
|
9373
|
-
}
|
|
9374
9384
|
this.splitview = new Splitview(this.element, options);
|
|
9375
9385
|
this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
|
|
9376
9386
|
}
|
|
@@ -9433,18 +9443,17 @@ class SplitviewComponent extends Resizable {
|
|
|
9433
9443
|
return this.panels.find((view) => view.id === id);
|
|
9434
9444
|
}
|
|
9435
9445
|
addPanel(options) {
|
|
9436
|
-
var _a
|
|
9446
|
+
var _a;
|
|
9437
9447
|
if (this._panels.has(options.id)) {
|
|
9438
9448
|
throw new Error(`panel ${options.id} already exists`);
|
|
9439
9449
|
}
|
|
9440
|
-
const view =
|
|
9441
|
-
|
|
9442
|
-
|
|
9443
|
-
|
|
9444
|
-
: undefined);
|
|
9450
|
+
const view = this.options.createComponent({
|
|
9451
|
+
id: options.id,
|
|
9452
|
+
name: options.component,
|
|
9453
|
+
});
|
|
9445
9454
|
view.orientation = this.splitview.orientation;
|
|
9446
9455
|
view.init({
|
|
9447
|
-
params: (
|
|
9456
|
+
params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
|
|
9448
9457
|
minimumSize: options.minimumSize,
|
|
9449
9458
|
maximumSize: options.maximumSize,
|
|
9450
9459
|
snap: options.snap,
|
|
@@ -9506,17 +9515,14 @@ class SplitviewComponent extends Resizable {
|
|
|
9506
9515
|
descriptor: {
|
|
9507
9516
|
size,
|
|
9508
9517
|
views: views.map((view) => {
|
|
9509
|
-
var _a, _b;
|
|
9510
9518
|
const data = view.data;
|
|
9511
9519
|
if (this._panels.has(data.id)) {
|
|
9512
9520
|
throw new Error(`panel ${data.id} already exists`);
|
|
9513
9521
|
}
|
|
9514
|
-
const panel =
|
|
9515
|
-
|
|
9516
|
-
|
|
9517
|
-
|
|
9518
|
-
}
|
|
9519
|
-
: undefined);
|
|
9522
|
+
const panel = this.options.createComponent({
|
|
9523
|
+
id: data.id,
|
|
9524
|
+
name: data.component,
|
|
9525
|
+
});
|
|
9520
9526
|
queue.push(() => {
|
|
9521
9527
|
var _a;
|
|
9522
9528
|
panel.init({
|
|
@@ -9699,16 +9705,12 @@ class PaneviewComponent extends Resizable {
|
|
|
9699
9705
|
this.onDidAddView = this._onDidAddView.event;
|
|
9700
9706
|
this._onDidRemoveView = new Emitter();
|
|
9701
9707
|
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
9702
|
-
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);
|
|
9703
9711
|
this._classNames = new Classnames(this.element);
|
|
9704
9712
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9705
9713
|
this._options = options;
|
|
9706
|
-
if (!options.components) {
|
|
9707
|
-
options.components = {};
|
|
9708
|
-
}
|
|
9709
|
-
if (!options.frameworkComponents) {
|
|
9710
|
-
options.frameworkComponents = {};
|
|
9711
|
-
}
|
|
9712
9714
|
this.paneview = new Paneview(this.element, {
|
|
9713
9715
|
// only allow paneview in the vertical orientation for now
|
|
9714
9716
|
orientation: exports.Orientation.VERTICAL,
|
|
@@ -9733,22 +9735,19 @@ class PaneviewComponent extends Resizable {
|
|
|
9733
9735
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
9734
9736
|
}
|
|
9735
9737
|
addPanel(options) {
|
|
9736
|
-
var _a
|
|
9737
|
-
const body =
|
|
9738
|
-
|
|
9739
|
-
|
|
9740
|
-
|
|
9741
|
-
: undefined);
|
|
9738
|
+
var _a;
|
|
9739
|
+
const body = this.options.createComponent({
|
|
9740
|
+
id: options.id,
|
|
9741
|
+
name: options.component,
|
|
9742
|
+
});
|
|
9742
9743
|
let header;
|
|
9743
|
-
if (options.headerComponent) {
|
|
9744
|
-
header =
|
|
9745
|
-
|
|
9746
|
-
|
|
9747
|
-
|
|
9748
|
-
}
|
|
9749
|
-
: undefined);
|
|
9744
|
+
if (options.headerComponent && this.options.createHeaderComponent) {
|
|
9745
|
+
header = this.options.createHeaderComponent({
|
|
9746
|
+
id: options.id,
|
|
9747
|
+
name: options.headerComponent,
|
|
9748
|
+
});
|
|
9750
9749
|
}
|
|
9751
|
-
|
|
9750
|
+
if (!header) {
|
|
9752
9751
|
header = new DefaultHeader();
|
|
9753
9752
|
}
|
|
9754
9753
|
const view = new PaneFramework({
|
|
@@ -9766,7 +9765,7 @@ class PaneviewComponent extends Resizable {
|
|
|
9766
9765
|
const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
|
|
9767
9766
|
const index = typeof options.index === 'number' ? options.index : undefined;
|
|
9768
9767
|
view.init({
|
|
9769
|
-
params: (
|
|
9768
|
+
params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
|
|
9770
9769
|
minimumBodySize: options.minimumBodySize,
|
|
9771
9770
|
maximumBodySize: options.maximumBodySize,
|
|
9772
9771
|
isExpanded: options.isExpanded,
|
|
@@ -9831,24 +9830,20 @@ class PaneviewComponent extends Resizable {
|
|
|
9831
9830
|
descriptor: {
|
|
9832
9831
|
size,
|
|
9833
9832
|
views: views.map((view) => {
|
|
9834
|
-
var _a, _b, _c, _d;
|
|
9835
9833
|
const data = view.data;
|
|
9836
|
-
const body =
|
|
9837
|
-
|
|
9838
|
-
|
|
9839
|
-
|
|
9840
|
-
}
|
|
9841
|
-
: undefined);
|
|
9834
|
+
const body = this.options.createComponent({
|
|
9835
|
+
id: data.id,
|
|
9836
|
+
name: data.component,
|
|
9837
|
+
});
|
|
9842
9838
|
let header;
|
|
9843
|
-
if (data.headerComponent
|
|
9844
|
-
|
|
9845
|
-
|
|
9846
|
-
|
|
9847
|
-
|
|
9848
|
-
|
|
9849
|
-
: undefined);
|
|
9839
|
+
if (data.headerComponent &&
|
|
9840
|
+
this.options.createHeaderComponent) {
|
|
9841
|
+
header = this.options.createHeaderComponent({
|
|
9842
|
+
id: data.id,
|
|
9843
|
+
name: data.headerComponent,
|
|
9844
|
+
});
|
|
9850
9845
|
}
|
|
9851
|
-
|
|
9846
|
+
if (!header) {
|
|
9852
9847
|
header = new DefaultHeader();
|
|
9853
9848
|
}
|
|
9854
9849
|
const panel = new PaneFramework({
|
|
@@ -9896,9 +9891,11 @@ class PaneviewComponent extends Resizable {
|
|
|
9896
9891
|
this.paneview.dispose();
|
|
9897
9892
|
}
|
|
9898
9893
|
doAddPanel(panel) {
|
|
9899
|
-
const disposable = panel.onDidDrop((event) => {
|
|
9894
|
+
const disposable = new CompositeDisposable(panel.onDidDrop((event) => {
|
|
9900
9895
|
this._onDidDrop.fire(event);
|
|
9901
|
-
})
|
|
9896
|
+
}), panel.onUnhandledDragOverEvent((event) => {
|
|
9897
|
+
this._onUnhandledDragOverEvent.fire(event);
|
|
9898
|
+
}));
|
|
9902
9899
|
this._viewDisposables.set(panel.id, disposable);
|
|
9903
9900
|
}
|
|
9904
9901
|
doRemovePanel(panel) {
|
|
@@ -10060,7 +10057,10 @@ exports.Gridview = Gridview;
|
|
|
10060
10057
|
exports.GridviewApi = GridviewApi;
|
|
10061
10058
|
exports.GridviewComponent = GridviewComponent;
|
|
10062
10059
|
exports.GridviewPanel = GridviewPanel;
|
|
10063
|
-
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;
|
|
10064
10064
|
exports.PaneFramework = PaneFramework;
|
|
10065
10065
|
exports.PaneTransfer = PaneTransfer;
|
|
10066
10066
|
exports.PanelTransfer = PanelTransfer;
|
|
@@ -10068,6 +10068,7 @@ exports.Paneview = Paneview;
|
|
|
10068
10068
|
exports.PaneviewApi = PaneviewApi;
|
|
10069
10069
|
exports.PaneviewComponent = PaneviewComponent;
|
|
10070
10070
|
exports.PaneviewPanel = PaneviewPanel;
|
|
10071
|
+
exports.PaneviewUnhandledDragOverEvent = PaneviewUnhandledDragOverEvent;
|
|
10071
10072
|
exports.Splitview = Splitview;
|
|
10072
10073
|
exports.SplitviewApi = SplitviewApi;
|
|
10073
10074
|
exports.SplitviewComponent = SplitviewComponent;
|