dockview-react 1.16.0 → 1.16.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.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview-react
3
- * @version 1.16.0
3
+ * @version 1.16.1
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -2704,6 +2704,7 @@ class BaseGrid extends Resizable {
2704
2704
  this.gridview.locked = value;
2705
2705
  }
2706
2706
  constructor(options) {
2707
+ var _a, _b;
2707
2708
  super(document.createElement('div'), options.disableAutoResizing);
2708
2709
  this._id = nextLayoutId$1.next();
2709
2710
  this._groups = new Map();
@@ -2717,10 +2718,12 @@ class BaseGrid extends Resizable {
2717
2718
  this.onDidLayoutChange = this._bufferOnDidLayoutChange.onEvent;
2718
2719
  this._onDidViewVisibilityChangeMicroTaskQueue = new AsapEvent();
2719
2720
  this.onDidViewVisibilityChangeMicroTaskQueue = this._onDidViewVisibilityChangeMicroTaskQueue.onEvent;
2721
+ this.classNames = [];
2720
2722
  this.element.style.height = '100%';
2721
2723
  this.element.style.width = '100%';
2722
- if (typeof options.className === 'string') {
2723
- this.element.classList.add(options.className);
2724
+ this.classNames = (_b = (_a = options.className) === null || _a === void 0 ? void 0 : _a.split(' ')) !== null && _b !== void 0 ? _b : [];
2725
+ for (const className of this.classNames) {
2726
+ toggleClass(this.element, className, true);
2724
2727
  }
2725
2728
  options.parentElement.appendChild(this.element);
2726
2729
  this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation, options.locked, options.margin);
@@ -2745,6 +2748,18 @@ class BaseGrid extends Resizable {
2745
2748
  isVisible(panel) {
2746
2749
  return this.gridview.isViewVisible(getGridLocation(panel.element));
2747
2750
  }
2751
+ updateOptions(options) {
2752
+ var _a, _b;
2753
+ if ('className' in options) {
2754
+ for (const className of this.classNames) {
2755
+ toggleClass(this.element, className, false);
2756
+ }
2757
+ this.classNames = (_b = (_a = options.className) === null || _a === void 0 ? void 0 : _a.split(' ')) !== null && _b !== void 0 ? _b : [];
2758
+ for (const className of this.classNames) {
2759
+ toggleClass(this.element, className, true);
2760
+ }
2761
+ }
2762
+ }
2748
2763
  maximizeGroup(panel) {
2749
2764
  this.gridview.maximizeView(panel);
2750
2765
  this.doSetGroupActive(panel);
@@ -7810,6 +7825,7 @@ class DockviewComponent extends BaseGrid {
7810
7825
  }
7811
7826
  updateOptions(options) {
7812
7827
  var _a, _b;
7828
+ super.updateOptions(options);
7813
7829
  const changed_floatingGroupBounds = 'floatingGroupBounds' in options &&
7814
7830
  options.floatingGroupBounds !== this.options.floatingGroupBounds;
7815
7831
  const changed_rootOverlayOptions = 'rootOverlayModel' in options &&
@@ -8754,6 +8770,7 @@ class GridviewComponent extends BaseGrid {
8754
8770
  }
8755
8771
  }
8756
8772
  updateOptions(options) {
8773
+ super.updateOptions(options);
8757
8774
  const hasOrientationChanged = typeof options.orientation === 'string' &&
8758
8775
  this.gridview.orientation !== options.orientation;
8759
8776
  this._options = Object.assign(Object.assign({}, this.options), options);
@@ -9021,6 +9038,7 @@ class SplitviewComponent extends Resizable {
9021
9038
  : this.splitview.orthogonalSize;
9022
9039
  }
9023
9040
  constructor(parentElement, options) {
9041
+ var _a, _b;
9024
9042
  super(parentElement, options.disableAutoResizing);
9025
9043
  this._splitviewChangeDisposable = new MutableDisposable();
9026
9044
  this._panels = new Map();
@@ -9032,8 +9050,10 @@ class SplitviewComponent extends Resizable {
9032
9050
  this.onDidRemoveView = this._onDidRemoveView.event;
9033
9051
  this._onDidLayoutChange = new Emitter();
9034
9052
  this.onDidLayoutChange = this._onDidLayoutChange.event;
9035
- if (typeof options.className === 'string') {
9036
- this.element.classList.add(options.className);
9053
+ this.classNames = [];
9054
+ this.classNames = (_b = (_a = options.className) === null || _a === void 0 ? void 0 : _a.split(' ')) !== null && _b !== void 0 ? _b : [];
9055
+ for (const className of this.classNames) {
9056
+ toggleClass(this.element, className, true);
9037
9057
  }
9038
9058
  this._options = options;
9039
9059
  if (!options.components) {
@@ -9046,6 +9066,16 @@ class SplitviewComponent extends Resizable {
9046
9066
  this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
9047
9067
  }
9048
9068
  updateOptions(options) {
9069
+ var _a, _b;
9070
+ if ('className' in options) {
9071
+ for (const className of this.classNames) {
9072
+ toggleClass(this.element, className, false);
9073
+ }
9074
+ this.classNames = (_b = (_a = options.className) === null || _a === void 0 ? void 0 : _a.split(' ')) !== null && _b !== void 0 ? _b : [];
9075
+ for (const className of this.classNames) {
9076
+ toggleClass(this.element, className, true);
9077
+ }
9078
+ }
9049
9079
  const hasOrientationChanged = typeof options.orientation === 'string' &&
9050
9080
  this.options.orientation !== options.orientation;
9051
9081
  this._options = Object.assign(Object.assign({}, this.options), options);
@@ -9348,6 +9378,7 @@ class PaneviewComponent extends Resizable {
9348
9378
  return this._options;
9349
9379
  }
9350
9380
  constructor(parentElement, options) {
9381
+ var _a, _b;
9351
9382
  super(parentElement, options.disableAutoResizing);
9352
9383
  this._id = nextLayoutId.next();
9353
9384
  this._disposable = new MutableDisposable();
@@ -9362,10 +9393,12 @@ class PaneviewComponent extends Resizable {
9362
9393
  this.onDidAddView = this._onDidAddView.event;
9363
9394
  this._onDidRemoveView = new Emitter();
9364
9395
  this.onDidRemoveView = this._onDidRemoveView.event;
9365
- if (typeof options.className === 'string') {
9366
- this.element.classList.add(options.className);
9367
- }
9396
+ this.classNames = [];
9368
9397
  this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView);
9398
+ this.classNames = (_b = (_a = options.className) === null || _a === void 0 ? void 0 : _a.split(' ')) !== null && _b !== void 0 ? _b : [];
9399
+ for (const className of this.classNames) {
9400
+ toggleClass(this.element, className, true);
9401
+ }
9369
9402
  this._options = options;
9370
9403
  if (!options.components) {
9371
9404
  options.components = {};
@@ -9387,6 +9420,16 @@ class PaneviewComponent extends Resizable {
9387
9420
  //noop
9388
9421
  }
9389
9422
  updateOptions(options) {
9423
+ var _a, _b;
9424
+ if ('className' in options) {
9425
+ for (const className of this.classNames) {
9426
+ toggleClass(this.element, className, false);
9427
+ }
9428
+ this.classNames = (_b = (_a = options.className) === null || _a === void 0 ? void 0 : _a.split(' ')) !== null && _b !== void 0 ? _b : [];
9429
+ for (const className of this.classNames) {
9430
+ toggleClass(this.element, className, true);
9431
+ }
9432
+ }
9390
9433
  this._options = Object.assign(Object.assign({}, this.options), options);
9391
9434
  }
9392
9435
  addPanel(options) {