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
|
*/
|
|
@@ -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;
|
|
@@ -2758,7 +2801,7 @@ class BaseGrid extends Resizable {
|
|
|
2758
2801
|
}
|
|
2759
2802
|
constructor(parentElement, options) {
|
|
2760
2803
|
var _a;
|
|
2761
|
-
super(
|
|
2804
|
+
super(parentElement, options.disableAutoResizing);
|
|
2762
2805
|
this._id = nextLayoutId$1.next();
|
|
2763
2806
|
this._groups = new Map();
|
|
2764
2807
|
this._onDidRemove = new Emitter();
|
|
@@ -2777,7 +2820,6 @@ class BaseGrid extends Resizable {
|
|
|
2777
2820
|
this.element.style.width = '100%';
|
|
2778
2821
|
this._classNames = new Classnames(this.element);
|
|
2779
2822
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
2780
|
-
parentElement.appendChild(this.element);
|
|
2781
2823
|
this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation, options.locked, options.margin);
|
|
2782
2824
|
this.gridview.locked = !!options.locked;
|
|
2783
2825
|
this.element.appendChild(this.gridview.element);
|
|
@@ -3126,15 +3168,10 @@ class PaneviewApi {
|
|
|
3126
3168
|
* Invoked when a Drag'n'Drop event occurs that the component was unable to handle. Exposed for custom Drag'n'Drop functionality.
|
|
3127
3169
|
*/
|
|
3128
3170
|
get onDidDrop() {
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
emitter.dispose = () => {
|
|
3134
|
-
disposable.dispose();
|
|
3135
|
-
emitter.dispose();
|
|
3136
|
-
};
|
|
3137
|
-
return emitter.event;
|
|
3171
|
+
return this.component.onDidDrop;
|
|
3172
|
+
}
|
|
3173
|
+
get onUnhandledDragOverEvent() {
|
|
3174
|
+
return this.component.onUnhandledDragOverEvent;
|
|
3138
3175
|
}
|
|
3139
3176
|
constructor(component) {
|
|
3140
3177
|
this.component = component;
|
|
@@ -4061,6 +4098,28 @@ function calculateQuadrantAsPixels(overlayType, x, y, width, height, threshold)
|
|
|
4061
4098
|
return 'center';
|
|
4062
4099
|
}
|
|
4063
4100
|
|
|
4101
|
+
const PROPERTY_KEYS_PANEVIEW = (() => {
|
|
4102
|
+
/**
|
|
4103
|
+
* by readong the keys from an empty value object TypeScript will error
|
|
4104
|
+
* when we add or remove new properties to `DockviewOptions`
|
|
4105
|
+
*/
|
|
4106
|
+
const properties = {
|
|
4107
|
+
disableAutoResizing: undefined,
|
|
4108
|
+
disableDnd: undefined,
|
|
4109
|
+
className: undefined,
|
|
4110
|
+
};
|
|
4111
|
+
return Object.keys(properties);
|
|
4112
|
+
})();
|
|
4113
|
+
class PaneviewUnhandledDragOverEvent extends AcceptableEvent {
|
|
4114
|
+
constructor(nativeEvent, position, getData, panel) {
|
|
4115
|
+
super();
|
|
4116
|
+
this.nativeEvent = nativeEvent;
|
|
4117
|
+
this.position = position;
|
|
4118
|
+
this.getData = getData;
|
|
4119
|
+
this.panel = panel;
|
|
4120
|
+
}
|
|
4121
|
+
}
|
|
4122
|
+
|
|
4064
4123
|
class WillFocusEvent extends DockviewEvent {
|
|
4065
4124
|
constructor() {
|
|
4066
4125
|
super();
|
|
@@ -4484,6 +4543,9 @@ class DraggablePaneviewPanel extends PaneviewPanel {
|
|
|
4484
4543
|
this.accessor = accessor;
|
|
4485
4544
|
this._onDidDrop = new Emitter();
|
|
4486
4545
|
this.onDidDrop = this._onDidDrop.event;
|
|
4546
|
+
this._onUnhandledDragOverEvent = new Emitter();
|
|
4547
|
+
this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
|
|
4548
|
+
this.addDisposables(this._onDidDrop, this._onUnhandledDragOverEvent);
|
|
4487
4549
|
if (!disableDnd) {
|
|
4488
4550
|
this.initDragFeatures();
|
|
4489
4551
|
}
|
|
@@ -4510,7 +4572,7 @@ class DraggablePaneviewPanel extends PaneviewPanel {
|
|
|
4510
4572
|
overlayModel: {
|
|
4511
4573
|
activationSize: { type: 'percentage', value: 50 },
|
|
4512
4574
|
},
|
|
4513
|
-
canDisplayOverlay: (event) => {
|
|
4575
|
+
canDisplayOverlay: (event, position) => {
|
|
4514
4576
|
const data = getPaneData();
|
|
4515
4577
|
if (data) {
|
|
4516
4578
|
if (data.paneId !== this.id &&
|
|
@@ -4518,14 +4580,9 @@ class DraggablePaneviewPanel extends PaneviewPanel {
|
|
|
4518
4580
|
return true;
|
|
4519
4581
|
}
|
|
4520
4582
|
}
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
getData: getPaneData,
|
|
4525
|
-
panel: this,
|
|
4526
|
-
});
|
|
4527
|
-
}
|
|
4528
|
-
return false;
|
|
4583
|
+
const firedEvent = new PaneviewUnhandledDragOverEvent(event, position, getPaneData, this);
|
|
4584
|
+
this._onUnhandledDragOverEvent.fire(firedEvent);
|
|
4585
|
+
return firedEvent.isAccepted;
|
|
4529
4586
|
},
|
|
4530
4587
|
});
|
|
4531
4588
|
this.addDisposables(this._onDidDrop, this.handler, this.target, this.target.onDrop((event) => {
|
|
@@ -4980,15 +5037,7 @@ class TabsContainer extends CompositeDisposable {
|
|
|
4980
5037
|
this._element.appendChild(this.leftActionsContainer);
|
|
4981
5038
|
this._element.appendChild(this.voidContainer.element);
|
|
4982
5039
|
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) => {
|
|
5040
|
+
this.addDisposables(this._onWillShowOverlay, this._onDrop, this._onTabDragStart, this._onGroupDragStart, this.voidContainer, this.voidContainer.onDragStart((event) => {
|
|
4992
5041
|
this._onGroupDragStart.fire({
|
|
4993
5042
|
nativeEvent: event,
|
|
4994
5043
|
group: this.group,
|
|
@@ -5033,20 +5082,6 @@ class TabsContainer extends CompositeDisposable {
|
|
|
5033
5082
|
setActive(_isGroupActive) {
|
|
5034
5083
|
// noop
|
|
5035
5084
|
}
|
|
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
5085
|
delete(id) {
|
|
5051
5086
|
const index = this.tabs.findIndex((tab) => tab.value.panel.id === id);
|
|
5052
5087
|
const tabToRemove = this.tabs.splice(index, 1)[0];
|
|
@@ -5054,6 +5089,7 @@ class TabsContainer extends CompositeDisposable {
|
|
|
5054
5089
|
disposable.dispose();
|
|
5055
5090
|
value.dispose();
|
|
5056
5091
|
value.element.remove();
|
|
5092
|
+
this.updateClassnames();
|
|
5057
5093
|
}
|
|
5058
5094
|
setActivePanel(panel) {
|
|
5059
5095
|
this.tabs.forEach((tab) => {
|
|
@@ -5122,25 +5158,37 @@ class TabsContainer extends CompositeDisposable {
|
|
|
5122
5158
|
}
|
|
5123
5159
|
this.tabs = [];
|
|
5124
5160
|
}
|
|
5161
|
+
addTab(tab, index = this.tabs.length) {
|
|
5162
|
+
if (index < 0 || index > this.tabs.length) {
|
|
5163
|
+
throw new Error('invalid location');
|
|
5164
|
+
}
|
|
5165
|
+
this.tabContainer.insertBefore(tab.value.element, this.tabContainer.children[index]);
|
|
5166
|
+
this.tabs = [
|
|
5167
|
+
...this.tabs.slice(0, index),
|
|
5168
|
+
tab,
|
|
5169
|
+
...this.tabs.slice(index),
|
|
5170
|
+
];
|
|
5171
|
+
if (this.selectedIndex < 0) {
|
|
5172
|
+
this.selectedIndex = index;
|
|
5173
|
+
}
|
|
5174
|
+
this.updateClassnames();
|
|
5175
|
+
}
|
|
5176
|
+
updateClassnames() {
|
|
5177
|
+
toggleClass(this._element, 'dv-single-tab', this.size === 1);
|
|
5178
|
+
}
|
|
5125
5179
|
}
|
|
5126
5180
|
|
|
5127
|
-
class DockviewUnhandledDragOverEvent {
|
|
5128
|
-
get isAccepted() {
|
|
5129
|
-
return this._isAccepted;
|
|
5130
|
-
}
|
|
5181
|
+
class DockviewUnhandledDragOverEvent extends AcceptableEvent {
|
|
5131
5182
|
constructor(nativeEvent, target, position, getData, group) {
|
|
5183
|
+
super();
|
|
5132
5184
|
this.nativeEvent = nativeEvent;
|
|
5133
5185
|
this.target = target;
|
|
5134
5186
|
this.position = position;
|
|
5135
5187
|
this.getData = getData;
|
|
5136
5188
|
this.group = group;
|
|
5137
|
-
this._isAccepted = false;
|
|
5138
|
-
}
|
|
5139
|
-
accept() {
|
|
5140
|
-
this._isAccepted = true;
|
|
5141
5189
|
}
|
|
5142
5190
|
}
|
|
5143
|
-
const
|
|
5191
|
+
const PROPERTY_KEYS_DOCKVIEW = (() => {
|
|
5144
5192
|
/**
|
|
5145
5193
|
* by readong the keys from an empty value object TypeScript will error
|
|
5146
5194
|
* when we add or remove new properties to `DockviewOptions`
|
|
@@ -9009,31 +9057,6 @@ class DockviewComponent extends BaseGrid {
|
|
|
9009
9057
|
}
|
|
9010
9058
|
}
|
|
9011
9059
|
|
|
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
9060
|
class GridviewComponent extends BaseGrid {
|
|
9038
9061
|
get orientation() {
|
|
9039
9062
|
return this.gridview.orientation;
|
|
@@ -9051,10 +9074,13 @@ class GridviewComponent extends BaseGrid {
|
|
|
9051
9074
|
this._deserializer = value;
|
|
9052
9075
|
}
|
|
9053
9076
|
constructor(parentElement, options) {
|
|
9077
|
+
var _a;
|
|
9054
9078
|
super(parentElement, {
|
|
9055
|
-
proportionalLayout: options.proportionalLayout,
|
|
9079
|
+
proportionalLayout: (_a = options.proportionalLayout) !== null && _a !== void 0 ? _a : true,
|
|
9056
9080
|
orientation: options.orientation,
|
|
9057
|
-
styles: options.
|
|
9081
|
+
styles: options.hideBorders
|
|
9082
|
+
? { separatorBorder: 'transparent' }
|
|
9083
|
+
: undefined,
|
|
9058
9084
|
disableAutoResizing: options.disableAutoResizing,
|
|
9059
9085
|
className: options.className,
|
|
9060
9086
|
});
|
|
@@ -9074,12 +9100,6 @@ class GridviewComponent extends BaseGrid {
|
|
|
9074
9100
|
}), this.onDidActiveChange((event) => {
|
|
9075
9101
|
this._onDidActiveGroupChange.fire(event);
|
|
9076
9102
|
}));
|
|
9077
|
-
if (!this.options.components) {
|
|
9078
|
-
this.options.components = {};
|
|
9079
|
-
}
|
|
9080
|
-
if (!this.options.frameworkComponents) {
|
|
9081
|
-
this.options.frameworkComponents = {};
|
|
9082
|
-
}
|
|
9083
9103
|
}
|
|
9084
9104
|
updateOptions(options) {
|
|
9085
9105
|
super.updateOptions(options);
|
|
@@ -9129,14 +9149,11 @@ class GridviewComponent extends BaseGrid {
|
|
|
9129
9149
|
const height = this.height;
|
|
9130
9150
|
this.gridview.deserialize(grid, {
|
|
9131
9151
|
fromJSON: (node) => {
|
|
9132
|
-
var _a, _b;
|
|
9133
9152
|
const { data } = node;
|
|
9134
|
-
const view =
|
|
9135
|
-
|
|
9136
|
-
|
|
9137
|
-
|
|
9138
|
-
}
|
|
9139
|
-
: undefined);
|
|
9153
|
+
const view = this.options.createComponent({
|
|
9154
|
+
id: data.id,
|
|
9155
|
+
name: data.component,
|
|
9156
|
+
});
|
|
9140
9157
|
queue.push(() => view.init({
|
|
9141
9158
|
params: data.params,
|
|
9142
9159
|
minimumWidth: data.minimumWidth,
|
|
@@ -9214,7 +9231,7 @@ class GridviewComponent extends BaseGrid {
|
|
|
9214
9231
|
this.doAddGroup(removedPanel, relativeLocation, options.size);
|
|
9215
9232
|
}
|
|
9216
9233
|
addPanel(options) {
|
|
9217
|
-
var _a, _b, _c, _d
|
|
9234
|
+
var _a, _b, _c, _d;
|
|
9218
9235
|
let relativeLocation = (_a = options.location) !== null && _a !== void 0 ? _a : [0];
|
|
9219
9236
|
if ((_b = options.position) === null || _b === void 0 ? void 0 : _b.referencePanel) {
|
|
9220
9237
|
const referenceGroup = (_c = this._groups.get(options.position.referencePanel)) === null || _c === void 0 ? void 0 : _c.value;
|
|
@@ -9230,14 +9247,12 @@ class GridviewComponent extends BaseGrid {
|
|
|
9230
9247
|
relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
|
|
9231
9248
|
}
|
|
9232
9249
|
}
|
|
9233
|
-
const view =
|
|
9234
|
-
|
|
9235
|
-
|
|
9236
|
-
|
|
9237
|
-
}
|
|
9238
|
-
: undefined);
|
|
9250
|
+
const view = this.options.createComponent({
|
|
9251
|
+
id: options.id,
|
|
9252
|
+
name: options.component,
|
|
9253
|
+
});
|
|
9239
9254
|
view.init({
|
|
9240
|
-
params: (
|
|
9255
|
+
params: (_d = options.params) !== null && _d !== void 0 ? _d : {},
|
|
9241
9256
|
minimumWidth: options.minimumWidth,
|
|
9242
9257
|
maximumWidth: options.maximumWidth,
|
|
9243
9258
|
minimumHeight: options.minimumHeight,
|
|
@@ -9365,12 +9380,6 @@ class SplitviewComponent extends Resizable {
|
|
|
9365
9380
|
this._classNames = new Classnames(this.element);
|
|
9366
9381
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9367
9382
|
this._options = options;
|
|
9368
|
-
if (!options.components) {
|
|
9369
|
-
options.components = {};
|
|
9370
|
-
}
|
|
9371
|
-
if (!options.frameworkComponents) {
|
|
9372
|
-
options.frameworkComponents = {};
|
|
9373
|
-
}
|
|
9374
9383
|
this.splitview = new Splitview(this.element, options);
|
|
9375
9384
|
this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
|
|
9376
9385
|
}
|
|
@@ -9433,18 +9442,17 @@ class SplitviewComponent extends Resizable {
|
|
|
9433
9442
|
return this.panels.find((view) => view.id === id);
|
|
9434
9443
|
}
|
|
9435
9444
|
addPanel(options) {
|
|
9436
|
-
var _a
|
|
9445
|
+
var _a;
|
|
9437
9446
|
if (this._panels.has(options.id)) {
|
|
9438
9447
|
throw new Error(`panel ${options.id} already exists`);
|
|
9439
9448
|
}
|
|
9440
|
-
const view =
|
|
9441
|
-
|
|
9442
|
-
|
|
9443
|
-
|
|
9444
|
-
: undefined);
|
|
9449
|
+
const view = this.options.createComponent({
|
|
9450
|
+
id: options.id,
|
|
9451
|
+
name: options.component,
|
|
9452
|
+
});
|
|
9445
9453
|
view.orientation = this.splitview.orientation;
|
|
9446
9454
|
view.init({
|
|
9447
|
-
params: (
|
|
9455
|
+
params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
|
|
9448
9456
|
minimumSize: options.minimumSize,
|
|
9449
9457
|
maximumSize: options.maximumSize,
|
|
9450
9458
|
snap: options.snap,
|
|
@@ -9506,17 +9514,14 @@ class SplitviewComponent extends Resizable {
|
|
|
9506
9514
|
descriptor: {
|
|
9507
9515
|
size,
|
|
9508
9516
|
views: views.map((view) => {
|
|
9509
|
-
var _a, _b;
|
|
9510
9517
|
const data = view.data;
|
|
9511
9518
|
if (this._panels.has(data.id)) {
|
|
9512
9519
|
throw new Error(`panel ${data.id} already exists`);
|
|
9513
9520
|
}
|
|
9514
|
-
const panel =
|
|
9515
|
-
|
|
9516
|
-
|
|
9517
|
-
|
|
9518
|
-
}
|
|
9519
|
-
: undefined);
|
|
9521
|
+
const panel = this.options.createComponent({
|
|
9522
|
+
id: data.id,
|
|
9523
|
+
name: data.component,
|
|
9524
|
+
});
|
|
9520
9525
|
queue.push(() => {
|
|
9521
9526
|
var _a;
|
|
9522
9527
|
panel.init({
|
|
@@ -9699,16 +9704,12 @@ class PaneviewComponent extends Resizable {
|
|
|
9699
9704
|
this.onDidAddView = this._onDidAddView.event;
|
|
9700
9705
|
this._onDidRemoveView = new Emitter();
|
|
9701
9706
|
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
9702
|
-
this.
|
|
9707
|
+
this._onUnhandledDragOverEvent = new Emitter();
|
|
9708
|
+
this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
|
|
9709
|
+
this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView, this._onUnhandledDragOverEvent);
|
|
9703
9710
|
this._classNames = new Classnames(this.element);
|
|
9704
9711
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9705
9712
|
this._options = options;
|
|
9706
|
-
if (!options.components) {
|
|
9707
|
-
options.components = {};
|
|
9708
|
-
}
|
|
9709
|
-
if (!options.frameworkComponents) {
|
|
9710
|
-
options.frameworkComponents = {};
|
|
9711
|
-
}
|
|
9712
9713
|
this.paneview = new Paneview(this.element, {
|
|
9713
9714
|
// only allow paneview in the vertical orientation for now
|
|
9714
9715
|
orientation: exports.Orientation.VERTICAL,
|
|
@@ -9733,22 +9734,19 @@ class PaneviewComponent extends Resizable {
|
|
|
9733
9734
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
9734
9735
|
}
|
|
9735
9736
|
addPanel(options) {
|
|
9736
|
-
var _a
|
|
9737
|
-
const body =
|
|
9738
|
-
|
|
9739
|
-
|
|
9740
|
-
|
|
9741
|
-
: undefined);
|
|
9737
|
+
var _a;
|
|
9738
|
+
const body = this.options.createComponent({
|
|
9739
|
+
id: options.id,
|
|
9740
|
+
name: options.component,
|
|
9741
|
+
});
|
|
9742
9742
|
let header;
|
|
9743
|
-
if (options.headerComponent) {
|
|
9744
|
-
header =
|
|
9745
|
-
|
|
9746
|
-
|
|
9747
|
-
|
|
9748
|
-
}
|
|
9749
|
-
: undefined);
|
|
9743
|
+
if (options.headerComponent && this.options.createHeaderComponent) {
|
|
9744
|
+
header = this.options.createHeaderComponent({
|
|
9745
|
+
id: options.id,
|
|
9746
|
+
name: options.headerComponent,
|
|
9747
|
+
});
|
|
9750
9748
|
}
|
|
9751
|
-
|
|
9749
|
+
if (!header) {
|
|
9752
9750
|
header = new DefaultHeader();
|
|
9753
9751
|
}
|
|
9754
9752
|
const view = new PaneFramework({
|
|
@@ -9766,7 +9764,7 @@ class PaneviewComponent extends Resizable {
|
|
|
9766
9764
|
const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
|
|
9767
9765
|
const index = typeof options.index === 'number' ? options.index : undefined;
|
|
9768
9766
|
view.init({
|
|
9769
|
-
params: (
|
|
9767
|
+
params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
|
|
9770
9768
|
minimumBodySize: options.minimumBodySize,
|
|
9771
9769
|
maximumBodySize: options.maximumBodySize,
|
|
9772
9770
|
isExpanded: options.isExpanded,
|
|
@@ -9831,24 +9829,20 @@ class PaneviewComponent extends Resizable {
|
|
|
9831
9829
|
descriptor: {
|
|
9832
9830
|
size,
|
|
9833
9831
|
views: views.map((view) => {
|
|
9834
|
-
var _a, _b, _c, _d;
|
|
9835
9832
|
const data = view.data;
|
|
9836
|
-
const body =
|
|
9837
|
-
|
|
9838
|
-
|
|
9839
|
-
|
|
9840
|
-
}
|
|
9841
|
-
: undefined);
|
|
9833
|
+
const body = this.options.createComponent({
|
|
9834
|
+
id: data.id,
|
|
9835
|
+
name: data.component,
|
|
9836
|
+
});
|
|
9842
9837
|
let header;
|
|
9843
|
-
if (data.headerComponent
|
|
9844
|
-
|
|
9845
|
-
|
|
9846
|
-
|
|
9847
|
-
|
|
9848
|
-
|
|
9849
|
-
: undefined);
|
|
9838
|
+
if (data.headerComponent &&
|
|
9839
|
+
this.options.createHeaderComponent) {
|
|
9840
|
+
header = this.options.createHeaderComponent({
|
|
9841
|
+
id: data.id,
|
|
9842
|
+
name: data.headerComponent,
|
|
9843
|
+
});
|
|
9850
9844
|
}
|
|
9851
|
-
|
|
9845
|
+
if (!header) {
|
|
9852
9846
|
header = new DefaultHeader();
|
|
9853
9847
|
}
|
|
9854
9848
|
const panel = new PaneFramework({
|
|
@@ -9896,9 +9890,11 @@ class PaneviewComponent extends Resizable {
|
|
|
9896
9890
|
this.paneview.dispose();
|
|
9897
9891
|
}
|
|
9898
9892
|
doAddPanel(panel) {
|
|
9899
|
-
const disposable = panel.onDidDrop((event) => {
|
|
9893
|
+
const disposable = new CompositeDisposable(panel.onDidDrop((event) => {
|
|
9900
9894
|
this._onDidDrop.fire(event);
|
|
9901
|
-
})
|
|
9895
|
+
}), panel.onUnhandledDragOverEvent((event) => {
|
|
9896
|
+
this._onUnhandledDragOverEvent.fire(event);
|
|
9897
|
+
}));
|
|
9902
9898
|
this._viewDisposables.set(panel.id, disposable);
|
|
9903
9899
|
}
|
|
9904
9900
|
doRemovePanel(panel) {
|
|
@@ -10060,7 +10056,10 @@ exports.Gridview = Gridview;
|
|
|
10060
10056
|
exports.GridviewApi = GridviewApi;
|
|
10061
10057
|
exports.GridviewComponent = GridviewComponent;
|
|
10062
10058
|
exports.GridviewPanel = GridviewPanel;
|
|
10063
|
-
exports.
|
|
10059
|
+
exports.PROPERTY_KEYS_DOCKVIEW = PROPERTY_KEYS_DOCKVIEW;
|
|
10060
|
+
exports.PROPERTY_KEYS_GRIDVIEW = PROPERTY_KEYS_GRIDVIEW;
|
|
10061
|
+
exports.PROPERTY_KEYS_PANEVIEW = PROPERTY_KEYS_PANEVIEW;
|
|
10062
|
+
exports.PROPERTY_KEYS_SPLITVIEW = PROPERTY_KEYS_SPLITVIEW;
|
|
10064
10063
|
exports.PaneFramework = PaneFramework;
|
|
10065
10064
|
exports.PaneTransfer = PaneTransfer;
|
|
10066
10065
|
exports.PanelTransfer = PanelTransfer;
|
|
@@ -10068,6 +10067,7 @@ exports.Paneview = Paneview;
|
|
|
10068
10067
|
exports.PaneviewApi = PaneviewApi;
|
|
10069
10068
|
exports.PaneviewComponent = PaneviewComponent;
|
|
10070
10069
|
exports.PaneviewPanel = PaneviewPanel;
|
|
10070
|
+
exports.PaneviewUnhandledDragOverEvent = PaneviewUnhandledDragOverEvent;
|
|
10071
10071
|
exports.Splitview = Splitview;
|
|
10072
10072
|
exports.SplitviewApi = SplitviewApi;
|
|
10073
10073
|
exports.SplitviewComponent = SplitviewComponent;
|