@pega/dx-component-builder-sdk 23.1.15 → 24.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 (311) hide show
  1. package/README.md +3 -3
  2. package/package.json +1 -1
  3. package/src/cli.js +1 -1
  4. package/src/constants.js +4 -0
  5. package/src/tasks/build-all/helper.js +6 -0
  6. package/src/tasks/build-comp/helper.js +6 -0
  7. package/src/tasks/bundle/builderAngular/webpack.config.js +14 -1
  8. package/src/tasks/bundle/builderAssociated/webpack.config.js +13 -0
  9. package/src/tasks/bundle/builderReact/webpack.config.js +14 -1
  10. package/src/tasks/create/templates/Constellation/field/Boolean/index.tsx.mustache +3 -2
  11. package/src/tasks/create/templates/Constellation/field/Icon-Button-URL/PConnProps.d.ts.mustache +46 -0
  12. package/src/tasks/create/templates/Constellation/field/Icon-Button-URL/config.json.mustache +64 -0
  13. package/src/tasks/create/templates/Constellation/field/Icon-Button-URL/demo.stories.tsx.mustache +99 -0
  14. package/src/tasks/create/templates/Constellation/field/Icon-Button-URL/index.tsx.mustache +204 -0
  15. package/src/tasks/create/templates/Constellation/field/Icon-Button-URL/mock.ts.mustache +5 -0
  16. package/src/tasks/create/templates/Constellation/field/Icon-Button-URL/styles.ts.mustache +8 -0
  17. package/src/tasks/create/templates/Constellation/field/Picklist/index.tsx.mustache +0 -1
  18. package/src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/date.ts.mustache +15 -37
  19. package/src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/index.tsx.mustache +11 -0
  20. package/src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/utils.ts.mustache +3 -0
  21. package/src/tasks/create/templates/Constellation/field/Text/index.tsx.mustache +94 -4
  22. package/src/tasks/create/templates/Constellation/template/DETAILS/Avatar.tsx.mustache +78 -0
  23. package/src/tasks/create/templates/Constellation/template/DETAILS/DetailsRender.tsx.mustache +55 -0
  24. package/src/tasks/create/templates/Constellation/template/DETAILS/HighlightRender.tsx.mustache +49 -0
  25. package/src/tasks/create/templates/Constellation/template/DETAILS/Operator.tsx.mustache +218 -0
  26. package/src/tasks/create/templates/Constellation/template/DETAILS/demo.stories.tsx.mustache +77 -23
  27. package/src/tasks/create/templates/Constellation/template/DETAILS/index.tsx.mustache +51 -40
  28. package/src/tasks/create/templates/Constellation/template/DETAILS/mock.ts.mustache +78 -20
  29. package/src/tasks/create/templates/Constellation/template/DETAILS/styles.ts.mustache +16 -0
  30. package/src/tasks/create/templates/Constellation/template/DETAILS-region/Avatar.tsx.mustache +78 -0
  31. package/src/tasks/create/templates/Constellation/template/DETAILS-region/DetailsRender.tsx.mustache +55 -0
  32. package/src/tasks/create/templates/Constellation/template/DETAILS-region/HighlightRender.tsx.mustache +49 -0
  33. package/src/tasks/create/templates/Constellation/template/DETAILS-region/Operator.tsx.mustache +218 -0
  34. package/src/tasks/create/templates/Constellation/template/DETAILS-region/demo.stories.tsx.mustache +95 -26
  35. package/src/tasks/create/templates/Constellation/template/DETAILS-region/index.tsx.mustache +42 -39
  36. package/src/tasks/create/templates/Constellation/template/DETAILS-region/mock.ts.mustache +68 -10
  37. package/src/tasks/create/templates/Constellation/template/DETAILS-region/styles.ts.mustache +15 -0
  38. package/src/tasks/create/templates/Constellation/template/FORM/DetailsRender.tsx +59 -0
  39. package/src/tasks/create/templates/Constellation/template/FORM/demo.stories.tsx.mustache +73 -8
  40. package/src/tasks/create/templates/Constellation/template/FORM/index.tsx.mustache +33 -5
  41. package/src/tasks/create/templates/Constellation/template/FORM-region/DetailsRender.tsx +59 -0
  42. package/src/tasks/create/templates/Constellation/template/FORM-region/demo.stories.tsx.mustache +95 -15
  43. package/src/tasks/create/templates/Constellation/template/FORM-region/index.tsx.mustache +29 -7
  44. package/src/tasks/create/templates/Constellation/template/PAGE/GetNextWork.tsx.mustache +2 -1
  45. package/src/tasks/create/templates/Constellation/template/PAGE/localizations.json.mustache +4 -2
  46. package/src/tasks/create/templates/Constellation/widget/PAGE/demo.stories.tsx.mustache +87 -6
  47. package/src/tasks/create/templates/Constellation/widget/PAGE/index.tsx.mustache +67 -5
  48. package/src/tasks/create/templates/SDK-Angular/field/Boolean/boolean.component.html.mustache +19 -18
  49. package/src/tasks/create/templates/SDK-Angular/field/Boolean/boolean.component.ts.mustache +127 -44
  50. package/src/tasks/create/templates/SDK-Angular/field/Icon-Button-URL/config.json.mustache +64 -0
  51. package/src/tasks/create/templates/SDK-Angular/field/Icon-Button-URL/demo.stories.tsx.mustache +63 -0
  52. package/src/tasks/create/templates/SDK-Angular/field/Icon-Button-URL/icon-button-url.component.html.mustache +40 -0
  53. package/src/tasks/create/templates/SDK-Angular/field/Icon-Button-URL/icon-button-url.component.scss.mustache +24 -0
  54. package/src/tasks/create/templates/SDK-Angular/field/Icon-Button-URL/icon-button-url.component.spec.ts.mustache +26 -0
  55. package/src/tasks/create/templates/SDK-Angular/field/Icon-Button-URL/icon-button-url.component.ts.mustache +195 -0
  56. package/src/tasks/create/templates/SDK-Angular/field/Icon-Button-URL/mock.ts.mustache +37 -0
  57. package/src/tasks/create/templates/SDK-Angular/field/Text-URL/text-url.component.html.mustache +1 -0
  58. package/src/tasks/create/templates/SDK-Angular/field/Text-URL/text-url.component.ts.mustache +2 -0
  59. package/src/tasks/create/templates/SDK-Angular/field/TimeOfDay/time-of-day.component.html.mustache +1 -0
  60. package/src/tasks/create/templates/SDK-Angular/field/TimeOfDay/time-of-day.component.ts.mustache +2 -0
  61. package/src/tasks/create/templates/SDK-Angular/template/FORM-region/form.component.scss.mustache +1 -1
  62. package/src/tasks/create/templates/SDK-Angular/widget/CASE/case.component.ts.mustache +2 -2
  63. package/src/tasks/create/templates/SDK-Angular/widget/PAGE/demo.stories.tsx.mustache +22 -5
  64. package/src/tasks/create/templates/SDK-Angular/widget/PAGE/mock.ts.mustache +25 -0
  65. package/src/tasks/create/templates/SDK-Angular/widget/PAGE/page.component.html.mustache +11 -1
  66. package/src/tasks/create/templates/SDK-Angular/widget/PAGE/page.component.ts.mustache +93 -1
  67. package/src/tasks/create/templates/SDK-React/field/Boolean/demo.stories.tsx.mustache +1 -1
  68. package/src/tasks/create/templates/SDK-React/field/Boolean/mock.ts.mustache +8 -8
  69. package/src/tasks/create/templates/SDK-React/field/Date/index.tsx.mustache +2 -2
  70. package/src/tasks/create/templates/SDK-React/field/Date/mock.ts.mustache +7 -7
  71. package/src/tasks/create/templates/SDK-React/field/DateTime/demo.stories.tsx.mustache +1 -1
  72. package/src/tasks/create/templates/SDK-React/field/DateTime/index.tsx.mustache +2 -3
  73. package/src/tasks/create/templates/SDK-React/field/DateTime/mock.ts.mustache +6 -6
  74. package/src/tasks/create/templates/SDK-React/field/Decimal/index.tsx.mustache +51 -35
  75. package/src/tasks/create/templates/SDK-React/field/Decimal/mock.ts.mustache +1 -1
  76. package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/config.json.mustache +1 -1
  77. package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/demo.stories.tsx.mustache +1 -1
  78. package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/index.tsx.mustache +47 -37
  79. package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/mock.ts.mustache +1 -1
  80. package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/config.json.mustache +1 -1
  81. package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/index.tsx.mustache +36 -21
  82. package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/mock.ts.mustache +1 -1
  83. package/src/tasks/create/templates/SDK-React/field/Icon-Button-URL/config.json.mustache +64 -0
  84. package/src/tasks/create/templates/SDK-React/field/Icon-Button-URL/demo.stories.tsx.mustache +91 -0
  85. package/src/tasks/create/templates/SDK-React/field/Icon-Button-URL/index.tsx.mustache +160 -0
  86. package/src/tasks/create/templates/SDK-React/field/Icon-Button-URL/mock.ts.mustache +4 -0
  87. package/src/tasks/create/templates/SDK-React/field/Icon-Button-URL/styles.js.mustache +7 -0
  88. package/src/tasks/create/templates/SDK-React/field/Integer/config.json.mustache +1 -1
  89. package/src/tasks/create/templates/SDK-React/field/Integer/index.tsx.mustache +19 -20
  90. package/src/tasks/create/templates/SDK-React/field/Integer/mock.ts.mustache +1 -1
  91. package/src/tasks/create/templates/SDK-React/field/Picklist/index.tsx.mustache +26 -26
  92. package/src/tasks/create/templates/SDK-React/field/Picklist-RadioButtons/mock.ts.mustache +0 -1
  93. package/src/tasks/create/templates/SDK-React/field/Text/config.json.mustache +1 -1
  94. package/src/tasks/create/templates/SDK-React/field/Text/index.tsx.mustache +0 -1
  95. package/src/tasks/create/templates/SDK-React/field/Text/mock.ts.mustache +1 -1
  96. package/src/tasks/create/templates/SDK-React/field/Text-Email/config.json.mustache +1 -1
  97. package/src/tasks/create/templates/SDK-React/field/Text-Email/mock.ts.mustache +1 -1
  98. package/src/tasks/create/templates/SDK-React/field/Text-Input/config.json.mustache +1 -1
  99. package/src/tasks/create/templates/SDK-React/field/Text-Input/index.tsx.mustache +0 -1
  100. package/src/tasks/create/templates/SDK-React/field/Text-Input/mock.ts.mustache +1 -1
  101. package/src/tasks/create/templates/SDK-React/field/Text-Paragraph/index.tsx.mustache +1 -3
  102. package/src/tasks/create/templates/SDK-React/field/Text-Paragraph/mock.ts.mustache +1 -1
  103. package/src/tasks/create/templates/SDK-React/field/Text-Phone/index.tsx.mustache +17 -9
  104. package/src/tasks/create/templates/SDK-React/field/Text-URL/index.tsx.mustache +1 -2
  105. package/src/tasks/create/templates/SDK-React/field/Text-URL/mock.ts.mustache +1 -1
  106. package/src/tasks/create/templates/SDK-React/field/TimeOfDay/demo.stories.tsx.mustache +4 -4
  107. package/src/tasks/create/templates/SDK-React/field/TimeOfDay/index.tsx.mustache +0 -2
  108. package/src/tasks/create/templates/SDK-React/field/TimeOfDay/mock.ts.mustache +6 -6
  109. package/src/tasks/create/templates/SDK-React/template/DETAILS/demo.stories.tsx.mustache +1 -7
  110. package/src/tasks/create/templates/SDK-React/template/DETAILS/index.tsx.mustache +4 -9
  111. package/src/tasks/create/templates/SDK-React/template/DETAILS/mock.ts.mustache +197 -164
  112. package/src/tasks/create/templates/SDK-React/template/DETAILS-region/demo.stories.tsx.mustache +1 -6
  113. package/src/tasks/create/templates/SDK-React/template/DETAILS-region/index.tsx.mustache +4 -9
  114. package/src/tasks/create/templates/SDK-React/template/DETAILS-region/mock.ts.mustache +207 -163
  115. package/src/tasks/create/templates/SDK-React/template/FORM/config.json.mustache +1 -1
  116. package/src/tasks/create/templates/SDK-React/template/FORM/demo.stories.tsx.mustache +13 -1
  117. package/src/tasks/create/templates/SDK-React/template/FORM/index.tsx.mustache +14 -16
  118. package/src/tasks/create/templates/SDK-React/template/FORM/utils.ts.mustache +1 -1
  119. package/src/tasks/create/templates/SDK-React/template/FORM-region/demo.stories.tsx.mustache +0 -2
  120. package/src/tasks/create/templates/SDK-React/template/FORM-region/mock.ts.mustache +121 -122
  121. package/src/tasks/create/templates/SDK-React/template/PAGE/OneColumn.tsx.mustache +12 -13
  122. package/src/tasks/create/templates/SDK-React/template/PAGE/demo.stories.tsx.mustache +1 -1
  123. package/src/tasks/create/templates/SDK-React/template/PAGE/index.tsx.mustache +3 -5
  124. package/src/tasks/create/templates/SDK-React/template/PAGE/mock.ts.mustache +8 -9
  125. package/src/tasks/create/templates/SDK-React/widget/CASE/config.json.mustache +2 -2
  126. package/src/tasks/create/templates/SDK-React/widget/CASE/demo.stories.tsx.mustache +19 -20
  127. package/src/tasks/create/templates/SDK-React/widget/CASE/index.tsx.mustache +3 -3
  128. package/src/tasks/create/templates/SDK-React/widget/PAGE/config.json.mustache +43 -43
  129. package/src/tasks/create/templates/SDK-React/widget/PAGE/demo.stories.tsx.mustache +45 -2
  130. package/src/tasks/create/templates/SDK-React/widget/PAGE/index.tsx.mustache +168 -3
  131. package/src/tasks/create/templates/SDK-React/widget/PAGE/mock.ts.mustache +26 -1
  132. package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/demo.stories.tsx.mustache +20 -21
  133. package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/index.tsx.mustache +0 -1
  134. package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/mock.ts.mustache +0 -1
  135. package/src/tasks/create-all/index.js +3 -0
  136. package/src/tasks/publish/helper.js +4 -0
  137. package/src/tasks/publish-all/helper.js +6 -2
  138. package/src/tasks/validator/index.js +7 -1
  139. package/tests/assets/sdk-r/components/create/custom-constellation/field/Pega_DXIL_MyTestText/index.tsx +94 -4
  140. package/tests/assets/sdk-r/components/create/custom-sdk/field/Pega_DXIL_MyTestText/config.json +1 -1
  141. package/tests/assets/sdk-r/components/create/custom-sdk/field/Pega_DXIL_MyTestText/index.tsx +0 -1
  142. package/tests/assets/sdk-r/components/create/custom-sdk/field/Pega_DXIL_MyTestText/mock.ts +1 -1
  143. package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +2 -2
  144. package/tests/assets/sdk-r/components/create/override-sdk/field/CancelAlert/CancelAlert.tsx +2 -0
  145. package/tests/assets/sdk-r/components/create/override-sdk/field/Currency/Currency.tsx +36 -26
  146. package/tests/assets/sdk-r/components/create/override-sdk/field/Decimal/Decimal.tsx +33 -19
  147. package/tests/assets/sdk-r/components/create/override-sdk/field/Multiselect/Multiselect.tsx +1 -1
  148. package/tests/assets/sdk-r/components/create/override-sdk/field/Percentage/Percentage.tsx +33 -18
  149. package/tests/assets/sdk-r/components/create/override-sdk/field/Phone/Phone.tsx +16 -7
  150. package/tests/assets/sdk-r/components/create/override-sdk/field/ScalarList/ScalarList.tsx +2 -0
  151. package/tests/assets/sdk-r/components/create/override-sdk/field/UserReference/UserReference.tsx +11 -1
  152. package/tests/assets/sdk-r/components/create/override-sdk/infra/Assignment/Assignment.tsx +28 -1
  153. package/tests/assets/sdk-r/components/create/override-sdk/infra/DashboardFilter/DashboardFilter.tsx +1 -1
  154. package/tests/assets/sdk-r/components/create/override-sdk/infra/DeferLoad/DeferLoad.tsx +5 -1
  155. package/tests/assets/sdk-r/components/create/override-sdk/infra/MultiStep/MultiStep.tsx +3 -1
  156. package/tests/assets/sdk-r/components/create/override-sdk/infra/NavBar/NavBar.tsx +2 -2
  157. package/tests/assets/sdk-r/components/create/override-sdk/template/CaseView/CaseView.tsx +2 -1
  158. package/tests/assets/sdk-r/components/create/override-sdk/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +1 -1
  159. package/tests/assets/sdk-r/components/create/override-sdk/template/DataReference/DataReference.tsx +1 -1
  160. package/tests/assets/sdk-r/components/create/override-sdk/template/DefaultForm/utils/index.ts +2 -7
  161. package/tests/assets/sdk-r/components/create/override-sdk/template/Details/Details.tsx +1 -1
  162. package/tests/assets/sdk-r/components/create/override-sdk/template/DetailsThreeColumn/DetailsThreeColumn.tsx +1 -1
  163. package/tests/assets/sdk-r/components/create/override-sdk/template/DetailsTwoColumn/DetailsTwoColumn.tsx +1 -1
  164. package/tests/assets/sdk-r/components/create/override-sdk/template/FieldGroupTemplate/FieldGroupTemplate.tsx +2 -0
  165. package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/ListView.tsx +20 -31
  166. package/tests/assets/sdk-r/components/create/override-sdk/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +1 -1
  167. package/tests/assets/sdk-r/components/create/override-sdk/template/NarrowWideDetails/NarrowWideDetails.tsx +1 -1
  168. package/tests/assets/sdk-r/components/create/override-sdk/template/PromotedFilters/PromotedFilters.tsx +1 -0
  169. package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +4 -0
  170. package/tests/assets/sdk-r/components/create/override-sdk/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +1 -1
  171. package/tests/assets/sdk-r/components/create/override-sdk/template/WideNarrowDetails/WideNarrowDetails.tsx +1 -1
  172. package/tests/assets/sdk-r/components/create/override-sdk/widget/Attachment/Attachment.tsx +3 -2
  173. package/tests/assets/sdk-r/components/create/override-sdk/widget/FileUtility/FileUtility.tsx +1 -1
  174. package/tests/assets/sdk-r/components/create/override-sdk/widget/QuickCreate/QuickCreate.tsx +1 -0
  175. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyBoolean/index.tsx +3 -2
  176. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyIconButtonURL/PConnProps.d.ts +46 -0
  177. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +99 -0
  178. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyIconButtonURL/index.tsx +201 -0
  179. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyIconButtonURL/mock.ts +5 -0
  180. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyIconButtonURL/styles.ts +8 -0
  181. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyPicklist/index.tsx +0 -1
  182. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/date.ts +15 -37
  183. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/index.tsx +11 -0
  184. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/utils.ts +3 -0
  185. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyText/index.tsx +94 -4
  186. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/Avatar.tsx +78 -0
  187. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/DetailsRender.tsx +52 -0
  188. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/HighlightRender.tsx +46 -0
  189. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/Operator.tsx +215 -0
  190. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/demo.stories.tsx +77 -23
  191. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/index.tsx +48 -37
  192. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/mock.ts +78 -20
  193. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/styles.ts +16 -0
  194. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyForm/DetailsRender.tsx +59 -0
  195. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyForm/demo.stories.tsx +73 -8
  196. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyForm/index.tsx +30 -5
  197. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyPage/GetNextWork.tsx +2 -1
  198. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyPage/localizations.json +4 -2
  199. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/Avatar.tsx +78 -0
  200. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/DetailsRender.tsx +52 -0
  201. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/HighlightRender.tsx +46 -0
  202. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/Operator.tsx +215 -0
  203. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +95 -26
  204. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/index.tsx +39 -36
  205. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/mock.ts +68 -10
  206. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/styles.ts +15 -0
  207. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnForm/DetailsRender.tsx +59 -0
  208. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +95 -15
  209. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnForm/index.tsx +23 -4
  210. package/tests/assets/sdk-r/components/createAll/custom-constellation/widget/Pega_DXIL_MyPageWidget/demo.stories.tsx +87 -6
  211. package/tests/assets/sdk-r/components/createAll/custom-constellation/widget/Pega_DXIL_MyPageWidget/index.tsx +67 -5
  212. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyBoolean/demo.stories.tsx +1 -1
  213. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyBoolean/mock.ts +8 -8
  214. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/config.json +1 -1
  215. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/demo.stories.tsx +1 -1
  216. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/index.tsx +44 -34
  217. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/mock.ts +1 -1
  218. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDate/index.tsx +2 -2
  219. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDate/mock.ts +7 -7
  220. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/demo.stories.tsx +1 -1
  221. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/index.tsx +2 -3
  222. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/mock.ts +6 -6
  223. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/index.tsx +48 -32
  224. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/mock.ts +1 -1
  225. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyEmail/config.json +1 -1
  226. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyEmail/mock.ts +1 -1
  227. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyIconButtonURL/config.json +64 -0
  228. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +91 -0
  229. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyIconButtonURL/index.tsx +157 -0
  230. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyIconButtonURL/mock.ts +4 -0
  231. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyIconButtonURL/styles.js +7 -0
  232. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyInteger/config.json +1 -1
  233. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyInteger/index.tsx +16 -17
  234. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyInteger/mock.ts +1 -1
  235. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyParagraph/index.tsx +1 -3
  236. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyParagraph/mock.ts +1 -1
  237. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/config.json +1 -1
  238. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/index.tsx +34 -19
  239. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/mock.ts +1 -1
  240. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPhone/index.tsx +17 -9
  241. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPicklist/index.tsx +23 -23
  242. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyRadiobuttons/mock.ts +0 -1
  243. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyText/config.json +1 -1
  244. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyText/index.tsx +0 -1
  245. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyText/mock.ts +1 -1
  246. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTextInput/config.json +1 -1
  247. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTextInput/index.tsx +0 -1
  248. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTextInput/mock.ts +1 -1
  249. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTimeOfDay/demo.stories.tsx +4 -4
  250. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTimeOfDay/index.tsx +0 -2
  251. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTimeOfDay/mock.ts +6 -6
  252. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyURL/index.tsx +1 -2
  253. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyURL/mock.ts +1 -1
  254. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyDetails/demo.stories.tsx +1 -7
  255. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyDetails/index.tsx +4 -9
  256. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyDetails/mock.ts +197 -164
  257. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/config.json +1 -1
  258. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/demo.stories.tsx +13 -1
  259. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/index.tsx +11 -13
  260. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/utils.ts +1 -1
  261. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyPage/OneColumn.tsx +12 -13
  262. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyPage/demo.stories.tsx +1 -1
  263. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyPage/index.tsx +3 -5
  264. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyPage/mock.ts +8 -9
  265. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +1 -6
  266. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnDetails/index.tsx +4 -9
  267. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnDetails/mock.ts +207 -163
  268. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +0 -2
  269. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnForm/mock.ts +121 -122
  270. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/config.json +2 -2
  271. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/demo.stories.tsx +19 -20
  272. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/index.tsx +3 -3
  273. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/demo.stories.tsx +20 -21
  274. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/index.tsx +0 -1
  275. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/mock.ts +0 -1
  276. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageWidget/config.json +43 -43
  277. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageWidget/demo.stories.tsx +45 -2
  278. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageWidget/index.tsx +168 -3
  279. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageWidget/mock.ts +26 -1
  280. package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +2 -2
  281. package/tests/assets/sdk-r/components/createAll/override-sdk/field/CancelAlert/CancelAlert.tsx +2 -0
  282. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Currency/Currency.tsx +36 -26
  283. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Decimal/Decimal.tsx +33 -19
  284. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Multiselect/Multiselect.tsx +1 -1
  285. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Percentage/Percentage.tsx +33 -18
  286. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Phone/Phone.tsx +16 -7
  287. package/tests/assets/sdk-r/components/createAll/override-sdk/field/ScalarList/ScalarList.tsx +2 -0
  288. package/tests/assets/sdk-r/components/createAll/override-sdk/field/UserReference/UserReference.tsx +11 -1
  289. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/Assignment/Assignment.tsx +28 -1
  290. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/DashboardFilter/DashboardFilter.tsx +1 -1
  291. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/DeferLoad/DeferLoad.tsx +5 -1
  292. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/MultiStep/MultiStep.tsx +3 -1
  293. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/NavBar/NavBar.tsx +2 -2
  294. package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseView/CaseView.tsx +2 -1
  295. package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +1 -1
  296. package/tests/assets/sdk-r/components/createAll/override-sdk/template/DataReference/DataReference.tsx +1 -1
  297. package/tests/assets/sdk-r/components/createAll/override-sdk/template/DefaultForm/utils/index.ts +2 -7
  298. package/tests/assets/sdk-r/components/createAll/override-sdk/template/Details/Details.tsx +1 -1
  299. package/tests/assets/sdk-r/components/createAll/override-sdk/template/DetailsThreeColumn/DetailsThreeColumn.tsx +1 -1
  300. package/tests/assets/sdk-r/components/createAll/override-sdk/template/DetailsTwoColumn/DetailsTwoColumn.tsx +1 -1
  301. package/tests/assets/sdk-r/components/createAll/override-sdk/template/FieldGroupTemplate/FieldGroupTemplate.tsx +2 -0
  302. package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/ListView.tsx +20 -31
  303. package/tests/assets/sdk-r/components/createAll/override-sdk/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +1 -1
  304. package/tests/assets/sdk-r/components/createAll/override-sdk/template/NarrowWideDetails/NarrowWideDetails.tsx +1 -1
  305. package/tests/assets/sdk-r/components/createAll/override-sdk/template/PromotedFilters/PromotedFilters.tsx +1 -0
  306. package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +4 -0
  307. package/tests/assets/sdk-r/components/createAll/override-sdk/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +1 -1
  308. package/tests/assets/sdk-r/components/createAll/override-sdk/template/WideNarrowDetails/WideNarrowDetails.tsx +1 -1
  309. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/Attachment/Attachment.tsx +3 -2
  310. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/FileUtility/FileUtility.tsx +1 -1
  311. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/QuickCreate/QuickCreate.tsx +1 -0
package/README.md CHANGED
@@ -8,13 +8,13 @@ This project provides you with an environment to extend SDK-R/SDK-A by giving yo
8
8
 
9
9
  Ensure you have access to the following in your system:
10
10
 
11
- - Pega Infinity Server version 23
11
+ - Pega Infinity Server version 24.1
12
12
 
13
13
  - Git version 2.30 or later
14
14
 
15
- - System node version 18
15
+ - System node version 18, 20
16
16
 
17
- - System npm version 8
17
+ - System npm version 8, 10 (npm 9 not supported)
18
18
 
19
19
  - Installed SDK-R or SDK-A, as the below commands live in the package.json of the SDK-R/SDK-A an NOT in this npm module
20
20
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/dx-component-builder-sdk",
3
- "version": "23.1.15",
3
+ "version": "24.1.10",
4
4
  "description": "Utility for building custom UI components",
5
5
  "bin": "./bin/index.js",
6
6
  "scripts": {
package/src/cli.js CHANGED
@@ -41,7 +41,7 @@ const TASKS = {
41
41
  VALIDATE_SCHEMA: 'validateSchema',
42
42
  UPDATE: 'update',
43
43
  DELETE: 'delete',
44
- DELETE_ALL: "deleteAll",
44
+ DELETE_ALL: 'deleteAll',
45
45
  AUTHENTICATE: 'authenticate',
46
46
  UPGRADE: 'upgrade',
47
47
  SCAN_AND_FIX: 'scanAndFix'
package/src/constants.js CHANGED
@@ -164,6 +164,10 @@ export const COMPONENT_SCHEMA = {
164
164
  name: 'URL',
165
165
  value: 'Text-URL'
166
166
  },
167
+ {
168
+ name: 'Icon Button URL',
169
+ value: 'Icon-Button-URL'
170
+ },
167
171
  {
168
172
  name: 'Integer',
169
173
  value: 'Integer'
@@ -71,11 +71,17 @@ export const zipComponent = async (componentKey, category = CATEGORY_CUSTOM) =>
71
71
  const srcDirectory = await getComponentDirectoryPath(componentKey, category);
72
72
  const buildDirectory = await path.join(path.resolve(), 'dist/components', componentKey);
73
73
  const configJson = `${srcDirectory}/config.json`;
74
+ const localizationJson = `${srcDirectory}/localizations.json`;
74
75
 
75
76
  const zip = new AdmZip();
76
77
 
77
78
  zip.addLocalFolder(srcDirectory, 'src/');
78
79
  zip.addLocalFile(configJson);
80
+
81
+ if (fs.existsSync(localizationJson)) {
82
+ zip.addLocalFile(localizationJson);
83
+ }
84
+
79
85
  zip.addLocalFolder(buildDirectory);
80
86
  const zipContent = zip.toBuffer().toString('base64');
81
87
 
@@ -89,11 +89,17 @@ export const zipComponent = async (componentKey, category = CATEGORY_CUSTOM) =>
89
89
  const srcDirectory = await getComponentDirectoryPath(componentKey, category);
90
90
  const buildDirectory = await path.join(path.resolve(), 'dist/components', componentKey);
91
91
  const configJson = `${srcDirectory}/config.json`;
92
+ const localizationJson = `${srcDirectory}/localizations.json`;
92
93
 
93
94
  const zip = new AdmZip();
94
95
 
95
96
  zip.addLocalFolder(srcDirectory, 'src/');
96
97
  zip.addLocalFile(configJson);
98
+
99
+ if (fs.existsSync(localizationJson)) {
100
+ zip.addLocalFile(localizationJson);
101
+ }
102
+
97
103
  zip.addLocalFolder(buildDirectory);
98
104
  const zipContent = zip.toBuffer().toString('base64');
99
105
 
@@ -266,7 +266,7 @@ export default (
266
266
  {
267
267
  test: /\.(map)$/, /* latest react-sdk-components needs to ignore compiling .d.ts and .map files */
268
268
  loader: 'null-loader',
269
- },
269
+ },
270
270
  // "file" loader makes sure those assets get served by WebpackDevServer.
271
271
  // When you `import` an asset, you get its (virtual) filename.
272
272
  // In production, they would get copied to the `build` folder.
@@ -330,6 +330,19 @@ export default (
330
330
  contextRegExp: /@pega\\cosmos-react-core\\lib\\components\\Icon$/
331
331
  }),
332
332
 
333
+ /* cosmos 6.x and above */
334
+ /* Ignore cosmos icons */
335
+ new webpack.IgnorePlugin({
336
+ resourceRegExp: /^\.\/.*\/.*\.icon$/,
337
+ contextRegExp: /@pega\/cosmos-react-core\/lib\/components\/Icon$/
338
+ }),
339
+
340
+ /* Ignore cosmos icons - windows */
341
+ new webpack.IgnorePlugin({
342
+ resourceRegExp: /^\.\/.*\/.*\.icon$/,
343
+ contextRegExp: /@pega\\cosmos-react-core\\lib\\components\\Icon$/
344
+ }),
345
+
333
346
  new webpack.optimize.LimitChunkCountPlugin({
334
347
  maxChunks: 1
335
348
  }),
@@ -318,6 +318,19 @@ export default (
318
318
  contextRegExp: /@pega\\cosmos-react-core\\lib\\components\\Icon$/
319
319
  }),
320
320
 
321
+ /* cosmos 6.x and above */
322
+ /* Ignore cosmos icons */
323
+ new webpack.IgnorePlugin({
324
+ resourceRegExp: /^\.\/.*\/.*\.icon$/,
325
+ contextRegExp: /@pega\/cosmos-react-core\/lib\/components\/Icon$/
326
+ }),
327
+
328
+ /* Ignore cosmos icons - windows */
329
+ new webpack.IgnorePlugin({
330
+ resourceRegExp: /^\.\/.*\/.*\.icon$/,
331
+ contextRegExp: /@pega\\cosmos-react-core\\lib\\components\\Icon$/
332
+ }),
333
+
321
334
  new webpack.optimize.LimitChunkCountPlugin({
322
335
  maxChunks: 1
323
336
  }),
@@ -262,7 +262,7 @@ export default (
262
262
  {
263
263
  test: /\.(map)$/, /* latest react-sdk-components needs to ignore compiling .d.ts and .map files */
264
264
  loader: 'null-loader',
265
- },
265
+ },
266
266
  // "file" loader makes sure those assets get served by WebpackDevServer.
267
267
  // When you `import` an asset, you get its (virtual) filename.
268
268
  // In production, they would get copied to the `build` folder.
@@ -326,6 +326,19 @@ export default (
326
326
  contextRegExp: /@pega\\cosmos-react-core\\lib\\components\\Icon$/
327
327
  }),
328
328
 
329
+ /* cosmos 6.x and above */
330
+ /* Ignore cosmos icons */
331
+ new webpack.IgnorePlugin({
332
+ resourceRegExp: /^\.\/.*\/.*\.icon$/,
333
+ contextRegExp: /@pega\/cosmos-react-core\/lib\/components\/Icon$/
334
+ }),
335
+
336
+ /* Ignore cosmos icons - windows */
337
+ new webpack.IgnorePlugin({
338
+ resourceRegExp: /^\.\/.*\/.*\.icon$/,
339
+ contextRegExp: /@pega\\cosmos-react-core\\lib\\components\\Icon$/
340
+ }),
341
+
329
342
  new webpack.optimize.LimitChunkCountPlugin({
330
343
  maxChunks: 1
331
344
  }),
@@ -3,7 +3,8 @@ import {
3
3
  CheckboxGroup,
4
4
  FieldValueList,
5
5
  Text,
6
- withConfiguration
6
+ withConfiguration,
7
+ BooleanDisplay
7
8
  } from "@pega/cosmos-react-core";
8
9
 
9
10
  import type { PConnFieldProps } from './PConnProps';
@@ -99,7 +100,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
99
100
  // @ts-ignore
100
101
  displayComponent = (
101
102
  // @ts-ignore
102
- <{{COMPONENT_CLASS_NAME}} value={value} trueLabel={trueLabel} falseLabel={falseLabel} />
103
+ <BooleanDisplay value={value} trueLabel={trueLabel} falseLabel={falseLabel} />
103
104
  );
104
105
  }
105
106
 
@@ -0,0 +1,46 @@
1
+ import {PConnect } from '@pega/pcore-pconnect-typedefs';
2
+
3
+ // PConnProps.d.ts
4
+ // This gives us a place to have each component (which is most DX Components) that is
5
+ // expected to have a getPConnect extend its props (from BaseProps)
6
+ // such that every component will be expected to have a getPConnect() function
7
+ // that returns a PConnect object. (new/better way of doing .propTypes).
8
+ // This PConnProps can be extended to include other props that we know are in every component
9
+ export interface PConnProps {
10
+ // getPConnect should exist for every C11n component. (add @ts-ignore in special cases where it isn't)
11
+ getPConnect: () => typeof PConnect;
12
+
13
+ // Allow any/all other key/value pairs in the BaseProps for now
14
+ // TODO: refine which other props are always expected for various component
15
+ // types and consider further interface "subclassing". For example, we may
16
+ // want to create a "BasePropsForm" that gives guidance on required, readonly, etc.
17
+ // and any other props that every Form component expects.
18
+ // For example, see the PConnFieldProps below.
19
+ // NOTE: if you uncomment the line below, the PConnProps type will allow
20
+ // otherwise undefined types to appear. This can be helpful for debugging
21
+ // or when adding new components whose types aren't yet known.
22
+ // [key: string]: any;
23
+ }
24
+
25
+
26
+ // PConnFieldProps extends PConnProps to bring in the common properties that are
27
+ // associated with most field components (ex: Dropdown, TextInput, etc.) in the
28
+ // components/field directory
29
+ export interface PConnFieldProps extends PConnProps {
30
+ label: string,
31
+ required: boolean,
32
+ disabled: boolean,
33
+ value: any,
34
+ validatemessage: string,
35
+ status?: string,
36
+ onChange?: any,
37
+ onBlur?: any,
38
+ readOnly: boolean,
39
+ testId: string,
40
+ helperText: string,
41
+ displayMode?: string,
42
+ hideLabel: boolean,
43
+ placeholder?: string,
44
+ fieldMetadata?: any,
45
+ additionalProps?: any
46
+ }
@@ -0,0 +1,64 @@
1
+ {
2
+ "name": "{{COMPONENT_KEY}}",
3
+ "label": "{{COMPONENT_LABEL}}",
4
+ "description": "{{DESCRIPTION}}",
5
+ "organization": "{{ORGANIZATION}}",
6
+ "version": "{{VERSION}}",
7
+ "library": "{{LIBRARY}}",
8
+ "allowedApplications": {{{ALLOWEDAPPS}}},
9
+ "componentKey": "{{COMPONENT_KEY}}",
10
+ "type": "{{TYPE}}",
11
+ "subtype": {{{SUB_TYPE}}},
12
+ "icon": "images/pz-url-active.svg",
13
+ "properties": [
14
+ {
15
+ "format": "SELECT",
16
+ "name": "countryCode",
17
+ "label": "Country code",
18
+ "defaultValue": "USA",
19
+ "source": [
20
+ {
21
+ "key": "USA",
22
+ "value": "United States"
23
+ },
24
+ {
25
+ "key": "CAN",
26
+ "value": "Canada"
27
+ },
28
+ {
29
+ "key": "AUS",
30
+ "value": "Australia"
31
+ },
32
+ {
33
+ "key": "JPN",
34
+ "value": "Japan"
35
+ },
36
+ {
37
+ "key": "IND",
38
+ "value": "India"
39
+ },
40
+ {
41
+ "key": "TUR",
42
+ "value": "Turkey"
43
+ }
44
+ ]
45
+ },
46
+ {
47
+ "label": "Advanced",
48
+ "format": "GROUP",
49
+ "collapsible": true,
50
+ "properties": [
51
+ {
52
+ "name": "testId",
53
+ "label": "Test ID",
54
+ "format": "TEXT",
55
+ "ignorePattern": "[^-_\\p{N}\\p{L}]",
56
+ "includeAnnotations": false
57
+ }
58
+ ]
59
+ }
60
+ ],
61
+ "defaultConfig": {
62
+ "label": "@L $this.label"
63
+ }
64
+ }
@@ -0,0 +1,99 @@
1
+
2
+ /* eslint-disable react/jsx-no-useless-fragment */
3
+ // @ts-nocheck
4
+ import type { Meta, StoryObj } from '@storybook/react';
5
+
6
+ import {{COMPONENT_CLASS_NAME}} from './index';
7
+ import { configProps } from './mock';
8
+
9
+ const meta: Meta<typeof {{COMPONENT_CLASS_NAME}}> = {
10
+ title: '{{COMPONENT_CLASS_NAME}}',
11
+ component: {{COMPONENT_CLASS_NAME}},
12
+ excludeStories: /.*Data$/
13
+ };
14
+
15
+ export default meta;
16
+ type Story = StoryObj<typeof {{COMPONENT_CLASS_NAME}}>;
17
+
18
+ if (!window.PCore) {
19
+ window.PCore = {};
20
+ }
21
+
22
+ const statelistData = {
23
+ data: [
24
+ {
25
+ pyLabel: 'Massachusetts',
26
+ pyStateCode: 'MA'
27
+ },
28
+ {
29
+ pyLabel: 'Rhode Island',
30
+ pyStateCode: 'RI'
31
+ },
32
+ {
33
+ pyLabel: 'Connecticut',
34
+ pyStateCode: 'CT'
35
+ }
36
+ ]
37
+ };
38
+
39
+ window.PCore.getDataPageUtils = () => {
40
+ return {
41
+ getDataAsync: () => {
42
+ return new Promise(resolve => {
43
+ resolve(statelistData);
44
+ });
45
+ }
46
+ };
47
+ };
48
+
49
+ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
50
+
51
+ const props = {
52
+ countryCode: configProps.countryCode,
53
+ getPConnect: () => {
54
+ return {
55
+ getValue: value => {
56
+ return value;
57
+ },
58
+ getContextName: () => {
59
+ return 'app/primary_1';
60
+ },
61
+ getLocalizedValue: value => {
62
+ return value;
63
+ },
64
+ getActionsApi: () => {
65
+ return {
66
+ updateFieldValue: () => {
67
+ /* nothing */
68
+ },
69
+ triggerFieldChange: () => {
70
+ /* nothing */
71
+ }
72
+ };
73
+ },
74
+ ignoreSuggestion: () => {
75
+ /* nothing */
76
+ },
77
+ acceptSuggestion: () => {
78
+ /* nothing */
79
+ },
80
+ setInheritedProps: () => {
81
+ /* nothing */
82
+ },
83
+ resolveConfigProps: () => {
84
+ /* nothing */
85
+ }
86
+ };
87
+ }
88
+ };
89
+
90
+ return (
91
+ <>
92
+ <{{COMPONENT_CLASS_NAME}} {...props} {...args} />
93
+ </>
94
+ );
95
+ };
96
+
97
+ Base{{COMPONENT_CLASS_NAME}}.args = {
98
+ countryCode: configProps.countryCode
99
+ };
@@ -0,0 +1,204 @@
1
+ import { useEffect, useState } from 'react';
2
+ import {
3
+ Icon,
4
+ Button,
5
+ withConfiguration,
6
+ registerIcon,
7
+ Table,
8
+ Label,
9
+ Link,
10
+ URLDisplay
11
+ } from '@pega/cosmos-react-core';
12
+ import type { PConnFieldProps } from './PConnProps';
13
+
14
+ // IMPORTANT
15
+ // To use Icons, need to individually import the icon file form @pega/cosmos-react-core (see path below)
16
+ // Icons filename is kabab case (file-name), where as the icon you import is camel case (fileName)
17
+ // Icons need to be registered (camel case), and then used (kabab case)
18
+ import * as listNumber from '@pega/cosmos-react-core/lib/components/Icon/icons/list-number.icon';
19
+ import * as arrowRight from '@pega/cosmos-react-core/lib/components/Icon/icons/arrow-right.icon';
20
+ import * as globe from '@pega/cosmos-react-core/lib/components/Icon/icons/globe.icon';
21
+
22
+ import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
23
+
24
+ // interface for props
25
+ interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
26
+ // If any, enter additional props that only exist on TextInput here
27
+ countryCode: string;
28
+ }
29
+
30
+ export const textFormatter = (value: string) => {
31
+ return <URLDisplay target='_blank' value={value} displayText={value} variant='link' />;
32
+ };
33
+
34
+
35
+ // *************
36
+ // This component is meant to be an example of usage (Icon, Button, Link, etc.) and NOT meant to be
37
+ // used "as is"
38
+ //
39
+ // In this example, Icon is shown on its own and inside a Button
40
+ // Though an Icon can have an "onClick" event is it recommended if you want to click on it,
41
+ // to put it in a Button (shown below), so you can have a tooltip and hover style or put it
42
+ // in a Link (shown below) as a URL.
43
+ //
44
+ // For the button, the click will get a list of states for a given country and display in a
45
+ // table below. The table display will toggle with the click of the button icon. Example shows
46
+ // how to handle click, retrieve data from PCore and display it.
47
+ //
48
+ // Globe icon is an icon placed in a Link element. The Link element to use an icon internally. (NOTE: In general
49
+ // the Link element shows the open icon to the left of the link text, but here we are using
50
+ // another icon, so with "icon" specified in the Link element, the open icon doesn't show)
51
+ // Link elements do not handle bad urls well, so we have a simple validator to prevent the Link element
52
+ // from getting most bad urls.
53
+ //
54
+ // NOTE: because icons have to be imported and registered, you can NOT put the icon name
55
+ // inside the config.json and let the user pick it, if it is not already part of your
56
+ // import and registration (can't be done on the fly)
57
+ // **************
58
+
59
+ // props passed in combination of props from property panel (config.json) and run time props from Constellation
60
+ // any default values in config.pros should be set in defaultProps at bottom of this file
61
+ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
62
+ const { value, displayMode, countryCode = 'USA', getPConnect, testId } = props;
63
+ const [statelist, setStatelist] = useState([]);
64
+ const [showTable, setShowTable] = useState(false);
65
+ const [validUrl, setValidUrl] = useState('about:blank');
66
+ const PConnect = getPConnect();
67
+
68
+ // IMPORTANT: need to register icons used in camel case
69
+ registerIcon(listNumber, arrowRight, globe);
70
+
71
+
72
+ // setting up columns for the work list table
73
+ const columns = [
74
+ { renderer: 'stateName', label: PConnect.getLocalizedValue('State name', '', '') },
75
+ { renderer: 'stateCode', label: PConnect.getLocalizedValue('State code', '', '') }
76
+ ];
77
+
78
+ // toggle showing table and getting table data
79
+ function showHideTable() {
80
+ setShowTable(prevShowTable => !prevShowTable);
81
+ }
82
+
83
+ // check if url is valid (simple)
84
+ function validateUrl(href: string) {
85
+ return /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(
86
+ href
87
+ );
88
+ }
89
+
90
+ // Testing to see if value entered is valid url, if not can't use it.
91
+ // Reason for this code is that you can NOT pass to Link component
92
+ // a bad url, or it will error out.
93
+ // For example: Since the value is the property field,
94
+ // it could be entered from another component and thus as it is
95
+ // entered (typed in), it won't be valid until it is all entered.
96
+ // NOTE: can't have a blank value for the url as the Link element will error out
97
+ // in App studio preview
98
+ useEffect(() => {
99
+ if (validateUrl(value)) {
100
+ setValidUrl(value);
101
+ } else {
102
+ setValidUrl('about:blank');
103
+ }
104
+ }, [value]);
105
+
106
+ // going to get data for worklist to put into a table
107
+ // data comes from calling a PCore function to get
108
+ // get data from a data page and a PConnect function
109
+ // to get getContextName
110
+ useEffect(() => {
111
+ const dataViewName = 'D_pyStateList';
112
+ const context = PConnect.getContextName();
113
+ const params = { pyCountry: countryCode };
114
+
115
+ // only retrieve table data if table is shown
116
+ if (showTable) {
117
+ PCore.getDataPageUtils()
118
+ .getDataAsync(dataViewName, context, params, null, null)
119
+ // @ts-ignore
120
+ .then((response: any) => {
121
+ // table requires an index or will get setExtraStackFrame error
122
+ setStatelist(
123
+ response.data.map((entry: any, index: number) => {
124
+ // mapping the data into the column names
125
+ // MUST have an id/index or will get a setExtraStackFrame error
126
+ // put a key in the table
127
+ return {
128
+ stateName: entry.pyLabel,
129
+ stateCode: entry.pyStateCode,
130
+ id: index
131
+ };
132
+ })
133
+ );
134
+ })
135
+ .catch((error: any) => {
136
+ console.log(error);
137
+ });
138
+ }
139
+ }, [PConnect, countryCode, showTable]);
140
+
141
+ // when DISPLAY_ONLY, in this example we will just show the URL.
142
+ if (displayMode === 'DISPLAY_ONLY') {
143
+ const displayComp = textFormatter(validUrl);
144
+ return (
145
+ <Styled{{COMPONENT_CLASS_NAME}}Wrapper> {displayComp} </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
146
+ );
147
+ }
148
+
149
+ return (
150
+ <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
151
+ {{! pick new delimiters for mustache }}
152
+ {{=<% %>=}}
153
+ <div style={{ display: 'flex' }} data-testid={testId}>
154
+ <Icon
155
+ style={{ height: '1.5rem', width: '1.5rem' }}
156
+ // icon name is kabab case
157
+ name='arrow-right'
158
+ role='img'
159
+ aria-label='arrow right'
160
+ />
161
+ <Label style={{ margin: '0.1rem' }}>
162
+ {' '}
163
+ {PConnect.getLocalizedValue('State list for', '', '')}{' '}
164
+ {PConnect.getLocalizedValue(`${countryCode}`, '', '')}{' '}
165
+ </Label>
166
+ <Button
167
+ icon
168
+ label={PConnect.getLocalizedValue('Click to show/hide state list', '', '')}
169
+ variant='link'
170
+ compact={false}
171
+ onClick={showHideTable}
172
+ >
173
+ <Icon
174
+ style={{ height: '1.5rem', width: '1.5rem' }}
175
+ // icon name is kabab case
176
+ name='list-number'
177
+ role='img'
178
+ aria-label='numbered list'
179
+ />
180
+ </Button>
181
+ <Link href={validUrl} variant='link' label={validUrl} icon>
182
+ <Icon
183
+ style={{ height: '1.5rem', width: '1.5rem' }}
184
+ // icon name is kabab case
185
+ name='globe'
186
+ role='img'
187
+ aria-label='open link'
188
+ />
189
+ </Link>
190
+ </div>
191
+ {showTable && (
192
+ <Table
193
+ title={PConnect.getLocalizedValue('State list', '', '')}
194
+ columns={columns}
195
+ data={statelist}
196
+ />
197
+ )}
198
+ <%={{ }}=%> {{! revert delimiters for mustache }}
199
+ </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
200
+ );
201
+ }
202
+
203
+
204
+ export default withConfiguration({{COMPONENT_CLASS_NAME}});
@@ -0,0 +1,5 @@
1
+
2
+ // @ts-nocheck
3
+ export const configProps = {
4
+ countryCode: 'USA'
5
+ };
@@ -0,0 +1,8 @@
1
+ // individual style, comment out above, and uncomment here and add styles
2
+ import styled, { css } from 'styled-components';
3
+
4
+ export default styled.div(() => {
5
+ return css`
6
+ margin: 0px 0;
7
+ `;
8
+ });
@@ -39,7 +39,6 @@ interface StateProps {
39
39
  hasSuggestions: boolean;
40
40
  }
41
41
 
42
-
43
42
  export const formatExists = (formatterVal: string) => {
44
43
  const formatterValues = [
45
44
  "TextInput",