@cyber-harbour/ui 1.0.38 → 1.0.40
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/index.js +51 -49
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -23
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/Core/Button/Button.tsx +2 -0
- package/src/Graph2D/Graph2D.tsx +20 -23
package/package.json
CHANGED
|
@@ -50,6 +50,7 @@ const ButtonTextContainer = styled.div`
|
|
|
50
50
|
text-overflow: ellipsis;
|
|
51
51
|
overflow: hidden;
|
|
52
52
|
white-space: nowrap;
|
|
53
|
+
user-select: text;
|
|
53
54
|
`;
|
|
54
55
|
|
|
55
56
|
const StyledIconWrapper = styled.span`
|
|
@@ -94,6 +95,7 @@ const StyledButton = styled(createComponent('button'))<{
|
|
|
94
95
|
text-decoration: none;
|
|
95
96
|
transition: all 0.2s ease;
|
|
96
97
|
outline: none;
|
|
98
|
+
user-select: text;
|
|
97
99
|
|
|
98
100
|
${$iconPosition === 'right' ? 'flex-direction: row-reverse;' : ''}
|
|
99
101
|
|
package/src/Graph2D/Graph2D.tsx
CHANGED
|
@@ -126,32 +126,29 @@ export const Graph2D = ({
|
|
|
126
126
|
setHighlightLinks(newHighlightLinks);
|
|
127
127
|
};
|
|
128
128
|
|
|
129
|
-
const handleEngineTick =
|
|
130
|
-
if (isRendering)
|
|
131
|
-
if (
|
|
132
|
-
graphData &&
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
graphData.nodes.length <= fgRef.current.tick
|
|
137
|
-
) {
|
|
138
|
-
if (tickTimerRef.current) {
|
|
139
|
-
clearTimeout(tickTimerRef.current);
|
|
140
|
-
}
|
|
141
|
-
fgRef.current.zoomToFit(0, 20);
|
|
142
|
-
setIsRendering(false);
|
|
143
|
-
} else {
|
|
144
|
-
fgRef.current.tick = fgRef.current.tick ? (fgRef.current.tick = fgRef.current.tick + 1) : 1;
|
|
145
|
-
if (tickTimerRef.current) {
|
|
146
|
-
clearTimeout(tickTimerRef.current);
|
|
147
|
-
}
|
|
148
|
-
tickTimerRef.current = setTimeout(() => {
|
|
149
|
-
//force tick check
|
|
129
|
+
const handleEngineTick = () => {
|
|
130
|
+
if (isRendering) {
|
|
131
|
+
if (fgRef.current && graphData) {
|
|
132
|
+
if (fgRef.current.tick && graphData.nodes.length > 0 && graphData.nodes.length <= fgRef.current.tick) {
|
|
133
|
+
if (tickTimerRef.current) {
|
|
134
|
+
clearTimeout(tickTimerRef.current);
|
|
135
|
+
}
|
|
150
136
|
fgRef.current.zoomToFit(0, 20);
|
|
151
137
|
setIsRendering(false);
|
|
152
|
-
}
|
|
138
|
+
} else {
|
|
139
|
+
fgRef.current.tick = fgRef.current.tick ? (fgRef.current.tick = fgRef.current.tick + 1) : 1;
|
|
140
|
+
if (tickTimerRef.current) {
|
|
141
|
+
clearTimeout(tickTimerRef.current);
|
|
142
|
+
}
|
|
143
|
+
tickTimerRef.current = setTimeout(() => {
|
|
144
|
+
//force tick check
|
|
145
|
+
fgRef.current.zoomToFit(0, 20);
|
|
146
|
+
setIsRendering(false);
|
|
147
|
+
}, 1500);
|
|
148
|
+
}
|
|
153
149
|
}
|
|
154
|
-
|
|
150
|
+
}
|
|
151
|
+
};
|
|
155
152
|
|
|
156
153
|
// Створення взаємозв'язків між вузлами
|
|
157
154
|
useEffect(() => {
|