@pega/custom-dx-components 23.1.12 → 24.1.10

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 (277) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/src/cli.js +8 -2
  4. package/src/constants.js +9 -0
  5. package/src/tasks/build-all/helper.js +6 -0
  6. package/src/tasks/build-comp/helper.js +8 -0
  7. package/src/tasks/build-jest-assets/index.js +171 -0
  8. package/src/tasks/bundle/builder/webpack.config.js +15 -1
  9. package/src/tasks/create/index.js +3 -0
  10. package/src/tasks/create/templates/Constellation/Field/Boolean/demo.stories.tsx.mustache +3 -13
  11. package/src/tasks/create/templates/Constellation/Field/Boolean/index.tsx.mustache +8 -5
  12. package/src/tasks/create/templates/Constellation/Field/Date/demo.stories.tsx.mustache +8 -19
  13. package/src/tasks/create/templates/Constellation/Field/Date/index.tsx.mustache +1 -1
  14. package/src/tasks/create/templates/Constellation/Field/DateTime/demo.stories.tsx.mustache +7 -18
  15. package/src/tasks/create/templates/Constellation/Field/DateTime/index.tsx.mustache +1 -1
  16. package/src/tasks/create/templates/Constellation/Field/DateTime/mock.ts.mustache +1 -0
  17. package/src/tasks/create/templates/Constellation/Field/Decimal/demo.stories.tsx.mustache +1 -7
  18. package/src/tasks/create/templates/Constellation/Field/Decimal/index.tsx.mustache +1 -1
  19. package/src/tasks/create/templates/Constellation/Field/Decimal/mock.ts.mustache +1 -0
  20. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/demo.stories.tsx.mustache +2 -9
  21. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.tsx.mustache +1 -1
  22. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/mock.ts.mustache +2 -0
  23. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/demo.stories.tsx.mustache +2 -6
  24. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.tsx.mustache +1 -1
  25. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/mock.ts.mustache +1 -0
  26. package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/PConnProps.d.ts.mustache +46 -0
  27. package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/config.json.mustache +64 -0
  28. package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/demo.stories.tsx.mustache +104 -0
  29. package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/index.tsx.mustache +218 -0
  30. package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/mock.ts.mustache +5 -0
  31. package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/styles.ts.mustache +8 -0
  32. package/src/tasks/create/templates/Constellation/Field/Integer/demo.stories.tsx.mustache +2 -6
  33. package/src/tasks/create/templates/Constellation/Field/Integer/index.tsx.mustache +1 -1
  34. package/src/tasks/create/templates/Constellation/Field/Picklist/demo.stories.tsx.mustache +2 -6
  35. package/src/tasks/create/templates/Constellation/Field/Picklist/index.tsx.mustache +1 -1
  36. package/src/tasks/create/templates/Constellation/Field/Picklist/mock.ts.mustache +1 -0
  37. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/demo.stories.tsx.mustache +2 -8
  38. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/index.tsx.mustache +11 -0
  39. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/utils.ts.mustache +3 -0
  40. package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/demo.stories.tsx.mustache +1 -7
  41. package/src/tasks/create/templates/Constellation/Field/Text/demo.stories.tsx.mustache +0 -3
  42. package/src/tasks/create/templates/Constellation/Field/Text/index.tsx.mustache +94 -4
  43. package/src/tasks/create/templates/Constellation/Field/Text-Email/demo.stories.tsx.mustache +1 -5
  44. package/src/tasks/create/templates/Constellation/Field/Text-Email/index.tsx.mustache +1 -1
  45. package/src/tasks/create/templates/Constellation/Field/Text-Input/StatusWork.tsx +3 -9
  46. package/src/tasks/create/templates/Constellation/Field/Text-Input/demo.stories.tsx.mustache +1 -5
  47. package/src/tasks/create/templates/Constellation/Field/Text-Input/index.tsx.mustache +1 -1
  48. package/src/tasks/create/templates/Constellation/Field/Text-Input/mock.ts.mustache +1 -0
  49. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/demo.stories.tsx.mustache +1 -5
  50. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.tsx.mustache +1 -1
  51. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/mock.ts.mustache +1 -0
  52. package/src/tasks/create/templates/Constellation/Field/Text-Phone/demo.stories.tsx.mustache +2 -5
  53. package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.tsx.mustache +1 -1
  54. package/src/tasks/create/templates/Constellation/Field/Text-Phone/mock.ts.mustache +1 -0
  55. package/src/tasks/create/templates/Constellation/Field/Text-URL/demo.stories.tsx.mustache +1 -5
  56. package/src/tasks/create/templates/Constellation/Field/Text-URL/mock.ts.mustache +1 -0
  57. package/src/tasks/create/templates/Constellation/Field/TimeofDay/demo.stories.tsx.mustache +5 -15
  58. package/src/tasks/create/templates/Constellation/Field/TimeofDay/index.tsx.mustache +1 -1
  59. package/src/tasks/create/templates/Constellation/Template/DETAILS/Avatar.tsx.mustache +78 -0
  60. package/src/tasks/create/templates/Constellation/Template/DETAILS/DetailsRender.tsx.mustache +55 -0
  61. package/src/tasks/create/templates/Constellation/Template/DETAILS/HighlightRender.tsx.mustache +49 -0
  62. package/src/tasks/create/templates/Constellation/Template/DETAILS/Operator.tsx.mustache +218 -0
  63. package/src/tasks/create/templates/Constellation/Template/DETAILS/StatusWork.tsx.mustache +17 -19
  64. package/src/tasks/create/templates/Constellation/Template/DETAILS/demo.stories.tsx.mustache +79 -25
  65. package/src/tasks/create/templates/Constellation/Template/DETAILS/index.tsx.mustache +51 -40
  66. package/src/tasks/create/templates/Constellation/Template/DETAILS/mock.ts.mustache +78 -20
  67. package/src/tasks/create/templates/Constellation/Template/DETAILS/styles.ts.mustache +16 -0
  68. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/Avatar.tsx.mustache +78 -0
  69. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/DetailsRender.tsx.mustache +55 -0
  70. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/HighlightRender.tsx.mustache +49 -0
  71. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/Operator.tsx.mustache +218 -0
  72. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/StatusWork.tsx.mustache +17 -19
  73. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/demo.stories.tsx.mustache +96 -27
  74. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.tsx.mustache +42 -39
  75. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/mock.ts.mustache +68 -10
  76. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/styles.ts.mustache +15 -0
  77. package/src/tasks/create/templates/Constellation/Template/FORM/DetailsRender.tsx +59 -0
  78. package/src/tasks/create/templates/Constellation/Template/FORM/demo.stories.tsx.mustache +5 -3
  79. package/src/tasks/create/templates/Constellation/Template/FORM/index.tsx.mustache +31 -5
  80. package/src/tasks/create/templates/Constellation/Template/FORM-region/DetailsRender.tsx +59 -0
  81. package/src/tasks/create/templates/Constellation/Template/FORM-region/demo.stories.tsx.mustache +4 -2
  82. package/src/tasks/create/templates/Constellation/Template/FORM-region/index.tsx.mustache +29 -7
  83. package/src/tasks/create/templates/Constellation/Template/PAGE/GetNextWork.tsx.mustache +2 -1
  84. package/src/tasks/create/templates/Constellation/Template/PAGE/demo.stories.tsx.mustache +4 -3
  85. package/src/tasks/create/templates/Constellation/Template/PAGE/localizations.json.mustache +4 -2
  86. package/src/tasks/create/templates/Constellation/Widget/CASE/demo.stories.tsx.mustache +3 -2
  87. package/src/tasks/create/templates/Constellation/Widget/PAGE/demo.stories.tsx.mustache +91 -13
  88. package/src/tasks/create/templates/Constellation/Widget/PAGE/index.tsx.mustache +67 -5
  89. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/demo.stories.tsx.mustache +5 -4
  90. package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/PConnProps.d.ts.mustache +46 -0
  91. package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/config.json.mustache +32 -0
  92. package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/demo.stories.tsx.mustache +103 -0
  93. package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/index.tsx.mustache +216 -0
  94. package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/mock.ts.mustache +5 -0
  95. package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/styles.ts.mustache +8 -0
  96. package/src/tasks/create/templates/Launchpad/Widget/PAGE/OneColumnPage.svg +36 -0
  97. package/src/tasks/create/templates/Launchpad/Widget/PAGE/PConnProps.d.ts.mustache +46 -0
  98. package/src/tasks/create/templates/Launchpad/Widget/PAGE/config.json.mustache +59 -0
  99. package/src/tasks/create/templates/Launchpad/Widget/PAGE/demo.stories.tsx.mustache +120 -0
  100. package/src/tasks/create/templates/Launchpad/Widget/PAGE/index.tsx.mustache +109 -0
  101. package/src/tasks/create/templates/Launchpad/Widget/PAGE/mock.ts.mustache +25 -0
  102. package/src/tasks/create/templates/Launchpad/Widget/PAGE/styles.ts.mustache +8 -0
  103. package/src/tasks/create-all/index.js +3 -0
  104. package/src/tasks/index.js +1 -0
  105. package/src/tasks/init/template/.storybook/preview.js +3 -0
  106. package/src/tasks/init/template/package.json.mustache +7 -6
  107. package/src/tasks/init/template/tsconfig.build.json +3 -1
  108. package/src/tasks/publish/helper.js +6 -0
  109. package/src/tasks/publish-all/helper.js +6 -0
  110. package/src/tasks/validator/index.js +7 -1
  111. package/src/util.js +18 -0
  112. package/tests/assets/components/create/Pega_DXIL_MyDetails.zip +0 -0
  113. package/tests/assets/components/create/Pega_DXIL_MyTestText/demo.stories.tsx +0 -3
  114. package/tests/assets/components/create/Pega_DXIL_MyTestText/index.tsx +94 -4
  115. package/tests/assets/components/create/_components.md +1 -0
  116. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/demo.stories.tsx +3 -13
  117. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/index.tsx +8 -5
  118. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/demo.stories.tsx +3 -2
  119. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/demo.stories.tsx +2 -9
  120. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/index.tsx +1 -1
  121. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/mock.ts +2 -0
  122. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/demo.stories.tsx +8 -19
  123. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/index.tsx +1 -1
  124. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/demo.stories.tsx +7 -18
  125. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/index.tsx +1 -1
  126. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/mock.ts +1 -0
  127. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/demo.stories.tsx +1 -7
  128. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/index.tsx +1 -1
  129. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/mock.ts +1 -0
  130. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/Avatar.tsx +78 -0
  131. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/DetailsRender.tsx +52 -0
  132. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/HighlightRender.tsx +46 -0
  133. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/Operator.tsx +215 -0
  134. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/StatusWork.tsx +17 -19
  135. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/demo.stories.tsx +79 -25
  136. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/index.tsx +48 -37
  137. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/mock.ts +78 -20
  138. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/styles.ts +16 -0
  139. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails.zip +0 -0
  140. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyEmail/demo.stories.tsx +1 -5
  141. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyEmail/index.tsx +1 -1
  142. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/DetailsRender.tsx +59 -0
  143. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/demo.stories.tsx +5 -3
  144. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/index.tsx +28 -5
  145. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/PConnProps.d.ts +46 -0
  146. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/config.json +64 -0
  147. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +104 -0
  148. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/index.tsx +215 -0
  149. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/mock.ts +5 -0
  150. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/styles.ts +8 -0
  151. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/demo.stories.tsx +2 -6
  152. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/index.tsx +1 -1
  153. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/GetNextWork.tsx +2 -1
  154. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/demo.stories.tsx +4 -3
  155. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/localizations.json +4 -2
  156. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/demo.stories.tsx +5 -4
  157. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageWidget/demo.stories.tsx +91 -13
  158. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageWidget/index.tsx +67 -5
  159. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/demo.stories.tsx +1 -5
  160. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/index.tsx +1 -1
  161. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/mock.ts +1 -0
  162. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/demo.stories.tsx +2 -6
  163. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/index.tsx +1 -1
  164. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/mock.ts +1 -0
  165. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/demo.stories.tsx +2 -5
  166. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/index.tsx +1 -1
  167. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/mock.ts +1 -0
  168. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/demo.stories.tsx +2 -6
  169. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/index.tsx +1 -1
  170. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/mock.ts +1 -0
  171. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyRadioButtons/demo.stories.tsx +1 -7
  172. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/demo.stories.tsx +2 -8
  173. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/index.tsx +11 -0
  174. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/utils.ts +3 -0
  175. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyText/demo.stories.tsx +0 -3
  176. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyText/index.tsx +94 -4
  177. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/StatusWork.tsx +3 -9
  178. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/demo.stories.tsx +1 -5
  179. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/index.tsx +1 -1
  180. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/mock.ts +1 -0
  181. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/demo.stories.tsx +5 -15
  182. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/index.tsx +1 -1
  183. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/Avatar.tsx +78 -0
  184. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/DetailsRender.tsx +52 -0
  185. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/HighlightRender.tsx +46 -0
  186. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/Operator.tsx +215 -0
  187. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/StatusWork.tsx +17 -19
  188. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +96 -27
  189. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/index.tsx +39 -36
  190. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/mock.ts +68 -10
  191. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/styles.ts +15 -0
  192. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/DetailsRender.tsx +59 -0
  193. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +4 -2
  194. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/index.tsx +23 -4
  195. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/demo.stories.tsx +1 -5
  196. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/mock.ts +1 -0
  197. package/tests/assets/components/createAll/Constellation/_components.md +1 -0
  198. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/demo.stories.tsx +3 -13
  199. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/index.tsx +8 -5
  200. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/demo.stories.tsx +2 -9
  201. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/index.tsx +1 -1
  202. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/mock.ts +2 -0
  203. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/demo.stories.tsx +8 -19
  204. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/index.tsx +1 -1
  205. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/demo.stories.tsx +7 -18
  206. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/index.tsx +1 -1
  207. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/mock.ts +1 -0
  208. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/demo.stories.tsx +1 -7
  209. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/index.tsx +1 -1
  210. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/mock.ts +1 -0
  211. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/Avatar.tsx +78 -0
  212. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/DetailsRender.tsx +52 -0
  213. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/HighlightRender.tsx +46 -0
  214. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/Operator.tsx +215 -0
  215. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/StatusWork.tsx +17 -19
  216. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/demo.stories.tsx +79 -25
  217. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/index.tsx +48 -37
  218. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/mock.ts +78 -20
  219. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/styles.ts +16 -0
  220. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails.zip +0 -0
  221. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyEmail/demo.stories.tsx +1 -5
  222. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyEmail/index.tsx +1 -1
  223. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/DetailsRender.tsx +59 -0
  224. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/demo.stories.tsx +5 -3
  225. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/index.tsx +28 -5
  226. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/PConnProps.d.ts +46 -0
  227. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/config.json +32 -0
  228. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +103 -0
  229. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/index.tsx +213 -0
  230. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/mock.ts +5 -0
  231. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/styles.ts +8 -0
  232. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyInteger/demo.stories.tsx +2 -6
  233. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyInteger/index.tsx +1 -1
  234. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/GetNextWork.tsx +2 -1
  235. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/demo.stories.tsx +4 -3
  236. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/localizations.json +4 -2
  237. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/demo.stories.tsx +88 -9
  238. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/index.tsx +67 -5
  239. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/demo.stories.tsx +1 -5
  240. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/index.tsx +1 -1
  241. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/mock.ts +1 -0
  242. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/demo.stories.tsx +2 -6
  243. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/index.tsx +1 -1
  244. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/mock.ts +1 -0
  245. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/demo.stories.tsx +2 -5
  246. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/index.tsx +1 -1
  247. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/mock.ts +1 -0
  248. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/demo.stories.tsx +2 -6
  249. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/index.tsx +1 -1
  250. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/mock.ts +1 -0
  251. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyRadioButtons/demo.stories.tsx +1 -7
  252. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/demo.stories.tsx +2 -8
  253. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/index.tsx +11 -0
  254. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/utils.ts +3 -0
  255. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyText/demo.stories.tsx +0 -3
  256. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyText/index.tsx +94 -4
  257. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/StatusWork.tsx +3 -9
  258. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/demo.stories.tsx +1 -5
  259. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/index.tsx +1 -1
  260. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/mock.ts +1 -0
  261. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/demo.stories.tsx +5 -15
  262. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/index.tsx +1 -1
  263. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/Avatar.tsx +78 -0
  264. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/DetailsRender.tsx +52 -0
  265. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/HighlightRender.tsx +46 -0
  266. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/Operator.tsx +215 -0
  267. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/StatusWork.tsx +17 -19
  268. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +96 -27
  269. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/index.tsx +39 -36
  270. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/mock.ts +68 -10
  271. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/styles.ts +15 -0
  272. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/DetailsRender.tsx +59 -0
  273. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +4 -2
  274. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/index.tsx +23 -4
  275. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/demo.stories.tsx +1 -5
  276. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/mock.ts +1 -0
  277. package/tests/assets/components/createAll/Launchpad/_components.md +1 -0
@@ -0,0 +1,46 @@
1
+ import {PConnect } from '@pega/pcore-pconnect-typedefs';
2
+
3
+ // PConnProps.d.ts
4
+ // This gives us a place to have each component (which is most DX Components) that is
5
+ // expected to have a getPConnect extend its props (from BaseProps)
6
+ // such that every component will be expected to have a getPConnect() function
7
+ // that returns a PConnect object. (new/better way of doing .propTypes).
8
+ // This PConnProps can be extended to include other props that we know are in every component
9
+ export interface PConnProps {
10
+ // getPConnect should exist for every C11n component. (add @ts-ignore in special cases where it isn't)
11
+ getPConnect: () => typeof PConnect;
12
+
13
+ // Allow any/all other key/value pairs in the BaseProps for now
14
+ // TODO: refine which other props are always expected for various component
15
+ // types and consider further interface "subclassing". For example, we may
16
+ // want to create a "BasePropsForm" that gives guidance on required, readonly, etc.
17
+ // and any other props that every Form component expects.
18
+ // For example, see the PConnFieldProps below.
19
+ // NOTE: if you uncomment the line below, the PConnProps type will allow
20
+ // otherwise undefined types to appear. This can be helpful for debugging
21
+ // or when adding new components whose types aren't yet known.
22
+ // [key: string]: any;
23
+ }
24
+
25
+
26
+ // PConnFieldProps extends PConnProps to bring in the common properties that are
27
+ // associated with most field components (ex: Dropdown, TextInput, etc.) in the
28
+ // components/field directory
29
+ export interface PConnFieldProps extends PConnProps {
30
+ label: string,
31
+ required: boolean,
32
+ disabled: boolean,
33
+ value: any,
34
+ validatemessage: string,
35
+ status?: string,
36
+ onChange?: any,
37
+ onBlur?: any,
38
+ readOnly: boolean,
39
+ testId: string,
40
+ helperText: string,
41
+ displayMode?: string,
42
+ hideLabel: boolean,
43
+ placeholder?: string,
44
+ fieldMetadata?: any,
45
+ additionalProps?: any
46
+ }
@@ -0,0 +1,64 @@
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-url-active.svg",
13
+ "properties": [
14
+ {
15
+ "format": "SELECT",
16
+ "name": "countryCode",
17
+ "label": "Country code",
18
+ "defaultValue": "USA",
19
+ "source": [
20
+ {
21
+ "key": "USA",
22
+ "value": "United States"
23
+ },
24
+ {
25
+ "key": "CAN",
26
+ "value": "Canada"
27
+ },
28
+ {
29
+ "key": "AUS",
30
+ "value": "Australia"
31
+ },
32
+ {
33
+ "key": "JPN",
34
+ "value": "Japan"
35
+ },
36
+ {
37
+ "key": "IND",
38
+ "value": "India"
39
+ },
40
+ {
41
+ "key": "TUR",
42
+ "value": "Turkey"
43
+ }
44
+ ]
45
+ },
46
+ {
47
+ "label": "Advanced",
48
+ "format": "GROUP",
49
+ "collapsible": true,
50
+ "properties": [
51
+ {
52
+ "name": "testId",
53
+ "label": "Test ID",
54
+ "format": "TEXT",
55
+ "ignorePattern": "[^-_\\p{N}\\p{L}]",
56
+ "includeAnnotations": false
57
+ }
58
+ ]
59
+ }
60
+ ],
61
+ "defaultConfig": {
62
+ "label": "@L $this.label"
63
+ }
64
+ }
@@ -0,0 +1,104 @@
1
+
2
+ /* eslint-disable react/jsx-no-useless-fragment */
3
+ // @ts-nocheck
4
+ import type { Meta, StoryObj } from '@storybook/react';
5
+
6
+ import {{COMPONENT_CLASS_NAME}} from './index';
7
+ import { stateProps, configProps } from './mock';
8
+
9
+ const meta: Meta<typeof {{COMPONENT_CLASS_NAME}}> = {
10
+ title: '{{COMPONENT_CLASS_NAME}}',
11
+ component: {{COMPONENT_CLASS_NAME}},
12
+ excludeStories: /.*Data$/
13
+ };
14
+
15
+ export default meta;
16
+ type Story = StoryObj<typeof {{COMPONENT_CLASS_NAME}}>;
17
+
18
+ if (!window.PCore) {
19
+ window.PCore = {};
20
+ }
21
+
22
+ const statelistData = {
23
+ data: [
24
+ {
25
+ pyLabel: 'Massachusetts',
26
+ pyStateCode: 'MA'
27
+ },
28
+ {
29
+ pyLabel: 'Rhode Island',
30
+ pyStateCode: 'RI'
31
+ },
32
+ {
33
+ pyLabel: 'Connecticut',
34
+ pyStateCode: 'CT'
35
+ }
36
+ ]
37
+ };
38
+
39
+ window.PCore.getDataPageUtils = () => {
40
+ return {
41
+ getData: () => {
42
+ return new Promise(resolve => {
43
+ resolve(statelistData);
44
+ });
45
+ },
46
+ getDataAsync: () => {
47
+ return new Promise(resolve => {
48
+ resolve(statelistData);
49
+ });
50
+ }
51
+ };
52
+ };
53
+
54
+ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
55
+
56
+ const props = {
57
+ countryCode: configProps.countryCode,
58
+ getPConnect: () => {
59
+ return {
60
+ getValue: value => {
61
+ return value;
62
+ },
63
+ getContextName: () => {
64
+ return 'app/primary_1';
65
+ },
66
+ getLocalizedValue: value => {
67
+ return value;
68
+ },
69
+ getActionsApi: () => {
70
+ return {
71
+ updateFieldValue: () => {
72
+ /* nothing */
73
+ },
74
+ triggerFieldChange: () => {
75
+ /* nothing */
76
+ }
77
+ };
78
+ },
79
+ ignoreSuggestion: () => {
80
+ /* nothing */
81
+ },
82
+ acceptSuggestion: () => {
83
+ /* nothing */
84
+ },
85
+ setInheritedProps: () => {
86
+ /* nothing */
87
+ },
88
+ resolveConfigProps: () => {
89
+ /* nothing */
90
+ }
91
+ };
92
+ }
93
+ };
94
+
95
+ return (
96
+ <>
97
+ <{{COMPONENT_CLASS_NAME}} {...props} {...args} />
98
+ </>
99
+ );
100
+ };
101
+
102
+ Base{{COMPONENT_CLASS_NAME}}.args = {
103
+ countryCode: configProps.countryCode
104
+ };
@@ -0,0 +1,218 @@
1
+ import { useEffect, useState } from 'react';
2
+ import {
3
+ Icon,
4
+ Button,
5
+ withConfiguration,
6
+ registerIcon,
7
+ Table,
8
+ Label,
9
+ Link,
10
+ URLDisplay
11
+ } from '@pega/cosmos-react-core';
12
+ import type { PConnFieldProps } from './PConnProps';
13
+
14
+ // IMPORTANT
15
+ // To use Icons, need to individually import the icon file form @pega/cosmos-react-core (see path below)
16
+ // Icons filename is kabab case (file-name), where as the icon you import is camel case (fileName)
17
+ // Icons need to be registered (camel case), and then used (kabab case)
18
+ import * as listNumber from '@pega/cosmos-react-core/lib/components/Icon/icons/list-number.icon';
19
+ import * as arrowRight from '@pega/cosmos-react-core/lib/components/Icon/icons/arrow-right.icon';
20
+ import * as globe from '@pega/cosmos-react-core/lib/components/Icon/icons/globe.icon';
21
+
22
+ import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
23
+
24
+ // interface for props
25
+ interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
26
+ // If any, enter additional props that only exist on TextInput here
27
+ countryCode: string;
28
+ }
29
+
30
+ export const textFormatter = (value: string) => {
31
+ const displayComponent = (
32
+ <URLDisplay target='_blank' value={value} displayText={value} variant='link' />
33
+ );
34
+
35
+ return displayComponent;
36
+ };
37
+
38
+ // *************
39
+ // This component is meant to be an example of usage (Icon, Button, Link, etc.) and NOT meant to be
40
+ // used "as is"
41
+ //
42
+ // In this example, Icon is shown on its own and inside a Button
43
+ // Though an Icon can have an "onClick" event is it recommended if you want to click on it,
44
+ // to put it in a Button (shown below), so you can have a tooltip and hover style or put it
45
+ // in a Link (shown below) as a URL.
46
+ //
47
+ // For the button, the click will get a list of states for a given country and display in a
48
+ // table below. The table display will toggle with the click of the button icon. Example shows
49
+ // how to handle click, retrieve data from PCore and display it.
50
+ //
51
+ // Globe icon is an icon placed in a Link element. The Link element to use an icon internally. (NOTE: In general
52
+ // the Link element shows the open icon to the left of the link text, but here we are using
53
+ // another icon, so with "icon" specified in the Link element, the open icon doesn't show)
54
+ // Link elements do not handle bad urls well, so we have a simple validator to prevent the Link element
55
+ // from getting most bad urls.
56
+ //
57
+ // NOTE: because icons have to be imported and registered, you can NOT put the icon name
58
+ // inside the config.json and let the user pick it, if it is not already part of your
59
+ // import and registration (can't be done on the fly)
60
+ // **************
61
+
62
+ // props passed in combination of props from property panel (config.json) and run time props from Constellation
63
+ // any default values in config.pros should be set in defaultProps at bottom of this file
64
+ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
65
+ const { value, displayMode, countryCode = 'USA', getPConnect, testId } = props;
66
+ const [statelist, setStatelist] = useState([]);
67
+ const [showTable, setShowTable] = useState(false);
68
+ const [isLoading, setIsLoading] = useState(true);
69
+ const [validUrl, setValidUrl] = useState('about:blank');
70
+ const PConnect = getPConnect();
71
+ const dataViewName = 'D_pyStateList';
72
+ const context = PConnect.getContextName();
73
+
74
+ // IMPORTANT: need to register icons used in camel case
75
+ registerIcon(listNumber, arrowRight, globe);
76
+
77
+
78
+ // setting up columns for the work list table
79
+ const columns = [
80
+ { renderer: 'stateName', label: PConnect.getLocalizedValue('State name', '', '') },
81
+ { renderer: 'stateCode', label: PConnect.getLocalizedValue('State code', '', '') }
82
+ ];
83
+
84
+ // toggle showing table and getting table data
85
+ function showHideTable() {
86
+ setShowTable(prevShowTable => !prevShowTable);
87
+ }
88
+
89
+ // check if url is valid (simple)
90
+ function validateUrl(href: string) {
91
+ return /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(
92
+ href
93
+ );
94
+ }
95
+
96
+ // Testing to see if value entered is valid url, if not can't use it.
97
+ // Reason for this code is that you can NOT pass to Link component
98
+ // a bad url, or it will error out.
99
+ // For example: Since the value is the property field,
100
+ // it could be entered from another component and thus as it is
101
+ // entered (typed in), it won't be valid until it is all entered.
102
+ // NOTE: can't have a blank value for the url as the Link element will error out
103
+ // in App studio preview
104
+ useEffect(() => {
105
+ if (validateUrl(value)) {
106
+ setValidUrl(value);
107
+ } else {
108
+ setValidUrl('about:blank');
109
+ }
110
+ }, [value]);
111
+
112
+ // going to get data for worklist to put into a table
113
+ // data comes from calling a PCore function to get
114
+ // get data from a data page and a PConnect function
115
+ // to get getContextName
116
+ useEffect(() => {
117
+ const params = { pyCountry: countryCode };
118
+
119
+ // only retrieve table data if table is shown
120
+ if (showTable) {
121
+ PCore.getDataPageUtils()
122
+ .getDataAsync(dataViewName, context, params, null, null)
123
+ // @ts-ignore
124
+ .then((response: any) => {
125
+ setIsLoading(false);
126
+ // table requires an index or will get setExtraStackFrame error
127
+ if (response.data !== null) {
128
+ setStatelist(
129
+ response.data.map((entry: any, index: number) => {
130
+ // mapping the data into the column names
131
+ // MUST have an id/index or will get a setExtraStackFrame error
132
+ // put a key in the table
133
+ return {
134
+ stateName: entry.pyLabel,
135
+ stateCode: entry.pyStateCode,
136
+ id: index
137
+ };
138
+ })
139
+ );
140
+ } else {
141
+ setStatelist([]);
142
+ setIsLoading(false);
143
+ }
144
+ })
145
+ .catch((error: any) => {
146
+ setStatelist([]);
147
+ setIsLoading(false);
148
+ console.log(error);
149
+ });
150
+ }
151
+ }, [context, countryCode, showTable]);
152
+
153
+ // when DISPLAY_ONLY, in this example we will just show the URL.
154
+ if (displayMode === 'DISPLAY_ONLY') {
155
+ const displayComp = textFormatter(validUrl);
156
+ return (
157
+ <Styled{{COMPONENT_CLASS_NAME}}Wrapper> {displayComp} </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
158
+ );
159
+ }
160
+
161
+ return (
162
+ <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
163
+ {{! pick new delimiters for mustache }}
164
+ {{=<% %>=}}
165
+ <div style={{ display: 'flex' }} data-testid={testId}>
166
+ <Icon
167
+ style={{ height: '1.5rem', width: '1.5rem' }}
168
+ // icon name is kabab case
169
+ name='arrow-right'
170
+ role='img'
171
+ aria-label='arrow right'
172
+ />
173
+ <Label style={{ margin: '0.1rem' }}>
174
+ {' '}
175
+ {PConnect.getLocalizedValue('State list for', '', '')}{' '}
176
+ {PConnect.getLocalizedValue(`${countryCode}`, '', '')}{' '}
177
+ </Label>
178
+ <Button
179
+ icon
180
+ label={PConnect.getLocalizedValue('Click to show/hide state list', '', '')}
181
+ variant='link'
182
+ compact={false}
183
+ onClick={showHideTable}
184
+ >
185
+ <Icon
186
+ style={{ height: '1.5rem', width: '1.5rem' }}
187
+ // icon name is kabab case
188
+ name='list-number'
189
+ role='img'
190
+ aria-label='numbered list'
191
+ />
192
+ </Button>
193
+ <Link href={validUrl} variant='link' label={validUrl} icon>
194
+ <Icon
195
+ style={{ height: '1.5rem', width: '1.5rem' }}
196
+ // icon name is kabab case
197
+ name='globe'
198
+ role='img'
199
+ aria-label='open link'
200
+ />
201
+ </Link>
202
+ </div>
203
+ {showTable && (
204
+ <Table
205
+ title={PConnect.getLocalizedValue('State list', '', '')}
206
+ columns={columns}
207
+ data={statelist}
208
+ loading={isLoading}
209
+ loadingMessage={PConnect.getLocalizedValue('Loading state list', '', '')}
210
+ />
211
+ )}
212
+ <%={{ }}=%> {{! revert delimiters for mustache }}
213
+ </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
214
+ );
215
+ }
216
+
217
+
218
+ export default withConfiguration({{COMPONENT_CLASS_NAME}});
@@ -0,0 +1,5 @@
1
+
2
+ // @ts-nocheck
3
+ export const configProps = {
4
+ countryCode: 'USA'
5
+ };
@@ -0,0 +1,8 @@
1
+ // individual style, comment out above, and uncomment here and add styles
2
+ import styled, { css } from 'styled-components';
3
+
4
+ export default styled.div(() => {
5
+ return css`
6
+ margin: 0px 0;
7
+ `;
8
+ });
@@ -19,14 +19,8 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
19
19
 
20
20
  const props = {
21
21
  value: configProps.value,
22
- placeholder: configProps.placeholder,
23
- label: configProps.label,
24
- helperText: configProps.helperText,
25
- showGroupSeparators: configProps.showGroupSeparators,
26
22
  hasSuggestions: configProps.hasSuggestions,
27
- testId: configProps.testId,
28
23
  fieldMetadata,
29
- validatemessage: '',
30
24
  getPConnect: () => {
31
25
  return {
32
26
  getStateProps: () => {
@@ -56,6 +50,7 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
56
50
  Base{{COMPONENT_CLASS_NAME}}.args = {
57
51
  label: configProps.label,
58
52
  helperText: configProps.helperText,
53
+ placeholder: configProps.placeholder,
59
54
  showGroupSeparators: configProps.showGroupSeparators,
60
55
  testId: configProps.testId,
61
56
  readOnly: configProps.readOnly,
@@ -64,5 +59,6 @@ Base{{COMPONENT_CLASS_NAME}}.args = {
64
59
  status: configProps.status,
65
60
  hideLabel: configProps.hideLabel,
66
61
  displayMode: configProps.displayMode,
62
+ variant: configProps.variant,
67
63
  validatemessage: configProps.validatemessage
68
64
  };
@@ -187,7 +187,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
187
187
 
188
188
  switch (displayMode) {
189
189
  case 'DISPLAY_ONLY': {
190
- return (<Styled{{COMPONENT_CLASS_NAME}}Wrapper> displayComp </Styled{{COMPONENT_CLASS_NAME}}Wrapper>);
190
+ return (<Styled{{COMPONENT_CLASS_NAME}}Wrapper> {displayComp} </Styled{{COMPONENT_CLASS_NAME}}Wrapper>);
191
191
  }
192
192
  case 'LABELS_LEFT': {
193
193
  return (
@@ -23,14 +23,8 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
23
23
 
24
24
  const props = {
25
25
  value,
26
- placeholder: configProps.placeholder,
27
- label: configProps.label,
28
- helperText: configProps.helperText,
29
- datasource: configProps.datasource,
30
- testId: configProps.testId,
31
26
  hasSuggestions: configProps.hasSuggestions,
32
27
  fieldMetadata,
33
- validatemessage: '',
34
28
  getPConnect: () => {
35
29
  return {
36
30
  getConfigProps: () => {
@@ -84,6 +78,7 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
84
78
  };
85
79
 
86
80
  Base{{COMPONENT_CLASS_NAME}}.args = {
81
+ datasource: configProps.datasource,
87
82
  label: configProps.label,
88
83
  helperText: configProps.helperText,
89
84
  placeholder: configProps.placeholder,
@@ -94,5 +89,6 @@ Base{{COMPONENT_CLASS_NAME}}.args = {
94
89
  status: configProps.status,
95
90
  hideLabel: configProps.hideLabel,
96
91
  displayMode: configProps.displayMode,
92
+ variant: configProps.variant,
97
93
  validatemessage: configProps.validatemessage
98
94
  };
@@ -256,7 +256,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
256
256
 
257
257
  return displayMode === 'DISPLAY_ONLY' ? (
258
258
  <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
259
- displayComp
259
+ {displayComp}
260
260
  </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
261
261
  ) : (
262
262
  <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
@@ -22,6 +22,7 @@ export const configProps = {
22
22
  testId: 'picklist-12345678',
23
23
  hasSuggestions: false,
24
24
  displayMode: '',
25
+ variant: '',
25
26
  hideLabel: false,
26
27
  readOnly: false,
27
28
  required: false,
@@ -24,19 +24,11 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
24
24
 
25
25
  const props = {
26
26
  value,
27
- placeholder: configProps.placeholder,
28
- label: configProps.label,
29
- helperText: configProps.helperText,
30
- datasource: configProps.datasource,
31
- testId: configProps.testId,
32
27
  hasSuggestions: configProps.hasSuggestions,
33
28
  columns: [],
34
- isTableFormatter: false,
35
29
  listType: 'associated',
36
- parameters: {},
37
30
  datasourceMetadata,
38
31
  fieldMetadata,
39
- validatemessage: '',
40
32
  getPConnect: () => {
41
33
  return {
42
34
  getConfigProps: () => {
@@ -93,9 +85,11 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
93
85
  };
94
86
 
95
87
  Base{{COMPONENT_CLASS_NAME}}.args = {
88
+ datasource: configProps.datasource,
96
89
  label: configProps.label,
97
90
  helperText: configProps.helperText,
98
91
  placeholder: configProps.placeholder,
92
+ parameters: {},
99
93
  isTableFormatter: false,
100
94
  testId: configProps.testId,
101
95
  readOnly: configProps.readOnly,
@@ -645,12 +645,14 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
645
645
  PCore.getDataApi()
646
646
  .init(dataConfig, contextName)
647
647
  .then(dataObj => {
648
+ // @ts-ignore
648
649
  setDataApiObj(dataObj);
649
650
  // To avoid calling doSearch if someone types/pastes value before the API call is made
650
651
  if (!filterValue)
651
652
  doSearch(
652
653
  '',
653
654
  getDisplayFieldsMetaData(dataConfig.columns),
655
+ // @ts-ignore
654
656
  dataObj,
655
657
  setItems as any,
656
658
  setLoading,
@@ -677,6 +679,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
677
679
  PCore.getDataApi()
678
680
  .init(dataConfig, contextName)
679
681
  .then(dataObj => {
682
+ // @ts-ignore
680
683
  setDataApiObj(dataObj);
681
684
  // To avoid calling doSearch if someone types/pastes value before the API call is made
682
685
  if (!filterValue) {
@@ -692,6 +695,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
692
695
  doSearch(
693
696
  '',
694
697
  getDisplayFieldsMetaData(dataConfig.columns),
698
+ // @ts-ignore
695
699
  dataObj,
696
700
  setItems as any,
697
701
  setLoading,
@@ -711,6 +715,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
711
715
  doSearch(
712
716
  '',
713
717
  getDisplayFieldsMetaData(dataConfig.columns),
718
+ // @ts-ignore
714
719
  dataObj,
715
720
  setItems as any,
716
721
  setLoading,
@@ -770,10 +775,14 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
770
775
  PCore.getDataApi()
771
776
  .init(dataConfig, contextName)
772
777
  .then(dataObj => {
778
+ // @ts-ignore
773
779
  setDataApiObj(dataObj);
780
+ // @ts-ignore
774
781
  buildColumnForDisplayValue(dataObj);
775
782
  // SET matchPosition to EQUALS to return exact matching record
783
+ // @ts-ignore
776
784
  dataObj.matchPosition = 'equals';
785
+ // @ts-ignore
777
786
  dataObj
778
787
  .fetchData(value)
779
788
  .then((displayResponse: { data: Array<never> }) => {
@@ -822,11 +831,13 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
822
831
  setSelected(searchedItem[0]);
823
832
  setActualValue(value);
824
833
  // RESET matchPosition
834
+ // @ts-ignore
825
835
  dataObj.matchPosition = dataConfig.matchPosition;
826
836
  })
827
837
  .catch(() => {
828
838
  setActualValue(value);
829
839
  // RESET matchPosition
840
+ // @ts-ignore
830
841
  dataObj.matchPosition = dataConfig.matchPosition;
831
842
  });
832
843
  });
@@ -181,7 +181,9 @@ export const updatePropertiesForNewRecord = (
181
181
  setDataApiObj(dataObj);
182
182
  buildColumnForDisplayValue(dataObj);
183
183
  // SET matchPosition to EQUALS to return exact matching record
184
+ // @ts-ignore
184
185
  dataObj.matchPosition = 'equals';
186
+ // @ts-ignore
185
187
  dataObj
186
188
  .fetchData(newCaseId)
187
189
  // @ts-ignore
@@ -212,6 +214,7 @@ export const updatePropertiesForNewRecord = (
212
214
  })
213
215
  .finally(() => {
214
216
  // RESET matchPosition
217
+ // @ts-ignore
215
218
  dataObj.matchPosition = dataConfig.matchPosition;
216
219
  });
217
220
  });
@@ -23,15 +23,8 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
23
23
 
24
24
  const props = {
25
25
  value,
26
- placeholder: configProps.placeholder,
27
- label: configProps.label,
28
- helperText: configProps.helperText,
29
- datasource: configProps.datasource,
30
- inline: configProps.inline,
31
- testId: configProps.testId,
32
26
  hasSuggestions: configProps.hasSuggestions,
33
27
  fieldMetadata,
34
- validatemessage: '',
35
28
  getPConnect: () => {
36
29
  return {
37
30
  getConfigProps: () => {
@@ -88,6 +81,7 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
88
81
  };
89
82
 
90
83
  Base{{COMPONENT_CLASS_NAME}}.args = {
84
+ datasource: configProps.datasource,
91
85
  label: configProps.label,
92
86
  helperText: configProps.helperText,
93
87
  placeholder: configProps.placeholder,