@pega/dx-component-builder-sdk 23.1.13 → 23.1.15

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 (342) hide show
  1. package/README.md +4 -4
  2. package/package.json +1 -1
  3. package/src/cli.js +6 -0
  4. package/src/constants.js +10 -0
  5. package/src/tasks/build-jest-assets/index.js +153 -0
  6. package/src/tasks/create/templates/Constellation/field/Boolean/Boolean.ts.mustache +35 -0
  7. package/src/tasks/create/templates/Constellation/field/Boolean/demo.stories.tsx.mustache +71 -0
  8. package/src/tasks/create/templates/Constellation/field/Boolean/index.tsx.mustache +11 -48
  9. package/src/tasks/create/templates/Constellation/field/Boolean/mock.ts.mustache +2 -1
  10. package/src/tasks/create/templates/Constellation/field/Boolean/styles.ts.mustache +7 -14
  11. package/{tests/assets/sdk-r/components/createAll/custom-constellation/field/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/src/tasks/create/templates/Constellation/field/Date/{date.js.mustache → date.ts.mustache} +3 -2
  14. package/src/tasks/create/templates/Constellation/field/Date/demo.stories.tsx.mustache +31 -24
  15. package/src/tasks/create/templates/Constellation/field/Date/index.tsx.mustache +19 -60
  16. package/src/tasks/create/templates/Constellation/field/Date/mock.ts.mustache +2 -1
  17. package/src/tasks/create/templates/Constellation/field/Date/styles.ts.mustache +7 -14
  18. package/src/tasks/create/templates/Constellation/field/DateTime/{date-time.js.mustache → date-time.ts.mustache} +12 -12
  19. package/{tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTimeOfDay/time-of-day.js → src/tasks/create/templates/Constellation/field/DateTime/date-utils.ts.mustache} +27 -26
  20. package/{tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyDateTime/date.js → src/tasks/create/templates/Constellation/field/DateTime/date.ts.mustache} +1 -0
  21. package/src/tasks/create/templates/Constellation/field/DateTime/demo.stories.tsx.mustache +32 -25
  22. package/src/tasks/create/templates/Constellation/field/DateTime/index.tsx.mustache +13 -60
  23. package/src/tasks/create/templates/Constellation/field/DateTime/mock.ts.mustache +3 -1
  24. package/src/tasks/create/templates/Constellation/field/DateTime/styles.ts.mustache +7 -14
  25. package/src/tasks/create/templates/Constellation/field/Decimal/demo.stories.tsx.mustache +25 -13
  26. package/src/tasks/create/templates/Constellation/field/Decimal/index.tsx.mustache +15 -68
  27. package/src/tasks/create/templates/Constellation/field/Decimal/mock.ts.mustache +9 -1
  28. package/src/tasks/create/templates/Constellation/field/Decimal/styles.ts.mustache +7 -14
  29. package/src/tasks/create/templates/Constellation/field/Decimal-Currency/demo.stories.tsx.mustache +28 -15
  30. package/src/tasks/create/templates/Constellation/field/Decimal-Currency/index.tsx.mustache +24 -76
  31. package/src/tasks/create/templates/Constellation/field/Decimal-Currency/mock.ts.mustache +11 -1
  32. package/src/tasks/create/templates/Constellation/field/Decimal-Currency/styles.ts.mustache +7 -14
  33. package/src/tasks/create/templates/Constellation/field/Decimal-Percentage/demo.stories.tsx.mustache +25 -12
  34. package/src/tasks/create/templates/Constellation/field/Decimal-Percentage/index.tsx.mustache +14 -55
  35. package/src/tasks/create/templates/Constellation/field/Decimal-Percentage/mock.ts.mustache +9 -2
  36. package/src/tasks/create/templates/Constellation/field/Decimal-Percentage/styles.ts.mustache +7 -14
  37. package/src/tasks/create/templates/Constellation/field/Integer/demo.stories.tsx.mustache +25 -12
  38. package/src/tasks/create/templates/Constellation/field/Integer/index.tsx.mustache +24 -88
  39. package/src/tasks/create/templates/Constellation/field/Integer/mock.ts.mustache +8 -2
  40. package/src/tasks/create/templates/Constellation/field/Integer/styles.ts.mustache +7 -14
  41. package/src/tasks/create/templates/Constellation/field/Picklist/demo.stories.tsx.mustache +25 -12
  42. package/src/tasks/create/templates/Constellation/field/Picklist/index.tsx.mustache +13 -61
  43. package/src/tasks/create/templates/Constellation/field/Picklist/mock.ts.mustache +9 -1
  44. package/src/tasks/create/templates/Constellation/field/Picklist/styles.ts.mustache +7 -14
  45. package/{tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/date.js → src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/date.ts.mustache} +2 -1
  46. package/src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/demo.stories.tsx.mustache +26 -14
  47. package/{tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/embed-utils.js → src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/embed-utils.ts.mustache} +2 -1
  48. package/src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/index.tsx.mustache +15 -76
  49. package/src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/mock.ts.mustache +8 -1
  50. package/{tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/picklist-utils.js → src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/picklist-utils.ts.mustache} +1 -0
  51. package/src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/{repeat-constants.js.mustache → repeat-constants.ts.mustache} +1 -1
  52. package/src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/{repeat-utils.js.mustache → repeat-utils.ts.mustache} +6 -12
  53. package/src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/styles.ts.mustache +7 -14
  54. package/src/tasks/create/templates/Constellation/field/{Picklist-RadioButtons/textformat-utils.jsx.mustache → Picklist-Autocomplete/textformat-utils.tsx.mustache} +30 -10
  55. package/src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/utils.ts.mustache +1 -1
  56. package/src/tasks/create/templates/Constellation/field/Picklist-RadioButtons/demo.stories.tsx.mustache +25 -13
  57. package/src/tasks/create/templates/Constellation/field/Picklist-RadioButtons/index.tsx.mustache +11 -58
  58. package/src/tasks/create/templates/Constellation/field/Picklist-RadioButtons/mock.ts.mustache +9 -1
  59. package/src/tasks/create/templates/Constellation/field/Picklist-RadioButtons/styles.ts.mustache +7 -14
  60. package/src/tasks/create/templates/Constellation/field/{Picklist-Autocomplete/textformat-utils.jsx.mustache → Picklist-RadioButtons/textformat-utils.tsx.mustache} +1 -0
  61. package/src/tasks/create/templates/Constellation/field/Text/demo.stories.tsx.mustache +23 -9
  62. package/src/tasks/create/templates/Constellation/field/Text/index.tsx.mustache +4 -22
  63. package/src/tasks/create/templates/Constellation/field/Text/mock.ts.mustache +8 -1
  64. package/src/tasks/create/templates/Constellation/field/Text/styles.ts.mustache +7 -14
  65. package/src/tasks/create/templates/Constellation/field/Text-Email/demo.stories.tsx.mustache +24 -11
  66. package/src/tasks/create/templates/Constellation/field/Text-Email/index.tsx.mustache +10 -47
  67. package/src/tasks/create/templates/Constellation/field/Text-Email/mock.ts.mustache +8 -1
  68. package/src/tasks/create/templates/Constellation/field/Text-Email/styles.ts.mustache +7 -14
  69. package/src/tasks/create/templates/Constellation/field/Text-Input/StatusWork.tsx +3 -9
  70. package/src/tasks/create/templates/Constellation/field/Text-Input/demo.stories.tsx.mustache +24 -11
  71. package/src/tasks/create/templates/Constellation/field/Text-Input/index.tsx.mustache +11 -51
  72. package/src/tasks/create/templates/Constellation/field/Text-Input/mock.ts.mustache +9 -1
  73. package/src/tasks/create/templates/Constellation/field/Text-Input/styles.ts.mustache +7 -14
  74. package/src/tasks/create/templates/Constellation/field/Text-Paragraph/demo.stories.tsx.mustache +24 -11
  75. package/src/tasks/create/templates/Constellation/field/Text-Paragraph/index.tsx.mustache +13 -49
  76. package/src/tasks/create/templates/Constellation/field/Text-Paragraph/mock.ts.mustache +9 -1
  77. package/src/tasks/create/templates/Constellation/field/Text-Paragraph/styles.ts.mustache +7 -14
  78. package/src/tasks/create/templates/Constellation/field/Text-Phone/demo.stories.tsx.mustache +25 -11
  79. package/src/tasks/create/templates/Constellation/field/Text-Phone/index.tsx.mustache +14 -53
  80. package/src/tasks/create/templates/Constellation/field/Text-Phone/mock.ts.mustache +9 -1
  81. package/src/tasks/create/templates/Constellation/field/Text-Phone/styles.ts.mustache +7 -14
  82. package/src/tasks/create/templates/Constellation/field/Text-URL/demo.stories.tsx.mustache +24 -11
  83. package/src/tasks/create/templates/Constellation/field/Text-URL/index.tsx.mustache +15 -71
  84. package/src/tasks/create/templates/Constellation/field/Text-URL/mock.ts.mustache +9 -1
  85. package/src/tasks/create/templates/Constellation/field/Text-URL/styles.ts.mustache +7 -14
  86. package/src/tasks/create/templates/Constellation/field/Text-URL/{text-url.jsx.mustache → text-url.tsx.mustache} +4 -3
  87. package/src/tasks/create/templates/Constellation/field/TimeOfDay/demo.stories.tsx.mustache +28 -22
  88. package/src/tasks/create/templates/Constellation/field/TimeOfDay/index.tsx.mustache +17 -53
  89. package/src/tasks/create/templates/Constellation/field/TimeOfDay/mock.ts.mustache +2 -1
  90. package/src/tasks/create/templates/Constellation/field/TimeOfDay/styles.ts.mustache +7 -14
  91. package/{tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyDateTime/date-utils.js → src/tasks/create/templates/Constellation/field/TimeOfDay/time-of-day.ts.mustache} +24 -23
  92. package/src/tasks/create/templates/Constellation/template/DETAILS/StatusWork.tsx.mustache +17 -19
  93. package/src/tasks/create/templates/Constellation/template/DETAILS/demo.stories.tsx.mustache +19 -8
  94. package/src/tasks/create/templates/Constellation/template/DETAILS/index.tsx.mustache +4 -17
  95. package/src/tasks/create/templates/Constellation/template/DETAILS/styles.ts.mustache +7 -14
  96. package/src/tasks/create/templates/Constellation/template/DETAILS-region/StatusWork.tsx.mustache +17 -19
  97. package/src/tasks/create/templates/Constellation/template/DETAILS-region/demo.stories.tsx.mustache +17 -8
  98. package/src/tasks/create/templates/Constellation/template/DETAILS-region/index.tsx.mustache +5 -19
  99. package/src/tasks/create/templates/Constellation/template/DETAILS-region/styles.ts.mustache +7 -14
  100. package/src/tasks/create/templates/Constellation/template/DETAILS-region/{utils.js.mustache → utils.ts.mustache} +15 -13
  101. package/src/tasks/create/templates/Constellation/template/FORM/demo.stories.tsx.mustache +18 -8
  102. package/src/tasks/create/templates/Constellation/template/FORM/index.tsx.mustache +5 -13
  103. package/src/tasks/create/templates/Constellation/template/FORM/styles.ts.mustache +7 -14
  104. package/src/tasks/create/templates/Constellation/template/FORM-region/demo.stories.tsx.mustache +17 -7
  105. package/src/tasks/create/templates/Constellation/template/FORM-region/index.tsx.mustache +4 -10
  106. package/src/tasks/create/templates/Constellation/template/FORM-region/styles.ts.mustache +7 -14
  107. package/src/tasks/create/templates/Constellation/template/PAGE/demo.stories.tsx.mustache +14 -8
  108. package/src/tasks/create/templates/Constellation/template/PAGE/index.tsx.mustache +5 -16
  109. package/src/tasks/create/templates/Constellation/template/PAGE/styles.ts.mustache +7 -14
  110. package/{tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyPage/utils.js → src/tasks/create/templates/Constellation/template/PAGE/utils.ts.mustache} +28 -14
  111. package/src/tasks/create/templates/Constellation/widget/CASE/demo.stories.tsx.mustache +13 -7
  112. package/src/tasks/create/templates/Constellation/widget/CASE/index.tsx.mustache +3 -10
  113. package/src/tasks/create/templates/Constellation/widget/CASE/styles.ts.mustache +7 -14
  114. package/src/tasks/create/templates/Constellation/widget/PAGE/demo.stories.tsx.mustache +18 -13
  115. package/src/tasks/create/templates/Constellation/widget/PAGE/index.tsx.mustache +4 -18
  116. package/src/tasks/create/templates/Constellation/widget/PAGE/styles.ts.mustache +7 -14
  117. package/src/tasks/create/templates/Constellation/widget/PAGE-CASE/Avatar.tsx.mustache +3 -13
  118. package/src/tasks/create/templates/Constellation/widget/PAGE-CASE/Operator.tsx.mustache +5 -20
  119. package/src/tasks/create/templates/Constellation/widget/PAGE-CASE/demo.stories.tsx.mustache +15 -9
  120. package/src/tasks/create/templates/Constellation/widget/PAGE-CASE/index.tsx.mustache +24 -39
  121. package/src/tasks/create/templates/Constellation/widget/PAGE-CASE/styles.ts.mustache +7 -14
  122. package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/page-case.component.ts.mustache +7 -5
  123. package/src/tasks/create/templates/SDK-React/field/Boolean/index.tsx.mustache +104 -25
  124. package/src/tasks/create/templates/SDK-React/field/DateTime/demo.stories.tsx.mustache +8 -1
  125. package/src/tasks/create/templates/SDK-React/field/Decimal/config.json.mustache +155 -0
  126. package/src/tasks/create/templates/SDK-React/field/Decimal/index.tsx.mustache +15 -12
  127. package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/index.tsx.mustache +10 -16
  128. package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/demo.stories.tsx.mustache +20 -0
  129. package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/index.tsx.mustache +41 -36
  130. package/src/tasks/create/templates/SDK-React/template/DETAILS/demo.stories.tsx.mustache +10 -0
  131. package/src/tasks/create/templates/SDK-React/template/DETAILS-region/demo.stories.tsx.mustache +17 -3
  132. package/src/tasks/create/templates/SDK-React/widget/CASE/index.tsx.mustache +3 -3
  133. package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/demo.stories.tsx.mustache +7 -0
  134. package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/index.tsx.mustache +5 -3
  135. package/src/tasks/index.js +1 -0
  136. package/src/tasks/map/map.js +29 -8
  137. package/src/tasks/publish/index.js +3 -1
  138. package/src/tasks/publish-all/index.js +7 -5
  139. package/src/util.js +7 -0
  140. package/tests/assets/sdk-r/components/create/_components.md +6 -0
  141. package/tests/assets/sdk-r/components/create/custom-constellation/field/Pega_DXIL_MyTestText/demo.stories.tsx +23 -9
  142. package/tests/assets/sdk-r/components/create/custom-constellation/field/Pega_DXIL_MyTestText/index.tsx +4 -22
  143. package/tests/assets/sdk-r/components/create/custom-constellation/field/Pega_DXIL_MyTestText/mock.ts +8 -1
  144. package/tests/assets/sdk-r/components/create/custom-constellation/field/Pega_DXIL_MyTestText/styles.ts +7 -14
  145. package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +2 -2
  146. package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/FieldValueList/FieldValueList.tsx +10 -4
  147. package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/Operator/Operator.tsx +5 -3
  148. package/tests/assets/sdk-r/components/create/override-sdk/field/CancelAlert/CancelAlert.tsx +95 -78
  149. package/tests/assets/sdk-r/components/create/override-sdk/field/Checkbox/Checkbox.tsx +104 -24
  150. package/tests/assets/sdk-r/components/create/override-sdk/field/Currency/Currency.tsx +10 -16
  151. package/tests/assets/sdk-r/components/create/override-sdk/field/Decimal/Decimal.tsx +18 -13
  152. package/tests/assets/sdk-r/components/create/override-sdk/field/Group/Group.tsx +2 -0
  153. package/tests/assets/sdk-r/components/create/override-sdk/field/Multiselect/Multiselect.tsx +244 -0
  154. package/tests/assets/sdk-r/components/create/override-sdk/field/Multiselect/index.tsx +1 -0
  155. package/tests/assets/sdk-r/components/create/override-sdk/field/Multiselect/utils.ts +230 -0
  156. package/tests/assets/sdk-r/components/create/override-sdk/field/Percentage/Percentage.tsx +41 -36
  157. package/tests/assets/sdk-r/components/create/override-sdk/field/RichText/RichText.tsx +2 -2
  158. package/tests/assets/sdk-r/components/create/override-sdk/infra/Assignment/Assignment.tsx +21 -7
  159. package/tests/assets/sdk-r/components/create/override-sdk/infra/NavBar/NavBar.tsx +6 -4
  160. package/tests/assets/sdk-r/components/create/override-sdk/template/CaseSummary/CaseSummary.tsx +43 -1
  161. package/tests/assets/sdk-r/components/create/override-sdk/template/CaseView/CaseView.tsx +1 -1
  162. package/tests/assets/sdk-r/components/create/override-sdk/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +34 -1
  163. package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/ListView.tsx +8 -7
  164. package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/utils.ts +3 -1
  165. package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +32 -16
  166. package/tests/assets/sdk-r/components/create/override-sdk/template/WideNarrow/WideNarrow.tsx +1 -1
  167. package/tests/assets/sdk-r/components/create/override-sdk/template/WssNavBar/WssNavBar.tsx +4 -1
  168. package/tests/assets/sdk-r/components/create/override-sdk/widget/Attachment/Attachment.tsx +12 -2
  169. package/tests/assets/sdk-r/components/create/override-sdk/widget/QuickCreate/QuickCreate.tsx +52 -25
  170. package/tests/assets/sdk-r/components/createAll/_components.md +6 -0
  171. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyBoolean/Boolean.ts +35 -0
  172. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyBoolean/{demo.stories.jsx → demo.stories.tsx} +28 -20
  173. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyBoolean/index.tsx +11 -48
  174. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyBoolean/mock.ts +2 -1
  175. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyBoolean/styles.ts +7 -14
  176. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyCurrency/demo.stories.tsx +28 -15
  177. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyCurrency/index.tsx +24 -76
  178. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyCurrency/mock.ts +11 -1
  179. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyCurrency/styles.ts +7 -14
  180. package/{src/tasks/create/templates/Constellation/field/Date/DateFormatter.js.mustache → tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyDate/DateFormatter.ts} +6 -6
  181. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyDate/FormattedText.tsx +20 -0
  182. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyDate/{date.js → date.ts} +3 -2
  183. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyDate/demo.stories.tsx +31 -24
  184. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyDate/index.tsx +19 -60
  185. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyDate/mock.ts +2 -1
  186. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyDate/styles.ts +7 -14
  187. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyDateTime/{date-time.js → date-time.ts} +12 -12
  188. package/{src/tasks/create/templates/Constellation/field/TimeOfDay/time-of-day.js.mustache → tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyDateTime/date-utils.ts} +27 -26
  189. package/{src/tasks/create/templates/Constellation/field/DateTime/date.js.mustache → tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyDateTime/date.ts} +1 -0
  190. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyDateTime/demo.stories.tsx +32 -25
  191. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyDateTime/index.tsx +13 -60
  192. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyDateTime/mock.ts +3 -1
  193. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyDateTime/styles.ts +7 -14
  194. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyDecimal/demo.stories.tsx +25 -13
  195. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyDecimal/index.tsx +15 -68
  196. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyDecimal/mock.ts +9 -1
  197. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyDecimal/styles.ts +7 -14
  198. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyEmail/demo.stories.tsx +24 -11
  199. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyEmail/index.tsx +10 -47
  200. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyEmail/mock.ts +8 -1
  201. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyEmail/styles.ts +7 -14
  202. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyInteger/demo.stories.tsx +25 -12
  203. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyInteger/index.tsx +24 -88
  204. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyInteger/mock.ts +8 -2
  205. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyInteger/styles.ts +7 -14
  206. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyParagraph/demo.stories.tsx +24 -11
  207. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyParagraph/index.tsx +13 -49
  208. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyParagraph/mock.ts +9 -1
  209. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyParagraph/styles.ts +7 -14
  210. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyPercentage/demo.stories.tsx +25 -12
  211. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyPercentage/index.tsx +14 -55
  212. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyPercentage/mock.ts +9 -2
  213. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyPercentage/styles.ts +7 -14
  214. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyPhone/demo.stories.tsx +25 -11
  215. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyPhone/index.tsx +14 -53
  216. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyPhone/mock.ts +9 -1
  217. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyPhone/styles.ts +7 -14
  218. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyPicklist/demo.stories.tsx +25 -12
  219. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyPicklist/index.tsx +13 -61
  220. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyPicklist/mock.ts +9 -1
  221. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyPicklist/styles.ts +7 -14
  222. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyRadiobuttons/demo.stories.tsx +25 -13
  223. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyRadiobuttons/index.tsx +11 -58
  224. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyRadiobuttons/mock.ts +9 -1
  225. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyRadiobuttons/styles.ts +7 -14
  226. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/{Pega_DXIL_MySearchbox/textformat-utils.jsx → Pega_DXIL_MyRadiobuttons/textformat-utils.tsx} +1 -0
  227. package/{src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/date.js.mustache → tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/date.ts} +2 -1
  228. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/demo.stories.tsx +26 -14
  229. package/{src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/embed-utils.js.mustache → tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/embed-utils.ts} +2 -1
  230. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/index.tsx +15 -76
  231. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/mock.ts +8 -1
  232. package/{src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/picklist-utils.js.mustache → tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/picklist-utils.ts} +1 -0
  233. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/{repeat-constants.js → repeat-constants.ts} +1 -1
  234. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/{repeat-utils.js → repeat-utils.ts} +6 -12
  235. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/styles.ts +7 -14
  236. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/{Pega_DXIL_MyRadiobuttons/textformat-utils.jsx → Pega_DXIL_MySearchbox/textformat-utils.tsx} +30 -10
  237. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/utils.ts +1 -1
  238. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyText/demo.stories.tsx +23 -9
  239. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyText/index.tsx +4 -22
  240. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyText/mock.ts +8 -1
  241. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyText/styles.ts +7 -14
  242. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTextInput/StatusWork.tsx +3 -9
  243. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTextInput/demo.stories.tsx +24 -11
  244. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTextInput/index.tsx +11 -51
  245. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTextInput/mock.ts +9 -1
  246. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTextInput/styles.ts +7 -14
  247. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTimeOfDay/demo.stories.tsx +28 -22
  248. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTimeOfDay/index.tsx +17 -53
  249. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTimeOfDay/mock.ts +2 -1
  250. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTimeOfDay/styles.ts +7 -14
  251. package/{src/tasks/create/templates/Constellation/field/DateTime/date-utils.js.mustache → tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTimeOfDay/time-of-day.ts} +24 -23
  252. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyURL/demo.stories.tsx +24 -11
  253. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyURL/index.tsx +15 -71
  254. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyURL/mock.ts +9 -1
  255. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyURL/styles.ts +7 -14
  256. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyURL/{text-url.jsx → text-url.tsx} +4 -3
  257. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/StatusWork.tsx +17 -19
  258. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/demo.stories.tsx +19 -8
  259. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/index.tsx +4 -17
  260. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/styles.ts +7 -14
  261. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyForm/demo.stories.tsx +18 -8
  262. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyForm/index.tsx +5 -13
  263. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyForm/styles.ts +7 -14
  264. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyPage/demo.stories.tsx +14 -8
  265. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyPage/index.tsx +5 -16
  266. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyPage/styles.ts +7 -14
  267. package/{src/tasks/create/templates/Constellation/template/PAGE/utils.js.mustache → tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyPage/utils.ts} +28 -14
  268. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/StatusWork.tsx +17 -19
  269. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +17 -8
  270. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/index.tsx +5 -19
  271. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/styles.ts +7 -14
  272. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/{utils.js → utils.ts} +15 -13
  273. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +17 -7
  274. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnForm/index.tsx +4 -10
  275. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnForm/styles.ts +7 -14
  276. package/tests/assets/sdk-r/components/createAll/custom-constellation/widget/Pega_DXIL_MyCaseWidget/demo.stories.tsx +13 -7
  277. package/tests/assets/sdk-r/components/createAll/custom-constellation/widget/Pega_DXIL_MyCaseWidget/index.tsx +3 -10
  278. package/tests/assets/sdk-r/components/createAll/custom-constellation/widget/Pega_DXIL_MyCaseWidget/styles.ts +7 -14
  279. package/tests/assets/sdk-r/components/createAll/custom-constellation/widget/Pega_DXIL_MyPageCaseWidget/Avatar.tsx +3 -13
  280. package/tests/assets/sdk-r/components/createAll/custom-constellation/widget/Pega_DXIL_MyPageCaseWidget/Operator.tsx +5 -20
  281. package/tests/assets/sdk-r/components/createAll/custom-constellation/widget/Pega_DXIL_MyPageCaseWidget/demo.stories.tsx +15 -9
  282. package/tests/assets/sdk-r/components/createAll/custom-constellation/widget/Pega_DXIL_MyPageCaseWidget/index.tsx +24 -39
  283. package/tests/assets/sdk-r/components/createAll/custom-constellation/widget/Pega_DXIL_MyPageCaseWidget/styles.ts +7 -14
  284. package/tests/assets/sdk-r/components/createAll/custom-constellation/widget/Pega_DXIL_MyPageWidget/demo.stories.tsx +18 -13
  285. package/tests/assets/sdk-r/components/createAll/custom-constellation/widget/Pega_DXIL_MyPageWidget/index.tsx +4 -18
  286. package/tests/assets/sdk-r/components/createAll/custom-constellation/widget/Pega_DXIL_MyPageWidget/styles.ts +7 -14
  287. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyBoolean/index.tsx +104 -25
  288. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/index.tsx +10 -16
  289. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/demo.stories.tsx +8 -1
  290. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/config.json +155 -0
  291. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/index.tsx +15 -12
  292. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/demo.stories.tsx +20 -0
  293. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/index.tsx +41 -36
  294. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyDetails/demo.stories.tsx +10 -0
  295. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +17 -3
  296. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/index.tsx +3 -3
  297. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/demo.stories.tsx +7 -0
  298. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/index.tsx +5 -3
  299. package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +2 -2
  300. package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/FieldValueList/FieldValueList.tsx +10 -4
  301. package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/Operator/Operator.tsx +5 -3
  302. package/tests/assets/sdk-r/components/createAll/override-sdk/field/CancelAlert/CancelAlert.tsx +95 -78
  303. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Checkbox/Checkbox.tsx +104 -24
  304. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Currency/Currency.tsx +10 -16
  305. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Decimal/Decimal.tsx +18 -13
  306. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Group/Group.tsx +2 -0
  307. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Multiselect/Multiselect.tsx +244 -0
  308. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Multiselect/index.tsx +1 -0
  309. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Multiselect/utils.ts +230 -0
  310. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Percentage/Percentage.tsx +41 -36
  311. package/tests/assets/sdk-r/components/createAll/override-sdk/field/RichText/RichText.tsx +2 -2
  312. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/Assignment/Assignment.tsx +21 -7
  313. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/NavBar/NavBar.tsx +6 -4
  314. package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseSummary/CaseSummary.tsx +43 -1
  315. package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseView/CaseView.tsx +1 -1
  316. package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +34 -1
  317. package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/ListView.tsx +8 -7
  318. package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/utils.ts +3 -1
  319. package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +32 -16
  320. package/tests/assets/sdk-r/components/createAll/override-sdk/template/WideNarrow/WideNarrow.tsx +1 -1
  321. package/tests/assets/sdk-r/components/createAll/override-sdk/template/WssNavBar/WssNavBar.tsx +4 -1
  322. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/Attachment/Attachment.tsx +12 -2
  323. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/QuickCreate/QuickCreate.tsx +52 -25
  324. package/src/tasks/create/templates/Constellation/field/Boolean/Boolean.js.mustache +0 -38
  325. package/src/tasks/create/templates/Constellation/field/Boolean/demo.stories.jsx.mustache +0 -63
  326. package/src/tasks/create/templates/Constellation/field/Date/FormattedText.jsx.mustache +0 -41
  327. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyBoolean/Boolean.js +0 -38
  328. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyDate/FormattedText.jsx +0 -41
  329. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/PConnProps.d.ts +0 -46
  330. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/demo.stories.tsx +0 -54
  331. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/index.tsx +0 -73
  332. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/mock.ts +0 -15
  333. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/styles.ts +0 -15
  334. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/config.json +0 -83
  335. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/demo.stories.tsx +0 -59
  336. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/index.tsx +0 -101
  337. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/mock.ts +0 -16
  338. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/styles.js +0 -7
  339. /package/src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/{component-constants.js → component-constants.ts} +0 -0
  340. /package/src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/{format-constants.js.mustache → format-constants.ts.mustache} +0 -0
  341. /package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/{component-constants.js → component-constants.ts} +0 -0
  342. /package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/{format-constants.js → format-constants.ts} +0 -0
@@ -38,7 +38,9 @@ export default async options => {
38
38
  const rulesetVersion = options.params[6];
39
39
  const dBuild = options.params[7];
40
40
  devBuild = dBuild === 'Y' || dBuild === 'y' || dBuild === true || dBuild === 'true';
41
- doFetch = false;
41
+
42
+ // eslint-disable-next-line no-unneeded-ternary,no-nested-ternary
43
+ doFetch = options.params.length >= 9 ? (options.params[8] === 'noFetch' ? false : true) : true;
42
44
 
43
45
  content = { componentKey, rulesetName, rulesetVersion, devBuild };
44
46
  } else {
@@ -24,8 +24,9 @@ export function getCustomTasks(componentKey, category, sourceMap, devBuild, cont
24
24
  const sDevBuild = devBuild ? '(dev build)' : '';
25
25
  const sFramework = framework.split("-")[1];
26
26
 
27
- // don't fetch if testing
28
- const doFetch = options.params.length >= 7 ? false : true;
27
+ // eslint-disable no-unneeded-ternary,no-nested-ternary
28
+ const doFetch = options.params.length >= 8 ? options.params[7] !== 'noFetch' : true;
29
+
29
30
 
30
31
  return new Listr(
31
32
  [
@@ -112,8 +113,9 @@ export function getOverrideTasks(componentKey, category, sourceMap, devBuild, co
112
113
  const sDevBuild = devBuild ? '(dev build)' : '';
113
114
  const sFramework = framework.split("-")[1];
114
115
 
115
- // don't fetch if testing
116
- const doFetch = options.params.length >= 7 ? false : true;
116
+ // eslint-disable no-unneeded-ternary,no-nested-ternary
117
+ const doFetch = options.params.length >= 8 ? options.params[7] !== 'noFetch' : true;
118
+
117
119
 
118
120
  return new Listr(
119
121
  [
@@ -194,7 +196,7 @@ export default async options => {
194
196
 
195
197
  components = await getComponentsObj(false, category);
196
198
 
197
- // end if find no componets
199
+ // end if find no components
198
200
  if (components.length == 0) {
199
201
  console.log(chalk.redBright("No components to publish"));
200
202
  process.exit(1);
package/src/util.js CHANGED
@@ -443,6 +443,13 @@ export const getDirectoryFiles = async (directory) => {
443
443
  .map(dirent => dirent.name);
444
444
  }
445
445
 
446
+ export const getListOfDirectories = async (directory) => {
447
+ return fs
448
+ .readdirSync(directory, { withFileTypes: true })
449
+ .filter(dirent => dirent.isDirectory())
450
+ .map(dirent => dirent.name);
451
+ }
452
+
446
453
 
447
454
  export const getComponentsObj = async (showSeparator = false, category = CATEGORY_CUSTOM) => {
448
455
  const currentDirectory = process.cwd();
@@ -0,0 +1,6 @@
1
+ # The **components** directory
2
+
3
+ The **src/components** directory contains the code for the components you want to use with the **React SDK**.
4
+
5
+ When you run the **npm run create** or **npm run override** commands to create new components, the generated code that
6
+ you can use as a starting point for your component development will be placed in component-specific folders inside **src/components**.
@@ -2,27 +2,27 @@
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 { stateProps, configProps } from './mock';
8
8
 
9
9
  import PegaDxilMyTestText from './index';
10
10
 
11
- export default {
11
+ const meta: Meta<typeof PegaDxilMyTestText> = {
12
12
  title: 'PegaDxilMyTestText',
13
- decorators: [withKnobs],
14
- component: PegaDxilMyTestText
13
+ component: PegaDxilMyTestText,
14
+ excludeStories: /.*Data$/
15
15
  };
16
16
 
17
- export const BasePegaDxilMyTestText = () => {
17
+ export default meta;
18
+ type Story = StoryObj<typeof PegaDxilMyTestText>;
19
+
20
+ export const BasePegaDxilMyTestText: Story = args => {
18
21
 
19
22
  const [value, setValue] = useState(configProps.value);
20
23
 
21
24
  const props = {
22
25
  value,
23
- placeholder: configProps.placeholder,
24
- label: configProps.label,
25
- testId: configProps.testId,
26
26
  hasSuggestions: configProps.hasSuggestions,
27
27
 
28
28
  getPConnect: () => {
@@ -48,7 +48,21 @@ export const BasePegaDxilMyTestText = () => {
48
48
 
49
49
  return (
50
50
  <>
51
- <PegaDxilMyTestText {...props} />
51
+ <PegaDxilMyTestText {...props} {...args} />
52
52
  </>
53
53
  );
54
54
  };
55
+
56
+ BasePegaDxilMyTestText.args = {
57
+ label: configProps.label,
58
+ helperText: configProps.helperText,
59
+ placeholder: configProps.placeholder,
60
+ testId: configProps.testId,
61
+ readOnly: configProps.readOnly,
62
+ disabled: configProps.disabled,
63
+ required: configProps.required,
64
+ status: configProps.status,
65
+ hideLabel: configProps.hideLabel,
66
+ displayMode: configProps.displayMode,
67
+ validatemessage: configProps.validatemessage
68
+ };
@@ -1,5 +1,4 @@
1
- import PropTypes from 'prop-types';
2
- import { Input } from '@pega/cosmos-react-core';
1
+ import { Input, withConfiguration } from '@pega/cosmos-react-core';
3
2
 
4
3
  import type { PConnFieldProps } from './PConnProps';
5
4
 
@@ -21,8 +20,8 @@ interface StateProps {
21
20
 
22
21
  // props passed in combination of props from property panel (config.json) and run time props from Constellation
23
22
  // any default values in config.pros should be set in defaultProps at bottom of this file
24
- export default function PegaDxilMyTestText(props: PegaDxilMyTestTextProps) {
25
- const { getPConnect, value, placeholder, disabled, readOnly, required, label, hideLabel, testId } = props;
23
+ function PegaDxilMyTestText(props: PegaDxilMyTestTextProps) {
24
+ const { getPConnect, value, placeholder, disabled = false, readOnly = false, required = false, label, hideLabel = false, testId } = props;
26
25
 
27
26
  const pConn = getPConnect();
28
27
  const actions = pConn.getActionsApi();
@@ -52,22 +51,5 @@ export default function PegaDxilMyTestText(props: PegaDxilMyTestTextProps) {
52
51
  );
53
52
  };
54
53
 
55
- PegaDxilMyTestText.defaultProps = {
56
- value: '',
57
- placeholder: '',
58
- disabled: false,
59
- readOnly: false,
60
- required: false,
61
- testId: ''
62
- };
63
54
 
64
- PegaDxilMyTestText.propTypes = {
65
- label: PropTypes.string,
66
- value: PropTypes.string,
67
- placeholder: PropTypes.string,
68
- getPConnect: PropTypes.func.isRequired,
69
- disabled: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
70
- readOnly: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
71
- required: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
72
- testId: PropTypes.string
73
- };
55
+ export default withConfiguration(PegaDxilMyTestText);
@@ -6,7 +6,14 @@ export const configProps = {
6
6
  placeholder: 'Text Placeholder',
7
7
  helperText: 'Text Helper Text',
8
8
  testId: 'Text-12345678',
9
- hasSuggestions: false
9
+ hasSuggestions: false,
10
+ displayMode: '',
11
+ hideLabel: false,
12
+ readOnly: false,
13
+ required: false,
14
+ disabled: false,
15
+ status: '',
16
+ validatemessage: ''
10
17
  };
11
18
 
12
19
  export const stateProps = {
@@ -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
+ });
@@ -109,9 +109,9 @@ export default function CaseSummaryFields(props: CaseSummaryFieldsProps) {
109
109
  label={field.config.label}
110
110
  InputProps={{
111
111
  readOnly: true,
112
+ disableUnderline: true,
112
113
  inputProps: {
113
- style: { cursor: 'pointer' },
114
- disableUnderline: true
114
+ style: { cursor: 'pointer' }
115
115
  }
116
116
  }}
117
117
  />
@@ -9,6 +9,7 @@ interface FieldValueListProps {
9
9
  name?: string;
10
10
  value: any;
11
11
  variant?: string;
12
+ isHtml?: boolean;
12
13
  }
13
14
 
14
15
  const useStyles = makeStyles(theme => ({
@@ -45,7 +46,7 @@ function formatItemValue(value) {
45
46
  }
46
47
 
47
48
  export default function FieldValueList(props: FieldValueListProps) {
48
- const { name, value, variant = 'inline' } = props;
49
+ const { name, value, variant = 'inline', isHtml = false } = props;
49
50
  const classes = useStyles();
50
51
 
51
52
  function getGridItemLabel() {
@@ -63,9 +64,14 @@ export default function FieldValueList(props: FieldValueListProps) {
63
64
 
64
65
  return (
65
66
  <Grid item xs={variant === 'stacked' ? 12 : 6} className={variant === 'stacked' ? classes.noPaddingTop : ''}>
66
- <Typography variant={variant === 'stacked' ? 'h6' : 'body2'} component='span' className={classes.fieldValue}>
67
- {formattedValue}
68
- </Typography>
67
+ {isHtml ? (
68
+ // eslint-disable-next-line react/no-danger
69
+ <div dangerouslySetInnerHTML={{ __html: formattedValue }} />
70
+ ) : (
71
+ <Typography variant={variant === 'stacked' ? 'h6' : 'body2'} component='span' className={classes.fieldValue}>
72
+ {formattedValue}
73
+ </Typography>
74
+ )}
69
75
  </Grid>
70
76
  );
71
77
  }
@@ -19,6 +19,7 @@ interface OperatorProps extends PConnProps {
19
19
  updateDateTime: string;
20
20
  updateLabel: string;
21
21
  updateOperator: { userName: string; userId: string };
22
+ displayLabel?: any;
22
23
  }
23
24
 
24
25
  const useStyles = makeStyles(theme => ({
@@ -36,18 +37,19 @@ export default function Operator(props: OperatorProps) {
36
37
  // const componentName = "Operator";
37
38
  const classes = useStyles();
38
39
 
39
- const fieldLabel = props.label.toLowerCase();
40
+ const fieldLabel = props?.label?.toLowerCase();
41
+ const displayLabel = props?.displayLabel?.toLowerCase();
40
42
  let caseOpLabel = '---';
41
43
  let caseOpName = '---';
42
44
  let caseOpId = '';
43
45
  let caseTime = '';
44
46
 
45
- if (fieldLabel === 'create operator') {
47
+ if (fieldLabel === 'create operator' || displayLabel === 'create operator') {
46
48
  caseOpLabel = props.createLabel;
47
49
  caseOpName = props.createOperator.userName;
48
50
  caseTime = props.createDateTime;
49
51
  caseOpId = props.createOperator.userId;
50
- } else if (fieldLabel === 'update operator') {
52
+ } else if (fieldLabel === 'update operator' || displayLabel === 'update operator') {
51
53
  caseOpLabel = props.updateLabel;
52
54
  caseOpName = props.updateOperator.userName;
53
55
  caseTime = props.updateDateTime;
@@ -7,34 +7,85 @@ import './CancelAlert.css';
7
7
 
8
8
  interface CancelAlertProps extends PConnFieldProps {
9
9
  // If any, enter additional props that only exist on CancelAlert here
10
- pConn: any;
11
- updateAlertState: any;
10
+ heading: string;
11
+ content: string;
12
+ itemKey: string;
13
+ hideDelete: boolean;
14
+ isDataObject: boolean;
15
+ skipReleaseLockRequest: any;
16
+ dismiss: Function;
12
17
  }
13
18
 
14
19
  export default function CancelAlert(props: CancelAlertProps) {
15
- const { pConn, updateAlertState } = props;
16
- const [showSnackbar, setShowSnackbar] = useState(false);
17
- const [snackbarMessage, setSnackbarMessage] = useState('');
18
-
19
- const itemKey = pConn.getContextName();
20
- const caseInfo = pConn.getCaseInfo();
21
- const caseName = caseInfo.getName();
22
- const ID = caseInfo.getID();
20
+ const { heading, content, getPConnect, itemKey: containerItemID, hideDelete, isDataObject, skipReleaseLockRequest, dismiss } = props;
21
+ const actionsAPI = getPConnect().getActionsApi();
22
+ const containerManagerAPI = getPConnect().getContainerManager();
23
+ const isLocalAction = getPConnect().getValue(PCore.getConstants().CASE_INFO.IS_LOCAL_ACTION);
24
+ const isBulkAction = getPConnect()?.options?.isBulkAction;
23
25
  const localizedVal = PCore.getLocaleUtils().getLocaleValue;
26
+ const broadCastUtils: any = PCore.getCoexistenceManager().getBroadcastUtils();
27
+ const isReverseCoexistence = broadCastUtils.isReverseCoexistenceCaseLoaded();
24
28
  const localeCategory = 'ModalContainer';
29
+ const btnIds = {
30
+ SAVE_AND_CLOSE: 'saveAndClose',
31
+ CONTINUE_WORKING: 'continueWorking',
32
+ DELETE: 'delete'
33
+ };
25
34
 
26
- function showToast(message: string) {
27
- setSnackbarMessage(message);
28
- setShowSnackbar(true);
35
+ const [buttonsState, setButtonsState] = useState({
36
+ [btnIds.SAVE_AND_CLOSE]: false,
37
+ [btnIds.DELETE]: false
38
+ });
39
+
40
+ const [showSnackbar, setShowSnackbar] = useState(false);
41
+ const [snackbarMessage, setSnackbarMessage] = useState('');
42
+
43
+ function disableButton(id) {
44
+ setButtonsState(prevState => ({
45
+ ...prevState,
46
+ [id]: true
47
+ }));
29
48
  }
30
49
 
31
- const dismissCancelAlertOnly = () => {
32
- updateAlertState(true);
33
- };
50
+ function enableButton(id) {
51
+ setButtonsState(prevState => ({
52
+ ...prevState,
53
+ [id]: false
54
+ }));
55
+ }
34
56
 
35
- const dismissModal = () => {
36
- updateAlertState(false);
37
- };
57
+ function cancelHandler() {
58
+ if (isReverseCoexistence) {
59
+ dismiss(true);
60
+ // @ts-ignore - An argument for 'payload' was not provided.
61
+ PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.HANDLE_DISCARD);
62
+ } else if (!isDataObject && !isLocalAction && !isBulkAction) {
63
+ disableButton(btnIds.DELETE);
64
+ actionsAPI
65
+ .deleteCaseInCreateStage(containerItemID, hideDelete)
66
+ .then(() => {
67
+ // @ts-ignore - An argument for 'payload' was not provided.
68
+ PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL);
69
+ })
70
+ .catch(() => {
71
+ setSnackbarMessage(localizedVal('Delete failed.', localeCategory));
72
+ setShowSnackbar(true);
73
+ })
74
+ .finally(() => {
75
+ enableButton(btnIds.DELETE);
76
+ dismiss(true);
77
+ });
78
+ } else if (isLocalAction) {
79
+ dismiss(true);
80
+ actionsAPI.cancelAssignment(containerItemID);
81
+ } else if (isBulkAction) {
82
+ dismiss(true);
83
+ actionsAPI.cancelBulkAction(containerItemID);
84
+ } else {
85
+ dismiss(true);
86
+ containerManagerAPI.removeContainerItem({ containerItemID, skipReleaseLockRequest });
87
+ }
88
+ }
38
89
 
39
90
  function handleSnackbarClose(event: React.SyntheticEvent | React.MouseEvent, reason?: string) {
40
91
  if (reason === 'clickaway') {
@@ -43,75 +94,41 @@ export default function CancelAlert(props: CancelAlertProps) {
43
94
  setShowSnackbar(false);
44
95
  }
45
96
 
46
- const buttonClick = action => {
47
- const actionsAPI = pConn.getActionsApi();
48
-
49
- switch (action) {
50
- case 'save':
51
- // eslint-disable-next-line no-case-declarations
52
- const savePromise = actionsAPI.saveAndClose(itemKey);
53
-
54
- savePromise
55
- .then(() => {
56
- dismissModal();
57
-
58
- // @ts-ignore - second parameter “payload” for publish method should be optional
59
- PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CASE_CREATED);
60
- })
61
- .catch(() => {
62
- showToast(localizedVal('Save failed', localeCategory));
63
- });
64
- break;
65
-
66
- case 'continue':
67
- dismissCancelAlertOnly();
68
- break;
69
-
70
- case 'delete':
71
- // eslint-disable-next-line no-case-declarations
72
- const deletePromise = actionsAPI.deleteCaseInCreateStage(itemKey);
73
-
74
- deletePromise
75
- .then(() => {
76
- dismissModal();
77
-
78
- // @ts-ignore - second parameter “payload” for publish method should be optional
79
- PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL);
80
- })
81
- .catch(() => {
82
- showToast(localizedVal('Delete failed.', localeCategory));
83
- });
84
- break;
97
+ const leftButton = (
98
+ <Button
99
+ name={btnIds.CONTINUE_WORKING}
100
+ variant='contained'
101
+ color='secondary'
102
+ onClick={() => {
103
+ dismiss();
104
+ if (isReverseCoexistence) {
105
+ broadCastUtils.setCallBackFunction(null);
106
+ broadCastUtils.setIsDirtyDialogActive(false);
107
+ }
108
+ }}
109
+ >
110
+ {localizedVal('Go back', localeCategory)}
111
+ </Button>
112
+ );
85
113
 
86
- default:
87
- break;
88
- }
89
- };
114
+ const rightButton = (
115
+ <Button name={btnIds.DELETE} variant='contained' color='primary' disabled={buttonsState[btnIds.DELETE]} onClick={cancelHandler}>
116
+ {localizedVal('Discard', localeCategory)}
117
+ </Button>
118
+ );
90
119
 
91
120
  return (
92
121
  <>
93
122
  <div className='cancel-alert-background'>
94
123
  <div className='cancel-alert-top'>
95
- <h3>{`Delete ${caseName}(${ID})`}</h3>
124
+ <h3>{localizedVal(heading, localeCategory)}</h3>
96
125
  <div>
97
- <p>{`${localizedVal('Are you sure you want to delete', localeCategory)} ${caseName} (${ID})?`}</p>
98
- <p>{localizedVal('Alternatively, you can continue working or save your work for later.', localeCategory)}</p>
126
+ <p>{localizedVal(content, localeCategory)}</p>
99
127
  </div>
100
128
  <div className='action-controls'>
101
129
  <Grid container spacing={4} justifyContent='space-between'>
102
- <Grid item>
103
- <Button variant='outlined' color='primary' onClick={() => buttonClick('save')}>
104
- {localizedVal('Save for later', localeCategory)}
105
- </Button>
106
- </Grid>
107
- <Grid item>
108
- <Button variant='outlined' color='primary' onClick={() => buttonClick('continue')}>
109
- {localizedVal('Continue Working', localeCategory)}
110
- </Button>
111
- <Button variant='contained' color='primary' onClick={() => buttonClick('delete')}>
112
- {localizedVal('Delete', localeCategory)}
113
- </Button>
114
- </Grid>
130
+ <Grid item>{leftButton}</Grid>
131
+ <Grid item>{rightButton}</Grid>
115
132
  </Grid>
116
133
  </div>
117
134
  </div>