@pega/react-sdk-overrides 8.8.21 → 8.23.11-debug

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 (128) hide show
  1. package/lib/designSystemExtension/AlertBanner/AlertBanner.tsx +9 -13
  2. package/lib/designSystemExtension/Banner/Banner.tsx +1 -12
  3. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +10 -15
  4. package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +11 -10
  5. package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +3 -10
  6. package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +3 -11
  7. package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +3 -11
  8. package/lib/designSystemExtension/Operator/Operator.tsx +12 -16
  9. package/lib/designSystemExtension/Pulse/Pulse.tsx +7 -11
  10. package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +1 -10
  11. package/lib/field/AutoComplete/AutoComplete.tsx +18 -37
  12. package/lib/field/CancelAlert/CancelAlert.tsx +4 -9
  13. package/lib/field/Checkbox/Checkbox.tsx +16 -39
  14. package/lib/field/Currency/Currency.tsx +15 -23
  15. package/lib/field/Currency/currency-utils.ts +5 -1
  16. package/lib/field/Date/Date.tsx +15 -22
  17. package/lib/field/DateTime/DateTime.tsx +14 -25
  18. package/lib/field/Decimal/Decimal.tsx +14 -25
  19. package/lib/field/Dropdown/Dropdown.tsx +26 -30
  20. package/lib/field/Email/Email.tsx +9 -17
  21. package/lib/field/Integer/Integer.tsx +7 -15
  22. package/lib/field/Percentage/Percentage.tsx +7 -15
  23. package/lib/field/Phone/Phone.tsx +11 -19
  24. package/lib/field/RadioButtons/RadioButtons.tsx +37 -25
  25. package/lib/field/SemanticLink/SemanticLink.tsx +25 -26
  26. package/lib/field/TextArea/TextArea.tsx +5 -14
  27. package/lib/field/TextContent/TextContent.tsx +1 -10
  28. package/lib/field/TextInput/TextInput.tsx +6 -15
  29. package/lib/field/Time/Time.tsx +27 -22
  30. package/lib/field/URL/URL.tsx +8 -16
  31. package/lib/field/UserReference/UserReference.tsx +60 -50
  32. package/lib/helpers/attachmentHelpers.ts +4 -4
  33. package/lib/helpers/auth.js +397 -741
  34. package/lib/helpers/authManager.js +634 -0
  35. package/lib/helpers/case-utils.tsx +9 -8
  36. package/lib/helpers/common-utils.ts +1 -1
  37. package/lib/helpers/config_access.js +73 -0
  38. package/lib/helpers/date-format-utils.ts +1 -1
  39. package/lib/helpers/event-utils.ts +1 -1
  40. package/lib/helpers/formatters/Currency.ts +11 -11
  41. package/lib/helpers/formatters/CurrencyMap.ts +5 -8
  42. package/lib/helpers/formatters/Date.ts +1 -1
  43. package/lib/helpers/formatters/common.ts +6 -2
  44. package/lib/helpers/formatters/index.ts +3 -3
  45. package/lib/helpers/simpleTableHelpers.ts +7 -7
  46. package/lib/helpers/state-utils.tsx +3 -0
  47. package/lib/helpers/template-utils.ts +6 -3
  48. package/lib/helpers/versionHelpers.ts +3 -0
  49. package/lib/infra/ActionButtons/ActionButtons.tsx +19 -9
  50. package/lib/infra/Assignment/Assignment.tsx +28 -21
  51. package/lib/infra/AssignmentCard/AssignmentCard.tsx +19 -15
  52. package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +58 -57
  53. package/lib/infra/Containers/FlowContainer/helpers.ts +3 -0
  54. package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +19 -14
  55. package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +25 -14
  56. package/lib/infra/DashboardFilter/DashboardFilter.tsx +21 -13
  57. package/lib/infra/DashboardFilter/filterUtils.tsx +1 -1
  58. package/lib/infra/DeferLoad/DeferLoad.tsx +20 -14
  59. package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +14 -10
  60. package/lib/infra/MultiStep/MultiStep.tsx +22 -22
  61. package/lib/infra/NavBar/NavBar.tsx +21 -14
  62. package/lib/infra/Reference/Reference.tsx +18 -13
  63. package/lib/infra/Region/Region.tsx +6 -8
  64. package/lib/infra/RootContainer/RootContainer.tsx +25 -16
  65. package/lib/infra/Stages/Stages.tsx +8 -10
  66. package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +1 -8
  67. package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +12 -12
  68. package/lib/infra/View/View.tsx +22 -21
  69. package/lib/template/AppShell/AppShell.tsx +25 -36
  70. package/lib/template/BannerPage/BannerPage.tsx +31 -26
  71. package/lib/template/CaseSummary/CaseSummary.tsx +8 -15
  72. package/lib/template/CaseView/CaseView.tsx +25 -24
  73. package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +19 -10
  74. package/lib/template/Confirmation/Confirmation.tsx +53 -27
  75. package/lib/template/DataReference/DataReference.tsx +52 -48
  76. package/lib/template/DefaultForm/DefaultForm.tsx +12 -14
  77. package/lib/template/Details/Details/Details.tsx +17 -16
  78. package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +16 -13
  79. package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +18 -19
  80. package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +18 -20
  81. package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +28 -22
  82. package/lib/template/InlineDashboard/InlineDashboard.tsx +7 -11
  83. package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +17 -19
  84. package/lib/template/ListPage/ListPage.tsx +13 -14
  85. package/lib/template/ListView/ListView.tsx +186 -189
  86. package/lib/template/ListView/utils.ts +23 -170
  87. package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +19 -10
  88. package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +1 -16
  89. package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +18 -19
  90. package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +1 -9
  91. package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +17 -17
  92. package/lib/template/OneColumn/OneColumn/OneColumn.tsx +7 -8
  93. package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +10 -10
  94. package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +7 -5
  95. package/lib/template/PromotedFilters/PromotedFilters.tsx +14 -16
  96. package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +8 -102
  97. package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +7 -24
  98. package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +33 -23
  99. package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +36 -34
  100. package/lib/template/SubTabs/SubTabs.tsx +11 -10
  101. package/lib/template/SubTabs/tabUtils.ts +4 -0
  102. package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +15 -10
  103. package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +10 -10
  104. package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +12 -10
  105. package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +3 -17
  106. package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +25 -35
  107. package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +1 -7
  108. package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +17 -15
  109. package/lib/template/WssNavBar/WssNavBar.tsx +1 -18
  110. package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +21 -13
  111. package/lib/widget/Attachment/Attachment.tsx +16 -28
  112. package/lib/widget/CaseHistory/CaseHistory.tsx +10 -12
  113. package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +1 -13
  114. package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +22 -35
  115. package/lib/widget/Followers/Followers.tsx +11 -10
  116. package/lib/widget/QuickCreate/QuickCreate.tsx +5 -11
  117. package/lib/widget/SummaryItem/SummaryItem.tsx +1 -11
  118. package/lib/widget/SummaryList/SummaryList.tsx +3 -17
  119. package/lib/widget/ToDo/ToDo.tsx +105 -62
  120. package/package.json +1 -1
  121. package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +0 -121
  122. package/lib/designSystemExtension/RichTextEditor/index.tsx +0 -1
  123. package/lib/field/RichText/RichText.tsx +0 -93
  124. package/lib/field/RichText/index.tsx +0 -1
  125. package/lib/field/ScalarList/ScalarList.tsx +0 -64
  126. package/lib/field/ScalarList/config-ext.json +0 -8
  127. package/lib/field/ScalarList/index.tsx +0 -1
  128. package/lib/helpers/authManager.ts +0 -933
@@ -1,16 +1,8 @@
1
1
  import React from 'react';
2
2
  import MuiPhoneNumber from 'material-ui-phone-number';
3
- import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
4
- import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
-
6
- interface PhoneProps extends PConnFieldProps {
7
- // If any, enter additional props that only exist on Phone here
8
- }
9
-
10
- export default function Phone(props: PhoneProps) {
11
- // Get emitted components from map (so we can get any override that may exist)
12
- const FieldValueList = getComponentFromMap('FieldValueList');
3
+ import FieldValueList from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldValueList';
13
4
 
5
+ export default function Phone(props) {
14
6
  const {
15
7
  label,
16
8
  required,
@@ -39,7 +31,7 @@ export default function Phone(props: PhoneProps) {
39
31
  }
40
32
 
41
33
  if (displayMode === 'STACKED_LARGE_VAL') {
42
- return <FieldValueList name={hideLabel ? '' : label} value={value} variant="stacked" />;
34
+ return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;
43
35
  }
44
36
 
45
37
  if (readOnly) {
@@ -49,8 +41,8 @@ export default function Phone(props: PhoneProps) {
49
41
  <MuiPhoneNumber
50
42
  fullWidth
51
43
  helperText={helperTextToDisplay}
52
- placeholder=""
53
- size="small"
44
+ placeholder=''
45
+ size='small'
54
46
  required={required}
55
47
  disabled={disabled}
56
48
  onChange={onChange}
@@ -67,13 +59,13 @@ export default function Phone(props: PhoneProps) {
67
59
  );
68
60
  }
69
61
 
70
- const handleChange = (inputVal) => {
62
+ const handleChange = inputVal => {
71
63
  let phoneValue = inputVal && inputVal.replace(/\D+/g, '');
72
64
  phoneValue = `+${phoneValue}`;
73
65
  onChange({ value: phoneValue });
74
66
  };
75
67
 
76
- const handleBlur = (event) => {
68
+ const handleBlur = event => {
77
69
  const phoneValue = event?.target?.value;
78
70
  event.target.value = `+${phoneValue && phoneValue.replace(/\D+/g, '')}`;
79
71
  onBlur(event);
@@ -82,11 +74,11 @@ export default function Phone(props: PhoneProps) {
82
74
  return (
83
75
  <MuiPhoneNumber
84
76
  fullWidth
85
- variant="outlined"
77
+ variant='outlined'
86
78
  helperText={helperTextToDisplay}
87
- placeholder=""
88
- size="small"
89
- defaultCountry="us"
79
+ placeholder=''
80
+ size='small'
81
+ defaultCountry='us'
90
82
  required={required}
91
83
  disabled={disabled}
92
84
  onChange={handleChange}
@@ -1,21 +1,18 @@
1
1
  import React, { useState, useEffect } from 'react';
2
- import { Radio, RadioGroup, FormControl, FormControlLabel, FormLabel, FormHelperText } from '@material-ui/core';
2
+ import {
3
+ Radio,
4
+ RadioGroup,
5
+ FormControl,
6
+ FormControlLabel,
7
+ FormLabel,
8
+ FormHelperText
9
+ } from '@material-ui/core';
3
10
 
4
11
  import Utils from '@pega/react-sdk-components/lib/components/helpers/utils';
5
12
  import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
6
- import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
7
- import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
8
-
9
- interface RadioButtonsProps extends PConnFieldProps {
10
- // If any, enter additional props that only exist on RadioButtons here
11
- inline: boolean;
12
- fieldMetadata?: any;
13
- }
14
-
15
- export default function RadioButtons(props: RadioButtonsProps) {
16
- // Get emitted components from map (so we can get any override that may exist)
17
- const FieldValueList = getComponentFromMap('FieldValueList');
13
+ import FieldValueList from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldValueList';
18
14
 
15
+ export default function RadioButtons(props) {
19
16
  const {
20
17
  getPConnect,
21
18
  label,
@@ -43,7 +40,9 @@ export default function RadioButtons(props: RadioButtonsProps) {
43
40
  configProperty = configProperty.startsWith('@P') ? configProperty.substring(3) : configProperty;
44
41
  configProperty = configProperty.startsWith('.') ? configProperty.substring(1) : configProperty;
45
42
 
46
- const metaData = Array.isArray(fieldMetadata) ? fieldMetadata.filter((field) => field?.classID === className)[0] : fieldMetadata;
43
+ const metaData = Array.isArray(fieldMetadata)
44
+ ? fieldMetadata.filter(field => field?.classID === className)[0]
45
+ : fieldMetadata;
47
46
  let displayName = metaData?.datasource?.propertyForDisplayText;
48
47
  displayName = displayName?.slice(displayName.lastIndexOf('.') + 1);
49
48
  const localeContext = metaData?.datasource?.tableType === 'DataPage' ? 'datapage' : 'associated';
@@ -53,7 +52,7 @@ export default function RadioButtons(props: RadioButtonsProps) {
53
52
 
54
53
  // theOptions will be an array of JSON objects that are literally key/value pairs.
55
54
  // Ex: [ {key: "Basic", value: "Basic"} ]
56
- const theOptions = Utils.getOptionList(theConfigProps, thePConn.getDataObject(thePConn.getContextName()));
55
+ const theOptions = Utils.getOptionList(theConfigProps, thePConn.getDataObject());
57
56
 
58
57
  useEffect(() => {
59
58
  // This update theSelectedButton which will update the UI to show the selected button correctly
@@ -64,7 +63,11 @@ export default function RadioButtons(props: RadioButtonsProps) {
64
63
  return (
65
64
  <FieldValueList
66
65
  name={hideLabel ? '' : label}
67
- value={thePConn.getLocalizedValue(value, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))}
66
+ value={thePConn.getLocalizedValue(
67
+ value,
68
+ localePath,
69
+ thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)
70
+ )}
68
71
  />
69
72
  );
70
73
  }
@@ -73,25 +76,34 @@ export default function RadioButtons(props: RadioButtonsProps) {
73
76
  return (
74
77
  <FieldValueList
75
78
  name={hideLabel ? '' : label}
76
- value={thePConn.getLocalizedValue(value, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))}
77
- variant="stacked"
79
+ value={thePConn.getLocalizedValue(
80
+ value,
81
+ localePath,
82
+ thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)
83
+ )}
84
+ variant='stacked'
78
85
  />
79
86
  );
80
87
  }
81
88
 
82
- const handleChange = (event) => {
89
+ const handleChange = event => {
83
90
  handleEvent(actionsApi, 'changeNblur', propName, event.target.value);
84
91
  };
85
92
 
86
- const handleBlur = (event) => {
87
- thePConn.getValidationApi().validate(event.target.value, ''); // 2nd arg empty string until typedef marked correctly as optional
93
+ const handleBlur = event => {
94
+ thePConn.getValidationApi().validate(event.target.value);
88
95
  };
89
96
 
90
97
  return (
91
98
  <FormControl error={status === 'error'} required={required}>
92
- <FormLabel component="legend">{label}</FormLabel>
93
- <RadioGroup value={theSelectedButton} onChange={handleChange} onBlur={!readOnly ? handleBlur : undefined} row={inline}>
94
- {theOptions.map((theOption) => {
99
+ <FormLabel component='legend'>{label}</FormLabel>
100
+ <RadioGroup
101
+ value={theSelectedButton}
102
+ onChange={handleChange}
103
+ onBlur={!readOnly ? handleBlur : undefined}
104
+ row={inline}
105
+ >
106
+ {theOptions.map(theOption => {
95
107
  return (
96
108
  <FormControlLabel
97
109
  value={theOption.key}
@@ -101,7 +113,7 @@ export default function RadioButtons(props: RadioButtonsProps) {
101
113
  localePath,
102
114
  thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)
103
115
  )}
104
- control={<Radio key={theOption.key} color="primary" disabled={readOnly} />}
116
+ control={<Radio key={theOption.key} color='primary' disabled={readOnly} />}
105
117
  />
106
118
  );
107
119
  })}
@@ -1,9 +1,9 @@
1
- import React from 'react';
1
+ import React from "react";
2
+ import PropTypes from "prop-types";
2
3
  import Typography from '@material-ui/core/Typography';
3
4
  import Grid from '@material-ui/core/Grid';
4
5
  import { makeStyles } from '@material-ui/core/styles';
5
- import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
6
- import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
6
+ import FieldValueList from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldValueList';
7
7
 
8
8
  /* although this is called the SemanticLink component, we are not yet displaying as a
9
9
  SemanticLink in SDK and only showing the value as a read only text field. */
@@ -17,7 +17,7 @@ const useStyles = makeStyles((theme) => ({
17
17
  marginRight: theme.spacing(1),
18
18
  marginLeft: theme.spacing(1),
19
19
  marginTop: theme.spacing(1),
20
- marginBottom: theme.spacing(1)
20
+ marginBottom: theme.spacing(1),
21
21
  },
22
22
  fieldMargin: {
23
23
  paddingRight: theme.spacing(1),
@@ -27,7 +27,7 @@ const useStyles = makeStyles((theme) => ({
27
27
  marginRight: theme.spacing(1),
28
28
  marginLeft: theme.spacing(1),
29
29
  marginTop: theme.spacing(1),
30
- marginBottom: theme.spacing(1)
30
+ marginBottom: theme.spacing(1),
31
31
  },
32
32
  fieldLabel: {
33
33
  fontWeight: 400,
@@ -39,38 +39,37 @@ const useStyles = makeStyles((theme) => ({
39
39
  }
40
40
  }));
41
41
 
42
- interface SemanticLinkProps extends PConnFieldProps {
43
- // If any, enter additional props that only exist on SemanticLink here
44
- // from previous PropTypes
45
- text: string;
46
- }
47
-
48
- export default function SemanticLink(props: SemanticLinkProps) {
49
- // Get emitted components from map (so we can get any override that may exist)
50
- const FieldValueList = getComponentFromMap('FieldValueList');
51
-
52
- const { text, displayMode, label, hideLabel } = props;
42
+ export default function SemanticLink(props) {
43
+ const {
44
+ text,
45
+ displayMode,
46
+ label,
47
+ hideLabel
48
+ } = props;
53
49
  const classes = useStyles();
54
50
 
55
- if (displayMode === 'LABELS_LEFT' || (!displayMode && label !== undefined)) {
56
- const value = text || '---';
51
+
52
+ if (displayMode === "LABELS_LEFT" || (!displayMode && label !== undefined)) {
53
+ const value = text || "---";
57
54
  return (
58
- <Grid container spacing={1} style={{ padding: '4px 0px' }} id="semantic-link-grid">
55
+ <Grid container spacing={1} style={{padding: "4px 0px"}} id="semantic-link-grid">
59
56
  <Grid item xs={6}>
60
- <Typography variant="body2" component="span" className={`${classes.fieldLabel} ${classes.fieldMargin}`}>
61
- {label}
62
- </Typography>
57
+ <Typography variant="body2" component="span" className={`${classes.fieldLabel} ${classes.fieldMargin}`}>{label}</Typography>
63
58
  </Grid>
64
59
  <Grid item xs={6}>
65
- <Typography variant="body2" component="span" className={classes.fieldValue}>
66
- {value}
67
- </Typography>
60
+ <Typography variant="body2" component="span" className={classes.fieldValue}>{value}</Typography>
68
61
  </Grid>
69
62
  </Grid>
70
63
  );
71
64
  }
72
65
 
73
66
  if (displayMode === 'STACKED_LARGE_VAL') {
74
- return <FieldValueList name={hideLabel ? '' : label} value={text} variant="stacked" />;
67
+ return <FieldValueList name={hideLabel ? '' : label} value={text} variant='stacked' />;
75
68
  }
76
69
  }
70
+
71
+ SemanticLink.propTypes = {
72
+ text: PropTypes.string.isRequired,
73
+ displayMode: PropTypes.string,
74
+ label: PropTypes.string,
75
+ };
@@ -1,17 +1,8 @@
1
1
  import React from 'react';
2
2
  import { TextField } from '@material-ui/core';
3
- import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
4
- import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
-
6
- interface TextAreaProps extends PConnFieldProps {
7
- // If any, enter additional props that only exist on TextArea here
8
- fieldMetadata?: any;
9
- }
10
-
11
- export default function TextArea(props: TextAreaProps) {
12
- // Get emitted components from map (so we can get any override that may exist)
13
- const FieldValueList = getComponentFromMap('FieldValueList');
3
+ import FieldValueList from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldValueList';
14
4
 
5
+ export default function TextArea(props) {
15
6
  const {
16
7
  label,
17
8
  required,
@@ -39,7 +30,7 @@ export default function TextArea(props: TextAreaProps) {
39
30
  }
40
31
 
41
32
  if (displayMode === 'STACKED_LARGE_VAL') {
42
- return <FieldValueList name={hideLabel ? '' : label} value={value} variant="stacked" />;
33
+ return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;
43
34
  }
44
35
 
45
36
  if (readOnly) {
@@ -62,8 +53,8 @@ export default function TextArea(props: TextAreaProps) {
62
53
  fullWidth
63
54
  variant={readOnly ? 'standard' : 'outlined'}
64
55
  helperText={helperTextToDisplay}
65
- placeholder=""
66
- size="small"
56
+ placeholder=''
57
+ size='small'
67
58
  required={required}
68
59
  disabled={disabled}
69
60
  onChange={onChange}
@@ -1,16 +1,7 @@
1
1
  import React from 'react';
2
2
  import { Typography } from '@material-ui/core';
3
- import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
4
3
 
5
- interface TextContentProps extends PConnProps {
6
- // If any, enter additional props that only exist on TextContent here
7
- content: string,
8
- displayAs: 'Paragraph' | 'Heading 1' | 'Heading 2' | 'Heading 3' | 'Heading 4'
9
- }
10
-
11
-
12
-
13
- export default function TextContent(props: TextContentProps) {
4
+ export default function TextContent(props) {
14
5
  type ExpectedDisplayAs = 'Paragraph' | 'Heading 1' | 'Heading 2' | 'Heading 3' | 'Heading 4';
15
6
  type ExpectedVariants = 'body1' | 'h1' | 'h2' | 'h3' | 'h4';
16
7
 
@@ -1,18 +1,9 @@
1
1
  import React, { useState, useEffect } from 'react';
2
2
  import { TextField } from '@material-ui/core';
3
+ import FieldValueList from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldValueList';
3
4
  import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
4
- import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
5
- import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
6
-
7
- interface TextInputProps extends PConnFieldProps {
8
- // If any, enter additional props that only exist on TextInput here
9
- fieldMetadata?: any;
10
- }
11
-
12
- export default function TextInput(props: TextInputProps) {
13
- // Get emitted components from map (so we can get any override that may exist)
14
- const FieldValueList = getComponentFromMap('FieldValueList');
15
5
 
6
+ export default function TextInput(props) {
16
7
  const {
17
8
  getPConnect,
18
9
  label,
@@ -36,7 +27,7 @@ export default function TextInput(props: TextInputProps) {
36
27
 
37
28
  const helperTextToDisplay = validatemessage || helperText;
38
29
 
39
- const [inputValue, setInputValue] = useState('');
30
+ const [inputValue, setInputValue] = useState();
40
31
  const maxLength = fieldMetadata?.maxLength;
41
32
 
42
33
  let readOnlyProp = {}; // Note: empty if NOT ReadOnly
@@ -50,7 +41,7 @@ export default function TextInput(props: TextInputProps) {
50
41
  }
51
42
 
52
43
  if (displayMode === 'STACKED_LARGE_VAL') {
53
- return <FieldValueList name={hideLabel ? '' : label} value={value} variant="stacked" />;
44
+ return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;
54
45
  }
55
46
 
56
47
  if (readOnly) {
@@ -77,8 +68,8 @@ export default function TextInput(props: TextInputProps) {
77
68
  fullWidth
78
69
  variant={readOnly ? 'standard' : 'outlined'}
79
70
  helperText={helperTextToDisplay}
80
- placeholder=""
81
- size="small"
71
+ placeholder=''
72
+ size='small'
82
73
  required={required}
83
74
  disabled={disabled}
84
75
  onChange={handleChange}
@@ -1,20 +1,25 @@
1
1
  import React from 'react';
2
2
  import { KeyboardTimePicker } from '@material-ui/pickers';
3
- import AccessTimeIcon from '@material-ui/icons/AccessTime';
3
+ import TextInput from '@pega/react-sdk-components/lib/components/field/TextInput';
4
4
  import dayjs from 'dayjs';
5
- import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
6
- import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
7
-
8
- interface TimeProps extends PConnFieldProps {
9
- // If any, enter additional props that only exist on Time here
10
- }
11
-
12
- export default function Time(props: TimeProps) {
13
- // Get emitted components from map (so we can get any override that may exist)
14
- const FieldValueList = getComponentFromMap('FieldValueList');
15
- const TextInput = getComponentFromMap('TextInput');
5
+ import AccessTimeIcon from '@material-ui/icons/AccessTime';
6
+ import FieldValueList from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldValueList';
16
7
 
17
- const { label, required, disabled, value = '', validatemessage, status, onChange, readOnly, helperText, displayMode, hideLabel, testId } = props;
8
+ export default function Time(props) {
9
+ const {
10
+ label,
11
+ required,
12
+ disabled,
13
+ value,
14
+ validatemessage,
15
+ status,
16
+ onChange,
17
+ readOnly,
18
+ helperText,
19
+ displayMode,
20
+ hideLabel,
21
+ testId
22
+ } = props;
18
23
  const helperTextToDisplay = validatemessage || helperText;
19
24
 
20
25
  if (displayMode === 'LABELS_LEFT') {
@@ -22,7 +27,7 @@ export default function Time(props: TimeProps) {
22
27
  }
23
28
 
24
29
  if (displayMode === 'STACKED_LARGE_VAL') {
25
- return <FieldValueList name={hideLabel ? '' : label} value={value} variant="stacked" />;
30
+ return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;
26
31
  }
27
32
 
28
33
  if (readOnly) {
@@ -35,14 +40,14 @@ export default function Time(props: TimeProps) {
35
40
  'data-test-id': testId
36
41
  };
37
42
 
38
- const handleChange = (date) => {
43
+ const handleChange = date => {
39
44
  const theValue = date && date.isValid() ? date.format('HH:mm') : null;
40
45
  onChange({ value: theValue });
41
46
  };
42
47
 
43
48
  let timeValue: any = null;
44
49
  if (value) {
45
- const timeArray = value.split(':').map((itm) => Number(itm));
50
+ const timeArray = value.split(':').map(itm => Number(itm));
46
51
  timeValue = dayjs().hour(timeArray[0]).minute(timeArray[1]);
47
52
  }
48
53
 
@@ -53,9 +58,9 @@ export default function Time(props: TimeProps) {
53
58
 
54
59
  return (
55
60
  <KeyboardTimePicker
56
- variant="inline"
57
- inputVariant="outlined"
58
- placeholder="hh:mm am"
61
+ variant='inline'
62
+ inputVariant='outlined'
63
+ placeholder='hh:mm am'
59
64
  keyboardIcon={<AccessTimeIcon />}
60
65
  fullWidth
61
66
  required={required}
@@ -63,11 +68,11 @@ export default function Time(props: TimeProps) {
63
68
  error={status === 'error'}
64
69
  helperText={helperTextToDisplay}
65
70
  minutesStep={5}
66
- size="small"
71
+ size='small'
67
72
  label={label}
68
73
  autoOk
69
- mask="__:__ _m"
70
- format="hh:mm a"
74
+ mask='__:__ _m'
75
+ format='hh:mm a'
71
76
  value={timeValue}
72
77
  onChange={handleChange}
73
78
  InputProps={{ inputProps: { ...testProp } }}
@@ -1,20 +1,12 @@
1
1
  import React from 'react';
2
2
  import { TextField } from '@material-ui/core';
3
- import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
4
- import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
-
6
- interface URLComponentProps extends PConnFieldProps {
7
- // If any, enter additional props that only exist on URLComponent here
8
- }
3
+ import TextInput from '@pega/react-sdk-components/lib/components/field/TextInput';
4
+ import FieldValueList from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldValueList';
9
5
 
10
6
  // NOTE: that we had to change the name from URL to URLComponent
11
7
  // Otherwise, we were getting all kinds of weird errors when we
12
8
  // referred to URL as a component.
13
- export default function URLComponent(props: URLComponentProps) {
14
- // Get emitted components from map (so we can get any override that may exist)
15
- const FieldValueList = getComponentFromMap('FieldValueList');
16
- const TextInput = getComponentFromMap('TextInput');
17
-
9
+ export default function URLComponent(props) {
18
10
  const {
19
11
  label,
20
12
  required,
@@ -37,7 +29,7 @@ export default function URLComponent(props: URLComponentProps) {
37
29
  }
38
30
 
39
31
  if (displayMode === 'STACKED_LARGE_VAL') {
40
- return <FieldValueList name={hideLabel ? '' : label} value={value} variant="stacked" />;
32
+ return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;
41
33
  }
42
34
 
43
35
  if (readOnly) {
@@ -52,12 +44,12 @@ export default function URLComponent(props: URLComponentProps) {
52
44
 
53
45
  return (
54
46
  <TextField
55
- type="url"
47
+ type='url'
56
48
  fullWidth
57
- variant="outlined"
49
+ variant='outlined'
58
50
  helperText={helperTextToDisplay}
59
- placeholder=""
60
- size="small"
51
+ placeholder=''
52
+ size='small'
61
53
  required={required}
62
54
  disabled={disabled}
63
55
  onChange={onChange}