@pega/custom-dx-components 0.23.35 → 0.23.37

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 (330) hide show
  1. package/SECURITY.md +10 -0
  2. package/package.json +1 -1
  3. package/src/constants.js +1 -0
  4. package/src/tasks/build-all/index.js +10 -25
  5. package/src/tasks/build-comp/index.js +1 -0
  6. package/src/tasks/bundle/builder/index.js +6 -3
  7. package/src/tasks/create/templates/Constellation/Field/Boolean/Boolean.ts.mustache +35 -0
  8. package/src/tasks/create/templates/Constellation/Field/Boolean/demo.stories.tsx.mustache +8 -5
  9. package/src/tasks/create/templates/Constellation/Field/Boolean/index.tsx.mustache +10 -47
  10. package/src/tasks/create/templates/Constellation/Field/Boolean/styles.ts.mustache +7 -14
  11. package/{tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/DateFormatter.js → src/tasks/create/templates/Constellation/Field/Date/DateFormatter.ts.mustache} +6 -6
  12. package/src/tasks/create/templates/Constellation/Field/Date/FormattedText.tsx.mustache +20 -0
  13. package/{tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/date.js → src/tasks/create/templates/Constellation/Field/Date/date.ts.mustache} +2 -2
  14. package/src/tasks/create/templates/Constellation/Field/Date/demo.stories.tsx.mustache +8 -5
  15. package/src/tasks/create/templates/Constellation/Field/Date/index.tsx.mustache +29 -70
  16. package/src/tasks/create/templates/Constellation/Field/Date/styles.ts.mustache +7 -14
  17. package/src/tasks/create/templates/Constellation/Field/DateTime/{date-time.js.mustache → date-time.ts.mustache} +12 -12
  18. package/{tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/date-utils.js → src/tasks/create/templates/Constellation/Field/DateTime/date-utils.ts.mustache} +27 -26
  19. package/{tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/date.js → src/tasks/create/templates/Constellation/Field/DateTime/date.ts.mustache} +1 -0
  20. package/src/tasks/create/templates/Constellation/Field/DateTime/demo.stories.tsx.mustache +9 -6
  21. package/src/tasks/create/templates/Constellation/Field/DateTime/index.tsx.mustache +12 -59
  22. package/src/tasks/create/templates/Constellation/Field/DateTime/styles.ts.mustache +7 -14
  23. package/src/tasks/create/templates/Constellation/Field/Decimal/demo.stories.tsx.mustache +8 -5
  24. package/src/tasks/create/templates/Constellation/Field/Decimal/index.tsx.mustache +14 -67
  25. package/src/tasks/create/templates/Constellation/Field/Decimal/styles.ts.mustache +7 -14
  26. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/demo.stories.tsx.mustache +8 -5
  27. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.tsx.mustache +21 -75
  28. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/styles.ts.mustache +7 -14
  29. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/demo.stories.tsx.mustache +8 -5
  30. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.tsx.mustache +13 -54
  31. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/styles.ts.mustache +7 -14
  32. package/src/tasks/create/templates/Constellation/Field/Integer/demo.stories.tsx.mustache +8 -5
  33. package/src/tasks/create/templates/Constellation/Field/Integer/index.tsx.mustache +23 -87
  34. package/src/tasks/create/templates/Constellation/Field/Integer/styles.ts.mustache +7 -14
  35. package/src/tasks/create/templates/Constellation/Field/Picklist/demo.stories.tsx.mustache +8 -5
  36. package/src/tasks/create/templates/Constellation/Field/Picklist/index.tsx.mustache +12 -60
  37. package/src/tasks/create/templates/Constellation/Field/Picklist/styles.ts.mustache +7 -14
  38. package/{tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/date.js → src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/date.ts.mustache} +2 -1
  39. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/demo.stories.tsx.mustache +8 -5
  40. package/{tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/embed-utils.js → src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/embed-utils.ts.mustache} +2 -1
  41. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/index.tsx.mustache +15 -76
  42. package/{tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/picklist-utils.js → src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/picklist-utils.ts.mustache} +1 -0
  43. package/{tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/repeat-constants.js → src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/repeat-constants.ts.mustache} +1 -1
  44. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/{repeat-utils.js.mustache → repeat-utils.ts.mustache} +6 -12
  45. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/styles.ts.mustache +7 -14
  46. package/{tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/textformat-utils.jsx → src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/textformat-utils.tsx.mustache} +30 -10
  47. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/utils.ts.mustache +1 -1
  48. package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/demo.stories.tsx.mustache +8 -5
  49. package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/index.tsx.mustache +11 -55
  50. package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/styles.ts.mustache +7 -14
  51. package/src/tasks/create/templates/Constellation/Field/Text/demo.stories.tsx.mustache +8 -5
  52. package/src/tasks/create/templates/Constellation/Field/Text/index.tsx.mustache +4 -22
  53. package/src/tasks/create/templates/Constellation/Field/Text/styles.ts.mustache +7 -14
  54. package/src/tasks/create/templates/Constellation/Field/Text-Email/demo.stories.tsx.mustache +8 -5
  55. package/src/tasks/create/templates/Constellation/Field/Text-Email/index.tsx.mustache +9 -46
  56. package/src/tasks/create/templates/Constellation/Field/Text-Email/styles.ts.mustache +7 -14
  57. package/src/tasks/create/templates/Constellation/Field/Text-Input/demo.stories.tsx.mustache +7 -4
  58. package/src/tasks/create/templates/Constellation/Field/Text-Input/index.tsx.mustache +10 -50
  59. package/src/tasks/create/templates/Constellation/Field/Text-Input/styles.ts.mustache +7 -14
  60. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/demo.stories.tsx.mustache +8 -5
  61. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.tsx.mustache +12 -48
  62. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/styles.ts.mustache +7 -14
  63. package/src/tasks/create/templates/Constellation/Field/Text-Phone/demo.stories.tsx.mustache +8 -5
  64. package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.tsx.mustache +13 -52
  65. package/src/tasks/create/templates/Constellation/Field/Text-Phone/styles.ts.mustache +7 -14
  66. package/src/tasks/create/templates/Constellation/Field/Text-URL/demo.stories.tsx.mustache +8 -5
  67. package/src/tasks/create/templates/Constellation/Field/Text-URL/index.tsx.mustache +15 -71
  68. package/src/tasks/create/templates/Constellation/Field/Text-URL/styles.ts.mustache +7 -14
  69. package/{tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/text-url.jsx → src/tasks/create/templates/Constellation/Field/Text-URL/text-url.tsx.mustache} +4 -3
  70. package/src/tasks/create/templates/Constellation/Field/TimeofDay/demo.stories.tsx.mustache +8 -6
  71. package/src/tasks/create/templates/Constellation/Field/TimeofDay/index.tsx.mustache +16 -52
  72. package/src/tasks/create/templates/Constellation/Field/TimeofDay/styles.ts.mustache +7 -14
  73. package/src/tasks/create/templates/Constellation/Field/{DateTime/date-utils.js.mustache → TimeofDay/time-of-day.ts.mustache} +24 -23
  74. package/src/tasks/create/templates/Constellation/Template/DETAILS/demo.stories.tsx.mustache +14 -5
  75. package/src/tasks/create/templates/Constellation/Template/DETAILS/index.tsx.mustache +4 -17
  76. package/src/tasks/create/templates/Constellation/Template/DETAILS/styles.ts.mustache +7 -14
  77. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/demo.stories.tsx.mustache +10 -3
  78. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.tsx.mustache +4 -18
  79. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/styles.ts.mustache +7 -14
  80. package/{tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/utils.js → src/tasks/create/templates/Constellation/Template/DETAILS-region/utils.ts.mustache} +15 -13
  81. package/src/tasks/create/templates/Constellation/Template/FORM/demo.stories.tsx.mustache +11 -5
  82. package/src/tasks/create/templates/Constellation/Template/FORM/index.tsx.mustache +5 -13
  83. package/src/tasks/create/templates/Constellation/Template/FORM/styles.ts.mustache +7 -14
  84. package/src/tasks/create/templates/Constellation/Template/FORM-region/demo.stories.tsx.mustache +11 -5
  85. package/src/tasks/create/templates/Constellation/Template/FORM-region/index.tsx.mustache +4 -10
  86. package/src/tasks/create/templates/Constellation/Template/FORM-region/styles.ts.mustache +7 -14
  87. package/src/tasks/create/templates/Constellation/Template/PAGE/demo.stories.tsx.mustache +8 -5
  88. package/src/tasks/create/templates/Constellation/Template/PAGE/index.tsx.mustache +5 -16
  89. package/src/tasks/create/templates/Constellation/Template/PAGE/styles.ts.mustache +7 -14
  90. package/{tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/utils.js → src/tasks/create/templates/Constellation/Template/PAGE/utils.ts.mustache} +28 -14
  91. package/src/tasks/create/templates/Constellation/Widget/CASE/demo.stories.tsx.mustache +8 -5
  92. package/src/tasks/create/templates/Constellation/Widget/CASE/index.tsx.mustache +3 -10
  93. package/src/tasks/create/templates/Constellation/Widget/CASE/styles.ts.mustache +7 -14
  94. package/src/tasks/create/templates/Constellation/Widget/PAGE/demo.stories.tsx.mustache +8 -5
  95. package/src/tasks/create/templates/Constellation/Widget/PAGE/index.tsx.mustache +4 -18
  96. package/src/tasks/create/templates/Constellation/Widget/PAGE/styles.ts.mustache +7 -14
  97. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Avatar.tsx.mustache +3 -13
  98. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Operator.tsx.mustache +4 -19
  99. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/demo.stories.tsx.mustache +8 -5
  100. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/index.tsx.mustache +24 -39
  101. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/styles.ts.mustache +7 -14
  102. package/src/tasks/create/templates/Launchpad/Widget/CASE/demo.stories.tsx.mustache +8 -5
  103. package/src/tasks/create/templates/Launchpad/Widget/CASE/index.tsx.mustache +3 -9
  104. package/src/tasks/create/templates/Launchpad/Widget/CASE/styles.ts.mustache +7 -14
  105. package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/Avatar.tsx.mustache +1 -11
  106. package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/Operator.tsx.mustache +33 -51
  107. package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/demo.stories.tsx.mustache +8 -5
  108. package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/index.tsx.mustache +22 -21
  109. package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/styles.ts.mustache +7 -14
  110. package/src/tasks/delete-all/helper.js +37 -5
  111. package/src/tasks/init/template/package.json.mustache +6 -6
  112. package/src/tasks/init/template/tasks.config.json +2 -1
  113. package/src/tasks/linter/index.js +7 -4
  114. package/src/tasks/list/helper.js +10 -0
  115. package/src/tasks/list/index.js +20 -3
  116. package/src/tasks/promote-webpack/index.js +3 -26
  117. package/src/tasks/publish/helper.js +1 -1
  118. package/src/tasks/publish/index.js +6 -4
  119. package/src/tasks/publish-all/helper.js +52 -40
  120. package/src/tasks/publish-all/index.js +16 -17
  121. package/src/tasks/revert-webpack/index.js +3 -23
  122. package/src/util.js +152 -61
  123. package/tests/assets/components/create/Pega_DXIL_MyTestText/demo.stories.tsx +8 -5
  124. package/tests/assets/components/create/Pega_DXIL_MyTestText/index.tsx +4 -22
  125. package/tests/assets/components/create/Pega_DXIL_MyTestText/styles.ts +7 -14
  126. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/Boolean.ts +35 -0
  127. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/demo.stories.tsx +8 -5
  128. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/index.tsx +10 -47
  129. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/styles.ts +7 -14
  130. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/demo.stories.tsx +8 -5
  131. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/index.tsx +3 -10
  132. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/styles.ts +7 -14
  133. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/demo.stories.tsx +8 -5
  134. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/index.tsx +21 -75
  135. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/styles.ts +7 -14
  136. package/{src/tasks/create/templates/Constellation/Field/Date/DateFormatter.js.mustache → tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/DateFormatter.ts} +6 -6
  137. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/FormattedText.tsx +20 -0
  138. package/tests/assets/components/createAll/{Launchpad/Pega_DXIL_MyDate/date.js → Constellation/Pega_DXIL_MyDate/date.ts} +2 -2
  139. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/demo.stories.tsx +8 -5
  140. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/index.tsx +18 -59
  141. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/styles.ts +7 -14
  142. package/tests/assets/components/createAll/{Launchpad/Pega_DXIL_MyDateTime/date-time.js → Constellation/Pega_DXIL_MyDateTime/date-time.ts} +12 -12
  143. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/date-utils.ts +288 -0
  144. package/{src/tasks/create/templates/Constellation/Field/DateTime/date.js.mustache → tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/date.ts} +1 -0
  145. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/demo.stories.tsx +9 -6
  146. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/index.tsx +12 -59
  147. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/styles.ts +7 -14
  148. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/demo.stories.tsx +8 -5
  149. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/index.tsx +14 -67
  150. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/styles.ts +7 -14
  151. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/demo.stories.tsx +12 -3
  152. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/index.tsx +4 -17
  153. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/styles.ts +7 -14
  154. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyEmail/demo.stories.tsx +8 -5
  155. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyEmail/index.tsx +9 -46
  156. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyEmail/styles.ts +7 -14
  157. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/demo.stories.tsx +11 -5
  158. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/index.tsx +5 -13
  159. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/styles.ts +7 -14
  160. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/demo.stories.tsx +8 -5
  161. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/index.tsx +23 -87
  162. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/styles.ts +7 -14
  163. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/demo.stories.tsx +8 -5
  164. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/index.tsx +5 -16
  165. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/styles.ts +7 -14
  166. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/{utils.js → utils.ts} +28 -14
  167. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/Avatar.tsx +3 -13
  168. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/Operator.tsx +4 -19
  169. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/demo.stories.tsx +8 -5
  170. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/index.tsx +24 -39
  171. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/styles.ts +7 -14
  172. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageWidget/demo.stories.tsx +8 -5
  173. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageWidget/index.tsx +4 -18
  174. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageWidget/styles.ts +7 -14
  175. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/demo.stories.tsx +8 -5
  176. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/index.tsx +12 -48
  177. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/styles.ts +7 -14
  178. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/demo.stories.tsx +8 -5
  179. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/index.tsx +13 -54
  180. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/styles.ts +7 -14
  181. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/demo.stories.tsx +8 -5
  182. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/index.tsx +13 -52
  183. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/styles.ts +7 -14
  184. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/demo.stories.tsx +8 -5
  185. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/index.tsx +12 -60
  186. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/styles.ts +7 -14
  187. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyRadioButtons/demo.stories.tsx +8 -5
  188. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyRadioButtons/index.tsx +11 -55
  189. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyRadioButtons/styles.ts +7 -14
  190. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/{date.js → date.ts} +2 -1
  191. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/demo.stories.tsx +8 -5
  192. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/{embed-utils.js → embed-utils.ts} +2 -1
  193. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/index.tsx +15 -76
  194. package/tests/assets/components/createAll/{Launchpad/Pega_DXIL_MySearchbox/picklist-utils.js → Constellation/Pega_DXIL_MySearchbox/picklist-utils.ts} +1 -0
  195. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/{repeat-constants.js → repeat-constants.ts} +1 -1
  196. package/tests/assets/components/createAll/{Launchpad/Pega_DXIL_MySearchbox/repeat-utils.js → Constellation/Pega_DXIL_MySearchbox/repeat-utils.ts} +6 -12
  197. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/styles.ts +7 -14
  198. package/tests/assets/components/createAll/{Launchpad/Pega_DXIL_MySearchbox/textformat-utils.jsx → Constellation/Pega_DXIL_MySearchbox/textformat-utils.tsx} +30 -10
  199. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/utils.ts +1 -1
  200. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyText/demo.stories.tsx +8 -5
  201. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyText/index.tsx +4 -22
  202. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyText/styles.ts +7 -14
  203. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/demo.stories.tsx +7 -4
  204. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/index.tsx +10 -50
  205. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/styles.ts +7 -14
  206. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/demo.stories.tsx +8 -6
  207. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/index.tsx +16 -52
  208. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/styles.ts +7 -14
  209. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/{time-of-day.js → time-of-day.ts} +24 -23
  210. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +10 -3
  211. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/index.tsx +4 -18
  212. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/styles.ts +7 -14
  213. package/tests/assets/components/createAll/{Launchpad/Pega_DXIL_MyTwoColumnDetails/utils.js → Constellation/Pega_DXIL_MyTwoColumnDetails/utils.ts} +15 -13
  214. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +11 -5
  215. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/index.tsx +4 -10
  216. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/styles.ts +7 -14
  217. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/demo.stories.tsx +8 -5
  218. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/index.tsx +15 -71
  219. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/styles.ts +7 -14
  220. package/{src/tasks/create/templates/Constellation/Field/Text-URL/text-url.jsx.mustache → tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/text-url.tsx} +4 -3
  221. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/Boolean.ts +35 -0
  222. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/demo.stories.tsx +8 -5
  223. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/index.tsx +10 -47
  224. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/styles.ts +7 -14
  225. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/demo.stories.tsx +8 -5
  226. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/index.tsx +3 -9
  227. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/styles.ts +7 -14
  228. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/demo.stories.tsx +8 -5
  229. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/index.tsx +21 -75
  230. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/styles.ts +7 -14
  231. package/tests/assets/components/createAll/{Constellation/Pega_DXIL_MyDate/DateFormatter.js → Launchpad/Pega_DXIL_MyDate/DateFormatter.ts} +6 -6
  232. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/FormattedText.tsx +20 -0
  233. package/{src/tasks/create/templates/Constellation/Field/Date/date.js.mustache → tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/date.ts} +2 -2
  234. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/demo.stories.tsx +8 -5
  235. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/index.tsx +18 -59
  236. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/styles.ts +7 -14
  237. package/tests/assets/components/createAll/{Constellation/Pega_DXIL_MyDateTime/date-time.js → Launchpad/Pega_DXIL_MyDateTime/date-time.ts} +12 -12
  238. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/date-utils.ts +288 -0
  239. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/{date.js → date.ts} +1 -0
  240. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/demo.stories.tsx +9 -6
  241. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/index.tsx +12 -59
  242. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/styles.ts +7 -14
  243. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/demo.stories.tsx +8 -5
  244. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/index.tsx +14 -67
  245. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/styles.ts +7 -14
  246. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/demo.stories.tsx +12 -3
  247. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/index.tsx +4 -17
  248. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/styles.ts +7 -14
  249. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyEmail/demo.stories.tsx +8 -5
  250. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyEmail/index.tsx +9 -46
  251. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyEmail/styles.ts +7 -14
  252. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/demo.stories.tsx +11 -5
  253. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/index.tsx +5 -13
  254. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/styles.ts +7 -14
  255. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyInteger/demo.stories.tsx +8 -5
  256. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyInteger/index.tsx +23 -87
  257. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyInteger/styles.ts +7 -14
  258. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/demo.stories.tsx +8 -5
  259. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/index.tsx +5 -16
  260. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/styles.ts +7 -14
  261. package/{src/tasks/create/templates/Constellation/Template/PAGE/utils.js.mustache → tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/utils.ts} +28 -14
  262. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/Avatar.tsx +1 -11
  263. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/Operator.tsx +33 -51
  264. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/demo.stories.tsx +8 -5
  265. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/index.tsx +22 -20
  266. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/styles.ts +7 -14
  267. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/demo.stories.tsx +8 -5
  268. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/index.tsx +4 -18
  269. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/styles.ts +7 -14
  270. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/demo.stories.tsx +8 -5
  271. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/index.tsx +12 -48
  272. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/styles.ts +7 -14
  273. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/demo.stories.tsx +8 -5
  274. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/index.tsx +13 -54
  275. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/styles.ts +7 -14
  276. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/demo.stories.tsx +8 -5
  277. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/index.tsx +13 -52
  278. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/styles.ts +7 -14
  279. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/demo.stories.tsx +8 -5
  280. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/index.tsx +12 -60
  281. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/styles.ts +7 -14
  282. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyRadioButtons/demo.stories.tsx +8 -5
  283. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyRadioButtons/index.tsx +11 -55
  284. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyRadioButtons/styles.ts +7 -14
  285. package/{src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/date.js.mustache → tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/date.ts} +2 -1
  286. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/demo.stories.tsx +8 -5
  287. package/{src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/embed-utils.js.mustache → tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/embed-utils.ts} +2 -1
  288. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/index.tsx +15 -76
  289. package/{src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/picklist-utils.js.mustache → tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/picklist-utils.ts} +1 -0
  290. package/{src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/repeat-constants.js.mustache → tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/repeat-constants.ts} +1 -1
  291. package/tests/assets/components/createAll/{Constellation/Pega_DXIL_MySearchbox/repeat-utils.js → Launchpad/Pega_DXIL_MySearchbox/repeat-utils.ts} +6 -12
  292. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/styles.ts +7 -14
  293. package/{src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/textformat-utils.jsx.mustache → tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/textformat-utils.tsx} +30 -10
  294. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/utils.ts +1 -1
  295. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyText/demo.stories.tsx +8 -5
  296. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyText/index.tsx +4 -22
  297. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyText/styles.ts +7 -14
  298. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/demo.stories.tsx +7 -4
  299. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/index.tsx +10 -50
  300. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/styles.ts +7 -14
  301. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/demo.stories.tsx +8 -6
  302. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/index.tsx +16 -52
  303. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/styles.ts +7 -14
  304. package/{src/tasks/create/templates/Constellation/Field/TimeofDay/time-of-day.js.mustache → tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/time-of-day.ts} +24 -23
  305. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +10 -3
  306. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/index.tsx +4 -18
  307. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/styles.ts +7 -14
  308. package/{src/tasks/create/templates/Constellation/Template/DETAILS-region/utils.js.mustache → tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/utils.ts} +15 -13
  309. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +11 -5
  310. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/index.tsx +4 -10
  311. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/styles.ts +7 -14
  312. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/demo.stories.tsx +8 -5
  313. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/index.tsx +15 -71
  314. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/styles.ts +7 -14
  315. package/tests/assets/components/createAll/{Constellation/Pega_DXIL_MyURL/text-url.jsx → Launchpad/Pega_DXIL_MyURL/text-url.tsx} +4 -3
  316. package/tests/functional/localCreateAllListDeleteAll.test.js +10 -3
  317. package/src/tasks/create/templates/Constellation/Field/Boolean/Boolean.js.mustache +0 -38
  318. package/src/tasks/create/templates/Constellation/Field/Date/FormattedText.jsx.mustache +0 -41
  319. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/Boolean.js +0 -38
  320. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/FormattedText.jsx +0 -41
  321. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/Boolean.js +0 -38
  322. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/FormattedText.jsx +0 -41
  323. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/date-utils.js +0 -287
  324. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/time-of-day.js +0 -287
  325. /package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/{component-constants.js → component-constants.ts} +0 -0
  326. /package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/{format-constants.js.mustache → format-constants.ts.mustache} +0 -0
  327. /package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/{component-constants.js → component-constants.ts} +0 -0
  328. /package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/{format-constants.js → format-constants.ts} +0 -0
  329. /package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/{component-constants.js → component-constants.ts} +0 -0
  330. /package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/{format-constants.js → format-constants.ts} +0 -0
package/SECURITY.md ADDED
@@ -0,0 +1,10 @@
1
+ # Reporting Security Issues
2
+
3
+ Pegasystems takes security seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions.
4
+
5
+ To report a security issue, [email us](mailto:opensource@pega.com;security@pega.com) and include the word "SECURITY" in the subject line.
6
+
7
+ The Pega team will send a response indicating the next steps in handling your report. We may ask for additional information or guidance.
8
+
9
+ ## Learning More About Security
10
+ To learn more about securing a Pega application or our security capabilities, please see the [security article](https://community.pega.com/knowledgebase/capabilities/security) on Pega Community and the [Pega Trust Center](https://www.pega.com/products/cloud/pega-trust-center).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/custom-dx-components",
3
- "version": "0.23.35",
3
+ "version": "0.23.37",
4
4
  "description": "Utility for building custom UI components",
5
5
  "bin": "./bin/index.js",
6
6
  "scripts": {
package/src/constants.js CHANGED
@@ -4,6 +4,7 @@ export const PACKAGE_JSON_FILENAME = 'package.json';
4
4
  export const BUILD_CONFIG_JSON_FILENAME = 'build.config.json';
5
5
  export const WEBPACK_CONFIG_JS_FILENAME = 'webpack.config.js';
6
6
  export const WEBPACK_PATHS_JS_FILENAME = 'paths.js';
7
+ export const USE_PROMOTED_WEB_PACK = 'usePromotedWebPack';
7
8
  export const COMPONENTS_DIRECTORY_PATH = 'components-directory-path';
8
9
  export const COMPONENTS_PATH = 'component';
9
10
  export const TOKEN_PATH = 'node_modules/@pega/custom-dx-components/.access_token';
@@ -9,9 +9,7 @@ import { getComponentDirectoryPath, showVersion, getComponents } from '../../uti
9
9
 
10
10
  import { getBuildComponentQuestions, cleanUp } from './helper.js';
11
11
 
12
-
13
12
  export function getCustomTasks(componentKey, sourceMap, devBuild, options) {
14
-
15
13
  const sDevBuild = devBuild ? '(dev build)' : '';
16
14
  return new Listr(
17
15
  [
@@ -35,50 +33,37 @@ export function getCustomTasks(componentKey, sourceMap, devBuild, options) {
35
33
  skip: () => (options.skipBundle ? 'Skipped bundling component' : undefined)
36
34
  }
37
35
  ],
38
- {
39
- exitOnError: true
40
- }
36
+ { concurrent: false, exitOnError: true }
41
37
  );
42
-
43
-
44
38
  }
45
39
 
46
-
47
-
48
-
49
- export default async (options) => {
40
+ export default async options => {
50
41
  showVersion();
51
42
 
52
-
53
43
  const components = await getComponents();
54
44
  let sourceMap;
55
45
  let devBuild;
56
46
 
57
47
  if (options.params.length >= 4) {
58
48
  const dBuild = options.params[3];
59
- devBuild = (dBuild === 'Y' ||
60
- dBuild === 'y' ||
61
- dBuild === true ||
62
- dBuild === 'true') ? true : false;
63
- }
64
- else {
49
+ devBuild = !!(dBuild === 'Y' || dBuild === 'y' || dBuild === true || dBuild === 'true');
50
+ } else {
65
51
  const questions = await getBuildComponentQuestions();
66
52
  const answers = await inquirer.prompt(questions);
67
53
  ({ sourceMap, devBuild } = answers);
68
54
  }
69
55
 
70
-
71
- for (const componentKey of components) {
56
+ for await (const componentKey of components) {
72
57
  console.log(chalk.bold.green(`Building ${componentKey}`));
73
58
 
74
- const myCustomTasks = getCustomTasks(componentKey, sourceMap, devBuild, options );
59
+ const myCustomTasks = getCustomTasks(componentKey, sourceMap, devBuild, options);
75
60
 
76
- // eslint-disable-next-line no-await-in-loop
77
- await myCustomTasks.run().catch(err => {
61
+ try {
62
+ await myCustomTasks.run();
63
+ } catch (err) {
78
64
  console.log(chalk.bold.red(err.toString()));
79
65
  process.exit(1);
80
- });
81
-
66
+ }
82
67
  }
83
68
 
84
69
  // once done, remove leftover directories
@@ -71,6 +71,7 @@ export default async options => {
71
71
 
72
72
  await tasks.run().catch(err => {
73
73
  console.log(chalk.bold.red(err.toString()));
74
+ process.exit(1);
74
75
  });
75
76
  return true;
76
77
  };
@@ -3,12 +3,15 @@ import fs from 'fs-extra';
3
3
  import webpack from 'webpack';
4
4
  import FileSizeReporter from 'react-dev-utils/FileSizeReporter.js';
5
5
  import printBuildError from 'react-dev-utils/printBuildError.js';
6
+ import { getUseWebPackPromotion} from '../../../util.js';
6
7
 
7
8
 
9
+ const usePromoted = await getUseWebPackPromotion();
8
10
  // used by promote and revert webPack commands, do not change
9
- import configFactory from './webpack.config.js';
10
- // import configFactory from '../../../../../../../webpack.config.js';
11
- // do not change
11
+ const configFactory = (
12
+ await import(`${usePromoted ? `../../../../../../../webpack.config.js` : `./webpack.config.js`}`)
13
+ ).default
14
+
12
15
 
13
16
  import paths from './paths.js';
14
17
 
@@ -0,0 +1,35 @@
1
+ function Boolean(value: any, { allowEmpty = true, tick = '', cross = '' } = {}) {
2
+ if (
3
+ (!allowEmpty && !value) ||
4
+ value === false ||
5
+ value?.toString()?.toLowerCase() === 'false' ||
6
+ value === 0 ||
7
+ value === '0'
8
+ ) {
9
+ return cross || '';
10
+ }
11
+ if (
12
+ value === true ||
13
+ value?.toString()?.toLowerCase() === 'true' ||
14
+ value === 1 ||
15
+ value === '1'
16
+ ) {
17
+ return tick || '';
18
+ }
19
+ if (
20
+ allowEmpty &&
21
+ (value === 'null' || value === '' || value === null || typeof value === 'undefined')
22
+ ) {
23
+ return '––';
24
+ }
25
+ return value;
26
+ }
27
+
28
+ export default {
29
+ TrueFalse: (value: any, options: Object) =>
30
+ Boolean(value, {
31
+ ...options,
32
+ tick: 'True',
33
+ cross: 'False'
34
+ })
35
+ };
@@ -2,19 +2,22 @@
2
2
  /* eslint-disable react/jsx-no-useless-fragment */
3
3
  // @ts-nocheck
4
4
  import { useState } from 'react';
5
- import { withKnobs } from '@storybook/addon-knobs';
5
+ import type { Meta, StoryObj } from '@storybook/react';
6
6
 
7
7
  import { configProps, stateProps } from './mock';
8
8
 
9
9
  import {{COMPONENT_CLASS_NAME}} from './index';
10
10
 
11
- export default {
11
+ const meta: Meta<typeof {{COMPONENT_CLASS_NAME}}> = {
12
12
  title: '{{COMPONENT_CLASS_NAME}}',
13
- decorators: [withKnobs],
14
- component: {{COMPONENT_CLASS_NAME}}
13
+ component: {{COMPONENT_CLASS_NAME}},
14
+ excludeStories: /.*Data$/
15
15
  };
16
16
 
17
- export const Base{{COMPONENT_CLASS_NAME}} = () => {
17
+ export default meta;
18
+ type Story = StoryObj<typeof {{COMPONENT_CLASS_NAME}}>;
19
+
20
+ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
18
21
 
19
22
  const [value, setValue] = useState(configProps.value);
20
23
 
@@ -2,10 +2,9 @@ import {
2
2
  Checkbox as CosmosCheckbox,
3
3
  CheckboxGroup,
4
4
  FieldValueList,
5
- Text
5
+ Text,
6
+ withConfiguration
6
7
  } from "@pega/cosmos-react-core";
7
- import PropTypes from "prop-types";
8
-
9
8
 
10
9
  import type { PConnFieldProps } from './PConnProps';
11
10
 
@@ -40,19 +39,19 @@ interface ActionsProps {
40
39
 
41
40
  // props passed in combination of props from property panel (config.json) and run time props from Constellation
42
41
  // any default values in config.pros should be set in defaultProps at bottom of this file
43
- export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
42
+ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
44
43
  const {
45
44
  getPConnect,
46
- value,
47
- label,
48
- helperText,
45
+ value = false,
46
+ label = '',
47
+ helperText = '',
49
48
  caption,
50
49
  validatemessage,
51
50
  hideLabel,
52
51
  testId,
53
- additionalProps,
52
+ additionalProps = {},
54
53
  displayMode,
55
- variant,
54
+ variant = 'inline',
56
55
  trueLabel,
57
56
  falseLabel
58
57
  } = props;
@@ -62,7 +61,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
62
61
  const stateProps = pConn.getStateProps() as StateProps;
63
62
  const propName: string = stateProps.value;
64
63
 
65
- let { readOnly, required, disabled } = props;
64
+ let { readOnly = false, required = false, disabled = false } = props;
66
65
  [readOnly, required, disabled] = [readOnly, required, disabled].map(
67
66
  (prop) => prop === true || (typeof prop === 'string' && prop === 'true')
68
67
  );
@@ -161,40 +160,4 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
161
160
  };
162
161
 
163
162
 
164
- {{COMPONENT_CLASS_NAME}}.defaultProps = {
165
- validatemessage: '',
166
- value: false,
167
- label: '',
168
- hideLabel: false,
169
- helperText: '',
170
- disabled: false,
171
- readOnly: false,
172
- required: false,
173
- testId: '',
174
- additionalProps: {},
175
- displayMode: null,
176
- variant: 'inline',
177
- displayValue: 'Yes/No',
178
- trueLabel: '',
179
- falseLabel: ''
180
- };
181
-
182
- {{COMPONENT_CLASS_NAME}}.propTypes = {
183
- getPConnect: PropTypes.func.isRequired,
184
- validatemessage: PropTypes.string,
185
- label: PropTypes.string,
186
- hideLabel: PropTypes.bool,
187
- helperText: PropTypes.string,
188
- value: PropTypes.bool,
189
- caption: PropTypes.string.isRequired,
190
- disabled: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
191
- readOnly: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
192
- required: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
193
- testId: PropTypes.string,
194
- additionalProps: PropTypes.objectOf(PropTypes.any),
195
- displayMode: PropTypes.string,
196
- variant: PropTypes.string,
197
- displayValue: PropTypes.string,
198
- trueLabel: PropTypes.string,
199
- falseLabel: PropTypes.string
200
- };
163
+ export default withConfiguration({{COMPONENT_CLASS_NAME}});
@@ -1,15 +1,8 @@
1
-
2
- // utilizing theming, comment out, if want individual style
3
- import styled from 'styled-components';
4
- import { Configuration } from '@pega/cosmos-react-core';
5
-
6
- export default styled(Configuration)``;
7
-
8
1
  // individual style, comment out above, and uncomment here and add styles
9
- // import styled, { css } from 'styled-components';
10
- //
11
- // export default styled.div(() => {
12
- // return css`
13
- // margin: 0px 0;
14
- // `;
15
- // });
2
+ import styled, { css } from 'styled-components';
3
+
4
+ export default styled.div(() => {
5
+ return css`
6
+ margin: 0px 0;
7
+ `;
8
+ });
@@ -15,8 +15,8 @@ const types = ['fromNow', 'customFormat'];
15
15
 
16
16
  // value should be in ISO 8601 format.
17
17
  function DateFormatter(
18
- value,
19
- { type = types[1], format = "DD/MM/YYYY", tzone } = {}
18
+ value: any,
19
+ { type = types[1], format = "DD/MM/YYYY", tzone = null } = {}
20
20
  ) {
21
21
  if (!value) return value;
22
22
  switch (type) {
@@ -31,7 +31,7 @@ function DateFormatter(
31
31
  }
32
32
 
33
33
  // value should be in hh:mm:ss format (00:00:00 - 23:59:59).
34
- function TimeFormatter(value, options) {
34
+ function TimeFormatter(value: any, options: any) {
35
35
  if (!value) return value;
36
36
  const { locale = "en-US" } = options;
37
37
  const timeOnlyRegex = /^(?:[01]\d|2[0123]):(?:[012345]\d):(?:[012345]\d)$/;
@@ -49,10 +49,10 @@ function TimeFormatter(value, options) {
49
49
  }
50
50
 
51
51
  export default {
52
- Date: (value, options) => DateFormatter(value, { type: 'customFormat', ...options }),
53
- 'Date-Time-Default': (value, options) =>
52
+ Date: (value: any, options: any) => DateFormatter(value, { type: 'customFormat', ...options }),
53
+ 'Date-Time-Default': (value: any, options: any) =>
54
54
  DateFormatter(value, { ...options, type: 'customFormat', format: 'lll' }),
55
- 'Time-Default': (value, options) =>
55
+ 'Time-Default': (value: any, options: any) =>
56
56
  TimeFormatter(value, {
57
57
  ...options,
58
58
  type: 'customFormat',
@@ -0,0 +1,20 @@
1
+ import { FieldValueList } from '@pega/cosmos-react-core';
2
+
3
+ import { format } from './date';
4
+
5
+ export default function FormattedText(props: any) {
6
+ const { formatType = 'none', label, value, testId, hideLabel, variant = 'stacked', additionalProps = {} } = props;
7
+
8
+ let text = value;
9
+
10
+ text = format(text, formatType, additionalProps);
11
+
12
+ const fields = [
13
+ {
14
+ id: label.toLowerCase(),
15
+ name: hideLabel ? '' : label,
16
+ value: text
17
+ }
18
+ ];
19
+ return <FieldValueList variant={variant} fields={fields} data-testid={testId} />;
20
+ }
@@ -1,6 +1,6 @@
1
- /* eslint-disable no-undef */
1
+ // @ts-nocheck
2
2
  import dayjs from 'dayjs';
3
- import DateFormatter from './DateFormatter.js';
3
+ import DateFormatter from './DateFormatter';
4
4
 
5
5
  import relativeTime from 'dayjs/plugin/relativeTime.js';
6
6
  import localizedFormat from 'dayjs/plugin/localizedFormat.js';
@@ -1,16 +1,19 @@
1
1
 
2
2
  /* eslint-disable react/jsx-no-useless-fragment */
3
3
  // @ts-nocheck
4
- import { withKnobs } from '@storybook/addon-knobs';
4
+ import type { Meta, StoryObj } from '@storybook/react';
5
5
  import { configProps, stateProps } from './mock';
6
6
  import {{COMPONENT_CLASS_NAME}} from './index';
7
7
 
8
- export default {
8
+ const meta: Meta<typeof {{COMPONENT_CLASS_NAME}}> = {
9
9
  title: '{{COMPONENT_CLASS_NAME}}',
10
- decorators: [withKnobs],
11
- component: {{COMPONENT_CLASS_NAME}}
10
+ component: {{COMPONENT_CLASS_NAME}},
11
+ excludeStories: /.*Data$/
12
12
  };
13
13
 
14
+ export default meta;
15
+ type Story = StoryObj<typeof {{COMPONENT_CLASS_NAME}}>;
16
+
14
17
  if (!window.PCore) {
15
18
  window.PCore = {};
16
19
  }
@@ -26,7 +29,7 @@ window.PCore.getEnvironmentInfo = () => {
26
29
  };
27
30
  };
28
31
 
29
- export const Base{{COMPONENT_CLASS_NAME}} = () => {
32
+ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
30
33
  const props = {
31
34
  getPConnect: () => {
32
35
  return {
@@ -1,11 +1,10 @@
1
1
  import { useEffect, useState } from 'react';
2
- import { DateInput, FieldValueList, DateTimeDisplay, Text, } from '@pega/cosmos-react-core';
3
- import PropTypes from 'prop-types';
4
- import FormattedText from "./FormattedText.jsx";
2
+ import { DateInput, FieldValueList, DateTimeDisplay, Text, withConfiguration } from '@pega/cosmos-react-core';
3
+ import FormattedText from "./FormattedText";
5
4
 
6
5
  import type { PConnFieldProps } from './PConnProps';
7
6
 
8
- import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
7
+ import StyledPegaDxilMyDateWrapper from './styles';
9
8
 
10
9
  // includes in bundle
11
10
  import {
@@ -16,12 +15,12 @@ import {
16
15
  getMinDate,
17
16
  datetimeFireChangeBlurEvents,
18
17
  getDateFormat
19
- } from "./date.js";
18
+ } from "./date";
20
19
  import { suggestionsHandler } from './suggestions-handler';
21
20
  import type { DateTimeFormat, DateTimeVariant } from '@pega/cosmos-react-core/lib/components/DateTime/DateTime.types.js';
22
21
 
23
22
  // interface for props
24
- interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
23
+ interface PegaDxilMyDateProps extends PConnFieldProps {
25
24
  // If any, enter additional props that only exist on TextInput here
26
25
  displayAsStatus?: boolean;
27
26
  isTableFormatter?: boolean;
@@ -42,7 +41,7 @@ interface StateProps {
42
41
  }
43
42
 
44
43
  interface ConfigProps {
45
- formatter?: string;
44
+ formatter?: string | undefined;
46
45
  }
47
46
 
48
47
  interface ActionsProps {
@@ -53,33 +52,33 @@ interface ActionsProps {
53
52
 
54
53
  // props passed in combination of props from property panel (config.json) and run time props from Constellation
55
54
  // any default values in config.pros should be set in defaultProps at bottom of this file
56
- export default function {{COMPONENT_CLASS_NAME}} (props: {{COMPONENT_CLASS_NAME}}Props) {
55
+ function PegaDxilMyDate (props: PegaDxilMyDateProps) {
57
56
  const {
58
57
  getPConnect,
59
58
  value,
60
59
  validatemessage,
61
60
  label,
62
- hideLabel,
63
- helperText,
61
+ hideLabel = false,
62
+ helperText = '',
64
63
  nextYearRange,
65
64
  previousYearRange,
66
- showWeekNumber,
65
+ showWeekNumber = false,
67
66
  testId,
68
- showAsFormattedText,
69
- additionalProps,
67
+ showAsFormattedText = false,
68
+ additionalProps = {},
70
69
  displayMode,
71
- variant,
72
- hasSuggestions
70
+ variant = 'inline',
71
+ hasSuggestions = false
73
72
  } = props;
74
73
 
75
- let {formatter} = props;
74
+ let {formatter = 'defaultDate' } = props;
76
75
  const pConn = getPConnect();
77
76
  const actions = pConn.getActionsApi();
78
77
  const actionsProps = pConn.getActionsApi() as unknown as ActionsProps;
79
78
  const stateProps = pConn.getStateProps() as StateProps;
80
79
  const propName: string = stateProps.value;
81
80
 
82
- let { readOnly, required, disabled } = props;
81
+ let { readOnly = false, required = false, disabled = false } = props;
83
82
  [readOnly, required, disabled] = [readOnly, required, disabled].map(
84
83
  (prop) => prop === true || (typeof prop === "string" && prop === "true")
85
84
  );
@@ -156,13 +155,14 @@ export default function {{COMPONENT_CLASS_NAME}} (props: {{COMPONENT_CLASS_NAME}
156
155
  const runtimeformatter = configProps?.formatter;
157
156
 
158
157
  if (formatter !== runtimeformatter) {
159
- formatter = runtimeformatter;
158
+ formatter = runtimeformatter!;
160
159
  }
161
160
  }
162
161
 
163
162
 
164
163
  if (formatter !== "" && formatExists(formatter)){
165
- const {variantVal,formatVal} = datetimedisplayformatter(formatter);
164
+ // @ts-ignore
165
+ const {variantVal, formatVal} = datetimedisplayformatter(formatter);
166
166
  variantValue = variantVal;
167
167
  formatValue = formatVal;
168
168
  }
@@ -175,29 +175,29 @@ export default function {{COMPONENT_CLASS_NAME}} (props: {{COMPONENT_CLASS_NAME}
175
175
  );
176
176
  switch(displayMode){
177
177
  case 'DISPLAY_ONLY': {
178
- return ( <Styled{{COMPONENT_CLASS_NAME}}Wrapper> displayComp </Styled{{COMPONENT_CLASS_NAME}}Wrapper>);
178
+ return ( <StyledPegaDxilMyDateWrapper> displayComp </StyledPegaDxilMyDateWrapper>);
179
179
  }
180
180
  case "LABELS_LEFT" : {
181
181
  return (
182
- <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
182
+ <StyledPegaDxilMyDateWrapper>
183
183
  <FieldValueList
184
184
  variant={hideLabel ? "stacked" : variant}
185
185
  data-testid={testId}
186
186
  fields={[{ id: '1', name: hideLabel ? "" :label, value: displayComp }]}
187
187
  />
188
- </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
188
+ </StyledPegaDxilMyDateWrapper>
189
189
 
190
190
  );
191
191
  }
192
192
  case "STACKED_LARGE_VAL" : {
193
193
  return (
194
- <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
194
+ <StyledPegaDxilMyDateWrapper>
195
195
  <FieldValueList
196
196
  variant='stacked'
197
197
  data-testid={testId}
198
198
  fields={[{ id: '2', name: hideLabel ? "" :label, value: <Text variant='h1' as='span'>{displayComp}</Text> }]}
199
199
  />
200
- </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
200
+ </StyledPegaDxilMyDateWrapper>
201
201
 
202
202
  );
203
203
  }
@@ -216,7 +216,7 @@ export default function {{COMPONENT_CLASS_NAME}} (props: {{COMPONENT_CLASS_NAME}
216
216
  fieldType: 'Date'
217
217
  };
218
218
  dateComponent = (
219
- <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
219
+ <StyledPegaDxilMyDateWrapper>
220
220
  <FormattedText
221
221
  formatType='date'
222
222
  value={value}
@@ -227,12 +227,12 @@ export default function {{COMPONENT_CLASS_NAME}} (props: {{COMPONENT_CLASS_NAME}
227
227
  // @ts-ignore
228
228
  customFormat={getDateFormat(locale)}
229
229
  />
230
- </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
230
+ </StyledPegaDxilMyDateWrapper>
231
231
  );
232
232
  } else {
233
233
 
234
234
  dateComponent = (
235
- <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
235
+ <StyledPegaDxilMyDateWrapper>
236
236
  <DateInput
237
237
  {...additionalProps}
238
238
  label={label}
@@ -252,52 +252,11 @@ export default function {{COMPONENT_CLASS_NAME}} (props: {{COMPONENT_CLASS_NAME}
252
252
  onBlur={handleBlur}
253
253
  onResolveSuggestion={onResolveSuggestionHandler}
254
254
  />
255
- </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
255
+ </StyledPegaDxilMyDateWrapper>
256
256
  );
257
257
  }
258
258
  return dateComponent;
259
259
  }
260
260
 
261
261
 
262
-
263
- {{COMPONENT_CLASS_NAME}}.defaultProps = {
264
- value: undefined,
265
- validatemessage: "",
266
- helperText: "",
267
- hideLabel: false,
268
- disabled: false,
269
- readOnly: false,
270
- required: false,
271
- showWeekNumber: false,
272
- nextYearRange: "",
273
- previousYearRange: "",
274
- testId: "",
275
- showAsFormattedText: false,
276
- additionalProps: {},
277
- displayMode: null,
278
- variant: "inline",
279
- formatter: "defaultDate",
280
- hasSuggestions: false
281
- };
282
-
283
- {{COMPONENT_CLASS_NAME}}.propTypes = {
284
- value: PropTypes.string,
285
- label: PropTypes.string.isRequired,
286
- hideLabel: PropTypes.bool,
287
- getPConnect: PropTypes.func.isRequired,
288
- validatemessage: PropTypes.string,
289
- helperText: PropTypes.string,
290
- disabled: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
291
- readOnly: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
292
- required: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
293
- showWeekNumber: PropTypes.bool,
294
- nextYearRange: PropTypes.string,
295
- previousYearRange: PropTypes.string,
296
- testId: PropTypes.string,
297
- showAsFormattedText: PropTypes.bool,
298
- additionalProps: PropTypes.objectOf(PropTypes.any),
299
- displayMode: PropTypes.string,
300
- variant: PropTypes.string,
301
- formatter: PropTypes.string,
302
- hasSuggestions: PropTypes.bool
303
- };
262
+ export default withConfiguration(PegaDxilMyDate);
@@ -1,15 +1,8 @@
1
-
2
- // utilizing theming, comment out, if want individual style
3
- import styled from 'styled-components';
4
- import { Configuration } from '@pega/cosmos-react-core';
5
-
6
- export default styled(Configuration)``;
7
-
8
1
  // individual style, comment out above, and uncomment here and add styles
9
- // import styled, { css } from 'styled-components';
10
- //
11
- // export default styled.div(() => {
12
- // return css`
13
- // margin: 0px 0;
14
- // `;
15
- // });
2
+ import styled, { css } from 'styled-components';
3
+
4
+ export default styled.div(() => {
5
+ return css`
6
+ margin: 0px 0;
7
+ `;
8
+ });