@eccenca/gui-elements 26.0.0-rc.1 → 26.0.0
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/CHANGELOG.md +19 -3
- package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js +1 -1
- package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
- package/dist/cjs/cmem/react-flow/configuration/linking.js +1 -0
- package/dist/cjs/cmem/react-flow/configuration/linking.js.map +1 -1
- package/dist/cjs/cmem/react-flow/configuration/typing.js +1 -0
- package/dist/cjs/cmem/react-flow/configuration/typing.js.map +1 -1
- package/dist/cjs/common/Intent/index.js +4 -2
- package/dist/cjs/common/Intent/index.js.map +1 -1
- package/dist/cjs/common/index.js +3 -1
- package/dist/cjs/common/index.js.map +1 -1
- package/dist/cjs/components/Button/Button.js +2 -1
- package/dist/cjs/components/Button/Button.js.map +1 -1
- package/dist/cjs/components/Icon/canonicalIconNames.js +2 -0
- package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/cjs/components/Menu/MenuItem.js +6 -2
- package/dist/cjs/components/Menu/MenuItem.js.map +1 -1
- package/dist/cjs/components/MultiSelect/MultiSelect.js +7 -1
- package/dist/cjs/components/MultiSelect/MultiSelect.js.map +1 -1
- package/dist/cjs/components/ProgressBar/ProgressBar.js +25 -2
- package/dist/cjs/components/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/cjs/components/TextField/TextArea.js +1 -1
- package/dist/cjs/components/TextField/TextArea.js.map +1 -1
- package/dist/cjs/components/TextField/TextField.js +1 -1
- package/dist/cjs/components/TextField/TextField.js.map +1 -1
- package/dist/cjs/components/Tooltip/Tooltip.js +7 -5
- package/dist/cjs/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/cjs/extensions/react-flow/handles/HandleContent.js +2 -2
- package/dist/cjs/extensions/react-flow/handles/HandleContent.js.map +1 -1
- package/dist/cjs/extensions/react-flow/handles/HandleDefault.js +16 -6
- package/dist/cjs/extensions/react-flow/handles/HandleDefault.js.map +1 -1
- package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js +1 -1
- package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
- package/dist/esm/cmem/react-flow/configuration/linking.js +1 -0
- package/dist/esm/cmem/react-flow/configuration/linking.js.map +1 -1
- package/dist/esm/cmem/react-flow/configuration/typing.js +1 -0
- package/dist/esm/cmem/react-flow/configuration/typing.js.map +1 -1
- package/dist/esm/common/Intent/index.js +3 -1
- package/dist/esm/common/Intent/index.js.map +1 -1
- package/dist/esm/common/index.js +1 -0
- package/dist/esm/common/index.js.map +1 -1
- package/dist/esm/components/Button/Button.js +3 -2
- package/dist/esm/components/Button/Button.js.map +1 -1
- package/dist/esm/components/Icon/canonicalIconNames.js +2 -0
- package/dist/esm/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/esm/components/Menu/MenuItem.js +8 -3
- package/dist/esm/components/Menu/MenuItem.js.map +1 -1
- package/dist/esm/components/MultiSelect/MultiSelect.js +12 -8
- package/dist/esm/components/MultiSelect/MultiSelect.js.map +1 -1
- package/dist/esm/components/ProgressBar/ProgressBar.js +33 -2
- package/dist/esm/components/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/esm/components/TextField/TextArea.js +1 -1
- package/dist/esm/components/TextField/TextArea.js.map +1 -1
- package/dist/esm/components/TextField/TextField.js +1 -1
- package/dist/esm/components/TextField/TextField.js.map +1 -1
- package/dist/esm/components/Tooltip/Tooltip.js +10 -7
- package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleContent.js +2 -2
- package/dist/esm/extensions/react-flow/handles/HandleContent.js.map +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleDefault.js +17 -7
- package/dist/esm/extensions/react-flow/handles/HandleDefault.js.map +1 -1
- package/dist/types/cmem/ActivityControl/ActivityControlWidget.d.ts +1 -0
- package/dist/types/cmem/react-flow/configuration/typing.d.ts +1 -0
- package/dist/types/common/Intent/index.d.ts +9 -1
- package/dist/types/common/index.d.ts +1 -0
- package/dist/types/components/Button/Button.d.ts +3 -2
- package/dist/types/components/Icon/canonicalIconNames.d.ts +2 -0
- package/dist/types/components/Menu/MenuItem.d.ts +9 -2
- package/dist/types/components/MultiSelect/MultiSelect.d.ts +3 -2
- package/dist/types/components/ProgressBar/ProgressBar.d.ts +9 -2
- package/dist/types/components/Tooltip/Tooltip.d.ts +7 -2
- package/package.json +3 -2
- package/src/cmem/ActivityControl/ActivityControlWidget.tsx +11 -0
- package/src/cmem/ActivityControl/tests/ActivityControlWidget.test.tsx +21 -0
- package/src/cmem/react-flow/ReactFlow/ReactFlow.stories.tsx +11 -1
- package/src/cmem/react-flow/_handles.scss +1 -0
- package/src/cmem/react-flow/_minimap.scss +1 -0
- package/src/cmem/react-flow/configuration/_colors-linking.scss +2 -0
- package/src/cmem/react-flow/configuration/linking.ts +1 -0
- package/src/cmem/react-flow/configuration/typing.ts +1 -0
- package/src/cmem/react-flow/nodes/_colors.scss +1 -0
- package/src/common/Intent/index.ts +4 -2
- package/src/common/index.ts +1 -0
- package/src/components/Button/Button.tsx +4 -4
- package/src/components/Form/form.scss +14 -2
- package/src/components/Icon/canonicalIconNames.tsx +2 -0
- package/src/components/Menu/MenuItem.test.tsx +25 -0
- package/src/components/Menu/MenuItem.tsx +18 -5
- package/src/components/Menu/Stories/MenuItem.stories.tsx +5 -0
- package/src/components/Menu/menu.scss +48 -0
- package/src/components/MultiSelect/MultiSelect.tsx +8 -4
- package/src/components/MultiSuggestField/MultiSuggestField.stories.tsx +1 -1
- package/src/components/MultiSuggestField/_multisuggestfield.scss +8 -0
- package/src/components/ProgressBar/ProgressBar.test.tsx +28 -0
- package/src/components/ProgressBar/ProgressBar.tsx +23 -3
- package/src/components/ProgressBar/Stories/ProgressBar.stories.tsx +1 -1
- package/src/components/ProgressBar/progressbar.scss +20 -0
- package/src/components/TextField/TextArea.tsx +3 -4
- package/src/components/TextField/TextField.tsx +3 -4
- package/src/components/TextField/textfield.scss +46 -14
- package/src/components/Tooltip/Tooltip.stories.tsx +7 -1
- package/src/components/Tooltip/Tooltip.test.tsx +16 -0
- package/src/components/Tooltip/Tooltip.tsx +19 -4
- package/src/components/Tooltip/tooltip.scss +21 -0
- package/src/components/index.scss +1 -0
- package/src/extensions/react-flow/handles/HandleContent.tsx +2 -1
- package/src/extensions/react-flow/handles/HandleDefault.tsx +23 -21
- package/src/extensions/react-flow/handles/_handles.scss +8 -1
- package/src/extensions/react-flow/handles/tests/HandleDefault.test.tsx +60 -0
- package/src/includes/blueprintjs/_components.scss +0 -1
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React, { memo } from "react";
|
|
2
2
|
import { Handle as HandleV9, HandleProps as ReactFlowHandleV9Props } from "react-flow-renderer";
|
|
3
3
|
import { Classes as BlueprintClasses } from "@blueprintjs/core";
|
|
4
|
-
import { Intent } from "@blueprintjs/core/src/common/intent";
|
|
5
4
|
import { Handle as HandleV12, HandleProps as ReactFlowHandleV12Props } from "@xyflow/react";
|
|
6
5
|
|
|
7
|
-
import { intentClassName, IntentTypes } from "../../../common/Intent";
|
|
6
|
+
import { intentClassName, IntentTypes, IntentBlueprint } from "../../../common/Intent";
|
|
8
7
|
import { TooltipProps } from "../../../components";
|
|
9
8
|
import { CLASSPREFIX as eccgui } from "../../../configuration/constants";
|
|
10
9
|
import { ReacFlowVersionSupportProps, useReactFlowVersion } from "../versionsupport";
|
|
@@ -80,30 +79,24 @@ export const HandleDefault = memo(
|
|
|
80
79
|
offset: {
|
|
81
80
|
enabled: true,
|
|
82
81
|
options: {
|
|
83
|
-
offset: [
|
|
82
|
+
offset: [0, 20],
|
|
84
83
|
},
|
|
85
84
|
},
|
|
86
85
|
},
|
|
87
|
-
intent: intent as
|
|
86
|
+
intent: intent as IntentBlueprint,
|
|
88
87
|
className: `${eccgui}-graphviz__handle__tooltip-target`,
|
|
89
88
|
isOpen: extendedTooltipDisplayed,
|
|
90
89
|
};
|
|
91
90
|
|
|
92
|
-
const handleContentProps =
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}),
|
|
100
|
-
[intent, category, handleProps.isConnectable],
|
|
101
|
-
);
|
|
91
|
+
const handleContentProps = {
|
|
92
|
+
...data,
|
|
93
|
+
tooltipProps: {
|
|
94
|
+
...handleContentTooltipProps,
|
|
95
|
+
...data?.tooltipProps,
|
|
96
|
+
} as TooltipProps,
|
|
97
|
+
};
|
|
102
98
|
|
|
103
|
-
const handleContent =
|
|
104
|
-
() => <HandleContent {...handleContentProps}>{children}</HandleContent>,
|
|
105
|
-
[],
|
|
106
|
-
);
|
|
99
|
+
const handleContent = <HandleContent {...handleContentProps}>{children}</HandleContent>;
|
|
107
100
|
|
|
108
101
|
let switchTooltipTimerOn: ReturnType<typeof setTimeout>;
|
|
109
102
|
let switchToolsTimerOff: ReturnType<typeof setTimeout>;
|
|
@@ -119,7 +112,7 @@ export const HandleDefault = memo(
|
|
|
119
112
|
if (handleProps.onClick) {
|
|
120
113
|
handleProps.onClick(e);
|
|
121
114
|
}
|
|
122
|
-
if (toolsTarget.length > 0 && e.
|
|
115
|
+
if (toolsTarget.length > 0 && e.currentTarget === handleDefaultRef.current) {
|
|
123
116
|
setExtendedTooltipDisplayed(false);
|
|
124
117
|
(toolsTarget[0] as HTMLElement).click();
|
|
125
118
|
}
|
|
@@ -127,7 +120,7 @@ export const HandleDefault = memo(
|
|
|
127
120
|
"data-category": category,
|
|
128
121
|
onMouseEnter: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => {
|
|
129
122
|
if (switchToolsTimerOff) clearTimeout(switchToolsTimerOff);
|
|
130
|
-
if (e.
|
|
123
|
+
if (e.currentTarget === handleDefaultRef.current) {
|
|
131
124
|
switchTooltipTimerOn = setTimeout(
|
|
132
125
|
() => setExtendedTooltipDisplayed(true),
|
|
133
126
|
data?.tooltipProps?.hoverOpenDelay ?? 500,
|
|
@@ -142,7 +135,16 @@ export const HandleDefault = memo(
|
|
|
142
135
|
setExtendedTooltipDisplayed(false);
|
|
143
136
|
},
|
|
144
137
|
}),
|
|
145
|
-
[
|
|
138
|
+
[
|
|
139
|
+
intent,
|
|
140
|
+
category,
|
|
141
|
+
tooltip,
|
|
142
|
+
flowVersionCheck,
|
|
143
|
+
handleProps.isConnectable,
|
|
144
|
+
handleProps.style,
|
|
145
|
+
handleProps.onClick,
|
|
146
|
+
data?.tooltipProps?.hoverOpenDelay,
|
|
147
|
+
],
|
|
146
148
|
);
|
|
147
149
|
|
|
148
150
|
switch (flowVersionCheck) {
|
|
@@ -146,7 +146,14 @@ div.react-flow__handle {
|
|
|
146
146
|
position: absolute;
|
|
147
147
|
inset: 0;
|
|
148
148
|
overflow: hidden;
|
|
149
|
-
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.#{$eccgui}-graphviz__handle__content--extendedTooltip {
|
|
152
|
+
inset: unset;
|
|
153
|
+
top: 50%;
|
|
154
|
+
left: 50%;
|
|
155
|
+
height: 0;
|
|
156
|
+
width: 0;
|
|
150
157
|
}
|
|
151
158
|
|
|
152
159
|
div.react-flow__handle-right {
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { fireEvent, render, screen } from "@testing-library/react";
|
|
3
|
+
import { OverlaysProvider } from "@blueprintjs/core";
|
|
4
|
+
import "@testing-library/jest-dom";
|
|
5
|
+
|
|
6
|
+
import { HandleDefault } from "../HandleDefault";
|
|
7
|
+
|
|
8
|
+
jest.mock("react-flow-renderer", () => {
|
|
9
|
+
const React = require("react");
|
|
10
|
+
return {
|
|
11
|
+
Handle: React.forwardRef(
|
|
12
|
+
({ children, isConnectable, position, type, ...props }: any, ref: React.Ref<HTMLDivElement>) => (
|
|
13
|
+
<div ref={ref} {...props}>
|
|
14
|
+
{children}
|
|
15
|
+
</div>
|
|
16
|
+
),
|
|
17
|
+
),
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
jest.mock("@xyflow/react", () => {
|
|
22
|
+
const React = require("react");
|
|
23
|
+
return {
|
|
24
|
+
Handle: React.forwardRef(
|
|
25
|
+
({ children, isConnectable, position, type, ...props }: any, ref: React.Ref<HTMLDivElement>) => (
|
|
26
|
+
<div ref={ref} {...props}>
|
|
27
|
+
{children}
|
|
28
|
+
</div>
|
|
29
|
+
),
|
|
30
|
+
),
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
jest.mock("../../versionsupport", () => ({
|
|
35
|
+
useReactFlowVersion: () => "v9",
|
|
36
|
+
}));
|
|
37
|
+
|
|
38
|
+
describe("HandleDefault", () => {
|
|
39
|
+
it("shows the extended tooltip on handle hover", async () => {
|
|
40
|
+
render(
|
|
41
|
+
<OverlaysProvider>
|
|
42
|
+
<HandleDefault
|
|
43
|
+
type="target"
|
|
44
|
+
isConnectable={true}
|
|
45
|
+
data-testid="handle"
|
|
46
|
+
data={{
|
|
47
|
+
extendedTooltip: "This is another Tooltip",
|
|
48
|
+
tooltipProps: {
|
|
49
|
+
hoverOpenDelay: 0,
|
|
50
|
+
},
|
|
51
|
+
}}
|
|
52
|
+
/>
|
|
53
|
+
</OverlaysProvider>,
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
fireEvent.mouseEnter(screen.getByTestId("handle"));
|
|
57
|
+
|
|
58
|
+
expect(await screen.findByText("This is another Tooltip")).toBeVisible();
|
|
59
|
+
});
|
|
60
|
+
});
|