@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,23 +1,21 @@
1
- import React, { createElement } from 'react';
2
- import Grid from '@material-ui/core/Grid';
3
- import { GridSize } from '@material-ui/core/Grid';
1
+ import { createElement } from 'react';
2
+ import Grid, { GridSize } from '@material-ui/core/Grid';
3
+
4
4
  import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
5
5
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
6
6
 
7
- // import type { PConnProps } from '../../../../types/PConnProps';
8
-
9
- // Can't use PConnProps until getPConnect().getChildren() type is ok
10
- // interface NarrowWideDetailsProps extends PConnProps {
11
- // // If any, enter additional props that only exist on this component
12
- // showLabel?: boolean,
13
- // label: string,
14
- // showHighlightedData?: boolean
15
- // }
7
+ import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
16
8
 
9
+ interface NarrowWideDetailsProps extends PConnProps {
10
+ // If any, enter additional props that only exist on this component
11
+ showLabel?: boolean;
12
+ label: string;
13
+ showHighlightedData?: boolean;
14
+ }
17
15
 
18
16
  const COLUMN_WIDTHS = [4, 8];
19
17
 
20
- export default function NarrowWideDetails(props /* : NarrowWideDetailsProps */) {
18
+ export default function NarrowWideDetails(props: NarrowWideDetailsProps) {
21
19
  // Get emitted components from map (so we can get any override that may exist)
22
20
  const FieldGroup = getComponentFromMap('FieldGroup');
23
21
 
@@ -30,20 +28,18 @@ export default function NarrowWideDetails(props /* : NarrowWideDetailsProps */)
30
28
  // in a readonly (display) mode instead of a editable
31
29
  getPConnect().setInheritedProp('displayMode', 'LABELS_LEFT');
32
30
  getPConnect().setInheritedProp('readOnly', true);
33
- const children = getPConnect()
34
- .getChildren()
35
- .map((configObject, index) =>
36
- createElement(createPConnectComponent(), {
37
- ...configObject,
38
- // eslint-disable-next-line react/no-array-index-key
39
- key: index.toString()
40
- })
41
- );
31
+ const children = (getPConnect().getChildren() as any[]).map((configObject, index) =>
32
+ createElement(createPConnectComponent(), {
33
+ ...configObject,
34
+ // eslint-disable-next-line react/no-array-index-key
35
+ key: index.toString()
36
+ })
37
+ );
42
38
 
43
39
  // Set up highlighted data to pass in return if is set to show, need raw metadata to pass to createComponent
44
40
  let highlightedDataArr = [];
45
41
  if (showHighlightedData) {
46
- const { highlightedData = [] } = getPConnect().getRawMetadata().config;
42
+ const { highlightedData = [] } = (getPConnect().getRawMetadata() as any).config;
47
43
  highlightedDataArr = highlightedData.map(field => {
48
44
  field.config.displayMode = 'STACKED_LARGE_VAL';
49
45
 
@@ -53,8 +49,7 @@ export default function NarrowWideDetails(props /* : NarrowWideDetailsProps */)
53
49
  field.config.displayAsStatus = true;
54
50
  }
55
51
 
56
- return getPConnect().createComponent(field,
57
- '', '', {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
52
+ return getPConnect().createComponent(field, '', '', {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
58
53
  });
59
54
  }
60
55
 
@@ -4,6 +4,5 @@
4
4
  "description": "Details (Narrow-wide) template",
5
5
  "type": "Template",
6
6
  "subtype": "DETAILS",
7
- "properties": [
8
- ]
7
+ "properties": []
9
8
  }
@@ -9,7 +9,6 @@
9
9
  float: left;
10
10
  padding: 0rem 0.3125rem 0rem 0rem;
11
11
  height: 100%;
12
-
13
12
  }
14
13
 
15
14
  .psdk-narrow-wide-column .psdk-wide-column-column {
@@ -17,5 +16,4 @@
17
16
  float: left;
18
17
  padding: 0rem 0rem 0rem 0.3125rem;
19
18
  height: 100%;
20
-
21
19
  }
@@ -1,32 +1,22 @@
1
- import React from "react";
2
-
1
+ import { PropsWithChildren, ReactElement } from 'react';
2
+ import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
3
3
  import './NarrowWideForm.css';
4
4
 
5
- // NarrowWideForm does NOT have getPConnect. So, no need to extend from PConnProps
6
-
7
- interface NarrowWideFormProps {
5
+ interface NarrowWideFormProps extends PConnProps {
8
6
  // If any, enter additional props that only exist on this component
9
- children: Array<any>
10
7
  }
11
8
 
12
-
13
- export default function NarrowWideForm(props: NarrowWideFormProps) {
14
- const {children} = props;
9
+ export default function NarrowWideForm(props: PropsWithChildren<NarrowWideFormProps>) {
10
+ const { children } = props;
15
11
 
16
12
  return (
17
- <React.Fragment>
18
- {children && children.length === 2 &&
19
- <div className="psdk-narrow-wide-column">
20
- <div className="psdk-narrow-column-column">
21
- {children[0]}
22
- </div>
23
- <div className="psdk-wide-column-column">
24
- {children[1]}
25
- </div>
26
- </div>
27
- }
28
- </React.Fragment>
29
-
30
- )
31
-
13
+ <>
14
+ {children && (children as ReactElement[]).length === 2 && (
15
+ <div className='psdk-narrow-wide-column'>
16
+ <div className='psdk-narrow-column-column'>{children[0]}</div>
17
+ <div className='psdk-wide-column-column'>{children[1]}</div>
18
+ </div>
19
+ )}
20
+ </>
21
+ );
32
22
  }
@@ -4,6 +4,5 @@
4
4
  "description": "NarrowWide Template",
5
5
  "type": "Template",
6
6
  "subtype": "FORM",
7
- "properties": [
8
- ]
7
+ "properties": []
9
8
  }
@@ -1,38 +1,28 @@
1
- import React, { Children } from "react";
2
- // import { TwoColumnPage as TwoColumn } from "@pega/cosmos-react-core";
1
+ import { PropsWithChildren, ReactElement } from 'react';
3
2
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
3
+ import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
4
4
 
5
-
6
- // NarrowWidePage does NOT have getPConnect. So, no need to extend from PConnProps
7
- interface NarrowWidePageProps {
5
+ interface NarrowWidePageProps extends PConnProps {
8
6
  // If any, enter additional props that only exist on this component
9
- children: Array<any>,
10
- title: string,
11
- templateCol: string,
12
- icon: string
7
+ title: string;
8
+ templateCol: string;
9
+ icon: string;
13
10
  }
14
11
 
15
-
16
12
  /*
17
13
  * The wrapper handles knowing how to take in just children and mapping
18
14
  * to the Cosmos template.
19
15
  */
20
- export default function NarrowWidePage(props: NarrowWidePageProps) {
16
+ export default function NarrowWidePage(props: PropsWithChildren<NarrowWidePageProps>) {
21
17
  // Get emitted components from map (so we can get any override that may exist)
22
18
  const NarrowWide = getComponentFromMap('NarrowWide');
23
19
 
24
20
  const { children, title, templateCol = '1fr 1fr', icon = '' } = props;
25
- const childArray = Children.toArray(children);
21
+ const childrenToRender = children as ReactElement[];
26
22
 
27
23
  return (
28
24
  <div>
29
- <NarrowWide
30
- a={childArray[0]}
31
- b={childArray[1]}
32
- title={title}
33
- cols={templateCol}
34
- icon={icon?.replace("pi pi-", "")}
35
- />
25
+ <NarrowWide a={childrenToRender[0]} b={childrenToRender[1]} title={title} cols={templateCol} icon={icon?.replace('pi pi-', '')} />
36
26
  </div>
37
27
  );
38
28
  }
@@ -4,6 +4,5 @@
4
4
  "description": "Narrow-wide Page Template",
5
5
  "type": "Template",
6
6
  "subtype": "PAGE",
7
- "properties": [
8
- ]
7
+ "properties": []
9
8
  }
@@ -1,33 +1,32 @@
1
- import React from "react";
2
- import { Grid } from "@material-ui/core";
1
+ import { PropsWithChildren, ReactElement } from 'react';
2
+ import { Grid } from '@material-ui/core';
3
3
  import { makeStyles } from '@material-ui/core/styles';
4
+ import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
4
5
 
5
- // OneColumn does NOT have getPConnect. So, no need to extend from PConnProps
6
- interface OneColumnProps{
6
+ interface OneColumnProps extends PConnProps {
7
7
  // If any, enter additional props that only exist on this component
8
- children: Array<any>
9
8
  }
10
9
 
11
-
12
10
  const useStyles = makeStyles((/* theme */) => ({
13
11
  colStyles: {
14
- display: "grid",
15
- gap: "1rem",
16
- alignContent: "baseline",
17
- },
12
+ display: 'grid',
13
+ gap: '1rem',
14
+ alignContent: 'baseline'
15
+ }
18
16
  }));
19
17
 
20
-
21
- export default function OneColumn(props: OneColumnProps) {
18
+ export default function OneColumn(props: PropsWithChildren<OneColumnProps>) {
22
19
  const classes = useStyles();
23
20
 
24
- const { children} = props;
21
+ const { children } = props;
25
22
 
26
23
  return (
27
24
  <Grid container spacing={2}>
28
25
  <Grid item xs={12} className={classes.colStyles}>
29
- {children.map(child => { return child; } )}
26
+ {(children as ReactElement[]).map(child => {
27
+ return child;
28
+ })}
30
29
  </Grid>
31
30
  </Grid>
32
- )
31
+ );
33
32
  }
@@ -4,6 +4,5 @@
4
4
  "description": "OneColumn Template",
5
5
  "type": "Template",
6
6
  "subtype": "FORM",
7
- "properties": [
8
- ]
7
+ "properties": []
9
8
  }
@@ -1,13 +1,10 @@
1
- import React from "react";
2
1
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
2
+ import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
3
3
 
4
- // OneColumnPage does NOT have getPConnect. So, no need to extend from PConnProps
5
- interface OneColumnPageProps{
4
+ interface OneColumnPageProps extends PConnProps {
6
5
  // If any, enter additional props that only exist on this component
7
- children: Array<any>
8
6
  }
9
7
 
10
-
11
8
  /*
12
9
  * The wrapper handles knowing how to take in just children
13
10
  * and mapping to the TwoColumn template.
@@ -16,9 +13,5 @@ export default function OneColumnPage(props: OneColumnPageProps) {
16
13
  // Get emitted components from map (so we can get any override that may exist)
17
14
  const OneColumn = getComponentFromMap('OneColumn');
18
15
 
19
- return (
20
- <OneColumn
21
- {...props}
22
- />
23
- );
16
+ return <OneColumn {...props} />;
24
17
  }
@@ -4,6 +4,5 @@
4
4
  "description": "OneColumn Page Template",
5
5
  "type": "Template",
6
6
  "subtype": "PAGE",
7
- "properties": [
8
- ]
7
+ "properties": []
9
8
  }
@@ -1,15 +1,11 @@
1
- import React from "react";
1
+ import { PropsWithChildren } from 'react';
2
+ import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
2
3
 
3
- interface OneColumnTabProps{
4
+ interface OneColumnTabProps extends PConnProps {
4
5
  // If any, enter additional props that only exist on this component
5
- children: Array<any>
6
6
  }
7
- export default function OneColumnTab(props: OneColumnTabProps) {
8
- const { children} = props;
7
+ export default function OneColumnTab(props: PropsWithChildren<OneColumnTabProps>) {
8
+ const { children } = props;
9
9
 
10
- return (
11
- <div id="OneColumnTab">
12
- {children}
13
- </div>
14
- )
10
+ return <div id='OneColumnTab'>{children}</div>;
15
11
  }
@@ -4,6 +4,5 @@
4
4
  "description": "One column",
5
5
  "type": "Template",
6
6
  "subtype": "TAB",
7
- "properties": [
8
- ]
7
+ "properties": []
9
8
  }
@@ -1,6 +1,6 @@
1
1
  .psdk-grid-filter {
2
2
  display: grid;
3
- grid-template-columns: repeat(2,minmax(0,1fr));
3
+ grid-template-columns: repeat(2, minmax(0, 1fr));
4
4
  column-gap: calc(2 * 0.5rem);
5
5
  row-gap: calc(2 * 0.5rem);
6
6
  align-items: start;
@@ -1,4 +1,4 @@
1
- import React, { useCallback, useMemo, useState, createElement, Fragment } from 'react';
1
+ import React, { useCallback, useMemo, useState, createElement } from 'react';
2
2
  import Button from '@material-ui/core/Button';
3
3
 
4
4
  import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
@@ -6,19 +6,18 @@ import { isEmptyObject } from '@pega/react-sdk-components/lib/components/helpers
6
6
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
7
7
  import './PromotedFilters.css';
8
8
 
9
- // import type { PConnProps } from '../../../types/PConnProps';
9
+ import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
10
10
 
11
11
  // Can't use PromotedFilterProps until getContainerManager() knows about addTransientItem
12
12
  // Currently just expects "object"
13
- // interface PromotedFilterProps extends PConnProps {
14
- // // If any, enter additional props that only exist on this component
15
- // viewName: string,
16
- // filters: Array<any>,
17
- // listViewProps: any,
18
- // pageClass: string,
19
- // parameters?: object
20
- // }
21
-
13
+ interface PromotedFilterProps extends PConnProps {
14
+ // If any, enter additional props that only exist on this component
15
+ viewName: string;
16
+ filters: any[];
17
+ listViewProps: any;
18
+ pageClass: string;
19
+ parameters?: object;
20
+ }
22
21
 
23
22
  const localeCategory = 'SimpleTable';
24
23
  const SUPPORTED_TYPES_IN_PROMOTED_FILTERS = [
@@ -64,10 +63,10 @@ function Filters({ filters, transientItemID, localeReference }) {
64
63
  }
65
64
 
66
65
  function isValidInput(input) {
67
- return Object.values(input).findIndex((v) => v) >= 0;
66
+ return Object.values(input).findIndex(v => v) >= 0;
68
67
  }
69
68
 
70
- export default function PromotedFilters(props /* : PromotedFilterProps */) {
69
+ export default function PromotedFilters(props: PromotedFilterProps) {
71
70
  // Get emitted components from map (so we can get any override that may exist)
72
71
  const ListView = getComponentFromMap('ListView');
73
72
 
@@ -77,7 +76,7 @@ export default function PromotedFilters(props /* : PromotedFilterProps */) {
77
76
  const [payload, setPayload] = useState({});
78
77
  const filtersProperties = {};
79
78
 
80
- filters.forEach((filter) => {
79
+ filters.forEach(filter => {
81
80
  filtersProperties[PCore.getAnnotationUtils().getPropertyName(filter.config.value)] = '';
82
81
  });
83
82
 
@@ -99,7 +98,7 @@ export default function PromotedFilters(props /* : PromotedFilterProps */) {
99
98
  lhs: {
100
99
  field
101
100
  },
102
- comparator: "EQ",
101
+ comparator: 'EQ',
103
102
  rhs: {
104
103
  value
105
104
  }
@@ -110,12 +109,12 @@ export default function PromotedFilters(props /* : PromotedFilterProps */) {
110
109
  }
111
110
 
112
111
  const getFilterData = useCallback(
113
- (e) => {
112
+ e => {
114
113
  e.preventDefault(); // to prevent un-intended forms submission.
115
114
 
116
115
  const changes = PCore.getFormUtils().getChanges(transientItemID);
117
116
  const formValues = {};
118
- Object.keys(changes).forEach((key) => {
117
+ Object.keys(changes).forEach(key => {
119
118
  if (!['context_data', 'pageInstructions'].includes(key)) {
120
119
  formValues[key] = changes[key];
121
120
  }
@@ -143,25 +142,30 @@ export default function PromotedFilters(props /* : PromotedFilterProps */) {
143
142
  }, [transientItemID]);
144
143
 
145
144
  return (
146
- <Fragment>
145
+ <>
147
146
  <div>{listViewProps.title}</div>
148
- <div className="psdk-grid-filter">
149
- <Filters filters={filters} transientItemID={transientItemID} localeReference={listViewProps.localeReference}/>
147
+ <div className='psdk-grid-filter'>
148
+ <Filters filters={filters} transientItemID={transientItemID} localeReference={listViewProps.localeReference} />
150
149
  </div>
151
150
  <div>
152
151
  <Button key='1' type='button' onClick={clearFilterData} data-testid='clear' variant='contained' color='primary'>
153
152
  {localizedVal('Clear', localeCategory)}
154
153
  </Button>
155
- <Button style={{float: 'right'}} key='2' type='submit' onClick={getFilterData} data-testid='search' variant='contained' color='primary'>
154
+ <Button style={{ float: 'right' }} key='2' type='submit' onClick={getFilterData} data-testid='search' variant='contained' color='primary'>
156
155
  {localizedVal('Search', localeCategory)}
157
156
  </Button>
158
157
  </div>
159
- {initTable && <ListView {...listViewProps} title='' payload={payload}
160
- isSearchable
161
- tableDisplay={{
162
- show: initTable
163
- }}
164
- />}
165
- </Fragment>
158
+ {initTable && (
159
+ <ListView
160
+ {...listViewProps}
161
+ title=''
162
+ payload={payload}
163
+ isSearchable
164
+ tableDisplay={{
165
+ show: initTable
166
+ }}
167
+ />
168
+ )}
169
+ </>
166
170
  );
167
171
  }
@@ -1,21 +1,31 @@
1
1
  /* eslint-disable react-hooks/rules-of-hooks */
2
- import React from 'react';
3
- import { buildMetaForListView, getContext } from '@pega/react-sdk-components/lib/components/helpers/simpleTableHelpers';
4
2
  import { useRef } from 'react';
3
+
4
+ import { buildMetaForListView, getContext } from '@pega/react-sdk-components/lib/components/helpers/simpleTableHelpers';
5
5
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
6
6
 
7
- // import type { PConnProps } from '../../../../types/PConnProps';
7
+ import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
8
8
 
9
9
  // Can't use SimpleTableProps until getComponentConfig() and getFieldMetadata() are NOT private
10
- // interface SimpleTableProps extends PConnProps {
11
- // // If any, enter additional props that only exist on this component
12
- // multiRecordDisplayAs: string,
13
- // allowTableEdit: boolean,
14
- // contextClass: any
15
- // }
16
- declare const PCore: any;
10
+ interface SimpleTableProps extends PConnProps {
11
+ // If any, enter additional props that only exist on this component
12
+ multiRecordDisplayAs: string;
13
+ allowTableEdit: boolean;
14
+ contextClass: any;
15
+ label: string;
16
+ propertyLabel?: string;
17
+ displayMode?: string;
18
+ fieldMetadata?: any;
19
+ hideLabel?: boolean;
20
+ parameters?: any;
21
+ isDataObject?: boolean;
22
+ type?: string;
23
+ ruleClass?: string;
24
+ authorContext?: string;
25
+ name?: string;
26
+ }
17
27
 
18
- export default function SimpleTable(props /* : SimpleTableProps */) {
28
+ export default function SimpleTable(props: SimpleTableProps) {
19
29
  // Get emitted components from map (so we can get any override that may exist)
20
30
  const ListView = getComponentFromMap('ListView');
21
31
  const FieldGroupTemplate = getComponentFromMap('FieldGroupTemplate');
@@ -40,12 +50,14 @@ export default function SimpleTable(props /* : SimpleTableProps */) {
40
50
 
41
51
  let { contextClass } = props;
42
52
  if (!contextClass) {
53
+ // @ts-ignore - Property 'getComponentConfig' is private and only accessible within class 'C11nEnv'.
43
54
  let listName = getPConnect().getComponentConfig().referenceList;
44
55
  listName = PCore.getAnnotationUtils().getPropertyName(listName);
45
56
  // was... contextClass = getPConnect().getFieldMetadata(listName)?.pageClass;
57
+ // @ts-ignore - Property 'getFieldMetadata' is private and only accessible within class 'C11nEnv'.
46
58
  const theFieldMetadata = getPConnect().getFieldMetadata(listName);
47
59
  if (theFieldMetadata) {
48
- contextClass = theFieldMetadata['pageClass'];
60
+ contextClass = theFieldMetadata.pageClass;
49
61
  } else {
50
62
  contextClass = undefined;
51
63
  }
@@ -59,15 +71,11 @@ export default function SimpleTable(props /* : SimpleTableProps */) {
59
71
  const propsToUse = { label, ...getPConnect().getInheritedProps() };
60
72
  const isDisplayModeEnabled = displayMode === 'DISPLAY_ONLY';
61
73
 
62
- if (
63
- fieldMetadata &&
64
- fieldMetadata.type === 'Page List' &&
65
- fieldMetadata.dataRetrievalType === 'refer'
66
- ) {
74
+ if (fieldMetadata && fieldMetadata.type === 'Page List' && fieldMetadata.dataRetrievalType === 'refer') {
67
75
  const {
68
76
  children: [{ children: rawFields }],
69
77
  parameters: rawParams
70
- } = getPConnect().getRawMetadata().config;
78
+ } = (getPConnect().getRawMetadata() as any).config;
71
79
  if (isDisplayModeEnabled && hideLabel) {
72
80
  propsToUse.label = '';
73
81
  }
@@ -84,8 +92,8 @@ export default function SimpleTable(props /* : SimpleTableProps */) {
84
92
  );
85
93
 
86
94
  const metaForPConnect = JSON.parse(JSON.stringify(metaForListView));
87
- metaForPConnect.config.parameters =
88
- rawParams ?? PCore.getMetadataUtils().getPropertyMetadata(name)?.datasource?.parameters;
95
+ // @ts-ignore - PCore.getMetadataUtils().getPropertyMetadata - An argument for 'currentClassID' was not provided.
96
+ metaForPConnect.config.parameters = rawParams ?? PCore.getMetadataUtils().getPropertyMetadata(name)?.datasource?.parameters;
89
97
 
90
98
  const { referenceListStr: referenceList } = getContext(getPConnect());
91
99
  let requiredContextForQueryInDisplayMode = {};
@@ -100,9 +108,7 @@ export default function SimpleTable(props /* : SimpleTableProps */) {
100
108
  ...requiredContextForQueryInDisplayMode
101
109
  };
102
110
 
103
- const refToPConnect = useRef(
104
- PCore.createPConnect({ meta: metaForPConnect, options }).getPConnect
105
- ).current; // getPConnect should be created only once.
111
+ const refToPConnect = useRef(PCore.createPConnect({ meta: metaForPConnect, options }).getPConnect).current; // getPConnect should be created only once.
106
112
  /* BUG-637178 : need to send context */
107
113
  const listViewProps = {
108
114
  ...metaForListView.config,
@@ -111,15 +117,13 @@ export default function SimpleTable(props /* : SimpleTableProps */) {
111
117
  fieldName: authorContext,
112
118
  bInForm: true
113
119
  };
114
- const listViewComponent = <ListView {...listViewProps} />;
115
- return listViewComponent;
116
- } else {
117
- const simpleTableManualProps = { ...props, contextClass };
118
- if (allowTableEdit === false) {
119
- simpleTableManualProps.hideAddRow = true;
120
- simpleTableManualProps.hideDeleteRow = true;
121
- simpleTableManualProps.disableDragDrop = true;
122
- }
123
- return <SimpleTableManual {...simpleTableManualProps} />;
120
+ return <ListView {...listViewProps} />;
121
+ }
122
+ const simpleTableManualProps: any = { ...props, contextClass };
123
+ if (allowTableEdit === false) {
124
+ simpleTableManualProps.hideAddRow = true;
125
+ simpleTableManualProps.hideDeleteRow = true;
126
+ simpleTableManualProps.disableDragDrop = true;
124
127
  }
128
+ return <SimpleTableManual {...simpleTableManualProps} />;
125
129
  }
@@ -3,6 +3,5 @@
3
3
  "description": "Datatype List Template",
4
4
  "type": "Template",
5
5
  "subtype": "DATAVIEW",
6
- "properties": [
7
- ]
6
+ "properties": []
8
7
  }