dockview-core 4.2.3 → 4.2.5
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/dist/cjs/dnd/ghost.js +2 -0
- package/dist/cjs/dockview/components/popupService.d.ts +1 -0
- package/dist/cjs/dockview/components/popupService.js +6 -1
- package/dist/cjs/dockview/components/titlebar/tabsContainer.js +5 -1
- package/dist/cjs/dockview/dockviewComponent.js +19 -17
- package/dist/cjs/dom.d.ts +4 -0
- package/dist/cjs/dom.js +40 -1
- package/dist/dockview-core.amd.js +68 -20
- package/dist/dockview-core.amd.js.map +1 -1
- package/dist/dockview-core.amd.min.js +2 -2
- package/dist/dockview-core.amd.min.js.map +1 -1
- package/dist/dockview-core.amd.min.noStyle.js +2 -2
- package/dist/dockview-core.amd.min.noStyle.js.map +1 -1
- package/dist/dockview-core.amd.noStyle.js +68 -20
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +68 -20
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +68 -20
- package/dist/dockview-core.esm.js.map +1 -1
- package/dist/dockview-core.esm.min.js +2 -2
- package/dist/dockview-core.esm.min.js.map +1 -1
- package/dist/dockview-core.js +68 -20
- package/dist/dockview-core.js.map +1 -1
- package/dist/dockview-core.min.js +2 -2
- package/dist/dockview-core.min.js.map +1 -1
- package/dist/dockview-core.min.noStyle.js +2 -2
- package/dist/dockview-core.min.noStyle.js.map +1 -1
- package/dist/dockview-core.noStyle.js +68 -20
- package/dist/dockview-core.noStyle.js.map +1 -1
- package/dist/esm/dnd/ghost.js +2 -0
- package/dist/esm/dockview/components/popupService.d.ts +1 -0
- package/dist/esm/dockview/components/popupService.js +6 -1
- package/dist/esm/dockview/components/titlebar/tabsContainer.js +6 -2
- package/dist/esm/dockview/dockviewComponent.js +19 -17
- package/dist/esm/dom.d.ts +4 -0
- package/dist/esm/dom.js +36 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-core
|
|
3
|
-
* @version 4.2.
|
|
3
|
+
* @version 4.2.5
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -642,6 +642,42 @@
|
|
|
642
642
|
}));
|
|
643
643
|
return disposable;
|
|
644
644
|
}
|
|
645
|
+
function shiftAbsoluteElementIntoView(element, root, options = { buffer: 10 }) {
|
|
646
|
+
const buffer = options.buffer;
|
|
647
|
+
const rect = element.getBoundingClientRect();
|
|
648
|
+
const rootRect = root.getBoundingClientRect();
|
|
649
|
+
let translateX = 0;
|
|
650
|
+
let translateY = 0;
|
|
651
|
+
const left = rect.left - rootRect.left;
|
|
652
|
+
const top = rect.top - rootRect.top;
|
|
653
|
+
const bottom = rect.bottom - rootRect.bottom;
|
|
654
|
+
const right = rect.right - rootRect.right;
|
|
655
|
+
// Check horizontal overflow
|
|
656
|
+
if (left < buffer) {
|
|
657
|
+
translateX = buffer - left;
|
|
658
|
+
}
|
|
659
|
+
else if (right > buffer) {
|
|
660
|
+
translateX = -buffer - right;
|
|
661
|
+
}
|
|
662
|
+
// Check vertical overflow
|
|
663
|
+
if (top < buffer) {
|
|
664
|
+
translateY = buffer - top;
|
|
665
|
+
}
|
|
666
|
+
else if (bottom > buffer) {
|
|
667
|
+
translateY = -bottom - buffer;
|
|
668
|
+
}
|
|
669
|
+
// Apply the translation if needed
|
|
670
|
+
if (translateX !== 0 || translateY !== 0) {
|
|
671
|
+
element.style.transform = `translate(${translateX}px, ${translateY}px)`;
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
function findRelativeZIndexParent(el) {
|
|
675
|
+
let tmp = el;
|
|
676
|
+
while (tmp && (tmp.style.zIndex === 'auto' || tmp.style.zIndex === '')) {
|
|
677
|
+
tmp = tmp.parentElement;
|
|
678
|
+
}
|
|
679
|
+
return tmp;
|
|
680
|
+
}
|
|
645
681
|
|
|
646
682
|
function tail(arr) {
|
|
647
683
|
if (arr.length === 0) {
|
|
@@ -4909,6 +4945,8 @@
|
|
|
4909
4945
|
var _a, _b;
|
|
4910
4946
|
// class dockview provides to force ghost image to be drawn on a different layer and prevent weird rendering issues
|
|
4911
4947
|
addClasses(ghostElement, 'dv-dragged');
|
|
4948
|
+
// move the element off-screen initially otherwise it may in some cases be rendered at (0,0) momentarily
|
|
4949
|
+
ghostElement.style.top = '-9999px';
|
|
4912
4950
|
document.body.appendChild(ghostElement);
|
|
4913
4951
|
dataTransfer.setDragImage(ghostElement, (_a = options === null || options === void 0 ? void 0 : options.x) !== null && _a !== void 0 ? _a : 0, (_b = options === null || options === void 0 ? void 0 : options.y) !== null && _b !== void 0 ? _b : 0);
|
|
4914
4952
|
setTimeout(() => {
|
|
@@ -5609,7 +5647,7 @@
|
|
|
5609
5647
|
toggleClass(wrapper, 'dv-tab', true);
|
|
5610
5648
|
toggleClass(wrapper, 'dv-active-tab', panelObject.api.isActive);
|
|
5611
5649
|
toggleClass(wrapper, 'dv-inactive-tab', !panelObject.api.isActive);
|
|
5612
|
-
wrapper.addEventListener('
|
|
5650
|
+
wrapper.addEventListener('pointerdown', () => {
|
|
5613
5651
|
this.accessor.popupService.close();
|
|
5614
5652
|
tab.element.scrollIntoView();
|
|
5615
5653
|
tab.panel.api.setActive();
|
|
@@ -5617,9 +5655,13 @@
|
|
|
5617
5655
|
wrapper.appendChild(child);
|
|
5618
5656
|
el.appendChild(wrapper);
|
|
5619
5657
|
}
|
|
5658
|
+
const relativeParent = findRelativeZIndexParent(root);
|
|
5620
5659
|
this.accessor.popupService.openPopover(el, {
|
|
5621
5660
|
x: event.clientX,
|
|
5622
5661
|
y: event.clientY,
|
|
5662
|
+
zIndex: (relativeParent === null || relativeParent === void 0 ? void 0 : relativeParent.style.zIndex)
|
|
5663
|
+
? `calc(${relativeParent.style.zIndex} * 2)`
|
|
5664
|
+
: undefined,
|
|
5623
5665
|
});
|
|
5624
5666
|
}));
|
|
5625
5667
|
}
|
|
@@ -7984,10 +8026,11 @@
|
|
|
7984
8026
|
}), this._activeDisposable);
|
|
7985
8027
|
}
|
|
7986
8028
|
openPopover(element, position) {
|
|
8029
|
+
var _a;
|
|
7987
8030
|
this.close();
|
|
7988
8031
|
const wrapper = document.createElement('div');
|
|
7989
8032
|
wrapper.style.position = 'absolute';
|
|
7990
|
-
wrapper.style.zIndex = '
|
|
8033
|
+
wrapper.style.zIndex = (_a = position.zIndex) !== null && _a !== void 0 ? _a : 'var(--dv-overlay-z-index)';
|
|
7991
8034
|
wrapper.appendChild(element);
|
|
7992
8035
|
const anchorBox = this._element.getBoundingClientRect();
|
|
7993
8036
|
const offsetX = anchorBox.left;
|
|
@@ -8011,6 +8054,9 @@
|
|
|
8011
8054
|
}
|
|
8012
8055
|
this.close();
|
|
8013
8056
|
}));
|
|
8057
|
+
requestAnimationFrame(() => {
|
|
8058
|
+
shiftAbsoluteElementIntoView(wrapper, this.root);
|
|
8059
|
+
});
|
|
8014
8060
|
}
|
|
8015
8061
|
close() {
|
|
8016
8062
|
if (this._active) {
|
|
@@ -9544,24 +9590,26 @@
|
|
|
9544
9590
|
selectedPopoutGroup.disposable.dispose();
|
|
9545
9591
|
}
|
|
9546
9592
|
}
|
|
9547
|
-
|
|
9548
|
-
|
|
9549
|
-
|
|
9550
|
-
|
|
9551
|
-
|
|
9552
|
-
|
|
9553
|
-
|
|
9554
|
-
|
|
9555
|
-
|
|
9556
|
-
|
|
9557
|
-
|
|
9558
|
-
|
|
9559
|
-
|
|
9560
|
-
|
|
9561
|
-
|
|
9562
|
-
|
|
9593
|
+
if (from.api.location.type !== 'popout') {
|
|
9594
|
+
const referenceLocation = getGridLocation(to.element);
|
|
9595
|
+
const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, target);
|
|
9596
|
+
let size;
|
|
9597
|
+
switch (this.gridview.orientation) {
|
|
9598
|
+
case exports.Orientation.VERTICAL:
|
|
9599
|
+
size =
|
|
9600
|
+
referenceLocation.length % 2 == 0
|
|
9601
|
+
? from.api.width
|
|
9602
|
+
: from.api.height;
|
|
9603
|
+
break;
|
|
9604
|
+
case exports.Orientation.HORIZONTAL:
|
|
9605
|
+
size =
|
|
9606
|
+
referenceLocation.length % 2 == 0
|
|
9607
|
+
? from.api.height
|
|
9608
|
+
: from.api.width;
|
|
9609
|
+
break;
|
|
9610
|
+
}
|
|
9611
|
+
this.gridview.addView(from, size, dropLocation);
|
|
9563
9612
|
}
|
|
9564
|
-
this.gridview.addView(from, size, dropLocation);
|
|
9565
9613
|
}
|
|
9566
9614
|
from.panels.forEach((panel) => {
|
|
9567
9615
|
this._onDidMovePanel.fire({ panel, from });
|