@eccenca/gui-elements 23.1.0-easynav.2 → 23.1.0-easynav.4

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 (177) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js +6 -4
  3. package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
  4. package/dist/cjs/cmem/ActivityControl/SilkActivityControl.js +33 -8
  5. package/dist/cjs/cmem/ActivityControl/SilkActivityControl.js.map +1 -1
  6. package/dist/cjs/cmem/ConfidenceValue/ConfidenceValue.js +52 -0
  7. package/dist/cjs/cmem/ConfidenceValue/ConfidenceValue.js.map +1 -0
  8. package/dist/cjs/cmem/ConfidenceValue/index.js +14 -0
  9. package/dist/cjs/cmem/ConfidenceValue/index.js.map +1 -0
  10. package/dist/cjs/cmem/index.js +11 -0
  11. package/dist/cjs/cmem/index.js.map +1 -1
  12. package/dist/cjs/common/utils/CssCustomProperties.js.map +1 -1
  13. package/dist/cjs/components/AutoSuggestion/SingleLineCodeEditor.js +8 -10
  14. package/dist/cjs/components/AutoSuggestion/SingleLineCodeEditor.js.map +1 -1
  15. package/dist/cjs/components/Card/Card.js +7 -6
  16. package/dist/cjs/components/Card/Card.js.map +1 -1
  17. package/dist/cjs/components/Card/CardContent.js +4 -2
  18. package/dist/cjs/components/Card/CardContent.js.map +1 -1
  19. package/dist/cjs/components/Card/CardHeader.js.map +1 -1
  20. package/dist/cjs/components/Icon/canonicalIconNames.js +6 -0
  21. package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
  22. package/dist/cjs/components/Pagination/Pagination.js +24 -9
  23. package/dist/cjs/components/Pagination/Pagination.js.map +1 -1
  24. package/dist/cjs/components/ProgressBar/index.js +14 -0
  25. package/dist/cjs/components/ProgressBar/index.js.map +1 -0
  26. package/dist/cjs/components/Switch/Switch.js +2 -2
  27. package/dist/cjs/components/Switch/Switch.js.map +1 -1
  28. package/dist/cjs/components/Table/Table.js +45 -0
  29. package/dist/cjs/components/Table/Table.js.map +1 -0
  30. package/dist/cjs/components/{SimpleTable → Table}/TableContainer.js +7 -8
  31. package/dist/cjs/components/Table/TableContainer.js.map +1 -0
  32. package/dist/cjs/components/Table/TableExpandHeader.js +34 -0
  33. package/dist/cjs/components/Table/TableExpandHeader.js.map +1 -0
  34. package/dist/cjs/components/Table/TableExpandRow.js +42 -0
  35. package/dist/cjs/components/Table/TableExpandRow.js.map +1 -0
  36. package/dist/cjs/components/Table/index.js +29 -0
  37. package/dist/cjs/components/Table/index.js.map +1 -0
  38. package/dist/cjs/components/Tag/TagList.js.map +1 -1
  39. package/dist/cjs/components/Tag/index.js +11 -0
  40. package/dist/cjs/components/Tag/index.js.map +1 -0
  41. package/dist/cjs/components/TextField/TextField.js +25 -9
  42. package/dist/cjs/components/TextField/TextField.js.map +1 -1
  43. package/dist/cjs/components/index.js +4 -0
  44. package/dist/cjs/components/index.js.map +1 -1
  45. package/dist/cjs/index.js +3 -19
  46. package/dist/cjs/index.js.map +1 -1
  47. package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js +6 -4
  48. package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
  49. package/dist/esm/cmem/ActivityControl/SilkActivityControl.js +35 -10
  50. package/dist/esm/cmem/ActivityControl/SilkActivityControl.js.map +1 -1
  51. package/dist/esm/cmem/ConfidenceValue/ConfidenceValue.js +56 -0
  52. package/dist/esm/cmem/ConfidenceValue/ConfidenceValue.js.map +1 -0
  53. package/dist/esm/cmem/ConfidenceValue/index.js +2 -0
  54. package/dist/esm/cmem/ConfidenceValue/index.js.map +1 -0
  55. package/dist/esm/cmem/index.js +1 -0
  56. package/dist/esm/cmem/index.js.map +1 -1
  57. package/dist/esm/common/utils/CssCustomProperties.js.map +1 -1
  58. package/dist/esm/components/AutoSuggestion/SingleLineCodeEditor.js +8 -10
  59. package/dist/esm/components/AutoSuggestion/SingleLineCodeEditor.js.map +1 -1
  60. package/dist/esm/components/Card/Card.js +7 -6
  61. package/dist/esm/components/Card/Card.js.map +1 -1
  62. package/dist/esm/components/Card/CardContent.js +4 -2
  63. package/dist/esm/components/Card/CardContent.js.map +1 -1
  64. package/dist/esm/components/Card/CardHeader.js.map +1 -1
  65. package/dist/esm/components/Icon/canonicalIconNames.js +6 -0
  66. package/dist/esm/components/Icon/canonicalIconNames.js.map +1 -1
  67. package/dist/esm/components/Pagination/Pagination.js +25 -10
  68. package/dist/esm/components/Pagination/Pagination.js.map +1 -1
  69. package/dist/esm/components/ProgressBar/index.js +2 -0
  70. package/dist/esm/components/ProgressBar/index.js.map +1 -0
  71. package/dist/esm/components/Switch/Switch.js +2 -2
  72. package/dist/esm/components/Switch/Switch.js.map +1 -1
  73. package/dist/esm/components/Table/Table.js +50 -0
  74. package/dist/esm/components/Table/Table.js.map +1 -0
  75. package/dist/esm/components/{SimpleTable → Table}/TableContainer.js +7 -8
  76. package/dist/esm/components/Table/TableContainer.js.map +1 -0
  77. package/dist/esm/components/Table/TableExpandHeader.js +40 -0
  78. package/dist/esm/components/Table/TableExpandHeader.js.map +1 -0
  79. package/dist/esm/components/Table/TableExpandRow.js +48 -0
  80. package/dist/esm/components/Table/TableExpandRow.js.map +1 -0
  81. package/dist/esm/components/Table/index.js +15 -0
  82. package/dist/esm/components/Table/index.js.map +1 -0
  83. package/dist/esm/components/Tag/TagList.js.map +1 -1
  84. package/dist/esm/components/Tag/index.js +4 -0
  85. package/dist/esm/components/Tag/index.js.map +1 -0
  86. package/dist/esm/components/TextField/TextField.js +26 -10
  87. package/dist/esm/components/TextField/TextField.js.map +1 -1
  88. package/dist/esm/components/index.js +4 -0
  89. package/dist/esm/components/index.js.map +1 -1
  90. package/dist/esm/index.js +3 -8
  91. package/dist/esm/index.js.map +1 -1
  92. package/dist/types/cmem/ActivityControl/ActivityControlWidget.d.ts +1 -1
  93. package/dist/types/cmem/ActivityControl/SilkActivityControl.d.ts +6 -2
  94. package/dist/types/cmem/ConfidenceValue/ConfidenceValue.d.ts +46 -0
  95. package/dist/types/cmem/ConfidenceValue/index.d.ts +1 -0
  96. package/dist/types/cmem/index.d.ts +1 -0
  97. package/dist/types/common/utils/CssCustomProperties.d.ts +1 -1
  98. package/dist/types/components/Card/Card.d.ts +5 -1
  99. package/dist/types/components/Card/CardContent.d.ts +7 -1
  100. package/dist/types/components/Card/CardHeader.d.ts +9 -1
  101. package/dist/types/components/Icon/IconButton.d.ts +1 -1
  102. package/dist/types/components/Icon/canonicalIconNames.d.ts +1 -1
  103. package/dist/types/components/Pagination/Pagination.d.ts +5 -1
  104. package/dist/types/components/ProgressBar/index.d.ts +1 -0
  105. package/dist/types/components/Switch/Switch.d.ts +5 -1
  106. package/dist/types/components/Table/Table.d.ts +32 -0
  107. package/dist/types/components/Table/TableContainer.d.ts +13 -0
  108. package/dist/types/components/Table/TableExpandHeader.d.ts +13 -0
  109. package/dist/types/components/Table/TableExpandRow.d.ts +13 -0
  110. package/dist/types/components/Table/index.d.ts +13 -0
  111. package/dist/types/components/Tag/Tag.d.ts +1 -1
  112. package/dist/types/components/Tag/TagList.d.ts +5 -2
  113. package/dist/types/components/Tag/index.d.ts +4 -0
  114. package/dist/types/components/TextField/TextField.d.ts +9 -0
  115. package/dist/types/components/index.d.ts +4 -0
  116. package/dist/types/index.d.ts +1 -6
  117. package/package.json +1 -1
  118. package/src/cmem/ActivityControl/ActivityControlWidget.tsx +5 -5
  119. package/src/cmem/ActivityControl/SilkActivityControl.tsx +44 -17
  120. package/src/cmem/ConfidenceValue/ConfidenceValue.stories.tsx +22 -0
  121. package/src/cmem/ConfidenceValue/ConfidenceValue.tsx +116 -0
  122. package/src/cmem/ConfidenceValue/confidencevalue.scss +49 -0
  123. package/src/cmem/ConfidenceValue/index.ts +1 -0
  124. package/src/cmem/_index.scss +1 -0
  125. package/src/cmem/index.ts +2 -0
  126. package/src/common/utils/CssCustomProperties.ts +1 -1
  127. package/src/components/AutoSuggestion/SingleLineCodeEditor.tsx +8 -10
  128. package/src/components/AutoSuggestion/tests/SingleLineCodeEditor.test.tsx +5 -0
  129. package/src/components/Badge/badge.scss +2 -5
  130. package/src/components/Card/Card.tsx +11 -5
  131. package/src/components/Card/CardContent.tsx +12 -1
  132. package/src/components/Card/CardHeader.tsx +9 -1
  133. package/src/components/Card/card.scss +108 -3
  134. package/src/components/Checkbox/checkbox.scss +6 -2
  135. package/src/components/Icon/IconButton.tsx +1 -1
  136. package/src/components/Icon/canonicalIconNames.tsx +13 -0
  137. package/src/components/Menu/menu.scss +4 -0
  138. package/src/components/OverviewItem/overviewitem.scss +2 -2
  139. package/src/components/Pagination/Pagination.tsx +29 -9
  140. package/src/components/Pagination/pagination.scss +16 -0
  141. package/src/components/ProgressBar/index.ts +1 -0
  142. package/src/components/Switch/Switch.tsx +6 -2
  143. package/src/components/Table/Table.tsx +88 -0
  144. package/src/components/Table/TableContainer.tsx +49 -0
  145. package/src/components/Table/TableExpandHeader.tsx +51 -0
  146. package/src/components/Table/TableExpandRow.tsx +64 -0
  147. package/src/components/Table/index.tsx +41 -0
  148. package/src/components/Table/table.scss +318 -0
  149. package/src/components/Tag/Tag.tsx +1 -1
  150. package/src/components/Tag/TagList.tsx +5 -3
  151. package/src/components/Tag/index.ts +5 -0
  152. package/src/components/Tag/{Tag.stories.tsx → stories/Tag.stories.tsx} +3 -2
  153. package/src/components/Tag/stories/TagList.stories.tsx +28 -0
  154. package/src/components/Tag/tag.scss +1 -0
  155. package/src/components/TextField/TextField.tsx +43 -12
  156. package/src/components/TextField/stories/TextField.stories.tsx +3 -0
  157. package/src/components/TextField/textfield.scss +23 -1
  158. package/src/components/Tree/tree.scss +4 -0
  159. package/src/components/index.scss +1 -0
  160. package/src/components/index.ts +5 -0
  161. package/src/extensions/react-flow/_config.scss +1 -1
  162. package/src/extensions/react-flow/edges/_edges.scss +25 -24
  163. package/src/extensions/react-flow/edges/stories/EdgeLabel.stories.tsx +3 -2
  164. package/src/extensions/react-flow/nodes/_nodes.scss +3 -4
  165. package/src/index.scss +0 -1
  166. package/src/index.ts +5 -38
  167. package/dist/cjs/components/SimpleTable/TableContainer.js.map +0 -1
  168. package/dist/cjs/components/SimpleTable/index.js +0 -16
  169. package/dist/cjs/components/SimpleTable/index.js.map +0 -1
  170. package/dist/esm/components/SimpleTable/TableContainer.js.map +0 -1
  171. package/dist/esm/components/SimpleTable/index.js +0 -4
  172. package/dist/esm/components/SimpleTable/index.js.map +0 -1
  173. package/dist/types/components/SimpleTable/TableContainer.d.ts +0 -3
  174. package/dist/types/components/SimpleTable/index.d.ts +0 -3
  175. package/src/components/SimpleTable/TableContainer.tsx +0 -20
  176. package/src/components/SimpleTable/index.tsx +0 -4
  177. package/src/components/SimpleTable/simpletable.scss +0 -180
@@ -44,8 +44,6 @@ import MenuDivider from "./components/Menu/MenuDivider";
44
44
  import ContextOverlay from "./components/ContextOverlay/ContextOverlay";
45
45
  import ContextMenu from "./components/ContextOverlay/ContextMenu";
46
46
  import Pagination from "./components/Pagination/Pagination";
47
- import Tag from "./components/Tag/Tag";
48
- import TagList from "./components/Tag/TagList";
49
47
  import Notification from "./components/Notification/Notification";
50
48
  import Toast from "./components/Notification/Toast";
51
49
  import Select from "./components/Select/Select";
@@ -53,7 +51,6 @@ import MultiSelect from "./components/MultiSelect/MultiSelect";
53
51
  import { Iframe } from "./components/Iframe/Iframe";
54
52
  import { IframeModal } from "./components/Iframe/IframeModal";
55
53
  import { OverviewItem, OverviewItemActions, OverviewItemDepiction, OverviewItemDescription, OverviewItemLine, OverviewItemList } from "./components/OverviewItem";
56
- import { TableContainer, Table, TableHead, TableRow, TableBody, TableCell, TableHeader } from "./components/SimpleTable";
57
54
  import BreadcrumbList from "./components/Breadcrumb/BreadcrumbList";
58
55
  import BreadcrumbItem from "./components/Breadcrumb/BreadcrumbItem";
59
56
  import Modal from "./components/Dialog/Modal";
@@ -76,7 +73,6 @@ import Link from "./components/Link/Link";
76
73
  import Spinner from "./components/Spinner/Spinner";
77
74
  import InteractionGate from "./components/InteractionGate/InteractionGate";
78
75
  import { PropertyName, PropertyValue, PropertyValuePair, PropertyValueList } from "./components/PropertyValuePair";
79
- import { ProgressBar } from "./components/ProgressBar/ProgressBar";
80
76
  import List from "./components/List/List";
81
77
  import * as LegacyReplacements from "./legacy-replacements";
82
78
  import * as TypographyClassNames from "./components/Typography/classnames";
@@ -90,8 +86,7 @@ declare const Utilities: {
90
86
  openInNewTab: (event: import("react").MouseEvent<HTMLElement, MouseEvent>, handler?: ((e: import("react").MouseEvent<HTMLElement, MouseEvent>) => void) | undefined, url?: string | undefined) => void;
91
87
  decideContrastColorValue: ({ testColor, lightColor, darkColor }: import("./common/utils/colorDecideContrastvalue").decideContrastColorValueProps) => string;
92
88
  };
93
- export { ApplicationContainer, ApplicationHeader, ApplicationContent, ApplicationSidebarNavigation, ApplicationSidebarToggler, ApplicationTitle, ApplicationToolbar, ApplicationToolbarSection, ApplicationToolbarAction, ApplicationToolbarPanel, AutoSuggestion, AutoSuggestionList, SingleLineCodeEditor, 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, IconButton, Label, Button, Checkbox, RadioButton, Tabs, Tab, TabTitle, TabPanel, TextField, TextArea, SearchField, Switch, NumericInput, FieldItem, FieldItemRow, FieldSet, BreadcrumbList, BreadcrumbItem, Modal, SimpleDialog, AlertDialog, Card, CardHeader, CardTitle, CardOptions, CardContent, CardActions, CardActionsAux, HoverToggler, Spacing, Divider, Tooltip, Section, SectionHeader, TitlePage, TitleMainsection, TitleSubsection, Accordion, AccordionItem, Toolbar, ToolbarSection, Tag, TagList, Pagination, Notification, Link, Spinner, InteractionGate, PropertyName, PropertyValue, PropertyValuePair, PropertyValueList, Toast, HelperClasses, Select, MultiSelect, AutoCompleteField, ProgressBar, Iframe, IframeModal, Utilities, LegacyReplacements, };
89
+ export { ApplicationContainer, ApplicationHeader, ApplicationContent, ApplicationSidebarNavigation, ApplicationSidebarToggler, ApplicationTitle, ApplicationToolbar, ApplicationToolbarSection, ApplicationToolbarAction, ApplicationToolbarPanel, AutoSuggestion, AutoSuggestionList, SingleLineCodeEditor, Grid, GridRow, GridColumn, List, WorkspaceContent, WorkspaceMain, WorkspaceSide, WorkspaceHeader, Menu, MenuItem, MenuDivider, ContextOverlay, ContextMenu, OverviewItem, OverviewItemDepiction, OverviewItemDescription, OverviewItemLine, OverviewItemActions, OverviewItemList, IconButton, Label, Button, Checkbox, RadioButton, Tabs, Tab, TabTitle, TabPanel, TextField, TextArea, SearchField, Switch, NumericInput, FieldItem, FieldItemRow, FieldSet, BreadcrumbList, BreadcrumbItem, Modal, SimpleDialog, AlertDialog, Card, CardHeader, CardTitle, CardOptions, CardContent, CardActions, CardActionsAux, HoverToggler, Spacing, Divider, Tooltip, Section, SectionHeader, TitlePage, TitleMainsection, TitleSubsection, Accordion, AccordionItem, Toolbar, ToolbarSection, Pagination, Notification, Link, Spinner, InteractionGate, PropertyName, PropertyValue, PropertyValuePair, PropertyValueList, Toast, HelperClasses, Select, MultiSelect, AutoCompleteField, Iframe, IframeModal, Utilities, LegacyReplacements, };
94
90
  export * from "./components";
95
- export * from "./components/interfaces";
96
91
  export * from "./extensions";
97
92
  export * from "./cmem";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eccenca/gui-elements",
3
3
  "description": "GUI elements based on other libraries, usable in React application, written in Typescript.",
4
- "version": "23.1.0-easynav.2",
4
+ "version": "23.1.0-easynav.4",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/eccenca/gui-elements",
7
7
  "bugs": "https://github.com/eccenca/gui-elements/issues",
@@ -91,7 +91,7 @@ export interface IActivityAction extends TestableComponent {
91
91
  // The tooltip that should be shown over the action icon
92
92
  tooltip?: string;
93
93
  // The icon of the action button
94
- icon: ValidIconName
94
+ icon: ValidIconName | React.ReactElement<TestIconProps>
95
95
  // Action is currently disabled (but shown)
96
96
  disabled?: boolean;
97
97
  // Warning state
@@ -167,10 +167,10 @@ export function ActivityControlWidget(props: IActivityControlProps) {
167
167
  </OverviewItemDescription>
168
168
  <OverviewItemActions>
169
169
  {activityActions &&
170
- activityActions.map((action) => {
170
+ activityActions.map((action, idx) => {
171
171
  return (
172
172
  <IconButton
173
- key={action.icon}
173
+ key={typeof action.icon === "string" ? action.icon : action["data-test-id"] ?? idx}
174
174
  data-test-id={action["data-test-id"]}
175
175
  name={action.icon}
176
176
  text={action.tooltip}
@@ -189,11 +189,11 @@ export function ActivityControlWidget(props: IActivityControlProps) {
189
189
  data-test-id={activityContextMenu["data-test-id"]}
190
190
  togglerText={activityContextMenu.tooltip}
191
191
  >
192
- {activityContextMenu.menuItems.map((menuAction) => {
192
+ {activityContextMenu.menuItems.map((menuAction, idx) => {
193
193
  return (
194
194
  <MenuItem
195
195
  icon={menuAction.icon}
196
- key={menuAction.icon}
196
+ key={typeof menuAction.icon === "string" ? menuAction.icon : menuAction["data-test-id"] ?? idx}
197
197
  onClick={menuAction.action}
198
198
  text={menuAction.tooltip}
199
199
  />
@@ -1,12 +1,12 @@
1
- import { TestableComponent } from "../../components/interfaces";
2
- import { ActivityControlWidget, IActivityAction } from "./ActivityControlWidget";
3
- import React, { useEffect, useState } from "react";
1
+ import {TestableComponent} from "../../components/interfaces";
2
+ import {ActivityControlWidget, IActivityAction} from "./ActivityControlWidget";
3
+ import React, {useEffect, useRef, useState} from "react";
4
4
  import {ConcreteActivityStatus, IActivityStatus} from "./ActivityControlTypes";
5
- import { Intent } from "@blueprintjs/core/src/common/intent";
6
- import { ActivityExecutionErrorReportModal } from "./ActivityExecutionErrorReportModal";
7
- import { Icon, Spacing } from "../../";
8
- import { ElapsedDateTimeDisplay, TimeUnits } from "../DateTimeDisplay/ElapsedDateTimeDisplay";
9
- import { IntentTypes } from "../../common/Intent";
5
+ import {Intent} from "@blueprintjs/core/src/common/intent";
6
+ import {ActivityExecutionErrorReportModal} from "./ActivityExecutionErrorReportModal";
7
+ import {Icon, Spacing} from "../../";
8
+ import {ElapsedDateTimeDisplay, TimeUnits} from "../DateTimeDisplay/ElapsedDateTimeDisplay";
9
+ import {IntentTypes} from "../../common/Intent";
10
10
 
11
11
  const progressBreakpointIndetermination = 10;
12
12
  const progressBreakpointAnimation = 99;
@@ -41,6 +41,10 @@ interface SilkActivityControlProps extends TestableComponent {
41
41
  };
42
42
  // DI activity actions
43
43
  executeActivityAction: (action: ActivityAction) => void;
44
+ /** If specified, the activity control will offer a "Start prioritized" button while the activity is in the waiting state.
45
+ * When the button is clicked it should start the activity via the startPrioritized endpoint.
46
+ */
47
+ executePrioritized?: () => void;
44
48
  // Get the translation for a specific key
45
49
  translate: (key: ActivityControlTranslationKeys) => string;
46
50
  // When defined the elapsed time since the last start is displayed next to the label
@@ -127,7 +131,7 @@ interface IStacktrace {
127
131
  cause?: IStacktrace;
128
132
  }
129
133
 
130
- export type ActivityControlTranslationKeys = "startActivity" | "stopActivity" | "reloadActivity" | "showErrorReport";
134
+ export type ActivityControlTranslationKeys = "startActivity" | "stopActivity" | "reloadActivity" | "showErrorReport" | "startPrioritized";
131
135
 
132
136
  export type ActivityAction = "start" | "cancel" | "restart";
133
137
 
@@ -153,14 +157,28 @@ export function useSilkActivityControl({
153
157
  tags,
154
158
  layoutConfig = defaultLayout,
155
159
  hideMessageOnStatus = () => false,
160
+ executePrioritized,
156
161
  ...props
157
162
  }: SilkActivityControlProps) {
158
163
  const [activityStatus, setActivityStatus] = useState<IActivityStatus | undefined>(initialStatus);
164
+ const currentStatus = useRef<IActivityStatus | undefined>(initialStatus)
165
+ const [showStartPrioritized, setShowStartPrioritized] = useState(false)
159
166
  const [errorReport, setErrorReport] = useState<string | IActivityExecutionReport | undefined>(undefined);
160
167
 
161
168
  // Register update function
162
169
  useEffect(() => {
163
- const updateActivityStatus = (status: any) => {
170
+ const updateActivityStatus = (status: IActivityStatus | undefined) => {
171
+ if(status?.concreteStatus !== "Waiting") {
172
+ setShowStartPrioritized(false)
173
+ } else if(executePrioritized) {
174
+ // Show start prioritized button only-if the activity is still in Waiting status after 2s
175
+ setTimeout(() => {
176
+ if(currentStatus.current?.concreteStatus === "Waiting") {
177
+ setShowStartPrioritized(true)
178
+ }
179
+ }, 2000)
180
+ }
181
+ currentStatus.current = status
164
182
  setActivityStatus(status)
165
183
  }
166
184
  registerForUpdates(updateActivityStatus)
@@ -184,13 +202,22 @@ export function useSilkActivityControl({
184
202
  }
185
203
 
186
204
  if (showStartAction) {
187
- actions.push({
188
- "data-test-id": "activity-start-activity",
189
- icon: "item-start",
190
- action: () => executeActivityAction("start"),
191
- tooltip: translate("startActivity"),
192
- disabled: activityStatus?.isRunning === true,
193
- });
205
+ if(showStartPrioritized && executePrioritized) {
206
+ actions.push({
207
+ "data-test-id": "activity-start-prioritized-activity",
208
+ icon: "item-skip-forward",
209
+ action: executePrioritized,
210
+ tooltip: translate("startPrioritized"),
211
+ })
212
+ } else {
213
+ actions.push({
214
+ "data-test-id": "activity-start-activity",
215
+ icon: "item-start",
216
+ action: () => executeActivityAction("start"),
217
+ tooltip: translate("startActivity"),
218
+ disabled: activityStatus?.isRunning === true,
219
+ });
220
+ }
194
221
  }
195
222
 
196
223
  if (showReloadAction) {
@@ -0,0 +1,22 @@
1
+ import React from "react";
2
+ import { ComponentStory, ComponentMeta } from "@storybook/react";
3
+ import { ConfidenceValue } from "../../../index";
4
+
5
+ export default {
6
+ title: "cmem/ConfidenceValue",
7
+ component: ConfidenceValue,
8
+ argTypes: {
9
+ barColor: {
10
+ control: "color",
11
+ },
12
+ }
13
+
14
+ } as ComponentMeta<typeof ConfidenceValue>;
15
+
16
+ const TemplateIcons: ComponentStory<typeof ConfidenceValue> = (args) => (
17
+ <ConfidenceValue {...args} />
18
+ );
19
+ export const Default = TemplateIcons.bind({});
20
+ Default.args = {
21
+ value: "0.5"
22
+ };
@@ -0,0 +1,116 @@
1
+ import React from "react";
2
+ import Color from "color";
3
+ import { Tag, TagProps } from "./../../components/Tag";
4
+ import { ProgressBar, ProgressBarProps } from "./../../components/ProgressBar";
5
+ import { CLASSPREFIX as eccgui } from "../../configuration/constants";
6
+
7
+ export interface ConfidenceValueProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "children"> {
8
+ /**
9
+ * Confidence value.
10
+ */
11
+ value: number;
12
+ /**
13
+ * Minimal border for the confidence range.
14
+ */
15
+ minValue?: number;
16
+ /**
17
+ * Center (or average) value of the confidence range.
18
+ */
19
+ centerValue?: number;
20
+ /**
21
+ * Maximum border for the confidence range.
22
+ */
23
+ maxValue?: number;
24
+ /**
25
+ * Color of the confidence bar.
26
+ * By default it is colorized red for values below the `centerValue`, otherwise green.
27
+ */
28
+ barColor?: Color | string;
29
+ /**
30
+ * The value is displayed by a bar.
31
+ * This confidence bar can be start from the left or right side, or from the center of the element.
32
+ */
33
+ barStart?: "side" | "center";
34
+ /**
35
+ * What width is used to display the lement.
36
+ * It could use the `minimal` necessary space, the `maximal` available space, or a `static` width.
37
+ */
38
+ spaceUsage?: "minimal" | "static" | "maximal";
39
+ /**
40
+ * Additional properties for the `<Tag/>` element that is used to display the confidence value.
41
+ */
42
+ tagProps?: Omit<TagProps, "className">;
43
+ /**
44
+ * Additional properties for the `<PRogressBar/>` element that is used to display the confidence bar.
45
+ */
46
+ progressBarProps?: Omit<ProgressBarProps, "className">;
47
+ }
48
+
49
+ const toPercent = (n: number) => {
50
+ let formatted = (n * 100).toFixed(2)
51
+ const maybeRemovedFraction = formatted.replace(/(\.0+$)|(0+$)/, "")
52
+ return `${maybeRemovedFraction}%`
53
+ }
54
+
55
+ export function ConfidenceValue ({
56
+ className,
57
+ value,
58
+ minValue = -1,
59
+ maxValue = 1,
60
+ centerValue = 0,
61
+ barColor,
62
+ barStart = "side",
63
+ spaceUsage = "static",
64
+ tagProps,
65
+ progressBarProps,
66
+ ...otherProps
67
+ }: ConfidenceValueProps) {
68
+
69
+ const barValue = (
70
+ value === centerValue ? 0 :
71
+ value < centerValue ? value / (minValue - centerValue) :
72
+ value / (maxValue - centerValue)
73
+ );
74
+
75
+ let color = Color("#000000");
76
+ if (!!barColor) {
77
+ try {
78
+ color = Color(barColor);
79
+ } catch(ex) {
80
+ console.warn("Received invalid color for confidence bar: " + barColor)
81
+ }
82
+ }
83
+
84
+ return (
85
+ <span
86
+ className={
87
+ `${eccgui}-confidencevalue` +
88
+ ` ${eccgui}-confidencevalue--${barStart}` +
89
+ ` ${eccgui}-confidencevalue--${spaceUsage}space` +
90
+ (value < centerValue ? ` ${eccgui}-confidencevalue--negative` : ` ${eccgui}-confidencevalue--positive`) +
91
+ (className ? ` ${className}` : "")
92
+ }
93
+ {...otherProps}
94
+ >
95
+ <Tag
96
+ className={`${eccgui}-confidencevalue__value`}
97
+ {...tagProps}
98
+ >
99
+ {toPercent(value)}
100
+ </Tag>
101
+ <div
102
+ className={`${eccgui}-confidencevalue__bar-colorwrapper`}
103
+ style={!!barColor ? { color: color.rgb().toString() } : {}}
104
+ >
105
+ <ProgressBar
106
+ className={`${eccgui}-confidencevalue__bar`}
107
+ value={barValue}
108
+ intent={!!barColor ? undefined : value < centerValue ? "danger" : "success"}
109
+ stripes={false}
110
+ animate={false}
111
+ {...progressBarProps}
112
+ />
113
+ </div>
114
+ </span>
115
+ );
116
+ }
@@ -0,0 +1,49 @@
1
+ .#{$eccgui}-confidencevalue {
2
+ display: inline-block;
3
+ position: relative;
4
+ width: 5rem;
5
+ }
6
+
7
+ .#{$eccgui}-confidencevalue--minimalspace {
8
+ width: auto;
9
+ min-width: 0;
10
+ }
11
+
12
+ .#{$eccgui}-confidencevalue--maximalspace {
13
+ width: auto;
14
+ min-width: 100%;
15
+ }
16
+
17
+ .#{$eccgui}-confidencevalue__value {
18
+ width: 100%;
19
+ text-align: center;
20
+ }
21
+
22
+ .#{$eccgui}-confidencevalue__bar {
23
+ position: absolute;
24
+ left: 0;
25
+ bottom: 0;
26
+ width: 100%;
27
+ height: 3px;
28
+ background-color: transparent;
29
+
30
+ .#{$eccgui}-confidencevalue--center & {
31
+ left: 50%;
32
+ width: 50%;
33
+ }
34
+
35
+ .#{$eccgui}-confidencevalue--negative & {
36
+ transform: rotate(180deg);
37
+ }
38
+
39
+ .#{$eccgui}-confidencevalue--center.#{$eccgui}-confidencevalue--negative & {
40
+ left: 0;
41
+ right: 50%;
42
+ }
43
+ }
44
+
45
+ .#{$eccgui}-confidencevalue__bar-colorwrapper {
46
+ & .#{$ns}-progress-meter {
47
+ background-color: currentColor;
48
+ }
49
+ }
@@ -0,0 +1 @@
1
+ export * from "./ConfidenceValue";
@@ -1,4 +1,5 @@
1
1
  @import "./ActivityControl/activitycontrol";
2
+ @import "./ConfidenceValue/confidencevalue";
2
3
  @import "./markdown/markdown";
3
4
  @import "./react-flow";
4
5
 
package/src/cmem/index.ts CHANGED
@@ -21,3 +21,5 @@ export type {
21
21
  IActivityControlLayoutProps,
22
22
  TimeUnits,
23
23
  }
24
+
25
+ export * from "./ConfidenceValue";
@@ -90,7 +90,7 @@ export default class CssCustomProperties {
90
90
  const { propertyType = "all", ...otherFilters } = filter;
91
91
  return CssCustomProperties.listLocalCssStyleRules(otherFilters)
92
92
  .map((cssrule) => {
93
- return [...(cssrule as CSSStyleRule).style]
93
+ return [...(cssrule as any).style]
94
94
  .map((propertyname) => {
95
95
  return [
96
96
  propertyname.trim(),
@@ -49,22 +49,21 @@ const SingleLineCodeEditor = ({
49
49
  placeholder,
50
50
  showScrollBar = true
51
51
  }: IEditorProps) => {
52
+ const singleLineInitialContent = React.useRef(initialValue.replace(/[\r\n]/g, " "))
52
53
  return (
53
54
  <div className={`${eccgui}-singlelinecodeeditor ${BlueprintClassNames.INPUT}`}>
54
55
  <UnControlledEditor
55
56
  editorDidMount={(editor: any) => {
56
57
  editor.on("beforeChange", (_: any, change: any) => {
57
58
  // Prevent the user from entering new-line characters, since this is supposed to be a one-line editor.
58
- const newText = change.text.join("").replace(/\n/g, "");
59
- //failing unexpectedly during undo and redo
60
- if (change.update && typeof change.update === "function") {
61
- change.update(change.from, change.to, [newText]);
59
+ if (change.update && typeof change.update === "function" && change.text.length > 1) {
60
+ change.update(change.from, change.to, [change.text.join("")]);
62
61
  }
63
62
  return true;
64
63
  });
65
64
  setEditorInstance(editor);
66
65
  }}
67
- value={initialValue}
66
+ value={singleLineInitialContent.current}
68
67
  onFocus={() => onFocusChange(true)}
69
68
  onBlur={() => onFocusChange(false)}
70
69
  options={{
@@ -89,11 +88,10 @@ const SingleLineCodeEditor = ({
89
88
  editor.getScrollInfo()
90
89
  );
91
90
  }}
92
- onBeforeChange={(_editor, _data, value, next) => {
93
- // Remove entered new lines
94
- const trimmedValue = value.replace(/[\r\n]/g, "");
95
- if (trimmedValue !== value) {
96
- _editor.setValue(trimmedValue)
91
+ onBeforeChange={(_editor, data, _, next) => {
92
+ // Reduce multiple lines to a single line
93
+ if (data.text.length > 1) {
94
+ _editor.setValue(data.text.join(""))
97
95
  }
98
96
  next()
99
97
  }}
@@ -53,4 +53,9 @@ describe("SingleLineCodeEditor", () => {
53
53
  .setValue("I'm entering a new line \n character");
54
54
  expect(codeMirrorEditorInstance.lineCount()).toBe(1);
55
55
  });
56
+
57
+ it("should convert multiple lines to a single line", () => {
58
+ render(<SingleLineEditor {...{...props, initialValue: "1\n2\n3"}} />);
59
+ expect(codeMirrorEditorInstance.lineCount()).toBe(1);
60
+ });
56
61
  });
@@ -14,11 +14,8 @@
14
14
  }
15
15
 
16
16
  .#{$eccgui}-badge--inline {
17
- display: inline-block;
18
-
19
- &.#{$eccgui}-badge--icon {
20
- vertical-align: middle;
21
- }
17
+ display: inline-flex;
18
+ vertical-align: middle;
22
19
  }
23
20
 
24
21
  .#{$eccgui}-badge--bottom-right {
@@ -24,6 +24,10 @@ export interface CardProps extends BlueprintCardProps {
24
24
  * Property value defined which part of the card is always scrolled in, this may important when the card is larger than the viewport.
25
25
  */
26
26
  scrollinOnFocus?: "start" | "center" | "end";
27
+ /**
28
+ * Controls how much whitespace is displayed within the card subelements.
29
+ */
30
+ whitespaceAmount?: "none" | "small" | "medium" | "large";
27
31
  }
28
32
 
29
33
  /**
@@ -38,6 +42,7 @@ function Card({
38
42
  fullHeight=false,
39
43
  elevated=false,
40
44
  scrollinOnFocus,
45
+ whitespaceAmount="medium",
41
46
  interactive,
42
47
  ...otherProps
43
48
  }: CardProps) {
@@ -55,11 +60,12 @@ function Card({
55
60
  const cardElement = (
56
61
  <BlueprintCard
57
62
  className={
58
- `${eccgui}-card ` +
59
- (fullHeight ? ` ${eccgui}-card--fullheight ` : '') +
60
- (elevated ? ` ${eccgui}-card--elevated ` : '') +
61
- (!!scrollinOnFocus ? ` ${eccgui}-card--scrollonfocus ` : '') +
62
- className
63
+ `${eccgui}-card` +
64
+ (fullHeight ? ` ${eccgui}-card--fullheight` : '') +
65
+ (elevated ? ` ${eccgui}-card--elevated` : '') +
66
+ (!!scrollinOnFocus ? ` ${eccgui}-card--scrollonfocus` : '') +
67
+ (whitespaceAmount !== "medium" ? ` ${eccgui}-card--whitespace-${whitespaceAmount}` : '') +
68
+ (!!className ? ` ${className}` : "")
63
69
  }
64
70
  elevation={elevation}
65
71
  interactive={!!otherProps.onClick ? true : interactive}
@@ -2,6 +2,12 @@ import React from 'react';
2
2
  import { CLASSPREFIX as eccgui } from "../../configuration/constants";
3
3
 
4
4
  export interface CardContentProps extends React.HTMLAttributes<HTMLDivElement> {
5
+ /**
6
+ * Usually `CardContent` remains the available space inside a card.
7
+ * This option changes that behaviour, so that the content section is not grown or shrinked.
8
+ * You may use this then you have multiple content section in one card but not all those sections should be grown or shrinked regarding the remaining space.
9
+ */
10
+ noFlexHeight?: boolean;
5
11
  }
6
12
 
7
13
  /**
@@ -11,12 +17,17 @@ export interface CardContentProps extends React.HTMLAttributes<HTMLDivElement> {
11
17
  function CardContent({
12
18
  children,
13
19
  className='',
20
+ noFlexHeight,
14
21
  ...otherProps
15
22
  }: CardContentProps) {
16
23
  return (
17
24
  <div
18
25
  {...otherProps}
19
- className={`${eccgui}-card__content ` + className}
26
+ className={
27
+ `${eccgui}-card__content` +
28
+ (noFlexHeight ? ` ${eccgui}-card__content--noflexheight` : "") +
29
+ (!!className ? ` ${className}` : "")
30
+ }
20
31
  >
21
32
  {children}
22
33
  </div>
@@ -5,8 +5,16 @@ import { CLASSPREFIX as eccgui } from "../../configuration/constants";
5
5
  import CardTitle from "./CardTitle";
6
6
  import CardOptions from "./CardOptions";
7
7
 
8
- interface CardHeaderProps extends OverviewItemProps {
8
+ interface CardHeaderProps extends Omit<OverviewItemProps, "densityHigh" | "hasSpacing"> {
9
9
  children: JSX.Element | (JSX.Element | undefined | null)[] | null | undefined;
10
+ /**
11
+ * @deprecated
12
+ */
13
+ densityHigh?: OverviewItemProps["densityHigh"];
14
+ /**
15
+ * @deprecated
16
+ */
17
+ hasSpacing?: OverviewItemProps["hasSpacing"];
10
18
  }
11
19
 
12
20
  function CardHeader({