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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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
package/lib/index.d.ts CHANGED
@@ -2,8 +2,8 @@ export { default as initializeRsCore } from './src/core/index';
2
2
  export { convertMetaIntoState } from './src/core/features/uIFeatures/beforeRender/stateHydration';
3
3
  export { filterParams, typeMap, comparatorMap } from './src/core/config/filterConfig';
4
4
  export { getVisibileFields, dateFunctionLabels, getScrollbarWidth, getScrollerElem, getRowContextData, getFilterInitializers, getFilterConditions, isFilterApplied, addFilter, getFilters, removeEmptyValues, isEmpty, normalizeMeta } from './src/core/utils/util';
5
- export { ACTION_FIELD_TYPE, expandCollapseAllMeta, rowErrorColumnMeta, rowDragDropColumnMeta } from './src/core/constants';
6
- export declare const UPDATE_DEBUG_INFO: "updateDebugInfo", TOGGLE_DISABLE_SELECTION: "toggleDisableSelection", TOGGLE_REQUIRED: "toggleRequired", NOTIFY_DATA_REFRESH: "notifyDataRefresh", USER_CONFIRMATION_ACTION: "userConfirmationAction", SET_IN_EXTERNAL_STATE: "setInExternalState", UPDATE_SELECTED_ROWS: "updateSelectedRows";
5
+ export { ACTION_FIELD_TYPE, expandCollapseAllMeta, rowErrorColumnMeta, rowDragDropColumnMeta, rowDeleteColumnMeta } from './src/core/constants';
6
+ export declare const UPDATE_DEBUG_INFO: "updateDebugInfo", TOGGLE_DISABLE_SELECTION: "toggleDisableSelection", TOGGLE_REQUIRED: "toggleRequired", NOTIFY_DATA_REFRESH: "notifyDataRefresh", USER_CONFIRMATION_ACTION: "userConfirmationAction", SET_IN_EXTERNAL_STATE: "setInExternalState", UPDATE_SELECTED_ROWS: "updateSelectedRows", SET_WARNING_MESSAGES: "setWarningMessages";
7
7
  export { getMockColumn } from './src/core/test/junitMocks';
8
8
  export { getGroupKey, getGroupFromKey } from './src/core/utils/util';
9
9
  export { default as BaseA11y } from './src/core/a11y/BaseA11y';
@@ -11,4 +11,5 @@ export type { RsCoreTypes } from './types';
11
11
  export { ROW_DENSITY, FieldType } from './types/Meta.types';
12
12
  export { REPEATING_STRUCTURE_TEMPLATES, cellUpdateTrigger } from './types/Meta.types';
13
13
  export { sanitizeConditionalStyleFormats } from './src/core/features/uIFeatures/beforeRender/stateSanitization';
14
+ export { rowSelectColumnMeta } from './src/core/constants';
14
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAG/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AAElG,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAEtF,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf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AAC;AAE/B,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAC9B,eAAO,MACL,iBAAiB,qBACjB,wBAAwB,4BACxB,eAAe,oBACf,mBAAmB,uBACnB,wBAAwB,4BACxB,qBAAqB,wBACrB,oBAAoB,wBACpB,oBAAoB,sBACP,CAAC;AAEhB,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAE/D,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,6BAA6B,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEtF,OAAO,EAAE,+BAA+B,EAAE,MAAM,+DAA+D,CAAC;AAEhH,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC"}
package/lib/index.js CHANGED
@@ -4,12 +4,13 @@ export { default as initializeRsCore } from './src/core/index';
4
4
  export { convertMetaIntoState } from './src/core/features/uIFeatures/beforeRender/stateHydration';
5
5
  export { filterParams, typeMap, comparatorMap } from './src/core/config/filterConfig';
6
6
  export { getVisibileFields, dateFunctionLabels, getScrollbarWidth, getScrollerElem, getRowContextData, getFilterInitializers, getFilterConditions, isFilterApplied, addFilter, getFilters, removeEmptyValues, isEmpty, normalizeMeta } from './src/core/utils/util';
7
- export { ACTION_FIELD_TYPE, expandCollapseAllMeta, rowErrorColumnMeta, rowDragDropColumnMeta } from './src/core/constants';
8
- export const { UPDATE_DEBUG_INFO, TOGGLE_DISABLE_SELECTION, TOGGLE_REQUIRED, NOTIFY_DATA_REFRESH, USER_CONFIRMATION_ACTION, SET_IN_EXTERNAL_STATE, UPDATE_SELECTED_ROWS } = ActionTypes;
7
+ export { ACTION_FIELD_TYPE, expandCollapseAllMeta, rowErrorColumnMeta, rowDragDropColumnMeta, rowDeleteColumnMeta } from './src/core/constants';
8
+ export const { UPDATE_DEBUG_INFO, TOGGLE_DISABLE_SELECTION, TOGGLE_REQUIRED, NOTIFY_DATA_REFRESH, USER_CONFIRMATION_ACTION, SET_IN_EXTERNAL_STATE, UPDATE_SELECTED_ROWS, SET_WARNING_MESSAGES } = ActionTypes;
9
9
  export { getMockColumn } from './src/core/test/junitMocks';
10
10
  export { getGroupKey, getGroupFromKey } from './src/core/utils/util';
11
11
  export { default as BaseA11y } from './src/core/a11y/BaseA11y';
12
12
  export { ROW_DENSITY, FieldType } from './types/Meta.types';
13
13
  export { REPEATING_STRUCTURE_TEMPLATES, cellUpdateTrigger } from './types/Meta.types';
14
14
  export { sanitizeConditionalStyleFormats } from './src/core/features/uIFeatures/beforeRender/stateSanitization';
15
+ export { rowSelectColumnMeta } from './src/core/constants';
15
16
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,oCAAoC,CAAC;AAE7D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAE/D,+BAA+B;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AAElG,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAEtF,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,OAAO,EACP,aAAa,EACd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAC9B,MAAM,CAAC,MAAM,EACX,iBAAiB,EACjB,wBAAwB,EACxB,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EACrB,GAAG,WAAW,CAAC;AAEhB,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAI/D,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,6BAA6B,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEtF,OAAO,EAAE,+BAA+B,EAAE,MAAM,+DAA+D,CAAC","sourcesContent":["import ActionTypes from './src/core/actions/actionConstants';\n\nexport { default as initializeRsCore } from './src/core/index';\n\n// FIXME: revisit below exports\nexport { convertMetaIntoState } from './src/core/features/uIFeatures/beforeRender/stateHydration';\n\nexport { filterParams, typeMap, comparatorMap } from './src/core/config/filterConfig';\n\nexport {\n getVisibileFields,\n dateFunctionLabels,\n getScrollbarWidth,\n getScrollerElem,\n getRowContextData,\n getFilterInitializers,\n getFilterConditions,\n isFilterApplied,\n addFilter,\n getFilters,\n removeEmptyValues,\n isEmpty,\n normalizeMeta\n} from './src/core/utils/util';\n\nexport {\n ACTION_FIELD_TYPE,\n expandCollapseAllMeta,\n rowErrorColumnMeta,\n rowDragDropColumnMeta\n} from './src/core/constants';\nexport const {\n UPDATE_DEBUG_INFO,\n TOGGLE_DISABLE_SELECTION,\n TOGGLE_REQUIRED,\n NOTIFY_DATA_REFRESH,\n USER_CONFIRMATION_ACTION,\n SET_IN_EXTERNAL_STATE,\n UPDATE_SELECTED_ROWS\n} = ActionTypes;\n\nexport { getMockColumn } from './src/core/test/junitMocks';\nexport { getGroupKey, getGroupFromKey } from './src/core/utils/util';\n\nexport { default as BaseA11y } from './src/core/a11y/BaseA11y';\n\nexport type { RsCoreTypes } from './types';\n\nexport { ROW_DENSITY, FieldType } from './types/Meta.types';\n\nexport { REPEATING_STRUCTURE_TEMPLATES, cellUpdateTrigger } from './types/Meta.types';\n\nexport { sanitizeConditionalStyleFormats } from './src/core/features/uIFeatures/beforeRender/stateSanitization';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,oCAAoC,CAAC;AAE7D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAE/D,+BAA+B;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AAElG,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAEtF,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,OAAO,EACP,aAAa,EACd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAC9B,MAAM,CAAC,MAAM,EACX,iBAAiB,EACjB,wBAAwB,EACxB,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACrB,GAAG,WAAW,CAAC;AAEhB,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAI/D,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,6BAA6B,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEtF,OAAO,EAAE,+BAA+B,EAAE,MAAM,+DAA+D,CAAC;AAEhH,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["import ActionTypes from './src/core/actions/actionConstants';\n\nexport { default as initializeRsCore } from './src/core/index';\n\n// FIXME: revisit below exports\nexport { convertMetaIntoState } from './src/core/features/uIFeatures/beforeRender/stateHydration';\n\nexport { filterParams, typeMap, comparatorMap } from './src/core/config/filterConfig';\n\nexport {\n getVisibileFields,\n dateFunctionLabels,\n getScrollbarWidth,\n getScrollerElem,\n getRowContextData,\n getFilterInitializers,\n getFilterConditions,\n isFilterApplied,\n addFilter,\n getFilters,\n removeEmptyValues,\n isEmpty,\n normalizeMeta\n} from './src/core/utils/util';\n\nexport {\n ACTION_FIELD_TYPE,\n expandCollapseAllMeta,\n rowErrorColumnMeta,\n rowDragDropColumnMeta,\n rowDeleteColumnMeta\n} from './src/core/constants';\nexport const {\n UPDATE_DEBUG_INFO,\n TOGGLE_DISABLE_SELECTION,\n TOGGLE_REQUIRED,\n NOTIFY_DATA_REFRESH,\n USER_CONFIRMATION_ACTION,\n SET_IN_EXTERNAL_STATE,\n UPDATE_SELECTED_ROWS,\n SET_WARNING_MESSAGES\n} = ActionTypes;\n\nexport { getMockColumn } from './src/core/test/junitMocks';\nexport { getGroupKey, getGroupFromKey } from './src/core/utils/util';\n\nexport { default as BaseA11y } from './src/core/a11y/BaseA11y';\n\nexport type { RsCoreTypes } from './types';\n\nexport { ROW_DENSITY, FieldType } from './types/Meta.types';\n\nexport { REPEATING_STRUCTURE_TEMPLATES, cellUpdateTrigger } from './types/Meta.types';\n\nexport { sanitizeConditionalStyleFormats } from './src/core/features/uIFeatures/beforeRender/stateSanitization';\n\nexport { rowSelectColumnMeta } from './src/core/constants';\n"]}
@@ -14,7 +14,7 @@ export default class RsCore {
14
14
  */
15
15
  constructor(rsCoreInternal: RsInternal);
16
16
  /**
17
- * @param {*} args - args whose reference is changing after initialization of rsCore
17
+ * @param args - args whose reference is changing after initialization of rsCore
18
18
  */
19
19
  updateInitArgs(args: {
20
20
  apiContext: ApiContext;
@@ -16,7 +16,7 @@ export default class RsCore {
16
16
  }
17
17
  // TODO: enrich this to take other args like meta as well
18
18
  /**
19
- * @param {*} args - args whose reference is changing after initialization of rsCore
19
+ * @param args - args whose reference is changing after initialization of rsCore
20
20
  */
21
21
  updateInitArgs(args) {
22
22
  const { apiContext, styleFormats } = args;
@@ -1 +1 @@
1
- {"version":3,"file":"RsCore.js","sourceRoot":"","sources":["../../../src/core/RsCore.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,MAAM;IACzB,WAAW,CAAa;IAExB;;;OAGG;IACH,YAAY,cAA0B;QACpC,IAAI,CAAC,WAAW,GAAG,cAAc,CAAC;IACpC,CAAC;IAED,yDAAyD;IACzD;;OAEG;IACH,cAAc,CAAC,IAAuE;QACpF,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;QAC1C,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC,UAAU,GAAG,UAAU,CAAC;QACtD,iEAAiE;QACjE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC,EAAE,CAAC;YACzE,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC,YAAY,GAAG,YAAY,CAAC;YAC1D,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;IAED;;OAEG;IACH,OAAO,GAAG,GAAG,EAAE;QACb,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;IACpC,CAAC,CAAC;IAEF;;OAEG;IACH,eAAe,GAAG,GAAG,EAAE,CAAC,CAAC;QACvB,gEAAgE;QAChE,KAAK,EAAE,GAAG,EAAE;YACV,IAAI,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACnD,CAAC;QACD,+CAA+C;QAC/C,OAAO,EAAE,GAAG,EAAE;YACZ,IAAI,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACrD,CAAC;QACD,oIAAoI;QACpI,WAAW,EAAE,GAAG,EAAE;YAChB,IAAI,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QAC1D,CAAC;KACF,CAAC,CAAC;CACJ","sourcesContent":["import type { ApiContext } from '../../types/ApiContext.types';\n\nimport type RsInternal from './RsInternal';\nimport type RsProps from './RsProps';\nimport { MOUNT, UNMOUNT, AFTER_RENDER } from './pubSub/events';\nimport { deepEqual } from './utils/util';\n\n/**\n * Represents the public interface of the core library.\n * On the initialization of core library, an instance of this class will be returned to the consumer\n * and they can use the available methods to interact with the library.\n */\nexport default class RsCore {\n #rsInternal: RsInternal;\n\n /**\n * Constructs an instance of RsCore.\n * @param rsCoreInternal RsInternal object.\n */\n constructor(rsCoreInternal: RsInternal) {\n this.#rsInternal = rsCoreInternal;\n }\n\n // TODO: enrich this to take other args like meta as well\n /**\n * @param {*} args - args whose reference is changing after initialization of rsCore\n */\n updateInitArgs(args: { apiContext: ApiContext; styleFormats: RsProps['styleFormats'] }) {\n const { apiContext, styleFormats } = args;\n this.#rsInternal.getRsProps().apiContext = apiContext;\n // styleFormats props can be updated across re-renders, honor it.\n if (!deepEqual(this.#rsInternal.getRsProps().styleFormats, styleFormats)) {\n this.#rsInternal.getRsProps().styleFormats = styleFormats;\n this.#rsInternal.getView().type.forceUpdate(false);\n }\n }\n\n /**\n * Get the latest view object. This object can be used to construct the repeating structure view.\n */\n getView = () => {\n return this.#rsInternal.getView();\n };\n\n /**\n * Notify the core library about the view related events. The library will do run some features or do some cleanup based on the events.\n */\n notifyViewEvent = () => ({\n /** Notify when the component has mounted for the first time. */\n mount: () => {\n this.#rsInternal.getPubSubUtils().publish(MOUNT);\n },\n /** Notify when the component is unmounting. */\n unmount: () => {\n this.#rsInternal.getPubSubUtils().publish(UNMOUNT);\n },\n /** Notify every time the component has finished rendering. Core library might run some features that need the latest DOM to run. */\n afterRender: () => {\n this.#rsInternal.getPubSubUtils().publish(AFTER_RENDER);\n }\n });\n}\n"]}
1
+ {"version":3,"file":"RsCore.js","sourceRoot":"","sources":["../../../src/core/RsCore.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,MAAM;IACzB,WAAW,CAAa;IAExB;;;OAGG;IACH,YAAY,cAA0B;QACpC,IAAI,CAAC,WAAW,GAAG,cAAc,CAAC;IACpC,CAAC;IAED,yDAAyD;IACzD;;OAEG;IACH,cAAc,CAAC,IAAuE;QACpF,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;QAC1C,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC,UAAU,GAAG,UAAU,CAAC;QACtD,iEAAiE;QACjE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC,EAAE,CAAC;YACzE,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC,YAAY,GAAG,YAAY,CAAC;YAC1D,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;IAED;;OAEG;IACH,OAAO,GAAG,GAAG,EAAE;QACb,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;IACpC,CAAC,CAAC;IAEF;;OAEG;IACH,eAAe,GAAG,GAAG,EAAE,CAAC,CAAC;QACvB,gEAAgE;QAChE,KAAK,EAAE,GAAG,EAAE;YACV,IAAI,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACnD,CAAC;QACD,+CAA+C;QAC/C,OAAO,EAAE,GAAG,EAAE;YACZ,IAAI,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACrD,CAAC;QACD,oIAAoI;QACpI,WAAW,EAAE,GAAG,EAAE;YAChB,IAAI,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QAC1D,CAAC;KACF,CAAC,CAAC;CACJ","sourcesContent":["import type { ApiContext } from '../../types/ApiContext.types';\n\nimport type RsInternal from './RsInternal';\nimport type RsProps from './RsProps';\nimport { MOUNT, UNMOUNT, AFTER_RENDER } from './pubSub/events';\nimport { deepEqual } from './utils/util';\n\n/**\n * Represents the public interface of the core library.\n * On the initialization of core library, an instance of this class will be returned to the consumer\n * and they can use the available methods to interact with the library.\n */\nexport default class RsCore {\n #rsInternal: RsInternal;\n\n /**\n * Constructs an instance of RsCore.\n * @param rsCoreInternal RsInternal object.\n */\n constructor(rsCoreInternal: RsInternal) {\n this.#rsInternal = rsCoreInternal;\n }\n\n // TODO: enrich this to take other args like meta as well\n /**\n * @param args - args whose reference is changing after initialization of rsCore\n */\n updateInitArgs(args: { apiContext: ApiContext; styleFormats: RsProps['styleFormats'] }) {\n const { apiContext, styleFormats } = args;\n this.#rsInternal.getRsProps().apiContext = apiContext;\n // styleFormats props can be updated across re-renders, honor it.\n if (!deepEqual(this.#rsInternal.getRsProps().styleFormats, styleFormats)) {\n this.#rsInternal.getRsProps().styleFormats = styleFormats;\n this.#rsInternal.getView().type.forceUpdate(false);\n }\n }\n\n /**\n * Get the latest view object. This object can be used to construct the repeating structure view.\n */\n getView = () => {\n return this.#rsInternal.getView();\n };\n\n /**\n * Notify the core library about the view related events. The library will do run some features or do some cleanup based on the events.\n */\n notifyViewEvent = () => ({\n /** Notify when the component has mounted for the first time. */\n mount: () => {\n this.#rsInternal.getPubSubUtils().publish(MOUNT);\n },\n /** Notify when the component is unmounting. */\n unmount: () => {\n this.#rsInternal.getPubSubUtils().publish(UNMOUNT);\n },\n /** Notify every time the component has finished rendering. Core library might run some features that need the latest DOM to run. */\n afterRender: () => {\n this.#rsInternal.getPubSubUtils().publish(AFTER_RENDER);\n }\n });\n}\n"]}
@@ -2,6 +2,18 @@ import type View from './generators/ViewGenerator';
2
2
  import type StateResolver from './StateResolver';
3
3
  import type RsStore from './RsStore';
4
4
  import type RsProps from './RsProps';
5
+ /**
6
+ * Browser environment context derived from the RS component's owner document.
7
+ * Provides frame-aware alternatives to the global `document` and `window`, so that
8
+ * features work correctly when the table is rendered inside an iFrame.
9
+ * Extend this interface when new browser-global properties need to be exposed to features.
10
+ */
11
+ export interface BrowserContext {
12
+ /** The document that owns the RS DOM container. Use instead of the global `document`. */
13
+ document: Document;
14
+ /** The window associated with the owner document. Use instead of the global `window`. */
15
+ window: Window & typeof globalThis;
16
+ }
5
17
  type SubscriberCallback = () => void;
6
18
  type Subscribers = {
7
19
  [eventName: string]: SubscriberCallback[];
@@ -80,6 +92,17 @@ export default class RsInternal {
80
92
  * @returns rsStateResolver instance
81
93
  */
82
94
  getRsStateResolver: () => StateResolver;
95
+ /**
96
+ * Returns the browser environment context derived from the RS component's owner document.
97
+ *
98
+ * All features should use `browserContext.document` and `browserContext.window` from
99
+ * {@link FeatureProps} instead of the global `document` and `window`. This ensures
100
+ * features work correctly when the table is rendered inside an iFrame, where the
101
+ * globals refer to the parent frame rather than the frame containing the component.
102
+ *
103
+ * @returns A {@link BrowserContext} containing the frame-aware `document` and `window`.
104
+ */
105
+ getBrowserContext: () => BrowserContext;
83
106
  }
84
107
  export {};
85
108
  //# sourceMappingURL=RsInternal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RsInternal.d.ts","sourceRoot":"","sources":["../../../src/core/RsInternal.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,aAAa,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,KAAK,kBAAkB,GAAG,MAAM,IAAI,CAAC;AACrC,KAAK,WAAW,GAAG;IACjB,CAAC,SAAS,EAAE,MAAM,GAAG,kBAAkB,EAAE,CAAC;CAC3C,CAAC;AACF,KAAK,WAAW,GAAG;IACjB;;;;;OAKG;IACH,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC,MAAM,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC;IAC9D;;;;;OAKG;IACH,SAAS,EAAE,CACT,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,IAAI,KAElB;QACE,WAAW,EAAE,MAAM,IAAI,CAAC;KACzB,GACD,SAAS,CAAC;CACf,CAAC;AACF;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,UAAU;;IAgB7B,0BAA0B;IAC1B,EAAE,EAAE,MAAM,CAAC;;IAOX,oDAAoD;IACpD,OAAO;IAIP,iCAAiC;IACjC,OAAO,aAEL;IAEF,oHAAoH;IACpH,UAAU,GAAI,YAAY,IAAI,UAI5B;IAEF,UAAU,GAAI,SAAS,OAAO,UAE5B;IAEF;;;;;OAKG;IACH,UAAU,QAAO,OA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AAM,IAAI,KAElB;QACE,WAAW,EAAE,MAAM,IAAI,CAAC;KACzB,GACD,SAAS,CAAC;CACf,CAAC;AACF;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,UAAU;;IAgB7B,0BAA0B;IAC1B,EAAE,EAAE,MAAM,CAAC;;IAOX,oDAAoD;IACpD,OAAO;IAIP,iCAAiC;IACjC,OAAO,aAEL;IAEF,oHAAoH;IACpH,UAAU,GAAI,YAAY,IAAI,UAI5B;IAEF,UAAU,GAAI,SAAS,OAAO,UAE5B;IAEF;;;;;OAKG;IACH,UAAU,QAAO,OAAO,CAEtB;IAEF,UAAU,GAAI,SAAS,OAAO,UAE5B;IAEF;;;;OAIG;IACH,UAAU,QAAO,OAAO,CAEtB;IAEF,cAAc,GAAI,aAAa,WAAW,UAExC;IAEF;;;;OAIG;IACH,cAAc,QAAO,WAAW,CAE9B;IAEF,sBAAsB,GAAI,qBAAqB,MAAM,IAAI,UAEvD;IAEF;;;;OAIG;IACH,sBAAsB,QAAO,CAAC,MAAM,IAAI,CAAC,CAEvC;IAEF,cAAc,GAAI,aAAa,WAAW,UAExC;IAEF;;;OAGG;IACH,cAAc,QAAO,WAAW,CAE9B;IAEF,kBAAkB,GAAI,iBAAiB,aAAa,UAElD;IAEF;;;OAGG;IACH,kBAAkB,sBAEhB;IAEF;;;;;;;;;OASG;IACH,iBAAiB,QAAO,cAAc,CAMpC;CACH"}
@@ -1,4 +1,3 @@
1
- import { v4 as uuidV4 } from 'uuid';
2
1
  import viewUtilityMethods from './generators/viewUtilityMethods';
3
2
  /**
4
3
  * Represents the internal state of the core library.
@@ -17,7 +16,7 @@ export default class RsInternal {
17
16
  /** A unique identifier */
18
17
  id;
19
18
  constructor() {
20
- this.id = uuidV4();
19
+ this.id = crypto.randomUUID();
21
20
  // TODO: check we have a better way to initialize the util methods on the view
22
21
  this.#viewUtilityMethods = viewUtilityMethods(this);
23
22
  }
@@ -100,5 +99,22 @@ export default class RsInternal {
100
99
  getRsStateResolver = () => {
101
100
  return this.#rsStateResolver;
102
101
  };
102
+ /**
103
+ * Returns the browser environment context derived from the RS component's owner document.
104
+ *
105
+ * All features should use `browserContext.document` and `browserContext.window` from
106
+ * {@link FeatureProps} instead of the global `document` and `window`. This ensures
107
+ * features work correctly when the table is rendered inside an iFrame, where the
108
+ * globals refer to the parent frame rather than the frame containing the component.
109
+ *
110
+ * @returns A {@link BrowserContext} containing the frame-aware `document` and `window`.
111
+ */
112
+ getBrowserContext = () => {
113
+ const ownerDocument = this.getView().getDomContainer()?.ownerDocument ?? document;
114
+ return {
115
+ document: ownerDocument,
116
+ window: ownerDocument.defaultView ?? window
117
+ };
118
+ };
103
119
  }
104
120
  //# sourceMappingURL=RsInternal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RsInternal.js","sourceRoot":"","sources":["../../../src/core/RsInternal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAGpC,OAAO,kBAAkB,MAAM,iCAAiC,CAAC;AAiCjE;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B,QAAQ,GAAG,EAAa,CAAC;IAEzB,QAAQ,GAAG,EAAa,CAAC;IAEzB,KAAK,CAAQ;IAEb,YAAY,GAAgB,EAAE,CAAC;IAE/B,YAAY,CAAe;IAE3B,gBAAgB,CAAiB;IAEjC,oBAAoB,CAAc;IAClC,mEAAmE;IACnE,mBAAmB,CAAmB;IACtC,0BAA0B;IAC1B,EAAE,CAAS;IACX;QACE,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC;QACnB,8EAA8E;QAC9E,IAAI,CAAC,mBAAmB,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAED,oDAAoD;IACpD,OAAO;QACL,OAAO,IAAI,CAAC,EAAE,CAAC;IACjB,CAAC;IAED,iCAAiC;IACjC,OAAO,GAAG,GAAG,EAAE;QACb,OAAO,IAAI,CAAC,KAA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CAAC;IAEF;;;OAGG;IACH,cAAc,GAAG,GAAgB,EAAE;QACjC,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC,CAAC;IAEF,kBAAkB,GAAG,CAAC,eAA8B,EAAE,EAAE;QACtD,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;IAC1C,CAAC,CAAC;IAEF;;;OAGG;IACH,kBAAkB,GAAG,GAAG,EAAE;QACxB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC,CAAC;CACH","sourcesContent":["import { v4 as uuidV4 } from 'uuid';\n\nimport type { UtilityFunctions } from './generators/viewUtilityMethods';\nimport viewUtilityMethods from './generators/viewUtilityMethods';\nimport type View from './generators/ViewGenerator';\nimport type StateResolver from './StateResolver';\nimport type RsStore from './RsStore';\nimport type RsProps from './RsProps';\n\ntype SubscriberCallback = () => void;\ntype Subscribers = {\n [eventName: string]: SubscriberCallback[];\n};\ntype PubSubUtils = {\n /**\n *\n * @param eventName - A unique event name that needs to be published\n * @param args - Any optional extra arguments of type functions to be passed to subscriber callbacks.\n * @returns void\n */\n publish: (eventName: string, ...args: (() => void)[]) => void;\n /**\n *\n * @param eventName eventName - A unique event name which needs to be subscribed.\n * @param callback Any optional extra arguments of type functions passed by publisher.\n * @returns - an unsubscribe callback.\n */\n subscribe: (\n eventName: string,\n callback: () => void\n ) =>\n | {\n unsubscribe: () => void;\n }\n | undefined;\n};\n/**\n * Represents the internal state of the core library.\n * The building blocks like features, state resolver, reducers will receive getter methods for properties from this class.\n */\nexport default class RsInternal {\n #rsStore = {} as RsStore;\n\n #rsProps = {} as RsProps;\n\n #view!: View;\n\n #subscribers: Subscribers = {};\n\n #pubSubUtils!: PubSubUtils;\n\n #rsStateResolver!: StateResolver;\n\n #afterRenderFeatures!: () => void;\n /** A set of utility functions avaliable on view using view.type */\n #viewUtilityMethods: UtilityFunctions;\n /** A unique identifier */\n id: string;\n constructor() {\n this.id = uuidV4();\n // TODO: check we have a better way to initialize the util methods on the view\n this.#viewUtilityMethods = viewUtilityMethods(this);\n }\n\n /** Returns the uuid for the rsInternal instance. */\n getRsID() {\n return this.id;\n }\n\n /** Get the latest view object */\n getView = () => {\n return this.#view;\n };\n\n /** Update the newly generated view on the internal state and attach additional methods and callback to the view. */\n updateView = (latestView: View) => {\n this.#view = latestView;\n this.#view.addUtilityFunctions(this.#viewUtilityMethods);\n this.#view.setViewUpdateCallback(this.updateView);\n };\n\n setRsStore = (rsStore: RsStore) => {\n this.#rsStore = rsStore;\n };\n\n /**\n * Get the rsStore object that can be used to store properties which are not supposed to trigger state change,\n * references or any intermediate values that the features might need.\n *\n * @returns reference to rsStore object\n */\n getRsStore = (): RsStore => {\n return this.#rsStore;\n };\n\n setRsProps = (rsProps: RsProps) => {\n this.#rsProps = rsProps;\n };\n\n /**\n * Get the rsProps object that is used to store readOnly props like apiContext, formatters etc.\n *\n * @returns reference to rsProps object\n */\n getRsProps = (): RsProps => {\n return this.#rsProps;\n };\n\n setPubSubUtils = (pubSubUtils: PubSubUtils) => {\n this.#pubSubUtils = pubSubUtils;\n };\n\n /**\n * Returns the pubSub utility methods that can be used to publish/subscribe to events like MOUNT, BEFORE_FETCH, AFTER_FETCH etc.\n *\n * @returns pubSub utils\n */\n getPubSubUtils = (): PubSubUtils => {\n return this.#pubSubUtils;\n };\n\n setAfterRenderFeatures = (afterRenderFeatures: () => void) => {\n this.#afterRenderFeatures = afterRenderFeatures;\n };\n\n /**\n * Returns the array of features like autosize that will run after the rendering has completed.\n *\n * @returns afterRender features\n */\n getAfterRenderFeatures = (): (() => void) => {\n return this.#afterRenderFeatures;\n };\n\n setSubscribers = (subscribers: Subscribers) => {\n this.#subscribers = subscribers;\n };\n\n /**\n * Returns the list of subscribers for respective events.\n * @returns - {@link Subscribers}\n */\n getSubscribers = (): Subscribers => {\n return this.#subscribers;\n };\n\n setRsStateResolver = (rsStateResolver: StateResolver) => {\n this.#rsStateResolver = rsStateResolver;\n };\n\n /**\n * Returns the instance of StateResolver.\n * @returns rsStateResolver instance\n */\n getRsStateResolver = () => {\n return this.#rsStateResolver;\n };\n}\n"]}
1
+ {"version":3,"file":"RsInternal.js","sourceRoot":"","sources":["../../../src/core/RsInternal.ts"],"names":[],"mappings":"AACA,OAAO,kBAAkB,MAAM,iCAAiC,CAAC;AA8CjE;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B,QAAQ,GAAG,EAAa,CAAC;IAEzB,QAAQ,GAAG,EAAa,CAAC;IAEzB,KAAK,CAAQ;IAEb,YAAY,GAAgB,EAAE,CAAC;IAE/B,YAAY,CAAe;IAE3B,gBAAgB,CAAiB;IAEjC,oBAAoB,CAAc;IAClC,mEAAmE;IACnE,mBAAmB,CAAmB;IACtC,0BAA0B;IAC1B,EAAE,CAAS;IACX;QACE,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QAC9B,8EAA8E;QAC9E,IAAI,CAAC,mBAAmB,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAED,oDAAoD;IACpD,OAAO;QACL,OAAO,IAAI,CAAC,EAAE,CAAC;IACjB,CAAC;IAED,iCAAiC;IACjC,OAAO,GAAG,GAAG,EAAE;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC,CAAC;IAEF,oHAAoH;IACpH,UAAU,GAAG,CAAC,UAAgB,EAAE,EAAE;QAChC,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC;QACxB,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QACzD,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACpD,CAAC,CAAC;IAEF,UAAU,GAAG,CAAC,OAAgB,EAAE,EAAE;QAChC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC,CAAC;IAEF;;;;;OAKG;IACH,UAAU,GAAG,GAAY,EAA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AAa,IAAI,QAAQ,CAAC;QAClF,OAAO;YACL,QAAQ,EAAE,aAAa;YACvB,MAAM,EAAE,aAAa,CAAC,WAAW,IAAI,MAAM;SAC5C,CAAC;IACJ,CAAC,CAAC;CACH","sourcesContent":["import type { UtilityFunctions } from './generators/viewUtilityMethods';\nimport viewUtilityMethods from './generators/viewUtilityMethods';\nimport type View from './generators/ViewGenerator';\nimport type StateResolver from './StateResolver';\nimport type RsStore from './RsStore';\nimport type RsProps from './RsProps';\n\n/**\n * Browser environment context derived from the RS component's owner document.\n * Provides frame-aware alternatives to the global `document` and `window`, so that\n * features work correctly when the table is rendered inside an iFrame.\n * Extend this interface when new browser-global properties need to be exposed to features.\n */\nexport interface BrowserContext {\n /** The document that owns the RS DOM container. Use instead of the global `document`. */\n document: Document;\n /** The window associated with the owner document. Use instead of the global `window`. */\n window: Window & typeof globalThis;\n}\n\ntype SubscriberCallback = () => void;\ntype Subscribers = {\n [eventName: string]: SubscriberCallback[];\n};\ntype PubSubUtils = {\n /**\n *\n * @param eventName - A unique event name that needs to be published\n * @param args - Any optional extra arguments of type functions to be passed to subscriber callbacks.\n * @returns void\n */\n publish: (eventName: string, ...args: (() => void)[]) => void;\n /**\n *\n * @param eventName eventName - A unique event name which needs to be subscribed.\n * @param callback Any optional extra arguments of type functions passed by publisher.\n * @returns - an unsubscribe callback.\n */\n subscribe: (\n eventName: string,\n callback: () => void\n ) =>\n | {\n unsubscribe: () => void;\n }\n | undefined;\n};\n/**\n * Represents the internal state of the core library.\n * The building blocks like features, state resolver, reducers will receive getter methods for properties from this class.\n */\nexport default class RsInternal {\n #rsStore = {} as RsStore;\n\n #rsProps = {} as RsProps;\n\n #view!: View;\n\n #subscribers: Subscribers = {};\n\n #pubSubUtils!: PubSubUtils;\n\n #rsStateResolver!: StateResolver;\n\n #afterRenderFeatures!: () => void;\n /** A set of utility functions avaliable on view using view.type */\n #viewUtilityMethods: UtilityFunctions;\n /** A unique identifier */\n id: string;\n constructor() {\n this.id = crypto.randomUUID();\n // TODO: check we have a better way to initialize the util methods on the view\n this.#viewUtilityMethods = viewUtilityMethods(this);\n }\n\n /** Returns the uuid for the rsInternal instance. */\n getRsID() {\n return this.id;\n }\n\n /** Get the latest view object */\n getView = () => {\n return this.#view;\n };\n\n /** Update the newly generated view on the internal state and attach additional methods and callback to the view. */\n updateView = (latestView: View) => {\n this.#view = latestView;\n this.#view.addUtilityFunctions(this.#viewUtilityMethods);\n this.#view.setViewUpdateCallback(this.updateView);\n };\n\n setRsStore = (rsStore: RsStore) => {\n this.#rsStore = rsStore;\n };\n\n /**\n * Get the rsStore object that can be used to store properties which are not supposed to trigger state change,\n * references or any intermediate values that the features might need.\n *\n * @returns reference to rsStore object\n */\n getRsStore = (): RsStore => {\n return this.#rsStore;\n };\n\n setRsProps = (rsProps: RsProps) => {\n this.#rsProps = rsProps;\n };\n\n /**\n * Get the rsProps object that is used to store readOnly props like apiContext, formatters etc.\n *\n * @returns reference to rsProps object\n */\n getRsProps = (): RsProps => {\n return this.#rsProps;\n };\n\n setPubSubUtils = (pubSubUtils: PubSubUtils) => {\n this.#pubSubUtils = pubSubUtils;\n };\n\n /**\n * Returns the pubSub utility methods that can be used to publish/subscribe to events like MOUNT, BEFORE_FETCH, AFTER_FETCH etc.\n *\n * @returns pubSub utils\n */\n getPubSubUtils = (): PubSubUtils => {\n return this.#pubSubUtils;\n };\n\n setAfterRenderFeatures = (afterRenderFeatures: () => void) => {\n this.#afterRenderFeatures = afterRenderFeatures;\n };\n\n /**\n * Returns the array of features like autosize that will run after the rendering has completed.\n *\n * @returns afterRender features\n */\n getAfterRenderFeatures = (): (() => void) => {\n return this.#afterRenderFeatures;\n };\n\n setSubscribers = (subscribers: Subscribers) => {\n this.#subscribers = subscribers;\n };\n\n /**\n * Returns the list of subscribers for respective events.\n * @returns - {@link Subscribers}\n */\n getSubscribers = (): Subscribers => {\n return this.#subscribers;\n };\n\n setRsStateResolver = (rsStateResolver: StateResolver) => {\n this.#rsStateResolver = rsStateResolver;\n };\n\n /**\n * Returns the instance of StateResolver.\n * @returns rsStateResolver instance\n */\n getRsStateResolver = () => {\n return this.#rsStateResolver;\n };\n\n /**\n * Returns the browser environment context derived from the RS component's owner document.\n *\n * All features should use `browserContext.document` and `browserContext.window` from\n * {@link FeatureProps} instead of the global `document` and `window`. This ensures\n * features work correctly when the table is rendered inside an iFrame, where the\n * globals refer to the parent frame rather than the frame containing the component.\n *\n * @returns A {@link BrowserContext} containing the frame-aware `document` and `window`.\n */\n getBrowserContext = (): BrowserContext => {\n const ownerDocument = this.getView().getDomContainer()?.ownerDocument ?? document;\n return {\n document: ownerDocument,\n window: ownerDocument.defaultView ?? window\n };\n };\n}\n"]}
@@ -29,12 +29,6 @@ export default class RsProps {
29
29
  renderFormatterTypeMap?: RsCoreBootArgs['renderFormatterTypeMap'];
30
30
  /** A list of customised the toolbar actions to be displayed at the top of a repeating structure, apart from ootb toolbar actions. */
31
31
  toolBarOptions?: RsCoreBootArgs['toolBarOptions'];
32
- /**
33
- * This function is provided a click handler for a row via row generator.
34
- * @param {RowData} data - current row data
35
- * @returns {void} void
36
- */
37
- onRowClickAction?: RsCoreBootArgs['onRowClickAction'];
38
32
  /** It contains registered api's provided by consumer of RsCore */
39
33
  externalStore: ExternalStore;
40
34
  constructor(apiContext: ApiContext, externalStore: ExternalStore, options: {
@@ -44,7 +38,6 @@ export default class RsProps {
44
38
  formatters?: RsCoreBootArgs['formatters'];
45
39
  renderFormatterTypeMap?: RsCoreBootArgs['renderFormatterTypeMap'];
46
40
  toolBarOptions?: RsCoreBootArgs['toolBarOptions'];
47
- onRowClickAction?: RsCoreBootArgs['onRowClickAction'];
48
41
  styleFormats?: RsCoreBootArgs['styleFormats'];
49
42
  });
50
43
  }
@@ -1 +1 @@
1
- {"version":3,"file":"RsProps.d.ts","sourceRoot":"","sources":["../../../src/core/RsProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC/D,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cAAc,CAAC,eAAe,CAAC,CAAC;QAChD,aAAa,CAAC,EAAE,cAAc,CAAC,eAAe,CAAC,CAAC;QAChD,UAAU,CAAC,EAAE,cAAc,CAAC,YAAY,CAAC,CAAC;QAC1C,sBAAsB,CAAC,EAAE,cAAc,CAAC,wBAAwB,CAAC,CAAC;QAClE,cAAc,CAAC,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAC;QAClD,YAAY,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;KAC/C;CAYJ"}
@@ -23,12 +23,6 @@ export default class RsProps {
23
23
  renderFormatterTypeMap;
24
24
  /** A list of customised the toolbar actions to be displayed at the top of a repeating structure, apart from ootb toolbar actions. */
25
25
  toolBarOptions;
26
- /**
27
- * This function is provided a click handler for a row via row generator.
28
- * @param {RowData} data - current row data
29
- * @returns {void} void
30
- */
31
- onRowClickAction;
32
26
  /** It contains registered api's provided by consumer of RsCore */
33
27
  externalStore;
34
28
  constructor(apiContext, externalStore, options) {
@@ -40,7 +34,6 @@ export default class RsProps {
40
34
  this.formatters = options.formatters;
41
35
  this.renderFormatterTypeMap = options.renderFormatterTypeMap;
42
36
  this.toolBarOptions = options.toolBarOptions;
43
- this.onRowClickAction = options.onRowClickAction;
44
37
  this.styleFormats = options.styleFormats;
45
38
  }
46
39
  }
@@ -1 +1 @@
1
- {"version":3,"file":"RsProps.js","sourceRoot":"","sources":["../../../src/core/RsProps.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,OAAO,OAAO,OAAO;IAC1B;wDACoD;IACpD,IAAI,CAA0B;IAC9B;;OAEG;IACH,aAAa,CAAmC;IAChD,2KAA2K;IAC3K,UAAU,CAA+B;IACzC;;;;;OAKG;IACH,aAAa,CAAmC;IAEhD,oEAAoE;IACpE,UAAU,CAAgC;IAC1C,8EAA8E;IAC9E,YAAY,CAAkC;IAC9C,yGAAyG;IACzG,sBAAsB,CAA4C;IAClE,qIAAqI;IACrI,cAAc,CAAoC;IAClD;;;;OAIG;IACH,gBAAgB,CAAsC;IACtD,kEAAkE;IAClE,aAAa,CAAgB;IAE7B,YACE,UAAsB,EACtB,aAA4B,EAC5B,OASC;QAED,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;QAC3C,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;QAC3C,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACrC,IAAI,CAAC,sBAAsB,GAAG,OAAO,CAAC,sBAAsB,CAAC;QAC7D,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;QAC7C,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QACjD,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;IAC3C,CAAC;CACF","sourcesContent":["import type { ApiContext } from '../../types/ApiContext.types';\nimport type RsCoreBootArgs from '../../types/RsCoreBootArgs.types';\n\nexport type ExternalStore = {\n /** A state communication api to communicate latest state of repeating structure core to it's consumer. */\n dispatch: RsCoreBootArgs['dispatch'];\n};\n\nexport default class RsProps {\n /** Indicates the mode in which Rs core is running. E.g. A debug mode will print logs in console for the action dispatched by RsCore\n * and the state derived after consumption of it. */\n mode?: RsCoreBootArgs['mode'];\n /**\n * An initial state to load repeating structure instance with it.\n */\n persistedInfo?: RsCoreBootArgs['persistedInfo'];\n /** A set of api's provided to repeating structure core to establish communication b/w repeating structure and its consumer (e.g. providing data to repeating structure) */\n apiContext: RsCoreBootArgs['apiContext'];\n /** A factory function provided to RsCore that returns component or component definition for specified type\n * @param type It is equal to value of {@link FieldDef.cellRenderer cellRenderer}(if added in fieldDefs of that column).\n * @returns It should return a component definition (or an object that contains component definition).\n * This component definition will be used by RepeatingStructures to render a cell with the component provided by renderFactory.\n * If component definition is not provided from render factory or renderFactory is not provided to Repeating structures then cell will be rendered directly with value derived for the cell or the formatted value(if {@link RsProps.formatters formatters} are provided for that column)\n */\n renderFactory?: RsCoreBootArgs['renderFactory'];\n\n /** An object of formatter functions which formats the raw value. */\n formatters?: RsCoreBootArgs['formatters'];\n /** A collection of style formats that can be applied for styling the data. */\n styleFormats?: RsCoreBootArgs['styleFormats'];\n /** A map of formatters that will be displayed to consumer to format a fieldDef in repeating structure */\n renderFormatterTypeMap?: RsCoreBootArgs['renderFormatterTypeMap'];\n /** A list of customised the toolbar actions to be displayed at the top of a repeating structure, apart from ootb toolbar actions. */\n toolBarOptions?: RsCoreBootArgs['toolBarOptions'];\n /**\n * This function is provided a click handler for a row via row generator.\n * @param {RowData} data - current row data\n * @returns {void} void\n */\n onRowClickAction?: RsCoreBootArgs['onRowClickAction'];\n /** It contains registered api's provided by consumer of RsCore */\n externalStore: ExternalStore;\n\n constructor(\n apiContext: ApiContext,\n externalStore: ExternalStore,\n options: {\n mode?: RsCoreBootArgs['mode'];\n persistedInfo?: RsCoreBootArgs['persistedInfo'];\n renderFactory?: RsCoreBootArgs['renderFactory'];\n formatters?: RsCoreBootArgs['formatters'];\n renderFormatterTypeMap?: RsCoreBootArgs['renderFormatterTypeMap'];\n toolBarOptions?: RsCoreBootArgs['toolBarOptions'];\n onRowClickAction?: RsCoreBootArgs['onRowClickAction'];\n styleFormats?: RsCoreBootArgs['styleFormats'];\n }\n ) {\n this.apiContext = apiContext;\n this.externalStore = externalStore;\n this.mode = options.mode;\n this.persistedInfo = options.persistedInfo;\n this.renderFactory = options.renderFactory;\n this.formatters = options.formatters;\n this.renderFormatterTypeMap = options.renderFormatterTypeMap;\n this.toolBarOptions = options.toolBarOptions;\n this.onRowClickAction = options.onRowClickAction;\n this.styleFormats = options.styleFormats;\n }\n}\n"]}
1
+ {"version":3,"file":"RsProps.js","sourceRoot":"","sources":["../../../src/core/RsProps.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,OAAO,OAAO,OAAO;IAC1B;wDACoD;IACpD,IAAI,CAA0B;IAC9B;;OAEG;IACH,aAAa,CAAmC;IAChD,2KAA2K;IAC3K,UAAU,CAA+B;IACzC;;;;;OAKG;IACH,aAAa,CAAmC;IAEhD,oEAAoE;IACpE,UAAU,CAAgC;IAC1C,8EAA8E;IAC9E,YAAY,CAAkC;IAC9C,yGAAyG;IACzG,sBAAsB,CAA4C;IAClE,qIAAqI;IACrI,cAAc,CAAoC;IAClD,kEAAkE;IAClE,aAAa,CAAgB;IAE7B,YACE,UAAsB,EACtB,aAA4B,EAC5B,OAQC;QAED,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;QAC3C,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;QAC3C,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACrC,IAAI,CAAC,sBAAsB,GAAG,OAAO,CAAC,sBAAsB,CAAC;QAC7D,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;QAC7C,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;IAC3C,CAAC;CACF","sourcesContent":["import type { ApiContext } from '../../types/ApiContext.types';\nimport type RsCoreBootArgs from '../../types/RsCoreBootArgs.types';\n\nexport type ExternalStore = {\n /** A state communication api to communicate latest state of repeating structure core to it's consumer. */\n dispatch: RsCoreBootArgs['dispatch'];\n};\n\nexport default class RsProps {\n /** Indicates the mode in which Rs core is running. E.g. A debug mode will print logs in console for the action dispatched by RsCore\n * and the state derived after consumption of it. */\n mode?: RsCoreBootArgs['mode'];\n /**\n * An initial state to load repeating structure instance with it.\n */\n persistedInfo?: RsCoreBootArgs['persistedInfo'];\n /** A set of api's provided to repeating structure core to establish communication b/w repeating structure and its consumer (e.g. providing data to repeating structure) */\n apiContext: RsCoreBootArgs['apiContext'];\n /** A factory function provided to RsCore that returns component or component definition for specified type\n * @param type It is equal to value of {@link FieldDef.cellRenderer cellRenderer}(if added in fieldDefs of that column).\n * @returns It should return a component definition (or an object that contains component definition).\n * This component definition will be used by RepeatingStructures to render a cell with the component provided by renderFactory.\n * If component definition is not provided from render factory or renderFactory is not provided to Repeating structures then cell will be rendered directly with value derived for the cell or the formatted value(if {@link RsProps.formatters formatters} are provided for that column)\n */\n renderFactory?: RsCoreBootArgs['renderFactory'];\n\n /** An object of formatter functions which formats the raw value. */\n formatters?: RsCoreBootArgs['formatters'];\n /** A collection of style formats that can be applied for styling the data. */\n styleFormats?: RsCoreBootArgs['styleFormats'];\n /** A map of formatters that will be displayed to consumer to format a fieldDef in repeating structure */\n renderFormatterTypeMap?: RsCoreBootArgs['renderFormatterTypeMap'];\n /** A list of customised the toolbar actions to be displayed at the top of a repeating structure, apart from ootb toolbar actions. */\n toolBarOptions?: RsCoreBootArgs['toolBarOptions'];\n /** It contains registered api's provided by consumer of RsCore */\n externalStore: ExternalStore;\n\n constructor(\n apiContext: ApiContext,\n externalStore: ExternalStore,\n options: {\n mode?: RsCoreBootArgs['mode'];\n persistedInfo?: RsCoreBootArgs['persistedInfo'];\n renderFactory?: RsCoreBootArgs['renderFactory'];\n formatters?: RsCoreBootArgs['formatters'];\n renderFormatterTypeMap?: RsCoreBootArgs['renderFormatterTypeMap'];\n toolBarOptions?: RsCoreBootArgs['toolBarOptions'];\n styleFormats?: RsCoreBootArgs['styleFormats'];\n }\n ) {\n this.apiContext = apiContext;\n this.externalStore = externalStore;\n this.mode = options.mode;\n this.persistedInfo = options.persistedInfo;\n this.renderFactory = options.renderFactory;\n this.formatters = options.formatters;\n this.renderFormatterTypeMap = options.renderFormatterTypeMap;\n this.toolBarOptions = options.toolBarOptions;\n this.styleFormats = options.styleFormats;\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { PersonalizedState, State } from '../../types/State.types';
2
- import type { Meta } from '../../types/Meta.types';
2
+ import type { FieldDef, Meta } from '../../types/Meta.types';
3
3
  import type RsCoreBootArgs from '../../types/RsCoreBootArgs.types';
4
4
  import type { ColumnReorderProps, ColumnResizerProps } from './generators/ColumnGenerator.types';
5
5
  import type { GroupingInfo, HierarchicalGroupingInfo } from './features/uIFeatures/beforeRender/grouping';
@@ -65,14 +65,18 @@ export default class RsStore {
65
65
  * @returns The translated string, with tokens replaced if provided.
66
66
  */
67
67
  translate: (str: keyof typeof defaultTranslations, tokens?: string[]) => string;
68
+ fieldDefsMap: Map<string, FieldDef>;
68
69
  constructor(meta: Meta, presets: Meta[], isInitialRender?: boolean, isMounted?: boolean, translations?: RsCoreBootArgs['translations']);
69
70
  /** Sets the Html events required for resizing a column. */
70
71
  setFieldReorderProps(fieldReorderProps: RsStore['fieldReorderProps']): void;
71
72
  /** Returns the Html events required for reordering a column. */
72
73
  getFieldReorderProps(): ColumnReorderProps | null;
74
+ setMeta(newMeta: Meta): void;
73
75
  /** Sets the Html events required for resizing a column. */
74
76
  setColumnResizerProps(columnResizerProps: RsStore['columnResizerProps']): void;
75
77
  /** Returns the Html events required for resizing a column. */
76
78
  getColumnResizerProps(): ColumnResizerProps;
79
+ /** Retrieves the FieldDef object corresponding to the given fieldId from the fieldDefsMap. */
80
+ getFieldDefById(fieldId: string): FieldDef | undefined;
77
81
  }
78
82
  //# sourceMappingURL=RsStore.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RsStore.d.ts","sourceRoot":"","sources":["../../../src/core/RsStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAGnD,OAAO,KAAK,cAAc,MAAM,kCAAkC,CAAC;AAEnE,OAAO,KAAK,EAAE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BAAoB;IAKpB,OAAO,CAAC,OAAO,EAAE,IAAI,GAAG,IAAI;IAQ5B,2DAA2D;IAC3D,qBAAqB,CAAC,kBAAkB,EAAE,OAAO,CAAC,oBAAoB,CAAC;IAIvE,8DAA8D;IAC9D,qBAAqB;IAIrB,8FAA8F;IAC9F,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS;CAGvD"}
@@ -49,8 +49,11 @@ export default class RsStore {
49
49
  * @returns The translated string, with tokens replaced if provided.
50
50
  */
51
51
  translate;
52
+ // maintain a fieldDefsMap for quick access.
53
+ fieldDefsMap;
52
54
  constructor(meta, presets, isInitialRender = true, isMounted = false, translations) {
53
55
  this.meta = meta;
56
+ this.fieldDefsMap = new Map(meta.fieldDefs.map(fieldDef => [fieldDef.id, fieldDef]));
54
57
  this.presets = presets;
55
58
  this.isInitialRender = isInitialRender;
56
59
  this.isMounted = isMounted;
@@ -65,6 +68,11 @@ export default class RsStore {
65
68
  getFieldReorderProps() {
66
69
  return this.fieldReorderProps;
67
70
  }
71
+ // Updates store meta and synchronizes derived fieldDefsMap with the new metadata
72
+ setMeta(newMeta) {
73
+ this.meta = newMeta;
74
+ this.fieldDefsMap = new Map(this.meta.fieldDefs?.map(fieldDef => [fieldDef.id, fieldDef]) ?? []);
75
+ }
68
76
  /** Sets the Html events required for resizing a column. */
69
77
  setColumnResizerProps(columnResizerProps) {
70
78
  this.columnResizerProps = columnResizerProps;
@@ -73,5 +81,9 @@ export default class RsStore {
73
81
  getColumnResizerProps() {
74
82
  return this.columnResizerProps;
75
83
  }
84
+ /** Retrieves the FieldDef object corresponding to the given fieldId from the fieldDefsMap. */
85
+ getFieldDefById(fieldId) {
86
+ return this.fieldDefsMap.get(fieldId);
87
+ }
76
88
  }
77
89
  //# sourceMappingURL=RsStore.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RsStore.js","sourceRoot":"","sources":["../../../src/core/RsStore.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,M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CAAC,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,MAAO,CAAC,CAAC;IACvE,CAAC;IAED,2DAA2D;IAC3D,oBAAoB,CAAC,iBAA+C;QAClE,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IAC7C,CAAC;IAED,gEAAgE;IAChE,oBAAoB;QAClB,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAChC,CAAC;IAED,2DAA2D;IAC3D,qBAAqB,CAAC,kBAAiD;QACrE,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;IAC/C,CAAC;IAED,8DAA8D;IAC9D,qBAAqB;QACnB,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACjC,CAAC;CACF","sourcesContent":["import translatorFor from '@pega/cosmos-react-core/lib/i18n/translate';\n\nimport type { PersonalizedState, State } from '../../types/State.types';\nimport type { Meta } from '../../types/Meta.types';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { ApiOptions } from '../../types/ApiContext.types';\nimport type RsCoreBootArgs from '../../types/RsCoreBootArgs.types';\n\nimport type { ColumnReorderProps, ColumnResizerProps } from './generators/ColumnGenerator.types';\nimport type {\n GroupingInfo,\n HierarchicalGroupingInfo\n} from './features/uIFeatures/beforeRender/grouping';\nimport defaultTranslations from './defaultTranslations';\n\nexport default class RsStore {\n /** Indicates if it is initial render (or mount) of Repeating structures. It is usually set to true upon initialization of RsCore. */\n isInitialRender: boolean;\n /** Indicates if repeating structures component is mounted */\n isMounted: boolean;\n /** Repeating structures meta */\n meta: Meta;\n /** Other variants of Repeating structures meta. E.g. Table/Gallery/Timeline Preset */\n presets: Meta[];\n /** Current grouping information. */\n groupingInfo?: GroupingInfo[] | HierarchicalGroupingInfo[];\n\n /** Stores the Html events required for reordering a column. */\n private fieldReorderProps!: ColumnReorderProps | null;\n /** Stores the Html events required for resizing a column. */\n private columnResizerProps!: ColumnResizerProps;\n /** Holds the bounding rect of rows before animation is triggered. */\n oldBoundingBox?: Map<string, DOMRect> | null;\n /** Holds the bounding rect of columns before animation is triggered. */\n oldColumnBoundingBox?: Map<string, DOMRect> | null;\n /** Indicates to skip the column animation feature on next run. */\n skipColumnAnimationOnNextRun?: boolean;\n /** Timer for loading indicator for time consuming operations such as execution of {@link ApiContext} api's */\n busyIndicatorTimer?: ReturnType<typeof setTimeout> | null;\n /** Current group filters in the state. */\n groupFilters?: State['groupFilters'];\n /** Indicates if the column sizing is triggered after rows being available on DOM. */\n columnSizingTriggerdOnRowsAvailable?: boolean;\n /** Indicates whether the automatic resizing of columns has already been triggered. */\n autosizeTriggered?: boolean;\n /** Indicates if the personalizations for a given RS view is already fetched. */\n personalizationDone?: boolean;\n /** A reference to row drag drop information used during row drag drop operation. */\n rowDragDropRef!: {\n dropTarget: HTMLElement[];\n dragTarget?: HTMLElement;\n dropZones: [];\n dragLeaveSkipped?: boolean;\n dropTargetCoord?: DOMRect | null;\n forcedDragLeave?: boolean;\n isDragTargetTypeRow?: boolean;\n contextDropCb?: (ev: DragEvent) => void;\n contextDragOverCb?: (ev: DragEvent) => void;\n };\n\n /** Set this as true to notify apiContext api's for invalidating api cache. This is communicated via {@link ApiOptions.invalidateCache invalidateCache api option}. */\n refreshInProgress = false;\n /** The refresh token used to identify a unique refresh triggered. */\n refreshToken?: number;\n\n /** The personalized state of Repeating structure. */\n componentState?: (PersonalizedState & { activePersonalization?: string }) | null;\n\n /** Used to provide localized strings, typically overriding default translations. */\n translations?: RsCoreBootArgs['translations'];\n\n /**\n * Translates the given input string using the injected or default translations pack.\n *\n * @param str - The key of the string to be translated, which must be a key of the defaultTranslations.\n * @param tokens - Optional array of strings to be used for token replacement in the translated string.\n * @returns The translated string, with tokens replaced if provided.\n */\n translate: (str: keyof typeof defaultTranslations, tokens?: string[]) => string;\n\n constructor(\n meta: Meta,\n presets: Meta[],\n isInitialRender = true,\n isMounted = false,\n translations?: RsCoreBootArgs['translations']\n ) {\n this.meta = meta;\n this.presets = presets;\n this.isInitialRender = isInitialRender;\n this.isMounted = isMounted;\n this.translations = { ...defaultTranslations, ...translations };\n this.translate = translatorFor(this.translations, this.meta.locale!);\n }\n\n /** Sets the Html events required for resizing a column. */\n setFieldReorderProps(fieldReorderProps: RsStore['fieldReorderProps']) {\n this.fieldReorderProps = fieldReorderProps;\n }\n\n /** Returns the Html events required for reordering a column. */\n getFieldReorderProps() {\n return this.fieldReorderProps;\n }\n\n /** Sets the Html events required for resizing a column. */\n setColumnResizerProps(columnResizerProps: RsStore['columnResizerProps']) {\n this.columnResizerProps = columnResizerProps;\n }\n\n /** Returns the Html events required for resizing a column. */\n getColumnResizerProps() {\n return this.columnResizerProps;\n }\n}\n"]}
1
+ {"version":3,"file":"RsStore.js","sourceRoot":"","sources":["../../../src/core/RsStore.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,4CAA4C,CAAC;AAavE,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AAExD,MAAM,CAAC,OAAO,OAAO,OAAO;IAC1B,qIAAqI;IACrI,eAAe,CAAU;IACzB,6DAA6D;IAC7D,SAAS,CAAU;IACnB,gCAAgC;IAChC,IAAI,CAAO;IACX,sFAAsF;IACtF,OAAO,CAAS;IAChB,oCAAoC;IACpC,YAAY,CAA+C;IAE3D,+DAA+D;IACvD,iBAAiB,CAA6B;IACtD,6DAA6D;IACrD,kBAAkB,CAAsB;IAChD,qEAAqE;IACrE,cAAc,CAA+B;IAC7C,wEAAwE;IACxE,oBAAoB,CAA+B;IACnD,kEAAkE;IAClE,4BAA4B,CAAW;IACvC,8GAA8G;IAC9G,kBAAkB,CAAwC;IAC1D,0CAA0C;IAC1C,YAAY,CAAyB;IACrC,qFAAqF;IACrF,mCAAmC,CAAW;IAC9C,sFAAsF;IACtF,iBAAiB,CAAW;IAC5B,gFAAgF;IAChF,mBAAmB,CAAW;IAC9B,oFAAoF;IACpF,cAAc,CAUZ;IAEF,sKAAsK;IACtK,iBAAiB,GAAG,KAAK,CAAC;IAC1B,qEAAqE;IACrE,YAAY,CAAU;IA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IACJ,CAAC;IAED,2DAA2D;IAC3D,qBAAqB,CAAC,kBAAiD;QACrE,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;IAC/C,CAAC;IAED,8DAA8D;IAC9D,qBAAqB;QACnB,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACjC,CAAC;IAED,8FAA8F;IAC9F,eAAe,CAAC,OAAe;QAC7B,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC;CACF","sourcesContent":["import translatorFor from '@pega/cosmos-react-core/lib/i18n/translate';\n\nimport type { PersonalizedState, State } from '../../types/State.types';\nimport type { FieldDef, Meta } from '../../types/Meta.types';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { ApiOptions } from '../../types/ApiContext.types';\nimport type RsCoreBootArgs from '../../types/RsCoreBootArgs.types';\n\nimport type { ColumnReorderProps, ColumnResizerProps } from './generators/ColumnGenerator.types';\nimport type {\n GroupingInfo,\n HierarchicalGroupingInfo\n} from './features/uIFeatures/beforeRender/grouping';\nimport defaultTranslations from './defaultTranslations';\n\nexport default class RsStore {\n /** Indicates if it is initial render (or mount) of Repeating structures. It is usually set to true upon initialization of RsCore. */\n isInitialRender: boolean;\n /** Indicates if repeating structures component is mounted */\n isMounted: boolean;\n /** Repeating structures meta */\n meta: Meta;\n /** Other variants of Repeating structures meta. E.g. Table/Gallery/Timeline Preset */\n presets: Meta[];\n /** Current grouping information. */\n groupingInfo?: GroupingInfo[] | HierarchicalGroupingInfo[];\n\n /** Stores the Html events required for reordering a column. */\n private fieldReorderProps!: ColumnReorderProps | null;\n /** Stores the Html events required for resizing a column. */\n private columnResizerProps!: ColumnResizerProps;\n /** Holds the bounding rect of rows before animation is triggered. */\n oldBoundingBox?: Map<string, DOMRect> | null;\n /** Holds the bounding rect of columns before animation is triggered. */\n oldColumnBoundingBox?: Map<string, DOMRect> | null;\n /** Indicates to skip the column animation feature on next run. */\n skipColumnAnimationOnNextRun?: boolean;\n /** Timer for loading indicator for time consuming operations such as execution of {@link ApiContext} api's */\n busyIndicatorTimer?: ReturnType<typeof setTimeout> | null;\n /** Current group filters in the state. */\n groupFilters?: State['groupFilters'];\n /** Indicates if the column sizing is triggered after rows being available on DOM. */\n columnSizingTriggerdOnRowsAvailable?: boolean;\n /** Indicates whether the automatic resizing of columns has already been triggered. */\n autosizeTriggered?: boolean;\n /** Indicates if the personalizations for a given RS view is already fetched. */\n personalizationDone?: boolean;\n /** A reference to row drag drop information used during row drag drop operation. */\n rowDragDropRef!: {\n dropTarget: HTMLElement[];\n dragTarget?: HTMLElement;\n dropZones: [];\n dragLeaveSkipped?: boolean;\n dropTargetCoord?: DOMRect | null;\n forcedDragLeave?: boolean;\n isDragTargetTypeRow?: boolean;\n contextDropCb?: (ev: DragEvent) => void;\n contextDragOverCb?: (ev: DragEvent) => void;\n };\n\n /** Set this as true to notify apiContext api's for invalidating api cache. This is communicated via {@link ApiOptions.invalidateCache invalidateCache api option}. */\n refreshInProgress = false;\n /** The refresh token used to identify a unique refresh triggered. */\n refreshToken?: number;\n\n /** The personalized state of Repeating structure. */\n componentState?: (PersonalizedState & { activePersonalization?: string }) | null;\n\n /** Used to provide localized strings, typically overriding default translations. */\n translations?: RsCoreBootArgs['translations'];\n\n /**\n * Translates the given input string using the injected or default translations pack.\n *\n * @param str - The key of the string to be translated, which must be a key of the defaultTranslations.\n * @param tokens - Optional array of strings to be used for token replacement in the translated string.\n * @returns The translated string, with tokens replaced if provided.\n */\n translate: (str: keyof typeof defaultTranslations, tokens?: string[]) => string;\n\n // maintain a fieldDefsMap for quick access.\n fieldDefsMap: Map<string, FieldDef>;\n\n constructor(\n meta: Meta,\n presets: Meta[],\n isInitialRender = true,\n isMounted = false,\n translations?: RsCoreBootArgs['translations']\n ) {\n this.meta = meta;\n this.fieldDefsMap = new Map(meta.fieldDefs.map(fieldDef => [fieldDef.id, fieldDef]));\n this.presets = presets;\n this.isInitialRender = isInitialRender;\n this.isMounted = isMounted;\n this.translations = { ...defaultTranslations, ...translations };\n this.translate = translatorFor(this.translations, this.meta.locale!);\n }\n\n /** Sets the Html events required for resizing a column. */\n setFieldReorderProps(fieldReorderProps: RsStore['fieldReorderProps']) {\n this.fieldReorderProps = fieldReorderProps;\n }\n\n /** Returns the Html events required for reordering a column. */\n getFieldReorderProps() {\n return this.fieldReorderProps;\n }\n\n // Updates store meta and synchronizes derived fieldDefsMap with the new metadata\n setMeta(newMeta: Meta): void {\n this.meta = newMeta;\n\n this.fieldDefsMap = new Map(\n this.meta.fieldDefs?.map(fieldDef => [fieldDef.id, fieldDef]) ?? []\n );\n }\n\n /** Sets the Html events required for resizing a column. */\n setColumnResizerProps(columnResizerProps: RsStore['columnResizerProps']) {\n this.columnResizerProps = columnResizerProps;\n }\n\n /** Returns the Html events required for resizing a column. */\n getColumnResizerProps() {\n return this.columnResizerProps;\n }\n\n /** Retrieves the FieldDef object corresponding to the given fieldId from the fieldDefsMap. */\n getFieldDefById(fieldId: string): FieldDef | undefined {\n return this.fieldDefsMap.get(fieldId);\n }\n}\n"]}
@@ -36,7 +36,6 @@ export default class StateResolver {
36
36
  * Sets a function to execute a set of {@link Feature features} before triggering a render.
37
37
  * The provided function will be called with the {@link MiddleWareFeatureProps featureProps}
38
38
  * @param middlewares - A function that executes a set of {@link Feature features} before rendering.
39
- * @returns
40
39
  */
41
40
  setMiddlewares: (middlewares: (featureProps: MiddleWareFeatureProps) => Promise<void | null>) => void;
42
41
  }
@@ -1 +1 @@
1
- {"version":3,"file":"StateResolver.d.ts","sourceRoot":"","sources":["../../../src/core/StateResolver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,KAAK,EAAc,UAAU,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAgB9F,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,EAAE,sBAAsB,EAAuB,MAAM,2BAA2B,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B,UAAU,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAGpF,MAAM,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,KAAK,KAAK,CAAC;AAC9F,MAAM,MAAM,gBAAgB,GAAG,CAC7B,KAAK,EAAE,KAAK,EACZ,gBAAgB,EAAE,UAAU,KACzB,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAChC,kCAAkC;AAClC,MAAM,CAAC,OAAO,OAAO,aAAa;;IAwChC,6CAA6C;IAC7C,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;;;;OAKG;gBAED,QAAQ,EAAE,eAAe,EACzB,gBAAgB,EAAE,gBAAgB,EAClC,UAAU,EAAE,UAAU;IAiCxB;;;;;OAKG;IACH,QAAQ,GAAI,QAAQ,UAAU,KAAG,IAAI,CA+CnC;IAEF;;OAEG;IACH,QAAQ,cAEN;IAEF;;OAEG;IACH,gBAAgB,cAEd;IAEF;;;;OAIG;IACH,cAAc,GACZ,aAAa,CAAC,YAAY,EAAE,sBAAsB,KAAK,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,UAI3E;CAoIH;AAED,0EAA0E;AAC1E,wBAAgB,0BAA0B,CAAC,cAAc,EAAE,UAAU,IAcrD,OAAO,KAAK,EAAE,kBAAkB,UAAU,gCAwBzD"}
@@ -53,13 +53,10 @@ export default class StateResolver {
53
53
  * Executes {@link ApiContext.stateUpdateCallback stateUpdateCallback} and {@link ApiContext.setComponentState setComponentState} api with latest state.
54
54
  */
55
55
  #executePostStateUpdateCallbacks = () => {
56
- const visibleColumnsArr = this.#rsInternal.getView().getVisibleColumns();
57
- const visibleColumns = visibleColumnsArr.map(col => col.field.id);
58
56
  const { apiContext } = this.#rsInternal.getRsProps();
59
57
  if (apiContext?.stateUpdateCallback) {
60
58
  apiContext.stateUpdateCallback({
61
- ...pickProperties(this.getState(), personalizationProps),
62
- visibleColumns
59
+ ...pickProperties(this.getState(), personalizationProps)
63
60
  });
64
61
  }
65
62
  if (apiContext?.setComponentState && this.getState().personalization?.active) {
@@ -131,20 +128,35 @@ export default class StateResolver {
131
128
  * Sets a function to execute a set of {@link Feature features} before triggering a render.
132
129
  * The provided function will be called with the {@link MiddleWareFeatureProps featureProps}
133
130
  * @param middlewares - A function that executes a set of {@link Feature features} before rendering.
134
- * @returns
135
131
  */
136
132
  setMiddlewares = (middlewares) => {
137
133
  if (this.#middlewares)
138
134
  return;
139
135
  this.#middlewares = middlewares;
140
136
  };
137
+ /**
138
+ * Returns true if the lone queued FORCE_UPDATE action should be skipped (no-op optimization).
139
+ */
140
+ #skipForceUpdateAction = () => {
141
+ if (this.#queuedActions.length !== 1)
142
+ return false;
143
+ const action = this.#queuedActions[0];
144
+ if (action?.type !== ActionTypes.FORCE_UPDATE)
145
+ return false;
146
+ if (!('payload' in action))
147
+ return false;
148
+ return !Object.keys(action.payload.forceUpdateFeatures ?? {}).length;
149
+ };
141
150
  /** This will reduce the RsCore {@link State state} for a {@link StateResolver.dispatch dispatched} action .
142
151
  * Additionally it will also run middlewares, fetches latest data using {@link FetchDataHandler} and executes post state update callback with latest reduced state.
143
152
  */
144
153
  #runQueuedActions = async () => {
145
154
  const queuedAction = this.#queuedActions[0];
146
155
  if (queuedAction) {
147
- if (isStaleAction(queuedAction, this.#latestActions)) {
156
+ const skipStaleActionExecution = 'takeLatestAction' in queuedAction &&
157
+ queuedAction.takeLatestAction &&
158
+ isStaleAction(queuedAction, this.#latestActions);
159
+ if (skipStaleActionExecution) {
148
160
  this.#queuedActions.shift();
149
161
  await this.#runQueuedActions();
150
162
  return;
@@ -184,9 +196,7 @@ export default class StateResolver {
184
196
  // forceUpdateFeatures slice is generally used by features when they are not able to perform their task if the rendering cycle is not complete.
185
197
  // For eg.renderHeader and autosize feature set forceRenderOnNextRun and forceCalculateAutoWidth in this slice so that they will get executed after the existing rendering cycle is complete and the rows are rendered on DOM.
186
198
  // If we skip these types of FORCE_UPDATE action then the corresponding features execution will also be skipped.
187
- if (this.#queuedActions.length === 1 &&
188
- this.#queuedActions[0]?.type === ActionTypes.FORCE_UPDATE &&
189
- !Object.keys(this.#queuedActions[0].payload.forceUpdateFeatures).length) {
199
+ if (this.#skipForceUpdateAction()) {
190
200
  this.#queuedActions.shift();
191
201
  }
192
202
  if (this.#queuedActions.length) {