@pega/react-sdk-overrides 8.23.10 → 23.1.10

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 (142) hide show
  1. package/lib/designSystemExtension/AlertBanner/AlertBanner.tsx +47 -0
  2. package/lib/designSystemExtension/AlertBanner/index.tsx +1 -0
  3. package/lib/designSystemExtension/Banner/Banner.tsx +12 -1
  4. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +15 -10
  5. package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +10 -11
  6. package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +10 -3
  7. package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +11 -5
  8. package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +11 -3
  9. package/lib/designSystemExtension/Operator/Operator.tsx +30 -21
  10. package/lib/designSystemExtension/Pulse/Pulse.tsx +11 -7
  11. package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +121 -0
  12. package/lib/designSystemExtension/RichTextEditor/index.tsx +1 -0
  13. package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +12 -3
  14. package/lib/field/AutoComplete/AutoComplete.tsx +38 -19
  15. package/lib/field/CancelAlert/CancelAlert.tsx +21 -12
  16. package/lib/field/Checkbox/Checkbox.tsx +42 -9
  17. package/lib/field/Currency/Currency.tsx +24 -16
  18. package/lib/field/Currency/currency-utils.ts +1 -2
  19. package/lib/field/Date/Date.tsx +32 -18
  20. package/lib/field/DateTime/DateTime.tsx +27 -16
  21. package/lib/field/Decimal/Decimal.tsx +82 -19
  22. package/lib/field/Dropdown/Dropdown.tsx +60 -15
  23. package/lib/field/Email/Email.tsx +17 -9
  24. package/lib/field/Integer/Integer.tsx +15 -7
  25. package/lib/field/Percentage/Percentage.tsx +15 -7
  26. package/lib/field/Phone/Phone.tsx +21 -12
  27. package/lib/field/RadioButtons/RadioButtons.tsx +57 -28
  28. package/lib/field/RichText/RichText.tsx +95 -0
  29. package/lib/field/RichText/index.tsx +1 -0
  30. package/lib/field/ScalarList/ScalarList.tsx +73 -0
  31. package/lib/field/ScalarList/config-ext.json +8 -0
  32. package/lib/field/ScalarList/index.tsx +1 -0
  33. package/lib/field/SemanticLink/SemanticLink.tsx +26 -25
  34. package/lib/field/SemanticLink/utils.ts +2 -1
  35. package/lib/field/TextArea/TextArea.tsx +14 -5
  36. package/lib/field/TextContent/TextContent.tsx +10 -1
  37. package/lib/field/TextInput/TextInput.tsx +40 -11
  38. package/lib/field/Time/Time.tsx +29 -26
  39. package/lib/field/URL/URL.tsx +24 -8
  40. package/lib/field/UserReference/UserReference.tsx +52 -60
  41. package/lib/helpers/{attachmentHelpers.js → attachmentHelpers.ts} +5 -5
  42. package/lib/helpers/auth.js +752 -401
  43. package/lib/helpers/authManager.ts +933 -0
  44. package/lib/helpers/case-utils.tsx +103 -0
  45. package/lib/helpers/common-utils.ts +4 -0
  46. package/lib/helpers/config_access.js +63 -145
  47. package/lib/helpers/data_page.ts +2 -1
  48. package/lib/helpers/date-format-utils.ts +29 -19
  49. package/lib/helpers/{event-utils.js → event-utils.ts} +1 -1
  50. package/lib/helpers/{field-group-utils.js → field-group-utils.ts} +10 -11
  51. package/lib/helpers/formatters/{Currency.js → Currency.ts} +13 -12
  52. package/lib/helpers/formatters/{CurrencyMap.js → CurrencyMap.ts} +8 -5
  53. package/lib/helpers/formatters/{Date.js → Date.ts} +2 -2
  54. package/lib/helpers/formatters/{common.js → common.ts} +4 -4
  55. package/lib/helpers/formatters/{index.js → index.ts} +3 -3
  56. package/lib/helpers/simpleTableHelpers.ts +10 -6
  57. package/lib/helpers/state-utils.tsx +47 -0
  58. package/lib/helpers/template-utils.ts +3 -4
  59. package/lib/helpers/utils.ts +12 -4
  60. package/lib/helpers/versionHelpers.ts +0 -1
  61. package/lib/infra/ActionButtons/ActionButtons.tsx +13 -18
  62. package/lib/infra/Assignment/Assignment.tsx +44 -35
  63. package/lib/infra/AssignmentCard/AssignmentCard.tsx +15 -19
  64. package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +76 -64
  65. package/lib/infra/Containers/FlowContainer/{helpers.js → helpers.ts} +18 -16
  66. package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +41 -25
  67. package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +25 -30
  68. package/lib/infra/DashboardFilter/DashboardFilter.tsx +16 -20
  69. package/lib/infra/DashboardFilter/filterUtils.tsx +4 -1
  70. package/lib/infra/DeferLoad/DeferLoad.tsx +16 -19
  71. package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +21 -20
  72. package/lib/infra/MultiStep/MultiStep.tsx +24 -24
  73. package/lib/infra/NavBar/NavBar.tsx +23 -24
  74. package/lib/infra/Reference/Reference.tsx +14 -18
  75. package/lib/infra/Region/Region.tsx +8 -6
  76. package/lib/infra/RootContainer/RootContainer.tsx +32 -39
  77. package/lib/infra/Stages/Stages.tsx +15 -9
  78. package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +8 -1
  79. package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +12 -12
  80. package/lib/infra/View/View.tsx +30 -57
  81. package/lib/template/AppShell/AppShell.tsx +51 -34
  82. package/lib/template/BannerPage/BannerPage.tsx +26 -31
  83. package/lib/template/CaseSummary/CaseSummary.tsx +15 -8
  84. package/lib/template/CaseView/CaseView.tsx +137 -100
  85. package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +27 -27
  86. package/lib/template/Confirmation/Confirmation.tsx +29 -52
  87. package/lib/template/DataReference/DataReference.tsx +51 -53
  88. package/lib/template/DefaultForm/DefaultForm.tsx +29 -20
  89. package/lib/template/DefaultForm/utils/index.ts +33 -0
  90. package/lib/template/Details/Details/Details.tsx +16 -17
  91. package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +13 -16
  92. package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +19 -18
  93. package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +20 -18
  94. package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +78 -0
  95. package/lib/template/Details/DynamicTabs/config.json +36 -0
  96. package/lib/template/Details/DynamicTabs/index.tsx +1 -0
  97. package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +24 -27
  98. package/lib/template/InlineDashboard/InlineDashboard.tsx +11 -7
  99. package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +20 -18
  100. package/lib/template/ListPage/ListPage.tsx +14 -13
  101. package/lib/template/ListView/ListView.tsx +244 -314
  102. package/lib/template/ListView/{hooks.js → hooks.ts} +3 -1
  103. package/lib/template/ListView/{utils.js → utils.ts} +172 -23
  104. package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +12 -17
  105. package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +16 -1
  106. package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +19 -18
  107. package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +9 -1
  108. package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +17 -17
  109. package/lib/template/OneColumn/OneColumn/OneColumn.tsx +8 -7
  110. package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +10 -10
  111. package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +5 -7
  112. package/lib/template/PromotedFilters/PromotedFilters.tsx +23 -17
  113. package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +103 -6
  114. package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +29 -8
  115. package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +26 -31
  116. package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +33 -36
  117. package/lib/template/SubTabs/SubTabs.tsx +10 -11
  118. package/lib/template/SubTabs/tabUtils.ts +0 -2
  119. package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +10 -15
  120. package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +10 -10
  121. package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +10 -12
  122. package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +17 -3
  123. package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +35 -25
  124. package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +7 -1
  125. package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +15 -17
  126. package/lib/template/WssNavBar/WssNavBar.tsx +20 -3
  127. package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +13 -21
  128. package/lib/widget/Attachment/Attachment.css +15 -3
  129. package/lib/widget/Attachment/Attachment.tsx +51 -32
  130. package/lib/widget/CaseHistory/CaseHistory.tsx +13 -11
  131. package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +13 -1
  132. package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +40 -26
  133. package/lib/widget/Followers/Followers.tsx +10 -11
  134. package/lib/widget/QuickCreate/QuickCreate.tsx +15 -6
  135. package/lib/widget/SummaryItem/SummaryItem.tsx +12 -4
  136. package/lib/widget/SummaryList/SummaryList.tsx +17 -3
  137. package/lib/widget/ToDo/ToDo.tsx +69 -104
  138. package/package.json +1 -1
  139. package/lib/helpers/authManager.js +0 -631
  140. /package/lib/helpers/formatters/{Boolean.js → Boolean.ts} +0 -0
  141. /package/lib/helpers/{reactContextHelpers.js → reactContextHelpers.ts} +0 -0
  142. /package/lib/template/ListView/{DefaultViewMeta.js → DefaultViewMeta.ts} +0 -0
@@ -1,21 +1,35 @@
1
1
  /* eslint-disable react-hooks/rules-of-hooks */
2
2
  import React, { useMemo } from 'react';
3
- import PropTypes from 'prop-types';
4
-
5
- import FieldGroup from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldGroup';
6
- import FieldGroupList from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldGroupList';
7
3
  import { getReferenceList, buildView } from '@pega/react-sdk-components/lib/components/helpers/field-group-utils';
4
+ import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
5
+
6
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
7
+
8
+ interface FieldGroupTemplateProps extends PConnProps {
9
+ // If any, enter additional props that only exist on this component
10
+ referenceList?: Array<any>,
11
+ contextClass: string,
12
+ renderMode?: string,
13
+ heading?: string,
14
+ lookForChildInConfig?: boolean,
15
+ displayMode?: string,
16
+ fieldHeader?: string,
17
+ allowTableEdit: boolean
18
+ }
8
19
 
9
- declare const PCore: any;
10
20
 
11
- export default function FieldGroupTemplate(props) {
21
+ export default function FieldGroupTemplate(props: FieldGroupTemplateProps) {
22
+ // Get emitted components from map (so we can get any override that may exist)
23
+ const FieldGroup = getComponentFromMap('FieldGroup');
24
+ const FieldGroupList = getComponentFromMap('FieldGroupList');
25
+
12
26
  const {
13
- referenceList,
27
+ referenceList = [],
14
28
  renderMode,
15
29
  contextClass,
16
30
  getPConnect,
17
31
  lookForChildInConfig,
18
- heading,
32
+ heading = '',
19
33
  displayMode,
20
34
  fieldHeader,
21
35
  allowTableEdit: allowAddEdit
@@ -38,7 +52,7 @@ export default function FieldGroupTemplate(props) {
38
52
  if (PCore.getPCoreVersion()?.includes('8.7')) {
39
53
  pConn.getListActions().insert({ classID: contextClass }, referenceList.length, pageReference);
40
54
  } else {
41
- pConn.getListActions().insert({ classID: contextClass }, referenceList.length);
55
+ pConn.getListActions().insert({}, referenceList.length, null); // 3rd arg null until typedef marked correctly as optional
42
56
  }
43
57
  };
44
58
 
@@ -50,7 +64,7 @@ export default function FieldGroupTemplate(props) {
50
64
  if (PCore.getPCoreVersion()?.includes('8.7')) {
51
65
  pConn.getListActions().deleteEntry(index, pageReference);
52
66
  } else {
53
- pConn.getListActions().deleteEntry(index);
67
+ pConn.getListActions().deleteEntry(index, null); // 2nd arg null until typedef marked correctly as optional
54
68
  }
55
69
  };
56
70
  if (referenceList.length === 0 && allowAddEdit !== false) {
@@ -94,20 +108,3 @@ export default function FieldGroupTemplate(props) {
94
108
 
95
109
  return <div>{memoisedReadOnlyList}</div>;
96
110
  }
97
-
98
- FieldGroupTemplate.defaultProps = {
99
- referenceList: [],
100
- heading: undefined,
101
- contextClass: null,
102
- displayMode: undefined
103
- };
104
-
105
- FieldGroupTemplate.propTypes = {
106
- referenceList: PropTypes.arrayOf(Object),
107
- contextClass: PropTypes.string,
108
- getPConnect: PropTypes.func.isRequired,
109
- renderMode: PropTypes.string.isRequired,
110
- heading: PropTypes.string,
111
- lookForChildInConfig: PropTypes.bool,
112
- displayMode: PropTypes.string
113
- };
@@ -1,7 +1,16 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import { Grid, Typography } from '@material-ui/core';
4
3
  import { makeStyles } from '@material-ui/core/styles';
4
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
+
6
+ // InlineDashboard does NOT have getPConnect. So, no need to extend from PConnProps
7
+ interface InlineDashboardProps extends PConnProps {
8
+ // If any, enter additional props that only exist on this component
9
+ children: Array<any>,
10
+ title: string,
11
+ filterPosition?: string
12
+ }
13
+
5
14
 
6
15
  const useStyles = makeStyles((/* theme */) => ({
7
16
  headerStyles: {
@@ -30,7 +39,7 @@ const useStyles = makeStyles((/* theme */) => ({
30
39
  }
31
40
  }));
32
41
 
33
- export default function InlineDashboard(props) {
42
+ export default function InlineDashboard(props: InlineDashboardProps) {
34
43
  const classes = useStyles();
35
44
 
36
45
  const { children, title, filterPosition } = props;
@@ -65,8 +74,3 @@ export default function InlineDashboard(props) {
65
74
  </>
66
75
  );
67
76
  }
68
-
69
- InlineDashboard.propTypes = {
70
- children: PropTypes.arrayOf(PropTypes.node).isRequired
71
- // template: PropTypes.string.isRequired
72
- };
@@ -1,18 +1,33 @@
1
1
  import React from 'react';
2
2
  import { useMemo, Children, useEffect, useState } from 'react';
3
- import PropTypes from 'prop-types';
4
3
 
5
4
  import { buildFilterComponents } from '@pega/react-sdk-components/lib/components/infra/DashboardFilter/filterUtils';
6
- import InlineDashboard from '@pega/react-sdk-components/lib/components/template/InlineDashboard';
5
+ import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
7
6
 
8
- export default function InlineDashboardPage(props) {
9
- const { children, getPConnect } = props;
7
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
8
+
9
+
10
+ interface InlineDashboardPageProps extends PConnProps {
11
+ // If any, enter additional props that only exist on this component
12
+ children: Array<any>,
13
+ title: string,
14
+ icon?: string,
15
+ filterPosition?: string
16
+ }
17
+
18
+
19
+ export default function InlineDashboardPage(props: InlineDashboardPageProps) {
20
+ // Get emitted components from map (so we can get any override that may exist)
21
+ const InlineDashboard = getComponentFromMap("InlineDashboard");
22
+
23
+ // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
24
+ const { children, getPConnect, icon = '', filterPosition = 'block-start' } = props;
10
25
  const [filterComponents, setFilterComponents] = useState([]);
11
26
  const childArray = useMemo(() => {
12
27
  return Children.toArray(children);
13
28
  }, [children]);
14
29
 
15
- const allFilters = getPConnect().getRawMetadata().children[1];
30
+ const allFilters = getPConnect().getRawMetadata()["children"][1];
16
31
 
17
32
  useEffect(() => {
18
33
  setFilterComponents(buildFilterComponents(getPConnect, allFilters));
@@ -26,16 +41,3 @@ export default function InlineDashboardPage(props) {
26
41
 
27
42
  return <InlineDashboard {...inlineProps} />;
28
43
  }
29
-
30
- InlineDashboardPage.propTypes = {
31
- children: PropTypes.arrayOf(PropTypes.node).isRequired,
32
- getPConnect: PropTypes.func.isRequired,
33
- title: PropTypes.string.isRequired,
34
- icon: PropTypes.string,
35
- filterPosition: PropTypes.string
36
- };
37
-
38
- InlineDashboardPage.defaultProps = {
39
- icon: '',
40
- filterPosition: 'block-start'
41
- };
@@ -1,20 +1,21 @@
1
1
  import React from "react";
2
- import PropTypes from "prop-types";
2
+ import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
3
3
 
4
- import ListView from '@pega/react-sdk-components/lib/components/template/ListView';
4
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
5
 
6
- export default function ListPage(props) {
6
+ interface ListPageProps extends PConnProps {
7
+ // If any, enter additional props that only exist on this component
8
+ parameters: object
9
+ }
10
+
11
+
12
+ export default function ListPage(props: ListPageProps) {
13
+ // Get emitted components from map (so we can get any override that may exist)
14
+ const ListView = getComponentFromMap('ListView');
7
15
 
16
+ // special case for ListView - add in a prop
17
+ const listViewProps = {...props, bInForm: false};
8
18
  return (
9
- <ListView {...props}></ListView>
19
+ <ListView {...listViewProps}></ListView>
10
20
  )
11
21
  }
12
-
13
- ListPage.defaultProps = {
14
- parameters: undefined
15
- };
16
-
17
- ListPage.propTypes = {
18
- getPConnect: PropTypes.func.isRequired,
19
- parameters: PropTypes.objectOf(PropTypes.any)
20
- };