@elliemae/ds-datagrids 3.16.0 → 3.16.1-rc.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (468) hide show
  1. package/dist/cjs/DSDataGrid.js +145 -2
  2. package/dist/cjs/DSDataGrid.js.map +2 -2
  3. package/dist/cjs/DataGridImpl.js +15 -11
  4. package/dist/cjs/DataGridImpl.js.map +2 -2
  5. package/dist/cjs/PaginatedDataGrid.js +13 -9
  6. package/dist/cjs/PaginatedDataGrid.js.map +2 -2
  7. package/dist/cjs/blockNames.js +4 -0
  8. package/dist/cjs/blockNames.js.map +1 -1
  9. package/dist/cjs/columns/IconColumn.js +4 -0
  10. package/dist/cjs/columns/IconColumn.js.map +1 -1
  11. package/dist/cjs/columns/NumberColumn.js +4 -0
  12. package/dist/cjs/columns/NumberColumn.js.map +1 -1
  13. package/dist/cjs/components/BodyCell.js +6 -0
  14. package/dist/cjs/components/BodyCell.js.map +1 -1
  15. package/dist/cjs/components/BodyList.js +7 -5
  16. package/dist/cjs/components/BodyList.js.map +2 -2
  17. package/dist/cjs/components/ColumnVisibilityMenuOption.js +5 -6
  18. package/dist/cjs/components/ColumnVisibilityMenuOption.js.map +2 -2
  19. package/dist/cjs/components/ColumnsOptionsMenuSection.js +7 -11
  20. package/dist/cjs/components/ColumnsOptionsMenuSection.js.map +2 -2
  21. package/dist/cjs/components/EmptyState.js +9 -6
  22. package/dist/cjs/components/EmptyState.js.map +3 -3
  23. package/dist/cjs/components/HeaderCell.js +4 -0
  24. package/dist/cjs/components/HeaderCell.js.map +1 -1
  25. package/dist/cjs/components/List.js +6 -2
  26. package/dist/cjs/components/List.js.map +2 -2
  27. package/dist/cjs/components/ListItem.js +7 -6
  28. package/dist/cjs/components/ListItem.js.map +2 -2
  29. package/dist/cjs/components/NoResults.js +8 -10
  30. package/dist/cjs/components/NoResults.js.map +2 -2
  31. package/dist/cjs/components/RowsLoader.js +5 -1
  32. package/dist/cjs/components/RowsLoader.js.map +2 -2
  33. package/dist/cjs/components/Table.js +9 -5
  34. package/dist/cjs/components/Table.js.map +2 -2
  35. package/dist/cjs/components/TableBody.js +6 -7
  36. package/dist/cjs/components/TableBody.js.map +2 -2
  37. package/dist/cjs/components/TableHeader.js +5 -1
  38. package/dist/cjs/components/TableHeader.js.map +2 -2
  39. package/dist/cjs/components/footer/addOptionalFooterComponents.js +5 -1
  40. package/dist/cjs/components/footer/addOptionalFooterComponents.js.map +2 -2
  41. package/dist/cjs/components/header/PrimaryControls.js +4 -0
  42. package/dist/cjs/components/header/PrimaryControls.js.map +1 -1
  43. package/dist/cjs/components/header/addOptionalHeaderComponents.js +4 -0
  44. package/dist/cjs/components/header/addOptionalHeaderComponents.js.map +1 -1
  45. package/dist/cjs/components/index.js +9 -5
  46. package/dist/cjs/components/index.js.map +2 -2
  47. package/dist/cjs/components/renderers/defaultClassedRenderers.js +20 -36
  48. package/dist/cjs/components/renderers/defaultClassedRenderers.js.map +2 -2
  49. package/dist/cjs/components/renderers/index.js +6 -2
  50. package/dist/cjs/components/renderers/index.js.map +2 -2
  51. package/dist/cjs/components/renderers/renderRowsLoader.js +6 -4
  52. package/dist/cjs/components/renderers/renderRowsLoader.js.map +2 -2
  53. package/dist/cjs/components/tableContext.js +4 -0
  54. package/dist/cjs/components/tableContext.js.map +1 -1
  55. package/dist/cjs/defaultPlugins.js +9 -10
  56. package/dist/cjs/defaultPlugins.js.map +2 -2
  57. package/dist/cjs/index.js +13 -9
  58. package/dist/cjs/index.js.map +2 -2
  59. package/dist/cjs/package.json +7 -0
  60. package/dist/cjs/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js +26 -18
  61. package/dist/cjs/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js.map +2 -2
  62. package/dist/cjs/plugins/body-header-scroll-sync/index.js +5 -1
  63. package/dist/cjs/plugins/body-header-scroll-sync/index.js.map +2 -2
  64. package/dist/cjs/plugins/column-dnd/DndColumnsPlugin.js +5 -1
  65. package/dist/cjs/plugins/column-dnd/DndColumnsPlugin.js.map +2 -2
  66. package/dist/cjs/plugins/column-dnd/decorateGridWithDndColumns.js +4 -0
  67. package/dist/cjs/plugins/column-dnd/decorateGridWithDndColumns.js.map +1 -1
  68. package/dist/cjs/plugins/column-dnd/index.js +5 -1
  69. package/dist/cjs/plugins/column-dnd/index.js.map +2 -2
  70. package/dist/cjs/plugins/column-sizing/ColumnSizingPlugin.js +8 -4
  71. package/dist/cjs/plugins/column-sizing/ColumnSizingPlugin.js.map +2 -2
  72. package/dist/cjs/plugins/column-sizing/columnMeasurerTransformer.js +4 -0
  73. package/dist/cjs/plugins/column-sizing/columnMeasurerTransformer.js.map +1 -1
  74. package/dist/cjs/plugins/column-sizing/ext-points/decorateColumn.js +5 -1
  75. package/dist/cjs/plugins/column-sizing/ext-points/decorateColumn.js.map +2 -2
  76. package/dist/cjs/plugins/column-sizing/ext-points/getTableProps.js +5 -1
  77. package/dist/cjs/plugins/column-sizing/ext-points/getTableProps.js.map +2 -2
  78. package/dist/cjs/plugins/column-sizing/getColumnNameFromProperty.js +4 -0
  79. package/dist/cjs/plugins/column-sizing/getColumnNameFromProperty.js.map +1 -1
  80. package/dist/cjs/plugins/column-sizing/index.js +5 -1
  81. package/dist/cjs/plugins/column-sizing/index.js.map +2 -2
  82. package/dist/cjs/plugins/column-sizing/useColumnSizeService.js +11 -26
  83. package/dist/cjs/plugins/column-sizing/useColumnSizeService.js.map +2 -2
  84. package/dist/cjs/plugins/column-sizing/useStylesheetHelpers.js +7 -2
  85. package/dist/cjs/plugins/column-sizing/useStylesheetHelpers.js.map +2 -2
  86. package/dist/cjs/plugins/column-sizing/utils.js +4 -0
  87. package/dist/cjs/plugins/column-sizing/utils.js.map +1 -1
  88. package/dist/cjs/plugins/custom-cell-renderer/CustomRendererPlugin.js +5 -1
  89. package/dist/cjs/plugins/custom-cell-renderer/CustomRendererPlugin.js.map +2 -2
  90. package/dist/cjs/plugins/custom-cell-renderer/addCustomRendererToCell.js +6 -1
  91. package/dist/cjs/plugins/custom-cell-renderer/addCustomRendererToCell.js.map +2 -2
  92. package/dist/cjs/plugins/custom-cell-renderer/getRendererComponent.js +5 -1
  93. package/dist/cjs/plugins/custom-cell-renderer/getRendererComponent.js.map +2 -2
  94. package/dist/cjs/plugins/custom-cell-renderer/index.js +5 -1
  95. package/dist/cjs/plugins/custom-cell-renderer/index.js.map +2 -2
  96. package/dist/cjs/plugins/editable/EditableComponents/ComboBox.js +4 -0
  97. package/dist/cjs/plugins/editable/EditableComponents/ComboBox.js.map +2 -2
  98. package/dist/cjs/plugins/editable/EditableComponents/TextBox.js +4 -0
  99. package/dist/cjs/plugins/editable/EditableComponents/TextBox.js.map +2 -2
  100. package/dist/cjs/plugins/editable/EditableComponents/index.js +6 -2
  101. package/dist/cjs/plugins/editable/EditableComponents/index.js.map +2 -2
  102. package/dist/cjs/plugins/editable/EditablePlugin.js +5 -1
  103. package/dist/cjs/plugins/editable/EditablePlugin.js.map +2 -2
  104. package/dist/cjs/plugins/editable/decorateEditable.js +5 -1
  105. package/dist/cjs/plugins/editable/decorateEditable.js.map +2 -2
  106. package/dist/cjs/plugins/editable/getEditorComponent.js +7 -16
  107. package/dist/cjs/plugins/editable/getEditorComponent.js.map +2 -2
  108. package/dist/cjs/plugins/editable/index.js +6 -2
  109. package/dist/cjs/plugins/editable/index.js.map +2 -2
  110. package/dist/cjs/plugins/expandable-grid/ExpandableColumn.js +27 -25
  111. package/dist/cjs/plugins/expandable-grid/ExpandableColumn.js.map +2 -2
  112. package/dist/cjs/plugins/expandable-grid/ExpandablePlugin.js +9 -5
  113. package/dist/cjs/plugins/expandable-grid/ExpandablePlugin.js.map +2 -2
  114. package/dist/cjs/plugins/expandable-grid/ExpandedRow.js +10 -6
  115. package/dist/cjs/plugins/expandable-grid/ExpandedRow.js.map +2 -2
  116. package/dist/cjs/plugins/expandable-grid/ExpandedRowExtra.js +16 -8
  117. package/dist/cjs/plugins/expandable-grid/ExpandedRowExtra.js.map +2 -2
  118. package/dist/cjs/plugins/expandable-grid/index.js +6 -2
  119. package/dist/cjs/plugins/expandable-grid/index.js.map +2 -2
  120. package/dist/cjs/plugins/expandable-grid/useExpandGridState.js +4 -0
  121. package/dist/cjs/plugins/expandable-grid/useExpandGridState.js.map +2 -2
  122. package/dist/cjs/plugins/export-data/ExportDataPlugin.js +4 -0
  123. package/dist/cjs/plugins/export-data/ExportDataPlugin.js.map +1 -1
  124. package/dist/cjs/plugins/export-data/index.js +5 -1
  125. package/dist/cjs/plugins/export-data/index.js.map +2 -2
  126. package/dist/cjs/plugins/filterable/FilterablePlugin.js +7 -3
  127. package/dist/cjs/plugins/filterable/FilterablePlugin.js.map +2 -2
  128. package/dist/cjs/plugins/filterable/addFilterToColumn.js +5 -1
  129. package/dist/cjs/plugins/filterable/addFilterToColumn.js.map +2 -2
  130. package/dist/cjs/plugins/filterable/components/FilterableHeader.js +5 -1
  131. package/dist/cjs/plugins/filterable/components/FilterableHeader.js.map +2 -2
  132. package/dist/cjs/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js +50 -47
  133. package/dist/cjs/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js.map +2 -2
  134. package/dist/cjs/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js +50 -48
  135. package/dist/cjs/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js.map +2 -2
  136. package/dist/cjs/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js +48 -45
  137. package/dist/cjs/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js.map +2 -2
  138. package/dist/cjs/plugins/filterable/components/filterable-menus/TextFilterMenu.js +7 -3
  139. package/dist/cjs/plugins/filterable/components/filterable-menus/TextFilterMenu.js.map +2 -2
  140. package/dist/cjs/plugins/filterable/components/filterable-menus/defaultDateFormat.js +4 -0
  141. package/dist/cjs/plugins/filterable/components/filterable-menus/defaultDateFormat.js.map +1 -1
  142. package/dist/cjs/plugins/filterable/components/filterable-menus/getFilterMenuByType.js +9 -7
  143. package/dist/cjs/plugins/filterable/components/filterable-menus/getFilterMenuByType.js.map +2 -2
  144. package/dist/cjs/plugins/filterable/filterableFormatter.js +33 -37
  145. package/dist/cjs/plugins/filterable/filterableFormatter.js.map +2 -2
  146. package/dist/cjs/plugins/filterable/filtering-helper/filterRowsByQuery.js +6 -4
  147. package/dist/cjs/plugins/filterable/filtering-helper/filterRowsByQuery.js.map +2 -2
  148. package/dist/cjs/plugins/filterable/filtering-helper/strategiesOperators.js +4 -0
  149. package/dist/cjs/plugins/filterable/filtering-helper/strategiesOperators.js.map +2 -2
  150. package/dist/cjs/plugins/filterable/helper.js +4 -0
  151. package/dist/cjs/plugins/filterable/helper.js.map +2 -2
  152. package/dist/cjs/plugins/filterable/index.js +5 -1
  153. package/dist/cjs/plugins/filterable/index.js.map +2 -2
  154. package/dist/cjs/plugins/filterable/useFilterableState.js +7 -7
  155. package/dist/cjs/plugins/filterable/useFilterableState.js.map +2 -2
  156. package/dist/cjs/plugins/grouping-by/GroupingByPlugin.js +4 -0
  157. package/dist/cjs/plugins/grouping-by/GroupingByPlugin.js.map +1 -1
  158. package/dist/cjs/plugins/grouping-grid/GroupingPlugin.js +19 -11
  159. package/dist/cjs/plugins/grouping-grid/GroupingPlugin.js.map +2 -2
  160. package/dist/cjs/plugins/grouping-grid/walkStrategy.js +4 -0
  161. package/dist/cjs/plugins/grouping-grid/walkStrategy.js.map +2 -2
  162. package/dist/cjs/plugins/index.js +20 -16
  163. package/dist/cjs/plugins/index.js.map +2 -2
  164. package/dist/cjs/plugins/infinite-scrolling/InfiniteScrollPlugin.js +4 -0
  165. package/dist/cjs/plugins/infinite-scrolling/InfiniteScrollPlugin.js.map +1 -1
  166. package/dist/cjs/plugins/infinite-scrolling/index.js +5 -1
  167. package/dist/cjs/plugins/infinite-scrolling/index.js.map +2 -2
  168. package/dist/cjs/plugins/pagination/PaginationPlugin.js +9 -4
  169. package/dist/cjs/plugins/pagination/PaginationPlugin.js.map +2 -2
  170. package/dist/cjs/plugins/pagination/components/Pagination.js +9 -24
  171. package/dist/cjs/plugins/pagination/components/Pagination.js.map +2 -2
  172. package/dist/cjs/plugins/pagination/components/Paginator.js +15 -10
  173. package/dist/cjs/plugins/pagination/components/Paginator.js.map +2 -2
  174. package/dist/cjs/plugins/pagination/components/PerPageDropdown.js +6 -2
  175. package/dist/cjs/plugins/pagination/components/PerPageDropdown.js.map +2 -2
  176. package/dist/cjs/plugins/pagination/helper.js +4 -0
  177. package/dist/cjs/plugins/pagination/helper.js.map +2 -2
  178. package/dist/cjs/plugins/pagination/index.js +5 -1
  179. package/dist/cjs/plugins/pagination/index.js.map +2 -2
  180. package/dist/cjs/plugins/pagination/usePaginationState.js +5 -1
  181. package/dist/cjs/plugins/pagination/usePaginationState.js.map +2 -2
  182. package/dist/cjs/plugins/resizable/ResizablePlugin.js +5 -1
  183. package/dist/cjs/plugins/resizable/ResizablePlugin.js.map +2 -2
  184. package/dist/cjs/plugins/resizable/decorateResizable.js +8 -2
  185. package/dist/cjs/plugins/resizable/decorateResizable.js.map +2 -2
  186. package/dist/cjs/plugins/resizable/index.js +5 -1
  187. package/dist/cjs/plugins/resizable/index.js.map +2 -2
  188. package/dist/cjs/plugins/resizable/useResizeHandle.js +10 -13
  189. package/dist/cjs/plugins/resizable/useResizeHandle.js.map +2 -2
  190. package/dist/cjs/plugins/resizable/utils.js +4 -0
  191. package/dist/cjs/plugins/resizable/utils.js.map +1 -1
  192. package/dist/cjs/plugins/row-dnd/DndRowsPlugin.js +5 -0
  193. package/dist/cjs/plugins/row-dnd/DndRowsPlugin.js.map +1 -1
  194. package/dist/cjs/plugins/row-dnd/index.js +5 -1
  195. package/dist/cjs/plugins/row-dnd/index.js.map +2 -2
  196. package/dist/cjs/plugins/selectable/SelectablePlugin.js +7 -3
  197. package/dist/cjs/plugins/selectable/SelectablePlugin.js.map +2 -2
  198. package/dist/cjs/plugins/selectable/addSelectableColumn.js +7 -1
  199. package/dist/cjs/plugins/selectable/addSelectableColumn.js.map +2 -2
  200. package/dist/cjs/plugins/selectable/helper.js +4 -0
  201. package/dist/cjs/plugins/selectable/helper.js.map +1 -1
  202. package/dist/cjs/plugins/selectable/index.js +5 -1
  203. package/dist/cjs/plugins/selectable/index.js.map +2 -2
  204. package/dist/cjs/plugins/selectable/selectableFormatter.js +5 -1
  205. package/dist/cjs/plugins/selectable/selectableFormatter.js.map +2 -2
  206. package/dist/cjs/plugins/selectable/useSelectableState.js +7 -1
  207. package/dist/cjs/plugins/selectable/useSelectableState.js.map +2 -2
  208. package/dist/cjs/plugins/sortable/SortablePlugin.js +7 -3
  209. package/dist/cjs/plugins/sortable/SortablePlugin.js.map +2 -2
  210. package/dist/cjs/plugins/sortable/checkIfSortable.js +4 -0
  211. package/dist/cjs/plugins/sortable/checkIfSortable.js.map +1 -1
  212. package/dist/cjs/plugins/sortable/index.js +5 -1
  213. package/dist/cjs/plugins/sortable/index.js.map +2 -2
  214. package/dist/cjs/plugins/sortable/sortHeaderFormatter.js +4 -0
  215. package/dist/cjs/plugins/sortable/sortHeaderFormatter.js.map +1 -1
  216. package/dist/cjs/plugins/sortable/sortTree.js +4 -0
  217. package/dist/cjs/plugins/sortable/sortTree.js.map +2 -2
  218. package/dist/cjs/plugins/sortable/sorter.js +5 -0
  219. package/dist/cjs/plugins/sortable/sorter.js.map +1 -1
  220. package/dist/cjs/plugins/sortable/useSortableState.js +6 -4
  221. package/dist/cjs/plugins/sortable/useSortableState.js.map +2 -2
  222. package/dist/cjs/plugins/toolbar/RowRenderer.js +7 -2
  223. package/dist/cjs/plugins/toolbar/RowRenderer.js.map +2 -2
  224. package/dist/cjs/plugins/toolbar/ToolbarPlugin.js +5 -1
  225. package/dist/cjs/plugins/toolbar/ToolbarPlugin.js.map +2 -2
  226. package/dist/cjs/plugins/toolbar/ToolbarTrigger.js +5 -0
  227. package/dist/cjs/plugins/toolbar/ToolbarTrigger.js.map +1 -1
  228. package/dist/cjs/plugins/toolbar/index.js +5 -1
  229. package/dist/cjs/plugins/toolbar/index.js.map +2 -2
  230. package/dist/cjs/plugins/virtualization/AutoHeightList.js +4 -0
  231. package/dist/cjs/plugins/virtualization/AutoHeightList.js.map +2 -2
  232. package/dist/cjs/plugins/virtualization/VirtualizationPlugin.js +8 -2
  233. package/dist/cjs/plugins/virtualization/VirtualizationPlugin.js.map +2 -2
  234. package/dist/cjs/plugins/virtualization/VirtualizedBody.js +9 -4
  235. package/dist/cjs/plugins/virtualization/VirtualizedBody.js.map +2 -2
  236. package/dist/cjs/plugins/virtualization/VirtualizedBodyRow.js +5 -0
  237. package/dist/cjs/plugins/virtualization/VirtualizedBodyRow.js.map +1 -1
  238. package/dist/cjs/plugins/virtualization/helper.js +4 -0
  239. package/dist/cjs/plugins/virtualization/helper.js.map +1 -1
  240. package/dist/cjs/plugins/virtualization/index.js +5 -1
  241. package/dist/cjs/plugins/virtualization/index.js.map +2 -2
  242. package/dist/cjs/renders/CellWithAddons.js +15 -1
  243. package/dist/cjs/renders/CellWithAddons.js.map +2 -2
  244. package/dist/cjs/renders/index.js +6 -2
  245. package/dist/cjs/renders/index.js.map +2 -2
  246. package/dist/cjs/renders/styled.js +4 -0
  247. package/dist/cjs/renders/styled.js.map +1 -1
  248. package/dist/cjs/rowSizes.js +5 -5
  249. package/dist/cjs/rowSizes.js.map +2 -2
  250. package/dist/cjs/utilities/getPluginsFromProps.js +17 -13
  251. package/dist/cjs/utilities/getPluginsFromProps.js.map +2 -2
  252. package/dist/cjs/utilities/getScrollbarSize.js +4 -0
  253. package/dist/cjs/utilities/getScrollbarSize.js.map +1 -1
  254. package/dist/cjs/utilities/normalizeData.js +4 -0
  255. package/dist/cjs/utilities/normalizeData.js.map +2 -2
  256. package/dist/esm/DSDataGrid.js +141 -2
  257. package/dist/esm/DSDataGrid.js.map +2 -2
  258. package/dist/esm/DataGridImpl.js +11 -11
  259. package/dist/esm/DataGridImpl.js.map +2 -2
  260. package/dist/esm/PaginatedDataGrid.js +9 -9
  261. package/dist/esm/PaginatedDataGrid.js.map +2 -2
  262. package/dist/esm/columns/IconColumn.js.map +1 -1
  263. package/dist/esm/components/BodyCell.js +2 -0
  264. package/dist/esm/components/BodyCell.js.map +1 -1
  265. package/dist/esm/components/BodyList.js +3 -5
  266. package/dist/esm/components/BodyList.js.map +2 -2
  267. package/dist/esm/components/ColumnVisibilityMenuOption.js +1 -6
  268. package/dist/esm/components/ColumnVisibilityMenuOption.js.map +2 -2
  269. package/dist/esm/components/ColumnsOptionsMenuSection.js +3 -11
  270. package/dist/esm/components/ColumnsOptionsMenuSection.js.map +2 -2
  271. package/dist/esm/components/EmptyState.js +1 -2
  272. package/dist/esm/components/EmptyState.js.map +2 -2
  273. package/dist/esm/components/List.js +2 -2
  274. package/dist/esm/components/List.js.map +2 -2
  275. package/dist/esm/components/ListItem.js +3 -6
  276. package/dist/esm/components/ListItem.js.map +2 -2
  277. package/dist/esm/components/NoResults.js +4 -10
  278. package/dist/esm/components/NoResults.js.map +2 -2
  279. package/dist/esm/components/RowsLoader.js +1 -1
  280. package/dist/esm/components/RowsLoader.js.map +1 -1
  281. package/dist/esm/components/Table.js +5 -5
  282. package/dist/esm/components/Table.js.map +2 -2
  283. package/dist/esm/components/TableBody.js +2 -7
  284. package/dist/esm/components/TableBody.js.map +2 -2
  285. package/dist/esm/components/TableHeader.js +1 -1
  286. package/dist/esm/components/TableHeader.js.map +2 -2
  287. package/dist/esm/components/footer/addOptionalFooterComponents.js +1 -1
  288. package/dist/esm/components/footer/addOptionalFooterComponents.js.map +1 -1
  289. package/dist/esm/components/index.js +5 -5
  290. package/dist/esm/components/index.js.map +1 -1
  291. package/dist/esm/components/renderers/defaultClassedRenderers.js +16 -40
  292. package/dist/esm/components/renderers/defaultClassedRenderers.js.map +2 -2
  293. package/dist/esm/components/renderers/index.js +2 -2
  294. package/dist/esm/components/renderers/index.js.map +1 -1
  295. package/dist/esm/components/renderers/renderRowsLoader.js +2 -4
  296. package/dist/esm/components/renderers/renderRowsLoader.js.map +2 -2
  297. package/dist/esm/defaultPlugins.js +5 -10
  298. package/dist/esm/defaultPlugins.js.map +2 -2
  299. package/dist/esm/index.js +9 -9
  300. package/dist/esm/index.js.map +1 -1
  301. package/dist/esm/package.json +7 -0
  302. package/dist/esm/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js +22 -18
  303. package/dist/esm/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js.map +2 -2
  304. package/dist/esm/plugins/body-header-scroll-sync/index.js +1 -1
  305. package/dist/esm/plugins/body-header-scroll-sync/index.js.map +1 -1
  306. package/dist/esm/plugins/column-dnd/DndColumnsPlugin.js +1 -1
  307. package/dist/esm/plugins/column-dnd/DndColumnsPlugin.js.map +2 -2
  308. package/dist/esm/plugins/column-dnd/index.js +1 -1
  309. package/dist/esm/plugins/column-dnd/index.js.map +1 -1
  310. package/dist/esm/plugins/column-sizing/ColumnSizingPlugin.js +4 -4
  311. package/dist/esm/plugins/column-sizing/ColumnSizingPlugin.js.map +1 -1
  312. package/dist/esm/plugins/column-sizing/columnMeasurerTransformer.js.map +1 -1
  313. package/dist/esm/plugins/column-sizing/ext-points/decorateColumn.js +1 -1
  314. package/dist/esm/plugins/column-sizing/ext-points/decorateColumn.js.map +1 -1
  315. package/dist/esm/plugins/column-sizing/ext-points/getTableProps.js +1 -1
  316. package/dist/esm/plugins/column-sizing/ext-points/getTableProps.js.map +1 -1
  317. package/dist/esm/plugins/column-sizing/index.js +1 -1
  318. package/dist/esm/plugins/column-sizing/index.js.map +1 -1
  319. package/dist/esm/plugins/column-sizing/useColumnSizeService.js +7 -26
  320. package/dist/esm/plugins/column-sizing/useColumnSizeService.js.map +2 -2
  321. package/dist/esm/plugins/column-sizing/useStylesheetHelpers.js +3 -2
  322. package/dist/esm/plugins/column-sizing/useStylesheetHelpers.js.map +2 -2
  323. package/dist/esm/plugins/column-sizing/utils.js.map +1 -1
  324. package/dist/esm/plugins/custom-cell-renderer/CustomRendererPlugin.js +1 -1
  325. package/dist/esm/plugins/custom-cell-renderer/CustomRendererPlugin.js.map +1 -1
  326. package/dist/esm/plugins/custom-cell-renderer/addCustomRendererToCell.js +2 -1
  327. package/dist/esm/plugins/custom-cell-renderer/addCustomRendererToCell.js.map +2 -2
  328. package/dist/esm/plugins/custom-cell-renderer/getRendererComponent.js +1 -1
  329. package/dist/esm/plugins/custom-cell-renderer/getRendererComponent.js.map +2 -2
  330. package/dist/esm/plugins/custom-cell-renderer/index.js +1 -1
  331. package/dist/esm/plugins/custom-cell-renderer/index.js.map +1 -1
  332. package/dist/esm/plugins/editable/EditableComponents/ComboBox.js.map +1 -1
  333. package/dist/esm/plugins/editable/EditableComponents/TextBox.js.map +1 -1
  334. package/dist/esm/plugins/editable/EditableComponents/index.js +2 -2
  335. package/dist/esm/plugins/editable/EditableComponents/index.js.map +1 -1
  336. package/dist/esm/plugins/editable/EditablePlugin.js +1 -1
  337. package/dist/esm/plugins/editable/EditablePlugin.js.map +2 -2
  338. package/dist/esm/plugins/editable/decorateEditable.js +1 -1
  339. package/dist/esm/plugins/editable/decorateEditable.js.map +2 -2
  340. package/dist/esm/plugins/editable/getEditorComponent.js +3 -16
  341. package/dist/esm/plugins/editable/getEditorComponent.js.map +2 -2
  342. package/dist/esm/plugins/editable/index.js +2 -2
  343. package/dist/esm/plugins/editable/index.js.map +1 -1
  344. package/dist/esm/plugins/expandable-grid/ExpandableColumn.js +23 -25
  345. package/dist/esm/plugins/expandable-grid/ExpandableColumn.js.map +2 -2
  346. package/dist/esm/plugins/expandable-grid/ExpandablePlugin.js +5 -5
  347. package/dist/esm/plugins/expandable-grid/ExpandablePlugin.js.map +2 -2
  348. package/dist/esm/plugins/expandable-grid/ExpandedRow.js +6 -6
  349. package/dist/esm/plugins/expandable-grid/ExpandedRow.js.map +2 -2
  350. package/dist/esm/plugins/expandable-grid/ExpandedRowExtra.js +12 -8
  351. package/dist/esm/plugins/expandable-grid/ExpandedRowExtra.js.map +2 -2
  352. package/dist/esm/plugins/expandable-grid/index.js +2 -2
  353. package/dist/esm/plugins/expandable-grid/index.js.map +1 -1
  354. package/dist/esm/plugins/expandable-grid/useExpandGridState.js.map +2 -2
  355. package/dist/esm/plugins/export-data/ExportDataPlugin.js.map +1 -1
  356. package/dist/esm/plugins/export-data/index.js +1 -1
  357. package/dist/esm/plugins/export-data/index.js.map +1 -1
  358. package/dist/esm/plugins/filterable/FilterablePlugin.js +3 -3
  359. package/dist/esm/plugins/filterable/FilterablePlugin.js.map +2 -2
  360. package/dist/esm/plugins/filterable/addFilterToColumn.js +1 -1
  361. package/dist/esm/plugins/filterable/addFilterToColumn.js.map +1 -1
  362. package/dist/esm/plugins/filterable/components/FilterableHeader.js +1 -1
  363. package/dist/esm/plugins/filterable/components/FilterableHeader.js.map +2 -2
  364. package/dist/esm/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js +46 -47
  365. package/dist/esm/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js.map +2 -2
  366. package/dist/esm/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js +46 -48
  367. package/dist/esm/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js.map +2 -2
  368. package/dist/esm/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js +44 -45
  369. package/dist/esm/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js.map +2 -2
  370. package/dist/esm/plugins/filterable/components/filterable-menus/TextFilterMenu.js +3 -3
  371. package/dist/esm/plugins/filterable/components/filterable-menus/TextFilterMenu.js.map +2 -2
  372. package/dist/esm/plugins/filterable/components/filterable-menus/getFilterMenuByType.js +5 -7
  373. package/dist/esm/plugins/filterable/components/filterable-menus/getFilterMenuByType.js.map +2 -2
  374. package/dist/esm/plugins/filterable/filterableFormatter.js +29 -37
  375. package/dist/esm/plugins/filterable/filterableFormatter.js.map +2 -2
  376. package/dist/esm/plugins/filterable/filtering-helper/filterRowsByQuery.js +2 -4
  377. package/dist/esm/plugins/filterable/filtering-helper/filterRowsByQuery.js.map +2 -2
  378. package/dist/esm/plugins/filterable/filtering-helper/strategiesOperators.js.map +2 -2
  379. package/dist/esm/plugins/filterable/helper.js +1 -7
  380. package/dist/esm/plugins/filterable/helper.js.map +2 -2
  381. package/dist/esm/plugins/filterable/index.js +1 -1
  382. package/dist/esm/plugins/filterable/index.js.map +1 -1
  383. package/dist/esm/plugins/filterable/useFilterableState.js +3 -11
  384. package/dist/esm/plugins/filterable/useFilterableState.js.map +2 -2
  385. package/dist/esm/plugins/grouping-by/GroupingByPlugin.js.map +1 -1
  386. package/dist/esm/plugins/grouping-grid/GroupingPlugin.js +15 -11
  387. package/dist/esm/plugins/grouping-grid/GroupingPlugin.js.map +2 -2
  388. package/dist/esm/plugins/grouping-grid/walkStrategy.js.map +2 -2
  389. package/dist/esm/plugins/index.js +16 -16
  390. package/dist/esm/plugins/index.js.map +1 -1
  391. package/dist/esm/plugins/infinite-scrolling/InfiniteScrollPlugin.js.map +1 -1
  392. package/dist/esm/plugins/infinite-scrolling/index.js +1 -1
  393. package/dist/esm/plugins/infinite-scrolling/index.js.map +1 -1
  394. package/dist/esm/plugins/pagination/PaginationPlugin.js +5 -4
  395. package/dist/esm/plugins/pagination/PaginationPlugin.js.map +2 -2
  396. package/dist/esm/plugins/pagination/components/Pagination.js +5 -24
  397. package/dist/esm/plugins/pagination/components/Pagination.js.map +2 -2
  398. package/dist/esm/plugins/pagination/components/Paginator.js +12 -11
  399. package/dist/esm/plugins/pagination/components/Paginator.js.map +2 -2
  400. package/dist/esm/plugins/pagination/components/PerPageDropdown.js +2 -2
  401. package/dist/esm/plugins/pagination/components/PerPageDropdown.js.map +2 -2
  402. package/dist/esm/plugins/pagination/helper.js.map +2 -2
  403. package/dist/esm/plugins/pagination/index.js +1 -1
  404. package/dist/esm/plugins/pagination/index.js.map +1 -1
  405. package/dist/esm/plugins/pagination/usePaginationState.js +1 -1
  406. package/dist/esm/plugins/pagination/usePaginationState.js.map +1 -1
  407. package/dist/esm/plugins/resizable/ResizablePlugin.js +1 -1
  408. package/dist/esm/plugins/resizable/ResizablePlugin.js.map +2 -2
  409. package/dist/esm/plugins/resizable/decorateResizable.js +4 -2
  410. package/dist/esm/plugins/resizable/decorateResizable.js.map +2 -2
  411. package/dist/esm/plugins/resizable/index.js +1 -1
  412. package/dist/esm/plugins/resizable/index.js.map +1 -1
  413. package/dist/esm/plugins/resizable/useResizeHandle.js +6 -13
  414. package/dist/esm/plugins/resizable/useResizeHandle.js.map +2 -2
  415. package/dist/esm/plugins/row-dnd/DndRowsPlugin.js +1 -0
  416. package/dist/esm/plugins/row-dnd/DndRowsPlugin.js.map +1 -1
  417. package/dist/esm/plugins/row-dnd/index.js +1 -1
  418. package/dist/esm/plugins/row-dnd/index.js.map +1 -1
  419. package/dist/esm/plugins/selectable/SelectablePlugin.js +3 -3
  420. package/dist/esm/plugins/selectable/SelectablePlugin.js.map +2 -2
  421. package/dist/esm/plugins/selectable/addSelectableColumn.js +3 -1
  422. package/dist/esm/plugins/selectable/addSelectableColumn.js.map +2 -2
  423. package/dist/esm/plugins/selectable/helper.js.map +1 -1
  424. package/dist/esm/plugins/selectable/index.js +1 -1
  425. package/dist/esm/plugins/selectable/index.js.map +1 -1
  426. package/dist/esm/plugins/selectable/selectableFormatter.js +1 -1
  427. package/dist/esm/plugins/selectable/selectableFormatter.js.map +2 -2
  428. package/dist/esm/plugins/selectable/useSelectableState.js +3 -5
  429. package/dist/esm/plugins/selectable/useSelectableState.js.map +2 -2
  430. package/dist/esm/plugins/sortable/SortablePlugin.js +3 -3
  431. package/dist/esm/plugins/sortable/SortablePlugin.js.map +2 -2
  432. package/dist/esm/plugins/sortable/checkIfSortable.js.map +1 -1
  433. package/dist/esm/plugins/sortable/index.js +1 -1
  434. package/dist/esm/plugins/sortable/index.js.map +1 -1
  435. package/dist/esm/plugins/sortable/sortHeaderFormatter.js.map +1 -1
  436. package/dist/esm/plugins/sortable/sortTree.js.map +2 -2
  437. package/dist/esm/plugins/sortable/sorter.js +1 -0
  438. package/dist/esm/plugins/sortable/sorter.js.map +1 -1
  439. package/dist/esm/plugins/sortable/useSortableState.js +2 -4
  440. package/dist/esm/plugins/sortable/useSortableState.js.map +2 -2
  441. package/dist/esm/plugins/toolbar/RowRenderer.js +3 -2
  442. package/dist/esm/plugins/toolbar/RowRenderer.js.map +2 -2
  443. package/dist/esm/plugins/toolbar/ToolbarPlugin.js +1 -1
  444. package/dist/esm/plugins/toolbar/ToolbarPlugin.js.map +2 -2
  445. package/dist/esm/plugins/toolbar/ToolbarTrigger.js +1 -0
  446. package/dist/esm/plugins/toolbar/ToolbarTrigger.js.map +1 -1
  447. package/dist/esm/plugins/toolbar/index.js +1 -1
  448. package/dist/esm/plugins/toolbar/index.js.map +1 -1
  449. package/dist/esm/plugins/virtualization/AutoHeightList.js.map +2 -2
  450. package/dist/esm/plugins/virtualization/VirtualizationPlugin.js +4 -2
  451. package/dist/esm/plugins/virtualization/VirtualizationPlugin.js.map +2 -2
  452. package/dist/esm/plugins/virtualization/VirtualizedBody.js +5 -4
  453. package/dist/esm/plugins/virtualization/VirtualizedBody.js.map +2 -2
  454. package/dist/esm/plugins/virtualization/VirtualizedBodyRow.js +1 -0
  455. package/dist/esm/plugins/virtualization/VirtualizedBodyRow.js.map +1 -1
  456. package/dist/esm/plugins/virtualization/index.js +1 -1
  457. package/dist/esm/plugins/virtualization/index.js.map +1 -1
  458. package/dist/esm/renders/CellWithAddons.js +11 -1
  459. package/dist/esm/renders/CellWithAddons.js.map +2 -2
  460. package/dist/esm/renders/index.js +2 -2
  461. package/dist/esm/renders/index.js.map +1 -1
  462. package/dist/esm/renders/styled.js.map +1 -1
  463. package/dist/esm/rowSizes.js +1 -5
  464. package/dist/esm/rowSizes.js.map +2 -2
  465. package/dist/esm/utilities/getPluginsFromProps.js +13 -13
  466. package/dist/esm/utilities/getPluginsFromProps.js.map +2 -2
  467. package/dist/esm/utilities/normalizeData.js.map +2 -2
  468. package/package.json +25 -25
@@ -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,S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G;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;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,KAAK;AAC1B,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,EAAE,IAAI;AAAA,IACvC;AAAA,EACF,CAAC;AAED,SAAO,QAAQ,OAAO,CAAC,MAAM;AAC3B,QAAI,EAAE,WAAW,CAAC,UAAU,EAAE,EAAE;AAAG,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,EAAE,KAAK,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,S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AAW;AAAA,UACX,OAAO,OAAO,IAAI,iBAAiB;AAAA,QACrC,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,KAAK,KAAK,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,CA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C;AAAA,MACH,OAAO;AACL,oBAAY,MAAM,KAAK,kBAAkB,OAAO,CAAC,CAAC,CAAC;AAAA,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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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;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/grouping-by/GroupingByPlugin.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { createInstancePlugin } from '@elliemae/ds-shared';\nimport { groupBy } from 'lodash';\n\nconst groupedByData = (groupedBy, composedRows) => {\n const grouped = groupBy(composedRows, groupedBy);\n return Object.keys(grouped).map((c, key) => ({\n id: `grouped-by-${groupedBy}-${key}`,\n key: groupedBy,\n value: c,\n children: grouped[c],\n _isGroup: true,\n isGroup: true,\n }));\n};\n\nexport const GroupingByPlugin = createInstancePlugin('groupedByRows', {\n decorateGrid(grid) {\n const {\n composedRows,\n props: { groupedBy },\n } = grid.getInstance();\n grid.composedRows = groupedBy ? groupedByData(groupedBy, composedRows) : composedRows;\n return grid;\n },\n});\n"],
5
- "mappings": "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InstancePlugin } 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,15 +80,19 @@ 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 }) => {
84
- const { composedRows } = grid.getInstance();
85
- const node = composedRows[rowProps.index] ? composedRows[rowProps.index] : rowProps.rowData;
86
- const { groupedRowsRenderHeader } = grid.props;
87
- if (node && node._isGroup) {
88
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(GroupRowHeaderWrapper, { ...rowProps, children: /* @__PURE__ */ jsx(GroupRowHeaderTitle, { children: groupedRowsRenderHeader ? groupedRowsRenderHeader(node) : "Group" }) }) });
83
+ () => (
84
+ // eslint-disable-next-line react/display-name
85
+ // eslint-disable-next-line react/prop-types
86
+ function({ isExpanded, ...rowProps }) {
87
+ const { composedRows } = grid.getInstance();
88
+ const node = composedRows[rowProps.index] ? composedRows[rowProps.index] : rowProps.rowData;
89
+ const { groupedRowsRenderHeader } = grid.props;
90
+ if (node && node._isGroup) {
91
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(GroupRowHeaderWrapper, { ...rowProps, children: /* @__PURE__ */ jsx(GroupRowHeaderTitle, { children: groupedRowsRenderHeader ? groupedRowsRenderHeader(node) : "Group" }) }) });
92
+ }
93
+ return /* @__PURE__ */ jsx(Row, { ...rowProps });
89
94
  }
90
- return /* @__PURE__ */ jsx(Row, { ...rowProps });
91
- },
95
+ ),
92
96
  []
93
97
  );
94
98
  return renderers;
@@ -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,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,UACzB,8BAAC,uBACE,oCAA0B,wBAAwB,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;A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B,GAAG,UACzB,8BAAC,uBACE,oCAA0B,wBAAwB,IAAI,IAAI,SAC7D,GACF,GACF;AAAA,UAEJ;AACA,iBAAO,oBAAC,OAAK,GAAG,UAAU;AAAA,QAC5B;AAAA;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,CAAC,EAAE,WAAW;AACpC,UAAM,UAAU,YAAY,CAAC,CAAC,SAAS;AACvC,UAAM,OAAO;AAAA,MACX,OAAO;AAAA,MACP,IAAI,MAAM,KAAK,CAAC,CAAC;AAAA,MACjB,MAAM,KAAK,CAAC;AAAA,MACZ,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
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/infinite-scrolling/InfiniteScrollPlugin.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useRef, useEffect, useState } from 'react';\nimport { createInstancePlugin } from '@elliemae/ds-shared';\n\n// TODO: EXPORT A SEPARATED INFINITE LOADER GRID\n\nconst registerStateHook = (grid) => {\n const {\n props: { getData, onInfiniteScrolling = () => null },\n actions: { updateRows },\n } = grid;\n\n const loading = useRef(false);\n\n const addMoreData = (data = []) => {\n loading.current = false;\n updateRows((prevRows) => prevRows.concat(data || []));\n };\n\n const doLoadData = async (currentRows) => {\n loading.current = true;\n return Promise.resolve(getData(currentRows)).then(addMoreData);\n };\n\n const loadMoreData = (currentRows) => {\n onInfiniteScrolling(currentRows);\n if (loading.current || !getData) return;\n doLoadData(currentRows);\n };\n\n return {\n actions: {\n loadMoreData,\n },\n };\n};\n\nconst getBodyProps = ({ children, ...props }, grid) => {\n const { loadMoreData } = grid.getInstance().actions;\n\n const [bodyNode, setBodyRef] = useState();\n const prevScroll = useRef();\n prevScroll.current = 0;\n\n const handleBodyScroll = (event, s) => {\n const { target } = event;\n const { scrollHeight, scrollTop, offsetHeight, scrollLeft } = target;\n const { composedRows } = grid.getInstance();\n // prevent horizontal scroll triggering infinite scrolling callbacks\n if (prevScroll.current !== scrollLeft) {\n prevScroll.current = scrollLeft;\n return;\n }\n // todo: clean this. Better approach using another component for the infinite scroll\n if (bodyNode !== target) return;\n if (scrollTop + offsetHeight >= scrollHeight - 1) {\n loadMoreData(composedRows);\n }\n };\n\n useEffect(() => {\n if (bodyNode) {\n bodyNode.addEventListener('scroll', handleBodyScroll);\n }\n return () => {\n if (bodyNode) {\n bodyNode.removeEventListener('scroll', handleBodyScroll);\n }\n };\n }, [bodyNode]);\n\n return {\n ...props,\n listProps: { outerRef: setBodyRef },\n };\n};\n\nexport const InfiniteScrollPlugin = createInstancePlugin('infinite-scroll', {\n registerStateHook,\n getBodyProps,\n});\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,WAAW,gBAAgB;AAC5C,SAAS,4BAA4B;AAIrC,MAAM,oBAAoB,CAAC,SAAS;AAClC,QAAM;AAAA,IACJ,OAAO,EAAE,SAAS,sBAAsB,MAAM,KAAK;AAAA,IACnD,SAAS,EAAE,WAAW;AAAA,EACxB,IAAI;AAEJ,QAAM,UAAU,OAAO,KAAK;AAE5B,QAAM,cAAc,CAAC,OAAO,CAAC,MAAM;AACjC,YAAQ,UAAU;AAClB,eAAW,CAAC,aAAa,SAAS,OAAO,QAAQ,CAAC,CAAC,CAAC;AAAA,EACtD;AAEA,QAAM,aAAa,OAAO,gBAAgB;AACxC,YAAQ,UAAU;AAClB,WAAO,QAAQ,QAAQ,QAAQ,WAAW,CAAC,EAAE,KAAK,WAAW;AAAA,EAC/D;AAEA,QAAM,eAAe,CAAC,gBAAgB;AACpC,wBAAoB,WAAW;AAC/B,QAAI,QAAQ,WAAW,CAAC;AAAS;AACjC,eAAW,WAAW;AAAA,EACxB;AAEA,SAAO;AAAA,IACL,SAAS;AAAA,MACP;AAAA,IACF;AAAA,EACF;AACF;AAEA,MAAM,eAAe,CAAC,EAAE,aAAa,MAAM,GAAG,SAAS;AACrD,QAAM,EAAE,aAAa,IAAI,KAAK,YAAY,EAAE;AAE5C,QAAM,CAAC,UAAU,UAAU,IAAI,SAAS;AACxC,QAAM,aAAa,OAAO;AAC1B,aAAW,UAAU;AAErB,QAAM,mBAAmB,CAAC,OAAO,MAAM;AACrC,UAAM,EAAE,OAAO,IAAI;AACnB,UAAM,EAAE,cAAc,WAAW,cAAc,WAAW,IAAI;AAC9D,UAAM,EAAE,aAAa,IAAI,KAAK,YAAY;AAE1C,QAAI,W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ACF;AACF;AAEA,MAAM,eAAe,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS;AACrD,QAAM,EAAE,aAAa,IAAI,KAAK,YAAY,EAAE;AAE5C,QAAM,CAAC,UAAU,UAAU,IAAI,SAAS;AACxC,QAAM,aAAa,OAAO;AAC1B,aAAW,UAAU;AAErB,QAAM,mBAAmB,CAAC,OAAO,MAAM;AACrC,UAAM,EAAE,OAAO,IAAI;AACnB,UAAM,EAAE,cAAc,WAAW,cAAc,WAAW,IAAI;AAC9D,UAAM,EAAE,aAAa,IAAI,KAAK,YAAY;AAE1C,QAAI,WAAW,YAAY,YAAY;AACrC,iBAAW,UAAU;AACrB;AAAA,IACF;AAEA,QAAI,aAAa;AAAQ;AACzB,QAAI,YAAY,gBAAgB,eAAe,GAAG;AAChD,mBAAa,YAAY;AAAA,IAC3B;AAAA,EACF;AAEA,YAAU,MAAM;AACd,QAAI,UAAU;AACZ,eAAS,iBAAiB,UAAU,gBAAgB;AAAA,IACtD;AACA,WAAO,MAAM;AACX,UAAI,UAAU;AACZ,iBAAS,oBAAoB,UAAU,gBAAgB;AAAA,MACzD;AAAA,IACF;AAAA,EACF,GAAG,CAAC,QAAQ,CAAC;AAEb,SAAO;AAAA,IACL,GAAG;AAAA,IACH,WAAW,EAAE,UAAU,WAAW;AAAA,EACpC;AACF;AAEO,MAAM,uBAAuB,qBAAqB,mBAAmB;AAAA,EAC1E;AAAA,EACA;AACF,CAAC;",
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 },
@@ -33,6 +33,7 @@ const Body = React2.memo(
33
33
  noResultsPlaceholder,
34
34
  innerRef,
35
35
  innerBodyRef,
36
+ // depends on body-header-scroll-sync
36
37
  isPlaceholderActive = false,
37
38
  ...otherBodyProps
38
39
  }) => /* @__PURE__ */ jsx(Component, { ...otherBodyProps, innerRef: mergeRefs(innerRef), children: !isPlaceholderActive ? rows.map((row, index) => rowRenderer(row, { index, rowIndex: index }, {})) : /* @__PURE__ */ jsx(NoResults, { innerRef, rowRenderer, children: noResultsPlaceholder }) })
@@ -40,7 +41,7 @@ const Body = React2.memo(
40
41
  const decorateRenderers = (renderers, grid) => {
41
42
  const BodyWrapper = renderers.body.wrapper;
42
43
  renderers.body.wrapper = useMemo(
43
- () => (props) => {
44
+ () => function(props) {
44
45
  const { hotKeys, shouldRefocus, state } = grid.getInstance();
45
46
  return /* @__PURE__ */ jsx(FocusGrid, { hotKeys, shouldRefocus: false, children: /* @__PURE__ */ jsx(Body, { ...props, component: BodyWrapper }) });
46
47
  },
@@ -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;A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,aAAa,GAC3C;AAAA,IAEJ;AAAA,IACA,CAAC;AAAA,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 = createInstanc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Ae,MAAM,IAAI,KAAK,YAAY;AAC3D,aACE,oBAAC,aAAU,SAAkB,eAAe,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
  }
@@ -1,11 +1,12 @@
1
1
  import * as React from "react";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import ReactPagify from "react-pagify";
3
+ import { default as ReactPagify } from "react-pagify";
4
4
  import segmentize from "segmentize";
5
5
  import { aggregatedClasses } from "@elliemae/ds-classnames";
6
+ const Comp = ReactPagify?.default ?? ReactPagify;
6
7
  const blockName = "data-grid";
7
8
  const PaginationContainer = aggregatedClasses("div")(blockName, "pagination");
8
- const PagifyContext = aggregatedClasses(ReactPagify?.Context)(blockName, "pagify-pagination");
9
+ const PagifyContext = aggregatedClasses(Comp?.Context)(blockName, "pagify-pagination");
9
10
  const Paginator = ({ pagination, pages, onSelect, labelPrevious = "Previous", labelNext = "Next" }) => {
10
11
  const prevPage = pagination.page - 1;
11
12
  const nextPage = pagination.page + 1;
@@ -21,15 +22,15 @@ const Paginator = ({ pagination, pages, onSelect, labelPrevious = "Previous", la
21
22
  sidePages: 1
22
23
  }),
23
24
  children: [
24
- /* @__PURE__ */ jsx(ReactPagify.Button, { className: pagination.page <= 1 ? "button-disabled" : "", page: prevPage, children: labelPrevious }),
25
- /* @__PURE__ */ jsx(ReactPagify.Segment, { field: "beginPages" }),
26
- /* @__PURE__ */ jsx(ReactPagify.Ellipsis, { className: "ellipsis", nextField: "previousPages", previousField: "beginPages" }),
27
- /* @__PURE__ */ jsx(ReactPagify.Segment, { field: "previousPages" }),
28
- /* @__PURE__ */ jsx(ReactPagify.Segment, { className: "selected", field: "centerPage" }),
29
- /* @__PURE__ */ jsx(ReactPagify.Segment, { field: "nextPages" }),
30
- /* @__PURE__ */ jsx(ReactPagify.Ellipsis, { className: "ellipsis", nextField: "endPages", previousField: "nextPages" }),
31
- /* @__PURE__ */ jsx(ReactPagify.Segment, { field: "endPages" }),
32
- /* @__PURE__ */ jsx(ReactPagify.Button, { className: pagination.page >= pages ? "button-disabled" : "", page: nextPage, children: labelNext })
25
+ /* @__PURE__ */ jsx(Comp.Button, { className: pagination.page <= 1 ? "button-disabled" : "", page: prevPage, children: labelPrevious }),
26
+ /* @__PURE__ */ jsx(Comp.Segment, { field: "beginPages" }),
27
+ /* @__PURE__ */ jsx(Comp.Ellipsis, { className: "ellipsis", nextField: "previousPages", previousField: "beginPages" }),
28
+ /* @__PURE__ */ jsx(Comp.Segment, { field: "previousPages" }),
29
+ /* @__PURE__ */ jsx(Comp.Segment, { className: "selected", field: "centerPage" }),
30
+ /* @__PURE__ */ jsx(Comp.Segment, { field: "nextPages" }),
31
+ /* @__PURE__ */ jsx(Comp.Ellipsis, { className: "ellipsis", nextField: "endPages", previousField: "nextPages" }),
32
+ /* @__PURE__ */ jsx(Comp.Segment, { field: "endPages" }),
33
+ /* @__PURE__ */ jsx(Comp.Button, { className: pagination.page >= pages ? "button-disabled" : "", page: nextPage, children: labelNext })
33
34
  ]
34
35
  }
35
36
  ) });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/plugins/pagination/components/Paginator.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\nimport React from 'react';\nimport ReactPagify from 'react-pagify';\nimport segmentize from 'segmentize';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\n\nconst blockName = 'data-grid';\n\nconst PaginationContainer = aggregatedClasses('div')(blockName, 'pagination');\nconst PagifyContext = aggregatedClasses(ReactPagify?.Context)(blockName, 'pagify-pagination');\n\nconst Paginator = ({ pagination, pages, onSelect, labelPrevious = 'Previous', labelNext = 'Next' }) => {\n const prevPage = pagination.page - 1;\n const nextPage = pagination.page + 1;\n return (\n <PaginationContainer>\n <PagifyContext\n onSelect={(page) => page !== pagination.page && onSelect(page)}\n segments={segmentize({\n page: pagination.page,\n pages,\n beginPages: 1,\n endPages: 1,\n sidePages: 1,\n })}\n >\n <ReactPagify.Button className={pagination.page <= 1 ? 'button-disabled' : ''} page={prevPage}>\n {labelPrevious}\n </ReactPagify.Button>\n\n <ReactPagify.Segment field=\"beginPages\" />\n\n <ReactPagify.Ellipsis className=\"ellipsis\" nextField=\"previousPages\" previousField=\"beginPages\" />\n\n <ReactPagify.Segment field=\"previousPages\" />\n <ReactPagify.Segment className=\"selected\" field=\"centerPage\" />\n <ReactPagify.Segment field=\"nextPages\" />\n\n <ReactPagify.Ellipsis className=\"ellipsis\" nextField=\"endPages\" previousField=\"nextPages\" />\n\n <ReactPagify.Segment field=\"endPages\" />\n\n <ReactPagify.Button className={pagination.page >= pages ? 'button-disabled' : ''} page={nextPage}>\n {labelNext}\n </ReactPagify.Button>\n </PagifyContext>\n </PaginationContainer>\n );\n};\n\nexport { Paginator };\nexport default Paginator;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACiBjB,SAUE,KAVF;AAdN,OAAO,iBAAiB;AACxB,OAAO,gBAAgB;AACvB,SAAS,yBAAyB;AAElC,MAAM,YAAY;AAElB,MAAM,sBAAsB,kBAAkB,KAAK,EAAE,WAAW,YAAY;AAC5E,MAAM,gBAAgB,kBAAkB,aAAa,OAAO,EAAE,WAAW,mBAAmB;AAE5F,MAAM,YAAY,CAAC,EAAE,YAAY,OAAO,UAAU,gBAAgB,YAAY,YAAY,OAAO,MAAM;AACrG,QAAM,WAAW,WAAW,OAAO;AACnC,QAAM,WAAW,WAAW,OAAO;AACnC,SACE,oBAAC,uBACC;AAAA,IAAC;AAAA;AAAA,MACC,UAAU,CAAC,SAAS,SAAS,WAAW,QAAQ,SAAS,IAAI;AAAA,MAC7D,UAAU,WAAW;AAAA,QACnB,MAAM,WAAW;AAAA,QACjB;AAAA,QACA,YAAY;AAAA,QACZ,UAAU;AAAA,QACV,WAAW;AAAA,MACb,CAAC;AAAA,MAED;AAAA,4BAAC,YAAY,QAAZ,EAAmB,WAAW,WAAW,QAAQ,IAAI,oBAAoB,IAAI,MAAM,UACjF,yBACH;AAAA,QAEA,oBAAC,YAAY,SAAZ,EAAoB,OAAM,cAAa;AAAA,QAExC,oBAAC,YAAY,UAAZ,EAAqB,WAAU,YAAW,WAAU,iBAAgB,eAAc,cAAa;AAAA,QAEhG,oBAAC,YAAY,SAAZ,EAAoB,OAAM,iBAAgB;AAAA,QAC3C,oBAAC,YAAY,SAAZ,EAAoB,WAAU,YAAW,OAAM,cAAa;AAAA,QAC7D,oBAAC,YAAY,SAAZ,EAAoB,OAAM,aAAY;AAAA,QAEvC,oBAAC,YAAY,UAAZ,EAAqB,WAAU,YAAW,WAAU,YAAW,eAAc,aAAY;AAAA,QAE1F,oBAAC,YAAY,SAAZ,EAAoB,OAAM,YAAW;AAAA,QAEtC,oBAAC,YAAY,QAAZ,EAAmB,WAAW,WAAW,QAAQ,QAAQ,oBAAoB,IAAI,MAAM,UACrF,qBACH;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;AAGA,IAAO,oBAAQ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\nimport React from 'react';\nimport { default as ReactPagify } from 'react-pagify';\nimport segmentize from 'segmentize';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\n\nconst Comp = (ReactPagify as any)?.default ?? ReactPagify;\nconst blockName = 'data-grid';\nconst PaginationContainer = aggregatedClasses('div')(blockName, 'pagination');\nconst PagifyContext = aggregatedClasses(Comp?.Context)(blockName, 'pagify-pagination');\n\nconst Paginator = ({ pagination, pages, onSelect, labelPrevious = 'Previous', labelNext = 'Next' }) => {\n const prevPage = pagination.page - 1;\n const nextPage = pagination.page + 1;\n\n return (\n <PaginationContainer>\n <PagifyContext\n onSelect={(page) => page !== pagination.page && onSelect(page)}\n segments={segmentize({\n page: pagination.page,\n pages,\n beginPages: 1,\n endPages: 1,\n sidePages: 1,\n })}\n >\n <Comp.Button className={pagination.page <= 1 ? 'button-disabled' : ''} page={prevPage}>\n {labelPrevious}\n </Comp.Button>\n\n <Comp.Segment field=\"beginPages\" />\n\n <Comp.Ellipsis className=\"ellipsis\" nextField=\"previousPages\" previousField=\"beginPages\" />\n\n <Comp.Segment field=\"previousPages\" />\n <Comp.Segment className=\"selected\" field=\"centerPage\" />\n <Comp.Segment field=\"nextPages\" />\n\n <Comp.Ellipsis className=\"ellipsis\" nextField=\"endPages\" previousField=\"nextPages\" />\n\n <Comp.Segment field=\"endPages\" />\n\n <Comp.Button className={pagination.page >= pages ? 'button-disabled' : ''} page={nextPage}>\n {labelNext}\n </Comp.Button>\n </PagifyContext>\n </PaginationContainer>\n );\n};\n\nexport { Paginator };\nexport default Paginator;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACkBjB,SAUE,KAVF;AAfN,SAAS,WAAW,mBAAmB;AACvC,OAAO,gBAAgB;AACvB,SAAS,yBAAyB;AAElC,MAAM,OAAQ,aAAqB,WAAW;AAC9C,MAAM,YAAY;AAClB,MAAM,sBAAsB,kBAAkB,KAAK,EAAE,WAAW,YAAY;AAC5E,MAAM,gBAAgB,kBAAkB,MAAM,OAAO,EAAE,WAAW,mBAAmB;AAErF,MAAM,YAAY,CAAC,EAAE,YAAY,OAAO,UAAU,gBAAgB,YAAY,YAAY,OAAO,MAAM;AACrG,QAAM,WAAW,WAAW,OAAO;AACnC,QAAM,WAAW,WAAW,OAAO;AAEnC,SACE,oBAAC,uBACC;AAAA,IAAC;AAAA;AAAA,MACC,UAAU,CAAC,SAAS,SAAS,WAAW,QAAQ,SAAS,IAAI;AAAA,MAC7D,UAAU,WAAW;AAAA,QACnB,MAAM,WAAW;AAAA,QACjB;AAAA,QACA,YAAY;AAAA,QACZ,UAAU;AAAA,QACV,WAAW;AAAA,MACb,CAAC;AAAA,MAED;AAAA,4BAAC,KAAK,QAAL,EAAY,WAAW,WAAW,QAAQ,IAAI,oBAAoB,IAAI,MAAM,UAC1E,yBACH;AAAA,QAEA,oBAAC,KAAK,SAAL,EAAa,OAAM,cAAa;AAAA,QAEjC,oBAAC,KAAK,UAAL,EAAc,WAAU,YAAW,WAAU,iBAAgB,eAAc,cAAa;AAAA,QAEzF,oBAAC,KAAK,SAAL,EAAa,OAAM,iBAAgB;AAAA,QACpC,oBAAC,KAAK,SAAL,EAAa,WAAU,YAAW,OAAM,cAAa;AAAA,QACtD,oBAAC,KAAK,SAAL,EAAa,OAAM,aAAY;AAAA,QAEhC,oBAAC,KAAK,UAAL,EAAc,WAAU,YAAW,WAAU,YAAW,eAAc,aAAY;AAAA,QAEnF,oBAAC,KAAK,SAAL,EAAa,OAAM,YAAW;AAAA,QAE/B,oBAAC,KAAK,QAAL,EAAY,WAAW,WAAW,QAAQ,QAAQ,oBAAoB,IAAI,MAAM,UAC9E,qBACH;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;AAGA,IAAO,oBAAQ;",
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,