@eccenca/gui-elements 23.0.0 → 23.1.0-easynav.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 +35 -1
- package/README.md +7 -0
- package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
- package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js +7 -2
- package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -1
- package/dist/cjs/cmem/react-flow/StickyNoteModal/StickyNoteModal.js +3 -7
- package/dist/cjs/cmem/react-flow/StickyNoteModal/StickyNoteModal.js.map +1 -1
- package/dist/cjs/cmem/react-flow/extensions/scrollOnDragHook.js +200 -0
- package/dist/cjs/cmem/react-flow/extensions/scrollOnDragHook.js.map +1 -0
- package/dist/cjs/common/Intent/index.js +7 -3
- package/dist/cjs/common/Intent/index.js.map +1 -1
- package/dist/cjs/common/utils/characters.js +82 -0
- package/dist/cjs/common/utils/characters.js.map +1 -0
- package/dist/cjs/components/Application/ApplicationTitle.js +2 -2
- package/dist/cjs/components/Application/ApplicationTitle.js.map +1 -1
- package/dist/cjs/components/Badge/Badge.js +44 -0
- package/dist/cjs/components/Badge/Badge.js.map +1 -0
- package/dist/cjs/components/Depiction/Depiction.js +111 -0
- package/dist/cjs/components/Depiction/Depiction.js.map +1 -0
- package/dist/cjs/components/Grid/Grid.js +7 -2
- package/dist/cjs/components/Grid/Grid.js.map +1 -1
- package/dist/cjs/components/Grid/GridColumn.js +6 -2
- package/dist/cjs/components/Grid/GridColumn.js.map +1 -1
- package/dist/cjs/components/Grid/GridRow.js +3 -0
- package/dist/cjs/components/Grid/GridRow.js.map +1 -1
- package/dist/cjs/components/Icon/BaseIcon.js +38 -0
- package/dist/cjs/components/Icon/BaseIcon.js.map +1 -0
- package/dist/cjs/components/Icon/Icon.js +9 -24
- package/dist/cjs/components/Icon/Icon.js.map +1 -1
- package/dist/cjs/components/Icon/IconButton.js +8 -1
- package/dist/cjs/components/Icon/IconButton.js.map +1 -1
- package/dist/cjs/components/Icon/TestIcon.js +35 -0
- package/dist/cjs/components/Icon/TestIcon.js.map +1 -0
- package/dist/cjs/components/Icon/canonicalIconNames.js +123 -621
- package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/cjs/components/Icon/index.js +11 -0
- package/dist/cjs/components/Icon/index.js.map +1 -0
- package/dist/cjs/components/Menu/MenuItem.js +1 -1
- package/dist/cjs/components/Menu/MenuItem.js.map +1 -1
- package/dist/cjs/components/MultiSelect/MultiSelect.js +56 -23
- package/dist/cjs/components/MultiSelect/MultiSelect.js.map +1 -1
- package/dist/cjs/components/Notification/Notification.js +10 -2
- package/dist/cjs/components/Notification/Notification.js.map +1 -1
- package/dist/cjs/components/OverviewItem/OverviewItemDepiction.js +24 -0
- package/dist/cjs/components/OverviewItem/OverviewItemDepiction.js.map +1 -1
- package/dist/cjs/components/Tag/Tag.js +6 -2
- package/dist/cjs/components/Tag/Tag.js.map +1 -1
- package/dist/cjs/components/TextField/TextArea.js +4 -2
- package/dist/cjs/components/TextField/TextArea.js.map +1 -1
- package/dist/cjs/components/TextField/TextField.js +4 -2
- package/dist/cjs/components/TextField/TextField.js.map +1 -1
- package/dist/cjs/components/TextField/useTextValidation.js +84 -0
- package/dist/cjs/components/TextField/useTextValidation.js.map +1 -0
- package/dist/cjs/components/Tree/Tree.js.map +1 -1
- package/dist/cjs/components/Typography/Highlighter.js.map +1 -1
- package/dist/cjs/components/Typography/OverflowText.js.map +1 -1
- package/dist/cjs/components/Typography/WhiteSpaceContainer.js +35 -12
- package/dist/cjs/components/Typography/WhiteSpaceContainer.js.map +1 -1
- package/dist/cjs/components/Typography/index.js +21 -0
- package/dist/cjs/components/Typography/index.js.map +1 -0
- package/dist/cjs/components/Workspace/WorkspaceContent.js +1 -1
- package/dist/cjs/components/Workspace/WorkspaceContent.js.map +1 -1
- package/dist/cjs/components/index.js +18 -0
- package/dist/cjs/components/index.js.map +1 -0
- package/dist/cjs/extensions/react-flow/edges/EdgeLabel.js +58 -0
- package/dist/cjs/extensions/react-flow/edges/EdgeLabel.js.map +1 -0
- package/dist/cjs/extensions/react-flow/handles/HandleDefault.js +12 -3
- package/dist/cjs/extensions/react-flow/handles/HandleDefault.js.map +1 -1
- package/dist/cjs/extensions/react-flow/index.js +11 -0
- package/dist/cjs/extensions/react-flow/index.js.map +1 -1
- package/dist/cjs/extensions/react-flow/nodes/NodeContent.js +57 -30
- package/dist/cjs/extensions/react-flow/nodes/NodeContent.js.map +1 -1
- package/dist/cjs/extensions/react-flow/nodes/NodeDefault.js +3 -2
- package/dist/cjs/extensions/react-flow/nodes/NodeDefault.js.map +1 -1
- package/dist/cjs/extensions/react-flow/versionsupport.js +20 -0
- package/dist/cjs/extensions/react-flow/versionsupport.js.map +1 -0
- package/dist/cjs/index.js +7 -17
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
- package/dist/esm/cmem/react-flow/ReactFlow/ReactFlow.js +7 -2
- package/dist/esm/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -1
- package/dist/esm/cmem/react-flow/StickyNoteModal/StickyNoteModal.js +3 -6
- package/dist/esm/cmem/react-flow/StickyNoteModal/StickyNoteModal.js.map +1 -1
- package/dist/esm/cmem/react-flow/extensions/scrollOnDragHook.js +194 -0
- package/dist/esm/cmem/react-flow/extensions/scrollOnDragHook.js.map +1 -0
- package/dist/esm/common/Intent/index.js +5 -13
- package/dist/esm/common/Intent/index.js.map +1 -1
- package/dist/esm/common/utils/characters.js +96 -0
- package/dist/esm/common/utils/characters.js.map +1 -0
- package/dist/esm/components/Application/ApplicationTitle.js +2 -2
- package/dist/esm/components/Application/ApplicationTitle.js.map +1 -1
- package/dist/esm/components/Badge/Badge.js +48 -0
- package/dist/esm/components/Badge/Badge.js.map +1 -0
- package/dist/esm/components/Depiction/Depiction.js +96 -0
- package/dist/esm/components/Depiction/Depiction.js.map +1 -0
- package/dist/esm/components/Grid/Grid.js +7 -2
- package/dist/esm/components/Grid/Grid.js.map +1 -1
- package/dist/esm/components/Grid/GridColumn.js +6 -2
- package/dist/esm/components/Grid/GridColumn.js.map +1 -1
- package/dist/esm/components/Grid/GridRow.js +3 -0
- package/dist/esm/components/Grid/GridRow.js.map +1 -1
- package/dist/esm/components/Icon/BaseIcon.js +44 -0
- package/dist/esm/components/Icon/BaseIcon.js.map +1 -0
- package/dist/esm/components/Icon/Icon.js +9 -24
- package/dist/esm/components/Icon/Icon.js.map +1 -1
- package/dist/esm/components/Icon/IconButton.js +8 -1
- package/dist/esm/components/Icon/IconButton.js.map +1 -1
- package/dist/esm/components/Icon/TestIcon.js +41 -0
- package/dist/esm/components/Icon/TestIcon.js.map +1 -0
- package/dist/esm/components/Icon/canonicalIconNames.js +123 -621
- package/dist/esm/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/esm/components/Icon/index.js +4 -0
- package/dist/esm/components/Icon/index.js.map +1 -0
- package/dist/esm/components/Menu/MenuItem.js +1 -1
- package/dist/esm/components/Menu/MenuItem.js.map +1 -1
- package/dist/esm/components/MultiSelect/MultiSelect.js +61 -44
- package/dist/esm/components/MultiSelect/MultiSelect.js.map +1 -1
- package/dist/esm/components/Notification/Notification.js +12 -4
- package/dist/esm/components/Notification/Notification.js.map +1 -1
- package/dist/esm/components/OverviewItem/OverviewItemDepiction.js +24 -0
- package/dist/esm/components/OverviewItem/OverviewItemDepiction.js.map +1 -1
- package/dist/esm/components/Tag/Tag.js +6 -2
- package/dist/esm/components/Tag/Tag.js.map +1 -1
- package/dist/esm/components/TextField/TextArea.js +4 -2
- package/dist/esm/components/TextField/TextArea.js.map +1 -1
- package/dist/esm/components/TextField/TextField.js +4 -2
- package/dist/esm/components/TextField/TextField.js.map +1 -1
- package/dist/esm/components/TextField/useTextValidation.js +78 -0
- package/dist/esm/components/TextField/useTextValidation.js.map +1 -0
- package/dist/esm/components/Tree/Tree.js.map +1 -1
- package/dist/esm/components/Typography/Highlighter.js.map +1 -1
- package/dist/esm/components/Typography/OverflowText.js.map +1 -1
- package/dist/esm/components/Typography/WhiteSpaceContainer.js +16 -14
- package/dist/esm/components/Typography/WhiteSpaceContainer.js.map +1 -1
- package/dist/esm/components/Typography/index.js +12 -0
- package/dist/esm/components/Typography/index.js.map +1 -0
- package/dist/esm/components/Workspace/WorkspaceContent.js +1 -1
- package/dist/esm/components/Workspace/WorkspaceContent.js.map +1 -1
- package/dist/esm/components/index.js +6 -0
- package/dist/esm/components/index.js.map +1 -0
- package/dist/esm/extensions/react-flow/edges/EdgeLabel.js +47 -0
- package/dist/esm/extensions/react-flow/edges/EdgeLabel.js.map +1 -0
- package/dist/esm/extensions/react-flow/handles/HandleDefault.js +13 -4
- package/dist/esm/extensions/react-flow/handles/HandleDefault.js.map +1 -1
- package/dist/esm/extensions/react-flow/index.js +1 -0
- package/dist/esm/extensions/react-flow/index.js.map +1 -1
- package/dist/esm/extensions/react-flow/nodes/NodeContent.js +67 -38
- package/dist/esm/extensions/react-flow/nodes/NodeContent.js.map +1 -1
- package/dist/esm/extensions/react-flow/nodes/NodeDefault.js +3 -2
- package/dist/esm/extensions/react-flow/nodes/NodeDefault.js.map +1 -1
- package/dist/esm/extensions/react-flow/versionsupport.js +32 -0
- package/dist/esm/extensions/react-flow/versionsupport.js.map +1 -0
- package/dist/esm/index.js +5 -10
- package/dist/esm/index.js.map +1 -1
- package/dist/types/cmem/ActivityControl/ActivityControlWidget.d.ts +2 -1
- package/dist/types/cmem/react-flow/ReactFlow/ReactFlow.d.ts +14 -0
- package/dist/types/cmem/react-flow/extensions/scrollOnDragHook.d.ts +22 -0
- package/dist/types/common/Intent/index.d.ts +4 -3
- package/dist/types/common/utils/characters.d.ts +19 -0
- package/dist/types/components/Badge/Badge.d.ts +42 -0
- package/dist/types/components/Depiction/Depiction.d.ts +71 -0
- package/dist/types/components/Grid/Grid.d.ts +21 -2
- package/dist/types/components/Grid/GridColumn.d.ts +21 -3
- package/dist/types/components/Grid/GridRow.d.ts +18 -2
- package/dist/types/components/Icon/BaseIcon.d.ts +45 -0
- package/dist/types/components/Icon/Icon.d.ts +7 -34
- package/dist/types/components/Icon/IconButton.d.ts +3 -2
- package/dist/types/components/Icon/TestIcon.d.ts +20 -0
- package/dist/types/components/Icon/canonicalIconNames.d.ts +9 -7
- package/dist/types/components/Icon/index.d.ts +4 -0
- package/dist/types/components/Menu/MenuItem.d.ts +2 -1
- package/dist/types/components/MultiSelect/MultiSelect.d.ts +3 -1
- package/dist/types/components/Notification/Notification.d.ts +13 -4
- package/dist/types/components/Tabs/Tab.d.ts +2 -0
- package/dist/types/components/Tag/Tag.d.ts +16 -3
- package/dist/types/components/TextField/TextArea.d.ts +7 -2
- package/dist/types/components/TextField/TextField.d.ts +6 -1
- package/dist/types/components/TextField/useTextValidation.d.ts +28 -0
- package/dist/types/components/Tree/Tree.d.ts +2 -1
- package/dist/types/components/Typography/Highlighter.d.ts +2 -2
- package/dist/types/components/Typography/OverflowText.d.ts +2 -2
- package/dist/types/components/Typography/WhiteSpaceContainer.d.ts +45 -4
- package/dist/types/components/Typography/index.d.ts +12 -0
- package/dist/types/components/index.d.ts +5 -0
- package/dist/types/extensions/react-flow/edges/EdgeLabel.d.ts +32 -0
- package/dist/types/extensions/react-flow/handles/HandleDefault.d.ts +11 -3
- package/dist/types/extensions/react-flow/index.d.ts +1 -0
- package/dist/types/extensions/react-flow/nodes/NodeContent.d.ts +31 -7
- package/dist/types/extensions/react-flow/nodes/NodeDefault.d.ts +2 -1
- package/dist/types/extensions/react-flow/versionsupport.d.ts +7 -0
- package/dist/types/index.d.ts +6 -11
- package/package.json +14 -16
- package/scripts/compile-sass.ts +9 -1
- package/src/_shame.scss +1 -1
- package/src/cmem/ActivityControl/ActivityControlWidget.stories.tsx +6 -4
- package/src/cmem/ActivityControl/ActivityControlWidget.tsx +3 -2
- package/src/cmem/react-flow/ReactFlow/ReactFlow.tsx +26 -1
- package/src/cmem/react-flow/StickyNoteModal/StickyNoteModal.tsx +10 -6
- package/src/cmem/react-flow/extensions/scrollOnDragHook.ts +247 -0
- package/src/common/Intent/index.ts +16 -12
- package/src/common/utils/characters.ts +111 -0
- package/src/components/Accordion/accordion.scss +4 -3
- package/src/components/Application/ApplicationTitle.tsx +2 -2
- package/src/components/Application/_config.scss +1 -1
- package/src/components/Application/_content.scss +1 -1
- package/src/components/Application/_header.scss +2 -2
- package/src/components/Application/_sidebar.scss +2 -9
- package/src/components/Application/_toolbar.scss +1 -1
- package/src/components/Application/application.scss +4 -4
- package/src/components/AutocompleteField/autoCompleteFieldUtils.tsx +13 -8
- package/src/components/Badge/Badge.stories.tsx +47 -0
- package/src/components/Badge/Badge.tsx +93 -0
- package/src/components/Badge/badge.scss +44 -0
- package/src/components/Depiction/Depiction.tsx +198 -0
- package/src/components/Depiction/depiction.scss +176 -0
- package/src/components/Depiction/stories/Depiction.stories.tsx +69 -0
- package/src/components/Depiction/stories/test-16to9.png +0 -0
- package/src/components/Depiction/stories/test-16to9.svg +41 -0
- package/src/components/Depiction/stories/test-16to9.tobase64.svg +41 -0
- package/src/components/Depiction/stories/test-16to9.tsx +44 -0
- package/src/components/Depiction/stories/test-9to16.png +0 -0
- package/src/components/Depiction/stories/test-9to16.svg +44 -0
- package/src/components/Depiction/stories/test-9to16.tobase64.svg +44 -0
- package/src/components/Depiction/stories/test-9to16.tsx +48 -0
- package/src/components/Grid/Grid.tsx +22 -4
- package/src/components/Grid/GridColumn.tsx +24 -7
- package/src/components/Grid/GridRow.tsx +18 -3
- package/src/components/Grid/grid.scss +14 -13
- package/src/components/Grid/stories/Grid.stories.tsx +27 -0
- package/src/components/Grid/stories/GridColumn.stories.tsx +66 -0
- package/src/components/Grid/stories/GridRow.stories.tsx +47 -0
- package/src/components/Icon/BaseIcon.tsx +84 -0
- package/src/components/Icon/Icon.tsx +23 -82
- package/src/components/Icon/IconButton.tsx +18 -14
- package/src/components/Icon/TestIcon.tsx +39 -0
- package/src/components/Icon/canonicalIconNames.tsx +132 -633
- package/src/components/Icon/index.ts +5 -0
- package/src/components/Icon/stories/Icon.stories.tsx +13 -0
- package/src/components/Icon/stories/IconButton.stories.tsx +14 -7
- package/src/components/Icon/stories/TestIcon.stories.tsx +28 -0
- package/src/components/Link/link.scss +2 -1
- package/src/components/Menu/MenuItem.tsx +14 -4
- package/src/components/Menu/Stories/MenuItem.stories.tsx +16 -2
- package/src/components/MultiSelect/MultiSelect.tsx +58 -27
- package/src/components/Notification/Notification.stories.tsx +4 -0
- package/src/components/Notification/Notification.tsx +26 -6
- package/src/components/OverviewItem/OverviewItemDepiction.tsx +31 -0
- package/src/components/OverviewItem/overviewitem.scss +2 -1
- package/src/components/OverviewItem/stories/OverviewItem.stories.tsx +22 -1
- package/src/components/OverviewItem/stories/OverviewItemDepiction.stories.tsx +8 -3
- package/src/components/Pagination/pagination.scss +3 -2
- package/src/components/SimpleTable/simpletable.scss +11 -12
- package/src/components/Tag/Tag.stories.tsx +7 -2
- package/src/components/Tag/Tag.tsx +24 -4
- package/src/components/Tag/tag.scss +84 -3
- package/src/components/TagInput/taginput.scss +6 -0
- package/src/components/TextField/TextArea.tsx +10 -1
- package/src/components/TextField/TextField.tsx +9 -0
- package/src/components/TextField/stories/SearchField.stories.tsx +1 -1
- package/src/components/TextField/textfield.scss +12 -0
- package/src/components/TextField/useTextValidation.ts +103 -0
- package/src/components/Tooltip/tooltip.scss +1 -1
- package/src/components/Tree/Tree.stories.tsx +7 -1
- package/src/components/Tree/Tree.tsx +2 -1
- package/src/components/Typography/Highlighter.tsx +2 -2
- package/src/components/Typography/OverflowText.tsx +2 -2
- package/src/components/Typography/WhiteSpaceContainer.tsx +69 -21
- package/src/components/Typography/index.ts +25 -0
- package/src/components/Typography/stories/WhiteSpaceContainer.stories.tsx +55 -0
- package/src/components/Typography/typography.scss +3 -2
- package/src/components/Workspace/WorkspaceContent.tsx +1 -1
- package/src/components/index.scss +5 -0
- package/src/components/index.ts +5 -0
- package/src/extensions/react-flow/_config.scss +1 -0
- package/src/extensions/react-flow/edges/EdgeLabel.tsx +83 -0
- package/src/extensions/react-flow/edges/_edges.scss +77 -0
- package/src/extensions/react-flow/edges/stories/EdgeLabel.stories.tsx +39 -0
- package/src/extensions/react-flow/handles/HandleDefault.tsx +38 -10
- package/src/extensions/react-flow/index.ts +1 -0
- package/src/extensions/react-flow/nodes/NodeContent.tsx +134 -55
- package/src/extensions/react-flow/nodes/NodeDefault.tsx +4 -2
- package/src/extensions/react-flow/nodes/_nodes.scss +56 -17
- package/src/extensions/react-flow/nodes/stories/NodeContent.stories.tsx +37 -1
- package/src/extensions/react-flow/versionsupport.ts +22 -0
- package/src/includes/carbon-components/_components.scss +11 -0
- package/src/includes/carbon-components/_requisits.scss +18 -0
- package/src/includes/carbon-components/_variables.scss +50 -53
- package/src/index.scss +4 -105
- package/src/index.ts +6 -16
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Position, useStoreState } from "react-flow-renderer";
|
|
3
|
-
import {
|
|
2
|
+
import { Position, useStoreState as useStoreStateFlowLegacy } from "react-flow-renderer";
|
|
3
|
+
import { useStore as useStoreStateFlowNext } from "react-flow-renderer-lts";
|
|
4
|
+
import { Icon, Depiction, OverflowText } from "../../../index";
|
|
4
5
|
import { CLASSPREFIX as eccgui } from "../../../configuration/constants";
|
|
5
6
|
import { ValidIconName } from "../../../components/Icon/canonicalIconNames";
|
|
6
|
-
import {
|
|
7
|
+
import { DepictionProps } from "../../../components/Depiction/Depiction";
|
|
8
|
+
import { ReacFlowVersionSupportProps, useReactFlowVersion } from "../versionsupport";
|
|
9
|
+
import { HandleDefault, HandleProps, HandleNextProps } from "./../handles/HandleDefault";
|
|
7
10
|
import { NodeProps } from "./NodeDefault";
|
|
8
11
|
import { NodeContentExtensionProps } from "./NodeContentExtension";
|
|
9
12
|
import { Resizable } from "re-resizable";
|
|
@@ -14,6 +17,10 @@ export interface IHandleProps extends HandleProps {
|
|
|
14
17
|
category?: "configuration";
|
|
15
18
|
}
|
|
16
19
|
|
|
20
|
+
interface NodeContentHandleNextProps extends HandleNextProps {
|
|
21
|
+
category?: "configuration";
|
|
22
|
+
}
|
|
23
|
+
|
|
17
24
|
export type NodeDimensions = {
|
|
18
25
|
width: number;
|
|
19
26
|
height: number;
|
|
@@ -26,13 +33,22 @@ interface NodeContentData<CONTENT_PROPS = any> {
|
|
|
26
33
|
*/
|
|
27
34
|
iconName?: ValidIconName;
|
|
28
35
|
/**
|
|
29
|
-
*
|
|
36
|
+
* Depiction element that should be displayed before the node label.
|
|
37
|
+
* As alternative a valid and accessible URL or `data-uri` for an image can be set, then the Depiction element is created automatically.
|
|
30
38
|
*/
|
|
31
|
-
depiction?: string
|
|
39
|
+
depiction?: string | React.ReactElement<DepictionProps>;
|
|
40
|
+
/**
|
|
41
|
+
* Any element that should be displayed as depiction before the node label.
|
|
42
|
+
*/
|
|
43
|
+
leftElement?: JSX.Element;
|
|
32
44
|
/**
|
|
33
45
|
* Label that is displayed in the node header.
|
|
34
46
|
*/
|
|
35
|
-
label: string;
|
|
47
|
+
label: string | JSX.Element;
|
|
48
|
+
/**
|
|
49
|
+
* Element that is displayed as subline under the label in the header.
|
|
50
|
+
*/
|
|
51
|
+
labelSubline?: JSX.Element;
|
|
36
52
|
/**
|
|
37
53
|
* Content element, displayed in the node body.
|
|
38
54
|
*/
|
|
@@ -48,7 +64,7 @@ interface NodeContentData<CONTENT_PROPS = any> {
|
|
|
48
64
|
}
|
|
49
65
|
|
|
50
66
|
export interface NodeContentProps<NODE_DATA, NODE_CONTENT_PROPS = any>
|
|
51
|
-
extends NodeContentData,
|
|
67
|
+
extends NodeContentData, ReacFlowVersionSupportProps,
|
|
52
68
|
React.HTMLAttributes<HTMLDivElement> {
|
|
53
69
|
/**
|
|
54
70
|
* Size of the node.
|
|
@@ -60,6 +76,16 @@ export interface NodeContentProps<NODE_DATA, NODE_CONTENT_PROPS = any>
|
|
|
60
76
|
* If not set to `none` then the node is only displayed in normal size when it is selected.
|
|
61
77
|
*/
|
|
62
78
|
minimalShape?: "none" | "circular" | "rectangular";
|
|
79
|
+
/**
|
|
80
|
+
* Stretches the node to the full available width.
|
|
81
|
+
*/
|
|
82
|
+
fullWidth?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Increase the hight of the node header.
|
|
85
|
+
* Use this for example if you need more space for a label subline.
|
|
86
|
+
* Also the depiction is displayed larger.
|
|
87
|
+
*/
|
|
88
|
+
increadeHeader?: boolean;
|
|
63
89
|
/**
|
|
64
90
|
* Set the type of used highlights to mark the node.
|
|
65
91
|
*/
|
|
@@ -90,7 +116,7 @@ export interface NodeContentProps<NODE_DATA, NODE_CONTENT_PROPS = any>
|
|
|
90
116
|
* Array of property definition objects for `Handle` components that need to be created for the node.
|
|
91
117
|
* @see https://reactflow.dev/docs/api/handle/
|
|
92
118
|
*/
|
|
93
|
-
handles?: IHandleProps[];
|
|
119
|
+
handles?: IHandleProps[] | NodeContentHandleNextProps[];
|
|
94
120
|
/**
|
|
95
121
|
* Set the minimal number of handles on left or right side of the node to activate the recalculation of the minimal height of the node.
|
|
96
122
|
*/
|
|
@@ -153,14 +179,33 @@ export interface NodeContentProps<NODE_DATA, NODE_CONTENT_PROPS = any>
|
|
|
153
179
|
nodeDimensions?: NodeDimensions;
|
|
154
180
|
}
|
|
155
181
|
|
|
156
|
-
interface
|
|
182
|
+
interface MemoHandlerLegacyProps extends HandleProps {
|
|
183
|
+
posdirection: string;
|
|
184
|
+
style: {
|
|
185
|
+
[key: string]: string | undefined;
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
interface MemoHandlerNextProps extends HandleNextProps {
|
|
157
190
|
posdirection: string;
|
|
158
191
|
style: {
|
|
159
192
|
[key: string]: string | undefined;
|
|
160
193
|
};
|
|
161
194
|
}
|
|
162
195
|
|
|
163
|
-
|
|
196
|
+
type MemoHandlerProps = MemoHandlerLegacyProps | MemoHandlerNextProps;
|
|
197
|
+
|
|
198
|
+
const defaultHandles = () => {
|
|
199
|
+
const flowVersion = useReactFlowVersion();
|
|
200
|
+
switch (flowVersion) {
|
|
201
|
+
case "legacy":
|
|
202
|
+
return [{ type: "target" }, { type: "source" }] as IHandleProps[];
|
|
203
|
+
case "next":
|
|
204
|
+
return [{ type: "target" }, { type: "source" }] as NodeContentHandleNextProps[];
|
|
205
|
+
default:
|
|
206
|
+
return [];
|
|
207
|
+
}
|
|
208
|
+
}
|
|
164
209
|
|
|
165
210
|
const getDefaultMinimalTooltipData = (node: any) => {
|
|
166
211
|
return {
|
|
@@ -171,7 +216,7 @@ const getDefaultMinimalTooltipData = (node: any) => {
|
|
|
171
216
|
};
|
|
172
217
|
};
|
|
173
218
|
|
|
174
|
-
const addHandles = (handles: any, position: any, posDirection: any, isConnectable: any, nodeStyle: any) => {
|
|
219
|
+
const addHandles = (handles: any, position: any, posDirection: any, isConnectable: any, nodeStyle: any, flowVersion: any = "legacy") => {
|
|
175
220
|
return handles[position].map((handle: any, idx: any) => {
|
|
176
221
|
const { className, style = {}, category } = handle;
|
|
177
222
|
const styleAdditions: { [key: string]: string } = {
|
|
@@ -191,22 +236,10 @@ const addHandles = (handles: any, position: any, posDirection: any, isConnectabl
|
|
|
191
236
|
: className,
|
|
192
237
|
},
|
|
193
238
|
};
|
|
194
|
-
return <MemoHandler {...handleProperties} key={"handle" + idx} />;
|
|
239
|
+
return <MemoHandler flowVersion={flowVersion} {...handleProperties} key={"handle" + idx} />;
|
|
195
240
|
});
|
|
196
241
|
};
|
|
197
242
|
|
|
198
|
-
const imgWithTooltip = (imgEl: any, tooltipText: any) => {
|
|
199
|
-
if (!!tooltipText) {
|
|
200
|
-
return (
|
|
201
|
-
<Tooltip content={tooltipText}>
|
|
202
|
-
<span>{imgEl}</span>
|
|
203
|
-
</Tooltip>
|
|
204
|
-
);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
return imgEl;
|
|
208
|
-
};
|
|
209
|
-
|
|
210
243
|
export const gethighlightedStateClasses = (state: any, baseClassName: any) => {
|
|
211
244
|
let hightlights = typeof state === "string" ? [state] : state;
|
|
212
245
|
//@ts-ignore
|
|
@@ -226,20 +259,25 @@ const MemoHandler = React.memo(
|
|
|
226
259
|
* This element cannot be used directly, all properties must be routed through the `data` property of an `elements` property item inside the `ReactFlow` container.
|
|
227
260
|
*/
|
|
228
261
|
export function NodeContent<CONTENT_PROPS = any>({
|
|
262
|
+
flowVersion = useReactFlowVersion(),
|
|
229
263
|
iconName,
|
|
230
264
|
depiction,
|
|
265
|
+
leftElement,
|
|
231
266
|
typeLabel,
|
|
232
267
|
label,
|
|
268
|
+
labelSubline,
|
|
269
|
+
increadeHeader,
|
|
270
|
+
fullWidth,
|
|
233
271
|
showExecutionButtons = true,
|
|
234
272
|
executionButtons,
|
|
235
273
|
menuButtons,
|
|
236
274
|
content,
|
|
237
275
|
contentExtension,
|
|
238
|
-
|
|
276
|
+
footerContent,
|
|
239
277
|
size = "small",
|
|
240
278
|
minimalShape = "circular",
|
|
241
279
|
highlightedState,
|
|
242
|
-
handles = defaultHandles,
|
|
280
|
+
handles = defaultHandles(),
|
|
243
281
|
adaptHeightForHandleMinCount,
|
|
244
282
|
adaptSizeIncrement = 15,
|
|
245
283
|
getMinimalTooltipData = getDefaultMinimalTooltipData,
|
|
@@ -259,16 +297,22 @@ export function NodeContent<CONTENT_PROPS = any>({
|
|
|
259
297
|
// other props for DOM element
|
|
260
298
|
...otherProps
|
|
261
299
|
}: NodeContentProps<any>) {
|
|
300
|
+
const isResizeable = (!!onNodeResize && minimalShape === "none");
|
|
262
301
|
const [width, setWidth] = React.useState<number>(nodeDimensions?.width ?? 0);
|
|
263
302
|
const [height, setHeight] = React.useState<number>(nodeDimensions?.height ?? 0);
|
|
264
|
-
|
|
303
|
+
let zoom = 1;
|
|
304
|
+
if (isResizeable) try {
|
|
305
|
+
[, , zoom] = flowVersion === "legacy"
|
|
306
|
+
? useStoreStateFlowLegacy((state) => state.transform)
|
|
307
|
+
: useStoreStateFlowNext((state) => state.transform);
|
|
308
|
+
} catch {}
|
|
265
309
|
const [adjustedContentProps, setAdjustedContentProps] = React.useState<Partial<CONTENT_PROPS>>({});
|
|
266
310
|
const nodeContentRef = React.useRef<any>();
|
|
267
|
-
const handleStack
|
|
268
|
-
handleStack[Position.Top] = [] as IHandleProps[];
|
|
269
|
-
handleStack[Position.Right] = [] as IHandleProps[];
|
|
270
|
-
handleStack[Position.Bottom] = [] as IHandleProps[];
|
|
271
|
-
handleStack[Position.Left] = [] as IHandleProps[];
|
|
311
|
+
const handleStack = flowVersion==="legacy" ? {} as { [key: string]: IHandleProps[] } : {} as { [key: string]: NodeContentHandleNextProps[] };
|
|
312
|
+
handleStack[Position.Top] = flowVersion==="legacy" ? [] as IHandleProps[] : [] as NodeContentHandleNextProps[];
|
|
313
|
+
handleStack[Position.Right] = flowVersion==="legacy" ? [] as IHandleProps[] : [] as NodeContentHandleNextProps[];
|
|
314
|
+
handleStack[Position.Bottom] = flowVersion==="legacy" ? [] as IHandleProps[] : [] as NodeContentHandleNextProps[];
|
|
315
|
+
handleStack[Position.Left] = flowVersion==="legacy" ? [] as IHandleProps[] : [] as NodeContentHandleNextProps[];
|
|
272
316
|
|
|
273
317
|
// initial dimension before resize
|
|
274
318
|
React.useEffect(() => {
|
|
@@ -333,6 +377,7 @@ export function NodeContent<CONTENT_PROPS = any>({
|
|
|
333
377
|
`${eccgui}-graphviz__node` +
|
|
334
378
|
` ${eccgui}-graphviz__node--${size}` +
|
|
335
379
|
` ${eccgui}-graphviz__node--minimal-${minimalShape}` +
|
|
380
|
+
(fullWidth ? ` ${eccgui}-graphviz__node--fullwidth` : "") +
|
|
336
381
|
(!!highlightedState
|
|
337
382
|
? " " + gethighlightedStateClasses(highlightedState, `${eccgui}-graphviz__node`)
|
|
338
383
|
: "") +
|
|
@@ -341,32 +386,66 @@ export function NodeContent<CONTENT_PROPS = any>({
|
|
|
341
386
|
(letPassWheelEvents === false ? ` nowheel` : "")
|
|
342
387
|
}
|
|
343
388
|
>
|
|
344
|
-
<header className={
|
|
345
|
-
{
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
389
|
+
<header className={
|
|
390
|
+
`${eccgui}-graphviz__node__header` +
|
|
391
|
+
((increadeHeader && minimalShape==="none") ? ` ${eccgui}-graphviz__node__header--large` : "")
|
|
392
|
+
}>
|
|
393
|
+
{(!!iconName || !!depiction || !!leftElement) && (
|
|
394
|
+
<div className={`${eccgui}-graphviz__node__header-depiction`}>
|
|
395
|
+
{ leftElement }
|
|
396
|
+
{!!depiction && !leftElement && typeof depiction === "string" && (
|
|
397
|
+
<Depiction
|
|
398
|
+
image={<img src={depiction} alt="" />}
|
|
399
|
+
caption={minimalShape === "none" || selected ? typeLabel : undefined}
|
|
400
|
+
captionPosition="tooltip"
|
|
401
|
+
padding="tiny"
|
|
402
|
+
ratio="1:1"
|
|
403
|
+
resizing="contain"
|
|
404
|
+
forceInlineSvg
|
|
356
405
|
/>
|
|
357
406
|
)}
|
|
358
|
-
|
|
407
|
+
{!!depiction && !leftElement && typeof depiction !== "string" && (
|
|
408
|
+
React.cloneElement(depiction, {
|
|
409
|
+
caption: minimalShape === "none" || selected ? typeLabel : undefined,
|
|
410
|
+
captionPosition: "tooltip",
|
|
411
|
+
padding: "tiny",
|
|
412
|
+
ratio: "1:1",
|
|
413
|
+
resizing: "contain",
|
|
414
|
+
forceInlineSvg: true,
|
|
415
|
+
})
|
|
416
|
+
)}
|
|
417
|
+
{!!iconName && !leftElement && !depiction && (
|
|
418
|
+
<Depiction
|
|
419
|
+
image={<Icon name={iconName} />}
|
|
420
|
+
caption={minimalShape === "none" || selected ? typeLabel : undefined}
|
|
421
|
+
captionPosition="tooltip"
|
|
422
|
+
padding="tiny"
|
|
423
|
+
ratio="1:1"
|
|
424
|
+
resizing="contain"
|
|
425
|
+
forceInlineSvg
|
|
426
|
+
/>
|
|
427
|
+
)}
|
|
428
|
+
</div>
|
|
359
429
|
)}
|
|
360
|
-
<
|
|
361
|
-
{
|
|
362
|
-
|
|
430
|
+
<div className={`${eccgui}-graphviz__node__header-label`} title={typeof label==="string" ? label : undefined}>
|
|
431
|
+
{
|
|
432
|
+
typeof label === "string"
|
|
433
|
+
? <OverflowText className={`${eccgui}-graphviz__node__header-label__mainline`}>{label}</OverflowText>
|
|
434
|
+
: <div className={`${eccgui}-graphviz__node__header-label__mainline`}>{label}</div>
|
|
435
|
+
}
|
|
436
|
+
{!!labelSubline && (
|
|
437
|
+
<div className={`${eccgui}-graphviz__node__header-label__subline`}>
|
|
438
|
+
{ labelSubline }
|
|
439
|
+
</div>
|
|
440
|
+
)}
|
|
441
|
+
</div>
|
|
363
442
|
{(menuButtons || (showExecutionButtons && executionButtons)) && (
|
|
364
|
-
<
|
|
443
|
+
<div className={`${eccgui}-graphviz__node__header-menu`}>
|
|
365
444
|
{showExecutionButtons && typeof executionButtons === "function"
|
|
366
445
|
? executionButtons(adjustedContentProps, setAdjustedContentProps)
|
|
367
446
|
: null}
|
|
368
447
|
{menuButtons ?? null}
|
|
369
|
-
</
|
|
448
|
+
</div>
|
|
370
449
|
)}
|
|
371
450
|
</header>
|
|
372
451
|
{content && (
|
|
@@ -383,10 +462,10 @@ export function NodeContent<CONTENT_PROPS = any>({
|
|
|
383
462
|
</section>
|
|
384
463
|
{!!handles && (
|
|
385
464
|
<>
|
|
386
|
-
{addHandles(handleStack, Position.Top, "left", isConnectable, style)}
|
|
387
|
-
{addHandles(handleStack, Position.Right, "top", isConnectable, style)}
|
|
388
|
-
{addHandles(handleStack, Position.Bottom, "left", isConnectable, style)}
|
|
389
|
-
{addHandles(handleStack, Position.Left, "top", isConnectable, style)}
|
|
465
|
+
{addHandles(handleStack, Position.Top, "left", isConnectable, style, flowVersion)}
|
|
466
|
+
{addHandles(handleStack, Position.Right, "top", isConnectable, style, flowVersion)}
|
|
467
|
+
{addHandles(handleStack, Position.Bottom, "left", isConnectable, style, flowVersion)}
|
|
468
|
+
{addHandles(handleStack, Position.Left, "top", isConnectable, style, flowVersion)}
|
|
390
469
|
</>
|
|
391
470
|
)}
|
|
392
471
|
</>
|
|
@@ -419,5 +498,5 @@ export function NodeContent<CONTENT_PROPS = any>({
|
|
|
419
498
|
</Resizable>
|
|
420
499
|
);
|
|
421
500
|
|
|
422
|
-
return (
|
|
501
|
+
return (isResizeable) ? resizableNode() : nodeContent;
|
|
423
502
|
}
|
|
@@ -5,8 +5,9 @@ import {
|
|
|
5
5
|
} from "react-flow-renderer";
|
|
6
6
|
import { Tooltip } from "../../../index";
|
|
7
7
|
import { NodeContent, NodeContentProps } from "./NodeContent";
|
|
8
|
+
import { ReacFlowVersionSupportProps, useReactFlowVersion } from "../versionsupport";
|
|
8
9
|
|
|
9
|
-
export interface NodeProps<NODE_DATA, NODE_CONTENT_PROPS = any> extends ReactFlowNodeProps {
|
|
10
|
+
export interface NodeProps<NODE_DATA, NODE_CONTENT_PROPS = any> extends ReacFlowVersionSupportProps, ReactFlowNodeProps {
|
|
10
11
|
/**
|
|
11
12
|
* Contains all properties for our implementation of the React-Flow node.
|
|
12
13
|
* For details pls see the `NodeContent` element documentation.
|
|
@@ -22,6 +23,7 @@ export interface NodeProps<NODE_DATA, NODE_CONTENT_PROPS = any> extends ReactFlo
|
|
|
22
23
|
export const NodeDefault = memo(
|
|
23
24
|
(node: NodeProps<any>) => {
|
|
24
25
|
const {
|
|
26
|
+
flowVersion = useReactFlowVersion(),
|
|
25
27
|
data,
|
|
26
28
|
targetPosition = Position.Left,
|
|
27
29
|
sourcePosition = Position.Right,
|
|
@@ -29,7 +31,7 @@ export const NodeDefault = memo(
|
|
|
29
31
|
selected
|
|
30
32
|
} = node;
|
|
31
33
|
|
|
32
|
-
const nodeEl = <NodeContent {...{...data, targetPosition, sourcePosition, isConnectable, selected}} />
|
|
34
|
+
const nodeEl = <NodeContent {...{flowVersion, ...data, targetPosition, sourcePosition, isConnectable, selected}} />
|
|
33
35
|
|
|
34
36
|
if (!selected && data?.minimalShape !== "none" && !!data?.getMinimalTooltipData) {
|
|
35
37
|
const tooltipData = data?.getMinimalTooltipData(node);
|
|
@@ -120,22 +120,20 @@
|
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
+
.#{$eccgui}-graphviz__node__header--large {
|
|
124
|
+
min-height: $reactflow-node-largesize;
|
|
125
|
+
}
|
|
126
|
+
|
|
123
127
|
.#{$eccgui}-graphviz__node__header-depiction,
|
|
124
128
|
.#{$eccgui}-graphviz__node__header-menu {
|
|
125
129
|
flex-grow: 0;
|
|
126
130
|
flex-shrink: 0;
|
|
127
131
|
max-height: calc(#{$reactflow-node-basesize} - #{2 * $reactflow-node-border-width});
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.#{$eccgui}-graphviz__node__header-label {
|
|
131
132
|
margin: 0 $eccgui-size-block-whitespace * 0.25;
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
flex-shrink: 1;
|
|
137
|
-
display: inline-block;
|
|
138
|
-
text-align: left;
|
|
133
|
+
|
|
134
|
+
.#{$eccgui}-graphviz__node__header--large & {
|
|
135
|
+
max-height: calc(#{$reactflow-node-largesize} - #{2 * $reactflow-node-border-width});
|
|
136
|
+
}
|
|
139
137
|
}
|
|
140
138
|
|
|
141
139
|
.#{$eccgui}-graphviz__node__header-depiction {
|
|
@@ -151,16 +149,53 @@
|
|
|
151
149
|
justify-content: center;
|
|
152
150
|
align-items: center;
|
|
153
151
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
152
|
+
& .#{$eccgui}-depiction {
|
|
153
|
+
flex-grow: 0;
|
|
154
|
+
flex-shrink: 0;
|
|
155
|
+
align-self: stretch;
|
|
156
|
+
|
|
157
|
+
/*
|
|
158
|
+
Fix for Firefox,
|
|
159
|
+
the width of .#{$eccgui}-depiction container is not reduced to its content
|
|
160
|
+
when .#{$eccgui}-depiction__image updated to the available height.
|
|
161
|
+
*/
|
|
162
|
+
.#{$eccgui}-depiction__image {
|
|
163
|
+
height: calc(#{$reactflow-node-basesize} - #{2 * $reactflow-node-border-width});
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.#{$eccgui}-graphviz__node__header--large & {
|
|
168
|
+
min-width: calc(#{$reactflow-node-largesize} - #{2 * $reactflow-node-border-width});
|
|
169
|
+
min-height: calc(#{$reactflow-node-largesize} - #{2 * $reactflow-node-border-width});
|
|
170
|
+
max-width: calc(2 * (#{$reactflow-node-largesize} - #{2 * $reactflow-node-border-width}));
|
|
171
|
+
|
|
172
|
+
.#{$eccgui}-depiction__image {
|
|
173
|
+
height: calc(#{$reactflow-node-largesize} - #{2 * $reactflow-node-border-width});
|
|
174
|
+
}
|
|
161
175
|
}
|
|
162
176
|
}
|
|
163
177
|
|
|
178
|
+
.#{$eccgui}-graphviz__node__header-label {
|
|
179
|
+
margin: 0 $eccgui-size-block-whitespace * 0.25;
|
|
180
|
+
white-space: nowrap;
|
|
181
|
+
overflow: hidden;
|
|
182
|
+
text-overflow: ellipsis;
|
|
183
|
+
flex-grow: 1;
|
|
184
|
+
flex-shrink: 1;
|
|
185
|
+
display: inline-flex;
|
|
186
|
+
flex-direction: column;
|
|
187
|
+
text-align: left;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.#{$eccgui}-graphviz__node__header-label__mainline,
|
|
191
|
+
.#{$eccgui}-graphviz__node__header-label__subline {
|
|
192
|
+
overflow: hidden;
|
|
193
|
+
text-overflow: ellipsis;
|
|
194
|
+
white-space: nowrap;
|
|
195
|
+
flex-grow: 0;
|
|
196
|
+
flex-shrink: 0;
|
|
197
|
+
}
|
|
198
|
+
|
|
164
199
|
.#{$eccgui}-graphviz__node__content {
|
|
165
200
|
padding: $eccgui-size-block-whitespace * 0.5 $eccgui-size-block-whitespace * 0.25;
|
|
166
201
|
overflow: hidden;
|
|
@@ -225,6 +260,10 @@
|
|
|
225
260
|
max-height: $reactflow-node-basesize * 13;
|
|
226
261
|
}
|
|
227
262
|
|
|
263
|
+
.#{$eccgui}-graphviz__node--fullwidth:not(.is-resizeable) {
|
|
264
|
+
width: 100%;
|
|
265
|
+
}
|
|
266
|
+
|
|
228
267
|
// Node highlights
|
|
229
268
|
|
|
230
269
|
.#{$eccgui}-graphviz__node--highlight-success,
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import React, { useState, useEffect, useCallback } from "react";
|
|
2
2
|
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
-
import { LoremIpsum } from 'react-lorem-ipsum';
|
|
3
|
+
import { LoremIpsum, loremIpsum } from 'react-lorem-ipsum';
|
|
4
4
|
import ReactFlow, { Elements, ReactFlowProvider } from 'react-flow-renderer';
|
|
5
5
|
import {
|
|
6
|
+
Badge,
|
|
7
|
+
ContextMenu,
|
|
8
|
+
MenuItem,
|
|
6
9
|
OverflowText,
|
|
7
10
|
HtmlContentBlock,
|
|
11
|
+
IconButton,
|
|
12
|
+
Tag,
|
|
13
|
+
TagList,
|
|
8
14
|
} from "./../../../../index";
|
|
15
|
+
import canonicalIcons from "./../../../../components/Icon/canonicalIconNames";
|
|
9
16
|
|
|
10
17
|
import { NodeContent } from "./../NodeContent";
|
|
11
18
|
import { nodeTypes } from "./../nodeTypes";
|
|
@@ -29,6 +36,35 @@ export default {
|
|
|
29
36
|
"Slide out example": <NodeContentExtension {...ContentExtensionExampleSlideOut.args} />,
|
|
30
37
|
},
|
|
31
38
|
},
|
|
39
|
+
labelSubline: {
|
|
40
|
+
control: "select",
|
|
41
|
+
options: ["Not set", "Text string", "OverflowText element", "Tag list"],
|
|
42
|
+
mapping: {
|
|
43
|
+
"Not set": undefined,
|
|
44
|
+
"Text string": loremIpsum({ p: 1, avgSentencesPerParagraph: 1, avgWordsPerSentence: 8, random: false }).toString(),
|
|
45
|
+
"OverflowText element": <OverflowText>{loremIpsum({ p: 1, avgSentencesPerParagraph: 2, avgWordsPerSentence: 4, random: false }).toString()}</OverflowText>,
|
|
46
|
+
"Tag list": <TagList>{
|
|
47
|
+
loremIpsum({ p: 1, avgSentencesPerParagraph: 1, avgWordsPerSentence: 5, random: false })
|
|
48
|
+
.toString()
|
|
49
|
+
.split(" ")
|
|
50
|
+
.map((term) => <Tag small>{term}</Tag>)
|
|
51
|
+
}</TagList>
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
menuButtons: {
|
|
55
|
+
control: "select",
|
|
56
|
+
options: ["Not set", "Icon button", "Context Menu", "Info badge"],
|
|
57
|
+
mapping: {
|
|
58
|
+
"Not set": undefined,
|
|
59
|
+
"Icon button": <IconButton name="item-info" text="Icon button" onClick={()=>alert("Click info")} />,
|
|
60
|
+
"Context Menu": <ContextMenu><MenuItem text="Context menu" /></ContextMenu>,
|
|
61
|
+
"Info badge": <Badge intent="info">Info</Badge>,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
iconName: {
|
|
65
|
+
control: "select",
|
|
66
|
+
options: [...(Object.keys(canonicalIcons))],
|
|
67
|
+
},
|
|
32
68
|
content: { control: "none" },
|
|
33
69
|
footerContent: { control: "none" },
|
|
34
70
|
isConnectable: { table: { disable: true } },
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useStoreState as useStoreStateFlowLegacy } from "react-flow-renderer";
|
|
2
|
+
import { useStore as useStoreStateFlowNext } from "react-flow-renderer-lts";
|
|
3
|
+
|
|
4
|
+
export interface ReacFlowVersionSupportProps {
|
|
5
|
+
/**
|
|
6
|
+
* Spevifies the context of the react flow renderer version that is used for the component.
|
|
7
|
+
*/
|
|
8
|
+
flowVersion?: "legacy" | "next" | "none";
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const useReactFlowVersion = () => {
|
|
12
|
+
try {
|
|
13
|
+
const [, , zoom] = useStoreStateFlowLegacy((state) => state.transform);
|
|
14
|
+
return !!zoom ? "legacy" : "none";
|
|
15
|
+
} catch {}
|
|
16
|
+
try {
|
|
17
|
+
const [, , zoom] = useStoreStateFlowNext((state) => state.transform);
|
|
18
|
+
return !!zoom ? "next" : "none";
|
|
19
|
+
} catch {}
|
|
20
|
+
|
|
21
|
+
return "none";
|
|
22
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*
|
|
2
|
+
FIXME:
|
|
3
|
+
it's probably not necessary to include those elements because they should be included by
|
|
4
|
+
the Carbon components itself when they are necessary as sub components. We may remove this
|
|
5
|
+
file later when we haven't experiences any problems.
|
|
6
|
+
*/
|
|
7
|
+
// @use "~@carbon/styles/scss/components/select/index" as select;
|
|
8
|
+
// @use "~@carbon/styles/scss/components/list-box/index" as list-box;
|
|
9
|
+
// @use "~@carbon/styles/scss/components/dropdown/index" as dropdown;
|
|
10
|
+
|
|
11
|
+
@use "~@carbon/styles/scss/components/popover/index" as popover; // necessary for pagination
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
@use "~@carbon/styles/scss/config" with (
|
|
2
|
+
$css--body: $css--body,
|
|
3
|
+
$css--font-face: $css--font-face,
|
|
4
|
+
$css--reset: $css--reset,
|
|
5
|
+
$css--default-type: $css--default-type,
|
|
6
|
+
$prefix: $prefix,
|
|
7
|
+
$flex-grid-columns: $flex-grid-columns,
|
|
8
|
+
$use-flexbox-grid: $use-flexbox-grid
|
|
9
|
+
);
|
|
10
|
+
@use "~@carbon/styles/scss/utilities/_visually-hidden";
|
|
11
|
+
@import "~@carbon/styles/scss/feature-flags";
|
|
12
|
+
@import "~@carbon/styles/scss/colors";
|
|
13
|
+
@import "~@carbon/styles/scss/theme";
|
|
14
|
+
:root {
|
|
15
|
+
@include theme;
|
|
16
|
+
}
|
|
17
|
+
@import "~@carbon/styles/scss/spacing";
|
|
18
|
+
@import "~@carbon/styles/scss/utilities/z-index";
|