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
  */
@@ -2796,7 +2796,7 @@ class BaseGrid extends Resizable {
2796
2796
  this.doSetGroupActive(next);
2797
2797
  }
2798
2798
  layout(width, height, forceResize) {
2799
- const different = forceResize !== null && forceResize !== void 0 ? forceResize : (width !== this.width || height !== this.height);
2799
+ const different = forceResize || width !== this.width || height !== this.height;
2800
2800
  if (!different) {
2801
2801
  return;
2802
2802
  }
@@ -3269,6 +3269,9 @@ class DockviewApi {
3269
3269
  get totalPanels() {
3270
3270
  return this.component.totalPanels;
3271
3271
  }
3272
+ get gap() {
3273
+ return this.component.gap;
3274
+ }
3272
3275
  /**
3273
3276
  * Invoked when the active group changes. May be undefined if no group is active.
3274
3277
  */
@@ -7221,6 +7224,9 @@ class DockviewComponent extends BaseGrid {
7221
7224
  get api() {
7222
7225
  return this._api;
7223
7226
  }
7227
+ get gap() {
7228
+ return this.gridview.margin;
7229
+ }
7224
7230
  constructor(options) {
7225
7231
  var _a;
7226
7232
  super({
@@ -7390,7 +7396,7 @@ class DockviewComponent extends BaseGrid {
7390
7396
  var _a, _b, _c;
7391
7397
  if (itemToPopout instanceof DockviewPanel &&
7392
7398
  itemToPopout.group.size === 1) {
7393
- return this.addPopoutGroup(itemToPopout.group);
7399
+ return this.addPopoutGroup(itemToPopout.group, options);
7394
7400
  }
7395
7401
  const theme = getDockviewTheme(this.gridview.element);
7396
7402
  const element = this.element;
@@ -7608,14 +7614,14 @@ class DockviewComponent extends BaseGrid {
7608
7614
  else {
7609
7615
  result.top = DEFAULT_FLOATING_GROUP_POSITION.top;
7610
7616
  }
7611
- if ('width' in options.position) {
7612
- result.width = Math.max(options.position.width, 0);
7617
+ if (typeof options.width === 'number') {
7618
+ result.width = Math.max(options.width, 0);
7613
7619
  }
7614
7620
  else {
7615
7621
  result.width = DEFAULT_FLOATING_GROUP_POSITION.width;
7616
7622
  }
7617
- if ('height' in options.position) {
7618
- result.height = Math.max(options.position.height, 0);
7623
+ if (typeof options.height === 'number') {
7624
+ result.height = Math.max(options.height, 0);
7619
7625
  }
7620
7626
  else {
7621
7627
  result.height = DEFAULT_FLOATING_GROUP_POSITION.height;
@@ -7746,7 +7752,10 @@ class DockviewComponent extends BaseGrid {
7746
7752
  if (changed_rootOverlayOptions) {
7747
7753
  this._rootDropTarget.setOverlayModel(options.rootOverlayModel);
7748
7754
  }
7749
- if (this.gridview.margin !== 0 && options.gap === undefined) {
7755
+ if (
7756
+ // if explicitly set as `undefined`
7757
+ 'gap' in options &&
7758
+ options.gap === undefined) {
7750
7759
  this.gridview.margin = 0;
7751
7760
  }
7752
7761
  if (typeof options.gap === 'number') {
@@ -8047,11 +8056,11 @@ class DockviewComponent extends BaseGrid {
8047
8056
  if (options.floating) {
8048
8057
  const group = this.createGroup();
8049
8058
  this._onDidAddGroup.fire(group);
8050
- const o = typeof options.floating === 'object' &&
8059
+ const floatingGroupOptions = typeof options.floating === 'object' &&
8051
8060
  options.floating !== null
8052
8061
  ? options.floating
8053
8062
  : {};
8054
- this.addFloatingGroup(group, Object.assign(Object.assign({}, o), { inDragMode: false, skipRemoveGroup: true, skipActiveGroup: true }));
8063
+ this.addFloatingGroup(group, Object.assign(Object.assign({}, floatingGroupOptions), { inDragMode: false, skipRemoveGroup: true, skipActiveGroup: true }));
8055
8064
  panel = this.createPanel(options, group);
8056
8065
  group.model.openPanel(panel, {
8057
8066
  skipSetActive: options.inactive,