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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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,5 +1,5 @@
1
1
  import { actionColumnResize, actionColumnsAutoSize, actionColumnAutoSize, actionForceUpdate } from '../../../../actions/actions';
2
- import { TEMPLATES, SELECTION_MODES, rowSelectColumnMeta } from '../../../../constants';
2
+ import { TEMPLATES } from '../../../../constants';
3
3
  import { OOTB_COLUMNS, withMemoization } from '../../../../utils/util';
4
4
  import { autoSizeOfColumns } from './autoSize';
5
5
  /*
@@ -34,35 +34,36 @@ const checkDomContainerHasDataRows = (domContainer) => {
34
34
  return !!(domContainer && domContainer.querySelectorAll('.row[aria-rowindex]').length);
35
35
  };
36
36
  /**
37
- * Executes the autosizing feature on row selection column.
37
+ * Autosizes the first visual column to account for the expand/collapse button
38
+ * introduced by grouping.
38
39
  */
39
- function autosizeRowSelectionColumn([{ getView, dispatch }]) {
40
- const { columns = [], getDomContainer, meta } = getView();
41
- if (meta.selectionMode && Object.values(SELECTION_MODES).includes(meta.selectionMode)) {
42
- const col = columns.find(c => c.field.id === rowSelectColumnMeta.field.id);
43
- if (col)
44
- dispatch(actionColumnAutoSize(col, getDomContainer(), true));
40
+ function autoSizeFirstVisualColumn([featureProps]) {
41
+ const { getView, dispatch } = featureProps;
42
+ const { columns = [], getDomContainer } = getView();
43
+ const firstVisualCol = columns.find(c => c.isFirstVisualColumn);
44
+ const domContainer = getDomContainer();
45
+ if (firstVisualCol && domContainer) {
46
+ dispatch(actionColumnAutoSize(firstVisualCol, domContainer, true));
45
47
  }
46
48
  }
47
49
  /**
48
50
  * Runs autosizing on out-of-the-box (OOTB) action columns in the view.
49
51
  */
50
- const autosizeOotbActionColumns = ([{ getView, dispatch }]) => {
51
- const { columns = [] } = getView();
52
+ const autosizeOotbActionColumns = ([featureProps]) => {
53
+ const { getView, dispatch } = featureProps;
54
+ const { columns = [], getDomContainer } = getView();
52
55
  const ootbColumns = columns?.filter(col => OOTB_COLUMNS.includes(col.field.id));
53
- if (ootbColumns.length) {
54
- dispatch(actionColumnsAutoSize(ootbColumns, getView().getDomContainer(), true));
56
+ const domContainer = getDomContainer();
57
+ if (ootbColumns.length && domContainer) {
58
+ dispatch(actionColumnsAutoSize(ootbColumns, domContainer, true));
55
59
  }
56
60
  };
57
61
  /**
58
62
  * Executes the autosizing feature on all the columns. It dispatches an action that updates {@link State.columnWidths} slice with the calculated widths for all the columns.
59
63
  * @param param featureProps
60
- * @returns
61
64
  */
62
- export function runColumnSizing([{ getState, getView, getRsStore, dispatch }]) {
63
- const { columns = [], getDomContainer, meta } = getView();
64
- if (meta.template !== TEMPLATES.TABLE)
65
- return;
65
+ export function runColumnSizing([{ getView, getRsStore, dispatch }]) {
66
+ const { columns = [], getDomContainer } = getView();
66
67
  const rsStore = getRsStore();
67
68
  const domContainer = getDomContainer();
68
69
  const runColumnSizingOnRowsAvailable = !rsStore.columnSizingTriggerdOnRowsAvailable && checkDomContainerHasDataRows(domContainer);
@@ -75,30 +76,6 @@ export function runColumnSizing([{ getState, getView, getRsStore, dispatch }]) {
75
76
  }
76
77
  return;
77
78
  }
78
- /**
79
- * If one of the table's ancestors is in a hidden state, the autosize calculations will not function correctly
80
- * since the domContainer's offsetWidth will be 0. To address this scenario, a resize observer is attached for this use case.
81
- * It triggers autosize whenever the offsetWidth of the domContainer increases from 0 once the ancestors are
82
- * made visible. */
83
- if (domContainer?.offsetWidth === 0) {
84
- const observer = new ResizeObserver(entries => {
85
- for (const entry of entries) {
86
- if (entry.contentRect.width > 0) {
87
- runColumnSizing([
88
- {
89
- getState,
90
- getView,
91
- getRsStore,
92
- dispatch
93
- }
94
- ]);
95
- observer.unobserve(entry.target);
96
- }
97
- }
98
- });
99
- observer.observe(domContainer);
100
- return;
101
- }
102
79
  rsStore.autosizeTriggered = true;
103
80
  // skipping column animation on next run if column size changed after personalization change or delete
104
81
  rsStore.skipColumnAnimationOnNextRun = true;
@@ -139,7 +116,7 @@ function resetAutosizeStatus([{ getRsStore }]) {
139
116
  * - {@link State.hiddenColumns}
140
117
  * - {@link State.customFields}
141
118
  *
142
- * 3. **Executing Autosize on Row Selection Column**:
119
+ * 3. **Executing Autosize on First Visual Column**:
143
120
  *
144
121
  * This action is triggered when any of the following properties change:
145
122
  * - {@link State.groups}
@@ -148,21 +125,82 @@ function resetAutosizeStatus([{ getRsStore }]) {
148
125
  export default () => {
149
126
  const memoizedRunColumnSizing = withMemoization(runColumnSizing);
150
127
  const memoizedResetAutosizeStatus = withMemoization(resetAutosizeStatus);
151
- const memoizedAutosizeRowSelectionColumn = withMemoization(autosizeRowSelectionColumn);
128
+ const memoizedAutosizeFirstVisualColumn = withMemoization(autoSizeFirstVisualColumn);
152
129
  const memoizedAutosizeOotbActionColumns = withMemoization(autosizeOotbActionColumns);
130
+ let domContainerResizeObserver = null;
131
+ let observedDomContainer = null;
153
132
  return function execute(featureProps) {
133
+ /**
134
+ * Column sizing is Table-only. When template switches away from Table, clear any pending observer.
135
+ * This prevents an observer created in a previous hidden-Table render from firing late and
136
+ * triggering sizing work against the current non-Table template
137
+ */
138
+ if (featureProps.getView().template !== TEMPLATES.TABLE) {
139
+ domContainerResizeObserver?.disconnect();
140
+ domContainerResizeObserver = null;
141
+ observedDomContainer = null;
142
+ return;
143
+ }
154
144
  const state = featureProps.getState();
155
145
  // AutoSize by default
156
146
  memoizedResetAutosizeStatus([featureProps], [state.personalization?.active, state.refresh, state.hiddenColumns, state.customFields]);
147
+ /**
148
+ * If one of the table's ancestors is in a hidden state, the autosize calculations will not
149
+ * function correctly since the domContainer's offsetWidth will be 0. A single ResizeObserver
150
+ * is attached here (once per hidden period) and fires all sizing functions as soon as the
151
+ * container gains width.
152
+ *
153
+ * The memoized versions are called intentionally so their dependency arrays are initialized
154
+ * with the current state values. If the raw functions were called instead, the memoized
155
+ * wrappers would still have no recorded deps and would re-run on the very next `execute`
156
+ * cycle, causing each sizing function to fire twice.
157
+ *
158
+ * Any function that performs sizing calculations should be called within this observer callback.
159
+ */
160
+ const domContainer = featureProps.getView().getDomContainer();
161
+ if (domContainer && domContainer.offsetWidth === 0) {
162
+ if (domContainerResizeObserver && observedDomContainer !== domContainer) {
163
+ // The DOM container was replaced while the observer was still pending (e.g. component remount).
164
+ domContainerResizeObserver.disconnect();
165
+ domContainerResizeObserver = null;
166
+ observedDomContainer = null;
167
+ }
168
+ if (!domContainerResizeObserver) {
169
+ domContainerResizeObserver = new ResizeObserver(entries => {
170
+ for (const entry of entries) {
171
+ if (entry.contentRect.width > 0) {
172
+ const currentState = featureProps.getState();
173
+ memoizedRunColumnSizing([featureProps], [
174
+ currentState.personalization?.active,
175
+ featureProps.getView().rows,
176
+ featureProps.getRsStore().autosizeTriggered,
177
+ currentState.refresh,
178
+ currentState.visibleColumns,
179
+ currentState.forceUpdateFeatures?.forceCalculateAutoWidth
180
+ ]);
181
+ memoizedAutosizeFirstVisualColumn([featureProps], [currentState.groups, currentState.responsive?.sm]);
182
+ memoizedAutosizeOotbActionColumns([featureProps], [currentState.selectedHeightOption]);
183
+ domContainerResizeObserver?.unobserve(entry.target);
184
+ domContainerResizeObserver = null;
185
+ observedDomContainer = null;
186
+ }
187
+ }
188
+ });
189
+ domContainerResizeObserver.observe(domContainer);
190
+ observedDomContainer = domContainer;
191
+ }
192
+ return;
193
+ }
194
+ // These are still needed as the Resize observer will work only once but we need to run sizing on user operations as well
157
195
  memoizedRunColumnSizing([featureProps], [
158
196
  state.personalization?.active,
159
197
  featureProps.getView().rows,
160
198
  featureProps.getRsStore().autosizeTriggered,
161
199
  state.refresh,
162
- state.hiddenColumns,
200
+ state.visibleColumns,
163
201
  state.forceUpdateFeatures?.forceCalculateAutoWidth
164
202
  ]);
165
- memoizedAutosizeRowSelectionColumn([featureProps], [state.groups, state.responsive?.sm]);
203
+ memoizedAutosizeFirstVisualColumn([featureProps], [state.groups, state.responsive?.sm]);
166
204
  memoizedAutosizeOotbActionColumns([featureProps], [state.selectedHeightOption]);
167
205
  };
168
206
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/core/features/uIFeatures/afterRender/columnSizing/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAQvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C;;;;GAIG;AACH;;;;;GAKG;AACH,MAAM,2BAA2B,GAAG,CAClC,OAAqC,EACrC,YAAkC,EAClC,EAAE;IACF,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,IAAI,CAAC,MAAM,CAAC,MAAM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AC,0BAA0B,CAAC,CAAC;IACvF,MAAM,iCAAiC,GAAG,eAAe,CAAC,yBAAyB,CAAC,CAAC;IACrF,OAAO,SAAS,OAAO,CAAC,YAA0B;QAChD,MAAM,KAAK,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;QACtC,sBAAsB;QACtB,2BAA2B,CACzB,CAAC,YAAY,CAAC,EACd,CAAC,KAAK,CAAC,eAAe,EAAE,MAAM,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC,YAAY,CAAC,CACxF,CAAC;QACF,uBAAuB,CACrB,CAAC,YAAY,CAAC,EACd;YACE,KAAK,CAAC,eAAe,EAAE,MAAM;YAC7B,YAAY,CAAC,OAAO,EAAE,CAAC,IAAI;YAC3B,YAAY,CAAC,UAAU,EAAE,CAAC,iBAAiB;YAC3C,KAAK,CAAC,OAAO;YACb,KAAK,CAAC,aAAa;YACnB,KAAK,CAAC,mBAAmB,EAAE,uBAAuB;SACnD,CACF,CAAC;QACF,kCAAkC,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC;QACzF,iCAAiC,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAClF,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { OmitStrict } from '@pega/cosmos-react-core';\n\nimport {\n actionColumnResize,\n actionColumnsAutoSize,\n actionColumnAutoSize,\n actionForceUpdate\n} from '../../../../actions/actions';\nimport { TEMPLATES, SELECTION_MODES, rowSelectColumnMeta } from '../../../../constants';\nimport { OOTB_COLUMNS, withMemoization } from '../../../../utils/util';\nimport type { FeatureProps } from '../../../featureFactory';\nimport type View from '../../../../generators/ViewGenerator';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { State } from '../../../../../../types/State.types';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type RsStore from '../../../../RsStore';\n\nimport { autoSizeOfColumns } from './autoSize';\n\n/*\n * If columnWidths are undefined, there is no active personalization invloved in the current view\n * So triggering auto column sizing, which depends on column content.\n * in case of nested groupings, skipping group headers from being counted as a row\n */\n/**\n * Checks if {@link View.domContainer dom container} has any rows with visible cells.\n * @param columns\n * @param domContainer\n * @returns true if dom container has any rows available, otherwise false.\n */\nconst checkDomContainerHasAnyRows = (\n columns: NonNullable<View['columns']>,\n domContainer: View['domContainer']\n) => {\n for (const column of columns) {\n if (!column.hidden) {\n const cells = domContainer\n ? domContainer.querySelectorAll(`[data-col-id=\"${column.field.id}\"]`)\n : [];\n if (cells.length > 1) {\n return true;\n }\n }\n }\n return false;\n};\n\n/**\n * Checks if any data rows are available in dom container. It does not includes grouped rows.\n * @returns true if data rows are available, otherwise false.\n */\nconst checkDomContainerHasDataRows = (domContainer: View['domContainer']) => {\n return !!(domContainer && domContainer.querySelectorAll('.row[aria-rowindex]').length);\n};\n\n/**\n * Executes the autosizing feature on row selection column.\n */\nfunction autosizeRowSelectionColumn([{ getView, dispatch }]: [featureProps: FeatureProps]) {\n const { columns = [], getDomContainer, meta } = getView();\n if (meta.selectionMode && Object.values(SELECTION_MODES).includes(meta.selectionMode)) {\n const col = columns.find(c => c.field.id === rowSelectColumnMeta.field.id);\n if (col) dispatch(actionColumnAutoSize(col, getDomContainer()!, true));\n }\n}\n\n/**\n * Runs autosizing on out-of-the-box (OOTB) action columns in the view.\n */\nconst autosizeOotbActionColumns = ([{ getView, dispatch }]: [featureProps: FeatureProps]) => {\n const { columns = [] } = getView();\n const ootbColumns = columns?.filter(col => OOTB_COLUMNS.includes(col.field.id));\n if (ootbColumns.length) {\n dispatch(actionColumnsAutoSize(ootbColumns, getView().getDomContainer()!, true));\n }\n};\n\n/**\n * Executes the autosizing feature on all the columns. It dispatches an action that updates {@link State.columnWidths} slice with the calculated widths for all the columns.\n * @param param featureProps\n * @returns\n */\nexport function runColumnSizing([{ getState, getView, getRsStore, dispatch }]: [\n featureProps: OmitStrict<FeatureProps, 'getOriginalState' | 'getRsProps'>\n]) {\n const { columns = [], getDomContainer, meta } = getView();\n\n if (meta.template !== TEMPLATES.TABLE) return;\n\n const rsStore = getRsStore();\n const domContainer = getDomContainer();\n const runColumnSizingOnRowsAvailable =\n !rsStore.columnSizingTriggerdOnRowsAvailable && checkDomContainerHasDataRows(domContainer);\n\n // if there is no group/data row to size in DOM, don't run column sizing\n if (\n !checkDomContainerHasAnyRows(columns, domContainer) ||\n (rsStore.autosizeTriggered && !runColumnSizingOnRowsAvailable)\n ) {\n // if in current render cycle the rows were not painted, check for autosizing in next cycle\n if (!rsStore.autosizeTriggered) {\n dispatch(actionForceUpdate(false, { forceCalculateAutoWidth: true }));\n }\n return;\n }\n\n /**\n * If one of the table's ancestors is in a hidden state, the autosize calculations will not function correctly\n * since the domContainer's offsetWidth will be 0. To address this scenario, a resize observer is attached for this use case.\n * It triggers autosize whenever the offsetWidth of the domContainer increases from 0 once the ancestors are\n * made visible. */\n if (domContainer?.offsetWidth === 0) {\n const observer = new ResizeObserver(entries => {\n for (const entry of entries) {\n if (entry.contentRect.width > 0) {\n runColumnSizing([\n {\n getState,\n getView,\n getRsStore,\n dispatch\n }\n ]);\n observer.unobserve(entry.target);\n }\n }\n });\n observer.observe(domContainer);\n return;\n }\n\n rsStore.autosizeTriggered = true;\n // skipping column animation on next run if column size changed after personalization change or delete\n rsStore.skipColumnAnimationOnNextRun = true;\n\n if (runColumnSizingOnRowsAvailable) {\n // Fresh column sizing will run only once for a view when the rows are loaded for the first time in DOM\n rsStore.columnSizingTriggerdOnRowsAvailable = true;\n dispatch(actionColumnsAutoSize(columns, domContainer!, true));\n } else {\n // Incremental column sizing on show/hide of columns or table refresh or on view change with grouping applied\n dispatch(actionColumnResize(autoSizeOfColumns(columns, domContainer!)));\n }\n}\n\n/**\n * It resets the {@link RsStore.autosizeTriggered autosize status} on RsStore.\n * @param param featureProps\n */\nfunction resetAutosizeStatus([{ getRsStore }]: [featureProps: FeatureProps]) {\n // This parent flag checks if any type of sizing is triggered on the table including table header/groups/rows.\n getRsStore().autosizeTriggered = false;\n}\n\n/**\n * Manages the autosizing feature of columns in the view. This includes the following actions:\n * 1. **Executing Autosize for All Columns**:\n *\n * This action is triggered when any of the following properties change:\n * - {@link State.personalization.active}\n * - {@link View.rows}\n * - {@link RsStore.autosizeTriggered}\n * - {@link State.refresh}\n * - {@link State.hiddenColumns}\n * - {@link State.forceUpdateFeatures.forceCalculateAutoWidth}\n * 2. **Resetting Autosize Status**:\n *\n * This action is triggered when any of the following properties change:\n * - {@link State.personalization.active}\n * - {@link State.refresh}\n * - {@link State.hiddenColumns}\n * - {@link State.customFields}\n *\n * 3. **Executing Autosize on Row Selection Column**:\n *\n * This action is triggered when any of the following properties change:\n * - {@link State.groups}\n * - {@link State.responsive.sm}\n */\nexport default () => {\n const memoizedRunColumnSizing = withMemoization(runColumnSizing);\n const memoizedResetAutosizeStatus = withMemoization(resetAutosizeStatus);\n const memoizedAutosizeRowSelectionColumn = withMemoization(autosizeRowSelectionColumn);\n const memoizedAutosizeOotbActionColumns = withMemoization(autosizeOotbActionColumns);\n return function execute(featureProps: FeatureProps) {\n const state = featureProps.getState();\n // AutoSize by default\n memoizedResetAutosizeStatus(\n [featureProps],\n [state.personalization?.active, state.refresh, state.hiddenColumns, state.customFields]\n );\n memoizedRunColumnSizing(\n [featureProps],\n [\n state.personalization?.active,\n featureProps.getView().rows,\n featureProps.getRsStore().autosizeTriggered,\n state.refresh,\n state.hiddenColumns,\n state.forceUpdateFeatures?.forceCalculateAutoWidth\n ]\n );\n memoizedAutosizeRowSelectionColumn([featureProps], [state.groups, state.responsive?.sm]);\n memoizedAutosizeOotbActionColumns([featureProps], [state.selectedHeightOption]);\n };\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/core/features/uIFeatures/afterRender/columnSizing/index.ts"],"names":[],"mappings":"AAEA,OAAO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{\n actionColumnResize,\n actionColumnsAutoSize,\n actionColumnAutoSize,\n actionForceUpdate\n} from '../../../../actions/actions';\nimport { TEMPLATES } from '../../../../constants';\nimport { OOTB_COLUMNS, withMemoization } from '../../../../utils/util';\nimport type { FeatureProps } from '../../../featureFactory';\nimport type View from '../../../../generators/ViewGenerator';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { State } from '../../../../../../types/State.types';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type RsStore from '../../../../RsStore';\n\nimport { autoSizeOfColumns } from './autoSize';\n\n/*\n * If columnWidths are undefined, there is no active personalization invloved in the current view\n * So triggering auto column sizing, which depends on column content.\n * in case of nested groupings, skipping group headers from being counted as a row\n */\n/**\n * Checks if {@link View.domContainer dom container} has any rows with visible cells.\n * @param columns\n * @param domContainer\n * @returns true if dom container has any rows available, otherwise false.\n */\nconst checkDomContainerHasAnyRows = (\n columns: NonNullable<View['columns']>,\n domContainer: View['domContainer']\n) => {\n for (const column of columns) {\n if (!column.hidden) {\n const cells = domContainer\n ? domContainer.querySelectorAll(`[data-col-id=\"${column.field.id}\"]`)\n : [];\n if (cells.length > 1) {\n return true;\n }\n }\n }\n return false;\n};\n\n/**\n * Checks if any data rows are available in dom container. It does not includes grouped rows.\n * @returns true if data rows are available, otherwise false.\n */\nconst checkDomContainerHasDataRows = (domContainer: View['domContainer']) => {\n return !!(domContainer && domContainer.querySelectorAll('.row[aria-rowindex]').length);\n};\n\n/**\n * Autosizes the first visual column to account for the expand/collapse button\n * introduced by grouping.\n */\n\nfunction autoSizeFirstVisualColumn([featureProps]: [featureProps: FeatureProps]) {\n const { getView, dispatch } = featureProps;\n const { columns = [], getDomContainer } = getView();\n const firstVisualCol = columns.find(c => c.isFirstVisualColumn);\n const domContainer = getDomContainer();\n if (firstVisualCol && domContainer) {\n dispatch(actionColumnAutoSize(firstVisualCol, domContainer, true));\n }\n}\n\n/**\n * Runs autosizing on out-of-the-box (OOTB) action columns in the view.\n */\nconst autosizeOotbActionColumns = ([featureProps]: [featureProps: FeatureProps]) => {\n const { getView, dispatch } = featureProps;\n const { columns = [], getDomContainer } = getView();\n const ootbColumns = columns?.filter(col => OOTB_COLUMNS.includes(col.field.id));\n const domContainer = getDomContainer();\n if (ootbColumns.length && domContainer) {\n dispatch(actionColumnsAutoSize(ootbColumns, domContainer, true));\n }\n};\n\n/**\n * Executes the autosizing feature on all the columns. It dispatches an action that updates {@link State.columnWidths} slice with the calculated widths for all the columns.\n * @param param featureProps\n */\nexport function runColumnSizing([{ getView, getRsStore, dispatch }]: [\n featureProps: OmitStrict<FeatureProps, 'getOriginalState' | 'getRsProps' | 'browserContext'>\n]) {\n const { columns = [], getDomContainer } = getView();\n\n const rsStore = getRsStore();\n const domContainer = getDomContainer();\n const runColumnSizingOnRowsAvailable =\n !rsStore.columnSizingTriggerdOnRowsAvailable && checkDomContainerHasDataRows(domContainer);\n\n // if there is no group/data row to size in DOM, don't run column sizing\n if (\n !checkDomContainerHasAnyRows(columns, domContainer) ||\n (rsStore.autosizeTriggered && !runColumnSizingOnRowsAvailable)\n ) {\n // if in current render cycle the rows were not painted, check for autosizing in next cycle\n if (!rsStore.autosizeTriggered) {\n dispatch(actionForceUpdate(false, { forceCalculateAutoWidth: true }));\n }\n return;\n }\n\n rsStore.autosizeTriggered = true;\n // skipping column animation on next run if column size changed after personalization change or delete\n rsStore.skipColumnAnimationOnNextRun = true;\n\n if (runColumnSizingOnRowsAvailable) {\n // Fresh column sizing will run only once for a view when the rows are loaded for the first time in DOM\n rsStore.columnSizingTriggerdOnRowsAvailable = true;\n dispatch(actionColumnsAutoSize(columns, domContainer!, true));\n } else {\n // Incremental column sizing on show/hide of columns or table refresh or on view change with grouping applied\n dispatch(actionColumnResize(autoSizeOfColumns(columns, domContainer!)));\n }\n}\n\n/**\n * It resets the {@link RsStore.autosizeTriggered autosize status} on RsStore.\n * @param param featureProps\n */\nfunction resetAutosizeStatus([{ getRsStore }]: [featureProps: FeatureProps]) {\n // This parent flag checks if any type of sizing is triggered on the table including table header/groups/rows.\n getRsStore().autosizeTriggered = false;\n}\n\n/**\n * Manages the autosizing feature of columns in the view. This includes the following actions:\n * 1. **Executing Autosize for All Columns**:\n *\n * This action is triggered when any of the following properties change:\n * - {@link State.personalization.active}\n * - {@link View.rows}\n * - {@link RsStore.autosizeTriggered}\n * - {@link State.refresh}\n * - {@link State.hiddenColumns}\n * - {@link State.forceUpdateFeatures.forceCalculateAutoWidth}\n * 2. **Resetting Autosize Status**:\n *\n * This action is triggered when any of the following properties change:\n * - {@link State.personalization.active}\n * - {@link State.refresh}\n * - {@link State.hiddenColumns}\n * - {@link State.customFields}\n *\n * 3. **Executing Autosize on First Visual Column**:\n *\n * This action is triggered when any of the following properties change:\n * - {@link State.groups}\n * - {@link State.responsive.sm}\n */\nexport default () => {\n const memoizedRunColumnSizing = withMemoization(runColumnSizing);\n const memoizedResetAutosizeStatus = withMemoization(resetAutosizeStatus);\n const memoizedAutosizeFirstVisualColumn = withMemoization(autoSizeFirstVisualColumn);\n const memoizedAutosizeOotbActionColumns = withMemoization(autosizeOotbActionColumns);\n let domContainerResizeObserver: ResizeObserver | null = null;\n let observedDomContainer: Element | null = null;\n return function execute(featureProps: FeatureProps) {\n /**\n * Column sizing is Table-only. When template switches away from Table, clear any pending observer.\n * This prevents an observer created in a previous hidden-Table render from firing late and\n * triggering sizing work against the current non-Table template\n */\n if (featureProps.getView().template !== TEMPLATES.TABLE) {\n domContainerResizeObserver?.disconnect();\n domContainerResizeObserver = null;\n observedDomContainer = null;\n return;\n }\n const state = featureProps.getState();\n // AutoSize by default\n memoizedResetAutosizeStatus(\n [featureProps],\n [state.personalization?.active, state.refresh, state.hiddenColumns, state.customFields]\n );\n\n /**\n * If one of the table's ancestors is in a hidden state, the autosize calculations will not\n * function correctly since the domContainer's offsetWidth will be 0. A single ResizeObserver\n * is attached here (once per hidden period) and fires all sizing functions as soon as the\n * container gains width.\n *\n * The memoized versions are called intentionally so their dependency arrays are initialized\n * with the current state values. If the raw functions were called instead, the memoized\n * wrappers would still have no recorded deps and would re-run on the very next `execute`\n * cycle, causing each sizing function to fire twice.\n *\n * Any function that performs sizing calculations should be called within this observer callback.\n */\n const domContainer = featureProps.getView().getDomContainer();\n if (domContainer && domContainer.offsetWidth === 0) {\n if (domContainerResizeObserver && observedDomContainer !== domContainer) {\n // The DOM container was replaced while the observer was still pending (e.g. component remount).\n domContainerResizeObserver.disconnect();\n domContainerResizeObserver = null;\n observedDomContainer = null;\n }\n\n if (!domContainerResizeObserver) {\n domContainerResizeObserver = new ResizeObserver(entries => {\n for (const entry of entries) {\n if (entry.contentRect.width > 0) {\n const currentState = featureProps.getState();\n memoizedRunColumnSizing(\n [featureProps],\n [\n currentState.personalization?.active,\n featureProps.getView().rows,\n featureProps.getRsStore().autosizeTriggered,\n currentState.refresh,\n currentState.visibleColumns,\n currentState.forceUpdateFeatures?.forceCalculateAutoWidth\n ]\n );\n memoizedAutosizeFirstVisualColumn(\n [featureProps],\n [currentState.groups, currentState.responsive?.sm]\n );\n memoizedAutosizeOotbActionColumns(\n [featureProps],\n [currentState.selectedHeightOption]\n );\n domContainerResizeObserver?.unobserve(entry.target);\n domContainerResizeObserver = null;\n observedDomContainer = null;\n }\n }\n });\n domContainerResizeObserver.observe(domContainer);\n observedDomContainer = domContainer;\n }\n return;\n }\n\n // These are still needed as the Resize observer will work only once but we need to run sizing on user operations as well\n memoizedRunColumnSizing(\n [featureProps],\n [\n state.personalization?.active,\n featureProps.getView().rows,\n featureProps.getRsStore().autosizeTriggered,\n state.refresh,\n state.visibleColumns,\n state.forceUpdateFeatures?.forceCalculateAutoWidth\n ]\n );\n memoizedAutosizeFirstVisualColumn([featureProps], [state.groups, state.responsive?.sm]);\n memoizedAutosizeOotbActionColumns([featureProps], [state.selectedHeightOption]);\n };\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/features/uIFeatures/afterRender/customizeParentContainer/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAO5D;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAAI,eAAe,CAAC,YAAY,EAAE,YAAY,CAAC,SAW9E,CAAC;AAEF;;;;;;GAMG;+BAIuB,cAAc,YAAY;AAHpD,wBAQE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/features/uIFeatures/afterRender/customizeParentContainer/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAO5D;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAAI,eAAe,CAAC,YAAY,EAAE,YAAY,CAAC,SAW9E,CAAC;AAEF;;;;;;GAMG;+BAIuB,cAAc,YAAY;AAHpD,wBAOE"}
@@ -25,8 +25,8 @@ export const customizePContainer = ([{ getView }]) => {
25
25
  export default () => {
26
26
  const memoisedCustomizePContainer = withMemoization(customizePContainer);
27
27
  return function execute(featureProps) {
28
- const { hiddenColumns, columnWidths } = featureProps.getState();
29
- memoisedCustomizePContainer([featureProps], [hiddenColumns, columnWidths]);
28
+ const { visibleColumns, columnWidths } = featureProps.getState();
29
+ memoisedCustomizePContainer([featureProps], [visibleColumns, columnWidths]);
30
30
  };
31
31
  };
32
32
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/core/features/uIFeatures/afterRender/customizeParentContainer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAQzD;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,CAA+B,EAAE,EAAE;IACjF,MAAM,eAAe,GAAG,OAAO,EAAE,CAAC,kBAAkB,CAAC,eAAe,EAAE,kBAAkB,EAAE,CAAC;IAE3F,IAAI,eAAe,EAAE,CAAC;QACpB,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,eAAe,CAAC;QAChE,IAAI,WAAW,GAAG,WAAW,EAAE,CAAC;YAC9B,SAAS,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QACpC,CAAC;aAAM,CAAC;YACN,SAAS,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;QACvC,CAAC;IACH,CAAC;AACH,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,eAAe,GAAG,EAAE;IAClB,MAAM,2BAA2B,GAAG,eAAe,CAAC,mBAAmB,CAAC,CAAC;IAEzE,OAAO,SAAS,OAAO,CAAC,YAA0B;QAChD,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;QAEhE,2BAA2B,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC;IAC7E,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { withMemoization } from '../../../../utils/util';\nimport type { FeatureProps } from '../../../featureFactory';\n// Used in JsDoc.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { RootVirtualizer } from '../../../../generators/ViewGenerator.types';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { State } from '../../../../../../types/State.types';\n\n/** Toggles CSS class `pContainerScroll` on {@link RootVirtualizer.getParentContainer parentContainer} (scrollable element of the virtualizer) by comparing scrollWidth and clientWidth of parentContainer.\n * @param featureProps - A tuple containing an object of feature props.\n * @returns void\n */\nexport const customizePContainer = ([{ getView }]: [featureProps: FeatureProps]) => {\n const parentContainer = getView().virtualizeElements.rootVirtualiser?.getParentContainer();\n\n if (parentContainer) {\n const { scrollWidth, clientWidth, classList } = parentContainer;\n if (scrollWidth > clientWidth) {\n classList.add('pContainerScroll');\n } else {\n classList.remove('pContainerScroll');\n }\n }\n};\n\n/**\n * Customizes the behavior of the scrollable of virtualizer i.e. {@link RootVirtualizer.getParentContainer parentContainer}.\n *\n * This customization includes toggling the CSS class `pContainerScroll` on the `parentContainer`. The `pContainerScroll` class is toggled based on changes to specific state properties, including:\n * - {@link State.hiddenColumns}\n * - {@link State.columnWidths}\n */\nexport default () => {\n const memoisedCustomizePContainer = withMemoization(customizePContainer);\n\n return function execute(featureProps: FeatureProps) {\n const { hiddenColumns, columnWidths } = featureProps.getState();\n\n memoisedCustomizePContainer([featureProps], [hiddenColumns, columnWidths]);\n };\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/core/features/uIFeatures/afterRender/customizeParentContainer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAQzD;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,CAA+B,EAAE,EAAE;IACjF,MAAM,eAAe,GAAG,OAAO,EAAE,CAAC,kBAAkB,CAAC,eAAe,EAAE,kBAAkB,EAAE,CAAC;IAE3F,IAAI,eAAe,EAAE,CAAC;QACpB,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,eAAe,CAAC;QAChE,IAAI,WAAW,GAAG,WAAW,EAAE,CAAC;YAC9B,SAAS,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QACpC,CAAC;aAAM,CAAC;YACN,SAAS,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;QACvC,CAAC;IACH,CAAC;AACH,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,eAAe,GAAG,EAAE;IAClB,MAAM,2BAA2B,GAAG,eAAe,CAAC,mBAAmB,CAAC,CAAC;IAEzE,OAAO,SAAS,OAAO,CAAC,YAA0B;QAChD,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;QACjE,2BAA2B,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC,CAAC;IAC9E,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { withMemoization } from '../../../../utils/util';\nimport type { FeatureProps } from '../../../featureFactory';\n// Used in JsDoc.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { RootVirtualizer } from '../../../../generators/ViewGenerator.types';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { State } from '../../../../../../types/State.types';\n\n/** Toggles CSS class `pContainerScroll` on {@link RootVirtualizer.getParentContainer parentContainer} (scrollable element of the virtualizer) by comparing scrollWidth and clientWidth of parentContainer.\n * @param featureProps - A tuple containing an object of feature props.\n * @returns void\n */\nexport const customizePContainer = ([{ getView }]: [featureProps: FeatureProps]) => {\n const parentContainer = getView().virtualizeElements.rootVirtualiser?.getParentContainer();\n\n if (parentContainer) {\n const { scrollWidth, clientWidth, classList } = parentContainer;\n if (scrollWidth > clientWidth) {\n classList.add('pContainerScroll');\n } else {\n classList.remove('pContainerScroll');\n }\n }\n};\n\n/**\n * Customizes the behavior of the scrollable of virtualizer i.e. {@link RootVirtualizer.getParentContainer parentContainer}.\n *\n * This customization includes toggling the CSS class `pContainerScroll` on the `parentContainer`. The `pContainerScroll` class is toggled based on changes to specific state properties, including:\n * - {@link State.hiddenColumns}\n * - {@link State.columnWidths}\n */\nexport default () => {\n const memoisedCustomizePContainer = withMemoization(customizePContainer);\n\n return function execute(featureProps: FeatureProps) {\n const { visibleColumns, columnWidths } = featureProps.getState();\n memoisedCustomizePContainer([featureProps], [visibleColumns, columnWidths]);\n };\n};\n"]}
@@ -1,11 +1,14 @@
1
1
  import type RsInternal from '../../../RsInternal';
2
2
  import type { BeforeRenderFeatureProps } from '../../featureFactory';
3
+ type AdjustHeightProps = Pick<BeforeRenderFeatureProps, 'getView' | 'dispatch' | 'browserContext'>;
3
4
  /**
4
5
  * Calculates the {@link View.bodyHeight body height} of the view.
5
6
  * @param param.0 {@link BeforeRenderFeatureProps}.
6
7
  * @returns void
7
8
  */
8
- export declare function execute([{ getView, dispatch }]: [featureProps: BeforeRenderFeatureProps]): void;
9
+ export declare function execute([{ getView, dispatch, browserContext }]: [
10
+ featureProps: AdjustHeightProps
11
+ ]): void;
9
12
  /**
10
13
  * Calculates the {@link View.bodyHeight body height} of the view and toggles `resize listener` to the `window`.
11
14
  *
@@ -1 +1 @@
1
- {"version":3,"file":"adjustHeight.d.ts","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/adjustHeight.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AASrE;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,YAAY,EAAE,wBAAwB,CAAC,QA6CxF;AAwBD;;;;;;;;;;;;;GAaG;yBAEa,YAAY,UAAU,MAkB5B,cAAc,wBAAwB;AAlBhD,wBA4BE"}
1
+ {"version":3,"file":"adjustHeight.d.ts","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/adjustHeight.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAKrE,KAAK,iBAAiB,GAAG,IAAI,CAAC,wBAAwB,EAAE,SAAS,GAAG,UAAU,GAAG,gBAAgB,CAAC,CAAC;AAMnG;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC,EAAE;IAC/D,YAAY,EAAE,iBAAiB;CAChC,QA6CA;AAwBD;;;;;;;;;;;;;GAaG;yBAEa,YAAY,UAAU,MAsB5B,cAAc,wBAAwB;AAtBhD,wBAgCE"}
@@ -9,7 +9,7 @@ const getVirtualizer = (view) => {
9
9
  * @param param.0 {@link BeforeRenderFeatureProps}.
10
10
  * @returns void
11
11
  */
12
- export function execute([{ getView, dispatch }]) {
12
+ export function execute([{ getView, dispatch, browserContext }]) {
13
13
  // Don't need to calculate height if numberOfRows is defined or view is in basicMode and virtualizer is used
14
14
  // because, virtualizer will set the height to auto which is a contradition
15
15
  const basicMode = getView().meta.basicMode;
@@ -25,17 +25,17 @@ export function execute([{ getView, dispatch }]) {
25
25
  if (typeof fitHeightToElement === 'string') {
26
26
  targetContainerElement =
27
27
  fitHeightToElement === 'document'
28
- ? document.body
29
- : document.querySelector(fitHeightToElement);
28
+ ? browserContext.document.body
29
+ : browserContext.document.querySelector(fitHeightToElement);
30
30
  }
31
31
  else if (fitHeightToElement.nodeType === 1) {
32
32
  targetContainerElement = fitHeightToElement;
33
33
  }
34
34
  else {
35
- targetContainerElement = document.body;
35
+ targetContainerElement = browserContext.document.body;
36
36
  }
37
37
  if (targetContainerElement) {
38
- const computedStyle = window.getComputedStyle(targetContainerElement);
38
+ const computedStyle = browserContext.window.getComputedStyle(targetContainerElement);
39
39
  const totalHeight = parseFloat(computedStyle.height);
40
40
  const paddingTop = parseFloat(computedStyle.paddingTop);
41
41
  const paddingBottom = parseFloat(computedStyle.paddingBottom);
@@ -54,15 +54,15 @@ export function execute([{ getView, dispatch }]) {
54
54
  * @param param.1 Resize listener.
55
55
  * @returns void
56
56
  */
57
- function attachResize([{ getView }, resizeListener]) {
57
+ function attachResize([{ getView, browserContext }, resizeListener]) {
58
58
  const { meta: { height: { height, fitHeightToElement, autoSize = true } = {}, basicMode, numberOfRows } } = getView();
59
59
  const isNumberOfRowsDefined = !!numberOfRows;
60
60
  if (!basicMode && !isNumberOfRowsDefined && !height && fitHeightToElement && autoSize) {
61
- window.removeEventListener('resize', resizeListener);
62
- window.addEventListener('resize', resizeListener);
61
+ browserContext.window.removeEventListener('resize', resizeListener);
62
+ browserContext.window.addEventListener('resize', resizeListener);
63
63
  }
64
64
  else {
65
- window.removeEventListener('resize', resizeListener);
65
+ browserContext.window.removeEventListener('resize', resizeListener);
66
66
  }
67
67
  }
68
68
  /**
@@ -83,16 +83,17 @@ function attachResize([{ getView }, resizeListener]) {
83
83
  export default (rsInternal) => {
84
84
  const { getView, getRsStateResolver, getPubSubUtils } = rsInternal;
85
85
  const { dispatch } = getRsStateResolver();
86
- const instExecute = execute.bind(null, [{ getView, dispatch }]);
87
86
  let timeoutId = null;
88
87
  const resizeListener = () => {
89
88
  // prevent execution of previous setTimeout
90
- clearTimeout(timeoutId);
91
- // change width from the state object after 150 milliseconds
92
- timeoutId = setTimeout(() => instExecute(), 500);
89
+ if (timeoutId) {
90
+ clearTimeout(timeoutId);
91
+ }
92
+ // change width from the state object after 500 milliseconds
93
+ timeoutId = setTimeout(() => execute([{ getView, dispatch, browserContext: rsInternal.getBrowserContext() }]), 500);
93
94
  };
94
95
  getPubSubUtils().subscribe(UNMOUNT, () => {
95
- window.removeEventListener('resize', resizeListener);
96
+ rsInternal.getBrowserContext().window.removeEventListener('resize', resizeListener);
96
97
  });
97
98
  const memoisedExecute = withMemoization(execute);
98
99
  const memoisedAttachResize = withMemoization(attachResize);
@@ -1 +1 @@
1
- {"version":3,"file":"adjustHeight.js","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/adjustHeight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAOtD,MAAM,cAAc,GAAG,CAAC,IAAU,EAAE,EAAE;IACpC,OAAO,IAAI,CAAC,kBAAkB,EAAE,eAAe,CAAC;AAClD,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAA2C;IACvF,4GAA4G;IAC5G,2EAA2E;IA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AAE,CAAC;IAC1C,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,QAAQ,EAA8B,CAAC,CAAC,CAAC;IAC5F,IAAI,SAAS,GAAyC,IAAI,CAAC;IAC3D,MAAM,cAAc,GAAG,GAAG,EAAE;QAC1B,2CAA2C;QAC3C,YAAY,CAAC,SAAU,CAAC,CAAC;QACzB,4DAA4D;QAC5D,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,EAAE,GAAG,CAAC,CAAC;IACnD,CAAC,CAAC;IAEF,cAAc,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,GAAG,EAAE;QACvC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;IAEH,MAAM,eAAe,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;IACjD,MAAM,oBAAoB,GAAG,eAAe,CAAC,YAAY,CAAC,CAAC;IAC3D,OAAO,CAAC,YAAsC,EAAE,EAAE;QAChD,eAAe,CACb,CAAC,YAAY,CAAC,EACd,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAC/E,CAAC;QACF,oBAAoB,CAClB,CAAC,YAAY,EAAE,cAAc,CAAC,EAC9B,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAC/E,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { UNMOUNT } from '../../../pubSub/events';\nimport { actionForceUpdate } from '../../../actions/actions';\nimport { withMemoization } from '../../../utils/util';\nimport type RsInternal from '../../../RsInternal';\nimport type { BeforeRenderFeatureProps } from '../../featureFactory';\nimport type View from '../../../generators/ViewGenerator';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { Meta } from '../../../../../types/Meta.types';\n\nconst getVirtualizer = (view: View) => {\n return view.virtualizeElements?.rootVirtualiser;\n};\n\n/**\n * Calculates the {@link View.bodyHeight body height} of the view.\n * @param param.0 {@link BeforeRenderFeatureProps}.\n * @returns void\n */\nexport function execute([{ getView, dispatch }]: [featureProps: BeforeRenderFeatureProps]) {\n // Don't need to calculate height if numberOfRows is defined or view is in basicMode and virtualizer is used\n // because, virtualizer will set the height to auto which is a contradition\n const basicMode = getView().meta.basicMode;\n const isVirtualizerUsed = !!getVirtualizer(getView());\n const isNumberOfRowsDefined = !!getView().meta.numberOfRows;\n if (isNumberOfRowsDefined || (basicMode && isVirtualizerUsed)) {\n return;\n }\n\n const {\n meta: { height: { minHeight, fitHeightToElement } = {} }\n } = getView();\n\n if (!getView().getDomContainer() || !fitHeightToElement) return;\n\n let targetContainerElement: HTMLElement | null;\n if (typeof fitHeightToElement === 'string') {\n targetContainerElement =\n fitHeightToElement === 'document'\n ? document.body\n : document.querySelector(fitHeightToElement);\n } else if (fitHeightToElement.nodeType === 1) {\n targetContainerElement = fitHeightToElement;\n } else {\n targetContainerElement = document.body;\n }\n\n if (targetContainerElement) {\n const computedStyle = window.getComputedStyle(targetContainerElement);\n const totalHeight = parseFloat(computedStyle.height);\n const paddingTop = parseFloat(computedStyle.paddingTop);\n const paddingBottom = parseFloat(computedStyle.paddingBottom);\n\n const targetHeight = totalHeight - paddingTop - paddingBottom;\n\n // tableHeight should not be less than minHeight if it's configured\n if (\n (typeof minHeight === 'number' && targetHeight && targetHeight > minHeight) ||\n (!minHeight && targetHeight)\n ) {\n getView().setProp('viewHeight', targetHeight);\n dispatch(actionForceUpdate(false));\n }\n }\n}\n\n/**\n * Toggles the `resize listener` on `window`\n * @param param.0 {@link BeforeRenderFeatureProps}.\n * @param param.1 Resize listener.\n * @returns void\n */\nfunction attachResize([{ getView }, resizeListener]: [\n featureProps: BeforeRenderFeatureProps,\n resizeListener: () => void\n]) {\n const {\n meta: { height: { height, fitHeightToElement, autoSize = true } = {}, basicMode, numberOfRows }\n } = getView();\n const isNumberOfRowsDefined = !!numberOfRows;\n if (!basicMode && !isNumberOfRowsDefined && !height && fitHeightToElement && autoSize) {\n window.removeEventListener('resize', resizeListener);\n window.addEventListener('resize', resizeListener);\n } else {\n window.removeEventListener('resize', resizeListener);\n }\n}\n\n/**\n * Calculates the {@link View.bodyHeight body height} of the view and toggles `resize listener` to the `window`.\n *\n * 1. The `body height` is calculated only on initial mount of the Repeating structures, if following properties are provided in {@link Meta}:\n * - {@link Meta.height}\n * - {@link Meta.numberOfRows}\n *\n * 2. The `resize listener` is attached/removed on initial mount of Repeating structures, after considering the values for following properties in {@link Meta}:\n * - {@link Meta.height}\n * - {@link Meta.numberOfRows}\n *\n * Additionally the `resize listener` will be removed on `UNMOUNT` event publish.\n *\n */\n// TODO: RsCore shouldn't be responsible for height calculations. We should move this feature to React layer.\nexport default (rsInternal: RsInternal) => {\n const { getView, getRsStateResolver, getPubSubUtils } = rsInternal;\n const { dispatch } = getRsStateResolver();\n const instExecute = execute.bind(null, [{ getView, dispatch } as BeforeRenderFeatureProps]);\n let timeoutId: ReturnType<typeof setTimeout> | null = null;\n const resizeListener = () => {\n // prevent execution of previous setTimeout\n clearTimeout(timeoutId!);\n // change width from the state object after 150 milliseconds\n timeoutId = setTimeout(() => instExecute(), 500);\n };\n\n getPubSubUtils().subscribe(UNMOUNT, () => {\n window.removeEventListener('resize', resizeListener);\n });\n\n const memoisedExecute = withMemoization(execute);\n const memoisedAttachResize = withMemoization(attachResize);\n return (featureProps: BeforeRenderFeatureProps) => {\n memoisedExecute(\n [featureProps],\n [featureProps.getView().meta.numberOfRows, featureProps.getView().meta.height]\n );\n memoisedAttachResize(\n [featureProps, resizeListener],\n [featureProps.getView().meta.numberOfRows, featureProps.getView().meta.height]\n );\n };\n};\n"]}
1
+ {"version":3,"file":"adjustHeight.js","sourceRoot":"","sources":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CAAC,CAAC;IAC3D,OAAO,CAAC,YAAsC,EAAE,EAAE;QAChD,eAAe,CACb,CAAC,YAAY,CAAC,EACd,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAC/E,CAAC;QACF,oBAAoB,CAClB,CAAC,YAAY,EAAE,cAAc,CAAC,EAC9B,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAC/E,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { UNMOUNT } from '../../../pubSub/events';\nimport { actionForceUpdate } from '../../../actions/actions';\nimport { withMemoization } from '../../../utils/util';\nimport type RsInternal from '../../../RsInternal';\nimport type { BeforeRenderFeatureProps } from '../../featureFactory';\nimport type View from '../../../generators/ViewGenerator';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { Meta } from '../../../../../types/Meta.types';\n\ntype AdjustHeightProps = Pick<BeforeRenderFeatureProps, 'getView' | 'dispatch' | 'browserContext'>;\n\nconst getVirtualizer = (view: View) => {\n return view.virtualizeElements?.rootVirtualiser;\n};\n\n/**\n * Calculates the {@link View.bodyHeight body height} of the view.\n * @param param.0 {@link BeforeRenderFeatureProps}.\n * @returns void\n */\nexport function execute([{ getView, dispatch, browserContext }]: [\n featureProps: AdjustHeightProps\n]) {\n // Don't need to calculate height if numberOfRows is defined or view is in basicMode and virtualizer is used\n // because, virtualizer will set the height to auto which is a contradition\n const basicMode = getView().meta.basicMode;\n const isVirtualizerUsed = !!getVirtualizer(getView());\n const isNumberOfRowsDefined = !!getView().meta.numberOfRows;\n if (isNumberOfRowsDefined || (basicMode && isVirtualizerUsed)) {\n return;\n }\n\n const {\n meta: { height: { minHeight, fitHeightToElement } = {} }\n } = getView();\n\n if (!getView().getDomContainer() || !fitHeightToElement) return;\n\n let targetContainerElement: HTMLElement | null;\n if (typeof fitHeightToElement === 'string') {\n targetContainerElement =\n fitHeightToElement === 'document'\n ? browserContext.document.body\n : browserContext.document.querySelector(fitHeightToElement);\n } else if (fitHeightToElement.nodeType === 1) {\n targetContainerElement = fitHeightToElement;\n } else {\n targetContainerElement = browserContext.document.body;\n }\n\n if (targetContainerElement) {\n const computedStyle = browserContext.window.getComputedStyle(targetContainerElement);\n const totalHeight = parseFloat(computedStyle.height);\n const paddingTop = parseFloat(computedStyle.paddingTop);\n const paddingBottom = parseFloat(computedStyle.paddingBottom);\n\n const targetHeight = totalHeight - paddingTop - paddingBottom;\n\n // tableHeight should not be less than minHeight if it's configured\n if (\n (typeof minHeight === 'number' && targetHeight && targetHeight > minHeight) ||\n (!minHeight && targetHeight)\n ) {\n getView().setProp('viewHeight', targetHeight);\n dispatch(actionForceUpdate(false));\n }\n }\n}\n\n/**\n * Toggles the `resize listener` on `window`\n * @param param.0 {@link BeforeRenderFeatureProps}.\n * @param param.1 Resize listener.\n * @returns void\n */\nfunction attachResize([{ getView, browserContext }, resizeListener]: [\n featureProps: AdjustHeightProps,\n resizeListener: () => void\n]) {\n const {\n meta: { height: { height, fitHeightToElement, autoSize = true } = {}, basicMode, numberOfRows }\n } = getView();\n const isNumberOfRowsDefined = !!numberOfRows;\n if (!basicMode && !isNumberOfRowsDefined && !height && fitHeightToElement && autoSize) {\n browserContext.window.removeEventListener('resize', resizeListener);\n browserContext.window.addEventListener('resize', resizeListener);\n } else {\n browserContext.window.removeEventListener('resize', resizeListener);\n }\n}\n\n/**\n * Calculates the {@link View.bodyHeight body height} of the view and toggles `resize listener` to the `window`.\n *\n * 1. The `body height` is calculated only on initial mount of the Repeating structures, if following properties are provided in {@link Meta}:\n * - {@link Meta.height}\n * - {@link Meta.numberOfRows}\n *\n * 2. The `resize listener` is attached/removed on initial mount of Repeating structures, after considering the values for following properties in {@link Meta}:\n * - {@link Meta.height}\n * - {@link Meta.numberOfRows}\n *\n * Additionally the `resize listener` will be removed on `UNMOUNT` event publish.\n *\n */\n// TODO: RsCore shouldn't be responsible for height calculations. We should move this feature to React layer.\nexport default (rsInternal: RsInternal) => {\n const { getView, getRsStateResolver, getPubSubUtils } = rsInternal;\n const { dispatch } = getRsStateResolver();\n let timeoutId: ReturnType<typeof setTimeout> | null = null;\n const resizeListener = () => {\n // prevent execution of previous setTimeout\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n // change width from the state object after 500 milliseconds\n timeoutId = setTimeout(\n () => execute([{ getView, dispatch, browserContext: rsInternal.getBrowserContext() }]),\n 500\n );\n };\n\n getPubSubUtils().subscribe(UNMOUNT, () => {\n rsInternal.getBrowserContext().window.removeEventListener('resize', resizeListener);\n });\n\n const memoisedExecute = withMemoization(execute);\n const memoisedAttachResize = withMemoization(attachResize);\n return (featureProps: BeforeRenderFeatureProps) => {\n memoisedExecute(\n [featureProps],\n [featureProps.getView().meta.numberOfRows, featureProps.getView().meta.height]\n );\n memoisedAttachResize(\n [featureProps, resizeListener],\n [featureProps.getView().meta.numberOfRows, featureProps.getView().meta.height]\n );\n };\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"adjustHeightToFitRecords.d.ts","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/adjustHeightToFitRecords.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAQrE;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE;IACxD,YAAY,EAAE,wBAAwB;CACvC,QAwBA;AACD;;;;;;GAMG;+BAKuB,cAAc,wBAAwB;AAHhE,wBAcE"}
1
+ {"version":3,"file":"adjustHeightToFitRecords.d.ts","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/adjustHeightToFitRecords.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAUrE;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE;IACxD,YAAY,EAAE,wBAAwB;CACvC,QA8BA;AACD;;;;;;GAMG;+BAKuB,cAAc,wBAAwB;AAHhE,wBAcE"}
@@ -1,12 +1,20 @@
1
1
  import { withMemoization } from '../../../utils/util';
2
2
  import { rowDensityClasses, TEMPLATES } from '../../../constants';
3
3
  /* eslint-enable @typescript-eslint/no-unused-vars */
4
+ const SUPPORTED_TEMPLATES = [TEMPLATES.TABLE, TEMPLATES.TIMELINE];
4
5
  /**
5
6
  * Adjusts the {@link View.bodyHeight bodyHeight} of the view.
6
7
  * @param param0 - {@link BeforeRenderFeatureProps}
7
8
  */
8
9
  export function updateBodyHeight([{ getView, getState }]) {
9
- const { meta: { numberOfRows, template } } = getView();
10
+ const { numberOfRows } = getView().meta;
11
+ const template = getView().template;
12
+ if (!template || !SUPPORTED_TEMPLATES.includes(template)) {
13
+ // Setting bodyHeight to undefined to unset bodyHeight if set by previous view like table
14
+ // TODO: Once we start clearing ViewGenerator object on view change, we can remove this as bodyHeight will be reset to default value on new view render.
15
+ getView().setProp('bodyHeight', undefined);
16
+ return;
17
+ }
10
18
  // row height is calculated based on the height provided for each row in the styledtablecontainer.jsx styles
11
19
  let rowHeight;
12
20
  let headerHeight;
@@ -39,7 +47,7 @@ export default () => {
39
47
  memoisedFunc([featureProps], [
40
48
  featureProps.getState().selectedHeightOption,
41
49
  featureProps.getView().meta.numberOfRows,
42
- featureProps.getView().meta.template,
50
+ featureProps.getView().template,
43
51
  featureProps.getState().groups
44
52
  ]);
45
53
  };
@@ -1 +1 @@
1
- {"version":3,"file":"adjustHeightToFitRecords.js","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/adjustHeightToFitRecords.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,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C,OAAO,EAAE,CAAC,IAAI,CAAC,QAAQ;YACpC,YAAY,CAAC,QAAQ,EAAE,CAAC,MAAM;SAC/B,CACF,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { withMemoization } from '../../../utils/util';\nimport { rowDensityClasses, TEMPLATES } from '../../../constants';\nimport type { BeforeRenderFeatureProps } from '../../featureFactory';\n// The below types are being used in JsDocs.\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport type { State } from '../../../../../types/State.types';\nimport type { Meta } from '../../../../../types/Meta.types';\nimport type View from '../../../generators/ViewGenerator';\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\n/**\n * Adjusts the {@link View.bodyHeight bodyHeight} of the view.\n * @param param0 - {@link BeforeRenderFeatureProps}\n */\nexport function updateBodyHeight([{ getView, getState }]: [\n featureProps: BeforeRenderFeatureProps\n]) {\n const {\n meta: { numberOfRows, template }\n } = getView();\n\n // row height is calculated based on the height provided for each row in the styledtablecontainer.jsx styles\n let rowHeight;\n let headerHeight;\n if (getState().selectedHeightOption) {\n rowHeight = rowDensityClasses[getState().selectedHeightOption!].rowHeight;\n headerHeight = 45;\n }\n\n if (template === TEMPLATES.TIMELINE) {\n rowHeight = 41;\n headerHeight = 56;\n if (!getState().groups?.[0]?.dateFunction) {\n headerHeight = 0;\n }\n }\n\n if (rowHeight && numberOfRows) {\n getView().setProp('bodyHeight', rowHeight * numberOfRows + headerHeight!);\n }\n}\n/**\n * Adjusts the {@link View.bodyHeight bodyHeight} of the view based on the following properties change:\n * - {@link State.selectedHeightOption}.\n * - {@link Meta.numberOfRows}.\n * - {@link Meta.template}.\n * - {@link State.groups}.\n */\n// TODO: RsCore shouldn't be responsible for height calculations. We should move this feature to React layer.\nexport default () => {\n const memoisedFunc = withMemoization(updateBodyHeight);\n\n return function execute(featureProps: BeforeRenderFeatureProps) {\n memoisedFunc(\n [featureProps],\n [\n featureProps.getState().selectedHeightOption,\n featureProps.getView().meta.numberOfRows,\n featureProps.getView().meta.template,\n featureProps.getState().groups\n ]\n );\n };\n};\n"]}
1
+ {"version":3,"file":"adjustHeightToFitRecords.js","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/adjustHeightToFitRecords.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAOlE,qDAAqD;AAErD,MAAM,mBAAmB,GAAG,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,QAAQ,CAAU,CAAC;AAE3E;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAEtD;IACC,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,EAAE,CAAC,IAAI,CAAC;IACxC,MAAM,QAAQ,GAAG,OAAO,EAAE,CAAC,QAAQ,CAAC;IAEpC,IAAI,CAAC,QAAQ,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QACzD,yFAAyF;QACzF,wJAAwJ;QACxJ,OAAO,EAAE,CAAC,OAAO,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;QAC3C,OAAO;IACT,CAAC;IAED,4GAA4G;IAC5G,IAAI,SAAS,CAAC;IACd,IAAI,YAAY,CAAC;IACjB,IAAI,QAAQ,EAAE,CAAC,oBAAoB,EAAE,CAAC;QACpC,SAAS,GAAG,iBAAiB,CAAC,QAAQ,EAAE,CAAC,oBAAqB,CAAC,CAAC,SAAS,CAAC;QAC1E,YAAY,GAAG,EAAE,CAAC;IACpB,CAAC;IAED,IAAI,QAAQ,KAAK,SAAS,CAAC,QAAQ,EAAE,CAAC;QACpC,SAAS,GAAG,EAAE,CAAC;QACf,YAAY,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC;YAC1C,YAAY,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC;IAED,IAAI,SAAS,IAAI,YAAY,EAAE,CAAC;QAC9B,OAAO,EAAE,CAAC,OAAO,CAAC,YAAY,EAAE,SAAS,GAAG,YAAY,GAAG,YAAa,CAAC,CAAC;IAC5E,CAAC;AACH,CAAC;AACD;;;;;;GAMG;AACH,6GAA6G;AAC7G,eAAe,GAAG,EAAE;IAClB,MAAM,YAAY,GAAG,eAAe,CAAC,gBAAgB,CAAC,CAAC;IAEvD,OAAO,SAAS,OAAO,CAAC,YAAsC;QAC5D,YAAY,CACV,CAAC,YAAY,CAAC,EACd;YACE,YAAY,CAAC,QAAQ,EAAE,CAAC,oBAAoB;YAC5C,YAAY,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,YAAY;YACxC,YAAY,CAAC,OAAO,EAAE,CAAC,QAAQ;YAC/B,YAAY,CAAC,QAAQ,EAAE,CAAC,MAAM;SAC/B,CACF,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { withMemoization } from '../../../utils/util';\nimport { rowDensityClasses, TEMPLATES } from '../../../constants';\nimport type { BeforeRenderFeatureProps } from '../../featureFactory';\n// The below types are being used in JsDocs.\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport type { State } from '../../../../../types/State.types';\nimport type { Meta } from '../../../../../types/Meta.types';\nimport type View from '../../../generators/ViewGenerator';\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\nconst SUPPORTED_TEMPLATES = [TEMPLATES.TABLE, TEMPLATES.TIMELINE] as const;\n\n/**\n * Adjusts the {@link View.bodyHeight bodyHeight} of the view.\n * @param param0 - {@link BeforeRenderFeatureProps}\n */\nexport function updateBodyHeight([{ getView, getState }]: [\n featureProps: BeforeRenderFeatureProps\n]) {\n const { numberOfRows } = getView().meta;\n const template = getView().template;\n\n if (!template || !SUPPORTED_TEMPLATES.includes(template)) {\n // Setting bodyHeight to undefined to unset bodyHeight if set by previous view like table\n // TODO: Once we start clearing ViewGenerator object on view change, we can remove this as bodyHeight will be reset to default value on new view render.\n getView().setProp('bodyHeight', undefined);\n return;\n }\n\n // row height is calculated based on the height provided for each row in the styledtablecontainer.jsx styles\n let rowHeight;\n let headerHeight;\n if (getState().selectedHeightOption) {\n rowHeight = rowDensityClasses[getState().selectedHeightOption!].rowHeight;\n headerHeight = 45;\n }\n\n if (template === TEMPLATES.TIMELINE) {\n rowHeight = 41;\n headerHeight = 56;\n if (!getState().groups?.[0]?.dateFunction) {\n headerHeight = 0;\n }\n }\n\n if (rowHeight && numberOfRows) {\n getView().setProp('bodyHeight', rowHeight * numberOfRows + headerHeight!);\n }\n}\n/**\n * Adjusts the {@link View.bodyHeight bodyHeight} of the view based on the following properties change:\n * - {@link State.selectedHeightOption}.\n * - {@link Meta.numberOfRows}.\n * - {@link Meta.template}.\n * - {@link State.groups}.\n */\n// TODO: RsCore shouldn't be responsible for height calculations. We should move this feature to React layer.\nexport default () => {\n const memoisedFunc = withMemoization(updateBodyHeight);\n\n return function execute(featureProps: BeforeRenderFeatureProps) {\n memoisedFunc(\n [featureProps],\n [\n featureProps.getState().selectedHeightOption,\n featureProps.getView().meta.numberOfRows,\n featureProps.getView().template,\n featureProps.getState().groups\n ]\n );\n };\n};\n"]}
@@ -5,7 +5,7 @@ import type { BeforeRenderFeatureProps } from '../../featureFactory';
5
5
  * - {@link State.filterExpression}
6
6
  * - `query` in {@link State.search}
7
7
  * - `active` in {@link State.personalization}
8
- * - {@link state.hiddenColumns}
8
+ * - {@link state.visibleColumns}
9
9
  */
10
10
  declare const _default: () => (featureProps: BeforeRenderFeatureProps) => Promise<void>;
11
11
  export default _default;
@@ -36,7 +36,7 @@ const getAggregatedValues = async ([{ getView, getRsProps, getState, getRsStore
36
36
  * - {@link State.filterExpression}
37
37
  * - `query` in {@link State.search}
38
38
  * - `active` in {@link State.personalization}
39
- * - {@link state.hiddenColumns}
39
+ * - {@link state.visibleColumns}
40
40
  */
41
41
  export default () => {
42
42
  const memoizedGetAggregatedValues = withMemoization(getAggregatedValues);
@@ -48,7 +48,7 @@ export default () => {
48
48
  state.search?.query,
49
49
  state?.personalization?.active,
50
50
  state.refresh,
51
- state.hiddenColumns
51
+ state.visibleColumns
52
52
  ]);
53
53
  };
54
54
  };
@@ -1 +1 @@
1
- {"version":3,"file":"aggregation.js","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/aggregation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAKhE,qDAAqD;AAErD;;;GAGG;AACH,MAAM,mBAAmB,GAAG,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,CAEhF,EAAE,EAAE;IACH,MAAM,EAAE,UAAU,EAAE,GAAG,UAAU,EAAE,CAAC;IACpC,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,IAAI,CAAC;QACH,MAAM,gBAAgB,GACpB,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC,IAAI,KAAK,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC;YACtE,CAAC,CAAC,MAAM,UAAU,CAAC,qBAAsB,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE;gBACvE,GAAG,CAAC,UAAU,EAAE,CAAC,iBAAiB,IAAI;oBACpC,eAAe,EAAE,IAAI;oBACrB,oBAAoB,EAAE,UAAU,EAAE,CAAC,YAAY;iBAChD,CAAC;aACH,CAAC;YACJ,CAAC,CAAC,EAAE,CAAC;QACT,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE;YAClC,MAAM,WAAW,GACf,KAAK,CAAC,eAAe,IAAI,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAC3F,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC;gBACtB,UAAU,EAAE,CAAC,CAAC,WAAW;gBACzB,cAAc,EAAE,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;gBACjD,eAAe,EAAE,WAAW,EAAE,IAAI;aACnC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,sCAAsC;QACtC,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;IACxC,CAAC;AACH,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAe,GAAG,EAAE;IAClB,MAAM,2BAA2B,GAAG,eAAe,CAAC,mBAAmB,CAAC,CAAC;IAEzE,OAAO,KAAK,UAAU,OAAO,CAAC,YAAsC;QAClE,MAAM,KAAK,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;QACtC,MAAM,2BAA2B,CAC/B,CAAC,YAAY,CAAC,EACd;YACE,KAAK,CAAC,eAAe;YACrB,KAAK,CAAC,gBAAgB;YACtB,KAAK,CAAC,MAAM,EAAE,KAAK;YACnB,KAAK,EAAE,eAAe,EAAE,MAAM;YAC9B,KAAK,CAAC,OAAO;YACb,KAAK,CAAC,aAAa;SACpB,CACF,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { deepCopy, withMemoization } from '../../../utils/util';\nimport type { BeforeRenderFeatureProps } from '../../featureFactory';\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport type { State } from '../../../../../types/State.types';\nimport type { ApiContext } from '../../../../../types/ApiContext.types';\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\n/**\n * Calculates the aggregate values for columns by calling {@link ApiContext.fetchAggregatedValues fetchAggregatedValues} api if {@link State.aggregationInfo aggregationInfo} is present.\n * @param param0 - {@link BeforeRenderFeatureProps}\n */\nconst getAggregatedValues = async ([{ getView, getRsProps, getState, getRsStore }]: [\n featureProps: BeforeRenderFeatureProps\n]) => {\n const { apiContext } = getRsProps();\n const state = getState();\n try {\n const aggregatedValues =\n Array.isArray(state.aggregationInfo) && state.aggregationInfo.length > 0\n ? await apiContext.fetchAggregatedValues!(deepCopy(state), getView().meta, {\n ...(getRsStore().refreshInProgress && {\n invalidateCache: true,\n invalidateCacheToken: getRsStore().refreshToken\n })\n })\n : {};\n getView().columns?.forEach(column => {\n const aggregation =\n state.aggregationInfo && state.aggregationInfo.find(t => t.columnId === column.field.id);\n column = column.setProp({\n aggregated: !!aggregation,\n aggregateValue: aggregatedValues[column.field.id],\n aggregationType: aggregation?.type\n });\n });\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error('API call failed', err);\n }\n};\n\n/**\n * Calculates the aggregate values for columns when any of the following state properties are changed:\n * - {@link State.aggregationInfo}\n * - {@link State.filterExpression}\n * - `query` in {@link State.search}\n * - `active` in {@link State.personalization}\n * - {@link state.hiddenColumns}\n */\nexport default () => {\n const memoizedGetAggregatedValues = withMemoization(getAggregatedValues);\n\n return async function execute(featureProps: BeforeRenderFeatureProps) {\n const state = featureProps.getState();\n await memoizedGetAggregatedValues(\n [featureProps],\n [\n state.aggregationInfo,\n state.filterExpression,\n state.search?.query,\n state?.personalization?.active,\n state.refresh,\n state.hiddenColumns\n ]\n );\n };\n};\n"]}
1
+ {"version":3,"file":"aggregation.js","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/aggregation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAKhE,qDAAqD;AAErD;;;GAGG;AACH,MAAM,mBAAmB,GAAG,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,CAEhF,EAAE,EAAE;IACH,MAAM,EAAE,UAAU,EAAE,GAAG,UAAU,EAAE,CAAC;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AClE,MAAM,KAAK,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;QACtC,MAAM,2BAA2B,CAC/B,CAAC,YAAY,CAAC,EACd;YACE,KAAK,CAAC,eAAe;YACrB,KAAK,CAAC,gBAAgB;YACtB,KAAK,CAAC,MAAM,EAAE,KAAK;YACnB,KAAK,EAAE,eAAe,EAAE,MAAM;YAC9B,KAAK,CAAC,OAAO;YACb,KAAK,CAAC,cAAc;SACrB,CACF,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { deepCopy, withMemoization } from '../../../utils/util';\nimport type { BeforeRenderFeatureProps } from '../../featureFactory';\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport type { State } from '../../../../../types/State.types';\nimport type { ApiContext } from '../../../../../types/ApiContext.types';\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\n/**\n * Calculates the aggregate values for columns by calling {@link ApiContext.fetchAggregatedValues fetchAggregatedValues} api if {@link State.aggregationInfo aggregationInfo} is present.\n * @param param0 - {@link BeforeRenderFeatureProps}\n */\nconst getAggregatedValues = async ([{ getView, getRsProps, getState, getRsStore }]: [\n featureProps: BeforeRenderFeatureProps\n]) => {\n const { apiContext } = getRsProps();\n const state = getState();\n try {\n const aggregatedValues =\n Array.isArray(state.aggregationInfo) && state.aggregationInfo.length > 0\n ? await apiContext.fetchAggregatedValues!(deepCopy(state), getView().meta, {\n ...(getRsStore().refreshInProgress && {\n invalidateCache: true,\n invalidateCacheToken: getRsStore().refreshToken\n })\n })\n : {};\n getView().columns?.forEach(column => {\n const aggregation =\n state.aggregationInfo && state.aggregationInfo.find(t => t.columnId === column.field.id);\n column = column.setProp({\n aggregated: !!aggregation,\n aggregateValue: aggregatedValues[column.field.id],\n aggregationType: aggregation?.type\n });\n });\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error('API call failed', err);\n }\n};\n\n/**\n * Calculates the aggregate values for columns when any of the following state properties are changed:\n * - {@link State.aggregationInfo}\n * - {@link State.filterExpression}\n * - `query` in {@link State.search}\n * - `active` in {@link State.personalization}\n * - {@link state.visibleColumns}\n */\nexport default () => {\n const memoizedGetAggregatedValues = withMemoization(getAggregatedValues);\n\n return async function execute(featureProps: BeforeRenderFeatureProps) {\n const state = featureProps.getState();\n await memoizedGetAggregatedValues(\n [featureProps],\n [\n state.aggregationInfo,\n state.filterExpression,\n state.search?.query,\n state?.personalization?.active,\n state.refresh,\n state.visibleColumns\n ]\n );\n };\n};\n"]}
@@ -16,7 +16,7 @@ import type RsInternal from '../../../RsInternal';
16
16
  * - {@link State.freezeColumns}
17
17
  * - {@link RsStore.skipColumnAnimationOnNextRun}
18
18
  * - {@link State.colOrder}
19
- * - {@link State.hiddenColumns}
19
+ * - {@link State.visibleColumns}
20
20
  * - {@link State.columnWidths}
21
21
  * - {@link State.refresh}
22
22
  */
@@ -1 +1 @@
1
- {"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/animation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AA4DlD;;;;;;;;;;;;;;;;;;;;GAoBG;yBACa,YAAY,UAAU;AAAtC,wBA8CE"}
1
+ {"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/animation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AA4DlD;;;;;;;;;;;;;;;;;;;;GAoBG;yBACa,YAAY,UAAU;AAAtC,wBA8CE"}
@@ -1,3 +1,4 @@
1
+ import { isInstance } from '@pega/cosmos-react-core';
1
2
  import { BEFORE_FETCH } from '../../../pubSub/events';
2
3
  import { withMemoization } from '../../../utils/util';
3
4
  /* eslint-enable @typescript-eslint/no-unused-vars */
@@ -16,7 +17,7 @@ const rowAnimate = ([{ getState, getRsStore, getView }]) => {
16
17
  return false;
17
18
  const boundingBox = new Map();
18
19
  rowContainer.childNodes.forEach(n => {
19
- if (n instanceof Element && n.hasAttribute('data-key'))
20
+ if (isInstance(n, Element) && n.hasAttribute('data-key'))
20
21
  boundingBox.set(n.getAttribute('data-key'), n.getBoundingClientRect());
21
22
  });
22
23
  rsStore.oldBoundingBox = boundingBox;
@@ -33,7 +34,7 @@ const columnAnimate = ([{ getState, getRsStore, getView }]) => {
33
34
  getView()
34
35
  .getItemElement()
35
36
  .childNodes.forEach(cell => {
36
- if (cell instanceof Element && cell.hasAttribute('data-col-id')) {
37
+ if (isInstance(cell, Element) && cell.hasAttribute('data-col-id')) {
37
38
  columnBoundingBox.set(cell.getAttribute('data-col-id'), cell.getBoundingClientRect());
38
39
  }
39
40
  });
@@ -63,7 +64,7 @@ function skipColumnAnimation([{ getRsStore }]) {
63
64
  * - {@link State.freezeColumns}
64
65
  * - {@link RsStore.skipColumnAnimationOnNextRun}
65
66
  * - {@link State.colOrder}
66
- * - {@link State.hiddenColumns}
67
+ * - {@link State.visibleColumns}
67
68
  * - {@link State.columnWidths}
68
69
  * - {@link State.refresh}
69
70
  */
@@ -93,7 +94,7 @@ export default (rsInternal) => {
93
94
  memoizedColumnAnimate([featureProps], [
94
95
  state.freezeColumns,
95
96
  state.colOrder,
96
- state.hiddenColumns,
97
+ state.visibleColumns,
97
98
  state.columnWidths,
98
99
  state.refresh,
99
100
  featureProps.getRsStore().skipColumnAnimationOnNextRun