dockview-angular 4.9.0 → 4.11.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.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview-angular
3
- * @version 4.9.0
3
+ * @version 4.11.0
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -6765,11 +6765,16 @@
6765
6765
  }
6766
6766
  }
6767
6767
 
6768
+ // GridConstraintChangeEvent2 is not exported, so we'll type it manually
6768
6769
  const MINIMUM_DOCKVIEW_GROUP_PANEL_WIDTH = 100;
6769
6770
  const MINIMUM_DOCKVIEW_GROUP_PANEL_HEIGHT = 100;
6770
6771
  class DockviewGroupPanel extends GridviewPanel {
6771
6772
  get minimumWidth() {
6772
6773
  var _a;
6774
+ // Check for explicitly set group constraint first
6775
+ if (typeof this._explicitConstraints.minimumWidth === 'number') {
6776
+ return this._explicitConstraints.minimumWidth;
6777
+ }
6773
6778
  const activePanelMinimumWidth = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.minimumWidth;
6774
6779
  if (typeof activePanelMinimumWidth === 'number') {
6775
6780
  return activePanelMinimumWidth;
@@ -6778,6 +6783,10 @@
6778
6783
  }
6779
6784
  get minimumHeight() {
6780
6785
  var _a;
6786
+ // Check for explicitly set group constraint first
6787
+ if (typeof this._explicitConstraints.minimumHeight === 'number') {
6788
+ return this._explicitConstraints.minimumHeight;
6789
+ }
6781
6790
  const activePanelMinimumHeight = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.minimumHeight;
6782
6791
  if (typeof activePanelMinimumHeight === 'number') {
6783
6792
  return activePanelMinimumHeight;
@@ -6786,6 +6795,10 @@
6786
6795
  }
6787
6796
  get maximumWidth() {
6788
6797
  var _a;
6798
+ // Check for explicitly set group constraint first
6799
+ if (typeof this._explicitConstraints.maximumWidth === 'number') {
6800
+ return this._explicitConstraints.maximumWidth;
6801
+ }
6789
6802
  const activePanelMaximumWidth = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.maximumWidth;
6790
6803
  if (typeof activePanelMaximumWidth === 'number') {
6791
6804
  return activePanelMaximumWidth;
@@ -6794,6 +6807,10 @@
6794
6807
  }
6795
6808
  get maximumHeight() {
6796
6809
  var _a;
6810
+ // Check for explicitly set group constraint first
6811
+ if (typeof this._explicitConstraints.maximumHeight === 'number') {
6812
+ return this._explicitConstraints.maximumHeight;
6813
+ }
6797
6814
  const activePanelMaximumHeight = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.maximumHeight;
6798
6815
  if (typeof activePanelMaximumHeight === 'number') {
6799
6816
  return activePanelMaximumHeight;
@@ -6825,14 +6842,39 @@
6825
6842
  var _a, _b, _c, _d, _e, _f;
6826
6843
  super(id, 'groupview_default', {
6827
6844
  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.maximumHeight) !== null && _d !== void 0 ? _d : MINIMUM_DOCKVIEW_GROUP_PANEL_WIDTH,
6845
+ minimumWidth: (_d = (_c = options.constraints) === null || _c === void 0 ? void 0 : _c.minimumWidth) !== null && _d !== void 0 ? _d : MINIMUM_DOCKVIEW_GROUP_PANEL_WIDTH,
6829
6846
  maximumHeight: (_e = options.constraints) === null || _e === void 0 ? void 0 : _e.maximumHeight,
6830
6847
  maximumWidth: (_f = options.constraints) === null || _f === void 0 ? void 0 : _f.maximumWidth,
6831
6848
  }, new DockviewGroupPanelApiImpl(id, accessor));
6849
+ // Track explicitly set constraints to override panel constraints
6850
+ this._explicitConstraints = {};
6832
6851
  this.api.initialize(this); // cannot use 'this' after after 'super' call
6833
6852
  this._model = new DockviewGroupPanelModel(this.element, accessor, id, options, this);
6834
6853
  this.addDisposables(this.model.onDidActivePanelChange((event) => {
6835
6854
  this.api._onDidActivePanelChange.fire(event);
6855
+ }), this.api.onDidConstraintsChangeInternal((event) => {
6856
+ // Track explicitly set constraints to override panel constraints
6857
+ // Extract numeric values from functions or values
6858
+ if (event.minimumWidth !== undefined) {
6859
+ this._explicitConstraints.minimumWidth = typeof event.minimumWidth === 'function'
6860
+ ? event.minimumWidth()
6861
+ : event.minimumWidth;
6862
+ }
6863
+ if (event.minimumHeight !== undefined) {
6864
+ this._explicitConstraints.minimumHeight = typeof event.minimumHeight === 'function'
6865
+ ? event.minimumHeight()
6866
+ : event.minimumHeight;
6867
+ }
6868
+ if (event.maximumWidth !== undefined) {
6869
+ this._explicitConstraints.maximumWidth = typeof event.maximumWidth === 'function'
6870
+ ? event.maximumWidth()
6871
+ : event.maximumWidth;
6872
+ }
6873
+ if (event.maximumHeight !== undefined) {
6874
+ this._explicitConstraints.maximumHeight = typeof event.maximumHeight === 'function'
6875
+ ? event.maximumHeight()
6876
+ : event.maximumHeight;
6877
+ }
6836
6878
  }));
6837
6879
  }
6838
6880
  focus() {
@@ -10277,8 +10319,8 @@
10277
10319
  accessor: this,
10278
10320
  isVisible: true,
10279
10321
  });
10280
- this.registerPanel(view);
10281
10322
  this.doAddGroup(view, relativeLocation, options.size);
10323
+ this.registerPanel(view);
10282
10324
  this.doSetGroupActive(view);
10283
10325
  return view;
10284
10326
  }