@pega/react-sdk-overrides 24.1.10 → 24.2.11

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 (103) 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 -1
  4. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +11 -2
  5. package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +4 -4
  6. package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +4 -4
  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 +6 -5
  10. package/lib/designSystemExtension/Pulse/Pulse.tsx +2 -2
  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 +4 -4
  14. package/lib/field/CancelAlert/CancelAlert.tsx +4 -7
  15. package/lib/field/Checkbox/Checkbox.tsx +4 -4
  16. package/lib/field/Currency/Currency.tsx +10 -7
  17. package/lib/field/Date/Date.tsx +27 -42
  18. package/lib/field/DateTime/DateTime.tsx +39 -36
  19. package/lib/field/Decimal/Decimal.tsx +9 -4
  20. package/lib/field/Dropdown/Dropdown.tsx +29 -22
  21. package/lib/field/Email/Email.tsx +29 -8
  22. package/lib/field/Group/Group.tsx +2 -2
  23. package/lib/field/Integer/Integer.tsx +22 -8
  24. package/lib/field/Multiselect/Multiselect.tsx +8 -14
  25. package/lib/field/Percentage/Percentage.tsx +8 -4
  26. package/lib/field/Phone/Phone.tsx +6 -5
  27. package/lib/field/Phone/config-ext.json +8 -0
  28. package/lib/field/RadioButtons/RadioButtons.tsx +3 -6
  29. package/lib/field/RichText/RichText.tsx +1 -1
  30. package/lib/field/RichText/config-ext.json +10 -0
  31. package/lib/field/ScalarList/ScalarList.tsx +3 -4
  32. package/lib/field/SemanticLink/SemanticLink.tsx +4 -4
  33. package/lib/field/TextArea/TextArea.tsx +26 -8
  34. package/lib/field/TextContent/TextContent.tsx +1 -1
  35. package/lib/field/TextInput/TextInput.tsx +2 -2
  36. package/lib/field/Time/Time.tsx +28 -21
  37. package/lib/field/URL/URL.tsx +26 -7
  38. package/lib/field/UserReference/UserReference.tsx +3 -5
  39. package/lib/helpers/common-utils.ts +24 -1
  40. package/lib/helpers/field-group-utils.ts +2 -2
  41. package/lib/helpers/formatters/Currency.ts +11 -16
  42. package/lib/helpers/formatters/common.ts +2 -1
  43. package/lib/helpers/formatters/index.ts +2 -4
  44. package/lib/helpers/simpleTableHelpers.ts +1 -1
  45. package/lib/infra/ActionButtons/ActionButtons.tsx +3 -3
  46. package/lib/infra/Assignment/Assignment.tsx +12 -12
  47. package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +16 -28
  48. package/lib/infra/Containers/FlowContainer/helpers.ts +1 -5
  49. package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +9 -4
  50. package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +8 -8
  51. package/lib/infra/Containers/SimpleView/helper.ts +1 -1
  52. package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +1 -1
  53. package/lib/infra/DashboardFilter/DashboardFilter.tsx +3 -4
  54. package/lib/infra/DashboardFilter/filterUtils.tsx +3 -4
  55. package/lib/infra/DeferLoad/DeferLoad.tsx +8 -8
  56. package/lib/infra/MultiStep/MultiStep.tsx +15 -14
  57. package/lib/infra/NavBar/NavBar.css +1 -0
  58. package/lib/infra/NavBar/NavBar.tsx +25 -17
  59. package/lib/infra/RootContainer/RootContainer.tsx +5 -6
  60. package/lib/infra/Stages/Stages.tsx +4 -4
  61. package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +4 -3
  62. package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +2 -2
  63. package/lib/infra/View/View.tsx +37 -3
  64. package/lib/template/AppShell/AppShell.tsx +60 -10
  65. package/lib/template/BannerPage/config-ext.json +9 -0
  66. package/lib/template/CaseView/CaseView.tsx +10 -9
  67. package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +7 -7
  68. package/lib/template/Confirmation/Confirmation.tsx +3 -2
  69. package/lib/template/DataReference/DataReference.tsx +2 -2
  70. package/lib/template/Details/Details/Details.tsx +2 -2
  71. package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +3 -3
  72. package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +2 -2
  73. package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +2 -2
  74. package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +4 -4
  75. package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +10 -5
  76. package/lib/template/InlineDashboard/InlineDashboard.tsx +2 -2
  77. package/lib/template/InlineDashboardPage/config-ext.json +9 -0
  78. package/lib/template/ListView/ListView.tsx +79 -70
  79. package/lib/template/ListView/utils.ts +1 -2
  80. package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +2 -2
  81. package/lib/template/OneColumn/OneColumn/OneColumn.tsx +2 -2
  82. package/lib/template/PromotedFilters/PromotedFilters.tsx +1 -2
  83. package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +0 -2
  84. package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +110 -86
  85. package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +2 -4
  86. package/lib/template/SubTabs/SubTabs.tsx +2 -2
  87. package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +2 -2
  88. package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +2 -2
  89. package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +2 -2
  90. package/lib/template/WssNavBar/WssNavBar.tsx +9 -9
  91. package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +2 -2
  92. package/lib/widget/Attachment/Attachment.css +1 -0
  93. package/lib/widget/Attachment/Attachment.tsx +7 -9
  94. package/lib/widget/CaseHistory/CaseHistory.tsx +12 -10
  95. package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +1 -1
  96. package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +5 -4
  97. package/lib/widget/Followers/Followers.tsx +2 -2
  98. package/lib/widget/QuickCreate/QuickCreate.tsx +0 -1
  99. package/lib/widget/QuickCreate/config-ext.json +9 -0
  100. package/lib/widget/SummaryItem/SummaryItem.tsx +4 -3
  101. package/lib/widget/ToDo/ToDo.tsx +92 -22
  102. package/package.json +1 -1
  103. /package/lib/infra/Containers/{helpers.ts → container-helpers.ts} +0 -0
@@ -1,6 +1,6 @@
1
- import { TextField } from '@material-ui/core';
2
1
  import { NumericFormat } from 'react-number-format';
3
- import { useState } from 'react';
2
+ import { TextField } from '@mui/material';
3
+ import { useEffect, useState } from 'react';
4
4
  import { getCurrencyCharacters, getCurrencyOptions } from '@pega/react-sdk-components/lib/components/field/Currency/currency-utils';
5
5
  import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
6
6
  import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
@@ -58,6 +58,10 @@ export default function Decimal(props: DecimalProps) {
58
58
 
59
59
  const theCurrencyOptions = getCurrencyOptions(currencyISOCode);
60
60
 
61
+ useEffect(() => {
62
+ setValues(value.toString());
63
+ }, [value]);
64
+
61
65
  let readOnlyProp = {}; // Note: empty if NOT ReadOnly
62
66
 
63
67
  if (readOnly) {
@@ -68,10 +72,10 @@ export default function Decimal(props: DecimalProps) {
68
72
  if (formatter === 'Currency') {
69
73
  formattedValue = format(value, formatter.toLowerCase(), theCurrencyOptions);
70
74
  } else {
71
- formattedValue = format(value, pConn.getComponentName().toLowerCase(), theCurrencyOptions);
75
+ formattedValue = format(value, pConn.getComponentName()?.toLowerCase(), theCurrencyOptions);
72
76
  }
73
77
 
74
- if (displayMode === 'LABELS_LEFT') {
78
+ if (displayMode === 'DISPLAY_ONLY') {
75
79
  return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} />;
76
80
  }
77
81
 
@@ -109,6 +113,7 @@ export default function Decimal(props: DecimalProps) {
109
113
  }}
110
114
  onBlur={!readOnly ? decimalOnBlur : undefined}
111
115
  prefix={readOnly && formatter === 'Currency' ? theCurrSym : ''}
116
+ suffix={readOnly && formatter === 'Percentage' ? '%' : ''}
112
117
  decimalSeparator={theCurrDec}
113
118
  thousandSeparator={showGroupSeparators ? theCurrSep : ''}
114
119
  decimalScale={readOnly && formatter === 'Currency' ? undefined : decimalPrecision}
@@ -1,6 +1,6 @@
1
1
  import { useEffect, useState } from 'react';
2
- import { TextField } from '@material-ui/core';
3
- import MenuItem from '@material-ui/core/MenuItem';
2
+ import { TextField } from '@mui/material';
3
+ import MenuItem from '@mui/material/MenuItem';
4
4
  import isDeepEqual from 'fast-deep-equal/react';
5
5
  import Utils from '@pega/react-sdk-components/lib/components/helpers/utils';
6
6
  import { getDataPage } from '@pega/react-sdk-components/lib/components/helpers/data_page';
@@ -137,7 +137,7 @@ export default function Dropdown(props: DropdownProps) {
137
137
  }, [theDatasource]);
138
138
 
139
139
  useEffect(() => {
140
- if (!displayMode && listType !== 'associated' && typeof datasource === 'string') {
140
+ if (listType !== 'associated' && typeof datasource === 'string') {
141
141
  getDataPage(datasource, parameters, context).then((results: any) => {
142
142
  const optionsData: any[] = [];
143
143
  const displayColumn = getDisplayFieldsMetaData(columns);
@@ -165,25 +165,33 @@ export default function Dropdown(props: DropdownProps) {
165
165
 
166
166
  let readOnlyProp = {};
167
167
 
168
- if (displayMode === 'LABELS_LEFT') {
169
- return (
170
- <FieldValueList
171
- name={hideLabel ? '' : label}
172
- // @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv'
173
- value={thePConn.getLocalizedValue(value, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))}
174
- />
175
- );
176
- }
168
+ const displayFn = (displayM, val) => {
169
+ if (displayM === 'DISPLAY_ONLY') {
170
+ return (
171
+ <FieldValueList
172
+ name={hideLabel ? '' : label}
173
+ // @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv'
174
+ value={thePConn.getLocalizedValue(val, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))}
175
+ />
176
+ );
177
+ }
178
+
179
+ if (displayM === 'STACKED_LARGE_VAL') {
180
+ return (
181
+ <FieldValueList
182
+ name={hideLabel ? '' : label}
183
+ // @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv'
184
+ value={thePConn.getLocalizedValue(val, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))}
185
+ variant='stacked'
186
+ />
187
+ );
188
+ }
189
+
190
+ return null;
191
+ };
177
192
 
178
- if (displayMode === 'STACKED_LARGE_VAL') {
179
- return (
180
- <FieldValueList
181
- name={hideLabel ? '' : label}
182
- // @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv'
183
- value={thePConn.getLocalizedValue(value, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))}
184
- variant='stacked'
185
- />
186
- );
193
+ if (displayMode) {
194
+ return displayFn(displayMode, options.find(option => option.key === value)?.value || value);
187
195
  }
188
196
 
189
197
  if (readOnly) {
@@ -224,7 +232,6 @@ export default function Dropdown(props: DropdownProps) {
224
232
  >
225
233
  {options.map((option: any) => (
226
234
  <MenuItem key={option.key} value={option.key}>
227
- {/* @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv' */}
228
235
  {thePConn.getLocalizedValue(option.value, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))}
229
236
  </MenuItem>
230
237
  ))}
@@ -1,8 +1,10 @@
1
- import { InputAdornment, TextField } from '@material-ui/core';
2
- import MailOutlineIcon from '@material-ui/icons/MailOutline';
1
+ import { useEffect, useState } from 'react';
2
+ import { InputAdornment, TextField } from '@mui/material';
3
+ import MailOutlineIcon from '@mui/icons-material/MailOutline';
3
4
 
4
5
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
5
6
  import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
7
+ import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
6
8
 
7
9
  interface EmailProps extends PConnFieldProps {
8
10
  // If any, enter additional props that only exist on Date here
@@ -14,14 +16,13 @@ export default function Email(props: EmailProps) {
14
16
  const FieldValueList = getComponentFromMap('FieldValueList');
15
17
 
16
18
  const {
19
+ getPConnect,
17
20
  label,
18
21
  required,
19
22
  disabled,
20
23
  value = '',
21
24
  validatemessage,
22
25
  status,
23
- onChange,
24
- onBlur,
25
26
  readOnly,
26
27
  testId,
27
28
  helperText,
@@ -29,9 +30,20 @@ export default function Email(props: EmailProps) {
29
30
  hideLabel,
30
31
  placeholder
31
32
  } = props;
33
+
34
+ const pConn = getPConnect();
35
+ const actions = pConn.getActionsApi();
36
+ const propName = (pConn.getStateProps() as any).value;
37
+
32
38
  const helperTextToDisplay = validatemessage || helperText;
33
39
 
34
- if (displayMode === 'LABELS_LEFT') {
40
+ const [inputValue, setInputValue] = useState('');
41
+
42
+ useEffect(() => {
43
+ setInputValue(value);
44
+ }, [value]);
45
+
46
+ if (displayMode === 'DISPLAY_ONLY') {
35
47
  return <FieldValueList name={hideLabel ? '' : label} value={value} />;
36
48
  }
37
49
 
@@ -49,6 +61,15 @@ export default function Email(props: EmailProps) {
49
61
  'data-test-id': testId
50
62
  };
51
63
 
64
+ function handleChange(event) {
65
+ // update internal value
66
+ setInputValue(event?.target?.value);
67
+ }
68
+
69
+ function handleBlur() {
70
+ handleEvent(actions, 'changeNblur', propName, inputValue);
71
+ }
72
+
52
73
  return (
53
74
  <TextField
54
75
  fullWidth
@@ -58,11 +79,11 @@ export default function Email(props: EmailProps) {
58
79
  size='small'
59
80
  required={required}
60
81
  disabled={disabled}
61
- onChange={onChange}
62
- onBlur={!readOnly ? onBlur : undefined}
82
+ onChange={handleChange}
83
+ onBlur={!readOnly ? handleBlur : undefined}
63
84
  error={status === 'error'}
64
85
  label={label}
65
- value={value}
86
+ value={inputValue}
66
87
  type='email'
67
88
  InputProps={{
68
89
  startAdornment: (
@@ -1,5 +1,5 @@
1
1
  import { ReactElement, useMemo } from 'react';
2
- import { Grid } from '@material-ui/core';
2
+ import { Grid } from '@mui/material';
3
3
  import FieldGroup from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldGroup';
4
4
  import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
5
 
@@ -15,7 +15,7 @@ interface GroupProps extends PConnFieldProps {
15
15
  export default function Group(props: GroupProps) {
16
16
  const { children, heading, showHeading, instructions, collapsible, displayMode, type } = props;
17
17
 
18
- const isReadOnly = displayMode === 'LABELS_LEFT';
18
+ const isReadOnly = displayMode === 'DISPLAY_ONLY';
19
19
 
20
20
  const content = useMemo(() => {
21
21
  return (
@@ -1,5 +1,7 @@
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
6
  import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
7
 
@@ -13,14 +15,13 @@ export default function Integer(props: IntegerProps) {
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
  helperText,
@@ -28,11 +29,20 @@ export default function Integer(props: IntegerProps) {
28
29
  hideLabel,
29
30
  placeholder
30
31
  } = props;
32
+
33
+ const pConn = getPConnect();
34
+ const actions = pConn.getActionsApi();
35
+ const propName = (pConn.getStateProps() as any).value;
36
+
31
37
  const helperTextToDisplay = validatemessage || helperText;
32
38
 
33
- // console.log(`Integer: label: ${label} value: ${value}`);
39
+ const [inputValue, setInputValue] = useState('');
40
+
41
+ useEffect(() => {
42
+ setInputValue(value);
43
+ }, [value]);
34
44
 
35
- if (displayMode === 'LABELS_LEFT') {
45
+ if (displayMode === 'DISPLAY_ONLY') {
36
46
  return <FieldValueList name={hideLabel ? '' : label} value={value} />;
37
47
  }
38
48
 
@@ -64,7 +74,11 @@ export default function Integer(props: IntegerProps) {
64
74
  }
65
75
 
66
76
  // Pass through to the Constellation change handler
67
- onChange(event);
77
+ setInputValue(event.target.value);
78
+ }
79
+
80
+ function handleBlur() {
81
+ handleEvent(actions, 'changeNblur', propName, inputValue);
68
82
  }
69
83
 
70
84
  return (
@@ -77,10 +91,10 @@ export default function Integer(props: IntegerProps) {
77
91
  required={required}
78
92
  disabled={disabled}
79
93
  onChange={intOnChange}
80
- onBlur={!readOnly ? onBlur : undefined}
94
+ onBlur={!readOnly ? handleBlur : undefined}
81
95
  error={status === 'error'}
82
96
  label={label}
83
- value={value}
97
+ value={inputValue}
84
98
  type='text'
85
99
  inputProps={{ inputMode: 'numeric', pattern: '[0-9]*', ...testProp }}
86
100
  />
@@ -1,15 +1,9 @@
1
- import { Checkbox, TextField } from '@material-ui/core';
2
- import Autocomplete from '@material-ui/lab/Autocomplete';
3
- import CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';
4
- import CheckBoxIcon from '@material-ui/icons/CheckBox';
5
1
  import { useEffect, useMemo, useRef, useState } from 'react';
2
+ import { Autocomplete, TextField } from '@mui/material';
6
3
  import { doSearch, getDisplayFieldsMetaData, useDeepMemo, preProcessColumns, getGroupDataForItemsTree } from './utils';
7
4
  import { insertInstruction, deleteInstruction } from '@pega/react-sdk-components/lib/components/helpers/instructions-utils';
8
5
  import { debounce } from 'throttle-debounce';
9
6
 
10
- const icon = <CheckBoxOutlineBlankIcon fontSize='small' />;
11
- const checkedIcon = <CheckBoxIcon fontSize='small' />;
12
-
13
7
  export default function Multiselect(props) {
14
8
  const {
15
9
  getPConnect,
@@ -226,16 +220,16 @@ export default function Multiselect(props) {
226
220
  fullWidth
227
221
  options={itemsTree}
228
222
  disableCloseOnSelect
229
- getOptionSelected={(option: any, val: any) => option?.primary === val?.primary}
223
+ // getOptionSelected={(option: any, val: any) => option?.primary === val?.primary}
230
224
  getOptionLabel={(option: any) => option?.primary}
231
225
  onChange={handleChange}
232
226
  value={selectedItems}
233
- renderOption={(option: any, { selected }) => (
234
- <>
235
- <Checkbox icon={icon} checkedIcon={checkedIcon} style={{ marginRight: 8 }} checked={selected} />
236
- {option.primary}
237
- </>
238
- )}
227
+ // renderOption={(_props, option: any, { selected }) => (
228
+ // <>
229
+ // <Checkbox icon={icon} checkedIcon={checkedIcon} style={{ marginRight: 8 }} checked={selected} />
230
+ // {option.primary}
231
+ // </>
232
+ // )}
239
233
  renderInput={params => (
240
234
  <TextField {...params} variant='outlined' fullWidth label={label} placeholder={placeholder} size='small' onChange={onSearchHandler} />
241
235
  )}
@@ -1,6 +1,6 @@
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
5
  import { 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';
@@ -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
 
@@ -1,5 +1,5 @@
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
5
  import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
@@ -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,11 +57,12 @@ 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}
@@ -90,13 +91,13 @@ export default function Phone(props: PhoneProps) {
90
91
  };
91
92
 
92
93
  return (
93
- <MuiPhoneNumber
94
+ <MuiTelInput
94
95
  fullWidth
95
96
  variant='outlined'
96
97
  helperText={helperTextToDisplay}
97
98
  placeholder={placeholder ?? ''}
98
99
  size='small'
99
- defaultCountry='us'
100
+ defaultCountry='US'
100
101
  required={required}
101
102
  disabled={disabled}
102
103
  onChange={handleChange}
@@ -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,5 +1,5 @@
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';
@@ -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} />}
@@ -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
+ }
@@ -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,6 +1,6 @@
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
6
  import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
@@ -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,5 +1,7 @@
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
6
  import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
7
 
@@ -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
 
@@ -55,6 +64,15 @@ export default function TextArea(props: TextAreaProps) {
55
64
  'data-test-id': testId
56
65
  };
57
66
 
67
+ function handleChange(event) {
68
+ // update internal value
69
+ setInputValue(event?.target?.value);
70
+ }
71
+
72
+ function handleBlur() {
73
+ handleEvent(actions, 'changeNblur', propName, inputValue);
74
+ }
75
+
58
76
  return (
59
77
  <TextField
60
78
  multiline
@@ -67,11 +85,11 @@ export default function TextArea(props: TextAreaProps) {
67
85
  size='small'
68
86
  required={required}
69
87
  disabled={disabled}
70
- onChange={onChange}
71
- onBlur={!readOnly ? onBlur : undefined}
88
+ onChange={handleChange}
89
+ onBlur={!readOnly ? handleBlur : undefined}
72
90
  error={status === 'error'}
73
91
  label={label}
74
- value={value}
92
+ value={inputValue}
75
93
  InputProps={{ ...readOnlyProp, inputProps: { maxLength, ...testProp } }}
76
94
  />
77
95
  );
@@ -1,4 +1,4 @@
1
- import { Typography } from '@material-ui/core';
1
+ import { Typography } from '@mui/material';
2
2
 
3
3
  import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
4
4
 
@@ -1,5 +1,5 @@
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';
@@ -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