@eccenca/gui-elements 22.0.1 → 22.1.0-rc.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 +20 -4
- package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js +18 -14
- package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
- package/dist/cjs/cmem/ActivityControl/SilkActivityControl.js +58 -30
- package/dist/cjs/cmem/ActivityControl/SilkActivityControl.js.map +1 -1
- package/dist/cjs/cmem/ActivityControl/index.js +11 -0
- package/dist/cjs/cmem/ActivityControl/index.js.map +1 -0
- package/dist/cjs/cmem/ContentBlobToggler/index.js +8 -0
- package/dist/cjs/cmem/ContentBlobToggler/index.js.map +1 -0
- package/dist/cjs/cmem/index.js +14 -13
- package/dist/cjs/cmem/index.js.map +1 -1
- package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js +57 -0
- package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -0
- package/dist/cjs/cmem/react-flow/configuration/_colors-graph.module.scss +35 -0
- package/dist/cjs/cmem/react-flow/configuration/_colors-linking.module.scss +29 -0
- package/dist/cjs/cmem/react-flow/configuration/_colors-workflow.module.scss +22 -0
- package/dist/cjs/cmem/react-flow/configuration/graph.js +31 -0
- package/dist/cjs/cmem/react-flow/configuration/graph.js.map +1 -0
- package/dist/cjs/cmem/react-flow/configuration/linking.js +29 -0
- package/dist/cjs/cmem/react-flow/configuration/linking.js.map +1 -0
- package/dist/cjs/cmem/react-flow/configuration/unspecified.js +15 -0
- package/dist/cjs/cmem/react-flow/configuration/unspecified.js.map +1 -0
- package/dist/cjs/cmem/react-flow/configuration/workflow.js +27 -0
- package/dist/cjs/cmem/react-flow/configuration/workflow.js.map +1 -0
- package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js +285 -0
- package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js.map +1 -0
- package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js +81 -0
- package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js.map +1 -0
- package/dist/cjs/components/AutoSuggestion/SingleLineCodeEditor.js +46 -0
- package/dist/cjs/components/AutoSuggestion/SingleLineCodeEditor.js.map +1 -0
- package/dist/cjs/components/AutocompleteField/AutoCompleteField.js +8 -12
- package/dist/cjs/components/AutocompleteField/AutoCompleteField.js.map +1 -1
- package/dist/cjs/components/Button/Button.js.map +1 -1
- package/dist/cjs/components/ContextOverlay/ContextMenu.js +1 -1
- package/dist/cjs/components/ContextOverlay/ContextMenu.js.map +1 -1
- package/dist/cjs/components/Dialog/Modal.js +2 -2
- package/dist/cjs/components/Dialog/Modal.js.map +1 -1
- package/dist/cjs/components/Dialog/SimpleDialog.js.map +1 -1
- package/dist/cjs/components/Icon/Icon.js.map +1 -1
- package/dist/cjs/components/Icon/canonicalIconNames.js +30 -0
- package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/cjs/components/MultiSelect/MultiSelect.js +219 -0
- package/dist/cjs/components/MultiSelect/MultiSelect.js.map +1 -0
- package/dist/cjs/components/Tabs/Tab.js +95 -0
- package/dist/cjs/components/Tabs/Tab.js.map +1 -0
- package/dist/cjs/components/Tabs/TabTitle.js +20 -0
- package/dist/cjs/components/Tabs/TabTitle.js.map +1 -0
- package/dist/cjs/components/Tabs/Tabs.js +29 -19
- package/dist/cjs/components/Tabs/Tabs.js.map +1 -1
- package/dist/cjs/components/Tag/Tag.js +7 -1
- package/dist/cjs/components/Tag/Tag.js.map +1 -1
- package/dist/cjs/extensions/react-flow/edges/utils.js +96 -4
- package/dist/cjs/extensions/react-flow/edges/utils.js.map +1 -1
- package/dist/cjs/extensions/react-flow/nodes/NodeContent.js +5 -4
- package/dist/cjs/extensions/react-flow/nodes/NodeContent.js.map +1 -1
- package/dist/cjs/extensions/react-flow/nodes/NodeContentExtension.js +2 -2
- package/dist/cjs/extensions/react-flow/nodes/NodeContentExtension.js.map +1 -1
- package/dist/cjs/extensions/react-flow/nodes/NodeTools.js.map +1 -1
- package/dist/cjs/index.js +17 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/legacy-replacements/Button/AffirmativeButton.js +25 -0
- package/dist/cjs/legacy-replacements/Button/AffirmativeButton.js.map +1 -0
- package/dist/cjs/legacy-replacements/Button/Button.js +61 -0
- package/dist/cjs/legacy-replacements/Button/Button.js.map +1 -0
- package/dist/cjs/legacy-replacements/Button/DismissiveButton.js +25 -0
- package/dist/cjs/legacy-replacements/Button/DismissiveButton.js.map +1 -0
- package/dist/cjs/legacy-replacements/Button/DisruptiveButton.js +25 -0
- package/dist/cjs/legacy-replacements/Button/DisruptiveButton.js.map +1 -0
- package/dist/cjs/legacy-replacements/Checkbox/Checkbox.js +55 -0
- package/dist/cjs/legacy-replacements/Checkbox/Checkbox.js.map +1 -0
- package/dist/cjs/legacy-replacements/Radio/RadioButton.js +48 -0
- package/dist/cjs/legacy-replacements/Radio/RadioButton.js.map +1 -0
- package/dist/cjs/legacy-replacements/Tabs/Tabs.js +36 -0
- package/dist/cjs/legacy-replacements/Tabs/Tabs.js.map +1 -0
- package/dist/cjs/legacy-replacements/TextField/TextField.js +75 -0
- package/dist/cjs/legacy-replacements/TextField/TextField.js.map +1 -0
- package/dist/cjs/legacy-replacements/index.js +22 -0
- package/dist/cjs/legacy-replacements/index.js.map +1 -0
- package/dist/es5/cmem/ActivityControl/ActivityControlWidget.js +19 -15
- package/dist/es5/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
- package/dist/es5/cmem/ActivityControl/SilkActivityControl.js +56 -30
- package/dist/es5/cmem/ActivityControl/SilkActivityControl.js.map +1 -1
- package/dist/es5/cmem/ActivityControl/index.js +4 -0
- package/dist/es5/cmem/ActivityControl/index.js.map +1 -0
- package/dist/es5/cmem/ContentBlobToggler/index.js +3 -0
- package/dist/es5/cmem/ContentBlobToggler/index.js.map +1 -0
- package/dist/es5/cmem/index.js +6 -8
- package/dist/es5/cmem/index.js.map +1 -1
- package/dist/es5/cmem/react-flow/ReactFlow/ReactFlow.js +43 -0
- package/dist/es5/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -0
- package/dist/es5/cmem/react-flow/configuration/_colors-graph.module.scss +35 -0
- package/dist/es5/cmem/react-flow/configuration/_colors-linking.module.scss +29 -0
- package/dist/es5/cmem/react-flow/configuration/_colors-workflow.module.scss +22 -0
- package/dist/es5/cmem/react-flow/configuration/graph.js +23 -0
- package/dist/es5/cmem/react-flow/configuration/graph.js.map +1 -0
- package/dist/es5/cmem/react-flow/configuration/linking.js +21 -0
- package/dist/es5/cmem/react-flow/configuration/linking.js.map +1 -0
- package/dist/es5/cmem/react-flow/configuration/unspecified.js +12 -0
- package/dist/es5/cmem/react-flow/configuration/unspecified.js.map +1 -0
- package/dist/es5/cmem/react-flow/configuration/workflow.js +19 -0
- package/dist/es5/cmem/react-flow/configuration/workflow.js.map +1 -0
- package/dist/es5/components/AutoSuggestion/AutoSuggestion.js +347 -0
- package/dist/es5/components/AutoSuggestion/AutoSuggestion.js.map +1 -0
- package/dist/es5/components/AutoSuggestion/AutoSuggestionList.js +93 -0
- package/dist/es5/components/AutoSuggestion/AutoSuggestionList.js.map +1 -0
- package/dist/es5/components/AutoSuggestion/SingleLineCodeEditor.js +42 -0
- package/dist/es5/components/AutoSuggestion/SingleLineCodeEditor.js.map +1 -0
- package/dist/es5/components/AutocompleteField/AutoCompleteField.js +8 -12
- package/dist/es5/components/AutocompleteField/AutoCompleteField.js.map +1 -1
- package/dist/es5/components/Button/Button.js.map +1 -1
- package/dist/es5/components/ContextOverlay/ContextMenu.js +1 -1
- package/dist/es5/components/ContextOverlay/ContextMenu.js.map +1 -1
- package/dist/es5/components/Dialog/Modal.js +2 -2
- package/dist/es5/components/Dialog/Modal.js.map +1 -1
- package/dist/es5/components/Dialog/SimpleDialog.js.map +1 -1
- package/dist/es5/components/Icon/Icon.js.map +1 -1
- package/dist/es5/components/Icon/canonicalIconNames.js +30 -0
- package/dist/es5/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/es5/components/MultiSelect/MultiSelect.js +301 -0
- package/dist/es5/components/MultiSelect/MultiSelect.js.map +1 -0
- package/dist/es5/components/Tabs/Tab.js +98 -0
- package/dist/es5/components/Tabs/Tab.js.map +1 -0
- package/dist/es5/components/Tabs/TabTitle.js +16 -0
- package/dist/es5/components/Tabs/TabTitle.js.map +1 -0
- package/dist/es5/components/Tabs/Tabs.js +11 -21
- package/dist/es5/components/Tabs/Tabs.js.map +1 -1
- package/dist/es5/components/Tag/Tag.js +7 -1
- package/dist/es5/components/Tag/Tag.js.map +1 -1
- package/dist/es5/extensions/react-flow/edges/utils.js +99 -5
- package/dist/es5/extensions/react-flow/edges/utils.js.map +1 -1
- package/dist/es5/extensions/react-flow/nodes/NodeContent.js +21 -4
- package/dist/es5/extensions/react-flow/nodes/NodeContent.js.map +1 -1
- package/dist/es5/extensions/react-flow/nodes/NodeContentExtension.js +2 -2
- package/dist/es5/extensions/react-flow/nodes/NodeContentExtension.js.map +1 -1
- package/dist/es5/extensions/react-flow/nodes/NodeTools.js.map +1 -1
- package/dist/es5/index.js +9 -2
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/legacy-replacements/Button/AffirmativeButton.js +29 -0
- package/dist/es5/legacy-replacements/Button/AffirmativeButton.js.map +1 -0
- package/dist/es5/legacy-replacements/Button/Button.js +65 -0
- package/dist/es5/legacy-replacements/Button/Button.js.map +1 -0
- package/dist/es5/legacy-replacements/Button/DismissiveButton.js +29 -0
- package/dist/es5/legacy-replacements/Button/DismissiveButton.js.map +1 -0
- package/dist/es5/legacy-replacements/Button/DisruptiveButton.js +29 -0
- package/dist/es5/legacy-replacements/Button/DisruptiveButton.js.map +1 -0
- package/dist/es5/legacy-replacements/Checkbox/Checkbox.js +59 -0
- package/dist/es5/legacy-replacements/Checkbox/Checkbox.js.map +1 -0
- package/dist/es5/legacy-replacements/Radio/RadioButton.js +52 -0
- package/dist/es5/legacy-replacements/Radio/RadioButton.js.map +1 -0
- package/dist/es5/legacy-replacements/Tabs/Tabs.js +40 -0
- package/dist/es5/legacy-replacements/Tabs/Tabs.js.map +1 -0
- package/dist/es5/legacy-replacements/TextField/TextField.js +81 -0
- package/dist/es5/legacy-replacements/TextField/TextField.js.map +1 -0
- package/dist/es5/legacy-replacements/index.js +10 -0
- package/dist/es5/legacy-replacements/index.js.map +1 -0
- package/dist/types/cmem/ActivityControl/ActivityControlTypes.d.ts +2 -1
- package/dist/types/cmem/ActivityControl/ActivityControlWidget.d.ts +39 -2
- package/dist/types/cmem/ActivityControl/SilkActivityControl.d.ts +16 -3
- package/dist/types/cmem/ActivityControl/index.d.ts +3 -0
- package/dist/types/cmem/ContentBlobToggler/index.d.ts +2 -0
- package/dist/types/cmem/index.d.ts +8 -8
- package/dist/types/cmem/react-flow/ReactFlow/ReactFlow.d.ts +14 -0
- package/dist/types/cmem/react-flow/configuration/graph.d.ts +21 -0
- package/dist/types/cmem/react-flow/configuration/linking.d.ts +19 -0
- package/dist/types/cmem/react-flow/configuration/unspecified.d.ts +9 -0
- package/dist/types/cmem/react-flow/configuration/workflow.d.ts +17 -0
- package/dist/types/components/AutoSuggestion/AutoSuggestion.d.ts +67 -0
- package/dist/types/components/AutoSuggestion/AutoSuggestionList.d.ts +13 -0
- package/dist/types/components/AutoSuggestion/SingleLineCodeEditor.d.ts +25 -0
- package/dist/types/components/AutocompleteField/AutoCompleteField.d.ts +8 -7
- package/dist/types/components/Button/Button.d.ts +3 -2
- package/dist/types/components/ContextOverlay/ContextMenu.d.ts +6 -1
- package/dist/types/components/Dialog/Modal.d.ts +4 -3
- package/dist/types/components/Dialog/SimpleDialog.d.ts +2 -0
- package/dist/types/components/Icon/Icon.d.ts +2 -2
- package/dist/types/components/Icon/IconButton.d.ts +1 -1
- package/dist/types/components/Icon/canonicalIconNames.d.ts +1 -1
- package/dist/types/components/MultiSelect/MultiSelect.d.ts +79 -0
- package/dist/types/components/Tabs/Tab.d.ts +549 -0
- package/dist/types/components/Tabs/TabTitle.d.ts +38 -0
- package/dist/types/components/Tabs/Tabs.d.ts +14 -20
- package/dist/types/components/Tag/Tag.d.ts +1 -1
- package/dist/types/extensions/react-flow/edges/utils.d.ts +1 -1
- package/dist/types/extensions/react-flow/nodes/NodeContent.d.ts +8 -8
- package/dist/types/extensions/react-flow/nodes/NodeDefault.d.ts +2 -2
- package/dist/types/extensions/react-flow/nodes/NodeTools.d.ts +2 -1
- package/dist/types/extensions/react-flow/nodes/nodeTypes.d.ts +10 -10
- package/dist/types/index.d.ts +9 -2
- package/dist/types/legacy-replacements/Button/AffirmativeButton.d.ts +2 -0
- package/dist/types/legacy-replacements/Button/Button.d.ts +5 -0
- package/dist/types/legacy-replacements/Button/DismissiveButton.d.ts +2 -0
- package/dist/types/legacy-replacements/Button/DisruptiveButton.d.ts +2 -0
- package/dist/types/legacy-replacements/Checkbox/Checkbox.d.ts +2 -0
- package/dist/types/legacy-replacements/Radio/RadioButton.d.ts +2 -0
- package/dist/types/legacy-replacements/Tabs/Tabs.d.ts +22 -0
- package/dist/types/legacy-replacements/TextField/TextField.d.ts +2 -0
- package/dist/types/legacy-replacements/index.d.ts +10 -0
- package/package.json +16 -7
- package/src/cmem/ActivityControl/ActivityControlTypes.ts +3 -1
- package/src/cmem/ActivityControl/ActivityControlWidget.stories.tsx +98 -0
- package/src/cmem/ActivityControl/ActivityControlWidget.tsx +131 -89
- package/src/cmem/ActivityControl/SilkActivityControl.tsx +178 -120
- package/src/cmem/ActivityControl/index.ts +3 -0
- package/src/cmem/ContentBlobToggler/index.ts +2 -0
- package/src/cmem/_index.scss +6 -0
- package/src/cmem/index.ts +10 -23
- package/src/cmem/react-flow/ReactFlow/ReactFlow.stories.tsx +222 -0
- package/src/cmem/react-flow/ReactFlow/ReactFlow.tsx +40 -0
- package/src/cmem/react-flow/_edges.scss +23 -0
- package/src/cmem/react-flow/_handles.scss +34 -0
- package/src/cmem/react-flow/_index.scss +5 -0
- package/src/cmem/react-flow/_minimap.scss +33 -0
- package/src/cmem/react-flow/_nodes.scss +60 -0
- package/src/cmem/react-flow/configuration/_colors-graph.module.scss +35 -0
- package/src/cmem/react-flow/configuration/_colors-linking.module.scss +29 -0
- package/src/cmem/react-flow/configuration/_colors-workflow.module.scss +22 -0
- package/src/cmem/react-flow/configuration/_colors.scss +3 -0
- package/src/cmem/react-flow/configuration/graph.ts +29 -0
- package/src/cmem/react-flow/configuration/linking.ts +28 -0
- package/src/cmem/react-flow/configuration/unspecified.ts +13 -0
- package/src/cmem/react-flow/configuration/workflow.ts +25 -0
- package/src/components/AutoSuggestion/AutoSuggestion.scss +100 -0
- package/src/components/AutoSuggestion/AutoSuggestion.tsx +447 -0
- package/src/components/AutoSuggestion/AutoSuggestionList.tsx +170 -0
- package/src/components/AutoSuggestion/SingleLineCodeEditor.tsx +97 -0
- package/src/components/AutoSuggestion/tests/AutoSuggestion.test.tsx +37 -0
- package/src/components/AutoSuggestion/tests/AutoSuggestionList.test.tsx +124 -0
- package/src/components/AutoSuggestion/tests/SingleLineCodeEditor.test.tsx +55 -0
- package/src/components/AutocompleteField/AutoCompleteField.tsx +19 -19
- package/src/components/AutocompleteField/autoCompleteFieldUtils.tsx +2 -1
- package/src/components/Button/Button.tsx +3 -2
- package/src/components/ContextOverlay/ContextMenu.tsx +8 -2
- package/src/components/Dialog/Modal.tsx +9 -2
- package/src/components/Dialog/SimpleDialog.tsx +2 -0
- package/src/components/Icon/Icon.tsx +4 -4
- package/src/components/Icon/IconButton.tsx +1 -1
- package/src/components/Icon/canonicalIconNames.tsx +39 -2
- package/src/components/MultiSelect/MultiSelect.stories.tsx +63 -0
- package/src/components/MultiSelect/MultiSelect.tsx +370 -0
- package/src/components/Tabs/Tab.tsx +112 -0
- package/src/components/Tabs/TabTitle.tsx +71 -0
- package/src/components/Tabs/Tabs.tsx +26 -90
- package/src/components/Tabs/stories/Tab.stories.tsx +65 -0
- package/src/components/Tabs/stories/TabTitle.stories.tsx +35 -0
- package/src/components/Tabs/stories/Tabs.stories.tsx +98 -0
- package/src/components/Tabs/tabs.scss +11 -4
- package/src/components/Tag/Tag.tsx +10 -3
- package/src/components/Tag/tag.scss +1 -1
- package/src/components/TextField/TextField.tsx +1 -1
- package/src/configuration/_variables.scss +3 -3
- package/src/extensions/react-flow/_config.scss +2 -2
- package/src/extensions/react-flow/edges/_edges.scss +3 -28
- package/src/extensions/react-flow/edges/utils.ts +139 -4
- package/src/extensions/react-flow/handles/_handles.scss +4 -58
- package/src/extensions/react-flow/minimap/_minimap.scss +0 -45
- package/src/extensions/react-flow/nodes/NodeContent.tsx +134 -133
- package/src/extensions/react-flow/nodes/NodeContentExtension.tsx +11 -10
- package/src/extensions/react-flow/nodes/NodeDefault.tsx +2 -2
- package/src/extensions/react-flow/nodes/NodeTools.tsx +2 -1
- package/src/extensions/react-flow/nodes/_nodes.scss +31 -185
- package/src/extensions/react-flow/nodes/{NodeContent.stories.tsx → stories/NodeContent.stories.tsx} +4 -4
- package/src/extensions/react-flow/nodes/{NodeContentExtension.stories.tsx → stories/NodeContentExtension.stories.tsx} +4 -4
- package/src/extensions/react-flow/nodes/{NodeDefault.stories.tsx → stories/NodeDefault.stories.tsx} +5 -4
- package/src/index.scss +1 -0
- package/src/index.ts +16 -1
- package/src/legacy-replacements/Tabs/Tabs.stories.tsx +46 -0
- package/src/legacy-replacements/Tabs/Tabs.tsx +84 -0
- package/src/legacy-replacements/index.ts +11 -0
- package/src/test/setupTests.js +19 -0
|
@@ -104,42 +104,17 @@ path.react-flow__edge-path-glow {
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
.react-flow__edge-
|
|
108
|
-
stroke: #00acc1;
|
|
109
|
-
color: #00acc1;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.react-flow__edge-importEdge {
|
|
113
|
-
stroke: #8e24aa;
|
|
114
|
-
color: #8e24aa;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.react-flow__edge-subclassEdge {
|
|
118
|
-
stroke: darken($button-background-color, 60%);
|
|
119
|
-
color: darken($button-background-color, 60%);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.react-flow__edge-subpropertyEdge {
|
|
123
|
-
stroke: darken(complement($button-background-color), 40%);
|
|
124
|
-
color: darken(complement($button-background-color), 40%);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.react-flow__edge-rdftypeEdge {
|
|
128
|
-
stroke: darken($button-background-color, 50%);
|
|
129
|
-
color: darken($button-background-color, 50%);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.react-flow__edge-successStep {
|
|
107
|
+
.react-flow__edge-success {
|
|
133
108
|
stroke: $eccgui-color-success-text;
|
|
134
109
|
color: $eccgui-color-success-text;
|
|
135
110
|
}
|
|
136
111
|
|
|
137
|
-
.react-flow__edge-
|
|
112
|
+
.react-flow__edge-warning {
|
|
138
113
|
stroke: $eccgui-color-warning-text;
|
|
139
114
|
color: $eccgui-color-warning-text;
|
|
140
115
|
}
|
|
141
116
|
|
|
142
|
-
.react-flow__edge-
|
|
117
|
+
.react-flow__edge-danger {
|
|
143
118
|
stroke: $eccgui-color-danger-text;
|
|
144
119
|
color: $eccgui-color-danger-text;
|
|
145
120
|
}
|
|
@@ -1,14 +1,131 @@
|
|
|
1
1
|
import { EdgeDefaultProps } from "./EdgeDefault";
|
|
2
2
|
import { EdgeStepProps } from "./EdgeStep";
|
|
3
|
-
import { getSmoothStepPath } from "react-flow-renderer";
|
|
3
|
+
import { getSmoothStepPath, Position } from "react-flow-renderer";
|
|
4
|
+
|
|
5
|
+
interface EdgePositionCorrectionProps extends Omit<EdgeDefaultProps, "id" | "source" | "target" | "drawSvgPath" | "data"> {
|
|
6
|
+
correctionLength?: number;
|
|
7
|
+
correctionRadius?: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const posCorrectionEdge = ({
|
|
11
|
+
sourceX,
|
|
12
|
+
sourceY,
|
|
13
|
+
sourcePosition,
|
|
14
|
+
targetX,
|
|
15
|
+
targetY,
|
|
16
|
+
targetPosition,
|
|
17
|
+
correctionLength = 7,
|
|
18
|
+
correctionRadius = 7
|
|
19
|
+
}: EdgePositionCorrectionProps) => {
|
|
20
|
+
let newSourceX = sourceX;
|
|
21
|
+
let newSourceY = sourceY;
|
|
22
|
+
let newTargetX = targetX;
|
|
23
|
+
let newTargetY = targetY;
|
|
24
|
+
let startCommandCorrection = `M ${sourceX},${sourceY} `;
|
|
25
|
+
let endCommandCorrection = ``;
|
|
26
|
+
|
|
27
|
+
if (sourcePosition === Position.Left && sourceX < targetX) {
|
|
28
|
+
newSourceX = newSourceX - correctionLength;
|
|
29
|
+
if (sourceY < targetY) {
|
|
30
|
+
newSourceY = sourceY + 2 * correctionRadius;
|
|
31
|
+
startCommandCorrection = startCommandCorrection + ` L ${newSourceX},${sourceY} A ${correctionRadius} ${correctionRadius} ${180} ${1} ${0} `;
|
|
32
|
+
} else {
|
|
33
|
+
newSourceY = sourceY - 2 * correctionRadius;
|
|
34
|
+
startCommandCorrection = startCommandCorrection + ` L ${newSourceX},${sourceY} A ${correctionRadius} ${correctionRadius} ${180} ${1} ${1} `;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (sourcePosition === Position.Right && sourceX > targetX) {
|
|
39
|
+
newSourceX = targetPosition === Position.Right ? newSourceX + correctionLength + correctionRadius : newSourceX + correctionLength;
|
|
40
|
+
if (sourceY < targetY) {
|
|
41
|
+
newSourceY = targetPosition === Position.Right ? sourceY + 1 * correctionRadius : sourceY + 2 * correctionRadius;
|
|
42
|
+
startCommandCorrection = targetPosition === Position.Right ? (
|
|
43
|
+
startCommandCorrection + ` L ${newSourceX - correctionRadius},${sourceY} A ${correctionRadius} ${correctionRadius} ${90} ${0} ${1} `
|
|
44
|
+
) : (
|
|
45
|
+
startCommandCorrection + ` L ${newSourceX},${sourceY} A ${correctionRadius} ${correctionRadius} ${180} ${1} ${1} `
|
|
46
|
+
);
|
|
47
|
+
} else {
|
|
48
|
+
newSourceY = targetPosition === Position.Right ? sourceY - 1 * correctionRadius : sourceY - 2 * correctionRadius;
|
|
49
|
+
startCommandCorrection = targetPosition === Position.Right ? (
|
|
50
|
+
startCommandCorrection + ` L ${newSourceX - correctionRadius},${sourceY} A ${correctionRadius} ${correctionRadius} ${90} ${0} ${0} `
|
|
51
|
+
) : (
|
|
52
|
+
startCommandCorrection + ` L ${newSourceX},${sourceY} A ${correctionRadius} ${correctionRadius} ${180} ${1} ${0} `
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (targetPosition === Position.Left && sourceX > targetX) {
|
|
58
|
+
newTargetX = newTargetX - correctionLength;
|
|
59
|
+
if (sourceY < targetY) {
|
|
60
|
+
newTargetY = targetY - 2 * correctionRadius;
|
|
61
|
+
endCommandCorrection = ` A ${correctionRadius} ${correctionRadius} ${180} ${1} ${0} ${newTargetX},${targetY} L ${targetX},${targetY}`;
|
|
62
|
+
} else {
|
|
63
|
+
newTargetY = targetY + 2 * correctionRadius;
|
|
64
|
+
endCommandCorrection = ` A ${correctionRadius} ${correctionRadius} ${180} ${1} ${1} ${newTargetX},${targetY} L ${targetX},${targetY}`;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (targetPosition === Position.Right && sourceX < targetX) {
|
|
69
|
+
newTargetX = newTargetX + correctionLength;
|
|
70
|
+
if (sourceY < targetY) {
|
|
71
|
+
newTargetY = targetY - 2 * correctionRadius;
|
|
72
|
+
endCommandCorrection = ` A ${correctionRadius} ${correctionRadius} ${180} ${1} ${1} ${newTargetX},${targetY} L ${targetX},${targetY}`;
|
|
73
|
+
} else {
|
|
74
|
+
newTargetY = targetY + 2 * correctionRadius;
|
|
75
|
+
endCommandCorrection = ` A ${correctionRadius} ${correctionRadius} ${180} ${1} ${0} ${newTargetX},${targetY} L ${targetX},${targetY}`;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
return {
|
|
81
|
+
newSourceX,
|
|
82
|
+
newSourceY,
|
|
83
|
+
newTargetX,
|
|
84
|
+
newTargetY,
|
|
85
|
+
startCommandCorrection,
|
|
86
|
+
endCommandCorrection,
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
interface PathCommandCorrectionProps {
|
|
91
|
+
pathCommand: string;
|
|
92
|
+
startCorrection: string;
|
|
93
|
+
endCorrection: string;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const pathCommandCorrection = ({
|
|
97
|
+
pathCommand,
|
|
98
|
+
startCorrection,
|
|
99
|
+
endCorrection,
|
|
100
|
+
}: PathCommandCorrectionProps) => {
|
|
101
|
+
return startCorrection + pathCommand.substring(1) + endCorrection;
|
|
102
|
+
}
|
|
4
103
|
|
|
5
104
|
export const drawEdgeStraight = ({
|
|
6
105
|
sourceX,
|
|
7
106
|
sourceY,
|
|
107
|
+
sourcePosition,
|
|
8
108
|
targetX,
|
|
9
109
|
targetY,
|
|
110
|
+
targetPosition,
|
|
10
111
|
}: EdgeDefaultProps) => {
|
|
11
|
-
|
|
112
|
+
const corrections = posCorrectionEdge({
|
|
113
|
+
sourceX,
|
|
114
|
+
sourceY,
|
|
115
|
+
sourcePosition,
|
|
116
|
+
targetX,
|
|
117
|
+
targetY,
|
|
118
|
+
targetPosition,
|
|
119
|
+
correctionRadius: 0
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
const pathCommand = `M ${corrections.newSourceX},${corrections.newSourceY}L ${corrections.newTargetX},${corrections.newTargetY}`;
|
|
123
|
+
|
|
124
|
+
return pathCommandCorrection({
|
|
125
|
+
pathCommand,
|
|
126
|
+
startCorrection: corrections.startCommandCorrection,
|
|
127
|
+
endCorrection: corrections.endCommandCorrection,
|
|
128
|
+
});
|
|
12
129
|
}
|
|
13
130
|
|
|
14
131
|
export const drawEdgeStep = ({
|
|
@@ -20,13 +137,31 @@ export const drawEdgeStep = ({
|
|
|
20
137
|
targetPosition,
|
|
21
138
|
data = {},
|
|
22
139
|
}: EdgeStepProps) => {
|
|
23
|
-
|
|
140
|
+
|
|
141
|
+
const corrections = posCorrectionEdge({
|
|
24
142
|
sourceX,
|
|
25
143
|
sourceY,
|
|
26
144
|
sourcePosition,
|
|
27
145
|
targetX,
|
|
28
146
|
targetY,
|
|
29
147
|
targetPosition,
|
|
30
|
-
|
|
148
|
+
correctionLength: data.stepCornerRadius || 7,
|
|
149
|
+
correctionRadius: data.stepCornerRadius || 7,
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
const pathCommand = getSmoothStepPath({
|
|
153
|
+
sourceX: corrections.newSourceX,
|
|
154
|
+
sourceY: corrections.newSourceY,
|
|
155
|
+
sourcePosition,
|
|
156
|
+
targetX: corrections.newTargetX,
|
|
157
|
+
targetY: corrections.newTargetY,
|
|
158
|
+
targetPosition,
|
|
159
|
+
borderRadius: data.stepCornerRadius || 7
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
return pathCommandCorrection({
|
|
163
|
+
pathCommand,
|
|
164
|
+
startCorrection: corrections.startCommandCorrection,
|
|
165
|
+
endCorrection: corrections.endCommandCorrection,
|
|
31
166
|
});
|
|
32
167
|
}
|
|
@@ -22,14 +22,14 @@ div.react-flow__handle {
|
|
|
22
22
|
right: $eccgui-size-block-whitespace/-2;
|
|
23
23
|
opacity: 0.61;
|
|
24
24
|
display: none;
|
|
25
|
-
background-color:
|
|
25
|
+
background-color: currentColor;
|
|
26
26
|
border: solid 1px currentColor;
|
|
27
27
|
border-radius: 100%;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
&:hover {
|
|
31
31
|
&:before {
|
|
32
|
-
|
|
32
|
+
box-shadow: 0 0 $eccgui-size-block-whitespace/2 $eccgui-size-block-whitespace/4 currentColor;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -47,14 +47,14 @@ div.react-flow__handle {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
&.react-flow__handle-connecting:hover {
|
|
50
|
+
&.react-flow__handle-connecting:hover, &.invalid-handle {
|
|
51
51
|
color: $eccgui-color-danger-text;
|
|
52
52
|
&:before {
|
|
53
53
|
display: block;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
&.react-flow__handle-valid:hover {
|
|
57
|
+
&.react-flow__handle-valid:hover, &.valid-handle {
|
|
58
58
|
color: $eccgui-color-success-text;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
@@ -152,57 +152,3 @@ div.react-flow__handle-bottom {
|
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
|
|
156
|
-
.react-flow__node-graphNode {
|
|
157
|
-
.react-flow__handle {
|
|
158
|
-
color: #8e24aa;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.react-flow__node-classNode {
|
|
163
|
-
.react-flow__handle {
|
|
164
|
-
color: darken($button-background-color, 60%);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.react-flow__node-instanceNode {
|
|
169
|
-
.react-flow__handle {
|
|
170
|
-
color: darken($button-background-color, 50%);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
.react-flow__node-propertyNode {
|
|
175
|
-
.react-flow__handle {
|
|
176
|
-
color: darken(complement($button-background-color), 40%);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
.react-flow__node-datasetNode {
|
|
181
|
-
.react-flow__handle {
|
|
182
|
-
color: #039be5;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.react-flow__node-linkingNode {
|
|
187
|
-
.react-flow__handle {
|
|
188
|
-
color: #00acc1;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
.react-flow__node-transformNode {
|
|
193
|
-
.react-flow__handle {
|
|
194
|
-
color: #00897b;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.react-flow__node-taskNode {
|
|
199
|
-
.react-flow__handle {
|
|
200
|
-
color: #546e7a;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
.react-flow__node-workflowNode {
|
|
205
|
-
.react-flow__handle {
|
|
206
|
-
color: #4527a0;
|
|
207
|
-
}
|
|
208
|
-
}
|
|
@@ -3,51 +3,6 @@
|
|
|
3
3
|
fill: $reactflow-node-background-color;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
.#{$eccgui}-graphviz__minimap__node--graphNode {
|
|
7
|
-
fill: #8e24aa;
|
|
8
|
-
stroke: #8e24aa;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.#{$eccgui}-graphviz__minimap__node--classNode {
|
|
12
|
-
fill: darken($button-background-color, 60%);
|
|
13
|
-
stroke: darken($button-background-color, 60%);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.#{$eccgui}-graphviz__minimap__node--instanceNode {
|
|
17
|
-
fill: darken($button-background-color, 50%);
|
|
18
|
-
stroke: darken($button-background-color, 50%);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.#{$eccgui}-graphviz__minimap__node--propertyNode {
|
|
22
|
-
fill: darken(complement($button-background-color), 40%);
|
|
23
|
-
stroke: darken(complement($button-background-color), 40%);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.#{$eccgui}-graphviz__minimap__node--datasetNode {
|
|
27
|
-
fill: #039be5;
|
|
28
|
-
stroke: #039be5;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.#{$eccgui}-graphviz__minimap__node--linkingNode {
|
|
32
|
-
fill: #00acc1;
|
|
33
|
-
stroke: #00acc1;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.#{$eccgui}-graphviz__minimap__node--transformNode {
|
|
37
|
-
fill: #00897b;
|
|
38
|
-
stroke: #00897b;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.#{$eccgui}-graphviz__minimap__node--taskNode {
|
|
42
|
-
fill: #546e7a;
|
|
43
|
-
stroke: #546e7a;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.#{$eccgui}-graphviz__minimap__node--workflowNode {
|
|
47
|
-
fill: #4527a0;
|
|
48
|
-
stroke: #4527a0;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
6
|
.#{$eccgui}-graphviz__minimap__node--highlight-match {
|
|
52
7
|
stroke: $eccgui-color-accent;
|
|
53
8
|
stroke-width: 5;
|
|
@@ -8,13 +8,13 @@ import {ValidIconName} from "../../../components/Icon/canonicalIconNames";
|
|
|
8
8
|
import { HandleDefault, HandleProps } from "./../handles/HandleDefault";
|
|
9
9
|
import { NodeProps } from "./NodeDefault";
|
|
10
10
|
|
|
11
|
-
type HighlightingState = "success" | "warning" | "danger" | "match" | "altmatch";
|
|
11
|
+
export type HighlightingState = "success" | "warning" | "danger" | "match" | "altmatch";
|
|
12
12
|
|
|
13
13
|
export interface IHandleProps extends HandleProps {
|
|
14
14
|
category?: "configuration";
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
interface NodeContentData {
|
|
17
|
+
interface NodeContentData<CONTENT_PROPS = any> {
|
|
18
18
|
/**
|
|
19
19
|
* Name of icon that should be displayed before the node label.
|
|
20
20
|
* Must be a name from our list of canonical icon names.
|
|
@@ -31,14 +31,14 @@ interface NodeContentData {
|
|
|
31
31
|
/**
|
|
32
32
|
* Content element, displayed in the node body.
|
|
33
33
|
*/
|
|
34
|
-
content?: React.ReactNode;
|
|
34
|
+
content?: React.ReactNode | ((adjustedContentProps: Partial<CONTENT_PROPS>) => React.ReactNode);
|
|
35
35
|
/**
|
|
36
36
|
* Content extension, displayed at the bottom side of a node.
|
|
37
37
|
*/
|
|
38
38
|
contentExtension?: React.ReactNode;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
export interface NodeContentProps<
|
|
41
|
+
export interface NodeContentProps<NODE_DATA, NODE_CONTENT_PROPS = any> extends NodeContentData, React.HTMLAttributes<HTMLDivElement> {
|
|
42
42
|
/**
|
|
43
43
|
* Size of the node.
|
|
44
44
|
* If `minimalShape` is not set to `none`then the configured size definition is only used for the selected node state.
|
|
@@ -66,7 +66,7 @@ export interface NodeContentProps<T> extends NodeContentData, React.HTMLAttribut
|
|
|
66
66
|
/**
|
|
67
67
|
* Set of defined buttons and icons that can be displayed.
|
|
68
68
|
*/
|
|
69
|
-
executionButtons?: () => React.
|
|
69
|
+
executionButtons?: (adjustedContentProps: Partial<NODE_CONTENT_PROPS>, setAdjustedContentProps: React.Dispatch<React.SetStateAction<Partial<NODE_CONTENT_PROPS>>>) => React.ReactElement<NODE_CONTENT_PROPS>;
|
|
70
70
|
/**
|
|
71
71
|
* Can be used for permanent action button or context menu.
|
|
72
72
|
* It is displayed at the node header right to the label.
|
|
@@ -89,7 +89,7 @@ export interface NodeContentProps<T> extends NodeContentData, React.HTMLAttribut
|
|
|
89
89
|
* Callback function to provide content for the tooltip on a node with a defined `minimalShape`.
|
|
90
90
|
* If you do not want a tooltip in this state you need to provide a callback that returns an empty value.
|
|
91
91
|
*/
|
|
92
|
-
getMinimalTooltipData?: (node: NodeProps<
|
|
92
|
+
getMinimalTooltipData?: (node: NodeProps<NODE_DATA>) => NodeContentData;
|
|
93
93
|
/**
|
|
94
94
|
* Set if a handle is displayed even if it does not allow a connection to an edge.
|
|
95
95
|
*/
|
|
@@ -100,7 +100,7 @@ export interface NodeContentProps<T> extends NodeContentData, React.HTMLAttribut
|
|
|
100
100
|
animated?:boolean;
|
|
101
101
|
|
|
102
102
|
/** Additional data stored in the node. */
|
|
103
|
-
businessData?:
|
|
103
|
+
businessData?: NODE_DATA;
|
|
104
104
|
|
|
105
105
|
// we need to forward some ReactFlowNodeProps here
|
|
106
106
|
|
|
@@ -201,129 +201,130 @@ const MemoHandler = React.memo(
|
|
|
201
201
|
* The `NodeContent` element manages the main view of how a node is displaying which content.
|
|
202
202
|
* This element cannot be used directly, all properties must be routed through the `data` property of an `elements` property item inside the `ReactFlow` container.
|
|
203
203
|
*/
|
|
204
|
-
export
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
}: NodeContentProps<any>)
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
204
|
+
export function NodeContent <CONTENT_PROPS = any>({
|
|
205
|
+
iconName,
|
|
206
|
+
depiction,
|
|
207
|
+
typeLabel,
|
|
208
|
+
label,
|
|
209
|
+
showExecutionButtons = true,
|
|
210
|
+
executionButtons,
|
|
211
|
+
menuButtons,
|
|
212
|
+
content,
|
|
213
|
+
contentExtension,
|
|
214
|
+
size = "small",
|
|
215
|
+
minimalShape = "circular",
|
|
216
|
+
highlightedState,
|
|
217
|
+
handles = defaultHandles,
|
|
218
|
+
adaptHeightForHandleMinCount,
|
|
219
|
+
adaptSizeIncrement = 15,
|
|
220
|
+
getMinimalTooltipData = getDefaultMinimalTooltipData,
|
|
221
|
+
style = {},
|
|
222
|
+
showUnconnectableHandles = false,
|
|
223
|
+
animated = false,
|
|
224
|
+
// forwarded props
|
|
225
|
+
targetPosition = Position.Left,
|
|
226
|
+
sourcePosition = Position.Right,
|
|
227
|
+
isConnectable = true,
|
|
228
|
+
selected,
|
|
229
|
+
// businessData is just being ignored
|
|
230
|
+
businessData,
|
|
231
|
+
// other props for DOM element
|
|
232
|
+
...otherProps
|
|
233
|
+
}: NodeContentProps<any>) {
|
|
234
|
+
const [adjustedContentProps, setAdjustedContentProps] = React.useState<Partial<CONTENT_PROPS>>({})
|
|
235
|
+
const handleStack: { [key: string]: IHandleProps[] } = {};
|
|
236
|
+
handleStack[Position.Top] = [] as IHandleProps[];
|
|
237
|
+
handleStack[Position.Right] = [] as IHandleProps[];
|
|
238
|
+
handleStack[Position.Bottom] = [] as IHandleProps[];
|
|
239
|
+
handleStack[Position.Left] = [] as IHandleProps[];
|
|
240
|
+
if (handles.length > 0) {
|
|
241
|
+
handles.forEach(handle => {
|
|
242
|
+
if (!!handle.position) {
|
|
243
|
+
handleStack[handle.position].push(handle);
|
|
244
|
+
}
|
|
245
|
+
else if (handle.category === "configuration") {
|
|
246
|
+
handleStack[Position.Top].push(handle);
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
if (handle.type === "target") {
|
|
250
|
+
handleStack[targetPosition].push(handle);
|
|
251
|
+
}
|
|
252
|
+
if (handle.type === "source") {
|
|
253
|
+
handleStack[sourcePosition].push(handle);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
const styleExpandDimensions: { [key: string]: string | number } = {};
|
|
259
|
+
if (
|
|
260
|
+
typeof adaptHeightForHandleMinCount !== "undefined" &&
|
|
261
|
+
(minimalShape === "none" || !!selected) &&
|
|
262
|
+
adaptSizeIncrement && (
|
|
263
|
+
handleStack[Position.Left].length >= adaptHeightForHandleMinCount ||
|
|
264
|
+
handleStack[Position.Right].length >= adaptHeightForHandleMinCount
|
|
265
|
+
)
|
|
266
|
+
) {
|
|
267
|
+
const minHeightLeft = handleStack[Position.Left].length * adaptSizeIncrement;
|
|
268
|
+
const minHeightRight = handleStack[Position.Right].length * adaptSizeIncrement;
|
|
269
|
+
styleExpandDimensions["minHeight"] = Math.max(minHeightLeft, minHeightRight);
|
|
270
|
+
}
|
|
271
|
+
return (
|
|
272
|
+
<>
|
|
273
|
+
<section
|
|
274
|
+
{...otherProps}
|
|
275
|
+
style={{...style, ...styleExpandDimensions}}
|
|
276
|
+
className={
|
|
277
|
+
`${eccgui}-graphviz__node` +
|
|
278
|
+
` ${eccgui}-graphviz__node--${size}` +
|
|
279
|
+
` ${eccgui}-graphviz__node--minimal-${minimalShape}` +
|
|
280
|
+
(!!highlightedState ? " " + gethighlightedStateClasses(highlightedState, `${eccgui}-graphviz__node`) : "") +
|
|
281
|
+
(animated ? ` ${eccgui}-graphviz__node--animated` : "") +
|
|
282
|
+
(showUnconnectableHandles === false ? ` ${eccgui}-graphviz__node--hidehandles` : "")
|
|
283
|
+
}
|
|
284
|
+
>
|
|
285
|
+
<header className={`${eccgui}-graphviz__node__header`}>
|
|
286
|
+
{(!!iconName || !!depiction) && (
|
|
287
|
+
<span
|
|
288
|
+
className={`${eccgui}-graphviz__node__header-depiction`}
|
|
289
|
+
>
|
|
290
|
+
{!!depiction && imgWithTooltip(<img src={depiction} alt="" />, (minimalShape === "none" || selected) ? typeLabel : undefined)}
|
|
291
|
+
{(!!iconName && !depiction) && <Icon name={iconName} tooltipText={(minimalShape === "none" || selected) ? typeLabel : undefined} />}
|
|
292
|
+
</span>
|
|
293
|
+
)}
|
|
294
|
+
<span
|
|
295
|
+
className={`${eccgui}-graphviz__node__header-label`}
|
|
296
|
+
title={label}
|
|
297
|
+
>
|
|
298
|
+
{label}
|
|
299
|
+
</span>
|
|
300
|
+
{(menuButtons || (showExecutionButtons && executionButtons)) && (
|
|
301
|
+
<span
|
|
302
|
+
className={`${eccgui}-graphviz__node__header-menu`}
|
|
303
|
+
>
|
|
304
|
+
{(showExecutionButtons && typeof executionButtons === "function") ? executionButtons(adjustedContentProps, setAdjustedContentProps) : null}
|
|
305
|
+
{menuButtons??null}
|
|
306
|
+
</span>
|
|
307
|
+
)}
|
|
308
|
+
</header>
|
|
309
|
+
{content && (
|
|
310
|
+
<div className={`${eccgui}-graphviz__node__content`}>
|
|
311
|
+
{typeof content === "function" ? content(adjustedContentProps) : content}
|
|
312
|
+
</div>
|
|
313
|
+
)}
|
|
314
|
+
{contentExtension && (
|
|
315
|
+
<div className={`${eccgui}-graphviz__node__footer`}>
|
|
316
|
+
{contentExtension}
|
|
317
|
+
</div>
|
|
318
|
+
)}
|
|
319
|
+
</section>
|
|
320
|
+
{!!handles && (
|
|
321
|
+
<>
|
|
322
|
+
{ addHandles(handleStack, Position.Top, "left", isConnectable, style) }
|
|
323
|
+
{ addHandles(handleStack, Position.Right, "top", isConnectable, style) }
|
|
324
|
+
{ addHandles(handleStack, Position.Bottom, "left", isConnectable, style) }
|
|
325
|
+
{ addHandles(handleStack, Position.Left, "top", isConnectable, style) }
|
|
326
|
+
</>
|
|
327
|
+
)}
|
|
328
|
+
</>
|
|
329
|
+
);
|
|
330
|
+
}
|