@eccenca/gui-elements 22.1.0-rc.0 → 22.1.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js +13 -9
  3. package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
  4. package/dist/cjs/cmem/ActivityControl/ActivityExecutionErrorReportModal.js +23 -6
  5. package/dist/cjs/cmem/ActivityControl/ActivityExecutionErrorReportModal.js.map +1 -1
  6. package/dist/cjs/cmem/ActivityControl/SilkActivityControl.js +1 -1
  7. package/dist/cjs/cmem/ActivityControl/SilkActivityControl.js.map +1 -1
  8. package/dist/cjs/cmem/react-flow/configuration/_colors-linking.module.scss +1 -1
  9. package/dist/cjs/common/utils/stringUtils.js +7 -0
  10. package/dist/cjs/common/utils/stringUtils.js.map +1 -0
  11. package/dist/cjs/components/Application/ApplicationContent.js +1 -7
  12. package/dist/cjs/components/Application/ApplicationContent.js.map +1 -1
  13. package/dist/cjs/components/Application/ApplicationTitle.js +1 -7
  14. package/dist/cjs/components/Application/ApplicationTitle.js.map +1 -1
  15. package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js +0 -1
  16. package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
  17. package/dist/cjs/components/AutocompleteField/AutoCompleteField.js +5 -4
  18. package/dist/cjs/components/AutocompleteField/AutoCompleteField.js.map +1 -1
  19. package/dist/cjs/components/Breadcrumb/BreadcrumbItem.js +1 -1
  20. package/dist/cjs/components/Button/Button.js +1 -1
  21. package/dist/cjs/components/Button/Button.js.map +1 -1
  22. package/dist/cjs/components/Card/Card.js +18 -3
  23. package/dist/cjs/components/Card/Card.js.map +1 -1
  24. package/dist/cjs/components/Form/FieldItemRow.js +2 -3
  25. package/dist/cjs/components/Form/FieldItemRow.js.map +1 -1
  26. package/dist/cjs/components/MultiSelect/MultiSelect.js +34 -41
  27. package/dist/cjs/components/MultiSelect/MultiSelect.js.map +1 -1
  28. package/dist/cjs/components/Notification/Notification.js +8 -2
  29. package/dist/cjs/components/Notification/Notification.js.map +1 -1
  30. package/dist/cjs/components/OverviewItem/OverviewItemList.js +1 -1
  31. package/dist/cjs/components/OverviewItem/OverviewItemList.js.map +1 -1
  32. package/dist/cjs/components/Spinner/Spinner.js +1 -1
  33. package/dist/cjs/components/Spinner/Spinner.js.map +1 -1
  34. package/dist/cjs/components/Tabs/Tab.js +1 -2
  35. package/dist/cjs/components/Tabs/Tab.js.map +1 -1
  36. package/dist/cjs/components/Tabs/Tabs.js +1 -4
  37. package/dist/cjs/components/Tabs/Tabs.js.map +1 -1
  38. package/dist/cjs/components/Typography/HtmlContentBlock.js +6 -6
  39. package/dist/cjs/components/Typography/HtmlContentBlock.js.map +1 -1
  40. package/dist/cjs/components/Typography/classnames.js +2 -1
  41. package/dist/cjs/components/Typography/classnames.js.map +1 -1
  42. package/dist/cjs/extensions/react-flow/edges/EdgeDefault.js.map +1 -1
  43. package/dist/cjs/extensions/react-flow/edges/getSmoothStepPath.js +98 -0
  44. package/dist/cjs/extensions/react-flow/edges/getSmoothStepPath.js.map +1 -0
  45. package/dist/cjs/extensions/react-flow/edges/utils.js +21 -20
  46. package/dist/cjs/extensions/react-flow/edges/utils.js.map +1 -1
  47. package/dist/cjs/extensions/react-flow/nodes/NodeContent.js +6 -4
  48. package/dist/cjs/extensions/react-flow/nodes/NodeContent.js.map +1 -1
  49. package/dist/cjs/extensions/react-flow/nodes/NodeContentExtension.js +3 -2
  50. package/dist/cjs/extensions/react-flow/nodes/NodeContentExtension.js.map +1 -1
  51. package/dist/cjs/extensions/react-flow/nodes/NodeTools.js +11 -9
  52. package/dist/cjs/extensions/react-flow/nodes/NodeTools.js.map +1 -1
  53. package/dist/es5/cmem/ActivityControl/ActivityControlWidget.js +14 -10
  54. package/dist/es5/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
  55. package/dist/es5/cmem/ActivityControl/ActivityExecutionErrorReportModal.js +21 -4
  56. package/dist/es5/cmem/ActivityControl/ActivityExecutionErrorReportModal.js.map +1 -1
  57. package/dist/es5/cmem/ActivityControl/SilkActivityControl.js +1 -1
  58. package/dist/es5/cmem/ActivityControl/SilkActivityControl.js.map +1 -1
  59. package/dist/es5/cmem/react-flow/configuration/_colors-linking.module.scss +1 -1
  60. package/dist/es5/common/utils/stringUtils.js +3 -0
  61. package/dist/es5/common/utils/stringUtils.js.map +1 -0
  62. package/dist/es5/components/Application/ApplicationContent.js +1 -7
  63. package/dist/es5/components/Application/ApplicationContent.js.map +1 -1
  64. package/dist/es5/components/Application/ApplicationTitle.js +1 -7
  65. package/dist/es5/components/Application/ApplicationTitle.js.map +1 -1
  66. package/dist/es5/components/AutoSuggestion/AutoSuggestion.js +0 -1
  67. package/dist/es5/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
  68. package/dist/es5/components/AutocompleteField/AutoCompleteField.js +5 -4
  69. package/dist/es5/components/AutocompleteField/AutoCompleteField.js.map +1 -1
  70. package/dist/es5/components/Breadcrumb/BreadcrumbItem.js +1 -1
  71. package/dist/es5/components/Button/Button.js +1 -1
  72. package/dist/es5/components/Button/Button.js.map +1 -1
  73. package/dist/es5/components/Card/Card.js +18 -3
  74. package/dist/es5/components/Card/Card.js.map +1 -1
  75. package/dist/es5/components/Form/FieldItemRow.js +2 -3
  76. package/dist/es5/components/Form/FieldItemRow.js.map +1 -1
  77. package/dist/es5/components/MultiSelect/MultiSelect.js +40 -51
  78. package/dist/es5/components/MultiSelect/MultiSelect.js.map +1 -1
  79. package/dist/es5/components/Notification/Notification.js +10 -3
  80. package/dist/es5/components/Notification/Notification.js.map +1 -1
  81. package/dist/es5/components/OverviewItem/OverviewItemList.js +1 -1
  82. package/dist/es5/components/OverviewItem/OverviewItemList.js.map +1 -1
  83. package/dist/es5/components/Spinner/Spinner.js +2 -2
  84. package/dist/es5/components/Spinner/Spinner.js.map +1 -1
  85. package/dist/es5/components/Tabs/Tab.js +1 -2
  86. package/dist/es5/components/Tabs/Tab.js.map +1 -1
  87. package/dist/es5/components/Tabs/Tabs.js +1 -4
  88. package/dist/es5/components/Tabs/Tabs.js.map +1 -1
  89. package/dist/es5/components/Typography/HtmlContentBlock.js +17 -8
  90. package/dist/es5/components/Typography/HtmlContentBlock.js.map +1 -1
  91. package/dist/es5/components/Typography/classnames.js +1 -0
  92. package/dist/es5/components/Typography/classnames.js.map +1 -1
  93. package/dist/es5/extensions/react-flow/edges/EdgeDefault.js.map +1 -1
  94. package/dist/es5/extensions/react-flow/edges/getSmoothStepPath.js +119 -0
  95. package/dist/es5/extensions/react-flow/edges/getSmoothStepPath.js.map +1 -0
  96. package/dist/es5/extensions/react-flow/edges/utils.js +21 -20
  97. package/dist/es5/extensions/react-flow/edges/utils.js.map +1 -1
  98. package/dist/es5/extensions/react-flow/nodes/NodeContent.js +7 -5
  99. package/dist/es5/extensions/react-flow/nodes/NodeContent.js.map +1 -1
  100. package/dist/es5/extensions/react-flow/nodes/NodeContentExtension.js +3 -2
  101. package/dist/es5/extensions/react-flow/nodes/NodeContentExtension.js.map +1 -1
  102. package/dist/es5/extensions/react-flow/nodes/NodeTools.js +12 -10
  103. package/dist/es5/extensions/react-flow/nodes/NodeTools.js.map +1 -1
  104. package/dist/es5/index.js +1 -3
  105. package/dist/es5/index.js.map +1 -1
  106. package/dist/types/cmem/ActivityControl/ActivityControlWidget.d.ts +9 -0
  107. package/dist/types/cmem/ActivityControl/SilkActivityControl.d.ts +2 -0
  108. package/dist/types/common/utils/stringUtils.d.ts +2 -0
  109. package/dist/types/components/Card/Card.d.ts +9 -4
  110. package/dist/types/components/Form/FieldItemRow.d.ts +1 -0
  111. package/dist/types/components/MultiSelect/MultiSelect.d.ts +16 -9
  112. package/dist/types/components/Notification/Notification.d.ts +55 -2
  113. package/dist/types/components/OverviewItem/OverviewItemList.d.ts +1 -1
  114. package/dist/types/components/Spinner/Spinner.d.ts +1 -1
  115. package/dist/types/components/Typography/HtmlContentBlock.d.ts +15 -5
  116. package/dist/types/components/Typography/classnames.d.ts +1 -0
  117. package/dist/types/extensions/react-flow/edges/getSmoothStepPath.d.ts +18 -0
  118. package/dist/types/extensions/react-flow/nodes/NodeContent.d.ts +8 -2
  119. package/dist/types/extensions/react-flow/nodes/NodeContentExtension.d.ts +5 -1
  120. package/dist/types/extensions/react-flow/nodes/NodeTools.d.ts +7 -1
  121. package/dist/types/index.d.ts +1 -3
  122. package/package.json +22 -13
  123. package/src/cmem/ActivityControl/ActivityControlWidget.stories.tsx +6 -6
  124. package/src/cmem/ActivityControl/ActivityControlWidget.tsx +27 -14
  125. package/src/cmem/ActivityControl/ActivityExecutionErrorReportModal.tsx +11 -3
  126. package/src/cmem/ActivityControl/SilkActivityControl.tsx +5 -1
  127. package/src/cmem/react-flow/_nodes.scss +12 -6
  128. package/src/cmem/react-flow/configuration/_colors-linking.module.scss +1 -1
  129. package/src/common/utils/stringUtils.ts +2 -0
  130. package/src/components/Application/ApplicationContent.tsx +0 -5
  131. package/src/components/Application/ApplicationTitle.tsx +0 -5
  132. package/src/components/AutoSuggestion/AutoSuggestion.tsx +0 -1
  133. package/src/components/AutocompleteField/AutoCompleteField.tsx +5 -4
  134. package/src/components/Breadcrumb/BreadcrumbItem.tsx +5 -5
  135. package/src/components/Breadcrumb/BreadcrumbList.tsx +1 -1
  136. package/src/components/Button/Button.stories.tsx +1 -1
  137. package/src/components/Button/Button.tsx +1 -1
  138. package/src/components/Card/Card.tsx +23 -4
  139. package/src/components/Card/card.scss +4 -0
  140. package/src/components/Checkbox/checkbox.scss +4 -0
  141. package/src/components/Form/FieldItem.tsx +3 -3
  142. package/src/components/Form/FieldItemRow.tsx +2 -4
  143. package/src/components/Icon/IconButton.tsx +2 -2
  144. package/src/components/Menu/MenuItem.tsx +1 -1
  145. package/src/components/MultiSelect/MultiSelect.stories.tsx +15 -7
  146. package/src/components/MultiSelect/MultiSelect.tsx +63 -60
  147. package/src/components/Notification/Notification.stories.tsx +82 -0
  148. package/src/components/Notification/Notification.tsx +62 -4
  149. package/src/components/Notification/notification.scss +2 -1
  150. package/src/components/OverviewItem/OverviewItemList.tsx +2 -2
  151. package/src/components/RadioButton/radiobutton.scss +4 -0
  152. package/src/components/Spinner/Spinner.tsx +1 -1
  153. package/src/components/Switch/switch.scss +1 -0
  154. package/src/components/Tabs/Tab.tsx +1 -2
  155. package/src/components/Tabs/Tabs.tsx +1 -5
  156. package/src/components/Tabs/stories/Tabs.stories.tsx +3 -3
  157. package/src/components/Tag/tag.scss +1 -1
  158. package/src/components/Toolbar/toolbar.scss +1 -1
  159. package/src/components/Typography/HtmlContentBlock.tsx +27 -4
  160. package/src/components/Typography/classnames.ts +1 -0
  161. package/src/components/Typography/typography.scss +8 -0
  162. package/src/extensions/react-flow/_react-flow.scss +4 -0
  163. package/src/extensions/react-flow/edges/EdgeDefault.tsx +0 -1
  164. package/src/extensions/react-flow/edges/getSmoothStepPath.ts +118 -0
  165. package/src/extensions/react-flow/edges/utils.ts +21 -29
  166. package/src/extensions/react-flow/nodes/NodeContent.tsx +13 -7
  167. package/src/extensions/react-flow/nodes/NodeContentExtension.tsx +6 -0
  168. package/src/extensions/react-flow/nodes/NodeTools.tsx +25 -9
  169. package/src/extensions/react-flow/nodes/_nodes.scss +31 -12
  170. package/src/extensions/react-flow/nodes/stories/NodeContent.stories.tsx +10 -1
  171. package/src/extensions/react-flow/nodes/stories/NodeContentExtension.stories.tsx +23 -0
  172. package/src/index.ts +3 -3
@@ -0,0 +1,82 @@
1
+ import React from "react";
2
+ import { ComponentStory, ComponentMeta } from "@storybook/react";
3
+ import { LoremIpsum } from 'react-lorem-ipsum';
4
+
5
+ import Notification from "./Notification";
6
+ import HtmlContentBlock from "./../Typography/HtmlContentBlock";
7
+ import Button from "./../Button/Button";
8
+ import Spacing from "./../Separation/Spacing";
9
+
10
+ export default {
11
+ title: "Components/Notification",
12
+ component: Notification,
13
+ argTypes: {
14
+ className: {
15
+ description: "A space-delimited list of class names.",
16
+ control: "text",
17
+ table: {
18
+ defaultValue: { summary: undefined },
19
+ type: { summary: "string" },
20
+ }
21
+ },
22
+ onDismiss: {
23
+ description: "Callback invoked when the toast is dismissed, either by the user or by the timeout.",
24
+ control: "none",
25
+ table: {
26
+ defaultValue: { summary: undefined },
27
+ type: { summary: "(didTimeoutExpire: boolean) => void" },
28
+ }
29
+ },
30
+ timeout: {
31
+ description: "Milliseconds to wait before automatically dismissing toast. Providing a value less than or equal to 0 will disable the timeout.",
32
+ control: "number",
33
+ table: {
34
+ defaultValue: { summary: 0 },
35
+ type: { summary: "number" },
36
+ }
37
+ },
38
+ message: {
39
+ control: "none",
40
+ },
41
+ },
42
+ } as ComponentMeta<typeof Notification>;
43
+
44
+ const TemplateFull: ComponentStory<typeof Notification> = (args) => (
45
+ <Notification {...args} />
46
+ );
47
+
48
+ export const ExampleWithMessage = TemplateFull.bind({});
49
+ ExampleWithMessage.args = {
50
+ message: <LoremIpsum p={1} avgSentencesPerParagraph={2} random={false} />,
51
+ onDismiss: false, // workaround for undefined function in Storybook
52
+ };
53
+
54
+ export const ExampleWithChildren = TemplateFull.bind({});
55
+ ExampleWithChildren.args = {
56
+ children: (
57
+ <HtmlContentBlock>
58
+ <LoremIpsum p={1} avgSentencesPerParagraph={1} random={false} />
59
+ <LoremIpsum p={1} avgSentencesPerParagraph={4} random={false} />
60
+ </HtmlContentBlock>
61
+ ),
62
+ onDismiss: false, // workaround for undefined function in Storybook
63
+ };
64
+
65
+ export const ExampleNeutralMessage = TemplateFull.bind({});
66
+ ExampleNeutralMessage.args = {
67
+ message: <LoremIpsum p={1} avgSentencesPerParagraph={2} random={false} />,
68
+ onDismiss: false, // workaround for undefined function in Storybook
69
+ neutral: true,
70
+ };
71
+
72
+ export const ExampleWithActions = TemplateFull.bind({});
73
+ ExampleWithActions.args = {
74
+ message: <LoremIpsum p={1} avgSentencesPerParagraph={2} random={false} />,
75
+ onDismiss: false, // workaround for undefined function in Storybook
76
+ danger: true,
77
+ actions: [
78
+ <Button text="Something" key="b1" />,
79
+ <Spacing size="tiny" vertical />,
80
+ <Button text="Important" hasStateDanger key="b2" />
81
+ ]
82
+ };
@@ -1,9 +1,65 @@
1
1
  import React from "react";
2
- import { Toast as BlueprintToast, Classes as BlueprintClassNames } from "@blueprintjs/core";
2
+ import {
3
+ Toast as BlueprintToast,
4
+ ToastProps as BlueprintToastProps,
5
+ Classes as BlueprintClassNames,
6
+ } from "@blueprintjs/core";
3
7
  import { CLASSPREFIX as eccgui } from "../../configuration/constants";
4
8
  import {ClassNames as IntentClassNames} from "../../common/Intent";
5
9
  import Icon from "./../Icon/Icon";
10
+ import { ValidIconName } from "./../Icon/canonicalIconNames";
6
11
 
12
+ export interface NotificationProps extends Omit<BlueprintToastProps, "message" | "action" | "icon" | "intent">, React.HTMLAttributes<HTMLDivElement> {
13
+ /**
14
+ * Extra user action elements
15
+ */
16
+ actions?: JSX.Element | JSX.Element[];
17
+ /**
18
+ * Notification message that can be used as alternative to children elements.
19
+ */
20
+ message?: JSX.Element | string;
21
+ /**
22
+ * Notification has a neutral color scheme.
23
+ */
24
+ neutral?: boolean;
25
+ /**
26
+ * Notification is a success info.
27
+ * This defines the colorization and the icon symbol.
28
+ */
29
+ success?: boolean;
30
+ /**
31
+ * Notification is a warning alert.
32
+ * This defines the colorization and the icon symbol.
33
+ */
34
+ warning?: boolean;
35
+ /**
36
+ * Notification is a danger alert.
37
+ * This defines the colorization and the icon symbol.
38
+ */
39
+ danger?: boolean;
40
+ /**
41
+ * Notification uses the the given space more flexible.
42
+ * Depracation notice: Property name will removed in futire versions.
43
+ * Please use `flexWidth`.
44
+ * @depracted
45
+ */
46
+ fullWidth?: boolean;
47
+ /**
48
+ * Notification uses the the given space more flexible.
49
+ * Default notifcation is displayed in min and max limits.
50
+ * Those limits are removed by setting this property to `true`.
51
+ */
52
+ flexWidth?: boolean;
53
+ /**
54
+ * Icon used as depiction that is displayed with the notification.
55
+ */
56
+ iconName?: ValidIconName;
57
+ }
58
+
59
+ /**
60
+ * Displays a notification message, optionally combined with depiction and further action buttons.
61
+ * By default it uses colorization of an blueish info alert.
62
+ */
7
63
  function Notification({
8
64
  actions,
9
65
  children,
@@ -13,11 +69,12 @@ function Notification({
13
69
  warning = false,
14
70
  danger = false,
15
71
  neutral = false,
16
- fullWidth = false,
72
+ fullWidth = false, // deprecated
73
+ flexWidth = false,
17
74
  iconName = "state-info",
18
75
  timeout,
19
76
  ...otherProps
20
- }: any) {
77
+ }: NotificationProps) {
21
78
  let intentLevel: string = IntentClassNames.INFO;
22
79
  let iconSymbol = iconName;
23
80
  switch (true) {
@@ -55,7 +112,8 @@ function Notification({
55
112
  `${eccgui}-notification ` +
56
113
  intentLevel +
57
114
  (className ? ` ${className}` : "") +
58
- (fullWidth ? ` ${eccgui}-notification--fullwidth` : "") +
115
+ (fullWidth ? ` ${eccgui}-notification--fullwidth` : "") + // deprecated
116
+ (flexWidth ? ` ${eccgui}-notification--flexwidth` : "") +
59
117
  (otherProps.onDismiss ? "" : ` ${eccgui}-notification--static`)
60
118
  }
61
119
  message={content}
@@ -55,6 +55,7 @@
55
55
  }
56
56
  }
57
57
 
58
+ .#{$eccgui}-notification--flexwidth,
58
59
  .#{$eccgui}-notification--fullwidth {
59
60
  min-width: 0;
60
61
  max-width: none;
@@ -77,7 +78,7 @@
77
78
  flex-grow: 0;
78
79
  flex-shrink: 0;
79
80
 
80
- .#{$ns}-button {
81
+ .#{$ns}-button:not([class*="intent"]) {
81
82
  color: inherit;
82
83
  }
83
84
  }
@@ -18,7 +18,7 @@ export interface OverviewItemListProps extends React.HTMLAttributes<HTMLOListEle
18
18
  * Use multiple columns.
19
19
  * Currently only lists using 1 and 2 columns are supported.
20
20
  */
21
- columns?: number;
21
+ columns?: 1 | 2;
22
22
  }
23
23
 
24
24
  /**
@@ -42,7 +42,7 @@ function OverviewItemList({
42
42
  (densityHigh ? `${eccgui}-overviewitem__list--highdensity ` : '') +
43
43
  (hasDivider ? `${eccgui}-overviewitem__list--hasdivider ` : '') +
44
44
  (hasSpacing ? `${eccgui}-overviewitem__list--hasspacing ` : '') +
45
- (columns > 1 ? `${eccgui}-overviewitem__list--hascolumns ` : '') + // TODO: add number
45
+ (columns > 1 ? `${eccgui}-overviewitem__list--hascolumns ` : '') + // FIXME: Support numbers > 2
46
46
  className
47
47
  }
48
48
  >
@@ -7,6 +7,10 @@
7
7
  box-shadow: none;
8
8
  }
9
9
 
10
+ input:focus ~ .#{$ns}-control-indicator {
11
+ outline-offset: 1px;
12
+ }
13
+
10
14
  input:disabled ~ .#{$ns}-control-indicator,
11
15
  input:disabled:checked ~ .#{$ns}-control-indicator
12
16
  {
@@ -28,7 +28,7 @@ export interface SpinnerProps extends Partial<BlueprintOverlayProps & Omit<Bluep
28
28
  function Spinner({
29
29
  className = "",
30
30
  color = "inherit",
31
- description = "Loading indicator", // currently unsupported (TODO)
31
+ description = "Loading indicator", // currently unsupported (FIXME)
32
32
  position = "local",
33
33
  size,
34
34
  stroke,
@@ -2,3 +2,4 @@
2
2
  currently not used, we need to control switch layout in
3
3
  ../Checkbox/checkbox.scss for now
4
4
  */
5
+ // FIXME: scss styles
@@ -62,7 +62,7 @@ export const transformTabProperties = ({
62
62
 
63
63
  /*
64
64
 
65
- TODO: Try to overload the original Tab element. Currently it does not work
65
+ NOTE: Try to overload the original Tab element. Currently it does not work.
66
66
  (at least inside Storybook) because the set displayName is overwritten and
67
67
  Blueprints Tabs integration cannot match the new Tab element correctly by
68
68
  checking the displayName.
@@ -105,7 +105,6 @@ class Tab extends AbstractPureComponent2<TabProps> {
105
105
  }
106
106
 
107
107
  //*
108
- console.log(Tab.displayName);
109
108
  export default Tab;
110
109
  //*/
111
110
 
@@ -29,8 +29,6 @@ function Tabs(
29
29
  ...restProps
30
30
  }: TabsProps) {
31
31
 
32
- // TODO React.Children.toArray(children).forEach((e) => {console.log(e)});
33
-
34
32
  return (
35
33
  <BlueprintTabs
36
34
  className={
@@ -43,9 +41,7 @@ function Tabs(
43
41
  >
44
42
  {!!tabs ? (
45
43
  tabs.map(tab => {
46
- const e = <Tab {...transformTabProperties(tab)} />;
47
- // TODO console.log(e);
48
- return e;
44
+ return <Tab {...transformTabProperties(tab)} />;
49
45
  })
50
46
  ) : (
51
47
  children
@@ -22,8 +22,8 @@ export default {
22
22
  }
23
23
  },
24
24
  /*
25
- TODO: we currently cannot support tis because Blueprint set then !important
26
- styles preventig tab background colors.
25
+ NOTE: we currently cannot support this because Blueprint set then !important
26
+ styles prevent tab background colors.
27
27
 
28
28
  animate: {
29
29
  description: "Whether the selected tab indicator should animate its movement.",
@@ -87,7 +87,7 @@ TabsContainerUncontrolled.args = {
87
87
  };
88
88
 
89
89
  /*
90
- TODO: this integration does currently not work, reason is not clear.
90
+ FIXME: this integration does currently not work, reason is not clear. See Tab component comments at bottom.
91
91
  export const UncontrolledElementsUsage = TemplateFull.bind({});
92
92
  UncontrolledElementsUsage.args = {
93
93
  id: "storytabs2",
@@ -18,7 +18,7 @@ $tag-line-height-large: $eccgui-size-typo-tag-large; // !default;
18
18
  $tag-padding-large: ($tag-height-large - $tag-line-height-large); // !default;
19
19
  // $tag-icon-spacing: ($tag-height - 12px) / 2 !default;
20
20
  // $tag-icon-spacing-large: ($tag-height-large - $pt-icon-size-standard) / 2 !default;
21
- // $tag-round-adjustment: 2px !default;
21
+ $tag-round-adjustment: 0px !default;
22
22
 
23
23
  @import "~@blueprintjs/core/src/components/tag/tag";
24
24
 
@@ -26,7 +26,7 @@
26
26
 
27
27
  .#{$eccgui}-toolbar--vertical > & {
28
28
  flex-direction: column;
29
- align-items: center;
29
+ align-items: stretch;
30
30
  }
31
31
  }
32
32
 
@@ -2,15 +2,34 @@ import React from "react";
2
2
  import { CLASSPREFIX as eccgui } from "../../configuration/constants";
3
3
  import * as TypographyClassNames from "./classnames";
4
4
 
5
+ // FIXME: CMEM-3742: comment + add story
6
+
7
+ export interface HtmlContentBlockProps extends React.HTMLAttributes<HTMLDivElement> {
8
+ className?: string;
9
+ small?: boolean;
10
+ /** currently not supported */
11
+ large?: boolean;
12
+ /** currently not supported */
13
+ muted ?: boolean;
14
+ /** currently not supported */
15
+ disabled?: boolean;
16
+ linebreakForced?: boolean;
17
+ linebreakPrevented?: boolean;
18
+ noScrollbarsOnChildren?: boolean;
19
+ }
20
+
5
21
  function HtmlContentBlock({
6
22
  className = "",
7
23
  children,
8
24
  small = false,
9
- large = false, // currently unsupported
10
- muted = false, // currently unsupported
11
- disabled = false, // currently unsupported
25
+ large = false,
26
+ muted = false,
27
+ disabled = false,
28
+ linebreakForced = false,
29
+ linebreakPrevented = false,
30
+ noScrollbarsOnChildren = false,
12
31
  ...otherProps
13
- }: any) {
32
+ }: HtmlContentBlockProps) {
14
33
  return (
15
34
  <div
16
35
  className={
@@ -19,8 +38,12 @@ function HtmlContentBlock({
19
38
  (small ? " " + TypographyClassNames.SMALL : "") +
20
39
  (large ? " " + TypographyClassNames.LARGE : "") +
21
40
  (muted ? " " + TypographyClassNames.MUTED : "") +
41
+ (linebreakForced ? " " + TypographyClassNames.FORCELINEBREAK : "") +
42
+ (linebreakPrevented ? " " + TypographyClassNames.PREVENTLINEBREAK : "") +
43
+ (noScrollbarsOnChildren ? " " + TypographyClassNames.NOSCROLLBARSONCHILDREN : "") +
22
44
  (disabled ? " " + TypographyClassNames.DISABLED : "")
23
45
  }
46
+ {...otherProps}
24
47
  >
25
48
  {children}
26
49
  </div>
@@ -4,6 +4,7 @@ import { CLASSPREFIX as eccgui } from "../../configuration/constants";
4
4
  export const NOOVERFLOW = eccgui + "-typography--nooverflow";
5
5
  export const FORCELINEBREAK = eccgui + "-typography--forcelinebreak";
6
6
  export const PREVENTLINEBREAK = eccgui + "-typography--preventlinebreak";
7
+ export const NOSCROLLBARSONCHILDREN = eccgui + "-typography--noscrollbarsonchildren";
7
8
  export const LARGE = eccgui + "-typography--large";
8
9
  export const SMALL = eccgui + "-typography--small";
9
10
  export const MUTED = eccgui + "-typography--muted";
@@ -261,6 +261,14 @@ table {
261
261
  white-space: nowrap;
262
262
  }
263
263
 
264
+ .#{$eccgui}-typography--noscrollbarsonchildren * {
265
+ overflow: visible;
266
+
267
+ pre {
268
+ width: fit-content;
269
+ }
270
+ }
271
+
264
272
  // white spaces
265
273
  @each $whitespacePlace in ("margin", "padding") {
266
274
  @each $whitespaceDirection in ("top", "right", "bottom", "left") {
@@ -3,3 +3,7 @@
3
3
  @import "edges/edges";
4
4
  @import "handles/handles";
5
5
  @import "minimap/minimap";
6
+
7
+ .react-flow__background {
8
+ border: solid 1px $eccgui-color-separation-divider;
9
+ }
@@ -67,7 +67,6 @@ export const EdgeDefault = memo(
67
67
  <path
68
68
  d={pathDisplay}
69
69
  className="react-flow__edge-path"
70
-
71
70
  markerEnd={markerEnd}
72
71
  />
73
72
  { edgeLabel }
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Copied from `react-flow` because we need to change there routing.
3
+ * We use the 10.2.0cversion minus commit 87d518f8b5540a91a3f9c163a2315c2de47abc31
4
+ * @see https://github.com/wbkd/react-flow/commit/87d518f8b5540a91a3f9c163a2315c2de47abc31
5
+ */
6
+
7
+ import { getEdgeCenter as getCenter, Position } from "react-flow-renderer";
8
+
9
+ // These are some helper methods for drawing the round corners
10
+ // The name indicates the direction of the path. "bottomLeftCorner" goes
11
+ // from bottom to the left and "leftBottomCorner" goes from left to the bottom.
12
+ // We have to consider the direction of the paths because of the animated lines.
13
+ const bottomLeftCorner = (x: number, y: number, size: number): string =>
14
+ `L ${x},${y - size}Q ${x},${y} ${x + size},${y}`;
15
+ const leftBottomCorner = (x: number, y: number, size: number): string =>
16
+ `L ${x + size},${y}Q ${x},${y} ${x},${y - size}`;
17
+ const bottomRightCorner = (x: number, y: number, size: number): string =>
18
+ `L ${x},${y - size}Q ${x},${y} ${x - size},${y}`;
19
+ const rightBottomCorner = (x: number, y: number, size: number): string =>
20
+ `L ${x - size},${y}Q ${x},${y} ${x},${y - size}`;
21
+ const leftTopCorner = (x: number, y: number, size: number): string => `L ${x + size},${y}Q ${x},${y} ${x},${y + size}`;
22
+ const topLeftCorner = (x: number, y: number, size: number): string => `L ${x},${y + size}Q ${x},${y} ${x + size},${y}`;
23
+ const topRightCorner = (x: number, y: number, size: number): string => `L ${x},${y + size}Q ${x},${y} ${x - size},${y}`;
24
+ const rightTopCorner = (x: number, y: number, size: number): string => `L ${x - size},${y}Q ${x},${y} ${x},${y + size}`;
25
+
26
+ export interface GetSmoothStepPathParams {
27
+ sourceX: number;
28
+ sourceY: number;
29
+ sourcePosition?: Position;
30
+ targetX: number;
31
+ targetY: number;
32
+ targetPosition?: Position;
33
+ borderRadius?: number;
34
+ centerX?: number;
35
+ centerY?: number;
36
+ }
37
+
38
+ export function getSmoothStepPath({
39
+ sourceX,
40
+ sourceY,
41
+ sourcePosition = Position.Bottom,
42
+ targetX,
43
+ targetY,
44
+ targetPosition = Position.Top,
45
+ borderRadius = 5,
46
+ centerX,
47
+ centerY,
48
+ }: GetSmoothStepPathParams): string {
49
+ const [_centerX, _centerY, offsetX, offsetY] = getCenter({ sourceX, sourceY, targetX, targetY });
50
+ const cornerWidth = Math.min(borderRadius, Math.abs(targetX - sourceX));
51
+ const cornerHeight = Math.min(borderRadius, Math.abs(targetY - sourceY));
52
+ const cornerSize = Math.min(cornerWidth, cornerHeight, offsetX, offsetY);
53
+ const cX = typeof centerX !== 'undefined' ? centerX : _centerX;
54
+ const cY = typeof centerY !== 'undefined' ? centerY : _centerY;
55
+
56
+ let firstCornerPath = "";
57
+ let secondCornerPath = "";
58
+
59
+ if (sourceX <= targetX) {
60
+ if (sourceY <= targetY) {
61
+ firstCornerPath = bottomLeftCorner(sourceX, cY, cornerSize);
62
+ secondCornerPath = rightTopCorner(targetX, cY, cornerSize);
63
+ if (sourcePosition === Position.Right) {
64
+ if (targetPosition === Position.Left) {
65
+ firstCornerPath = rightTopCorner(cX, sourceY, cornerSize);
66
+ secondCornerPath = bottomLeftCorner(cX, targetY, cornerSize);
67
+ }
68
+ } else {
69
+ if (targetPosition === Position.Left) {
70
+ // no change
71
+ }
72
+ }
73
+ } else {
74
+ firstCornerPath = topLeftCorner(sourceX, cY, cornerSize);
75
+ secondCornerPath = rightBottomCorner(targetX, cY, cornerSize);
76
+ if (sourcePosition === Position.Right) {
77
+ if (targetPosition === Position.Left) {
78
+ firstCornerPath = rightBottomCorner(cX, sourceY, cornerSize);
79
+ secondCornerPath = topLeftCorner(cX, targetY, cornerSize);
80
+ }
81
+ } else {
82
+ if (targetPosition === Position.Left) {
83
+ // no change
84
+ }
85
+ }
86
+ }
87
+ } else {
88
+ if (sourceY <= targetY) {
89
+ firstCornerPath = bottomRightCorner(sourceX, cY, cornerSize);
90
+ secondCornerPath = leftTopCorner(targetX, cY, cornerSize);
91
+ if (sourcePosition === Position.Left) {
92
+ if (targetPosition === Position.Right) {
93
+ firstCornerPath = leftTopCorner(cX, sourceY, cornerSize);
94
+ secondCornerPath = bottomRightCorner(cX, targetY, cornerSize);
95
+ }
96
+ } else {
97
+ if (targetPosition === Position.Right) {
98
+ // no change
99
+ }
100
+ }
101
+ } else {
102
+ firstCornerPath = topRightCorner(sourceX, cY, cornerSize);
103
+ secondCornerPath = leftBottomCorner(targetX, cY, cornerSize);
104
+ if (sourcePosition === Position.Left) {
105
+ if (targetPosition === Position.Right) {
106
+ firstCornerPath = leftBottomCorner(cX, sourceY, cornerSize);
107
+ secondCornerPath = topRightCorner(cX, targetY, cornerSize);
108
+ }
109
+ } else {
110
+ if (targetPosition === Position.Right) {
111
+ // no change
112
+ }
113
+ }
114
+ }
115
+ }
116
+
117
+ return `M ${sourceX},${sourceY}${firstCornerPath}${secondCornerPath}L ${targetX},${targetY}`;
118
+ }
@@ -1,6 +1,7 @@
1
1
  import { EdgeDefaultProps } from "./EdgeDefault";
2
2
  import { EdgeStepProps } from "./EdgeStep";
3
- import { getSmoothStepPath, Position } from "react-flow-renderer";
3
+ import { Position } from "react-flow-renderer";
4
+ import { getSmoothStepPath } from "./getSmoothStepPath";
4
5
 
5
6
  interface EdgePositionCorrectionProps extends Omit<EdgeDefaultProps, "id" | "source" | "target" | "drawSvgPath" | "data"> {
6
7
  correctionLength?: number;
@@ -25,58 +26,49 @@ const posCorrectionEdge = ({
25
26
  let endCommandCorrection = ``;
26
27
 
27
28
  if (sourcePosition === Position.Left && sourceX < targetX) {
28
- newSourceX = newSourceX - correctionLength;
29
+ newSourceX = newSourceX - 2 * correctionLength;
29
30
  if (sourceY < targetY) {
30
- newSourceY = sourceY + 2 * correctionRadius;
31
- startCommandCorrection = startCommandCorrection + ` L ${newSourceX},${sourceY} A ${correctionRadius} ${correctionRadius} ${180} ${1} ${0} `;
31
+ newSourceY = sourceY + correctionRadius;
32
+ startCommandCorrection = startCommandCorrection + ` L ${newSourceX + correctionRadius},${sourceY} A ${correctionRadius} ${correctionRadius} ${90} ${0} ${0} `;
32
33
  } else {
33
- newSourceY = sourceY - 2 * correctionRadius;
34
- startCommandCorrection = startCommandCorrection + ` L ${newSourceX},${sourceY} A ${correctionRadius} ${correctionRadius} ${180} ${1} ${1} `;
34
+ newSourceY = sourceY - correctionRadius;
35
+ startCommandCorrection = startCommandCorrection + ` L ${newSourceX + correctionRadius},${sourceY} A ${correctionRadius} ${correctionRadius} ${90} ${0} ${1} `;
35
36
  }
36
37
  }
37
38
 
38
39
  if (sourcePosition === Position.Right && sourceX > targetX) {
39
40
  newSourceX = targetPosition === Position.Right ? newSourceX + correctionLength + correctionRadius : newSourceX + correctionLength;
40
41
  if (sourceY < targetY) {
41
- newSourceY = targetPosition === Position.Right ? sourceY + 1 * correctionRadius : sourceY + 2 * correctionRadius;
42
- startCommandCorrection = targetPosition === Position.Right ? (
43
- startCommandCorrection + ` L ${newSourceX - correctionRadius},${sourceY} A ${correctionRadius} ${correctionRadius} ${90} ${0} ${1} `
44
- ) : (
45
- startCommandCorrection + ` L ${newSourceX},${sourceY} A ${correctionRadius} ${correctionRadius} ${180} ${1} ${1} `
46
- );
42
+ newSourceY = sourceY + correctionRadius;
43
+ startCommandCorrection = startCommandCorrection + ` L ${newSourceX - correctionRadius},${sourceY} A ${correctionRadius} ${correctionRadius} ${90} ${0} ${1} `;
47
44
  } else {
48
- newSourceY = targetPosition === Position.Right ? sourceY - 1 * correctionRadius : sourceY - 2 * correctionRadius;
49
- startCommandCorrection = targetPosition === Position.Right ? (
50
- startCommandCorrection + ` L ${newSourceX - correctionRadius},${sourceY} A ${correctionRadius} ${correctionRadius} ${90} ${0} ${0} `
51
- ) : (
52
- startCommandCorrection + ` L ${newSourceX},${sourceY} A ${correctionRadius} ${correctionRadius} ${180} ${1} ${0} `
53
- );
45
+ newSourceY = sourceY - correctionRadius;
46
+ startCommandCorrection = startCommandCorrection + ` L ${newSourceX - correctionRadius},${sourceY} A ${correctionRadius} ${correctionRadius} ${90} ${0} ${0} `;
54
47
  }
55
48
  }
56
49
 
57
50
  if (targetPosition === Position.Left && sourceX > targetX) {
58
- newTargetX = newTargetX - correctionLength;
51
+ newTargetX = newTargetX - 3 * correctionLength;
59
52
  if (sourceY < targetY) {
60
- newTargetY = targetY - 2 * correctionRadius;
61
- endCommandCorrection = ` A ${correctionRadius} ${correctionRadius} ${180} ${1} ${0} ${newTargetX},${targetY} L ${targetX},${targetY}`;
53
+ newTargetY = targetY - correctionRadius;
54
+ endCommandCorrection = ` A ${correctionRadius} ${correctionRadius} ${90} ${0} ${0} ${newTargetX + correctionRadius},${targetY} L ${targetX},${targetY}`;
62
55
  } else {
63
- newTargetY = targetY + 2 * correctionRadius;
64
- endCommandCorrection = ` A ${correctionRadius} ${correctionRadius} ${180} ${1} ${1} ${newTargetX},${targetY} L ${targetX},${targetY}`;
56
+ newTargetY = targetY + correctionRadius;
57
+ endCommandCorrection = ` A ${correctionRadius} ${correctionRadius} ${90} ${0} ${1} ${newTargetX + correctionRadius},${targetY} L ${targetX},${targetY}`;
65
58
  }
66
59
  }
67
60
 
68
61
  if (targetPosition === Position.Right && sourceX < targetX) {
69
- newTargetX = newTargetX + correctionLength;
62
+ newTargetX = newTargetX + 3 * correctionLength;
70
63
  if (sourceY < targetY) {
71
- newTargetY = targetY - 2 * correctionRadius;
72
- endCommandCorrection = ` A ${correctionRadius} ${correctionRadius} ${180} ${1} ${1} ${newTargetX},${targetY} L ${targetX},${targetY}`;
64
+ newTargetY = targetY - correctionRadius;
65
+ endCommandCorrection = ` A ${correctionRadius} ${correctionRadius} ${90} ${0} ${1} ${newTargetX - correctionRadius},${targetY} L ${targetX},${targetY}`;
73
66
  } else {
74
- newTargetY = targetY + 2 * correctionRadius;
75
- endCommandCorrection = ` A ${correctionRadius} ${correctionRadius} ${180} ${1} ${0} ${newTargetX},${targetY} L ${targetX},${targetY}`;
67
+ newTargetY = targetY + correctionRadius;
68
+ endCommandCorrection = ` A ${correctionRadius} ${correctionRadius} ${90} ${0} ${0} ${newTargetX - correctionRadius},${targetY} L ${targetX},${targetY}`;
76
69
  }
77
70
  }
78
71
 
79
-
80
72
  return {
81
73
  newSourceX,
82
74
  newSourceY,