@pega/react-sdk-overrides 0.24.4 → 0.25.2

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 (139) hide show
  1. package/lib/designSystemExtension/AlertBanner/AlertBanner.tsx +1 -1
  2. package/lib/designSystemExtension/Banner/Banner.tsx +1 -1
  3. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -2
  4. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +59 -32
  5. package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +4 -4
  6. package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +5 -5
  7. package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +4 -4
  8. package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +6 -6
  9. package/lib/designSystemExtension/Operator/Operator.tsx +16 -12
  10. package/lib/designSystemExtension/Pulse/Pulse.tsx +3 -3
  11. package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +3 -2
  12. package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +1 -1
  13. package/lib/field/AutoComplete/AutoComplete.tsx +5 -5
  14. package/lib/field/CancelAlert/CancelAlert.tsx +5 -8
  15. package/lib/field/Checkbox/Checkbox.tsx +5 -5
  16. package/lib/field/Currency/Currency.tsx +12 -9
  17. package/lib/field/Date/Date.tsx +29 -48
  18. package/lib/field/DateTime/DateTime.tsx +37 -39
  19. package/lib/field/Decimal/Decimal.tsx +12 -9
  20. package/lib/field/Dropdown/Dropdown.tsx +34 -27
  21. package/lib/field/Email/Email.tsx +39 -20
  22. package/lib/field/Group/Group.tsx +4 -4
  23. package/lib/field/Integer/Integer.tsx +27 -15
  24. package/lib/field/Multiselect/Multiselect.tsx +8 -14
  25. package/lib/field/Multiselect/utils.ts +1 -1
  26. package/lib/field/Percentage/Percentage.tsx +11 -11
  27. package/lib/field/Phone/Phone.tsx +13 -10
  28. package/lib/field/Phone/config-ext.json +8 -0
  29. package/lib/field/RadioButtons/RadioButtons.tsx +4 -7
  30. package/lib/field/RichText/RichText.tsx +2 -2
  31. package/lib/field/RichText/config-ext.json +10 -0
  32. package/lib/field/ScalarList/ScalarList.tsx +4 -5
  33. package/lib/field/SemanticLink/SemanticLink.tsx +5 -5
  34. package/lib/field/TextArea/TextArea.tsx +30 -14
  35. package/lib/field/TextContent/TextContent.tsx +2 -2
  36. package/lib/field/TextInput/TextInput.tsx +7 -9
  37. package/lib/field/Time/Time.tsx +30 -27
  38. package/lib/field/URL/URL.tsx +29 -12
  39. package/lib/field/UserReference/UserReference.tsx +4 -6
  40. package/lib/helpers/common-utils.ts +24 -1
  41. package/lib/helpers/field-group-utils.ts +3 -3
  42. package/lib/helpers/formatters/Currency.ts +11 -16
  43. package/lib/helpers/formatters/common.ts +2 -1
  44. package/lib/helpers/formatters/index.ts +2 -4
  45. package/lib/helpers/simpleTableHelpers.ts +1 -1
  46. package/lib/infra/ActionButtons/ActionButtons.tsx +3 -3
  47. package/lib/infra/Assignment/Assignment.tsx +14 -14
  48. package/lib/infra/AssignmentCard/AssignmentCard.tsx +2 -2
  49. package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +17 -29
  50. package/lib/infra/Containers/FlowContainer/helpers.ts +1 -5
  51. package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +10 -5
  52. package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +9 -9
  53. package/lib/infra/Containers/SimpleView/helper.ts +1 -1
  54. package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +2 -2
  55. package/lib/infra/DashboardFilter/DashboardFilter.tsx +6 -8
  56. package/lib/infra/DashboardFilter/filterUtils.tsx +3 -4
  57. package/lib/infra/DeferLoad/DeferLoad.tsx +9 -9
  58. package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +1 -1
  59. package/lib/infra/MultiStep/MultiStep.tsx +17 -16
  60. package/lib/infra/NavBar/NavBar.css +1 -0
  61. package/lib/infra/NavBar/NavBar.tsx +49 -38
  62. package/lib/infra/Reference/Reference.tsx +1 -1
  63. package/lib/infra/Region/Region.tsx +1 -1
  64. package/lib/infra/RootContainer/RootContainer.tsx +7 -8
  65. package/lib/infra/Stages/Stages.tsx +5 -5
  66. package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +4 -3
  67. package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +2 -2
  68. package/lib/infra/View/View.tsx +38 -4
  69. package/lib/template/AdvancedSearch/AdvancedSearch.tsx +87 -0
  70. package/lib/template/AdvancedSearch/SearchGroup/persistUtils.ts +58 -0
  71. package/lib/template/AdvancedSearch/SearchGroups/SearchGroups.tsx +245 -0
  72. package/lib/template/AdvancedSearch/SearchGroups/hooks.ts +37 -0
  73. package/lib/template/AdvancedSearch/SearchGroups/index.tsx +1 -0
  74. package/lib/template/AdvancedSearch/SearchGroups/utils.ts +29 -0
  75. package/lib/template/AdvancedSearch/TemplateContext.ts +11 -0
  76. package/lib/template/AdvancedSearch/config-ext.json +9 -0
  77. package/lib/template/AdvancedSearch/index.tsx +1 -0
  78. package/lib/template/AppShell/AppShell.tsx +62 -12
  79. package/lib/template/BannerPage/BannerPage.tsx +2 -2
  80. package/lib/template/BannerPage/config-ext.json +9 -0
  81. package/lib/template/CaseSummary/CaseSummary.tsx +2 -2
  82. package/lib/template/CaseView/CaseView.tsx +12 -11
  83. package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +8 -8
  84. package/lib/template/Confirmation/Confirmation.tsx +5 -4
  85. package/lib/template/DataReference/DataReference.tsx +318 -108
  86. package/lib/template/DataReference/DataReferenceAdvancedSearchContext.js +10 -0
  87. package/lib/template/DataReference/SearchForm.tsx +148 -0
  88. package/lib/template/DataReference/utils.js +90 -0
  89. package/lib/template/DefaultForm/DefaultForm.tsx +2 -2
  90. package/lib/template/DefaultForm/utils/index.ts +1 -3
  91. package/lib/template/Details/Details/Details.tsx +3 -3
  92. package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +5 -5
  93. package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +3 -3
  94. package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +3 -3
  95. package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +5 -5
  96. package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +11 -6
  97. package/lib/template/InlineDashboard/InlineDashboard.tsx +4 -4
  98. package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +2 -2
  99. package/lib/template/InlineDashboardPage/config-ext.json +9 -0
  100. package/lib/template/ListPage/ListPage.tsx +1 -1
  101. package/lib/template/ListView/ListView.tsx +201 -95
  102. package/lib/template/ListView/utils.ts +38 -6
  103. package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +1 -1
  104. package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +2 -2
  105. package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +3 -3
  106. package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +2 -2
  107. package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +2 -2
  108. package/lib/template/OneColumn/OneColumn/OneColumn.tsx +4 -4
  109. package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +1 -1
  110. package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +2 -2
  111. package/lib/template/PromotedFilters/PromotedFilters.tsx +2 -3
  112. package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +1 -3
  113. package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +112 -88
  114. package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +3 -5
  115. package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +1 -1
  116. package/lib/template/SubTabs/SubTabs.tsx +4 -4
  117. package/lib/template/SubTabs/tabUtils.ts +118 -1
  118. package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +10 -10
  119. package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +1 -1
  120. package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +10 -10
  121. package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +2 -2
  122. package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +3 -3
  123. package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +2 -2
  124. package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +2 -2
  125. package/lib/template/WssNavBar/WssNavBar.tsx +10 -10
  126. package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +3 -3
  127. package/lib/widget/Attachment/Attachment.css +1 -0
  128. package/lib/widget/Attachment/Attachment.tsx +8 -10
  129. package/lib/widget/CaseHistory/CaseHistory.tsx +13 -11
  130. package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +2 -2
  131. package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +6 -5
  132. package/lib/widget/Followers/Followers.tsx +4 -4
  133. package/lib/widget/QuickCreate/QuickCreate.tsx +1 -2
  134. package/lib/widget/QuickCreate/config-ext.json +9 -0
  135. package/lib/widget/SummaryItem/SummaryItem.tsx +5 -4
  136. package/lib/widget/SummaryList/SummaryList.tsx +1 -1
  137. package/lib/widget/ToDo/ToDo.tsx +102 -40
  138. package/package.json +1 -1
  139. /package/lib/infra/Containers/{helpers.ts → container-helpers.ts} +0 -0
@@ -1,8 +1,8 @@
1
- import { TextField } from '@material-ui/core';
1
+ import { useEffect, useState } from 'react';
2
2
  import { NumericFormat } from 'react-number-format';
3
- import { useState } from 'react';
3
+ import { TextField } from '@mui/material';
4
4
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
5
- import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
+ import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
6
6
  import { getCurrencyCharacters, getCurrencyOptions } from '@pega/react-sdk-components/lib/components/field/Currency/currency-utils';
7
7
  import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
8
8
  import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
@@ -50,7 +50,11 @@ export default function Percentage(props: PercentageProps) {
50
50
  const helperTextToDisplay = validatemessage || helperText;
51
51
 
52
52
  const theCurrencyOptions = getCurrencyOptions(currencyISOCode);
53
- const formattedValue = format(value, pConn.getComponentName().toLowerCase(), theCurrencyOptions);
53
+ const formattedValue = format(value, pConn.getComponentName()?.toLowerCase(), theCurrencyOptions);
54
+
55
+ useEffect(() => {
56
+ setValues(value.toString());
57
+ }, [value]);
54
58
 
55
59
  let readOnlyProp = {}; // Note: empty if NOT ReadOnly
56
60
 
@@ -58,7 +62,7 @@ export default function Percentage(props: PercentageProps) {
58
62
  readOnlyProp = { readOnly: true };
59
63
  }
60
64
 
61
- if (displayMode === 'LABELS_LEFT') {
65
+ if (displayMode === 'DISPLAY_ONLY') {
62
66
  return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} />;
63
67
  }
64
68
 
@@ -66,11 +70,7 @@ export default function Percentage(props: PercentageProps) {
66
70
  return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} variant='stacked' />;
67
71
  }
68
72
 
69
- let testProp = {};
70
-
71
- testProp = {
72
- 'data-test-id': testId
73
- };
73
+ const testProps: any = { 'data-test-id': testId };
74
74
 
75
75
  const theSymbols = getCurrencyCharacters(currencyISOCode);
76
76
  const theCurrDec = theSymbols.theDecimalIndicator;
@@ -105,7 +105,7 @@ export default function Percentage(props: PercentageProps) {
105
105
  thousandSeparator={showGroupSeparators ? theCurrSep : ''}
106
106
  decimalScale={decimalPrecision}
107
107
  suffix='%'
108
- InputProps={{ ...readOnlyProp, inputProps: { ...testProp } }}
108
+ slotProps={{ input: { ...readOnlyProp, inputProps: { ...testProps } } }}
109
109
  customInput={TextField}
110
110
  />
111
111
  );
@@ -1,8 +1,8 @@
1
- import MuiPhoneNumber from 'material-ui-phone-number';
2
1
  import { useEffect, useState } from 'react';
2
+ import { MuiTelInput } from 'mui-tel-input';
3
3
 
4
4
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
5
- import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
+ import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
6
6
  import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
7
7
 
8
8
  interface PhoneProps extends PConnFieldProps {
@@ -45,7 +45,7 @@ export default function Phone(props: PhoneProps) {
45
45
  'data-test-id': testId
46
46
  };
47
47
 
48
- if (displayMode === 'LABELS_LEFT') {
48
+ if (displayMode === 'DISPLAY_ONLY') {
49
49
  return <FieldValueList name={hideLabel ? '' : label} value={value} />;
50
50
  }
51
51
 
@@ -57,20 +57,23 @@ export default function Phone(props: PhoneProps) {
57
57
  const disableDropdown = true;
58
58
  return (
59
59
  <div>
60
- <MuiPhoneNumber
60
+ <MuiTelInput
61
61
  fullWidth
62
62
  helperText={helperTextToDisplay}
63
63
  placeholder={placeholder ?? ''}
64
64
  size='small'
65
+ defaultCountry='US'
65
66
  required={required}
66
67
  disabled={disabled}
67
68
  onChange={onChange}
68
69
  error={status === 'error'}
69
70
  label={label}
70
71
  value={value}
71
- InputProps={{
72
- readOnly: true,
73
- inputProps: { ...testProp }
72
+ slotProps={{
73
+ input: {
74
+ readOnly: true,
75
+ ...testProp
76
+ }
74
77
  }}
75
78
  disableDropdown={disableDropdown}
76
79
  />
@@ -90,13 +93,13 @@ export default function Phone(props: PhoneProps) {
90
93
  };
91
94
 
92
95
  return (
93
- <MuiPhoneNumber
96
+ <MuiTelInput
94
97
  fullWidth
95
98
  variant='outlined'
96
99
  helperText={helperTextToDisplay}
97
100
  placeholder={placeholder ?? ''}
98
101
  size='small'
99
- defaultCountry='us'
102
+ defaultCountry='US'
100
103
  required={required}
101
104
  disabled={disabled}
102
105
  onChange={handleChange}
@@ -104,7 +107,7 @@ export default function Phone(props: PhoneProps) {
104
107
  error={status === 'error'}
105
108
  label={label}
106
109
  value={inputValue}
107
- InputProps={{ ...testProp }}
110
+ slotProps={{ input: { ...testProp } }}
108
111
  />
109
112
  );
110
113
  }
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "Phone",
3
+ "label": "Phone",
4
+ "description": "Phone",
5
+ "type": "Field",
6
+ "subtype": "DATA_CAPTURE",
7
+ "properties": []
8
+ }
@@ -1,10 +1,10 @@
1
1
  import { useState, useEffect } from 'react';
2
- import { Radio, RadioGroup, FormControl, FormControlLabel, FormLabel, FormHelperText } from '@material-ui/core';
2
+ import { Radio, RadioGroup, FormControl, FormControlLabel, FormLabel, FormHelperText } from '@mui/material';
3
3
 
4
4
  import Utils from '@pega/react-sdk-components/lib/components/helpers/utils';
5
5
  import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
6
6
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
7
- import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
7
+ import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
8
8
 
9
9
  // Can't use RadioButtonProps until getLocaleRuleNameFromKeys is NOT private
10
10
  interface RadioButtonsProps extends PConnFieldProps {
@@ -61,11 +61,10 @@ export default function RadioButtons(props: RadioButtonsProps) {
61
61
  setSelectedButton(value);
62
62
  }, [value]);
63
63
 
64
- if (displayMode === 'LABELS_LEFT') {
64
+ if (displayMode === 'DISPLAY_ONLY') {
65
65
  return (
66
66
  <FieldValueList
67
67
  name={hideLabel ? '' : label}
68
- // @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv'
69
68
  value={thePConn.getLocalizedValue(value, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))}
70
69
  />
71
70
  );
@@ -75,7 +74,6 @@ export default function RadioButtons(props: RadioButtonsProps) {
75
74
  return (
76
75
  <FieldValueList
77
76
  name={hideLabel ? '' : label}
78
- // @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv'
79
77
  value={thePConn.getLocalizedValue(value, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))}
80
78
  variant='stacked'
81
79
  />
@@ -91,7 +89,7 @@ export default function RadioButtons(props: RadioButtonsProps) {
91
89
  };
92
90
 
93
91
  return (
94
- <FormControl error={status === 'error'} required={required}>
92
+ <FormControl variant='standard' error={status === 'error'} required={required}>
95
93
  <FormLabel component='legend'>{label}</FormLabel>
96
94
  <RadioGroup value={theSelectedButton} onChange={handleChange} onBlur={!readOnly ? handleBlur : undefined} row={inline}>
97
95
  {theOptions.map(theOption => {
@@ -102,7 +100,6 @@ export default function RadioButtons(props: RadioButtonsProps) {
102
100
  label={thePConn.getLocalizedValue(
103
101
  theOption.value,
104
102
  localePath,
105
- // @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv'
106
103
  thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)
107
104
  )}
108
105
  control={<Radio key={theOption.key} color='primary' disabled={readOnly} />}
@@ -2,7 +2,7 @@ import { useRef } from 'react';
2
2
 
3
3
  import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
4
4
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
5
- import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
+ import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
6
6
 
7
7
  interface RichTextProps extends PConnFieldProps {
8
8
  // If any, enter additional props that only exist on TextArea here
@@ -23,7 +23,7 @@ export default function RichText(props: RichTextProps) {
23
23
 
24
24
  const helperTextToDisplay = validatemessage || helperText;
25
25
 
26
- if (displayMode === 'LABELS_LEFT') {
26
+ if (displayMode === 'DISPLAY_ONLY') {
27
27
  return <FieldValueList name={hideLabel ? '' : label} value={value} isHtml />;
28
28
  }
29
29
 
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "RichText",
3
+ "label": "Rich text editor",
4
+ "description": "Text (paragraph)",
5
+ "type": "Field",
6
+ "subtype": "Text-Paragraph",
7
+ "icon": "images/pz-text-area-active.svg",
8
+ "properties": [],
9
+ "defaultConfig": {}
10
+ }
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable react/no-array-index-key */
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
  // ScalarListProps can't extend PConnFieldProps because its 'value' has a different type
6
6
  interface ScalarListProps extends PConnProps {
@@ -36,22 +36,21 @@ export default function ScalarList(props: ScalarListProps) {
36
36
  {
37
37
  type: componentType,
38
38
  config: {
39
- // @ts-ignore - Type '{ readOnly: true; displayInModal: boolean; value: any; displayMode: string; label: string; }' is not assignable to type 'ComponentMetadataConfig'.
40
39
  value: scalarValue,
41
- displayMode: 'LABELS_LEFT',
40
+ displayMode: 'DISPLAY_ONLY',
42
41
  label,
43
42
  ...restProps,
44
- // @ts-ignore - Type 'string' is not assignable to type 'boolean | undefined'.
45
43
  readOnly: 'true'
46
44
  }
47
45
  },
48
46
  '',
47
+ // @ts-ignore
49
48
  '',
50
49
  {}
51
50
  ); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional;
52
51
  });
53
52
 
54
- if (['LABELS_LEFT', 'STACKED_LARGE_VAL', 'DISPLAY_ONLY'].includes(displayMode)) {
53
+ if (['STACKED_LARGE_VAL', 'DISPLAY_ONLY'].includes(displayMode)) {
55
54
  return (
56
55
  <div>
57
56
  <CommaSeparatedList items={items} />
@@ -1,9 +1,9 @@
1
- import Typography from '@material-ui/core/Typography';
2
- import Grid from '@material-ui/core/Grid';
3
- import { makeStyles } from '@material-ui/core/styles';
1
+ import Typography from '@mui/material/Typography';
2
+ import Grid from '@mui/material/Grid';
3
+ import makeStyles from '@mui/styles/makeStyles';
4
4
 
5
5
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
6
- import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
6
+ import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
7
7
 
8
8
  /* although this is called the SemanticLink component, we are not yet displaying as a
9
9
  SemanticLink in SDK and only showing the value as a read only text field. */
@@ -52,7 +52,7 @@ export default function SemanticLink(props: SemanticLinkProps) {
52
52
  const { text, displayMode, label, hideLabel } = props;
53
53
  const classes = useStyles();
54
54
 
55
- if (displayMode === 'LABELS_LEFT' || (!displayMode && label !== undefined)) {
55
+ if (displayMode === 'DISPLAY_ONLY' || (!displayMode && label !== undefined)) {
56
56
  const value = text || '---';
57
57
  return (
58
58
  <Grid container spacing={1} style={{ padding: '4px 0px' }} id='semantic-link-grid'>
@@ -1,7 +1,9 @@
1
- import { TextField } from '@material-ui/core';
1
+ import { useEffect, useState } from 'react';
2
+ import { TextField } from '@mui/material';
2
3
 
4
+ import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
3
5
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
4
- import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
6
+ import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
7
 
6
8
  interface TextAreaProps extends PConnFieldProps {
7
9
  // If any, enter additional props that only exist on TextArea here
@@ -13,14 +15,13 @@ export default function TextArea(props: TextAreaProps) {
13
15
  const FieldValueList = getComponentFromMap('FieldValueList');
14
16
 
15
17
  const {
18
+ getPConnect,
16
19
  label,
17
20
  required,
18
21
  disabled,
19
22
  value = '',
20
23
  validatemessage,
21
24
  status,
22
- onChange,
23
- onBlur,
24
25
  readOnly,
25
26
  testId,
26
27
  fieldMetadata,
@@ -30,12 +31,20 @@ export default function TextArea(props: TextAreaProps) {
30
31
  placeholder
31
32
  } = props;
32
33
  const helperTextToDisplay = validatemessage || helperText;
33
-
34
+ const pConn = getPConnect();
35
+ const actions = pConn.getActionsApi();
36
+ const propName = (pConn.getStateProps() as any).value;
34
37
  const maxLength = fieldMetadata?.maxLength;
35
38
 
39
+ const [inputValue, setInputValue] = useState('');
40
+
36
41
  let readOnlyProp = {};
37
42
 
38
- if (displayMode === 'LABELS_LEFT') {
43
+ useEffect(() => {
44
+ setInputValue(value);
45
+ }, [value]);
46
+
47
+ if (displayMode === 'DISPLAY_ONLY') {
39
48
  return <FieldValueList name={hideLabel ? '' : label} value={value} />;
40
49
  }
41
50
 
@@ -49,11 +58,16 @@ export default function TextArea(props: TextAreaProps) {
49
58
  readOnlyProp = { readOnly: true };
50
59
  }
51
60
 
52
- let testProp = {};
61
+ const testProps: any = { 'data-test-id': testId };
53
62
 
54
- testProp = {
55
- 'data-test-id': testId
56
- };
63
+ function handleChange(event) {
64
+ // update internal value
65
+ setInputValue(event?.target?.value);
66
+ }
67
+
68
+ function handleBlur() {
69
+ handleEvent(actions, 'changeNblur', propName, inputValue);
70
+ }
57
71
 
58
72
  return (
59
73
  <TextField
@@ -67,12 +81,14 @@ export default function TextArea(props: TextAreaProps) {
67
81
  size='small'
68
82
  required={required}
69
83
  disabled={disabled}
70
- onChange={onChange}
71
- onBlur={!readOnly ? onBlur : undefined}
84
+ onChange={handleChange}
85
+ onBlur={!readOnly ? handleBlur : undefined}
72
86
  error={status === 'error'}
73
87
  label={label}
74
- value={value}
75
- InputProps={{ ...readOnlyProp, inputProps: { maxLength, ...testProp } }}
88
+ value={inputValue}
89
+ slotProps={{
90
+ input: { ...readOnlyProp, inputProps: { maxLength, ...testProps } }
91
+ }}
76
92
  />
77
93
  );
78
94
  }
@@ -1,6 +1,6 @@
1
- import { Typography } from '@material-ui/core';
1
+ import { Typography } from '@mui/material';
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 TextContentProps extends PConnProps {
6
6
  // If any, enter additional props that only exist on TextContent here
@@ -1,9 +1,9 @@
1
1
  import { useState, useEffect } from 'react';
2
- import { TextField } from '@material-ui/core';
2
+ import { TextField } from '@mui/material';
3
3
 
4
4
  import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
5
5
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
6
- import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
6
+ import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
7
7
 
8
8
  interface TextInputProps extends PConnFieldProps {
9
9
  // If any, enter additional props that only exist on TextInput here
@@ -47,7 +47,7 @@ export default function TextInput(props: TextInputProps) {
47
47
  setInputValue(value);
48
48
  }, [value]);
49
49
 
50
- if (displayMode === 'LABELS_LEFT') {
50
+ if (displayMode === 'DISPLAY_ONLY') {
51
51
  return <FieldValueList name={hideLabel ? '' : label} value={value} />;
52
52
  }
53
53
 
@@ -59,11 +59,7 @@ export default function TextInput(props: TextInputProps) {
59
59
  readOnlyProp = { readOnly: true };
60
60
  }
61
61
 
62
- let testProp = {};
63
-
64
- testProp = {
65
- 'data-test-id': testId
66
- };
62
+ const testProps: any = { 'data-test-id': testId };
67
63
 
68
64
  function handleChange(event) {
69
65
  // update internal value
@@ -88,7 +84,9 @@ export default function TextInput(props: TextInputProps) {
88
84
  error={status === 'error'}
89
85
  label={label}
90
86
  value={inputValue}
91
- InputProps={{ ...readOnlyProp, inputProps: { maxLength, ...testProp } }}
87
+ slotProps={{
88
+ input: { ...readOnlyProp, inputProps: { maxLength, ...testProps } }
89
+ }}
92
90
  />
93
91
  );
94
92
  }
@@ -1,9 +1,10 @@
1
- import { KeyboardTimePicker } from '@material-ui/pickers';
2
- import AccessTimeIcon from '@material-ui/icons/AccessTime';
1
+ import { TimePicker } from '@mui/x-date-pickers/TimePicker';
2
+ // import AccessTimeIcon from '@mui/icons-material/AccessTime';
3
3
  import dayjs from 'dayjs';
4
4
 
5
+ import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
5
6
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
6
- import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
7
+ import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
7
8
 
8
9
  interface TimeProps extends PConnFieldProps {
9
10
  // If any, enter additional props that only exist on Time here
@@ -14,10 +15,12 @@ export default function Time(props: TimeProps) {
14
15
  const FieldValueList = getComponentFromMap('FieldValueList');
15
16
  const TextInput = getComponentFromMap('TextInput');
16
17
 
17
- const { label, required, disabled, value = '', validatemessage, status, onChange, readOnly, helperText, displayMode, hideLabel, testId } = props;
18
+ const { getPConnect, label, required, disabled, value = '', validatemessage, status, readOnly, helperText, displayMode, hideLabel, testId } = props;
18
19
  const helperTextToDisplay = validatemessage || helperText;
19
-
20
- if (displayMode === 'LABELS_LEFT') {
20
+ const pConn = getPConnect();
21
+ const actions = pConn.getActionsApi();
22
+ const propName = (pConn.getStateProps() as any).value;
23
+ if (displayMode === 'DISPLAY_ONLY') {
21
24
  return <FieldValueList name={hideLabel ? '' : label} value={value} />;
22
25
  }
23
26
 
@@ -29,19 +32,15 @@ export default function Time(props: TimeProps) {
29
32
  return <TextInput {...props} />;
30
33
  }
31
34
 
32
- let testProp = {};
33
-
34
- testProp = {
35
- 'data-test-id': testId
36
- };
35
+ const testProps: any = { 'data-test-id': testId };
37
36
 
38
37
  const handleChange = date => {
39
- const theValue = date && date.isValid() ? date.format('HH:mm') : null;
40
- onChange({ value: theValue });
38
+ const theValue = date && date.isValid() ? date.format('HH:mm:ss') : null;
39
+ handleEvent(actions, 'changeNblur', propName, theValue);
41
40
  };
42
41
 
43
42
  let timeValue: any = null;
44
- if (value) {
43
+ if (value && Object.keys(value).length) {
45
44
  const timeArray = value.split(':').map(itm => Number(itm));
46
45
  timeValue = dayjs().hour(timeArray[0]).minute(timeArray[1]);
47
46
  }
@@ -52,25 +51,29 @@ export default function Time(props: TimeProps) {
52
51
  //
53
52
 
54
53
  return (
55
- <KeyboardTimePicker
56
- variant='inline'
57
- inputVariant='outlined'
58
- placeholder='hh:mm am'
59
- keyboardIcon={<AccessTimeIcon />}
60
- fullWidth
61
- required={required}
54
+ <TimePicker
55
+ // keyboardIcon={<AccessTimeIcon />}
56
+ // fullWidth
57
+
62
58
  disabled={disabled}
63
- error={status === 'error'}
64
- helperText={helperTextToDisplay}
65
59
  minutesStep={5}
66
- size='small'
67
60
  label={label}
68
- autoOk
69
- mask='__:__ _m'
61
+ // autoOk
62
+ // mask='__:__ _m'
70
63
  format='hh:mm a'
71
64
  value={timeValue}
72
65
  onChange={handleChange}
73
- InputProps={{ inputProps: { ...testProp } }}
66
+ slotProps={{
67
+ textField: {
68
+ variant: 'outlined',
69
+ placeholder: 'hh:mm am',
70
+ required,
71
+ error: status === 'error',
72
+ helperText: helperTextToDisplay,
73
+ size: 'small',
74
+ InputProps: { ...testProps }
75
+ }
76
+ }}
74
77
  />
75
78
  );
76
79
  }
@@ -1,7 +1,9 @@
1
- import { TextField } from '@material-ui/core';
1
+ import { useEffect, useState } from 'react';
2
+ import { TextField } from '@mui/material';
2
3
 
4
+ import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
3
5
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
4
- import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
6
+ import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
7
 
6
8
  interface URLComponentProps extends PConnFieldProps {
7
9
  // If any, enter additional props that only exist on URLComponent here
@@ -16,14 +18,13 @@ export default function URLComponent(props: URLComponentProps) {
16
18
  const TextInput = getComponentFromMap('TextInput');
17
19
 
18
20
  const {
21
+ getPConnect,
19
22
  label,
20
23
  required,
21
24
  disabled,
22
25
  value = '',
23
26
  validatemessage,
24
27
  status,
25
- onChange,
26
- onBlur,
27
28
  readOnly,
28
29
  testId,
29
30
  helperText,
@@ -33,7 +34,17 @@ export default function URLComponent(props: URLComponentProps) {
33
34
  } = props;
34
35
  const helperTextToDisplay = validatemessage || helperText;
35
36
 
36
- if (displayMode === 'LABELS_LEFT') {
37
+ const [inputValue, setInputValue] = useState('');
38
+
39
+ const pConn = getPConnect();
40
+ const actions = pConn.getActionsApi();
41
+ const propName = (pConn.getStateProps() as any).value;
42
+
43
+ useEffect(() => {
44
+ setInputValue(value);
45
+ }, [value]);
46
+
47
+ if (displayMode === 'DISPLAY_ONLY') {
37
48
  return <FieldValueList name={hideLabel ? '' : label} value={value} />;
38
49
  }
39
50
 
@@ -45,12 +56,16 @@ export default function URLComponent(props: URLComponentProps) {
45
56
  return <TextInput {...props} />;
46
57
  }
47
58
 
48
- let testProp = {};
59
+ const testProps: any = { 'data-test-id': testId };
49
60
 
50
- testProp = {
51
- 'data-test-id': testId
61
+ const handleChange = event => {
62
+ setInputValue(event?.target?.value);
52
63
  };
53
64
 
65
+ function handleBlur() {
66
+ handleEvent(actions, 'changeNblur', propName, inputValue);
67
+ }
68
+
54
69
  return (
55
70
  <TextField
56
71
  type='url'
@@ -61,12 +76,14 @@ export default function URLComponent(props: URLComponentProps) {
61
76
  size='small'
62
77
  required={required}
63
78
  disabled={disabled}
64
- onChange={onChange}
65
- onBlur={!readOnly ? onBlur : undefined}
79
+ onChange={handleChange}
80
+ onBlur={!readOnly ? handleBlur : undefined}
66
81
  error={status === 'error'}
67
82
  label={label}
68
- value={value}
69
- InputProps={{ inputProps: { ...testProp } }}
83
+ value={inputValue}
84
+ slotProps={{
85
+ input: { inputProps: { ...testProps } }
86
+ }}
70
87
  />
71
88
  );
72
89
  }
@@ -1,8 +1,8 @@
1
1
  import { memo, useEffect, useState } from 'react';
2
- import { Typography } from '@material-ui/core';
2
+ import { Typography } from '@mui/material';
3
3
 
4
4
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
5
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
6
6
 
7
7
  import FieldValueList from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldValueList';
8
8
  import { getUserId, isUserNameAvailable } from './UserReferenceUtils';
@@ -80,10 +80,8 @@ const UserReference = (props: UserReferenceProps) => {
80
80
  };
81
81
 
82
82
  PCore.getRestClient()
83
- // @ts-ignore - Argument of type '{ queryPayload: { dataViewName: string; }; }' is not assignable to parameter of type 'RestApiOptionsObject'
84
- // @ts-ignore - Expected 3 arguments, but got 2
85
83
  .invokeRestApi('getListData', { queryPayload })
86
- .then((res: any) => {
84
+ .then(res => {
87
85
  const ddDataSource = res.data.data.map(listItem => ({
88
86
  key: listItem.pyUserIdentifier,
89
87
  value: listItem.pyUserName
@@ -99,7 +97,7 @@ const UserReference = (props: UserReferenceProps) => {
99
97
 
100
98
  let userReferenceComponent: any = null;
101
99
 
102
- if (displayMode === 'LABELS_LEFT') {
100
+ if (displayMode === 'DISPLAY_ONLY') {
103
101
  return <FieldValueList name={hideLabel ? '' : label} value={userName || ''} />;
104
102
  }
105
103
 
@@ -1,4 +1,27 @@
1
- /* eslint-disable import/prefer-default-export */
2
1
  export function isEmptyObject(obj: Object): boolean {
3
2
  return Object.keys(obj).length === 0;
4
3
  }
4
+
5
+ /**
6
+ * Get a localized value from the Generic Fields
7
+ * @param path - The path within Generic Fields (e.g., 'CosmosFields.fields.lists')
8
+ * @param key - The key of the string to localize
9
+ * @returns The localized string or the key itself if no translation is found
10
+ */
11
+ export function getGenericFieldsLocalizedValue(path: string, key: string): string {
12
+ const GENERIC_BUNDLE_KEY = PCore.getLocaleUtils().GENERIC_BUNDLE_KEY;
13
+ const localeStore = PCore.getLocaleUtils().localeStore[GENERIC_BUNDLE_KEY];
14
+
15
+ if (!localeStore) return key;
16
+
17
+ // Split the path and traverse the object
18
+ const pathParts = path.split('.');
19
+ let currentObj = localeStore;
20
+
21
+ for (const part of pathParts) {
22
+ if (!currentObj[part]) return key;
23
+ currentObj = currentObj[part];
24
+ }
25
+
26
+ return currentObj[key] || key;
27
+ }