@eccenca/gui-elements 23.0.0-rc.0 → 23.0.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 +6 -0
- package/README.md +1 -11
- package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js +7 -1
- package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -1
- package/dist/cjs/cmem/react-flow/configuration/customLabel.js +13 -0
- package/dist/cjs/cmem/react-flow/configuration/customLabel.js.map +1 -0
- package/dist/cjs/cmem/react-flow/configuration/inverseEdge.js +13 -0
- package/dist/cjs/cmem/react-flow/configuration/inverseEdge.js.map +1 -0
- package/dist/cjs/components/Dialog/SimpleDialog.js +9 -4
- package/dist/cjs/components/Dialog/SimpleDialog.js.map +1 -1
- package/dist/cjs/components/Icon/canonicalIconNames.js +10 -0
- package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/cjs/components/Iframe/IframeModal.js +2 -6
- package/dist/cjs/components/Iframe/IframeModal.js.map +1 -1
- package/dist/cjs/extensions/react-flow/edges/EdgeDefault.js +5 -5
- package/dist/cjs/extensions/react-flow/edges/EdgeDefault.js.map +1 -1
- package/dist/cjs/extensions/react-flow/index.js +5 -1
- package/dist/cjs/extensions/react-flow/index.js.map +1 -1
- package/dist/cjs/extensions/react-flow/markers/MarkerArrowClosedInverse.js +13 -0
- package/dist/cjs/extensions/react-flow/markers/MarkerArrowClosedInverse.js.map +1 -0
- package/dist/cjs/extensions/react-flow/markers/ReactFlowMarkers.js +15 -0
- package/dist/cjs/extensions/react-flow/markers/ReactFlowMarkers.js.map +1 -0
- package/dist/esm/cmem/react-flow/ReactFlow/ReactFlow.js +7 -1
- package/dist/esm/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -1
- package/dist/esm/cmem/react-flow/configuration/customLabel.js +10 -0
- package/dist/esm/cmem/react-flow/configuration/customLabel.js.map +1 -0
- package/dist/esm/cmem/react-flow/configuration/inverseEdge.js +10 -0
- package/dist/esm/cmem/react-flow/configuration/inverseEdge.js.map +1 -0
- package/dist/esm/components/Dialog/SimpleDialog.js +25 -4
- package/dist/esm/components/Dialog/SimpleDialog.js.map +1 -1
- package/dist/esm/components/Icon/canonicalIconNames.js +10 -0
- package/dist/esm/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/esm/components/Iframe/IframeModal.js +2 -22
- package/dist/esm/components/Iframe/IframeModal.js.map +1 -1
- package/dist/esm/extensions/react-flow/edges/EdgeDefault.js +6 -6
- package/dist/esm/extensions/react-flow/edges/EdgeDefault.js.map +1 -1
- 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/markers/MarkerArrowClosedInverse.js +6 -0
- package/dist/esm/extensions/react-flow/markers/MarkerArrowClosedInverse.js.map +1 -0
- package/dist/esm/extensions/react-flow/markers/ReactFlowMarkers.js +8 -0
- package/dist/esm/extensions/react-flow/markers/ReactFlowMarkers.js.map +1 -0
- package/dist/types/cmem/react-flow/ReactFlow/ReactFlow.d.ts +2 -3
- package/dist/types/cmem/react-flow/configuration/customLabel.d.ts +8 -0
- package/dist/types/cmem/react-flow/configuration/inverseEdge.d.ts +8 -0
- package/dist/types/components/Dialog/SimpleDialog.d.ts +5 -1
- package/dist/types/components/Icon/canonicalIconNames.d.ts +1 -1
- package/dist/types/extensions/react-flow/edges/EdgeDefault.d.ts +3 -0
- package/dist/types/extensions/react-flow/index.d.ts +2 -0
- package/dist/types/extensions/react-flow/markers/MarkerArrowClosedInverse.d.ts +2 -0
- package/dist/types/extensions/react-flow/markers/ReactFlowMarkers.d.ts +2 -0
- package/package.json +7 -3
- package/src/cmem/react-flow/ReactFlow/ReactFlow.stories.tsx +115 -39
- package/src/cmem/react-flow/ReactFlow/ReactFlow.tsx +10 -3
- package/src/cmem/react-flow/configuration/customLabel.ts +11 -0
- package/src/cmem/react-flow/configuration/inverseEdge.ts +11 -0
- package/src/common/utils/CssCustomProperties.ts +17 -7
- package/src/components/Dialog/SimpleDialog.tsx +25 -4
- package/src/components/Icon/canonicalIconNames.tsx +12 -0
- package/src/components/Iframe/IframeModal.tsx +6 -17
- package/src/extensions/react-flow/edges/EdgeDefault.tsx +7 -2
- package/src/extensions/react-flow/index.ts +2 -0
- package/src/extensions/react-flow/markers/MarkerArrowClosedInverse.tsx +25 -0
- package/src/extensions/react-flow/markers/ReactFlowMarkers.tsx +13 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import React, { useState, useEffect, useCallback } from "react";
|
|
1
|
+
import React, { useState, useEffect, useCallback, FC } from "react";
|
|
2
2
|
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
3
|
+
import IconButton from "../../../components/Icon/IconButton";
|
|
4
|
+
import { ReactFlow, ReactFlowProps } from "./ReactFlow";
|
|
5
|
+
import { ArrowHeadType, Elements, getMarkerEnd } from "react-flow-renderer";
|
|
5
6
|
|
|
6
7
|
export default {
|
|
7
8
|
title: "CMEM/React Flow/Configurations",
|
|
@@ -13,7 +14,7 @@ export default {
|
|
|
13
14
|
const nodeExamples = {
|
|
14
15
|
unspecified: [
|
|
15
16
|
{
|
|
16
|
-
id: 1,
|
|
17
|
+
id: 'unspecified-1',
|
|
17
18
|
type: "default",
|
|
18
19
|
data: {
|
|
19
20
|
label: "Default ", content: "Example content.", minimalShape: "none"
|
|
@@ -21,7 +22,7 @@ const nodeExamples = {
|
|
|
21
22
|
position: { x: 200, y: 50 },
|
|
22
23
|
},
|
|
23
24
|
{
|
|
24
|
-
id: 2,
|
|
25
|
+
id: 'unspecified-2',
|
|
25
26
|
type: "default",
|
|
26
27
|
data: {
|
|
27
28
|
label: "Default ", content: "Example content.", minimalShape: "none",
|
|
@@ -30,15 +31,15 @@ const nodeExamples = {
|
|
|
30
31
|
position: { x: 200, y: 300 },
|
|
31
32
|
},
|
|
32
33
|
{
|
|
33
|
-
id: 'e1', type: 'straight', label: "straight edge", arrowHeadType: "arrowclosed",source: '1', target: '2',
|
|
34
|
+
id: 'unspecified-e1', type: 'straight', label: "straight edge", arrowHeadType: "arrowclosed",source: 'unspecified-1', target: 'unspecified-2',
|
|
34
35
|
},
|
|
35
36
|
{
|
|
36
|
-
id: 'e2', type: 'step', label: "step edge", arrowHeadType: "arrowclosed",source: '2', target: '1',
|
|
37
|
+
id: 'unspecified-e2', type: 'step', label: "step edge", arrowHeadType: "arrowclosed",source: 'unspecified-2', target: 'unspecified-1',
|
|
37
38
|
}
|
|
38
39
|
],
|
|
39
40
|
linking: [
|
|
40
41
|
{
|
|
41
|
-
id: 1,
|
|
42
|
+
id: 'linking-1',
|
|
42
43
|
type: "sourcepath",
|
|
43
44
|
data: {
|
|
44
45
|
label: "Source path", content: "Example content.", minimalShape: "none"
|
|
@@ -46,7 +47,7 @@ const nodeExamples = {
|
|
|
46
47
|
position: { x: 100, y: 50 },
|
|
47
48
|
},
|
|
48
49
|
{
|
|
49
|
-
id: 2,
|
|
50
|
+
id: 'linking-2',
|
|
50
51
|
type: "targetpath",
|
|
51
52
|
data: {
|
|
52
53
|
label: "Target path", content: "Example content.", minimalShape: "none"
|
|
@@ -54,7 +55,7 @@ const nodeExamples = {
|
|
|
54
55
|
position: { x: 400, y: 200 },
|
|
55
56
|
},
|
|
56
57
|
{
|
|
57
|
-
id: 3,
|
|
58
|
+
id: 'linking-3',
|
|
58
59
|
type: "transformation",
|
|
59
60
|
data: {
|
|
60
61
|
label: "Transformation", content: "Example content.", minimalShape: "none"
|
|
@@ -62,7 +63,7 @@ const nodeExamples = {
|
|
|
62
63
|
position: { x: 700, y: 50 },
|
|
63
64
|
},
|
|
64
65
|
{
|
|
65
|
-
id: 4,
|
|
66
|
+
id: 'linking-4',
|
|
66
67
|
type: "comparator",
|
|
67
68
|
data: {
|
|
68
69
|
label: "Comparation", content: "Example content.", minimalShape: "none",
|
|
@@ -71,7 +72,7 @@ const nodeExamples = {
|
|
|
71
72
|
position: { x: 750, y: 300 },
|
|
72
73
|
},
|
|
73
74
|
{
|
|
74
|
-
id: 5,
|
|
75
|
+
id: 'linking-5',
|
|
75
76
|
type: "aggregator",
|
|
76
77
|
data: {
|
|
77
78
|
label: "Aggregation", content: "Example content.", minimalShape: "none",
|
|
@@ -79,15 +80,15 @@ const nodeExamples = {
|
|
|
79
80
|
},
|
|
80
81
|
position: { x: 50, y: 300 },
|
|
81
82
|
},
|
|
82
|
-
{ id: 'e1', type: 'value', label: "value edge", arrowHeadType: "arrowclosed",source: '1', target: '2' },
|
|
83
|
-
{ id: 'e2', type: 'score', label: "score edge", arrowHeadType: "arrowclosed",source: '2', target: '3' },
|
|
84
|
-
{ id: 'e3', type: 'success', label: "success edge", arrowHeadType: "arrowclosed",source: '3', target: '4' },
|
|
85
|
-
{ id: 'e4', type: 'warning', label: "warning edge", arrowHeadType: "arrowclosed",source: '4', target: '5' },
|
|
86
|
-
{ id: 'e5', type: 'danger', label: "danger edge", arrowHeadType: "arrowclosed",source: '5', target: '1' },
|
|
83
|
+
{ id: 'linking-e1', type: 'value', label: "value edge", arrowHeadType: "arrowclosed",source: 'linking-1', target: 'linking-2' },
|
|
84
|
+
{ id: 'linking-e2', type: 'score', label: "score edge", arrowHeadType: "arrowclosed",source: 'linking-2', target: 'linking-3' },
|
|
85
|
+
{ id: 'linking-e3', type: 'success', label: "success edge", arrowHeadType: "arrowclosed",source: 'linking-3', target: 'linking-4' },
|
|
86
|
+
{ id: 'linking-e4', type: 'warning', label: "warning edge", arrowHeadType: "arrowclosed",source: 'linking-4', target: 'linking-5' },
|
|
87
|
+
{ id: 'linking-e5', type: 'danger', label: "danger edge", arrowHeadType: "arrowclosed",source: 'linking-5', target: 'linking-1' },
|
|
87
88
|
],
|
|
88
89
|
workflow: [
|
|
89
90
|
{
|
|
90
|
-
id: 1,
|
|
91
|
+
id: 'workflow-1',
|
|
91
92
|
type: "dataset",
|
|
92
93
|
data: {
|
|
93
94
|
label: "Dataset", content: "Example content.", minimalShape: "none"
|
|
@@ -95,7 +96,7 @@ const nodeExamples = {
|
|
|
95
96
|
position: { x: 100, y: 50 },
|
|
96
97
|
},
|
|
97
98
|
{
|
|
98
|
-
id: 2,
|
|
99
|
+
id: 'workflow-2',
|
|
99
100
|
type: "linking",
|
|
100
101
|
data: {
|
|
101
102
|
label: "Linking", content: "Example content.", minimalShape: "none"
|
|
@@ -103,7 +104,7 @@ const nodeExamples = {
|
|
|
103
104
|
position: { x: 400, y: 200 },
|
|
104
105
|
},
|
|
105
106
|
{
|
|
106
|
-
id: 3,
|
|
107
|
+
id: 'workflow-3',
|
|
107
108
|
type: "transform",
|
|
108
109
|
data: {
|
|
109
110
|
label: "Transform", content: "Example content.", minimalShape: "none"
|
|
@@ -111,7 +112,7 @@ const nodeExamples = {
|
|
|
111
112
|
position: { x: 700, y: 50 },
|
|
112
113
|
},
|
|
113
114
|
{
|
|
114
|
-
id: 4,
|
|
115
|
+
id: 'workflow-4',
|
|
115
116
|
type: "task",
|
|
116
117
|
data: {
|
|
117
118
|
label: "Task", content: "Example content.", minimalShape: "none",
|
|
@@ -120,7 +121,7 @@ const nodeExamples = {
|
|
|
120
121
|
position: { x: 750, y: 300 },
|
|
121
122
|
},
|
|
122
123
|
{
|
|
123
|
-
id: 5,
|
|
124
|
+
id: 'workflow-5',
|
|
124
125
|
type: "workflow",
|
|
125
126
|
data: {
|
|
126
127
|
label: "Workflow", content: "Example content.", minimalShape: "none",
|
|
@@ -128,15 +129,15 @@ const nodeExamples = {
|
|
|
128
129
|
},
|
|
129
130
|
position: { x: 50, y: 300 },
|
|
130
131
|
},
|
|
131
|
-
{ id: 'e1', arrowHeadType: "arrowclosed",source: '1', target: '2' },
|
|
132
|
-
{ id: 'e2', arrowHeadType: "arrowclosed",source: '2', target: '3' },
|
|
133
|
-
{ id: 'e3', type: 'success', label: "success edge", arrowHeadType: "arrowclosed",source: '3', target: '4' },
|
|
134
|
-
{ id: 'e4', type: 'warning', label: "warning edge", arrowHeadType: "arrowclosed",source: '4', target: '5' },
|
|
135
|
-
{ id: 'e5', type: 'danger', label: "danger edge", arrowHeadType: "arrowclosed",source: '5', target: '1' },
|
|
132
|
+
{ id: 'workflow-e1', arrowHeadType: "arrowclosed",source: 'workflow-1', target: 'workflow-2' },
|
|
133
|
+
{ id: 'workflow-e2', arrowHeadType: "arrowclosed",source: 'workflow-2', target: 'workflow-3' },
|
|
134
|
+
{ id: 'workflow-e3', type: 'success', label: "success edge", arrowHeadType: "arrowclosed",source: 'workflow-3', target: 'workflow-4' },
|
|
135
|
+
{ id: 'workflow-e4', type: 'warning', label: "warning edge", arrowHeadType: "arrowclosed",source: 'workflow-4', target: 'workflow-5' },
|
|
136
|
+
{ id: 'workflow-e5', type: 'danger', label: "danger edge", arrowHeadType: "arrowclosed",source: 'workflow-5', target: 'workflow-1' },
|
|
136
137
|
],
|
|
137
138
|
graph: [
|
|
138
139
|
{
|
|
139
|
-
id: 1,
|
|
140
|
+
id: 'graph-1',
|
|
140
141
|
type: "default",
|
|
141
142
|
data: {
|
|
142
143
|
label: "Default ", content: "Example content.", minimalShape: "none"
|
|
@@ -144,7 +145,7 @@ const nodeExamples = {
|
|
|
144
145
|
position: { x: 100, y: 50 },
|
|
145
146
|
},
|
|
146
147
|
{
|
|
147
|
-
id: 2,
|
|
148
|
+
id: 'graph-2',
|
|
148
149
|
type: "graph",
|
|
149
150
|
data: {
|
|
150
151
|
label: "Graph", content: "Example content.", minimalShape: "none"
|
|
@@ -152,7 +153,7 @@ const nodeExamples = {
|
|
|
152
153
|
position: { x: 400, y: 200 },
|
|
153
154
|
},
|
|
154
155
|
{
|
|
155
|
-
id: 3,
|
|
156
|
+
id: 'graph-3',
|
|
156
157
|
type: "class",
|
|
157
158
|
data: {
|
|
158
159
|
label: "Class", content: "Example content.", minimalShape: "none"
|
|
@@ -160,7 +161,7 @@ const nodeExamples = {
|
|
|
160
161
|
position: { x: 700, y: 50 },
|
|
161
162
|
},
|
|
162
163
|
{
|
|
163
|
-
id: 4,
|
|
164
|
+
id: 'graph-4',
|
|
164
165
|
type: "instance",
|
|
165
166
|
data: {
|
|
166
167
|
label: "Instance", content: "Example content.", minimalShape: "none",
|
|
@@ -169,7 +170,7 @@ const nodeExamples = {
|
|
|
169
170
|
position: { x: 750, y: 300 },
|
|
170
171
|
},
|
|
171
172
|
{
|
|
172
|
-
id: 5,
|
|
173
|
+
id: 'graph-5',
|
|
173
174
|
type: "property",
|
|
174
175
|
data: {
|
|
175
176
|
label: "Property", content: "Example content.", minimalShape: "none",
|
|
@@ -177,21 +178,96 @@ const nodeExamples = {
|
|
|
177
178
|
},
|
|
178
179
|
position: { x: 50, y: 300 },
|
|
179
180
|
},
|
|
180
|
-
{ id: 'e1', type: 'implicit', label: "implicit edge", arrowHeadType: "arrowclosed",source: '1', target: '2' },
|
|
181
|
-
{ id: 'e2', type: 'import', label: "import edge", arrowHeadType: "arrowclosed",source: '2', target: '3' },
|
|
182
|
-
{ id: 'e3', type: 'subclass', label: "subclass edge", arrowHeadType: "arrowclosed",source: '3', target: '4' },
|
|
183
|
-
{ id: 'e4', type: 'subproperty', label: "subproperty edge", arrowHeadType: "arrowclosed",source: '4', target: '5' },
|
|
184
|
-
{ id: 'e5', type: 'rdftype', label: "rdftype edge", arrowHeadType: "arrowclosed",source: '5', target: '1' },
|
|
181
|
+
{ id: 'graph-e1', type: 'implicit', label: "implicit edge", arrowHeadType: "arrowclosed",source: 'graph-1', target: 'graph-2' },
|
|
182
|
+
{ id: 'graph-e2', type: 'import', label: "import edge", arrowHeadType: "arrowclosed",source: 'graph-2', target: 'graph-3' },
|
|
183
|
+
{ id: 'graph-e3', type: 'subclass', label: "subclass edge", arrowHeadType: "arrowclosed",source: 'graph-3', target: 'graph-4' },
|
|
184
|
+
{ id: 'graph-e4', type: 'subproperty', label: "subproperty edge", arrowHeadType: "arrowclosed",source: 'graph-4', target: 'graph-5' },
|
|
185
|
+
{ id: 'graph-e5', type: 'rdftype', label: "rdftype edge", arrowHeadType: "arrowclosed",source: 'graph-5', target: 'graph-1' },
|
|
185
186
|
],
|
|
187
|
+
inverseEdge: [
|
|
188
|
+
{
|
|
189
|
+
id: 'inverseEdge-1',
|
|
190
|
+
type: "default",
|
|
191
|
+
data: {
|
|
192
|
+
label: "Default ", content: "Example content.", minimalShape: "none"
|
|
193
|
+
},
|
|
194
|
+
position: { x: 200, y: 50 },
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
id: 'inverseEdge-2',
|
|
198
|
+
type: "default",
|
|
199
|
+
data: {
|
|
200
|
+
label: "Default ", content: "Example content.", minimalShape: "none",
|
|
201
|
+
handles: [ { type: "source", position: "left" }, { type: "target", position: "right" } ],
|
|
202
|
+
inversePath: true,
|
|
203
|
+
},
|
|
204
|
+
position: { x: 200, y: 300 },
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
id: 'inverseEdge-e1', type: 'straight', label: "straight edge", arrowHeadType: "arrowclosed",source: 'inverseEdge-1', target: 'inverseEdge-2',
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
id: 'inverseEdge-e2', type: 'default', label: "inverse edge", source: 'inverseEdge-2', target: 'inverseEdge-1',
|
|
211
|
+
data: {
|
|
212
|
+
markerStart: getMarkerEnd(
|
|
213
|
+
`${ArrowHeadType.ArrowClosed}-inverse` as ArrowHeadType
|
|
214
|
+
),
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
],
|
|
218
|
+
customLabel: [
|
|
219
|
+
{
|
|
220
|
+
id: 'customLabel-1',
|
|
221
|
+
type: "default",
|
|
222
|
+
data: {
|
|
223
|
+
label: "Default ", content: "Example content.", minimalShape: "none"
|
|
224
|
+
},
|
|
225
|
+
position: { x: 200, y: 50 },
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
id: 'customLabel-2',
|
|
229
|
+
type: "default",
|
|
230
|
+
data: {
|
|
231
|
+
label: "Default ", content: "Example content.", minimalShape: "none",
|
|
232
|
+
handles: [ { type: "source", position: "left" }, { type: "target", position: "right" } ],
|
|
233
|
+
inversePath: true,
|
|
234
|
+
},
|
|
235
|
+
position: { x: 200, y: 300 },
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
id: 'customLabel-e1', type: 'straight', label: "straight edge", arrowHeadType: "arrowclosed", source: 'customLabel-1', target: 'customLabel-2',
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
id: 'customLabel-e2', type: 'default', label: "custom edge", arrowHeadType: "arrowclosed", source: 'customLabel-2', target: 'customLabel-1',
|
|
242
|
+
data: {
|
|
243
|
+
renderLabel: (
|
|
244
|
+
edgeCenter: [number, number, number, number]
|
|
245
|
+
) => (
|
|
246
|
+
<foreignObject
|
|
247
|
+
width={30}
|
|
248
|
+
height={30}
|
|
249
|
+
x={edgeCenter[0] - 15}
|
|
250
|
+
y={edgeCenter[1] - 15}
|
|
251
|
+
className="instance-viz-multiedge"
|
|
252
|
+
requiredExtensions="http://www.w3.org/1999/xhtml"
|
|
253
|
+
>
|
|
254
|
+
<body>
|
|
255
|
+
<IconButton name="navigation-close" />
|
|
256
|
+
</body>
|
|
257
|
+
</foreignObject>
|
|
258
|
+
)
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
]
|
|
186
262
|
}
|
|
187
263
|
|
|
188
|
-
const ReactFlowExample = (args) => {
|
|
264
|
+
const ReactFlowExample: FC<ReactFlowProps> = (args) => {
|
|
189
265
|
const [reactflowInstance, setReactflowInstance] = useState(null);
|
|
190
266
|
const [elements, setElements] = useState([] as Elements);
|
|
191
267
|
//const [edgeTools, setEdgeTools] = useState<JSX.Element>(<></>);
|
|
192
268
|
|
|
193
269
|
useEffect(() => {
|
|
194
|
-
setElements(nodeExamples[args.configuration] as Elements);
|
|
270
|
+
setElements(nodeExamples[args.configuration ?? "unspecified"] as Elements);
|
|
195
271
|
}, [args]);
|
|
196
272
|
|
|
197
273
|
const onLoad = useCallback(
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import {default as ReactFlowOriginal, ReactFlowProps as ReactFlowOriginalProps} from "react-flow-renderer";
|
|
3
|
+
import { ReactFlowMarkers } from "../../../extensions/react-flow/markers/ReactFlowMarkers";
|
|
3
4
|
import * as unspecifiedConfig from "./../configuration/unspecified";
|
|
4
5
|
import * as graphConfig from "./../configuration/graph";
|
|
5
6
|
import * as workflowConfig from "./../configuration/workflow";
|
|
6
7
|
import * as linkingConfig from "./../configuration/linking";
|
|
8
|
+
import * as inverseEdgeConfig from "./../configuration/inverseEdge";
|
|
9
|
+
import * as customLabelConfig from "./../configuration/customLabel";
|
|
7
10
|
|
|
8
|
-
interface ReactFlowProps extends ReactFlowOriginalProps {
|
|
11
|
+
export interface ReactFlowProps extends ReactFlowOriginalProps {
|
|
9
12
|
/**
|
|
10
13
|
* Load `ReactFlow` component with pre-configured values for `nodeTypes` and `edgeTypes`
|
|
11
14
|
*/
|
|
12
|
-
configuration?: "unspecified" | "graph" | "workflow" | "linking";
|
|
15
|
+
configuration?: "unspecified" | "graph" | "workflow" | "linking" | "inverseEdge" | "customLabel";
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
/**
|
|
@@ -27,6 +30,8 @@ export const ReactFlow = React.forwardRef<HTMLDivElement, ReactFlowProps>((
|
|
|
27
30
|
graph: graphConfig,
|
|
28
31
|
workflow: workflowConfig,
|
|
29
32
|
linking: linkingConfig,
|
|
33
|
+
inverseEdge: inverseEdgeConfig,
|
|
34
|
+
customLabel: customLabelConfig,
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
return (
|
|
@@ -35,6 +40,8 @@ export const ReactFlow = React.forwardRef<HTMLDivElement, ReactFlowProps>((
|
|
|
35
40
|
nodeTypes={ configReactFlow[configuration].nodeTypes }
|
|
36
41
|
edgeTypes={ configReactFlow[configuration].edgeTypes }
|
|
37
42
|
{...originalProps}
|
|
38
|
-
|
|
43
|
+
>
|
|
44
|
+
<ReactFlowMarkers />
|
|
45
|
+
</ReactFlowOriginal>
|
|
39
46
|
);
|
|
40
47
|
})
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EdgeDefault } from "./../../../extensions/react-flow/edges/EdgeDefault";
|
|
2
|
+
import { NodeDefault } from "./../../../extensions/react-flow/nodes/NodeDefault";
|
|
3
|
+
|
|
4
|
+
export const edgeTypes = {
|
|
5
|
+
default: EdgeDefault,
|
|
6
|
+
straight: EdgeDefault,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const nodeTypes = {
|
|
10
|
+
default: NodeDefault,
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EdgeDefault } from "./../../../extensions/react-flow/edges/EdgeDefault";
|
|
2
|
+
import { NodeDefault } from "./../../../extensions/react-flow/nodes/NodeDefault";
|
|
3
|
+
|
|
4
|
+
export const edgeTypes = {
|
|
5
|
+
default: EdgeDefault,
|
|
6
|
+
straight: EdgeDefault,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const nodeTypes = {
|
|
10
|
+
default: NodeDefault,
|
|
11
|
+
};
|
|
@@ -41,7 +41,7 @@ export default class CssCustomProperties {
|
|
|
41
41
|
return customprops;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
static listLocalStylesheets = () => {
|
|
44
|
+
static listLocalStylesheets = (): CSSStyleSheet[] => {
|
|
45
45
|
if (document && document.styleSheets) {
|
|
46
46
|
return Array.from(document.styleSheets)
|
|
47
47
|
.filter((stylesheet) => {
|
|
@@ -56,7 +56,7 @@ export default class CssCustomProperties {
|
|
|
56
56
|
return [];
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
static listLocalCssRules = () => {
|
|
59
|
+
static listLocalCssRules = (): CSSRule[] => {
|
|
60
60
|
return CssCustomProperties.listLocalStylesheets()
|
|
61
61
|
.map((stylesheet) => {
|
|
62
62
|
return Array.from(stylesheet.cssRules);
|
|
@@ -64,14 +64,24 @@ export default class CssCustomProperties {
|
|
|
64
64
|
.flat();
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
static listLocalCssStyleRules = (filter: getLocalCssStyleRulesProps = {}) => {
|
|
67
|
+
static listLocalCssStyleRules = (filter: getLocalCssStyleRulesProps = {}): CSSStyleRule[] => {
|
|
68
68
|
const {cssRuleType = "CSSStyleRule", selectorText} = filter;
|
|
69
|
-
|
|
69
|
+
const cssStyleRules = CssCustomProperties.listLocalCssRules()
|
|
70
70
|
.filter((cssrule) => {
|
|
71
|
-
if
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
if((cssrule as CSSStyleRule).style) {
|
|
72
|
+
const cssStyleRule = cssrule as CSSStyleRule
|
|
73
|
+
if (cssStyleRule.constructor.name !== cssRuleType) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
if (!!selectorText && cssStyleRule.selectorText !== selectorText) {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
return true;
|
|
80
|
+
} else {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
74
83
|
})
|
|
84
|
+
return cssStyleRules as CSSStyleRule[]
|
|
75
85
|
}
|
|
76
86
|
|
|
77
87
|
static listLocalCssStyleRuleProperties = (filter: getLocalCssStyleRulePropertiesProps = {}) => {
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
import Divider from "./../Separation/Divider";
|
|
17
17
|
import Modal, { ModalProps } from "./Modal";
|
|
18
18
|
import {TestableComponent} from "../interfaces";
|
|
19
|
+
import IconButton from "../Icon/IconButton";
|
|
19
20
|
|
|
20
21
|
export interface SimpleDialogProps extends ModalProps, TestableComponent {
|
|
21
22
|
/**
|
|
@@ -49,6 +50,10 @@ export interface SimpleDialogProps extends ModalProps, TestableComponent {
|
|
|
49
50
|
intent?: IntentTypes;
|
|
50
51
|
/** Optional props for the wrapper div element inside the modal. */
|
|
51
52
|
wrapperDivProps?: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>
|
|
53
|
+
/** If a full screen toggler is shown that will allow to switch to full screen mode. */
|
|
54
|
+
showFullScreenToggler?: boolean
|
|
55
|
+
/** Starts the modal in full screen mode. The show full screen toggler will be automatically enabled. */
|
|
56
|
+
startInFullScreenMode?: boolean
|
|
52
57
|
}
|
|
53
58
|
|
|
54
59
|
/**
|
|
@@ -66,8 +71,13 @@ function SimpleDialog({
|
|
|
66
71
|
preventSimpleClosing = false,
|
|
67
72
|
intent,
|
|
68
73
|
headerOptions,
|
|
74
|
+
showFullScreenToggler = false,
|
|
75
|
+
startInFullScreenMode = false,
|
|
76
|
+
size,
|
|
69
77
|
...otherProps
|
|
70
78
|
}: SimpleDialogProps) {
|
|
79
|
+
const [displayFullscreen, setDisplayFullscreen] = React.useState<boolean>(startInFullScreenMode);
|
|
80
|
+
const showToggler = startInFullScreenMode || showFullScreenToggler
|
|
71
81
|
const intentClassName = intent ? `${eccgui}-intent--${intent}` : "";
|
|
72
82
|
return (
|
|
73
83
|
<Modal
|
|
@@ -76,21 +86,32 @@ function SimpleDialog({
|
|
|
76
86
|
data-test-id={otherProps["data-test-id"] ?? "simpleDialogWidget"}
|
|
77
87
|
canOutsideClickClose={canOutsideClickClose || !preventSimpleClosing}
|
|
78
88
|
canEscapeKeyClose={canEscapeKeyClose || !preventSimpleClosing}
|
|
89
|
+
size={displayFullscreen ? "fullscreen" : size}
|
|
79
90
|
>
|
|
80
91
|
<Card className={intentClassName}
|
|
81
92
|
>
|
|
82
|
-
{(title || headerOptions)
|
|
93
|
+
{(title || headerOptions || showToggler) ? (
|
|
83
94
|
<CardHeader>
|
|
84
95
|
<CardTitle
|
|
85
96
|
className={intentClassName}
|
|
86
97
|
>
|
|
87
98
|
{title}
|
|
88
99
|
</CardTitle>
|
|
89
|
-
{headerOptions
|
|
90
|
-
<CardOptions>
|
|
100
|
+
{(headerOptions || showToggler) ? (
|
|
101
|
+
<CardOptions>
|
|
102
|
+
{ headerOptions }
|
|
103
|
+
{showToggler && (
|
|
104
|
+
<IconButton
|
|
105
|
+
name={displayFullscreen ? "toggler-minimize" : "toggler-maximize"}
|
|
106
|
+
onClick={() => setDisplayFullscreen(!displayFullscreen)}
|
|
107
|
+
/>
|
|
108
|
+
)}
|
|
109
|
+
</CardOptions>
|
|
110
|
+
) : (
|
|
111
|
+
<></>
|
|
91
112
|
)}
|
|
92
113
|
</CardHeader>
|
|
93
|
-
)}
|
|
114
|
+
) : null}
|
|
94
115
|
{hasBorder && <Divider />}
|
|
95
116
|
<CardContent>{children}</CardContent>
|
|
96
117
|
{hasBorder && <Divider />}
|
|
@@ -67,6 +67,8 @@ export type ValidIconName = "application-dataintegration"
|
|
|
67
67
|
| "operation-comparison"
|
|
68
68
|
| "operation-transform"
|
|
69
69
|
| "operation-aggregation"
|
|
70
|
+
| "operation-commit"
|
|
71
|
+
| "operation-sharelink"
|
|
70
72
|
| "data-sourcepath"
|
|
71
73
|
| "data-targetpath"
|
|
72
74
|
| "list-sort"
|
|
@@ -453,6 +455,16 @@ const canonicalIconNames: Record<ValidIconName, IconSized> = {
|
|
|
453
455
|
normal: icons.DataCollection20,
|
|
454
456
|
large: icons.DataCollection32
|
|
455
457
|
},
|
|
458
|
+
"operation-commit": {
|
|
459
|
+
small: icons.Commit16,
|
|
460
|
+
normal: icons.Commit20,
|
|
461
|
+
large: icons.Commit32
|
|
462
|
+
},
|
|
463
|
+
"operation-sharelink": {
|
|
464
|
+
small: icons.CopyLink16,
|
|
465
|
+
normal: icons.CopyLink20,
|
|
466
|
+
large: icons.CopyLink32
|
|
467
|
+
},
|
|
456
468
|
|
|
457
469
|
"data-sourcepath": {
|
|
458
470
|
small: icons.Data_216,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import SimpleDialog, {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { Iframe, IframeProps } from "./Iframe";
|
|
2
|
+
import SimpleDialog, {SimpleDialogProps} from "../Dialog/SimpleDialog";
|
|
3
|
+
import {CLASSPREFIX as eccgui} from "../../configuration/constants";
|
|
4
|
+
import {Iframe, IframeProps} from "./Iframe";
|
|
6
5
|
|
|
7
6
|
export interface IframeModalProps extends Omit<SimpleDialogProps, "children"> {
|
|
8
7
|
// The title of the dialog
|
|
@@ -29,7 +28,6 @@ export function IframeModal({
|
|
|
29
28
|
size = "large",
|
|
30
29
|
...otherSimpleDialogProps
|
|
31
30
|
}: IframeModalProps) {
|
|
32
|
-
const [displayFullscreen, setDisplayFullscreen] = React.useState<boolean>(startFullscreen);
|
|
33
31
|
const {
|
|
34
32
|
useViewportHeight,
|
|
35
33
|
useAvailableSpace,
|
|
@@ -44,22 +42,13 @@ export function IframeModal({
|
|
|
44
42
|
<SimpleDialog
|
|
45
43
|
hasBorder
|
|
46
44
|
title={title}
|
|
47
|
-
headerOptions={
|
|
48
|
-
<>
|
|
49
|
-
<IconButton
|
|
50
|
-
name={displayFullscreen ? "toggler-minimize" : "toggler-maximize"}
|
|
51
|
-
onClick={()=>setDisplayFullscreen(!displayFullscreen)}
|
|
52
|
-
/>
|
|
53
|
-
<>
|
|
54
|
-
{headerOptions}
|
|
55
|
-
</>
|
|
56
|
-
</>
|
|
57
|
-
)}
|
|
45
|
+
headerOptions={headerOptions}
|
|
58
46
|
className={
|
|
59
47
|
`${eccgui}-iframemodal` +
|
|
60
48
|
(className ? ` ${className}` : "")
|
|
61
49
|
}
|
|
62
|
-
|
|
50
|
+
showFullScreenToggler={true}
|
|
51
|
+
startInFullScreenMode={startFullscreen}
|
|
63
52
|
{...otherSimpleDialogProps}
|
|
64
53
|
>
|
|
65
54
|
<Iframe
|
|
@@ -11,6 +11,9 @@ import { drawEdgeStraight} from "./utils";
|
|
|
11
11
|
|
|
12
12
|
export interface EdgeDefaultDataProps {
|
|
13
13
|
pathGlowWidth?: number;
|
|
14
|
+
inversePath?: boolean;
|
|
15
|
+
markerStart?: string;
|
|
16
|
+
renderLabel?: (edgeCenter: [number, number, number, number]) => React.ReactNode;
|
|
14
17
|
}
|
|
15
18
|
|
|
16
19
|
export interface EdgeDefaultProps extends ReactFlowEdgeProps {
|
|
@@ -27,6 +30,7 @@ export const EdgeDefault = memo(
|
|
|
27
30
|
} = edge;
|
|
28
31
|
const {
|
|
29
32
|
pathGlowWidth = 10,
|
|
33
|
+
markerStart
|
|
30
34
|
} = data;
|
|
31
35
|
|
|
32
36
|
const pathDisplay = drawSvgPath({...edgeOriginalProperties, data});
|
|
@@ -41,7 +45,7 @@ export const EdgeDefault = memo(
|
|
|
41
45
|
targetY: edgeOriginalProperties.targetY,
|
|
42
46
|
});
|
|
43
47
|
|
|
44
|
-
const edgeLabel = edgeOriginalProperties.label ? (
|
|
48
|
+
const edgeLabel = data.renderLabel?.(edgeCenter) ?? (edgeOriginalProperties.label ? (
|
|
45
49
|
<EdgeText
|
|
46
50
|
x={edgeCenter[0]}
|
|
47
51
|
y={edgeCenter[1]}
|
|
@@ -52,7 +56,7 @@ export const EdgeDefault = memo(
|
|
|
52
56
|
labelBgPadding={edgeOriginalProperties.labelBgPadding || [5, 5]}
|
|
53
57
|
labelBgBorderRadius={edgeOriginalProperties.labelBgBorderRadius || 3}
|
|
54
58
|
/>
|
|
55
|
-
) : null;
|
|
59
|
+
) : null);
|
|
56
60
|
|
|
57
61
|
const edgeStyle = edgeOriginalProperties.style ?? {};
|
|
58
62
|
return (
|
|
@@ -67,6 +71,7 @@ export const EdgeDefault = memo(
|
|
|
67
71
|
<path
|
|
68
72
|
d={pathDisplay}
|
|
69
73
|
className="react-flow__edge-path"
|
|
74
|
+
markerStart={markerStart}
|
|
70
75
|
markerEnd={markerEnd}
|
|
71
76
|
/>
|
|
72
77
|
{ edgeLabel }
|
|
@@ -7,6 +7,8 @@ export { EdgeDefault } from "./edges/EdgeDefault";
|
|
|
7
7
|
export { EdgeStep } from "./edges/EdgeStep";
|
|
8
8
|
export { EdgeTools } from "./edges/EdgeTools";
|
|
9
9
|
export { edgeTypes } from "./edges/edgeTypes";
|
|
10
|
+
export { MarkerArrowClosedInverse } from "./markers/MarkerArrowClosedInverse";
|
|
11
|
+
export { ReactFlowMarkers } from "./markers/ReactFlowMarkers";
|
|
10
12
|
export { MiniMap } from "./minimap/MiniMap";
|
|
11
13
|
export { minimapNodeClassName, minimapNodeColor } from "./minimap/utils";
|
|
12
14
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React, { FC } from "react";
|
|
2
|
+
|
|
3
|
+
export const MarkerArrowClosedInverse: FC = () => {
|
|
4
|
+
return (
|
|
5
|
+
<marker
|
|
6
|
+
className="react-flow__arrowhead"
|
|
7
|
+
id="react-flow__arrowclosed-inverse"
|
|
8
|
+
markerWidth="12.5"
|
|
9
|
+
markerHeight="12.5"
|
|
10
|
+
viewBox="-10 -10 20 20"
|
|
11
|
+
orient="auto"
|
|
12
|
+
refX="0"
|
|
13
|
+
refY="0"
|
|
14
|
+
>
|
|
15
|
+
<polyline
|
|
16
|
+
stroke="#b1b1b7"
|
|
17
|
+
strokeLinecap="round"
|
|
18
|
+
strokeLinejoin="round"
|
|
19
|
+
strokeWidth="1"
|
|
20
|
+
fill="#b1b1b7"
|
|
21
|
+
points="5,-4 0,0 5,4 5,-4"
|
|
22
|
+
></polyline>
|
|
23
|
+
</marker>
|
|
24
|
+
);
|
|
25
|
+
};
|