@pega/react-sdk-overrides 0.25.1 → 0.25.3

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 (144) hide show
  1. package/lib/designSystemExtension/Banner/Banner.css +1 -1
  2. package/lib/designSystemExtension/Banner/Banner.tsx +7 -7
  3. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -1
  4. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +52 -36
  5. package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +11 -13
  6. package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +8 -9
  7. package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +9 -9
  8. package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +7 -8
  9. package/lib/designSystemExtension/Operator/Operator.tsx +21 -19
  10. package/lib/designSystemExtension/Pulse/Pulse.tsx +1 -1
  11. package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +28 -3
  12. package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.css +4 -4
  13. package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +1 -1
  14. package/lib/field/AutoComplete/AutoComplete.tsx +1 -1
  15. package/lib/field/CancelAlert/CancelAlert.css +4 -4
  16. package/lib/field/CancelAlert/CancelAlert.tsx +6 -6
  17. package/lib/field/Checkbox/Checkbox.tsx +97 -4
  18. package/lib/field/Currency/Currency.tsx +3 -3
  19. package/lib/field/Currency/currency-utils.ts +1 -2
  20. package/lib/field/Date/Date.tsx +3 -7
  21. package/lib/field/DateTime/DateTime.tsx +3 -8
  22. package/lib/field/Decimal/Decimal.tsx +3 -5
  23. package/lib/field/Dropdown/Dropdown.tsx +5 -7
  24. package/lib/field/Email/Email.tsx +11 -13
  25. package/lib/field/Group/Group.tsx +7 -7
  26. package/lib/field/Integer/Integer.tsx +5 -7
  27. package/lib/field/Location/Location.tsx +256 -0
  28. package/lib/field/Location/config-ext.json +8 -0
  29. package/lib/field/Location/index.tsx +1 -0
  30. package/lib/field/ObjectReference/ObjectReference.tsx +235 -0
  31. package/lib/field/ObjectReference/index.tsx +1 -0
  32. package/lib/field/ObjectReference/utils.ts +111 -0
  33. package/lib/field/Percentage/Percentage.tsx +3 -7
  34. package/lib/field/Phone/Phone.tsx +7 -5
  35. package/lib/field/RadioButtons/RadioButtons.tsx +47 -2
  36. package/lib/field/RichText/RichText.tsx +1 -1
  37. package/lib/field/ScalarList/ScalarList.tsx +2 -3
  38. package/lib/field/SelectableCard/SelectableCard.tsx +175 -0
  39. package/lib/field/SelectableCard/index.tsx +1 -0
  40. package/lib/field/SelectableCard/utils.tsx +226 -0
  41. package/lib/field/SemanticLink/SemanticLink.tsx +160 -28
  42. package/lib/field/SemanticLink/utils.ts +1 -1
  43. package/lib/field/TextArea/TextArea.tsx +5 -7
  44. package/lib/field/TextContent/TextContent.tsx +1 -2
  45. package/lib/field/TextInput/TextInput.tsx +5 -7
  46. package/lib/field/Time/Time.tsx +3 -7
  47. package/lib/field/URL/URL.tsx +5 -7
  48. package/lib/field/UserReference/UserReference.tsx +1 -2
  49. package/lib/helpers/attachmentHelpers.ts +56 -35
  50. package/lib/helpers/common-utils.ts +2 -2
  51. package/lib/helpers/data_page.ts +0 -1
  52. package/lib/helpers/field-group-utils.ts +1 -1
  53. package/lib/helpers/formatters/CurrencyMap.ts +0 -2
  54. package/lib/helpers/simpleTableHelpers.ts +118 -6
  55. package/lib/helpers/utils.ts +8 -1
  56. package/lib/helpers/versionHelpers.ts +0 -1
  57. package/lib/infra/ActionButtons/ActionButtons.tsx +28 -21
  58. package/lib/infra/Assignment/Assignment.tsx +4 -4
  59. package/lib/infra/AssignmentCard/AssignmentCard.tsx +2 -2
  60. package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +15 -94
  61. package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +1 -2
  62. package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +3 -3
  63. package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +4 -5
  64. package/lib/infra/Containers/container-helpers.ts +47 -1
  65. package/lib/infra/DashboardFilter/DashboardFilter.tsx +2 -4
  66. package/lib/infra/DashboardFilter/filterUtils.tsx +3 -4
  67. package/lib/infra/DeferLoad/DeferLoad.tsx +2 -4
  68. package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +1 -3
  69. package/lib/infra/MultiStep/MultiStep.css +8 -8
  70. package/lib/infra/MultiStep/MultiStep.tsx +2 -2
  71. package/lib/infra/NavBar/NavBar.css +1 -1
  72. package/lib/infra/NavBar/NavBar.tsx +29 -27
  73. package/lib/infra/Reference/Reference.tsx +3 -4
  74. package/lib/infra/Region/Region.tsx +1 -1
  75. package/lib/infra/RootContainer/RootContainer.tsx +2 -3
  76. package/lib/infra/Stages/Stages.tsx +1 -1
  77. package/lib/infra/View/View.tsx +2 -2
  78. package/lib/template/AdvancedSearch/AdvancedSearch.tsx +0 -1
  79. package/lib/template/AdvancedSearch/SearchGroup/persistUtils.ts +3 -9
  80. package/lib/template/AdvancedSearch/SearchGroups/SearchGroups.tsx +3 -4
  81. package/lib/template/AdvancedSearch/SearchGroups/hooks.ts +1 -1
  82. package/lib/template/AppShell/AppShell.css +1 -1
  83. package/lib/template/AppShell/AppShell.tsx +6 -10
  84. package/lib/template/BannerPage/BannerPage.tsx +2 -2
  85. package/lib/template/CaseSummary/CaseSummary.tsx +2 -3
  86. package/lib/template/CaseView/CaseView.tsx +15 -21
  87. package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +1 -1
  88. package/lib/template/Confirmation/Confirmation.tsx +2 -3
  89. package/lib/template/DataReference/DataReference.tsx +9 -12
  90. package/lib/template/DataReference/SearchForm.tsx +6 -5
  91. package/lib/template/DataReference/{utils.js → utils.ts} +3 -3
  92. package/lib/template/DefaultForm/DefaultForm.tsx +3 -3
  93. package/lib/template/Details/Details/Details.tsx +11 -11
  94. package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +2 -2
  95. package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +11 -11
  96. package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +11 -11
  97. package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +1 -1
  98. package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +2 -3
  99. package/lib/template/InlineDashboard/InlineDashboard.tsx +14 -16
  100. package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +2 -2
  101. package/lib/template/ListPage/ListPage.tsx +1 -1
  102. package/lib/template/ListView/ListView.tsx +10 -22
  103. package/lib/template/ListView/hooks.ts +1 -5
  104. package/lib/template/ListView/utils.ts +1 -1
  105. package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +1 -1
  106. package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +5 -5
  107. package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +11 -11
  108. package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +2 -2
  109. package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +2 -2
  110. package/lib/template/OneColumn/OneColumn/OneColumn.tsx +7 -7
  111. package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +1 -1
  112. package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +2 -2
  113. package/lib/template/PromotedFilters/PromotedFilters.tsx +1 -2
  114. package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +2 -3
  115. package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +35 -32
  116. package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +1 -1
  117. package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +1 -1
  118. package/lib/template/SubTabs/SubTabs.tsx +2 -2
  119. package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +9 -10
  120. package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +1 -1
  121. package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +9 -10
  122. package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +5 -5
  123. package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +11 -11
  124. package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +2 -2
  125. package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +2 -2
  126. package/lib/template/WssNavBar/WssNavBar.css +1 -1
  127. package/lib/template/WssNavBar/WssNavBar.tsx +5 -5
  128. package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +1 -1
  129. package/lib/widget/Attachment/Attachment.css +6 -8
  130. package/lib/widget/Attachment/Attachment.tsx +62 -58
  131. package/lib/widget/CaseHistory/CaseHistory.tsx +5 -5
  132. package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.css +0 -14
  133. package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +3 -3
  134. package/lib/widget/FileUtility/FileUtility/FileUtility.css +7 -6
  135. package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +5 -7
  136. package/lib/widget/Followers/Followers.tsx +2 -4
  137. package/lib/widget/QuickCreate/QuickCreate.tsx +1 -2
  138. package/lib/widget/SummaryItem/SummaryItem.css +9 -11
  139. package/lib/widget/SummaryItem/SummaryItem.tsx +2 -2
  140. package/lib/widget/SummaryList/SummaryList.tsx +1 -1
  141. package/lib/widget/ToDo/ToDo.css +1 -13
  142. package/lib/widget/ToDo/ToDo.tsx +26 -26
  143. package/package.json +1 -1
  144. /package/lib/template/DataReference/{DataReferenceAdvancedSearchContext.js → DataReferenceAdvancedSearchContext.ts} +0 -0
@@ -14,7 +14,6 @@ export default function useInit(props) {
14
14
  ref,
15
15
  showDynamicFields,
16
16
  isDataObject,
17
- xRayUid,
18
17
  cosmosTableRef
19
18
  } = props;
20
19
  let { editing, selectionMode } = props;
@@ -27,7 +26,6 @@ export default function useInit(props) {
27
26
 
28
27
  (async function init() {
29
28
  // promise to fetch metadata
30
- // @ts-ignore - 3rd parameter "associationFilter" should be optional for getDataViewMetadata method
31
29
  const metaDataPromise: Promise<any> = PCore.getAnalyticsUtils().getDataViewMetadata(referenceList, showDynamicFields);
32
30
 
33
31
  const promisesArray = [metaDataPromise];
@@ -73,8 +71,7 @@ export default function useInit(props) {
73
71
  getPConnect,
74
72
  compositeKeys,
75
73
  isSearchable,
76
- isCacheable: true,
77
- xRayUid
74
+ isCacheable: true
78
75
  }).then(async context => {
79
76
  if (isCompStillMounted) {
80
77
  return readContextResponse(context, {
@@ -83,7 +80,6 @@ export default function useInit(props) {
83
80
  selectionCountThreshold,
84
81
  ref,
85
82
  selectionMode,
86
- xRayUid,
87
83
  cosmosTableRef
88
84
  });
89
85
  }
@@ -684,7 +684,7 @@ export function updatePageFieldsConfig(configFields, parentClassID) {
684
684
  export const readContextResponse = async (context, params) => {
685
685
  const { getPConnect, apiContext, setListContext, children, showDynamicFields, referenceList, isDataObject, ref } = params;
686
686
  const { promisesResponseArray, setShowRecords, apiContext: otherContext } = context;
687
- // eslint-disable-next-line sonarjs/no-unused-collection
687
+
688
688
  const listOfComponents: any[] = [];
689
689
  ref.setShowRecords = setShowRecords;
690
690
  const {
@@ -1,4 +1,4 @@
1
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
1
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
2
2
 
3
3
  interface MultiReferenceReadOnlyProps extends PConnProps {
4
4
  config: { referenceList: any; readonlyContextList: any };
@@ -1,16 +1,16 @@
1
- import { PropsWithChildren, ReactElement } from 'react';
2
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
1
+ import type { PropsWithChildren, ReactElement } from 'react';
2
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
3
3
  import './NarrowWide.css';
4
4
 
5
5
  interface NarrowWideProps extends PConnProps {
6
6
  // If any, enter additional props that only exist on this component
7
7
  a: any;
8
8
  b: any;
9
- // eslint-disable-next-line react/no-unused-prop-types
9
+
10
10
  title?: string;
11
- // eslint-disable-next-line react/no-unused-prop-types
11
+
12
12
  cols?: string;
13
- // eslint-disable-next-line react/no-unused-prop-types
13
+
14
14
  icon?: string;
15
15
  }
16
16
 
@@ -1,10 +1,10 @@
1
1
  import { createElement } from 'react';
2
- import Grid, { GridSize } from '@mui/material/Grid';
2
+ import Grid2, { type GridSize } from '@mui/material/Grid2';
3
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 { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
7
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
8
8
 
9
9
  interface NarrowWideDetailsProps extends PConnProps {
10
10
  // If any, enter additional props that only exist on this component
@@ -31,7 +31,7 @@ export default function NarrowWideDetails(props: NarrowWideDetailsProps) {
31
31
  const children = (getPConnect().getChildren() as any[]).map((configObject, index) =>
32
32
  createElement(createPConnectComponent(), {
33
33
  ...configObject,
34
- // eslint-disable-next-line react/no-array-index-key
34
+
35
35
  key: index.toString()
36
36
  })
37
37
  );
@@ -56,21 +56,21 @@ export default function NarrowWideDetails(props: NarrowWideDetailsProps) {
56
56
  return (
57
57
  <FieldGroup name={propsToUse.showLabel ? propsToUse.label : ''}>
58
58
  {showHighlightedData && highlightedDataArr.length > 0 && (
59
- <Grid container spacing={1} style={{ padding: '0 0 1em' }}>
59
+ <Grid2 container spacing={1} style={{ padding: '0 0 1em' }}>
60
60
  {highlightedDataArr.map((child, i) => (
61
- <Grid item xs={COLUMN_WIDTHS[i] as GridSize} key={`hf-${i + 1}`}>
61
+ <Grid2 size={{ xs: COLUMN_WIDTHS[i] as GridSize }} key={`hf-${i + 1}`}>
62
62
  {child}
63
- </Grid>
63
+ </Grid2>
64
64
  ))}
65
- </Grid>
65
+ </Grid2>
66
66
  )}
67
- <Grid container spacing={1}>
67
+ <Grid2 container spacing={1}>
68
68
  {children.map((child, i) => (
69
- <Grid item xs={COLUMN_WIDTHS[i] as GridSize} key={`r-${i + 1}`}>
69
+ <Grid2 size={{ xs: COLUMN_WIDTHS[i] as GridSize }} key={`r-${i + 1}`}>
70
70
  {child}
71
- </Grid>
71
+ </Grid2>
72
72
  ))}
73
- </Grid>
73
+ </Grid2>
74
74
  </FieldGroup>
75
75
  );
76
76
  }
@@ -1,5 +1,5 @@
1
- import { PropsWithChildren, ReactElement } from 'react';
2
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
1
+ import type { PropsWithChildren, ReactElement } from 'react';
2
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
3
3
  import './NarrowWideForm.css';
4
4
 
5
5
  interface NarrowWideFormProps extends PConnProps {
@@ -1,6 +1,6 @@
1
- import { PropsWithChildren, ReactElement } from 'react';
1
+ import type { PropsWithChildren, ReactElement } from 'react';
2
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';
3
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
4
4
 
5
5
  interface NarrowWidePageProps extends PConnProps {
6
6
  // If any, enter additional props that only exist on this component
@@ -1,7 +1,7 @@
1
- import { PropsWithChildren, ReactElement } from 'react';
2
- import { Grid } from '@mui/material';
1
+ import type { PropsWithChildren, ReactElement } from 'react';
2
+ import Grid2 from '@mui/material/Grid2';
3
3
  import makeStyles from '@mui/styles/makeStyles';
4
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
4
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
5
 
6
6
  interface OneColumnProps extends PConnProps {
7
7
  // If any, enter additional props that only exist on this component
@@ -21,12 +21,12 @@ export default function OneColumn(props: PropsWithChildren<OneColumnProps>) {
21
21
  const { children } = props;
22
22
 
23
23
  return (
24
- <Grid container spacing={2}>
25
- <Grid item xs={12} className={classes.colStyles}>
24
+ <Grid2 container spacing={2}>
25
+ <Grid2 size={{ xs: 12 }} className={classes.colStyles}>
26
26
  {(children as ReactElement[]).map(child => {
27
27
  return child;
28
28
  })}
29
- </Grid>
30
- </Grid>
29
+ </Grid2>
30
+ </Grid2>
31
31
  );
32
32
  }
@@ -1,5 +1,5 @@
1
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';
2
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
3
3
 
4
4
  interface OneColumnPageProps extends PConnProps {
5
5
  // If any, enter additional props that only exist on this component
@@ -1,5 +1,5 @@
1
- import { PropsWithChildren } from 'react';
2
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
1
+ import type { PropsWithChildren } from 'react';
2
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
3
3
 
4
4
  interface OneColumnTabProps extends PConnProps {
5
5
  // If any, enter additional props that only exist on this component
@@ -6,7 +6,7 @@ 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 { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
9
+ import type { 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"
@@ -57,7 +57,6 @@ function Filters({ filters, transientItemID, localeReference }) {
57
57
  }
58
58
  });
59
59
 
60
- // eslint-disable-next-line react/no-array-index-key
61
60
  return <React.Fragment key={index}>{createElement(createPConnectComponent(), c11nEnv)}</React.Fragment>;
62
61
  });
63
62
  }
@@ -1,10 +1,9 @@
1
- /* eslint-disable react-hooks/rules-of-hooks */
2
1
  import { useRef } from 'react';
3
2
 
4
3
  import { buildMetaForListView, getContext } from '@pega/react-sdk-components/lib/components/helpers/simpleTableHelpers';
5
4
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
6
5
 
7
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
6
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
8
7
 
9
8
  // Can't use SimpleTableProps until getComponentConfig() and getFieldMetadata() are NOT private
10
9
  interface SimpleTableProps extends PConnProps {
@@ -90,7 +89,7 @@ export default function SimpleTable(props: SimpleTableProps) {
90
89
  );
91
90
 
92
91
  const metaForPConnect = JSON.parse(JSON.stringify(metaForListView));
93
- // @ts-ignore - PCore.getMetadataUtils().getPropertyMetadata - An argument for 'currentClassID' was not provided.
92
+ // @ts-expect-error - PCore.getMetadataUtils().getPropertyMetadata - An argument for 'currentClassID' was not provided.
94
93
  metaForPConnect.config.parameters = rawParams ?? PCore.getMetadataUtils().getPropertyMetadata(name)?.datasource?.parameters;
95
94
 
96
95
  const { referenceListStr: referenceList } = getContext(getPConnect());
@@ -1,4 +1,4 @@
1
- import React, { PropsWithChildren, useEffect, useLayoutEffect, useRef, useState } from 'react';
1
+ import React, { type PropsWithChildren, useEffect, useLayoutEffect, useRef, useState } from 'react';
2
2
  import Table from '@mui/material/Table';
3
3
  import TableBody from '@mui/material/TableBody';
4
4
  import TableCell from '@mui/material/TableCell';
@@ -29,7 +29,7 @@ import { getReferenceList } from '@pega/react-sdk-components/lib/components/help
29
29
  import { getDataPage } from '@pega/react-sdk-components/lib/components/helpers/data_page';
30
30
  import { getGenericFieldsLocalizedValue } from '@pega/react-sdk-components/lib/components/helpers/common-utils';
31
31
  import { buildFieldsForTable, filterData, getContext } from '@pega/react-sdk-components/lib/components/helpers/simpleTableHelpers';
32
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
32
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
33
33
  import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
34
34
 
35
35
  interface SimpleTableManualProps extends PConnProps {
@@ -74,7 +74,7 @@ const useStyles = makeStyles((/* theme */) => ({
74
74
  fontSize: '14px'
75
75
  },
76
76
  header: {
77
- background: '#f5f5f5'
77
+ background: 'var(--table-header-background)'
78
78
  },
79
79
  tableCell: {
80
80
  borderRight: '1px solid lightgray',
@@ -163,6 +163,7 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
163
163
  const menuIconOverride$ = Utils.getImageSrc('trash', Utils.getSDKStaticConentUrl());
164
164
 
165
165
  const resolvedFields = children?.[0]?.children || presets?.[0].children?.[0].children;
166
+ const primaryFieldsViewIndex = resolvedFields.findIndex(field => field.config.value === 'pyPrimaryFields');
166
167
  // NOTE: props has each child.config with datasource and value undefined
167
168
  // but getRawMetadata() has each child.config with datasource and value showing their unresolved values (ex: "@P thePropName")
168
169
  // We need to use the prop name as the "glue" to tie the table dataSource, displayColumns and data together.
@@ -194,10 +195,8 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
194
195
  });
195
196
 
196
197
  useEffect(() => {
197
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
198
198
  buildElementsForTable();
199
199
  if (readOnlyMode || allowEditingInModal) {
200
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
201
200
  generateRowsData();
202
201
  }
203
202
  }, [referenceList]);
@@ -208,7 +207,10 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
208
207
  // Constellation DX Components do). It will also have the "label", and "meta" contains the original,
209
208
  // unchanged config info. For now, much of the info here is carried over from
210
209
  // Constellation DX Components.
211
- const fieldDefs = buildFieldsForTable(rawFields, resolvedFields, showDeleteButton);
210
+ const fieldDefs = buildFieldsForTable(rawFields, getPConnect(), showDeleteButton, {
211
+ primaryFieldsViewIndex,
212
+ fields: resolvedFields
213
+ });
212
214
 
213
215
  useLayoutEffect(() => {
214
216
  if (allowEditingInModal) {
@@ -219,7 +221,7 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
219
221
  fieldDefs.filter(item => item.name).map(item => item.name)
220
222
  );
221
223
  } else {
222
- // @ts-ignore - An argument for 'fields' was not provided
224
+ // @ts-expect-error - An argument for 'fields' was not provided
223
225
  getPConnect().getListActions().initDefaultPageInstructions(getPConnect().getReferenceList());
224
226
  }
225
227
  }, []);
@@ -246,7 +248,7 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
246
248
 
247
249
  // return the value that should be shown as the contents for the given row data
248
250
  // of the given row field
249
- function getRowValue(inRowData: Object, inColKey: string): any {
251
+ function getRowValue(inRowData: object, inColKey: string): any {
250
252
  // See what data (if any) we have to display
251
253
  const refKeys: string[] = inColKey?.split('.');
252
254
  let valBuilder = inRowData;
@@ -277,7 +279,6 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
277
279
  setRowData(data);
278
280
  })
279
281
  .catch(e => {
280
- // eslint-disable-next-line no-console
281
282
  console.log(e);
282
283
  });
283
284
  } else {
@@ -286,7 +287,7 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
286
287
  // we're using as the table's dataSource
287
288
  const data: any = [];
288
289
  for (const row of referenceList) {
289
- const dataForRow: Object = {};
290
+ const dataForRow: object = {};
290
291
  for (const col of displayedColumns) {
291
292
  const colKey: string = col;
292
293
  const theVal = getRowValue(row, colKey);
@@ -318,7 +319,7 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
318
319
  if (allowEditingInModal && defaultView) {
319
320
  pConn
320
321
  .getActionsApi()
321
- // @ts-ignore
322
+ // @ts-expect-error
322
323
  .openEmbeddedDataModal(defaultView, pConn, referenceListStr, referenceList.length, PCore.getConstants().RESOURCE_STATUS.CREATE);
323
324
  } else {
324
325
  pConn.getListActions().insert({ classID: contextClass }, referenceList.length);
@@ -334,7 +335,7 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
334
335
  if (typeof selectedRowIndex.current === 'number') {
335
336
  pConn
336
337
  .getActionsApi()
337
- // @ts-ignore
338
+ // @ts-expect-error
338
339
  .openEmbeddedDataModal(
339
340
  bUseSeparateViewForEdit ? editView : defaultView,
340
341
  pConn,
@@ -360,23 +361,25 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
360
361
  const data: any = [];
361
362
  rawFields.forEach(item => {
362
363
  // removing label field from config to hide title in the table cell
363
- item = { ...item, config: { ...item.config, label: '', displayMode: readOnlyMode || allowEditingInModal ? 'DISPLAY_ONLY' : undefined } };
364
- const referenceListData = getReferenceList(pConn);
365
- const isDatapage = referenceListData.startsWith('D_');
366
- const pageReferenceValue = isDatapage
367
- ? `${referenceListData}[${index}]`
368
- : `${pConn.getPageReference()}${referenceListData.substring(referenceListData.lastIndexOf('.'))}[${index}]`;
369
- const config = {
370
- meta: item,
371
- options: {
372
- context,
373
- pageReference: pageReferenceValue,
374
- referenceList: referenceListData,
375
- hasForm: true
376
- }
377
- };
378
- const view = PCore.createPConnect(config);
379
- data.push(createElement(createPConnectComponent(), view));
364
+ if (!item.config.hide) {
365
+ item = { ...item, config: { ...item.config, label: '', displayMode: readOnlyMode || allowEditingInModal ? 'DISPLAY_ONLY' : undefined } };
366
+ const referenceListData = getReferenceList(pConn);
367
+ const isDatapage = referenceListData.startsWith('D_');
368
+ const pageReferenceValue = isDatapage
369
+ ? `${referenceListData}[${index}]`
370
+ : `${pConn.getPageReference()}${referenceListData.substring(referenceListData.lastIndexOf('.'))}[${index}]`;
371
+ const config = {
372
+ meta: item,
373
+ options: {
374
+ context,
375
+ pageReference: pageReferenceValue,
376
+ referenceList: referenceListData,
377
+ hasForm: true
378
+ }
379
+ };
380
+ const view = PCore.createPConnect(config);
381
+ data.push(createElement(createPConnectComponent(), view));
382
+ }
380
383
  });
381
384
  eleData.push(data);
382
385
  });
@@ -419,7 +422,6 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
419
422
  function stableSort<T>(array: T[], comparator: (a: T, b: T) => number) {
420
423
  const stabilizedThis = array.map((el, index) => [el, index] as [T, number]);
421
424
  stabilizedThis.sort((a, b) => {
422
- // eslint-disable-next-line @typescript-eslint/no-shadow
423
425
  const order = comparator(a[0], b[0]);
424
426
  if (order !== 0) return order;
425
427
  return a[1] - b[1];
@@ -574,7 +576,6 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
574
576
  function _showFilteredIcon(columnId) {
575
577
  for (const filterObj of filterByColumns) {
576
578
  if (filterObj.ref === columnId) {
577
- // eslint-disable-next-line sonarjs/prefer-single-boolean-return
578
579
  if (filterObj.containsFilterValue !== '') {
579
580
  return true;
580
581
  }
@@ -608,6 +609,9 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
608
609
  <TableHead className={classes.header}>
609
610
  <TableRow>
610
611
  {fieldDefs.map((field: any, index) => {
612
+ if (field?.meta?.config?.hide) {
613
+ return null; // Skip rendering if hide = true
614
+ }
611
615
  return (
612
616
  <TableCell key={`head-${displayedColumns[index]}`} className={classes.tableCell}>
613
617
  {(readOnlyMode || allowEditingInModal) && field.cellRenderer !== 'DeleteIcon' ? (
@@ -678,7 +682,6 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
678
682
  .slice(0)
679
683
  .map((row, index) => {
680
684
  return (
681
- // eslint-disable-next-line react/no-array-index-key
682
685
  <TableRow key={index}>
683
686
  {row.map((item, childIndex) => {
684
687
  const theColKey = displayedColumns[childIndex];
@@ -1,6 +1,6 @@
1
1
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
2
2
 
3
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
3
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
4
4
 
5
5
  interface SimpleTableSelectProps extends PConnProps {
6
6
  // If any, enter additional props that only exist on this component
@@ -1,4 +1,4 @@
1
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
1
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
2
2
 
3
3
  interface SingleReferenceReadOnlyProps extends PConnProps {
4
4
  // If any, enter additional props that only exist on this component
@@ -1,9 +1,9 @@
1
- import { Children, PropsWithChildren, useEffect, useState } from 'react';
1
+ import { Children, type PropsWithChildren, useEffect, useState } from 'react';
2
2
  import { Tab, Tabs } from '@mui/material';
3
3
  import { TabContext, TabPanel } from '@mui/lab';
4
4
 
5
5
  import { getTransientTabs, getVisibleTabs, tabClick } from './tabUtils';
6
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
6
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
7
7
 
8
8
  interface SubTabsProps extends PConnProps {
9
9
  // If any, enter additional props that only exist on this component
@@ -1,7 +1,7 @@
1
- import { PropsWithChildren, ReactElement } from 'react';
2
- import { Grid, GridSize } from '@mui/material';
1
+ import type { PropsWithChildren, ReactElement } from 'react';
2
+ import Grid2, { type GridSize } from '@mui/material/Grid2';
3
3
  import makeStyles from '@mui/styles/makeStyles';
4
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
4
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
5
 
6
6
  interface TwoColumnProps extends PConnProps {
7
7
  // If any, enter additional props that only exist on this component
@@ -23,7 +23,6 @@ export default function TwoColumn(props: PropsWithChildren<TwoColumnProps>) {
23
23
  const childrenToRender = children as ReactElement[];
24
24
 
25
25
  if (childrenToRender.length !== 2) {
26
- // eslint-disable-next-line no-console
27
26
  console.error(`TwoColumn template sees more than 2 columns: ${childrenToRender.length}`);
28
27
  }
29
28
 
@@ -43,13 +42,13 @@ export default function TwoColumn(props: PropsWithChildren<TwoColumnProps>) {
43
42
  bSize = (ratio * colAArray[1]) as GridSize;
44
43
 
45
44
  return (
46
- <Grid container spacing={1}>
47
- <Grid item xs={12} md={aSize} className={classes.colStyles}>
45
+ <Grid2 container spacing={1}>
46
+ <Grid2 size={{ xs: 12, md: aSize }} className={classes.colStyles}>
48
47
  {childrenToRender[0]}
49
- </Grid>
50
- <Grid item xs={12} md={bSize} className={classes.colStyles}>
48
+ </Grid2>
49
+ <Grid2 size={{ xs: 12, md: bSize }} className={classes.colStyles}>
51
50
  {childrenToRender[1]}
52
- </Grid>
53
- </Grid>
51
+ </Grid2>
52
+ </Grid2>
54
53
  );
55
54
  }
@@ -1,5 +1,5 @@
1
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';
2
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
3
3
 
4
4
  interface TwoColumnPageProps extends PConnProps {
5
5
  // If any, enter additional props that only exist on this component
@@ -1,7 +1,7 @@
1
- import { PropsWithChildren, ReactElement } from 'react';
2
- import { Grid, GridSize } from '@mui/material';
1
+ import type { PropsWithChildren, ReactElement } from 'react';
2
+ import Grid2, { type GridSize } from '@mui/material/Grid2';
3
3
  import makeStyles from '@mui/styles/makeStyles';
4
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
4
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
5
 
6
6
  interface TwoColumnTabProps extends PConnProps {
7
7
  // If any, enter additional props that only exist on this component
@@ -23,7 +23,6 @@ export default function TwoColumnTab(props: PropsWithChildren<TwoColumnTabProps>
23
23
  const childrenToRender = children as ReactElement[];
24
24
 
25
25
  if (childrenToRender.length !== 2) {
26
- // eslint-disable-next-line no-console
27
26
  console.error(`TwoColumn template sees more than 2 columns: ${childrenToRender.length}`);
28
27
  }
29
28
 
@@ -43,13 +42,13 @@ export default function TwoColumnTab(props: PropsWithChildren<TwoColumnTabProps>
43
42
  bSize = (ratio * colAArray[1]) as GridSize;
44
43
 
45
44
  return (
46
- <Grid container spacing={1}>
47
- <Grid item xs={12} md={aSize} className={classes.colStyles}>
45
+ <Grid2 container spacing={1}>
46
+ <Grid2 size={{ xs: 12, md: aSize }} className={classes.colStyles}>
48
47
  {childrenToRender[0]}
49
- </Grid>
50
- <Grid item xs={12} md={bSize} className={classes.colStyles}>
48
+ </Grid2>
49
+ <Grid2 size={{ xs: 12, md: bSize }} className={classes.colStyles}>
51
50
  {childrenToRender[1]}
52
- </Grid>
53
- </Grid>
51
+ </Grid2>
52
+ </Grid2>
54
53
  );
55
54
  }
@@ -1,16 +1,16 @@
1
- import { PropsWithChildren, ReactElement } from 'react';
2
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
1
+ import type { PropsWithChildren, ReactElement } from 'react';
2
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
3
3
  import './WideNarrow.css';
4
4
 
5
5
  interface WideNarrowProps extends PConnProps {
6
6
  // If any, enter additional props that only exist on this component
7
7
  a: any;
8
8
  b: any;
9
- // eslint-disable-next-line react/no-unused-prop-types
9
+
10
10
  title?: string;
11
- // eslint-disable-next-line react/no-unused-prop-types
11
+
12
12
  cols?: string;
13
- // eslint-disable-next-line react/no-unused-prop-types
13
+
14
14
  icon?: string;
15
15
  }
16
16
 
@@ -1,10 +1,10 @@
1
1
  import { createElement } from 'react';
2
- import Grid, { GridSize } from '@mui/material/Grid';
2
+ import Grid2, { type GridSize } from '@mui/material/Grid2';
3
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 { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
7
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
8
8
 
9
9
  interface WideNarrowDetailsProps extends PConnProps {
10
10
  // If any, enter additional props that only exist on this component
@@ -36,7 +36,7 @@ export default function WideNarrowDetails(props: WideNarrowDetailsProps) {
36
36
 
37
37
  return createElement(createPConnectComponent(), {
38
38
  ...theConfigObject,
39
- // eslint-disable-next-line react/no-array-index-key
39
+
40
40
  key: index.toString()
41
41
  });
42
42
  });
@@ -66,21 +66,21 @@ export default function WideNarrowDetails(props: WideNarrowDetailsProps) {
66
66
  return (
67
67
  <FieldGroup name={theName}>
68
68
  {showHighlightedData && highlightedDataArr.length > 0 && (
69
- <Grid container spacing={1} style={{ padding: '0 0 1em' }}>
69
+ <Grid2 container spacing={1} style={{ padding: '0 0 1em' }}>
70
70
  {highlightedDataArr.map((child, i) => (
71
- <Grid item xs={COLUMN_WIDTHS[i] as GridSize} key={`hf-${i + 1}`}>
71
+ <Grid2 size={{ xs: COLUMN_WIDTHS[i] as GridSize }} key={`hf-${i + 1}`}>
72
72
  {child}
73
- </Grid>
73
+ </Grid2>
74
74
  ))}
75
- </Grid>
75
+ </Grid2>
76
76
  )}
77
- <Grid container spacing={1}>
77
+ <Grid2 container spacing={1}>
78
78
  {children?.map((child, i) => (
79
- <Grid item xs={COLUMN_WIDTHS[i] as GridSize} key={`r-${i + 1}`}>
79
+ <Grid2 size={{ xs: COLUMN_WIDTHS[i] as GridSize }} key={`r-${i + 1}`}>
80
80
  {child}
81
- </Grid>
81
+ </Grid2>
82
82
  ))}
83
- </Grid>
83
+ </Grid2>
84
84
  </FieldGroup>
85
85
  );
86
86
  }
@@ -1,5 +1,5 @@
1
- import { PropsWithChildren, ReactElement } from 'react';
2
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
1
+ import type { PropsWithChildren, ReactElement } from 'react';
2
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
3
3
  import './WideNarrowForm.css';
4
4
 
5
5
  interface WideNarrowFormProps extends PConnProps {
@@ -1,6 +1,6 @@
1
- import { Children, PropsWithChildren } from 'react';
1
+ import { Children, type PropsWithChildren } from 'react';
2
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';
3
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
4
4
 
5
5
  interface WideNarrowPageProps extends PConnProps {
6
6
  // If any, enter additional props that only exist on this component
@@ -1,5 +1,5 @@
1
1
  .link-style {
2
- color: white !important;
2
+ color: var(--app-text-color) !important;
3
3
  text-transform: capitalize !important;
4
4
  font-size: 1rem !important;
5
5
  }