dockview-core 1.15.0 → 1.15.2

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.
Files changed (37) hide show
  1. package/dist/cjs/api/component.api.d.ts +1 -0
  2. package/dist/cjs/api/component.api.js +7 -0
  3. package/dist/cjs/dockview/dockviewComponent.d.ts +7 -3
  4. package/dist/cjs/dockview/dockviewComponent.js +18 -8
  5. package/dist/cjs/dockview/options.d.ts +2 -2
  6. package/dist/cjs/gridview/baseComponentGridview.js +1 -1
  7. package/dist/cjs/types.d.ts +1 -1
  8. package/dist/dockview-core.amd.js +19 -10
  9. package/dist/dockview-core.amd.js.map +1 -1
  10. package/dist/dockview-core.amd.min.js +2 -2
  11. package/dist/dockview-core.amd.min.js.map +1 -1
  12. package/dist/dockview-core.amd.min.noStyle.js +2 -2
  13. package/dist/dockview-core.amd.min.noStyle.js.map +1 -1
  14. package/dist/dockview-core.amd.noStyle.js +19 -10
  15. package/dist/dockview-core.amd.noStyle.js.map +1 -1
  16. package/dist/dockview-core.cjs.js +19 -10
  17. package/dist/dockview-core.cjs.js.map +1 -1
  18. package/dist/dockview-core.esm.js +19 -10
  19. package/dist/dockview-core.esm.js.map +1 -1
  20. package/dist/dockview-core.esm.min.js +2 -2
  21. package/dist/dockview-core.esm.min.js.map +1 -1
  22. package/dist/dockview-core.js +19 -10
  23. package/dist/dockview-core.js.map +1 -1
  24. package/dist/dockview-core.min.js +2 -2
  25. package/dist/dockview-core.min.js.map +1 -1
  26. package/dist/dockview-core.min.noStyle.js +2 -2
  27. package/dist/dockview-core.min.noStyle.js.map +1 -1
  28. package/dist/dockview-core.noStyle.js +19 -10
  29. package/dist/dockview-core.noStyle.js.map +1 -1
  30. package/dist/esm/api/component.api.d.ts +1 -0
  31. package/dist/esm/api/component.api.js +3 -0
  32. package/dist/esm/dockview/dockviewComponent.d.ts +7 -3
  33. package/dist/esm/dockview/dockviewComponent.js +14 -8
  34. package/dist/esm/dockview/options.d.ts +2 -2
  35. package/dist/esm/gridview/baseComponentGridview.js +1 -1
  36. package/dist/esm/types.d.ts +1 -1
  37. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview-core
3
- * @version 1.15.0
3
+ * @version 1.15.2
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -2798,7 +2798,7 @@ class BaseGrid extends Resizable {
2798
2798
  this.doSetGroupActive(next);
2799
2799
  }
2800
2800
  layout(width, height, forceResize) {
2801
- const different = forceResize !== null && forceResize !== void 0 ? forceResize : (width !== this.width || height !== this.height);
2801
+ const different = forceResize || width !== this.width || height !== this.height;
2802
2802
  if (!different) {
2803
2803
  return;
2804
2804
  }
@@ -3271,6 +3271,9 @@ class DockviewApi {
3271
3271
  get totalPanels() {
3272
3272
  return this.component.totalPanels;
3273
3273
  }
3274
+ get gap() {
3275
+ return this.component.gap;
3276
+ }
3274
3277
  /**
3275
3278
  * Invoked when the active group changes. May be undefined if no group is active.
3276
3279
  */
@@ -7223,6 +7226,9 @@ class DockviewComponent extends BaseGrid {
7223
7226
  get api() {
7224
7227
  return this._api;
7225
7228
  }
7229
+ get gap() {
7230
+ return this.gridview.margin;
7231
+ }
7226
7232
  constructor(options) {
7227
7233
  var _a;
7228
7234
  super({
@@ -7392,7 +7398,7 @@ class DockviewComponent extends BaseGrid {
7392
7398
  var _a, _b, _c;
7393
7399
  if (itemToPopout instanceof DockviewPanel &&
7394
7400
  itemToPopout.group.size === 1) {
7395
- return this.addPopoutGroup(itemToPopout.group);
7401
+ return this.addPopoutGroup(itemToPopout.group, options);
7396
7402
  }
7397
7403
  const theme = getDockviewTheme(this.gridview.element);
7398
7404
  const element = this.element;
@@ -7610,14 +7616,14 @@ class DockviewComponent extends BaseGrid {
7610
7616
  else {
7611
7617
  result.top = DEFAULT_FLOATING_GROUP_POSITION.top;
7612
7618
  }
7613
- if ('width' in options.position) {
7614
- result.width = Math.max(options.position.width, 0);
7619
+ if (typeof options.width === 'number') {
7620
+ result.width = Math.max(options.width, 0);
7615
7621
  }
7616
7622
  else {
7617
7623
  result.width = DEFAULT_FLOATING_GROUP_POSITION.width;
7618
7624
  }
7619
- if ('height' in options.position) {
7620
- result.height = Math.max(options.position.height, 0);
7625
+ if (typeof options.height === 'number') {
7626
+ result.height = Math.max(options.height, 0);
7621
7627
  }
7622
7628
  else {
7623
7629
  result.height = DEFAULT_FLOATING_GROUP_POSITION.height;
@@ -7748,7 +7754,10 @@ class DockviewComponent extends BaseGrid {
7748
7754
  if (changed_rootOverlayOptions) {
7749
7755
  this._rootDropTarget.setOverlayModel(options.rootOverlayModel);
7750
7756
  }
7751
- if (this.gridview.margin !== 0 && options.gap === undefined) {
7757
+ if (
7758
+ // if explicitly set as `undefined`
7759
+ 'gap' in options &&
7760
+ options.gap === undefined) {
7752
7761
  this.gridview.margin = 0;
7753
7762
  }
7754
7763
  if (typeof options.gap === 'number') {
@@ -8049,11 +8058,11 @@ class DockviewComponent extends BaseGrid {
8049
8058
  if (options.floating) {
8050
8059
  const group = this.createGroup();
8051
8060
  this._onDidAddGroup.fire(group);
8052
- const o = typeof options.floating === 'object' &&
8061
+ const floatingGroupOptions = typeof options.floating === 'object' &&
8053
8062
  options.floating !== null
8054
8063
  ? options.floating
8055
8064
  : {};
8056
- this.addFloatingGroup(group, Object.assign(Object.assign({}, o), { inDragMode: false, skipRemoveGroup: true, skipActiveGroup: true }));
8065
+ this.addFloatingGroup(group, Object.assign(Object.assign({}, floatingGroupOptions), { inDragMode: false, skipRemoveGroup: true, skipActiveGroup: true }));
8057
8066
  panel = this.createPanel(options, group);
8058
8067
  group.model.openPanel(panel, {
8059
8068
  skipSetActive: options.inactive,