dockview-angular 4.11.0 → 4.13.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/lib/dockview/dockview-angular.component.js +2 -1
- package/dist/cjs/lib/dockview-angular.module.js +2 -4
- package/dist/cjs/lib/gridview/gridview-angular.component.js +2 -1
- package/dist/cjs/lib/paneview/paneview-angular.component.js +2 -1
- package/dist/cjs/lib/splitview/splitview-angular.component.js +2 -1
- package/dist/cjs/lib/utils/angular-renderer.js +11 -3
- package/dist/cjs/lib/utils/component-factory.js +1 -0
- package/dist/dockview-angular.amd.js +194 -65
- package/dist/dockview-angular.amd.js.map +1 -1
- package/dist/dockview-angular.amd.min.js +2 -2
- package/dist/dockview-angular.amd.min.js.map +1 -1
- package/dist/dockview-angular.amd.min.noStyle.js +2 -2
- package/dist/dockview-angular.amd.min.noStyle.js.map +1 -1
- package/dist/dockview-angular.amd.noStyle.js +194 -65
- package/dist/dockview-angular.amd.noStyle.js.map +1 -1
- package/dist/dockview-angular.cjs.js +194 -65
- package/dist/dockview-angular.cjs.js.map +1 -1
- package/dist/dockview-angular.esm.js +194 -66
- package/dist/dockview-angular.esm.js.map +1 -1
- package/dist/dockview-angular.esm.min.js +2 -2
- package/dist/dockview-angular.esm.min.js.map +1 -1
- package/dist/dockview-angular.js +194 -65
- package/dist/dockview-angular.js.map +1 -1
- package/dist/dockview-angular.min.js +2 -2
- package/dist/dockview-angular.min.js.map +1 -1
- package/dist/dockview-angular.min.noStyle.js +2 -2
- package/dist/dockview-angular.min.noStyle.js.map +1 -1
- package/dist/dockview-angular.noStyle.js +194 -65
- package/dist/dockview-angular.noStyle.js.map +1 -1
- package/dist/esm/lib/dockview/dockview-angular.component.js +2 -1
- package/dist/esm/lib/dockview-angular.module.js +2 -4
- package/dist/esm/lib/gridview/gridview-angular.component.js +2 -1
- package/dist/esm/lib/paneview/paneview-angular.component.js +2 -1
- package/dist/esm/lib/splitview/splitview-angular.component.js +2 -1
- package/dist/esm/lib/utils/angular-renderer.js +11 -3
- package/dist/esm/lib/utils/component-factory.js +1 -0
- package/package.json +4 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-angular
|
|
3
|
-
* @version 4.
|
|
3
|
+
* @version 4.13.0
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -1298,11 +1298,13 @@ class Splitview {
|
|
|
1298
1298
|
document.removeEventListener('pointermove', onPointerMove);
|
|
1299
1299
|
document.removeEventListener('pointerup', end);
|
|
1300
1300
|
document.removeEventListener('pointercancel', end);
|
|
1301
|
+
document.removeEventListener('contextmenu', end);
|
|
1301
1302
|
this._onDidSashEnd.fire(undefined);
|
|
1302
1303
|
};
|
|
1303
1304
|
document.addEventListener('pointermove', onPointerMove);
|
|
1304
1305
|
document.addEventListener('pointerup', end);
|
|
1305
1306
|
document.addEventListener('pointercancel', end);
|
|
1307
|
+
document.addEventListener('contextmenu', end);
|
|
1306
1308
|
};
|
|
1307
1309
|
sash.addEventListener('pointerdown', onPointerStart);
|
|
1308
1310
|
const sashItem = {
|
|
@@ -3785,8 +3787,8 @@ class DockviewApi {
|
|
|
3785
3787
|
/**
|
|
3786
3788
|
* Create a component from a serialized object.
|
|
3787
3789
|
*/
|
|
3788
|
-
fromJSON(data) {
|
|
3789
|
-
this.component.fromJSON(data);
|
|
3790
|
+
fromJSON(data, options) {
|
|
3791
|
+
this.component.fromJSON(data, options);
|
|
3790
3792
|
}
|
|
3791
3793
|
/**
|
|
3792
3794
|
* Create a serialized object of the current component.
|
|
@@ -5017,6 +5019,7 @@ class ContentContainer extends CompositeDisposable {
|
|
|
5017
5019
|
}
|
|
5018
5020
|
if (doRender) {
|
|
5019
5021
|
const focusTracker = trackFocus(container);
|
|
5022
|
+
this.focusTracker = focusTracker;
|
|
5020
5023
|
const disposable = new CompositeDisposable();
|
|
5021
5024
|
disposable.addDisposables(focusTracker, focusTracker.onDidFocus(() => this._onDidFocus.fire()), focusTracker.onDidBlur(() => this._onDidBlur.fire()));
|
|
5022
5025
|
this.disposable.value = disposable;
|
|
@@ -5044,6 +5047,16 @@ class ContentContainer extends CompositeDisposable {
|
|
|
5044
5047
|
this.disposable.dispose();
|
|
5045
5048
|
super.dispose();
|
|
5046
5049
|
}
|
|
5050
|
+
/**
|
|
5051
|
+
* Refresh the focus tracker state to handle cases where focus state
|
|
5052
|
+
* gets out of sync due to programmatic panel activation
|
|
5053
|
+
*/
|
|
5054
|
+
refreshFocusState() {
|
|
5055
|
+
var _a;
|
|
5056
|
+
if ((_a = this.focusTracker) === null || _a === void 0 ? void 0 : _a.refreshState) {
|
|
5057
|
+
this.focusTracker.refreshState();
|
|
5058
|
+
}
|
|
5059
|
+
}
|
|
5047
5060
|
}
|
|
5048
5061
|
|
|
5049
5062
|
function addGhostImage(dataTransfer, ghostElement, options) {
|
|
@@ -5153,7 +5166,7 @@ class Tab extends CompositeDisposable {
|
|
|
5153
5166
|
}
|
|
5154
5167
|
}
|
|
5155
5168
|
|
|
5156
|
-
class
|
|
5169
|
+
class DockviewWillShowOverlayLocationEvent {
|
|
5157
5170
|
get kind() {
|
|
5158
5171
|
return this.options.kind;
|
|
5159
5172
|
}
|
|
@@ -5501,7 +5514,7 @@ class Tabs extends CompositeDisposable {
|
|
|
5501
5514
|
index: this._tabs.findIndex((x) => x.value === tab),
|
|
5502
5515
|
});
|
|
5503
5516
|
}), tab.onWillShowOverlay((event) => {
|
|
5504
|
-
this._onWillShowOverlay.fire(new
|
|
5517
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
5505
5518
|
kind: 'tab',
|
|
5506
5519
|
panel: this.group.activePanel,
|
|
5507
5520
|
api: this.accessor.api,
|
|
@@ -5665,7 +5678,7 @@ class TabsContainer extends CompositeDisposable {
|
|
|
5665
5678
|
index: this.tabs.size,
|
|
5666
5679
|
});
|
|
5667
5680
|
}), this.voidContainer.onWillShowOverlay((event) => {
|
|
5668
|
-
this._onWillShowOverlay.fire(new
|
|
5681
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
5669
5682
|
kind: 'header_space',
|
|
5670
5683
|
panel: this.group.activePanel,
|
|
5671
5684
|
api: this.accessor.api,
|
|
@@ -6059,7 +6072,7 @@ class DockviewGroupPanelModel extends CompositeDisposable {
|
|
|
6059
6072
|
}), this.tabsContainer.onWillShowOverlay((event) => {
|
|
6060
6073
|
this._onWillShowOverlay.fire(event);
|
|
6061
6074
|
}), this.contentContainer.dropTarget.onWillShowOverlay((event) => {
|
|
6062
|
-
this._onWillShowOverlay.fire(new
|
|
6075
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
6063
6076
|
kind: 'content',
|
|
6064
6077
|
panel: this.activePanel,
|
|
6065
6078
|
api: this._api,
|
|
@@ -6370,8 +6383,11 @@ class DockviewGroupPanelModel extends CompositeDisposable {
|
|
|
6370
6383
|
this._activePanel = panel;
|
|
6371
6384
|
if (panel) {
|
|
6372
6385
|
this.tabsContainer.setActivePanel(panel);
|
|
6386
|
+
this.contentContainer.openPanel(panel);
|
|
6373
6387
|
panel.layout(this._width, this._height);
|
|
6374
6388
|
this.updateMru(panel);
|
|
6389
|
+
// Refresh focus state to handle programmatic activation without DOM focus change
|
|
6390
|
+
this.contentContainer.refreshFocusState();
|
|
6375
6391
|
this._onDidActivePanelChange.fire({
|
|
6376
6392
|
panel,
|
|
6377
6393
|
});
|
|
@@ -6732,7 +6748,19 @@ class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
6732
6748
|
this.onDidLocationChange = this._onDidLocationChange.event;
|
|
6733
6749
|
this._onDidActivePanelChange = new Emitter();
|
|
6734
6750
|
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
6735
|
-
this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange)
|
|
6751
|
+
this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange, this._onDidVisibilityChange.event((event) => {
|
|
6752
|
+
// When becoming visible, apply any pending size change
|
|
6753
|
+
if (event.isVisible && this._pendingSize) {
|
|
6754
|
+
super.setSize(this._pendingSize);
|
|
6755
|
+
this._pendingSize = undefined;
|
|
6756
|
+
}
|
|
6757
|
+
}));
|
|
6758
|
+
}
|
|
6759
|
+
setSize(event) {
|
|
6760
|
+
// Always store the requested size
|
|
6761
|
+
this._pendingSize = Object.assign({}, event);
|
|
6762
|
+
// Apply the size change immediately
|
|
6763
|
+
super.setSize(event);
|
|
6736
6764
|
}
|
|
6737
6765
|
close() {
|
|
6738
6766
|
if (!this._group) {
|
|
@@ -7201,6 +7229,18 @@ class DockviewPanel extends CompositeDisposable {
|
|
|
7201
7229
|
params: this._params,
|
|
7202
7230
|
});
|
|
7203
7231
|
}
|
|
7232
|
+
updateFromStateModel(state) {
|
|
7233
|
+
var _a, _b, _c;
|
|
7234
|
+
this._maximumHeight = state.maximumHeight;
|
|
7235
|
+
this._minimumHeight = state.minimumHeight;
|
|
7236
|
+
this._maximumWidth = state.maximumWidth;
|
|
7237
|
+
this._minimumWidth = state.minimumWidth;
|
|
7238
|
+
this.update({ params: (_a = state.params) !== null && _a !== void 0 ? _a : {} });
|
|
7239
|
+
this.setTitle((_b = state.title) !== null && _b !== void 0 ? _b : this.id);
|
|
7240
|
+
this.setRenderer((_c = state.renderer) !== null && _c !== void 0 ? _c : this.accessor.renderer);
|
|
7241
|
+
// state.contentComponent;
|
|
7242
|
+
// state.tabComponent;
|
|
7243
|
+
}
|
|
7204
7244
|
updateParentGroup(group, options) {
|
|
7205
7245
|
this._group = group;
|
|
7206
7246
|
this.api.group = this._group;
|
|
@@ -7672,13 +7712,16 @@ class Overlay extends CompositeDisposable {
|
|
|
7672
7712
|
let right = undefined;
|
|
7673
7713
|
let width = undefined;
|
|
7674
7714
|
const moveTop = () => {
|
|
7675
|
-
|
|
7715
|
+
// When dragging top handle, constrain top position to prevent oversizing
|
|
7716
|
+
const maxTop = startPosition.originalY +
|
|
7676
7717
|
startPosition.originalHeight >
|
|
7677
7718
|
containerRect.height
|
|
7678
|
-
?
|
|
7719
|
+
? Math.max(0, containerRect.height -
|
|
7720
|
+
Overlay.MINIMUM_HEIGHT)
|
|
7679
7721
|
: Math.max(0, startPosition.originalY +
|
|
7680
7722
|
startPosition.originalHeight -
|
|
7681
|
-
Overlay.MINIMUM_HEIGHT)
|
|
7723
|
+
Overlay.MINIMUM_HEIGHT);
|
|
7724
|
+
top = clamp(y, 0, maxTop);
|
|
7682
7725
|
height =
|
|
7683
7726
|
startPosition.originalY +
|
|
7684
7727
|
startPosition.originalHeight -
|
|
@@ -7689,22 +7732,27 @@ class Overlay extends CompositeDisposable {
|
|
|
7689
7732
|
top =
|
|
7690
7733
|
startPosition.originalY -
|
|
7691
7734
|
startPosition.originalHeight;
|
|
7692
|
-
|
|
7693
|
-
|
|
7694
|
-
|
|
7735
|
+
// When dragging bottom handle, constrain height to container height
|
|
7736
|
+
const minHeight = top < 0 &&
|
|
7737
|
+
typeof this.options.minimumInViewportHeight ===
|
|
7738
|
+
'number'
|
|
7695
7739
|
? -top +
|
|
7696
7740
|
this.options.minimumInViewportHeight
|
|
7697
|
-
: Overlay.MINIMUM_HEIGHT
|
|
7741
|
+
: Overlay.MINIMUM_HEIGHT;
|
|
7742
|
+
const maxHeight = containerRect.height - Math.max(0, top);
|
|
7743
|
+
height = clamp(y - top, minHeight, maxHeight);
|
|
7698
7744
|
bottom = containerRect.height - top - height;
|
|
7699
7745
|
};
|
|
7700
7746
|
const moveLeft = () => {
|
|
7701
|
-
|
|
7747
|
+
const maxLeft = startPosition.originalX +
|
|
7702
7748
|
startPosition.originalWidth >
|
|
7703
7749
|
containerRect.width
|
|
7704
|
-
?
|
|
7750
|
+
? Math.max(0, containerRect.width -
|
|
7751
|
+
Overlay.MINIMUM_WIDTH) // Prevent extending beyong right edge
|
|
7705
7752
|
: Math.max(0, startPosition.originalX +
|
|
7706
7753
|
startPosition.originalWidth -
|
|
7707
|
-
Overlay.MINIMUM_WIDTH)
|
|
7754
|
+
Overlay.MINIMUM_WIDTH);
|
|
7755
|
+
left = clamp(x, 0, maxLeft); // min is 0 (Not -Infinity) to prevent dragging beyond left edge
|
|
7708
7756
|
width =
|
|
7709
7757
|
startPosition.originalX +
|
|
7710
7758
|
startPosition.originalWidth -
|
|
@@ -7715,12 +7763,15 @@ class Overlay extends CompositeDisposable {
|
|
|
7715
7763
|
left =
|
|
7716
7764
|
startPosition.originalX -
|
|
7717
7765
|
startPosition.originalWidth;
|
|
7718
|
-
|
|
7719
|
-
|
|
7720
|
-
|
|
7766
|
+
// When dragging right handle, constrain width to container width
|
|
7767
|
+
const minWidth = left < 0 &&
|
|
7768
|
+
typeof this.options.minimumInViewportWidth ===
|
|
7769
|
+
'number'
|
|
7721
7770
|
? -left +
|
|
7722
7771
|
this.options.minimumInViewportWidth
|
|
7723
|
-
: Overlay.MINIMUM_WIDTH
|
|
7772
|
+
: Overlay.MINIMUM_WIDTH;
|
|
7773
|
+
const maxWidth = containerRect.width - Math.max(0, left);
|
|
7774
|
+
width = clamp(x - left, minWidth, maxWidth);
|
|
7724
7775
|
right = containerRect.width - left - width;
|
|
7725
7776
|
};
|
|
7726
7777
|
switch (direction) {
|
|
@@ -8550,7 +8601,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
8550
8601
|
// option only available when no panels in primary grid
|
|
8551
8602
|
return;
|
|
8552
8603
|
}
|
|
8553
|
-
this._onWillShowOverlay.fire(new
|
|
8604
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
8554
8605
|
kind: 'edge',
|
|
8555
8606
|
panel: undefined,
|
|
8556
8607
|
api: this._api,
|
|
@@ -8964,7 +9015,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
8964
9015
|
: (_e = (_d = this.options.floatingGroupBounds) === null || _d === void 0 ? void 0 : _d.minimumHeightWithinViewport) !== null && _e !== void 0 ? _e : DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE }));
|
|
8965
9016
|
const el = group.element.querySelector('.dv-void-container');
|
|
8966
9017
|
if (!el) {
|
|
8967
|
-
throw new Error('failed to find drag handle');
|
|
9018
|
+
throw new Error('dockview: failed to find drag handle');
|
|
8968
9019
|
}
|
|
8969
9020
|
overlay.setupDrag(el, {
|
|
8970
9021
|
inDragMode: typeof (options === null || options === void 0 ? void 0 : options.inDragMode) === 'boolean'
|
|
@@ -9036,7 +9087,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9036
9087
|
case 'right':
|
|
9037
9088
|
return this.createGroupAtLocation([this.gridview.length], undefined, options); // insert into last position
|
|
9038
9089
|
default:
|
|
9039
|
-
throw new Error(`unsupported position ${position}`);
|
|
9090
|
+
throw new Error(`dockview: unsupported position ${position}`);
|
|
9040
9091
|
}
|
|
9041
9092
|
}
|
|
9042
9093
|
updateOptions(options) {
|
|
@@ -9182,15 +9233,48 @@ class DockviewComponent extends BaseGrid {
|
|
|
9182
9233
|
}
|
|
9183
9234
|
return result;
|
|
9184
9235
|
}
|
|
9185
|
-
fromJSON(data) {
|
|
9236
|
+
fromJSON(data, options) {
|
|
9186
9237
|
var _a, _b;
|
|
9238
|
+
const existingPanels = new Map();
|
|
9239
|
+
let tempGroup;
|
|
9240
|
+
if (options === null || options === void 0 ? void 0 : options.reuseExistingPanels) {
|
|
9241
|
+
/**
|
|
9242
|
+
* What are we doing here?
|
|
9243
|
+
*
|
|
9244
|
+
* 1. Create a temporary group to hold any panels that currently exist and that also exist in the new layout
|
|
9245
|
+
* 2. Remove that temporary group from the group mapping so that it doesn't get cleared when we clear the layout
|
|
9246
|
+
*/
|
|
9247
|
+
tempGroup = this.createGroup();
|
|
9248
|
+
this._groups.delete(tempGroup.api.id);
|
|
9249
|
+
const newPanels = Object.keys(data.panels);
|
|
9250
|
+
for (const panel of this.panels) {
|
|
9251
|
+
if (newPanels.includes(panel.api.id)) {
|
|
9252
|
+
existingPanels.set(panel.api.id, panel);
|
|
9253
|
+
}
|
|
9254
|
+
}
|
|
9255
|
+
this.movingLock(() => {
|
|
9256
|
+
Array.from(existingPanels.values()).forEach((panel) => {
|
|
9257
|
+
this.moveGroupOrPanel({
|
|
9258
|
+
from: {
|
|
9259
|
+
groupId: panel.api.group.api.id,
|
|
9260
|
+
panelId: panel.api.id,
|
|
9261
|
+
},
|
|
9262
|
+
to: {
|
|
9263
|
+
group: tempGroup,
|
|
9264
|
+
position: 'center',
|
|
9265
|
+
},
|
|
9266
|
+
keepEmptyGroups: true,
|
|
9267
|
+
});
|
|
9268
|
+
});
|
|
9269
|
+
});
|
|
9270
|
+
}
|
|
9187
9271
|
this.clear();
|
|
9188
9272
|
if (typeof data !== 'object' || data === null) {
|
|
9189
|
-
throw new Error('serialized layout must be a non-null object');
|
|
9273
|
+
throw new Error('dockview: serialized layout must be a non-null object');
|
|
9190
9274
|
}
|
|
9191
9275
|
const { grid, panels, activeGroup } = data;
|
|
9192
9276
|
if (grid.root.type !== 'branch' || !Array.isArray(grid.root.data)) {
|
|
9193
|
-
throw new Error('root must be of type branch');
|
|
9277
|
+
throw new Error('dockview: root must be of type branch');
|
|
9194
9278
|
}
|
|
9195
9279
|
try {
|
|
9196
9280
|
// take note of the existing dimensions
|
|
@@ -9199,7 +9283,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9199
9283
|
const createGroupFromSerializedState = (data) => {
|
|
9200
9284
|
const { id, locked, hideHeader, views, activeView } = data;
|
|
9201
9285
|
if (typeof id !== 'string') {
|
|
9202
|
-
throw new Error('group id must be of type string');
|
|
9286
|
+
throw new Error('dockview: group id must be of type string');
|
|
9203
9287
|
}
|
|
9204
9288
|
const group = this.createGroup({
|
|
9205
9289
|
id,
|
|
@@ -9214,17 +9298,38 @@ class DockviewComponent extends BaseGrid {
|
|
|
9214
9298
|
* In running this section first we avoid firing lots of 'add' events in the event of a failure
|
|
9215
9299
|
* due to a corruption of input data.
|
|
9216
9300
|
*/
|
|
9217
|
-
const
|
|
9218
|
-
|
|
9301
|
+
const existingPanel = existingPanels.get(child);
|
|
9302
|
+
if (tempGroup && existingPanel) {
|
|
9303
|
+
this.movingLock(() => {
|
|
9304
|
+
tempGroup.model.removePanel(existingPanel);
|
|
9305
|
+
});
|
|
9306
|
+
createdPanels.push(existingPanel);
|
|
9307
|
+
existingPanel.updateFromStateModel(panels[child]);
|
|
9308
|
+
}
|
|
9309
|
+
else {
|
|
9310
|
+
const panel = this._deserializer.fromJSON(panels[child], group);
|
|
9311
|
+
createdPanels.push(panel);
|
|
9312
|
+
}
|
|
9219
9313
|
}
|
|
9220
9314
|
for (let i = 0; i < views.length; i++) {
|
|
9221
9315
|
const panel = createdPanels[i];
|
|
9222
9316
|
const isActive = typeof activeView === 'string' &&
|
|
9223
9317
|
activeView === panel.id;
|
|
9224
|
-
|
|
9225
|
-
|
|
9226
|
-
|
|
9227
|
-
|
|
9318
|
+
const hasExisting = existingPanels.has(panel.api.id);
|
|
9319
|
+
if (hasExisting) {
|
|
9320
|
+
this.movingLock(() => {
|
|
9321
|
+
group.model.openPanel(panel, {
|
|
9322
|
+
skipSetActive: !isActive,
|
|
9323
|
+
skipSetGroupActive: true,
|
|
9324
|
+
});
|
|
9325
|
+
});
|
|
9326
|
+
}
|
|
9327
|
+
else {
|
|
9328
|
+
group.model.openPanel(panel, {
|
|
9329
|
+
skipSetActive: !isActive,
|
|
9330
|
+
skipSetGroupActive: true,
|
|
9331
|
+
});
|
|
9332
|
+
}
|
|
9228
9333
|
}
|
|
9229
9334
|
if (!group.activePanel && group.panels.length > 0) {
|
|
9230
9335
|
group.model.openPanel(group.panels[group.panels.length - 1], {
|
|
@@ -9263,7 +9368,9 @@ class DockviewComponent extends BaseGrid {
|
|
|
9263
9368
|
setTimeout(() => {
|
|
9264
9369
|
this.addPopoutGroup(group, {
|
|
9265
9370
|
position: position !== null && position !== void 0 ? position : undefined,
|
|
9266
|
-
overridePopoutGroup: gridReferenceGroup
|
|
9371
|
+
overridePopoutGroup: gridReferenceGroup
|
|
9372
|
+
? group
|
|
9373
|
+
: undefined,
|
|
9267
9374
|
referenceGroup: gridReferenceGroup
|
|
9268
9375
|
? this.getPanel(gridReferenceGroup)
|
|
9269
9376
|
: undefined,
|
|
@@ -9349,11 +9456,11 @@ class DockviewComponent extends BaseGrid {
|
|
|
9349
9456
|
addPanel(options) {
|
|
9350
9457
|
var _a, _b;
|
|
9351
9458
|
if (this.panels.find((_) => _.id === options.id)) {
|
|
9352
|
-
throw new Error(`panel with id ${options.id} already exists`);
|
|
9459
|
+
throw new Error(`dockview: panel with id ${options.id} already exists`);
|
|
9353
9460
|
}
|
|
9354
9461
|
let referenceGroup;
|
|
9355
9462
|
if (options.position && options.floating) {
|
|
9356
|
-
throw new Error('you can only provide one of: position, floating as arguments to .addPanel(...)');
|
|
9463
|
+
throw new Error('dockview: you can only provide one of: position, floating as arguments to .addPanel(...)');
|
|
9357
9464
|
}
|
|
9358
9465
|
const initial = {
|
|
9359
9466
|
width: options.initialWidth,
|
|
@@ -9367,7 +9474,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9367
9474
|
: options.position.referencePanel;
|
|
9368
9475
|
index = options.position.index;
|
|
9369
9476
|
if (!referencePanel) {
|
|
9370
|
-
throw new Error(`referencePanel '${options.position.referencePanel}' does not exist`);
|
|
9477
|
+
throw new Error(`dockview: referencePanel '${options.position.referencePanel}' does not exist`);
|
|
9371
9478
|
}
|
|
9372
9479
|
referenceGroup = this.findGroup(referencePanel);
|
|
9373
9480
|
}
|
|
@@ -9378,7 +9485,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9378
9485
|
: options.position.referenceGroup;
|
|
9379
9486
|
index = options.position.index;
|
|
9380
9487
|
if (!referenceGroup) {
|
|
9381
|
-
throw new Error(`referenceGroup '${options.position.referenceGroup}' does not exist`);
|
|
9488
|
+
throw new Error(`dockview: referenceGroup '${options.position.referenceGroup}' does not exist`);
|
|
9382
9489
|
}
|
|
9383
9490
|
}
|
|
9384
9491
|
else {
|
|
@@ -9490,7 +9597,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9490
9597
|
}) {
|
|
9491
9598
|
const group = panel.group;
|
|
9492
9599
|
if (!group) {
|
|
9493
|
-
throw new Error(`cannot remove panel ${panel.id}. it's missing a group.`);
|
|
9600
|
+
throw new Error(`dockview: cannot remove panel ${panel.id}. it's missing a group.`);
|
|
9494
9601
|
}
|
|
9495
9602
|
group.model.removePanel(panel, {
|
|
9496
9603
|
skipSetActiveGroup: options.skipSetActiveGroup,
|
|
@@ -9539,11 +9646,11 @@ class DockviewComponent extends BaseGrid {
|
|
|
9539
9646
|
? this.panels.find((panel) => panel.id === options.referencePanel)
|
|
9540
9647
|
: options.referencePanel;
|
|
9541
9648
|
if (!referencePanel) {
|
|
9542
|
-
throw new Error(`reference panel ${options.referencePanel} does not exist`);
|
|
9649
|
+
throw new Error(`dockview: reference panel ${options.referencePanel} does not exist`);
|
|
9543
9650
|
}
|
|
9544
9651
|
referenceGroup = this.findGroup(referencePanel);
|
|
9545
9652
|
if (!referenceGroup) {
|
|
9546
|
-
throw new Error(`reference group for reference panel ${options.referencePanel} does not exist`);
|
|
9653
|
+
throw new Error(`dockview: reference group for reference panel ${options.referencePanel} does not exist`);
|
|
9547
9654
|
}
|
|
9548
9655
|
}
|
|
9549
9656
|
else if (isGroupOptionsWithGroup(options)) {
|
|
@@ -9552,7 +9659,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9552
9659
|
? (_a = this._groups.get(options.referenceGroup)) === null || _a === void 0 ? void 0 : _a.value
|
|
9553
9660
|
: options.referenceGroup;
|
|
9554
9661
|
if (!referenceGroup) {
|
|
9555
|
-
throw new Error(`reference group ${options.referenceGroup} does not exist`);
|
|
9662
|
+
throw new Error(`dockview: reference group ${options.referenceGroup} does not exist`);
|
|
9556
9663
|
}
|
|
9557
9664
|
}
|
|
9558
9665
|
else {
|
|
@@ -9620,7 +9727,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9620
9727
|
}
|
|
9621
9728
|
return floatingGroup.group;
|
|
9622
9729
|
}
|
|
9623
|
-
throw new Error('failed to find floating group');
|
|
9730
|
+
throw new Error('dockview: failed to find floating group');
|
|
9624
9731
|
}
|
|
9625
9732
|
if (group.api.location.type === 'popout') {
|
|
9626
9733
|
const selectedGroup = this._popoutGroups.find((_) => _.popoutGroup === group);
|
|
@@ -9651,7 +9758,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9651
9758
|
this.updateWatermark();
|
|
9652
9759
|
return selectedGroup.popoutGroup;
|
|
9653
9760
|
}
|
|
9654
|
-
throw new Error('failed to find popout group');
|
|
9761
|
+
throw new Error('dockview: failed to find popout group');
|
|
9655
9762
|
}
|
|
9656
9763
|
const re = super.doRemoveGroup(group, options);
|
|
9657
9764
|
if (!(options === null || options === void 0 ? void 0 : options.skipActive)) {
|
|
@@ -9682,7 +9789,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9682
9789
|
? (_a = this._groups.get(sourceGroupId)) === null || _a === void 0 ? void 0 : _a.value
|
|
9683
9790
|
: undefined;
|
|
9684
9791
|
if (!sourceGroup) {
|
|
9685
|
-
throw new Error(`Failed to find group id ${sourceGroupId}`);
|
|
9792
|
+
throw new Error(`dockview: Failed to find group id ${sourceGroupId}`);
|
|
9686
9793
|
}
|
|
9687
9794
|
if (sourceItemId === undefined) {
|
|
9688
9795
|
/**
|
|
@@ -9707,9 +9814,9 @@ class DockviewComponent extends BaseGrid {
|
|
|
9707
9814
|
skipSetActiveGroup: true,
|
|
9708
9815
|
}));
|
|
9709
9816
|
if (!removedPanel) {
|
|
9710
|
-
throw new Error(`No panel with id ${sourceItemId}`);
|
|
9817
|
+
throw new Error(`dockview: No panel with id ${sourceItemId}`);
|
|
9711
9818
|
}
|
|
9712
|
-
if (sourceGroup.model.size === 0) {
|
|
9819
|
+
if (!options.keepEmptyGroups && sourceGroup.model.size === 0) {
|
|
9713
9820
|
// remove the group and do not set a new group as active
|
|
9714
9821
|
this.doRemoveGroup(sourceGroup, { skipActive: true });
|
|
9715
9822
|
}
|
|
@@ -9719,7 +9826,8 @@ class DockviewComponent extends BaseGrid {
|
|
|
9719
9826
|
var _a;
|
|
9720
9827
|
return destinationGroup.model.openPanel(removedPanel, {
|
|
9721
9828
|
index: destinationIndex,
|
|
9722
|
-
skipSetActive: ((_a = options.skipSetActive) !== null && _a !== void 0 ? _a : false) &&
|
|
9829
|
+
skipSetActive: ((_a = options.skipSetActive) !== null && _a !== void 0 ? _a : false) &&
|
|
9830
|
+
!isDestinationGroupEmpty,
|
|
9723
9831
|
skipSetGroupActive: true,
|
|
9724
9832
|
});
|
|
9725
9833
|
});
|
|
@@ -9730,6 +9838,13 @@ class DockviewComponent extends BaseGrid {
|
|
|
9730
9838
|
panel: removedPanel,
|
|
9731
9839
|
from: sourceGroup,
|
|
9732
9840
|
});
|
|
9841
|
+
/**
|
|
9842
|
+
* Update overlay positions after DOM layout completes to prevent 0×0 dimensions.
|
|
9843
|
+
* With defaultRenderer="always" this results in panel content not showing after move operations.
|
|
9844
|
+
*/
|
|
9845
|
+
requestAnimationFrame(() => {
|
|
9846
|
+
this.overlayRenderContainer.updateAllPositions();
|
|
9847
|
+
});
|
|
9733
9848
|
}
|
|
9734
9849
|
else {
|
|
9735
9850
|
/**
|
|
@@ -9774,7 +9889,9 @@ class DockviewComponent extends BaseGrid {
|
|
|
9774
9889
|
}));
|
|
9775
9890
|
this.doRemoveGroup(sourceGroup, { skipActive: true });
|
|
9776
9891
|
const newGroup = this.createGroupAtLocation(targetLocation);
|
|
9777
|
-
this.movingLock(() => newGroup.model.openPanel(removedPanel
|
|
9892
|
+
this.movingLock(() => newGroup.model.openPanel(removedPanel, {
|
|
9893
|
+
skipSetActive: true,
|
|
9894
|
+
}));
|
|
9778
9895
|
this.doSetGroupAndPanelActive(newGroup);
|
|
9779
9896
|
this._onDidMovePanel.fire({
|
|
9780
9897
|
panel: this.getGroupPanel(sourceItemId),
|
|
@@ -9807,7 +9924,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9807
9924
|
skipSetActiveGroup: true,
|
|
9808
9925
|
}));
|
|
9809
9926
|
if (!removedPanel) {
|
|
9810
|
-
throw new Error(`No panel with id ${sourceItemId}`);
|
|
9927
|
+
throw new Error(`dockview: No panel with id ${sourceItemId}`);
|
|
9811
9928
|
}
|
|
9812
9929
|
const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, destinationTarget);
|
|
9813
9930
|
const group = this.createGroupAtLocation(dropLocation);
|
|
@@ -9862,7 +9979,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9862
9979
|
case 'floating': {
|
|
9863
9980
|
const selectedFloatingGroup = this._floatingGroups.find((x) => x.group === from);
|
|
9864
9981
|
if (!selectedFloatingGroup) {
|
|
9865
|
-
throw new Error('failed to find floating group');
|
|
9982
|
+
throw new Error('dockview: failed to find floating group');
|
|
9866
9983
|
}
|
|
9867
9984
|
selectedFloatingGroup.dispose();
|
|
9868
9985
|
break;
|
|
@@ -9870,7 +9987,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9870
9987
|
case 'popout': {
|
|
9871
9988
|
const selectedPopoutGroup = this._popoutGroups.find((x) => x.popoutGroup === from);
|
|
9872
9989
|
if (!selectedPopoutGroup) {
|
|
9873
|
-
throw new Error('failed to find popout group');
|
|
9990
|
+
throw new Error('dockview: failed to find popout group');
|
|
9874
9991
|
}
|
|
9875
9992
|
// Remove from popout groups list to prevent automatic restoration
|
|
9876
9993
|
const index = this._popoutGroups.indexOf(selectedPopoutGroup);
|
|
@@ -11319,12 +11436,19 @@ class AngularRenderer {
|
|
|
11319
11436
|
return this._element;
|
|
11320
11437
|
}
|
|
11321
11438
|
init(parameters) {
|
|
11322
|
-
|
|
11439
|
+
// If already initialized, just update the parameters
|
|
11440
|
+
if (this.componentRef) {
|
|
11441
|
+
this.update(parameters);
|
|
11442
|
+
}
|
|
11443
|
+
else {
|
|
11444
|
+
this.render(parameters);
|
|
11445
|
+
}
|
|
11323
11446
|
}
|
|
11324
11447
|
update(params) {
|
|
11325
11448
|
if (this.componentRef) {
|
|
11326
11449
|
Object.keys(params).forEach(key => {
|
|
11327
|
-
|
|
11450
|
+
// Use 'in' operator instead of hasOwnProperty to support getter/setter properties
|
|
11451
|
+
if (key in this.componentRef.instance) {
|
|
11328
11452
|
this.componentRef.instance[key] = params[key];
|
|
11329
11453
|
}
|
|
11330
11454
|
});
|
|
@@ -11340,7 +11464,8 @@ class AngularRenderer {
|
|
|
11340
11464
|
});
|
|
11341
11465
|
// Set initial parameters
|
|
11342
11466
|
Object.keys(parameters).forEach(key => {
|
|
11343
|
-
|
|
11467
|
+
// Use 'in' operator instead of hasOwnProperty to support getter/setter properties
|
|
11468
|
+
if (key in this.componentRef.instance) {
|
|
11344
11469
|
this.componentRef.instance[key] = parameters[key];
|
|
11345
11470
|
}
|
|
11346
11471
|
});
|
|
@@ -11511,6 +11636,7 @@ class AngularFrameworkComponentFactory {
|
|
|
11511
11636
|
injector: this.injector,
|
|
11512
11637
|
environmentInjector: this.environmentInjector
|
|
11513
11638
|
});
|
|
11639
|
+
// Initialize with empty props - dockview-core will call init() again with actual IGroupHeaderProps
|
|
11514
11640
|
renderer.init({});
|
|
11515
11641
|
return renderer;
|
|
11516
11642
|
}
|
|
@@ -12568,6 +12694,7 @@ __decorate([
|
|
|
12568
12694
|
exports.DockviewAngularComponent = __decorate([
|
|
12569
12695
|
core.Component({
|
|
12570
12696
|
selector: 'dv-dockview',
|
|
12697
|
+
standalone: true,
|
|
12571
12698
|
template: '<div #dockviewContainer class="dockview-container"></div>',
|
|
12572
12699
|
styles: [`
|
|
12573
12700
|
:host {
|
|
@@ -12575,7 +12702,7 @@ exports.DockviewAngularComponent = __decorate([
|
|
|
12575
12702
|
width: 100%;
|
|
12576
12703
|
height: 100%;
|
|
12577
12704
|
}
|
|
12578
|
-
|
|
12705
|
+
|
|
12579
12706
|
.dockview-container {
|
|
12580
12707
|
width: 100%;
|
|
12581
12708
|
height: 100%;
|
|
@@ -12691,6 +12818,7 @@ __decorate([
|
|
|
12691
12818
|
exports.GridviewAngularComponent = __decorate([
|
|
12692
12819
|
core.Component({
|
|
12693
12820
|
selector: 'dv-gridview',
|
|
12821
|
+
standalone: true,
|
|
12694
12822
|
template: '<div #gridviewContainer class="gridview-container"></div>',
|
|
12695
12823
|
styles: [`
|
|
12696
12824
|
:host {
|
|
@@ -12698,7 +12826,7 @@ exports.GridviewAngularComponent = __decorate([
|
|
|
12698
12826
|
width: 100%;
|
|
12699
12827
|
height: 100%;
|
|
12700
12828
|
}
|
|
12701
|
-
|
|
12829
|
+
|
|
12702
12830
|
.gridview-container {
|
|
12703
12831
|
width: 100%;
|
|
12704
12832
|
height: 100%;
|
|
@@ -12839,6 +12967,7 @@ __decorate([
|
|
|
12839
12967
|
exports.PaneviewAngularComponent = __decorate([
|
|
12840
12968
|
core.Component({
|
|
12841
12969
|
selector: 'dv-paneview',
|
|
12970
|
+
standalone: true,
|
|
12842
12971
|
template: '<div #paneviewContainer class="paneview-container"></div>',
|
|
12843
12972
|
styles: [`
|
|
12844
12973
|
:host {
|
|
@@ -12846,7 +12975,7 @@ exports.PaneviewAngularComponent = __decorate([
|
|
|
12846
12975
|
width: 100%;
|
|
12847
12976
|
height: 100%;
|
|
12848
12977
|
}
|
|
12849
|
-
|
|
12978
|
+
|
|
12850
12979
|
.paneview-container {
|
|
12851
12980
|
width: 100%;
|
|
12852
12981
|
height: 100%;
|
|
@@ -12962,6 +13091,7 @@ __decorate([
|
|
|
12962
13091
|
exports.SplitviewAngularComponent = __decorate([
|
|
12963
13092
|
core.Component({
|
|
12964
13093
|
selector: 'dv-splitview',
|
|
13094
|
+
standalone: true,
|
|
12965
13095
|
template: '<div #splitviewContainer class="splitview-container"></div>',
|
|
12966
13096
|
styles: [`
|
|
12967
13097
|
:host {
|
|
@@ -12969,7 +13099,7 @@ exports.SplitviewAngularComponent = __decorate([
|
|
|
12969
13099
|
width: 100%;
|
|
12970
13100
|
height: 100%;
|
|
12971
13101
|
}
|
|
12972
|
-
|
|
13102
|
+
|
|
12973
13103
|
.splitview-container {
|
|
12974
13104
|
width: 100%;
|
|
12975
13105
|
height: 100%;
|
|
@@ -12983,15 +13113,13 @@ exports.DockviewAngularModule = class DockviewAngularModule {
|
|
|
12983
13113
|
};
|
|
12984
13114
|
exports.DockviewAngularModule = __decorate([
|
|
12985
13115
|
core.NgModule({
|
|
12986
|
-
|
|
13116
|
+
imports: [
|
|
13117
|
+
common.CommonModule,
|
|
12987
13118
|
exports.DockviewAngularComponent,
|
|
12988
13119
|
exports.GridviewAngularComponent,
|
|
12989
13120
|
exports.PaneviewAngularComponent,
|
|
12990
13121
|
exports.SplitviewAngularComponent
|
|
12991
13122
|
],
|
|
12992
|
-
imports: [
|
|
12993
|
-
common.CommonModule
|
|
12994
|
-
],
|
|
12995
13123
|
exports: [
|
|
12996
13124
|
exports.DockviewAngularComponent,
|
|
12997
13125
|
exports.GridviewAngularComponent,
|
|
@@ -13020,6 +13148,7 @@ exports.DockviewMutableDisposable = MutableDisposable;
|
|
|
13020
13148
|
exports.DockviewPanel = DockviewPanel;
|
|
13021
13149
|
exports.DockviewUnhandledDragOverEvent = DockviewUnhandledDragOverEvent;
|
|
13022
13150
|
exports.DockviewWillDropEvent = DockviewWillDropEvent;
|
|
13151
|
+
exports.DockviewWillShowOverlayLocationEvent = DockviewWillShowOverlayLocationEvent;
|
|
13023
13152
|
exports.DraggablePaneviewPanel = DraggablePaneviewPanel;
|
|
13024
13153
|
exports.Gridview = Gridview;
|
|
13025
13154
|
exports.GridviewApi = GridviewApi;
|