@pega/react-sdk-components 0.23.25 → 0.23.27

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 (656) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +17 -0
  3. package/SECURITY.md +10 -0
  4. package/lib/bridge/Context/StoreContext.d.ts +3 -2
  5. package/lib/bridge/Context/StoreContext.d.ts.map +1 -1
  6. package/lib/bridge/Context/StoreContext.js +5 -6
  7. package/lib/bridge/Context/StoreContext.js.map +1 -1
  8. package/lib/bridge/helpers/sdk_component_map.d.ts +1 -0
  9. package/lib/bridge/helpers/sdk_component_map.d.ts.map +1 -1
  10. package/lib/bridge/helpers/sdk_component_map.js +45 -46
  11. package/lib/bridge/helpers/sdk_component_map.js.map +1 -1
  12. package/lib/bridge/react_pconnect.d.ts.map +1 -1
  13. package/lib/bridge/react_pconnect.js +18 -41
  14. package/lib/bridge/react_pconnect.js.map +1 -1
  15. package/lib/components/designSystemExtension/AlertBanner/AlertBanner.d.ts +10 -0
  16. package/lib/components/designSystemExtension/AlertBanner/AlertBanner.d.ts.map +1 -0
  17. package/lib/components/designSystemExtension/AlertBanner/AlertBanner.js +19 -0
  18. package/lib/components/designSystemExtension/AlertBanner/AlertBanner.js.map +1 -0
  19. package/lib/components/designSystemExtension/AlertBanner/index.d.ts +2 -0
  20. package/lib/components/designSystemExtension/AlertBanner/index.d.ts.map +1 -0
  21. package/lib/components/designSystemExtension/AlertBanner/index.js +2 -0
  22. package/lib/components/designSystemExtension/AlertBanner/index.js.map +1 -0
  23. package/lib/components/designSystemExtension/Banner/Banner.css +4 -0
  24. package/lib/components/designSystemExtension/Banner/Banner.d.ts +15 -1
  25. package/lib/components/designSystemExtension/Banner/Banner.d.ts.map +1 -1
  26. package/lib/components/designSystemExtension/Banner/Banner.js +8 -12
  27. package/lib/components/designSystemExtension/Banner/Banner.js.map +1 -1
  28. package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -1
  29. package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.d.ts +6 -9
  30. package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.d.ts.map +1 -1
  31. package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.js +32 -33
  32. package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.js.map +1 -1
  33. package/lib/components/designSystemExtension/DetailsFields/DetailsFields.d.ts +4 -10
  34. package/lib/components/designSystemExtension/DetailsFields/DetailsFields.d.ts.map +1 -1
  35. package/lib/components/designSystemExtension/DetailsFields/DetailsFields.js +10 -23
  36. package/lib/components/designSystemExtension/DetailsFields/DetailsFields.js.map +1 -1
  37. package/lib/components/designSystemExtension/DetailsFields/index.js.map +1 -1
  38. package/lib/components/designSystemExtension/FieldGroup/FieldGroup.d.ts +8 -3
  39. package/lib/components/designSystemExtension/FieldGroup/FieldGroup.d.ts.map +1 -1
  40. package/lib/components/designSystemExtension/FieldGroup/FieldGroup.js +25 -14
  41. package/lib/components/designSystemExtension/FieldGroup/FieldGroup.js.map +1 -1
  42. package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.d.ts +7 -2
  43. package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.d.ts.map +1 -1
  44. package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.js +7 -19
  45. package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.js.map +1 -1
  46. package/lib/components/designSystemExtension/FieldValueList/FieldValueList.d.ts +7 -2
  47. package/lib/components/designSystemExtension/FieldValueList/FieldValueList.d.ts.map +1 -1
  48. package/lib/components/designSystemExtension/FieldValueList/FieldValueList.js +6 -12
  49. package/lib/components/designSystemExtension/FieldValueList/FieldValueList.js.map +1 -1
  50. package/lib/components/designSystemExtension/Operator/Operator.d.ts +16 -7
  51. package/lib/components/designSystemExtension/Operator/Operator.d.ts.map +1 -1
  52. package/lib/components/designSystemExtension/Operator/Operator.js +56 -73
  53. package/lib/components/designSystemExtension/Operator/Operator.js.map +1 -1
  54. package/lib/components/designSystemExtension/Pulse/Pulse.d.ts +5 -2
  55. package/lib/components/designSystemExtension/Pulse/Pulse.d.ts.map +1 -1
  56. package/lib/components/designSystemExtension/Pulse/Pulse.js +9 -15
  57. package/lib/components/designSystemExtension/Pulse/Pulse.js.map +1 -1
  58. package/lib/components/designSystemExtension/RichTextEditor/RichTextEditor.d.ts +19 -0
  59. package/lib/components/designSystemExtension/RichTextEditor/RichTextEditor.d.ts.map +1 -0
  60. package/lib/components/designSystemExtension/RichTextEditor/RichTextEditor.js +75 -0
  61. package/lib/components/designSystemExtension/RichTextEditor/RichTextEditor.js.map +1 -0
  62. package/lib/components/designSystemExtension/RichTextEditor/index.d.ts +2 -0
  63. package/lib/components/designSystemExtension/RichTextEditor/index.d.ts.map +1 -0
  64. package/lib/components/designSystemExtension/RichTextEditor/index.js +2 -0
  65. package/lib/components/designSystemExtension/RichTextEditor/index.js.map +1 -0
  66. package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.css +6 -2
  67. package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.d.ts +6 -1
  68. package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.d.ts.map +1 -1
  69. package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.js +5 -11
  70. package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.js.map +1 -1
  71. package/lib/components/field/AutoComplete/AutoComplete.d.ts +15 -1
  72. package/lib/components/field/AutoComplete/AutoComplete.d.ts.map +1 -1
  73. package/lib/components/field/AutoComplete/AutoComplete.js +17 -17
  74. package/lib/components/field/AutoComplete/AutoComplete.js.map +1 -1
  75. package/lib/components/field/CancelAlert/CancelAlert.d.ts +7 -2
  76. package/lib/components/field/CancelAlert/CancelAlert.d.ts.map +1 -1
  77. package/lib/components/field/CancelAlert/CancelAlert.js +11 -22
  78. package/lib/components/field/CancelAlert/CancelAlert.js.map +1 -1
  79. package/lib/components/field/CancelAlert/index.js.map +1 -1
  80. package/lib/components/field/Checkbox/Checkbox.d.ts +9 -1
  81. package/lib/components/field/Checkbox/Checkbox.d.ts.map +1 -1
  82. package/lib/components/field/Checkbox/Checkbox.js +12 -12
  83. package/lib/components/field/Checkbox/Checkbox.js.map +1 -1
  84. package/lib/components/field/Currency/Currency.d.ts +6 -1
  85. package/lib/components/field/Currency/Currency.d.ts.map +1 -1
  86. package/lib/components/field/Currency/Currency.js +14 -29
  87. package/lib/components/field/Currency/Currency.js.map +1 -1
  88. package/lib/components/field/Currency/currency-utils.d.ts +1 -1
  89. package/lib/components/field/Currency/currency-utils.d.ts.map +1 -1
  90. package/lib/components/field/Currency/currency-utils.js +5 -6
  91. package/lib/components/field/Currency/currency-utils.js.map +1 -1
  92. package/lib/components/field/Date/Date.d.ts +5 -1
  93. package/lib/components/field/Date/Date.d.ts.map +1 -1
  94. package/lib/components/field/Date/Date.js +26 -14
  95. package/lib/components/field/Date/Date.js.map +1 -1
  96. package/lib/components/field/DateTime/DateTime.d.ts +5 -1
  97. package/lib/components/field/DateTime/DateTime.d.ts.map +1 -1
  98. package/lib/components/field/DateTime/DateTime.js +16 -10
  99. package/lib/components/field/DateTime/DateTime.js.map +1 -1
  100. package/lib/components/field/Decimal/Decimal.d.ts +8 -1
  101. package/lib/components/field/Decimal/Decimal.d.ts.map +1 -1
  102. package/lib/components/field/Decimal/Decimal.js +32 -10
  103. package/lib/components/field/Decimal/Decimal.js.map +1 -1
  104. package/lib/components/field/Decimal/index.js.map +1 -1
  105. package/lib/components/field/Dropdown/Dropdown.d.ts +13 -1
  106. package/lib/components/field/Dropdown/Dropdown.d.ts.map +1 -1
  107. package/lib/components/field/Dropdown/Dropdown.js +115 -11
  108. package/lib/components/field/Dropdown/Dropdown.js.map +1 -1
  109. package/lib/components/field/Email/Email.d.ts +5 -1
  110. package/lib/components/field/Email/Email.d.ts.map +1 -1
  111. package/lib/components/field/Email/Email.js +12 -11
  112. package/lib/components/field/Email/Email.js.map +1 -1
  113. package/lib/components/field/Email/index.js.map +1 -1
  114. package/lib/components/field/Group/Group.d.ts +13 -0
  115. package/lib/components/field/Group/Group.d.ts.map +1 -0
  116. package/lib/components/field/Group/Group.js +13 -0
  117. package/lib/components/field/Group/Group.js.map +1 -0
  118. package/lib/components/field/Group/index.d.ts +2 -0
  119. package/lib/components/field/Group/index.d.ts.map +1 -0
  120. package/lib/components/field/Group/index.js +2 -0
  121. package/lib/components/field/Group/index.js.map +1 -0
  122. package/lib/components/field/Integer/Integer.d.ts +5 -1
  123. package/lib/components/field/Integer/Integer.d.ts.map +1 -1
  124. package/lib/components/field/Integer/Integer.js +10 -8
  125. package/lib/components/field/Integer/Integer.js.map +1 -1
  126. package/lib/components/field/Percentage/Percentage.d.ts +5 -1
  127. package/lib/components/field/Percentage/Percentage.d.ts.map +1 -1
  128. package/lib/components/field/Percentage/Percentage.js +10 -8
  129. package/lib/components/field/Percentage/Percentage.js.map +1 -1
  130. package/lib/components/field/Phone/Phone.d.ts +5 -1
  131. package/lib/components/field/Phone/Phone.d.ts.map +1 -1
  132. package/lib/components/field/Phone/Phone.js +12 -10
  133. package/lib/components/field/Phone/Phone.js.map +1 -1
  134. package/lib/components/field/Phone/index.js.map +1 -1
  135. package/lib/components/field/RadioButtons/RadioButtons.d.ts +7 -1
  136. package/lib/components/field/RadioButtons/RadioButtons.d.ts.map +1 -1
  137. package/lib/components/field/RadioButtons/RadioButtons.js +30 -13
  138. package/lib/components/field/RadioButtons/RadioButtons.js.map +1 -1
  139. package/lib/components/field/RichText/RichText.d.ts +7 -0
  140. package/lib/components/field/RichText/RichText.d.ts.map +1 -0
  141. package/lib/components/field/RichText/RichText.js +54 -0
  142. package/lib/components/field/RichText/RichText.js.map +1 -0
  143. package/lib/components/field/RichText/index.d.ts +2 -0
  144. package/lib/components/field/RichText/index.d.ts.map +1 -0
  145. package/lib/components/field/RichText/index.js +2 -0
  146. package/lib/components/field/RichText/index.js.map +1 -0
  147. package/lib/components/field/ScalarList/ScalarList.d.ts +13 -0
  148. package/lib/components/field/ScalarList/ScalarList.d.ts.map +1 -0
  149. package/lib/components/field/ScalarList/ScalarList.js +32 -0
  150. package/lib/components/field/ScalarList/ScalarList.js.map +1 -0
  151. package/lib/components/field/ScalarList/index.d.ts +2 -0
  152. package/lib/components/field/ScalarList/index.d.ts.map +1 -0
  153. package/lib/components/field/ScalarList/index.js +2 -0
  154. package/lib/components/field/ScalarList/index.js.map +1 -0
  155. package/lib/components/field/SemanticLink/SemanticLink.d.ts +5 -9
  156. package/lib/components/field/SemanticLink/SemanticLink.d.ts.map +1 -1
  157. package/lib/components/field/SemanticLink/SemanticLink.js +11 -19
  158. package/lib/components/field/SemanticLink/SemanticLink.js.map +1 -1
  159. package/lib/components/field/SemanticLink/utils.d.ts.map +1 -1
  160. package/lib/components/field/SemanticLink/utils.js +8 -8
  161. package/lib/components/field/SemanticLink/utils.js.map +1 -1
  162. package/lib/components/field/TextArea/TextArea.d.ts +6 -1
  163. package/lib/components/field/TextArea/TextArea.d.ts.map +1 -1
  164. package/lib/components/field/TextArea/TextArea.js +8 -6
  165. package/lib/components/field/TextArea/TextArea.js.map +1 -1
  166. package/lib/components/field/TextContent/TextContent.d.ts +7 -1
  167. package/lib/components/field/TextContent/TextContent.d.ts.map +1 -1
  168. package/lib/components/field/TextContent/TextContent.js +2 -2
  169. package/lib/components/field/TextContent/TextContent.js.map +1 -1
  170. package/lib/components/field/TextInput/TextInput.d.ts +6 -1
  171. package/lib/components/field/TextInput/TextInput.d.ts.map +1 -1
  172. package/lib/components/field/TextInput/TextInput.js +26 -6
  173. package/lib/components/field/TextInput/TextInput.js.map +1 -1
  174. package/lib/components/field/TextInput/index.js.map +1 -1
  175. package/lib/components/field/Time/Time.d.ts +5 -1
  176. package/lib/components/field/Time/Time.d.ts.map +1 -1
  177. package/lib/components/field/Time/Time.js +15 -9
  178. package/lib/components/field/Time/Time.js.map +1 -1
  179. package/lib/components/field/URL/URL.d.ts +5 -1
  180. package/lib/components/field/URL/URL.d.ts.map +1 -1
  181. package/lib/components/field/URL/URL.js +14 -8
  182. package/lib/components/field/URL/URL.js.map +1 -1
  183. package/lib/components/field/URL/index.js.map +1 -1
  184. package/lib/components/field/UserReference/UserReference.d.ts +20 -41
  185. package/lib/components/field/UserReference/UserReference.d.ts.map +1 -1
  186. package/lib/components/field/UserReference/UserReference.js +17 -46
  187. package/lib/components/field/UserReference/UserReference.js.map +1 -1
  188. package/lib/components/field/UserReference/UserReferenceUtils.js +2 -2
  189. package/lib/components/field/UserReference/UserReferenceUtils.js.map +1 -1
  190. package/lib/components/helpers/attachmentHelpers.d.ts +6 -6
  191. package/lib/components/helpers/attachmentHelpers.d.ts.map +1 -1
  192. package/lib/components/helpers/attachmentHelpers.js +8 -8
  193. package/lib/components/helpers/attachmentHelpers.js.map +1 -1
  194. package/lib/components/helpers/case-utils.d.ts +20 -0
  195. package/lib/components/helpers/case-utils.d.ts.map +1 -0
  196. package/lib/components/helpers/case-utils.js +82 -0
  197. package/lib/components/helpers/case-utils.js.map +1 -0
  198. package/lib/components/helpers/common-utils.d.ts +3 -0
  199. package/lib/components/helpers/common-utils.d.ts.map +1 -0
  200. package/lib/components/helpers/common-utils.js +8 -0
  201. package/lib/components/helpers/common-utils.js.map +1 -0
  202. package/lib/components/helpers/data_page.d.ts.map +1 -1
  203. package/lib/components/helpers/data_page.js +2 -3
  204. package/lib/components/helpers/data_page.js.map +1 -1
  205. package/lib/components/helpers/date-format-utils.d.ts +1 -6
  206. package/lib/components/helpers/date-format-utils.d.ts.map +1 -1
  207. package/lib/components/helpers/date-format-utils.js +23 -14
  208. package/lib/components/helpers/date-format-utils.js.map +1 -1
  209. package/lib/components/helpers/event-utils.d.ts +1 -1
  210. package/lib/components/helpers/event-utils.d.ts.map +1 -1
  211. package/lib/components/helpers/event-utils.js +3 -3
  212. package/lib/components/helpers/event-utils.js.map +1 -1
  213. package/lib/components/helpers/field-group-utils.d.ts +15 -2
  214. package/lib/components/helpers/field-group-utils.d.ts.map +1 -1
  215. package/lib/components/helpers/field-group-utils.js +5 -9
  216. package/lib/components/helpers/field-group-utils.js.map +1 -1
  217. package/lib/components/helpers/formatters/Boolean.d.ts +3 -3
  218. package/lib/components/helpers/formatters/Boolean.d.ts.map +1 -1
  219. package/lib/components/helpers/formatters/Boolean.js +9 -20
  220. package/lib/components/helpers/formatters/Boolean.js.map +1 -1
  221. package/lib/components/helpers/formatters/Currency.d.ts +6 -6
  222. package/lib/components/helpers/formatters/Currency.d.ts.map +1 -1
  223. package/lib/components/helpers/formatters/Currency.js +13 -13
  224. package/lib/components/helpers/formatters/Currency.js.map +1 -1
  225. package/lib/components/helpers/formatters/CurrencyMap.d.ts +881 -1399
  226. package/lib/components/helpers/formatters/CurrencyMap.d.ts.map +1 -1
  227. package/lib/components/helpers/formatters/CurrencyMap.js +500 -500
  228. package/lib/components/helpers/formatters/CurrencyMap.js.map +1 -1
  229. package/lib/components/helpers/formatters/Date.d.ts +5 -5
  230. package/lib/components/helpers/formatters/Date.d.ts.map +1 -1
  231. package/lib/components/helpers/formatters/Date.js +20 -20
  232. package/lib/components/helpers/formatters/Date.js.map +1 -1
  233. package/lib/components/helpers/formatters/common.d.ts +2 -2
  234. package/lib/components/helpers/formatters/common.d.ts.map +1 -1
  235. package/lib/components/helpers/formatters/common.js +4 -5
  236. package/lib/components/helpers/formatters/common.js.map +1 -1
  237. package/lib/components/helpers/formatters/index.d.ts +12 -12
  238. package/lib/components/helpers/formatters/index.d.ts.map +1 -1
  239. package/lib/components/helpers/formatters/index.js +19 -19
  240. package/lib/components/helpers/formatters/index.js.map +1 -1
  241. package/lib/components/helpers/reactContextHelpers.d.ts +3 -2
  242. package/lib/components/helpers/reactContextHelpers.d.ts.map +1 -1
  243. package/lib/components/helpers/reactContextHelpers.js +1 -1
  244. package/lib/components/helpers/reactContextHelpers.js.map +1 -1
  245. package/lib/components/helpers/simpleTableHelpers.d.ts +5 -3
  246. package/lib/components/helpers/simpleTableHelpers.d.ts.map +1 -1
  247. package/lib/components/helpers/simpleTableHelpers.js +51 -54
  248. package/lib/components/helpers/simpleTableHelpers.js.map +1 -1
  249. package/lib/components/helpers/state-utils.d.ts +4 -0
  250. package/lib/components/helpers/state-utils.d.ts.map +1 -0
  251. package/lib/components/helpers/state-utils.js +34 -0
  252. package/lib/components/helpers/state-utils.js.map +1 -0
  253. package/lib/components/helpers/template-utils.d.ts +7 -3
  254. package/lib/components/helpers/template-utils.d.ts.map +1 -1
  255. package/lib/components/helpers/template-utils.js +1 -2
  256. package/lib/components/helpers/template-utils.js.map +1 -1
  257. package/lib/components/helpers/utils.d.ts +2 -2
  258. package/lib/components/helpers/utils.d.ts.map +1 -1
  259. package/lib/components/helpers/utils.js +11 -10
  260. package/lib/components/helpers/utils.js.map +1 -1
  261. package/lib/components/helpers/versionHelpers.d.ts.map +1 -1
  262. package/lib/components/helpers/versionHelpers.js +1 -1
  263. package/lib/components/helpers/versionHelpers.js.map +1 -1
  264. package/lib/components/infra/ActionButtons/ActionButtons.d.ts +6 -13
  265. package/lib/components/infra/ActionButtons/ActionButtons.d.ts.map +1 -1
  266. package/lib/components/infra/ActionButtons/ActionButtons.js +13 -27
  267. package/lib/components/infra/ActionButtons/ActionButtons.js.map +1 -1
  268. package/lib/components/infra/ActionButtons/index.js.map +1 -1
  269. package/lib/components/infra/Assignment/Assignment.d.ts +9 -15
  270. package/lib/components/infra/Assignment/Assignment.d.ts.map +1 -1
  271. package/lib/components/infra/Assignment/Assignment.js +67 -70
  272. package/lib/components/infra/Assignment/Assignment.js.map +1 -1
  273. package/lib/components/infra/Assignment/index.js.map +1 -1
  274. package/lib/components/infra/AssignmentCard/AssignmentCard.d.ts +7 -15
  275. package/lib/components/infra/AssignmentCard/AssignmentCard.d.ts.map +1 -1
  276. package/lib/components/infra/AssignmentCard/AssignmentCard.js +6 -20
  277. package/lib/components/infra/AssignmentCard/AssignmentCard.js.map +1 -1
  278. package/lib/components/infra/AssignmentCard/index.js.map +1 -1
  279. package/lib/components/infra/Containers/FlowContainer/FlowContainer.d.ts +10 -20
  280. package/lib/components/infra/Containers/FlowContainer/FlowContainer.d.ts.map +1 -1
  281. package/lib/components/infra/Containers/FlowContainer/FlowContainer.js +69 -190
  282. package/lib/components/infra/Containers/FlowContainer/FlowContainer.js.map +1 -1
  283. package/lib/components/infra/Containers/FlowContainer/helpers.d.ts +12 -12
  284. package/lib/components/infra/Containers/FlowContainer/helpers.d.ts.map +1 -1
  285. package/lib/components/infra/Containers/FlowContainer/helpers.js +46 -45
  286. package/lib/components/infra/Containers/FlowContainer/helpers.js.map +1 -1
  287. package/lib/components/infra/Containers/FlowContainer/index.js.map +1 -1
  288. package/lib/components/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.d.ts +9 -0
  289. package/lib/components/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.d.ts.map +1 -0
  290. package/lib/components/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.js +37 -0
  291. package/lib/components/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.js.map +1 -0
  292. package/lib/components/infra/Containers/ModalViewContainer/ListViewActionButtons/index.d.ts +2 -0
  293. package/lib/components/infra/Containers/ModalViewContainer/ListViewActionButtons/index.d.ts.map +1 -0
  294. package/lib/components/infra/Containers/ModalViewContainer/ListViewActionButtons/index.js +2 -0
  295. package/lib/components/infra/Containers/ModalViewContainer/ListViewActionButtons/index.js.map +1 -0
  296. package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.d.ts +8 -17
  297. package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.d.ts.map +1 -1
  298. package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.js +62 -42
  299. package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.js.map +1 -1
  300. package/lib/components/infra/Containers/ModalViewContainer/index.js.map +1 -1
  301. package/lib/components/infra/Containers/SimpleView/SimpleView.d.ts +9 -0
  302. package/lib/components/infra/Containers/SimpleView/SimpleView.d.ts.map +1 -0
  303. package/lib/components/infra/Containers/SimpleView/SimpleView.js +29 -0
  304. package/lib/components/infra/Containers/SimpleView/SimpleView.js.map +1 -0
  305. package/lib/components/infra/Containers/SimpleView/helper.d.ts +10 -0
  306. package/lib/components/infra/Containers/SimpleView/helper.d.ts.map +1 -0
  307. package/lib/components/infra/Containers/SimpleView/helper.js +102 -0
  308. package/lib/components/infra/Containers/SimpleView/helper.js.map +1 -0
  309. package/lib/components/infra/Containers/SimpleView/index.d.ts +2 -0
  310. package/lib/components/infra/Containers/SimpleView/index.d.ts.map +1 -0
  311. package/lib/components/infra/Containers/SimpleView/index.js +2 -0
  312. package/lib/components/infra/Containers/SimpleView/index.js.map +1 -0
  313. package/lib/components/infra/Containers/ViewContainer/ViewContainer.d.ts +9 -22
  314. package/lib/components/infra/Containers/ViewContainer/ViewContainer.d.ts.map +1 -1
  315. package/lib/components/infra/Containers/ViewContainer/ViewContainer.js +27 -45
  316. package/lib/components/infra/Containers/ViewContainer/ViewContainer.js.map +1 -1
  317. package/lib/components/infra/Containers/helpers.d.ts +2 -0
  318. package/lib/components/infra/Containers/helpers.d.ts.map +1 -0
  319. package/lib/components/infra/Containers/helpers.js +7 -0
  320. package/lib/components/infra/Containers/helpers.js.map +1 -0
  321. package/lib/components/infra/DashboardFilter/DashboardFilter.d.ts +9 -20
  322. package/lib/components/infra/DashboardFilter/DashboardFilter.d.ts.map +1 -1
  323. package/lib/components/infra/DashboardFilter/DashboardFilter.js +15 -33
  324. package/lib/components/infra/DashboardFilter/DashboardFilter.js.map +1 -1
  325. package/lib/components/infra/DashboardFilter/filterUtils.d.ts.map +1 -1
  326. package/lib/components/infra/DashboardFilter/filterUtils.js +10 -12
  327. package/lib/components/infra/DashboardFilter/filterUtils.js.map +1 -1
  328. package/lib/components/infra/DeferLoad/DeferLoad.d.ts +8 -13
  329. package/lib/components/infra/DeferLoad/DeferLoad.d.ts.map +1 -1
  330. package/lib/components/infra/DeferLoad/DeferLoad.js +11 -22
  331. package/lib/components/infra/DeferLoad/DeferLoad.js.map +1 -1
  332. package/lib/components/infra/DeferLoad/index.js.map +1 -1
  333. package/lib/components/infra/ErrorBoundary/ErrorBoundary.d.ts +5 -12
  334. package/lib/components/infra/ErrorBoundary/ErrorBoundary.d.ts.map +1 -1
  335. package/lib/components/infra/ErrorBoundary/ErrorBoundary.js +21 -27
  336. package/lib/components/infra/ErrorBoundary/ErrorBoundary.js.map +1 -1
  337. package/lib/components/infra/MultiStep/MultiStep.css +11 -15
  338. package/lib/components/infra/MultiStep/MultiStep.d.ts +10 -18
  339. package/lib/components/infra/MultiStep/MultiStep.d.ts.map +1 -1
  340. package/lib/components/infra/MultiStep/MultiStep.js +34 -99
  341. package/lib/components/infra/MultiStep/MultiStep.js.map +1 -1
  342. package/lib/components/infra/MultiStep/index.js.map +1 -1
  343. package/lib/components/infra/NavBar/NavBar.css +103 -105
  344. package/lib/components/infra/NavBar/NavBar.d.ts +8 -16
  345. package/lib/components/infra/NavBar/NavBar.d.ts.map +1 -1
  346. package/lib/components/infra/NavBar/NavBar.js +22 -69
  347. package/lib/components/infra/NavBar/NavBar.js.map +1 -1
  348. package/lib/components/infra/Reference/Reference.d.ts +8 -17
  349. package/lib/components/infra/Reference/Reference.d.ts.map +1 -1
  350. package/lib/components/infra/Reference/Reference.js +5 -17
  351. package/lib/components/infra/Reference/Reference.js.map +1 -1
  352. package/lib/components/infra/Region/Region.d.ts +4 -8
  353. package/lib/components/infra/Region/Region.d.ts.map +1 -1
  354. package/lib/components/infra/Region/Region.js +2 -7
  355. package/lib/components/infra/Region/Region.js.map +1 -1
  356. package/lib/components/infra/RootContainer/RootContainer.d.ts +13 -20
  357. package/lib/components/infra/RootContainer/RootContainer.d.ts.map +1 -1
  358. package/lib/components/infra/RootContainer/RootContainer.js +46 -88
  359. package/lib/components/infra/RootContainer/RootContainer.js.map +1 -1
  360. package/lib/components/infra/RootContainer/index.js.map +1 -1
  361. package/lib/components/infra/Stages/Stages.d.ts +5 -8
  362. package/lib/components/infra/Stages/Stages.d.ts.map +1 -1
  363. package/lib/components/infra/Stages/Stages.js +20 -27
  364. package/lib/components/infra/Stages/Stages.js.map +1 -1
  365. package/lib/components/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.d.ts.map +1 -1
  366. package/lib/components/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.js +6 -8
  367. package/lib/components/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.js.map +1 -1
  368. package/lib/components/infra/VerticalTabs/VerticalTabs/VerticalTabs.d.ts +4 -10
  369. package/lib/components/infra/VerticalTabs/VerticalTabs/VerticalTabs.d.ts.map +1 -1
  370. package/lib/components/infra/VerticalTabs/VerticalTabs/VerticalTabs.js +13 -17
  371. package/lib/components/infra/VerticalTabs/VerticalTabs/VerticalTabs.js.map +1 -1
  372. package/lib/components/infra/View/View.d.ts +13 -17
  373. package/lib/components/infra/View/View.d.ts.map +1 -1
  374. package/lib/components/infra/View/View.js +17 -69
  375. package/lib/components/infra/View/View.js.map +1 -1
  376. package/lib/components/template/AppShell/AppShell.css +22 -23
  377. package/lib/components/template/AppShell/AppShell.d.ts +20 -16
  378. package/lib/components/template/AppShell/AppShell.d.ts.map +1 -1
  379. package/lib/components/template/AppShell/AppShell.js +32 -50
  380. package/lib/components/template/AppShell/AppShell.js.map +1 -1
  381. package/lib/components/template/BannerPage/BannerPage.d.ts +12 -24
  382. package/lib/components/template/BannerPage/BannerPage.d.ts.map +1 -1
  383. package/lib/components/template/BannerPage/BannerPage.js +7 -25
  384. package/lib/components/template/BannerPage/BannerPage.js.map +1 -1
  385. package/lib/components/template/CaseSummary/CaseSummary.d.ts +5 -8
  386. package/lib/components/template/CaseSummary/CaseSummary.d.ts.map +1 -1
  387. package/lib/components/template/CaseSummary/CaseSummary.js +10 -12
  388. package/lib/components/template/CaseSummary/CaseSummary.js.map +1 -1
  389. package/lib/components/template/CaseView/CaseView.d.ts +10 -23
  390. package/lib/components/template/CaseView/CaseView.d.ts.map +1 -1
  391. package/lib/components/template/CaseView/CaseView.js +38 -65
  392. package/lib/components/template/CaseView/CaseView.js.map +1 -1
  393. package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.d.ts +8 -13
  394. package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.d.ts.map +1 -1
  395. package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.js +24 -20
  396. package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.js.map +1 -1
  397. package/lib/components/template/Confirmation/Confirmation.d.ts +10 -17
  398. package/lib/components/template/Confirmation/Confirmation.d.ts.map +1 -1
  399. package/lib/components/template/Confirmation/Confirmation.js +10 -28
  400. package/lib/components/template/Confirmation/Confirmation.js.map +1 -1
  401. package/lib/components/template/DataReference/DataReference.d.ts +15 -30
  402. package/lib/components/template/DataReference/DataReference.d.ts.map +1 -1
  403. package/lib/components/template/DataReference/DataReference.js +35 -72
  404. package/lib/components/template/DataReference/DataReference.js.map +1 -1
  405. package/lib/components/template/DefaultForm/DefaultForm.css +7 -3
  406. package/lib/components/template/DefaultForm/DefaultForm.d.ts +7 -11
  407. package/lib/components/template/DefaultForm/DefaultForm.d.ts.map +1 -1
  408. package/lib/components/template/DefaultForm/DefaultForm.js +11 -17
  409. package/lib/components/template/DefaultForm/DefaultForm.js.map +1 -1
  410. package/lib/components/template/DefaultForm/utils/index.d.ts +3 -0
  411. package/lib/components/template/DefaultForm/utils/index.d.ts.map +1 -0
  412. package/lib/components/template/DefaultForm/utils/index.js +27 -0
  413. package/lib/components/template/DefaultForm/utils/index.js.map +1 -0
  414. package/lib/components/template/Details/Details/Details.d.ts +7 -15
  415. package/lib/components/template/Details/Details/Details.d.ts.map +1 -1
  416. package/lib/components/template/Details/Details/Details.js +8 -21
  417. package/lib/components/template/Details/Details/Details.js.map +1 -1
  418. package/lib/components/template/Details/DetailsSubTabs/DetailsSubTabs.d.ts +7 -16
  419. package/lib/components/template/Details/DetailsSubTabs/DetailsSubTabs.d.ts.map +1 -1
  420. package/lib/components/template/Details/DetailsSubTabs/DetailsSubTabs.js +6 -23
  421. package/lib/components/template/Details/DetailsSubTabs/DetailsSubTabs.js.map +1 -1
  422. package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.d.ts +7 -15
  423. package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.d.ts.map +1 -1
  424. package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.js +9 -22
  425. package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.js.map +1 -1
  426. package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.d.ts +7 -15
  427. package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.d.ts.map +1 -1
  428. package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.js +9 -22
  429. package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.js.map +1 -1
  430. package/lib/components/template/Details/DetailsTwoColumn/index.js.map +1 -1
  431. package/lib/components/template/Details/DynamicTabs/DynamicTabs.d.ts +10 -0
  432. package/lib/components/template/Details/DynamicTabs/DynamicTabs.d.ts.map +1 -0
  433. package/lib/components/template/Details/DynamicTabs/DynamicTabs.js +45 -0
  434. package/lib/components/template/Details/DynamicTabs/DynamicTabs.js.map +1 -0
  435. package/lib/components/template/Details/DynamicTabs/index.d.ts +2 -0
  436. package/lib/components/template/Details/DynamicTabs/index.d.ts.map +1 -0
  437. package/lib/components/template/Details/DynamicTabs/index.js +2 -0
  438. package/lib/components/template/Details/DynamicTabs/index.js.map +1 -0
  439. package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.d.ts +12 -19
  440. package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.d.ts.map +1 -1
  441. package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.js +12 -27
  442. package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.js.map +1 -1
  443. package/lib/components/template/InlineDashboard/InlineDashboard.d.ts +7 -8
  444. package/lib/components/template/InlineDashboard/InlineDashboard.d.ts.map +1 -1
  445. package/lib/components/template/InlineDashboard/InlineDashboard.js +3 -14
  446. package/lib/components/template/InlineDashboard/InlineDashboard.js.map +1 -1
  447. package/lib/components/template/InlineDashboardPage/InlineDashboardPage.d.ts +8 -16
  448. package/lib/components/template/InlineDashboardPage/InlineDashboardPage.d.ts.map +1 -1
  449. package/lib/components/template/InlineDashboardPage/InlineDashboardPage.js +9 -17
  450. package/lib/components/template/InlineDashboardPage/InlineDashboardPage.js.map +1 -1
  451. package/lib/components/template/ListPage/ListPage.d.ts +5 -13
  452. package/lib/components/template/ListPage/ListPage.d.ts.map +1 -1
  453. package/lib/components/template/ListPage/ListPage.js +7 -11
  454. package/lib/components/template/ListPage/ListPage.js.map +1 -1
  455. package/lib/components/template/ListView/DefaultViewMeta.d.ts +1 -90
  456. package/lib/components/template/ListView/DefaultViewMeta.d.ts.map +1 -1
  457. package/lib/components/template/ListView/DefaultViewMeta.js.map +1 -1
  458. package/lib/components/template/ListView/ListView.d.ts +15 -8
  459. package/lib/components/template/ListView/ListView.d.ts.map +1 -1
  460. package/lib/components/template/ListView/ListView.js +166 -257
  461. package/lib/components/template/ListView/ListView.js.map +1 -1
  462. package/lib/components/template/ListView/hooks.d.ts.map +1 -1
  463. package/lib/components/template/ListView/hooks.js +4 -7
  464. package/lib/components/template/ListView/hooks.js.map +1 -1
  465. package/lib/components/template/ListView/utils.d.ts +72 -16
  466. package/lib/components/template/ListView/utils.d.ts.map +1 -1
  467. package/lib/components/template/ListView/utils.js +163 -33
  468. package/lib/components/template/ListView/utils.js.map +1 -1
  469. package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.d.ts +9 -13
  470. package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.d.ts.map +1 -1
  471. package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.js +5 -16
  472. package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.js.map +1 -1
  473. package/lib/components/template/NarrowWide/NarrowWide/NarrowWide.css +0 -2
  474. package/lib/components/template/NarrowWide/NarrowWide/NarrowWide.d.ts +11 -2
  475. package/lib/components/template/NarrowWide/NarrowWide/NarrowWide.d.ts.map +1 -1
  476. package/lib/components/template/NarrowWide/NarrowWide/NarrowWide.js +2 -10
  477. package/lib/components/template/NarrowWide/NarrowWide/NarrowWide.js.map +1 -1
  478. package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.d.ts +7 -15
  479. package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.d.ts.map +1 -1
  480. package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.js +9 -22
  481. package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.js.map +1 -1
  482. package/lib/components/template/NarrowWide/NarrowWideForm/NarrowWideForm.css +0 -2
  483. package/lib/components/template/NarrowWide/NarrowWideForm/NarrowWideForm.d.ts +6 -2
  484. package/lib/components/template/NarrowWide/NarrowWideForm/NarrowWideForm.d.ts.map +1 -1
  485. package/lib/components/template/NarrowWide/NarrowWideForm/NarrowWideForm.js +2 -5
  486. package/lib/components/template/NarrowWide/NarrowWideForm/NarrowWideForm.js.map +1 -1
  487. package/lib/components/template/NarrowWide/NarrowWidePage/NarrowWidePage.d.ts +8 -15
  488. package/lib/components/template/NarrowWide/NarrowWidePage/NarrowWidePage.d.ts.map +1 -1
  489. package/lib/components/template/NarrowWide/NarrowWidePage/NarrowWidePage.js +7 -18
  490. package/lib/components/template/NarrowWide/NarrowWidePage/NarrowWidePage.js.map +1 -1
  491. package/lib/components/template/OneColumn/OneColumn/OneColumn.d.ts +5 -8
  492. package/lib/components/template/OneColumn/OneColumn/OneColumn.d.ts.map +1 -1
  493. package/lib/components/template/OneColumn/OneColumn/OneColumn.js +9 -13
  494. package/lib/components/template/OneColumn/OneColumn/OneColumn.js.map +1 -1
  495. package/lib/components/template/OneColumn/OneColumnPage/OneColumnPage.d.ts +4 -8
  496. package/lib/components/template/OneColumn/OneColumnPage/OneColumnPage.d.ts.map +1 -1
  497. package/lib/components/template/OneColumn/OneColumnPage/OneColumnPage.js +5 -8
  498. package/lib/components/template/OneColumn/OneColumnPage/OneColumnPage.js.map +1 -1
  499. package/lib/components/template/OneColumn/OneColumnTab/OneColumnTab.d.ts +5 -8
  500. package/lib/components/template/OneColumn/OneColumnTab/OneColumnTab.d.ts.map +1 -1
  501. package/lib/components/template/OneColumn/OneColumnTab/OneColumnTab.js +2 -7
  502. package/lib/components/template/OneColumn/OneColumnTab/OneColumnTab.js.map +1 -1
  503. package/lib/components/template/PromotedFilters/PromotedFilters.css +1 -1
  504. package/lib/components/template/PromotedFilters/PromotedFilters.d.ts +9 -14
  505. package/lib/components/template/PromotedFilters/PromotedFilters.d.ts.map +1 -1
  506. package/lib/components/template/PromotedFilters/PromotedFilters.js +16 -29
  507. package/lib/components/template/PromotedFilters/PromotedFilters.js.map +1 -1
  508. package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.d.ts +19 -1
  509. package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.d.ts.map +1 -1
  510. package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.js +62 -13
  511. package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.js.map +1 -1
  512. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.d.ts +24 -2
  513. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.d.ts.map +1 -1
  514. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js +109 -129
  515. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js.map +1 -1
  516. package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.d.ts +14 -29
  517. package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.d.ts.map +1 -1
  518. package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.js +15 -33
  519. package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.js.map +1 -1
  520. package/lib/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.d.ts +14 -26
  521. package/lib/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.d.ts.map +1 -1
  522. package/lib/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.js +8 -29
  523. package/lib/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.js.map +1 -1
  524. package/lib/components/template/SubTabs/SubTabs.d.ts +5 -11
  525. package/lib/components/template/SubTabs/SubTabs.d.ts.map +1 -1
  526. package/lib/components/template/SubTabs/SubTabs.js +7 -17
  527. package/lib/components/template/SubTabs/SubTabs.js.map +1 -1
  528. package/lib/components/template/SubTabs/tabUtils.d.ts.map +1 -1
  529. package/lib/components/template/SubTabs/tabUtils.js +2 -4
  530. package/lib/components/template/SubTabs/tabUtils.js.map +1 -1
  531. package/lib/components/template/TwoColumn/TwoColumn/TwoColumn.css +0 -1
  532. package/lib/components/template/TwoColumn/TwoColumn/TwoColumn.d.ts +6 -12
  533. package/lib/components/template/TwoColumn/TwoColumn/TwoColumn.d.ts.map +1 -1
  534. package/lib/components/template/TwoColumn/TwoColumn/TwoColumn.js +15 -24
  535. package/lib/components/template/TwoColumn/TwoColumn/TwoColumn.js.map +1 -1
  536. package/lib/components/template/TwoColumn/TwoColumnPage/TwoColumnPage.d.ts +4 -8
  537. package/lib/components/template/TwoColumn/TwoColumnPage/TwoColumnPage.d.ts.map +1 -1
  538. package/lib/components/template/TwoColumn/TwoColumnPage/TwoColumnPage.js +5 -8
  539. package/lib/components/template/TwoColumn/TwoColumnPage/TwoColumnPage.js.map +1 -1
  540. package/lib/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.d.ts +6 -12
  541. package/lib/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.d.ts.map +1 -1
  542. package/lib/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.js +15 -21
  543. package/lib/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.js.map +1 -1
  544. package/lib/components/template/WideNarrow/WideNarrow/WideNarrow.css +0 -2
  545. package/lib/components/template/WideNarrow/WideNarrow/WideNarrow.d.ts +11 -2
  546. package/lib/components/template/WideNarrow/WideNarrow/WideNarrow.d.ts.map +1 -1
  547. package/lib/components/template/WideNarrow/WideNarrow/WideNarrow.js +3 -11
  548. package/lib/components/template/WideNarrow/WideNarrow/WideNarrow.js.map +1 -1
  549. package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.d.ts +7 -15
  550. package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.d.ts.map +1 -1
  551. package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.js +23 -26
  552. package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.js.map +1 -1
  553. package/lib/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.css +0 -2
  554. package/lib/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.d.ts +6 -2
  555. package/lib/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.d.ts.map +1 -1
  556. package/lib/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.js +2 -5
  557. package/lib/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.js.map +1 -1
  558. package/lib/components/template/WideNarrow/WideNarrowPage/WideNarrowPage.d.ts +8 -15
  559. package/lib/components/template/WideNarrow/WideNarrowPage/WideNarrowPage.d.ts.map +1 -1
  560. package/lib/components/template/WideNarrow/WideNarrowPage/WideNarrowPage.js +7 -17
  561. package/lib/components/template/WideNarrow/WideNarrowPage/WideNarrowPage.js.map +1 -1
  562. package/lib/components/template/WideNarrow/WideNarrowPage/index.js.map +1 -1
  563. package/lib/components/template/WssNavBar/WssNavBar.d.ts +18 -1
  564. package/lib/components/template/WssNavBar/WssNavBar.d.ts.map +1 -1
  565. package/lib/components/template/WssNavBar/WssNavBar.js +19 -36
  566. package/lib/components/template/WssNavBar/WssNavBar.js.map +1 -1
  567. package/lib/components/widget/AppAnnouncement/AppAnnouncement.d.ts +9 -17
  568. package/lib/components/widget/AppAnnouncement/AppAnnouncement.d.ts.map +1 -1
  569. package/lib/components/widget/AppAnnouncement/AppAnnouncement.js +13 -37
  570. package/lib/components/widget/AppAnnouncement/AppAnnouncement.js.map +1 -1
  571. package/lib/components/widget/Attachment/Attachment.css +75 -4
  572. package/lib/components/widget/Attachment/Attachment.d.ts +8 -1
  573. package/lib/components/widget/Attachment/Attachment.d.ts.map +1 -1
  574. package/lib/components/widget/Attachment/Attachment.js +267 -340
  575. package/lib/components/widget/Attachment/Attachment.js.map +1 -1
  576. package/lib/components/widget/Attachment/index.js.map +1 -1
  577. package/lib/components/widget/CaseHistory/CaseHistory.d.ts +4 -7
  578. package/lib/components/widget/CaseHistory/CaseHistory.d.ts.map +1 -1
  579. package/lib/components/widget/CaseHistory/CaseHistory.js +38 -36
  580. package/lib/components/widget/CaseHistory/CaseHistory.js.map +1 -1
  581. package/lib/components/widget/CaseHistory/index.js.map +1 -1
  582. package/lib/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.d.ts +9 -1
  583. package/lib/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.d.ts.map +1 -1
  584. package/lib/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.js +2 -4
  585. package/lib/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.js.map +1 -1
  586. package/lib/components/widget/FileUtility/FileUtility/FileUtility.css +2 -2
  587. package/lib/components/widget/FileUtility/FileUtility/FileUtility.d.ts +5 -1
  588. package/lib/components/widget/FileUtility/FileUtility/FileUtility.d.ts.map +1 -1
  589. package/lib/components/widget/FileUtility/FileUtility/FileUtility.js +122 -141
  590. package/lib/components/widget/FileUtility/FileUtility/FileUtility.js.map +1 -1
  591. package/lib/components/widget/Followers/Followers.d.ts +5 -6
  592. package/lib/components/widget/Followers/Followers.d.ts.map +1 -1
  593. package/lib/components/widget/Followers/Followers.js +10 -25
  594. package/lib/components/widget/Followers/Followers.js.map +1 -1
  595. package/lib/components/widget/QuickCreate/QuickCreate.d.ts +8 -1
  596. package/lib/components/widget/QuickCreate/QuickCreate.d.ts.map +1 -1
  597. package/lib/components/widget/QuickCreate/QuickCreate.js +11 -10
  598. package/lib/components/widget/QuickCreate/QuickCreate.js.map +1 -1
  599. package/lib/components/widget/SummaryItem/SummaryItem.css +9 -9
  600. package/lib/components/widget/SummaryItem/SummaryItem.d.ts +8 -1
  601. package/lib/components/widget/SummaryItem/SummaryItem.d.ts.map +1 -1
  602. package/lib/components/widget/SummaryItem/SummaryItem.js +10 -25
  603. package/lib/components/widget/SummaryItem/SummaryItem.js.map +1 -1
  604. package/lib/components/widget/SummaryItem/index.js.map +1 -1
  605. package/lib/components/widget/SummaryList/SummaryList.d.ts +8 -1
  606. package/lib/components/widget/SummaryList/SummaryList.d.ts.map +1 -1
  607. package/lib/components/widget/SummaryList/SummaryList.js +6 -3
  608. package/lib/components/widget/SummaryList/SummaryList.js.map +1 -1
  609. package/lib/components/widget/ToDo/ToDo.css +4 -4
  610. package/lib/components/widget/ToDo/ToDo.d.ts +13 -27
  611. package/lib/components/widget/ToDo/ToDo.d.ts.map +1 -1
  612. package/lib/components/widget/ToDo/ToDo.js +30 -98
  613. package/lib/components/widget/ToDo/ToDo.js.map +1 -1
  614. package/lib/components_map.d.ts +3 -3
  615. package/lib/components_map.d.ts.map +1 -1
  616. package/lib/components_map.js +821 -818
  617. package/lib/components_map.js.map +1 -1
  618. package/lib/doc/KeyReleaseUpdates.md +66 -9
  619. package/lib/hooks/index.d.ts +4 -0
  620. package/lib/hooks/index.d.ts.map +1 -0
  621. package/lib/hooks/index.js +4 -0
  622. package/lib/hooks/index.js.map +1 -0
  623. package/lib/hooks/useAfterInitialEffect.d.ts +9 -0
  624. package/lib/hooks/useAfterInitialEffect.d.ts.map +1 -0
  625. package/lib/hooks/useAfterInitialEffect.js +16 -0
  626. package/lib/hooks/useAfterInitialEffect.js.map +1 -0
  627. package/lib/hooks/useConsolidatedRef.d.ts +9 -0
  628. package/lib/hooks/useConsolidatedRef.d.ts.map +1 -0
  629. package/lib/hooks/useConsolidatedRef.js +30 -0
  630. package/lib/hooks/useConsolidatedRef.js.map +1 -0
  631. package/lib/hooks/useUID.d.ts +8 -0
  632. package/lib/hooks/useUID.d.ts.map +1 -0
  633. package/lib/hooks/useUID.js +14 -0
  634. package/lib/hooks/useUID.js.map +1 -0
  635. package/lib/index.d.ts +1 -0
  636. package/lib/index.d.ts.map +1 -1
  637. package/lib/index.js +2 -1
  638. package/lib/index.js.map +1 -1
  639. package/lib/sdk-local-component-map.js +2 -2
  640. package/lib/sdk-pega-component-map.d.ts +21 -1
  641. package/lib/sdk-pega-component-map.js +112 -92
  642. package/lib/sdk-pega-component-map.js.map +1 -1
  643. package/lib/types/PConnProps.d.ts +41 -0
  644. package/package.json +5 -2
  645. package/lib/components/helpers/auth.d.ts +0 -16
  646. package/lib/components/helpers/auth.d.ts.map +0 -1
  647. package/lib/components/helpers/auth.js +0 -437
  648. package/lib/components/helpers/auth.js.map +0 -1
  649. package/lib/components/helpers/authManager.d.ts +0 -18
  650. package/lib/components/helpers/authManager.d.ts.map +0 -1
  651. package/lib/components/helpers/authManager.js +0 -589
  652. package/lib/components/helpers/authManager.js.map +0 -1
  653. package/lib/components/helpers/config_access.d.ts +0 -3
  654. package/lib/components/helpers/config_access.d.ts.map +0 -1
  655. package/lib/components/helpers/config_access.js +0 -268
  656. package/lib/components/helpers/config_access.js.map +0 -1
@@ -1,3 +1,17 @@
1
1
  /// <reference types="react" />
2
- export default function AutoComplete(props: any): JSX.Element;
2
+ import { 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: 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":";AASA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AA8B5D,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,GAAG,EAAE,CAAC;CAChB;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,iBAAiB,eAoK5D"}
@@ -1,12 +1,12 @@
1
- import React, { useEffect, useState } from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useEffect, useState } from 'react';
2
3
  import { TextField } from '@material-ui/core';
3
4
  import Autocomplete from '@material-ui/lab/Autocomplete';
4
- import Utils from '../../helpers/utils';
5
- import TextInput from '../TextInput';
6
5
  import isDeepEqual from 'fast-deep-equal/react';
6
+ import Utils from '../../helpers/utils';
7
7
  import { getDataPage } from '../../helpers/data_page';
8
8
  import handleEvent from '../../helpers/event-utils';
9
- import FieldValueList from '../../designSystemExtension/FieldValueList';
9
+ import { getComponentFromMap } from '../../../bridge/helpers/sdk_component_map';
10
10
  const preProcessColumns = columnList => {
11
11
  return columnList.map(col => {
12
12
  const tempColObj = { ...col };
@@ -30,6 +30,9 @@ const getDisplayFieldsMetaData = columnList => {
30
30
  return metaDataObj;
31
31
  };
32
32
  export default function AutoComplete(props) {
33
+ // Get emitted components from map (so we can get any override that may exist)
34
+ const TextInput = getComponentFromMap('TextInput');
35
+ const FieldValueList = getComponentFromMap('FieldValueList');
33
36
  const { getPConnect, label, required, placeholder, value = '', validatemessage, readOnly, testId, displayMode, deferDatasource, datasourceMetadata, status, helperText, hideLabel, onRecordChange } = props;
34
37
  const context = getPConnect().getContextName();
35
38
  let { listType, parameters, datasource = [], columns = [] } = props;
@@ -58,13 +61,10 @@ export default function AutoComplete(props) {
58
61
  if (deferDatasource && datasourceMetadata?.datasource?.name) {
59
62
  listType = 'datapage';
60
63
  datasource = datasourceMetadata.datasource.name;
61
- parameters = flattenParameters(datasourceMetadata?.datasource?.parameters);
62
- const displayProp = datasourceMetadata.datasource.propertyForDisplayText.startsWith('@P')
63
- ? datasourceMetadata.datasource.propertyForDisplayText.substring(3)
64
- : datasourceMetadata.datasource.propertyForDisplayText;
65
- const valueProp = datasourceMetadata.datasource.propertyForValue.startsWith('@P')
66
- ? datasourceMetadata.datasource.propertyForValue.substring(3)
67
- : datasourceMetadata.datasource.propertyForValue;
64
+ const { parameters: dataSourceParameters, propertyForDisplayText, propertyForValue } = datasourceMetadata.datasource;
65
+ parameters = flattenParameters(dataSourceParameters);
66
+ const displayProp = propertyForDisplayText.startsWith('@P') ? propertyForDisplayText.substring(3) : propertyForDisplayText;
67
+ const valueProp = propertyForValue.startsWith('@P') ? propertyForValue.substring(3) : propertyForValue;
68
68
  columns = [
69
69
  {
70
70
  key: 'true',
@@ -82,7 +82,7 @@ export default function AutoComplete(props) {
82
82
  columns = preProcessColumns(columns);
83
83
  useEffect(() => {
84
84
  if (listType === 'associated') {
85
- setOptions(Utils.getOptionList(props, getPConnect().getDataObject()));
85
+ setOptions(Utils.getOptionList(props, getPConnect().getDataObject('')));
86
86
  }
87
87
  }, [theDatasource]);
88
88
  useEffect(() => {
@@ -103,10 +103,10 @@ export default function AutoComplete(props) {
103
103
  }
104
104
  }, []);
105
105
  if (displayMode === 'LABELS_LEFT') {
106
- return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: value });
106
+ return _jsx(FieldValueList, { name: hideLabel ? '' : label, value: value });
107
107
  }
108
108
  if (displayMode === 'STACKED_LARGE_VAL') {
109
- return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: value, variant: 'stacked' });
109
+ return _jsx(FieldValueList, { name: hideLabel ? '' : label, value: value, variant: 'stacked' });
110
110
  }
111
111
  if (value) {
112
112
  const index = options?.findIndex(element => element.key === value);
@@ -129,14 +129,14 @@ export default function AutoComplete(props) {
129
129
  };
130
130
  if (readOnly) {
131
131
  const theValAsString = options?.find(opt => opt.key === value)?.value;
132
- return React.createElement(TextInput, { ...props, value: theValAsString });
132
+ return _jsx(TextInput, { ...props, value: theValAsString });
133
133
  }
134
134
  // Need to use both getOptionLabel and getOptionSelected to map our
135
135
  // key/value structure to what Autocomplete expects
136
- return (React.createElement(Autocomplete, { options: options, getOptionLabel: (option) => {
136
+ return (_jsx(Autocomplete, { options: options, getOptionLabel: (option) => {
137
137
  return option.value ? option.value : '';
138
138
  }, getOptionSelected: (option) => {
139
139
  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 })) }));
140
+ }, fullWidth: true, onChange: handleChange, value: selectedValue, inputValue: inputValue || selectedValue, onInputChange: handleInputValue, renderInput: params => (_jsx(TextField, { ...params, fullWidth: true, variant: 'outlined', helperText: helperTextToDisplay, placeholder: placeholder, size: 'small', required: required, error: status === 'error', label: label, "data-test-id": testId })) }));
141
141
  }
142
142
  //# 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,EAAE,CAAC,GAAG,CAAC,OAAO,KAAK,MAAM,CAAC,CAAC;IACxE,MAAM,WAAW,GAAQ,E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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,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,YAAY,MAAM,+BAA+B,CAAC;AACzD,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAEhD,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,WAAW,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAQhF,MAAM,iBAAiB,GAAG,UAAU,CAAC,EAAE;IACrC,OAA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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,MAAM,CAAC,EAAE,CAAC,CACrB,KAAC,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 { useEffect, useState } from 'react';\nimport { TextField } from '@material-ui/core';\nimport Autocomplete from '@material-ui/lab/Autocomplete';\nimport isDeepEqual from 'fast-deep-equal/react';\n\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 { 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: 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<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() as any).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 const { parameters: dataSourceParameters, propertyForDisplayText, propertyForValue } = datasourceMetadata.datasource;\n parameters = flattenParameters(dataSourceParameters);\n const displayProp = propertyForDisplayText.startsWith('@P') ? propertyForDisplayText.substring(3) : propertyForDisplayText;\n const valueProp = propertyForValue.startsWith('@P') ? propertyForValue.substring(3) : 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: 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 { 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":";AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,mBAAmB,CAAC;AAE3B,UAAU,gBAAiB,SAAQ,eAAe;IAEhD,KAAK,EAAE,GAAG,CAAC;IACX,gBAAgB,EAAE,GAAG,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,gBAAgB,eAsH1D"}
@@ -1,8 +1,9 @@
1
- import React, { useState } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useState } from 'react';
2
3
  import { Button, Grid, IconButton, Snackbar } from '@material-ui/core';
3
4
  import CloseIcon from '@material-ui/icons/Close';
4
5
  import './CancelAlert.css';
5
- const CancelAlert = props => {
6
+ export default function CancelAlert(props) {
6
7
  const { pConn, updateAlertState } = props;
7
8
  const [showSnackbar, setShowSnackbar] = useState(false);
8
9
  const [snackbarMessage, setSnackbarMessage] = useState('');
@@ -10,6 +11,8 @@ const CancelAlert = props => {
10
11
  const caseInfo = pConn.getCaseInfo();
11
12
  const caseName = caseInfo.getName();
12
13
  const ID = caseInfo.getID();
14
+ const localizedVal = PCore.getLocaleUtils().getLocaleValue;
15
+ const localeCategory = 'ModalContainer';
13
16
  function showToast(message) {
14
17
  setSnackbarMessage(message);
15
18
  setShowSnackbar(true);
@@ -35,10 +38,11 @@ const CancelAlert = props => {
35
38
  savePromise
36
39
  .then(() => {
37
40
  dismissModal();
41
+ // @ts-ignore - second parameter “payload” for publish method should be optional
38
42
  PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CASE_CREATED);
39
43
  })
40
44
  .catch(() => {
41
- showToast('Save failed');
45
+ showToast(localizedVal('Save failed', localeCategory));
42
46
  });
43
47
  break;
44
48
  case 'continue':
@@ -50,32 +54,17 @@ const CancelAlert = props => {
50
54
  deletePromise
51
55
  .then(() => {
52
56
  dismissModal();
57
+ // @ts-ignore - second parameter “payload” for publish method should be optional
53
58
  PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL);
54
59
  })
55
60
  .catch(() => {
56
- showToast('Delete failed.');
61
+ showToast(localizedVal('Delete failed.', localeCategory));
57
62
  });
58
63
  break;
59
64
  default:
60
65
  break;
61
66
  }
62
67
  };
63
- return (React.createElement(React.Fragment, null,
64
- React.createElement("div", { className: 'cancel-alert-background' },
65
- React.createElement("div", { className: 'cancel-alert-top' },
66
- React.createElement("h3", null, `Delete ${caseName}(${ID})`),
67
- 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("div", { className: 'action-controls' },
71
- React.createElement(Grid, { container: true, spacing: 4, justifyContent: 'space-between' },
72
- React.createElement(Grid, { item: true },
73
- React.createElement(Button, { variant: 'outlined', color: 'primary', onClick: () => buttonClick('save') }, "Save for later")),
74
- 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(Snackbar, { open: showSnackbar, autoHideDuration: 3000, onClose: handleSnackbarClose, message: snackbarMessage, action: React.createElement(IconButton, { size: 'small', "aria-label": 'close', color: 'inherit', onClick: handleSnackbarClose },
78
- React.createElement(CloseIcon, { fontSize: 'small' })) })));
79
- };
80
- export default CancelAlert;
68
+ return (_jsxs(_Fragment, { children: [_jsx("div", { className: 'cancel-alert-background', children: _jsxs("div", { className: 'cancel-alert-top', children: [_jsx("h3", { children: `Delete ${caseName}(${ID})` }), _jsxs("div", { children: [_jsx("p", { children: `${localizedVal('Are you sure you want to delete', localeCategory)} ${caseName} (${ID})?` }), _jsx("p", { children: localizedVal('Alternatively, you can continue working or save your work for later.', localeCategory) })] }), _jsx("div", { className: 'action-controls', children: _jsxs(Grid, { container: true, spacing: 4, justifyContent: 'space-between', children: [_jsx(Grid, { item: true, children: _jsx(Button, { variant: 'outlined', color: 'primary', onClick: () => buttonClick('save'), children: localizedVal('Save for later', localeCategory) }) }), _jsxs(Grid, { item: true, children: [_jsx(Button, { variant: 'outlined', color: 'primary', onClick: () => buttonClick('continue'), children: localizedVal('Continue Working', localeCategory) }), _jsx(Button, { variant: 'contained', color: 'primary', onClick: () => buttonClick('delete'), children: localizedVal('Delete', localeCategory) })] })] }) })] }) }), _jsx(Snackbar, { open: showSnackbar, autoHideDuration: 3000, onClose: handleSnackbarClose, message: snackbarMessage, action: _jsx(IconButton, { size: 'small', "aria-label": 'close', color: 'inherit', onClick: handleSnackbarClose, children: _jsx(CloseIcon, { fontSize: 'small' }) }) })] }));
69
+ }
81
70
  //# sourceMappingURL=CancelAlert.js.map
@@ -1 +1 @@
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;AAI3B,MAAM,WAAW,GAAG,KAAK,CAAC,EAAE;IAC1B,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;IAE5B,SAAS,SAAS,CAAC,OAAe;QAChC,kBAAkB,CAAC,OAAO,CAAC,CAAC;QAC5B,eAAe,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;IAED,MAAM,sBAAsB,GAAG,GAAG,EAAE;QAClC,gBAAgB,CAA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,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,OAAc,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;AAGjD,OAAO,mBAAmB,CAAC;AAQ3B,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,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AU,EAAC,KAAK,EAAC,SAAS,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,UAAU,CAAC,YAC9E,YAAY,CAAC,kBAAkB,EAAE,cAAc,CAAC,GAC1C,EACT,KAAC,MAAM,IAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,SAAS,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,YAC7E,YAAY,CAAC,QAAQ,EAAE,cAAc,CAAC,GAChC,IACJ,IACF,GACH,IACF,GACF,EACN,KAAC,QAAQ,IACP,IAAI,EAAE,YAAY,EAClB,gBAAgB,EAAE,IAAI,EACtB,OAAO,EAAE,mBAAmB,EAC5B,OAAO,EAAE,eAAe,EACxB,MAAM,EACJ,KAAC,UAAU,IAAC,IAAI,EAAC,OAAO,gBAAY,OAAO,EAAC,KAAK,EAAC,SAAS,EAAC,OAAO,EAAE,mBAAmB,YACtF,KAAC,SAAS,IAAC,QAAQ,EAAC,OAAO,GAAG,GACnB,GAEf,IACD,CACJ,CAAC;AACJ,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 { PConnFieldProps } from '../../../types/PConnProps';\nimport './CancelAlert.css';\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\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 // @ts-ignore - second parameter “payload” for publish method should be optional\n PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CASE_CREATED);\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\n // @ts-ignore - second parameter “payload” for publish method should be optional\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 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/field/CancelAlert/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC","sourcesContent":["export { default } from './CancelAlert';"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/field/CancelAlert/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC","sourcesContent":["export { default } from './CancelAlert';\n"]}
@@ -1,3 +1,11 @@
1
1
  /// <reference types="react" />
2
- export default function CheckboxComponent(props: any): JSX.Element;
2
+ import { PConnFieldProps } from '../../../types/PConnProps';
3
+ interface CheckboxProps extends Omit<PConnFieldProps, 'value'> {
4
+ value?: boolean;
5
+ caption?: string;
6
+ trueLabel?: string;
7
+ falseLabel?: string;
8
+ }
9
+ export default function CheckboxComponent(props: CheckboxProps): JSX.Element;
10
+ export {};
3
11
  //# 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":";AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,UAAU,aAAc,SAAQ,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC;IAE5D,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,KAAK,EAAE,aAAa,eAyE7D"}
@@ -1,13 +1,16 @@
1
- import React, { useState, useEffect } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState, useEffect } from 'react';
2
3
  import { Checkbox, FormControl, FormControlLabel, FormGroup, FormHelperText } from '@material-ui/core';
3
4
  import handleEvent from '../../helpers/event-utils';
4
- import FieldValueList from '../../designSystemExtension/FieldValueList';
5
+ import { getComponentFromMap } from '../../../bridge/helpers/sdk_component_map';
5
6
  export default function CheckboxComponent(props) {
6
- const { getPConnect, label, value = false, readOnly, testId, required, status, helperText, validatemessage, displayMode, hideLabel } = props;
7
+ // Get emitted components from map (so we can get any override that may exist)
8
+ const FieldValueList = getComponentFromMap('FieldValueList');
9
+ const { getPConnect, value = false, readOnly, testId, required, disabled, status, helperText, validatemessage, displayMode, hideLabel, trueLabel, falseLabel } = props;
7
10
  const helperTextToDisplay = validatemessage || helperText;
8
11
  const thePConn = getPConnect();
9
12
  const theConfigProps = thePConn.getConfigProps();
10
- const { caption } = theConfigProps;
13
+ const caption = theConfigProps.caption;
11
14
  const actionsApi = thePConn.getActionsApi();
12
15
  const propName = thePConn.getStateProps().value;
13
16
  const [checked, setChecked] = useState(false);
@@ -16,10 +19,10 @@ export default function CheckboxComponent(props) {
16
19
  setChecked(value);
17
20
  }, [value]);
18
21
  if (displayMode === 'LABELS_LEFT') {
19
- return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: value });
22
+ return _jsx(FieldValueList, { name: hideLabel ? '' : caption, value: value ? trueLabel : falseLabel });
20
23
  }
21
24
  if (displayMode === 'STACKED_LARGE_VAL') {
22
- return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: value, variant: 'stacked' });
25
+ return _jsx(FieldValueList, { name: hideLabel ? '' : caption, value: value ? trueLabel : falseLabel, variant: 'stacked' });
23
26
  }
24
27
  const handleChange = event => {
25
28
  handleEvent(actionsApi, 'changeNblur', propName, event.target.checked);
@@ -27,15 +30,12 @@ export default function CheckboxComponent(props) {
27
30
  const handleBlur = event => {
28
31
  thePConn.getValidationApi().validate(event.target.checked);
29
32
  };
30
- let theCheckbox = React.createElement(Checkbox, { color: 'primary' });
33
+ let theCheckbox = _jsx(Checkbox, { color: 'primary', disabled: disabled });
31
34
  if (readOnly) {
32
35
  // Workaround for lack of InputProps readOnly from https://github.com/mui-org/material-ui/issues/17043
33
36
  // 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 });
37
+ theCheckbox = _jsx(Checkbox, { value: value || false, readOnly: readOnly });
35
38
  }
36
- return (React.createElement(FormControl, { required: required, error: status === 'error' },
37
- 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 })),
39
- React.createElement(FormHelperText, null, helperTextToDisplay)));
39
+ return (_jsxs(FormControl, { required: required, error: status === 'error', children: [_jsx(FormGroup, { children: _jsx(FormControlLabel, { control: theCheckbox, checked: checked, onChange: !readOnly ? handleChange : undefined, onBlur: !readOnly ? handleBlur : undefined, label: caption, labelPlacement: 'end', "data-test-id": testId }) }), _jsx(FormHelperText, { children: helperTextToDisplay })] }));
40
40
  }
41
41
  //# 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,EAA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,\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":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,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EAC1C,KAAK,EAAE,OAAO,EACd,cAAc,EAAC,KAAK,kBACN,MAAM,GACpB,GACQ,EACZ,KAAC,cAAc,cAAE,mBAAmB,GAAkB,IAC1C,CACf,CAAC;AACJ,CAAC","sourcesContent":["import { useState, useEffect } from 'react';\nimport { Checkbox, FormControl, FormControlLabel, FormGroup, FormHelperText } from '@material-ui/core';\n\nimport handleEvent from '../../helpers/event-utils';\nimport { getComponentFromMap } from '../../../bridge/helpers/sdk_component_map';\nimport { PConnFieldProps } from '../../../types/PConnProps';\n\ninterface CheckboxProps extends Omit<PConnFieldProps, 'value'> {\n // If any, enter additional props that only exist on Checkbox here\n value?: boolean;\n // eslint-disable-next-line react/no-unused-prop-types\n caption?: string;\n trueLabel?: string;\n falseLabel?: 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 value = false,\n readOnly,\n testId,\n required,\n disabled,\n status,\n helperText,\n validatemessage,\n displayMode,\n hideLabel,\n trueLabel,\n falseLabel\n } = props;\n const helperTextToDisplay = validatemessage || helperText;\n\n const thePConn = getPConnect();\n const theConfigProps = thePConn.getConfigProps() as CheckboxProps;\n const caption = theConfigProps.caption;\n const actionsApi = thePConn.getActionsApi();\n const propName = (thePConn.getStateProps() as any).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 ? '' : caption} value={value ? trueLabel : falseLabel} />;\n }\n\n if (displayMode === 'STACKED_LARGE_VAL') {\n return <FieldValueList name={hideLabel ? '' : caption} value={value ? trueLabel : falseLabel} 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' 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 { 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,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAM5D,UAAU,cAAe,SAAQ,eAAe;IAE9C,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE,cAAc,eAsFrD"}
@@ -1,32 +1,27 @@
1
- import React, { useState, useEffect } from 'react';
2
- // import { TextField } from "@material-ui/core";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useState, useEffect } from 'react';
3
3
  import CurrencyTextField from '@unicef/material-ui-currency-textfield';
4
4
  import handleEvent from '../../helpers/event-utils';
5
- import FieldValueList from '../../designSystemExtension/FieldValueList';
6
- import { format } from "../../helpers/formatters";
5
+ import { format } from '../../helpers/formatters';
6
+ import { getComponentFromMap } from '../../../bridge/helpers/sdk_component_map';
7
7
  import { getCurrencyCharacters, getCurrencyOptions } from './currency-utils';
8
- // Using control from: https://github.com/unicef/material-ui-currency-textfield
9
8
  export default function Currency(props) {
9
+ // Get emitted components from map (so we can get any override that may exist)
10
+ const FieldValueList = getComponentFromMap('FieldValueList');
10
11
  const { getPConnect, label, required, disabled, value = '', validatemessage, status,
11
12
  /* onChange, onBlur, */
12
- readOnly, testId, helperText, displayMode, hideLabel, currencyISOCode = "USD" } = props;
13
+ readOnly, testId, helperText, displayMode, hideLabel, currencyISOCode = 'USD', placeholder } = props;
13
14
  const pConn = getPConnect();
14
15
  const actions = pConn.getActionsApi();
15
16
  const propName = pConn.getStateProps().value;
16
17
  const helperTextToDisplay = validatemessage || helperText;
17
18
  // console.log(`Currency: label: ${label} value: ${value}`);
18
- let readOnlyProp = {}; // Note: empty if NOT ReadOnly
19
- if (readOnly) {
20
- readOnlyProp = { readOnly: true };
21
- }
22
- let testProp = {};
23
- testProp = {
19
+ const testProp = {
24
20
  'data-test-id': testId
25
21
  };
26
- const [currValue, setCurrValue] = useState();
27
- const [theCurrSym, setCurrSym] = useState("$");
28
- const [theCurrDec, setCurrDec] = useState(".");
29
- const [theCurrSep, setCurrSep] = useState(",");
22
+ const [theCurrSym, setCurrSym] = useState('$');
23
+ const [theCurrDec, setCurrDec] = useState('.');
24
+ const [theCurrSep, setCurrSep] = useState(',');
30
25
  useEffect(() => {
31
26
  // currencySymbols looks like this: { theCurrencySymbol: '$', theDecimalIndicator: '.', theSeparator: ',' }
32
27
  const theSymbols = getCurrencyCharacters(currencyISOCode);
@@ -34,29 +29,19 @@ export default function Currency(props) {
34
29
  setCurrDec(theSymbols.theDecimalIndicator);
35
30
  setCurrSep(theSymbols.theDigitGroupSeparator);
36
31
  }, [currencyISOCode]);
37
- useEffect(() => {
38
- // const testVal = value;
39
- setCurrValue(value.toString());
40
- }, [value]);
41
32
  const theCurrencyOptions = getCurrencyOptions(currencyISOCode);
42
33
  const formattedValue = format(value, pConn.getComponentName().toLowerCase(), theCurrencyOptions);
43
34
  if (displayMode === 'LABELS_LEFT') {
44
- return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: formattedValue });
35
+ return _jsx(FieldValueList, { name: hideLabel ? '' : label, value: formattedValue });
45
36
  }
46
37
  if (displayMode === 'STACKED_LARGE_VAL') {
47
- return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: formattedValue, variant: 'stacked' });
48
- }
49
- // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
50
- function currOnChange(event, inValue) {
51
- // console.log(`Currency currOnChange inValue: ${inValue}`);
52
- // update internal value
53
- setCurrValue(event?.target?.value);
38
+ return _jsx(FieldValueList, { name: hideLabel ? '' : label, value: formattedValue, variant: 'stacked' });
54
39
  }
55
40
  function currOnBlur(event, inValue) {
56
41
  // console.log(`Currency currOnBlur inValue: ${inValue}`);
57
42
  handleEvent(actions, 'changeNblur', propName, inValue !== '' ? Number(inValue) : inValue);
58
43
  }
59
44
  // 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 }));
45
+ return (_jsx(CurrencyTextField, { fullWidth: true, variant: readOnly ? 'standard' : 'outlined', helperText: helperTextToDisplay, placeholder: placeholder ?? '', size: 'small', required: required, disabled: disabled, readOnly: !!readOnly, error: status === 'error', label: label, value: value, type: 'text', outputFormat: 'number', textAlign: 'left', InputProps: { inputProps: { ...testProp } }, currencySymbol: theCurrSym, decimalCharacter: theCurrDec, digitGroupSeparator: theCurrSep, onBlur: !readOnly ? currOnBlur : undefined }));
61
46
  }
62
47
  //# 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,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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AC,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,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,iBAAiB,MAAM,wCAAwC,CAAC;AAEvE,OAAO,WAAW,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAA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KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,IAAI,EAAC,MAAM,EACX,YAAY,EAAC,QAAQ,EACrB,SAAS,EAAC,MAAM,EAChB,UAAU,EAAE,EAAE,UAAU,EAAE,EAAE,GAAG,QAAQ,EAAE,EAAE,EAC3C,cAAc,EAAE,UAAU,EAC1B,gBAAgB,EAAE,UAAU,EAC5B,mBAAmB,EAAE,UAAU,EAC/B,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,GAC1C,CACH,CAAC;AACJ,CAAC","sourcesContent":["import { useState, useEffect } from 'react';\nimport CurrencyTextField from '@unicef/material-ui-currency-textfield';\n\nimport handleEvent from '../../helpers/event-utils';\nimport { format } from '../../helpers/formatters';\nimport { getComponentFromMap } from '../../../bridge/helpers/sdk_component_map';\nimport { PConnFieldProps } from '../../../types/PConnProps';\n\nimport { getCurrencyCharacters, getCurrencyOptions } from './currency-utils';\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 placeholder\n } = props;\n\n const pConn = getPConnect();\n const actions = pConn.getActionsApi();\n const propName = (pConn.getStateProps() as any).value;\n const helperTextToDisplay = validatemessage || helperText;\n\n // console.log(`Currency: label: ${label} value: ${value}`);\n\n const testProp = {\n 'data-test-id': testId\n };\n\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 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 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={placeholder ?? ''}\n size='small'\n required={required}\n disabled={disabled}\n readOnly={!!readOnly}\n error={status === 'error'}\n label={label}\n value={value}\n type='text'\n outputFormat='number'\n textAlign='left'\n InputProps={{ inputProps: { ...testProp } }}\n currencySymbol={theCurrSym}\n decimalCharacter={theCurrDec}\n digitGroupSeparator={theCurrSep}\n onBlur={!readOnly ? currOnBlur : undefined}\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
  };
@@ -1 +1 @@
1
- {"version":3,"file":"currency-utils.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Currency/currency-utils.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,kBAAkB,cAAe,MAAM;;;;CAsCnD,CAAA;AAGD,eAAO,MAAM,qBAAqB,cAAe,MAAM;;;;CA2BtD,CAAA"}
1
+ {"version":3,"file":"currency-utils.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Currency/currency-utils.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,kBAAkB,cAAe,MAAM;;;;CAkCnD,CAAC;AAEF,eAAO,MAAM,qBAAqB,cAAe,MAAM;;;;CA0BtD,CAAC"}