@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
@@ -1,18 +1,21 @@
1
1
  /* eslint-disable react/jsx-no-useless-fragment */
2
2
  // @ts-nocheck
3
- import { withKnobs } from '@storybook/addon-knobs';
3
+ import type { Meta, StoryObj } from '@storybook/react';
4
4
 
5
5
  import { stateProps, configProps, fieldMetadata } from './mock';
6
6
 
7
7
  import PegaDxilMyInteger from './index';
8
8
 
9
- export default {
9
+ const meta: Meta<typeof PegaDxilMyInteger> = {
10
10
  title: 'PegaDxilMyInteger',
11
- decorators: [withKnobs],
12
- component: PegaDxilMyInteger
11
+ component: PegaDxilMyInteger,
12
+ excludeStories: /.*Data$/
13
13
  };
14
14
 
15
- export const BasePegaDxilMyInteger = () => {
15
+ export default meta;
16
+ type Story = StoryObj<typeof PegaDxilMyInteger>;
17
+
18
+ export const BasePegaDxilMyInteger: Story = args => {
16
19
 
17
20
  const props = {
18
21
  value: configProps.value,
@@ -1,6 +1,6 @@
1
1
  import { useState, useEffect, useRef } from 'react';
2
- import { NumberInput, NumberDisplay, Slider, FieldValueList, CurrencyDisplay, Text } from '@pega/cosmos-react-core';
3
- import PropTypes from 'prop-types';
2
+ import { NumberInput, NumberDisplay, Slider, FieldValueList, CurrencyDisplay, Text, withConfiguration } from '@pega/cosmos-react-core';
3
+
4
4
 
5
5
  import type { PConnFieldProps } from './PConnProps';
6
6
 
@@ -24,7 +24,6 @@ interface PegaDxilMyIntegerProps extends PConnFieldProps {
24
24
  allowDecimals: boolean;
25
25
  currencyISOCode: string;
26
26
  alwaysShowISOCode: boolean;
27
- isoCodeSelection: string;
28
27
  additionalProps: any;
29
28
  showGroupSeparators: boolean;
30
29
  currencyDisplay: 'symbol' | 'code' | 'name' | undefined;
@@ -48,7 +47,7 @@ interface StateProps {
48
47
 
49
48
  // props passed in combination of props from property panel (config.json) and run time props from Constellation
50
49
  // any default values in config.pros should be set in defaultProps at bottom of this file
51
- export default function PegaDxilMyInteger(props: PegaDxilMyIntegerProps) {
50
+ function PegaDxilMyInteger(props: PegaDxilMyIntegerProps) {
52
51
  const {
53
52
  getPConnect,
54
53
  value,
@@ -56,26 +55,26 @@ export default function PegaDxilMyInteger(props: PegaDxilMyIntegerProps) {
56
55
  placeholder,
57
56
  validatemessage,
58
57
  label,
59
- hideLabel,
58
+ hideLabel = false,
60
59
  helperText,
61
60
  testId,
62
61
  displayMode,
63
62
  displayAs,
64
- showInput,
65
- min,
66
- max,
67
- step,
68
- showTicks,
69
- additionalProps,
70
- variant,
71
- formatter,
72
- negative,
73
- notation,
74
- isTableFormatter,
75
- hasSuggestions
63
+ showInput = true,
64
+ min = 0,
65
+ max = 100,
66
+ step = 1,
67
+ showTicks = true,
68
+ additionalProps = {},
69
+ variant = 'inline',
70
+ formatter = 'defaultInteger',
71
+ negative = 'minus-sign',
72
+ notation = 'standard',
73
+ isTableFormatter = false,
74
+ hasSuggestions = false
76
75
  } = props;
77
- let { showGroupSeparators } = props;
78
- let { currencyDisplay } = props;
76
+ let { showGroupSeparators = false } = props;
77
+ let { currencyDisplay = 'symbol' } = props;
79
78
  const pConn = getPConnect();
80
79
  const actions = pConn.getActionsApi();
81
80
  const stateProps = pConn.getStateProps() as StateProps;
@@ -86,11 +85,13 @@ export default function PegaDxilMyInteger(props: PegaDxilMyIntegerProps) {
86
85
  const hasValueChange = useRef(false);
87
86
 
88
87
 
89
- let { readOnly, required, disabled } = props;
88
+ let { readOnly = false, required = false, disabled = false } = props;
90
89
  [readOnly, required, disabled] = [readOnly, required, disabled].map(
91
90
  (prop) => prop === true || (typeof prop === 'string' && prop === 'true')
92
91
  );
93
92
 
93
+
94
+
94
95
  const [status, setStatus] = useState(hasSuggestions ? 'pending' : '');
95
96
  useEffect(() => {
96
97
  if (validatemessage !== '') {
@@ -115,7 +116,7 @@ export default function PegaDxilMyInteger(props: PegaDxilMyIntegerProps) {
115
116
  }
116
117
  }, [actions, displayAs, propName, sliderDefaultValue, value]);
117
118
 
118
- const { decimalPrecision, currencyDecimalPrecision, currencyISOCode } = props;
119
+ const { decimalPrecision, currencyDecimalPrecision = 'auto', currencyISOCode = 'USD' } = props;
119
120
  let noOfDecimals = parseInt(decimalPrecision, 10);
120
121
  // @ts-ignore
121
122
  if (Number.isNaN(noOfDecimals)) noOfDecimals = undefined;
@@ -307,70 +308,5 @@ export default function PegaDxilMyInteger(props: PegaDxilMyIntegerProps) {
307
308
  );
308
309
  }
309
310
 
310
- PegaDxilMyInteger.defaultProps = {
311
- value: '',
312
- defaultValue: null,
313
- placeholder: '',
314
- validatemessage: '',
315
- helperText: '',
316
- hideLabel: false,
317
- disabled: false,
318
- readOnly: false,
319
- required: false,
320
- testId: '',
321
- showGroupSeparators: false,
322
- displayMode: null,
323
- displayAs: 'input',
324
- showInput: true,
325
- min: 0,
326
- max: 100,
327
- step: 1,
328
- showTicks: true,
329
- additionalProps: {},
330
- variant: 'inline',
331
- decimalPrecision: null,
332
- currencyISOCode: 'USD',
333
- isoCodeSelection: 'constant',
334
- formatter: 'defaultInteger',
335
- negative: 'minus-sign',
336
- notation: 'standard',
337
- currencyDisplay: 'symbol',
338
- currencyDecimalPrecision: 'auto',
339
- isTableFormatter: false,
340
- hasSuggestions: false
341
- };
342
311
 
343
- PegaDxilMyInteger.propTypes = {
344
- value: PropTypes.string,
345
- defaultValue: PropTypes.number,
346
- placeholder: PropTypes.string,
347
- label: PropTypes.string.isRequired,
348
- hideLabel: PropTypes.bool,
349
- getPConnect: PropTypes.func.isRequired,
350
- validatemessage: PropTypes.string,
351
- helperText: PropTypes.string,
352
- disabled: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
353
- readOnly: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
354
- required: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
355
- testId: PropTypes.string,
356
- showGroupSeparators: PropTypes.bool,
357
- displayMode: PropTypes.string,
358
- displayAs: PropTypes.string,
359
- showInput: PropTypes.bool,
360
- min: PropTypes.number,
361
- max: PropTypes.number,
362
- step: PropTypes.number,
363
- showTicks: PropTypes.bool,
364
- additionalProps: PropTypes.objectOf(PropTypes.any),
365
- variant: PropTypes.string,
366
- decimalPrecision: PropTypes.number,
367
- currencyISOCode: PropTypes.string,
368
- isoCodeSelection: PropTypes.string,
369
- formatter: PropTypes.string,
370
- negative: PropTypes.string,
371
- notation: PropTypes.string,
372
- currencyDisplay: PropTypes.string,
373
- currencyDecimalPrecision: PropTypes.string,
374
- isTableFormatter: PropTypes.bool,
375
- hasSuggestions: PropTypes.bool
376
- };
312
+ export default withConfiguration(PegaDxilMyInteger);
@@ -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
+ });
@@ -2,20 +2,23 @@
2
2
  /* eslint-disable react/jsx-no-useless-fragment */
3
3
  /* eslint-disable react/no-unstable-nested-components */
4
4
  // @ts-nocheck
5
- import { withKnobs } from '@storybook/addon-knobs';
5
+ import type { Meta, StoryObj } from '@storybook/react';
6
6
 
7
7
  import { AppAnnouncement as PegaAppAnnouncement } from '@pega/cosmos-react-work';
8
8
 
9
9
  import PegaDxilMyPage from './index';
10
10
  import { pyHome1Resolved, pyHome1Raw } from './mock';
11
11
 
12
- export default {
12
+ const meta: Meta<typeof PegaDxilMyPage> = {
13
13
  title: 'PegaDxilMyPage',
14
- decorators: [withKnobs],
15
- component: PegaDxilMyPage
14
+ component: PegaDxilMyPage,
15
+ excludeStories: /.*Data$/,
16
16
  };
17
17
 
18
- export const BasePegaDxilMyPage = () => {
18
+ export default meta;
19
+ type Story = StoryObj<typeof PegaDxilMyPage>;
20
+
21
+ export const BasePegaDxilMyPage: Story = args => {
19
22
  if (!window.PCore) {
20
23
  window.PCore = {};
21
24
  }
@@ -1,6 +1,5 @@
1
1
  import { useMemo, Children } from 'react';
2
- import PropTypes from 'prop-types';
3
- import { OneColumnPage as OneColumn } from '@pega/cosmos-react-core';
2
+ import { OneColumnPage as OneColumn, withConfiguration } from '@pega/cosmos-react-core';
4
3
  import { ConfigurableLayout } from '@pega/cosmos-react-work'
5
4
  // import { registerIcon } from '@pega/cosmos-react-core';
6
5
  import type { PConnFieldProps } from './PConnProps';
@@ -35,11 +34,11 @@ interface PegaDxilMyPageProps extends PConnFieldProps {
35
34
 
36
35
  // props passed in combination of props from property panel (config.json) and run time props from Constellation
37
36
  // any default values in config.pros should be set in defaultProps at bottom of this file
38
- export default function PegaDxilMyPage(props: PegaDxilMyPageProps) {
37
+ function PegaDxilMyPage(props: PegaDxilMyPageProps) {
39
38
 
40
39
  // add back in icon when working
41
- // const { children, title, icon, useConfigurableLayout, getPConnect, enableGetNextWork } = props;
42
- const { children, title, useConfigurableLayout, getPConnect, enableGetNextWork } = props;
40
+ // const { children, title, icon, useConfigurableLayout = false, getPConnect, enableGetNextWork } = props;
41
+ const { children = [], title, useConfigurableLayout, getPConnect, enableGetNextWork } = props;
43
42
  const childArray = useMemo(() => {
44
43
  return Children.toArray(children);
45
44
  }, [children]);
@@ -70,14 +69,4 @@ export default function PegaDxilMyPage(props: PegaDxilMyPageProps) {
70
69
 
71
70
  }
72
71
 
73
- PegaDxilMyPage.defaultProps = {
74
- /* icon: '', */
75
- useConfigurableLayout: false
76
- };
77
-
78
- PegaDxilMyPage.propTypes = {
79
- children: PropTypes.arrayOf(PropTypes.node).isRequired,
80
- title: PropTypes.string.isRequired,
81
- /* icon: PropTypes.string, */
82
- useConfigurableLayout: PropTypes.bool
83
- };
72
+ export default withConfiguration(PegaDxilMyPage);
@@ -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
+ });
@@ -9,7 +9,7 @@ const LazyComponentMap = {};
9
9
  * metadata of all regions.
10
10
  * @param {Function} pConnect PConnect of a Template component.
11
11
  */
12
- export function getAllFields(pConnect) {
12
+ export function getAllFields(pConnect: Function) {
13
13
  const metadata = pConnect().getRawMetadata();
14
14
  if (!metadata.children) {
15
15
  return [];
@@ -17,15 +17,15 @@ export function getAllFields(pConnect) {
17
17
 
18
18
  let allFields = [];
19
19
 
20
- const makeField = (f) => ({
20
+ const makeField = (f: any) => ({
21
21
  ...pConnect().resolveConfigProps(f.config),
22
22
  type: f.type
23
23
  });
24
24
 
25
25
  const hasRegions = !!metadata.children[0]?.children;
26
26
  if (hasRegions) {
27
- allFields = metadata.children.map((region) =>
28
- region.children.map((field) => {
27
+ allFields = metadata.children.map((region: any) =>
28
+ region.children.map((field: any) => {
29
29
  // Do not resolve the config props if is status work, instead create component here as status badge and mark as status display
30
30
  if (field.config?.value === '@P .pyStatusWork') {
31
31
  field.type = 'TextInput';
@@ -50,7 +50,7 @@ export function getAllFields(pConnect) {
50
50
  * @param {Function} getPConnect PConnect function passed along to other components.
51
51
  * @param {string} displayMode displayMode string contains information about the layout of component in review mode.
52
52
  */
53
- export function prepareComponentInCaseSummary(configObject, getPConnect, displayMode) {
53
+ export function prepareComponentInCaseSummary(configObject: any, getPConnect: Function, displayMode: string) {
54
54
  const { config, children } = configObject;
55
55
  let { type } = configObject;
56
56
  const caseSummaryComponentObject = {};
@@ -60,33 +60,40 @@ export function prepareComponentInCaseSummary(configObject, getPConnect, display
60
60
  type = 'TextInput'; // force the type to be TextInput for status field.
61
61
  // As TextInput is loaded forcefully sometimes, TextInput component might not be available in lazy map.
62
62
  // Load TextInput if it is not available.
63
+ // @ts-ignore
63
64
  if (!LazyComponentMap[type]) {
64
65
  PCore.getAssetLoader().getLoader('component-loader')([type]);
65
66
  }
66
67
  }
67
68
 
69
+ // @ts-ignore
68
70
  caseSummaryComponentObject.name = getPConnect().resolveConfigProps({
69
71
  label: config.label
70
72
  }).label;
71
73
  if (type === 'CaseOperator') {
74
+ // @ts-ignore
72
75
  switch (caseSummaryComponentObject.name) {
73
76
  case 'Create operator':
77
+ // @ts-ignore
74
78
  caseSummaryComponentObject.name = getPConnect().resolveConfigProps({
75
79
  createLabel: config.createLabel
76
80
  }).createLabel;
77
81
  break;
78
82
  case 'Update operator':
83
+ // @ts-ignore
79
84
  caseSummaryComponentObject.name = getPConnect().resolveConfigProps({
80
85
  updateLabel: config.updateLabel
81
86
  }).updateLabel;
82
87
  break;
83
88
  default:
89
+ // @ts-ignore
84
90
  caseSummaryComponentObject.name = getPConnect().resolveConfigProps({
85
91
  resolveLabel: config.resolveLabel
86
92
  }).resolveLabel;
87
93
  break;
88
94
  }
89
95
  } else if (type === 'Checkbox') {
96
+ // @ts-ignore
90
97
  caseSummaryComponentObject.name = getPConnect().resolveConfigProps({
91
98
  label: config.caption
92
99
  }).label;
@@ -108,15 +115,17 @@ export function prepareComponentInCaseSummary(configObject, getPConnect, display
108
115
  createdComponent.props.getPConnect().setInheritedProp('showAddressLabel', showAddressLabel);
109
116
  }
110
117
  // createdComponent.props.getPConnect().setInheritedProp("hideLabel", true);
118
+ // @ts-ignore
111
119
  caseSummaryComponentObject.value = createdComponent;
112
120
  if (type === 'reference') {
121
+ // @ts-ignore
113
122
  caseSummaryComponentObject.name = createdComponent.props.getPConnect().getInheritedProps().label;
114
123
  }
115
124
 
116
125
  return caseSummaryComponentObject;
117
126
  }
118
127
 
119
- export function getFilteredFields(getPConnect) {
128
+ export function getFilteredFields(getPConnect: Function) {
120
129
  let primaryFieldsRaw;
121
130
  let secondaryFieldsRaw;
122
131
  const metadata = getPConnect().getRawMetadata();
@@ -129,12 +138,12 @@ export function getFilteredFields(getPConnect) {
129
138
  }
130
139
 
131
140
  // Filter out fields that are not visible and unsupported types for primary fields (for CaseSummary)
132
- primaryFieldsRaw = primaryFieldsRaw.filter((item) => {
141
+ primaryFieldsRaw = primaryFieldsRaw.filter((item: any) => {
133
142
  const resolvedItem = getPConnect().resolveConfigProps(item.config);
134
143
  return resolvedItem.visibility !== false && item.type !== 'TextContent';
135
144
  });
136
145
 
137
- secondaryFieldsRaw = secondaryFieldsRaw.filter((item) => {
146
+ secondaryFieldsRaw = secondaryFieldsRaw.filter((item: any) => {
138
147
  const resolvedItem = getPConnect().resolveConfigProps(item.config);
139
148
  return resolvedItem.visibility !== false && item.type !== 'TextContent';
140
149
  });
@@ -147,17 +156,18 @@ export function getFilteredFields(getPConnect) {
147
156
  * @param {object[]} regionData template children item.
148
157
  * @returns {object[]} ConfigurableLayout content.
149
158
  */
150
- export function getLayoutDataFromRegion(regionData) {
159
+ export function getLayoutDataFromRegion(regionData: object[]) {
151
160
  const defaultLayoutConfig = {
152
161
  width: 'full',
153
162
  fillAvailable: true,
154
163
  minWidth: [300, 'px']
155
164
  };
156
165
 
166
+ // @ts-ignore
157
167
  return regionData.props
158
168
  ?.getPConnect()
159
169
  ?.getChildren()
160
- ?.map((item, index) => {
170
+ ?.map((item: any, index: number) => {
161
171
  const itemPConnect = item?.getPConnect();
162
172
 
163
173
  return {
@@ -175,15 +185,18 @@ export function getLayoutDataFromRegion(regionData) {
175
185
  * Determine if the current view is the view of the case step/assignment.
176
186
  * @param {Function} pConnect PConnect object for the component
177
187
  */
178
- export function getIsAssignmentView(pConnect) {
188
+ export function getIsAssignmentView(pConnect: Function) {
179
189
  // Get caseInfo content from the store which contains the view info about the current assignment/step
180
190
  // TODO To be replaced with pConnect.getCaseInfo().getCurrentAssignmentView when it's available
191
+ // @ts-ignore
181
192
  const assignmentViewClass = pConnect.getValue(PCore.getConstants().CASE_INFO.CASE_INFO_CLASSID);
193
+ // @ts-ignore
182
194
  const assignmentViewName = pConnect.getValue(PCore.getConstants().CASE_INFO.ASSIGNMENTACTION_ID);
183
195
 
184
196
  const assignmentViewId = `${assignmentViewName}!${assignmentViewClass}`;
185
197
 
186
198
  // Get the info about the current view from pConnect
199
+ // @ts-ignore
187
200
  const currentViewId = `${pConnect.getCurrentView()}!${pConnect.getCurrentClassID()}`;
188
201
 
189
202
  return assignmentViewId === currentViewId;
@@ -194,7 +207,8 @@ export function getIsAssignmentView(pConnect) {
194
207
  * @param {Function} pConnect PConnect object for the component
195
208
  * @param {string} [instructions="casestep"] 'casestep', 'none', or the html content of a Rule-UI-Paragraph rule (processed via core's paragraph annotation handler)
196
209
  */
197
- export function getInstructions(pConnect, instructions = 'casestep') {
210
+ export function getInstructions(pConnect: Function, instructions: string = 'casestep') {
211
+ // @ts-ignore
198
212
  const caseStepInstructions = pConnect.getValue(PCore.getConstants().CASE_INFO.INSTRUCTIONS);
199
213
 
200
214
  // Determine if this view is the current assignment/step view
@@ -212,9 +226,9 @@ export function getInstructions(pConnect, instructions = 'casestep') {
212
226
 
213
227
  // If the annotation wasn't processed correctly, don't return any instruction text
214
228
  if (instructions?.startsWith('@PARAGRAPH')) {
215
- /* eslint-disable no-console */
229
+
216
230
  console.error('@PARAGRAPH annotation was not processed. Hiding custom instructions.');
217
- /* eslint-enable no-console */
231
+
218
232
  return undefined;
219
233
  }
220
234
 
@@ -1,7 +1,6 @@
1
1
  /* eslint-disable react-hooks/rules-of-hooks */
2
2
  import React from 'react';
3
3
  import { useEffect, useState } from 'react';
4
- import PropTypes from 'prop-types';
5
4
  import { Avatar as CosmosAvatar } from '@pega/cosmos-react-core';
6
5
  import type { PConnFieldProps } from './PConnProps';
7
6
 
@@ -15,7 +14,7 @@ interface PegaDxilMyPageCaseWidgetAvatarProps extends PConnFieldProps {
15
14
  }
16
15
 
17
16
  function Avatar(props: PegaDxilMyPageCaseWidgetAvatarProps) {
18
- const { metaObj, showStatus } = props;
17
+ const { metaObj, showStatus = false } = props;
19
18
  const [imageBlobUrl, setImageBlobUrl] = useState(null);
20
19
  let userName: string;
21
20
  let userIdentifier: string;
@@ -75,14 +74,5 @@ function Avatar(props: PegaDxilMyPageCaseWidgetAvatarProps) {
75
74
  return <CosmosAvatar name={userName} imageSrc={imageBlobUrl as React.SetStateAction<any>} />;
76
75
  }
77
76
 
78
- Avatar.propTypes = {
79
- metaObj: PropTypes.objectOf(PropTypes.any),
80
- showStatus: PropTypes.bool
81
- };
82
-
83
- Avatar.defaultProps = {
84
- metaObj: null,
85
- showStatus: false
86
- };
87
77
 
88
78
  export default Avatar;
@@ -12,12 +12,12 @@ import {
12
12
  } from '@pega/cosmos-react-core';
13
13
  import { Glimpse } from '@pega/cosmos-react-work';
14
14
  import { EmailDisplay } from '@pega/cosmos-react-core';
15
- import PropTypes from 'prop-types';
16
15
 
17
16
  import type { PConnFieldProps } from './PConnProps';
18
17
 
19
18
  import Avatar from './Avatar';
20
19
 
20
+
21
21
  // interface for props
22
22
  interface PegaDxilMyPageCaseWidgetOperatorProps extends PConnFieldProps {
23
23
  // If any, enter additional props that only exist on TextInput here
@@ -36,7 +36,7 @@ export default function Operator(props: PegaDxilMyPageCaseWidgetOperatorProps) {
36
36
  const [isLoading, setIsLoading] = useState(true);
37
37
  const [popoverEl, setPopoverEl] = useElement(null);
38
38
  const [popoverContent, setpopoverContent] = useState(null);
39
- const theme = useTheme();
39
+ const theme: any = useTheme();
40
40
 
41
41
  /* If the id has changed, we need to reset the popover */
42
42
  useEffect(() => {
@@ -46,8 +46,8 @@ export default function Operator(props: PegaDxilMyPageCaseWidgetOperatorProps) {
46
46
 
47
47
 
48
48
  const OperatorPreview = () => {
49
- let localizedVal = PCore.getLocaleUtils().getLocaleValue;
50
- let localeCategory = 'Operator';
49
+ const localizedVal = PCore.getLocaleUtils().getLocaleValue;
50
+ const localeCategory = 'Operator';
51
51
  setpopoverContent(
52
52
  <Progress variant='ring' message={localizedVal('Loading operator...', localeCategory)} placement='local' />
53
53
  );
@@ -87,55 +87,54 @@ export default function Operator(props: PegaDxilMyPageCaseWidgetOperatorProps) {
87
87
  />
88
88
  );
89
89
  } else {
90
- localizedVal = PCore.getLocaleUtils().getLocaleValue;
91
- localeCategory = 'Operator';
92
90
  return PCore.getUserApi()
93
91
  .getOperatorDetails(id, true)
94
92
  .then(res => {
95
93
  if (res.data?.data && res.data.data[0].BusinessID && res.data.data[0].Name) {
96
94
  const fields = [];
97
- if (res.data.data[0].Name)
95
+ if (res.data.data[0].Name) {
98
96
  fields.push({
99
97
  id: 'Name',
100
98
  name: localizedVal('Name', localeCategory),
101
99
  value: res.data.data[0].Name
102
100
  });
103
- if (res.data.data[0].BusinessID)
101
+ }
102
+ if (res.data.data[0].BusinessID) {
104
103
  fields.push({
105
104
  id: 'Email',
106
105
  name: localizedVal('Email address', localeCategory),
107
106
  value: <EmailDisplay value={res.data.data[0].BusinessID} />
108
107
  });
109
-
110
- setIsLoading(false);
111
- setpopoverContent(
112
- <Glimpse
113
- heading={{
114
- primary: res.data.data[0].Name,
115
- secondary: res.data.data[0].BusinessID,
116
- visual: (
117
- <Avatar
118
- metaObj={{
119
- image: '',
120
- name: res.data.data[0].Name
121
- }}
122
- />
123
- )
124
- }}
125
- fields={fields}
126
- target={pTarget}
127
- onDismiss={() => {pTarget = null;})}
128
- />
129
- );
130
-
108
+ }
109
+ const opAvatar = (
110
+ <Avatar
111
+ metaObj={{
112
+ image: '',
113
+ name: res.data.data[0].Name
114
+ }}
115
+ />
116
+ );
117
+
118
+ setIsLoading(false);
119
+ setpopoverContent(
120
+ <Glimpse
121
+ heading={{
122
+ primary: res.data.data[0].Name,
123
+ secondary: res.data.data[0].BusinessID,
124
+ visual: opAvatar
125
+ }}
126
+ fields={fields}
127
+ target={pTarget}
128
+ onDismiss={() => {pTarget = null;}}
129
+ />
130
+ );
131
131
  }
132
132
  });
133
-
134
133
  }
135
134
  };
136
135
 
137
136
 
138
- const clickAction = (e: any) =>
137
+ const clickAction = (e: any) => {
139
138
 
140
139
  setIsOpen(!isOpen);
141
140
  if (pTarget === null) {
@@ -151,6 +150,7 @@ export default function Operator(props: PegaDxilMyPageCaseWidgetOperatorProps) {
151
150
  };
152
151
 
153
152
  useOuterEvent('mousedown', [popoverEl], hidePopover); // Call the method on clicking outside these elements
153
+
154
154
  const hideOnEscape = (e: any) => {
155
155
  if (e.key === 'Escape') hidePopover(); // Call the method when Escape key is pressed
156
156
  };
@@ -167,7 +167,7 @@ export default function Operator(props: PegaDxilMyPageCaseWidgetOperatorProps) {
167
167
  data-test-id={testId}
168
168
  style={label !== null ? { width: 'max-content', height: theme.components.input.height } : undefined}
169
169
  >
170
- <Avatar {...props}></Avatar>
170
+ <Avatar {...props} />
171
171
  </Button>
172
172
  ) : (
173
173
  <Button
@@ -208,21 +208,3 @@ export default function Operator(props: PegaDxilMyPageCaseWidgetOperatorProps) {
208
208
 
209
209
  return comp;
210
210
  };
211
-
212
- Operator.propTypes = {
213
- name: PropTypes.string,
214
- id: PropTypes.string,
215
- label: PropTypes.string,
216
- testId: PropTypes.string,
217
- helperText: PropTypes.string,
218
- metaObj: PropTypes.object
219
- };
220
-
221
- Operator.defaultProps = {
222
- name: '',
223
- id: '',
224
- label: null,
225
- testId: null,
226
- helperText: null,
227
- metaObj: null
228
- };