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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (269) hide show
  1. package/CHANGELOG.md +20 -4
  2. package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js +18 -14
  3. package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
  4. package/dist/cjs/cmem/ActivityControl/SilkActivityControl.js +58 -30
  5. package/dist/cjs/cmem/ActivityControl/SilkActivityControl.js.map +1 -1
  6. package/dist/cjs/cmem/ActivityControl/index.js +11 -0
  7. package/dist/cjs/cmem/ActivityControl/index.js.map +1 -0
  8. package/dist/cjs/cmem/ContentBlobToggler/index.js +8 -0
  9. package/dist/cjs/cmem/ContentBlobToggler/index.js.map +1 -0
  10. package/dist/cjs/cmem/index.js +14 -13
  11. package/dist/cjs/cmem/index.js.map +1 -1
  12. package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js +57 -0
  13. package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -0
  14. package/dist/cjs/cmem/react-flow/configuration/_colors-graph.module.scss +35 -0
  15. package/dist/cjs/cmem/react-flow/configuration/_colors-linking.module.scss +29 -0
  16. package/dist/cjs/cmem/react-flow/configuration/_colors-workflow.module.scss +22 -0
  17. package/dist/cjs/cmem/react-flow/configuration/graph.js +31 -0
  18. package/dist/cjs/cmem/react-flow/configuration/graph.js.map +1 -0
  19. package/dist/cjs/cmem/react-flow/configuration/linking.js +29 -0
  20. package/dist/cjs/cmem/react-flow/configuration/linking.js.map +1 -0
  21. package/dist/cjs/cmem/react-flow/configuration/unspecified.js +15 -0
  22. package/dist/cjs/cmem/react-flow/configuration/unspecified.js.map +1 -0
  23. package/dist/cjs/cmem/react-flow/configuration/workflow.js +27 -0
  24. package/dist/cjs/cmem/react-flow/configuration/workflow.js.map +1 -0
  25. package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js +285 -0
  26. package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js.map +1 -0
  27. package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js +81 -0
  28. package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js.map +1 -0
  29. package/dist/cjs/components/AutoSuggestion/SingleLineCodeEditor.js +46 -0
  30. package/dist/cjs/components/AutoSuggestion/SingleLineCodeEditor.js.map +1 -0
  31. package/dist/cjs/components/AutocompleteField/AutoCompleteField.js +8 -12
  32. package/dist/cjs/components/AutocompleteField/AutoCompleteField.js.map +1 -1
  33. package/dist/cjs/components/Button/Button.js.map +1 -1
  34. package/dist/cjs/components/ContextOverlay/ContextMenu.js +1 -1
  35. package/dist/cjs/components/ContextOverlay/ContextMenu.js.map +1 -1
  36. package/dist/cjs/components/Dialog/Modal.js +2 -2
  37. package/dist/cjs/components/Dialog/Modal.js.map +1 -1
  38. package/dist/cjs/components/Dialog/SimpleDialog.js.map +1 -1
  39. package/dist/cjs/components/Icon/Icon.js.map +1 -1
  40. package/dist/cjs/components/Icon/canonicalIconNames.js +30 -0
  41. package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
  42. package/dist/cjs/components/MultiSelect/MultiSelect.js +219 -0
  43. package/dist/cjs/components/MultiSelect/MultiSelect.js.map +1 -0
  44. package/dist/cjs/components/Tabs/Tab.js +95 -0
  45. package/dist/cjs/components/Tabs/Tab.js.map +1 -0
  46. package/dist/cjs/components/Tabs/TabTitle.js +20 -0
  47. package/dist/cjs/components/Tabs/TabTitle.js.map +1 -0
  48. package/dist/cjs/components/Tabs/Tabs.js +29 -19
  49. package/dist/cjs/components/Tabs/Tabs.js.map +1 -1
  50. package/dist/cjs/components/Tag/Tag.js +7 -1
  51. package/dist/cjs/components/Tag/Tag.js.map +1 -1
  52. package/dist/cjs/extensions/react-flow/edges/utils.js +96 -4
  53. package/dist/cjs/extensions/react-flow/edges/utils.js.map +1 -1
  54. package/dist/cjs/extensions/react-flow/nodes/NodeContent.js +5 -4
  55. package/dist/cjs/extensions/react-flow/nodes/NodeContent.js.map +1 -1
  56. package/dist/cjs/extensions/react-flow/nodes/NodeContentExtension.js +2 -2
  57. package/dist/cjs/extensions/react-flow/nodes/NodeContentExtension.js.map +1 -1
  58. package/dist/cjs/extensions/react-flow/nodes/NodeTools.js.map +1 -1
  59. package/dist/cjs/index.js +17 -2
  60. package/dist/cjs/index.js.map +1 -1
  61. package/dist/cjs/legacy-replacements/Button/AffirmativeButton.js +25 -0
  62. package/dist/cjs/legacy-replacements/Button/AffirmativeButton.js.map +1 -0
  63. package/dist/cjs/legacy-replacements/Button/Button.js +61 -0
  64. package/dist/cjs/legacy-replacements/Button/Button.js.map +1 -0
  65. package/dist/cjs/legacy-replacements/Button/DismissiveButton.js +25 -0
  66. package/dist/cjs/legacy-replacements/Button/DismissiveButton.js.map +1 -0
  67. package/dist/cjs/legacy-replacements/Button/DisruptiveButton.js +25 -0
  68. package/dist/cjs/legacy-replacements/Button/DisruptiveButton.js.map +1 -0
  69. package/dist/cjs/legacy-replacements/Checkbox/Checkbox.js +55 -0
  70. package/dist/cjs/legacy-replacements/Checkbox/Checkbox.js.map +1 -0
  71. package/dist/cjs/legacy-replacements/Radio/RadioButton.js +48 -0
  72. package/dist/cjs/legacy-replacements/Radio/RadioButton.js.map +1 -0
  73. package/dist/cjs/legacy-replacements/Tabs/Tabs.js +36 -0
  74. package/dist/cjs/legacy-replacements/Tabs/Tabs.js.map +1 -0
  75. package/dist/cjs/legacy-replacements/TextField/TextField.js +75 -0
  76. package/dist/cjs/legacy-replacements/TextField/TextField.js.map +1 -0
  77. package/dist/cjs/legacy-replacements/index.js +22 -0
  78. package/dist/cjs/legacy-replacements/index.js.map +1 -0
  79. package/dist/es5/cmem/ActivityControl/ActivityControlWidget.js +19 -15
  80. package/dist/es5/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
  81. package/dist/es5/cmem/ActivityControl/SilkActivityControl.js +56 -30
  82. package/dist/es5/cmem/ActivityControl/SilkActivityControl.js.map +1 -1
  83. package/dist/es5/cmem/ActivityControl/index.js +4 -0
  84. package/dist/es5/cmem/ActivityControl/index.js.map +1 -0
  85. package/dist/es5/cmem/ContentBlobToggler/index.js +3 -0
  86. package/dist/es5/cmem/ContentBlobToggler/index.js.map +1 -0
  87. package/dist/es5/cmem/index.js +6 -8
  88. package/dist/es5/cmem/index.js.map +1 -1
  89. package/dist/es5/cmem/react-flow/ReactFlow/ReactFlow.js +43 -0
  90. package/dist/es5/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -0
  91. package/dist/es5/cmem/react-flow/configuration/_colors-graph.module.scss +35 -0
  92. package/dist/es5/cmem/react-flow/configuration/_colors-linking.module.scss +29 -0
  93. package/dist/es5/cmem/react-flow/configuration/_colors-workflow.module.scss +22 -0
  94. package/dist/es5/cmem/react-flow/configuration/graph.js +23 -0
  95. package/dist/es5/cmem/react-flow/configuration/graph.js.map +1 -0
  96. package/dist/es5/cmem/react-flow/configuration/linking.js +21 -0
  97. package/dist/es5/cmem/react-flow/configuration/linking.js.map +1 -0
  98. package/dist/es5/cmem/react-flow/configuration/unspecified.js +12 -0
  99. package/dist/es5/cmem/react-flow/configuration/unspecified.js.map +1 -0
  100. package/dist/es5/cmem/react-flow/configuration/workflow.js +19 -0
  101. package/dist/es5/cmem/react-flow/configuration/workflow.js.map +1 -0
  102. package/dist/es5/components/AutoSuggestion/AutoSuggestion.js +347 -0
  103. package/dist/es5/components/AutoSuggestion/AutoSuggestion.js.map +1 -0
  104. package/dist/es5/components/AutoSuggestion/AutoSuggestionList.js +93 -0
  105. package/dist/es5/components/AutoSuggestion/AutoSuggestionList.js.map +1 -0
  106. package/dist/es5/components/AutoSuggestion/SingleLineCodeEditor.js +42 -0
  107. package/dist/es5/components/AutoSuggestion/SingleLineCodeEditor.js.map +1 -0
  108. package/dist/es5/components/AutocompleteField/AutoCompleteField.js +8 -12
  109. package/dist/es5/components/AutocompleteField/AutoCompleteField.js.map +1 -1
  110. package/dist/es5/components/Button/Button.js.map +1 -1
  111. package/dist/es5/components/ContextOverlay/ContextMenu.js +1 -1
  112. package/dist/es5/components/ContextOverlay/ContextMenu.js.map +1 -1
  113. package/dist/es5/components/Dialog/Modal.js +2 -2
  114. package/dist/es5/components/Dialog/Modal.js.map +1 -1
  115. package/dist/es5/components/Dialog/SimpleDialog.js.map +1 -1
  116. package/dist/es5/components/Icon/Icon.js.map +1 -1
  117. package/dist/es5/components/Icon/canonicalIconNames.js +30 -0
  118. package/dist/es5/components/Icon/canonicalIconNames.js.map +1 -1
  119. package/dist/es5/components/MultiSelect/MultiSelect.js +301 -0
  120. package/dist/es5/components/MultiSelect/MultiSelect.js.map +1 -0
  121. package/dist/es5/components/Tabs/Tab.js +98 -0
  122. package/dist/es5/components/Tabs/Tab.js.map +1 -0
  123. package/dist/es5/components/Tabs/TabTitle.js +16 -0
  124. package/dist/es5/components/Tabs/TabTitle.js.map +1 -0
  125. package/dist/es5/components/Tabs/Tabs.js +11 -21
  126. package/dist/es5/components/Tabs/Tabs.js.map +1 -1
  127. package/dist/es5/components/Tag/Tag.js +7 -1
  128. package/dist/es5/components/Tag/Tag.js.map +1 -1
  129. package/dist/es5/extensions/react-flow/edges/utils.js +99 -5
  130. package/dist/es5/extensions/react-flow/edges/utils.js.map +1 -1
  131. package/dist/es5/extensions/react-flow/nodes/NodeContent.js +21 -4
  132. package/dist/es5/extensions/react-flow/nodes/NodeContent.js.map +1 -1
  133. package/dist/es5/extensions/react-flow/nodes/NodeContentExtension.js +2 -2
  134. package/dist/es5/extensions/react-flow/nodes/NodeContentExtension.js.map +1 -1
  135. package/dist/es5/extensions/react-flow/nodes/NodeTools.js.map +1 -1
  136. package/dist/es5/index.js +9 -2
  137. package/dist/es5/index.js.map +1 -1
  138. package/dist/es5/legacy-replacements/Button/AffirmativeButton.js +29 -0
  139. package/dist/es5/legacy-replacements/Button/AffirmativeButton.js.map +1 -0
  140. package/dist/es5/legacy-replacements/Button/Button.js +65 -0
  141. package/dist/es5/legacy-replacements/Button/Button.js.map +1 -0
  142. package/dist/es5/legacy-replacements/Button/DismissiveButton.js +29 -0
  143. package/dist/es5/legacy-replacements/Button/DismissiveButton.js.map +1 -0
  144. package/dist/es5/legacy-replacements/Button/DisruptiveButton.js +29 -0
  145. package/dist/es5/legacy-replacements/Button/DisruptiveButton.js.map +1 -0
  146. package/dist/es5/legacy-replacements/Checkbox/Checkbox.js +59 -0
  147. package/dist/es5/legacy-replacements/Checkbox/Checkbox.js.map +1 -0
  148. package/dist/es5/legacy-replacements/Radio/RadioButton.js +52 -0
  149. package/dist/es5/legacy-replacements/Radio/RadioButton.js.map +1 -0
  150. package/dist/es5/legacy-replacements/Tabs/Tabs.js +40 -0
  151. package/dist/es5/legacy-replacements/Tabs/Tabs.js.map +1 -0
  152. package/dist/es5/legacy-replacements/TextField/TextField.js +81 -0
  153. package/dist/es5/legacy-replacements/TextField/TextField.js.map +1 -0
  154. package/dist/es5/legacy-replacements/index.js +10 -0
  155. package/dist/es5/legacy-replacements/index.js.map +1 -0
  156. package/dist/types/cmem/ActivityControl/ActivityControlTypes.d.ts +2 -1
  157. package/dist/types/cmem/ActivityControl/ActivityControlWidget.d.ts +39 -2
  158. package/dist/types/cmem/ActivityControl/SilkActivityControl.d.ts +16 -3
  159. package/dist/types/cmem/ActivityControl/index.d.ts +3 -0
  160. package/dist/types/cmem/ContentBlobToggler/index.d.ts +2 -0
  161. package/dist/types/cmem/index.d.ts +8 -8
  162. package/dist/types/cmem/react-flow/ReactFlow/ReactFlow.d.ts +14 -0
  163. package/dist/types/cmem/react-flow/configuration/graph.d.ts +21 -0
  164. package/dist/types/cmem/react-flow/configuration/linking.d.ts +19 -0
  165. package/dist/types/cmem/react-flow/configuration/unspecified.d.ts +9 -0
  166. package/dist/types/cmem/react-flow/configuration/workflow.d.ts +17 -0
  167. package/dist/types/components/AutoSuggestion/AutoSuggestion.d.ts +67 -0
  168. package/dist/types/components/AutoSuggestion/AutoSuggestionList.d.ts +13 -0
  169. package/dist/types/components/AutoSuggestion/SingleLineCodeEditor.d.ts +25 -0
  170. package/dist/types/components/AutocompleteField/AutoCompleteField.d.ts +8 -7
  171. package/dist/types/components/Button/Button.d.ts +3 -2
  172. package/dist/types/components/ContextOverlay/ContextMenu.d.ts +6 -1
  173. package/dist/types/components/Dialog/Modal.d.ts +4 -3
  174. package/dist/types/components/Dialog/SimpleDialog.d.ts +2 -0
  175. package/dist/types/components/Icon/Icon.d.ts +2 -2
  176. package/dist/types/components/Icon/IconButton.d.ts +1 -1
  177. package/dist/types/components/Icon/canonicalIconNames.d.ts +1 -1
  178. package/dist/types/components/MultiSelect/MultiSelect.d.ts +79 -0
  179. package/dist/types/components/Tabs/Tab.d.ts +549 -0
  180. package/dist/types/components/Tabs/TabTitle.d.ts +38 -0
  181. package/dist/types/components/Tabs/Tabs.d.ts +14 -20
  182. package/dist/types/components/Tag/Tag.d.ts +1 -1
  183. package/dist/types/extensions/react-flow/edges/utils.d.ts +1 -1
  184. package/dist/types/extensions/react-flow/nodes/NodeContent.d.ts +8 -8
  185. package/dist/types/extensions/react-flow/nodes/NodeDefault.d.ts +2 -2
  186. package/dist/types/extensions/react-flow/nodes/NodeTools.d.ts +2 -1
  187. package/dist/types/extensions/react-flow/nodes/nodeTypes.d.ts +10 -10
  188. package/dist/types/index.d.ts +9 -2
  189. package/dist/types/legacy-replacements/Button/AffirmativeButton.d.ts +2 -0
  190. package/dist/types/legacy-replacements/Button/Button.d.ts +5 -0
  191. package/dist/types/legacy-replacements/Button/DismissiveButton.d.ts +2 -0
  192. package/dist/types/legacy-replacements/Button/DisruptiveButton.d.ts +2 -0
  193. package/dist/types/legacy-replacements/Checkbox/Checkbox.d.ts +2 -0
  194. package/dist/types/legacy-replacements/Radio/RadioButton.d.ts +2 -0
  195. package/dist/types/legacy-replacements/Tabs/Tabs.d.ts +22 -0
  196. package/dist/types/legacy-replacements/TextField/TextField.d.ts +2 -0
  197. package/dist/types/legacy-replacements/index.d.ts +10 -0
  198. package/package.json +16 -7
  199. package/src/cmem/ActivityControl/ActivityControlTypes.ts +3 -1
  200. package/src/cmem/ActivityControl/ActivityControlWidget.stories.tsx +98 -0
  201. package/src/cmem/ActivityControl/ActivityControlWidget.tsx +131 -89
  202. package/src/cmem/ActivityControl/SilkActivityControl.tsx +178 -120
  203. package/src/cmem/ActivityControl/index.ts +3 -0
  204. package/src/cmem/ContentBlobToggler/index.ts +2 -0
  205. package/src/cmem/_index.scss +6 -0
  206. package/src/cmem/index.ts +10 -23
  207. package/src/cmem/react-flow/ReactFlow/ReactFlow.stories.tsx +222 -0
  208. package/src/cmem/react-flow/ReactFlow/ReactFlow.tsx +40 -0
  209. package/src/cmem/react-flow/_edges.scss +23 -0
  210. package/src/cmem/react-flow/_handles.scss +34 -0
  211. package/src/cmem/react-flow/_index.scss +5 -0
  212. package/src/cmem/react-flow/_minimap.scss +33 -0
  213. package/src/cmem/react-flow/_nodes.scss +60 -0
  214. package/src/cmem/react-flow/configuration/_colors-graph.module.scss +35 -0
  215. package/src/cmem/react-flow/configuration/_colors-linking.module.scss +29 -0
  216. package/src/cmem/react-flow/configuration/_colors-workflow.module.scss +22 -0
  217. package/src/cmem/react-flow/configuration/_colors.scss +3 -0
  218. package/src/cmem/react-flow/configuration/graph.ts +29 -0
  219. package/src/cmem/react-flow/configuration/linking.ts +28 -0
  220. package/src/cmem/react-flow/configuration/unspecified.ts +13 -0
  221. package/src/cmem/react-flow/configuration/workflow.ts +25 -0
  222. package/src/components/AutoSuggestion/AutoSuggestion.scss +100 -0
  223. package/src/components/AutoSuggestion/AutoSuggestion.tsx +447 -0
  224. package/src/components/AutoSuggestion/AutoSuggestionList.tsx +170 -0
  225. package/src/components/AutoSuggestion/SingleLineCodeEditor.tsx +97 -0
  226. package/src/components/AutoSuggestion/tests/AutoSuggestion.test.tsx +37 -0
  227. package/src/components/AutoSuggestion/tests/AutoSuggestionList.test.tsx +124 -0
  228. package/src/components/AutoSuggestion/tests/SingleLineCodeEditor.test.tsx +55 -0
  229. package/src/components/AutocompleteField/AutoCompleteField.tsx +19 -19
  230. package/src/components/AutocompleteField/autoCompleteFieldUtils.tsx +2 -1
  231. package/src/components/Button/Button.tsx +3 -2
  232. package/src/components/ContextOverlay/ContextMenu.tsx +8 -2
  233. package/src/components/Dialog/Modal.tsx +9 -2
  234. package/src/components/Dialog/SimpleDialog.tsx +2 -0
  235. package/src/components/Icon/Icon.tsx +4 -4
  236. package/src/components/Icon/IconButton.tsx +1 -1
  237. package/src/components/Icon/canonicalIconNames.tsx +39 -2
  238. package/src/components/MultiSelect/MultiSelect.stories.tsx +63 -0
  239. package/src/components/MultiSelect/MultiSelect.tsx +370 -0
  240. package/src/components/Tabs/Tab.tsx +112 -0
  241. package/src/components/Tabs/TabTitle.tsx +71 -0
  242. package/src/components/Tabs/Tabs.tsx +26 -90
  243. package/src/components/Tabs/stories/Tab.stories.tsx +65 -0
  244. package/src/components/Tabs/stories/TabTitle.stories.tsx +35 -0
  245. package/src/components/Tabs/stories/Tabs.stories.tsx +98 -0
  246. package/src/components/Tabs/tabs.scss +11 -4
  247. package/src/components/Tag/Tag.tsx +10 -3
  248. package/src/components/Tag/tag.scss +1 -1
  249. package/src/components/TextField/TextField.tsx +1 -1
  250. package/src/configuration/_variables.scss +3 -3
  251. package/src/extensions/react-flow/_config.scss +2 -2
  252. package/src/extensions/react-flow/edges/_edges.scss +3 -28
  253. package/src/extensions/react-flow/edges/utils.ts +139 -4
  254. package/src/extensions/react-flow/handles/_handles.scss +4 -58
  255. package/src/extensions/react-flow/minimap/_minimap.scss +0 -45
  256. package/src/extensions/react-flow/nodes/NodeContent.tsx +134 -133
  257. package/src/extensions/react-flow/nodes/NodeContentExtension.tsx +11 -10
  258. package/src/extensions/react-flow/nodes/NodeDefault.tsx +2 -2
  259. package/src/extensions/react-flow/nodes/NodeTools.tsx +2 -1
  260. package/src/extensions/react-flow/nodes/_nodes.scss +31 -185
  261. package/src/extensions/react-flow/nodes/{NodeContent.stories.tsx → stories/NodeContent.stories.tsx} +4 -4
  262. package/src/extensions/react-flow/nodes/{NodeContentExtension.stories.tsx → stories/NodeContentExtension.stories.tsx} +4 -4
  263. package/src/extensions/react-flow/nodes/{NodeDefault.stories.tsx → stories/NodeDefault.stories.tsx} +5 -4
  264. package/src/index.scss +1 -0
  265. package/src/index.ts +16 -1
  266. package/src/legacy-replacements/Tabs/Tabs.stories.tsx +46 -0
  267. package/src/legacy-replacements/Tabs/Tabs.tsx +84 -0
  268. package/src/legacy-replacements/index.ts +11 -0
  269. package/src/test/setupTests.js +19 -0
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ export interface TabTitleProps {
3
+ /**
4
+ * Content of the label that is displayed in the tab element.
5
+ */
6
+ text: string | React.ReactNode;
7
+ /**
8
+ * Content that is displayed before the tab label, could be used for icons, change markers, etc.
9
+ * Use text content inside `<span>` element to force white space between th eprefix and the label.
10
+ */
11
+ titlePrefix?: React.ReactNode;
12
+ /**
13
+ * Content that is display after tab label, could be used for counts or close/remove buttons.
14
+ * Use text content inside `<span>` element to force white space between th eprefix and the label.
15
+ */
16
+ titleSuffix?: React.ReactNode;
17
+ /**
18
+ * Enable larger display of the tab.
19
+ */
20
+ large?: boolean;
21
+ /**
22
+ * Enable smaller display of the tab.
23
+ */
24
+ small?: boolean;
25
+ /**
26
+ * Add a tooltip to a tab, displayed when user hoveres over it.
27
+ */
28
+ tooltip?: string | JSX.Element;
29
+ /**
30
+ * Make the tab not usable, display is also narrowed.
31
+ */
32
+ disabled?: boolean;
33
+ }
34
+ /**
35
+ * Gives control about functionality and layout of the tab titles.
36
+ */
37
+ declare const TabTitle: ({ text, tooltip, titlePrefix, titleSuffix, large, small, disabled, }: TabTitleProps) => JSX.Element;
38
+ export default TabTitle;
@@ -1,24 +1,18 @@
1
1
  import React from 'react';
2
- import { TabsProps as BlueprintTabsProbs, TabProps as BlueprintTabProbs } from "@blueprintjs/core";
3
- export interface TabProps extends BlueprintTabProbs {
4
- titlePrefix?: React.ReactNode;
5
- titleSuffix?: React.ReactNode;
6
- dontShrink?: boolean;
7
- large?: boolean;
8
- small?: boolean;
9
- }
10
- export interface DeprecatedTabProps {
11
- tabId: string;
12
- tabTitle: React.ReactNode;
13
- tabContent?: JSX.Element;
14
- dontShrink?: boolean;
15
- }
16
- interface TabsProps extends Omit<BlueprintTabsProbs, "vertical" | "onChange" | "large"> {
17
- activeTab: string;
18
- tabs: any[];
19
- onTabClick: ({ props }: any) => void;
20
- prefixTabNames?: string;
2
+ import { TabsProps as BlueprintTabsProps } from "@blueprintjs/core";
3
+ import { TabProps } from "./Tab";
4
+ interface TabsProps extends Omit<BlueprintTabsProps, "vertical" | "large" | "animate"> {
5
+ children?: React.ReactNode;
6
+ /**
7
+ * Data structure containing all tabs, including their titles and content panels.
8
+ * Currently it is not possible to add `Tab` elements direct as children elements to the `<Tabs>` container.
9
+ */
10
+ tabs?: TabProps[];
11
+ /**
12
+ * Allow scrollbars on the tabs header.
13
+ * Otherwise they will be shrinked if not enough space.
14
+ */
21
15
  allowScrollbars?: boolean;
22
16
  }
23
- declare function Tabs({ activeTab, tabs, onTabClick, prefixTabNames, className, allowScrollbars, ...restProps }: TabsProps): JSX.Element;
17
+ declare function Tabs({ tabs, children, className, allowScrollbars, ...restProps }: TabsProps): JSX.Element;
24
18
  export default Tabs;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { TagProps as BlueprintTagProps } from "@blueprintjs/core";
3
3
  import Color from "color";
4
- interface TagProps extends Omit<BlueprintTagProps, "active" | "fill" | "large" | "multiline" | "intent" | "rightIcon" | "round"> {
4
+ interface TagProps extends Omit<BlueprintTagProps, "active" | "fill" | "large" | "multiline" | "intent" | "rightIcon"> {
5
5
  /**
6
6
  * Sets the background color of a tag, depends on the `Color` object provided by the
7
7
  * [npm color module](https://www.npmjs.com/package/color) v3. You can use it with
@@ -1,4 +1,4 @@
1
1
  import { EdgeDefaultProps } from "./EdgeDefault";
2
2
  import { EdgeStepProps } from "./EdgeStep";
3
- export declare const drawEdgeStraight: ({ sourceX, sourceY, targetX, targetY, }: EdgeDefaultProps) => string;
3
+ export declare const drawEdgeStraight: ({ sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition, }: EdgeDefaultProps) => string;
4
4
  export declare const drawEdgeStep: ({ sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition, data, }: EdgeStepProps) => string;
@@ -3,11 +3,11 @@ 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
- declare type HighlightingState = "success" | "warning" | "danger" | "match" | "altmatch";
6
+ export declare type HighlightingState = "success" | "warning" | "danger" | "match" | "altmatch";
7
7
  export interface IHandleProps extends HandleProps {
8
8
  category?: "configuration";
9
9
  }
10
- interface NodeContentData {
10
+ interface NodeContentData<CONTENT_PROPS = any> {
11
11
  /**
12
12
  * Name of icon that should be displayed before the node label.
13
13
  * Must be a name from our list of canonical icon names.
@@ -24,13 +24,13 @@ interface NodeContentData {
24
24
  /**
25
25
  * Content element, displayed in the node body.
26
26
  */
27
- content?: React.ReactNode;
27
+ content?: React.ReactNode | ((adjustedContentProps: Partial<CONTENT_PROPS>) => React.ReactNode);
28
28
  /**
29
29
  * Content extension, displayed at the bottom side of a node.
30
30
  */
31
31
  contentExtension?: React.ReactNode;
32
32
  }
33
- export interface NodeContentProps<T> extends NodeContentData, React.HTMLAttributes<HTMLDivElement> {
33
+ export interface NodeContentProps<NODE_DATA, NODE_CONTENT_PROPS = any> extends NodeContentData, React.HTMLAttributes<HTMLDivElement> {
34
34
  /**
35
35
  * Size of the node.
36
36
  * If `minimalShape` is not set to `none`then the configured size definition is only used for the selected node state.
@@ -57,7 +57,7 @@ export interface NodeContentProps<T> extends NodeContentData, React.HTMLAttribut
57
57
  /**
58
58
  * Set of defined buttons and icons that can be displayed.
59
59
  */
60
- executionButtons?: () => React.ReactNode;
60
+ executionButtons?: (adjustedContentProps: Partial<NODE_CONTENT_PROPS>, setAdjustedContentProps: React.Dispatch<React.SetStateAction<Partial<NODE_CONTENT_PROPS>>>) => React.ReactElement<NODE_CONTENT_PROPS>;
61
61
  /**
62
62
  * Can be used for permanent action button or context menu.
63
63
  * It is displayed at the node header right to the label.
@@ -80,7 +80,7 @@ export interface NodeContentProps<T> extends NodeContentData, React.HTMLAttribut
80
80
  * Callback function to provide content for the tooltip on a node with a defined `minimalShape`.
81
81
  * If you do not want a tooltip in this state you need to provide a callback that returns an empty value.
82
82
  */
83
- getMinimalTooltipData?: (node: NodeProps<T>) => NodeContentData;
83
+ getMinimalTooltipData?: (node: NodeProps<NODE_DATA>) => NodeContentData;
84
84
  /**
85
85
  * Set if a handle is displayed even if it does not allow a connection to an edge.
86
86
  */
@@ -90,7 +90,7 @@ export interface NodeContentProps<T> extends NodeContentData, React.HTMLAttribut
90
90
  */
91
91
  animated?: boolean;
92
92
  /** Additional data stored in the node. */
93
- businessData?: T;
93
+ businessData?: NODE_DATA;
94
94
  /**
95
95
  * This property is only forwarded from the `NodeDefault` element.
96
96
  * If set then it will be always overwritten internally.
@@ -117,5 +117,5 @@ export declare const gethighlightedStateClasses: (state: any, baseClassName: any
117
117
  * The `NodeContent` element manages the main view of how a node is displaying which content.
118
118
  * 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
119
  */
120
- export declare const NodeContent: ({ 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;
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;
121
121
  export {};
@@ -1,12 +1,12 @@
1
1
  import React from "react";
2
2
  import { NodeProps as ReactFlowNodeProps } from "react-flow-renderer";
3
3
  import { NodeContentProps } from "./NodeContent";
4
- export interface NodeProps<T> extends ReactFlowNodeProps {
4
+ export interface NodeProps<NODE_DATA, NODE_CONTENT_PROPS = any> extends ReactFlowNodeProps {
5
5
  /**
6
6
  * Contains all properties for our implementation of the React-Flow node.
7
7
  * For details pls see the `NodeContent` element documentation.
8
8
  */
9
- data: NodeContentProps<T>;
9
+ data: NodeContentProps<NODE_DATA, NODE_CONTENT_PROPS>;
10
10
  }
11
11
  /**
12
12
  * The `NodeDefault` element manages the display of React-Flow nodes.
@@ -1,8 +1,9 @@
1
1
  import React from "react";
2
2
  import { IPopoverProps as IBlueprintPopoverProps } from "@blueprintjs/core";
3
+ import { ValidIconName } from "../../../components/Icon/canonicalIconNames";
3
4
  export interface NodeToolsProps extends IBlueprintPopoverProps {
4
5
  children: string | JSX.Element;
5
- togglerElement?: string | JSX.Element;
6
+ togglerElement?: ValidIconName | JSX.Element;
6
7
  togglerText?: string;
7
8
  menuButtonDataTestId?: string;
8
9
  }
@@ -1,13 +1,13 @@
1
1
  /// <reference types="react" />
2
2
  export declare const nodeTypes: {
3
- default: import("react").MemoExoticComponent<(node: import("./NodeDefault").NodeProps<any>) => JSX.Element>;
4
- graphNode: import("react").MemoExoticComponent<(node: import("./NodeDefault").NodeProps<any>) => JSX.Element>;
5
- classNode: import("react").MemoExoticComponent<(node: import("./NodeDefault").NodeProps<any>) => JSX.Element>;
6
- instanceNode: import("react").MemoExoticComponent<(node: import("./NodeDefault").NodeProps<any>) => JSX.Element>;
7
- propertyNode: import("react").MemoExoticComponent<(node: import("./NodeDefault").NodeProps<any>) => JSX.Element>;
8
- datasetNode: import("react").MemoExoticComponent<(node: import("./NodeDefault").NodeProps<any>) => JSX.Element>;
9
- linkingNode: import("react").MemoExoticComponent<(node: import("./NodeDefault").NodeProps<any>) => JSX.Element>;
10
- transformNode: import("react").MemoExoticComponent<(node: import("./NodeDefault").NodeProps<any>) => JSX.Element>;
11
- taskNode: import("react").MemoExoticComponent<(node: import("./NodeDefault").NodeProps<any>) => JSX.Element>;
12
- workflowNode: import("react").MemoExoticComponent<(node: import("./NodeDefault").NodeProps<any>) => JSX.Element>;
3
+ default: import("react").MemoExoticComponent<(node: import("./NodeDefault").NodeProps<any, any>) => JSX.Element>;
4
+ graphNode: import("react").MemoExoticComponent<(node: import("./NodeDefault").NodeProps<any, any>) => JSX.Element>;
5
+ classNode: import("react").MemoExoticComponent<(node: import("./NodeDefault").NodeProps<any, any>) => JSX.Element>;
6
+ instanceNode: import("react").MemoExoticComponent<(node: import("./NodeDefault").NodeProps<any, any>) => JSX.Element>;
7
+ propertyNode: import("react").MemoExoticComponent<(node: import("./NodeDefault").NodeProps<any, any>) => JSX.Element>;
8
+ datasetNode: import("react").MemoExoticComponent<(node: import("./NodeDefault").NodeProps<any, any>) => JSX.Element>;
9
+ linkingNode: import("react").MemoExoticComponent<(node: import("./NodeDefault").NodeProps<any, any>) => JSX.Element>;
10
+ transformNode: import("react").MemoExoticComponent<(node: import("./NodeDefault").NodeProps<any, any>) => JSX.Element>;
11
+ taskNode: import("react").MemoExoticComponent<(node: import("./NodeDefault").NodeProps<any, any>) => JSX.Element>;
12
+ workflowNode: import("react").MemoExoticComponent<(node: import("./NodeDefault").NodeProps<any, any>) => JSX.Element>;
13
13
  };
@@ -9,6 +9,9 @@ import ApplicationToolbar from "./components/Application/ApplicationToolbar";
9
9
  import ApplicationToolbarSection from "./components/Application/ApplicationToolbarSection";
10
10
  import ApplicationToolbarAction from "./components/Application/ApplicationToolbarAction";
11
11
  import ApplicationToolbarPanel from "./components/Application/ApplicationToolbarPanel";
12
+ import AutoSuggestion from "./components/AutoSuggestion/AutoSuggestion";
13
+ import { AutoSuggestionList } from "./components/AutoSuggestion/AutoSuggestionList";
14
+ import SingleLineCodeEditor from "./components/AutoSuggestion/SingleLineCodeEditor";
12
15
  import HtmlContentBlock from "./components/Typography/HtmlContentBlock";
13
16
  import OverflowText from "./components/Typography/OverflowText";
14
17
  import WhiteSpaceContainer from "./components/Typography/WhiteSpaceContainer";
@@ -27,6 +30,8 @@ import Button from "./components/Button/Button";
27
30
  import Checkbox from "./components/Checkbox/Checkbox";
28
31
  import RadioButton from "./components/RadioButton/RadioButton";
29
32
  import Tabs from "./components/Tabs/Tabs";
33
+ import Tab from "./components/Tabs/Tab";
34
+ import TabTitle from "./components/Tabs/TabTitle";
30
35
  import TextField from "./components/TextField/TextField";
31
36
  import TextArea from "./components/TextField/TextArea";
32
37
  import SearchField from "./components/TextField/SearchField";
@@ -47,6 +52,7 @@ import TagList from "./components/Tag/TagList";
47
52
  import Notification from "./components/Notification/Notification";
48
53
  import Toast from "./components/Notification/Toast";
49
54
  import { Select } from "@blueprintjs/select";
55
+ import MultiSelect from "./components/MultiSelect/MultiSelect";
50
56
  import { Iframe } from "./components/Iframe/Iframe";
51
57
  import { IframeModal } from "./components/Iframe/IframeModal";
52
58
  import { OverviewItem, OverviewItemActions, OverviewItemDepiction, OverviewItemDescription, OverviewItemLine, OverviewItemList } from "./components/OverviewItem";
@@ -75,6 +81,7 @@ import { PropertyName, PropertyValue, PropertyValuePair, PropertyValueList } fro
75
81
  import * as TypographyClassNames from "./components/Typography/classnames";
76
82
  import { ProgressBar } from "./components/ProgressBar/ProgressBar";
77
83
  import List from "./components/List/List";
84
+ import * as LegacyReplacements from "./legacy-replacements";
78
85
  declare const HelperClasses: {
79
86
  Typography: typeof TypographyClassNames;
80
87
  Intent: {
@@ -84,9 +91,9 @@ declare const HelperClasses: {
84
91
  declare const Utilities: {
85
92
  openInNewTab: (event: import("react").MouseEvent<HTMLElement, MouseEvent>, handler?: ((e: import("react").MouseEvent<HTMLElement, MouseEvent>) => void) | undefined, url?: string | undefined) => void;
86
93
  };
87
- export { ApplicationContainer, ApplicationHeader, ApplicationContent, ApplicationSidebarNavigation, ApplicationSidebarToggler, ApplicationTitle, ApplicationToolbar, ApplicationToolbarSection, ApplicationToolbarAction, ApplicationToolbarPanel, 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, TextField, TextArea, SearchField, Switch, // TODO: scss styles
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
88
95
  NumericInput, // TODO: scss styles
89
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
90
- AutoCompleteField, ProgressBar, Iframe, IframeModal, Utilities };
97
+ MultiSelect, AutoCompleteField, ProgressBar, Iframe, IframeModal, Utilities, LegacyReplacements, };
91
98
  export * from "./cmem";
92
99
  export * from "./extensions/react-flow";
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function AffirmativeButtonReplacement({ children, ...otherProps }: any): JSX.Element;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export declare const iconMappings: {
3
+ [key: string]: any;
4
+ };
5
+ export declare function ButtonReplacement({ children, className, fabSize, iconName, tooltip, progress, disabled, affirmative, dismissive, disruptive, raised, colored, ...otherProps }: any): JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function DismissiveButtonReplacement({ children, ...otherProps }: any): JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function DisruptiveButtonReplacement({ children, ...otherProps }: any): JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function CheckboxReplacement({ children, checked, className, disabled, label, onChange, ...otherProps }: any): JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function RadioButtonReplacement({ children, label, ...otherProps }: any): JSX.Element;
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import { TabsProps as BlueprintTabsProps } from "@blueprintjs/core";
3
+ interface TabsProps extends Omit<BlueprintTabsProps, "vertical" | "onChange" | "large" | "id" | "renderActiveTabPanelOnly"> {
4
+ activeTab: string;
5
+ tabs: DeprecatedTabProps[];
6
+ onTabClick?: ({ props }: any) => void;
7
+ prefixTabNames: string;
8
+ allowScrollbars?: boolean;
9
+ /**
10
+ * If controlled usage is enable then a `onTabClick` handler is ncessary to control tab panel content and `activeTab` updates.
11
+ */
12
+ controlled?: boolean;
13
+ }
14
+ export interface DeprecatedTabProps {
15
+ tabId: string;
16
+ tabTitle: React.ReactNode;
17
+ tabContent?: JSX.Element;
18
+ dontShrink?: boolean;
19
+ className?: string;
20
+ }
21
+ export declare function TabsReplacement({ activeTab, tabs, onTabClick, controlled, prefixTabNames, className, allowScrollbars, ...restProps }: TabsProps): JSX.Element;
22
+ export {};
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function TextFieldReplacement({ className, disabled, error, inputClassName, label, multiline, onChange, onClearValue, required, stretch, value, ...otherProps }: any): JSX.Element;
@@ -0,0 +1,10 @@
1
+ export { ButtonReplacement as Button } from "./Button/Button";
2
+ export { AffirmativeButtonReplacement as AffirmativeButton } from "./Button/AffirmativeButton";
3
+ export { DismissiveButtonReplacement as DismissiveButton } from "./Button/DismissiveButton";
4
+ export { DisruptiveButtonReplacement as DisruptiveButton } from "./Button/DisruptiveButton";
5
+ export { ButtonReplacement as ProgressButton } from "./Button/Button";
6
+ export { CheckboxReplacement as Checkbox } from "./Checkbox/Checkbox";
7
+ export { RadioButtonReplacement as Radio } from "./Radio/RadioButton";
8
+ export { TabsReplacement as Tabs } from "./Tabs/Tabs";
9
+ export { TextFieldReplacement as TextField } from "./TextField/TextField";
10
+ export type { DeprecatedTabProps } from "./Tabs/Tabs";
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": "22.0.1",
4
+ "version": "22.1.0-rc.0",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/eccenca/gui-elements",
7
7
  "keywords": [
@@ -42,7 +42,7 @@
42
42
  "src"
43
43
  ],
44
44
  "scripts": {
45
- "build:clean": "rm -rf dist/",
45
+ "build:clean": "rimraf dist/",
46
46
  "build:es5": "tsc --build .typescript/tsbuild-es5.json && ./scripts/fix-es5-dist",
47
47
  "build:cjs": "tsc --build .typescript/tsbuild-cjs.json && ./scripts/fix-cjs-dist",
48
48
  "build:all": "yarn build:clean && yarn build:es5 && yarn build:cjs",
@@ -64,12 +64,14 @@
64
64
  "carbon-components": "10.44.0",
65
65
  "carbon-components-react": "7.44.1",
66
66
  "carbon-icons": "7.0.7",
67
- "codemirror": "^5.52.2",
67
+ "codemirror": "^5.61.0",
68
68
  "color": "3.2.1",
69
+ "lodash": "^4.17.21",
69
70
  "micromark": "^3.0.10",
70
71
  "react": "^16.13.1",
72
+ "react-codemirror2": "^7.2.1",
71
73
  "react-dom": "^16.13.1",
72
- "react-flow-renderer": "^9.6.1",
74
+ "react-flow-renderer": "9.7.4",
73
75
  "react-markdown": "^7.0.1",
74
76
  "rehype-raw": "^6.1.0",
75
77
  "remark-definition-list": "^1.1.0",
@@ -96,24 +98,28 @@
96
98
  "@testing-library/jest-dom": "^5.16.1",
97
99
  "@testing-library/react": "^12.1.2",
98
100
  "@types/carbon-components-react": "^7.49.0",
99
- "@types/carbon__icons-react": "^10.31.2",
101
+ "@types/codemirror": "^5.60.5",
100
102
  "@types/color": "^3.0.2",
101
103
  "@types/jest": "^24.9.1",
104
+ "@types/lodash": "^4.14.182",
102
105
  "@typescript-eslint/eslint-plugin": "^4.33.0",
103
106
  "@typescript-eslint/parser": "^4.33.0",
104
107
  "babel-jest": "^27.5.1",
105
108
  "chromatic": "^6.5.1",
109
+ "copyfiles": "^2.4.1",
106
110
  "css-loader": "3.4.2",
107
111
  "eslint": "^7.32.0",
108
112
  "eslint-config-react-app": "^6.0.0",
113
+ "identity-obj-proxy": "^3.0.0",
109
114
  "jest": "^26.6.3",
110
115
  "jest-environment-jsdom-fourteen": "1.0.1",
111
116
  "jest-pnp-resolver": "^1.2.1",
112
- "node-sass": "4.12.0",
117
+ "node-sass": "4.14.1",
113
118
  "node-sass-tilde-importer": "^1.0.2",
114
119
  "react-app-polyfill": "^1.0.6",
115
120
  "react-lorem-ipsum": "^1.4.9",
116
121
  "regenerator-runtime": "^0.13.9",
122
+ "rimraf": "^3.0.2",
117
123
  "sass-loader": "8.0.2",
118
124
  "style-loader": "0.23.1",
119
125
  "typescript": "4.4.4",
@@ -171,6 +177,9 @@
171
177
  "web.jsx",
172
178
  "jsx",
173
179
  "node"
174
- ]
180
+ ],
181
+ "moduleNameMapper": {
182
+ "\\.(css|scss)$": "identity-obj-proxy"
183
+ }
175
184
  }
176
185
  }
@@ -18,7 +18,7 @@ export interface IActivityStatus {
18
18
  // If the activity has been cancelled
19
19
  cancelled: boolean;
20
20
  // The concrete status ID
21
- concreteStatus: "Cancelled" | "Failed" | "Successful" | "Not executed" | "Running" | "Waiting" | "Canceling";
21
+ concreteStatus: ConcreteActivityStatus;
22
22
  // If there was an error, this contains the exception message
23
23
  exceptionMessage?: string | null;
24
24
  // The runtime in ms
@@ -26,3 +26,5 @@ export interface IActivityStatus {
26
26
  // The start time as date time, e.g. "2021-09-07T09:34:53.153Z"
27
27
  startTime?: string;
28
28
  }
29
+
30
+ export type ConcreteActivityStatus = "Cancelled" | "Failed" | "Successful" | "Not executed" | "Running" | "Waiting" | "Canceling"
@@ -0,0 +1,98 @@
1
+ import React from "react";
2
+ import { ComponentStory, ComponentMeta } from "@storybook/react";
3
+
4
+ import { ActivityControlWidget } from "./ActivityControlWidget";
5
+ import { loremIpsum, name } from "react-lorem-ipsum";
6
+ import Tag from "../../components/Tag/Tag";
7
+ import TagList from "../../components/Tag/TagList";
8
+
9
+ export default {
10
+ title: "Cmem/ActivityControlWidget",
11
+ component: ActivityControlWidget,
12
+ argTypes: {
13
+ border: {
14
+ table: {
15
+ defaultValue: { summary: false },
16
+ type: { summary: "boolean" },
17
+ },
18
+ },
19
+ small: {
20
+ table: {
21
+ defaultValue: { summary: false },
22
+ type: { summary: "boolean" },
23
+ },
24
+ },
25
+ canShrink: {
26
+ table: {
27
+ defaultValue: { summary: false },
28
+ type: { summary: "boolean" },
29
+ },
30
+ },
31
+ },
32
+ } as ComponentMeta<typeof ActivityControlWidget>;
33
+
34
+ const Template: ComponentStory<typeof ActivityControlWidget> = (args) => <ActivityControlWidget {...args} />;
35
+
36
+ export const FullExample = Template.bind({});
37
+
38
+ const actions = [
39
+ {
40
+ "data-test-id": "activity-reload-activity",
41
+ icon: "item-reload",
42
+ action: () => {},
43
+ tooltip: "Reload Activity",
44
+ disabled: false,
45
+ },
46
+ {
47
+ "data-test-id": "activity-start-activity",
48
+ icon: "item-start",
49
+ action: () => console.log("start"),
50
+ tooltip: "Start Activity",
51
+ disabled: false,
52
+ },
53
+ {
54
+ "data-test-id": "activity-stop-activity",
55
+ icon: "item-stop",
56
+ action: () => console.log("cancel"),
57
+ tooltip: "Stop Activity",
58
+ disabled: false,
59
+ },
60
+ {
61
+ "data-test-id": "activity-view-data",
62
+ icon: "artefact-rawdata",
63
+ action: () => {},
64
+ tooltip: "preview report",
65
+ },
66
+ ];
67
+
68
+ const commonWidgetArgs = {
69
+ label: loremIpsum({ p: 1, avgSentencesPerParagraph: 1, avgWordsPerSentence: 4 }),
70
+ border: true,
71
+ activityActions: actions,
72
+ statusMessage: loremIpsum({ p: 1, startWithLoremIpsum: false }),
73
+ progressSpinner: {
74
+ intent: "none",
75
+ value: 0.5,
76
+ },
77
+ };
78
+
79
+ FullExample.args = {
80
+ ...commonWidgetArgs,
81
+ };
82
+
83
+ const TemplateWithTags: ComponentStory<typeof ActivityControlWidget> = (args) => <ActivityControlWidget {...args} />;
84
+
85
+ export const WidgetWithTags = TemplateWithTags.bind({});
86
+
87
+ const widgetTags = (
88
+ <TagList>
89
+ <Tag small>{name()}</Tag>
90
+ <Tag small>{name()}</Tag>
91
+ <Tag small>{name()}</Tag>
92
+ </TagList>
93
+ );
94
+
95
+ WidgetWithTags.args = {
96
+ ...commonWidgetArgs,
97
+ tags: widgetTags,
98
+ };