@eccenca/gui-elements 23.2.0 → 23.3.0-rc.1
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 +53 -0
- package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js +5 -1
- package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -1
- package/dist/cjs/cmem/react-flow/StickyNoteModal/StickyNoteModal.js +9 -11
- package/dist/cjs/cmem/react-flow/StickyNoteModal/StickyNoteModal.js.map +1 -1
- package/dist/cjs/cmem/react-flow/extensions/ReactFlowHotkeyContext.js +12 -0
- package/dist/cjs/cmem/react-flow/extensions/ReactFlowHotkeyContext.js.map +1 -0
- package/dist/cjs/common/index.js +5 -2
- package/dist/cjs/common/index.js.map +1 -1
- package/dist/cjs/common/utils/globalVars.js +21 -0
- package/dist/cjs/common/utils/globalVars.js.map +1 -0
- package/dist/cjs/components/Application/ApplicationHeader.js +2 -3
- package/dist/cjs/components/Application/ApplicationHeader.js.map +1 -1
- package/dist/cjs/components/Dialog/Modal.js +35 -8
- package/dist/cjs/components/Dialog/Modal.js.map +1 -1
- package/dist/cjs/components/Dialog/SimpleDialog.js +15 -2
- package/dist/cjs/components/Dialog/SimpleDialog.js.map +1 -1
- package/dist/cjs/components/Icon/IconButton.js +1 -1
- package/dist/cjs/components/Icon/IconButton.js.map +1 -1
- package/dist/cjs/components/Icon/canonicalIconNames.js +1 -0
- package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/cjs/components/OverviewItem/OverviewItemDepiction.js +3 -6
- package/dist/cjs/components/OverviewItem/OverviewItemDepiction.js.map +1 -1
- package/dist/cjs/components/PropertyValuePair/PropertyName.js +3 -3
- package/dist/cjs/components/PropertyValuePair/PropertyName.js.map +1 -1
- package/dist/cjs/components/Separation/Spacing.js +18 -4
- package/dist/cjs/components/Separation/Spacing.js.map +1 -1
- package/dist/cjs/components/Table/TableExpandHeader.js +7 -8
- package/dist/cjs/components/Table/TableExpandHeader.js.map +1 -1
- package/dist/cjs/components/TextField/TextField.js +23 -3
- package/dist/cjs/components/TextField/TextField.js.map +1 -1
- package/dist/cjs/extensions/codemirror/CodeMirror.js +39 -7
- package/dist/cjs/extensions/codemirror/CodeMirror.js.map +1 -1
- package/dist/cjs/extensions/react-flow/edges/EdgeLabel.js +10 -9
- package/dist/cjs/extensions/react-flow/edges/EdgeLabel.js.map +1 -1
- package/dist/cjs/extensions/react-flow/handles/HandleContent.js +4 -4
- package/dist/cjs/extensions/react-flow/handles/HandleContent.js.map +1 -1
- package/dist/cjs/extensions/react-flow/handles/HandleDefault.js +56 -6
- package/dist/cjs/extensions/react-flow/handles/HandleDefault.js.map +1 -1
- package/dist/cjs/extensions/react-flow/handles/HandleTools.js +41 -0
- package/dist/cjs/extensions/react-flow/handles/HandleTools.js.map +1 -0
- package/dist/cjs/extensions/react-flow/index.js +2 -0
- package/dist/cjs/extensions/react-flow/index.js.map +1 -1
- package/dist/cjs/extensions/react-flow/nodes/NodeContent.js +42 -13
- package/dist/cjs/extensions/react-flow/nodes/NodeContent.js.map +1 -1
- package/dist/esm/cmem/markdown/Markdown.js +1 -1
- package/dist/esm/cmem/react-flow/ReactFlow/ReactFlow.js +5 -1
- package/dist/esm/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -1
- package/dist/esm/cmem/react-flow/StickyNoteModal/StickyNoteModal.js +9 -11
- package/dist/esm/cmem/react-flow/StickyNoteModal/StickyNoteModal.js.map +1 -1
- package/dist/esm/cmem/react-flow/extensions/ReactFlowHotkeyContext.js +6 -0
- package/dist/esm/cmem/react-flow/extensions/ReactFlowHotkeyContext.js.map +1 -0
- package/dist/esm/common/index.js +5 -2
- package/dist/esm/common/index.js.map +1 -1
- package/dist/esm/common/utils/globalVars.js +16 -0
- package/dist/esm/common/utils/globalVars.js.map +1 -0
- package/dist/esm/components/Application/ApplicationHeader.js +2 -3
- package/dist/esm/components/Application/ApplicationHeader.js.map +1 -1
- package/dist/esm/components/Dialog/Modal.js +36 -9
- package/dist/esm/components/Dialog/Modal.js.map +1 -1
- package/dist/esm/components/Dialog/SimpleDialog.js +14 -1
- package/dist/esm/components/Dialog/SimpleDialog.js.map +1 -1
- package/dist/esm/components/Icon/IconButton.js +1 -1
- package/dist/esm/components/Icon/IconButton.js.map +1 -1
- package/dist/esm/components/Icon/canonicalIconNames.js +1 -0
- package/dist/esm/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/esm/components/OverviewItem/OverviewItemDepiction.js +3 -6
- package/dist/esm/components/OverviewItem/OverviewItemDepiction.js.map +1 -1
- package/dist/esm/components/PropertyValuePair/PropertyName.js +3 -3
- package/dist/esm/components/PropertyValuePair/PropertyName.js.map +1 -1
- package/dist/esm/components/Separation/Spacing.js +28 -4
- package/dist/esm/components/Separation/Spacing.js.map +1 -1
- package/dist/esm/components/Table/TableExpandHeader.js +7 -8
- package/dist/esm/components/Table/TableExpandHeader.js.map +1 -1
- package/dist/esm/components/TextField/TextField.js +25 -5
- package/dist/esm/components/TextField/TextField.js.map +1 -1
- package/dist/esm/extensions/codemirror/CodeMirror.js +49 -6
- package/dist/esm/extensions/codemirror/CodeMirror.js.map +1 -1
- package/dist/esm/extensions/react-flow/edges/EdgeLabel.js +10 -9
- package/dist/esm/extensions/react-flow/edges/EdgeLabel.js.map +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleContent.js +16 -5
- package/dist/esm/extensions/react-flow/handles/HandleContent.js.map +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleDefault.js +75 -9
- package/dist/esm/extensions/react-flow/handles/HandleDefault.js.map +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleTools.js +61 -0
- package/dist/esm/extensions/react-flow/handles/HandleTools.js.map +1 -0
- package/dist/esm/extensions/react-flow/index.js +2 -0
- package/dist/esm/extensions/react-flow/index.js.map +1 -1
- package/dist/esm/extensions/react-flow/nodes/NodeContent.js +49 -20
- package/dist/esm/extensions/react-flow/nodes/NodeContent.js.map +1 -1
- package/dist/types/cmem/react-flow/extensions/ReactFlowHotkeyContext.d.ts +8 -0
- package/dist/types/common/index.d.ts +4 -0
- package/dist/types/common/utils/globalVars.d.ts +2 -0
- package/dist/types/components/Application/ApplicationHeader.d.ts +1 -2
- package/dist/types/components/Dialog/Modal.d.ts +22 -7
- package/dist/types/components/Dialog/SimpleDialog.d.ts +12 -1
- package/dist/types/components/Icon/canonicalIconNames.d.ts +1 -1
- package/dist/types/components/PropertyValuePair/PropertyName.d.ts +7 -1
- package/dist/types/components/Separation/Spacing.d.ts +2 -2
- package/dist/types/components/Table/TableExpandHeader.d.ts +5 -1
- package/dist/types/components/TextField/TextField.d.ts +4 -2
- package/dist/types/extensions/codemirror/CodeMirror.d.ts +17 -3
- package/dist/types/extensions/react-flow/edges/EdgeLabel.d.ts +7 -3
- package/dist/types/extensions/react-flow/handles/HandleContent.d.ts +7 -2
- package/dist/types/extensions/react-flow/handles/HandleDefault.d.ts +15 -6
- package/dist/types/extensions/react-flow/handles/HandleTools.d.ts +7 -0
- package/dist/types/extensions/react-flow/index.d.ts +2 -0
- package/dist/types/extensions/react-flow/nodes/NodeContent.d.ts +24 -8
- package/package.json +19 -17
- package/scripts/compile-sass.ts +1 -1
- package/src/cmem/react-flow/ReactFlow/ReactFlow.tsx +10 -0
- package/src/cmem/react-flow/StickyNoteModal/StickyNoteModal.tsx +10 -12
- package/src/cmem/react-flow/extensions/ReactFlowHotkeyContext.ts +14 -0
- package/src/common/index.ts +6 -3
- package/src/common/utils/globalVars.ts +18 -0
- package/src/components/Application/ApplicationHeader.tsx +8 -13
- package/src/components/Application/_header.scss +17 -17
- package/src/components/Application/_toolbar.scss +22 -33
- package/src/components/Application/application.scss +8 -6
- package/src/components/AutoSuggestion/tests/AutoSuggestion.test.tsx +34 -21
- package/src/components/AutoSuggestion/tests/SingleLineCodeEditor.test.tsx +20 -9
- package/src/components/Dialog/Modal.tsx +96 -39
- package/src/components/Dialog/SimpleDialog.tsx +19 -1
- package/src/components/Dialog/dialog.scss +33 -17
- package/src/components/Icon/IconButton.tsx +1 -1
- package/src/components/Icon/canonicalIconNames.tsx +2 -0
- package/src/components/OverviewItem/OverviewItemDepiction.tsx +8 -16
- package/src/components/PropertyValuePair/PropertyName.tsx +15 -4
- package/src/components/PropertyValuePair/propertyvalue.scss +1 -0
- package/src/components/Separation/Spacing.tsx +12 -8
- package/src/components/Table/TableExpandHeader.tsx +21 -18
- package/src/components/TextField/TextField.tsx +32 -6
- package/src/components/Tooltip/tooltip.scss +15 -1
- package/src/extensions/codemirror/CodeMirror.tsx +62 -8
- package/src/extensions/codemirror/_codemirror.scss +53 -8
- package/src/extensions/react-flow/edges/EdgeLabel.tsx +78 -81
- package/src/extensions/react-flow/edges/_edges.scss +62 -67
- package/src/extensions/react-flow/edges/stories/EdgeDefault.stories.tsx +43 -44
- package/src/extensions/react-flow/handles/HandleContent.tsx +14 -13
- package/src/extensions/react-flow/handles/HandleDefault.tsx +121 -44
- package/src/extensions/react-flow/handles/HandleTools.tsx +46 -0
- package/src/extensions/react-flow/handles/_handles.scss +135 -50
- package/src/extensions/react-flow/handles/stories/HandleDefault.stories.tsx +69 -25
- package/src/extensions/react-flow/index.ts +2 -0
- package/src/extensions/react-flow/nodes/NodeContent.tsx +97 -32
- package/src/extensions/react-flow/nodes/_nodes.scss +170 -110
- package/src/extensions/react-flow/nodes/stories/NodeContent.stories.tsx +75 -52
- package/src/extensions/react-flow/nodes/stories/NodeDefault.stories.tsx +34 -36
- package/src/extensions/react-flow/nodes/stories/nodeTypes.ts +11 -0
|
@@ -3,23 +3,31 @@
|
|
|
3
3
|
--#{$eccgui}-reactflow-node-color-hover: #{$reactflow-edge-stroke-color-hover};
|
|
4
4
|
--#{$eccgui}-reactflow-node-color-selected: #{$reactflow-edge-stroke-color-selected};
|
|
5
5
|
|
|
6
|
-
stroke: var(--#{$eccgui}-reactflow-node-color-default);
|
|
7
6
|
color: var(--#{$eccgui}-reactflow-node-color-default);
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
// stroke: var(--#{$eccgui}-reactflow-node-color-default); // removed, probably not necessary
|
|
9
|
+
|
|
10
|
+
path[class*="react-flow__edge"],
|
|
11
|
+
rect[class*="react-flow__edge"] {
|
|
11
12
|
stroke-opacity: $reactflow-edge-stroke-opacity-default;
|
|
13
|
+
shape-rendering: optimizespeed;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
text[class*="react-flow__edge"] {
|
|
15
17
|
opacity: $reactflow-edge-stroke-opacity-default;
|
|
16
18
|
}
|
|
17
19
|
|
|
20
|
+
.react-flow__edge-textbg {
|
|
21
|
+
stroke: currentcolor;
|
|
22
|
+
}
|
|
23
|
+
|
|
18
24
|
&:hover {
|
|
19
|
-
stroke: var(--#{$eccgui}-reactflow-node-color-hover);
|
|
20
25
|
color: var(--#{$eccgui}-reactflow-node-color-hover);
|
|
21
26
|
|
|
22
|
-
|
|
27
|
+
// stroke: var(--#{$eccgui}-reactflow-node-color-hover); // removed, probably not necessary
|
|
28
|
+
|
|
29
|
+
path[class*="react-flow__edge"],
|
|
30
|
+
rect[class*="react-flow__edge"] {
|
|
23
31
|
stroke-opacity: $reactflow-edge-stroke-opacity-hover;
|
|
24
32
|
}
|
|
25
33
|
|
|
@@ -29,10 +37,11 @@
|
|
|
29
37
|
}
|
|
30
38
|
|
|
31
39
|
&.selected {
|
|
32
|
-
stroke: var(--#{$eccgui}-reactflow-node-color-selected);
|
|
33
40
|
color: var(--#{$eccgui}-reactflow-node-color-selected);
|
|
41
|
+
stroke: var(--#{$eccgui}-reactflow-node-color-selected);
|
|
34
42
|
|
|
35
|
-
path[class*="react-flow__edge"],
|
|
43
|
+
path[class*="react-flow__edge"],
|
|
44
|
+
rect[class*="react-flow__edge"] {
|
|
36
45
|
stroke-opacity: $reactflow-edge-stroke-opacity-selected;
|
|
37
46
|
}
|
|
38
47
|
|
|
@@ -43,19 +52,19 @@
|
|
|
43
52
|
}
|
|
44
53
|
|
|
45
54
|
path.react-flow__edge-path {
|
|
46
|
-
stroke
|
|
47
|
-
stroke: currentColor;
|
|
55
|
+
stroke: currentcolor;
|
|
48
56
|
stroke-opacity: $reactflow-edge-stroke-opacity-default;
|
|
57
|
+
stroke-width: 2;
|
|
49
58
|
|
|
50
59
|
.react-flow__edge.selected & {
|
|
60
|
+
stroke: currentcolor;
|
|
51
61
|
stroke-width: 2;
|
|
52
|
-
stroke: currentColor;
|
|
53
62
|
}
|
|
54
63
|
}
|
|
55
64
|
|
|
56
65
|
path.react-flow__edge-path-glow {
|
|
57
|
-
stroke: currentColor;
|
|
58
66
|
fill: none;
|
|
67
|
+
stroke: currentcolor;
|
|
59
68
|
stroke-linecap: round;
|
|
60
69
|
|
|
61
70
|
.react-flow__edge & {
|
|
@@ -77,9 +86,9 @@ path.react-flow__edge-path-glow {
|
|
|
77
86
|
}
|
|
78
87
|
|
|
79
88
|
.react-flow__edgeupdater {
|
|
80
|
-
stroke: currentColor;
|
|
81
|
-
fill: currentColor;
|
|
82
89
|
opacity: 0;
|
|
90
|
+
fill: currentcolor;
|
|
91
|
+
stroke: currentcolor;
|
|
83
92
|
|
|
84
93
|
&:hover {
|
|
85
94
|
opacity: 0.05;
|
|
@@ -87,13 +96,10 @@ path.react-flow__edge-path-glow {
|
|
|
87
96
|
}
|
|
88
97
|
|
|
89
98
|
.react-flow__edge-text {
|
|
90
|
-
fill:
|
|
99
|
+
fill: currentcolor;
|
|
91
100
|
stroke: none;
|
|
92
101
|
}
|
|
93
102
|
|
|
94
|
-
.react-flow__edge-textbg {
|
|
95
|
-
}
|
|
96
|
-
|
|
97
103
|
// Stroke types
|
|
98
104
|
|
|
99
105
|
path.react-flow__edge-path--stroke-solid {
|
|
@@ -111,16 +117,16 @@ path.react-flow__edge-path--stroke-dotted,
|
|
|
111
117
|
}
|
|
112
118
|
|
|
113
119
|
path.react-flow__edge-path--stroke-double {
|
|
120
|
+
filter: drop-shadow(1px 1px 1px currentcolor) drop-shadow(-1px -1px 1px currentcolor);
|
|
114
121
|
stroke: #fff !important;
|
|
115
122
|
stroke-opacity: 1 !important;
|
|
116
|
-
filter: drop-shadow(1px 1px 1px currentColor) drop-shadow(-1px -1px 1px currentColor);
|
|
117
123
|
}
|
|
118
124
|
|
|
119
125
|
path.react-flow__edge-path--stroke-doubledashed {
|
|
126
|
+
filter: drop-shadow(1px 1px 1px currentcolor) drop-shadow(-1px -1px 1px currentcolor);
|
|
120
127
|
stroke: #fff !important;
|
|
121
|
-
stroke-opacity: 1 !important;
|
|
122
|
-
filter: drop-shadow(1px 1px 1px currentColor) drop-shadow(-1px -1px 1px currentColor);
|
|
123
128
|
stroke-dasharray: 5;
|
|
129
|
+
stroke-opacity: 1 !important;
|
|
124
130
|
}
|
|
125
131
|
|
|
126
132
|
// Intent states
|
|
@@ -165,13 +171,12 @@ g.#{$eccgui}-intent--danger {
|
|
|
165
171
|
// Highlightning
|
|
166
172
|
|
|
167
173
|
path.react-flow__edge-path-highlight {
|
|
168
|
-
|
|
174
|
+
filter: drop-shadow(2px -2px 1px var(--edge-highlight-default-color))
|
|
175
|
+
drop-shadow(-2px 2px 1px var(--edge-highlight-alternate-color, var(--edge-highlight-default-color)));
|
|
169
176
|
fill: none;
|
|
170
|
-
stroke-linecap: round;
|
|
171
177
|
stroke: #fff;
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
drop-shadow(-2px 2px 1px var(--edge-highlight-alternate-color, var(--edge-highlight-default-color)));
|
|
178
|
+
stroke-linecap: round;
|
|
179
|
+
stroke-opacity: 1;
|
|
175
180
|
}
|
|
176
181
|
|
|
177
182
|
.#{$eccgui}-graphviz__edge--highlight-default {
|
|
@@ -189,16 +194,8 @@ path.react-flow__edge-path-highlight {
|
|
|
189
194
|
--edge-highlight-alternate-color: #{$eccgui-color-primary};
|
|
190
195
|
}
|
|
191
196
|
|
|
192
|
-
|
|
193
|
-
|
|
194
197
|
// Type colors
|
|
195
198
|
|
|
196
|
-
.react-flow__edge-default,
|
|
197
|
-
.react-flow__edge-straight,
|
|
198
|
-
.react-flow__edge-smoothstep,
|
|
199
|
-
.react-flow__edge-step {
|
|
200
|
-
}
|
|
201
|
-
|
|
202
199
|
.react-flow__edge-success {
|
|
203
200
|
--#{$eccgui}-reactflow-node-color-default: #{$eccgui-color-success-text};
|
|
204
201
|
--#{$eccgui}-reactflow-node-color-hover: #{$eccgui-color-success-text};
|
|
@@ -221,34 +218,29 @@ path.react-flow__edge-path-highlight {
|
|
|
221
218
|
|
|
222
219
|
.#{$eccgui}-graphviz__edgetools-target {
|
|
223
220
|
position: fixed;
|
|
221
|
+
z-index: 1000;
|
|
224
222
|
width: $eccgui-size-block-whitespace * 2;
|
|
225
223
|
height: $eccgui-size-block-whitespace * 2;
|
|
226
|
-
//margin-left: -1 * $eccgui-size-block-whitespace;
|
|
227
224
|
margin-top: -1 * $eccgui-size-block-whitespace;
|
|
228
|
-
z-index: 1000;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
.#{$eccgui}-graphviz__edgetools-overlay {
|
|
232
|
-
//transform: translate(#{$eccgui-size-block-whitespace}, #{-1 * $eccgui-size-block-whitespace});
|
|
233
225
|
}
|
|
234
226
|
|
|
235
227
|
.#{$eccgui}-graphviz__edgetools-content {
|
|
236
|
-
padding: $eccgui-size-block-whitespace * 0.5;
|
|
237
|
-
max-width: $reactflow-node-basesize * 8;
|
|
238
228
|
min-width: $reactflow-node-basesize;
|
|
239
|
-
max-
|
|
229
|
+
max-width: $reactflow-node-basesize * 8;
|
|
240
230
|
min-height: $reactflow-node-basesize;
|
|
231
|
+
max-height: $reactflow-node-basesize * 13;
|
|
232
|
+
padding: $eccgui-size-block-whitespace * 0.5;
|
|
241
233
|
}
|
|
242
234
|
|
|
243
235
|
// Arrows
|
|
244
236
|
|
|
245
237
|
.react-flow__arrowhead {
|
|
246
238
|
polyline {
|
|
247
|
-
|
|
239
|
+
fill: currentcolor;
|
|
240
|
+
stroke: currentcolor;
|
|
248
241
|
stroke-linecap: square;
|
|
249
242
|
stroke-linejoin: miter;
|
|
250
|
-
stroke:
|
|
251
|
-
fill: currentColor;
|
|
243
|
+
stroke-width: 1px;
|
|
252
244
|
transform: scale(1.75, 0.75);
|
|
253
245
|
}
|
|
254
246
|
}
|
|
@@ -256,54 +248,57 @@ path.react-flow__edge-path-highlight {
|
|
|
256
248
|
// Custom label
|
|
257
249
|
|
|
258
250
|
.#{$eccgui}-graphviz__edge-label {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
color: currentColor;
|
|
251
|
+
--#{$eccgui}-reactflow-edge-label-color: currentcolor;
|
|
252
|
+
--#{$eccgui}-reactflow-edge-label-color-background: #{$card-background-color};
|
|
253
|
+
|
|
263
254
|
display: inline-flex;
|
|
264
255
|
align-items: center;
|
|
265
256
|
width: auto;
|
|
266
257
|
max-width: 20rem;
|
|
267
258
|
height: 0.5 * $reactflow-node-largesize;
|
|
268
259
|
font-size: $reactflow-node-font-size;
|
|
260
|
+
color: var(--#{$eccgui}-reactflow-edge-label-color, currentColor);
|
|
261
|
+
background-color: var(--#{$eccgui}-reactflow-edge-label-color-background, #{$card-background-color});
|
|
262
|
+
border: 0.5 * $reactflow-node-border-width solid transparent;
|
|
263
|
+
border-color: var(--#{$eccgui}-reactflow-edge-label-color, currentColor);
|
|
264
|
+
border-radius: $reactflow-node-border-radius;
|
|
265
|
+
|
|
266
|
+
&.#{$eccgui}-graphviz__edge-label--loose {
|
|
267
|
+
background-color: transparent;
|
|
268
|
+
border: none;
|
|
269
|
+
}
|
|
269
270
|
|
|
270
271
|
&.#{$eccgui}-intent--primary {
|
|
271
|
-
color: $eccgui-color-primary;
|
|
272
|
-
border-color: $eccgui-color-primary;
|
|
272
|
+
--#{$eccgui}-reactflow-edge-label-color: #{$eccgui-color-primary};
|
|
273
273
|
}
|
|
274
274
|
&.#{$eccgui}-intent--accent {
|
|
275
|
-
color: $eccgui-color-accent;
|
|
276
|
-
border-color: $eccgui-color-accent;
|
|
275
|
+
--#{$eccgui}-reactflow-edge-label-color: #{$eccgui-color-accent};
|
|
277
276
|
}
|
|
278
277
|
&.#{$eccgui}-intent--success {
|
|
279
|
-
color: $eccgui-color-success-text;
|
|
280
|
-
border-color: $eccgui-color-success-text;
|
|
278
|
+
--#{$eccgui}-reactflow-edge-label-color: #{$eccgui-color-success-text};
|
|
281
279
|
}
|
|
282
280
|
&.#{$eccgui}-intent--info {
|
|
283
|
-
color: $eccgui-color-info-text;
|
|
284
|
-
border-color: $eccgui-color-info-text;
|
|
281
|
+
--#{$eccgui}-reactflow-edge-label-color: #{$eccgui-color-info-text};
|
|
285
282
|
}
|
|
286
283
|
&.#{$eccgui}-intent--warning {
|
|
287
|
-
color: $eccgui-color-warning-text;
|
|
288
|
-
border-color: $eccgui-color-warning-text;
|
|
284
|
+
--#{$eccgui}-reactflow-edge-label-color: #{$eccgui-color-warning-text};
|
|
289
285
|
}
|
|
290
286
|
&.#{$eccgui}-intent--danger {
|
|
291
|
-
color: $eccgui-color-danger-text;
|
|
292
|
-
border-color: $eccgui-color-danger-text;
|
|
287
|
+
--#{$eccgui}-reactflow-edge-label-color: #{$eccgui-color-danger-text};
|
|
293
288
|
}
|
|
294
289
|
}
|
|
295
290
|
.#{$eccgui}-graphviz__edge-label--large {
|
|
296
291
|
height: $reactflow-node-largesize;
|
|
297
292
|
}
|
|
298
293
|
.#{$eccgui}-graphviz__edge-label--fullwidth {
|
|
299
|
-
max-width: none;
|
|
300
294
|
width: 100%;
|
|
295
|
+
max-width: none;
|
|
301
296
|
}
|
|
302
297
|
.#{$eccgui}-graphviz__edge-label__depiction {
|
|
303
|
-
margin-left: 2px;
|
|
304
298
|
display: inline-flex;
|
|
305
299
|
flex-grow: 0;
|
|
306
300
|
flex-shrink: 0;
|
|
301
|
+
margin-left: 2px;
|
|
307
302
|
.#{$eccgui}-depiction__image {
|
|
308
303
|
height: calc(#{0.5 * $reactflow-node-largesize} - 4px);
|
|
309
304
|
|
|
@@ -313,20 +308,20 @@ path.react-flow__edge-path-highlight {
|
|
|
313
308
|
}
|
|
314
309
|
}
|
|
315
310
|
.#{$eccgui}-graphviz__edge-label__text {
|
|
316
|
-
margin: 0 $eccgui-size-block-whitespace * 0.25;
|
|
317
311
|
flex-grow: 1;
|
|
318
312
|
flex-shrink: 1;
|
|
319
|
-
|
|
313
|
+
margin: 0 $eccgui-size-block-whitespace * 0.25;
|
|
320
314
|
overflow: hidden;
|
|
321
|
-
text-overflow: ellipsis;
|
|
322
315
|
text-align: center;
|
|
316
|
+
text-overflow: ellipsis;
|
|
317
|
+
white-space: nowrap;
|
|
323
318
|
|
|
324
319
|
.#{$eccgui}-graphviz__edge-label--fullwidth & {
|
|
325
320
|
text-align: left;
|
|
326
321
|
}
|
|
327
322
|
}
|
|
328
323
|
.#{$eccgui}-graphviz__edge-label__aux {
|
|
329
|
-
margin-right: $eccgui-size-block-whitespace * 0.25;
|
|
330
324
|
flex-grow: 0;
|
|
331
325
|
flex-shrink: 0;
|
|
326
|
+
margin-right: $eccgui-size-block-whitespace * 0.25;
|
|
332
327
|
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { ArrowHeadType, Elements, getMarkerEnd, ReactFlowProvider } from 'react-flow-renderer';
|
|
1
|
+
import React, { useCallback, useEffect, useState } from "react";
|
|
2
|
+
import { ArrowHeadType, Elements, getMarkerEnd, ReactFlowProvider } from "react-flow-renderer";
|
|
3
|
+
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
|
5
4
|
|
|
5
|
+
import { EdgeLabel, EdgeLabelObject, ReactFlow } from "./../../../../../index";
|
|
6
6
|
import { EdgeDefault, EdgeDefaultDataProps as EdgeData } from "./../EdgeDefault";
|
|
7
7
|
import { edgeTypes } from "./../edgeTypes";
|
|
8
8
|
|
|
9
9
|
const EdgeDefaultDataProps = (data: EdgeData) => {
|
|
10
10
|
// this is only a mock to get it as sub element in the table
|
|
11
11
|
return <></>;
|
|
12
|
-
}
|
|
12
|
+
};
|
|
13
13
|
|
|
14
14
|
export default {
|
|
15
|
-
title: "Extensions/React Flow/
|
|
15
|
+
title: "Extensions/React Flow/Edge",
|
|
16
16
|
component: EdgeDefault,
|
|
17
17
|
subcomponents: { EdgeDefaultDataProps },
|
|
18
18
|
argTypes: {
|
|
19
19
|
type: {
|
|
20
20
|
control: "select",
|
|
21
|
-
options: [...
|
|
21
|
+
options: [...Object.keys(edgeTypes)],
|
|
22
22
|
},
|
|
23
23
|
},
|
|
24
24
|
} as ComponentMeta<typeof EdgeDefault>;
|
|
@@ -33,7 +33,9 @@ const EdgeDefaultExample = (args: any) => {
|
|
|
33
33
|
id: args.source,
|
|
34
34
|
type: "default",
|
|
35
35
|
data: {
|
|
36
|
-
label: "Default ",
|
|
36
|
+
label: "Default ",
|
|
37
|
+
content: "Example content.",
|
|
38
|
+
minimalShape: "none",
|
|
37
39
|
},
|
|
38
40
|
position: { x: 50, y: 200 },
|
|
39
41
|
},
|
|
@@ -41,13 +43,15 @@ const EdgeDefaultExample = (args: any) => {
|
|
|
41
43
|
id: args.target,
|
|
42
44
|
type: "default",
|
|
43
45
|
data: {
|
|
44
|
-
label: "Default ",
|
|
46
|
+
label: "Default ",
|
|
47
|
+
content: "Example content.",
|
|
48
|
+
minimalShape: "none",
|
|
45
49
|
},
|
|
46
50
|
position: { x: 600, y: 200 },
|
|
47
51
|
},
|
|
48
52
|
{
|
|
49
|
-
...args
|
|
50
|
-
}
|
|
53
|
+
...args,
|
|
54
|
+
},
|
|
51
55
|
] as Elements);
|
|
52
56
|
}, [args]);
|
|
53
57
|
|
|
@@ -60,31 +64,30 @@ const EdgeDefaultExample = (args: any) => {
|
|
|
60
64
|
[reactflowInstance]
|
|
61
65
|
);
|
|
62
66
|
|
|
63
|
-
return
|
|
64
|
-
<
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
67
|
+
return (
|
|
68
|
+
<ReactFlowProvider>
|
|
69
|
+
<ReactFlow
|
|
70
|
+
elements={elements}
|
|
71
|
+
style={{ height: "400px" }}
|
|
72
|
+
onLoad={onLoad}
|
|
73
|
+
edgeTypes={edgeTypes}
|
|
74
|
+
defaultZoom={1}
|
|
75
|
+
/>
|
|
76
|
+
</ReactFlowProvider>
|
|
77
|
+
);
|
|
78
|
+
};
|
|
73
79
|
|
|
74
|
-
const Template: ComponentStory<typeof EdgeDefault> = (args) =>
|
|
75
|
-
<EdgeDefaultExample {...args} />
|
|
76
|
-
);
|
|
80
|
+
const Template: ComponentStory<typeof EdgeDefault> = (args) => <EdgeDefaultExample {...args} />;
|
|
77
81
|
|
|
78
82
|
export const Default = Template.bind({});
|
|
79
83
|
Default.args = {
|
|
80
|
-
id:
|
|
81
|
-
type:
|
|
84
|
+
id: "default",
|
|
85
|
+
type: "dangerStep",
|
|
82
86
|
label: "edge",
|
|
83
87
|
arrowHeadType: "arrowclosed",
|
|
84
|
-
source:
|
|
85
|
-
target:
|
|
86
|
-
data: {
|
|
87
|
-
}
|
|
88
|
+
source: "node-1",
|
|
89
|
+
target: "node-2",
|
|
90
|
+
data: {},
|
|
88
91
|
};
|
|
89
92
|
|
|
90
93
|
export const CustomLabel = Template.bind({});
|
|
@@ -94,14 +97,12 @@ CustomLabel.args = {
|
|
|
94
97
|
arrowHeadType: undefined,
|
|
95
98
|
label: undefined,
|
|
96
99
|
data: {
|
|
97
|
-
renderLabel: (
|
|
98
|
-
edgeCenter: [number, number, number, number]
|
|
99
|
-
) => (
|
|
100
|
+
renderLabel: (edgeCenter: [number, number, number, number]) => (
|
|
100
101
|
<EdgeLabelObject edgeCenter={edgeCenter}>
|
|
101
|
-
|
|
102
|
+
<EdgeLabel text="Custom label that is very long" />
|
|
102
103
|
</EdgeLabelObject>
|
|
103
|
-
)
|
|
104
|
-
}
|
|
104
|
+
),
|
|
105
|
+
},
|
|
105
106
|
};
|
|
106
107
|
|
|
107
108
|
export const InverseEdge = Template.bind({});
|
|
@@ -111,10 +112,8 @@ InverseEdge.args = {
|
|
|
111
112
|
arrowHeadType: undefined,
|
|
112
113
|
data: {
|
|
113
114
|
inversePath: true,
|
|
114
|
-
markerStart: getMarkerEnd(
|
|
115
|
-
|
|
116
|
-
),
|
|
117
|
-
}
|
|
115
|
+
markerStart: getMarkerEnd(`${ArrowHeadType.ArrowClosed}-inverse` as ArrowHeadType),
|
|
116
|
+
},
|
|
118
117
|
};
|
|
119
118
|
|
|
120
119
|
export const AdjustStrokeType = Template.bind({});
|
|
@@ -122,7 +121,7 @@ AdjustStrokeType.args = {
|
|
|
122
121
|
...Default.args,
|
|
123
122
|
data: {
|
|
124
123
|
strokeType: "double",
|
|
125
|
-
}
|
|
124
|
+
},
|
|
126
125
|
};
|
|
127
126
|
|
|
128
127
|
export const AdjustIntent = Template.bind({});
|
|
@@ -130,13 +129,13 @@ AdjustIntent.args = {
|
|
|
130
129
|
...Default.args,
|
|
131
130
|
data: {
|
|
132
131
|
intent: "warning",
|
|
133
|
-
}
|
|
132
|
+
},
|
|
134
133
|
};
|
|
135
134
|
|
|
136
135
|
export const AdjustHighlight = Template.bind({});
|
|
137
136
|
AdjustHighlight.args = {
|
|
138
137
|
...Default.args,
|
|
139
138
|
data: {
|
|
140
|
-
highlightColor: ["default", "alternate"]
|
|
141
|
-
}
|
|
139
|
+
highlightColor: ["default", "alternate"],
|
|
140
|
+
},
|
|
142
141
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React, {memo} from
|
|
1
|
+
import React, { memo } from "react";
|
|
2
|
+
|
|
2
3
|
import { CLASSPREFIX as eccgui } from "../../../configuration/constants";
|
|
3
|
-
import { Tooltip } from "../../../index";
|
|
4
|
+
import { Tooltip, TooltipProps } from "../../../index";
|
|
4
5
|
|
|
5
6
|
export interface HandleContentProps {
|
|
6
7
|
children?: JSX.Element | string;
|
|
@@ -8,31 +9,31 @@ export interface HandleContentProps {
|
|
|
8
9
|
* Tooltip displayed as overlay on hover.
|
|
9
10
|
*/
|
|
10
11
|
extendedTooltip?: JSX.Element | string;
|
|
12
|
+
/**
|
|
13
|
+
* Configure the tooltip and overwrite automatically set options.
|
|
14
|
+
*/
|
|
15
|
+
tooltipProps?: Omit<TooltipProps, "content" | "children" | "renderTarget">;
|
|
11
16
|
}
|
|
12
17
|
|
|
13
|
-
export const HandleContent = memo(({
|
|
14
|
-
children
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const handleContent = !!children ? (
|
|
18
|
-
<div className={`${eccgui}-graphviz__handle__content`}>
|
|
19
|
-
{ children }
|
|
20
|
-
</div>
|
|
21
|
-
) : !!extendedTooltip ? (
|
|
18
|
+
export const HandleContent = memo(({ children, extendedTooltip, tooltipProps }: HandleContentProps) => {
|
|
19
|
+
const handleContent = children ? (
|
|
20
|
+
<div className={`${eccgui}-graphviz__handle__content`}>{children}</div>
|
|
21
|
+
) : extendedTooltip ? (
|
|
22
22
|
<div className={`${eccgui}-graphviz__handle__content`} />
|
|
23
23
|
) : (
|
|
24
24
|
<></>
|
|
25
25
|
);
|
|
26
26
|
|
|
27
|
-
if (
|
|
27
|
+
if (extendedTooltip && tooltipProps?.isOpen) {
|
|
28
28
|
return (
|
|
29
29
|
<Tooltip
|
|
30
30
|
content={extendedTooltip}
|
|
31
31
|
autoFocus={false}
|
|
32
32
|
enforceFocus={false}
|
|
33
33
|
openOnTargetFocus={false}
|
|
34
|
+
{...tooltipProps}
|
|
34
35
|
>
|
|
35
|
-
{
|
|
36
|
+
{handleContent}
|
|
36
37
|
</Tooltip>
|
|
37
38
|
);
|
|
38
39
|
}
|