dockview-core 2.1.3 → 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/dockviewComponent.d.ts +0 -1
- package/dist/cjs/dockview/dockviewComponent.js +8 -13
- 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 +168 -172
- 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 +168 -172
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +168 -172
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +164 -172
- 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 +168 -172
- 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 +168 -172
- 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/dockviewComponent.d.ts +0 -1
- package/dist/esm/dockview/dockviewComponent.js +8 -13
- 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`
|
|
@@ -7661,10 +7710,6 @@ class DockviewComponent extends BaseGrid {
|
|
|
7661
7710
|
this._api = new DockviewApi(this);
|
|
7662
7711
|
this.updateWatermark();
|
|
7663
7712
|
}
|
|
7664
|
-
dispose() {
|
|
7665
|
-
this.clear(); // explicitly clear the layout before cleaning up
|
|
7666
|
-
super.dispose();
|
|
7667
|
-
}
|
|
7668
7713
|
setVisible(panel, visible) {
|
|
7669
7714
|
switch (panel.api.location.type) {
|
|
7670
7715
|
case 'grid':
|
|
@@ -7848,30 +7893,29 @@ class DockviewComponent extends BaseGrid {
|
|
|
7848
7893
|
}
|
|
7849
7894
|
}
|
|
7850
7895
|
else if (this.getPanel(group.id)) {
|
|
7851
|
-
|
|
7896
|
+
group.model.renderContainer =
|
|
7897
|
+
this.overlayRenderContainer;
|
|
7898
|
+
returnedGroup = group;
|
|
7852
7899
|
if (floatingBox) {
|
|
7853
|
-
this.addFloatingGroup(
|
|
7900
|
+
this.addFloatingGroup(group, {
|
|
7854
7901
|
height: floatingBox.height,
|
|
7855
7902
|
width: floatingBox.width,
|
|
7856
7903
|
position: floatingBox,
|
|
7857
7904
|
});
|
|
7858
7905
|
}
|
|
7859
7906
|
else {
|
|
7860
|
-
this.doRemoveGroup(
|
|
7907
|
+
this.doRemoveGroup(group, {
|
|
7861
7908
|
skipDispose: true,
|
|
7862
7909
|
skipActive: true,
|
|
7863
7910
|
skipPopoutReturn: true,
|
|
7864
7911
|
});
|
|
7865
|
-
|
|
7866
|
-
this.overlayRenderContainer;
|
|
7867
|
-
removedGroup.model.location = { type: 'grid' };
|
|
7868
|
-
returnedGroup = removedGroup;
|
|
7912
|
+
group.model.location = { type: 'grid' };
|
|
7869
7913
|
this.movingLock(() => {
|
|
7870
7914
|
// suppress group add events since the group already exists
|
|
7871
|
-
this.doAddGroup(
|
|
7915
|
+
this.doAddGroup(group, [0]);
|
|
7872
7916
|
});
|
|
7873
7917
|
}
|
|
7874
|
-
this.doSetGroupAndPanelActive(
|
|
7918
|
+
this.doSetGroupAndPanelActive(group);
|
|
7875
7919
|
}
|
|
7876
7920
|
}));
|
|
7877
7921
|
this._popoutGroups.push(value);
|
|
@@ -9012,31 +9056,6 @@ class DockviewComponent extends BaseGrid {
|
|
|
9012
9056
|
}
|
|
9013
9057
|
}
|
|
9014
9058
|
|
|
9015
|
-
function createComponent(id, componentName, components = {}, frameworkComponents = {}, createFrameworkComponent, fallback) {
|
|
9016
|
-
const Component = typeof componentName === 'string'
|
|
9017
|
-
? components[componentName]
|
|
9018
|
-
: undefined;
|
|
9019
|
-
const FrameworkComponent = typeof componentName === 'string'
|
|
9020
|
-
? frameworkComponents[componentName]
|
|
9021
|
-
: undefined;
|
|
9022
|
-
if (Component && FrameworkComponent) {
|
|
9023
|
-
throw new Error(`Cannot create '${id}'. component '${componentName}' registered as both a component and frameworkComponent`);
|
|
9024
|
-
}
|
|
9025
|
-
if (FrameworkComponent) {
|
|
9026
|
-
if (!createFrameworkComponent) {
|
|
9027
|
-
throw new Error(`Cannot create '${id}' for framework component '${componentName}'. you must register a frameworkPanelWrapper to use framework components`);
|
|
9028
|
-
}
|
|
9029
|
-
return createFrameworkComponent.createComponent(id, componentName, FrameworkComponent);
|
|
9030
|
-
}
|
|
9031
|
-
if (!Component) {
|
|
9032
|
-
if (fallback) {
|
|
9033
|
-
return fallback();
|
|
9034
|
-
}
|
|
9035
|
-
throw new Error(`Cannot create '${id}', no component '${componentName}' provided`);
|
|
9036
|
-
}
|
|
9037
|
-
return new Component(id, componentName);
|
|
9038
|
-
}
|
|
9039
|
-
|
|
9040
9059
|
class GridviewComponent extends BaseGrid {
|
|
9041
9060
|
get orientation() {
|
|
9042
9061
|
return this.gridview.orientation;
|
|
@@ -9054,10 +9073,13 @@ class GridviewComponent extends BaseGrid {
|
|
|
9054
9073
|
this._deserializer = value;
|
|
9055
9074
|
}
|
|
9056
9075
|
constructor(parentElement, options) {
|
|
9076
|
+
var _a;
|
|
9057
9077
|
super(parentElement, {
|
|
9058
|
-
proportionalLayout: options.proportionalLayout,
|
|
9078
|
+
proportionalLayout: (_a = options.proportionalLayout) !== null && _a !== void 0 ? _a : true,
|
|
9059
9079
|
orientation: options.orientation,
|
|
9060
|
-
styles: options.
|
|
9080
|
+
styles: options.hideBorders
|
|
9081
|
+
? { separatorBorder: 'transparent' }
|
|
9082
|
+
: undefined,
|
|
9061
9083
|
disableAutoResizing: options.disableAutoResizing,
|
|
9062
9084
|
className: options.className,
|
|
9063
9085
|
});
|
|
@@ -9077,12 +9099,6 @@ class GridviewComponent extends BaseGrid {
|
|
|
9077
9099
|
}), this.onDidActiveChange((event) => {
|
|
9078
9100
|
this._onDidActiveGroupChange.fire(event);
|
|
9079
9101
|
}));
|
|
9080
|
-
if (!this.options.components) {
|
|
9081
|
-
this.options.components = {};
|
|
9082
|
-
}
|
|
9083
|
-
if (!this.options.frameworkComponents) {
|
|
9084
|
-
this.options.frameworkComponents = {};
|
|
9085
|
-
}
|
|
9086
9102
|
}
|
|
9087
9103
|
updateOptions(options) {
|
|
9088
9104
|
super.updateOptions(options);
|
|
@@ -9132,14 +9148,11 @@ class GridviewComponent extends BaseGrid {
|
|
|
9132
9148
|
const height = this.height;
|
|
9133
9149
|
this.gridview.deserialize(grid, {
|
|
9134
9150
|
fromJSON: (node) => {
|
|
9135
|
-
var _a, _b;
|
|
9136
9151
|
const { data } = node;
|
|
9137
|
-
const view =
|
|
9138
|
-
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
}
|
|
9142
|
-
: undefined);
|
|
9152
|
+
const view = this.options.createComponent({
|
|
9153
|
+
id: data.id,
|
|
9154
|
+
name: data.component,
|
|
9155
|
+
});
|
|
9143
9156
|
queue.push(() => view.init({
|
|
9144
9157
|
params: data.params,
|
|
9145
9158
|
minimumWidth: data.minimumWidth,
|
|
@@ -9217,7 +9230,7 @@ class GridviewComponent extends BaseGrid {
|
|
|
9217
9230
|
this.doAddGroup(removedPanel, relativeLocation, options.size);
|
|
9218
9231
|
}
|
|
9219
9232
|
addPanel(options) {
|
|
9220
|
-
var _a, _b, _c, _d
|
|
9233
|
+
var _a, _b, _c, _d;
|
|
9221
9234
|
let relativeLocation = (_a = options.location) !== null && _a !== void 0 ? _a : [0];
|
|
9222
9235
|
if ((_b = options.position) === null || _b === void 0 ? void 0 : _b.referencePanel) {
|
|
9223
9236
|
const referenceGroup = (_c = this._groups.get(options.position.referencePanel)) === null || _c === void 0 ? void 0 : _c.value;
|
|
@@ -9233,14 +9246,12 @@ class GridviewComponent extends BaseGrid {
|
|
|
9233
9246
|
relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
|
|
9234
9247
|
}
|
|
9235
9248
|
}
|
|
9236
|
-
const view =
|
|
9237
|
-
|
|
9238
|
-
|
|
9239
|
-
|
|
9240
|
-
}
|
|
9241
|
-
: undefined);
|
|
9249
|
+
const view = this.options.createComponent({
|
|
9250
|
+
id: options.id,
|
|
9251
|
+
name: options.component,
|
|
9252
|
+
});
|
|
9242
9253
|
view.init({
|
|
9243
|
-
params: (
|
|
9254
|
+
params: (_d = options.params) !== null && _d !== void 0 ? _d : {},
|
|
9244
9255
|
minimumWidth: options.minimumWidth,
|
|
9245
9256
|
maximumWidth: options.maximumWidth,
|
|
9246
9257
|
minimumHeight: options.minimumHeight,
|
|
@@ -9368,12 +9379,6 @@ class SplitviewComponent extends Resizable {
|
|
|
9368
9379
|
this._classNames = new Classnames(this.element);
|
|
9369
9380
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9370
9381
|
this._options = options;
|
|
9371
|
-
if (!options.components) {
|
|
9372
|
-
options.components = {};
|
|
9373
|
-
}
|
|
9374
|
-
if (!options.frameworkComponents) {
|
|
9375
|
-
options.frameworkComponents = {};
|
|
9376
|
-
}
|
|
9377
9382
|
this.splitview = new Splitview(this.element, options);
|
|
9378
9383
|
this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
|
|
9379
9384
|
}
|
|
@@ -9436,18 +9441,17 @@ class SplitviewComponent extends Resizable {
|
|
|
9436
9441
|
return this.panels.find((view) => view.id === id);
|
|
9437
9442
|
}
|
|
9438
9443
|
addPanel(options) {
|
|
9439
|
-
var _a
|
|
9444
|
+
var _a;
|
|
9440
9445
|
if (this._panels.has(options.id)) {
|
|
9441
9446
|
throw new Error(`panel ${options.id} already exists`);
|
|
9442
9447
|
}
|
|
9443
|
-
const view =
|
|
9444
|
-
|
|
9445
|
-
|
|
9446
|
-
|
|
9447
|
-
: undefined);
|
|
9448
|
+
const view = this.options.createComponent({
|
|
9449
|
+
id: options.id,
|
|
9450
|
+
name: options.component,
|
|
9451
|
+
});
|
|
9448
9452
|
view.orientation = this.splitview.orientation;
|
|
9449
9453
|
view.init({
|
|
9450
|
-
params: (
|
|
9454
|
+
params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
|
|
9451
9455
|
minimumSize: options.minimumSize,
|
|
9452
9456
|
maximumSize: options.maximumSize,
|
|
9453
9457
|
snap: options.snap,
|
|
@@ -9509,17 +9513,14 @@ class SplitviewComponent extends Resizable {
|
|
|
9509
9513
|
descriptor: {
|
|
9510
9514
|
size,
|
|
9511
9515
|
views: views.map((view) => {
|
|
9512
|
-
var _a, _b;
|
|
9513
9516
|
const data = view.data;
|
|
9514
9517
|
if (this._panels.has(data.id)) {
|
|
9515
9518
|
throw new Error(`panel ${data.id} already exists`);
|
|
9516
9519
|
}
|
|
9517
|
-
const panel =
|
|
9518
|
-
|
|
9519
|
-
|
|
9520
|
-
|
|
9521
|
-
}
|
|
9522
|
-
: undefined);
|
|
9520
|
+
const panel = this.options.createComponent({
|
|
9521
|
+
id: data.id,
|
|
9522
|
+
name: data.component,
|
|
9523
|
+
});
|
|
9523
9524
|
queue.push(() => {
|
|
9524
9525
|
var _a;
|
|
9525
9526
|
panel.init({
|
|
@@ -9702,16 +9703,12 @@ class PaneviewComponent extends Resizable {
|
|
|
9702
9703
|
this.onDidAddView = this._onDidAddView.event;
|
|
9703
9704
|
this._onDidRemoveView = new Emitter();
|
|
9704
9705
|
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
9705
|
-
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);
|
|
9706
9709
|
this._classNames = new Classnames(this.element);
|
|
9707
9710
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9708
9711
|
this._options = options;
|
|
9709
|
-
if (!options.components) {
|
|
9710
|
-
options.components = {};
|
|
9711
|
-
}
|
|
9712
|
-
if (!options.frameworkComponents) {
|
|
9713
|
-
options.frameworkComponents = {};
|
|
9714
|
-
}
|
|
9715
9712
|
this.paneview = new Paneview(this.element, {
|
|
9716
9713
|
// only allow paneview in the vertical orientation for now
|
|
9717
9714
|
orientation: Orientation.VERTICAL,
|
|
@@ -9736,22 +9733,19 @@ class PaneviewComponent extends Resizable {
|
|
|
9736
9733
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
9737
9734
|
}
|
|
9738
9735
|
addPanel(options) {
|
|
9739
|
-
var _a
|
|
9740
|
-
const body =
|
|
9741
|
-
|
|
9742
|
-
|
|
9743
|
-
|
|
9744
|
-
: undefined);
|
|
9736
|
+
var _a;
|
|
9737
|
+
const body = this.options.createComponent({
|
|
9738
|
+
id: options.id,
|
|
9739
|
+
name: options.component,
|
|
9740
|
+
});
|
|
9745
9741
|
let header;
|
|
9746
|
-
if (options.headerComponent) {
|
|
9747
|
-
header =
|
|
9748
|
-
|
|
9749
|
-
|
|
9750
|
-
|
|
9751
|
-
}
|
|
9752
|
-
: undefined);
|
|
9742
|
+
if (options.headerComponent && this.options.createHeaderComponent) {
|
|
9743
|
+
header = this.options.createHeaderComponent({
|
|
9744
|
+
id: options.id,
|
|
9745
|
+
name: options.headerComponent,
|
|
9746
|
+
});
|
|
9753
9747
|
}
|
|
9754
|
-
|
|
9748
|
+
if (!header) {
|
|
9755
9749
|
header = new DefaultHeader();
|
|
9756
9750
|
}
|
|
9757
9751
|
const view = new PaneFramework({
|
|
@@ -9769,7 +9763,7 @@ class PaneviewComponent extends Resizable {
|
|
|
9769
9763
|
const size = typeof options.size === 'number' ? options.size : Sizing.Distribute;
|
|
9770
9764
|
const index = typeof options.index === 'number' ? options.index : undefined;
|
|
9771
9765
|
view.init({
|
|
9772
|
-
params: (
|
|
9766
|
+
params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
|
|
9773
9767
|
minimumBodySize: options.minimumBodySize,
|
|
9774
9768
|
maximumBodySize: options.maximumBodySize,
|
|
9775
9769
|
isExpanded: options.isExpanded,
|
|
@@ -9834,24 +9828,20 @@ class PaneviewComponent extends Resizable {
|
|
|
9834
9828
|
descriptor: {
|
|
9835
9829
|
size,
|
|
9836
9830
|
views: views.map((view) => {
|
|
9837
|
-
var _a, _b, _c, _d;
|
|
9838
9831
|
const data = view.data;
|
|
9839
|
-
const body =
|
|
9840
|
-
|
|
9841
|
-
|
|
9842
|
-
|
|
9843
|
-
}
|
|
9844
|
-
: undefined);
|
|
9832
|
+
const body = this.options.createComponent({
|
|
9833
|
+
id: data.id,
|
|
9834
|
+
name: data.component,
|
|
9835
|
+
});
|
|
9845
9836
|
let header;
|
|
9846
|
-
if (data.headerComponent
|
|
9847
|
-
|
|
9848
|
-
|
|
9849
|
-
|
|
9850
|
-
|
|
9851
|
-
|
|
9852
|
-
: undefined);
|
|
9837
|
+
if (data.headerComponent &&
|
|
9838
|
+
this.options.createHeaderComponent) {
|
|
9839
|
+
header = this.options.createHeaderComponent({
|
|
9840
|
+
id: data.id,
|
|
9841
|
+
name: data.headerComponent,
|
|
9842
|
+
});
|
|
9853
9843
|
}
|
|
9854
|
-
|
|
9844
|
+
if (!header) {
|
|
9855
9845
|
header = new DefaultHeader();
|
|
9856
9846
|
}
|
|
9857
9847
|
const panel = new PaneFramework({
|
|
@@ -9899,9 +9889,11 @@ class PaneviewComponent extends Resizable {
|
|
|
9899
9889
|
this.paneview.dispose();
|
|
9900
9890
|
}
|
|
9901
9891
|
doAddPanel(panel) {
|
|
9902
|
-
const disposable = panel.onDidDrop((event) => {
|
|
9892
|
+
const disposable = new CompositeDisposable(panel.onDidDrop((event) => {
|
|
9903
9893
|
this._onDidDrop.fire(event);
|
|
9904
|
-
})
|
|
9894
|
+
}), panel.onUnhandledDragOverEvent((event) => {
|
|
9895
|
+
this._onUnhandledDragOverEvent.fire(event);
|
|
9896
|
+
}));
|
|
9905
9897
|
this._viewDisposables.set(panel.id, disposable);
|
|
9906
9898
|
}
|
|
9907
9899
|
doRemovePanel(panel) {
|
|
@@ -10043,5 +10035,5 @@ function createPaneview(element, options) {
|
|
|
10043
10035
|
return new PaneviewApi(component);
|
|
10044
10036
|
}
|
|
10045
10037
|
|
|
10046
|
-
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 };
|
|
10047
10039
|
//# sourceMappingURL=dockview-core.esm.js.map
|