igniteui-dockmanager 1.12.2 → 1.12.4

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.
@@ -2541,7 +2541,7 @@ let IgcDockManager = class {
2541
2541
  this.element.shadowRoot.elementsFromPoint(clientX, clientY) :
2542
2542
  null;
2543
2543
  let isOverSplitter = false;
2544
- const splitter = elements.filter(e => e.tagName.toLowerCase() === 'igc-splitter-component');
2544
+ const splitter = elements ? elements.filter(e => e.tagName.toLowerCase() === 'igc-splitter-component') : [];
2545
2545
  if (splitter.length > 0) {
2546
2546
  const splitterIndex = elements.indexOf(splitter[0]);
2547
2547
  const adjacentElement = elements[splitterIndex - 1];
@@ -2708,18 +2708,36 @@ let IgcDockManager = class {
2708
2708
  return;
2709
2709
  }
2710
2710
  this.service.bringFloatingPaneOnTop(pane);
2711
- requestAnimationFrame(() => {
2712
- let targetPane = this.findFocusablePane(pane.panes);
2713
- if (!targetPane) {
2714
- targetPane = pane.panes[0];
2715
- }
2716
- const nodeName = event.target.nodeName.toLowerCase();
2717
- if (nodeName === 'igc-dockmanager') {
2718
- this.setActivePane(targetPane);
2719
- this.setFocus(targetPane);
2711
+ const isTabs = pathHTMLElements.filter(e => e.attributes.getNamedItem('part') && e.attributes.getNamedItem('part').value === 'tabs-container').length > 0;
2712
+ if (isTabs) {
2713
+ return;
2714
+ }
2715
+ const isFloatingPaneHeader = pathHTMLElements.filter(e => e.attributes.getNamedItem('part') && e.attributes.getNamedItem('part').value === 'pane-header floating window').length > 0;
2716
+ if (isFloatingPaneHeader) {
2717
+ let targetPane;
2718
+ let parent = this.service.getParent(this.activePane);
2719
+ while (parent) {
2720
+ if (parent === pane) {
2721
+ targetPane = this.activePane;
2722
+ break;
2723
+ }
2724
+ parent = this.service.getParent(parent);
2720
2725
  }
2721
- this.contentPaneId = targetPane.contentId;
2722
- });
2726
+ requestAnimationFrame(() => {
2727
+ if (!targetPane) {
2728
+ targetPane = this.findFocusablePane(pane.panes);
2729
+ }
2730
+ if (!targetPane) {
2731
+ targetPane = pane.panes[0];
2732
+ }
2733
+ const nodeName = event.target.nodeName.toLowerCase();
2734
+ if (nodeName === 'igc-dockmanager') {
2735
+ this.setActivePane(targetPane);
2736
+ this.setFocus(targetPane);
2737
+ }
2738
+ this.contentPaneId = targetPane.contentId;
2739
+ });
2740
+ }
2723
2741
  }
2724
2742
  handleTabIconClick(p, position, isFloating, event) {
2725
2743
  if (!this.showHeaderIconOnHover) {
@@ -718,7 +718,7 @@ export class IgcDockManager {
718
718
  this.element.shadowRoot.elementsFromPoint(clientX, clientY) :
719
719
  null;
720
720
  let isOverSplitter = false;
721
- const splitter = elements.filter(e => e.tagName.toLowerCase() === 'igc-splitter-component');
721
+ const splitter = elements ? elements.filter(e => e.tagName.toLowerCase() === 'igc-splitter-component') : [];
722
722
  if (splitter.length > 0) {
723
723
  const splitterIndex = elements.indexOf(splitter[0]);
724
724
  const adjacentElement = elements[splitterIndex - 1];
@@ -885,18 +885,36 @@ export class IgcDockManager {
885
885
  return;
886
886
  }
887
887
  this.service.bringFloatingPaneOnTop(pane);
888
- requestAnimationFrame(() => {
889
- let targetPane = this.findFocusablePane(pane.panes);
890
- if (!targetPane) {
891
- targetPane = pane.panes[0];
892
- }
893
- const nodeName = event.target.nodeName.toLowerCase();
894
- if (nodeName === 'igc-dockmanager') {
895
- this.setActivePane(targetPane);
896
- this.setFocus(targetPane);
888
+ const isTabs = pathHTMLElements.filter(e => e.attributes.getNamedItem('part') && e.attributes.getNamedItem('part').value === 'tabs-container').length > 0;
889
+ if (isTabs) {
890
+ return;
891
+ }
892
+ const isFloatingPaneHeader = pathHTMLElements.filter(e => e.attributes.getNamedItem('part') && e.attributes.getNamedItem('part').value === 'pane-header floating window').length > 0;
893
+ if (isFloatingPaneHeader) {
894
+ let targetPane;
895
+ let parent = this.service.getParent(this.activePane);
896
+ while (parent) {
897
+ if (parent === pane) {
898
+ targetPane = this.activePane;
899
+ break;
900
+ }
901
+ parent = this.service.getParent(parent);
897
902
  }
898
- this.contentPaneId = targetPane.contentId;
899
- });
903
+ requestAnimationFrame(() => {
904
+ if (!targetPane) {
905
+ targetPane = this.findFocusablePane(pane.panes);
906
+ }
907
+ if (!targetPane) {
908
+ targetPane = pane.panes[0];
909
+ }
910
+ const nodeName = event.target.nodeName.toLowerCase();
911
+ if (nodeName === 'igc-dockmanager') {
912
+ this.setActivePane(targetPane);
913
+ this.setFocus(targetPane);
914
+ }
915
+ this.contentPaneId = targetPane.contentId;
916
+ });
917
+ }
900
918
  }
901
919
  handleTabIconClick(p, position, isFloating, event) {
902
920
  if (!this.showHeaderIconOnHover) {
@@ -2537,7 +2537,7 @@ let IgcDockManager = class {
2537
2537
  this.element.shadowRoot.elementsFromPoint(clientX, clientY) :
2538
2538
  null;
2539
2539
  let isOverSplitter = false;
2540
- const splitter = elements.filter(e => e.tagName.toLowerCase() === 'igc-splitter-component');
2540
+ const splitter = elements ? elements.filter(e => e.tagName.toLowerCase() === 'igc-splitter-component') : [];
2541
2541
  if (splitter.length > 0) {
2542
2542
  const splitterIndex = elements.indexOf(splitter[0]);
2543
2543
  const adjacentElement = elements[splitterIndex - 1];
@@ -2704,18 +2704,36 @@ let IgcDockManager = class {
2704
2704
  return;
2705
2705
  }
2706
2706
  this.service.bringFloatingPaneOnTop(pane);
2707
- requestAnimationFrame(() => {
2708
- let targetPane = this.findFocusablePane(pane.panes);
2709
- if (!targetPane) {
2710
- targetPane = pane.panes[0];
2711
- }
2712
- const nodeName = event.target.nodeName.toLowerCase();
2713
- if (nodeName === 'igc-dockmanager') {
2714
- this.setActivePane(targetPane);
2715
- this.setFocus(targetPane);
2707
+ const isTabs = pathHTMLElements.filter(e => e.attributes.getNamedItem('part') && e.attributes.getNamedItem('part').value === 'tabs-container').length > 0;
2708
+ if (isTabs) {
2709
+ return;
2710
+ }
2711
+ const isFloatingPaneHeader = pathHTMLElements.filter(e => e.attributes.getNamedItem('part') && e.attributes.getNamedItem('part').value === 'pane-header floating window').length > 0;
2712
+ if (isFloatingPaneHeader) {
2713
+ let targetPane;
2714
+ let parent = this.service.getParent(this.activePane);
2715
+ while (parent) {
2716
+ if (parent === pane) {
2717
+ targetPane = this.activePane;
2718
+ break;
2719
+ }
2720
+ parent = this.service.getParent(parent);
2716
2721
  }
2717
- this.contentPaneId = targetPane.contentId;
2718
- });
2722
+ requestAnimationFrame(() => {
2723
+ if (!targetPane) {
2724
+ targetPane = this.findFocusablePane(pane.panes);
2725
+ }
2726
+ if (!targetPane) {
2727
+ targetPane = pane.panes[0];
2728
+ }
2729
+ const nodeName = event.target.nodeName.toLowerCase();
2730
+ if (nodeName === 'igc-dockmanager') {
2731
+ this.setActivePane(targetPane);
2732
+ this.setFocus(targetPane);
2733
+ }
2734
+ this.contentPaneId = targetPane.contentId;
2735
+ });
2736
+ }
2719
2737
  }
2720
2738
  handleTabIconClick(p, position, isFloating, event) {
2721
2739
  if (!this.showHeaderIconOnHover) {