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