@pega/react-sdk-components 0.24.4 → 0.25.2

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 (544) hide show
  1. package/lib/bridge/Context/StoreContext.d.ts +0 -1
  2. package/lib/bridge/Context/StoreContext.d.ts.map +1 -1
  3. package/lib/bridge/Context/StoreContext.js.map +1 -1
  4. package/lib/bridge/helpers/sdk_component_map.js.map +1 -1
  5. package/lib/bridge/react_pconnect.d.ts.map +1 -1
  6. package/lib/bridge/react_pconnect.js +2 -2
  7. package/lib/bridge/react_pconnect.js.map +1 -1
  8. package/lib/components/designSystemExtension/AlertBanner/AlertBanner.js +1 -1
  9. package/lib/components/designSystemExtension/AlertBanner/AlertBanner.js.map +1 -1
  10. package/lib/components/designSystemExtension/Banner/Banner.js +1 -1
  11. package/lib/components/designSystemExtension/Banner/Banner.js.map +1 -1
  12. package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -2
  13. package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.d.ts.map +1 -1
  14. package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.js +51 -33
  15. package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.js.map +1 -1
  16. package/lib/components/designSystemExtension/DetailsFields/DetailsFields.js +4 -4
  17. package/lib/components/designSystemExtension/DetailsFields/DetailsFields.js.map +1 -1
  18. package/lib/components/designSystemExtension/FieldGroup/FieldGroup.d.ts +1 -1
  19. package/lib/components/designSystemExtension/FieldGroup/FieldGroup.d.ts.map +1 -1
  20. package/lib/components/designSystemExtension/FieldGroup/FieldGroup.js +4 -4
  21. package/lib/components/designSystemExtension/FieldGroup/FieldGroup.js.map +1 -1
  22. package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.js +4 -4
  23. package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.js.map +1 -1
  24. package/lib/components/designSystemExtension/FieldValueList/FieldValueList.js +6 -6
  25. package/lib/components/designSystemExtension/FieldValueList/FieldValueList.js.map +1 -1
  26. package/lib/components/designSystemExtension/Operator/Operator.d.ts +1 -1
  27. package/lib/components/designSystemExtension/Operator/Operator.d.ts.map +1 -1
  28. package/lib/components/designSystemExtension/Operator/Operator.js +14 -10
  29. package/lib/components/designSystemExtension/Operator/Operator.js.map +1 -1
  30. package/lib/components/designSystemExtension/Pulse/Pulse.d.ts +1 -1
  31. package/lib/components/designSystemExtension/Pulse/Pulse.d.ts.map +1 -1
  32. package/lib/components/designSystemExtension/Pulse/Pulse.js +2 -2
  33. package/lib/components/designSystemExtension/Pulse/Pulse.js.map +1 -1
  34. package/lib/components/designSystemExtension/RichTextEditor/RichTextEditor.d.ts.map +1 -1
  35. package/lib/components/designSystemExtension/RichTextEditor/RichTextEditor.js +4 -3
  36. package/lib/components/designSystemExtension/RichTextEditor/RichTextEditor.js.map +1 -1
  37. package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.js +1 -1
  38. package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.js.map +1 -1
  39. package/lib/components/field/AutoComplete/AutoComplete.d.ts +1 -1
  40. package/lib/components/field/AutoComplete/AutoComplete.d.ts.map +1 -1
  41. package/lib/components/field/AutoComplete/AutoComplete.js +4 -4
  42. package/lib/components/field/AutoComplete/AutoComplete.js.map +1 -1
  43. package/lib/components/field/CancelAlert/CancelAlert.d.ts +1 -1
  44. package/lib/components/field/CancelAlert/CancelAlert.d.ts.map +1 -1
  45. package/lib/components/field/CancelAlert/CancelAlert.js +4 -7
  46. package/lib/components/field/CancelAlert/CancelAlert.js.map +1 -1
  47. package/lib/components/field/Checkbox/Checkbox.d.ts +1 -1
  48. package/lib/components/field/Checkbox/Checkbox.d.ts.map +1 -1
  49. package/lib/components/field/Checkbox/Checkbox.js +4 -4
  50. package/lib/components/field/Checkbox/Checkbox.js.map +1 -1
  51. package/lib/components/field/Currency/Currency.d.ts +1 -1
  52. package/lib/components/field/Currency/Currency.d.ts.map +1 -1
  53. package/lib/components/field/Currency/Currency.js +10 -9
  54. package/lib/components/field/Currency/Currency.js.map +1 -1
  55. package/lib/components/field/Currency/currency-utils.d.ts.map +1 -1
  56. package/lib/components/field/Currency/currency-utils.js.map +1 -1
  57. package/lib/components/field/Date/Date.d.ts +1 -1
  58. package/lib/components/field/Date/Date.d.ts.map +1 -1
  59. package/lib/components/field/Date/Date.js +22 -13
  60. package/lib/components/field/Date/Date.js.map +1 -1
  61. package/lib/components/field/DateTime/DateTime.d.ts +1 -1
  62. package/lib/components/field/DateTime/DateTime.d.ts.map +1 -1
  63. package/lib/components/field/DateTime/DateTime.js +35 -9
  64. package/lib/components/field/DateTime/DateTime.js.map +1 -1
  65. package/lib/components/field/Decimal/Decimal.d.ts +1 -1
  66. package/lib/components/field/Decimal/Decimal.d.ts.map +1 -1
  67. package/lib/components/field/Decimal/Decimal.js +9 -8
  68. package/lib/components/field/Decimal/Decimal.js.map +1 -1
  69. package/lib/components/field/Dropdown/Dropdown.d.ts +1 -1
  70. package/lib/components/field/Dropdown/Dropdown.d.ts.map +1 -1
  71. package/lib/components/field/Dropdown/Dropdown.js +22 -15
  72. package/lib/components/field/Dropdown/Dropdown.js.map +1 -1
  73. package/lib/components/field/Email/Email.d.ts +1 -1
  74. package/lib/components/field/Email/Email.d.ts.map +1 -1
  75. package/lib/components/field/Email/Email.js +26 -11
  76. package/lib/components/field/Email/Email.js.map +1 -1
  77. package/lib/components/field/Group/Group.d.ts +2 -2
  78. package/lib/components/field/Group/Group.d.ts.map +1 -1
  79. package/lib/components/field/Group/Group.js +2 -2
  80. package/lib/components/field/Group/Group.js.map +1 -1
  81. package/lib/components/field/Integer/Integer.d.ts +1 -1
  82. package/lib/components/field/Integer/Integer.d.ts.map +1 -1
  83. package/lib/components/field/Integer/Integer.js +20 -10
  84. package/lib/components/field/Integer/Integer.js.map +1 -1
  85. package/lib/components/field/Multiselect/Multiselect.d.ts.map +1 -1
  86. package/lib/components/field/Multiselect/Multiselect.js +12 -8
  87. package/lib/components/field/Multiselect/Multiselect.js.map +1 -1
  88. package/lib/components/field/Multiselect/utils.d.ts +2 -1
  89. package/lib/components/field/Multiselect/utils.d.ts.map +1 -1
  90. package/lib/components/field/Multiselect/utils.js +1 -1
  91. package/lib/components/field/Multiselect/utils.js.map +1 -1
  92. package/lib/components/field/Percentage/Percentage.d.ts +1 -1
  93. package/lib/components/field/Percentage/Percentage.d.ts.map +1 -1
  94. package/lib/components/field/Percentage/Percentage.js +9 -9
  95. package/lib/components/field/Percentage/Percentage.js.map +1 -1
  96. package/lib/components/field/Phone/Phone.d.ts +1 -1
  97. package/lib/components/field/Phone/Phone.d.ts.map +1 -1
  98. package/lib/components/field/Phone/Phone.js +8 -6
  99. package/lib/components/field/Phone/Phone.js.map +1 -1
  100. package/lib/components/field/RadioButtons/RadioButtons.d.ts +1 -1
  101. package/lib/components/field/RadioButtons/RadioButtons.d.ts.map +1 -1
  102. package/lib/components/field/RadioButtons/RadioButtons.js +6 -12
  103. package/lib/components/field/RadioButtons/RadioButtons.js.map +1 -1
  104. package/lib/components/field/RichText/RichText.d.ts +1 -1
  105. package/lib/components/field/RichText/RichText.d.ts.map +1 -1
  106. package/lib/components/field/RichText/RichText.js +1 -1
  107. package/lib/components/field/RichText/RichText.js.map +1 -1
  108. package/lib/components/field/ScalarList/ScalarList.d.ts +1 -1
  109. package/lib/components/field/ScalarList/ScalarList.d.ts.map +1 -1
  110. package/lib/components/field/ScalarList/ScalarList.js +5 -5
  111. package/lib/components/field/ScalarList/ScalarList.js.map +1 -1
  112. package/lib/components/field/SemanticLink/SemanticLink.d.ts +1 -1
  113. package/lib/components/field/SemanticLink/SemanticLink.d.ts.map +1 -1
  114. package/lib/components/field/SemanticLink/SemanticLink.js +4 -4
  115. package/lib/components/field/SemanticLink/SemanticLink.js.map +1 -1
  116. package/lib/components/field/SemanticLink/utils.js.map +1 -1
  117. package/lib/components/field/TextArea/TextArea.d.ts +1 -1
  118. package/lib/components/field/TextArea/TextArea.d.ts.map +1 -1
  119. package/lib/components/field/TextArea/TextArea.js +23 -8
  120. package/lib/components/field/TextArea/TextArea.js.map +1 -1
  121. package/lib/components/field/TextContent/TextContent.d.ts +1 -1
  122. package/lib/components/field/TextContent/TextContent.d.ts.map +1 -1
  123. package/lib/components/field/TextContent/TextContent.js +1 -1
  124. package/lib/components/field/TextContent/TextContent.js.map +1 -1
  125. package/lib/components/field/TextInput/TextInput.d.ts +1 -1
  126. package/lib/components/field/TextInput/TextInput.d.ts.map +1 -1
  127. package/lib/components/field/TextInput/TextInput.js +6 -7
  128. package/lib/components/field/TextInput/TextInput.js.map +1 -1
  129. package/lib/components/field/Time/Time.d.ts +1 -1
  130. package/lib/components/field/Time/Time.d.ts.map +1 -1
  131. package/lib/components/field/Time/Time.js +32 -12
  132. package/lib/components/field/Time/Time.js.map +1 -1
  133. package/lib/components/field/URL/URL.d.ts +1 -1
  134. package/lib/components/field/URL/URL.d.ts.map +1 -1
  135. package/lib/components/field/URL/URL.js +21 -7
  136. package/lib/components/field/URL/URL.js.map +1 -1
  137. package/lib/components/field/UserReference/UserReference.d.ts +1 -2
  138. package/lib/components/field/UserReference/UserReference.d.ts.map +1 -1
  139. package/lib/components/field/UserReference/UserReference.js +3 -5
  140. package/lib/components/field/UserReference/UserReference.js.map +1 -1
  141. package/lib/components/field/UserReference/UserReferenceUtils.d.ts.map +1 -1
  142. package/lib/components/field/UserReference/UserReferenceUtils.js.map +1 -1
  143. package/lib/components/helpers/attachmentHelpers.d.ts.map +1 -1
  144. package/lib/components/helpers/attachmentHelpers.js.map +1 -1
  145. package/lib/components/helpers/case-utils.js.map +1 -1
  146. package/lib/components/helpers/common-utils.d.ts +7 -0
  147. package/lib/components/helpers/common-utils.d.ts.map +1 -1
  148. package/lib/components/helpers/common-utils.js +21 -1
  149. package/lib/components/helpers/common-utils.js.map +1 -1
  150. package/lib/components/helpers/data_page.d.ts.map +1 -1
  151. package/lib/components/helpers/data_page.js.map +1 -1
  152. package/lib/components/helpers/date-format-utils.d.ts.map +1 -1
  153. package/lib/components/helpers/event-utils.d.ts.map +1 -1
  154. package/lib/components/helpers/event-utils.js.map +1 -1
  155. package/lib/components/helpers/field-group-utils.d.ts +1 -1
  156. package/lib/components/helpers/field-group-utils.d.ts.map +1 -1
  157. package/lib/components/helpers/field-group-utils.js +2 -2
  158. package/lib/components/helpers/field-group-utils.js.map +1 -1
  159. package/lib/components/helpers/formatters/Boolean.js.map +1 -1
  160. package/lib/components/helpers/formatters/Currency.d.ts.map +1 -1
  161. package/lib/components/helpers/formatters/Currency.js +12 -15
  162. package/lib/components/helpers/formatters/Currency.js.map +1 -1
  163. package/lib/components/helpers/formatters/Date.js.map +1 -1
  164. package/lib/components/helpers/formatters/common.d.ts +2 -2
  165. package/lib/components/helpers/formatters/common.d.ts.map +1 -1
  166. package/lib/components/helpers/formatters/common.js +2 -1
  167. package/lib/components/helpers/formatters/common.js.map +1 -1
  168. package/lib/components/helpers/formatters/index.d.ts.map +1 -1
  169. package/lib/components/helpers/formatters/index.js +2 -3
  170. package/lib/components/helpers/formatters/index.js.map +1 -1
  171. package/lib/components/helpers/instructions-utils.d.ts.map +1 -1
  172. package/lib/components/helpers/reactContextHelpers.d.ts +0 -1
  173. package/lib/components/helpers/reactContextHelpers.d.ts.map +1 -1
  174. package/lib/components/helpers/simpleTableHelpers.d.ts +1 -1
  175. package/lib/components/helpers/simpleTableHelpers.d.ts.map +1 -1
  176. package/lib/components/helpers/simpleTableHelpers.js +1 -1
  177. package/lib/components/helpers/simpleTableHelpers.js.map +1 -1
  178. package/lib/components/helpers/state-utils.d.ts.map +1 -1
  179. package/lib/components/helpers/state-utils.js.map +1 -1
  180. package/lib/components/helpers/template-utils.js.map +1 -1
  181. package/lib/components/helpers/utils.js.map +1 -1
  182. package/lib/components/infra/ActionButtons/ActionButtons.js +3 -3
  183. package/lib/components/infra/ActionButtons/ActionButtons.js.map +1 -1
  184. package/lib/components/infra/Assignment/Assignment.d.ts +2 -2
  185. package/lib/components/infra/Assignment/Assignment.d.ts.map +1 -1
  186. package/lib/components/infra/Assignment/Assignment.js +12 -14
  187. package/lib/components/infra/Assignment/Assignment.js.map +1 -1
  188. package/lib/components/infra/AssignmentCard/AssignmentCard.d.ts +2 -2
  189. package/lib/components/infra/AssignmentCard/AssignmentCard.d.ts.map +1 -1
  190. package/lib/components/infra/AssignmentCard/AssignmentCard.js.map +1 -1
  191. package/lib/components/infra/Containers/FlowContainer/FlowContainer.d.ts +1 -2
  192. package/lib/components/infra/Containers/FlowContainer/FlowContainer.d.ts.map +1 -1
  193. package/lib/components/infra/Containers/FlowContainer/FlowContainer.js +12 -22
  194. package/lib/components/infra/Containers/FlowContainer/FlowContainer.js.map +1 -1
  195. package/lib/components/infra/Containers/FlowContainer/helpers.d.ts.map +1 -1
  196. package/lib/components/infra/Containers/FlowContainer/helpers.js +1 -5
  197. package/lib/components/infra/Containers/FlowContainer/helpers.js.map +1 -1
  198. package/lib/components/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.d.ts +1 -1
  199. package/lib/components/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.d.ts.map +1 -1
  200. package/lib/components/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.js +9 -4
  201. package/lib/components/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.js.map +1 -1
  202. package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.d.ts +1 -1
  203. package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.d.ts.map +1 -1
  204. package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.js +7 -7
  205. package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.js.map +1 -1
  206. package/lib/components/infra/Containers/SimpleView/SimpleView.d.ts +0 -1
  207. package/lib/components/infra/Containers/SimpleView/SimpleView.d.ts.map +1 -1
  208. package/lib/components/infra/Containers/SimpleView/helper.d.ts +0 -1
  209. package/lib/components/infra/Containers/SimpleView/helper.d.ts.map +1 -1
  210. package/lib/components/infra/Containers/SimpleView/helper.js +1 -1
  211. package/lib/components/infra/Containers/SimpleView/helper.js.map +1 -1
  212. package/lib/components/infra/Containers/ViewContainer/ViewContainer.d.ts +1 -1
  213. package/lib/components/infra/Containers/ViewContainer/ViewContainer.d.ts.map +1 -1
  214. package/lib/components/infra/Containers/ViewContainer/ViewContainer.js +1 -1
  215. package/lib/components/infra/Containers/ViewContainer/ViewContainer.js.map +1 -1
  216. package/lib/components/infra/Containers/container-helpers.d.ts +2 -0
  217. package/lib/components/infra/Containers/container-helpers.d.ts.map +1 -0
  218. package/lib/components/infra/Containers/{helpers.js → container-helpers.js} +1 -1
  219. package/lib/components/infra/Containers/container-helpers.js.map +1 -0
  220. package/lib/components/infra/DashboardFilter/DashboardFilter.d.ts +2 -2
  221. package/lib/components/infra/DashboardFilter/DashboardFilter.d.ts.map +1 -1
  222. package/lib/components/infra/DashboardFilter/DashboardFilter.js +4 -6
  223. package/lib/components/infra/DashboardFilter/DashboardFilter.js.map +1 -1
  224. package/lib/components/infra/DashboardFilter/filterUtils.d.ts.map +1 -1
  225. package/lib/components/infra/DashboardFilter/filterUtils.js +3 -5
  226. package/lib/components/infra/DashboardFilter/filterUtils.js.map +1 -1
  227. package/lib/components/infra/DeferLoad/DeferLoad.d.ts +2 -1
  228. package/lib/components/infra/DeferLoad/DeferLoad.d.ts.map +1 -1
  229. package/lib/components/infra/DeferLoad/DeferLoad.js +8 -9
  230. package/lib/components/infra/DeferLoad/DeferLoad.js.map +1 -1
  231. package/lib/components/infra/ErrorBoundary/ErrorBoundary.d.ts +1 -1
  232. package/lib/components/infra/ErrorBoundary/ErrorBoundary.d.ts.map +1 -1
  233. package/lib/components/infra/ErrorBoundary/ErrorBoundary.js.map +1 -1
  234. package/lib/components/infra/MultiStep/MultiStep.d.ts +3 -3
  235. package/lib/components/infra/MultiStep/MultiStep.d.ts.map +1 -1
  236. package/lib/components/infra/MultiStep/MultiStep.js +13 -12
  237. package/lib/components/infra/MultiStep/MultiStep.js.map +1 -1
  238. package/lib/components/infra/NavBar/NavBar.css +1 -0
  239. package/lib/components/infra/NavBar/NavBar.d.ts +1 -1
  240. package/lib/components/infra/NavBar/NavBar.d.ts.map +1 -1
  241. package/lib/components/infra/NavBar/NavBar.js +24 -16
  242. package/lib/components/infra/NavBar/NavBar.js.map +1 -1
  243. package/lib/components/infra/Reference/Reference.d.ts +1 -1
  244. package/lib/components/infra/Reference/Reference.d.ts.map +1 -1
  245. package/lib/components/infra/Reference/Reference.js.map +1 -1
  246. package/lib/components/infra/Region/Region.d.ts +1 -1
  247. package/lib/components/infra/Region/Region.d.ts.map +1 -1
  248. package/lib/components/infra/Region/Region.js.map +1 -1
  249. package/lib/components/infra/RootContainer/RootContainer.d.ts +2 -2
  250. package/lib/components/infra/RootContainer/RootContainer.d.ts.map +1 -1
  251. package/lib/components/infra/RootContainer/RootContainer.js +5 -6
  252. package/lib/components/infra/RootContainer/RootContainer.js.map +1 -1
  253. package/lib/components/infra/Stages/Stages.d.ts +1 -1
  254. package/lib/components/infra/Stages/Stages.d.ts.map +1 -1
  255. package/lib/components/infra/Stages/Stages.js +4 -4
  256. package/lib/components/infra/Stages/Stages.js.map +1 -1
  257. package/lib/components/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.d.ts.map +1 -1
  258. package/lib/components/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.js +4 -3
  259. package/lib/components/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.js.map +1 -1
  260. package/lib/components/infra/VerticalTabs/VerticalTabs/VerticalTabs.js +3 -3
  261. package/lib/components/infra/VerticalTabs/VerticalTabs/VerticalTabs.js.map +1 -1
  262. package/lib/components/infra/View/View.d.ts +3 -2
  263. package/lib/components/infra/View/View.d.ts.map +1 -1
  264. package/lib/components/infra/View/View.js +32 -2
  265. package/lib/components/infra/View/View.js.map +1 -1
  266. package/lib/components/template/AdvancedSearch/AdvancedSearch.d.ts +2 -0
  267. package/lib/components/template/AdvancedSearch/AdvancedSearch.d.ts.map +1 -0
  268. package/lib/components/template/AdvancedSearch/AdvancedSearch.js +69 -0
  269. package/lib/components/template/AdvancedSearch/AdvancedSearch.js.map +1 -0
  270. package/lib/components/template/AdvancedSearch/SearchGroup/persistUtils.d.ts +24 -0
  271. package/lib/components/template/AdvancedSearch/SearchGroup/persistUtils.d.ts.map +1 -0
  272. package/lib/components/template/AdvancedSearch/SearchGroup/persistUtils.js +32 -0
  273. package/lib/components/template/AdvancedSearch/SearchGroup/persistUtils.js.map +1 -0
  274. package/lib/components/template/AdvancedSearch/SearchGroups/SearchGroups.d.ts +3 -0
  275. package/lib/components/template/AdvancedSearch/SearchGroups/SearchGroups.d.ts.map +1 -0
  276. package/lib/components/template/AdvancedSearch/SearchGroups/SearchGroups.js +181 -0
  277. package/lib/components/template/AdvancedSearch/SearchGroups/SearchGroups.js.map +1 -0
  278. package/lib/components/template/AdvancedSearch/SearchGroups/hooks.d.ts +10 -0
  279. package/lib/components/template/AdvancedSearch/SearchGroups/hooks.d.ts.map +1 -0
  280. package/lib/components/template/AdvancedSearch/SearchGroups/hooks.js +26 -0
  281. package/lib/components/template/AdvancedSearch/SearchGroups/hooks.js.map +1 -0
  282. package/lib/components/template/AdvancedSearch/SearchGroups/index.d.ts +2 -0
  283. package/lib/components/template/AdvancedSearch/SearchGroups/index.d.ts.map +1 -0
  284. package/lib/components/template/AdvancedSearch/SearchGroups/index.js +2 -0
  285. package/lib/components/template/AdvancedSearch/SearchGroups/index.js.map +1 -0
  286. package/lib/components/template/AdvancedSearch/SearchGroups/utils.d.ts +16 -0
  287. package/lib/components/template/AdvancedSearch/SearchGroups/utils.d.ts.map +1 -0
  288. package/lib/components/template/AdvancedSearch/SearchGroups/utils.js +22 -0
  289. package/lib/components/template/AdvancedSearch/SearchGroups/utils.js.map +1 -0
  290. package/lib/components/template/AdvancedSearch/TemplateContext.d.ts +10 -0
  291. package/lib/components/template/AdvancedSearch/TemplateContext.d.ts.map +1 -0
  292. package/lib/components/template/AdvancedSearch/TemplateContext.js +11 -0
  293. package/lib/components/template/AdvancedSearch/TemplateContext.js.map +1 -0
  294. package/lib/components/template/AdvancedSearch/index.d.ts +2 -0
  295. package/lib/components/template/AdvancedSearch/index.d.ts.map +1 -0
  296. package/lib/components/template/AdvancedSearch/index.js +2 -0
  297. package/lib/components/template/AdvancedSearch/index.js.map +1 -0
  298. package/lib/components/template/AppShell/AppShell.d.ts +4 -2
  299. package/lib/components/template/AppShell/AppShell.d.ts.map +1 -1
  300. package/lib/components/template/AppShell/AppShell.js +33 -10
  301. package/lib/components/template/AppShell/AppShell.js.map +1 -1
  302. package/lib/components/template/BannerPage/BannerPage.d.ts +2 -2
  303. package/lib/components/template/BannerPage/BannerPage.d.ts.map +1 -1
  304. package/lib/components/template/BannerPage/BannerPage.js.map +1 -1
  305. package/lib/components/template/CaseSummary/CaseSummary.d.ts +2 -2
  306. package/lib/components/template/CaseSummary/CaseSummary.d.ts.map +1 -1
  307. package/lib/components/template/CaseSummary/CaseSummary.js.map +1 -1
  308. package/lib/components/template/CaseView/CaseView.d.ts +3 -2
  309. package/lib/components/template/CaseView/CaseView.d.ts.map +1 -1
  310. package/lib/components/template/CaseView/CaseView.js +7 -7
  311. package/lib/components/template/CaseView/CaseView.js.map +1 -1
  312. package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.d.ts +1 -1
  313. package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.d.ts.map +1 -1
  314. package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.js +7 -7
  315. package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.js.map +1 -1
  316. package/lib/components/template/Confirmation/Confirmation.d.ts +2 -2
  317. package/lib/components/template/Confirmation/Confirmation.d.ts.map +1 -1
  318. package/lib/components/template/Confirmation/Confirmation.js +3 -2
  319. package/lib/components/template/Confirmation/Confirmation.js.map +1 -1
  320. package/lib/components/template/DataReference/DataReference.d.ts +9 -2
  321. package/lib/components/template/DataReference/DataReference.d.ts.map +1 -1
  322. package/lib/components/template/DataReference/DataReference.js +245 -81
  323. package/lib/components/template/DataReference/DataReference.js.map +1 -1
  324. package/lib/components/template/DataReference/DataReferenceAdvancedSearchContext.d.ts +8 -0
  325. package/lib/components/template/DataReference/DataReferenceAdvancedSearchContext.d.ts.map +1 -0
  326. package/lib/components/template/DataReference/DataReferenceAdvancedSearchContext.js +9 -0
  327. package/lib/components/template/DataReference/DataReferenceAdvancedSearchContext.js.map +1 -0
  328. package/lib/components/template/DataReference/SearchForm.d.ts +3 -0
  329. package/lib/components/template/DataReference/SearchForm.d.ts.map +1 -0
  330. package/lib/components/template/DataReference/SearchForm.js +86 -0
  331. package/lib/components/template/DataReference/SearchForm.js.map +1 -0
  332. package/lib/components/template/DataReference/utils.d.ts +15 -0
  333. package/lib/components/template/DataReference/utils.d.ts.map +1 -0
  334. package/lib/components/template/DataReference/utils.js +75 -0
  335. package/lib/components/template/DataReference/utils.js.map +1 -0
  336. package/lib/components/template/DefaultForm/DefaultForm.d.ts +2 -2
  337. package/lib/components/template/DefaultForm/DefaultForm.d.ts.map +1 -1
  338. package/lib/components/template/DefaultForm/DefaultForm.js.map +1 -1
  339. package/lib/components/template/DefaultForm/utils/index.d.ts.map +1 -1
  340. package/lib/components/template/DefaultForm/utils/index.js +1 -2
  341. package/lib/components/template/DefaultForm/utils/index.js.map +1 -1
  342. package/lib/components/template/Details/Details/Details.d.ts +1 -1
  343. package/lib/components/template/Details/Details/Details.d.ts.map +1 -1
  344. package/lib/components/template/Details/Details/Details.js +2 -2
  345. package/lib/components/template/Details/Details/Details.js.map +1 -1
  346. package/lib/components/template/Details/DetailsSubTabs/DetailsSubTabs.d.ts +2 -2
  347. package/lib/components/template/Details/DetailsSubTabs/DetailsSubTabs.d.ts.map +1 -1
  348. package/lib/components/template/Details/DetailsSubTabs/DetailsSubTabs.js +3 -3
  349. package/lib/components/template/Details/DetailsSubTabs/DetailsSubTabs.js.map +1 -1
  350. package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.d.ts +1 -1
  351. package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.d.ts.map +1 -1
  352. package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.js +2 -2
  353. package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.js.map +1 -1
  354. package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.d.ts +1 -1
  355. package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.d.ts.map +1 -1
  356. package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.js +2 -2
  357. package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.js.map +1 -1
  358. package/lib/components/template/Details/DynamicTabs/DynamicTabs.d.ts +1 -1
  359. package/lib/components/template/Details/DynamicTabs/DynamicTabs.d.ts.map +1 -1
  360. package/lib/components/template/Details/DynamicTabs/DynamicTabs.js +4 -4
  361. package/lib/components/template/Details/DynamicTabs/DynamicTabs.js.map +1 -1
  362. package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.d.ts +1 -1
  363. package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.d.ts.map +1 -1
  364. package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.js +9 -5
  365. package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.js.map +1 -1
  366. package/lib/components/template/InlineDashboard/InlineDashboard.d.ts +2 -2
  367. package/lib/components/template/InlineDashboard/InlineDashboard.d.ts.map +1 -1
  368. package/lib/components/template/InlineDashboard/InlineDashboard.js +2 -2
  369. package/lib/components/template/InlineDashboard/InlineDashboard.js.map +1 -1
  370. package/lib/components/template/InlineDashboardPage/InlineDashboardPage.d.ts +2 -2
  371. package/lib/components/template/InlineDashboardPage/InlineDashboardPage.d.ts.map +1 -1
  372. package/lib/components/template/InlineDashboardPage/InlineDashboardPage.js.map +1 -1
  373. package/lib/components/template/ListPage/ListPage.d.ts +1 -1
  374. package/lib/components/template/ListPage/ListPage.d.ts.map +1 -1
  375. package/lib/components/template/ListPage/ListPage.js.map +1 -1
  376. package/lib/components/template/ListView/DefaultViewMeta.js.map +1 -1
  377. package/lib/components/template/ListView/ListView.d.ts +4 -1
  378. package/lib/components/template/ListView/ListView.d.ts.map +1 -1
  379. package/lib/components/template/ListView/ListView.js +151 -66
  380. package/lib/components/template/ListView/ListView.js.map +1 -1
  381. package/lib/components/template/ListView/hooks.js.map +1 -1
  382. package/lib/components/template/ListView/utils.d.ts.map +1 -1
  383. package/lib/components/template/ListView/utils.js +29 -6
  384. package/lib/components/template/ListView/utils.js.map +1 -1
  385. package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.d.ts +1 -1
  386. package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.d.ts.map +1 -1
  387. package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.js.map +1 -1
  388. package/lib/components/template/NarrowWide/NarrowWide/NarrowWide.d.ts +2 -2
  389. package/lib/components/template/NarrowWide/NarrowWide/NarrowWide.d.ts.map +1 -1
  390. package/lib/components/template/NarrowWide/NarrowWide/NarrowWide.js.map +1 -1
  391. package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.d.ts +1 -1
  392. package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.d.ts.map +1 -1
  393. package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.js +2 -2
  394. package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.js.map +1 -1
  395. package/lib/components/template/NarrowWide/NarrowWideForm/NarrowWideForm.d.ts +2 -2
  396. package/lib/components/template/NarrowWide/NarrowWideForm/NarrowWideForm.d.ts.map +1 -1
  397. package/lib/components/template/NarrowWide/NarrowWideForm/NarrowWideForm.js.map +1 -1
  398. package/lib/components/template/NarrowWide/NarrowWidePage/NarrowWidePage.d.ts +2 -2
  399. package/lib/components/template/NarrowWide/NarrowWidePage/NarrowWidePage.d.ts.map +1 -1
  400. package/lib/components/template/NarrowWide/NarrowWidePage/NarrowWidePage.js.map +1 -1
  401. package/lib/components/template/OneColumn/OneColumn/OneColumn.d.ts +2 -2
  402. package/lib/components/template/OneColumn/OneColumn/OneColumn.d.ts.map +1 -1
  403. package/lib/components/template/OneColumn/OneColumn/OneColumn.js +2 -2
  404. package/lib/components/template/OneColumn/OneColumn/OneColumn.js.map +1 -1
  405. package/lib/components/template/OneColumn/OneColumnPage/OneColumnPage.d.ts +1 -1
  406. package/lib/components/template/OneColumn/OneColumnPage/OneColumnPage.d.ts.map +1 -1
  407. package/lib/components/template/OneColumn/OneColumnPage/OneColumnPage.js.map +1 -1
  408. package/lib/components/template/OneColumn/OneColumnTab/OneColumnTab.d.ts +2 -2
  409. package/lib/components/template/OneColumn/OneColumnTab/OneColumnTab.d.ts.map +1 -1
  410. package/lib/components/template/OneColumn/OneColumnTab/OneColumnTab.js.map +1 -1
  411. package/lib/components/template/PromotedFilters/PromotedFilters.d.ts +1 -1
  412. package/lib/components/template/PromotedFilters/PromotedFilters.d.ts.map +1 -1
  413. package/lib/components/template/PromotedFilters/PromotedFilters.js +1 -2
  414. package/lib/components/template/PromotedFilters/PromotedFilters.js.map +1 -1
  415. package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.d.ts +1 -1
  416. package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.d.ts.map +1 -1
  417. package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.js +0 -2
  418. package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.js.map +1 -1
  419. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.d.ts +4 -2
  420. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.d.ts.map +1 -1
  421. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js +68 -45
  422. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js.map +1 -1
  423. package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.d.ts +1 -1
  424. package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.d.ts.map +1 -1
  425. package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.js +2 -4
  426. package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.js.map +1 -1
  427. package/lib/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.d.ts +1 -1
  428. package/lib/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.d.ts.map +1 -1
  429. package/lib/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.js.map +1 -1
  430. package/lib/components/template/SubTabs/SubTabs.d.ts +2 -2
  431. package/lib/components/template/SubTabs/SubTabs.d.ts.map +1 -1
  432. package/lib/components/template/SubTabs/SubTabs.js +2 -2
  433. package/lib/components/template/SubTabs/SubTabs.js.map +1 -1
  434. package/lib/components/template/SubTabs/tabUtils.d.ts +10 -0
  435. package/lib/components/template/SubTabs/tabUtils.d.ts.map +1 -1
  436. package/lib/components/template/SubTabs/tabUtils.js +102 -1
  437. package/lib/components/template/SubTabs/tabUtils.js.map +1 -1
  438. package/lib/components/template/TwoColumn/TwoColumn/TwoColumn.d.ts +2 -2
  439. package/lib/components/template/TwoColumn/TwoColumn/TwoColumn.d.ts.map +1 -1
  440. package/lib/components/template/TwoColumn/TwoColumn/TwoColumn.js +3 -3
  441. package/lib/components/template/TwoColumn/TwoColumn/TwoColumn.js.map +1 -1
  442. package/lib/components/template/TwoColumn/TwoColumnPage/TwoColumnPage.d.ts +1 -1
  443. package/lib/components/template/TwoColumn/TwoColumnPage/TwoColumnPage.d.ts.map +1 -1
  444. package/lib/components/template/TwoColumn/TwoColumnPage/TwoColumnPage.js.map +1 -1
  445. package/lib/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.d.ts +2 -2
  446. package/lib/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.d.ts.map +1 -1
  447. package/lib/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.js +3 -3
  448. package/lib/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.js.map +1 -1
  449. package/lib/components/template/WideNarrow/WideNarrow/WideNarrow.d.ts +2 -2
  450. package/lib/components/template/WideNarrow/WideNarrow/WideNarrow.d.ts.map +1 -1
  451. package/lib/components/template/WideNarrow/WideNarrow/WideNarrow.js.map +1 -1
  452. package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.d.ts +1 -1
  453. package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.d.ts.map +1 -1
  454. package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.js +2 -2
  455. package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.js.map +1 -1
  456. package/lib/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.d.ts +2 -2
  457. package/lib/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.d.ts.map +1 -1
  458. package/lib/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.js.map +1 -1
  459. package/lib/components/template/WideNarrow/WideNarrowPage/WideNarrowPage.d.ts +2 -2
  460. package/lib/components/template/WideNarrow/WideNarrowPage/WideNarrowPage.d.ts.map +1 -1
  461. package/lib/components/template/WideNarrow/WideNarrowPage/WideNarrowPage.js.map +1 -1
  462. package/lib/components/template/WssNavBar/WssNavBar.d.ts +1 -1
  463. package/lib/components/template/WssNavBar/WssNavBar.d.ts.map +1 -1
  464. package/lib/components/template/WssNavBar/WssNavBar.js +10 -10
  465. package/lib/components/template/WssNavBar/WssNavBar.js.map +1 -1
  466. package/lib/components/widget/AppAnnouncement/AppAnnouncement.d.ts +1 -1
  467. package/lib/components/widget/AppAnnouncement/AppAnnouncement.d.ts.map +1 -1
  468. package/lib/components/widget/AppAnnouncement/AppAnnouncement.js +2 -2
  469. package/lib/components/widget/AppAnnouncement/AppAnnouncement.js.map +1 -1
  470. package/lib/components/widget/Attachment/Attachment.css +1 -0
  471. package/lib/components/widget/Attachment/Attachment.d.ts +1 -1
  472. package/lib/components/widget/Attachment/Attachment.d.ts.map +1 -1
  473. package/lib/components/widget/Attachment/Attachment.js +7 -10
  474. package/lib/components/widget/Attachment/Attachment.js.map +1 -1
  475. package/lib/components/widget/CaseHistory/CaseHistory.d.ts +1 -1
  476. package/lib/components/widget/CaseHistory/CaseHistory.d.ts.map +1 -1
  477. package/lib/components/widget/CaseHistory/CaseHistory.js +10 -9
  478. package/lib/components/widget/CaseHistory/CaseHistory.js.map +1 -1
  479. package/lib/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.d.ts +1 -1
  480. package/lib/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.d.ts.map +1 -1
  481. package/lib/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.js +1 -1
  482. package/lib/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.js.map +1 -1
  483. package/lib/components/widget/FileUtility/FileUtility/FileUtility.d.ts +1 -1
  484. package/lib/components/widget/FileUtility/FileUtility/FileUtility.d.ts.map +1 -1
  485. package/lib/components/widget/FileUtility/FileUtility/FileUtility.js +10 -10
  486. package/lib/components/widget/FileUtility/FileUtility/FileUtility.js.map +1 -1
  487. package/lib/components/widget/Followers/Followers.d.ts +2 -2
  488. package/lib/components/widget/Followers/Followers.d.ts.map +1 -1
  489. package/lib/components/widget/Followers/Followers.js +2 -2
  490. package/lib/components/widget/Followers/Followers.js.map +1 -1
  491. package/lib/components/widget/QuickCreate/QuickCreate.d.ts +1 -1
  492. package/lib/components/widget/QuickCreate/QuickCreate.d.ts.map +1 -1
  493. package/lib/components/widget/QuickCreate/QuickCreate.js +0 -1
  494. package/lib/components/widget/QuickCreate/QuickCreate.js.map +1 -1
  495. package/lib/components/widget/SummaryItem/SummaryItem.d.ts +1 -1
  496. package/lib/components/widget/SummaryItem/SummaryItem.d.ts.map +1 -1
  497. package/lib/components/widget/SummaryItem/SummaryItem.js +3 -3
  498. package/lib/components/widget/SummaryItem/SummaryItem.js.map +1 -1
  499. package/lib/components/widget/SummaryList/SummaryList.d.ts +1 -1
  500. package/lib/components/widget/SummaryList/SummaryList.d.ts.map +1 -1
  501. package/lib/components/widget/SummaryList/SummaryList.js.map +1 -1
  502. package/lib/components/widget/ToDo/ToDo.d.ts +1 -1
  503. package/lib/components/widget/ToDo/ToDo.d.ts.map +1 -1
  504. package/lib/components/widget/ToDo/ToDo.js +60 -17
  505. package/lib/components/widget/ToDo/ToDo.js.map +1 -1
  506. package/lib/doc/KeyReleaseUpdates.md +19 -7
  507. package/lib/hooks/index.d.ts +2 -0
  508. package/lib/hooks/index.d.ts.map +1 -1
  509. package/lib/hooks/index.js +2 -0
  510. package/lib/hooks/index.js.map +1 -1
  511. package/lib/hooks/useAfterInitialEffect.d.ts +1 -1
  512. package/lib/hooks/useAfterInitialEffect.d.ts.map +1 -1
  513. package/lib/hooks/useAfterInitialEffect.js.map +1 -1
  514. package/lib/hooks/useConsolidatedRef.d.ts +1 -1
  515. package/lib/hooks/useConsolidatedRef.d.ts.map +1 -1
  516. package/lib/hooks/useConsolidatedRef.js.map +1 -1
  517. package/lib/hooks/useFocusFirstField.d.ts +7 -0
  518. package/lib/hooks/useFocusFirstField.d.ts.map +1 -0
  519. package/lib/hooks/useFocusFirstField.js +20 -0
  520. package/lib/hooks/useFocusFirstField.js.map +1 -0
  521. package/lib/hooks/useGetTabsCount.d.ts +10 -0
  522. package/lib/hooks/useGetTabsCount.d.ts.map +1 -0
  523. package/lib/hooks/useGetTabsCount.js +166 -0
  524. package/lib/hooks/useGetTabsCount.js.map +1 -0
  525. package/lib/hooks/useIsMount.d.ts +2 -0
  526. package/lib/hooks/useIsMount.d.ts.map +1 -0
  527. package/lib/hooks/useIsMount.js +9 -0
  528. package/lib/hooks/useIsMount.js.map +1 -0
  529. package/lib/hooks/useScrolltoTop.d.ts +7 -0
  530. package/lib/hooks/useScrolltoTop.d.ts.map +1 -0
  531. package/lib/hooks/useScrolltoTop.js +13 -0
  532. package/lib/hooks/useScrolltoTop.js.map +1 -0
  533. package/lib/sdk-pega-component-map.d.ts +109 -103
  534. package/lib/sdk-pega-component-map.d.ts.map +1 -1
  535. package/lib/sdk-pega-component-map.js +9 -3
  536. package/lib/sdk-pega-component-map.js.map +1 -1
  537. package/lib/theme.d.ts +11 -0
  538. package/lib/theme.d.ts.map +1 -0
  539. package/lib/theme.js +31 -0
  540. package/lib/theme.js.map +1 -0
  541. package/package.json +31 -1
  542. package/lib/components/infra/Containers/helpers.d.ts +0 -2
  543. package/lib/components/infra/Containers/helpers.d.ts.map +0 -1
  544. package/lib/components/infra/Containers/helpers.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"common-utils.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/common-utils.ts"],"names":[],"mappings":"AACA,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAElD"}
1
+ {"version":3,"file":"common-utils.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/common-utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAElD;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAgBhF"}
@@ -1,5 +1,25 @@
1
- /* eslint-disable import/prefer-default-export */
2
1
  export function isEmptyObject(obj) {
3
2
  return Object.keys(obj).length === 0;
4
3
  }
4
+ /**
5
+ * Get a localized value from the Generic Fields
6
+ * @param path - The path within Generic Fields (e.g., 'CosmosFields.fields.lists')
7
+ * @param key - The key of the string to localize
8
+ * @returns The localized string or the key itself if no translation is found
9
+ */
10
+ export function getGenericFieldsLocalizedValue(path, key) {
11
+ const GENERIC_BUNDLE_KEY = PCore.getLocaleUtils().GENERIC_BUNDLE_KEY;
12
+ const localeStore = PCore.getLocaleUtils().localeStore[GENERIC_BUNDLE_KEY];
13
+ if (!localeStore)
14
+ return key;
15
+ // Split the path and traverse the object
16
+ const pathParts = path.split('.');
17
+ let currentObj = localeStore;
18
+ for (const part of pathParts) {
19
+ if (!currentObj[part])
20
+ return key;
21
+ currentObj = currentObj[part];
22
+ }
23
+ return currentObj[key] || key;
24
+ }
5
25
  //# sourceMappingURL=common-utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"common-utils.js","sourceRoot":"","sources":["../../../src/components/helpers/common-utils.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;AACvC,CAAC","sourcesContent":["/* eslint-disable import/prefer-default-export */\nexport function isEmptyObject(obj: Object): boolean {\n return Object.keys(obj).length === 0;\n}\n"]}
1
+ {"version":3,"file":"common-utils.js","sourceRoot":"","sources":["../../../src/components/helpers/common-utils.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;AACvC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,8BAA8B,CAAC,IAAY,EAAE,GAAW;IACtE,MAAM,kBAAkB,GAAG,KAAK,CAAC,cAAc,EAAE,CAAC,kBAAkB,CAAC;IACrE,MAAM,WAAW,GAAG,KAAK,CAAC,cAAc,EAAE,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;IAE3E,IAAI,CAAC,WAAW;QAAE,OAAO,GAAG,CAAC;IAE7B,yCAAyC;IACzC,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAClC,IAAI,UAAU,GAAG,WAAW,CAAC;IAE7B,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;QAC7B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;YAAE,OAAO,GAAG,CAAC;QAClC,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,UAAU,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC;AAChC,CAAC","sourcesContent":["export function isEmptyObject(obj: Object): boolean {\n return Object.keys(obj).length === 0;\n}\n\n/**\n * Get a localized value from the Generic Fields\n * @param path - The path within Generic Fields (e.g., 'CosmosFields.fields.lists')\n * @param key - The key of the string to localize\n * @returns The localized string or the key itself if no translation is found\n */\nexport function getGenericFieldsLocalizedValue(path: string, key: string): string {\n const GENERIC_BUNDLE_KEY = PCore.getLocaleUtils().GENERIC_BUNDLE_KEY;\n const localeStore = PCore.getLocaleUtils().localeStore[GENERIC_BUNDLE_KEY];\n\n if (!localeStore) return key;\n\n // Split the path and traverse the object\n const pathParts = path.split('.');\n let currentObj = localeStore;\n\n for (const part of pathParts) {\n if (!currentObj[part]) return key;\n currentObj = currentObj[part];\n }\n\n return currentObj[key] || key;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"data_page.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/data_page.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,WAAW,wEAmBvB,CAAC"}
1
+ {"version":3,"file":"data_page.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/data_page.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,WAAW,GAAI,iBAAY,EAAE,eAAU,EAAE,YAAO,qBAmB5D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"data_page.js","sourceRoot":"","sources":["../../../src/components/helpers/data_page.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE;IAC/D,IAAI,cAAc,CAAC;IACnB,IAAI,UAAU,EAAE;QACd,cAAc,GAAG;YACf,kBAAkB,EAAE,UAAU;SAC/B,CAAC;KACH;IACD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACpC,KAAK,CAAC,eAAe,EAAE,CAAC,OAAO,CAAC,YAAY,EAAE,cAAc,EAAE,OAAO,CAAS;aAC5E,IAAI,CAAC,QAAQ,CAAC,EAAE;YACf,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,CAAC,EAAE;YACT,IAAI,CAAC,EAAE;gBACL,8FAA8F;gBAC9F,MAAM,CAAC,CAAC,CAAC,CAAC;aACX;QACH,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["// eslint-disable-next-line import/prefer-default-export\nexport const getDataPage = (dataPageName, parameters, context) => {\n let dataViewParams;\n if (parameters) {\n dataViewParams = {\n dataViewParameters: parameters\n };\n }\n return new Promise((resolve, reject) => {\n (PCore.getDataApiUtils().getData(dataPageName, dataViewParams, context) as any)\n .then(response => {\n resolve(response.data.data);\n })\n .catch(e => {\n if (e) {\n // check specific error if 401, and wiped out if so stored token is stale. Fetcch new tokens.\n reject(e);\n }\n });\n });\n};\n"]}
1
+ {"version":3,"file":"data_page.js","sourceRoot":"","sources":["../../../src/components/helpers/data_page.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE;IAC/D,IAAI,cAAc,CAAC;IACnB,IAAI,UAAU,EAAE,CAAC;QACf,cAAc,GAAG;YACf,kBAAkB,EAAE,UAAU;SAC/B,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACpC,KAAK,CAAC,eAAe,EAAE,CAAC,OAAO,CAAC,YAAY,EAAE,cAAc,EAAE,OAAO,CAAS;aAC5E,IAAI,CAAC,QAAQ,CAAC,EAAE;YACf,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,CAAC,EAAE;YACT,IAAI,CAAC,EAAE,CAAC;gBACN,8FAA8F;gBAC9F,MAAM,CAAC,CAAC,CAAC,CAAC;YACZ,CAAC;QACH,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["// eslint-disable-next-line import/prefer-default-export\nexport const getDataPage = (dataPageName, parameters, context) => {\n let dataViewParams;\n if (parameters) {\n dataViewParams = {\n dataViewParameters: parameters\n };\n }\n return new Promise((resolve, reject) => {\n (PCore.getDataApiUtils().getData(dataPageName, dataViewParams, context) as any)\n .then(response => {\n resolve(response.data.data);\n })\n .catch(e => {\n if (e) {\n // check specific error if 401, and wiped out if so stored token is stale. Fetcch new tokens.\n reject(e);\n }\n });\n });\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"date-format-utils.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/date-format-utils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB;;;;;CAKjC,CAAC;AAEF,eAAO,MAAM,iBAAiB,QAAO,4BAkEpC,CAAC"}
1
+ {"version":3,"file":"date-format-utils.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/date-format-utils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB;;;;;CAKjC,CAAC;AAEF,eAAO,MAAM,iBAAiB,QAAO,OAAO,qBAkE3C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"event-utils.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/event-utils.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,WAAW,YAAa,GAAG,aAAa,MAAM,YAAY,MAAM,SAAS,MAAM,SAepF,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"event-utils.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/event-utils.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,WAAW,GAAI,SAAS,GAAG,EAAE,WAAW,MAAM,EAAE,UAAU,MAAM,EAAE,OAAO,MAAM,SAepF,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"event-utils.js","sourceRoot":"","sources":["../../../src/components/helpers/event-utils.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAE9C,MAAM,WAAW,GAAG,CAAC,OAAY,EAAE,SAAiB,EAAE,QAAgB,EAAE,KAAa,EAAE,EAAE;IACvF,QAAQ,SAAS,EAAE;QACjB,KAAK,QAAQ;YACX,OAAO,CAAC,gBAAgB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;YAC1C,MAAM;QACR,KAAK,MAAM;YACT,OAAO,CAAC,kBAAkB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;YAC5C,MAAM;QACR,KAAK,aAAa;YAChB,OAAO,CAAC,gBAAgB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;YAC1C,OAAO,CAAC,kBAAkB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;YAC5C,MAAM;QACR;YACE,MAAM;KACT;AACH,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["// From DX Components src/utils/event-utils.js\n\nconst handleEvent = (actions: any, eventType: string, propName: string, value: string) => {\n switch (eventType) {\n case 'change':\n actions.updateFieldValue(propName, value);\n break;\n case 'blur':\n actions.triggerFieldChange(propName, value);\n break;\n case 'changeNblur':\n actions.updateFieldValue(propName, value);\n actions.triggerFieldChange(propName, value);\n break;\n default:\n break;\n }\n};\n\nexport default handleEvent;\n"]}
1
+ {"version":3,"file":"event-utils.js","sourceRoot":"","sources":["../../../src/components/helpers/event-utils.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAE9C,MAAM,WAAW,GAAG,CAAC,OAAY,EAAE,SAAiB,EAAE,QAAgB,EAAE,KAAa,EAAE,EAAE;IACvF,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,QAAQ;YACX,OAAO,CAAC,gBAAgB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;YAC1C,MAAM;QACR,KAAK,MAAM;YACT,OAAO,CAAC,kBAAkB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;YAC5C,MAAM;QACR,KAAK,aAAa;YAChB,OAAO,CAAC,gBAAgB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;YAC1C,OAAO,CAAC,kBAAkB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;YAC5C,MAAM;QACR;YACE,MAAM;IACV,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["// From DX Components src/utils/event-utils.js\n\nconst handleEvent = (actions: any, eventType: string, propName: string, value: string) => {\n switch (eventType) {\n case 'change':\n actions.updateFieldValue(propName, value);\n break;\n case 'blur':\n actions.triggerFieldChange(propName, value);\n break;\n case 'changeNblur':\n actions.updateFieldValue(propName, value);\n actions.triggerFieldChange(propName, value);\n break;\n default:\n break;\n }\n};\n\nexport default handleEvent;\n"]}
@@ -1,4 +1,4 @@
1
- import { ReactElement } from 'react';
1
+ import { type ReactElement } from 'react';
2
2
  /**
3
3
  *
4
4
  * @param {*} pConn - pConnect object of the view
@@ -1 +1 @@
1
- {"version":3,"file":"field-group-utils.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/field-group-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAIpD;;;;GAIG;AAEH,eAAO,MAAM,gBAAgB,qBAW5B,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,KAAK,KAAA,EAAE,KAAK,KAAA,EAAE,cAAc,KAAA,GAAG,YAAY,CAyBpE"}
1
+ {"version":3,"file":"field-group-utils.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/field-group-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAIzD;;;;GAIG;AAEH,eAAO,MAAM,gBAAgB,GAAG,UAAK,QAWpC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,KAAK,KAAA,EAAE,KAAK,KAAA,EAAE,cAAc,KAAA,GAAG,YAAY,CAyBpE"}
@@ -42,8 +42,8 @@ export function buildView(pConn, index, viewConfigPath) {
42
42
  }
43
43
  };
44
44
  const view = PCore.createPConnect(config);
45
- if (pConn.getConfigProps()?.displayMode === 'LABELS_LEFT') {
46
- view.getPConnect()?.setInheritedProp('displayMode', 'LABELS_LEFT');
45
+ if (pConn.getConfigProps()?.displayMode === 'DISPLAY_ONLY') {
46
+ view.getPConnect()?.setInheritedProp('displayMode', 'DISPLAY_ONLY');
47
47
  }
48
48
  return createElement(createPConnectComponent(), view);
49
49
  }
@@ -1 +1 @@
1
- {"version":3,"file":"field-group-utils.js","sourceRoot":"","sources":["../../../src/components/helpers/field-group-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAgB,MAAM,OAAO,CAAC;AAEpD,OAAO,uBAAuB,MAAM,6BAA6B,CAAC;AAElE;;;;GAIG;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC,EAAE;IACtC,IAAI,WAAW,GAAG,KAAK,CAAC,kBAAkB,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC9E,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;QAC9B,WAAW,GAAG,KAAK,CAAC,0BAA0B,CAAC,WAAW,CAAC,CAAC;QAC5D,IAAI,WAAW,EAAE,SAAS,EAAE;YAC1B,WAAW,GAAG,WAAW,EAAE,SAAS,CAAC;SACtC;aAAM,IAAI,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE;YAC9E,WAAW,GAAG,GAAG,WAAW,YAAY,CAAC;SAC1C;KACF;IACD,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,cAAc;IACpD,MAAM,OAAO,GAAG,KAAK,CAAC,cAAc,EAAE,CAAC;IACvC,MAAM,aAAa,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAE9C,MAAM,UAAU,GAAG,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAClD,MAAM,aAAa,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,aAAa,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,gBAAgB,EAAE,GAAG,aAAa,IAAI,KAAK,GAAG,CAAC;IAC1H,MAAM,IAAI,GAAG,cAAc,CAAC,CAAC,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAElH,OAAO,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC;IAE/B,MAAM,MAAM,GAAG;QACb,IAAI;QACJ,OAAO,EAAE;YACP,OAAO;YACP,aAAa;YACb,aAAa;YACb,OAAO,EAAE,IAAI;SACd;KACF,CAAC;IAEF,MAAM,IAAI,GAAG,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAC1C,IAAI,KAAK,CAAC,cAAc,EAAE,EAAE,WAAW,KAAK,aAAa,EAAE;QACzD,IAAI,CAAC,WAAW,EAAE,EAAE,gBAAgB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;KACpE;IACD,OAAO,aAAa,CAAC,uBAAuB,EAAE,EAAE,IAAI,CAAC,CAAC;AACxD,CAAC","sourcesContent":["import { createElement, ReactElement } from 'react';\n\nimport createPConnectComponent from '../../bridge/react_pconnect';\n\n/**\n *\n * @param {*} pConn - pConnect object of the view\n * @returns {string} - returns the name of referenceList\n */\n\nexport const getReferenceList = pConn => {\n let resolvePage = pConn.getComponentConfig().referenceList.replace('@P ', '');\n if (resolvePage.includes('D_')) {\n resolvePage = pConn.resolveDatasourceReference(resolvePage);\n if (resolvePage?.pxResults) {\n resolvePage = resolvePage?.pxResults;\n } else if (resolvePage.startsWith('D_') && !resolvePage.endsWith('.pxResults')) {\n resolvePage = `${resolvePage}.pxResults`;\n }\n }\n return resolvePage;\n};\n\n/**\n * creates and returns react element of the view\n * @param {*} pConn - pConnect object of the view\n * @param {*} index - index of the fieldGroup item\n * @param {*} viewConfigPath - boolean value to check for children in config\n * @returns {*} - return the react element of the view\n */\nexport function buildView(pConn, index, viewConfigPath): ReactElement {\n const context = pConn.getContextName();\n const referenceList = getReferenceList(pConn);\n\n const isDatapage = referenceList.startsWith('D_');\n const pageReference = isDatapage ? `${referenceList}[${index}]` : `${pConn.getPageReference()}${referenceList}[${index}]`;\n const meta = viewConfigPath ? pConn.getRawMetadata().children[0].children[0] : pConn.getRawMetadata().children[0];\n\n delete meta?.config?.ruleClass;\n\n const config = {\n meta,\n options: {\n context,\n pageReference,\n referenceList,\n hasForm: true\n }\n };\n\n const view = PCore.createPConnect(config);\n if (pConn.getConfigProps()?.displayMode === 'LABELS_LEFT') {\n view.getPConnect()?.setInheritedProp('displayMode', 'LABELS_LEFT');\n }\n return createElement(createPConnectComponent(), view);\n}\n"]}
1
+ {"version":3,"file":"field-group-utils.js","sourceRoot":"","sources":["../../../src/components/helpers/field-group-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAqB,MAAM,OAAO,CAAC;AAEzD,OAAO,uBAAuB,MAAM,6BAA6B,CAAC;AAElE;;;;GAIG;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC,EAAE;IACtC,IAAI,WAAW,GAAG,KAAK,CAAC,kBAAkB,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,EAAE,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ACb,OAAO,EAAE,IAAI;SACd;KACF,CAAC;IAEF,MAAM,IAAI,GAAG,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAC1C,IAAI,KAAK,CAAC,cAAc,EAAE,EAAE,WAAW,KAAK,cAAc,EAAE,CAAC;QAC3D,IAAI,CAAC,WAAW,EAAE,EAAE,gBAAgB,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;IACtE,CAAC;IACD,OAAO,aAAa,CAAC,uBAAuB,EAAE,EAAE,IAAI,CAAC,CAAC;AACxD,CAAC","sourcesContent":["import { createElement, type ReactElement } from 'react';\n\nimport createPConnectComponent from '../../bridge/react_pconnect';\n\n/**\n *\n * @param {*} pConn - pConnect object of the view\n * @returns {string} - returns the name of referenceList\n */\n\nexport const getReferenceList = pConn => {\n let resolvePage = pConn.getComponentConfig().referenceList.replace('@P ', '');\n if (resolvePage.includes('D_')) {\n resolvePage = pConn.resolveDatasourceReference(resolvePage);\n if (resolvePage?.pxResults) {\n resolvePage = resolvePage?.pxResults;\n } else if (resolvePage.startsWith('D_') && !resolvePage.endsWith('.pxResults')) {\n resolvePage = `${resolvePage}.pxResults`;\n }\n }\n return resolvePage;\n};\n\n/**\n * creates and returns react element of the view\n * @param {*} pConn - pConnect object of the view\n * @param {*} index - index of the fieldGroup item\n * @param {*} viewConfigPath - boolean value to check for children in config\n * @returns {*} - return the react element of the view\n */\nexport function buildView(pConn, index, viewConfigPath): ReactElement {\n const context = pConn.getContextName();\n const referenceList = getReferenceList(pConn);\n\n const isDatapage = referenceList.startsWith('D_');\n const pageReference = isDatapage ? `${referenceList}[${index}]` : `${pConn.getPageReference()}${referenceList}[${index}]`;\n const meta = viewConfigPath ? pConn.getRawMetadata().children[0].children[0] : pConn.getRawMetadata().children[0];\n\n delete meta?.config?.ruleClass;\n\n const config = {\n meta,\n options: {\n context,\n pageReference,\n referenceList,\n hasForm: true\n }\n };\n\n const view = PCore.createPConnect(config);\n if (pConn.getConfigProps()?.displayMode === 'DISPLAY_ONLY') {\n view.getPConnect()?.setInheritedProp('displayMode', 'DISPLAY_ONLY');\n }\n return createElement(createPConnectComponent(), view);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Boolean.js","sourceRoot":"","sources":["../../../../src/components/helpers/formatters/Boolean.ts"],"names":[],"mappings":"AAAA,SAAS,OAAO,CAAC,KAAK,EAAE,EAAE,UAAU,GAAG,IAAI,EAAE,IAAI,GAAG,EAAE,EAAE,KAAK,GAAG,EAAE,EAAE,GAAG,EAAE;IACvE,IAAI,CAAC,CAAC,UAAU,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,KAAK,IAAI,KAAK,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,KAAK,OAAO,IAAI,KAAK,KAAK,CAAC,IAAI,KAAK,KAAK,GAAG,EAAE;QAC9H,OAAO,KAAK,IAAI,EAAE,CAAC;KACpB;IACD,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,KAAK,MAAM,IAAI,KAAK,KAAK,CAAC,IAAI,KAAK,KAAK,GAAG,EAAE;QACjG,OAAO,IAAI,IAAI,EAAE,CAAC;KACnB;IACD,IAAI,UAAU,IAAI,CAAC,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,WAAW,CAAC,EAAE;QACtG,OAAO,KAAK,CAAC;KACd;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,eAAe;IACb,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAC5B,OAAO,CAAC,KAAK,EAAE;QACb,GAAG,OAAO;QACV,IAAI,EAAE,OAAO,CAAC,SAAS,IAAI,MAAM;QACjC,KAAK,EAAE,OAAO,CAAC,UAAU,IAAI,OAAO;KACrC,CAAC;CACL,CAAC","sourcesContent":["function Boolean(value, { allowEmpty = true, tick = '', cross = '' } = {}) {\n if ((!allowEmpty && !value) || value === false || value?.toString()?.toLowerCase() === 'false' || value === 0 || value === '0') {\n return cross || '';\n }\n if (value === true || value?.toString()?.toLowerCase() === 'true' || value === 1 || value === '1') {\n return tick || '';\n }\n if (allowEmpty && (value === 'null' || value === '' || value === null || typeof value === 'undefined')) {\n return '- -';\n }\n return value;\n}\n\nexport default {\n TrueFalse: (value, options) =>\n Boolean(value, {\n ...options,\n tick: options.trueLabel || 'True',\n cross: options.falseLabel || 'False'\n })\n};\n"]}
1
+ {"version":3,"file":"Boolean.js","sourceRoot":"","sources":["../../../../src/components/helpers/formatters/Boolean.ts"],"names":[],"mappings":"AAAA,SAAS,OAAO,CAAC,KAAK,EAAE,EAAE,UAAU,GAAG,IAAI,EAAE,IAAI,GAAG,EAAE,EAAE,KAAK,GAAG,EAAE,EAAE,GAAG,EAAE;IACvE,IAAI,CAAC,CAAC,UAAU,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,KAAK,IAAI,KAAK,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,KAAK,OAAO,IAAI,KAAK,KAAK,CAAC,IAAI,KAAK,KAAK,GAAG,EAAE,CAAC;QAC/H,OAAO,KAAK,IAAI,EAAE,CAAC;IACrB,CAAC;IACD,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,KAAK,MAAM,IAAI,KAAK,KAAK,CAAC,IAAI,KAAK,KAAK,GAAG,EAAE,CAAC;QAClG,OAAO,IAAI,IAAI,EAAE,CAAC;IACpB,CAAC;IACD,IAAI,UAAU,IAAI,CAAC,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,WAAW,CAAC,EAAE,CAAC;QACvG,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,eAAe;IACb,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAC5B,OAAO,CAAC,KAAK,EAAE;QACb,GAAG,OAAO;QACV,IAAI,EAAE,OAAO,CAAC,SAAS,IAAI,MAAM;QACjC,KAAK,EAAE,OAAO,CAAC,UAAU,IAAI,OAAO;KACrC,CAAC;CACL,CAAC","sourcesContent":["function Boolean(value, { allowEmpty = true, tick = '', cross = '' } = {}) {\n if ((!allowEmpty && !value) || value === false || value?.toString()?.toLowerCase() === 'false' || value === 0 || value === '0') {\n return cross || '';\n }\n if (value === true || value?.toString()?.toLowerCase() === 'true' || value === 1 || value === '1') {\n return tick || '';\n }\n if (allowEmpty && (value === 'null' || value === '' || value === null || typeof value === 'undefined')) {\n return '- -';\n }\n return value;\n}\n\nexport default {\n TrueFalse: (value, options) =>\n Boolean(value, {\n ...options,\n tick: options.trueLabel || 'True',\n cross: options.falseLabel || 'False'\n })\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Currency.d.ts","sourceRoot":"","sources":["../../../../src/components/helpers/formatters/Currency.ts"],"names":[],"mappings":";;;;;;;;AAiEA,wBAWE"}
1
+ {"version":3,"file":"Currency.d.ts","sourceRoot":"","sources":["../../../../src/components/helpers/formatters/Currency.ts"],"names":[],"mappings":";;;;;;;;AAgEA,wBAOE"}
@@ -4,10 +4,7 @@ import CurrencyMap from './CurrencyMap';
4
4
  function NumberFormatter(value, { locale = 'en-US', decPlaces = 2, style = '', currency = 'USD' } = {}) {
5
5
  const currentLocale = getLocale(locale);
6
6
  if (value !== null && value !== undefined) {
7
- return Number(value).toLocaleString(currentLocale, {
8
- minimumFractionDigits: decPlaces,
9
- maximumFractionDigits: decPlaces
10
- });
7
+ return Number(value).toLocaleString(currentLocale, { minimumFractionDigits: decPlaces, maximumFractionDigits: decPlaces });
11
8
  }
12
9
  return value;
13
10
  }
@@ -15,13 +12,16 @@ function CurrencyFormatter(value, { symbol = true, position = 'before', locale =
15
12
  const currentLocale = getLocale(locale);
16
13
  let formattedValue = value;
17
14
  if (value !== null && value !== undefined && value !== '') {
18
- formattedValue = NumberFormatter(value, {
19
- locale: currentLocale,
20
- decPlaces,
21
- style,
22
- currency
23
- });
24
- let countryCode = currentLocale?.split('-')[1].toUpperCase();
15
+ formattedValue = NumberFormatter(value, { locale: currentLocale, decPlaces, style, currency });
16
+ // For currency other than EUR, we need to determine the country code from currency code
17
+ // If currency is EUR, we use the locale to determine the country code
18
+ let countryCode;
19
+ if (currency !== 'EUR') {
20
+ countryCode = currency.substring(0, 2);
21
+ }
22
+ else {
23
+ countryCode = currentLocale?.split('-')[1].toUpperCase();
24
+ }
25
25
  // If countryCode is still undefined, setting it as US
26
26
  if (!countryCode) {
27
27
  countryCode = 'US';
@@ -58,10 +58,7 @@ export default {
58
58
  Currency: (value, options) => CurrencyFormatter(value, options),
59
59
  'Currency-Code': (value, options) => CurrencyFormatter(value, { ...options, symbol: false }),
60
60
  Decimal: (value, options) => NumberFormatter(value, options),
61
- 'Decimal-Auto': (value, options) => NumberFormatter(value, {
62
- ...options,
63
- decPlaces: Number.isInteger(value) ? 0 : 2
64
- }),
61
+ 'Decimal-Auto': (value, options) => NumberFormatter(value, { ...options, decPlaces: Number.isInteger(value) ? 0 : 2 }),
65
62
  Integer: (value, options) => NumberFormatter(value, { ...options, decPlaces: 0 }),
66
63
  Percentage: (value, options) => SymbolFormatter(value, { ...options, symbol: '%' })
67
64
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Currency.js","sourceRoot":"","sources":["../../../../src/components/helpers/formatters/Currency.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,6DAA6D;AAC7D,SAAS,eAAe,CAAC,KAAK,EAAE,EAAE,MAAM,GAAG,OAAO,EAAE,SAAS,GAAG,CAAC,EAAE,KAAK,GAAG,EAAE,EAAE,QAAQ,GAAG,KAAK,EAAE,GAAG,EAAE;IACpG,MAAM,aAAa,GAAuB,SAAS,CAAC,MAAM,CA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EAAE,KAAK,EAAE,CAAC;IAC5F,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC;IAC5D,cAAc,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CACjC,eAAe,CAAC,KAAK,EAAE;QACrB,GAAG,OAAO;QACV,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAC3C,CAAC;IACJ,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE,EAAE,GAAG,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;IACjF,UAAU,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;CACpF,CAAC","sourcesContent":["import { getLocale } from './common';\nimport CurrencyMap from './CurrencyMap';\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction NumberFormatter(value, { locale = 'en-US', decPlaces = 2, style = '', currency = 'USD' } = {}): string {\n const currentLocale: string | undefined = getLocale(locale);\n if (value !== null && value !== undefined) {\n return Number(value).toLocaleString(currentLocale, {\n minimumFractionDigits: decPlaces,\n maximumFractionDigits: decPlaces\n });\n }\n return value;\n}\n\nfunction CurrencyFormatter(\n value: string,\n { symbol = true, position = 'before', locale = 'en-US', decPlaces = 2, style = 'currency', currency = 'USD' } = {}\n): string {\n const currentLocale: string | undefined = getLocale(locale);\n let formattedValue: string = value;\n if (value !== null && value !== undefined && value !== '') {\n formattedValue = NumberFormatter(value, {\n locale: currentLocale,\n decPlaces,\n style,\n currency\n });\n\n let countryCode: string | undefined = currentLocale?.split('-')[1].toUpperCase();\n\n // If countryCode is still undefined, setting it as US\n if (!countryCode) {\n countryCode = 'US';\n }\n\n let code: string;\n if (symbol) {\n code = CurrencyMap[countryCode]?.symbolFormat;\n } else {\n code = CurrencyMap[countryCode]?.currencyCode;\n }\n\n // if position is provided, change placeholder accordingly.\n if (position && code) {\n if (position.toLowerCase() === 'before' && code.startsWith('{#}')) {\n code = code.slice(3) + code.slice(0, 3);\n } else if (position.toLowerCase() === 'after' && code.indexOf('{#}') === code.length - 3) {\n code = code.slice(-3) + code.slice(0, -3);\n }\n }\n return code?.replace('{#}', formattedValue) || formattedValue;\n }\n return formattedValue;\n}\n\nfunction SymbolFormatter(value, { symbol = '$', suffix = true, locale = 'en-US' } = {}): string {\n let formattedValue: string = value;\n if (value !== null && value !== undefined) {\n formattedValue = NumberFormatter(value, { locale });\n return suffix ? `${formattedValue}${symbol}` : `${symbol}${formattedValue}`;\n }\n return formattedValue;\n}\n\nexport default {\n Currency: (value, options) => CurrencyFormatter(value, options),\n 'Currency-Code': (value, options) => CurrencyFormatter(value, { ...options, symbol: false }),\n Decimal: (value, options) => NumberFormatter(value, options),\n 'Decimal-Auto': (value, options) =>\n NumberFormatter(value, {\n ...options,\n decPlaces: Number.isInteger(value) ? 0 : 2\n }),\n Integer: (value, options) => NumberFormatter(value, { ...options, decPlaces: 0 }),\n Percentage: (value, options) => SymbolFormatter(value, { ...options, symbol: '%' })\n};\n"]}
1
+ {"version":3,"file":"Currency.js","sourceRoot":"","sources":["../../../../src/components/helpers/formatters/Currency.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,6DAA6D;AAC7D,SAAS,eAAe,CAAC,KAAK,EAAE,EAAE,MAAM,GAAG,OAAO,EAAE,SAAS,GAAG,CAAC,EAAE,KAAK,GAAG,EAAE,EAAE,QAAQ,GAAG,KAAK,EAAE,GAAG,EAAE;IACpG,MAAM,aAAa,GAAuB,SAAS,CAAC,MAAM,CAAC,CAAC;IAC5D,IAAI,KAAK,KAAK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AC;IAC9E,CAAC;IACD,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,eAAe;IACb,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,iBAAiB,CAAC,KAAK,EAAE,OAAO,CAAC;IAC/D,eAAe,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,iBAAiB,CAAC,KAAK,EAAE,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAC5F,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC;IAC5D,cAAc,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE,EAAE,GAAG,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACtH,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE,EAAE,GAAG,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;IACjF,UAAU,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;CACpF,CAAC","sourcesContent":["import { getLocale } from './common';\nimport CurrencyMap from './CurrencyMap';\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction NumberFormatter(value, { locale = 'en-US', decPlaces = 2, style = '', currency = 'USD' } = {}): string {\n const currentLocale: string | undefined = getLocale(locale);\n if (value !== null && value !== undefined) {\n return Number(value).toLocaleString(currentLocale, { minimumFractionDigits: decPlaces, maximumFractionDigits: decPlaces });\n }\n return value;\n}\n\nfunction CurrencyFormatter(\n value: string,\n { symbol = true, position = 'before', locale = 'en-US', decPlaces = 2, style = 'currency', currency = 'USD' } = {}\n): string {\n const currentLocale: string | undefined = getLocale(locale);\n let formattedValue: string = value;\n if (value !== null && value !== undefined && value !== '') {\n formattedValue = NumberFormatter(value, { locale: currentLocale, decPlaces, style, currency });\n\n // For currency other than EUR, we need to determine the country code from currency code\n // If currency is EUR, we use the locale to determine the country code\n let countryCode: string | undefined;\n if (currency !== 'EUR') {\n countryCode = currency.substring(0, 2);\n } else {\n countryCode = currentLocale?.split('-')[1].toUpperCase();\n }\n\n // If countryCode is still undefined, setting it as US\n if (!countryCode) {\n countryCode = 'US';\n }\n\n let code: string;\n if (symbol) {\n code = CurrencyMap[countryCode]?.symbolFormat;\n } else {\n code = CurrencyMap[countryCode]?.currencyCode;\n }\n\n // if position is provided, change placeholder accordingly.\n if (position && code) {\n if (position.toLowerCase() === 'before' && code.startsWith('{#}')) {\n code = code.slice(3) + code.slice(0, 3);\n } else if (position.toLowerCase() === 'after' && code.indexOf('{#}') === code.length - 3) {\n code = code.slice(-3) + code.slice(0, -3);\n }\n }\n return code?.replace('{#}', formattedValue) || formattedValue;\n }\n return formattedValue;\n}\n\nfunction SymbolFormatter(value, { symbol = '$', suffix = true, locale = 'en-US' } = {}): string {\n let formattedValue: string = value;\n if (value !== null && value !== undefined) {\n formattedValue = NumberFormatter(value, { locale });\n return suffix ? `${formattedValue}${symbol}` : `${symbol}${formattedValue}`;\n }\n return formattedValue;\n}\n\nexport default {\n Currency: (value, options) => CurrencyFormatter(value, options),\n 'Currency-Code': (value, options) => CurrencyFormatter(value, { ...options, symbol: false }),\n Decimal: (value, options) => NumberFormatter(value, options),\n 'Decimal-Auto': (value, options) => NumberFormatter(value, { ...options, decPlaces: Number.isInteger(value) ? 0 : 2 }),\n Integer: (value, options) => NumberFormatter(value, { ...options, decPlaces: 0 }),\n Percentage: (value, options) => SymbolFormatter(value, { ...options, symbol: '%' })\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Date.js","sourceRoot":"","sources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,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IACpE,WAAW,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAC9B,aAAa,CAAC,KAAK,EAAE;QACnB,GAAG,OAAO;QACV,IAAI,EAAE,cAAc;QACpB,MAAM,EAAE,YAAY;KACrB,CAAC;IACJ,iBAAiB,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACpC,OAAO,KAAK,IAAI,OAAO,IAAI,OAAO,CAAC,QAAQ;YACzC,CAAC,CAAC,aAAa,CAAC,KAAK,EAAE;gBACnB,GAAG,OAAO;gBACV,IAAI,EAAE,cAAc;gBACpB,MAAM,EAAE,qBAAqB;aAC9B,CAAC;YACJ,CAAC,CAAC,KAAK,CAAC;IACZ,CAAC;IACD,mBAAmB,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;IAChH,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,OAAO,EAAE,CAAC;CACrF,CAAC","sourcesContent":["import dayjs from 'dayjs';\nimport relativeTime from 'dayjs/plugin/relativeTime';\nimport localizedFormat from 'dayjs/plugin/localizedFormat';\nimport utc from 'dayjs/plugin/utc';\nimport tzone from 'dayjs/plugin/timezone';\n\ndayjs.extend(relativeTime);\ndayjs.extend(localizedFormat);\ndayjs.extend(utc);\ndayjs.extend(tzone);\n\nconst types = ['fromNow', 'customFormat'];\n\n// value should be in ISO 8601 format.\nfunction DateFormatter(value: string, { type = types[1], format = 'DD/MM/YYYY', timezone = 'America/New_York' } = {}) {\n if (!value) return value;\n switch (type) {\n case types[1]:\n if (timezone) return dayjs(value).tz(timezone).format(format);\n return dayjs(value).format(format);\n case types[0]:\n return dayjs(value).from(dayjs());\n default:\n return value;\n }\n}\n// value should be in hh:mm:ss format (00:00:00 - 23:59:59).\nfunction TimeFormatter(value, options) {\n if (!value) return value;\n const { locale = 'en-US' } = options;\n const timeOnlyRegex = /^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$/;\n if (value.length === 8 && timeOnlyRegex.test(value)) {\n const tempDate = new Date();\n const hours = parseInt(value.substr(0, 2), 10);\n const minutes = parseInt(value.substr(3, 2), 10);\n const seconds = parseInt(value.substr(6, 2), 10);\n tempDate.setHours(hours);\n tempDate.setMinutes(minutes);\n tempDate.setSeconds(seconds);\n return tempDate.toLocaleTimeString(locale);\n }\n return DateFormatter(value, options);\n}\n\nexport default {\n 'DateTime-Long': (value, options) => DateFormatter(value, { ...options, type: 'customFormat', format: 'LLL' }),\n 'DateTime-Short': (value, options) =>\n DateFormatter(value, {\n ...options,\n type: 'customFormat',\n format: 'MMM DD, YYYY'\n }),\n 'DateTime-Since': value => DateFormatter(value, { type: 'fromNow' }),\n 'Time-Only': (value, options) =>\n TimeFormatter(value, {\n ...options,\n type: 'customFormat',\n format: 'hh:mm:ss A'\n }),\n convertToTimezone: (value, options) => {\n return value && options && options.timezone\n ? DateFormatter(value, {\n ...options,\n type: 'customFormat',\n format: 'YYYY-MM-DDTHH:mm:ss'\n })\n : value;\n },\n convertFromTimezone: (value, timezone) => (value && timezone ? dayjs.tz(value, timezone).utc().format() : value),\n Date: (value, options) => DateFormatter(value, { type: 'customFormat', ...options })\n};\n"]}
1
+ {"version":3,"file":"Date.js","sourceRoot":"","sources":["../../../../src/components/helpers/formatters/Date.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,YAAY,MAAM,2BAA2B,CAAC;AACrD,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAC3D,OAAO,GAAG,MAAM,kB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,IAAI,EAAE,cAAc;QACpB,MAAM,EAAE,YAAY;KACrB,CAAC;IACJ,iBAAiB,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACpC,OAAO,KAAK,IAAI,OAAO,IAAI,OAAO,CAAC,QAAQ;YACzC,CAAC,CAAC,aAAa,CAAC,KAAK,EAAE;gBACnB,GAAG,OAAO;gBACV,IAAI,EAAE,cAAc;gBACpB,MAAM,EAAE,qBAAqB;aAC9B,CAAC;YACJ,CAAC,CAAC,KAAK,CAAC;IACZ,CAAC;IACD,mBAAmB,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;IAChH,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,OAAO,EAAE,CAAC;CACrF,CAAC","sourcesContent":["import dayjs from 'dayjs';\nimport relativeTime from 'dayjs/plugin/relativeTime';\nimport localizedFormat from 'dayjs/plugin/localizedFormat';\nimport utc from 'dayjs/plugin/utc';\nimport tzone from 'dayjs/plugin/timezone';\n\ndayjs.extend(relativeTime);\ndayjs.extend(localizedFormat);\ndayjs.extend(utc);\ndayjs.extend(tzone);\n\nconst types = ['fromNow', 'customFormat'];\n\n// value should be in ISO 8601 format.\nfunction DateFormatter(value: string, { type = types[1], format = 'DD/MM/YYYY', timezone = 'America/New_York' } = {}) {\n if (!value) return value;\n switch (type) {\n case types[1]:\n if (timezone) return dayjs(value).tz(timezone).format(format);\n return dayjs(value).format(format);\n case types[0]:\n return dayjs(value).from(dayjs());\n default:\n return value;\n }\n}\n// value should be in hh:mm:ss format (00:00:00 - 23:59:59).\nfunction TimeFormatter(value, options) {\n if (!value) return value;\n const { locale = 'en-US' } = options;\n const timeOnlyRegex = /^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$/;\n if (value.length === 8 && timeOnlyRegex.test(value)) {\n const tempDate = new Date();\n const hours = parseInt(value.substr(0, 2), 10);\n const minutes = parseInt(value.substr(3, 2), 10);\n const seconds = parseInt(value.substr(6, 2), 10);\n tempDate.setHours(hours);\n tempDate.setMinutes(minutes);\n tempDate.setSeconds(seconds);\n return tempDate.toLocaleTimeString(locale);\n }\n return DateFormatter(value, options);\n}\n\nexport default {\n 'DateTime-Long': (value, options) => DateFormatter(value, { ...options, type: 'customFormat', format: 'LLL' }),\n 'DateTime-Short': (value, options) =>\n DateFormatter(value, {\n ...options,\n type: 'customFormat',\n format: 'MMM DD, YYYY'\n }),\n 'DateTime-Since': value => DateFormatter(value, { type: 'fromNow' }),\n 'Time-Only': (value, options) =>\n TimeFormatter(value, {\n ...options,\n type: 'customFormat',\n format: 'hh:mm:ss A'\n }),\n convertToTimezone: (value, options) => {\n return value && options && options.timezone\n ? DateFormatter(value, {\n ...options,\n type: 'customFormat',\n format: 'YYYY-MM-DDTHH:mm:ss'\n })\n : value;\n },\n convertFromTimezone: (value, timezone) => (value && timezone ? dayjs.tz(value, timezone).utc().format() : value),\n Date: (value, options) => DateFormatter(value, { type: 'customFormat', ...options })\n};\n"]}
@@ -1,3 +1,3 @@
1
- export declare function getLocale(locale?: string): string;
2
- export declare function getCurrentTimezone(timezone?: string): any;
1
+ export declare function getLocale(locale?: string): string | undefined;
2
+ export declare function getCurrentTimezone(timezone?: string): string;
3
3
  //# sourceMappingURL=common.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/components/helpers/formatters/common.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CAAC,MAAM,GAAE,MAAW,UAO5C;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,GAAE,MAA2B,OAGvE"}
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/components/helpers/formatters/common.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CAAC,MAAM,GAAE,MAAW,sBAO5C;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,CAAC,EAAE,MAAM,UAInD"}
@@ -8,7 +8,8 @@ export function getLocale(locale = '') {
8
8
  // fallback
9
9
  return Intl.DateTimeFormat().resolvedOptions().locale;
10
10
  }
11
- export function getCurrentTimezone(timezone = 'America/New_York') {
11
+ export function getCurrentTimezone(timezone) {
12
+ // use timezone if specified
12
13
  if (timezone)
13
14
  return timezone;
14
15
  return PCore?.getLocaleUtils?.().getTimeZoneInUse?.();
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/components/helpers/formatters/common.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS,CAAC,SAAiB,EAAE;IAC3C,0BAA0B;IAC1B,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC;IAC1B,iDAAiD;IACjD,IAAI,KAAK,CAAC,kBAAkB,EAAE,CAAC,SAAS,EAAE;QAAE,OAAO,KAAK,CAAC,kBAAkB,EAAE,CAAC,SAAS,EAAE,CAAC;IAC1F,WAAW;IACX,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC,eAAe,EAAE,CAAC,MAAM,CAAC;AACxD,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,WAAmB,kBAAkB;IACtE,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAC9B,OAAO,KAAK,EAAE,cAAc,EAAE,EAAE,CAAC,gBAAgB,EAAE,EAAE,CAAC;AACxD,CAAC","sourcesContent":["export function getLocale(locale: string = '') {\n // use locale if specified\n if (locale) return locale;\n // otherwise, use operator locale if it's defined\n if (PCore.getEnvironmentInfo().getLocale()) return PCore.getEnvironmentInfo().getLocale();\n // fallback\n return Intl.DateTimeFormat().resolvedOptions().locale;\n}\n\nexport function getCurrentTimezone(timezone: string = 'America/New_York') {\n if (timezone) return timezone;\n return PCore?.getLocaleUtils?.().getTimeZoneInUse?.();\n}\n"]}
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/components/helpers/formatters/common.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS,CAAC,SAAiB,EAAE;IAC3C,0BAA0B;IAC1B,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC;IAC1B,iDAAiD;IACjD,IAAI,KAAK,CAAC,kBAAkB,EAAE,CAAC,SAAS,EAAE;QAAE,OAAO,KAAK,CAAC,kBAAkB,EAAE,CAAC,SAAS,EAAE,CAAC;IAC1F,WAAW;IACX,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC,eAAe,EAAE,CAAC,MAAM,CAAC;AACxD,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,QAAiB;IAClD,4BAA4B;IAC5B,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAC9B,OAAO,KAAK,EAAE,cAAc,EAAE,EAAE,CAAC,gBAAgB,EAAE,EAAE,CAAC;AACxD,CAAC","sourcesContent":["export function getLocale(locale: string = '') {\n // use locale if specified\n if (locale) return locale;\n // otherwise, use operator locale if it's defined\n if (PCore.getEnvironmentInfo().getLocale()) return PCore.getEnvironmentInfo().getLocale();\n // fallback\n return Intl.DateTimeFormat().resolvedOptions().locale;\n}\n\nexport function getCurrentTimezone(timezone?: string) {\n // use timezone if specified\n if (timezone) return timezone;\n return PCore?.getLocaleUtils?.().getTimeZoneInUse?.();\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/helpers/formatters/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAKA,wBAIE;AAmDF,wBAAgB,MAAM,CAAC,KAAK,KAAA,EAAE,IAAI,KAAA,EAAE,OAAO,KAAK,GAAG,MAAM,CAuExD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/helpers/formatters/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAKA,wBAIE;AAiDF,wBAAgB,MAAM,CAAC,KAAK,KAAA,EAAE,IAAI,KAAA,EAAE,OAAO,KAAK,GAAG,MAAM,CAuExD"}
@@ -15,9 +15,8 @@ function getDateObject(text) {
15
15
  const month = parseInt(timeStamp.substr(4, 2), 10) - 1;
16
16
  const day = parseInt(timeStamp.substr(6, 2), 10);
17
17
  const date = new Date();
18
- date.setDate(day);
19
- date.setMonth(month);
20
- date.setFullYear(year);
18
+ // Fix to handle all the dates, raised via https://github.com/pegasystems/react-sdk-components/issues/442
19
+ date.setFullYear(year, month, day);
21
20
  if (isDateTime) {
22
21
  const hours = parseInt(timeStamp.substr(9, 2), 10);
23
22
  const minutes = parseInt(timeStamp.substr(11, 2), 10);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/helpers/formatters/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,aAAa,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAEzD,eAAe;IACb,GAAG,OAAO;IACV,GAAG,QAAQ;IACX,GAAG,aAAa;CACjB,CAAC;AAEF,SAAS,aAAa,CAAC,IAAI;IACzB,4FAA4F;IAC5F,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACzC,MAAM,UAAU,GAAG,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IACnD,MAAM,IAAI,GAAG,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAClD,MAAM,KAAK,GAAG,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,CAA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M;SACP;QAED,KAAK,SAAS,CAAC;QACf,KAAK,UAAU,CAAC,CAAC;YACf,cAAc,GAAG,OAAO,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;YAC7E,MAAM;SACP;QAED,KAAK,eAAe,CAAC,CAAC;YACpB,cAAc,GAAG,KAAK,CAAC,QAAQ,CAAC;YAChC,MAAM;SACP;QAED;YACE,cAAc,GAAG,KAAK,CAAC;KAC1B;IACD,OAAO,cAAc,CAAC;AACxB,CAAC","sourcesContent":["import Boolean from './Boolean';\nimport Currency from './Currency';\nimport DateFormatter from './Date';\nimport { getCurrentTimezone, getLocale } from './common';\n\nexport default {\n ...Boolean,\n ...Currency,\n ...DateFormatter\n};\n\nfunction getDateObject(text): Date {\n // TODO - cleanup formatters util functions as DX APIs are returning values per ISO std now.\n const timeStamp = text.replace(/-/g, '');\n const isDateTime = timeStamp.indexOf('GMT') !== -1;\n const year = parseInt(timeStamp.substr(0, 4), 10);\n const month = parseInt(timeStamp.substr(4, 2), 10) - 1;\n const day = parseInt(timeStamp.substr(6, 2), 10);\n\n const date = new Date();\n\n date.setDate(day);\n date.setMonth(month);\n date.setFullYear(year);\n\n if (isDateTime) {\n const hours = parseInt(timeStamp.substr(9, 2), 10);\n const minutes = parseInt(timeStamp.substr(11, 2), 10);\n const seconds = parseInt(timeStamp.substr(13, 2), 10);\n const ms = parseInt(timeStamp.substr(16, 3), 10);\n date.setHours(hours);\n date.setMinutes(minutes);\n date.setSeconds(seconds);\n date.setMilliseconds(ms);\n }\n\n return date;\n}\n\nfunction isIsoDate(str) {\n if (!/\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z/.test(str)) return false;\n const d = new Date(str);\n return d.toISOString() === str;\n}\n\nfunction parseDateInISO(value) {\n const isMilliSeconds = /^[0-9]+$/.exec(value);\n if (isMilliSeconds) {\n const date = new Date(parseInt(value, 10));\n return date.toISOString();\n }\n\n if (isIsoDate(value)) {\n const date = new Date(value);\n return date.toISOString();\n }\n\n return value ? getDateObject(value).toISOString() : value;\n}\n\nexport function format(value, type, options = {}): string {\n let formattedValue: string;\n\n switch (type?.toLowerCase()) {\n case 'currency': {\n const defaultOptions = {\n locale: getLocale(),\n position: 'before',\n decPlaces: 2\n };\n const params = { ...defaultOptions, ...options };\n formattedValue = Currency.Currency(value, params);\n break;\n }\n\n case 'decimal': {\n const defaultOptions = { locale: getLocale(), decPlaces: 2 };\n const params = { ...defaultOptions, ...options };\n formattedValue = Currency.Decimal(value, params);\n break;\n }\n\n case 'percentage': {\n const defaultOptions = { locale: getLocale(), decPlaces: 2 };\n const params = { ...defaultOptions, ...options };\n formattedValue = Currency.Percentage(value, params);\n break;\n }\n\n case 'integer': {\n const defaultOptions = { locale: getLocale() };\n const params = { ...defaultOptions, ...options };\n formattedValue = Currency.Integer(value, params);\n break;\n }\n\n case 'date': {\n const defaultOptions = {\n format: 'MMM DD, YYYY',\n timezone: getCurrentTimezone()\n };\n const params = { ...defaultOptions, ...options };\n formattedValue = DateFormatter.Date(parseDateInISO(value), params);\n break;\n }\n\n case 'datetime': {\n const defaultOptions = {\n format: 'MMM DD, YYYY h:mm A',\n timezone: getCurrentTimezone()\n };\n const params = { ...defaultOptions, ...options };\n formattedValue = DateFormatter.Date(parseDateInISO(value), params);\n break;\n }\n\n case 'boolean':\n case 'checkbox': {\n formattedValue = Boolean.TrueFalse(value, { allowEmpty: false, ...options });\n break;\n }\n\n case 'userreference': {\n formattedValue = value.userName;\n break;\n }\n\n default:\n formattedValue = value;\n }\n return formattedValue;\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/helpers/formatters/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,aAAa,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,kBAAk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BACrB,MAAM,EAAE,cAAc;gBACtB,QAAQ,EAAE,kBAAkB,EAAE;aAC/B,CAAC;YACF,MAAM,MAAM,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,OAAO,EAAE,CAAC;YACjD,cAAc,GAAG,aAAa,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC;YACnE,MAAM;QACR,CAAC;QAED,KAAK,UAAU,CAAC,CAAC,CAAC;YAChB,MAAM,cAAc,GAAG;gBACrB,MAAM,EAAE,qBAAqB;gBAC7B,QAAQ,EAAE,kBAAkB,EAAE;aAC/B,CAAC;YACF,MAAM,MAAM,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,OAAO,EAAE,CAAC;YACjD,cAAc,GAAG,aAAa,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC;YACnE,MAAM;QACR,CAAC;QAED,KAAK,SAAS,CAAC;QACf,KAAK,UAAU,CAAC,CAAC,CAAC;YAChB,cAAc,GAAG,OAAO,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;YAC7E,MAAM;QACR,CAAC;QAED,KAAK,eAAe,CAAC,CAAC,CAAC;YACrB,cAAc,GAAG,KAAK,CAAC,QAAQ,CAAC;YAChC,MAAM;QACR,CAAC;QAED;YACE,cAAc,GAAG,KAAK,CAAC;IAC3B,CAAC;IACD,OAAO,cAAc,CAAC;AACxB,CAAC","sourcesContent":["import Boolean from './Boolean';\nimport Currency from './Currency';\nimport DateFormatter from './Date';\nimport { getCurrentTimezone, getLocale } from './common';\n\nexport default {\n ...Boolean,\n ...Currency,\n ...DateFormatter\n};\n\nfunction getDateObject(text): Date {\n // TODO - cleanup formatters util functions as DX APIs are returning values per ISO std now.\n const timeStamp = text.replace(/-/g, '');\n const isDateTime = timeStamp.indexOf('GMT') !== -1;\n const year = parseInt(timeStamp.substr(0, 4), 10);\n const month = parseInt(timeStamp.substr(4, 2), 10) - 1;\n const day = parseInt(timeStamp.substr(6, 2), 10);\n\n const date = new Date();\n // Fix to handle all the dates, raised via https://github.com/pegasystems/react-sdk-components/issues/442\n date.setFullYear(year, month, day);\n\n if (isDateTime) {\n const hours = parseInt(timeStamp.substr(9, 2), 10);\n const minutes = parseInt(timeStamp.substr(11, 2), 10);\n const seconds = parseInt(timeStamp.substr(13, 2), 10);\n const ms = parseInt(timeStamp.substr(16, 3), 10);\n date.setHours(hours);\n date.setMinutes(minutes);\n date.setSeconds(seconds);\n date.setMilliseconds(ms);\n }\n\n return date;\n}\n\nfunction isIsoDate(str) {\n if (!/\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z/.test(str)) return false;\n const d = new Date(str);\n return d.toISOString() === str;\n}\n\nfunction parseDateInISO(value) {\n const isMilliSeconds = /^[0-9]+$/.exec(value);\n if (isMilliSeconds) {\n const date = new Date(parseInt(value, 10));\n return date.toISOString();\n }\n\n if (isIsoDate(value)) {\n const date = new Date(value);\n return date.toISOString();\n }\n\n return value ? getDateObject(value).toISOString() : value;\n}\n\nexport function format(value, type, options = {}): string {\n let formattedValue: string;\n\n switch (type?.toLowerCase()) {\n case 'currency': {\n const defaultOptions = {\n locale: getLocale(),\n position: 'before',\n decPlaces: 2\n };\n const params = { ...defaultOptions, ...options };\n formattedValue = Currency.Currency(value, params);\n break;\n }\n\n case 'decimal': {\n const defaultOptions = { locale: getLocale(), decPlaces: 2 };\n const params = { ...defaultOptions, ...options };\n formattedValue = Currency.Decimal(value, params);\n break;\n }\n\n case 'percentage': {\n const defaultOptions = { locale: getLocale(), decPlaces: 2 };\n const params = { ...defaultOptions, ...options };\n formattedValue = Currency.Percentage(value, params);\n break;\n }\n\n case 'integer': {\n const defaultOptions = { locale: getLocale() };\n const params = { ...defaultOptions, ...options };\n formattedValue = Currency.Integer(value, params);\n break;\n }\n\n case 'date': {\n const defaultOptions = {\n format: 'MMM DD, YYYY',\n timezone: getCurrentTimezone()\n };\n const params = { ...defaultOptions, ...options };\n formattedValue = DateFormatter.Date(parseDateInISO(value), params);\n break;\n }\n\n case 'datetime': {\n const defaultOptions = {\n format: 'MMM DD, YYYY h:mm A',\n timezone: getCurrentTimezone()\n };\n const params = { ...defaultOptions, ...options };\n formattedValue = DateFormatter.Date(parseDateInISO(value), params);\n break;\n }\n\n case 'boolean':\n case 'checkbox': {\n formattedValue = Boolean.TrueFalse(value, { allowEmpty: false, ...options });\n break;\n }\n\n case 'userreference': {\n formattedValue = value.userName;\n break;\n }\n\n default:\n formattedValue = value;\n }\n return formattedValue;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"instructions-utils.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/instructions-utils.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,oBAAoB,4CAOzB,CAAC;AAEF,QAAA,MAAM,iBAAiB,6FAYtB,CAAC;AAEF,QAAA,MAAM,iBAAiB,0EAMtB,CAAC;AAEF,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,CAAC"}
1
+ {"version":3,"file":"instructions-utils.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/instructions-utils.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,oBAAoB,GAAI,YAAO,EAAE,kBAAa,SAOnD,CAAC;AAEF,QAAA,MAAM,iBAAiB,GAAI,YAAO,EAAE,kBAAa,EAAE,iBAAY,EAAE,iBAAY,EAAE,SAAI,SAYlF,CAAC;AAEF,QAAA,MAAM,iBAAiB,GAAI,YAAO,EAAE,kBAAa,EAAE,iBAAY,EAAE,SAAI,SAMpE,CAAC;AAEF,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,CAAC"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const NavContext: import("react").Context<{
3
2
  open: boolean;
4
3
  setOpen: (f: any) => any;
@@ -1 +1 @@
1
- {"version":3,"file":"reactContextHelpers.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/reactContextHelpers.ts"],"names":[],"mappings":";AAQA,eAAO,MAAM,UAAU;;;EAAkD,CAAC;AAC1E,eAAO,MAAM,SAAS;;;CAA+B,CAAC"}
1
+ {"version":3,"file":"reactContextHelpers.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/reactContextHelpers.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,UAAU;;;EAAkD,CAAC;AAC1E,eAAO,MAAM,SAAS;;;CAA+B,CAAC"}
@@ -62,7 +62,7 @@ export declare const createMetaForTable: (fields: any, renderMode: any) => {
62
62
  footer: boolean;
63
63
  filterExpression: null;
64
64
  editing: boolean;
65
- timezone: string;
65
+ timezone: string | undefined;
66
66
  };
67
67
  /**
68
68
  * This method returns a callBack function for Add action.
@@ -1 +1 @@
1
- {"version":3,"file":"simpleTableHelpers.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/simpleTableHelpers.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,gBAAgB,CAAC;AACxC,eAAO,MAAM,WAAW,eAAe,CAAC;AAwCxC,eAAO,MAAM,UAAU;;;;CAkBtB,CAAC;AAEF,eAAO,MAAM,cAAc,uBAI1B,CAAC;AAEF,eAAO,MAAM,aAAa;;;;CAoBzB,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmChC,CAAC;AAEF,eAAO,MAAM,mBAAmB,gEAmC/B,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;CAuB9B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,0CAE7B,CAAC;AAEF;;;;;GAKG;AAGH,wBAAgB,cAAc,CAAC,WAAW,KAAA,EAAE,aAAa,KAAA,EAAE,aAAa,KAAA,GAAG,GAAG,CAY7E;AAED,eAAO,MAAM,UAAU,kDAsHtB,CAAC"}
1
+ {"version":3,"file":"simpleTableHelpers.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/simpleTableHelpers.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,gBAAgB,CAAC;AACxC,eAAO,MAAM,WAAW,eAAe,CAAC;AAwCxC,eAAO,MAAM,UAAU,GAAG,aAAQ;;;;CAkBjC,CAAC;AAEF,eAAO,MAAM,cAAc,GAAG,YAAO,QAIpC,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,kBAAa,EAAE,aAAQ,EAAE,cAAS;;;;CAoB/D,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,kBAAa,EAAE,WAAM,EAAE,SAAI,EAAE,cAAS,EAAE,SAAI,EAAE,kBAAa,EAAE,iBAAY,EAAE,eAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCzH,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,iBAAY,EAAE,WAAM,EAAE,qBAAgB,QAmCzE,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,WAAM,EAAE,eAAU;;;;;;;;;;;;;;;;;;;;;CAuBpD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,aAAQ,EAAE,UAAK,cAEhD,CAAC;AAEF;;;;;GAKG;AAGH,wBAAgB,cAAc,CAAC,WAAW,KAAA,EAAE,aAAa,KAAA,EAAE,aAAa,KAAA,GAAG,GAAG,CAY7E;AAED,eAAO,MAAM,UAAU,GAAG,oBAAe,MACT,SAAI,YAqHnC,CAAC"}
@@ -213,7 +213,7 @@ export const filterData = filterByColumns => {
213
213
  case 'Date':
214
214
  case 'DateTime':
215
215
  case 'Time':
216
- value = item[filterObj.ref] !== null ?? item[filterObj.ref] !== '' ? Utils.getSeconds(item[filterObj.ref]) : null;
216
+ value = item[filterObj.ref] !== null || item[filterObj.ref] !== '' ? Utils.getSeconds(item[filterObj.ref]) : null;
217
217
  filterValue =
218
218
  filterObj.containsFilterValue !== null && filterObj.containsFilterValue !== '' ? Utils.getSeconds(filterObj.containsFilterValue) : null;
219
219
  // eslint-disable-next-line sonarjs/no-nested-switch
@@ -1 +1 @@
1
- {"version":3,"file":"simpleTableHelpers.js","sourceRoot":"","sources":["../../../src/components/helpers/simpleTableHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,MAAM,CAAC,MAAM,UAAU,GAAG,aAAa,CAAC;AACxC,MAAM,CAAC,MAAM,WAAW,GAAG,YAAY,CAAC;AAExC,4EAA4E;AAC5E,0BAA0B;AAC1B,SAAS,aAAa,CAAC,KAAK,EAAE,KAAK;IACjC,IAAI,KAAa,CAAC;IAClB,QAAQ,KAAK,CAAC,IAAI,EAAE;QAClB,KAAK,MAAM;YACT,KAAK,GAAG,GAAG,CAAC;YACZ,MAAM;QACR,KAAK,MAAM;YACT,KAAK,GAAG,GAAG,CAAC;YACZ,MAAM;QACR,KAAK,UAAU;YACb,KAAK,GAAG,GAAG,CAAC;YACZ,MAAM;QACR,KAAK,cAAc,CAAC;QACpB,KAAK,UAAU;YACb,KAAK,GAAG,GAAG,CAAC;YACZ,MAAM;QACR,KAAK,UAAU,CAAC;QAChB,KAAK,WAAW;YACd,KAAK,GAAG,GAAG,CAAC;YACZ,MAAM;QACR,KAAK,UAAU;YACb,gDAAgD;YAChD,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;YAC5C,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YAChC,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC;YAC7B,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC;YACjC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;YACvB,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC;YACzC,QAAQ,CAAC,IAAI,CAAC,WAAW,CA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AAK,KAAK,WAAW,EAAE;oCACzB,KAAK,GAAG,KAAK,CAAC;iCACf;gCACD,MAAM;4BAER,KAAK,YAAY;gCACf,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE;oCACpC,KAAK,GAAG,KAAK,CAAC;iCACf;gCACD,MAAM;4BAER;gCACE,MAAM;yBACT;wBAED,MAAM;iBACT;aACF;YAED,+BAA+B;YAC/B,IAAI,CAAC,KAAK,EAAE;gBACV,MAAM;aACP;SACF;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Utils } from './utils';\n\nexport const TABLE_CELL = 'SdkRenderer';\nexport const DELETE_ICON = 'DeleteIcon';\n\n// BUG-615253: Workaround for autosize in table with lazy loading components\n/* istanbul ignore next */\nfunction getFieldWidth(field, label) {\n let width: number;\n switch (field.type) {\n case 'Time':\n width = 150;\n break;\n case 'Date':\n width = 160;\n break;\n case 'DateTime':\n width = 205;\n break;\n case 'AutoComplete':\n case 'TextArea':\n width = 190;\n break;\n case 'Currency':\n case 'TextInput':\n width = 182;\n break;\n case 'Checkbox':\n // eslint-disable-next-line no-case-declarations\n const text = document.createElement('span');\n document.body.appendChild(text);\n text.style.fontSize = '13px';\n text.style.position = 'absolute';\n text.innerHTML = label;\n width = Math.ceil(text.clientWidth) + 30;\n document.body.removeChild(text);\n break;\n default:\n width = 180;\n }\n return width;\n}\n\nexport const getContext = thePConn => {\n const contextName = thePConn.getContextName();\n const pageReference = thePConn.getPageReference();\n const { referenceList } = thePConn.getStateProps()?.config || thePConn.getStateProps();\n const pageReferenceForRows = referenceList.startsWith('.') ? `${pageReference}.${referenceList.substring(1)}` : referenceList;\n\n // removing \"caseInfo.content\" prefix to avoid setting it as a target while preparing pageInstructions\n // skipping the removal as StateMachine itself is removing this case info prefix while preparing pageInstructions\n // referenceList = pageReferenceForRows.replace(\n // PCore.getConstants().CASE_INFO.CASE_INFO_CONTENT,\n // \"\"\n // );\n\n return {\n contextName,\n referenceListStr: referenceList,\n pageReferenceForRows\n };\n};\n\nexport const populateRowKey = rawData => {\n return rawData.map((row: any, index: number) => {\n return { ...row, index };\n });\n};\n\nexport const getApiContext = (processedData, pConnect, reorderCB) => {\n return {\n fetchData: () => {\n return new Promise(resolve => {\n resolve({\n data: processedData,\n filteredRecordCount: processedData.length,\n totalRecordCount: processedData.length\n });\n });\n },\n fetchPersonalizations: () => {\n return Promise.resolve({});\n },\n applyRowReorder: (sourceKey, destinationKey) => {\n // indexes are keys for simple table so, it should work.\n reorderCB();\n return Promise.resolve(pConnect.getListActions().reorder(parseInt(sourceKey, 10), parseInt(destinationKey, 10)));\n }\n };\n};\n\nexport const buildMetaForListView = (fieldMetadata, fields, type, ruleClass, name, propertyLabel, isDataObject, parameters) => {\n return {\n name,\n config: {\n type,\n referenceList: fieldMetadata.datasource.name,\n parameters: parameters ?? fieldMetadata.datasource.parameters,\n personalization: false,\n isDataObject,\n grouping: true,\n globalSearch: true,\n reorderFields: true,\n toggleFieldVisibility: true,\n title: propertyLabel,\n personalizationId: '' /* TODO */,\n template: 'ListView',\n presets: [\n {\n name: 'presets',\n template: 'Table',\n config: {},\n children: [\n {\n name: 'Columns',\n type: 'Region',\n children: fields\n }\n ],\n label: propertyLabel,\n id: 'P_' /* TODO */\n }\n ],\n ruleClass\n }\n };\n};\n\nexport const buildFieldsForTable = (configFields, fields, showDeleteButton) => {\n const fieldDefs = configFields.map((field, index) => {\n return {\n type: 'text',\n label: fields[index].config.label || fields[index].config.caption,\n fillAvailableSpace: !!field.config.fillAvailableSpace,\n id: `${index}`,\n name: field.config.value.substr(4),\n cellRenderer: TABLE_CELL,\n sort: false,\n noContextMenu: true,\n showMenu: false,\n meta: {\n ...field\n },\n // BUG-615253: Workaround for autosize in table with lazy loading components\n width: getFieldWidth(field, fields[index].config.label)\n };\n });\n\n // ONLY add DELETE_ICON to fields when the table is requested as EDITABLE\n if (showDeleteButton) {\n fieldDefs.push({\n type: 'text',\n id: fieldDefs.length,\n cellRenderer: DELETE_ICON,\n sort: false,\n noContextMenu: true,\n showMenu: false,\n // BUG-615253: Workaround for autosize in table with lazy loading components\n width: 46\n });\n }\n\n return fieldDefs;\n};\n\nexport const createMetaForTable = (fields, renderMode) => {\n return {\n height: {\n minHeight: 'auto',\n fitHeightToElement: 'fitHeightToElement',\n deltaAdjustment: 'deltaAdjustment',\n autoSize: true\n },\n fieldDefs: fields,\n itemKey: 'index',\n grouping: false,\n reorderFields: false,\n reorderItems: renderMode === 'Editable',\n dragHandle: renderMode === 'Editable',\n globalSearch: false,\n personalization: false,\n toggleFieldVisibility: false,\n toolbar: false,\n footer: false,\n filterExpression: null,\n editing: false,\n timezone: PCore.getEnvironmentInfo().getTimeZone()\n };\n};\n\n/**\n * This method returns a callBack function for Add action.\n * @param {object} pConnect - PConnect object\n * @param {number} index - index of the page list to add\n */\nexport const getAddRowCallback = (pConnect, index) => {\n return () => pConnect.getListActions().insert({}, index, ''); // 3rd arg null until typedef marked correctly as optional\n};\n\n/**\n * This method creates a PConnect object with proper options for Add and Delete actions\n * @param {string} contextName - contextName\n * @param {string} referenceList - referenceList\n * @param {string} pageReference - pageReference\n */\n// NOTE: use of type \"any\" is required since TypeScript doesn't allow private/protected properties\n// to be exported from a class (TS4094 error)\nexport function createPConnect(contextName, referenceList, pageReference): any {\n const options = {\n context: contextName,\n pageReference,\n referenceList\n };\n\n // create PConnect object\n const config = { meta: {}, options };\n const { getPConnect } = PCore.createPConnect(config);\n\n return getPConnect();\n}\n\nexport const filterData = filterByColumns => {\n return function filteringData(item) {\n let bKeep = true;\n for (const filterObj of filterByColumns) {\n if (filterObj.containsFilterValue !== '' || filterObj.containsFilter === 'null' || filterObj.containsFilter === 'notnull') {\n let value: any;\n let filterValue: any;\n\n switch (filterObj.type) {\n case 'Date':\n case 'DateTime':\n case 'Time':\n value = item[filterObj.ref] !== null ?? item[filterObj.ref] !== '' ? Utils.getSeconds(item[filterObj.ref]) : null;\n filterValue =\n filterObj.containsFilterValue !== null && filterObj.containsFilterValue !== '' ? Utils.getSeconds(filterObj.containsFilterValue) : null;\n\n // eslint-disable-next-line sonarjs/no-nested-switch\n switch (filterObj.containsFilter) {\n case 'notequal':\n // becasue filterValue is in minutes, need to have a range of less than 60 secons\n\n if (value !== null && filterValue !== null) {\n // get rid of milliseconds\n value /= 1000;\n filterValue /= 1000;\n\n const diff = value - filterValue;\n if (diff >= 0 && diff < 60) {\n bKeep = false;\n }\n }\n\n break;\n\n case 'equal':\n // becasue filterValue is in minutes, need to have a range of less than 60 secons\n\n if (value !== null && filterValue !== null) {\n // get rid of milliseconds\n value /= 1000;\n filterValue /= 1000;\n\n const diff = value - filterValue;\n if (diff !== 0) {\n bKeep = false;\n }\n }\n\n break;\n\n case 'after':\n if (value < filterValue) {\n bKeep = false;\n }\n break;\n\n case 'before':\n if (value > filterValue) {\n bKeep = false;\n }\n break;\n\n case 'null':\n if (value !== null) {\n bKeep = false;\n }\n break;\n\n case 'notnull':\n if (value === null) {\n bKeep = false;\n }\n break;\n\n default:\n break;\n }\n break;\n\n default:\n value = item[filterObj.ref].toLowerCase();\n filterValue = filterObj.containsFilterValue.toLowerCase();\n\n // eslint-disable-next-line sonarjs/no-nested-switch\n switch (filterObj.containsFilter) {\n case 'contains':\n if (value.indexOf(filterValue) < 0) {\n bKeep = false;\n }\n break;\n\n case 'equals':\n if (value !== filterValue) {\n bKeep = false;\n }\n break;\n\n case 'startswith':\n if (value.indexOf(filterValue) !== 0) {\n bKeep = false;\n }\n break;\n\n default:\n break;\n }\n\n break;\n }\n }\n\n // if don't keep stop filtering\n if (!bKeep) {\n break;\n }\n }\n return bKeep;\n };\n};\n"]}
1
+ {"version":3,"file":"simpleTableHelpers.js","sourceRoot":"","sources":["../../../src/components/helpers/simpleTableHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,MAAM,CAAC,MAAM,UAAU,GAAG,aAAa,CAAC;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AK,YAAY;gCACf,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;oCACrC,KAAK,GAAG,KAAK,CAAC;gCAChB,CAAC;gCACD,MAAM;4BAER;gCACE,MAAM;wBACV,CAAC;wBAED,MAAM;gBACV,CAAC;YACH,CAAC;YAED,+BAA+B;YAC/B,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,MAAM;YACR,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Utils } from './utils';\n\nexport const TABLE_CELL = 'SdkRenderer';\nexport const DELETE_ICON = 'DeleteIcon';\n\n// BUG-615253: Workaround for autosize in table with lazy loading components\n/* istanbul ignore next */\nfunction getFieldWidth(field, label) {\n let width: number;\n switch (field.type) {\n case 'Time':\n width = 150;\n break;\n case 'Date':\n width = 160;\n break;\n case 'DateTime':\n width = 205;\n break;\n case 'AutoComplete':\n case 'TextArea':\n width = 190;\n break;\n case 'Currency':\n case 'TextInput':\n width = 182;\n break;\n case 'Checkbox':\n // eslint-disable-next-line no-case-declarations\n const text = document.createElement('span');\n document.body.appendChild(text);\n text.style.fontSize = '13px';\n text.style.position = 'absolute';\n text.innerHTML = label;\n width = Math.ceil(text.clientWidth) + 30;\n document.body.removeChild(text);\n break;\n default:\n width = 180;\n }\n return width;\n}\n\nexport const getContext = thePConn => {\n const contextName = thePConn.getContextName();\n const pageReference = thePConn.getPageReference();\n const { referenceList } = thePConn.getStateProps()?.config || thePConn.getStateProps();\n const pageReferenceForRows = referenceList.startsWith('.') ? `${pageReference}.${referenceList.substring(1)}` : referenceList;\n\n // removing \"caseInfo.content\" prefix to avoid setting it as a target while preparing pageInstructions\n // skipping the removal as StateMachine itself is removing this case info prefix while preparing pageInstructions\n // referenceList = pageReferenceForRows.replace(\n // PCore.getConstants().CASE_INFO.CASE_INFO_CONTENT,\n // \"\"\n // );\n\n return {\n contextName,\n referenceListStr: referenceList,\n pageReferenceForRows\n };\n};\n\nexport const populateRowKey = rawData => {\n return rawData.map((row: any, index: number) => {\n return { ...row, index };\n });\n};\n\nexport const getApiContext = (processedData, pConnect, reorderCB) => {\n return {\n fetchData: () => {\n return new Promise(resolve => {\n resolve({\n data: processedData,\n filteredRecordCount: processedData.length,\n totalRecordCount: processedData.length\n });\n });\n },\n fetchPersonalizations: () => {\n return Promise.resolve({});\n },\n applyRowReorder: (sourceKey, destinationKey) => {\n // indexes are keys for simple table so, it should work.\n reorderCB();\n return Promise.resolve(pConnect.getListActions().reorder(parseInt(sourceKey, 10), parseInt(destinationKey, 10)));\n }\n };\n};\n\nexport const buildMetaForListView = (fieldMetadata, fields, type, ruleClass, name, propertyLabel, isDataObject, parameters) => {\n return {\n name,\n config: {\n type,\n referenceList: fieldMetadata.datasource.name,\n parameters: parameters ?? fieldMetadata.datasource.parameters,\n personalization: false,\n isDataObject,\n grouping: true,\n globalSearch: true,\n reorderFields: true,\n toggleFieldVisibility: true,\n title: propertyLabel,\n personalizationId: '' /* TODO */,\n template: 'ListView',\n presets: [\n {\n name: 'presets',\n template: 'Table',\n config: {},\n children: [\n {\n name: 'Columns',\n type: 'Region',\n children: fields\n }\n ],\n label: propertyLabel,\n id: 'P_' /* TODO */\n }\n ],\n ruleClass\n }\n };\n};\n\nexport const buildFieldsForTable = (configFields, fields, showDeleteButton) => {\n const fieldDefs = configFields.map((field, index) => {\n return {\n type: 'text',\n label: fields[index].config.label || fields[index].config.caption,\n fillAvailableSpace: !!field.config.fillAvailableSpace,\n id: `${index}`,\n name: field.config.value.substr(4),\n cellRenderer: TABLE_CELL,\n sort: false,\n noContextMenu: true,\n showMenu: false,\n meta: {\n ...field\n },\n // BUG-615253: Workaround for autosize in table with lazy loading components\n width: getFieldWidth(field, fields[index].config.label)\n };\n });\n\n // ONLY add DELETE_ICON to fields when the table is requested as EDITABLE\n if (showDeleteButton) {\n fieldDefs.push({\n type: 'text',\n id: fieldDefs.length,\n cellRenderer: DELETE_ICON,\n sort: false,\n noContextMenu: true,\n showMenu: false,\n // BUG-615253: Workaround for autosize in table with lazy loading components\n width: 46\n });\n }\n\n return fieldDefs;\n};\n\nexport const createMetaForTable = (fields, renderMode) => {\n return {\n height: {\n minHeight: 'auto',\n fitHeightToElement: 'fitHeightToElement',\n deltaAdjustment: 'deltaAdjustment',\n autoSize: true\n },\n fieldDefs: fields,\n itemKey: 'index',\n grouping: false,\n reorderFields: false,\n reorderItems: renderMode === 'Editable',\n dragHandle: renderMode === 'Editable',\n globalSearch: false,\n personalization: false,\n toggleFieldVisibility: false,\n toolbar: false,\n footer: false,\n filterExpression: null,\n editing: false,\n timezone: PCore.getEnvironmentInfo().getTimeZone()\n };\n};\n\n/**\n * This method returns a callBack function for Add action.\n * @param {object} pConnect - PConnect object\n * @param {number} index - index of the page list to add\n */\nexport const getAddRowCallback = (pConnect, index) => {\n return () => pConnect.getListActions().insert({}, index, ''); // 3rd arg null until typedef marked correctly as optional\n};\n\n/**\n * This method creates a PConnect object with proper options for Add and Delete actions\n * @param {string} contextName - contextName\n * @param {string} referenceList - referenceList\n * @param {string} pageReference - pageReference\n */\n// NOTE: use of type \"any\" is required since TypeScript doesn't allow private/protected properties\n// to be exported from a class (TS4094 error)\nexport function createPConnect(contextName, referenceList, pageReference): any {\n const options = {\n context: contextName,\n pageReference,\n referenceList\n };\n\n // create PConnect object\n const config = { meta: {}, options };\n const { getPConnect } = PCore.createPConnect(config);\n\n return getPConnect();\n}\n\nexport const filterData = filterByColumns => {\n return function filteringData(item) {\n let bKeep = true;\n for (const filterObj of filterByColumns) {\n if (filterObj.containsFilterValue !== '' || filterObj.containsFilter === 'null' || filterObj.containsFilter === 'notnull') {\n let value: any;\n let filterValue: any;\n\n switch (filterObj.type) {\n case 'Date':\n case 'DateTime':\n case 'Time':\n value = item[filterObj.ref] !== null || item[filterObj.ref] !== '' ? Utils.getSeconds(item[filterObj.ref]) : null;\n filterValue =\n filterObj.containsFilterValue !== null && filterObj.containsFilterValue !== '' ? Utils.getSeconds(filterObj.containsFilterValue) : null;\n\n // eslint-disable-next-line sonarjs/no-nested-switch\n switch (filterObj.containsFilter) {\n case 'notequal':\n // becasue filterValue is in minutes, need to have a range of less than 60 secons\n\n if (value !== null && filterValue !== null) {\n // get rid of milliseconds\n value /= 1000;\n filterValue /= 1000;\n\n const diff = value - filterValue;\n if (diff >= 0 && diff < 60) {\n bKeep = false;\n }\n }\n\n break;\n\n case 'equal':\n // becasue filterValue is in minutes, need to have a range of less than 60 secons\n\n if (value !== null && filterValue !== null) {\n // get rid of milliseconds\n value /= 1000;\n filterValue /= 1000;\n\n const diff = value - filterValue;\n if (diff !== 0) {\n bKeep = false;\n }\n }\n\n break;\n\n case 'after':\n if (value < filterValue) {\n bKeep = false;\n }\n break;\n\n case 'before':\n if (value > filterValue) {\n bKeep = false;\n }\n break;\n\n case 'null':\n if (value !== null) {\n bKeep = false;\n }\n break;\n\n case 'notnull':\n if (value === null) {\n bKeep = false;\n }\n break;\n\n default:\n break;\n }\n break;\n\n default:\n value = item[filterObj.ref].toLowerCase();\n filterValue = filterObj.containsFilterValue.toLowerCase();\n\n // eslint-disable-next-line sonarjs/no-nested-switch\n switch (filterObj.containsFilter) {\n case 'contains':\n if (value.indexOf(filterValue) < 0) {\n bKeep = false;\n }\n break;\n\n case 'equals':\n if (value !== filterValue) {\n bKeep = false;\n }\n break;\n\n case 'startswith':\n if (value.indexOf(filterValue) !== 0) {\n bKeep = false;\n }\n break;\n\n default:\n break;\n }\n\n break;\n }\n }\n\n // if don't keep stop filtering\n if (!bKeep) {\n break;\n }\n }\n return bKeep;\n };\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"state-utils.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/state-utils.tsx"],"names":[],"mappings":"AAKA,QAAA,MAAM,cAAc,gDACC,GAAG,+DAkCvB,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"state-utils.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/state-utils.tsx"],"names":[],"mappings":"AAKA,QAAA,MAAM,cAAc,GAAI,4BAA0B,MACxC,WAAW,GAAG,MAwBZ,aAAa,4CAUxB,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"state-utils.js","sourceRoot":"","sources":["../../../src/components/helpers/state-utils.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE9D,OAAO,iBAAiB,MAAM,mCAAmC,CAAC;AAElE,MAAM,cAAc,GAAG,CAAC,eAAe,GAAG,GAAG,EAAE,GAAE,CAAC,EAAE,EAAE;IACpD,OAAO,CAAC,SAAc,EAAE,EAAE;QACxB,MAAM,kBAAkB,GAAG,OAAO,CAAC,eAAe,EAAE,IAAI,EAAE,IAAI,EAAE;YAC9D,kBAAkB,EAAE,CAAC,IAAI,EAAE,IAAS,EAAE,EAAE;gBACtC,qBAAqB;gBACrB,MAAM,cAAc,GAAG,IAAI,CAAC,UAAU,KAAK,KAAK,CAAC;gBACjD,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,IAAI,IAAI,CAAC,UAAU,KAAK,cAAc,EAAE;oBACvE,OAAO,KAAK,CAAC;iBACd;gBACD,sBAAsB;gBACtB,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;gBACnC,MAAM,aAAa,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;gBAC9C,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE;oBAC5C,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE;wBACvH,OAAO,KAAK,CAAC;qBACd;iBACF;gBACD,gFAAgF;gBAChF,OAAO,CAAC,CACN,aAAa,IAAI,IAAI;oBACrB,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAC9G,CAAC;YACJ,CAAC;SACF,CAAC,CAAC,SAAS,CAAC,CAAC;QAEd,OAAO,CAAC,QAAQ,GAAG,EAAE,EAAE,EAAE;YACvB,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,CAAM,iBAAiB,CAAC,CAAC;YAErD,OAAO,CACL,KAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YACpB,KAAC,kBAAkB,OAAK,QAAQ,GAAI,GAC3B,CACZ,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { useContext } from 'react';\nimport { connect, Provider, shallowEqual } from 'react-redux';\n\nimport ReactReduxContext from '../../bridge/Context/StoreContext';\n\nconst connectToState = (mapStateToProps = () => {}) => {\n return (Component: any) => {\n const ConnectedComponent = connect(mapStateToProps, null, null, {\n areStatePropsEqual: (next, prev: any) => {\n // Compare visibility\n const prevWasVisible = prev.visibility !== false;\n if (next.visibility !== undefined && next.visibility !== prevWasVisible) {\n return false;\n }\n // Compare start props\n const c11nEnv = next.getPConnect();\n const allStateProps = c11nEnv.getStateProps();\n for (const key of Object.keys(allStateProps)) {\n if (!shallowEqual(next[key], prev[key]) || (next.routingInfo && !PCore.isDeepEqual(next.routingInfo, prev.routingInfo))) {\n return false;\n }\n }\n /* TODO For some rawConfig we are not getting routingInfo under allStateProps */\n return !(\n 'routingInfo' in next &&\n (!shallowEqual(next.routingInfo, prev.routingInfo) || !PCore.isDeepEqual(next.routingInfo, prev.routingInfo))\n );\n }\n })(Component);\n\n return (ownProps = {}) => {\n const { store } = useContext<any>(ReactReduxContext);\n\n return (\n <Provider store={store}>\n <ConnectedComponent {...ownProps} />\n </Provider>\n );\n };\n };\n};\n\nexport default connectToState;\n"]}
1
+ {"version":3,"file":"state-utils.js","sourceRoot":"","sources":["../../../src/components/helpers/state-utils.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE9D,OAAO,iBAAiB,MAAM,mCAAmC,CAAC;AAElE,MAAM,cAAc,GAAG,CAAC,eAAe,GAAG,GAAG,EAAE,GAAE,CAAC,EAAE,EAAE;IACpD,OAAO,CAAC,SAAc,EAAE,EAAE;QACxB,MAAM,kBAAkB,GAAG,OAAO,CAAC,eAAe,EAAE,IAAI,EAAE,IAAI,EAAE;YAC9D,kBAAkB,EAAE,CAAC,IAAI,EAAE,IAAS,EAAE,EAAE;gBACtC,qBAAqB;gBACrB,MAAM,cAAc,GAAG,IAAI,CAAC,UAAU,KAAK,KAAK,CAAC;gBACjD,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,IAAI,IAAI,CAAC,UAAU,KAAK,cAAc,EAAE,CAAC;oBACxE,OAAO,KAAK,CAAC;gBACf,CAAC;gBACD,sBAAsB;gBACtB,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;gBACnC,MAAM,aAAa,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;gBAC9C,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;oBAC7C,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC;wBACxH,OAAO,KAAK,CAAC;oBACf,CAAC;gBACH,CAAC;gBACD,gFAAgF;gBAChF,OAAO,CAAC,CACN,aAAa,IAAI,IAAI;oBACrB,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAC9G,CAAC;YACJ,CAAC;SACF,CAAC,CAAC,SAAS,CAAC,CAAC;QAEd,OAAO,CAAC,QAAQ,GAAG,EAAE,EAAE,EAAE;YACvB,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,CAAM,iBAAiB,CAAC,CAAC;YAErD,OAAO,CACL,KAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YACpB,KAAC,kBAAkB,OAAK,QAAQ,GAAI,GAC3B,CACZ,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { useContext } from 'react';\nimport { connect, Provider, shallowEqual } from 'react-redux';\n\nimport ReactReduxContext from '../../bridge/Context/StoreContext';\n\nconst connectToState = (mapStateToProps = () => {}) => {\n return (Component: any) => {\n const ConnectedComponent = connect(mapStateToProps, null, null, {\n areStatePropsEqual: (next, prev: any) => {\n // Compare visibility\n const prevWasVisible = prev.visibility !== false;\n if (next.visibility !== undefined && next.visibility !== prevWasVisible) {\n return false;\n }\n // Compare start props\n const c11nEnv = next.getPConnect();\n const allStateProps = c11nEnv.getStateProps();\n for (const key of Object.keys(allStateProps)) {\n if (!shallowEqual(next[key], prev[key]) || (next.routingInfo && !PCore.isDeepEqual(next.routingInfo, prev.routingInfo))) {\n return false;\n }\n }\n /* TODO For some rawConfig we are not getting routingInfo under allStateProps */\n return !(\n 'routingInfo' in next &&\n (!shallowEqual(next.routingInfo, prev.routingInfo) || !PCore.isDeepEqual(next.routingInfo, prev.routingInfo))\n );\n }\n })(Component);\n\n return (ownProps = {}) => {\n const { store } = useContext<any>(ReactReduxContext);\n\n return (\n <Provider store={store}>\n <ConnectedComponent {...ownProps} />\n </Provider>\n );\n };\n };\n};\n\nexport default connectToState;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"template-utils.js","sourceRoot":"","sources":["../../../src/components/helpers/template-utils.ts"],"names":[],"mappings":"AAAA,mEAAmE;AAEnE,MAAM,UAAU,YAAY,CAAC,QAAa;IACxC,MAAM,QAAQ,GAAG,QAAQ,CAAC,cAAc,EAAE,CAAC;IAC3C,IAAI,SAAS,GAAU,EAAE,CAAC;IAC1B,IAAI,QAAQ,CAAC,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE;QAC9C,SAAS,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;YACzC,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,YAAY,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;YACzE,OAAO,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;KACJ;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,MAAa;IACnD,OAAO,MAAM;SACV,MAAM,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,UAAU,KAAK,KAAK,CAAC;SAChD,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;QAC1B,EAAE,EAAE,KAAK,CAAC,WAAW,EAAE;QACvB,IAAI,EAAE,KAAK;QACX,KAAK;KACN,CAAC,CAAC,CAAC;AACR,CAAC;AAED;;;GAGG;AACH,M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AAY,KAAK,MAAM,EAAE;QAC1D,OAAO,YAAY,CAAC;KACrB;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["// This file is adapted from React DX components/template/utils.js\n\nexport function getAllFields(pConnect: any) {\n const metadata = pConnect.getRawMetadata();\n let allFields: any[] = [];\n if (metadata.children && metadata.children.map) {\n allFields = metadata.children.map(fields => {\n const children = fields.children instanceof Array ? fields.children : [];\n return children.map(field => field.config);\n });\n }\n return allFields;\n}\n\nexport function filterForFieldValueList(fields: any[]) {\n return fields\n .filter(({ visibility }) => visibility !== false)\n .map(({ value, label }) => ({\n id: label.toLowerCase(),\n name: label,\n value\n }));\n}\n\n/**\n * Determine if the current view is the view of the case step/assignment.\n * @param {Function} pConnect PConnect object for the component\n */\nexport function getIsAssignmentView(pConnect) {\n // Get caseInfo content from the store which contains the view info about the current assignment/step\n // TODO To be replaced with pConnect.getCaseInfo().getCurrentAssignmentView when it's available\n const assignmentViewClass = pConnect.getValue(PCore.getConstants().CASE_INFO.CASE_INFO_CLASSID);\n const assignmentViewName = pConnect.getValue(PCore.getConstants().CASE_INFO.ASSIGNMENTACTION_ID);\n\n const assignmentViewId = `${assignmentViewName}!${assignmentViewClass}`;\n\n // Get the info about the current view from pConnect\n const currentViewId = `${pConnect.getCurrentView()}!${pConnect.getCurrentClassID()}`;\n\n return assignmentViewId === currentViewId;\n}\n\n/**\n * A hook that gets the instructions content for a view.\n * @param {Function} pConnect PConnect object for the component\n * @param {string} [instructions=\"casestep\"] 'casestep', 'none', or the html content of a Rule-UI-Paragraph rule (processed via core's paragraph annotation handler)\n */\nexport function getInstructions(pConnect, instructions: string = 'casestep'): string | undefined {\n const caseStepInstructions = PCore.getConstants().CASE_INFO.INSTRUCTIONS && pConnect.getValue(PCore.getConstants().CASE_INFO.INSTRUCTIONS);\n\n // Determine if this view is the current assignment/step view\n const isCurrentAssignmentView = getIsAssignmentView(pConnect);\n\n // Case step instructions\n if (instructions === 'casestep' && isCurrentAssignmentView && caseStepInstructions?.length) {\n return caseStepInstructions;\n }\n\n // No instructions\n if (instructions === 'none') {\n return undefined;\n }\n\n // If the annotation wasn't processed correctly, don't return any instruction text\n if (instructions?.startsWith('@PARAGRAPH')) {\n return undefined;\n }\n\n // Custom instructions from the view\n // The raw metadata for `instructions` will be something like '@PARAGRAPH .SomeParagraphRule' but\n // it is evaluated by core logic to the content\n if (instructions !== 'casestep' && instructions !== 'none') {\n return instructions;\n }\n return undefined;\n}\n"]}
1
+ {"version":3,"file":"template-utils.js","sourceRoot":"","sources":["../../../src/components/helpers/template-utils.ts"],"names":[],"mappings":"AAAA,mEAAmE;AAEnE,MAAM,UAAU,YAAY,CAAC,QAAa;IACxC,MAAM,QAAQ,GAAG,QAAQ,CAAC,cAAc,EAAE,CAAC;IAC3C,IAAI,SAAS,GAAU,EAAE,CAAC;IAC1B,IAAI,QAAQ,CAAC,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;QAC/C,SAAS,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;YACzC,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,YAAY,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;YACzE,OAAO,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,MAAa;IACnD,OAAO,MAAM;SACV,MAAM,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,UAAU,KAAK,KAAK,CAAC;SAChD,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;QAC1B,EAAE,EAAE,KAAK,CAAC,WAAW,EAAE;QACvB,IA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C3C,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,oCAAoC;IACpC,iGAAiG;IACjG,+CAA+C;IAC/C,IAAI,YAAY,KAAK,UAAU,IAAI,YAAY,KAAK,MAAM,EAAE,CAAC;QAC3D,OAAO,YAAY,CAAC;IACtB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["// This file is adapted from React DX components/template/utils.js\n\nexport function getAllFields(pConnect: any) {\n const metadata = pConnect.getRawMetadata();\n let allFields: any[] = [];\n if (metadata.children && metadata.children.map) {\n allFields = metadata.children.map(fields => {\n const children = fields.children instanceof Array ? fields.children : [];\n return children.map(field => field.config);\n });\n }\n return allFields;\n}\n\nexport function filterForFieldValueList(fields: any[]) {\n return fields\n .filter(({ visibility }) => visibility !== false)\n .map(({ value, label }) => ({\n id: label.toLowerCase(),\n name: label,\n value\n }));\n}\n\n/**\n * Determine if the current view is the view of the case step/assignment.\n * @param {Function} pConnect PConnect object for the component\n */\nexport function getIsAssignmentView(pConnect) {\n // Get caseInfo content from the store which contains the view info about the current assignment/step\n // TODO To be replaced with pConnect.getCaseInfo().getCurrentAssignmentView when it's available\n const assignmentViewClass = pConnect.getValue(PCore.getConstants().CASE_INFO.CASE_INFO_CLASSID);\n const assignmentViewName = pConnect.getValue(PCore.getConstants().CASE_INFO.ASSIGNMENTACTION_ID);\n\n const assignmentViewId = `${assignmentViewName}!${assignmentViewClass}`;\n\n // Get the info about the current view from pConnect\n const currentViewId = `${pConnect.getCurrentView()}!${pConnect.getCurrentClassID()}`;\n\n return assignmentViewId === currentViewId;\n}\n\n/**\n * A hook that gets the instructions content for a view.\n * @param {Function} pConnect PConnect object for the component\n * @param {string} [instructions=\"casestep\"] 'casestep', 'none', or the html content of a Rule-UI-Paragraph rule (processed via core's paragraph annotation handler)\n */\nexport function getInstructions(pConnect, instructions: string = 'casestep'): string | undefined {\n const caseStepInstructions = PCore.getConstants().CASE_INFO.INSTRUCTIONS && pConnect.getValue(PCore.getConstants().CASE_INFO.INSTRUCTIONS);\n\n // Determine if this view is the current assignment/step view\n const isCurrentAssignmentView = getIsAssignmentView(pConnect);\n\n // Case step instructions\n if (instructions === 'casestep' && isCurrentAssignmentView && caseStepInstructions?.length) {\n return caseStepInstructions;\n }\n\n // No instructions\n if (instructions === 'none') {\n return undefined;\n }\n\n // If the annotation wasn't processed correctly, don't return any instruction text\n if (instructions?.startsWith('@PARAGRAPH')) {\n return undefined;\n }\n\n // Custom instructions from the view\n // The raw metadata for `instructions` will be something like '@PARAGRAPH .SomeParagraphRule' but\n // it is evaluated by core logic to the content\n if (instructions !== 'casestep' && instructions !== 'none') {\n return instructions;\n }\n return undefined;\n}\n"]}