@pega/react-sdk-overrides 24.1.10 → 24.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) 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 +5 -5
  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 +3 -3
  15. package/lib/field/Checkbox/Checkbox.tsx +4 -4
  16. package/lib/field/Currency/Currency.tsx +2 -2
  17. package/lib/field/Date/Date.tsx +23 -42
  18. package/lib/field/DateTime/DateTime.tsx +29 -34
  19. package/lib/field/Decimal/Decimal.tsx +2 -2
  20. package/lib/field/Dropdown/Dropdown.tsx +3 -3
  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 +3 -3
  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 -3
  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 +2 -2
  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 +27 -20
  37. package/lib/field/URL/URL.tsx +26 -7
  38. package/lib/field/UserReference/UserReference.tsx +2 -2
  39. package/lib/helpers/field-group-utils.ts +2 -2
  40. package/lib/helpers/simpleTableHelpers.ts +1 -1
  41. package/lib/infra/ActionButtons/ActionButtons.tsx +3 -3
  42. package/lib/infra/Assignment/Assignment.tsx +10 -6
  43. package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +11 -10
  44. package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +7 -4
  45. package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +8 -8
  46. package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +1 -1
  47. package/lib/infra/DashboardFilter/DashboardFilter.tsx +1 -1
  48. package/lib/infra/DashboardFilter/filterUtils.tsx +2 -1
  49. package/lib/infra/DeferLoad/DeferLoad.tsx +3 -3
  50. package/lib/infra/MultiStep/MultiStep.tsx +14 -8
  51. package/lib/infra/NavBar/NavBar.css +1 -0
  52. package/lib/infra/NavBar/NavBar.tsx +25 -17
  53. package/lib/infra/RootContainer/RootContainer.tsx +5 -6
  54. package/lib/infra/Stages/Stages.tsx +4 -4
  55. package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +4 -3
  56. package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +2 -2
  57. package/lib/infra/View/View.tsx +37 -3
  58. package/lib/template/AppShell/AppShell.tsx +55 -5
  59. package/lib/template/BannerPage/config-ext.json +9 -0
  60. package/lib/template/CaseView/CaseView.tsx +5 -5
  61. package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +7 -7
  62. package/lib/template/Confirmation/Confirmation.tsx +2 -1
  63. package/lib/template/DataReference/DataReference.tsx +2 -2
  64. package/lib/template/Details/Details/Details.tsx +2 -2
  65. package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +3 -3
  66. package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +2 -2
  67. package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +2 -2
  68. package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +4 -3
  69. package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +10 -3
  70. package/lib/template/InlineDashboard/InlineDashboard.tsx +2 -2
  71. package/lib/template/InlineDashboardPage/config-ext.json +9 -0
  72. package/lib/template/ListView/ListView.tsx +69 -61
  73. package/lib/template/ListView/utils.ts +1 -1
  74. package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +2 -2
  75. package/lib/template/OneColumn/OneColumn/OneColumn.tsx +2 -2
  76. package/lib/template/PromotedFilters/PromotedFilters.tsx +1 -1
  77. package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +42 -30
  78. package/lib/template/SubTabs/SubTabs.tsx +2 -2
  79. package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +2 -2
  80. package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +2 -2
  81. package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +2 -2
  82. package/lib/template/WssNavBar/WssNavBar.tsx +9 -9
  83. package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +2 -2
  84. package/lib/widget/Attachment/Attachment.tsx +5 -2
  85. package/lib/widget/CaseHistory/CaseHistory.tsx +12 -10
  86. package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +1 -1
  87. package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +4 -3
  88. package/lib/widget/Followers/Followers.tsx +2 -2
  89. package/lib/widget/QuickCreate/config-ext.json +9 -0
  90. package/lib/widget/SummaryItem/SummaryItem.tsx +3 -2
  91. package/lib/widget/ToDo/ToDo.tsx +91 -21
  92. package/package.json +1 -1
@@ -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';
2
- import { NumericFormat } from 'react-number-format';
3
1
  import { useState } from 'react';
2
+ import { NumericFormat } from 'react-number-format';
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';
@@ -58,7 +58,7 @@ export default function Percentage(props: PercentageProps) {
58
58
  readOnlyProp = { readOnly: true };
59
59
  }
60
60
 
61
- if (displayMode === 'LABELS_LEFT') {
61
+ if (displayMode === 'DISPLAY_ONLY') {
62
62
  return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} />;
63
63
  }
64
64
 
@@ -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,7 +61,7 @@ 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}
@@ -91,7 +91,7 @@ export default function RadioButtons(props: RadioButtonsProps) {
91
91
  };
92
92
 
93
93
  return (
94
- <FormControl error={status === 'error'} required={required}>
94
+ <FormControl variant='standard' error={status === 'error'} required={required}>
95
95
  <FormLabel component='legend'>{label}</FormLabel>
96
96
  <RadioGroup value={theSelectedButton} onChange={handleChange} onBlur={!readOnly ? handleBlur : undefined} row={inline}>
97
97
  {theOptions.map(theOption => {
@@ -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
+ }
@@ -38,7 +38,7 @@ export default function ScalarList(props: ScalarListProps) {
38
38
  config: {
39
39
  // @ts-ignore - Type '{ readOnly: true; displayInModal: boolean; value: any; displayMode: string; label: string; }' is not assignable to type 'ComponentMetadataConfig'.
40
40
  value: scalarValue,
41
- displayMode: 'LABELS_LEFT',
41
+ displayMode: 'DISPLAY_ONLY',
42
42
  label,
43
43
  ...restProps,
44
44
  // @ts-ignore - Type 'string' is not assignable to type 'boolean | undefined'.
@@ -51,7 +51,7 @@ export default function ScalarList(props: ScalarListProps) {
51
51
  ); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional;
52
52
  });
53
53
 
54
- if (['LABELS_LEFT', 'STACKED_LARGE_VAL', 'DISPLAY_ONLY'].includes(displayMode)) {
54
+ if (['STACKED_LARGE_VAL', 'DISPLAY_ONLY'].includes(displayMode)) {
55
55
  return (
56
56
  <div>
57
57
  <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
 
@@ -1,7 +1,8 @@
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
7
  import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
7
8
 
@@ -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
 
@@ -37,11 +40,11 @@ export default function Time(props: TimeProps) {
37
40
 
38
41
  const handleChange = date => {
39
42
  const theValue = date && date.isValid() ? date.format('HH:mm') : null;
40
- onChange({ value: theValue });
43
+ handleEvent(actions, 'changeNblur', propName, theValue);
41
44
  };
42
45
 
43
46
  let timeValue: any = null;
44
- if (value) {
47
+ if (value && Object.keys(value).length) {
45
48
  const timeArray = value.split(':').map(itm => Number(itm));
46
49
  timeValue = dayjs().hour(timeArray[0]).minute(timeArray[1]);
47
50
  }
@@ -52,25 +55,29 @@ export default function Time(props: TimeProps) {
52
55
  //
53
56
 
54
57
  return (
55
- <KeyboardTimePicker
56
- variant='inline'
57
- inputVariant='outlined'
58
- placeholder='hh:mm am'
59
- keyboardIcon={<AccessTimeIcon />}
60
- fullWidth
61
- required={required}
58
+ <TimePicker
59
+ // keyboardIcon={<AccessTimeIcon />}
60
+ // fullWidth
61
+
62
62
  disabled={disabled}
63
- error={status === 'error'}
64
- helperText={helperTextToDisplay}
65
63
  minutesStep={5}
66
- size='small'
67
64
  label={label}
68
- autoOk
69
- mask='__:__ _m'
65
+ // autoOk
66
+ // mask='__:__ _m'
70
67
  format='hh:mm a'
71
68
  value={timeValue}
72
69
  onChange={handleChange}
73
- InputProps={{ inputProps: { ...testProp } }}
70
+ slotProps={{
71
+ textField: {
72
+ variant: 'outlined',
73
+ placeholder: 'hh:mm am',
74
+ required,
75
+ error: status === 'error',
76
+ helperText: helperTextToDisplay,
77
+ size: 'small',
78
+ InputProps: { ...testProp }
79
+ }
80
+ }}
74
81
  />
75
82
  );
76
83
  }
@@ -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
 
@@ -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
 
@@ -51,6 +62,14 @@ export default function URLComponent(props: URLComponentProps) {
51
62
  'data-test-id': testId
52
63
  };
53
64
 
65
+ const handleChange = event => {
66
+ setInputValue(event?.target?.value);
67
+ };
68
+
69
+ function handleBlur() {
70
+ handleEvent(actions, 'changeNblur', propName, inputValue);
71
+ }
72
+
54
73
  return (
55
74
  <TextField
56
75
  type='url'
@@ -61,11 +80,11 @@ export default function URLComponent(props: URLComponentProps) {
61
80
  size='small'
62
81
  required={required}
63
82
  disabled={disabled}
64
- onChange={onChange}
65
- onBlur={!readOnly ? onBlur : undefined}
83
+ onChange={handleChange}
84
+ onBlur={!readOnly ? handleBlur : undefined}
66
85
  error={status === 'error'}
67
86
  label={label}
68
- value={value}
87
+ value={inputValue}
69
88
  InputProps={{ inputProps: { ...testProp } }}
70
89
  />
71
90
  );
@@ -1,5 +1,5 @@
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
5
  import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
@@ -99,7 +99,7 @@ const UserReference = (props: UserReferenceProps) => {
99
99
 
100
100
  let userReferenceComponent: any = null;
101
101
 
102
- if (displayMode === 'LABELS_LEFT') {
102
+ if (displayMode === 'DISPLAY_ONLY') {
103
103
  return <FieldValueList name={hideLabel ? '' : label} value={userName || ''} />;
104
104
  }
105
105
 
@@ -49,8 +49,8 @@ export function buildView(pConn, index, viewConfigPath): ReactElement {
49
49
  };
50
50
 
51
51
  const view = PCore.createPConnect(config);
52
- if (pConn.getConfigProps()?.displayMode === 'LABELS_LEFT') {
53
- view.getPConnect()?.setInheritedProp('displayMode', 'LABELS_LEFT');
52
+ if (pConn.getConfigProps()?.displayMode === 'DISPLAY_ONLY') {
53
+ view.getPConnect()?.setInheritedProp('displayMode', 'DISPLAY_ONLY');
54
54
  }
55
55
  return createElement(createPConnectComponent(), view);
56
56
  }
@@ -231,7 +231,7 @@ export const filterData = filterByColumns => {
231
231
  case 'Date':
232
232
  case 'DateTime':
233
233
  case 'Time':
234
- value = item[filterObj.ref] !== null ?? item[filterObj.ref] !== '' ? Utils.getSeconds(item[filterObj.ref]) : null;
234
+ value = (item[filterObj.ref] !== null ?? item[filterObj.ref] !== '') ? Utils.getSeconds(item[filterObj.ref]) : null;
235
235
  filterValue =
236
236
  filterObj.containsFilterValue !== null && filterObj.containsFilterValue !== '' ? Utils.getSeconds(filterObj.containsFilterValue) : null;
237
237
 
@@ -1,6 +1,6 @@
1
- import { makeStyles } from '@material-ui/core/styles';
2
- import Button from '@material-ui/core/Button';
3
- import { Grid, Divider } from '@material-ui/core';
1
+ import makeStyles from '@mui/styles/makeStyles';
2
+ import Button from '@mui/material/Button';
3
+ import { Grid, Divider } from '@mui/material';
4
4
 
5
5
  // ActionButtons does NOT have getPConnect. So, no need to extend from PConnProps
6
6
  interface ActionButtonsProps {
@@ -1,9 +1,10 @@
1
1
  import React, { PropsWithChildren, useEffect, useState } from 'react';
2
- import Snackbar from '@material-ui/core/Snackbar';
3
- import IconButton from '@material-ui/core/IconButton';
4
- import CloseIcon from '@material-ui/icons/Close';
2
+ import Snackbar from '@mui/material/Snackbar';
3
+ import IconButton from '@mui/material/IconButton';
4
+ import CloseIcon from '@mui/icons-material/Close';
5
5
 
6
6
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
7
+ import { useFocusFirstField, useScrolltoTop } from '@pega/react-sdk-components/lib/hooks';
7
8
 
8
9
  import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
9
10
 
@@ -86,6 +87,10 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
86
87
  return formedSteps;
87
88
  }
88
89
 
90
+ const scrollId = window.location.href.includes('embedded') ? '#pega-part-of-page' : '#portal';
91
+ useScrolltoTop(scrollId, children);
92
+ useFocusFirstField('Assignment', children);
93
+
89
94
  useEffect(() => {
90
95
  if (children) {
91
96
  const firstChild = Array.isArray(children) ? children[0] : children;
@@ -94,7 +99,7 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
94
99
  const oData: any = thePConn.getDataObject(''); // 1st arg empty string until typedefs allow it to be optional
95
100
 
96
101
  if (oWorkData?.caseInfo && oWorkData.caseInfo.assignments !== null) {
97
- const oCaseInfo = oData.caseInfo;
102
+ const oCaseInfo = oData?.caseInfo;
98
103
 
99
104
  if (oCaseInfo && oCaseInfo.actionButtons) {
100
105
  setActionButtons(oCaseInfo.actionButtons);
@@ -134,7 +139,7 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
134
139
  setShowSnackbar(true);
135
140
  }
136
141
 
137
- function handleSnackbarClose(event: React.SyntheticEvent | React.MouseEvent, reason?: string) {
142
+ function handleSnackbarClose(event: React.SyntheticEvent<any> | Event, reason?: string) {
138
143
  if (reason === 'clickaway') {
139
144
  return;
140
145
  }
@@ -230,7 +235,6 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
230
235
  break;
231
236
  }
232
237
  } else if (sButtonType === 'primary') {
233
- // eslint-disable-next-line sonarjs/no-small-switch
234
238
  switch (sAction) {
235
239
  case 'finishAssignment': {
236
240
  const finishPromise = finishAssignment(itemKey);