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
  */
@@ -2702,6 +2702,7 @@ class BaseGrid extends Resizable {
2702
2702
  this.gridview.locked = value;
2703
2703
  }
2704
2704
  constructor(options) {
2705
+ var _a, _b;
2705
2706
  super(document.createElement('div'), options.disableAutoResizing);
2706
2707
  this._id = nextLayoutId$1.next();
2707
2708
  this._groups = new Map();
@@ -2715,10 +2716,12 @@ class BaseGrid extends Resizable {
2715
2716
  this.onDidLayoutChange = this._bufferOnDidLayoutChange.onEvent;
2716
2717
  this._onDidViewVisibilityChangeMicroTaskQueue = new AsapEvent();
2717
2718
  this.onDidViewVisibilityChangeMicroTaskQueue = this._onDidViewVisibilityChangeMicroTaskQueue.onEvent;
2719
+ this.classNames = [];
2718
2720
  this.element.style.height = '100%';
2719
2721
  this.element.style.width = '100%';
2720
- if (typeof options.className === 'string') {
2721
- this.element.classList.add(options.className);
2722
+ this.classNames = (_b = (_a = options.className) === null || _a === void 0 ? void 0 : _a.split(' ')) !== null && _b !== void 0 ? _b : [];
2723
+ for (const className of this.classNames) {
2724
+ toggleClass(this.element, className, true);
2722
2725
  }
2723
2726
  options.parentElement.appendChild(this.element);
2724
2727
  this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation, options.locked, options.margin);
@@ -2743,6 +2746,18 @@ class BaseGrid extends Resizable {
2743
2746
  isVisible(panel) {
2744
2747
  return this.gridview.isViewVisible(getGridLocation(panel.element));
2745
2748
  }
2749
+ updateOptions(options) {
2750
+ var _a, _b;
2751
+ if ('className' in options) {
2752
+ for (const className of this.classNames) {
2753
+ toggleClass(this.element, className, false);
2754
+ }
2755
+ this.classNames = (_b = (_a = options.className) === null || _a === void 0 ? void 0 : _a.split(' ')) !== null && _b !== void 0 ? _b : [];
2756
+ for (const className of this.classNames) {
2757
+ toggleClass(this.element, className, true);
2758
+ }
2759
+ }
2760
+ }
2746
2761
  maximizeGroup(panel) {
2747
2762
  this.gridview.maximizeView(panel);
2748
2763
  this.doSetGroupActive(panel);
@@ -7808,6 +7823,7 @@ class DockviewComponent extends BaseGrid {
7808
7823
  }
7809
7824
  updateOptions(options) {
7810
7825
  var _a, _b;
7826
+ super.updateOptions(options);
7811
7827
  const changed_floatingGroupBounds = 'floatingGroupBounds' in options &&
7812
7828
  options.floatingGroupBounds !== this.options.floatingGroupBounds;
7813
7829
  const changed_rootOverlayOptions = 'rootOverlayModel' in options &&
@@ -8752,6 +8768,7 @@ class GridviewComponent extends BaseGrid {
8752
8768
  }
8753
8769
  }
8754
8770
  updateOptions(options) {
8771
+ super.updateOptions(options);
8755
8772
  const hasOrientationChanged = typeof options.orientation === 'string' &&
8756
8773
  this.gridview.orientation !== options.orientation;
8757
8774
  this._options = Object.assign(Object.assign({}, this.options), options);
@@ -9019,6 +9036,7 @@ class SplitviewComponent extends Resizable {
9019
9036
  : this.splitview.orthogonalSize;
9020
9037
  }
9021
9038
  constructor(parentElement, options) {
9039
+ var _a, _b;
9022
9040
  super(parentElement, options.disableAutoResizing);
9023
9041
  this._splitviewChangeDisposable = new MutableDisposable();
9024
9042
  this._panels = new Map();
@@ -9030,8 +9048,10 @@ class SplitviewComponent extends Resizable {
9030
9048
  this.onDidRemoveView = this._onDidRemoveView.event;
9031
9049
  this._onDidLayoutChange = new Emitter();
9032
9050
  this.onDidLayoutChange = this._onDidLayoutChange.event;
9033
- if (typeof options.className === 'string') {
9034
- this.element.classList.add(options.className);
9051
+ this.classNames = [];
9052
+ this.classNames = (_b = (_a = options.className) === null || _a === void 0 ? void 0 : _a.split(' ')) !== null && _b !== void 0 ? _b : [];
9053
+ for (const className of this.classNames) {
9054
+ toggleClass(this.element, className, true);
9035
9055
  }
9036
9056
  this._options = options;
9037
9057
  if (!options.components) {
@@ -9044,6 +9064,16 @@ class SplitviewComponent extends Resizable {
9044
9064
  this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
9045
9065
  }
9046
9066
  updateOptions(options) {
9067
+ var _a, _b;
9068
+ if ('className' in options) {
9069
+ for (const className of this.classNames) {
9070
+ toggleClass(this.element, className, false);
9071
+ }
9072
+ this.classNames = (_b = (_a = options.className) === null || _a === void 0 ? void 0 : _a.split(' ')) !== null && _b !== void 0 ? _b : [];
9073
+ for (const className of this.classNames) {
9074
+ toggleClass(this.element, className, true);
9075
+ }
9076
+ }
9047
9077
  const hasOrientationChanged = typeof options.orientation === 'string' &&
9048
9078
  this.options.orientation !== options.orientation;
9049
9079
  this._options = Object.assign(Object.assign({}, this.options), options);
@@ -9346,6 +9376,7 @@ class PaneviewComponent extends Resizable {
9346
9376
  return this._options;
9347
9377
  }
9348
9378
  constructor(parentElement, options) {
9379
+ var _a, _b;
9349
9380
  super(parentElement, options.disableAutoResizing);
9350
9381
  this._id = nextLayoutId.next();
9351
9382
  this._disposable = new MutableDisposable();
@@ -9360,10 +9391,12 @@ class PaneviewComponent extends Resizable {
9360
9391
  this.onDidAddView = this._onDidAddView.event;
9361
9392
  this._onDidRemoveView = new Emitter();
9362
9393
  this.onDidRemoveView = this._onDidRemoveView.event;
9363
- if (typeof options.className === 'string') {
9364
- this.element.classList.add(options.className);
9365
- }
9394
+ this.classNames = [];
9366
9395
  this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView);
9396
+ this.classNames = (_b = (_a = options.className) === null || _a === void 0 ? void 0 : _a.split(' ')) !== null && _b !== void 0 ? _b : [];
9397
+ for (const className of this.classNames) {
9398
+ toggleClass(this.element, className, true);
9399
+ }
9367
9400
  this._options = options;
9368
9401
  if (!options.components) {
9369
9402
  options.components = {};
@@ -9385,6 +9418,16 @@ class PaneviewComponent extends Resizable {
9385
9418
  //noop
9386
9419
  }
9387
9420
  updateOptions(options) {
9421
+ var _a, _b;
9422
+ if ('className' in options) {
9423
+ for (const className of this.classNames) {
9424
+ toggleClass(this.element, className, false);
9425
+ }
9426
+ this.classNames = (_b = (_a = options.className) === null || _a === void 0 ? void 0 : _a.split(' ')) !== null && _b !== void 0 ? _b : [];
9427
+ for (const className of this.classNames) {
9428
+ toggleClass(this.element, className, true);
9429
+ }
9430
+ }
9388
9431
  this._options = Object.assign(Object.assign({}, this.options), options);
9389
9432
  }
9390
9433
  addPanel(options) {