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
package/dist/dockview-react.js
CHANGED
|
@@ -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
|
*/
|
|
@@ -672,6 +672,44 @@
|
|
|
672
672
|
}));
|
|
673
673
|
return disposable;
|
|
674
674
|
}
|
|
675
|
+
function shiftAbsoluteElementIntoView(element, root, options = { buffer: 10 }) {
|
|
676
|
+
const buffer = options.buffer;
|
|
677
|
+
const rect = element.getBoundingClientRect();
|
|
678
|
+
const rootRect = element.getBoundingClientRect();
|
|
679
|
+
const viewportWidth = root.clientWidth;
|
|
680
|
+
const viewportHeight = root.clientHeight;
|
|
681
|
+
let translateX = 0;
|
|
682
|
+
let translateY = 0;
|
|
683
|
+
const left = rect.left - rootRect.left;
|
|
684
|
+
const top = rect.top - rootRect.top;
|
|
685
|
+
const bottom = rect.bottom - rootRect.bottom;
|
|
686
|
+
const right = rect.right - rootRect.right;
|
|
687
|
+
// Check horizontal overflow
|
|
688
|
+
if (left < buffer) {
|
|
689
|
+
translateX = buffer - left;
|
|
690
|
+
}
|
|
691
|
+
else if (right > viewportWidth - buffer) {
|
|
692
|
+
translateX = viewportWidth - right - buffer;
|
|
693
|
+
}
|
|
694
|
+
// Check vertical overflow
|
|
695
|
+
if (top < buffer) {
|
|
696
|
+
translateY = buffer - top;
|
|
697
|
+
}
|
|
698
|
+
else if (bottom > viewportHeight - buffer) {
|
|
699
|
+
translateY = viewportHeight - bottom - buffer;
|
|
700
|
+
}
|
|
701
|
+
// Apply the translation if needed
|
|
702
|
+
if (translateX !== 0 || translateY !== 0) {
|
|
703
|
+
element.style.transform = `translate(${translateX}px, ${translateY}px)`;
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
function findRelativeZIndexParent(el) {
|
|
707
|
+
let tmp = el;
|
|
708
|
+
while (tmp && (tmp.style.zIndex === 'auto' || tmp.style.zIndex === '')) {
|
|
709
|
+
tmp = tmp.parentElement;
|
|
710
|
+
}
|
|
711
|
+
return tmp;
|
|
712
|
+
}
|
|
675
713
|
|
|
676
714
|
function tail(arr) {
|
|
677
715
|
if (arr.length === 0) {
|
|
@@ -5639,7 +5677,7 @@
|
|
|
5639
5677
|
toggleClass(wrapper, 'dv-tab', true);
|
|
5640
5678
|
toggleClass(wrapper, 'dv-active-tab', panelObject.api.isActive);
|
|
5641
5679
|
toggleClass(wrapper, 'dv-inactive-tab', !panelObject.api.isActive);
|
|
5642
|
-
wrapper.addEventListener('
|
|
5680
|
+
wrapper.addEventListener('pointerdown', () => {
|
|
5643
5681
|
this.accessor.popupService.close();
|
|
5644
5682
|
tab.element.scrollIntoView();
|
|
5645
5683
|
tab.panel.api.setActive();
|
|
@@ -5647,9 +5685,13 @@
|
|
|
5647
5685
|
wrapper.appendChild(child);
|
|
5648
5686
|
el.appendChild(wrapper);
|
|
5649
5687
|
}
|
|
5688
|
+
const relativeParent = findRelativeZIndexParent(root);
|
|
5650
5689
|
this.accessor.popupService.openPopover(el, {
|
|
5651
5690
|
x: event.clientX,
|
|
5652
5691
|
y: event.clientY,
|
|
5692
|
+
zIndex: (relativeParent === null || relativeParent === void 0 ? void 0 : relativeParent.style.zIndex)
|
|
5693
|
+
? `calc(${relativeParent.style.zIndex} * 2)`
|
|
5694
|
+
: undefined,
|
|
5653
5695
|
});
|
|
5654
5696
|
}));
|
|
5655
5697
|
}
|
|
@@ -7991,10 +8033,11 @@
|
|
|
7991
8033
|
}), this._activeDisposable);
|
|
7992
8034
|
}
|
|
7993
8035
|
openPopover(element, position) {
|
|
8036
|
+
var _a;
|
|
7994
8037
|
this.close();
|
|
7995
8038
|
const wrapper = document.createElement('div');
|
|
7996
8039
|
wrapper.style.position = 'absolute';
|
|
7997
|
-
wrapper.style.zIndex = '
|
|
8040
|
+
wrapper.style.zIndex = (_a = position.zIndex) !== null && _a !== void 0 ? _a : 'var(--dv-overlay-z-index)';
|
|
7998
8041
|
wrapper.appendChild(element);
|
|
7999
8042
|
const anchorBox = this._element.getBoundingClientRect();
|
|
8000
8043
|
const offsetX = anchorBox.left;
|
|
@@ -8018,6 +8061,9 @@
|
|
|
8018
8061
|
}
|
|
8019
8062
|
this.close();
|
|
8020
8063
|
}));
|
|
8064
|
+
requestAnimationFrame(() => {
|
|
8065
|
+
shiftAbsoluteElementIntoView(wrapper, this.root);
|
|
8066
|
+
});
|
|
8021
8067
|
}
|
|
8022
8068
|
close() {
|
|
8023
8069
|
if (this._active) {
|
|
@@ -9551,24 +9597,26 @@
|
|
|
9551
9597
|
selectedPopoutGroup.disposable.dispose();
|
|
9552
9598
|
}
|
|
9553
9599
|
}
|
|
9554
|
-
|
|
9555
|
-
|
|
9556
|
-
|
|
9557
|
-
|
|
9558
|
-
|
|
9559
|
-
|
|
9560
|
-
|
|
9561
|
-
|
|
9562
|
-
|
|
9563
|
-
|
|
9564
|
-
|
|
9565
|
-
|
|
9566
|
-
|
|
9567
|
-
|
|
9568
|
-
|
|
9569
|
-
|
|
9600
|
+
if (from.api.location.type !== 'popout') {
|
|
9601
|
+
const referenceLocation = getGridLocation(to.element);
|
|
9602
|
+
const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, target);
|
|
9603
|
+
let size;
|
|
9604
|
+
switch (this.gridview.orientation) {
|
|
9605
|
+
case exports.Orientation.VERTICAL:
|
|
9606
|
+
size =
|
|
9607
|
+
referenceLocation.length % 2 == 0
|
|
9608
|
+
? from.api.width
|
|
9609
|
+
: from.api.height;
|
|
9610
|
+
break;
|
|
9611
|
+
case exports.Orientation.HORIZONTAL:
|
|
9612
|
+
size =
|
|
9613
|
+
referenceLocation.length % 2 == 0
|
|
9614
|
+
? from.api.height
|
|
9615
|
+
: from.api.width;
|
|
9616
|
+
break;
|
|
9617
|
+
}
|
|
9618
|
+
this.gridview.addView(from, size, dropLocation);
|
|
9570
9619
|
}
|
|
9571
|
-
this.gridview.addView(from, size, dropLocation);
|
|
9572
9620
|
}
|
|
9573
9621
|
from.panels.forEach((panel) => {
|
|
9574
9622
|
this._onDidMovePanel.fire({ panel, from });
|
|
@@ -11145,6 +11193,7 @@
|
|
|
11145
11193
|
}
|
|
11146
11194
|
dockviewRef.current = api;
|
|
11147
11195
|
return () => {
|
|
11196
|
+
dockviewRef.current = undefined;
|
|
11148
11197
|
api.dispose();
|
|
11149
11198
|
};
|
|
11150
11199
|
}, []);
|
|
@@ -11380,6 +11429,7 @@
|
|
|
11380
11429
|
}
|
|
11381
11430
|
splitviewRef.current = api;
|
|
11382
11431
|
return () => {
|
|
11432
|
+
splitviewRef.current = undefined;
|
|
11383
11433
|
api.dispose();
|
|
11384
11434
|
};
|
|
11385
11435
|
}, []);
|
|
@@ -11463,6 +11513,7 @@
|
|
|
11463
11513
|
}
|
|
11464
11514
|
gridviewRef.current = api;
|
|
11465
11515
|
return () => {
|
|
11516
|
+
gridviewRef.current = undefined;
|
|
11466
11517
|
api.dispose();
|
|
11467
11518
|
};
|
|
11468
11519
|
}, []);
|
|
@@ -11568,6 +11619,7 @@
|
|
|
11568
11619
|
}
|
|
11569
11620
|
paneviewRef.current = api;
|
|
11570
11621
|
return () => {
|
|
11622
|
+
paneviewRef.current = undefined;
|
|
11571
11623
|
api.dispose();
|
|
11572
11624
|
};
|
|
11573
11625
|
}, []);
|