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
|
*/
|
|
@@ -127,6 +127,17 @@ class DockviewEvent {
|
|
|
127
127
|
this._defaultPrevented = true;
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
+
class AcceptableEvent {
|
|
131
|
+
constructor() {
|
|
132
|
+
this._isAccepted = false;
|
|
133
|
+
}
|
|
134
|
+
get isAccepted() {
|
|
135
|
+
return this._isAccepted;
|
|
136
|
+
}
|
|
137
|
+
accept() {
|
|
138
|
+
this._isAccepted = true;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
130
141
|
class LeakageMonitor {
|
|
131
142
|
constructor() {
|
|
132
143
|
this.events = new Map();
|
|
@@ -1518,6 +1529,23 @@ class Splitview {
|
|
|
1518
1529
|
}
|
|
1519
1530
|
}
|
|
1520
1531
|
|
|
1532
|
+
const PROPERTY_KEYS_SPLITVIEW = (() => {
|
|
1533
|
+
/**
|
|
1534
|
+
* by readong the keys from an empty value object TypeScript will error
|
|
1535
|
+
* when we add or remove new properties to `DockviewOptions`
|
|
1536
|
+
*/
|
|
1537
|
+
const properties = {
|
|
1538
|
+
orientation: undefined,
|
|
1539
|
+
descriptor: undefined,
|
|
1540
|
+
proportionalLayout: undefined,
|
|
1541
|
+
styles: undefined,
|
|
1542
|
+
margin: undefined,
|
|
1543
|
+
disableAutoResizing: undefined,
|
|
1544
|
+
className: undefined,
|
|
1545
|
+
};
|
|
1546
|
+
return Object.keys(properties);
|
|
1547
|
+
})();
|
|
1548
|
+
|
|
1521
1549
|
class Paneview extends CompositeDisposable {
|
|
1522
1550
|
get onDidAddView() {
|
|
1523
1551
|
return this.splitview.onDidAddView;
|
|
@@ -2647,6 +2675,21 @@ class Gridview {
|
|
|
2647
2675
|
}
|
|
2648
2676
|
}
|
|
2649
2677
|
|
|
2678
|
+
const PROPERTY_KEYS_GRIDVIEW = (() => {
|
|
2679
|
+
/**
|
|
2680
|
+
* by readong the keys from an empty value object TypeScript will error
|
|
2681
|
+
* when we add or remove new properties to `DockviewOptions`
|
|
2682
|
+
*/
|
|
2683
|
+
const properties = {
|
|
2684
|
+
disableAutoResizing: undefined,
|
|
2685
|
+
proportionalLayout: undefined,
|
|
2686
|
+
orientation: undefined,
|
|
2687
|
+
hideBorders: undefined,
|
|
2688
|
+
className: undefined,
|
|
2689
|
+
};
|
|
2690
|
+
return Object.keys(properties);
|
|
2691
|
+
})();
|
|
2692
|
+
|
|
2650
2693
|
class Resizable extends CompositeDisposable {
|
|
2651
2694
|
get element() {
|
|
2652
2695
|
return this._element;
|
|
@@ -3124,15 +3167,10 @@ class PaneviewApi {
|
|
|
3124
3167
|
* Invoked when a Drag'n'Drop event occurs that the component was unable to handle. Exposed for custom Drag'n'Drop functionality.
|
|
3125
3168
|
*/
|
|
3126
3169
|
get onDidDrop() {
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
emitter.dispose = () => {
|
|
3132
|
-
disposable.dispose();
|
|
3133
|
-
emitter.dispose();
|
|
3134
|
-
};
|
|
3135
|
-
return emitter.event;
|
|
3170
|
+
return this.component.onDidDrop;
|
|
3171
|
+
}
|
|
3172
|
+
get onUnhandledDragOverEvent() {
|
|
3173
|
+
return this.component.onUnhandledDragOverEvent;
|
|
3136
3174
|
}
|
|
3137
3175
|
constructor(component) {
|
|
3138
3176
|
this.component = component;
|
|
@@ -4059,6 +4097,28 @@ function calculateQuadrantAsPixels(overlayType, x, y, width, height, threshold)
|
|
|
4059
4097
|
return 'center';
|
|
4060
4098
|
}
|
|
4061
4099
|
|
|
4100
|
+
const PROPERTY_KEYS_PANEVIEW = (() => {
|
|
4101
|
+
/**
|
|
4102
|
+
* by readong the keys from an empty value object TypeScript will error
|
|
4103
|
+
* when we add or remove new properties to `DockviewOptions`
|
|
4104
|
+
*/
|
|
4105
|
+
const properties = {
|
|
4106
|
+
disableAutoResizing: undefined,
|
|
4107
|
+
disableDnd: undefined,
|
|
4108
|
+
className: undefined,
|
|
4109
|
+
};
|
|
4110
|
+
return Object.keys(properties);
|
|
4111
|
+
})();
|
|
4112
|
+
class PaneviewUnhandledDragOverEvent extends AcceptableEvent {
|
|
4113
|
+
constructor(nativeEvent, position, getData, panel) {
|
|
4114
|
+
super();
|
|
4115
|
+
this.nativeEvent = nativeEvent;
|
|
4116
|
+
this.position = position;
|
|
4117
|
+
this.getData = getData;
|
|
4118
|
+
this.panel = panel;
|
|
4119
|
+
}
|
|
4120
|
+
}
|
|
4121
|
+
|
|
4062
4122
|
class WillFocusEvent extends DockviewEvent {
|
|
4063
4123
|
constructor() {
|
|
4064
4124
|
super();
|
|
@@ -4482,6 +4542,9 @@ class DraggablePaneviewPanel extends PaneviewPanel {
|
|
|
4482
4542
|
this.accessor = accessor;
|
|
4483
4543
|
this._onDidDrop = new Emitter();
|
|
4484
4544
|
this.onDidDrop = this._onDidDrop.event;
|
|
4545
|
+
this._onUnhandledDragOverEvent = new Emitter();
|
|
4546
|
+
this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
|
|
4547
|
+
this.addDisposables(this._onDidDrop, this._onUnhandledDragOverEvent);
|
|
4485
4548
|
if (!disableDnd) {
|
|
4486
4549
|
this.initDragFeatures();
|
|
4487
4550
|
}
|
|
@@ -4508,7 +4571,7 @@ class DraggablePaneviewPanel extends PaneviewPanel {
|
|
|
4508
4571
|
overlayModel: {
|
|
4509
4572
|
activationSize: { type: 'percentage', value: 50 },
|
|
4510
4573
|
},
|
|
4511
|
-
canDisplayOverlay: (event) => {
|
|
4574
|
+
canDisplayOverlay: (event, position) => {
|
|
4512
4575
|
const data = getPaneData();
|
|
4513
4576
|
if (data) {
|
|
4514
4577
|
if (data.paneId !== this.id &&
|
|
@@ -4516,14 +4579,9 @@ class DraggablePaneviewPanel extends PaneviewPanel {
|
|
|
4516
4579
|
return true;
|
|
4517
4580
|
}
|
|
4518
4581
|
}
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
getData: getPaneData,
|
|
4523
|
-
panel: this,
|
|
4524
|
-
});
|
|
4525
|
-
}
|
|
4526
|
-
return false;
|
|
4582
|
+
const firedEvent = new PaneviewUnhandledDragOverEvent(event, position, getPaneData, this);
|
|
4583
|
+
this._onUnhandledDragOverEvent.fire(firedEvent);
|
|
4584
|
+
return firedEvent.isAccepted;
|
|
4527
4585
|
},
|
|
4528
4586
|
});
|
|
4529
4587
|
this.addDisposables(this._onDidDrop, this.handler, this.target, this.target.onDrop((event) => {
|
|
@@ -4978,15 +5036,7 @@ class TabsContainer extends CompositeDisposable {
|
|
|
4978
5036
|
this._element.appendChild(this.leftActionsContainer);
|
|
4979
5037
|
this._element.appendChild(this.voidContainer.element);
|
|
4980
5038
|
this._element.appendChild(this.rightActionsContainer);
|
|
4981
|
-
this.addDisposables(this.
|
|
4982
|
-
if (e.api.group === this.group) {
|
|
4983
|
-
toggleClass(this._element, 'dv-single-tab', this.size === 1);
|
|
4984
|
-
}
|
|
4985
|
-
}), this.accessor.onDidRemovePanel((e) => {
|
|
4986
|
-
if (e.api.group === this.group) {
|
|
4987
|
-
toggleClass(this._element, 'dv-single-tab', this.size === 1);
|
|
4988
|
-
}
|
|
4989
|
-
}), this._onWillShowOverlay, this._onDrop, this._onTabDragStart, this._onGroupDragStart, this.voidContainer, this.voidContainer.onDragStart((event) => {
|
|
5039
|
+
this.addDisposables(this._onWillShowOverlay, this._onDrop, this._onTabDragStart, this._onGroupDragStart, this.voidContainer, this.voidContainer.onDragStart((event) => {
|
|
4990
5040
|
this._onGroupDragStart.fire({
|
|
4991
5041
|
nativeEvent: event,
|
|
4992
5042
|
group: this.group,
|
|
@@ -5031,20 +5081,6 @@ class TabsContainer extends CompositeDisposable {
|
|
|
5031
5081
|
setActive(_isGroupActive) {
|
|
5032
5082
|
// noop
|
|
5033
5083
|
}
|
|
5034
|
-
addTab(tab, index = this.tabs.length) {
|
|
5035
|
-
if (index < 0 || index > this.tabs.length) {
|
|
5036
|
-
throw new Error('invalid location');
|
|
5037
|
-
}
|
|
5038
|
-
this.tabContainer.insertBefore(tab.value.element, this.tabContainer.children[index]);
|
|
5039
|
-
this.tabs = [
|
|
5040
|
-
...this.tabs.slice(0, index),
|
|
5041
|
-
tab,
|
|
5042
|
-
...this.tabs.slice(index),
|
|
5043
|
-
];
|
|
5044
|
-
if (this.selectedIndex < 0) {
|
|
5045
|
-
this.selectedIndex = index;
|
|
5046
|
-
}
|
|
5047
|
-
}
|
|
5048
5084
|
delete(id) {
|
|
5049
5085
|
const index = this.tabs.findIndex((tab) => tab.value.panel.id === id);
|
|
5050
5086
|
const tabToRemove = this.tabs.splice(index, 1)[0];
|
|
@@ -5052,6 +5088,7 @@ class TabsContainer extends CompositeDisposable {
|
|
|
5052
5088
|
disposable.dispose();
|
|
5053
5089
|
value.dispose();
|
|
5054
5090
|
value.element.remove();
|
|
5091
|
+
this.updateClassnames();
|
|
5055
5092
|
}
|
|
5056
5093
|
setActivePanel(panel) {
|
|
5057
5094
|
this.tabs.forEach((tab) => {
|
|
@@ -5120,25 +5157,37 @@ class TabsContainer extends CompositeDisposable {
|
|
|
5120
5157
|
}
|
|
5121
5158
|
this.tabs = [];
|
|
5122
5159
|
}
|
|
5160
|
+
addTab(tab, index = this.tabs.length) {
|
|
5161
|
+
if (index < 0 || index > this.tabs.length) {
|
|
5162
|
+
throw new Error('invalid location');
|
|
5163
|
+
}
|
|
5164
|
+
this.tabContainer.insertBefore(tab.value.element, this.tabContainer.children[index]);
|
|
5165
|
+
this.tabs = [
|
|
5166
|
+
...this.tabs.slice(0, index),
|
|
5167
|
+
tab,
|
|
5168
|
+
...this.tabs.slice(index),
|
|
5169
|
+
];
|
|
5170
|
+
if (this.selectedIndex < 0) {
|
|
5171
|
+
this.selectedIndex = index;
|
|
5172
|
+
}
|
|
5173
|
+
this.updateClassnames();
|
|
5174
|
+
}
|
|
5175
|
+
updateClassnames() {
|
|
5176
|
+
toggleClass(this._element, 'dv-single-tab', this.size === 1);
|
|
5177
|
+
}
|
|
5123
5178
|
}
|
|
5124
5179
|
|
|
5125
|
-
class DockviewUnhandledDragOverEvent {
|
|
5126
|
-
get isAccepted() {
|
|
5127
|
-
return this._isAccepted;
|
|
5128
|
-
}
|
|
5180
|
+
class DockviewUnhandledDragOverEvent extends AcceptableEvent {
|
|
5129
5181
|
constructor(nativeEvent, target, position, getData, group) {
|
|
5182
|
+
super();
|
|
5130
5183
|
this.nativeEvent = nativeEvent;
|
|
5131
5184
|
this.target = target;
|
|
5132
5185
|
this.position = position;
|
|
5133
5186
|
this.getData = getData;
|
|
5134
5187
|
this.group = group;
|
|
5135
|
-
this._isAccepted = false;
|
|
5136
|
-
}
|
|
5137
|
-
accept() {
|
|
5138
|
-
this._isAccepted = true;
|
|
5139
5188
|
}
|
|
5140
5189
|
}
|
|
5141
|
-
const
|
|
5190
|
+
const PROPERTY_KEYS_DOCKVIEW = (() => {
|
|
5142
5191
|
/**
|
|
5143
5192
|
* by readong the keys from an empty value object TypeScript will error
|
|
5144
5193
|
* when we add or remove new properties to `DockviewOptions`
|
|
@@ -9007,31 +9056,6 @@ class DockviewComponent extends BaseGrid {
|
|
|
9007
9056
|
}
|
|
9008
9057
|
}
|
|
9009
9058
|
|
|
9010
|
-
function createComponent(id, componentName, components = {}, frameworkComponents = {}, createFrameworkComponent, fallback) {
|
|
9011
|
-
const Component = typeof componentName === 'string'
|
|
9012
|
-
? components[componentName]
|
|
9013
|
-
: undefined;
|
|
9014
|
-
const FrameworkComponent = typeof componentName === 'string'
|
|
9015
|
-
? frameworkComponents[componentName]
|
|
9016
|
-
: undefined;
|
|
9017
|
-
if (Component && FrameworkComponent) {
|
|
9018
|
-
throw new Error(`Cannot create '${id}'. component '${componentName}' registered as both a component and frameworkComponent`);
|
|
9019
|
-
}
|
|
9020
|
-
if (FrameworkComponent) {
|
|
9021
|
-
if (!createFrameworkComponent) {
|
|
9022
|
-
throw new Error(`Cannot create '${id}' for framework component '${componentName}'. you must register a frameworkPanelWrapper to use framework components`);
|
|
9023
|
-
}
|
|
9024
|
-
return createFrameworkComponent.createComponent(id, componentName, FrameworkComponent);
|
|
9025
|
-
}
|
|
9026
|
-
if (!Component) {
|
|
9027
|
-
if (fallback) {
|
|
9028
|
-
return fallback();
|
|
9029
|
-
}
|
|
9030
|
-
throw new Error(`Cannot create '${id}', no component '${componentName}' provided`);
|
|
9031
|
-
}
|
|
9032
|
-
return new Component(id, componentName);
|
|
9033
|
-
}
|
|
9034
|
-
|
|
9035
9059
|
class GridviewComponent extends BaseGrid {
|
|
9036
9060
|
get orientation() {
|
|
9037
9061
|
return this.gridview.orientation;
|
|
@@ -9049,10 +9073,13 @@ class GridviewComponent extends BaseGrid {
|
|
|
9049
9073
|
this._deserializer = value;
|
|
9050
9074
|
}
|
|
9051
9075
|
constructor(parentElement, options) {
|
|
9076
|
+
var _a;
|
|
9052
9077
|
super(parentElement, {
|
|
9053
|
-
proportionalLayout: options.proportionalLayout,
|
|
9078
|
+
proportionalLayout: (_a = options.proportionalLayout) !== null && _a !== void 0 ? _a : true,
|
|
9054
9079
|
orientation: options.orientation,
|
|
9055
|
-
styles: options.
|
|
9080
|
+
styles: options.hideBorders
|
|
9081
|
+
? { separatorBorder: 'transparent' }
|
|
9082
|
+
: undefined,
|
|
9056
9083
|
disableAutoResizing: options.disableAutoResizing,
|
|
9057
9084
|
className: options.className,
|
|
9058
9085
|
});
|
|
@@ -9072,12 +9099,6 @@ class GridviewComponent extends BaseGrid {
|
|
|
9072
9099
|
}), this.onDidActiveChange((event) => {
|
|
9073
9100
|
this._onDidActiveGroupChange.fire(event);
|
|
9074
9101
|
}));
|
|
9075
|
-
if (!this.options.components) {
|
|
9076
|
-
this.options.components = {};
|
|
9077
|
-
}
|
|
9078
|
-
if (!this.options.frameworkComponents) {
|
|
9079
|
-
this.options.frameworkComponents = {};
|
|
9080
|
-
}
|
|
9081
9102
|
}
|
|
9082
9103
|
updateOptions(options) {
|
|
9083
9104
|
super.updateOptions(options);
|
|
@@ -9127,14 +9148,11 @@ class GridviewComponent extends BaseGrid {
|
|
|
9127
9148
|
const height = this.height;
|
|
9128
9149
|
this.gridview.deserialize(grid, {
|
|
9129
9150
|
fromJSON: (node) => {
|
|
9130
|
-
var _a, _b;
|
|
9131
9151
|
const { data } = node;
|
|
9132
|
-
const view =
|
|
9133
|
-
|
|
9134
|
-
|
|
9135
|
-
|
|
9136
|
-
}
|
|
9137
|
-
: undefined);
|
|
9152
|
+
const view = this.options.createComponent({
|
|
9153
|
+
id: data.id,
|
|
9154
|
+
name: data.component,
|
|
9155
|
+
});
|
|
9138
9156
|
queue.push(() => view.init({
|
|
9139
9157
|
params: data.params,
|
|
9140
9158
|
minimumWidth: data.minimumWidth,
|
|
@@ -9212,7 +9230,7 @@ class GridviewComponent extends BaseGrid {
|
|
|
9212
9230
|
this.doAddGroup(removedPanel, relativeLocation, options.size);
|
|
9213
9231
|
}
|
|
9214
9232
|
addPanel(options) {
|
|
9215
|
-
var _a, _b, _c, _d
|
|
9233
|
+
var _a, _b, _c, _d;
|
|
9216
9234
|
let relativeLocation = (_a = options.location) !== null && _a !== void 0 ? _a : [0];
|
|
9217
9235
|
if ((_b = options.position) === null || _b === void 0 ? void 0 : _b.referencePanel) {
|
|
9218
9236
|
const referenceGroup = (_c = this._groups.get(options.position.referencePanel)) === null || _c === void 0 ? void 0 : _c.value;
|
|
@@ -9228,14 +9246,12 @@ class GridviewComponent extends BaseGrid {
|
|
|
9228
9246
|
relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
|
|
9229
9247
|
}
|
|
9230
9248
|
}
|
|
9231
|
-
const view =
|
|
9232
|
-
|
|
9233
|
-
|
|
9234
|
-
|
|
9235
|
-
}
|
|
9236
|
-
: undefined);
|
|
9249
|
+
const view = this.options.createComponent({
|
|
9250
|
+
id: options.id,
|
|
9251
|
+
name: options.component,
|
|
9252
|
+
});
|
|
9237
9253
|
view.init({
|
|
9238
|
-
params: (
|
|
9254
|
+
params: (_d = options.params) !== null && _d !== void 0 ? _d : {},
|
|
9239
9255
|
minimumWidth: options.minimumWidth,
|
|
9240
9256
|
maximumWidth: options.maximumWidth,
|
|
9241
9257
|
minimumHeight: options.minimumHeight,
|
|
@@ -9363,12 +9379,6 @@ class SplitviewComponent extends Resizable {
|
|
|
9363
9379
|
this._classNames = new Classnames(this.element);
|
|
9364
9380
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9365
9381
|
this._options = options;
|
|
9366
|
-
if (!options.components) {
|
|
9367
|
-
options.components = {};
|
|
9368
|
-
}
|
|
9369
|
-
if (!options.frameworkComponents) {
|
|
9370
|
-
options.frameworkComponents = {};
|
|
9371
|
-
}
|
|
9372
9382
|
this.splitview = new Splitview(this.element, options);
|
|
9373
9383
|
this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
|
|
9374
9384
|
}
|
|
@@ -9431,18 +9441,17 @@ class SplitviewComponent extends Resizable {
|
|
|
9431
9441
|
return this.panels.find((view) => view.id === id);
|
|
9432
9442
|
}
|
|
9433
9443
|
addPanel(options) {
|
|
9434
|
-
var _a
|
|
9444
|
+
var _a;
|
|
9435
9445
|
if (this._panels.has(options.id)) {
|
|
9436
9446
|
throw new Error(`panel ${options.id} already exists`);
|
|
9437
9447
|
}
|
|
9438
|
-
const view =
|
|
9439
|
-
|
|
9440
|
-
|
|
9441
|
-
|
|
9442
|
-
: undefined);
|
|
9448
|
+
const view = this.options.createComponent({
|
|
9449
|
+
id: options.id,
|
|
9450
|
+
name: options.component,
|
|
9451
|
+
});
|
|
9443
9452
|
view.orientation = this.splitview.orientation;
|
|
9444
9453
|
view.init({
|
|
9445
|
-
params: (
|
|
9454
|
+
params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
|
|
9446
9455
|
minimumSize: options.minimumSize,
|
|
9447
9456
|
maximumSize: options.maximumSize,
|
|
9448
9457
|
snap: options.snap,
|
|
@@ -9504,17 +9513,14 @@ class SplitviewComponent extends Resizable {
|
|
|
9504
9513
|
descriptor: {
|
|
9505
9514
|
size,
|
|
9506
9515
|
views: views.map((view) => {
|
|
9507
|
-
var _a, _b;
|
|
9508
9516
|
const data = view.data;
|
|
9509
9517
|
if (this._panels.has(data.id)) {
|
|
9510
9518
|
throw new Error(`panel ${data.id} already exists`);
|
|
9511
9519
|
}
|
|
9512
|
-
const panel =
|
|
9513
|
-
|
|
9514
|
-
|
|
9515
|
-
|
|
9516
|
-
}
|
|
9517
|
-
: undefined);
|
|
9520
|
+
const panel = this.options.createComponent({
|
|
9521
|
+
id: data.id,
|
|
9522
|
+
name: data.component,
|
|
9523
|
+
});
|
|
9518
9524
|
queue.push(() => {
|
|
9519
9525
|
var _a;
|
|
9520
9526
|
panel.init({
|
|
@@ -9697,16 +9703,12 @@ class PaneviewComponent extends Resizable {
|
|
|
9697
9703
|
this.onDidAddView = this._onDidAddView.event;
|
|
9698
9704
|
this._onDidRemoveView = new Emitter();
|
|
9699
9705
|
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
9700
|
-
this.
|
|
9706
|
+
this._onUnhandledDragOverEvent = new Emitter();
|
|
9707
|
+
this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
|
|
9708
|
+
this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView, this._onUnhandledDragOverEvent);
|
|
9701
9709
|
this._classNames = new Classnames(this.element);
|
|
9702
9710
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9703
9711
|
this._options = options;
|
|
9704
|
-
if (!options.components) {
|
|
9705
|
-
options.components = {};
|
|
9706
|
-
}
|
|
9707
|
-
if (!options.frameworkComponents) {
|
|
9708
|
-
options.frameworkComponents = {};
|
|
9709
|
-
}
|
|
9710
9712
|
this.paneview = new Paneview(this.element, {
|
|
9711
9713
|
// only allow paneview in the vertical orientation for now
|
|
9712
9714
|
orientation: Orientation.VERTICAL,
|
|
@@ -9731,22 +9733,19 @@ class PaneviewComponent extends Resizable {
|
|
|
9731
9733
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
9732
9734
|
}
|
|
9733
9735
|
addPanel(options) {
|
|
9734
|
-
var _a
|
|
9735
|
-
const body =
|
|
9736
|
-
|
|
9737
|
-
|
|
9738
|
-
|
|
9739
|
-
: undefined);
|
|
9736
|
+
var _a;
|
|
9737
|
+
const body = this.options.createComponent({
|
|
9738
|
+
id: options.id,
|
|
9739
|
+
name: options.component,
|
|
9740
|
+
});
|
|
9740
9741
|
let header;
|
|
9741
|
-
if (options.headerComponent) {
|
|
9742
|
-
header =
|
|
9743
|
-
|
|
9744
|
-
|
|
9745
|
-
|
|
9746
|
-
}
|
|
9747
|
-
: undefined);
|
|
9742
|
+
if (options.headerComponent && this.options.createHeaderComponent) {
|
|
9743
|
+
header = this.options.createHeaderComponent({
|
|
9744
|
+
id: options.id,
|
|
9745
|
+
name: options.headerComponent,
|
|
9746
|
+
});
|
|
9748
9747
|
}
|
|
9749
|
-
|
|
9748
|
+
if (!header) {
|
|
9750
9749
|
header = new DefaultHeader();
|
|
9751
9750
|
}
|
|
9752
9751
|
const view = new PaneFramework({
|
|
@@ -9764,7 +9763,7 @@ class PaneviewComponent extends Resizable {
|
|
|
9764
9763
|
const size = typeof options.size === 'number' ? options.size : Sizing.Distribute;
|
|
9765
9764
|
const index = typeof options.index === 'number' ? options.index : undefined;
|
|
9766
9765
|
view.init({
|
|
9767
|
-
params: (
|
|
9766
|
+
params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
|
|
9768
9767
|
minimumBodySize: options.minimumBodySize,
|
|
9769
9768
|
maximumBodySize: options.maximumBodySize,
|
|
9770
9769
|
isExpanded: options.isExpanded,
|
|
@@ -9829,24 +9828,20 @@ class PaneviewComponent extends Resizable {
|
|
|
9829
9828
|
descriptor: {
|
|
9830
9829
|
size,
|
|
9831
9830
|
views: views.map((view) => {
|
|
9832
|
-
var _a, _b, _c, _d;
|
|
9833
9831
|
const data = view.data;
|
|
9834
|
-
const body =
|
|
9835
|
-
|
|
9836
|
-
|
|
9837
|
-
|
|
9838
|
-
}
|
|
9839
|
-
: undefined);
|
|
9832
|
+
const body = this.options.createComponent({
|
|
9833
|
+
id: data.id,
|
|
9834
|
+
name: data.component,
|
|
9835
|
+
});
|
|
9840
9836
|
let header;
|
|
9841
|
-
if (data.headerComponent
|
|
9842
|
-
|
|
9843
|
-
|
|
9844
|
-
|
|
9845
|
-
|
|
9846
|
-
|
|
9847
|
-
: undefined);
|
|
9837
|
+
if (data.headerComponent &&
|
|
9838
|
+
this.options.createHeaderComponent) {
|
|
9839
|
+
header = this.options.createHeaderComponent({
|
|
9840
|
+
id: data.id,
|
|
9841
|
+
name: data.headerComponent,
|
|
9842
|
+
});
|
|
9848
9843
|
}
|
|
9849
|
-
|
|
9844
|
+
if (!header) {
|
|
9850
9845
|
header = new DefaultHeader();
|
|
9851
9846
|
}
|
|
9852
9847
|
const panel = new PaneFramework({
|
|
@@ -9894,9 +9889,11 @@ class PaneviewComponent extends Resizable {
|
|
|
9894
9889
|
this.paneview.dispose();
|
|
9895
9890
|
}
|
|
9896
9891
|
doAddPanel(panel) {
|
|
9897
|
-
const disposable = panel.onDidDrop((event) => {
|
|
9892
|
+
const disposable = new CompositeDisposable(panel.onDidDrop((event) => {
|
|
9898
9893
|
this._onDidDrop.fire(event);
|
|
9899
|
-
})
|
|
9894
|
+
}), panel.onUnhandledDragOverEvent((event) => {
|
|
9895
|
+
this._onUnhandledDragOverEvent.fire(event);
|
|
9896
|
+
}));
|
|
9900
9897
|
this._viewDisposables.set(panel.id, disposable);
|
|
9901
9898
|
}
|
|
9902
9899
|
doRemovePanel(panel) {
|
|
@@ -10038,5 +10035,5 @@ function createPaneview(element, options) {
|
|
|
10038
10035
|
return new PaneviewApi(component);
|
|
10039
10036
|
}
|
|
10040
10037
|
|
|
10041
|
-
export { BaseGrid, ContentContainer, DefaultDockviewDeserialzier, DefaultTab, DockviewApi, DockviewComponent, CompositeDisposable as DockviewCompositeDisposable, DockviewDidDropEvent, Disposable as DockviewDisposable, Emitter as DockviewEmitter, Event as DockviewEvent, DockviewGroupPanel, DockviewGroupPanelModel, MutableDisposable as DockviewMutableDisposable, DockviewPanel, DockviewUnhandledDragOverEvent, DockviewWillDropEvent, DraggablePaneviewPanel, Gridview, GridviewApi, GridviewComponent, GridviewPanel, LayoutPriority, Orientation,
|
|
10038
|
+
export { BaseGrid, ContentContainer, DefaultDockviewDeserialzier, DefaultTab, DockviewApi, DockviewComponent, CompositeDisposable as DockviewCompositeDisposable, DockviewDidDropEvent, Disposable as DockviewDisposable, Emitter as DockviewEmitter, Event as DockviewEvent, DockviewGroupPanel, DockviewGroupPanelModel, MutableDisposable as DockviewMutableDisposable, DockviewPanel, DockviewUnhandledDragOverEvent, DockviewWillDropEvent, DraggablePaneviewPanel, Gridview, GridviewApi, GridviewComponent, GridviewPanel, LayoutPriority, Orientation, PROPERTY_KEYS_DOCKVIEW, PROPERTY_KEYS_GRIDVIEW, PROPERTY_KEYS_PANEVIEW, PROPERTY_KEYS_SPLITVIEW, PaneFramework, PaneTransfer, PanelTransfer, Paneview, PaneviewApi, PaneviewComponent, PaneviewPanel, PaneviewUnhandledDragOverEvent, SashState, Sizing, Splitview, SplitviewApi, SplitviewComponent, SplitviewPanel, Tab, WillShowOverlayLocationEvent, createDockview, createGridview, createPaneview, createSplitview, directionToPosition, getDirectionOrientation, getGridLocation, getLocationOrientation, getPaneData, getPanelData, getRelativeLocation, indexInParent, isGridBranchNode, isGroupOptionsWithGroup, isGroupOptionsWithPanel, isPanelOptionsWithGroup, isPanelOptionsWithPanel, orthogonal, positionToDirection, toTarget };
|
|
10042
10039
|
//# sourceMappingURL=dockview-core.esm.js.map
|