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
  */
@@ -2671,6 +2671,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2671
2671
  this.gridview.locked = value;
2672
2672
  }
2673
2673
  constructor(options) {
2674
+ var _a, _b;
2674
2675
  super(document.createElement('div'), options.disableAutoResizing);
2675
2676
  this._id = nextLayoutId$1.next();
2676
2677
  this._groups = new Map();
@@ -2684,10 +2685,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2684
2685
  this.onDidLayoutChange = this._bufferOnDidLayoutChange.onEvent;
2685
2686
  this._onDidViewVisibilityChangeMicroTaskQueue = new AsapEvent();
2686
2687
  this.onDidViewVisibilityChangeMicroTaskQueue = this._onDidViewVisibilityChangeMicroTaskQueue.onEvent;
2688
+ this.classNames = [];
2687
2689
  this.element.style.height = '100%';
2688
2690
  this.element.style.width = '100%';
2689
- if (typeof options.className === 'string') {
2690
- this.element.classList.add(options.className);
2691
+ this.classNames = (_b = (_a = options.className) === null || _a === void 0 ? void 0 : _a.split(' ')) !== null && _b !== void 0 ? _b : [];
2692
+ for (const className of this.classNames) {
2693
+ toggleClass(this.element, className, true);
2691
2694
  }
2692
2695
  options.parentElement.appendChild(this.element);
2693
2696
  this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation, options.locked, options.margin);
@@ -2712,6 +2715,18 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2712
2715
  isVisible(panel) {
2713
2716
  return this.gridview.isViewVisible(getGridLocation(panel.element));
2714
2717
  }
2718
+ updateOptions(options) {
2719
+ var _a, _b;
2720
+ if ('className' in options) {
2721
+ for (const className of this.classNames) {
2722
+ toggleClass(this.element, className, false);
2723
+ }
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);
2727
+ }
2728
+ }
2729
+ }
2715
2730
  maximizeGroup(panel) {
2716
2731
  this.gridview.maximizeView(panel);
2717
2732
  this.doSetGroupActive(panel);
@@ -7777,6 +7792,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
7777
7792
  }
7778
7793
  updateOptions(options) {
7779
7794
  var _a, _b;
7795
+ super.updateOptions(options);
7780
7796
  const changed_floatingGroupBounds = 'floatingGroupBounds' in options &&
7781
7797
  options.floatingGroupBounds !== this.options.floatingGroupBounds;
7782
7798
  const changed_rootOverlayOptions = 'rootOverlayModel' in options &&
@@ -8721,6 +8737,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
8721
8737
  }
8722
8738
  }
8723
8739
  updateOptions(options) {
8740
+ super.updateOptions(options);
8724
8741
  const hasOrientationChanged = typeof options.orientation === 'string' &&
8725
8742
  this.gridview.orientation !== options.orientation;
8726
8743
  this._options = Object.assign(Object.assign({}, this.options), options);
@@ -8988,6 +9005,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
8988
9005
  : this.splitview.orthogonalSize;
8989
9006
  }
8990
9007
  constructor(parentElement, options) {
9008
+ var _a, _b;
8991
9009
  super(parentElement, options.disableAutoResizing);
8992
9010
  this._splitviewChangeDisposable = new MutableDisposable();
8993
9011
  this._panels = new Map();
@@ -8999,8 +9017,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
8999
9017
  this.onDidRemoveView = this._onDidRemoveView.event;
9000
9018
  this._onDidLayoutChange = new Emitter();
9001
9019
  this.onDidLayoutChange = this._onDidLayoutChange.event;
9002
- if (typeof options.className === 'string') {
9003
- this.element.classList.add(options.className);
9020
+ this.classNames = [];
9021
+ this.classNames = (_b = (_a = options.className) === null || _a === void 0 ? void 0 : _a.split(' ')) !== null && _b !== void 0 ? _b : [];
9022
+ for (const className of this.classNames) {
9023
+ toggleClass(this.element, className, true);
9004
9024
  }
9005
9025
  this._options = options;
9006
9026
  if (!options.components) {
@@ -9013,6 +9033,16 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9013
9033
  this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
9014
9034
  }
9015
9035
  updateOptions(options) {
9036
+ var _a, _b;
9037
+ if ('className' in options) {
9038
+ for (const className of this.classNames) {
9039
+ toggleClass(this.element, className, false);
9040
+ }
9041
+ this.classNames = (_b = (_a = options.className) === null || _a === void 0 ? void 0 : _a.split(' ')) !== null && _b !== void 0 ? _b : [];
9042
+ for (const className of this.classNames) {
9043
+ toggleClass(this.element, className, true);
9044
+ }
9045
+ }
9016
9046
  const hasOrientationChanged = typeof options.orientation === 'string' &&
9017
9047
  this.options.orientation !== options.orientation;
9018
9048
  this._options = Object.assign(Object.assign({}, this.options), options);
@@ -9315,6 +9345,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9315
9345
  return this._options;
9316
9346
  }
9317
9347
  constructor(parentElement, options) {
9348
+ var _a, _b;
9318
9349
  super(parentElement, options.disableAutoResizing);
9319
9350
  this._id = nextLayoutId.next();
9320
9351
  this._disposable = new MutableDisposable();
@@ -9329,10 +9360,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9329
9360
  this.onDidAddView = this._onDidAddView.event;
9330
9361
  this._onDidRemoveView = new Emitter();
9331
9362
  this.onDidRemoveView = this._onDidRemoveView.event;
9332
- if (typeof options.className === 'string') {
9333
- this.element.classList.add(options.className);
9334
- }
9363
+ this.classNames = [];
9335
9364
  this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView);
9365
+ this.classNames = (_b = (_a = options.className) === null || _a === void 0 ? void 0 : _a.split(' ')) !== null && _b !== void 0 ? _b : [];
9366
+ for (const className of this.classNames) {
9367
+ toggleClass(this.element, className, true);
9368
+ }
9336
9369
  this._options = options;
9337
9370
  if (!options.components) {
9338
9371
  options.components = {};
@@ -9354,6 +9387,16 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9354
9387
  //noop
9355
9388
  }
9356
9389
  updateOptions(options) {
9390
+ var _a, _b;
9391
+ if ('className' in options) {
9392
+ for (const className of this.classNames) {
9393
+ toggleClass(this.element, className, false);
9394
+ }
9395
+ this.classNames = (_b = (_a = options.className) === null || _a === void 0 ? void 0 : _a.split(' ')) !== null && _b !== void 0 ? _b : [];
9396
+ for (const className of this.classNames) {
9397
+ toggleClass(this.element, className, true);
9398
+ }
9399
+ }
9357
9400
  this._options = Object.assign(Object.assign({}, this.options), options);
9358
9401
  }
9359
9402
  addPanel(options) {