@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
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { MultiSelectProps } from "@blueprintjs/select";
3
+ import { HTMLInputProps } from "@blueprintjs/core/src/common/props";
3
4
  interface SelectedParamsType<T> {
4
5
  newlySelected: T;
5
6
  selectedItems: T[];
@@ -7,18 +8,14 @@ interface SelectedParamsType<T> {
7
8
  }
8
9
  interface IProps<T> extends Pick<MultiSelectProps<T>, "items" | "placeholder" | "openOnKeyDown"> {
9
10
  /**
10
- * field in an item, that differentiates on item from the other.
11
+ * Returns the unique ID of an item. This will be used for equality of items.
11
12
  */
12
- equalityProp: string;
13
+ itemId: (item: T) => string;
13
14
  /**
14
- * field in the item object that would be used to describe the item.
15
+ * Returns the label of an item.
15
16
  * this would be used in the item selection list as well as the multi-select input
16
17
  */
17
- labelProp: string;
18
- /**
19
- * if new items that are not in the original item list can be created and appended
20
- */
21
- canCreateNewItem?: boolean;
18
+ itemLabel: (item: T) => string;
22
19
  /**
23
20
  * When set to true will set the multi-select value with all the items provided
24
21
  */
@@ -35,6 +32,8 @@ interface IProps<T> extends Pick<MultiSelectProps<T>, "items" | "placeholder" |
35
32
  * Props to spread to `TagInput`. Use `query` and `onQueryChange` to control the input.
36
33
  */
37
34
  tagInputProps?: MultiSelectProps<T>["tagInputProps"];
35
+ /** Additional properties for the (query) input field of the multi-selection. */
36
+ inputProps?: HTMLInputProps;
38
37
  /**
39
38
  * prop to listen for query changes, when text is entered in the multi-select input
40
39
  */
@@ -54,6 +53,14 @@ interface IProps<T> extends Pick<MultiSelectProps<T>, "items" | "placeholder" |
54
53
  * If omitted, "No results." will be rendered in this case.
55
54
  */
56
55
  newItemCreationText?: string;
56
+ /**
57
+ * Allows to creates new item from a given query. If this is not provided then no new items can be created.
58
+ */
59
+ createNewItemFromQuery?: (query: string) => T;
60
+ /**
61
+ * Items that were newly created and not taken from the list will be post-fixed with this string.
62
+ */
63
+ newItemPostfix?: string;
57
64
  /**
58
65
  * The input element is displayed with primary color scheme.
59
66
  */
@@ -75,5 +82,5 @@ interface IProps<T> extends Pick<MultiSelectProps<T>, "items" | "placeholder" |
75
82
  */
76
83
  disabled?: boolean;
77
84
  }
78
- declare function MultiSelect<T>({ items, prePopulateWithItems, equalityProp, labelProp, onSelection, canCreateNewItem, popoverProps, tagInputProps, runOnQueryChange, fullWidth, noResultText, newItemCreationText, hasStatePrimary, hasStateDanger, hasStateSuccess, hasStateWarning, disabled, ...otherProps }: IProps<T>): JSX.Element;
85
+ declare function MultiSelect<T>({ items, prePopulateWithItems, itemId, itemLabel, onSelection, popoverProps, tagInputProps, inputProps, runOnQueryChange, fullWidth, noResultText, newItemCreationText, newItemPostfix, hasStatePrimary, hasStateDanger, hasStateSuccess, hasStateWarning, disabled, createNewItemFromQuery, ...otherProps }: IProps<T>): JSX.Element;
79
86
  export default MultiSelect;
@@ -1,3 +1,56 @@
1
- /// <reference types="react" />
2
- declare function Notification({ actions, children, className, message, success, warning, danger, neutral, fullWidth, iconName, timeout, ...otherProps }: any): JSX.Element;
1
+ import React from "react";
2
+ import { ToastProps as BlueprintToastProps } from "@blueprintjs/core";
3
+ import { ValidIconName } from "./../Icon/canonicalIconNames";
4
+ export interface NotificationProps extends Omit<BlueprintToastProps, "message" | "action" | "icon" | "intent">, React.HTMLAttributes<HTMLDivElement> {
5
+ /**
6
+ * Extra user action elements
7
+ */
8
+ actions?: JSX.Element | JSX.Element[];
9
+ /**
10
+ * Notification message that can be used as alternative to children elements.
11
+ */
12
+ message?: JSX.Element | string;
13
+ /**
14
+ * Notification has a neutral color scheme.
15
+ */
16
+ neutral?: boolean;
17
+ /**
18
+ * Notification is a success info.
19
+ * This defines the colorization and the icon symbol.
20
+ */
21
+ success?: boolean;
22
+ /**
23
+ * Notification is a warning alert.
24
+ * This defines the colorization and the icon symbol.
25
+ */
26
+ warning?: boolean;
27
+ /**
28
+ * Notification is a danger alert.
29
+ * This defines the colorization and the icon symbol.
30
+ */
31
+ danger?: boolean;
32
+ /**
33
+ * Notification uses the the given space more flexible.
34
+ * Depracation notice: Property name will removed in futire versions.
35
+ * Please use `flexWidth`.
36
+ * @depracted
37
+ */
38
+ fullWidth?: boolean;
39
+ /**
40
+ * Notification uses the the given space more flexible.
41
+ * Default notifcation is displayed in min and max limits.
42
+ * Those limits are removed by setting this property to `true`.
43
+ */
44
+ flexWidth?: boolean;
45
+ /**
46
+ * Icon used as depiction that is displayed with the notification.
47
+ */
48
+ iconName?: ValidIconName;
49
+ }
50
+ /**
51
+ * Displays a notification message, optionally combined with depiction and further action buttons.
52
+ * By default it uses colorization of an blueish info alert.
53
+ */
54
+ declare function Notification({ actions, children, className, message, success, warning, danger, neutral, fullWidth, // deprecated
55
+ flexWidth, iconName, timeout, ...otherProps }: NotificationProps): JSX.Element;
3
56
  export default Notification;
@@ -16,7 +16,7 @@ export interface OverviewItemListProps extends React.HTMLAttributes<HTMLOListEle
16
16
  * Use multiple columns.
17
17
  * Currently only lists using 1 and 2 columns are supported.
18
18
  */
19
- columns?: number;
19
+ columns?: 1 | 2;
20
20
  }
21
21
  /**
22
22
  * This element can include all basic information and actions to give an overview about the item.
@@ -14,6 +14,6 @@ export interface SpinnerProps extends Partial<BlueprintOverlayProps & Omit<Bluep
14
14
  stroke?: SpinnerStroke;
15
15
  delay?: number;
16
16
  }
17
- declare function Spinner({ className, color, description, // currently unsupported (TODO)
17
+ declare function Spinner({ className, color, description, // currently unsupported (FIXME)
18
18
  position, size, stroke, delay, ...otherProps }: SpinnerProps): JSX.Element | null;
19
19
  export default Spinner;
@@ -1,6 +1,16 @@
1
- /// <reference types="react" />
2
- declare function HtmlContentBlock({ className, children, small, large, // currently unsupported
3
- muted, // currently unsupported
4
- disabled, // currently unsupported
5
- ...otherProps }: any): JSX.Element;
1
+ import React from "react";
2
+ export interface HtmlContentBlockProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ className?: string;
4
+ small?: boolean;
5
+ /** currently not supported */
6
+ large?: boolean;
7
+ /** currently not supported */
8
+ muted?: boolean;
9
+ /** currently not supported */
10
+ disabled?: boolean;
11
+ linebreakForced?: boolean;
12
+ linebreakPrevented?: boolean;
13
+ noScrollbarsOnChildren?: boolean;
14
+ }
15
+ declare function HtmlContentBlock({ className, children, small, large, muted, disabled, linebreakForced, linebreakPrevented, noScrollbarsOnChildren, ...otherProps }: HtmlContentBlockProps): JSX.Element;
6
16
  export default HtmlContentBlock;
@@ -1,6 +1,7 @@
1
1
  export declare const NOOVERFLOW: string;
2
2
  export declare const FORCELINEBREAK: string;
3
3
  export declare const PREVENTLINEBREAK: string;
4
+ export declare const NOSCROLLBARSONCHILDREN: string;
4
5
  export declare const LARGE: string;
5
6
  export declare const SMALL: string;
6
7
  export declare const MUTED: string;
@@ -0,0 +1,18 @@
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
+ import { Position } from "react-flow-renderer";
7
+ export interface GetSmoothStepPathParams {
8
+ sourceX: number;
9
+ sourceY: number;
10
+ sourcePosition?: Position;
11
+ targetX: number;
12
+ targetY: number;
13
+ targetPosition?: Position;
14
+ borderRadius?: number;
15
+ centerX?: number;
16
+ centerY?: number;
17
+ }
18
+ export declare function getSmoothStepPath({ sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition, borderRadius, centerX, centerY, }: GetSmoothStepPathParams): string;
@@ -3,6 +3,7 @@ import { Position } from "react-flow-renderer";
3
3
  import { ValidIconName } from "../../../components/Icon/canonicalIconNames";
4
4
  import { HandleProps } from "./../handles/HandleDefault";
5
5
  import { NodeProps } from "./NodeDefault";
6
+ import { NodeContentExtensionProps } from "./NodeContentExtension";
6
7
  export declare type HighlightingState = "success" | "warning" | "danger" | "match" | "altmatch";
7
8
  export interface IHandleProps extends HandleProps {
8
9
  category?: "configuration";
@@ -28,7 +29,7 @@ interface NodeContentData<CONTENT_PROPS = any> {
28
29
  /**
29
30
  * Content extension, displayed at the bottom side of a node.
30
31
  */
31
- contentExtension?: React.ReactNode;
32
+ contentExtension?: React.ReactElement<NodeContentExtensionProps>;
32
33
  }
33
34
  export interface NodeContentProps<NODE_DATA, NODE_CONTENT_PROPS = any> extends NodeContentData, React.HTMLAttributes<HTMLDivElement> {
34
35
  /**
@@ -111,11 +112,16 @@ export interface NodeContentProps<NODE_DATA, NODE_CONTENT_PROPS = any> extends N
111
112
  * If set then it will be always overwritten internally.
112
113
  */
113
114
  selected?: boolean;
115
+ /**
116
+ * Allow react flow wheel events, e.g. for zooming using the mouse wheel over a node.
117
+ * If this is allowed scrolling inside a node is not possible.
118
+ */
119
+ letPassWheelEvents?: boolean;
114
120
  }
115
121
  export declare const gethighlightedStateClasses: (state: any, baseClassName: any) => any;
116
122
  /**
117
123
  * The `NodeContent` element manages the main view of how a node is displaying which content.
118
124
  * This element cannot be used directly, all properties must be routed through the `data` property of an `elements` property item inside the `ReactFlow` container.
119
125
  */
120
- export declare function NodeContent<CONTENT_PROPS = any>({ iconName, depiction, typeLabel, label, showExecutionButtons, executionButtons, menuButtons, content, contentExtension, size, minimalShape, highlightedState, handles, adaptHeightForHandleMinCount, adaptSizeIncrement, getMinimalTooltipData, style, showUnconnectableHandles, animated, targetPosition, sourcePosition, isConnectable, selected, businessData, ...otherProps }: NodeContentProps<any>): JSX.Element;
126
+ export declare function NodeContent<CONTENT_PROPS = any>({ iconName, depiction, typeLabel, label, showExecutionButtons, executionButtons, menuButtons, content, contentExtension, size, minimalShape, highlightedState, handles, adaptHeightForHandleMinCount, adaptSizeIncrement, getMinimalTooltipData, style, showUnconnectableHandles, animated, targetPosition, sourcePosition, isConnectable, selected, letPassWheelEvents, businessData, ...otherProps }: NodeContentProps<any>): JSX.Element;
121
127
  export {};
@@ -1,5 +1,9 @@
1
1
  import React from "react";
2
2
  export interface NodeContentExtensionProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ /**
4
+ * When enabled the element is displayed in a way that it does not count into the node size calculation.
5
+ */
6
+ slideOutOfNode?: boolean;
3
7
  /**
4
8
  * Element is displayed in expanded state.
5
9
  * If it has no `onToggle` handler property set then it is always expanded.
@@ -27,4 +31,4 @@ export interface NodeContentExtensionProps extends React.HTMLAttributes<HTMLDivE
27
31
  /**
28
32
  * Displays an content area that can be attached to `NodeContent` elements.
29
33
  */
30
- export declare const NodeContentExtension: ({ children, isExpanded, onToggle, actionButtons, tooltipExpand, tooltipReduce, ...otherProps }: NodeContentExtensionProps) => JSX.Element;
34
+ export declare const NodeContentExtension: ({ children, slideOutOfNode, isExpanded, onToggle, actionButtons, tooltipExpand, tooltipReduce, ...otherProps }: NodeContentExtensionProps) => JSX.Element;
@@ -6,5 +6,11 @@ export interface NodeToolsProps extends IBlueprintPopoverProps {
6
6
  togglerElement?: ValidIconName | JSX.Element;
7
7
  togglerText?: string;
8
8
  menuButtonDataTestId?: string;
9
+ /** If defined this function will be called with the menu API object to be used externally. */
10
+ menuFunctionsCallback?: (menuFunctions: NodeToolsMenuFunctions) => any;
9
11
  }
10
- export declare const NodeTools: React.MemoExoticComponent<({ children, togglerElement, togglerText, menuButtonDataTestId, ...otherOverlayProps }: NodeToolsProps) => JSX.Element>;
12
+ export interface NodeToolsMenuFunctions {
13
+ /** Closes the menu if its open. */
14
+ closeMenu: () => void;
15
+ }
16
+ export declare const NodeTools: React.MemoExoticComponent<({ children, togglerElement, togglerText, menuButtonDataTestId, menuFunctionsCallback, ...otherOverlayProps }: NodeToolsProps) => JSX.Element>;
@@ -91,9 +91,7 @@ declare const HelperClasses: {
91
91
  declare const Utilities: {
92
92
  openInNewTab: (event: import("react").MouseEvent<HTMLElement, MouseEvent>, handler?: ((e: import("react").MouseEvent<HTMLElement, MouseEvent>) => void) | undefined, url?: string | undefined) => void;
93
93
  };
94
- export { ApplicationContainer, ApplicationHeader, ApplicationContent, ApplicationSidebarNavigation, ApplicationSidebarToggler, ApplicationTitle, ApplicationToolbar, ApplicationToolbarSection, ApplicationToolbarAction, ApplicationToolbarPanel, AutoSuggestion, AutoSuggestionList, SingleLineCodeEditor, HtmlContentBlock, OverflowText, WhiteSpaceContainer, Highlighter, Grid, GridRow, GridColumn, List, WorkspaceContent, WorkspaceMain, WorkspaceSide, WorkspaceHeader, Menu, MenuItem, MenuDivider, ContextOverlay, ContextMenu, OverviewItem, OverviewItemDepiction, OverviewItemDescription, OverviewItemLine, OverviewItemActions, OverviewItemList, TableContainer, Table, TableHead, TableRow, TableBody, TableCell, TableHeader, Icon, IconButton, Label, Button, Checkbox, RadioButton, Tabs, Tab, TabTitle, TextField, TextArea, SearchField, Switch, // TODO: scss styles
95
- NumericInput, // TODO: scss styles
96
- FieldItem, FieldItemRow, FieldSet, BreadcrumbList, BreadcrumbItem, Modal, SimpleDialog, AlertDialog, Card, CardHeader, CardTitle, CardOptions, CardContent, CardActions, CardActionsAux, Spacing, Divider, Tooltip, Section, SectionHeader, TitlePage, TitleMainsection, TitleSubsection, Accordion, AccordionItem, Toolbar, ToolbarSection, Tag, TagList, Pagination, Notification, Link, Spinner, PropertyName, PropertyValue, PropertyValuePair, PropertyValueList, Toast, HelperClasses, Select, // TODO: include as own element
94
+ export { ApplicationContainer, ApplicationHeader, ApplicationContent, ApplicationSidebarNavigation, ApplicationSidebarToggler, ApplicationTitle, ApplicationToolbar, ApplicationToolbarSection, ApplicationToolbarAction, ApplicationToolbarPanel, AutoSuggestion, AutoSuggestionList, SingleLineCodeEditor, HtmlContentBlock, OverflowText, WhiteSpaceContainer, Highlighter, Grid, GridRow, GridColumn, List, WorkspaceContent, WorkspaceMain, WorkspaceSide, WorkspaceHeader, Menu, MenuItem, MenuDivider, ContextOverlay, ContextMenu, OverviewItem, OverviewItemDepiction, OverviewItemDescription, OverviewItemLine, OverviewItemActions, OverviewItemList, TableContainer, Table, TableHead, TableRow, TableBody, TableCell, TableHeader, Icon, IconButton, Label, Button, Checkbox, RadioButton, Tabs, Tab, TabTitle, TextField, TextArea, SearchField, Switch, NumericInput, FieldItem, FieldItemRow, FieldSet, BreadcrumbList, BreadcrumbItem, Modal, SimpleDialog, AlertDialog, Card, CardHeader, CardTitle, CardOptions, CardContent, CardActions, CardActionsAux, Spacing, Divider, Tooltip, Section, SectionHeader, TitlePage, TitleMainsection, TitleSubsection, Accordion, AccordionItem, Toolbar, ToolbarSection, Tag, TagList, Pagination, Notification, Link, Spinner, PropertyName, PropertyValue, PropertyValuePair, PropertyValueList, Toast, HelperClasses, Select, // FIXME: CMEM-3742: include as own element
97
95
  MultiSelect, AutoCompleteField, ProgressBar, Iframe, IframeModal, Utilities, LegacyReplacements, };
98
96
  export * from "./cmem";
99
97
  export * from "./extensions/react-flow";
package/package.json CHANGED
@@ -1,15 +1,17 @@
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": "22.1.0-rc.0",
4
+ "version": "22.1.0-rc.1",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/eccenca/gui-elements",
7
+ "bugs": "https://github.com/eccenca/gui-elements/issues",
7
8
  "keywords": [
8
9
  "GUI",
9
10
  "React",
10
- "Blueprint JS",
11
- "Carbon Components",
12
- "Typescript"
11
+ "Blueprint",
12
+ "Carbon Design System",
13
+ "Typescript",
14
+ "SCSS"
13
15
  ],
14
16
  "maintainers": [
15
17
  {
@@ -18,15 +20,16 @@
18
20
  "web": "https://eccence.com/"
19
21
  }
20
22
  ],
21
- "repository": [
22
- {
23
- "type": "git",
24
- "url": "git://github.com/eccenca/gui-elements.git"
25
- }
26
- ],
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git://github.com/eccenca/gui-elements.git"
26
+ },
27
27
  "publishConfig": {
28
28
  "registry": "https://registry.npmjs.org"
29
29
  },
30
+ "engines": {
31
+ "node": ">=14.x"
32
+ },
30
33
  "style": "src/index.scss",
31
34
  "main": "dist/cjs/index.js",
32
35
  "module": "dist/es5/index.js",
@@ -53,7 +56,8 @@
53
56
  "test": "jest",
54
57
  "test:ci": "jest --ci --reporters='default'",
55
58
  "test:coverage": "jest --collectCoverage",
56
- "test:generate-output": "jest --json --outputFile=.jest-test-results.json"
59
+ "test:generate-output": "jest --json --outputFile=.jest-test-results.json",
60
+ "check:package": "pjv --warnings --recommendations"
57
61
  },
58
62
  "dependencies": {
59
63
  "@blueprintjs/core": "3.49.1",
@@ -97,7 +101,7 @@
97
101
  "@storybook/react": "^6.4.9",
98
102
  "@testing-library/jest-dom": "^5.16.1",
99
103
  "@testing-library/react": "^12.1.2",
100
- "@types/carbon-components-react": "^7.49.0",
104
+ "@types/carbon-components-react": "7.49.0",
101
105
  "@types/codemirror": "^5.60.5",
102
106
  "@types/color": "^3.0.2",
103
107
  "@types/jest": "^24.9.1",
@@ -116,6 +120,7 @@
116
120
  "jest-pnp-resolver": "^1.2.1",
117
121
  "node-sass": "4.14.1",
118
122
  "node-sass-tilde-importer": "^1.0.2",
123
+ "package-json-validator": "^0.6.3",
119
124
  "react-app-polyfill": "^1.0.6",
120
125
  "react-lorem-ipsum": "^1.4.9",
121
126
  "regenerator-runtime": "^0.13.9",
@@ -133,7 +138,11 @@
133
138
  "**/carbon-components": "10.44.0",
134
139
  "**/carbon-components-react": "7.44.1",
135
140
  "**/carbon-icons": "7.0.7",
136
- "**/@types/react": "^17.0.0"
141
+ "**/@types/react": "^17.0.0",
142
+ "**/node-gyp": "^7.0.0",
143
+ "**/glob-parent": "^5.1.2",
144
+ "**/trim": "^0.0.3",
145
+ "**/trim-newlines": "^3.0.1"
137
146
  },
138
147
  "eslintConfig": {
139
148
  "extends": [
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import { ComponentStory, ComponentMeta } from "@storybook/react";
3
3
 
4
4
  import { ActivityControlWidget } from "./ActivityControlWidget";
5
- import { loremIpsum, name } from "react-lorem-ipsum";
5
+ import { loremIpsum } from "react-lorem-ipsum";
6
6
  import Tag from "../../components/Tag/Tag";
7
7
  import TagList from "../../components/Tag/TagList";
8
8
 
@@ -66,10 +66,10 @@ const actions = [
66
66
  ];
67
67
 
68
68
  const commonWidgetArgs = {
69
- label: loremIpsum({ p: 1, avgSentencesPerParagraph: 1, avgWordsPerSentence: 4 }),
69
+ label: loremIpsum({ p: 1, avgSentencesPerParagraph: 1, avgWordsPerSentence: 4, random: false }),
70
70
  border: true,
71
71
  activityActions: actions,
72
- statusMessage: loremIpsum({ p: 1, startWithLoremIpsum: false }),
72
+ statusMessage: loremIpsum({ p: 1, startWithLoremIpsum: false, random: false }),
73
73
  progressSpinner: {
74
74
  intent: "none",
75
75
  value: 0.5,
@@ -86,9 +86,9 @@ export const WidgetWithTags = TemplateWithTags.bind({});
86
86
 
87
87
  const widgetTags = (
88
88
  <TagList>
89
- <Tag small>{name()}</Tag>
90
- <Tag small>{name()}</Tag>
91
- <Tag small>{name()}</Tag>
89
+ <Tag small>Tag one</Tag>
90
+ <Tag small>Other tag</Tag>
91
+ <Tag small>Third keyword</Tag>
92
92
  </TagList>
93
93
  );
94
94
 
@@ -11,7 +11,6 @@ import {
11
11
  OverviewItemDescription,
12
12
  OverviewItemLine,
13
13
  ProgressBar,
14
- Spacing,
15
14
  Spinner,
16
15
  Tooltip,
17
16
  } from "../../index";
@@ -27,6 +26,11 @@ export interface IActivityControlProps extends TestableComponent {
27
26
  * The label to be shown
28
27
  */
29
28
  label?: string | JSX.Element;
29
+ /**
30
+ * Element that wraps around the label.
31
+ * Default: `<OverflowText inline={true} />`
32
+ */
33
+ labelWrapper?: JSX.Element;
30
34
  /**
31
35
  * To add tags in addition to the widget status description
32
36
  */
@@ -59,6 +63,10 @@ export interface IActivityControlProps extends TestableComponent {
59
63
  * display widget inside rectangle
60
64
  */
61
65
  border?: boolean;
66
+ /**
67
+ * display a bit whitespace around widget, even without border
68
+ */
69
+ hasSpacing?: boolean;
62
70
  /**
63
71
  * only use necessary width, not always the available 100% of parent element
64
72
  */
@@ -103,13 +111,15 @@ export function ActivityControlWidget(props: IActivityControlProps) {
103
111
  activityContextMenu,
104
112
  small,
105
113
  border,
114
+ hasSpacing,
106
115
  canShrink,
107
116
  tags,
108
117
  progressSpinnerFinishedIcon,
118
+ labelWrapper = <OverflowText inline={true} />,
109
119
  } = props;
110
120
  const spinnerClassNames = (progressSpinner?.className ?? "") + ` ${eccgui}-spinner--permanent`;
111
121
  const widget = (
112
- <OverviewItem data-test-id={dataTestId} hasSpacing={border} densityHigh={small}>
122
+ <OverviewItem data-test-id={dataTestId} hasSpacing={border || hasSpacing} densityHigh={small}>
113
123
  {progressBar && <ProgressBar {...progressBar} />}
114
124
  {(progressSpinner || progressSpinnerFinishedIcon) && (
115
125
  <OverviewItemDepiction keepColors>
@@ -129,31 +139,34 @@ export function ActivityControlWidget(props: IActivityControlProps) {
129
139
  <OverviewItemDescription>
130
140
  {props.label && (
131
141
  <OverviewItemLine small={small}>
132
- <OverflowText inline={true}>{props.label}</OverflowText>
142
+ { React.cloneElement(labelWrapper, {}, props.label) }
133
143
  </OverviewItemLine>
134
144
  )}
135
145
  {(props.statusMessage || tags) && (
136
146
  <OverviewItemLine small>
137
- {tags && (
138
- <>
139
- { tags }
140
- <Spacing vertical size="tiny" />
141
- </>
142
- )}
147
+ { tags }
143
148
  {props.statusMessage && (
144
- <>
149
+ <OverflowText passDown>
145
150
  {props.statusMessage.length > 50 ? (
146
151
  <Tooltip
147
152
  content={props.statusMessage}
148
153
  size="large"
149
- tooltipProps={{ placement: "top", boundary: "viewport" }}
154
+ tooltipProps={{
155
+ position: "top-right",
156
+ boundary: "viewport",
157
+ modifiers: {
158
+ flip: {
159
+ enabled: false
160
+ }
161
+ }
162
+ }}
150
163
  >
151
- <OverflowText inline={true}>{props.statusMessage}</OverflowText>
164
+ {props.statusMessage}
152
165
  </Tooltip>
153
166
  ) : (
154
- <OverflowText inline={true}>{props.statusMessage}</OverflowText>
167
+ props.statusMessage
155
168
  )}
156
- </>
169
+ </OverflowText>
157
170
  )}
158
171
  </OverviewItemLine>
159
172
  )}
@@ -1,5 +1,5 @@
1
- import {Button, HtmlContentBlock, SimpleDialog} from "../../index";
2
- import React from "react";
1
+ import {Button, HtmlContentBlock, IconButton, SimpleDialog} from "../../index";
2
+ import React, { useState } from "react";
3
3
 
4
4
  interface IProps {
5
5
  // Title of the modal
@@ -18,6 +18,7 @@ interface IProps {
18
18
 
19
19
  /** Shows the execution error report to the user and offers to download the report. */
20
20
  export const ActivityExecutionErrorReportModal = ({title, onDiscard, report, downloadButtonValue, closeButtonValue, fetchErrorReport}: IProps) => {
21
+ const [displayFullscreen, setDisplayFullscreen] = useState<boolean>(false);
21
22
  const fileName = "Activity execution report from " + (new Date()).toISOString().replace(/T/, " ").replace(/:/g, "-").substr(0, 19) + ".md"
22
23
  const handleDownload = async () => {
23
24
  const markdown = await fetchErrorReport()
@@ -37,7 +38,14 @@ export const ActivityExecutionErrorReportModal = ({title, onDiscard, report, dow
37
38
  <SimpleDialog
38
39
  title={title}
39
40
  isOpen={true}
41
+ size={displayFullscreen ? "fullscreen" : "large"}
40
42
  onClose={onDiscard}
43
+ headerOptions={(
44
+ <IconButton
45
+ name={displayFullscreen ? "toggler-minimize" : "toggler-maximize"}
46
+ onClick={() => setDisplayFullscreen(!displayFullscreen)}
47
+ />
48
+ )}
41
49
  actions={[
42
50
  <Button data-test-id={"error-report-download-btn"} affirmative onClick={handleDownload} key="download">
43
51
  {downloadButtonValue}
@@ -47,7 +55,7 @@ export const ActivityExecutionErrorReportModal = ({title, onDiscard, report, dow
47
55
  </Button>,
48
56
  ]}
49
57
  >
50
- <HtmlContentBlock>
58
+ <HtmlContentBlock noScrollbarsOnChildren>
51
59
  {report}
52
60
  </HtmlContentBlock>
53
61
  </SimpleDialog>
@@ -63,10 +63,14 @@ export interface IActivityControlLayoutProps {
63
63
  small?: boolean;
64
64
  // display widget inside rectange
65
65
  border?: boolean;
66
+ // add a bit spacing
67
+ hasSpacing?: boolean;
66
68
  // only use necessary width, not always the available 100% of parent element
67
69
  canShrink?: boolean;
68
70
  // what type of progrss display should be uses, horizontal progress bar, circular spinner, or none of that
69
71
  visualization?: "none" | "progressbar" | "spinner";
72
+ // wrapper around label
73
+ labelWrapper?: JSX.Element;
70
74
  }
71
75
 
72
76
  const defaultLayout: IActivityControlLayoutProps = {
@@ -352,7 +356,7 @@ export const calcIntent = (activityStatus: IActivityStatus): Intent => {
352
356
  intent = "danger";
353
357
  break;
354
358
  case "Waiting":
355
- intent = "none"; // TODO: This is 100% yellow in the old activity control
359
+ intent = "none";
356
360
  break;
357
361
  default:
358
362
  intent = "none";
@@ -10,7 +10,9 @@
10
10
  background-color: mix($color, #fff, 24%);
11
11
  }
12
12
  .#{$eccgui}-graphviz__node__extension--expanded {
13
- border-color: $color;
13
+ &.#{$eccgui}-graphviz__node__extension--slideout {
14
+ border-color: $color;
15
+ }
14
16
  }
15
17
  }
16
18
 
@@ -23,10 +25,12 @@
23
25
  border-width: 3 * $reactflow-node-border-width;
24
26
  }
25
27
  .#{$eccgui}-graphviz__node__extension--expanded {
26
- border-style: double;
27
- border-width: 3 * $reactflow-node-border-width;
28
- left: -3 * $reactflow-node-border-width;
29
- right: -3 * $reactflow-node-border-width;
28
+ &.#{$eccgui}-graphviz__node__extension--slideout {
29
+ border-style: double;
30
+ border-width: 3 * $reactflow-node-border-width;
31
+ left: -3 * $reactflow-node-border-width;
32
+ right: -3 * $reactflow-node-border-width;
33
+ }
30
34
  }
31
35
  }
32
36
 
@@ -39,7 +43,9 @@
39
43
  border-style: dashed;
40
44
  }
41
45
  .#{$eccgui}-graphviz__node__extension--expanded {
42
- border-style: dashed;
46
+ &.#{$eccgui}-graphviz__node__extension--slideout {
47
+ border-style: dashed;
48
+ }
43
49
  }
44
50
  }
45
51
 
@@ -1,6 +1,6 @@
1
1
  $reactflow-color-sourcepath-node: #745a85 !default;
2
2
  $reactflow-color-targetpath-node: #3a7896 !default;
3
- $reactflow-color-transformation-node: #c1c1c1 !default;
3
+ $reactflow-color-transformation-node: #ae3c74 !default;
4
4
  $reactflow-color-comparator-node: #40a691 !default;
5
5
  $reactflow-color-aggregator-node: #0097a7 !default;
6
6
 
@@ -0,0 +1,2 @@
1
+ /** Removes leading and trailing spaces. In addition converts multiple subsequent spaces to a single space. */
2
+ export const removeExtraSpaces = (text: string) => text.replace(/\s+/g, " ").trim();
@@ -30,11 +30,6 @@ function ApplicationContent({
30
30
  isApplicationSidebarExpanded = false,
31
31
  isApplicationSidebarRail = false,
32
32
  htmlMainProps,
33
- /*
34
- TODO: type definitions do not include data attributes because of their infinite number of possible names, so we
35
- need to solve this by filtering out all other props, or create a stack of allowed data attributes or using
36
- a combined process of dynamic keys and template mappings in typescript
37
- */
38
33
  ...otherPropsShouldOnlyBeUsedForDataAttributes
39
34
  }: IApplicationContentProps) {
40
35
 
@@ -54,11 +54,6 @@ function ApplicationTitle({
54
54
  isAlignedWithSidebar=false,
55
55
  isApplicationSidebarExpanded,
56
56
  htmlAProps,
57
- /*
58
- TODO: type definitions do not include data attributes because of their infinite number of possible names, so we
59
- need to solve this by filtering out all other props, or create a stack of allowed data attributes or using
60
- a combined process of dynamic keys and template mappings in typescript
61
- */
62
57
  ...otherPropsShouldOnlyBeUsedForDataAttributes
63
58
  }: IApplicationTitleProps) {
64
59
 
@@ -189,7 +189,6 @@ const AutoSuggestion = ({
189
189
  const parseError = validationResponse?.parseError;
190
190
  if (parseError && editorInstance) {
191
191
  const { message, start, end } = parseError;
192
- // TODO: Display error message
193
192
  editorInstance.getDoc().getEditor()
194
193
  const marker = editorInstance.markText(
195
194
  { line: 0, ch: start },