dockview-angular 4.10.0 → 4.12.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 +184 -46
- 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 +184 -46
- package/dist/dockview-angular.amd.noStyle.js.map +1 -1
- package/dist/dockview-angular.cjs.js +184 -46
- package/dist/dockview-angular.cjs.js.map +1 -1
- package/dist/dockview-angular.esm.js +184 -46
- 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 +184 -46
- 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 +184 -46
- 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 +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-angular
|
|
3
|
-
* @version 4.
|
|
3
|
+
* @version 4.12.0
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -3755,8 +3755,8 @@
|
|
|
3755
3755
|
/**
|
|
3756
3756
|
* Create a component from a serialized object.
|
|
3757
3757
|
*/
|
|
3758
|
-
fromJSON(data) {
|
|
3759
|
-
this.component.fromJSON(data);
|
|
3758
|
+
fromJSON(data, options) {
|
|
3759
|
+
this.component.fromJSON(data, options);
|
|
3760
3760
|
}
|
|
3761
3761
|
/**
|
|
3762
3762
|
* Create a serialized object of the current component.
|
|
@@ -4987,6 +4987,7 @@
|
|
|
4987
4987
|
}
|
|
4988
4988
|
if (doRender) {
|
|
4989
4989
|
const focusTracker = trackFocus(container);
|
|
4990
|
+
this.focusTracker = focusTracker;
|
|
4990
4991
|
const disposable = new CompositeDisposable();
|
|
4991
4992
|
disposable.addDisposables(focusTracker, focusTracker.onDidFocus(() => this._onDidFocus.fire()), focusTracker.onDidBlur(() => this._onDidBlur.fire()));
|
|
4992
4993
|
this.disposable.value = disposable;
|
|
@@ -5014,6 +5015,16 @@
|
|
|
5014
5015
|
this.disposable.dispose();
|
|
5015
5016
|
super.dispose();
|
|
5016
5017
|
}
|
|
5018
|
+
/**
|
|
5019
|
+
* Refresh the focus tracker state to handle cases where focus state
|
|
5020
|
+
* gets out of sync due to programmatic panel activation
|
|
5021
|
+
*/
|
|
5022
|
+
refreshFocusState() {
|
|
5023
|
+
var _a;
|
|
5024
|
+
if ((_a = this.focusTracker) === null || _a === void 0 ? void 0 : _a.refreshState) {
|
|
5025
|
+
this.focusTracker.refreshState();
|
|
5026
|
+
}
|
|
5027
|
+
}
|
|
5017
5028
|
}
|
|
5018
5029
|
|
|
5019
5030
|
function addGhostImage(dataTransfer, ghostElement, options) {
|
|
@@ -6340,8 +6351,11 @@
|
|
|
6340
6351
|
this._activePanel = panel;
|
|
6341
6352
|
if (panel) {
|
|
6342
6353
|
this.tabsContainer.setActivePanel(panel);
|
|
6354
|
+
this.contentContainer.openPanel(panel);
|
|
6343
6355
|
panel.layout(this._width, this._height);
|
|
6344
6356
|
this.updateMru(panel);
|
|
6357
|
+
// Refresh focus state to handle programmatic activation without DOM focus change
|
|
6358
|
+
this.contentContainer.refreshFocusState();
|
|
6345
6359
|
this._onDidActivePanelChange.fire({
|
|
6346
6360
|
panel,
|
|
6347
6361
|
});
|
|
@@ -6765,11 +6779,16 @@
|
|
|
6765
6779
|
}
|
|
6766
6780
|
}
|
|
6767
6781
|
|
|
6782
|
+
// GridConstraintChangeEvent2 is not exported, so we'll type it manually
|
|
6768
6783
|
const MINIMUM_DOCKVIEW_GROUP_PANEL_WIDTH = 100;
|
|
6769
6784
|
const MINIMUM_DOCKVIEW_GROUP_PANEL_HEIGHT = 100;
|
|
6770
6785
|
class DockviewGroupPanel extends GridviewPanel {
|
|
6771
6786
|
get minimumWidth() {
|
|
6772
6787
|
var _a;
|
|
6788
|
+
// Check for explicitly set group constraint first
|
|
6789
|
+
if (typeof this._explicitConstraints.minimumWidth === 'number') {
|
|
6790
|
+
return this._explicitConstraints.minimumWidth;
|
|
6791
|
+
}
|
|
6773
6792
|
const activePanelMinimumWidth = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.minimumWidth;
|
|
6774
6793
|
if (typeof activePanelMinimumWidth === 'number') {
|
|
6775
6794
|
return activePanelMinimumWidth;
|
|
@@ -6778,6 +6797,10 @@
|
|
|
6778
6797
|
}
|
|
6779
6798
|
get minimumHeight() {
|
|
6780
6799
|
var _a;
|
|
6800
|
+
// Check for explicitly set group constraint first
|
|
6801
|
+
if (typeof this._explicitConstraints.minimumHeight === 'number') {
|
|
6802
|
+
return this._explicitConstraints.minimumHeight;
|
|
6803
|
+
}
|
|
6781
6804
|
const activePanelMinimumHeight = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.minimumHeight;
|
|
6782
6805
|
if (typeof activePanelMinimumHeight === 'number') {
|
|
6783
6806
|
return activePanelMinimumHeight;
|
|
@@ -6786,6 +6809,10 @@
|
|
|
6786
6809
|
}
|
|
6787
6810
|
get maximumWidth() {
|
|
6788
6811
|
var _a;
|
|
6812
|
+
// Check for explicitly set group constraint first
|
|
6813
|
+
if (typeof this._explicitConstraints.maximumWidth === 'number') {
|
|
6814
|
+
return this._explicitConstraints.maximumWidth;
|
|
6815
|
+
}
|
|
6789
6816
|
const activePanelMaximumWidth = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.maximumWidth;
|
|
6790
6817
|
if (typeof activePanelMaximumWidth === 'number') {
|
|
6791
6818
|
return activePanelMaximumWidth;
|
|
@@ -6794,6 +6821,10 @@
|
|
|
6794
6821
|
}
|
|
6795
6822
|
get maximumHeight() {
|
|
6796
6823
|
var _a;
|
|
6824
|
+
// Check for explicitly set group constraint first
|
|
6825
|
+
if (typeof this._explicitConstraints.maximumHeight === 'number') {
|
|
6826
|
+
return this._explicitConstraints.maximumHeight;
|
|
6827
|
+
}
|
|
6797
6828
|
const activePanelMaximumHeight = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.maximumHeight;
|
|
6798
6829
|
if (typeof activePanelMaximumHeight === 'number') {
|
|
6799
6830
|
return activePanelMaximumHeight;
|
|
@@ -6825,14 +6856,39 @@
|
|
|
6825
6856
|
var _a, _b, _c, _d, _e, _f;
|
|
6826
6857
|
super(id, 'groupview_default', {
|
|
6827
6858
|
minimumHeight: (_b = (_a = options.constraints) === null || _a === void 0 ? void 0 : _a.minimumHeight) !== null && _b !== void 0 ? _b : MINIMUM_DOCKVIEW_GROUP_PANEL_HEIGHT,
|
|
6828
|
-
minimumWidth: (_d = (_c = options.constraints) === null || _c === void 0 ? void 0 : _c.
|
|
6859
|
+
minimumWidth: (_d = (_c = options.constraints) === null || _c === void 0 ? void 0 : _c.minimumWidth) !== null && _d !== void 0 ? _d : MINIMUM_DOCKVIEW_GROUP_PANEL_WIDTH,
|
|
6829
6860
|
maximumHeight: (_e = options.constraints) === null || _e === void 0 ? void 0 : _e.maximumHeight,
|
|
6830
6861
|
maximumWidth: (_f = options.constraints) === null || _f === void 0 ? void 0 : _f.maximumWidth,
|
|
6831
6862
|
}, new DockviewGroupPanelApiImpl(id, accessor));
|
|
6863
|
+
// Track explicitly set constraints to override panel constraints
|
|
6864
|
+
this._explicitConstraints = {};
|
|
6832
6865
|
this.api.initialize(this); // cannot use 'this' after after 'super' call
|
|
6833
6866
|
this._model = new DockviewGroupPanelModel(this.element, accessor, id, options, this);
|
|
6834
6867
|
this.addDisposables(this.model.onDidActivePanelChange((event) => {
|
|
6835
6868
|
this.api._onDidActivePanelChange.fire(event);
|
|
6869
|
+
}), this.api.onDidConstraintsChangeInternal((event) => {
|
|
6870
|
+
// Track explicitly set constraints to override panel constraints
|
|
6871
|
+
// Extract numeric values from functions or values
|
|
6872
|
+
if (event.minimumWidth !== undefined) {
|
|
6873
|
+
this._explicitConstraints.minimumWidth = typeof event.minimumWidth === 'function'
|
|
6874
|
+
? event.minimumWidth()
|
|
6875
|
+
: event.minimumWidth;
|
|
6876
|
+
}
|
|
6877
|
+
if (event.minimumHeight !== undefined) {
|
|
6878
|
+
this._explicitConstraints.minimumHeight = typeof event.minimumHeight === 'function'
|
|
6879
|
+
? event.minimumHeight()
|
|
6880
|
+
: event.minimumHeight;
|
|
6881
|
+
}
|
|
6882
|
+
if (event.maximumWidth !== undefined) {
|
|
6883
|
+
this._explicitConstraints.maximumWidth = typeof event.maximumWidth === 'function'
|
|
6884
|
+
? event.maximumWidth()
|
|
6885
|
+
: event.maximumWidth;
|
|
6886
|
+
}
|
|
6887
|
+
if (event.maximumHeight !== undefined) {
|
|
6888
|
+
this._explicitConstraints.maximumHeight = typeof event.maximumHeight === 'function'
|
|
6889
|
+
? event.maximumHeight()
|
|
6890
|
+
: event.maximumHeight;
|
|
6891
|
+
}
|
|
6836
6892
|
}));
|
|
6837
6893
|
}
|
|
6838
6894
|
focus() {
|
|
@@ -7129,6 +7185,18 @@
|
|
|
7129
7185
|
params: this._params,
|
|
7130
7186
|
});
|
|
7131
7187
|
}
|
|
7188
|
+
updateFromStateModel(state) {
|
|
7189
|
+
var _a, _b, _c;
|
|
7190
|
+
this._maximumHeight = state.maximumHeight;
|
|
7191
|
+
this._minimumHeight = state.minimumHeight;
|
|
7192
|
+
this._maximumWidth = state.maximumWidth;
|
|
7193
|
+
this._minimumWidth = state.minimumWidth;
|
|
7194
|
+
this.update({ params: (_a = state.params) !== null && _a !== void 0 ? _a : {} });
|
|
7195
|
+
this.setTitle((_b = state.title) !== null && _b !== void 0 ? _b : this.id);
|
|
7196
|
+
this.setRenderer((_c = state.renderer) !== null && _c !== void 0 ? _c : this.accessor.renderer);
|
|
7197
|
+
// state.contentComponent;
|
|
7198
|
+
// state.tabComponent;
|
|
7199
|
+
}
|
|
7132
7200
|
updateParentGroup(group, options) {
|
|
7133
7201
|
this._group = group;
|
|
7134
7202
|
this.api.group = this._group;
|
|
@@ -8892,7 +8960,7 @@
|
|
|
8892
8960
|
: (_e = (_d = this.options.floatingGroupBounds) === null || _d === void 0 ? void 0 : _d.minimumHeightWithinViewport) !== null && _e !== void 0 ? _e : DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE }));
|
|
8893
8961
|
const el = group.element.querySelector('.dv-void-container');
|
|
8894
8962
|
if (!el) {
|
|
8895
|
-
throw new Error('failed to find drag handle');
|
|
8963
|
+
throw new Error('dockview: failed to find drag handle');
|
|
8896
8964
|
}
|
|
8897
8965
|
overlay.setupDrag(el, {
|
|
8898
8966
|
inDragMode: typeof (options === null || options === void 0 ? void 0 : options.inDragMode) === 'boolean'
|
|
@@ -8964,7 +9032,7 @@
|
|
|
8964
9032
|
case 'right':
|
|
8965
9033
|
return this.createGroupAtLocation([this.gridview.length], undefined, options); // insert into last position
|
|
8966
9034
|
default:
|
|
8967
|
-
throw new Error(`unsupported position ${position}`);
|
|
9035
|
+
throw new Error(`dockview: unsupported position ${position}`);
|
|
8968
9036
|
}
|
|
8969
9037
|
}
|
|
8970
9038
|
updateOptions(options) {
|
|
@@ -9110,15 +9178,48 @@
|
|
|
9110
9178
|
}
|
|
9111
9179
|
return result;
|
|
9112
9180
|
}
|
|
9113
|
-
fromJSON(data) {
|
|
9181
|
+
fromJSON(data, options) {
|
|
9114
9182
|
var _a, _b;
|
|
9183
|
+
const existingPanels = new Map();
|
|
9184
|
+
let tempGroup;
|
|
9185
|
+
if (options === null || options === void 0 ? void 0 : options.reuseExistingPanels) {
|
|
9186
|
+
/**
|
|
9187
|
+
* What are we doing here?
|
|
9188
|
+
*
|
|
9189
|
+
* 1. Create a temporary group to hold any panels that currently exist and that also exist in the new layout
|
|
9190
|
+
* 2. Remove that temporary group from the group mapping so that it doesn't get cleared when we clear the layout
|
|
9191
|
+
*/
|
|
9192
|
+
tempGroup = this.createGroup();
|
|
9193
|
+
this._groups.delete(tempGroup.api.id);
|
|
9194
|
+
const newPanels = Object.keys(data.panels);
|
|
9195
|
+
for (const panel of this.panels) {
|
|
9196
|
+
if (newPanels.includes(panel.api.id)) {
|
|
9197
|
+
existingPanels.set(panel.api.id, panel);
|
|
9198
|
+
}
|
|
9199
|
+
}
|
|
9200
|
+
this.movingLock(() => {
|
|
9201
|
+
Array.from(existingPanels.values()).forEach((panel) => {
|
|
9202
|
+
this.moveGroupOrPanel({
|
|
9203
|
+
from: {
|
|
9204
|
+
groupId: panel.api.group.api.id,
|
|
9205
|
+
panelId: panel.api.id,
|
|
9206
|
+
},
|
|
9207
|
+
to: {
|
|
9208
|
+
group: tempGroup,
|
|
9209
|
+
position: 'center',
|
|
9210
|
+
},
|
|
9211
|
+
keepEmptyGroups: true,
|
|
9212
|
+
});
|
|
9213
|
+
});
|
|
9214
|
+
});
|
|
9215
|
+
}
|
|
9115
9216
|
this.clear();
|
|
9116
9217
|
if (typeof data !== 'object' || data === null) {
|
|
9117
|
-
throw new Error('serialized layout must be a non-null object');
|
|
9218
|
+
throw new Error('dockview: serialized layout must be a non-null object');
|
|
9118
9219
|
}
|
|
9119
9220
|
const { grid, panels, activeGroup } = data;
|
|
9120
9221
|
if (grid.root.type !== 'branch' || !Array.isArray(grid.root.data)) {
|
|
9121
|
-
throw new Error('root must be of type branch');
|
|
9222
|
+
throw new Error('dockview: root must be of type branch');
|
|
9122
9223
|
}
|
|
9123
9224
|
try {
|
|
9124
9225
|
// take note of the existing dimensions
|
|
@@ -9127,7 +9228,7 @@
|
|
|
9127
9228
|
const createGroupFromSerializedState = (data) => {
|
|
9128
9229
|
const { id, locked, hideHeader, views, activeView } = data;
|
|
9129
9230
|
if (typeof id !== 'string') {
|
|
9130
|
-
throw new Error('group id must be of type string');
|
|
9231
|
+
throw new Error('dockview: group id must be of type string');
|
|
9131
9232
|
}
|
|
9132
9233
|
const group = this.createGroup({
|
|
9133
9234
|
id,
|
|
@@ -9142,17 +9243,38 @@
|
|
|
9142
9243
|
* In running this section first we avoid firing lots of 'add' events in the event of a failure
|
|
9143
9244
|
* due to a corruption of input data.
|
|
9144
9245
|
*/
|
|
9145
|
-
const
|
|
9146
|
-
|
|
9246
|
+
const existingPanel = existingPanels.get(child);
|
|
9247
|
+
if (tempGroup && existingPanel) {
|
|
9248
|
+
this.movingLock(() => {
|
|
9249
|
+
tempGroup.model.removePanel(existingPanel);
|
|
9250
|
+
});
|
|
9251
|
+
createdPanels.push(existingPanel);
|
|
9252
|
+
existingPanel.updateFromStateModel(panels[child]);
|
|
9253
|
+
}
|
|
9254
|
+
else {
|
|
9255
|
+
const panel = this._deserializer.fromJSON(panels[child], group);
|
|
9256
|
+
createdPanels.push(panel);
|
|
9257
|
+
}
|
|
9147
9258
|
}
|
|
9148
9259
|
for (let i = 0; i < views.length; i++) {
|
|
9149
9260
|
const panel = createdPanels[i];
|
|
9150
9261
|
const isActive = typeof activeView === 'string' &&
|
|
9151
9262
|
activeView === panel.id;
|
|
9152
|
-
|
|
9153
|
-
|
|
9154
|
-
|
|
9155
|
-
|
|
9263
|
+
const hasExisting = existingPanels.has(panel.api.id);
|
|
9264
|
+
if (hasExisting) {
|
|
9265
|
+
this.movingLock(() => {
|
|
9266
|
+
group.model.openPanel(panel, {
|
|
9267
|
+
skipSetActive: !isActive,
|
|
9268
|
+
skipSetGroupActive: true,
|
|
9269
|
+
});
|
|
9270
|
+
});
|
|
9271
|
+
}
|
|
9272
|
+
else {
|
|
9273
|
+
group.model.openPanel(panel, {
|
|
9274
|
+
skipSetActive: !isActive,
|
|
9275
|
+
skipSetGroupActive: true,
|
|
9276
|
+
});
|
|
9277
|
+
}
|
|
9156
9278
|
}
|
|
9157
9279
|
if (!group.activePanel && group.panels.length > 0) {
|
|
9158
9280
|
group.model.openPanel(group.panels[group.panels.length - 1], {
|
|
@@ -9191,7 +9313,9 @@
|
|
|
9191
9313
|
setTimeout(() => {
|
|
9192
9314
|
this.addPopoutGroup(group, {
|
|
9193
9315
|
position: position !== null && position !== void 0 ? position : undefined,
|
|
9194
|
-
overridePopoutGroup: gridReferenceGroup
|
|
9316
|
+
overridePopoutGroup: gridReferenceGroup
|
|
9317
|
+
? group
|
|
9318
|
+
: undefined,
|
|
9195
9319
|
referenceGroup: gridReferenceGroup
|
|
9196
9320
|
? this.getPanel(gridReferenceGroup)
|
|
9197
9321
|
: undefined,
|
|
@@ -9277,11 +9401,11 @@
|
|
|
9277
9401
|
addPanel(options) {
|
|
9278
9402
|
var _a, _b;
|
|
9279
9403
|
if (this.panels.find((_) => _.id === options.id)) {
|
|
9280
|
-
throw new Error(`panel with id ${options.id} already exists`);
|
|
9404
|
+
throw new Error(`dockview: panel with id ${options.id} already exists`);
|
|
9281
9405
|
}
|
|
9282
9406
|
let referenceGroup;
|
|
9283
9407
|
if (options.position && options.floating) {
|
|
9284
|
-
throw new Error('you can only provide one of: position, floating as arguments to .addPanel(...)');
|
|
9408
|
+
throw new Error('dockview: you can only provide one of: position, floating as arguments to .addPanel(...)');
|
|
9285
9409
|
}
|
|
9286
9410
|
const initial = {
|
|
9287
9411
|
width: options.initialWidth,
|
|
@@ -9295,7 +9419,7 @@
|
|
|
9295
9419
|
: options.position.referencePanel;
|
|
9296
9420
|
index = options.position.index;
|
|
9297
9421
|
if (!referencePanel) {
|
|
9298
|
-
throw new Error(`referencePanel '${options.position.referencePanel}' does not exist`);
|
|
9422
|
+
throw new Error(`dockview: referencePanel '${options.position.referencePanel}' does not exist`);
|
|
9299
9423
|
}
|
|
9300
9424
|
referenceGroup = this.findGroup(referencePanel);
|
|
9301
9425
|
}
|
|
@@ -9306,7 +9430,7 @@
|
|
|
9306
9430
|
: options.position.referenceGroup;
|
|
9307
9431
|
index = options.position.index;
|
|
9308
9432
|
if (!referenceGroup) {
|
|
9309
|
-
throw new Error(`referenceGroup '${options.position.referenceGroup}' does not exist`);
|
|
9433
|
+
throw new Error(`dockview: referenceGroup '${options.position.referenceGroup}' does not exist`);
|
|
9310
9434
|
}
|
|
9311
9435
|
}
|
|
9312
9436
|
else {
|
|
@@ -9418,7 +9542,7 @@
|
|
|
9418
9542
|
}) {
|
|
9419
9543
|
const group = panel.group;
|
|
9420
9544
|
if (!group) {
|
|
9421
|
-
throw new Error(`cannot remove panel ${panel.id}. it's missing a group.`);
|
|
9545
|
+
throw new Error(`dockview: cannot remove panel ${panel.id}. it's missing a group.`);
|
|
9422
9546
|
}
|
|
9423
9547
|
group.model.removePanel(panel, {
|
|
9424
9548
|
skipSetActiveGroup: options.skipSetActiveGroup,
|
|
@@ -9467,11 +9591,11 @@
|
|
|
9467
9591
|
? this.panels.find((panel) => panel.id === options.referencePanel)
|
|
9468
9592
|
: options.referencePanel;
|
|
9469
9593
|
if (!referencePanel) {
|
|
9470
|
-
throw new Error(`reference panel ${options.referencePanel} does not exist`);
|
|
9594
|
+
throw new Error(`dockview: reference panel ${options.referencePanel} does not exist`);
|
|
9471
9595
|
}
|
|
9472
9596
|
referenceGroup = this.findGroup(referencePanel);
|
|
9473
9597
|
if (!referenceGroup) {
|
|
9474
|
-
throw new Error(`reference group for reference panel ${options.referencePanel} does not exist`);
|
|
9598
|
+
throw new Error(`dockview: reference group for reference panel ${options.referencePanel} does not exist`);
|
|
9475
9599
|
}
|
|
9476
9600
|
}
|
|
9477
9601
|
else if (isGroupOptionsWithGroup(options)) {
|
|
@@ -9480,7 +9604,7 @@
|
|
|
9480
9604
|
? (_a = this._groups.get(options.referenceGroup)) === null || _a === void 0 ? void 0 : _a.value
|
|
9481
9605
|
: options.referenceGroup;
|
|
9482
9606
|
if (!referenceGroup) {
|
|
9483
|
-
throw new Error(`reference group ${options.referenceGroup} does not exist`);
|
|
9607
|
+
throw new Error(`dockview: reference group ${options.referenceGroup} does not exist`);
|
|
9484
9608
|
}
|
|
9485
9609
|
}
|
|
9486
9610
|
else {
|
|
@@ -9548,7 +9672,7 @@
|
|
|
9548
9672
|
}
|
|
9549
9673
|
return floatingGroup.group;
|
|
9550
9674
|
}
|
|
9551
|
-
throw new Error('failed to find floating group');
|
|
9675
|
+
throw new Error('dockview: failed to find floating group');
|
|
9552
9676
|
}
|
|
9553
9677
|
if (group.api.location.type === 'popout') {
|
|
9554
9678
|
const selectedGroup = this._popoutGroups.find((_) => _.popoutGroup === group);
|
|
@@ -9579,7 +9703,7 @@
|
|
|
9579
9703
|
this.updateWatermark();
|
|
9580
9704
|
return selectedGroup.popoutGroup;
|
|
9581
9705
|
}
|
|
9582
|
-
throw new Error('failed to find popout group');
|
|
9706
|
+
throw new Error('dockview: failed to find popout group');
|
|
9583
9707
|
}
|
|
9584
9708
|
const re = super.doRemoveGroup(group, options);
|
|
9585
9709
|
if (!(options === null || options === void 0 ? void 0 : options.skipActive)) {
|
|
@@ -9610,7 +9734,7 @@
|
|
|
9610
9734
|
? (_a = this._groups.get(sourceGroupId)) === null || _a === void 0 ? void 0 : _a.value
|
|
9611
9735
|
: undefined;
|
|
9612
9736
|
if (!sourceGroup) {
|
|
9613
|
-
throw new Error(`Failed to find group id ${sourceGroupId}`);
|
|
9737
|
+
throw new Error(`dockview: Failed to find group id ${sourceGroupId}`);
|
|
9614
9738
|
}
|
|
9615
9739
|
if (sourceItemId === undefined) {
|
|
9616
9740
|
/**
|
|
@@ -9635,9 +9759,9 @@
|
|
|
9635
9759
|
skipSetActiveGroup: true,
|
|
9636
9760
|
}));
|
|
9637
9761
|
if (!removedPanel) {
|
|
9638
|
-
throw new Error(`No panel with id ${sourceItemId}`);
|
|
9762
|
+
throw new Error(`dockview: No panel with id ${sourceItemId}`);
|
|
9639
9763
|
}
|
|
9640
|
-
if (sourceGroup.model.size === 0) {
|
|
9764
|
+
if (!options.keepEmptyGroups && sourceGroup.model.size === 0) {
|
|
9641
9765
|
// remove the group and do not set a new group as active
|
|
9642
9766
|
this.doRemoveGroup(sourceGroup, { skipActive: true });
|
|
9643
9767
|
}
|
|
@@ -9647,7 +9771,8 @@
|
|
|
9647
9771
|
var _a;
|
|
9648
9772
|
return destinationGroup.model.openPanel(removedPanel, {
|
|
9649
9773
|
index: destinationIndex,
|
|
9650
|
-
skipSetActive: ((_a = options.skipSetActive) !== null && _a !== void 0 ? _a : false) &&
|
|
9774
|
+
skipSetActive: ((_a = options.skipSetActive) !== null && _a !== void 0 ? _a : false) &&
|
|
9775
|
+
!isDestinationGroupEmpty,
|
|
9651
9776
|
skipSetGroupActive: true,
|
|
9652
9777
|
});
|
|
9653
9778
|
});
|
|
@@ -9702,7 +9827,9 @@
|
|
|
9702
9827
|
}));
|
|
9703
9828
|
this.doRemoveGroup(sourceGroup, { skipActive: true });
|
|
9704
9829
|
const newGroup = this.createGroupAtLocation(targetLocation);
|
|
9705
|
-
this.movingLock(() => newGroup.model.openPanel(removedPanel
|
|
9830
|
+
this.movingLock(() => newGroup.model.openPanel(removedPanel, {
|
|
9831
|
+
skipSetActive: true,
|
|
9832
|
+
}));
|
|
9706
9833
|
this.doSetGroupAndPanelActive(newGroup);
|
|
9707
9834
|
this._onDidMovePanel.fire({
|
|
9708
9835
|
panel: this.getGroupPanel(sourceItemId),
|
|
@@ -9735,7 +9862,7 @@
|
|
|
9735
9862
|
skipSetActiveGroup: true,
|
|
9736
9863
|
}));
|
|
9737
9864
|
if (!removedPanel) {
|
|
9738
|
-
throw new Error(`No panel with id ${sourceItemId}`);
|
|
9865
|
+
throw new Error(`dockview: No panel with id ${sourceItemId}`);
|
|
9739
9866
|
}
|
|
9740
9867
|
const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, destinationTarget);
|
|
9741
9868
|
const group = this.createGroupAtLocation(dropLocation);
|
|
@@ -9790,7 +9917,7 @@
|
|
|
9790
9917
|
case 'floating': {
|
|
9791
9918
|
const selectedFloatingGroup = this._floatingGroups.find((x) => x.group === from);
|
|
9792
9919
|
if (!selectedFloatingGroup) {
|
|
9793
|
-
throw new Error('failed to find floating group');
|
|
9920
|
+
throw new Error('dockview: failed to find floating group');
|
|
9794
9921
|
}
|
|
9795
9922
|
selectedFloatingGroup.dispose();
|
|
9796
9923
|
break;
|
|
@@ -9798,7 +9925,7 @@
|
|
|
9798
9925
|
case 'popout': {
|
|
9799
9926
|
const selectedPopoutGroup = this._popoutGroups.find((x) => x.popoutGroup === from);
|
|
9800
9927
|
if (!selectedPopoutGroup) {
|
|
9801
|
-
throw new Error('failed to find popout group');
|
|
9928
|
+
throw new Error('dockview: failed to find popout group');
|
|
9802
9929
|
}
|
|
9803
9930
|
// Remove from popout groups list to prevent automatic restoration
|
|
9804
9931
|
const index = this._popoutGroups.indexOf(selectedPopoutGroup);
|
|
@@ -11247,12 +11374,19 @@
|
|
|
11247
11374
|
return this._element;
|
|
11248
11375
|
}
|
|
11249
11376
|
init(parameters) {
|
|
11250
|
-
|
|
11377
|
+
// If already initialized, just update the parameters
|
|
11378
|
+
if (this.componentRef) {
|
|
11379
|
+
this.update(parameters);
|
|
11380
|
+
}
|
|
11381
|
+
else {
|
|
11382
|
+
this.render(parameters);
|
|
11383
|
+
}
|
|
11251
11384
|
}
|
|
11252
11385
|
update(params) {
|
|
11253
11386
|
if (this.componentRef) {
|
|
11254
11387
|
Object.keys(params).forEach(key => {
|
|
11255
|
-
|
|
11388
|
+
// Use 'in' operator instead of hasOwnProperty to support getter/setter properties
|
|
11389
|
+
if (key in this.componentRef.instance) {
|
|
11256
11390
|
this.componentRef.instance[key] = params[key];
|
|
11257
11391
|
}
|
|
11258
11392
|
});
|
|
@@ -11268,7 +11402,8 @@
|
|
|
11268
11402
|
});
|
|
11269
11403
|
// Set initial parameters
|
|
11270
11404
|
Object.keys(parameters).forEach(key => {
|
|
11271
|
-
|
|
11405
|
+
// Use 'in' operator instead of hasOwnProperty to support getter/setter properties
|
|
11406
|
+
if (key in this.componentRef.instance) {
|
|
11272
11407
|
this.componentRef.instance[key] = parameters[key];
|
|
11273
11408
|
}
|
|
11274
11409
|
});
|
|
@@ -11439,6 +11574,7 @@
|
|
|
11439
11574
|
injector: this.injector,
|
|
11440
11575
|
environmentInjector: this.environmentInjector
|
|
11441
11576
|
});
|
|
11577
|
+
// Initialize with empty props - dockview-core will call init() again with actual IGroupHeaderProps
|
|
11442
11578
|
renderer.init({});
|
|
11443
11579
|
return renderer;
|
|
11444
11580
|
}
|
|
@@ -12496,6 +12632,7 @@
|
|
|
12496
12632
|
exports.DockviewAngularComponent = __decorate([
|
|
12497
12633
|
core.Component({
|
|
12498
12634
|
selector: 'dv-dockview',
|
|
12635
|
+
standalone: true,
|
|
12499
12636
|
template: '<div #dockviewContainer class="dockview-container"></div>',
|
|
12500
12637
|
styles: [`
|
|
12501
12638
|
:host {
|
|
@@ -12503,7 +12640,7 @@
|
|
|
12503
12640
|
width: 100%;
|
|
12504
12641
|
height: 100%;
|
|
12505
12642
|
}
|
|
12506
|
-
|
|
12643
|
+
|
|
12507
12644
|
.dockview-container {
|
|
12508
12645
|
width: 100%;
|
|
12509
12646
|
height: 100%;
|
|
@@ -12619,6 +12756,7 @@
|
|
|
12619
12756
|
exports.GridviewAngularComponent = __decorate([
|
|
12620
12757
|
core.Component({
|
|
12621
12758
|
selector: 'dv-gridview',
|
|
12759
|
+
standalone: true,
|
|
12622
12760
|
template: '<div #gridviewContainer class="gridview-container"></div>',
|
|
12623
12761
|
styles: [`
|
|
12624
12762
|
:host {
|
|
@@ -12626,7 +12764,7 @@
|
|
|
12626
12764
|
width: 100%;
|
|
12627
12765
|
height: 100%;
|
|
12628
12766
|
}
|
|
12629
|
-
|
|
12767
|
+
|
|
12630
12768
|
.gridview-container {
|
|
12631
12769
|
width: 100%;
|
|
12632
12770
|
height: 100%;
|
|
@@ -12767,6 +12905,7 @@
|
|
|
12767
12905
|
exports.PaneviewAngularComponent = __decorate([
|
|
12768
12906
|
core.Component({
|
|
12769
12907
|
selector: 'dv-paneview',
|
|
12908
|
+
standalone: true,
|
|
12770
12909
|
template: '<div #paneviewContainer class="paneview-container"></div>',
|
|
12771
12910
|
styles: [`
|
|
12772
12911
|
:host {
|
|
@@ -12774,7 +12913,7 @@
|
|
|
12774
12913
|
width: 100%;
|
|
12775
12914
|
height: 100%;
|
|
12776
12915
|
}
|
|
12777
|
-
|
|
12916
|
+
|
|
12778
12917
|
.paneview-container {
|
|
12779
12918
|
width: 100%;
|
|
12780
12919
|
height: 100%;
|
|
@@ -12890,6 +13029,7 @@
|
|
|
12890
13029
|
exports.SplitviewAngularComponent = __decorate([
|
|
12891
13030
|
core.Component({
|
|
12892
13031
|
selector: 'dv-splitview',
|
|
13032
|
+
standalone: true,
|
|
12893
13033
|
template: '<div #splitviewContainer class="splitview-container"></div>',
|
|
12894
13034
|
styles: [`
|
|
12895
13035
|
:host {
|
|
@@ -12897,7 +13037,7 @@
|
|
|
12897
13037
|
width: 100%;
|
|
12898
13038
|
height: 100%;
|
|
12899
13039
|
}
|
|
12900
|
-
|
|
13040
|
+
|
|
12901
13041
|
.splitview-container {
|
|
12902
13042
|
width: 100%;
|
|
12903
13043
|
height: 100%;
|
|
@@ -12911,15 +13051,13 @@
|
|
|
12911
13051
|
};
|
|
12912
13052
|
exports.DockviewAngularModule = __decorate([
|
|
12913
13053
|
core.NgModule({
|
|
12914
|
-
|
|
13054
|
+
imports: [
|
|
13055
|
+
common.CommonModule,
|
|
12915
13056
|
exports.DockviewAngularComponent,
|
|
12916
13057
|
exports.GridviewAngularComponent,
|
|
12917
13058
|
exports.PaneviewAngularComponent,
|
|
12918
13059
|
exports.SplitviewAngularComponent
|
|
12919
13060
|
],
|
|
12920
|
-
imports: [
|
|
12921
|
-
common.CommonModule
|
|
12922
|
-
],
|
|
12923
13061
|
exports: [
|
|
12924
13062
|
exports.DockviewAngularComponent,
|
|
12925
13063
|
exports.GridviewAngularComponent,
|