@pega/dx-component-builder-sdk 0.1.47 → 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 +112 -56
  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
@@ -16,21 +16,24 @@ export const pyReviewRaw = {
16
16
  type: 'TextInput',
17
17
  config: {
18
18
  value: '@P .FirstName',
19
- label: '@L First Name'
19
+ label: '@L First Name',
20
+ key: 'FirstName'
20
21
  }
21
22
  },
22
23
  {
23
24
  type: 'TextInput',
24
25
  config: {
25
26
  value: '@P .MiddleName',
26
- label: '@L Middle Name'
27
+ label: '@L Middle Name',
28
+ key: 'MiddleName'
27
29
  }
28
30
  },
29
31
  {
30
32
  type: 'TextInput',
31
33
  config: {
32
34
  value: '@P .LastName',
33
- label: '@L Last Name'
35
+ label: '@L Last Name',
36
+ key: 'LastName'
34
37
  }
35
38
  }
36
39
  ]
@@ -43,7 +46,8 @@ export const pyReviewRaw = {
43
46
  type: 'Email',
44
47
  config: {
45
48
  value: '@P .Email',
46
- label: '@L Email'
49
+ label: '@L Email',
50
+ key: 'Email'
47
51
  }
48
52
  },
49
53
  {
@@ -56,14 +60,16 @@ export const pyReviewRaw = {
56
60
  fields: {
57
61
  value: '@P .pyCallingCode'
58
62
  }
59
- }
63
+ },
64
+ key: 'PhoneNumber'
60
65
  }
61
66
  },
62
67
  {
63
68
  type: 'Date',
64
69
  config: {
65
70
  value: '@P .ServiceDate',
66
- label: '@L Service Date'
71
+ label: '@L Service Date',
72
+ key: 'ServiceDate'
67
73
  }
68
74
  }
69
75
  ]
@@ -77,25 +83,29 @@ export const regionChildrenResolved = [
77
83
  readOnly: undefined,
78
84
  value: 'John',
79
85
  label: 'First Name',
80
- hasSuggestions: false
86
+ hasSuggestions: false,
87
+ key: 'First Name'
81
88
  },
82
89
  {
83
90
  readOnly: undefined,
84
91
  value: '',
85
92
  label: 'Middle Name',
86
- hasSuggestions: false
93
+ hasSuggestions: false,
94
+ key: 'Middle Name'
87
95
  },
88
96
  {
89
97
  readOnly: undefined,
90
98
  value: 'Doe',
91
99
  label: 'Last Name',
92
- hasSuggestions: false
100
+ hasSuggestions: false,
101
+ key: 'Last Name'
93
102
  },
94
103
  {
95
104
  readOnly: undefined,
96
105
  value: 'John@doe.com',
97
106
  label: 'Email',
98
- hasSuggestions: false
107
+ hasSuggestions: false,
108
+ key: 'Email'
99
109
  },
100
110
  {
101
111
  readOnly: undefined,
@@ -120,12 +130,14 @@ export const regionChildrenResolved = [
120
130
  }
121
131
  ]
122
132
  },
123
- hasSuggestions: false
133
+ hasSuggestions: false,
134
+ key: 'Phone Number'
124
135
  },
125
136
  {
126
137
  readOnly: undefined,
127
138
  value: '2023-01-25',
128
139
  label: 'Service Date',
129
- hasSuggestions: false
140
+ hasSuggestions: false,
141
+ key: 'Service Date'
130
142
  }
131
143
  ];
@@ -1,7 +1,14 @@
1
- import styled, { css } from 'styled-components';
1
+ // utilizing theming, comment out, if want individual style
2
+ import styled from 'styled-components';
3
+ import { Configuration } from '@pega/cosmos-react-core';
2
4
 
3
- export default styled.div(() => {
4
- return css`
5
- margin: 0px 0px;
6
- `;
7
- });
5
+ export default styled(Configuration)``;
6
+
7
+ // individual style, comment out above, and uncomment here and add styles
8
+ // import styled, { css } from 'styled-components';
9
+ //
10
+ // export default styled.div(() => {
11
+ // return css`
12
+ // margin: 0px 0;
13
+ // `;
14
+ // });
@@ -64,6 +64,7 @@ export const base{{COMPONENT_CLASS_NAME}} = () => {
64
64
  if (config.type === 'AppAnnouncement') {
65
65
  return (
66
66
  <PegaAppAnnouncement
67
+ key='app-announcements'
67
68
  heading='Announcements'
68
69
  description={configProps.description}
69
70
  whatsNewLink={configProps.whatsnewlink}
@@ -1,7 +1,14 @@
1
- import styled, { css } from 'styled-components';
1
+ // utilizing theming, comment out, if want individual style
2
+ import styled from 'styled-components';
3
+ import { Configuration } from '@pega/cosmos-react-core';
2
4
 
3
- export default styled.div(() => {
4
- return css`
5
- margin: 0px 0px;
6
- `;
7
- });
5
+ export default styled(Configuration)``;
6
+
7
+ // individual style, comment out above, and uncomment here and add styles
8
+ // import styled, { css } from 'styled-components';
9
+ //
10
+ // export default styled.div(() => {
11
+ // return css`
12
+ // margin: 0px 0;
13
+ // `;
14
+ // });
@@ -33,7 +33,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props) {
33
33
  if (response.data.data !== null) {
34
34
  setHistory(
35
35
  response.data.data.map((entry, index) => {
36
- {{! pick new delimiteres for mustache }}
36
+ {{! pick new delimiters for mustache }}
37
37
  {{=<% %>=}}
38
38
  return {
39
39
  date: new Date(entry.pxTimeCreated).toLocaleString(),
@@ -41,7 +41,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props) {
41
41
  user: entry.pyPerformer,
42
42
  id: index
43
43
  };
44
- <%={{ }}=%> {{! revert delimiteres for mustache }}
44
+ <%={{ }}=%> {{! revert delimiters for mustache }}
45
45
  })
46
46
  );
47
47
  } else {
@@ -1,7 +1,14 @@
1
- import styled, { css } from 'styled-components';
1
+ // utilizing theming, comment out, if want individual style
2
+ import styled from 'styled-components';
3
+ import { Configuration } from '@pega/cosmos-react-core';
2
4
 
3
- export default styled.div(() => {
4
- return css`
5
- margin: 0px 0;
6
- `;
7
- });
5
+ export default styled(Configuration)``;
6
+
7
+ // individual style, comment out above, and uncomment here and add styles
8
+ // import styled, { css } from 'styled-components';
9
+ //
10
+ // export default styled.div(() => {
11
+ // return css`
12
+ // margin: 0px 0;
13
+ // `;
14
+ // });
@@ -1,7 +1,14 @@
1
- import styled, { css } from 'styled-components';
1
+ // utilizing theming, comment out, if want individual style
2
+ import styled from 'styled-components';
3
+ import { Configuration } from '@pega/cosmos-react-core';
2
4
 
3
- export default styled.div(() => {
4
- return css`
5
- margin: 0px 0;
6
- `;
7
- });
5
+ export default styled(Configuration)``;
6
+
7
+ // individual style, comment out above, and uncomment here and add styles
8
+ // import styled, { css } from 'styled-components';
9
+ //
10
+ // export default styled.div(() => {
11
+ // return css`
12
+ // margin: 0px 0;
13
+ // `;
14
+ // });
@@ -31,7 +31,7 @@ const Operator = (props) => {
31
31
  }, [id]);
32
32
 
33
33
 
34
- {{! pick new delimiteres for mustache }}
34
+ {{! pick new delimiters for mustache }}
35
35
  {{=<% %>=}}
36
36
 
37
37
  const OperatorPreview = () => {
@@ -145,7 +145,7 @@ const Operator = (props) => {
145
145
  }
146
146
  };
147
147
 
148
- <%={{ }}=%> {{! revert delimiteres for mustache }}
148
+ <%={{ }}=%> {{! revert delimiters for mustache }}
149
149
 
150
150
  const clickAction = (e) => {
151
151
  setPopoverTarget(e.currentTarget);
@@ -46,11 +46,11 @@ export default function {{COMPONENT_CLASS_NAME}}(props) {
46
46
  <Card>
47
47
  <CardHeader>{title}</CardHeader>
48
48
  <CardContent>
49
- {{! pick new delimiteres for mustache }} {{=<% %>=}}
49
+ {{! pick new delimiters for mustache }} {{=<% %>=}}
50
50
  <Flex container={{ direction: 'row'}}>
51
51
  <Operator label={hideLabel ? null : _label} name={user.userName} id={user.userId} getPConnect={getPConnect} />
52
52
 
53
- <%={{ }}=%> {{! revert delimiteres for mustache }}
53
+ <%={{ }}=%> {{! revert delimiters for mustache }}
54
54
  {dateTimeValue && (
55
55
  <Fragment>
56
56
  {' '}
@@ -1,7 +1,14 @@
1
- import styled, { css } from 'styled-components';
1
+ // utilizing theming, comment out, if want individual style
2
+ import styled from 'styled-components';
3
+ import { Configuration } from '@pega/cosmos-react-core';
2
4
 
3
- export default styled.div(() => {
4
- return css`
5
- margin: 0px 0;
6
- `;
7
- });
5
+ export default styled(Configuration)``;
6
+
7
+ // individual style, comment out above, and uncomment here and add styles
8
+ // import styled, { css } from 'styled-components';
9
+ //
10
+ // export default styled.div(() => {
11
+ // return css`
12
+ // margin: 0px 0;
13
+ // `;
14
+ // });
@@ -0,0 +1,42 @@
1
+ <div *ngIf="displayMode$; else noDisplayMode">
2
+ <app-field-value-list [label$]="label$" [value$]="value$" [displayMode$]="displayMode$"></app-field-value-list>
3
+ </div>
4
+ <ng-template #noDisplayMode>
5
+ <div *ngIf="!bReadonly$ && bHasForm$; else noEdit">
6
+ <div [formGroup]="formGroup$" *ngIf="bVisible$">
7
+ <div class="mat-form-field-infix" *ngIf="showLabel$">
8
+ <span>
9
+ <label class="mat-form-field-label psdk-label-readonly">{{ label$ }}</label>
10
+ </span>
11
+ {{! pick new delimiters for mustache }}
12
+ {{=<% %>=}}
13
+ <mat-checkbox
14
+ [labelPosition]="checkboxLabelPos$"
15
+ [checked]="isChecked$"
16
+ [disabled]="bDisabled$"
17
+ [attr.data-test-id]="testId"
18
+ (change)="fieldOnChange($event)"
19
+ (click)="fieldOnClick($event)"
20
+ (blur)="fieldOnBlur($event)"
21
+ >{{ caption$ }}</mat-checkbox
22
+ >
23
+ </div>
24
+ <div class="mat-form-field-infix" *ngIf="!bReadonly$ && !showLabel$">
25
+ <mat-checkbox
26
+ [labelPosition]="checkboxLabelPos$"
27
+ [checked]="isChecked$"
28
+ [disabled]="bDisabled$"
29
+ [attr.data-test-id]="testId"
30
+ (change)="fieldOnChange($event)"
31
+ (click)="fieldOnClick($event)"
32
+ (blur)="fieldOnBlur($event)"
33
+ >{{ caption$ }}</mat-checkbox
34
+ >
35
+ <%={{ }}=%> {{! revert delimiters for mustache }}
36
+ </div>
37
+ </div>
38
+ </div>
39
+ </ng-template>
40
+ <ng-template #noEdit>
41
+ <app-text [pConn$]="pConn$" [formatAs$]="'text'"></app-text>
42
+ </ng-template>
@@ -0,0 +1,24 @@
1
+ .psdk-full-width {
2
+ min-width: 9.375rem;
3
+ width: 100%;
4
+ text-align: left;
5
+ }
6
+
7
+ .psdk-label-readonly {
8
+ top: 0rem;
9
+ margin-top: 0.625rem;
10
+ font-size: 0.875rem;
11
+ display: block;
12
+ transform: translateY(-1.28125em) scale(0.75) perspective(100px) translateZ(0.001px);
13
+ -ms-transform: translateY(-1.28125em) scale(0.75);
14
+ width: 133.33333%;
15
+ }
16
+
17
+ .psdk-data-readonly {
18
+ padding-top: 0.625rem;
19
+ width: 100%;
20
+ }
21
+
22
+ ::ng-deep .mat-mdc-form-field-infix {
23
+ width: auto;
24
+ }
@@ -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,165 @@
1
+ import { Component, OnInit, Input, ChangeDetectorRef } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
4
+ import { MatCheckboxModule } from '@angular/material/checkbox';
5
+ import { AngularPConnectService } from '@pega/angular-sdk-library';
6
+ import { Utils } from '@pega/angular-sdk-library';
7
+ import { TextComponent } from '@pega/angular-sdk-library';
8
+ import { FieldValueListComponent } from '@pega/angular-sdk-library';
9
+
10
+ declare const window: any;
11
+
12
+ @Component({
13
+ selector: 'app-{{COMPONENT_CLASS_NAME_KEBAB}}',
14
+ templateUrl: './{{COMPONENT_CLASS_NAME_KEBAB}}.component.html',
15
+ styleUrls: ['./{{COMPONENT_CLASS_NAME_KEBAB}}.component.scss'],
16
+ standalone: true,
17
+ imports: [CommonModule, ReactiveFormsModule, MatCheckboxModule, TextComponent, FieldValueListComponent]
18
+ })
19
+ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit {
20
+ @Input() pConn$: any;
21
+ @Input() formGroup$: FormGroup;
22
+
23
+ // Used with AngularPConnect
24
+ angularPConnectData: any = {};
25
+ configProps$: Object;
26
+
27
+ label$: string = '';
28
+ value$: any = '';
29
+ caption$: string = '';
30
+ testId: string = '';
31
+ showLabel$: boolean = false;
32
+ checkboxLabelPos$ = 'after';
33
+ isChecked$: boolean = false;
34
+ bRequired$: boolean = false;
35
+ bReadonly$: boolean = false;
36
+ bDisabled$: boolean = false;
37
+ bVisible$: boolean = true;
38
+ displayMode$: string = '';
39
+ controlName$: string;
40
+ bHasForm$: boolean = true;
41
+ componentReference: string = '';
42
+
43
+ fieldControl = new FormControl('', null);
44
+
45
+ constructor(
46
+ private angularPConnect: AngularPConnectService,
47
+ private cdRef: ChangeDetectorRef,
48
+ private utils: Utils
49
+ ) {}
50
+
51
+ ngOnInit(): void {
52
+ // First thing in initialization is registering and subscribing to the AngularPConnect service
53
+ this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
54
+ this.controlName$ = this.angularPConnect.getComponentID(this);
55
+
56
+ // Then, continue on with other initialization
57
+
58
+ // call updateSelf when initializing
59
+ //this.updateSelf();
60
+ this.checkAndUpdate();
61
+
62
+ if (this.formGroup$ != null) {
63
+ // add control to formGroup
64
+ this.formGroup$.addControl(this.controlName$, this.fieldControl);
65
+ this.fieldControl.setValue(this.value$);
66
+ this.bHasForm$ = true;
67
+ } else {
68
+ this.bReadonly$ = true;
69
+ this.bHasForm$ = false;
70
+ }
71
+ }
72
+
73
+ ngOnDestroy(): void {
74
+ if (this.formGroup$ != null) {
75
+ this.formGroup$.removeControl(this.controlName$);
76
+ }
77
+
78
+ if (this.angularPConnectData.unsubscribeFn) {
79
+ this.angularPConnectData.unsubscribeFn();
80
+ }
81
+ }
82
+
83
+ // Callback passed when subscribing to store change
84
+ onStateChange() {
85
+ this.checkAndUpdate();
86
+ }
87
+
88
+ checkAndUpdate() {
89
+ // Should always check the bridge to see if the component should
90
+ // update itself (re-render)
91
+ const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
92
+
93
+ // ONLY call updateSelf when the component should update
94
+ if (bUpdateSelf) {
95
+ this.updateSelf();
96
+ }
97
+ }
98
+
99
+ // updateSelf
100
+ updateSelf(): void {
101
+ // moved this from ngOnInit() and call this from there instead...
102
+ this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps());
103
+
104
+ if (this.configProps$['value'] != undefined) {
105
+ this.value$ = this.configProps$['value'];
106
+ }
107
+ this.testId = this.configProps$['testId'];
108
+ this.label$ = this.configProps$['label'];
109
+ this.displayMode$ = this.configProps$['displayMode'];
110
+
111
+ this.caption$ = this.configProps$['caption'];
112
+
113
+ // timeout and detectChanges to avoid ExpressionChangedAfterItHasBeenCheckedError
114
+ setTimeout(() => {
115
+ if (this.configProps$['required'] != null) {
116
+ this.bRequired$ = this.utils.getBooleanValue(this.configProps$['required']);
117
+ }
118
+ this.cdRef.detectChanges();
119
+ });
120
+
121
+ if (this.configProps$['visibility'] != null) {
122
+ this.bVisible$ = this.utils.getBooleanValue(this.configProps$['visibility']);
123
+ }
124
+
125
+ // disabled
126
+ if (this.configProps$['disabled'] != undefined) {
127
+ this.bDisabled$ = this.utils.getBooleanValue(this.configProps$['disabled']);
128
+ }
129
+
130
+ if (this.bDisabled$) {
131
+ this.fieldControl.disable();
132
+ } else {
133
+ this.fieldControl.enable();
134
+ }
135
+
136
+ if (this.configProps$['readOnly'] != null) {
137
+ this.bReadonly$ = this.utils.getBooleanValue(this.configProps$['readOnly']);
138
+ }
139
+
140
+ this.componentReference = this.pConn$.getStateProps().value;
141
+
142
+ if (this.label$ != '') {
143
+ this.showLabel$ = true;
144
+ }
145
+
146
+ if (this.value$ === 'true' || this.value$ == true) {
147
+ this.isChecked$ = true;
148
+ } else {
149
+ this.isChecked$ = false;
150
+ }
151
+ }
152
+
153
+ fieldOnChange(event: any) {
154
+ event.value = event.checked;
155
+
156
+ this.angularPConnectData.actions.onChange(this, event);
157
+ }
158
+
159
+ fieldOnClick(event: any) {}
160
+
161
+ fieldOnBlur(event: any) {
162
+ event.value = event.checked;
163
+ this.angularPConnectData.actions.onBlur(this, event);
164
+ }
165
+ }
@@ -0,0 +1,87 @@
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": "images/pz-checkbox-active.svg",
13
+ "properties": [
14
+ {
15
+ "name": "label",
16
+ "label": "Field label",
17
+ "format": "TEXT"
18
+ },
19
+ {
20
+ "name": "hideLabel",
21
+ "label": "Hide Label",
22
+ "format": "BOOLEAN"
23
+ },
24
+ {
25
+ "name": "readOnly",
26
+ "label": "Edit mode",
27
+ "format": "READONLY"
28
+ },
29
+ {
30
+ "label": "Input settings",
31
+ "format": "GROUP",
32
+ "visibility": "(!readOnly = true)",
33
+ "properties": [
34
+ {
35
+ "name": "caption",
36
+ "label": "Caption",
37
+ "format": "TEXT"
38
+ },
39
+ {
40
+ "name": "helperText",
41
+ "label": "Helper text",
42
+ "format": "TEXT"
43
+ }
44
+ ]
45
+ },
46
+ {
47
+ "label": "Conditions",
48
+ "format": "GROUP",
49
+ "properties": [
50
+ {
51
+ "name": "required",
52
+ "label": "Required",
53
+ "format": "REQUIRED",
54
+ "visibility": "(!readOnly = true)"
55
+ },
56
+ {
57
+ "name": "disabled",
58
+ "label": "Disabled",
59
+ "format": "DISABLED",
60
+ "visibility": "(!readOnly = true)"
61
+ },
62
+ {
63
+ "name": "visibility",
64
+ "label": "Visibility",
65
+ "format": "VISIBILITY"
66
+ }
67
+ ]
68
+ },
69
+ {
70
+ "label": "Advanced",
71
+ "format": "GROUP",
72
+ "collapsible": true,
73
+ "properties": [
74
+ {
75
+ "name": "testId",
76
+ "label": "Test ID",
77
+ "format": "TEXT",
78
+ "ignorePattern": "[^-_\\p{N}\\p{L}]",
79
+ "includeAnnotations": false
80
+ }
81
+ ]
82
+ }
83
+ ],
84
+ "defaultConfig": {
85
+ "label": "@L $this.label"
86
+ }
87
+ }
@@ -0,0 +1,56 @@
1
+ import { useState } from 'react';
2
+ import { withKnobs } from '@storybook/addon-knobs';
3
+
4
+ import { configProps, stateProps } from './mock.stories';
5
+
6
+ import {{COMPONENT_CLASS_NAME}} from './index.tsx';
7
+
8
+ export default {
9
+ title: '{{COMPONENT_CLASS_NAME}}',
10
+ decorators: [withKnobs],
11
+ component: {{COMPONENT_CLASS_NAME}}
12
+ };
13
+
14
+ export const Base{{COMPONENT_CLASS_NAME}} = () => {
15
+ const [value, setValue] = useState(configProps.value);
16
+
17
+ const props = {
18
+ value,
19
+ label: configProps.label,
20
+ helperText: configProps.helperText,
21
+ caption: configProps.caption,
22
+ testId: configProps.testId,
23
+ trueLabel: configProps.trueLabel,
24
+ falseLabel: configProps.falseLabel,
25
+
26
+ getPConnect: () => {
27
+ return {
28
+ getStateProps: () => {
29
+ return stateProps;
30
+ },
31
+ getConfigProps: () => {
32
+ return configProps;
33
+ },
34
+ getActionsApi: () => {
35
+ return {
36
+ updateFieldValue: (propName, theValue) => {
37
+ setValue(theValue);
38
+ },
39
+ triggerFieldChange: () => { /* nothing */}
40
+ };
41
+ },
42
+ getValidationApi: () => {
43
+ return {
44
+ validate: () => { /* nothing */}
45
+ };
46
+ }
47
+ };
48
+ }
49
+ };
50
+
51
+ return (
52
+ <>
53
+ <{{COMPONENT_CLASS_NAME}} {...props} />
54
+ </>
55
+ );
56
+ };