igniteui-dockmanager 1.16.2-beta.2 → 1.17.0-beta.0

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 (28) hide show
  1. package/custom-elements.json +56 -0
  2. package/dist/cjs/igc-button-component_21.cjs.entry.js +73 -8
  3. package/dist/cjs/igc-button-component_21.cjs.entry.js.map +1 -1
  4. package/dist/cjs/igniteui-dockmanager.cjs.js +1 -1
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/collection/components/dockmanager/dockmanager-component.js +77 -7
  7. package/dist/collection/components/dockmanager/dockmanager-component.js.map +1 -1
  8. package/dist/collection/components/dockmanager/dockmanager.interfaces.js.map +1 -1
  9. package/dist/collection/components/dockmanager/dockmanager.service.js +15 -2
  10. package/dist/collection/components/dockmanager/dockmanager.service.js.map +1 -1
  11. package/dist/collection/utils/test-utils.js.map +1 -1
  12. package/dist/esm/igc-button-component_21.entry.js +73 -8
  13. package/dist/esm/igc-button-component_21.entry.js.map +1 -1
  14. package/dist/esm/igniteui-dockmanager.js +1 -1
  15. package/dist/esm/loader.js +1 -1
  16. package/dist/igniteui-dockmanager/igniteui-dockmanager.esm.js +1 -1
  17. package/dist/igniteui-dockmanager/igniteui-dockmanager.esm.js.map +1 -1
  18. package/dist/igniteui-dockmanager/p-a30930a4.entry.js +2 -0
  19. package/dist/igniteui-dockmanager/p-a30930a4.entry.js.map +1 -0
  20. package/dist/types/components/dockmanager/dockmanager-component.d.ts +4 -0
  21. package/dist/types/components/dockmanager/dockmanager.interfaces.d.ts +1 -0
  22. package/dist/types/components.d.ts +2 -0
  23. package/dist/types/utils/test-utils.d.ts +1 -0
  24. package/loader/cdn.js +2 -2
  25. package/loader/index.cjs.js +2 -2
  26. package/package.json +1 -1
  27. package/dist/igniteui-dockmanager/p-cf024b92.entry.js +0 -2
  28. package/dist/igniteui-dockmanager/p-cf024b92.entry.js.map +0 -1
@@ -511,6 +511,13 @@
511
511
  "text": "boolean"
512
512
  }
513
513
  },
514
+ {
515
+ "kind": "field",
516
+ "name": "allowRootDock",
517
+ "type": {
518
+ "text": "boolean"
519
+ }
520
+ },
514
521
  {
515
522
  "kind": "field",
516
523
  "name": "useFixedSizeOnDock",
@@ -1453,6 +1460,24 @@
1453
1460
  },
1454
1461
  "privacy": "private"
1455
1462
  },
1463
+ {
1464
+ "kind": "field",
1465
+ "name": "autoScrollInterval",
1466
+ "type": {
1467
+ "text": "number"
1468
+ },
1469
+ "privacy": "private",
1470
+ "default": "null"
1471
+ },
1472
+ {
1473
+ "kind": "field",
1474
+ "name": "autoScrollDirection",
1475
+ "type": {
1476
+ "text": "{ x: number, y: number }"
1477
+ },
1478
+ "privacy": "private",
1479
+ "default": "{ x: 0, y: 0 }"
1480
+ },
1456
1481
  {
1457
1482
  "kind": "field",
1458
1483
  "name": "templatableComponents",
@@ -1664,6 +1689,14 @@
1664
1689
  },
1665
1690
  "default": "false"
1666
1691
  },
1692
+ {
1693
+ "kind": "field",
1694
+ "name": "allowRootDock",
1695
+ "type": {
1696
+ "text": "boolean"
1697
+ },
1698
+ "default": "true"
1699
+ },
1667
1700
  {
1668
1701
  "kind": "field",
1669
1702
  "name": "useFixedSizeOnDock",
@@ -2304,6 +2337,25 @@
2304
2337
  }
2305
2338
  ]
2306
2339
  },
2340
+ {
2341
+ "kind": "method",
2342
+ "name": "handleAutoScroll",
2343
+ "privacy": "private",
2344
+ "parameters": [
2345
+ {
2346
+ "name": "clientX",
2347
+ "type": {
2348
+ "text": "number"
2349
+ }
2350
+ },
2351
+ {
2352
+ "name": "clientY",
2353
+ "type": {
2354
+ "text": "number"
2355
+ }
2356
+ }
2357
+ ]
2358
+ },
2307
2359
  {
2308
2360
  "kind": "method",
2309
2361
  "name": "getInnerDropTargetParentRect",
@@ -3219,6 +3271,10 @@
3219
3271
  "name": "allow-splitter-dock",
3220
3272
  "fieldName": "allowSplitterDock"
3221
3273
  },
3274
+ {
3275
+ "name": "allow-root-dock",
3276
+ "fieldName": "allowRootDock"
3277
+ },
3222
3278
  {
3223
3279
  "name": "use-fixed-size-on-dock",
3224
3280
  "fieldName": "useFixedSizeOnDock",
@@ -705,7 +705,9 @@ class IgcDockManagerService {
705
705
  else if (useFixedSize === true && (((_b = this.draggedPaneParent) === null || _b === void 0 ? void 0 : _b.useFixedSize) !== true || ((_c = this.draggedPaneParent) === null || _c === void 0 ? void 0 : _c.orientation) !== orientation)) {
706
706
  const floatingPane = draggedPane;
707
707
  const floatingPaneSizeInPixels = isIndicatorVertical ? floatingPane === null || floatingPane === void 0 ? void 0 : floatingPane.floatingHeight : floatingPane === null || floatingPane === void 0 ? void 0 : floatingPane.floatingWidth;
708
- paneToDock.size = floatingPaneSizeInPixels;
708
+ if (floatingPaneSizeInPixels) {
709
+ paneToDock.size = floatingPaneSizeInPixels;
710
+ }
709
711
  }
710
712
  let newSplitPane;
711
713
  var isDockingBefore = Utils.isDockingIndicatorBefore(position) && !isRTL || Utils.isDockingIndicatorBeforeRTL(position) && isRTL;
@@ -753,8 +755,17 @@ class IgcDockManagerService {
753
755
  }
754
756
  }
755
757
  dockToSplitter() {
758
+ var _a, _b, _c;
756
759
  const parent = this.getParent(this.splitterDockPane);
757
760
  const index = parent.panes.indexOf(this.splitterDockPane);
761
+ if (((_a = this.draggedPaneParent) === null || _a === void 0 ? void 0 : _a.useFixedSize) === true && parent.useFixedSize !== true) {
762
+ this.dockManager.draggedPane.size = IGC_DEFAULT_PANE_SIZE_IN_PIXELS;
763
+ }
764
+ else if (parent.useFixedSize === true && (((_b = this.draggedPaneParent) === null || _b === void 0 ? void 0 : _b.useFixedSize) !== true || ((_c = this.draggedPaneParent) === null || _c === void 0 ? void 0 : _c.orientation) !== parent.orientation)) {
765
+ const floatingPane = this.dockManager.draggedPane;
766
+ const floatingPaneSizeInPixels = parent.orientation === locale.IgcSplitPaneOrientation.vertical ? floatingPane === null || floatingPane === void 0 ? void 0 : floatingPane.floatingHeight : floatingPane === null || floatingPane === void 0 ? void 0 : floatingPane.floatingWidth;
767
+ this.dockManager.draggedPane.size = floatingPaneSizeInPixels;
768
+ }
758
769
  parent.panes.splice(index + 1, 0, this.dockManager.draggedPane);
759
770
  }
760
771
  shouldUseFixedSize(pane) {
@@ -1767,7 +1778,9 @@ class IgcDockManagerService {
1767
1778
  if (targetParent.useFixedSize === true && ((_b = this.draggedPaneParent) === null || _b === void 0 ? void 0 : _b.orientation) !== targetParent.orientation) {
1768
1779
  const floatingPane = this.dockManager.draggedPane;
1769
1780
  const floatingPaneSizeInPixels = targetParent.orientation === locale.IgcSplitPaneOrientation.horizontal ? floatingPane === null || floatingPane === void 0 ? void 0 : floatingPane.floatingWidth : floatingPane === null || floatingPane === void 0 ? void 0 : floatingPane.floatingHeight;
1770
- draggedPaneSize = floatingPaneSizeInPixels;
1781
+ if (floatingPaneSizeInPixels) {
1782
+ draggedPaneSize = floatingPaneSizeInPixels;
1783
+ }
1771
1784
  }
1772
1785
  draggedPaneSize = draggedPaneSize >= 0 ? draggedPaneSize : IGC_DEFAULT_PANE_SIZE;
1773
1786
  if (draggedPaneIndex > -1) {
@@ -2198,6 +2211,8 @@ const IgcDockManager = class {
2198
2211
  this.proximityDockThreshold = 50;
2199
2212
  this.proximityOuterDockThreshold = 25;
2200
2213
  this.anyPaneIgnoringResizeConstraints = false;
2214
+ this.autoScrollInterval = null;
2215
+ this.autoScrollDirection = { x: 0, y: 0 };
2201
2216
  this.templatableComponents = [
2202
2217
  {
2203
2218
  slot: 'paneHeaderCloseButton',
@@ -2358,6 +2373,7 @@ const IgcDockManager = class {
2358
2373
  this.closeBehavior = locale.IgcPaneActionBehavior.allPanes;
2359
2374
  this.unpinBehavior = locale.IgcPaneActionBehavior.allPanes;
2360
2375
  this.allowSplitterDock = false;
2376
+ this.allowRootDock = true;
2361
2377
  this.useFixedSizeOnDock = 'none';
2362
2378
  this.layout = undefined;
2363
2379
  this.draggedPane = undefined;
@@ -2947,6 +2963,7 @@ const IgcDockManager = class {
2947
2963
  this.paneDragMoved(event.detail.clientX, event.detail.clientY, event);
2948
2964
  }
2949
2965
  paneDragMoved(clientX, clientY, event) {
2966
+ this.handleAutoScroll(clientX, clientY);
2950
2967
  this.handleDropPositionChange(clientX, clientY, event === null || event === void 0 ? void 0 : event.target);
2951
2968
  const x = event === null || event === void 0 ? void 0 : event.detail.clientX;
2952
2969
  const y = event === null || event === void 0 ? void 0 : event.detail.clientY;
@@ -2976,6 +2993,48 @@ const IgcDockManager = class {
2976
2993
  }
2977
2994
  }
2978
2995
  }
2996
+ handleAutoScroll(clientX, clientY) {
2997
+ const SCROLL_ZONE = 50; // px from edge to start scrolling
2998
+ const SCROLL_SPEED = 30; // px per interval
2999
+ const rootSplitPane = this.dockedPanesContainer.children[0];
3000
+ if (!rootSplitPane)
3001
+ return;
3002
+ const rect = rootSplitPane.getBoundingClientRect();
3003
+ let x = 0, y = 0;
3004
+ if (clientX - rect.left < SCROLL_ZONE) {
3005
+ x = -SCROLL_SPEED;
3006
+ }
3007
+ else if (rect.right - clientX < SCROLL_ZONE) {
3008
+ x = SCROLL_SPEED;
3009
+ }
3010
+ if (clientY - rect.top < SCROLL_ZONE) {
3011
+ y = -SCROLL_SPEED;
3012
+ }
3013
+ else if (rect.bottom - clientY < SCROLL_ZONE) {
3014
+ y = SCROLL_SPEED;
3015
+ }
3016
+ // If direction changed or started, set interval
3017
+ if ((x !== this.autoScrollDirection.x || y !== this.autoScrollDirection.y) || (x !== 0 || y !== 0 && !this.autoScrollInterval)) {
3018
+ this.autoScrollDirection = { x, y };
3019
+ if (this.autoScrollInterval) {
3020
+ clearInterval(this.autoScrollInterval);
3021
+ this.autoScrollInterval = null;
3022
+ }
3023
+ if (x !== 0 || y !== 0) {
3024
+ this.autoScrollInterval = window.setInterval(() => {
3025
+ if (x !== 0)
3026
+ rootSplitPane.scrollLeft += x;
3027
+ if (y !== 0)
3028
+ rootSplitPane.scrollTop += y;
3029
+ }, 30);
3030
+ }
3031
+ }
3032
+ // Stop scrolling if not near any edge
3033
+ if (x === 0 && y === 0 && this.autoScrollInterval) {
3034
+ clearInterval(this.autoScrollInterval);
3035
+ this.autoScrollInterval = null;
3036
+ }
3037
+ }
2979
3038
  getInnerDropTargetParentRect() {
2980
3039
  if (this.dropTargetPaneInfo && this.service.proximityDockPosition) {
2981
3040
  const targetDocHostParent = this.service.getParent(this.dropTargetPaneInfo.docHost);
@@ -3076,6 +3135,11 @@ const IgcDockManager = class {
3076
3135
  return null;
3077
3136
  }
3078
3137
  handlePaneDragEnd() {
3138
+ if (this.autoScrollInterval) {
3139
+ clearInterval(this.autoScrollInterval);
3140
+ this.autoScrollInterval = null;
3141
+ this.autoScrollDirection = { x: 0, y: 0 };
3142
+ }
3079
3143
  this.setSplitterDockingIndicatorVisibility('hidden');
3080
3144
  const docked = this.service.dragPaneEnd();
3081
3145
  this.isDragging = false;
@@ -3839,12 +3903,13 @@ const IgcDockManager = class {
3839
3903
  (((_b = this.dropTargetPaneInfo.pane) === null || _b === void 0 ? void 0 : _b.type) == "splitPane" && this.service.getSplitPaneVisibleChildren(this.dropTargetPaneInfo.pane).length));
3840
3904
  return (index.h("div", { class: "docking-indicators-container", style: {
3841
3905
  display: this.showDockingIndicators ? 'flex' : 'none'
3842
- } }, !this.documentOnlyDrag && !this.proximityDock && this.renderRootDockingIndicator(locale.IgcDockingIndicatorPosition.top), index.h("div", { style: {
3843
- flexGrow: '1',
3844
- display: 'flex',
3845
- flexDirection: 'row',
3846
- justifyContent: 'space-between'
3847
- } }, !this.documentOnlyDrag && !this.proximityDock && this.renderRootDockingIndicator(startPosition), !this.documentOnlyDrag && !this.proximityDock && this.renderRootDockingIndicator(endPosition)), !this.documentOnlyDrag && !this.proximityDock && this.renderRootDockingIndicator(locale.IgcDockingIndicatorPosition.bottom), this.dropTargetPaneInfo && !this.proximityDock && !hideJoystickIndicator && ((_c = this.splitterDockingIndicator) === null || _c === void 0 ? void 0 : _c.style.visibility) !== 'visible' &&
3906
+ } }, this.allowRootDock && !this.documentOnlyDrag && !this.proximityDock &&
3907
+ index.h(index.Fragment, null, this.renderRootDockingIndicator(locale.IgcDockingIndicatorPosition.top), index.h("div", { style: {
3908
+ flexGrow: '1',
3909
+ display: 'flex',
3910
+ flexDirection: 'row',
3911
+ justifyContent: 'space-between'
3912
+ } }, this.renderRootDockingIndicator(startPosition), this.renderRootDockingIndicator(endPosition)), this.renderRootDockingIndicator(locale.IgcDockingIndicatorPosition.bottom)), this.dropTargetPaneInfo && !this.proximityDock && !hideJoystickIndicator && ((_c = this.splitterDockingIndicator) === null || _c === void 0 ? void 0 : _c.style.visibility) !== 'visible' && !this.autoScrollInterval &&
3848
3913
  index.h("igc-joystick-indicator-component", { dropTargetPaneInfo: this.dropTargetPaneInfo, documentOnlyDrag: this.documentOnlyDrag, allowCenterDock: this.allowInnerDock }), this.allowSplitterDock && !this.proximityDock &&
3849
3914
  index.h("igc-splitter-docking-indicator-component", { style: {
3850
3915
  position: 'fixed',