@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
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import Highlighter, { HighlighterProps } from "./Highlighter";
|
|
2
|
+
import { extractSearchWords, matchesAllWords, createMultiWordRegex } from "./Highlighter";
|
|
3
|
+
import HtmlContentBlock, { HtmlContentBlockProps } from "./HtmlContentBlock";
|
|
4
|
+
import OverflowText, { OverflowTextProps } from "./OverflowText";
|
|
5
|
+
import WhiteSpaceContainer, { WhiteSpaceContainerProps } from "./WhiteSpaceContainer";
|
|
6
|
+
|
|
7
|
+
export type {
|
|
8
|
+
HighlighterProps,
|
|
9
|
+
HtmlContentBlockProps,
|
|
10
|
+
OverflowTextProps,
|
|
11
|
+
WhiteSpaceContainerProps
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
Highlighter,
|
|
16
|
+
HtmlContentBlock,
|
|
17
|
+
OverflowText,
|
|
18
|
+
WhiteSpaceContainer,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const HighlighterFunctions = {
|
|
22
|
+
extractSearchWords,
|
|
23
|
+
matchesAllWords,
|
|
24
|
+
createMultiWordRegex,
|
|
25
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
+
import { loremIpsum } from "react-lorem-ipsum";
|
|
4
|
+
import { WhiteSpaceContainer as WhiteSpaceContainerElement } from "../../../index";
|
|
5
|
+
|
|
6
|
+
const whiteSpaceSizeOptions = {
|
|
7
|
+
control: "select",
|
|
8
|
+
options: {
|
|
9
|
+
"not set": undefined,
|
|
10
|
+
"tiny": "tiny",
|
|
11
|
+
"small": "small",
|
|
12
|
+
"regular": "regular",
|
|
13
|
+
"large": "large",
|
|
14
|
+
"xlarge": "xlarge"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
title: "Components/Typography",
|
|
20
|
+
component: WhiteSpaceContainerElement,
|
|
21
|
+
argTypes: {
|
|
22
|
+
children: { control: "none" },
|
|
23
|
+
marginTop: {...whiteSpaceSizeOptions},
|
|
24
|
+
marginRight: {...whiteSpaceSizeOptions},
|
|
25
|
+
marginBottom: {...whiteSpaceSizeOptions},
|
|
26
|
+
marginLeft: {...whiteSpaceSizeOptions},
|
|
27
|
+
paddingTop: {...whiteSpaceSizeOptions},
|
|
28
|
+
paddingRight: {...whiteSpaceSizeOptions},
|
|
29
|
+
paddingBottom: {...whiteSpaceSizeOptions},
|
|
30
|
+
paddingLeft: {...whiteSpaceSizeOptions},
|
|
31
|
+
},
|
|
32
|
+
} as ComponentMeta<typeof WhiteSpaceContainerElement>;
|
|
33
|
+
|
|
34
|
+
const Template: ComponentStory<typeof WhiteSpaceContainerElement> = (args) => (
|
|
35
|
+
<WhiteSpaceContainerElement {...args} style={{background: "#eee"}}/>
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
const testContent = loremIpsum({
|
|
39
|
+
p: 2,
|
|
40
|
+
avgSentencesPerParagraph: 4,
|
|
41
|
+
random: false
|
|
42
|
+
}).toString()
|
|
43
|
+
|
|
44
|
+
export const WhiteSpaceContainer = Template.bind({});
|
|
45
|
+
WhiteSpaceContainer.args = {
|
|
46
|
+
children: [
|
|
47
|
+
<p>{ testContent }</p>,
|
|
48
|
+
<p><strong>{ testContent.replaceAll(" ", "") }</strong></p>,
|
|
49
|
+
<p>{ testContent }</p>
|
|
50
|
+
],
|
|
51
|
+
paddingTop: "tiny",
|
|
52
|
+
paddingRight: "small",
|
|
53
|
+
paddingBottom: "regular",
|
|
54
|
+
paddingLeft: "large",
|
|
55
|
+
}
|
|
@@ -205,7 +205,7 @@ table {
|
|
|
205
205
|
.#{$eccgui}-typography__overflowtext--passdown * {
|
|
206
206
|
overflow: hidden;
|
|
207
207
|
text-overflow: ellipsis;
|
|
208
|
-
|
|
208
|
+
overflow-wrap: normal;
|
|
209
209
|
white-space: nowrap;
|
|
210
210
|
// display: inherit;
|
|
211
211
|
max-width: 100%;
|
|
@@ -254,7 +254,8 @@ table {
|
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
.#{$eccgui}-typography--forcelinebreak {
|
|
257
|
-
word-break:
|
|
257
|
+
word-break: normal;
|
|
258
|
+
overflow-wrap: anywhere;
|
|
258
259
|
}
|
|
259
260
|
|
|
260
261
|
.#{$eccgui}-typography--preventlinebreak {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
$reactflow-node-basesize: $button-height !default;
|
|
2
|
+
$reactflow-node-largesize: mini-units(6) !default;
|
|
2
3
|
$reactflow-node-border-color: $eccgui-color-workspace-text !default;
|
|
3
4
|
$reactflow-node-background-color: $button-background-color !default;
|
|
4
5
|
$reactflow-node-color: $eccgui-color-workspace-text !default;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import React, { memo } from "react";
|
|
2
|
+
import { Icon, Depiction, DepictionProps, OverflowText } from "../../../index";
|
|
3
|
+
import { CLASSPREFIX as eccgui } from "../../../configuration/constants";
|
|
4
|
+
import { ValidIconName } from "../../../components/Icon/canonicalIconNames";
|
|
5
|
+
import { IntentTypes, intentClassName } from "../../../common/Intent";
|
|
6
|
+
|
|
7
|
+
export interface EdgeLabelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
/**
|
|
9
|
+
* Depiction element displayed left from the label.
|
|
10
|
+
*/
|
|
11
|
+
depiction?: ValidIconName | React.ReactElement<DepictionProps>;
|
|
12
|
+
/**
|
|
13
|
+
* Label of the edge.
|
|
14
|
+
* Cannot overflow the parent container.
|
|
15
|
+
*/
|
|
16
|
+
text: string | JSX.Element;
|
|
17
|
+
/**
|
|
18
|
+
* One or multiple other elements displayed right from label.
|
|
19
|
+
*/
|
|
20
|
+
actions?: JSX.Element | JSX.Element[];
|
|
21
|
+
/**
|
|
22
|
+
* The element is increased in its size.
|
|
23
|
+
*/
|
|
24
|
+
large?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Stretches the label component to the full available width.
|
|
27
|
+
*/
|
|
28
|
+
fullWidth?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Add a info state to the label, visualized by color.
|
|
31
|
+
*/
|
|
32
|
+
intent?: IntentTypes;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const EdgeLabel = memo(({
|
|
36
|
+
depiction,
|
|
37
|
+
text,
|
|
38
|
+
actions,
|
|
39
|
+
large,
|
|
40
|
+
fullWidth,
|
|
41
|
+
intent,
|
|
42
|
+
...otherDivProps
|
|
43
|
+
} : EdgeLabelProps) => {
|
|
44
|
+
|
|
45
|
+
const depEl = (!!depiction && typeof depiction === "string")
|
|
46
|
+
? <Depiction image={<Icon name={depiction as ValidIconName} />} />
|
|
47
|
+
: depiction;
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<div
|
|
51
|
+
className={
|
|
52
|
+
`${eccgui}-graphviz__edge-label` +
|
|
53
|
+
(large ? ` ${eccgui}-graphviz__edge-label--large` : "") +
|
|
54
|
+
(fullWidth ? ` ${eccgui}-graphviz__edge-label--fullwidth` : "") +
|
|
55
|
+
(!!intent ? ` ${intentClassName(intent)}` : '')
|
|
56
|
+
}
|
|
57
|
+
{...otherDivProps}
|
|
58
|
+
>
|
|
59
|
+
{!!depEl && (
|
|
60
|
+
<div className={`${eccgui}-graphviz__edge-label__depiction`}>
|
|
61
|
+
{
|
|
62
|
+
React.cloneElement(depEl, {
|
|
63
|
+
padding: "tiny",
|
|
64
|
+
ratio: "1:1",
|
|
65
|
+
resizing: "contain",
|
|
66
|
+
forceInlineSvg: true,
|
|
67
|
+
border: false,
|
|
68
|
+
backgroundColor: undefined,
|
|
69
|
+
})
|
|
70
|
+
}
|
|
71
|
+
</div>
|
|
72
|
+
)}
|
|
73
|
+
<div className={`${eccgui}-graphviz__edge-label__text`}>
|
|
74
|
+
{ typeof text === "string" ? <OverflowText>{ text }</OverflowText> : text }
|
|
75
|
+
</div>
|
|
76
|
+
{!!actions && (
|
|
77
|
+
<div className={`${eccgui}-graphviz__edge-label__aux`}>
|
|
78
|
+
{ actions }
|
|
79
|
+
</div>
|
|
80
|
+
)}
|
|
81
|
+
</div>
|
|
82
|
+
)
|
|
83
|
+
});
|
|
@@ -154,3 +154,80 @@ path.react-flow__edge-path-glow {
|
|
|
154
154
|
transform: scale(1.75, 0.75);
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
+
|
|
158
|
+
// Custom label
|
|
159
|
+
|
|
160
|
+
.#{$eccgui}-graphviz__edge-label {
|
|
161
|
+
border: 0.5*$reactflow-node-border-width solid $reactflow-node-border-color;
|
|
162
|
+
border-radius: $reactflow-node-border-radius;
|
|
163
|
+
background: #fff; // TODO color
|
|
164
|
+
color: $reactflow-node-color;
|
|
165
|
+
display: inline-flex;
|
|
166
|
+
align-items: center;
|
|
167
|
+
width: auto;
|
|
168
|
+
max-width: 20rem;
|
|
169
|
+
height: 0.5 * $reactflow-node-largesize;
|
|
170
|
+
font-size: $reactflow-node-font-size;
|
|
171
|
+
|
|
172
|
+
&.#{$eccgui}-intent--primary {
|
|
173
|
+
color: $eccgui-color-primary;
|
|
174
|
+
border-color: $eccgui-color-primary;
|
|
175
|
+
}
|
|
176
|
+
&.#{$eccgui}-intent--accent {
|
|
177
|
+
color: $eccgui-color-accent;
|
|
178
|
+
border-color: $eccgui-color-accent;
|
|
179
|
+
}
|
|
180
|
+
&.#{$eccgui}-intent--success {
|
|
181
|
+
color: $eccgui-color-success-text;
|
|
182
|
+
border-color: $eccgui-color-success-text;
|
|
183
|
+
}
|
|
184
|
+
&.#{$eccgui}-intent--info {
|
|
185
|
+
color: $eccgui-color-info-text;
|
|
186
|
+
border-color: $eccgui-color-info-text;
|
|
187
|
+
}
|
|
188
|
+
&.#{$eccgui}-intent--warning {
|
|
189
|
+
color: $eccgui-color-warning-text;
|
|
190
|
+
border-color: $eccgui-color-warning-text;
|
|
191
|
+
}
|
|
192
|
+
&.#{$eccgui}-intent--danger {
|
|
193
|
+
color: $eccgui-color-danger-text;
|
|
194
|
+
border-color: $eccgui-color-danger-text;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
.#{$eccgui}-graphviz__edge-label--large {
|
|
198
|
+
height: $reactflow-node-largesize;
|
|
199
|
+
}
|
|
200
|
+
.#{$eccgui}-graphviz__edge-label--fullwidth {
|
|
201
|
+
max-width: none;
|
|
202
|
+
width: 100%;
|
|
203
|
+
}
|
|
204
|
+
.#{$eccgui}-graphviz__edge-label__depiction {
|
|
205
|
+
margin: $eccgui-size-block-whitespace * 0.25;
|
|
206
|
+
flex-grow: 0;
|
|
207
|
+
flex-shrink: 0;
|
|
208
|
+
.#{$eccgui}-depiction__image {
|
|
209
|
+
height: calc(#{0.5 * $reactflow-node-largesize} - #{$eccgui-size-block-whitespace * 0.25});
|
|
210
|
+
|
|
211
|
+
.#{$eccgui}-graphviz__edge-label--large & {
|
|
212
|
+
height: calc(#{$reactflow-node-largesize} - #{$eccgui-size-block-whitespace * 0.25});
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
.#{$eccgui}-graphviz__edge-label__text {
|
|
217
|
+
margin: $eccgui-size-block-whitespace * 0.25;
|
|
218
|
+
flex-grow: 1;
|
|
219
|
+
flex-shrink: 1;
|
|
220
|
+
white-space: nowrap;
|
|
221
|
+
overflow: hidden;
|
|
222
|
+
text-overflow: ellipsis;
|
|
223
|
+
text-align: center;
|
|
224
|
+
|
|
225
|
+
.#{$eccgui}-graphviz__edge-label--fullwidth & {
|
|
226
|
+
text-align: left;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
.#{$eccgui}-graphviz__edge-label__aux {
|
|
230
|
+
margin: $eccgui-size-block-whitespace * 0.25;
|
|
231
|
+
flex-grow: 0;
|
|
232
|
+
flex-shrink: 0;
|
|
233
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
+
import { loremIpsum } from 'react-lorem-ipsum';
|
|
4
|
+
import { EdgeLabel, IconButton, Badge } from "./../../../../../index";
|
|
5
|
+
import canonicalIcons from "./../../../../components/Icon/canonicalIconNames";
|
|
6
|
+
import { helpersArgTypes } from "../../../../../.storybook/helpers";
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: "Extensions/React Flow/Custom EdgeLabel",
|
|
10
|
+
component: EdgeLabel,
|
|
11
|
+
argTypes: {
|
|
12
|
+
depiction: {
|
|
13
|
+
control: "select",
|
|
14
|
+
options: [...(Object.keys(canonicalIcons))],
|
|
15
|
+
},
|
|
16
|
+
actions: {
|
|
17
|
+
control: "select",
|
|
18
|
+
options: ["Not set", "Icon button", "Icon button small", "Info badge"],
|
|
19
|
+
mapping: {
|
|
20
|
+
"Not set": undefined,
|
|
21
|
+
"Icon button": <IconButton name="item-info" text="Icon button" onClick={()=>alert("Click info")} />,
|
|
22
|
+
"Icon button small": <IconButton small name="item-info" text="Icon button" onClick={()=>alert("Click info")} />,
|
|
23
|
+
"Info badge": <Badge intent="info">Info</Badge>,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
intent: {
|
|
27
|
+
...helpersArgTypes.exampleIntent,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
} as ComponentMeta<typeof EdgeLabel>;
|
|
31
|
+
|
|
32
|
+
const Template: ComponentStory<typeof EdgeLabel> = (args) => (
|
|
33
|
+
<EdgeLabel {...args} />
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
export const Default = Template.bind({});
|
|
37
|
+
Default.args = {
|
|
38
|
+
text: loremIpsum({ p: 1, avgSentencesPerParagraph: 1, avgWordsPerSentence: 8, random: false }).toString(),
|
|
39
|
+
};
|
|
@@ -1,29 +1,57 @@
|
|
|
1
1
|
import React, {memo} from 'react';
|
|
2
2
|
import {
|
|
3
|
-
HandleProps as
|
|
4
|
-
Handle,
|
|
3
|
+
HandleProps as ReactFlowHandleLegacyProps,
|
|
4
|
+
Handle as HandleLegacy,
|
|
5
5
|
} from "react-flow-renderer";
|
|
6
|
+
import {
|
|
7
|
+
HandleProps as ReactFlowHandleNextProps,
|
|
8
|
+
Handle as HandleNext,
|
|
9
|
+
} from "react-flow-renderer-lts";
|
|
6
10
|
import { HandleContent, HandleContentProps } from "./HandleContent";
|
|
11
|
+
import { ReacFlowVersionSupportProps, useReactFlowVersion } from "../versionsupport";
|
|
7
12
|
|
|
8
|
-
|
|
13
|
+
interface HandleExtensionProps extends ReacFlowVersionSupportProps {
|
|
9
14
|
data?: HandleContentProps;
|
|
10
15
|
tooltip?: string;
|
|
11
16
|
children?: JSX.Element | string;
|
|
17
|
+
onClick?: () => void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface HandleProps extends HandleExtensionProps, ReactFlowHandleLegacyProps {
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface HandleNextProps extends HandleExtensionProps, ReactFlowHandleNextProps {
|
|
12
24
|
}
|
|
13
25
|
|
|
14
26
|
export const HandleDefault = memo(({
|
|
27
|
+
flowVersion = useReactFlowVersion(),
|
|
15
28
|
data,
|
|
16
29
|
tooltip,
|
|
17
30
|
children,
|
|
18
31
|
...handleProps
|
|
19
|
-
}: HandleProps) => {
|
|
32
|
+
}: HandleProps | HandleNextProps) => {
|
|
20
33
|
const tooltipTitle = !!tooltip ? { title: tooltip } : {};
|
|
21
34
|
|
|
22
|
-
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
</HandleContent>
|
|
27
|
-
</Handle>
|
|
35
|
+
const handleContent = (
|
|
36
|
+
<HandleContent {...data}>
|
|
37
|
+
{ children }
|
|
38
|
+
</HandleContent>
|
|
28
39
|
);
|
|
40
|
+
|
|
41
|
+
switch (flowVersion) {
|
|
42
|
+
case "legacy":
|
|
43
|
+
return (
|
|
44
|
+
<HandleLegacy {...handleProps} {...tooltipTitle}>
|
|
45
|
+
{ handleContent }
|
|
46
|
+
</HandleLegacy>
|
|
47
|
+
);
|
|
48
|
+
case "next":
|
|
49
|
+
return (
|
|
50
|
+
<HandleNext {...handleProps} {...tooltipTitle}>
|
|
51
|
+
{ handleContent }
|
|
52
|
+
</HandleNext>
|
|
53
|
+
);
|
|
54
|
+
default:
|
|
55
|
+
return <></>;
|
|
56
|
+
}
|
|
29
57
|
});
|
|
@@ -7,6 +7,7 @@ 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 * from "./edges/EdgeLabel";
|
|
10
11
|
export { MarkerArrowClosedInverse } from "./markers/MarkerArrowClosedInverse";
|
|
11
12
|
export { ReactFlowMarkers } from "./markers/ReactFlowMarkers";
|
|
12
13
|
export { MiniMap } from "./minimap/MiniMap";
|