@pega/custom-dx-components 8.8.17 → 8.8.18

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 (243) hide show
  1. package/.prettierrc.json +7 -1
  2. package/babel.config.cjs +13 -0
  3. package/jest.config.cjs +37 -0
  4. package/package.json +12 -4
  5. package/src/auth.js +9 -3
  6. package/src/constants.js +7 -5
  7. package/src/currentPath.cjs +1 -0
  8. package/src/tasks/authenticate/index.js +43 -40
  9. package/src/tasks/build/helper.js +18 -31
  10. package/src/tasks/build/index.js +26 -6
  11. package/src/tasks/build-all/index.js +15 -3
  12. package/src/tasks/bundle/builder/index.js +1 -1
  13. package/src/tasks/bundle/builder/webpack.config.js +1 -3
  14. package/src/tasks/create/index.js +17 -7
  15. package/src/tasks/create/templates/Constellation/Field/Boolean/styles.js.mustache +13 -6
  16. package/src/tasks/create/templates/Constellation/Field/Date/DateFormatter.js.mustache +7 -7
  17. package/src/tasks/create/templates/Constellation/Field/Date/date.js.mustache +8 -8
  18. package/src/tasks/create/templates/Constellation/Field/Date/styles.js.mustache +13 -6
  19. package/src/tasks/create/templates/Constellation/Field/DateTime/date-time.js.mustache +10 -10
  20. package/src/tasks/create/templates/Constellation/Field/DateTime/date-utils.js.mustache +6 -5
  21. package/src/tasks/create/templates/Constellation/Field/DateTime/date.js.mustache +6 -3
  22. package/src/tasks/create/templates/Constellation/Field/DateTime/styles.js.mustache +13 -6
  23. package/src/tasks/create/templates/Constellation/Field/Decimal/styles.js.mustache +13 -6
  24. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/styles.js.mustache +13 -6
  25. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/styles.js.mustache +13 -6
  26. package/src/tasks/create/templates/Constellation/Field/Integer/styles.js.mustache +13 -6
  27. package/src/tasks/create/templates/Constellation/Field/Picklist/styles.js.mustache +13 -6
  28. package/src/tasks/create/templates/Constellation/Field/Text/styles.js.mustache +13 -6
  29. package/src/tasks/create/templates/Constellation/Field/Text-Email/styles.js.mustache +13 -6
  30. package/src/tasks/create/templates/Constellation/Field/Text-Input/styles.js.mustache +13 -6
  31. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/styles.js.mustache +13 -6
  32. package/src/tasks/create/templates/Constellation/Field/Text-Phone/styles.js.mustache +13 -6
  33. package/src/tasks/create/templates/Constellation/Field/Text-URL/styles.js.mustache +13 -6
  34. package/src/tasks/create/templates/Constellation/Field/TimeOfDay/styles.js.mustache +13 -6
  35. package/src/tasks/create/templates/Constellation/Field/TimeOfDay/time-of-day.js.mustache +6 -5
  36. package/src/tasks/create/templates/Constellation/Template/DETAILS/styles.js.mustache +13 -6
  37. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/styles.js.mustache +13 -6
  38. package/src/tasks/create/templates/Constellation/Template/FORM/styles.js.mustache +13 -6
  39. package/src/tasks/create/templates/Constellation/Template/FORM-region/styles.js.mustache +13 -6
  40. package/src/tasks/create/templates/Constellation/Template/PAGE/styles.js.mustache +13 -6
  41. package/src/tasks/create/templates/Constellation/Widget/CASE/styles.js.mustache +13 -6
  42. package/src/tasks/create/templates/Constellation/Widget/PAGE/styles.js.mustache +13 -6
  43. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/styles.js.mustache +13 -6
  44. package/src/tasks/create-all/index.js +109 -150
  45. package/src/tasks/delete/helper.js +87 -53
  46. package/src/tasks/delete/index.js +8 -15
  47. package/src/tasks/delete-all/helper.js +132 -85
  48. package/src/tasks/delete-all/index.js +8 -15
  49. package/src/tasks/init/index.js +20 -22
  50. package/src/tasks/init/template/babel.config.cjs +13 -0
  51. package/src/tasks/init/template/jest.config.cjs +21 -0
  52. package/src/tasks/init/template/package.json.mustache +6 -4
  53. package/src/tasks/init/template/test/assets/components/create/Pega_DXIL_MyTestText/config.json +55 -0
  54. package/src/tasks/init/template/test/assets/components/create/Pega_DXIL_MyTestText/demo.stories.jsx +51 -0
  55. package/src/tasks/init/template/test/assets/components/create/Pega_DXIL_MyTestText/index.jsx +60 -0
  56. package/src/tasks/init/template/test/assets/components/create/Pega_DXIL_MyTestText/mock.stories.js +13 -0
  57. package/src/tasks/init/template/test/assets/components/create/Pega_DXIL_MyTestText/styles.js +14 -0
  58. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyBoolean/Boolean.js +38 -0
  59. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyBoolean/boolean-format.js +26 -0
  60. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyBoolean/config.json +145 -0
  61. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyBoolean/demo.stories.jsx +61 -0
  62. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyBoolean/event-utils.js +18 -0
  63. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyBoolean/index.jsx +170 -0
  64. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyBoolean/mock.stories.js +21 -0
  65. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyBoolean/styles.js +14 -0
  66. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCaseWidget/OneColumnPage.svg +36 -0
  67. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCaseWidget/config.json +23 -0
  68. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCaseWidget/demo.stories.jsx +78 -0
  69. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCaseWidget/index.jsx +73 -0
  70. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCaseWidget/mock.stories.js +390 -0
  71. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCaseWidget/styles.js +14 -0
  72. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCurrency/config.json +291 -0
  73. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCurrency/demo.stories.jsx +53 -0
  74. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCurrency/event-utils.js +18 -0
  75. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCurrency/index.jsx +296 -0
  76. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCurrency/mock.stories.js +23 -0
  77. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCurrency/styles.js +14 -0
  78. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCurrency/suggestions-handler.js +10 -0
  79. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDate/DateFormatter.js +61 -0
  80. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDate/FormattedText.jsx +41 -0
  81. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDate/config.json +195 -0
  82. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDate/date.js +439 -0
  83. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDate/demo.stories.jsx +73 -0
  84. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDate/index.jsx +256 -0
  85. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDate/mock.stories.js +23 -0
  86. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDate/styles.js +14 -0
  87. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDate/suggestions-handler.js +10 -0
  88. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDateTime/config.json +256 -0
  89. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDateTime/date-time.js +92 -0
  90. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDateTime/date-utils.js +288 -0
  91. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDateTime/date.js +331 -0
  92. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDateTime/demo.stories.jsx +73 -0
  93. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDateTime/index.jsx +254 -0
  94. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDateTime/mock.stories.js +23 -0
  95. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDateTime/styles.js +14 -0
  96. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDateTime/suggestions-handler.js +10 -0
  97. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDecimal/config.json +278 -0
  98. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDecimal/demo.stories.jsx +49 -0
  99. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDecimal/event-utils.js +18 -0
  100. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDecimal/index.jsx +270 -0
  101. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDecimal/mock.stories.js +21 -0
  102. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDecimal/styles.js +14 -0
  103. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDecimal/suggestions-handler.js +10 -0
  104. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDetails/OneColumnDetails.svg +22 -0
  105. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDetails/StatusWork.jsx +26 -0
  106. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDetails/config.json +35 -0
  107. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDetails/demo.stories.jsx +132 -0
  108. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDetails/index.jsx +83 -0
  109. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDetails/mock.stories.js +189 -0
  110. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDetails/styles.js +14 -0
  111. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDetails/utils.js +152 -0
  112. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyEmail/config.json +111 -0
  113. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyEmail/demo.stories.jsx +48 -0
  114. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyEmail/event-utils.js +18 -0
  115. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyEmail/index.jsx +231 -0
  116. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyEmail/mock.stories.js +22 -0
  117. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyEmail/styles.js +14 -0
  118. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyEmail/suggestions-handler.js +10 -0
  119. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyForm/DefaultForm.svg +29 -0
  120. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyForm/config.json +45 -0
  121. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyForm/demo.stories.jsx +166 -0
  122. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyForm/index.jsx +42 -0
  123. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyForm/mock.stories.js +137 -0
  124. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyForm/styles.js +14 -0
  125. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyInteger/config.json +344 -0
  126. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyInteger/demo.stories.jsx +49 -0
  127. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyInteger/event-utils.js +18 -0
  128. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyInteger/index.jsx +333 -0
  129. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyInteger/mock.stories.js +21 -0
  130. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyInteger/styles.js +14 -0
  131. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyInteger/suggestions-handler.js +10 -0
  132. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPage/GetNextWork.jsx +35 -0
  133. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPage/OneColumnPage.svg +36 -0
  134. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPage/config.json +32 -0
  135. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPage/demo.stories.jsx +102 -0
  136. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPage/index.jsx +70 -0
  137. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPage/localizations.json +4 -0
  138. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPage/mock.stories.js +94 -0
  139. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPage/styles.js +14 -0
  140. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPage/utils.js +229 -0
  141. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageCaseWidget/Avatar.jsx +75 -0
  142. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageCaseWidget/OneColumnPage.svg +36 -0
  143. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageCaseWidget/Operator.jsx +237 -0
  144. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageCaseWidget/config.json +66 -0
  145. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageCaseWidget/demo.stories.jsx +68 -0
  146. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageCaseWidget/index.jsx +108 -0
  147. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageCaseWidget/mock.stories.js +51 -0
  148. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageCaseWidget/styles.js +14 -0
  149. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageWidget/OneColumnPage.svg +36 -0
  150. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageWidget/config.json +59 -0
  151. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageWidget/demo.stories.jsx +30 -0
  152. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageWidget/index.jsx +48 -0
  153. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageWidget/mock.stories.js +23 -0
  154. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageWidget/styles.js +14 -0
  155. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyParagraph/config.json +111 -0
  156. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyParagraph/demo.stories.jsx +48 -0
  157. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyParagraph/event-utils.js +18 -0
  158. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyParagraph/index.jsx +231 -0
  159. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyParagraph/mock.stories.js +20 -0
  160. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyParagraph/styles.js +14 -0
  161. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyParagraph/suggestions-handler.js +10 -0
  162. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPercentage/config.json +93 -0
  163. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPercentage/demo.stories.jsx +49 -0
  164. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPercentage/event-utils.js +18 -0
  165. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPercentage/index.jsx +275 -0
  166. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPercentage/mock.stories.js +21 -0
  167. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPercentage/styles.js +14 -0
  168. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPercentage/suggestions-handler.js +10 -0
  169. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPhone/config.json +123 -0
  170. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPhone/demo.stories.jsx +46 -0
  171. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPhone/event-utils.js +18 -0
  172. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPhone/index.jsx +266 -0
  173. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPhone/mock.stories.js +37 -0
  174. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPhone/styles.js +14 -0
  175. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPhone/suggestions-handler.js +10 -0
  176. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPicklist/config.json +114 -0
  177. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPicklist/demo.stories.jsx +78 -0
  178. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPicklist/event-utils.js +18 -0
  179. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPicklist/index.jsx +351 -0
  180. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPicklist/mock.stories.js +67 -0
  181. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPicklist/styles.js +14 -0
  182. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPicklist/suggestions-handler.js +10 -0
  183. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyText/config.json +55 -0
  184. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyText/demo.stories.jsx +51 -0
  185. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyText/index.jsx +60 -0
  186. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyText/mock.stories.js +13 -0
  187. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyText/styles.js +14 -0
  188. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTextInput/StatusWork.jsx +26 -0
  189. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTextInput/config.json +111 -0
  190. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTextInput/demo.stories.jsx +48 -0
  191. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTextInput/event-utils.js +18 -0
  192. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTextInput/index.jsx +239 -0
  193. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTextInput/mock.stories.js +21 -0
  194. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTextInput/styles.js +14 -0
  195. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTextInput/suggestions-handler.js +10 -0
  196. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTimeOfDay/config.json +185 -0
  197. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTimeOfDay/demo.stories.jsx +57 -0
  198. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTimeOfDay/index.jsx +213 -0
  199. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTimeOfDay/mock.stories.js +20 -0
  200. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTimeOfDay/styles.js +14 -0
  201. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTimeOfDay/suggestions-handler.js +10 -0
  202. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTimeOfDay/time-of-day.js +288 -0
  203. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnDetails/StatusWork.jsx +26 -0
  204. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnDetails/TwoColumnDetails.svg +28 -0
  205. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnDetails/config.json +42 -0
  206. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnDetails/demo.stories.jsx +136 -0
  207. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnDetails/index.jsx +83 -0
  208. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnDetails/mock.stories.js +230 -0
  209. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnDetails/styles.js +14 -0
  210. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnDetails/utils.js +155 -0
  211. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnForm/TwoColumn.svg +38 -0
  212. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnForm/config.json +27 -0
  213. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnForm/demo.stories.jsx +175 -0
  214. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnForm/index.jsx +45 -0
  215. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnForm/mock.stories.js +143 -0
  216. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnForm/styles.js +14 -0
  217. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyURL/config.json +237 -0
  218. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyURL/demo.stories.jsx +46 -0
  219. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyURL/event-utils.js +18 -0
  220. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyURL/index.jsx +232 -0
  221. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyURL/mock.stories.js +22 -0
  222. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyURL/styles.js +14 -0
  223. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyURL/suggestions-handler.js +10 -0
  224. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyURL/text-url.jsx +173 -0
  225. package/src/tasks/init/template/test/functionTest/localCreateAllListDeleteAll.test.js +157 -0
  226. package/src/tasks/init/template/test/functionTest/localCreateBuildAllDeleteAll.test.js +148 -0
  227. package/src/tasks/init/template/test/functionTest/localCreateBuildDelete.test.js +84 -0
  228. package/src/tasks/init/template/test/functionTest/localCreateListDelete.test.js +108 -0
  229. package/src/tasks/init/template/test/functionTest/localCreatePublishAllDeleteAll.test.js +148 -0
  230. package/src/tasks/init/template/test/functionTest/localCreatePublishDelete.test.js +84 -0
  231. package/src/tasks/init/template/test/functionTest/localCreateRenameDelete.test.js +84 -0
  232. package/src/tasks/init/template/test/functionTest/localPromoteRevertWP.test.js +59 -0
  233. package/src/tasks/list/helper.js +129 -61
  234. package/src/tasks/list/index.js +3 -4
  235. package/src/tasks/promote-webpack/index.js +45 -13
  236. package/src/tasks/publish/helper.js +69 -89
  237. package/src/tasks/publish/index.js +29 -12
  238. package/src/tasks/publish-all/helper.js +66 -92
  239. package/src/tasks/publish-all/index.js +30 -18
  240. package/src/tasks/rename/index.js +127 -97
  241. package/src/tasks/revert-webpack/index.js +4 -4
  242. package/src/util.js +205 -127
  243. package/test/unitTest/util.test.js +544 -0
@@ -3,10 +3,12 @@ import inquirer from 'inquirer';
3
3
  import ora from 'ora';
4
4
 
5
5
  import {
6
+ deleteInfinityServerComponent,
7
+ deleteLaunchpadServerComponent,
6
8
  deleteLocalComponent,
7
- deleteServerComponent,
8
9
  getComponents,
9
10
  getPegaServerConfig,
11
+ standardizeStr,
10
12
  validateRulesetVersion
11
13
  } from '../../util.js';
12
14
  import { getComponentsFromServer } from '../list/helper.js';
@@ -16,10 +18,9 @@ export const SOURCE_OF_COMPONENT_TYPES = {
16
18
  LOCAL: 'Local'
17
19
  };
18
20
 
19
- export const getDeleteComponentsQuestions = async (options, sourceOfComponentsOption) => {
21
+ export const getDeleteComponentsQuestions = async (options) => {
20
22
  const defaultPegaServerConfig = await getPegaServerConfig();
21
23
 
22
-
23
24
  return [
24
25
  {
25
26
  name: 'sourceOfComponents',
@@ -34,30 +35,42 @@ export const getDeleteComponentsQuestions = async (options, sourceOfComponentsOp
34
35
  ];
35
36
  };
36
37
 
37
-
38
-
39
- export const deleteLocalComponents = async sourceOfComponents => {
38
+ export const deleteLocalComponents = async (sourceOfComponents, options) => {
40
39
  const localComponents = await getComponents();
41
40
 
42
- for (var index in localComponents) {
41
+ // eslint-disable-next-line no-restricted-syntax, guard-for-in
42
+ for (const index in localComponents) {
43
43
  console.log(chalk.bold.green(localComponents[index]));
44
44
  }
45
45
 
46
46
  if (localComponents.length > 0) {
47
- const answers = await inquirer.prompt([
48
-
49
- {
50
- name: 'confirmDeletion',
51
- type: 'confirm',
52
- message: 'Delete all local ?',
53
- default: false
47
+ if (options.params.length >= 5) {
48
+ const sDeletion = options.params[4];
49
+ const confirmDeletion = sDeletion === 'Y' || sDeletion === 'y' || sDeletion === true || sDeletion === 'true';
50
+ if (confirmDeletion) {
51
+ // eslint-disable-next-line no-restricted-syntax, guard-for-in
52
+ for (const index in localComponents) {
53
+ const componentToDelete = localComponents[index];
54
+ // console.log(chalk.bold.green("Deleting: " + componentToDelete));
55
+ // eslint-disable-next-line no-await-in-loop
56
+ await deleteLocalComponent(componentToDelete);
57
+ }
54
58
  }
55
- ]);
56
- if (answers.confirmDeletion) {
57
- for (var index in localComponents) {
58
- var componentToDelete = localComponents[index];
59
- //console.log(chalk.bold.green("Deleting: " + componentToDelete));
60
- await deleteLocalComponent(componentToDelete);
59
+ } else {
60
+ const answers = await inquirer.prompt([
61
+ {
62
+ name: 'confirmDeletion',
63
+ type: 'confirm',
64
+ message: 'Delete all local ?',
65
+ default: false
66
+ }
67
+ ]);
68
+ if (answers.confirmDeletion) {
69
+ for (const component of localComponents) {
70
+ // console.log(chalk.bold.green("Deleting: " + componentToDelete));
71
+ // eslint-disable-next-line no-await-in-loop
72
+ await deleteLocalComponent(component);
73
+ }
61
74
  }
62
75
  }
63
76
  } else {
@@ -67,87 +80,121 @@ export const deleteLocalComponents = async sourceOfComponents => {
67
80
 
68
81
  export const deleteServerComponents = async (sourceOfComponents, answers) => {
69
82
  const spinner = ora('Fetching components from server').start();
83
+ const defaultPegaServerConfig = await getPegaServerConfig();
84
+ const isLaunchpad = defaultPegaServerConfig.serverType === 'launchpad';
70
85
  const data = await getComponentsFromServer(answers);
71
- const defaultPegaConfig = await getPegaServerConfig();
72
86
 
73
- const serverComponents = JSON.parse(data);
87
+ // const serverComponents = isLaunchpad ? data : data.pxResults;
88
+ let serverComponents;
89
+ if (isLaunchpad) {
90
+ serverComponents = data;
91
+ } else {
92
+ try {
93
+ if (typeof data === 'object') {
94
+ serverComponents = data.pxResults;
95
+ } else {
96
+ serverComponents = JSON.parse(data).pxResults;
97
+ }
98
+ } catch (ex) {
99
+ /* empty */
100
+ }
101
+ }
102
+
74
103
  spinner.stop();
75
- if (serverComponents && serverComponents.pxResults?.length > 0) {
76
- const choicesArr = serverComponents.pxResults.map(({ label, pyRuleSet, pyRuleSetVersion }) => {
77
- const name = `${standardizeStr(label, 45)} ${standardizeStr(pyRuleSet, 30)} ${standardizeStr(
78
- pyRuleSetVersion,
79
- 20
80
- )}`;
81
-
82
- const value = `${label}~|~${pyRuleSet}~|~${pyRuleSetVersion}`;
83
- const short = `Selected component : ${chalk.redBright(
84
- `${label} ${pyRuleSet} : ${pyRuleSetVersion}`
85
- )}`;
86
-
87
- return { name, value, short };
88
- });
89
-
90
- const selectedComp = await inquirer.prompt([
91
- {
92
- name: 'rulesetName',
93
- message: 'Enter ruleset name',
94
- default: defaultPegaConfig.rulesetName,
95
- validate: value => {
96
- if (value.trim()) {
97
- return true;
98
- }
99
- return 'Ruleset name cannot be empty';
104
+
105
+ if (serverComponents && serverComponents?.length > 0) {
106
+ if (isLaunchpad) {
107
+ serverComponents.forEach((component) => {
108
+ console.log(chalk.bold.green(component.name));
109
+ });
110
+
111
+ const confirmDeletionAnswers = await inquirer.prompt([
112
+ {
113
+ name: 'confirmDeletion',
114
+ type: 'confirm',
115
+ message: 'All custom components for the tenant would be deleted. Do you want to proceed ?',
116
+ default: false
100
117
  }
101
- },
102
- {
103
- name: 'rulesetVersion',
104
- message: 'Enter ruleset version',
105
- default: defaultPegaConfig.rulesetVersion,
106
- validate: value => {
107
- if (validateRulesetVersion(value)) {
108
- return true;
109
- }
110
- return 'Please provide compatible version e.g 01-01-01';
118
+ ]);
119
+
120
+ if (confirmDeletionAnswers.confirmDeletion) {
121
+ const componentsList = serverComponents.map((component) => `${component.name}~|~`);
122
+ for (const componentToDelete of componentsList) {
123
+ // eslint-disable-next-line no-await-in-loop
124
+ await deleteLaunchpadServerComponent(componentToDelete);
111
125
  }
112
126
  }
127
+ } else {
128
+ const choicesArr = serverComponents.map(({ label, pyRuleSet, pyRuleSetVersion }) => {
129
+ const name = `${standardizeStr(label, 45)} ${standardizeStr(pyRuleSet, 30)} ${standardizeStr(pyRuleSetVersion, 20)}`;
130
+
131
+ const value = `${label}~|~${pyRuleSet}~|~${pyRuleSetVersion}`;
132
+ const short = `\n Selected component : ${chalk.redBright(`${label} ${pyRuleSet} : ${pyRuleSetVersion}`)}`;
133
+
134
+ return { name, value, short };
135
+ });
136
+
137
+ const selectedComp = await inquirer.prompt([
138
+ {
139
+ name: 'rulesetName',
140
+ message: 'Enter ruleset name',
141
+ default: defaultPegaServerConfig.rulesetName,
142
+ validate: (value) => {
143
+ if (value.trim()) {
144
+ return true;
145
+ }
146
+ return 'Ruleset name cannot be empty';
147
+ }
148
+ },
149
+ {
150
+ name: 'rulesetVersion',
151
+ message: 'Enter ruleset version',
152
+ default: defaultPegaServerConfig.rulesetVersion,
153
+ validate: (value) => {
154
+ if (validateRulesetVersion(value)) {
155
+ return true;
156
+ }
157
+ return 'Please provide compatible version e.g 01-01-01';
158
+ }
159
+ }
113
160
  ]);
114
161
 
115
- for (var index in choicesArr) {
116
- var componentToDelete = choicesArr[index].value;
117
- var arData = componentToDelete.split("~|~");
118
- if (arData[1] == selectedComp.rulesetName && arData[2] == selectedComp.rulesetVersion) {
119
- console.log(chalk.bold.green(arData[0]));
162
+ let bHasAtLeastOneComponent = false;
163
+ for (const choice of choicesArr) {
164
+ const componentToDelete = choice.value;
165
+ const [name, rulesetName, rulesetVersion] = componentToDelete.split('~|~');
166
+ if (rulesetName === selectedComp.rulesetName && rulesetVersion === selectedComp.rulesetVersion) {
167
+ console.log(chalk.bold.green(name));
168
+ bHasAtLeastOneComponent = true;
120
169
  }
121
170
  }
122
171
 
123
-
124
- const answers = await inquirer.prompt([
125
- {
126
- name: 'confirmDeletion',
127
- type: 'confirm',
128
- message: 'Do you want to delete these components ?',
129
- default: false
172
+ if (!bHasAtLeastOneComponent) {
173
+ console.log(chalk.bold.redBright(`No custom components in ${sourceOfComponents} that match ruleSet:${selectedComp.rulesetName}.`));
174
+ process.exit();
130
175
  }
131
- ]);
132
- if (answers.confirmDeletion) {
133
- for (var index in choicesArr) {
134
- var componentToDelete = choicesArr[index].value;
135
- var arData = componentToDelete.split("~|~");
136
- if (arData[1] == selectedComp.rulesetName && arData[2] == selectedComp.rulesetVersion) {
137
- await deleteServerComponent(componentToDelete);
176
+
177
+ const confirmDeletionAnswers = await inquirer.prompt([
178
+ {
179
+ name: 'confirmDeletion',
180
+ type: 'confirm',
181
+ message: 'Do you want to delete these components ?',
182
+ default: false
183
+ }
184
+ ]);
185
+ if (confirmDeletionAnswers.confirmDeletion) {
186
+ for (const choice of choicesArr) {
187
+ const componentToDelete = choice.value;
188
+ // eslint-disable-next-line no-unused-vars
189
+ const [name, rulesetName, rulesetVersion] = componentToDelete.split('~|~');
190
+ if (rulesetName === selectedComp.rulesetName && rulesetVersion === selectedComp.rulesetVersion) {
191
+ // eslint-disable-next-line no-await-in-loop
192
+ await deleteInfinityServerComponent(componentToDelete);
193
+ }
138
194
  }
139
195
  }
140
196
  }
141
-
142
-
143
197
  } else {
144
198
  console.log(chalk.bold.redBright(`No custom components in ${sourceOfComponents}`));
145
199
  }
146
200
  };
147
-
148
- export const standardizeStr = (str, leng) => {
149
- for (let i = str.length; i <= leng; i++) {
150
- str += ' ';
151
- }
152
- return str;
153
- };
@@ -1,20 +1,13 @@
1
1
  import inquirer from 'inquirer';
2
- import ora from 'ora';
3
- import chalk from 'chalk';
4
-
5
- import {
6
- deleteLocalComponents,
7
- SOURCE_OF_COMPONENT_TYPES,
8
- deleteServerComponents,
9
- getDeleteComponentsQuestions
10
- } from './helper.js';
11
2
 
12
3
  import { showVersion } from '../../util.js';
13
4
 
14
- const deleteComponentsFn = async (sourceOfComponents, answers) => {
5
+ import { deleteLocalComponents, SOURCE_OF_COMPONENT_TYPES, deleteServerComponents, getDeleteComponentsQuestions } from './helper.js';
6
+
7
+ const deleteComponentsFn = async (sourceOfComponents, answers, options) => {
15
8
  switch (sourceOfComponents) {
16
9
  case SOURCE_OF_COMPONENT_TYPES.LOCAL: {
17
- await deleteLocalComponents(sourceOfComponents);
10
+ await deleteLocalComponents(sourceOfComponents, options);
18
11
  break;
19
12
  }
20
13
  case SOURCE_OF_COMPONENT_TYPES.SERVER: {
@@ -28,22 +21,22 @@ const deleteComponentsFn = async (sourceOfComponents, answers) => {
28
21
  }
29
22
  };
30
23
 
31
- export default async options => {
24
+ export default async (options) => {
32
25
  showVersion();
33
26
 
34
27
  let sourceOfComponentsOption = SOURCE_OF_COMPONENT_TYPES.LOCAL;
35
28
  if (options.params[3] === SOURCE_OF_COMPONENT_TYPES.LOCAL) {
36
29
  sourceOfComponentsOption = options.params[3];
37
- await deleteComponentsFn(sourceOfComponentsOption);
30
+ await deleteComponentsFn(sourceOfComponentsOption, null, options);
38
31
  } else if (options.params[3] === SOURCE_OF_COMPONENT_TYPES.SERVER) {
39
32
  sourceOfComponentsOption = options.params[3];
40
33
  const questions = await getDeleteComponentsQuestions(options, sourceOfComponentsOption);
41
34
  const answers = await inquirer.prompt(questions);
42
- await deleteComponentsFn(sourceOfComponentsOption, answers);
35
+ await deleteComponentsFn(sourceOfComponentsOption, answers, options);
43
36
  } else {
44
37
  const questions = await getDeleteComponentsQuestions(options);
45
38
  const answers = await inquirer.prompt(questions);
46
39
  const { sourceOfComponents } = answers;
47
- await deleteComponentsFn(sourceOfComponents, answers);
40
+ await deleteComponentsFn(sourceOfComponents, answers, options);
48
41
  }
49
42
  };
@@ -11,12 +11,7 @@ import Listr from 'listr';
11
11
  import gitignore from 'gitignore';
12
12
  import inquirer from 'inquirer';
13
13
 
14
- import {
15
- compileMustacheTemplate,
16
- isPascalCase,
17
- convertIntoPascalCase,
18
- sanitize
19
- } from '../../util.js';
14
+ import { compileMustacheTemplate, isPascalCase, convertIntoPascalCase, sanitize } from '../../util.js';
20
15
 
21
16
  import { getInitProjectQuestions } from './helper.js';
22
17
 
@@ -26,7 +21,7 @@ const copy = promisify(ncp);
26
21
  const writeGitignore = promisify(gitignore.writeFile);
27
22
  const writeFile = promisify(fs.writeFile);
28
23
 
29
- const createGitignore = async options => {
24
+ const createGitignore = async (options) => {
30
25
  const file = fs.createWriteStream(path.join(options.targetDirectory, '.gitignore'), {
31
26
  flags: 'a'
32
27
  });
@@ -36,13 +31,13 @@ const createGitignore = async options => {
36
31
  });
37
32
  };
38
33
 
39
- const createLicense = async options => {
34
+ const createLicense = async (options) => {
40
35
  const targetPath = path.join(options.targetDirectory, 'LICENSE');
41
36
  const licenseContent = 'Enter license text here';
42
37
  return writeFile(targetPath, licenseContent, 'utf8');
43
38
  };
44
39
 
45
- const copyProjectTemplate = async options => {
40
+ const copyProjectTemplate = async (options) => {
46
41
  await copy(options.templateDirectory, options.targetDirectory, {
47
42
  clobber: false
48
43
  });
@@ -73,7 +68,7 @@ const copyProjectTemplate = async options => {
73
68
  await createLicense(options);
74
69
  };
75
70
 
76
- const initGit = async options => {
71
+ const initGit = async (options) => {
77
72
  const result = await execa('git', ['init'], {
78
73
  cwd: options.targetDirectory
79
74
  });
@@ -82,16 +77,13 @@ const initGit = async options => {
82
77
  }
83
78
  };
84
79
 
85
- export default async options => {
86
- options.templateDirectory = path.resolve(
87
- path.dirname(fileURLToPath(import.meta.url)),
88
- 'template'
89
- );
80
+ export default async (options) => {
81
+ options.templateDirectory = path.resolve(path.dirname(fileURLToPath(import.meta.url)), 'template');
90
82
  let projectName = 'test';
91
83
 
92
84
  const questions = getInitProjectQuestions();
93
85
 
94
- await inquirer.prompt(questions).then(async answers => {
86
+ await inquirer.prompt(questions).then(async (answers) => {
95
87
  projectName = answers.projectName;
96
88
  projectName = sanitize(projectName).toLowerCase();
97
89
  options = { ...options, ...answers };
@@ -102,11 +94,12 @@ export default async options => {
102
94
  fs.mkdirSync(projectDirectory);
103
95
  } else {
104
96
  console.log(chalk.bold.red(`A project with name ${projectName} already exists. Exiting...`));
105
- process.exit(1);
97
+ process.exit();
106
98
  }
107
99
 
108
100
  const targetDirectory = options.targetDirectory || process.cwd();
109
101
  options.targetDirectory = path.join(targetDirectory, projectName);
102
+ options.componentDirectory = path.join(options.targetDirectory, 'node_modules/@pega/custom-dx-components');
110
103
  });
111
104
 
112
105
  const installDependenciesText = `Installing dependencies. This will take a couple of minutes.`;
@@ -128,8 +121,15 @@ export default async options => {
128
121
  },
129
122
  {
130
123
  title: installDependenciesText,
131
- task: () =>
132
- execPromise('npm i --force --production=false', { cwd: options.targetDirectory })
124
+ task: () => execPromise('npm i --force --production=false', { cwd: options.targetDirectory })
125
+ },
126
+ {
127
+ title: 'Installing tasks dependencies',
128
+ task: () => execPromise('npm i --force --production=false', { cwd: options.componentDirectory })
129
+ },
130
+ {
131
+ title: 'Installing quick run',
132
+ task: () => execPromise('npm i -g npm-quick-run', { cwd: options.targetDirectory })
133
133
  }
134
134
  ],
135
135
  {
@@ -139,9 +139,7 @@ export default async options => {
139
139
 
140
140
  await tasks.run();
141
141
  console.log('\n');
142
- console.log(
143
- `${chalk.green('Success!!')} Project created at ${chalk.blueBright(options.targetDirectory)}`
144
- );
142
+ console.log(`${chalk.green('Success!!')} Project created at ${chalk.blueBright(options.targetDirectory)}`);
145
143
  console.log(
146
144
  '\n',
147
145
  `Inside that directory, you can run several commands:`,
@@ -0,0 +1,13 @@
1
+ module.exports = {
2
+ presets: [
3
+ [
4
+ '@babel/preset-env',
5
+ {
6
+ targets: {
7
+ node: 'current'
8
+ }
9
+ }
10
+ ]
11
+ ],
12
+ sourceType: 'unambiguous'
13
+ };
@@ -0,0 +1,21 @@
1
+ module.exports = {
2
+ verbose: true,
3
+ moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx'],
4
+ transform: {
5
+ '^.+\\.[t|j]sx?$': 'babel-jest'
6
+ },
7
+ collectCoverage: true,
8
+ testPathIgnorePatterns: [],
9
+ transformIgnorePatterns: [],
10
+ modulePathIgnorePatterns: [],
11
+ coveragePathIgnorePatterns: [],
12
+ collectCoverageFrom: ['./node_modules/@pega/custom-dx-components/src/*.js'],
13
+ coverageThreshold: {
14
+ global: {
15
+ statements: 79,
16
+ branches: 74,
17
+ functions: 81,
18
+ lines: 80
19
+ }
20
+ }
21
+ };
@@ -4,6 +4,7 @@
4
4
  "description": "{{description}}",
5
5
  "organization": "{{organization}}",
6
6
  "main": "src/index.js",
7
+ "type": "module",
7
8
  "scripts": {
8
9
  "startStorybook": "start-storybook --port 6040 --quiet",
9
10
  "lint": "run-p -cl lint:*",
@@ -20,6 +21,8 @@
20
21
  "update": "custom-dx-components update",
21
22
  "delete": "custom-dx-components delete",
22
23
  "deleteAll": "custom-dx-components deleteAll",
24
+ "promoteWebPack": "custom-dx-components promoteWebPack",
25
+ "revertWebPack": "custom-dx-components revertWebPack",
23
26
  "lint:types": "tsc --noEmit",
24
27
  "lint:es": "eslint .",
25
28
  "lint:styles": "stylelint \"./**/*.@(js|jsx|ts|tsx)\"",
@@ -43,8 +46,8 @@
43
46
  "license": "Enter License",
44
47
  "sideEffects": false,
45
48
  "dependencies": {
46
- "@pega/cosmos-react-core": "^3.0.1",
47
- "@pega/cosmos-react-work": "3.0.1",
49
+ "@pega/cosmos-react-core": "^3.0.11",
50
+ "@pega/cosmos-react-work": "3.0.11",
48
51
  "dayjs": "^1.11.5",
49
52
  "polished": "^4.2.2",
50
53
  "prop-types": "^15.8.1",
@@ -58,7 +61,7 @@
58
61
  },
59
62
  "devDependencies": {
60
63
  "@pega/configs": "^0.5.3",
61
- "@pega/custom-dx-components": "^8.8.17",
64
+ "@pega/custom-dx-components": "^8.8.18",
62
65
  "@pega/eslint-config": "^0.3.2",
63
66
  "@storybook/addon-actions": "^6.5.12",
64
67
  "@storybook/addon-essentials": "^6.5.12",
@@ -85,7 +88,6 @@
85
88
  "eslint-plugin-sonarjs": "^0.11.0",
86
89
  "jest": "^29.3.1",
87
90
  "jest-environment-jsdom": "^29.3.1",
88
- "npm-quick-run": "^1.18.0",
89
91
  "npm-run-all": "^4.1.5",
90
92
  "prettier": "2.7.1",
91
93
  "stylelint": "^14.11.0",
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "Pega_DXIL_MyTestText",
3
+ "label": "My Test Text",
4
+ "description": "My Test Text Description",
5
+ "organization": "Pega",
6
+ "version": "0.0.1",
7
+ "library": "DXIL",
8
+ "allowedApplications": [],
9
+ "componentKey": "Pega_DXIL_MyTestText",
10
+ "type": "Field",
11
+ "subtype": "Text",
12
+ "properties": [
13
+ {
14
+ "name": "label",
15
+ "label": "Label value",
16
+ "format": "TEXT"
17
+ },
18
+ {
19
+ "name": "placeholder",
20
+ "label": "Placeholder",
21
+ "format": "TEXT"
22
+ },
23
+ {
24
+ "name": "visibility",
25
+ "label": "Visible",
26
+ "format": "VISIBILITY"
27
+ },
28
+ {
29
+ "name": "disabled",
30
+ "label": "Disabled",
31
+ "format": "DISABLED"
32
+ },
33
+ {
34
+ "name": "required",
35
+ "label": "Required",
36
+ "format": "REQUIRED"
37
+ },
38
+ {
39
+ "label": "Advanced",
40
+ "format": "GROUP",
41
+ "collapsible": true,
42
+ "properties": [
43
+ {
44
+ "name": "testId",
45
+ "label": "Test ID",
46
+ "format": "TEXT",
47
+ "ignorePattern": "[^-_\\p{N}\\p{L}]",
48
+ "includeAnnotations": false
49
+ }
50
+ ]
51
+ }
52
+ ],
53
+ "defaultConfig": {
54
+ }
55
+ }
@@ -0,0 +1,51 @@
1
+ import { useState } from 'react';
2
+ import { withKnobs } from '@storybook/addon-knobs';
3
+
4
+ import { stateProps, configProps } from './mock.stories';
5
+
6
+ import PegaDxilMyTestText from './index.jsx';
7
+
8
+ export default {
9
+ title: 'PegaDxilMyTestText',
10
+ decorators: [withKnobs],
11
+ component: PegaDxilMyTestText
12
+ };
13
+
14
+ export const basePegaDxilMyTestText = () => {
15
+ // eslint-disable-next-line react-hooks/rules-of-hooks
16
+ const [value, setValue] = useState(configProps.value);
17
+
18
+ const props = {
19
+ value,
20
+ placeholder: configProps.placeholder,
21
+ label: configProps.label,
22
+ testId: configProps.testId,
23
+ hasSuggestions: configProps.hasSuggestions,
24
+
25
+ getPConnect: () => {
26
+ return {
27
+ getStateProps: () => {
28
+ return stateProps;
29
+ },
30
+ getActionsApi: () => {
31
+ return {
32
+ updateFieldValue: (propName, theValue) => {
33
+ setValue(theValue);
34
+ },
35
+ triggerFieldChange: () => {/* nothing */}
36
+ };
37
+ },
38
+ ignoreSuggestion: () => {/* nothing */},
39
+ acceptSuggestion: () => {/* nothing */},
40
+ setInheritedProps: () => {/* nothing */},
41
+ resolveConfigProps: () => {/* nothing */}
42
+ };
43
+ }
44
+ };
45
+
46
+ return (
47
+ <>
48
+ <PegaDxilMyTestText {...props} />
49
+ </>
50
+ );
51
+ };
@@ -0,0 +1,60 @@
1
+ import PropTypes from 'prop-types';
2
+ import { Input, Label } from '@pega/cosmos-react-core';
3
+
4
+ import StyledPegaDxilMyTestTextWrapper from './styles';
5
+
6
+
7
+ // Duplicated runtime code from Constellation Design System Component
8
+
9
+ // props passed in combination of props from property panel (config.json) and run time props from Constellation
10
+ // any default values in config.pros should be set in defaultProps at bottom of this file
11
+ const PegaDxilMyTestText = props => {
12
+ const { getPConnect, value, placeholder, disabled, readOnly, required, label, testId } = props;
13
+
14
+ const pConn = getPConnect();
15
+ const actions = pConn.getActionsApi();
16
+ const propName = pConn?.getStateProps()?.value;
17
+
18
+ const handleOnChange = event => {
19
+ const { value: updatedValue } = event.target;
20
+ actions.updateFieldValue(propName, updatedValue);
21
+ };
22
+
23
+ return (
24
+ <StyledPegaDxilMyTestTextWrapper>
25
+ <Label>{label}</Label>
26
+ <Input
27
+ type='text'
28
+ value={value}
29
+ placeholder={placeholder}
30
+ disabled={disabled}
31
+ readOnly={readOnly}
32
+ required={required}
33
+ onChange={handleOnChange}
34
+ testId={testId}
35
+ />
36
+ </StyledPegaDxilMyTestTextWrapper>
37
+ );
38
+ };
39
+
40
+ PegaDxilMyTestText.defaultProps = {
41
+ value: '',
42
+ placeholder: '',
43
+ disabled: false,
44
+ readOnly: false,
45
+ required: false,
46
+ testId: null
47
+ };
48
+
49
+ PegaDxilMyTestText.propTypes = {
50
+ label: PropTypes.string,
51
+ value: PropTypes.string,
52
+ placeholder: PropTypes.string,
53
+ getPConnect: PropTypes.func.isRequired,
54
+ disabled: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
55
+ readOnly: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
56
+ required: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
57
+ testId: PropTypes.string
58
+ };
59
+
60
+ export default PegaDxilMyTestText;