@pega/dx-component-builder-sdk 25.1.16 → 26.1.10

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 (208) hide show
  1. package/package.json +1 -1
  2. package/pega-dx-component-builder-sdk-26.1.10.tgz +0 -0
  3. package/src/constants.js +4 -0
  4. package/src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/utils.ts.mustache +1 -1
  5. package/src/tasks/create/templates/Constellation/template/DETAILS/DetailsRender.tsx.mustache +1 -1
  6. package/src/tasks/create/templates/Constellation/template/DETAILS-region/DetailsRender.tsx.mustache +1 -1
  7. package/src/tasks/create/templates/Constellation/template/FORM/DetailsRender.tsx +1 -1
  8. package/src/tasks/create/templates/Constellation/template/FORM-region/DetailsRender.tsx +1 -1
  9. package/src/tasks/create/templates/SDK-React/field/Boolean/index.tsx.mustache +22 -6
  10. package/src/tasks/create/templates/SDK-React/field/Date/demo.stories.tsx.mustache +8 -1
  11. package/src/tasks/create/templates/SDK-React/field/Date/index.tsx.mustache +22 -13
  12. package/src/tasks/create/templates/SDK-React/field/DateTime/demo.stories.tsx.mustache +9 -1
  13. package/src/tasks/create/templates/SDK-React/field/DateTime/index.tsx.mustache +23 -14
  14. package/src/tasks/create/templates/SDK-React/field/Decimal/index.tsx.mustache +24 -8
  15. package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/index.tsx.mustache +24 -8
  16. package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/index.tsx.mustache +24 -10
  17. package/src/tasks/create/templates/SDK-React/field/Integer/index.tsx.mustache +26 -14
  18. package/src/tasks/create/templates/SDK-React/field/Picklist/index.tsx.mustache +34 -8
  19. package/src/tasks/create/templates/SDK-React/field/Picklist-Autocomplete/index.tsx.mustache +25 -9
  20. package/src/tasks/create/templates/SDK-React/field/Picklist-RadioButtons/index.tsx.mustache +21 -5
  21. package/src/tasks/create/templates/SDK-React/field/Text/index.tsx.mustache +25 -14
  22. package/src/tasks/create/templates/SDK-React/field/Text-Email/index.tsx.mustache +32 -21
  23. package/src/tasks/create/templates/SDK-React/field/Text-Input/index.tsx.mustache +25 -10
  24. package/src/tasks/create/templates/SDK-React/field/Text-Paragraph/index.tsx.mustache +26 -14
  25. package/src/tasks/create/templates/SDK-React/field/Text-Phone/index.tsx.mustache +28 -10
  26. package/src/tasks/create/templates/SDK-React/field/Text-URL/index.tsx.mustache +26 -14
  27. package/src/tasks/create/templates/SDK-React/field/TimeOfDay/demo.stories.tsx.mustache +9 -1
  28. package/src/tasks/create/templates/SDK-React/field/TimeOfDay/index.tsx.mustache +22 -17
  29. package/src/tasks/create/templates/SDK-React/template/FORM/DefaultForm.css +82 -2
  30. package/src/tasks/create/templates/SDK-React/template/FORM/index.tsx.mustache +51 -11
  31. package/src/tasks/create/templates/SDK-React/widget/CASE/index.tsx.mustache +19 -15
  32. package/src/tasks/create/templates/SDK-React/widget/PAGE/index.tsx.mustache +2 -167
  33. package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/index.tsx.mustache +72 -15
  34. package/tests/assets/sdk-r/components/create/custom-sdk/field/Pega_DXIL_MyTestText/index.tsx +25 -14
  35. package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/AlertBanner/AlertBanner.css +46 -0
  36. package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/AlertBanner/AlertBanner.tsx +37 -20
  37. package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +14 -0
  38. package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +57 -5
  39. package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/FieldGroup/FieldGroup.tsx +18 -11
  40. package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/FieldGroupList/FieldGroupList.tsx +1 -1
  41. package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/FieldValueList/FieldValueList.tsx +19 -4
  42. package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/Operator/Operator.tsx +125 -74
  43. package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/RichTextEditor/RichTextEditor.tsx +184 -90
  44. package/tests/assets/sdk-r/components/create/override-sdk/field/AutoComplete/AutoComplete.tsx +372 -26
  45. package/tests/assets/sdk-r/components/create/override-sdk/field/Checkbox/Checkbox.tsx +22 -6
  46. package/tests/assets/sdk-r/components/create/override-sdk/field/Currency/Currency.tsx +22 -4
  47. package/tests/assets/sdk-r/components/create/override-sdk/field/Date/Date.tsx +35 -4
  48. package/tests/assets/sdk-r/components/create/override-sdk/field/DateTime/DateTime.tsx +35 -4
  49. package/tests/assets/sdk-r/components/create/override-sdk/field/Decimal/Decimal.tsx +22 -4
  50. package/tests/assets/sdk-r/components/create/override-sdk/field/Dropdown/Dropdown.tsx +48 -16
  51. package/tests/assets/sdk-r/components/create/override-sdk/field/Email/Email.tsx +21 -4
  52. package/tests/assets/sdk-r/components/create/override-sdk/field/Group/Group.tsx +28 -4
  53. package/tests/assets/sdk-r/components/create/override-sdk/field/Integer/Integer.tsx +21 -4
  54. package/tests/assets/sdk-r/components/create/override-sdk/field/Multiselect/Multiselect.tsx +42 -20
  55. package/tests/assets/sdk-r/components/create/override-sdk/field/Multiselect/utils.ts +5 -3
  56. package/tests/assets/sdk-r/components/create/override-sdk/field/ObjectReference/ObjectReference.tsx +554 -66
  57. package/tests/assets/sdk-r/components/create/override-sdk/field/ObjectReference/utils.ts +108 -20
  58. package/tests/assets/sdk-r/components/create/override-sdk/field/Percentage/Percentage.tsx +22 -4
  59. package/tests/assets/sdk-r/components/create/override-sdk/field/Phone/Phone.tsx +23 -4
  60. package/tests/assets/sdk-r/components/create/override-sdk/field/RadioButtons/RadioButtons.tsx +20 -4
  61. package/tests/assets/sdk-r/components/create/override-sdk/field/RichText/RichText.css +0 -79
  62. package/tests/assets/sdk-r/components/create/override-sdk/field/RichText/RichText.tsx +1 -1
  63. package/tests/assets/sdk-r/components/create/override-sdk/field/SelectableCard/SelectableCard.tsx +25 -10
  64. package/tests/assets/sdk-r/components/create/override-sdk/field/TextArea/TextArea.tsx +22 -4
  65. package/tests/assets/sdk-r/components/create/override-sdk/field/TextInput/TextInput.tsx +21 -4
  66. package/tests/assets/sdk-r/components/create/override-sdk/field/Time/Time.tsx +35 -4
  67. package/tests/assets/sdk-r/components/create/override-sdk/field/URL/URL.tsx +22 -4
  68. package/tests/assets/sdk-r/components/create/override-sdk/field/UserReference/UserReference.tsx +10 -6
  69. package/tests/assets/sdk-r/components/create/override-sdk/infra/Assignment/Assignment.tsx +36 -14
  70. package/tests/assets/sdk-r/components/create/override-sdk/infra/Assignment/useValidationBanner.ts +29 -0
  71. package/tests/assets/sdk-r/components/create/override-sdk/infra/DeferLoad/DeferLoad.tsx +31 -10
  72. package/tests/assets/sdk-r/components/create/override-sdk/infra/FlowContainer/FlowContainer.tsx +5 -6
  73. package/tests/assets/sdk-r/components/create/override-sdk/infra/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +1 -1
  74. package/tests/assets/sdk-r/components/create/override-sdk/infra/ModalViewContainer/DataViewActionButtons/DataViewActionButtons.tsx +138 -0
  75. package/tests/assets/sdk-r/components/create/override-sdk/infra/ModalViewContainer/ModalViewContainer.tsx +110 -64
  76. package/tests/assets/sdk-r/components/create/override-sdk/infra/MultiStep/MultiStep.css +63 -0
  77. package/tests/assets/sdk-r/components/create/override-sdk/infra/MultiStep/MultiStep.tsx +23 -52
  78. package/tests/assets/sdk-r/components/create/override-sdk/infra/NavBar/NavBar.tsx +8 -3
  79. package/tests/assets/sdk-r/components/create/override-sdk/infra/Reference/Reference.tsx +5 -0
  80. package/tests/assets/sdk-r/components/create/override-sdk/infra/RootContainer/RootContainer.tsx +4 -5
  81. package/tests/assets/sdk-r/components/create/override-sdk/infra/View/View.css +1 -0
  82. package/tests/assets/sdk-r/components/create/override-sdk/infra/View/View.tsx +10 -17
  83. package/tests/assets/sdk-r/components/create/override-sdk/infra/ViewContainer/ViewContainer.tsx +8 -10
  84. package/tests/assets/sdk-r/components/create/override-sdk/template/AppShell/AppShell.css +0 -4
  85. package/tests/assets/sdk-r/components/create/override-sdk/template/AppShell/AppShell.tsx +7 -1
  86. package/tests/assets/sdk-r/components/create/override-sdk/template/CaseSummary/CaseSummary.tsx +9 -42
  87. package/tests/assets/sdk-r/components/create/override-sdk/template/CaseView/CaseView.tsx +8 -2
  88. package/tests/assets/sdk-r/components/create/override-sdk/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +58 -3
  89. package/tests/assets/sdk-r/components/create/override-sdk/template/DataReference/DataReference.tsx +56 -33
  90. package/tests/assets/sdk-r/components/create/override-sdk/template/DataReference/SearchForm.tsx +3 -4
  91. package/tests/assets/sdk-r/components/create/override-sdk/template/DefaultForm/DefaultForm.css +71 -0
  92. package/tests/assets/sdk-r/components/create/override-sdk/template/DefaultForm/DefaultForm.tsx +45 -9
  93. package/tests/assets/sdk-r/components/create/override-sdk/template/FieldGroupTemplate/FieldGroupTemplate.tsx +10 -3
  94. package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/ListView.tsx +139 -59
  95. package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/hooks.ts +80 -13
  96. package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/utils.ts +13 -3
  97. package/tests/assets/sdk-r/components/create/override-sdk/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +16 -1
  98. package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +167 -93
  99. package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTableSelect/SimpleTableSelect.tsx +71 -56
  100. package/tests/assets/sdk-r/components/create/override-sdk/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +12 -7
  101. package/tests/assets/sdk-r/components/create/override-sdk/widget/Attachment/Attachment.tsx +119 -26
  102. package/tests/assets/sdk-r/components/create/override-sdk/widget/Attachment/AttachmentUtils.ts +1 -1
  103. package/tests/assets/sdk-r/components/create/override-sdk/widget/CaseHistory/CaseHistory.tsx +16 -12
  104. package/tests/assets/sdk-r/components/create/override-sdk/widget/FileUtility/FileUtility.tsx +40 -28
  105. package/tests/assets/sdk-r/components/create/override-sdk/widget/ToDo/ToDo.tsx +14 -6
  106. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/utils.ts +1 -1
  107. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/DetailsRender.tsx +1 -1
  108. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyForm/DetailsRender.tsx +1 -1
  109. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/DetailsRender.tsx +1 -1
  110. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnForm/DetailsRender.tsx +1 -1
  111. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyBoolean/index.tsx +22 -6
  112. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/index.tsx +24 -8
  113. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDate/demo.stories.tsx +8 -1
  114. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDate/index.tsx +22 -13
  115. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/demo.stories.tsx +9 -1
  116. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/index.tsx +23 -14
  117. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/index.tsx +24 -8
  118. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyEmail/index.tsx +32 -21
  119. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyIconButtonURL/index.tsx +2 -2
  120. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyInteger/index.tsx +26 -14
  121. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyParagraph/index.tsx +26 -14
  122. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/index.tsx +24 -10
  123. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPhone/index.tsx +25 -10
  124. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPicklist/index.tsx +34 -8
  125. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyRadiobuttons/index.tsx +21 -5
  126. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MySearchbox/index.tsx +22 -9
  127. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyText/index.tsx +25 -14
  128. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTextInput/index.tsx +25 -10
  129. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTimeOfDay/demo.stories.tsx +9 -1
  130. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTimeOfDay/index.tsx +22 -17
  131. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyURL/index.tsx +26 -14
  132. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/DefaultForm.css +82 -2
  133. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/index.tsx +45 -8
  134. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/index.tsx +19 -15
  135. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/index.tsx +66 -15
  136. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageWidget/index.tsx +2 -167
  137. package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/AlertBanner/AlertBanner.css +46 -0
  138. package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/AlertBanner/AlertBanner.tsx +37 -20
  139. package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +14 -0
  140. package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +57 -5
  141. package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/FieldGroup/FieldGroup.tsx +18 -11
  142. package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/FieldGroupList/FieldGroupList.tsx +1 -1
  143. package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/FieldValueList/FieldValueList.tsx +19 -4
  144. package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/Operator/Operator.tsx +125 -74
  145. package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/RichTextEditor/RichTextEditor.tsx +184 -90
  146. package/tests/assets/sdk-r/components/createAll/override-sdk/field/AutoComplete/AutoComplete.tsx +372 -26
  147. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Checkbox/Checkbox.tsx +22 -6
  148. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Currency/Currency.tsx +22 -4
  149. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Date/Date.tsx +35 -4
  150. package/tests/assets/sdk-r/components/createAll/override-sdk/field/DateTime/DateTime.tsx +35 -4
  151. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Decimal/Decimal.tsx +22 -4
  152. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Dropdown/Dropdown.tsx +48 -16
  153. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Email/Email.tsx +21 -4
  154. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Group/Group.tsx +28 -4
  155. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Integer/Integer.tsx +21 -4
  156. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Multiselect/Multiselect.tsx +42 -20
  157. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Multiselect/utils.ts +5 -3
  158. package/tests/assets/sdk-r/components/createAll/override-sdk/field/ObjectReference/ObjectReference.tsx +554 -66
  159. package/tests/assets/sdk-r/components/createAll/override-sdk/field/ObjectReference/utils.ts +108 -20
  160. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Percentage/Percentage.tsx +22 -4
  161. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Phone/Phone.tsx +23 -4
  162. package/tests/assets/sdk-r/components/createAll/override-sdk/field/RadioButtons/RadioButtons.tsx +20 -4
  163. package/tests/assets/sdk-r/components/createAll/override-sdk/field/RichText/RichText.css +0 -79
  164. package/tests/assets/sdk-r/components/createAll/override-sdk/field/RichText/RichText.tsx +1 -1
  165. package/tests/assets/sdk-r/components/createAll/override-sdk/field/SelectableCard/SelectableCard.tsx +25 -10
  166. package/tests/assets/sdk-r/components/createAll/override-sdk/field/TextArea/TextArea.tsx +22 -4
  167. package/tests/assets/sdk-r/components/createAll/override-sdk/field/TextInput/TextInput.tsx +21 -4
  168. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Time/Time.tsx +35 -4
  169. package/tests/assets/sdk-r/components/createAll/override-sdk/field/URL/URL.tsx +22 -4
  170. package/tests/assets/sdk-r/components/createAll/override-sdk/field/UserReference/UserReference.tsx +10 -6
  171. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/Assignment/Assignment.tsx +36 -14
  172. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/Assignment/useValidationBanner.ts +29 -0
  173. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/DeferLoad/DeferLoad.tsx +31 -10
  174. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/FlowContainer/FlowContainer.tsx +5 -6
  175. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +1 -1
  176. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/ModalViewContainer/DataViewActionButtons/DataViewActionButtons.tsx +138 -0
  177. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/ModalViewContainer/ModalViewContainer.tsx +110 -64
  178. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/MultiStep/MultiStep.css +63 -0
  179. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/MultiStep/MultiStep.tsx +23 -52
  180. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/NavBar/NavBar.tsx +8 -3
  181. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/Reference/Reference.tsx +5 -0
  182. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/RootContainer/RootContainer.tsx +4 -5
  183. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/View/View.css +1 -0
  184. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/View/View.tsx +10 -17
  185. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/ViewContainer/ViewContainer.tsx +8 -10
  186. package/tests/assets/sdk-r/components/createAll/override-sdk/template/AppShell/AppShell.css +0 -4
  187. package/tests/assets/sdk-r/components/createAll/override-sdk/template/AppShell/AppShell.tsx +7 -1
  188. package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseSummary/CaseSummary.tsx +9 -42
  189. package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseView/CaseView.tsx +8 -2
  190. package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +58 -3
  191. package/tests/assets/sdk-r/components/createAll/override-sdk/template/DataReference/DataReference.tsx +56 -33
  192. package/tests/assets/sdk-r/components/createAll/override-sdk/template/DataReference/SearchForm.tsx +3 -4
  193. package/tests/assets/sdk-r/components/createAll/override-sdk/template/DefaultForm/DefaultForm.css +71 -0
  194. package/tests/assets/sdk-r/components/createAll/override-sdk/template/DefaultForm/DefaultForm.tsx +45 -9
  195. package/tests/assets/sdk-r/components/createAll/override-sdk/template/FieldGroupTemplate/FieldGroupTemplate.tsx +10 -3
  196. package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/ListView.tsx +139 -59
  197. package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/hooks.ts +80 -13
  198. package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/utils.ts +13 -3
  199. package/tests/assets/sdk-r/components/createAll/override-sdk/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +16 -1
  200. package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +167 -93
  201. package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTableSelect/SimpleTableSelect.tsx +71 -56
  202. package/tests/assets/sdk-r/components/createAll/override-sdk/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +12 -7
  203. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/Attachment/Attachment.tsx +119 -26
  204. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/Attachment/AttachmentUtils.ts +1 -1
  205. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/CaseHistory/CaseHistory.tsx +16 -12
  206. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/FileUtility/FileUtility.tsx +40 -28
  207. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/ToDo/ToDo.tsx +14 -6
  208. package/SECURITY.md +0 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/dx-component-builder-sdk",
3
- "version": "25.1.16",
3
+ "version": "26.1.10",
4
4
  "description": "Utility for building custom UI components",
5
5
  "bin": "./bin/index.js",
6
6
  "scripts": {
package/src/constants.js CHANGED
@@ -315,6 +315,10 @@ export const COMPONENT_SCHEMA = {
315
315
  name: 'Email',
316
316
  value: 'Email'
317
317
  },
318
+ {
319
+ name: 'EmbeddedData Multi',
320
+ value: 'EmbeddedDataMulti'
321
+ },
318
322
  {
319
323
  name: 'Field Group',
320
324
  value: 'Group'
@@ -115,7 +115,7 @@ export function usePaginate() {
115
115
  }
116
116
 
117
117
  export function useDeepMemo(memoFn: any, key: any) {
118
- const ref = useRef();
118
+ const ref = useRef<{ key: any; value: any } | undefined>(undefined);
119
119
  // @ts-ignore
120
120
  if (!ref.current || !equal(key, ref.current.key)) {
121
121
  // @ts-ignore
@@ -3,7 +3,7 @@ import { FieldValueList } from '@pega/cosmos-react-core';
3
3
 
4
4
  interface DetailsRenderProps {
5
5
  children?: never;
6
- child: NonNullable<ReactElement>;
6
+ child: NonNullable<ReactElement<any>>;
7
7
  }
8
8
 
9
9
  const DetailsRender = (props: DetailsRenderProps) => {
@@ -3,7 +3,7 @@ import { FieldValueList } from '@pega/cosmos-react-core';
3
3
 
4
4
  interface DetailsRenderProps {
5
5
  children?: never;
6
- child: NonNullable<ReactElement>;
6
+ child: NonNullable<ReactElement<any>>;
7
7
  }
8
8
 
9
9
  const DetailsRender = (props: DetailsRenderProps) => {
@@ -3,7 +3,7 @@ import { FieldValueList } from '@pega/cosmos-react-core';
3
3
 
4
4
  interface DetailsRenderProps {
5
5
  children?: never;
6
- child: NonNullable<ReactElement>;
6
+ child: NonNullable<ReactElement<any>>;
7
7
  }
8
8
 
9
9
  const DetailsRender = (props: DetailsRenderProps) => {
@@ -3,7 +3,7 @@ import { FieldValueList } from '@pega/cosmos-react-core';
3
3
 
4
4
  interface DetailsRenderProps {
5
5
  children?: never;
6
- child: NonNullable<ReactElement>;
6
+ child: NonNullable<ReactElement<any>>;
7
7
  }
8
8
 
9
9
  const DetailsRender = (props: DetailsRenderProps) => {
@@ -6,6 +6,8 @@ import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event
6
6
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
7
7
  import { insertInstruction, deleteInstruction, updateNewInstuctions } from '@pega/react-sdk-components/lib/components/helpers/instructions-utils';
8
8
  import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
9
+ import useStatus from '@pega/react-sdk-components/lib/hooks/useStatus';
10
+ import { getFormControlSx } from '@pega/react-sdk-components/lib/components/helpers/field-utils';
9
11
 
10
12
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
11
13
 
@@ -30,6 +32,11 @@ interface {{COMPONENT_CLASS_NAME}}Props extends Omit<PConnFieldProps, 'value'> {
30
32
  showImageDescription: string;
31
33
  renderMode: string;
32
34
  image: string;
35
+ showFieldMessage?: boolean;
36
+ messageConfig?: {
37
+ content?: string;
38
+ visibility?: boolean;
39
+ };
33
40
  }
34
41
 
35
42
  const useStyles = makeStyles(() => ({
@@ -61,7 +68,6 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
61
68
  testId,
62
69
  required,
63
70
  disabled,
64
- status,
65
71
  helperText,
66
72
  validatemessage,
67
73
  displayMode,
@@ -82,18 +88,28 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
82
88
  imageSize,
83
89
  showImageDescription,
84
90
  renderMode,
85
- image
91
+ image,
92
+ showFieldMessage,
93
+ messageConfig = {}
86
94
  } = props;
87
95
 
88
96
  const readOnlyMode = renderMode === 'ReadOnly' || displayMode === 'DISPLAY_ONLY' || readOnly;
89
97
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
90
98
  const [theSelectedButton, setSelectedButton] = useState(value);
91
99
  const classes = useStyles();
92
- const helperTextToDisplay = validatemessage || helperText;
100
+ const eligibleForFieldWarning = showFieldMessage && messageConfig.visibility && !readOnly;
101
+ const helperTextToDisplay = validatemessage || (eligibleForFieldWarning ? messageConfig.content : helperText);
93
102
  const thePConn = getPConnect();
94
103
  const actionsApi = thePConn.getActionsApi();
95
104
  const propName = (thePConn.getStateProps() as any).value;
96
105
 
106
+ const status = useStatus({
107
+ showFieldMessage,
108
+ messageVisibility: messageConfig.visibility,
109
+ validatemessage,
110
+ readOnly
111
+ });
112
+
97
113
  const [checked, setChecked] = useState<any>(false);
98
114
  useEffect(() => {
99
115
  // This update theSelectedButton which will update the UI to show the selected button correctly
@@ -114,11 +130,11 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
114
130
  }, [value]);
115
131
 
116
132
  if (displayMode === 'DISPLAY_ONLY') {
117
- return <FieldValueList name={hideLabel ? '' : caption} value={value ? trueLabel : falseLabel} />;
133
+ return <FieldValueList name={caption} value={value ? trueLabel : falseLabel} variant={props.variant} />;
118
134
  }
119
135
 
120
136
  if (displayMode === 'STACKED_LARGE_VAL') {
121
- return <FieldValueList name={hideLabel ? '' : caption} value={value ? trueLabel : falseLabel} variant='stacked' />;
137
+ return <FieldValueList name={caption} value={value ? trueLabel : falseLabel} variant='stacked' />;
122
138
  }
123
139
 
124
140
  const handleChange = event => {
@@ -258,7 +274,7 @@ const handleCheckboxChange = (event, item) => {
258
274
 
259
275
  return (
260
276
  <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
261
- <FormControl variant='standard' required={required} error={status === 'error'}>
277
+ <FormControl variant='standard' required={required} error={status === 'error'} sx={getFormControlSx(status)}>
262
278
  {!hideLabel && <FormLabel component='legend'>{label}</FormLabel>}
263
279
  <FormGroup>{theCheckbox}</FormGroup>
264
280
  <FormHelperText>{helperTextToDisplay}</FormHelperText>
@@ -1,5 +1,8 @@
1
1
  import { useState } from 'react';
2
2
 
3
+ import { LocalizationProvider } from '@mui/x-date-pickers';
4
+ import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
5
+
3
6
  import type { Meta, StoryObj } from '@storybook/react';
4
7
 
5
8
  import {{COMPONENT_CLASS_NAME}} from './index';
@@ -41,7 +44,11 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
41
44
  }
42
45
  };
43
46
 
44
- return <{{COMPONENT_CLASS_NAME}} {...props} {...args} />;
47
+ return (
48
+ <LocalizationProvider dateAdapter={AdapterDayjs}>
49
+ <{{COMPONENT_CLASS_NAME}} {...props} {...args} />
50
+ </LocalizationProvider>
51
+ );
45
52
  };
46
53
 
47
54
  Base{{COMPONENT_CLASS_NAME}}.args = {
@@ -1,7 +1,5 @@
1
1
  import { useEffect, useState } from 'react';
2
2
  import { DatePicker } from '@mui/x-date-pickers/DatePicker';
3
- import { LocalizationProvider } from '@mui/x-date-pickers';
4
- import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
5
3
  import dayjs, { Dayjs } from 'dayjs';
6
4
 
7
5
  import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
@@ -9,6 +7,8 @@ import { format } from '@pega/react-sdk-components/lib/components/helpers/format
9
7
  import { dateFormatInfoDefault, getDateFormatInfo } from '@pega/react-sdk-components/lib/components/helpers/date-format-utils';
10
8
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
11
9
  import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
10
+ import useStatus from '@pega/react-sdk-components/lib/hooks/useStatus';
11
+ import { getFieldSx } from '@pega/react-sdk-components/lib/components/helpers/field-utils';
12
12
 
13
13
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
14
14
 
@@ -19,6 +19,12 @@ function getFormattedDate(date) {
19
19
 
20
20
  interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
21
21
  // If any, enter additional props that only exist on this componentName
22
+ showFieldMessage?: boolean;
23
+ messageConfig?: {
24
+ content?: string;
25
+ visibility?: boolean;
26
+ };
27
+ variant?: string;
22
28
  }
23
29
 
24
30
  // Duplicated runtime code from React SDK
@@ -29,14 +35,22 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
29
35
  const TextInput = getComponentFromMap('TextInput');
30
36
  const FieldValueList = getComponentFromMap('FieldValueList');
31
37
 
32
- const { getPConnect, label, required, disabled, value, validatemessage, status, readOnly, testId, helperText, displayMode, hideLabel } = props;
38
+ const { getPConnect, label, required, disabled, value, validatemessage, readOnly, testId, helperText, displayMode, hideLabel, showFieldMessage, messageConfig = {} } = props;
33
39
 
34
40
  const [dateValue, setDateValue] = useState<Dayjs | null>(value ? dayjs(value) : null);
35
41
 
36
42
  const pConn = getPConnect();
37
43
  const actions = pConn.getActionsApi();
38
44
  const propName = (pConn.getStateProps() as any).value;
39
- const helperTextToDisplay = validatemessage || helperText;
45
+ const eligibleForFieldWarning = showFieldMessage && messageConfig.visibility && !readOnly;
46
+ const helperTextToDisplay = validatemessage || (eligibleForFieldWarning ? messageConfig.content : helperText);
47
+
48
+ const status = useStatus({
49
+ showFieldMessage,
50
+ messageVisibility: messageConfig.visibility,
51
+ validatemessage,
52
+ readOnly
53
+ });
40
54
 
41
55
  // Start with default dateFormatInfo
42
56
  const dateFormatInfo = dateFormatInfoDefault;
@@ -54,7 +68,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
54
68
  const formattedDate = format(props.value, 'date', {
55
69
  format: dateFormatInfo.dateFormatString
56
70
  });
57
- return <FieldValueList name={hideLabel ? '' : label} value={formattedDate} />;
71
+ return <FieldValueList name={hideLabel ? '' : label} value={formattedDate} variant={props.variant} />;
58
72
  }
59
73
 
60
74
  if (displayMode === 'STACKED_LARGE_VAL') {
@@ -69,11 +83,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
69
83
  return <TextInput {...props} />;
70
84
  }
71
85
 
72
- let testProp = {};
73
-
74
- testProp = {
75
- 'data-test-id': testId
76
- };
86
+ const testProps: any = { 'data-test-id': testId };
77
87
 
78
88
  const handleChange = date => {
79
89
  if (date && date.isValid()) {
@@ -84,7 +94,6 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
84
94
 
85
95
  return (
86
96
  <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
87
- <LocalizationProvider dateAdapter={AdapterDayjs}>
88
97
  <DatePicker
89
98
  label={label}
90
99
  disabled={disabled}
@@ -100,13 +109,13 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
100
109
  error: status === 'error',
101
110
  helperText: helperTextToDisplay,
102
111
  size: 'small',
103
- InputProps: { ...testProp }
112
+ InputProps: { ...testProps },
113
+ sx: getFieldSx(status)
104
114
  }
105
115
  }}
106
116
  <%={{ }}=%> {{! revert delimiters for mustache }}
107
117
  onChange={handleChange}
108
118
  />
109
- </LocalizationProvider>
110
119
  </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
111
120
  );
112
121
  }
@@ -1,4 +1,8 @@
1
1
  import { useState } from 'react';
2
+
3
+ import { LocalizationProvider } from '@mui/x-date-pickers';
4
+ import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
5
+
2
6
  import type { Meta, StoryObj } from '@storybook/react';
3
7
 
4
8
  import {{COMPONENT_CLASS_NAME}} from './index';
@@ -40,7 +44,11 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
40
44
  }
41
45
  };
42
46
 
43
- return <{{COMPONENT_CLASS_NAME}} {...props} {...args} />;
47
+ return (
48
+ <LocalizationProvider dateAdapter={AdapterDayjs}>
49
+ <{{COMPONENT_CLASS_NAME}} {...props} {...args} />
50
+ </LocalizationProvider>
51
+ );
44
52
  };
45
53
 
46
54
  Base{{COMPONENT_CLASS_NAME}}.args = {
@@ -1,7 +1,5 @@
1
1
  import { useEffect, useState } from 'react';
2
2
  import { DateTimePicker } from '@mui/x-date-pickers/DateTimePicker';
3
- import { LocalizationProvider } from '@mui/x-date-pickers';
4
- import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
5
3
  import dayjs, { Dayjs } from 'dayjs';
6
4
  import DateFormatter from '@pega/react-sdk-components/lib/components/helpers/formatters/Date';
7
5
  import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
@@ -9,11 +7,19 @@ import { format } from '@pega/react-sdk-components/lib/components/helpers/format
9
7
  import { dateFormatInfoDefault, getDateFormatInfo } from '@pega/react-sdk-components/lib/components/helpers/date-format-utils';
10
8
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
11
9
  import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
10
+ import useStatus from '@pega/react-sdk-components/lib/hooks/useStatus';
11
+ import { getFieldSx } from '@pega/react-sdk-components/lib/components/helpers/field-utils';
12
12
 
13
13
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
14
14
 
15
15
  interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
16
16
  // If any, enter additional props that only exist on this componentName
17
+ showFieldMessage?: boolean;
18
+ messageConfig?: {
19
+ content?: string;
20
+ visibility?: boolean;
21
+ };
22
+ variant?: string;
17
23
  }
18
24
 
19
25
  // Duplicated runtime code from React SDK
@@ -24,7 +30,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
24
30
  const TextInput = getComponentFromMap('TextInput');
25
31
  const FieldValueList = getComponentFromMap('FieldValueList');
26
32
 
27
- const { getPConnect, label, required, disabled, value = '', validatemessage, status, readOnly, testId, helperText, displayMode, hideLabel } = props;
33
+ const { getPConnect, label, required, disabled, value = '', validatemessage, readOnly, testId, helperText, displayMode, hideLabel, showFieldMessage, messageConfig = {} } = props;
28
34
 
29
35
  const environmentInfo = PCore.getEnvironmentInfo();
30
36
  const timezone = environmentInfo && environmentInfo.getTimeZone();
@@ -34,7 +40,15 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
34
40
  const pConn = getPConnect();
35
41
  const actions = pConn.getActionsApi();
36
42
  const propName = (pConn.getStateProps() as any).value;
37
- const helperTextToDisplay = validatemessage || helperText;
43
+ const eligibleForFieldWarning = showFieldMessage && messageConfig.visibility && !readOnly;
44
+ const helperTextToDisplay = validatemessage || (eligibleForFieldWarning ? messageConfig.content : helperText);
45
+
46
+ const status = useStatus({
47
+ showFieldMessage,
48
+ messageVisibility: messageConfig.visibility,
49
+ validatemessage,
50
+ readOnly
51
+ });
38
52
 
39
53
  // Start with default dateFormatInfo
40
54
  const dateFormatInfo = dateFormatInfoDefault;
@@ -52,7 +66,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
52
66
  const formattedDateTime = format(props.value, 'datetime', {
53
67
  format: `${dateFormatInfo.dateFormatString} hh:mm a`
54
68
  });
55
- return <FieldValueList name={hideLabel ? '' : label} value={formattedDateTime} />;
69
+ return <FieldValueList name={hideLabel ? '' : label} value={formattedDateTime} variant={props.variant} />;
56
70
  }
57
71
 
58
72
  if (displayMode === 'STACKED_LARGE_VAL') {
@@ -67,14 +81,10 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
67
81
  return <TextInput {...props} value={formattedDateTime} />;
68
82
  }
69
83
 
70
- let testProp = {};
71
-
72
- testProp = {
73
- 'data-test-id': testId
74
- };
84
+ const testProps: any = { 'data-test-id': testId };
75
85
 
76
86
  const handleChange = date => {
77
- const timeZoneDateTime = dayjs.tz(date.format('YYYY-MM-DDTHH:mm:ss'), timezone);
87
+ const timeZoneDateTime = (dayjs as any).tz(date.format('YYYY-MM-DDTHH:mm:ss'), timezone);
78
88
  const changeValue = timeZoneDateTime && timeZoneDateTime.isValid() ? timeZoneDateTime.toISOString() : '';
79
89
  setDateValue(timeZoneDateTime);
80
90
  handleEvent(actions, 'changeNblur', propName, changeValue);
@@ -87,7 +97,6 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
87
97
 
88
98
  return (
89
99
  <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
90
- <LocalizationProvider dateAdapter={AdapterDayjs}>
91
100
  <DateTimePicker
92
101
  // fullWidth
93
102
  // autoOk
@@ -109,12 +118,12 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
109
118
  error: status === 'error',
110
119
  helperText: helperTextToDisplay,
111
120
  size: 'small',
112
- InputProps: { ...testProp }
121
+ InputProps: { ...testProps },
122
+ sx: getFieldSx(status)
113
123
  }
114
124
  }}
115
125
  <%={{ }}=%> {{! revert delimiters for mustache }}
116
126
  />
117
- </LocalizationProvider>
118
127
  </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
119
128
  );
120
129
  }
@@ -6,6 +6,8 @@ import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event
6
6
  import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
7
7
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
8
8
  import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
9
+ import useStatus from '@pega/react-sdk-components/lib/hooks/useStatus';
10
+ import { getFieldSx } from '@pega/react-sdk-components/lib/components/helpers/field-utils';
9
11
 
10
12
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
11
13
 
@@ -19,6 +21,12 @@ interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
19
21
  decimalPrecision?: number;
20
22
  showGroupSeparators?: boolean;
21
23
  formatter?: string;
24
+ showFieldMessage?: boolean;
25
+ messageConfig?: {
26
+ content?: string;
27
+ visibility?: boolean;
28
+ };
29
+ variant?: string;
22
30
  }
23
31
 
24
32
  // Duplicated runtime code from React SDK
@@ -35,7 +43,6 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
35
43
  disabled,
36
44
  value = '',
37
45
  validatemessage,
38
- status,
39
46
  /* onChange, onBlur, */
40
47
  readOnly,
41
48
  helperText,
@@ -46,7 +53,9 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
46
53
  showGroupSeparators,
47
54
  testId,
48
55
  placeholder,
49
- formatter
56
+ formatter,
57
+ showFieldMessage,
58
+ messageConfig = {}
50
59
  } = props;
51
60
 
52
61
  const [values, setValues] = useState(value.toString());
@@ -54,7 +63,15 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
54
63
  const pConn = getPConnect();
55
64
  const actions = pConn.getActionsApi();
56
65
  const propName = (pConn.getStateProps() as any).value;
57
- const helperTextToDisplay = validatemessage || helperText;
66
+ const eligibleForFieldWarning = showFieldMessage && messageConfig.visibility && !readOnly;
67
+ const helperTextToDisplay = validatemessage || (eligibleForFieldWarning ? messageConfig.content : helperText);
68
+
69
+ const status = useStatus({
70
+ showFieldMessage,
71
+ messageVisibility: messageConfig.visibility,
72
+ validatemessage,
73
+ readOnly
74
+ });
58
75
 
59
76
  const theSymbols = getCurrencyCharacters(currencyISOCode);
60
77
  const theCurrDec = theSymbols.theDecimalIndicator;
@@ -81,16 +98,14 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
81
98
  }
82
99
 
83
100
  if (displayMode === 'DISPLAY_ONLY') {
84
- return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} />;
101
+ return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} variant={props.variant} />;
85
102
  }
86
103
 
87
104
  if (displayMode === 'STACKED_LARGE_VAL') {
88
105
  return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} variant='stacked' />;
89
106
  }
90
107
 
91
- const testProp = {
92
- 'data-test-id': testId
93
- };
108
+ const testProps: any = { 'data-test-id': testId };
94
109
 
95
110
  function decimalOnBlur() {
96
111
  handleEvent(actions, 'changeNblur', propName, values);
@@ -125,7 +140,8 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
125
140
  decimalScale={readOnly && formatter === 'Currency' ? undefined : decimalPrecision}
126
141
  {{! pick new delimiters for mustache }}
127
142
  {{=<% %>=}}
128
- InputProps={{ ...readOnlyProp, inputProps: { ...testProp } }}
143
+ slotProps={{ input: { ...readOnlyProp, inputProps: { ...testProps } } }}
144
+ sx={getFieldSx(status)}
129
145
  <%={{ }}=%> {{! revert delimiters for mustache }}
130
146
  customInput={TextField}
131
147
  />
@@ -6,6 +6,8 @@ import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps
6
6
  import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
7
7
  import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
8
8
  import { getCurrencyCharacters, getCurrencyOptions } from '@pega/react-sdk-components/lib/components/field/Currency/currency-utils.js';
9
+ import useStatus from '@pega/react-sdk-components/lib/hooks/useStatus';
10
+ import { getFieldSx } from '@pega/react-sdk-components/lib/components/helpers/field-utils';
9
11
 
10
12
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
11
13
 
@@ -17,6 +19,12 @@ interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
17
19
  // If any, enter additional props that only exist on this componentName
18
20
  currencyISOCode?: string;
19
21
  allowDecimals: boolean;
22
+ showFieldMessage?: boolean;
23
+ messageConfig?: {
24
+ content?: string;
25
+ visibility?: boolean;
26
+ };
27
+ variant?: string;
20
28
  }
21
29
 
22
30
  // Duplicated runtime code from React SDK
@@ -33,7 +41,6 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
33
41
  disabled,
34
42
  value = '',
35
43
  validatemessage,
36
- status,
37
44
  /* onChange, onBlur, */
38
45
  readOnly,
39
46
  testId,
@@ -42,18 +49,26 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
42
49
  hideLabel,
43
50
  currencyISOCode = 'USD',
44
51
  placeholder,
45
- allowDecimals
52
+ allowDecimals,
53
+ showFieldMessage,
54
+ messageConfig = {}
46
55
  } = props;
47
56
 
48
57
  const pConn = getPConnect();
49
58
  const actions = pConn.getActionsApi();
50
59
  const propName = (pConn.getStateProps() as any).value;
51
- const helperTextToDisplay = validatemessage || helperText;
60
+ const eligibleForFieldWarning = showFieldMessage && messageConfig.visibility && !readOnly;
61
+ const helperTextToDisplay = validatemessage || (eligibleForFieldWarning ? messageConfig.content : helperText);
52
62
  const [values, setValues] = useState(value.toString());
53
63
 
54
- const testProp = {
55
- 'data-test-id': testId
56
- };
64
+ const status = useStatus({
65
+ showFieldMessage,
66
+ messageVisibility: messageConfig.visibility,
67
+ validatemessage,
68
+ readOnly
69
+ });
70
+
71
+ const testProps: any = { 'data-test-id': testId };
57
72
 
58
73
  useEffect(() => {
59
74
  setValues(value.toString());
@@ -78,7 +93,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
78
93
  currencyProp = { prefix: theCurrSym, decimalSeparator: theCurrDec, thousandSeparator: theCurrSep };
79
94
 
80
95
  if (displayMode === 'DISPLAY_ONLY') {
81
- return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} />;
96
+ return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} variant={props.variant} />;
82
97
  }
83
98
 
84
99
  if (displayMode === 'STACKED_LARGE_VAL') {
@@ -115,7 +130,8 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
115
130
  fixedDecimalScale={allowDecimals}
116
131
  {{! pick new delimiters for mustache }}
117
132
  {{=<% %>=}}
118
- InputProps={{ ...readOnlyProp, inputProps: { ...testProp } }}
133
+ slotProps={{ input: { ...readOnlyProp, inputProps: { ...testProps } } }}
134
+ sx={getFieldSx(status)}
119
135
  <%={{ }}=%> {{! revert delimiters for mustache }}
120
136
  customInput={TextField}
121
137
  />
@@ -6,6 +6,8 @@ import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps
6
6
  import { getCurrencyCharacters, getCurrencyOptions } from '@pega/react-sdk-components/lib/components/field/Currency/currency-utils';
7
7
  import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
8
8
  import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
9
+ import useStatus from '@pega/react-sdk-components/lib/hooks/useStatus';
10
+ import { getFieldSx } from '@pega/react-sdk-components/lib/components/helpers/field-utils';
9
11
 
10
12
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
11
13
 
@@ -18,6 +20,12 @@ interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
18
20
  currencyISOCode?: string;
19
21
  showGroupSeparators?: string;
20
22
  decimalPrecision?: number;
23
+ showFieldMessage?: boolean;
24
+ messageConfig?: {
25
+ content?: string;
26
+ visibility?: boolean;
27
+ };
28
+ variant?: string;
21
29
  }
22
30
 
23
31
  // props passed in combination of props from property panel (config.json) and run time props from Constellation
@@ -32,7 +40,6 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
32
40
  disabled,
33
41
  value = '',
34
42
  validatemessage,
35
- status,
36
43
  // onChange,
37
44
  // onBlur,
38
45
  readOnly,
@@ -43,7 +50,9 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
43
50
  hideLabel,
44
51
  placeholder,
45
52
  showGroupSeparators,
46
- decimalPrecision
53
+ decimalPrecision,
54
+ showFieldMessage,
55
+ messageConfig = {}
47
56
  } = props;
48
57
 
49
58
  const [values, setValues] = useState(value.toString());
@@ -51,7 +60,15 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
51
60
  const pConn = getPConnect();
52
61
  const actions = pConn.getActionsApi();
53
62
  const propName = (pConn.getStateProps() as any).value;
54
- const helperTextToDisplay = validatemessage || helperText;
63
+ const eligibleForFieldWarning = showFieldMessage && messageConfig.visibility && !readOnly;
64
+ const helperTextToDisplay = validatemessage || (eligibleForFieldWarning ? messageConfig.content : helperText);
65
+
66
+ const status = useStatus({
67
+ showFieldMessage,
68
+ messageVisibility: messageConfig.visibility,
69
+ validatemessage,
70
+ readOnly
71
+ });
55
72
 
56
73
  const theCurrencyOptions = getCurrencyOptions(currencyISOCode);
57
74
  const formattedValue = format(value, pConn.getComponentName()?.toLowerCase(), theCurrencyOptions);
@@ -67,18 +84,14 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
67
84
  }
68
85
 
69
86
  if (displayMode === 'DISPLAY_ONLY') {
70
- return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} />;
87
+ return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} variant={props.variant} />;
71
88
  }
72
89
 
73
90
  if (displayMode === 'STACKED_LARGE_VAL') {
74
91
  return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} variant='stacked' />;
75
92
  }
76
93
 
77
- let testProp = {};
78
-
79
- testProp = {
80
- 'data-test-id': testId
81
- };
94
+ const testProps: any = { 'data-test-id': testId };
82
95
 
83
96
  const theSymbols = getCurrencyCharacters(currencyISOCode);
84
97
  const theCurrDec = theSymbols.theDecimalIndicator;
@@ -116,7 +129,8 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
116
129
  suffix='%'
117
130
  {{! pick new delimiters for mustache }}
118
131
  {{=<% %>=}}
119
- InputProps={{ ...readOnlyProp, inputProps: { ...testProp } }}
132
+ slotProps={{ input: { ...readOnlyProp, inputProps: { ...testProps } } }}
133
+ sx={getFieldSx(status)}
120
134
  <%={{ }}=%> {{! revert delimiters for mustache }}
121
135
  customInput={TextField}
122
136
  />