igniteui-dockmanager 1.7.0-beta.2 → 1.7.0-beta.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/CHANGELOG.md +2 -1
- package/dist/cjs/igc-button-component_20.cjs.entry.js +130 -57
- package/dist/collection/components/dockmanager/docking/joystick-indicator-component.js +12 -4
- package/dist/collection/components/dockmanager/dockmanager-component.js +21 -12
- package/dist/collection/components/dockmanager/dockmanager.service.js +84 -31
- package/dist/collection/components/sample-component/sample-component.js +10 -0
- package/dist/collection/components/tabs/tab-panel-component.css +9 -7
- package/dist/collection/components/tabs/tab-panel-component.js +1 -1
- package/dist/collection/components/tabs/tabs-component.css +0 -2
- package/dist/collection/components/tabs/tabs-component.js +2 -9
- package/dist/esm/igc-button-component_20.entry.js +130 -57
- package/dist/esm-es5/igc-button-component_20.entry.js +1 -1
- package/dist/igniteui-dockmanager/igniteui-dockmanager.esm.js +1 -1
- package/dist/igniteui-dockmanager/p-6efd2e0c.system.js +1 -1
- package/dist/igniteui-dockmanager/p-e4f72d14.system.entry.js +1 -0
- package/dist/igniteui-dockmanager/p-e8ad91c2.entry.js +1 -0
- package/dist/types/components/dockmanager/docking/joystick-indicator-component.d.ts +2 -0
- package/dist/types/components/dockmanager/dockmanager.public-interfaces.d.ts +8 -0
- package/dist/types/components/dockmanager/dockmanager.service.d.ts +3 -0
- package/dist/types/components/tabs/tabs-component.d.ts +1 -2
- package/loader/cdn.js +2 -2
- package/loader/index.cjs.js +2 -2
- package/package.json +1 -1
- package/dist/igniteui-dockmanager/p-1a99bbc6.system.entry.js +0 -1
- package/dist/igniteui-dockmanager/p-90a12dbe.entry.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,7 @@ All notable changes for each version of this project will be documented in this
|
|
|
7
7
|
### New features
|
|
8
8
|
- Customizable floating pane header
|
|
9
9
|
- Support for document-only content panes which can be docked only inside a document host
|
|
10
|
+
- `allowEmpty` property for split and tab group panes which allows displaying empty areas
|
|
10
11
|
|
|
11
12
|
### Bug fixes
|
|
12
13
|
- Docking indicators appear over the currently dragged floating pane
|
|
@@ -22,7 +23,7 @@ All notable changes for each version of this project will be documented in this
|
|
|
22
23
|
## 1.5.0
|
|
23
24
|
|
|
24
25
|
### New features
|
|
25
|
-
-
|
|
26
|
+
- `allowMaximize` property per pane [#10](https://github.com/IgniteUI/igniteui-dockmanager/issues/10)
|
|
26
27
|
|
|
27
28
|
### Bug fixes
|
|
28
29
|
- Unpinned pane is closing automatically upon clicking on its content [#11](https://github.com/IgniteUI/igniteui-dockmanager/issues/11)
|
|
@@ -402,7 +402,21 @@ class IgcDockManagerService {
|
|
|
402
402
|
const index = parent.panes.indexOf(pane);
|
|
403
403
|
parent.panes.splice(index, 1);
|
|
404
404
|
if (parent.panes.length === 0) {
|
|
405
|
-
|
|
405
|
+
if (parent.allowEmpty) {
|
|
406
|
+
const rootParent = this.getRootParent(pane);
|
|
407
|
+
if (this.isFloatingPane(rootParent)) {
|
|
408
|
+
this.removeFloatingPaneIfEmpty(rootParent);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
else {
|
|
412
|
+
this.removePane(parent);
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
else if (parent.type === locale.IgcDockManagerPaneType.splitPane) {
|
|
416
|
+
const rootParent = this.getRootParent(parent);
|
|
417
|
+
if (this.isFloatingPane(rootParent)) {
|
|
418
|
+
this.removeFloatingPaneIfEmpty(parent);
|
|
419
|
+
}
|
|
406
420
|
}
|
|
407
421
|
}
|
|
408
422
|
else if (parent.type === locale.IgcDockManagerPaneType.documentHost) {
|
|
@@ -410,6 +424,18 @@ class IgcDockManagerService {
|
|
|
410
424
|
this.removePane(parent);
|
|
411
425
|
}
|
|
412
426
|
}
|
|
427
|
+
removeFloatingPaneIfEmpty(pane) {
|
|
428
|
+
const childPanes = this.getChildContentPanes(pane);
|
|
429
|
+
if (childPanes.length === 0) {
|
|
430
|
+
this.removePane(pane);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
isFloatingPane(pane) {
|
|
434
|
+
if (!this.dockManager.layout.floatingPanes) {
|
|
435
|
+
return false;
|
|
436
|
+
}
|
|
437
|
+
return this.dockManager.layout.floatingPanes.indexOf(pane) > -1;
|
|
438
|
+
}
|
|
413
439
|
addFloatingPane(content, location, width, height) {
|
|
414
440
|
const floatingPane = {
|
|
415
441
|
type: locale.IgcDockManagerPaneType.splitPane,
|
|
@@ -481,25 +507,36 @@ class IgcDockManagerService {
|
|
|
481
507
|
docHost.rootPane;
|
|
482
508
|
}
|
|
483
509
|
}
|
|
484
|
-
dockToCenter(targetPane,
|
|
485
|
-
let
|
|
510
|
+
dockToCenter(targetPane, draggedPane) {
|
|
511
|
+
let targetContainer;
|
|
486
512
|
if (targetPane.type === locale.IgcDockManagerPaneType.tabGroupPane) {
|
|
487
|
-
|
|
513
|
+
targetContainer = targetPane;
|
|
488
514
|
}
|
|
489
515
|
else if (targetPane.type === locale.IgcDockManagerPaneType.contentPane) {
|
|
490
|
-
|
|
516
|
+
targetContainer = {
|
|
491
517
|
type: locale.IgcDockManagerPaneType.tabGroupPane,
|
|
492
518
|
size: targetPane.size,
|
|
493
519
|
panes: [targetPane]
|
|
494
520
|
};
|
|
495
521
|
const targetParent = this.paneParentMap.get(targetPane);
|
|
496
522
|
const index = targetParent.panes.indexOf(targetPane);
|
|
497
|
-
targetParent.panes[index] =
|
|
523
|
+
targetParent.panes[index] = targetContainer;
|
|
524
|
+
}
|
|
525
|
+
else if (targetPane.type === locale.IgcDockManagerPaneType.splitPane) {
|
|
526
|
+
targetContainer = targetPane;
|
|
527
|
+
}
|
|
528
|
+
else if (targetPane.type === locale.IgcDockManagerPaneType.documentHost) {
|
|
529
|
+
targetContainer = targetPane.rootPane;
|
|
530
|
+
}
|
|
531
|
+
if (targetContainer.type === locale.IgcDockManagerPaneType.tabGroupPane) {
|
|
532
|
+
const panesToDock = (draggedPane.type === locale.IgcDockManagerPaneType.contentPane) ?
|
|
533
|
+
[draggedPane] :
|
|
534
|
+
this.getChildContentPanes(draggedPane);
|
|
535
|
+
targetContainer.panes.push(...panesToDock);
|
|
536
|
+
}
|
|
537
|
+
else if (targetContainer.type === locale.IgcDockManagerPaneType.splitPane) {
|
|
538
|
+
targetContainer.panes.push(draggedPane);
|
|
498
539
|
}
|
|
499
|
-
const panesToDock = (draggedFloatingPane.type === locale.IgcDockManagerPaneType.contentPane) ?
|
|
500
|
-
[draggedFloatingPane] :
|
|
501
|
-
this.getChildContentPanes(draggedFloatingPane);
|
|
502
|
-
targetTabGroup.panes.push(...panesToDock);
|
|
503
540
|
}
|
|
504
541
|
dockToEdge(targetPane, position) {
|
|
505
542
|
const targetParent = this.getParent(targetPane);
|
|
@@ -583,6 +620,9 @@ class IgcDockManagerService {
|
|
|
583
620
|
getParent(pane) {
|
|
584
621
|
return this.paneParentMap.get(pane);
|
|
585
622
|
}
|
|
623
|
+
getRootParent(pane) {
|
|
624
|
+
return this.getPanePath(pane)[0];
|
|
625
|
+
}
|
|
586
626
|
getPanePath(pane) {
|
|
587
627
|
const path = [];
|
|
588
628
|
let currentPane = pane;
|
|
@@ -594,13 +634,10 @@ class IgcDockManagerService {
|
|
|
594
634
|
}
|
|
595
635
|
getDocHostParent(pane) {
|
|
596
636
|
let parent = pane;
|
|
597
|
-
|
|
598
|
-
if (parent.type === locale.IgcDockManagerPaneType.documentHost) {
|
|
599
|
-
return parent;
|
|
600
|
-
}
|
|
637
|
+
do {
|
|
601
638
|
parent = this.paneParentMap.get(parent);
|
|
602
|
-
}
|
|
603
|
-
return
|
|
639
|
+
} while (parent && parent.type !== locale.IgcDockManagerPaneType.documentHost);
|
|
640
|
+
return parent;
|
|
604
641
|
}
|
|
605
642
|
resizeFlyoutPane(delta) {
|
|
606
643
|
const pane = this.dockManager.flyoutPane;
|
|
@@ -828,13 +865,28 @@ class IgcDockManagerService {
|
|
|
828
865
|
});
|
|
829
866
|
}
|
|
830
867
|
floatPane(pane, x, y, width, height) {
|
|
831
|
-
let
|
|
868
|
+
let panesToRemove = [pane];
|
|
869
|
+
let paneToAdd = pane;
|
|
832
870
|
const parent = this.paneParentMap.get(pane);
|
|
833
|
-
|
|
834
|
-
parent
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
871
|
+
if (pane !== this.dockManager.flyoutPane && parent.type === locale.IgcDockManagerPaneType.tabGroupPane) {
|
|
872
|
+
if (parent.allowEmpty) {
|
|
873
|
+
const panes = [...parent.panes];
|
|
874
|
+
panesToRemove = panes;
|
|
875
|
+
paneToAdd = parent.panes.length === 1 ?
|
|
876
|
+
pane :
|
|
877
|
+
{
|
|
878
|
+
type: locale.IgcDockManagerPaneType.tabGroupPane,
|
|
879
|
+
panes,
|
|
880
|
+
selectedIndex: parent.selectedIndex
|
|
881
|
+
};
|
|
882
|
+
}
|
|
883
|
+
else {
|
|
884
|
+
panesToRemove = [parent];
|
|
885
|
+
paneToAdd = parent;
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
panesToRemove.forEach(p => this.removePane(p));
|
|
889
|
+
this.addFloatingPane(paneToAdd, { x, y }, width, height);
|
|
838
890
|
if (pane === this.dockManager.flyoutPane) {
|
|
839
891
|
pane.isPinned = true;
|
|
840
892
|
this.dockManager.flyoutPane = null;
|
|
@@ -946,13 +998,13 @@ class IgcDockManagerService {
|
|
|
946
998
|
return this.isContentPaneVisible(p);
|
|
947
999
|
}
|
|
948
1000
|
else if (p.type === locale.IgcDockManagerPaneType.splitPane) {
|
|
949
|
-
return this.getSplitPaneVisibleChildren(p).length;
|
|
1001
|
+
return p.allowEmpty || this.getSplitPaneVisibleChildren(p).length;
|
|
950
1002
|
}
|
|
951
1003
|
else if (p.type === locale.IgcDockManagerPaneType.tabGroupPane) {
|
|
952
|
-
return p.panes.some(cp => this.isContentPaneVisible(cp));
|
|
1004
|
+
return p.allowEmpty || p.panes.some(cp => this.isContentPaneVisible(cp));
|
|
953
1005
|
}
|
|
954
1006
|
else if (p.type === locale.IgcDockManagerPaneType.documentHost) {
|
|
955
|
-
return this.getSplitPaneVisibleChildren(p.rootPane).length;
|
|
1007
|
+
return p.rootPane.allowEmpty || this.getSplitPaneVisibleChildren(p.rootPane).length;
|
|
956
1008
|
}
|
|
957
1009
|
});
|
|
958
1010
|
}
|
|
@@ -1326,6 +1378,13 @@ class IgcDockManagerService {
|
|
|
1326
1378
|
const draggedPaneSize = (_a = this.getPaneToDock(this.dockManager.draggedPane).size) !== null && _a !== void 0 ? _a : IGC_DEFAULT_PANE_SIZE;
|
|
1327
1379
|
const isOuter = Utils.isDockingIndicatorOuter(this.dockingIndicator.position);
|
|
1328
1380
|
const baseRect = isOuter ? parentRect : dropTargetPaneInfo.targetRect;
|
|
1381
|
+
if (this.dockingIndicator.position === locale.IgcDockingIndicatorPosition.center) {
|
|
1382
|
+
shadowRect.x = baseRect.x;
|
|
1383
|
+
shadowRect.y = baseRect.y;
|
|
1384
|
+
shadowRect.width = baseRect.width;
|
|
1385
|
+
shadowRect.height = baseRect.height;
|
|
1386
|
+
return shadowRect;
|
|
1387
|
+
}
|
|
1329
1388
|
const targetPane = isOuter ? dropTargetPaneInfo.docHost : dropTargetPaneInfo.pane;
|
|
1330
1389
|
const targetParent = this.getParent(targetPane);
|
|
1331
1390
|
const panes = this.getSplitPaneVisibleChildren(targetParent);
|
|
@@ -1341,12 +1400,6 @@ class IgcDockManagerService {
|
|
|
1341
1400
|
const beforePanesTotalSize = panes.slice(0, dropTargetIndex).reduce((a, b) => a + (b.size || IGC_DEFAULT_PANE_SIZE), 0);
|
|
1342
1401
|
const afterPanesTotalSize = panes.slice(0, dropTargetIndex + 1).reduce((a, b) => a + (b.size || IGC_DEFAULT_PANE_SIZE), 0);
|
|
1343
1402
|
switch (this.dockingIndicator.position) {
|
|
1344
|
-
case locale.IgcDockingIndicatorPosition.center:
|
|
1345
|
-
shadowRect.x = baseRect.x;
|
|
1346
|
-
shadowRect.y = baseRect.y;
|
|
1347
|
-
shadowRect.width = baseRect.width;
|
|
1348
|
-
shadowRect.height = baseRect.height;
|
|
1349
|
-
break;
|
|
1350
1403
|
case locale.IgcDockingIndicatorPosition.left:
|
|
1351
1404
|
case locale.IgcDockingIndicatorPosition.outerLeft:
|
|
1352
1405
|
shadowRect.x = baseRect.x;
|
|
@@ -2092,15 +2145,13 @@ let IgcDockManager = class {
|
|
|
2092
2145
|
let paneElement;
|
|
2093
2146
|
for (const element of elements) {
|
|
2094
2147
|
const tagName = element.tagName.toLowerCase();
|
|
2095
|
-
if (tagName === 'igc-content-pane-component') {
|
|
2148
|
+
if (tagName === 'igc-content-pane-component' || tagName === 'igc-split-pane-component') {
|
|
2096
2149
|
if (paneElement) {
|
|
2097
2150
|
break;
|
|
2098
2151
|
}
|
|
2099
|
-
|
|
2100
|
-
paneElement = element;
|
|
2101
|
-
}
|
|
2152
|
+
paneElement = element;
|
|
2102
2153
|
}
|
|
2103
|
-
else if (tagName === 'igc-tabs-component') {
|
|
2154
|
+
else if (tagName === 'igc-tabs-component' || tagName === 'igc-document-host-component') {
|
|
2104
2155
|
paneElement = element;
|
|
2105
2156
|
break;
|
|
2106
2157
|
}
|
|
@@ -2112,10 +2163,13 @@ let IgcDockManager = class {
|
|
|
2112
2163
|
const dropPane = this.panesElementMap.getByValue(paneElement);
|
|
2113
2164
|
if ((!this.dropTargetPaneInfo || this.dropTargetPaneInfo.pane !== dropPane) && dropPane !== this.draggedPane) {
|
|
2114
2165
|
const docHost = this.service.getDocHostParent(dropPane);
|
|
2115
|
-
const dropPaneRoot = this.service.
|
|
2166
|
+
const dropPaneRoot = this.service.getRootParent(dropPane);
|
|
2116
2167
|
const floatingPaneWithoutDocHost = this.layout.floatingPanes.indexOf(dropPaneRoot) !== -1 &&
|
|
2117
2168
|
!this.service.getChildDocHostRecursive(dropPaneRoot);
|
|
2118
|
-
if (!this.documentOnlyDrag
|
|
2169
|
+
if (!this.documentOnlyDrag
|
|
2170
|
+
|| docHost
|
|
2171
|
+
|| floatingPaneWithoutDocHost
|
|
2172
|
+
|| dropPane.type === locale.IgcDockManagerPaneType.documentHost) {
|
|
2119
2173
|
this.dropTargetPaneInfo = {
|
|
2120
2174
|
pane: dropPane,
|
|
2121
2175
|
targetRect: paneElement.getBoundingClientRect(),
|
|
@@ -2123,6 +2177,9 @@ let IgcDockManager = class {
|
|
|
2123
2177
|
floatingPaneWithoutDocHost
|
|
2124
2178
|
};
|
|
2125
2179
|
}
|
|
2180
|
+
else {
|
|
2181
|
+
this.dropTargetPaneInfo = null;
|
|
2182
|
+
}
|
|
2126
2183
|
}
|
|
2127
2184
|
}
|
|
2128
2185
|
else {
|
|
@@ -2258,7 +2315,7 @@ let IgcDockManager = class {
|
|
|
2258
2315
|
let isSingleFloatingContentPane = false;
|
|
2259
2316
|
let floatingPane;
|
|
2260
2317
|
if (isFloating) {
|
|
2261
|
-
floatingPane = this.service.
|
|
2318
|
+
floatingPane = this.service.getRootParent(pane);
|
|
2262
2319
|
const hasHeader = this.service.hasFloatingPaneHeader(floatingPane);
|
|
2263
2320
|
if (!hasHeader) {
|
|
2264
2321
|
isSingleFloatingContentPane = true;
|
|
@@ -2286,7 +2343,11 @@ let IgcDockManager = class {
|
|
|
2286
2343
|
return (index.h("igc-splitter-component", { splitPaneOrientation: parentPane.orientation, onResizeStart: this.handleSplitterResizeStart.bind(this), onResizeEnd: this.handleSplitterResizeEnd.bind(this, parentPane, pane), onFocusin: this.clearActivePane.bind(this) }));
|
|
2287
2344
|
}
|
|
2288
2345
|
renderDocumentHost(docHost) {
|
|
2289
|
-
return (index.h("igc-document-host-component", { key: docHost.id, size: docHost.size
|
|
2346
|
+
return (index.h("igc-document-host-component", { key: docHost.id, size: docHost.size, ref: el => {
|
|
2347
|
+
if (el) {
|
|
2348
|
+
this.panesElementMap.set(docHost, el);
|
|
2349
|
+
}
|
|
2350
|
+
} }, this.renderSplitPane(docHost.rootPane, false, true)));
|
|
2290
2351
|
}
|
|
2291
2352
|
renderTabGroup(pane, isFloating, isInDocumentHost) {
|
|
2292
2353
|
let tabs = pane.type === locale.IgcDockManagerPaneType.tabGroupPane ? pane.panes : [pane];
|
|
@@ -2295,8 +2356,9 @@ let IgcDockManager = class {
|
|
|
2295
2356
|
pane.selectedIndex : 0;
|
|
2296
2357
|
const position = isInDocumentHost ? IgcTabHeadersPosition.top : IgcTabHeadersPosition.bottom;
|
|
2297
2358
|
const isSingleTab = tabs.length === 1 && position === IgcTabHeadersPosition.bottom;
|
|
2359
|
+
const allowEmpty = pane.type === locale.IgcDockManagerPaneType.tabGroupPane ? pane.allowEmpty : false;
|
|
2298
2360
|
const allowMaximize = this.resolveAllowMaximize(pane);
|
|
2299
|
-
return tabs.length > 0 && (index.h("igc-tabs-component", { key: pane.id, size: pane.size, selectedIndex: selectedIndex, hasHeaders: !isSingleTab, onSelectedIndexChanged: this.handleTabSelectedIndexChanged.bind(this, pane), onHiddenTabSelected: this.handleHiddenTabSelected.bind(this, pane), onSelectedTabOutOfView: this.handleSelectedTabOutOfView.bind(this, pane), tabHeadersPosition: position, resourceStrings: this.resourceStrings, ref: el => {
|
|
2361
|
+
return (allowEmpty || tabs.length > 0) && (index.h("igc-tabs-component", { key: pane.id, size: pane.size, selectedIndex: selectedIndex, hasHeaders: !isSingleTab, onSelectedIndexChanged: this.handleTabSelectedIndexChanged.bind(this, pane), onHiddenTabSelected: this.handleHiddenTabSelected.bind(this, pane), onSelectedTabOutOfView: this.handleSelectedTabOutOfView.bind(this, pane), tabHeadersPosition: position, resourceStrings: this.resourceStrings, ref: el => {
|
|
2300
2362
|
if (el) {
|
|
2301
2363
|
this.panesElementMap.set(pane, el);
|
|
2302
2364
|
}
|
|
@@ -2340,7 +2402,7 @@ let IgcDockManager = class {
|
|
|
2340
2402
|
}
|
|
2341
2403
|
renderSplitPane(splitPane, isFloating, isInDocumentHost) {
|
|
2342
2404
|
const panes = this.service.getSplitPaneVisibleChildren(splitPane);
|
|
2343
|
-
return panes.length > 0 && (index.h("igc-split-pane-component", { key: splitPane.id, orientation: splitPane.orientation, size: splitPane.size, ref: el => {
|
|
2405
|
+
return (splitPane.allowEmpty || panes.length > 0) && (index.h("igc-split-pane-component", { key: splitPane.id, orientation: splitPane.orientation, size: splitPane.size, ref: el => {
|
|
2344
2406
|
if (el) {
|
|
2345
2407
|
this.panesElementMap.set(splitPane, el);
|
|
2346
2408
|
}
|
|
@@ -2419,7 +2481,7 @@ let IgcDockManager = class {
|
|
|
2419
2481
|
this.service.forceDragPane = null;
|
|
2420
2482
|
forceDrag = true;
|
|
2421
2483
|
}
|
|
2422
|
-
const containsMaximizedPane = this.maximizedPane && this.service.
|
|
2484
|
+
const containsMaximizedPane = this.maximizedPane && this.service.getRootParent(this.maximizedPane) === p;
|
|
2423
2485
|
return (index.h("igc-floating-pane-component", { key: p.id, style: { zIndex: this.floatingPaneZIndicesMap.get(p).toString() }, floatingLocation: p.floatingLocation ? p.floatingLocation : { x: 0, y: 0 }, floatingWidth: p.floatingWidth ? p.floatingWidth : IGC_DEFAULT_PANE_SIZE, floatingHeight: p.floatingHeight ? p.floatingHeight : IGC_DEFAULT_PANE_SIZE, hasHeader: hasHeader, onWndResizeStart: this.handleFloatingPaneResizeStart.bind(this, p), onWndResizeMove: this.handleFloatingPaneResizeMove.bind(this, p), onWndResizeEnd: this.handleFloatingPaneResizeEnd.bind(this, p), onMouseDown: this.handleFloatingPaneMouseDown.bind(this, p), class: {
|
|
2424
2486
|
'maximized': this.maximizedPane === p
|
|
2425
2487
|
}, maximized: this.maximizedPane === p || containsMaximizedPane, allowResize: (_a = p.floatingResizable) !== null && _a !== void 0 ? _a : this.allowFloatingPanesResize }, hasHeader ?
|
|
@@ -2760,10 +2822,18 @@ let IgcJoystickIndicatorComponent = class {
|
|
|
2760
2822
|
constructor(hostRef) {
|
|
2761
2823
|
index.registerInstance(this, hostRef);
|
|
2762
2824
|
}
|
|
2825
|
+
isEmptyCenter(position) {
|
|
2826
|
+
return this.documentOnlyDrag
|
|
2827
|
+
&& position === locale.IgcDockingIndicatorPosition.center
|
|
2828
|
+
&& this.dropTargetPaneInfo.floatingPaneWithoutDocHost;
|
|
2829
|
+
}
|
|
2830
|
+
isEmptyEdge(position) {
|
|
2831
|
+
return this.documentOnlyDrag
|
|
2832
|
+
&& position !== locale.IgcDockingIndicatorPosition.center
|
|
2833
|
+
&& this.dropTargetPaneInfo.pane.type === locale.IgcDockManagerPaneType.documentHost;
|
|
2834
|
+
}
|
|
2763
2835
|
renderIndicator(position) {
|
|
2764
|
-
return (index.h("igc-joystick-icon-component", { isDocHost: this.isDocHost, position: position, empty: this.
|
|
2765
|
-
position === locale.IgcDockingIndicatorPosition.center &&
|
|
2766
|
-
this.dropTargetPaneInfo.floatingPaneWithoutDocHost }));
|
|
2836
|
+
return (index.h("igc-joystick-icon-component", { isDocHost: this.isDocHost, position: position, empty: this.isEmptyCenter(position) || this.isEmptyEdge(position) }));
|
|
2767
2837
|
}
|
|
2768
2838
|
render() {
|
|
2769
2839
|
this.isDocHost = !!this.dropTargetPaneInfo.docHost;
|
|
@@ -3435,7 +3505,7 @@ let IgcTabHeaderComponent = class {
|
|
|
3435
3505
|
};
|
|
3436
3506
|
IgcTabHeaderComponent.style = tabHeaderComponentCss;
|
|
3437
3507
|
|
|
3438
|
-
const tabPanelComponentCss = ":host{display:block;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:auto;-ms-flex-positive:1;flex-grow:1;height:100
|
|
3508
|
+
const tabPanelComponentCss = ":host{display:block;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:auto;-ms-flex-positive:1;flex-grow:1;height:100%;color:var(--igc-pane-content-text, var(--igc-text-color, rgba(0, 0, 0, 0.72)));background-color:var(--igc-pane-content-background, var(--igc-border-color, #F3F5F7))}";
|
|
3439
3509
|
|
|
3440
3510
|
let IgcTabPanelComponent = class {
|
|
3441
3511
|
constructor(hostRef) {
|
|
@@ -3465,7 +3535,7 @@ let IgcTabPanelComponent = class {
|
|
|
3465
3535
|
};
|
|
3466
3536
|
IgcTabPanelComponent.style = tabPanelComponentCss;
|
|
3467
3537
|
|
|
3468
|
-
const tabsComponentCss = ":host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;min-width:0px;min-height:0px}.tabs{display:-ms-flexbox;display:flex;overflow:hidden;min-height:32px;max-height:32px;background:var(--igc-dock-background, var(--igc-background-color, #E5E7E9))}.tabs--top{padding-top:8px}.tabs--top .tab-headers-container--wrapped{-ms-flex-wrap:wrap;flex-wrap:wrap}.tabs--bottom{padding-bottom:8px}.tabs--bottom .tab-headers-container--wrapped{-ms-flex-wrap:wrap-reverse;flex-wrap:wrap-reverse}.content{-ms-flex-positive:1;flex-grow:1;height:100%;overflow:auto
|
|
3538
|
+
const tabsComponentCss = ":host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;min-width:0px;min-height:0px}.tabs{display:-ms-flexbox;display:flex;overflow:hidden;min-height:32px;max-height:32px;background:var(--igc-dock-background, var(--igc-background-color, #E5E7E9))}.tabs--top{padding-top:8px}.tabs--top .tab-headers-container--wrapped{-ms-flex-wrap:wrap;flex-wrap:wrap}.tabs--bottom{padding-bottom:8px}.tabs--bottom .tab-headers-container--wrapped{-ms-flex-wrap:wrap-reverse;flex-wrap:wrap-reverse}.content{-ms-flex-positive:1;flex-grow:1;height:100%;overflow:auto}.tab-headers-container{width:100%;display:-ms-flexbox;display:flex;overflow:hidden}.tab-header-icon-container{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-pack:end;justify-content:flex-end;padding-left:8px;padding-right:8px}";
|
|
3469
3539
|
|
|
3470
3540
|
/**
|
|
3471
3541
|
* @hidden
|
|
@@ -3483,7 +3553,7 @@ let IgcTabsComponent = class {
|
|
|
3483
3553
|
this.hasHeaders = true;
|
|
3484
3554
|
this.showHiddenTabsMenu = true;
|
|
3485
3555
|
this.resizeObserver = new ResizeObserver(this.tabHeadersDivResized.bind(this));
|
|
3486
|
-
this.
|
|
3556
|
+
this.slotChanged = () => {
|
|
3487
3557
|
this.updateSelectedIndex();
|
|
3488
3558
|
this.setTabsAttributes();
|
|
3489
3559
|
this.forceUpdate();
|
|
@@ -3516,10 +3586,6 @@ let IgcTabsComponent = class {
|
|
|
3516
3586
|
this.updateSelectedIndex();
|
|
3517
3587
|
}
|
|
3518
3588
|
componentDidLoad() {
|
|
3519
|
-
this.headerSlot = this.el.shadowRoot.querySelector('slot[name="tabHeader"]');
|
|
3520
|
-
if (this.headerSlot) {
|
|
3521
|
-
this.headerSlot.addEventListener('slotchange', this.headerSlotChanged);
|
|
3522
|
-
}
|
|
3523
3589
|
this.setTabsAttributes();
|
|
3524
3590
|
this.tabHeadersDiv = this.el.shadowRoot.querySelector('div.tabs');
|
|
3525
3591
|
if (this.tabHeadersDiv) {
|
|
@@ -3547,9 +3613,6 @@ let IgcTabsComponent = class {
|
|
|
3547
3613
|
}
|
|
3548
3614
|
}
|
|
3549
3615
|
disconnectedCallback() {
|
|
3550
|
-
if (this.headerSlot) {
|
|
3551
|
-
this.headerSlot.removeEventListener('slotchange', this.headerSlotChanged);
|
|
3552
|
-
}
|
|
3553
3616
|
this.resizeObserver.disconnect();
|
|
3554
3617
|
}
|
|
3555
3618
|
forceUpdate() {
|
|
@@ -3662,7 +3725,7 @@ let IgcTabsComponent = class {
|
|
|
3662
3725
|
}, ',');
|
|
3663
3726
|
return (index.h(index.Host, { role: "tablist", style: {
|
|
3664
3727
|
flex: `${size} 1 ${size}px`
|
|
3665
|
-
}, exportparts: exportParts }, top && this.renderTabHeaders(top), index.h("div", { part: tabsContentParts, class: "content" }, index.h("slot",
|
|
3728
|
+
}, exportparts: exportParts }, top && this.renderTabHeaders(top), index.h("div", { part: tabsContentParts, class: "content" }, index.h("slot", { onSlotchange: this.slotChanged })), bottom && this.renderTabHeaders(top), this.renderHiddenTabsMenu()));
|
|
3666
3729
|
}
|
|
3667
3730
|
get el() { return index.getElement(this); }
|
|
3668
3731
|
static get watchers() { return {
|
|
@@ -3734,6 +3797,7 @@ let SampleComponent = class {
|
|
|
3734
3797
|
rootPane: {
|
|
3735
3798
|
type: locale.IgcDockManagerPaneType.splitPane,
|
|
3736
3799
|
orientation: locale.IgcSplitPaneOrientation.horizontal,
|
|
3800
|
+
allowEmpty: true,
|
|
3737
3801
|
panes: [
|
|
3738
3802
|
{
|
|
3739
3803
|
type: locale.IgcDockManagerPaneType.tabGroupPane,
|
|
@@ -3763,6 +3827,12 @@ let SampleComponent = class {
|
|
|
3763
3827
|
]
|
|
3764
3828
|
}
|
|
3765
3829
|
},
|
|
3830
|
+
{
|
|
3831
|
+
type: locale.IgcDockManagerPaneType.splitPane,
|
|
3832
|
+
orientation: locale.IgcSplitPaneOrientation.horizontal,
|
|
3833
|
+
allowEmpty: true,
|
|
3834
|
+
panes: []
|
|
3835
|
+
},
|
|
3766
3836
|
{
|
|
3767
3837
|
type: locale.IgcDockManagerPaneType.contentPane,
|
|
3768
3838
|
header: 'Error List',
|
|
@@ -3780,6 +3850,7 @@ let SampleComponent = class {
|
|
|
3780
3850
|
{
|
|
3781
3851
|
type: locale.IgcDockManagerPaneType.tabGroupPane,
|
|
3782
3852
|
size: 200,
|
|
3853
|
+
allowEmpty: true,
|
|
3783
3854
|
panes: [
|
|
3784
3855
|
{
|
|
3785
3856
|
type: locale.IgcDockManagerPaneType.contentPane,
|
|
@@ -3824,6 +3895,7 @@ let SampleComponent = class {
|
|
|
3824
3895
|
},
|
|
3825
3896
|
{
|
|
3826
3897
|
type: locale.IgcDockManagerPaneType.splitPane,
|
|
3898
|
+
allowEmpty: true,
|
|
3827
3899
|
orientation: locale.IgcSplitPaneOrientation.horizontal,
|
|
3828
3900
|
floatingLocation: { x: 250, y: 350 },
|
|
3829
3901
|
floatingWidth: 300,
|
|
@@ -3851,6 +3923,7 @@ let SampleComponent = class {
|
|
|
3851
3923
|
panes: [
|
|
3852
3924
|
{
|
|
3853
3925
|
type: locale.IgcDockManagerPaneType.tabGroupPane,
|
|
3926
|
+
allowEmpty: true,
|
|
3854
3927
|
panes: [
|
|
3855
3928
|
{
|
|
3856
3929
|
type: locale.IgcDockManagerPaneType.contentPane,
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import { Component, Host, Prop, h } from '@stencil/core';
|
|
2
|
-
import { IgcDockingIndicatorPosition } from '../dockmanager.public-interfaces';
|
|
2
|
+
import { IgcDockManagerPaneType, IgcDockingIndicatorPosition } from '../dockmanager.public-interfaces';
|
|
3
3
|
/**
|
|
4
4
|
* @hidden
|
|
5
5
|
*/
|
|
6
6
|
export class IgcJoystickIndicatorComponent {
|
|
7
|
+
isEmptyCenter(position) {
|
|
8
|
+
return this.documentOnlyDrag
|
|
9
|
+
&& position === IgcDockingIndicatorPosition.center
|
|
10
|
+
&& this.dropTargetPaneInfo.floatingPaneWithoutDocHost;
|
|
11
|
+
}
|
|
12
|
+
isEmptyEdge(position) {
|
|
13
|
+
return this.documentOnlyDrag
|
|
14
|
+
&& position !== IgcDockingIndicatorPosition.center
|
|
15
|
+
&& this.dropTargetPaneInfo.pane.type === IgcDockManagerPaneType.documentHost;
|
|
16
|
+
}
|
|
7
17
|
renderIndicator(position) {
|
|
8
|
-
return (h("igc-joystick-icon-component", { isDocHost: this.isDocHost, position: position, empty: this.
|
|
9
|
-
position === IgcDockingIndicatorPosition.center &&
|
|
10
|
-
this.dropTargetPaneInfo.floatingPaneWithoutDocHost }));
|
|
18
|
+
return (h("igc-joystick-icon-component", { isDocHost: this.isDocHost, position: position, empty: this.isEmptyCenter(position) || this.isEmptyEdge(position) }));
|
|
11
19
|
}
|
|
12
20
|
render() {
|
|
13
21
|
this.isDocHost = !!this.dropTargetPaneInfo.docHost;
|
|
@@ -444,15 +444,13 @@ export class IgcDockManager {
|
|
|
444
444
|
let paneElement;
|
|
445
445
|
for (const element of elements) {
|
|
446
446
|
const tagName = element.tagName.toLowerCase();
|
|
447
|
-
if (tagName === 'igc-content-pane-component') {
|
|
447
|
+
if (tagName === 'igc-content-pane-component' || tagName === 'igc-split-pane-component') {
|
|
448
448
|
if (paneElement) {
|
|
449
449
|
break;
|
|
450
450
|
}
|
|
451
|
-
|
|
452
|
-
paneElement = element;
|
|
453
|
-
}
|
|
451
|
+
paneElement = element;
|
|
454
452
|
}
|
|
455
|
-
else if (tagName === 'igc-tabs-component') {
|
|
453
|
+
else if (tagName === 'igc-tabs-component' || tagName === 'igc-document-host-component') {
|
|
456
454
|
paneElement = element;
|
|
457
455
|
break;
|
|
458
456
|
}
|
|
@@ -464,10 +462,13 @@ export class IgcDockManager {
|
|
|
464
462
|
const dropPane = this.panesElementMap.getByValue(paneElement);
|
|
465
463
|
if ((!this.dropTargetPaneInfo || this.dropTargetPaneInfo.pane !== dropPane) && dropPane !== this.draggedPane) {
|
|
466
464
|
const docHost = this.service.getDocHostParent(dropPane);
|
|
467
|
-
const dropPaneRoot = this.service.
|
|
465
|
+
const dropPaneRoot = this.service.getRootParent(dropPane);
|
|
468
466
|
const floatingPaneWithoutDocHost = this.layout.floatingPanes.indexOf(dropPaneRoot) !== -1 &&
|
|
469
467
|
!this.service.getChildDocHostRecursive(dropPaneRoot);
|
|
470
|
-
if (!this.documentOnlyDrag
|
|
468
|
+
if (!this.documentOnlyDrag
|
|
469
|
+
|| docHost
|
|
470
|
+
|| floatingPaneWithoutDocHost
|
|
471
|
+
|| dropPane.type === IgcDockManagerPaneType.documentHost) {
|
|
471
472
|
this.dropTargetPaneInfo = {
|
|
472
473
|
pane: dropPane,
|
|
473
474
|
targetRect: paneElement.getBoundingClientRect(),
|
|
@@ -475,6 +476,9 @@ export class IgcDockManager {
|
|
|
475
476
|
floatingPaneWithoutDocHost
|
|
476
477
|
};
|
|
477
478
|
}
|
|
479
|
+
else {
|
|
480
|
+
this.dropTargetPaneInfo = null;
|
|
481
|
+
}
|
|
478
482
|
}
|
|
479
483
|
}
|
|
480
484
|
else {
|
|
@@ -610,7 +614,7 @@ export class IgcDockManager {
|
|
|
610
614
|
let isSingleFloatingContentPane = false;
|
|
611
615
|
let floatingPane;
|
|
612
616
|
if (isFloating) {
|
|
613
|
-
floatingPane = this.service.
|
|
617
|
+
floatingPane = this.service.getRootParent(pane);
|
|
614
618
|
const hasHeader = this.service.hasFloatingPaneHeader(floatingPane);
|
|
615
619
|
if (!hasHeader) {
|
|
616
620
|
isSingleFloatingContentPane = true;
|
|
@@ -641,7 +645,11 @@ export class IgcDockManager {
|
|
|
641
645
|
return (h("igc-splitter-component", { splitPaneOrientation: parentPane.orientation, onResizeStart: this.handleSplitterResizeStart.bind(this), onResizeEnd: this.handleSplitterResizeEnd.bind(this, parentPane, pane), onFocusin: this.clearActivePane.bind(this) }));
|
|
642
646
|
}
|
|
643
647
|
renderDocumentHost(docHost) {
|
|
644
|
-
return (h("igc-document-host-component", { key: docHost.id, size: docHost.size
|
|
648
|
+
return (h("igc-document-host-component", { key: docHost.id, size: docHost.size, ref: el => {
|
|
649
|
+
if (el) {
|
|
650
|
+
this.panesElementMap.set(docHost, el);
|
|
651
|
+
}
|
|
652
|
+
} }, this.renderSplitPane(docHost.rootPane, false, true)));
|
|
645
653
|
}
|
|
646
654
|
renderTabGroup(pane, isFloating, isInDocumentHost) {
|
|
647
655
|
let tabs = pane.type === IgcDockManagerPaneType.tabGroupPane ? pane.panes : [pane];
|
|
@@ -650,8 +658,9 @@ export class IgcDockManager {
|
|
|
650
658
|
pane.selectedIndex : 0;
|
|
651
659
|
const position = isInDocumentHost ? IgcTabHeadersPosition.top : IgcTabHeadersPosition.bottom;
|
|
652
660
|
const isSingleTab = tabs.length === 1 && position === IgcTabHeadersPosition.bottom;
|
|
661
|
+
const allowEmpty = pane.type === IgcDockManagerPaneType.tabGroupPane ? pane.allowEmpty : false;
|
|
653
662
|
const allowMaximize = this.resolveAllowMaximize(pane);
|
|
654
|
-
return tabs.length > 0 && (h("igc-tabs-component", { key: pane.id, size: pane.size, selectedIndex: selectedIndex, hasHeaders: !isSingleTab, onSelectedIndexChanged: this.handleTabSelectedIndexChanged.bind(this, pane), onHiddenTabSelected: this.handleHiddenTabSelected.bind(this, pane), onSelectedTabOutOfView: this.handleSelectedTabOutOfView.bind(this, pane), tabHeadersPosition: position, resourceStrings: this.resourceStrings, ref: el => {
|
|
663
|
+
return (allowEmpty || tabs.length > 0) && (h("igc-tabs-component", { key: pane.id, size: pane.size, selectedIndex: selectedIndex, hasHeaders: !isSingleTab, onSelectedIndexChanged: this.handleTabSelectedIndexChanged.bind(this, pane), onHiddenTabSelected: this.handleHiddenTabSelected.bind(this, pane), onSelectedTabOutOfView: this.handleSelectedTabOutOfView.bind(this, pane), tabHeadersPosition: position, resourceStrings: this.resourceStrings, ref: el => {
|
|
655
664
|
if (el) {
|
|
656
665
|
this.panesElementMap.set(pane, el);
|
|
657
666
|
}
|
|
@@ -698,7 +707,7 @@ export class IgcDockManager {
|
|
|
698
707
|
}
|
|
699
708
|
renderSplitPane(splitPane, isFloating, isInDocumentHost) {
|
|
700
709
|
const panes = this.service.getSplitPaneVisibleChildren(splitPane);
|
|
701
|
-
return panes.length > 0 && (h("igc-split-pane-component", { key: splitPane.id, orientation: splitPane.orientation, size: splitPane.size, ref: el => {
|
|
710
|
+
return (splitPane.allowEmpty || panes.length > 0) && (h("igc-split-pane-component", { key: splitPane.id, orientation: splitPane.orientation, size: splitPane.size, ref: el => {
|
|
702
711
|
if (el) {
|
|
703
712
|
this.panesElementMap.set(splitPane, el);
|
|
704
713
|
}
|
|
@@ -779,7 +788,7 @@ export class IgcDockManager {
|
|
|
779
788
|
this.service.forceDragPane = null;
|
|
780
789
|
forceDrag = true;
|
|
781
790
|
}
|
|
782
|
-
const containsMaximizedPane = this.maximizedPane && this.service.
|
|
791
|
+
const containsMaximizedPane = this.maximizedPane && this.service.getRootParent(this.maximizedPane) === p;
|
|
783
792
|
return (h("igc-floating-pane-component", { key: p.id, style: { zIndex: this.floatingPaneZIndicesMap.get(p).toString() }, floatingLocation: p.floatingLocation ? p.floatingLocation : { x: 0, y: 0 }, floatingWidth: p.floatingWidth ? p.floatingWidth : IGC_DEFAULT_PANE_SIZE, floatingHeight: p.floatingHeight ? p.floatingHeight : IGC_DEFAULT_PANE_SIZE, hasHeader: hasHeader, onWndResizeStart: this.handleFloatingPaneResizeStart.bind(this, p), onWndResizeMove: this.handleFloatingPaneResizeMove.bind(this, p), onWndResizeEnd: this.handleFloatingPaneResizeEnd.bind(this, p), onMouseDown: this.handleFloatingPaneMouseDown.bind(this, p), class: {
|
|
784
793
|
'maximized': this.maximizedPane === p
|
|
785
794
|
}, maximized: this.maximizedPane === p || containsMaximizedPane, allowResize: (_a = p.floatingResizable) !== null && _a !== void 0 ? _a : this.allowFloatingPanesResize },
|