@pega/dx-component-builder-sdk 0.24.7 → 0.242.1

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 (45) hide show
  1. package/package.json +2 -2
  2. package/src/tasks/authenticate/index.js +1 -1
  3. package/src/tasks/create/templates/Constellation/field/Boolean/demo.stories.tsx.mustache +2 -3
  4. package/src/tasks/create/templates/Constellation/field/Boolean/index.tsx.mustache +5 -4
  5. package/src/tasks/create/templates/Constellation/field/Boolean/mock.ts.mustache +0 -1
  6. package/src/tasks/create/templates/Constellation/field/Date/index.tsx.mustache +3 -5
  7. package/src/tasks/create/templates/Constellation/field/Integer/demo.stories.tsx.mustache +1 -2
  8. package/src/tasks/create/templates/Constellation/field/Integer/event-utils.ts.mustache +1 -1
  9. package/src/tasks/create/templates/Constellation/field/Integer/index.tsx.mustache +2 -12
  10. package/src/tasks/create/templates/Constellation/field/Integer/mock.ts.mustache +3 -2
  11. package/src/tasks/create/templates/SDK-React/field/Boolean/index.tsx.mustache +3 -2
  12. package/src/tasks/create/templates/SDK-React/field/Date/index.tsx.mustache +30 -50
  13. package/src/tasks/create/templates/SDK-React/field/DateTime/index.tsx.mustache +29 -39
  14. package/src/tasks/create/templates/SDK-React/field/Decimal/index.tsx.mustache +4 -3
  15. package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/index.tsx.mustache +2 -1
  16. package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/index.tsx.mustache +4 -3
  17. package/src/tasks/create/templates/SDK-React/field/Icon-Button-URL/index.tsx.mustache +11 -11
  18. package/src/tasks/create/templates/SDK-React/field/Integer/index.tsx.mustache +2 -1
  19. package/src/tasks/create/templates/SDK-React/field/Picklist/index.tsx.mustache +3 -2
  20. package/src/tasks/create/templates/SDK-React/field/Picklist-Autocomplete/index.tsx.mustache +4 -3
  21. package/src/tasks/create/templates/SDK-React/field/Picklist-RadioButtons/index.tsx.mustache +2 -1
  22. package/src/tasks/create/templates/SDK-React/field/Text/index.tsx.mustache +2 -1
  23. package/src/tasks/create/templates/SDK-React/field/Text-Email/index.tsx.mustache +3 -2
  24. package/src/tasks/create/templates/SDK-React/field/Text-Input/index.tsx.mustache +2 -1
  25. package/src/tasks/create/templates/SDK-React/field/Text-Paragraph/index.tsx.mustache +2 -1
  26. package/src/tasks/create/templates/SDK-React/field/Text-URL/index.tsx.mustache +2 -1
  27. package/src/tasks/create/templates/SDK-React/field/TimeOfDay/index.tsx.mustache +23 -21
  28. package/src/tasks/create/templates/SDK-React/template/DETAILS/index.tsx.mustache +1 -1
  29. package/src/tasks/create/templates/SDK-React/template/DETAILS-region/index.tsx.mustache +1 -1
  30. package/src/tasks/create/templates/SDK-React/template/FORM-region/index.tsx.mustache +6 -6
  31. package/src/tasks/create/templates/SDK-React/template/PAGE/OneColumn.tsx.mustache +2 -2
  32. package/src/tasks/create/templates/SDK-React/widget/CASE/index.tsx.mustache +11 -10
  33. package/src/tasks/create/templates/SDK-React/widget/PAGE/index.tsx.mustache +25 -19
  34. package/src/tasks/create/templates/SDK-React/widget/PAGE/mock.ts.mustache +1 -1
  35. package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/index.tsx.mustache +18 -10
  36. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageWidget/index.tsx +1 -1
  37. /package/tests/assets/sdk-a/components/createAll/custom-constellation/field/{Pega_DXIL_MyRadiobuttons → Pega_DXIL_MyRadioButtons}/PConnProps.d.ts +0 -0
  38. /package/tests/assets/sdk-a/components/createAll/custom-constellation/field/{Pega_DXIL_MyRadiobuttons → Pega_DXIL_MyRadioButtons}/create-nonce.ts +0 -0
  39. /package/tests/assets/sdk-a/components/createAll/custom-constellation/field/{Pega_DXIL_MyRadiobuttons → Pega_DXIL_MyRadioButtons}/demo.stories.tsx +0 -0
  40. /package/tests/assets/sdk-a/components/createAll/custom-constellation/field/{Pega_DXIL_MyRadiobuttons → Pega_DXIL_MyRadioButtons}/event-utils.ts +0 -0
  41. /package/tests/assets/sdk-a/components/createAll/custom-constellation/field/{Pega_DXIL_MyRadiobuttons → Pega_DXIL_MyRadioButtons}/index.tsx +0 -0
  42. /package/tests/assets/sdk-a/components/createAll/custom-constellation/field/{Pega_DXIL_MyRadiobuttons → Pega_DXIL_MyRadioButtons}/mock.ts +0 -0
  43. /package/tests/assets/sdk-a/components/createAll/custom-constellation/field/{Pega_DXIL_MyRadiobuttons → Pega_DXIL_MyRadioButtons}/styles.ts +0 -0
  44. /package/tests/assets/sdk-a/components/createAll/custom-constellation/field/{Pega_DXIL_MyRadiobuttons → Pega_DXIL_MyRadioButtons}/suggestions-handler.ts +0 -0
  45. /package/tests/assets/sdk-a/components/createAll/custom-constellation/field/{Pega_DXIL_MyRadiobuttons → Pega_DXIL_MyRadioButtons}/textformat-utils.tsx +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/dx-component-builder-sdk",
3
- "version": "0.24.7",
3
+ "version": "0.242.1",
4
4
  "description": "Utility for building custom UI components",
5
5
  "bin": "./bin/index.js",
6
6
  "scripts": {
@@ -52,7 +52,7 @@
52
52
  "sass-loader": "^13.3.3",
53
53
  "terser-webpack-plugin": "5.3.10",
54
54
  "ts-loader": "^9.5.1",
55
- "typescript": "^4.9.5",
55
+ "typescript": "~5.2.2",
56
56
  "url-loader": "4.1.1",
57
57
  "webpack": "^5.89.0"
58
58
  },
@@ -208,6 +208,6 @@ export default async options => {
208
208
  }
209
209
  }
210
210
 
211
- process.exit(1);
211
+ process.exit();
212
212
 
213
213
  };
@@ -1,6 +1,5 @@
1
1
 
2
2
  /* eslint-disable react/jsx-no-useless-fragment */
3
- // @ts-nocheck
4
3
  import { useState } from 'react';
5
4
  import type { Meta, StoryObj } from '@storybook/react';
6
5
 
@@ -17,7 +16,7 @@ const meta: Meta<typeof {{COMPONENT_CLASS_NAME}}> = {
17
16
  export default meta;
18
17
  type Story = StoryObj<typeof {{COMPONENT_CLASS_NAME}}>;
19
18
 
20
- export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
19
+ export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
21
20
 
22
21
  const [value, setValue] = useState(configProps.value);
23
22
 
@@ -31,7 +30,7 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
31
30
  },
32
31
  getActionsApi: () => {
33
32
  return {
34
- updateFieldValue: (propName, theValue) => {
33
+ updateFieldValue: (propName: string, theValue: any) => {
35
34
  setValue(theValue);
36
35
  },
37
36
  triggerFieldChange: () => { /* nothing */}
@@ -87,7 +87,6 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
87
87
  handleEvent(actions, "changeNblur", propName, event.target.checked);
88
88
  }}
89
89
  onBlur={(event: { target: { checked: any; }; }) => {
90
- // @ts-ignore
91
90
  pConn.getValidationApi().validate(event.target.checked);
92
91
  }}
93
92
  data-testid={testId}
@@ -98,15 +97,17 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
98
97
 
99
98
  let displayComponent;
100
99
  if (displayMode) {
101
- // @ts-ignore
102
100
  displayComponent = (
103
- // @ts-ignore
104
101
  <BooleanDisplay value={value} trueLabel={trueLabel} falseLabel={falseLabel} />
105
102
  );
106
103
  }
107
104
 
108
105
  if (displayMode === 'DISPLAY_ONLY') {
109
- return ( <Styled{{COMPONENT_CLASS_NAME}}Wrapper> {displayComponent} </Styled{{COMPONENT_CLASS_NAME}}Wrapper>);
106
+ return (
107
+ <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
108
+ {displayComponent}
109
+ </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
110
+ );
110
111
  }
111
112
 
112
113
  if (displayMode === "LABELS_LEFT") {
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  export const configProps = {
3
2
  value: true,
4
3
  label: 'Boolean label',
@@ -104,8 +104,7 @@ function {{COMPONENT_CLASS_NAME}} (props: {{COMPONENT_CLASS_NAME}}Props) {
104
104
  }, [validatemessage, hasSuggestions, myStatus]);
105
105
 
106
106
  // calculate min and max range of calendar
107
- // @ts-ignore
108
- const currentYear = getFullYear();
107
+ const currentYear = getFullYear(null);
109
108
 
110
109
  const yearFromValue = getFullYear(value);
111
110
  const maxDate = getMaxDate(
@@ -161,7 +160,7 @@ function {{COMPONENT_CLASS_NAME}} (props: {{COMPONENT_CLASS_NAME}}Props) {
161
160
  }
162
161
 
163
162
 
164
- if (formatter !== "" && formatExists(formatter)){
163
+ if (formatter !== "" && formatExists(formatter)) {
165
164
  // @ts-ignore
166
165
  const {variantVal, formatVal} = datetimedisplayformatter(formatter);
167
166
  variantValue = variantVal;
@@ -225,8 +224,7 @@ function {{COMPONENT_CLASS_NAME}} (props: {{COMPONENT_CLASS_NAME}}Props) {
225
224
  hideLabel={hideLabel}
226
225
  testId={testId}
227
226
  additionalProps={textAdditionalProps}
228
- // @ts-ignore
229
- customFormat={getDateFormat(locale)}
227
+ customFormat={getDateFormat(locale, null)}
230
228
  />
231
229
  </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
232
230
  );
@@ -1,5 +1,4 @@
1
1
  /* eslint-disable react/jsx-no-useless-fragment */
2
- // @ts-nocheck
3
2
  import type { Meta, StoryObj } from '@storybook/react';
4
3
 
5
4
  import { stateProps, configProps, fieldMetadata } from './mock';
@@ -15,7 +14,7 @@ const meta: Meta<typeof {{COMPONENT_CLASS_NAME}}> = {
15
14
  export default meta;
16
15
  type Story = StoryObj<typeof {{COMPONENT_CLASS_NAME}}>;
17
16
 
18
- export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
17
+ export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
19
18
 
20
19
  const props = {
21
20
  value: configProps.value,
@@ -1,4 +1,4 @@
1
- const handleEvent = (actions: any, eventType: string, propName: string, value: string) => {
1
+ const handleEvent = (actions: any, eventType: string, propName: string, value: string | number) => {
2
2
  switch (eventType) {
3
3
  case 'change':
4
4
  actions.updateFieldValue(propName, value);
@@ -112,21 +112,17 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
112
112
 
113
113
  useEffect(() => {
114
114
  if (displayAs === 'slider' && value === '') {
115
- // @ts-ignore
116
115
  handleEvent(actions, 'change', propName, sliderDefaultValue);
117
116
  }
118
117
  }, [actions, displayAs, propName, sliderDefaultValue, value]);
119
118
 
120
119
  const { decimalPrecision, currencyDecimalPrecision = 'auto', currencyISOCode = 'USD' } = props;
121
- let noOfDecimals = parseInt(decimalPrecision, 10);
122
- // @ts-ignore
120
+ let noOfDecimals : number | undefined = parseInt(decimalPrecision, 10);
123
121
  if (Number.isNaN(noOfDecimals)) noOfDecimals = undefined;
124
122
  let noOfFractionDigits = currencyDecimalPrecision === 'auto' ? undefined : parseInt(currencyDecimalPrecision, 10);
125
123
  let unit;
126
- let unitPlacement;
127
124
 
128
- // @ts-ignore
129
- if (['LABELS_LEFT', 'STACKED_LARGE_VAL', 'DISPLAY_ONLY'].includes(displayMode)) {
125
+ if (['LABELS_LEFT', 'STACKED_LARGE_VAL', 'DISPLAY_ONLY'].includes(displayMode as string)) {
130
126
  switch (formatter) {
131
127
  case 'Decimal': {
132
128
  break;
@@ -134,7 +130,6 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
134
130
  case 'Percentage': {
135
131
  showGroupSeparators = false;
136
132
  unit = '%';
137
- unitPlacement = 'after';
138
133
  break;
139
134
  }
140
135
  case 'Decimal-Auto': {
@@ -180,7 +175,6 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
180
175
  notation
181
176
  }}
182
177
  unit={unit}
183
- unitPlacement={unitPlacement}
184
178
  />
185
179
  );
186
180
 
@@ -233,13 +227,11 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
233
227
  setIntegerValue(enteredValue);
234
228
  // const parsedValue = integerValue !== '' ? Number(integerValue) : '';
235
229
  if (value !== (enteredValue !== '' ? Number(enteredValue) : '')) {
236
- // @ts-ignore
237
230
  handleEvent(actions, 'change', propName, enteredValue !== '' ? Number(enteredValue) : '');
238
231
  hasValueChange.current = true;
239
232
  }
240
233
  // In case of stepper variation there is no blur event as component is never focussed unless forced. Need to update redux on change.
241
234
  if (displayAs === 'stepper') {
242
- // @ts-ignore
243
235
  handleEvent(actions, 'changeNblur', propName, enteredValue !== '' ? Number(enteredValue) : '');
244
236
  }
245
237
  }
@@ -271,7 +263,6 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
271
263
  ticks={showTicks && { [min]: `${min}`, [max]: `${max}` }}
272
264
  onChange={(selectedValue) => {
273
265
  onChangeHandler(selectedValue.toString());
274
- // @ts-ignore
275
266
  handleEvent(actions, 'changeNblur', propName, selectedValue);
276
267
  }}
277
268
  />
@@ -298,7 +289,6 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
298
289
  }}
299
290
  onBlur={() => {
300
291
  if (!readOnly && (hasValueChange.current || !value)) {
301
- // @ts-ignore
302
292
  handleEvent(actions, 'blur', propName, integerValue !== '' ? Number(integerValue) : '');
303
293
  if (hasSuggestions) {
304
294
  pConn.ignoreSuggestion('');
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  export const configProps = {
3
2
  value: '',
4
3
  label: 'Integer Sample',
@@ -12,7 +11,9 @@ export const configProps = {
12
11
  required: false,
13
12
  disabled: false,
14
13
  status: '',
15
- validatemessage: ''
14
+ validatemessage: '',
15
+ placeholder: '',
16
+ variant: ''
16
17
  };
17
18
 
18
19
  export const stateProps = {
@@ -1,12 +1,13 @@
1
1
  /* eslint-disable react/no-array-index-key */
2
2
  import { useState, useEffect } from 'react';
3
- import { Checkbox, FormControl, FormControlLabel, FormGroup, FormHelperText, FormLabel } from '@material-ui/core';
3
+ import { Checkbox, FormControl, FormControlLabel, FormGroup, FormHelperText, FormLabel } from '@mui/material';
4
+ import makeStyles from '@mui/styles/makeStyles';
4
5
 
5
6
  import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
6
7
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
7
8
  import { insertInstruction, deleteInstruction, updateNewInstuctions } from '@pega/react-sdk-components/lib/components/helpers/instructions-utils';
8
9
  import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
9
- import { makeStyles } from '@material-ui/core/styles';
10
+
10
11
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
11
12
 
12
13
  interface {{COMPONENT_CLASS_NAME}}Props extends Omit<PConnFieldProps, 'value'> {
@@ -1,10 +1,13 @@
1
- import { KeyboardDatePicker, MuiPickersUtilsProvider } from '@material-ui/pickers';
2
- import DayjsUtils from '@date-io/dayjs';
1
+ import { useState } from 'react';
2
+ import { DatePicker } from '@mui/x-date-pickers/DatePicker';
3
+ import dayjs, { Dayjs } from 'dayjs';
4
+
3
5
  import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
4
6
  import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
5
7
  import { dateFormatInfoDefault, getDateFormatInfo } from '@pega/react-sdk-components/lib/components/helpers/date-format-utils';
6
8
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
7
9
  import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
10
+
8
11
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
9
12
 
10
13
  // Will return the date string in YYYY-MM-DD format which we'll be POSTing to the server
@@ -24,22 +27,9 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
24
27
  const TextInput = getComponentFromMap('TextInput');
25
28
  const FieldValueList = getComponentFromMap('FieldValueList');
26
29
 
27
- const {
28
- getPConnect,
29
- label,
30
- required,
31
- disabled,
32
- value = '',
33
- validatemessage,
34
- status,
35
- onChange,
36
- onBlur,
37
- readOnly,
38
- testId,
39
- helperText,
40
- displayMode,
41
- hideLabel
42
- } = props;
30
+ const { getPConnect, label, required, disabled, value, validatemessage, status, readOnly, testId, helperText, displayMode, hideLabel } = props;
31
+
32
+ const [dateValue, setDateValue] = useState<Dayjs | null>(value ? dayjs(value) : null);
43
33
 
44
34
  const pConn = getPConnect();
45
35
  const actions = pConn.getActionsApi();
@@ -81,44 +71,34 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
81
71
 
82
72
  const handleChange = date => {
83
73
  if (date && date.isValid()) {
84
- onChange({ value: getFormattedDate(date) });
85
- }
86
- };
87
-
88
- const handleAccept = date => {
89
- if (date && date.isValid()) {
74
+ setDateValue(date);
90
75
  handleEvent(actions, 'changeNblur', propName, getFormattedDate(date));
91
76
  }
92
77
  };
93
78
 
94
79
  return (
95
80
  <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
96
- <MuiPickersUtilsProvider utils={DayjsUtils}>
97
- <KeyboardDatePicker
98
- disableToolbar
99
- variant='inline'
100
- inputVariant='outlined'
101
- placeholder={dateFormatInfo.dateFormatStringLC}
102
- format={dateFormatInfo.dateFormatString}
103
- mask={dateFormatInfo.dateFormatMask}
104
- fullWidth
105
- autoOk
106
- required={required}
107
- disabled={disabled}
108
- error={status === 'error'}
109
- helperText={helperTextToDisplay}
110
- size='small'
111
- label={label}
112
- value={value || null}
113
- onChange={handleChange}
114
- onBlur={!readOnly ? onBlur : undefined}
115
- onAccept={handleAccept}
116
- {{! pick new delimiters for mustache }}
117
- {{=<% %>=}}
118
- InputProps={{ ...testProp }}
119
- <%={{ }}=%> {{! revert delimiters for mustache }}
120
- />
121
- </MuiPickersUtilsProvider>
81
+ <DatePicker
82
+ label={label}
83
+ disabled={disabled}
84
+ format={dateFormatInfo.dateFormatString}
85
+ value={dateValue}
86
+ {{! pick new delimiters for mustache }}
87
+ {{=<% %>=}}
88
+ slotProps={{
89
+ textField: {
90
+ required,
91
+ variant: 'outlined',
92
+ placeholder: dateFormatInfo.dateFormatStringLC,
93
+ error: status === 'error',
94
+ helperText: helperTextToDisplay,
95
+ size: 'small',
96
+ InputProps: { ...testProp }
97
+ }
98
+ }}
99
+ <%={{ }}=%> {{! revert delimiters for mustache }}
100
+ onChange={handleChange}
101
+ />
122
102
  </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
123
103
  );
124
104
  }
@@ -1,11 +1,14 @@
1
- import { KeyboardDateTimePicker, MuiPickersUtilsProvider } from '@material-ui/pickers';
2
- import DayjsUtils from '@date-io/dayjs';
1
+ import { useState } from 'react';
2
+ import { DateTimePicker } from '@mui/x-date-pickers/DateTimePicker';
3
+ import dayjs, { Dayjs } from 'dayjs';
4
+
3
5
  import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
4
- import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters/';
6
+ import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
5
7
  import { dateFormatInfoDefault, getDateFormatInfo } from '@pega/react-sdk-components/lib/components/helpers/date-format-utils';
6
8
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
7
9
  import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
8
10
 
11
+
9
12
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
10
13
 
11
14
  interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
@@ -20,21 +23,9 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
20
23
  const TextInput = getComponentFromMap('TextInput');
21
24
  const FieldValueList = getComponentFromMap('FieldValueList');
22
25
 
23
- const {
24
- getPConnect,
25
- label,
26
- required,
27
- disabled,
28
- value = '',
29
- validatemessage,
30
- status,
31
- onChange,
32
- readOnly,
33
- testId,
34
- helperText,
35
- displayMode,
36
- hideLabel
37
- } = props;
26
+ const { getPConnect, label, required, disabled, value = '', validatemessage, status, readOnly, testId, helperText, displayMode, hideLabel } = props;
27
+
28
+ const [dateValue, setDateValue] = useState<Dayjs | null>(value ? dayjs(value) : null);
38
29
 
39
30
  const pConn = getPConnect();
40
31
  const actions = pConn.getActionsApi();
@@ -69,11 +60,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
69
60
  }
70
61
 
71
62
  const handleChange = date => {
72
- const changeValue = date && date.isValid() ? date.toISOString() : null;
73
- onChange({ value: changeValue });
74
- };
75
-
76
- const handleAccept = date => {
63
+ setDateValue(date);
77
64
  const changeValue = date && date.isValid() ? date.toISOString() : null;
78
65
  handleEvent(actions, 'changeNblur', propName, changeValue);
79
66
  };
@@ -85,28 +72,31 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
85
72
 
86
73
  return (
87
74
  <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
88
- <MuiPickersUtilsProvider utils={DayjsUtils}>
89
- <KeyboardDateTimePicker
90
- variant='inline'
91
- inputVariant='outlined'
92
- fullWidth
93
- autoOk
94
- required={required}
75
+ <DateTimePicker
76
+ // fullWidth
77
+ // autoOk
95
78
  disabled={disabled}
96
- placeholder={`${dateFormatInfo.dateFormatStringLC} hh:mm a`}
97
79
  format={`${dateFormatInfo.dateFormatString} hh:mm a`}
98
- mask={`${dateFormatInfo.dateFormatMask} __:__ _m`}
80
+ // mask={`${dateFormatInfo.dateFormatMask} __:__ _m`}
99
81
  minutesStep={5}
100
- error={status === 'error'}
101
- helperText={helperTextToDisplay}
102
- size='small'
103
82
  label={label}
104
- value={value || null}
83
+ value={dateValue}
105
84
  onChange={handleChange}
106
- onAccept={handleAccept}
107
85
  data-test-id={testId}
108
- />
109
- </MuiPickersUtilsProvider>
86
+ {{! pick new delimiters for mustache }}
87
+ {{=<% %>=}}
88
+ slotProps={{
89
+ textField: {
90
+ variant: 'outlined',
91
+ required,
92
+ placeholder: `${dateFormatInfo.dateFormatStringLC} hh:mm a`,
93
+ error: status === 'error',
94
+ helperText: helperTextToDisplay,
95
+ size: 'small'
96
+ }
97
+ }}
98
+ <%={{ }}=%> {{! revert delimiters for mustache }}
99
+ />
110
100
  </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
111
101
  );
112
102
  }
@@ -1,11 +1,12 @@
1
- import { TextField } from '@material-ui/core';
2
1
  import { NumericFormat } from 'react-number-format';
2
+ import { TextField } from '@mui/material';
3
3
  import { useState } from 'react';
4
- import { getCurrencyCharacters, getCurrencyOptions } from '@pega/react-sdk-components/lib/components/field/Currency/currency-utils.js';
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';
7
7
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
8
8
  import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
9
+
9
10
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
10
11
 
11
12
  /* Using react-number-format component here, since it allows formatting decimal values,
@@ -98,7 +99,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
98
99
  return (
99
100
  <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
100
101
  <NumericFormat
101
- valueIsNumericString
102
+ valueIsNumericString
102
103
  fullWidth
103
104
  variant={readOnly ? 'standard' : 'outlined'}
104
105
  helperText={helperTextToDisplay}
@@ -1,11 +1,12 @@
1
- import { TextField } from '@material-ui/core';
2
1
  import { useState } from 'react';
3
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 handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
7
7
  import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
8
8
  import { getCurrencyCharacters, getCurrencyOptions } from '@pega/react-sdk-components/lib/components/field/Currency/currency-utils.js';
9
+
9
10
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
10
11
 
11
12
  /* Using react-number-format component here, since it allows formatting decimal values,
@@ -1,11 +1,12 @@
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
- import { getCurrencyCharacters, getCurrencyOptions } from '@pega/react-sdk-components/lib/components/field/Currency/currency-utils.js';
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';
9
+
9
10
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
10
11
 
11
12
  /* Using react-number-format component here, since it allows formatting decimal values,
@@ -1,12 +1,12 @@
1
1
  import { useEffect, useState } from 'react';
2
- import { Tooltip, IconButton, Link } from '@material-ui/core';
3
- import Table from '@material-ui/core/Table';
4
- import TableBody from '@material-ui/core/TableBody';
5
- import TableCell from '@material-ui/core/TableCell';
6
- import TableContainer from '@material-ui/core/TableContainer';
7
- import TableHead from '@material-ui/core/TableHead';
8
- import TableRow from '@material-ui/core/TableRow';
9
- import Paper from '@material-ui/core/Paper';
2
+ import { Tooltip, IconButton, Link } from '@mui/material';
3
+ import Table from '@mui/material/Table';
4
+ import TableBody from '@mui/material/TableBody';
5
+ import TableCell from '@mui/material/TableCell';
6
+ import TableContainer from '@mui/material/TableContainer';
7
+ import TableHead from '@mui/material/TableHead';
8
+ import TableRow from '@mui/material/TableRow';
9
+ import Paper from '@mui/material/Paper';
10
10
 
11
11
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
12
12
  import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
@@ -14,9 +14,9 @@ import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
14
14
 
15
15
  // IMPORTANT
16
16
  // import LanguageIcon from '@mui/icons-material/Language';
17
- import ArrowForwardIcon from '@material-ui/icons/ArrowForward';
18
- import LanguageIcon from '@material-ui/icons/Language';
19
- import FormatListNumberedIcon from '@material-ui/icons/FormatListNumbered';
17
+ import ArrowForwardIcon from '@mui/icons-material/ArrowForward';
18
+ import LanguageIcon from '@mui/icons-material/Language';
19
+ import FormatListNumberedIcon from '@mui/icons-material/FormatListNumbered';
20
20
 
21
21
  interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
22
22
  // If any, enter additional props that only exist on this componentName
@@ -1,7 +1,8 @@
1
- import { TextField } from '@material-ui/core';
1
+ import { TextField } from '@mui/material';
2
2
 
3
3
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
4
4
  import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
+
5
6
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
6
7
 
7
8
  interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
@@ -1,12 +1,13 @@
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';
7
7
  import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
8
8
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
9
9
  import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
10
+
10
11
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
11
12
 
12
13
  interface IOption {
@@ -1,6 +1,6 @@
1
1
  import { useEffect, useState } from 'react';
2
- import { TextField } from '@material-ui/core';
3
- import Autocomplete from '@material-ui/lab/Autocomplete';
2
+ import { TextField } from '@mui/material';
3
+ import Autocomplete from '@mui/material/Autocomplete';
4
4
  import isDeepEqual from 'fast-deep-equal/react';
5
5
 
6
6
  import Utils from '@pega/react-sdk-components/lib/components/helpers/utils';
@@ -8,6 +8,7 @@ import { getDataPage } from '@pega/react-sdk-components/lib/components/helpers/d
8
8
  import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
9
9
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
10
10
  import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
11
+
11
12
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
12
13
 
13
14
  interface IOption {
@@ -198,7 +199,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
198
199
  getOptionLabel={(option: IOption) => {
199
200
  return option.value ? option.value : '';
200
201
  }}
201
- getOptionSelected={(option: any) => {
202
+ isOptionEqualToValue={(option: any) => {
202
203
  return option.value ? option.value : '';
203
204
  }}
204
205
  <%={{ }}=%> {{! revert delimiters for mustache }}
@@ -1,10 +1,11 @@
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
7
  import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
8
+
8
9
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
9
10
 
10
11
  // Can't use RadioButtonProps until getLocaleRuleNameFromKeys is NOT private
@@ -1,9 +1,10 @@
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
6
  import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
7
+
7
8
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
8
9
 
9
10
  interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
@@ -1,8 +1,9 @@
1
- import { InputAdornment, TextField } from '@material-ui/core';
2
- import MailOutlineIcon from '@material-ui/icons/MailOutline';
1
+ import { InputAdornment, TextField } from '@mui/material';
2
+ import MailOutlineIcon from '@mui/icons-material/MailOutline';
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';
6
+
6
7
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
7
8
 
8
9
  interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
@@ -1,9 +1,10 @@
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
6
  import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
7
+
7
8
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
8
9
 
9
10
  interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
@@ -1,7 +1,8 @@
1
- import { TextField } from '@material-ui/core';
1
+ import { TextField } from '@mui/material';
2
2
 
3
3
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
4
4
  import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
+
5
6
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
6
7
 
7
8
  interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
@@ -1,7 +1,8 @@
1
- import { TextField } from '@material-ui/core';
1
+ import { TextField } from '@mui/material';
2
2
 
3
3
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
4
4
  import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
+
5
6
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
6
7
 
7
8
  interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
@@ -1,10 +1,10 @@
1
- import { KeyboardTimePicker, MuiPickersUtilsProvider } from '@material-ui/pickers';
2
- import DayjsUtils from '@date-io/dayjs';
3
- import AccessTimeIcon from '@material-ui/icons/AccessTime';
1
+ import { TimePicker } from '@mui/x-date-pickers/TimePicker';
2
+ // import AccessTimeIcon from '@mui/icons-material/AccessTime';
4
3
  import dayjs from 'dayjs';
5
4
 
6
5
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
7
6
  import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
7
+
8
8
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
9
9
 
10
10
  interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
@@ -58,31 +58,33 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
58
58
 
59
59
  return (
60
60
  <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
61
- <MuiPickersUtilsProvider utils={DayjsUtils}>
62
- <KeyboardTimePicker
63
- variant='inline'
64
- inputVariant='outlined'
65
- placeholder='hh:mm am'
66
- keyboardIcon={<AccessTimeIcon />}
67
- fullWidth
68
- required={required}
61
+ <TimePicker
62
+ // keyboardIcon={<AccessTimeIcon />}
63
+ // fullWidth
64
+
69
65
  disabled={disabled}
70
- error={status === 'error'}
71
- helperText={helperTextToDisplay}
72
66
  minutesStep={5}
73
- size='small'
74
67
  label={label}
75
- autoOk
76
- mask='__:__ _m'
68
+ // autoOk
69
+ // mask='__:__ _m'
77
70
  format='hh:mm a'
78
71
  value={timeValue}
79
72
  onChange={handleChange}
80
- {{! pick new delimiters for mustache }}
81
- {{=<% %>=}}
82
- InputProps={{ inputProps: { ...testProp } }}
83
- <%={{ }}=%> {{! revert delimiters for mustache }}
73
+ {{! pick new delimiters for mustache }}
74
+ {{=<% %>=}}
75
+ slotProps={{
76
+ textField: {
77
+ variant: 'outlined',
78
+ placeholder: 'hh:mm am',
79
+ required,
80
+ error: status === 'error',
81
+ helperText: helperTextToDisplay,
82
+ size: 'small',
83
+ InputProps: { inputProps: { ...testProp } }
84
+ }
85
+ }}
86
+ <%={{ }}=%> {{! revert delimiters for mustache }}
84
87
  />
85
- </MuiPickersUtilsProvider>
86
88
  </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
87
89
  );
88
90
  }
@@ -1,5 +1,5 @@
1
1
  import { createElement } from 'react';
2
- import Grid from '@material-ui/core/Grid';
2
+ import Grid from '@mui/material/Grid';
3
3
 
4
4
  import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
5
5
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
@@ -1,5 +1,5 @@
1
1
  import { createElement } from 'react';
2
- import Grid from '@material-ui/core/Grid';
2
+ import Grid from '@mui/material/Grid';
3
3
 
4
4
  import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
5
5
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
@@ -1,6 +1,6 @@
1
1
  import { PropsWithChildren, ReactElement } from 'react';
2
- import { Grid, GridSize } from '@material-ui/core';
3
- import { makeStyles } from '@material-ui/core/styles';
2
+ import { Grid } from '@mui/material';
3
+ import makeStyles from '@mui/styles/makeStyles';
4
4
 
5
5
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
6
6
  import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
@@ -35,8 +35,8 @@ export default function {{COMPONENT_CLASS_NAME}}(props: PropsWithChildren<{{COMP
35
35
  // Calculate the size
36
36
  // Default to assume the 2 columns are evenly split. However, override if templateCol
37
37
  // (example value: "1fr 1fr")
38
- let aSize: GridSize = 6;
39
- let bSize: GridSize = 6;
38
+ let aSize = 6;
39
+ let bSize = 6;
40
40
 
41
41
  const colAArray = templateCol
42
42
  .replaceAll(/[a-z]+/g, '')
@@ -44,8 +44,8 @@ export default function {{COMPONENT_CLASS_NAME}}(props: PropsWithChildren<{{COMP
44
44
  .map(itm => Number(itm));
45
45
  const totalCols = colAArray.reduce((v, itm) => itm + v, 0);
46
46
  const ratio = 12 / totalCols;
47
- aSize = (ratio * colAArray[0]) as GridSize;
48
- bSize = (ratio * colAArray[1]) as GridSize;
47
+ aSize = (ratio * colAArray[0]) as number;
48
+ bSize = (ratio * colAArray[1]) as number;
49
49
 
50
50
  return (
51
51
  <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
@@ -1,5 +1,5 @@
1
- import { Grid } from '@material-ui/core';
2
- import { makeStyles } from '@material-ui/core/styles';
1
+ import Grid from '@mui/material/Grid';
2
+ import makeStyles from '@mui/styles/makeStyles';
3
3
 
4
4
  interface OneColumnProps {
5
5
  // If any, enter additional props that only exist on this component
@@ -1,29 +1,30 @@
1
1
  import { useEffect, useRef, useState } from 'react';
2
- import { withStyles, Theme, createStyles } from '@material-ui/core/styles';
3
- import Table from '@material-ui/core/Table';
4
- import TableBody from '@material-ui/core/TableBody';
5
- import TableCell from '@material-ui/core/TableCell';
6
- import TableContainer from '@material-ui/core/TableContainer';
7
- import TableHead from '@material-ui/core/TableHead';
8
- import TableRow from '@material-ui/core/TableRow';
2
+ import { withStyles, createStyles } from '@mui/styles';
3
+ import Table from '@mui/material/Table';
4
+ import TableBody from '@mui/material/TableBody';
5
+ import TableCell from '@mui/material/TableCell';
6
+ import TableContainer from '@mui/material/TableContainer';
7
+ import TableHead from '@mui/material/TableHead';
8
+ import TableRow from '@mui/material/TableRow';
9
9
  import isDeepEqual from 'fast-deep-equal/react';
10
10
 
11
11
  import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
12
12
  import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
13
+
13
14
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
14
15
 
15
16
  interface {{COMPONENT_CLASS_NAME}}Props extends PConnProps {
16
17
  // If any, enter additional props that only exist on this component
17
18
  }
18
19
 
19
- const StyledTableCell = withStyles((theme: Theme) =>
20
+ const StyledTableCell = withStyles((myTheme) =>
20
21
  createStyles({
21
22
  head: {
22
23
  borderWidth: '1px',
23
24
  borderStyle: 'solid',
24
25
  borderColor: 'silver',
25
- backgroundColor: theme.palette.text.disabled,
26
- color: theme.palette.getContrastText(theme.palette.text.disabled)
26
+ backgroundColor: myTheme.palette.text.disabled,
27
+ color: myTheme.palette.getContrastText(myTheme.palette.text.disabled)
27
28
  },
28
29
  body: {
29
30
  borderWidth: '1px',
@@ -1,26 +1,32 @@
1
- import {
2
- Card,
3
- CardContent,
4
- CardHeader,
1
+ import {
2
+ Card,
3
+ CardContent,
4
+ CardHeader,
5
5
  Typography,
6
- CardActions,
6
+ CardActions,
7
7
  Button,
8
8
  TableContainer,
9
9
  Table,
10
10
  TableBody,
11
11
  TableHead,
12
- withStyles,
13
- createStyles,
14
- Theme,
15
12
  TableCell,
16
- TableRow
17
- } from '@material-ui/core';
18
- import { makeStyles } from '@material-ui/core/styles';
13
+ TableRow
14
+ } from '@mui/material';
15
+ import { withStyles, createStyles } from '@mui/styles';
16
+ import makeStyles from '@mui/styles/makeStyles';
19
17
  import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
18
+
20
19
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
21
20
  import isDeepEqual from 'fast-deep-equal/react';
22
21
  import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
23
22
  import { useRef, useEffect, useState } from 'react';
23
+ import { Theme as MuiTheme } from "@mui/material/styles";
24
+
25
+ declare module "@mui/private-theming" {
26
+ interface DefaultTheme extends MuiTheme {
27
+ spacing: (spacing: number) => string;
28
+ }
29
+ }
24
30
 
25
31
  interface {{COMPONENT_CLASS_NAME}}Props extends PConnProps {
26
32
  // If any, enter additional props that only exist on this component
@@ -30,23 +36,23 @@ interface {{COMPONENT_CLASS_NAME}}Props extends PConnProps {
30
36
  whatsnewlink?: string;
31
37
  }
32
38
 
33
- const useStyles = makeStyles(theme => ({
39
+ const useStyles = makeStyles(myTheme => ({
34
40
  root: {
35
- marginTop: theme.spacing(1),
36
- marginBottom: theme.spacing(1),
41
+ marginTop: myTheme.spacing(1),
42
+ marginBottom: myTheme.spacing(1),
37
43
  borderLeft: '6px solid',
38
- borderLeftColor: theme.palette.primary.light
44
+ borderLeftColor: myTheme.palette.primary.light
39
45
  }
40
46
  }));
41
47
 
42
- const StyledTableCell = withStyles((theme: Theme) =>
48
+ const StyledTableCell = withStyles((myTheme) =>
43
49
  createStyles({
44
50
  head: {
45
51
  borderWidth: '1px',
46
52
  borderStyle: 'solid',
47
53
  borderColor: 'silver',
48
- backgroundColor: theme.palette.text.disabled,
49
- color: theme.palette.getContrastText(theme.palette.text.disabled)
54
+ backgroundColor: myTheme.palette.text.disabled,
55
+ color: myTheme.palette.getContrastText(myTheme.palette.text.disabled)
50
56
  },
51
57
  body: {
52
58
  borderWidth: '1px',
@@ -73,7 +79,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
73
79
  const [waitingForData, setWaitingForData] = useState<boolean>(true);
74
80
  const thePConn = getPConnect();
75
81
  const caseID = thePConn.getValue(PCore.getConstants().CASE_INFO.CASE_INFO_ID, ''); // 2nd arg empty string until typedef marked correctly
76
- const dataViewName = 'D_pyWorkHistory';
82
+ const dataViewName = 'D_pyMyWorkList';
77
83
  const context = thePConn.getContextName();
78
84
 
79
85
  const rowData: any = useRef([]);
@@ -1,4 +1,4 @@
1
- // eslint-disable-next-line import/prefer-default-export
1
+
2
2
  export const configProps = {
3
3
  label: 'App announcement',
4
4
  header: 'Announcements',
@@ -1,15 +1,23 @@
1
1
  import React, { useState } from 'react';
2
- import TextField from '@material-ui/core/TextField';
3
- import Popover from '@material-ui/core/Popover';
4
- import Grid from '@material-ui/core/Grid';
5
- import Typography from '@material-ui/core/Typography';
6
- import { makeStyles } from '@material-ui/core/styles';
2
+ import TextField from '@mui/material/TextField';
3
+ import Popover from '@mui/material/Popover';
4
+ import Grid from '@mui/material/Grid';
5
+ import Typography from '@mui/material/Typography';
6
+ import makeStyles from '@mui/styles/makeStyles';
7
+ import { Theme as MuiTheme } from "@mui/material/styles";
7
8
 
8
9
  import Utils from '@pega/react-sdk-components/lib/components/helpers/utils';
9
10
 
10
11
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
12
+
11
13
  import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
12
14
 
15
+ declare module "@mui/private-theming" {
16
+ interface DefaultTheme extends MuiTheme {
17
+ spacing: (spacing: number) => string;
18
+ }
19
+ }
20
+
13
21
  interface {{COMPONENT_CLASS_NAME}}Props extends PConnProps {
14
22
  // If any, enter additional props that only exist on this component
15
23
  label: string;
@@ -22,14 +30,14 @@ interface {{COMPONENT_CLASS_NAME}}Props extends PConnProps {
22
30
  displayLabel?: any;
23
31
  }
24
32
 
25
- const useStyles = makeStyles(theme => ({
33
+ const useStyles = makeStyles(myTheme => ({
26
34
  root: {
27
- padding: theme.spacing(1),
28
- margin: theme.spacing(1)
35
+ padding: myTheme.spacing(1),
36
+ margin: myTheme.spacing(1)
29
37
  },
30
38
  popover: {
31
- padding: theme.spacing(1),
32
- margin: theme.spacing(1)
39
+ padding: myTheme.spacing(1),
40
+ margin: myTheme.spacing(1)
33
41
  }
34
42
  }));
35
43
 
@@ -73,7 +73,7 @@ export default function PegaDxilMyPageWidget(props: PegaDxilMyPageWidgetProps) {
73
73
  const [waitingForData, setWaitingForData] = useState<boolean>(true);
74
74
  const thePConn = getPConnect();
75
75
  const caseID = thePConn.getValue(PCore.getConstants().CASE_INFO.CASE_INFO_ID, ''); // 2nd arg empty string until typedef marked correctly
76
- const dataViewName = 'D_pyWorkHistory';
76
+ const dataViewName = 'D_pyMyWorkList';
77
77
  const context = thePConn.getContextName();
78
78
 
79
79
  const rowData: any = useRef([]);