@pega/lists-core 8.0.0-build.27.14

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 (468) hide show
  1. package/LICENSE +185 -0
  2. package/README.md +80 -0
  3. package/SECURITY.md +11 -0
  4. package/lib/index.d.ts +13 -0
  5. package/lib/index.d.ts.map +1 -0
  6. package/lib/index.js +14 -0
  7. package/lib/index.js.map +1 -0
  8. package/lib/src/core/RsCore.d.ts +37 -0
  9. package/lib/src/core/RsCore.d.ts.map +1 -0
  10. package/lib/src/core/RsCore.js +48 -0
  11. package/lib/src/core/RsCore.js.map +1 -0
  12. package/lib/src/core/RsInternal.d.ts +85 -0
  13. package/lib/src/core/RsInternal.d.ts.map +1 -0
  14. package/lib/src/core/RsInternal.js +104 -0
  15. package/lib/src/core/RsInternal.js.map +1 -0
  16. package/lib/src/core/RsProps.d.ts +52 -0
  17. package/lib/src/core/RsProps.d.ts.map +1 -0
  18. package/lib/src/core/RsProps.js +47 -0
  19. package/lib/src/core/RsProps.js.map +1 -0
  20. package/lib/src/core/RsStore.d.ts +62 -0
  21. package/lib/src/core/RsStore.d.ts.map +1 -0
  22. package/lib/src/core/RsStore.js +59 -0
  23. package/lib/src/core/RsStore.js.map +1 -0
  24. package/lib/src/core/StateResolver.d.ts +45 -0
  25. package/lib/src/core/StateResolver.d.ts.map +1 -0
  26. package/lib/src/core/StateResolver.js +276 -0
  27. package/lib/src/core/StateResolver.js.map +1 -0
  28. package/lib/src/core/a11y/BaseA11y.d.ts +161 -0
  29. package/lib/src/core/a11y/BaseA11y.d.ts.map +1 -0
  30. package/lib/src/core/a11y/BaseA11y.js +549 -0
  31. package/lib/src/core/a11y/BaseA11y.js.map +1 -0
  32. package/lib/src/core/actions/actionConstants.d.ts +77 -0
  33. package/lib/src/core/actions/actionConstants.d.ts.map +1 -0
  34. package/lib/src/core/actions/actionConstants.js +79 -0
  35. package/lib/src/core/actions/actionConstants.js.map +1 -0
  36. package/lib/src/core/actions/actions.d.ts +400 -0
  37. package/lib/src/core/actions/actions.d.ts.map +1 -0
  38. package/lib/src/core/actions/actions.js +537 -0
  39. package/lib/src/core/actions/actions.js.map +1 -0
  40. package/lib/src/core/actions/actions.types.d.ts +504 -0
  41. package/lib/src/core/actions/actions.types.d.ts.map +1 -0
  42. package/lib/src/core/actions/actions.types.js +5 -0
  43. package/lib/src/core/actions/actions.types.js.map +1 -0
  44. package/lib/src/core/config/config.d.ts +9 -0
  45. package/lib/src/core/config/config.d.ts.map +1 -0
  46. package/lib/src/core/config/config.js +93 -0
  47. package/lib/src/core/config/config.js.map +1 -0
  48. package/lib/src/core/config/filterConfig.d.ts +123 -0
  49. package/lib/src/core/config/filterConfig.d.ts.map +1 -0
  50. package/lib/src/core/config/filterConfig.js +238 -0
  51. package/lib/src/core/config/filterConfig.js.map +1 -0
  52. package/lib/src/core/constants.d.ts +146 -0
  53. package/lib/src/core/constants.d.ts.map +1 -0
  54. package/lib/src/core/constants.js +124 -0
  55. package/lib/src/core/constants.js.map +1 -0
  56. package/lib/src/core/features/featureFactory.d.ts +52 -0
  57. package/lib/src/core/features/featureFactory.d.ts.map +1 -0
  58. package/lib/src/core/features/featureFactory.js +118 -0
  59. package/lib/src/core/features/featureFactory.js.map +1 -0
  60. package/lib/src/core/features/uIFeatures/afterRender/animation.d.ts +24 -0
  61. package/lib/src/core/features/uIFeatures/afterRender/animation.d.ts.map +1 -0
  62. package/lib/src/core/features/uIFeatures/afterRender/animation.js +157 -0
  63. package/lib/src/core/features/uIFeatures/afterRender/animation.js.map +1 -0
  64. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/autoSize.d.ts +29 -0
  65. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/autoSize.d.ts.map +1 -0
  66. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/autoSize.js +114 -0
  67. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/autoSize.js.map +1 -0
  68. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/index.d.ts +38 -0
  69. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/index.d.ts.map +1 -0
  70. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/index.js +157 -0
  71. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/index.js.map +1 -0
  72. package/lib/src/core/features/uIFeatures/afterRender/customizeParentContainer/index.d.ts +16 -0
  73. package/lib/src/core/features/uIFeatures/afterRender/customizeParentContainer/index.d.ts.map +1 -0
  74. package/lib/src/core/features/uIFeatures/afterRender/customizeParentContainer/index.js +32 -0
  75. package/lib/src/core/features/uIFeatures/afterRender/customizeParentContainer/index.js.map +1 -0
  76. package/lib/src/core/features/uIFeatures/beforeRender/adjustHeight.d.ts +25 -0
  77. package/lib/src/core/features/uIFeatures/beforeRender/adjustHeight.d.ts.map +1 -0
  78. package/lib/src/core/features/uIFeatures/beforeRender/adjustHeight.js +139 -0
  79. package/lib/src/core/features/uIFeatures/beforeRender/adjustHeight.js.map +1 -0
  80. package/lib/src/core/features/uIFeatures/beforeRender/adjustHeightToFitRecords.d.ts +18 -0
  81. package/lib/src/core/features/uIFeatures/beforeRender/adjustHeightToFitRecords.d.ts.map +1 -0
  82. package/lib/src/core/features/uIFeatures/beforeRender/adjustHeightToFitRecords.js +46 -0
  83. package/lib/src/core/features/uIFeatures/beforeRender/adjustHeightToFitRecords.js.map +1 -0
  84. package/lib/src/core/features/uIFeatures/beforeRender/adjustMaxHeight.d.ts +13 -0
  85. package/lib/src/core/features/uIFeatures/beforeRender/adjustMaxHeight.d.ts.map +1 -0
  86. package/lib/src/core/features/uIFeatures/beforeRender/adjustMaxHeight.js +38 -0
  87. package/lib/src/core/features/uIFeatures/beforeRender/adjustMaxHeight.js.map +1 -0
  88. package/lib/src/core/features/uIFeatures/beforeRender/aggregation.d.ts +11 -0
  89. package/lib/src/core/features/uIFeatures/beforeRender/aggregation.d.ts.map +1 -0
  90. package/lib/src/core/features/uIFeatures/beforeRender/aggregation.js +48 -0
  91. package/lib/src/core/features/uIFeatures/beforeRender/aggregation.js.map +1 -0
  92. package/lib/src/core/features/uIFeatures/beforeRender/animation.d.ts +25 -0
  93. package/lib/src/core/features/uIFeatures/beforeRender/animation.d.ts.map +1 -0
  94. package/lib/src/core/features/uIFeatures/beforeRender/animation.js +106 -0
  95. package/lib/src/core/features/uIFeatures/beforeRender/animation.js.map +1 -0
  96. package/lib/src/core/features/uIFeatures/beforeRender/busyIndicator.d.ts +18 -0
  97. package/lib/src/core/features/uIFeatures/beforeRender/busyIndicator.d.ts.map +1 -0
  98. package/lib/src/core/features/uIFeatures/beforeRender/busyIndicator.js +56 -0
  99. package/lib/src/core/features/uIFeatures/beforeRender/busyIndicator.js.map +1 -0
  100. package/lib/src/core/features/uIFeatures/beforeRender/changePersonalisation.d.ts +7 -0
  101. package/lib/src/core/features/uIFeatures/beforeRender/changePersonalisation.d.ts.map +1 -0
  102. package/lib/src/core/features/uIFeatures/beforeRender/changePersonalisation.js +34 -0
  103. package/lib/src/core/features/uIFeatures/beforeRender/changePersonalisation.js.map +1 -0
  104. package/lib/src/core/features/uIFeatures/beforeRender/columnAlias.d.ts +10 -0
  105. package/lib/src/core/features/uIFeatures/beforeRender/columnAlias.d.ts.map +1 -0
  106. package/lib/src/core/features/uIFeatures/beforeRender/columnAlias.js +72 -0
  107. package/lib/src/core/features/uIFeatures/beforeRender/columnAlias.js.map +1 -0
  108. package/lib/src/core/features/uIFeatures/beforeRender/columnDisplayMode.d.ts +9 -0
  109. package/lib/src/core/features/uIFeatures/beforeRender/columnDisplayMode.d.ts.map +1 -0
  110. package/lib/src/core/features/uIFeatures/beforeRender/columnDisplayMode.js +26 -0
  111. package/lib/src/core/features/uIFeatures/beforeRender/columnDisplayMode.js.map +1 -0
  112. package/lib/src/core/features/uIFeatures/beforeRender/columnFormatter.d.ts +9 -0
  113. package/lib/src/core/features/uIFeatures/beforeRender/columnFormatter.d.ts.map +1 -0
  114. package/lib/src/core/features/uIFeatures/beforeRender/columnFormatter.js +29 -0
  115. package/lib/src/core/features/uIFeatures/beforeRender/columnFormatter.js.map +1 -0
  116. package/lib/src/core/features/uIFeatures/beforeRender/columnOrder.d.ts +11 -0
  117. package/lib/src/core/features/uIFeatures/beforeRender/columnOrder.d.ts.map +1 -0
  118. package/lib/src/core/features/uIFeatures/beforeRender/columnOrder.js +38 -0
  119. package/lib/src/core/features/uIFeatures/beforeRender/columnOrder.js.map +1 -0
  120. package/lib/src/core/features/uIFeatures/beforeRender/columnReOrder.d.ts +11 -0
  121. package/lib/src/core/features/uIFeatures/beforeRender/columnReOrder.d.ts.map +1 -0
  122. package/lib/src/core/features/uIFeatures/beforeRender/columnReOrder.js +199 -0
  123. package/lib/src/core/features/uIFeatures/beforeRender/columnReOrder.js.map +1 -0
  124. package/lib/src/core/features/uIFeatures/beforeRender/columnSizing/index.d.ts +5 -0
  125. package/lib/src/core/features/uIFeatures/beforeRender/columnSizing/index.d.ts.map +1 -0
  126. package/lib/src/core/features/uIFeatures/beforeRender/columnSizing/index.js +29 -0
  127. package/lib/src/core/features/uIFeatures/beforeRender/columnSizing/index.js.map +1 -0
  128. package/lib/src/core/features/uIFeatures/beforeRender/columnSizing/resize.d.ts +14 -0
  129. package/lib/src/core/features/uIFeatures/beforeRender/columnSizing/resize.d.ts.map +1 -0
  130. package/lib/src/core/features/uIFeatures/beforeRender/columnSizing/resize.js +118 -0
  131. package/lib/src/core/features/uIFeatures/beforeRender/columnSizing/resize.js.map +1 -0
  132. package/lib/src/core/features/uIFeatures/beforeRender/columnSort.d.ts +8 -0
  133. package/lib/src/core/features/uIFeatures/beforeRender/columnSort.d.ts.map +1 -0
  134. package/lib/src/core/features/uIFeatures/beforeRender/columnSort.js +25 -0
  135. package/lib/src/core/features/uIFeatures/beforeRender/columnSort.js.map +1 -0
  136. package/lib/src/core/features/uIFeatures/beforeRender/columnToggle.d.ts +9 -0
  137. package/lib/src/core/features/uIFeatures/beforeRender/columnToggle.d.ts.map +1 -0
  138. package/lib/src/core/features/uIFeatures/beforeRender/columnToggle.js +26 -0
  139. package/lib/src/core/features/uIFeatures/beforeRender/columnToggle.js.map +1 -0
  140. package/lib/src/core/features/uIFeatures/beforeRender/columnVisualOrder.d.ts +12 -0
  141. package/lib/src/core/features/uIFeatures/beforeRender/columnVisualOrder.d.ts.map +1 -0
  142. package/lib/src/core/features/uIFeatures/beforeRender/columnVisualOrder.js +57 -0
  143. package/lib/src/core/features/uIFeatures/beforeRender/columnVisualOrder.js.map +1 -0
  144. package/lib/src/core/features/uIFeatures/beforeRender/conditionalStyleFormat.d.ts +9 -0
  145. package/lib/src/core/features/uIFeatures/beforeRender/conditionalStyleFormat.d.ts.map +1 -0
  146. package/lib/src/core/features/uIFeatures/beforeRender/conditionalStyleFormat.js +36 -0
  147. package/lib/src/core/features/uIFeatures/beforeRender/conditionalStyleFormat.js.map +1 -0
  148. package/lib/src/core/features/uIFeatures/beforeRender/customColumn.d.ts +9 -0
  149. package/lib/src/core/features/uIFeatures/beforeRender/customColumn.d.ts.map +1 -0
  150. package/lib/src/core/features/uIFeatures/beforeRender/customColumn.js +70 -0
  151. package/lib/src/core/features/uIFeatures/beforeRender/customColumn.js.map +1 -0
  152. package/lib/src/core/features/uIFeatures/beforeRender/edit.d.ts +12 -0
  153. package/lib/src/core/features/uIFeatures/beforeRender/edit.d.ts.map +1 -0
  154. package/lib/src/core/features/uIFeatures/beforeRender/edit.js +94 -0
  155. package/lib/src/core/features/uIFeatures/beforeRender/edit.js.map +1 -0
  156. package/lib/src/core/features/uIFeatures/beforeRender/errorColumn.d.ts +9 -0
  157. package/lib/src/core/features/uIFeatures/beforeRender/errorColumn.d.ts.map +1 -0
  158. package/lib/src/core/features/uIFeatures/beforeRender/errorColumn.js +26 -0
  159. package/lib/src/core/features/uIFeatures/beforeRender/errorColumn.js.map +1 -0
  160. package/lib/src/core/features/uIFeatures/beforeRender/filter.d.ts +10 -0
  161. package/lib/src/core/features/uIFeatures/beforeRender/filter.d.ts.map +1 -0
  162. package/lib/src/core/features/uIFeatures/beforeRender/filter.js +36 -0
  163. package/lib/src/core/features/uIFeatures/beforeRender/filter.js.map +1 -0
  164. package/lib/src/core/features/uIFeatures/beforeRender/freeze.d.ts +15 -0
  165. package/lib/src/core/features/uIFeatures/beforeRender/freeze.d.ts.map +1 -0
  166. package/lib/src/core/features/uIFeatures/beforeRender/freeze.js +119 -0
  167. package/lib/src/core/features/uIFeatures/beforeRender/freeze.js.map +1 -0
  168. package/lib/src/core/features/uIFeatures/beforeRender/grouping.d.ts +38 -0
  169. package/lib/src/core/features/uIFeatures/beforeRender/grouping.d.ts.map +1 -0
  170. package/lib/src/core/features/uIFeatures/beforeRender/grouping.js +451 -0
  171. package/lib/src/core/features/uIFeatures/beforeRender/grouping.js.map +1 -0
  172. package/lib/src/core/features/uIFeatures/beforeRender/groupsorting.d.ts +7 -0
  173. package/lib/src/core/features/uIFeatures/beforeRender/groupsorting.d.ts.map +1 -0
  174. package/lib/src/core/features/uIFeatures/beforeRender/groupsorting.js +36 -0
  175. package/lib/src/core/features/uIFeatures/beforeRender/groupsorting.js.map +1 -0
  176. package/lib/src/core/features/uIFeatures/beforeRender/moveListRecords.d.ts +7 -0
  177. package/lib/src/core/features/uIFeatures/beforeRender/moveListRecords.d.ts.map +1 -0
  178. package/lib/src/core/features/uIFeatures/beforeRender/moveListRecords.js +76 -0
  179. package/lib/src/core/features/uIFeatures/beforeRender/moveListRecords.js.map +1 -0
  180. package/lib/src/core/features/uIFeatures/beforeRender/personalization.d.ts +16 -0
  181. package/lib/src/core/features/uIFeatures/beforeRender/personalization.d.ts.map +1 -0
  182. package/lib/src/core/features/uIFeatures/beforeRender/personalization.js +306 -0
  183. package/lib/src/core/features/uIFeatures/beforeRender/personalization.js.map +1 -0
  184. package/lib/src/core/features/uIFeatures/beforeRender/prepareColumns.d.ts +7 -0
  185. package/lib/src/core/features/uIFeatures/beforeRender/prepareColumns.d.ts.map +1 -0
  186. package/lib/src/core/features/uIFeatures/beforeRender/prepareColumns.js +59 -0
  187. package/lib/src/core/features/uIFeatures/beforeRender/prepareColumns.js.map +1 -0
  188. package/lib/src/core/features/uIFeatures/beforeRender/prepareRows.d.ts +7 -0
  189. package/lib/src/core/features/uIFeatures/beforeRender/prepareRows.d.ts.map +1 -0
  190. package/lib/src/core/features/uIFeatures/beforeRender/prepareRows.js +30 -0
  191. package/lib/src/core/features/uIFeatures/beforeRender/prepareRows.js.map +1 -0
  192. package/lib/src/core/features/uIFeatures/beforeRender/refresh.d.ts +15 -0
  193. package/lib/src/core/features/uIFeatures/beforeRender/refresh.d.ts.map +1 -0
  194. package/lib/src/core/features/uIFeatures/beforeRender/refresh.js +40 -0
  195. package/lib/src/core/features/uIFeatures/beforeRender/refresh.js.map +1 -0
  196. package/lib/src/core/features/uIFeatures/beforeRender/renderHeader.d.ts +7 -0
  197. package/lib/src/core/features/uIFeatures/beforeRender/renderHeader.d.ts.map +1 -0
  198. package/lib/src/core/features/uIFeatures/beforeRender/renderHeader.js +21 -0
  199. package/lib/src/core/features/uIFeatures/beforeRender/renderHeader.js.map +1 -0
  200. package/lib/src/core/features/uIFeatures/beforeRender/resetFetch.d.ts +7 -0
  201. package/lib/src/core/features/uIFeatures/beforeRender/resetFetch.d.ts.map +1 -0
  202. package/lib/src/core/features/uIFeatures/beforeRender/resetFetch.js +55 -0
  203. package/lib/src/core/features/uIFeatures/beforeRender/resetFetch.js.map +1 -0
  204. package/lib/src/core/features/uIFeatures/beforeRender/resizeGroupedDragDropColumn.d.ts +7 -0
  205. package/lib/src/core/features/uIFeatures/beforeRender/resizeGroupedDragDropColumn.d.ts.map +1 -0
  206. package/lib/src/core/features/uIFeatures/beforeRender/resizeGroupedDragDropColumn.js +24 -0
  207. package/lib/src/core/features/uIFeatures/beforeRender/resizeGroupedDragDropColumn.js.map +1 -0
  208. package/lib/src/core/features/uIFeatures/beforeRender/rowDragDrop.d.ts +9 -0
  209. package/lib/src/core/features/uIFeatures/beforeRender/rowDragDrop.d.ts.map +1 -0
  210. package/lib/src/core/features/uIFeatures/beforeRender/rowDragDrop.js +232 -0
  211. package/lib/src/core/features/uIFeatures/beforeRender/rowDragDrop.js.map +1 -0
  212. package/lib/src/core/features/uIFeatures/beforeRender/rowHeight.d.ts +7 -0
  213. package/lib/src/core/features/uIFeatures/beforeRender/rowHeight.d.ts.map +1 -0
  214. package/lib/src/core/features/uIFeatures/beforeRender/rowHeight.js +18 -0
  215. package/lib/src/core/features/uIFeatures/beforeRender/rowHeight.js.map +1 -0
  216. package/lib/src/core/features/uIFeatures/beforeRender/rowSelect.d.ts +23 -0
  217. package/lib/src/core/features/uIFeatures/beforeRender/rowSelect.d.ts.map +1 -0
  218. package/lib/src/core/features/uIFeatures/beforeRender/rowSelect.js +135 -0
  219. package/lib/src/core/features/uIFeatures/beforeRender/rowSelect.js.map +1 -0
  220. package/lib/src/core/features/uIFeatures/beforeRender/scrollToTop.d.ts +14 -0
  221. package/lib/src/core/features/uIFeatures/beforeRender/scrollToTop.d.ts.map +1 -0
  222. package/lib/src/core/features/uIFeatures/beforeRender/scrollToTop.js +36 -0
  223. package/lib/src/core/features/uIFeatures/beforeRender/scrollToTop.js.map +1 -0
  224. package/lib/src/core/features/uIFeatures/beforeRender/stateHydration.d.ts +19 -0
  225. package/lib/src/core/features/uIFeatures/beforeRender/stateHydration.d.ts.map +1 -0
  226. package/lib/src/core/features/uIFeatures/beforeRender/stateHydration.js +157 -0
  227. package/lib/src/core/features/uIFeatures/beforeRender/stateHydration.js.map +1 -0
  228. package/lib/src/core/features/uIFeatures/beforeRender/stateSanitization.d.ts +29 -0
  229. package/lib/src/core/features/uIFeatures/beforeRender/stateSanitization.d.ts.map +1 -0
  230. package/lib/src/core/features/uIFeatures/beforeRender/stateSanitization.js +214 -0
  231. package/lib/src/core/features/uIFeatures/beforeRender/stateSanitization.js.map +1 -0
  232. package/lib/src/core/features/uIFeatures/beforeRender/toggleHeaderIcons.d.ts +11 -0
  233. package/lib/src/core/features/uIFeatures/beforeRender/toggleHeaderIcons.d.ts.map +1 -0
  234. package/lib/src/core/features/uIFeatures/beforeRender/toggleHeaderIcons.js +26 -0
  235. package/lib/src/core/features/uIFeatures/beforeRender/toggleHeaderIcons.js.map +1 -0
  236. package/lib/src/core/features/uIFeatures/beforeRender/toggleSelectAllCheckbox.d.ts +12 -0
  237. package/lib/src/core/features/uIFeatures/beforeRender/toggleSelectAllCheckbox.d.ts.map +1 -0
  238. package/lib/src/core/features/uIFeatures/beforeRender/toggleSelectAllCheckbox.js +51 -0
  239. package/lib/src/core/features/uIFeatures/beforeRender/toggleSelectAllCheckbox.js.map +1 -0
  240. package/lib/src/core/features/uIFeatures/index.d.ts +55 -0
  241. package/lib/src/core/features/uIFeatures/index.d.ts.map +1 -0
  242. package/lib/src/core/features/uIFeatures/index.js +95 -0
  243. package/lib/src/core/features/uIFeatures/index.js.map +1 -0
  244. package/lib/src/core/generators/ColumnGenerator.d.ts +349 -0
  245. package/lib/src/core/generators/ColumnGenerator.d.ts.map +1 -0
  246. package/lib/src/core/generators/ColumnGenerator.js +725 -0
  247. package/lib/src/core/generators/ColumnGenerator.js.map +1 -0
  248. package/lib/src/core/generators/ColumnGenerator.types.d.ts +149 -0
  249. package/lib/src/core/generators/ColumnGenerator.types.d.ts.map +1 -0
  250. package/lib/src/core/generators/ColumnGenerator.types.js +2 -0
  251. package/lib/src/core/generators/ColumnGenerator.types.js.map +1 -0
  252. package/lib/src/core/generators/GroupGenerator.d.ts +59 -0
  253. package/lib/src/core/generators/GroupGenerator.d.ts.map +1 -0
  254. package/lib/src/core/generators/GroupGenerator.js +64 -0
  255. package/lib/src/core/generators/GroupGenerator.js.map +1 -0
  256. package/lib/src/core/generators/RowGenerator.d.ts +97 -0
  257. package/lib/src/core/generators/RowGenerator.d.ts.map +1 -0
  258. package/lib/src/core/generators/RowGenerator.js +285 -0
  259. package/lib/src/core/generators/RowGenerator.js.map +1 -0
  260. package/lib/src/core/generators/RowGenerator.types.d.ts +95 -0
  261. package/lib/src/core/generators/RowGenerator.types.d.ts.map +1 -0
  262. package/lib/src/core/generators/RowGenerator.types.js +2 -0
  263. package/lib/src/core/generators/RowGenerator.types.js.map +1 -0
  264. package/lib/src/core/generators/ViewGenerator.d.ts +280 -0
  265. package/lib/src/core/generators/ViewGenerator.d.ts.map +1 -0
  266. package/lib/src/core/generators/ViewGenerator.js +585 -0
  267. package/lib/src/core/generators/ViewGenerator.js.map +1 -0
  268. package/lib/src/core/generators/ViewGenerator.types.d.ts +180 -0
  269. package/lib/src/core/generators/ViewGenerator.types.d.ts.map +1 -0
  270. package/lib/src/core/generators/ViewGenerator.types.js +2 -0
  271. package/lib/src/core/generators/ViewGenerator.types.js.map +1 -0
  272. package/lib/src/core/generators/__tests__/viewUtilityMockSetup.d.ts +69 -0
  273. package/lib/src/core/generators/__tests__/viewUtilityMockSetup.d.ts.map +1 -0
  274. package/lib/src/core/generators/__tests__/viewUtilityMockSetup.js +16 -0
  275. package/lib/src/core/generators/__tests__/viewUtilityMockSetup.js.map +1 -0
  276. package/lib/src/core/generators/viewUtilityMethods.d.ts +316 -0
  277. package/lib/src/core/generators/viewUtilityMethods.d.ts.map +1 -0
  278. package/lib/src/core/generators/viewUtilityMethods.js +542 -0
  279. package/lib/src/core/generators/viewUtilityMethods.js.map +1 -0
  280. package/lib/src/core/index.d.ts +7 -0
  281. package/lib/src/core/index.d.ts.map +1 -0
  282. package/lib/src/core/index.js +80 -0
  283. package/lib/src/core/index.js.map +1 -0
  284. package/lib/src/core/pubSub/events.d.ts +6 -0
  285. package/lib/src/core/pubSub/events.d.ts.map +1 -0
  286. package/lib/src/core/pubSub/events.js +6 -0
  287. package/lib/src/core/pubSub/events.js.map +1 -0
  288. package/lib/src/core/pubSub/index.d.ts +7 -0
  289. package/lib/src/core/pubSub/index.d.ts.map +1 -0
  290. package/lib/src/core/pubSub/index.js +35 -0
  291. package/lib/src/core/pubSub/index.js.map +1 -0
  292. package/lib/src/core/reducers/aggregation.d.ts +5 -0
  293. package/lib/src/core/reducers/aggregation.d.ts.map +1 -0
  294. package/lib/src/core/reducers/aggregation.js +35 -0
  295. package/lib/src/core/reducers/aggregation.js.map +1 -0
  296. package/lib/src/core/reducers/bootstrap.d.ts +5 -0
  297. package/lib/src/core/reducers/bootstrap.d.ts.map +1 -0
  298. package/lib/src/core/reducers/bootstrap.js +12 -0
  299. package/lib/src/core/reducers/bootstrap.js.map +1 -0
  300. package/lib/src/core/reducers/columnAlias.d.ts +5 -0
  301. package/lib/src/core/reducers/columnAlias.d.ts.map +1 -0
  302. package/lib/src/core/reducers/columnAlias.js +28 -0
  303. package/lib/src/core/reducers/columnAlias.js.map +1 -0
  304. package/lib/src/core/reducers/conditionalStyleFormat.d.ts +5 -0
  305. package/lib/src/core/reducers/conditionalStyleFormat.d.ts.map +1 -0
  306. package/lib/src/core/reducers/conditionalStyleFormat.js +13 -0
  307. package/lib/src/core/reducers/conditionalStyleFormat.js.map +1 -0
  308. package/lib/src/core/reducers/customColumn.d.ts +5 -0
  309. package/lib/src/core/reducers/customColumn.d.ts.map +1 -0
  310. package/lib/src/core/reducers/customColumn.js +40 -0
  311. package/lib/src/core/reducers/customColumn.js.map +1 -0
  312. package/lib/src/core/reducers/dragDrop.d.ts +6 -0
  313. package/lib/src/core/reducers/dragDrop.d.ts.map +1 -0
  314. package/lib/src/core/reducers/dragDrop.js +100 -0
  315. package/lib/src/core/reducers/dragDrop.js.map +1 -0
  316. package/lib/src/core/reducers/edit.d.ts +5 -0
  317. package/lib/src/core/reducers/edit.d.ts.map +1 -0
  318. package/lib/src/core/reducers/edit.js +65 -0
  319. package/lib/src/core/reducers/edit.js.map +1 -0
  320. package/lib/src/core/reducers/error.d.ts +69 -0
  321. package/lib/src/core/reducers/error.d.ts.map +1 -0
  322. package/lib/src/core/reducers/error.js +21 -0
  323. package/lib/src/core/reducers/error.js.map +1 -0
  324. package/lib/src/core/reducers/externalState.d.ts +5 -0
  325. package/lib/src/core/reducers/externalState.d.ts.map +1 -0
  326. package/lib/src/core/reducers/externalState.js +20 -0
  327. package/lib/src/core/reducers/externalState.js.map +1 -0
  328. package/lib/src/core/reducers/filter.d.ts +5 -0
  329. package/lib/src/core/reducers/filter.d.ts.map +1 -0
  330. package/lib/src/core/reducers/filter.js +29 -0
  331. package/lib/src/core/reducers/filter.js.map +1 -0
  332. package/lib/src/core/reducers/forceUpdate.d.ts +5 -0
  333. package/lib/src/core/reducers/forceUpdate.d.ts.map +1 -0
  334. package/lib/src/core/reducers/forceUpdate.js +25 -0
  335. package/lib/src/core/reducers/forceUpdate.js.map +1 -0
  336. package/lib/src/core/reducers/freeze.d.ts +5 -0
  337. package/lib/src/core/reducers/freeze.d.ts.map +1 -0
  338. package/lib/src/core/reducers/freeze.js +36 -0
  339. package/lib/src/core/reducers/freeze.js.map +1 -0
  340. package/lib/src/core/reducers/grouping.d.ts +5 -0
  341. package/lib/src/core/reducers/grouping.d.ts.map +1 -0
  342. package/lib/src/core/reducers/grouping.js +142 -0
  343. package/lib/src/core/reducers/grouping.js.map +1 -0
  344. package/lib/src/core/reducers/index.d.ts +5 -0
  345. package/lib/src/core/reducers/index.d.ts.map +1 -0
  346. package/lib/src/core/reducers/index.js +77 -0
  347. package/lib/src/core/reducers/index.js.map +1 -0
  348. package/lib/src/core/reducers/moveRecords.d.ts +5 -0
  349. package/lib/src/core/reducers/moveRecords.d.ts.map +1 -0
  350. package/lib/src/core/reducers/moveRecords.js +10 -0
  351. package/lib/src/core/reducers/moveRecords.js.map +1 -0
  352. package/lib/src/core/reducers/notificationsReducer.d.ts +4 -0
  353. package/lib/src/core/reducers/notificationsReducer.d.ts.map +1 -0
  354. package/lib/src/core/reducers/notificationsReducer.js +49 -0
  355. package/lib/src/core/reducers/notificationsReducer.js.map +1 -0
  356. package/lib/src/core/reducers/paginations.d.ts +5 -0
  357. package/lib/src/core/reducers/paginations.d.ts.map +1 -0
  358. package/lib/src/core/reducers/paginations.js +19 -0
  359. package/lib/src/core/reducers/paginations.js.map +1 -0
  360. package/lib/src/core/reducers/personalizationDirtyReducer.d.ts +5 -0
  361. package/lib/src/core/reducers/personalizationDirtyReducer.d.ts.map +1 -0
  362. package/lib/src/core/reducers/personalizationDirtyReducer.js +46 -0
  363. package/lib/src/core/reducers/personalizationDirtyReducer.js.map +1 -0
  364. package/lib/src/core/reducers/personalizationReducer.d.ts +5 -0
  365. package/lib/src/core/reducers/personalizationReducer.d.ts.map +1 -0
  366. package/lib/src/core/reducers/personalizationReducer.js +238 -0
  367. package/lib/src/core/reducers/personalizationReducer.js.map +1 -0
  368. package/lib/src/core/reducers/refresh.d.ts +5 -0
  369. package/lib/src/core/reducers/refresh.d.ts.map +1 -0
  370. package/lib/src/core/reducers/refresh.js +16 -0
  371. package/lib/src/core/reducers/refresh.js.map +1 -0
  372. package/lib/src/core/reducers/renderFormatter.d.ts +5 -0
  373. package/lib/src/core/reducers/renderFormatter.d.ts.map +1 -0
  374. package/lib/src/core/reducers/renderFormatter.js +22 -0
  375. package/lib/src/core/reducers/renderFormatter.js.map +1 -0
  376. package/lib/src/core/reducers/resize.d.ts +5 -0
  377. package/lib/src/core/reducers/resize.d.ts.map +1 -0
  378. package/lib/src/core/reducers/resize.js +32 -0
  379. package/lib/src/core/reducers/resize.js.map +1 -0
  380. package/lib/src/core/reducers/rowSelect.d.ts +5 -0
  381. package/lib/src/core/reducers/rowSelect.d.ts.map +1 -0
  382. package/lib/src/core/reducers/rowSelect.js +86 -0
  383. package/lib/src/core/reducers/rowSelect.js.map +1 -0
  384. package/lib/src/core/reducers/sanitize.d.ts +5 -0
  385. package/lib/src/core/reducers/sanitize.d.ts.map +1 -0
  386. package/lib/src/core/reducers/sanitize.js +21 -0
  387. package/lib/src/core/reducers/sanitize.js.map +1 -0
  388. package/lib/src/core/reducers/search.d.ts +5 -0
  389. package/lib/src/core/reducers/search.d.ts.map +1 -0
  390. package/lib/src/core/reducers/search.js +13 -0
  391. package/lib/src/core/reducers/search.js.map +1 -0
  392. package/lib/src/core/reducers/showHeaderIcons.d.ts +5 -0
  393. package/lib/src/core/reducers/showHeaderIcons.d.ts.map +1 -0
  394. package/lib/src/core/reducers/showHeaderIcons.js +13 -0
  395. package/lib/src/core/reducers/showHeaderIcons.js.map +1 -0
  396. package/lib/src/core/reducers/smallScreen.d.ts +5 -0
  397. package/lib/src/core/reducers/smallScreen.d.ts.map +1 -0
  398. package/lib/src/core/reducers/smallScreen.js +22 -0
  399. package/lib/src/core/reducers/smallScreen.js.map +1 -0
  400. package/lib/src/core/reducers/sort.d.ts +5 -0
  401. package/lib/src/core/reducers/sort.d.ts.map +1 -0
  402. package/lib/src/core/reducers/sort.js +71 -0
  403. package/lib/src/core/reducers/sort.js.map +1 -0
  404. package/lib/src/core/reducers/versioning/index.d.ts +16 -0
  405. package/lib/src/core/reducers/versioning/index.d.ts.map +1 -0
  406. package/lib/src/core/reducers/versioning/index.js +46 -0
  407. package/lib/src/core/reducers/versioning/index.js.map +1 -0
  408. package/lib/src/core/reducers/versioning/v1.d.ts +136 -0
  409. package/lib/src/core/reducers/versioning/v1.d.ts.map +1 -0
  410. package/lib/src/core/reducers/versioning/v1.js +156 -0
  411. package/lib/src/core/reducers/versioning/v1.js.map +1 -0
  412. package/lib/src/core/reducers/visibility.d.ts +5 -0
  413. package/lib/src/core/reducers/visibility.d.ts.map +1 -0
  414. package/lib/src/core/reducers/visibility.js +49 -0
  415. package/lib/src/core/reducers/visibility.js.map +1 -0
  416. package/lib/src/core/test/junitMocks.d.ts +756 -0
  417. package/lib/src/core/test/junitMocks.d.ts.map +1 -0
  418. package/lib/src/core/test/junitMocks.js +2923 -0
  419. package/lib/src/core/test/junitMocks.js.map +1 -0
  420. package/lib/src/core/test/samples/a11ySample.d.ts +8 -0
  421. package/lib/src/core/test/samples/a11ySample.d.ts.map +1 -0
  422. package/lib/src/core/test/samples/a11ySample.js +1131 -0
  423. package/lib/src/core/test/samples/a11ySample.js.map +1 -0
  424. package/lib/src/core/test/samples/a11ySampleWithLoaders.d.ts +8 -0
  425. package/lib/src/core/test/samples/a11ySampleWithLoaders.d.ts.map +1 -0
  426. package/lib/src/core/test/samples/a11ySampleWithLoaders.js +1134 -0
  427. package/lib/src/core/test/samples/a11ySampleWithLoaders.js.map +1 -0
  428. package/lib/src/core/test/samples/utils.d.ts +2 -0
  429. package/lib/src/core/test/samples/utils.d.ts.map +1 -0
  430. package/lib/src/core/test/samples/utils.js +9 -0
  431. package/lib/src/core/test/samples/utils.js.map +1 -0
  432. package/lib/src/core/test/utils/rowDragDropUtils.d.ts +20 -0
  433. package/lib/src/core/test/utils/rowDragDropUtils.d.ts.map +1 -0
  434. package/lib/src/core/test/utils/rowDragDropUtils.js +98 -0
  435. package/lib/src/core/test/utils/rowDragDropUtils.js.map +1 -0
  436. package/lib/src/core/utils/condition-utils.d.ts +15 -0
  437. package/lib/src/core/utils/condition-utils.d.ts.map +1 -0
  438. package/lib/src/core/utils/condition-utils.js +114 -0
  439. package/lib/src/core/utils/condition-utils.js.map +1 -0
  440. package/lib/src/core/utils/util.d.ts +380 -0
  441. package/lib/src/core/utils/util.d.ts.map +1 -0
  442. package/lib/src/core/utils/util.js +912 -0
  443. package/lib/src/core/utils/util.js.map +1 -0
  444. package/lib/src/core/utils/util.types.d.ts +43 -0
  445. package/lib/src/core/utils/util.types.d.ts.map +1 -0
  446. package/lib/src/core/utils/util.types.js +2 -0
  447. package/lib/src/core/utils/util.types.js.map +1 -0
  448. package/lib/types/ApiContext.types.d.ts +392 -0
  449. package/lib/types/ApiContext.types.d.ts.map +1 -0
  450. package/lib/types/ApiContext.types.js +2 -0
  451. package/lib/types/ApiContext.types.js.map +1 -0
  452. package/lib/types/Meta.types.d.ts +705 -0
  453. package/lib/types/Meta.types.d.ts.map +1 -0
  454. package/lib/types/Meta.types.js +37 -0
  455. package/lib/types/Meta.types.js.map +1 -0
  456. package/lib/types/RsCoreBootArgs.types.d.ts +103 -0
  457. package/lib/types/RsCoreBootArgs.types.d.ts.map +1 -0
  458. package/lib/types/RsCoreBootArgs.types.js +2 -0
  459. package/lib/types/RsCoreBootArgs.types.js.map +1 -0
  460. package/lib/types/State.types.d.ts +374 -0
  461. package/lib/types/State.types.d.ts.map +1 -0
  462. package/lib/types/State.types.js +5 -0
  463. package/lib/types/State.types.js.map +1 -0
  464. package/lib/types.d.ts +30 -0
  465. package/lib/types.d.ts.map +1 -0
  466. package/lib/types.js +2 -0
  467. package/lib/types.js.map +1 -0
  468. package/package.json +30 -0
@@ -0,0 +1,36 @@
1
+ import { withMemoization } from '../../../utils/util';
2
+ import ActionTypes from '../../../actions/actionConstants';
3
+ function dispatchGroupSort(featureProps, columnId) {
4
+ const column = featureProps.getView().columns.find(col => col.field.id === columnId);
5
+ if (!column) {
6
+ /* eslint-disable no-console */
7
+ console.warn('Invalid columnId:', columnId);
8
+ return;
9
+ }
10
+ if (column?.grouped) {
11
+ column.applyGroupingSort();
12
+ }
13
+ }
14
+ function sortGroupedColumns([featureProps]) {
15
+ const action = featureProps.queuedActions[0];
16
+ if (action.type === ActionTypes.UPDATE_SORT) {
17
+ action.payload.forEach(({ columnId }) => {
18
+ dispatchGroupSort(featureProps, columnId);
19
+ });
20
+ }
21
+ else if (action.type === ActionTypes.COLUMN_SORT) {
22
+ dispatchGroupSort(featureProps, action.payload.id);
23
+ }
24
+ }
25
+ /**
26
+ *
27
+ * Updates the `sort` order in the {@link State.group} for a column by considering it from {@link State.sortingOrder}.
28
+ */
29
+ export default function groupSorting() {
30
+ const memoizedSortGroupedColumns = withMemoization(sortGroupedColumns);
31
+ return function execute(featureProps) {
32
+ const state = featureProps.getState();
33
+ memoizedSortGroupedColumns([featureProps], [state.sortingOrder]);
34
+ };
35
+ }
36
+ //# sourceMappingURL=groupsorting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"groupsorting.js","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/groupsorting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,WAAW,MAAM,kCAAkC,CAAC;AAK3D,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AC,CAAC;IACnE,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { withMemoization } from '../../../utils/util';\nimport ActionTypes from '../../../actions/actionConstants';\nimport type { BeforeRenderFeatureProps } from '../../featureFactory';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { State } from '../../../../../types/State.types';\n\nfunction dispatchGroupSort(featureProps: BeforeRenderFeatureProps, columnId: string) {\n const column = featureProps.getView().columns!.find(col => col.field.id === columnId);\n if (!column) {\n /* eslint-disable no-console */\n console.warn('Invalid columnId:', columnId);\n return;\n }\n if (column?.grouped) {\n column.applyGroupingSort();\n }\n}\n\nfunction sortGroupedColumns([featureProps]: [featureProps: BeforeRenderFeatureProps]) {\n const action = featureProps.queuedActions[0];\n if (action.type === ActionTypes.UPDATE_SORT) {\n action.payload.forEach(({ columnId }) => {\n dispatchGroupSort(featureProps, columnId);\n });\n } else if (action.type === ActionTypes.COLUMN_SORT) {\n dispatchGroupSort(featureProps, action.payload.id);\n }\n}\n\n/**\n *\n * Updates the `sort` order in the {@link State.group} for a column by considering it from {@link State.sortingOrder}.\n */\nexport default function groupSorting() {\n const memoizedSortGroupedColumns = withMemoization(sortGroupedColumns);\n\n return function execute(featureProps: BeforeRenderFeatureProps) {\n const state = featureProps.getState();\n memoizedSortGroupedColumns([featureProps], [state.sortingOrder]);\n };\n}\n"]}
@@ -0,0 +1,7 @@
1
+ import type { BeforeRenderFeatureProps } from '../../featureFactory';
2
+ /**
3
+ * Moves the rows within view {@link View.data data} and calls {@link ApiContext.moveListRecords moveListRecords} api when {@link State.sourceKey sourceKey} or {@link State.destinationKey destinationKey} is changed in the `State`.
4
+ */
5
+ declare const _default: () => (featureProps: BeforeRenderFeatureProps) => undefined;
6
+ export default _default;
7
+ //# sourceMappingURL=moveListRecords.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"moveListRecords.d.ts","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/moveListRecords.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AA+ErE;;GAEG;6CAGqC,wBAAwB;AAFhE,wBAOE"}
@@ -0,0 +1,76 @@
1
+ import { withMemoization } from '../../../utils/util';
2
+ import { actionMoveRecordKeysUpdate } from '../../../actions/actions';
3
+ /* eslint-enable @typescript-eslint/no-unused-vars */
4
+ function moveDataRecords(data, source, destination, getView) {
5
+ let reorderedData;
6
+ if (source < destination) {
7
+ reorderedData = [
8
+ ...data.slice(0, source),
9
+ ...data.slice(source + 1, destination + 1),
10
+ data[source],
11
+ ...data.slice(destination + 1, data.length)
12
+ ];
13
+ }
14
+ else {
15
+ reorderedData = [
16
+ ...data.slice(0, destination),
17
+ data[source],
18
+ ...data.slice(destination, source),
19
+ ...data.slice(source + 1, data.length)
20
+ ];
21
+ }
22
+ getView().setProp('data', reorderedData);
23
+ }
24
+ async function moveRecords([{ getView, getState, getRsProps, dispatch }]) {
25
+ if (!getView().meta.moveListRecords) {
26
+ return;
27
+ }
28
+ const { sourceKey: sourceID, destinationKey: destinationID } = getState();
29
+ const { apiContext } = getRsProps();
30
+ try {
31
+ if (!sourceID || !destinationID) {
32
+ return;
33
+ }
34
+ // FIXME: why there is a dependency on pzInskey?
35
+ const sourceIndex = getView().data.findIndex(row => row.pzInsKey === sourceID);
36
+ const destinationIndex = getView().data.findIndex(row => row.pzInsKey === destinationID);
37
+ // check if source & destination records are from current view's list data.
38
+ if (sourceIndex === -1 || destinationIndex === -1) {
39
+ return;
40
+ }
41
+ // moving data records manually from client side
42
+ moveDataRecords(getView().data, sourceIndex, destinationIndex, getView);
43
+ const dataToSubmit = {
44
+ sourceID,
45
+ destinationID
46
+ };
47
+ // invoke moveListRecords context api
48
+ if (!apiContext.moveListRecords) {
49
+ throw Error('moveListRecords api is not defined in the apiContext prop passed.');
50
+ }
51
+ const { refresh = false } = await apiContext.moveListRecords(dataToSubmit);
52
+ if (refresh) {
53
+ getView().type.forceRefresh({ sourceID: true, destinationID: true });
54
+ }
55
+ }
56
+ catch (err) {
57
+ // eslint-disable-next-line no-console
58
+ console.log('Move list error:', err);
59
+ }
60
+ finally {
61
+ // clean sourceID and destinationID state
62
+ dispatch(actionMoveRecordKeysUpdate({ sourceID: '', destinationID: '' }));
63
+ }
64
+ }
65
+ /**
66
+ * Moves the rows within view {@link View.data data} and calls {@link ApiContext.moveListRecords moveListRecords} api when {@link State.sourceKey sourceKey} or {@link State.destinationKey destinationKey} is changed in the `State`.
67
+ */
68
+ export default () => {
69
+ const memoizedMoveRecords = withMemoization(moveRecords);
70
+ return function execute(featureProps) {
71
+ const { sourceKey: sourceID, destinationKey: destinationID } = featureProps.getState();
72
+ memoizedMoveRecords([featureProps], [sourceID, destinationID]);
73
+ return undefined;
74
+ };
75
+ };
76
+ //# sourceMappingURL=moveListRecords.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"moveListRecords.js","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/moveListRecords.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAOtE,qDAAqD;AAErD,SAAS,eAAe,CACtB,IAAe,EACf,MAAc,EACd,WAAmB,EACnB,OAA4C;IAE5C,IAAI,aAAa,CAAC;IAClB,IAAI,MAAM,GAAG,WAAW,EAAE,CAAC;QACzB,aAAa,GAAG;YACd,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC;YACxB,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,WAAW,GAAG,CAAC,CAAC;YAC1C,IAAI,CAAC,MAAM,CAAC;YACZ,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC;SAC5C,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,aAAa,GAAG;YACd,GAAG,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gBAAgB,EAAE,OAAO,CAAC,CAAC;QAEzE,MAAM,YAAY,GAAG;YACnB,QAAQ;YACR,aAAa;SACd,CAAC;QACF,qCAAqC;QACrC,IAAI,CAAC,UAAU,CAAC,eAAe,EAAE,CAAC;YAChC,MAAM,KAAK,CAAC,mEAAmE,CAAC,CAAC;QACnF,CAAC;QACD,MAAM,EAAE,OAAO,GAAG,KAAK,EAAE,GAAG,MAAM,UAAU,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;QAE3E,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;QACvE,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,sCAAsC;QACtC,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAC;IACvC,CAAC;YAAS,CAAC;QACT,yCAAyC;QACzC,QAAQ,CAAC,0BAA0B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IAC5E,CAAC;AACH,CAAC;AAED;;GAEG;AACH,eAAe,GAAG,EAAE;IAClB,MAAM,mBAAmB,GAAG,eAAe,CAAC,WAAW,CAAC,CAAC;IACzD,OAAO,SAAS,OAAO,CAAC,YAAsC;QAC5D,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;QACvF,mBAAmB,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC;QAC/D,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { withMemoization } from '../../../utils/util';\nimport { actionMoveRecordKeysUpdate } from '../../../actions/actions';\nimport type { BeforeRenderFeatureProps } from '../../featureFactory';\nimport type { RowData } from '../../../generators/RowGenerator.types';\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport type { State } from '../../../../../types/State.types';\nimport type View from '../../../generators/ViewGenerator';\nimport type { ApiContext } from '../../../../../types/ApiContext.types';\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\nfunction moveDataRecords(\n data: RowData[],\n source: number,\n destination: number,\n getView: BeforeRenderFeatureProps['getView']\n) {\n let reorderedData;\n if (source < destination) {\n reorderedData = [\n ...data.slice(0, source),\n ...data.slice(source + 1, destination + 1),\n data[source],\n ...data.slice(destination + 1, data.length)\n ];\n } else {\n reorderedData = [\n ...data.slice(0, destination),\n data[source],\n ...data.slice(destination, source),\n ...data.slice(source + 1, data.length)\n ];\n }\n getView().setProp('data', reorderedData);\n}\n\nasync function moveRecords([{ getView, getState, getRsProps, dispatch }]: [\n featureProps: BeforeRenderFeatureProps\n]) {\n if (!getView().meta.moveListRecords) {\n return;\n }\n const { sourceKey: sourceID, destinationKey: destinationID } = getState();\n const { apiContext } = getRsProps();\n try {\n if (!sourceID || !destinationID) {\n return;\n }\n // FIXME: why there is a dependency on pzInskey?\n const sourceIndex = getView().data!.findIndex(row => row.pzInsKey === sourceID);\n const destinationIndex = getView().data!.findIndex(row => row.pzInsKey === destinationID);\n\n // check if source & destination records are from current view's list data.\n if (sourceIndex === -1 || destinationIndex === -1) {\n return;\n }\n\n // moving data records manually from client side\n moveDataRecords(getView().data!, sourceIndex, destinationIndex, getView);\n\n const dataToSubmit = {\n sourceID,\n destinationID\n };\n // invoke moveListRecords context api\n if (!apiContext.moveListRecords) {\n throw Error('moveListRecords api is not defined in the apiContext prop passed.');\n }\n const { refresh = false } = await apiContext.moveListRecords(dataToSubmit);\n\n if (refresh) {\n getView().type.forceRefresh({ sourceID: true, destinationID: true });\n }\n } catch (err) {\n // eslint-disable-next-line no-console\n console.log('Move list error:', err);\n } finally {\n // clean sourceID and destinationID state\n dispatch(actionMoveRecordKeysUpdate({ sourceID: '', destinationID: '' }));\n }\n}\n\n/**\n * Moves the rows within view {@link View.data data} and calls {@link ApiContext.moveListRecords moveListRecords} api when {@link State.sourceKey sourceKey} or {@link State.destinationKey destinationKey} is changed in the `State`.\n */\nexport default () => {\n const memoizedMoveRecords = withMemoization(moveRecords);\n return function execute(featureProps: BeforeRenderFeatureProps) {\n const { sourceKey: sourceID, destinationKey: destinationID } = featureProps.getState();\n memoizedMoveRecords([featureProps], [sourceID, destinationID]);\n return undefined;\n };\n};\n"]}
@@ -0,0 +1,16 @@
1
+ import type RsInternal from '../../../RsInternal';
2
+ import type { BeforeRenderFeatureProps } from '../../featureFactory';
3
+ declare function execute(featureProps: BeforeRenderFeatureProps): Promise<void> | null | undefined;
4
+ /**
5
+ * Handles the CRUD operations for the personalization feature in RS. It manages the following personalization actions and invokes the corresponding APIs to communicate personalization data:
6
+ * - {@link ActionTypes.PERSONALIZATION_UPDATE}
7
+ * - {@link ActionTypes.PERSONALIZATION_EDIT}
8
+ * - {@link ActionTypes.PERSONALIZATION_SET_DEFAULT}
9
+ * - {@link ActionTypes.PERSONALIZATION_SET_APP_DEFAULT}
10
+ * - {@link ActionTypes.PERSONALIZATION_CREATE}
11
+ * - {@link ActionTypes.PERSONALIZATION_DELETE}
12
+ * - {@link ActionTypes.PERSONALIZATION_UPDATE_PRESET_ID}
13
+ */
14
+ declare const _default: (rsInternal: RsInternal) => typeof execute;
15
+ export default _default;
16
+ //# sourceMappingURL=personalization.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"personalization.d.ts","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/personalization.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AAElD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAiRrE,iBAAS,OAAO,CAAC,YAAY,EAAE,wBAAwB,oCAuJtD;AAED;;;;;;;;;GASG;qCACyB,UAAU;AAAtC,wBAOE"}
@@ -0,0 +1,306 @@
1
+ import { actionGetPersonalizations, actionNotificationAdd, actionPersonalizationUpdateId, actionPersonalizationDelete, actionPersonalizationUpdatePresetId } from '../../../actions/actions';
2
+ import ActionTypes from '../../../actions/actionConstants';
3
+ import { removeEmptyValuesFromObject } from '../../../utils/util';
4
+ import { defaultPresetIdIndex } from '../../../constants';
5
+ function personalizationUpdate({ getRsProps, dispatch }, payload, personalization) {
6
+ const rsProps = getRsProps();
7
+ const { personalizationKey, markAsDefault, markAsAppDefault } = payload;
8
+ const viewName = personalization.allPersonalizations[personalizationKey].name;
9
+ rsProps.apiContext.updatePersonalization(personalizationKey, {
10
+ markAsDefault: markAsDefault || personalization.allPersonalizations[personalizationKey].markAsDefault,
11
+ ...personalization.allPersonalizations[personalizationKey],
12
+ markAsAppDefault
13
+ }).then(() => {
14
+ dispatch(actionNotificationAdd({
15
+ // FIXME: Identify how to use translated values inside core library.
16
+ content: `'${viewName}' saved with changes${markAsDefault ? ' and marked as default view' : ''}`
17
+ }));
18
+ });
19
+ }
20
+ function personalizationUpdatePresetId({ getRsProps }, payload, personalization) {
21
+ const { personalizationKey } = payload;
22
+ const rsProps = getRsProps();
23
+ rsProps.apiContext.updatePersonalization(personalizationKey, personalization.allPersonalizations[personalizationKey]);
24
+ }
25
+ function personalizationSetDefault({ getRsProps, dispatch }, payload, personalization) {
26
+ const { personalizationKey } = payload;
27
+ const rsProps = getRsProps();
28
+ const { updatePersonalization } = rsProps.apiContext;
29
+ const setDefault = updatePersonalization(personalizationKey, {
30
+ markAsDefault: true
31
+ });
32
+ const viewName = personalization.allPersonalizations[personalizationKey].name;
33
+ setDefault.then(() => {
34
+ dispatch(actionNotificationAdd({
35
+ content: `'${viewName}' view is marked as Default`
36
+ }));
37
+ });
38
+ }
39
+ function personalizationSetAppDefault({ getRsProps, dispatch }, payload, personalization) {
40
+ const { personalizationKey, personalizationName } = payload;
41
+ const rsProps = getRsProps();
42
+ const { updatePersonalization } = rsProps.apiContext;
43
+ personalization.allPersonalizations[personalizationKey].name = personalizationName;
44
+ const setAppDefault = updatePersonalization(personalizationKey, {
45
+ markAsAppDefault: true,
46
+ // @ts-expect-error name is added twice. Check this.
47
+ name: personalizationName,
48
+ ...personalization.allPersonalizations[personalizationKey]
49
+ });
50
+ const viewName = personalization.allPersonalizations[personalizationKey].name;
51
+ setAppDefault.then(() => {
52
+ dispatch(actionNotificationAdd({
53
+ content: `'${viewName}' view is marked as App Default`
54
+ }));
55
+ });
56
+ }
57
+ function personalizationCreation({ getRsProps, dispatch }, payload, personalization) {
58
+ const { personalizationKey, markAsDefault } = payload;
59
+ const rsProps = getRsProps();
60
+ const viewName = personalization.allPersonalizations[personalizationKey].name;
61
+ rsProps.apiContext.createPersonalization(personalizationKey, {
62
+ markAsDefault,
63
+ ...personalization.allPersonalizations[personalizationKey]
64
+ }).then(response => {
65
+ const actualPersonalizationKey = response.data || response;
66
+ if (actualPersonalizationKey !== personalizationKey) {
67
+ dispatch(actionPersonalizationUpdateId(personalizationKey, actualPersonalizationKey));
68
+ }
69
+ dispatch(actionNotificationAdd({
70
+ content: `Created view '${viewName}'${markAsDefault ? ' and marked as default view' : ''}`
71
+ }));
72
+ });
73
+ }
74
+ function personalizationDeletion({ getRsProps, dispatch }, payload, personalization) {
75
+ const { personalizationKey, deletePresetPersonalizations } = payload;
76
+ const rsProps = getRsProps();
77
+ const viewName = personalization.lastDeletedPersonalization.name;
78
+ rsProps.apiContext.deletePersonalization(personalizationKey).then(() => {
79
+ if (!deletePresetPersonalizations) {
80
+ dispatch(actionNotificationAdd({
81
+ content: `Deleted view '${viewName}'`
82
+ }));
83
+ }
84
+ });
85
+ }
86
+ function syncPersonalization(featureProps) {
87
+ const { getState, queuedActions } = featureProps;
88
+ const personalizationActions = [
89
+ ActionTypes.PERSONALIZATION_UPDATE,
90
+ ActionTypes.PERSONALIZATION_EDIT,
91
+ ActionTypes.PERSONALIZATION_SET_DEFAULT,
92
+ ActionTypes.PERSONALIZATION_SET_APP_DEFAULT,
93
+ ActionTypes.PERSONALIZATION_CREATE,
94
+ ActionTypes.PERSONALIZATION_DELETE,
95
+ ActionTypes.PERSONALIZATION_UPDATE_PRESET_ID
96
+ ];
97
+ const actionTypes = queuedActions.map(a => a.type);
98
+ const personalizationAction = personalizationActions.find(a => actionTypes.includes(a));
99
+ if (personalizationAction) {
100
+ const actionDispatched = queuedActions.find(a => a.type === personalizationAction);
101
+ const { personalization } = getState();
102
+ switch (personalizationAction) {
103
+ case ActionTypes.PERSONALIZATION_EDIT:
104
+ case ActionTypes.PERSONALIZATION_UPDATE:
105
+ personalizationUpdate(featureProps, actionDispatched.payload, personalization);
106
+ break;
107
+ case ActionTypes.PERSONALIZATION_SET_DEFAULT:
108
+ personalizationSetDefault(featureProps, actionDispatched.payload, personalization);
109
+ break;
110
+ case ActionTypes.PERSONALIZATION_SET_APP_DEFAULT:
111
+ personalizationSetAppDefault(featureProps, actionDispatched.payload, personalization);
112
+ break;
113
+ case ActionTypes.PERSONALIZATION_CREATE:
114
+ personalizationCreation(featureProps, actionDispatched.payload, personalization);
115
+ break;
116
+ case ActionTypes.PERSONALIZATION_DELETE:
117
+ personalizationDeletion(featureProps, actionDispatched.payload, personalization);
118
+ break;
119
+ case ActionTypes.PERSONALIZATION_UPDATE_PRESET_ID:
120
+ personalizationUpdatePresetId(featureProps, actionDispatched.payload, personalization);
121
+ break;
122
+ default:
123
+ break;
124
+ }
125
+ }
126
+ }
127
+ function sanitizingPersonalisations({ getRsStore, dispatch }, { allPersonalizations }, presets) {
128
+ const rsStore = getRsStore();
129
+ if (!allPersonalizations)
130
+ return;
131
+ Object.keys(allPersonalizations).forEach(key => {
132
+ const { personalizationState } = allPersonalizations[key];
133
+ const defaultPresetId = rsStore.presets[defaultPresetIdIndex].id;
134
+ const { template } = presets[defaultPresetId];
135
+ if (!personalizationState.presetId && personalizationState.template === template) {
136
+ // to support existing created personalizations(backward compatibility)
137
+ personalizationState.presetId = defaultPresetId;
138
+ personalizationState.template = 'Table';
139
+ }
140
+ else if (!presets[personalizationState.presetId] ||
141
+ personalizationState.template !== presets[personalizationState.presetId].template) {
142
+ if (personalizationState.presetId === 'nonPersonalizationViewKey') {
143
+ dispatch(actionPersonalizationUpdatePresetId(key, 'nonPersonalizationViewKey', defaultPresetId));
144
+ }
145
+ else {
146
+ // Remove the personalizations of the deleted presets
147
+ dispatch(actionPersonalizationDelete(key, true));
148
+ }
149
+ }
150
+ });
151
+ }
152
+ const defaultPersonalization = (personalizationWithPreset, defaultPresetId) => {
153
+ if (personalizationWithPreset.allPersonalizations[personalizationWithPreset.defaultPersonalization]) {
154
+ return personalizationWithPreset.defaultPersonalization;
155
+ // eslint-disable-next-line no-else-return
156
+ }
157
+ else if (personalizationWithPreset.allPersonalizations.APP_DEFAULT) {
158
+ return 'APP_DEFAULT';
159
+ }
160
+ else {
161
+ return defaultPresetId;
162
+ }
163
+ };
164
+ function getPersonalizationsAction({ dispatch }, personalizationWithPreset, defaultPresetId) {
165
+ dispatch(
166
+ // @ts-expect-error Check this after full migration. There is incompatibility b/w Personalization response and Personalization state
167
+ actionGetPersonalizations({
168
+ ...personalizationWithPreset,
169
+ defaultPersonalization: defaultPersonalization(personalizationWithPreset, defaultPresetId)
170
+ }));
171
+ }
172
+ function execute(featureProps) {
173
+ const { getView, getRsStore, getRsProps, dispatch } = featureProps;
174
+ const rsStore = getRsStore();
175
+ const rsProps = getRsProps();
176
+ if (!getView().meta.personalization &&
177
+ (!rsStore.presets || Object.keys(rsStore.presets).length === 0)) {
178
+ // return as personalization is disabled and presets do not exist so no need to fetch to see which preset is default
179
+ return null;
180
+ }
181
+ // i want to get called before mount and also only once
182
+ if (!rsStore.personalizationDone) {
183
+ if (typeof rsProps.apiContext.fetchPersonalizations !== 'function') {
184
+ // eslint-disable-next-line no-console
185
+ console.warn('Return type of apiContext.fetchPersonalization is', JSON.stringify({
186
+ defaultPersonalization: 'b5f5c4f3-fdf8-496c-9f99-9e2e7d296e0a',
187
+ allPersonalizations: {
188
+ 'b5f5c4f3-fdf8-496c-9f99-9e2e7d296e0a': {
189
+ name: 'Personalized state view',
190
+ personalizationState: {
191
+ version: 'v1',
192
+ showHeaderIcons: true,
193
+ columnWidths: { 'Sl.No.': 93 },
194
+ customFields: [],
195
+ sortingOrder: [{ columnId: 'ID', order: 'desc', sequence: 1 }],
196
+ groups: [],
197
+ hiddenColumns: ['Product ID'],
198
+ selectedHeightOption: '1',
199
+ aggregationInfo: [],
200
+ template: 'Table',
201
+ presetId: 'P_1599825360427'
202
+ }
203
+ }
204
+ }
205
+ }, null, 4));
206
+ throw Error('apiContext.fetchPersonalizations method should be a function which should return personalizations information (check above warning for response structure).');
207
+ }
208
+ // i need the middleware to wait until i finish my job
209
+ return rsProps.apiContext
210
+ .fetchPersonalizations()
211
+ .then(personalization => {
212
+ const personalizationFetched = personalization || {
213
+ defaultPersonalization: rsStore.presets[0].id,
214
+ allPersonalizations: {}
215
+ };
216
+ // This is done to remove empty object which got saved while setting preset as default.
217
+ removeEmptyValuesFromObject(personalizationFetched.allPersonalizations);
218
+ const defaultPresetId = rsStore.presets[defaultPresetIdIndex].id;
219
+ // Creating personalization from preset.
220
+ const presetsPersonalizations = rsStore.presets?.reduce((acc, p) => {
221
+ acc[p.id] = {
222
+ title: p.title,
223
+ name: p.name,
224
+ template: p.template,
225
+ isPreset: true,
226
+ personalizationState: {},
227
+ isDefaultPreset: defaultPresetId === p.id
228
+ };
229
+ return acc;
230
+ }, {}) || {};
231
+ // sanitizing personalisations where there is no preset exists
232
+ sanitizingPersonalisations(featureProps, personalizationFetched, presetsPersonalizations);
233
+ const personalizationWithPreset = {
234
+ ...personalizationFetched,
235
+ allPersonalizations: {
236
+ ...presetsPersonalizations,
237
+ ...(getView().meta.personalization ? personalizationFetched.allPersonalizations : {})
238
+ }
239
+ };
240
+ // if grouping is not enabled based on some factors, remove grouping programatically from personalizations
241
+ if (!getView().meta.grouping) {
242
+ Object.values(personalizationWithPreset.allPersonalizations).forEach(p => {
243
+ if (p.personalizationState?.groups?.length) {
244
+ p.personalizationState.groups = [];
245
+ }
246
+ });
247
+ }
248
+ // dispatch the get personalization action
249
+ getPersonalizationsAction(featureProps, personalizationWithPreset, rsStore.presets[defaultPresetIdIndex].id);
250
+ })
251
+ .catch(error => {
252
+ getView().meta.personalization = false;
253
+ rsStore.meta.personalization = false;
254
+ const errMessage = `Error Fetching personalizations ${error}`;
255
+ // eslint-disable-next-line no-console
256
+ console.error(errMessage);
257
+ dispatch(actionNotificationAdd({
258
+ content: errMessage
259
+ }));
260
+ // eslint-disable-next-line no-console
261
+ console.warn('Return type of apiContext.fetchPersonalization is', JSON.stringify({
262
+ defaultPersonalization: 'b5f5c4f3-fdf8-496c-9f99-9e2e7d296e0a',
263
+ allPersonalizations: {
264
+ 'b5f5c4f3-fdf8-496c-9f99-9e2e7d296e0a': {
265
+ name: 'Personalized state view',
266
+ personalizationState: {
267
+ version: 'v1',
268
+ showHeaderIcons: true,
269
+ columnWidths: { 'Sl.No.': 93 },
270
+ customFields: [],
271
+ sortingOrder: [{ columnId: 'ID', order: 'desc', sequence: 1 }],
272
+ groups: [],
273
+ hiddenColumns: ['Product ID'],
274
+ selectedHeightOption: '1',
275
+ aggregationInfo: [],
276
+ template: 'Table',
277
+ presetId: 'P_1599825360427'
278
+ }
279
+ }
280
+ }
281
+ }, null, 4));
282
+ })
283
+ .finally(() => {
284
+ rsStore.personalizationDone = true;
285
+ });
286
+ }
287
+ syncPersonalization(featureProps);
288
+ return undefined;
289
+ }
290
+ /**
291
+ * Handles the CRUD operations for the personalization feature in RS. It manages the following personalization actions and invokes the corresponding APIs to communicate personalization data:
292
+ * - {@link ActionTypes.PERSONALIZATION_UPDATE}
293
+ * - {@link ActionTypes.PERSONALIZATION_EDIT}
294
+ * - {@link ActionTypes.PERSONALIZATION_SET_DEFAULT}
295
+ * - {@link ActionTypes.PERSONALIZATION_SET_APP_DEFAULT}
296
+ * - {@link ActionTypes.PERSONALIZATION_CREATE}
297
+ * - {@link ActionTypes.PERSONALIZATION_DELETE}
298
+ * - {@link ActionTypes.PERSONALIZATION_UPDATE_PRESET_ID}
299
+ */
300
+ export default (rsInternal) => {
301
+ if (!rsInternal.getView().meta.personalization) {
302
+ rsInternal.getRsProps().apiContext.fetchPersonalizations = () => Promise.resolve({});
303
+ }
304
+ return execute;
305
+ };
306
+ //# sourceMappingURL=personalization.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"personalization.js","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/personalization.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,6BAA6B,EAC7B,2BAA2B,EAC3B,mCAAmC,EACpC,MAAM,0BAA0B,CAAC;AAClC,OAAO,WAAW,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAe1D,SAAS,qBAAqB,CAC5B,EAAE,UAAU,EAAE,QAAQ,EAA4B,EAClD,OAA+C,EAC/C,eAAgC;IAEhC,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,EAAE,kBAAkB,EAAE,aAAa,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC;IACxE,MAAM,QAAQ,GAAG,eAAe,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC;IAC9E,OAAO,CAAC,UAAU,CAAC,qBAAsB,CAAC,kBAAkB,EAAE;QAC5D,aAAa,EACX,aAAa,IAAI,eAAe,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC,aAAa;QACxF,GAAG,eAAe,CAAC,mBAAmB,CAAC,kBAAkB,CAAC;QAC1D,gBAAgB;KACjB,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;QACX,QAAQ,CACN,qBAAqB,CAAC;YACpB,oEAAoE;YACpE,OAAO,EAAE,IAAI,QAAQ,uBACnB,aAA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AC","sourcesContent":["import {\n actionGetPersonalizations,\n actionNotificationAdd,\n actionPersonalizationUpdateId,\n actionPersonalizationDelete,\n actionPersonalizationUpdatePresetId\n} from '../../../actions/actions';\nimport ActionTypes from '../../../actions/actionConstants';\nimport { removeEmptyValuesFromObject } from '../../../utils/util';\nimport { defaultPresetIdIndex } from '../../../constants';\nimport type RsInternal from '../../../RsInternal';\nimport type { PersonalizationResponse } from '../../../../../types/ApiContext.types';\nimport type { BeforeRenderFeatureProps } from '../../featureFactory';\nimport type { Personalization, PersonalizationInfo } from '../../../../../types/State.types';\nimport type {\n PersonalizationCreateAction,\n PersonalizationDeleteAction,\n PersonalizationEditAction,\n PersonalizationSetAppDefaultAction,\n PersonalizationSetDefaultAction,\n PersonalizationUpdateAction,\n PersonalizationUpdatePresetIdAction\n} from '../../../actions/actions.types';\n\nfunction personalizationUpdate(\n { getRsProps, dispatch }: BeforeRenderFeatureProps,\n payload: PersonalizationUpdateAction['payload'],\n personalization: Personalization\n) {\n const rsProps = getRsProps();\n const { personalizationKey, markAsDefault, markAsAppDefault } = payload;\n const viewName = personalization.allPersonalizations[personalizationKey].name;\n rsProps.apiContext.updatePersonalization!(personalizationKey, {\n markAsDefault:\n markAsDefault || personalization.allPersonalizations[personalizationKey].markAsDefault,\n ...personalization.allPersonalizations[personalizationKey],\n markAsAppDefault\n }).then(() => {\n dispatch(\n actionNotificationAdd({\n // FIXME: Identify how to use translated values inside core library.\n content: `'${viewName}' saved with changes${\n markAsDefault ? ' and marked as default view' : ''\n }`\n })\n );\n });\n}\n\nfunction personalizationUpdatePresetId(\n { getRsProps }: BeforeRenderFeatureProps,\n payload: PersonalizationUpdatePresetIdAction['payload'],\n personalization: Personalization\n) {\n const { personalizationKey } = payload;\n const rsProps = getRsProps();\n rsProps.apiContext.updatePersonalization!(\n personalizationKey,\n personalization.allPersonalizations[personalizationKey]\n );\n}\n\nfunction personalizationSetDefault(\n { getRsProps, dispatch }: BeforeRenderFeatureProps,\n payload: PersonalizationSetDefaultAction['payload'],\n personalization: Personalization\n) {\n const { personalizationKey } = payload;\n const rsProps = getRsProps();\n const { updatePersonalization } = rsProps.apiContext;\n\n const setDefault = updatePersonalization!(personalizationKey, {\n markAsDefault: true\n });\n const viewName = personalization.allPersonalizations[personalizationKey].name;\n\n setDefault.then(() => {\n dispatch(\n actionNotificationAdd({\n content: `'${viewName}' view is marked as Default`\n })\n );\n });\n}\n\nfunction personalizationSetAppDefault(\n { getRsProps, dispatch }: BeforeRenderFeatureProps,\n payload: PersonalizationSetAppDefaultAction['payload'],\n personalization: Personalization\n) {\n const { personalizationKey, personalizationName } = payload;\n const rsProps = getRsProps();\n const { updatePersonalization } = rsProps.apiContext;\n personalization.allPersonalizations[personalizationKey].name = personalizationName;\n\n const setAppDefault = updatePersonalization!(personalizationKey, {\n markAsAppDefault: true,\n // @ts-expect-error name is added twice. Check this.\n name: personalizationName,\n ...personalization.allPersonalizations[personalizationKey]\n });\n const viewName = personalization.allPersonalizations[personalizationKey].name;\n\n setAppDefault.then(() => {\n dispatch(\n actionNotificationAdd({\n content: `'${viewName}' view is marked as App Default`\n })\n );\n });\n}\n\nfunction personalizationCreation(\n { getRsProps, dispatch }: BeforeRenderFeatureProps,\n payload: PersonalizationCreateAction['payload'],\n personalization: Personalization\n) {\n const { personalizationKey, markAsDefault } = payload;\n const rsProps = getRsProps();\n const viewName = personalization.allPersonalizations[personalizationKey].name;\n rsProps.apiContext.createPersonalization!(personalizationKey, {\n markAsDefault,\n ...personalization.allPersonalizations[personalizationKey]\n }).then(response => {\n const actualPersonalizationKey = (response as { data: string }).data || (response as string);\n\n if (actualPersonalizationKey !== personalizationKey) {\n dispatch(actionPersonalizationUpdateId(personalizationKey, actualPersonalizationKey));\n }\n dispatch(\n actionNotificationAdd({\n content: `Created view '${viewName}'${markAsDefault ? ' and marked as default view' : ''}`\n })\n );\n });\n}\n\nfunction personalizationDeletion(\n { getRsProps, dispatch }: BeforeRenderFeatureProps,\n payload: PersonalizationDeleteAction['payload'],\n personalization: Personalization\n) {\n const { personalizationKey, deletePresetPersonalizations } = payload;\n const rsProps = getRsProps();\n const viewName = personalization.lastDeletedPersonalization!.name;\n rsProps.apiContext.deletePersonalization!(personalizationKey).then(() => {\n if (!deletePresetPersonalizations) {\n dispatch(\n actionNotificationAdd({\n content: `Deleted view '${viewName}'`\n })\n );\n }\n });\n}\n\nfunction syncPersonalization(featureProps: BeforeRenderFeatureProps) {\n const { getState, queuedActions } = featureProps;\n const personalizationActions = [\n ActionTypes.PERSONALIZATION_UPDATE,\n ActionTypes.PERSONALIZATION_EDIT,\n ActionTypes.PERSONALIZATION_SET_DEFAULT,\n ActionTypes.PERSONALIZATION_SET_APP_DEFAULT,\n ActionTypes.PERSONALIZATION_CREATE,\n ActionTypes.PERSONALIZATION_DELETE,\n ActionTypes.PERSONALIZATION_UPDATE_PRESET_ID\n ];\n const actionTypes = queuedActions.map(a => a.type);\n const personalizationAction = personalizationActions.find(a => actionTypes.includes(a));\n if (personalizationAction) {\n const actionDispatched = queuedActions.find(a => a.type === personalizationAction)!;\n const { personalization } = getState();\n switch (personalizationAction) {\n case ActionTypes.PERSONALIZATION_EDIT:\n case ActionTypes.PERSONALIZATION_UPDATE:\n personalizationUpdate(\n featureProps,\n (actionDispatched as PersonalizationEditAction | PersonalizationUpdateAction).payload,\n personalization!\n );\n break;\n case ActionTypes.PERSONALIZATION_SET_DEFAULT:\n personalizationSetDefault(\n featureProps,\n (actionDispatched as PersonalizationSetDefaultAction).payload,\n personalization!\n );\n break;\n case ActionTypes.PERSONALIZATION_SET_APP_DEFAULT:\n personalizationSetAppDefault(\n featureProps,\n (actionDispatched as PersonalizationSetAppDefaultAction).payload,\n personalization!\n );\n break;\n case ActionTypes.PERSONALIZATION_CREATE:\n personalizationCreation(\n featureProps,\n (actionDispatched as PersonalizationCreateAction).payload,\n personalization!\n );\n break;\n case ActionTypes.PERSONALIZATION_DELETE:\n personalizationDeletion(\n featureProps,\n (actionDispatched as PersonalizationDeleteAction).payload,\n personalization!\n );\n break;\n case ActionTypes.PERSONALIZATION_UPDATE_PRESET_ID:\n personalizationUpdatePresetId(\n featureProps,\n (actionDispatched as PersonalizationUpdatePresetIdAction).payload,\n personalization!\n );\n break;\n default:\n break;\n }\n }\n}\n\nfunction sanitizingPersonalisations(\n { getRsStore, dispatch }: BeforeRenderFeatureProps,\n { allPersonalizations }: PersonalizationResponse,\n presets: Record<string, PersonalizationInfo>\n) {\n const rsStore = getRsStore();\n if (!allPersonalizations) return;\n Object.keys(allPersonalizations).forEach(key => {\n const { personalizationState } = allPersonalizations[key];\n const defaultPresetId = rsStore.presets[defaultPresetIdIndex].id;\n\n const { template } = presets[defaultPresetId!];\n\n if (!personalizationState.presetId && personalizationState.template === template) {\n // to support existing created personalizations(backward compatibility)\n personalizationState.presetId = defaultPresetId;\n personalizationState.template = 'Table';\n } else if (\n !presets[personalizationState.presetId!] ||\n personalizationState.template !== presets[personalizationState.presetId!].template\n ) {\n if (personalizationState.presetId === 'nonPersonalizationViewKey') {\n dispatch(\n actionPersonalizationUpdatePresetId(key, 'nonPersonalizationViewKey', defaultPresetId!)\n );\n } else {\n // Remove the personalizations of the deleted presets\n dispatch(actionPersonalizationDelete(key, true));\n }\n }\n });\n}\n\nconst defaultPersonalization = (\n personalizationWithPreset: PersonalizationResponse,\n defaultPresetId: string\n) => {\n if (\n personalizationWithPreset.allPersonalizations[personalizationWithPreset.defaultPersonalization]\n ) {\n return personalizationWithPreset.defaultPersonalization;\n // eslint-disable-next-line no-else-return\n } else if (personalizationWithPreset.allPersonalizations.APP_DEFAULT) {\n return 'APP_DEFAULT';\n } else {\n return defaultPresetId;\n }\n};\n\nfunction getPersonalizationsAction(\n { dispatch }: BeforeRenderFeatureProps,\n personalizationWithPreset: PersonalizationResponse,\n defaultPresetId: string\n) {\n dispatch(\n // @ts-expect-error Check this after full migration. There is incompatibility b/w Personalization response and Personalization state\n actionGetPersonalizations({\n ...personalizationWithPreset,\n defaultPersonalization: defaultPersonalization(personalizationWithPreset, defaultPresetId)\n })\n );\n}\n\nfunction execute(featureProps: BeforeRenderFeatureProps) {\n const { getView, getRsStore, getRsProps, dispatch } = featureProps;\n const rsStore = getRsStore();\n const rsProps = getRsProps();\n if (\n !getView().meta.personalization &&\n (!rsStore.presets || Object.keys(rsStore.presets).length === 0)\n ) {\n // return as personalization is disabled and presets do not exist so no need to fetch to see which preset is default\n return null;\n }\n // i want to get called before mount and also only once\n if (!rsStore.personalizationDone) {\n if (typeof rsProps.apiContext.fetchPersonalizations !== 'function') {\n // eslint-disable-next-line no-console\n console.warn(\n 'Return type of apiContext.fetchPersonalization is',\n JSON.stringify(\n {\n defaultPersonalization: 'b5f5c4f3-fdf8-496c-9f99-9e2e7d296e0a',\n allPersonalizations: {\n 'b5f5c4f3-fdf8-496c-9f99-9e2e7d296e0a': {\n name: 'Personalized state view',\n personalizationState: {\n version: 'v1',\n showHeaderIcons: true,\n columnWidths: { 'Sl.No.': 93 },\n customFields: [],\n sortingOrder: [{ columnId: 'ID', order: 'desc', sequence: 1 }],\n groups: [],\n hiddenColumns: ['Product ID'],\n selectedHeightOption: '1',\n aggregationInfo: [],\n template: 'Table',\n presetId: 'P_1599825360427'\n }\n }\n }\n },\n null,\n 4\n )\n );\n throw Error(\n 'apiContext.fetchPersonalizations method should be a function which should return personalizations information (check above warning for response structure).'\n );\n }\n // i need the middleware to wait until i finish my job\n return rsProps.apiContext\n .fetchPersonalizations()\n .then(personalization => {\n const personalizationFetched = personalization || {\n defaultPersonalization: rsStore.presets[0].id,\n allPersonalizations: {}\n };\n\n // This is done to remove empty object which got saved while setting preset as default.\n removeEmptyValuesFromObject(personalizationFetched.allPersonalizations);\n\n const defaultPresetId = rsStore.presets[defaultPresetIdIndex].id;\n\n // Creating personalization from preset.\n const presetsPersonalizations =\n rsStore.presets?.reduce<Record<string, PersonalizationInfo>>((acc, p) => {\n acc[p.id] = {\n title: p.title,\n name: p.name,\n template: p.template,\n isPreset: true,\n personalizationState: {},\n isDefaultPreset: defaultPresetId === p.id\n };\n return acc;\n }, {}) || {};\n\n // sanitizing personalisations where there is no preset exists\n sanitizingPersonalisations(featureProps, personalizationFetched, presetsPersonalizations);\n\n const personalizationWithPreset = {\n ...personalizationFetched,\n allPersonalizations: {\n ...presetsPersonalizations,\n ...(getView().meta.personalization ? personalizationFetched.allPersonalizations : {})\n }\n };\n\n // if grouping is not enabled based on some factors, remove grouping programatically from personalizations\n if (!getView().meta.grouping) {\n Object.values(personalizationWithPreset.allPersonalizations).forEach(p => {\n if (p.personalizationState?.groups?.length) {\n p.personalizationState.groups = [];\n }\n });\n }\n\n // dispatch the get personalization action\n getPersonalizationsAction(\n featureProps,\n personalizationWithPreset,\n rsStore.presets[defaultPresetIdIndex].id\n );\n })\n .catch(error => {\n getView().meta.personalization = false;\n rsStore.meta.personalization = false;\n const errMessage = `Error Fetching personalizations ${error}`;\n // eslint-disable-next-line no-console\n console.error(errMessage);\n dispatch(\n actionNotificationAdd({\n content: errMessage\n })\n );\n\n // eslint-disable-next-line no-console\n console.warn(\n 'Return type of apiContext.fetchPersonalization is',\n JSON.stringify(\n {\n defaultPersonalization: 'b5f5c4f3-fdf8-496c-9f99-9e2e7d296e0a',\n allPersonalizations: {\n 'b5f5c4f3-fdf8-496c-9f99-9e2e7d296e0a': {\n name: 'Personalized state view',\n personalizationState: {\n version: 'v1',\n showHeaderIcons: true,\n columnWidths: { 'Sl.No.': 93 },\n customFields: [],\n sortingOrder: [{ columnId: 'ID', order: 'desc', sequence: 1 }],\n groups: [],\n hiddenColumns: ['Product ID'],\n selectedHeightOption: '1',\n aggregationInfo: [],\n template: 'Table',\n presetId: 'P_1599825360427'\n }\n }\n }\n },\n null,\n 4\n )\n );\n })\n .finally(() => {\n rsStore.personalizationDone = true;\n });\n }\n\n syncPersonalization(featureProps);\n return undefined;\n}\n\n/**\n * Handles the CRUD operations for the personalization feature in RS. It manages the following personalization actions and invokes the corresponding APIs to communicate personalization data:\n * - {@link ActionTypes.PERSONALIZATION_UPDATE}\n * - {@link ActionTypes.PERSONALIZATION_EDIT}\n * - {@link ActionTypes.PERSONALIZATION_SET_DEFAULT}\n * - {@link ActionTypes.PERSONALIZATION_SET_APP_DEFAULT}\n * - {@link ActionTypes.PERSONALIZATION_CREATE}\n * - {@link ActionTypes.PERSONALIZATION_DELETE}\n * - {@link ActionTypes.PERSONALIZATION_UPDATE_PRESET_ID}\n */\nexport default (rsInternal: RsInternal) => {\n if (!rsInternal.getView().meta.personalization) {\n rsInternal.getRsProps().apiContext.fetchPersonalizations = () =>\n Promise.resolve({} as PersonalizationResponse);\n }\n\n return execute;\n};\n"]}
@@ -0,0 +1,7 @@
1
+ import type RsInternal from '../../../RsInternal';
2
+ /**
3
+ * Prepares {@link View.columns columns} for the view from {@link Meta.fieldDefs fieldDefs}.
4
+ */
5
+ declare const _default: (rsInternal: RsInternal) => () => void;
6
+ export default _default;
7
+ //# sourceMappingURL=prepareColumns.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepareColumns.d.ts","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/prepareColumns.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AAsFlD;;GAEG;qCACyB,UAAU;AAAtC,wBAOE"}
@@ -0,0 +1,59 @@
1
+ import { isRowErrorFieldEnabled, isRowReorderFieldEnabled, withMemoization } from '../../../utils/util';
2
+ import Column from '../../../generators/ColumnGenerator';
3
+ import { rowActionColumnMeta, rowDragDropColumnMeta, rowErrorColumnMeta, rowSelectColumnMeta, SELECTION_MODES, TEMPLATES } from '../../../constants';
4
+ const addFrozenColumnAtIndex = (rsInternal, field, options, index) => {
5
+ const { getView, getRsStateResolver } = rsInternal;
6
+ const { getState } = getRsStateResolver();
7
+ getView().addColumnAtIndex(
8
+ // error column initially should be hidden and will be displayed only when there are errors in state, unless consumer needs to display it on load.
9
+ field, options, index);
10
+ if (!getState().freezeColumns?.includes(field.id)) {
11
+ getView().columns[index].applyFreezeAtIndex(index);
12
+ }
13
+ };
14
+ const prepareOOTBColumns = ([rsInternal]) => {
15
+ const { getView } = rsInternal;
16
+ let ootColumnsIndex = 0;
17
+ // Add error column.
18
+ if (isRowErrorFieldEnabled(getView().meta)) {
19
+ addFrozenColumnAtIndex(rsInternal,
20
+ // Error column is added as a hidden column. Toggles based on state.errors.dataErrors
21
+ { ...rowErrorColumnMeta.field, show: getView().meta.rowErrorField?.show ?? false }, rowErrorColumnMeta.options, ootColumnsIndex);
22
+ ootColumnsIndex += 1;
23
+ }
24
+ // Add row drag drop column.
25
+ if (isRowReorderFieldEnabled(getView().meta)) {
26
+ addFrozenColumnAtIndex(rsInternal, { ...rowDragDropColumnMeta.field, show: getView().meta.rowReorderField?.show ?? true }, rowDragDropColumnMeta.options, ootColumnsIndex);
27
+ ootColumnsIndex += 1;
28
+ }
29
+ // Add selection column.
30
+ const { template, selectionMode } = getView().meta;
31
+ if (selectionMode &&
32
+ SELECTION_MODES[selectionMode] &&
33
+ !(template === TEMPLATES.GALLERY && selectionMode === SELECTION_MODES.multi_on_hover) &&
34
+ template !== TEMPLATES.TIMELINE) {
35
+ addFrozenColumnAtIndex(rsInternal, rowSelectColumnMeta.field, rowSelectColumnMeta.options, ootColumnsIndex);
36
+ }
37
+ // Add row action column.
38
+ if (getView().meta.editing || getView().meta.deleting) {
39
+ getView().addColumn(rowActionColumnMeta.field, rowActionColumnMeta.options);
40
+ }
41
+ };
42
+ function prepareColumns([rsInternal]) {
43
+ const columns = rsInternal
44
+ .getView()
45
+ .meta.fieldDefs.map(f => new Column({ field: f }, rsInternal));
46
+ rsInternal.getView().columns = columns;
47
+ }
48
+ /**
49
+ * Prepares {@link View.columns columns} for the view from {@link Meta.fieldDefs fieldDefs}.
50
+ */
51
+ export default (rsInternal) => {
52
+ const memoizedPrepareColumns = withMemoization(prepareColumns);
53
+ const memoizedPrepareOOTBColumns = withMemoization(prepareOOTBColumns);
54
+ return function execute() {
55
+ memoizedPrepareColumns([rsInternal], [rsInternal.getView().meta.fieldDefs]);
56
+ memoizedPrepareOOTBColumns([rsInternal], [rsInternal.getView().meta]);
57
+ };
58
+ };
59
+ //# sourceMappingURL=prepareColumns.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepareColumns.js","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/prepareColumns.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,eAAe,EAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,MAAM,MAAM,qCAAqC,CAAC;AAKzD,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,SAAS,EACV,MAAM,oBAAoB,CAAC;AAG5B,MAAM,sBAAsB,GAAG,CAC7B,UAAsB,EACtB,KAAe,EACf,OAA0C,EAC1C,KAAa,EACb,EAAE;IACF,MAAM,EAAE,OAAO,EAAE,kBAAkB,EAAE,GAAG,UAAU,CAAC;IACnD,MAAM,EAAE,QAAQ,EAAE,GAAG,kBAAkB,EAAE,CAAC;IAC1C,OAAO,EAAE,CAAC,gBAAgB;IACxB,kJAAkJ;IAClJ,KAAK,EACL,OAAO,EACP,KAAK,CACN,CAAC;IACF,IAAI,CAAC,QAAQ,EAAE,CAAC,aAAa,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;QAClD,OAAO,EAAE,CAAC,OAAQ,CAAC,KAAK,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACtD,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,CAAC,UAAU,CAA2B,EAAE,EAAE;IACpE,MAAM,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC;IAC/B,IAAI,eAAe,GAAG,CAAC,CAAC;IACxB,oBAAoB;IACpB,IAAI,sBAAsB,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;Q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AAc,CAAC,CAAC,UAAU,CAA2B;IAC5D,MAAM,OAAO,GAAG,UAAU;SACvB,OAAO,EAAE;SACT,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC;IACjE,UAAU,CAAC,OAAO,EAAE,CAAC,OAAO,GAAG,OAAO,CAAC;AACzC,CAAC;AAED;;GAEG;AACH,eAAe,CAAC,UAAsB,EAAE,EAAE;IACxC,MAAM,sBAAsB,GAAG,eAAe,CAAC,cAAc,CAAC,CAAC;IAC/D,MAAM,0BAA0B,GAAG,eAAe,CAAC,kBAAkB,CAAC,CAAC;IACvE,OAAO,SAAS,OAAO;QACrB,sBAAsB,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;QAC5E,0BAA0B,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IACxE,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { OmitStrict } from '@pega/cosmos-react-core';\n\nimport {\n isRowErrorFieldEnabled,\n isRowReorderFieldEnabled,\n withMemoization\n} from '../../../utils/util';\nimport Column from '../../../generators/ColumnGenerator';\nimport type RsInternal from '../../../RsInternal';\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport type View from '../../../generators/ViewGenerator';\nimport type { FieldDef, Meta } from '../../../../../types/Meta.types';\nimport {\n rowActionColumnMeta,\n rowDragDropColumnMeta,\n rowErrorColumnMeta,\n rowSelectColumnMeta,\n SELECTION_MODES,\n TEMPLATES\n} from '../../../constants';\nimport type { ColumnConfig } from '../../../generators/ColumnGenerator.types';\n\nconst addFrozenColumnAtIndex = (\n rsInternal: RsInternal,\n field: FieldDef,\n options: OmitStrict<ColumnConfig, 'field'>,\n index: number\n) => {\n const { getView, getRsStateResolver } = rsInternal;\n const { getState } = getRsStateResolver();\n getView().addColumnAtIndex(\n // error column initially should be hidden and will be displayed only when there are errors in state, unless consumer needs to display it on load.\n field,\n options,\n index\n );\n if (!getState().freezeColumns?.includes(field.id)) {\n getView().columns![index].applyFreezeAtIndex(index);\n }\n};\n\nconst prepareOOTBColumns = ([rsInternal]: [rsInternal: RsInternal]) => {\n const { getView } = rsInternal;\n let ootColumnsIndex = 0;\n // Add error column.\n if (isRowErrorFieldEnabled(getView().meta)) {\n addFrozenColumnAtIndex(\n rsInternal,\n // Error column is added as a hidden column. Toggles based on state.errors.dataErrors\n { ...rowErrorColumnMeta.field, show: getView().meta.rowErrorField?.show ?? false },\n rowErrorColumnMeta.options,\n ootColumnsIndex\n );\n ootColumnsIndex += 1;\n }\n // Add row drag drop column.\n if (isRowReorderFieldEnabled(getView().meta)) {\n addFrozenColumnAtIndex(\n rsInternal,\n { ...rowDragDropColumnMeta.field, show: getView().meta.rowReorderField?.show ?? true },\n rowDragDropColumnMeta.options,\n ootColumnsIndex\n );\n ootColumnsIndex += 1;\n }\n // Add selection column.\n const { template, selectionMode } = getView().meta;\n if (\n selectionMode &&\n SELECTION_MODES[selectionMode] &&\n !(template === TEMPLATES.GALLERY && selectionMode === SELECTION_MODES.multi_on_hover) &&\n template !== TEMPLATES.TIMELINE\n ) {\n addFrozenColumnAtIndex(\n rsInternal,\n rowSelectColumnMeta.field,\n rowSelectColumnMeta.options,\n ootColumnsIndex\n );\n }\n\n // Add row action column.\n if (getView().meta.editing || getView().meta.deleting) {\n getView().addColumn(rowActionColumnMeta.field, rowActionColumnMeta.options);\n }\n};\n\nfunction prepareColumns([rsInternal]: [rsInternal: RsInternal]) {\n const columns = rsInternal\n .getView()\n .meta.fieldDefs.map(f => new Column({ field: f }, rsInternal));\n rsInternal.getView().columns = columns;\n}\n\n/**\n * Prepares {@link View.columns columns} for the view from {@link Meta.fieldDefs fieldDefs}.\n */\nexport default (rsInternal: RsInternal) => {\n const memoizedPrepareColumns = withMemoization(prepareColumns);\n const memoizedPrepareOOTBColumns = withMemoization(prepareOOTBColumns);\n return function execute() {\n memoizedPrepareColumns([rsInternal], [rsInternal.getView().meta.fieldDefs]);\n memoizedPrepareOOTBColumns([rsInternal], [rsInternal.getView().meta]);\n };\n};\n"]}
@@ -0,0 +1,7 @@
1
+ import type RsInternal from '../../../RsInternal';
2
+ /**
3
+ * Prepare {@link View.rows rows} for the view from view {@link View.data data}. This is triggered on publish of `AFTER_FETCH` event.
4
+ */
5
+ declare const _default: (rsInternal: RsInternal) => void;
6
+ export default _default;
7
+ //# sourceMappingURL=prepareRows.d.ts.map