@eccenca/gui-elements 23.0.0-rc.6 → 23.0.0-rc.7
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 +3 -1
- package/dist/cjs/cmem/markdown/Markdown.js +14 -2
- package/dist/cjs/cmem/markdown/Markdown.js.map +1 -1
- package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js +0 -4
- package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -1
- package/dist/cjs/components/Accordion/Accordion.js +7 -2
- package/dist/cjs/components/Accordion/Accordion.js.map +1 -1
- package/dist/cjs/components/Accordion/AccordionItem.js.map +1 -1
- package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js +59 -33
- package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
- package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js +10 -1
- package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js.map +1 -1
- package/dist/cjs/components/AutoSuggestion/SingleLineCodeEditor.js +10 -4
- package/dist/cjs/components/AutoSuggestion/SingleLineCodeEditor.js.map +1 -1
- package/dist/cjs/components/AutocompleteField/AutoCompleteField.js +13 -8
- package/dist/cjs/components/AutocompleteField/AutoCompleteField.js.map +1 -1
- package/dist/cjs/components/Button/Button.js.map +1 -1
- package/dist/cjs/components/Checkbox/Checkbox.js +1 -0
- package/dist/cjs/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/cjs/components/Form/FieldItem.js.map +1 -1
- package/dist/cjs/components/Menu/Menu.js +2 -2
- package/dist/cjs/components/Menu/Menu.js.map +1 -1
- package/dist/cjs/components/Menu/MenuDivider.js +2 -2
- package/dist/cjs/components/Menu/MenuDivider.js.map +1 -1
- package/dist/cjs/components/Menu/MenuItem.js +5 -3
- package/dist/cjs/components/Menu/MenuItem.js.map +1 -1
- package/dist/cjs/components/MultiSelect/MultiSelect.js +17 -4
- package/dist/cjs/components/MultiSelect/MultiSelect.js.map +1 -1
- package/dist/cjs/components/Pagination/Pagination.js.map +1 -1
- package/dist/cjs/components/RadioButton/RadioButton.js +1 -0
- package/dist/cjs/components/RadioButton/RadioButton.js.map +1 -1
- package/dist/cjs/components/Separation/Spacing.js +4 -1
- package/dist/cjs/components/Separation/Spacing.js.map +1 -1
- package/dist/cjs/components/Spinner/Spinner.js +3 -3
- package/dist/cjs/components/Spinner/Spinner.js.map +1 -1
- package/dist/cjs/components/Switch/Switch.js.map +1 -1
- package/dist/cjs/extensions/react-flow/edges/EdgeDefault.js.map +1 -1
- package/dist/esm/cmem/markdown/Markdown.js +13 -2
- package/dist/esm/cmem/markdown/Markdown.js.map +1 -1
- package/dist/esm/cmem/react-flow/ReactFlow/ReactFlow.js +0 -4
- package/dist/esm/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -1
- package/dist/esm/components/Accordion/Accordion.js +8 -3
- package/dist/esm/components/Accordion/Accordion.js.map +1 -1
- package/dist/esm/components/Accordion/AccordionItem.js +1 -1
- package/dist/esm/components/Accordion/AccordionItem.js.map +1 -1
- package/dist/esm/components/AutoSuggestion/AutoSuggestion.js +71 -45
- package/dist/esm/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
- package/dist/esm/components/AutoSuggestion/AutoSuggestionList.js +11 -2
- package/dist/esm/components/AutoSuggestion/AutoSuggestionList.js.map +1 -1
- package/dist/esm/components/AutoSuggestion/SingleLineCodeEditor.js +11 -5
- package/dist/esm/components/AutoSuggestion/SingleLineCodeEditor.js.map +1 -1
- package/dist/esm/components/AutocompleteField/AutoCompleteField.js +19 -14
- package/dist/esm/components/AutocompleteField/AutoCompleteField.js.map +1 -1
- package/dist/esm/components/Button/Button.js.map +1 -1
- package/dist/esm/components/Checkbox/Checkbox.js +1 -0
- package/dist/esm/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/esm/components/Form/FieldItem.js.map +1 -1
- package/dist/esm/components/Menu/Menu.js +3 -3
- package/dist/esm/components/Menu/Menu.js.map +1 -1
- package/dist/esm/components/Menu/MenuDivider.js +3 -3
- package/dist/esm/components/Menu/MenuDivider.js.map +1 -1
- package/dist/esm/components/Menu/MenuItem.js +5 -3
- package/dist/esm/components/Menu/MenuItem.js.map +1 -1
- package/dist/esm/components/MultiSelect/MultiSelect.js +22 -9
- package/dist/esm/components/MultiSelect/MultiSelect.js.map +1 -1
- package/dist/esm/components/Pagination/Pagination.js +1 -1
- package/dist/esm/components/Pagination/Pagination.js.map +1 -1
- package/dist/esm/components/RadioButton/RadioButton.js +2 -1
- package/dist/esm/components/RadioButton/RadioButton.js.map +1 -1
- package/dist/esm/components/Separation/Spacing.js +4 -1
- package/dist/esm/components/Separation/Spacing.js.map +1 -1
- package/dist/esm/components/Spinner/Spinner.js +3 -4
- package/dist/esm/components/Spinner/Spinner.js.map +1 -1
- package/dist/esm/components/Switch/Switch.js +1 -1
- package/dist/esm/components/Switch/Switch.js.map +1 -1
- package/dist/esm/extensions/react-flow/edges/EdgeDefault.js.map +1 -1
- package/dist/types/cmem/markdown/Markdown.d.ts +3 -2
- package/dist/types/cmem/react-flow/ReactFlow/ReactFlow.d.ts +1 -1
- package/dist/types/components/Accordion/Accordion.d.ts +12 -1
- package/dist/types/components/Accordion/AccordionItem.d.ts +21 -6
- package/dist/types/components/AutoSuggestion/AutoSuggestionList.d.ts +4 -2
- package/dist/types/components/AutocompleteField/AutoCompleteField.d.ts +5 -0
- package/dist/types/components/Button/Button.d.ts +1 -1
- package/dist/types/components/Checkbox/Checkbox.d.ts +4 -1
- package/dist/types/components/Form/FieldItem.d.ts +32 -2
- package/dist/types/components/Menu/Menu.d.ts +4 -1
- package/dist/types/components/Menu/MenuDivider.d.ts +4 -1
- package/dist/types/components/Menu/MenuItem.d.ts +5 -2
- package/dist/types/components/Pagination/Pagination.d.ts +9 -5
- package/dist/types/components/RadioButton/RadioButton.d.ts +4 -1
- package/dist/types/components/Separation/Spacing.d.ts +17 -3
- package/dist/types/components/Spinner/Spinner.d.ts +38 -5
- package/dist/types/components/Switch/Switch.d.ts +6 -3
- package/dist/types/extensions/react-flow/edges/EdgeDefault.d.ts +15 -0
- package/package.json +4 -6
- package/src/cmem/markdown/Markdown.tsx +5 -4
- package/src/cmem/react-flow/ReactFlow/ReactFlow.stories.tsx +15 -86
- package/src/cmem/react-flow/ReactFlow/ReactFlow.tsx +1 -5
- package/src/components/Accordion/Accordion.tsx +33 -3
- package/src/components/Accordion/AccordionItem.tsx +23 -33
- package/src/components/Accordion/Stories/Accordion.stories.tsx +33 -0
- package/src/components/Accordion/Stories/AccordionItem.stories.tsx +27 -0
- package/src/components/Accordion/accordion.scss +20 -1
- package/src/components/AutoSuggestion/AutoSuggestion.tsx +73 -39
- package/src/components/AutoSuggestion/AutoSuggestionList.tsx +15 -2
- package/src/components/AutoSuggestion/SingleLineCodeEditor.tsx +17 -9
- package/src/components/AutoSuggestion/tests/AutoSuggestionList.test.tsx +9 -7
- package/src/components/AutocompleteField/AutoCompleteField.tsx +19 -6
- package/src/components/AutocompleteField/autoCompleteFieldUtils.tsx +1 -1
- package/src/components/AutocompleteField/stories/AutoCompleteField.stories.tsx +1 -1
- package/src/components/Button/Button.stories.tsx +1 -107
- package/src/components/Button/Button.tsx +2 -2
- package/src/components/Card/stories/Card.stories.tsx +2 -21
- package/src/components/Checkbox/Checkbox.tsx +9 -2
- package/src/components/Checkbox/Stories/Checkbox.stories.tsx +30 -0
- package/src/components/Checkbox/checkbox.scss +4 -0
- package/src/components/ContextOverlay/ContextMenu.stories.tsx +2 -2
- package/src/components/Dialog/stories/Modal.stories.tsx +1 -61
- package/src/components/Dialog/stories/SimpleDialog.stories.tsx +1 -2
- package/src/components/Form/FieldItem.tsx +32 -2
- package/src/components/Form/Stories/FieldItem.stories.tsx +27 -0
- package/src/components/Form/Stories/FieldItemRow.stories.tsx +31 -0
- package/src/components/Label/Label.stories.tsx +1 -1
- package/src/components/Menu/Menu.tsx +21 -3
- package/src/components/Menu/MenuDivider.tsx +20 -3
- package/src/components/Menu/MenuItem.tsx +13 -10
- package/src/components/Menu/Stories/Menu.stories.tsx +31 -0
- package/src/components/Menu/Stories/MenuItem.stories.tsx +25 -0
- package/src/components/MultiSelect/MultiSelect.stories.tsx +2 -21
- package/src/components/MultiSelect/MultiSelect.tsx +22 -5
- package/src/components/Notification/Notification.stories.tsx +1 -29
- package/src/components/Pagination/Pagination.tsx +13 -6
- package/src/components/Pagination/Stories/Pagination.stories.tsx +32 -0
- package/src/components/Pagination/pagination.scss +2 -2
- package/src/components/ProgressBar/Stories/ProgressBar.stories.tsx +25 -0
- package/src/components/RadioButton/RadioButton.tsx +9 -2
- package/src/components/RadioButton/Stories/RadioButton.stories.tsx +30 -0
- package/src/components/Select/Select.stories.tsx +1 -1
- package/src/components/Separation/Spacing.tsx +17 -4
- package/src/components/Separation/Stories/Spacing.stories.tsx +25 -0
- package/src/components/Spinner/Spinner.tsx +39 -7
- package/src/components/Spinner/Stories/spinner.stories.tsx +26 -0
- package/src/components/Switch/Stories/Switch.stories.tsx +27 -0
- package/src/components/Switch/Switch.tsx +9 -3
- package/src/components/Tabs/stories/Tab.stories.tsx +1 -32
- package/src/components/Tabs/stories/Tabs.stories.tsx +1 -39
- package/src/components/Tag/Tag.stories.tsx +1 -9
- package/src/components/TextField/stories/TextArea.stories.tsx +10 -25
- package/src/components/TextField/stories/TextField.stories.tsx +2 -73
- package/src/extensions/react-flow/edges/EdgeDefault.tsx +19 -0
- package/src/extensions/react-flow/edges/stories/EdgeDefault.stories.tsx +121 -0
- package/src/extensions/react-flow/nodes/stories/NodeContent.stories.tsx +1 -1
- package/dist/cjs/cmem/react-flow/configuration/customLabel.js +0 -13
- package/dist/cjs/cmem/react-flow/configuration/customLabel.js.map +0 -1
- package/dist/cjs/cmem/react-flow/configuration/inverseEdge.js +0 -13
- package/dist/cjs/cmem/react-flow/configuration/inverseEdge.js.map +0 -1
- package/dist/esm/cmem/react-flow/configuration/customLabel.js +0 -10
- package/dist/esm/cmem/react-flow/configuration/customLabel.js.map +0 -1
- package/dist/esm/cmem/react-flow/configuration/inverseEdge.js +0 -10
- package/dist/esm/cmem/react-flow/configuration/inverseEdge.js.map +0 -1
- package/dist/types/cmem/react-flow/configuration/customLabel.d.ts +0 -8
- package/dist/types/cmem/react-flow/configuration/inverseEdge.d.ts +0 -8
- package/src/cmem/react-flow/configuration/customLabel.ts +0 -11
- package/src/cmem/react-flow/configuration/inverseEdge.ts +0 -11
|
@@ -5,21 +5,54 @@ export declare type SpinnerSize = "tiny" | "small" | "medium" | "large" | "xlarg
|
|
|
5
5
|
export declare type SpinnerStroke = "thin" | "medium" | "bold";
|
|
6
6
|
declare type Intent = "inherit" | "primary" | "success" | "warning" | "danger";
|
|
7
7
|
/** A spinner that is either displayed globally or locally. */
|
|
8
|
-
export interface SpinnerProps extends
|
|
8
|
+
export interface SpinnerProps extends Omit<BlueprintSpinnerProps, "size"> {
|
|
9
|
+
/**
|
|
10
|
+
* intent value or a valid css color definition
|
|
11
|
+
*/
|
|
9
12
|
color?: Intent | string;
|
|
13
|
+
/**
|
|
14
|
+
* Additional CSS class names.
|
|
15
|
+
*/
|
|
10
16
|
className?: string;
|
|
11
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Position where and how the spinner is displayed:
|
|
19
|
+
* * `local`: the spinner is displayed as centered overlay to the neareast parent with relative (or equivalent) positioning
|
|
20
|
+
* * `inline`: the spinner is displayed as inline element
|
|
21
|
+
* * `global`: the spinner is displayed including backdrop centered over the full viewport
|
|
22
|
+
*/
|
|
12
23
|
position?: SpinnerPosition;
|
|
24
|
+
/**
|
|
25
|
+
* The size of the spinner.
|
|
26
|
+
* The default size relates to the `position`.
|
|
27
|
+
*/
|
|
13
28
|
size?: SpinnerSize;
|
|
29
|
+
/**
|
|
30
|
+
* The stroke width that is used to visualize the spinner.
|
|
31
|
+
* The default size relates to the `position`.
|
|
32
|
+
* There are only rare cases to set this property,
|
|
33
|
+
*/
|
|
14
34
|
stroke?: SpinnerStroke;
|
|
35
|
+
/**
|
|
36
|
+
* Delay when to show the spinner in ms.
|
|
37
|
+
*/
|
|
15
38
|
delay?: number;
|
|
16
39
|
/**
|
|
17
40
|
* Includes a backdrop behind the spinner that narrows visibility of the area behind the spinner.
|
|
18
41
|
* This option only works with "local" spinners, for "inline" spinners there is no backdrop, "global" spinners always have backdrops.
|
|
19
|
-
* The backdrop and the spinner are located over the nearest parent element that is styled by `position: relative` or
|
|
42
|
+
* The backdrop and the spinner are located over the nearest parent element that is styled by `position: relative` or some other CSS rule with an equivalent outcome.
|
|
20
43
|
*/
|
|
21
44
|
showLocalBackdrop?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Use this property to alter the display of the backdrop used for the global spinner
|
|
47
|
+
*/
|
|
48
|
+
overlayProps?: BlueprintOverlayProps;
|
|
49
|
+
/**
|
|
50
|
+
* Label displayed next to the spinner (planned).
|
|
51
|
+
* You can set it to document the purpose of the spinner.
|
|
52
|
+
* It is currently not supported and not displayed.
|
|
53
|
+
*/
|
|
54
|
+
description?: string;
|
|
22
55
|
}
|
|
23
|
-
declare function Spinner({ className, color, description, // currently unsupported (FIXME)
|
|
24
|
-
|
|
56
|
+
declare function Spinner({ className, color, position, size, stroke, showLocalBackdrop, delay, overlayProps, description, // currently unsupported (FIXME):
|
|
57
|
+
...otherProps }: SpinnerProps): JSX.Element | null;
|
|
25
58
|
export default Spinner;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { SwitchProps } from "@blueprintjs/core";
|
|
3
|
-
interface
|
|
2
|
+
import { SwitchProps as BlueprintSwitchProps } from "@blueprintjs/core";
|
|
3
|
+
export interface SwitchProps extends Omit<BlueprintSwitchProps, "onChange"> {
|
|
4
|
+
/**
|
|
5
|
+
* Event handler for changed state.
|
|
6
|
+
*/
|
|
4
7
|
onChange?: (value: boolean) => any;
|
|
5
8
|
}
|
|
6
|
-
declare function Switch({ onChange, ...otherProps }:
|
|
9
|
+
declare function Switch({ onChange, ...otherProps }: SwitchProps): JSX.Element;
|
|
7
10
|
declare const _default: React.MemoExoticComponent<typeof Switch>;
|
|
8
11
|
export default _default;
|
|
@@ -1,13 +1,28 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { EdgeProps as ReactFlowEdgeProps } from "react-flow-renderer/dist/types";
|
|
3
3
|
export interface EdgeDefaultDataProps {
|
|
4
|
+
/**
|
|
5
|
+
* Size of the "glow" effect when the edge is hovered.
|
|
6
|
+
*/
|
|
4
7
|
pathGlowWidth?: number;
|
|
5
8
|
inversePath?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Reference linnk to the SVG marker used for the start of the edge
|
|
11
|
+
*/
|
|
6
12
|
markerStart?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Callback handler that returns a React element used as edge title.
|
|
15
|
+
*/
|
|
7
16
|
renderLabel?: (edgeCenter: [number, number, number, number]) => React.ReactNode;
|
|
8
17
|
}
|
|
9
18
|
export interface EdgeDefaultProps extends ReactFlowEdgeProps {
|
|
19
|
+
/**
|
|
20
|
+
* Defining content and markers for the edge.
|
|
21
|
+
*/
|
|
10
22
|
data?: EdgeDefaultDataProps;
|
|
23
|
+
/**
|
|
24
|
+
* Callback handler that returns a SVG path as string to define how the edge is rendered.
|
|
25
|
+
*/
|
|
11
26
|
drawSvgPath?: (edge: ReactFlowEdgeProps) => string;
|
|
12
27
|
}
|
|
13
28
|
export declare const EdgeDefault: React.MemoExoticComponent<(edge: EdgeDefaultProps) => JSX.Element>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eccenca/gui-elements",
|
|
3
3
|
"description": "GUI elements based on other libraries, usable in React application, written in Typescript.",
|
|
4
|
-
"version": "23.0.0-rc.
|
|
4
|
+
"version": "23.0.0-rc.7",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/eccenca/gui-elements",
|
|
7
7
|
"bugs": "https://github.com/eccenca/gui-elements/issues",
|
|
@@ -116,7 +116,6 @@
|
|
|
116
116
|
"@typescript-eslint/parser": "^4.33.0",
|
|
117
117
|
"babel-jest": "^27.5.1",
|
|
118
118
|
"chromatic": "^6.5.1",
|
|
119
|
-
"css-loader": "3.4.2",
|
|
120
119
|
"eslint": "^7.32.0",
|
|
121
120
|
"eslint-config-react-app": "^6.0.0",
|
|
122
121
|
"identity-obj-proxy": "^3.0.0",
|
|
@@ -131,11 +130,9 @@
|
|
|
131
130
|
"rimraf": "^3.0.2",
|
|
132
131
|
"sass": "^1.53.0",
|
|
133
132
|
"sass-loader": "^10.3.1",
|
|
134
|
-
"style-loader": "0.23.1",
|
|
135
133
|
"ts-node": "^10.9.1",
|
|
136
134
|
"tsc-esm-fix": "^2.13.0",
|
|
137
|
-
"typescript": "4.4.4"
|
|
138
|
-
"webpack": "^4.46.0"
|
|
135
|
+
"typescript": "4.4.4"
|
|
139
136
|
},
|
|
140
137
|
"peerDependencies": {
|
|
141
138
|
"react": ">=16",
|
|
@@ -152,7 +149,8 @@
|
|
|
152
149
|
"**/glob-parent": "^5.1.2",
|
|
153
150
|
"**/trim": "^0.0.3",
|
|
154
151
|
"**/trim-newlines": "^3.0.1",
|
|
155
|
-
"**/minimist": "^1.2.6"
|
|
152
|
+
"**/minimist": "^1.2.6",
|
|
153
|
+
"**/postcss": "^7.0.36"
|
|
156
154
|
},
|
|
157
155
|
"eslintConfig": {
|
|
158
156
|
"extends": [
|
|
@@ -5,10 +5,10 @@ import remarkGfm from "remark-gfm";
|
|
|
5
5
|
import remarkTypograf from "@mavrin/remark-typograf";
|
|
6
6
|
import {remarkDefinitionList} from 'remark-definition-list';
|
|
7
7
|
import React from "react";
|
|
8
|
-
import {
|
|
8
|
+
import {HtmlContentBlock, TestableComponent} from "../../index";
|
|
9
9
|
import { PluggableList } from "react-markdown/lib/react-markdown";
|
|
10
10
|
|
|
11
|
-
export interface MarkdownParserProps {
|
|
11
|
+
export interface MarkdownParserProps extends TestableComponent {
|
|
12
12
|
children: string;
|
|
13
13
|
/**
|
|
14
14
|
* Allow HTML as partial content, otherwise escape HTML tags.
|
|
@@ -65,7 +65,8 @@ export const Markdown = ({
|
|
|
65
65
|
removeMarkup = false,
|
|
66
66
|
inheritBlock = false,
|
|
67
67
|
allowedElements,
|
|
68
|
-
reHypePlugins
|
|
68
|
+
reHypePlugins,
|
|
69
|
+
...otherProps
|
|
69
70
|
}: MarkdownParserProps) => {
|
|
70
71
|
|
|
71
72
|
const configHtml = allowHtml ? {
|
|
@@ -93,7 +94,7 @@ export const Markdown = ({
|
|
|
93
94
|
return inheritBlock ? (
|
|
94
95
|
<ReactMarkdown {...reactMarkdownProperties} />
|
|
95
96
|
) : (
|
|
96
|
-
<HtmlContentBlock>
|
|
97
|
+
<HtmlContentBlock data-test-id={otherProps["data-test-id"]} >
|
|
97
98
|
<ReactMarkdown {...reactMarkdownProperties} />
|
|
98
99
|
</HtmlContentBlock>
|
|
99
100
|
);
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
import React, { useState, useEffect, useCallback, FC } from "react";
|
|
2
2
|
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
-
import { ReactFlow, EdgeTools, NodeTools
|
|
3
|
+
import { ReactFlow, EdgeTools, NodeTools } from "./../../../index";
|
|
4
4
|
import { ReactFlowProps } from "./ReactFlow";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
title: "CMEM/React Flow/Configurations",
|
|
9
|
-
component: ReactFlow,
|
|
10
|
-
argTypes: {
|
|
11
|
-
},
|
|
12
|
-
} as ComponentMeta<typeof ReactFlow>;
|
|
5
|
+
import { Elements, FlowElement } from "react-flow-renderer";
|
|
13
6
|
|
|
14
7
|
const nodeExamples = {
|
|
15
8
|
unspecified: [
|
|
@@ -32,10 +25,10 @@ const nodeExamples = {
|
|
|
32
25
|
position: { x: 200, y: 300 },
|
|
33
26
|
},
|
|
34
27
|
{
|
|
35
|
-
id: 'unspecified-e1', type: 'straight', label: "straight edge", arrowHeadType: "arrowclosed",source: 'unspecified-1', target: 'unspecified-2',
|
|
28
|
+
id: 'unspecified-e1', type: 'straight', label: "straight edge", arrowHeadType: "arrowclosed", source: 'unspecified-1', target: 'unspecified-2',
|
|
36
29
|
},
|
|
37
30
|
{
|
|
38
|
-
id: 'unspecified-e2', type: 'step', label: "step edge", arrowHeadType: "arrowclosed",source: 'unspecified-2', target: 'unspecified-1',
|
|
31
|
+
id: 'unspecified-e2', type: 'step', label: "step edge", arrowHeadType: "arrowclosed", source: 'unspecified-2', target: 'unspecified-1',
|
|
39
32
|
}
|
|
40
33
|
],
|
|
41
34
|
linking: [
|
|
@@ -188,83 +181,19 @@ const nodeExamples = {
|
|
|
188
181
|
{ id: 'graph-e4', type: 'subproperty', label: "subproperty edge", arrowHeadType: "arrowclosed",source: 'graph-4', target: 'graph-5' },
|
|
189
182
|
{ id: 'graph-e5', type: 'rdftype', label: "rdftype edge", arrowHeadType: "arrowclosed",source: 'graph-5', target: 'graph-1' },
|
|
190
183
|
],
|
|
191
|
-
inverseEdge: [
|
|
192
|
-
{
|
|
193
|
-
id: 'inverseEdge-1',
|
|
194
|
-
type: "default",
|
|
195
|
-
data: {
|
|
196
|
-
label: "Default ", content: "Example content.", minimalShape: "none"
|
|
197
|
-
},
|
|
198
|
-
position: { x: 200, y: 50 },
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
id: 'inverseEdge-2',
|
|
202
|
-
type: "default",
|
|
203
|
-
data: {
|
|
204
|
-
label: "Default ", content: "Example content.", minimalShape: "none",
|
|
205
|
-
handles: [ { type: "source", position: "left" }, { type: "target", position: "right" } ],
|
|
206
|
-
inversePath: true,
|
|
207
|
-
},
|
|
208
|
-
position: { x: 200, y: 300 },
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
id: 'inverseEdge-e1', type: 'straight', label: "straight edge", arrowHeadType: "arrowclosed",source: 'inverseEdge-1', target: 'inverseEdge-2',
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
id: 'inverseEdge-e2', type: 'default', label: "inverse edge", source: 'inverseEdge-2', target: 'inverseEdge-1',
|
|
215
|
-
data: {
|
|
216
|
-
markerStart: getMarkerEnd(
|
|
217
|
-
`${ArrowHeadType.ArrowClosed}-inverse` as ArrowHeadType
|
|
218
|
-
),
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
],
|
|
222
|
-
customLabel: [
|
|
223
|
-
{
|
|
224
|
-
id: 'customLabel-1',
|
|
225
|
-
type: "default",
|
|
226
|
-
data: {
|
|
227
|
-
label: "Default ", content: "Example content.", minimalShape: "none"
|
|
228
|
-
},
|
|
229
|
-
position: { x: 200, y: 50 },
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
id: 'customLabel-2',
|
|
233
|
-
type: "default",
|
|
234
|
-
data: {
|
|
235
|
-
label: "Default ", content: "Example content.", minimalShape: "none",
|
|
236
|
-
handles: [ { type: "source", position: "left" }, { type: "target", position: "right" } ],
|
|
237
|
-
inversePath: true,
|
|
238
|
-
},
|
|
239
|
-
position: { x: 200, y: 300 },
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
id: 'customLabel-e1', type: 'straight', label: "straight edge", arrowHeadType: "arrowclosed", source: 'customLabel-1', target: 'customLabel-2',
|
|
243
|
-
},
|
|
244
|
-
{
|
|
245
|
-
id: 'customLabel-e2', type: 'default', label: "custom edge", arrowHeadType: "arrowclosed", source: 'customLabel-2', target: 'customLabel-1',
|
|
246
|
-
data: {
|
|
247
|
-
renderLabel: (
|
|
248
|
-
edgeCenter: [number, number, number, number]
|
|
249
|
-
) => (
|
|
250
|
-
<foreignObject
|
|
251
|
-
width={30}
|
|
252
|
-
height={30}
|
|
253
|
-
x={edgeCenter[0] - 15}
|
|
254
|
-
y={edgeCenter[1] - 15}
|
|
255
|
-
className="instance-viz-multiedge"
|
|
256
|
-
requiredExtensions="http://www.w3.org/1999/xhtml"
|
|
257
|
-
>
|
|
258
|
-
<body>
|
|
259
|
-
<IconButton name="navigation-close" />
|
|
260
|
-
</body>
|
|
261
|
-
</foreignObject>
|
|
262
|
-
)
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
]
|
|
266
184
|
}
|
|
267
185
|
|
|
186
|
+
export default {
|
|
187
|
+
title: "CMEM/React Flow/Configurations",
|
|
188
|
+
component: ReactFlow,
|
|
189
|
+
argTypes: {
|
|
190
|
+
configuration: {
|
|
191
|
+
control: "select",
|
|
192
|
+
options: Object.keys(nodeExamples),
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
} as ComponentMeta<typeof ReactFlow>;
|
|
196
|
+
|
|
268
197
|
const ReactFlowExample: FC<ReactFlowProps> = (args) => {
|
|
269
198
|
const [reactflowInstance, setReactflowInstance] = useState(null);
|
|
270
199
|
const [elements, setElements] = useState([] as Elements);
|
|
@@ -5,14 +5,12 @@ import * as unspecifiedConfig from "./../configuration/unspecified";
|
|
|
5
5
|
import * as graphConfig from "./../configuration/graph";
|
|
6
6
|
import * as workflowConfig from "./../configuration/workflow";
|
|
7
7
|
import * as linkingConfig from "./../configuration/linking";
|
|
8
|
-
import * as inverseEdgeConfig from "./../configuration/inverseEdge";
|
|
9
|
-
import * as customLabelConfig from "./../configuration/customLabel";
|
|
10
8
|
|
|
11
9
|
export interface ReactFlowProps extends ReactFlowOriginalProps {
|
|
12
10
|
/**
|
|
13
11
|
* Load `ReactFlow` component with pre-configured values for `nodeTypes` and `edgeTypes`
|
|
14
12
|
*/
|
|
15
|
-
configuration?: "unspecified" | "graph" | "workflow" | "linking"
|
|
13
|
+
configuration?: "unspecified" | "graph" | "workflow" | "linking";
|
|
16
14
|
}
|
|
17
15
|
|
|
18
16
|
/**
|
|
@@ -31,8 +29,6 @@ export const ReactFlow = React.forwardRef<HTMLDivElement, ReactFlowProps>((
|
|
|
31
29
|
graph: graphConfig,
|
|
32
30
|
workflow: workflowConfig,
|
|
33
31
|
linking: linkingConfig,
|
|
34
|
-
inverseEdge: inverseEdgeConfig,
|
|
35
|
-
customLabel: customLabelConfig,
|
|
36
32
|
}
|
|
37
33
|
|
|
38
34
|
return (
|
|
@@ -1,10 +1,40 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Accordion as CarbonAccordion,
|
|
4
|
+
AccordionProps as CarbonAccordionProps,
|
|
5
|
+
} from "carbon-components-react";
|
|
3
6
|
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
export interface AccordionProps extends Omit<CarbonAccordionProps, "className" | "size"> {
|
|
9
|
+
/**
|
|
10
|
+
* Additional CSS classes.
|
|
11
|
+
*/
|
|
12
|
+
className?: string;
|
|
13
|
+
/**
|
|
14
|
+
* How much space is used for the header of the each of the accordion items.
|
|
15
|
+
*/
|
|
16
|
+
size?: "small" | "medium" | "large";
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const carbonAccordionSizeMapping = {
|
|
20
|
+
"small": "sm" as "sm",
|
|
21
|
+
"medium": "md" as "md",
|
|
22
|
+
"large": "lg" as "lg"
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function Accordion({
|
|
26
|
+
children,
|
|
27
|
+
className = "",
|
|
28
|
+
align = "start",
|
|
29
|
+
size = "medium",
|
|
30
|
+
...otherProps
|
|
31
|
+
}: AccordionProps) {
|
|
6
32
|
return (
|
|
7
|
-
<CarbonAccordion
|
|
33
|
+
<CarbonAccordion
|
|
34
|
+
className={`${eccgui}-accordion__container ` + className}
|
|
35
|
+
align={align}
|
|
36
|
+
size={carbonAccordionSizeMapping[size]}
|
|
37
|
+
{...otherProps}>
|
|
8
38
|
{children}
|
|
9
39
|
</CarbonAccordion>
|
|
10
40
|
);
|
|
@@ -1,45 +1,35 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
AccordionItem as CarbonAccordionItem,
|
|
4
|
+
AccordionItemProps as CarbonAccordionItemProps,
|
|
5
|
+
} from "carbon-components-react";
|
|
3
6
|
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
4
7
|
|
|
5
|
-
export interface AccordionItemProps extends
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
export interface AccordionItemProps extends Omit<CarbonAccordionItemProps, "title" | "iconDescription" | "renderExpando"> {
|
|
9
|
+
/**
|
|
10
|
+
* additional user class name
|
|
11
|
+
*/
|
|
9
12
|
className?: string;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
children: string | JSX.Element | JSX.Element[];
|
|
14
|
-
/*
|
|
15
|
-
disable accordion item
|
|
16
|
-
*/
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
/*
|
|
19
|
-
set accordion item expliciteky as open when displayed first
|
|
20
|
-
*/
|
|
21
|
-
open?: boolean;
|
|
22
|
-
/*
|
|
23
|
-
header of accordion item
|
|
24
|
-
*/
|
|
13
|
+
/**
|
|
14
|
+
* header of accordion item
|
|
15
|
+
*/
|
|
25
16
|
label: string | JSX.Element;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
/**
|
|
18
|
+
* use full available width for content
|
|
19
|
+
*/
|
|
29
20
|
fullWidth?: boolean;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
/**
|
|
22
|
+
* minimize white space and paddings
|
|
23
|
+
*/
|
|
33
24
|
condensed?: boolean;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
25
|
+
/**
|
|
26
|
+
* do not use borders as visible separations on accordion item
|
|
27
|
+
*/
|
|
37
28
|
noBorder?: boolean;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
29
|
+
/**
|
|
30
|
+
* highlight accordion item by different background color
|
|
31
|
+
*/
|
|
41
32
|
elevated?: boolean;
|
|
42
|
-
title?: never;
|
|
43
33
|
};
|
|
44
34
|
|
|
45
35
|
function AccordionItem({
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
+
import { Accordion, AccordionItem } from "../../../../index";
|
|
4
|
+
import { Default as AccordionStoryItem } from '../Stories/AccordionItem.stories'
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Components/Accordion",
|
|
8
|
+
component: Accordion,
|
|
9
|
+
subcomponents: { AccordionItem },
|
|
10
|
+
argTypes: {
|
|
11
|
+
children: {
|
|
12
|
+
control: "none",
|
|
13
|
+
description: "Elements to include into the Accordion component"
|
|
14
|
+
},
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
} as ComponentMeta<typeof Accordion>;
|
|
18
|
+
|
|
19
|
+
const TemplateIcons: ComponentStory<typeof Accordion> = (args) => (
|
|
20
|
+
<Accordion {...args} />
|
|
21
|
+
);
|
|
22
|
+
export const Default = TemplateIcons.bind({});
|
|
23
|
+
Default.args = {
|
|
24
|
+
children : [
|
|
25
|
+
<AccordionItem {...AccordionStoryItem.args} label="Accordion item 1" />,
|
|
26
|
+
<AccordionItem {...AccordionStoryItem.args} label="Accordion item 2 (elevated)" elevated />,
|
|
27
|
+
<AccordionItem {...AccordionStoryItem.args} label="Accordion item 3 (initially opened)" open />,
|
|
28
|
+
<AccordionItem {...AccordionStoryItem.args} label="Accordion item 4 (disabled)" disabled />,
|
|
29
|
+
<AccordionItem {...AccordionStoryItem.args} label="Accordion item 5" />,
|
|
30
|
+
],
|
|
31
|
+
align: "start",
|
|
32
|
+
size: "medium"
|
|
33
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
+
import { Accordion, AccordionItem, HtmlContentBlock } from "../../../../index";
|
|
4
|
+
import { LoremIpsum } from 'react-lorem-ipsum';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Components/Accordion/AccordionItem",
|
|
8
|
+
component: AccordionItem,
|
|
9
|
+
argTypes: {
|
|
10
|
+
children: {
|
|
11
|
+
control: "none",
|
|
12
|
+
description: "content of accordion item"
|
|
13
|
+
},
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
} as ComponentMeta<typeof AccordionItem>;
|
|
17
|
+
|
|
18
|
+
const Template : ComponentStory<typeof AccordionItem> = (args) => (
|
|
19
|
+
<Accordion>
|
|
20
|
+
<AccordionItem {...args} />
|
|
21
|
+
</Accordion>
|
|
22
|
+
);
|
|
23
|
+
export const Default = Template.bind({});
|
|
24
|
+
Default.args = {
|
|
25
|
+
label: "Title of accordion item",
|
|
26
|
+
children : <HtmlContentBlock><LoremIpsum p={2} avgSentencesPerParagraph={4} random={false} /></HtmlContentBlock>
|
|
27
|
+
};
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
// own vars
|
|
2
|
+
$eccgui-color-accordion-background-elevated: rgba($eccgui-color-accent, 0.1) !default;
|
|
3
|
+
$eccgui-color-accordion-toggler-hover: $menu-item-color-hover !default;
|
|
4
|
+
$eccgui-color-accordion-toggler-elevated-hover: mix($eccgui-color-accordion-background-elevated, $eccgui-color-accordion-toggler-hover, 50%) !default;
|
|
5
|
+
|
|
1
6
|
// lib import
|
|
2
7
|
@import "~carbon-components/scss/components/accordion/accordion";
|
|
3
8
|
|
|
@@ -57,8 +62,22 @@
|
|
|
57
62
|
}
|
|
58
63
|
}
|
|
59
64
|
|
|
65
|
+
.#{$prefix}--accordion__heading {
|
|
66
|
+
&:hover::before,
|
|
67
|
+
&:focus::before {
|
|
68
|
+
background-color: $eccgui-color-accordion-toggler-hover;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
60
72
|
.#{$eccgui}-accordion__item--elevated {
|
|
61
|
-
background-color: $
|
|
73
|
+
background-color: $eccgui-color-accordion-background-elevated;
|
|
74
|
+
|
|
75
|
+
.#{$prefix}--accordion__heading {
|
|
76
|
+
&:hover::before,
|
|
77
|
+
&:focus::before {
|
|
78
|
+
background-color: $eccgui-color-accordion-toggler-elevated-hover;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
62
81
|
}
|
|
63
82
|
|
|
64
83
|
.#{$eccgui}-accordion__item--noborder {
|