@pega/react-sdk-components 0.23.26 → 8.8.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (553) hide show
  1. package/lib/bridge/Context/StoreContext.d.ts +3 -2
  2. package/lib/bridge/Context/StoreContext.d.ts.map +1 -1
  3. package/lib/bridge/Context/StoreContext.js +2 -3
  4. package/lib/bridge/Context/StoreContext.js.map +1 -1
  5. package/lib/bridge/helpers/sdk_component_map.d.ts +1 -0
  6. package/lib/bridge/helpers/sdk_component_map.d.ts.map +1 -1
  7. package/lib/bridge/helpers/sdk_component_map.js +22 -0
  8. package/lib/bridge/helpers/sdk_component_map.js.map +1 -1
  9. package/lib/bridge/react_pconnect.d.ts.map +1 -1
  10. package/lib/bridge/react_pconnect.js +2 -14
  11. package/lib/bridge/react_pconnect.js.map +1 -1
  12. package/lib/components/designSystemExtension/AlertBanner/AlertBanner.d.ts +10 -0
  13. package/lib/components/designSystemExtension/AlertBanner/AlertBanner.d.ts.map +1 -0
  14. package/lib/components/designSystemExtension/AlertBanner/AlertBanner.js +19 -0
  15. package/lib/components/designSystemExtension/AlertBanner/AlertBanner.js.map +1 -0
  16. package/lib/components/designSystemExtension/AlertBanner/index.d.ts +2 -0
  17. package/lib/components/designSystemExtension/AlertBanner/index.d.ts.map +1 -0
  18. package/lib/components/designSystemExtension/AlertBanner/index.js +2 -0
  19. package/lib/components/designSystemExtension/AlertBanner/index.js.map +1 -0
  20. package/lib/components/designSystemExtension/Banner/Banner.d.ts +15 -1
  21. package/lib/components/designSystemExtension/Banner/Banner.d.ts.map +1 -1
  22. package/lib/components/designSystemExtension/Banner/Banner.js.map +1 -1
  23. package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.d.ts +6 -9
  24. package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.d.ts.map +1 -1
  25. package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.js +3 -7
  26. package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.js.map +1 -1
  27. package/lib/components/designSystemExtension/DetailsFields/DetailsFields.d.ts +4 -10
  28. package/lib/components/designSystemExtension/DetailsFields/DetailsFields.d.ts.map +1 -1
  29. package/lib/components/designSystemExtension/DetailsFields/DetailsFields.js +1 -8
  30. package/lib/components/designSystemExtension/DetailsFields/DetailsFields.js.map +1 -1
  31. package/lib/components/designSystemExtension/FieldGroup/FieldGroup.d.ts +6 -2
  32. package/lib/components/designSystemExtension/FieldGroup/FieldGroup.d.ts.map +1 -1
  33. package/lib/components/designSystemExtension/FieldGroup/FieldGroup.js +3 -3
  34. package/lib/components/designSystemExtension/FieldGroup/FieldGroup.js.map +1 -1
  35. package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.d.ts +7 -2
  36. package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.d.ts.map +1 -1
  37. package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.js +4 -4
  38. package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.js.map +1 -1
  39. package/lib/components/designSystemExtension/FieldValueList/FieldValueList.d.ts +7 -2
  40. package/lib/components/designSystemExtension/FieldValueList/FieldValueList.d.ts.map +1 -1
  41. package/lib/components/designSystemExtension/FieldValueList/FieldValueList.js +3 -3
  42. package/lib/components/designSystemExtension/FieldValueList/FieldValueList.js.map +1 -1
  43. package/lib/components/designSystemExtension/Operator/Operator.d.ts +17 -7
  44. package/lib/components/designSystemExtension/Operator/Operator.d.ts.map +1 -1
  45. package/lib/components/designSystemExtension/Operator/Operator.js +13 -16
  46. package/lib/components/designSystemExtension/Operator/Operator.js.map +1 -1
  47. package/lib/components/designSystemExtension/Pulse/Pulse.d.ts +5 -1
  48. package/lib/components/designSystemExtension/Pulse/Pulse.d.ts.map +1 -1
  49. package/lib/components/designSystemExtension/Pulse/Pulse.js +3 -6
  50. package/lib/components/designSystemExtension/Pulse/Pulse.js.map +1 -1
  51. package/lib/components/designSystemExtension/RichTextEditor/RichTextEditor.d.ts +19 -0
  52. package/lib/components/designSystemExtension/RichTextEditor/RichTextEditor.d.ts.map +1 -0
  53. package/lib/components/designSystemExtension/RichTextEditor/RichTextEditor.js +77 -0
  54. package/lib/components/designSystemExtension/RichTextEditor/RichTextEditor.js.map +1 -0
  55. package/lib/components/designSystemExtension/RichTextEditor/index.d.ts +2 -0
  56. package/lib/components/designSystemExtension/RichTextEditor/index.d.ts.map +1 -0
  57. package/lib/components/designSystemExtension/RichTextEditor/index.js +2 -0
  58. package/lib/components/designSystemExtension/RichTextEditor/index.js.map +1 -0
  59. package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.d.ts +6 -1
  60. package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.d.ts.map +1 -1
  61. package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.js +2 -2
  62. package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.js.map +1 -1
  63. package/lib/components/field/AutoComplete/AutoComplete.d.ts +15 -1
  64. package/lib/components/field/AutoComplete/AutoComplete.d.ts.map +1 -1
  65. package/lib/components/field/AutoComplete/AutoComplete.js +17 -15
  66. package/lib/components/field/AutoComplete/AutoComplete.js.map +1 -1
  67. package/lib/components/field/CancelAlert/CancelAlert.d.ts +7 -2
  68. package/lib/components/field/CancelAlert/CancelAlert.d.ts.map +1 -1
  69. package/lib/components/field/CancelAlert/CancelAlert.js +12 -10
  70. package/lib/components/field/CancelAlert/CancelAlert.js.map +1 -1
  71. package/lib/components/field/Checkbox/Checkbox.d.ts +19 -1
  72. package/lib/components/field/Checkbox/Checkbox.d.ts.map +1 -1
  73. package/lib/components/field/Checkbox/Checkbox.js +12 -10
  74. package/lib/components/field/Checkbox/Checkbox.js.map +1 -1
  75. package/lib/components/field/Currency/Currency.d.ts +6 -1
  76. package/lib/components/field/Currency/Currency.d.ts.map +1 -1
  77. package/lib/components/field/Currency/Currency.js +11 -11
  78. package/lib/components/field/Currency/Currency.js.map +1 -1
  79. package/lib/components/field/Currency/currency-utils.d.ts +1 -1
  80. package/lib/components/field/Currency/currency-utils.d.ts.map +1 -1
  81. package/lib/components/field/Currency/currency-utils.js +1 -1
  82. package/lib/components/field/Currency/currency-utils.js.map +1 -1
  83. package/lib/components/field/Date/Date.d.ts +5 -1
  84. package/lib/components/field/Date/Date.d.ts.map +1 -1
  85. package/lib/components/field/Date/Date.js +19 -11
  86. package/lib/components/field/Date/Date.js.map +1 -1
  87. package/lib/components/field/DateTime/DateTime.d.ts +5 -1
  88. package/lib/components/field/DateTime/DateTime.d.ts.map +1 -1
  89. package/lib/components/field/DateTime/DateTime.js +15 -9
  90. package/lib/components/field/DateTime/DateTime.js.map +1 -1
  91. package/lib/components/field/Decimal/Decimal.d.ts +8 -1
  92. package/lib/components/field/Decimal/Decimal.d.ts.map +1 -1
  93. package/lib/components/field/Decimal/Decimal.js +43 -9
  94. package/lib/components/field/Decimal/Decimal.js.map +1 -1
  95. package/lib/components/field/Dropdown/Dropdown.d.ts +10 -1
  96. package/lib/components/field/Dropdown/Dropdown.d.ts.map +1 -1
  97. package/lib/components/field/Dropdown/Dropdown.js +26 -9
  98. package/lib/components/field/Dropdown/Dropdown.js.map +1 -1
  99. package/lib/components/field/Email/Email.d.ts +5 -1
  100. package/lib/components/field/Email/Email.d.ts.map +1 -1
  101. package/lib/components/field/Email/Email.js +7 -5
  102. package/lib/components/field/Email/Email.js.map +1 -1
  103. package/lib/components/field/Integer/Integer.d.ts +5 -1
  104. package/lib/components/field/Integer/Integer.d.ts.map +1 -1
  105. package/lib/components/field/Integer/Integer.js +6 -4
  106. package/lib/components/field/Integer/Integer.js.map +1 -1
  107. package/lib/components/field/Percentage/Percentage.d.ts +5 -1
  108. package/lib/components/field/Percentage/Percentage.d.ts.map +1 -1
  109. package/lib/components/field/Percentage/Percentage.js +6 -4
  110. package/lib/components/field/Percentage/Percentage.js.map +1 -1
  111. package/lib/components/field/Phone/Phone.d.ts +5 -1
  112. package/lib/components/field/Phone/Phone.d.ts.map +1 -1
  113. package/lib/components/field/Phone/Phone.js +10 -7
  114. package/lib/components/field/Phone/Phone.js.map +1 -1
  115. package/lib/components/field/RadioButtons/RadioButtons.d.ts +7 -1
  116. package/lib/components/field/RadioButtons/RadioButtons.d.ts.map +1 -1
  117. package/lib/components/field/RadioButtons/RadioButtons.js +24 -11
  118. package/lib/components/field/RadioButtons/RadioButtons.js.map +1 -1
  119. package/lib/components/field/RichText/RichText.d.ts +7 -0
  120. package/lib/components/field/RichText/RichText.d.ts.map +1 -0
  121. package/lib/components/field/RichText/RichText.js +51 -0
  122. package/lib/components/field/RichText/RichText.js.map +1 -0
  123. package/lib/components/field/RichText/index.d.ts +2 -0
  124. package/lib/components/field/RichText/index.d.ts.map +1 -0
  125. package/lib/components/field/RichText/index.js +2 -0
  126. package/lib/components/field/RichText/index.js.map +1 -0
  127. package/lib/components/field/ScalarList/ScalarList.d.ts +13 -0
  128. package/lib/components/field/ScalarList/ScalarList.d.ts.map +1 -0
  129. package/lib/components/field/ScalarList/ScalarList.js +34 -0
  130. package/lib/components/field/ScalarList/ScalarList.js.map +1 -0
  131. package/lib/components/field/ScalarList/index.d.ts +2 -0
  132. package/lib/components/field/ScalarList/index.d.ts.map +1 -0
  133. package/lib/components/field/ScalarList/index.js +2 -0
  134. package/lib/components/field/ScalarList/index.js.map +1 -0
  135. package/lib/components/field/SemanticLink/SemanticLink.d.ts +5 -9
  136. package/lib/components/field/SemanticLink/SemanticLink.d.ts.map +1 -1
  137. package/lib/components/field/SemanticLink/SemanticLink.js +10 -14
  138. package/lib/components/field/SemanticLink/SemanticLink.js.map +1 -1
  139. package/lib/components/field/SemanticLink/utils.d.ts.map +1 -1
  140. package/lib/components/field/SemanticLink/utils.js.map +1 -1
  141. package/lib/components/field/TextArea/TextArea.d.ts +6 -1
  142. package/lib/components/field/TextArea/TextArea.d.ts.map +1 -1
  143. package/lib/components/field/TextArea/TextArea.js +5 -3
  144. package/lib/components/field/TextArea/TextArea.js.map +1 -1
  145. package/lib/components/field/TextContent/TextContent.d.ts +7 -1
  146. package/lib/components/field/TextContent/TextContent.d.ts.map +1 -1
  147. package/lib/components/field/TextContent/TextContent.js.map +1 -1
  148. package/lib/components/field/TextInput/TextInput.d.ts +6 -1
  149. package/lib/components/field/TextInput/TextInput.d.ts.map +1 -1
  150. package/lib/components/field/TextInput/TextInput.js +24 -5
  151. package/lib/components/field/TextInput/TextInput.js.map +1 -1
  152. package/lib/components/field/Time/Time.d.ts +5 -1
  153. package/lib/components/field/Time/Time.d.ts.map +1 -1
  154. package/lib/components/field/Time/Time.js +14 -8
  155. package/lib/components/field/Time/Time.js.map +1 -1
  156. package/lib/components/field/URL/URL.d.ts +5 -1
  157. package/lib/components/field/URL/URL.d.ts.map +1 -1
  158. package/lib/components/field/URL/URL.js +11 -5
  159. package/lib/components/field/URL/URL.js.map +1 -1
  160. package/lib/components/field/UserReference/UserReference.d.ts +19 -40
  161. package/lib/components/field/UserReference/UserReference.d.ts.map +1 -1
  162. package/lib/components/field/UserReference/UserReference.js +16 -45
  163. package/lib/components/field/UserReference/UserReference.js.map +1 -1
  164. package/lib/components/helpers/attachmentHelpers.d.ts +6 -6
  165. package/lib/components/helpers/attachmentHelpers.d.ts.map +1 -1
  166. package/lib/components/helpers/attachmentHelpers.js +2 -2
  167. package/lib/components/helpers/attachmentHelpers.js.map +1 -1
  168. package/lib/components/helpers/auth.d.ts +8 -6
  169. package/lib/components/helpers/auth.d.ts.map +1 -1
  170. package/lib/components/helpers/auth.js +642 -327
  171. package/lib/components/helpers/auth.js.map +1 -1
  172. package/lib/components/helpers/authManager.d.ts +20 -17
  173. package/lib/components/helpers/authManager.d.ts.map +1 -1
  174. package/lib/components/helpers/authManager.js +713 -438
  175. package/lib/components/helpers/authManager.js.map +1 -1
  176. package/lib/components/helpers/case-utils.d.ts +20 -0
  177. package/lib/components/helpers/case-utils.d.ts.map +1 -0
  178. package/lib/components/helpers/case-utils.js +82 -0
  179. package/lib/components/helpers/case-utils.js.map +1 -0
  180. package/lib/components/helpers/common-utils.d.ts +2 -0
  181. package/lib/components/helpers/common-utils.d.ts.map +1 -0
  182. package/lib/components/helpers/common-utils.js +5 -0
  183. package/lib/components/helpers/common-utils.js.map +1 -0
  184. package/lib/components/helpers/config_access.d.ts.map +1 -1
  185. package/lib/components/helpers/config_access.js +28 -98
  186. package/lib/components/helpers/config_access.js.map +1 -1
  187. package/lib/components/helpers/data_page.d.ts.map +1 -1
  188. package/lib/components/helpers/data_page.js.map +1 -1
  189. package/lib/components/helpers/date-format-utils.d.ts +1 -6
  190. package/lib/components/helpers/date-format-utils.d.ts.map +1 -1
  191. package/lib/components/helpers/date-format-utils.js +23 -14
  192. package/lib/components/helpers/date-format-utils.js.map +1 -1
  193. package/lib/components/helpers/event-utils.d.ts +1 -1
  194. package/lib/components/helpers/event-utils.d.ts.map +1 -1
  195. package/lib/components/helpers/event-utils.js.map +1 -1
  196. package/lib/components/helpers/field-group-utils.d.ts +15 -2
  197. package/lib/components/helpers/field-group-utils.d.ts.map +1 -1
  198. package/lib/components/helpers/field-group-utils.js +3 -3
  199. package/lib/components/helpers/field-group-utils.js.map +1 -1
  200. package/lib/components/helpers/formatters/Boolean.d.ts +3 -3
  201. package/lib/components/helpers/formatters/Boolean.d.ts.map +1 -1
  202. package/lib/components/helpers/formatters/Boolean.js.map +1 -1
  203. package/lib/components/helpers/formatters/Currency.d.ts +6 -6
  204. package/lib/components/helpers/formatters/Currency.d.ts.map +1 -1
  205. package/lib/components/helpers/formatters/Currency.js +6 -5
  206. package/lib/components/helpers/formatters/Currency.js.map +1 -1
  207. package/lib/components/helpers/formatters/CurrencyMap.d.ts +881 -1399
  208. package/lib/components/helpers/formatters/CurrencyMap.d.ts.map +1 -1
  209. package/lib/components/helpers/formatters/CurrencyMap.js.map +1 -1
  210. package/lib/components/helpers/formatters/Date.d.ts +4 -4
  211. package/lib/components/helpers/formatters/Date.d.ts.map +1 -1
  212. package/lib/components/helpers/formatters/Date.js +1 -1
  213. package/lib/components/helpers/formatters/Date.js.map +1 -1
  214. package/lib/components/helpers/formatters/common.d.ts +2 -2
  215. package/lib/components/helpers/formatters/common.d.ts.map +1 -1
  216. package/lib/components/helpers/formatters/common.js +4 -5
  217. package/lib/components/helpers/formatters/common.js.map +1 -1
  218. package/lib/components/helpers/formatters/index.d.ts +11 -11
  219. package/lib/components/helpers/formatters/index.d.ts.map +1 -1
  220. package/lib/components/helpers/formatters/index.js.map +1 -1
  221. package/lib/components/helpers/reactContextHelpers.d.ts +3 -2
  222. package/lib/components/helpers/reactContextHelpers.d.ts.map +1 -1
  223. package/lib/components/helpers/reactContextHelpers.js.map +1 -1
  224. package/lib/components/helpers/simpleTableHelpers.d.ts +5 -3
  225. package/lib/components/helpers/simpleTableHelpers.d.ts.map +1 -1
  226. package/lib/components/helpers/simpleTableHelpers.js +10 -5
  227. package/lib/components/helpers/simpleTableHelpers.js.map +1 -1
  228. package/lib/components/helpers/state-utils.d.ts +4 -0
  229. package/lib/components/helpers/state-utils.d.ts.map +1 -0
  230. package/lib/components/helpers/state-utils.js +36 -0
  231. package/lib/components/helpers/state-utils.js.map +1 -0
  232. package/lib/components/helpers/template-utils.d.ts +7 -3
  233. package/lib/components/helpers/template-utils.d.ts.map +1 -1
  234. package/lib/components/helpers/template-utils.js.map +1 -1
  235. package/lib/components/helpers/utils.d.ts +1 -1
  236. package/lib/components/helpers/utils.d.ts.map +1 -1
  237. package/lib/components/helpers/utils.js +9 -3
  238. package/lib/components/helpers/utils.js.map +1 -1
  239. package/lib/components/helpers/versionHelpers.d.ts.map +1 -1
  240. package/lib/components/helpers/versionHelpers.js.map +1 -1
  241. package/lib/components/infra/ActionButtons/ActionButtons.d.ts +6 -13
  242. package/lib/components/infra/ActionButtons/ActionButtons.d.ts.map +1 -1
  243. package/lib/components/infra/ActionButtons/ActionButtons.js +5 -15
  244. package/lib/components/infra/ActionButtons/ActionButtons.js.map +1 -1
  245. package/lib/components/infra/Assignment/Assignment.d.ts +9 -14
  246. package/lib/components/infra/Assignment/Assignment.d.ts.map +1 -1
  247. package/lib/components/infra/Assignment/Assignment.js +32 -33
  248. package/lib/components/infra/Assignment/Assignment.js.map +1 -1
  249. package/lib/components/infra/AssignmentCard/AssignmentCard.d.ts +8 -14
  250. package/lib/components/infra/AssignmentCard/AssignmentCard.d.ts.map +1 -1
  251. package/lib/components/infra/AssignmentCard/AssignmentCard.js +3 -16
  252. package/lib/components/infra/AssignmentCard/AssignmentCard.js.map +1 -1
  253. package/lib/components/infra/Containers/FlowContainer/FlowContainer.d.ts +1 -21
  254. package/lib/components/infra/Containers/FlowContainer/FlowContainer.d.ts.map +1 -1
  255. package/lib/components/infra/Containers/FlowContainer/FlowContainer.js +53 -52
  256. package/lib/components/infra/Containers/FlowContainer/FlowContainer.js.map +1 -1
  257. package/lib/components/infra/Containers/FlowContainer/helpers.d.ts +12 -12
  258. package/lib/components/infra/Containers/FlowContainer/helpers.d.ts.map +1 -1
  259. package/lib/components/infra/Containers/FlowContainer/helpers.js +17 -16
  260. package/lib/components/infra/Containers/FlowContainer/helpers.js.map +1 -1
  261. package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.d.ts +8 -17
  262. package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.d.ts.map +1 -1
  263. package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.js +22 -24
  264. package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.js.map +1 -1
  265. package/lib/components/infra/Containers/ViewContainer/ViewContainer.d.ts +9 -22
  266. package/lib/components/infra/Containers/ViewContainer/ViewContainer.d.ts.map +1 -1
  267. package/lib/components/infra/Containers/ViewContainer/ViewContainer.js +7 -22
  268. package/lib/components/infra/Containers/ViewContainer/ViewContainer.js.map +1 -1
  269. package/lib/components/infra/DashboardFilter/DashboardFilter.d.ts +9 -19
  270. package/lib/components/infra/DashboardFilter/DashboardFilter.d.ts.map +1 -1
  271. package/lib/components/infra/DashboardFilter/DashboardFilter.js +2 -16
  272. package/lib/components/infra/DashboardFilter/DashboardFilter.js.map +1 -1
  273. package/lib/components/infra/DashboardFilter/filterUtils.d.ts.map +1 -1
  274. package/lib/components/infra/DashboardFilter/filterUtils.js +1 -1
  275. package/lib/components/infra/DashboardFilter/filterUtils.js.map +1 -1
  276. package/lib/components/infra/DeferLoad/DeferLoad.d.ts +1 -14
  277. package/lib/components/infra/DeferLoad/DeferLoad.d.ts.map +1 -1
  278. package/lib/components/infra/DeferLoad/DeferLoad.js +13 -15
  279. package/lib/components/infra/DeferLoad/DeferLoad.js.map +1 -1
  280. package/lib/components/infra/ErrorBoundary/ErrorBoundary.d.ts +5 -12
  281. package/lib/components/infra/ErrorBoundary/ErrorBoundary.d.ts.map +1 -1
  282. package/lib/components/infra/ErrorBoundary/ErrorBoundary.js +9 -16
  283. package/lib/components/infra/ErrorBoundary/ErrorBoundary.js.map +1 -1
  284. package/lib/components/infra/MultiStep/MultiStep.d.ts +11 -17
  285. package/lib/components/infra/MultiStep/MultiStep.d.ts.map +1 -1
  286. package/lib/components/infra/MultiStep/MultiStep.js +6 -20
  287. package/lib/components/infra/MultiStep/MultiStep.js.map +1 -1
  288. package/lib/components/infra/NavBar/NavBar.d.ts +8 -16
  289. package/lib/components/infra/NavBar/NavBar.d.ts.map +1 -1
  290. package/lib/components/infra/NavBar/NavBar.js +9 -20
  291. package/lib/components/infra/NavBar/NavBar.js.map +1 -1
  292. package/lib/components/infra/Reference/Reference.d.ts +8 -17
  293. package/lib/components/infra/Reference/Reference.d.ts.map +1 -1
  294. package/lib/components/infra/Reference/Reference.js +1 -15
  295. package/lib/components/infra/Reference/Reference.js.map +1 -1
  296. package/lib/components/infra/Region/Region.d.ts +4 -7
  297. package/lib/components/infra/Region/Region.d.ts.map +1 -1
  298. package/lib/components/infra/Region/Region.js +0 -4
  299. package/lib/components/infra/Region/Region.js.map +1 -1
  300. package/lib/components/infra/RootContainer/RootContainer.d.ts +1 -21
  301. package/lib/components/infra/RootContainer/RootContainer.d.ts.map +1 -1
  302. package/lib/components/infra/RootContainer/RootContainer.js +16 -36
  303. package/lib/components/infra/RootContainer/RootContainer.js.map +1 -1
  304. package/lib/components/infra/Stages/Stages.d.ts +5 -8
  305. package/lib/components/infra/Stages/Stages.d.ts.map +1 -1
  306. package/lib/components/infra/Stages/Stages.js +3 -7
  307. package/lib/components/infra/Stages/Stages.js.map +1 -1
  308. package/lib/components/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.d.ts.map +1 -1
  309. package/lib/components/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.js.map +1 -1
  310. package/lib/components/infra/VerticalTabs/VerticalTabs/VerticalTabs.d.ts +4 -10
  311. package/lib/components/infra/VerticalTabs/VerticalTabs/VerticalTabs.d.ts.map +1 -1
  312. package/lib/components/infra/VerticalTabs/VerticalTabs/VerticalTabs.js +4 -9
  313. package/lib/components/infra/VerticalTabs/VerticalTabs/VerticalTabs.js.map +1 -1
  314. package/lib/components/infra/View/View.d.ts +13 -16
  315. package/lib/components/infra/View/View.d.ts.map +1 -1
  316. package/lib/components/infra/View/View.js +8 -54
  317. package/lib/components/infra/View/View.js.map +1 -1
  318. package/lib/components/template/AppShell/AppShell.d.ts +20 -15
  319. package/lib/components/template/AppShell/AppShell.d.ts.map +1 -1
  320. package/lib/components/template/AppShell/AppShell.js +17 -29
  321. package/lib/components/template/AppShell/AppShell.js.map +1 -1
  322. package/lib/components/template/BannerPage/BannerPage.d.ts +11 -23
  323. package/lib/components/template/BannerPage/BannerPage.d.ts.map +1 -1
  324. package/lib/components/template/BannerPage/BannerPage.js +4 -22
  325. package/lib/components/template/BannerPage/BannerPage.js.map +1 -1
  326. package/lib/components/template/CaseSummary/CaseSummary.d.ts +5 -7
  327. package/lib/components/template/CaseSummary/CaseSummary.d.ts.map +1 -1
  328. package/lib/components/template/CaseSummary/CaseSummary.js +6 -6
  329. package/lib/components/template/CaseSummary/CaseSummary.js.map +1 -1
  330. package/lib/components/template/CaseView/CaseView.d.ts +10 -22
  331. package/lib/components/template/CaseView/CaseView.d.ts.map +1 -1
  332. package/lib/components/template/CaseView/CaseView.js +41 -45
  333. package/lib/components/template/CaseView/CaseView.js.map +1 -1
  334. package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.d.ts +8 -13
  335. package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.d.ts.map +1 -1
  336. package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.js +9 -16
  337. package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.js.map +1 -1
  338. package/lib/components/template/Confirmation/Confirmation.d.ts +10 -16
  339. package/lib/components/template/Confirmation/Confirmation.d.ts.map +1 -1
  340. package/lib/components/template/Confirmation/Confirmation.js +12 -23
  341. package/lib/components/template/Confirmation/Confirmation.js.map +1 -1
  342. package/lib/components/template/DataReference/DataReference.d.ts +1 -31
  343. package/lib/components/template/DataReference/DataReference.d.ts.map +1 -1
  344. package/lib/components/template/DataReference/DataReference.js +41 -48
  345. package/lib/components/template/DataReference/DataReference.js.map +1 -1
  346. package/lib/components/template/DefaultForm/DefaultForm.d.ts +1 -11
  347. package/lib/components/template/DefaultForm/DefaultForm.d.ts.map +1 -1
  348. package/lib/components/template/DefaultForm/DefaultForm.js +18 -15
  349. package/lib/components/template/DefaultForm/DefaultForm.js.map +1 -1
  350. package/lib/components/template/DefaultForm/utils/index.d.ts +3 -0
  351. package/lib/components/template/DefaultForm/utils/index.d.ts.map +1 -0
  352. package/lib/components/template/DefaultForm/utils/index.js +27 -0
  353. package/lib/components/template/DefaultForm/utils/index.js.map +1 -0
  354. package/lib/components/template/Details/Details/Details.d.ts +1 -16
  355. package/lib/components/template/Details/Details/Details.d.ts.map +1 -1
  356. package/lib/components/template/Details/Details/Details.js +10 -15
  357. package/lib/components/template/Details/Details/Details.js.map +1 -1
  358. package/lib/components/template/Details/DetailsSubTabs/DetailsSubTabs.d.ts +7 -15
  359. package/lib/components/template/Details/DetailsSubTabs/DetailsSubTabs.d.ts.map +1 -1
  360. package/lib/components/template/Details/DetailsSubTabs/DetailsSubTabs.js +1 -13
  361. package/lib/components/template/Details/DetailsSubTabs/DetailsSubTabs.js.map +1 -1
  362. package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.d.ts +1 -16
  363. package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.d.ts.map +1 -1
  364. package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.js +14 -16
  365. package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.js.map +1 -1
  366. package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.d.ts +1 -16
  367. package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.d.ts.map +1 -1
  368. package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.js +14 -16
  369. package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.js.map +1 -1
  370. package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.d.ts +12 -19
  371. package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.d.ts.map +1 -1
  372. package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.js +7 -21
  373. package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.js.map +1 -1
  374. package/lib/components/template/InlineDashboard/InlineDashboard.d.ts +7 -7
  375. package/lib/components/template/InlineDashboard/InlineDashboard.d.ts.map +1 -1
  376. package/lib/components/template/InlineDashboard/InlineDashboard.js +0 -5
  377. package/lib/components/template/InlineDashboard/InlineDashboard.js.map +1 -1
  378. package/lib/components/template/InlineDashboardPage/InlineDashboardPage.d.ts +8 -15
  379. package/lib/components/template/InlineDashboardPage/InlineDashboardPage.d.ts.map +1 -1
  380. package/lib/components/template/InlineDashboardPage/InlineDashboardPage.js +5 -14
  381. package/lib/components/template/InlineDashboardPage/InlineDashboardPage.js.map +1 -1
  382. package/lib/components/template/ListPage/ListPage.d.ts +5 -13
  383. package/lib/components/template/ListPage/ListPage.d.ts.map +1 -1
  384. package/lib/components/template/ListPage/ListPage.js +6 -10
  385. package/lib/components/template/ListPage/ListPage.js.map +1 -1
  386. package/lib/components/template/ListView/DefaultViewMeta.d.ts +1 -90
  387. package/lib/components/template/ListView/DefaultViewMeta.d.ts.map +1 -1
  388. package/lib/components/template/ListView/DefaultViewMeta.js.map +1 -1
  389. package/lib/components/template/ListView/ListView.d.ts +1 -9
  390. package/lib/components/template/ListView/ListView.d.ts.map +1 -1
  391. package/lib/components/template/ListView/ListView.js +96 -100
  392. package/lib/components/template/ListView/ListView.js.map +1 -1
  393. package/lib/components/template/ListView/hooks.d.ts.map +1 -1
  394. package/lib/components/template/ListView/hooks.js +0 -1
  395. package/lib/components/template/ListView/hooks.js.map +1 -1
  396. package/lib/components/template/ListView/utils.d.ts +72 -16
  397. package/lib/components/template/ListView/utils.d.ts.map +1 -1
  398. package/lib/components/template/ListView/utils.js +143 -3
  399. package/lib/components/template/ListView/utils.js.map +1 -1
  400. package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.d.ts +9 -13
  401. package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.d.ts.map +1 -1
  402. package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.js +2 -13
  403. package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.js.map +1 -1
  404. package/lib/components/template/NarrowWide/NarrowWide/NarrowWide.d.ts +10 -1
  405. package/lib/components/template/NarrowWide/NarrowWide/NarrowWide.d.ts.map +1 -1
  406. package/lib/components/template/NarrowWide/NarrowWide/NarrowWide.js.map +1 -1
  407. package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.d.ts +1 -16
  408. package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.d.ts.map +1 -1
  409. package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.js +14 -16
  410. package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.js.map +1 -1
  411. package/lib/components/template/NarrowWide/NarrowWideForm/NarrowWideForm.d.ts +5 -1
  412. package/lib/components/template/NarrowWide/NarrowWideForm/NarrowWideForm.d.ts.map +1 -1
  413. package/lib/components/template/NarrowWide/NarrowWideForm/NarrowWideForm.js.map +1 -1
  414. package/lib/components/template/NarrowWide/NarrowWidePage/NarrowWidePage.d.ts +7 -14
  415. package/lib/components/template/NarrowWide/NarrowWidePage/NarrowWidePage.d.ts.map +1 -1
  416. package/lib/components/template/NarrowWide/NarrowWidePage/NarrowWidePage.js +4 -13
  417. package/lib/components/template/NarrowWide/NarrowWidePage/NarrowWidePage.js.map +1 -1
  418. package/lib/components/template/OneColumn/OneColumn/OneColumn.d.ts +4 -7
  419. package/lib/components/template/OneColumn/OneColumn/OneColumn.d.ts.map +1 -1
  420. package/lib/components/template/OneColumn/OneColumn/OneColumn.js +0 -5
  421. package/lib/components/template/OneColumn/OneColumn/OneColumn.js.map +1 -1
  422. package/lib/components/template/OneColumn/OneColumnPage/OneColumnPage.d.ts +4 -8
  423. package/lib/components/template/OneColumn/OneColumnPage/OneColumnPage.d.ts.map +1 -1
  424. package/lib/components/template/OneColumn/OneColumnPage/OneColumnPage.js +3 -6
  425. package/lib/components/template/OneColumn/OneColumnPage/OneColumnPage.js.map +1 -1
  426. package/lib/components/template/OneColumn/OneColumnTab/OneColumnTab.d.ts +4 -7
  427. package/lib/components/template/OneColumn/OneColumnTab/OneColumnTab.d.ts.map +1 -1
  428. package/lib/components/template/OneColumn/OneColumnTab/OneColumnTab.js +0 -5
  429. package/lib/components/template/OneColumn/OneColumnTab/OneColumnTab.js.map +1 -1
  430. package/lib/components/template/PromotedFilters/PromotedFilters.d.ts +1 -15
  431. package/lib/components/template/PromotedFilters/PromotedFilters.d.ts.map +1 -1
  432. package/lib/components/template/PromotedFilters/PromotedFilters.js +17 -13
  433. package/lib/components/template/PromotedFilters/PromotedFilters.js.map +1 -1
  434. package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.d.ts.map +1 -1
  435. package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.js +57 -5
  436. package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.js.map +1 -1
  437. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.d.ts +18 -1
  438. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.d.ts.map +1 -1
  439. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js +5 -5
  440. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js.map +1 -1
  441. package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.d.ts +1 -29
  442. package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.d.ts.map +1 -1
  443. package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.js +22 -28
  444. package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.js.map +1 -1
  445. package/lib/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.d.ts +14 -26
  446. package/lib/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.d.ts.map +1 -1
  447. package/lib/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.js +5 -26
  448. package/lib/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.js.map +1 -1
  449. package/lib/components/template/SubTabs/SubTabs.d.ts +4 -10
  450. package/lib/components/template/SubTabs/SubTabs.d.ts.map +1 -1
  451. package/lib/components/template/SubTabs/SubTabs.js +1 -8
  452. package/lib/components/template/SubTabs/SubTabs.js.map +1 -1
  453. package/lib/components/template/SubTabs/tabUtils.d.ts.map +1 -1
  454. package/lib/components/template/SubTabs/tabUtils.js.map +1 -1
  455. package/lib/components/template/TwoColumn/TwoColumn/TwoColumn.d.ts +5 -11
  456. package/lib/components/template/TwoColumn/TwoColumn/TwoColumn.d.ts.map +1 -1
  457. package/lib/components/template/TwoColumn/TwoColumn/TwoColumn.js +1 -12
  458. package/lib/components/template/TwoColumn/TwoColumn/TwoColumn.js.map +1 -1
  459. package/lib/components/template/TwoColumn/TwoColumnPage/TwoColumnPage.d.ts +4 -8
  460. package/lib/components/template/TwoColumn/TwoColumnPage/TwoColumnPage.d.ts.map +1 -1
  461. package/lib/components/template/TwoColumn/TwoColumnPage/TwoColumnPage.js +3 -6
  462. package/lib/components/template/TwoColumn/TwoColumnPage/TwoColumnPage.js.map +1 -1
  463. package/lib/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.d.ts +5 -11
  464. package/lib/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.d.ts.map +1 -1
  465. package/lib/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.js +1 -9
  466. package/lib/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.js.map +1 -1
  467. package/lib/components/template/WideNarrow/WideNarrow/WideNarrow.d.ts +10 -1
  468. package/lib/components/template/WideNarrow/WideNarrow/WideNarrow.d.ts.map +1 -1
  469. package/lib/components/template/WideNarrow/WideNarrow/WideNarrow.js +1 -1
  470. package/lib/components/template/WideNarrow/WideNarrow/WideNarrow.js.map +1 -1
  471. package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.d.ts +1 -16
  472. package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.d.ts.map +1 -1
  473. package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.js +31 -23
  474. package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.js.map +1 -1
  475. package/lib/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.d.ts +5 -1
  476. package/lib/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.d.ts.map +1 -1
  477. package/lib/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.js.map +1 -1
  478. package/lib/components/template/WideNarrow/WideNarrowPage/WideNarrowPage.d.ts +7 -14
  479. package/lib/components/template/WideNarrow/WideNarrowPage/WideNarrowPage.d.ts.map +1 -1
  480. package/lib/components/template/WideNarrow/WideNarrowPage/WideNarrowPage.js +4 -14
  481. package/lib/components/template/WideNarrow/WideNarrowPage/WideNarrowPage.js.map +1 -1
  482. package/lib/components/template/WssNavBar/WssNavBar.d.ts +17 -1
  483. package/lib/components/template/WssNavBar/WssNavBar.d.ts.map +1 -1
  484. package/lib/components/template/WssNavBar/WssNavBar.js +2 -2
  485. package/lib/components/template/WssNavBar/WssNavBar.js.map +1 -1
  486. package/lib/components/widget/AppAnnouncement/AppAnnouncement.d.ts +8 -17
  487. package/lib/components/widget/AppAnnouncement/AppAnnouncement.d.ts.map +1 -1
  488. package/lib/components/widget/AppAnnouncement/AppAnnouncement.js +4 -19
  489. package/lib/components/widget/AppAnnouncement/AppAnnouncement.js.map +1 -1
  490. package/lib/components/widget/Attachment/Attachment.css +15 -3
  491. package/lib/components/widget/Attachment/Attachment.d.ts.map +1 -1
  492. package/lib/components/widget/Attachment/Attachment.js +44 -32
  493. package/lib/components/widget/Attachment/Attachment.js.map +1 -1
  494. package/lib/components/widget/CaseHistory/CaseHistory.d.ts +4 -7
  495. package/lib/components/widget/CaseHistory/CaseHistory.d.ts.map +1 -1
  496. package/lib/components/widget/CaseHistory/CaseHistory.js +4 -8
  497. package/lib/components/widget/CaseHistory/CaseHistory.js.map +1 -1
  498. package/lib/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.d.ts +8 -1
  499. package/lib/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.d.ts.map +1 -1
  500. package/lib/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.js.map +1 -1
  501. package/lib/components/widget/FileUtility/FileUtility/FileUtility.d.ts +5 -1
  502. package/lib/components/widget/FileUtility/FileUtility/FileUtility.d.ts.map +1 -1
  503. package/lib/components/widget/FileUtility/FileUtility/FileUtility.js +33 -23
  504. package/lib/components/widget/FileUtility/FileUtility/FileUtility.js.map +1 -1
  505. package/lib/components/widget/Followers/Followers.d.ts +4 -5
  506. package/lib/components/widget/Followers/Followers.d.ts.map +1 -1
  507. package/lib/components/widget/Followers/Followers.js +3 -10
  508. package/lib/components/widget/Followers/Followers.js.map +1 -1
  509. package/lib/components/widget/QuickCreate/QuickCreate.d.ts.map +1 -1
  510. package/lib/components/widget/QuickCreate/QuickCreate.js +12 -4
  511. package/lib/components/widget/QuickCreate/QuickCreate.js.map +1 -1
  512. package/lib/components/widget/SummaryItem/SummaryItem.d.ts +7 -1
  513. package/lib/components/widget/SummaryItem/SummaryItem.d.ts.map +1 -1
  514. package/lib/components/widget/SummaryItem/SummaryItem.js +2 -2
  515. package/lib/components/widget/SummaryItem/SummaryItem.js.map +1 -1
  516. package/lib/components/widget/SummaryList/SummaryList.d.ts +7 -1
  517. package/lib/components/widget/SummaryList/SummaryList.d.ts.map +1 -1
  518. package/lib/components/widget/SummaryList/SummaryList.js +5 -2
  519. package/lib/components/widget/SummaryList/SummaryList.js.map +1 -1
  520. package/lib/components/widget/ToDo/ToDo.d.ts +13 -27
  521. package/lib/components/widget/ToDo/ToDo.d.ts.map +1 -1
  522. package/lib/components/widget/ToDo/ToDo.js +35 -67
  523. package/lib/components/widget/ToDo/ToDo.js.map +1 -1
  524. package/lib/components_map.d.ts +3 -3
  525. package/lib/components_map.d.ts.map +1 -1
  526. package/lib/components_map.js +819 -818
  527. package/lib/components_map.js.map +1 -1
  528. package/lib/doc/KeyReleaseUpdates.md +65 -9
  529. package/lib/hooks/index.d.ts +4 -0
  530. package/lib/hooks/index.d.ts.map +1 -0
  531. package/lib/hooks/index.js +4 -0
  532. package/lib/hooks/index.js.map +1 -0
  533. package/lib/hooks/useAfterInitialEffect.d.ts +9 -0
  534. package/lib/hooks/useAfterInitialEffect.d.ts.map +1 -0
  535. package/lib/hooks/useAfterInitialEffect.js +16 -0
  536. package/lib/hooks/useAfterInitialEffect.js.map +1 -0
  537. package/lib/hooks/useConsolidatedRef.d.ts +9 -0
  538. package/lib/hooks/useConsolidatedRef.d.ts.map +1 -0
  539. package/lib/hooks/useConsolidatedRef.js +30 -0
  540. package/lib/hooks/useConsolidatedRef.js.map +1 -0
  541. package/lib/hooks/useUID.d.ts +8 -0
  542. package/lib/hooks/useUID.d.ts.map +1 -0
  543. package/lib/hooks/useUID.js +14 -0
  544. package/lib/hooks/useUID.js.map +1 -0
  545. package/lib/index.d.ts +1 -0
  546. package/lib/index.d.ts.map +1 -1
  547. package/lib/index.js +2 -1
  548. package/lib/index.js.map +1 -1
  549. package/lib/sdk-pega-component-map.d.ts +15 -1
  550. package/lib/sdk-pega-component-map.js +15 -1
  551. package/lib/sdk-pega-component-map.js.map +1 -1
  552. package/lib/types/PConnProps.d.ts +42 -0
  553. package/package.json +1 -1
@@ -1,13 +1,16 @@
1
1
  import React, { Fragment, memo, useEffect, useState } from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import { Typography } from '@material-ui/core';
4
- import AutoComplete from '../AutoComplete';
5
- import Dropdown from '../Dropdown';
6
3
  import { getUserId, isUserNameAvailable } from './UserReferenceUtils';
4
+ import { getComponentFromMap } from '../../../bridge/helpers/sdk_component_map';
7
5
  const DROPDOWN_LIST = 'Drop-down list';
8
6
  const SEARCH_BOX = 'Search box';
9
- const UserReference = props => {
10
- const { label, displayAs, getPConnect, value, testId, helperText, validatemessage, placeholder, showAsFormattedText, additionalProps, hideLabel, readOnly, required, disabled, onChange } = props;
7
+ const UserReference = (props) => {
8
+ // Get emitted components from map (so we can get any override that may exist)
9
+ const AutoComplete = getComponentFromMap('AutoComplete');
10
+ const Dropdown = getComponentFromMap('Dropdown');
11
+ const { label = '', displayAs = '', getPConnect, value = '', testId = '', helperText = '', validatemessage = '', placeholder = '', showAsFormattedText = false, additionalProps = {}, hideLabel = false, readOnly = false, required = false, disabled = false, onChange,
12
+ // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
13
+ variant = 'inline' } = props;
11
14
  const [dropDownDataSource, setDropDownDataSource] = useState([]);
12
15
  const [userName, setUserName] = useState('');
13
16
  const OPERATORS_DP = PCore.getEnvironmentInfo().getDefaultOperatorDP();
@@ -21,7 +24,7 @@ const UserReference = props => {
21
24
  // if same user ref field is referred in view as editable & readonly formatted text
22
25
  // referenced users won't be available, so get user details from dx api
23
26
  const { getOperatorDetails } = PCore.getUserApi();
24
- getOperatorDetails(userId).then(res => {
27
+ getOperatorDetails(userId).then((res) => {
25
28
  if (res.data && res.data.pyOperatorInfo && res.data.pyOperatorInfo.pyUserName) {
26
29
  setUserName(res.data.pyOperatorInfo.pyUserName);
27
30
  }
@@ -34,14 +37,14 @@ const UserReference = props => {
34
37
  };
35
38
  PCore.getRestClient()
36
39
  .invokeRestApi('getListData', { queryPayload })
37
- .then(res => {
38
- const ddDataSource = res.data.data.map(listItem => ({
40
+ .then((res) => {
41
+ const ddDataSource = res.data.data.map((listItem) => ({
39
42
  key: listItem.pyUserIdentifier,
40
43
  value: listItem.pyUserName
41
44
  }));
42
45
  setDropDownDataSource(ddDataSource);
43
46
  })
44
- .catch(err => {
47
+ .catch((err) => {
45
48
  // eslint-disable-next-line no-console
46
49
  console.error(err);
47
50
  });
@@ -52,8 +55,8 @@ const UserReference = props => {
52
55
  if (userId) {
53
56
  userReferenceComponent = (React.createElement(Fragment, null,
54
57
  React.createElement("div", null,
55
- React.createElement(Typography, { variant: 'caption' }, label),
56
- React.createElement(Typography, { variant: 'body1' }, userName))));
58
+ React.createElement(Typography, { variant: "caption" }, label),
59
+ React.createElement(Typography, { variant: "body1" }, userName))));
57
60
  }
58
61
  }
59
62
  else {
@@ -74,46 +77,14 @@ const UserReference = props => {
74
77
  useForSearch: 'true'
75
78
  }
76
79
  ];
77
- userReferenceComponent = (React.createElement(AutoComplete, { additionalProps: additionalProps, label: label, getPConnect: getPConnect, datasource: OPERATORS_DP, listType: 'datapage', columns: columns, testId: testId, placeholder: placeholder, readOnly: readOnly, disabled: disabled, required: required, helperText: helperText, validatemessage: validatemessage, value: userId, hideLabel: hideLabel, onChange: onChange }));
80
+ userReferenceComponent = (React.createElement(AutoComplete, { additionalProps: additionalProps, label: label, getPConnect: getPConnect, datasource: OPERATORS_DP, listType: "datapage", columns: columns, testId: testId, placeholder: placeholder, readOnly: readOnly, disabled: disabled, required: required, helperText: helperText, validatemessage: validatemessage, value: userId, hideLabel: hideLabel, onChange: onChange }));
78
81
  }
79
82
  if (displayAs === DROPDOWN_LIST) {
80
- userReferenceComponent = (React.createElement(Dropdown, { additionalProps: additionalProps, datasource: dropDownDataSource, listType: 'associated', getPConnect: getPConnect, label: label, value: userId, testId: testId, placeholder: placeholder, readOnly: readOnly, disabled: disabled, required: required, helperText: helperText, validatemessage: validatemessage, hideLabel: hideLabel, onChange: onChange }));
83
+ userReferenceComponent = (React.createElement(Dropdown, { additionalProps: additionalProps, datasource: dropDownDataSource, listType: "associated", getPConnect: getPConnect, label: label, value: userId, testId: testId, placeholder: placeholder, readOnly: readOnly, disabled: disabled, required: required, helperText: helperText, validatemessage: validatemessage, hideLabel: hideLabel, onChange: onChange }));
81
84
  }
82
85
  }
83
86
  return userReferenceComponent;
84
87
  };
85
- UserReference.propTypes = {
86
- getPConnect: PropTypes.func.isRequired,
87
- displayAs: PropTypes.string,
88
- label: PropTypes.string,
89
- value: PropTypes.oneOfType([PropTypes.string, PropTypes.objectOf(PropTypes.any)]),
90
- testId: PropTypes.string,
91
- placeholder: PropTypes.string,
92
- helperText: PropTypes.string,
93
- disabled: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
94
- readOnly: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
95
- required: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
96
- validatemessage: PropTypes.string,
97
- showAsFormattedText: PropTypes.bool,
98
- additionalProps: PropTypes.objectOf(PropTypes.any),
99
- hideLabel: PropTypes.bool
100
- };
101
- UserReference.defaultProps = {
102
- displayAs: null,
103
- label: null,
104
- value: null,
105
- readOnly: false,
106
- testId: null,
107
- placeholder: null,
108
- helperText: null,
109
- disabled: false,
110
- required: false,
111
- validatemessage: null,
112
- showAsFormattedText: false,
113
- additionalProps: {},
114
- variant: 'inline',
115
- hideLabel: false
116
- };
117
88
  // as objects are there in props, shallow comparision fails & re-rendering of comp happens even with
118
89
  // same key value pairs in obj. hence using custom comparison function on when to re-render
119
90
  const comparisonFn = (prevProps, nextProps) => {
@@ -1 +1 @@
1
- {"version":3,"file":"UserReference.js","sourceRoot":"","sources":["../../../../src/components/field/UserReference/UserReference.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAGtE,MAAM,aAAa,GAAG,gBAAgB,CAAC;AACvC,MAAM,UAAU,GAAG,YAAY,CAAC;AAEhC,MAAM,aAAa,GAAG,KAAK,CAAC,EAAE;IAC5B,MAAM,EACJ,KAAK,EACL,SAAS,EACT,WAAW,EACX,KAAK,EACL,MAAM,EACN,UAAU,EACV,eAAe,EACf,WAAW,EACX,mBAAmB,EACnB,eAAe,EACf,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACT,GAAG,KAAK,CAAC;IACV,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACjE,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC7C,MAAM,YAAY,GAAG,KAAK,CAAC,kBAAkB,EAAE,CAAC,oBAAoB,EAAE,CAAC;IACvE,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IAEhC,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,MAAM,IAAI,QAAQ,IAAI,mBAAmB,EAAE;YAC7C,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G,CAAC;IAClD,SAAS,EAAE,SAAS,CAAC,IAAI;CAC1B,CAAC;AAEF,aAAa,CAAC,YAAY,GAAG;IAC3B,SAAS,EAAE,IAAI;IACf,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;IACX,QAAQ,EAAE,KAAK;IACf,MAAM,EAAE,IAAI;IACZ,WAAW,EAAE,IAAI;IACjB,UAAU,EAAE,IAAI;IAChB,QAAQ,EAAE,KAAK;IACf,QAAQ,EAAE,KAAK;IACf,eAAe,EAAE,IAAI;IACrB,mBAAmB,EAAE,KAAK;IAC1B,eAAe,EAAE,EAAE;IACnB,OAAO,EAAE,QAAQ;IACjB,SAAS,EAAE,KAAK;CACjB,CAAC;AAEF,oGAAoG;AACpG,2FAA2F;AAC3F,MAAM,YAAY,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE;IAC5C,OAAO,CACL,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC;QACzD,SAAS,CAAC,eAAe,KAAK,SAAS,CAAC,eAAe;QACvD,SAAS,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ;QACzC,SAAS,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ;QACzC,SAAS,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ,CAC1C,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC","sourcesContent":["import React, { Fragment, memo, useEffect, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { Typography } from '@material-ui/core';\nimport AutoComplete from '../AutoComplete';\nimport Dropdown from '../Dropdown';\nimport { getUserId, isUserNameAvailable } from './UserReferenceUtils';\n\ndeclare const PCore: any;\nconst DROPDOWN_LIST = 'Drop-down list';\nconst SEARCH_BOX = 'Search box';\n\nconst UserReference = props => {\n const {\n label,\n displayAs,\n getPConnect,\n value,\n testId,\n helperText,\n validatemessage,\n placeholder,\n showAsFormattedText,\n additionalProps,\n hideLabel,\n readOnly,\n required,\n disabled,\n onChange\n } = props;\n const [dropDownDataSource, setDropDownDataSource] = useState([]);\n const [userName, setUserName] = useState('');\n const OPERATORS_DP = PCore.getEnvironmentInfo().getDefaultOperatorDP();\n const userId = getUserId(value);\n\n useEffect(() => {\n if (userId && readOnly && showAsFormattedText) {\n if (isUserNameAvailable(value)) {\n setUserName(value.userName);\n } else {\n // if same user ref field is referred in view as editable & readonly formatted text\n // referenced users won't be available, so get user details from dx api\n const { getOperatorDetails } = PCore.getUserApi();\n getOperatorDetails(userId).then(res => {\n if (res.data && res.data.pyOperatorInfo && res.data.pyOperatorInfo.pyUserName) {\n setUserName(res.data.pyOperatorInfo.pyUserName);\n }\n });\n }\n } else if (displayAs === DROPDOWN_LIST) {\n const queryPayload = {\n dataViewName: OPERATORS_DP\n };\n PCore.getRestClient()\n .invokeRestApi('getListData', { queryPayload })\n .then(res => {\n const ddDataSource = res.data.data.map(listItem => ({\n key: listItem.pyUserIdentifier,\n value: listItem.pyUserName\n }));\n setDropDownDataSource(ddDataSource);\n })\n .catch(err => {\n // eslint-disable-next-line no-console\n console.error(err);\n });\n }\n }, [displayAs, readOnly, showAsFormattedText, value]);\n\n let userReferenceComponent: any = null;\n\n if (readOnly && showAsFormattedText) {\n if (userId) {\n userReferenceComponent = (\n <Fragment>\n {/*\n TODO: This has to be replaced with Operator Component\n */}\n <div>\n <Typography variant='caption'>{label}</Typography>\n <Typography variant='body1'>{userName}</Typography>\n </div>\n </Fragment>\n );\n }\n } else {\n if (displayAs === SEARCH_BOX) {\n const columns = [\n {\n value: 'pyUserName',\n display: 'true',\n useForSearch: true,\n primary: 'true'\n },\n {\n value: 'pyUserIdentifier',\n setProperty: 'Associated property',\n key: 'true',\n display: 'true',\n secondary: 'true',\n useForSearch: 'true'\n }\n ];\n\n userReferenceComponent = (\n <AutoComplete\n additionalProps={additionalProps}\n label={label}\n getPConnect={getPConnect}\n datasource={OPERATORS_DP}\n listType='datapage'\n columns={columns}\n testId={testId}\n placeholder={placeholder}\n readOnly={readOnly}\n disabled={disabled}\n required={required}\n helperText={helperText}\n validatemessage={validatemessage}\n value={userId}\n hideLabel={hideLabel}\n onChange={onChange}\n />\n );\n }\n if (displayAs === DROPDOWN_LIST) {\n userReferenceComponent = (\n <Dropdown\n additionalProps={additionalProps}\n datasource={dropDownDataSource}\n listType='associated'\n getPConnect={getPConnect}\n label={label}\n value={userId}\n testId={testId}\n placeholder={placeholder}\n readOnly={readOnly}\n disabled={disabled}\n required={required}\n helperText={helperText}\n validatemessage={validatemessage}\n hideLabel={hideLabel}\n onChange={onChange}\n />\n );\n }\n }\n\n return userReferenceComponent;\n};\n\nUserReference.propTypes = {\n getPConnect: PropTypes.func.isRequired,\n displayAs: PropTypes.string,\n label: PropTypes.string,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.objectOf(PropTypes.any)]),\n testId: PropTypes.string,\n placeholder: PropTypes.string,\n helperText: PropTypes.string,\n disabled: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),\n readOnly: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),\n required: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),\n validatemessage: PropTypes.string,\n showAsFormattedText: PropTypes.bool,\n additionalProps: PropTypes.objectOf(PropTypes.any),\n hideLabel: PropTypes.bool\n};\n\nUserReference.defaultProps = {\n displayAs: null,\n label: null,\n value: null,\n readOnly: false,\n testId: null,\n placeholder: null,\n helperText: null,\n disabled: false,\n required: false,\n validatemessage: null,\n showAsFormattedText: false,\n additionalProps: {},\n variant: 'inline',\n hideLabel: false\n};\n\n// as objects are there in props, shallow comparision fails & re-rendering of comp happens even with\n// same key value pairs in obj. hence using custom comparison function on when to re-render\nconst comparisonFn = (prevProps, nextProps) => {\n return (\n getUserId(prevProps.value) === getUserId(nextProps.value) &&\n prevProps.validatemessage === nextProps.validatemessage &&\n prevProps.required === nextProps.required &&\n prevProps.disabled === nextProps.disabled &&\n prevProps.readOnly === nextProps.readOnly\n );\n};\n\nexport default memo(UserReference, comparisonFn);\n"]}
1
+ {"version":3,"file":"UserReference.js","sourceRoot":"","sources":["../../../../src/components/field/UserReference/UserReference.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAMhF,MAAM,aAAa,GAAG,gBAAgB,CAAC;AACvC,MAAM,UAAU,GAAG,YAAY,CAAC;AAqBhC,MAAM,aAAa,GAAG,CAAC,KAAyB,EAAE,EAAE;IAClD,8EAA8E;IAC9E,MAAM,YAAY,GAAG,mBAAmB,CAAC,cAAc,CAAC,CAAC;IACzD,MAAM,QAAQ,GAAG,mBAAmB,CAAC,UAAU,CAAC,CAAC;IAEjD,MAAM,EACJ,KAAK,GAAG,EAAE,EACV,SAAS,GAAG,EAAE,EACd,WAAW,EACX,KAAK,GAAG,EAAE,EACV,MAAM,GAAG,EAAE,EACX,UAAU,GAAG,EAAE,EACf,eAAe,GAAG,EAAE,EACpB,WAAW,GAAG,EAAE,EAChB,mBAAmB,GAAG,KAAK,EAC3B,eAAe,GAAG,EAAE,EACpB,SAAS,GAAG,KAAK,EACjB,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,KAAK,EAChB,QAAQ;IACR,6EAA6E;IAC7E,OAAO,GAAG,QAAQ,EACnB,GAAG,KAAK,CAAC;IACV,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACjE,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,EA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AAU,EAAE,UAAU,EACtB,eAAe,EAAE,eAAe,EAChC,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;SACH;QACD,IAAI,SAAS,KAAK,aAAa,EAAE;YAC/B,sBAAsB,GAAG,CACvB,oBAAC,QAAQ,IACP,eAAe,EAAE,eAAe,EAChC,UAAU,EAAE,kBAAkB,EAC9B,QAAQ,EAAC,YAAY,EACrB,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;SACH;KACF;IAED,OAAO,sBAAsB,CAAC;AAChC,CAAC,CAAC;AAEF,oGAAoG;AACpG,2FAA2F;AAC3F,MAAM,YAAY,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE;IAC5C,OAAO,CACL,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC;QACzD,SAAS,CAAC,eAAe,KAAK,SAAS,CAAC,eAAe;QACvD,SAAS,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ;QACzC,SAAS,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ;QACzC,SAAS,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ,CAC1C,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC","sourcesContent":["import React, { Fragment, memo, useEffect, useState } from 'react';\nimport { Typography } from '@material-ui/core';\nimport { getUserId, isUserNameAvailable } from './UserReferenceUtils';\nimport { getComponentFromMap } from '../../../bridge/helpers/sdk_component_map';\nimport type { PConnProps } from '../../../types/PConnProps';\n\n// Remove this and use \"real\" PCore type once .d.ts is fixed (currently shows 1 errors)\ndeclare const PCore: any;\n\nconst DROPDOWN_LIST = 'Drop-down list';\nconst SEARCH_BOX = 'Search box';\n\ninterface UserReferenceProps extends PConnProps {\n // If any, enter additional props that only exist on URLComponent here\n displayAs?: string;\n label?: string;\n value?: any;\n testId?: string;\n placeholder?: string;\n helperText?: string;\n disabled?: boolean;\n readOnly?: boolean;\n required?: boolean;\n validatemessage?: string;\n showAsFormattedText?: boolean;\n additionalProps?: object;\n hideLabel?: boolean;\n variant?: string;\n onChange?: any;\n}\n\nconst UserReference = (props: UserReferenceProps) => {\n // Get emitted components from map (so we can get any override that may exist)\n const AutoComplete = getComponentFromMap('AutoComplete');\n const Dropdown = getComponentFromMap('Dropdown');\n\n const {\n label = '',\n displayAs = '',\n getPConnect,\n value = '',\n testId = '',\n helperText = '',\n validatemessage = '',\n placeholder = '',\n showAsFormattedText = false,\n additionalProps = {},\n hideLabel = false,\n readOnly = false,\n required = false,\n disabled = false,\n onChange,\n // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\n variant = 'inline'\n } = props;\n const [dropDownDataSource, setDropDownDataSource] = useState([]);\n const [userName, setUserName] = useState('');\n const OPERATORS_DP = PCore.getEnvironmentInfo().getDefaultOperatorDP();\n const userId = getUserId(value);\n\n useEffect(() => {\n if (userId && readOnly && showAsFormattedText) {\n if (isUserNameAvailable(value)) {\n setUserName(value.userName);\n } else {\n // if same user ref field is referred in view as editable & readonly formatted text\n // referenced users won't be available, so get user details from dx api\n const { getOperatorDetails } = PCore.getUserApi();\n getOperatorDetails(userId).then((res) => {\n if (res.data && res.data.pyOperatorInfo && res.data.pyOperatorInfo.pyUserName) {\n setUserName(res.data.pyOperatorInfo.pyUserName);\n }\n });\n }\n } else if (displayAs === DROPDOWN_LIST) {\n const queryPayload = {\n dataViewName: OPERATORS_DP\n };\n PCore.getRestClient()\n .invokeRestApi('getListData', { queryPayload })\n .then((res) => {\n const ddDataSource = res.data.data.map((listItem) => ({\n key: listItem.pyUserIdentifier,\n value: listItem.pyUserName\n }));\n setDropDownDataSource(ddDataSource);\n })\n .catch((err) => {\n // eslint-disable-next-line no-console\n console.error(err);\n });\n }\n }, [displayAs, readOnly, showAsFormattedText, value]);\n\n let userReferenceComponent: any = null;\n\n if (readOnly && showAsFormattedText) {\n if (userId) {\n userReferenceComponent = (\n <Fragment>\n {/*\n TODO: This has to be replaced with Operator Component\n */}\n <div>\n <Typography variant=\"caption\">{label}</Typography>\n <Typography variant=\"body1\">{userName}</Typography>\n </div>\n </Fragment>\n );\n }\n } else {\n if (displayAs === SEARCH_BOX) {\n const columns = [\n {\n value: 'pyUserName',\n display: 'true',\n useForSearch: true,\n primary: 'true'\n },\n {\n value: 'pyUserIdentifier',\n setProperty: 'Associated property',\n key: 'true',\n display: 'true',\n secondary: 'true',\n useForSearch: 'true'\n }\n ];\n\n userReferenceComponent = (\n <AutoComplete\n additionalProps={additionalProps}\n label={label}\n getPConnect={getPConnect}\n datasource={OPERATORS_DP}\n listType=\"datapage\"\n columns={columns}\n testId={testId}\n placeholder={placeholder}\n readOnly={readOnly}\n disabled={disabled}\n required={required}\n helperText={helperText}\n validatemessage={validatemessage}\n value={userId}\n hideLabel={hideLabel}\n onChange={onChange}\n />\n );\n }\n if (displayAs === DROPDOWN_LIST) {\n userReferenceComponent = (\n <Dropdown\n additionalProps={additionalProps}\n datasource={dropDownDataSource}\n listType=\"associated\"\n getPConnect={getPConnect}\n label={label}\n value={userId}\n testId={testId}\n placeholder={placeholder}\n readOnly={readOnly}\n disabled={disabled}\n required={required}\n helperText={helperText}\n validatemessage={validatemessage}\n hideLabel={hideLabel}\n onChange={onChange}\n />\n );\n }\n }\n\n return userReferenceComponent;\n};\n\n// as objects are there in props, shallow comparision fails & re-rendering of comp happens even with\n// same key value pairs in obj. hence using custom comparison function on when to re-render\nconst comparisonFn = (prevProps, nextProps) => {\n return (\n getUserId(prevProps.value) === getUserId(nextProps.value) &&\n prevProps.validatemessage === nextProps.validatemessage &&\n prevProps.required === nextProps.required &&\n prevProps.disabled === nextProps.disabled &&\n prevProps.readOnly === nextProps.readOnly\n );\n};\n\nexport default memo(UserReference, comparisonFn);\n"]}
@@ -1,11 +1,11 @@
1
- export function validateMaxSize(fileObj: any, maxSizeInMB: any): boolean;
2
- export function fileDownload(data: any, fileName: any, ext: any): void;
3
- export function getIconFromFileType(fileType: any): string;
4
- export function getIconForAttachment(attachment: any): any;
5
- export function buildFilePropsFromResponse(respObj: any): {
1
+ export declare const validateMaxSize: (fileObj: any, maxSizeInMB: string) => boolean;
2
+ export declare const fileDownload: (data: any, fileName: any, ext: any) => void;
3
+ export declare const getIconFromFileType: (fileType: any) => string;
4
+ export declare const getIconForAttachment: (inThis: any, attachment: any) => string;
5
+ export declare const buildFilePropsFromResponse: (respObj: any) => {
6
6
  props: {
7
7
  meta: string;
8
- name: any;
8
+ name: string;
9
9
  icon: string;
10
10
  };
11
11
  responseProps: any;
@@ -1 +1 @@
1
- {"version":3,"file":"attachmentHelpers.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/attachmentHelpers.js"],"names":[],"mappings":"AAEO,yEAGN;AAEM,uEAQN;AAEM,2DAyBN;AAEM,2DAaN;AAEM;;;;;;;EAWN"}
1
+ {"version":3,"file":"attachmentHelpers.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/attachmentHelpers.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,YAAa,GAAG,eAAe,MAAM,KAAG,OAGnE,CAAC;AAEF,eAAO,MAAM,YAAY,8CAQxB,CAAC;AAEF,eAAO,MAAM,mBAAmB,qBAAe,MAyB9C,CAAC;AAEF,eAAO,MAAM,oBAAoB,WAAW,GAAG,cAAc,GAAG,KAAG,MAalE,CAAC;AAEF,eAAO,MAAM,0BAA0B,oBAAc;IAAE,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC;IAAC,aAAa,EAAE,GAAG,CAAA;CAW5H,CAAC"}
@@ -43,11 +43,11 @@ export const getIconFromFileType = (fileType) => {
43
43
  }
44
44
  return icon;
45
45
  };
46
- export const getIconForAttachment = (attachment) => {
46
+ export const getIconForAttachment = (inThis, attachment) => {
47
47
  let icon;
48
48
  switch (attachment.type) {
49
49
  case "FILE":
50
- icon = this.getIconFromFileType(attachment.mimeType);
50
+ icon = inThis.getIconFromFileType(attachment.mimeType);
51
51
  break;
52
52
  case "URL":
53
53
  icon = "chain";
@@ -1 +1 @@
1
- {"version":3,"file":"attachmentHelpers.js","sourceRoot":"","sources":["../../../src/components/helpers/attachmentHelpers.js"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,WAAW,EAAE,EAAE;IACtD,MAAM,QAAQ,GAAG,CAAC,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACrD,OAAO,UAAU,CAAC,QAAQ,CAAC,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;AACxD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE;IAClD,MAAM,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,QAAQ,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;IACnD,2DAA2D;IAC3D,IAAI,GAAG,KAAK,MAAM,EAAE;QAClB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;KACnC;SAAM;QACL,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;KAC5B;AACH,CAAC,CAAC;AAEF,M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IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;YACrD,MAAM;QACR,KAAK,KAAK;YACR,IAAI,GAAG,OAAO,CAAC;YACf,MAAM;QACR;YACE,IAAI,GAAG,cAAc,CAAC;KACzB;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,OAAO,EAAE,EAAE;IACpD,OAAO;QACL,KAAK,EAAE;YACL,IAAI,EAAE,GAAG,OAAO,CAAC,cAAc,KAAK,OAAO,CAAC,gBAAgB,EAAE;YAC9D,IAAI,EAAE,OAAO,CAAC,YAAY;YAC1B,IAAI,EAAE,mBAAmB,CAAC,OAAO,CAAC,mBAAmB,CAAC;SACvD;QACD,aAAa,EAAE;YACb,GAAG,OAAO;SACX;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import download from 'downloadjs';\n\nexport const validateMaxSize = (fileObj, maxSizeInMB) => {\n const fileSize = (fileObj.size / 1048576).toFixed(2);\n return parseFloat(fileSize) < parseFloat(maxSizeInMB);\n};\n\nexport const fileDownload = (data, fileName, ext) => {\n const name = ext ? `${fileName}.${ext}` : fileName;\n // Temp fix: downloading EMAIl type attachment as html file\n if (ext === 'html') {\n download(data, name, 'text/html');\n } else {\n download(atob(data), name);\n }\n};\n\nexport const getIconFromFileType = (fileType) => {\n let icon = 'document-doc';\n if (!fileType) return icon;\n if (fileType.startsWith('audio')) {\n icon = 'audio';\n } else if (fileType.startsWith('video')) {\n icon = 'video';\n } else if (fileType.startsWith('image')) {\n icon = 'picture';\n } else if (fileType.includes('pdf')) {\n icon = 'document-pdf';\n } else {\n const [, subtype] = fileType.split('/');\n const foundMatch = (sources) => {\n return sources.some((key) => subtype.includes(key));\n };\n\n if (foundMatch(['excel', 'spreadsheet'])) {\n icon = 'document-xls';\n } else if (foundMatch(['zip', 'compressed', 'gzip', 'rar', 'tar'])) {\n icon = 'document-compress';\n }\n }\n\n return icon;\n};\n\nexport const getIconForAttachment = (attachment) => {\n let icon;\n switch (attachment.type) {\n case \"FILE\":\n icon = this.getIconFromFileType(attachment.mimeType);\n break;\n case \"URL\":\n icon = \"chain\";\n break;\n default:\n icon = \"document-doc\";\n }\n return icon;\n};\n\nexport const buildFilePropsFromResponse = (respObj) => {\n return {\n props: {\n meta: `${respObj.pyCategoryName}, ${respObj.pxCreateOperator}`,\n name: respObj.pyAttachName,\n icon: getIconFromFileType(respObj.pyMimeFileExtension)\n },\n responseProps: {\n ...respObj\n }\n };\n};\n"]}
1
+ {"version":3,"file":"attachmentHelpers.js","sourceRoot":"","sources":["../../../src/components/helpers/attachmentHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAY,EAAE,WAAmB,EAAW,EAAE;IAC5E,MAAM,QAAQ,GAAG,CAAC,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACrD,OAAO,UAAU,CAAC,QAAQ,CAAC,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;AACxD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE;IAClD,MAAM,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,QAAQ,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;IACnD,2DAA2D;IAC3D,IAAI,GAAG,KAAK,MAAM,EAAE;QAClB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;KACnC;SAAM;QACL,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;KAC5B;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,QAAQ,EAAU,EAAE;IACtD,IAAI,IAAI,GAAG,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;QACR,KAAK,KAAK;YACR,IAAI,GAAG,OAAO,CAAC;YACf,MAAM;QACR;YACE,IAAI,GAAG,cAAc,CAAC;KACzB;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,OAAO,EAA6E,EAAE;IAC/H,OAAO;QACL,KAAK,EAAE;YACL,IAAI,EAAE,GAAG,OAAO,CAAC,cAAc,KAAK,OAAO,CAAC,gBAAgB,EAAE;YAC9D,IAAI,EAAE,OAAO,CAAC,YAAY;YAC1B,IAAI,EAAE,mBAAmB,CAAC,OAAO,CAAC,mBAAmB,CAAC;SACvD;QACD,aAAa,EAAE;YACb,GAAG,OAAO;SACX;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import download from 'downloadjs';\n\nexport const validateMaxSize = (fileObj: any, maxSizeInMB: string): boolean => {\n const fileSize = (fileObj.size / 1048576).toFixed(2);\n return parseFloat(fileSize) < parseFloat(maxSizeInMB);\n};\n\nexport const fileDownload = (data, fileName, ext) => {\n const name = ext ? `${fileName}.${ext}` : fileName;\n // Temp fix: downloading EMAIl type attachment as html file\n if (ext === 'html') {\n download(data, name, 'text/html');\n } else {\n download(atob(data), name);\n }\n};\n\nexport const getIconFromFileType = (fileType): string => {\n let icon = 'document-doc';\n if (!fileType) return icon;\n if (fileType.startsWith('audio')) {\n icon = 'audio';\n } else if (fileType.startsWith('video')) {\n icon = 'video';\n } else if (fileType.startsWith('image')) {\n icon = 'picture';\n } else if (fileType.includes('pdf')) {\n icon = 'document-pdf';\n } else {\n const [, subtype] = fileType.split('/');\n const foundMatch = (sources) => {\n return sources.some((key) => subtype.includes(key));\n };\n\n if (foundMatch(['excel', 'spreadsheet'])) {\n icon = 'document-xls';\n } else if (foundMatch(['zip', 'compressed', 'gzip', 'rar', 'tar'])) {\n icon = 'document-compress';\n }\n }\n\n return icon;\n};\n\nexport const getIconForAttachment = (inThis:any , attachment:any): string => {\n let icon;\n switch (attachment.type) {\n case \"FILE\":\n icon = inThis.getIconFromFileType(attachment.mimeType);\n break;\n case \"URL\":\n icon = \"chain\";\n break;\n default:\n icon = \"document-doc\";\n }\n return icon;\n};\n\nexport const buildFilePropsFromResponse = (respObj): { props: { meta: string, name: string, icon: string}, responseProps: any} => {\n return {\n props: {\n meta: `${respObj.pyCategoryName}, ${respObj.pxCreateOperator}`,\n name: respObj.pyAttachName,\n icon: getIconFromFileType(respObj.pyMimeFileExtension)\n },\n responseProps: {\n ...respObj\n }\n };\n};\n"]}
@@ -1,16 +1,18 @@
1
1
  export default PegaAuth;
2
2
  declare class PegaAuth {
3
- constructor(ssKeyConfig: any);
4
- ssKeyConfig: any;
5
- bEncodeSI: boolean;
6
- reloadConfig(): void;
7
- config: {} | null | undefined;
3
+ constructor(ssKeyConfig: any, ssKeyDynState: any);
4
+ ssKeyConfig: string | undefined;
5
+ ssKeyDynState: any;
6
+ urlencoded: string;
7
+ isNode: boolean;
8
+ crypto: Crypto | undefined;
9
+ subtle: SubtleCrypto | undefined;
8
10
  login(): Promise<any>;
9
11
  loginRedirect(): void;
12
+ checkStateMatch(state: any): boolean;
10
13
  getToken(authCode: any): Promise<any>;
11
14
  refreshToken(refresh_token: any): Promise<any>;
12
15
  revokeTokens(access_token: any, refresh_token?: null): Promise<void>;
13
- getUserinfo(access_token: any): Promise<any>;
14
16
  #private;
15
17
  }
16
18
  //# sourceMappingURL=auth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/auth.js"],"names":[],"mappings":";AAAA;IAEE,8BAIC;IAHG,iBAA8B;IAC9B,mBAAsB;IAI1B,qBAgBC;IADG,8BAAmC;IAgDvC,sBA2LC;IAGD,sBAOC;IAID,sCAoDC;IAGD,+CAqCC;IAED,qEA4CC;IAID,6CAwBC;;CA0CF"}
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/auth.js"],"names":[],"mappings":";AAAA;IAUE,kDAyBC;IAvBG,gCAA8B;IAC9B,mBAAyD;IAO3D,mBAAqD;IACrD,gBAA2C;IAIzC,2BAA2B;IAC3B,iCAAkC;IAuKtC,sBAgBC;IA0TD,sBAOC;IAGD,qCAEC;IAcD,sCAkHC;IAGD,+CAgDC;IAED,qEAgDC;;CAmEF"}