@elliemae/ds-datagrids 3.22.0-next.3 → 3.22.0-next.31

Sign up to get free protection for your applications and to get access to all the features.
Files changed (257) hide show
  1. package/dist/cjs/DSDataGrid.js.map +1 -1
  2. package/dist/cjs/DataGridImpl.js.map +1 -1
  3. package/dist/cjs/PaginatedDataGrid.js.map +1 -1
  4. package/dist/cjs/blockNames.js.map +1 -1
  5. package/dist/cjs/columns/IconColumn.js.map +1 -1
  6. package/dist/cjs/columns/NumberColumn.js.map +1 -1
  7. package/dist/cjs/components/BodyCell.js.map +1 -1
  8. package/dist/cjs/components/BodyList.js.map +1 -1
  9. package/dist/cjs/components/ColumnVisibilityMenuOption.js.map +1 -1
  10. package/dist/cjs/components/ColumnsOptionsMenuSection.js.map +1 -1
  11. package/dist/cjs/components/EmptyState.js.map +1 -1
  12. package/dist/cjs/components/HeaderCell.js.map +1 -1
  13. package/dist/cjs/components/List.js.map +1 -1
  14. package/dist/cjs/components/ListItem.js.map +1 -1
  15. package/dist/cjs/components/NoResults.js.map +1 -1
  16. package/dist/cjs/components/RowsLoader.js.map +1 -1
  17. package/dist/cjs/components/Table.js.map +1 -1
  18. package/dist/cjs/components/TableBody.js.map +1 -1
  19. package/dist/cjs/components/TableHeader.js.map +1 -1
  20. package/dist/cjs/components/footer/addOptionalFooterComponents.js.map +1 -1
  21. package/dist/cjs/components/header/PrimaryControls.js.map +1 -1
  22. package/dist/cjs/components/header/addOptionalHeaderComponents.js.map +1 -1
  23. package/dist/cjs/components/index.js.map +1 -1
  24. package/dist/cjs/components/renderers/defaultClassedRenderers.js.map +1 -1
  25. package/dist/cjs/components/renderers/index.js.map +1 -1
  26. package/dist/cjs/components/renderers/renderRowsLoader.js.map +1 -1
  27. package/dist/cjs/components/tableContext.js.map +1 -1
  28. package/dist/cjs/defaultPlugins.js.map +1 -1
  29. package/dist/cjs/index.js.map +1 -1
  30. package/dist/cjs/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js.map +1 -1
  31. package/dist/cjs/plugins/body-header-scroll-sync/index.js.map +1 -1
  32. package/dist/cjs/plugins/column-dnd/DndColumnsPlugin.js.map +1 -1
  33. package/dist/cjs/plugins/column-dnd/decorateGridWithDndColumns.js.map +1 -1
  34. package/dist/cjs/plugins/column-dnd/index.js.map +1 -1
  35. package/dist/cjs/plugins/column-sizing/ColumnSizingPlugin.js.map +1 -1
  36. package/dist/cjs/plugins/column-sizing/columnMeasurerTransformer.js.map +1 -1
  37. package/dist/cjs/plugins/column-sizing/ext-points/decorateColumn.js.map +1 -1
  38. package/dist/cjs/plugins/column-sizing/ext-points/getTableProps.js.map +1 -1
  39. package/dist/cjs/plugins/column-sizing/getColumnNameFromProperty.js.map +1 -1
  40. package/dist/cjs/plugins/column-sizing/index.js.map +1 -1
  41. package/dist/cjs/plugins/column-sizing/useColumnSizeService.js.map +1 -1
  42. package/dist/cjs/plugins/column-sizing/useStylesheetHelpers.js.map +1 -1
  43. package/dist/cjs/plugins/column-sizing/utils.js.map +1 -1
  44. package/dist/cjs/plugins/custom-cell-renderer/CustomRendererPlugin.js.map +1 -1
  45. package/dist/cjs/plugins/custom-cell-renderer/addCustomRendererToCell.js.map +1 -1
  46. package/dist/cjs/plugins/custom-cell-renderer/getRendererComponent.js.map +1 -1
  47. package/dist/cjs/plugins/custom-cell-renderer/index.js.map +1 -1
  48. package/dist/cjs/plugins/editable/EditableComponents/ComboBox.js.map +1 -1
  49. package/dist/cjs/plugins/editable/EditableComponents/TextBox.js.map +1 -1
  50. package/dist/cjs/plugins/editable/EditableComponents/index.js.map +1 -1
  51. package/dist/cjs/plugins/editable/EditablePlugin.js.map +1 -1
  52. package/dist/cjs/plugins/editable/decorateEditable.js.map +1 -1
  53. package/dist/cjs/plugins/editable/getEditorComponent.js.map +1 -1
  54. package/dist/cjs/plugins/editable/index.js.map +1 -1
  55. package/dist/cjs/plugins/expandable-grid/ExpandableColumn.js.map +1 -1
  56. package/dist/cjs/plugins/expandable-grid/ExpandablePlugin.js.map +1 -1
  57. package/dist/cjs/plugins/expandable-grid/ExpandedRow.js.map +1 -1
  58. package/dist/cjs/plugins/expandable-grid/ExpandedRowExtra.js.map +1 -1
  59. package/dist/cjs/plugins/expandable-grid/index.js.map +1 -1
  60. package/dist/cjs/plugins/expandable-grid/useExpandGridState.js.map +1 -1
  61. package/dist/cjs/plugins/export-data/ExportDataPlugin.js.map +1 -1
  62. package/dist/cjs/plugins/export-data/index.js.map +1 -1
  63. package/dist/cjs/plugins/filterable/FilterablePlugin.js.map +1 -1
  64. package/dist/cjs/plugins/filterable/addFilterToColumn.js.map +1 -1
  65. package/dist/cjs/plugins/filterable/components/FilterableHeader.js.map +1 -1
  66. package/dist/cjs/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js.map +1 -1
  67. package/dist/cjs/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js.map +1 -1
  68. package/dist/cjs/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js.map +1 -1
  69. package/dist/cjs/plugins/filterable/components/filterable-menus/TextFilterMenu.js.map +1 -1
  70. package/dist/cjs/plugins/filterable/components/filterable-menus/defaultDateFormat.js.map +1 -1
  71. package/dist/cjs/plugins/filterable/components/filterable-menus/getFilterMenuByType.js.map +1 -1
  72. package/dist/cjs/plugins/filterable/filterableFormatter.js.map +1 -1
  73. package/dist/cjs/plugins/filterable/filtering-helper/filterRowsByQuery.js.map +1 -1
  74. package/dist/cjs/plugins/filterable/filtering-helper/strategiesOperators.js.map +1 -1
  75. package/dist/cjs/plugins/filterable/helper.js.map +1 -1
  76. package/dist/cjs/plugins/filterable/index.js.map +1 -1
  77. package/dist/cjs/plugins/filterable/useFilterableState.js.map +1 -1
  78. package/dist/cjs/plugins/grouping-by/GroupingByPlugin.js.map +1 -1
  79. package/dist/cjs/plugins/grouping-grid/GroupingPlugin.js.map +1 -1
  80. package/dist/cjs/plugins/grouping-grid/walkStrategy.js.map +1 -1
  81. package/dist/cjs/plugins/index.js.map +1 -1
  82. package/dist/cjs/plugins/infinite-scrolling/InfiniteScrollPlugin.js.map +1 -1
  83. package/dist/cjs/plugins/infinite-scrolling/index.js.map +1 -1
  84. package/dist/cjs/plugins/pagination/PaginationPlugin.js.map +1 -1
  85. package/dist/cjs/plugins/pagination/components/Pagination.js.map +1 -1
  86. package/dist/cjs/plugins/pagination/components/Paginator.js.map +1 -1
  87. package/dist/cjs/plugins/pagination/components/PerPageDropdown.js.map +1 -1
  88. package/dist/cjs/plugins/pagination/helper.js.map +1 -1
  89. package/dist/cjs/plugins/pagination/index.js.map +1 -1
  90. package/dist/cjs/plugins/pagination/usePaginationState.js.map +1 -1
  91. package/dist/cjs/plugins/resizable/ResizablePlugin.js.map +1 -1
  92. package/dist/cjs/plugins/resizable/decorateResizable.js.map +1 -1
  93. package/dist/cjs/plugins/resizable/index.js.map +1 -1
  94. package/dist/cjs/plugins/resizable/useResizeHandle.js.map +1 -1
  95. package/dist/cjs/plugins/resizable/utils.js.map +1 -1
  96. package/dist/cjs/plugins/row-dnd/DndRowsPlugin.js.map +1 -1
  97. package/dist/cjs/plugins/row-dnd/index.js.map +1 -1
  98. package/dist/cjs/plugins/selectable/SelectablePlugin.js.map +1 -1
  99. package/dist/cjs/plugins/selectable/addSelectableColumn.js.map +1 -1
  100. package/dist/cjs/plugins/selectable/helper.js.map +1 -1
  101. package/dist/cjs/plugins/selectable/index.js.map +1 -1
  102. package/dist/cjs/plugins/selectable/selectableFormatter.js.map +1 -1
  103. package/dist/cjs/plugins/selectable/useSelectableState.js.map +1 -1
  104. package/dist/cjs/plugins/sortable/SortablePlugin.js.map +1 -1
  105. package/dist/cjs/plugins/sortable/checkIfSortable.js.map +1 -1
  106. package/dist/cjs/plugins/sortable/index.js.map +1 -1
  107. package/dist/cjs/plugins/sortable/sortHeaderFormatter.js.map +1 -1
  108. package/dist/cjs/plugins/sortable/sortTree.js.map +1 -1
  109. package/dist/cjs/plugins/sortable/sorter.js.map +1 -1
  110. package/dist/cjs/plugins/sortable/useSortableState.js.map +1 -1
  111. package/dist/cjs/plugins/toolbar/RowRenderer.js.map +1 -1
  112. package/dist/cjs/plugins/toolbar/ToolbarPlugin.js.map +1 -1
  113. package/dist/cjs/plugins/toolbar/ToolbarTrigger.js.map +1 -1
  114. package/dist/cjs/plugins/toolbar/index.js.map +1 -1
  115. package/dist/cjs/plugins/virtualization/AutoHeightList.js.map +1 -1
  116. package/dist/cjs/plugins/virtualization/VirtualizationPlugin.js.map +1 -1
  117. package/dist/cjs/plugins/virtualization/VirtualizedBody.js.map +1 -1
  118. package/dist/cjs/plugins/virtualization/VirtualizedBodyRow.js.map +1 -1
  119. package/dist/cjs/plugins/virtualization/helper.js.map +1 -1
  120. package/dist/cjs/plugins/virtualization/index.js.map +1 -1
  121. package/dist/cjs/renders/CellWithAddons.js.map +1 -1
  122. package/dist/cjs/renders/index.js.map +1 -1
  123. package/dist/cjs/renders/styled.js.map +1 -1
  124. package/dist/cjs/rowSizes.js.map +1 -1
  125. package/dist/cjs/utilities/getPluginsFromProps.js.map +1 -1
  126. package/dist/cjs/utilities/getScrollbarSize.js.map +1 -1
  127. package/dist/cjs/utilities/normalizeData.js.map +1 -1
  128. package/dist/esm/DSDataGrid.js.map +1 -1
  129. package/dist/esm/DataGridImpl.js.map +1 -1
  130. package/dist/esm/PaginatedDataGrid.js.map +1 -1
  131. package/dist/esm/blockNames.js.map +1 -1
  132. package/dist/esm/columns/IconColumn.js.map +1 -1
  133. package/dist/esm/columns/NumberColumn.js.map +1 -1
  134. package/dist/esm/components/BodyCell.js.map +1 -1
  135. package/dist/esm/components/BodyList.js.map +1 -1
  136. package/dist/esm/components/ColumnVisibilityMenuOption.js.map +1 -1
  137. package/dist/esm/components/ColumnsOptionsMenuSection.js.map +1 -1
  138. package/dist/esm/components/EmptyState.js.map +1 -1
  139. package/dist/esm/components/HeaderCell.js.map +1 -1
  140. package/dist/esm/components/List.js.map +1 -1
  141. package/dist/esm/components/ListItem.js.map +1 -1
  142. package/dist/esm/components/NoResults.js.map +1 -1
  143. package/dist/esm/components/RowsLoader.js.map +1 -1
  144. package/dist/esm/components/Table.js.map +1 -1
  145. package/dist/esm/components/TableBody.js.map +1 -1
  146. package/dist/esm/components/TableHeader.js.map +1 -1
  147. package/dist/esm/components/footer/addOptionalFooterComponents.js.map +1 -1
  148. package/dist/esm/components/header/PrimaryControls.js.map +1 -1
  149. package/dist/esm/components/header/addOptionalHeaderComponents.js.map +1 -1
  150. package/dist/esm/components/index.js.map +1 -1
  151. package/dist/esm/components/renderers/defaultClassedRenderers.js.map +1 -1
  152. package/dist/esm/components/renderers/index.js.map +1 -1
  153. package/dist/esm/components/renderers/renderRowsLoader.js.map +1 -1
  154. package/dist/esm/components/tableContext.js.map +1 -1
  155. package/dist/esm/defaultPlugins.js.map +1 -1
  156. package/dist/esm/index.js.map +1 -1
  157. package/dist/esm/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js.map +1 -1
  158. package/dist/esm/plugins/body-header-scroll-sync/index.js.map +1 -1
  159. package/dist/esm/plugins/column-dnd/DndColumnsPlugin.js.map +1 -1
  160. package/dist/esm/plugins/column-dnd/decorateGridWithDndColumns.js.map +1 -1
  161. package/dist/esm/plugins/column-dnd/index.js.map +1 -1
  162. package/dist/esm/plugins/column-sizing/ColumnSizingPlugin.js.map +1 -1
  163. package/dist/esm/plugins/column-sizing/columnMeasurerTransformer.js.map +1 -1
  164. package/dist/esm/plugins/column-sizing/ext-points/decorateColumn.js.map +1 -1
  165. package/dist/esm/plugins/column-sizing/ext-points/getTableProps.js.map +1 -1
  166. package/dist/esm/plugins/column-sizing/getColumnNameFromProperty.js.map +1 -1
  167. package/dist/esm/plugins/column-sizing/index.js.map +1 -1
  168. package/dist/esm/plugins/column-sizing/useColumnSizeService.js.map +1 -1
  169. package/dist/esm/plugins/column-sizing/useStylesheetHelpers.js.map +1 -1
  170. package/dist/esm/plugins/column-sizing/utils.js.map +1 -1
  171. package/dist/esm/plugins/custom-cell-renderer/CustomRendererPlugin.js.map +1 -1
  172. package/dist/esm/plugins/custom-cell-renderer/addCustomRendererToCell.js.map +1 -1
  173. package/dist/esm/plugins/custom-cell-renderer/getRendererComponent.js.map +1 -1
  174. package/dist/esm/plugins/custom-cell-renderer/index.js.map +1 -1
  175. package/dist/esm/plugins/editable/EditableComponents/ComboBox.js.map +1 -1
  176. package/dist/esm/plugins/editable/EditableComponents/TextBox.js.map +1 -1
  177. package/dist/esm/plugins/editable/EditableComponents/index.js.map +1 -1
  178. package/dist/esm/plugins/editable/EditablePlugin.js.map +1 -1
  179. package/dist/esm/plugins/editable/decorateEditable.js.map +1 -1
  180. package/dist/esm/plugins/editable/getEditorComponent.js.map +1 -1
  181. package/dist/esm/plugins/editable/index.js.map +1 -1
  182. package/dist/esm/plugins/expandable-grid/ExpandableColumn.js.map +1 -1
  183. package/dist/esm/plugins/expandable-grid/ExpandablePlugin.js.map +1 -1
  184. package/dist/esm/plugins/expandable-grid/ExpandedRow.js.map +1 -1
  185. package/dist/esm/plugins/expandable-grid/ExpandedRowExtra.js.map +1 -1
  186. package/dist/esm/plugins/expandable-grid/index.js.map +1 -1
  187. package/dist/esm/plugins/expandable-grid/useExpandGridState.js.map +1 -1
  188. package/dist/esm/plugins/export-data/ExportDataPlugin.js.map +1 -1
  189. package/dist/esm/plugins/export-data/index.js.map +1 -1
  190. package/dist/esm/plugins/filterable/FilterablePlugin.js.map +1 -1
  191. package/dist/esm/plugins/filterable/addFilterToColumn.js.map +1 -1
  192. package/dist/esm/plugins/filterable/components/FilterableHeader.js.map +1 -1
  193. package/dist/esm/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js.map +1 -1
  194. package/dist/esm/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js.map +1 -1
  195. package/dist/esm/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js.map +1 -1
  196. package/dist/esm/plugins/filterable/components/filterable-menus/TextFilterMenu.js.map +1 -1
  197. package/dist/esm/plugins/filterable/components/filterable-menus/defaultDateFormat.js.map +1 -1
  198. package/dist/esm/plugins/filterable/components/filterable-menus/getFilterMenuByType.js.map +1 -1
  199. package/dist/esm/plugins/filterable/filterableFormatter.js.map +1 -1
  200. package/dist/esm/plugins/filterable/filtering-helper/filterRowsByQuery.js.map +1 -1
  201. package/dist/esm/plugins/filterable/filtering-helper/strategiesOperators.js.map +1 -1
  202. package/dist/esm/plugins/filterable/helper.js.map +1 -1
  203. package/dist/esm/plugins/filterable/index.js.map +1 -1
  204. package/dist/esm/plugins/filterable/useFilterableState.js.map +1 -1
  205. package/dist/esm/plugins/grouping-by/GroupingByPlugin.js.map +1 -1
  206. package/dist/esm/plugins/grouping-grid/GroupingPlugin.js.map +1 -1
  207. package/dist/esm/plugins/grouping-grid/walkStrategy.js.map +1 -1
  208. package/dist/esm/plugins/index.js.map +1 -1
  209. package/dist/esm/plugins/infinite-scrolling/InfiniteScrollPlugin.js.map +1 -1
  210. package/dist/esm/plugins/infinite-scrolling/index.js.map +1 -1
  211. package/dist/esm/plugins/pagination/PaginationPlugin.js.map +1 -1
  212. package/dist/esm/plugins/pagination/components/Pagination.js.map +1 -1
  213. package/dist/esm/plugins/pagination/components/Paginator.js.map +1 -1
  214. package/dist/esm/plugins/pagination/components/PerPageDropdown.js.map +1 -1
  215. package/dist/esm/plugins/pagination/helper.js.map +1 -1
  216. package/dist/esm/plugins/pagination/index.js.map +1 -1
  217. package/dist/esm/plugins/pagination/usePaginationState.js.map +1 -1
  218. package/dist/esm/plugins/resizable/ResizablePlugin.js.map +1 -1
  219. package/dist/esm/plugins/resizable/decorateResizable.js.map +1 -1
  220. package/dist/esm/plugins/resizable/index.js.map +1 -1
  221. package/dist/esm/plugins/resizable/useResizeHandle.js.map +1 -1
  222. package/dist/esm/plugins/resizable/utils.js.map +1 -1
  223. package/dist/esm/plugins/row-dnd/DndRowsPlugin.js.map +1 -1
  224. package/dist/esm/plugins/row-dnd/index.js.map +1 -1
  225. package/dist/esm/plugins/selectable/SelectablePlugin.js.map +1 -1
  226. package/dist/esm/plugins/selectable/addSelectableColumn.js.map +1 -1
  227. package/dist/esm/plugins/selectable/helper.js.map +1 -1
  228. package/dist/esm/plugins/selectable/index.js.map +1 -1
  229. package/dist/esm/plugins/selectable/selectableFormatter.js.map +1 -1
  230. package/dist/esm/plugins/selectable/useSelectableState.js.map +1 -1
  231. package/dist/esm/plugins/sortable/SortablePlugin.js.map +1 -1
  232. package/dist/esm/plugins/sortable/checkIfSortable.js.map +1 -1
  233. package/dist/esm/plugins/sortable/index.js.map +1 -1
  234. package/dist/esm/plugins/sortable/sortHeaderFormatter.js.map +1 -1
  235. package/dist/esm/plugins/sortable/sortTree.js.map +1 -1
  236. package/dist/esm/plugins/sortable/sorter.js.map +1 -1
  237. package/dist/esm/plugins/sortable/useSortableState.js.map +1 -1
  238. package/dist/esm/plugins/toolbar/RowRenderer.js.map +1 -1
  239. package/dist/esm/plugins/toolbar/ToolbarPlugin.js.map +1 -1
  240. package/dist/esm/plugins/toolbar/ToolbarTrigger.js.map +1 -1
  241. package/dist/esm/plugins/toolbar/index.js.map +1 -1
  242. package/dist/esm/plugins/virtualization/AutoHeightList.js.map +1 -1
  243. package/dist/esm/plugins/virtualization/VirtualizationPlugin.js.map +1 -1
  244. package/dist/esm/plugins/virtualization/VirtualizedBody.js.map +1 -1
  245. package/dist/esm/plugins/virtualization/VirtualizedBodyRow.js.map +1 -1
  246. package/dist/esm/plugins/virtualization/helper.js.map +1 -1
  247. package/dist/esm/plugins/virtualization/index.js.map +1 -1
  248. package/dist/esm/renders/CellWithAddons.js.map +1 -1
  249. package/dist/esm/renders/index.js.map +1 -1
  250. package/dist/esm/renders/styled.js.map +1 -1
  251. package/dist/esm/rowSizes.js.map +1 -1
  252. package/dist/esm/utilities/getPluginsFromProps.js.map +1 -1
  253. package/dist/esm/utilities/getScrollbarSize.js.map +1 -1
  254. package/dist/esm/utilities/normalizeData.js.map +1 -1
  255. package/dist/types/blockNames.d.ts +2 -2
  256. package/dist/types/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.d.ts +1 -0
  257. package/package.json +25 -26
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/pagination/PaginationPlugin.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/pagination/PaginationPlugin.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/display-name */\nimport React, { useMemo } from 'react';\nimport { mergeRefs } from '@elliemae/ds-utilities';\nimport { createInstancePlugin, FocusGrid } from '@elliemae/ds-shared';\nimport { paginate } from './helper.js';\nimport { usePaginationState } from './usePaginationState.js';\nimport { NoResults } from '../../components/NoResults.js';\n\nconst composeRows = (rows, grid) => {\n const {\n state: { pagination },\n props: { groupedRows },\n } = grid.getInstance();\n if (groupedRows) return rows; // disable pagination with grouping\n if (groupedRows) {\n const filterIds = rows.map((r) => r.id);\n return paginate(\n rows\n .filter((c) => filterIds.includes(c.id))\n .map((r) => ({\n ...r,\n _isGroup: r.isGroup,\n })),\n pagination,\n );\n }\n\n return paginate(rows, pagination);\n};\n\nconst Body = React.memo(\n ({\n component: Component,\n rows,\n rowRenderer,\n noResultsPlaceholder,\n innerRef,\n innerBodyRef, // depends on body-header-scroll-sync\n isPlaceholderActive = false,\n ...otherBodyProps\n }) => (\n <Component {...otherBodyProps} innerRef={mergeRefs(innerRef)}>\n {!isPlaceholderActive ? (\n rows.map((row, index) => rowRenderer(row, { index, rowIndex: index }, {}))\n ) : (\n <NoResults innerRef={innerRef} rowRenderer={rowRenderer}>\n {noResultsPlaceholder}\n </NoResults>\n )}\n </Component>\n ),\n);\n\nconst decorateRenderers = (renderers, grid) => {\n const BodyWrapper = renderers.body.wrapper;\n renderers.body.wrapper = useMemo(\n () =>\n function (props) {\n const { hotKeys, shouldRefocus, state } = grid.getInstance();\n return (\n <FocusGrid hotKeys={hotKeys} shouldRefocus={false}>\n <Body {...props} component={BodyWrapper} />\n </FocusGrid>\n );\n },\n [],\n );\n return renderers;\n};\n\nexport const PaginationPlugin = createInstancePlugin('pagination', {\n registerStateHook: usePaginationState,\n decorateRenderers,\n composeRows,\n});\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;AC6Cf;AA5CR,OAAOA,UAAS,eAAe;AAC/B,SAAS,iBAAiB;AAC1B,SAAS,sBAAsB,iBAAiB;AAChD,SAAS,gBAAgB;AACzB,SAAS,0BAA0B;AACnC,SAAS,iBAAiB;AAE1B,MAAM,cAAc,CAAC,MAAM,SAAS;AAClC,QAAM;AAAA,IACJ,OAAO,EAAE,WAAW;AAAA,IACpB,OAAO,EAAE,YAAY;AAAA,EACvB,IAAI,KAAK,YAAY;AACrB,MAAI;AAAa,WAAO;AACxB,MAAI,aAAa;AACf,UAAM,YAAY,KAAK,IAAI,CAAC,MAAM,EAAE,EAAE;AACtC,WAAO;AAAA,MACL,KACG,OAAO,CAAC,MAAM,UAAU,SAAS,EAAE,EAAE,CAAC,EACtC,IAAI,CAAC,OAAO;AAAA,QACX,GAAG;AAAA,QACH,UAAU,EAAE;AAAA,MACd,EAAE;AAAA,MACJ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,SAAS,MAAM,UAAU;AAClC;AAEA,MAAM,OAAOA,OAAM;AAAA,EACjB,CAAC;AAAA,IACC,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IACA,sBAAsB;AAAA,IACtB,GAAG;AAAA,EACL,MACE,oBAAC,aAAW,GAAG,gBAAgB,UAAU,UAAU,QAAQ,GACxD,WAAC,sBACA,KAAK,IAAI,CAAC,KAAK,UAAU,YAAY,KAAK,EAAE,OAAO,UAAU,MAAM,GAAG,CAAC,CAAC,CAAC,IAEzE,oBAAC,aAAU,UAAoB,aAC5B,gCACH,GAEJ;AAEJ;AAEA,MAAM,oBAAoB,CAAC,WAAW,SAAS;AAC7C,QAAM,cAAc,UAAU,KAAK;AACnC,YAAU,KAAK,UAAU;AAAA,IACvB,MACE,SAAU,OAAO;AACf,YAAM,EAAE,SAAS,eAAe,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"]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/plugins/pagination/components/Pagination.tsx"],
3
+ "sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/plugins/pagination/components/Pagination.tsx"],
4
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
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": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/plugins/pagination/components/Paginator.tsx"],
3
+ "sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/plugins/pagination/components/Paginator.tsx"],
4
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
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": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/plugins/pagination/components/PerPageDropdown.tsx"],
3
+ "sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/plugins/pagination/components/PerPageDropdown.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport memoize from 'memoize-one';\nimport { range } from '@elliemae/ds-utilities';\nimport { DSComboBox, components } from '@elliemae/ds-form';\n\nconst SingleValue = ({ children, ...props }) => (\n <components.SingleValue {...props}>\n {children} <span>per page</span>\n </components.SingleValue>\n);\n\nconst generateOption = (value) => ({\n value,\n label: value,\n});\nconst getOptions = memoize((step, min, max) => {\n const options = range(min, max + step, step).map(generateOption);\n return min === 0 ? options.slice(1, options.length) : options;\n});\n\nconst PerPageDropdown = ({ min = 0, max = 100, step = 5, value = 0, onChange = () => null }) => {\n const options = getOptions(step, min, max);\n return (\n <DSComboBox\n className=\"per-page-dropdown\"\n components={{\n SingleValue,\n }}\n containerProps={{\n 'data-testid': 'per-page-dropdown',\n }}\n maxOptions={10}\n onChange={onChange}\n options={options}\n searchable={false}\n value={value}\n />\n );\n};\n\nexport { PerPageDropdown };\nexport default PerPageDropdown;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACMrB,SACa,KADb;AALF,OAAO,aAAa;AACpB,SAAS,aAAa;AACtB,SAAS,YAAY,kBAAkB;AAEvC,MAAM,cAAc,CAAC,EAAE,UAAU,GAAG,MAAM,MACxC,qBAAC,WAAW,aAAX,EAAwB,GAAG,OACzB;AAAA;AAAA,EAAS;AAAA,EAAC,oBAAC,UAAK,sBAAQ;AAAA,GAC3B;AAGF,MAAM,iBAAiB,CAAC,WAAW;AAAA,EACjC;AAAA,EACA,OAAO;AACT;AACA,MAAM,aAAa,QAAQ,CAAC,MAAM,KAAK,QAAQ;AAC7C,QAAM,UAAU,MAAM,KAAK,MAAM,MAAM,IAAI,EAAE,IAAI,cAAc;AAC/D,SAAO,QAAQ,IAAI,QAAQ,MAAM,GAAG,QAAQ,MAAM,IAAI;AACxD,CAAC;AAED,MAAM,kBAAkB,CAAC,EAAE,MAAM,GAAG,MAAM,KAAK,OAAO,GAAG,QAAQ,GAAG,WAAW,MAAM,KAAK,MAAM;AAC9F,QAAM,UAAU,WAAW,MAAM,KAAK,GAAG;AACzC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV,YAAY;AAAA,QACV;AAAA,MACF;AAAA,MACA,gBAAgB;AAAA,QACd,eAAe;AAAA,MACjB;AAAA,MACA,YAAY;AAAA,MACZ;AAAA,MACA;AAAA,MACA,YAAY;AAAA,MACZ;AAAA;AAAA,EACF;AAEJ;AAGA,IAAO,0BAAQ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/pagination/helper.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/pagination/helper.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const parsePerPageNumber = (number, max, min = 1) => {\n if (number > max) return max;\n if (number < min) return min;\n return number;\n};\n\nexport const paginate = (rows, { page, perPage = 1, amountOfPages: amount, totalRows }) => {\n // return if pagination state is controlled\n if (amount && totalRows) {\n return {\n amount,\n rows,\n page,\n };\n }\n // adapt to zero indexed logic\n const p = page - 1 || 0;\n\n const amountOfPages = perPage ? Math.ceil(rows.length / (perPage > 0 ? perPage : 1)) : 1;\n const startPage = p < amountOfPages ? p : 0;\n\n return {\n amount: amountOfPages,\n rows: perPage ? rows.slice(startPage * perPage, startPage * perPage + perPage) : rows,\n allRows: rows,\n page: startPage,\n };\n};\n\nexport default paginate;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,qBAAqB,CAAC,QAAQ,KAAK,MAAM,MAAM;AAC1D,MAAI,SAAS;AAAK,WAAO;AACzB,MAAI,SAAS;AAAK,WAAO;AACzB,SAAO;AACT;AAEO,MAAM,WAAW,CAAC,MAAM,EAAE,MAAM,UAAU,GAAG,eAAe,QAAQ,UAAU,MAAM;AAEzF,MAAI,UAAU,WAAW;AACvB,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,QAAM,IAAI,OAAO,KAAK;AAEtB,QAAM,gBAAgB,UAAU,KAAK,KAAK,KAAK,UAAU,UAAU,IAAI,UAAU,EAAE,IAAI;AACvF,QAAM,YAAY,IAAI,gBAAgB,IAAI;AAE1C,SAAO;AAAA,IACL,QAAQ;AAAA,IACR,MAAM,UAAU,KAAK,MAAM,YAAY,SAAS,YAAY,UAAU,OAAO,IAAI;AAAA,IACjF,SAAS;AAAA,IACT,MAAM;AAAA,EACR;AACF;AAEA,IAAO,iBAAQ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/pagination/index.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/pagination/index.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { PaginationPlugin } from './PaginationPlugin.js';\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,wBAAwB;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/pagination/usePaginationState.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/pagination/usePaginationState.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useDerivedStateFromProps } from '@elliemae/ds-utilities';\nimport { parsePerPageNumber } from './helper.js';\n\nexport function usePaginationState(grid) {\n const {\n minPerPage = 0,\n maxPerPage = 50,\n onPerPageChange = () => null,\n onPageChange = () => null,\n pagination: paginationProp = {\n page: 1,\n perPage: 10,\n },\n groupedRows,\n } = grid.props;\n const { composedRows, rows } = grid.getInstance();\n const [pagination, setPagination] = useDerivedStateFromProps(paginationProp);\n\n const onPerPage = (perPageNumber) => {\n const parsedPerPageNumber = parsePerPageNumber(perPageNumber, maxPerPage, minPerPage);\n const actualNumber = parsedPerPageNumber ? parseInt(parsedPerPageNumber, 10) : 0;\n\n setPagination((prevPagination) => {\n onPerPageChange(actualNumber);\n return {\n page: prevPagination.page,\n perPage: actualNumber,\n };\n });\n };\n\n const onPageSelect = (page) => {\n const length = groupedRows ? composedRows.length : rows.length;\n setPagination((prevPagination) => {\n const pages = Math.ceil(length / prevPagination.perPage);\n onPageChange(page);\n return {\n ...prevPagination,\n page: Math.min(Math.max(page, 1), pages),\n };\n });\n };\n\n return {\n state: {\n pagination,\n },\n actions: {\n onPerPage,\n onPageSelect,\n },\n };\n}\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,gCAAgC;AACzC,SAAS,0BAA0B;AAE5B,SAAS,mBAAmB,MAAM;AACvC,QAAM;AAAA,IACJ,aAAa;AAAA,IACb,aAAa;AAAA,IACb,kBAAkB,MAAM;AAAA,IACxB,eAAe,MAAM;AAAA,IACrB,YAAY,iBAAiB;AAAA,MAC3B,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,IACA;AAAA,EACF,IAAI,KAAK;AACT,QAAM,EAAE,cAAc,KAAK,IAAI,KAAK,YAAY;AAChD,QAAM,CAAC,YAAY,aAAa,IAAI,yBAAyB,cAAc;AAE3E,QAAM,YAAY,CAAC,kBAAkB;AACnC,UAAM,sBAAsB,mBAAmB,eAAe,YAAY,UAAU;AACpF,UAAM,eAAe,sBAAsB,SAAS,qBAAqB,EAAE,IAAI;AAE/E,kBAAc,CAAC,mBAAmB;AAChC,sBAAgB,YAAY;AAC5B,aAAO;AAAA,QACL,MAAM,eAAe;AAAA,QACrB,SAAS;AAAA,MACX;AAAA,IACF,CAAC;AAAA,EACH;AAEA,QAAM,eAAe,CAAC,SAAS;AAC7B,UAAM,SAAS,cAAc,aAAa,SAAS,KAAK;AACxD,kBAAc,CAAC,mBAAmB;AAChC,YAAM,QAAQ,KAAK,KAAK,SAAS,eAAe,OAAO;AACvD,mBAAa,IAAI;AACjB,aAAO;AAAA,QACL,GAAG;AAAA,QACH,MAAM,KAAK,IAAI,KAAK,IAAI,MAAM,CAAC,GAAG,KAAK;AAAA,MACzC;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO;AAAA,IACL,OAAO;AAAA,MACL;AAAA,IACF;AAAA,IACA,SAAS;AAAA,MACP;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/resizable/ResizablePlugin.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/resizable/ResizablePlugin.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-param-reassign */\n/* eslint-disable max-statements */\nimport { runAll } from '@elliemae/ds-utilities';\nimport { createInstancePlugin } from '@elliemae/ds-shared';\nimport { addResizableToColumn, resizableFormatter } from './decorateResizable.js';\n\nconst noop = () => null;\n\nconst DELTA_LAST_COLUMN = 25;\n\n// eslint-disable-next-line no-unused-vars\nconst decorateColumn = (column, grid, index) => {\n const {\n onResizeEnd = noop,\n onResizeStart = noop,\n minColumnWidth = 90,\n isColumnResizeActive = (col) => col.resizable && !col.expandableColumn,\n onColumnResize,\n } = grid.props;\n\n const { decoratedColumns } = grid.getInstance();\n // need to do this because the decorated columns which the index in the function call\n // could be different from the final decorated columns because a plugin could add a\n // column afterwards\n const colIndex = decoratedColumns.findIndex((col) => col.property === column.property);\n const isLast = colIndex === decoratedColumns.length - 1;\n\n if (!isColumnResizeActive(column)) return column;\n return addResizableToColumn(\n column,\n resizableFormatter({\n onDragStart: () => {\n grid.isDragging.current = true;\n grid.disableEvents();\n onResizeStart();\n onColumnResize('onResizeStart', { column });\n },\n onDrag: (width, increasing) => {\n const { resizedColumns, refs } = grid.getInstance();\n if (isLast && increasing) {\n const thisCol = resizedColumns.current[column.uuid] || 0;\n width = Math.max(thisCol + DELTA_LAST_COLUMN, width);\n }\n column.updateBodyHeaderWidth(width, width);\n grid.updateRowWidth();\n if (isLast && increasing) {\n // TODO: Move this to packages/ds-shared/src/ScrollSync/ScrollSync.js\n // It isn't watching the scrollLeft so you have to move both at the same time\n refs.header.current.scrollLeft += DELTA_LAST_COLUMN;\n refs.body.current.scrollLeft += DELTA_LAST_COLUMN;\n }\n },\n onDragEnd: (width, increasing, extraData) => {\n const { resizedColumns } = grid.getInstance();\n if (isLast && increasing) {\n const thisCol = resizedColumns.current[column.uuid] || 0;\n width = Math.max(thisCol + DELTA_LAST_COLUMN, width);\n }\n resizedColumns.current[column.uuid] = width;\n\n grid.isDragging.current = false;\n grid.enableEvents();\n try {\n const total = grid.getInstance().refs.body.current.scrollWidth;\n const sum = Object.keys(grid.resizedColumns.current).reduce((p, n) => grid.resizedColumns.current[n] + p, 0);\n const lastKey = grid.decoratedColumns[grid.columns.length - 1].uuid;\n if (sum < total) {\n const lastCol = grid.getInstance().columnSizeService.columns[lastKey];\n lastCol.updateWidth(grid.resizedColumns.current[lastKey] + total - sum);\n lastCol.updateBodyHeaderWidth(grid.resizedColumns.current[lastKey] + total - sum);\n grid.getInstance().columnSizeService.updateMissingWidths(total);\n }\n } catch (error) {\n console.error(\n 'Unexpected error in the addResizableToColumn trying to use the remaining grid space to the last column',\n error,\n );\n }\n\n onColumnResize('onResizeEnd', {\n column,\n width,\n extraData,\n });\n runAll(onResizeEnd)(width, extraData);\n grid.updateRowWidth();\n },\n minWidth: (column.minWidth || minColumnWidth) - (isLast ? DELTA_LAST_COLUMN : 0),\n isLast,\n }),\n );\n};\n\nexport const ResizablePlugin = createInstancePlugin('resizable', {\n decorateColumn,\n});\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,cAAc;AACvB,SAAS,4BAA4B;AACrC,SAAS,sBAAsB,0BAA0B;AAEzD,MAAM,OAAO,MAAM;AAEnB,MAAM,oBAAoB;AAG1B,MAAM,iBAAiB,CAAC,QAAQ,MAAM,UAAU;AAC9C,QAAM;AAAA,IACJ,cAAc;AAAA,IACd,gBAAgB;AAAA,IAChB,iBAAiB;AAAA,IACjB,uBAAuB,CAAC,QAAQ,IAAI,aAAa,CAAC,IAAI;AAAA,IACtD;AAAA,EACF,IAAI,KAAK;AAET,QAAM,EAAE,iBAAiB,IAAI,KAAK,YAAY;AAI9C,QAAM,WAAW,iBAAiB,UAAU,CAAC,QAAQ,IAAI,aAAa,OAAO,QAAQ;AACrF,QAAM,SAAS,aAAa,iBAAiB,SAAS;AAEtD,MAAI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AACpE,oBAAQ,YAAY,KAAK,eAAe,QAAQ,OAAO,IAAI,QAAQ,GAAG;AACtE,oBAAQ,sBAAsB,KAAK,eAAe,QAAQ,OAAO,IAAI,QAAQ,GAAG;AAChF,iBAAK,YAAY,EAAE,kBAAkB,oBAAoB,KAAK;AAAA,UAChE;AAAA,QACF,SAAS,OAAP;AACA,kBAAQ;AAAA,YACN;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAEA,uBAAe,eAAe;AAAA,UAC5B;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AACD,eAAO,WAAW,EAAE,OAAO,SAAS;AACpC,aAAK,eAAe;AAAA,MACtB;AAAA,MACA,WAAW,OAAO,YAAY,mBAAmB,SAAS,oBAAoB;AAAA,MAC9E;AAAA,IACF,CAAC;AAAA,EACH;AACF;AAEO,MAAM,kBAAkB,qBAAqB,aAAa;AAAA,EAC/D;AACF,CAAC;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/resizable/decorateResizable.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/resizable/decorateResizable.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { appendHeaderFormatter } from '@elliemae/ds-shared';\nimport { useResizeHandle } from './useResizeHandle.js';\n\nconst addResizableToColumn = (column, formatter) => appendHeaderFormatter(formatter, column);\n\nconst ResizableWrapper = React.memo(({ value, onDrag, onDragEnd, onDragStart, minWidth, handleClassName }) => {\n const { containerRef, Handle } = useResizeHandle({\n onDrag,\n onDragEnd,\n onDragStart,\n minWidth,\n handleClassName,\n });\n return (\n <div ref={containerRef} className=\"resize-container\">\n {value}\n <Handle />\n </div>\n );\n});\n\n// eslint-disable-next-line react/display-name\nconst resizableFormatter = (options) =>\n function (value) {\n return <ResizableWrapper {...options} value={value} />;\n };\n\nexport { addResizableToColumn, resizableFormatter };\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACenB,SAEE,KAFF;AAfJ,OAAOA,YAAW;AAClB,SAAS,6BAA6B;AACtC,SAAS,uBAAuB;AAEhC,MAAM,uBAAuB,CAAC,QAAQ,cAAc,sBAAsB,WAAW,MAAM;AAE3F,MAAM,mBAAmBA,OAAM,KAAK,CAAC,EAAE,OAAO,QAAQ,WAAW,aAAa,UAAU,gBAAgB,MAAM;AAC5G,QAAM,EAAE,cAAc,OAAO,IAAI,gBAAgB;AAAA,IAC/C;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,SACE,qBAAC,SAAI,KAAK,cAAc,WAAU,oBAC/B;AAAA;AAAA,IACD,oBAAC,UAAO;AAAA,KACV;AAEJ,CAAC;AAGD,MAAM,qBAAqB,CAAC,YAC1B,SAAU,OAAO;AACf,SAAO,oBAAC,oBAAkB,GAAG,SAAS,OAAc;AACtD;",
6
6
  "names": ["React"]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/resizable/index.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/resizable/index.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { ResizablePlugin } from './ResizablePlugin.js';\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,uBAAuB;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/resizable/useResizeHandle.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/resizable/useResizeHandle.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useRef } from 'react';\n\nexport const useResizeHandle = ({ onDragStart, onDrag, onDragEnd, minWidth = 10, isLast = false }) => {\n const startX = useRef();\n const startWidth = useRef();\n const containerRef = useRef();\n\n const triggerMove = (handler, event) => {\n const increasing = startX.current - event.clientX < 0;\n handler(Math.max(startWidth.current - startX.current + event.clientX, minWidth), increasing, {});\n };\n\n const onMouseMove = (event) => {\n event.stopPropagation();\n event.preventDefault();\n\n triggerMove(onDrag, event);\n };\n\n const onMouseUp = (event) => {\n event.stopPropagation();\n event.preventDefault();\n\n triggerMove(onDragEnd, event);\n\n document.removeEventListener('mousemove', onMouseMove);\n document.removeEventListener('mouseup', onMouseUp);\n };\n\n const onMouseDown = (event) => {\n event.stopPropagation();\n event.preventDefault();\n\n document.addEventListener('mousemove', onMouseMove);\n document.addEventListener('mouseup', onMouseUp);\n\n startX.current = event.clientX;\n startWidth.current = containerRef.current.offsetWidth;\n\n triggerMove(onDragStart, event);\n };\n\n const HandleComponent = ({ className = 'resize-handle' }) => (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n <div className={className} onMouseDown={onMouseDown} />\n );\n\n return {\n containerRef,\n Handle: HandleComponent,\n };\n};\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;AC4CnB;AA5CJ,SAA6B,cAAc;AAEpC,MAAM,kBAAkB,CAAC,EAAE,aAAa,QAAQ,WAAW,WAAW,IAAI,SAAS,MAAM,MAAM;AACpG,QAAM,SAAS,OAAO;AACtB,QAAM,aAAa,OAAO;AAC1B,QAAM,eAAe,OAAO;AAE5B,QAAM,cAAc,CAAC,SAAS,UAAU;AACtC,UAAM,aAAa,OAAO,UAAU,MAAM,UAAU;AACpD,YAAQ,KAAK,IAAI,WAAW,UAAU,OAAO,UAAU,MAAM,SAAS,QAAQ,GAAG,YAAY,CAAC,CAAC;AAAA,EACjG;AAEA,QAAM,cAAc,CAAC,UAAU;AAC7B,UAAM,gBAAgB;AACtB,UAAM,eAAe;AAErB,gBAAY,QAAQ,KAAK;AAAA,EAC3B;AAEA,QAAM,YAAY,CAAC,UAAU;AAC3B,UAAM,gBAAgB;AACtB,UAAM,eAAe;AAErB,gBAAY,WAAW,KAAK;AAE5B,aAAS,oBAAoB,aAAa,WAAW;AACrD,aAAS,oBAAoB,WAAW,SAAS;AAAA,EACnD;AAEA,QAAM,cAAc,CAAC,UAAU;AAC7B,UAAM,gBAAgB;AACtB,UAAM,eAAe;AAErB,aAAS,iBAAiB,aAAa,WAAW;AAClD,aAAS,iBAAiB,WAAW,SAAS;AAE9C,WAAO,UAAU,MAAM;AACvB,eAAW,UAAU,aAAa,QAAQ;AAE1C,gBAAY,aAAa,KAAK;AAAA,EAChC;AAEA,QAAM,kBAAkB,CAAC,EAAE,YAAY,gBAAgB;AAAA;AAAA,IAErD,oBAAC,SAAI,WAAsB,aAA0B;AAAA;AAGvD,SAAO;AAAA,IACL;AAAA,IACA,QAAQ;AAAA,EACV;AACF;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/resizable/utils.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/resizable/utils.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { parseInt } from '@elliemae/ds-utilities';\nimport memoizeOne from 'memoize-one';\n\nexport const isPercentNumber = (stringNumber) => typeof stringNumber === 'string' && stringNumber.indexOf('%') !== -1;\nexport const isPxNumber = (stringNumber) => typeof stringNumber === 'string' && stringNumber.indexOf('px') !== -1;\n\nexport const translatePercentageToPx = memoizeOne((totalWidth, percentage, minWidth = 0) => {\n const parsedPercentatge = parseInt(percentage.replace('%', ''));\n const width = (totalWidth * parsedPercentatge) / 100;\n return width > minWidth ? width : minWidth;\n});\n\nconst translateStringPxToNumberPx = memoizeOne((pxNumber) => parseInt(pxNumber.replace('%', '')));\nconst translatePxToPercentage = memoizeOne((totalWidth, pxWidth) => `${(pxWidth / totalWidth) * 100}%`);\n\nconst getWidth = memoizeOne((gridWidth, width = 0, minWidth) => {\n if (isPercentNumber(width)) return translatePercentageToPx(gridWidth, width, minWidth);\n if (isPxNumber(width)) return translateStringPxToNumberPx(width);\n return width;\n});\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,gBAAgB;AACzB,OAAO,gBAAgB;AAEhB,MAAM,kBAAkB,CAAC,iBAAiB,OAAO,iBAAiB,YAAY,aAAa,QAAQ,GAAG,MAAM;AAC5G,MAAM,aAAa,CAAC,iBAAiB,OAAO,iBAAiB,YAAY,aAAa,QAAQ,IAAI,MAAM;AAExG,MAAM,0BAA0B,WAAW,CAAC,YAAY,YAAY,WAAW,MAAM;AAC1F,QAAM,oBAAoB,SAAS,WAAW,QAAQ,KAAK,EAAE,CAAC;AAC9D,QAAM,QAAS,aAAa,oBAAqB;AACjD,SAAO,QAAQ,WAAW,QAAQ;AACpC,CAAC;AAED,MAAM,8BAA8B,WAAW,CAAC,aAAa,SAAS,SAAS,QAAQ,KAAK,EAAE,CAAC,CAAC;AAChG,MAAM,0BAA0B,WAAW,CAAC,YAAY,YAAY,GAAI,UAAU,aAAc,MAAM;AAEtG,MAAM,WAAW,WAAW,CAAC,WAAW,QAAQ,GAAG,aAAa;AAC9D,MAAI,gBAAgB,KAAK;AAAG,WAAO,wBAAwB,WAAW,OAAO,QAAQ;AACrF,MAAI,WAAW,KAAK;AAAG,WAAO,4BAA4B,KAAK;AAC/D,SAAO;AACT,CAAC;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/row-dnd/DndRowsPlugin.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/row-dnd/DndRowsPlugin.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable react-hooks/rules-of-hooks */\nimport React, { useMemo } from 'react';\nimport { SortableElement, SortableContainer, SortableHandle } from 'react-sortable-hoc';\nimport { GripperVertical } from '@elliemae/ds-icons';\nimport { omit } from '@elliemae/ds-utilities';\nimport { appendCellFormatter, createInstancePlugin } from '@elliemae/ds-shared';\n\n// todo: remove once it's fixed in react-sortable-hoc library\nconst keysToOmit = [\n 'axis',\n 'contentWindow',\n 'disableAutoscroll',\n 'distance',\n 'getContainer',\n 'getHelperDimensions',\n 'helperClass',\n 'helperContainer',\n 'hideSortableGhost',\n 'keyboardSortingTransitionDuration',\n 'lockAxis',\n 'lockOffset',\n 'lockToContainerEdges',\n 'onSortEnd',\n 'onSortMove',\n 'onSortOver',\n 'onSortStart',\n 'pressDelay',\n 'pressThreshold',\n 'shouldCancelStart',\n 'transitionDuration',\n 'updateBeforeSortStart',\n 'useDragHandle',\n 'useWindowAsScrollContainer',\n];\n\nconst DragHandle = SortableHandle(() => <GripperVertical className=\"drag-handle\" />);\n\nconst translateDnDData = ({ oldIndex, newIndex, index }) => ({\n sourceIndex: oldIndex,\n targetIndex: newIndex,\n fromIndex: index === undefined ? oldIndex : index,\n});\n\nconst decorateColumns = (columns) => {\n const dragColumn = {\n property: 'drag',\n label: '',\n visible: true,\n width: 24,\n minWidth: 24,\n special: true,\n };\n return [\n appendCellFormatter(\n () => (\n <>\n <DragHandle />\n </>\n ),\n dragColumn,\n ),\n ...columns,\n ];\n};\n\nconst getBodyProps = (props, grid) => {\n const { onMoveRowEnd, onReorder, onMoveRowStart } = grid.props;\n return {\n ...props,\n onSortEnd: (data) => {\n grid.enableEvents();\n grid.setIsRowDragging(false);\n onMoveRowEnd(translateDnDData(data));\n },\n onSortStart: (...args) => {\n grid.disableEvents();\n grid.setIsRowDragging(true);\n onMoveRowStart(...args);\n },\n onSortOver: (data) => {\n onReorder(translateDnDData(data));\n },\n lockAxis: 'y',\n useDragHandle: true,\n helperClass: 'row-drag-helper',\n // a promise is needed, since sortable it's mounted before it's container\n getContainer: () =>\n new Promise((resolve) => {\n setTimeout(() => {\n resolve(grid.refs.innerBody.current || grid.refs.body.current);\n }, 100);\n }),\n };\n};\n\nconst decorateRenderers = (renderers) => {\n const RowComponent = renderers.body.row;\n const BodyWrapperComponent = renderers.body.wrapper;\n\n const Row = useMemo(() => SortableElement(RowComponent), []);\n\n const BodyWrapper = useMemo(\n () => SortableContainer((props) => <BodyWrapperComponent {...omit(props, keysToOmit)} />),\n [],\n );\n\n return {\n ...renderers,\n body: {\n ...renderers.body,\n wrapper: BodyWrapper,\n row: Row,\n },\n };\n};\n\nexport const DndRowsPlugin = createInstancePlugin('dnd-rows', {\n decorateColumns,\n getBodyProps,\n decorateRenderers,\n});\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACoCiB,SAoBhC,UApBgC;AAlCxC,SAAgB,eAAe;AAC/B,SAAS,iBAAiB,mBAAmB,sBAAsB;AACnE,SAAS,uBAAuB;AAChC,SAAS,YAAY;AACrB,SAAS,qBAAqB,4BAA4B;AAG1D,MAAM,aAAa;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAM,aAAa,eAAe,MAAM,oBAAC,mBAAgB,WAAU,eAAc,CAAE;AAEnF,MAAM,mBAAmB,CAAC,EAAE,UAAU,UAAU,MAAM,OAAO;AAAA,EAC3D,aAAa;AAAA,EACb,aAAa;AAAA,EACb,WAAW,UAAU,SAAY,WAAW;AAC9C;AAEA,MAAM,kBAAkB,CAAC,YAAY;AACnC,QAAM,aAAa;AAAA,IACjB,UAAU;AAAA,IACV,OAAO;AAAA,IACP,SAAS;AAAA,IACT,OAAO;AAAA,IACP,UAAU;AAAA,IACV,SAAS;AAAA,EACX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BAAqB,YAAY;AAAA,EAC5D;AAAA,EACA;AAAA,EACA;AACF,CAAC;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/row-dnd/index.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/row-dnd/index.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { DndRowsPlugin } from './DndRowsPlugin.js';\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,qBAAqB;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/selectable/SelectablePlugin.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/selectable/SelectablePlugin.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react-hooks/rules-of-hooks */\n/* eslint-disable max-lines */\nimport { useEffect, useState, useCallback } from 'react';\nimport cx from 'obj-str';\nimport { isFunction } from '@elliemae/ds-utilities';\nimport { createInstancePlugin } from '@elliemae/ds-shared';\nimport { selectionColumnCreator } from './addSelectableColumn.js';\nimport { useSelectableState } from './useSelectableState.js';\nimport { selectMultipleRow, selectSingleRow } from './helper.js';\n\n// DECORATORS\nconst decorateColumns = (columns, grid) => {\n const {\n props: {\n selectable,\n multiSelectFilterLabel,\n multiSelectFilterOptions,\n multiSelectFilterLabels,\n multiSelectComponent,\n },\n actions: { selectAll: handleSelectAll, selectRow: handleSelectRow },\n state: { selection },\n } = grid;\n\n const createSelectionColumn = selectionColumnCreator({\n grid,\n multiple: selectable === 'multi',\n selectAll: selection.selectAll,\n onSelectAll: handleSelectAll,\n onSelectRow: handleSelectRow,\n multiSelectFilterLabel,\n multiSelectFilterOptions,\n multiSelectFilterLabels,\n multiSelectComponent,\n });\n\n const { showSelectColumn, selectionColumnDefinition } = grid.props;\n\n if (showSelectColumn) {\n const selectionColumn = createSelectionColumn(selectionColumnDefinition);\n return [selectionColumn, ...columns];\n }\n return columns;\n};\n\nconst getRowProps = (rowProps, grid, { rowData }) => {\n const {\n props: { showSelectHighlight, showSelectColumn, rowKey },\n actions: { selectRow },\n } = grid.getInstance();\n\n const { _index } = rowData;\n const isSelected = rowData['metaData.selected'];\n\n if (!showSelectColumn) {\n rowProps.onClick = () => selectRow(rowData[rowKey], _index);\n }\n\n rowProps.className = cx({\n [rowProps.className]: true,\n selected: isSelected,\n 'select-highlight': showSelectHighlight && isSelected,\n });\n\n return rowProps;\n};\n\nconst composeRows = (rows, grid) => {\n const {\n props: { isRowSelected, multiple, rowKey },\n state: { selection },\n } = grid.getInstance();\n\n const selectionPredicate = (row) =>\n isFunction(isRowSelected) ? isRowSelected(row) : !!selection.selectedRows[row[rowKey]];\n\n return multiple ? selectMultipleRow(rows, selectionPredicate) : selectSingleRow(rows, selectionPredicate);\n};\n\nconst decorateGrid = (grid) => {\n // const handler = useRef();\n const {\n props: { isRowSelected, rowKey },\n actions: { selectRow },\n state: { selection },\n } = grid.getInstance();\n const [shiftPressed, setShiftPressed] = useState(false);\n const [lastSelectedRow, setLastSelectedRow] = useState(null);\n\n const selectRowHandler = useCallback(\n (rowData, index) => () => selectRow(rowData[rowKey], index, shiftPressed),\n [isRowSelected, selection, shiftPressed],\n );\n\n useEffect(() => {\n const keyDownListener = (event) => {\n if (\n event.key === 'Shift' &&\n event.target.tagName.toLowerCase() !== 'input' &&\n event.target.parentNode.className !== 'em-ds-combobox__input'\n ) {\n setShiftPressed(true);\n }\n };\n const keyUpListener = (event) => {\n if (\n event.key === 'Shift' &&\n event.target.tagName.toLowerCase() !== 'input' &&\n event.target.parentNode.className !== 'em-ds-combobox__input'\n ) {\n setShiftPressed(false);\n }\n };\n window.addEventListener('keydown', keyDownListener);\n window.addEventListener('keyup', keyUpListener);\n return () => {\n window.removeEventListener('keydown', keyDownListener);\n window.removeEventListener('keyup', keyUpListener);\n };\n });\n\n return {\n shiftPressed,\n selectRowHandler,\n setLastSelectedRow,\n lastSelectedRow,\n };\n};\n\nexport const SelectablePlugin = createInstancePlugin('selectable', {\n decorateGrid,\n registerStateHook: useSelectableState,\n decorateColumns,\n getRowProps,\n composeRows,\n registerHotKeys(grid) {\n return [\n {\n key: 'space',\n handler: ({ rowIndex }) => {\n const {\n composedRows,\n props: { rowKey },\n actions: { selectRow },\n } = grid.getInstance();\n const rows = composedRows.rows || composedRows;\n const row = rows[rowIndex];\n if (!row) return;\n selectRow(row[rowKey], rowIndex);\n },\n },\n {\n key: 'ctrl+a',\n handler: () => {\n const {\n state: { selection },\n actions: { selectAll },\n } = grid.getInstance();\n\n selectAll(!selection.selectAll);\n },\n },\n ];\n },\n});\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,WAAW,UAAU,mBAAmB;AACjD,OAAO,QAAQ;AACf,SAAS,kBAAkB;AAC3B,SAAS,4BAA4B;AACrC,SAAS,8BAA8B;AACvC,SAAS,0BAA0B;AACnC,SAAS,mBAAmB,uBAAuB;AAGnD,MAAM,kBAAkB,CAAC,SAAS,SAAS;AACzC,QAAM;AAAA,IACJ,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,SAAS,EAAE,WAAW,iBAAiB,WAAW,gBAAgB;AAAA,IAClE,OAAO,EAAE,UAAU;AAAA,EACrB,IAAI;AAEJ,QAAM,wBAAwB,uBAAuB;AAAA,IACnD;AAAA,IACA,UAAU,eAAe;AAAA,IACzB,WAAW,UAAU;AAAA,IACrB,aAAa;AAAA,IACb,aAAa;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,QAAM,EAAE,kBAAkB,0BAA0B,IAAI,KAAK;AAE7D,MAAI,kBAAkB;AACpB,UAAM,kBAAk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,OAAO,EAAE,UAAU;AAAA,YACnB,SAAS,EAAE,UAAU;AAAA,UACvB,IAAI,KAAK,YAAY;AAErB,oBAAU,CAAC,UAAU,SAAS;AAAA,QAChC;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF,CAAC;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/selectable/addSelectableColumn.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/selectable/addSelectableColumn.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { appendCellFormatter, appendHeaderFormatter } from '@elliemae/ds-shared';\nimport { selectableFormatter } from './selectableFormatter.js';\n\nexport function selectionColumnCreator({\n grid,\n selectAll,\n selectionComponent,\n onSelectRow,\n onSelectAll,\n multiple,\n\n // backward compatibility: later this needed to be passed through column definition\n multiSelectFilterLabel,\n multiSelectFilterOptions,\n multiSelectFilterLabels,\n multiSelectComponent, // favor selectionComponent\n}) {\n const {\n props: { rowKey },\n } = grid;\n\n return ({\n visible = true,\n isDataColumn = false,\n width = 40,\n minWidth,\n cellRenderer,\n headerCellRenderer,\n customRenderer,\n header,\n ...column\n } = {}) => {\n let selectionColumn = {\n ...column,\n property: 'metaData.selected',\n filterLabel: multiSelectFilterLabel,\n filterOptions: multiSelectFilterOptions,\n filterLabels: multiSelectFilterLabels,\n visible,\n width,\n minWidth: minWidth || width,\n isDataColumn,\n };\n selectionColumn = appendCellFormatter(\n selectableFormatter(\n {\n isMultiSelect: multiple,\n renderer: selectionComponent || multiSelectComponent,\n onSelect: onSelectRow,\n },\n grid,\n ),\n )(selectionColumn);\n\n if (multiple) {\n selectionColumn = appendHeaderFormatter(\n selectableFormatter(\n {\n rowKey,\n selectAll,\n isMultiSelect: true,\n isHeader: true,\n className: 'multi-select-wrapper',\n renderer: selectionComponent || multiSelectComponent,\n onSelect: onSelectAll,\n },\n grid,\n ),\n )(selectionColumn);\n }\n return selectionColumn;\n };\n}\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,qBAAqB,6BAA6B;AAC3D,SAAS,2BAA2B;AAE7B,SAAS,uBAAuB;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AACF,GAAG;AACD,QAAM;AAAA,IACJ,OAAO,EAAE,OAAO;AAAA,EAClB,IAAI;AAEJ,SAAO,CAAC;AAAA,IACN,UAAU;AAAA,IACV,eAAe;AAAA,IACf,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI,CAAC,MAAM;AACT,QAAI,kBAAkB;AAAA,MACpB,GAAG;AAAA,MACH,UAAU;AAAA,MACV,aAAa;AAAA,MACb,eAAe;AAAA,MACf,cAAc;AAAA,MACd;AAAA,MACA;AAAA,MACA,UAAU,YAAY;AAAA,MACtB;AAAA,IACF;AACA,sBAAkB;AAAA,MAChB;AAAA,QACE;AAAA,UACE,eAAe;AAAA,UACf,UAAU,sBAAsB;AAAA,UAChC,UAAU;AAAA,QACZ;AAAA,QACA;AAAA,MACF;AAAA,IACF,EAAE,eAAe;AAEjB,QAAI,UAAU;AACZ,wBAAkB;AAAA,QAChB;AAAA,UACE;AAAA,YACE;AAAA,YACA;AAAA,YACA,eAAe;AAAA,YACf,UAAU;AAAA,YACV,WAAW;AAAA,YACX,UAAU,sBAAsB;AAAA,YAChC,UAAU;AAAA,UACZ;AAAA,UACA;AAAA,QACF;AAAA,MACF,EAAE,eAAe;AAAA,IACnB;AACA,WAAO;AAAA,EACT;AACF;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/selectable/helper.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/selectable/helper.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { toggleInObject } from '@elliemae/ds-utilities';\n\nexport const checkAllRowsSelected = (rows, selectedRows) => {\n if (rows.length && selectedRows.length === rows.length) return true;\n if (selectedRows.length) return 'mixed';\n return false;\n};\n\nexport const toggleSelectAll = (rows, checked) =>\n !checked ? {} : rows.reduce((nextSelRows, row) => toggleInObject(nextSelRows, row.id, true), {});\n\nexport const toggleSingleSelectable = (selectedRows, id) => (!selectedRows[id] ? toggleInObject({}, id, true) : {});\n\nconst mergeSelectedToMetaData = (selected) => (row) => ({\n ...row,\n 'metaData.selected': selected,\n});\n\nexport const selectSingleRow = (rows, filter) => rows.map((row) => mergeSelectedToMetaData(filter(row))(row));\n\nexport const selectMultipleRow = (rows, isRowSelectedPredicate) =>\n rows.map((row) => mergeSelectedToMetaData(isRowSelectedPredicate(row))(row));\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sBAAsB;AAExB,MAAM,uBAAuB,CAAC,MAAM,iBAAiB;AAC1D,MAAI,KAAK,UAAU,aAAa,WAAW,KAAK;AAAQ,WAAO;AAC/D,MAAI,aAAa;AAAQ,WAAO;AAChC,SAAO;AACT;AAEO,MAAM,kBAAkB,CAAC,MAAM,YACpC,CAAC,UAAU,CAAC,IAAI,KAAK,OAAO,CAAC,aAAa,QAAQ,eAAe,aAAa,IAAI,IAAI,IAAI,GAAG,CAAC,CAAC;AAE1F,MAAM,yBAAyB,CAAC,cAAc,OAAQ,CAAC,aAAa,EAAE,IAAI,eAAe,CAAC,GAAG,IAAI,IAAI,IAAI,CAAC;AAEjH,MAAM,0BAA0B,CAAC,aAAa,CAAC,SAAS;AAAA,EACtD,GAAG;AAAA,EACH,qBAAqB;AACvB;AAEO,MAAM,kBAAkB,CAAC,MAAM,WAAW,KAAK,IAAI,CAAC,QAAQ,wBAAwB,OAAO,GAAG,CAAC,EAAE,GAAG,CAAC;AAErG,MAAM,oBAAoB,CAAC,MAAM,2BACtC,KAAK,IAAI,CAAC,QAAQ,wBAAwB,uBAAuB,GAAG,CAAC,EAAE,GAAG,CAAC;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/selectable/index.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/selectable/index.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { SelectablePlugin } from './SelectablePlugin.js';\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,wBAAwB;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/selectable/selectableFormatter.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/selectable/selectableFormatter.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\n/* eslint-disable indent */\n/* eslint-disable jsx-a11y/no-static-element-interactions,jsx-a11y/click-events-have-key-events,react/display-name */\nimport React, { forwardRef, useEffect, useRef } from 'react';\nimport { isFunction } from '@elliemae/ds-utilities';\nimport { DSCheckbox, DSRadio } from '@elliemae/ds-form';\n\nconst SelectableWrapper = ({ className, children }) => (\n <div className={className} onClick={(e) => e.stopPropagation()}>\n {children}\n </div>\n);\n\nconst SelectableComponent = React.memo(\n forwardRef(\n ({ className, isMultiSelect, isHeader, onSelect, isSelected, value }, ref) => {\n const SelectComponent = isMultiSelect || isHeader ? DSCheckbox : DSRadio;\n\n return (\n <SelectableWrapper className={className}>\n <SelectComponent\n checked={isSelected}\n data-testid=\"column-selectable-component\"\n innerRef={ref}\n onChange={onSelect}\n tabIndex={-1}\n value={value}\n />\n </SelectableWrapper>\n );\n },\n (prev, next) => next.isScrolling,\n ),\n);\n\nconst selectableFormatter = ({ isMultiSelect = false, renderer, className, isHeader, onSelect }, grid) =>\n function (valueRender, extraParams) {\n const { registerFocus } = extraParams;\n const ref = useRef();\n const {\n props: { rowKey },\n state: { selection },\n shiftPressed,\n lastSelectedRow,\n } = grid.getInstance();\n const { rowData, isScrolling } = extraParams;\n\n useEffect(() => {\n if (registerFocus) registerFocus(ref.current);\n }, [ref.current]);\n\n const isSelected = isHeader ? selection.selectAll : !!selection.selectedRows[rowData[rowKey]];\n\n const handleSelect = isHeader\n ? () => onSelect(!isSelected)\n : () => onSelect(rowData[rowKey], extraParams.rowIndex, shiftPressed, lastSelectedRow);\n\n if (isFunction(renderer)) {\n return (\n <SelectableWrapper className={className}>\n {renderer({\n rowData: {},\n ...extraParams,\n value: isSelected,\n isHeader,\n onSelect: handleSelect,\n })}\n </SelectableWrapper>\n );\n }\n\n return (\n <SelectableComponent\n ref={ref}\n className={className}\n isMultiSelect={isMultiSelect}\n isScrolling={isScrolling}\n isSelected={isSelected}\n onSelect={handleSelect}\n value={!isHeader ? rowData[rowKey] : 'header-select-all'}\n />\n );\n };\n\nexport { selectableFormatter };\nexport default selectableFormatter;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACQrB;AALF,OAAOA,UAAS,YAAY,WAAW,cAAc;AACrD,SAAS,kBAAkB;AAC3B,SAAS,YAAY,eAAe;AAEpC,MAAM,oBAAoB,CAAC,EAAE,WAAW,SAAS,MAC/C,oBAAC,SAAI,WAAsB,SAAS,CAAC,MAAM,EAAE,gBAAgB,GAC1D,UACH;AAGF,MAAM,sBAAsBA,OAAM;AAAA,EAChC;AAAA,IACE,CAAC,EAAE,WAAW,eAAe,UAAU,UAAU,YAAY,MAAM,GAAG,QAAQ;AAC5E,YAAM,kBAAkB,iBAAiB,WAAW,aAAa;AAEjE,aACE,oBAAC,qBAAkB,WACjB;AAAA,QAAC;AAAA;A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": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/selectable/useSelectableState.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/selectable/useSelectableState.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport { useDerivedStateFromProps } from '@elliemae/ds-utilities';\nimport { toggleInObject, hashArray, omit } from '@elliemae/ds-utilities';\nimport { checkAllRowsSelected, toggleSelectAll, toggleSingleSelectable } from './helper.js';\n\nfunction deriveSelectedStateFromPropsOnUpdate(rows) {\n return (nextProp = {}, prevProp = {}) => {\n if (nextProp.selectAll !== prevProp.selectAll) {\n const nextSelectedRows = nextProp.selectAll\n ? toggleSelectAll(rows, true)\n : hashArray(nextProp.selectedRows || []);\n return {\n selectedRows: nextSelectedRows,\n selectAll: checkAllRowsSelected(rows, Object.keys(nextSelectedRows)),\n };\n }\n return {\n selectedRows: hashArray(nextProp.selectedRows || []),\n selectAll: checkAllRowsSelected(rows, Object.keys(nextProp.selectedRows)),\n };\n };\n}\n\nexport function useSelectableState(grid) {\n const {\n props: { rowKey = 'id', selectedRows, selectAll, selectable, onSelectRow, onSelectAll },\n rows,\n setLastSelectedRow,\n } = grid.getInstance();\n\n const multiple = selectable === 'multi';\n const [selection, setSelectedRowsState] = useDerivedStateFromProps(\n { selectedRows, selectAll },\n { onUpdate: deriveSelectedStateFromPropsOnUpdate(rows) },\n );\n\n // ACTIONS\n const handleSelectRow = (\n id,\n index,\n shift = false,\n lastSelectedRow = null,\n // eslint-disable-next-line max-params\n ) => {\n setSelectedRowsState((prevState) => {\n const { rows: nextRows } = grid.getInstance();\n const wasSelected = Object.keys(prevState.selectedRows).some(\n // we need to match softly as the id may be a number\n // eslint-disable-next-line eqeqeq\n (elem) => elem == id,\n );\n let nextSelectedRows = multiple\n ? toggleInObject(prevState.selectedRows, id, true)\n : toggleSingleSelectable(prevState.selectedRows, id);\n setLastSelectedRow({ index, mode: wasSelected ? 'deselect' : 'select' });\n if (shift && lastSelectedRow) {\n const prevSmallest = lastSelectedRow.index < index + 1;\n const sliceStart = prevSmallest ? lastSelectedRow.index : index;\n const sliceEnd = prevSmallest ? index + 1 : lastSelectedRow.index + 1;\n const rowSegment = nextRows.slice(sliceStart, sliceEnd).map((row) => row[rowKey]);\n if (lastSelectedRow.mode === 'deselect') {\n nextSelectedRows = omit(prevState.selectedRows, rowSegment);\n } else {\n const selectedSegment = rowSegment.reduce((o, key) => ({ ...o, [key]: true }), {});\n nextSelectedRows = {\n ...prevState.selectedRows,\n ...selectedSegment,\n };\n }\n }\n\n const nextState = {\n selectedRows: nextSelectedRows,\n selectAll: checkAllRowsSelected(nextRows, Object.keys(nextSelectedRows)),\n };\n if (index !== null && index !== undefined) {\n onSelectRow(\n nextRows.filter((row) => nextState.selectedRows[row[rowKey]]),\n nextState.selectAll,\n index,\n );\n }\n\n return nextState;\n });\n };\n\n const handleSelectAll = (checked) => {\n if (!multiple) return;\n setLastSelectedRow(null);\n setSelectedRowsState(() => {\n const { composedRows: nextRows } = grid.getInstance();\n\n const nextState = {\n selectAll: checked,\n selectedRows: toggleSelectAll(nextRows, checked),\n };\n\n onSelectAll(nextState.selectAll);\n onSelectRow(checked ? nextRows : [], nextState.selectAll);\n\n return nextState;\n });\n };\n\n return {\n actions: {\n selectRow: handleSelectRow,\n selectAll: handleSelectAll,\n },\n state: {\n selection,\n },\n };\n}\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,gCAAgC;AACzC,SAAS,gBAAgB,WAAW,YAAY;AAChD,SAAS,sBAAsB,iBAAiB,8BAA8B;AAE9E,SAAS,qCAAqC,MAAM;AAClD,SAAO,CAAC,WAAW,CAAC,GAAG,WAAW,CAAC,MAAM;AACvC,QAAI,SAAS,cAAc,SAAS,WAAW;AAC7C,YAAM,mBAAmB,SAAS,YAC9B,gBAAgB,MAAM,IAAI,IAC1B,UAAU,SAAS,gBAAgB,CA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B,SAAS,YAAY;AACvC,6BAAmB,KAAK,UAAU,cAAc,UAAU;AAAA,QAC5D,OAAO;AACL,gBAAM,kBAAkB,WAAW,OAAO,CAAC,GAAG,SAAS,EAAE,GAAG,GAAG,CAAC,GAAG,GAAG,KAAK,IAAI,CAAC,CAAC;AACjF,6BAAmB;AAAA,YACjB,GAAG,UAAU;AAAA,YACb,GAAG;AAAA,UACL;AAAA,QACF;AAAA,MACF;AAEA,YAAM,YAAY;AAAA,QAChB,cAAc;AAAA,QACd,WAAW,qBAAqB,UAAU,OAAO,KAAK,gBAAgB,CAAC;AAAA,MACzE;AACA,UAAI,UAAU,QAAQ,UAAU,QAAW;AACzC;AAAA,UACE,SAAS,OAAO,CAAC,QAAQ,UAAU,aAAa,IAAI,MAAM,CAAC,CAAC;AAAA,UAC5D,UAAU;AAAA,UACV;AAAA,QACF;AAAA,MACF;AAEA,aAAO;AAAA,IACT,CAAC;AAAA,EACH;AAEA,QAAM,kBAAkB,CAAC,YAAY;AACnC,QAAI,CAAC;AAAU;AACf,uBAAmB,IAAI;AACvB,yBAAqB,MAAM;AACzB,YAAM,EAAE,cAAc,SAAS,IAAI,KAAK,YAAY;AAEpD,YAAM,YAAY;AAAA,QAChB,WAAW;AAAA,QACX,cAAc,gBAAgB,UAAU,OAAO;AAAA,MACjD;AAEA,kBAAY,UAAU,SAAS;AAC/B,kBAAY,UAAU,WAAW,CAAC,GAAG,UAAU,SAAS;AAExD,aAAO;AAAA,IACT,CAAC;AAAA,EACH;AAEA,SAAO;AAAA,IACL,SAAS;AAAA,MACP,WAAW;AAAA,MACX,WAAW;AAAA,IACb;AAAA,IACA,OAAO;AAAA,MACL;AAAA,IACF;AAAA,EACF;AACF;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/sortable/SortablePlugin.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/sortable/SortablePlugin.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import * as sortabular from 'sortabular';\nimport { compose, isEmpty, orderBy } from '@elliemae/ds-utilities';\nimport { createInstancePlugin, appendHeaderFormatter, mergeClassNameToColumnHeader } from '@elliemae/ds-shared';\nimport { sortHeaderFormatter } from './sortHeaderFormatter.js';\nimport { useSortableState } from './useSortableState.js';\nimport { sorter, sorterGroups } from './sorter.js';\n\nconst decorateColumn = (column, grid) => {\n const {\n props: { isSortableColumnActive = (col) => col.sortable, groupedRows },\n } = grid;\n\n if (groupedRows) return column;\n if (!isSortableColumnActive(column)) return column;\n\n const formatter = sortHeaderFormatter(\n sortabular.sort({\n getSortingColumns: () => grid.getState().sortingColumns || [],\n onSort: grid.actions.sort,\n strategy: sortabular.strategies.byProperty,\n }),\n grid,\n );\n\n return compose(appendHeaderFormatter(formatter), mergeClassNameToColumnHeader('with-sortable'))(column);\n};\n\nconst composeRows = (rows, grid) => {\n const {\n state: { sortingColumns },\n props: { isDataSorted, groupedRows, groupedBy, sortEmptyLast },\n rows: rowsData,\n composedRows,\n decoratedColumns,\n } = grid.getInstance();\n\n const sortingConfig = {\n columns: decoratedColumns,\n sortingColumns: !isEmpty(sortingColumns) && sortingColumns,\n sort: orderBy,\n emptyLast: sortEmptyLast,\n };\n\n // TODO: 1572 FIX\n if (groupedRows && !groupedBy) {\n return !isDataSorted ? sorterGroups(sortingConfig)(composedRows, rowsData, groupedBy) : rows;\n }\n\n return !isDataSorted ? sorter(sortingConfig)(rows) : rows;\n};\n\nexport const SortablePlugin = createInstancePlugin('sortable', {\n registerStateHook: useSortableState,\n decorateColumn,\n composeRows,\n registerHotKeys(grid) {\n return {\n key: 'ctrl+s',\n handler: ({ cellIndex }) => {\n const {\n actions: { sort },\n decoratedColumns,\n } = grid.getInstance();\n const column = decoratedColumns[cellIndex];\n if (!column) return;\n sort(column.property);\n },\n };\n },\n});\n"],
5
5
  "mappings": "AAAA,YAA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AAAA,EACA,gBAAgB,MAAM;AACpB,WAAO;AAAA,MACL,KAAK;AAAA,MACL,SAAS,CAAC,EAAE,UAAU,MAAM;AAC1B,cAAM;AAAA,UACJ,SAAS,EAAE,KAAK;AAAA,UAChB;AAAA,QACF,IAAI,KAAK,YAAY;AACrB,cAAM,SAAS,iBAAiB,SAAS;AACzC,YAAI,CAAC;AAAQ;AACb,aAAK,OAAO,QAAQ;AAAA,MACtB;AAAA,IACF;AAAA,EACF;AACF,CAAC;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/sortable/checkIfSortable.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/sortable/checkIfSortable.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-plusplus */\n/* eslint-disable no-loops/no-loops */\nexport const checkIfSortable = (column, rows) => {\n for (let index = 0; index < rows.length; index++) {\n const element = rows[index][column];\n if (!(element === null || element === undefined)) {\n // PUI-6452\n return true;\n }\n }\n return false;\n};\n\nexport default checkIfSortable;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACEhB,MAAM,kBAAkB,CAAC,QAAQ,SAAS;AAC/C,WAAS,QAAQ,GAAG,QAAQ,KAAK,QAAQ,SAAS;AAChD,UAAM,UAAU,KAAK,KAAK,EAAE,MAAM;AAClC,QAAI,EAAE,YAAY,QAAQ,YAAY,SAAY;AAEhD,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;AAEA,IAAO,0BAAQ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/sortable/index.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/sortable/index.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { SortablePlugin } from './SortablePlugin.js';\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sBAAsB;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/sortable/sortHeaderFormatter.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/sortable/sortHeaderFormatter.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { ArrowheadDown, ArrowheadUp } from '@elliemae/ds-icons';\n\nconst blockName = 'data-grid-sort-header';\n\nconst SortHeaderContainer = aggregatedClasses('div')(blockName);\n\nconst iconColor = ['brand-primary', 800];\n\nconst SortHeader = React.memo(({ value, onClick, sortState }) => {\n const sortIndicator = sortState === 'asc' ? <ArrowheadUp color={iconColor} /> : <ArrowheadDown color={iconColor} />;\n return (\n <SortHeaderContainer onClick={onClick}>\n <span className=\"header-value\">{value}</span>\n {sortState && sortIndicator}\n </SortHeaderContainer>\n );\n});\n\nconst sortHeaderFormatter =\n (sortable, grid) =>\n (value, { columnIndex, property }) => {\n const {\n state: { sortingColumns },\n } = grid.getInstance();\n const { onClick, className } = sortable(value, { columnIndex, property });\n return (\n <SortHeader\n className={className}\n onClick={onClick}\n sortState={sortingColumns[property] && sortingColumns[property].direction}\n value={value}\n />\n );\n };\n\nexport { sortHeaderFormatter };\nexport default sortHeaderFormatter;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACWuB,cAE1C,YAF0C;AAX9C,OAAOA,YAAW;AAClB,SAAS,yBAAyB;AAClC,SAAS,eAAe,mBAAmB;AAE3C,MAAM,YAAY;AAElB,MAAM,sBAAsB,kBAAkB,KAAK,EAAE,SAAS;AAE9D,MAAM,YAAY,CAAC,iBAAiB,GAAG;AAEvC,MAAM,aAAaA,OAAM,KAAK,CAAC,EAAE,OAAO,SAAS,UAAU,MAAM;AAC/D,QAAM,gBAAgB,cAAc,QAAQ,oBAAC,eAAY,OAAO,WAAW,IAAK,oBAAC,iBAAc,OAAO,WAAW;AACjH,SACE,qBAAC,uBAAoB,SACnB;AAAA,wBAAC,UAAK,WAAU,gBAAgB,iBAAM;AAAA,IACrC,aAAa;AAAA,KAChB;AAEJ,CAAC;AAED,MAAM,sBACJ,CAAC,UAAU,SACX,CAAC,OAAO,EAAE,aAAa,SAAS,MAAM;AACpC,QAAM;AAAA,IACJ,OAAO,EAAE,eAAe;AAAA,EAC1B,IAAI,KAAK,YAAY;AACrB,QAAM,EAAE,SAAS,UAAU,IAAI,SAAS,OAAO,EAAE,aAAa,SAAS,CAAC;AACxE,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,WAAW,eAAe,QAAQ,KAAK,eAAe,QAAQ,EAAE;AAAA,MAChE;AAAA;AAAA,EACF;AAEJ;AAGF,IAAO,8BAAQ;",
6
6
  "names": ["React"]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/sortable/sortTree.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/sortable/sortTree.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import * as sort from 'sortabular';\n\nconst deepSorting = (sortConfig, rows = []) =>\n sort.sorter(sortConfig)(\n rows.map((row) =>\n row.children && row.children.length\n ? {\n ...row,\n children: deepSorting(sortConfig, row.children),\n }\n : row,\n ),\n );\nfunction sortTree(sortConfig) {\n return (rows) => deepSorting(sortConfig, rows);\n}\n\nexport { sortTree };\nexport default sortTree;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,YAAY,UAAU;AAEtB,MAAM,cAAc,CAAC,YAAY,OAAO,CAAC,MACvC,KAAK,OAAO,UAAU;AAAA,EACpB,KAAK;AAAA,IAAI,CAAC,QACR,IAAI,YAAY,IAAI,SAAS,SACzB;AAAA,MACE,GAAG;AAAA,MACH,UAAU,YAAY,YAAY,IAAI,QAAQ;AAAA,IAChD,IACA;AAAA,EACN;AACF;AACF,SAAS,SAAS,YAAY;AAC5B,SAAO,CAAC,SAAS,YAAY,YAAY,IAAI;AAC/C;AAGA,IAAO,mBAAQ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/sortable/sorter.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/sortable/sorter.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable max-statements */\nimport { get } from '@elliemae/ds-utilities';\nimport moment from 'moment';\n\nexport const sorter =\n ({ columns, sortingColumns, sort, emptyLast } = {}) =>\n (data) => {\n if (!columns) {\n throw new Error('sort.sorter - Missing \"columns\" argument!');\n }\n\n if (!sort) {\n throw new Error('sort.sorter - Missing \"sort\" argument!');\n }\n\n if (!sortingColumns) {\n return data;\n }\n const columnIndexList = new Array(sortingColumns.length);\n const orderList = new Array(sortingColumns.length);\n\n let actualSortFunction = sort;\n if (emptyLast) {\n actualSortFunction = (innerData, innerColumnIndexList, innerOrderList) => {\n const sortedData = sort(innerData, innerColumnIndexList, innerOrderList);\n\n const keys = Object.keys(sortingColumns);\n\n const withData = sortedData.filter((r) => keys.some((key) => !!r[key]));\n const withoutData = sortedData.filter((r) => keys.some((key) => !r[key]));\n\n return [...withData, ...withoutData];\n };\n }\n\n Object.keys(sortingColumns).forEach((sortingColumnKey) => {\n const realColumn = columns.find((column) => column.property === sortingColumnKey);\n if (!realColumn) return;\n const columnSorter =\n realColumn.sort ||\n function resolveValue(row) {\n const { property, sortBy } = realColumn;\n const value = row[sortBy || property];\n // Pick resolved value by convention\n const resolvedValue = get(row, `_${property}`, value);\n\n if (realColumn.type === 'DateTime') {\n return moment(resolvedValue);\n }\n\n return typeof resolvedValue === 'string' ? resolvedValue.toLowerCase() : resolvedValue;\n };\n\n const sortingColumn = sortingColumns[sortingColumnKey];\n\n columnIndexList[sortingColumn.position] = columnSorter;\n\n orderList[sortingColumn.position] = sortingColumn.direction;\n });\n return actualSortFunction(data, columnIndexList, orderList);\n };\n\nexport const sorterGroups =\n ({ columns, sortingColumns, sort, emptyLast } = {}) =>\n (data, rowsData) => {\n if (!columns) {\n throw new Error('sort.sorter - Missing \"columns\" argument!');\n }\n\n if (!sort) {\n throw new Error('sort.sorter - Missing \"sort\" argument!');\n }\n\n if (!sortingColumns) {\n return data;\n }\n\n const columnIndexList = new Array(sortingColumns.length);\n const orderList = new Array(sortingColumns.length);\n\n let actualSortFunction = sort;\n if (emptyLast) {\n actualSortFunction = (innerData, innerColumnIndexList, innerOrderList) => {\n const sortedData = sort(innerData, innerColumnIndexList, innerOrderList);\n\n const keys = Object.keys(sortingColumns);\n\n const withData = sortedData.filter((r) => keys.some((key) => !!r[key]));\n const withoutData = sortedData.filter((r) => keys.some((key) => !r[key]));\n\n return [...withData, ...withoutData];\n };\n }\n\n Object.keys(sortingColumns).forEach((sortingColumnKey) => {\n const realColumn = columns.find((column) => column.property === sortingColumnKey);\n if (!realColumn) return;\n const columnSorter =\n realColumn.sort ||\n function resolveValue(row) {\n const { property, sortBy } = realColumn;\n const value = row[sortBy || property];\n // Pick resolved value by convention\n const resolvedValue = get(row, `_${property}`, value);\n\n if (realColumn.type === 'DateTime') {\n return moment(resolvedValue);\n }\n\n return typeof resolvedValue === 'string' ? resolvedValue.toLowerCase() : resolvedValue;\n };\n\n const sortingColumn = sortingColumns[sortingColumnKey];\n\n columnIndexList[sortingColumn.position] = columnSorter;\n\n orderList[sortingColumn.position] = sortingColumn.direction;\n });\n\n const groups = {};\n const preserveData = {};\n data.forEach((c) => {\n preserveData[c.id] = { ...c };\n });\n\n rowsData.forEach((group) => {\n groups[group.id] = {\n children: actualSortFunction(\n group.children.map((c) => ({\n parentNode: preserveData[c.id].parentNode,\n data: c,\n ...c,\n })),\n columnIndexList,\n orderList,\n ), // sort internally\n };\n });\n\n const sorted = actualSortFunction(\n data.map((r) => ({\n ...r.data,\n ...r,\n })),\n columnIndexList,\n orderList,\n ); // sort global\n let ssortGlobal = [];\n sorted\n .filter((s) => !s.isGroup)\n .forEach((sr) => {\n if (groups[sr.parentNode.id]) {\n ssortGlobal = [...ssortGlobal, preserveData[sr.parentNode.id], ...groups[sr.parentNode.id].children];\n delete groups[sr.parentNode.id];\n }\n });\n return ssortGlobal;\n };\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,WAAW;AACpB,OAAO,YAAY;AAEZ,MAAM,SACX,CAAC,EAAE,SAAS,gBAAgB,MAAM,UAAU,IAAI,CAAC,MACjD,CAAC,SAAS;AACR,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,2CAA2C;AAAA,EAC7D;AAEA,MAAI,CAAC,MAAM;AACT,UAAM,IAAI,MAAM,wCAAwC;AAAA,EAC1D;AAEA,MAAI,CAAC,gBAAgB;AACnB,WAAO;AAAA,EACT;AACA,QAAM,kBAAkB,IAAI,MAAM,eAAe,MAAM;AACvD,QAAM,YAAY,IAAI,MAAM,eAAe,MAAM;AAEjD,MAAI,qBAAqB;AACzB,MAAI,WAAW;AACb,yBAAqB,CAAC,WAAW,sBAAsB,mBAAmB;AACxE,YAAM,aAAa,KAAK,WAAW,sBAAsB,cAAc;AAEvE,YAAM,OAAO,OAAO,KAAK,cAAc;AAEvC,YAAM,WAAW,WAAW,OAAO,CAAC,MAAM,KAAK,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AACtE,YAAM,cAAc,WAAW,OAAO,CAAC,MAAM,KAAK,KAAK,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,CAAC;AAExE,aAAO,C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C;AAED,QAAM,SAAS;AAAA,IACb,KAAK,IAAI,CAAC,OAAO;AAAA,MACf,GAAG,EAAE;AAAA,MACL,GAAG;AAAA,IACL,EAAE;AAAA,IACF;AAAA,IACA;AAAA,EACF;AACA,MAAI,cAAc,CAAC;AACnB,SACG,OAAO,CAAC,MAAM,CAAC,EAAE,OAAO,EACxB,QAAQ,CAAC,OAAO;AACf,QAAI,OAAO,GAAG,WAAW,EAAE,GAAG;AAC5B,oBAAc,CAAC,GAAG,aAAa,aAAa,GAAG,WAAW,EAAE,GAAG,GAAG,OAAO,GAAG,WAAW,EAAE,EAAE,QAAQ;AACnG,aAAO,OAAO,GAAG,WAAW,EAAE;AAAA,IAChC;AAAA,EACF,CAAC;AACH,SAAO;AACT;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/sortable/useSortableState.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/sortable/useSortableState.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import * as sortabular from 'sortabular/dist/index.js';\nimport { useDerivedStateFromProps } from '@elliemae/ds-utilities';\nimport { checkIfSortable } from './checkIfSortable.js';\n\nexport function useSortableState(grid) {\n const { onSort, sortingColumns: sortingColumnsProp, pagination } = grid.props;\n\n const [sortingColumns, setSortingColumns] = useDerivedStateFromProps(sortingColumnsProp);\n\n const handleSort = (selectedColumn) => {\n // support for pagination\n const { composedRows = {}, props } = grid.getInstance();\n const { allRows, rows } = composedRows;\n const serverSidePagination = pagination && composedRows.amount !== (composedRows.rows && composedRows.rows.length);\n if (\n props.serverSideData ||\n serverSidePagination ||\n checkIfSortable(selectedColumn, allRows || rows || composedRows)\n ) {\n setSortingColumns((prevSortingColumns) => {\n const nextSortingColumns = sortabular.byColumn({\n sortingColumns: prevSortingColumns,\n sortingOrder: {\n FIRST: 'asc',\n asc: 'desc',\n desc: 'asc',\n },\n selectedColumn,\n });\n const { columns } = grid.getInstance();\n let columnSorted = columns.find((col) => col.property === selectedColumn);\n columnSorted = {\n ...columnSorted,\n originalProperty: columnSorted.property,\n };\n onSort(nextSortingColumns, selectedColumn, columnSorted);\n return nextSortingColumns;\n });\n }\n };\n\n return {\n state: { sortingColumns },\n actions: {\n sort: handleSort,\n },\n };\n}\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,YAAY,gBAAgB;AAC5B,SAAS,gCAAgC;AACzC,SAAS,uBAAuB;AAEzB,SAAS,iBAAiB,MAAM;AACrC,QAAM,EAAE,QAAQ,gBAAgB,oBAAoB,WAAW,IAAI,KAAK;AAExE,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,yBAAyB,kBAAkB;AAEvF,QAAM,aAAa,CAAC,mBAAmB;AAErC,UAAM,EAAE,eAAe,CAAC,GAAG,MAAM,IAAI,KAAK,YAAY;AACtD,UAAM,EAAE,SAAS,KAAK,IAAI;AAC1B,UAAM,uBAAuB,cAAc,aAAa,YAAY,aAAa,QAAQ,aAAa,KAAK;AAC3G,QACE,MAAM,kBACN,wBACA,gBAAgB,gBAAgB,WAAW,QAAQ,YAAY,GAC/D;AACA,wBAAkB,CAAC,uBAAuB;AACxC,cAAM,qBAAqB,WAAW,SAAS;AAAA,UAC7C,gBAAgB;AAAA,UAChB,cAAc;AAAA,YACZ,OAAO;AAAA,YACP,KAAK;AAAA,YACL,MAAM;AAAA,UACR;AAAA,UACA;AAAA,QACF,CAAC;AACD,cAAM,EAAE,QAAQ,IAAI,KAAK,YAAY;AACrC,YAAI,eAAe,QAAQ,KAAK,CAAC,QAAQ,IAAI,aAAa,cAAc;AACxE,uBAAe;AAAA,UACb,GAAG;AAAA,UACH,kBAAkB,aAAa;AAAA,QACjC;AACA,eAAO,oBAAoB,gBAAgB,YAAY;AACvD,eAAO;AAAA,MACT,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO;AAAA,IACL,OAAO,EAAE,eAAe;AAAA,IACxB,SAAS;AAAA,MACP,MAAM;AAAA,IACR;AAAA,EACF;AACF;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/toolbar/RowRenderer.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/toolbar/RowRenderer.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react-hooks/rules-of-hooks */\n/* eslint-disable max-statements */\n/* eslint-disable react/prop-types */\nimport React, { useEffect, useRef, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { isEmpty } from 'lodash';\nimport { omit } from '@elliemae/ds-utilities';\nimport { ToolbarTrigger } from './ToolbarTrigger.js';\nimport { RowSizes } from '../../rowSizes.js';\n\nexport const RowRenderer = (Row, grid) => {\n const Wrapped = (props) => {\n const ref = useRef();\n const { rowData = {}, index, rowIndex, style } = props;\n const {\n props: { wrapText },\n } = grid.getInstance();\n const [popStyle, setPopStyle] = useState({});\n const [rowStyle, setRowStyle] = useState(style);\n const gridInstance = grid.getInstance();\n const { refs, isRowDragging } = gridInstance;\n const [hasVerticalScrollBar, setHasVerticalScrollBar] = useState(\n refs.body.current && refs.body.current.offsetWidth > refs.body.current.clientWidth,\n );\n\n useEffect(() => {\n const shouldOmit = isRowDragging ? ['top'] : [];\n setPopStyle({\n ...popStyle,\n ...{ top: style && !isRowDragging ? style.top : '0' },\n });\n if (style) {\n // style defined means it has virtualization\n setHasVerticalScrollBar(true);\n } else {\n setHasVerticalScrollBar(false);\n }\n setRowStyle(\n omit(\n style || {\n height: !wrapText ? RowSizes[gridInstance.props.rowSize] : 'auto',\n position: 'relative',\n },\n [shouldOmit],\n ),\n );\n }, [style, isRowDragging]);\n return (\n <div\n className=\"row-renderer-fixed-height\"\n style={{\n height: !wrapText ? RowSizes[gridInstance.props.rowSize] : 'auto',\n position: style ? 'auto' : 'relative',\n // top: isDragging ? rowStyle.top - RowSizes[gridInstance.props.rowSize] : 'auto',\n }}\n >\n <Row ref={ref} {...props} style={rowStyle} />\n {isEmpty(rowData) && !rowData.index && !rowData.rowIndex ? null : (\n <div className={`toolbar-trigger-container ${style ? 'move' : 'stay'}`} style={{ ...popStyle }}>\n <ToolbarTrigger\n grid={grid}\n rowData={{ rowData, index, rowIndex }}\n hasScrollBar={hasVerticalScrollBar}\n rowRef={ref}\n />\n </div>\n )}\n </div>\n );\n };\n\n Wrapped.propTypes = {\n rowData: PropTypes.any,\n index: PropTypes.number,\n rowIndex: PropTypes.number,\n style: PropTypes.any,\n };\n\n return Wrapped;\n};\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACgDjB,SAQE,KARF;AA7CN,SAAgB,WAAW,QAAQ,gBAAgB;AACnD,OAAO,eAAe;AACtB,SAAS,eAAe;AACxB,SAAS,YAAY;AACrB,SAAS,sBAAsB;AAC/B,SAAS,gBAAgB;AAElB,MAAM,cAAc,CAAC,KAAK,SAAS;AACxC,QAAM,UAAU,CAAC,UAAU;AACzB,UAAM,MAAM,OAAO;AACnB,UAAM,EAAE,UAAU,CAAC,GAAG,OAAO,UAAU,MAAM,IAAI;AACjD,UAAM;AAAA,MACJ,OAAO,EAAE,SAAS;AAAA,IACpB,IAAI,KAAK,YAAY;AACrB,UAAM,CAAC,UAAU,WAAW,IAAI,SAAS,CAAC,CAAC;AAC3C,UAAM,CAAC,UAAU,WAAW,IAAI,SAAS,KAAK;AAC9C,UAAM,eAAe,KAAK,YAAY;AACtC,UAAM,EAAE,MAAM,cAAc,IAAI;AAChC,UAAM,CAAC,sBAAsB,uBAAuB,IAAI;AAAA,MACtD,KAAK,KAAK,WAAW,KAAK,KAAK,QAAQ,cAAc,KAAK,KAAK,QAAQ;AAAA,IACzE;AAEA,cAAU,MAAM;AACd,YAAM,aAAa,gBAAgB,CAAC,KAAK,IAAI,CAAC;AAC9C,kBAAY;AAAA,QACV,GAAG;AAAA,QACH,GAAG,EAAE,KAAK,SAAS,CAAC,gBAAgB,MAAM,MAAM,IAAI;AAAA,MACtD,CAAC;AACD,UAAI,OAAO;AAET,gCAAwB,IAAI;AAAA,MAC9B,OAAO;AACL,gCAAwB,KAAK;AAAA,MAC/B;AACA;AAAA,QACE;AAAA,UACE,SAAS;AAAA,YACP,QAAQ,CAAC,WAAW,SAAS,aAAa,MAAM,OAAO,IAAI;AAAA,YAC3D,UAAU;AAAA,UACZ;AAAA,UACA,CAAC,UAAU;AAAA,QACb;AAAA,MACF;AAAA,IACF,GAAG,CAAC,OAAO,aAAa,CAAC;AACzB,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAU;AAAA,QACV,OAAO;AAAA,UACL,QAAQ,CAAC,WAAW,SAAS,aAAa,MAAM,OAAO,IAAI;AAAA,UAC3D,UAAU,QAAQ,SAAS;AAAA;AAAA,QAE7B;AAAA,QAEA;AAAA,8BAAC,OAAI,KAAW,GAAG,OAAO,OAAO,UAAU;AAAA,UAC1C,QAAQ,OAAO,KAAK,CAAC,QAAQ,SAAS,CAAC,QAAQ,WAAW,OACzD,oBAAC,SAAI,WAAW,6BAA6B,QAAQ,SAAS,UAAU,OAAO,EAAE,GAAG,SAAS,GAC3F;AAAA,YAAC;AAAA;AAAA,cACC;AAAA,cACA,SAAS,EAAE,SAAS,OAAO,SAAS;AAAA,cACpC,cAAc;AAAA,cACd,QAAQ;AAAA;AAAA,UACV,GACF;AAAA;AAAA;AAAA,IAEJ;AAAA,EAEJ;AAEA,UAAQ,YAAY;AAAA,IAClB,SAAS,UAAU;AAAA,IACnB,OAAO,UAAU;AAAA,IACjB,UAAU,UAAU;AAAA,IACpB,OAAO,UAAU;AAAA,EACnB;AAEA,SAAO;AACT;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/toolbar/ToolbarPlugin.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/toolbar/ToolbarPlugin.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { createInstancePlugin, appendCellFormatter } from '@elliemae/ds-shared';\nimport { RowRenderer } from './RowRenderer.js';\n\nconst decorateColumns = (columns) => {\n const lastColumn = columns[columns.length - 1];\n return [\n ...columns.slice(0, -1),\n appendCellFormatter(\n [\n (value) => (\n <>\n {value}\n <div style={{ width: 34, maxWidth: 34, overflow: 'hidden' }} />\n </>\n ),\n ],\n lastColumn,\n 'fixedFormatters',\n ),\n ];\n};\n\nconst decorateRenderers = (renderers, grid) => {\n const Row = renderers.body.row;\n renderers.body.row = RowRenderer(Row, grid);\n return renderers;\n};\n\nexport const ToolbarPlugin = createInstancePlugin('toolbar', {\n decorateRenderers,\n decorateColumns,\n});\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACWb,mBAEE,KAFF;AAVV,SAAS,sBAAsB,2BAA2B;AAC1D,SAAS,mBAAmB;AAE5B,MAAM,kBAAkB,CAAC,YAAY;AACnC,QAAM,aAAa,QAAQ,QAAQ,SAAS,CAAC;AAC7C,SAAO;AAAA,IACL,GAAG,QAAQ,MAAM,GAAG,EAAE;AAAA,IACtB;AAAA,MACE;AAAA,QACE,CAAC,UACC,iCACG;AAAA;AAAA,UACD,oBAAC,SAAI,OAAO,EAAE,OAAO,IAAI,UAAU,IAAI,UAAU,SAAS,GAAG;AAAA,WAC/D;AAAA,MAEJ;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;AAEA,MAAM,oBAAoB,CAAC,WAAW,SAAS;AAC7C,QAAM,MAAM,UAAU,KAAK;AAC3B,YAAU,KAAK,MAAM,YAAY,KAAK,IAAI;AAC1C,SAAO;AACT;AAEO,MAAM,gBAAgB,qBAAqB,WAAW;AAAA,EAC3D;AAAA,EACA;AACF,CAAC;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/toolbar/ToolbarTrigger.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/toolbar/ToolbarTrigger.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useState } from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { DSButton } from '@elliemae/ds-button';\nimport { MoreOptionsVert } from '@elliemae/ds-icons';\n\nconst ToolbarBtns = styled.div`\n & > .em-ds-toolbar {\n box-shadow: none;\n }\n`;\n\nconst ToolbarWrapper = styled.div`\n display: flex;\n align-items: center;\n height: ${(props) => (props.rowSize === 'normal' ? '36px' : '28px')};\n margin-left: -4px;\n margin-right: ${(props) => (props.hasScrollBar ? '0' : '-10px')};\n padding-right: 4px;\n pointer-events: all;\n background: white;\n ${(props) =>\n props.showShadow\n ? `box-shadow: -1px 0px 1px 0px rgba(0, 0, 0, 0.2),\n 1px 0px 2px 0px rgba(0, 0, 0, 0.2);`\n : ''}\n &:hover {\n box-shadow: -1px 0px 1px 0px rgba(0, 0, 0, 0.2), 1px 0px 2px 0px rgba(0, 0, 0, 0.2);\n & > .toolbar-trigger {\n border: none;\n }\n }\n`;\n\nconst ToolbarPosition = styled.div`\n position: absolute;\n z-index: 10;\n display: flex;\n justify-content: flex-end;\n align-items: center;\n width: 0;\n pointer-events: none;\n top: 0;\n height: ${(props) => (props.rowRef.current ? `${props.rowRef.current.offsetHeight}px` : '36px')};\n margin-top: ${(props) => (props.rowSize === 'normal' ? '0' : '0')};\n`;\n\n// eslint-disable-next-line react/prop-types\nexport const ToolbarTrigger = ({ grid, rowData, hasScrollBar, rowRef }) => {\n const {\n props: { renderToolbar, rowSize },\n // eslint-disable-next-line react/prop-types\n } = grid.getInstance();\n const [show, setShow] = useState(false);\n /* eslint-disable indent */\n const toolbar = show\n ? renderToolbar({\n ...rowData,\n size: rowSize,\n isToolbarShown: show,\n setToolbarShow: setShow,\n })\n : null;\n /* eslint-enable indent */\n return (\n <ToolbarPosition rowSize={rowSize} rowRef={rowRef}>\n <ToolbarWrapper\n onMouseEnter={() => setShow(true)}\n onMouseLeave={() => setShow(false)}\n showShadow={show}\n rowSize={rowSize}\n hasScrollBar={hasScrollBar}\n >\n {show && <ToolbarBtns>{toolbar}</ToolbarBtns>}\n <DSButton\n buttonType=\"text\"\n className=\"toolbar-trigger\"\n data-testid=\"toolbar-trigger\"\n icon={<MoreOptionsVert />}\n // eslint-disable-next-line react/prop-types\n index={rowData.index}\n onClick={() => setShow(true)}\n tabIndex={-1}\n />\n </ToolbarWrapper>\n </ToolbarPosition>\n );\n};\n\nexport default ToolbarTrigger;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACiEjB,SAOW,KAPX;AAjEN,SAAgB,gBAAgB;AAChC,SAAS,cAAc;AACvB,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAEhC,MAAM,cAAc,OAAO;AAAA;AAAA;AAAA;AAAA;AAM3B,MAAM,iBAAiB,OAAO;AAAA;AAAA;AAAA,YAGlB,CAAC,UAAW,MAAM,YAAY,WAAW,SAAS;AAAA;AAAA,kBAE5C,CAAC,UAAW,MAAM,eAAe,MAAM;AAAA;AAAA;AAAA;AAAA,IAIrD,CAAC,UACD,MAAM,aACF;AAAA,yCAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASR,MAAM,kBAAkB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YASnB,CAAC,UAAW,MAAM,OAAO,UAAU,GAAG,MAAM,OAAO,QAAQ,mBAAmB;AAAA,gBAC1E,CAAC,UAAW,MAAM,YAAY,WAAW,MAAM;AAAA;AAIxD,MAAM,iBAAiB,CAAC,EAAE,MAAM,SAAS,cAAc,OAAO,MAAM;AACzE,QAAM;AAAA,IACJ,OAAO,EAAE,eAAe,QAAQ;AAAA;AAAA,EAElC,IAAI,KAAK,YAAY;AACrB,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,KAAK;AAEtC,QAAM,UAAU,OACZ,cAAc;AAAA,IACZ,GAAG;AAAA,IACH,MAAM;AAAA,IACN,gBAAgB;AAAA,IAChB,gBAAgB;AAAA,EAClB,CAAC,IACD;AAEJ,SACE,oBAAC,mBAAgB,SAAkB,QACjC;AAAA,IAAC;AAAA;AAAA,MACC,cAAc,MAAM,QAAQ,IAAI;AAAA,MAChC,cAAc,MAAM,QAAQ,KAAK;AAAA,MACjC,YAAY;AAAA,MACZ;AAAA,MACA;AAAA,MAEC;AAAA,gBAAQ,oBAAC,eAAa,mBAAQ;AAAA,QAC/B;AAAA,UAAC;AAAA;AAAA,YACC,YAAW;AAAA,YACX,WAAU;AAAA,YACV,eAAY;AAAA,YACZ,MAAM,oBAAC,mBAAgB;AAAA,YAEvB,OAAO,QAAQ;AAAA,YACf,SAAS,MAAM,QAAQ,IAAI;AAAA,YAC3B,UAAU;AAAA;AAAA,QACZ;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;AAEA,IAAO,yBAAQ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/toolbar/index.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/toolbar/index.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { ToolbarPlugin } from './ToolbarPlugin.js';\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,qBAAqB;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/virtualization/AutoHeightList.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/virtualization/AutoHeightList.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { forwardRef, useRef } from 'react';\nimport { FixedSizeList as List } from 'react-window';\nimport { mergeRefs, useWindowScrollerList, cx } from '@elliemae/ds-utilities';\n\n// eslint-disable-next-line react/display-name\nexport const AutoHeightList = forwardRef(\n (\n {\n itemCount,\n className,\n innerRef,\n itemData,\n itemKey,\n itemSize,\n outerRef,\n component: ListComponent = List,\n ...otherProps\n },\n ref,\n ) => {\n const listRef = useRef();\n const outerListRef = useRef();\n\n useWindowScrollerList({\n listInstance: listRef,\n outerListRef,\n });\n return (\n <ListComponent\n {...otherProps}\n ref={mergeRefs(ref, listRef)}\n className={cx(className, 'window-scroller-override')}\n height={window.innerHeight}\n innerRef={innerRef}\n itemCount={itemCount}\n itemData={itemData}\n itemKey={itemKey}\n itemSize={itemSize}\n outerRef={mergeRefs(outerListRef, outerRef)}\n overscanCount={10}\n useIsScrolling\n />\n );\n },\n);\n\nexport default AutoHeightList;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;AC4BjB;AA5BN,SAAgB,YAAY,cAAc;AAC1C,SAAS,iBAAiB,YAAY;AACtC,SAAS,WAAW,uBAAuB,UAAU;AAG9C,MAAM,iBAAiB;AAAA,EAC5B,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW,gBAAgB;AAAA,IAC3B,GAAG;AAAA,EACL,GACA,QACG;AACH,UAAM,UAAU,OAAO;AACvB,UAAM,eAAe,OAAO;AAE5B,0BAAsB;AAAA,MACpB,cAAc;AAAA,MACd;AAAA,IACF,CAAC;AACD,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ,KAAK,UAAU,KAAK,OAAO;AAAA,QAC3B,WAAW,GAAG,WAAW,0BAA0B;AAAA,QACnD,QAAQ,OAAO;AAAA,QACf;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,UAAU,UAAU,cAAc,QAAQ;AAAA,QAC1C,eAAe;AAAA,QACf,gBAAc;AAAA;AAAA,IAChB;AAAA,EAEJ;AACF;AAEA,IAAO,yBAAQ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/virtualization/VirtualizationPlugin.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/virtualization/VirtualizationPlugin.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-param-reassign */\n/* eslint-disable react/prop-types */\n/* eslint-disable react-hooks/rules-of-hooks */\nimport React, { useMemo, useRef } from 'react';\nimport { get } from 'lodash';\nimport { runAll, mergeRefs } from '@elliemae/ds-utilities';\nimport { createInstancePlugin, FocusGrid } from '@elliemae/ds-shared';\nimport { VirtualizedBody } from './VirtualizedBody.js';\n\nexport const VirtualizationPlugin = createInstancePlugin('virtualization', {\n decorateRenderers(renderers, grid) {\n const BodyWrapper = renderers.body.wrapper;\n // eslint-disable-next-line react/display-name\n renderers.body.wrapper = useMemo(\n () =>\n function (props) {\n const { listProps = {}, rows } = props;\n const {\n hotKeys,\n props: { autoHeight, autoScrollToId, expandable, overscanCount, rowSize },\n refs: { innerBody },\n setHasScroll,\n state: { filters },\n } = grid.getInstance();\n\n const listRef = useRef();\n const nextListProps = {\n ...listProps,\n ref: mergeRefs(listRef, listProps.ref),\n };\n return (\n <FocusGrid\n hotKeys={hotKeys}\n keyBindings={({ defaultBindings }) => ({\n ...defaultBindings,\n // todo: this is kind of hacky, since it's virtualized and there's\n // the possibility that the firsts or lasts rows aren't rendered\n Home: runAll((e) => {\n if (e.ctrlKey) {\n listRef.current.scrollToItem(0);\n setTimeout(() => defaultBindings.Home(e), 10);\n } else {\n defaultBindings.Home(e);\n }\n }),\n End: runAll((e) => {\n if (e.ctrlKey) {\n listRef.current.scrollToItem(rows.length - 1);\n setTimeout(() => defaultBindings.End(e), 10);\n } else {\n defaultBindings.End(e);\n }\n }),\n })}\n shouldRefocus={false}\n >\n <VirtualizedBody\n {...props}\n autoScrollToId={autoScrollToId}\n autoHeight={autoHeight}\n component={BodyWrapper}\n expandable={expandable}\n innerBody={innerBody}\n listProps={nextListProps}\n overscanCount={overscanCount}\n rowSize={rowSize}\n setHasScroll={setHasScroll}\n filters={filters}\n />\n </FocusGrid>\n );\n },\n [get(grid.getInstance(), 'rows.length')],\n );\n return renderers;\n },\n});\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACwDT;AArDd,SAAgB,SAAS,cAAc;AACvC,SAAS,WAAW;AACpB,SAAS,QAAQ,iBAAiB;AAClC,SAAS,sBAAsB,iBAAiB;AAChD,SAAS,uBAAuB;AAEzB,MAAM,uBAAuB,qBAAqB,kBAAkB;AAAA,EACzE,kBAAkB,WAAW,MAAM;AACjC,UAAM,cAAc,UAAU,KAAK;AAEnC,cAAU,KAAK,UAAU;AAAA,MACvB,MACE,SAAU,OAAO;AACf,cAAM,EAAE,YAAY,CAAC,GAAG,KAAK,IAAI;AACjC,cAAM;AAAA,UACJ;AAAA,UACA,OAAO,EAAE,YAAY,gBAAgB,YAAY,eAAe,QAAQ;AAAA,UACxE,MAAM,EAAE,UAAU;AAAA,UAClB;AAAA,UACA,OAAO,EAAE,QAAQ;AAAA,QACnB,IAAI,KAAK,YAAY;AAErB,cAAM,UAAU,OAAO;AACvB,cAAM,gBAAgB;AAAA,UACpB,GAAG;AAAA,UACH,KAAK,UAAU,SAAS,UAAU,GAAG;AAAA,QACvC;AACA,eACE;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA,aAAa,CAAC,EAAE,gBAAgB,OAAO;AAAA,cACrC,GAAG;AAAA;AAAA;AAAA,cAGH,MAAM,OAAO,CAAC,MAAM;AAClB,oBAAI,EAAE,SAAS;AACb,0BAAQ,QAAQ,aAAa,CAAC;AAC9B,6BAAW,MAAM,gBAAgB,KAAK,CAAC,GAAG,EAAE;AAAA,gBAC9C,OAAO;AACL,kCAAgB,KAAK,CAAC;AAAA,gBACxB;AAAA,cACF,CAAC;AAAA,cACD,KAAK,OAAO,CAAC,MAAM;AACjB,oBAAI,EAAE,SAAS;AACb,0BAAQ,QAAQ,aAAa,KAAK,SAAS,CAAC;AAC5C,6BAAW,MAAM,gBAAgB,IAAI,CAAC,GAAG,EAAE;AAAA,gBAC7C,OAAO;AACL,kCAAgB,IAAI,CAAC;AAAA,gBACvB;AAAA,cACF,CAAC;AAAA,YACH;AAAA,YACA,eAAe;AAAA,YAEf;AAAA,cAAC;AAAA;AAAA,gBACE,GAAG;AAAA,gBACJ;AAAA,gBACA;AAAA,gBACA,WAAW;AAAA,gBACX;AAAA,gBACA;AAAA,gBACA,WAAW;AAAA,gBACX;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA;AAAA,YACF;AAAA;AAAA,QACF;AAAA,MAEJ;AAAA,MACF,CAAC,IAAI,KAAK,YAAY,GAAG,aAAa,CAAC;AAAA,IACzC;AACA,WAAO;AAAA,EACT;AACF,CAAC;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/virtualization/VirtualizedBody.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/virtualization/VirtualizedBody.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable max-statements */\nimport React, { useEffect, useState, useCallback, useRef, useLayoutEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { mergeRefs, debounce, isNaN } from '@elliemae/ds-utilities';\nimport { NoResults } from '../../components/NoResults.js';\nimport { VirtualizedBodyRow } from './VirtualizedBodyRow.js';\nimport { RowSizes } from '../../rowSizes.js';\nimport { isSafari } from './helper.js';\n\nconst wrapperSafari = {};\nconst wrapperGeneric = { overflowY: 'auto', overflowX: 'visible' };\n\nconst VirtualizedBody = (props) => {\n const {\n autoScrollToId,\n columns,\n component: Component,\n expandable,\n innerRef,\n innerBody,\n isPlaceholderActive,\n listProps,\n noResultsPlaceholder,\n overscanCount,\n rows,\n rowHeight: defaultRowHeight,\n rowKey,\n rowRenderer,\n rowSize,\n setHasScroll,\n filters, // hack to reset the scrollTop to 0 if filters change\n } = props;\n const rowHeight = defaultRowHeight || RowSizes[rowSize];\n const [scrollTop, setScrollTop] = useState(0);\n const [visibleHeight, setVisibleHeight] = useState(0);\n const [hasScrollBar, setHasScrollBar] = useState(false);\n const rowStyleCache = useRef({});\n const [renderedIndexes, setRenderedIndexes] = useState([0, 30]);\n\n const getCalculatedHeightBetweenIndexes = (start, end) => {\n const { itemSize = () => rowHeight } = listProps;\n if (expandable) {\n return rows\n .slice(start, end)\n .map((_, idx) => idx)\n .map((idx) => itemSize(idx))\n .reduce((acc, curr) => acc + curr, 0);\n }\n return (end - start) * rowHeight;\n };\n\n const generateRowPositionMap = () => rows.map((row, idx) => getCalculatedHeightBetweenIndexes(0, idx));\n\n const rowPositionMap = useRef(generateRowPositionMap());\n const [virtualizedBodyRef, setVirtualizedBodyRef] = useState(null);\n const handlerRef = useRef();\n\n const autoScrollTo = useCallback(\n (scrollHeight) => {\n const { itemSize = () => rowHeight } = listProps;\n const idx = rows.findIndex((item) => item[rowKey] === autoScrollToId);\n let val = rowPositionMap.current[idx] || 0;\n const lastPositionIdx = rowPositionMap.current.length - 1;\n let lastPosition = 0;\n if (lastPositionIdx > -1) {\n lastPosition = rowPositionMap.current[lastPositionIdx] - scrollHeight + itemSize(lastPositionIdx);\n }\n if (lastPosition < val) {\n val = lastPosition;\n }\n if (virtualizedBodyRef) {\n if (idx > -1) {\n setScrollTop(val);\n virtualizedBodyRef.scrollTop = val;\n }\n }\n },\n [rows, virtualizedBodyRef],\n );\n\n useEffect(() => {\n autoScrollTo(visibleHeight);\n }, [autoScrollToId, visibleHeight]);\n\n const handler = useCallback(\n debounce(({ target }) => {\n // Update coordinates\n setScrollTop(target.scrollTop || 0);\n }, 100),\n [setScrollTop],\n );\n\n useEffect(() => {\n setScrollTop(0);\n }, [filters]);\n\n useEffect(() => {\n handlerRef.current = handler;\n }, [handler]);\n\n useLayoutEffect(() => {\n let top = Math.ceil(scrollTop / rowHeight);\n let bot = Math.ceil((scrollTop + visibleHeight) / rowHeight);\n if (expandable) {\n // updateMapperFirst\n rowPositionMap.current = generateRowPositionMap();\n top = rowPositionMap.current.findIndex((item) => item > scrollTop);\n bot = rowPositionMap.current.findIndex((item) => item > scrollTop + visibleHeight);\n if (bot === -1) bot = rowPositionMap.current.length;\n }\n let upperBound = top - 1 - overscanCount;\n let lowerBound = bot - 1 + overscanCount;\n if (upperBound < 0) {\n upperBound = 0;\n }\n if (lowerBound - upperBound < overscanCount) {\n lowerBound = upperBound + overscanCount;\n }\n if (lowerBound > rows.length) {\n lowerBound = rows.length;\n }\n setHasScrollBar(visibleHeight < getHeight());\n setHasScroll(visibleHeight < getHeight());\n setRenderedIndexes([upperBound, lowerBound]);\n }, [visibleHeight, scrollTop, rows]);\n\n useLayoutEffect(() => {\n if (virtualizedBodyRef) {\n const parsedVisibleHeight = parseFloat(\n window.getComputedStyle(virtualizedBodyRef, null).getPropertyValue('height'),\n );\n // eslint-disable-next-line no-restricted-globals\n if (!isNaN(parsedVisibleHeight)) {\n setVisibleHeight(parsedVisibleHeight);\n autoScrollTo(parsedVisibleHeight);\n }\n }\n }, [rows, virtualizedBodyRef]);\n\n useEffect(() => {\n if (virtualizedBodyRef) {\n const eventListener = (event) => handlerRef.current(event);\n virtualizedBodyRef.addEventListener('scroll', eventListener);\n\n return () => {\n virtualizedBodyRef.removeEventListener('scroll', eventListener);\n };\n }\n return () => null;\n }, [virtualizedBodyRef]);\n\n const getHeight = () => {\n let returnHeight = 0;\n if (expandable) {\n returnHeight = getCalculatedHeightBetweenIndexes(0, rows.length) + 8;\n } else {\n returnHeight = rows.length * rowHeight + 8;\n }\n // if (visibleHeight > returnHeight) {\n // return visibleHeight;\n // }\n if (virtualizedBodyRef && virtualizedBodyRef.scrollHeight > virtualizedBodyRef.clientHeight) {\n return returnHeight + 10;\n }\n return returnHeight;\n };\n\n const getRowStyle = (row, index, specificRowHeight) => {\n const { itemSize } = listProps;\n\n if (!expandable && rowStyleCache.current[index]) {\n return rowStyleCache.current[index];\n }\n rowStyleCache.current[index] = {\n height: itemSize ? itemSize(index) : specificRowHeight,\n left: 0,\n right: 0,\n top: getCalculatedHeightBetweenIndexes(0, index),\n position: 'absolute',\n };\n return rowStyleCache.current[index];\n };\n\n const generateRenderedRows = () =>\n rows.slice(renderedIndexes[0], renderedIndexes[1] + 1).map((_, index) => (\n <VirtualizedBodyRow\n data={{\n rows,\n columns,\n rowKey,\n renderer: { rowRenderer },\n }}\n index={renderedIndexes[0] + index}\n key={rows[renderedIndexes[0] + index][rowKey]}\n style={getRowStyle(rows[renderedIndexes[0] + index], renderedIndexes[0] + index, rowHeight)}\n ></VirtualizedBodyRow>\n ));\n\n const wrapperStyle = {\n height: '100%',\n ...(isSafari ? wrapperSafari : wrapperGeneric),\n };\n const bodyStyle = {\n height: getHeight(),\n willChange: 'transform',\n backfaceVisibility: 'hidden',\n };\n\n return (\n <Component {...props} innerRef={innerRef}>\n {!isPlaceholderActive ? (\n <div\n className=\"virtualized-body-wrapper\"\n style={wrapperStyle}\n ref={(elem) => {\n if (elem) {\n if (isSafari) {\n setVirtualizedBodyRef(elem.parentElement);\n // eslint-disable-next-line no-param-reassign\n elem.parentElement.scrollTop = scrollTop;\n mergeRefs(listProps.outerRef)(elem.parentElement);\n } else {\n setVirtualizedBodyRef(elem);\n mergeRefs(listProps.outerRef)(elem);\n }\n }\n }}\n >\n <div\n data-testid=\"virtualized-body\"\n className={`virtualized-body${hasScrollBar ? ' with-scrollbar' : ''}`}\n style={bodyStyle}\n ref={(r) => {\n mergeRefs(innerBody)(r);\n }}\n >\n {generateRenderedRows()}\n </div>\n </div>\n ) : (\n <NoResults innerRef={innerRef} rowRenderer={rowRenderer}>\n {noResultsPlaceholder}\n </NoResults>\n )}\n </Component>\n );\n};\n\nVirtualizedBody.defaultProps = {\n rows: [],\n overscanCount: 10,\n};\n\nVirtualizedBody.propTypes = {\n autoScrollToId: PropTypes.number,\n columns: PropTypes.arrayOf(PropTypes.shape({})),\n component: PropTypes.element,\n expandable: PropTypes.bool,\n filters: PropTypes.any,\n innerRef: PropTypes.any,\n innerBody: PropTypes.any,\n isPlaceholderActive: PropTypes.bool,\n listProps: PropTypes.shape({\n itemSize: PropTypes.func,\n outerRef: PropTypes.any,\n }),\n noResultsPlaceholder: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n overscanCount: PropTypes.number,\n rows: PropTypes.arrayOf(PropTypes.shape({})),\n rowHeight: PropTypes.number,\n rowKey: PropTypes.string,\n rowRenderer: PropTypes.element,\n rowSize: PropTypes.any,\n setHasScroll: PropTypes.func,\n};\n\nexport { VirtualizedBody };\nexport default VirtualizedBody;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;AC0LjB;AAxLN,SAAgB,WAAW,UAAU,aAAa,QAAQ,uBAAuB;AACjF,OAAO,eAAe;AACtB,SAAS,WAAW,UAAU,aAAa;AAC3C,SAAS,iBAAiB;AAC1B,SAAS,0BAA0B;AACnC,SAAS,gBAAgB;AACzB,SAAS,gBAAgB;AAEzB,MAAM,gBAAgB,CAAC;AACvB,MAAM,iBAAiB,EAAE,WAAW,QAAQ,WAAW,UAAU;AAEjE,MAAM,kBAAkB,CAAC,UAAU;AACjC,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,EACF,IAAI;AACJ,QAAM,YAAY,oBAAoB,SAAS,OAAO;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gB,eAAe;AAAA,EAC7B,MAAM,CAAC;AAAA,EACP,eAAe;AACjB;AAEA,gBAAgB,YAAY;AAAA,EAC1B,gBAAgB,UAAU;AAAA,EAC1B,SAAS,UAAU,QAAQ,UAAU,MAAM,CAAC,CAAC,CAAC;AAAA,EAC9C,WAAW,UAAU;AAAA,EACrB,YAAY,UAAU;AAAA,EACtB,SAAS,UAAU;AAAA,EACnB,UAAU,UAAU;AAAA,EACpB,WAAW,UAAU;AAAA,EACrB,qBAAqB,UAAU;AAAA,EAC/B,WAAW,UAAU,MAAM;AAAA,IACzB,UAAU,UAAU;AAAA,IACpB,UAAU,UAAU;AAAA,EACtB,CAAC;AAAA,EACD,sBAAsB,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,OAAO,CAAC;AAAA,EAC/E,eAAe,UAAU;AAAA,EACzB,MAAM,UAAU,QAAQ,UAAU,MAAM,CAAC,CAAC,CAAC;AAAA,EAC3C,WAAW,UAAU;AAAA,EACrB,QAAQ,UAAU;AAAA,EAClB,aAAa,UAAU;AAAA,EACvB,SAAS,UAAU;AAAA,EACnB,cAAc,UAAU;AAC1B;AAGA,IAAO,0BAAQ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/virtualization/VirtualizedBodyRow.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/virtualization/VirtualizedBodyRow.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const VirtualizedBodyRow = ({ data, index, style, key, isScrolling }) => {\n const {\n rows,\n renderer: { rowRenderer },\n } = data;\n const rowData = rows[index];\n\n return rowRenderer(\n rowData,\n {\n style,\n index,\n rowIndex: index,\n key,\n },\n {\n // eslint-disable-next-line no-underscore-dangle\n rowIndex: index,\n isScrolling,\n },\n );\n};\n\nexport default VirtualizedBodyRow;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,qBAAqB,CAAC,EAAE,MAAM,OAAO,OAAO,KAAK,YAAY,MAAM;AAC9E,QAAM;AAAA,IACJ;AAAA,IACA,UAAU,EAAE,YAAY;AAAA,EAC1B,IAAI;AACJ,QAAM,UAAU,KAAK,KAAK;AAE1B,SAAO;AAAA,IACL;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA,UAAU;AAAA,MACV;AAAA,IACF;AAAA,IACA;AAAA;AAAA,MAEE,UAAU;AAAA,MACV;AAAA,IACF;AAAA,EACF;AACF;AAEA,IAAO,6BAAQ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/virtualization/helper.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/virtualization/helper.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const isSafari =\n navigator.vendor &&\n navigator.vendor.indexOf('Apple') > -1 &&\n navigator.userAgent &&\n navigator.userAgent.indexOf('CriOS') === -1 &&\n navigator.userAgent.indexOf('FxiOS') === -1;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,WACX,UAAU,UACV,UAAU,OAAO,QAAQ,OAAO,IAAI,MACpC,UAAU,aACV,UAAU,UAAU,QAAQ,OAAO,MAAM,MACzC,UAAU,UAAU,QAAQ,OAAO,MAAM;",
6
6
  "names": []