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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (277) hide show
  1. package/lib/index.d.ts +3 -2
  2. package/lib/index.d.ts.map +1 -1
  3. package/lib/index.js +3 -2
  4. package/lib/index.js.map +1 -1
  5. package/lib/src/core/RsCore.d.ts +1 -1
  6. package/lib/src/core/RsCore.js +1 -1
  7. package/lib/src/core/RsCore.js.map +1 -1
  8. package/lib/src/core/RsInternal.d.ts +23 -0
  9. package/lib/src/core/RsInternal.d.ts.map +1 -1
  10. package/lib/src/core/RsInternal.js +18 -2
  11. package/lib/src/core/RsInternal.js.map +1 -1
  12. package/lib/src/core/RsProps.d.ts +0 -7
  13. package/lib/src/core/RsProps.d.ts.map +1 -1
  14. package/lib/src/core/RsProps.js +0 -7
  15. package/lib/src/core/RsProps.js.map +1 -1
  16. package/lib/src/core/RsStore.d.ts +5 -1
  17. package/lib/src/core/RsStore.d.ts.map +1 -1
  18. package/lib/src/core/RsStore.js +12 -0
  19. package/lib/src/core/RsStore.js.map +1 -1
  20. package/lib/src/core/StateResolver.d.ts +0 -1
  21. package/lib/src/core/StateResolver.d.ts.map +1 -1
  22. package/lib/src/core/StateResolver.js +19 -9
  23. package/lib/src/core/StateResolver.js.map +1 -1
  24. package/lib/src/core/a11y/BaseA11y.d.ts +25 -6
  25. package/lib/src/core/a11y/BaseA11y.d.ts.map +1 -1
  26. package/lib/src/core/a11y/BaseA11y.js +39 -8
  27. package/lib/src/core/a11y/BaseA11y.js.map +1 -1
  28. package/lib/src/core/actions/actionConstants.d.ts +7 -4
  29. package/lib/src/core/actions/actionConstants.d.ts.map +1 -1
  30. package/lib/src/core/actions/actionConstants.js +8 -5
  31. package/lib/src/core/actions/actionConstants.js.map +1 -1
  32. package/lib/src/core/actions/actions.d.ts +35 -34
  33. package/lib/src/core/actions/actions.d.ts.map +1 -1
  34. package/lib/src/core/actions/actions.js +47 -40
  35. package/lib/src/core/actions/actions.js.map +1 -1
  36. package/lib/src/core/actions/actions.types.d.ts +34 -27
  37. package/lib/src/core/actions/actions.types.d.ts.map +1 -1
  38. package/lib/src/core/actions/actions.types.js.map +1 -1
  39. package/lib/src/core/config/config.d.ts +1 -1
  40. package/lib/src/core/config/config.d.ts.map +1 -1
  41. package/lib/src/core/config/config.js +5 -2
  42. package/lib/src/core/config/config.js.map +1 -1
  43. package/lib/src/core/constants.d.ts +4 -0
  44. package/lib/src/core/constants.d.ts.map +1 -1
  45. package/lib/src/core/constants.js +22 -5
  46. package/lib/src/core/constants.js.map +1 -1
  47. package/lib/src/core/defaultTranslations.d.ts +6 -1
  48. package/lib/src/core/defaultTranslations.d.ts.map +1 -1
  49. package/lib/src/core/defaultTranslations.js +6 -1
  50. package/lib/src/core/defaultTranslations.js.map +1 -1
  51. package/lib/src/core/features/featureFactory.d.ts +6 -2
  52. package/lib/src/core/features/featureFactory.d.ts.map +1 -1
  53. package/lib/src/core/features/featureFactory.js +9 -8
  54. package/lib/src/core/features/featureFactory.js.map +1 -1
  55. package/lib/src/core/features/uIFeatures/afterRender/animation.d.ts.map +1 -1
  56. package/lib/src/core/features/uIFeatures/afterRender/animation.js +11 -2
  57. package/lib/src/core/features/uIFeatures/afterRender/animation.js.map +1 -1
  58. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/autoSize.d.ts +2 -16
  59. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/autoSize.d.ts.map +1 -1
  60. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/autoSize.js +48 -89
  61. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/autoSize.js.map +1 -1
  62. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/index.d.ts +3 -4
  63. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/index.d.ts.map +1 -1
  64. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/index.js +83 -45
  65. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/index.js.map +1 -1
  66. package/lib/src/core/features/uIFeatures/afterRender/customizeParentContainer/index.d.ts.map +1 -1
  67. package/lib/src/core/features/uIFeatures/afterRender/customizeParentContainer/index.js +2 -2
  68. package/lib/src/core/features/uIFeatures/afterRender/customizeParentContainer/index.js.map +1 -1
  69. package/lib/src/core/features/uIFeatures/beforeRender/adjustHeight.d.ts +4 -1
  70. package/lib/src/core/features/uIFeatures/beforeRender/adjustHeight.d.ts.map +1 -1
  71. package/lib/src/core/features/uIFeatures/beforeRender/adjustHeight.js +15 -14
  72. package/lib/src/core/features/uIFeatures/beforeRender/adjustHeight.js.map +1 -1
  73. package/lib/src/core/features/uIFeatures/beforeRender/adjustHeightToFitRecords.d.ts.map +1 -1
  74. package/lib/src/core/features/uIFeatures/beforeRender/adjustHeightToFitRecords.js +10 -2
  75. package/lib/src/core/features/uIFeatures/beforeRender/adjustHeightToFitRecords.js.map +1 -1
  76. package/lib/src/core/features/uIFeatures/beforeRender/aggregation.d.ts +1 -1
  77. package/lib/src/core/features/uIFeatures/beforeRender/aggregation.js +2 -2
  78. package/lib/src/core/features/uIFeatures/beforeRender/aggregation.js.map +1 -1
  79. package/lib/src/core/features/uIFeatures/beforeRender/animation.d.ts +1 -1
  80. package/lib/src/core/features/uIFeatures/beforeRender/animation.d.ts.map +1 -1
  81. package/lib/src/core/features/uIFeatures/beforeRender/animation.js +5 -4
  82. package/lib/src/core/features/uIFeatures/beforeRender/animation.js.map +1 -1
  83. package/lib/src/core/features/uIFeatures/beforeRender/busyIndicator.d.ts +1 -1
  84. package/lib/src/core/features/uIFeatures/beforeRender/busyIndicator.js +2 -2
  85. package/lib/src/core/features/uIFeatures/beforeRender/busyIndicator.js.map +1 -1
  86. package/lib/src/core/features/uIFeatures/beforeRender/changePersonalisation.js +1 -1
  87. package/lib/src/core/features/uIFeatures/beforeRender/changePersonalisation.js.map +1 -1
  88. package/lib/src/core/features/uIFeatures/beforeRender/changeTemplate.d.ts +13 -0
  89. package/lib/src/core/features/uIFeatures/beforeRender/changeTemplate.d.ts.map +1 -0
  90. package/lib/src/core/features/uIFeatures/beforeRender/changeTemplate.js +40 -0
  91. package/lib/src/core/features/uIFeatures/beforeRender/changeTemplate.js.map +1 -0
  92. package/lib/src/core/features/uIFeatures/beforeRender/columnAlias.d.ts +2 -0
  93. package/lib/src/core/features/uIFeatures/beforeRender/columnAlias.d.ts.map +1 -1
  94. package/lib/src/core/features/uIFeatures/beforeRender/columnAlias.js +14 -1
  95. package/lib/src/core/features/uIFeatures/beforeRender/columnAlias.js.map +1 -1
  96. package/lib/src/core/features/uIFeatures/beforeRender/columnFormatter.d.ts.map +1 -1
  97. package/lib/src/core/features/uIFeatures/beforeRender/columnFormatter.js +7 -5
  98. package/lib/src/core/features/uIFeatures/beforeRender/columnFormatter.js.map +1 -1
  99. package/lib/src/core/features/uIFeatures/beforeRender/columnOrder.d.ts.map +1 -1
  100. package/lib/src/core/features/uIFeatures/beforeRender/columnOrder.js +13 -5
  101. package/lib/src/core/features/uIFeatures/beforeRender/columnOrder.js.map +1 -1
  102. package/lib/src/core/features/uIFeatures/beforeRender/columnReOrder.d.ts +1 -1
  103. package/lib/src/core/features/uIFeatures/beforeRender/columnReOrder.d.ts.map +1 -1
  104. package/lib/src/core/features/uIFeatures/beforeRender/columnReOrder.js +20 -17
  105. package/lib/src/core/features/uIFeatures/beforeRender/columnReOrder.js.map +1 -1
  106. package/lib/src/core/features/uIFeatures/beforeRender/columnSizing/resize.d.ts +2 -4
  107. package/lib/src/core/features/uIFeatures/beforeRender/columnSizing/resize.d.ts.map +1 -1
  108. package/lib/src/core/features/uIFeatures/beforeRender/columnSizing/resize.js +61 -40
  109. package/lib/src/core/features/uIFeatures/beforeRender/columnSizing/resize.js.map +1 -1
  110. package/lib/src/core/features/uIFeatures/beforeRender/columnSort.d.ts.map +1 -1
  111. package/lib/src/core/features/uIFeatures/beforeRender/columnSort.js +1 -1
  112. package/lib/src/core/features/uIFeatures/beforeRender/columnSort.js.map +1 -1
  113. package/lib/src/core/features/uIFeatures/beforeRender/columnToggle.d.ts +2 -2
  114. package/lib/src/core/features/uIFeatures/beforeRender/columnToggle.d.ts.map +1 -1
  115. package/lib/src/core/features/uIFeatures/beforeRender/columnToggle.js +10 -5
  116. package/lib/src/core/features/uIFeatures/beforeRender/columnToggle.js.map +1 -1
  117. package/lib/src/core/features/uIFeatures/beforeRender/columnVisualOrder.d.ts +1 -1
  118. package/lib/src/core/features/uIFeatures/beforeRender/columnVisualOrder.js +4 -4
  119. package/lib/src/core/features/uIFeatures/beforeRender/columnVisualOrder.js.map +1 -1
  120. package/lib/src/core/features/uIFeatures/beforeRender/conditionalStyleFormat.d.ts.map +1 -1
  121. package/lib/src/core/features/uIFeatures/beforeRender/conditionalStyleFormat.js +9 -8
  122. package/lib/src/core/features/uIFeatures/beforeRender/conditionalStyleFormat.js.map +1 -1
  123. package/lib/src/core/features/uIFeatures/beforeRender/customColumn.d.ts +1 -1
  124. package/lib/src/core/features/uIFeatures/beforeRender/customColumn.d.ts.map +1 -1
  125. package/lib/src/core/features/uIFeatures/beforeRender/customColumn.js +22 -8
  126. package/lib/src/core/features/uIFeatures/beforeRender/customColumn.js.map +1 -1
  127. package/lib/src/core/features/uIFeatures/beforeRender/errorColumn.d.ts.map +1 -1
  128. package/lib/src/core/features/uIFeatures/beforeRender/errorColumn.js +9 -6
  129. package/lib/src/core/features/uIFeatures/beforeRender/errorColumn.js.map +1 -1
  130. package/lib/src/core/features/uIFeatures/beforeRender/filter.d.ts +1 -0
  131. package/lib/src/core/features/uIFeatures/beforeRender/filter.d.ts.map +1 -1
  132. package/lib/src/core/features/uIFeatures/beforeRender/filter.js +13 -3
  133. package/lib/src/core/features/uIFeatures/beforeRender/filter.js.map +1 -1
  134. package/lib/src/core/features/uIFeatures/beforeRender/freeze.d.ts +2 -2
  135. package/lib/src/core/features/uIFeatures/beforeRender/freeze.d.ts.map +1 -1
  136. package/lib/src/core/features/uIFeatures/beforeRender/freeze.js +14 -9
  137. package/lib/src/core/features/uIFeatures/beforeRender/freeze.js.map +1 -1
  138. package/lib/src/core/features/uIFeatures/beforeRender/grouping.d.ts.map +1 -1
  139. package/lib/src/core/features/uIFeatures/beforeRender/grouping.js +23 -24
  140. package/lib/src/core/features/uIFeatures/beforeRender/grouping.js.map +1 -1
  141. package/lib/src/core/features/uIFeatures/beforeRender/prepareColumns.d.ts +32 -1
  142. package/lib/src/core/features/uIFeatures/beforeRender/prepareColumns.d.ts.map +1 -1
  143. package/lib/src/core/features/uIFeatures/beforeRender/prepareColumns.js +128 -32
  144. package/lib/src/core/features/uIFeatures/beforeRender/prepareColumns.js.map +1 -1
  145. package/lib/src/core/features/uIFeatures/beforeRender/prepareRows.d.ts.map +1 -1
  146. package/lib/src/core/features/uIFeatures/beforeRender/prepareRows.js +4 -4
  147. package/lib/src/core/features/uIFeatures/beforeRender/prepareRows.js.map +1 -1
  148. package/lib/src/core/features/uIFeatures/beforeRender/rowDragDrop.d.ts.map +1 -1
  149. package/lib/src/core/features/uIFeatures/beforeRender/rowDragDrop.js +14 -10
  150. package/lib/src/core/features/uIFeatures/beforeRender/rowDragDrop.js.map +1 -1
  151. package/lib/src/core/features/uIFeatures/beforeRender/stateHydration.d.ts +16 -4
  152. package/lib/src/core/features/uIFeatures/beforeRender/stateHydration.d.ts.map +1 -1
  153. package/lib/src/core/features/uIFeatures/beforeRender/stateHydration.js +124 -72
  154. package/lib/src/core/features/uIFeatures/beforeRender/stateHydration.js.map +1 -1
  155. package/lib/src/core/features/uIFeatures/beforeRender/stateSanitization.d.ts +2 -2
  156. package/lib/src/core/features/uIFeatures/beforeRender/stateSanitization.d.ts.map +1 -1
  157. package/lib/src/core/features/uIFeatures/beforeRender/stateSanitization.js +116 -37
  158. package/lib/src/core/features/uIFeatures/beforeRender/stateSanitization.js.map +1 -1
  159. package/lib/src/core/features/uIFeatures/index.d.ts +2 -3
  160. package/lib/src/core/features/uIFeatures/index.d.ts.map +1 -1
  161. package/lib/src/core/features/uIFeatures/index.js +2 -4
  162. package/lib/src/core/features/uIFeatures/index.js.map +1 -1
  163. package/lib/src/core/generators/ColumnGenerator.d.ts +15 -21
  164. package/lib/src/core/generators/ColumnGenerator.d.ts.map +1 -1
  165. package/lib/src/core/generators/ColumnGenerator.js +32 -95
  166. package/lib/src/core/generators/ColumnGenerator.js.map +1 -1
  167. package/lib/src/core/generators/ColumnGenerator.types.d.ts +16 -13
  168. package/lib/src/core/generators/ColumnGenerator.types.d.ts.map +1 -1
  169. package/lib/src/core/generators/ColumnGenerator.types.js.map +1 -1
  170. package/lib/src/core/generators/GroupGenerator.d.ts +5 -1
  171. package/lib/src/core/generators/GroupGenerator.d.ts.map +1 -1
  172. package/lib/src/core/generators/GroupGenerator.js +20 -0
  173. package/lib/src/core/generators/GroupGenerator.js.map +1 -1
  174. package/lib/src/core/generators/RowGenerator.d.ts +2 -2
  175. package/lib/src/core/generators/RowGenerator.d.ts.map +1 -1
  176. package/lib/src/core/generators/RowGenerator.js +3 -4
  177. package/lib/src/core/generators/RowGenerator.js.map +1 -1
  178. package/lib/src/core/generators/RowGenerator.types.d.ts +2 -1
  179. package/lib/src/core/generators/RowGenerator.types.d.ts.map +1 -1
  180. package/lib/src/core/generators/RowGenerator.types.js.map +1 -1
  181. package/lib/src/core/generators/ViewGenerator.d.ts +42 -28
  182. package/lib/src/core/generators/ViewGenerator.d.ts.map +1 -1
  183. package/lib/src/core/generators/ViewGenerator.js +101 -61
  184. package/lib/src/core/generators/ViewGenerator.js.map +1 -1
  185. package/lib/src/core/generators/ViewGenerator.types.d.ts +13 -1
  186. package/lib/src/core/generators/ViewGenerator.types.d.ts.map +1 -1
  187. package/lib/src/core/generators/ViewGenerator.types.js.map +1 -1
  188. package/lib/src/core/generators/__tests__/viewUtilityMockSetup.d.ts +3 -0
  189. package/lib/src/core/generators/__tests__/viewUtilityMockSetup.d.ts.map +1 -1
  190. package/lib/src/core/generators/viewUtilityMethods.d.ts +23 -10
  191. package/lib/src/core/generators/viewUtilityMethods.d.ts.map +1 -1
  192. package/lib/src/core/generators/viewUtilityMethods.js +50 -11
  193. package/lib/src/core/generators/viewUtilityMethods.js.map +1 -1
  194. package/lib/src/core/index.d.ts.map +1 -1
  195. package/lib/src/core/index.js +1 -2
  196. package/lib/src/core/index.js.map +1 -1
  197. package/lib/src/core/reducers/changeTemplate.d.ts +5 -0
  198. package/lib/src/core/reducers/changeTemplate.d.ts.map +1 -0
  199. package/lib/src/core/reducers/changeTemplate.js +14 -0
  200. package/lib/src/core/reducers/changeTemplate.js.map +1 -0
  201. package/lib/src/core/reducers/dragDrop.d.ts.map +1 -1
  202. package/lib/src/core/reducers/dragDrop.js +5 -4
  203. package/lib/src/core/reducers/dragDrop.js.map +1 -1
  204. package/lib/src/core/reducers/error.d.ts +8 -4
  205. package/lib/src/core/reducers/error.d.ts.map +1 -1
  206. package/lib/src/core/reducers/{edit.d.ts → galleryView.d.ts} +1 -1
  207. package/lib/src/core/reducers/galleryView.d.ts.map +1 -0
  208. package/lib/src/core/reducers/galleryView.js +11 -0
  209. package/lib/src/core/reducers/galleryView.js.map +1 -0
  210. package/lib/src/core/reducers/grouping.d.ts.map +1 -1
  211. package/lib/src/core/reducers/grouping.js +7 -0
  212. package/lib/src/core/reducers/grouping.js.map +1 -1
  213. package/lib/src/core/reducers/index.d.ts +8 -4
  214. package/lib/src/core/reducers/index.d.ts.map +1 -1
  215. package/lib/src/core/reducers/index.js +5 -3
  216. package/lib/src/core/reducers/index.js.map +1 -1
  217. package/lib/src/core/reducers/personalizationDirtyReducer.d.ts.map +1 -1
  218. package/lib/src/core/reducers/personalizationDirtyReducer.js +8 -4
  219. package/lib/src/core/reducers/personalizationDirtyReducer.js.map +1 -1
  220. package/lib/src/core/reducers/personalizationReducer.d.ts +3 -2
  221. package/lib/src/core/reducers/personalizationReducer.d.ts.map +1 -1
  222. package/lib/src/core/reducers/personalizationReducer.js +12 -4
  223. package/lib/src/core/reducers/personalizationReducer.js.map +1 -1
  224. package/lib/src/core/reducers/renderFormatter.d.ts.map +1 -1
  225. package/lib/src/core/reducers/renderFormatter.js +13 -3
  226. package/lib/src/core/reducers/renderFormatter.js.map +1 -1
  227. package/lib/src/core/reducers/rowSelect.d.ts.map +1 -1
  228. package/lib/src/core/reducers/rowSelect.js +0 -8
  229. package/lib/src/core/reducers/rowSelect.js.map +1 -1
  230. package/lib/src/core/reducers/versioning/index.d.ts +1 -1
  231. package/lib/src/core/reducers/versioning/index.d.ts.map +1 -1
  232. package/lib/src/core/reducers/versioning/index.js +1 -1
  233. package/lib/src/core/reducers/versioning/index.js.map +1 -1
  234. package/lib/src/core/reducers/visibility.d.ts +2 -1
  235. package/lib/src/core/reducers/visibility.d.ts.map +1 -1
  236. package/lib/src/core/reducers/visibility.js +69 -19
  237. package/lib/src/core/reducers/visibility.js.map +1 -1
  238. package/lib/src/core/test/junitMocks.d.ts +1322 -0
  239. package/lib/src/core/test/junitMocks.d.ts.map +1 -1
  240. package/lib/src/core/test/junitMocks.js +32 -51
  241. package/lib/src/core/test/junitMocks.js.map +1 -1
  242. package/lib/src/core/utils/condition-utils.d.ts +1 -1
  243. package/lib/src/core/utils/condition-utils.d.ts.map +1 -1
  244. package/lib/src/core/utils/condition-utils.js +5 -3
  245. package/lib/src/core/utils/condition-utils.js.map +1 -1
  246. package/lib/src/core/utils/util.d.ts +58 -9
  247. package/lib/src/core/utils/util.d.ts.map +1 -1
  248. package/lib/src/core/utils/util.js +151 -18
  249. package/lib/src/core/utils/util.js.map +1 -1
  250. package/lib/types/ApiContext.types.d.ts +69 -7
  251. package/lib/types/ApiContext.types.d.ts.map +1 -1
  252. package/lib/types/ApiContext.types.js.map +1 -1
  253. package/lib/types/Meta.types.d.ts +153 -11
  254. package/lib/types/Meta.types.d.ts.map +1 -1
  255. package/lib/types/Meta.types.js +7 -1
  256. package/lib/types/Meta.types.js.map +1 -1
  257. package/lib/types/RsCoreBootArgs.types.d.ts +11 -13
  258. package/lib/types/RsCoreBootArgs.types.d.ts.map +1 -1
  259. package/lib/types/RsCoreBootArgs.types.js.map +1 -1
  260. package/lib/types/State.types.d.ts +32 -30
  261. package/lib/types/State.types.d.ts.map +1 -1
  262. package/lib/types/State.types.js.map +1 -1
  263. package/lib/types.d.ts +10 -2
  264. package/lib/types.d.ts.map +1 -1
  265. package/lib/types.js.map +1 -1
  266. package/package.json +6 -8
  267. package/lib/src/core/features/uIFeatures/beforeRender/edit.d.ts +0 -12
  268. package/lib/src/core/features/uIFeatures/beforeRender/edit.d.ts.map +0 -1
  269. package/lib/src/core/features/uIFeatures/beforeRender/edit.js +0 -94
  270. package/lib/src/core/features/uIFeatures/beforeRender/edit.js.map +0 -1
  271. package/lib/src/core/features/uIFeatures/beforeRender/toggleSelectAllCheckbox.d.ts +0 -12
  272. package/lib/src/core/features/uIFeatures/beforeRender/toggleSelectAllCheckbox.d.ts.map +0 -1
  273. package/lib/src/core/features/uIFeatures/beforeRender/toggleSelectAllCheckbox.js +0 -51
  274. package/lib/src/core/features/uIFeatures/beforeRender/toggleSelectAllCheckbox.js.map +0 -1
  275. package/lib/src/core/reducers/edit.d.ts.map +0 -1
  276. package/lib/src/core/reducers/edit.js +0 -65
  277. package/lib/src/core/reducers/edit.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"StateResolver.js","sourceRoot":"","sources":["../../../src/core/StateResolver.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EACL,sCAAsC,EACtC,8BAA8B,EAC9B,OAAO,EACP,uBAAuB,EACvB,mBAAmB,IAAI,0BAA0B,EACjD,aAAa,EACb,cAAc,EACd,eAAe,EAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,WAAW,MAAM,2BAA2B,CAAC;AAapD,kCAAkC;AAClC,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC,gDAAgD;IAChD,WAAW,CAAa;IAExB,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U,EAAE,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;QACrF,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,IAAI,CAAC,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBACxD,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;YACxC,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,KAAK,EAAE,KAAY,EAAE,gBAA4B,EAAE,EAAE;QAC1D;;;;;WAKG;QACH,QAAQ,CAAC,IAAI,GAAG,cAAc,CAAC,OAAO,EAAE,CAAC,IAAK,CAAC;QAC/C,MAAM,YAAY,CAChB,CAAC,KAAK,EAAE,gBAAgB,CAAC,EACzB;YACE,KAAK,CAAC,gBAAgB;YACtB,KAAK,CAAC,MAAM;YACZ,KAAK,CAAC,iBAAiB;YACvB,KAAK,CAAC,YAAY;YAClB,KAAK,CAAC,OAAO;YACb,KAAK,CAAC,MAAM;YACZ,KAAK,CAAC,iBAAiB;YACvB,KAAK,CAAC,YAAY;YAClB,KAAK,CAAC,aAAa;SACpB,CACF,CAAC;QACF,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/* eslint-disable no-console */\nimport type { State } from '../../types/State.types';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { ApiContext, ApiOptions, FetchDataResponse } from '../../types/ApiContext.types';\n\nimport { AFTER_FETCH, BEFORE_FETCH } from './pubSub/events';\nimport {\n clearProcessedActionsFromLatestActions,\n isSignificantPaginationOverlap,\n isEmpty,\n isFilterCriteriaChanged,\n isSameActionPresent as isSameActionPresentInQueue,\n isStaleAction,\n pickProperties,\n withMemoization\n} from './utils/util';\nimport { personalizationProps } from './reducers/personalizationReducer';\nimport ActionTypes from './actions/actionConstants';\nimport type { ActionType } from './actions/actionConstants';\nimport type RsInternal from './RsInternal';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { MiddleWareFeatureProps, UIFeatures, Feature } from './features/featureFactory';\nimport type { ActionAsFunction, BaseAction, Action } from './actions/actions.types';\nimport type RsProps from './RsProps';\n\nexport type ReducerFunction = (state: State, action: Action, rsInternal: RsInternal) => State;\nexport type FetchDataHandler = (\n state: State,\n fetchDataOptions: ApiOptions\n) => Promise<FetchDataResponse>;\n/** It manages state of RsCore. */\nexport default class StateResolver {\n /** A reference to {@link RsInternal} object. */\n #rsInternal: RsInternal;\n\n /** Reducer function to reduce RS Core actions to its respective state. */\n #reducers: ReducerFunction;\n\n /** A reference to beforeRender UI features */\n #middlewares?: (featureProps: MiddleWareFeatureProps) => Promise<void | null>;\n\n /** Handler to fetch and manage data using {@link ApiContext.fetchData fetchData} api. */\n #fetchDataHandler: FetchDataHandler;\n\n /** previously dispatched stable state excluding instant state */\n #state: State;\n\n /** Intermittent state generated based upon the processed actions from the queue */\n #currentState: State;\n\n /** State generated via actions with instantRender. */\n #instantState: State;\n\n /** Queue holding actions that are dispatched. */\n #queuedActions: Action[];\n\n /** Holds the action that is executed. */\n #previousExecutedActionQueue: Action[];\n\n /** It contains registered api's provided by consumer of RsCore */\n #externalStoreRef: NonNullable<RsProps['externalStore']>;\n\n /** Keep track of latest action of a type of that action is marked to ignore stale actions */\n #latestActions = new Map<ActionType, Action>();\n\n /** Indicates if an external dispatch to RS core consumer should ber skipped. */\n #skipExternalDispatch = false;\n\n /** Abort controller to abort the fetchData requests in transit */\n #abortController?: AbortController;\n\n /** Indicates if fetchData is in progress. */\n fetchDataInProgress?: boolean;\n\n /**\n * Create an instance of {@link StateResolver} class.\n * @param reducers Reducer function to reduce state for a given action\n * @param fetchDataHandler Fetch Data handler function to fetch the data of RSCore when required.\n * @param rsInternal Reference to {@link RsInternal} object.\n */\n constructor(\n reducers: ReducerFunction,\n fetchDataHandler: FetchDataHandler,\n rsInternal: RsInternal\n ) {\n this.#reducers = reducers;\n this.#fetchDataHandler = fetchDataHandler;\n this.#rsInternal = rsInternal;\n\n this.#externalStoreRef = rsInternal.getRsProps().externalStore!;\n\n this.#state = {};\n this.#currentState = {};\n this.#instantState = {};\n this.#queuedActions = [];\n this.#previousExecutedActionQueue = [];\n }\n\n /**\n * Executes {@link ApiContext.stateUpdateCallback stateUpdateCallback} and {@link ApiContext.setComponentState setComponentState} api with latest state.\n */\n #executePostStateUpdateCallbacks = () => {\n const visibleColumnsArr = this.#rsInternal.getView().getVisibleColumns();\n const visibleColumns = visibleColumnsArr.map(col => col.field.id);\n const { apiContext } = this.#rsInternal.getRsProps();\n if (apiContext?.stateUpdateCallback) {\n apiContext.stateUpdateCallback({\n ...pickProperties(this.getState(), personalizationProps),\n visibleColumns\n });\n }\n if (apiContext?.setComponentState && this.getState().personalization?.active) {\n apiContext.setComponentState({\n ...pickProperties(this.getState(), personalizationProps),\n activePersonalization: this.getState().personalization?.active\n });\n }\n };\n\n /**\n * Dispatches given {@link action} to update the RsCore {@link State state} based on the provided action type. Multiple actions are queued in the action queue.\n * It will further triggers various {@link UIFeatures features} and fetches data using {@link FetchDataHandler} according to the state changes.\n *\n * @param action - The action to be dispatched.\n */\n dispatch = (action: BaseAction): void => {\n if ('takeLatestAction' in action && action.takeLatestAction) {\n if (isSameActionPresentInQueue(action, this.#latestActions)) return;\n this.#latestActions.set(action.type, action);\n if (isSignificantPaginationOverlap(this.#latestActions, this.#previousExecutedActionQueue)) {\n this.#abortController?.abort();\n }\n }\n if (typeof action === 'function')\n return (action as ActionAsFunction)(\n this.dispatch,\n this.getState,\n this.#rsInternal.getView().meta\n );\n if (!this.#queuedActions.length && !this.fetchDataInProgress) {\n // Don't do deep copy as we don't do deep comparison for arrays and objects in memoization in feature files\n this.#currentState = { ...this.#state };\n }\n\n if ('instantRender' in action && action.instantRender) {\n if (this.#rsInternal.getRsProps().mode === 'debug') {\n console.warn(\n 'Doing instant render. This might introduce performance issues. Check if this is really needed.'\n );\n }\n this.#instantState = this.#reducers(this.#instantState, action, this.#rsInternal);\n this.#rsInternal.getView().setProp({\n state: { ...this.getState(), ...this.#instantState },\n isInstantRender: true\n });\n this.#externalStoreRef.dispatch({\n ...this.#instantState\n });\n this.#executePostStateUpdateCallbacks();\n\n return;\n }\n if ('skipActionQueue' in action && action.skipActionQueue) {\n this.#currentState = this.#reducers(this.#currentState, action, this.#rsInternal);\n return;\n }\n\n this.#queuedActions.push(action);\n // We run next batch only after completing first batch, Fetch call should get completed.\n if (this.#queuedActions.length === 1 && !this.#previousExecutedActionQueue.length) {\n this.#runQueuedActions();\n }\n };\n\n /**\n * Returns the current state that is built using the {@link dispatch dispatched} action.\n */\n getState = () => {\n return Object.keys(this.#currentState).length > 0 ? this.#currentState : this.#state;\n };\n\n /**\n * Returns a snapshot of the previous stable state before the action queue starts executing via {@link dispatch}.\n */\n getOriginalState = () => {\n return this.#state;\n };\n\n /**\n * Sets a function to execute a set of {@link Feature features} before triggering a render.\n * The provided function will be called with the {@link MiddleWareFeatureProps featureProps}\n * @param middlewares - A function that executes a set of {@link Feature features} before rendering.\n * @returns\n */\n setMiddlewares = (\n middlewares: (featureProps: MiddleWareFeatureProps) => Promise<void | null>\n ) => {\n if (this.#middlewares) return;\n this.#middlewares = middlewares;\n };\n\n /** This will reduce the RsCore {@link State state} for a {@link StateResolver.dispatch dispatched} action .\n * Additionally it will also run middlewares, fetches latest data using {@link FetchDataHandler} and executes post state update callback with latest reduced state.\n */\n #runQueuedActions = async () => {\n const queuedAction = this.#queuedActions[0];\n if (queuedAction) {\n if (isStaleAction(queuedAction, this.#latestActions)) {\n this.#queuedActions.shift();\n await this.#runQueuedActions();\n return;\n }\n\n this.#previousExecutedActionQueue.push(queuedAction);\n this.#currentState = this.#reducers(this.#currentState, queuedAction, this.#rsInternal);\n await this.#middlewares!({\n rsInternal: this.#rsInternal,\n getState: this.getState,\n getOriginalState: this.getOriginalState,\n dispatch: this.dispatch,\n queuedActions: [queuedAction]\n });\n this.#queuedActions.shift();\n await this.#runQueuedActions();\n } else if (this.#rsInternal.getRsStore().isMounted) {\n this.fetchDataInProgress = true;\n\n await this.#fetchData({\n ...this.#currentState,\n ...this.#instantState\n });\n\n // if the processed action and latest action has same payload, delete the latestAction as all the actions have been processed.\n clearProcessedActionsFromLatestActions(\n this.#latestActions,\n this.#previousExecutedActionQueue\n );\n\n // if data has been ignored, don't dispatch to view layer as the there is no change in rows\n if (!this.#skipExternalDispatch) {\n await this.#externalStoreRef.dispatch({\n ...this.#currentState\n });\n }\n this.#skipExternalDispatch = false;\n this.fetchDataInProgress = false;\n this.#previousExecutedActionQueue = [];\n\n // this happens in cases of dispatches like query info. In that case, the props have been set on view directly and the dispatch has already happened\n // This will prevent unnecessary renders in case of server side table\n\n // Avoid skipping FORCE_UPDATE action in case feature has triggered it and is relying on forceUpdatedFeatures slice of state.\n // forceUpdateFeatures slice is generally used by features when they are not able to perform their task if the rendering cycle is not complete.\n // 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.\n // If we skip these types of FORCE_UPDATE action then the corresponding features execution will also be skipped.\n if (\n this.#queuedActions.length === 1 &&\n this.#queuedActions[0]?.type === ActionTypes.FORCE_UPDATE &&\n !Object.keys(this.#queuedActions[0].payload.forceUpdateFeatures).length\n ) {\n this.#queuedActions.shift();\n }\n if (this.#queuedActions.length) {\n this.#runQueuedActions();\n } else {\n this.#state = { ...this.#currentState };\n this.#currentState = {};\n this.#executePostStateUpdateCallbacks();\n }\n }\n };\n\n /**\n * Calls the {@link FetchDataHandler fetchDataHandler} and updates the latest data in the {@link View}\n * @param latestState - Current state.\n */\n #fetchData = async (latestState: State) => {\n this.#abortController = new AbortController();\n const signal = this.#abortController.signal;\n this.#rsInternal.getPubSubUtils().publish(BEFORE_FETCH);\n\n const derivedState = {\n ...latestState,\n groupFilters: this.#rsInternal.getRsStore().groupFilters\n };\n // TODO: No need to fetch data if all the groups are collapsed.\n const res = await this.#fetchDataHandler(derivedState, {\n signal,\n ...(this.#rsInternal.getRsStore().refreshInProgress && {\n invalidateCache: true,\n invalidateCacheToken: this.#rsInternal.getRsStore().refreshToken\n })\n });\n if (res) {\n const { totalRecordCount, filteredRecordCount, data = [] } = res;\n\n if (!isEmpty(totalRecordCount) || !isEmpty(filteredRecordCount)) {\n this.#rsInternal.getView().setProp({\n resultsCount: totalRecordCount || filteredRecordCount,\n countGeneratedInternally: false,\n showCount: true\n });\n }\n\n if (isSignificantPaginationOverlap(this.#latestActions, this.#previousExecutedActionQueue)) {\n this.#skipExternalDispatch = true;\n } else {\n this.#rsInternal.getView().setProp({\n data,\n isCountUpdateRequired:\n isFilterCriteriaChanged(this.#rsInternal.getRsStore().meta, this.#state, latestState) ||\n latestState.refresh !== this.#state.refresh\n });\n }\n }\n\n this.#rsInternal.getPubSubUtils().publish(AFTER_FETCH);\n this.#rsInternal.getView().setProp({ state: latestState, isInstantRender: false });\n };\n}\n\n/** Initializes handler for {@link ApiContext.fetchData fetchData} api. */\nexport function initializeFetchDataHandler(rsCoreInternal: RsInternal) {\n let response = {} as FetchDataResponse;\n const fetchWrapper = withMemoization(async ([state, fetchDataOptions]: [State, ApiOptions]) => {\n try {\n response = await rsCoreInternal\n .getRsProps()\n .apiContext.fetchData(state, rsCoreInternal.getRsStore().meta, fetchDataOptions);\n } catch (err: any) {\n if (!['AbortError', 'CanceledError'].includes(err.name)) {\n console.error('API call failed', err);\n }\n }\n });\n\n return async (state: State, fetchDataOptions: ApiOptions) => {\n /**\n * Returning default data from getView() in case the actual apiContext.getData() doesn't get called.\n *\n * BUG-811621: in case of bulk actions and inline edit, the updated rows come from separate apiContext APIs\n * and the memo of below function won't break, so, it will give stale data. Using getView().data as the default fallback for such cases.\n */\n response.data = rsCoreInternal.getView().data!;\n await fetchWrapper(\n [state, fetchDataOptions],\n [\n state.filterExpression,\n state.search,\n state.paginationOptions,\n state.sortingOrder,\n state.refresh,\n state.groups,\n state.hierarchicalGroup,\n state.groupFilters,\n state.hiddenColumns\n ]\n );\n return response;\n };\n}\n"]}
1
+ {"version":3,"file":"StateResolver.js","sourceRoot":"","sources":["../../../src/core/StateResolver.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EACL,sCAAsC,EACtC,8BAA8B,EAC9B,OAAO,EACP,uBAAuB,EACvB,mBAAmB,IAAI,0BAA0B,EACjD,aAAa,EACb,cAAc,EACd,eAAe,EAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,WAAW,MAAM,2BAA2B,CAAC;AAapD,kCAAkC;AAClC,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC,gDAAgD;IAChD,WAAW,CAAa;IAExB,0EAA0E;IAC1E,SAAS,CAAkB;IAE3B,8CAA8C;IAC9C,YAAY,CAAkE;IAE9E,yFAAyF;IACzF,iBAAiB,CAAmB;IAEpC,iEAAiE;IACjE,MAAM,CAAQ;IAEd,mFAAmF;IACnF,aAAa,CAAQ;IAErB,sDAAsD;IACtD,aAAa,CAAQ;IAErB,iDAAiD;IACjD,cAAc,CAAW;IAEzB,0CAA0C;IAC1C,4BAA4B,CAAW;IAEvC,kEAAkE;IAClE,iBAAiB,CAAwC;IAEzD,6FAA6F;IAC7F,cAAc,GAAG,IAAI,GAAG,EAAsB,CAAC;IAE/C,gFAAgF;IAChF,qBAAqB,GAAG,KAAK,CAAC;IAE9B,kEAAkE;IAClE,gBAAgB,CAAmB;IAEnC,6CAA6C;IAC7C,mBAAmB,CAAW;IAE9B;;;;;OAKG;IACH,YACE,QAAyB,EACzB,gBAAkC,EAClC,UAAsB;QAEtB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,iBAAiB,GAAG,gBAAgB,CAAC;QAC1C,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAE9B,IAAI,CAAC,iBAAi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AC,iBAAiB;YACvB,KAAK,CAAC,YAAY;YAClB,KAAK,CAAC,OAAO;YACb,KAAK,CAAC,MAAM;YACZ,KAAK,CAAC,iBAAiB;YACvB,KAAK,CAAC,YAAY;YAClB,KAAK,CAAC,aAAa;SACpB,CACF,CAAC;QACF,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/* eslint-disable no-console */\nimport type { State } from '../../types/State.types';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { ApiContext, ApiOptions, FetchDataResponse } from '../../types/ApiContext.types';\n\nimport { AFTER_FETCH, BEFORE_FETCH } from './pubSub/events';\nimport {\n clearProcessedActionsFromLatestActions,\n isSignificantPaginationOverlap,\n isEmpty,\n isFilterCriteriaChanged,\n isSameActionPresent as isSameActionPresentInQueue,\n isStaleAction,\n pickProperties,\n withMemoization\n} from './utils/util';\nimport { personalizationProps } from './reducers/personalizationReducer';\nimport ActionTypes from './actions/actionConstants';\nimport type { ActionType } from './actions/actionConstants';\nimport type RsInternal from './RsInternal';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { MiddleWareFeatureProps, UIFeatures, Feature } from './features/featureFactory';\nimport type { ActionAsFunction, BaseAction, Action } from './actions/actions.types';\nimport type RsProps from './RsProps';\n\nexport type ReducerFunction = (state: State, action: Action, rsInternal: RsInternal) => State;\nexport type FetchDataHandler = (\n state: State,\n fetchDataOptions: ApiOptions\n) => Promise<FetchDataResponse>;\n/** It manages state of RsCore. */\nexport default class StateResolver {\n /** A reference to {@link RsInternal} object. */\n #rsInternal: RsInternal;\n\n /** Reducer function to reduce RS Core actions to its respective state. */\n #reducers: ReducerFunction;\n\n /** A reference to beforeRender UI features */\n #middlewares?: (featureProps: MiddleWareFeatureProps) => Promise<void | null>;\n\n /** Handler to fetch and manage data using {@link ApiContext.fetchData fetchData} api. */\n #fetchDataHandler: FetchDataHandler;\n\n /** previously dispatched stable state excluding instant state */\n #state: State;\n\n /** Intermittent state generated based upon the processed actions from the queue */\n #currentState: State;\n\n /** State generated via actions with instantRender. */\n #instantState: State;\n\n /** Queue holding actions that are dispatched. */\n #queuedActions: Action[];\n\n /** Holds the action that is executed. */\n #previousExecutedActionQueue: Action[];\n\n /** It contains registered api's provided by consumer of RsCore */\n #externalStoreRef: NonNullable<RsProps['externalStore']>;\n\n /** Keep track of latest action of a type of that action is marked to ignore stale actions */\n #latestActions = new Map<ActionType, Action>();\n\n /** Indicates if an external dispatch to RS core consumer should ber skipped. */\n #skipExternalDispatch = false;\n\n /** Abort controller to abort the fetchData requests in transit */\n #abortController?: AbortController;\n\n /** Indicates if fetchData is in progress. */\n fetchDataInProgress?: boolean;\n\n /**\n * Create an instance of {@link StateResolver} class.\n * @param reducers Reducer function to reduce state for a given action\n * @param fetchDataHandler Fetch Data handler function to fetch the data of RSCore when required.\n * @param rsInternal Reference to {@link RsInternal} object.\n */\n constructor(\n reducers: ReducerFunction,\n fetchDataHandler: FetchDataHandler,\n rsInternal: RsInternal\n ) {\n this.#reducers = reducers;\n this.#fetchDataHandler = fetchDataHandler;\n this.#rsInternal = rsInternal;\n\n this.#externalStoreRef = rsInternal.getRsProps().externalStore!;\n\n this.#state = {};\n this.#currentState = {};\n this.#instantState = {};\n this.#queuedActions = [];\n this.#previousExecutedActionQueue = [];\n }\n\n /**\n * Executes {@link ApiContext.stateUpdateCallback stateUpdateCallback} and {@link ApiContext.setComponentState setComponentState} api with latest state.\n */\n #executePostStateUpdateCallbacks = () => {\n const { apiContext } = this.#rsInternal.getRsProps();\n if (apiContext?.stateUpdateCallback) {\n apiContext.stateUpdateCallback({\n ...pickProperties(this.getState(), personalizationProps)\n });\n }\n if (apiContext?.setComponentState && this.getState().personalization?.active) {\n apiContext.setComponentState({\n ...pickProperties(this.getState(), personalizationProps),\n activePersonalization: this.getState().personalization?.active\n });\n }\n };\n\n /**\n * Dispatches given {@link action} to update the RsCore {@link State state} based on the provided action type. Multiple actions are queued in the action queue.\n * It will further triggers various {@link UIFeatures features} and fetches data using {@link FetchDataHandler} according to the state changes.\n *\n * @param action - The action to be dispatched.\n */\n dispatch = (action: BaseAction): void => {\n if ('takeLatestAction' in action && action.takeLatestAction) {\n if (isSameActionPresentInQueue(action, this.#latestActions)) return;\n this.#latestActions.set(action.type, action);\n if (isSignificantPaginationOverlap(this.#latestActions, this.#previousExecutedActionQueue)) {\n this.#abortController?.abort();\n }\n }\n if (typeof action === 'function')\n return (action as ActionAsFunction)(\n this.dispatch,\n this.getState,\n this.#rsInternal.getView().meta\n );\n if (!this.#queuedActions.length && !this.fetchDataInProgress) {\n // Don't do deep copy as we don't do deep comparison for arrays and objects in memoization in feature files\n this.#currentState = { ...this.#state };\n }\n\n if ('instantRender' in action && action.instantRender) {\n if (this.#rsInternal.getRsProps().mode === 'debug') {\n console.warn(\n 'Doing instant render. This might introduce performance issues. Check if this is really needed.'\n );\n }\n this.#instantState = this.#reducers(this.#instantState, action, this.#rsInternal);\n this.#rsInternal.getView().setProp({\n state: { ...this.getState(), ...this.#instantState },\n isInstantRender: true\n });\n this.#externalStoreRef.dispatch({\n ...this.#instantState\n });\n this.#executePostStateUpdateCallbacks();\n\n return;\n }\n if ('skipActionQueue' in action && action.skipActionQueue) {\n this.#currentState = this.#reducers(this.#currentState, action, this.#rsInternal);\n return;\n }\n\n this.#queuedActions.push(action);\n // We run next batch only after completing first batch, Fetch call should get completed.\n if (this.#queuedActions.length === 1 && !this.#previousExecutedActionQueue.length) {\n this.#runQueuedActions();\n }\n };\n\n /**\n * Returns the current state that is built using the {@link dispatch dispatched} action.\n */\n getState = () => {\n return Object.keys(this.#currentState).length > 0 ? this.#currentState : this.#state;\n };\n\n /**\n * Returns a snapshot of the previous stable state before the action queue starts executing via {@link dispatch}.\n */\n getOriginalState = () => {\n return this.#state;\n };\n\n /**\n * Sets a function to execute a set of {@link Feature features} before triggering a render.\n * The provided function will be called with the {@link MiddleWareFeatureProps featureProps}\n * @param middlewares - A function that executes a set of {@link Feature features} before rendering.\n */\n setMiddlewares = (\n middlewares: (featureProps: MiddleWareFeatureProps) => Promise<void | null>\n ) => {\n if (this.#middlewares) return;\n this.#middlewares = middlewares;\n };\n\n /**\n * Returns true if the lone queued FORCE_UPDATE action should be skipped (no-op optimization).\n */\n #skipForceUpdateAction = (): boolean => {\n if (this.#queuedActions.length !== 1) return false;\n const action = this.#queuedActions[0];\n if (action?.type !== ActionTypes.FORCE_UPDATE) return false;\n if (!('payload' in action)) return false;\n return !Object.keys(action.payload.forceUpdateFeatures ?? {}).length;\n };\n\n /** This will reduce the RsCore {@link State state} for a {@link StateResolver.dispatch dispatched} action .\n * Additionally it will also run middlewares, fetches latest data using {@link FetchDataHandler} and executes post state update callback with latest reduced state.\n */\n #runQueuedActions = async () => {\n const queuedAction = this.#queuedActions[0];\n if (queuedAction) {\n const skipStaleActionExecution =\n 'takeLatestAction' in queuedAction &&\n queuedAction.takeLatestAction &&\n isStaleAction(queuedAction, this.#latestActions);\n\n if (skipStaleActionExecution) {\n this.#queuedActions.shift();\n await this.#runQueuedActions();\n return;\n }\n\n this.#previousExecutedActionQueue.push(queuedAction);\n this.#currentState = this.#reducers(this.#currentState, queuedAction, this.#rsInternal);\n await this.#middlewares!({\n rsInternal: this.#rsInternal,\n getState: this.getState,\n getOriginalState: this.getOriginalState,\n dispatch: this.dispatch,\n queuedActions: [queuedAction]\n });\n this.#queuedActions.shift();\n await this.#runQueuedActions();\n } else if (this.#rsInternal.getRsStore().isMounted) {\n this.fetchDataInProgress = true;\n\n await this.#fetchData({\n ...this.#currentState,\n ...this.#instantState\n });\n\n // if the processed action and latest action has same payload, delete the latestAction as all the actions have been processed.\n clearProcessedActionsFromLatestActions(\n this.#latestActions,\n this.#previousExecutedActionQueue\n );\n\n // if data has been ignored, don't dispatch to view layer as the there is no change in rows\n if (!this.#skipExternalDispatch) {\n await this.#externalStoreRef.dispatch({\n ...this.#currentState\n });\n }\n this.#skipExternalDispatch = false;\n this.fetchDataInProgress = false;\n this.#previousExecutedActionQueue = [];\n\n // this happens in cases of dispatches like query info. In that case, the props have been set on view directly and the dispatch has already happened\n // This will prevent unnecessary renders in case of server side table\n\n // Avoid skipping FORCE_UPDATE action in case feature has triggered it and is relying on forceUpdatedFeatures slice of state.\n // forceUpdateFeatures slice is generally used by features when they are not able to perform their task if the rendering cycle is not complete.\n // 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.\n // If we skip these types of FORCE_UPDATE action then the corresponding features execution will also be skipped.\n if (this.#skipForceUpdateAction()) {\n this.#queuedActions.shift();\n }\n if (this.#queuedActions.length) {\n this.#runQueuedActions();\n } else {\n this.#state = { ...this.#currentState };\n this.#currentState = {};\n this.#executePostStateUpdateCallbacks();\n }\n }\n };\n\n /**\n * Calls the {@link FetchDataHandler fetchDataHandler} and updates the latest data in the {@link View}\n * @param latestState - Current state.\n */\n #fetchData = async (latestState: State) => {\n this.#abortController = new AbortController();\n const signal = this.#abortController.signal;\n this.#rsInternal.getPubSubUtils().publish(BEFORE_FETCH);\n\n const derivedState = {\n ...latestState,\n groupFilters: this.#rsInternal.getRsStore().groupFilters\n };\n // TODO: No need to fetch data if all the groups are collapsed.\n const res = await this.#fetchDataHandler(derivedState, {\n signal,\n ...(this.#rsInternal.getRsStore().refreshInProgress && {\n invalidateCache: true,\n invalidateCacheToken: this.#rsInternal.getRsStore().refreshToken\n })\n });\n if (res) {\n const { totalRecordCount, filteredRecordCount, data = [] } = res;\n\n if (!isEmpty(totalRecordCount) || !isEmpty(filteredRecordCount)) {\n this.#rsInternal.getView().setProp({\n resultsCount: totalRecordCount || filteredRecordCount,\n countGeneratedInternally: false,\n showCount: true\n });\n }\n\n if (isSignificantPaginationOverlap(this.#latestActions, this.#previousExecutedActionQueue)) {\n this.#skipExternalDispatch = true;\n } else {\n this.#rsInternal.getView().setProp({\n data,\n isCountUpdateRequired:\n isFilterCriteriaChanged(this.#rsInternal.getRsStore().meta, this.#state, latestState) ||\n latestState.refresh !== this.#state.refresh\n });\n }\n }\n\n this.#rsInternal.getPubSubUtils().publish(AFTER_FETCH);\n this.#rsInternal.getView().setProp({ state: latestState, isInstantRender: false });\n };\n}\n\n/** Initializes handler for {@link ApiContext.fetchData fetchData} api. */\nexport function initializeFetchDataHandler(rsCoreInternal: RsInternal) {\n let response = {} as FetchDataResponse;\n const fetchWrapper = withMemoization(async ([state, fetchDataOptions]: [State, ApiOptions]) => {\n try {\n response = await rsCoreInternal\n .getRsProps()\n .apiContext.fetchData(state, rsCoreInternal.getRsStore().meta, fetchDataOptions);\n } catch (err: any) {\n if (!['AbortError', 'CanceledError'].includes(err.name)) {\n console.error('API call failed', err);\n }\n }\n });\n\n return async (state: State, fetchDataOptions: ApiOptions) => {\n /**\n * Returning default data from getView() in case the actual apiContext.getData() doesn't get called.\n *\n * BUG-811621: in case of bulk actions and inline edit, the updated rows come from separate apiContext APIs\n * and the memo of below function won't break, so, it will give stale data. Using getView().data as the default fallback for such cases.\n */\n response.data = rsCoreInternal.getView().data!;\n await fetchWrapper(\n [state, fetchDataOptions],\n [\n state.filterExpression,\n state.search,\n state.paginationOptions,\n state.sortingOrder,\n state.refresh,\n state.groups,\n state.hierarchicalGroup,\n state.groupFilters,\n state.hiddenColumns\n ]\n );\n return response;\n };\n}\n"]}
@@ -5,6 +5,7 @@ export type Selectors = {
5
5
  parentElementSelector?: string;
6
6
  aboveLoader?: string;
7
7
  belowLoader?: string;
8
+ addActionSelector?: string;
8
9
  };
9
10
  declare class BaseA11y {
10
11
  #private;
@@ -14,6 +15,14 @@ declare class BaseA11y {
14
15
  focusableSelectors: string[];
15
16
  actionableSelectors?: string[];
16
17
  ariaLabel?: string;
18
+ focusState: {
19
+ focusSnapshot: {
20
+ rowIndex: number | undefined;
21
+ colIndex: number | undefined;
22
+ rowKey: string | undefined;
23
+ };
24
+ hadFocus: boolean;
25
+ };
17
26
  /**
18
27
  *
19
28
  * @param selectors
@@ -55,19 +64,27 @@ declare class BaseA11y {
55
64
  * - If `Shift + Tab` is pressed, it focuses the `topFocusableElement`.
56
65
  * - If only `Tab` is pressed, it focuses the `bottomFocusableElement`.
57
66
  *
58
- * @param {KeyboardEvent} event - The keyboard event object containing details of the pressed key.
67
+ * @param event - The keyboard event object containing details of the pressed key.
59
68
  */
60
69
  tabHandler(event: KeyboardEvent): void;
70
+ /**
71
+ * Determines whether an element can receive focus.
72
+ * Checks that the element is not disabled, not inside an inert container, and is visible.
73
+ *
74
+ * @param el - The element to check for focusability.
75
+ * @returns `true` if the element can receive focus, `false` otherwise.
76
+ */
77
+ static isElementFocusable(el: HTMLElement): boolean;
61
78
  /**
62
79
  * Retrieves all focusable elements within a given element based on the `focusableSelectors` array.
80
+ * Filters out disabled elements, those inside inert containers, and visually hidden elements.
63
81
  *
64
- * @param {Element} column - The element from which to get focusable elements.
65
- * @returns {NodeListOf<HTMLElement>} - A NodeList of all focusable HTML elements found inside element.
82
+ * @param column - The element from which to get focusable elements.
83
+ * @returns An array of all focusable HTML elements found inside element.
66
84
  */
67
- getFocusableElementsInCell(column: Element): NodeListOf<HTMLElement>;
85
+ getFocusableElementsInCell(column: Element): HTMLElement[];
68
86
  /**
69
87
  * @param row
70
- * @returns
71
88
  */
72
89
  getSortedColumns(row: HTMLElement | null): (Element | HTMLElement)[];
73
90
  /**
@@ -126,7 +143,7 @@ declare class BaseA11y {
126
143
  */
127
144
  toggleStyleFormatAriaDescription(nextCol: Element, currentCol: Element): void;
128
145
  /**
129
- * @param {KeyboardEvent} event
146
+ * @param event
130
147
  */
131
148
  dynamicLoadersKeyDownHandler(event: KeyboardEvent): boolean;
132
149
  /**
@@ -162,6 +179,8 @@ declare class BaseA11y {
162
179
  * @returns void
163
180
  */
164
181
  boundaryElementsFocusHandler(event: FocusEvent): void;
182
+ onFocusHandler(): void;
183
+ onBlurHandler(event: FocusEvent): void;
165
184
  }
166
185
  export default BaseA11y;
167
186
  //# sourceMappingURL=BaseA11y.d.ts.map
@@ -1 +1 @@
1
- {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EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO;IAwBhF;;OAEG;IACH,6BAA6B,IAAI,WAAW,GAAG,IAAI;IAkBnD;;;;;;;OAOG;IACH,sBAAsB;IAOtB;;;;OAIG;IACH,2BAA2B,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM;;;;;IASnF;;;;OAIG;IAEH,gCAAgC,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO;IAiLtE;;OAEG;IACH,4BAA4B,CAAC,KAAK,EAAE,aAAa;IA6BjD;;;;OAIG;IACH,WAAW,CAAC,KAAK,EAAE,aAAa;IAsBhC;;;;;;;;;;OAUG;IACH,cAAc,CAAC,QAAQ,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE;IAwChD,iBAAiB;IAWjB;;;;;;;;;;OAUG;IACH,4BAA4B,CAAC,KAAK,EAAE,UAAU;IAmB9C,cAAc;IAId,aAAa,CAAC,KAAK,EAAE,UAAU;CAWhC;AAED,eAAe,QAAQ,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { isInstance } from '@pega/cosmos-react-core';
1
2
  const keys = {
2
3
  TAB: 9,
3
4
  ENTER: 13,
@@ -51,6 +52,7 @@ class BaseA11y {
51
52
  focusableSelectors;
52
53
  actionableSelectors;
53
54
  ariaLabel;
55
+ focusState;
54
56
  /**
55
57
  *
56
58
  * @param selectors
@@ -89,6 +91,10 @@ class BaseA11y {
89
91
  this.focusableSelectors = focusableSelectors;
90
92
  this.actionableSelectors = actionableSelectors;
91
93
  this.ariaLabel = ariaLabel;
94
+ this.focusState = {
95
+ focusSnapshot: { rowIndex: undefined, colIndex: undefined, rowKey: undefined },
96
+ hadFocus: false
97
+ };
92
98
  }
93
99
  /**
94
100
  * Sets the container element
@@ -103,7 +109,7 @@ class BaseA11y {
103
109
  * - If `Shift + Tab` is pressed, it focuses the `topFocusableElement`.
104
110
  * - If only `Tab` is pressed, it focuses the `bottomFocusableElement`.
105
111
  *
106
- * @param {KeyboardEvent} event - The keyboard event object containing details of the pressed key.
112
+ * @param event - The keyboard event object containing details of the pressed key.
107
113
  */
108
114
  tabHandler(event) {
109
115
  const topFocusableElement = this.selectors.topFocusRef
@@ -135,14 +141,28 @@ class BaseA11y {
135
141
  bottomFocusableElement.dispatchEvent(keyboardEvent);
136
142
  }
137
143
  }
144
+ /**
145
+ * Determines whether an element can receive focus.
146
+ * Checks that the element is not disabled, not inside an inert container, and is visible.
147
+ *
148
+ * @param el - The element to check for focusability.
149
+ * @returns `true` if the element can receive focus, `false` otherwise.
150
+ */
151
+ static isElementFocusable(el) {
152
+ return (!el.hasAttribute('disabled') &&
153
+ !el.closest('[inert]') &&
154
+ (el.checkVisibility?.() ?? getComputedStyle(el).visibility !== 'hidden'));
155
+ }
138
156
  /**
139
157
  * Retrieves all focusable elements within a given element based on the `focusableSelectors` array.
158
+ * Filters out disabled elements, those inside inert containers, and visually hidden elements.
140
159
  *
141
- * @param {Element} column - The element from which to get focusable elements.
142
- * @returns {NodeListOf<HTMLElement>} - A NodeList of all focusable HTML elements found inside element.
160
+ * @param column - The element from which to get focusable elements.
161
+ * @returns An array of all focusable HTML elements found inside element.
143
162
  */
144
163
  getFocusableElementsInCell(column) {
145
- return column.querySelectorAll(this.focusableSelectors.join(','));
164
+ const elements = column.querySelectorAll(this.focusableSelectors.join(','));
165
+ return [...elements].filter(el => BaseA11y.isElementFocusable(el));
146
166
  }
147
167
  /**
148
168
  * Determines whether a given DOM element is a grid cell.
@@ -156,7 +176,6 @@ class BaseA11y {
156
176
  }
157
177
  /**
158
178
  * @param row
159
- * @returns
160
179
  */
161
180
  getSortedColumns(row) {
162
181
  return [...(row?.querySelectorAll(this.selectors.focusElementSelector) ?? [])];
@@ -421,7 +440,7 @@ class BaseA11y {
421
440
  return [...colItem.querySelectorAll(this.actionableSelectors.join(','))].includes(element);
422
441
  }
423
442
  /**
424
- * @param {KeyboardEvent} event
443
+ * @param event
425
444
  */
426
445
  dynamicLoadersKeyDownHandler(event) {
427
446
  const { keyCode } = event;
@@ -450,7 +469,7 @@ class BaseA11y {
450
469
  */
451
470
  a11yHandler(event) {
452
471
  const rootNode = this.container.getRootNode();
453
- if (!(rootNode instanceof Document || rootNode instanceof ShadowRoot))
472
+ if (!isInstance(rootNode, Document, ShadowRoot))
454
473
  return;
455
474
  const currentCol = rootNode.activeElement?.closest(this.selectors.focusElementSelector);
456
475
  const belowLoader = this.selectors.belowLoader
@@ -502,7 +521,7 @@ class BaseA11y {
502
521
  }
503
522
  }
504
523
  /**
505
- * @param {HTMLElement | null} firstCell
524
+ * @param firstCell
506
525
  */
507
526
  #focusFirstElementInCell(firstCell) {
508
527
  if (!firstCell)
@@ -555,6 +574,18 @@ class BaseA11y {
555
574
  }
556
575
  }
557
576
  }
577
+ onFocusHandler() {
578
+ this.focusState.hadFocus = true;
579
+ }
580
+ onBlurHandler(event) {
581
+ const currentTarget = event.currentTarget;
582
+ const relatedTarget = event.relatedTarget;
583
+ // If relatedTarget is within the currentTarget i.e. RS container, skip the blur event capture as focus is still within the container.
584
+ if (relatedTarget === null ||
585
+ !(currentTarget && currentTarget.contains(relatedTarget))) {
586
+ this.focusState.hadFocus = false;
587
+ }
588
+ }
558
589
  }
559
590
  export default BaseA11y;
560
591
  //# sourceMappingURL=BaseA11y.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseA11y.js","sourceRoot":"","sources":["../../../../src/core/a11y/BaseA11y.ts"],"names":[],"mappings":"AASA,MAAM,IAAI,GAA2B;IACnC,GAAG,EAAE,CAAC;IACN,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,EAAE;IACT,MAAM,EAAE,EAAE;IACV,IAAI,EAAE,EAAE;IACR,EAAE,EAAE,EAAE;IACN,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,EAAE;IACR,IAAI,EAAE,EAAE;CACA,CAAC;AAEX,MAAM,SAAS,GAAG,UAAU,CAAC;AAC7B,MAAM,gBAAgB,GA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,CAAC,CAAC;YAEzE,IAAI,CAAC,wBAAwB,CAAC,SAAS,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC;IAED;;;;;;;;;;OAUG;IACH,4BAA4B,CAAC,KAAiB;QAC5C,MAAM,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC;QAChC,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,IAAI,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,aAA4B,CAAC,EAAE,CAAC;YAC7E,IAAI,eAAe,CAAC;YAEpB,IAAK,KAAK,CAAC,MAAsB,CAAC,YAAY,CAAC,gBAAgB,CAAC,EAAE,CAAC;gBACjE,eAAe,GAAG;oBAChB,WAAW,EAAE,QAAQ,CAAE,KAAK,CAAC,MAAsB,CAAC,YAAY,CAAC,gBAAgB,CAAE,EAAE,EAAE,CAAC;iBACzF,CAAC;YACJ,CAAC;YACD,IAAI,eAAe,EAAE,CAAC;gBACpB,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;YACvC,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC3B,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAED,eAAe,QAAQ,CAAC","sourcesContent":["export type Selectors = {\n topFocusRef?: string;\n bottomFocusRef?: string;\n focusElementSelector: string;\n parentElementSelector?: string;\n aboveLoader?: string;\n belowLoader?: string;\n};\n\nconst keys: Record<string, number> = {\n TAB: 9,\n ENTER: 13,\n SPACE: 32,\n ESCAPE: 27,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40,\n HOME: 36\n} as const;\n\nconst TAB_INDEX = 'tabindex';\nconst DATA_COLUMNINDEX = 'data-columnIndex';\n\n/**\n * Sets focus on the provided HTML element.\n * It sets the `tabindex` attribute to \"0\" to ensure the element can receive keyboard focus.\n *\n * @param element - The HTML element to be focused. If `undefined`, the function does not performing any action.\n */\nfunction gainFocus(element: HTMLElement | undefined): void {\n if (!element) return;\n element.setAttribute(TAB_INDEX, '0');\n element.focus();\n}\n\n/**\n * Recursively finds the first parent element that has scrollable content.\n *\n * This function checks whether the given HTML element or any of its parent\n * elements has a scrollable content area.\n *\n * @param node - The starting HTML element to check for scrollable content.\n * If null, the function will return null.\n *\n * @returns - The first parent element with scrollable content, or null if no such element is found.\n */\nfunction getScrollParent(node: HTMLElement | null): HTMLElement | null {\n // eslint-disable-next-line eqeqeq\n if (node == null) {\n return null;\n }\n\n if (node.scrollHeight > node.clientHeight) {\n return node;\n }\n\n return getScrollParent(node.parentNode as HTMLElement);\n}\n\nclass BaseA11y {\n selectors: Selectors;\n keys: Record<string, number>;\n container: HTMLElement;\n focusableSelectors: string[];\n actionableSelectors?: string[];\n ariaLabel?: string;\n /**\n *\n * @param selectors\n * @param focusableSelectors Selectors which doesn't require arrow keys/typing interaction from user\n * @param customKeys\n * @param container\n * @param actionableSelectors Selectors which require arrow keys/typing interaction from user\n * @param ariaLabel\n *\n * selectors = {\n topFocusRef: '.top',\n bottomFocusRef: '.bottom',\n focusElementSelector: '.cell',\n parentElementSelector: '.row'\n };\n customKeys = {\n TAB: 9,\n ENTER: 13,\n SPACE: 32,\n ESCAPE: 27,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40\n };\n focusableSelectors = ['button', 'a[href]'];\n actionableSelectors = ['select', 'textarea']\n ariaLabel = 'Interactive content'\n */\n constructor(\n selectors: Selectors,\n focusableSelectors: string[],\n // eslint-disable-next-line @typescript-eslint/default-param-last\n customKeys: Record<string, number> = {},\n container: HTMLElement,\n actionableSelectors?: string[],\n ariaLabel?: string\n ) {\n this.selectors = { ...selectors };\n this.keys = { ...keys, ...customKeys };\n this.container = container;\n this.focusableSelectors = focusableSelectors;\n this.actionableSelectors = actionableSelectors;\n this.ariaLabel = ariaLabel;\n }\n\n /**\n * Sets the container element\n */\n setContainer(container: HTMLElement) {\n this.container = container;\n }\n\n /**\n * Handles tab key navigation within a focusable region. It focuses on the top or bottom\n * focusable element based on the `Shift` key press in combination with the `Tab` key.\n *\n * - If `Shift + Tab` is pressed, it focuses the `topFocusableElement`.\n * - If only `Tab` is pressed, it focuses the `bottomFocusableElement`.\n *\n * @param {KeyboardEvent} event - The keyboard event object containing details of the pressed key.\n */\n tabHandler(event: KeyboardEvent) {\n const topFocusableElement = this.selectors.topFocusRef\n ? this.container.parentElement?.querySelector(this.selectors.topFocusRef)\n : null;\n const bottomFocusableElement = this.selectors.bottomFocusRef\n ? this.container.parentElement?.querySelector(this.selectors.bottomFocusRef)\n : null;\n if (event.shiftKey && topFocusableElement) {\n const shiftTabKeyEvent = new KeyboardEvent('keypress', {\n bubbles: true,\n cancelable: true,\n key: 'Tab',\n shiftKey: true,\n keyCode: 9\n });\n\n (topFocusableElement as HTMLElement).focus();\n topFocusableElement.dispatchEvent(shiftTabKeyEvent);\n } else if (bottomFocusableElement) {\n const keyboardEvent = new KeyboardEvent('keypress', {\n bubbles: true,\n cancelable: true,\n key: 'Tab',\n shiftKey: false,\n keyCode: 9\n });\n\n (bottomFocusableElement as HTMLElement).focus();\n bottomFocusableElement.dispatchEvent(keyboardEvent);\n }\n }\n\n /**\n * Retrieves all focusable elements within a given element based on the `focusableSelectors` array.\n *\n * @param {Element} column - The element from which to get focusable elements.\n * @returns {NodeListOf<HTMLElement>} - A NodeList of all focusable HTML elements found inside element.\n */\n getFocusableElementsInCell(column: Element): NodeListOf<HTMLElement> {\n return column.querySelectorAll(this.focusableSelectors.join(','));\n }\n\n /**\n * Determines whether a given DOM element is a grid cell.\n * @param column - The DOM element to check.\n * @returns Returns `true` if the element contains the specified CSS class, indicating it's a grid cell, otherwise `false`.\n *\n * @private\n */\n #isGridCell(column: Element): boolean {\n return column.classList.contains(this.selectors.focusElementSelector.substring(1));\n }\n\n /**\n * @param row\n * @returns\n */\n getSortedColumns(row: HTMLElement | null): (Element | HTMLElement)[] {\n return [...(row?.querySelectorAll(this.selectors.focusElementSelector) ?? [])];\n }\n\n /**\n * @param event\n */\n stopEventHandler(event: KeyboardEvent) {\n return (\n (event.target as HTMLElement).getAttribute('aria-expanded') === 'true' ||\n (event.target as HTMLElement).closest('.popper') ||\n !Object.values(this.keys).includes(event.keyCode)\n );\n }\n\n /**\n * Sets focus on the loader element and stores the column index of the current focused element.\n *\n * @param loader - The loader element that will receive focus.\n * @param currentCol - The currently focused column element whose index will be stored.\n *\n * @returns void\n */\n setFocusOnLoader(loader: HTMLElement, currentCol: HTMLElement) {\n // Store the current focussed cell - useful when coming back\n const restoreFocusRef = {\n columnIndex: [\n ...this.container.querySelectorAll(this.selectors.focusElementSelector)\n ].indexOf(currentCol)\n };\n loader.setAttribute(DATA_COLUMNINDEX, restoreFocusRef.columnIndex.toString());\n loader.focus();\n }\n\n /**\n * Handles the `Tab` key navigation within a container element .\n * Ensures that when the user tabs out of the repeating structures, focus can be restored to the\n * previously active cell (from which the user tabbed out). If `shiftKey` is pressed (indicating reverse tabbing), the focus will move to the\n * top boundary element, otherwise, it moves to the bottom boundary element.\n *\n * @param event - The keyboard event triggered by the `Tab` key.\n * @param currentCol - The current column (cell) element from which the user is tabbing out.\n * @param shiftKey - A boolean indicating if the `Shift` key is pressed (for reverse tabbing).\n *\n * @returns void\n */\n containerTabHandler(event: KeyboardEvent, currentCol: Element, shiftKey: boolean) {\n // focus should be restored to the cell\n // from which user has tabbed out from the table\n let hiddenBoundaryElement = this.selectors.bottomFocusRef\n ? this.container.parentElement?.querySelector(this.selectors.bottomFocusRef)\n : null;\n if (shiftKey) {\n hiddenBoundaryElement = this.selectors.topFocusRef\n ? this.container.parentElement?.querySelector(this.selectors.topFocusRef)\n : null;\n }\n\n const restoreFocusRef = {\n columnIndex: [\n ...this.container.querySelectorAll(this.selectors.focusElementSelector)\n ].indexOf(currentCol)\n };\n if (hiddenBoundaryElement) {\n hiddenBoundaryElement.setAttribute(DATA_COLUMNINDEX, restoreFocusRef.columnIndex.toString());\n }\n\n this.tabHandler(event);\n }\n\n /**\n * Returns the first focusable element in the `container`.\n */\n getFocusableElementOnCtrlHome(): HTMLElement | null {\n return this.container.querySelector(this.selectors.focusElementSelector);\n }\n\n /**\n * Scrolls the nearest scrollable parent of a focusable element to the top.\n *\n * @private\n */\n #scrollToTop() {\n const scrollableParent = getScrollParent(\n this.container.querySelector(this.selectors.focusElementSelector)\n );\n if (scrollableParent) {\n scrollableParent.scrollTop = 0;\n }\n }\n\n /**\n * Handles the `Ctrl + Home` keypress event.\n *\n * It focuses the first focusable element in the container of the repeating structures,\n * and ensures that the view scrolls to the top after focusing.\n *\n * @returns void\n */\n handleCtrlHomeKeypress() {\n const cellToFocus = this.getFocusableElementOnCtrlHome();\n this.#focusFirstElementInCell(cellToFocus);\n\n this.#scrollToTop();\n }\n\n /**\n * @param nextItem\n * @param currentCol\n * @param keyCode\n */\n handleAnnouncementForErrors(nextItem: Element, currentCol: Element, keyCode: number) {\n return {\n ...this,\n nextItem,\n currentCol,\n keyCode\n };\n }\n\n /**\n * @param nextCol - The next item to focus on.\n * @param currentCol- The current element that has focus.\n * override this method for specific RS template\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, class-methods-use-this\n toggleStyleFormatAriaDescription(nextCol: Element, currentCol: Element) {}\n /**\n * Handles keyboard navigation. This method processes keyboard events like arrow keys, tab, home. It updates the `tabindex` of elements and supports accessibility\n * announcements for error handling.\n *\n * @param event - The keyboard event triggered by the user.\n * @param currentCol - The current element that has focus.\n *\n * @returns void\n *\n * @private\n */\n #containerEventHandlers(event: KeyboardEvent, currentCol: Element) {\n const { keyCode, shiftKey, ctrlKey } = event;\n if (this.stopEventHandler(event)) {\n return;\n }\n let nextItem: Element | undefined | null;\n\n if (this.selectors.parentElementSelector) {\n ({ nextItem } = this.#processWithParentSelector(\n currentCol as HTMLElement,\n keyCode,\n ctrlKey,\n nextItem\n ));\n } else {\n switch (keyCode) {\n case this.keys.UP:\n case this.keys.LEFT:\n nextItem = currentCol.previousElementSibling;\n break;\n case this.keys.RIGHT:\n case this.keys.DOWN:\n nextItem = currentCol.nextElementSibling;\n break;\n case this.keys.HOME:\n if (ctrlKey) {\n nextItem = this.container.querySelector(this.selectors.focusElementSelector);\n }\n break;\n default:\n }\n }\n\n if (keyCode === this.keys.TAB) {\n this.containerTabHandler(event, currentCol, shiftKey);\n }\n if (nextItem && currentCol) {\n event.preventDefault();\n const focusableElements = this.getFocusableElementsInCell(nextItem);\n // we will be supporting focus directly on the inner focusable elements so\n // tags like a, buttons should be skipped for focus on pressing tab\n if (!!this.actionableSelectors && !!this.ariaLabel) {\n const nextActionableElements = nextItem.querySelectorAll(\n this.actionableSelectors.join(',')\n );\n const nextFocusableElements = nextItem.querySelectorAll(this.focusableSelectors.join(','));\n const currentActionableElements = currentCol.querySelectorAll(\n this.actionableSelectors.join(',')\n );\n const currentFocusableElements = nextItem.querySelectorAll(\n this.focusableSelectors.join(',')\n );\n if (nextActionableElements.length || nextFocusableElements.length > 1) {\n nextItem.setAttribute('aria-label', this.ariaLabel);\n }\n if (currentActionableElements.length || currentFocusableElements.length > 1) {\n currentCol.removeAttribute('aria-label');\n }\n }\n currentCol.setAttribute('tabindex', '-1');\n if (focusableElements.length === 1 && this.#isGridCell(nextItem)) {\n this.handleAnnouncementForErrors(focusableElements[0], currentCol, keyCode);\n gainFocus(focusableElements[0]);\n } else {\n this.handleAnnouncementForErrors(nextItem, currentCol, keyCode);\n\n gainFocus(nextItem as HTMLElement);\n }\n\n this.toggleStyleFormatAriaDescription(nextItem, currentCol);\n }\n }\n\n /**\n * This method processes keyboard navigation events and moves focus between elements inside containers,\n * based on the arrow keys (up, down, left, right) and the Home key.\n *\n * @param currentCol - The current focused column element.\n * @param keyCode - The keycode of the pressed key (e.g., arrow keys, home key).\n * @param ctrlKey - Indicates if the `Ctrl` key was held down during the key press.\n * @param nextItem - The next item to focus on, updated by this function.\n *\n * @returns - Returns an object containing the index of the current element within its parent, the index of its parent element, and the next item to focus on.\n */\n #processWithParentSelector(\n currentCol: HTMLElement,\n keyCode: number,\n ctrlKey: boolean,\n nextItem: Element | undefined | null\n ) {\n const parentElements = this.container.querySelectorAll(this.selectors.parentElementSelector!);\n const indexOfCurrentEleInParent = [\n ...(currentCol\n .closest(this.selectors.parentElementSelector!)\n ?.querySelectorAll(this.selectors.focusElementSelector) ?? [])\n ].indexOf(currentCol);\n const currentEleParentIndex = [...parentElements].indexOf(\n currentCol.closest(this.selectors.parentElementSelector!)!\n );\n const sortedColumns = this.getSortedColumns(\n currentCol.closest(this.selectors.parentElementSelector!)\n );\n switch (keyCode) {\n case this.keys.HOME:\n if (ctrlKey) {\n this.handleCtrlHomeKeypress();\n }\n break;\n case this.keys.UP: {\n // Above Loader handler\n const aboveLoader = this.selectors.aboveLoader\n ? (this.container.querySelector(this.selectors.aboveLoader) as HTMLElement | null)\n : null;\n if (aboveLoader && currentEleParentIndex - 1 === 0) {\n this.setFocusOnLoader(aboveLoader, currentCol);\n } else if (currentEleParentIndex - 1 >= 0) {\n nextItem = parentElements[currentEleParentIndex - 1].querySelectorAll(\n this.selectors.focusElementSelector\n )[indexOfCurrentEleInParent];\n }\n break;\n }\n case this.keys.DOWN: {\n // Below Loader handler\n const belowLoader = this.selectors.belowLoader\n ? (this.container.querySelector(this.selectors.belowLoader) as HTMLElement | null)\n : null;\n if (belowLoader && parentElements.length === currentEleParentIndex + 1) {\n this.setFocusOnLoader(belowLoader, currentCol);\n } else if (parentElements.length > currentEleParentIndex + 1) {\n nextItem = parentElements[currentEleParentIndex + 1].querySelectorAll(\n this.selectors.focusElementSelector\n )[indexOfCurrentEleInParent];\n }\n break;\n }\n case this.keys.LEFT:\n nextItem = sortedColumns[sortedColumns.indexOf(currentCol) - 1];\n break;\n case this.keys.RIGHT:\n nextItem = sortedColumns[sortedColumns.indexOf(currentCol) + 1];\n break;\n default:\n }\n return { indexOfCurrentEleInParent, currentEleParentIndex, nextItem };\n }\n\n /**\n * Determines if the current element contains any `focusable` element.\n */\n #isFocusableElement(element: HTMLElement) {\n const colItem = element.closest(this.selectors.focusElementSelector);\n if (!colItem) return false;\n return [...colItem.querySelectorAll(this.focusableSelectors.join(','))].includes(element);\n }\n\n /**\n * Determines if the current element contains any `Actionable` elements like TextInput, TextArea\n */\n #isActionableElement(element: HTMLElement) {\n const colItem = element.closest(this.selectors.focusElementSelector);\n if (!colItem || !this.actionableSelectors) return false;\n return [...colItem.querySelectorAll(this.actionableSelectors.join(','))].includes(element);\n }\n\n /**\n * @param {KeyboardEvent} event\n */\n dynamicLoadersKeyDownHandler(event: KeyboardEvent) {\n const { keyCode } = event;\n event.stopPropagation();\n event.preventDefault();\n\n if (\n this.container &&\n (((event.target as HTMLElement).classList.contains(\n this.selectors.aboveLoader!.substring(1)\n ) &&\n keyCode === this.keys.DOWN) ||\n ((event.target as HTMLElement).classList.contains(\n this.selectors.belowLoader!.substring(1)\n ) &&\n keyCode === this.keys.UP))\n ) {\n let restoreFocusRef;\n\n if ((event.target as HTMLElement).hasAttribute(DATA_COLUMNINDEX)) {\n restoreFocusRef = {\n columnIndex: parseInt((event.target as HTMLElement).getAttribute(DATA_COLUMNINDEX)!, 10)\n };\n this.setFocusToCell(restoreFocusRef);\n return true;\n }\n }\n return false;\n }\n\n /**\n * Handles the keyboard navigation of a repeating structures.\n *\n * @public\n */\n a11yHandler(event: KeyboardEvent) {\n const rootNode = this.container.getRootNode();\n if (!(rootNode instanceof Document || rootNode instanceof ShadowRoot)) return;\n const currentCol = rootNode.activeElement?.closest(this.selectors.focusElementSelector);\n const belowLoader = this.selectors.belowLoader\n ? this.container.querySelector(this.selectors.belowLoader)\n : null;\n const aboveLoader = this.selectors.aboveLoader\n ? this.container.querySelector(this.selectors.aboveLoader)\n : null;\n\n if (\n currentCol === rootNode.activeElement ||\n this.#isFocusableElement(rootNode.activeElement as HTMLElement) ||\n this.#isActionableElement(rootNode.activeElement as HTMLElement)\n ) {\n this.#containerEventHandlers(event, currentCol as HTMLElement);\n } else if (belowLoader === event.target || aboveLoader === event.target) {\n this.dynamicLoadersKeyDownHandler(event);\n }\n }\n\n /**\n * Sets the focus to a specific cell in the grid based on the given position. If there is exactly one focusable element in a cell,\n * focus is set on it. Otherwise, the entire cell receives focus.\n *\n * If the specified cell cannot be found, focus is set on the first focusable element.\n *\n * @param position - The position of the cell to focus.\n * @param position.columnIndex - The index of the column for which the focus should be set.\n *\n * @returns void\n */\n setFocusToCell(position: { columnIndex: number }) {\n const { columnIndex } = position;\n const cellToFocus = this.container.querySelectorAll(this.selectors.focusElementSelector)[\n columnIndex\n ];\n if (cellToFocus) {\n const focusableElements = this.getFocusableElementsInCell(cellToFocus);\n // we will be supporting focus directly on the inner focusable elements so\n // tags like a, buttons should be skipped for focus on pressing tab\n if (\n focusableElements.length === 1 &&\n this.#isGridCell(cellToFocus)\n // Enable this in EPIC-80524\n // || isSelectAllCheckbox(focusableElements[0])\n ) {\n gainFocus(focusableElements[0]);\n } else {\n gainFocus(cellToFocus as HTMLElement);\n }\n } else {\n this.focusFirstElement();\n }\n }\n\n /**\n * @param {HTMLElement | null} firstCell\n */\n #focusFirstElementInCell(firstCell: Element | null) {\n if (!firstCell) return;\n const focusableElements = this.getFocusableElementsInCell(firstCell);\n // if there is only one focusable element in cell, e.g. a[href], radio etc, focus on that\n if (focusableElements.length === 1 && this.#isGridCell(firstCell)) {\n gainFocus(focusableElements[0]);\n } else {\n // if there are multiple focusable elements in cell or the cell is not a grid cell, focus on whole cell\n\n gainFocus(firstCell as HTMLElement);\n }\n }\n\n focusFirstElement() {\n const row = this.selectors.parentElementSelector\n ? this.container.querySelector(this.selectors.parentElementSelector)\n : null;\n if (row) {\n const firstCell = row.querySelector(this.selectors.focusElementSelector);\n\n this.#focusFirstElementInCell(firstCell);\n }\n }\n\n /**\n * Handles focus events on boundary elements within the container.\n * This method stops the propagation of the focus event and checks whether the focus has moved\n * outside of the specified container. If so, it determines whether to restore focus to a specific\n * cell or to the first focusable element within the container.\n *\n * @param event - The focus event object, which includes the element that lost focus\n * (via the `relatedTarget` property).\n *\n * @returns void\n */\n boundaryElementsFocusHandler(event: FocusEvent) {\n const { relatedTarget } = event;\n event.stopPropagation();\n if (this.container && !this.container.contains(relatedTarget as HTMLElement)) {\n let restoreFocusRef;\n\n if ((event.target as HTMLElement).hasAttribute(DATA_COLUMNINDEX)) {\n restoreFocusRef = {\n columnIndex: parseInt((event.target as HTMLElement).getAttribute(DATA_COLUMNINDEX)!, 10)\n };\n }\n if (restoreFocusRef) {\n this.setFocusToCell(restoreFocusRef);\n } else {\n this.focusFirstElement();\n }\n }\n }\n}\n\nexport default BaseA11y;\n"]}
1
+ {"version":3,"file":"BaseA11y.js","sourceRoot":"","sources":["../../../../src/core/a11y/BaseA11y.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAYrD,MAAM,IAAI,GAA2B;IACnC,GAAG,EAAE,CAAC;IACN,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,EAAE;IACT,MAAM,EAAE,EAAE;IACV,IAAI,EAAE,EAAE;IACR,EAAE,EAAE,EAAE;IACN,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,EAAE;IACR,IAAI,EAAE,EAAE;CACA,CAAC;AAEX,MAAM,SAAS,GAAG,UAAU,CAAC;AAC7B,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AAE5C;;;;;GAKG;AACH,SAAS,SAAS,CAAC,OAAgC;IACjD,IAAI,CAAC,OAAO;QAAE,OAAO;IACrB,OAAO,CAAC,YAAY,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;IACrC,OAAO,CAAC,KAAK,EAAE,CAAC;AAClB,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAS,eAAe,CAAC,IAAwB;IAC/C,kCAAkC;IAClC,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QAC1C,OAAO,IAAI,CAAC;IACd,CAAC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,EACzF,CAAC;YACD,IAAI,CAAC,UAAU,CAAC,QAAQ,GAAG,KAAK,CAAC;QACnC,CAAC;IACH,CAAC;CACF;AAED,eAAe,QAAQ,CAAC","sourcesContent":["import { isInstance } from '@pega/cosmos-react-core';\n\nexport type Selectors = {\n topFocusRef?: string;\n bottomFocusRef?: string;\n focusElementSelector: string;\n parentElementSelector?: string;\n aboveLoader?: string;\n belowLoader?: string;\n addActionSelector?: string;\n};\n\nconst keys: Record<string, number> = {\n TAB: 9,\n ENTER: 13,\n SPACE: 32,\n ESCAPE: 27,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40,\n HOME: 36\n} as const;\n\nconst TAB_INDEX = 'tabindex';\nconst DATA_COLUMNINDEX = 'data-columnIndex';\n\n/**\n * Sets focus on the provided HTML element.\n * It sets the `tabindex` attribute to \"0\" to ensure the element can receive keyboard focus.\n *\n * @param element - The HTML element to be focused. If `undefined`, the function does not performing any action.\n */\nfunction gainFocus(element: HTMLElement | undefined): void {\n if (!element) return;\n element.setAttribute(TAB_INDEX, '0');\n element.focus();\n}\n\n/**\n * Recursively finds the first parent element that has scrollable content.\n *\n * This function checks whether the given HTML element or any of its parent\n * elements has a scrollable content area.\n *\n * @param node - The starting HTML element to check for scrollable content.\n * If null, the function will return null.\n *\n * @returns - The first parent element with scrollable content, or null if no such element is found.\n */\nfunction getScrollParent(node: HTMLElement | null): HTMLElement | null {\n // eslint-disable-next-line eqeqeq\n if (node == null) {\n return null;\n }\n\n if (node.scrollHeight > node.clientHeight) {\n return node;\n }\n\n return getScrollParent(node.parentNode as HTMLElement);\n}\n\nclass BaseA11y {\n selectors: Selectors;\n keys: Record<string, number>;\n container: HTMLElement;\n focusableSelectors: string[];\n actionableSelectors?: string[];\n ariaLabel?: string;\n focusState: {\n focusSnapshot: {\n rowIndex: number | undefined;\n colIndex: number | undefined;\n rowKey: string | undefined;\n };\n hadFocus: boolean;\n };\n\n /**\n *\n * @param selectors\n * @param focusableSelectors Selectors which doesn't require arrow keys/typing interaction from user\n * @param customKeys\n * @param container\n * @param actionableSelectors Selectors which require arrow keys/typing interaction from user\n * @param ariaLabel\n *\n * selectors = {\n topFocusRef: '.top',\n bottomFocusRef: '.bottom',\n focusElementSelector: '.cell',\n parentElementSelector: '.row'\n };\n customKeys = {\n TAB: 9,\n ENTER: 13,\n SPACE: 32,\n ESCAPE: 27,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40\n };\n focusableSelectors = ['button', 'a[href]'];\n actionableSelectors = ['select', 'textarea']\n ariaLabel = 'Interactive content'\n */\n constructor(\n selectors: Selectors,\n focusableSelectors: string[],\n // eslint-disable-next-line @typescript-eslint/default-param-last\n customKeys: Record<string, number> = {},\n container: HTMLElement,\n actionableSelectors?: string[],\n ariaLabel?: string\n ) {\n this.selectors = { ...selectors };\n this.keys = { ...keys, ...customKeys };\n this.container = container;\n this.focusableSelectors = focusableSelectors;\n this.actionableSelectors = actionableSelectors;\n this.ariaLabel = ariaLabel;\n this.focusState = {\n focusSnapshot: { rowIndex: undefined, colIndex: undefined, rowKey: undefined },\n hadFocus: false\n };\n }\n\n /**\n * Sets the container element\n */\n setContainer(container: HTMLElement) {\n this.container = container;\n }\n\n /**\n * Handles tab key navigation within a focusable region. It focuses on the top or bottom\n * focusable element based on the `Shift` key press in combination with the `Tab` key.\n *\n * - If `Shift + Tab` is pressed, it focuses the `topFocusableElement`.\n * - If only `Tab` is pressed, it focuses the `bottomFocusableElement`.\n *\n * @param event - The keyboard event object containing details of the pressed key.\n */\n tabHandler(event: KeyboardEvent) {\n const topFocusableElement = this.selectors.topFocusRef\n ? this.container.parentElement?.querySelector(this.selectors.topFocusRef)\n : null;\n const bottomFocusableElement = this.selectors.bottomFocusRef\n ? this.container.parentElement?.querySelector(this.selectors.bottomFocusRef)\n : null;\n if (event.shiftKey && topFocusableElement) {\n const shiftTabKeyEvent = new KeyboardEvent('keypress', {\n bubbles: true,\n cancelable: true,\n key: 'Tab',\n shiftKey: true,\n keyCode: 9\n });\n\n (topFocusableElement as HTMLElement).focus();\n topFocusableElement.dispatchEvent(shiftTabKeyEvent);\n } else if (bottomFocusableElement) {\n const keyboardEvent = new KeyboardEvent('keypress', {\n bubbles: true,\n cancelable: true,\n key: 'Tab',\n shiftKey: false,\n keyCode: 9\n });\n\n (bottomFocusableElement as HTMLElement).focus();\n bottomFocusableElement.dispatchEvent(keyboardEvent);\n }\n }\n\n /**\n * Determines whether an element can receive focus.\n * Checks that the element is not disabled, not inside an inert container, and is visible.\n *\n * @param el - The element to check for focusability.\n * @returns `true` if the element can receive focus, `false` otherwise.\n */\n static isElementFocusable(el: HTMLElement): boolean {\n return (\n !el.hasAttribute('disabled') &&\n !el.closest('[inert]') &&\n (el.checkVisibility?.() ?? getComputedStyle(el).visibility !== 'hidden')\n );\n }\n\n /**\n * Retrieves all focusable elements within a given element based on the `focusableSelectors` array.\n * Filters out disabled elements, those inside inert containers, and visually hidden elements.\n *\n * @param column - The element from which to get focusable elements.\n * @returns An array of all focusable HTML elements found inside element.\n */\n getFocusableElementsInCell(column: Element): HTMLElement[] {\n const elements = column.querySelectorAll<HTMLElement>(this.focusableSelectors.join(','));\n return [...elements].filter(el => BaseA11y.isElementFocusable(el));\n }\n\n /**\n * Determines whether a given DOM element is a grid cell.\n * @param column - The DOM element to check.\n * @returns Returns `true` if the element contains the specified CSS class, indicating it's a grid cell, otherwise `false`.\n *\n * @private\n */\n #isGridCell(column: Element): boolean {\n return column.classList.contains(this.selectors.focusElementSelector.substring(1));\n }\n\n /**\n * @param row\n */\n getSortedColumns(row: HTMLElement | null): (Element | HTMLElement)[] {\n return [...(row?.querySelectorAll(this.selectors.focusElementSelector) ?? [])];\n }\n\n /**\n * @param event\n */\n stopEventHandler(event: KeyboardEvent) {\n return (\n (event.target as HTMLElement).getAttribute('aria-expanded') === 'true' ||\n (event.target as HTMLElement).closest('.popper') ||\n !Object.values(this.keys).includes(event.keyCode)\n );\n }\n\n /**\n * Sets focus on the loader element and stores the column index of the current focused element.\n *\n * @param loader - The loader element that will receive focus.\n * @param currentCol - The currently focused column element whose index will be stored.\n *\n * @returns void\n */\n setFocusOnLoader(loader: HTMLElement, currentCol: HTMLElement) {\n // Store the current focussed cell - useful when coming back\n const restoreFocusRef = {\n columnIndex: [\n ...this.container.querySelectorAll(this.selectors.focusElementSelector)\n ].indexOf(currentCol)\n };\n loader.setAttribute(DATA_COLUMNINDEX, restoreFocusRef.columnIndex.toString());\n loader.focus();\n }\n\n /**\n * Handles the `Tab` key navigation within a container element .\n * Ensures that when the user tabs out of the repeating structures, focus can be restored to the\n * previously active cell (from which the user tabbed out). If `shiftKey` is pressed (indicating reverse tabbing), the focus will move to the\n * top boundary element, otherwise, it moves to the bottom boundary element.\n *\n * @param event - The keyboard event triggered by the `Tab` key.\n * @param currentCol - The current column (cell) element from which the user is tabbing out.\n * @param shiftKey - A boolean indicating if the `Shift` key is pressed (for reverse tabbing).\n *\n * @returns void\n */\n containerTabHandler(event: KeyboardEvent, currentCol: Element, shiftKey: boolean) {\n // focus should be restored to the cell\n // from which user has tabbed out from the table\n let hiddenBoundaryElement = this.selectors.bottomFocusRef\n ? this.container.parentElement?.querySelector(this.selectors.bottomFocusRef)\n : null;\n if (shiftKey) {\n hiddenBoundaryElement = this.selectors.topFocusRef\n ? this.container.parentElement?.querySelector(this.selectors.topFocusRef)\n : null;\n }\n\n const restoreFocusRef = {\n columnIndex: [\n ...this.container.querySelectorAll(this.selectors.focusElementSelector)\n ].indexOf(currentCol)\n };\n if (hiddenBoundaryElement) {\n hiddenBoundaryElement.setAttribute(DATA_COLUMNINDEX, restoreFocusRef.columnIndex.toString());\n }\n\n this.tabHandler(event);\n }\n\n /**\n * Returns the first focusable element in the `container`.\n */\n getFocusableElementOnCtrlHome(): HTMLElement | null {\n return this.container.querySelector(this.selectors.focusElementSelector);\n }\n\n /**\n * Scrolls the nearest scrollable parent of a focusable element to the top.\n *\n * @private\n */\n #scrollToTop() {\n const scrollableParent = getScrollParent(\n this.container.querySelector(this.selectors.focusElementSelector)\n );\n if (scrollableParent) {\n scrollableParent.scrollTop = 0;\n }\n }\n\n /**\n * Handles the `Ctrl + Home` keypress event.\n *\n * It focuses the first focusable element in the container of the repeating structures,\n * and ensures that the view scrolls to the top after focusing.\n *\n * @returns void\n */\n handleCtrlHomeKeypress() {\n const cellToFocus = this.getFocusableElementOnCtrlHome();\n this.#focusFirstElementInCell(cellToFocus);\n\n this.#scrollToTop();\n }\n\n /**\n * @param nextItem\n * @param currentCol\n * @param keyCode\n */\n handleAnnouncementForErrors(nextItem: Element, currentCol: Element, keyCode: number) {\n return {\n ...this,\n nextItem,\n currentCol,\n keyCode\n };\n }\n\n /**\n * @param nextCol - The next item to focus on.\n * @param currentCol- The current element that has focus.\n * override this method for specific RS template\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, class-methods-use-this\n toggleStyleFormatAriaDescription(nextCol: Element, currentCol: Element) {}\n /**\n * Handles keyboard navigation. This method processes keyboard events like arrow keys, tab, home. It updates the `tabindex` of elements and supports accessibility\n * announcements for error handling.\n *\n * @param event - The keyboard event triggered by the user.\n * @param currentCol - The current element that has focus.\n *\n * @returns void\n *\n * @private\n */\n #containerEventHandlers(event: KeyboardEvent, currentCol: Element) {\n const { keyCode, shiftKey, ctrlKey } = event;\n if (this.stopEventHandler(event)) {\n return;\n }\n let nextItem: Element | undefined | null;\n\n if (this.selectors.parentElementSelector) {\n ({ nextItem } = this.#processWithParentSelector(\n currentCol as HTMLElement,\n keyCode,\n ctrlKey,\n nextItem\n ));\n } else {\n switch (keyCode) {\n case this.keys.UP:\n case this.keys.LEFT:\n nextItem = currentCol.previousElementSibling;\n break;\n case this.keys.RIGHT:\n case this.keys.DOWN:\n nextItem = currentCol.nextElementSibling;\n break;\n case this.keys.HOME:\n if (ctrlKey) {\n nextItem = this.container.querySelector(this.selectors.focusElementSelector);\n }\n break;\n default:\n }\n }\n\n if (keyCode === this.keys.TAB) {\n this.containerTabHandler(event, currentCol, shiftKey);\n }\n if (nextItem && currentCol) {\n event.preventDefault();\n const focusableElements = this.getFocusableElementsInCell(nextItem);\n // we will be supporting focus directly on the inner focusable elements so\n // tags like a, buttons should be skipped for focus on pressing tab\n if (!!this.actionableSelectors && !!this.ariaLabel) {\n const nextActionableElements = nextItem.querySelectorAll(\n this.actionableSelectors.join(',')\n );\n const nextFocusableElements = nextItem.querySelectorAll(this.focusableSelectors.join(','));\n const currentActionableElements = currentCol.querySelectorAll(\n this.actionableSelectors.join(',')\n );\n const currentFocusableElements = nextItem.querySelectorAll(\n this.focusableSelectors.join(',')\n );\n if (nextActionableElements.length || nextFocusableElements.length > 1) {\n nextItem.setAttribute('aria-label', this.ariaLabel);\n }\n if (currentActionableElements.length || currentFocusableElements.length > 1) {\n currentCol.removeAttribute('aria-label');\n }\n }\n currentCol.setAttribute('tabindex', '-1');\n if (focusableElements.length === 1 && this.#isGridCell(nextItem)) {\n this.handleAnnouncementForErrors(focusableElements[0], currentCol, keyCode);\n gainFocus(focusableElements[0]);\n } else {\n this.handleAnnouncementForErrors(nextItem, currentCol, keyCode);\n\n gainFocus(nextItem as HTMLElement);\n }\n\n this.toggleStyleFormatAriaDescription(nextItem, currentCol);\n }\n }\n\n /**\n * This method processes keyboard navigation events and moves focus between elements inside containers,\n * based on the arrow keys (up, down, left, right) and the Home key.\n *\n * @param currentCol - The current focused column element.\n * @param keyCode - The keycode of the pressed key (e.g., arrow keys, home key).\n * @param ctrlKey - Indicates if the `Ctrl` key was held down during the key press.\n * @param nextItem - The next item to focus on, updated by this function.\n *\n * @returns - Returns an object containing the index of the current element within its parent, the index of its parent element, and the next item to focus on.\n */\n #processWithParentSelector(\n currentCol: HTMLElement,\n keyCode: number,\n ctrlKey: boolean,\n nextItem: Element | undefined | null\n ) {\n const parentElements = this.container.querySelectorAll(this.selectors.parentElementSelector!);\n const indexOfCurrentEleInParent = [\n ...(currentCol\n .closest(this.selectors.parentElementSelector!)\n ?.querySelectorAll(this.selectors.focusElementSelector) ?? [])\n ].indexOf(currentCol);\n const currentEleParentIndex = [...parentElements].indexOf(\n currentCol.closest(this.selectors.parentElementSelector!)!\n );\n const sortedColumns = this.getSortedColumns(\n currentCol.closest(this.selectors.parentElementSelector!)\n );\n switch (keyCode) {\n case this.keys.HOME:\n if (ctrlKey) {\n this.handleCtrlHomeKeypress();\n }\n break;\n case this.keys.UP: {\n // Above Loader handler\n const aboveLoader = this.selectors.aboveLoader\n ? (this.container.querySelector(this.selectors.aboveLoader) as HTMLElement | null)\n : null;\n if (aboveLoader && currentEleParentIndex - 1 === 0) {\n this.setFocusOnLoader(aboveLoader, currentCol);\n } else if (currentEleParentIndex - 1 >= 0) {\n nextItem = parentElements[currentEleParentIndex - 1].querySelectorAll(\n this.selectors.focusElementSelector\n )[indexOfCurrentEleInParent];\n }\n break;\n }\n case this.keys.DOWN: {\n // Below Loader handler\n const belowLoader = this.selectors.belowLoader\n ? (this.container.querySelector(this.selectors.belowLoader) as HTMLElement | null)\n : null;\n if (belowLoader && parentElements.length === currentEleParentIndex + 1) {\n this.setFocusOnLoader(belowLoader, currentCol);\n } else if (parentElements.length > currentEleParentIndex + 1) {\n nextItem = parentElements[currentEleParentIndex + 1].querySelectorAll(\n this.selectors.focusElementSelector\n )[indexOfCurrentEleInParent];\n }\n break;\n }\n case this.keys.LEFT:\n nextItem = sortedColumns[sortedColumns.indexOf(currentCol) - 1];\n break;\n case this.keys.RIGHT:\n nextItem = sortedColumns[sortedColumns.indexOf(currentCol) + 1];\n break;\n default:\n }\n return { indexOfCurrentEleInParent, currentEleParentIndex, nextItem };\n }\n\n /**\n * Determines if the current element contains any `focusable` element.\n */\n #isFocusableElement(element: HTMLElement) {\n const colItem = element.closest(this.selectors.focusElementSelector);\n if (!colItem) return false;\n return [...colItem.querySelectorAll(this.focusableSelectors.join(','))].includes(element);\n }\n\n /**\n * Determines if the current element contains any `Actionable` elements like TextInput, TextArea\n */\n #isActionableElement(element: HTMLElement) {\n const colItem = element.closest(this.selectors.focusElementSelector);\n if (!colItem || !this.actionableSelectors) return false;\n return [...colItem.querySelectorAll(this.actionableSelectors.join(','))].includes(element);\n }\n\n /**\n * @param event\n */\n dynamicLoadersKeyDownHandler(event: KeyboardEvent) {\n const { keyCode } = event;\n event.stopPropagation();\n event.preventDefault();\n\n if (\n this.container &&\n (((event.target as HTMLElement).classList.contains(\n this.selectors.aboveLoader!.substring(1)\n ) &&\n keyCode === this.keys.DOWN) ||\n ((event.target as HTMLElement).classList.contains(\n this.selectors.belowLoader!.substring(1)\n ) &&\n keyCode === this.keys.UP))\n ) {\n let restoreFocusRef;\n\n if ((event.target as HTMLElement).hasAttribute(DATA_COLUMNINDEX)) {\n restoreFocusRef = {\n columnIndex: parseInt((event.target as HTMLElement).getAttribute(DATA_COLUMNINDEX)!, 10)\n };\n this.setFocusToCell(restoreFocusRef);\n return true;\n }\n }\n return false;\n }\n\n /**\n * Handles the keyboard navigation of a repeating structures.\n *\n * @public\n */\n a11yHandler(event: KeyboardEvent) {\n const rootNode = this.container.getRootNode();\n if (!isInstance(rootNode, Document, ShadowRoot)) return;\n const currentCol = rootNode.activeElement?.closest(this.selectors.focusElementSelector);\n const belowLoader = this.selectors.belowLoader\n ? this.container.querySelector(this.selectors.belowLoader)\n : null;\n const aboveLoader = this.selectors.aboveLoader\n ? this.container.querySelector(this.selectors.aboveLoader)\n : null;\n\n if (\n currentCol === rootNode.activeElement ||\n this.#isFocusableElement(rootNode.activeElement as HTMLElement) ||\n this.#isActionableElement(rootNode.activeElement as HTMLElement)\n ) {\n this.#containerEventHandlers(event, currentCol as HTMLElement);\n } else if (belowLoader === event.target || aboveLoader === event.target) {\n this.dynamicLoadersKeyDownHandler(event);\n }\n }\n\n /**\n * Sets the focus to a specific cell in the grid based on the given position. If there is exactly one focusable element in a cell,\n * focus is set on it. Otherwise, the entire cell receives focus.\n *\n * If the specified cell cannot be found, focus is set on the first focusable element.\n *\n * @param position - The position of the cell to focus.\n * @param position.columnIndex - The index of the column for which the focus should be set.\n *\n * @returns void\n */\n setFocusToCell(position: { columnIndex: number }) {\n const { columnIndex } = position;\n const cellToFocus = this.container.querySelectorAll(this.selectors.focusElementSelector)[\n columnIndex\n ];\n if (cellToFocus) {\n const focusableElements = this.getFocusableElementsInCell(cellToFocus);\n // we will be supporting focus directly on the inner focusable elements so\n // tags like a, buttons should be skipped for focus on pressing tab\n if (\n focusableElements.length === 1 &&\n this.#isGridCell(cellToFocus)\n // Enable this in EPIC-80524\n // || isSelectAllCheckbox(focusableElements[0])\n ) {\n gainFocus(focusableElements[0]);\n } else {\n gainFocus(cellToFocus as HTMLElement);\n }\n } else {\n this.focusFirstElement();\n }\n }\n\n /**\n * @param firstCell\n */\n #focusFirstElementInCell(firstCell: Element | null) {\n if (!firstCell) return;\n const focusableElements = this.getFocusableElementsInCell(firstCell);\n // if there is only one focusable element in cell, e.g. a[href], radio etc, focus on that\n if (focusableElements.length === 1 && this.#isGridCell(firstCell)) {\n gainFocus(focusableElements[0]);\n } else {\n // if there are multiple focusable elements in cell or the cell is not a grid cell, focus on whole cell\n\n gainFocus(firstCell as HTMLElement);\n }\n }\n\n focusFirstElement() {\n const row = this.selectors.parentElementSelector\n ? this.container.querySelector(this.selectors.parentElementSelector)\n : null;\n if (row) {\n const firstCell = row.querySelector(this.selectors.focusElementSelector);\n\n this.#focusFirstElementInCell(firstCell);\n }\n }\n\n /**\n * Handles focus events on boundary elements within the container.\n * This method stops the propagation of the focus event and checks whether the focus has moved\n * outside of the specified container. If so, it determines whether to restore focus to a specific\n * cell or to the first focusable element within the container.\n *\n * @param event - The focus event object, which includes the element that lost focus\n * (via the `relatedTarget` property).\n *\n * @returns void\n */\n boundaryElementsFocusHandler(event: FocusEvent) {\n const { relatedTarget } = event;\n event.stopPropagation();\n if (this.container && !this.container.contains(relatedTarget as HTMLElement)) {\n let restoreFocusRef;\n\n if ((event.target as HTMLElement).hasAttribute(DATA_COLUMNINDEX)) {\n restoreFocusRef = {\n columnIndex: parseInt((event.target as HTMLElement).getAttribute(DATA_COLUMNINDEX)!, 10)\n };\n }\n if (restoreFocusRef) {\n this.setFocusToCell(restoreFocusRef);\n } else {\n this.focusFirstElement();\n }\n }\n }\n\n onFocusHandler() {\n this.focusState.hadFocus = true;\n }\n\n onBlurHandler(event: FocusEvent) {\n const currentTarget = event.currentTarget;\n const relatedTarget = event.relatedTarget;\n // If relatedTarget is within the currentTarget i.e. RS container, skip the blur event capture as focus is still within the container.\n if (\n relatedTarget === null ||\n !(currentTarget && (currentTarget as HTMLElement).contains(relatedTarget as HTMLElement))\n ) {\n this.focusState.hadFocus = false;\n }\n }\n}\n\nexport default BaseA11y;\n"]}
@@ -16,10 +16,12 @@ declare const ActionTypes: {
16
16
  readonly TOGGLE_PIN: "togglePin";
17
17
  readonly TOGGLE_PIN_AT_INDEX: "togglePinAtIndex";
18
18
  readonly COLUMN_SORT: "columnSort";
19
+ readonly SET_WARNING_MESSAGES: "setWarningMessages";
19
20
  readonly UPDATE_SORT: "updateSort";
20
21
  readonly BOOTSTRAP: "bootstrap";
21
22
  readonly PAGINATE: "paginate";
22
23
  readonly ROW_HEIGHT_CHANGE: "rowHeightChange";
24
+ readonly GALLERY_LAYOUT_CHANGE: "galleryLayoutChange";
23
25
  readonly COLUMN_RESIZE: "columnResize";
24
26
  readonly COLUMN_TOGGLE: "columnToggle";
25
27
  readonly HIDDEN_COLUMN_UPDATE: "hiddenColumnUpdate";
@@ -29,6 +31,7 @@ declare const ActionTypes: {
29
31
  readonly UPDATE_GROUPING_SORT: "updateGroupingSort";
30
32
  readonly TOGGLE_EXPAND_COLLAPSE: "toggleExpandCollapse";
31
33
  readonly ADD_GROUPS: "addGroups";
34
+ readonly SET_GROUP_SNAPSHOT: "setGroupSnapshot";
32
35
  readonly SEARCH: "search";
33
36
  readonly COLUMN_MERGE: "columnMerge";
34
37
  readonly CUSTOM_COLUMN_DELETE: "customColumnDelete";
@@ -45,18 +48,15 @@ declare const ActionTypes: {
45
48
  readonly UPDATE_AGGREGATIONS: "updateAggregations";
46
49
  readonly UPDATE_TABLE_HEIGHT: "updateTableHeight";
47
50
  readonly CHANGE_RENDERER_FORMATTER: "changeRenderFormatter";
51
+ readonly REMOVE_RENDERER_FORMATTER: "removeRenderFormatter";
48
52
  readonly CHANGE_LABEL: "changeLabel";
49
53
  readonly REPLACE_LABELS: "replaceLabels";
50
- readonly UPDATE_CHANGE_SET: "updateChangeSet";
51
- readonly SUBMIT_CHANGE_SET: "submitChangeSet";
52
- readonly CLEAR_CHANGE_SET: "clearChangeSet";
53
54
  readonly SHOW_HEADER_ICONS: "showHeaderIcons";
54
55
  readonly CHANGE_CELL_MODE: "changeCellMode";
55
56
  readonly FORCE_UPDATE: "forceUpdate";
56
57
  readonly FORCE_REFRESH: "forceRefresh";
57
58
  readonly TOGGLE_EXPAND_COLLAPSE_ALL: "toggleExpandCollapseAll";
58
59
  readonly UPDATE_STATE_VERSION: "updateStateVersion";
59
- readonly TOGGLE_SELECTALL_CHECKBOX: "toggleSelectAllCheckbox";
60
60
  readonly TOGGLE_DISABLE_SELECTION: "toggleDisableSelection";
61
61
  readonly UPDATE_DEBUG_INFO: "updateDebugInfo";
62
62
  readonly TOGGLE_REQUIRED: "toggleRequired";
@@ -69,6 +69,9 @@ declare const ActionTypes: {
69
69
  readonly SET_DOM_CONTAINER_BREAKPOINTS: "setDomContainerResponsiveBreakpoints";
70
70
  readonly UPDATE_COLUMNS_VISIBILITY: "updateColumnsVisibility";
71
71
  readonly SET_CONDITIONAL_STYLE_FORMATS: "setConditionalStyleFormats";
72
+ readonly ADD_COLUMN_VISIBILITY: "addColumnVisibility";
73
+ readonly VISIBLE_COLUMN_UPDATE: "visibleColumnUpdate";
74
+ readonly CHANGE_TEMPLATE: "changeTemplate";
72
75
  };
73
76
  export default ActionTypes;
74
77
  export type ActionType = (typeof ActionTypes)[keyof typeof ActionTypes];
@@ -1 +1 @@
1
- {"version":3,"file":"actionConstants.d.ts","sourceRoot":"","sources":["../../../../src/core/actions/actionConstants.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8EP,CAAC;AAEX,eAAe,WAAW,CAAC;AAC3B,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC"}
1
+ {"version":3,"file":"actionConstants.d.ts","sourceRoot":"","sources":["../../../../src/core/actions/actionConstants.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiFP,CAAC;AAEX,eAAe,WAAW,CAAC;AAC3B,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC"}
@@ -19,10 +19,12 @@ const ActionTypes = {
19
19
  TOGGLE_PIN: 'togglePin',
20
20
  TOGGLE_PIN_AT_INDEX: 'togglePinAtIndex',
21
21
  COLUMN_SORT: 'columnSort',
22
+ SET_WARNING_MESSAGES: 'setWarningMessages',
22
23
  UPDATE_SORT: 'updateSort',
23
24
  BOOTSTRAP: 'bootstrap',
24
25
  PAGINATE: 'paginate',
25
26
  ROW_HEIGHT_CHANGE: 'rowHeightChange',
27
+ GALLERY_LAYOUT_CHANGE: 'galleryLayoutChange',
26
28
  COLUMN_RESIZE: 'columnResize',
27
29
  COLUMN_TOGGLE: 'columnToggle',
28
30
  HIDDEN_COLUMN_UPDATE: 'hiddenColumnUpdate',
@@ -32,6 +34,7 @@ const ActionTypes = {
32
34
  UPDATE_GROUPING_SORT: 'updateGroupingSort',
33
35
  TOGGLE_EXPAND_COLLAPSE: 'toggleExpandCollapse',
34
36
  ADD_GROUPS: 'addGroups',
37
+ SET_GROUP_SNAPSHOT: 'setGroupSnapshot',
35
38
  SEARCH: 'search',
36
39
  COLUMN_MERGE: 'columnMerge',
37
40
  CUSTOM_COLUMN_DELETE: 'customColumnDelete',
@@ -48,18 +51,15 @@ const ActionTypes = {
48
51
  UPDATE_AGGREGATIONS: 'updateAggregations',
49
52
  UPDATE_TABLE_HEIGHT: 'updateTableHeight',
50
53
  CHANGE_RENDERER_FORMATTER: 'changeRenderFormatter',
54
+ REMOVE_RENDERER_FORMATTER: 'removeRenderFormatter',
51
55
  CHANGE_LABEL: 'changeLabel',
52
56
  REPLACE_LABELS: 'replaceLabels',
53
- UPDATE_CHANGE_SET: 'updateChangeSet',
54
- SUBMIT_CHANGE_SET: 'submitChangeSet',
55
- CLEAR_CHANGE_SET: 'clearChangeSet',
56
57
  SHOW_HEADER_ICONS: 'showHeaderIcons',
57
58
  CHANGE_CELL_MODE: 'changeCellMode',
58
59
  FORCE_UPDATE: 'forceUpdate',
59
60
  FORCE_REFRESH: 'forceRefresh',
60
61
  TOGGLE_EXPAND_COLLAPSE_ALL: 'toggleExpandCollapseAll',
61
62
  UPDATE_STATE_VERSION: 'updateStateVersion',
62
- TOGGLE_SELECTALL_CHECKBOX: 'toggleSelectAllCheckbox',
63
63
  // Dispatch Action constants that is used by consumer in order to send particular actions to Repeating structures
64
64
  TOGGLE_DISABLE_SELECTION: 'toggleDisableSelection',
65
65
  UPDATE_DEBUG_INFO: 'updateDebugInfo',
@@ -72,7 +72,10 @@ const ActionTypes = {
72
72
  SET_DATA_ERROR: 'setDataError',
73
73
  SET_DOM_CONTAINER_BREAKPOINTS: 'setDomContainerResponsiveBreakpoints',
74
74
  UPDATE_COLUMNS_VISIBILITY: 'updateColumnsVisibility',
75
- SET_CONDITIONAL_STYLE_FORMATS: 'setConditionalStyleFormats'
75
+ SET_CONDITIONAL_STYLE_FORMATS: 'setConditionalStyleFormats',
76
+ ADD_COLUMN_VISIBILITY: 'addColumnVisibility',
77
+ VISIBLE_COLUMN_UPDATE: 'visibleColumnUpdate',
78
+ CHANGE_TEMPLATE: 'changeTemplate'
76
79
  };
77
80
  export default ActionTypes;
78
81
  //# sourceMappingURL=actionConstants.js.map