@pega/react-sdk-components 0.23.26 → 8.8.20

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 (553) hide show
  1. package/lib/bridge/Context/StoreContext.d.ts +3 -2
  2. package/lib/bridge/Context/StoreContext.d.ts.map +1 -1
  3. package/lib/bridge/Context/StoreContext.js +2 -3
  4. package/lib/bridge/Context/StoreContext.js.map +1 -1
  5. package/lib/bridge/helpers/sdk_component_map.d.ts +1 -0
  6. package/lib/bridge/helpers/sdk_component_map.d.ts.map +1 -1
  7. package/lib/bridge/helpers/sdk_component_map.js +22 -0
  8. package/lib/bridge/helpers/sdk_component_map.js.map +1 -1
  9. package/lib/bridge/react_pconnect.d.ts.map +1 -1
  10. package/lib/bridge/react_pconnect.js +2 -14
  11. package/lib/bridge/react_pconnect.js.map +1 -1
  12. package/lib/components/designSystemExtension/AlertBanner/AlertBanner.d.ts +10 -0
  13. package/lib/components/designSystemExtension/AlertBanner/AlertBanner.d.ts.map +1 -0
  14. package/lib/components/designSystemExtension/AlertBanner/AlertBanner.js +19 -0
  15. package/lib/components/designSystemExtension/AlertBanner/AlertBanner.js.map +1 -0
  16. package/lib/components/designSystemExtension/AlertBanner/index.d.ts +2 -0
  17. package/lib/components/designSystemExtension/AlertBanner/index.d.ts.map +1 -0
  18. package/lib/components/designSystemExtension/AlertBanner/index.js +2 -0
  19. package/lib/components/designSystemExtension/AlertBanner/index.js.map +1 -0
  20. package/lib/components/designSystemExtension/Banner/Banner.d.ts +15 -1
  21. package/lib/components/designSystemExtension/Banner/Banner.d.ts.map +1 -1
  22. package/lib/components/designSystemExtension/Banner/Banner.js.map +1 -1
  23. package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.d.ts +6 -9
  24. package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.d.ts.map +1 -1
  25. package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.js +3 -7
  26. package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.js.map +1 -1
  27. package/lib/components/designSystemExtension/DetailsFields/DetailsFields.d.ts +4 -10
  28. package/lib/components/designSystemExtension/DetailsFields/DetailsFields.d.ts.map +1 -1
  29. package/lib/components/designSystemExtension/DetailsFields/DetailsFields.js +1 -8
  30. package/lib/components/designSystemExtension/DetailsFields/DetailsFields.js.map +1 -1
  31. package/lib/components/designSystemExtension/FieldGroup/FieldGroup.d.ts +6 -2
  32. package/lib/components/designSystemExtension/FieldGroup/FieldGroup.d.ts.map +1 -1
  33. package/lib/components/designSystemExtension/FieldGroup/FieldGroup.js +3 -3
  34. package/lib/components/designSystemExtension/FieldGroup/FieldGroup.js.map +1 -1
  35. package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.d.ts +7 -2
  36. package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.d.ts.map +1 -1
  37. package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.js +4 -4
  38. package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.js.map +1 -1
  39. package/lib/components/designSystemExtension/FieldValueList/FieldValueList.d.ts +7 -2
  40. package/lib/components/designSystemExtension/FieldValueList/FieldValueList.d.ts.map +1 -1
  41. package/lib/components/designSystemExtension/FieldValueList/FieldValueList.js +3 -3
  42. package/lib/components/designSystemExtension/FieldValueList/FieldValueList.js.map +1 -1
  43. package/lib/components/designSystemExtension/Operator/Operator.d.ts +17 -7
  44. package/lib/components/designSystemExtension/Operator/Operator.d.ts.map +1 -1
  45. package/lib/components/designSystemExtension/Operator/Operator.js +13 -16
  46. package/lib/components/designSystemExtension/Operator/Operator.js.map +1 -1
  47. package/lib/components/designSystemExtension/Pulse/Pulse.d.ts +5 -1
  48. package/lib/components/designSystemExtension/Pulse/Pulse.d.ts.map +1 -1
  49. package/lib/components/designSystemExtension/Pulse/Pulse.js +3 -6
  50. package/lib/components/designSystemExtension/Pulse/Pulse.js.map +1 -1
  51. package/lib/components/designSystemExtension/RichTextEditor/RichTextEditor.d.ts +19 -0
  52. package/lib/components/designSystemExtension/RichTextEditor/RichTextEditor.d.ts.map +1 -0
  53. package/lib/components/designSystemExtension/RichTextEditor/RichTextEditor.js +77 -0
  54. package/lib/components/designSystemExtension/RichTextEditor/RichTextEditor.js.map +1 -0
  55. package/lib/components/designSystemExtension/RichTextEditor/index.d.ts +2 -0
  56. package/lib/components/designSystemExtension/RichTextEditor/index.d.ts.map +1 -0
  57. package/lib/components/designSystemExtension/RichTextEditor/index.js +2 -0
  58. package/lib/components/designSystemExtension/RichTextEditor/index.js.map +1 -0
  59. package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.d.ts +6 -1
  60. package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.d.ts.map +1 -1
  61. package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.js +2 -2
  62. package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.js.map +1 -1
  63. package/lib/components/field/AutoComplete/AutoComplete.d.ts +15 -1
  64. package/lib/components/field/AutoComplete/AutoComplete.d.ts.map +1 -1
  65. package/lib/components/field/AutoComplete/AutoComplete.js +17 -15
  66. package/lib/components/field/AutoComplete/AutoComplete.js.map +1 -1
  67. package/lib/components/field/CancelAlert/CancelAlert.d.ts +7 -2
  68. package/lib/components/field/CancelAlert/CancelAlert.d.ts.map +1 -1
  69. package/lib/components/field/CancelAlert/CancelAlert.js +12 -10
  70. package/lib/components/field/CancelAlert/CancelAlert.js.map +1 -1
  71. package/lib/components/field/Checkbox/Checkbox.d.ts +19 -1
  72. package/lib/components/field/Checkbox/Checkbox.d.ts.map +1 -1
  73. package/lib/components/field/Checkbox/Checkbox.js +12 -10
  74. package/lib/components/field/Checkbox/Checkbox.js.map +1 -1
  75. package/lib/components/field/Currency/Currency.d.ts +6 -1
  76. package/lib/components/field/Currency/Currency.d.ts.map +1 -1
  77. package/lib/components/field/Currency/Currency.js +11 -11
  78. package/lib/components/field/Currency/Currency.js.map +1 -1
  79. package/lib/components/field/Currency/currency-utils.d.ts +1 -1
  80. package/lib/components/field/Currency/currency-utils.d.ts.map +1 -1
  81. package/lib/components/field/Currency/currency-utils.js +1 -1
  82. package/lib/components/field/Currency/currency-utils.js.map +1 -1
  83. package/lib/components/field/Date/Date.d.ts +5 -1
  84. package/lib/components/field/Date/Date.d.ts.map +1 -1
  85. package/lib/components/field/Date/Date.js +19 -11
  86. package/lib/components/field/Date/Date.js.map +1 -1
  87. package/lib/components/field/DateTime/DateTime.d.ts +5 -1
  88. package/lib/components/field/DateTime/DateTime.d.ts.map +1 -1
  89. package/lib/components/field/DateTime/DateTime.js +15 -9
  90. package/lib/components/field/DateTime/DateTime.js.map +1 -1
  91. package/lib/components/field/Decimal/Decimal.d.ts +8 -1
  92. package/lib/components/field/Decimal/Decimal.d.ts.map +1 -1
  93. package/lib/components/field/Decimal/Decimal.js +43 -9
  94. package/lib/components/field/Decimal/Decimal.js.map +1 -1
  95. package/lib/components/field/Dropdown/Dropdown.d.ts +10 -1
  96. package/lib/components/field/Dropdown/Dropdown.d.ts.map +1 -1
  97. package/lib/components/field/Dropdown/Dropdown.js +26 -9
  98. package/lib/components/field/Dropdown/Dropdown.js.map +1 -1
  99. package/lib/components/field/Email/Email.d.ts +5 -1
  100. package/lib/components/field/Email/Email.d.ts.map +1 -1
  101. package/lib/components/field/Email/Email.js +7 -5
  102. package/lib/components/field/Email/Email.js.map +1 -1
  103. package/lib/components/field/Integer/Integer.d.ts +5 -1
  104. package/lib/components/field/Integer/Integer.d.ts.map +1 -1
  105. package/lib/components/field/Integer/Integer.js +6 -4
  106. package/lib/components/field/Integer/Integer.js.map +1 -1
  107. package/lib/components/field/Percentage/Percentage.d.ts +5 -1
  108. package/lib/components/field/Percentage/Percentage.d.ts.map +1 -1
  109. package/lib/components/field/Percentage/Percentage.js +6 -4
  110. package/lib/components/field/Percentage/Percentage.js.map +1 -1
  111. package/lib/components/field/Phone/Phone.d.ts +5 -1
  112. package/lib/components/field/Phone/Phone.d.ts.map +1 -1
  113. package/lib/components/field/Phone/Phone.js +10 -7
  114. package/lib/components/field/Phone/Phone.js.map +1 -1
  115. package/lib/components/field/RadioButtons/RadioButtons.d.ts +7 -1
  116. package/lib/components/field/RadioButtons/RadioButtons.d.ts.map +1 -1
  117. package/lib/components/field/RadioButtons/RadioButtons.js +24 -11
  118. package/lib/components/field/RadioButtons/RadioButtons.js.map +1 -1
  119. package/lib/components/field/RichText/RichText.d.ts +7 -0
  120. package/lib/components/field/RichText/RichText.d.ts.map +1 -0
  121. package/lib/components/field/RichText/RichText.js +51 -0
  122. package/lib/components/field/RichText/RichText.js.map +1 -0
  123. package/lib/components/field/RichText/index.d.ts +2 -0
  124. package/lib/components/field/RichText/index.d.ts.map +1 -0
  125. package/lib/components/field/RichText/index.js +2 -0
  126. package/lib/components/field/RichText/index.js.map +1 -0
  127. package/lib/components/field/ScalarList/ScalarList.d.ts +13 -0
  128. package/lib/components/field/ScalarList/ScalarList.d.ts.map +1 -0
  129. package/lib/components/field/ScalarList/ScalarList.js +34 -0
  130. package/lib/components/field/ScalarList/ScalarList.js.map +1 -0
  131. package/lib/components/field/ScalarList/index.d.ts +2 -0
  132. package/lib/components/field/ScalarList/index.d.ts.map +1 -0
  133. package/lib/components/field/ScalarList/index.js +2 -0
  134. package/lib/components/field/ScalarList/index.js.map +1 -0
  135. package/lib/components/field/SemanticLink/SemanticLink.d.ts +5 -9
  136. package/lib/components/field/SemanticLink/SemanticLink.d.ts.map +1 -1
  137. package/lib/components/field/SemanticLink/SemanticLink.js +10 -14
  138. package/lib/components/field/SemanticLink/SemanticLink.js.map +1 -1
  139. package/lib/components/field/SemanticLink/utils.d.ts.map +1 -1
  140. package/lib/components/field/SemanticLink/utils.js.map +1 -1
  141. package/lib/components/field/TextArea/TextArea.d.ts +6 -1
  142. package/lib/components/field/TextArea/TextArea.d.ts.map +1 -1
  143. package/lib/components/field/TextArea/TextArea.js +5 -3
  144. package/lib/components/field/TextArea/TextArea.js.map +1 -1
  145. package/lib/components/field/TextContent/TextContent.d.ts +7 -1
  146. package/lib/components/field/TextContent/TextContent.d.ts.map +1 -1
  147. package/lib/components/field/TextContent/TextContent.js.map +1 -1
  148. package/lib/components/field/TextInput/TextInput.d.ts +6 -1
  149. package/lib/components/field/TextInput/TextInput.d.ts.map +1 -1
  150. package/lib/components/field/TextInput/TextInput.js +24 -5
  151. package/lib/components/field/TextInput/TextInput.js.map +1 -1
  152. package/lib/components/field/Time/Time.d.ts +5 -1
  153. package/lib/components/field/Time/Time.d.ts.map +1 -1
  154. package/lib/components/field/Time/Time.js +14 -8
  155. package/lib/components/field/Time/Time.js.map +1 -1
  156. package/lib/components/field/URL/URL.d.ts +5 -1
  157. package/lib/components/field/URL/URL.d.ts.map +1 -1
  158. package/lib/components/field/URL/URL.js +11 -5
  159. package/lib/components/field/URL/URL.js.map +1 -1
  160. package/lib/components/field/UserReference/UserReference.d.ts +19 -40
  161. package/lib/components/field/UserReference/UserReference.d.ts.map +1 -1
  162. package/lib/components/field/UserReference/UserReference.js +16 -45
  163. package/lib/components/field/UserReference/UserReference.js.map +1 -1
  164. package/lib/components/helpers/attachmentHelpers.d.ts +6 -6
  165. package/lib/components/helpers/attachmentHelpers.d.ts.map +1 -1
  166. package/lib/components/helpers/attachmentHelpers.js +2 -2
  167. package/lib/components/helpers/attachmentHelpers.js.map +1 -1
  168. package/lib/components/helpers/auth.d.ts +8 -6
  169. package/lib/components/helpers/auth.d.ts.map +1 -1
  170. package/lib/components/helpers/auth.js +642 -327
  171. package/lib/components/helpers/auth.js.map +1 -1
  172. package/lib/components/helpers/authManager.d.ts +20 -17
  173. package/lib/components/helpers/authManager.d.ts.map +1 -1
  174. package/lib/components/helpers/authManager.js +713 -438
  175. package/lib/components/helpers/authManager.js.map +1 -1
  176. package/lib/components/helpers/case-utils.d.ts +20 -0
  177. package/lib/components/helpers/case-utils.d.ts.map +1 -0
  178. package/lib/components/helpers/case-utils.js +82 -0
  179. package/lib/components/helpers/case-utils.js.map +1 -0
  180. package/lib/components/helpers/common-utils.d.ts +2 -0
  181. package/lib/components/helpers/common-utils.d.ts.map +1 -0
  182. package/lib/components/helpers/common-utils.js +5 -0
  183. package/lib/components/helpers/common-utils.js.map +1 -0
  184. package/lib/components/helpers/config_access.d.ts.map +1 -1
  185. package/lib/components/helpers/config_access.js +28 -98
  186. package/lib/components/helpers/config_access.js.map +1 -1
  187. package/lib/components/helpers/data_page.d.ts.map +1 -1
  188. package/lib/components/helpers/data_page.js.map +1 -1
  189. package/lib/components/helpers/date-format-utils.d.ts +1 -6
  190. package/lib/components/helpers/date-format-utils.d.ts.map +1 -1
  191. package/lib/components/helpers/date-format-utils.js +23 -14
  192. package/lib/components/helpers/date-format-utils.js.map +1 -1
  193. package/lib/components/helpers/event-utils.d.ts +1 -1
  194. package/lib/components/helpers/event-utils.d.ts.map +1 -1
  195. package/lib/components/helpers/event-utils.js.map +1 -1
  196. package/lib/components/helpers/field-group-utils.d.ts +15 -2
  197. package/lib/components/helpers/field-group-utils.d.ts.map +1 -1
  198. package/lib/components/helpers/field-group-utils.js +3 -3
  199. package/lib/components/helpers/field-group-utils.js.map +1 -1
  200. package/lib/components/helpers/formatters/Boolean.d.ts +3 -3
  201. package/lib/components/helpers/formatters/Boolean.d.ts.map +1 -1
  202. package/lib/components/helpers/formatters/Boolean.js.map +1 -1
  203. package/lib/components/helpers/formatters/Currency.d.ts +6 -6
  204. package/lib/components/helpers/formatters/Currency.d.ts.map +1 -1
  205. package/lib/components/helpers/formatters/Currency.js +6 -5
  206. package/lib/components/helpers/formatters/Currency.js.map +1 -1
  207. package/lib/components/helpers/formatters/CurrencyMap.d.ts +881 -1399
  208. package/lib/components/helpers/formatters/CurrencyMap.d.ts.map +1 -1
  209. package/lib/components/helpers/formatters/CurrencyMap.js.map +1 -1
  210. package/lib/components/helpers/formatters/Date.d.ts +4 -4
  211. package/lib/components/helpers/formatters/Date.d.ts.map +1 -1
  212. package/lib/components/helpers/formatters/Date.js +1 -1
  213. package/lib/components/helpers/formatters/Date.js.map +1 -1
  214. package/lib/components/helpers/formatters/common.d.ts +2 -2
  215. package/lib/components/helpers/formatters/common.d.ts.map +1 -1
  216. package/lib/components/helpers/formatters/common.js +4 -5
  217. package/lib/components/helpers/formatters/common.js.map +1 -1
  218. package/lib/components/helpers/formatters/index.d.ts +11 -11
  219. package/lib/components/helpers/formatters/index.d.ts.map +1 -1
  220. package/lib/components/helpers/formatters/index.js.map +1 -1
  221. package/lib/components/helpers/reactContextHelpers.d.ts +3 -2
  222. package/lib/components/helpers/reactContextHelpers.d.ts.map +1 -1
  223. package/lib/components/helpers/reactContextHelpers.js.map +1 -1
  224. package/lib/components/helpers/simpleTableHelpers.d.ts +5 -3
  225. package/lib/components/helpers/simpleTableHelpers.d.ts.map +1 -1
  226. package/lib/components/helpers/simpleTableHelpers.js +10 -5
  227. package/lib/components/helpers/simpleTableHelpers.js.map +1 -1
  228. package/lib/components/helpers/state-utils.d.ts +4 -0
  229. package/lib/components/helpers/state-utils.d.ts.map +1 -0
  230. package/lib/components/helpers/state-utils.js +36 -0
  231. package/lib/components/helpers/state-utils.js.map +1 -0
  232. package/lib/components/helpers/template-utils.d.ts +7 -3
  233. package/lib/components/helpers/template-utils.d.ts.map +1 -1
  234. package/lib/components/helpers/template-utils.js.map +1 -1
  235. package/lib/components/helpers/utils.d.ts +1 -1
  236. package/lib/components/helpers/utils.d.ts.map +1 -1
  237. package/lib/components/helpers/utils.js +9 -3
  238. package/lib/components/helpers/utils.js.map +1 -1
  239. package/lib/components/helpers/versionHelpers.d.ts.map +1 -1
  240. package/lib/components/helpers/versionHelpers.js.map +1 -1
  241. package/lib/components/infra/ActionButtons/ActionButtons.d.ts +6 -13
  242. package/lib/components/infra/ActionButtons/ActionButtons.d.ts.map +1 -1
  243. package/lib/components/infra/ActionButtons/ActionButtons.js +5 -15
  244. package/lib/components/infra/ActionButtons/ActionButtons.js.map +1 -1
  245. package/lib/components/infra/Assignment/Assignment.d.ts +9 -14
  246. package/lib/components/infra/Assignment/Assignment.d.ts.map +1 -1
  247. package/lib/components/infra/Assignment/Assignment.js +32 -33
  248. package/lib/components/infra/Assignment/Assignment.js.map +1 -1
  249. package/lib/components/infra/AssignmentCard/AssignmentCard.d.ts +8 -14
  250. package/lib/components/infra/AssignmentCard/AssignmentCard.d.ts.map +1 -1
  251. package/lib/components/infra/AssignmentCard/AssignmentCard.js +3 -16
  252. package/lib/components/infra/AssignmentCard/AssignmentCard.js.map +1 -1
  253. package/lib/components/infra/Containers/FlowContainer/FlowContainer.d.ts +1 -21
  254. package/lib/components/infra/Containers/FlowContainer/FlowContainer.d.ts.map +1 -1
  255. package/lib/components/infra/Containers/FlowContainer/FlowContainer.js +53 -52
  256. package/lib/components/infra/Containers/FlowContainer/FlowContainer.js.map +1 -1
  257. package/lib/components/infra/Containers/FlowContainer/helpers.d.ts +12 -12
  258. package/lib/components/infra/Containers/FlowContainer/helpers.d.ts.map +1 -1
  259. package/lib/components/infra/Containers/FlowContainer/helpers.js +17 -16
  260. package/lib/components/infra/Containers/FlowContainer/helpers.js.map +1 -1
  261. package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.d.ts +8 -17
  262. package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.d.ts.map +1 -1
  263. package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.js +22 -24
  264. package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.js.map +1 -1
  265. package/lib/components/infra/Containers/ViewContainer/ViewContainer.d.ts +9 -22
  266. package/lib/components/infra/Containers/ViewContainer/ViewContainer.d.ts.map +1 -1
  267. package/lib/components/infra/Containers/ViewContainer/ViewContainer.js +7 -22
  268. package/lib/components/infra/Containers/ViewContainer/ViewContainer.js.map +1 -1
  269. package/lib/components/infra/DashboardFilter/DashboardFilter.d.ts +9 -19
  270. package/lib/components/infra/DashboardFilter/DashboardFilter.d.ts.map +1 -1
  271. package/lib/components/infra/DashboardFilter/DashboardFilter.js +2 -16
  272. package/lib/components/infra/DashboardFilter/DashboardFilter.js.map +1 -1
  273. package/lib/components/infra/DashboardFilter/filterUtils.d.ts.map +1 -1
  274. package/lib/components/infra/DashboardFilter/filterUtils.js +1 -1
  275. package/lib/components/infra/DashboardFilter/filterUtils.js.map +1 -1
  276. package/lib/components/infra/DeferLoad/DeferLoad.d.ts +1 -14
  277. package/lib/components/infra/DeferLoad/DeferLoad.d.ts.map +1 -1
  278. package/lib/components/infra/DeferLoad/DeferLoad.js +13 -15
  279. package/lib/components/infra/DeferLoad/DeferLoad.js.map +1 -1
  280. package/lib/components/infra/ErrorBoundary/ErrorBoundary.d.ts +5 -12
  281. package/lib/components/infra/ErrorBoundary/ErrorBoundary.d.ts.map +1 -1
  282. package/lib/components/infra/ErrorBoundary/ErrorBoundary.js +9 -16
  283. package/lib/components/infra/ErrorBoundary/ErrorBoundary.js.map +1 -1
  284. package/lib/components/infra/MultiStep/MultiStep.d.ts +11 -17
  285. package/lib/components/infra/MultiStep/MultiStep.d.ts.map +1 -1
  286. package/lib/components/infra/MultiStep/MultiStep.js +6 -20
  287. package/lib/components/infra/MultiStep/MultiStep.js.map +1 -1
  288. package/lib/components/infra/NavBar/NavBar.d.ts +8 -16
  289. package/lib/components/infra/NavBar/NavBar.d.ts.map +1 -1
  290. package/lib/components/infra/NavBar/NavBar.js +9 -20
  291. package/lib/components/infra/NavBar/NavBar.js.map +1 -1
  292. package/lib/components/infra/Reference/Reference.d.ts +8 -17
  293. package/lib/components/infra/Reference/Reference.d.ts.map +1 -1
  294. package/lib/components/infra/Reference/Reference.js +1 -15
  295. package/lib/components/infra/Reference/Reference.js.map +1 -1
  296. package/lib/components/infra/Region/Region.d.ts +4 -7
  297. package/lib/components/infra/Region/Region.d.ts.map +1 -1
  298. package/lib/components/infra/Region/Region.js +0 -4
  299. package/lib/components/infra/Region/Region.js.map +1 -1
  300. package/lib/components/infra/RootContainer/RootContainer.d.ts +1 -21
  301. package/lib/components/infra/RootContainer/RootContainer.d.ts.map +1 -1
  302. package/lib/components/infra/RootContainer/RootContainer.js +16 -36
  303. package/lib/components/infra/RootContainer/RootContainer.js.map +1 -1
  304. package/lib/components/infra/Stages/Stages.d.ts +5 -8
  305. package/lib/components/infra/Stages/Stages.d.ts.map +1 -1
  306. package/lib/components/infra/Stages/Stages.js +3 -7
  307. package/lib/components/infra/Stages/Stages.js.map +1 -1
  308. package/lib/components/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.d.ts.map +1 -1
  309. package/lib/components/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.js.map +1 -1
  310. package/lib/components/infra/VerticalTabs/VerticalTabs/VerticalTabs.d.ts +4 -10
  311. package/lib/components/infra/VerticalTabs/VerticalTabs/VerticalTabs.d.ts.map +1 -1
  312. package/lib/components/infra/VerticalTabs/VerticalTabs/VerticalTabs.js +4 -9
  313. package/lib/components/infra/VerticalTabs/VerticalTabs/VerticalTabs.js.map +1 -1
  314. package/lib/components/infra/View/View.d.ts +13 -16
  315. package/lib/components/infra/View/View.d.ts.map +1 -1
  316. package/lib/components/infra/View/View.js +8 -54
  317. package/lib/components/infra/View/View.js.map +1 -1
  318. package/lib/components/template/AppShell/AppShell.d.ts +20 -15
  319. package/lib/components/template/AppShell/AppShell.d.ts.map +1 -1
  320. package/lib/components/template/AppShell/AppShell.js +17 -29
  321. package/lib/components/template/AppShell/AppShell.js.map +1 -1
  322. package/lib/components/template/BannerPage/BannerPage.d.ts +11 -23
  323. package/lib/components/template/BannerPage/BannerPage.d.ts.map +1 -1
  324. package/lib/components/template/BannerPage/BannerPage.js +4 -22
  325. package/lib/components/template/BannerPage/BannerPage.js.map +1 -1
  326. package/lib/components/template/CaseSummary/CaseSummary.d.ts +5 -7
  327. package/lib/components/template/CaseSummary/CaseSummary.d.ts.map +1 -1
  328. package/lib/components/template/CaseSummary/CaseSummary.js +6 -6
  329. package/lib/components/template/CaseSummary/CaseSummary.js.map +1 -1
  330. package/lib/components/template/CaseView/CaseView.d.ts +10 -22
  331. package/lib/components/template/CaseView/CaseView.d.ts.map +1 -1
  332. package/lib/components/template/CaseView/CaseView.js +41 -45
  333. package/lib/components/template/CaseView/CaseView.js.map +1 -1
  334. package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.d.ts +8 -13
  335. package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.d.ts.map +1 -1
  336. package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.js +9 -16
  337. package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.js.map +1 -1
  338. package/lib/components/template/Confirmation/Confirmation.d.ts +10 -16
  339. package/lib/components/template/Confirmation/Confirmation.d.ts.map +1 -1
  340. package/lib/components/template/Confirmation/Confirmation.js +12 -23
  341. package/lib/components/template/Confirmation/Confirmation.js.map +1 -1
  342. package/lib/components/template/DataReference/DataReference.d.ts +1 -31
  343. package/lib/components/template/DataReference/DataReference.d.ts.map +1 -1
  344. package/lib/components/template/DataReference/DataReference.js +41 -48
  345. package/lib/components/template/DataReference/DataReference.js.map +1 -1
  346. package/lib/components/template/DefaultForm/DefaultForm.d.ts +1 -11
  347. package/lib/components/template/DefaultForm/DefaultForm.d.ts.map +1 -1
  348. package/lib/components/template/DefaultForm/DefaultForm.js +18 -15
  349. package/lib/components/template/DefaultForm/DefaultForm.js.map +1 -1
  350. package/lib/components/template/DefaultForm/utils/index.d.ts +3 -0
  351. package/lib/components/template/DefaultForm/utils/index.d.ts.map +1 -0
  352. package/lib/components/template/DefaultForm/utils/index.js +27 -0
  353. package/lib/components/template/DefaultForm/utils/index.js.map +1 -0
  354. package/lib/components/template/Details/Details/Details.d.ts +1 -16
  355. package/lib/components/template/Details/Details/Details.d.ts.map +1 -1
  356. package/lib/components/template/Details/Details/Details.js +10 -15
  357. package/lib/components/template/Details/Details/Details.js.map +1 -1
  358. package/lib/components/template/Details/DetailsSubTabs/DetailsSubTabs.d.ts +7 -15
  359. package/lib/components/template/Details/DetailsSubTabs/DetailsSubTabs.d.ts.map +1 -1
  360. package/lib/components/template/Details/DetailsSubTabs/DetailsSubTabs.js +1 -13
  361. package/lib/components/template/Details/DetailsSubTabs/DetailsSubTabs.js.map +1 -1
  362. package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.d.ts +1 -16
  363. package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.d.ts.map +1 -1
  364. package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.js +14 -16
  365. package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.js.map +1 -1
  366. package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.d.ts +1 -16
  367. package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.d.ts.map +1 -1
  368. package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.js +14 -16
  369. package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.js.map +1 -1
  370. package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.d.ts +12 -19
  371. package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.d.ts.map +1 -1
  372. package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.js +7 -21
  373. package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.js.map +1 -1
  374. package/lib/components/template/InlineDashboard/InlineDashboard.d.ts +7 -7
  375. package/lib/components/template/InlineDashboard/InlineDashboard.d.ts.map +1 -1
  376. package/lib/components/template/InlineDashboard/InlineDashboard.js +0 -5
  377. package/lib/components/template/InlineDashboard/InlineDashboard.js.map +1 -1
  378. package/lib/components/template/InlineDashboardPage/InlineDashboardPage.d.ts +8 -15
  379. package/lib/components/template/InlineDashboardPage/InlineDashboardPage.d.ts.map +1 -1
  380. package/lib/components/template/InlineDashboardPage/InlineDashboardPage.js +5 -14
  381. package/lib/components/template/InlineDashboardPage/InlineDashboardPage.js.map +1 -1
  382. package/lib/components/template/ListPage/ListPage.d.ts +5 -13
  383. package/lib/components/template/ListPage/ListPage.d.ts.map +1 -1
  384. package/lib/components/template/ListPage/ListPage.js +6 -10
  385. package/lib/components/template/ListPage/ListPage.js.map +1 -1
  386. package/lib/components/template/ListView/DefaultViewMeta.d.ts +1 -90
  387. package/lib/components/template/ListView/DefaultViewMeta.d.ts.map +1 -1
  388. package/lib/components/template/ListView/DefaultViewMeta.js.map +1 -1
  389. package/lib/components/template/ListView/ListView.d.ts +1 -9
  390. package/lib/components/template/ListView/ListView.d.ts.map +1 -1
  391. package/lib/components/template/ListView/ListView.js +96 -100
  392. package/lib/components/template/ListView/ListView.js.map +1 -1
  393. package/lib/components/template/ListView/hooks.d.ts.map +1 -1
  394. package/lib/components/template/ListView/hooks.js +0 -1
  395. package/lib/components/template/ListView/hooks.js.map +1 -1
  396. package/lib/components/template/ListView/utils.d.ts +72 -16
  397. package/lib/components/template/ListView/utils.d.ts.map +1 -1
  398. package/lib/components/template/ListView/utils.js +143 -3
  399. package/lib/components/template/ListView/utils.js.map +1 -1
  400. package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.d.ts +9 -13
  401. package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.d.ts.map +1 -1
  402. package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.js +2 -13
  403. package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.js.map +1 -1
  404. package/lib/components/template/NarrowWide/NarrowWide/NarrowWide.d.ts +10 -1
  405. package/lib/components/template/NarrowWide/NarrowWide/NarrowWide.d.ts.map +1 -1
  406. package/lib/components/template/NarrowWide/NarrowWide/NarrowWide.js.map +1 -1
  407. package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.d.ts +1 -16
  408. package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.d.ts.map +1 -1
  409. package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.js +14 -16
  410. package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.js.map +1 -1
  411. package/lib/components/template/NarrowWide/NarrowWideForm/NarrowWideForm.d.ts +5 -1
  412. package/lib/components/template/NarrowWide/NarrowWideForm/NarrowWideForm.d.ts.map +1 -1
  413. package/lib/components/template/NarrowWide/NarrowWideForm/NarrowWideForm.js.map +1 -1
  414. package/lib/components/template/NarrowWide/NarrowWidePage/NarrowWidePage.d.ts +7 -14
  415. package/lib/components/template/NarrowWide/NarrowWidePage/NarrowWidePage.d.ts.map +1 -1
  416. package/lib/components/template/NarrowWide/NarrowWidePage/NarrowWidePage.js +4 -13
  417. package/lib/components/template/NarrowWide/NarrowWidePage/NarrowWidePage.js.map +1 -1
  418. package/lib/components/template/OneColumn/OneColumn/OneColumn.d.ts +4 -7
  419. package/lib/components/template/OneColumn/OneColumn/OneColumn.d.ts.map +1 -1
  420. package/lib/components/template/OneColumn/OneColumn/OneColumn.js +0 -5
  421. package/lib/components/template/OneColumn/OneColumn/OneColumn.js.map +1 -1
  422. package/lib/components/template/OneColumn/OneColumnPage/OneColumnPage.d.ts +4 -8
  423. package/lib/components/template/OneColumn/OneColumnPage/OneColumnPage.d.ts.map +1 -1
  424. package/lib/components/template/OneColumn/OneColumnPage/OneColumnPage.js +3 -6
  425. package/lib/components/template/OneColumn/OneColumnPage/OneColumnPage.js.map +1 -1
  426. package/lib/components/template/OneColumn/OneColumnTab/OneColumnTab.d.ts +4 -7
  427. package/lib/components/template/OneColumn/OneColumnTab/OneColumnTab.d.ts.map +1 -1
  428. package/lib/components/template/OneColumn/OneColumnTab/OneColumnTab.js +0 -5
  429. package/lib/components/template/OneColumn/OneColumnTab/OneColumnTab.js.map +1 -1
  430. package/lib/components/template/PromotedFilters/PromotedFilters.d.ts +1 -15
  431. package/lib/components/template/PromotedFilters/PromotedFilters.d.ts.map +1 -1
  432. package/lib/components/template/PromotedFilters/PromotedFilters.js +17 -13
  433. package/lib/components/template/PromotedFilters/PromotedFilters.js.map +1 -1
  434. package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.d.ts.map +1 -1
  435. package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.js +57 -5
  436. package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.js.map +1 -1
  437. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.d.ts +18 -1
  438. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.d.ts.map +1 -1
  439. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js +5 -5
  440. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js.map +1 -1
  441. package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.d.ts +1 -29
  442. package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.d.ts.map +1 -1
  443. package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.js +22 -28
  444. package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.js.map +1 -1
  445. package/lib/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.d.ts +14 -26
  446. package/lib/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.d.ts.map +1 -1
  447. package/lib/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.js +5 -26
  448. package/lib/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.js.map +1 -1
  449. package/lib/components/template/SubTabs/SubTabs.d.ts +4 -10
  450. package/lib/components/template/SubTabs/SubTabs.d.ts.map +1 -1
  451. package/lib/components/template/SubTabs/SubTabs.js +1 -8
  452. package/lib/components/template/SubTabs/SubTabs.js.map +1 -1
  453. package/lib/components/template/SubTabs/tabUtils.d.ts.map +1 -1
  454. package/lib/components/template/SubTabs/tabUtils.js.map +1 -1
  455. package/lib/components/template/TwoColumn/TwoColumn/TwoColumn.d.ts +5 -11
  456. package/lib/components/template/TwoColumn/TwoColumn/TwoColumn.d.ts.map +1 -1
  457. package/lib/components/template/TwoColumn/TwoColumn/TwoColumn.js +1 -12
  458. package/lib/components/template/TwoColumn/TwoColumn/TwoColumn.js.map +1 -1
  459. package/lib/components/template/TwoColumn/TwoColumnPage/TwoColumnPage.d.ts +4 -8
  460. package/lib/components/template/TwoColumn/TwoColumnPage/TwoColumnPage.d.ts.map +1 -1
  461. package/lib/components/template/TwoColumn/TwoColumnPage/TwoColumnPage.js +3 -6
  462. package/lib/components/template/TwoColumn/TwoColumnPage/TwoColumnPage.js.map +1 -1
  463. package/lib/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.d.ts +5 -11
  464. package/lib/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.d.ts.map +1 -1
  465. package/lib/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.js +1 -9
  466. package/lib/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.js.map +1 -1
  467. package/lib/components/template/WideNarrow/WideNarrow/WideNarrow.d.ts +10 -1
  468. package/lib/components/template/WideNarrow/WideNarrow/WideNarrow.d.ts.map +1 -1
  469. package/lib/components/template/WideNarrow/WideNarrow/WideNarrow.js +1 -1
  470. package/lib/components/template/WideNarrow/WideNarrow/WideNarrow.js.map +1 -1
  471. package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.d.ts +1 -16
  472. package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.d.ts.map +1 -1
  473. package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.js +31 -23
  474. package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.js.map +1 -1
  475. package/lib/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.d.ts +5 -1
  476. package/lib/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.d.ts.map +1 -1
  477. package/lib/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.js.map +1 -1
  478. package/lib/components/template/WideNarrow/WideNarrowPage/WideNarrowPage.d.ts +7 -14
  479. package/lib/components/template/WideNarrow/WideNarrowPage/WideNarrowPage.d.ts.map +1 -1
  480. package/lib/components/template/WideNarrow/WideNarrowPage/WideNarrowPage.js +4 -14
  481. package/lib/components/template/WideNarrow/WideNarrowPage/WideNarrowPage.js.map +1 -1
  482. package/lib/components/template/WssNavBar/WssNavBar.d.ts +17 -1
  483. package/lib/components/template/WssNavBar/WssNavBar.d.ts.map +1 -1
  484. package/lib/components/template/WssNavBar/WssNavBar.js +2 -2
  485. package/lib/components/template/WssNavBar/WssNavBar.js.map +1 -1
  486. package/lib/components/widget/AppAnnouncement/AppAnnouncement.d.ts +8 -17
  487. package/lib/components/widget/AppAnnouncement/AppAnnouncement.d.ts.map +1 -1
  488. package/lib/components/widget/AppAnnouncement/AppAnnouncement.js +4 -19
  489. package/lib/components/widget/AppAnnouncement/AppAnnouncement.js.map +1 -1
  490. package/lib/components/widget/Attachment/Attachment.css +15 -3
  491. package/lib/components/widget/Attachment/Attachment.d.ts.map +1 -1
  492. package/lib/components/widget/Attachment/Attachment.js +44 -32
  493. package/lib/components/widget/Attachment/Attachment.js.map +1 -1
  494. package/lib/components/widget/CaseHistory/CaseHistory.d.ts +4 -7
  495. package/lib/components/widget/CaseHistory/CaseHistory.d.ts.map +1 -1
  496. package/lib/components/widget/CaseHistory/CaseHistory.js +4 -8
  497. package/lib/components/widget/CaseHistory/CaseHistory.js.map +1 -1
  498. package/lib/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.d.ts +8 -1
  499. package/lib/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.d.ts.map +1 -1
  500. package/lib/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.js.map +1 -1
  501. package/lib/components/widget/FileUtility/FileUtility/FileUtility.d.ts +5 -1
  502. package/lib/components/widget/FileUtility/FileUtility/FileUtility.d.ts.map +1 -1
  503. package/lib/components/widget/FileUtility/FileUtility/FileUtility.js +33 -23
  504. package/lib/components/widget/FileUtility/FileUtility/FileUtility.js.map +1 -1
  505. package/lib/components/widget/Followers/Followers.d.ts +4 -5
  506. package/lib/components/widget/Followers/Followers.d.ts.map +1 -1
  507. package/lib/components/widget/Followers/Followers.js +3 -10
  508. package/lib/components/widget/Followers/Followers.js.map +1 -1
  509. package/lib/components/widget/QuickCreate/QuickCreate.d.ts.map +1 -1
  510. package/lib/components/widget/QuickCreate/QuickCreate.js +12 -4
  511. package/lib/components/widget/QuickCreate/QuickCreate.js.map +1 -1
  512. package/lib/components/widget/SummaryItem/SummaryItem.d.ts +7 -1
  513. package/lib/components/widget/SummaryItem/SummaryItem.d.ts.map +1 -1
  514. package/lib/components/widget/SummaryItem/SummaryItem.js +2 -2
  515. package/lib/components/widget/SummaryItem/SummaryItem.js.map +1 -1
  516. package/lib/components/widget/SummaryList/SummaryList.d.ts +7 -1
  517. package/lib/components/widget/SummaryList/SummaryList.d.ts.map +1 -1
  518. package/lib/components/widget/SummaryList/SummaryList.js +5 -2
  519. package/lib/components/widget/SummaryList/SummaryList.js.map +1 -1
  520. package/lib/components/widget/ToDo/ToDo.d.ts +13 -27
  521. package/lib/components/widget/ToDo/ToDo.d.ts.map +1 -1
  522. package/lib/components/widget/ToDo/ToDo.js +35 -67
  523. package/lib/components/widget/ToDo/ToDo.js.map +1 -1
  524. package/lib/components_map.d.ts +3 -3
  525. package/lib/components_map.d.ts.map +1 -1
  526. package/lib/components_map.js +819 -818
  527. package/lib/components_map.js.map +1 -1
  528. package/lib/doc/KeyReleaseUpdates.md +65 -9
  529. package/lib/hooks/index.d.ts +4 -0
  530. package/lib/hooks/index.d.ts.map +1 -0
  531. package/lib/hooks/index.js +4 -0
  532. package/lib/hooks/index.js.map +1 -0
  533. package/lib/hooks/useAfterInitialEffect.d.ts +9 -0
  534. package/lib/hooks/useAfterInitialEffect.d.ts.map +1 -0
  535. package/lib/hooks/useAfterInitialEffect.js +16 -0
  536. package/lib/hooks/useAfterInitialEffect.js.map +1 -0
  537. package/lib/hooks/useConsolidatedRef.d.ts +9 -0
  538. package/lib/hooks/useConsolidatedRef.d.ts.map +1 -0
  539. package/lib/hooks/useConsolidatedRef.js +30 -0
  540. package/lib/hooks/useConsolidatedRef.js.map +1 -0
  541. package/lib/hooks/useUID.d.ts +8 -0
  542. package/lib/hooks/useUID.d.ts.map +1 -0
  543. package/lib/hooks/useUID.js +14 -0
  544. package/lib/hooks/useUID.js.map +1 -0
  545. package/lib/index.d.ts +1 -0
  546. package/lib/index.d.ts.map +1 -1
  547. package/lib/index.js +2 -1
  548. package/lib/index.js.map +1 -1
  549. package/lib/sdk-pega-component-map.d.ts +15 -1
  550. package/lib/sdk-pega-component-map.js +15 -1
  551. package/lib/sdk-pega-component-map.js.map +1 -1
  552. package/lib/types/PConnProps.d.ts +42 -0
  553. package/package.json +1 -1
@@ -0,0 +1,2 @@
1
+ export { default } from './RichTextEditor';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/designSystemExtension/RichTextEditor/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["export { default } from './RichTextEditor';\n"]}
@@ -1,4 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import './WssQuickCreate.css';
3
- export default function WssQuickCreate(props: any): JSX.Element;
3
+ interface WssQuickCreateProps {
4
+ heading: string;
5
+ actions?: Array<any>;
6
+ }
7
+ export default function WssQuickCreate(props: WssQuickCreateProps): JSX.Element;
8
+ export {};
4
9
  //# sourceMappingURL=WssQuickCreate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"WssQuickCreate.d.ts","sourceRoot":"","sources":["../../../../src/components/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx"],"names":[],"mappings":";AAEA,OAAO,sBAAsB,CAAC;AAE9B,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,KAAA,eAuB3C"}
1
+ {"version":3,"file":"WssQuickCreate.d.ts","sourceRoot":"","sources":["../../../../src/components/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx"],"names":[],"mappings":";AAEA,OAAO,sBAAsB,CAAC;AAI9B,UAAU,mBAAmB;IAE3B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;CACrB;AAGD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,mBAAmB,eAuBhE"}
@@ -4,8 +4,8 @@ import './WssQuickCreate.css';
4
4
  export default function WssQuickCreate(props) {
5
5
  const { heading, actions } = props;
6
6
  return (React.createElement("div", null,
7
- React.createElement("h1", { className: 'quick-link-heading' }, heading),
8
- React.createElement("ul", { className: 'quick-link-ul-list' }, actions &&
7
+ React.createElement("h1", { id: "quick-links-heading", className: 'quick-link-heading' }, heading),
8
+ React.createElement("ul", { id: "quick-links", className: 'quick-link-ul-list' }, actions &&
9
9
  actions.map(element => {
10
10
  return (React.createElement("li", { className: 'quick-link-list', key: element.label },
11
11
  React.createElement(Button, { className: 'quick-link-button', onClick: element.onClick },
@@ -1 +1 @@
1
- {"version":3,"file":"WssQuickCreate.js","sourceRoot":"","sources":["../../../../src/components/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,sBAAsB,CAAC;AAE9B,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK;IAC1C,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAEnC,OAAO,CACL;QACE,4BAAI,SAAS,EAAC,oBAAoB,IAAE,OAAO,CAAM;QACjD,4BAAI,SAAS,EAAC,oBAAoB,IAC/B,OAAO;YACN,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;gBACpB,OAAO,CACP,4BAAI,SAAS,EAAC,iBAAiB,EAAC,GAAG,EAAE,OAAO,CAAC,KAAK;oBAChD,oBAAC,MAAM,IAAC,SAAS,EAAC,mBAAmB,EAAC,OAAO,EAAE,OAAO,CAAC,OAAO;wBAC5D,8BAAM,SAAS,EAAC,wBAAwB;4BACrC,OAAO,CAAC,IAAI,IAAI,6BAAK,SAAS,EAAC,iBAAiB,EAAC,GAAG,EAAE,OAAO,CAAC,IAAI,GAAG;4BACtE,kCAAO,OAAO,CAAC,KAAK,CAAQ,CACvB,CACA,CACN,CACJ,CAAC;YACJ,CAAC,CAAC,CACD,CACD,CACP,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { Button } from '@material-ui/core';\nimport './WssQuickCreate.css';\n\nexport default function WssQuickCreate(props) {\n const { heading, actions } = props;\n\n return (\n <div>\n <h1 className='quick-link-heading'>{heading}</h1>\n <ul className='quick-link-ul-list'>\n {actions &&\n actions.map(element => {\n return (\n <li className='quick-link-list' key={element.label}>\n <Button className='quick-link-button' onClick={element.onClick}>\n <span className='quick-link-button-span'>\n {element.icon && <img className='quick-link-icon' src={element.icon}/>}\n <span>{element.label}</span>\n </span>\n </Button>\n </li>\n );\n })}\n </ul>\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"WssQuickCreate.js","sourceRoot":"","sources":["../../../../src/components/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,sBAAsB,CAAC;AAW9B,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAA0B;IAC/D,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAEnC,OAAO,CACL;QACE,4BAAI,EAAE,EAAC,qBAAqB,EAAC,SAAS,EAAC,oBAAoB,IAAE,OAAO,CAAM;QAC1E,4BAAI,EAAE,EAAC,aAAa,EAAC,SAAS,EAAC,oBAAoB,IAChD,OAAO;YACN,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;gBACpB,OAAO,CACP,4BAAI,SAAS,EAAC,iBAAiB,EAAC,GAAG,EAAE,OAAO,CAAC,KAAK;oBAChD,oBAAC,MAAM,IAAC,SAAS,EAAC,mBAAmB,EAAC,OAAO,EAAE,OAAO,CAAC,OAAO;wBAC5D,8BAAM,SAAS,EAAC,wBAAwB;4BACrC,OAAO,CAAC,IAAI,IAAI,6BAAK,SAAS,EAAC,iBAAiB,EAAC,GAAG,EAAE,OAAO,CAAC,IAAI,GAAG;4BACtE,kCAAO,OAAO,CAAC,KAAK,CAAQ,CACvB,CACA,CACN,CACJ,CAAC;YACJ,CAAC,CAAC,CACD,CACD,CACP,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { Button } from '@material-ui/core';\nimport './WssQuickCreate.css';\n\n// WssQuickCreate is one of the few components that does NOT have getPConnect.\n// So, no need to extend PConnProps\ninterface WssQuickCreateProps {\n // If any, enter additional props that only exist on this component\n heading: string,\n actions?: Array<any>\n}\n\n\nexport default function WssQuickCreate(props: WssQuickCreateProps) {\n const { heading, actions } = props;\n\n return (\n <div>\n <h1 id=\"quick-links-heading\" className='quick-link-heading'>{heading}</h1>\n <ul id=\"quick-links\" className='quick-link-ul-list'>\n {actions &&\n actions.map(element => {\n return (\n <li className='quick-link-list' key={element.label}>\n <Button className='quick-link-button' onClick={element.onClick}>\n <span className='quick-link-button-span'>\n {element.icon && <img className='quick-link-icon' src={element.icon}/>}\n <span>{element.label}</span>\n </span>\n </Button>\n </li>\n );\n })}\n </ul>\n </div>\n );\n}\n"]}
@@ -1,3 +1,17 @@
1
1
  /// <reference types="react" />
2
- export default function AutoComplete(props: any): JSX.Element;
2
+ import type { PConnFieldProps } from '../../../types/PConnProps';
3
+ interface AutoCompleteProps extends PConnFieldProps {
4
+ displayMode?: string;
5
+ deferDatasource?: boolean;
6
+ datasourceMetadata?: any;
7
+ status?: string;
8
+ onRecordChange?: any;
9
+ additionalProps?: object;
10
+ listType: string;
11
+ parameters?: any;
12
+ datasource: any;
13
+ columns: Array<any>;
14
+ }
15
+ export default function AutoComplete(props: AutoCompleteProps): JSX.Element;
16
+ export {};
3
17
  //# sourceMappingURL=AutoComplete.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AutoComplete.d.ts","sourceRoot":"","sources":["../../../../src/components/field/AutoComplete/AutoComplete.tsx"],"names":[],"mappings":";AAsCA,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,KAAA,eAkKzC"}
1
+ {"version":3,"file":"AutoComplete.d.ts","sourceRoot":"","sources":["../../../../src/components/field/AutoComplete/AutoComplete.tsx"],"names":[],"mappings":";AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AA8BjE,UAAU,iBAAkB,SAAQ,eAAe;IAEjD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,GAAG,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,GAAG,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,UAAU,EAAE,GAAG,CAAC;IAChB,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,iBAAiB,eAuK5D"}
@@ -1,23 +1,22 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import { TextField } from '@material-ui/core';
3
3
  import Autocomplete from '@material-ui/lab/Autocomplete';
4
- import Utils from '../../helpers/utils';
5
- import TextInput from '../TextInput';
6
4
  import isDeepEqual from 'fast-deep-equal/react';
5
+ import Utils from '../../helpers/utils';
7
6
  import { getDataPage } from '../../helpers/data_page';
8
7
  import handleEvent from '../../helpers/event-utils';
9
- import FieldValueList from '../../designSystemExtension/FieldValueList';
10
- const preProcessColumns = columnList => {
11
- return columnList.map(col => {
8
+ import { getComponentFromMap } from '../../../bridge/helpers/sdk_component_map';
9
+ const preProcessColumns = (columnList) => {
10
+ return columnList.map((col) => {
12
11
  const tempColObj = { ...col };
13
12
  tempColObj.value = col.value && col.value.startsWith('.') ? col.value.substring(1) : col.value;
14
13
  return tempColObj;
15
14
  });
16
15
  };
17
- const getDisplayFieldsMetaData = columnList => {
18
- const displayColumns = columnList.filter(col => col.display === 'true');
16
+ const getDisplayFieldsMetaData = (columnList) => {
17
+ const displayColumns = columnList.filter((col) => col.display === 'true');
19
18
  const metaDataObj = { key: '', primary: '', secondary: [] };
20
- const keyCol = columnList.filter(col => col.key === 'true');
19
+ const keyCol = columnList.filter((col) => col.key === 'true');
21
20
  metaDataObj.key = keyCol.length > 0 ? keyCol[0].value : 'auto';
22
21
  for (let index = 0; index < displayColumns.length; index += 1) {
23
22
  if (displayColumns[index].primary === 'true') {
@@ -30,6 +29,9 @@ const getDisplayFieldsMetaData = columnList => {
30
29
  return metaDataObj;
31
30
  };
32
31
  export default function AutoComplete(props) {
32
+ // Get emitted components from map (so we can get any override that may exist)
33
+ const TextInput = getComponentFromMap('TextInput');
34
+ const FieldValueList = getComponentFromMap('FieldValueList');
33
35
  const { getPConnect, label, required, placeholder, value = '', validatemessage, readOnly, testId, displayMode, deferDatasource, datasourceMetadata, status, helperText, hideLabel, onRecordChange } = props;
34
36
  const context = getPConnect().getContextName();
35
37
  let { listType, parameters, datasource = [], columns = [] } = props;
@@ -47,7 +49,7 @@ export default function AutoComplete(props) {
47
49
  }
48
50
  const flattenParameters = (params = {}) => {
49
51
  const flatParams = {};
50
- Object.keys(params).forEach(key => {
52
+ Object.keys(params).forEach((key) => {
51
53
  const { name, value: theVal } = params[key];
52
54
  flatParams[name] = theVal;
53
55
  });
@@ -82,7 +84,7 @@ export default function AutoComplete(props) {
82
84
  columns = preProcessColumns(columns);
83
85
  useEffect(() => {
84
86
  if (listType === 'associated') {
85
- setOptions(Utils.getOptionList(props, getPConnect().getDataObject()));
87
+ setOptions(Utils.getOptionList(props, getPConnect().getDataObject(context)));
86
88
  }
87
89
  }, [theDatasource]);
88
90
  useEffect(() => {
@@ -90,7 +92,7 @@ export default function AutoComplete(props) {
90
92
  getDataPage(datasource, parameters, context).then((results) => {
91
93
  const optionsData = [];
92
94
  const displayColumn = getDisplayFieldsMetaData(columns);
93
- results?.forEach(element => {
95
+ results?.forEach((element) => {
94
96
  const val = element[displayColumn.primary]?.toString();
95
97
  const obj = {
96
98
  key: element[displayColumn.key] || element.pyGUID,
@@ -106,10 +108,10 @@ export default function AutoComplete(props) {
106
108
  return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: value });
107
109
  }
108
110
  if (displayMode === 'STACKED_LARGE_VAL') {
109
- return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: value, variant: 'stacked' });
111
+ return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: value, variant: "stacked" });
110
112
  }
111
113
  if (value) {
112
- const index = options?.findIndex(element => element.key === value);
114
+ const index = options?.findIndex((element) => element.key === value);
113
115
  if (index > -1) {
114
116
  selectedValue = options[index].value;
115
117
  }
@@ -128,7 +130,7 @@ export default function AutoComplete(props) {
128
130
  setInputValue(newInputValue);
129
131
  };
130
132
  if (readOnly) {
131
- const theValAsString = options?.find(opt => opt.key === value)?.value;
133
+ const theValAsString = options?.find((opt) => opt.key === value)?.value;
132
134
  return React.createElement(TextInput, { ...props, value: theValAsString });
133
135
  }
134
136
  // Need to use both getOptionLabel and getOptionSelected to map our
@@ -137,6 +139,6 @@ export default function AutoComplete(props) {
137
139
  return option.value ? option.value : '';
138
140
  }, getOptionSelected: (option) => {
139
141
  return option.value ? option.value : '';
140
- }, fullWidth: true, onChange: handleChange, value: selectedValue, inputValue: inputValue || selectedValue, onInputChange: handleInputValue, renderInput: params => (React.createElement(TextField, { ...params, fullWidth: true, variant: 'outlined', helperText: helperTextToDisplay, placeholder: placeholder, size: 'small', required: required, error: status === 'error', label: label, "data-test-id": testId })) }));
142
+ }, fullWidth: true, onChange: handleChange, value: selectedValue, inputValue: inputValue || selectedValue, onInputChange: handleInputValue, renderInput: (params) => (React.createElement(TextField, { ...params, fullWidth: true, variant: "outlined", helperText: helperTextToDisplay, placeholder: placeholder, size: "small", required: required, error: status === 'error', label: label, "data-test-id": testId })) }));
141
143
  }
142
144
  //# sourceMappingURL=AutoComplete.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AutoComplete.js","sourceRoot":"","sources":["../../../../src/components/field/AutoComplete/AutoComplete.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,YAAY,MAAM,+BAA+B,CAAC;AACzD,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,WAAW,MAAM,2BAA2B,CAAC;AACpD,OAAO,cAAc,MAAM,4CAA4C,CAAC;AAOxE,MAAM,iBAAiB,GAAG,UAAU,CAAC,EAAE;IACrC,OAAO,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;QAC1B,MAAM,UAAU,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC;QAC9B,UAAU,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC;QAC/F,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,wBAAwB,GAAG,UAAU,CAAC,EAAE;IAC5C,MAAM,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,E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ClB,UAAU,EAAE,mBAAmB,EAC/B,WAAW,EAAE,WAAW,EACxB,IAAI,EAAC,OAAO,EACZ,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,MAAM,KAAK,OAAO,EACzB,KAAK,EAAE,KAAK,kBACE,MAAM,GACpB,CACH,GACD,CACH,CAAC;AACJ,CAAC","sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { TextField } from '@material-ui/core';\nimport Autocomplete from '@material-ui/lab/Autocomplete';\nimport Utils from '../../helpers/utils';\nimport TextInput from '../TextInput';\nimport isDeepEqual from 'fast-deep-equal/react';\nimport { getDataPage } from '../../helpers/data_page';\nimport handleEvent from '../../helpers/event-utils';\nimport FieldValueList from '../../designSystemExtension/FieldValueList';\n\ninterface IOption {\n key: string;\n value: string;\n}\n\nconst preProcessColumns = columnList => {\n return columnList.map(col => {\n const tempColObj = { ...col };\n tempColObj.value = col.value && col.value.startsWith('.') ? col.value.substring(1) : col.value;\n return tempColObj;\n });\n};\n\nconst getDisplayFieldsMetaData = columnList => {\n const displayColumns = columnList.filter(col => col.display === 'true');\n const metaDataObj: any = { key: '', primary: '', secondary: [] };\n const keyCol = columnList.filter(col => col.key === 'true');\n metaDataObj.key = keyCol.length > 0 ? keyCol[0].value : 'auto';\n for (let index = 0; index < displayColumns.length; index += 1) {\n if (displayColumns[index].primary === 'true') {\n metaDataObj.primary = displayColumns[index].value;\n } else {\n metaDataObj.secondary.push(displayColumns[index].value);\n }\n }\n return metaDataObj;\n};\n\nexport default function AutoComplete(props) {\n const {\n getPConnect,\n label,\n required,\n placeholder,\n value = '',\n validatemessage,\n readOnly,\n testId,\n displayMode,\n deferDatasource,\n datasourceMetadata,\n status,\n helperText,\n hideLabel,\n onRecordChange\n } = props;\n const context = getPConnect().getContextName();\n let { listType, parameters, datasource = [], columns = [] } = props;\n const [inputValue, setInputValue] = useState('');\n const [options, setOptions] = useState<Array<IOption>>([]);\n const [theDatasource, setDatasource] = useState(null);\n let selectedValue: any = '';\n const helperTextToDisplay = validatemessage || helperText;\n\n const thePConn = getPConnect();\n const actionsApi = thePConn.getActionsApi();\n const propName = thePConn.getStateProps().value;\n\n if (!isDeepEqual(datasource, theDatasource)) {\n // inbound datasource is different, so update theDatasource (to trigger useEffect)\n setDatasource(datasource);\n }\n\n const flattenParameters = (params = {}) => {\n const flatParams = {};\n Object.keys(params).forEach(key => {\n const { name, value: theVal } = params[key];\n flatParams[name] = theVal;\n });\n\n return flatParams;\n };\n\n // convert associated to datapage listtype and transform props\n // Process deferDatasource when datapage name is present. WHhen tableType is promptList / localList\n if (deferDatasource && datasourceMetadata?.datasource?.name) {\n listType = 'datapage';\n datasource = datasourceMetadata.datasource.name;\n parameters = flattenParameters(datasourceMetadata?.datasource?.parameters);\n const displayProp = datasourceMetadata.datasource.propertyForDisplayText.startsWith('@P')\n ? datasourceMetadata.datasource.propertyForDisplayText.substring(3)\n : datasourceMetadata.datasource.propertyForDisplayText;\n const valueProp = datasourceMetadata.datasource.propertyForValue.startsWith('@P')\n ? datasourceMetadata.datasource.propertyForValue.substring(3)\n : datasourceMetadata.datasource.propertyForValue;\n columns = [\n {\n key: 'true',\n setProperty: 'Associated property',\n value: valueProp\n },\n {\n display: 'true',\n primary: 'true',\n useForSearch: true,\n value: displayProp\n }\n ];\n }\n columns = preProcessColumns(columns);\n\n useEffect(() => {\n if (listType === 'associated') {\n setOptions(Utils.getOptionList(props, getPConnect().getDataObject()));\n }\n }, [theDatasource]);\n\n useEffect(() => {\n if (!displayMode && listType !== 'associated') {\n getDataPage(datasource, parameters, context).then((results: any) => {\n const optionsData: Array<any> = [];\n const displayColumn = getDisplayFieldsMetaData(columns);\n results?.forEach(element => {\n const val = element[displayColumn.primary]?.toString();\n const obj = {\n key: element[displayColumn.key] || element.pyGUID,\n value: val\n };\n optionsData.push(obj);\n });\n setOptions(optionsData);\n });\n }\n }, []);\n\n if (displayMode === 'LABELS_LEFT') {\n return <FieldValueList name={hideLabel ? '' : label} value={value} />;\n }\n\n if (displayMode === 'STACKED_LARGE_VAL') {\n return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;\n }\n\n if (value) {\n const index = options?.findIndex(element => element.key === value);\n if (index > -1) {\n selectedValue = options[index].value;\n } else {\n selectedValue = value;\n }\n }\n\n const handleChange = (event: object, newValue) => {\n const val = newValue ? newValue.key : '';\n handleEvent(actionsApi, 'changeNblur', propName, val);\n if (onRecordChange) {\n onRecordChange(event);\n }\n };\n\n const handleInputValue = (event, newInputValue) => {\n setInputValue(newInputValue);\n };\n\n if (readOnly) {\n const theValAsString = options?.find(opt => opt.key === value)?.value;\n return <TextInput {...props} value={theValAsString} />;\n }\n // Need to use both getOptionLabel and getOptionSelected to map our\n // key/value structure to what Autocomplete expects\n return (\n <Autocomplete\n options={options}\n getOptionLabel={(option: IOption) => {\n return option.value ? option.value : '';\n }}\n getOptionSelected={(option: any) => {\n return option.value ? option.value : '';\n }}\n fullWidth\n onChange={handleChange}\n value={selectedValue}\n inputValue={inputValue || selectedValue}\n onInputChange={handleInputValue}\n renderInput={params => (\n <TextField\n {...params}\n fullWidth\n variant='outlined'\n helperText={helperTextToDisplay}\n placeholder={placeholder}\n size='small'\n required={required}\n error={status === 'error'}\n label={label}\n data-test-id={testId}\n />\n )}\n />\n );\n}\n"]}
1
+ {"version":3,"file":"AutoComplete.js","sourceRoot":"","sources":["../../../../src/components/field/AutoComplete/AutoComplete.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,YAAY,MAAM,+BAA+B,CAAC;AACzD,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,WAAW,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,m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CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,KAAK,CAAC,EAAE,KAAK,CAAC;QACxE,OAAO,oBAAC,SAAS,OAAK,KAAK,EAAE,KAAK,EAAE,cAAc,GAAI,CAAC;KACxD;IACD,mEAAmE;IACnE,oDAAoD;IACpD,OAAO,CACL,oBAAC,YAAY,IACX,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,CAAC,MAAe,EAAE,EAAE;YAClC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1C,CAAC,EACD,iBAAiB,EAAE,CAAC,MAAW,EAAE,EAAE;YACjC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1C,CAAC,EACD,SAAS,QACT,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,aAAa,EACpB,UAAU,EAAE,UAAU,IAAI,aAAa,EACvC,aAAa,EAAE,gBAAgB,EAC/B,WAAW,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CACvB,oBAAC,SAAS,OACJ,MAAM,EACV,SAAS,QACT,OAAO,EAAC,UAAU,EAClB,UAAU,EAAE,mBAAmB,EAC/B,WAAW,EAAE,WAAW,EACxB,IAAI,EAAC,OAAO,EACZ,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,MAAM,KAAK,OAAO,EACzB,KAAK,EAAE,KAAK,kBACE,MAAM,GACpB,CACH,GACD,CACH,CAAC;AACJ,CAAC","sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { TextField } from '@material-ui/core';\nimport Autocomplete from '@material-ui/lab/Autocomplete';\nimport isDeepEqual from 'fast-deep-equal/react';\nimport Utils from '../../helpers/utils';\nimport { getDataPage } from '../../helpers/data_page';\nimport handleEvent from '../../helpers/event-utils';\nimport { getComponentFromMap } from '../../../bridge/helpers/sdk_component_map';\nimport type { PConnFieldProps } from '../../../types/PConnProps';\n\ninterface IOption {\n key: string;\n value: string;\n}\n\nconst preProcessColumns = (columnList) => {\n return columnList.map((col) => {\n const tempColObj = { ...col };\n tempColObj.value = col.value && col.value.startsWith('.') ? col.value.substring(1) : col.value;\n return tempColObj;\n });\n};\n\nconst getDisplayFieldsMetaData = (columnList) => {\n const displayColumns = columnList.filter((col) => col.display === 'true');\n const metaDataObj: any = { key: '', primary: '', secondary: [] };\n const keyCol = columnList.filter((col) => col.key === 'true');\n metaDataObj.key = keyCol.length > 0 ? keyCol[0].value : 'auto';\n for (let index = 0; index < displayColumns.length; index += 1) {\n if (displayColumns[index].primary === 'true') {\n metaDataObj.primary = displayColumns[index].value;\n } else {\n metaDataObj.secondary.push(displayColumns[index].value);\n }\n }\n return metaDataObj;\n};\n\ninterface AutoCompleteProps extends PConnFieldProps {\n // If any, enter additional props that only exist on AutoComplete here'\n displayMode?: string;\n deferDatasource?: boolean;\n datasourceMetadata?: any;\n status?: string;\n onRecordChange?: any;\n additionalProps?: object;\n listType: string;\n parameters?: any;\n datasource: any;\n columns: Array<any>;\n}\n\nexport default function AutoComplete(props: AutoCompleteProps) {\n // Get emitted components from map (so we can get any override that may exist)\n const TextInput = getComponentFromMap('TextInput');\n const FieldValueList = getComponentFromMap('FieldValueList');\n\n const {\n getPConnect,\n label,\n required,\n placeholder,\n value = '',\n validatemessage,\n readOnly,\n testId,\n displayMode,\n deferDatasource,\n datasourceMetadata,\n status,\n helperText,\n hideLabel,\n onRecordChange\n } = props;\n\n const context = getPConnect().getContextName();\n let { listType, parameters, datasource = [], columns = [] } = props;\n const [inputValue, setInputValue] = useState('');\n const [options, setOptions] = useState<Array<IOption>>([]);\n const [theDatasource, setDatasource] = useState(null);\n let selectedValue: any = '';\n const helperTextToDisplay = validatemessage || helperText;\n\n const thePConn = getPConnect();\n const actionsApi = thePConn.getActionsApi();\n const propName = thePConn.getStateProps().value;\n\n if (!isDeepEqual(datasource, theDatasource)) {\n // inbound datasource is different, so update theDatasource (to trigger useEffect)\n setDatasource(datasource);\n }\n\n const flattenParameters = (params = {}) => {\n const flatParams = {};\n Object.keys(params).forEach((key) => {\n const { name, value: theVal } = params[key];\n flatParams[name] = theVal;\n });\n\n return flatParams;\n };\n\n // convert associated to datapage listtype and transform props\n // Process deferDatasource when datapage name is present. WHhen tableType is promptList / localList\n if (deferDatasource && datasourceMetadata?.datasource?.name) {\n listType = 'datapage';\n datasource = datasourceMetadata.datasource.name;\n parameters = flattenParameters(datasourceMetadata?.datasource?.parameters);\n const displayProp = datasourceMetadata.datasource.propertyForDisplayText.startsWith('@P')\n ? datasourceMetadata.datasource.propertyForDisplayText.substring(3)\n : datasourceMetadata.datasource.propertyForDisplayText;\n const valueProp = datasourceMetadata.datasource.propertyForValue.startsWith('@P')\n ? datasourceMetadata.datasource.propertyForValue.substring(3)\n : datasourceMetadata.datasource.propertyForValue;\n columns = [\n {\n key: 'true',\n setProperty: 'Associated property',\n value: valueProp\n },\n {\n display: 'true',\n primary: 'true',\n useForSearch: true,\n value: displayProp\n }\n ];\n }\n columns = preProcessColumns(columns);\n\n useEffect(() => {\n if (listType === 'associated') {\n setOptions(Utils.getOptionList(props, getPConnect().getDataObject(context)));\n }\n }, [theDatasource]);\n\n useEffect(() => {\n if (!displayMode && listType !== 'associated') {\n getDataPage(datasource, parameters, context).then((results: any) => {\n const optionsData: Array<any> = [];\n const displayColumn = getDisplayFieldsMetaData(columns);\n results?.forEach((element) => {\n const val = element[displayColumn.primary]?.toString();\n const obj = {\n key: element[displayColumn.key] || element.pyGUID,\n value: val\n };\n optionsData.push(obj);\n });\n setOptions(optionsData);\n });\n }\n }, []);\n\n if (displayMode === 'LABELS_LEFT') {\n return <FieldValueList name={hideLabel ? '' : label} value={value} />;\n }\n\n if (displayMode === 'STACKED_LARGE_VAL') {\n return <FieldValueList name={hideLabel ? '' : label} value={value} variant=\"stacked\" />;\n }\n\n if (value) {\n const index = options?.findIndex((element) => element.key === value);\n if (index > -1) {\n selectedValue = options[index].value;\n } else {\n selectedValue = value;\n }\n }\n\n const handleChange = (event: object, newValue) => {\n const val = newValue ? newValue.key : '';\n handleEvent(actionsApi, 'changeNblur', propName, val);\n if (onRecordChange) {\n onRecordChange(event);\n }\n };\n\n const handleInputValue = (event, newInputValue) => {\n setInputValue(newInputValue);\n };\n\n if (readOnly) {\n const theValAsString = options?.find((opt) => opt.key === value)?.value;\n return <TextInput {...props} value={theValAsString} />;\n }\n // Need to use both getOptionLabel and getOptionSelected to map our\n // key/value structure to what Autocomplete expects\n return (\n <Autocomplete\n options={options}\n getOptionLabel={(option: IOption) => {\n return option.value ? option.value : '';\n }}\n getOptionSelected={(option: any) => {\n return option.value ? option.value : '';\n }}\n fullWidth\n onChange={handleChange}\n value={selectedValue}\n inputValue={inputValue || selectedValue}\n onInputChange={handleInputValue}\n renderInput={(params) => (\n <TextField\n {...params}\n fullWidth\n variant=\"outlined\"\n helperText={helperTextToDisplay}\n placeholder={placeholder}\n size=\"small\"\n required={required}\n error={status === 'error'}\n label={label}\n data-test-id={testId}\n />\n )}\n />\n );\n}\n"]}
@@ -1,5 +1,10 @@
1
1
  /// <reference types="react" />
2
+ import type { PConnFieldProps } from '../../../types/PConnProps';
2
3
  import './CancelAlert.css';
3
- declare const CancelAlert: (props: any) => JSX.Element;
4
- export default CancelAlert;
4
+ interface CancelAlertProps extends PConnFieldProps {
5
+ pConn: any;
6
+ updateAlertState: any;
7
+ }
8
+ export default function CancelAlert(props: CancelAlertProps): JSX.Element;
9
+ export {};
5
10
  //# sourceMappingURL=CancelAlert.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CancelAlert.d.ts","sourceRoot":"","sources":["../../../../src/components/field/CancelAlert/CancelAlert.tsx"],"names":[],"mappings":";AAIA,OAAO,mBAAmB,CAAC;AAI3B,QAAA,MAAM,WAAW,6BAmHhB,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"CancelAlert.d.ts","sourceRoot":"","sources":["../../../../src/components/field/CancelAlert/CancelAlert.tsx"],"names":[],"mappings":";AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,mBAAmB,CAAC;AAM3B,UAAU,gBAAiB,SAAQ,eAAe;IAEhD,KAAK,EAAE,GAAG,CAAC;IACX,gBAAgB,EAAE,GAAG,CAAA;CACtB;AAGD,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,gBAAgB,eAqH1D"}
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
2
2
  import { Button, Grid, IconButton, Snackbar } from '@material-ui/core';
3
3
  import CloseIcon from '@material-ui/icons/Close';
4
4
  import './CancelAlert.css';
5
- const CancelAlert = props => {
5
+ export default function CancelAlert(props) {
6
6
  const { pConn, updateAlertState } = props;
7
7
  const [showSnackbar, setShowSnackbar] = useState(false);
8
8
  const [snackbarMessage, setSnackbarMessage] = useState('');
@@ -10,6 +10,8 @@ const CancelAlert = props => {
10
10
  const caseInfo = pConn.getCaseInfo();
11
11
  const caseName = caseInfo.getName();
12
12
  const ID = caseInfo.getID();
13
+ const localizedVal = PCore.getLocaleUtils().getLocaleValue;
14
+ const localeCategory = 'ModalContainer';
13
15
  function showToast(message) {
14
16
  setSnackbarMessage(message);
15
17
  setShowSnackbar(true);
@@ -38,7 +40,7 @@ const CancelAlert = props => {
38
40
  PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CASE_CREATED);
39
41
  })
40
42
  .catch(() => {
41
- showToast('Save failed');
43
+ showToast(localizedVal('Save failed', localeCategory));
42
44
  });
43
45
  break;
44
46
  case 'continue':
@@ -53,7 +55,7 @@ const CancelAlert = props => {
53
55
  PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL);
54
56
  })
55
57
  .catch(() => {
56
- showToast('Delete failed.');
58
+ showToast(localizedVal('Delete failed.', localeCategory));
57
59
  });
58
60
  break;
59
61
  default:
@@ -65,17 +67,17 @@ const CancelAlert = props => {
65
67
  React.createElement("div", { className: 'cancel-alert-top' },
66
68
  React.createElement("h3", null, `Delete ${caseName}(${ID})`),
67
69
  React.createElement("div", null,
68
- React.createElement("p", null, `Are you sure you want to delete ${caseName} (${ID})?`),
69
- React.createElement("p", null, "Alternatively, you can continue working or save your work for later.")),
70
+ React.createElement("p", null, `${localizedVal('Are you sure you want to delete', localeCategory)} ${caseName} (${ID})?`),
71
+ React.createElement("p", null, localizedVal('Alternatively, you can continue working or save your work for later.', localeCategory))),
70
72
  React.createElement("div", { className: 'action-controls' },
71
73
  React.createElement(Grid, { container: true, spacing: 4, justifyContent: 'space-between' },
72
74
  React.createElement(Grid, { item: true },
73
- React.createElement(Button, { variant: 'outlined', color: 'primary', onClick: () => buttonClick('save') }, "Save for later")),
75
+ React.createElement(Button, { variant: 'outlined', color: 'primary', onClick: () => buttonClick('save') }, localizedVal('Save for later', localeCategory))),
74
76
  React.createElement(Grid, { item: true },
75
- React.createElement(Button, { variant: 'outlined', color: 'primary', onClick: () => buttonClick('continue') }, "Continue Working"),
76
- React.createElement(Button, { variant: 'contained', color: 'primary', onClick: () => buttonClick('delete') }, "Delete")))))),
77
+ React.createElement(Button, { variant: 'outlined', color: 'primary', onClick: () => buttonClick('continue') }, localizedVal('Continue Working', localeCategory)),
78
+ React.createElement(Button, { variant: 'contained', color: 'primary', onClick: () => buttonClick('delete') }, localizedVal('Delete', localeCategory))))))),
77
79
  React.createElement(Snackbar, { open: showSnackbar, autoHideDuration: 3000, onClose: handleSnackbarClose, message: snackbarMessage, action: React.createElement(IconButton, { size: 'small', "aria-label": 'close', color: 'inherit', onClick: handleSnackbarClose },
78
80
  React.createElement(CloseIcon, { fontSize: 'small' })) })));
79
- };
80
- export default CancelAlert;
81
+ }
82
+ ;
81
83
  //# sourceMappingURL=CancelAlert.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CancelAlert.js","sourceRoot":"","sources":["../../../../src/components/field/CancelAlert/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EAAC,iBAAiB;oBAC9B,oBAAC,IAAI,IAAC,SAAS,QAAC,OAAO,EAAE,CAAC,EAAE,cAAc,EAAC,eAAe;wBACxD,oBAAC,IAAI,IAAC,IAAI;4BACR,oBAAC,MAAM,IAAC,OAAO,EAAC,UAAU,EAAC,KAAK,EAAC,SAAS,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,qBAEpE,CACJ;wBACP,oBAAC,IAAI,IAAC,IAAI;4BACR,oBAAC,MAAM,IAAC,OAAO,EAAC,UAAU,EAAC,KAAK,EAAC,SAAS,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,UAAU,CAAC,uBAExE;4BACT,oBAAC,MAAM,IAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,SAAS,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,aAEvE,CACJ,CACF,CACH,CACF,CACF;QACN,oBAAC,QAAQ,IACP,IAAI,EAAE,YAAY,EAClB,gBAAgB,EAAE,IAAI,EACtB,OAAO,EAAE,mBAAmB,EAC5B,OAAO,EAAE,eAAe,EACxB,MAAM,EACJ,oBAAC,UAAU,IAAC,IAAI,EAAC,OAAO,gBAAY,OAAO,EAAC,KAAK,EAAC,SAAS,EAAC,OAAO,EAAE,mBAAmB;gBACtF,oBAAC,SAAS,IAAC,QAAQ,EAAC,OAAO,GAAG,CACnB,GAEf,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import React, { useState } from 'react';\nimport { Button, Grid, IconButton, Snackbar } from '@material-ui/core';\nimport CloseIcon from '@material-ui/icons/Close';\n\nimport './CancelAlert.css';\n\ndeclare const PCore;\n\nconst CancelAlert = props => {\n const { pConn, updateAlertState } = props;\n const [showSnackbar, setShowSnackbar] = useState(false);\n const [snackbarMessage, setSnackbarMessage] = useState('');\n\n const itemKey = pConn.getContextName();\n const caseInfo = pConn.getCaseInfo();\n const caseName = caseInfo.getName();\n const ID = caseInfo.getID();\n\n function showToast(message: string) {\n setSnackbarMessage(message);\n setShowSnackbar(true);\n }\n\n const dismissCancelAlertOnly = () => {\n updateAlertState(true);\n };\n\n const dismissModal = () => {\n updateAlertState(false);\n };\n\n function handleSnackbarClose(event: React.SyntheticEvent | React.MouseEvent, reason?: string) {\n if (reason === 'clickaway') {\n return;\n }\n setShowSnackbar(false);\n }\n\n const buttonClick = action => {\n const actionsAPI = pConn.getActionsApi();\n\n switch (action) {\n case 'save':\n // eslint-disable-next-line no-case-declarations\n const savePromise = actionsAPI.saveAndClose(itemKey);\n\n savePromise\n .then(() => {\n dismissModal();\n\n PCore.getPubSubUtils().publish(\n PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CASE_CREATED\n );\n })\n .catch(() => {\n showToast('Save failed');\n });\n break;\n\n case 'continue':\n dismissCancelAlertOnly();\n break;\n\n case 'delete':\n // eslint-disable-next-line no-case-declarations\n const deletePromise = actionsAPI.deleteCaseInCreateStage(itemKey);\n\n deletePromise\n .then(() => {\n dismissModal();\n PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL);\n })\n .catch(() => {\n showToast('Delete failed.');\n });\n break;\n\n default:\n break;\n }\n };\n\n return (\n <>\n <div className='cancel-alert-background'>\n <div className='cancel-alert-top'>\n <h3>{`Delete ${caseName}(${ID})`}</h3>\n <div>\n <p>{`Are you sure you want to delete ${caseName} (${ID})?`}</p>\n <p>Alternatively, you can continue working or save your work for later.</p>\n </div>\n <div className='action-controls'>\n <Grid container spacing={4} justifyContent='space-between'>\n <Grid item>\n <Button variant='outlined' color='primary' onClick={() => buttonClick('save')}>\n Save for later\n </Button>\n </Grid>\n <Grid item>\n <Button variant='outlined' color='primary' onClick={() => buttonClick('continue')}>\n Continue Working\n </Button>\n <Button variant='contained' color='primary' onClick={() => buttonClick('delete')}>\n Delete\n </Button>\n </Grid>\n </Grid>\n </div>\n </div>\n </div>\n <Snackbar\n open={showSnackbar}\n autoHideDuration={3000}\n onClose={handleSnackbarClose}\n message={snackbarMessage}\n action={\n <IconButton size='small' aria-label='close' color='inherit' onClick={handleSnackbarClose}>\n <CloseIcon fontSize='small' />\n </IconButton>\n }\n />\n </>\n );\n};\n\nexport default CancelAlert;\n"]}
1
+ {"version":3,"file":"CancelAlert.js","sourceRoot":"","sources":["../../../../src/components/field/CancelAlert/CancelAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,SAAS,MAAM,0BAA0B,CAAC;AAEjD,OAAO,mBAAmB,CAAC;AAa3B,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAuB;IACzD,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,GAAG,KAAK,CAAC;IAC1C,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxD,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAE3D,MAAM,OAAO,GAAG,KAAK,CAAC,cAAc,EAAE,CAAC;IACvC,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;IACrC,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,EAAE,CAAC;IACpC,MAAM,EAAE,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC;IAC5B,MAAM,YAAY,GAAG,KAAK,CAAC,cAAc,EAAE,CAAC,cAAc,CAAC;IAC3D,MAAM,cAAc,GAAG,gBAAgB,CAAC;IAExC,SAAS,SAAS,CAAC,OAAe;QAChC,kBAAkB,CAAC,OAAO,CAAC,CAAC;QAC5B,eAAe,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;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CACF,CACH,CACF,CACF;QACN,oBAAC,QAAQ,IACP,IAAI,EAAE,YAAY,EAClB,gBAAgB,EAAE,IAAI,EACtB,OAAO,EAAE,mBAAmB,EAC5B,OAAO,EAAE,eAAe,EACxB,MAAM,EACJ,oBAAC,UAAU,IAAC,IAAI,EAAC,OAAO,gBAAY,OAAO,EAAC,KAAK,EAAC,SAAS,EAAC,OAAO,EAAE,mBAAmB;gBACtF,oBAAC,SAAS,IAAC,QAAQ,EAAC,OAAO,GAAG,CACnB,GAEf,CACD,CACJ,CAAC;AACJ,CAAC;AAAA,CAAC","sourcesContent":["import React, { useState } from 'react';\nimport { Button, Grid, IconButton, Snackbar } from '@material-ui/core';\nimport CloseIcon from '@material-ui/icons/Close';\nimport type { PConnFieldProps } from '../../../types/PConnProps';\nimport './CancelAlert.css';\n\n// Remove this and use \"real\" PCore type once .d.ts is fixed (currently shows 2 errors)\ndeclare const PCore: any;\n\n\ninterface CancelAlertProps extends PConnFieldProps {\n // If any, enter additional props that only exist on CancelAlert here\n pConn: any,\n updateAlertState: any\n}\n\n\nexport default function CancelAlert(props: CancelAlertProps) {\n const { pConn, updateAlertState } = props;\n const [showSnackbar, setShowSnackbar] = useState(false);\n const [snackbarMessage, setSnackbarMessage] = useState('');\n\n const itemKey = pConn.getContextName();\n const caseInfo = pConn.getCaseInfo();\n const caseName = caseInfo.getName();\n const ID = caseInfo.getID();\n const localizedVal = PCore.getLocaleUtils().getLocaleValue;\n const localeCategory = 'ModalContainer';\n\n function showToast(message: string) {\n setSnackbarMessage(message);\n setShowSnackbar(true);\n }\n\n const dismissCancelAlertOnly = () => {\n updateAlertState(true);\n };\n\n const dismissModal = () => {\n updateAlertState(false);\n };\n\n function handleSnackbarClose(event: React.SyntheticEvent | React.MouseEvent, reason?: string) {\n if (reason === 'clickaway') {\n return;\n }\n setShowSnackbar(false);\n }\n\n const buttonClick = action => {\n const actionsAPI = pConn.getActionsApi();\n\n switch (action) {\n case 'save':\n // eslint-disable-next-line no-case-declarations\n const savePromise = actionsAPI.saveAndClose(itemKey);\n\n savePromise\n .then(() => {\n dismissModal();\n\n PCore.getPubSubUtils().publish(\n PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CASE_CREATED\n );\n })\n .catch(() => {\n showToast(localizedVal('Save failed', localeCategory));\n });\n break;\n\n case 'continue':\n dismissCancelAlertOnly();\n break;\n\n case 'delete':\n // eslint-disable-next-line no-case-declarations\n const deletePromise = actionsAPI.deleteCaseInCreateStage(itemKey);\n\n deletePromise\n .then(() => {\n dismissModal();\n PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL);\n })\n .catch(() => {\n showToast(localizedVal('Delete failed.', localeCategory));\n });\n break;\n\n default:\n break;\n }\n };\n\n return (\n <>\n <div className='cancel-alert-background'>\n <div className='cancel-alert-top'>\n <h3>{`Delete ${caseName}(${ID})`}</h3>\n <div>\n <p>{`${localizedVal('Are you sure you want to delete', localeCategory)} ${caseName} (${ID})?`}</p>\n <p>{localizedVal('Alternatively, you can continue working or save your work for later.', localeCategory)}</p>\n </div>\n <div className='action-controls'>\n <Grid container spacing={4} justifyContent='space-between'>\n <Grid item>\n <Button variant='outlined' color='primary' onClick={() => buttonClick('save')}>\n {localizedVal('Save for later', localeCategory)}\n </Button>\n </Grid>\n <Grid item>\n <Button variant='outlined' color='primary' onClick={() => buttonClick('continue')}>\n {localizedVal('Continue Working', localeCategory)}\n </Button>\n <Button variant='contained' color='primary' onClick={() => buttonClick('delete')}>\n {localizedVal('Delete', localeCategory)}\n </Button>\n </Grid>\n </Grid>\n </div>\n </div>\n </div>\n <Snackbar\n open={showSnackbar}\n autoHideDuration={3000}\n onClose={handleSnackbarClose}\n message={snackbarMessage}\n action={\n <IconButton size='small' aria-label='close' color='inherit' onClick={handleSnackbarClose}>\n <CloseIcon fontSize='small' />\n </IconButton>\n }\n />\n </>\n );\n};\n"]}
@@ -1,3 +1,21 @@
1
1
  /// <reference types="react" />
2
- export default function CheckboxComponent(props: any): JSX.Element;
2
+ import type { PConnProps } from '../../../types/PConnProps';
3
+ interface CheckboxProps extends PConnProps {
4
+ value?: boolean;
5
+ label: string;
6
+ required: boolean;
7
+ disabled: boolean;
8
+ validatemessage: string;
9
+ status?: string;
10
+ onChange: any;
11
+ onBlur?: any;
12
+ readOnly: boolean;
13
+ testId: string;
14
+ helperText: string;
15
+ displayMode?: string;
16
+ hideLabel: boolean;
17
+ placeholder?: string;
18
+ }
19
+ export default function CheckboxComponent(props: CheckboxProps): JSX.Element;
20
+ export {};
3
21
  //# sourceMappingURL=Checkbox.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Checkbox/Checkbox.tsx"],"names":[],"mappings":";AAWA,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,KAAK,KAAA,eAoE9C"}
1
+ {"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Checkbox/Checkbox.tsx"],"names":[],"mappings":";AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAK5D,UAAU,aAAc,SAAQ,UAAU;IAIxC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,QAAQ,EAAE,GAAG,CAAC;IAEd,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IAEnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,KAAK,EAAE,aAAa,eAwE7D"}
@@ -1,9 +1,11 @@
1
1
  import React, { useState, useEffect } from 'react';
2
2
  import { Checkbox, FormControl, FormControlLabel, FormGroup, FormHelperText } from '@material-ui/core';
3
3
  import handleEvent from '../../helpers/event-utils';
4
- import FieldValueList from '../../designSystemExtension/FieldValueList';
4
+ import { getComponentFromMap } from '../../../bridge/helpers/sdk_component_map';
5
5
  export default function CheckboxComponent(props) {
6
- const { getPConnect, label, value = false, readOnly, testId, required, status, helperText, validatemessage, displayMode, hideLabel } = props;
6
+ // Get emitted components from map (so we can get any override that may exist)
7
+ const FieldValueList = getComponentFromMap('FieldValueList');
8
+ const { getPConnect, label, value = false, readOnly, testId, required, disabled, status, helperText, validatemessage, displayMode, hideLabel } = props;
7
9
  const helperTextToDisplay = validatemessage || helperText;
8
10
  const thePConn = getPConnect();
9
11
  const theConfigProps = thePConn.getConfigProps();
@@ -16,26 +18,26 @@ export default function CheckboxComponent(props) {
16
18
  setChecked(value);
17
19
  }, [value]);
18
20
  if (displayMode === 'LABELS_LEFT') {
19
- return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: value });
21
+ return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: value.toString() });
20
22
  }
21
23
  if (displayMode === 'STACKED_LARGE_VAL') {
22
- return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: value, variant: 'stacked' });
24
+ return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: value.toString(), variant: "stacked" });
23
25
  }
24
- const handleChange = event => {
26
+ const handleChange = (event) => {
25
27
  handleEvent(actionsApi, 'changeNblur', propName, event.target.checked);
26
28
  };
27
- const handleBlur = event => {
28
- thePConn.getValidationApi().validate(event.target.checked);
29
+ const handleBlur = (event) => {
30
+ thePConn.getValidationApi().validate(event.target.checked, ''); // 2nd arg empty string until typedef marked correctly as optional
29
31
  };
30
- let theCheckbox = React.createElement(Checkbox, { color: 'primary' });
32
+ let theCheckbox = React.createElement(Checkbox, { color: "primary", disabled: disabled });
31
33
  if (readOnly) {
32
34
  // Workaround for lack of InputProps readOnly from https://github.com/mui-org/material-ui/issues/17043
33
35
  // Also note that we need to turn off the onChange call in the FormControlLabel wrapper, too. See below!
34
- theCheckbox = React.createElement(Checkbox, { value: value || false, onChange: handleChange, readOnly: readOnly });
36
+ theCheckbox = React.createElement(Checkbox, { value: value || false, readOnly: readOnly });
35
37
  }
36
38
  return (React.createElement(FormControl, { required: required, error: status === 'error' },
37
39
  React.createElement(FormGroup, null,
38
- React.createElement(FormControlLabel, { control: theCheckbox, checked: checked, onChange: !readOnly ? handleChange : undefined, onBlur: !readOnly ? handleBlur : undefined, label: caption, labelPlacement: 'end', "data-test-id": testId })),
40
+ React.createElement(FormControlLabel, { control: theCheckbox, checked: checked, onChange: !readOnly ? handleChange : undefined, onBlur: !readOnly ? handleBlur : undefined, label: caption, labelPlacement: "end", "data-test-id": testId })),
39
41
  React.createElement(FormHelperText, null, helperTextToDisplay)));
40
42
  }
41
43
  //# sourceMappingURL=Checkbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../../../src/components/field/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EACL,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,cAAc,EACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,WAAW,MAAM,2BAA2B,CAAC;AACpD,OAAO,cAAc,MAAM,4CAA4C,CAAC;AAExE,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,KAAK;IAC7C,MAAM,EACJ,WAAW,EACX,KAAK,EACL,KAAK,GAAG,KAAK,EACb,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,MAAM,EACN,UAAU,EACV,eAAe,EACf,WAAW,EACX,SAAS,EACV,GAAG,KAAK,CAAC;IACV,MAAM,mBAAmB,GAAG,eAA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Q,IAAC,KAAK,EAAC,SAAS,GAAG,CAAC;IAE/C,IAAI,QAAQ,EAAE;QACZ,sGAAsG;QACtG,yGAAyG;QACzG,WAAW,GAAG,oBAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,IAAI,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAAC;KAC/F;IAED,OAAO,CACL,oBAAC,WAAW,IAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO;QACxD,oBAAC,SAAS;YACR,oBAAC,gBAAgB,IACf,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,EAC9C,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EAC1C,KAAK,EAAE,OAAO,EACd,cAAc,EAAC,KAAK,kBACN,MAAM,GACpB,CACQ;QACZ,oBAAC,cAAc,QAAE,mBAAmB,CAAkB,CAC1C,CACf,CAAC;AACJ,CAAC","sourcesContent":["import React, { useState, useEffect } from 'react';\nimport {\n Checkbox,\n FormControl,\n FormControlLabel,\n FormGroup,\n FormHelperText\n} from '@material-ui/core';\nimport handleEvent from '../../helpers/event-utils';\nimport FieldValueList from '../../designSystemExtension/FieldValueList';\n\nexport default function CheckboxComponent(props) {\n const {\n getPConnect,\n label,\n value = false,\n readOnly,\n testId,\n required,\n status,\n helperText,\n validatemessage,\n displayMode,\n hideLabel\n } = props;\n const helperTextToDisplay = validatemessage || helperText;\n\n const thePConn = getPConnect();\n const theConfigProps = thePConn.getConfigProps();\n const { caption } = theConfigProps;\n const actionsApi = thePConn.getActionsApi();\n const propName = thePConn.getStateProps().value;\n\n const [checked, setChecked] = useState(false);\n useEffect(() => {\n // This update theSelectedButton which will update the UI to show the selected button correctly\n setChecked(value);\n }, [value]);\n\n if (displayMode === 'LABELS_LEFT') {\n return <FieldValueList name={hideLabel ? '' : label} value={value} />;\n }\n\n if (displayMode === 'STACKED_LARGE_VAL') {\n return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;\n }\n\n const handleChange = event => {\n handleEvent(actionsApi, 'changeNblur', propName, event.target.checked);\n };\n\n const handleBlur = event => {\n thePConn.getValidationApi().validate(event.target.checked);\n };\n\n let theCheckbox = <Checkbox color='primary' />;\n\n if (readOnly) {\n // Workaround for lack of InputProps readOnly from https://github.com/mui-org/material-ui/issues/17043\n // Also note that we need to turn off the onChange call in the FormControlLabel wrapper, too. See below!\n theCheckbox = <Checkbox value={value || false} onChange={handleChange} readOnly={readOnly} />;\n }\n\n return (\n <FormControl required={required} error={status === 'error'}>\n <FormGroup>\n <FormControlLabel\n control={theCheckbox}\n checked={checked}\n onChange={!readOnly ? handleChange : undefined}\n onBlur={!readOnly ? handleBlur : undefined}\n label={caption}\n labelPlacement='end'\n data-test-id={testId}\n />\n </FormGroup>\n <FormHelperText>{helperTextToDisplay}</FormHelperText>\n </FormControl>\n );\n}\n"]}
1
+ {"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../../../src/components/field/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,gBAAgB,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACvG,OAAO,WAAW,MAAM,2BAA2B,CAAC;AAEpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AA2BhF,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,KAAoB;IAC5D,8EAA8E;IAC9E,MAAM,cAAc,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IAE7D,MAAM,EACJ,WAAW,EACX,KAAK,EACL,KAAK,GAAG,KAAK,EACb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C;IAEF,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,EAAE;QAC3B,QAAQ,CAAC,gBAAgB,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,kEAAkE;IACpI,CAAC,CAAC;IAEF,IAAI,WAAW,GAAG,oBAAC,QAAQ,IAAC,KAAK,EAAC,SAAS,EAAC,QAAQ,EAAE,QAAQ,GAAI,CAAC;IAEnE,IAAI,QAAQ,EAAE;QACZ,sGAAsG;QACtG,yGAAyG;QACzG,WAAW,GAAG,oBAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,IAAI,KAAK,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAAC;KACvE;IAED,OAAO,CACL,oBAAC,WAAW,IAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO;QACxD,oBAAC,SAAS;YACR,oBAAC,gBAAgB,IACf,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,EAC9C,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EAC1C,KAAK,EAAE,OAAO,EACd,cAAc,EAAC,KAAK,kBACN,MAAM,GACpB,CACQ;QACZ,oBAAC,cAAc,QAAE,mBAAmB,CAAkB,CAC1C,CACf,CAAC;AACJ,CAAC","sourcesContent":["import React, { useState, useEffect } from 'react';\nimport { Checkbox, FormControl, FormControlLabel, FormGroup, FormHelperText } from '@material-ui/core';\nimport handleEvent from '../../helpers/event-utils';\nimport type { PConnProps } from '../../../types/PConnProps';\nimport { getComponentFromMap } from '../../../bridge/helpers/sdk_component_map';\n\n// Checkbox passes in 'value' as a boolean. So can't use the default\n// PConnFieldProps since it expects value to be a string.\ninterface CheckboxProps extends PConnProps {\n // If any, enter additional props that only exist on Checkbox here\n // Everything from PConnFieldProps except value and change type of value to boolean\n\n value?: boolean;\n label: string;\n required: boolean;\n disabled: boolean;\n validatemessage: string;\n status?: string;\n // eslint-disable-next-line react/no-unused-prop-types\n onChange: any;\n // eslint-disable-next-line react/no-unused-prop-types\n onBlur?: any;\n readOnly: boolean;\n testId: string;\n helperText: string;\n displayMode?: string;\n hideLabel: boolean;\n // eslint-disable-next-line react/no-unused-prop-types\n placeholder?: string;\n}\n\nexport default function CheckboxComponent(props: CheckboxProps) {\n // Get emitted components from map (so we can get any override that may exist)\n const FieldValueList = getComponentFromMap('FieldValueList');\n\n const {\n getPConnect,\n label,\n value = false,\n readOnly,\n testId,\n required,\n disabled,\n status,\n helperText,\n validatemessage,\n displayMode,\n hideLabel\n } = props;\n const helperTextToDisplay = validatemessage || helperText;\n\n const thePConn = getPConnect();\n const theConfigProps = thePConn.getConfigProps();\n const { caption } = theConfigProps;\n const actionsApi = thePConn.getActionsApi();\n const propName = thePConn.getStateProps().value;\n\n const [checked, setChecked] = useState(false);\n useEffect(() => {\n // This update theSelectedButton which will update the UI to show the selected button correctly\n setChecked(value);\n }, [value]);\n\n if (displayMode === 'LABELS_LEFT') {\n return <FieldValueList name={hideLabel ? '' : label} value={value.toString()} />;\n }\n\n if (displayMode === 'STACKED_LARGE_VAL') {\n return <FieldValueList name={hideLabel ? '' : label} value={value.toString()} variant=\"stacked\" />;\n }\n\n const handleChange = (event) => {\n handleEvent(actionsApi, 'changeNblur', propName, event.target.checked);\n };\n\n const handleBlur = (event) => {\n thePConn.getValidationApi().validate(event.target.checked, ''); // 2nd arg empty string until typedef marked correctly as optional\n };\n\n let theCheckbox = <Checkbox color=\"primary\" disabled={disabled} />;\n\n if (readOnly) {\n // Workaround for lack of InputProps readOnly from https://github.com/mui-org/material-ui/issues/17043\n // Also note that we need to turn off the onChange call in the FormControlLabel wrapper, too. See below!\n theCheckbox = <Checkbox value={value || false} readOnly={readOnly} />;\n }\n\n return (\n <FormControl required={required} error={status === 'error'}>\n <FormGroup>\n <FormControlLabel\n control={theCheckbox}\n checked={checked}\n onChange={!readOnly ? handleChange : undefined}\n onBlur={!readOnly ? handleBlur : undefined}\n label={caption}\n labelPlacement=\"end\"\n data-test-id={testId}\n />\n </FormGroup>\n <FormHelperText>{helperTextToDisplay}</FormHelperText>\n </FormControl>\n );\n}\n"]}
@@ -1,3 +1,8 @@
1
1
  /// <reference types="react" />
2
- export default function Currency(props: any): JSX.Element;
2
+ import type { PConnFieldProps } from '../../../types/PConnProps';
3
+ interface CurrrencyProps extends PConnFieldProps {
4
+ currencyISOCode?: string;
5
+ }
6
+ export default function Currency(props: CurrrencyProps): JSX.Element;
7
+ export {};
3
8
  //# sourceMappingURL=Currency.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Currency.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Currency/Currency.tsx"],"names":[],"mappings":";AAUA,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,KAAA,eAwGrC"}
1
+ {"version":3,"file":"Currency.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Currency/Currency.tsx"],"names":[],"mappings":";AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAIjE,UAAU,cAAe,SAAQ,eAAe;IAE9C,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE,cAAc,eA2GrD"}
@@ -1,15 +1,15 @@
1
1
  import React, { useState, useEffect } from 'react';
2
- // import { TextField } from "@material-ui/core";
3
2
  import CurrencyTextField from '@unicef/material-ui-currency-textfield';
4
3
  import handleEvent from '../../helpers/event-utils';
5
- import FieldValueList from '../../designSystemExtension/FieldValueList';
6
- import { format } from "../../helpers/formatters";
4
+ import { format } from '../../helpers/formatters';
7
5
  import { getCurrencyCharacters, getCurrencyOptions } from './currency-utils';
8
- // Using control from: https://github.com/unicef/material-ui-currency-textfield
6
+ import { getComponentFromMap } from '../../../bridge/helpers/sdk_component_map';
9
7
  export default function Currency(props) {
8
+ // Get emitted components from map (so we can get any override that may exist)
9
+ const FieldValueList = getComponentFromMap('FieldValueList');
10
10
  const { getPConnect, label, required, disabled, value = '', validatemessage, status,
11
11
  /* onChange, onBlur, */
12
- readOnly, testId, helperText, displayMode, hideLabel, currencyISOCode = "USD" } = props;
12
+ readOnly, testId, helperText, displayMode, hideLabel, currencyISOCode = 'USD' } = props;
13
13
  const pConn = getPConnect();
14
14
  const actions = pConn.getActionsApi();
15
15
  const propName = pConn.getStateProps().value;
@@ -23,10 +23,10 @@ export default function Currency(props) {
23
23
  testProp = {
24
24
  'data-test-id': testId
25
25
  };
26
- const [currValue, setCurrValue] = useState();
27
- const [theCurrSym, setCurrSym] = useState("$");
28
- const [theCurrDec, setCurrDec] = useState(".");
29
- const [theCurrSep, setCurrSep] = useState(",");
26
+ const [currValue, setCurrValue] = useState('');
27
+ const [theCurrSym, setCurrSym] = useState('$');
28
+ const [theCurrDec, setCurrDec] = useState('.');
29
+ const [theCurrSep, setCurrSep] = useState(',');
30
30
  useEffect(() => {
31
31
  // currencySymbols looks like this: { theCurrencySymbol: '$', theDecimalIndicator: '.', theSeparator: ',' }
32
32
  const theSymbols = getCurrencyCharacters(currencyISOCode);
@@ -44,7 +44,7 @@ export default function Currency(props) {
44
44
  return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: formattedValue });
45
45
  }
46
46
  if (displayMode === 'STACKED_LARGE_VAL') {
47
- return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: formattedValue, variant: 'stacked' });
47
+ return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: formattedValue, variant: "stacked" });
48
48
  }
49
49
  // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
50
50
  function currOnChange(event, inValue) {
@@ -57,6 +57,6 @@ export default function Currency(props) {
57
57
  handleEvent(actions, 'changeNblur', propName, inValue !== '' ? Number(inValue) : inValue);
58
58
  }
59
59
  // console.log(`theCurrSym: ${theCurrSym} | theCurrDec: ${theCurrDec} | theCurrSep: ${theCurrSep}`);
60
- return (React.createElement(CurrencyTextField, { fullWidth: true, variant: readOnly ? 'standard' : 'outlined', helperText: helperTextToDisplay, placeholder: '', size: 'small', required: required, disabled: disabled, onChange: currOnChange, onBlur: !readOnly ? currOnBlur : undefined, error: status === 'error', label: label, value: currValue, type: 'text', outputFormat: 'number', textAlign: 'left', InputProps: { ...readOnlyProp, inputProps: { ...testProp, value: currValue } }, currencySymbol: theCurrSym, decimalCharacter: theCurrDec, digitGroupSeparator: theCurrSep }));
60
+ return (React.createElement(CurrencyTextField, { fullWidth: true, variant: readOnly ? 'standard' : 'outlined', helperText: helperTextToDisplay, placeholder: "", size: "small", required: required, disabled: disabled, onChange: currOnChange, onBlur: !readOnly ? currOnBlur : undefined, error: status === 'error', label: label, value: currValue, type: "text", outputFormat: "number", textAlign: "left", InputProps: { ...readOnlyProp, inputProps: { ...testProp, value: currValue } }, currencySymbol: theCurrSym, decimalCharacter: theCurrDec, digitGroupSeparator: theCurrSep }));
61
61
  }
62
62
  //# sourceMappingURL=Currency.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Currency.js","sourceRoot":"","sources":["../../../../src/components/field/Currency/Currency.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,iDAAiD;AACjD,OAAO,iBAAiB,MAAM,wCAAwC,CAAC;AACvE,OAAO,WAAW,MAAM,2BAA2B,CAAC;AACpD,OAAO,cAAc,MAAM,4CAA4C,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE7E,+EAA+E;AAE/E,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK;IACpC,MAAM,EACJ,WAAW,EACX,KAAK,EACL,QAAQ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AU,EAC3C,UAAU,EAAE,mBAAmB,EAC/B,WAAW,EAAC,EAAE,EACd,IAAI,EAAC,OAAO,EACZ,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EAC1C,KAAK,EAAE,MAAM,KAAK,OAAO,EACzB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,SAAS,EAChB,IAAI,EAAC,MAAM,EACX,YAAY,EAAC,QAAQ,EACrB,SAAS,EAAC,MAAM,EAChB,UAAU,EAAE,EAAE,GAAG,YAAY,EAAE,UAAU,EAAE,EAAE,GAAG,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAC9E,cAAc,EAAE,UAAU,EAC1B,gBAAgB,EAAE,UAAU,EAC5B,mBAAmB,EAAE,UAAU,GAC/B,CACH,CAAC;AACJ,CAAC","sourcesContent":["import React, { useState, useEffect } from 'react';\n// import { TextField } from \"@material-ui/core\";\nimport CurrencyTextField from '@unicef/material-ui-currency-textfield';\nimport handleEvent from '../../helpers/event-utils';\nimport FieldValueList from '../../designSystemExtension/FieldValueList';\nimport { format } from \"../../helpers/formatters\";\nimport { getCurrencyCharacters, getCurrencyOptions } from './currency-utils';\n\n// Using control from: https://github.com/unicef/material-ui-currency-textfield\n\nexport default function Currency(props) {\n const {\n getPConnect,\n label,\n required,\n disabled,\n value = '',\n validatemessage,\n status,\n /* onChange, onBlur, */\n readOnly,\n testId,\n helperText,\n displayMode,\n hideLabel,\n currencyISOCode = \"USD\"\n } = props;\n\n const pConn = getPConnect();\n const actions = pConn.getActionsApi();\n const propName = pConn.getStateProps().value;\n const helperTextToDisplay = validatemessage || helperText;\n\n // console.log(`Currency: label: ${label} value: ${value}`);\n\n let readOnlyProp = {}; // Note: empty if NOT ReadOnly\n\n if (readOnly) {\n readOnlyProp = { readOnly: true };\n }\n\n let testProp = {};\n\n testProp = {\n 'data-test-id': testId\n };\n\n const [currValue, setCurrValue] = useState();\n const [theCurrSym, setCurrSym] = useState(\"$\");\n const [theCurrDec, setCurrDec] = useState(\".\");\n const [theCurrSep, setCurrSep] = useState(\",\");\n\n useEffect(() => {\n // currencySymbols looks like this: { theCurrencySymbol: '$', theDecimalIndicator: '.', theSeparator: ',' }\n const theSymbols = getCurrencyCharacters(currencyISOCode);\n setCurrSym(theSymbols.theCurrencySymbol);\n setCurrDec(theSymbols.theDecimalIndicator);\n setCurrSep(theSymbols.theDigitGroupSeparator);\n }, [currencyISOCode]);\n\n useEffect(() => {\n // const testVal = value;\n setCurrValue(value.toString());\n }, [value]);\n\n const theCurrencyOptions = getCurrencyOptions(currencyISOCode);\n const formattedValue = format(value, pConn.getComponentName().toLowerCase(), theCurrencyOptions);\n\n if (displayMode === 'LABELS_LEFT') {\n return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} />;\n }\n\n if (displayMode === 'STACKED_LARGE_VAL') {\n return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} variant='stacked' />;\n }\n\n // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\n function currOnChange(event, inValue) {\n // console.log(`Currency currOnChange inValue: ${inValue}`);\n\n // update internal value\n setCurrValue(event?.target?.value);\n }\n\n function currOnBlur(event, inValue) {\n // console.log(`Currency currOnBlur inValue: ${inValue}`);\n handleEvent(actions, 'changeNblur', propName, inValue !== '' ? Number(inValue) : inValue);\n }\n\n // console.log(`theCurrSym: ${theCurrSym} | theCurrDec: ${theCurrDec} | theCurrSep: ${theCurrSep}`);\n\n return (\n <CurrencyTextField\n fullWidth\n variant={readOnly ? 'standard' : 'outlined'}\n helperText={helperTextToDisplay}\n placeholder=''\n size='small'\n required={required}\n disabled={disabled}\n onChange={currOnChange}\n onBlur={!readOnly ? currOnBlur : undefined}\n error={status === 'error'}\n label={label}\n value={currValue}\n type='text'\n outputFormat='number'\n textAlign='left'\n InputProps={{ ...readOnlyProp, inputProps: { ...testProp, value: currValue } }}\n currencySymbol={theCurrSym}\n decimalCharacter={theCurrDec}\n digitGroupSeparator={theCurrSep}\n />\n );\n}\n"]}
1
+ {"version":3,"file":"Currency.js","sourceRoot":"","sources":["../../../../src/components/field/Currency/Currency.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,iBAAiB,MAAM,wCAAwC,CAAC;AACvE,OAAO,WAAW,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAUhF,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAqB;IACpD,8EAA8E;IAC9E,MAAM,cAAc,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IAE7D,MAAM,EACJ,WAAW,EACX,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,KAAK,GAAG,EAAE,EACV,eAAe,EACf,MAAM;IACN,uBAAuB;IACvB,QAAQ,EACR,MAAM,EACN,UAAU,EACV,WAAW,EACX,SAAS,EACT,eAAe,GAAG,KAAK,EACxB,GAAG,KAAK,CAAC;IAEV,MAAM,KAAK,GAAG,WAAW,EAAE,CAAC;IAC5B,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC;IACtC,MAAM,QAAQ,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC,KAAK,CAAC;IAC7C,MAAM,mBAAmB,GAAG,eAAe,IAAI,UAAU,CAAC;IAE1D,4DAA4D;IAE5D,IAAI,YAAY,GAAG,EAAE,CAAC,CAAC,8BAA8B;IAErD,IAAI,QAAQ,EAAE;QACZ,YAAY,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;K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EAC1B,gBAAgB,EAAE,UAAU,EAC5B,mBAAmB,EAAE,UAAU,GAC/B,CACH,CAAC;AACJ,CAAC","sourcesContent":["import React, { useState, useEffect } from 'react';\nimport CurrencyTextField from '@unicef/material-ui-currency-textfield';\nimport handleEvent from '../../helpers/event-utils';\nimport { format } from '../../helpers/formatters';\nimport { getCurrencyCharacters, getCurrencyOptions } from './currency-utils';\nimport { getComponentFromMap } from '../../../bridge/helpers/sdk_component_map';\nimport type { PConnFieldProps } from '../../../types/PConnProps';\n\n// Using control from: https://github.com/unicef/material-ui-currency-textfield\n\ninterface CurrrencyProps extends PConnFieldProps {\n // If any, enter additional props that only exist on Currency here\n currencyISOCode?: string;\n}\n\nexport default function Currency(props: CurrrencyProps) {\n // Get emitted components from map (so we can get any override that may exist)\n const FieldValueList = getComponentFromMap('FieldValueList');\n\n const {\n getPConnect,\n label,\n required,\n disabled,\n value = '',\n validatemessage,\n status,\n /* onChange, onBlur, */\n readOnly,\n testId,\n helperText,\n displayMode,\n hideLabel,\n currencyISOCode = 'USD'\n } = props;\n\n const pConn = getPConnect();\n const actions = pConn.getActionsApi();\n const propName = pConn.getStateProps().value;\n const helperTextToDisplay = validatemessage || helperText;\n\n // console.log(`Currency: label: ${label} value: ${value}`);\n\n let readOnlyProp = {}; // Note: empty if NOT ReadOnly\n\n if (readOnly) {\n readOnlyProp = { readOnly: true };\n }\n\n let testProp = {};\n\n testProp = {\n 'data-test-id': testId\n };\n\n const [currValue, setCurrValue] = useState('');\n const [theCurrSym, setCurrSym] = useState('$');\n const [theCurrDec, setCurrDec] = useState('.');\n const [theCurrSep, setCurrSep] = useState(',');\n\n useEffect(() => {\n // currencySymbols looks like this: { theCurrencySymbol: '$', theDecimalIndicator: '.', theSeparator: ',' }\n const theSymbols = getCurrencyCharacters(currencyISOCode);\n setCurrSym(theSymbols.theCurrencySymbol);\n setCurrDec(theSymbols.theDecimalIndicator);\n setCurrSep(theSymbols.theDigitGroupSeparator);\n }, [currencyISOCode]);\n\n useEffect(() => {\n // const testVal = value;\n setCurrValue(value.toString());\n }, [value]);\n\n const theCurrencyOptions = getCurrencyOptions(currencyISOCode);\n const formattedValue = format(value, pConn.getComponentName().toLowerCase(), theCurrencyOptions);\n\n if (displayMode === 'LABELS_LEFT') {\n return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} />;\n }\n\n if (displayMode === 'STACKED_LARGE_VAL') {\n return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} variant=\"stacked\" />;\n }\n\n // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\n function currOnChange(event, inValue) {\n // console.log(`Currency currOnChange inValue: ${inValue}`);\n\n // update internal value\n setCurrValue(event?.target?.value);\n }\n\n function currOnBlur(event, inValue) {\n // console.log(`Currency currOnBlur inValue: ${inValue}`);\n handleEvent(actions, 'changeNblur', propName, inValue !== '' ? Number(inValue) : inValue);\n }\n\n // console.log(`theCurrSym: ${theCurrSym} | theCurrDec: ${theCurrDec} | theCurrSep: ${theCurrSep}`);\n\n return (\n <CurrencyTextField\n fullWidth\n variant={readOnly ? 'standard' : 'outlined'}\n helperText={helperTextToDisplay}\n placeholder=\"\"\n size=\"small\"\n required={required}\n disabled={disabled}\n onChange={currOnChange}\n onBlur={!readOnly ? currOnBlur : undefined}\n error={status === 'error'}\n label={label}\n value={currValue}\n type=\"text\"\n outputFormat=\"number\"\n textAlign=\"left\"\n InputProps={{ ...readOnlyProp, inputProps: { ...testProp, value: currValue } }}\n currencySymbol={theCurrSym}\n decimalCharacter={theCurrDec}\n digitGroupSeparator={theCurrSep}\n />\n );\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  export declare const getCurrencyOptions: (inISOCode: string) => {
2
- locale: any;
2
+ locale: string;
3
3
  style: string;
4
4
  currency: string;
5
5
  };