@pega/lists-react 9.0.0-build.9.9 → 10.0.0-build.1.0

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 (433) hide show
  1. package/README.md +0 -4
  2. package/lib/Core/Components/A11y/RepeatingStructureA11y.d.ts.map +1 -1
  3. package/lib/Core/Components/A11y/RepeatingStructureA11y.js +2 -1
  4. package/lib/Core/Components/A11y/RepeatingStructureA11y.js.map +1 -1
  5. package/lib/Core/Components/AggregateMenu.d.ts.map +1 -1
  6. package/lib/Core/Components/AggregateMenu.js +6 -2
  7. package/lib/Core/Components/AggregateMenu.js.map +1 -1
  8. package/lib/Core/Components/AggregatorCell.d.ts.map +1 -1
  9. package/lib/Core/Components/AggregatorCell.js +3 -1
  10. package/lib/Core/Components/AggregatorCell.js.map +1 -1
  11. package/lib/Core/Components/ContextMenu/ContextMenuContainer.d.ts +6 -15
  12. package/lib/Core/Components/ContextMenu/ContextMenuContainer.d.ts.map +1 -1
  13. package/lib/Core/Components/ContextMenu/ContextMenuContainer.js +111 -166
  14. package/lib/Core/Components/ContextMenu/ContextMenuContainer.js.map +1 -1
  15. package/lib/Core/Components/ContextMenu/QuickFilter.js +1 -1
  16. package/lib/Core/Components/ContextMenu/QuickFilter.js.map +1 -1
  17. package/lib/Core/Components/DefaultComponents/CellRenderers/ColumnMergeTemplates/CustomCellWrapper.d.ts +1 -1
  18. package/lib/Core/Components/DefaultComponents/CellRenderers/ColumnMergeTemplates/CustomCellWrapper.d.ts.map +1 -1
  19. package/lib/Core/Components/DefaultComponents/CellRenderers/RowActionMenu.d.ts.map +1 -1
  20. package/lib/Core/Components/DefaultComponents/CellRenderers/RowActionMenu.js +33 -5
  21. package/lib/Core/Components/DefaultComponents/CellRenderers/RowActionMenu.js.map +1 -1
  22. package/lib/Core/Components/DefaultComponents/CellRenderers/RowDeleteAction.d.ts +10 -0
  23. package/lib/Core/Components/DefaultComponents/CellRenderers/RowDeleteAction.d.ts.map +1 -0
  24. package/lib/Core/Components/DefaultComponents/CellRenderers/RowDeleteAction.js +27 -0
  25. package/lib/Core/Components/DefaultComponents/CellRenderers/RowDeleteAction.js.map +1 -0
  26. package/lib/Core/Components/DefaultComponents/CellRenderers/index.d.ts +2 -2
  27. package/lib/Core/Components/DefaultComponents/CellRenderers/index.d.ts.map +1 -1
  28. package/lib/Core/Components/DefaultComponents/CellRenderers/index.js +2 -2
  29. package/lib/Core/Components/DefaultComponents/CellRenderers/index.js.map +1 -1
  30. package/lib/Core/Components/DefaultComponents/EmptyContainer.d.ts +3 -1
  31. package/lib/Core/Components/DefaultComponents/EmptyContainer.d.ts.map +1 -1
  32. package/lib/Core/Components/DefaultComponents/EmptyContainer.js +11 -2
  33. package/lib/Core/Components/DefaultComponents/EmptyContainer.js.map +1 -1
  34. package/lib/Core/Components/DefaultComponents/PersonalizationCreateEdit.d.ts +3 -2
  35. package/lib/Core/Components/DefaultComponents/PersonalizationCreateEdit.d.ts.map +1 -1
  36. package/lib/Core/Components/DefaultComponents/PersonalizationCreateEdit.js +13 -26
  37. package/lib/Core/Components/DefaultComponents/PersonalizationCreateEdit.js.map +1 -1
  38. package/lib/Core/Components/DefaultComponents/PersonalizationDeleteConfirmation.js +2 -2
  39. package/lib/Core/Components/DefaultComponents/PersonalizationDeleteConfirmation.js.map +1 -1
  40. package/lib/Core/Components/DefaultComponents/PersonalizationSelector.d.ts +0 -2
  41. package/lib/Core/Components/DefaultComponents/PersonalizationSelector.d.ts.map +1 -1
  42. package/lib/Core/Components/DefaultComponents/PersonalizationSelector.js +11 -9
  43. package/lib/Core/Components/DefaultComponents/PersonalizationSelector.js.map +1 -1
  44. package/lib/Core/Components/DefaultComponents/SelectAllCheckbox.d.ts.map +1 -1
  45. package/lib/Core/Components/DefaultComponents/SelectAllCheckbox.js +20 -19
  46. package/lib/Core/Components/DefaultComponents/SelectAllCheckbox.js.map +1 -1
  47. package/lib/Core/Components/DefaultComponents/index.d.ts +4 -3
  48. package/lib/Core/Components/DefaultComponents/index.d.ts.map +1 -1
  49. package/lib/Core/Components/DefaultComponents/index.js +0 -2
  50. package/lib/Core/Components/DefaultComponents/index.js.map +1 -1
  51. package/lib/Core/Components/Filters/AdvanceFilter.d.ts.map +1 -1
  52. package/lib/Core/Components/Filters/AdvanceFilter.js +5 -2
  53. package/lib/Core/Components/Filters/AdvanceFilter.js.map +1 -1
  54. package/lib/Core/Components/Filters/SelectFilter.d.ts +1 -1
  55. package/lib/Core/Components/Filters/SelectFilter.d.ts.map +1 -1
  56. package/lib/Core/Components/Filters/SelectFilter.js +43 -44
  57. package/lib/Core/Components/Filters/SelectFilter.js.map +1 -1
  58. package/lib/Core/Components/Filters/SimpleFilter.js +1 -1
  59. package/lib/Core/Components/Filters/SimpleFilter.js.map +1 -1
  60. package/lib/Core/Components/Filters/styles.d.ts +1 -1
  61. package/lib/Core/Components/FooterAggregators.d.ts.map +1 -1
  62. package/lib/Core/Components/FooterAggregators.js +6 -3
  63. package/lib/Core/Components/FooterAggregators.js.map +1 -1
  64. package/lib/Core/Components/GroupRenderer/GroupAdditionalFieldDataModal.d.ts +12 -0
  65. package/lib/Core/Components/GroupRenderer/GroupAdditionalFieldDataModal.d.ts.map +1 -0
  66. package/lib/Core/Components/GroupRenderer/GroupAdditionalFieldDataModal.js +62 -0
  67. package/lib/Core/Components/GroupRenderer/GroupAdditionalFieldDataModal.js.map +1 -0
  68. package/lib/Core/Components/GroupRenderer/GroupAdditionalInfo.d.ts +33 -0
  69. package/lib/Core/Components/GroupRenderer/GroupAdditionalInfo.d.ts.map +1 -0
  70. package/lib/Core/Components/GroupRenderer/GroupAdditionalInfo.js +106 -0
  71. package/lib/Core/Components/GroupRenderer/GroupAdditionalInfo.js.map +1 -0
  72. package/lib/Core/Components/GroupRenderer/index.d.ts +22 -0
  73. package/lib/Core/Components/GroupRenderer/index.d.ts.map +1 -0
  74. package/lib/Core/Components/GroupRenderer/index.js +395 -0
  75. package/lib/Core/Components/GroupRenderer/index.js.map +1 -0
  76. package/lib/Core/Components/Grouping/GroupingMenu.d.ts.map +1 -1
  77. package/lib/Core/Components/Grouping/GroupingMenu.js +2 -1
  78. package/lib/Core/Components/Grouping/GroupingMenu.js.map +1 -1
  79. package/lib/Core/Components/HeaderCell.d.ts.map +1 -1
  80. package/lib/Core/Components/HeaderCell.js +3 -3
  81. package/lib/Core/Components/HeaderCell.js.map +1 -1
  82. package/lib/Core/Components/HeaderMenu/actions.d.ts +1 -1
  83. package/lib/Core/Components/HeaderMenu/actions.d.ts.map +1 -1
  84. package/lib/Core/Components/HeaderMenu/actions.js +3 -4
  85. package/lib/Core/Components/HeaderMenu/actions.js.map +1 -1
  86. package/lib/Core/Components/HeaderMenu/index.d.ts.map +1 -1
  87. package/lib/Core/Components/HeaderMenu/index.js +5 -5
  88. package/lib/Core/Components/HeaderMenu/index.js.map +1 -1
  89. package/lib/Core/Components/HierarchicalGroupRenderer.d.ts.map +1 -1
  90. package/lib/Core/Components/HierarchicalGroupRenderer.js +6 -2
  91. package/lib/Core/Components/HierarchicalGroupRenderer.js.map +1 -1
  92. package/lib/Core/Components/NotificationManager.js +1 -1
  93. package/lib/Core/Components/NotificationManager.js.map +1 -1
  94. package/lib/Core/Components/RFColumnConfigurator.d.ts.map +1 -1
  95. package/lib/Core/Components/RFColumnConfigurator.js +32 -9
  96. package/lib/Core/Components/RFColumnConfigurator.js.map +1 -1
  97. package/lib/Core/Components/RSWrapper/HeaderBarGadget.d.ts.map +1 -1
  98. package/lib/Core/Components/RSWrapper/HeaderBarGadget.js +2 -1
  99. package/lib/Core/Components/RSWrapper/HeaderBarGadget.js.map +1 -1
  100. package/lib/Core/Components/RSWrapper/index.d.ts.map +1 -1
  101. package/lib/Core/Components/RSWrapper/index.js +2 -9
  102. package/lib/Core/Components/RSWrapper/index.js.map +1 -1
  103. package/lib/Core/Components/RenderingEngine/Formatter.d.ts.map +1 -1
  104. package/lib/Core/Components/RenderingEngine/Formatter.js +4 -1
  105. package/lib/Core/Components/RenderingEngine/Formatter.js.map +1 -1
  106. package/lib/Core/Components/RenderingEngine/RenderCell.d.ts.map +1 -1
  107. package/lib/Core/Components/RenderingEngine/RenderCell.js +19 -8
  108. package/lib/Core/Components/RenderingEngine/RenderCell.js.map +1 -1
  109. package/lib/Core/Components/RenderingEngine/useHighlighter.d.ts.map +1 -1
  110. package/lib/Core/Components/RenderingEngine/useHighlighter.js +0 -1
  111. package/lib/Core/Components/RenderingEngine/useHighlighter.js.map +1 -1
  112. package/lib/Core/Components/TestIdConstants.d.ts +2 -0
  113. package/lib/Core/Components/TestIdConstants.js +3 -1
  114. package/lib/Core/Components/TestIdConstants.js.map +1 -1
  115. package/lib/Core/Components/Toolbar/AdvanceToolbar.d.ts.map +1 -1
  116. package/lib/Core/Components/Toolbar/AdvanceToolbar.js +7 -18
  117. package/lib/Core/Components/Toolbar/AdvanceToolbar.js.map +1 -1
  118. package/lib/Core/Components/Toolbar/ColumnSelector.d.ts +6 -4
  119. package/lib/Core/Components/Toolbar/ColumnSelector.d.ts.map +1 -1
  120. package/lib/Core/Components/Toolbar/ColumnSelector.js +18 -21
  121. package/lib/Core/Components/Toolbar/ColumnSelector.js.map +1 -1
  122. package/lib/Core/Components/Toolbar/DebugInfo.d.ts +3 -5
  123. package/lib/Core/Components/Toolbar/DebugInfo.d.ts.map +1 -1
  124. package/lib/Core/Components/Toolbar/DebugInfo.js +3 -3
  125. package/lib/Core/Components/Toolbar/DebugInfo.js.map +1 -1
  126. package/lib/Core/Components/Toolbar/FieldSelector.d.ts +2 -1
  127. package/lib/Core/Components/Toolbar/FieldSelector.d.ts.map +1 -1
  128. package/lib/Core/Components/Toolbar/FieldSelector.js +14 -7
  129. package/lib/Core/Components/Toolbar/FieldSelector.js.map +1 -1
  130. package/lib/Core/Components/Toolbar/Grouping.types.d.ts +0 -6
  131. package/lib/Core/Components/Toolbar/Grouping.types.d.ts.map +1 -1
  132. package/lib/Core/Components/Toolbar/Grouping.types.js.map +1 -1
  133. package/lib/Core/Components/Toolbar/RefreshBanner.d.ts.map +1 -1
  134. package/lib/Core/Components/Toolbar/RefreshBanner.js +1 -0
  135. package/lib/Core/Components/Toolbar/RefreshBanner.js.map +1 -1
  136. package/lib/Core/Components/Toolbar/SimpleToolbar.d.ts.map +1 -1
  137. package/lib/Core/Components/Toolbar/SimpleToolbar.js +2 -4
  138. package/lib/Core/Components/Toolbar/SimpleToolbar.js.map +1 -1
  139. package/lib/Core/Components/Toolbar/hooks/useFilter.d.ts.map +1 -1
  140. package/lib/Core/Components/Toolbar/hooks/useFilter.js +4 -1
  141. package/lib/Core/Components/Toolbar/hooks/useFilter.js.map +1 -1
  142. package/lib/Core/Components/Toolbar/hooks/useGroup/DateFunctionSelector.d.ts +14 -18
  143. package/lib/Core/Components/Toolbar/hooks/useGroup/DateFunctionSelector.d.ts.map +1 -1
  144. package/lib/Core/Components/Toolbar/hooks/useGroup/DateFunctionSelector.js +15 -16
  145. package/lib/Core/Components/Toolbar/hooks/useGroup/DateFunctionSelector.js.map +1 -1
  146. package/lib/Core/Components/Toolbar/hooks/useGroup/GroupRenderer.d.ts +4 -2
  147. package/lib/Core/Components/Toolbar/hooks/useGroup/GroupRenderer.d.ts.map +1 -1
  148. package/lib/Core/Components/Toolbar/hooks/useGroup/GroupRenderer.js +30 -22
  149. package/lib/Core/Components/Toolbar/hooks/useGroup/GroupRenderer.js.map +1 -1
  150. package/lib/Core/Components/Toolbar/hooks/useGroup/useGroup.d.ts.map +1 -1
  151. package/lib/Core/Components/Toolbar/hooks/useGroup/useGroup.js +17 -6
  152. package/lib/Core/Components/Toolbar/hooks/useGroup/useGroup.js.map +1 -1
  153. package/lib/Core/Components/Toolbar/hooks/useGroup/utils.d.ts +7 -2
  154. package/lib/Core/Components/Toolbar/hooks/useGroup/utils.d.ts.map +1 -1
  155. package/lib/Core/Components/Toolbar/hooks/useGroup/utils.js +12 -5
  156. package/lib/Core/Components/Toolbar/hooks/useGroup/utils.js.map +1 -1
  157. package/lib/Core/Components/Toolbar/hooks/useMore.d.ts +1 -1
  158. package/lib/Core/Components/Toolbar/hooks/useMore.d.ts.map +1 -1
  159. package/lib/Core/Components/Toolbar/hooks/useMore.js +134 -80
  160. package/lib/Core/Components/Toolbar/hooks/useMore.js.map +1 -1
  161. package/lib/Core/Components/Toolbar/hooks/usePersonalization.d.ts +8 -6
  162. package/lib/Core/Components/Toolbar/hooks/usePersonalization.d.ts.map +1 -1
  163. package/lib/Core/Components/Toolbar/hooks/usePersonalization.js +18 -3
  164. package/lib/Core/Components/Toolbar/hooks/usePersonalization.js.map +1 -1
  165. package/lib/Core/Components/Toolbar/hooks/useSearch.d.ts.map +1 -1
  166. package/lib/Core/Components/Toolbar/hooks/useSearch.js +7 -10
  167. package/lib/Core/Components/Toolbar/hooks/useSearch.js.map +1 -1
  168. package/lib/Core/Components/Toolbar/hooks/useSort/Row.d.ts +8 -6
  169. package/lib/Core/Components/Toolbar/hooks/useSort/Row.d.ts.map +1 -1
  170. package/lib/Core/Components/Toolbar/hooks/useSort/Row.js +16 -10
  171. package/lib/Core/Components/Toolbar/hooks/useSort/Row.js.map +1 -1
  172. package/lib/Core/Components/Toolbar/hooks/useSort/SortRenderer.d.ts +4 -2
  173. package/lib/Core/Components/Toolbar/hooks/useSort/SortRenderer.d.ts.map +1 -1
  174. package/lib/Core/Components/Toolbar/hooks/useSort/SortRenderer.js +9 -3
  175. package/lib/Core/Components/Toolbar/hooks/useSort/SortRenderer.js.map +1 -1
  176. package/lib/Core/Components/Toolbar/hooks/useSort/useSort.d.ts.map +1 -1
  177. package/lib/Core/Components/Toolbar/hooks/useSort/useSort.js +8 -2
  178. package/lib/Core/Components/Toolbar/hooks/useSort/useSort.js.map +1 -1
  179. package/lib/Core/Components/Toolbar/hooks/useSort/utils.d.ts +1 -1
  180. package/lib/Core/Components/Toolbar/hooks/useSort/utils.d.ts.map +1 -1
  181. package/lib/Core/Components/Toolbar/hooks/useSort/utils.js +2 -2
  182. package/lib/Core/Components/Toolbar/hooks/useSort/utils.js.map +1 -1
  183. package/lib/Core/Components/Toolbar/hooks/useWrapAction.d.ts +2 -1
  184. package/lib/Core/Components/Toolbar/hooks/useWrapAction.d.ts.map +1 -1
  185. package/lib/Core/Components/Toolbar/hooks/useWrapAction.js +36 -12
  186. package/lib/Core/Components/Toolbar/hooks/useWrapAction.js.map +1 -1
  187. package/lib/Core/Components/Toolbar/utils/utils.d.ts +28 -7
  188. package/lib/Core/Components/Toolbar/utils/utils.d.ts.map +1 -1
  189. package/lib/Core/Components/Toolbar/utils/utils.js +43 -11
  190. package/lib/Core/Components/Toolbar/utils/utils.js.map +1 -1
  191. package/lib/Core/Components/Virtualise/Pagination.d.ts.map +1 -1
  192. package/lib/Core/Components/Virtualise/Pagination.js +2 -1
  193. package/lib/Core/Components/Virtualise/Pagination.js.map +1 -1
  194. package/lib/Core/Components/Virtualise/UseScroll.d.ts +4 -1
  195. package/lib/Core/Components/Virtualise/UseScroll.d.ts.map +1 -1
  196. package/lib/Core/Components/Virtualise/UseScroll.js +16 -3
  197. package/lib/Core/Components/Virtualise/UseScroll.js.map +1 -1
  198. package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/VariableHeightVirtualizer.js +1 -1
  199. package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/VariableHeightVirtualizer.js.map +1 -1
  200. package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/utils.d.ts +1 -1
  201. package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/utils.js +1 -1
  202. package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/utils.js.map +1 -1
  203. package/lib/Core/Components/Virtualise/VirtualizeInfinite.js +14 -4
  204. package/lib/Core/Components/Virtualise/VirtualizeInfinite.js.map +1 -1
  205. package/lib/Core/Components/Virtualise/index.js +19 -4
  206. package/lib/Core/Components/Virtualise/index.js.map +1 -1
  207. package/lib/Core/Components/Virtualise/utility.js +1 -1
  208. package/lib/Core/Components/Virtualise/utility.js.map +1 -1
  209. package/lib/Core/Components/WarningBanner.d.ts +11 -0
  210. package/lib/Core/Components/WarningBanner.d.ts.map +1 -0
  211. package/lib/Core/Components/WarningBanner.js +23 -0
  212. package/lib/Core/Components/WarningBanner.js.map +1 -0
  213. package/lib/Core/Context/LocalizationContext.d.ts +1 -1
  214. package/lib/Core/Context/LocalizationContext.d.ts.map +1 -1
  215. package/lib/Core/Context/LocalizationContext.js.map +1 -1
  216. package/lib/Core/Hooks/a11y/useAnnounce.d.ts +3 -4
  217. package/lib/Core/Hooks/a11y/useAnnounce.d.ts.map +1 -1
  218. package/lib/Core/Hooks/a11y/useAnnounce.js +3 -4
  219. package/lib/Core/Hooks/a11y/useAnnounce.js.map +1 -1
  220. package/lib/Core/Hooks/useDebounce.js +1 -1
  221. package/lib/Core/Hooks/useDebounce.js.map +1 -1
  222. package/lib/Core/Hooks/useDragDrop.d.ts +2 -2
  223. package/lib/Core/Hooks/useDragDrop.d.ts.map +1 -1
  224. package/lib/Core/Hooks/useDragDrop.js +9 -9
  225. package/lib/Core/Hooks/useDragDrop.js.map +1 -1
  226. package/lib/Core/Hooks/useRepeat.d.ts +1 -1
  227. package/lib/Core/Hooks/useRepeat.d.ts.map +1 -1
  228. package/lib/Core/Hooks/useRepeat.js +58 -11
  229. package/lib/Core/Hooks/useRepeat.js.map +1 -1
  230. package/lib/Core/Hooks/useSelectAllCheckbox.d.ts +21 -0
  231. package/lib/Core/Hooks/useSelectAllCheckbox.d.ts.map +1 -0
  232. package/lib/Core/Hooks/useSelectAllCheckbox.js +23 -0
  233. package/lib/Core/Hooks/useSelectAllCheckbox.js.map +1 -0
  234. package/lib/Core/Localization/defaultTranslations.d.ts +15 -13
  235. package/lib/Core/Localization/defaultTranslations.d.ts.map +1 -1
  236. package/lib/Core/Localization/defaultTranslations.js +16 -14
  237. package/lib/Core/Localization/defaultTranslations.js.map +1 -1
  238. package/lib/Core/Test/JUnitMocks.d.ts +12 -0
  239. package/lib/Core/Test/JUnitMocks.d.ts.map +1 -1
  240. package/lib/Core/Test/JUnitMocks.js +27 -8
  241. package/lib/Core/Test/JUnitMocks.js.map +1 -1
  242. package/lib/Core/Test/TestUtils.d.ts +0 -1
  243. package/lib/Core/Test/TestUtils.d.ts.map +1 -1
  244. package/lib/Core/Test/TestUtils.js +3 -7
  245. package/lib/Core/Test/TestUtils.js.map +1 -1
  246. package/lib/Core/Utils/index.d.ts +15 -0
  247. package/lib/Core/Utils/index.d.ts.map +1 -1
  248. package/lib/Core/Utils/index.js +22 -0
  249. package/lib/Core/Utils/index.js.map +1 -1
  250. package/lib/Core/Utils/styles.d.ts +2 -2
  251. package/lib/Core/Utils/styles.d.ts.map +1 -1
  252. package/lib/Core/Views/Gallery/Components/GalleryCard.d.ts +4 -0
  253. package/lib/Core/Views/Gallery/Components/GalleryCard.d.ts.map +1 -0
  254. package/lib/Core/Views/Gallery/Components/GalleryCard.js +29 -0
  255. package/lib/Core/Views/Gallery/Components/GalleryCard.js.map +1 -0
  256. package/lib/Core/Views/Gallery/Components/GalleryCheckboxCard.d.ts +8 -0
  257. package/lib/Core/Views/Gallery/Components/GalleryCheckboxCard.d.ts.map +1 -0
  258. package/lib/Core/Views/Gallery/Components/GalleryCheckboxCard.js +25 -0
  259. package/lib/Core/Views/Gallery/Components/GalleryCheckboxCard.js.map +1 -0
  260. package/lib/Core/Views/Gallery/Components/GalleryFieldValue.d.ts +8 -0
  261. package/lib/Core/Views/Gallery/Components/GalleryFieldValue.d.ts.map +1 -0
  262. package/lib/Core/Views/Gallery/Components/GalleryFieldValue.js +8 -0
  263. package/lib/Core/Views/Gallery/Components/GalleryFieldValue.js.map +1 -0
  264. package/lib/Core/Views/Gallery/Components/GalleryHeader.d.ts +8 -0
  265. package/lib/Core/Views/Gallery/Components/GalleryHeader.d.ts.map +1 -0
  266. package/lib/Core/Views/Gallery/Components/GalleryHeader.js +15 -0
  267. package/lib/Core/Views/Gallery/Components/GalleryHeader.js.map +1 -0
  268. package/lib/Core/Views/Gallery/Gallery.types.d.ts +8 -0
  269. package/lib/Core/Views/Gallery/Gallery.types.d.ts.map +1 -0
  270. package/lib/Core/Views/Gallery/Gallery.types.js +2 -0
  271. package/lib/Core/Views/Gallery/Gallery.types.js.map +1 -0
  272. package/lib/Core/Views/Gallery/GalleryA11y.d.ts +7 -5
  273. package/lib/Core/Views/Gallery/GalleryA11y.d.ts.map +1 -1
  274. package/lib/Core/Views/Gallery/GalleryA11y.js +9 -52
  275. package/lib/Core/Views/Gallery/GalleryA11y.js.map +1 -1
  276. package/lib/Core/Views/Gallery/GalleryContainer.d.ts +23 -0
  277. package/lib/Core/Views/Gallery/GalleryContainer.d.ts.map +1 -0
  278. package/lib/Core/Views/Gallery/GalleryContainer.js +66 -0
  279. package/lib/Core/Views/Gallery/GalleryContainer.js.map +1 -0
  280. package/lib/Core/Views/Gallery/_tests_/Samples/GalleryA11ySample.js +1 -1
  281. package/lib/Core/Views/Gallery/_tests_/Samples/GalleryA11ySample.js.map +1 -1
  282. package/lib/Core/Views/Gallery/hooks/useRowActions.d.ts +9 -0
  283. package/lib/Core/Views/Gallery/hooks/useRowActions.d.ts.map +1 -0
  284. package/lib/Core/Views/Gallery/hooks/useRowActions.js +25 -0
  285. package/lib/Core/Views/Gallery/hooks/useRowActions.js.map +1 -0
  286. package/lib/Core/Views/Gallery/index.d.ts +4 -8
  287. package/lib/Core/Views/Gallery/index.d.ts.map +1 -1
  288. package/lib/Core/Views/Gallery/index.js +38 -59
  289. package/lib/Core/Views/Gallery/index.js.map +1 -1
  290. package/lib/Core/Views/Gallery/utils.d.ts +36 -0
  291. package/lib/Core/Views/Gallery/utils.d.ts.map +1 -0
  292. package/lib/Core/Views/Gallery/utils.js +115 -0
  293. package/lib/Core/Views/Gallery/utils.js.map +1 -0
  294. package/lib/Core/Views/Map/Map.styles.d.ts +190 -6
  295. package/lib/Core/Views/Map/Map.styles.d.ts.map +1 -1
  296. package/lib/Core/Views/Map/Map.styles.js.map +1 -1
  297. package/lib/Core/Views/Map/index.d.ts.map +1 -1
  298. package/lib/Core/Views/Map/index.js +2 -2
  299. package/lib/Core/Views/Map/index.js.map +1 -1
  300. package/lib/Core/Views/RsCardWrapper.js.map +1 -1
  301. package/lib/Core/Views/Table/Body.d.ts.map +1 -1
  302. package/lib/Core/Views/Table/Body.js +5 -2
  303. package/lib/Core/Views/Table/Body.js.map +1 -1
  304. package/lib/Core/Views/Table/CellWrapper.d.ts +1 -1
  305. package/lib/Core/Views/Table/CellWrapper.d.ts.map +1 -1
  306. package/lib/Core/Views/Table/CellWrapper.js +4 -2
  307. package/lib/Core/Views/Table/CellWrapper.js.map +1 -1
  308. package/lib/Core/Views/Table/GroupingHeaderCell.d.ts +6 -15
  309. package/lib/Core/Views/Table/GroupingHeaderCell.d.ts.map +1 -1
  310. package/lib/Core/Views/Table/GroupingHeaderCell.js +16 -14
  311. package/lib/Core/Views/Table/GroupingHeaderCell.js.map +1 -1
  312. package/lib/Core/Views/Table/HeaderWrapper.d.ts.map +1 -1
  313. package/lib/Core/Views/Table/HeaderWrapper.js +5 -5
  314. package/lib/Core/Views/Table/HeaderWrapper.js.map +1 -1
  315. package/lib/Core/Views/Table/SkeletonRows.d.ts +1 -1
  316. package/lib/Core/Views/Table/SkeletonRows.d.ts.map +1 -1
  317. package/lib/Core/Views/Table/StyledTableContainer.d.ts +3 -1
  318. package/lib/Core/Views/Table/StyledTableContainer.d.ts.map +1 -1
  319. package/lib/Core/Views/Table/StyledTableContainer.js +270 -155
  320. package/lib/Core/Views/Table/StyledTableContainer.js.map +1 -1
  321. package/lib/Core/Views/Table/TableA11y.d.ts +13 -1
  322. package/lib/Core/Views/Table/TableA11y.d.ts.map +1 -1
  323. package/lib/Core/Views/Table/TableA11y.js +233 -13
  324. package/lib/Core/Views/Table/TableA11y.js.map +1 -1
  325. package/lib/Core/Views/Table/VirtualizeWrapper.d.ts +3 -1
  326. package/lib/Core/Views/Table/VirtualizeWrapper.d.ts.map +1 -1
  327. package/lib/Core/Views/Table/VirtualizeWrapper.js +16 -16
  328. package/lib/Core/Views/Table/VirtualizeWrapper.js.map +1 -1
  329. package/lib/Core/Views/Table/index.d.ts.map +1 -1
  330. package/lib/Core/Views/Table/index.js +16 -7
  331. package/lib/Core/Views/Table/index.js.map +1 -1
  332. package/lib/Core/Views/Timeline/Timeline.d.ts.map +1 -1
  333. package/lib/Core/Views/Timeline/Timeline.js +15 -20
  334. package/lib/Core/Views/Timeline/Timeline.js.map +1 -1
  335. package/lib/Core/Views/Timeline/Timeline.styles.d.ts +392 -15
  336. package/lib/Core/Views/Timeline/Timeline.styles.d.ts.map +1 -1
  337. package/lib/Core/Views/Timeline/Timeline.styles.js +44 -44
  338. package/lib/Core/Views/Timeline/Timeline.styles.js.map +1 -1
  339. package/lib/Core/Views/Timeline/Timeline.types.d.ts +11 -7
  340. package/lib/Core/Views/Timeline/Timeline.types.d.ts.map +1 -1
  341. package/lib/Core/Views/Timeline/Timeline.types.js.map +1 -1
  342. package/lib/Core/Views/Timeline/TimelineGroup.d.ts +13 -0
  343. package/lib/Core/Views/Timeline/TimelineGroup.d.ts.map +1 -0
  344. package/lib/Core/Views/Timeline/TimelineGroup.js +21 -0
  345. package/lib/Core/Views/Timeline/TimelineGroup.js.map +1 -0
  346. package/lib/Core/Views/Timeline/TimelineItem.d.ts +1 -3
  347. package/lib/Core/Views/Timeline/TimelineItem.d.ts.map +1 -1
  348. package/lib/Core/Views/Timeline/TimelineItem.js +7 -6
  349. package/lib/Core/Views/Timeline/TimelineItem.js.map +1 -1
  350. package/lib/Core/Views/Timeline/__tests__/Timeline.mocks.d.ts +2 -2
  351. package/lib/Core/Views/Timeline/__tests__/Timeline.mocks.d.ts.map +1 -1
  352. package/lib/Core/Views/Timeline/__tests__/Timeline.mocks.js.map +1 -1
  353. package/lib/Core/Views/Timeline/index.d.ts.map +1 -1
  354. package/lib/Core/Views/Timeline/index.js +13 -6
  355. package/lib/Core/Views/Timeline/index.js.map +1 -1
  356. package/lib/Core/Views/Timeline/utils.d.ts +8 -10
  357. package/lib/Core/Views/Timeline/utils.d.ts.map +1 -1
  358. package/lib/Core/Views/Timeline/utils.js +136 -58
  359. package/lib/Core/Views/Timeline/utils.js.map +1 -1
  360. package/lib/Core/Views/rs-styles.d.ts +1 -1
  361. package/lib/Core/a11y/loadingAnnouncementBehavior.d.ts +12 -0
  362. package/lib/Core/a11y/loadingAnnouncementBehavior.d.ts.map +1 -0
  363. package/lib/Core/a11y/loadingAnnouncementBehavior.js +37 -0
  364. package/lib/Core/a11y/loadingAnnouncementBehavior.js.map +1 -0
  365. package/lib/Core/constants.d.ts.map +1 -1
  366. package/lib/Core/constants.js +1 -0
  367. package/lib/Core/constants.js.map +1 -1
  368. package/lib/Core/index.d.ts.map +1 -1
  369. package/lib/Core/index.js +1 -2
  370. package/lib/Core/index.js.map +1 -1
  371. package/lib/Core/templateFeatureSupport.d.ts +17 -0
  372. package/lib/Core/templateFeatureSupport.d.ts.map +1 -0
  373. package/lib/Core/templateFeatureSupport.js +31 -0
  374. package/lib/Core/templateFeatureSupport.js.map +1 -0
  375. package/lib/index.d.ts +1 -1
  376. package/lib/index.d.ts.map +1 -1
  377. package/lib/index.js +1 -1
  378. package/lib/index.js.map +1 -1
  379. package/lib/types/RepeatingStructuresBoot.types.d.ts +12 -8
  380. package/lib/types/RepeatingStructuresBoot.types.d.ts.map +1 -1
  381. package/lib/types/RepeatingStructuresBoot.types.js.map +1 -1
  382. package/lib/types.d.ts +2 -0
  383. package/lib/types.d.ts.map +1 -1
  384. package/lib/types.js.map +1 -1
  385. package/package.json +11 -13
  386. package/lib/Core/Components/DefaultComponents/CardItem.d.ts +0 -3
  387. package/lib/Core/Components/DefaultComponents/CardItem.d.ts.map +0 -1
  388. package/lib/Core/Components/DefaultComponents/CardItem.js +0 -78
  389. package/lib/Core/Components/DefaultComponents/CardItem.js.map +0 -1
  390. package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/DateTime.d.ts +0 -12
  391. package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/DateTime.d.ts.map +0 -1
  392. package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/DateTime.js +0 -36
  393. package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/DateTime.js.map +0 -1
  394. package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/Radio.d.ts +0 -15
  395. package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/Radio.d.ts.map +0 -1
  396. package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/Radio.js +0 -50
  397. package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/Radio.js.map +0 -1
  398. package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/TextInput.d.ts +0 -12
  399. package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/TextInput.d.ts.map +0 -1
  400. package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/TextInput.js +0 -44
  401. package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/TextInput.js.map +0 -1
  402. package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/index.d.ts +0 -16
  403. package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/index.d.ts.map +0 -1
  404. package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/index.js +0 -64
  405. package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/index.js.map +0 -1
  406. package/lib/Core/Components/GroupRenderer.d.ts +0 -31
  407. package/lib/Core/Components/GroupRenderer.d.ts.map +0 -1
  408. package/lib/Core/Components/GroupRenderer.js +0 -348
  409. package/lib/Core/Components/GroupRenderer.js.map +0 -1
  410. package/lib/Core/Components/RSWrapper/__mocks__/uuid.d.ts +0 -2
  411. package/lib/Core/Components/RSWrapper/__mocks__/uuid.d.ts.map +0 -1
  412. package/lib/Core/Components/RSWrapper/__mocks__/uuid.js +0 -4
  413. package/lib/Core/Components/RSWrapper/__mocks__/uuid.js.map +0 -1
  414. package/lib/Core/Components/Toolbar/KeyboardInstructions.d.ts +0 -6
  415. package/lib/Core/Components/Toolbar/KeyboardInstructions.d.ts.map +0 -1
  416. package/lib/Core/Components/Toolbar/KeyboardInstructions.js +0 -32
  417. package/lib/Core/Components/Toolbar/KeyboardInstructions.js.map +0 -1
  418. package/lib/Core/Components/Toolbar/Timeline/TimelineToolbar.d.ts +0 -7
  419. package/lib/Core/Components/Toolbar/Timeline/TimelineToolbar.d.ts.map +0 -1
  420. package/lib/Core/Components/Toolbar/Timeline/TimelineToolbar.js +0 -109
  421. package/lib/Core/Components/Toolbar/Timeline/TimelineToolbar.js.map +0 -1
  422. package/lib/Core/Views/Gallery/ItemWrapper.d.ts +0 -19
  423. package/lib/Core/Views/Gallery/ItemWrapper.d.ts.map +0 -1
  424. package/lib/Core/Views/Gallery/ItemWrapper.js +0 -34
  425. package/lib/Core/Views/Gallery/ItemWrapper.js.map +0 -1
  426. package/lib/Core/Views/Gallery/StyledGalleryContainer.d.ts +0 -3
  427. package/lib/Core/Views/Gallery/StyledGalleryContainer.d.ts.map +0 -1
  428. package/lib/Core/Views/Gallery/StyledGalleryContainer.js +0 -51
  429. package/lib/Core/Views/Gallery/StyledGalleryContainer.js.map +0 -1
  430. package/lib/Core/Views/Timeline/utility.d.ts +0 -8
  431. package/lib/Core/Views/Timeline/utility.d.ts.map +0 -1
  432. package/lib/Core/Views/Timeline/utility.js +0 -120
  433. package/lib/Core/Views/Timeline/utility.js.map +0 -1
@@ -11,7 +11,7 @@ const fieldsConfiguration = [
11
11
  { field: debugInfoFields.timeTaken, defaultLabel: 'Time taken' },
12
12
  { field: debugInfoFields.insightId, defaultLabel: 'Insight ID', hideIfNotAvailable: true }
13
13
  ];
14
- function DebugInfo({ view, targetRef, onClose }) {
14
+ function DebugInfo({ view, target, onClose }) {
15
15
  const [translate] = useTranslate();
16
16
  const debugInfoList = view.debugInfo.length === 0 ? [{}] : view.debugInfo;
17
17
  const headingRef = useRef(null);
@@ -30,11 +30,11 @@ function DebugInfo({ view, targetRef, onClose }) {
30
30
  });
31
31
  return result;
32
32
  }, []));
33
- return (_jsx(InfoDialog, { target: targetRef.current, heading: translate('Query info'), onDismiss: onClose, children: formattedData.map((debugInfoEntry, index) => (_jsx(FieldValueList, { className: 'debug-record', variant: 'inline', fields: debugInfoEntry }, index))) }));
33
+ return (_jsx(InfoDialog, { target: target, heading: translate('Query info'), onDismiss: onClose, children: formattedData.map((debugInfoEntry, index) => (_jsx(FieldValueList, { className: 'debug-record', variant: 'inline', fields: debugInfoEntry }, index))) }));
34
34
  }
35
35
  DebugInfo.propTypes = {
36
36
  view: PropTypes.objectOf(PropTypes.any).isRequired,
37
- targetRef: PropTypes.shape({ current: PropTypes.instanceOf(Element) }).isRequired,
37
+ target: PropTypes.instanceOf(Element),
38
38
  onClose: PropTypes.func
39
39
  };
40
40
  export default memo(DebugInfo);
@@ -1 +1 @@
1
- {"version":3,"file":"DebugInfo.js","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/DebugInfo.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE3E,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,mBAAmB,GAAG;IAC1B,EAAE,KAAK,EAAE,eAAe,CAAC,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE;IAC3D,EAAE,KAAK,EAAE,eAAe,CAAC,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE;IAC9D,EAAE,KAAK,EAAE,eAAe,CAAC,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE;IAClE,EAAE,KAAK,EAAE,eAAe,CAAC,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE;IAChE,EAAE,KAAK,EAAE,eAAe,CAAC,SAAS,EAAE,YAAY,EAAE,YAAY,EA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,EAAE,SAAS,CAAC,YAAY,CAAC,EAAE,SAAS,EAAE,OAAO,YACxF,aAAa,CAAC,GAAG,CAAC,CAAC,cAAc,EAAE,KAAK,EAAE,EAAE,CAAC,CAC5C,KAAC,cAAc,IACb,SAAS,EAAC,cAAc,EACxB,OAAO,EAAC,QAAQ,EAGhB,MAAM,EAAE,cAAc,IADjB,KAAK,CAEV,CACH,CAAC,GACS,CACd,CAAC;AACJ,CAAC;AAED,SAAS,CAAC,SAAS,GAAG;IACpB,IAAI,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;IAClD,SAAS,EAAE,SAAS,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,UAAU;IACjF,OAAO,EAAE,SAAS,CAAC,IAAI;CACxB,CAAC;AAEF,eAAe,IAAI,CAAC,SAAS,CAAC,CAAC","sourcesContent":["import { memo, useRef, useEffect } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { FieldValueList, Text, InfoDialog } from '@pega/cosmos-react-core';\n\nimport useTranslate from '../../Hooks/useTranslate';\nimport { debugInfoFields } from '../../constants';\n\nconst fieldsConfiguration = [\n { field: debugInfoFields.className, defaultLabel: 'Class' },\n { field: debugInfoFields.dataPage, defaultLabel: 'Data page' },\n { field: debugInfoFields.dataSource, defaultLabel: 'Data source' },\n { field: debugInfoFields.timeTaken, defaultLabel: 'Time taken' },\n { field: debugInfoFields.insightId, defaultLabel: 'Insight ID', hideIfNotAvailable: true }\n];\n\nfunction DebugInfo({ view, targetRef, onClose }) {\n const [translate] = useTranslate();\n const debugInfoList = view.debugInfo.length === 0 ? [{}] : view.debugInfo;\n const headingRef = useRef(null);\n\n useEffect(() => {\n if (headingRef.current) headingRef.current.focus();\n }, []);\n\n const formattedData = debugInfoList.map(debugInfoEntry =>\n fieldsConfiguration.reduce((result, { field, defaultLabel, hideIfNotAvailable }) => {\n if (hideIfNotAvailable && !debugInfoEntry[field]) {\n return result;\n }\n result.push({\n id: field,\n name: translate(defaultLabel),\n value: debugInfoEntry[field] ? (\n <Text variant='h5' data-testid={`field-${field}`}>\n {debugInfoEntry[field]}\n </Text>\n ) : undefined\n });\n return result;\n }, [])\n );\n\n return (\n <InfoDialog target={targetRef.current} heading={translate('Query info')} onDismiss={onClose}>\n {formattedData.map((debugInfoEntry, index) => (\n <FieldValueList\n className='debug-record'\n variant='inline'\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n fields={debugInfoEntry}\n />\n ))}\n </InfoDialog>\n );\n}\n\nDebugInfo.propTypes = {\n view: PropTypes.objectOf(PropTypes.any).isRequired,\n targetRef: PropTypes.shape({ current: PropTypes.instanceOf(Element) }).isRequired,\n onClose: PropTypes.func\n};\n\nexport default memo(DebugInfo);\n"]}
1
+ {"version":3,"file":"DebugInfo.js","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/DebugInfo.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE3E,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,mBAAmB,GAAG;IAC1B,EAAE,KAAK,EAAE,eAAe,CAAC,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE;IAC3D,EAAE,KAAK,EAAE,eAAe,CAAC,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE;IAC9D,EAAE,KAAK,EAAE,eAAe,CAAC,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE;IAClE,EAAE,KAAK,EAAE,eAAe,CAAC,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE;IAChE,EAAE,KAAK,EAAE,eA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,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,YAAY,CAAC,EAAE,SAAS,EAAE,OAAO,YAC7E,aAAa,CAAC,GAAG,CAAC,CAAC,cAAc,EAAE,KAAK,EAAE,EAAE,CAAC,CAC5C,KAAC,cAAc,IACb,SAAS,EAAC,cAAc,EACxB,OAAO,EAAC,QAAQ,EAGhB,MAAM,EAAE,cAAc,IADjB,KAAK,CAEV,CACH,CAAC,GACS,CACd,CAAC;AACJ,CAAC;AAED,SAAS,CAAC,SAAS,GAAG;IACpB,IAAI,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;IAClD,MAAM,EAAE,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC;IACrC,OAAO,EAAE,SAAS,CAAC,IAAI;CACxB,CAAC;AAEF,eAAe,IAAI,CAAC,SAAS,CAAC,CAAC","sourcesContent":["import { memo, useRef, useEffect } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { FieldValueList, Text, InfoDialog } from '@pega/cosmos-react-core';\n\nimport useTranslate from '../../Hooks/useTranslate';\nimport { debugInfoFields } from '../../constants';\n\nconst fieldsConfiguration = [\n { field: debugInfoFields.className, defaultLabel: 'Class' },\n { field: debugInfoFields.dataPage, defaultLabel: 'Data page' },\n { field: debugInfoFields.dataSource, defaultLabel: 'Data source' },\n { field: debugInfoFields.timeTaken, defaultLabel: 'Time taken' },\n { field: debugInfoFields.insightId, defaultLabel: 'Insight ID', hideIfNotAvailable: true }\n];\n\nfunction DebugInfo({ view, target, onClose }) {\n const [translate] = useTranslate();\n const debugInfoList = view.debugInfo.length === 0 ? [{}] : view.debugInfo;\n const headingRef = useRef(null);\n\n useEffect(() => {\n if (headingRef.current) headingRef.current.focus();\n }, []);\n\n const formattedData = debugInfoList.map(debugInfoEntry =>\n fieldsConfiguration.reduce((result, { field, defaultLabel, hideIfNotAvailable }) => {\n if (hideIfNotAvailable && !debugInfoEntry[field]) {\n return result;\n }\n result.push({\n id: field,\n name: translate(defaultLabel),\n value: debugInfoEntry[field] ? (\n <Text variant='h5' data-testid={`field-${field}`}>\n {debugInfoEntry[field]}\n </Text>\n ) : undefined\n });\n return result;\n }, [])\n );\n\n return (\n <InfoDialog target={target} heading={translate('Query info')} onDismiss={onClose}>\n {formattedData.map((debugInfoEntry, index) => (\n <FieldValueList\n className='debug-record'\n variant='inline'\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n fields={debugInfoEntry}\n />\n ))}\n </InfoDialog>\n );\n}\n\nDebugInfo.propTypes = {\n view: PropTypes.objectOf(PropTypes.any).isRequired,\n target: PropTypes.instanceOf(Element),\n onClose: PropTypes.func\n};\n\nexport default memo(DebugInfo);\n"]}
@@ -3,12 +3,13 @@ declare function FieldSelector(props: any): import("react/jsx-runtime").JSX.Elem
3
3
  declare namespace FieldSelector {
4
4
  namespace propTypes {
5
5
  let value: PropTypes.Requireable<string>;
6
- let columns: PropTypes.Validator<any[]>;
7
6
  let onChange: PropTypes.Validator<(...args: any[]) => any>;
8
7
  let disabled: PropTypes.Requireable<boolean>;
8
+ let readOnly: PropTypes.Requireable<boolean>;
9
9
  let fieldProp: PropTypes.Requireable<string>;
10
10
  let label: PropTypes.Validator<string>;
11
11
  let labelHidden: PropTypes.Requireable<boolean>;
12
+ let fieldDefs: PropTypes.Validator<(object | null | undefined)[]>;
12
13
  }
13
14
  }
14
15
  import PropTypes from 'prop-types';
@@ -1 +1 @@
1
- {"version":3,"file":"FieldSelector.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/FieldSelector.jsx"],"names":[],"mappings":";AASA,oFAuDC;;;;;;;;;;;;sBA/DqB,YAAY"}
1
+ {"version":3,"file":"FieldSelector.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/FieldSelector.jsx"],"names":[],"mappings":";AASA,oFAwEC;;;;;;;;;;;;;sBAhFqB,YAAY"}
@@ -5,9 +5,9 @@ import { ComboBox, menuHelpers } from '@pega/cosmos-react-core';
5
5
  import useTranslate from '../../Hooks/useTranslate';
6
6
  import getMenuItemsFromColumns from './utils/utils';
7
7
  function FieldSelector(props) {
8
- const { value, onChange, columns, disabled = false, fieldProp, label, labelHidden } = props;
8
+ const { value, onChange, disabled = false, readOnly, fieldProp, label, labelHidden, fieldDefs } = props;
9
9
  const [translate] = useTranslate();
10
- const items = useMemo(() => getMenuItemsFromColumns(columns, fieldProp, value), [columns, value, fieldProp]);
10
+ const items = useMemo(() => getMenuItemsFromColumns(fieldDefs, fieldProp, { selectedField: value }), [fieldDefs, value, fieldProp]);
11
11
  const selected = useMemo(() => {
12
12
  const selectedItem = menuHelpers.getItem(items, value);
13
13
  return selectedItem ? { id: selectedItem.id, text: selectedItem.primary } : undefined;
@@ -25,9 +25,15 @@ function FieldSelector(props) {
25
25
  ? menuHelpers.flatten(items).filter(({ primary }) => filterRegex.test(primary))
26
26
  : items;
27
27
  }, [filterRegex, items]);
28
- return (_jsx(ComboBox, { label: label, labelHidden: labelHidden, disabled: disabled, placeholder: translate('Select field'), mode: 'single-select', value: filterValue, testId: 'FieldSelector', onChange: ev => {
29
- setFilterValue(ev.target.value);
30
- }, selected: { items: selected }, menu: {
28
+ return (_jsx(ComboBox, { label: label, labelHidden: labelHidden, disabled: disabled, readOnly: readOnly, placeholder: translate('Select field'), mode: 'single-select', value: filterValue ?? '', testId: 'FieldSelector', onChange: ev => {
29
+ const newValue = ev.target.value;
30
+ if (!newValue) {
31
+ onChange('');
32
+ }
33
+ setFilterValue(newValue);
34
+ }, onBlur: () => {
35
+ setFilterValue(undefined);
36
+ }, selected: selected ? { items: selected } : undefined, menu: {
31
37
  items: filteredItems,
32
38
  mode: 'single-select',
33
39
  accent: filterRegex,
@@ -42,12 +48,13 @@ function FieldSelector(props) {
42
48
  }
43
49
  FieldSelector.propTypes = {
44
50
  value: PropTypes.string,
45
- columns: PropTypes.arrayOf(PropTypes.any).isRequired,
46
51
  onChange: PropTypes.func.isRequired,
47
52
  disabled: PropTypes.bool,
53
+ readOnly: PropTypes.bool,
48
54
  fieldProp: PropTypes.string,
49
55
  label: PropTypes.string.isRequired,
50
- labelHidden: PropTypes.bool
56
+ labelHidden: PropTypes.bool,
57
+ fieldDefs: PropTypes.arrayOf(PropTypes.object).isRequired
51
58
  };
52
59
  export default FieldSelector;
53
60
  //# sourceMappingURL=FieldSelector.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FieldSelector.js","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/FieldSelector.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,YAAY,MAAM,0BAA0B,CAAC;AAEpD,OAAO,uBAAuB,MAAM,eAAe,CAAC;AAEpD,SAAS,aAAa,CAAC,KAAK;IAC1B,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,GAAG,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAC5F,MAAM,CAAC,SAAS,CAAC,GAAG,YAAY,EAAE,CAAC;IAEnC,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE,CAAC,uBAAuB,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,CAAC,EACxD,CAAC,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC,CAC5B,CAAC;IACF,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE;QAC5B,MAAM,YAAY,GAAG,WAAW,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACvD,OAAO,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,YAAY,CAAC,EAAE,EAAE,IAAI,EAAE,YAAY,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IACx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UAAU;YACrB,WAAW,EAAE,EAAE,CAAC,EAAE;gBAChB,IAAI,QAAQ;oBAAE,OAAO;gBACrB,QAAQ,CAAC,EAAE,CAAC,CAAC;gBACb,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,0CAA0C;YACvE,CAAC;SACF,EACD,qBAAqB,EAAE,GAAG,EAAE,GAAE,CAAC,GAC/B,CACH,CAAC;AACJ,CAAC;AAED,aAAa,CAAC,SAAS,GAAG;IACxB,KAAK,EAAE,SAAS,CAAC,MAAM;IACvB,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;IACpD,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACnC,QAAQ,EAAE,SAAS,CAAC,IAAI;IACxB,SAAS,EAAE,SAAS,CAAC,MAAM;IAC3B,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;IAClC,WAAW,EAAE,SAAS,CAAC,IAAI;CAC5B,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { useMemo, useState } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { ComboBox, menuHelpers } from '@pega/cosmos-react-core';\n\nimport useTranslate from '../../Hooks/useTranslate';\n\nimport getMenuItemsFromColumns from './utils/utils';\n\nfunction FieldSelector(props) {\n const { value, onChange, columns, disabled = false, fieldProp, label, labelHidden } = props;\n const [translate] = useTranslate();\n\n const items = useMemo(\n () => getMenuItemsFromColumns(columns, fieldProp, value),\n [columns, value, fieldProp]\n );\n const selected = useMemo(() => {\n const selectedItem = menuHelpers.getItem(items, value);\n return selectedItem ? { id: selectedItem.id, text: selectedItem.primary } : undefined;\n }, [items, value]);\n\n const [filterValue, setFilterValue] = useState(undefined); // NOTE: `undefined` is needed to show the current selection\n const filterRegex = useMemo(() => {\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#Escaping\n // Literal string match from input, not user regex input.\n return filterValue\n ? new RegExp(filterValue.replace(/[.*+\\-?^${}()|[\\]\\\\]/g, '\\\\$&'), 'i')\n : undefined;\n }, [filterValue]);\n\n const filteredItems = useMemo(() => {\n return filterRegex\n ? menuHelpers.flatten(items).filter(({ primary }) => filterRegex.test(primary))\n : items;\n }, [filterRegex, items]);\n\n return (\n <ComboBox\n label={label}\n labelHidden={labelHidden}\n disabled={disabled}\n placeholder={translate('Select field')}\n mode='single-select'\n value={filterValue}\n testId='FieldSelector'\n onChange={ev => {\n setFilterValue(ev.target.value);\n }}\n selected={{ items: selected }}\n menu={{\n items: filteredItems,\n mode: 'single-select',\n accent: filterRegex,\n emptyText: 'No items',\n onItemClick: id => {\n if (disabled) return;\n onChange(id);\n setFilterValue(undefined); // To show the selected value in the input\n }\n }}\n onDropdownButtonClick={() => {}}\n />\n );\n}\n\nFieldSelector.propTypes = {\n value: PropTypes.string,\n columns: PropTypes.arrayOf(PropTypes.any).isRequired,\n onChange: PropTypes.func.isRequired,\n disabled: PropTypes.bool,\n fieldProp: PropTypes.string,\n label: PropTypes.string.isRequired,\n labelHidden: PropTypes.bool\n};\n\nexport default FieldSelector;\n"]}
1
+ {"version":3,"file":"FieldSelector.js","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/FieldSelector.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,YAAY,MAAM,0BAA0B,CAAC;AAEpD,OAAO,uBAAuB,MAAM,eAAe,CAAC;AAEpD,SAAS,aAAa,CAAC,KAAK;IAC1B,MAAM,EACJ,KAAK,EACL,QAAQ,EACR,QAAQ,GAAG,KAAK,EAChB,QAAQ,EACR,SAAS,EACT,KAAK,EACL,WAAW,EACX,SAAS,EACV,GAAG,KAAK,CAAC;IACV,MAAM,CAAC,SAAS,CAAC,GAAG,Y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E,SAAS,CAAC,MAAM;IAC3B,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;IAClC,WAAW,EAAE,SAAS,CAAC,IAAI;IAC3B,SAAS,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,UAAU;CAC1D,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { useMemo, useState } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { ComboBox, menuHelpers } from '@pega/cosmos-react-core';\n\nimport useTranslate from '../../Hooks/useTranslate';\n\nimport getMenuItemsFromColumns from './utils/utils';\n\nfunction FieldSelector(props) {\n const {\n value,\n onChange,\n disabled = false,\n readOnly,\n fieldProp,\n label,\n labelHidden,\n fieldDefs\n } = props;\n const [translate] = useTranslate();\n\n const items = useMemo(\n () => getMenuItemsFromColumns(fieldDefs, fieldProp, { selectedField: value }),\n [fieldDefs, value, fieldProp]\n );\n const selected = useMemo(() => {\n const selectedItem = menuHelpers.getItem(items, value);\n return selectedItem ? { id: selectedItem.id, text: selectedItem.primary } : undefined;\n }, [items, value]);\n\n const [filterValue, setFilterValue] = useState(undefined); // NOTE: `undefined` is needed to show the current selection\n const filterRegex = useMemo(() => {\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#Escaping\n // Literal string match from input, not user regex input.\n return filterValue\n ? new RegExp(filterValue.replace(/[.*+\\-?^${}()|[\\]\\\\]/g, '\\\\$&'), 'i')\n : undefined;\n }, [filterValue]);\n\n const filteredItems = useMemo(() => {\n return filterRegex\n ? menuHelpers.flatten(items).filter(({ primary }) => filterRegex.test(primary))\n : items;\n }, [filterRegex, items]);\n\n return (\n <ComboBox\n label={label}\n labelHidden={labelHidden}\n disabled={disabled}\n readOnly={readOnly}\n placeholder={translate('Select field')}\n mode='single-select'\n value={filterValue ?? ''}\n testId='FieldSelector'\n onChange={ev => {\n const newValue = ev.target.value;\n if (!newValue) {\n onChange('');\n }\n setFilterValue(newValue);\n }}\n onBlur={() => {\n setFilterValue(undefined);\n }}\n selected={selected ? { items: selected } : undefined}\n menu={{\n items: filteredItems,\n mode: 'single-select',\n accent: filterRegex,\n emptyText: 'No items',\n onItemClick: id => {\n if (disabled) return;\n onChange(id);\n setFilterValue(undefined); // To show the selected value in the input\n }\n }}\n onDropdownButtonClick={() => {}}\n />\n );\n}\n\nFieldSelector.propTypes = {\n value: PropTypes.string,\n onChange: PropTypes.func.isRequired,\n disabled: PropTypes.bool,\n readOnly: PropTypes.bool,\n fieldProp: PropTypes.string,\n label: PropTypes.string.isRequired,\n labelHidden: PropTypes.bool,\n fieldDefs: PropTypes.arrayOf(PropTypes.object).isRequired\n};\n\nexport default FieldSelector;\n"]}
@@ -13,10 +13,4 @@ export interface GroupingOptions {
13
13
  datetime: (DateFunction | undefined)[];
14
14
  };
15
15
  }
16
- /** Option object in the DateFunctionSelector component */
17
- export interface DateSelectorOption {
18
- key: DateFunction | 'NONE';
19
- dateFunction: DateFunction | undefined;
20
- label: string;
21
- }
22
16
  //# sourceMappingURL=Grouping.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Grouping.types.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/Grouping.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iFAAiF,CAAC;AAEpH,8HAA8H;AAC9H,MAAM,WAAW,eAAe;IAC9B,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7B,SAAS,EAAE;QACT,CAAC,QAAQ,EAAE,MAAM,GAAG;YAClB,SAAS,EAAE,CAAC,YAAY,GAAG,SAAS,CAAC,EAAE,CAAC;YACxC,SAAS,EAAE,CAAC,YAAY,GAAG,SAAS,CAAC,EAAE,CAAC;SACzC,CAAC;KACH,CAAC;IACF,iBAAiB,EAAE;QACjB,IAAI,EAAE,CAAC,YAAY,GAAG,SAAS,CAAC,EAAE,CAAC;QACnC,QAAQ,EAAE,CAAC,YAAY,GAAG,SAAS,CAAC,EAAE,CAAC;KACxC,CAAC;CACH;AAED,0DAA0D;AAC1D,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,YAAY,GAAG,MAAM,CAAC;IAC3B,YAAY,EAAE,YAAY,GAAG,SAAS,CAAC;IACvC,KAAK,EAAE,MAAM,CAAC;CACf"}
1
+ {"version":3,"file":"Grouping.types.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/Grouping.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iFAAiF,CAAC;AAEpH,8HAA8H;AAC9H,MAAM,WAAW,eAAe;IAC9B,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7B,SAAS,EAAE;QACT,CAAC,QAAQ,EAAE,MAAM,GAAG;YAClB,SAAS,EAAE,CAAC,YAAY,GAAG,SAAS,CAAC,EAAE,CAAC;YACxC,SAAS,EAAE,CAAC,YAAY,GAAG,SAAS,CAAC,EAAE,CAAC;SACzC,CAAC;KACH,CAAC;IACF,iBAAiB,EAAE;QACjB,IAAI,EAAE,CAAC,YAAY,GAAG,SAAS,CAAC,EAAE,CAAC;QACnC,QAAQ,EAAE,CAAC,YAAY,GAAG,SAAS,CAAC,EAAE,CAAC;KACxC,CAAC;CACH"}
@@ -1 +1 @@
1
- {"version":3,"file":"Grouping.types.js","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/Grouping.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { DateFunction } from '@pega/cosmos-react-condition-builder/lib/components/ConditionBuilder/core/types';\n\n/** Metadata used to identify which fields and which date functions are/aren't available for selection in the Grouping menu */\nexport interface GroupingOptions {\n exhaustedFields: Set<string>;\n dateFuncs: {\n [columnId: string]: {\n exhausted: (DateFunction | undefined)[];\n available: (DateFunction | undefined)[];\n };\n };\n dateGroupVariants: {\n date: (DateFunction | undefined)[];\n datetime: (DateFunction | undefined)[];\n };\n}\n\n/** Option object in the DateFunctionSelector component */\nexport interface DateSelectorOption {\n key: DateFunction | 'NONE';\n dateFunction: DateFunction | undefined;\n label: string;\n}\n"]}
1
+ {"version":3,"file":"Grouping.types.js","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/Grouping.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { DateFunction } from '@pega/cosmos-react-condition-builder/lib/components/ConditionBuilder/core/types';\n\n/** Metadata used to identify which fields and which date functions are/aren't available for selection in the Grouping menu */\nexport interface GroupingOptions {\n exhaustedFields: Set<string>;\n dateFuncs: {\n [columnId: string]: {\n exhausted: (DateFunction | undefined)[];\n available: (DateFunction | undefined)[];\n };\n };\n dateGroupVariants: {\n date: (DateFunction | undefined)[];\n datetime: (DateFunction | undefined)[];\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"RefreshBanner.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/RefreshBanner.jsx"],"names":[],"mappings":"AAkBA;;;4CA4BC;;;;;;;;;;sBA9CqB,YAAY"}
1
+ {"version":3,"file":"RefreshBanner.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/RefreshBanner.jsx"],"names":[],"mappings":"AAmBA;;;4CA4BC;;;;;;;;;;sBA/CqB,YAAY"}
@@ -5,6 +5,7 @@ import styled, { css } from 'styled-components';
5
5
  import { Banner, defaultThemeProp } from '@pega/cosmos-react-core';
6
6
  const StyledBanner = styled(Banner)(({ theme }) => {
7
7
  return css `
8
+ flex-shrink: 0;
8
9
  margin-bottom: calc(${theme.base.spacing} * 2);
9
10
  margin-top: calc(${theme.base.spacing} * 2);
10
11
  ul {
@@ -1 +1 @@
1
- {"version":3,"file":"RefreshBanner.js","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/RefreshBanner.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,M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,UAAU;CACxC,CAAC","sourcesContent":["import PropTypes from 'prop-types';\nimport { useState, useEffect } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Banner, defaultThemeProp } from '@pega/cosmos-react-core';\n\nconst StyledBanner = styled(Banner)(({ theme }) => {\n return css`\n margin-bottom: calc(${theme.base.spacing} * 2);\n margin-top: calc(${theme.base.spacing} * 2);\n ul {\n margin-inline-end: unset;\n }\n `;\n});\n\nStyledBanner.defaultProps = defaultThemeProp;\n\nexport default function RefreshBanner({ refreshNotification, forceRefresh }) {\n const { id: notificationId, message, refreshActionLabel } = refreshNotification || {};\n const [showBanner, setShowBanner] = useState(true);\n useEffect(() => {\n setShowBanner(true);\n }, [notificationId]);\n\n return (\n <>\n {showBanner && (\n <StyledBanner\n variant='info'\n messages={[\n {\n label: message,\n action: {\n text: refreshActionLabel,\n onClick: () => {\n forceRefresh();\n }\n }\n }\n ]}\n onDismiss={() => setShowBanner(false)}\n />\n )}\n </>\n );\n}\n\nRefreshBanner.propTypes = {\n refreshNotification: PropTypes.objectOf(PropTypes.any).isRequired,\n forceRefresh: PropTypes.func.isRequired\n};\n"]}
1
+ {"version":3,"file":"RefreshBanner.js","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/RefreshBanner.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAChD,OAAO,GAAG,CAAA;;0BAEc,KAAK,CAAC,IAAI,CAAC,OAAO;uBACrB,KAAK,CAAC,IAAI,CAAC,OAAO;;;;GAItC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,YAAY,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE7C,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,mBAAmB,EAAE,YAAY,EAAE;IACzE,MAAM,EAAE,EAAE,EAAE,cAAc,EAAE,OAAO,EAAE,kBAAkB,EAAE,GAAG,mBAAmB,IAAI,EAAE,CAAC;IACtF,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IACnD,SAAS,CAAC,GAAG,EAAE;QACb,aAAa,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAErB,OAAO,CACL,4BACG,UAAU,IAAI,CACb,KAAC,YAAY,IACX,OAAO,EAAC,MAAM,EACd,QAAQ,EAAE;gBACR;oBACE,KAAK,EAAE,OAAO;oBACd,MAAM,EAAE;wBACN,IAAI,EAAE,kBAAkB;wBACxB,OAAO,EAAE,GAAG,EAAE;4BACZ,YAAY,EAAE,CAAC;wBACjB,CAAC;qBACF;iBACF;aACF,EACD,SAAS,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,GACrC,CACH,GACA,CACJ,CAAC;AACJ,CAAC;AAED,aAAa,CAAC,SAAS,GAAG;IACxB,mBAAmB,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;IACjE,YAAY,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;CACxC,CAAC","sourcesContent":["import PropTypes from 'prop-types';\nimport { useState, useEffect } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Banner, defaultThemeProp } from '@pega/cosmos-react-core';\n\nconst StyledBanner = styled(Banner)(({ theme }) => {\n return css`\n flex-shrink: 0;\n margin-bottom: calc(${theme.base.spacing} * 2);\n margin-top: calc(${theme.base.spacing} * 2);\n ul {\n margin-inline-end: unset;\n }\n `;\n});\n\nStyledBanner.defaultProps = defaultThemeProp;\n\nexport default function RefreshBanner({ refreshNotification, forceRefresh }) {\n const { id: notificationId, message, refreshActionLabel } = refreshNotification || {};\n const [showBanner, setShowBanner] = useState(true);\n useEffect(() => {\n setShowBanner(true);\n }, [notificationId]);\n\n return (\n <>\n {showBanner && (\n <StyledBanner\n variant='info'\n messages={[\n {\n label: message,\n action: {\n text: refreshActionLabel,\n onClick: () => {\n forceRefresh();\n }\n }\n }\n ]}\n onDismiss={() => setShowBanner(false)}\n />\n )}\n </>\n );\n}\n\nRefreshBanner.propTypes = {\n refreshNotification: PropTypes.objectOf(PropTypes.any).isRequired,\n forceRefresh: PropTypes.func.isRequired\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SimpleToolbar.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/SimpleToolbar.jsx"],"names":[],"mappings":"AAaA;;4CAoCC;;;;;;;;;sBAjDqB,YAAY"}
1
+ {"version":3,"file":"SimpleToolbar.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/SimpleToolbar.jsx"],"names":[],"mappings":"AAWA;;4CAgCC;;;;;;;;;sBA3CqB,YAAY"}
@@ -1,22 +1,20 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import PropTypes from 'prop-types';
3
3
  import { ListToolbar } from '@pega/cosmos-react-core';
4
- import { REPEATING_STRUCTURE_TEMPLATES } from 'pega-repeating-structures-core';
5
4
  import RefreshBanner from './RefreshBanner';
6
5
  import getCount from './utils/getCount';
7
6
  import AnnounceRowsCount from './AnnounceRowsCount';
8
7
  import ValidateMessage from './ValidateMessage';
9
8
  import useFormControlProps from './hooks/useFormControlProps';
10
9
  import useWrapAction from './hooks/useWrapAction';
11
- import KeyboardInstructions from './KeyboardInstructions';
12
10
  export default function SimpleToolbar({ view }) {
13
- const { meta: { title, template } = {}, state, getContext, showCount, refreshNotification, type: { forceRefresh } } = view;
11
+ const { meta: { title, showTitle } = {}, state, getContext, showCount, refreshNotification, type: { forceRefresh } } = view;
14
12
  const { getRequiredDef } = getContext();
15
13
  const { validatemessage } = getRequiredDef() || {};
16
14
  const count = showCount ? getCount({ view }) : undefined;
17
15
  const formControlProps = useFormControlProps(view);
18
16
  const wrapAction = useWrapAction(view);
19
- return (_jsxs(AnnounceRowsCount, { state: state, count: count, children: [_jsx(ValidateMessage, { message: validatemessage, children: _jsx(ListToolbar, { name: title, count: count, formControlProps: formControlProps, wrap: template === REPEATING_STRUCTURE_TEMPLATES.TABLE && wrapAction, keyboardInstructions: template === REPEATING_STRUCTURE_TEMPLATES.TABLE ? (_jsx(KeyboardInstructions, { template: template })) : undefined }) }), refreshNotification && (_jsx(RefreshBanner, { refreshNotification: refreshNotification, forceRefresh: forceRefresh }))] }));
17
+ return (_jsxs(AnnounceRowsCount, { state: state, count: count, children: [_jsx(ValidateMessage, { message: validatemessage, children: _jsx(ListToolbar, { name: title, showName: showTitle, count: count, formControlProps: formControlProps, wrap: wrapAction }) }), refreshNotification && (_jsx(RefreshBanner, { refreshNotification: refreshNotification, forceRefresh: forceRefresh }))] }));
20
18
  }
21
19
  SimpleToolbar.propTypes = {
22
20
  view: PropTypes.objectOf(PropTypes.any).isRequired
@@ -1 +1 @@
1
- {"version":3,"file":"SimpleToolbar.js","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/SimpleToolbar.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAE/E,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,QAAQ,MAAM,kBAAkB,CAAC;AACxC,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,mBAAmB,MAAM,6BAA6B,CAAC;AAC9D,OAAO,aAAa,MAAM,uB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aAAa,CAAC,SAAS,GAAG;IACxB,IAAI,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;CACnD,CAAC","sourcesContent":["import PropTypes from 'prop-types';\n\nimport { ListToolbar } from '@pega/cosmos-react-core';\nimport { REPEATING_STRUCTURE_TEMPLATES } from 'pega-repeating-structures-core';\n\nimport RefreshBanner from './RefreshBanner';\nimport getCount from './utils/getCount';\nimport AnnounceRowsCount from './AnnounceRowsCount';\nimport ValidateMessage from './ValidateMessage';\nimport useFormControlProps from './hooks/useFormControlProps';\nimport useWrapAction from './hooks/useWrapAction';\nimport KeyboardInstructions from './KeyboardInstructions';\n\nexport default function SimpleToolbar({ view }) {\n const {\n meta: { title, template } = {},\n state,\n getContext,\n showCount,\n refreshNotification,\n type: { forceRefresh }\n } = view;\n const { getRequiredDef } = getContext();\n const { validatemessage } = getRequiredDef() || {};\n const count = showCount ? getCount({ view }) : undefined;\n const formControlProps = useFormControlProps(view);\n const wrapAction = useWrapAction(view);\n\n return (\n <AnnounceRowsCount state={state} count={count}>\n <ValidateMessage message={validatemessage}>\n <ListToolbar\n name={title}\n count={count}\n formControlProps={formControlProps}\n wrap={template === REPEATING_STRUCTURE_TEMPLATES.TABLE && wrapAction}\n keyboardInstructions={\n template === REPEATING_STRUCTURE_TEMPLATES.TABLE ? (\n <KeyboardInstructions template={template} />\n ) : undefined\n }\n />\n {/* FIXME: This implementation of error status should be considered temporary until an official, and properly accessible, spec is determined. */}\n </ValidateMessage>\n {refreshNotification && (\n <RefreshBanner refreshNotification={refreshNotification} forceRefresh={forceRefresh} />\n )}\n </AnnounceRowsCount>\n );\n}\n\nSimpleToolbar.propTypes = {\n view: PropTypes.objectOf(PropTypes.any).isRequired\n};\n"]}
1
+ {"version":3,"file":"SimpleToolbar.js","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/SimpleToolbar.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEn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Y,EAAE,YAAY,GAAI,CACxF,IACiB,CACrB,CAAC;AACJ,CAAC;AAED,aAAa,CAAC,SAAS,GAAG;IACxB,IAAI,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;CACnD,CAAC","sourcesContent":["import PropTypes from 'prop-types';\n\nimport { ListToolbar } from '@pega/cosmos-react-core';\n\nimport RefreshBanner from './RefreshBanner';\nimport getCount from './utils/getCount';\nimport AnnounceRowsCount from './AnnounceRowsCount';\nimport ValidateMessage from './ValidateMessage';\nimport useFormControlProps from './hooks/useFormControlProps';\nimport useWrapAction from './hooks/useWrapAction';\n\nexport default function SimpleToolbar({ view }) {\n const {\n meta: { title, showTitle } = {},\n state,\n getContext,\n showCount,\n refreshNotification,\n type: { forceRefresh }\n } = view;\n const { getRequiredDef } = getContext();\n const { validatemessage } = getRequiredDef() || {};\n const count = showCount ? getCount({ view }) : undefined;\n const formControlProps = useFormControlProps(view);\n const wrapAction = useWrapAction(view);\n\n return (\n <AnnounceRowsCount state={state} count={count}>\n <ValidateMessage message={validatemessage}>\n <ListToolbar\n name={title}\n showName={showTitle}\n count={count}\n formControlProps={formControlProps}\n wrap={wrapAction}\n />\n {/* FIXME: This implementation of error status should be considered temporary until an official, and properly accessible, spec is determined. */}\n </ValidateMessage>\n {refreshNotification && (\n <RefreshBanner refreshNotification={refreshNotification} forceRefresh={forceRefresh} />\n )}\n </AnnounceRowsCount>\n );\n}\n\nSimpleToolbar.propTypes = {\n view: PropTypes.objectOf(PropTypes.any).isRequired\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"useFilter.d.ts","sourceRoot":"","sources":["../../../../../Core/Components/Toolbar/hooks/useFilter.jsx"],"names":[],"mappings":";AAQA;;;;;;;cAoDC"}
1
+ {"version":3,"file":"useFilter.d.ts","sourceRoot":"","sources":["../../../../../Core/Components/Toolbar/hooks/useFilter.jsx"],"names":[],"mappings":";AAQA;;;;;;;cAyDC"}
@@ -7,7 +7,10 @@ import { TOOLBAR_FEATURES } from '../../../constants';
7
7
  const useFilter = ({ view }) => {
8
8
  const { state: { filterExpression, clearColFilter } = {}, type: { clearFilter, applyFilter } } = view;
9
9
  const displayFilter = view.shouldDisplayFeature(TOOLBAR_FEATURES.FILTER);
10
- const formattedColumns = useMemo(() => getMenuItemsFromColumns(view.columns?.filter(c => c.field.filter), 'name'), [view.columns]);
10
+ const viewFieldDefs = view.getFieldDefs();
11
+ const formattedColumns = useMemo(() => getMenuItemsFromColumns(viewFieldDefs?.filter(c => c.filter), 'name', {
12
+ columns: view.columns
13
+ }), [viewFieldDefs, view.columns]);
11
14
  const validRhsTypes = useValidRhsTypes(view);
12
15
  const handle = useRef(null);
13
16
  const { conditions } = splitConditionTree(filterExpression);
@@ -1 +1 @@
1
- {"version":3,"file":"useFilter.js","sourceRoot":"","sources":["../../../../../Core/Components/Toolbar/hooks/useFilter.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAE5F,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,uBAAuB,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,SAAS,GAAG,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;IAC7B,MAAM,EACJ,KAAK,EAAE,EAAE,gBAAgB,EAAE,cAAc,EAAE,GAAG,EAAE,EAChD,IAAI,EAAE,EAAE,WAAW,EAAE,WAAW,EAAE,EACnC,GAAG,IAAI,CAAC;IACT,MAAM,aAAa,GAAG,IAAI,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACzE,MAAM,gBAAgB,GAAG,OAAO,CAC9B,GAAG,EAAE,CACH,uBAAuB,CACrB,IAAI,CAAC,OAAO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I,CAAC,aAAa,EACtC,WAAW,QACX,MAAM,EAAE,MAAM,GACd,CACH,CAAC;IACJ,CAAC,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;IACjF,IAAI,CAAC,aAAa;QAAE,OAAO;IAC3B,OAAO;QACL,KAAK,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;QACvD,QAAQ,EAAE,cAAc;QACxB,QAAQ;QACR,QAAQ;KACT,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import { useCallback, useRef, useMemo } from 'react';\n\nimport { ConditionBuilder, splitConditionTree } from '@pega/cosmos-react-condition-builder';\n\nimport useValidRhsTypes from '../../Filters/Hooks/useValidRhsTypes';\nimport getMenuItemsFromColumns from '../utils/utils';\nimport { TOOLBAR_FEATURES } from '../../../constants';\n\nconst useFilter = ({ view }) => {\n const {\n state: { filterExpression, clearColFilter } = {},\n type: { clearFilter, applyFilter }\n } = view;\n const displayFilter = view.shouldDisplayFeature(TOOLBAR_FEATURES.FILTER);\n const formattedColumns = useMemo(\n () =>\n getMenuItemsFromColumns(\n view.columns?.filter(c => c.field.filter),\n 'name'\n ),\n [view.columns]\n );\n const validRhsTypes = useValidRhsTypes(view);\n const handle = useRef(null);\n const { conditions } = splitConditionTree(filterExpression);\n const filters = Object.keys(conditions) || [];\n\n const onSubmit = useCallback(() => {\n if (!handle?.current) return true;\n\n const [valid, newCondition] = handle.current.getCondition();\n if (!valid) return false;\n\n applyFilter({ filterExp: newCondition });\n if (clearColFilter) clearFilter(null);\n return true;\n }, [applyFilter, clearFilter, clearColFilter]);\n\n const onCancel = useCallback(() => {\n if (clearColFilter) clearFilter(null);\n }, [clearColFilter, clearFilter]);\n const filterRenderer = useCallback(() => {\n return (\n <ConditionBuilder\n fields={formattedColumns}\n condition={filterExpression || undefined}\n validRhsTypes={validRhsTypes}\n dateFunctions={view.meta.dateFunctions} // Could be undefined\n disallowNOT\n handle={handle}\n />\n );\n }, [filterExpression, formattedColumns, validRhsTypes, view.meta.dateFunctions]);\n if (!displayFilter) return;\n return {\n count: filters?.length > 0 ? filters.length : undefined,\n renderer: filterRenderer,\n onCancel,\n onSubmit\n };\n};\n\nexport default useFilter;\n"]}
1
+ {"version":3,"file":"useFilter.js","sourceRoot":"","sources":["../../../../../Core/Components/Toolbar/hooks/useFilter.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAE5F,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,uBAAuB,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,SAAS,GAAG,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;IAC7B,MAAM,EACJ,KAAK,EAAE,EAAE,gBAAgB,EAAE,cAAc,EAAE,GAAG,EAAE,EAChD,IAAI,EAAE,EAAE,WAAW,EAAE,WAAW,EAAE,EACnC,GAAG,IAAI,CAAC;IACT,MAAM,aAAa,GAAG,IAAI,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACzE,MAAM,aAAa,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;IAC1C,MAAM,gBAAgB,GAAG,OAAO,CAC9B,GAAG,EAAE,CACH,uBAAuB,CACrB,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,EACpC,MAAM,EACN;QACE,OAAO,EAAE,IAAI,CAAC,OAAO;KACtB,CACF,EACH,CAAC,aAAa,EAAE,IAAI,CAAC,OAAO,CAAC,CAC9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AI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;IACjF,IAAI,CAAC,aAAa;QAAE,OAAO;IAC3B,OAAO;QACL,KAAK,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;QACvD,QAAQ,EAAE,cAAc;QACxB,QAAQ;QACR,QAAQ;KACT,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import { useCallback, useRef, useMemo } from 'react';\n\nimport { ConditionBuilder, splitConditionTree } from '@pega/cosmos-react-condition-builder';\n\nimport useValidRhsTypes from '../../Filters/Hooks/useValidRhsTypes';\nimport getMenuItemsFromColumns from '../utils/utils';\nimport { TOOLBAR_FEATURES } from '../../../constants';\n\nconst useFilter = ({ view }) => {\n const {\n state: { filterExpression, clearColFilter } = {},\n type: { clearFilter, applyFilter }\n } = view;\n const displayFilter = view.shouldDisplayFeature(TOOLBAR_FEATURES.FILTER);\n const viewFieldDefs = view.getFieldDefs();\n const formattedColumns = useMemo(\n () =>\n getMenuItemsFromColumns(\n viewFieldDefs?.filter(c => c.filter),\n 'name',\n {\n columns: view.columns\n }\n ),\n [viewFieldDefs, view.columns]\n );\n\n const validRhsTypes = useValidRhsTypes(view);\n const handle = useRef(null);\n const { conditions } = splitConditionTree(filterExpression);\n const filters = Object.keys(conditions) || [];\n\n const onSubmit = useCallback(() => {\n if (!handle?.current) return true;\n\n const [valid, newCondition] = handle.current.getCondition();\n if (!valid) return false;\n\n applyFilter({ filterExp: newCondition });\n if (clearColFilter) clearFilter(null);\n return true;\n }, [applyFilter, clearFilter, clearColFilter]);\n\n const onCancel = useCallback(() => {\n if (clearColFilter) clearFilter(null);\n }, [clearColFilter, clearFilter]);\n const filterRenderer = useCallback(() => {\n return (\n <ConditionBuilder\n fields={formattedColumns}\n condition={filterExpression || undefined}\n validRhsTypes={validRhsTypes}\n dateFunctions={view.meta.dateFunctions} // Could be undefined\n disallowNOT\n handle={handle}\n />\n );\n }, [filterExpression, formattedColumns, validRhsTypes, view.meta.dateFunctions]);\n if (!displayFilter) return;\n return {\n count: filters?.length > 0 ? filters.length : undefined,\n renderer: filterRenderer,\n onCancel,\n onSubmit\n };\n};\n\nexport default useFilter;\n"]}
@@ -1,20 +1,16 @@
1
- export default DateFunctionSelector;
2
- /** Renders a Date-function selector in a grouping row if applicable */
3
- declare function DateFunctionSelector(props: any): import("react/jsx-runtime").JSX.Element | null;
4
- declare namespace DateFunctionSelector {
5
- namespace propTypes {
6
- let group: PropTypes.Validator<{
7
- [x: string]: any;
8
- }>;
9
- let dateFunctions: PropTypes.Requireable<{
10
- [x: string]: any;
11
- }>;
12
- let groupingOptions: PropTypes.Validator<{
13
- [x: string]: any;
14
- }>;
15
- let columns: PropTypes.Validator<any[]>;
16
- let onChange: PropTypes.Validator<(...args: any[]) => any>;
17
- }
1
+ import type { Group } from 'pega-repeating-structures-core/lib/types/State.types';
2
+ import type { RsCoreTypes } from 'pega-repeating-structures-core';
3
+ import type { GroupingOptions } from '../../Grouping.types';
4
+ import type { AppliedGroup } from './useGroup';
5
+ interface DateFunctionSelectorProps {
6
+ template: RsCoreTypes.Meta['template'];
7
+ group: AppliedGroup;
8
+ groupingOptions: GroupingOptions;
9
+ dateFunctions: RsCoreTypes.Meta['dateFunctions'];
10
+ fieldDefs: RsCoreTypes.Meta['fieldDefs'];
11
+ onChange: (newFunc: Group['dateFunction']) => void;
18
12
  }
19
- import PropTypes from 'prop-types';
13
+ /** Renders a Date-function selector in a grouping row if applicable */
14
+ declare const DateFunctionSelector: ({ template, group, groupingOptions, dateFunctions, fieldDefs, onChange }: DateFunctionSelectorProps) => import("react/jsx-runtime").JSX.Element | null;
15
+ export default DateFunctionSelector;
20
16
  //# sourceMappingURL=DateFunctionSelector.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DateFunctionSelector.d.ts","sourceRoot":"","sources":["../../../../../../Core/Components/Toolbar/hooks/useGroup/DateFunctionSelector.jsx"],"names":[],"mappings":";AAeA,uEAAuE;AACvE,kGA2DC;;;;;;;;;;;;;;;;sBA1EqB,YAAY"}
1
+ {"version":3,"file":"DateFunctionSelector.d.ts","sourceRoot":"","sources":["../../../../../../Core/Components/Toolbar/hooks/useGroup/DateFunctionSelector.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sDAAsD,CAAC;AAOlF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAGlE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAS/C,UAAU,yBAAyB;IACjC,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACvC,KAAK,EAAE,YAAY,CAAC;IACpB,eAAe,EAAE,eAAe,CAAC;IACjC,aAAa,EAAE,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACjD,SAAS,EAAE,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACzC,QAAQ,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;CACpD;AAED,uEAAuE;AACvE,QAAA,MAAM,oBAAoB,GAAI,0EAO3B,yBAAyB,mDAmE3B,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -1,26 +1,24 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useMemo } from 'react';
3
- import PropTypes from 'prop-types';
4
3
  import styled from 'styled-components';
5
4
  import { Option, Select } from '@pega/cosmos-react-core';
6
- import { dateFunctionLabels, FieldType } from 'pega-repeating-structures-core';
5
+ import { dateFunctionLabels, FieldType, REPEATING_STRUCTURE_TEMPLATES } from 'pega-repeating-structures-core';
7
6
  import useTranslate from '../../../../Hooks/useTranslate';
8
7
  import { getFieldType } from './utils';
9
8
  const StyledDateFuncWrapper = styled.div `
10
9
  width: 9rem;
11
10
  `;
11
+ const timelineAllowedDateFunctions = ['YEARS', 'QUARTERS', 'MONTHS', 'DAYS'];
12
12
  /** Renders a Date-function selector in a grouping row if applicable */
13
- const DateFunctionSelector = props => {
14
- const { group, groupingOptions, dateFunctions, columns, onChange } = props;
13
+ const DateFunctionSelector = ({ template, group, groupingOptions, dateFunctions, fieldDefs, onChange }) => {
15
14
  const [translate] = useTranslate();
16
- const fieldType = getFieldType(group.columnId, columns);
15
+ const fieldType = getFieldType(group.columnId, fieldDefs);
17
16
  /**
18
17
  * Determine what all date functions (if any) can be used for the given fieldType
19
- * @type { import("./Grouping.types").DateSelectorOption[] }
20
18
  */
21
19
  const allOptions = useMemo(() => {
22
20
  // If date functions are disabled or not applicable to the current field type
23
- if (!dateFunctions || ![FieldType.DATE, FieldType.DATE_TIME].includes(fieldType)) {
21
+ if (!dateFunctions || !(fieldType === FieldType.DATE || fieldType === FieldType.DATE_TIME)) {
24
22
  return [];
25
23
  }
26
24
  return [
@@ -43,15 +41,16 @@ const DateFunctionSelector = props => {
43
41
  // NOTE: Doing it this way to preserve the order of options.
44
42
  // If we instead appended `group.dateFunction` to `available`, the order or options will change on further selections.
45
43
  const { available } = groupingOptions.dateFuncs[group.columnId];
46
- const optionsToUse = allOptions.filter(o => available.includes(o.dateFunction) || o.dateFunction === group.dateFunction);
47
- return (_jsx(StyledDateFuncWrapper, { children: _jsx(Select, { label: 'Date function', labelHidden: true, "data-testid": 'GroupingDateFuncSelector', value: group.dateFunction || 'NONE', onChange: e => onChange(e.target.value === 'NONE' ? undefined : e.target.value), children: optionsToUse.map(o => (_jsx(Option, { value: o.key, children: translate(o.label) }, o.key))) }) }));
48
- };
49
- DateFunctionSelector.propTypes = {
50
- group: PropTypes.objectOf(PropTypes.any).isRequired,
51
- dateFunctions: PropTypes.objectOf(PropTypes.any),
52
- groupingOptions: PropTypes.objectOf(PropTypes.any).isRequired,
53
- columns: PropTypes.arrayOf(PropTypes.any).isRequired,
54
- onChange: PropTypes.func.isRequired
44
+ const optionsToUse = allOptions.filter(o => {
45
+ if (template === REPEATING_STRUCTURE_TEMPLATES.TIMELINE &&
46
+ (!o.dateFunction || !timelineAllowedDateFunctions.includes(o.dateFunction))) {
47
+ return false;
48
+ }
49
+ return available.includes(o.dateFunction) || o.dateFunction === group.dateFunction;
50
+ });
51
+ return (_jsx(StyledDateFuncWrapper, { children: _jsx(Select, { label: 'Date function', labelHidden: true, "data-testid": 'GroupingDateFuncSelector', value: group.dateFunction || 'NONE', onChange: e => {
52
+ onChange(e.target.value === 'NONE' ? undefined : e.target.value);
53
+ }, children: optionsToUse.map(o => (_jsx(Option, { value: o.key, children: translate(o.label) }, o.key))) }) }));
55
54
  };
56
55
  export default DateFunctionSelector;
57
56
  //# sourceMappingURL=DateFunctionSelector.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DateFunctionSelector.js","sourceRoot":"","sources":["../../../../../../Core/Components/Toolbar/hooks/useGroup/DateFunctionSelector.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE/E,OAAO,YAAY,MAAM,gCAAgC,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAA;;CAEvC,CAAC;AAEF,uEAAuE;AACvE,MAAM,oBAAoB,GAAG,KAAK,CAAC,EAAE;IACnC,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC3E,MAAM,CAAC,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AAC,IAAI,CAAC,CAAC,YAAY,KAAK,KAAK,CAAC,YAAY,CACjF,CAAC;IAEF,OAAO,CACL,KAAC,qBAAqB,cACpB,KAAC,MAAM,IACL,KAAK,EAAC,eAAe,EACrB,WAAW,uBACC,0BAA0B,EACtC,KAAK,EAAE,KAAK,CAAC,YAAY,IAAI,MAAM,EACnC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,YAE9E,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CACrB,KAAC,MAAM,IAAa,KAAK,EAAE,CAAC,CAAC,GAAG,YAC7B,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,IADR,CAAC,CAAC,GAAG,CAET,CACV,CAAC,GACK,GACa,CACzB,CAAC;AACJ,CAAC,CAAC;AACF,oBAAoB,CAAC,SAAS,GAAG;IAC/B,KAAK,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;IACnD,aAAa,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC;IAChD,eAAe,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;IAC7D,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;IACpD,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;CACpC,CAAC;AAEF,eAAe,oBAAoB,CAAC","sourcesContent":["import { useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport styled from 'styled-components';\n\nimport { Option, Select } from '@pega/cosmos-react-core';\nimport { dateFunctionLabels, FieldType } from 'pega-repeating-structures-core';\n\nimport useTranslate from '../../../../Hooks/useTranslate';\n\nimport { getFieldType } from './utils';\n\nconst StyledDateFuncWrapper = styled.div`\n width: 9rem;\n`;\n\n/** Renders a Date-function selector in a grouping row if applicable */\nconst DateFunctionSelector = props => {\n const { group, groupingOptions, dateFunctions, columns, onChange } = props;\n const [translate] = useTranslate();\n const fieldType = getFieldType(group.columnId, columns);\n\n /**\n * Determine what all date functions (if any) can be used for the given fieldType\n * @type { import(\"./Grouping.types\").DateSelectorOption[] }\n */\n const allOptions = useMemo(() => {\n // If date functions are disabled or not applicable to the current field type\n if (!dateFunctions || ![FieldType.DATE, FieldType.DATE_TIME].includes(fieldType)) {\n return [];\n }\n\n return [\n // Date functions applicable for the given field type\n ...dateFunctions[fieldType === FieldType.DATE ? 'DATE_ONLY' : 'DATE_TIME'].map(f => ({\n key: f,\n dateFunction: f,\n label: translate(dateFunctionLabels[f])\n })),\n\n // Option for grouping directly by the field values\n // The key 'NONE' is needed to work with the Select component\n { key: 'NONE', dateFunction: undefined, label: 'Default' }\n ];\n }, [dateFunctions, fieldType, translate]);\n\n // Skip if no options are available\n // i.e. date functions are disabled or not applicable to current field type\n if (allOptions.length === 0) {\n return null;\n }\n\n // NOTE: Doing it this way to preserve the order of options.\n // If we instead appended `group.dateFunction` to `available`, the order or options will change on further selections.\n const { available } = groupingOptions.dateFuncs[group.columnId];\n const optionsToUse = allOptions.filter(\n o => available.includes(o.dateFunction) || o.dateFunction === group.dateFunction\n );\n\n return (\n <StyledDateFuncWrapper>\n <Select\n label='Date function'\n labelHidden\n data-testid='GroupingDateFuncSelector'\n value={group.dateFunction || 'NONE'} // Can't set up `undefined` as value\n onChange={e => onChange(e.target.value === 'NONE' ? undefined : e.target.value)}\n >\n {optionsToUse.map(o => (\n <Option key={o.key} value={o.key}>\n {translate(o.label)}\n </Option>\n ))}\n </Select>\n </StyledDateFuncWrapper>\n );\n};\nDateFunctionSelector.propTypes = {\n group: PropTypes.objectOf(PropTypes.any).isRequired,\n dateFunctions: PropTypes.objectOf(PropTypes.any),\n groupingOptions: PropTypes.objectOf(PropTypes.any).isRequired,\n columns: PropTypes.arrayOf(PropTypes.any).isRequired,\n onChange: PropTypes.func.isRequired\n};\n\nexport default DateFunctionSelector;\n"]}
1
+ {"version":3,"file":"DateFunctionSelector.js","sourceRoot":"","sources":["../../../../../../Core/Components/Toolbar/hooks/useGroup/DateFunctionSelector.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAGvC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,6BAA6B,EAC9B,MAAM,gCAAgC,CAAC;AAGxC,OAAO,YAAY,MAAM,gCAAgC,CAAC;AAI1D,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAA;;CAEvC,CAAC;AAEF,MAAM,4BAA4B,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAW7E,uEAAuE;AACvE,MAAM,oBAAoB,GAAG,CAAC,EAC5B,QAAQ,EACR,KAAK,EACL,eAAe,EACf,aAAa,EACb,SAAS,EACT,QAAQ,EACkB,EAAE,EAAE;IAC9B,MAAM,CAAC,SAAS,CAAC,GAAG,YAAY,EAAE,CAAC;IACnC,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IAE1D;;OAEG;IACH,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE;QAC9B,6EAA6E;QAC7E,IAAI,CAAC,aAAa,IAAI,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,IAAI,IAAI,SAAS,KAAK,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC;YAC3F,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,OAAO;YACL,qDAAqD;YACrD,G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K,EAAE,KAAK,CAAC,YAAY,IAAI,MAAM,EACnC,QAAQ,EAAE,CAAC,CAAC,EAAE;gBACZ,QAAQ,CACN,CAAC,CAAC,MAAM,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAE,CAAC,CAAC,MAAM,CAAC,KAA+B,CAClF,CAAC;YACJ,CAAC,YAEA,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CACrB,KAAC,MAAM,IAAa,KAAK,EAAE,CAAC,CAAC,GAAG,YAC7B,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,IADR,CAAC,CAAC,GAAG,CAET,CACV,CAAC,GACK,GACa,CACzB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC","sourcesContent":["import { useMemo } from 'react';\nimport styled from 'styled-components';\n\nimport type { Group } from 'pega-repeating-structures-core/lib/types/State.types';\nimport { Option, Select } from '@pega/cosmos-react-core';\nimport {\n dateFunctionLabels,\n FieldType,\n REPEATING_STRUCTURE_TEMPLATES\n} from 'pega-repeating-structures-core';\nimport type { RsCoreTypes } from 'pega-repeating-structures-core';\n\nimport useTranslate from '../../../../Hooks/useTranslate';\nimport type { GroupingOptions } from '../../Grouping.types';\n\nimport type { AppliedGroup } from './useGroup';\nimport { getFieldType } from './utils';\n\nconst StyledDateFuncWrapper = styled.div`\n width: 9rem;\n`;\n\nconst timelineAllowedDateFunctions = ['YEARS', 'QUARTERS', 'MONTHS', 'DAYS'];\n\ninterface DateFunctionSelectorProps {\n template: RsCoreTypes.Meta['template'];\n group: AppliedGroup;\n groupingOptions: GroupingOptions;\n dateFunctions: RsCoreTypes.Meta['dateFunctions'];\n fieldDefs: RsCoreTypes.Meta['fieldDefs'];\n onChange: (newFunc: Group['dateFunction']) => void;\n}\n\n/** Renders a Date-function selector in a grouping row if applicable */\nconst DateFunctionSelector = ({\n template,\n group,\n groupingOptions,\n dateFunctions,\n fieldDefs,\n onChange\n}: DateFunctionSelectorProps) => {\n const [translate] = useTranslate();\n const fieldType = getFieldType(group.columnId, fieldDefs);\n\n /**\n * Determine what all date functions (if any) can be used for the given fieldType\n */\n const allOptions = useMemo(() => {\n // If date functions are disabled or not applicable to the current field type\n if (!dateFunctions || !(fieldType === FieldType.DATE || fieldType === FieldType.DATE_TIME)) {\n return [];\n }\n\n return [\n // Date functions applicable for the given field type\n ...dateFunctions[fieldType === FieldType.DATE ? 'DATE_ONLY' : 'DATE_TIME'].map(f => ({\n key: f,\n dateFunction: f,\n label: translate(dateFunctionLabels[f])\n })),\n\n // Option for grouping directly by the field values\n // The key 'NONE' is needed to work with the Select component\n { key: 'NONE', dateFunction: undefined, label: 'Default' }\n ];\n }, [dateFunctions, fieldType, translate]);\n\n // Skip if no options are available\n // i.e. date functions are disabled or not applicable to current field type\n if (allOptions.length === 0) {\n return null;\n }\n\n // NOTE: Doing it this way to preserve the order of options.\n // If we instead appended `group.dateFunction` to `available`, the order or options will change on further selections.\n const { available } = groupingOptions.dateFuncs[group.columnId];\n const optionsToUse = allOptions.filter(o => {\n if (\n template === REPEATING_STRUCTURE_TEMPLATES.TIMELINE &&\n (!o.dateFunction || !timelineAllowedDateFunctions.includes(o.dateFunction))\n ) {\n return false;\n }\n return available.includes(o.dateFunction) || o.dateFunction === group.dateFunction;\n });\n\n return (\n <StyledDateFuncWrapper>\n <Select\n label='Date function'\n labelHidden\n data-testid='GroupingDateFuncSelector'\n value={group.dateFunction || 'NONE'} // Can't set up `undefined` as a value\n onChange={e => {\n onChange(\n e.target.value === 'NONE' ? undefined : (e.target.value as Group['dateFunction'])\n );\n }}\n >\n {optionsToUse.map(o => (\n <Option key={o.key} value={o.key}>\n {translate(o.label)}\n </Option>\n ))}\n </Select>\n </StyledDateFuncWrapper>\n );\n};\n\nexport default DateFunctionSelector;\n"]}
@@ -1,4 +1,4 @@
1
- import { type RsCoreTypes } from 'pega-repeating-structures-core';
1
+ import type { RsCoreTypes } from 'pega-repeating-structures-core';
2
2
  import type { Group } from 'pega-repeating-structures-core/types/State.types';
3
3
  import type { GroupingOptions } from '../../Grouping.types';
4
4
  import type { AppliedGroup } from './useGroup';
@@ -10,7 +10,9 @@ interface GroupRendererProps {
10
10
  })[]) => void;
11
11
  columns: RsCoreTypes.Column[];
12
12
  dateFunctions: RsCoreTypes.Meta['dateFunctions'];
13
+ template: RsCoreTypes.Meta['template'];
14
+ fieldDefs: RsCoreTypes.Meta['fieldDefs'];
13
15
  }
14
- declare const GroupRenderer: ({ appliedGroups, groupingOptions, setGroups, columns, dateFunctions }: GroupRendererProps) => import("react/jsx-runtime").JSX.Element;
16
+ declare const GroupRenderer: ({ appliedGroups, groupingOptions, setGroups, columns, dateFunctions, template, fieldDefs }: GroupRendererProps) => import("react/jsx-runtime").JSX.Element;
15
17
  export default GroupRenderer;
16
18
  //# sourceMappingURL=GroupRenderer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GroupRenderer.d.ts","sourceRoot":"","sources":["../../../../../../Core/Components/Toolbar/hooks/useGroup/GroupRenderer.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kDAAkD,CAAC;AAK9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAI5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAQ/C,UAAU,kBAAkB;IAC1B,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,eAAe,EAAE,eAAe,CAAC;IACjC,SAAS,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,KAAK,IAAI,CAAC;IACxD,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC;IAC9B,aAAa,EAAE,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;CAClD;AAED,QAAA,MAAM,aAAa,GAAI,uEAMpB,kBAAkB,4CA0LpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"GroupRenderer.d.ts","sourceRoot":"","sources":["../../../../../../Core/Components/Toolbar/hooks/useGroup/GroupRenderer.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kDAAkD,CAAC;AAK9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAI5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAQ/C,UAAU,kBAAkB;IAC1B,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,eAAe,EAAE,eAAe,CAAC;IACjC,SAAS,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,KAAK,IAAI,CAAC;IACxD,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC;IAC9B,aAAa,EAAE,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACjD,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACvC,SAAS,EAAE,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;CAC1C;AAED,QAAA,MAAM,aAAa,GAAI,4FAQpB,kBAAkB,4CAuMpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -3,17 +3,17 @@ import { createElement as _createElement } from "react";
3
3
  import styled from 'styled-components';
4
4
  import { useCallback, useEffect, useRef } from 'react';
5
5
  import { Button, createUID, Flex, Icon, useI18n } from '@pega/cosmos-react-core';
6
- import { FieldType } from 'pega-repeating-structures-core';
6
+ import { FieldType, REPEATING_STRUCTURE_TEMPLATES } from 'pega-repeating-structures-core';
7
7
  import useRowFocus from '../useRowFocus';
8
8
  import useDragDrop from '../../../../Hooks/useDragDrop';
9
9
  import FieldSelector from '../../FieldSelector';
10
- import { getFieldType } from './utils';
10
+ import { getColumnById } from './utils';
11
11
  import DateFunctionSelector from './DateFunctionSelector';
12
12
  const DropSelector = '[data-drop]';
13
13
  const StyledDragHandle = styled(Button) `
14
14
  cursor: grab;
15
15
  `;
16
- const GroupRenderer = ({ appliedGroups, groupingOptions, setGroups, columns, dateFunctions }) => {
16
+ const GroupRenderer = ({ appliedGroups, groupingOptions, setGroups, columns, dateFunctions, template, fieldDefs }) => {
17
17
  const t = useI18n();
18
18
  const { focusRowRef, focusRowId, setFocusRowId } = useRowFocus();
19
19
  const dragDropRef = useRef(null);
@@ -47,13 +47,15 @@ const GroupRenderer = ({ appliedGroups, groupingOptions, setGroups, columns, dat
47
47
  const handleColumnChange = useCallback((group, index, newID) => {
48
48
  if (newID === group.columnId)
49
49
  return; // Ignore re-selecting the same
50
+ const groupedColumn = getColumnById(newID, columns);
50
51
  const updatedGroup = {
51
52
  ...group,
52
53
  columnId: newID,
53
- dateFunction: undefined // Reset for non-date/time fields
54
+ dateFunction: undefined, // Reset for non-date/time fields,
55
+ order: groupedColumn?.sortOrder || 'asc' // Set sort order from column else default to 'asc'
54
56
  };
55
57
  // For date/datetime field, pick a date function by default (if enabled)
56
- const fieldType = getFieldType(newID, columns);
58
+ const fieldType = groupedColumn?.field.type;
57
59
  if (dateFunctions && (fieldType === FieldType.DATE || fieldType === FieldType.DATE_TIME)) {
58
60
  updatedGroup.dateFunction = groupingOptions.dateFuncs[newID]
59
61
  ? groupingOptions.dateFuncs[newID].available[0] // If the field is already picked before
@@ -86,26 +88,32 @@ const GroupRenderer = ({ appliedGroups, groupingOptions, setGroups, columns, dat
86
88
  addRow();
87
89
  }
88
90
  }, [appliedGroups, addRow]);
89
- return (_jsxs(Flex, { container: { direction: 'column', gap: 2 }, children: [_jsx(Flex, { container: { direction: 'column', gap: 1 }, className: 'group-content', ref: dragDropRef, children: appliedGroups.map((group, index) => (_createElement("div", { ...dropProps, "data-index": index, key: group.id },
90
- _jsxs(Flex, { container: {
91
- justify: 'between',
92
- alignItems: 'center',
93
- direction: 'row',
94
- wrap: 'nowrap',
95
- itemGap: 0.5
96
- }, ref: appliedGroups[index].id === focusRowId ? focusRowRef : null, children: [_jsx(Flex, { item: { grow: 1 }, children: _jsxs(Flex, { container: {
97
- justify: 'start',
98
- alignItems: 'center',
99
- direction: 'row',
100
- wrap: 'nowrap',
101
- itemGap: 0.5
102
- }, children: [_jsx(StyledDragHandle, { forwardedAs: 'div', role: 'button', icon: true, variant: 'simple', compact: true, ...dragProps, children: _jsx(Icon, { name: 'drag' }) }), _jsx(Flex, { item: { grow: 1 }, children: _jsx(FieldSelector, { label: t('field'), labelHidden: true, columns: columns?.filter(c => c.field.grouping &&
103
- (c.field.id.toString() === group.columnId.toString() ||
104
- !groupingOptions.exhaustedFields.has(c.field.id))), value: group.columnId, disabled: !!group.customFunction, onChange: (newID) => handleColumnChange(group, index, newID), fieldProp: 'id' }) }), _jsx(DateFunctionSelector, { group: group, groupingOptions: groupingOptions, dateFunctions: dateFunctions, columns: columns, onChange: (newFunc) => handleDateFuncChange(group, index, newFunc) })] }) }), _jsx(Button, { icon: true, variant: 'simple', onClick: () => removeGroup(index), label: t('delete_group'), children: _jsx(Icon, { name: 'trash' }) })] })))) }), _jsx("div", { children: _jsx(Button, { variant: 'link', "aria-label": t('add_group'), onClick: addRow, children: _jsxs(Flex, { container: {
91
+ return (_jsxs(Flex, { container: { direction: 'column', gap: 2 }, children: [_jsx(Flex, { container: { direction: 'column', gap: 1 }, className: 'group-content', ref: dragDropRef, children: appliedGroups.map((group, index) => {
92
+ const fieldLabel = columns?.find(f => f.field.id === group.columnId)?.label;
93
+ const dragHandleLabel = fieldLabel
94
+ ? t('drag_to_reorder_field', [fieldLabel])
95
+ : t('drag_to_reorder');
96
+ return (_createElement("div", { ...dropProps, "data-index": index, key: group.id },
97
+ _jsxs(Flex, { container: {
98
+ justify: 'between',
99
+ alignItems: 'center',
100
+ direction: 'row',
101
+ wrap: 'nowrap',
102
+ itemGap: 0.5
103
+ }, ref: appliedGroups[index].id === focusRowId ? focusRowRef : null, children: [_jsx(Flex, { item: { grow: 1 }, children: _jsxs(Flex, { container: {
104
+ justify: 'start',
105
+ alignItems: 'center',
106
+ direction: 'row',
107
+ wrap: 'nowrap',
108
+ itemGap: 0.5
109
+ }, children: [_jsx(StyledDragHandle, { forwardedAs: 'div', role: 'button', icon: true, variant: 'simple', compact: true, "aria-label": dragHandleLabel, ...dragProps, children: _jsx(Icon, { name: 'drag' }) }), _jsx(Flex, { item: { grow: 1 }, children: _jsx(FieldSelector, { label: t('field'), labelHidden: true, value: group.columnId, disabled: !!group.customFunction, onChange: (newID) => handleColumnChange(group, index, newID), fieldProp: 'id', fieldDefs: fieldDefs?.filter(fieldDef => fieldDef.grouping &&
110
+ (fieldDef.id.toString() === group.columnId.toString() ||
111
+ !groupingOptions.exhaustedFields.has(fieldDef.id))) }) }), _jsx(DateFunctionSelector, { template: template, group: group, groupingOptions: groupingOptions, dateFunctions: dateFunctions, fieldDefs: fieldDefs, onChange: (newFunc) => handleDateFuncChange(group, index, newFunc) })] }) }), _jsx(Button, { icon: true, variant: 'simple', onClick: () => removeGroup(index), label: t('delete_group'), children: _jsx(Icon, { name: 'trash' }) })] })));
112
+ }) }), template !== REPEATING_STRUCTURE_TEMPLATES.TIMELINE && (_jsx("div", { children: _jsx(Button, { variant: 'link', "aria-label": t('add_group'), onClick: addRow, children: _jsxs(Flex, { container: {
105
113
  inline: true,
106
114
  alignItems: 'start',
107
115
  gap: 1
108
- }, as: 'span', children: [_jsx(Icon, { name: 'plus' }), _jsx("span", { children: t('add') })] }) }) })] }, 'grouping'));
116
+ }, as: 'span', children: [_jsx(Icon, { name: 'plus' }), _jsx("span", { children: t('add') })] }) }) }))] }, 'grouping'));
109
117
  };
110
118
  export default GroupRenderer;
111
119
  //# sourceMappingURL=GroupRenderer.js.map