@pega/lists-core 9.0.0-build.9.9 → 9.0.1

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 (277) hide show
  1. package/lib/index.d.ts +3 -2
  2. package/lib/index.d.ts.map +1 -1
  3. package/lib/index.js +3 -2
  4. package/lib/index.js.map +1 -1
  5. package/lib/src/core/RsCore.d.ts +1 -1
  6. package/lib/src/core/RsCore.js +1 -1
  7. package/lib/src/core/RsCore.js.map +1 -1
  8. package/lib/src/core/RsInternal.d.ts +23 -0
  9. package/lib/src/core/RsInternal.d.ts.map +1 -1
  10. package/lib/src/core/RsInternal.js +18 -2
  11. package/lib/src/core/RsInternal.js.map +1 -1
  12. package/lib/src/core/RsProps.d.ts +0 -7
  13. package/lib/src/core/RsProps.d.ts.map +1 -1
  14. package/lib/src/core/RsProps.js +0 -7
  15. package/lib/src/core/RsProps.js.map +1 -1
  16. package/lib/src/core/RsStore.d.ts +5 -1
  17. package/lib/src/core/RsStore.d.ts.map +1 -1
  18. package/lib/src/core/RsStore.js +12 -0
  19. package/lib/src/core/RsStore.js.map +1 -1
  20. package/lib/src/core/StateResolver.d.ts +0 -1
  21. package/lib/src/core/StateResolver.d.ts.map +1 -1
  22. package/lib/src/core/StateResolver.js +19 -9
  23. package/lib/src/core/StateResolver.js.map +1 -1
  24. package/lib/src/core/a11y/BaseA11y.d.ts +25 -6
  25. package/lib/src/core/a11y/BaseA11y.d.ts.map +1 -1
  26. package/lib/src/core/a11y/BaseA11y.js +39 -8
  27. package/lib/src/core/a11y/BaseA11y.js.map +1 -1
  28. package/lib/src/core/actions/actionConstants.d.ts +7 -4
  29. package/lib/src/core/actions/actionConstants.d.ts.map +1 -1
  30. package/lib/src/core/actions/actionConstants.js +8 -5
  31. package/lib/src/core/actions/actionConstants.js.map +1 -1
  32. package/lib/src/core/actions/actions.d.ts +35 -34
  33. package/lib/src/core/actions/actions.d.ts.map +1 -1
  34. package/lib/src/core/actions/actions.js +47 -40
  35. package/lib/src/core/actions/actions.js.map +1 -1
  36. package/lib/src/core/actions/actions.types.d.ts +34 -27
  37. package/lib/src/core/actions/actions.types.d.ts.map +1 -1
  38. package/lib/src/core/actions/actions.types.js.map +1 -1
  39. package/lib/src/core/config/config.d.ts +1 -1
  40. package/lib/src/core/config/config.d.ts.map +1 -1
  41. package/lib/src/core/config/config.js +5 -2
  42. package/lib/src/core/config/config.js.map +1 -1
  43. package/lib/src/core/constants.d.ts +4 -0
  44. package/lib/src/core/constants.d.ts.map +1 -1
  45. package/lib/src/core/constants.js +22 -5
  46. package/lib/src/core/constants.js.map +1 -1
  47. package/lib/src/core/defaultTranslations.d.ts +6 -1
  48. package/lib/src/core/defaultTranslations.d.ts.map +1 -1
  49. package/lib/src/core/defaultTranslations.js +6 -1
  50. package/lib/src/core/defaultTranslations.js.map +1 -1
  51. package/lib/src/core/features/featureFactory.d.ts +6 -2
  52. package/lib/src/core/features/featureFactory.d.ts.map +1 -1
  53. package/lib/src/core/features/featureFactory.js +9 -8
  54. package/lib/src/core/features/featureFactory.js.map +1 -1
  55. package/lib/src/core/features/uIFeatures/afterRender/animation.d.ts.map +1 -1
  56. package/lib/src/core/features/uIFeatures/afterRender/animation.js +11 -2
  57. package/lib/src/core/features/uIFeatures/afterRender/animation.js.map +1 -1
  58. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/autoSize.d.ts +2 -16
  59. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/autoSize.d.ts.map +1 -1
  60. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/autoSize.js +48 -89
  61. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/autoSize.js.map +1 -1
  62. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/index.d.ts +3 -4
  63. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/index.d.ts.map +1 -1
  64. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/index.js +83 -45
  65. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/index.js.map +1 -1
  66. package/lib/src/core/features/uIFeatures/afterRender/customizeParentContainer/index.d.ts.map +1 -1
  67. package/lib/src/core/features/uIFeatures/afterRender/customizeParentContainer/index.js +2 -2
  68. package/lib/src/core/features/uIFeatures/afterRender/customizeParentContainer/index.js.map +1 -1
  69. package/lib/src/core/features/uIFeatures/beforeRender/adjustHeight.d.ts +4 -1
  70. package/lib/src/core/features/uIFeatures/beforeRender/adjustHeight.d.ts.map +1 -1
  71. package/lib/src/core/features/uIFeatures/beforeRender/adjustHeight.js +15 -14
  72. package/lib/src/core/features/uIFeatures/beforeRender/adjustHeight.js.map +1 -1
  73. package/lib/src/core/features/uIFeatures/beforeRender/adjustHeightToFitRecords.d.ts.map +1 -1
  74. package/lib/src/core/features/uIFeatures/beforeRender/adjustHeightToFitRecords.js +10 -2
  75. package/lib/src/core/features/uIFeatures/beforeRender/adjustHeightToFitRecords.js.map +1 -1
  76. package/lib/src/core/features/uIFeatures/beforeRender/aggregation.d.ts +1 -1
  77. package/lib/src/core/features/uIFeatures/beforeRender/aggregation.js +2 -2
  78. package/lib/src/core/features/uIFeatures/beforeRender/aggregation.js.map +1 -1
  79. package/lib/src/core/features/uIFeatures/beforeRender/animation.d.ts +1 -1
  80. package/lib/src/core/features/uIFeatures/beforeRender/animation.d.ts.map +1 -1
  81. package/lib/src/core/features/uIFeatures/beforeRender/animation.js +5 -4
  82. package/lib/src/core/features/uIFeatures/beforeRender/animation.js.map +1 -1
  83. package/lib/src/core/features/uIFeatures/beforeRender/busyIndicator.d.ts +1 -1
  84. package/lib/src/core/features/uIFeatures/beforeRender/busyIndicator.js +2 -2
  85. package/lib/src/core/features/uIFeatures/beforeRender/busyIndicator.js.map +1 -1
  86. package/lib/src/core/features/uIFeatures/beforeRender/changePersonalisation.js +1 -1
  87. package/lib/src/core/features/uIFeatures/beforeRender/changePersonalisation.js.map +1 -1
  88. package/lib/src/core/features/uIFeatures/beforeRender/changeTemplate.d.ts +13 -0
  89. package/lib/src/core/features/uIFeatures/beforeRender/changeTemplate.d.ts.map +1 -0
  90. package/lib/src/core/features/uIFeatures/beforeRender/changeTemplate.js +40 -0
  91. package/lib/src/core/features/uIFeatures/beforeRender/changeTemplate.js.map +1 -0
  92. package/lib/src/core/features/uIFeatures/beforeRender/columnAlias.d.ts +2 -0
  93. package/lib/src/core/features/uIFeatures/beforeRender/columnAlias.d.ts.map +1 -1
  94. package/lib/src/core/features/uIFeatures/beforeRender/columnAlias.js +14 -1
  95. package/lib/src/core/features/uIFeatures/beforeRender/columnAlias.js.map +1 -1
  96. package/lib/src/core/features/uIFeatures/beforeRender/columnFormatter.d.ts.map +1 -1
  97. package/lib/src/core/features/uIFeatures/beforeRender/columnFormatter.js +7 -5
  98. package/lib/src/core/features/uIFeatures/beforeRender/columnFormatter.js.map +1 -1
  99. package/lib/src/core/features/uIFeatures/beforeRender/columnOrder.d.ts.map +1 -1
  100. package/lib/src/core/features/uIFeatures/beforeRender/columnOrder.js +13 -5
  101. package/lib/src/core/features/uIFeatures/beforeRender/columnOrder.js.map +1 -1
  102. package/lib/src/core/features/uIFeatures/beforeRender/columnReOrder.d.ts +1 -1
  103. package/lib/src/core/features/uIFeatures/beforeRender/columnReOrder.d.ts.map +1 -1
  104. package/lib/src/core/features/uIFeatures/beforeRender/columnReOrder.js +20 -17
  105. package/lib/src/core/features/uIFeatures/beforeRender/columnReOrder.js.map +1 -1
  106. package/lib/src/core/features/uIFeatures/beforeRender/columnSizing/resize.d.ts +2 -4
  107. package/lib/src/core/features/uIFeatures/beforeRender/columnSizing/resize.d.ts.map +1 -1
  108. package/lib/src/core/features/uIFeatures/beforeRender/columnSizing/resize.js +61 -40
  109. package/lib/src/core/features/uIFeatures/beforeRender/columnSizing/resize.js.map +1 -1
  110. package/lib/src/core/features/uIFeatures/beforeRender/columnSort.d.ts.map +1 -1
  111. package/lib/src/core/features/uIFeatures/beforeRender/columnSort.js +1 -1
  112. package/lib/src/core/features/uIFeatures/beforeRender/columnSort.js.map +1 -1
  113. package/lib/src/core/features/uIFeatures/beforeRender/columnToggle.d.ts +2 -2
  114. package/lib/src/core/features/uIFeatures/beforeRender/columnToggle.d.ts.map +1 -1
  115. package/lib/src/core/features/uIFeatures/beforeRender/columnToggle.js +10 -5
  116. package/lib/src/core/features/uIFeatures/beforeRender/columnToggle.js.map +1 -1
  117. package/lib/src/core/features/uIFeatures/beforeRender/columnVisualOrder.d.ts +1 -1
  118. package/lib/src/core/features/uIFeatures/beforeRender/columnVisualOrder.js +4 -4
  119. package/lib/src/core/features/uIFeatures/beforeRender/columnVisualOrder.js.map +1 -1
  120. package/lib/src/core/features/uIFeatures/beforeRender/conditionalStyleFormat.d.ts.map +1 -1
  121. package/lib/src/core/features/uIFeatures/beforeRender/conditionalStyleFormat.js +9 -8
  122. package/lib/src/core/features/uIFeatures/beforeRender/conditionalStyleFormat.js.map +1 -1
  123. package/lib/src/core/features/uIFeatures/beforeRender/customColumn.d.ts +1 -1
  124. package/lib/src/core/features/uIFeatures/beforeRender/customColumn.d.ts.map +1 -1
  125. package/lib/src/core/features/uIFeatures/beforeRender/customColumn.js +22 -8
  126. package/lib/src/core/features/uIFeatures/beforeRender/customColumn.js.map +1 -1
  127. package/lib/src/core/features/uIFeatures/beforeRender/errorColumn.d.ts.map +1 -1
  128. package/lib/src/core/features/uIFeatures/beforeRender/errorColumn.js +9 -6
  129. package/lib/src/core/features/uIFeatures/beforeRender/errorColumn.js.map +1 -1
  130. package/lib/src/core/features/uIFeatures/beforeRender/filter.d.ts +1 -0
  131. package/lib/src/core/features/uIFeatures/beforeRender/filter.d.ts.map +1 -1
  132. package/lib/src/core/features/uIFeatures/beforeRender/filter.js +13 -3
  133. package/lib/src/core/features/uIFeatures/beforeRender/filter.js.map +1 -1
  134. package/lib/src/core/features/uIFeatures/beforeRender/freeze.d.ts +2 -2
  135. package/lib/src/core/features/uIFeatures/beforeRender/freeze.d.ts.map +1 -1
  136. package/lib/src/core/features/uIFeatures/beforeRender/freeze.js +14 -9
  137. package/lib/src/core/features/uIFeatures/beforeRender/freeze.js.map +1 -1
  138. package/lib/src/core/features/uIFeatures/beforeRender/grouping.d.ts.map +1 -1
  139. package/lib/src/core/features/uIFeatures/beforeRender/grouping.js +23 -24
  140. package/lib/src/core/features/uIFeatures/beforeRender/grouping.js.map +1 -1
  141. package/lib/src/core/features/uIFeatures/beforeRender/prepareColumns.d.ts +32 -1
  142. package/lib/src/core/features/uIFeatures/beforeRender/prepareColumns.d.ts.map +1 -1
  143. package/lib/src/core/features/uIFeatures/beforeRender/prepareColumns.js +128 -32
  144. package/lib/src/core/features/uIFeatures/beforeRender/prepareColumns.js.map +1 -1
  145. package/lib/src/core/features/uIFeatures/beforeRender/prepareRows.d.ts.map +1 -1
  146. package/lib/src/core/features/uIFeatures/beforeRender/prepareRows.js +4 -4
  147. package/lib/src/core/features/uIFeatures/beforeRender/prepareRows.js.map +1 -1
  148. package/lib/src/core/features/uIFeatures/beforeRender/rowDragDrop.d.ts.map +1 -1
  149. package/lib/src/core/features/uIFeatures/beforeRender/rowDragDrop.js +14 -10
  150. package/lib/src/core/features/uIFeatures/beforeRender/rowDragDrop.js.map +1 -1
  151. package/lib/src/core/features/uIFeatures/beforeRender/stateHydration.d.ts +16 -4
  152. package/lib/src/core/features/uIFeatures/beforeRender/stateHydration.d.ts.map +1 -1
  153. package/lib/src/core/features/uIFeatures/beforeRender/stateHydration.js +124 -72
  154. package/lib/src/core/features/uIFeatures/beforeRender/stateHydration.js.map +1 -1
  155. package/lib/src/core/features/uIFeatures/beforeRender/stateSanitization.d.ts +2 -2
  156. package/lib/src/core/features/uIFeatures/beforeRender/stateSanitization.d.ts.map +1 -1
  157. package/lib/src/core/features/uIFeatures/beforeRender/stateSanitization.js +116 -37
  158. package/lib/src/core/features/uIFeatures/beforeRender/stateSanitization.js.map +1 -1
  159. package/lib/src/core/features/uIFeatures/index.d.ts +2 -3
  160. package/lib/src/core/features/uIFeatures/index.d.ts.map +1 -1
  161. package/lib/src/core/features/uIFeatures/index.js +2 -4
  162. package/lib/src/core/features/uIFeatures/index.js.map +1 -1
  163. package/lib/src/core/generators/ColumnGenerator.d.ts +15 -21
  164. package/lib/src/core/generators/ColumnGenerator.d.ts.map +1 -1
  165. package/lib/src/core/generators/ColumnGenerator.js +32 -95
  166. package/lib/src/core/generators/ColumnGenerator.js.map +1 -1
  167. package/lib/src/core/generators/ColumnGenerator.types.d.ts +16 -13
  168. package/lib/src/core/generators/ColumnGenerator.types.d.ts.map +1 -1
  169. package/lib/src/core/generators/ColumnGenerator.types.js.map +1 -1
  170. package/lib/src/core/generators/GroupGenerator.d.ts +5 -1
  171. package/lib/src/core/generators/GroupGenerator.d.ts.map +1 -1
  172. package/lib/src/core/generators/GroupGenerator.js +20 -0
  173. package/lib/src/core/generators/GroupGenerator.js.map +1 -1
  174. package/lib/src/core/generators/RowGenerator.d.ts +2 -2
  175. package/lib/src/core/generators/RowGenerator.d.ts.map +1 -1
  176. package/lib/src/core/generators/RowGenerator.js +3 -4
  177. package/lib/src/core/generators/RowGenerator.js.map +1 -1
  178. package/lib/src/core/generators/RowGenerator.types.d.ts +2 -1
  179. package/lib/src/core/generators/RowGenerator.types.d.ts.map +1 -1
  180. package/lib/src/core/generators/RowGenerator.types.js.map +1 -1
  181. package/lib/src/core/generators/ViewGenerator.d.ts +42 -28
  182. package/lib/src/core/generators/ViewGenerator.d.ts.map +1 -1
  183. package/lib/src/core/generators/ViewGenerator.js +101 -61
  184. package/lib/src/core/generators/ViewGenerator.js.map +1 -1
  185. package/lib/src/core/generators/ViewGenerator.types.d.ts +13 -1
  186. package/lib/src/core/generators/ViewGenerator.types.d.ts.map +1 -1
  187. package/lib/src/core/generators/ViewGenerator.types.js.map +1 -1
  188. package/lib/src/core/generators/__tests__/viewUtilityMockSetup.d.ts +3 -0
  189. package/lib/src/core/generators/__tests__/viewUtilityMockSetup.d.ts.map +1 -1
  190. package/lib/src/core/generators/viewUtilityMethods.d.ts +23 -10
  191. package/lib/src/core/generators/viewUtilityMethods.d.ts.map +1 -1
  192. package/lib/src/core/generators/viewUtilityMethods.js +50 -11
  193. package/lib/src/core/generators/viewUtilityMethods.js.map +1 -1
  194. package/lib/src/core/index.d.ts.map +1 -1
  195. package/lib/src/core/index.js +1 -2
  196. package/lib/src/core/index.js.map +1 -1
  197. package/lib/src/core/reducers/changeTemplate.d.ts +5 -0
  198. package/lib/src/core/reducers/changeTemplate.d.ts.map +1 -0
  199. package/lib/src/core/reducers/changeTemplate.js +14 -0
  200. package/lib/src/core/reducers/changeTemplate.js.map +1 -0
  201. package/lib/src/core/reducers/dragDrop.d.ts.map +1 -1
  202. package/lib/src/core/reducers/dragDrop.js +5 -4
  203. package/lib/src/core/reducers/dragDrop.js.map +1 -1
  204. package/lib/src/core/reducers/error.d.ts +8 -4
  205. package/lib/src/core/reducers/error.d.ts.map +1 -1
  206. package/lib/src/core/reducers/{edit.d.ts → galleryView.d.ts} +1 -1
  207. package/lib/src/core/reducers/galleryView.d.ts.map +1 -0
  208. package/lib/src/core/reducers/galleryView.js +11 -0
  209. package/lib/src/core/reducers/galleryView.js.map +1 -0
  210. package/lib/src/core/reducers/grouping.d.ts.map +1 -1
  211. package/lib/src/core/reducers/grouping.js +7 -0
  212. package/lib/src/core/reducers/grouping.js.map +1 -1
  213. package/lib/src/core/reducers/index.d.ts +8 -4
  214. package/lib/src/core/reducers/index.d.ts.map +1 -1
  215. package/lib/src/core/reducers/index.js +5 -3
  216. package/lib/src/core/reducers/index.js.map +1 -1
  217. package/lib/src/core/reducers/personalizationDirtyReducer.d.ts.map +1 -1
  218. package/lib/src/core/reducers/personalizationDirtyReducer.js +8 -4
  219. package/lib/src/core/reducers/personalizationDirtyReducer.js.map +1 -1
  220. package/lib/src/core/reducers/personalizationReducer.d.ts +3 -2
  221. package/lib/src/core/reducers/personalizationReducer.d.ts.map +1 -1
  222. package/lib/src/core/reducers/personalizationReducer.js +12 -4
  223. package/lib/src/core/reducers/personalizationReducer.js.map +1 -1
  224. package/lib/src/core/reducers/renderFormatter.d.ts.map +1 -1
  225. package/lib/src/core/reducers/renderFormatter.js +13 -3
  226. package/lib/src/core/reducers/renderFormatter.js.map +1 -1
  227. package/lib/src/core/reducers/rowSelect.d.ts.map +1 -1
  228. package/lib/src/core/reducers/rowSelect.js +0 -8
  229. package/lib/src/core/reducers/rowSelect.js.map +1 -1
  230. package/lib/src/core/reducers/versioning/index.d.ts +1 -1
  231. package/lib/src/core/reducers/versioning/index.d.ts.map +1 -1
  232. package/lib/src/core/reducers/versioning/index.js +1 -1
  233. package/lib/src/core/reducers/versioning/index.js.map +1 -1
  234. package/lib/src/core/reducers/visibility.d.ts +2 -1
  235. package/lib/src/core/reducers/visibility.d.ts.map +1 -1
  236. package/lib/src/core/reducers/visibility.js +69 -19
  237. package/lib/src/core/reducers/visibility.js.map +1 -1
  238. package/lib/src/core/test/junitMocks.d.ts +1322 -0
  239. package/lib/src/core/test/junitMocks.d.ts.map +1 -1
  240. package/lib/src/core/test/junitMocks.js +32 -51
  241. package/lib/src/core/test/junitMocks.js.map +1 -1
  242. package/lib/src/core/utils/condition-utils.d.ts +1 -1
  243. package/lib/src/core/utils/condition-utils.d.ts.map +1 -1
  244. package/lib/src/core/utils/condition-utils.js +5 -3
  245. package/lib/src/core/utils/condition-utils.js.map +1 -1
  246. package/lib/src/core/utils/util.d.ts +58 -9
  247. package/lib/src/core/utils/util.d.ts.map +1 -1
  248. package/lib/src/core/utils/util.js +151 -18
  249. package/lib/src/core/utils/util.js.map +1 -1
  250. package/lib/types/ApiContext.types.d.ts +69 -7
  251. package/lib/types/ApiContext.types.d.ts.map +1 -1
  252. package/lib/types/ApiContext.types.js.map +1 -1
  253. package/lib/types/Meta.types.d.ts +153 -11
  254. package/lib/types/Meta.types.d.ts.map +1 -1
  255. package/lib/types/Meta.types.js +7 -1
  256. package/lib/types/Meta.types.js.map +1 -1
  257. package/lib/types/RsCoreBootArgs.types.d.ts +11 -13
  258. package/lib/types/RsCoreBootArgs.types.d.ts.map +1 -1
  259. package/lib/types/RsCoreBootArgs.types.js.map +1 -1
  260. package/lib/types/State.types.d.ts +32 -30
  261. package/lib/types/State.types.d.ts.map +1 -1
  262. package/lib/types/State.types.js.map +1 -1
  263. package/lib/types.d.ts +10 -2
  264. package/lib/types.d.ts.map +1 -1
  265. package/lib/types.js.map +1 -1
  266. package/package.json +6 -8
  267. package/lib/src/core/features/uIFeatures/beforeRender/edit.d.ts +0 -12
  268. package/lib/src/core/features/uIFeatures/beforeRender/edit.d.ts.map +0 -1
  269. package/lib/src/core/features/uIFeatures/beforeRender/edit.js +0 -94
  270. package/lib/src/core/features/uIFeatures/beforeRender/edit.js.map +0 -1
  271. package/lib/src/core/features/uIFeatures/beforeRender/toggleSelectAllCheckbox.d.ts +0 -12
  272. package/lib/src/core/features/uIFeatures/beforeRender/toggleSelectAllCheckbox.d.ts.map +0 -1
  273. package/lib/src/core/features/uIFeatures/beforeRender/toggleSelectAllCheckbox.js +0 -51
  274. package/lib/src/core/features/uIFeatures/beforeRender/toggleSelectAllCheckbox.js.map +0 -1
  275. package/lib/src/core/reducers/edit.d.ts.map +0 -1
  276. package/lib/src/core/reducers/edit.js +0 -65
  277. package/lib/src/core/reducers/edit.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ColumnGenerator.types.js","sourceRoot":"","sources":["../../../../src/core/generators/ColumnGenerator.types.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC","sourcesContent":["import type { ExcludeStrict, OmitStrict } from '@pega/cosmos-react-core';\nimport type { Condition } from '@pega/cosmos-react-condition-builder';\n\nimport type { FieldDef, Meta } from '../../../types/Meta.types';\nimport type { AggregationType, CustomField, SortDirection } from '../../../types/State.types';\n\nimport type Column from './ColumnGenerator';\nimport type { RowContext, RowData } from './RowGenerator.types';\nimport type { FormatterFunction, ViewContext } from './ViewGenerator.types';\nimport type Row from './RowGenerator';\n\nexport const DATA_KEY = 'data-key';\nexport type ColumnConfig = Partial<\n Pick<\n Column,\n | 'style'\n | 'grouped'\n | 'frozen'\n | 'lastFrozen'\n | 'aggregated'\n | 'aggregateValue'\n | 'aggregationType'\n | 'currentWidth'\n | 'formatterAllowed'\n | 'formatterName'\n | 'formatter'\n | 'cellRenderer'\n | 'hidden'\n | 'label'\n | 'categorizedHeaderLabel'\n | 'filtered'\n | 'sorted'\n | 'sortSequence'\n | 'sortOrder'\n | 'isFirstVisualColumn'\n | 'isFirstDataColumn'\n | 'isLastColumn'\n | 'isCustomColumn'\n | 'editMode'\n | 'order'\n | 'classList'\n | 'showHeaderIcons'\n | 'isWidthChanged'\n | 'displayMode'\n | 'disableSelection'\n | 'alias'\n | 'refresh'\n | 'conditionalStyleFormats'\n >\n> & { field: FieldDef; showTooltip?: boolean };\n\nexport type ColumnResizerProps = {\n onMouseDown: (e: MouseEvent) => boolean | void;\n};\n\nexport type ColumnReorderProps = {\n onDragStart: (e: DragEvent) => boolean | undefined;\n onDrag: (e: DragEvent) => boolean;\n onDragEnd: (e: DragEvent) => boolean;\n};\n\ntype PixelValue = `${number}px`;\nexport interface ColumnStyle {\n /** Display attribute to be set on column */\n display: string;\n\n /** Left attribute denoting CSS attribute set in px */\n left: PixelValue;\n\n /** Visual order of column */\n order: number;\n\n /** Width attribute denoting CSS attribute set in px */\n width: PixelValue;\n}\n\n/** Sort properties exposed on a column */\nexport interface SortProperties {\n /** Indicates if a column is sorted. */\n sorted: boolean;\n\n /** Sequence of the sort with respect to other column sort sequences */\n sortSequence: number;\n\n /** Sort order on a column - ASC, DESC */\n sortOrder: (typeof SortDirection)[keyof typeof SortDirection];\n}\n\nexport interface ColumnContext {\n /** @default 'column' */\n name: 'column' | 'GroupAdditionalField';\n /** Returns {@link Column.field fieldDef} for this column. */\n getField: () => FieldDef;\n /** Returns the value of cell for this column based on {@link Column.executionContext} or overriddenExecutionContext. */\n getValue: () => RowData[keyof RowData] | undefined;\n /** Returns the current execution context for this column. It can return {@link overriddenExecutionContext} if passed. */\n getExecutionContext: () => RowContext | null;\n /** Returns the {@link View} Context object. */\n getParentContext: () => ViewContext;\n /** Returns the current formatter function for this column. */\n getFormatter: () => FormatterFunction | undefined;\n /** Indicates if formatter is allowed. */\n formatterAllowed: () => boolean;\n /** Returns the cell renderer name. */\n getCellRenderer: () => string | undefined;\n /** Returns the formatter name. */\n getFormatterName: () => string | undefined;\n /** Returns the formatted value. */\n getFormattedValue: () => string | null;\n /** Returns the search text. */\n getSearchKeyword: () => string | undefined;\n searchKeyword: string | undefined;\n /** Indicates if tooltip should be shown. */\n showTooltip: () => boolean;\n /** Returns the value to be shown on the tooltip. */\n getToolTipValue: () => RowData[keyof RowData] | undefined;\n /** Updates property of the column with value. The updated value will be reflected on next re-render. Check {@link setPropMutatively} for more info. */\n setProp: (\n prop:\n | Partial<OmitStrict<Column, 'data' | 'isAutoSizable' | 'parent'>>\n | ExcludeStrict<keyof Column, 'data' | 'isAutoSizable' | 'parent'>,\n value?: Column[keyof Column]\n ) => void;\n /** Returns the sort definition of the current column. */\n getSortProperties: () => {\n sorted: boolean;\n sortSequence: number | undefined;\n sortOrder: SortProperties['sortOrder'] | undefined;\n };\n /**\n * Returns the expression for the column if it is a {@link isCustomColumn custom} column.\n */\n getExpression: () => CustomField['expression'] | undefined;\n /** Returns the filter definition for the current column. */\n getFilterProperties: () => {\n filtered: boolean;\n filterExpression: Condition | undefined;\n };\n /** Returns the repeating structures {@link Meta meta}.\n * @deprecated Use {@link getRsMeta} instead.\n */\n getTableMeta: () => Meta;\n /** Returns the repeating structures {@link Meta meta}. */\n getRsMeta: () => Meta;\n /**\n * Applies grouping on this column.\n * It groups the rows based on column values.\n * This can be used to organize data into meaningful sections or categories.\n * Check {@link applyGrouping} for more details.\n */\n applyGrouping: () => void;\n /** Applies sorting to a column, ordering the data based on specified criteria. Check {@link applySorting} for more details. */\n applySorting: (flushState: boolean, sortOrderId: 'desc' | 'asc') => void;\n /** Toggles the visibility of the column. This can be used to show or hide the column. Check {@link applyToggleVisibility} for more details. */\n applyToggleVisibility: () => void;\n /** Applies a \"freeze\" effect to the column, locking it in place while the rest of the content\n * continues to scroll. This can be used to keep key columns visible in large datasets.\n * Check {@link applyFreeze} for more details. */\n applyFreeze: () => void;\n /** Applies aggregation to the column, summarizing the data based on a specified\n * {@link aggregationType}.\n * Check {@link applyAggregation} for more details.\n */\n applyAggregation: (type: AggregationType) => void;\n /** Applies custom label to the column. Check {@link applyLabel} for more details. */\n applyLabel: (label: string) => void;\n /** Applies formatter to the current column.\n * Check {@link applyFormatter} for more details.\n */\n applyFormatter: (name: string) => void;\n /** Applies merge operation to 2 columns based on selected expression.\n * Check {@link applyMerge} for more details.\n */\n applyMerge: (\n mergeWith: 'left' | 'right',\n title: string,\n templateName: string,\n bHideColumns: boolean\n ) => void;\n /** Deletes the {@link isCustomColumnustom column}. Check {@link deleteCustomColumn} for more details. */\n deleteCustomColumn: () => void;\n /** Sets the edit context for the column. Refer {@link setEditContext} for more details. */\n setEditContext: () => void;\n /** Returns the current renderer type. */\n getRendererType: () => 'cellRenderer' | 'cellEditRenderer' | 'customCellRenderer';\n /** Submits the edited cell value. */\n onSubmit: (editContext?: {\n oldValue: string | number | boolean | Date;\n newValue: string | number | boolean | Date;\n }) => void;\n /** Cancels the edit mode of the cell. */\n onCancel: () => void;\n /** Select all rows of the repeating structures. */\n selectAllRows: (isSelected: boolean) => Promise<void>;\n /** Indicates if the selection is disabled for this column. Refer {@link disableSelection} for more details. */\n getDisableSelection: () => boolean | undefined;\n}\n\nexport interface ColumnRenderingEngineProps {\n column: Column;\n row: Row | null;\n searchKeyword: string | undefined;\n}\n"]}
1
+ {"version":3,"file":"ColumnGenerator.types.js","sourceRoot":"","sources":["../../../../src/core/generators/ColumnGenerator.types.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC","sourcesContent":["import type { ExcludeStrict, OmitStrict } from '@pega/cosmos-react-core';\nimport type { Condition } from '@pega/cosmos-react-condition-builder';\n\nimport type { FieldDef, Meta } from '../../../types/Meta.types';\nimport type { AggregationType, CustomField, SortDirection } from '../../../types/State.types';\n\nimport type Column from './ColumnGenerator';\nimport type { RowContext, RowData } from './RowGenerator.types';\nimport type { FormatterFunction, ViewContext } from './ViewGenerator.types';\nimport type Row from './RowGenerator';\n\nexport const DATA_KEY = 'data-key';\nexport type ColumnConfig = Partial<\n Pick<\n Column,\n | 'style'\n | 'grouped'\n | 'frozen'\n | 'lastFrozen'\n | 'aggregated'\n | 'aggregateValue'\n | 'aggregationType'\n | 'currentWidth'\n | 'formatterAllowed'\n | 'formatterConfig'\n | 'formatter'\n | 'cellRenderer'\n | 'hidden'\n | 'label'\n | 'categorizedHeaderLabel'\n | 'filtered'\n | 'sorted'\n | 'sortSequence'\n | 'sortOrder'\n | 'isFirstVisualColumn'\n | 'isFirstDataColumn'\n | 'isLastColumn'\n | 'isCustomColumn'\n | 'order'\n | 'classList'\n | 'showHeaderIcons'\n | 'isWidthChanged'\n | 'displayMode'\n | 'disableSelection'\n | 'alias'\n | 'refresh'\n | 'conditionalStyleFormats'\n | 'field'\n >\n> & { field: FieldDef; showTooltip?: boolean };\n\nexport type ColumnResizerProps = {\n onMouseDown: (e: MouseEvent) => boolean | void;\n};\n\nexport type ColumnReorderProps = {\n onDragStart: (e: DragEvent) => boolean | undefined;\n onDrag: (e: DragEvent) => boolean;\n onDragEnd: (e: DragEvent) => boolean;\n};\n\ntype PixelValue = `${number}px`;\nexport interface ColumnStyle {\n /** Display attribute to be set on column */\n display: string;\n\n /** Left attribute denoting CSS attribute set in px */\n left: PixelValue;\n\n /** Visual order of column */\n order: number;\n\n /** Width attribute denoting CSS attribute set in px */\n width: PixelValue;\n}\n\n/** Sort properties exposed on a column */\nexport interface SortProperties {\n /** Indicates if a column is sorted. */\n sorted: boolean;\n\n /** Sequence of the sort with respect to other column sort sequences */\n sortSequence: number;\n\n /** Sort order on a column - ASC, DESC */\n sortOrder: (typeof SortDirection)[keyof typeof SortDirection];\n}\n\nexport interface ColumnContext {\n /** @default 'column' */\n name: 'column' | 'GroupAdditionalField';\n /** Returns {@link Column.field fieldDef} for this column. */\n getField: () => FieldDef;\n /** Returns the value of cell for this column based on {@link Column.executionContext} or overriddenExecutionContext. */\n getValue: () => RowData[keyof RowData] | undefined;\n /** Returns the current execution context for this column. It can return {@link overriddenExecutionContext} if passed. */\n getExecutionContext: () => RowContext | null;\n /** Returns the {@link View} Context object. */\n getParentContext: () => ViewContext;\n /** Returns the current formatter function for this column. */\n getFormatter: () => FormatterFunction | undefined;\n /** Indicates if formatter is allowed. */\n formatterAllowed: () => boolean;\n /** Returns the cell renderer name. */\n getCellRenderer: () => string | undefined;\n /** Returns the formatter name. */\n getFormatterValue: () => string | { type: string; config: unknown } | undefined;\n /** Returns the formatted value. */\n getFormattedValue: () => string | null;\n /** Returns the header label */\n getLabel: () => string | undefined;\n /** Returns the search text. */\n getSearchKeyword: () => string | undefined;\n searchKeyword: string | undefined;\n /** Indicates if tooltip should be shown. */\n showTooltip: () => boolean;\n /** Returns the value to be shown on the tooltip. */\n getToolTipValue: () => RowData[keyof RowData] | undefined;\n /** Updates property of the column with value. The updated value will be reflected on next re-render. Check {@link setPropMutatively} for more info. */\n setProp: (\n prop:\n | Partial<OmitStrict<Column, 'data' | 'isAutoSizable' | 'parent'>>\n | ExcludeStrict<keyof Column, 'data' | 'isAutoSizable' | 'parent'>,\n value?: Column[keyof Column]\n ) => void;\n /** Returns the sort definition of the current column. */\n getSortProperties: () => {\n sorted: boolean;\n sortSequence: number | undefined;\n sortOrder: SortProperties['sortOrder'] | undefined;\n };\n /**\n * Returns the expression for the column if it is a {@link isCustomColumn custom} column.\n */\n getExpression: () => CustomField['expression'] | undefined;\n /** Returns the filter definition for the current column. */\n getFilterProperties: () => {\n filtered: boolean;\n filterExpression: Condition | undefined;\n };\n /** Returns the repeating structures {@link Meta meta}.\n * @deprecated Use {@link getRsMeta} instead.\n */\n getTableMeta: () => Meta;\n /** Returns the repeating structures {@link Meta meta}. */\n getRsMeta: () => Meta;\n /**\n * Applies grouping on this column.\n * It groups the rows based on column values.\n * This can be used to organize data into meaningful sections or categories.\n * Check {@link applyGrouping} for more details.\n */\n applyGrouping: () => void;\n /** Applies sorting to a column, ordering the data based on specified criteria. Check {@link applySorting} for more details. */\n applySorting: (flushState: boolean, sortOrderId: 'desc' | 'asc') => void;\n /** Toggles the visibility of the column. This can be used to show or hide the column. Check {@link applyToggleVisibility} for more details. */\n applyToggleVisibility: () => void;\n /** Applies a \"freeze\" effect to the column, locking it in place while the rest of the content\n * continues to scroll. This can be used to keep key columns visible in large datasets.\n * Check {@link applyFreeze} for more details. */\n applyFreeze: () => void;\n /** Applies aggregation to the column, summarizing the data based on a specified\n * {@link aggregationType}.\n * Check {@link applyAggregation} for more details.\n */\n applyAggregation: (type: AggregationType) => void;\n /** Applies custom label to the column. Check {@link applyLabel} for more details. */\n applyLabel: (label: string) => void;\n /** Applies formatter to the current column.\n * Check {@link applyFormatter} for more details.\n */\n applyFormatter: (config: string | { type: string; config: unknown }) => void;\n /** Removes formatter of the current column.\n * Check {@link removeFormatter} for more details.\n */\n removeFormatter: () => void;\n /** Applies merge operation to 2 columns based on selected expression.\n * Check {@link applyMerge} for more details.\n */\n applyMerge: (\n mergeWith: 'left' | 'right',\n title: string,\n templateName: string,\n bHideColumns: boolean\n ) => void;\n /** Deletes the {@link isCustomColumnustom column}. Check {@link deleteCustomColumn} for more details. */\n deleteCustomColumn: () => void;\n /** Returns the current renderer type. */\n getRendererType: () => 'cellRenderer' | 'customCellRenderer';\n /** Select all rows of the repeating structures. */\n selectAllRows: (isSelected: boolean) => Promise<void>;\n /** Indicates if the selection is disabled for this column. Refer {@link disableSelection} for more details. */\n getDisableSelection: () => boolean | undefined;\n}\n\nexport interface ColumnRenderingEngineProps {\n column: Column;\n row: Row | null;\n searchKeyword: string | undefined;\n}\n"]}
@@ -1,4 +1,5 @@
1
- import type { AdditionalFieldData, AggregationResp } from '../../../types/ApiContext.types';
1
+ import type { AdditionalFieldData, AggregationResp, GroupAdditionalFieldUniqueValues } from '../../../types/ApiContext.types';
2
+ import type { GroupAdditionalField } from '../../../types/State.types';
2
3
  import type RsInternal from '../RsInternal';
3
4
  import type { RowData } from './RowGenerator.types';
4
5
  export interface GroupOptions {
@@ -20,6 +21,8 @@ export interface GroupOptions {
20
21
  }
21
22
  export default class GroupGenerator {
22
23
  #private;
24
+ /** Unique identifier for the group header. */
25
+ uniqueId: string;
23
26
  /** Indicates if the group header is visible. */
24
27
  isVisible: boolean;
25
28
  /** Indicates if the current group header is a leaf node. */
@@ -58,5 +61,6 @@ export default class GroupGenerator {
58
61
  index: number;
59
62
  constructor(groupOptions: GroupOptions, rsInternal: RsInternal);
60
63
  getRows(): import("./RowGenerator").default[] | undefined;
64
+ getAdditionalFieldData(additionalField: GroupAdditionalField): Promise<GroupAdditionalFieldUniqueValues | undefined>;
61
65
  }
62
66
  //# sourceMappingURL=GroupGenerator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GroupGenerator.d.ts","sourceRoot":"","sources":["../../../../src/core/generators/GroupGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAG5F,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAE5C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,IAAI,CAAC;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC;IAChD,KA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pB,0DAA0D;IAC1D,UAAU,EAAE,OAAO,CAAC;IACpB,gCAAgC;IAChC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,IAAI,CAAC;IAC9C,4EAA4E;IAC5E,OAAO,EAAE,MAAM,CAAC;IAChB,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,SAAS,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC;IAChD,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,wDAAwD;IACxD,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,6DAA6D;IAC7D,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,2DAA2D;IAC3D,IAAI,EAAS,OAAO,CAAC;IACrB,8CAA8C;IAC9C,IAAI,EAAS,OAAO,CAAC;IACrB,sCAAsC;IACtC,oBAAoB,EAAE,mBAAmB,EAAE,CAAC;IAC5C,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,KAAK,EAAG,MAAM,CAAC;gBAGH,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU;IAuC9D,OAAO;IAQD,sBAAsB,CAC1B,eAAe,EAAE,oBAAoB,GACpC,OAAO,CAAC,gCAAgC,GAAG,SAAS,CAAC;CAuBzD"}
@@ -1,4 +1,8 @@
1
+ import { createUID } from '@pega/cosmos-react-core';
2
+ import { deepCopy, getGroupKey } from '../utils/util';
1
3
  export default class GroupGenerator {
4
+ /** Unique identifier for the group header. */
5
+ uniqueId;
2
6
  /** Indicates if the group header is visible. */
3
7
  isVisible;
4
8
  /** Indicates if the current group header is a leaf node. */
@@ -38,6 +42,7 @@ export default class GroupGenerator {
38
42
  #rsInternal;
39
43
  constructor(groupOptions, rsInternal) {
40
44
  const { isVisible, isLeafNode, isExpanded, name, groupBy, level, label, hierarchy, count, aggregation, showHierarchicalFooter, isHierarchical, info, data, additionalFieldsData } = groupOptions;
45
+ this.uniqueId = createUID();
41
46
  this.isVisible = isVisible;
42
47
  this.isLeafNode = isLeafNode;
43
48
  this.isExpanded = isExpanded;
@@ -55,6 +60,7 @@ export default class GroupGenerator {
55
60
  this.additionalFieldsData = additionalFieldsData || [];
56
61
  this.#rsInternal = rsInternal;
57
62
  this.getRows = this.getRows.bind(this);
63
+ this.getAdditionalFieldData = this.getAdditionalFieldData.bind(this);
58
64
  }
59
65
  getRows() {
60
66
  const view = this.#rsInternal.getView();
@@ -63,5 +69,19 @@ export default class GroupGenerator {
63
69
  return view.rows.slice(this.startIndex, this.endIndex);
64
70
  }
65
71
  }
72
+ async getAdditionalFieldData(additionalField) {
73
+ const groupValues = this.hierarchy;
74
+ const groups = this.#rsInternal.getView().state.groups ?? [];
75
+ const groupFilters = groupValues.reduce((groupFilterAcc, groupValue, index) => {
76
+ const groupKey = getGroupKey(groups[index]);
77
+ groupFilterAcc[groupKey] = groupValue;
78
+ return groupFilterAcc;
79
+ }, {});
80
+ if (Object.keys(groupFilters).length && additionalField) {
81
+ return this.#rsInternal
82
+ .getRsProps()
83
+ .apiContext.fetchGroupAdditionalFieldUniqueValues?.(additionalField, groupFilters, deepCopy(this.#rsInternal.getView().state), this.#rsInternal.getView().meta);
84
+ }
85
+ }
66
86
  }
67
87
  //# sourceMappingURL=GroupGenerator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GroupGenerator.js","sourceRoot":"","sources":["../../../../src/core/generators/GroupGenerator.ts"],"names":[],"mappings":"AAyBA,MAAM,CAAC,OAAO,OAAO,cAAc;IACjC,gDAAgD;IAChD,SAAS,CAAU;IACnB,4DAA4D;IAC5D,UAAU,CAAU;IACpB,0DAA0D;I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C;QAC/B,IAAI,CAAC,sBAAsB,GAAG,sBAAsB,CAAC;QACrD,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC,oBAAoB,GAAG,oBAAoB,IAAI,EAAE,CAAC;QACvD,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAED,OAAO;QACL,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;QACxC,8EAA8E;QAC9E,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAW,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YAC1D,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QACzD,CAAC;IACH,CAAC;CACF","sourcesContent":["import type { AdditionalFieldData, AggregationResp } from '../../../types/ApiContext.types';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { FieldDef } from '../../../types/Meta.types';\nimport type RsInternal from '../RsInternal';\n\nimport type { RowData } from './RowGenerator.types';\n\nexport interface GroupOptions {\n isVisible: boolean;\n isLeafNode: boolean;\n isExpanded: boolean;\n name: string | number | boolean | Date | null;\n groupBy: string;\n level: number;\n label: string;\n hierarchy: (string | number | boolean | Date)[];\n count: number;\n aggregation?: AggregationResp;\n showHierarchicalFooter?: boolean;\n isHierarchical?: boolean;\n info?: RowData;\n data?: RowData;\n additionalFieldsData?: AdditionalFieldData[];\n}\n\nexport default class GroupGenerator {\n /** Indicates if the group header is visible. */\n isVisible: boolean;\n /** Indicates if the current group header is a leaf node. */\n isLeafNode: boolean;\n /** Indicates if the current group header is expanded. */\n isExpanded: boolean;\n /** Name of the group header. */\n name: string | number | boolean | Date | null;\n /** {@link FieldDef.name Name} of the field on which grouping is applied. */\n groupBy: string;\n /** Current group level, starts with 0 for 1st level of grouping. */\n level: number;\n /** {@link FieldDef.label Label} of the field on which grouping is applied */\n label: string;\n /** Path of the grouped column value. */\n hierarchy: (string | number | boolean | Date)[];\n /** Total count of the current group header. */\n count: number;\n /** Aggregation values if aggregation is applied with grouping */\n aggregation?: AggregationResp;\n /** Indicates if hierarchical footer should be shown. */\n showHierarchicalFooter?: boolean;\n /** Indicates if the current group header is hierarchical. */\n isHierarchical?: boolean;\n /** Row data for the current hierarchical group header. */\n info = {} as RowData;\n /** Row data for the current group header. */\n data = {} as RowData;\n /** Additional field data for group */\n additionalFieldsData: AdditionalFieldData[];\n /** Start index of the data of the current group header */\n startIndex?: number;\n /** End index of the data of the current group header */\n endIndex?: number;\n /** Holds the level of visible group headers. */\n index!: number;\n #rsInternal: RsInternal;\n\n constructor(groupOptions: GroupOptions, rsInternal: RsInternal) {\n const {\n isVisible,\n isLeafNode,\n isExpanded,\n name,\n groupBy,\n level,\n label,\n hierarchy,\n count,\n aggregation,\n showHierarchicalFooter,\n isHierarchical,\n info,\n data,\n additionalFieldsData\n } = groupOptions;\n this.isVisible = isVisible;\n this.isLeafNode = isLeafNode;\n this.isExpanded = isExpanded;\n this.name = name;\n this.groupBy = groupBy;\n this.level = level;\n this.label = label;\n this.hierarchy = hierarchy;\n this.count = count;\n this.aggregation = aggregation;\n this.showHierarchicalFooter = showHierarchicalFooter;\n this.isHierarchical = isHierarchical;\n this.info = info || {};\n this.data = data || {};\n this.additionalFieldsData = additionalFieldsData || [];\n this.#rsInternal = rsInternal;\n this.getRows = this.getRows.bind(this);\n }\n\n getRows() {\n const view = this.#rsInternal.getView();\n // we are supporting getData only on leaf node (considering view perspective).\n if (this.isLeafNode && this.startIndex! >= 0 && view.rows) {\n return view.rows.slice(this.startIndex, this.endIndex);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"GroupGenerator.js","sourceRoot":"","sources":["../../../../src/core/generators/GroupGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAWpD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAsBtD,MAAM,CAAC,OAAO,OAAO,cAAc;IACjC,8CAA8C;IAC9C,QAAQ,CAAS;IACjB,gDAAgD;IAChD,SAAS,CAAU;IACnB,4DAA4D;IAC5D,UAAU,CAAU;IACpB,0DAA0D;IAC1D,UAAU,CAAU;IACpB,gCAAgC;IAChC,IAAI,CAA0C;IAC9C,4EAA4E;IAC5E,OAAO,CAAS;IAChB,oEAAoE;IACpE,KAAK,CAAS;IACd,6EAA6E;IAC7E,KAAK,CAAS;IACd,wCAAwC;IACxC,SAAS,CAAuC;IAChD,+CAA+C;IAC/C,KAAK,CAAS;IACd,iEAAiE;IACjE,WAAW,CAAmB;IAC9B,wDAAwD;IACxD,sBAAsB,CAAW;IACjC,6DAA6D;IAC7D,cAAc,CAAW;IACzB,2DAA2D;IAC3D,IAAI,GAAG,EAAa,CAAC;IACrB,8CAA8C;IAC9C,IAAI,GAAG,EAAa,CAAC;IACrB,sCAAsC;IACtC,oBAAoB,CAAwB;IAC5C,0DAA0D;IAC1D,UAAU,CAAU;IACpB,wDAAwD;IACxD,QAAQ,CAAU;IAClB,gDAAgD;IAChD,KAAK,CAAU;IACf,WAAW,CAAa;IAExB,YAAY,YAA0B,EAAE,UAAsB;QAC5D,MAAM,EACJ,SAAS,EACT,UAAU,EACV,UAAU,EACV,IAAI,EACJ,OAAO,EACP,KAAK,EACL,KAAK,EACL,SAAS,EACT,KAAK,EACL,WAAW,EACX,sBAAsB,EACtB,cAAc,EACd,IAAI,EACJ,IAAI,EACJ,oBAAoB,EACrB,GAAG,YAAY,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,SAAS,EAAE,CAAC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AC;IAED,KAAK,CAAC,sBAAsB,CAC1B,eAAqC;QAErC,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC;QACnC,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC;QAC7D,MAAM,YAAY,GAAG,WAAW,CAAC,MAAM,CACrC,CAAC,cAAc,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE;YACpC,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YAC5C,cAAc,CAAC,QAAQ,CAAC,GAAG,UAAU,CAAC;YACtC,OAAO,cAAc,CAAC;QACxB,CAAC,EACD,EAAE,CACH,CAAC;QAEF,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,IAAI,eAAe,EAAE,CAAC;YACxD,OAAO,IAAI,CAAC,WAAW;iBACpB,UAAU,EAAE;iBACZ,UAAU,CAAC,qCAAqC,EAAE,CACjD,eAAe,EACf,YAAY,EACZ,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,EAC1C,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,IAAI,CAChC,CAAC;QACN,CAAC;IACH,CAAC;CACF","sourcesContent":["import { createUID } from '@pega/cosmos-react-core';\n\nimport type {\n AdditionalFieldData,\n AggregationResp,\n GroupAdditionalFieldUniqueValues\n} from '../../../types/ApiContext.types';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { FieldDef } from '../../../types/Meta.types';\nimport type { GroupAdditionalField, GroupFilter } from '../../../types/State.types';\nimport type RsInternal from '../RsInternal';\nimport { deepCopy, getGroupKey } from '../utils/util';\n\nimport type { RowData } from './RowGenerator.types';\n\nexport interface GroupOptions {\n isVisible: boolean;\n isLeafNode: boolean;\n isExpanded: boolean;\n name: string | number | boolean | Date | null;\n groupBy: string;\n level: number;\n label: string;\n hierarchy: (string | number | boolean | Date)[];\n count: number;\n aggregation?: AggregationResp;\n showHierarchicalFooter?: boolean;\n isHierarchical?: boolean;\n info?: RowData;\n data?: RowData;\n additionalFieldsData?: AdditionalFieldData[];\n}\n\nexport default class GroupGenerator {\n /** Unique identifier for the group header. */\n uniqueId: string;\n /** Indicates if the group header is visible. */\n isVisible: boolean;\n /** Indicates if the current group header is a leaf node. */\n isLeafNode: boolean;\n /** Indicates if the current group header is expanded. */\n isExpanded: boolean;\n /** Name of the group header. */\n name: string | number | boolean | Date | null;\n /** {@link FieldDef.name Name} of the field on which grouping is applied. */\n groupBy: string;\n /** Current group level, starts with 0 for 1st level of grouping. */\n level: number;\n /** {@link FieldDef.label Label} of the field on which grouping is applied */\n label: string;\n /** Path of the grouped column value. */\n hierarchy: (string | number | boolean | Date)[];\n /** Total count of the current group header. */\n count: number;\n /** Aggregation values if aggregation is applied with grouping */\n aggregation?: AggregationResp;\n /** Indicates if hierarchical footer should be shown. */\n showHierarchicalFooter?: boolean;\n /** Indicates if the current group header is hierarchical. */\n isHierarchical?: boolean;\n /** Row data for the current hierarchical group header. */\n info = {} as RowData;\n /** Row data for the current group header. */\n data = {} as RowData;\n /** Additional field data for group */\n additionalFieldsData: AdditionalFieldData[];\n /** Start index of the data of the current group header */\n startIndex?: number;\n /** End index of the data of the current group header */\n endIndex?: number;\n /** Holds the level of visible group headers. */\n index!: number;\n #rsInternal: RsInternal;\n\n constructor(groupOptions: GroupOptions, rsInternal: RsInternal) {\n const {\n isVisible,\n isLeafNode,\n isExpanded,\n name,\n groupBy,\n level,\n label,\n hierarchy,\n count,\n aggregation,\n showHierarchicalFooter,\n isHierarchical,\n info,\n data,\n additionalFieldsData\n } = groupOptions;\n this.uniqueId = createUID();\n this.isVisible = isVisible;\n this.isLeafNode = isLeafNode;\n this.isExpanded = isExpanded;\n this.name = name;\n this.groupBy = groupBy;\n this.level = level;\n this.label = label;\n this.hierarchy = hierarchy;\n this.count = count;\n this.aggregation = aggregation;\n this.showHierarchicalFooter = showHierarchicalFooter;\n this.isHierarchical = isHierarchical;\n this.info = info || {};\n this.data = data || {};\n this.additionalFieldsData = additionalFieldsData || [];\n this.#rsInternal = rsInternal;\n this.getRows = this.getRows.bind(this);\n this.getAdditionalFieldData = this.getAdditionalFieldData.bind(this);\n }\n\n getRows() {\n const view = this.#rsInternal.getView();\n // we are supporting getData only on leaf node (considering view perspective).\n if (this.isLeafNode && this.startIndex! >= 0 && view.rows) {\n return view.rows.slice(this.startIndex, this.endIndex);\n }\n }\n\n async getAdditionalFieldData(\n additionalField: GroupAdditionalField\n ): Promise<GroupAdditionalFieldUniqueValues | undefined> {\n const groupValues = this.hierarchy;\n const groups = this.#rsInternal.getView().state.groups ?? [];\n const groupFilters = groupValues.reduce<GroupFilter['filters']>(\n (groupFilterAcc, groupValue, index) => {\n const groupKey = getGroupKey(groups[index]);\n groupFilterAcc[groupKey] = groupValue;\n return groupFilterAcc;\n },\n {}\n );\n\n if (Object.keys(groupFilters).length && additionalField) {\n return this.#rsInternal\n .getRsProps()\n .apiContext.fetchGroupAdditionalFieldUniqueValues?.(\n additionalField,\n groupFilters,\n deepCopy(this.#rsInternal.getView().state),\n this.#rsInternal.getView().meta\n );\n }\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { DataError } from 'packages/lists-rs-core/types/State.types';
1
+ import type { DataError } from 'pega-repeating-structures-core/lib/types/State.types';
2
2
  import type RsInternal from '../RsInternal';
3
3
  import type View from './ViewGenerator';
4
4
  import { dataKey, type DragProps, type DropProps, type RowContext, type RowData, type RowHeader, type RowOptions, type UIProps } from './RowGenerator.types';
@@ -56,7 +56,7 @@ export default class Row {
56
56
  /**
57
57
  * This is used to create immutable objects of {@link Row} instance. Always call setProp if updating any properties of Row to make it immutable.
58
58
  * @param prop Either partial of row object or individual properties of row object.
59
- * @param [value] An optional parameter to provide value for {@link prop} in case prop is not of type {@link Row}
59
+ * @param value An optional parameter to provide value for {@link prop} in case prop is not of type {@link Row}
60
60
  */
61
61
  setProp(prop: Partial<RowOptions> | keyof RowOptions, value?: string | number | Date | boolean | DragProps | DropProps): void;
62
62
  /** This fetches the latest data of the row using
@@ -1 +1 @@
1
- {"version":3,"file":"RowGenerator.d.ts","sourceRoot":"","sources":["../../../../src/core/generators/RowGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAK1E,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAK5C,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,EACL,OAAO,EACP,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,OAAO,EACb,MAAM,sBAAsB,CAAC;AAE9B,0EAA0E;AAC1E,MAAM,CAAC,OAAO,OAAO,GAAG;;IACtB,sHAAsH;IAC/G,GAAG,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,+CAA+C;IACxC,SAAS,CAAC,EAAE,SAAS,CAAC;IAC7B,+CAA+C;IACxC,SAAS,CAAC,EAAE,SAAS,CAAC;IAC7B,oCAAoC;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,sIAAsI;IACtI,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGzB;;;;;;;;;;;OAWG;gBAED,EAAE,GAAG,EAAE,IAAY,EAAE,QAAY,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,UAAU,EACxF,UAAU,EAAE,UAAU;IAwBxB,0CAA0C;IAC1C,IAAI,MAAM,SAET;IAmBD;;;;OAIG;IACH,IAAI,QAAQ,WAEX;IAED,4BAA4B;IAC5B,IAAI,IAAI,YAEP;IAED;yFACqF;IACrF,IAAI,CAAC,OAA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.getRowError()?.message ? 'row row-error' : 'row';
102
102
  if (this.parent.meta.selectionMode === SELECTION_MODES.multi_on_hover)
103
103
  return this.$selected ? `${baseRowClass} selected-row` : `${baseRowClass} row-on-hover`;
104
- return this.parent.onRowClickAction ? `${baseRowClass} click` : `${baseRowClass}`;
104
+ return baseRowClass;
105
105
  }
106
106
  /** A transient value to signifies if a row is selected or not if selection mode is on. */
107
107
  get $selected() {
@@ -135,7 +135,7 @@ export default class Row {
135
135
  /**
136
136
  * This is used to create immutable objects of {@link Row} instance. Always call setProp if updating any properties of Row to make it immutable.
137
137
  * @param prop Either partial of row object or individual properties of row object.
138
- * @param [value] An optional parameter to provide value for {@link prop} in case prop is not of type {@link Row}
138
+ * @param value An optional parameter to provide value for {@link prop} in case prop is not of type {@link Row}
139
139
  */
140
140
  setProp(prop, value) {
141
141
  const { getView } = this.#rsInternal;
@@ -166,7 +166,7 @@ export default class Row {
166
166
  const { dispatch } = getRsStateResolver();
167
167
  const state = getRsStateResolver().getState();
168
168
  // TODO: Check if fetchRowData api is really needed? In case of grouped tables updating single row may cause issues. It is better to refresh whole view.
169
- const [rowData] = (await rsProps.apiContext.fetchRowData?.(deepCopy(state), getView().meta, getView().meta.itemKey, this[dataKey], {
169
+ const [rowData] = (await rsProps.apiContext.fetchRowData?.(deepCopy(state), getView().meta, getView().meta.itemKey, this[dataKey], this.data, {
170
170
  ...(getRsStore().refreshInProgress && {
171
171
  invalidateCache: true,
172
172
  invalidateCacheToken: getRsStore().refreshToken
@@ -225,7 +225,6 @@ export default class Row {
225
225
  this.parent.state.paginationOptions?.rootVirtualiser?.startIndex +
226
226
  this.parent.rows.findIndex(r => r === this) +
227
227
  1,
228
- onClick: getView().onRowClickAction?.bind(this, this.data),
229
228
  ...(!isRowReorderFieldEnabled(getView().meta) ? this.dragProps : {}),
230
229
  ...this.dropProps
231
230
  };
@@ -1 +1 @@
1
- {"version":3,"file":"RowGenerator.js","sourceRoot":"","sources":["../../../../src/core/generators/RowGenerator.ts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YACzB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,YAAY,EAAE,IAAI,CAAC,YAAY;SAChC,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { DataError } from 'packages/lists-rs-core/types/State.types';\n\nimport { STATE, SELECTION_MODES } from '../constants';\nimport { compareObjects, deepCopy, isRowReorderFieldEnabled } from '../utils/util';\nimport { actionForceUpdate, actionRowSelectionUpdate } from '../actions/actions';\nimport type RsInternal from '../RsInternal';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { Meta } from '../../../types/Meta.types';\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type View from './ViewGenerator';\nimport {\n dataKey,\n type DragProps,\n type DropProps,\n type RowContext,\n type RowData,\n type RowHeader,\n type RowOptions,\n type UIProps\n} from './RowGenerator.types';\nimport type Column from './ColumnGenerator';\n/** A row model that represents row of a repeating structure component. */\nexport default class Row {\n /** A unique key to identify a row object. The value of this must be derived from one of the key of {@link rowData} */\n public key: string;\n /** Value for Html attribute 'role'.\n * @default 'row'\n */\n role: string;\n /** Value of Html attribute 'tabindex'.\n * @default 0\n */\n tabIndex: number;\n /** Properties related to dragging behavior. */\n public dragProps?: DragProps;\n /** Properties related to dropping behavior. */\n public dropProps?: DropProps;\n /** Represents the data of a row. */\n rowData: RowData;\n /** A unique key to identify a row object in case {@link key} is duplicate. This can be used in the dom to uniquely identify a row. */\n uniqueId?: string | null;\n /** A reference to {@link RsInternal} object. */\n #rsInternal: RsInternal;\n /**\n * Creates an instance of Row object for a repeating structure.\n * @param args Constructor arguments\n * @param args.key A unique key to identify a row object.\n * @param args.role Value for Html attribute 'role'. Default is 'row'\n * @param args.tabIndex Value of Html attribute 'tabindex'. Default is 0.\n * @param args.dragProps Properties related to dragging behavior.\n * @param args.dropProps Properties related to dropping behavior.\n * @param args.rowData Represents the data of a row.\n * @param args.uniqueId A unique key to identify a row object in case {@link key} is duplicate.\n * @param rsInternal A reference to {@link RsInternal} object.\n */\n constructor(\n { key, role = 'row', tabIndex = 0, dragProps, dropProps, rowData, uniqueId }: RowOptions,\n rsInternal: RsInternal\n ) {\n this.key = key;\n this.role = role;\n this.tabIndex = tabIndex;\n this.dragProps = dragProps;\n this.dropProps = dropProps;\n this.rowData = rowData;\n this.uniqueId = uniqueId;\n this.#rsInternal = rsInternal;\n\n /** IMP: For generator methods use traditional function syntax\n * rather than arrow function for memory efficiency\n * and bind 'this' to the methods which requires 'this' context. */\n this.getUIProps = this.getUIProps.bind(this);\n this.getContext = this.getContext.bind(this);\n this.updateRow = this.updateRow.bind(this);\n this.selectRow = this.selectRow.bind(this);\n\n this.setProp = this.setProp.bind(this);\n this.getRowError = this.getRowError.bind(this);\n this.getRowHeader = this.getRowHeader.bind(this);\n }\n\n /** A reference to {@link View} object. */\n get parent() {\n return this.#rsInternal.getView();\n }\n\n /**\n * This is majorly used by {@link setprop} function to create a new row object from existing row object.\n * @returns the row instance properties.\n */\n #get(): RowOptions & { className: string } {\n return {\n key: this.key,\n role: this.role,\n tabIndex: this.tabIndex,\n className: this.className,\n dragProps: this.dragProps,\n dropProps: this.dropProps,\n rowData: this.rowData,\n uniqueId: this.uniqueId\n };\n }\n\n /**\n * This property serves to uniquely identify a row's DOM element within a DOM hierarchy.\n * It plays a vital role in modern JavaScript frameworks such as React, where optimizing DOM manipulation requires unique keys.\n * The value is derived from either {@link key} or {@link uniqueId} if {@link key} is duplicate.\n */\n get reactKey() {\n return this.uniqueId || this.key;\n }\n\n /** The data for the row. */\n get data() {\n return this.rowData;\n }\n\n /** Value of HTMl attribute data-key. The value is derived from\n * either the value of {@link Meta.itemKey itemkey} in {@link data} or {@link key} */\n get [dataKey](): string {\n const keyData = this.data?.[this.parent.meta.itemKey];\n if (keyData) return keyData as string;\n return this.key;\n }\n\n /** A set of CSS class names for Row element. */\n get className() {\n const baseRowClass = this.getRowError()?.message ? 'row row-error' : 'row';\n if (this.parent.meta.selectionMode === SELECTION_MODES.multi_on_hover)\n return this.$selected ? `${baseRowClass} selected-row` : `${baseRowClass} row-on-hover`;\n\n return this.parent.onRowClickAction ? `${baseRowClass} click` : `${baseRowClass}`;\n }\n\n /** A transient value to signifies if a row is selected or not if selection mode is on. */\n get $selected(): RowContext['$selected'] {\n const temporaryChangeSetValue = this.parent.state.rowSelectionChangeSet?.[this.key]?.selected;\n const committedValue = this.parent.state.selectedRows?.includes(this.key);\n if (\n (temporaryChangeSetValue ?? committedValue) &&\n this.parent.meta.selectionMode === SELECTION_MODES.single &&\n this.uniqueId\n ) {\n /**\n * temporaryChangeSetValue ?? committedValue - Is current row selected\n * this.parent.meta.selectionMode === SELECTION_MODES.single - Is single select mode\n * this.uniqueId - unique id is present only in case of duplicate rows\n */\n if (this.parent.getSingleSelectionRowKey()) {\n // This block is to avoid duplicate radio button selection on user selection\n return this.parent.getSingleSelectionRowKey() === this.uniqueId;\n }\n for (let i = 0; i < this.parent.rows!.length; i += 1) {\n // This block is to avoid duplicate radio button selection onload / remount\n const row = this.parent.rows![i];\n const rowTemporaryChangeSetValue =\n this.parent.state.rowSelectionChangeSet?.[row.key]?.selected;\n const rowCommittedValue =\n this.parent.state.selectedRows && this.parent.state.selectedRows?.includes(row.key);\n if (rowTemporaryChangeSetValue ?? rowCommittedValue) {\n // 'row' - first selected row in this.parent.rows\n return this.uniqueId === row.uniqueId; // If 'row' is same as current object return true otherwise return false\n }\n }\n }\n return temporaryChangeSetValue ?? committedValue;\n }\n\n /**\n * This is used to create immutable objects of {@link Row} instance. Always call setProp if updating any properties of Row to make it immutable.\n * @param prop Either partial of row object or individual properties of row object.\n * @param [value] An optional parameter to provide value for {@link prop} in case prop is not of type {@link Row}\n */\n setProp(\n prop: Partial<RowOptions> | keyof RowOptions,\n value?: string | number | Date | boolean | DragProps | DropProps\n ) {\n const { getView } = this.#rsInternal;\n const index = getView().rows!.findIndex(r => r === this);\n let pObject = prop;\n if (typeof prop !== 'object') {\n pObject = { [prop]: value };\n }\n\n // Change object if any value changes actually.\n // @ts-expect-error utils should be converted to TS in order to resolve this.\n if (!compareObjects(this, pObject, Object.keys(pObject))) {\n const newRow = new Row(\n {\n ...this.#get(),\n ...(pObject as RowOptions)\n },\n this.#rsInternal\n );\n const cloned = [...getView().rows!];\n cloned.splice(index, 1, newRow);\n getView().rows = cloned;\n }\n }\n\n /** This fetches the latest data of the row using\n * {@link rsProps.apiContext.fetchRowData fetchRowData} and updates the same in the {@link View} and {@link Row}\n * @returns void\n */\n async updateRow(): Promise<void> {\n const { getView, getRsProps, getRsStateResolver, getRsStore } = this.#rsInternal;\n const rsProps = getRsProps();\n const { dispatch } = getRsStateResolver();\n const state = getRsStateResolver().getState();\n // TODO: Check if fetchRowData api is really needed? In case of grouped tables updating single row may cause issues. It is better to refresh whole view.\n const [rowData] =\n (await rsProps.apiContext.fetchRowData?.(\n deepCopy(state),\n getView().meta,\n getView().meta.itemKey,\n this[dataKey],\n {\n ...(getRsStore().refreshInProgress && {\n invalidateCache: true,\n invalidateCacheToken: getRsStore().refreshToken\n })\n }\n )) || [];\n const dataIndex = getView().data!.findIndex(\n row => row[getView().meta.itemKey] === rowData[getView().meta.itemKey]\n );\n const rowIndex = getView().rows!.findIndex(row => row.key === rowData[getView().meta.itemKey]);\n if (dataIndex > -1) {\n getView().setProp({\n data: [\n ...getView().data!.slice(0, dataIndex),\n rowData,\n ...getView().data!.slice(dataIndex + 1)\n ],\n rows: [\n ...getView().rows!.slice(0, rowIndex),\n new Row(\n {\n key: rowData[getView().meta.itemKey] as string,\n rowData\n },\n this.#rsInternal\n ),\n ...getView().rows!.slice(rowIndex + 1)\n ]\n });\n dispatch(actionForceUpdate());\n }\n }\n\n /**\n * Used to select/deselect a {@link Row}.\n * @param selected Flag to indicate the row is selected or not.\n */\n selectRow(selected = true): void {\n const { getRsStateResolver } = this.#rsInternal;\n const { dispatch } = getRsStateResolver();\n this.parent.setSingleSelectionRowKey(this.uniqueId ?? (this.key as string));\n\n dispatch(\n actionRowSelectionUpdate({\n key: this.key as string,\n selected,\n data: this.data,\n status: STATE.NOT_STARTED,\n mode: this.parent.meta.selectionMode\n })\n );\n }\n\n /**\n * Returns the ui props for the {@link Row} that can be used to build a row in DOM.\n *\n */\n getUIProps(): UIProps {\n const { getView } = this.#rsInternal;\n return {\n className: this.className,\n 'data-error-message': this.getRowError()?.message,\n [dataKey]: this[dataKey],\n role: this.role,\n 'aria-rowindex':\n // eslint-disable-next-line no-unsafe-optional-chaining\n this.parent.state.paginationOptions?.rootVirtualiser?.startIndex! +\n this.parent.rows!.findIndex(r => r === this)! +\n 1,\n onClick: getView().onRowClickAction?.bind(this, this.data),\n ...(!isRowReorderFieldEnabled(getView().meta) ? this.dragProps : {}),\n ...this.dropProps\n };\n }\n\n /**\n *\n * @returns the errors on the row.\n */\n getRowError(): DataError[string | number] | undefined {\n return this.parent.state.errors?.dataErrors?.[this.key as string | number];\n }\n\n /**\n * Returns the current row Header field and value.\n * This api is exposed to the consumers of Repeating structures to access the row header information of the current row.\n *\n * @public\n */\n getRowHeader(): RowHeader | undefined {\n let rowHeaderColumn: Column | undefined;\n const columns = this.parent.getContext().getColumns();\n for (const column of columns!) {\n if (column.field.isRowHeader) {\n rowHeaderColumn = column;\n break;\n }\n if (column.isFirstDataColumn) {\n rowHeaderColumn = column;\n }\n }\n if (!rowHeaderColumn) {\n return undefined;\n }\n return {\n field: rowHeaderColumn as Column,\n getValue: () => rowHeaderColumn!.getContext().getValue()\n };\n }\n\n /**\n * Returns the current row context.\n * This api can be exposed to the consumers of Repeating structures to access the basic info regarding Row.\n *\n * @public\n */\n getContext(): RowContext {\n const { getRsProps, getView } = this.#rsInternal;\n const rsProps = getRsProps();\n return {\n name: 'row',\n getValue: () => this.data,\n getParentContext: this.parent.getContext,\n getRowActionDetails: (rowContext: RowData) => {\n return (\n rsProps.apiContext.fetchRowActionDetails?.(\n rowContext[getView().meta.itemKey] as string,\n rowContext\n ) ?? Promise.resolve([])\n );\n },\n getDragProps: () => this.dragProps,\n selectRow: this.selectRow,\n refreshRow: this.updateRow,\n $selected: this.$selected,\n getRowError: this.getRowError,\n getRowHeader: this.getRowHeader\n };\n }\n}\n"]}
1
+ {"version":3,"file":"RowGenerator.js","sourceRoot":"","sources":["../../../../src/core/generators/RowGenerator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAOjF,OAAO,EACL,OAAO,EAQR,MAAM,sBAAsB,CAAC;AAE9B,0EAA0E;AAC1E,MAAM,CAAC,OAAO,OAAO,GAAG;IACtB,sHAAsH;IAC/G,GAAG,CAAS;IACnB;;OAEG;IACH,IAAI,CAAS;IACb;;OAEG;IACH,QAAQ,CAAS;IACjB,+CAA+C;IACxC,SAAS,CAAa;IAC7B,+CAA+C;IACxC,SAAS,CAAa;IAC7B,oCAAoC;IACpC,OAAO,CAAU;IACjB,sIAAsI;IACtI,QAAQ,CAAiB;IACzB,gDAAgD;IAChD,WAAW,CAAa;IACxB;;;;;;;;;;;OAWG;IACH,YACE,EAAE,GAAG,EAAE,IAAI,GAAG,KAAK,EAAE,QAAQ,GAAG,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAc,EACxF,UAAsB;QAEtB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAE9B;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YAAY,EAAE,IAAI,CAAC,YAAY;SAChC,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { DataError } from 'pega-repeating-structures-core/lib/types/State.types';\n\nimport { STATE, SELECTION_MODES } from '../constants';\nimport { compareObjects, deepCopy, isRowReorderFieldEnabled } from '../utils/util';\nimport { actionForceUpdate, actionRowSelectionUpdate } from '../actions/actions';\nimport type RsInternal from '../RsInternal';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { Meta } from '../../../types/Meta.types';\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type View from './ViewGenerator';\nimport {\n dataKey,\n type DragProps,\n type DropProps,\n type RowContext,\n type RowData,\n type RowHeader,\n type RowOptions,\n type UIProps\n} from './RowGenerator.types';\nimport type Column from './ColumnGenerator';\n/** A row model that represents row of a repeating structure component. */\nexport default class Row {\n /** A unique key to identify a row object. The value of this must be derived from one of the key of {@link rowData} */\n public key: string;\n /** Value for Html attribute 'role'.\n * @default 'row'\n */\n role: string;\n /** Value of Html attribute 'tabindex'.\n * @default 0\n */\n tabIndex: number;\n /** Properties related to dragging behavior. */\n public dragProps?: DragProps;\n /** Properties related to dropping behavior. */\n public dropProps?: DropProps;\n /** Represents the data of a row. */\n rowData: RowData;\n /** A unique key to identify a row object in case {@link key} is duplicate. This can be used in the dom to uniquely identify a row. */\n uniqueId?: string | null;\n /** A reference to {@link RsInternal} object. */\n #rsInternal: RsInternal;\n /**\n * Creates an instance of Row object for a repeating structure.\n * @param args Constructor arguments\n * @param args.key A unique key to identify a row object.\n * @param args.role Value for Html attribute 'role'. Default is 'row'\n * @param args.tabIndex Value of Html attribute 'tabindex'. Default is 0.\n * @param args.dragProps Properties related to dragging behavior.\n * @param args.dropProps Properties related to dropping behavior.\n * @param args.rowData Represents the data of a row.\n * @param args.uniqueId A unique key to identify a row object in case {@link key} is duplicate.\n * @param rsInternal A reference to {@link RsInternal} object.\n */\n constructor(\n { key, role = 'row', tabIndex = 0, dragProps, dropProps, rowData, uniqueId }: RowOptions,\n rsInternal: RsInternal\n ) {\n this.key = key;\n this.role = role;\n this.tabIndex = tabIndex;\n this.dragProps = dragProps;\n this.dropProps = dropProps;\n this.rowData = rowData;\n this.uniqueId = uniqueId;\n this.#rsInternal = rsInternal;\n\n /** IMP: For generator methods use traditional function syntax\n * rather than arrow function for memory efficiency\n * and bind 'this' to the methods which requires 'this' context. */\n this.getUIProps = this.getUIProps.bind(this);\n this.getContext = this.getContext.bind(this);\n this.updateRow = this.updateRow.bind(this);\n this.selectRow = this.selectRow.bind(this);\n\n this.setProp = this.setProp.bind(this);\n this.getRowError = this.getRowError.bind(this);\n this.getRowHeader = this.getRowHeader.bind(this);\n }\n\n /** A reference to {@link View} object. */\n get parent() {\n return this.#rsInternal.getView();\n }\n\n /**\n * This is majorly used by {@link setprop} function to create a new row object from existing row object.\n * @returns the row instance properties.\n */\n #get(): RowOptions & { className: string } {\n return {\n key: this.key,\n role: this.role,\n tabIndex: this.tabIndex,\n className: this.className,\n dragProps: this.dragProps,\n dropProps: this.dropProps,\n rowData: this.rowData,\n uniqueId: this.uniqueId\n };\n }\n\n /**\n * This property serves to uniquely identify a row's DOM element within a DOM hierarchy.\n * It plays a vital role in modern JavaScript frameworks such as React, where optimizing DOM manipulation requires unique keys.\n * The value is derived from either {@link key} or {@link uniqueId} if {@link key} is duplicate.\n */\n get reactKey() {\n return this.uniqueId || this.key;\n }\n\n /** The data for the row. */\n get data() {\n return this.rowData;\n }\n\n /** Value of HTMl attribute data-key. The value is derived from\n * either the value of {@link Meta.itemKey itemkey} in {@link data} or {@link key} */\n get [dataKey](): string {\n const keyData = this.data?.[this.parent.meta.itemKey];\n if (keyData) return keyData as string;\n return this.key;\n }\n\n /** A set of CSS class names for Row element. */\n get className() {\n const baseRowClass = this.getRowError()?.message ? 'row row-error' : 'row';\n if (this.parent.meta.selectionMode === SELECTION_MODES.multi_on_hover)\n return this.$selected ? `${baseRowClass} selected-row` : `${baseRowClass} row-on-hover`;\n\n return baseRowClass;\n }\n\n /** A transient value to signifies if a row is selected or not if selection mode is on. */\n get $selected(): RowContext['$selected'] {\n const temporaryChangeSetValue = this.parent.state.rowSelectionChangeSet?.[this.key]?.selected;\n const committedValue = this.parent.state.selectedRows?.includes(this.key);\n if (\n (temporaryChangeSetValue ?? committedValue) &&\n this.parent.meta.selectionMode === SELECTION_MODES.single &&\n this.uniqueId\n ) {\n /**\n * temporaryChangeSetValue ?? committedValue - Is current row selected\n * this.parent.meta.selectionMode === SELECTION_MODES.single - Is single select mode\n * this.uniqueId - unique id is present only in case of duplicate rows\n */\n if (this.parent.getSingleSelectionRowKey()) {\n // This block is to avoid duplicate radio button selection on user selection\n return this.parent.getSingleSelectionRowKey() === this.uniqueId;\n }\n for (let i = 0; i < this.parent.rows!.length; i += 1) {\n // This block is to avoid duplicate radio button selection onload / remount\n const row = this.parent.rows![i];\n const rowTemporaryChangeSetValue =\n this.parent.state.rowSelectionChangeSet?.[row.key]?.selected;\n const rowCommittedValue =\n this.parent.state.selectedRows && this.parent.state.selectedRows?.includes(row.key);\n if (rowTemporaryChangeSetValue ?? rowCommittedValue) {\n // 'row' - first selected row in this.parent.rows\n return this.uniqueId === row.uniqueId; // If 'row' is same as current object return true otherwise return false\n }\n }\n }\n return temporaryChangeSetValue ?? committedValue;\n }\n\n /**\n * This is used to create immutable objects of {@link Row} instance. Always call setProp if updating any properties of Row to make it immutable.\n * @param prop Either partial of row object or individual properties of row object.\n * @param value An optional parameter to provide value for {@link prop} in case prop is not of type {@link Row}\n */\n setProp(\n prop: Partial<RowOptions> | keyof RowOptions,\n value?: string | number | Date | boolean | DragProps | DropProps\n ) {\n const { getView } = this.#rsInternal;\n const index = getView().rows!.findIndex(r => r === this);\n let pObject = prop;\n if (typeof prop !== 'object') {\n pObject = { [prop]: value };\n }\n\n // Change object if any value changes actually.\n // @ts-expect-error utils should be converted to TS in order to resolve this.\n if (!compareObjects(this, pObject, Object.keys(pObject))) {\n const newRow = new Row(\n {\n ...this.#get(),\n ...(pObject as RowOptions)\n },\n this.#rsInternal\n );\n const cloned = [...getView().rows!];\n cloned.splice(index, 1, newRow);\n getView().rows = cloned;\n }\n }\n\n /** This fetches the latest data of the row using\n * {@link rsProps.apiContext.fetchRowData fetchRowData} and updates the same in the {@link View} and {@link Row}\n * @returns void\n */\n async updateRow(): Promise<void> {\n const { getView, getRsProps, getRsStateResolver, getRsStore } = this.#rsInternal;\n const rsProps = getRsProps();\n const { dispatch } = getRsStateResolver();\n const state = getRsStateResolver().getState();\n // TODO: Check if fetchRowData api is really needed? In case of grouped tables updating single row may cause issues. It is better to refresh whole view.\n const [rowData] =\n (await rsProps.apiContext.fetchRowData?.(\n deepCopy(state),\n getView().meta,\n getView().meta.itemKey,\n this[dataKey],\n this.data,\n {\n ...(getRsStore().refreshInProgress && {\n invalidateCache: true,\n invalidateCacheToken: getRsStore().refreshToken\n })\n }\n )) || [];\n const dataIndex = getView().data!.findIndex(\n row => row[getView().meta.itemKey] === rowData[getView().meta.itemKey]\n );\n const rowIndex = getView().rows!.findIndex(row => row.key === rowData[getView().meta.itemKey]);\n if (dataIndex > -1) {\n getView().setProp({\n data: [\n ...getView().data!.slice(0, dataIndex),\n rowData,\n ...getView().data!.slice(dataIndex + 1)\n ],\n rows: [\n ...getView().rows!.slice(0, rowIndex),\n new Row(\n {\n key: rowData[getView().meta.itemKey] as string,\n rowData\n },\n this.#rsInternal\n ),\n ...getView().rows!.slice(rowIndex + 1)\n ]\n });\n dispatch(actionForceUpdate());\n }\n }\n\n /**\n * Used to select/deselect a {@link Row}.\n * @param selected Flag to indicate the row is selected or not.\n */\n selectRow(selected = true): void {\n const { getRsStateResolver } = this.#rsInternal;\n const { dispatch } = getRsStateResolver();\n this.parent.setSingleSelectionRowKey(this.uniqueId ?? (this.key as string));\n\n dispatch(\n actionRowSelectionUpdate({\n key: this.key as string,\n selected,\n data: this.data,\n status: STATE.NOT_STARTED,\n mode: this.parent.meta.selectionMode\n })\n );\n }\n\n /**\n * Returns the ui props for the {@link Row} that can be used to build a row in DOM.\n *\n */\n getUIProps(): UIProps {\n const { getView } = this.#rsInternal;\n return {\n className: this.className,\n 'data-error-message': this.getRowError()?.message,\n [dataKey]: this[dataKey],\n role: this.role,\n 'aria-rowindex':\n // eslint-disable-next-line no-unsafe-optional-chaining\n this.parent.state.paginationOptions?.rootVirtualiser?.startIndex! +\n this.parent.rows!.findIndex(r => r === this)! +\n 1,\n ...(!isRowReorderFieldEnabled(getView().meta) ? this.dragProps : {}),\n ...this.dropProps\n };\n }\n\n /**\n *\n * @returns the errors on the row.\n */\n getRowError(): DataError[string | number] | undefined {\n return this.parent.state.errors?.dataErrors?.[this.key as string | number];\n }\n\n /**\n * Returns the current row Header field and value.\n * This api is exposed to the consumers of Repeating structures to access the row header information of the current row.\n *\n * @public\n */\n getRowHeader(): RowHeader | undefined {\n let rowHeaderColumn: Column | undefined;\n const columns = this.parent.getContext().getColumns();\n for (const column of columns!) {\n if (column.field.isRowHeader) {\n rowHeaderColumn = column;\n break;\n }\n if (column.isFirstDataColumn) {\n rowHeaderColumn = column;\n }\n }\n if (!rowHeaderColumn) {\n return undefined;\n }\n return {\n field: rowHeaderColumn as Column,\n getValue: () => rowHeaderColumn!.getContext().getValue()\n };\n }\n\n /**\n * Returns the current row context.\n * This api can be exposed to the consumers of Repeating structures to access the basic info regarding Row.\n *\n * @public\n */\n getContext(): RowContext {\n const { getRsProps, getView } = this.#rsInternal;\n const rsProps = getRsProps();\n return {\n name: 'row',\n getValue: () => this.data,\n getParentContext: this.parent.getContext,\n getRowActionDetails: (rowContext: RowData) => {\n return (\n rsProps.apiContext.fetchRowActionDetails?.(\n rowContext[getView().meta.itemKey] as string,\n rowContext\n ) ?? Promise.resolve([])\n );\n },\n getDragProps: () => this.dragProps,\n selectRow: this.selectRow,\n refreshRow: this.updateRow,\n $selected: this.$selected,\n getRowError: this.getRowError,\n getRowHeader: this.getRowHeader\n };\n }\n}\n"]}
@@ -3,9 +3,10 @@ import type { DataError } from '../../../types/State.types';
3
3
  import type Column from './ColumnGenerator';
4
4
  import type Row from './RowGenerator';
5
5
  import type { ViewContext } from './ViewGenerator.types';
6
+ export type ScalarRowData = string | number | boolean | Date;
6
7
  /** Interface for expressing data present in a row */
7
8
  export interface RowData {
8
- [key: string]: null | string | number | boolean | Date | RowData | RowData[];
9
+ [key: string]: null | ScalarRowData | RowData | RowData[];
9
10
  }
10
11
  /** UI Props set on a row */
11
12
  export interface UIProps {
@@ -1 +1 @@
1
- {"version":3,"file":"RowGenerator.types.d.ts","sourceRoot":"","sources":["../../../../src/core/generators/RowGenerator.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,qDAAqD;AACrD,MAAM,WAAW,OAAO;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,OAAO,GAAG,OAAO,EAAE,CAAC;CAC9E;AAED,4BAA4B;AAC5B,MAAM,WAAW,OAAO;IACtB,4BAA4B;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IAEb,0EAA0E;IAC1E,eAAe,EAAE,MAAM,CAAC;IAExB,+BAA+B;IAC/B,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAE9B,4DAA4D;IAC5D,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,mCAAmC;IACnC,oBAAoB,CAAC,EAAE,MAAM,CAA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AAO,KAAK,IAAI,CAAC;IAEvC;;;OAGG;IACH,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhC,4CAA4C;IAC5C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,WAAW,EAAE,MAAM,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,SAAS,CAAC;IAC1D;;;OAGG;IACH,YAAY,EAAE,MAAM,SAAS,GAAG,SAAS,CAAC;CAC3C;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAAC;AAEF,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,OAAO,CAAC,MAAM,OAAO,CAAC,GAAG,SAAS,CAAC;CACpD;AAED,eAAO,MAAM,OAAO,aAAa,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"RowGenerator.types.js","sourceRoot":"","sources":["../../../../src/core/generators/RowGenerator.types.ts"],"names":[],"mappings":"AAsHA,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC","sourcesContent":["import type { ApiContext } from '../../../types/ApiContext.types';\nimport type { DataError } from '../../../types/State.types';\n\nimport type Column from './ColumnGenerator';\nimport type Row from './RowGenerator';\nimport type { ViewContext } from './ViewGenerator.types';\n\n/** Interface for expressing data present in a row */\nexport interface RowData {\n [key: string]: null | string | number | boolean | Date | RowData | RowData[];\n}\n\n/** UI Props set on a row */\nexport interface UIProps {\n /** Class name of the row */\n className: string;\n /** Role to be set on row for A11y purpose */\n role: string;\n\n /** aria-rowindex attribute is set on row and is used by screen readers */\n 'aria-rowindex': number;\n\n /** On click handler exposed */\n onClick?: (data: Row) => void;\n\n /** Drag props exposed on row for drag and drop operation */\n dragProps?: DragProps;\n\n /** Drop props exposed on row for drag and drop operation */\n dropProps?: DropProps;\n /** The error message for a row. */\n 'data-error-message'?: string;\n /** A key to uniquely identify a row. */\n 'data-key': string;\n}\n\nexport interface DragProps {\n /** Boolean denoting if a row is draggable */\n draggable: boolean;\n\n /** Event handler attached on the row for drag start event */\n onDragStart: (e: DragEvent) => void;\n\n /** Event handler attached on the row for drag end event */\n onDragEnd: (e: DragEvent) => void;\n}\n\n/** Drop props exposed on row for drag and drop operation */\nexport interface DropProps {\n /** Event handler attached on the row for drag enter event */\n onDragEnter: (e: DragEvent) => void;\n\n /** Event handler attached on the row for drag leave event */\n onDragLeave: (e: DragEvent) => void;\n\n /** Selector exposed for dropping a row */\n 'data-drop': string;\n}\n/** Context object exposed on the row */\nexport interface RowContext {\n /** Name of the the context object - row */\n name: string;\n\n /** Returns the data of the entire row */\n getValue: () => RowData;\n\n /** Returns the context of the parent(view) */\n getParentContext: () => ViewContext;\n\n /** Calls fetchRowActionDetails function of the API context and returns the row actions */\n getRowActionDetails: (\n rowContext: RowData\n ) => ReturnType<Required<ApiContext>['fetchRowActionDetails']>;\n\n /** Returns the drag props set on a row */\n getDragProps: () => DragProps | undefined;\n\n /**\n * Used to select/deselect a {@link Row}.\n * @param selected Flag to indicate the row is selected or not.\n */\n selectRow: (selected: boolean) => void;\n\n /** This fetches the latest data of the row using\n * {@link ApiContext.fetchRowData fetchRowData} and updates the same in the {@link View} and {@link Row}\n * @returns void\n */\n refreshRow: () => Promise<void>;\n\n /** Boolean denoting if a row is selected */\n $selected?: boolean;\n /**\n *\n * @returns the errors on the row.\n */\n getRowError: () => DataError[string | number] | undefined;\n /**\n *\n * @returns the current row Header field and value.\n */\n getRowHeader: () => RowHeader | undefined;\n}\n\nexport type RowOptions = {\n key: string;\n role?: string;\n tabIndex?: number;\n dragProps?: DragProps;\n dropProps?: DropProps;\n rowData: RowData;\n uniqueId?: string | null;\n};\n\nexport interface RowHeader {\n field: Column;\n getValue: () => RowData[keyof RowData] | undefined;\n}\n\nexport const dataKey = 'data-key';\n"]}
1
+ {"version":3,"file":"RowGenerator.types.js","sourceRoot":"","sources":["../../../../src/core/generators/RowGenerator.types.ts"],"names":[],"mappings":"AAuHA,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC","sourcesContent":["import type { ApiContext } from '../../../types/ApiContext.types';\nimport type { DataError } from '../../../types/State.types';\n\nimport type Column from './ColumnGenerator';\nimport type Row from './RowGenerator';\nimport type { ViewContext } from './ViewGenerator.types';\n\nexport type ScalarRowData = string | number | boolean | Date;\n/** Interface for expressing data present in a row */\nexport interface RowData {\n [key: string]: null | ScalarRowData | RowData | RowData[];\n}\n\n/** UI Props set on a row */\nexport interface UIProps {\n /** Class name of the row */\n className: string;\n /** Role to be set on row for A11y purpose */\n role: string;\n\n /** aria-rowindex attribute is set on row and is used by screen readers */\n 'aria-rowindex': number;\n\n /** On click handler exposed */\n onClick?: (data: Row) => void;\n\n /** Drag props exposed on row for drag and drop operation */\n dragProps?: DragProps;\n\n /** Drop props exposed on row for drag and drop operation */\n dropProps?: DropProps;\n /** The error message for a row. */\n 'data-error-message'?: string;\n /** A key to uniquely identify a row. */\n 'data-key': string;\n}\n\nexport interface DragProps {\n /** Boolean denoting if a row is draggable */\n draggable: boolean;\n\n /** Event handler attached on the row for drag start event */\n onDragStart: (e: DragEvent) => void;\n\n /** Event handler attached on the row for drag end event */\n onDragEnd: (e: DragEvent) => void;\n}\n\n/** Drop props exposed on row for drag and drop operation */\nexport interface DropProps {\n /** Event handler attached on the row for drag enter event */\n onDragEnter: (e: DragEvent) => void;\n\n /** Event handler attached on the row for drag leave event */\n onDragLeave: (e: DragEvent) => void;\n\n /** Selector exposed for dropping a row */\n 'data-drop': string;\n}\n/** Context object exposed on the row */\nexport interface RowContext {\n /** Name of the the context object - row */\n name: string;\n\n /** Returns the data of the entire row */\n getValue: () => RowData;\n\n /** Returns the context of the parent(view) */\n getParentContext: () => ViewContext;\n\n /** Calls fetchRowActionDetails function of the API context and returns the row actions */\n getRowActionDetails: (\n rowContext: RowData\n ) => ReturnType<Required<ApiContext>['fetchRowActionDetails']>;\n\n /** Returns the drag props set on a row */\n getDragProps: () => DragProps | undefined;\n\n /**\n * Used to select/deselect a {@link Row}.\n * @param selected Flag to indicate the row is selected or not.\n */\n selectRow: (selected: boolean) => void;\n\n /** This fetches the latest data of the row using\n * {@link ApiContext.fetchRowData fetchRowData} and updates the same in the {@link View} and {@link Row}\n * @returns void\n */\n refreshRow: () => Promise<void>;\n\n /** Boolean denoting if a row is selected */\n $selected?: boolean;\n /**\n *\n * @returns the errors on the row.\n */\n getRowError: () => DataError[string | number] | undefined;\n /**\n *\n * @returns the current row Header field and value.\n */\n getRowHeader: () => RowHeader | undefined;\n}\n\nexport type RowOptions = {\n key: string;\n role?: string;\n tabIndex?: number;\n dragProps?: DragProps;\n dropProps?: DropProps;\n rowData: RowData;\n uniqueId?: string | null;\n};\n\nexport interface RowHeader {\n field: Column;\n getValue: () => RowData[keyof RowData] | undefined;\n}\n\nexport const dataKey = 'data-key';\n"]}
@@ -1,11 +1,11 @@
1
- import type { OmitStrict } from '@pega/cosmos-react-core';
2
- import type { Meta } from '../../../types/Meta.types';
1
+ import { type OmitStrict } from '@pega/cosmos-react-core';
2
+ import { type FieldDef, type Meta } from '../../../types/Meta.types';
3
3
  import type RsInternal from '../RsInternal';
4
4
  import type RsProps from '../RsProps';
5
5
  import type { UtilityFunctions } from './viewUtilityMethods';
6
6
  import Column from './ColumnGenerator';
7
7
  import type Row from './RowGenerator';
8
- import type { ConfirmationActionDetails, DebugInfo, FormatterFunction, FreezeLine, RefreshNotification, RequiredDefinition, UIProps, ViewConfig, ViewContext, ViewState, VirtualizeElement } from './ViewGenerator.types';
8
+ import type { ConfirmationActionDetails, DebugInfo, FormatterFunction, FreezeLine, RefreshNotification, RequiredDefinition, UIProps, ViewConfig, ViewContext, ViewState, VirtualizeElement, WarningDetail } from './ViewGenerator.types';
9
9
  import type { RowData } from './RowGenerator.types';
10
10
  import type { ColumnConfig } from './ColumnGenerator.types';
11
11
  import type GroupGenerator from './GroupGenerator';
@@ -18,7 +18,7 @@ export default class View {
18
18
  rsID: string;
19
19
  /** Current data for the view. */
20
20
  data?: RowData[];
21
- /** Current {@link Column columns} for the view. */
21
+ /** Current visible {@link Column columns} for the view. */
22
22
  columns?: Column[];
23
23
  /** Current {@link Row rows} for the view. */
24
24
  rows?: Row[];
@@ -53,12 +53,6 @@ export default class View {
53
53
  freezeLine?: FreezeLine;
54
54
  /** Meta of the repeating structures. */
55
55
  meta: Meta;
56
- /**
57
- * This function is provided a click handler for a row via row generator.
58
- * @param {RowData} data - current row data
59
- * @returns {void} void
60
- */
61
- onRowClickAction?: RsProps['onRowClickAction'];
62
56
  /** A list of customised the toolbar actions to be displayed at the top of a repeating structure, apart from ootb toolbar actions. */
63
57
  toolBarOptions?: RsProps['toolBarOptions'];
64
58
  /** An object of formatter functions which formats the raw value. */
@@ -108,6 +102,22 @@ export default class View {
108
102
  * undefined: Use default behavior (skip first count announcement, announce on subsequent count updates).
109
103
  */
110
104
  announceCount?: boolean;
105
+ /** Indicates if global search is enabled.
106
+ * If a view does not contain any visible columns which are searchable, then this will be false.
107
+ * @default true
108
+ */
109
+ enableGlobalSearch: boolean;
110
+ /** Array of warning details from API responses to display at top of table */
111
+ warningMessages?: WarningDetail[];
112
+ /**
113
+ * The Table ↔ Gallery toggle is only surfaced on small screens, and only when the authored template (`meta.template`) is Table
114
+ * Currently active template for the view. Defaults to `meta.template` but can be
115
+ * overridden at runtime (e.g. when the user toggles between Table and Gallery).
116
+ *
117
+ * Renderers and toolbar code should read this property — not `meta.template` — so
118
+ * that runtime template switches take effect without altering the persisted preset.
119
+ */
120
+ template?: Meta['template'];
111
121
  /**
112
122
  * Creates a view instance that represents the whole view of repeating structures.
113
123
  * It has properties like rows, columns, data to build a repeating structures view.
@@ -115,6 +125,8 @@ export default class View {
115
125
  * @param rsInternal The {@link RsInternal} object.
116
126
  */
117
127
  constructor(config: ViewConfig, rsInternal: RsInternal);
128
+ /** Returns the warning messages array */
129
+ getWarningMessages(): ViewConfig['warningMessages'];
118
130
  /**
119
131
  * Attach utility functions of view to {@link type} property.
120
132
  * @param functions
@@ -130,8 +142,7 @@ export default class View {
130
142
  /**
131
143
  * This is used to create immutable objects of {@link View} instance. Always call setProp if updating any properties of View to make it immutable.
132
144
  * @param prop Either partial of {@link ViewConfig} or individual properties of {@link ViewConfig}.
133
- * @param [value] An optional parameter to provide value for {@link prop} in case prop is not of type {@link ViewConfig}
134
- * @returns void
145
+ * @param value An optional parameter to provide value for {@link prop} in case prop is not of type {@link ViewConfig}
135
146
  */
136
147
  setProp(prop: Partial<ViewConfig> | keyof ViewConfig, value?: ViewConfig[keyof ViewConfig]): View;
137
148
  /**
@@ -142,6 +153,7 @@ export default class View {
142
153
  get defaultPresetId(): string | undefined;
143
154
  /** Indicates if the view is ready.(means the RS component is mounted). */
144
155
  get isReady(): boolean | undefined;
156
+ get galleryLayout(): import("../../../types/Meta.types").GalleryLayout | undefined;
145
157
  /** Indicates if {@link Meta.selectionMode selection mode} is ON */
146
158
  get isInSelectionMode(): boolean;
147
159
  /** Indicates if the Group Expand all functionality should be shown on UI. */
@@ -151,12 +163,10 @@ export default class View {
151
163
  isExpanded?: undefined;
152
164
  handleChange?: undefined;
153
165
  enable?: undefined;
154
- classList?: undefined;
155
166
  } | {
156
167
  isExpanded: boolean | undefined;
157
168
  handleChange: (isExpanded: boolean) => void;
158
- enable: boolean;
159
- classList: string[];
169
+ enable: true;
160
170
  };
161
171
  /** Indicates if there are no records in the view. */
162
172
  get hasNoRecords(): boolean;
@@ -190,12 +200,10 @@ export default class View {
190
200
  /**
191
201
  * Return the rendering engine props of a given column
192
202
  * @param id The {@link Column.field.id id} of the column for which rendering engine props are required.
193
- * @returns
194
203
  */
195
204
  getRenderingEnginePropsById(id: string): import("./ColumnGenerator.types").ColumnRenderingEngineProps | undefined;
196
205
  /**
197
206
  * Returns the row density id for a given {@link rowHeightClass}.
198
- * @returns
199
207
  */
200
208
  getRowDensity(): string;
201
209
  /** Returns the current view context. While building a RS view,
@@ -207,7 +215,6 @@ export default class View {
207
215
  /**
208
216
  * It returns the formatter function available for a given formatterName from {@link RsProps.formatters formatters} passed to RS Core.
209
217
  * @param formatterName
210
- * @returns
211
218
  */
212
219
  getFormatterByKey(formatterName: string): FormatterFunction | undefined;
213
220
  /**
@@ -239,18 +246,15 @@ export default class View {
239
246
  */
240
247
  putVirtualizeElement(name: string, virtualizerInstance: VirtualizeElement[keyof VirtualizeElement[number]]): void;
241
248
  /**
242
- * Returns the parent dom container HTML element.
243
- * @returns
249
+ * @returns The parent dom container HTML element.
244
250
  */
245
251
  getDomContainer(): HTMLElement | undefined;
246
252
  /**
247
- * Returns the scroller element(the element used in virtualizer as a scrollable area.)
248
- * @returns
253
+ * @returns The scroller element(the element used in virtualizer as a scrollable area.)
249
254
  */
250
255
  getScrollNode(): HTMLElement | undefined;
251
256
  /**
252
- * Returns the header row of the Repeating structures view.
253
- * @returns
257
+ * @returns Returns the header row of the Repeating structures view.
254
258
  */
255
259
  getItemElement(): HTMLElement | undefined;
256
260
  /**
@@ -259,7 +263,6 @@ export default class View {
259
263
  * This flag is just to hide the user interaction items from the UI for the respective features. It will not stop running the respective features.
260
264
  * @param feature The feature name
261
265
  * @param column an optional column parameter if you want to check if the feature is available for the given column.
262
- * @returns boolean
263
266
  */
264
267
  shouldDisplayFeature(feature: 'filter' | 'sort' | 'grouping', column?: Column): boolean;
265
268
  /**
@@ -278,10 +281,21 @@ export default class View {
278
281
  setSingleSelectionRowKey(key: string): void;
279
282
  /**
280
283
  * Returns the array of visible columns.
281
- * @function getVisibleColumns
282
- * @param includeActionColumns include action columns. Default value is false.
283
- * @returns array of visible columns with/without including action columns(rowSelect, rowDragDrop and rowActionColumn).
284
+ * @param includeActionColumns - include action columns (rowSelect, rowDragDrop, rowActionColumn). Default is `false`.
285
+ * @returns array of visible columns with/without action columns.
284
286
  */
285
287
  getVisibleColumns(includeActionColumns?: boolean): Column[];
288
+ /**
289
+ * Returns the array of visible column IDs.
290
+ * @param includeActionColumns - include action column IDs (rowSelect, rowDragDrop, rowActionColumn). Default is `false`.
291
+ * @returns array of visible column IDs with/without action columns.
292
+ */
293
+ getVisibleColumnIds(includeActionColumns?: boolean): string[];
294
+ /**
295
+ * Returns the {@link FieldDef fieldDefs} from {@link meta} for the current view.
296
+ * This reflects the latest state of fieldDefs including any additions or removals made after initialization.
297
+ * @returns array of {@link FieldDef fieldDefs} from {@link meta}.
298
+ */
299
+ getFieldDefs(): FieldDef[];
286
300
  }
287
301
  //# sourceMappingURL=ViewGenerator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ViewGenerator.d.ts","sourceRoot":"","sources":["../../../../src/core/generators/ViewGenerator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAgBtD,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AAKtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,EACV,yBAAyB,EACzB,SAAS,EACT,iBAAiB,EACjB,UAAU,EACV,mBAAmB,EACnB,kBAAkB,EAClB,OAAO,EACP,UAAU,EACV,WAAW,EACX,SAAS,EACT,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY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