@pega/dx-component-builder-sdk 0.1.46 → 0.1.48

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 (263) hide show
  1. package/package.json +3 -2
  2. package/src/auth.js +3 -3
  3. package/src/cli.js +1 -1
  4. package/src/constants.js +728 -2
  5. package/src/tasks/authenticate/index.js +1 -1
  6. package/src/tasks/build/helper.js +10 -6
  7. package/src/tasks/build/index.js +76 -22
  8. package/src/tasks/build-all/helper.js +16 -11
  9. package/src/tasks/build-all/index.js +108 -44
  10. package/src/tasks/bundle/{builder → builderAngular}/paths.js +2 -2
  11. package/src/tasks/bundle/builderAngular/webpack.config.js +342 -0
  12. package/src/tasks/bundle/builderReact/index.js +218 -0
  13. package/src/tasks/bundle/builderReact/modules.js +139 -0
  14. package/src/tasks/bundle/builderReact/paths.js +50 -0
  15. package/src/tasks/bundle/{builder → builderReact}/webpack.config.js +5 -4
  16. package/src/tasks/bundle/index.js +64 -5
  17. package/src/tasks/create/index.js +54 -12
  18. package/src/tasks/create/templates/Constellation/field/Boolean/styles.js.mustache +13 -6
  19. package/src/tasks/create/templates/Constellation/field/Date/DateFormatter.js.mustache +7 -7
  20. package/src/tasks/create/templates/Constellation/field/Date/date.js.mustache +8 -8
  21. package/src/tasks/create/templates/Constellation/field/Date/styles.js.mustache +13 -6
  22. package/src/tasks/create/templates/Constellation/field/DateTime/date-time.js.mustache +10 -10
  23. package/src/tasks/create/templates/Constellation/field/DateTime/date-utils.js.mustache +6 -5
  24. package/src/tasks/create/templates/Constellation/field/DateTime/date.js.mustache +6 -3
  25. package/src/tasks/create/templates/Constellation/field/DateTime/styles.js.mustache +13 -6
  26. package/src/tasks/create/templates/Constellation/field/Decimal/index.jsx.mustache +2 -2
  27. package/src/tasks/create/templates/Constellation/field/Decimal/styles.js.mustache +13 -6
  28. package/src/tasks/create/templates/Constellation/field/Decimal-Currency/index.jsx.mustache +2 -2
  29. package/src/tasks/create/templates/Constellation/field/Decimal-Currency/styles.js.mustache +13 -6
  30. package/src/tasks/create/templates/Constellation/field/Decimal-Percentage/index.jsx.mustache +4 -4
  31. package/src/tasks/create/templates/Constellation/field/Decimal-Percentage/styles.js.mustache +13 -6
  32. package/src/tasks/create/templates/Constellation/field/Integer/index.jsx.mustache +2 -2
  33. package/src/tasks/create/templates/Constellation/field/Integer/styles.js.mustache +13 -6
  34. package/src/tasks/create/templates/Constellation/field/Picklist/styles.js.mustache +13 -6
  35. package/src/tasks/create/templates/Constellation/field/Text/styles.js.mustache +13 -6
  36. package/src/tasks/create/templates/Constellation/field/Text-Email/styles.js.mustache +13 -6
  37. package/src/tasks/create/templates/Constellation/field/Text-Input/styles.js.mustache +13 -6
  38. package/src/tasks/create/templates/Constellation/field/Text-Paragraph/styles.js.mustache +13 -6
  39. package/src/tasks/create/templates/Constellation/field/Text-Phone/index.jsx.mustache +0 -1
  40. package/src/tasks/create/templates/Constellation/field/Text-Phone/styles.js.mustache +13 -6
  41. package/src/tasks/create/templates/Constellation/field/Text-URL/styles.js.mustache +13 -6
  42. package/src/tasks/create/templates/Constellation/field/TimeOfDay/styles.js.mustache +14 -0
  43. package/src/tasks/create/templates/Constellation/field/{TimeofDay → TimeOfDay}/time-of-day.js.mustache +6 -5
  44. package/src/tasks/create/templates/Constellation/template/DETAILS/demo.stories.jsx.mustache +20 -6
  45. package/src/tasks/create/templates/Constellation/template/DETAILS/index.jsx.mustache +2 -2
  46. package/src/tasks/create/templates/Constellation/template/DETAILS/mock.stories.js.mustache +20 -10
  47. package/src/tasks/create/templates/Constellation/template/DETAILS/styles.js.mustache +13 -6
  48. package/src/tasks/create/templates/Constellation/template/DETAILS-region/demo.stories.jsx.mustache +20 -7
  49. package/src/tasks/create/templates/Constellation/template/DETAILS-region/index.jsx.mustache +2 -2
  50. package/src/tasks/create/templates/Constellation/template/DETAILS-region/mock.stories.js.mustache +28 -13
  51. package/src/tasks/create/templates/Constellation/template/DETAILS-region/styles.js.mustache +13 -6
  52. package/src/tasks/create/templates/Constellation/template/FORM/demo.stories.jsx.mustache +92 -16
  53. package/src/tasks/create/templates/Constellation/template/FORM/index.jsx.mustache +2 -2
  54. package/src/tasks/create/templates/Constellation/template/FORM/mock.stories.js.mustache +24 -12
  55. package/src/tasks/create/templates/Constellation/template/FORM/styles.js.mustache +13 -6
  56. package/src/tasks/create/templates/Constellation/template/FORM-region/demo.stories.jsx.mustache +91 -13
  57. package/src/tasks/create/templates/Constellation/template/FORM-region/index.jsx.mustache +2 -2
  58. package/src/tasks/create/templates/Constellation/template/FORM-region/mock.stories.js.mustache +24 -12
  59. package/src/tasks/create/templates/Constellation/template/FORM-region/styles.js.mustache +13 -6
  60. package/src/tasks/create/templates/Constellation/template/PAGE/demo.stories.jsx.mustache +1 -0
  61. package/src/tasks/create/templates/Constellation/template/PAGE/styles.js.mustache +13 -6
  62. package/src/tasks/create/templates/Constellation/widget/CASE/index.jsx.mustache +2 -2
  63. package/src/tasks/create/templates/Constellation/widget/CASE/styles.js.mustache +13 -6
  64. package/src/tasks/create/templates/Constellation/widget/PAGE/styles.js.mustache +13 -6
  65. package/src/tasks/create/templates/Constellation/widget/PAGE-CASE/Operator.jsx.mustache +2 -2
  66. package/src/tasks/create/templates/Constellation/widget/PAGE-CASE/index.jsx.mustache +2 -2
  67. package/src/tasks/create/templates/Constellation/widget/PAGE-CASE/styles.js.mustache +13 -6
  68. package/src/tasks/create/templates/SDK-Angular/field/Boolean/boolean.component.html.mustache +42 -0
  69. package/src/tasks/create/templates/SDK-Angular/field/Boolean/boolean.component.scss.mustache +24 -0
  70. package/src/tasks/create/templates/SDK-Angular/field/Boolean/boolean.component.spec.ts.mustache +25 -0
  71. package/src/tasks/create/templates/SDK-Angular/field/Boolean/boolean.component.ts.mustache +165 -0
  72. package/src/tasks/create/templates/SDK-Angular/field/Boolean/config.json.mustache +87 -0
  73. package/src/tasks/create/templates/SDK-Angular/field/Boolean/demo.stories.jsx.mustache +56 -0
  74. package/src/tasks/create/templates/SDK-Angular/field/Boolean/mock.stories.js.mustache +15 -0
  75. package/src/tasks/create/templates/SDK-Angular/field/Date/config.json.mustache +147 -0
  76. package/src/tasks/create/templates/SDK-Angular/field/Date/date.component.html.mustache +35 -0
  77. package/src/tasks/create/templates/SDK-Angular/field/Date/date.component.scss.mustache +20 -0
  78. package/src/tasks/create/templates/SDK-Angular/field/Date/date.component.spec.ts.mustache +25 -0
  79. package/src/tasks/create/templates/SDK-Angular/field/Date/date.component.ts.mustache +209 -0
  80. package/src/tasks/create/templates/SDK-Angular/field/DateTime/config.json.mustache +204 -0
  81. package/src/tasks/create/templates/SDK-Angular/field/DateTime/date-time.component.html.mustache +31 -0
  82. package/src/tasks/create/templates/SDK-Angular/field/DateTime/date-time.component.scss.mustache +20 -0
  83. package/src/tasks/create/templates/SDK-Angular/field/DateTime/date-time.component.spec.ts.mustache +25 -0
  84. package/src/tasks/create/templates/SDK-Angular/field/DateTime/date-time.component.ts.mustache +177 -0
  85. package/src/tasks/create/templates/SDK-Angular/field/Decimal/config.json.mustache +94 -0
  86. package/src/tasks/create/templates/SDK-Angular/field/Decimal/decimal.component.html.mustache +32 -0
  87. package/src/tasks/create/templates/SDK-Angular/field/Decimal/decimal.component.scss.mustache +20 -0
  88. package/src/tasks/create/templates/SDK-Angular/field/Decimal/decimal.component.spec.ts.mustache +25 -0
  89. package/src/tasks/create/templates/SDK-Angular/field/Decimal/decimal.component.ts.mustache +170 -0
  90. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/config.json.mustache +125 -0
  91. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/decimal-currency.component.html.mustache +33 -0
  92. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/decimal-currency.component.scss.mustache +20 -0
  93. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/decimal-currency.component.spec.ts.mustache +25 -0
  94. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/decimal-currency.component.ts.mustache +175 -0
  95. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/config.json.mustache +94 -0
  96. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/decimal-percentage.component.html.mustache +33 -0
  97. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/decimal-percentage.component.scss.mustache +20 -0
  98. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/decimal-percentage.component.spec.ts.mustache +25 -0
  99. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/decimal-percentage.component.ts.mustache +176 -0
  100. package/src/tasks/create/templates/SDK-Angular/field/Integer/config.json.mustache +88 -0
  101. package/src/tasks/create/templates/SDK-Angular/field/Integer/integer.component.html.mustache +33 -0
  102. package/src/tasks/create/templates/SDK-Angular/field/Integer/integer.component.scss.mustache +20 -0
  103. package/src/tasks/create/templates/SDK-Angular/field/Integer/integer.component.spec.ts.mustache +25 -0
  104. package/src/tasks/create/templates/SDK-Angular/field/Integer/integer.component.ts.mustache +180 -0
  105. package/src/tasks/create/templates/SDK-Angular/field/Picklist/config.json.mustache +86 -0
  106. package/src/tasks/create/templates/SDK-Angular/field/Picklist/picklist.component.html.mustache +30 -0
  107. package/src/tasks/create/templates/SDK-Angular/field/Picklist/picklist.component.scss.mustache +25 -0
  108. package/src/tasks/create/templates/SDK-Angular/field/Picklist/picklist.component.spec.ts.mustache +25 -0
  109. package/src/tasks/create/templates/SDK-Angular/field/Picklist/picklist.component.ts.mustache +195 -0
  110. package/src/tasks/create/templates/SDK-Angular/field/Text/config.json.mustache +83 -0
  111. package/src/tasks/create/templates/SDK-Angular/field/Text/text.component.html.mustache +17 -0
  112. package/src/tasks/create/templates/SDK-Angular/field/Text/text.component.scss.mustache +30 -0
  113. package/src/tasks/create/templates/SDK-Angular/field/Text/text.component.spec.ts.mustache +25 -0
  114. package/src/tasks/create/templates/SDK-Angular/field/Text/text.component.ts.mustache +145 -0
  115. package/src/tasks/create/templates/SDK-Angular/field/Text-Email/config.json.mustache +83 -0
  116. package/src/tasks/create/templates/SDK-Angular/field/Text-Email/text-email.component.html.mustache +31 -0
  117. package/src/tasks/create/templates/SDK-Angular/field/Text-Email/text-email.component.scss.mustache +20 -0
  118. package/src/tasks/create/templates/SDK-Angular/field/Text-Email/text-email.component.spec.ts.mustache +25 -0
  119. package/src/tasks/create/templates/SDK-Angular/field/Text-Email/text-email.component.ts.mustache +175 -0
  120. package/src/tasks/create/templates/SDK-Angular/field/Text-Input/config.json.mustache +83 -0
  121. package/src/tasks/create/templates/SDK-Angular/field/Text-Input/text.component.html.mustache +31 -0
  122. package/src/tasks/create/templates/SDK-Angular/field/Text-Input/text.component.scss.mustache +20 -0
  123. package/src/tasks/create/templates/SDK-Angular/field/Text-Input/text.component.spec.ts.mustache +25 -0
  124. package/src/tasks/create/templates/SDK-Angular/field/Text-Input/text.component.ts.mustache +177 -0
  125. package/src/tasks/create/templates/SDK-Angular/field/Text-Paragraph/config.json.mustache +83 -0
  126. package/src/tasks/create/templates/SDK-Angular/field/Text-Paragraph/text-paragraph.component.html.mustache +31 -0
  127. package/src/tasks/create/templates/SDK-Angular/field/Text-Paragraph/text-paragraph.component.scss.mustache +20 -0
  128. package/src/tasks/create/templates/SDK-Angular/field/Text-Paragraph/text-paragraph.component.spec.ts.mustache +25 -0
  129. package/src/tasks/create/templates/SDK-Angular/field/Text-Paragraph/text-paragraph.component.ts.mustache +179 -0
  130. package/src/tasks/create/templates/SDK-Angular/field/Text-Phone/config.json.mustache +95 -0
  131. package/src/tasks/create/templates/SDK-Angular/field/Text-Phone/text-phone.component.html.mustache +30 -0
  132. package/src/tasks/create/templates/SDK-Angular/field/Text-Phone/text-phone.component.scss.mustache +81 -0
  133. package/src/tasks/create/templates/SDK-Angular/field/Text-Phone/text-phone.component.spec.ts.mustache +25 -0
  134. package/src/tasks/create/templates/SDK-Angular/field/Text-Phone/text-phone.component.ts.mustache +194 -0
  135. package/src/tasks/create/templates/SDK-Angular/field/Text-URL/config.json.mustache +111 -0
  136. package/src/tasks/create/templates/SDK-Angular/field/Text-URL/text-url.component.html.mustache +30 -0
  137. package/src/tasks/create/templates/SDK-Angular/field/Text-URL/text-url.component.scss.mustache +20 -0
  138. package/src/tasks/create/templates/SDK-Angular/field/Text-URL/text-url.component.spec.ts.mustache +26 -0
  139. package/src/tasks/create/templates/SDK-Angular/field/Text-URL/text-url.component.ts.mustache +174 -0
  140. package/src/tasks/create/templates/SDK-Angular/field/TimeOfDay/time-of-day.component.html.mustache +30 -0
  141. package/src/tasks/create/templates/SDK-Angular/field/TimeOfDay/time-of-day.component.scss.mustache +20 -0
  142. package/src/tasks/create/templates/SDK-Angular/field/TimeOfDay/time-of-day.component.spec.ts.mustache +25 -0
  143. package/src/tasks/create/templates/SDK-Angular/field/TimeOfDay/time-of-day.component.ts.mustache +172 -0
  144. package/src/tasks/create/templates/SDK-Angular/template/DETAILS/DefaultForm.svg +29 -0
  145. package/src/tasks/create/templates/SDK-Angular/template/DETAILS/config.json.mustache +21 -0
  146. package/src/tasks/create/templates/SDK-Angular/template/DETAILS/demo.stories.jsx.mustache +71 -0
  147. package/src/tasks/create/templates/SDK-Angular/template/DETAILS/details.component.html.mustache +7 -0
  148. package/src/tasks/create/templates/SDK-Angular/template/DETAILS/details.component.scss.mustache +7 -0
  149. package/src/tasks/create/templates/SDK-Angular/template/DETAILS/details.component.spec.ts.mustache +25 -0
  150. package/src/tasks/create/templates/SDK-Angular/template/DETAILS/details.component.ts.mustache +121 -0
  151. package/src/tasks/create/templates/SDK-Angular/template/DETAILS/mock.stories.js.mustache +294 -0
  152. package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/TwoColumnDetails.svg +28 -0
  153. package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/config.json.mustache +27 -0
  154. package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/demo.stories.jsx.mustache +73 -0
  155. package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/details.component.html.mustache +6 -0
  156. package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/details.component.scss.mustache +7 -0
  157. package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/details.component.spec.ts.mustache +25 -0
  158. package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/details.component.ts.mustache +92 -0
  159. package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/mock.stories.js.mustache +290 -0
  160. package/src/tasks/create/templates/SDK-Angular/template/FORM/DefaultForm.svg +29 -0
  161. package/src/tasks/create/templates/SDK-Angular/template/FORM/config.json.mustache +45 -0
  162. package/src/tasks/create/templates/SDK-Angular/template/FORM/demo.stories.jsx.mustache +215 -0
  163. package/src/tasks/create/templates/SDK-Angular/template/FORM/form.component.html.mustache +23 -0
  164. package/src/tasks/create/templates/SDK-Angular/template/FORM/form.component.scss.mustache +33 -0
  165. package/src/tasks/create/templates/SDK-Angular/template/FORM/form.component.spec.ts.mustache +25 -0
  166. package/src/tasks/create/templates/SDK-Angular/template/FORM/form.component.ts.mustache +71 -0
  167. package/src/tasks/create/templates/SDK-Angular/template/FORM-region/TwoColumn.svg +38 -0
  168. package/src/tasks/create/templates/SDK-Angular/template/FORM-region/config.json.mustache +49 -0
  169. package/src/tasks/create/templates/SDK-Angular/template/FORM-region/demo.stories.jsx.mustache +183 -0
  170. package/src/tasks/create/templates/SDK-Angular/template/FORM-region/form.component.html.mustache +16 -0
  171. package/src/tasks/create/templates/SDK-Angular/template/FORM-region/form.component.scss.mustache +28 -0
  172. package/src/tasks/create/templates/SDK-Angular/template/FORM-region/form.component.spec.ts.mustache +25 -0
  173. package/src/tasks/create/templates/SDK-Angular/template/FORM-region/form.component.ts.mustache +26 -0
  174. package/src/tasks/create/templates/SDK-Angular/template/FORM-region/mock.stories.js.mustache +132 -0
  175. package/src/tasks/create/templates/SDK-Angular/template/PAGE/OneColumnPage.svg +28 -0
  176. package/src/tasks/create/templates/SDK-Angular/template/PAGE/config.json.mustache +32 -0
  177. package/src/tasks/create/templates/SDK-Angular/template/PAGE/demo.stories.jsx.mustache +80 -0
  178. package/src/tasks/create/templates/SDK-Angular/template/PAGE/mock.stories.js.mustache +115 -0
  179. package/src/tasks/create/templates/SDK-Angular/template/PAGE/page.component.html.mustache +15 -0
  180. package/src/tasks/create/templates/SDK-Angular/template/PAGE/page.component.scss.mustache +3 -0
  181. package/src/tasks/create/templates/SDK-Angular/template/PAGE/page.component.spec.ts.mustache +25 -0
  182. package/src/tasks/create/templates/SDK-Angular/template/PAGE/page.component.ts.mustache +63 -0
  183. package/src/tasks/create/templates/SDK-Angular/widget/CASE/OneColumnPage.svg +36 -0
  184. package/src/tasks/create/templates/SDK-Angular/widget/CASE/case.component.html.mustache +15 -0
  185. package/src/tasks/create/templates/SDK-Angular/widget/CASE/case.component.scss.mustache +22 -0
  186. package/src/tasks/create/templates/SDK-Angular/widget/CASE/case.component.spec.ts.mustache +25 -0
  187. package/src/tasks/create/templates/SDK-Angular/widget/CASE/case.component.ts.mustache +111 -0
  188. package/src/tasks/create/templates/SDK-Angular/widget/CASE/config.json.mustache +23 -0
  189. package/src/tasks/create/templates/SDK-Angular/widget/CASE/demo.stories.jsx.mustache +70 -0
  190. package/src/tasks/create/templates/SDK-Angular/widget/CASE/mock.stories.js.mustache +390 -0
  191. package/src/tasks/create/templates/SDK-Angular/widget/PAGE/OneColumnPage.svg +36 -0
  192. package/src/tasks/create/templates/SDK-Angular/widget/PAGE/config.json.mustache +59 -0
  193. package/src/tasks/create/templates/SDK-Angular/widget/PAGE/demo.stories.jsx.mustache +29 -0
  194. package/src/tasks/create/templates/SDK-Angular/widget/PAGE/mock.stories.js.mustache +23 -0
  195. package/src/tasks/create/templates/SDK-Angular/widget/PAGE/page.component.html.mustache +17 -0
  196. package/src/tasks/create/templates/SDK-Angular/widget/PAGE/page.component.scss.mustache +19 -0
  197. package/src/tasks/create/templates/SDK-Angular/widget/PAGE/page.component.ts.mustache +32 -0
  198. package/src/tasks/create/templates/SDK-Angular/widget/PAGE/pagecomponent.spec.ts.mustache +25 -0
  199. package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/OneColumnPage.svg +36 -0
  200. package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/config.json.mustache +66 -0
  201. package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/demo.stories.jsx.mustache +52 -0
  202. package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/mock.stories.js.mustache +52 -0
  203. package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/page-case.component.html.mustache +28 -0
  204. package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/page-case.component.scss.mustache +137 -0
  205. package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/page-case.component.spec.ts.mustache +25 -0
  206. package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/page-case.component.ts.mustache +115 -0
  207. package/src/tasks/create/templates/SDK-React/field/Boolean/index.tsx.mustache +3 -3
  208. package/src/tasks/create/templates/SDK-React/field/Date/index.tsx.mustache +2 -2
  209. package/src/tasks/create/templates/SDK-React/field/DateTime/index.tsx.mustache +6 -7
  210. package/src/tasks/create/templates/SDK-React/field/Decimal/demo.stories.jsx.mustache +5 -1
  211. package/src/tasks/create/templates/SDK-React/field/Decimal/index.tsx.mustache +78 -28
  212. package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/index.tsx.mustache +3 -3
  213. package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/index.tsx.mustache +2 -2
  214. package/src/tasks/create/templates/SDK-React/field/Integer/index.tsx.mustache +2 -2
  215. package/src/tasks/create/templates/SDK-React/field/Picklist/demo.stories.jsx.mustache +13 -0
  216. package/src/tasks/create/templates/SDK-React/field/Picklist/index.tsx.mustache +30 -10
  217. package/src/tasks/create/templates/SDK-React/field/Text/index.tsx.mustache +2 -2
  218. package/src/tasks/create/templates/SDK-React/field/Text-Email/index.tsx.mustache +2 -2
  219. package/src/tasks/create/templates/SDK-React/field/Text-Input/index.tsx.mustache +2 -2
  220. package/src/tasks/create/templates/SDK-React/field/Text-Paragraph/index.tsx.mustache +2 -2
  221. package/src/tasks/create/templates/SDK-React/field/Text-Phone/index.tsx.mustache +6 -5
  222. package/src/tasks/create/templates/SDK-React/field/Text-URL/index.tsx.mustache +11 -0
  223. package/src/tasks/create/templates/SDK-React/field/TimeOfDay/config.json.mustache +135 -0
  224. package/src/tasks/create/templates/SDK-React/field/{TimeofDay → TimeOfDay}/index.tsx.mustache +12 -1
  225. package/src/tasks/create/templates/SDK-React/template/DETAILS/index.tsx.mustache +7 -3
  226. package/src/tasks/create/templates/SDK-React/template/DETAILS-region/index.tsx.mustache +8 -4
  227. package/src/tasks/create/templates/SDK-React/template/FORM/index.tsx.mustache +30 -20
  228. package/src/tasks/create/templates/SDK-React/template/FORM-region/demo.stories.jsx.mustache +2 -2
  229. package/src/tasks/create/templates/SDK-React/template/PAGE/demo.stories.jsx.mustache +1 -0
  230. package/src/tasks/create/templates/SDK-React/widget/CASE/index.tsx.mustache +4 -3
  231. package/src/tasks/create/templates/SDK-React/widget/PAGE/index.tsx.mustache +7 -7
  232. package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/demo.stories.jsx.mustache +2 -10
  233. package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/index.tsx.mustache +138 -36
  234. package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/mock.stories.js.mustache +1 -1
  235. package/src/tasks/create-all/index.js +114 -58
  236. package/src/tasks/delete/helper.js +88 -24
  237. package/src/tasks/delete/index.js +17 -8
  238. package/src/tasks/delete-all/helper.js +88 -25
  239. package/src/tasks/delete-all/index.js +15 -6
  240. package/src/tasks/list/index.js +14 -7
  241. package/src/tasks/map/map.js +212 -20
  242. package/src/tasks/map-all/index.js +19 -2
  243. package/src/tasks/override/index.js +137 -76
  244. package/src/tasks/override-all/index.js +54 -6
  245. package/src/tasks/publish/helper.js +93 -50
  246. package/src/tasks/publish/index.js +87 -34
  247. package/src/tasks/publish-all/helper.js +96 -57
  248. package/src/tasks/publish-all/index.js +123 -47
  249. package/src/tasks/rename/index.js +184 -111
  250. package/src/tasks/validator/index.js +31 -7
  251. package/src/util.js +173 -20
  252. package/src/tasks/create/templates/Constellation/field/TimeofDay/styles.js.mustache +0 -7
  253. /package/src/tasks/bundle/{builder → builderAngular}/index.js +0 -0
  254. /package/src/tasks/bundle/{builder → builderAngular}/modules.js +0 -0
  255. /package/src/tasks/create/templates/Constellation/field/{TimeofDay → TimeOfDay}/config.json.mustache +0 -0
  256. /package/src/tasks/create/templates/Constellation/field/{TimeofDay → TimeOfDay}/demo.stories.jsx.mustache +0 -0
  257. /package/src/tasks/create/templates/Constellation/field/{TimeofDay → TimeOfDay}/index.jsx.mustache +0 -0
  258. /package/src/tasks/create/templates/Constellation/field/{TimeofDay → TimeOfDay}/mock.stories.js.mustache +0 -0
  259. /package/src/tasks/create/templates/Constellation/field/{TimeofDay → TimeOfDay}/suggestions-handler.js +0 -0
  260. /package/src/tasks/create/templates/{SDK-React/field/TimeofDay → SDK-Angular/field/TimeOfDay}/config.json.mustache +0 -0
  261. /package/src/tasks/create/templates/SDK-React/field/{TimeofDay → TimeOfDay}/demo.stories.jsx.mustache +0 -0
  262. /package/src/tasks/create/templates/SDK-React/field/{TimeofDay → TimeOfDay}/mock.stories.js.mustache +0 -0
  263. /package/src/tasks/create/templates/SDK-React/field/{TimeofDay → TimeOfDay}/styles.js.mustache +0 -0
@@ -0,0 +1,80 @@
1
+ import { withKnobs } from '@storybook/addon-knobs';
2
+
3
+ import AppAnnouncement from "@pega/react-sdk-components/lib/components/widget/AppAnnouncement";
4
+
5
+ import { pyHome1Resolved, pyHome1Raw } from './mock.stories';
6
+
7
+ import {{COMPONENT_CLASS_NAME}} from './index.tsx';
8
+
9
+ export default {
10
+ title: '{{COMPONENT_CLASS_NAME}}',
11
+ decorators: [withKnobs],
12
+ component: {{COMPONENT_CLASS_NAME}}
13
+ };
14
+
15
+ export const Base{{COMPONENT_CLASS_NAME}} = () => {
16
+
17
+ const configProps = pyHome1Resolved.children[0].children[0].config;
18
+
19
+ const props = {
20
+ getPConnect: () => {
21
+ return {
22
+ getStateProps: () => {
23
+ return {};
24
+ },
25
+ getActionsApi: () => {
26
+ return {
27
+ getNextWork: () => {
28
+ return new Promise(resolve => {
29
+ resolve({});
30
+ });
31
+ },
32
+ updateFieldValue: () => {/* nothing */},
33
+ triggerFieldChange: () => {/* nothing */}
34
+ };
35
+ },
36
+ getChildren: () => {
37
+ return pyHome1Raw.children;
38
+ },
39
+ getComponentName: () => {
40
+ return '';
41
+ },
42
+ getLocalizedValue: value => {
43
+ return value;
44
+ },
45
+ getRawMetadata: () => {
46
+ return pyHome1Raw;
47
+ },
48
+ createComponent: config => {
49
+ if(config.type === 'AppAnnouncement') {
50
+ return (
51
+ <AppAnnouncement
52
+ key='announcement'
53
+ header='Announcements'
54
+ description={configProps.description}
55
+ image={configProps.image.replace(/ /g, '+')}
56
+ datasource={configProps.datasource}
57
+ label={configProps.label}
58
+ whatsnewlink={configProps.whatsnewlink}
59
+ />
60
+ );
61
+ }
62
+ },
63
+ ignoreSuggestion: () => {/* nothing */},
64
+ acceptSuggestion: () => {/* nothing */},
65
+ setInheritedProps: () => {/* nothing */},
66
+ resolveConfigProps: () => {/* nothing */}
67
+ };
68
+ }
69
+ };
70
+
71
+ const regionAChildren = pyHome1Raw.children[0].children.map(child => {
72
+ return props.getPConnect().createComponent(child);
73
+ });
74
+
75
+ return (
76
+ <>
77
+ <{{COMPONENT_CLASS_NAME}} {...props}>{regionAChildren}</{{COMPONENT_CLASS_NAME}}>
78
+ </>
79
+ );
80
+ };
@@ -0,0 +1,115 @@
1
+ export const pyHome1Raw = {
2
+ name: 'pyHome1',
3
+ type: 'View',
4
+ config: {
5
+ type: 'landingpage',
6
+ template: 'OneColumnPage',
7
+ icon: 'home-solid',
8
+ title: '@ENV APPLICATION_DESC',
9
+ ruleClass: 'DIXL-MediaCo-UIPages',
10
+ localeReference: '@LR DIXL-MEDIACO-UIPAGES!PAGE!PYHOME1',
11
+ enableGetNextWork: true,
12
+ context: 'pyPortal'
13
+ },
14
+ children: [
15
+ {
16
+ name: 'A',
17
+ type: 'Region',
18
+ children: [
19
+ {
20
+ type: 'AppAnnouncement',
21
+ config: {
22
+ label: '@L App announcement',
23
+ description:
24
+ "We've launched a brand new experience to accelerate your workflow. Check out the guides to help you get the most of Cosmos.",
25
+ whatsnewlink: 'https://design.pega.com',
26
+ image:
27
+ 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzOSAxMSI+PHRpdGxlPlBlZ2EgdGV4dC1vbmx5IGxvZ288L3RpdGxlPjxwYXRoIHN0eWxlPSJmaWxsLW9wYWNpdHk6IC4yNTsiIGZpbGw9IiNmZmYiIGQ9Ik03LjcyIDMuODJjMCAyLjI1LTEuNzggMy40MS00IDMuNDFoLTEuNnYzSDBWLjQyaDMuOTRjMi4zNiAwIDMuNzggMS4zOSAzLjc4IDMuNHptLTQtMS40N2gtMS42djNoMS43QTEuNDcgMS40NyAwIDAgMCA1LjUgMy44MmMwLS45MS0uNjUtMS40Ny0xLjc1LTEuNDd6bTcuNjggNS45MWg1LjN2Mkg5LjI5Vi40Mmg3LjM4djEuOTNoLTUuMjR2Mmg0LjI0djEuOWgtNC4yNHpNMjMuMTggMGE1IDUgMCAwIDEgMy41NyAxLjI4TDI1LjYzIDIuOGEzLjc4IDMuNzggMCAwIDAtMS4wNS0uNjNBNC4zMiA0LjMyIDAgMCAwIDIzLjMxIDIgMy4xNyAzLjE3IDAgMCAwIDIwIDUuMjdhMy4xNiAzLjE2IDAgMCAwIDEgMi4zOSAzLjA3IDMuMDcgMCAwIDAgMi4xNy44NCA0LjYgNC42IDAgMCAwIDIuMDktLjVWNi4xOWgtMi4yVjQuMzhoNC4yNXY0LjU2YTUuNDEgNS40MSAwIDAgMS00LjA4IDEuNTdBNS4zNSA1LjM1IDAgMCAxIDE5LjQzIDlhNS4wNSA1LjA1IDAgMCAxLTEuNTYtMy43NCA1LjIxIDUuMjEgMCAwIDEgMS41Ni0zLjc2QTUuMzEgNS4zMSAwIDAgMSAyMy4xOCAwem0xMS4yOS40Mmw0LjEzIDkuNzloLTIuMjVMMzUuNDggOGgtNC4wNmwtLjkgMi4xOGgtMi4yTDMyLjUxLjQyem0uMjUgNS43MkwzMy40NCAzbC0xLjI5IDMuMTR6bTMtNWEuNzEuNzEgMCAwIDEtLjc0Ljc1LjcxLjcxIDAgMCAxLS43My0uNzUuNzMuNzMgMCAwIDEgLjc1LS43Mi43Mi43MiAwIDAgMSAuNzUuNzF6TTM3IC41M2EuNTkuNTkgMCAwIDAtLjYuNi42MS42MSAwIDEgMCAxLjIxIDAgLjYuNiAwIDAgMC0uNjEtLjZ6bS0uMjQgMVYuNzFIMzdjLjEyIDAgLjE4LjA2LjI1LjA2YS4yMS4yMSAwIDAgMSAuMDcuMTguMTkuMTkgMCAwIDEtLjA3LjE4cy0uMDcuMDgtLjEzLjA4bC4yNi4zNmgtLjJMMzcgMS4yOGgtLjF2LjI5em0uMTMtLjQ0aC4yM2EuMjYuMjYgMCAwIDAgLjA3LS4wOWgtLjA2Yy0uMDUtLjE3LS4wNS0uMTctLjEzLS4xN2gtLjF6Ii8+PC9zdmc+',
28
+ datasource: {
29
+ source: [
30
+ {
31
+ "name": "New React based UI rendering"
32
+ },
33
+ {
34
+ "name": "Support for followers and recents"
35
+ },
36
+ {
37
+ "name": "New authoring experience"
38
+ }
39
+ ],
40
+ fields: {
41
+ name: '@P .pyLabel'
42
+ }
43
+ }
44
+ }
45
+ }
46
+ ]
47
+ }
48
+ ],
49
+ classID: 'DIXL-MediaCo-UIPages'
50
+ };
51
+
52
+ export const pyHome1Resolved = {
53
+ name: 'pyHome1',
54
+ type: 'View',
55
+ config: {
56
+ type: 'landingpage',
57
+ template: 'OneColumnPage',
58
+ icon: 'home-solid',
59
+ title: '@ENV APPLICATION_DESC',
60
+ ruleClass: 'DIXL-MediaCo-UIPages',
61
+ localeReference: '@LR DIXL-MEDIACO-UIPAGES!PAGE!PYHOME1',
62
+ enableGetNextWork: true,
63
+ context: 'pyPortal'
64
+ },
65
+ children: [
66
+ {
67
+ name: 'A',
68
+ type: 'Region',
69
+ getPConnect: () => {
70
+ return {
71
+ getComponentName: () => {
72
+ return '';
73
+ },
74
+ getComponent: () => {
75
+ return pyHome1Resolved.children[0];
76
+ },
77
+ getConfigProps: () => {
78
+ return {};
79
+ }
80
+ };
81
+ },
82
+ children: [
83
+ {
84
+ type: 'AppAnnouncement',
85
+ config: {
86
+ label: '@L App announcement',
87
+ description:
88
+ "We've launched a brand new experience to accelerate your workflow. Check out the guides to help you get the most of Cosmos.",
89
+ whatsnewlink: 'https://design.pega.com',
90
+ image:
91
+ 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzOSAxMSI+PHRpdGxlPlBlZ2EgdGV4dC1vbmx5IGxvZ288L3RpdGxlPjxwYXRoIHN0eWxlPSJmaWxsLW9wYWNpdHk6IC4yNTsiIGZpbGw9IiNmZmYiIGQ9Ik03LjcyIDMuODJjMCAyLjI1LTEuNzggMy40MS00IDMuNDFoLTEuNnYzSDBWLjQyaDMuOTRjMi4zNiAwIDMuNzggMS4zOSAzLjc4IDMuNHptLTQtMS40N2gtMS42djNoMS43QTEuNDcgMS40NyAwIDAgMCA1LjUgMy44MmMwLS45MS0uNjUtMS40Ny0xLjc1LTEuNDd6bTcuNjggNS45MWg1LjN2Mkg5LjI5Vi40Mmg3LjM4djEuOTNoLTUuMjR2Mmg0LjI0djEuOWgtNC4yNHpNMjMuMTggMGE1IDUgMCAwIDEgMy41NyAxLjI4TDI1LjYzIDIuOGEzLjc4IDMuNzggMCAwIDAtMS4wNS0uNjNBNC4zMiA0LjMyIDAgMCAwIDIzLjMxIDIgMy4xNyAzLjE3IDAgMCAwIDIwIDUuMjdhMy4xNiAzLjE2IDAgMCAwIDEgMi4zOSAzLjA3IDMuMDcgMCAwIDAgMi4xNy44NCA0LjYgNC42IDAgMCAwIDIuMDktLjVWNi4xOWgtMi4yVjQuMzhoNC4yNXY0LjU2YTUuNDEgNS40MSAwIDAgMS00LjA4IDEuNTdBNS4zNSA1LjM1IDAgMCAxIDE5LjQzIDlhNS4wNSA1LjA1IDAgMCAxLTEuNTYtMy43NCA1LjIxIDUuMjEgMCAwIDEgMS41Ni0zLjc2QTUuMzEgNS4zMSAwIDAgMSAyMy4xOCAwem0xMS4yOS40Mmw0LjEzIDkuNzloLTIuMjVMMzUuNDggOGgtNC4wNmwtLjkgMi4xOGgtMi4yTDMyLjUxLjQyem0uMjUgNS43MkwzMy40NCAzbC0xLjI5IDMuMTR6bTMtNWEuNzEuNzEgMCAwIDEtLjc0Ljc1LjcxLjcxIDAgMCAxLS43My0uNzUuNzMuNzMgMCAwIDEgLjc1LS43Mi43Mi43MiAwIDAgMSAuNzUuNzF6TTM3IC41M2EuNTkuNTkgMCAwIDAtLjYuNi42MS42MSAwIDEgMCAxLjIxIDAgLjYuNiAwIDAgMC0uNjEtLjZ6bS0uMjQgMVYuNzFIMzdjLjEyIDAgLjE4LjA2LjI1LjA2YS4yMS4yMSAwIDAgMSAuMDcuMTguMTkuMTkgMCAwIDEtLjA3LjE4cy0uMDcuMDgtLjEzLjA4bC4yNi4zNmgtLjJMMzcgMS4yOGgtLjF2LjI5em0uMTMtLjQ0aC4yM2EuMjYuMjYgMCAwIDAgLjA3LS4wOWgtLjA2Yy0uMDUtLjE3LS4wNS0uMTctLjEzLS4xN2gtLjF6Ii8+PC9zdmc+',
92
+ datasource: {
93
+ source: [
94
+ {
95
+ "name": "New React based UI rendering"
96
+ },
97
+ {
98
+ "name": "Support for followers and recents"
99
+ },
100
+ {
101
+ "name": "New authoring experience"
102
+ }
103
+ ]
104
+ ,
105
+ fields: {
106
+ name: '@P .pyLabel'
107
+ }
108
+ }
109
+ }
110
+ }
111
+ ]
112
+ }
113
+ ],
114
+ classID: 'DIXL-MediaCo-UIPages'
115
+ };
@@ -0,0 +1,15 @@
1
+ {{! pick new delimiters for mustache }}
2
+ {{=<% %>=}}
3
+ <div class="psdk-page-title">
4
+ <h2>{{ title$ }}</h2>
5
+ </div>
6
+ <div class="page-body">
7
+ <div *ngFor="let kid of arChildren$">
8
+ <div [ngSwitch]="kid.getPConnect().getComponentName()">
9
+ <app-view *ngSwitchCase="'View'" [pConn$]="kid.getPConnect()"></app-view>
10
+ <app-region *ngSwitchCase="'Region'" [pConn$]="kid.getPConnect()"></app-region>
11
+ <div *ngSwitchDefault><%COMPONENT_CLASS_NAME%> Missing: {{ kid.getPConnect().getComponentName() }}</div>
12
+ </div>
13
+ </div>
14
+ </div>
15
+ <%={{ }}=%> {{! revert delimiters for mustache }}
@@ -0,0 +1,3 @@
1
+ .psdk-page-title {
2
+ padding-left: 0.2rem;
3
+ }
@@ -0,0 +1,25 @@
1
+ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
2
+
3
+ import { {{COMPONENT_CLASS_NAME}}Component } from './{{COMPONENT_CLASS_NAME_KEBAB}}.component';
4
+
5
+ describe('{{COMPONENT_CLASS_NAME}}Component', () => {
6
+ let component: {{COMPONENT_CLASS_NAME}}Component;
7
+ let fixture: ComponentFixture<{{COMPONENT_CLASS_NAME}}Component>;
8
+
9
+ beforeEach(waitForAsync(() => {
10
+ TestBed.configureTestingModule({
11
+ declarations: [ {{COMPONENT_CLASS_NAME}}Component ]
12
+ })
13
+ .compileComponents();
14
+ }));
15
+
16
+ beforeEach(() => {
17
+ fixture = TestBed.createComponent({{COMPONENT_CLASS_NAME}}Component);
18
+ component = fixture.componentInstance;
19
+ fixture.detectChanges();
20
+ });
21
+
22
+ it('should create', () => {
23
+ expect(component).toBeTruthy();
24
+ });
25
+ });
@@ -0,0 +1,63 @@
1
+ import { Component, OnInit, Input, forwardRef } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { FormGroup } from '@angular/forms';
4
+ import { AngularPConnectService } from '@pega/angular-sdk-library';
5
+ import { RegionComponent } from '@pega/angular-sdk-library';
6
+ import { ViewComponent } from '@pega/angular-sdk-library';
7
+
8
+ @Component({
9
+ selector: 'app-{{COMPONENT_CLASS_NAME_KEBAB}}',
10
+ templateUrl: './{{COMPONENT_CLASS_NAME_KEBAB}}.component.html',
11
+ styleUrls: ['./{{COMPONENT_CLASS_NAME_KEBAB}}.component.scss'],
12
+ standalone: true,
13
+ imports: [CommonModule, RegionComponent, forwardRef(() => ViewComponent)]
14
+ })
15
+ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit {
16
+ @Input() pConn$: any;
17
+ @Input() formGroup$: FormGroup;
18
+
19
+ // Used with AngularPConnect
20
+ angularPConnectData: any = {};
21
+
22
+ configProps$: Object;
23
+ arChildren$: Array<any>;
24
+ title$: string;
25
+
26
+ constructor(private angularPConnect: AngularPConnectService) {}
27
+
28
+ ngOnInit() {
29
+ this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
30
+
31
+ this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps());
32
+ this.arChildren$ = this.pConn$.getChildren();
33
+
34
+ this.title$ = this.configProps$['title'];
35
+ let operator = this.configProps$['operator'];
36
+
37
+ if (operator && operator != '') {
38
+ this.title$ += ', ' + operator;
39
+ }
40
+
41
+ // when showing a page, similar to updating root, need to cause viewContainer to call "initContainer"
42
+ sessionStorage.setItem('hasViewContainer', 'false');
43
+ }
44
+
45
+ ngOnDestroy(): void {
46
+ if (this.angularPConnectData.unsubscribeFn) {
47
+ this.angularPConnectData.unsubscribeFn();
48
+ }
49
+ }
50
+
51
+ onStateChange() {
52
+ // Should always check the bridge to see if the component should update itself (re-render)
53
+ const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
54
+
55
+ // ONLY call updateSelf when the component should update
56
+ // AND removing the "gate" that was put there since shouldComponentUpdate
57
+ // should be the real "gate"
58
+ if (bUpdateSelf) {
59
+ // turn off spinner
60
+ //this.psService.sendMessage(false);
61
+ }
62
+ }
63
+ }
@@ -0,0 +1,36 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="100px" height="70px" viewBox="0 0 100 70" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>1 col </title>
4
+ <defs>
5
+ <rect id="path-1" x="0" y="0" width="100" height="70"></rect>
6
+ </defs>
7
+ <g id="Concepts" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
8
+ <g id="Templates" transform="translate(-98.000000, -108.000000)">
9
+ <g id="Change-template" transform="translate(42.000000, 36.000000)">
10
+ <g id="1-col-" transform="translate(56.000000, 72.000000)">
11
+ <mask id="mask-2" fill="white">
12
+ <use xlink:href="#path-1"></use>
13
+ </mask>
14
+ <rect stroke="#A5A8BC" stroke-width="0.5" x="0.25" y="0.25" width="99.5" height="69.5"></rect>
15
+ <g id="white" mask="url(#mask-2)" fill="#FFFFFF">
16
+ <g transform="translate(3.000000, 3.000000)" id="Rectangle">
17
+ <rect x="0" y="0" width="94" height="66.5"></rect>
18
+ </g>
19
+ </g>
20
+ <g id="gray" mask="url(#mask-2)" fill="#8084A7">
21
+ <g transform="translate(6.000000, 6.000000)" id="Rectangle">
22
+ <rect x="0" y="-2.84217094e-14" width="88" height="77.8"></rect>
23
+ </g>
24
+ </g>
25
+ <g id="labels" mask="url(#mask-2)" font-family="OpenSans-Semibold, Open Sans" font-size="11" font-weight="500">
26
+ <g transform="translate(44.000000, 17.000000)" id="A">
27
+ <text>
28
+ <tspan x="0.75" y="12" fill="#FFFFFF">A</tspan>
29
+ </text>
30
+ </g>
31
+ </g>
32
+ </g>
33
+ </g>
34
+ </g>
35
+ </g>
36
+ </svg>
@@ -0,0 +1,15 @@
1
+ {{! pick new delimiters for mustache }}
2
+ {{=<% %>=}}
3
+ <div>
4
+ <h2 class="psdk-case-history-title">{{ configProps$.label }}</h2>
5
+ <table mat-table [dataSource]="repeatList$">
6
+ <ng-container *ngFor="let dCol of fields$" [matColumnDef]="dCol.fieldName">
7
+ <th mat-header-cell *matHeaderCellDef>{{ dCol.label }}</th>
8
+ <td mat-cell *matCellDef="let element">{{ element[dCol.fieldName] }}</td>
9
+ </ng-container>
10
+
11
+ <tr mat-header-row *matHeaderRowDef="displayedColumns$"></tr>
12
+ <tr mat-row *matRowDef="let row; columns: displayedColumns$"></tr>
13
+ </table>
14
+ </div>
15
+ <%={{ }}=%> {{! revert delimiters for mustache }}
@@ -0,0 +1,22 @@
1
+ table {
2
+ width: 100%;
3
+ }
4
+
5
+ .mat-mdc-row .mat-mdc-cell {
6
+ text-align: left;
7
+ }
8
+
9
+ .psdk-search {
10
+ padding-left: 0.625rem;
11
+ }
12
+
13
+ .psdk-icon-search {
14
+ vertical-align: sub;
15
+ padding: 0rem 0.125rem;
16
+ min-width: unset;
17
+ width: 1.1rem;
18
+ }
19
+
20
+ .psdk-case-history-title {
21
+ margin-left: 0.5rem;
22
+ }
@@ -0,0 +1,25 @@
1
+ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
2
+
3
+ import { {{COMPONENT_CLASS_NAME}}Component } from './{{COMPONENT_CLASS_NAME_KEBAB}}.component';
4
+
5
+ describe('{{COMPONENT_CLASS_NAME}}Component', () => {
6
+ let component: {{COMPONENT_CLASS_NAME}}Component;
7
+ let fixture: ComponentFixture<{{COMPONENT_CLASS_NAME}}Component>;
8
+
9
+ beforeEach(waitForAsync(() => {
10
+ TestBed.configureTestingModule({
11
+ declarations: [ {{COMPONENT_CLASS_NAME}}Component ]
12
+ })
13
+ .compileComponents();
14
+ }));
15
+
16
+ beforeEach(() => {
17
+ fixture = TestBed.createComponent({{COMPONENT_CLASS_NAME}}Component);
18
+ component = fixture.componentInstance;
19
+ fixture.detectChanges();
20
+ });
21
+
22
+ it('should create', () => {
23
+ expect(component).toBeTruthy();
24
+ });
25
+ });
@@ -0,0 +1,111 @@
1
+ import { Component, OnInit, Input } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { MatTableDataSource, MatTableModule } from '@angular/material/table';
4
+ import { Utils } from '@pega/angular-sdk-library';
5
+
6
+ declare const window: any;
7
+
8
+ @Component({
9
+ selector: 'app-{{COMPONENT_CLASS_NAME_KEBAB}}',
10
+ templateUrl: './{{COMPONENT_CLASS_NAME_KEBAB}}.component.html',
11
+ styleUrls: ['./{{COMPONENT_CLASS_NAME_KEBAB}}.component.scss'],
12
+ standalone: true,
13
+ imports: [CommonModule, MatTableModule]
14
+ })
15
+ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit {
16
+ @Input() pConn$: any;
17
+
18
+ PCore$: any;
19
+ configProps$: any;
20
+
21
+ repeatList$: MatTableDataSource<any>;
22
+ fields$: Array<any>;
23
+ displayedColumns$ = Array<any>();
24
+ waitingForData: boolean = false;
25
+
26
+ constructor(private utils: Utils) {}
27
+
28
+ ngOnInit(): void {
29
+ if (!this.PCore$) {
30
+ this.PCore$ = window.PCore;
31
+ }
32
+
33
+ this.configProps$ = this.pConn$.getConfigProps();
34
+
35
+ const caseID = this.pConn$.getValue(this.PCore$.getConstants().CASE_INFO.CASE_INFO_ID);
36
+ const dataViewName = 'D_pyWorkHistory';
37
+ const context = this.pConn$.getContextName();
38
+
39
+ this.waitingForData = true;
40
+
41
+ const caseHistoryData = this.PCore$.getDataApiUtils().getData(
42
+ dataViewName,
43
+ `{"dataViewParameters":[{"CaseInstanceKey":"${caseID}"}]}`,
44
+ context
45
+ );
46
+
47
+ caseHistoryData.then((historyJSON: Object) => {
48
+ this.fields$ = [
49
+ { label: 'Date', type: 'DateTime', fieldName: 'pxTimeCreated' },
50
+ { label: 'Description', type: 'TextInput', fieldName: 'pyMessageKey' },
51
+ { label: 'User', type: 'TextInput', fieldName: 'pyPerformer' }
52
+ ];
53
+
54
+ const tableDataResults = this.updateData(historyJSON['data'].data, this.fields$);
55
+
56
+ this.displayedColumns$ = this.getDisplayColums(this.fields$);
57
+
58
+ this.repeatList$ = new MatTableDataSource(tableDataResults);
59
+
60
+ this.waitingForData = false;
61
+ });
62
+ }
63
+
64
+ ngOnDestroy() {}
65
+
66
+ updateFields(arFields, arColumns): Array<any> {
67
+ let arReturn = arFields;
68
+ for (let i in arReturn) {
69
+ arReturn[i].config.name = arColumns[i];
70
+ }
71
+
72
+ return arReturn;
73
+ }
74
+
75
+ updateData(listData: Array<any>, fieldData: Array<any>): Array<any> {
76
+ let returnList: Array<any> = new Array<any>();
77
+ for (let row in listData) {
78
+ // copy
79
+ let rowData = JSON.parse(JSON.stringify(listData[row]));
80
+
81
+ for (let field of fieldData) {
82
+ let fieldName = field['fieldName'];
83
+ let formattedDate;
84
+
85
+ switch (field['type']) {
86
+ case 'Date':
87
+ formattedDate = this.utils.generateDate(rowData[fieldName], 'Date-Short-YYYY');
88
+ rowData[fieldName] = formattedDate;
89
+ break;
90
+ case 'DateTime':
91
+ formattedDate = this.utils.generateDateTime(rowData[fieldName], 'DateTime-Short-YYYY');
92
+ rowData[fieldName] = formattedDate;
93
+ break;
94
+ }
95
+ }
96
+
97
+ returnList.push(rowData);
98
+ }
99
+
100
+ return returnList;
101
+ }
102
+
103
+ getDisplayColums(fields = []) {
104
+ let arReturn = fields.map((field, colIndex) => {
105
+ let theField = field.fieldName;
106
+
107
+ return theField;
108
+ });
109
+ return arReturn;
110
+ }
111
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "{{COMPONENT_KEY}}",
3
+ "label": "{{COMPONENT_LABEL}}",
4
+ "description": "{{DESCRIPTION}}",
5
+ "organization": "{{ORGANIZATION}}",
6
+ "version": "{{VERSION}}",
7
+ "library": "{{LIBRARY}}",
8
+ "allowedApplications": {{{ALLOWEDAPPS}}},
9
+ "componentKey": "{{COMPONENT_KEY}}",
10
+ "type": "{{TYPE}}",
11
+ "subtype": {{{SUB_TYPE}}},
12
+ "icon": "OneColumnPage.svg",
13
+ "properties": [
14
+ {
15
+ "name": "label",
16
+ "label": "Label value",
17
+ "format": "TEXT"
18
+ }
19
+ ],
20
+ "defaultConfig": {
21
+ "label": "Case Widget"
22
+ }
23
+ }
@@ -0,0 +1,70 @@
1
+ import { withKnobs } from '@storybook/addon-knobs';
2
+
3
+ import { historyData } from './mock.stories';
4
+
5
+ import {{COMPONENT_CLASS_NAME}} from './index.tsx';
6
+
7
+ export default {
8
+ title: '{{COMPONENT_CLASS_NAME}}',
9
+ decorators: [withKnobs],
10
+ component: {{COMPONENT_CLASS_NAME}}
11
+ };
12
+
13
+ if (!window.PCore) {
14
+ window.PCore = {};
15
+ }
16
+
17
+ window.PCore.getConstants = () => {
18
+ return {
19
+ CASE_INFO: {
20
+ CASE_INFO_ID: 'caseInfo.ID'
21
+ }
22
+ };
23
+ };
24
+
25
+ window.PCore.getDataApiUtils = () => {
26
+ return {
27
+ getData: () => {
28
+ return new Promise(resolve => {
29
+ resolve(historyData);
30
+ });
31
+ }
32
+ };
33
+ };
34
+
35
+ export const Base{{COMPONENT_CLASS_NAME}} = () => {
36
+
37
+ const props = {
38
+ label: 'Case history',
39
+
40
+ getPConnect: () => {
41
+ return {
42
+ getValue: value => {
43
+ return value;
44
+ },
45
+ getContextName: () => {
46
+ return 'app/primary_1';
47
+ },
48
+ getLocalizedValue: value => {
49
+ return value;
50
+ },
51
+ getActionsApi: () => {
52
+ return {
53
+ updateFieldValue: () => {/* nothing */},
54
+ triggerFieldChange: () => {/* nothing */}
55
+ };
56
+ },
57
+ ignoreSuggestion: () => {/* nothing */},
58
+ acceptSuggestion: () => {/* nothing */},
59
+ setInheritedProps: () => {/* nothing */},
60
+ resolveConfigProps: () => {/* nothing */}
61
+ };
62
+ }
63
+ };
64
+
65
+ return (
66
+ <>
67
+ <{{COMPONENT_CLASS_NAME}} {...props} />
68
+ </>
69
+ );
70
+ };