igniteui-dockmanager 2.1.1 → 2.1.3

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.
package/common/util.d.ts CHANGED
@@ -2,3 +2,4 @@ export interface PartNameInfo {
2
2
  readonly [name: string]: string | boolean | number;
3
3
  }
4
4
  export declare const partNameMap: (partNameInfo: PartNameInfo) => string;
5
+ export declare const exportPartsMap: (partNameInfo: PartNameInfo) => string;
package/common/util.js CHANGED
@@ -3,3 +3,8 @@ export const partNameMap = (partNameInfo) => {
3
3
  .filter((key) => partNameInfo[key])
4
4
  .join(' ');
5
5
  };
6
+ export const exportPartsMap = (partNameInfo) => {
7
+ return Object.keys(partNameInfo)
8
+ .filter((key) => partNameInfo[key])
9
+ .join(', ');
10
+ };
@@ -1989,7 +1989,7 @@ export default class IgcDockManagerComponent extends EventEmitterMixin(LitElemen
1989
1989
  }
1990
1990
  handlePaneContentPointerDown(pane) {
1991
1991
  requestAnimationFrame(() => {
1992
- const rootNode = this.shadowRoot ?? document;
1992
+ const rootNode = this.getRootNode();
1993
1993
  if (this === rootNode.activeElement ||
1994
1994
  !this.contains(rootNode.activeElement)) {
1995
1995
  this.setFocus(pane);
@@ -2012,6 +2012,10 @@ export default class IgcDockManagerComponent extends EventEmitterMixin(LitElemen
2012
2012
  this.activePane = this.service.getVisibleContentPanes(pane)[event.detail];
2013
2013
  }
2014
2014
  handleSelectedTabOutOfView(pane, event) {
2015
+ if (this.panesElementMap.get(pane) !== event.target) {
2016
+ event.stopPropagation();
2017
+ return;
2018
+ }
2015
2019
  const cp = pane.panes[event.detail];
2016
2020
  if (cp && this.service.getVisibleContentPanes(pane).indexOf(cp) >= 0) {
2017
2021
  this.service.selectHiddenTab(pane, cp);
@@ -22,6 +22,7 @@ export declare class IgcDockManagerService {
22
22
  private isUpdatingLayout;
23
23
  private lastSwapCenter;
24
24
  private _splitterSize;
25
+ private _previousLocationMap;
25
26
  visibleDocuments: IgcContentPane[];
26
27
  visibleContentPanes: IgcContentPane[];
27
28
  documentHosts: IgcDocumentHost[];
@@ -11,6 +11,7 @@ export class IgcDockManagerService {
11
11
  this.contentPanesCache = [];
12
12
  this.isUpdatingLayout = false;
13
13
  this._splitterSize = null;
14
+ this._previousLocationMap = null;
14
15
  this.visibleDocuments = [];
15
16
  this.visibleContentPanes = [];
16
17
  this.documentHosts = [];
@@ -111,17 +112,22 @@ export class IgcDockManagerService {
111
112
  }
112
113
  }
113
114
  resolvePaneUnpinLocation(pane) {
114
- let unpinnedLocation;
115
115
  if (pane.unpinnedLocation) {
116
- unpinnedLocation = pane.unpinnedLocation;
116
+ return pane.unpinnedLocation;
117
117
  }
118
- else {
119
- const documentHost = this.findClosestDocumentHost(pane);
120
- unpinnedLocation = documentHost
121
- ? this.findPaneUnpinLocation(pane, documentHost)
122
- : 'left';
118
+ const documentHost = this.findClosestDocumentHost(pane);
119
+ if (documentHost) {
120
+ const panePath = this.getPanePath(pane);
121
+ const docHostPath = this.getPanePath(documentHost);
122
+ if (panePath.length > 0 &&
123
+ docHostPath.length > 0 &&
124
+ panePath[0] === docHostPath[0]) {
125
+ return this.findPaneUnpinLocation(pane, documentHost);
126
+ }
123
127
  }
124
- return unpinnedLocation;
128
+ const previousLocation = this._previousLocationMap?.get(pane.contentId) ??
129
+ this.unpinnedLocationMap.get(pane);
130
+ return previousLocation ?? 'left';
125
131
  }
126
132
  addContentPanePinLocation(pane) {
127
133
  if (pane.isPinned === false) {
@@ -654,6 +660,10 @@ export class IgcDockManagerService {
654
660
  .filter((pane) => pane && pane.id != null)
655
661
  .map((pane) => pane.id);
656
662
  this.paneParentMap = new Map();
663
+ this._previousLocationMap = new Map();
664
+ for (const [pane, location] of this.unpinnedLocationMap) {
665
+ this._previousLocationMap.set(pane.contentId, location);
666
+ }
657
667
  this.unpinnedLocationMap = new Map();
658
668
  this.clientContentPanesMap = new Map();
659
669
  this.documentHosts = [];
@@ -680,6 +690,7 @@ export class IgcDockManagerService {
680
690
  }
681
691
  }
682
692
  this.populatePinLocations(layout.rootPane);
693
+ this._previousLocationMap = null;
683
694
  if (this.dockManager.flyoutPane &&
684
695
  !this.unpinnedLocationMap.has(this.dockManager.flyoutPane)) {
685
696
  this.setFlyoutPane(null, this.dockManager.flyoutPane);
@@ -39,6 +39,7 @@ export default class IgcPaneNavigatorComponent extends EventEmitterMixin(LitElem
39
39
  this._allItems = [...this.activePanes, ...this.activeDocuments];
40
40
  this.addEventListener('keyup', this._handleKeyUp);
41
41
  this.addEventListener('keydown', this._handleKeyDown);
42
+ this.setAttribute('exportparts', 'base: pane-navigator, header: pane-navigator-header, body: pane-navigator-body, group: pane-navigator-items-group, title: pane-navigator-items-group-title, item: pane-navigator-item, selected, disabled');
42
43
  }
43
44
  firstUpdated() {
44
45
  const element = this._paneNav.value;
@@ -171,8 +172,6 @@ export default class IgcPaneNavigatorComponent extends EventEmitterMixin(LitElem
171
172
  @click=${() => this.emitEvent('igcClosed', {
172
173
  detail: this._allItems[this.previousActivePaneIndex],
173
174
  })}
174
- exportparts="base: pane-navigator, header: pane-navigator-header, body: pane-navigator-body,
175
- group: pane-navigator-items-group, title: pane-navigator-items-group-title, item: pane-navigator-item, selected, disabled"
176
175
  >
177
176
  <article
178
177
  part="base"
@@ -110,6 +110,7 @@ export default class IgcContentPaneComponent extends IgcContentPaneComponent_bas
110
110
  set minResizeHeight(value: number | undefined);
111
111
  get minResizeHeight(): number;
112
112
  connectedCallback(): void;
113
+ protected _headerChanged(): void;
113
114
  protected updated(): void;
114
115
  private _updateFlex;
115
116
  private _updateParts;
@@ -6,6 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { html, LitElement } from 'lit';
8
8
  import { property } from 'lit/decorators.js';
9
+ import { watch } from '../../../common/decorators/watch.js';
9
10
  import { registerComponent } from '../../../common/definitions/register.js';
10
11
  import { EventEmitterMixin } from '../../../common/mixins/event-emitter.js';
11
12
  import { partNameMap } from '../../../utils/utils.js';
@@ -99,6 +100,9 @@ export default class IgcContentPaneComponent extends EventEmitterMixin(LitElemen
99
100
  this._updateParts();
100
101
  this._updateFlex();
101
102
  }
103
+ _headerChanged() {
104
+ this._updateParts();
105
+ }
102
106
  updated() {
103
107
  this.emitEvent('igcRendered', {
104
108
  detail: this,
@@ -163,3 +167,6 @@ __decorate([
163
167
  __decorate([
164
168
  property({ type: Number, attribute: 'min-resize-height' })
165
169
  ], IgcContentPaneComponent.prototype, "minResizeHeight", null);
170
+ __decorate([
171
+ watch('header', { waitUntilFirstUpdate: true })
172
+ ], IgcContentPaneComponent.prototype, "_headerChanged", null);
@@ -11,7 +11,7 @@ import { ifDefined } from 'lit/directives/if-defined.js';
11
11
  import { watch } from '../../../common/decorators/watch.js';
12
12
  import { registerComponent } from '../../../common/definitions/register.js';
13
13
  import { EventEmitterMixin } from '../../../common/mixins/event-emitter.js';
14
- import { partNameMap } from '../../../common/util.js';
14
+ import { exportPartsMap, partNameMap } from '../../../common/util.js';
15
15
  import { convertToIgcResource } from '../../../utils/locale.js';
16
16
  import IgcButtonDMComponent from '../../button/button-component.js';
17
17
  import { IgcDragService } from '../../drag-drop/drag.service.js';
@@ -108,7 +108,7 @@ export default class IgcPaneHeaderComponent extends EventEmitterMixin(LitElement
108
108
  'pane-header': true,
109
109
  ...this.commonParts,
110
110
  });
111
- const exportParts = partNameMap({
111
+ const exportParts = exportPartsMap({
112
112
  'pane-header': true,
113
113
  'pane-header-actions': true,
114
114
  'pane-header-content': true,
@@ -118,6 +118,7 @@ export default class IgcTabHeaderComponent extends IgcTabHeaderComponent_base {
118
118
  private _updateParts;
119
119
  /** @internal */
120
120
  disconnectedCallback(): void;
121
+ protected _headerChanged(): void;
121
122
  protected _forcedDragChanged(): void;
122
123
  private _forceDragging;
123
124
  protected _activeChanged(): void;
@@ -10,7 +10,7 @@ import { ifDefined } from 'lit/directives/if-defined.js';
10
10
  import { watch } from '../../common/decorators/watch.js';
11
11
  import { registerComponent } from '../../common/definitions/register.js';
12
12
  import { EventEmitterMixin } from '../../common/mixins/event-emitter.js';
13
- import { partNameMap } from '../../common/util.js';
13
+ import { exportPartsMap, partNameMap } from '../../common/util.js';
14
14
  import IgcButtonDMComponent from '../button/button-component.js';
15
15
  import { IgcDragService, } from '../drag-drop/drag.service.js';
16
16
  import IgcIconDMComponent from '../icon/icon-component.js';
@@ -104,7 +104,7 @@ export default class IgcTabHeaderComponent extends EventEmitterMixin(LitElement)
104
104
  'hover-preview-options': showMoreOptionsOnHover,
105
105
  bottom: this.position === 'bottom',
106
106
  });
107
- const exportParts = partNameMap({
107
+ const exportParts = exportPartsMap({
108
108
  'tab-header-close-button': true,
109
109
  'tab-header-more-options': true,
110
110
  'tab-header-more-options-button': true,
@@ -128,6 +128,9 @@ export default class IgcTabHeaderComponent extends EventEmitterMixin(LitElement)
128
128
  this.removeEventListener('pointerenter', this._handlePointerEnter);
129
129
  this.removeEventListener('pointerleave', this._handlePointerLeave);
130
130
  }
131
+ _headerChanged() {
132
+ this._updateParts();
133
+ }
131
134
  _forcedDragChanged() {
132
135
  this._forceDragging();
133
136
  }
@@ -278,6 +281,9 @@ __decorate([
278
281
  __decorate([
279
282
  property({ type: String })
280
283
  ], IgcTabHeaderComponent.prototype, "showHeaderIconOnHover", void 0);
284
+ __decorate([
285
+ watch('header', { waitUntilFirstUpdate: true })
286
+ ], IgcTabHeaderComponent.prototype, "_headerChanged", null);
281
287
  __decorate([
282
288
  watch('forcedDrag', { waitUntilFirstUpdate: true })
283
289
  ], IgcTabHeaderComponent.prototype, "_forcedDragChanged", null);
@@ -11,7 +11,7 @@ import { ifDefined } from 'lit/directives/if-defined.js';
11
11
  import { watch } from '../../common/decorators/watch.js';
12
12
  import { registerComponent } from '../../common/definitions/register.js';
13
13
  import { EventEmitterMixin } from '../../common/mixins/event-emitter.js';
14
- import { partNameMap } from '../../common/util.js';
14
+ import { exportPartsMap, partNameMap } from '../../common/util.js';
15
15
  import IgcButtonDMComponent from '../button/button-component.js';
16
16
  import IgcContextMenuComponent from '../context-menu/context-menu.js';
17
17
  import { IGC_DEFAULT_PANE_SIZE, } from '../dockmanager/dockmanager.interfaces.js';
@@ -171,7 +171,7 @@ export default class IgcTabsComponent extends EventEmitterMixin(LitElement) {
171
171
  const bottom = this.tabHeadersPosition === 'bottom';
172
172
  const contentIds = this.contentIds.join(' ');
173
173
  const parts = `tabs-container ${contentIds}`;
174
- const exportParts = partNameMap({
174
+ const exportParts = exportPartsMap({
175
175
  'tab-strip-area': true,
176
176
  'tab-strip-actions': true,
177
177
  'tabs-content': true,
@@ -466,6 +466,18 @@
466
466
  }
467
467
  }
468
468
  ]
469
+ },
470
+ {
471
+ "kind": "function",
472
+ "name": "exportPartsMap",
473
+ "parameters": [
474
+ {
475
+ "name": "partNameInfo",
476
+ "type": {
477
+ "text": "PartNameInfo"
478
+ }
479
+ }
480
+ ]
469
481
  }
470
482
  ],
471
483
  "exports": [
@@ -476,6 +488,14 @@
476
488
  "name": "partNameMap",
477
489
  "module": "src/common/util.ts"
478
490
  }
491
+ },
492
+ {
493
+ "kind": "js",
494
+ "name": "exportPartsMap",
495
+ "declaration": {
496
+ "name": "exportPartsMap",
497
+ "module": "src/common/util.ts"
498
+ }
479
499
  }
480
500
  ]
481
501
  },
@@ -5879,6 +5899,15 @@
5879
5899
  "privacy": "private",
5880
5900
  "default": "null"
5881
5901
  },
5902
+ {
5903
+ "kind": "field",
5904
+ "name": "_previousLocationMap",
5905
+ "type": {
5906
+ "text": "Map<string, UnpinnedLocation> | null"
5907
+ },
5908
+ "privacy": "private",
5909
+ "default": "null"
5910
+ },
5882
5911
  {
5883
5912
  "kind": "field",
5884
5913
  "name": "visibleDocuments",
@@ -8571,6 +8600,11 @@
8571
8600
  "name": "_updateParts",
8572
8601
  "privacy": "private"
8573
8602
  },
8603
+ {
8604
+ "kind": "method",
8605
+ "name": "_headerChanged",
8606
+ "privacy": "protected"
8607
+ },
8574
8608
  {
8575
8609
  "kind": "method",
8576
8610
  "name": "_forcedDragChanged",
@@ -11388,6 +11422,11 @@
11388
11422
  "text": "number"
11389
11423
  }
11390
11424
  },
11425
+ {
11426
+ "kind": "method",
11427
+ "name": "_headerChanged",
11428
+ "privacy": "protected"
11429
+ },
11391
11430
  {
11392
11431
  "kind": "method",
11393
11432
  "name": "_updateFlex",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "igniteui-dockmanager",
3
- "version": "2.1.1",
3
+ "version": "2.1.3",
4
4
  "description": "Ignite UI Dock Manager Web Component provides means to manage the layout of your application through panes, allowing your end-users to customize it further by pinning, resizing, moving and hiding panes.",
5
5
  "author": "Infragistics",
6
6
  "license": "SEE LICENSE IN LICENSE",