@eccenca/gui-elements 22.1.0 → 23.0.0-rc.2
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 +39 -0
- package/README.md +1 -11
- package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js +4 -10
- package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
- package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js +9 -2
- 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/graph.js +1 -6
- package/dist/cjs/cmem/react-flow/configuration/graph.js.map +1 -1
- 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/cmem/react-flow/configuration/linking.js +1 -6
- package/dist/cjs/cmem/react-flow/configuration/linking.js.map +1 -1
- package/dist/cjs/cmem/react-flow/configuration/workflow.js +1 -6
- package/dist/cjs/cmem/react-flow/configuration/workflow.js.map +1 -1
- package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js +19 -19
- package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
- package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js +4 -12
- package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js.map +1 -1
- package/dist/cjs/components/AutocompleteField/AutoCompleteField.js +15 -6
- package/dist/cjs/components/AutocompleteField/AutoCompleteField.js.map +1 -1
- package/dist/cjs/components/Button/Button.js +2 -2
- package/dist/cjs/components/Button/Button.js.map +1 -1
- package/dist/cjs/components/ContextOverlay/ContextMenu.js +6 -5
- package/dist/cjs/components/ContextOverlay/ContextMenu.js.map +1 -1
- package/dist/cjs/components/ContextOverlay/ContextOverlay.js +6 -8
- package/dist/cjs/components/ContextOverlay/ContextOverlay.js.map +1 -1
- package/dist/cjs/components/Dialog/SimpleDialog.js +9 -4
- package/dist/cjs/components/Dialog/SimpleDialog.js.map +1 -1
- package/dist/cjs/components/Form/FieldItem.js +2 -2
- package/dist/cjs/components/Form/FieldItem.js.map +1 -1
- package/dist/cjs/components/Icon/Icon.js +2 -2
- package/dist/cjs/components/Icon/Icon.js.map +1 -1
- package/dist/cjs/components/Icon/IconButton.js +2 -2
- package/dist/cjs/components/Icon/IconButton.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/components/Label/Label.js +6 -6
- package/dist/cjs/components/Label/Label.js.map +1 -1
- package/dist/cjs/components/Menu/MenuItem.js +2 -5
- package/dist/cjs/components/Menu/MenuItem.js.map +1 -1
- package/dist/cjs/components/MultiSelect/MultiSelect.js +8 -10
- package/dist/cjs/components/MultiSelect/MultiSelect.js.map +1 -1
- package/dist/cjs/components/Select/Select.js +29 -0
- package/dist/cjs/components/Select/Select.js.map +1 -0
- package/dist/cjs/components/Tabs/TabTitle.js +2 -4
- package/dist/cjs/components/Tabs/TabTitle.js.map +1 -1
- package/dist/cjs/components/Tooltip/Tooltip.js +7 -4
- package/dist/cjs/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/cjs/extensions/codemirror/CodeMirror.js +59 -0
- package/dist/cjs/extensions/codemirror/CodeMirror.js.map +1 -0
- package/dist/cjs/extensions/index.js +15 -0
- package/dist/cjs/extensions/index.js.map +1 -0
- 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/edges/EdgeTools.js +2 -1
- package/dist/cjs/extensions/react-flow/edges/EdgeTools.js.map +1 -1
- package/dist/cjs/extensions/react-flow/handles/HandleContent.js +1 -1
- package/dist/cjs/extensions/react-flow/handles/HandleContent.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/cjs/extensions/react-flow/nodes/NodeTools.js +1 -3
- package/dist/cjs/extensions/react-flow/nodes/NodeTools.js.map +1 -1
- package/dist/cjs/index.js +4 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js +4 -10
- package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
- package/dist/esm/cmem/react-flow/ReactFlow/ReactFlow.js +9 -2
- 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/graph.js +1 -2
- package/dist/esm/cmem/react-flow/configuration/graph.js.map +1 -1
- 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/cmem/react-flow/configuration/linking.js +1 -2
- package/dist/esm/cmem/react-flow/configuration/linking.js.map +1 -1
- package/dist/esm/cmem/react-flow/configuration/workflow.js +1 -2
- package/dist/esm/cmem/react-flow/configuration/workflow.js.map +1 -1
- package/dist/esm/components/AutoSuggestion/AutoSuggestion.js +23 -21
- package/dist/esm/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
- package/dist/esm/components/AutoSuggestion/AutoSuggestionList.js +4 -12
- package/dist/esm/components/AutoSuggestion/AutoSuggestionList.js.map +1 -1
- package/dist/esm/components/AutocompleteField/AutoCompleteField.js +32 -23
- package/dist/esm/components/AutocompleteField/AutoCompleteField.js.map +1 -1
- package/dist/esm/components/Button/Button.js +2 -2
- package/dist/esm/components/Button/Button.js.map +1 -1
- package/dist/esm/components/ContextOverlay/ContextMenu.js +6 -5
- package/dist/esm/components/ContextOverlay/ContextMenu.js.map +1 -1
- package/dist/esm/components/ContextOverlay/ContextOverlay.js +6 -8
- package/dist/esm/components/ContextOverlay/ContextOverlay.js.map +1 -1
- package/dist/esm/components/Dialog/SimpleDialog.js +25 -4
- package/dist/esm/components/Dialog/SimpleDialog.js.map +1 -1
- package/dist/esm/components/Form/FieldItem.js +2 -2
- package/dist/esm/components/Form/FieldItem.js.map +1 -1
- package/dist/esm/components/Icon/Icon.js +2 -2
- package/dist/esm/components/Icon/Icon.js.map +1 -1
- package/dist/esm/components/Icon/IconButton.js +2 -2
- package/dist/esm/components/Icon/IconButton.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/components/Label/Label.js +6 -6
- package/dist/esm/components/Label/Label.js.map +1 -1
- package/dist/esm/components/Menu/MenuItem.js +2 -5
- package/dist/esm/components/Menu/MenuItem.js.map +1 -1
- package/dist/esm/components/MultiSelect/MultiSelect.js +5 -7
- package/dist/esm/components/MultiSelect/MultiSelect.js.map +1 -1
- package/dist/esm/components/Select/Select.js +35 -0
- package/dist/esm/components/Select/Select.js.map +1 -0
- package/dist/esm/components/Tabs/TabTitle.js +2 -4
- package/dist/esm/components/Tabs/TabTitle.js.map +1 -1
- package/dist/esm/components/Tooltip/Tooltip.js +7 -4
- package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/extensions/codemirror/CodeMirror.js +34 -0
- package/dist/esm/extensions/codemirror/CodeMirror.js.map +1 -0
- package/dist/esm/extensions/index.js +3 -0
- package/dist/esm/extensions/index.js.map +1 -0
- 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/edges/EdgeTools.js +2 -1
- package/dist/esm/extensions/react-flow/edges/EdgeTools.js.map +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleContent.js +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleContent.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/esm/extensions/react-flow/nodes/NodeTools.js +1 -3
- package/dist/esm/extensions/react-flow/nodes/NodeTools.js.map +1 -1
- package/dist/esm/index.js +3 -2
- package/dist/esm/index.js.map +1 -1
- 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/graph.d.ts +1 -2
- package/dist/types/cmem/react-flow/configuration/inverseEdge.d.ts +8 -0
- package/dist/types/cmem/react-flow/configuration/linking.d.ts +1 -2
- package/dist/types/cmem/react-flow/configuration/workflow.d.ts +1 -2
- package/dist/types/components/AutocompleteField/AutoCompleteField.d.ts +7 -4
- package/dist/types/components/Button/Button.d.ts +2 -2
- package/dist/types/components/ContextOverlay/ContextMenu.d.ts +37 -3
- package/dist/types/components/ContextOverlay/ContextOverlay.d.ts +12 -1
- package/dist/types/components/Dialog/SimpleDialog.d.ts +5 -1
- package/dist/types/components/Form/FieldItem.d.ts +3 -2
- package/dist/types/components/Icon/Icon.d.ts +32 -7
- package/dist/types/components/Icon/IconButton.d.ts +21 -7
- package/dist/types/components/Icon/canonicalIconNames.d.ts +1 -1
- package/dist/types/components/Label/Label.d.ts +30 -2
- package/dist/types/components/Menu/MenuItem.d.ts +3 -7
- package/dist/types/components/MultiSelect/MultiSelect.d.ts +13 -9
- package/dist/types/components/Select/Select.d.ts +22 -0
- package/dist/types/components/Tooltip/Tooltip.d.ts +13 -11
- package/dist/types/components/interfaces.d.ts +1 -0
- package/dist/types/extensions/codemirror/CodeMirror.d.ts +35 -0
- package/dist/types/extensions/index.d.ts +2 -0
- package/dist/types/extensions/react-flow/edges/EdgeDefault.d.ts +3 -0
- package/dist/types/extensions/react-flow/edges/EdgeTools.d.ts +2 -2
- 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/dist/types/extensions/react-flow/nodes/NodeTools.d.ts +2 -2
- package/dist/types/index.d.ts +3 -2
- package/package.json +16 -9
- package/src/cmem/ActivityControl/ActivityControlWidget.stories.tsx +2 -2
- package/src/cmem/ActivityControl/ActivityControlWidget.tsx +5 -10
- package/src/cmem/react-flow/ReactFlow/ReactFlow.stories.tsx +160 -51
- package/src/cmem/react-flow/ReactFlow/ReactFlow.tsx +12 -3
- package/src/cmem/react-flow/configuration/_colors-graph.scss +35 -0
- package/src/cmem/react-flow/configuration/_colors-linking.scss +29 -0
- package/src/cmem/react-flow/configuration/_colors-workflow.scss +22 -0
- package/src/cmem/react-flow/configuration/_colors.scss +3 -3
- package/src/cmem/react-flow/configuration/customLabel.ts +11 -0
- package/src/cmem/react-flow/configuration/graph.ts +0 -2
- package/src/cmem/react-flow/configuration/inverseEdge.ts +11 -0
- package/src/cmem/react-flow/configuration/linking.ts +0 -2
- package/src/cmem/react-flow/configuration/workflow.ts +0 -2
- package/src/common/utils/CssCustomProperties.ts +135 -0
- package/src/common/utils/getColorConfiguration.ts +21 -0
- package/src/components/Accordion/accordion.scss +7 -0
- package/src/components/AutoSuggestion/AutoSuggestion.tsx +23 -23
- package/src/components/AutoSuggestion/AutoSuggestionList.tsx +15 -17
- package/src/components/AutoSuggestion/tests/AutoSuggestionList.test.tsx +1 -1
- package/src/components/AutocompleteField/AutoCompleteField.tsx +44 -19
- package/src/components/AutocompleteField/autocompletefield.scss +5 -3
- package/src/components/AutocompleteField/stories/AutoCompleteField.stories.tsx +75 -0
- package/src/components/Button/Button.tsx +3 -3
- package/src/components/ContextOverlay/ContextMenu.stories.tsx +30 -0
- package/src/components/ContextOverlay/ContextMenu.tsx +46 -8
- package/src/components/ContextOverlay/ContextOverlay.stories.tsx +148 -0
- package/src/components/ContextOverlay/ContextOverlay.tsx +16 -9
- package/src/components/ContextOverlay/contextoverlay.scss +3 -3
- package/src/components/Dialog/SimpleDialog.tsx +25 -4
- package/src/components/Form/FieldItem.tsx +4 -4
- package/src/components/Icon/Icon.tsx +33 -18
- package/src/components/Icon/IconButton.tsx +24 -19
- package/src/components/Icon/canonicalIconNames.tsx +12 -0
- package/src/components/Icon/stories/Icon.stories.tsx +52 -0
- package/src/components/Icon/stories/IconButton.stories.tsx +27 -0
- package/src/components/Iframe/IframeModal.tsx +6 -17
- package/src/components/Label/Label.stories.tsx +27 -0
- package/src/components/Label/Label.tsx +47 -15
- package/src/components/Menu/MenuItem.tsx +9 -16
- package/src/components/Menu/menu.scss +4 -3
- package/src/components/MultiSelect/MultiSelect.tsx +30 -18
- package/src/components/Select/Select.stories.tsx +35 -0
- package/src/components/Select/Select.tsx +38 -0
- package/src/components/Select/_select.scss +8 -0
- package/src/components/Tabs/TabTitle.tsx +2 -4
- package/src/components/Tabs/tabs.scss +1 -1
- package/src/components/Tag/tag.scss +26 -22
- package/src/components/Tooltip/Tooltip.stories.tsx +36 -0
- package/src/components/Tooltip/Tooltip.tsx +23 -18
- package/src/components/Tooltip/tooltip.scss +6 -6
- package/src/components/Typography/typography.scss +1 -0
- package/src/components/interfaces.ts +3 -1
- package/src/extensions/_index.scss +5 -0
- package/src/extensions/codemirror/CodeMirror.stories.tsx +26 -0
- package/src/extensions/codemirror/CodeMirror.tsx +82 -0
- package/src/extensions/codemirror/_codemirror.scss +31 -0
- package/src/extensions/index.ts +2 -0
- package/src/extensions/react-flow/edges/EdgeDefault.tsx +7 -2
- package/src/extensions/react-flow/edges/EdgeTools.tsx +6 -4
- package/src/extensions/react-flow/handles/HandleContent.tsx +0 -1
- 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
- package/src/extensions/react-flow/nodes/NodeTools.tsx +10 -7
- package/src/extensions/react-flow/nodes/stories/NodeContent.stories.tsx +18 -0
- package/src/includes/blueprintjs/_variables.scss +1 -1
- package/src/index.scss +10 -9
- package/src/index.ts +4 -2
- package/dist/cjs/cmem/react-flow/configuration/_colors-graph.module.scss +0 -35
- package/dist/cjs/cmem/react-flow/configuration/_colors-linking.module.scss +0 -29
- package/dist/cjs/cmem/react-flow/configuration/_colors-workflow.module.scss +0 -22
- package/dist/esm/cmem/react-flow/configuration/_colors-graph.module.scss +0 -35
- package/dist/esm/cmem/react-flow/configuration/_colors-linking.module.scss +0 -29
- package/dist/esm/cmem/react-flow/configuration/_colors-workflow.module.scss +0 -22
- package/src/cmem/react-flow/configuration/_colors-graph.module.scss +0 -35
- package/src/cmem/react-flow/configuration/_colors-linking.module.scss +0 -29
- package/src/cmem/react-flow/configuration/_colors-workflow.module.scss +0 -22
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { ContextOverlayProps } from "./../../../components/ContextOverlay/ContextOverlay";
|
|
3
3
|
import { ValidIconName } from "../../../components/Icon/canonicalIconNames";
|
|
4
|
-
export interface NodeToolsProps extends
|
|
4
|
+
export interface NodeToolsProps extends Omit<ContextOverlayProps, "children"> {
|
|
5
5
|
children: string | JSX.Element;
|
|
6
6
|
togglerElement?: ValidIconName | JSX.Element;
|
|
7
7
|
togglerText?: string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ import Tag from "./components/Tag/Tag";
|
|
|
51
51
|
import TagList from "./components/Tag/TagList";
|
|
52
52
|
import Notification from "./components/Notification/Notification";
|
|
53
53
|
import Toast from "./components/Notification/Toast";
|
|
54
|
-
import
|
|
54
|
+
import Select from "./components/Select/Select";
|
|
55
55
|
import MultiSelect from "./components/MultiSelect/MultiSelect";
|
|
56
56
|
import { Iframe } from "./components/Iframe/Iframe";
|
|
57
57
|
import { IframeModal } from "./components/Iframe/IframeModal";
|
|
@@ -94,4 +94,5 @@ declare const Utilities: {
|
|
|
94
94
|
export { ApplicationContainer, ApplicationHeader, ApplicationContent, ApplicationSidebarNavigation, ApplicationSidebarToggler, ApplicationTitle, ApplicationToolbar, ApplicationToolbarSection, ApplicationToolbarAction, ApplicationToolbarPanel, AutoSuggestion, AutoSuggestionList, SingleLineCodeEditor, HtmlContentBlock, OverflowText, WhiteSpaceContainer, Highlighter, Grid, GridRow, GridColumn, List, WorkspaceContent, WorkspaceMain, WorkspaceSide, WorkspaceHeader, Menu, MenuItem, MenuDivider, ContextOverlay, ContextMenu, OverviewItem, OverviewItemDepiction, OverviewItemDescription, OverviewItemLine, OverviewItemActions, OverviewItemList, TableContainer, Table, TableHead, TableRow, TableBody, TableCell, TableHeader, Icon, IconButton, Label, Button, Checkbox, RadioButton, Tabs, Tab, TabTitle, TextField, TextArea, SearchField, Switch, NumericInput, FieldItem, FieldItemRow, FieldSet, BreadcrumbList, BreadcrumbItem, Modal, SimpleDialog, AlertDialog, Card, CardHeader, CardTitle, CardOptions, CardContent, CardActions, CardActionsAux, Spacing, Divider, Tooltip, Section, SectionHeader, TitlePage, TitleMainsection, TitleSubsection, Accordion, AccordionItem, Toolbar, ToolbarSection, Tag, TagList, Pagination, Notification, Link, Spinner, PropertyName, PropertyValue, PropertyValuePair, PropertyValueList, Toast, HelperClasses, Select, // FIXME: CMEM-3742: include as own element
|
|
95
95
|
MultiSelect, AutoCompleteField, ProgressBar, Iframe, IframeModal, Utilities, LegacyReplacements, };
|
|
96
96
|
export * from "./cmem";
|
|
97
|
-
export * from "./extensions
|
|
97
|
+
export * from "./extensions";
|
|
98
|
+
export * from "./components/interfaces";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eccenca/gui-elements",
|
|
3
3
|
"description": "GUI elements based on other libraries, usable in React application, written in Typescript.",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "23.0.0-rc.2",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/eccenca/gui-elements",
|
|
7
7
|
"bugs": "https://github.com/eccenca/gui-elements/issues",
|
|
@@ -60,8 +60,10 @@
|
|
|
60
60
|
"check:package": "pjv --warnings --recommendations"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@blueprintjs/
|
|
64
|
-
"@blueprintjs/
|
|
63
|
+
"@blueprintjs/colors": "^4.1.3",
|
|
64
|
+
"@blueprintjs/core": "4.0.4",
|
|
65
|
+
"@blueprintjs/popover2": "1.0.4",
|
|
66
|
+
"@blueprintjs/select": "4.3.1",
|
|
65
67
|
"@carbon/icons": "10.44.0",
|
|
66
68
|
"@carbon/icons-react": "10.44.0",
|
|
67
69
|
"@mavrin/remark-typograf": "^2.2.0",
|
|
@@ -110,7 +112,6 @@
|
|
|
110
112
|
"@typescript-eslint/parser": "^4.33.0",
|
|
111
113
|
"babel-jest": "^27.5.1",
|
|
112
114
|
"chromatic": "^6.5.1",
|
|
113
|
-
"copyfiles": "^2.4.1",
|
|
114
115
|
"css-loader": "3.4.2",
|
|
115
116
|
"eslint": "^7.32.0",
|
|
116
117
|
"eslint-config-react-app": "^6.0.0",
|
|
@@ -118,22 +119,27 @@
|
|
|
118
119
|
"jest": "^26.6.3",
|
|
119
120
|
"jest-environment-jsdom-fourteen": "1.0.1",
|
|
120
121
|
"jest-pnp-resolver": "^1.2.1",
|
|
121
|
-
"node-sass": "
|
|
122
|
+
"node-sass": "6.0.1",
|
|
122
123
|
"node-sass-tilde-importer": "^1.0.2",
|
|
123
124
|
"package-json-validator": "^0.6.3",
|
|
124
125
|
"react-app-polyfill": "^1.0.6",
|
|
125
126
|
"react-lorem-ipsum": "^1.4.9",
|
|
126
127
|
"regenerator-runtime": "^0.13.9",
|
|
127
128
|
"rimraf": "^3.0.2",
|
|
128
|
-
"sass-loader": "
|
|
129
|
+
"sass-loader": "^10.3.1",
|
|
129
130
|
"style-loader": "0.23.1",
|
|
130
131
|
"tsc-esm-fix": "^2.13.0",
|
|
131
132
|
"typescript": "4.4.4",
|
|
132
133
|
"webpack": "^4.46.0"
|
|
133
134
|
},
|
|
135
|
+
"peerDependencies": {
|
|
136
|
+
"react": ">=16",
|
|
137
|
+
"react-dom": ">=16"
|
|
138
|
+
},
|
|
134
139
|
"resolutions": {
|
|
135
|
-
"**/@blueprintjs/core": "
|
|
136
|
-
"**/@blueprintjs/
|
|
140
|
+
"**/@blueprintjs/core": "4.0.4",
|
|
141
|
+
"**/@blueprintjs/popover2": "1.0.4",
|
|
142
|
+
"**/@blueprintjs/select": "4.3.1",
|
|
137
143
|
"**/@carbon/icons": "10.44.0",
|
|
138
144
|
"**/@carbon/icons-react": "10.44.0",
|
|
139
145
|
"**/carbon-components": "10.44.0",
|
|
@@ -143,7 +149,8 @@
|
|
|
143
149
|
"**/node-gyp": "^7.0.0",
|
|
144
150
|
"**/glob-parent": "^5.1.2",
|
|
145
151
|
"**/trim": "^0.0.3",
|
|
146
|
-
"**/trim-newlines": "^3.0.1"
|
|
152
|
+
"**/trim-newlines": "^3.0.1",
|
|
153
|
+
"**/minimist": "^1.2.6"
|
|
147
154
|
},
|
|
148
155
|
"eslintConfig": {
|
|
149
156
|
"extends": [
|
|
@@ -66,10 +66,10 @@ const actions = [
|
|
|
66
66
|
];
|
|
67
67
|
|
|
68
68
|
const commonWidgetArgs = {
|
|
69
|
-
label: loremIpsum({ p: 1, avgSentencesPerParagraph: 1, avgWordsPerSentence: 4, random: false }),
|
|
69
|
+
label: loremIpsum({ p: 1, avgSentencesPerParagraph: 1, avgWordsPerSentence: 4, random: false }).toString(),
|
|
70
70
|
border: true,
|
|
71
71
|
activityActions: actions,
|
|
72
|
-
statusMessage: loremIpsum({ p: 1, startWithLoremIpsum: false, random: false }),
|
|
72
|
+
statusMessage: loremIpsum({ p: 1, startWithLoremIpsum: false, random: false }).toString(),
|
|
73
73
|
progressSpinner: {
|
|
74
74
|
intent: "none",
|
|
75
75
|
value: 0.5,
|
|
@@ -151,15 +151,8 @@ export function ActivityControlWidget(props: IActivityControlProps) {
|
|
|
151
151
|
<Tooltip
|
|
152
152
|
content={props.statusMessage}
|
|
153
153
|
size="large"
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
boundary: "viewport",
|
|
157
|
-
modifiers: {
|
|
158
|
-
flip: {
|
|
159
|
-
enabled: false
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}}
|
|
154
|
+
placement="top-start"
|
|
155
|
+
rootBoundary="viewport"
|
|
163
156
|
>
|
|
164
157
|
{props.statusMessage}
|
|
165
158
|
</Tooltip>
|
|
@@ -181,9 +174,11 @@ export function ActivityControlWidget(props: IActivityControlProps) {
|
|
|
181
174
|
name={action.icon}
|
|
182
175
|
text={action.tooltip}
|
|
183
176
|
onClick={action.action}
|
|
184
|
-
tooltipOpenDelay={200}
|
|
185
177
|
disabled={action.disabled}
|
|
186
178
|
hasStateWarning={action.hasStateWarning}
|
|
179
|
+
tooltipProps={{
|
|
180
|
+
hoverOpenDelay: 200
|
|
181
|
+
}}
|
|
187
182
|
/>
|
|
188
183
|
);
|
|
189
184
|
})}
|
|
@@ -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 { ReactFlow } from "
|
|
4
|
-
import {
|
|
3
|
+
import { ReactFlow, EdgeTools, NodeTools, IconButton } from "./../../../index";
|
|
4
|
+
import { ReactFlowProps } from "./ReactFlow";
|
|
5
|
+
import { ArrowHeadType, Elements, FlowElement, getMarkerEnd } from "react-flow-renderer";
|
|
5
6
|
|
|
6
7
|
export default {
|
|
7
8
|
title: "CMEM/React Flow/Configurations",
|
|
@@ -13,15 +14,16 @@ 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
|
-
label: "Default ", content: "Example content.", minimalShape: "none"
|
|
20
|
+
label: "Default ", content: "Example content.", minimalShape: "none",
|
|
21
|
+
menuButtons: <NodeTools>Pass your menu here.</NodeTools>
|
|
20
22
|
},
|
|
21
23
|
position: { x: 200, y: 50 },
|
|
22
24
|
},
|
|
23
25
|
{
|
|
24
|
-
id: 2,
|
|
26
|
+
id: 'unspecified-2',
|
|
25
27
|
type: "default",
|
|
26
28
|
data: {
|
|
27
29
|
label: "Default ", content: "Example content.", minimalShape: "none",
|
|
@@ -30,23 +32,24 @@ const nodeExamples = {
|
|
|
30
32
|
position: { x: 200, y: 300 },
|
|
31
33
|
},
|
|
32
34
|
{
|
|
33
|
-
id: 'e1', type: 'straight', label: "straight edge", arrowHeadType: "arrowclosed",source: '1', target: '2',
|
|
35
|
+
id: 'unspecified-e1', type: 'straight', label: "straight edge", arrowHeadType: "arrowclosed",source: 'unspecified-1', target: 'unspecified-2',
|
|
34
36
|
},
|
|
35
37
|
{
|
|
36
|
-
id: 'e2', type: 'step', label: "step edge", arrowHeadType: "arrowclosed",source: '2', target: '1',
|
|
38
|
+
id: 'unspecified-e2', type: 'step', label: "step edge", arrowHeadType: "arrowclosed",source: 'unspecified-2', target: 'unspecified-1',
|
|
37
39
|
}
|
|
38
40
|
],
|
|
39
41
|
linking: [
|
|
40
42
|
{
|
|
41
|
-
id: 1,
|
|
43
|
+
id: 'linking-1',
|
|
42
44
|
type: "sourcepath",
|
|
43
45
|
data: {
|
|
44
|
-
label: "Source path", content: "Example content.", minimalShape: "none"
|
|
46
|
+
label: "Source path", content: "Example content.", minimalShape: "none",
|
|
47
|
+
menuButtons: <NodeTools>Pass your menu here.</NodeTools>
|
|
45
48
|
},
|
|
46
49
|
position: { x: 100, y: 50 },
|
|
47
50
|
},
|
|
48
51
|
{
|
|
49
|
-
id: 2,
|
|
52
|
+
id: 'linking-2',
|
|
50
53
|
type: "targetpath",
|
|
51
54
|
data: {
|
|
52
55
|
label: "Target path", content: "Example content.", minimalShape: "none"
|
|
@@ -54,7 +57,7 @@ const nodeExamples = {
|
|
|
54
57
|
position: { x: 400, y: 200 },
|
|
55
58
|
},
|
|
56
59
|
{
|
|
57
|
-
id: 3,
|
|
60
|
+
id: 'linking-3',
|
|
58
61
|
type: "transformation",
|
|
59
62
|
data: {
|
|
60
63
|
label: "Transformation", content: "Example content.", minimalShape: "none"
|
|
@@ -62,7 +65,7 @@ const nodeExamples = {
|
|
|
62
65
|
position: { x: 700, y: 50 },
|
|
63
66
|
},
|
|
64
67
|
{
|
|
65
|
-
id: 4,
|
|
68
|
+
id: 'linking-4',
|
|
66
69
|
type: "comparator",
|
|
67
70
|
data: {
|
|
68
71
|
label: "Comparation", content: "Example content.", minimalShape: "none",
|
|
@@ -71,7 +74,7 @@ const nodeExamples = {
|
|
|
71
74
|
position: { x: 750, y: 300 },
|
|
72
75
|
},
|
|
73
76
|
{
|
|
74
|
-
id: 5,
|
|
77
|
+
id: 'linking-5',
|
|
75
78
|
type: "aggregator",
|
|
76
79
|
data: {
|
|
77
80
|
label: "Aggregation", content: "Example content.", minimalShape: "none",
|
|
@@ -79,23 +82,24 @@ const nodeExamples = {
|
|
|
79
82
|
},
|
|
80
83
|
position: { x: 50, y: 300 },
|
|
81
84
|
},
|
|
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' },
|
|
85
|
+
{ id: 'linking-e1', type: 'value', label: "value edge", arrowHeadType: "arrowclosed",source: 'linking-1', target: 'linking-2' },
|
|
86
|
+
{ id: 'linking-e2', type: 'score', label: "score edge", arrowHeadType: "arrowclosed",source: 'linking-2', target: 'linking-3' },
|
|
87
|
+
{ id: 'linking-e3', type: 'success', label: "success edge", arrowHeadType: "arrowclosed",source: 'linking-3', target: 'linking-4' },
|
|
88
|
+
{ id: 'linking-e4', type: 'warning', label: "warning edge", arrowHeadType: "arrowclosed",source: 'linking-4', target: 'linking-5' },
|
|
89
|
+
{ id: 'linking-e5', type: 'danger', label: "danger edge", arrowHeadType: "arrowclosed",source: 'linking-5', target: 'linking-1' },
|
|
87
90
|
],
|
|
88
91
|
workflow: [
|
|
89
92
|
{
|
|
90
|
-
id: 1,
|
|
93
|
+
id: 'workflow-1',
|
|
91
94
|
type: "dataset",
|
|
92
95
|
data: {
|
|
93
|
-
label: "Dataset", content: "Example content.", minimalShape: "none"
|
|
96
|
+
label: "Dataset", content: "Example content.", minimalShape: "none",
|
|
97
|
+
menuButtons: <NodeTools>Pass your menu here.</NodeTools>
|
|
94
98
|
},
|
|
95
99
|
position: { x: 100, y: 50 },
|
|
96
100
|
},
|
|
97
101
|
{
|
|
98
|
-
id: 2,
|
|
102
|
+
id: 'workflow-2',
|
|
99
103
|
type: "linking",
|
|
100
104
|
data: {
|
|
101
105
|
label: "Linking", content: "Example content.", minimalShape: "none"
|
|
@@ -103,7 +107,7 @@ const nodeExamples = {
|
|
|
103
107
|
position: { x: 400, y: 200 },
|
|
104
108
|
},
|
|
105
109
|
{
|
|
106
|
-
id: 3,
|
|
110
|
+
id: 'workflow-3',
|
|
107
111
|
type: "transform",
|
|
108
112
|
data: {
|
|
109
113
|
label: "Transform", content: "Example content.", minimalShape: "none"
|
|
@@ -111,7 +115,7 @@ const nodeExamples = {
|
|
|
111
115
|
position: { x: 700, y: 50 },
|
|
112
116
|
},
|
|
113
117
|
{
|
|
114
|
-
id: 4,
|
|
118
|
+
id: 'workflow-4',
|
|
115
119
|
type: "task",
|
|
116
120
|
data: {
|
|
117
121
|
label: "Task", content: "Example content.", minimalShape: "none",
|
|
@@ -120,7 +124,7 @@ const nodeExamples = {
|
|
|
120
124
|
position: { x: 750, y: 300 },
|
|
121
125
|
},
|
|
122
126
|
{
|
|
123
|
-
id: 5,
|
|
127
|
+
id: 'workflow-5',
|
|
124
128
|
type: "workflow",
|
|
125
129
|
data: {
|
|
126
130
|
label: "Workflow", content: "Example content.", minimalShape: "none",
|
|
@@ -128,23 +132,24 @@ const nodeExamples = {
|
|
|
128
132
|
},
|
|
129
133
|
position: { x: 50, y: 300 },
|
|
130
134
|
},
|
|
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' },
|
|
135
|
+
{ id: 'workflow-e1', arrowHeadType: "arrowclosed",source: 'workflow-1', target: 'workflow-2' },
|
|
136
|
+
{ id: 'workflow-e2', arrowHeadType: "arrowclosed",source: 'workflow-2', target: 'workflow-3' },
|
|
137
|
+
{ id: 'workflow-e3', type: 'success', label: "success edge", arrowHeadType: "arrowclosed",source: 'workflow-3', target: 'workflow-4' },
|
|
138
|
+
{ id: 'workflow-e4', type: 'warning', label: "warning edge", arrowHeadType: "arrowclosed",source: 'workflow-4', target: 'workflow-5' },
|
|
139
|
+
{ id: 'workflow-e5', type: 'danger', label: "danger edge", arrowHeadType: "arrowclosed",source: 'workflow-5', target: 'workflow-1' },
|
|
136
140
|
],
|
|
137
141
|
graph: [
|
|
138
142
|
{
|
|
139
|
-
id: 1,
|
|
143
|
+
id: 'graph-1',
|
|
140
144
|
type: "default",
|
|
141
145
|
data: {
|
|
142
|
-
label: "Default ", content: "Example content.", minimalShape: "none"
|
|
146
|
+
label: "Default ", content: "Example content.", minimalShape: "none",
|
|
147
|
+
menuButtons: <NodeTools>Pass your menu here.</NodeTools>
|
|
143
148
|
},
|
|
144
149
|
position: { x: 100, y: 50 },
|
|
145
150
|
},
|
|
146
151
|
{
|
|
147
|
-
id: 2,
|
|
152
|
+
id: 'graph-2',
|
|
148
153
|
type: "graph",
|
|
149
154
|
data: {
|
|
150
155
|
label: "Graph", content: "Example content.", minimalShape: "none"
|
|
@@ -152,7 +157,7 @@ const nodeExamples = {
|
|
|
152
157
|
position: { x: 400, y: 200 },
|
|
153
158
|
},
|
|
154
159
|
{
|
|
155
|
-
id: 3,
|
|
160
|
+
id: 'graph-3',
|
|
156
161
|
type: "class",
|
|
157
162
|
data: {
|
|
158
163
|
label: "Class", content: "Example content.", minimalShape: "none"
|
|
@@ -160,7 +165,7 @@ const nodeExamples = {
|
|
|
160
165
|
position: { x: 700, y: 50 },
|
|
161
166
|
},
|
|
162
167
|
{
|
|
163
|
-
id: 4,
|
|
168
|
+
id: 'graph-4',
|
|
164
169
|
type: "instance",
|
|
165
170
|
data: {
|
|
166
171
|
label: "Instance", content: "Example content.", minimalShape: "none",
|
|
@@ -169,7 +174,7 @@ const nodeExamples = {
|
|
|
169
174
|
position: { x: 750, y: 300 },
|
|
170
175
|
},
|
|
171
176
|
{
|
|
172
|
-
id: 5,
|
|
177
|
+
id: 'graph-5',
|
|
173
178
|
type: "property",
|
|
174
179
|
data: {
|
|
175
180
|
label: "Property", content: "Example content.", minimalShape: "none",
|
|
@@ -177,23 +182,122 @@ const nodeExamples = {
|
|
|
177
182
|
},
|
|
178
183
|
position: { x: 50, y: 300 },
|
|
179
184
|
},
|
|
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' },
|
|
185
|
+
{ id: 'graph-e1', type: 'implicit', label: "implicit edge", arrowHeadType: "arrowclosed",source: 'graph-1', target: 'graph-2' },
|
|
186
|
+
{ id: 'graph-e2', type: 'import', label: "import edge", arrowHeadType: "arrowclosed",source: 'graph-2', target: 'graph-3' },
|
|
187
|
+
{ id: 'graph-e3', type: 'subclass', label: "subclass edge", arrowHeadType: "arrowclosed",source: 'graph-3', target: 'graph-4' },
|
|
188
|
+
{ id: 'graph-e4', type: 'subproperty', label: "subproperty edge", arrowHeadType: "arrowclosed",source: 'graph-4', target: 'graph-5' },
|
|
189
|
+
{ id: 'graph-e5', type: 'rdftype', label: "rdftype edge", arrowHeadType: "arrowclosed",source: 'graph-5', target: 'graph-1' },
|
|
190
|
+
],
|
|
191
|
+
inverseEdge: [
|
|
192
|
+
{
|
|
193
|
+
id: 'inverseEdge-1',
|
|
194
|
+
type: "default",
|
|
195
|
+
data: {
|
|
196
|
+
label: "Default ", content: "Example content.", minimalShape: "none"
|
|
197
|
+
},
|
|
198
|
+
position: { x: 200, y: 50 },
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
id: 'inverseEdge-2',
|
|
202
|
+
type: "default",
|
|
203
|
+
data: {
|
|
204
|
+
label: "Default ", content: "Example content.", minimalShape: "none",
|
|
205
|
+
handles: [ { type: "source", position: "left" }, { type: "target", position: "right" } ],
|
|
206
|
+
inversePath: true,
|
|
207
|
+
},
|
|
208
|
+
position: { x: 200, y: 300 },
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
id: 'inverseEdge-e1', type: 'straight', label: "straight edge", arrowHeadType: "arrowclosed",source: 'inverseEdge-1', target: 'inverseEdge-2',
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
id: 'inverseEdge-e2', type: 'default', label: "inverse edge", source: 'inverseEdge-2', target: 'inverseEdge-1',
|
|
215
|
+
data: {
|
|
216
|
+
markerStart: getMarkerEnd(
|
|
217
|
+
`${ArrowHeadType.ArrowClosed}-inverse` as ArrowHeadType
|
|
218
|
+
),
|
|
219
|
+
}
|
|
220
|
+
}
|
|
185
221
|
],
|
|
222
|
+
customLabel: [
|
|
223
|
+
{
|
|
224
|
+
id: 'customLabel-1',
|
|
225
|
+
type: "default",
|
|
226
|
+
data: {
|
|
227
|
+
label: "Default ", content: "Example content.", minimalShape: "none"
|
|
228
|
+
},
|
|
229
|
+
position: { x: 200, y: 50 },
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
id: 'customLabel-2',
|
|
233
|
+
type: "default",
|
|
234
|
+
data: {
|
|
235
|
+
label: "Default ", content: "Example content.", minimalShape: "none",
|
|
236
|
+
handles: [ { type: "source", position: "left" }, { type: "target", position: "right" } ],
|
|
237
|
+
inversePath: true,
|
|
238
|
+
},
|
|
239
|
+
position: { x: 200, y: 300 },
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
id: 'customLabel-e1', type: 'straight', label: "straight edge", arrowHeadType: "arrowclosed", source: 'customLabel-1', target: 'customLabel-2',
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
id: 'customLabel-e2', type: 'default', label: "custom edge", arrowHeadType: "arrowclosed", source: 'customLabel-2', target: 'customLabel-1',
|
|
246
|
+
data: {
|
|
247
|
+
renderLabel: (
|
|
248
|
+
edgeCenter: [number, number, number, number]
|
|
249
|
+
) => (
|
|
250
|
+
<foreignObject
|
|
251
|
+
width={30}
|
|
252
|
+
height={30}
|
|
253
|
+
x={edgeCenter[0] - 15}
|
|
254
|
+
y={edgeCenter[1] - 15}
|
|
255
|
+
className="instance-viz-multiedge"
|
|
256
|
+
requiredExtensions="http://www.w3.org/1999/xhtml"
|
|
257
|
+
>
|
|
258
|
+
<body>
|
|
259
|
+
<IconButton name="navigation-close" />
|
|
260
|
+
</body>
|
|
261
|
+
</foreignObject>
|
|
262
|
+
)
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
]
|
|
186
266
|
}
|
|
187
267
|
|
|
188
|
-
const ReactFlowExample = (args) => {
|
|
268
|
+
const ReactFlowExample: FC<ReactFlowProps> = (args) => {
|
|
189
269
|
const [reactflowInstance, setReactflowInstance] = useState(null);
|
|
190
270
|
const [elements, setElements] = useState([] as Elements);
|
|
191
|
-
|
|
271
|
+
const [edgeTools, setEdgeTools] = useState<JSX.Element>(<></>);
|
|
192
272
|
|
|
193
273
|
useEffect(() => {
|
|
194
|
-
setElements(nodeExamples[args.configuration] as Elements);
|
|
274
|
+
setElements(nodeExamples[args.configuration ?? "unspecified"] as Elements);
|
|
195
275
|
}, [args]);
|
|
196
276
|
|
|
277
|
+
// Helper methods for nodes and edges
|
|
278
|
+
const isNode = (element: FlowElement & { source?: string }): boolean =>
|
|
279
|
+
!element.source;
|
|
280
|
+
const isEdge = (element: FlowElement & { source?: string }): boolean =>
|
|
281
|
+
!isNode(element);
|
|
282
|
+
|
|
283
|
+
// Fired when clicked on any elements, e.g. edge or node. Used to show the edge menu.
|
|
284
|
+
const onElementClick = React.useCallback((event, element) => {
|
|
285
|
+
if (isEdge(element)) {
|
|
286
|
+
event.preventDefault();
|
|
287
|
+
setEdgeTools(
|
|
288
|
+
<EdgeTools
|
|
289
|
+
posOffset={{ left: event.clientX, top: event.clientY }}
|
|
290
|
+
onClose={() => {
|
|
291
|
+
setEdgeTools(<></>);
|
|
292
|
+
}}
|
|
293
|
+
>
|
|
294
|
+
EdgeTools demo,
|
|
295
|
+
add elements here.
|
|
296
|
+
</EdgeTools>
|
|
297
|
+
);
|
|
298
|
+
}
|
|
299
|
+
}, []);
|
|
300
|
+
|
|
197
301
|
const onLoad = useCallback(
|
|
198
302
|
(rfi) => {
|
|
199
303
|
if (!reactflowInstance) {
|
|
@@ -203,13 +307,18 @@ const ReactFlowExample = (args) => {
|
|
|
203
307
|
[reactflowInstance]
|
|
204
308
|
);
|
|
205
309
|
|
|
206
|
-
return
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
310
|
+
return <>
|
|
311
|
+
<ReactFlow
|
|
312
|
+
configuration={args.configuration}
|
|
313
|
+
elements={elements}
|
|
314
|
+
style={{ height: '400px' }}
|
|
315
|
+
onLoad={onLoad}
|
|
316
|
+
defaultZoom={1}
|
|
317
|
+
onElementClick={onElementClick}
|
|
318
|
+
onEdgeContextMenu={onElementClick}
|
|
319
|
+
/>
|
|
320
|
+
{edgeTools}
|
|
321
|
+
</>
|
|
213
322
|
}
|
|
214
323
|
|
|
215
324
|
const Template: ComponentStory<typeof ReactFlow> = (args) => (
|
|
@@ -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
|
/**
|
|
@@ -19,6 +22,7 @@ interface ReactFlowProps extends ReactFlowOriginalProps {
|
|
|
19
22
|
export const ReactFlow = React.forwardRef<HTMLDivElement, ReactFlowProps>((
|
|
20
23
|
{
|
|
21
24
|
configuration = "unspecified",
|
|
25
|
+
children,
|
|
22
26
|
...originalProps
|
|
23
27
|
},
|
|
24
28
|
ref) => {
|
|
@@ -27,6 +31,8 @@ export const ReactFlow = React.forwardRef<HTMLDivElement, ReactFlowProps>((
|
|
|
27
31
|
graph: graphConfig,
|
|
28
32
|
workflow: workflowConfig,
|
|
29
33
|
linking: linkingConfig,
|
|
34
|
+
inverseEdge: inverseEdgeConfig,
|
|
35
|
+
customLabel: customLabelConfig,
|
|
30
36
|
}
|
|
31
37
|
|
|
32
38
|
return (
|
|
@@ -35,6 +41,9 @@ export const ReactFlow = React.forwardRef<HTMLDivElement, ReactFlowProps>((
|
|
|
35
41
|
nodeTypes={ configReactFlow[configuration].nodeTypes }
|
|
36
42
|
edgeTypes={ configReactFlow[configuration].edgeTypes }
|
|
37
43
|
{...originalProps}
|
|
38
|
-
|
|
44
|
+
>
|
|
45
|
+
{ children }
|
|
46
|
+
<ReactFlowMarkers />
|
|
47
|
+
</ReactFlowOriginal>
|
|
39
48
|
);
|
|
40
49
|
})
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
$reactflow-color-graph-node: #745a85 !default;
|
|
2
|
+
$reactflow-color-class-node: #3a7896 !default;
|
|
3
|
+
$reactflow-color-instance-node: #0097a7 !default;
|
|
4
|
+
$reactflow-color-property-node: #ffd54f !default;
|
|
5
|
+
|
|
6
|
+
$reactflow-color-implicit-edge: #ae3c74 !default;
|
|
7
|
+
$reactflow-color-import-edge: $reactflow-color-graph-node !default;
|
|
8
|
+
$reactflow-color-subclass-edge: $reactflow-color-class-node !default;
|
|
9
|
+
$reactflow-color-subproperty-edge: $reactflow-color-property-node !default;
|
|
10
|
+
$reactflow-color-rdftype-edge: $reactflow-color-instance-node !default;
|
|
11
|
+
|
|
12
|
+
@function bright($color) {
|
|
13
|
+
@return mix($color, #fff, 24%);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.#{eccgui}-configuration--colors__react-flow-graph {
|
|
17
|
+
--graphNode: #{$reactflow-color-graph-node};
|
|
18
|
+
--classNode: #{$reactflow-color-class-node};
|
|
19
|
+
--instanceNode: #{$reactflow-color-instance-node};
|
|
20
|
+
--propertyNode: #{$reactflow-color-property-node};
|
|
21
|
+
--implicitEdge: #{$reactflow-color-implicit-edge};
|
|
22
|
+
--importEdge: #{$reactflow-color-import-edge};
|
|
23
|
+
--subclassEdge: #{$reactflow-color-subclass-edge};
|
|
24
|
+
--subpropertyEdge: #{$reactflow-color-subproperty-edge};
|
|
25
|
+
--rdftypeEdge: #{$reactflow-color-rdftype-edge};
|
|
26
|
+
--graphNodeBright: #{bright($reactflow-color-graph-node)};
|
|
27
|
+
--classNodeBright: #{bright($reactflow-color-class-node)};
|
|
28
|
+
--instanceNodeBright: #{bright($reactflow-color-instance-node)};
|
|
29
|
+
--propertyNodeBright: #{bright($reactflow-color-property-node)};
|
|
30
|
+
--implicitEdgeBright: #{bright($reactflow-color-implicit-edge)};
|
|
31
|
+
--importEdgeBright: #{bright($reactflow-color-import-edge)};
|
|
32
|
+
--subclassEdgeBright: #{bright($reactflow-color-subclass-edge)};
|
|
33
|
+
--subpropertyEdgeBright: #{bright($reactflow-color-subproperty-edge)};
|
|
34
|
+
--rdftypeEdgeBright: #{bright($reactflow-color-rdftype-edge)};
|
|
35
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
$reactflow-color-sourcepath-node: #745a85 !default;
|
|
2
|
+
$reactflow-color-targetpath-node: #3a7896 !default;
|
|
3
|
+
$reactflow-color-transformation-node: #ae3c74 !default;
|
|
4
|
+
$reactflow-color-comparator-node: #40a691 !default;
|
|
5
|
+
$reactflow-color-aggregator-node: #0097a7 !default;
|
|
6
|
+
|
|
7
|
+
$reactflow-color-value-edge: #222 !default;
|
|
8
|
+
$reactflow-color-score-edge: $reactflow-color-aggregator-node !default;
|
|
9
|
+
|
|
10
|
+
@function bright($color) {
|
|
11
|
+
@return mix($color, #fff, 24%);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.#{eccgui}-configuration--colors__react-flow-linking {
|
|
15
|
+
--sourcepathNode: #{$reactflow-color-sourcepath-node};
|
|
16
|
+
--targetpathNode: #{$reactflow-color-targetpath-node};
|
|
17
|
+
--transformationNode: #{$reactflow-color-transformation-node};
|
|
18
|
+
--comparatorNode: #{$reactflow-color-comparator-node};
|
|
19
|
+
--aggregatorNode: #{$reactflow-color-aggregator-node};
|
|
20
|
+
--valueEdge: #{$reactflow-color-value-edge};
|
|
21
|
+
--scoreEdge: #{$reactflow-color-score-edge};
|
|
22
|
+
--sourcepathNodeBright: #{bright($reactflow-color-sourcepath-node)};
|
|
23
|
+
--targetpathNodeBright: #{bright($reactflow-color-targetpath-node)};
|
|
24
|
+
--transformationNodeBright: #{bright($reactflow-color-transformation-node)};
|
|
25
|
+
--comparatorNodeBright: #{bright($reactflow-color-comparator-node)};
|
|
26
|
+
--aggregatorNodeBright: #{bright($reactflow-color-aggregator-node)};
|
|
27
|
+
--valueEdgeBright: #{bright($reactflow-color-value-edge)};
|
|
28
|
+
--scoreEdgeBright: #{bright($reactflow-color-score-edge)};
|
|
29
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
$reactflow-color-dataset-node: #3a7896 !default;
|
|
2
|
+
$reactflow-color-linking-node: #0097a7 !default;
|
|
3
|
+
$reactflow-color-transform-node: #40a691 !default;
|
|
4
|
+
$reactflow-color-task-node: #80b67b !default;
|
|
5
|
+
$reactflow-color-workflow-node: #745a85 !default;
|
|
6
|
+
|
|
7
|
+
@function bright($color) {
|
|
8
|
+
@return mix($color, #fff, 24%);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.#{eccgui}-configuration--colors__react-flow-workflow {
|
|
12
|
+
--datasetNode: #{$reactflow-color-dataset-node};
|
|
13
|
+
--linkingNode: #{$reactflow-color-linking-node};
|
|
14
|
+
--transformNode: #{$reactflow-color-transform-node};
|
|
15
|
+
--taskNode: #{$reactflow-color-task-node};
|
|
16
|
+
--workflowNode: #{$reactflow-color-workflow-node};
|
|
17
|
+
--datasetNodeBright: #{bright($reactflow-color-dataset-node)};
|
|
18
|
+
--linkingNodeBright: #{bright($reactflow-color-linking-node)};
|
|
19
|
+
--transformNodeBright: #{bright($reactflow-color-transform-node)};
|
|
20
|
+
--taskNodeBright: #{bright($reactflow-color-task-node)};
|
|
21
|
+
--workflowNodeBright: #{bright($reactflow-color-workflow-node)};
|
|
22
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
@import "colors-graph
|
|
2
|
-
@import "colors-workflow
|
|
3
|
-
@import "colors-linking
|
|
1
|
+
@import "colors-graph";
|
|
2
|
+
@import "colors-workflow";
|
|
3
|
+
@import "colors-linking";
|