@eccenca/gui-elements 24.0.0 → 24.1.0-featureimprovepublishingprocesscmem6356.0
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 +95 -0
- package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js +7 -2
- package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
- package/dist/cjs/cmem/react-flow/StickyNoteModal/StickyNoteModal.js +3 -3
- package/dist/cjs/cmem/react-flow/StickyNoteModal/StickyNoteModal.js.map +1 -1
- package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js +13 -3
- package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
- package/dist/cjs/components/AutoSuggestion/ExtendedCodeEditor.js +3 -3
- package/dist/cjs/components/AutoSuggestion/ExtendedCodeEditor.js.map +1 -1
- package/dist/cjs/components/AutocompleteField/AutoCompleteField.js +4 -2
- package/dist/cjs/components/AutocompleteField/AutoCompleteField.js.map +1 -1
- package/dist/cjs/components/Card/CardActions.js +2 -1
- package/dist/cjs/components/Card/CardActions.js.map +1 -1
- package/dist/cjs/components/Card/CardContent.js +4 -6
- package/dist/cjs/components/Card/CardContent.js.map +1 -1
- package/dist/cjs/components/ContentGroup/ContentGroup.js +95 -0
- package/dist/cjs/components/ContentGroup/ContentGroup.js.map +1 -0
- package/dist/cjs/components/Dialog/SimpleDialog.js +3 -3
- package/dist/cjs/components/Dialog/SimpleDialog.js.map +1 -1
- package/dist/cjs/components/Icon/canonicalIconNames.js +12 -0
- package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/cjs/components/Label/Label.js +8 -3
- package/dist/cjs/components/Label/Label.js.map +1 -1
- package/dist/cjs/components/Menu/MenuItem.js +3 -2
- package/dist/cjs/components/Menu/MenuItem.js.map +1 -1
- package/dist/cjs/components/MultiSelect/MultiSelect.js +1 -0
- package/dist/cjs/components/MultiSelect/MultiSelect.js.map +1 -1
- package/dist/cjs/components/OverviewItem/OverviewItem.js +5 -2
- package/dist/cjs/components/OverviewItem/OverviewItem.js.map +1 -1
- package/dist/cjs/components/OverviewItem/OverviewItemList.js +2 -2
- package/dist/cjs/components/OverviewItem/OverviewItemList.js.map +1 -1
- package/dist/cjs/components/Switch/Switch.js +6 -4
- package/dist/cjs/components/Switch/Switch.js.map +1 -1
- package/dist/cjs/components/Tag/TagList.js +1 -1
- package/dist/cjs/components/Tag/TagList.js.map +1 -1
- package/dist/cjs/components/TextField/SearchField.js +19 -2
- package/dist/cjs/components/TextField/SearchField.js.map +1 -1
- package/dist/cjs/components/Typography/OverflowText.js +1 -1
- package/dist/cjs/components/Typography/OverflowText.js.map +1 -1
- package/dist/cjs/components/index.js +1 -0
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/extensions/codemirror/CodeMirror.js +93 -11
- package/dist/cjs/extensions/codemirror/CodeMirror.js.map +1 -1
- package/dist/cjs/extensions/codemirror/debouncedLinter.js +18 -0
- package/dist/cjs/extensions/codemirror/debouncedLinter.js.map +1 -0
- package/dist/cjs/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.js +23 -14
- package/dist/cjs/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.js.map +1 -1
- package/dist/cjs/extensions/codemirror/linters/jsLinter.js +36 -0
- package/dist/cjs/extensions/codemirror/linters/jsLinter.js.map +1 -0
- package/dist/cjs/extensions/codemirror/linters/turtleLinter.js +81 -0
- package/dist/cjs/extensions/codemirror/linters/turtleLinter.js.map +1 -0
- package/dist/cjs/extensions/codemirror/tests/codemirrorTestHelper.js +4 -1
- package/dist/cjs/extensions/codemirror/tests/codemirrorTestHelper.js.map +1 -1
- package/dist/cjs/extensions/codemirror/toolbars/commands/markdown.command.js +278 -0
- package/dist/cjs/extensions/codemirror/toolbars/commands/markdown.command.js.map +1 -0
- package/dist/cjs/extensions/codemirror/toolbars/markdown.toolbar.js +47 -0
- package/dist/cjs/extensions/codemirror/toolbars/markdown.toolbar.js.map +1 -0
- package/dist/cjs/extensions/codemirror/types.js +3 -0
- package/dist/cjs/extensions/codemirror/types.js.map +1 -0
- package/dist/cjs/extensions/react-flow/nodes/NodeContent.js +140 -41
- package/dist/cjs/extensions/react-flow/nodes/NodeContent.js.map +1 -1
- package/dist/cjs/extensions/react-flow/nodes/nodeUtils.js +5 -6
- package/dist/cjs/extensions/react-flow/nodes/nodeUtils.js.map +1 -1
- package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js +7 -2
- package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
- package/dist/esm/cmem/react-flow/StickyNoteModal/StickyNoteModal.js +4 -4
- package/dist/esm/cmem/react-flow/StickyNoteModal/StickyNoteModal.js.map +1 -1
- package/dist/esm/components/AutoSuggestion/AutoSuggestion.js +13 -3
- package/dist/esm/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
- package/dist/esm/components/AutoSuggestion/ExtendedCodeEditor.js +14 -3
- package/dist/esm/components/AutoSuggestion/ExtendedCodeEditor.js.map +1 -1
- package/dist/esm/components/AutocompleteField/AutoCompleteField.js +4 -3
- package/dist/esm/components/AutocompleteField/AutoCompleteField.js.map +1 -1
- package/dist/esm/components/Card/CardActions.js +2 -1
- package/dist/esm/components/Card/CardActions.js.map +1 -1
- package/dist/esm/components/Card/CardContent.js +4 -5
- package/dist/esm/components/Card/CardContent.js.map +1 -1
- package/dist/esm/components/ContentGroup/ContentGroup.js +100 -0
- package/dist/esm/components/ContentGroup/ContentGroup.js.map +1 -0
- package/dist/esm/components/Dialog/SimpleDialog.js +4 -4
- package/dist/esm/components/Dialog/SimpleDialog.js.map +1 -1
- package/dist/esm/components/Icon/canonicalIconNames.js +12 -0
- package/dist/esm/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/esm/components/Label/Label.js +8 -3
- package/dist/esm/components/Label/Label.js.map +1 -1
- package/dist/esm/components/Menu/MenuItem.js +3 -2
- package/dist/esm/components/Menu/MenuItem.js.map +1 -1
- package/dist/esm/components/MultiSelect/MultiSelect.js +1 -0
- package/dist/esm/components/MultiSelect/MultiSelect.js.map +1 -1
- package/dist/esm/components/OverviewItem/OverviewItem.js +5 -2
- package/dist/esm/components/OverviewItem/OverviewItem.js.map +1 -1
- package/dist/esm/components/OverviewItem/OverviewItemList.js +2 -2
- package/dist/esm/components/OverviewItem/OverviewItemList.js.map +1 -1
- package/dist/esm/components/Switch/Switch.js +7 -5
- package/dist/esm/components/Switch/Switch.js.map +1 -1
- package/dist/esm/components/Tag/TagList.js +1 -1
- package/dist/esm/components/Tag/TagList.js.map +1 -1
- package/dist/esm/components/TextField/SearchField.js +35 -2
- package/dist/esm/components/TextField/SearchField.js.map +1 -1
- package/dist/esm/components/Typography/OverflowText.js +1 -1
- package/dist/esm/components/Typography/OverflowText.js.map +1 -1
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/extensions/codemirror/CodeMirror.js +94 -13
- package/dist/esm/extensions/codemirror/CodeMirror.js.map +1 -1
- package/dist/esm/extensions/codemirror/debouncedLinter.js +15 -0
- package/dist/esm/extensions/codemirror/debouncedLinter.js.map +1 -0
- package/dist/esm/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.js +20 -11
- package/dist/esm/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.js.map +1 -1
- package/dist/esm/extensions/codemirror/linters/jsLinter.js +32 -0
- package/dist/esm/extensions/codemirror/linters/jsLinter.js.map +1 -0
- package/dist/esm/extensions/codemirror/linters/turtleLinter.js +77 -0
- package/dist/esm/extensions/codemirror/linters/turtleLinter.js.map +1 -0
- package/dist/esm/extensions/codemirror/tests/codemirrorTestHelper.js +4 -0
- package/dist/esm/extensions/codemirror/tests/codemirrorTestHelper.js.map +1 -1
- package/dist/esm/extensions/codemirror/toolbars/commands/markdown.command.js +283 -0
- package/dist/esm/extensions/codemirror/toolbars/commands/markdown.command.js.map +1 -0
- package/dist/esm/extensions/codemirror/toolbars/markdown.toolbar.js +41 -0
- package/dist/esm/extensions/codemirror/toolbars/markdown.toolbar.js.map +1 -0
- package/dist/esm/extensions/codemirror/types.js +2 -0
- package/dist/esm/extensions/codemirror/types.js.map +1 -0
- package/dist/esm/extensions/react-flow/nodes/NodeContent.js +149 -48
- package/dist/esm/extensions/react-flow/nodes/NodeContent.js.map +1 -1
- package/dist/esm/extensions/react-flow/nodes/nodeUtils.js +5 -6
- package/dist/esm/extensions/react-flow/nodes/nodeUtils.js.map +1 -1
- package/dist/types/cmem/ActivityControl/ActivityControlWidget.d.ts +1 -1
- package/dist/types/cmem/react-flow/StickyNoteModal/StickyNoteModal.d.ts +5 -1
- package/dist/types/components/AutoSuggestion/ExtendedCodeEditor.d.ts +11 -6
- package/dist/types/components/Card/CardActions.d.ts +5 -1
- package/dist/types/components/Card/CardContent.d.ts +1 -2
- package/dist/types/components/ContentGroup/ContentGroup.d.ts +78 -0
- package/dist/types/components/Dialog/SimpleDialog.d.ts +4 -1
- package/dist/types/components/Icon/canonicalIconNames.d.ts +12 -0
- package/dist/types/components/Label/Label.d.ts +7 -1
- package/dist/types/components/Menu/MenuItem.d.ts +8 -1
- package/dist/types/components/OverviewItem/OverviewItem.d.ts +13 -1
- package/dist/types/components/OverviewItem/OverviewItemList.d.ts +3 -2
- package/dist/types/components/ProgressBar/ProgressBar.d.ts +2 -2
- package/dist/types/components/Structure/TitleSubsection.d.ts +9 -1
- package/dist/types/components/Switch/Switch.d.ts +3 -3
- package/dist/types/components/Tabs/Tab.d.ts +20 -4
- package/dist/types/components/TextField/SearchField.d.ts +1 -1
- package/dist/types/components/Typography/OverflowText.d.ts +23 -2
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/extensions/codemirror/CodeMirror.d.ts +32 -5
- package/dist/types/extensions/codemirror/debouncedLinter.d.ts +4 -0
- package/dist/types/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.d.ts +7 -5
- package/dist/types/extensions/codemirror/linters/jsLinter.d.ts +5 -0
- package/dist/types/extensions/codemirror/linters/turtleLinter.d.ts +5 -0
- package/dist/types/extensions/codemirror/tests/codemirrorTestHelper.d.ts +1 -0
- package/dist/types/extensions/codemirror/toolbars/commands/markdown.command.d.ts +55 -0
- package/dist/types/extensions/codemirror/toolbars/markdown.toolbar.d.ts +12 -0
- package/dist/types/extensions/codemirror/types.d.ts +5 -0
- package/dist/types/extensions/react-flow/nodes/NodeContent.d.ts +18 -4
- package/dist/types/extensions/react-flow/nodes/nodeUtils.d.ts +7 -6
- package/dist/types/extensions/react-flow/versionsupport.d.ts +1 -1
- package/package.json +59 -47
- package/src/cmem/ActivityControl/ActivityControlWidget.tsx +5 -2
- package/src/cmem/react-flow/StickyNoteModal/StickyNoteModal.tsx +16 -2
- package/src/cmem/react-flow/configuration/_colors-graph.scss +4 -1
- package/src/cmem/react-flow/configuration/_colors-workflow.scss +3 -0
- package/src/components/AutoSuggestion/AutoSuggestion.tsx +14 -3
- package/src/components/AutoSuggestion/ExtendedCodeEditor.tsx +29 -6
- package/src/components/AutocompleteField/AutoCompleteField.tsx +5 -3
- package/src/components/Card/CardActions.tsx +6 -0
- package/src/components/Card/CardContent.tsx +8 -4
- package/src/components/Card/card.scss +15 -0
- package/src/components/CodeAutocompleteField/CodeAutocompleteField.stories.tsx +3 -2
- package/src/components/ContentGroup/ContentGroup.stories.tsx +47 -0
- package/src/components/ContentGroup/ContentGroup.tsx +256 -0
- package/src/components/ContentGroup/_contentgroup.scss +56 -0
- package/src/components/ContextOverlay/ContextOverlay.stories.tsx +15 -4
- package/src/components/Depiction/depiction.scss +7 -0
- package/src/components/Dialog/SimpleDialog.tsx +9 -2
- package/src/components/Dialog/stories/AlertDialog.stories.tsx +5 -1
- package/src/components/Dialog/stories/Modal.stories.tsx +4 -2
- package/src/components/Dialog/stories/SimpleDialog.stories.tsx +5 -2
- package/src/components/Icon/canonicalIconNames.tsx +12 -0
- package/src/components/Label/Label.stories.tsx +2 -1
- package/src/components/Label/Label.tsx +17 -1
- package/src/components/Label/label.scss +5 -1
- package/src/components/Menu/MenuItem.tsx +27 -1
- package/src/components/Menu/menu.scss +1 -0
- package/src/components/MultiSelect/MultiSelect.tsx +1 -0
- package/src/components/OverviewItem/OverviewItem.tsx +24 -1
- package/src/components/OverviewItem/OverviewItemList.tsx +3 -2
- package/src/components/OverviewItem/overviewitem.scss +4 -1
- package/src/components/OverviewItem/stories/OverviewItem.stories.tsx +6 -12
- package/src/components/Select/Select.stories.tsx +4 -1
- package/src/components/Switch/Switch.tsx +27 -8
- package/src/components/Tag/TagList.tsx +2 -2
- package/src/components/TextField/SearchField.tsx +37 -9
- package/src/components/TextField/stories/SearchField.stories.tsx +15 -1
- package/src/components/TextField/stories/TextField.stories.tsx +2 -1
- package/src/components/TextField/textfield.scss +17 -3
- package/src/components/Typography/OverflowText.tsx +24 -3
- package/src/components/Typography/stories/OverflowText.stories.tsx +33 -0
- package/src/components/index.scss +1 -0
- package/src/components/index.ts +1 -0
- package/src/extensions/codemirror/CodeMirror.stories.tsx +19 -1
- package/src/extensions/codemirror/CodeMirror.tsx +154 -16
- package/src/extensions/codemirror/_codemirror.scss +130 -1
- package/src/extensions/codemirror/debouncedLinter.ts +26 -0
- package/src/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.ts +21 -12
- package/src/extensions/codemirror/linters/jsLinter.ts +38 -0
- package/src/extensions/codemirror/linters/turtleLinter.ts +102 -0
- package/src/extensions/codemirror/tests/codemirrorTestHelper.ts +4 -0
- package/src/extensions/codemirror/toolbars/commands/markdown.command.ts +340 -0
- package/src/extensions/codemirror/toolbars/markdown.toolbar.tsx +117 -0
- package/src/extensions/codemirror/types.ts +7 -0
- package/src/extensions/react-flow/_config.scss +1 -0
- package/src/extensions/react-flow/nodes/NodeContent.tsx +170 -52
- package/src/extensions/react-flow/nodes/_nodes.scss +71 -35
- package/src/extensions/react-flow/nodes/nodeUtils.tsx +16 -14
- package/src/extensions/react-flow/nodes/stories/NodeContent.stories.tsx +51 -12
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import Color from "color";
|
|
4
|
+
|
|
5
|
+
import { TestableComponent } from "../../components/interfaces";
|
|
6
|
+
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
7
|
+
import {
|
|
8
|
+
Divider,
|
|
9
|
+
Icon,
|
|
10
|
+
IconButton,
|
|
11
|
+
OverflowText,
|
|
12
|
+
Section,
|
|
13
|
+
SectionHeader,
|
|
14
|
+
Spacing,
|
|
15
|
+
StickyTarget,
|
|
16
|
+
StickyTargetProps,
|
|
17
|
+
Toolbar,
|
|
18
|
+
ToolbarSection,
|
|
19
|
+
Tooltip,
|
|
20
|
+
} from "../index";
|
|
21
|
+
|
|
22
|
+
export interface ContentGroupProps extends Omit<React.HTMLAttributes<HTMLElement>, "title">, TestableComponent {
|
|
23
|
+
/**
|
|
24
|
+
* Title of the content group.
|
|
25
|
+
*/
|
|
26
|
+
title?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Level of the content group.
|
|
29
|
+
*/
|
|
30
|
+
level?: number;
|
|
31
|
+
/**
|
|
32
|
+
* Context information to display in the header.
|
|
33
|
+
*/
|
|
34
|
+
contextInfo?: React.ReactElement | React.ReactElement[];
|
|
35
|
+
/**
|
|
36
|
+
* Annotation to display in the content.
|
|
37
|
+
*/
|
|
38
|
+
annotation?: React.ReactElement | React.ReactElement[];
|
|
39
|
+
/**
|
|
40
|
+
* Action options to display in the header.
|
|
41
|
+
*/
|
|
42
|
+
actionOptions?: React.ReactElement | React.ReactElement[];
|
|
43
|
+
/**
|
|
44
|
+
* Flag to collapse the content group.
|
|
45
|
+
*/
|
|
46
|
+
isCollapsed?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Text to display when the callapse button is hovered.
|
|
49
|
+
* If not set then it uses "Show more" or "Show less".
|
|
50
|
+
*/
|
|
51
|
+
textToggleCollapse?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Event handler to toggle the collapse state.
|
|
54
|
+
*/
|
|
55
|
+
handlerToggleCollapse?: () => void;
|
|
56
|
+
/**
|
|
57
|
+
* Use a border on the left side to visually connect the whole content content group.
|
|
58
|
+
*/
|
|
59
|
+
borderMainConnection?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Use a border on the left side to visually emphase the content group.
|
|
62
|
+
* If it is set to an array of color codes then the border is multi colored.
|
|
63
|
+
*/
|
|
64
|
+
borderSubConnection?: boolean | string[];
|
|
65
|
+
/**
|
|
66
|
+
* Whitespace size between header and the content.
|
|
67
|
+
*/
|
|
68
|
+
whitespaceSize?: "tiny" | "small" | "medium" | "large" | "xlarge";
|
|
69
|
+
/**
|
|
70
|
+
* Title minimum headline level.
|
|
71
|
+
*/
|
|
72
|
+
minimumHeadlineLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
73
|
+
/**
|
|
74
|
+
* Props to pass to `StickyTarget`.
|
|
75
|
+
*/
|
|
76
|
+
stickyHeaderProps?: Omit<StickyTargetProps, "children">;
|
|
77
|
+
/**
|
|
78
|
+
* Description of the content group.
|
|
79
|
+
* Added as tooltip to an info icon placed in the content group header.
|
|
80
|
+
*/
|
|
81
|
+
description?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Flag to hide the group divider.
|
|
84
|
+
*/
|
|
85
|
+
hideGroupDivider?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Additional props to pass to the content container.
|
|
88
|
+
*/
|
|
89
|
+
contentProps?: Omit<React.HTMLAttributes<HTMLDivElement>, "children">;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Manage display of a grouped content section.
|
|
94
|
+
* Add info, actions and context annotations by using its properties.
|
|
95
|
+
* Can be nested into each other.
|
|
96
|
+
*/
|
|
97
|
+
export const ContentGroup = ({
|
|
98
|
+
children,
|
|
99
|
+
className = "",
|
|
100
|
+
title,
|
|
101
|
+
contextInfo,
|
|
102
|
+
annotation,
|
|
103
|
+
actionOptions,
|
|
104
|
+
isCollapsed = false,
|
|
105
|
+
textToggleCollapse,
|
|
106
|
+
handlerToggleCollapse,
|
|
107
|
+
borderMainConnection = false,
|
|
108
|
+
borderSubConnection = false,
|
|
109
|
+
level = 1,
|
|
110
|
+
minimumHeadlineLevel = 3,
|
|
111
|
+
whitespaceSize = "small",
|
|
112
|
+
style,
|
|
113
|
+
stickyHeaderProps,
|
|
114
|
+
description,
|
|
115
|
+
hideGroupDivider,
|
|
116
|
+
contentProps,
|
|
117
|
+
...otherContentWrapperProps
|
|
118
|
+
}: ContentGroupProps) => {
|
|
119
|
+
const displayHeader = title || handlerToggleCollapse;
|
|
120
|
+
|
|
121
|
+
let borderGradient: string[] | undefined = undefined;
|
|
122
|
+
if (typeof borderSubConnection === "object") {
|
|
123
|
+
const borderColors: string[] = Array.isArray(borderSubConnection) ? borderSubConnection : [borderSubConnection];
|
|
124
|
+
borderGradient = borderColors.reduce((acc: string[], borderColor: string, index: number): string[] => {
|
|
125
|
+
try {
|
|
126
|
+
const color = Color(borderColor);
|
|
127
|
+
|
|
128
|
+
acc.push(
|
|
129
|
+
`${color.rgb().toString()} ` +
|
|
130
|
+
`${(index / borderColors.length) * 100}% ` +
|
|
131
|
+
`${((index + 1) / borderColors.length) * 100}%`
|
|
132
|
+
);
|
|
133
|
+
} catch {
|
|
134
|
+
// eslint-disable-next-line no-console
|
|
135
|
+
console.warn("Received invalid background color for tag: " + borderColor);
|
|
136
|
+
}
|
|
137
|
+
return acc;
|
|
138
|
+
}, []);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const contextInfoElements = Array.isArray(contextInfo) ? contextInfo : [contextInfo];
|
|
142
|
+
const { className: contentClassName, ...otherContentProps } = contentProps ?? {};
|
|
143
|
+
|
|
144
|
+
const headerContent = displayHeader ? (
|
|
145
|
+
<>
|
|
146
|
+
<SectionHeader className={`${eccgui}-contentgroup__header`}>
|
|
147
|
+
<Toolbar>
|
|
148
|
+
{handlerToggleCollapse && (
|
|
149
|
+
<ToolbarSection>
|
|
150
|
+
<IconButton
|
|
151
|
+
className={`${eccgui}-contentgroup__header__toggler`}
|
|
152
|
+
name={isCollapsed ? "toggler-showmore" : "toggler-showless"}
|
|
153
|
+
text={textToggleCollapse ?? (isCollapsed ? "Show more" : "Show less")}
|
|
154
|
+
onClick={handlerToggleCollapse}
|
|
155
|
+
/>
|
|
156
|
+
<Spacing vertical size="small" />
|
|
157
|
+
</ToolbarSection>
|
|
158
|
+
)}
|
|
159
|
+
{title && (
|
|
160
|
+
<ToolbarSection canShrink>
|
|
161
|
+
{React.createElement(
|
|
162
|
+
"h" +
|
|
163
|
+
Math.min(
|
|
164
|
+
Math.max(minimumHeadlineLevel, level + minimumHeadlineLevel),
|
|
165
|
+
6
|
|
166
|
+
).toString(),
|
|
167
|
+
{
|
|
168
|
+
children: <OverflowText>{title}</OverflowText>,
|
|
169
|
+
className: `${eccgui}-contentgroup__header__title`,
|
|
170
|
+
}
|
|
171
|
+
)}
|
|
172
|
+
{description && (
|
|
173
|
+
<>
|
|
174
|
+
<Spacing vertical size="tiny" />
|
|
175
|
+
<Tooltip content={description}>
|
|
176
|
+
<Icon name="item-info" small className="dmapp--text-info" />
|
|
177
|
+
</Tooltip>
|
|
178
|
+
</>
|
|
179
|
+
)}
|
|
180
|
+
</ToolbarSection>
|
|
181
|
+
)}
|
|
182
|
+
{contextInfoElements &&
|
|
183
|
+
contextInfoElements[0]?.props &&
|
|
184
|
+
Object.values(contextInfoElements[0].props).every((v) => v !== undefined) && (
|
|
185
|
+
<ToolbarSection className={`${eccgui}-contentgroup__header__context`} canGrow>
|
|
186
|
+
<div className={`${eccgui}-contentgroup__content `}>
|
|
187
|
+
<Spacing vertical size="tiny" />
|
|
188
|
+
{contextInfoElements}
|
|
189
|
+
</div>
|
|
190
|
+
</ToolbarSection>
|
|
191
|
+
)}
|
|
192
|
+
{!isCollapsed && handlerToggleCollapse && actionOptions && (
|
|
193
|
+
<ToolbarSection className={`${eccgui}-contentgroup__header__options`}>
|
|
194
|
+
<Spacing vertical size="small" />
|
|
195
|
+
{actionOptions}
|
|
196
|
+
</ToolbarSection>
|
|
197
|
+
)}
|
|
198
|
+
</Toolbar>
|
|
199
|
+
</SectionHeader>
|
|
200
|
+
{(!isCollapsed || !handlerToggleCollapse) && (
|
|
201
|
+
<>
|
|
202
|
+
{!hideGroupDivider && <Divider addSpacing="small" />}
|
|
203
|
+
<Spacing size={whitespaceSize} />
|
|
204
|
+
</>
|
|
205
|
+
)}
|
|
206
|
+
</>
|
|
207
|
+
) : (
|
|
208
|
+
<></>
|
|
209
|
+
);
|
|
210
|
+
|
|
211
|
+
return (
|
|
212
|
+
<Section
|
|
213
|
+
className={
|
|
214
|
+
`${eccgui}-contentgroup` +
|
|
215
|
+
(className ? ` ${className}` : "") +
|
|
216
|
+
(whitespaceSize ? ` ${eccgui}-contentgroup--padding-${whitespaceSize}` : "") +
|
|
217
|
+
(borderMainConnection ? ` ${eccgui}-contentgroup--border-main` : "") +
|
|
218
|
+
(borderSubConnection ? ` ${eccgui}-contentgroup--border-sub` : "")
|
|
219
|
+
}
|
|
220
|
+
style={
|
|
221
|
+
borderGradient
|
|
222
|
+
? ({
|
|
223
|
+
...(style ?? {}),
|
|
224
|
+
[`--${eccgui}-color-contentgroup-border-sub`]: borderGradient.join(", "),
|
|
225
|
+
} as React.CSSProperties)
|
|
226
|
+
: style
|
|
227
|
+
}
|
|
228
|
+
{...otherContentWrapperProps}
|
|
229
|
+
>
|
|
230
|
+
{headerContent && stickyHeaderProps ? (
|
|
231
|
+
<StickyTarget {...stickyHeaderProps}>{headerContent}</StickyTarget>
|
|
232
|
+
) : (
|
|
233
|
+
headerContent
|
|
234
|
+
)}
|
|
235
|
+
{(!isCollapsed || !handlerToggleCollapse) && (
|
|
236
|
+
<>
|
|
237
|
+
<div className={`${eccgui}-contentgroup__content`}>
|
|
238
|
+
<div
|
|
239
|
+
className={classNames(`${eccgui}-contentgroup__content__body`, contentClassName)}
|
|
240
|
+
{...otherContentProps}
|
|
241
|
+
>
|
|
242
|
+
{children}
|
|
243
|
+
</div>
|
|
244
|
+
{contextInfo && !displayHeader && (
|
|
245
|
+
<div className={`${eccgui}-contentgroup__content__context`}>{contextInfoElements}</div>
|
|
246
|
+
)}
|
|
247
|
+
{annotation && <div>{annotation}</div>}
|
|
248
|
+
{actionOptions && !displayHeader && (
|
|
249
|
+
<div className={`${eccgui}-contentgroup__content__options`}>{actionOptions}</div>
|
|
250
|
+
)}
|
|
251
|
+
</div>
|
|
252
|
+
</>
|
|
253
|
+
)}
|
|
254
|
+
</Section>
|
|
255
|
+
);
|
|
256
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
$eccgui-color-scontentgroup-border-main: rgba($eccgui-color-workspace-text, $eccgui-opacity-muted) !default;
|
|
2
|
+
$eccgui-color-scontentgroup-border-sub: rgba($eccgui-color-workspace-text, $eccgui-opacity-disabled) !default;
|
|
3
|
+
|
|
4
|
+
.#{$eccgui}-contentgroup {
|
|
5
|
+
--#{$eccgui}-color-contentgroup-border-main: #{$eccgui-color-scontentgroup-border-main};
|
|
6
|
+
--#{$eccgui}-color-contentgroup-border-sub: #{$eccgui-color-scontentgroup-border-sub};
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.#{$eccgui}-contentgroup--border-main {
|
|
10
|
+
border-left: 0.25 * $eccgui-size-block-whitespace solid
|
|
11
|
+
var(--#{$eccgui}-color-contentgroup-border-main, #{$eccgui-color-scontentgroup-border-main});
|
|
12
|
+
|
|
13
|
+
&.#{$eccgui}-contentgroup--padding-small {
|
|
14
|
+
padding-left: 0.5 * $eccgui-size-block-whitespace;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.#{$eccgui}-contentgroup--border-sub {
|
|
19
|
+
position: relative;
|
|
20
|
+
border-right: 0.25 * $eccgui-size-block-whitespace solid transparent;
|
|
21
|
+
|
|
22
|
+
&::after {
|
|
23
|
+
position: absolute;
|
|
24
|
+
top: 0;
|
|
25
|
+
bottom: 0;
|
|
26
|
+
left: 100%;
|
|
27
|
+
width: 0.25 * $eccgui-size-block-whitespace;
|
|
28
|
+
content: " ";
|
|
29
|
+
background-color: var(--#{$eccgui}-color-contentgroup-border-sub, #{$eccgui-color-scontentgroup-border-sub});
|
|
30
|
+
background-image: linear-gradient(to bottom, var(--#{$eccgui}-color-contentgroup-border-sub));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&.#{$eccgui}-contentgroup--padding-small {
|
|
34
|
+
padding-right: 0.5 * $eccgui-size-block-whitespace;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.#{$eccgui}-contentgroup--padding-small {
|
|
39
|
+
+ .#{$eccgui}-contentgroup {
|
|
40
|
+
margin-top: 0.5 * $eccgui-size-block-whitespace;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
> .#{$eccgui}-contentgroup__content {
|
|
44
|
+
column-gap: 0.5 * $eccgui-size-block-whitespace;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.#{$eccgui}-contentgroup__content {
|
|
49
|
+
display: flex;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.#{$eccgui}-contentgroup__content__body {
|
|
53
|
+
flex-grow: 1;
|
|
54
|
+
flex-shrink: 1;
|
|
55
|
+
width: 100%;
|
|
56
|
+
}
|
|
@@ -4,31 +4,40 @@ import { PopoverInteractionKind, PopperModifierOverrides } from "@blueprintjs/co
|
|
|
4
4
|
import { PopperPlacements } from "@blueprintjs/core";
|
|
5
5
|
import { OverlaysProvider } from "@blueprintjs/core";
|
|
6
6
|
import { Meta, StoryFn } from "@storybook/react";
|
|
7
|
+
import { fn } from "@storybook/test";
|
|
7
8
|
|
|
8
9
|
import { Button, ContextOverlay, HtmlContentBlock } from "../../index";
|
|
9
10
|
|
|
11
|
+
const interactionKindOptions = { UNDEFINED: undefined, ...PopoverInteractionKind };
|
|
12
|
+
const rootBoundaryOptions = { UNDEFINED: undefined, VIEWPORT: "viewport", DOCUMENT: "document" };
|
|
13
|
+
const positioningStrategyOptions = { UNDEFINED: undefined, ABSOLUTE: "absolute", FIXED: "fixed" };
|
|
14
|
+
|
|
10
15
|
export default {
|
|
11
16
|
title: "Components/ContextOverlay",
|
|
12
17
|
component: ContextOverlay,
|
|
13
18
|
argTypes: {
|
|
14
19
|
interactionKind: {
|
|
15
|
-
options:
|
|
20
|
+
options: Object.keys(interactionKindOptions),
|
|
21
|
+
mapping: interactionKindOptions,
|
|
16
22
|
},
|
|
17
23
|
placement: {
|
|
18
24
|
options: PopperPlacements,
|
|
19
25
|
},
|
|
20
26
|
rootBoundary: {
|
|
21
|
-
options:
|
|
27
|
+
options: Object.keys(rootBoundaryOptions),
|
|
28
|
+
mapping: rootBoundaryOptions,
|
|
22
29
|
},
|
|
23
30
|
positioningStrategy: {
|
|
24
|
-
options:
|
|
31
|
+
options: Object.keys(positioningStrategyOptions),
|
|
32
|
+
mapping: positioningStrategyOptions,
|
|
25
33
|
},
|
|
26
34
|
},
|
|
27
35
|
} as Meta<typeof ContextOverlay>;
|
|
28
36
|
|
|
37
|
+
let forcedUpdateKey = 0;
|
|
29
38
|
const Template: StoryFn<typeof ContextOverlay> = (args) => (
|
|
30
39
|
<OverlaysProvider>
|
|
31
|
-
<ContextOverlay {...args} />
|
|
40
|
+
<ContextOverlay {...args} key={++forcedUpdateKey} />
|
|
32
41
|
</OverlaysProvider>
|
|
33
42
|
);
|
|
34
43
|
|
|
@@ -55,4 +64,6 @@ Default.args = {
|
|
|
55
64
|
} as PopperModifierOverrides,
|
|
56
65
|
rootBoundary: "viewport",
|
|
57
66
|
hasBackdrop: false,
|
|
67
|
+
onOpening: fn(),
|
|
68
|
+
onInteraction: fn(),
|
|
58
69
|
};
|
|
@@ -72,6 +72,13 @@ $eccgui-size-depiction-border-radius: $pt-border-radius !default;
|
|
|
72
72
|
.#{$eccgui}-overviewitem__list--highdensity > li > .#{$eccgui}-overviewitem__item & {
|
|
73
73
|
height: $button-height;
|
|
74
74
|
}
|
|
75
|
+
.#{$eccgui}-overviewitem__item--highdensity.#{$eccgui}-overviewitem__item--hasspacing > .#{$eccgui}-depiction &,
|
|
76
|
+
.#{$eccgui}-overviewitem__list--highdensity
|
|
77
|
+
> li
|
|
78
|
+
> .#{$eccgui}-overviewitem__item.#{$eccgui}-overviewitem__item--hasspacing
|
|
79
|
+
& {
|
|
80
|
+
height: calc(#{$button-height} - #{$eccgui-size-typo-base * 0.5});
|
|
81
|
+
}
|
|
75
82
|
}
|
|
76
83
|
|
|
77
84
|
.#{$eccgui}-depiction__image--disabled {
|
|
@@ -5,7 +5,7 @@ import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
|
5
5
|
import IconButton from "../Icon/IconButton";
|
|
6
6
|
import { TestableComponent } from "../interfaces";
|
|
7
7
|
|
|
8
|
-
import { Card, CardActions, CardContent, CardHeader, CardOptions, CardTitle } from "./../Card";
|
|
8
|
+
import { Card, CardActions, CardActionsProps, CardContent, CardHeader, CardOptions, CardTitle } from "./../Card";
|
|
9
9
|
import Divider from "./../Separation/Divider";
|
|
10
10
|
import Modal, { ModalProps } from "./Modal";
|
|
11
11
|
|
|
@@ -45,6 +45,8 @@ export interface SimpleDialogProps extends ModalProps, TestableComponent {
|
|
|
45
45
|
showFullScreenToggler?: boolean;
|
|
46
46
|
/** Starts the modal in full screen mode. The show full screen toggler will be automatically enabled. */
|
|
47
47
|
startInFullScreenMode?: boolean;
|
|
48
|
+
/** Forward properties to the actions footer component. */
|
|
49
|
+
actionsProps?: Omit<CardActionsProps, "inverseDirection">;
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
/**
|
|
@@ -66,6 +68,7 @@ export const SimpleDialog = ({
|
|
|
66
68
|
showFullScreenToggler = false,
|
|
67
69
|
startInFullScreenMode = false,
|
|
68
70
|
size,
|
|
71
|
+
actionsProps,
|
|
69
72
|
...otherProps
|
|
70
73
|
}: SimpleDialogProps) => {
|
|
71
74
|
const [displayFullscreen, setDisplayFullscreen] = React.useState<boolean>(startInFullScreenMode);
|
|
@@ -112,7 +115,11 @@ export const SimpleDialog = ({
|
|
|
112
115
|
<CardContent className={`${eccgui}-dialog__notifications`}>{notifications}</CardContent>
|
|
113
116
|
)}
|
|
114
117
|
{actions && (
|
|
115
|
-
<CardActions
|
|
118
|
+
<CardActions
|
|
119
|
+
{...actionsProps}
|
|
120
|
+
inverseDirection
|
|
121
|
+
className={`${actionsProps?.className ?? ""} ${intentClassName}`}
|
|
122
|
+
>
|
|
116
123
|
{actions}
|
|
117
124
|
</CardActions>
|
|
118
125
|
)}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { OverlaysProvider } from "@blueprintjs/core";
|
|
3
3
|
import { Meta, StoryFn } from "@storybook/react";
|
|
4
|
+
import { fn } from "@storybook/test";
|
|
4
5
|
|
|
5
6
|
import { AlertDialog } from "./../../../../index";
|
|
6
|
-
import { Default as SimpleDialogExample } from "./SimpleDialog.stories";
|
|
7
|
+
import simpleDialogStory, { Default as SimpleDialogExample } from "./SimpleDialog.stories";
|
|
7
8
|
|
|
8
9
|
export default {
|
|
9
10
|
title: "Components/Dialog/AlertDialog",
|
|
10
11
|
component: AlertDialog,
|
|
11
12
|
argTypes: {
|
|
13
|
+
...simpleDialogStory.argTypes,
|
|
12
14
|
headerOptions: { table: { disable: true } },
|
|
13
15
|
children: { table: { disable: true } },
|
|
14
16
|
actions: { table: { disable: true } },
|
|
@@ -42,4 +44,6 @@ Default.args = {
|
|
|
42
44
|
success: false,
|
|
43
45
|
warning: true,
|
|
44
46
|
danger: false,
|
|
47
|
+
onOpening: fn(),
|
|
48
|
+
onClosing: fn(),
|
|
45
49
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { OverlaysProvider } from "@blueprintjs/core";
|
|
3
3
|
import { Meta, StoryFn } from "@storybook/react";
|
|
4
|
+
import { fn } from "@storybook/test";
|
|
4
5
|
|
|
5
6
|
import { SimpleCard } from "../../Card/stories/Card.stories";
|
|
6
7
|
|
|
@@ -11,8 +12,7 @@ export default {
|
|
|
11
12
|
component: Modal,
|
|
12
13
|
argTypes: {
|
|
13
14
|
children: {
|
|
14
|
-
control:
|
|
15
|
-
description: "Elements to include into the modal container.",
|
|
15
|
+
control: false,
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
18
|
} as Meta<typeof Modal>;
|
|
@@ -30,4 +30,6 @@ Default.args = {
|
|
|
30
30
|
isOpen: true,
|
|
31
31
|
usePortal: false,
|
|
32
32
|
children: <Card {...SimpleCard.args} />,
|
|
33
|
+
onOpening: fn(),
|
|
34
|
+
onClosing: fn(),
|
|
33
35
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { OverlaysProvider } from "@blueprintjs/core";
|
|
3
3
|
import { Meta, StoryFn } from "@storybook/react";
|
|
4
|
+
import { fn } from "@storybook/test";
|
|
4
5
|
|
|
5
6
|
import { SimpleDialog } from "./../../../../index";
|
|
6
7
|
import { Default as CardActionsExample } from "./../../Card/stories/CardActions.stories";
|
|
@@ -14,10 +15,10 @@ export default {
|
|
|
14
15
|
argTypes: {
|
|
15
16
|
...storyModal.argTypes,
|
|
16
17
|
headerOptions: {
|
|
17
|
-
control:
|
|
18
|
+
control: false,
|
|
18
19
|
},
|
|
19
20
|
actions: {
|
|
20
|
-
control:
|
|
21
|
+
control: false,
|
|
21
22
|
},
|
|
22
23
|
},
|
|
23
24
|
} as Meta<typeof SimpleDialog>;
|
|
@@ -39,4 +40,6 @@ Default.args = {
|
|
|
39
40
|
hasBorder: true,
|
|
40
41
|
isOpen: true,
|
|
41
42
|
usePortal: false,
|
|
43
|
+
onOpening: fn(),
|
|
44
|
+
onClosing: fn(),
|
|
42
45
|
};
|
|
@@ -19,6 +19,9 @@ const canonicalIcons = {
|
|
|
19
19
|
"artefact-commit": icons.Commit,
|
|
20
20
|
"artefact-task-deleteprojectfiles": icons.TrashCan,
|
|
21
21
|
"artefact-task-downloadfile": icons.CloudDownload,
|
|
22
|
+
"artefact-task-pivot": icons.Transpose,
|
|
23
|
+
"artefact-task-unpivot": icons.Transpose,
|
|
24
|
+
"artefact-task-concatenatetofile": icons.DocumentExport,
|
|
22
25
|
"artefact-dataset-csv": icons.Csv,
|
|
23
26
|
"artefact-dataset-eccencadataplatform": icons.DataVis_1,
|
|
24
27
|
"artefact-dataset-excel": icons.Xls,
|
|
@@ -65,6 +68,7 @@ const canonicalIcons = {
|
|
|
65
68
|
"item-download": icons.Download,
|
|
66
69
|
"item-draggable": icons.Draggable,
|
|
67
70
|
"item-edit": icons.Edit,
|
|
71
|
+
"item-magic-edit": icons.MagicWand,
|
|
68
72
|
"item-evaluation": icons.Analytics,
|
|
69
73
|
"item-execution": icons.Run,
|
|
70
74
|
"item-info": icons.Information,
|
|
@@ -84,6 +88,7 @@ const canonicalIcons = {
|
|
|
84
88
|
"item-vertmenu": icons.OverflowMenuHorizontal,
|
|
85
89
|
"item-viewdetails": icons.View,
|
|
86
90
|
"item-hidedetails": icons.ViewOff,
|
|
91
|
+
"item-image": icons.Image,
|
|
87
92
|
|
|
88
93
|
"list-sortasc": icons.ArrowDown,
|
|
89
94
|
"list-sortdesc": icons.ArrowUp,
|
|
@@ -125,6 +130,13 @@ const canonicalIcons = {
|
|
|
125
130
|
"operation-filterremove": icons.FilterRemove,
|
|
126
131
|
"operation-filter": icons.Filter,
|
|
127
132
|
"operation-format-codeblock": icons.CodeBlock,
|
|
133
|
+
"operation-format-text-code": icons.Code,
|
|
134
|
+
"operation-format-text-bold": icons.TextBold,
|
|
135
|
+
"operation-format-text-italic": icons.TextItalic,
|
|
136
|
+
"operation-format-text-strikethrough": icons.TextStrikethrough,
|
|
137
|
+
"operation-format-list-bullet": icons.ListBulleted,
|
|
138
|
+
"operation-format-list-checked": icons.ListChecked,
|
|
139
|
+
"operation-format-list-numbered": icons.ListNumbered,
|
|
128
140
|
"operation-fix": icons.Tools,
|
|
129
141
|
"operation-link": icons.Link,
|
|
130
142
|
"operation-logout": icons.Logout,
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { loremIpsum } from "react-lorem-ipsum";
|
|
3
3
|
import { Meta, StoryFn } from "@storybook/react";
|
|
4
4
|
|
|
5
|
-
import { Label } from "../../index";
|
|
5
|
+
import { Icon, Label } from "../../index";
|
|
6
6
|
|
|
7
7
|
export default {
|
|
8
8
|
title: "Forms/Label",
|
|
@@ -19,4 +19,5 @@ Default.args = {
|
|
|
19
19
|
tooltip: loremIpsum({ p: 1, avgSentencesPerParagraph: 2, startWithLoremIpsum: false, random: false }).toString(),
|
|
20
20
|
disabled: false,
|
|
21
21
|
htmlFor: "inputid",
|
|
22
|
+
additionalElements: <Icon name={"state-warning"} tooltipText={"message"} small />,
|
|
22
23
|
};
|
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
|
|
3
3
|
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
4
4
|
import Icon from "../Icon/Icon";
|
|
5
|
+
import Spacing from "../Separation/Spacing";
|
|
5
6
|
import Tooltip, { TooltipProps } from "../Tooltip/Tooltip";
|
|
6
7
|
|
|
7
8
|
export interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
|
|
@@ -34,6 +35,12 @@ export interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement>
|
|
|
34
35
|
* visual appearance of the label
|
|
35
36
|
*/
|
|
36
37
|
emphasis?: "strong" | "normal";
|
|
38
|
+
/**
|
|
39
|
+
* Add other elements to the end of the label content
|
|
40
|
+
*/
|
|
41
|
+
additionalElements?: React.ReactNode | React.ReactNode[];
|
|
42
|
+
/** Force label to get displayed as inline block element. */
|
|
43
|
+
inline?: boolean;
|
|
37
44
|
}
|
|
38
45
|
|
|
39
46
|
export const Label = ({
|
|
@@ -46,6 +53,8 @@ export const Label = ({
|
|
|
46
53
|
tooltipProps,
|
|
47
54
|
isLayoutForElement = "label",
|
|
48
55
|
emphasis = "normal",
|
|
56
|
+
additionalElements,
|
|
57
|
+
inline,
|
|
49
58
|
...otherLabelProps
|
|
50
59
|
}: LabelProps) => {
|
|
51
60
|
let htmlElementstring = isLayoutForElement;
|
|
@@ -63,16 +72,23 @@ export const Label = ({
|
|
|
63
72
|
</span>
|
|
64
73
|
)}
|
|
65
74
|
{children && <span className={`${eccgui}-label__other`}>{children}</span>}
|
|
75
|
+
{additionalElements && (
|
|
76
|
+
<>
|
|
77
|
+
<Spacing vertical size="tiny" />
|
|
78
|
+
{additionalElements}
|
|
79
|
+
</>
|
|
80
|
+
)}
|
|
66
81
|
</>
|
|
67
82
|
);
|
|
68
83
|
|
|
69
|
-
return !!text || !!info || !!tooltip || !!children ? (
|
|
84
|
+
return !!text || !!info || !!tooltip || !!children || !!additionalElements ? (
|
|
70
85
|
React.createElement(
|
|
71
86
|
htmlElementstring,
|
|
72
87
|
{
|
|
73
88
|
className:
|
|
74
89
|
`${eccgui}-label ${eccgui}-label--${emphasis}` +
|
|
75
90
|
(className ? " " + className : "") +
|
|
91
|
+
(inline ? ` ${eccgui}-label--inline` : "") +
|
|
76
92
|
(disabled ? ` ${eccgui}-label--disabled` : ""),
|
|
77
93
|
...otherLabelProps,
|
|
78
94
|
},
|
|
@@ -8,7 +8,6 @@ $eccgui-color-label-info: rgba($eccgui-color-workspace-text, $eccgui-opacity-mut
|
|
|
8
8
|
font-size: $eccgui-size-typo-label;
|
|
9
9
|
line-height: $eccgui-size-typo-label-lineheight;
|
|
10
10
|
color: $eccgui-color-label-text;
|
|
11
|
-
vertical-align: middle;
|
|
12
11
|
|
|
13
12
|
.#{$eccgui}-typography__overflowtext--passdown > & {
|
|
14
13
|
display: flex;
|
|
@@ -17,6 +16,11 @@ $eccgui-color-label-info: rgba($eccgui-color-workspace-text, $eccgui-opacity-mut
|
|
|
17
16
|
}
|
|
18
17
|
}
|
|
19
18
|
|
|
19
|
+
.#{$eccgui}-label--inline {
|
|
20
|
+
display: inline-block;
|
|
21
|
+
vertical-align: middle;
|
|
22
|
+
}
|
|
23
|
+
|
|
20
24
|
.#{$eccgui}-label--disabled {
|
|
21
25
|
opacity: $eccgui-opacity-disabled;
|
|
22
26
|
}
|
|
@@ -5,6 +5,7 @@ import { openInNewTab } from "../../common/utils/openInNewTab";
|
|
|
5
5
|
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
6
6
|
import { ValidIconName } from "../Icon/canonicalIconNames";
|
|
7
7
|
import Icon from "../Icon/Icon";
|
|
8
|
+
import Tooltip from "../Tooltip/Tooltip";
|
|
8
9
|
|
|
9
10
|
import { TestIconProps } from "./../Icon/TestIcon";
|
|
10
11
|
|
|
@@ -15,16 +16,41 @@ export interface MenuItemProps
|
|
|
15
16
|
* If set the icon is diplayed on the left side of the menu item.
|
|
16
17
|
*/
|
|
17
18
|
icon?: ValidIconName | string[] | React.ReactElement<TestIconProps>;
|
|
19
|
+
/**
|
|
20
|
+
* Submenu.
|
|
21
|
+
*/
|
|
18
22
|
children?: React.ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Tooltip, but only added to the label, not to the full menu item.
|
|
25
|
+
*/
|
|
26
|
+
tooltip?: string | JSX.Element;
|
|
19
27
|
}
|
|
20
28
|
|
|
21
29
|
/**
|
|
22
30
|
* Single item, used as child inside `Menu`.
|
|
23
31
|
*/
|
|
24
|
-
export const MenuItem = ({
|
|
32
|
+
export const MenuItem = ({
|
|
33
|
+
children,
|
|
34
|
+
className = "",
|
|
35
|
+
icon,
|
|
36
|
+
onClick,
|
|
37
|
+
href,
|
|
38
|
+
text,
|
|
39
|
+
tooltip,
|
|
40
|
+
...restProps
|
|
41
|
+
}: MenuItemProps) => {
|
|
25
42
|
return (
|
|
26
43
|
<BlueprintMenuItem
|
|
27
44
|
{...restProps}
|
|
45
|
+
text={
|
|
46
|
+
tooltip ? (
|
|
47
|
+
<Tooltip content={tooltip} fill>
|
|
48
|
+
{text}
|
|
49
|
+
</Tooltip>
|
|
50
|
+
) : (
|
|
51
|
+
text
|
|
52
|
+
)
|
|
53
|
+
}
|
|
28
54
|
href={href}
|
|
29
55
|
onClick={(e: React.MouseEvent<HTMLElement>) =>
|
|
30
56
|
openInNewTab(e as React.MouseEvent<HTMLAnchorElement>, onClick, href)
|