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
  */
@@ -2675,6 +2675,7 @@
2675
2675
  this.gridview.locked = value;
2676
2676
  }
2677
2677
  constructor(options) {
2678
+ var _a, _b;
2678
2679
  super(document.createElement('div'), options.disableAutoResizing);
2679
2680
  this._id = nextLayoutId$1.next();
2680
2681
  this._groups = new Map();
@@ -2688,10 +2689,12 @@
2688
2689
  this.onDidLayoutChange = this._bufferOnDidLayoutChange.onEvent;
2689
2690
  this._onDidViewVisibilityChangeMicroTaskQueue = new AsapEvent();
2690
2691
  this.onDidViewVisibilityChangeMicroTaskQueue = this._onDidViewVisibilityChangeMicroTaskQueue.onEvent;
2692
+ this.classNames = [];
2691
2693
  this.element.style.height = '100%';
2692
2694
  this.element.style.width = '100%';
2693
- if (typeof options.className === 'string') {
2694
- this.element.classList.add(options.className);
2695
+ this.classNames = (_b = (_a = options.className) === null || _a === void 0 ? void 0 : _a.split(' ')) !== null && _b !== void 0 ? _b : [];
2696
+ for (const className of this.classNames) {
2697
+ toggleClass(this.element, className, true);
2695
2698
  }
2696
2699
  options.parentElement.appendChild(this.element);
2697
2700
  this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation, options.locked, options.margin);
@@ -2716,6 +2719,18 @@
2716
2719
  isVisible(panel) {
2717
2720
  return this.gridview.isViewVisible(getGridLocation(panel.element));
2718
2721
  }
2722
+ updateOptions(options) {
2723
+ var _a, _b;
2724
+ if ('className' in options) {
2725
+ for (const className of this.classNames) {
2726
+ toggleClass(this.element, className, false);
2727
+ }
2728
+ this.classNames = (_b = (_a = options.className) === null || _a === void 0 ? void 0 : _a.split(' ')) !== null && _b !== void 0 ? _b : [];
2729
+ for (const className of this.classNames) {
2730
+ toggleClass(this.element, className, true);
2731
+ }
2732
+ }
2733
+ }
2719
2734
  maximizeGroup(panel) {
2720
2735
  this.gridview.maximizeView(panel);
2721
2736
  this.doSetGroupActive(panel);
@@ -7781,6 +7796,7 @@
7781
7796
  }
7782
7797
  updateOptions(options) {
7783
7798
  var _a, _b;
7799
+ super.updateOptions(options);
7784
7800
  const changed_floatingGroupBounds = 'floatingGroupBounds' in options &&
7785
7801
  options.floatingGroupBounds !== this.options.floatingGroupBounds;
7786
7802
  const changed_rootOverlayOptions = 'rootOverlayModel' in options &&
@@ -8725,6 +8741,7 @@
8725
8741
  }
8726
8742
  }
8727
8743
  updateOptions(options) {
8744
+ super.updateOptions(options);
8728
8745
  const hasOrientationChanged = typeof options.orientation === 'string' &&
8729
8746
  this.gridview.orientation !== options.orientation;
8730
8747
  this._options = Object.assign(Object.assign({}, this.options), options);
@@ -8992,6 +9009,7 @@
8992
9009
  : this.splitview.orthogonalSize;
8993
9010
  }
8994
9011
  constructor(parentElement, options) {
9012
+ var _a, _b;
8995
9013
  super(parentElement, options.disableAutoResizing);
8996
9014
  this._splitviewChangeDisposable = new MutableDisposable();
8997
9015
  this._panels = new Map();
@@ -9003,8 +9021,10 @@
9003
9021
  this.onDidRemoveView = this._onDidRemoveView.event;
9004
9022
  this._onDidLayoutChange = new Emitter();
9005
9023
  this.onDidLayoutChange = this._onDidLayoutChange.event;
9006
- if (typeof options.className === 'string') {
9007
- this.element.classList.add(options.className);
9024
+ this.classNames = [];
9025
+ this.classNames = (_b = (_a = options.className) === null || _a === void 0 ? void 0 : _a.split(' ')) !== null && _b !== void 0 ? _b : [];
9026
+ for (const className of this.classNames) {
9027
+ toggleClass(this.element, className, true);
9008
9028
  }
9009
9029
  this._options = options;
9010
9030
  if (!options.components) {
@@ -9017,6 +9037,16 @@
9017
9037
  this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
9018
9038
  }
9019
9039
  updateOptions(options) {
9040
+ var _a, _b;
9041
+ if ('className' in options) {
9042
+ for (const className of this.classNames) {
9043
+ toggleClass(this.element, className, false);
9044
+ }
9045
+ this.classNames = (_b = (_a = options.className) === null || _a === void 0 ? void 0 : _a.split(' ')) !== null && _b !== void 0 ? _b : [];
9046
+ for (const className of this.classNames) {
9047
+ toggleClass(this.element, className, true);
9048
+ }
9049
+ }
9020
9050
  const hasOrientationChanged = typeof options.orientation === 'string' &&
9021
9051
  this.options.orientation !== options.orientation;
9022
9052
  this._options = Object.assign(Object.assign({}, this.options), options);
@@ -9319,6 +9349,7 @@
9319
9349
  return this._options;
9320
9350
  }
9321
9351
  constructor(parentElement, options) {
9352
+ var _a, _b;
9322
9353
  super(parentElement, options.disableAutoResizing);
9323
9354
  this._id = nextLayoutId.next();
9324
9355
  this._disposable = new MutableDisposable();
@@ -9333,10 +9364,12 @@
9333
9364
  this.onDidAddView = this._onDidAddView.event;
9334
9365
  this._onDidRemoveView = new Emitter();
9335
9366
  this.onDidRemoveView = this._onDidRemoveView.event;
9336
- if (typeof options.className === 'string') {
9337
- this.element.classList.add(options.className);
9338
- }
9367
+ this.classNames = [];
9339
9368
  this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView);
9369
+ this.classNames = (_b = (_a = options.className) === null || _a === void 0 ? void 0 : _a.split(' ')) !== null && _b !== void 0 ? _b : [];
9370
+ for (const className of this.classNames) {
9371
+ toggleClass(this.element, className, true);
9372
+ }
9340
9373
  this._options = options;
9341
9374
  if (!options.components) {
9342
9375
  options.components = {};
@@ -9358,6 +9391,16 @@
9358
9391
  //noop
9359
9392
  }
9360
9393
  updateOptions(options) {
9394
+ var _a, _b;
9395
+ if ('className' in options) {
9396
+ for (const className of this.classNames) {
9397
+ toggleClass(this.element, className, false);
9398
+ }
9399
+ this.classNames = (_b = (_a = options.className) === null || _a === void 0 ? void 0 : _a.split(' ')) !== null && _b !== void 0 ? _b : [];
9400
+ for (const className of this.classNames) {
9401
+ toggleClass(this.element, className, true);
9402
+ }
9403
+ }
9361
9404
  this._options = Object.assign(Object.assign({}, this.options), options);
9362
9405
  }
9363
9406
  addPanel(options) {