@pega/react-sdk-overrides 23.1.10 → 23.1.12

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 (232) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +17 -0
  3. package/SECURITY.md +10 -0
  4. package/lib/designSystemExtension/AlertBanner/AlertBanner.tsx +6 -14
  5. package/lib/designSystemExtension/Banner/Banner.tsx +14 -11
  6. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -1
  7. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +27 -22
  8. package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +14 -20
  9. package/lib/designSystemExtension/DetailsFields/index.tsx +1 -1
  10. package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +44 -19
  11. package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +7 -12
  12. package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +21 -32
  13. package/lib/designSystemExtension/Operator/Operator.tsx +94 -82
  14. package/lib/designSystemExtension/Pulse/Pulse.tsx +14 -16
  15. package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +6 -5
  16. package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +14 -14
  17. package/lib/field/AutoComplete/AutoComplete.tsx +24 -26
  18. package/lib/field/AutoComplete/config-ext.json +2 -3
  19. package/lib/field/CancelAlert/CancelAlert.tsx +98 -84
  20. package/lib/field/CancelAlert/index.tsx +1 -1
  21. package/lib/field/Checkbox/Checkbox.tsx +120 -63
  22. package/lib/field/Checkbox/config-ext.json +2 -3
  23. package/lib/field/Currency/Currency.tsx +25 -50
  24. package/lib/field/Currency/config-ext.json +2 -3
  25. package/lib/field/Currency/currency-utils.ts +9 -16
  26. package/lib/field/Date/Date.tsx +15 -11
  27. package/lib/field/Date/config-ext.json +2 -3
  28. package/lib/field/DateTime/DateTime.tsx +9 -9
  29. package/lib/field/DateTime/config-ext.json +1 -2
  30. package/lib/field/Decimal/Decimal.tsx +33 -44
  31. package/lib/field/Decimal/config-ext.json +1 -2
  32. package/lib/field/Decimal/index.tsx +1 -1
  33. package/lib/field/Dropdown/Dropdown.tsx +122 -31
  34. package/lib/field/Dropdown/config-ext.json +1 -2
  35. package/lib/field/Email/Email.tsx +11 -10
  36. package/lib/field/Email/config-ext.json +1 -2
  37. package/lib/field/Email/index.tsx +1 -1
  38. package/lib/field/Group/Group.tsx +39 -0
  39. package/lib/field/Group/config-ext.json +7 -0
  40. package/lib/field/Group/index.tsx +1 -0
  41. package/lib/field/Integer/Integer.tsx +8 -7
  42. package/lib/field/Integer/config-ext.json +1 -2
  43. package/lib/field/MultiSelect/Multiselect.tsx +244 -0
  44. package/lib/field/MultiSelect/index.tsx +1 -0
  45. package/lib/field/MultiSelect/utils.ts +230 -0
  46. package/lib/field/Percentage/Percentage.tsx +46 -41
  47. package/lib/field/Percentage/config-ext.json +1 -2
  48. package/lib/field/Phone/Phone.tsx +13 -12
  49. package/lib/field/Phone/index.tsx +1 -1
  50. package/lib/field/RadioButtons/RadioButtons.tsx +20 -18
  51. package/lib/field/RadioButtons/config-ext.json +1 -2
  52. package/lib/field/RichText/RichText.tsx +8 -7
  53. package/lib/field/ScalarList/ScalarList.tsx +3 -13
  54. package/lib/field/ScalarList/config-ext.json +1 -2
  55. package/lib/field/SemanticLink/SemanticLink.tsx +7 -7
  56. package/lib/field/SemanticLink/config-ext.json +1 -2
  57. package/lib/field/SemanticLink/utils.ts +8 -11
  58. package/lib/field/TextArea/TextArea.tsx +7 -6
  59. package/lib/field/TextArea/config-ext.json +1 -2
  60. package/lib/field/TextContent/TextContent.tsx +4 -6
  61. package/lib/field/TextContent/config-ext.json +1 -2
  62. package/lib/field/TextInput/TextInput.tsx +9 -7
  63. package/lib/field/TextInput/config-ext.json +1 -2
  64. package/lib/field/TextInput/index.tsx +1 -1
  65. package/lib/field/Time/Time.tsx +11 -11
  66. package/lib/field/Time/config-ext.json +1 -2
  67. package/lib/field/URL/URL.tsx +9 -8
  68. package/lib/field/URL/config-ext.json +1 -2
  69. package/lib/field/URL/index.tsx +1 -1
  70. package/lib/field/UserReference/UserReference.tsx +18 -16
  71. package/lib/field/UserReference/UserReferenceUtils.ts +2 -2
  72. package/lib/field/UserReference/config-ext.json +1 -2
  73. package/lib/helpers/attachmentHelpers.ts +13 -8
  74. package/lib/helpers/case-utils.tsx +4 -8
  75. package/lib/helpers/common-utils.ts +5 -1
  76. package/lib/helpers/data_page.ts +3 -7
  77. package/lib/helpers/date-format-utils.ts +3 -3
  78. package/lib/helpers/event-utils.ts +3 -3
  79. package/lib/helpers/field-group-utils.ts +1 -1
  80. package/lib/helpers/formatters/Boolean.ts +9 -26
  81. package/lib/helpers/formatters/Currency.ts +15 -21
  82. package/lib/helpers/formatters/CurrencyMap.ts +505 -501
  83. package/lib/helpers/formatters/Date.ts +20 -26
  84. package/lib/helpers/formatters/common.ts +1 -2
  85. package/lib/helpers/formatters/index.ts +26 -19
  86. package/lib/helpers/instructions-utils.ts +38 -0
  87. package/lib/helpers/reactContextHelpers.ts +2 -2
  88. package/lib/helpers/simpleTableHelpers.ts +59 -83
  89. package/lib/helpers/state-utils.tsx +5 -9
  90. package/lib/helpers/template-utils.ts +3 -6
  91. package/lib/helpers/utils.ts +5 -5
  92. package/lib/helpers/versionHelpers.ts +1 -4
  93. package/lib/infra/ActionButtons/ActionButtons.tsx +38 -29
  94. package/lib/infra/ActionButtons/index.tsx +1 -1
  95. package/lib/infra/Assignment/Assignment.tsx +99 -79
  96. package/lib/infra/Assignment/index.tsx +1 -1
  97. package/lib/infra/AssignmentCard/AssignmentCard.tsx +13 -16
  98. package/lib/infra/AssignmentCard/index.tsx +1 -1
  99. package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +67 -213
  100. package/lib/infra/Containers/FlowContainer/helpers.ts +34 -45
  101. package/lib/infra/Containers/FlowContainer/index.tsx +1 -1
  102. package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +65 -0
  103. package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/index.tsx +1 -0
  104. package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +227 -218
  105. package/lib/infra/Containers/ModalViewContainer/index.tsx +1 -1
  106. package/lib/infra/Containers/SimpleView/SimpleView.tsx +48 -0
  107. package/lib/infra/Containers/SimpleView/helper.ts +125 -0
  108. package/lib/infra/Containers/SimpleView/index.tsx +1 -0
  109. package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +36 -46
  110. package/lib/infra/Containers/helpers.ts +6 -0
  111. package/lib/infra/DashboardFilter/DashboardFilter.tsx +21 -42
  112. package/lib/infra/DashboardFilter/filterUtils.tsx +12 -43
  113. package/lib/infra/DeferLoad/DeferLoad.tsx +22 -28
  114. package/lib/infra/DeferLoad/index.tsx +1 -1
  115. package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +16 -30
  116. package/lib/infra/MultiStep/MultiStep.css +11 -15
  117. package/lib/infra/MultiStep/MultiStep.tsx +176 -212
  118. package/lib/infra/MultiStep/index.tsx +1 -1
  119. package/lib/infra/NavBar/NavBar.css +103 -105
  120. package/lib/infra/NavBar/NavBar.tsx +19 -31
  121. package/lib/infra/Reference/Reference.tsx +16 -18
  122. package/lib/infra/Region/Region.tsx +4 -6
  123. package/lib/infra/RootContainer/RootContainer.tsx +75 -111
  124. package/lib/infra/RootContainer/index.tsx +1 -1
  125. package/lib/infra/Stages/Stages.tsx +32 -39
  126. package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +11 -11
  127. package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +21 -28
  128. package/lib/infra/View/View.tsx +17 -21
  129. package/lib/template/AppShell/AppShell.css +22 -23
  130. package/lib/template/AppShell/AppShell.tsx +39 -74
  131. package/lib/template/BannerPage/BannerPage.tsx +12 -14
  132. package/lib/template/CaseSummary/CaseSummary.tsx +58 -18
  133. package/lib/template/CaseSummary/config-ext.json +1 -2
  134. package/lib/template/CaseView/CaseView.tsx +34 -63
  135. package/lib/template/CaseView/config-ext.json +1 -2
  136. package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +63 -19
  137. package/lib/template/Confirmation/Confirmation.tsx +12 -17
  138. package/lib/template/Confirmation/config-ext.json +1 -2
  139. package/lib/template/DataReference/DataReference.tsx +95 -121
  140. package/lib/template/DataReference/config-ext.json +1 -2
  141. package/lib/template/DefaultForm/DefaultForm.css +7 -3
  142. package/lib/template/DefaultForm/DefaultForm.tsx +13 -16
  143. package/lib/template/DefaultForm/config-ext.json +1 -2
  144. package/lib/template/Details/Details/Details.tsx +19 -22
  145. package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +9 -13
  146. package/lib/template/Details/DetailsSubTabs/config-ext.json +1 -2
  147. package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +19 -24
  148. package/lib/template/Details/DetailsThreeColumn/config-ext.json +1 -2
  149. package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +19 -25
  150. package/lib/template/Details/DetailsTwoColumn/config-ext.json +1 -2
  151. package/lib/template/Details/DetailsTwoColumn/index.tsx +1 -1
  152. package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +15 -14
  153. package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +15 -22
  154. package/lib/template/InlineDashboard/InlineDashboard.tsx +12 -14
  155. package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +12 -16
  156. package/lib/template/ListPage/ListPage.tsx +5 -10
  157. package/lib/template/ListPage/config-ext.json +1 -2
  158. package/lib/template/ListView/DefaultViewMeta.ts +1 -3
  159. package/lib/template/ListView/ListView.tsx +185 -175
  160. package/lib/template/ListView/config-ext.json +1 -2
  161. package/lib/template/ListView/hooks.ts +24 -26
  162. package/lib/template/ListView/utils.ts +51 -87
  163. package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +20 -20
  164. package/lib/template/NarrowWide/NarrowWide/NarrowWide.css +0 -2
  165. package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +25 -38
  166. package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +20 -25
  167. package/lib/template/NarrowWide/NarrowWideDetails/config-ext.json +1 -2
  168. package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.css +0 -2
  169. package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +14 -24
  170. package/lib/template/NarrowWide/NarrowWideForm/config-ext.json +1 -2
  171. package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +9 -19
  172. package/lib/template/NarrowWide/NarrowWidePage/config-ext.json +1 -2
  173. package/lib/template/OneColumn/OneColumn/OneColumn.tsx +14 -15
  174. package/lib/template/OneColumn/OneColumn/config-ext.json +1 -2
  175. package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +3 -10
  176. package/lib/template/OneColumn/OneColumnPage/config-ext.json +1 -2
  177. package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +6 -10
  178. package/lib/template/OneColumn/OneColumnTab/config-ext.json +1 -2
  179. package/lib/template/PromotedFilters/PromotedFilters.css +1 -1
  180. package/lib/template/PromotedFilters/PromotedFilters.tsx +32 -28
  181. package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +37 -33
  182. package/lib/template/SimpleTable/SimpleTable/config-ext.json +1 -2
  183. package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +187 -121
  184. package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +24 -25
  185. package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +30 -30
  186. package/lib/template/SubTabs/SubTabs.tsx +22 -40
  187. package/lib/template/SubTabs/config-ext.json +1 -2
  188. package/lib/template/SubTabs/tabUtils.ts +2 -5
  189. package/lib/template/TwoColumn/TwoColumn/TwoColumn.css +0 -1
  190. package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +30 -28
  191. package/lib/template/TwoColumn/TwoColumn/config-ext.json +1 -2
  192. package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +3 -10
  193. package/lib/template/TwoColumn/TwoColumnPage/config-ext.json +1 -2
  194. package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +30 -28
  195. package/lib/template/TwoColumn/TwoColumnTab/config-ext.json +1 -2
  196. package/lib/template/WideNarrow/WideNarrow/WideNarrow.css +0 -2
  197. package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +22 -34
  198. package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +24 -28
  199. package/lib/template/WideNarrow/WideNarrowDetails/config-ext.json +1 -2
  200. package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.css +0 -2
  201. package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +13 -21
  202. package/lib/template/WideNarrow/WideNarrowForm/config-ext.json +1 -2
  203. package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +8 -16
  204. package/lib/template/WideNarrow/WideNarrowPage/config-ext.json +1 -2
  205. package/lib/template/WideNarrow/WideNarrowPage/index.tsx +1 -1
  206. package/lib/template/WssNavBar/WssNavBar.tsx +18 -21
  207. package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +29 -28
  208. package/lib/widget/AppAnnouncement/config-ext.json +1 -2
  209. package/lib/widget/Attachment/Attachment.css +60 -1
  210. package/lib/widget/Attachment/Attachment.tsx +378 -405
  211. package/lib/widget/Attachment/index.tsx +1 -1
  212. package/lib/widget/CaseHistory/CaseHistory.tsx +64 -66
  213. package/lib/widget/CaseHistory/config-ext.json +1 -2
  214. package/lib/widget/CaseHistory/index.tsx +1 -1
  215. package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +16 -18
  216. package/lib/widget/FileUtility/FileUtility/FileUtility.css +2 -2
  217. package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +310 -246
  218. package/lib/widget/FileUtility/FileUtility/config-ext.json +1 -2
  219. package/lib/widget/Followers/Followers.tsx +23 -20
  220. package/lib/widget/Followers/config-ext.json +1 -2
  221. package/lib/widget/QuickCreate/QuickCreate.tsx +68 -42
  222. package/lib/widget/SummaryItem/SummaryItem.css +9 -9
  223. package/lib/widget/SummaryItem/SummaryItem.tsx +58 -58
  224. package/lib/widget/SummaryItem/index.tsx +1 -1
  225. package/lib/widget/SummaryList/SummaryList.tsx +7 -10
  226. package/lib/widget/ToDo/ToDo.css +4 -4
  227. package/lib/widget/ToDo/ToDo.tsx +52 -53
  228. package/lib/widget/ToDo/config-ext.json +1 -2
  229. package/package.json +5 -2
  230. package/lib/helpers/auth.js +0 -834
  231. package/lib/helpers/authManager.ts +0 -933
  232. package/lib/helpers/config_access.js +0 -186
@@ -1,14 +1,14 @@
1
- import React from 'react';
2
1
  import Typography from '@material-ui/core/Typography';
3
2
  import Grid from '@material-ui/core/Grid';
4
3
  import { makeStyles } from '@material-ui/core/styles';
4
+
5
5
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
6
- import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
6
+ import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
7
7
 
8
8
  /* although this is called the SemanticLink component, we are not yet displaying as a
9
9
  SemanticLink in SDK and only showing the value as a read only text field. */
10
10
 
11
- const useStyles = makeStyles((theme) => ({
11
+ const useStyles = makeStyles(theme => ({
12
12
  root: {
13
13
  paddingRight: theme.spacing(1),
14
14
  paddingLeft: theme.spacing(1),
@@ -55,14 +55,14 @@ export default function SemanticLink(props: SemanticLinkProps) {
55
55
  if (displayMode === 'LABELS_LEFT' || (!displayMode && label !== undefined)) {
56
56
  const value = text || '---';
57
57
  return (
58
- <Grid container spacing={1} style={{ padding: '4px 0px' }} id="semantic-link-grid">
58
+ <Grid container spacing={1} style={{ padding: '4px 0px' }} id='semantic-link-grid'>
59
59
  <Grid item xs={6}>
60
- <Typography variant="body2" component="span" className={`${classes.fieldLabel} ${classes.fieldMargin}`}>
60
+ <Typography variant='body2' component='span' className={`${classes.fieldLabel} ${classes.fieldMargin}`}>
61
61
  {label}
62
62
  </Typography>
63
63
  </Grid>
64
64
  <Grid item xs={6}>
65
- <Typography variant="body2" component="span" className={classes.fieldValue}>
65
+ <Typography variant='body2' component='span' className={classes.fieldValue}>
66
66
  {value}
67
67
  </Typography>
68
68
  </Grid>
@@ -71,6 +71,6 @@ export default function SemanticLink(props: SemanticLinkProps) {
71
71
  }
72
72
 
73
73
  if (displayMode === 'STACKED_LARGE_VAL') {
74
- return <FieldValueList name={hideLabel ? '' : label} value={text} variant="stacked" />;
74
+ return <FieldValueList name={hideLabel ? '' : label} value={text} variant='stacked' />;
75
75
  }
76
76
  }
@@ -3,6 +3,5 @@
3
3
  "description": "SemanticLink",
4
4
  "type": "Field",
5
5
  "subtype": "ACTION",
6
- "properties": [
7
- ]
6
+ "properties": []
8
7
  }
@@ -1,12 +1,9 @@
1
- // Remove this and use "real" PCore type once .d.ts is fixed (currently shows 2 errors)
2
- declare const PCore: any;
3
-
4
1
  function getDataReferenceInfo(pConnect, dataRelationshipContext) {
5
2
  if (!pConnect) {
6
- throw Error("PConnect parameter is required");
3
+ throw Error('PConnect parameter is required');
7
4
  }
8
5
 
9
- let dataContext = "";
6
+ let dataContext = '';
10
7
  const payload = {};
11
8
  const pageReference = pConnect.getPageReference();
12
9
  const annotationUtils = PCore.getAnnotationUtils();
@@ -17,7 +14,7 @@ function getDataReferenceInfo(pConnect, dataRelationshipContext) {
17
14
  For page list the page refernce will be something like caseInfo.content.EmployeeRef[1].
18
15
  Need to extract EmployeeRef from caseInfo.content.EmployeeRef[1]
19
16
  */
20
- const propertySplit = pageReference.split(".");
17
+ const propertySplit = pageReference.split('.');
21
18
 
22
19
  // Regex to match if the property is list type. Eg: EmployeeRef[1]
23
20
  const listPropertyRegex = /([a-z|A-Z]*[[][\d]*)[\]]$/gm;
@@ -26,9 +23,7 @@ function getDataReferenceInfo(pConnect, dataRelationshipContext) {
26
23
 
27
24
  let contextProperty = dataRelationshipContext !== null ? dataRelationshipContext : propertySplit.pop();
28
25
  const isListProperty = listPropertyRegex.test(contextProperty);
29
- contextProperty = isListProperty
30
- ? contextProperty.replace(indexRegex, "")
31
- : contextProperty;
26
+ contextProperty = isListProperty ? contextProperty.replace(indexRegex, '') : contextProperty;
32
27
  fieldMetadata = pConnect.getFieldMetadata(contextProperty);
33
28
  }
34
29
 
@@ -36,7 +31,9 @@ function getDataReferenceInfo(pConnect, dataRelationshipContext) {
36
31
  const { name, parameters } = fieldMetadata.datasource;
37
32
  dataContext = name;
38
33
  for (const [key, value] of Object.entries(parameters)) {
39
- const property = dataRelationshipContext !== null ? annotationUtils.getPropertyName(value) : annotationUtils.getLeafPropertyName(value)
34
+ const property =
35
+ // @ts-ignore - Property 'getLeafPropertyName' is private and only accessible within class 'AnnotationUtils'
36
+ dataRelationshipContext !== null ? annotationUtils.getPropertyName(value as string) : annotationUtils.getLeafPropertyName(value);
40
37
  payload[key] = pConnect.getValue(`.${property}`);
41
38
  }
42
39
  return { dataContext, dataContextParameters: payload };
@@ -46,7 +43,7 @@ function getDataReferenceInfo(pConnect, dataRelationshipContext) {
46
43
  }
47
44
 
48
45
  function isLinkTextEmpty(text) {
49
- return text === "" || text === undefined || text === null;
46
+ return text === '' || text === undefined || text === null;
50
47
  }
51
48
 
52
49
  export default { getDataReferenceInfo, isLinkTextEmpty };
@@ -1,7 +1,7 @@
1
- import React from 'react';
2
1
  import { TextField } from '@material-ui/core';
2
+
3
3
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
4
- import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
4
+ import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
5
 
6
6
  interface TextAreaProps extends PConnFieldProps {
7
7
  // If any, enter additional props that only exist on TextArea here
@@ -26,7 +26,8 @@ export default function TextArea(props: TextAreaProps) {
26
26
  fieldMetadata,
27
27
  helperText,
28
28
  displayMode,
29
- hideLabel
29
+ hideLabel,
30
+ placeholder
30
31
  } = props;
31
32
  const helperTextToDisplay = validatemessage || helperText;
32
33
 
@@ -39,7 +40,7 @@ export default function TextArea(props: TextAreaProps) {
39
40
  }
40
41
 
41
42
  if (displayMode === 'STACKED_LARGE_VAL') {
42
- return <FieldValueList name={hideLabel ? '' : label} value={value} variant="stacked" />;
43
+ return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;
43
44
  }
44
45
 
45
46
  if (readOnly) {
@@ -62,8 +63,8 @@ export default function TextArea(props: TextAreaProps) {
62
63
  fullWidth
63
64
  variant={readOnly ? 'standard' : 'outlined'}
64
65
  helperText={helperTextToDisplay}
65
- placeholder=""
66
- size="small"
66
+ placeholder={placeholder ?? ''}
67
+ size='small'
67
68
  required={required}
68
69
  disabled={disabled}
69
70
  onChange={onChange}
@@ -4,6 +4,5 @@
4
4
  "description": "Text (paragraph)",
5
5
  "type": "Field",
6
6
  "subtype": "Text-Paragraph",
7
- "properties": [
8
- ]
7
+ "properties": []
9
8
  }
@@ -1,15 +1,13 @@
1
- import React from 'react';
2
1
  import { Typography } from '@material-ui/core';
3
- import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
2
+
3
+ import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
4
4
 
5
5
  interface TextContentProps extends PConnProps {
6
6
  // If any, enter additional props that only exist on TextContent here
7
- content: string,
8
- displayAs: 'Paragraph' | 'Heading 1' | 'Heading 2' | 'Heading 3' | 'Heading 4'
7
+ content: string;
8
+ displayAs: 'Paragraph' | 'Heading 1' | 'Heading 2' | 'Heading 3' | 'Heading 4';
9
9
  }
10
10
 
11
-
12
-
13
11
  export default function TextContent(props: TextContentProps) {
14
12
  type ExpectedDisplayAs = 'Paragraph' | 'Heading 1' | 'Heading 2' | 'Heading 3' | 'Heading 4';
15
13
  type ExpectedVariants = 'body1' | 'h1' | 'h2' | 'h3' | 'h4';
@@ -3,6 +3,5 @@
3
3
  "description": "Text",
4
4
  "type": "Field",
5
5
  "subtype": "DATA_CAPTURE",
6
- "properties": [
7
- ]
6
+ "properties": []
8
7
  }
@@ -1,8 +1,9 @@
1
- import React, { useState, useEffect } from 'react';
1
+ import { useState, useEffect } from 'react';
2
2
  import { TextField } from '@material-ui/core';
3
+
3
4
  import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
4
5
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
5
- import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
6
+ import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
6
7
 
7
8
  interface TextInputProps extends PConnFieldProps {
8
9
  // If any, enter additional props that only exist on TextInput here
@@ -27,12 +28,13 @@ export default function TextInput(props: TextInputProps) {
27
28
  fieldMetadata,
28
29
  helperText,
29
30
  displayMode,
30
- hideLabel
31
+ hideLabel,
32
+ placeholder
31
33
  } = props;
32
34
 
33
35
  const pConn = getPConnect();
34
36
  const actions = pConn.getActionsApi();
35
- const propName = pConn.getStateProps()["value"];
37
+ const propName = (pConn.getStateProps() as any).value;
36
38
 
37
39
  const helperTextToDisplay = validatemessage || helperText;
38
40
 
@@ -50,7 +52,7 @@ export default function TextInput(props: TextInputProps) {
50
52
  }
51
53
 
52
54
  if (displayMode === 'STACKED_LARGE_VAL') {
53
- return <FieldValueList name={hideLabel ? '' : label} value={value} variant="stacked" />;
55
+ return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;
54
56
  }
55
57
 
56
58
  if (readOnly) {
@@ -77,8 +79,8 @@ export default function TextInput(props: TextInputProps) {
77
79
  fullWidth
78
80
  variant={readOnly ? 'standard' : 'outlined'}
79
81
  helperText={helperTextToDisplay}
80
- placeholder=""
81
- size="small"
82
+ placeholder={placeholder ?? ''}
83
+ size='small'
82
84
  required={required}
83
85
  disabled={disabled}
84
86
  onChange={handleChange}
@@ -4,6 +4,5 @@
4
4
  "description": "Text (single line)",
5
5
  "type": "Field",
6
6
  "subtype": "Text",
7
- "properties": [
8
- ]
7
+ "properties": []
9
8
  }
@@ -1 +1 @@
1
- export { default } from './TextInput';
1
+ export { default } from './TextInput';
@@ -1,9 +1,9 @@
1
- import React from 'react';
2
1
  import { KeyboardTimePicker } from '@material-ui/pickers';
3
2
  import AccessTimeIcon from '@material-ui/icons/AccessTime';
4
3
  import dayjs from 'dayjs';
4
+
5
5
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
6
- import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
6
+ import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
7
7
 
8
8
  interface TimeProps extends PConnFieldProps {
9
9
  // If any, enter additional props that only exist on Time here
@@ -22,7 +22,7 @@ export default function Time(props: TimeProps) {
22
22
  }
23
23
 
24
24
  if (displayMode === 'STACKED_LARGE_VAL') {
25
- return <FieldValueList name={hideLabel ? '' : label} value={value} variant="stacked" />;
25
+ return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;
26
26
  }
27
27
 
28
28
  if (readOnly) {
@@ -35,14 +35,14 @@ export default function Time(props: TimeProps) {
35
35
  'data-test-id': testId
36
36
  };
37
37
 
38
- const handleChange = (date) => {
38
+ const handleChange = date => {
39
39
  const theValue = date && date.isValid() ? date.format('HH:mm') : null;
40
40
  onChange({ value: theValue });
41
41
  };
42
42
 
43
43
  let timeValue: any = null;
44
44
  if (value) {
45
- const timeArray = value.split(':').map((itm) => Number(itm));
45
+ const timeArray = value.split(':').map(itm => Number(itm));
46
46
  timeValue = dayjs().hour(timeArray[0]).minute(timeArray[1]);
47
47
  }
48
48
 
@@ -53,9 +53,9 @@ export default function Time(props: TimeProps) {
53
53
 
54
54
  return (
55
55
  <KeyboardTimePicker
56
- variant="inline"
57
- inputVariant="outlined"
58
- placeholder="hh:mm am"
56
+ variant='inline'
57
+ inputVariant='outlined'
58
+ placeholder='hh:mm am'
59
59
  keyboardIcon={<AccessTimeIcon />}
60
60
  fullWidth
61
61
  required={required}
@@ -63,11 +63,11 @@ export default function Time(props: TimeProps) {
63
63
  error={status === 'error'}
64
64
  helperText={helperTextToDisplay}
65
65
  minutesStep={5}
66
- size="small"
66
+ size='small'
67
67
  label={label}
68
68
  autoOk
69
- mask="__:__ _m"
70
- format="hh:mm a"
69
+ mask='__:__ _m'
70
+ format='hh:mm a'
71
71
  value={timeValue}
72
72
  onChange={handleChange}
73
73
  InputProps={{ inputProps: { ...testProp } }}
@@ -4,6 +4,5 @@
4
4
  "description": "Time only",
5
5
  "type": "Field",
6
6
  "subtype": "TimeOfDay",
7
- "properties": [
8
- ]
7
+ "properties": []
9
8
  }
@@ -1,7 +1,7 @@
1
- import React from 'react';
2
1
  import { TextField } from '@material-ui/core';
2
+
3
3
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
4
- import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
4
+ import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
5
 
6
6
  interface URLComponentProps extends PConnFieldProps {
7
7
  // If any, enter additional props that only exist on URLComponent here
@@ -28,7 +28,8 @@ export default function URLComponent(props: URLComponentProps) {
28
28
  testId,
29
29
  helperText,
30
30
  displayMode,
31
- hideLabel
31
+ hideLabel,
32
+ placeholder
32
33
  } = props;
33
34
  const helperTextToDisplay = validatemessage || helperText;
34
35
 
@@ -37,7 +38,7 @@ export default function URLComponent(props: URLComponentProps) {
37
38
  }
38
39
 
39
40
  if (displayMode === 'STACKED_LARGE_VAL') {
40
- return <FieldValueList name={hideLabel ? '' : label} value={value} variant="stacked" />;
41
+ return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;
41
42
  }
42
43
 
43
44
  if (readOnly) {
@@ -52,12 +53,12 @@ export default function URLComponent(props: URLComponentProps) {
52
53
 
53
54
  return (
54
55
  <TextField
55
- type="url"
56
+ type='url'
56
57
  fullWidth
57
- variant="outlined"
58
+ variant='outlined'
58
59
  helperText={helperTextToDisplay}
59
- placeholder=""
60
- size="small"
60
+ placeholder={placeholder ?? ''}
61
+ size='small'
61
62
  required={required}
62
63
  disabled={disabled}
63
64
  onChange={onChange}
@@ -4,6 +4,5 @@
4
4
  "description": "URL",
5
5
  "type": "Field",
6
6
  "subtype": "Text-URL",
7
- "properties": [
8
- ]
7
+ "properties": []
9
8
  }
@@ -1 +1 @@
1
- export { default } from './URL';
1
+ export { default } from './URL';
@@ -1,11 +1,10 @@
1
- import React, { Fragment, memo, useEffect, useState } from 'react';
1
+ import { memo, useEffect, useState } from 'react';
2
2
  import { Typography } from '@material-ui/core';
3
- import { getUserId, isUserNameAvailable } from './UserReferenceUtils';
3
+
4
4
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
5
- import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
+ import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
6
6
 
7
- // Remove this and use "real" PCore type once .d.ts is fixed (currently shows 1 errors)
8
- declare const PCore: any;
7
+ import { getUserId, isUserNameAvailable } from './UserReferenceUtils';
9
8
 
10
9
  const DROPDOWN_LIST = 'Drop-down list';
11
10
  const SEARCH_BOX = 'Search box';
@@ -50,7 +49,7 @@ const UserReference = (props: UserReferenceProps) => {
50
49
  required = false,
51
50
  disabled = false,
52
51
  onChange,
53
- // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
52
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
54
53
  variant = 'inline'
55
54
  } = props;
56
55
  const [dropDownDataSource, setDropDownDataSource] = useState([]);
@@ -66,7 +65,7 @@ const UserReference = (props: UserReferenceProps) => {
66
65
  // if same user ref field is referred in view as editable & readonly formatted text
67
66
  // referenced users won't be available, so get user details from dx api
68
67
  const { getOperatorDetails } = PCore.getUserApi();
69
- getOperatorDetails(userId).then((res) => {
68
+ getOperatorDetails(userId).then((res: any) => {
70
69
  if (res.data && res.data.pyOperatorInfo && res.data.pyOperatorInfo.pyUserName) {
71
70
  setUserName(res.data.pyOperatorInfo.pyUserName);
72
71
  }
@@ -76,16 +75,19 @@ const UserReference = (props: UserReferenceProps) => {
76
75
  const queryPayload = {
77
76
  dataViewName: OPERATORS_DP
78
77
  };
78
+
79
79
  PCore.getRestClient()
80
+ // @ts-ignore - Argument of type '{ queryPayload: { dataViewName: string; }; }' is not assignable to parameter of type 'RestApiOptionsObject'
81
+ // @ts-ignore - Expected 3 arguments, but got 2
80
82
  .invokeRestApi('getListData', { queryPayload })
81
- .then((res) => {
82
- const ddDataSource = res.data.data.map((listItem) => ({
83
+ .then((res: any) => {
84
+ const ddDataSource = res.data.data.map(listItem => ({
83
85
  key: listItem.pyUserIdentifier,
84
86
  value: listItem.pyUserName
85
87
  }));
86
88
  setDropDownDataSource(ddDataSource);
87
89
  })
88
- .catch((err) => {
90
+ .catch(err => {
89
91
  // eslint-disable-next-line no-console
90
92
  console.error(err);
91
93
  });
@@ -97,15 +99,15 @@ const UserReference = (props: UserReferenceProps) => {
97
99
  if (readOnly && showAsFormattedText) {
98
100
  if (userId) {
99
101
  userReferenceComponent = (
100
- <Fragment>
102
+ <>
101
103
  {/*
102
104
  TODO: This has to be replaced with Operator Component
103
105
  */}
104
106
  <div>
105
- <Typography variant="caption">{label}</Typography>
106
- <Typography variant="body1">{userName}</Typography>
107
+ <Typography variant='caption'>{label}</Typography>
108
+ <Typography variant='body1'>{userName}</Typography>
107
109
  </div>
108
- </Fragment>
110
+ </>
109
111
  );
110
112
  }
111
113
  } else {
@@ -133,7 +135,7 @@ const UserReference = (props: UserReferenceProps) => {
133
135
  label={label}
134
136
  getPConnect={getPConnect}
135
137
  datasource={OPERATORS_DP}
136
- listType="datapage"
138
+ listType='datapage'
137
139
  columns={columns}
138
140
  testId={testId}
139
141
  placeholder={placeholder}
@@ -153,7 +155,7 @@ const UserReference = (props: UserReferenceProps) => {
153
155
  <Dropdown
154
156
  additionalProps={additionalProps}
155
157
  datasource={dropDownDataSource}
156
- listType="associated"
158
+ listType='associated'
157
159
  getPConnect={getPConnect}
158
160
  label={label}
159
161
  value={userId}
@@ -1,4 +1,4 @@
1
- export const getUserId = (user) => {
1
+ export const getUserId = user => {
2
2
  let userId = '';
3
3
  if (typeof user === 'object' && user !== null && user.userId) {
4
4
  userId = user.userId;
@@ -8,6 +8,6 @@ export const getUserId = (user) => {
8
8
  return userId;
9
9
  };
10
10
 
11
- export const isUserNameAvailable = (user) => {
11
+ export const isUserNameAvailable = user => {
12
12
  return typeof user === 'object' && user !== null && user.userName;
13
13
  };
@@ -3,6 +3,5 @@
3
3
  "description": "User reference",
4
4
  "type": "Field",
5
5
  "subtype": "DATA_CAPTURE",
6
- "properties": [
7
- ]
6
+ "properties": []
8
7
  }
@@ -28,8 +28,8 @@ export const getIconFromFileType = (fileType): string => {
28
28
  icon = 'document-pdf';
29
29
  } else {
30
30
  const [, subtype] = fileType.split('/');
31
- const foundMatch = (sources) => {
32
- return sources.some((key) => subtype.includes(key));
31
+ const foundMatch = sources => {
32
+ return sources.some(key => subtype.includes(key));
33
33
  };
34
34
 
35
35
  if (foundMatch(['excel', 'spreadsheet'])) {
@@ -42,22 +42,27 @@ export const getIconFromFileType = (fileType): string => {
42
42
  return icon;
43
43
  };
44
44
 
45
- export const getIconForAttachment = (inThis:any , attachment:any): string => {
45
+ export const getIconForAttachment = (inThis: any, attachment: any): string => {
46
46
  let icon;
47
47
  switch (attachment.type) {
48
- case "FILE":
48
+ case 'FILE':
49
49
  icon = inThis.getIconFromFileType(attachment.mimeType);
50
50
  break;
51
- case "URL":
52
- icon = "chain";
51
+ case 'URL':
52
+ icon = 'chain';
53
53
  break;
54
54
  default:
55
- icon = "document-doc";
55
+ icon = 'document-doc';
56
56
  }
57
57
  return icon;
58
58
  };
59
59
 
60
- export const buildFilePropsFromResponse = (respObj): { props: { meta: string, name: string, icon: string}, responseProps: any} => {
60
+ export const buildFilePropsFromResponse = (
61
+ respObj
62
+ ): {
63
+ props: { meta: string; name: string; icon: string };
64
+ responseProps: any;
65
+ } => {
61
66
  return {
62
67
  props: {
63
68
  meta: `${respObj.pyCategoryName}, ${respObj.pxCreateOperator}`,
@@ -1,9 +1,5 @@
1
- import React from 'react';
2
1
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
3
2
 
4
- // Remove this and use "real" PCore type once .d.ts is fixed (currently shows 1 error)
5
- declare const PCore: any;
6
-
7
3
  /**
8
4
  * Function that accepts array of messages as input and group them by their type and returns the resulting object
9
5
  * @param {Array} inputMessages
@@ -25,7 +21,7 @@ function getMessagesGrouped(inputMessages) {
25
21
  const messages = {};
26
22
 
27
23
  if (inputMessages && inputMessages instanceof Array && inputMessages.length > 0) {
28
- inputMessages.forEach((item) => {
24
+ inputMessages.forEach(item => {
29
25
  const { message, type } = item;
30
26
  messages[type] = [...(messages[type] || []), message];
31
27
  });
@@ -69,7 +65,7 @@ function getBanners(config) {
69
65
  const banners: any = [];
70
66
  const groupedPageMessages = getMessagesGrouped(pageMessages);
71
67
 
72
- Object.keys(groupedPageMessages).forEach((type) => {
68
+ Object.keys(groupedPageMessages).forEach(type => {
73
69
  const messagesByType = groupedPageMessages[type];
74
70
  const variant = getVariant(type);
75
71
  const pageMessagesBannerID = `${target}_${PAGE}_${type}`.toLowerCase().replace('/', '_');
@@ -86,7 +82,7 @@ function getBanners(config) {
86
82
  category: PAGE,
87
83
  type,
88
84
  context: target
89
- });
85
+ } as any);
90
86
  }
91
87
  }
92
88
  />
@@ -94,7 +90,7 @@ function getBanners(config) {
94
90
  });
95
91
 
96
92
  if (httpMessages && httpMessages.length > 0) {
97
- banners.push(<AlertBanner id="modalViewContainerBanner" variant="urgent" messages={httpMessages} />);
93
+ banners.push(<AlertBanner id='modalViewContainerBanner' variant='urgent' messages={httpMessages} />);
98
94
  }
99
95
 
100
96
  return banners;
@@ -1,4 +1,8 @@
1
- // eslint-disable-next-line import/prefer-default-export
2
1
  export function isEmptyObject(obj: Object): boolean {
3
2
  return Object.keys(obj).length === 0;
4
3
  }
4
+
5
+ export function isInfinity23OrHigher() {
6
+ const pCoreVersion = PCore.getPCoreVersion();
7
+ return ['8.23.0', '23.1.1', '23.1.2'].includes(pCoreVersion);
8
+ }
@@ -1,17 +1,13 @@
1
- // Remove this and use "real" PCore type once .d.ts is fixed (currently shows 1 error)
2
- declare const PCore: any;
3
-
4
1
  // eslint-disable-next-line import/prefer-default-export
5
2
  export const getDataPage = (dataPageName, parameters, context) => {
6
3
  let dataViewParams;
7
- if(parameters){
4
+ if (parameters) {
8
5
  dataViewParams = {
9
- 'dataViewParameters': parameters
6
+ dataViewParameters: parameters
10
7
  };
11
8
  }
12
9
  return new Promise((resolve, reject) => {
13
- PCore.getDataApiUtils()
14
- .getData(dataPageName, dataViewParams, context)
10
+ (PCore.getDataApiUtils().getData(dataPageName, dataViewParams, context) as any)
15
11
  .then(response => {
16
12
  resolve(response.data.data);
17
13
  })
@@ -39,7 +39,7 @@ export const getDateFormatInfo = (): typeof dateFormatInfoDefault => {
39
39
  longFormat: 'MMM',
40
40
  placeholder: localizedPlaceholderExists ? localizedVal('month_placeholder', localeCategory) : 'mm',
41
41
  mask: '__',
42
- separator: theTestDateLocaleString[locMM+2]
42
+ separator: theTestDateLocaleString[locMM + 2]
43
43
  },
44
44
  {
45
45
  loc: locDD,
@@ -47,7 +47,7 @@ export const getDateFormatInfo = (): typeof dateFormatInfoDefault => {
47
47
  longFormat: 'DD',
48
48
  placeholder: localizedPlaceholderExists ? localizedVal('day_placeholder', localeCategory) : 'dd',
49
49
  mask: '__',
50
- separator: theTestDateLocaleString[locDD+2]
50
+ separator: theTestDateLocaleString[locDD + 2]
51
51
  },
52
52
  {
53
53
  loc: locYYYY,
@@ -55,7 +55,7 @@ export const getDateFormatInfo = (): typeof dateFormatInfoDefault => {
55
55
  longFormat: 'YYYY',
56
56
  placeholder: localizedPlaceholderExists ? localizedVal('year_placeholder', localeCategory) : 'yyyy',
57
57
  mask: '____',
58
- separator: theTestDateLocaleString[locYYYY+4]
58
+ separator: theTestDateLocaleString[locYYYY + 4]
59
59
  }
60
60
  ];
61
61