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