@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,22 +1,14 @@
1
1
  import React, { useState, useEffect } from 'react';
2
+ // import { TextField } from "@material-ui/core";
2
3
  import CurrencyTextField from '@unicef/material-ui-currency-textfield';
3
4
  import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
4
- import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
5
+ import FieldValueList from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldValueList';
6
+ import { format } from "@pega/react-sdk-components/lib/components/helpers/formatters";
5
7
  import { getCurrencyCharacters, getCurrencyOptions } from './currency-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
8
 
9
9
  // Using control from: https://github.com/unicef/material-ui-currency-textfield
10
10
 
11
- interface CurrrencyProps extends PConnFieldProps {
12
- // If any, enter additional props that only exist on Currency here
13
- currencyISOCode?: string;
14
- }
15
-
16
- export default function Currency(props: CurrrencyProps) {
17
- // Get emitted components from map (so we can get any override that may exist)
18
- const FieldValueList = getComponentFromMap('FieldValueList');
19
-
11
+ export default function Currency(props) {
20
12
  const {
21
13
  getPConnect,
22
14
  label,
@@ -31,7 +23,7 @@ export default function Currency(props: CurrrencyProps) {
31
23
  helperText,
32
24
  displayMode,
33
25
  hideLabel,
34
- currencyISOCode = 'USD'
26
+ currencyISOCode = "USD"
35
27
  } = props;
36
28
 
37
29
  const pConn = getPConnect();
@@ -53,10 +45,10 @@ export default function Currency(props: CurrrencyProps) {
53
45
  'data-test-id': testId
54
46
  };
55
47
 
56
- const [currValue, setCurrValue] = useState('');
57
- const [theCurrSym, setCurrSym] = useState('$');
58
- const [theCurrDec, setCurrDec] = useState('.');
59
- const [theCurrSep, setCurrSep] = useState(',');
48
+ const [currValue, setCurrValue] = useState();
49
+ const [theCurrSym, setCurrSym] = useState("$");
50
+ const [theCurrDec, setCurrDec] = useState(".");
51
+ const [theCurrSep, setCurrSep] = useState(",");
60
52
 
61
53
  useEffect(() => {
62
54
  // currencySymbols looks like this: { theCurrencySymbol: '$', theDecimalIndicator: '.', theSeparator: ',' }
@@ -79,7 +71,7 @@ export default function Currency(props: CurrrencyProps) {
79
71
  }
80
72
 
81
73
  if (displayMode === 'STACKED_LARGE_VAL') {
82
- return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} variant="stacked" />;
74
+ return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} variant='stacked' />;
83
75
  }
84
76
 
85
77
  // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
@@ -102,8 +94,8 @@ export default function Currency(props: CurrrencyProps) {
102
94
  fullWidth
103
95
  variant={readOnly ? 'standard' : 'outlined'}
104
96
  helperText={helperTextToDisplay}
105
- placeholder=""
106
- size="small"
97
+ placeholder=''
98
+ size='small'
107
99
  required={required}
108
100
  disabled={disabled}
109
101
  onChange={currOnChange}
@@ -111,9 +103,9 @@ export default function Currency(props: CurrrencyProps) {
111
103
  error={status === 'error'}
112
104
  label={label}
113
105
  value={currValue}
114
- type="text"
115
- outputFormat="number"
116
- textAlign="left"
106
+ type='text'
107
+ outputFormat='number'
108
+ textAlign='left'
117
109
  InputProps={{ ...readOnlyProp, inputProps: { ...testProp, value: currValue } }}
118
110
  currencySymbol={theCurrSym}
119
111
  decimalCharacter={theCurrDec}
@@ -3,10 +3,14 @@ import { default as CurrencyAlias} from '@pega/react-sdk-components/lib/componen
3
3
  // eslint-disable-next-line import/no-named-default
4
4
  import { default as CurrencyMapAlias } from '@pega/react-sdk-components/lib/components/helpers/formatters/CurrencyMap';
5
5
 
6
+ import PCoreType from '@pega/pcore-pconnect-typedefs/types/pcore';
7
+
8
+ declare const PCore: typeof PCoreType;
9
+
6
10
 
7
11
  export const getCurrencyOptions = (inISOCode: string) => {
8
12
 
9
- const operatorLocale = PCore.getEnvironmentInfo().getUseLocale() || PCore.getEnvironmentInfo().getLocale() || 'en-US';
13
+ const operatorLocale = PCore.getEnvironmentInfo().getUseLocale() || 'en-US';
10
14
 
11
15
  let currMapToUse = CurrencyMapAlias.US;
12
16
  let localeToUse = operatorLocale;
@@ -1,25 +1,17 @@
1
1
  import React from 'react';
2
2
  import { KeyboardDatePicker } from '@material-ui/pickers';
3
+ import TextInput from '@pega/react-sdk-components/lib/components/field/TextInput';
3
4
  import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
5
+ import FieldValueList from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldValueList';
4
6
  import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
5
- import { dateFormatInfoDefault, getDateFormatInfo } from '@pega/react-sdk-components/lib/components/helpers/date-format-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';
7
+ import { dateFormatInfoDefault, getDateFormatInfo} from '@pega/react-sdk-components/lib/components/helpers/date-format-utils';
8
8
 
9
9
  // Will return the date string in YYYY-MM-DD format which we'll be POSTing to the server
10
- function getFormattedDate(date) {
10
+ function getFormattedDate(date){
11
11
  return `${date.$y.toString()}-${(date.$M + 1).toString().padStart(2, '0')}-${date.$D.toString().padStart(2, '0')}`;
12
12
  }
13
13
 
14
- interface DateProps extends PConnFieldProps {
15
- // If any, enter additional props that only exist on Date here
16
- }
17
-
18
- export default function Date(props: DateProps) {
19
- // Get emitted components from map (so we can get any override that may exist)
20
- const TextInput = getComponentFromMap('TextInput');
21
- const FieldValueList = getComponentFromMap('FieldValueList');
22
-
14
+ export default function Date(props) {
23
15
  const {
24
16
  getPConnect,
25
17
  label,
@@ -45,11 +37,12 @@ export default function Date(props: DateProps) {
45
37
  // Start with default dateFormatInfo
46
38
  const dateFormatInfo = dateFormatInfoDefault;
47
39
  // and then update, as needed, based on locale, etc.
48
- const theDateFormat = getDateFormatInfo();
40
+ const theDateFormat = getDateFormatInfo()
49
41
  dateFormatInfo.dateFormatString = theDateFormat.dateFormatString;
50
42
  dateFormatInfo.dateFormatStringLC = theDateFormat.dateFormatStringLC;
51
43
  dateFormatInfo.dateFormatMask = theDateFormat.dateFormatMask;
52
44
 
45
+
53
46
  if (displayMode === 'LABELS_LEFT') {
54
47
  const formattedDate = format(props.value, 'date', { format: dateFormatInfo.dateFormatString });
55
48
  return <FieldValueList name={hideLabel ? '' : label} value={formattedDate} />;
@@ -57,7 +50,7 @@ export default function Date(props: DateProps) {
57
50
 
58
51
  if (displayMode === 'STACKED_LARGE_VAL') {
59
52
  const formattedDate = format(props.value, 'date', { format: dateFormatInfo.dateFormatString });
60
- return <FieldValueList name={hideLabel ? '' : label} value={formattedDate} variant="stacked" />;
53
+ return <FieldValueList name={hideLabel ? '' : label} value={formattedDate} variant='stacked' />;
61
54
  }
62
55
 
63
56
  if (readOnly) {
@@ -71,14 +64,14 @@ export default function Date(props: DateProps) {
71
64
  'data-test-id': testId
72
65
  };
73
66
 
74
- const handleChange = (date) => {
75
- if (date && date.isValid()) {
67
+ const handleChange = date => {
68
+ if(date && date.isValid()){
76
69
  onChange({ value: getFormattedDate(date) });
77
70
  }
78
71
  };
79
72
 
80
- const handleAccept = (date) => {
81
- if (date && date.isValid()) {
73
+ const handleAccept = date => {
74
+ if(date && date.isValid()){
82
75
  handleEvent(actions, 'changeNblur', propName, getFormattedDate(date));
83
76
  }
84
77
  };
@@ -86,8 +79,8 @@ export default function Date(props: DateProps) {
86
79
  return (
87
80
  <KeyboardDatePicker
88
81
  disableToolbar
89
- variant="inline"
90
- inputVariant="outlined"
82
+ variant='inline'
83
+ inputVariant='outlined'
91
84
  placeholder={dateFormatInfo.dateFormatStringLC}
92
85
  format={dateFormatInfo.dateFormatString}
93
86
  mask={dateFormatInfo.dateFormatMask}
@@ -97,7 +90,7 @@ export default function Date(props: DateProps) {
97
90
  disabled={disabled}
98
91
  error={status === 'error'}
99
92
  helperText={helperTextToDisplay}
100
- size="small"
93
+ size='small'
101
94
  label={label}
102
95
  value={value || null}
103
96
  onChange={handleChange}
@@ -1,20 +1,12 @@
1
1
  import React from 'react';
2
2
  import { KeyboardDateTimePicker } from '@material-ui/pickers';
3
+ import TextInput from '@pega/react-sdk-components/lib/components/field/TextInput';
3
4
  import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
5
+ import FieldValueList from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldValueList';
4
6
  import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
5
- import { dateFormatInfoDefault, getDateFormatInfo } from '@pega/react-sdk-components/lib/components/helpers/date-format-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 DateTimeProps extends PConnFieldProps {
10
- // If any, enter additional props that only exist on DateTime here
11
- }
12
-
13
- export default function DateTime(props: DateTimeProps) {
14
- // Get emitted components from map (so we can get any override that may exist)
15
- const TextInput = getComponentFromMap('TextInput');
16
- const FieldValueList = getComponentFromMap('FieldValueList');
7
+ import { dateFormatInfoDefault, getDateFormatInfo} from '@pega/react-sdk-components/lib/components/helpers/date-format-utils';
17
8
 
9
+ export default function DateTime(props) {
18
10
  const {
19
11
  getPConnect,
20
12
  label,
@@ -39,23 +31,20 @@ export default function DateTime(props: DateTimeProps) {
39
31
  // Start with default dateFormatInfo
40
32
  const dateFormatInfo = dateFormatInfoDefault;
41
33
  // and then update, as needed, based on locale, etc.
42
- const theDateFormat = getDateFormatInfo();
34
+ const theDateFormat = getDateFormatInfo()
43
35
  dateFormatInfo.dateFormatString = theDateFormat.dateFormatString;
44
36
  dateFormatInfo.dateFormatStringLC = theDateFormat.dateFormatStringLC;
45
37
  dateFormatInfo.dateFormatMask = theDateFormat.dateFormatMask;
46
38
 
39
+
47
40
  if (displayMode === 'LABELS_LEFT') {
48
- const formattedDateTime = format(props.value, 'datetime', {
49
- format: `${dateFormatInfo.dateFormatString} hh:mm a`
50
- });
41
+ const formattedDateTime = format(props.value, 'datetime', { format: `${dateFormatInfo.dateFormatString} hh:mm a` });
51
42
  return <FieldValueList name={hideLabel ? '' : label} value={formattedDateTime} />;
52
43
  }
53
44
 
54
45
  if (displayMode === 'STACKED_LARGE_VAL') {
55
- const formattedDateTime = format(props.value, 'datetime', {
56
- format: `${dateFormatInfo.dateFormatString} hh:mm a`
57
- });
58
- return <FieldValueList name={hideLabel ? '' : label} value={formattedDateTime} variant="stacked" />;
46
+ const formattedDateTime = format(props.value, 'datetime', { format: `${dateFormatInfo.dateFormatString} hh:mm a` });
47
+ return <FieldValueList name={hideLabel ? '' : label} value={formattedDateTime} variant='stacked' />;
59
48
  }
60
49
 
61
50
  if (readOnly) {
@@ -63,12 +52,12 @@ export default function DateTime(props: DateTimeProps) {
63
52
  return <TextInput {...props} value={formattedDateTime} />;
64
53
  }
65
54
 
66
- const handleChange = (date) => {
55
+ const handleChange = date => {
67
56
  const changeValue = date && date.isValid() ? date.toISOString() : null;
68
57
  onChange({ value: changeValue });
69
58
  };
70
59
 
71
- const handleAccept = (date) => {
60
+ const handleAccept = date => {
72
61
  const changeValue = date && date.isValid() ? date.toISOString() : null;
73
62
  handleEvent(actions, 'changeNblur', propName, changeValue);
74
63
  };
@@ -80,8 +69,8 @@ export default function DateTime(props: DateTimeProps) {
80
69
 
81
70
  return (
82
71
  <KeyboardDateTimePicker
83
- variant="inline"
84
- inputVariant="outlined"
72
+ variant='inline'
73
+ inputVariant='outlined'
85
74
  fullWidth
86
75
  autoOk
87
76
  required={required}
@@ -92,7 +81,7 @@ export default function DateTime(props: DateTimeProps) {
92
81
  minutesStep={5}
93
82
  error={status === 'error'}
94
83
  helperText={helperTextToDisplay}
95
- size="small"
84
+ size='small'
96
85
  label={label}
97
86
  value={value || null}
98
87
  onChange={handleChange}
@@ -1,24 +1,13 @@
1
1
  import React, { useState, useEffect } from 'react';
2
2
  import CurrencyTextField from '@unicef/material-ui-currency-textfield';
3
+ import FieldValueList from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldValueList';
3
4
  import { getCurrencyCharacters, getCurrencyOptions } from '@pega/react-sdk-components/lib/components/field/Currency/currency-utils';
4
5
  import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
5
- import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
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';
6
+ import { format } from "@pega/react-sdk-components/lib/components/helpers/formatters";
8
7
 
9
8
  // Using control from: https://github.com/unicef/material-ui-currency-textfield
10
9
 
11
- interface DecimalProps extends PConnFieldProps {
12
- // If any, enter additional props that only exist on Decimal here
13
- currencyISOCode?: string;
14
- decimalPrecision?: number;
15
- showGroupSeparators?: string;
16
- }
17
-
18
- export default function Decimal(props: DecimalProps) {
19
- // Get emitted components from map (so we can get any override that may exist)
20
- const FieldValueList = getComponentFromMap('FieldValueList');
21
-
10
+ export default function Decimal(props) {
22
11
  const {
23
12
  getPConnect,
24
13
  label,
@@ -32,7 +21,7 @@ export default function Decimal(props: DecimalProps) {
32
21
  helperText,
33
22
  displayMode,
34
23
  hideLabel,
35
- currencyISOCode = 'USD',
24
+ currencyISOCode = "USD",
36
25
  decimalPrecision = 2,
37
26
  showGroupSeparators = true,
38
27
  testId
@@ -43,9 +32,9 @@ export default function Decimal(props: DecimalProps) {
43
32
  const propName = pConn.getStateProps().value;
44
33
  const helperTextToDisplay = validatemessage || helperText;
45
34
 
46
- const [decValue, setDecimalvalue] = useState('');
47
- const [theCurrDec, setCurrDec] = useState('.');
48
- const [theCurrSep, setCurrSep] = useState(',');
35
+ const [decValue, setDecimalvalue] = useState();
36
+ const [theCurrDec, setCurrDec] = useState(".");
37
+ const [theCurrSep, setCurrSep] = useState(",");
49
38
 
50
39
  useEffect(() => {
51
40
  const theSymbols = getCurrencyCharacters(currencyISOCode);
@@ -65,7 +54,7 @@ export default function Decimal(props: DecimalProps) {
65
54
  }
66
55
 
67
56
  if (displayMode === 'STACKED_LARGE_VAL') {
68
- return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} variant="stacked" />;
57
+ return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} variant='stacked' />;
69
58
  }
70
59
 
71
60
  let readOnlyProp = {}; // Note: empty if NOT ReadOnly
@@ -94,8 +83,8 @@ export default function Decimal(props: DecimalProps) {
94
83
  fullWidth
95
84
  variant={readOnly ? 'standard' : 'outlined'}
96
85
  helperText={helperTextToDisplay}
97
- placeholder=""
98
- size="small"
86
+ placeholder=''
87
+ size='small'
99
88
  required={required}
100
89
  disabled={disabled}
101
90
  onChange={decimalOnChange}
@@ -103,11 +92,11 @@ export default function Decimal(props: DecimalProps) {
103
92
  error={status === 'error'}
104
93
  label={label}
105
94
  value={decValue}
106
- type="text"
107
- outputFormat="number"
108
- textAlign="left"
95
+ type='text'
96
+ outputFormat='number'
97
+ textAlign='left'
109
98
  InputProps={{ ...readOnlyProp, inputProps: { ...testProp, value: decValue } }}
110
- currencySymbol=""
99
+ currencySymbol=''
111
100
  decimalCharacter={theCurrDec}
112
101
  digitGroupSeparator={showGroupSeparators ? theCurrSep : ''}
113
102
  decimalPlaces={decimalPrecision}
@@ -3,29 +3,14 @@ import { TextField } from '@material-ui/core';
3
3
  import MenuItem from '@material-ui/core/MenuItem';
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
- 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';
6
+ import FieldValueList from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldValueList';
8
7
 
9
8
  interface IOption {
10
9
  key: string;
11
10
  value: string;
12
11
  }
13
12
 
14
- interface DropdownProps extends PConnFieldProps {
15
- // If any, enter additional props that only exist on Dropdown here
16
- datasource?: Array<any>;
17
- onRecordChange?: any;
18
- fieldMetadata?: any;
19
- // eslint-disable-next-line react/no-unused-prop-types
20
- listType: string;
21
- // eslint-disable-next-line react/no-unused-prop-types
22
- additionalProps?: object;
23
- }
24
-
25
- export default function Dropdown(props: DropdownProps) {
26
- // Get emitted components from map (so we can get any override that may exist)
27
- const FieldValueList = getComponentFromMap('FieldValueList');
28
-
13
+ export default function Dropdown(props) {
29
14
  const {
30
15
  getPConnect,
31
16
  label,
@@ -55,16 +40,15 @@ export default function Dropdown(props: DropdownProps) {
55
40
  const refName = propName?.slice(propName.lastIndexOf('.') + 1);
56
41
 
57
42
  useEffect(() => {
58
- const list = Utils.getOptionList(props, getPConnect().getDataObject(thePConn.getContextName()));
43
+ const list = Utils.getOptionList(props, getPConnect().getDataObject());
59
44
  const optionsList = [...list];
60
- optionsList.unshift({
61
- key: placeholder,
62
- value: thePConn.getLocalizedValue(placeholder, '', '')
63
- }); // 2nd and 3rd args empty string until typedef marked correctly
45
+ optionsList.unshift({ key: placeholder, value: thePConn.getLocalizedValue(placeholder) });
64
46
  setOptions(optionsList);
65
47
  }, [datasource]);
66
48
 
67
- const metaData = Array.isArray(fieldMetadata) ? fieldMetadata.filter((field) => field?.classID === className)[0] : fieldMetadata;
49
+ const metaData = Array.isArray(fieldMetadata)
50
+ ? fieldMetadata.filter(field => field?.classID === className)[0]
51
+ : fieldMetadata;
68
52
 
69
53
  let displayName = metaData?.datasource?.propertyForDisplayText;
70
54
  displayName = displayName?.slice(displayName.lastIndexOf('.') + 1);
@@ -79,7 +63,11 @@ export default function Dropdown(props: DropdownProps) {
79
63
  return (
80
64
  <FieldValueList
81
65
  name={hideLabel ? '' : label}
82
- 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
+ )}
83
71
  />
84
72
  );
85
73
  }
@@ -88,8 +76,12 @@ export default function Dropdown(props: DropdownProps) {
88
76
  return (
89
77
  <FieldValueList
90
78
  name={hideLabel ? '' : label}
91
- value={thePConn.getLocalizedValue(value, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))}
92
- variant="stacked"
79
+ value={thePConn.getLocalizedValue(
80
+ value,
81
+ localePath,
82
+ thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)
83
+ )}
84
+ variant='stacked'
93
85
  />
94
86
  );
95
87
  }
@@ -104,7 +96,7 @@ export default function Dropdown(props: DropdownProps) {
104
96
  'data-test-id': testId
105
97
  };
106
98
 
107
- const handleChange = (evt) => {
99
+ const handleChange = evt => {
108
100
  const selectedValue = evt.target.value === placeholder ? '' : evt.target.value;
109
101
  handleEvent(actionsApi, 'changeNblur', propName, selectedValue);
110
102
  if (onRecordChange) {
@@ -119,8 +111,8 @@ export default function Dropdown(props: DropdownProps) {
119
111
  fullWidth
120
112
  variant={readOnly ? 'standard' : 'outlined'}
121
113
  helperText={helperTextToDisplay}
122
- placeholder={thePConn.getLocalizedValue(placeholder, '', '')} // 2nd and 3rd args empty string until typedef marked correctly
123
- size="small"
114
+ placeholder={thePConn.getLocalizedValue(placeholder)}
115
+ size='small'
124
116
  required={required}
125
117
  disabled={disabled}
126
118
  onChange={!readOnly ? handleChange : undefined}
@@ -132,7 +124,11 @@ export default function Dropdown(props: DropdownProps) {
132
124
  >
133
125
  {options.map((option: any) => (
134
126
  <MenuItem key={option.key} value={option.key}>
135
- {thePConn.getLocalizedValue(option.value, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))}
127
+ {thePConn.getLocalizedValue(
128
+ option.value,
129
+ localePath,
130
+ thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)
131
+ )}
136
132
  </MenuItem>
137
133
  ))}
138
134
  </TextField>
@@ -1,18 +1,10 @@
1
1
  import React from 'react';
2
2
  import { TextField, InputAdornment } from '@material-ui/core';
3
3
  import MailOutlineIcon from '@material-ui/icons/MailOutline';
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 EmailProps extends PConnFieldProps {
8
- // If any, enter additional props that only exist on Date here
9
- }
10
-
11
- export default function Email(props: EmailProps) {
12
- // Get emitted components from map (so we can get any override that may exist)
13
- const TextInput = getComponentFromMap('TextInput');
14
- const FieldValueList = getComponentFromMap('FieldValueList');
4
+ import TextInput from '@pega/react-sdk-components/lib/components/field/TextInput';
5
+ import FieldValueList from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldValueList';
15
6
 
7
+ export default function Email(props) {
16
8
  const {
17
9
  label,
18
10
  required,
@@ -35,7 +27,7 @@ export default function Email(props: EmailProps) {
35
27
  }
36
28
 
37
29
  if (displayMode === 'STACKED_LARGE_VAL') {
38
- return <FieldValueList name={hideLabel ? '' : label} value={value} variant="stacked" />;
30
+ return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;
39
31
  }
40
32
 
41
33
  if (readOnly) {
@@ -51,10 +43,10 @@ export default function Email(props: EmailProps) {
51
43
  return (
52
44
  <TextField
53
45
  fullWidth
54
- variant="outlined"
46
+ variant='outlined'
55
47
  helperText={helperTextToDisplay}
56
- placeholder=""
57
- size="small"
48
+ placeholder=''
49
+ size='small'
58
50
  required={required}
59
51
  disabled={disabled}
60
52
  onChange={onChange}
@@ -62,10 +54,10 @@ export default function Email(props: EmailProps) {
62
54
  error={status === 'error'}
63
55
  label={label}
64
56
  value={value}
65
- type="email"
57
+ type='email'
66
58
  InputProps={{
67
59
  startAdornment: (
68
- <InputAdornment position="start">
60
+ <InputAdornment position='start'>
69
61
  <MailOutlineIcon />
70
62
  </InputAdornment>
71
63
  ),
@@ -1,17 +1,9 @@
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 IntegerProps extends PConnFieldProps {
7
- // If any, enter additional props that only exist on Integer here
8
- }
9
-
10
- export default function Integer(props: IntegerProps) {
11
- // Get emitted components from map (so we can get any override that may exist)
12
- const TextInput = getComponentFromMap('TextInput');
13
- const FieldValueList = getComponentFromMap('FieldValueList');
3
+ import TextInput from '@pega/react-sdk-components/lib/components/field/TextInput';
4
+ import FieldValueList from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldValueList';
14
5
 
6
+ export default function Integer(props) {
15
7
  const {
16
8
  label,
17
9
  required,
@@ -36,7 +28,7 @@ export default function Integer(props: IntegerProps) {
36
28
  }
37
29
 
38
30
  if (displayMode === 'STACKED_LARGE_VAL') {
39
- return <FieldValueList name={hideLabel ? '' : label} value={value} variant="stacked" />;
31
+ return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;
40
32
  }
41
33
 
42
34
  if (readOnly) {
@@ -71,8 +63,8 @@ export default function Integer(props: IntegerProps) {
71
63
  fullWidth
72
64
  variant={readOnly ? 'standard' : 'outlined'}
73
65
  helperText={helperTextToDisplay}
74
- placeholder=""
75
- size="small"
66
+ placeholder=''
67
+ size='small'
76
68
  required={required}
77
69
  disabled={disabled}
78
70
  onChange={intOnChange}
@@ -80,7 +72,7 @@ export default function Integer(props: IntegerProps) {
80
72
  error={status === 'error'}
81
73
  label={label}
82
74
  value={value}
83
- type="text"
75
+ type='text'
84
76
  inputProps={{ inputMode: 'numeric', pattern: '[0-9]*', ...testProp }}
85
77
  />
86
78
  );
@@ -2,8 +2,8 @@ import React from 'react';
2
2
  import { TextField } from '@material-ui/core';
3
3
  import { makeStyles } from '@material-ui/core/styles';
4
4
 
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';
5
+ import TextInput from '@pega/react-sdk-components/lib/components/field/TextInput';
6
+ import FieldValueList from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldValueList';
7
7
 
8
8
  // Inspired by https://stackoverflow.com/questions/50823182/material-ui-remove-up-down-arrow-dials-from-textview
9
9
  const useStyles = makeStyles((/* theme */) => ({
@@ -22,15 +22,7 @@ const useStyles = makeStyles((/* theme */) => ({
22
22
  }
23
23
  }));
24
24
 
25
- interface PercentageProps extends PConnFieldProps {
26
- // If any, enter additional props that only exist on Percentage here
27
- }
28
-
29
- export default function Percentage(props: PercentageProps) {
30
- // Get emitted components from map (so we can get any override that may exist)
31
- const TextInput = getComponentFromMap('TextInput');
32
- const FieldValueList = getComponentFromMap('FieldValueList');
33
-
25
+ export default function Percentage(props) {
34
26
  const classes = useStyles();
35
27
 
36
28
  const {
@@ -57,7 +49,7 @@ export default function Percentage(props: PercentageProps) {
57
49
  }
58
50
 
59
51
  if (displayMode === 'STACKED_LARGE_VAL') {
60
- return <FieldValueList name={hideLabel ? '' : label} value={value} variant="stacked" />;
52
+ return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;
61
53
  }
62
54
 
63
55
  if (readOnly) {
@@ -76,8 +68,8 @@ export default function Percentage(props: PercentageProps) {
76
68
  fullWidth
77
69
  variant={readOnly ? 'standard' : 'outlined'}
78
70
  helperText={helperTextToDisplay}
79
- placeholder=""
80
- size="small"
71
+ placeholder=''
72
+ size='small'
81
73
  required={required}
82
74
  disabled={disabled}
83
75
  onChange={onChange}
@@ -85,7 +77,7 @@ export default function Percentage(props: PercentageProps) {
85
77
  error={status === 'error'}
86
78
  label={label}
87
79
  value={value}
88
- type="number"
80
+ type='number'
89
81
  inputProps={{ ...testProp }}
90
82
  />
91
83
  );