@pega/dx-component-builder-sdk 0.242.8 → 0.242.9

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 (38) hide show
  1. package/package.json +1 -1
  2. package/src/tasks/create/templates/Constellation/field/Decimal/index.tsx.mustache +3 -6
  3. package/src/tasks/create/templates/Constellation/field/Decimal-Currency/index.tsx.mustache +1 -3
  4. package/src/tasks/create/templates/Constellation/field/Decimal-Percentage/index.tsx.mustache +2 -5
  5. package/src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/index.tsx.mustache +10 -52
  6. package/src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/utils.ts.mustache +1 -1
  7. package/src/tasks/create/templates/Constellation/template/DETAILS/Avatar.tsx.mustache +5 -7
  8. package/src/tasks/create/templates/Constellation/template/DETAILS-region/Avatar.tsx.mustache +5 -7
  9. package/src/tasks/create/templates/Constellation/widget/PAGE-CASE/Avatar.tsx.mustache +5 -7
  10. package/src/tasks/create/templates/SDK-Angular/field/Decimal/decimal.component.ts.mustache +1 -1
  11. package/src/tasks/create/templates/SDK-React/field/Decimal/index.tsx.mustache +1 -1
  12. package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/index.tsx.mustache +1 -1
  13. package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/index.tsx.mustache +1 -1
  14. package/src/tasks/create/templates/SDK-React/template/FORM-region/demo.stories.tsx.mustache +21 -19
  15. package/src/tasks/map/map.js +2 -1
  16. package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/FieldValueList/FieldValueList.tsx +2 -2
  17. package/tests/assets/sdk-r/components/create/override-sdk/field/Phone/Phone.tsx +5 -5
  18. package/tests/assets/sdk-r/components/create/override-sdk/infra/NavBar/NavBar.css +0 -1
  19. package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/ListView.tsx +28 -29
  20. package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +5 -10
  21. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyCurrency/index.tsx +1 -3
  22. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyDecimal/index.tsx +3 -6
  23. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyPercentage/index.tsx +2 -5
  24. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/index.tsx +10 -52
  25. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/utils.ts +1 -1
  26. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/Avatar.tsx +5 -7
  27. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/Avatar.tsx +5 -7
  28. package/tests/assets/sdk-r/components/createAll/custom-constellation/widget/Pega_DXIL_MyPageCaseWidget/Avatar.tsx +5 -7
  29. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/index.tsx +1 -1
  30. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/index.tsx +1 -1
  31. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/index.tsx +1 -1
  32. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPhone/index.tsx +5 -5
  33. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +8 -21
  34. package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/FieldValueList/FieldValueList.tsx +2 -2
  35. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Phone/Phone.tsx +5 -5
  36. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/NavBar/NavBar.css +0 -1
  37. package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/ListView.tsx +28 -29
  38. package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +5 -10
@@ -1,5 +1,5 @@
1
+ import MuiPhoneNumber from 'material-ui-phone-number';
1
2
  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';
@@ -63,12 +63,12 @@ export default function PegaDxilMyPhone(props: PegaDxilMyPhoneProps) {
63
63
  return (
64
64
  <div>
65
65
  <StyledPegaDxilMyPhoneWrapper>
66
- <MuiTelInput
66
+ <MuiPhoneNumber
67
67
  fullWidth
68
68
  helperText={helperTextToDisplay}
69
69
  placeholder={placeholder ?? ''}
70
70
  size='small'
71
- defaultCountry='US'
71
+ defaultCountry='us'
72
72
  required={required}
73
73
  disabled={disabled}
74
74
  onChange={onChange}
@@ -99,13 +99,13 @@ export default function PegaDxilMyPhone(props: PegaDxilMyPhoneProps) {
99
99
 
100
100
  return (
101
101
  <StyledPegaDxilMyPhoneWrapper>
102
- <MuiTelInput
102
+ <MuiPhoneNumber
103
103
  fullWidth
104
104
  variant='outlined'
105
105
  helperText={helperTextToDisplay}
106
106
  placeholder={placeholder ?? ''}
107
107
  size='small'
108
- defaultCountry='US'
108
+ defaultCountry='us'
109
109
  required={required}
110
110
  disabled={disabled}
111
111
  onChange={handleChange}
@@ -2,7 +2,7 @@ import { useState } from 'react';
2
2
  import type { Meta, StoryObj } from '@storybook/react';
3
3
 
4
4
  import { TextField } from '@mui/material';
5
- import { MuiTelInput } from 'mui-tel-input';
5
+ import MuiPhoneNumber from 'material-ui-phone-number';
6
6
  import { DatePicker, LocalizationProvider } from '@mui/x-date-pickers';
7
7
  import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
8
8
  import dayjs from 'dayjs';
@@ -23,14 +23,8 @@ export default meta;
23
23
  type Story = StoryObj<typeof PegaDxilMyTwoColumnForm>;
24
24
 
25
25
  const renderField = resolvedProps => {
26
- const { displayMode, value = '', label = '', readOnly, onChange, onBlur, required, disabled, helperText, placeholder, validatemessage, status, testId } = resolvedProps;
26
+ const { displayMode, value = '', label = '', onChange } = resolvedProps;
27
27
 
28
- const helperTextToDisplay = validatemessage || helperText;
29
- let testProp = {};
30
-
31
- testProp = {
32
- 'data-test-id': testId
33
- };
34
28
  const variant = displayMode === 'DISPLAY_ONLY' ? 'inline' : 'stacked';
35
29
  let val: any = '';
36
30
 
@@ -72,21 +66,15 @@ const renderField = resolvedProps => {
72
66
 
73
67
  if (label === 'Phone Number')
74
68
  val = (
75
- <MuiTelInput
69
+ <MuiPhoneNumber
70
+ value={value}
76
71
  fullWidth
77
72
  variant='outlined'
78
- helperText={helperTextToDisplay}
79
- placeholder={placeholder ?? ''}
80
73
  size='small'
81
- defaultCountry='US'
82
- required={required}
83
- disabled={disabled}
84
- onChange={onChange}
85
- onBlur={!readOnly ? onBlur : undefined}
86
- error={status === 'error'}
74
+ style={{ fontSize: '14px' }}
75
+ defaultCountry='us'
87
76
  label={label}
88
- value={value}
89
- InputProps={{ ...testProp }}
77
+ onChange={onChange}
90
78
  />
91
79
  );
92
80
 
@@ -167,8 +155,7 @@ export const BasePegaDxilMyTwoColumnForm: Story = args => {
167
155
  hasSuggestions: false,
168
156
  onChange: val => {
169
157
  setPhone(val);
170
- },
171
- onBlur: () => {}
158
+ }
172
159
  },
173
160
  {
174
161
  readOnly: undefined,
@@ -51,7 +51,7 @@ export default function FieldValueList(props: FieldValueListProps) {
51
51
 
52
52
  function getGridItemLabel() {
53
53
  return (
54
- <Grid item xs={variant === 'stacked' ? 12 : 4} className={variant === 'stacked' ? classes.noPaddingBottom : ''}>
54
+ <Grid item xs={variant === 'stacked' ? 12 : 6} className={variant === 'stacked' ? classes.noPaddingBottom : ''}>
55
55
  <Typography variant='body2' component='span' className={`${classes.fieldLabel}`}>
56
56
  {name}
57
57
  </Typography>
@@ -63,7 +63,7 @@ export default function FieldValueList(props: FieldValueListProps) {
63
63
  const formattedValue = formatItemValue(value);
64
64
 
65
65
  return (
66
- <Grid item xs={variant === 'stacked' ? 12 : 8} className={variant === 'stacked' ? classes.noPaddingTop : ''}>
66
+ <Grid item xs={variant === 'stacked' ? 12 : 6} className={variant === 'stacked' ? classes.noPaddingTop : ''}>
67
67
  {isHtml ? (
68
68
  // eslint-disable-next-line react/no-danger
69
69
  <div dangerouslySetInnerHTML={{ __html: formattedValue }} />
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useState } from 'react';
2
- import { MuiTelInput } from 'mui-tel-input';
2
+ import MuiPhoneNumber from 'material-ui-phone-number';
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';
@@ -57,12 +57,12 @@ export default function Phone(props: PhoneProps) {
57
57
  const disableDropdown = true;
58
58
  return (
59
59
  <div>
60
- <MuiTelInput
60
+ <MuiPhoneNumber
61
61
  fullWidth
62
62
  helperText={helperTextToDisplay}
63
63
  placeholder={placeholder ?? ''}
64
64
  size='small'
65
- defaultCountry='US'
65
+ defaultCountry='us'
66
66
  required={required}
67
67
  disabled={disabled}
68
68
  onChange={onChange}
@@ -91,13 +91,13 @@ export default function Phone(props: PhoneProps) {
91
91
  };
92
92
 
93
93
  return (
94
- <MuiTelInput
94
+ <MuiPhoneNumber
95
95
  fullWidth
96
96
  variant='outlined'
97
97
  helperText={helperTextToDisplay}
98
98
  placeholder={placeholder ?? ''}
99
99
  size='small'
100
- defaultCountry='US'
100
+ defaultCountry='us'
101
101
  required={required}
102
102
  disabled={disabled}
103
103
  onChange={handleChange}
@@ -165,5 +165,4 @@
165
165
 
166
166
  .scrollable {
167
167
  overflow-y: scroll !important;
168
- min-height: 200px !important;
169
168
  }
@@ -1034,35 +1034,34 @@ export default function ListView(props: ListViewProps) {
1034
1034
  </TableRow>
1035
1035
  </TableHead>
1036
1036
  <TableBody>
1037
- {arRows &&
1038
- stableSort(arRows, getComparator(order, orderBy))
1039
- .slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)
1040
- .map(row => {
1041
- return (
1042
- <TableRow key={row.pxRefObjectInsName || row.pyID}>
1043
- {arColumns.map(column => {
1044
- const value = row[column.id];
1045
- return (
1046
- <TableCell key={column.id} align={column.align} className={classes.cell}>
1047
- {_showButton(column.id, row) || column.displayAsLink ? (
1048
- <Link
1049
- component='button'
1050
- onClick={() => {
1051
- _listViewClick(row, column);
1052
- }}
1053
- underline='hover'
1054
- >
1055
- {column.format && typeof value === 'number' ? column.format(value) : value}
1056
- </Link>
1057
- ) : (
1058
- <>{column.format && typeof value === 'number' ? column.format(value) : value || '---'}</>
1059
- )}
1060
- </TableCell>
1061
- );
1062
- })}
1063
- </TableRow>
1064
- );
1065
- })}
1037
+ {stableSort(arRows, getComparator(order, orderBy))
1038
+ .slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)
1039
+ .map(row => {
1040
+ return (
1041
+ <TableRow key={row.pxRefObjectInsName || row.pyID}>
1042
+ {arColumns.map(column => {
1043
+ const value = row[column.id];
1044
+ return (
1045
+ <TableCell key={column.id} align={column.align} className={classes.cell}>
1046
+ {_showButton(column.id, row) || column.displayAsLink ? (
1047
+ <Link
1048
+ component='button'
1049
+ onClick={() => {
1050
+ _listViewClick(row, column);
1051
+ }}
1052
+ underline='hover'
1053
+ >
1054
+ {column.format && typeof value === 'number' ? column.format(value) : value}
1055
+ </Link>
1056
+ ) : (
1057
+ <>{column.format && typeof value === 'number' ? column.format(value) : value || '---'}</>
1058
+ )}
1059
+ </TableCell>
1060
+ );
1061
+ })}
1062
+ </TableRow>
1063
+ );
1064
+ })}
1066
1065
  </TableBody>
1067
1066
  </Table>
1068
1067
  </TableContainer>
@@ -258,16 +258,11 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
258
258
  function generateRowsData() {
259
259
  // if referenceList is empty and dataPageName property value exists then make a datapage fetch call and get the list of data.
260
260
  if (!referenceList.length && dataPageName) {
261
- getDataPage(dataPageName, parameters, context)
262
- .then(listData => {
263
- const data = formatRowsData(listData);
264
- myRows = data;
265
- setRowData(data);
266
- })
267
- .catch(e => {
268
- // eslint-disable-next-line no-console
269
- console.log(e);
270
- });
261
+ getDataPage(dataPageName, parameters, context).then(listData => {
262
+ const data = formatRowsData(listData);
263
+ myRows = data;
264
+ setRowData(data);
265
+ });
271
266
  } else {
272
267
  // The referenceList prop has the JSON data for each row to be displayed
273
268
  // in the table. So, iterate over referenceList to create the dataRows that