publ-echo-test 0.0.177 → 0.0.179
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.
@@ -1,5 +1,6 @@
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
import { useEffect, useRef, useState } from 'react';
|
3
|
+
import { zIndexMap } from '../GridLayoutEditor/group';
|
3
4
|
var OutsideClickHandler = function (_a) {
|
4
5
|
var children = _a.children, onOutsideClick = _a.onOutsideClick;
|
5
6
|
var wrapperRef = useRef(null);
|
@@ -29,6 +30,9 @@ var OutsideClickHandler = function (_a) {
|
|
29
30
|
var childElement = wrapperRef.current.children[0];
|
30
31
|
// Get computed style of the child element
|
31
32
|
var computedStyle = window.getComputedStyle(childElement);
|
33
|
+
if (childElement.id !== 'BULK') {
|
34
|
+
return;
|
35
|
+
}
|
32
36
|
setChildDimensions({
|
33
37
|
transform: computedStyle.transform,
|
34
38
|
width: computedStyle.width,
|
@@ -40,40 +44,47 @@ var OutsideClickHandler = function (_a) {
|
|
40
44
|
var width = parseFloat(childDimensions.width) || 0;
|
41
45
|
var height = parseFloat(childDimensions.height) || 0;
|
42
46
|
var borderThickness = 3; // 3px border thickness
|
47
|
+
var shadowOffset = 3; // Match the child's shadow (0 0 0 3px #027aff)
|
43
48
|
return (_jsxs(_Fragment, { children: [_jsx("div", { ref: wrapperRef, className: 'outside-click-wrapper', children: children }), width > 0 && height > 0 && (_jsxs(_Fragment, { children: [_jsx("div", { className: "border-top", style: {
|
44
49
|
position: 'absolute',
|
45
50
|
transform: childDimensions.transform,
|
46
|
-
width: "".concat(width, "px"),
|
51
|
+
width: "".concat(width + (shadowOffset * 2), "px"),
|
47
52
|
height: "".concat(borderThickness, "px"),
|
48
|
-
backgroundColor: '
|
53
|
+
backgroundColor: '#027aff',
|
54
|
+
marginLeft: "-".concat(shadowOffset, "px"),
|
55
|
+
marginTop: "-".concat(shadowOffset, "px"),
|
49
56
|
pointerEvents: 'none',
|
50
|
-
zIndex:
|
57
|
+
zIndex: zIndexMap.BULK
|
51
58
|
} }), _jsx("div", { className: "border-right", style: {
|
52
59
|
position: 'absolute',
|
53
60
|
transform: childDimensions.transform,
|
54
61
|
width: "".concat(borderThickness, "px"),
|
55
|
-
height: "".concat(height, "px"),
|
56
|
-
backgroundColor: '
|
57
|
-
marginLeft: "".concat(width - borderThickness, "px"),
|
62
|
+
height: "".concat(height + (shadowOffset * 2), "px"),
|
63
|
+
backgroundColor: '#027aff',
|
64
|
+
marginLeft: "".concat(width + shadowOffset - borderThickness, "px"),
|
65
|
+
marginTop: "-".concat(shadowOffset, "px"),
|
58
66
|
pointerEvents: 'none',
|
59
|
-
zIndex:
|
67
|
+
zIndex: zIndexMap.BULK
|
60
68
|
} }), _jsx("div", { className: "border-bottom", style: {
|
61
69
|
position: 'absolute',
|
62
70
|
transform: childDimensions.transform,
|
63
|
-
width: "".concat(width, "px"),
|
71
|
+
width: "".concat(width + (shadowOffset * 2), "px"),
|
64
72
|
height: "".concat(borderThickness, "px"),
|
65
|
-
backgroundColor: '
|
66
|
-
|
73
|
+
backgroundColor: '#027aff',
|
74
|
+
marginLeft: "-".concat(shadowOffset, "px"),
|
75
|
+
marginTop: "".concat(height + shadowOffset - borderThickness, "px"),
|
67
76
|
pointerEvents: 'none',
|
68
|
-
zIndex:
|
77
|
+
zIndex: zIndexMap.BULK
|
69
78
|
} }), _jsx("div", { className: "border-left", style: {
|
70
79
|
position: 'absolute',
|
71
80
|
transform: childDimensions.transform,
|
72
81
|
width: "".concat(borderThickness, "px"),
|
73
|
-
height: "".concat(height, "px"),
|
74
|
-
backgroundColor: '
|
82
|
+
height: "".concat(height + (shadowOffset * 2), "px"),
|
83
|
+
backgroundColor: '#027aff',
|
84
|
+
marginLeft: "-".concat(shadowOffset, "px"),
|
85
|
+
marginTop: "-".concat(shadowOffset, "px"),
|
75
86
|
pointerEvents: 'none',
|
76
|
-
zIndex:
|
87
|
+
zIndex: zIndexMap.BULK
|
77
88
|
} })] }))] }));
|
78
89
|
};
|
79
90
|
export default OutsideClickHandler;
|