@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
|
@@ -323,6 +323,7 @@ function MultiSelect<T>({
|
|
|
323
323
|
* @param query
|
|
324
324
|
*/
|
|
325
325
|
const onQueryChange = (query: string) => {
|
|
326
|
+
setFilteredItems([]);
|
|
326
327
|
if (query.length && query !== requestState.current.query) {
|
|
327
328
|
requestState.current.query = query;
|
|
328
329
|
if (requestState.current.timeoutId) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
3
|
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
4
|
+
import Card, { CardProps } from "../Card/Card";
|
|
4
5
|
|
|
5
6
|
export interface OverviewItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
7
|
/**
|
|
@@ -11,6 +12,17 @@ export interface OverviewItemProps extends React.HTMLAttributes<HTMLDivElement>
|
|
|
11
12
|
* Add a bit white space around the element.
|
|
12
13
|
*/
|
|
13
14
|
hasSpacing?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Uses a `Card` element to wrap the `OverviewItem` inside.
|
|
17
|
+
* It is always used with `isOnlyLayout` set to `true`.
|
|
18
|
+
* Should be used together with `hasSpacing`.
|
|
19
|
+
*/
|
|
20
|
+
hasCardWrapper?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Forwarding basic `Card` properties to the wrapper element.
|
|
23
|
+
* Only used if `hasCardWrapper` is set to `true`.
|
|
24
|
+
*/
|
|
25
|
+
cardProps?: Omit<CardProps, "children" | "isOnlyLayout" | "fullHeight" | "whitespaceAmount" | "compact">;
|
|
14
26
|
}
|
|
15
27
|
|
|
16
28
|
/**
|
|
@@ -22,6 +34,8 @@ export const OverviewItem = ({
|
|
|
22
34
|
className = "",
|
|
23
35
|
densityHigh = false,
|
|
24
36
|
hasSpacing = false,
|
|
37
|
+
hasCardWrapper = false,
|
|
38
|
+
cardProps,
|
|
25
39
|
...otherProps
|
|
26
40
|
}: OverviewItemProps) => {
|
|
27
41
|
const item = (
|
|
@@ -38,6 +52,7 @@ export const OverviewItem = ({
|
|
|
38
52
|
</div>
|
|
39
53
|
);
|
|
40
54
|
|
|
55
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
56
|
const accessibilityParameters: { [key: string]: any } = Object.create(null);
|
|
42
57
|
if (typeof otherProps.onClick !== "undefined" || typeof otherProps.onKeyDown !== "undefined") {
|
|
43
58
|
accessibilityParameters["tabIndex"] = 0;
|
|
@@ -46,7 +61,15 @@ export const OverviewItem = ({
|
|
|
46
61
|
accessibilityParameters["role"] = "button";
|
|
47
62
|
}
|
|
48
63
|
|
|
49
|
-
|
|
64
|
+
const element = React.cloneElement(item, accessibilityParameters);
|
|
65
|
+
|
|
66
|
+
return hasCardWrapper ? (
|
|
67
|
+
<Card isOnlyLayout {...cardProps}>
|
|
68
|
+
{element}
|
|
69
|
+
</Card>
|
|
70
|
+
) : (
|
|
71
|
+
element
|
|
72
|
+
);
|
|
50
73
|
};
|
|
51
74
|
|
|
52
75
|
export default OverviewItem;
|
|
@@ -5,6 +5,7 @@ import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
|
5
5
|
export interface OverviewItemListProps extends React.HTMLAttributes<HTMLOListElement> {
|
|
6
6
|
/**
|
|
7
7
|
* Displays the element using reduced height and less white space inside.
|
|
8
|
+
* @deprecated (v25) use property directly on `OverviewItem` children.
|
|
8
9
|
*/
|
|
9
10
|
densityHigh?: boolean;
|
|
10
11
|
/**
|
|
@@ -23,8 +24,8 @@ export interface OverviewItemListProps extends React.HTMLAttributes<HTMLOListEle
|
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
|
-
* This
|
|
27
|
-
*
|
|
27
|
+
* This component is a listing container for multiple `OverviewItem` elements.
|
|
28
|
+
* It should only contains `OverviewItem` children but it does not check and control that condition.
|
|
28
29
|
*/
|
|
29
30
|
export const OverviewItemList = ({
|
|
30
31
|
children,
|
|
@@ -193,7 +193,10 @@ $eccgui-size-overviewitem-line-typo-large-lineheight: $eccgui-size-typo-subtitle
|
|
|
193
193
|
|
|
194
194
|
.#{$eccgui}-overviewitem__item:hover &,
|
|
195
195
|
.#{$eccgui}-overviewitem__item:focus &,
|
|
196
|
-
.#{$eccgui}-overviewitem__item:active
|
|
196
|
+
.#{$eccgui}-overviewitem__item:active &,
|
|
197
|
+
&:focus-within,
|
|
198
|
+
&:has(.#{$ns}-active),
|
|
199
|
+
&:has(.#{$ns}-popover-open) {
|
|
197
200
|
display: flex;
|
|
198
201
|
}
|
|
199
202
|
}
|
|
@@ -27,7 +27,7 @@ export default {
|
|
|
27
27
|
},
|
|
28
28
|
argTypes: {
|
|
29
29
|
children: {
|
|
30
|
-
control:
|
|
30
|
+
control: false,
|
|
31
31
|
description: "Elements used as depiction, text and interactive elements of an overview-item.",
|
|
32
32
|
},
|
|
33
33
|
},
|
|
@@ -47,6 +47,9 @@ ItemExample.args = {
|
|
|
47
47
|
<OverviewItemActions children={ActionsExample.args.children[0]} hiddenInteractions key="hiddenactions" />,
|
|
48
48
|
<OverviewItemActions children={ActionsExample.args.children[1]} key="actions" />,
|
|
49
49
|
],
|
|
50
|
+
densityHigh: false,
|
|
51
|
+
hasSpacing: false,
|
|
52
|
+
hasCardWrapper: false,
|
|
50
53
|
};
|
|
51
54
|
|
|
52
55
|
export const ItemWithDepictionElement = Template.bind({});
|
|
@@ -69,16 +72,7 @@ ItemWithDepictionElement.args = {
|
|
|
69
72
|
<OverviewItemActions children={ActionsExample.args.children[0]} hiddenInteractions />,
|
|
70
73
|
<OverviewItemActions children={ActionsExample.args.children[1]} />,
|
|
71
74
|
],
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const TemplateCard: StoryFn<typeof OverviewItem> = (args) => (
|
|
75
|
-
<Card isOnlyLayout>
|
|
76
|
-
<OverviewItem {...args}></OverviewItem>
|
|
77
|
-
</Card>
|
|
78
|
-
);
|
|
79
|
-
|
|
80
|
-
export const ItemInCard = TemplateCard.bind({});
|
|
81
|
-
ItemInCard.args = {
|
|
82
|
-
...ItemExample.args,
|
|
75
|
+
densityHigh: false,
|
|
83
76
|
hasSpacing: true,
|
|
77
|
+
hasCardWrapper: true,
|
|
84
78
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { loremIpsum } from "react-lorem-ipsum";
|
|
3
3
|
import { Meta, StoryFn } from "@storybook/react";
|
|
4
|
+
import { fn } from "@storybook/test";
|
|
4
5
|
|
|
5
6
|
import { helpersArgTypes } from "../../../.storybook/helpers";
|
|
6
7
|
import { Button, Depiction, MenuItem, Select } from "../../index";
|
|
@@ -30,7 +31,7 @@ Default.args = {
|
|
|
30
31
|
return { label: item };
|
|
31
32
|
}),
|
|
32
33
|
itemRenderer: (item, props) => {
|
|
33
|
-
return <MenuItem text={item.label} title={item.label} />;
|
|
34
|
+
return <MenuItem text={item.label} title={item.label} {...props} />;
|
|
34
35
|
},
|
|
35
36
|
fill: true,
|
|
36
37
|
};
|
|
@@ -53,6 +54,7 @@ ControlledTarget.args = {
|
|
|
53
54
|
...Default.args,
|
|
54
55
|
fill: false,
|
|
55
56
|
children: <Button text="Controlled select target" intent="primary" />,
|
|
57
|
+
onActiveItemChange: fn(),
|
|
56
58
|
};
|
|
57
59
|
|
|
58
60
|
/**
|
|
@@ -70,4 +72,5 @@ ClearanceOption.args = {
|
|
|
70
72
|
onClearanceHandler: () => {
|
|
71
73
|
alert("Reset now.");
|
|
72
74
|
},
|
|
75
|
+
onActiveItemChange: fn(),
|
|
73
76
|
};
|
|
@@ -1,26 +1,45 @@
|
|
|
1
|
-
import React, { memo
|
|
2
|
-
import {
|
|
1
|
+
import React, { memo } from "react";
|
|
2
|
+
import {
|
|
3
|
+
Classes as BlueprintClasses,
|
|
4
|
+
Switch as BlueprintSwitch,
|
|
5
|
+
SwitchProps as BlueprintSwitchProps,
|
|
6
|
+
} from "@blueprintjs/core";
|
|
3
7
|
|
|
4
8
|
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
9
|
+
import { Label } from "../Label/Label";
|
|
5
10
|
|
|
6
11
|
export interface SwitchProps extends Omit<BlueprintSwitchProps, "onChange"> {
|
|
7
12
|
/**
|
|
8
13
|
* Event handler for changed state.
|
|
9
14
|
*/
|
|
10
|
-
onChange?: (value: boolean) =>
|
|
15
|
+
onChange?: (value: boolean) => void;
|
|
11
16
|
/**
|
|
12
17
|
* class names
|
|
13
18
|
*/
|
|
14
19
|
className?: string;
|
|
15
20
|
}
|
|
16
21
|
|
|
17
|
-
export const Switch = ({ onChange, className, ...otherProps }: SwitchProps) => {
|
|
18
|
-
const handleChange = (e:
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
export const Switch = ({ onChange, className, label, ...otherProps }: SwitchProps) => {
|
|
23
|
+
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
24
|
+
if (onChange) {
|
|
25
|
+
onChange(!!e.target?.checked);
|
|
26
|
+
}
|
|
21
27
|
};
|
|
22
28
|
|
|
23
|
-
return
|
|
29
|
+
return (
|
|
30
|
+
<BlueprintSwitch
|
|
31
|
+
className={`${eccgui}-switch ${className ?? ""} ${
|
|
32
|
+
label && !otherProps.labelElement ? BlueprintClasses.INLINE : ""
|
|
33
|
+
}`}
|
|
34
|
+
labelElement={
|
|
35
|
+
label ? (
|
|
36
|
+
<Label text={label} isLayoutForElement="span" disabled={otherProps.disabled} inline />
|
|
37
|
+
) : undefined
|
|
38
|
+
}
|
|
39
|
+
{...otherProps}
|
|
40
|
+
onChange={handleChange}
|
|
41
|
+
/>
|
|
42
|
+
);
|
|
24
43
|
};
|
|
25
44
|
|
|
26
45
|
export default memo(Switch);
|
|
@@ -10,11 +10,11 @@ function TagList({ children, className = "", label = "", ...otherProps }: TagLis
|
|
|
10
10
|
const tagList = (
|
|
11
11
|
<ul className={`${eccgui}-tag__list` + (className && !label ? " " + className : "")} {...otherProps}>
|
|
12
12
|
{React.Children.map(children, (child, i) => {
|
|
13
|
-
return (
|
|
13
|
+
return child ? (
|
|
14
14
|
<li className={`${eccgui}-tag__list-item`} key={"tagitem_" + i}>
|
|
15
15
|
{child}
|
|
16
16
|
</li>
|
|
17
|
-
);
|
|
17
|
+
) : null;
|
|
18
18
|
})}
|
|
19
19
|
</ul>
|
|
20
20
|
);
|
|
@@ -35,10 +35,38 @@ export const SearchField = ({
|
|
|
35
35
|
className = "",
|
|
36
36
|
emptySearchInputMessage = "Enter search term",
|
|
37
37
|
onClearanceHandler,
|
|
38
|
-
onClearanceText = "Clear
|
|
38
|
+
onClearanceText = "Clear current search term",
|
|
39
|
+
onChange,
|
|
39
40
|
leftIcon = <Icon name="operation-search" />,
|
|
41
|
+
rightElement,
|
|
40
42
|
...otherProps
|
|
41
43
|
}: SearchFieldProps) => {
|
|
44
|
+
const [value, setValue] = React.useState<string>("");
|
|
45
|
+
|
|
46
|
+
const clearanceButton =
|
|
47
|
+
onClearanceHandler && value ? (
|
|
48
|
+
<IconButton
|
|
49
|
+
data-test-id={otherProps["data-test-id"] && `${otherProps["data-test-id"]}-clear-btn`}
|
|
50
|
+
name="operation-clear"
|
|
51
|
+
text={onClearanceText}
|
|
52
|
+
onClick={() => {
|
|
53
|
+
setValue("");
|
|
54
|
+
onClearanceHandler();
|
|
55
|
+
}}
|
|
56
|
+
/>
|
|
57
|
+
) : undefined;
|
|
58
|
+
|
|
59
|
+
const changeHandlerProcess = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
60
|
+
setValue(e.target.value);
|
|
61
|
+
if (onChange) {
|
|
62
|
+
onChange(e);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
React.useEffect(() => {
|
|
67
|
+
setValue(otherProps.value ?? otherProps.defaultValue ?? "");
|
|
68
|
+
}, [otherProps.value, otherProps.defaultValue]);
|
|
69
|
+
|
|
42
70
|
return (
|
|
43
71
|
<TextField
|
|
44
72
|
className={
|
|
@@ -50,16 +78,16 @@ export const SearchField = ({
|
|
|
50
78
|
placeholder={emptySearchInputMessage}
|
|
51
79
|
aria-label={emptySearchInputMessage}
|
|
52
80
|
rightElement={
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
/>
|
|
60
|
-
) : undefined
|
|
81
|
+
(clearanceButton || rightElement) && (
|
|
82
|
+
<>
|
|
83
|
+
{rightElement}
|
|
84
|
+
{clearanceButton}
|
|
85
|
+
</>
|
|
86
|
+
)
|
|
61
87
|
}
|
|
88
|
+
onChange={changeHandlerProcess}
|
|
62
89
|
{...otherProps}
|
|
90
|
+
value={value}
|
|
63
91
|
type={"search"}
|
|
64
92
|
leftIcon={leftIcon}
|
|
65
93
|
round={true}
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Meta, StoryFn } from "@storybook/react";
|
|
3
3
|
|
|
4
|
+
import { helpersArgTypes } from "../../../../.storybook/helpers";
|
|
5
|
+
|
|
4
6
|
import SearchField from "./../SearchField";
|
|
5
7
|
|
|
6
8
|
export default {
|
|
7
9
|
title: "Components/SearchField",
|
|
8
10
|
component: SearchField,
|
|
9
11
|
argTypes: {
|
|
12
|
+
leftIcon: {
|
|
13
|
+
...helpersArgTypes.exampleIcon,
|
|
14
|
+
},
|
|
15
|
+
rightElement: {
|
|
16
|
+
...helpersArgTypes.exampleIcon,
|
|
17
|
+
},
|
|
10
18
|
hasStatePrimary: { table: { disable: true } },
|
|
11
19
|
hasStateSuccess: { table: { disable: true } },
|
|
12
20
|
hasStateWarning: { table: { disable: true } },
|
|
@@ -23,7 +31,7 @@ Default.args = {
|
|
|
23
31
|
onClearanceText: "",
|
|
24
32
|
};
|
|
25
33
|
|
|
26
|
-
|
|
34
|
+
const SearchFieldWithClearanceIconTemplate: StoryFn<typeof SearchField> = (args) => {
|
|
27
35
|
const [query, setQuery] = React.useState<string>("");
|
|
28
36
|
return (
|
|
29
37
|
<SearchField
|
|
@@ -34,3 +42,9 @@ export const SearchFieldWithClearanceIcon: StoryFn<typeof SearchField> = (args)
|
|
|
34
42
|
/>
|
|
35
43
|
);
|
|
36
44
|
};
|
|
45
|
+
|
|
46
|
+
export const SearchFieldWithClearanceIcon = SearchFieldWithClearanceIconTemplate.bind({});
|
|
47
|
+
SearchFieldWithClearanceIcon.args = {
|
|
48
|
+
onClearanceHandler: null,
|
|
49
|
+
onClearanceText: "Clear field",
|
|
50
|
+
};
|
|
@@ -31,6 +31,7 @@ Default.args = {
|
|
|
31
31
|
fullWidth: false,
|
|
32
32
|
placeholder: "placeholder text",
|
|
33
33
|
readOnly: false,
|
|
34
|
+
disabled: false,
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
/** Text field with default value that contains a zero width/invisible character.
|
|
@@ -46,7 +47,7 @@ const invisibleCharacterWarningProps: TextFieldProps = {
|
|
|
46
47
|
const codePointsString = [...Array.from(codePoints)]
|
|
47
48
|
.map((n) => {
|
|
48
49
|
const info = characters.invisibleZeroWidthCharacters.codePointMap.get(n);
|
|
49
|
-
return info
|
|
50
|
+
return info?.fullLabel;
|
|
50
51
|
})
|
|
51
52
|
.join(", ");
|
|
52
53
|
alert("Invisible character detected in input string. Code points: " + codePointsString);
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
// own vars
|
|
5
5
|
$eccgui-size-textfield-height-small: $eccgui-size-block-whitespace * 2 !default;
|
|
6
6
|
$eccgui-size-textfield-height-regular: $eccgui-size-textfield-height-small * $eccgui-size-type-levelratio !default;
|
|
7
|
-
$eccgui-size-textfield-height-large: $eccgui-size-textfield-height-regular * $eccgui-size-type-levelratio *
|
|
7
|
+
$eccgui-size-textfield-height-large: $eccgui-size-textfield-height-regular * $eccgui-size-type-levelratio *
|
|
8
|
+
$eccgui-size-type-levelratio !default;
|
|
8
9
|
$eccgui-size-textfield-padding-horizontal-regular: $eccgui-size-inline-whitespace !default;
|
|
9
10
|
$eccgui-size-textfield-padding-horizontal-small: $eccgui-size-inline-whitespace * 0.5 !default;
|
|
10
11
|
$eccgui-typo-textfield-fontweight: $eccgui-font-weight-regular !default;
|
|
@@ -50,10 +51,23 @@ $input-button-height-small: math.div($eccgui-size-textfield-height-small, $eccgu
|
|
|
50
51
|
height: 100%;
|
|
51
52
|
max-height: $input-button-height-large;
|
|
52
53
|
|
|
53
|
-
& >
|
|
54
|
+
& > * {
|
|
55
|
+
vertical-align: middle;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
& > .#{eccgui}-icon,
|
|
59
|
+
& > .#{eccgui}-tooltip__wrapper {
|
|
54
60
|
display: inline-flex;
|
|
61
|
+
align-items: center;
|
|
55
62
|
height: 100%;
|
|
56
|
-
|
|
63
|
+
|
|
64
|
+
&:first-child {
|
|
65
|
+
margin-left: 0.5 * $eccgui-size-block-whitespace;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&:last-child {
|
|
69
|
+
margin-right: 0.5 * $eccgui-size-block-whitespace;
|
|
70
|
+
}
|
|
57
71
|
}
|
|
58
72
|
}
|
|
59
73
|
}
|
|
@@ -1,13 +1,34 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
3
|
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
4
|
+
import { TestableComponent } from "../../components/interfaces";
|
|
4
5
|
|
|
5
|
-
export interface OverflowTextProps {
|
|
6
|
-
|
|
6
|
+
export interface OverflowTextProps extends React.HTMLAttributes<HTMLElement>, TestableComponent {
|
|
7
|
+
/**
|
|
8
|
+
* How is ellipsis used to cut text overflows.
|
|
9
|
+
* Use `reverse`to use the ellipis on text start and display the end of the text.
|
|
10
|
+
*/
|
|
11
|
+
ellipsis?: "add" | "reverse" | "none";
|
|
12
|
+
/**
|
|
13
|
+
* Display component as inline element.
|
|
14
|
+
*/
|
|
7
15
|
inline?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Using text overflow on all children elements.
|
|
18
|
+
*/
|
|
8
19
|
passDown?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Additional CSS class name.
|
|
22
|
+
*/
|
|
9
23
|
className?: string;
|
|
24
|
+
/**
|
|
25
|
+
* HTML element that is used for the component.
|
|
26
|
+
*/
|
|
10
27
|
useHtmlElement?: "p" | "div" | "span";
|
|
28
|
+
/**
|
|
29
|
+
* Used for all other necessary properties.
|
|
30
|
+
* @deprecated (v25) we will allow only basic HTML element properties and testing IDs
|
|
31
|
+
*/
|
|
11
32
|
[key: string]: any;
|
|
12
33
|
}
|
|
13
34
|
|
|
@@ -15,7 +36,7 @@ export interface OverflowTextProps {
|
|
|
15
36
|
export const OverflowText = ({
|
|
16
37
|
className = "",
|
|
17
38
|
children,
|
|
18
|
-
ellipsis,
|
|
39
|
+
ellipsis = "add",
|
|
19
40
|
inline = false,
|
|
20
41
|
passDown = false,
|
|
21
42
|
useHtmlElement,
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import LoremIpsum, { loremIpsum } from "react-lorem-ipsum";
|
|
3
|
+
import { Meta, StoryFn } from "@storybook/react";
|
|
4
|
+
|
|
5
|
+
import { OverflowText } from "../../../index";
|
|
6
|
+
|
|
7
|
+
const config = {
|
|
8
|
+
title: "Components/Typography/OverflowText",
|
|
9
|
+
component: OverflowText,
|
|
10
|
+
argTypes: {
|
|
11
|
+
children: {
|
|
12
|
+
control: "select",
|
|
13
|
+
options: ["simple text", "2 paragraphs"],
|
|
14
|
+
mapping: {
|
|
15
|
+
"simple text": loremIpsum({
|
|
16
|
+
p: 1,
|
|
17
|
+
avgSentencesPerParagraph: 4,
|
|
18
|
+
random: false,
|
|
19
|
+
}),
|
|
20
|
+
"2 paragraphs": <LoremIpsum p={2} avgSentencesPerParagraph={4} random={false} />
|
|
21
|
+
},
|
|
22
|
+
description: "Content of the element.",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
} as Meta<typeof OverflowText>;
|
|
26
|
+
export default config;
|
|
27
|
+
|
|
28
|
+
const Template: StoryFn<typeof OverflowText> = (args) => <OverflowText {...args} />;
|
|
29
|
+
|
|
30
|
+
export const Default = Template.bind({});
|
|
31
|
+
Default.args = {
|
|
32
|
+
children: config?.argTypes?.children?.mapping ? config.argTypes.children.mapping["simple text"] : "Overflow text",
|
|
33
|
+
};
|
package/src/components/index.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Meta, StoryFn } from "@storybook/react";
|
|
3
3
|
|
|
4
|
+
import { helpersArgTypes } from "../../../.storybook/helpers";
|
|
5
|
+
|
|
4
6
|
import { CodeEditor } from "./CodeMirror";
|
|
5
7
|
|
|
6
8
|
export default {
|
|
@@ -11,14 +13,30 @@ export default {
|
|
|
11
13
|
onChange: {
|
|
12
14
|
action: "value changed",
|
|
13
15
|
},
|
|
16
|
+
intent: {
|
|
17
|
+
...helpersArgTypes.exampleIntent,
|
|
18
|
+
},
|
|
14
19
|
},
|
|
15
20
|
} as Meta<typeof CodeEditor>;
|
|
16
21
|
|
|
17
|
-
|
|
22
|
+
let forcedUpdateKey = 0; // @see https://github.com/storybookjs/storybook/issues/13375#issuecomment-1291011856
|
|
23
|
+
const TemplateFull: StoryFn<typeof CodeEditor> = (args) => <CodeEditor {...args} key={++forcedUpdateKey} />;
|
|
18
24
|
|
|
19
25
|
export const BasicExample = TemplateFull.bind({});
|
|
20
26
|
BasicExample.args = {
|
|
21
27
|
name: "codeinput",
|
|
22
28
|
mode: "markdown",
|
|
23
29
|
defaultValue: "**test me**",
|
|
30
|
+
useToolbar: true,
|
|
31
|
+
disabled: false,
|
|
32
|
+
readOnly: true,
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const LinterExample = TemplateFull.bind({});
|
|
36
|
+
LinterExample.args = {
|
|
37
|
+
name: "codeinput",
|
|
38
|
+
defaultValue: "**test me**",
|
|
39
|
+
mode: "javascript",
|
|
40
|
+
useLinting: true,
|
|
41
|
+
autoFocus: true,
|
|
24
42
|
};
|