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
  */
@@ -6793,11 +6793,16 @@ class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
6793
6793
  }
6794
6794
  }
6795
6795
 
6796
+ // GridConstraintChangeEvent2 is not exported, so we'll type it manually
6796
6797
  const MINIMUM_DOCKVIEW_GROUP_PANEL_WIDTH = 100;
6797
6798
  const MINIMUM_DOCKVIEW_GROUP_PANEL_HEIGHT = 100;
6798
6799
  class DockviewGroupPanel extends GridviewPanel {
6799
6800
  get minimumWidth() {
6800
6801
  var _a;
6802
+ // Check for explicitly set group constraint first
6803
+ if (typeof this._explicitConstraints.minimumWidth === 'number') {
6804
+ return this._explicitConstraints.minimumWidth;
6805
+ }
6801
6806
  const activePanelMinimumWidth = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.minimumWidth;
6802
6807
  if (typeof activePanelMinimumWidth === 'number') {
6803
6808
  return activePanelMinimumWidth;
@@ -6806,6 +6811,10 @@ class DockviewGroupPanel extends GridviewPanel {
6806
6811
  }
6807
6812
  get minimumHeight() {
6808
6813
  var _a;
6814
+ // Check for explicitly set group constraint first
6815
+ if (typeof this._explicitConstraints.minimumHeight === 'number') {
6816
+ return this._explicitConstraints.minimumHeight;
6817
+ }
6809
6818
  const activePanelMinimumHeight = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.minimumHeight;
6810
6819
  if (typeof activePanelMinimumHeight === 'number') {
6811
6820
  return activePanelMinimumHeight;
@@ -6814,6 +6823,10 @@ class DockviewGroupPanel extends GridviewPanel {
6814
6823
  }
6815
6824
  get maximumWidth() {
6816
6825
  var _a;
6826
+ // Check for explicitly set group constraint first
6827
+ if (typeof this._explicitConstraints.maximumWidth === 'number') {
6828
+ return this._explicitConstraints.maximumWidth;
6829
+ }
6817
6830
  const activePanelMaximumWidth = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.maximumWidth;
6818
6831
  if (typeof activePanelMaximumWidth === 'number') {
6819
6832
  return activePanelMaximumWidth;
@@ -6822,6 +6835,10 @@ class DockviewGroupPanel extends GridviewPanel {
6822
6835
  }
6823
6836
  get maximumHeight() {
6824
6837
  var _a;
6838
+ // Check for explicitly set group constraint first
6839
+ if (typeof this._explicitConstraints.maximumHeight === 'number') {
6840
+ return this._explicitConstraints.maximumHeight;
6841
+ }
6825
6842
  const activePanelMaximumHeight = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.maximumHeight;
6826
6843
  if (typeof activePanelMaximumHeight === 'number') {
6827
6844
  return activePanelMaximumHeight;
@@ -6853,14 +6870,39 @@ class DockviewGroupPanel extends GridviewPanel {
6853
6870
  var _a, _b, _c, _d, _e, _f;
6854
6871
  super(id, 'groupview_default', {
6855
6872
  minimumHeight: (_b = (_a = options.constraints) === null || _a === void 0 ? void 0 : _a.minimumHeight) !== null && _b !== void 0 ? _b : MINIMUM_DOCKVIEW_GROUP_PANEL_HEIGHT,
6856
- minimumWidth: (_d = (_c = options.constraints) === null || _c === void 0 ? void 0 : _c.maximumHeight) !== null && _d !== void 0 ? _d : MINIMUM_DOCKVIEW_GROUP_PANEL_WIDTH,
6873
+ minimumWidth: (_d = (_c = options.constraints) === null || _c === void 0 ? void 0 : _c.minimumWidth) !== null && _d !== void 0 ? _d : MINIMUM_DOCKVIEW_GROUP_PANEL_WIDTH,
6857
6874
  maximumHeight: (_e = options.constraints) === null || _e === void 0 ? void 0 : _e.maximumHeight,
6858
6875
  maximumWidth: (_f = options.constraints) === null || _f === void 0 ? void 0 : _f.maximumWidth,
6859
6876
  }, new DockviewGroupPanelApiImpl(id, accessor));
6877
+ // Track explicitly set constraints to override panel constraints
6878
+ this._explicitConstraints = {};
6860
6879
  this.api.initialize(this); // cannot use 'this' after after 'super' call
6861
6880
  this._model = new DockviewGroupPanelModel(this.element, accessor, id, options, this);
6862
6881
  this.addDisposables(this.model.onDidActivePanelChange((event) => {
6863
6882
  this.api._onDidActivePanelChange.fire(event);
6883
+ }), this.api.onDidConstraintsChangeInternal((event) => {
6884
+ // Track explicitly set constraints to override panel constraints
6885
+ // Extract numeric values from functions or values
6886
+ if (event.minimumWidth !== undefined) {
6887
+ this._explicitConstraints.minimumWidth = typeof event.minimumWidth === 'function'
6888
+ ? event.minimumWidth()
6889
+ : event.minimumWidth;
6890
+ }
6891
+ if (event.minimumHeight !== undefined) {
6892
+ this._explicitConstraints.minimumHeight = typeof event.minimumHeight === 'function'
6893
+ ? event.minimumHeight()
6894
+ : event.minimumHeight;
6895
+ }
6896
+ if (event.maximumWidth !== undefined) {
6897
+ this._explicitConstraints.maximumWidth = typeof event.maximumWidth === 'function'
6898
+ ? event.maximumWidth()
6899
+ : event.maximumWidth;
6900
+ }
6901
+ if (event.maximumHeight !== undefined) {
6902
+ this._explicitConstraints.maximumHeight = typeof event.maximumHeight === 'function'
6903
+ ? event.maximumHeight()
6904
+ : event.maximumHeight;
6905
+ }
6864
6906
  }));
6865
6907
  }
6866
6908
  focus() {
@@ -10305,8 +10347,8 @@ class GridviewComponent extends BaseGrid {
10305
10347
  accessor: this,
10306
10348
  isVisible: true,
10307
10349
  });
10308
- this.registerPanel(view);
10309
10350
  this.doAddGroup(view, relativeLocation, options.size);
10351
+ this.registerPanel(view);
10310
10352
  this.doSetGroupActive(view);
10311
10353
  return view;
10312
10354
  }