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
|
*/
|
|
@@ -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;
|
|
@@ -2756,7 +2799,7 @@ class BaseGrid extends Resizable {
|
|
|
2756
2799
|
}
|
|
2757
2800
|
constructor(parentElement, options) {
|
|
2758
2801
|
var _a;
|
|
2759
|
-
super(
|
|
2802
|
+
super(parentElement, options.disableAutoResizing);
|
|
2760
2803
|
this._id = nextLayoutId$1.next();
|
|
2761
2804
|
this._groups = new Map();
|
|
2762
2805
|
this._onDidRemove = new Emitter();
|
|
@@ -2775,7 +2818,6 @@ class BaseGrid extends Resizable {
|
|
|
2775
2818
|
this.element.style.width = '100%';
|
|
2776
2819
|
this._classNames = new Classnames(this.element);
|
|
2777
2820
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
2778
|
-
parentElement.appendChild(this.element);
|
|
2779
2821
|
this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation, options.locked, options.margin);
|
|
2780
2822
|
this.gridview.locked = !!options.locked;
|
|
2781
2823
|
this.element.appendChild(this.gridview.element);
|
|
@@ -3124,15 +3166,10 @@ class PaneviewApi {
|
|
|
3124
3166
|
* Invoked when a Drag'n'Drop event occurs that the component was unable to handle. Exposed for custom Drag'n'Drop functionality.
|
|
3125
3167
|
*/
|
|
3126
3168
|
get onDidDrop() {
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
emitter.dispose = () => {
|
|
3132
|
-
disposable.dispose();
|
|
3133
|
-
emitter.dispose();
|
|
3134
|
-
};
|
|
3135
|
-
return emitter.event;
|
|
3169
|
+
return this.component.onDidDrop;
|
|
3170
|
+
}
|
|
3171
|
+
get onUnhandledDragOverEvent() {
|
|
3172
|
+
return this.component.onUnhandledDragOverEvent;
|
|
3136
3173
|
}
|
|
3137
3174
|
constructor(component) {
|
|
3138
3175
|
this.component = component;
|
|
@@ -4059,6 +4096,28 @@ function calculateQuadrantAsPixels(overlayType, x, y, width, height, threshold)
|
|
|
4059
4096
|
return 'center';
|
|
4060
4097
|
}
|
|
4061
4098
|
|
|
4099
|
+
const PROPERTY_KEYS_PANEVIEW = (() => {
|
|
4100
|
+
/**
|
|
4101
|
+
* by readong the keys from an empty value object TypeScript will error
|
|
4102
|
+
* when we add or remove new properties to `DockviewOptions`
|
|
4103
|
+
*/
|
|
4104
|
+
const properties = {
|
|
4105
|
+
disableAutoResizing: undefined,
|
|
4106
|
+
disableDnd: undefined,
|
|
4107
|
+
className: undefined,
|
|
4108
|
+
};
|
|
4109
|
+
return Object.keys(properties);
|
|
4110
|
+
})();
|
|
4111
|
+
class PaneviewUnhandledDragOverEvent extends AcceptableEvent {
|
|
4112
|
+
constructor(nativeEvent, position, getData, panel) {
|
|
4113
|
+
super();
|
|
4114
|
+
this.nativeEvent = nativeEvent;
|
|
4115
|
+
this.position = position;
|
|
4116
|
+
this.getData = getData;
|
|
4117
|
+
this.panel = panel;
|
|
4118
|
+
}
|
|
4119
|
+
}
|
|
4120
|
+
|
|
4062
4121
|
class WillFocusEvent extends DockviewEvent {
|
|
4063
4122
|
constructor() {
|
|
4064
4123
|
super();
|
|
@@ -4482,6 +4541,9 @@ class DraggablePaneviewPanel extends PaneviewPanel {
|
|
|
4482
4541
|
this.accessor = accessor;
|
|
4483
4542
|
this._onDidDrop = new Emitter();
|
|
4484
4543
|
this.onDidDrop = this._onDidDrop.event;
|
|
4544
|
+
this._onUnhandledDragOverEvent = new Emitter();
|
|
4545
|
+
this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
|
|
4546
|
+
this.addDisposables(this._onDidDrop, this._onUnhandledDragOverEvent);
|
|
4485
4547
|
if (!disableDnd) {
|
|
4486
4548
|
this.initDragFeatures();
|
|
4487
4549
|
}
|
|
@@ -4508,7 +4570,7 @@ class DraggablePaneviewPanel extends PaneviewPanel {
|
|
|
4508
4570
|
overlayModel: {
|
|
4509
4571
|
activationSize: { type: 'percentage', value: 50 },
|
|
4510
4572
|
},
|
|
4511
|
-
canDisplayOverlay: (event) => {
|
|
4573
|
+
canDisplayOverlay: (event, position) => {
|
|
4512
4574
|
const data = getPaneData();
|
|
4513
4575
|
if (data) {
|
|
4514
4576
|
if (data.paneId !== this.id &&
|
|
@@ -4516,14 +4578,9 @@ class DraggablePaneviewPanel extends PaneviewPanel {
|
|
|
4516
4578
|
return true;
|
|
4517
4579
|
}
|
|
4518
4580
|
}
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
getData: getPaneData,
|
|
4523
|
-
panel: this,
|
|
4524
|
-
});
|
|
4525
|
-
}
|
|
4526
|
-
return false;
|
|
4581
|
+
const firedEvent = new PaneviewUnhandledDragOverEvent(event, position, getPaneData, this);
|
|
4582
|
+
this._onUnhandledDragOverEvent.fire(firedEvent);
|
|
4583
|
+
return firedEvent.isAccepted;
|
|
4527
4584
|
},
|
|
4528
4585
|
});
|
|
4529
4586
|
this.addDisposables(this._onDidDrop, this.handler, this.target, this.target.onDrop((event) => {
|
|
@@ -4978,15 +5035,7 @@ class TabsContainer extends CompositeDisposable {
|
|
|
4978
5035
|
this._element.appendChild(this.leftActionsContainer);
|
|
4979
5036
|
this._element.appendChild(this.voidContainer.element);
|
|
4980
5037
|
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) => {
|
|
5038
|
+
this.addDisposables(this._onWillShowOverlay, this._onDrop, this._onTabDragStart, this._onGroupDragStart, this.voidContainer, this.voidContainer.onDragStart((event) => {
|
|
4990
5039
|
this._onGroupDragStart.fire({
|
|
4991
5040
|
nativeEvent: event,
|
|
4992
5041
|
group: this.group,
|
|
@@ -5031,20 +5080,6 @@ class TabsContainer extends CompositeDisposable {
|
|
|
5031
5080
|
setActive(_isGroupActive) {
|
|
5032
5081
|
// noop
|
|
5033
5082
|
}
|
|
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
5083
|
delete(id) {
|
|
5049
5084
|
const index = this.tabs.findIndex((tab) => tab.value.panel.id === id);
|
|
5050
5085
|
const tabToRemove = this.tabs.splice(index, 1)[0];
|
|
@@ -5052,6 +5087,7 @@ class TabsContainer extends CompositeDisposable {
|
|
|
5052
5087
|
disposable.dispose();
|
|
5053
5088
|
value.dispose();
|
|
5054
5089
|
value.element.remove();
|
|
5090
|
+
this.updateClassnames();
|
|
5055
5091
|
}
|
|
5056
5092
|
setActivePanel(panel) {
|
|
5057
5093
|
this.tabs.forEach((tab) => {
|
|
@@ -5120,25 +5156,37 @@ class TabsContainer extends CompositeDisposable {
|
|
|
5120
5156
|
}
|
|
5121
5157
|
this.tabs = [];
|
|
5122
5158
|
}
|
|
5159
|
+
addTab(tab, index = this.tabs.length) {
|
|
5160
|
+
if (index < 0 || index > this.tabs.length) {
|
|
5161
|
+
throw new Error('invalid location');
|
|
5162
|
+
}
|
|
5163
|
+
this.tabContainer.insertBefore(tab.value.element, this.tabContainer.children[index]);
|
|
5164
|
+
this.tabs = [
|
|
5165
|
+
...this.tabs.slice(0, index),
|
|
5166
|
+
tab,
|
|
5167
|
+
...this.tabs.slice(index),
|
|
5168
|
+
];
|
|
5169
|
+
if (this.selectedIndex < 0) {
|
|
5170
|
+
this.selectedIndex = index;
|
|
5171
|
+
}
|
|
5172
|
+
this.updateClassnames();
|
|
5173
|
+
}
|
|
5174
|
+
updateClassnames() {
|
|
5175
|
+
toggleClass(this._element, 'dv-single-tab', this.size === 1);
|
|
5176
|
+
}
|
|
5123
5177
|
}
|
|
5124
5178
|
|
|
5125
|
-
class DockviewUnhandledDragOverEvent {
|
|
5126
|
-
get isAccepted() {
|
|
5127
|
-
return this._isAccepted;
|
|
5128
|
-
}
|
|
5179
|
+
class DockviewUnhandledDragOverEvent extends AcceptableEvent {
|
|
5129
5180
|
constructor(nativeEvent, target, position, getData, group) {
|
|
5181
|
+
super();
|
|
5130
5182
|
this.nativeEvent = nativeEvent;
|
|
5131
5183
|
this.target = target;
|
|
5132
5184
|
this.position = position;
|
|
5133
5185
|
this.getData = getData;
|
|
5134
5186
|
this.group = group;
|
|
5135
|
-
this._isAccepted = false;
|
|
5136
|
-
}
|
|
5137
|
-
accept() {
|
|
5138
|
-
this._isAccepted = true;
|
|
5139
5187
|
}
|
|
5140
5188
|
}
|
|
5141
|
-
const
|
|
5189
|
+
const PROPERTY_KEYS_DOCKVIEW = (() => {
|
|
5142
5190
|
/**
|
|
5143
5191
|
* by readong the keys from an empty value object TypeScript will error
|
|
5144
5192
|
* when we add or remove new properties to `DockviewOptions`
|
|
@@ -9007,31 +9055,6 @@ class DockviewComponent extends BaseGrid {
|
|
|
9007
9055
|
}
|
|
9008
9056
|
}
|
|
9009
9057
|
|
|
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
9058
|
class GridviewComponent extends BaseGrid {
|
|
9036
9059
|
get orientation() {
|
|
9037
9060
|
return this.gridview.orientation;
|
|
@@ -9049,10 +9072,13 @@ class GridviewComponent extends BaseGrid {
|
|
|
9049
9072
|
this._deserializer = value;
|
|
9050
9073
|
}
|
|
9051
9074
|
constructor(parentElement, options) {
|
|
9075
|
+
var _a;
|
|
9052
9076
|
super(parentElement, {
|
|
9053
|
-
proportionalLayout: options.proportionalLayout,
|
|
9077
|
+
proportionalLayout: (_a = options.proportionalLayout) !== null && _a !== void 0 ? _a : true,
|
|
9054
9078
|
orientation: options.orientation,
|
|
9055
|
-
styles: options.
|
|
9079
|
+
styles: options.hideBorders
|
|
9080
|
+
? { separatorBorder: 'transparent' }
|
|
9081
|
+
: undefined,
|
|
9056
9082
|
disableAutoResizing: options.disableAutoResizing,
|
|
9057
9083
|
className: options.className,
|
|
9058
9084
|
});
|
|
@@ -9072,12 +9098,6 @@ class GridviewComponent extends BaseGrid {
|
|
|
9072
9098
|
}), this.onDidActiveChange((event) => {
|
|
9073
9099
|
this._onDidActiveGroupChange.fire(event);
|
|
9074
9100
|
}));
|
|
9075
|
-
if (!this.options.components) {
|
|
9076
|
-
this.options.components = {};
|
|
9077
|
-
}
|
|
9078
|
-
if (!this.options.frameworkComponents) {
|
|
9079
|
-
this.options.frameworkComponents = {};
|
|
9080
|
-
}
|
|
9081
9101
|
}
|
|
9082
9102
|
updateOptions(options) {
|
|
9083
9103
|
super.updateOptions(options);
|
|
@@ -9127,14 +9147,11 @@ class GridviewComponent extends BaseGrid {
|
|
|
9127
9147
|
const height = this.height;
|
|
9128
9148
|
this.gridview.deserialize(grid, {
|
|
9129
9149
|
fromJSON: (node) => {
|
|
9130
|
-
var _a, _b;
|
|
9131
9150
|
const { data } = node;
|
|
9132
|
-
const view =
|
|
9133
|
-
|
|
9134
|
-
|
|
9135
|
-
|
|
9136
|
-
}
|
|
9137
|
-
: undefined);
|
|
9151
|
+
const view = this.options.createComponent({
|
|
9152
|
+
id: data.id,
|
|
9153
|
+
name: data.component,
|
|
9154
|
+
});
|
|
9138
9155
|
queue.push(() => view.init({
|
|
9139
9156
|
params: data.params,
|
|
9140
9157
|
minimumWidth: data.minimumWidth,
|
|
@@ -9212,7 +9229,7 @@ class GridviewComponent extends BaseGrid {
|
|
|
9212
9229
|
this.doAddGroup(removedPanel, relativeLocation, options.size);
|
|
9213
9230
|
}
|
|
9214
9231
|
addPanel(options) {
|
|
9215
|
-
var _a, _b, _c, _d
|
|
9232
|
+
var _a, _b, _c, _d;
|
|
9216
9233
|
let relativeLocation = (_a = options.location) !== null && _a !== void 0 ? _a : [0];
|
|
9217
9234
|
if ((_b = options.position) === null || _b === void 0 ? void 0 : _b.referencePanel) {
|
|
9218
9235
|
const referenceGroup = (_c = this._groups.get(options.position.referencePanel)) === null || _c === void 0 ? void 0 : _c.value;
|
|
@@ -9228,14 +9245,12 @@ class GridviewComponent extends BaseGrid {
|
|
|
9228
9245
|
relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
|
|
9229
9246
|
}
|
|
9230
9247
|
}
|
|
9231
|
-
const view =
|
|
9232
|
-
|
|
9233
|
-
|
|
9234
|
-
|
|
9235
|
-
}
|
|
9236
|
-
: undefined);
|
|
9248
|
+
const view = this.options.createComponent({
|
|
9249
|
+
id: options.id,
|
|
9250
|
+
name: options.component,
|
|
9251
|
+
});
|
|
9237
9252
|
view.init({
|
|
9238
|
-
params: (
|
|
9253
|
+
params: (_d = options.params) !== null && _d !== void 0 ? _d : {},
|
|
9239
9254
|
minimumWidth: options.minimumWidth,
|
|
9240
9255
|
maximumWidth: options.maximumWidth,
|
|
9241
9256
|
minimumHeight: options.minimumHeight,
|
|
@@ -9363,12 +9378,6 @@ class SplitviewComponent extends Resizable {
|
|
|
9363
9378
|
this._classNames = new Classnames(this.element);
|
|
9364
9379
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9365
9380
|
this._options = options;
|
|
9366
|
-
if (!options.components) {
|
|
9367
|
-
options.components = {};
|
|
9368
|
-
}
|
|
9369
|
-
if (!options.frameworkComponents) {
|
|
9370
|
-
options.frameworkComponents = {};
|
|
9371
|
-
}
|
|
9372
9381
|
this.splitview = new Splitview(this.element, options);
|
|
9373
9382
|
this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
|
|
9374
9383
|
}
|
|
@@ -9431,18 +9440,17 @@ class SplitviewComponent extends Resizable {
|
|
|
9431
9440
|
return this.panels.find((view) => view.id === id);
|
|
9432
9441
|
}
|
|
9433
9442
|
addPanel(options) {
|
|
9434
|
-
var _a
|
|
9443
|
+
var _a;
|
|
9435
9444
|
if (this._panels.has(options.id)) {
|
|
9436
9445
|
throw new Error(`panel ${options.id} already exists`);
|
|
9437
9446
|
}
|
|
9438
|
-
const view =
|
|
9439
|
-
|
|
9440
|
-
|
|
9441
|
-
|
|
9442
|
-
: undefined);
|
|
9447
|
+
const view = this.options.createComponent({
|
|
9448
|
+
id: options.id,
|
|
9449
|
+
name: options.component,
|
|
9450
|
+
});
|
|
9443
9451
|
view.orientation = this.splitview.orientation;
|
|
9444
9452
|
view.init({
|
|
9445
|
-
params: (
|
|
9453
|
+
params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
|
|
9446
9454
|
minimumSize: options.minimumSize,
|
|
9447
9455
|
maximumSize: options.maximumSize,
|
|
9448
9456
|
snap: options.snap,
|
|
@@ -9504,17 +9512,14 @@ class SplitviewComponent extends Resizable {
|
|
|
9504
9512
|
descriptor: {
|
|
9505
9513
|
size,
|
|
9506
9514
|
views: views.map((view) => {
|
|
9507
|
-
var _a, _b;
|
|
9508
9515
|
const data = view.data;
|
|
9509
9516
|
if (this._panels.has(data.id)) {
|
|
9510
9517
|
throw new Error(`panel ${data.id} already exists`);
|
|
9511
9518
|
}
|
|
9512
|
-
const panel =
|
|
9513
|
-
|
|
9514
|
-
|
|
9515
|
-
|
|
9516
|
-
}
|
|
9517
|
-
: undefined);
|
|
9519
|
+
const panel = this.options.createComponent({
|
|
9520
|
+
id: data.id,
|
|
9521
|
+
name: data.component,
|
|
9522
|
+
});
|
|
9518
9523
|
queue.push(() => {
|
|
9519
9524
|
var _a;
|
|
9520
9525
|
panel.init({
|
|
@@ -9697,16 +9702,12 @@ class PaneviewComponent extends Resizable {
|
|
|
9697
9702
|
this.onDidAddView = this._onDidAddView.event;
|
|
9698
9703
|
this._onDidRemoveView = new Emitter();
|
|
9699
9704
|
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
9700
|
-
this.
|
|
9705
|
+
this._onUnhandledDragOverEvent = new Emitter();
|
|
9706
|
+
this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
|
|
9707
|
+
this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView, this._onUnhandledDragOverEvent);
|
|
9701
9708
|
this._classNames = new Classnames(this.element);
|
|
9702
9709
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9703
9710
|
this._options = options;
|
|
9704
|
-
if (!options.components) {
|
|
9705
|
-
options.components = {};
|
|
9706
|
-
}
|
|
9707
|
-
if (!options.frameworkComponents) {
|
|
9708
|
-
options.frameworkComponents = {};
|
|
9709
|
-
}
|
|
9710
9711
|
this.paneview = new Paneview(this.element, {
|
|
9711
9712
|
// only allow paneview in the vertical orientation for now
|
|
9712
9713
|
orientation: Orientation.VERTICAL,
|
|
@@ -9731,22 +9732,19 @@ class PaneviewComponent extends Resizable {
|
|
|
9731
9732
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
9732
9733
|
}
|
|
9733
9734
|
addPanel(options) {
|
|
9734
|
-
var _a
|
|
9735
|
-
const body =
|
|
9736
|
-
|
|
9737
|
-
|
|
9738
|
-
|
|
9739
|
-
: undefined);
|
|
9735
|
+
var _a;
|
|
9736
|
+
const body = this.options.createComponent({
|
|
9737
|
+
id: options.id,
|
|
9738
|
+
name: options.component,
|
|
9739
|
+
});
|
|
9740
9740
|
let header;
|
|
9741
|
-
if (options.headerComponent) {
|
|
9742
|
-
header =
|
|
9743
|
-
|
|
9744
|
-
|
|
9745
|
-
|
|
9746
|
-
}
|
|
9747
|
-
: undefined);
|
|
9741
|
+
if (options.headerComponent && this.options.createHeaderComponent) {
|
|
9742
|
+
header = this.options.createHeaderComponent({
|
|
9743
|
+
id: options.id,
|
|
9744
|
+
name: options.headerComponent,
|
|
9745
|
+
});
|
|
9748
9746
|
}
|
|
9749
|
-
|
|
9747
|
+
if (!header) {
|
|
9750
9748
|
header = new DefaultHeader();
|
|
9751
9749
|
}
|
|
9752
9750
|
const view = new PaneFramework({
|
|
@@ -9764,7 +9762,7 @@ class PaneviewComponent extends Resizable {
|
|
|
9764
9762
|
const size = typeof options.size === 'number' ? options.size : Sizing.Distribute;
|
|
9765
9763
|
const index = typeof options.index === 'number' ? options.index : undefined;
|
|
9766
9764
|
view.init({
|
|
9767
|
-
params: (
|
|
9765
|
+
params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
|
|
9768
9766
|
minimumBodySize: options.minimumBodySize,
|
|
9769
9767
|
maximumBodySize: options.maximumBodySize,
|
|
9770
9768
|
isExpanded: options.isExpanded,
|
|
@@ -9829,24 +9827,20 @@ class PaneviewComponent extends Resizable {
|
|
|
9829
9827
|
descriptor: {
|
|
9830
9828
|
size,
|
|
9831
9829
|
views: views.map((view) => {
|
|
9832
|
-
var _a, _b, _c, _d;
|
|
9833
9830
|
const data = view.data;
|
|
9834
|
-
const body =
|
|
9835
|
-
|
|
9836
|
-
|
|
9837
|
-
|
|
9838
|
-
}
|
|
9839
|
-
: undefined);
|
|
9831
|
+
const body = this.options.createComponent({
|
|
9832
|
+
id: data.id,
|
|
9833
|
+
name: data.component,
|
|
9834
|
+
});
|
|
9840
9835
|
let header;
|
|
9841
|
-
if (data.headerComponent
|
|
9842
|
-
|
|
9843
|
-
|
|
9844
|
-
|
|
9845
|
-
|
|
9846
|
-
|
|
9847
|
-
: undefined);
|
|
9836
|
+
if (data.headerComponent &&
|
|
9837
|
+
this.options.createHeaderComponent) {
|
|
9838
|
+
header = this.options.createHeaderComponent({
|
|
9839
|
+
id: data.id,
|
|
9840
|
+
name: data.headerComponent,
|
|
9841
|
+
});
|
|
9848
9842
|
}
|
|
9849
|
-
|
|
9843
|
+
if (!header) {
|
|
9850
9844
|
header = new DefaultHeader();
|
|
9851
9845
|
}
|
|
9852
9846
|
const panel = new PaneFramework({
|
|
@@ -9894,9 +9888,11 @@ class PaneviewComponent extends Resizable {
|
|
|
9894
9888
|
this.paneview.dispose();
|
|
9895
9889
|
}
|
|
9896
9890
|
doAddPanel(panel) {
|
|
9897
|
-
const disposable = panel.onDidDrop((event) => {
|
|
9891
|
+
const disposable = new CompositeDisposable(panel.onDidDrop((event) => {
|
|
9898
9892
|
this._onDidDrop.fire(event);
|
|
9899
|
-
})
|
|
9893
|
+
}), panel.onUnhandledDragOverEvent((event) => {
|
|
9894
|
+
this._onUnhandledDragOverEvent.fire(event);
|
|
9895
|
+
}));
|
|
9900
9896
|
this._viewDisposables.set(panel.id, disposable);
|
|
9901
9897
|
}
|
|
9902
9898
|
doRemovePanel(panel) {
|
|
@@ -10038,5 +10034,5 @@ function createPaneview(element, options) {
|
|
|
10038
10034
|
return new PaneviewApi(component);
|
|
10039
10035
|
}
|
|
10040
10036
|
|
|
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,
|
|
10037
|
+
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
10038
|
//# sourceMappingURL=dockview-core.esm.js.map
|