@elliemae/ds-datagrids 3.15.0 → 3.16.0-next.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (380) hide show
  1. package/dist/cjs/DSDataGrid.js +249 -241
  2. package/dist/cjs/DSDataGrid.js.map +2 -2
  3. package/dist/cjs/DataGridImpl.js +11 -11
  4. package/dist/cjs/DataGridImpl.js.map +1 -1
  5. package/dist/cjs/PaginatedDataGrid.js +9 -9
  6. package/dist/cjs/PaginatedDataGrid.js.map +2 -2
  7. package/dist/cjs/components/BodyList.js +3 -5
  8. package/dist/cjs/components/BodyList.js.map +2 -2
  9. package/dist/cjs/components/ColumnVisibilityMenuOption.js +1 -6
  10. package/dist/cjs/components/ColumnVisibilityMenuOption.js.map +2 -2
  11. package/dist/cjs/components/ColumnsOptionsMenuSection.js +2 -11
  12. package/dist/cjs/components/ColumnsOptionsMenuSection.js.map +2 -2
  13. package/dist/cjs/components/EmptyState.js +5 -6
  14. package/dist/cjs/components/EmptyState.js.map +3 -3
  15. package/dist/cjs/components/List.js +2 -2
  16. package/dist/cjs/components/List.js.map +2 -2
  17. package/dist/cjs/components/ListItem.js +3 -6
  18. package/dist/cjs/components/ListItem.js.map +2 -2
  19. package/dist/cjs/components/NoResults.js +4 -10
  20. package/dist/cjs/components/NoResults.js.map +2 -2
  21. package/dist/cjs/components/RowsLoader.js +1 -1
  22. package/dist/cjs/components/RowsLoader.js.map +1 -1
  23. package/dist/cjs/components/Table.js +5 -5
  24. package/dist/cjs/components/Table.js.map +1 -1
  25. package/dist/cjs/components/TableBody.js +2 -7
  26. package/dist/cjs/components/TableBody.js.map +2 -2
  27. package/dist/cjs/components/TableHeader.js +1 -1
  28. package/dist/cjs/components/TableHeader.js.map +2 -2
  29. package/dist/cjs/components/footer/addOptionalFooterComponents.js +1 -1
  30. package/dist/cjs/components/footer/addOptionalFooterComponents.js.map +1 -1
  31. package/dist/cjs/components/index.js +5 -5
  32. package/dist/cjs/components/index.js.map +1 -1
  33. package/dist/cjs/components/renderers/defaultClassedRenderers.js +16 -36
  34. package/dist/cjs/components/renderers/defaultClassedRenderers.js.map +2 -2
  35. package/dist/cjs/components/renderers/index.js +2 -2
  36. package/dist/cjs/components/renderers/index.js.map +1 -1
  37. package/dist/cjs/components/renderers/renderRowsLoader.js +2 -4
  38. package/dist/cjs/components/renderers/renderRowsLoader.js.map +2 -2
  39. package/dist/cjs/defaultPlugins.js +5 -10
  40. package/dist/cjs/defaultPlugins.js.map +2 -2
  41. package/dist/cjs/index.js +9 -9
  42. package/dist/cjs/index.js.map +1 -1
  43. package/dist/cjs/package.json +7 -0
  44. package/dist/cjs/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js +22 -18
  45. package/dist/cjs/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js.map +2 -2
  46. package/dist/cjs/plugins/body-header-scroll-sync/index.js +1 -1
  47. package/dist/cjs/plugins/body-header-scroll-sync/index.js.map +1 -1
  48. package/dist/cjs/plugins/column-dnd/DndColumnsPlugin.js +1 -1
  49. package/dist/cjs/plugins/column-dnd/DndColumnsPlugin.js.map +1 -1
  50. package/dist/cjs/plugins/column-dnd/index.js +1 -1
  51. package/dist/cjs/plugins/column-dnd/index.js.map +1 -1
  52. package/dist/cjs/plugins/column-sizing/ColumnSizingPlugin.js +4 -4
  53. package/dist/cjs/plugins/column-sizing/ColumnSizingPlugin.js.map +1 -1
  54. package/dist/cjs/plugins/column-sizing/ext-points/decorateColumn.js +1 -1
  55. package/dist/cjs/plugins/column-sizing/ext-points/decorateColumn.js.map +1 -1
  56. package/dist/cjs/plugins/column-sizing/ext-points/getTableProps.js +1 -1
  57. package/dist/cjs/plugins/column-sizing/ext-points/getTableProps.js.map +1 -1
  58. package/dist/cjs/plugins/column-sizing/index.js +1 -1
  59. package/dist/cjs/plugins/column-sizing/index.js.map +1 -1
  60. package/dist/cjs/plugins/column-sizing/useColumnSizeService.js +7 -26
  61. package/dist/cjs/plugins/column-sizing/useColumnSizeService.js.map +2 -2
  62. package/dist/cjs/plugins/column-sizing/useStylesheetHelpers.js +2 -2
  63. package/dist/cjs/plugins/column-sizing/useStylesheetHelpers.js.map +1 -1
  64. package/dist/cjs/plugins/custom-cell-renderer/CustomRendererPlugin.js +1 -1
  65. package/dist/cjs/plugins/custom-cell-renderer/CustomRendererPlugin.js.map +1 -1
  66. package/dist/cjs/plugins/custom-cell-renderer/addCustomRendererToCell.js +1 -1
  67. package/dist/cjs/plugins/custom-cell-renderer/addCustomRendererToCell.js.map +1 -1
  68. package/dist/cjs/plugins/custom-cell-renderer/getRendererComponent.js +1 -1
  69. package/dist/cjs/plugins/custom-cell-renderer/getRendererComponent.js.map +1 -1
  70. package/dist/cjs/plugins/custom-cell-renderer/index.js +1 -1
  71. package/dist/cjs/plugins/custom-cell-renderer/index.js.map +1 -1
  72. package/dist/cjs/plugins/editable/EditableComponents/ComboBox.js.map +1 -1
  73. package/dist/cjs/plugins/editable/EditableComponents/TextBox.js.map +1 -1
  74. package/dist/cjs/plugins/editable/EditableComponents/index.js +2 -2
  75. package/dist/cjs/plugins/editable/EditableComponents/index.js.map +1 -1
  76. package/dist/cjs/plugins/editable/EditablePlugin.js +1 -1
  77. package/dist/cjs/plugins/editable/EditablePlugin.js.map +1 -1
  78. package/dist/cjs/plugins/editable/decorateEditable.js +1 -1
  79. package/dist/cjs/plugins/editable/decorateEditable.js.map +1 -1
  80. package/dist/cjs/plugins/editable/getEditorComponent.js +3 -16
  81. package/dist/cjs/plugins/editable/getEditorComponent.js.map +2 -2
  82. package/dist/cjs/plugins/editable/index.js +2 -2
  83. package/dist/cjs/plugins/editable/index.js.map +1 -1
  84. package/dist/cjs/plugins/expandable-grid/ExpandableColumn.js +23 -25
  85. package/dist/cjs/plugins/expandable-grid/ExpandableColumn.js.map +2 -2
  86. package/dist/cjs/plugins/expandable-grid/ExpandablePlugin.js +5 -5
  87. package/dist/cjs/plugins/expandable-grid/ExpandablePlugin.js.map +2 -2
  88. package/dist/cjs/plugins/expandable-grid/ExpandedRow.js +6 -6
  89. package/dist/cjs/plugins/expandable-grid/ExpandedRow.js.map +1 -1
  90. package/dist/cjs/plugins/expandable-grid/ExpandedRowExtra.js +12 -8
  91. package/dist/cjs/plugins/expandable-grid/ExpandedRowExtra.js.map +2 -2
  92. package/dist/cjs/plugins/expandable-grid/index.js +2 -2
  93. package/dist/cjs/plugins/expandable-grid/index.js.map +1 -1
  94. package/dist/cjs/plugins/expandable-grid/useExpandGridState.js.map +2 -2
  95. package/dist/cjs/plugins/export-data/index.js +1 -1
  96. package/dist/cjs/plugins/export-data/index.js.map +1 -1
  97. package/dist/cjs/plugins/filterable/FilterablePlugin.js +3 -3
  98. package/dist/cjs/plugins/filterable/FilterablePlugin.js.map +2 -2
  99. package/dist/cjs/plugins/filterable/addFilterToColumn.js +1 -1
  100. package/dist/cjs/plugins/filterable/addFilterToColumn.js.map +1 -1
  101. package/dist/cjs/plugins/filterable/components/FilterableHeader.js +1 -1
  102. package/dist/cjs/plugins/filterable/components/FilterableHeader.js.map +2 -2
  103. package/dist/cjs/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js +45 -47
  104. package/dist/cjs/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js.map +2 -2
  105. package/dist/cjs/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js +46 -48
  106. package/dist/cjs/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js.map +2 -2
  107. package/dist/cjs/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js +43 -45
  108. package/dist/cjs/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js.map +2 -2
  109. package/dist/cjs/plugins/filterable/components/filterable-menus/TextFilterMenu.js +3 -3
  110. package/dist/cjs/plugins/filterable/components/filterable-menus/TextFilterMenu.js.map +2 -2
  111. package/dist/cjs/plugins/filterable/components/filterable-menus/getFilterMenuByType.js +5 -7
  112. package/dist/cjs/plugins/filterable/components/filterable-menus/getFilterMenuByType.js.map +2 -2
  113. package/dist/cjs/plugins/filterable/filterableFormatter.js +29 -37
  114. package/dist/cjs/plugins/filterable/filterableFormatter.js.map +2 -2
  115. package/dist/cjs/plugins/filterable/filtering-helper/filterRowsByQuery.js +2 -4
  116. package/dist/cjs/plugins/filterable/filtering-helper/filterRowsByQuery.js.map +2 -2
  117. package/dist/cjs/plugins/filterable/filtering-helper/strategiesOperators.js.map +2 -2
  118. package/dist/cjs/plugins/filterable/helper.js.map +2 -2
  119. package/dist/cjs/plugins/filterable/index.js +1 -1
  120. package/dist/cjs/plugins/filterable/index.js.map +1 -1
  121. package/dist/cjs/plugins/filterable/useFilterableState.js +3 -7
  122. package/dist/cjs/plugins/filterable/useFilterableState.js.map +2 -2
  123. package/dist/cjs/plugins/grouping-grid/GroupingPlugin.js +4 -4
  124. package/dist/cjs/plugins/grouping-grid/GroupingPlugin.js.map +2 -2
  125. package/dist/cjs/plugins/grouping-grid/walkStrategy.js.map +2 -2
  126. package/dist/cjs/plugins/index.js +16 -16
  127. package/dist/cjs/plugins/index.js.map +1 -1
  128. package/dist/cjs/plugins/infinite-scrolling/index.js +1 -1
  129. package/dist/cjs/plugins/infinite-scrolling/index.js.map +1 -1
  130. package/dist/cjs/plugins/pagination/PaginationPlugin.js +4 -4
  131. package/dist/cjs/plugins/pagination/PaginationPlugin.js.map +2 -2
  132. package/dist/cjs/plugins/pagination/components/Pagination.js +5 -24
  133. package/dist/cjs/plugins/pagination/components/Pagination.js.map +2 -2
  134. package/dist/cjs/plugins/pagination/components/PerPageDropdown.js +2 -2
  135. package/dist/cjs/plugins/pagination/components/PerPageDropdown.js.map +2 -2
  136. package/dist/cjs/plugins/pagination/helper.js.map +2 -2
  137. package/dist/cjs/plugins/pagination/index.js +1 -1
  138. package/dist/cjs/plugins/pagination/index.js.map +1 -1
  139. package/dist/cjs/plugins/pagination/usePaginationState.js +1 -1
  140. package/dist/cjs/plugins/pagination/usePaginationState.js.map +1 -1
  141. package/dist/cjs/plugins/resizable/ResizablePlugin.js +1 -1
  142. package/dist/cjs/plugins/resizable/ResizablePlugin.js.map +1 -1
  143. package/dist/cjs/plugins/resizable/decorateResizable.js +4 -2
  144. package/dist/cjs/plugins/resizable/decorateResizable.js.map +2 -2
  145. package/dist/cjs/plugins/resizable/index.js +1 -1
  146. package/dist/cjs/plugins/resizable/index.js.map +1 -1
  147. package/dist/cjs/plugins/resizable/useResizeHandle.js +2 -12
  148. package/dist/cjs/plugins/resizable/useResizeHandle.js.map +2 -2
  149. package/dist/cjs/plugins/row-dnd/index.js +1 -1
  150. package/dist/cjs/plugins/row-dnd/index.js.map +1 -1
  151. package/dist/cjs/plugins/selectable/SelectablePlugin.js +3 -3
  152. package/dist/cjs/plugins/selectable/SelectablePlugin.js.map +1 -1
  153. package/dist/cjs/plugins/selectable/addSelectableColumn.js +1 -1
  154. package/dist/cjs/plugins/selectable/addSelectableColumn.js.map +1 -1
  155. package/dist/cjs/plugins/selectable/index.js +1 -1
  156. package/dist/cjs/plugins/selectable/index.js.map +1 -1
  157. package/dist/cjs/plugins/selectable/selectableFormatter.js +1 -1
  158. package/dist/cjs/plugins/selectable/selectableFormatter.js.map +2 -2
  159. package/dist/cjs/plugins/selectable/useSelectableState.js +1 -1
  160. package/dist/cjs/plugins/selectable/useSelectableState.js.map +2 -2
  161. package/dist/cjs/plugins/sortable/SortablePlugin.js +3 -3
  162. package/dist/cjs/plugins/sortable/SortablePlugin.js.map +1 -1
  163. package/dist/cjs/plugins/sortable/index.js +1 -1
  164. package/dist/cjs/plugins/sortable/index.js.map +1 -1
  165. package/dist/cjs/plugins/sortable/sortTree.js.map +2 -2
  166. package/dist/cjs/plugins/sortable/useSortableState.js +2 -4
  167. package/dist/cjs/plugins/sortable/useSortableState.js.map +2 -2
  168. package/dist/cjs/plugins/toolbar/RowRenderer.js +2 -2
  169. package/dist/cjs/plugins/toolbar/RowRenderer.js.map +1 -1
  170. package/dist/cjs/plugins/toolbar/ToolbarPlugin.js +1 -1
  171. package/dist/cjs/plugins/toolbar/ToolbarPlugin.js.map +1 -1
  172. package/dist/cjs/plugins/toolbar/index.js +1 -1
  173. package/dist/cjs/plugins/toolbar/index.js.map +1 -1
  174. package/dist/cjs/plugins/virtualization/AutoHeightList.js.map +2 -2
  175. package/dist/cjs/plugins/virtualization/VirtualizationPlugin.js +2 -2
  176. package/dist/cjs/plugins/virtualization/VirtualizationPlugin.js.map +2 -2
  177. package/dist/cjs/plugins/virtualization/VirtualizedBody.js +4 -4
  178. package/dist/cjs/plugins/virtualization/VirtualizedBody.js.map +1 -1
  179. package/dist/cjs/plugins/virtualization/index.js +1 -1
  180. package/dist/cjs/plugins/virtualization/index.js.map +1 -1
  181. package/dist/cjs/renders/CellWithAddons.js +1 -1
  182. package/dist/cjs/renders/CellWithAddons.js.map +1 -1
  183. package/dist/cjs/renders/index.js +2 -2
  184. package/dist/cjs/renders/index.js.map +1 -1
  185. package/dist/cjs/rowSizes.js +1 -5
  186. package/dist/cjs/rowSizes.js.map +2 -2
  187. package/dist/cjs/utilities/getPluginsFromProps.js +13 -13
  188. package/dist/cjs/utilities/getPluginsFromProps.js.map +1 -1
  189. package/dist/cjs/utilities/normalizeData.js.map +2 -2
  190. package/dist/esm/DSDataGrid.js +125 -117
  191. package/dist/esm/DSDataGrid.js.map +2 -2
  192. package/dist/esm/DataGridImpl.js +11 -11
  193. package/dist/esm/DataGridImpl.js.map +1 -1
  194. package/dist/esm/PaginatedDataGrid.js +9 -9
  195. package/dist/esm/PaginatedDataGrid.js.map +2 -2
  196. package/dist/esm/components/BodyList.js +3 -5
  197. package/dist/esm/components/BodyList.js.map +2 -2
  198. package/dist/esm/components/ColumnVisibilityMenuOption.js +1 -6
  199. package/dist/esm/components/ColumnVisibilityMenuOption.js.map +2 -2
  200. package/dist/esm/components/ColumnsOptionsMenuSection.js +2 -11
  201. package/dist/esm/components/ColumnsOptionsMenuSection.js.map +2 -2
  202. package/dist/esm/components/EmptyState.js +1 -2
  203. package/dist/esm/components/EmptyState.js.map +2 -2
  204. package/dist/esm/components/List.js +2 -2
  205. package/dist/esm/components/List.js.map +2 -2
  206. package/dist/esm/components/ListItem.js +3 -6
  207. package/dist/esm/components/ListItem.js.map +2 -2
  208. package/dist/esm/components/NoResults.js +4 -10
  209. package/dist/esm/components/NoResults.js.map +2 -2
  210. package/dist/esm/components/RowsLoader.js +1 -1
  211. package/dist/esm/components/RowsLoader.js.map +1 -1
  212. package/dist/esm/components/Table.js +5 -5
  213. package/dist/esm/components/Table.js.map +1 -1
  214. package/dist/esm/components/TableBody.js +2 -7
  215. package/dist/esm/components/TableBody.js.map +2 -2
  216. package/dist/esm/components/TableHeader.js +1 -1
  217. package/dist/esm/components/TableHeader.js.map +2 -2
  218. package/dist/esm/components/footer/addOptionalFooterComponents.js +1 -1
  219. package/dist/esm/components/footer/addOptionalFooterComponents.js.map +1 -1
  220. package/dist/esm/components/index.js +5 -5
  221. package/dist/esm/components/index.js.map +1 -1
  222. package/dist/esm/components/renderers/defaultClassedRenderers.js +16 -40
  223. package/dist/esm/components/renderers/defaultClassedRenderers.js.map +2 -2
  224. package/dist/esm/components/renderers/index.js +2 -2
  225. package/dist/esm/components/renderers/index.js.map +1 -1
  226. package/dist/esm/components/renderers/renderRowsLoader.js +2 -4
  227. package/dist/esm/components/renderers/renderRowsLoader.js.map +2 -2
  228. package/dist/esm/defaultPlugins.js +5 -10
  229. package/dist/esm/defaultPlugins.js.map +2 -2
  230. package/dist/esm/index.js +9 -9
  231. package/dist/esm/index.js.map +1 -1
  232. package/dist/esm/package.json +7 -0
  233. package/dist/esm/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js +22 -18
  234. package/dist/esm/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js.map +2 -2
  235. package/dist/esm/plugins/body-header-scroll-sync/index.js +1 -1
  236. package/dist/esm/plugins/body-header-scroll-sync/index.js.map +1 -1
  237. package/dist/esm/plugins/column-dnd/DndColumnsPlugin.js +1 -1
  238. package/dist/esm/plugins/column-dnd/DndColumnsPlugin.js.map +1 -1
  239. package/dist/esm/plugins/column-dnd/index.js +1 -1
  240. package/dist/esm/plugins/column-dnd/index.js.map +1 -1
  241. package/dist/esm/plugins/column-sizing/ColumnSizingPlugin.js +4 -4
  242. package/dist/esm/plugins/column-sizing/ColumnSizingPlugin.js.map +1 -1
  243. package/dist/esm/plugins/column-sizing/ext-points/decorateColumn.js +1 -1
  244. package/dist/esm/plugins/column-sizing/ext-points/decorateColumn.js.map +1 -1
  245. package/dist/esm/plugins/column-sizing/ext-points/getTableProps.js +1 -1
  246. package/dist/esm/plugins/column-sizing/ext-points/getTableProps.js.map +1 -1
  247. package/dist/esm/plugins/column-sizing/index.js +1 -1
  248. package/dist/esm/plugins/column-sizing/index.js.map +1 -1
  249. package/dist/esm/plugins/column-sizing/useColumnSizeService.js +7 -26
  250. package/dist/esm/plugins/column-sizing/useColumnSizeService.js.map +2 -2
  251. package/dist/esm/plugins/column-sizing/useStylesheetHelpers.js +2 -2
  252. package/dist/esm/plugins/column-sizing/useStylesheetHelpers.js.map +1 -1
  253. package/dist/esm/plugins/custom-cell-renderer/CustomRendererPlugin.js +1 -1
  254. package/dist/esm/plugins/custom-cell-renderer/CustomRendererPlugin.js.map +1 -1
  255. package/dist/esm/plugins/custom-cell-renderer/addCustomRendererToCell.js +1 -1
  256. package/dist/esm/plugins/custom-cell-renderer/addCustomRendererToCell.js.map +1 -1
  257. package/dist/esm/plugins/custom-cell-renderer/getRendererComponent.js +1 -1
  258. package/dist/esm/plugins/custom-cell-renderer/getRendererComponent.js.map +1 -1
  259. package/dist/esm/plugins/custom-cell-renderer/index.js +1 -1
  260. package/dist/esm/plugins/custom-cell-renderer/index.js.map +1 -1
  261. package/dist/esm/plugins/editable/EditableComponents/ComboBox.js.map +1 -1
  262. package/dist/esm/plugins/editable/EditableComponents/TextBox.js.map +1 -1
  263. package/dist/esm/plugins/editable/EditableComponents/index.js +2 -2
  264. package/dist/esm/plugins/editable/EditableComponents/index.js.map +1 -1
  265. package/dist/esm/plugins/editable/EditablePlugin.js +1 -1
  266. package/dist/esm/plugins/editable/EditablePlugin.js.map +1 -1
  267. package/dist/esm/plugins/editable/decorateEditable.js +1 -1
  268. package/dist/esm/plugins/editable/decorateEditable.js.map +1 -1
  269. package/dist/esm/plugins/editable/getEditorComponent.js +3 -16
  270. package/dist/esm/plugins/editable/getEditorComponent.js.map +2 -2
  271. package/dist/esm/plugins/editable/index.js +2 -2
  272. package/dist/esm/plugins/editable/index.js.map +1 -1
  273. package/dist/esm/plugins/expandable-grid/ExpandableColumn.js +23 -25
  274. package/dist/esm/plugins/expandable-grid/ExpandableColumn.js.map +2 -2
  275. package/dist/esm/plugins/expandable-grid/ExpandablePlugin.js +5 -5
  276. package/dist/esm/plugins/expandable-grid/ExpandablePlugin.js.map +2 -2
  277. package/dist/esm/plugins/expandable-grid/ExpandedRow.js +6 -6
  278. package/dist/esm/plugins/expandable-grid/ExpandedRow.js.map +1 -1
  279. package/dist/esm/plugins/expandable-grid/ExpandedRowExtra.js +12 -8
  280. package/dist/esm/plugins/expandable-grid/ExpandedRowExtra.js.map +2 -2
  281. package/dist/esm/plugins/expandable-grid/index.js +2 -2
  282. package/dist/esm/plugins/expandable-grid/index.js.map +1 -1
  283. package/dist/esm/plugins/expandable-grid/useExpandGridState.js.map +2 -2
  284. package/dist/esm/plugins/export-data/index.js +1 -1
  285. package/dist/esm/plugins/export-data/index.js.map +1 -1
  286. package/dist/esm/plugins/filterable/FilterablePlugin.js +3 -3
  287. package/dist/esm/plugins/filterable/FilterablePlugin.js.map +2 -2
  288. package/dist/esm/plugins/filterable/addFilterToColumn.js +1 -1
  289. package/dist/esm/plugins/filterable/addFilterToColumn.js.map +1 -1
  290. package/dist/esm/plugins/filterable/components/FilterableHeader.js +1 -1
  291. package/dist/esm/plugins/filterable/components/FilterableHeader.js.map +2 -2
  292. package/dist/esm/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js +45 -47
  293. package/dist/esm/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js.map +2 -2
  294. package/dist/esm/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js +46 -48
  295. package/dist/esm/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js.map +2 -2
  296. package/dist/esm/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js +43 -45
  297. package/dist/esm/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js.map +2 -2
  298. package/dist/esm/plugins/filterable/components/filterable-menus/TextFilterMenu.js +3 -3
  299. package/dist/esm/plugins/filterable/components/filterable-menus/TextFilterMenu.js.map +2 -2
  300. package/dist/esm/plugins/filterable/components/filterable-menus/getFilterMenuByType.js +5 -7
  301. package/dist/esm/plugins/filterable/components/filterable-menus/getFilterMenuByType.js.map +2 -2
  302. package/dist/esm/plugins/filterable/filterableFormatter.js +29 -37
  303. package/dist/esm/plugins/filterable/filterableFormatter.js.map +2 -2
  304. package/dist/esm/plugins/filterable/filtering-helper/filterRowsByQuery.js +2 -4
  305. package/dist/esm/plugins/filterable/filtering-helper/filterRowsByQuery.js.map +2 -2
  306. package/dist/esm/plugins/filterable/filtering-helper/strategiesOperators.js.map +2 -2
  307. package/dist/esm/plugins/filterable/helper.js +1 -7
  308. package/dist/esm/plugins/filterable/helper.js.map +2 -2
  309. package/dist/esm/plugins/filterable/index.js +1 -1
  310. package/dist/esm/plugins/filterable/index.js.map +1 -1
  311. package/dist/esm/plugins/filterable/useFilterableState.js +3 -11
  312. package/dist/esm/plugins/filterable/useFilterableState.js.map +2 -2
  313. package/dist/esm/plugins/grouping-grid/GroupingPlugin.js +4 -4
  314. package/dist/esm/plugins/grouping-grid/GroupingPlugin.js.map +2 -2
  315. package/dist/esm/plugins/grouping-grid/walkStrategy.js.map +2 -2
  316. package/dist/esm/plugins/index.js +16 -16
  317. package/dist/esm/plugins/index.js.map +1 -1
  318. package/dist/esm/plugins/infinite-scrolling/index.js +1 -1
  319. package/dist/esm/plugins/infinite-scrolling/index.js.map +1 -1
  320. package/dist/esm/plugins/pagination/PaginationPlugin.js +4 -4
  321. package/dist/esm/plugins/pagination/PaginationPlugin.js.map +2 -2
  322. package/dist/esm/plugins/pagination/components/Pagination.js +5 -24
  323. package/dist/esm/plugins/pagination/components/Pagination.js.map +2 -2
  324. package/dist/esm/plugins/pagination/components/PerPageDropdown.js +2 -2
  325. package/dist/esm/plugins/pagination/components/PerPageDropdown.js.map +2 -2
  326. package/dist/esm/plugins/pagination/helper.js.map +2 -2
  327. package/dist/esm/plugins/pagination/index.js +1 -1
  328. package/dist/esm/plugins/pagination/index.js.map +1 -1
  329. package/dist/esm/plugins/pagination/usePaginationState.js +1 -1
  330. package/dist/esm/plugins/pagination/usePaginationState.js.map +1 -1
  331. package/dist/esm/plugins/resizable/ResizablePlugin.js +1 -1
  332. package/dist/esm/plugins/resizable/ResizablePlugin.js.map +1 -1
  333. package/dist/esm/plugins/resizable/decorateResizable.js +4 -2
  334. package/dist/esm/plugins/resizable/decorateResizable.js.map +2 -2
  335. package/dist/esm/plugins/resizable/index.js +1 -1
  336. package/dist/esm/plugins/resizable/index.js.map +1 -1
  337. package/dist/esm/plugins/resizable/useResizeHandle.js +2 -12
  338. package/dist/esm/plugins/resizable/useResizeHandle.js.map +2 -2
  339. package/dist/esm/plugins/row-dnd/index.js +1 -1
  340. package/dist/esm/plugins/row-dnd/index.js.map +1 -1
  341. package/dist/esm/plugins/selectable/SelectablePlugin.js +3 -3
  342. package/dist/esm/plugins/selectable/SelectablePlugin.js.map +1 -1
  343. package/dist/esm/plugins/selectable/addSelectableColumn.js +1 -1
  344. package/dist/esm/plugins/selectable/addSelectableColumn.js.map +1 -1
  345. package/dist/esm/plugins/selectable/index.js +1 -1
  346. package/dist/esm/plugins/selectable/index.js.map +1 -1
  347. package/dist/esm/plugins/selectable/selectableFormatter.js +1 -1
  348. package/dist/esm/plugins/selectable/selectableFormatter.js.map +2 -2
  349. package/dist/esm/plugins/selectable/useSelectableState.js +1 -5
  350. package/dist/esm/plugins/selectable/useSelectableState.js.map +2 -2
  351. package/dist/esm/plugins/sortable/SortablePlugin.js +3 -3
  352. package/dist/esm/plugins/sortable/SortablePlugin.js.map +1 -1
  353. package/dist/esm/plugins/sortable/index.js +1 -1
  354. package/dist/esm/plugins/sortable/index.js.map +1 -1
  355. package/dist/esm/plugins/sortable/sortTree.js.map +2 -2
  356. package/dist/esm/plugins/sortable/useSortableState.js +2 -4
  357. package/dist/esm/plugins/sortable/useSortableState.js.map +2 -2
  358. package/dist/esm/plugins/toolbar/RowRenderer.js +2 -2
  359. package/dist/esm/plugins/toolbar/RowRenderer.js.map +1 -1
  360. package/dist/esm/plugins/toolbar/ToolbarPlugin.js +1 -1
  361. package/dist/esm/plugins/toolbar/ToolbarPlugin.js.map +1 -1
  362. package/dist/esm/plugins/toolbar/index.js +1 -1
  363. package/dist/esm/plugins/toolbar/index.js.map +1 -1
  364. package/dist/esm/plugins/virtualization/AutoHeightList.js.map +2 -2
  365. package/dist/esm/plugins/virtualization/VirtualizationPlugin.js +2 -2
  366. package/dist/esm/plugins/virtualization/VirtualizationPlugin.js.map +2 -2
  367. package/dist/esm/plugins/virtualization/VirtualizedBody.js +4 -4
  368. package/dist/esm/plugins/virtualization/VirtualizedBody.js.map +1 -1
  369. package/dist/esm/plugins/virtualization/index.js +1 -1
  370. package/dist/esm/plugins/virtualization/index.js.map +1 -1
  371. package/dist/esm/renders/CellWithAddons.js +1 -1
  372. package/dist/esm/renders/CellWithAddons.js.map +1 -1
  373. package/dist/esm/renders/index.js +2 -2
  374. package/dist/esm/renders/index.js.map +1 -1
  375. package/dist/esm/rowSizes.js +1 -5
  376. package/dist/esm/rowSizes.js.map +2 -2
  377. package/dist/esm/utilities/getPluginsFromProps.js +13 -13
  378. package/dist/esm/utilities/getPluginsFromProps.js.map +1 -1
  379. package/dist/esm/utilities/normalizeData.js.map +2 -2
  380. package/package.json +22 -21
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/plugins/filterable/filtering-helper/filterRowsByQuery.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { isFunction } from '@elliemae/ds-utilities';\nimport { strategiesOperators } from './strategiesOperators';\n\nconst getRuleStrategyOperator = (rule) => rule.strategy || strategiesOperators(rule.operator);\n\nconst executeFilterStrategy = (rule, row) => {\n const { value, field, transform, transformRowValue } = rule;\n if (field === 'all') return Object.values(row).some((colValue) => strategiesOperators('contains')(colValue, value));\n const rowValue = row[field];\n const transformedValue = isFunction(transform) ? transform(value) : value;\n const transformedRowValue = isFunction(transformRowValue) ? transformRowValue(rowValue) : rowValue;\n\n const filterStrategy = getRuleStrategyOperator(rule);\n return filterStrategy(transformedRowValue, transformedValue);\n};\n\nconst filterByRules =\n (rules, condition = 'AND') =>\n (row) =>\n condition === 'AND'\n ? rules.reduce(\n (isFiltered, rule) =>\n rule.rules && rule.rules.length\n ? isFiltered && filterByRules(rule.rules, rule.condition)(row)\n : isFiltered && executeFilterStrategy(rule, row),\n true,\n )\n : rules.some((rule) =>\n rule.rules && rule.rules.length\n ? filterByRules(rule.rules, rule.condition)(row)\n : executeFilterStrategy(rule, row),\n );\n\nexport function filterRowsByQueryGroup(rows, query, composedRows) {\n if (query && query.rules && query.rules.length === 0) return rows;\n const newRows = [];\n const parentMap = {};\n composedRows.forEach((parentRow) => {\n if (parentRow.isGroup) {\n newRows.push({\n ...parentRow,\n _filtered: true,\n });\n } else if (!parentRow.isGroup && filterByRules(query.rules, query.condition)(parentRow.data)) {\n newRows.push({\n ...parentRow,\n _filtered: true,\n });\n parentMap[parentRow.parentNode.id] = true;\n }\n });\n\n return newRows.filter((r) => {\n if (r.isGroup && !parentMap[r.id]) return false;\n return true;\n });\n}\n\nexport const filterRowsByQuery = (rows, query) => {\n return rows.filter(filterByRules(query.rules, query.condition));\n};\n\nexport default filterRowsByQuery;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,kBAAkB;AAC3B,SAAS,2BAA2B;AAEpC,MAAM,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A,QACX,GAAG;AAAA,QACH,WAAW;AAAA,MACb,CAAC;AACD,gBAAU,UAAU,WAAW,MAAM;AAAA,IACvC;AAAA,EACF,CAAC;AAED,SAAO,QAAQ,OAAO,CAAC,MAAM;AAC3B,QAAI,EAAE,WAAW,CAAC,UAAU,EAAE;AAAK,aAAO;AAC1C,WAAO;AAAA,EACT,CAAC;AACH;AAEO,MAAM,oBAAoB,CAAC,MAAM,UAAU;AAChD,SAAO,KAAK,OAAO,cAAc,MAAM,OAAO,MAAM,SAAS,CAAC;AAChE;AAEA,IAAO,4BAAQ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { isFunction } from '@elliemae/ds-utilities';\nimport { strategiesOperators } from './strategiesOperators.js';\n\nconst getRuleStrategyOperator = (rule) => rule.strategy || strategiesOperators(rule.operator);\n\nconst executeFilterStrategy = (rule, row) => {\n const { value, field, transform, transformRowValue } = rule;\n if (field === 'all') return Object.values(row).some((colValue) => strategiesOperators('contains')(colValue, value));\n const rowValue = row[field];\n const transformedValue = isFunction(transform) ? transform(value) : value;\n const transformedRowValue = isFunction(transformRowValue) ? transformRowValue(rowValue) : rowValue;\n\n const filterStrategy = getRuleStrategyOperator(rule);\n return filterStrategy(transformedRowValue, transformedValue);\n};\n\nconst filterByRules =\n (rules, condition = 'AND') =>\n (row) =>\n condition === 'AND'\n ? rules.reduce(\n (isFiltered, rule) =>\n rule.rules && rule.rules.length\n ? isFiltered && filterByRules(rule.rules, rule.condition)(row)\n : isFiltered && executeFilterStrategy(rule, row),\n true,\n )\n : rules.some((rule) =>\n rule.rules && rule.rules.length\n ? filterByRules(rule.rules, rule.condition)(row)\n : executeFilterStrategy(rule, row),\n );\n\nexport function filterRowsByQueryGroup(rows, query, composedRows) {\n if (query && query.rules && query.rules.length === 0) return rows;\n const newRows = [];\n const parentMap = {};\n composedRows.forEach((parentRow) => {\n if (parentRow.isGroup) {\n newRows.push({\n ...parentRow,\n _filtered: true,\n });\n } else if (!parentRow.isGroup && filterByRules(query.rules, query.condition)(parentRow.data)) {\n newRows.push({\n ...parentRow,\n _filtered: true,\n });\n parentMap[parentRow.parentNode.id] = true;\n }\n });\n\n return newRows.filter((r) => {\n if (r.isGroup && !parentMap[r.id]) return false;\n return true;\n });\n}\n\nexport const filterRowsByQuery = (rows, query) => rows.filter(filterByRules(query.rules, query.condition));\n\nexport default filterRowsByQuery;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,kBAAkB;AAC3B,SAAS,2BAA2B;AAEpC,MAAM,0BAA0B,CAAC,SAAS,KAAK,YAAY,oBAAoB,KAAK,QAAQ;AAE5F,MAAM,wBAAwB,CAAC,MAAM,QAAQ;AAC3C,QAAM,EAAE,OAAO,OAAO,WAAW,kBAAkB,IAAI;AACvD,MAAI,UAAU;AAAO,WAAO,OAAO,OAAO,GAAG,EAAE,KAAK,CAAC,aAAa,oBAAoB,UAAU,EAAE,UAAU,KAAK,CAAC;AAClH,QAAM,WAAW,IAAI;AACrB,QAAM,mBAAmB,WAAW,SAAS,IAAI,UAAU,KAAK,IAAI;AACpE,QAAM,sBAAsB,WAAW,iBAAiB,IAAI,kBAAkB,QAAQ,IAAI;AAE1F,QAAM,iBAAiB,wBAAwB,IAAI;AACnD,SAAO,eAAe,qBAAqB,gBAAgB;AAC7D;AAEA,MAAM,gBACJ,CAAC,OAAO,YAAY,UACpB,CAAC,QACC,cAAc,QACV,MAAM;AAAA,EACJ,CAAC,YAAY,SACX,KAAK,SAAS,KAAK,MAAM,SACrB,cAAc,cAAc,KAAK,OAAO,KAAK,SAAS,EAAE,GAAG,IAC3D,cAAc,sBAAsB,MAAM,GAAG;AAAA,EACnD;AACF,IACA,MAAM;AAAA,EAAK,CAAC,SACV,KAAK,SAAS,KAAK,MAAM,SACrB,cAAc,KAAK,OAAO,KAAK,SAAS,EAAE,GAAG,IAC7C,sBAAsB,MAAM,GAAG;AACrC;AAED,SAAS,uBAAuB,MAAM,OAAO,cAAc;AAChE,MAAI,SAAS,MAAM,SAAS,MAAM,MAAM,WAAW;AAAG,WAAO;AAC7D,QAAM,UAAU,CAAC;AACjB,QAAM,YAAY,CAAC;AACnB,eAAa,QAAQ,CAAC,cAAc;AAClC,QAAI,UAAU,SAAS;AACrB,cAAQ,KAAK;AAAA,QACX,GAAG;AAAA,QACH,WAAW;AAAA,MACb,CAAC;AAAA,IACH,WAAW,CAAC,UAAU,WAAW,cAAc,MAAM,OAAO,MAAM,SAAS,EAAE,UAAU,IAAI,GAAG;AAC5F,cAAQ,KAAK;AAAA,QACX,GAAG;AAAA,QACH,WAAW;AAAA,MACb,CAAC;AACD,gBAAU,UAAU,WAAW,MAAM;AAAA,IACvC;AAAA,EACF,CAAC;AAED,SAAO,QAAQ,OAAO,CAAC,MAAM;AAC3B,QAAI,EAAE,WAAW,CAAC,UAAU,EAAE;AAAK,aAAO;AAC1C,WAAO;AAAA,EACT,CAAC;AACH;AAEO,MAAM,oBAAoB,CAAC,MAAM,UAAU,KAAK,OAAO,cAAc,MAAM,OAAO,MAAM,SAAS,CAAC;AAEzG,IAAO,4BAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/plugins/filterable/filtering-helper/strategiesOperators.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import compare from 'comparejs';\n\nexport const strategiesOperators = op =>\n ({\n range: (rowValue, { start, end }) => start <= rowValue && end >= rowValue,\n equal: (value1, value2) => compare.id(value1, value2),\n greaterThan: compare.gt,\n lessThan: compare.lt,\n contains: (rowValue, value) =>\n String(rowValue)\n .toLowerCase()\n .indexOf(String(value).toLowerCase()) !== -1,\n }[op] || compare.id);\n\nexport default strategiesOperators;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,OAAO,aAAa;AAEb,MAAM,sBAAsB,SAChC;AAAA,EACC,OAAO,CAAC,UAAU,EAAE,OAAO,IAAI,MAAM,SAAS,YAAY,OAAO;AAAA,EACjE,OAAO,CAAC,QAAQ,WAAW,QAAQ,GAAG,QAAQ,MAAM;AAAA,EACpD,aAAa,QAAQ;AAAA,EACrB,UAAU,QAAQ;AAAA,EAClB,UAAU,CAAC,UAAU,UACnB,OAAO,QAAQ,EACZ,YAAY,EACZ,QAAQ,OAAO,KAAK,EAAE,YAAY,CAAC,MAAM;AAChD,GAAE,OAAO,QAAQ;AAEnB,IAAO,8BAAQ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import compare from 'comparejs';\n\nexport const strategiesOperators = (op) =>\n ({\n range: (rowValue, { start, end }) => start <= rowValue && end >= rowValue,\n equal: (value1, value2) => compare.id(value1, value2),\n greaterThan: compare.gt,\n lessThan: compare.lt,\n contains: (rowValue, value) => String(rowValue).toLowerCase().indexOf(String(value).toLowerCase()) !== -1,\n }[op] || compare.id);\n\nexport default strategiesOperators;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,OAAO,aAAa;AAEb,MAAM,sBAAsB,CAAC,QACjC;AAAA,EACC,OAAO,CAAC,UAAU,EAAE,OAAO,IAAI,MAAM,SAAS,YAAY,OAAO;AAAA,EACjE,OAAO,CAAC,QAAQ,WAAW,QAAQ,GAAG,QAAQ,MAAM;AAAA,EACpD,aAAa,QAAQ;AAAA,EACrB,UAAU,QAAQ;AAAA,EAClB,UAAU,CAAC,UAAU,UAAU,OAAO,QAAQ,EAAE,YAAY,EAAE,QAAQ,OAAO,KAAK,EAAE,YAAY,CAAC,MAAM;AACzG,GAAE,OAAO,QAAQ;AAEnB,IAAO,8BAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,11 +1,5 @@
1
1
  import * as React from "react";
2
- import {
3
- isFunction,
4
- uniqBy,
5
- get,
6
- groupBy,
7
- property
8
- } from "@elliemae/ds-utilities";
2
+ import { isFunction, uniqBy, get, groupBy, property } from "@elliemae/ds-utilities";
9
3
  const getFilterLabel = (column, value) => column.filterLabels ? column.filterLabels[value] || value : value;
10
4
  const getFilterLabels = (column, rows) => uniqBy(rows, property(column.searchBy || column.property)).map((row) => {
11
5
  const value = get(row, column.searchBy || column.property);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/filterable/helper.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import {\n isFunction,\n uniqBy,\n get,\n groupBy,\n property,\n} from '@elliemae/ds-utilities';\n\nexport const getFilterLabel = (column, value) => (column.filterLabels ? column.filterLabels[value] || value : value);\n\nexport const getFilterLabels = (column, rows) =>\n uniqBy(rows, property(column.searchBy || column.property))\n .map((row) => {\n const value = get(row, column.searchBy || column.property);\n if (value === undefined) return {};\n const rowColumnValue = String(get(row, column.searchBy || column.property));\n if (isFunction(column.valueTransformation)) {\n const nextValue = column.valueTransformation(rowColumnValue);\n return { id: nextValue, label: nextValue };\n }\n const label = getFilterLabel(column, rowColumnValue);\n return { id: rowColumnValue || label, label };\n })\n .filter((row) => row.id)\n .filter((row) => {\n if (row.id.startsWith) return !row.id.startsWith('grouped-by');\n return true;\n });\n\nexport const getFilterLabelsGroup = (column, rows) => {\n let flat = [];\n rows.forEach((r) => {\n if (r.children) {\n flat = [...flat, ...r.children];\n }\n });\n return getFilterLabels(column, flat);\n};\n\nexport function getFilterValue(filter, column) {\n const { value } = filter;\n\n if (!column) return value;\n\n const { filterOptions, filterLabels } = column;\n\n if (filterOptions) {\n const foundOption = column.filterOptions.filter((option) => option.id === value)[0];\n if (foundOption) return foundOption.label;\n return value;\n }\n if (filterLabels) {\n return filterLabels[value];\n }\n\n return value;\n}\n\nexport function buildFilterArray(newFilter, filters) {\n // if (newFilter.type && newFilter.type === 'date') return [...filters.slice(1), newFilter]\n return uniqBy([...filters, newFilter], (v) => [v.group, v.value].join());\n}\n\nexport const groupFilters = (filters) => filters.filter((filter) => !filter.fixed);\n\nfunction parseFilterToRule(filter) {\n return {\n ...filter,\n value: filter.filterParams || filter.value,\n field: filter.group,\n };\n}\n\nexport function parseFiltersToQuery(filters) {\n const groupedFilters = groupBy(groupFilters(filters), (filter) => filter.group);\n return Object.keys(groupedFilters).reduce(\n (queryResult, field) => {\n const filter = groupedFilters[field];\n if (Array.isArray(filter) && filter.length > 1) {\n // create query group with 'OR' condition\n queryResult.rules.push({\n condition: 'OR',\n rules: filter.map(parseFilterToRule),\n });\n } else {\n queryResult.rules.push(parseFilterToRule(filter[0]));\n }\n return queryResult;\n },\n { condition: 'AND', rules: [] },\n );\n}\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEA,MAAM,iBAAiB,CAAC,QAAQ,UAAW,OAAO,eAAe,OAAO,aAAa,UAAU,QAAQ;AAEvG,MAAM,kBAAkB,CAAC,QAAQ,SACtC,OAAO,MAAM,SAAS,OAAO,YAAY,OAAO,QAAQ,CAAC,EACtD,IAAI,CAAC,QAAQ;AACZ,QAAM,QAAQ,IAAI,KAAK,OAAO,YAAY,OAAO,QAAQ;AACzD,MAAI,UAAU;AAAW,WAAO,CAAC;AACjC,QAAM,iBAAiB,OAAO,IAAI,KAAK,OAAO,YAAY,OAAO,QAAQ,CAAC;AAC1E,MAAI,WAAW,OAAO,mBAAmB,GAAG;AAC1C,UAAM,YAAY,OAAO,oBAAoB,cAAc;AAC3D,WAAO,EAAE,IAAI,WAAW,OAAO,UAAU;AAAA,EAC3C;AACA,QAAM,QAAQ,eAAe,QAAQ,cAAc;AACnD,SAAO,EAAE,IAAI,kBAAkB,OAAO,MAAM;AAC9C,CAAC,EACA,OAAO,CAAC,QAAQ,IAAI,EAAE,EACtB,OAAO,CAAC,QAAQ;AACf,MAAI,IAAI,GAAG;AAAY,WAAO,CAAC,IAAI,GAAG,WAAW,YAAY;AAC7D,SAAO;AACT,CAAC;AAEE,MAAM,uBAAuB,CAAC,QAAQ,SA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C,CAAC;AAAA,MACH,OAAO;AACL,oBAAY,MAAM,KAAK,kBAAkB,OAAO,EAAE,CAAC;AAAA,MACrD;AACA,aAAO;AAAA,IACT;AAAA,IACA,EAAE,WAAW,OAAO,OAAO,CAAC,EAAE;AAAA,EAChC;AACF;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { isFunction, uniqBy, get, groupBy, property } from '@elliemae/ds-utilities';\n\nexport const getFilterLabel = (column, value) => (column.filterLabels ? column.filterLabels[value] || value : value);\n\nexport const getFilterLabels = (column, rows) =>\n uniqBy(rows, property(column.searchBy || column.property))\n .map((row) => {\n const value = get(row, column.searchBy || column.property);\n if (value === undefined) return {};\n const rowColumnValue = String(get(row, column.searchBy || column.property));\n if (isFunction(column.valueTransformation)) {\n const nextValue = column.valueTransformation(rowColumnValue);\n return { id: nextValue, label: nextValue };\n }\n const label = getFilterLabel(column, rowColumnValue);\n return { id: rowColumnValue || label, label };\n })\n .filter((row) => row.id)\n .filter((row) => {\n if (row.id.startsWith) return !row.id.startsWith('grouped-by');\n return true;\n });\n\nexport const getFilterLabelsGroup = (column, rows) => {\n let flat = [];\n rows.forEach((r) => {\n if (r.children) {\n flat = [...flat, ...r.children];\n }\n });\n return getFilterLabels(column, flat);\n};\n\nexport function getFilterValue(filter, column) {\n const { value } = filter;\n\n if (!column) return value;\n\n const { filterOptions, filterLabels } = column;\n\n if (filterOptions) {\n const foundOption = column.filterOptions.filter((option) => option.id === value)[0];\n if (foundOption) return foundOption.label;\n return value;\n }\n if (filterLabels) {\n return filterLabels[value];\n }\n\n return value;\n}\n\nexport function buildFilterArray(newFilter, filters) {\n // if (newFilter.type && newFilter.type === 'date') return [...filters.slice(1), newFilter]\n return uniqBy([...filters, newFilter], (v) => [v.group, v.value].join());\n}\n\nexport const groupFilters = (filters) => filters.filter((filter) => !filter.fixed);\n\nfunction parseFilterToRule(filter) {\n return {\n ...filter,\n value: filter.filterParams || filter.value,\n field: filter.group,\n };\n}\n\nexport function parseFiltersToQuery(filters) {\n const groupedFilters = groupBy(groupFilters(filters), (filter) => filter.group);\n return Object.keys(groupedFilters).reduce(\n (queryResult, field) => {\n const filter = groupedFilters[field];\n if (Array.isArray(filter) && filter.length > 1) {\n // create query group with 'OR' condition\n queryResult.rules.push({\n condition: 'OR',\n rules: filter.map(parseFilterToRule),\n });\n } else {\n queryResult.rules.push(parseFilterToRule(filter[0]));\n }\n return queryResult;\n },\n { condition: 'AND', rules: [] },\n );\n}\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,YAAY,QAAQ,KAAK,SAAS,gBAAgB;AAEpD,MAAM,iBAAiB,CAAC,QAAQ,UAAW,OAAO,eAAe,OAAO,aAAa,UAAU,QAAQ;AAEvG,MAAM,kBAAkB,CAAC,QAAQ,SACtC,OAAO,MAAM,SAAS,OAAO,YAAY,OAAO,QAAQ,CAAC,EACtD,IAAI,CAAC,QAAQ;AACZ,QAAM,QAAQ,IAAI,KAAK,OAAO,YAAY,OAAO,QAAQ;AACzD,MAAI,UAAU;AAAW,WAAO,CAAC;AACjC,QAAM,iBAAiB,OAAO,IAAI,KAAK,OAAO,YAAY,OAAO,QAAQ,CAAC;AAC1E,MAAI,WAAW,OAAO,mBAAmB,GAAG;AAC1C,UAAM,YAAY,OAAO,oBAAoB,cAAc;AAC3D,WAAO,EAAE,IAAI,WAAW,OAAO,UAAU;AAAA,EAC3C;AACA,QAAM,QAAQ,eAAe,QAAQ,cAAc;AACnD,SAAO,EAAE,IAAI,kBAAkB,OAAO,MAAM;AAC9C,CAAC,EACA,OAAO,CAAC,QAAQ,IAAI,EAAE,EACtB,OAAO,CAAC,QAAQ;AACf,MAAI,IAAI,GAAG;AAAY,WAAO,CAAC,IAAI,GAAG,WAAW,YAAY;AAC7D,SAAO;AACT,CAAC;AAEE,MAAM,uBAAuB,CAAC,QAAQ,SAAS;AACpD,MAAI,OAAO,CAAC;AACZ,OAAK,QAAQ,CAAC,MAAM;AAClB,QAAI,EAAE,UAAU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MACrD;AACA,aAAO;AAAA,IACT;AAAA,IACA,EAAE,WAAW,OAAO,OAAO,CAAC,EAAE;AAAA,EAChC;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { FilterablePlugin } from "./FilterablePlugin";
2
+ import { FilterablePlugin } from "./FilterablePlugin.js";
3
3
  export {
4
4
  FilterablePlugin
5
5
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/filterable/index.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { FilterablePlugin } from './FilterablePlugin';\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { FilterablePlugin } from './FilterablePlugin.js';\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,wBAAwB;",
6
6
  "names": []
7
7
  }
@@ -1,11 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { useMemo, useState, useEffect } from "react";
3
3
  import { v4 as uuidv4 } from "uuid";
4
- import {
5
- buildFilterArray,
6
- getFilterValue,
7
- parseFiltersToQuery
8
- } from "./helper";
4
+ import { buildFilterArray, getFilterValue, parseFiltersToQuery } from "./helper.js";
9
5
  const noop = () => null;
10
6
  function useFilterableState(grid) {
11
7
  const {
@@ -21,18 +17,14 @@ function useFilterableState(grid) {
21
17
  setFilters(filtersProp);
22
18
  }
23
19
  }, [filtersProp]);
24
- const queryFromFilters = useMemo(() => parseFiltersToQuery(filters || []), [
25
- filters
26
- ]);
20
+ const queryFromFilters = useMemo(() => parseFiltersToQuery(filters || []), [filters]);
27
21
  const handleFiltersChange = (nextFilters) => {
28
22
  const {
29
23
  refs: { body }
30
24
  } = grid.getInstance();
31
25
  body.current.scrollTop = 0;
32
26
  setFilters(nextFilters);
33
- grid.observeRows(
34
- (rows) => onFiltersChange(nextFilters, queryFromFilters, rows)
35
- );
27
+ grid.observeRows((rows) => onFiltersChange(nextFilters, queryFromFilters, rows));
36
28
  };
37
29
  const addFilter = (filter, column) => {
38
30
  let hasBeenCalled = false;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/filterable/useFilterableState.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useMemo, useState, useEffect } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\nimport {\n buildFilterArray,\n getFilterValue,\n parseFiltersToQuery,\n} from './helper';\n\nconst noop = () => null;\n\nexport function useFilterableState(grid) {\n const {\n filters: filtersProp,\n onAddFilter = noop,\n onRemoveFilter = noop,\n onRemoveAllFilters = noop,\n onFiltersChange = noop,\n } = grid.props;\n\n const [filters, setFilters] = useState(filtersProp || []);\n\n useEffect(() => {\n if (filtersProp && filtersProp !== filters) {\n setFilters(filtersProp);\n }\n }, [filtersProp]);\n\n const queryFromFilters = useMemo(() => parseFiltersToQuery(filters || []), [\n filters,\n ]);\n\n const handleFiltersChange = (nextFilters) => {\n const {\n refs: { body },\n } = grid.getInstance();\n body.current.scrollTop = 0;\n setFilters(nextFilters);\n grid.observeRows((rows) =>\n onFiltersChange(nextFilters, queryFromFilters, rows),\n );\n };\n\n const addFilter = (filter, column) => {\n let hasBeenCalled = false;\n const trimmedFilter = {\n ...filter,\n value: String(filter.value).trim(),\n };\n /* eslint-disable indent */\n const parsedFilter = !filter.group\n ? {\n ...trimmedFilter,\n value: String(filter.value).trim(),\n group: 'all',\n label: 'All',\n id: uuidv4(),\n }\n : {\n ...trimmedFilter,\n value: String(filter.value).trim(),\n id: uuidv4(),\n label: (column && column.filterLabel) || trimmedFilter.label,\n originalProperty: column.originalProperty || column.property,\n customValue: getFilterValue(trimmedFilter, column),\n };\n /* eslint-enable indent */\n setFilters((prevFilters) => {\n // This was setted for an issue that was recalling this function on the handleFiltersChange\n if (hasBeenCalled) {\n return;\n }\n hasBeenCalled = true;\n\n const nextFilters = buildFilterArray(parsedFilter, prevFilters);\n handleFiltersChange(nextFilters, true);\n onAddFilter(parsedFilter, nextFilters, column);\n });\n };\n\n const removeFilter = ({ group, pill, nextFilters }) => {\n onRemoveFilter(group, pill.value, nextFilters);\n handleFiltersChange(nextFilters);\n };\n\n const removeAllFilters = () => {\n onRemoveAllFilters();\n handleFiltersChange([]);\n };\n return {\n actions: {\n addFilter,\n removeFilter,\n removeAllFilters,\n },\n state: {\n query: queryFromFilters,\n filters,\n },\n };\n}\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,SAAS,UAAU,iBAAiB;AAC7C,SAAS,MAAM,cAAc;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,MAAM,OAAO,MAAM;AAEZ,SAAS,mBAAmB,MAAM;AACvC,QAAM;AAAA,IACJ,SAAS;AAAA,IACT,cAAc;AAAA,IACd,iBAAiB;AAAA,IACjB,qBAAqB;AAAA,IACrB,kBAAkB;AAAA,EACpB,IAAI,KAAK;AAET,QAAM,CAAC,SAAS,UAAU,IAAI,SAAS,eAAe,CAAC,CAAC;AAExD,YAAU,MAAM;AACd,QAAI,eAAe,gBAAgB,SAAS;AAC1C,iBAAW,WAAW;AAAA,IACxB;AAAA,EACF,GAAG,CAAC,WAAW,CAAC;AAEhB,QAAM,mBAAmB,QAAQ,MAAM,oBAAoB,WAAW,CAAC,CAAC,GAAG;AAAA,IACzE;AAAA,EACF,CAAC;AAED,QAAM,sBAAsB,CAAC,gBAAgB;AAC3C,UAAM;AAAA,MACJ,MAAM,EAAE,KAAK;AAAA,IACf,IAAI,KAAK,YAAY;AACrB,SAAK,QAAQ,YAAY;AACzB,eAAW,WAAW;AACtB,SAAK;AAAA,MAAY,CAAC,SAChB,gBAAgB,aAAa,kBAAkB,IAAI;AAAA,IACrD;AAAA,EACF;AAEA,QAAM,YAAY,CAAC,QAAQ,WAAW;AACpC,QAAI,gBAAgB;AACpB,UAAM,gBAAgB;AAAA,MACpB,GAAG;AAAA,MACH,OAAO,OAAO,OAAO,KAAK,EAAE,KAAK;AAAA,IACnC;AAEA,UAAM,eAAe,CAAC,OAAO,QACzB;AAAA,MACE,GAAG;AAAA,MACH,OAAO,OAAO,OAAO,KAAK,EAAE,KAAK;AAAA,MACjC,OAAO;AAAA,MACP,OAAO;AAAA,MACP,IAAI,OAAO;AAAA,IACb,IACA;AAAA,MACE,GAAG;AAAA,MACH,OAAO,OAAO,OAAO,KAAK,EAAE,KAAK;AAAA,MACjC,IAAI,OAAO;AAAA,MACX,OAAQ,UAAU,OAAO,eAAgB,cAAc;AAAA,MACvD,kBAAkB,OAAO,oBAAoB,OAAO;AAAA,MACpD,aAAa,eAAe,eAAe,MAAM;AAAA,IACnD;AAEJ,eAAW,CAAC,gBAAgB;AAE1B,UAAI,eAAe;AACjB;AAAA,MACF;AACA,sBAAgB;AAEhB,YAAM,cAAc,iBAAiB,cAAc,WAAW;AAC9D,0BAAoB,aAAa,IAAI;AACrC,kBAAY,cAAc,aAAa,MAAM;AAAA,IAC/C,CAAC;AAAA,EACH;AAEA,QAAM,eAAe,CAAC,EAAE,OAAO,MAAM,YAAY,MAAM;AACrD,mBAAe,OAAO,KAAK,OAAO,WAAW;AAC7C,wBAAoB,WAAW;AAAA,EACjC;AAEA,QAAM,mBAAmB,MAAM;AAC7B,uBAAmB;AACnB,wBAAoB,CAAC,CAAC;AAAA,EACxB;AACA,SAAO;AAAA,IACL,SAAS;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,OAAO;AAAA,MACL,OAAO;AAAA,MACP;AAAA,IACF;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useMemo, useState, useEffect } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\nimport { buildFilterArray, getFilterValue, parseFiltersToQuery } from './helper.js';\n\nconst noop = () => null;\n\nexport function useFilterableState(grid) {\n const {\n filters: filtersProp,\n onAddFilter = noop,\n onRemoveFilter = noop,\n onRemoveAllFilters = noop,\n onFiltersChange = noop,\n } = grid.props;\n\n const [filters, setFilters] = useState(filtersProp || []);\n\n useEffect(() => {\n if (filtersProp && filtersProp !== filters) {\n setFilters(filtersProp);\n }\n }, [filtersProp]);\n\n const queryFromFilters = useMemo(() => parseFiltersToQuery(filters || []), [filters]);\n\n const handleFiltersChange = (nextFilters) => {\n const {\n refs: { body },\n } = grid.getInstance();\n body.current.scrollTop = 0;\n setFilters(nextFilters);\n grid.observeRows((rows) => onFiltersChange(nextFilters, queryFromFilters, rows));\n };\n\n const addFilter = (filter, column) => {\n let hasBeenCalled = false;\n const trimmedFilter = {\n ...filter,\n value: String(filter.value).trim(),\n };\n /* eslint-disable indent */\n const parsedFilter = !filter.group\n ? {\n ...trimmedFilter,\n value: String(filter.value).trim(),\n group: 'all',\n label: 'All',\n id: uuidv4(),\n }\n : {\n ...trimmedFilter,\n value: String(filter.value).trim(),\n id: uuidv4(),\n label: (column && column.filterLabel) || trimmedFilter.label,\n originalProperty: column.originalProperty || column.property,\n customValue: getFilterValue(trimmedFilter, column),\n };\n /* eslint-enable indent */\n setFilters((prevFilters) => {\n // This was setted for an issue that was recalling this function on the handleFiltersChange\n if (hasBeenCalled) {\n return;\n }\n hasBeenCalled = true;\n\n const nextFilters = buildFilterArray(parsedFilter, prevFilters);\n handleFiltersChange(nextFilters, true);\n onAddFilter(parsedFilter, nextFilters, column);\n });\n };\n\n const removeFilter = ({ group, pill, nextFilters }) => {\n onRemoveFilter(group, pill.value, nextFilters);\n handleFiltersChange(nextFilters);\n };\n\n const removeAllFilters = () => {\n onRemoveAllFilters();\n handleFiltersChange([]);\n };\n return {\n actions: {\n addFilter,\n removeFilter,\n removeAllFilters,\n },\n state: {\n query: queryFromFilters,\n filters,\n },\n };\n}\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,SAAS,UAAU,iBAAiB;AAC7C,SAAS,MAAM,cAAc;AAC7B,SAAS,kB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;AAAA,IACnD;AAEJ,eAAW,CAAC,gBAAgB;AAE1B,UAAI,eAAe;AACjB;AAAA,MACF;AACA,sBAAgB;AAEhB,YAAM,cAAc,iBAAiB,cAAc,WAAW;AAC9D,0BAAoB,aAAa,IAAI;AACrC,kBAAY,cAAc,aAAa,MAAM;AAAA,IAC/C,CAAC;AAAA,EACH;AAEA,QAAM,eAAe,CAAC,EAAE,OAAO,MAAM,YAAY,MAAM;AACrD,mBAAe,OAAO,KAAK,OAAO,WAAW;AAC7C,wBAAoB,WAAW;AAAA,EACjC;AAEA,QAAM,mBAAmB,MAAM;AAC7B,uBAAmB;AACnB,wBAAoB,CAAC,CAAC;AAAA,EACxB;AACA,SAAO;AAAA,IACL,SAAS;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,OAAO;AAAA,MACL,OAAO;AAAA,MACP;AAAA,IACF;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -4,9 +4,9 @@ import { useMemo } from "react";
4
4
  import { createInstancePlugin } from "@elliemae/ds-shared";
5
5
  import { aggregatedClasses } from "@elliemae/ds-classnames";
6
6
  import { VariableSizeList } from "react-window";
7
- import { walkTreeStrategy } from "./walkStrategy";
8
- import { RowSizes } from "../../rowSizes";
9
- import { dataGridBlockName } from "../../blockNames";
7
+ import { walkTreeStrategy } from "./walkStrategy.js";
8
+ import { RowSizes } from "../../rowSizes.js";
9
+ import { dataGridBlockName } from "../../blockNames.js";
10
10
  const blockName = `${dataGridBlockName}-group-row-header`;
11
11
  const GroupRowHeaderWrapper = aggregatedClasses("div")(blockName);
12
12
  const GroupRowHeaderTitle = aggregatedClasses("div")(blockName, "title");
@@ -80,7 +80,7 @@ const GroupingPlugin = createInstancePlugin("groupedRows", {
80
80
  decorateRenderers(renderers, grid) {
81
81
  const Row = renderers.body.row;
82
82
  renderers.body.row = useMemo(
83
- () => ({ isExpanded, ...rowProps }) => {
83
+ () => function({ isExpanded, ...rowProps }) {
84
84
  const { composedRows } = grid.getInstance();
85
85
  const node = composedRows[rowProps.index] ? composedRows[rowProps.index] : rowProps.rowData;
86
86
  const { groupedRowsRenderHeader } = grid.props;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/grouping-grid/GroupingPlugin.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable no-underscore-dangle */\nimport React, { useMemo } from 'react';\nimport { createInstancePlugin } from '@elliemae/ds-shared';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { VariableSizeList } from 'react-window';\nimport { walkTreeStrategy } from './walkStrategy';\nimport { RowSizes } from '../../rowSizes';\nimport { dataGridBlockName } from '../../blockNames';\n\nconst blockName = `${dataGridBlockName}-group-row-header`;\nconst GroupRowHeaderWrapper = aggregatedClasses('div')(blockName);\nconst GroupRowHeaderTitle = aggregatedClasses('div')(blockName, 'title');\n\nexport const GroupingPlugin = createInstancePlugin('groupedRows', {\n decorateGrid(grid) {\n const { columns, composedRows } = grid.getInstance();\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const detailColumns = useMemo(\n () =>\n columns\n .map((column) => ({\n ...column,\n customRenderer: column.detailCustomRenderer,\n }))\n .filter((col) => !col.expandableColumn),\n [columns],\n );\n const flatRows = [];\n walkTreeStrategy({\n data: composedRows,\n cb: (n) => flatRows.push(n),\n });\n return {\n detailColumns,\n composedRows: flatRows,\n };\n },\n getBodyProps(bodyProps, grid) {\n const { composedRows: rows } = grid.getInstance();\n // implementation of expandable row single column with aggregation\n const getItemSize = (index) => {\n const rowData = rows[index];\n if (!rowData) return RowSizes.normal;\n return rowData._isGroup || rowData.isGroup ? RowSizes.compact : RowSizes.normal;\n };\n // eslint-disable-next-line no-unused-vars\n const getListHeight = () => {\n const size = rows.reduce((h, r) => {\n const rowHeight = r._isGroup || r.isGroup ? RowSizes.compact : RowSizes.normal;\n return h + rowHeight;\n }, 0);\n return size;\n };\n return {\n ...bodyProps,\n getListHeight,\n listComponent: VariableSizeList,\n listProps: { itemSize: getItemSize },\n };\n },\n composeRows: (rows, grid) => {\n const {\n composedRows,\n props: { rowKey },\n } = grid.getInstance();\n\n if (Array.isArray(rows)) {\n const filterIds = rows.map((r) => r.data[rowKey]);\n return composedRows\n .filter((c) => filterIds.includes(c.data[rowKey]))\n .map((r) => ({\n ...r.data,\n children: Array.isArray(r.data.children)\n ? r.data.children.filter((c) => filterIds.includes(c[rowKey]))\n : r.data.children,\n _isGroup: r.isGroup,\n }))\n .filter((g) => g.children === undefined || g.children.length > 0);\n }\n return {\n ...rows,\n allRows: rows.allRows.map((r) => ({\n ...r.data,\n _isGroup: r.isGroup,\n })),\n rows: rows.rows.map((r) => ({\n ...r.data,\n _isGroup: r.isGroup,\n })),\n };\n },\n decorateRenderers(renderers, grid) {\n const Row = renderers.body.row;\n // eslint-disable-next-line react-hooks/rules-of-hooks\n renderers.body.row = useMemo(\n () =>\n // eslint-disable-next-line react/display-name\n // eslint-disable-next-line react/prop-types\n ({ isExpanded, ...rowProps }) => {\n const { composedRows } = grid.getInstance();\n // // https://jira.elliemae.io/browse/PUI-1667\n const node = composedRows[rowProps.index] ? composedRows[rowProps.index] : rowProps.rowData;\n const { groupedRowsRenderHeader } = grid.props;\n // eslint-disable-next-line no-underscore-dangle\n if (node && node._isGroup) {\n return (\n <>\n <GroupRowHeaderWrapper {...rowProps}>\n <GroupRowHeaderTitle>\n {groupedRowsRenderHeader ? groupedRowsRenderHeader(node) : 'Group'}\n </GroupRowHeaderTitle>\n </GroupRowHeaderWrapper>\n </>\n );\n }\n return <Row {...rowProps} />;\n },\n [],\n );\n\n return renderers;\n },\n});\n"],
5
- "mappings": "AAAA,YAAY,WAAW;AC2GT,mBAEI,WAFJ;AAzGd,SAAgB,eAAe;AAC/B,SAAS,4BAA4B;AACrC,SAAS,yBAAyB;AAClC,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;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B,IAAI,IAAI,SAC7D,GACF,GACF;AAAA,QAEJ;AACA,eAAO,oBAAC,OAAK,GAAG,UAAU;AAAA,MAC5B;AAAA,MACF,CAAC;AAAA,IACH;AAEA,WAAO;AAAA,EACT;AACF,CAAC;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable no-underscore-dangle */\nimport React, { useMemo } from 'react';\nimport { createInstancePlugin } from '@elliemae/ds-shared';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { VariableSizeList } from 'react-window';\nimport { walkTreeStrategy } from './walkStrategy.js';\nimport { RowSizes } from '../../rowSizes.js';\nimport { dataGridBlockName } from '../../blockNames.js';\n\nconst blockName = `${dataGridBlockName}-group-row-header`;\nconst GroupRowHeaderWrapper = aggregatedClasses('div')(blockName);\nconst GroupRowHeaderTitle = aggregatedClasses('div')(blockName, 'title');\n\nexport const GroupingPlugin = createInstancePlugin('groupedRows', {\n decorateGrid(grid) {\n const { columns, composedRows } = grid.getInstance();\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const detailColumns = useMemo(\n () =>\n columns\n .map((column) => ({\n ...column,\n customRenderer: column.detailCustomRenderer,\n }))\n .filter((col) => !col.expandableColumn),\n [columns],\n );\n const flatRows = [];\n walkTreeStrategy({\n data: composedRows,\n cb: (n) => flatRows.push(n),\n });\n return {\n detailColumns,\n composedRows: flatRows,\n };\n },\n getBodyProps(bodyProps, grid) {\n const { composedRows: rows } = grid.getInstance();\n // implementation of expandable row single column with aggregation\n const getItemSize = (index) => {\n const rowData = rows[index];\n if (!rowData) return RowSizes.normal;\n return rowData._isGroup || rowData.isGroup ? RowSizes.compact : RowSizes.normal;\n };\n // eslint-disable-next-line no-unused-vars\n const getListHeight = () => {\n const size = rows.reduce((h, r) => {\n const rowHeight = r._isGroup || r.isGroup ? RowSizes.compact : RowSizes.normal;\n return h + rowHeight;\n }, 0);\n return size;\n };\n return {\n ...bodyProps,\n getListHeight,\n listComponent: VariableSizeList,\n listProps: { itemSize: getItemSize },\n };\n },\n composeRows: (rows, grid) => {\n const {\n composedRows,\n props: { rowKey },\n } = grid.getInstance();\n\n if (Array.isArray(rows)) {\n const filterIds = rows.map((r) => r.data[rowKey]);\n return composedRows\n .filter((c) => filterIds.includes(c.data[rowKey]))\n .map((r) => ({\n ...r.data,\n children: Array.isArray(r.data.children)\n ? r.data.children.filter((c) => filterIds.includes(c[rowKey]))\n : r.data.children,\n _isGroup: r.isGroup,\n }))\n .filter((g) => g.children === undefined || g.children.length > 0);\n }\n return {\n ...rows,\n allRows: rows.allRows.map((r) => ({\n ...r.data,\n _isGroup: r.isGroup,\n })),\n rows: rows.rows.map((r) => ({\n ...r.data,\n _isGroup: r.isGroup,\n })),\n };\n },\n decorateRenderers(renderers, grid) {\n const Row = renderers.body.row;\n // eslint-disable-next-line react-hooks/rules-of-hooks\n renderers.body.row = useMemo(\n () =>\n // eslint-disable-next-line react/display-name\n // eslint-disable-next-line react/prop-types\n function ({ isExpanded, ...rowProps }) {\n const { composedRows } = grid.getInstance();\n // // https://jira.elliemae.io/browse/PUI-1667\n const node = composedRows[rowProps.index] ? composedRows[rowProps.index] : rowProps.rowData;\n const { groupedRowsRenderHeader } = grid.props;\n // eslint-disable-next-line no-underscore-dangle\n if (node && node._isGroup) {\n return (\n <>\n <GroupRowHeaderWrapper {...rowProps}>\n <GroupRowHeaderTitle>\n {groupedRowsRenderHeader ? groupedRowsRenderHeader(node) : 'Group'}\n </GroupRowHeaderTitle>\n </GroupRowHeaderWrapper>\n </>\n );\n }\n return <Row {...rowProps} />;\n },\n [],\n );\n\n return renderers;\n },\n});\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;AC2GT,mBAEI,WAFJ;AAzGd,SAAgB,eAAe;AAC/B,SAAS,4BAA4B;AACrC,SAAS,yBAAyB;AAClC,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AACjC,SAAS,gBAAgB;AACzB,SAAS,yBAAyB;AAElC,MAAM,YAA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AAC,OAAK,GAAG,UAAU;AAAA,MAC5B;AAAA,MACF,CAAC;AAAA,IACH;AAEA,WAAO;AAAA,EACT;AACF,CAAC;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/grouping-grid/walkStrategy.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "function getPath(parentNode, index, childrenKey) {\n if (!parentNode) return [index];\n return [...parentNode.path, childrenKey, index];\n}\n\nexport function walkTreeStrategy({\n data,\n childrenKey = 'children',\n level = 0,\n getId = item => item.id,\n parentNode,\n shouldWalkChildren = () => true,\n cb,\n}) {\n // eslint-disable-next-line no-loops/no-loops,no-plusplus\n for (let i = 0; i < data.length; i++) {\n const currLevel = level + 1;\n const children = data[i][childrenKey];\n const isGroup = children && !!children.length;\n const node = {\n index: i,\n id: getId(data[i]),\n data: data[i],\n path: getPath(parentNode, i, childrenKey),\n isGroup,\n nestingLevel: currLevel,\n parentNode: parentNode || {\n isGroup: true,\n data: { children: data },\n },\n };\n cb(node);\n if (shouldWalkChildren(node) && children && children.length) {\n walkTreeStrategy({\n data: children,\n level: currLevel,\n parentNode: node,\n shouldWalkChildren,\n cb,\n });\n }\n }\n}\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,YAAY,OAAO,aAAa;AAC/C,MAAI,CAAC;AAAY,WAAO,CAAC,KAAK;AAC9B,SAAO,CAAC,GAAG,WAAW,MAAM,aAAa,KAAK;AAChD;AAEO,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,QAAQ,UAAQ,KAAK;AAAA,EACrB;AAAA,EACA,qBAAqB,MAAM;AAAA,EAC3B;AACF,GAAG;AAED,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,UAAM,YAAY,QAAQ;AAC1B,UAAM,WAAW,KAAK,GAAG;AACzB,UAAM,UAAU,YAAY,CAAC,CAAC,SAAS;AACvC,UAAM,OAAO;AAAA,MACX,OAAO;AAAA,MACP,IAAI,MAAM,KAAK,EAAE;AAAA,MACjB,MAAM,KAAK;AAAA,MACX,MAAM,QAAQ,YAAY,GAAG,WAAW;AAAA,MACxC;AAAA,MACA,cAAc;AAAA,MACd,YAAY,cAAc;AAAA,QACxB,SAAS;AAAA,QACT,MAAM,EAAE,UAAU,KAAK;AAAA,MACzB;AAAA,IACF;AACA,OAAG,IAAI;AACP,QAAI,mBAAmB,IAAI,KAAK,YAAY,SAAS,QAAQ;AAC3D,uBAAiB;AAAA,QACf,MAAM;AAAA,QACN,OAAO;AAAA,QACP,YAAY;AAAA,QACZ;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "function getPath(parentNode, index, childrenKey) {\n if (!parentNode) return [index];\n return [...parentNode.path, childrenKey, index];\n}\n\nexport function walkTreeStrategy({\n data,\n childrenKey = 'children',\n level = 0,\n getId = (item) => item.id,\n parentNode,\n shouldWalkChildren = () => true,\n cb,\n}) {\n // eslint-disable-next-line no-loops/no-loops,no-plusplus\n for (let i = 0; i < data.length; i++) {\n const currLevel = level + 1;\n const children = data[i][childrenKey];\n const isGroup = children && !!children.length;\n const node = {\n index: i,\n id: getId(data[i]),\n data: data[i],\n path: getPath(parentNode, i, childrenKey),\n isGroup,\n nestingLevel: currLevel,\n parentNode: parentNode || {\n isGroup: true,\n data: { children: data },\n },\n };\n cb(node);\n if (shouldWalkChildren(node) && children && children.length) {\n walkTreeStrategy({\n data: children,\n level: currLevel,\n parentNode: node,\n shouldWalkChildren,\n cb,\n });\n }\n }\n}\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,YAAY,OAAO,aAAa;AAC/C,MAAI,CAAC;AAAY,WAAO,CAAC,KAAK;AAC9B,SAAO,CAAC,GAAG,WAAW,MAAM,aAAa,KAAK;AAChD;AAEO,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,QAAQ,CAAC,SAAS,KAAK;AAAA,EACvB;AAAA,EACA,qBAAqB,MAAM;AAAA,EAC3B;AACF,GAAG;AAED,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,UAAM,YAAY,QAAQ;AAC1B,UAAM,WAAW,KAAK,GAAG;AACzB,UAAM,UAAU,YAAY,CAAC,CAAC,SAAS;AACvC,UAAM,OAAO;AAAA,MACX,OAAO;AAAA,MACP,IAAI,MAAM,KAAK,EAAE;AAAA,MACjB,MAAM,KAAK;AAAA,MACX,MAAM,QAAQ,YAAY,GAAG,WAAW;AAAA,MACxC;AAAA,MACA,cAAc;AAAA,MACd,YAAY,cAAc;AAAA,QACxB,SAAS;AAAA,QACT,MAAM,EAAE,UAAU,KAAK;AAAA,MACzB;AAAA,IACF;AACA,OAAG,IAAI;AACP,QAAI,mBAAmB,IAAI,KAAK,YAAY,SAAS,QAAQ;AAC3D,uBAAiB;AAAA,QACf,MAAM;AAAA,QACN,OAAO;AAAA,QACP,YAAY;AAAA,QACZ;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,20 +1,20 @@
1
1
  import * as React from "react";
2
- import { BodyHeaderScrollSyncPlugin } from "./body-header-scroll-sync";
3
- import { DndColumnsPlugin } from "./column-dnd";
4
- import { ColumnSizingPlugin } from "./column-sizing";
5
- import { CustomRendererPlugin } from "./custom-cell-renderer";
6
- import { EditablePlugin, ComboBox, TextBox } from "./editable";
7
- import { ExpandableColumn, ExpandablePlugin } from "./expandable-grid";
8
- import { FilterablePlugin } from "./filterable";
9
- import { InfiniteScrollPlugin } from "./infinite-scrolling";
10
- import { PaginationPlugin } from "./pagination";
11
- import { ResizablePlugin } from "./resizable";
12
- import { DndRowsPlugin } from "./row-dnd";
13
- import { SelectablePlugin } from "./selectable";
14
- import { SortablePlugin } from "./sortable";
15
- import { ToolbarPlugin } from "./toolbar";
16
- import { ExportDataPlugin } from "./export-data";
17
- import { VirtualizationPlugin } from "./virtualization";
2
+ import { BodyHeaderScrollSyncPlugin } from "./body-header-scroll-sync/index.js";
3
+ import { DndColumnsPlugin } from "./column-dnd/index.js";
4
+ import { ColumnSizingPlugin } from "./column-sizing/index.js";
5
+ import { CustomRendererPlugin } from "./custom-cell-renderer/index.js";
6
+ import { EditablePlugin, ComboBox, TextBox } from "./editable/index.js";
7
+ import { ExpandableColumn, ExpandablePlugin } from "./expandable-grid/index.js";
8
+ import { FilterablePlugin } from "./filterable/index.js";
9
+ import { InfiniteScrollPlugin } from "./infinite-scrolling/index.js";
10
+ import { PaginationPlugin } from "./pagination/index.js";
11
+ import { ResizablePlugin } from "./resizable/index.js";
12
+ import { DndRowsPlugin } from "./row-dnd/index.js";
13
+ import { SelectablePlugin } from "./selectable/index.js";
14
+ import { SortablePlugin } from "./sortable/index.js";
15
+ import { ToolbarPlugin } from "./toolbar/index.js";
16
+ import { ExportDataPlugin } from "./export-data/index.js";
17
+ import { VirtualizationPlugin } from "./virtualization/index.js";
18
18
  export {
19
19
  BodyHeaderScrollSyncPlugin,
20
20
  ColumnSizingPlugin,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/plugins/index.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { BodyHeaderScrollSyncPlugin } from './body-header-scroll-sync';\nexport { DndColumnsPlugin } from './column-dnd';\nexport { ColumnSizingPlugin } from './column-sizing';\nexport { CustomRendererPlugin } from './custom-cell-renderer';\nexport { EditablePlugin, ComboBox, TextBox } from './editable';\nexport { ExpandableColumn, ExpandablePlugin } from './expandable-grid';\nexport { FilterablePlugin } from './filterable';\nexport { InfiniteScrollPlugin } from './infinite-scrolling';\nexport { PaginationPlugin } from './pagination';\nexport { ResizablePlugin } from './resizable';\nexport { DndRowsPlugin } from './row-dnd';\nexport { SelectablePlugin } from './selectable';\nexport { SortablePlugin } from './sortable';\nexport { ToolbarPlugin } from './toolbar';\nexport { ExportDataPlugin } from './export-data';\nexport { VirtualizationPlugin } from './virtualization';\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { BodyHeaderScrollSyncPlugin } from './body-header-scroll-sync/index.js';\nexport { DndColumnsPlugin } from './column-dnd/index.js';\nexport { ColumnSizingPlugin } from './column-sizing/index.js';\nexport { CustomRendererPlugin } from './custom-cell-renderer/index.js';\nexport { EditablePlugin, ComboBox, TextBox } from './editable/index.js';\nexport { ExpandableColumn, ExpandablePlugin } from './expandable-grid/index.js';\nexport { FilterablePlugin } from './filterable/index.js';\nexport { InfiniteScrollPlugin } from './infinite-scrolling/index.js';\nexport { PaginationPlugin } from './pagination/index.js';\nexport { ResizablePlugin } from './resizable/index.js';\nexport { DndRowsPlugin } from './row-dnd/index.js';\nexport { SelectablePlugin } from './selectable/index.js';\nexport { SortablePlugin } from './sortable/index.js';\nexport { ToolbarPlugin } from './toolbar/index.js';\nexport { ExportDataPlugin } from './export-data/index.js';\nexport { VirtualizationPlugin } from './virtualization/index.js';\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,kCAAkC;AAC3C,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC,SAAS,4BAA4B;AACrC,SAAS,gBAAgB,UAAU,eAAe;AAClD,SAAS,kBAAkB,wBAAwB;AACnD,SAAS,wBAAwB;AACjC,SAAS,4BAA4B;AACrC,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAC9B,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB;AAC9B,SAAS,wBAAwB;AACjC,SAAS,4BAA4B;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { InfiniteScrollPlugin } from "./InfiniteScrollPlugin";
2
+ import { InfiniteScrollPlugin } from "./InfiniteScrollPlugin.js";
3
3
  export {
4
4
  InfiniteScrollPlugin
5
5
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/infinite-scrolling/index.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { InfiniteScrollPlugin } from './InfiniteScrollPlugin';\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { InfiniteScrollPlugin } from './InfiniteScrollPlugin.js';\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,4BAA4B;",
6
6
  "names": []
7
7
  }
@@ -3,9 +3,9 @@ import { jsx } from "react/jsx-runtime";
3
3
  import React2, { useMemo } from "react";
4
4
  import { mergeRefs } from "@elliemae/ds-utilities";
5
5
  import { createInstancePlugin, FocusGrid } from "@elliemae/ds-shared";
6
- import { paginate } from "./helper";
7
- import { usePaginationState } from "./usePaginationState";
8
- import { NoResults } from "../../components/NoResults";
6
+ import { paginate } from "./helper.js";
7
+ import { usePaginationState } from "./usePaginationState.js";
8
+ import { NoResults } from "../../components/NoResults.js";
9
9
  const composeRows = (rows, grid) => {
10
10
  const {
11
11
  state: { pagination },
@@ -40,7 +40,7 @@ const Body = React2.memo(
40
40
  const decorateRenderers = (renderers, grid) => {
41
41
  const BodyWrapper = renderers.body.wrapper;
42
42
  renderers.body.wrapper = useMemo(
43
- () => (props) => {
43
+ () => function(props) {
44
44
  const { hotKeys, shouldRefocus, state } = grid.getInstance();
45
45
  return /* @__PURE__ */ jsx(FocusGrid, { hotKeys, shouldRefocus: false, children: /* @__PURE__ */ jsx(Body, { ...props, component: BodyWrapper }) });
46
46
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/pagination/PaginationPlugin.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/display-name */\nimport React, { useMemo } from 'react';\nimport { mergeRefs } from '@elliemae/ds-utilities';\nimport { createInstancePlugin, FocusGrid } from '@elliemae/ds-shared';\nimport { paginate } from './helper';\nimport { usePaginationState } from './usePaginationState';\nimport { NoResults } from '../../components/NoResults';\n\nconst composeRows = (rows, grid) => {\n const {\n state: { pagination },\n props: { groupedRows },\n } = grid.getInstance();\n if (groupedRows) return rows; // disable pagination with grouping\n if (groupedRows) {\n const filterIds = rows.map((r) => r.id);\n return paginate(\n rows\n .filter((c) => filterIds.includes(c.id))\n .map((r) => ({\n ...r,\n _isGroup: r.isGroup,\n })),\n pagination,\n );\n }\n\n return paginate(rows, pagination);\n};\n\nconst Body = React.memo(\n ({\n component: Component,\n rows,\n rowRenderer,\n noResultsPlaceholder,\n innerRef,\n innerBodyRef, // depends on body-header-scroll-sync\n isPlaceholderActive = false,\n ...otherBodyProps\n }) => (\n <Component {...otherBodyProps} innerRef={mergeRefs(innerRef)}>\n {!isPlaceholderActive ? (\n rows.map((row, index) => rowRenderer(row, { index, rowIndex: index }, {}))\n ) : (\n <NoResults innerRef={innerRef} rowRenderer={rowRenderer}>\n {noResultsPlaceholder}\n </NoResults>\n )}\n </Component>\n ),\n);\n\nconst decorateRenderers = (renderers, grid) => {\n const BodyWrapper = renderers.body.wrapper;\n renderers.body.wrapper = useMemo(\n () => (props) => {\n const { hotKeys, shouldRefocus, state } = grid.getInstance();\n return (\n <FocusGrid hotKeys={hotKeys} shouldRefocus={false}>\n <Body {...props} component={BodyWrapper} />\n </FocusGrid>\n );\n },\n [],\n );\n return renderers;\n};\n\nexport const PaginationPlugin = createInstancePlugin('pagination', {\n registerStateHook: usePaginationState,\n decorateRenderers,\n composeRows,\n});\n"],
5
- "mappings": "AAAA,YAAY,WAAW;AC6Cf;AA5CR,OAAOA,UAAS,eAAe;AAC/B,SAAS,iBA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EACH;AACA,SAAO;AACT;AAEO,MAAM,mBAAmB,qBAAqB,cAAc;AAAA,EACjE,mBAAmB;AAAA,EACnB;AAAA,EACA;AACF,CAAC;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/display-name */\nimport React, { useMemo } from 'react';\nimport { mergeRefs } from '@elliemae/ds-utilities';\nimport { createInstancePlugin, FocusGrid } from '@elliemae/ds-shared';\nimport { paginate } from './helper.js';\nimport { usePaginationState } from './usePaginationState.js';\nimport { NoResults } from '../../components/NoResults.js';\n\nconst composeRows = (rows, grid) => {\n const {\n state: { pagination },\n props: { groupedRows },\n } = grid.getInstance();\n if (groupedRows) return rows; // disable pagination with grouping\n if (groupedRows) {\n const filterIds = rows.map((r) => r.id);\n return paginate(\n rows\n .filter((c) => filterIds.includes(c.id))\n .map((r) => ({\n ...r,\n _isGroup: r.isGroup,\n })),\n pagination,\n );\n }\n\n return paginate(rows, pagination);\n};\n\nconst Body = React.memo(\n ({\n component: Component,\n rows,\n rowRenderer,\n noResultsPlaceholder,\n innerRef,\n innerBodyRef, // depends on body-header-scroll-sync\n isPlaceholderActive = false,\n ...otherBodyProps\n }) => (\n <Component {...otherBodyProps} innerRef={mergeRefs(innerRef)}>\n {!isPlaceholderActive ? (\n rows.map((row, index) => rowRenderer(row, { index, rowIndex: index }, {}))\n ) : (\n <NoResults innerRef={innerRef} rowRenderer={rowRenderer}>\n {noResultsPlaceholder}\n </NoResults>\n )}\n </Component>\n ),\n);\n\nconst decorateRenderers = (renderers, grid) => {\n const BodyWrapper = renderers.body.wrapper;\n renderers.body.wrapper = useMemo(\n () =>\n function (props) {\n const { hotKeys, shouldRefocus, state } = grid.getInstance();\n return (\n <FocusGrid hotKeys={hotKeys} shouldRefocus={false}>\n <Body {...props} component={BodyWrapper} />\n </FocusGrid>\n );\n },\n [],\n );\n return renderers;\n};\n\nexport const PaginationPlugin = createInstancePlugin('pagination', {\n registerStateHook: usePaginationState,\n decorateRenderers,\n composeRows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Ae,OAC1C,8BAAC,QAAM,GAAG,OAAO,WAAW,aAAa,GAC3C;AAAA,IAEJ;AAAA,IACF,CAAC;AAAA,EACH;AACA,SAAO;AACT;AAEO,MAAM,mBAAmB,qBAAqB,cAAc;AAAA,EACjE,mBAAmB;AAAA,EACnB;AAAA,EACA;AACF,CAAC;",
6
6
  "names": ["React"]
7
7
  }
@@ -1,12 +1,9 @@
1
1
  import * as React from "react";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { aggregatedClasses } from "@elliemae/ds-classnames";
4
- import { Paginator } from "./Paginator";
5
- import { PerPageDropdown } from "./PerPageDropdown";
6
- const PaginationControls = aggregatedClasses("div")(
7
- "data-grid",
8
- "controls-pagination"
9
- );
4
+ import { Paginator } from "./Paginator.js";
5
+ import { PerPageDropdown } from "./PerPageDropdown.js";
6
+ const PaginationControls = aggregatedClasses("div")("data-grid", "controls-pagination");
10
7
  const Pagination = ({
11
8
  paginated,
12
9
  pagination = {},
@@ -20,24 +17,8 @@ const Pagination = ({
20
17
  if (pagination && pagination.conditionalPagination === true && paginated.amount === 1)
21
18
  return null;
22
19
  return paginated.amount > 0 ? /* @__PURE__ */ jsxs(PaginationControls, { children: [
23
- /* @__PURE__ */ jsx(
24
- PerPageDropdown,
25
- {
26
- max: maxPerPage,
27
- min: minPerPage,
28
- onChange: onPerPage,
29
- step: paginationStep,
30
- value: perPage
31
- }
32
- ),
33
- /* @__PURE__ */ jsx(
34
- Paginator,
35
- {
36
- onSelect: onPageSelect,
37
- pages: paginated.amount,
38
- pagination
39
- }
40
- )
20
+ /* @__PURE__ */ jsx(PerPageDropdown, { max: maxPerPage, min: minPerPage, onChange: onPerPage, step: paginationStep, value: perPage }),
21
+ /* @__PURE__ */ jsx(Paginator, { onSelect: onPageSelect, pages: paginated.amount, pagination })
41
22
  ] }) : null;
42
23
  };
43
24
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/plugins/pagination/components/Pagination.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { Paginator } from './Paginator';\nimport { PerPageDropdown } from './PerPageDropdown';\n\nconst PaginationControls = aggregatedClasses('div')(\n 'data-grid',\n 'controls-pagination',\n);\n\nconst Pagination = ({\n paginated,\n pagination = {},\n onPerPage,\n onPageSelect,\n paginationStep = 5,\n maxPerPage = 10,\n minPerPage = 5,\n}) => {\n const { perPage } = pagination;\n if (\n pagination &&\n pagination.conditionalPagination === true &&\n paginated.amount === 1\n )\n return null;\n return paginated.amount > 0 ? (\n <PaginationControls>\n <PerPageDropdown\n max={maxPerPage}\n min={minPerPage}\n onChange={onPerPage}\n step={paginationStep}\n value={perPage}\n />\n <Paginator\n onSelect={onPageSelect}\n pages={paginated.amount}\n pagination={pagination}\n />\n </PaginationControls>\n ) : null;\n};\n\nexport { Pagination };\n"],
5
- "mappings": "AAAA,YAAY,WAAW;AC2BnB,SACE,KADF;AA1BJ,SAAS,yBAAyB;AAClC,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;AAEhC,MAAM,qBAAqB,kBAAkB,KAAK;AAAA,EAChD;AAAA,EACA;AACF;AAEA,MAAM,aAAa,CAAC;AAAA,EAClB;AAAA,EACA,aAAa,CAAC;AAAA,EACd;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,aAAa;AACf,MAAM;AACJ,QAAM,EAAE,QAAQ,IAAI;AACpB,MACE,cACA,WAAW,0BAA0B,QACrC,UAAU,WAAW;AAErB,WAAO;AACT,SAAO,UAAU,SAAS,IACxB,qBAAC,sBACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,KAAK;AAAA,QACL,KAAK;AAAA,QACL,UAAU;AAAA,QACV,MAAM;AAAA,QACN,OAAO;AAAA;AAAA,IACT;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,UAAU;AAAA,QACV,OAAO,UAAU;AAAA,QACjB;AAAA;AAAA,IACF;AAAA,KACF,IACE;AACN;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { Paginator } from './Paginator.js';\nimport { PerPageDropdown } from './PerPageDropdown.js';\n\nconst PaginationControls = aggregatedClasses('div')('data-grid', 'controls-pagination');\n\nconst Pagination = ({\n paginated,\n pagination = {},\n onPerPage,\n onPageSelect,\n paginationStep = 5,\n maxPerPage = 10,\n minPerPage = 5,\n}) => {\n const { perPage } = pagination;\n if (pagination && pagination.conditionalPagination === true && paginated.amount === 1) return null;\n return paginated.amount > 0 ? (\n <PaginationControls>\n <PerPageDropdown max={maxPerPage} min={minPerPage} onChange={onPerPage} step={paginationStep} value={perPage} />\n <Paginator onSelect={onPageSelect} pages={paginated.amount} pagination={pagination} />\n </PaginationControls>\n ) : null;\n};\n\nexport { Pagination };\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACmBnB,SACE,KADF;AAlBJ,SAAS,yBAAyB;AAClC,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;AAEhC,MAAM,qBAAqB,kBAAkB,KAAK,EAAE,aAAa,qBAAqB;AAEtF,MAAM,aAAa,CAAC;AAAA,EAClB;AAAA,EACA,aAAa,CAAC;AAAA,EACd;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,aAAa;AACf,MAAM;AACJ,QAAM,EAAE,QAAQ,IAAI;AACpB,MAAI,cAAc,WAAW,0BAA0B,QAAQ,UAAU,WAAW;AAAG,WAAO;AAC9F,SAAO,UAAU,SAAS,IACxB,qBAAC,sBACC;AAAA,wBAAC,mBAAgB,KAAK,YAAY,KAAK,YAAY,UAAU,WAAW,MAAM,gBAAgB,OAAO,SAAS;AAAA,IAC9G,oBAAC,aAAU,UAAU,cAAc,OAAO,UAAU,QAAQ,YAAwB;AAAA,KACtF,IACE;AACN;",
6
6
  "names": []
7
7
  }
@@ -16,7 +16,7 @@ const getOptions = memoize((step, min, max) => {
16
16
  const options = range(min, max + step, step).map(generateOption);
17
17
  return min === 0 ? options.slice(1, options.length) : options;
18
18
  });
19
- function PerPageDropdown({ min = 0, max = 100, step = 5, value = 0, onChange = () => null }) {
19
+ const PerPageDropdown = ({ min = 0, max = 100, step = 5, value = 0, onChange = () => null }) => {
20
20
  const options = getOptions(step, min, max);
21
21
  return /* @__PURE__ */ jsx(
22
22
  DSComboBox,
@@ -35,7 +35,7 @@ function PerPageDropdown({ min = 0, max = 100, step = 5, value = 0, onChange = (
35
35
  value
36
36
  }
37
37
  );
38
- }
38
+ };
39
39
  var PerPageDropdown_default = PerPageDropdown;
40
40
  export {
41
41
  PerPageDropdown,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/plugins/pagination/components/PerPageDropdown.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport memoize from 'memoize-one';\nimport { range } from '@elliemae/ds-utilities';\nimport { DSComboBox, components } from '@elliemae/ds-form';\n\nconst SingleValue = ({ children, ...props }) => (\n <components.SingleValue {...props}>\n {children} <span>per page</span>\n </components.SingleValue>\n);\n\nconst generateOption = (value) => ({\n value,\n label: value,\n});\nconst getOptions = memoize((step, min, max) => {\n const options = range(min, max + step, step).map(generateOption);\n return min === 0 ? options.slice(1, options.length) : options;\n});\n\nfunction PerPageDropdown({ min = 0, max = 100, step = 5, value = 0, onChange = () => null }) {\n const options = getOptions(step, min, max);\n return (\n <DSComboBox\n className=\"per-page-dropdown\"\n components={{\n SingleValue,\n }}\n containerProps={{\n 'data-testid': 'per-page-dropdown',\n }}\n maxOptions={10}\n onChange={onChange}\n options={options}\n searchable={false}\n value={value}\n />\n );\n}\n\nexport { PerPageDropdown };\nexport default PerPageDropdown;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACMrB,SACa,KADb;AALF,OAAO,aAAa;AACpB,SAAS,aAAa;AACtB,SAAS,YAAY,kBAAkB;AAEvC,MAAM,cAAc,CAAC,EAAE,aAAa,MAAM,MACxC,qBAAC,WAAW,aAAX,EAAwB,GAAG,OACzB;AAAA;AAAA,EAAS;AAAA,EAAC,oBAAC,UAAK,sBAAQ;AAAA,GAC3B;AAGF,MAAM,iBAAiB,CAAC,WAAW;AAAA,EACjC;AAAA,EACA,OAAO;AACT;AACA,MAAM,aAAa,QAAQ,CAAC,MAAM,KAAK,QAAQ;AAC7C,QAAM,UAAU,MAAM,KAAK,MAAM,MAAM,IAAI,EAAE,IAAI,cAAc;AAC/D,SAAO,QAAQ,IAAI,QAAQ,MAAM,GAAG,QAAQ,MAAM,IAAI;AACxD,CAAC;AAED,SAAS,gBAAgB,EAAE,MAAM,GAAG,MAAM,KAAK,OAAO,GAAG,QAAQ,GAAG,WAAW,MAAM,KAAK,GAAG;AAC3F,QAAM,UAAU,WAAW,MAAM,KAAK,GAAG;AACzC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV,YAAY;AAAA,QACV;AAAA,MACF;AAAA,MACA,gBAAgB;AAAA,QACd,eAAe;AAAA,MACjB;AAAA,MACA,YAAY;AAAA,MACZ;AAAA,MACA;AAAA,MACA,YAAY;AAAA,MACZ;AAAA;AAAA,EACF;AAEJ;AAGA,IAAO,0BAAQ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport memoize from 'memoize-one';\nimport { range } from '@elliemae/ds-utilities';\nimport { DSComboBox, components } from '@elliemae/ds-form';\n\nconst SingleValue = ({ children, ...props }) => (\n <components.SingleValue {...props}>\n {children} <span>per page</span>\n </components.SingleValue>\n);\n\nconst generateOption = (value) => ({\n value,\n label: value,\n});\nconst getOptions = memoize((step, min, max) => {\n const options = range(min, max + step, step).map(generateOption);\n return min === 0 ? options.slice(1, options.length) : options;\n});\n\nconst PerPageDropdown = ({ min = 0, max = 100, step = 5, value = 0, onChange = () => null }) => {\n const options = getOptions(step, min, max);\n return (\n <DSComboBox\n className=\"per-page-dropdown\"\n components={{\n SingleValue,\n }}\n containerProps={{\n 'data-testid': 'per-page-dropdown',\n }}\n maxOptions={10}\n onChange={onChange}\n options={options}\n searchable={false}\n value={value}\n />\n );\n};\n\nexport { PerPageDropdown };\nexport default PerPageDropdown;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACMrB,SACa,KADb;AALF,OAAO,aAAa;AACpB,SAAS,aAAa;AACtB,SAAS,YAAY,kBAAkB;AAEvC,MAAM,cAAc,CAAC,EAAE,aAAa,MAAM,MACxC,qBAAC,WAAW,aAAX,EAAwB,GAAG,OACzB;AAAA;AAAA,EAAS;AAAA,EAAC,oBAAC,UAAK,sBAAQ;AAAA,GAC3B;AAGF,MAAM,iBAAiB,CAAC,WAAW;AAAA,EACjC;AAAA,EACA,OAAO;AACT;AACA,MAAM,aAAa,QAAQ,CAAC,MAAM,KAAK,QAAQ;AAC7C,QAAM,UAAU,MAAM,KAAK,MAAM,MAAM,IAAI,EAAE,IAAI,cAAc;AAC/D,SAAO,QAAQ,IAAI,QAAQ,MAAM,GAAG,QAAQ,MAAM,IAAI;AACxD,CAAC;AAED,MAAM,kBAAkB,CAAC,EAAE,MAAM,GAAG,MAAM,KAAK,OAAO,GAAG,QAAQ,GAAG,WAAW,MAAM,KAAK,MAAM;AAC9F,QAAM,UAAU,WAAW,MAAM,KAAK,GAAG;AACzC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV,YAAY;AAAA,QACV;AAAA,MACF;AAAA,MACA,gBAAgB;AAAA,QACd,eAAe;AAAA,MACjB;AAAA,MACA,YAAY;AAAA,MACZ;AAAA,MACA;AAAA,MACA,YAAY;AAAA,MACZ;AAAA;AAAA,EACF;AAEJ;AAGA,IAAO,0BAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/pagination/helper.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const parsePerPageNumber = (number, max, min = 1) => {\n if (number > max) return max;\n if (number < min) return min;\n return number;\n};\n\nexport const paginate = (\n rows,\n { page, perPage = 1, amountOfPages: amount, totalRows },\n) => {\n // return if pagination state is controlled\n if (amount && totalRows) {\n return {\n amount,\n rows,\n page,\n };\n }\n // adapt to zero indexed logic\n const p = page - 1 || 0;\n\n const amountOfPages = perPage\n ? Math.ceil(rows.length / (perPage > 0 ? perPage : 1))\n : 1;\n const startPage = p < amountOfPages ? p : 0;\n\n return {\n amount: amountOfPages,\n rows: perPage\n ? rows.slice(startPage * perPage, startPage * perPage + perPage)\n : rows,\n allRows: rows,\n page: startPage,\n };\n};\n\nexport default paginate;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,qBAAqB,CAAC,QAAQ,KAAK,MAAM,MAAM;AAC1D,MAAI,SAAS;AAAK,WAAO;AACzB,MAAI,SAAS;AAAK,WAAO;AACzB,SAAO;AACT;AAEO,MAAM,WAAW,CACtB,MACA,EAAE,MAAM,UAAU,GAAG,eAAe,QAAQ,UAAU,MACnD;AAEH,MAAI,UAAU,WAAW;AACvB,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,QAAM,IAAI,OAAO,KAAK;AAEtB,QAAM,gBAAgB,UAClB,KAAK,KAAK,KAAK,UAAU,UAAU,IAAI,UAAU,EAAE,IACnD;AACJ,QAAM,YAAY,IAAI,gBAAgB,IAAI;AAE1C,SAAO;AAAA,IACL,QAAQ;AAAA,IACR,MAAM,UACF,KAAK,MAAM,YAAY,SAAS,YAAY,UAAU,OAAO,IAC7D;AAAA,IACJ,SAAS;AAAA,IACT,MAAM;AAAA,EACR;AACF;AAEA,IAAO,iBAAQ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const parsePerPageNumber = (number, max, min = 1) => {\n if (number > max) return max;\n if (number < min) return min;\n return number;\n};\n\nexport const paginate = (rows, { page, perPage = 1, amountOfPages: amount, totalRows }) => {\n // return if pagination state is controlled\n if (amount && totalRows) {\n return {\n amount,\n rows,\n page,\n };\n }\n // adapt to zero indexed logic\n const p = page - 1 || 0;\n\n const amountOfPages = perPage ? Math.ceil(rows.length / (perPage > 0 ? perPage : 1)) : 1;\n const startPage = p < amountOfPages ? p : 0;\n\n return {\n amount: amountOfPages,\n rows: perPage ? rows.slice(startPage * perPage, startPage * perPage + perPage) : rows,\n allRows: rows,\n page: startPage,\n };\n};\n\nexport default paginate;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,qBAAqB,CAAC,QAAQ,KAAK,MAAM,MAAM;AAC1D,MAAI,SAAS;AAAK,WAAO;AACzB,MAAI,SAAS;AAAK,WAAO;AACzB,SAAO;AACT;AAEO,MAAM,WAAW,CAAC,MAAM,EAAE,MAAM,UAAU,GAAG,eAAe,QAAQ,UAAU,MAAM;AAEzF,MAAI,UAAU,WAAW;AACvB,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,QAAM,IAAI,OAAO,KAAK;AAEtB,QAAM,gBAAgB,UAAU,KAAK,KAAK,KAAK,UAAU,UAAU,IAAI,UAAU,EAAE,IAAI;AACvF,QAAM,YAAY,IAAI,gBAAgB,IAAI;AAE1C,SAAO;AAAA,IACL,QAAQ;AAAA,IACR,MAAM,UAAU,KAAK,MAAM,YAAY,SAAS,YAAY,UAAU,OAAO,IAAI;AAAA,IACjF,SAAS;AAAA,IACT,MAAM;AAAA,EACR;AACF;AAEA,IAAO,iBAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { PaginationPlugin } from "./PaginationPlugin";
2
+ import { PaginationPlugin } from "./PaginationPlugin.js";
3
3
  export {
4
4
  PaginationPlugin
5
5
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/pagination/index.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { PaginationPlugin } from './PaginationPlugin';\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { PaginationPlugin } from './PaginationPlugin.js';\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,wBAAwB;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { useDerivedStateFromProps } from "@elliemae/ds-utilities";
3
- import { parsePerPageNumber } from "./helper";
3
+ import { parsePerPageNumber } from "./helper.js";
4
4
  function usePaginationState(grid) {
5
5
  const {
6
6
  minPerPage = 0,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/pagination/usePaginationState.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useDerivedStateFromProps } from '@elliemae/ds-utilities';\nimport { parsePerPageNumber } from './helper';\n\nexport function usePaginationState(grid) {\n const {\n minPerPage = 0,\n maxPerPage = 50,\n onPerPageChange = () => null,\n onPageChange = () => null,\n pagination: paginationProp = {\n page: 1,\n perPage: 10,\n },\n groupedRows,\n } = grid.props;\n const { composedRows, rows } = grid.getInstance();\n const [pagination, setPagination] = useDerivedStateFromProps(paginationProp);\n\n const onPerPage = (perPageNumber) => {\n const parsedPerPageNumber = parsePerPageNumber(perPageNumber, maxPerPage, minPerPage);\n const actualNumber = parsedPerPageNumber ? parseInt(parsedPerPageNumber, 10) : 0;\n\n setPagination((prevPagination) => {\n onPerPageChange(actualNumber);\n return {\n page: prevPagination.page,\n perPage: actualNumber,\n };\n });\n };\n\n const onPageSelect = (page) => {\n const length = groupedRows ? composedRows.length : rows.length;\n setPagination((prevPagination) => {\n const pages = Math.ceil(length / prevPagination.perPage);\n onPageChange(page);\n return {\n ...prevPagination,\n page: Math.min(Math.max(page, 1), pages),\n };\n });\n };\n\n return {\n state: {\n pagination,\n },\n actions: {\n onPerPage,\n onPageSelect,\n },\n };\n}\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useDerivedStateFromProps } from '@elliemae/ds-utilities';\nimport { parsePerPageNumber } from './helper.js';\n\nexport function usePaginationState(grid) {\n const {\n minPerPage = 0,\n maxPerPage = 50,\n onPerPageChange = () => null,\n onPageChange = () => null,\n pagination: paginationProp = {\n page: 1,\n perPage: 10,\n },\n groupedRows,\n } = grid.props;\n const { composedRows, rows } = grid.getInstance();\n const [pagination, setPagination] = useDerivedStateFromProps(paginationProp);\n\n const onPerPage = (perPageNumber) => {\n const parsedPerPageNumber = parsePerPageNumber(perPageNumber, maxPerPage, minPerPage);\n const actualNumber = parsedPerPageNumber ? parseInt(parsedPerPageNumber, 10) : 0;\n\n setPagination((prevPagination) => {\n onPerPageChange(actualNumber);\n return {\n page: prevPagination.page,\n perPage: actualNumber,\n };\n });\n };\n\n const onPageSelect = (page) => {\n const length = groupedRows ? composedRows.length : rows.length;\n setPagination((prevPagination) => {\n const pages = Math.ceil(length / prevPagination.perPage);\n onPageChange(page);\n return {\n ...prevPagination,\n page: Math.min(Math.max(page, 1), pages),\n };\n });\n };\n\n return {\n state: {\n pagination,\n },\n actions: {\n onPerPage,\n onPageSelect,\n },\n };\n}\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,gCAAgC;AACzC,SAAS,0BAA0B;AAE5B,SAAS,mBAAmB,MAAM;AACvC,QAAM;AAAA,IACJ,aAAa;AAAA,IACb,aAAa;AAAA,IACb,kBAAkB,MAAM;AAAA,IACxB,eAAe,MAAM;AAAA,IACrB,YAAY,iBAAiB;AAAA,MAC3B,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,IACA;AAAA,EACF,IAAI,KAAK;AACT,QAAM,EAAE,cAAc,KAAK,IAAI,KAAK,YAAY;AAChD,QAAM,CAAC,YAAY,aAAa,IAAI,yBAAyB,cAAc;AAE3E,QAAM,YAAY,CAAC,kBAAkB;AACnC,UAAM,sBAAsB,mBAAmB,eAAe,YAAY,UAAU;AACpF,UAAM,eAAe,sBAAsB,SAAS,qBAAqB,EAAE,IAAI;AAE/E,kBAAc,CAAC,mBAAmB;AAChC,sBAAgB,YAAY;AAC5B,aAAO;AAAA,QACL,MAAM,eAAe;AAAA,QACrB,SAAS;AAAA,MACX;AAAA,IACF,CAAC;AAAA,EACH;AAEA,QAAM,eAAe,CAAC,SAAS;AAC7B,UAAM,SAAS,cAAc,aAAa,SAAS,KAAK;AACxD,kBAAc,CAAC,mBAAmB;AAChC,YAAM,QAAQ,KAAK,KAAK,SAAS,eAAe,OAAO;AACvD,mBAAa,IAAI;AACjB,aAAO;AAAA,QACL,GAAG;AAAA,QACH,MAAM,KAAK,IAAI,KAAK,IAAI,MAAM,CAAC,GAAG,KAAK;AAAA,MACzC;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO;AAAA,IACL,OAAO;AAAA,MACL;AAAA,IACF;AAAA,IACA,SAAS;AAAA,MACP;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { runAll } from "@elliemae/ds-utilities";
3
3
  import { createInstancePlugin } from "@elliemae/ds-shared";
4
- import { addResizableToColumn, resizableFormatter } from "./decorateResizable";
4
+ import { addResizableToColumn, resizableFormatter } from "./decorateResizable.js";
5
5
  const noop = () => null;
6
6
  const DELTA_LAST_COLUMN = 25;
7
7
  const decorateColumn = (column, grid, index) => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/resizable/ResizablePlugin.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-param-reassign */\n/* eslint-disable max-statements */\nimport { runAll } from '@elliemae/ds-utilities';\nimport { createInstancePlugin } from '@elliemae/ds-shared';\nimport { addResizableToColumn, resizableFormatter } from './decorateResizable';\n\nconst noop = () => null;\n\nconst DELTA_LAST_COLUMN = 25;\n\n// eslint-disable-next-line no-unused-vars\nconst decorateColumn = (column, grid, index) => {\n const {\n onResizeEnd = noop,\n onResizeStart = noop,\n minColumnWidth = 90,\n isColumnResizeActive = (col) => col.resizable && !col.expandableColumn,\n onColumnResize,\n } = grid.props;\n\n const { decoratedColumns } = grid.getInstance();\n // need to do this because the decorated columns which the index in the function call\n // could be different from the final decorated columns because a plugin could add a\n // column afterwards\n const colIndex = decoratedColumns.findIndex((col) => col.property === column.property);\n const isLast = colIndex === decoratedColumns.length - 1;\n\n if (!isColumnResizeActive(column)) return column;\n return addResizableToColumn(\n column,\n resizableFormatter({\n onDragStart: () => {\n grid.isDragging.current = true;\n grid.disableEvents();\n onResizeStart();\n onColumnResize('onResizeStart', { column });\n },\n onDrag: (width, increasing) => {\n const { resizedColumns, refs } = grid.getInstance();\n if (isLast && increasing) {\n const thisCol = resizedColumns.current[column.uuid] || 0;\n width = Math.max(thisCol + DELTA_LAST_COLUMN, width);\n }\n column.updateBodyHeaderWidth(width, width);\n grid.updateRowWidth();\n if (isLast && increasing) {\n // TODO: Move this to packages/ds-shared/src/ScrollSync/ScrollSync.js\n // It isn't watching the scrollLeft so you have to move both at the same time\n refs.header.current.scrollLeft += DELTA_LAST_COLUMN;\n refs.body.current.scrollLeft += DELTA_LAST_COLUMN;\n }\n },\n onDragEnd: (width, increasing, extraData) => {\n const { resizedColumns } = grid.getInstance();\n if (isLast && increasing) {\n const thisCol = resizedColumns.current[column.uuid] || 0;\n width = Math.max(thisCol + DELTA_LAST_COLUMN, width);\n }\n resizedColumns.current[column.uuid] = width;\n\n grid.isDragging.current = false;\n grid.enableEvents();\n try {\n const total = grid.getInstance().refs.body.current.scrollWidth;\n const sum = Object.keys(grid.resizedColumns.current).reduce((p, n) => grid.resizedColumns.current[n] + p, 0);\n const lastKey = grid.decoratedColumns[grid.columns.length - 1].uuid;\n if (sum < total) {\n const lastCol = grid.getInstance().columnSizeService.columns[lastKey];\n lastCol.updateWidth(grid.resizedColumns.current[lastKey] + total - sum);\n lastCol.updateBodyHeaderWidth(grid.resizedColumns.current[lastKey] + total - sum);\n grid.getInstance().columnSizeService.updateMissingWidths(total);\n }\n } catch (error) {\n console.error(\n 'Unexpected error in the addResizableToColumn trying to use the remaining grid space to the last column',\n error,\n );\n }\n\n onColumnResize('onResizeEnd', {\n column,\n width,\n extraData,\n });\n runAll(onResizeEnd)(width, extraData);\n grid.updateRowWidth();\n },\n minWidth: (column.minWidth || minColumnWidth) - (isLast ? DELTA_LAST_COLUMN : 0),\n isLast,\n }),\n );\n};\n\nexport const ResizablePlugin = createInstancePlugin('resizable', {\n decorateColumn,\n});\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-param-reassign */\n/* eslint-disable max-statements */\nimport { runAll } from '@elliemae/ds-utilities';\nimport { createInstancePlugin } from '@elliemae/ds-shared';\nimport { addResizableToColumn, resizableFormatter } from './decorateResizable.js';\n\nconst noop = () => null;\n\nconst DELTA_LAST_COLUMN = 25;\n\n// eslint-disable-next-line no-unused-vars\nconst decorateColumn = (column, grid, index) => {\n const {\n onResizeEnd = noop,\n onResizeStart = noop,\n minColumnWidth = 90,\n isColumnResizeActive = (col) => col.resizable && !col.expandableColumn,\n onColumnResize,\n } = grid.props;\n\n const { decoratedColumns } = grid.getInstance();\n // need to do this because the decorated columns which the index in the function call\n // could be different from the final decorated columns because a plugin could add a\n // column afterwards\n const colIndex = decoratedColumns.findIndex((col) => col.property === column.property);\n const isLast = colIndex === decoratedColumns.length - 1;\n\n if (!isColumnResizeActive(column)) return column;\n return addResizableToColumn(\n column,\n resizableFormatter({\n onDragStart: () => {\n grid.isDragging.current = true;\n grid.disableEvents();\n onResizeStart();\n onColumnResize('onResizeStart', { column });\n },\n onDrag: (width, increasing) => {\n const { resizedColumns, refs } = grid.getInstance();\n if (isLast && increasing) {\n const thisCol = resizedColumns.current[column.uuid] || 0;\n width = Math.max(thisCol + DELTA_LAST_COLUMN, width);\n }\n column.updateBodyHeaderWidth(width, width);\n grid.updateRowWidth();\n if (isLast && increasing) {\n // TODO: Move this to packages/ds-shared/src/ScrollSync/ScrollSync.js\n // It isn't watching the scrollLeft so you have to move both at the same time\n refs.header.current.scrollLeft += DELTA_LAST_COLUMN;\n refs.body.current.scrollLeft += DELTA_LAST_COLUMN;\n }\n },\n onDragEnd: (width, increasing, extraData) => {\n const { resizedColumns } = grid.getInstance();\n if (isLast && increasing) {\n const thisCol = resizedColumns.current[column.uuid] || 0;\n width = Math.max(thisCol + DELTA_LAST_COLUMN, width);\n }\n resizedColumns.current[column.uuid] = width;\n\n grid.isDragging.current = false;\n grid.enableEvents();\n try {\n const total = grid.getInstance().refs.body.current.scrollWidth;\n const sum = Object.keys(grid.resizedColumns.current).reduce((p, n) => grid.resizedColumns.current[n] + p, 0);\n const lastKey = grid.decoratedColumns[grid.columns.length - 1].uuid;\n if (sum < total) {\n const lastCol = grid.getInstance().columnSizeService.columns[lastKey];\n lastCol.updateWidth(grid.resizedColumns.current[lastKey] + total - sum);\n lastCol.updateBodyHeaderWidth(grid.resizedColumns.current[lastKey] + total - sum);\n grid.getInstance().columnSizeService.updateMissingWidths(total);\n }\n } catch (error) {\n console.error(\n 'Unexpected error in the addResizableToColumn trying to use the remaining grid space to the last column',\n error,\n );\n }\n\n onColumnResize('onResizeEnd', {\n column,\n width,\n extraData,\n });\n runAll(onResizeEnd)(width, extraData);\n grid.updateRowWidth();\n },\n minWidth: (column.minWidth || minColumnWidth) - (isLast ? DELTA_LAST_COLUMN : 0),\n isLast,\n }),\n );\n};\n\nexport const ResizablePlugin = createInstancePlugin('resizable', {\n decorateColumn,\n});\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACEv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