dockview-react 4.2.1 → 4.2.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.
- package/dist/dockview-react.amd.js +72 -20
- package/dist/dockview-react.amd.js.map +1 -1
- package/dist/dockview-react.amd.min.js +2 -2
- package/dist/dockview-react.amd.min.js.map +1 -1
- package/dist/dockview-react.amd.min.noStyle.js +2 -2
- package/dist/dockview-react.amd.min.noStyle.js.map +1 -1
- package/dist/dockview-react.amd.noStyle.js +72 -20
- package/dist/dockview-react.amd.noStyle.js.map +1 -1
- package/dist/dockview-react.cjs.js +72 -20
- package/dist/dockview-react.cjs.js.map +1 -1
- package/dist/dockview-react.esm.js +72 -20
- package/dist/dockview-react.esm.js.map +1 -1
- package/dist/dockview-react.esm.min.js +2 -2
- package/dist/dockview-react.esm.min.js.map +1 -1
- package/dist/dockview-react.js +72 -20
- package/dist/dockview-react.js.map +1 -1
- package/dist/dockview-react.min.js +2 -2
- package/dist/dockview-react.min.js.map +1 -1
- package/dist/dockview-react.min.noStyle.js +2 -2
- package/dist/dockview-react.min.noStyle.js.map +1 -1
- package/dist/dockview-react.noStyle.js +72 -20
- package/dist/dockview-react.noStyle.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-react
|
|
3
|
-
* @version 4.2.
|
|
3
|
+
* @version 4.2.4
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -668,6 +668,44 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
668
668
|
}));
|
|
669
669
|
return disposable;
|
|
670
670
|
}
|
|
671
|
+
function shiftAbsoluteElementIntoView(element, root, options = { buffer: 10 }) {
|
|
672
|
+
const buffer = options.buffer;
|
|
673
|
+
const rect = element.getBoundingClientRect();
|
|
674
|
+
const rootRect = element.getBoundingClientRect();
|
|
675
|
+
const viewportWidth = root.clientWidth;
|
|
676
|
+
const viewportHeight = root.clientHeight;
|
|
677
|
+
let translateX = 0;
|
|
678
|
+
let translateY = 0;
|
|
679
|
+
const left = rect.left - rootRect.left;
|
|
680
|
+
const top = rect.top - rootRect.top;
|
|
681
|
+
const bottom = rect.bottom - rootRect.bottom;
|
|
682
|
+
const right = rect.right - rootRect.right;
|
|
683
|
+
// Check horizontal overflow
|
|
684
|
+
if (left < buffer) {
|
|
685
|
+
translateX = buffer - left;
|
|
686
|
+
}
|
|
687
|
+
else if (right > viewportWidth - buffer) {
|
|
688
|
+
translateX = viewportWidth - right - buffer;
|
|
689
|
+
}
|
|
690
|
+
// Check vertical overflow
|
|
691
|
+
if (top < buffer) {
|
|
692
|
+
translateY = buffer - top;
|
|
693
|
+
}
|
|
694
|
+
else if (bottom > viewportHeight - buffer) {
|
|
695
|
+
translateY = viewportHeight - bottom - buffer;
|
|
696
|
+
}
|
|
697
|
+
// Apply the translation if needed
|
|
698
|
+
if (translateX !== 0 || translateY !== 0) {
|
|
699
|
+
element.style.transform = `translate(${translateX}px, ${translateY}px)`;
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
function findRelativeZIndexParent(el) {
|
|
703
|
+
let tmp = el;
|
|
704
|
+
while (tmp && (tmp.style.zIndex === 'auto' || tmp.style.zIndex === '')) {
|
|
705
|
+
tmp = tmp.parentElement;
|
|
706
|
+
}
|
|
707
|
+
return tmp;
|
|
708
|
+
}
|
|
671
709
|
|
|
672
710
|
function tail(arr) {
|
|
673
711
|
if (arr.length === 0) {
|
|
@@ -5635,7 +5673,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5635
5673
|
toggleClass(wrapper, 'dv-tab', true);
|
|
5636
5674
|
toggleClass(wrapper, 'dv-active-tab', panelObject.api.isActive);
|
|
5637
5675
|
toggleClass(wrapper, 'dv-inactive-tab', !panelObject.api.isActive);
|
|
5638
|
-
wrapper.addEventListener('
|
|
5676
|
+
wrapper.addEventListener('pointerdown', () => {
|
|
5639
5677
|
this.accessor.popupService.close();
|
|
5640
5678
|
tab.element.scrollIntoView();
|
|
5641
5679
|
tab.panel.api.setActive();
|
|
@@ -5643,9 +5681,13 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5643
5681
|
wrapper.appendChild(child);
|
|
5644
5682
|
el.appendChild(wrapper);
|
|
5645
5683
|
}
|
|
5684
|
+
const relativeParent = findRelativeZIndexParent(root);
|
|
5646
5685
|
this.accessor.popupService.openPopover(el, {
|
|
5647
5686
|
x: event.clientX,
|
|
5648
5687
|
y: event.clientY,
|
|
5688
|
+
zIndex: (relativeParent === null || relativeParent === void 0 ? void 0 : relativeParent.style.zIndex)
|
|
5689
|
+
? `calc(${relativeParent.style.zIndex} * 2)`
|
|
5690
|
+
: undefined,
|
|
5649
5691
|
});
|
|
5650
5692
|
}));
|
|
5651
5693
|
}
|
|
@@ -7987,10 +8029,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7987
8029
|
}), this._activeDisposable);
|
|
7988
8030
|
}
|
|
7989
8031
|
openPopover(element, position) {
|
|
8032
|
+
var _a;
|
|
7990
8033
|
this.close();
|
|
7991
8034
|
const wrapper = document.createElement('div');
|
|
7992
8035
|
wrapper.style.position = 'absolute';
|
|
7993
|
-
wrapper.style.zIndex = '
|
|
8036
|
+
wrapper.style.zIndex = (_a = position.zIndex) !== null && _a !== void 0 ? _a : 'var(--dv-overlay-z-index)';
|
|
7994
8037
|
wrapper.appendChild(element);
|
|
7995
8038
|
const anchorBox = this._element.getBoundingClientRect();
|
|
7996
8039
|
const offsetX = anchorBox.left;
|
|
@@ -8014,6 +8057,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8014
8057
|
}
|
|
8015
8058
|
this.close();
|
|
8016
8059
|
}));
|
|
8060
|
+
requestAnimationFrame(() => {
|
|
8061
|
+
shiftAbsoluteElementIntoView(wrapper, this.root);
|
|
8062
|
+
});
|
|
8017
8063
|
}
|
|
8018
8064
|
close() {
|
|
8019
8065
|
if (this._active) {
|
|
@@ -9547,24 +9593,26 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9547
9593
|
selectedPopoutGroup.disposable.dispose();
|
|
9548
9594
|
}
|
|
9549
9595
|
}
|
|
9550
|
-
|
|
9551
|
-
|
|
9552
|
-
|
|
9553
|
-
|
|
9554
|
-
|
|
9555
|
-
|
|
9556
|
-
|
|
9557
|
-
|
|
9558
|
-
|
|
9559
|
-
|
|
9560
|
-
|
|
9561
|
-
|
|
9562
|
-
|
|
9563
|
-
|
|
9564
|
-
|
|
9565
|
-
|
|
9596
|
+
if (from.api.location.type !== 'popout') {
|
|
9597
|
+
const referenceLocation = getGridLocation(to.element);
|
|
9598
|
+
const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, target);
|
|
9599
|
+
let size;
|
|
9600
|
+
switch (this.gridview.orientation) {
|
|
9601
|
+
case exports.Orientation.VERTICAL:
|
|
9602
|
+
size =
|
|
9603
|
+
referenceLocation.length % 2 == 0
|
|
9604
|
+
? from.api.width
|
|
9605
|
+
: from.api.height;
|
|
9606
|
+
break;
|
|
9607
|
+
case exports.Orientation.HORIZONTAL:
|
|
9608
|
+
size =
|
|
9609
|
+
referenceLocation.length % 2 == 0
|
|
9610
|
+
? from.api.height
|
|
9611
|
+
: from.api.width;
|
|
9612
|
+
break;
|
|
9613
|
+
}
|
|
9614
|
+
this.gridview.addView(from, size, dropLocation);
|
|
9566
9615
|
}
|
|
9567
|
-
this.gridview.addView(from, size, dropLocation);
|
|
9568
9616
|
}
|
|
9569
9617
|
from.panels.forEach((panel) => {
|
|
9570
9618
|
this._onDidMovePanel.fire({ panel, from });
|
|
@@ -11141,6 +11189,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
11141
11189
|
}
|
|
11142
11190
|
dockviewRef.current = api;
|
|
11143
11191
|
return () => {
|
|
11192
|
+
dockviewRef.current = undefined;
|
|
11144
11193
|
api.dispose();
|
|
11145
11194
|
};
|
|
11146
11195
|
}, []);
|
|
@@ -11376,6 +11425,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
11376
11425
|
}
|
|
11377
11426
|
splitviewRef.current = api;
|
|
11378
11427
|
return () => {
|
|
11428
|
+
splitviewRef.current = undefined;
|
|
11379
11429
|
api.dispose();
|
|
11380
11430
|
};
|
|
11381
11431
|
}, []);
|
|
@@ -11459,6 +11509,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
11459
11509
|
}
|
|
11460
11510
|
gridviewRef.current = api;
|
|
11461
11511
|
return () => {
|
|
11512
|
+
gridviewRef.current = undefined;
|
|
11462
11513
|
api.dispose();
|
|
11463
11514
|
};
|
|
11464
11515
|
}, []);
|
|
@@ -11564,6 +11615,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
11564
11615
|
}
|
|
11565
11616
|
paneviewRef.current = api;
|
|
11566
11617
|
return () => {
|
|
11618
|
+
paneviewRef.current = undefined;
|
|
11567
11619
|
api.dispose();
|
|
11568
11620
|
};
|
|
11569
11621
|
}, []);
|