@pega/dx-component-builder-sdk 0.8.5 → 0.8.7

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 (176) hide show
  1. package/package.json +1 -1
  2. package/src/constants.js +16 -0
  3. package/src/tasks/create/templates/Constellation/field/Text-Input/index.jsx.mustache +1 -1
  4. package/src/tasks/create/templates/SDK-React/field/Boolean/index.tsx.mustache +5 -1
  5. package/src/tasks/create/templates/SDK-React/field/Date/index.tsx.mustache +6 -2
  6. package/src/tasks/create/templates/SDK-React/field/DateTime/index.tsx.mustache +6 -2
  7. package/src/tasks/create/templates/SDK-React/field/Decimal/index.tsx.mustache +5 -1
  8. package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/index.tsx.mustache +6 -2
  9. package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/index.tsx.mustache +6 -2
  10. package/src/tasks/create/templates/SDK-React/field/Integer/index.tsx.mustache +6 -2
  11. package/src/tasks/create/templates/SDK-React/field/Picklist/index.tsx.mustache +4 -1
  12. package/src/tasks/create/templates/SDK-React/field/Text/index.tsx.mustache +4 -1
  13. package/src/tasks/create/templates/SDK-React/field/Text-Email/index.tsx.mustache +6 -2
  14. package/src/tasks/create/templates/SDK-React/field/Text-Input/index.tsx.mustache +4 -1
  15. package/src/tasks/create/templates/SDK-React/field/Text-Paragraph/index.tsx.mustache +4 -1
  16. package/src/tasks/create/templates/SDK-React/field/Text-Phone/index.tsx.mustache +5 -1
  17. package/src/tasks/create/templates/SDK-React/field/Text-URL/index.tsx.mustache +6 -2
  18. package/src/tasks/create/templates/SDK-React/field/TimeOfDay/index.tsx.mustache +6 -2
  19. package/src/tasks/create/templates/SDK-React/template/DETAILS/index.tsx.mustache +4 -1
  20. package/src/tasks/create/templates/SDK-React/template/DETAILS-region/index.tsx.mustache +4 -1
  21. package/src/tasks/create/templates/SDK-React/template/PAGE/OneColumn.tsx.mustache +7 -6
  22. package/tests/assets/components/SDK-React/create/custom-sdk/field/Pega_DXIL_MyTestText/index.tsx +4 -1
  23. package/tests/assets/components/SDK-React/create/override-sdk/designSystemExtension/AlertBanner/AlertBanner.tsx +47 -0
  24. package/tests/assets/components/SDK-React/create/override-sdk/designSystemExtension/AlertBanner/index.tsx +1 -0
  25. package/tests/assets/components/SDK-React/create/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +5 -3
  26. package/tests/assets/components/SDK-React/create/override-sdk/designSystemExtension/FieldValueList/FieldValueList.tsx +1 -1
  27. package/tests/assets/components/SDK-React/create/override-sdk/designSystemExtension/RichTextEditor/RichTextEditor.tsx +121 -0
  28. package/tests/assets/components/SDK-React/create/override-sdk/designSystemExtension/RichTextEditor/index.tsx +1 -0
  29. package/tests/assets/components/SDK-React/create/override-sdk/field/AutoComplete/AutoComplete.tsx +29 -27
  30. package/tests/assets/components/SDK-React/create/override-sdk/field/Checkbox/Checkbox.tsx +25 -28
  31. package/tests/assets/components/SDK-React/create/override-sdk/field/Currency/Currency.tsx +16 -15
  32. package/tests/assets/components/SDK-React/create/override-sdk/field/Date/Date.tsx +16 -15
  33. package/tests/assets/components/SDK-React/create/override-sdk/field/DateTime/DateTime.tsx +19 -14
  34. package/tests/assets/components/SDK-React/create/override-sdk/field/Decimal/Decimal.tsx +18 -16
  35. package/tests/assets/components/SDK-React/create/override-sdk/field/Dropdown/Dropdown.tsx +22 -31
  36. package/tests/assets/components/SDK-React/create/override-sdk/field/Email/Email.tsx +11 -11
  37. package/tests/assets/components/SDK-React/create/override-sdk/field/Integer/Integer.tsx +9 -7
  38. package/tests/assets/components/SDK-React/create/override-sdk/field/Percentage/Percentage.tsx +9 -9
  39. package/tests/assets/components/SDK-React/create/override-sdk/field/Phone/Phone.tsx +13 -12
  40. package/tests/assets/components/SDK-React/create/override-sdk/field/RadioButtons/RadioButtons.tsx +18 -38
  41. package/tests/assets/components/SDK-React/create/override-sdk/field/RichText/RichText.tsx +93 -0
  42. package/tests/assets/components/SDK-React/create/override-sdk/field/RichText/index.tsx +1 -0
  43. package/tests/assets/components/SDK-React/create/override-sdk/field/ScalarList/ScalarList.tsx +64 -0
  44. package/tests/assets/components/SDK-React/create/override-sdk/field/ScalarList/config-ext.json +8 -0
  45. package/tests/assets/components/SDK-React/create/override-sdk/field/ScalarList/index.tsx +1 -0
  46. package/tests/assets/components/SDK-React/create/override-sdk/field/SemanticLink/SemanticLink.tsx +19 -19
  47. package/tests/assets/components/SDK-React/create/override-sdk/field/TextArea/TextArea.tsx +8 -6
  48. package/tests/assets/components/SDK-React/create/override-sdk/field/TextInput/TextInput.tsx +8 -7
  49. package/tests/assets/components/SDK-React/create/override-sdk/field/Time/Time.tsx +16 -28
  50. package/tests/assets/components/SDK-React/create/override-sdk/field/URL/URL.tsx +10 -8
  51. package/tests/assets/components/SDK-React/create/override-sdk/field/UserReference/UserReference.tsx +29 -29
  52. package/tests/assets/components/SDK-React/create/override-sdk/infra/Assignment/Assignment.tsx +5 -2
  53. package/tests/assets/components/SDK-React/create/override-sdk/infra/AssignmentCard/AssignmentCard.tsx +4 -2
  54. package/tests/assets/components/SDK-React/create/override-sdk/infra/DashboardFilter/DashboardFilter.tsx +13 -13
  55. package/tests/assets/components/SDK-React/create/override-sdk/infra/DashboardFilter/filterUtils.tsx +1 -1
  56. package/tests/assets/components/SDK-React/create/override-sdk/infra/DeferLoad/DeferLoad.tsx +172 -0
  57. package/tests/assets/components/SDK-React/create/override-sdk/infra/DeferLoad/index.tsx +1 -0
  58. package/tests/assets/components/SDK-React/create/override-sdk/infra/MultiStep/MultiStep.tsx +4 -3
  59. package/tests/assets/components/SDK-React/create/override-sdk/infra/NavBar/NavBar.tsx +2 -1
  60. package/tests/assets/components/SDK-React/create/override-sdk/infra/VerticalTabs/VerticalTabs.tsx +4 -1
  61. package/tests/assets/components/SDK-React/create/override-sdk/template/AppShell/AppShell.tsx +6 -4
  62. package/tests/assets/components/SDK-React/create/override-sdk/template/BannerPage/BannerPage.tsx +4 -1
  63. package/tests/assets/components/SDK-React/create/override-sdk/template/CaseSummary/CaseSummary.tsx +7 -2
  64. package/tests/assets/components/SDK-React/create/override-sdk/template/CaseView/CaseView.tsx +10 -13
  65. package/tests/assets/components/SDK-React/create/override-sdk/template/Confirmation/Confirmation.tsx +23 -44
  66. package/tests/assets/components/SDK-React/create/override-sdk/template/DataReference/DataReference.tsx +28 -49
  67. package/tests/assets/components/SDK-React/create/override-sdk/template/Details/Details.tsx +8 -4
  68. package/tests/assets/components/SDK-React/create/override-sdk/template/DetailsThreeColumn/DetailsThreeColumn.tsx +8 -4
  69. package/tests/assets/components/SDK-React/create/override-sdk/template/DetailsTwoColumn/DetailsTwoColumn.tsx +8 -4
  70. package/tests/assets/components/SDK-React/create/override-sdk/template/FieldGroupTemplate/FieldGroupTemplate.tsx +6 -2
  71. package/tests/assets/components/SDK-React/create/override-sdk/template/InlineDashboardPage/InlineDashboardPage.tsx +5 -1
  72. package/tests/assets/components/SDK-React/create/override-sdk/template/ListPage/ListPage.tsx +6 -3
  73. package/tests/assets/components/SDK-React/create/override-sdk/template/ListView/ListView.tsx +89 -93
  74. package/tests/assets/components/SDK-React/create/override-sdk/template/ListView/utils.ts +170 -23
  75. package/tests/assets/components/SDK-React/create/override-sdk/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +9 -9
  76. package/tests/assets/components/SDK-React/create/override-sdk/template/NarrowWideDetails/NarrowWideDetails.tsx +8 -4
  77. package/tests/assets/components/SDK-React/create/override-sdk/template/NarrowWidePage/NarrowWidePage.tsx +4 -1
  78. package/tests/assets/components/SDK-React/create/override-sdk/template/OneColumnPage/OneColumnPage.tsx +3 -1
  79. package/tests/assets/components/SDK-React/create/override-sdk/template/PromotedFilters/PromotedFilters.tsx +16 -11
  80. package/tests/assets/components/SDK-React/create/override-sdk/template/SimpleTable/SimpleTable.tsx +96 -13
  81. package/tests/assets/components/SDK-React/create/override-sdk/template/SimpleTableSelect/SimpleTableSelect.tsx +6 -4
  82. package/tests/assets/components/SDK-React/create/override-sdk/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +22 -17
  83. package/tests/assets/components/SDK-React/create/override-sdk/template/TwoColumnPage/TwoColumnPage.tsx +3 -2
  84. package/tests/assets/components/SDK-React/create/override-sdk/template/WideNarrowDetails/WideNarrowDetails.tsx +8 -3
  85. package/tests/assets/components/SDK-React/create/override-sdk/template/WideNarrowPage/WideNarrowPage.tsx +4 -3
  86. package/tests/assets/components/SDK-React/create/override-sdk/widget/Attachment/Attachment.tsx +7 -3
  87. package/tests/assets/components/SDK-React/create/override-sdk/widget/FileUtility/FileUtility.tsx +8 -2
  88. package/tests/assets/components/SDK-React/create/override-sdk/widget/QuickCreate/QuickCreate.tsx +4 -1
  89. package/tests/assets/components/SDK-React/create/override-sdk/widget/SummaryList/SummaryList.tsx +4 -1
  90. package/tests/assets/components/SDK-React/create/override-sdk/widget/ToDo/ToDo.tsx +53 -82
  91. package/tests/assets/components/SDK-React/createAll/custom-constellation/field/Pega_DXIL_MyTextInput/index.jsx +1 -1
  92. package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyBoolean/index.tsx +5 -1
  93. package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/index.tsx +6 -2
  94. package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyDate/index.tsx +6 -2
  95. package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/index.tsx +6 -2
  96. package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/index.tsx +5 -1
  97. package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyEmail/index.tsx +6 -2
  98. package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyInteger/index.tsx +6 -2
  99. package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyParagraph/index.tsx +4 -1
  100. package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/index.tsx +6 -2
  101. package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyPhone/index.tsx +5 -1
  102. package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyPicklist/index.tsx +4 -1
  103. package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyText/index.tsx +4 -1
  104. package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyTextInput/index.tsx +4 -1
  105. package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyTimeOfDay/index.tsx +6 -2
  106. package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyURL/index.tsx +6 -2
  107. package/tests/assets/components/SDK-React/createAll/custom-sdk/template/Pega_DXIL_MyDetails/index.tsx +4 -1
  108. package/tests/assets/components/SDK-React/createAll/custom-sdk/template/Pega_DXIL_MyPage/OneColumn.tsx +7 -6
  109. package/tests/assets/components/SDK-React/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnDetails/index.tsx +4 -1
  110. package/tests/assets/components/SDK-React/createAll/override-sdk/designSystemExtension/AlertBanner/AlertBanner.tsx +47 -0
  111. package/tests/assets/components/SDK-React/createAll/override-sdk/designSystemExtension/AlertBanner/index.tsx +1 -0
  112. package/tests/assets/components/SDK-React/createAll/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +5 -3
  113. package/tests/assets/components/SDK-React/createAll/override-sdk/designSystemExtension/RichTextEditor/RichTextEditor.tsx +121 -0
  114. package/tests/assets/components/SDK-React/createAll/override-sdk/designSystemExtension/RichTextEditor/index.tsx +1 -0
  115. package/tests/assets/components/SDK-React/createAll/override-sdk/field/AutoComplete/AutoComplete.tsx +29 -27
  116. package/tests/assets/components/SDK-React/createAll/override-sdk/field/Checkbox/Checkbox.tsx +25 -28
  117. package/tests/assets/components/SDK-React/createAll/override-sdk/field/Currency/Currency.tsx +16 -15
  118. package/tests/assets/components/SDK-React/createAll/override-sdk/field/Date/Date.tsx +16 -15
  119. package/tests/assets/components/SDK-React/createAll/override-sdk/field/DateTime/DateTime.tsx +19 -14
  120. package/tests/assets/components/SDK-React/createAll/override-sdk/field/Decimal/Decimal.tsx +18 -16
  121. package/tests/assets/components/SDK-React/createAll/override-sdk/field/Dropdown/Dropdown.tsx +22 -31
  122. package/tests/assets/components/SDK-React/createAll/override-sdk/field/Email/Email.tsx +11 -11
  123. package/tests/assets/components/SDK-React/createAll/override-sdk/field/Integer/Integer.tsx +9 -7
  124. package/tests/assets/components/SDK-React/createAll/override-sdk/field/Percentage/Percentage.tsx +9 -9
  125. package/tests/assets/components/SDK-React/createAll/override-sdk/field/Phone/Phone.tsx +13 -12
  126. package/tests/assets/components/SDK-React/createAll/override-sdk/field/RadioButtons/RadioButtons.tsx +18 -38
  127. package/tests/assets/components/SDK-React/createAll/override-sdk/field/RichText/RichText.tsx +93 -0
  128. package/tests/assets/components/SDK-React/createAll/override-sdk/field/RichText/index.tsx +1 -0
  129. package/tests/assets/components/SDK-React/createAll/override-sdk/field/ScalarList/ScalarList.tsx +28 -30
  130. package/tests/assets/components/SDK-React/createAll/override-sdk/field/ScalarList/config-ext.json +7 -22
  131. package/tests/assets/components/SDK-React/createAll/override-sdk/field/SemanticLink/SemanticLink.tsx +19 -19
  132. package/tests/assets/components/SDK-React/createAll/override-sdk/field/TextArea/TextArea.tsx +8 -6
  133. package/tests/assets/components/SDK-React/createAll/override-sdk/field/TextInput/TextInput.tsx +8 -7
  134. package/tests/assets/components/SDK-React/createAll/override-sdk/field/Time/Time.tsx +16 -28
  135. package/tests/assets/components/SDK-React/createAll/override-sdk/field/URL/URL.tsx +10 -8
  136. package/tests/assets/components/SDK-React/createAll/override-sdk/field/UserReference/UserReference.tsx +29 -29
  137. package/tests/assets/components/SDK-React/createAll/override-sdk/infra/Assignment/Assignment.tsx +5 -2
  138. package/tests/assets/components/SDK-React/createAll/override-sdk/infra/AssignmentCard/AssignmentCard.tsx +4 -2
  139. package/tests/assets/components/SDK-React/createAll/override-sdk/infra/DeferLoad/DeferLoad.tsx +172 -0
  140. package/tests/assets/components/SDK-React/createAll/override-sdk/infra/DeferLoad/index.tsx +1 -0
  141. package/tests/assets/components/SDK-React/createAll/override-sdk/infra/MultiStep/MultiStep.tsx +4 -3
  142. package/tests/assets/components/SDK-React/createAll/override-sdk/infra/VerticalTabs/VerticalTabs.tsx +4 -1
  143. package/tests/assets/components/SDK-React/createAll/override-sdk/template/AppShell/AppShell.tsx +6 -4
  144. package/tests/assets/components/SDK-React/createAll/override-sdk/template/BannerPage/BannerPage.tsx +4 -1
  145. package/tests/assets/components/SDK-React/createAll/override-sdk/template/CaseSummary/CaseSummary.tsx +7 -2
  146. package/tests/assets/components/SDK-React/createAll/override-sdk/template/CaseView/CaseView.tsx +6 -3
  147. package/tests/assets/components/SDK-React/createAll/override-sdk/template/Confirmation/Confirmation.tsx +23 -44
  148. package/tests/assets/components/SDK-React/createAll/override-sdk/template/DataReference/DataReference.tsx +27 -21
  149. package/tests/assets/components/SDK-React/createAll/override-sdk/template/Details/Details.tsx +6 -2
  150. package/tests/assets/components/SDK-React/createAll/override-sdk/template/DetailsThreeColumn/DetailsThreeColumn.tsx +6 -2
  151. package/tests/assets/components/SDK-React/createAll/override-sdk/template/DetailsTwoColumn/DetailsTwoColumn.tsx +6 -2
  152. package/tests/assets/components/SDK-React/createAll/override-sdk/template/FieldGroupTemplate/FieldGroupTemplate.tsx +6 -2
  153. package/tests/assets/components/SDK-React/createAll/override-sdk/template/InlineDashboardPage/InlineDashboardPage.tsx +5 -1
  154. package/tests/assets/components/SDK-React/createAll/override-sdk/template/ListPage/ListPage.tsx +6 -3
  155. package/tests/assets/components/SDK-React/createAll/override-sdk/template/ListView/ListView.tsx +89 -93
  156. package/tests/assets/components/SDK-React/createAll/override-sdk/template/ListView/utils.ts +170 -23
  157. package/tests/assets/components/SDK-React/createAll/override-sdk/template/NarrowWideDetails/NarrowWideDetails.tsx +6 -2
  158. package/tests/assets/components/SDK-React/createAll/override-sdk/template/NarrowWidePage/NarrowWidePage.tsx +4 -1
  159. package/tests/assets/components/SDK-React/createAll/override-sdk/template/OneColumnPage/OneColumnPage.tsx +3 -1
  160. package/tests/assets/components/SDK-React/createAll/override-sdk/template/PromotedFilters/PromotedFilters.tsx +16 -11
  161. package/tests/assets/components/SDK-React/createAll/override-sdk/template/SimpleTable/SimpleTable.tsx +96 -13
  162. package/tests/assets/components/SDK-React/createAll/override-sdk/template/SimpleTableSelect/SimpleTableSelect.tsx +6 -4
  163. package/tests/assets/components/SDK-React/createAll/override-sdk/template/TwoColumnPage/TwoColumnPage.tsx +3 -2
  164. package/tests/assets/components/SDK-React/createAll/override-sdk/template/WideNarrowDetails/WideNarrowDetails.tsx +8 -4
  165. package/tests/assets/components/SDK-React/createAll/override-sdk/template/WideNarrowPage/WideNarrowPage.tsx +4 -3
  166. package/tests/assets/components/SDK-React/createAll/override-sdk/widget/Attachment/Attachment.tsx +7 -3
  167. package/tests/assets/components/SDK-React/createAll/override-sdk/widget/FileUtility/FileUtility.tsx +8 -2
  168. package/tests/assets/components/SDK-React/createAll/override-sdk/widget/QuickCreate/QuickCreate.tsx +4 -1
  169. package/tests/assets/components/SDK-React/createAll/override-sdk/widget/SummaryList/SummaryList.tsx +4 -1
  170. package/tests/assets/components/SDK-React/createAll/override-sdk/widget/ToDo/ToDo.tsx +53 -82
  171. package/tests/functional/localCreateBuildAllDeleteAllCustom.test.js +0 -1
  172. package/tests/functional/localCreateBuildDeleteCustom.test.js +1 -1
  173. package/tests/functional/localCreateBuildDeleteOverride.test.js +1 -1
  174. package/tests/functional/localCreatePublishAllDeleteAllCustom.test.js +5 -2
  175. package/tests/functional/localCreatePublishAllDeleteAllOverride.test.js +5 -6
  176. package/tests/functional/localCreatePublishDeleteOverride.test.js +1 -4
@@ -1,22 +1,24 @@
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';
4
3
  import { getCurrencyCharacters, getCurrencyOptions } from '@pega/react-sdk-components/lib/components/field/Currency/currency-utils';
5
4
  import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
6
- import { format } from "@pega/react-sdk-components/lib/components/helpers/formatters";
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
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
11
  interface DecimalProps extends PConnFieldProps {
12
12
  // If any, enter additional props that only exist on Decimal here
13
- currencyISOCode?: string,
14
- decimalPrecision?: number,
15
- showGroupSeparators?: string
13
+ currencyISOCode?: string;
14
+ decimalPrecision?: number;
15
+ showGroupSeparators?: string;
16
16
  }
17
17
 
18
-
19
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
+
20
22
  const {
21
23
  getPConnect,
22
24
  label,
@@ -30,7 +32,7 @@ export default function Decimal(props: DecimalProps) {
30
32
  helperText,
31
33
  displayMode,
32
34
  hideLabel,
33
- currencyISOCode = "USD",
35
+ currencyISOCode = 'USD',
34
36
  decimalPrecision = 2,
35
37
  showGroupSeparators = true,
36
38
  testId
@@ -42,8 +44,8 @@ export default function Decimal(props: DecimalProps) {
42
44
  const helperTextToDisplay = validatemessage || helperText;
43
45
 
44
46
  const [decValue, setDecimalvalue] = useState('');
45
- const [theCurrDec, setCurrDec] = useState(".");
46
- const [theCurrSep, setCurrSep] = useState(",");
47
+ const [theCurrDec, setCurrDec] = useState('.');
48
+ const [theCurrSep, setCurrSep] = useState(',');
47
49
 
48
50
  useEffect(() => {
49
51
  const theSymbols = getCurrencyCharacters(currencyISOCode);
@@ -63,7 +65,7 @@ export default function Decimal(props: DecimalProps) {
63
65
  }
64
66
 
65
67
  if (displayMode === 'STACKED_LARGE_VAL') {
66
- return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} variant='stacked' />;
68
+ return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} variant="stacked" />;
67
69
  }
68
70
 
69
71
  let readOnlyProp = {}; // Note: empty if NOT ReadOnly
@@ -92,8 +94,8 @@ export default function Decimal(props: DecimalProps) {
92
94
  fullWidth
93
95
  variant={readOnly ? 'standard' : 'outlined'}
94
96
  helperText={helperTextToDisplay}
95
- placeholder=''
96
- size='small'
97
+ placeholder=""
98
+ size="small"
97
99
  required={required}
98
100
  disabled={disabled}
99
101
  onChange={decimalOnChange}
@@ -101,11 +103,11 @@ export default function Decimal(props: DecimalProps) {
101
103
  error={status === 'error'}
102
104
  label={label}
103
105
  value={decValue}
104
- type='text'
105
- outputFormat='number'
106
- textAlign='left'
106
+ type="text"
107
+ outputFormat="number"
108
+ textAlign="left"
107
109
  InputProps={{ ...readOnlyProp, inputProps: { ...testProp, value: decValue } }}
108
- currencySymbol=''
110
+ currencySymbol=""
109
111
  decimalCharacter={theCurrDec}
110
112
  digitGroupSeparator={showGroupSeparators ? theCurrSep : ''}
111
113
  decimalPlaces={decimalPrecision}
@@ -3,7 +3,7 @@ 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 FieldValueList from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldValueList';
6
+ import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
7
7
  import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
8
8
 
9
9
  interface IOption {
@@ -13,17 +13,19 @@ interface IOption {
13
13
 
14
14
  interface DropdownProps extends PConnFieldProps {
15
15
  // If any, enter additional props that only exist on Dropdown here
16
- datasource?: Array<any>,
17
- onRecordChange?: any,
18
- fieldMetadata?: any,
16
+ datasource?: Array<any>;
17
+ onRecordChange?: any;
18
+ fieldMetadata?: any;
19
19
  // eslint-disable-next-line react/no-unused-prop-types
20
- listType: string,
20
+ listType: string;
21
21
  // eslint-disable-next-line react/no-unused-prop-types
22
- additionalProps?: object
22
+ additionalProps?: object;
23
23
  }
24
24
 
25
-
26
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
+
27
29
  const {
28
30
  getPConnect,
29
31
  label,
@@ -53,15 +55,16 @@ export default function Dropdown(props: DropdownProps) {
53
55
  const refName = propName?.slice(propName.lastIndexOf('.') + 1);
54
56
 
55
57
  useEffect(() => {
56
- const list = Utils.getOptionList(props, getPConnect().getDataObject('')); // 1st arg empty string until typedef marked correctly
58
+ const list = Utils.getOptionList(props, getPConnect().getDataObject('')); // 1st arg empty string until typedef marked correctly
57
59
  const optionsList = [...list];
58
- optionsList.unshift({ key: placeholder, value: thePConn.getLocalizedValue(placeholder, '', '') }); // 2nd and 3rd args empty string until typedef marked correctly
60
+ optionsList.unshift({
61
+ key: placeholder,
62
+ value: thePConn.getLocalizedValue(placeholder, '', '')
63
+ }); // 2nd and 3rd args empty string until typedef marked correctly
59
64
  setOptions(optionsList);
60
65
  }, [datasource]);
61
66
 
62
- const metaData = Array.isArray(fieldMetadata)
63
- ? fieldMetadata.filter(field => field?.classID === className)[0]
64
- : fieldMetadata;
67
+ const metaData = Array.isArray(fieldMetadata) ? fieldMetadata.filter((field) => field?.classID === className)[0] : fieldMetadata;
65
68
 
66
69
  let displayName = metaData?.datasource?.propertyForDisplayText;
67
70
  displayName = displayName?.slice(displayName.lastIndexOf('.') + 1);
@@ -76,11 +79,7 @@ export default function Dropdown(props: DropdownProps) {
76
79
  return (
77
80
  <FieldValueList
78
81
  name={hideLabel ? '' : label}
79
- value={thePConn.getLocalizedValue(
80
- value,
81
- localePath,
82
- thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)
83
- )}
82
+ value={thePConn.getLocalizedValue(value, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))}
84
83
  />
85
84
  );
86
85
  }
@@ -89,12 +88,8 @@ export default function Dropdown(props: DropdownProps) {
89
88
  return (
90
89
  <FieldValueList
91
90
  name={hideLabel ? '' : label}
92
- value={thePConn.getLocalizedValue(
93
- value,
94
- localePath,
95
- thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)
96
- )}
97
- variant='stacked'
91
+ value={thePConn.getLocalizedValue(value, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))}
92
+ variant="stacked"
98
93
  />
99
94
  );
100
95
  }
@@ -109,7 +104,7 @@ export default function Dropdown(props: DropdownProps) {
109
104
  'data-test-id': testId
110
105
  };
111
106
 
112
- const handleChange = evt => {
107
+ const handleChange = (evt) => {
113
108
  const selectedValue = evt.target.value === placeholder ? '' : evt.target.value;
114
109
  handleEvent(actionsApi, 'changeNblur', propName, selectedValue);
115
110
  if (onRecordChange) {
@@ -124,8 +119,8 @@ export default function Dropdown(props: DropdownProps) {
124
119
  fullWidth
125
120
  variant={readOnly ? 'standard' : 'outlined'}
126
121
  helperText={helperTextToDisplay}
127
- placeholder={thePConn.getLocalizedValue(placeholder, "", "")} // 2nd and 3rd args empty string until typedef marked correctly
128
- size='small'
122
+ placeholder={thePConn.getLocalizedValue(placeholder, '', '')} // 2nd and 3rd args empty string until typedef marked correctly
123
+ size="small"
129
124
  required={required}
130
125
  disabled={disabled}
131
126
  onChange={!readOnly ? handleChange : undefined}
@@ -137,11 +132,7 @@ export default function Dropdown(props: DropdownProps) {
137
132
  >
138
133
  {options.map((option: any) => (
139
134
  <MenuItem key={option.key} value={option.key}>
140
- {thePConn.getLocalizedValue(
141
- option.value,
142
- localePath,
143
- thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)
144
- )}
135
+ {thePConn.getLocalizedValue(option.value, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))}
145
136
  </MenuItem>
146
137
  ))}
147
138
  </TextField>
@@ -1,18 +1,18 @@
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 TextInput from '@pega/react-sdk-components/lib/components/field/TextInput';
5
- import FieldValueList from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldValueList';
4
+ import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
6
5
  import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
7
6
 
8
-
9
7
  interface EmailProps extends PConnFieldProps {
10
8
  // If any, enter additional props that only exist on Date here
11
9
  }
12
10
 
13
-
14
-
15
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');
15
+
16
16
  const {
17
17
  label,
18
18
  required,
@@ -35,7 +35,7 @@ export default function Email(props: EmailProps) {
35
35
  }
36
36
 
37
37
  if (displayMode === 'STACKED_LARGE_VAL') {
38
- return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;
38
+ return <FieldValueList name={hideLabel ? '' : label} value={value} variant="stacked" />;
39
39
  }
40
40
 
41
41
  if (readOnly) {
@@ -51,10 +51,10 @@ export default function Email(props: EmailProps) {
51
51
  return (
52
52
  <TextField
53
53
  fullWidth
54
- variant='outlined'
54
+ variant="outlined"
55
55
  helperText={helperTextToDisplay}
56
- placeholder=''
57
- size='small'
56
+ placeholder=""
57
+ size="small"
58
58
  required={required}
59
59
  disabled={disabled}
60
60
  onChange={onChange}
@@ -62,10 +62,10 @@ export default function Email(props: EmailProps) {
62
62
  error={status === 'error'}
63
63
  label={label}
64
64
  value={value}
65
- type='email'
65
+ type="email"
66
66
  InputProps={{
67
67
  startAdornment: (
68
- <InputAdornment position='start'>
68
+ <InputAdornment position="start">
69
69
  <MailOutlineIcon />
70
70
  </InputAdornment>
71
71
  ),
@@ -1,15 +1,17 @@
1
1
  import React from 'react';
2
2
  import { TextField } from '@material-ui/core';
3
- import TextInput from '@pega/react-sdk-components/lib/components/field/TextInput';
4
- import FieldValueList from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldValueList';
3
+ import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
5
4
  import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
6
5
 
7
6
  interface IntegerProps extends PConnFieldProps {
8
7
  // If any, enter additional props that only exist on Integer here
9
8
  }
10
9
 
11
-
12
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');
14
+
13
15
  const {
14
16
  label,
15
17
  required,
@@ -34,7 +36,7 @@ export default function Integer(props: IntegerProps) {
34
36
  }
35
37
 
36
38
  if (displayMode === 'STACKED_LARGE_VAL') {
37
- return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;
39
+ return <FieldValueList name={hideLabel ? '' : label} value={value} variant="stacked" />;
38
40
  }
39
41
 
40
42
  if (readOnly) {
@@ -69,8 +71,8 @@ export default function Integer(props: IntegerProps) {
69
71
  fullWidth
70
72
  variant={readOnly ? 'standard' : 'outlined'}
71
73
  helperText={helperTextToDisplay}
72
- placeholder=''
73
- size='small'
74
+ placeholder=""
75
+ size="small"
74
76
  required={required}
75
77
  disabled={disabled}
76
78
  onChange={intOnChange}
@@ -78,7 +80,7 @@ export default function Integer(props: IntegerProps) {
78
80
  error={status === 'error'}
79
81
  label={label}
80
82
  value={value}
81
- type='text'
83
+ type="text"
82
84
  inputProps={{ inputMode: 'numeric', pattern: '[0-9]*', ...testProp }}
83
85
  />
84
86
  );
@@ -2,11 +2,9 @@ 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 TextInput from '@pega/react-sdk-components/lib/components/field/TextInput';
6
- import FieldValueList from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldValueList';
5
+ import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
7
6
  import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
8
7
 
9
-
10
8
  // Inspired by https://stackoverflow.com/questions/50823182/material-ui-remove-up-down-arrow-dials-from-textview
11
9
  const useStyles = makeStyles((/* theme */) => ({
12
10
  input: {
@@ -24,13 +22,15 @@ const useStyles = makeStyles((/* theme */) => ({
24
22
  }
25
23
  }));
26
24
 
27
-
28
25
  interface PercentageProps extends PConnFieldProps {
29
26
  // If any, enter additional props that only exist on Percentage here
30
27
  }
31
28
 
32
-
33
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
+
34
34
  const classes = useStyles();
35
35
 
36
36
  const {
@@ -57,7 +57,7 @@ export default function Percentage(props: PercentageProps) {
57
57
  }
58
58
 
59
59
  if (displayMode === 'STACKED_LARGE_VAL') {
60
- return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;
60
+ return <FieldValueList name={hideLabel ? '' : label} value={value} variant="stacked" />;
61
61
  }
62
62
 
63
63
  if (readOnly) {
@@ -76,8 +76,8 @@ export default function Percentage(props: PercentageProps) {
76
76
  fullWidth
77
77
  variant={readOnly ? 'standard' : 'outlined'}
78
78
  helperText={helperTextToDisplay}
79
- placeholder=''
80
- size='small'
79
+ placeholder=""
80
+ size="small"
81
81
  required={required}
82
82
  disabled={disabled}
83
83
  onChange={onChange}
@@ -85,7 +85,7 @@ export default function Percentage(props: PercentageProps) {
85
85
  error={status === 'error'}
86
86
  label={label}
87
87
  value={value}
88
- type='number'
88
+ type="number"
89
89
  inputProps={{ ...testProp }}
90
90
  />
91
91
  );
@@ -1,15 +1,16 @@
1
1
  import React from 'react';
2
2
  import MuiPhoneNumber from 'material-ui-phone-number';
3
- import FieldValueList from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldValueList';
3
+ import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
4
4
  import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
5
 
6
6
  interface PhoneProps extends PConnFieldProps {
7
7
  // If any, enter additional props that only exist on Phone here
8
8
  }
9
9
 
10
-
11
-
12
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');
13
+
13
14
  const {
14
15
  label,
15
16
  required,
@@ -38,7 +39,7 @@ export default function Phone(props: PhoneProps) {
38
39
  }
39
40
 
40
41
  if (displayMode === 'STACKED_LARGE_VAL') {
41
- return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;
42
+ return <FieldValueList name={hideLabel ? '' : label} value={value} variant="stacked" />;
42
43
  }
43
44
 
44
45
  if (readOnly) {
@@ -48,8 +49,8 @@ export default function Phone(props: PhoneProps) {
48
49
  <MuiPhoneNumber
49
50
  fullWidth
50
51
  helperText={helperTextToDisplay}
51
- placeholder=''
52
- size='small'
52
+ placeholder=""
53
+ size="small"
53
54
  required={required}
54
55
  disabled={disabled}
55
56
  onChange={onChange}
@@ -66,13 +67,13 @@ export default function Phone(props: PhoneProps) {
66
67
  );
67
68
  }
68
69
 
69
- const handleChange = inputVal => {
70
+ const handleChange = (inputVal) => {
70
71
  let phoneValue = inputVal && inputVal.replace(/\D+/g, '');
71
72
  phoneValue = `+${phoneValue}`;
72
73
  onChange({ value: phoneValue });
73
74
  };
74
75
 
75
- const handleBlur = event => {
76
+ const handleBlur = (event) => {
76
77
  const phoneValue = event?.target?.value;
77
78
  event.target.value = `+${phoneValue && phoneValue.replace(/\D+/g, '')}`;
78
79
  onBlur(event);
@@ -81,11 +82,11 @@ export default function Phone(props: PhoneProps) {
81
82
  return (
82
83
  <MuiPhoneNumber
83
84
  fullWidth
84
- variant='outlined'
85
+ variant="outlined"
85
86
  helperText={helperTextToDisplay}
86
- placeholder=''
87
- size='small'
88
- defaultCountry='us'
87
+ placeholder=""
88
+ size="small"
89
+ defaultCountry="us"
89
90
  required={required}
90
91
  disabled={disabled}
91
92
  onChange={handleChange}
@@ -1,26 +1,21 @@
1
1
  import React, { useState, useEffect } from 'react';
2
- import {
3
- Radio,
4
- RadioGroup,
5
- FormControl,
6
- FormControlLabel,
7
- FormLabel,
8
- FormHelperText
9
- } from '@material-ui/core';
2
+ import { Radio, RadioGroup, FormControl, FormControlLabel, FormLabel, FormHelperText } from '@material-ui/core';
10
3
 
11
4
  import Utils from '@pega/react-sdk-components/lib/components/helpers/utils';
12
5
  import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
13
- import FieldValueList from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldValueList';
6
+ import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
14
7
  import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
15
8
 
16
9
  interface RadioButtonsProps extends PConnFieldProps {
17
10
  // If any, enter additional props that only exist on RadioButtons here
18
- inline: boolean,
19
- fieldMetadata?: any
11
+ inline: boolean;
12
+ fieldMetadata?: any;
20
13
  }
21
14
 
22
-
23
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');
18
+
24
19
  const {
25
20
  getPConnect,
26
21
  label,
@@ -48,9 +43,7 @@ export default function RadioButtons(props: RadioButtonsProps) {
48
43
  configProperty = configProperty.startsWith('@P') ? configProperty.substring(3) : configProperty;
49
44
  configProperty = configProperty.startsWith('.') ? configProperty.substring(1) : configProperty;
50
45
 
51
- const metaData = Array.isArray(fieldMetadata)
52
- ? fieldMetadata.filter(field => field?.classID === className)[0]
53
- : fieldMetadata;
46
+ const metaData = Array.isArray(fieldMetadata) ? fieldMetadata.filter((field) => field?.classID === className)[0] : fieldMetadata;
54
47
  let displayName = metaData?.datasource?.propertyForDisplayText;
55
48
  displayName = displayName?.slice(displayName.lastIndexOf('.') + 1);
56
49
  const localeContext = metaData?.datasource?.tableType === 'DataPage' ? 'datapage' : 'associated';
@@ -71,11 +64,7 @@ export default function RadioButtons(props: RadioButtonsProps) {
71
64
  return (
72
65
  <FieldValueList
73
66
  name={hideLabel ? '' : label}
74
- value={thePConn.getLocalizedValue(
75
- value,
76
- localePath,
77
- thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)
78
- )}
67
+ value={thePConn.getLocalizedValue(value, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))}
79
68
  />
80
69
  );
81
70
  }
@@ -84,34 +73,25 @@ export default function RadioButtons(props: RadioButtonsProps) {
84
73
  return (
85
74
  <FieldValueList
86
75
  name={hideLabel ? '' : label}
87
- value={thePConn.getLocalizedValue(
88
- value,
89
- localePath,
90
- thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)
91
- )}
92
- variant='stacked'
76
+ value={thePConn.getLocalizedValue(value, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))}
77
+ variant="stacked"
93
78
  />
94
79
  );
95
80
  }
96
81
 
97
- const handleChange = event => {
82
+ const handleChange = (event) => {
98
83
  handleEvent(actionsApi, 'changeNblur', propName, event.target.value);
99
84
  };
100
85
 
101
- const handleBlur = event => {
102
- thePConn.getValidationApi().validate(event.target.value, ""); // 2nd arg empty string until typedef marked correctly as optional
86
+ const handleBlur = (event) => {
87
+ thePConn.getValidationApi().validate(event.target.value, ''); // 2nd arg empty string until typedef marked correctly as optional
103
88
  };
104
89
 
105
90
  return (
106
91
  <FormControl error={status === 'error'} required={required}>
107
- <FormLabel component='legend'>{label}</FormLabel>
108
- <RadioGroup
109
- value={theSelectedButton}
110
- onChange={handleChange}
111
- onBlur={!readOnly ? handleBlur : undefined}
112
- row={inline}
113
- >
114
- {theOptions.map(theOption => {
92
+ <FormLabel component="legend">{label}</FormLabel>
93
+ <RadioGroup value={theSelectedButton} onChange={handleChange} onBlur={!readOnly ? handleBlur : undefined} row={inline}>
94
+ {theOptions.map((theOption) => {
115
95
  return (
116
96
  <FormControlLabel
117
97
  value={theOption.key}
@@ -121,7 +101,7 @@ export default function RadioButtons(props: RadioButtonsProps) {
121
101
  localePath,
122
102
  thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)
123
103
  )}
124
- control={<Radio key={theOption.key} color='primary' disabled={readOnly} />}
104
+ control={<Radio key={theOption.key} color="primary" disabled={readOnly} />}
125
105
  />
126
106
  );
127
107
  })}
@@ -0,0 +1,93 @@
1
+ import React, { useRef } from 'react';
2
+ import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
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 RichTextProps extends PConnFieldProps {
7
+ // If any, enter additional props that only exist on TextArea here
8
+ additionalProps?: object;
9
+ }
10
+
11
+ export default function RichText(props: RichTextProps) {
12
+ // Get emitted components from map (so we can get any override that may exist)
13
+ const FieldValueList = getComponentFromMap('FieldValueList');
14
+ const RichTextEditor = getComponentFromMap('RichTextEditor');
15
+
16
+ const { getPConnect, value, placeholder, validatemessage, label, hideLabel, helperText, testId, displayMode, additionalProps } = props;
17
+ const pConn = getPConnect();
18
+ const editorRef: any = useRef(null);
19
+
20
+ let { readOnly, required, disabled } = props;
21
+ [readOnly, required, disabled] = [readOnly, required, disabled].map((prop) => prop === true || (typeof prop === 'string' && prop === 'true'));
22
+
23
+ const helperTextToDisplay = validatemessage || helperText;
24
+
25
+ if (displayMode === 'LABELS_LEFT') {
26
+ return <FieldValueList name={hideLabel ? '' : label} value={value} />;
27
+ }
28
+
29
+ if (displayMode === 'STACKED_LARGE_VAL') {
30
+ return <FieldValueList name={hideLabel ? '' : label} value={value} variant="stacked" />;
31
+ }
32
+
33
+ let richTextComponent;
34
+
35
+ if (readOnly) {
36
+ // Rich Text read-only component
37
+ richTextComponent = (
38
+ <RichTextEditor
39
+ {...additionalProps}
40
+ label={label}
41
+ labelHidden={hideLabel}
42
+ defaultValue={value}
43
+ testId={testId}
44
+ info={helperTextToDisplay}
45
+ ref={editorRef}
46
+ readOnly
47
+ />
48
+ );
49
+ } else {
50
+ // Rich Text editable component
51
+ const actionsApi = pConn.getActionsApi();
52
+ let status = '';
53
+ if (validatemessage !== '') {
54
+ status = 'error';
55
+ }
56
+ const handleChange = () => {
57
+ if (status === 'error') {
58
+ const property = pConn.getStateProps().value;
59
+ pConn.clearErrorMessages({
60
+ property
61
+ });
62
+ }
63
+ };
64
+
65
+ const handleBlur = () => {
66
+ if (editorRef.current) {
67
+ const editorValue = editorRef.current.getContent({ format: 'html' });
68
+ const property = pConn.getStateProps().value;
69
+ handleEvent(actionsApi, 'changeNblur', property, editorValue);
70
+ }
71
+ };
72
+
73
+ richTextComponent = (
74
+ <RichTextEditor
75
+ {...additionalProps}
76
+ label={label}
77
+ labelHidden={hideLabel}
78
+ info={helperTextToDisplay}
79
+ defaultValue={value}
80
+ placeholder={placeholder}
81
+ disabled={disabled}
82
+ required={required}
83
+ testId={testId}
84
+ ref={editorRef}
85
+ error={status === 'error'}
86
+ onBlur={handleBlur}
87
+ onChange={handleChange}
88
+ />
89
+ );
90
+ }
91
+
92
+ return richTextComponent;
93
+ }
@@ -0,0 +1 @@
1
+ export { default } from './RichText';