@elliemae/ds-datagrids 3.22.0-next.6 → 3.22.0-rc.0

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 +27 -26
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/editable/decorateEditable.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/editable/decorateEditable.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport * as edit from 'react-edit';\nimport { EditPencil } from '@elliemae/ds-icons';\nimport { cx } from '@elliemae/ds-utilities';\nimport { appendCellFormatter } from '@elliemae/ds-shared';\nimport { getEditorComponent } from './getEditorComponent.js';\n\nconst makeEditableConfig = (grid) =>\n edit.edit({\n isEditing: ({ columnIndex, rowData, column = {}, ...rest }) => {\n const {\n state: { editingRows },\n props: { rowKey },\n } = grid.getInstance();\n let isCustomEditing;\n\n if (typeof column.isEditing === 'function') {\n isCustomEditing = column.isEditing({\n columnIndex,\n rowData,\n column,\n ...rest,\n });\n }\n return editingRows[rowData[rowKey]] === columnIndex || column.alwaysEditing || isCustomEditing;\n },\n onActivate: () => null,\n onValue: (...args) => grid.getInstance().actions.editValue(...args),\n });\nconst addEditableToCell = ({ column, config, handlers }, grid) => {\n column.cell.transforms.push(config(getEditorComponent(column.customEditor, handlers)));\n column.cell.props.className = cx(\n column.cell.props.className,\n `editable${column.customEditor ? ' customEditor' : ''}`,\n );\n return appendCellFormatter(\n [\n (value, extraParams) => (\n <>\n <div\n onClick={(e) => {\n e.stopPropagation();\n grid.getInstance().actions.activateEdit(extraParams);\n }}\n onKeyUp={(e) => {\n e.stopPropagation();\n if (e.keyCode === 33) {\n grid.getInstance().actions.activateEdit(extraParams);\n }\n }}\n role=\"gridcell\"\n tabIndex={0}\n >\n {value}\n <EditPencil className=\"edit-pencil\" />\n <span className=\"edit-separator\"> </span>\n </div>\n </>\n ),\n ],\n column,\n );\n};\n\nexport { makeEditableConfig, addEditableToCell };\n"],
5
5
  "mappings": "AAAA,YAAY,WA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AQ,aAAa,WAAW;AAAA,YACrD;AAAA,UACF;AAAA,UACA,MAAK;AAAA,UACL,UAAU;AAAA,UAET;AAAA;AAAA,YACD,oBAAC,cAAW,WAAU,eAAc;AAAA,YACpC,oBAAC,UAAK,WAAU,kBAAiB,eAAC;AAAA;AAAA;AAAA,MACpC,GACF;AAAA,IAEJ;AAAA,IACA;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/editable/getEditorComponent.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/editable/getEditorComponent.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/display-name */\nimport React from 'react';\nimport { ComboBox, TextBox } from './EditableComponents/index.js';\n\nconst components = {\n DSComboBox: ComboBox,\n DSTextBox: TextBox,\n};\n\nconst getEditorComponent =\n (editorComponent = {}, handlers) =>\n ({ value, onValue, extraParameters }) => {\n if (typeof editorComponent === 'function') {\n return editorComponent({\n value,\n onValue,\n customHandlers: handlers,\n ...extraParameters,\n });\n }\n\n const { type = 'DSTextBox', ...restEditorProps } = editorComponent;\n const Component = components[type];\n\n if (type === 'DSComboBox') {\n // TODO: remove this whole condition when combobox v3 is out and fully working without \"maxOptions\" parameter\n const maxOptions = restEditorProps?.options?.length || 100;\n return (\n <div style={{ zIndex: 0 }}>\n <Component autoFocus onValue={onValue} value={value} maxOptions={maxOptions} {...restEditorProps} />\n </div>\n );\n }\n\n return <Component autoFocus onValue={onValue} value={value} {...restEditorProps} />;\n };\n\nexport { getEditorComponent };\nexport default getEditorComponent;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;AC6BX;AA3BZ,SAAS,UAAU,eAAe;AAElC,MAAM,aAAa;AAAA,EACjB,YAAY;AAAA,EACZ,WAAW;AACb;AAEA,MAAM,qBACJ,CAAC,kBAAkB,CAAC,GAAG,aACrB,CAAC,EAAE,OAAO,SAAS,gBAAgB,MAAM;AACvC,MAAI,OAAO,oBAAoB,YAAY;AACzC,WAAO,gBAAgB;AAAA,MACrB;AAAA,MACA;AAAA,MACA,gBAAgB;AAAA,MAChB,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAEA,QAAM,EAAE,OAAO,aAAa,GAAG,gBAAgB,IAAI;AACnD,QAAM,YAAY,WAAW,IAAI;AAEjC,MAAI,SAAS,cAAc;AAEzB,UAAM,aAAa,iBAAiB,SAAS,UAAU;AACvD,WACE,oBAAC,SAAI,OAAO,EAAE,QAAQ,EAAE,GACtB,8BAAC,aAAU,WAAS,MAAC,SAAkB,OAAc,YAAyB,GAAG,iBAAiB,GACpG;AAAA,EAEJ;AAEA,SAAO,oBAAC,aAAU,WAAS,MAAC,SAAkB,OAAe,GAAG,iBAAiB;AACnF;AAGJ,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/editable/index.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/editable/index.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { EditablePlugin } from './EditablePlugin.js';\nexport { ComboBox, TextBox } from './EditableComponents/index.js';\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sBAAsB;AAC/B,SAAS,UAAU,eAAe;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/expandable-grid/ExpandableColumn.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/expandable-grid/ExpandableColumn.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/display-name */\nimport React, { useRef } from 'react';\nimport { ArrowheadDown, ArrowheadRight } from '@elliemae/ds-icons';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { DSButton } from '@elliemae/ds-button';\nimport { DSTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { dataGridBlockName } from '../../blockNames.js';\nimport { RowSizes } from '../../rowSizes.js';\n\nconst blockName = `${dataGridBlockName}-expandable-column`;\n\n// todo: clean this when we move to css-js\nconst ExpandableColumnWrapper = aggregatedClasses('div')(blockName);\nconst LabelDescriptionWrapper = aggregatedClasses('div')(blockName, 'label-description-wrapper');\nconst Label = aggregatedClasses('span')(blockName, 'label');\nconst Description = aggregatedClasses('span')(blockName, 'description');\nconst ExtraColumnData = aggregatedClasses('div')(blockName, 'extra-column-data');\nconst ExpandableMasterWrapper = aggregatedClasses('div')(`${blockName}-master-wrapper`);\nconst ExpandableDetailsWrapper = aggregatedClasses('div')(`${blockName}-details-wrapper`);\n\nconst ExpandableColumnCell = ({ label, description, isExpanded, expandableDetails, extraData, onToggleExpand }) => {\n const ref = useRef();\n return (\n <ExpandableColumnWrapper ref={ref} tabindex={0}>\n <ExpandableMasterWrapper style={{ height: RowSizes.extend }}>\n <DSButton\n buttonType=\"text\"\n className=\"expandable-arrow\"\n icon={isExpanded ? <ArrowheadDown /> : <ArrowheadRight />}\n onClick={(e) => {\n onToggleExpand(e);\n if (ref && ref.current) {\n ref.current.focus();\n }\n }}\n size=\"s\"\n />\n <LabelDescriptionWrapper>\n <Label>\n <DSTruncatedTooltipText value={label} />\n </Label>\n <Description>\n <DSTruncatedTooltipText value={description} />\n </Description>\n </LabelDescriptionWrapper>\n <ExtraColumnData>{extraData}</ExtraColumnData>\n </ExpandableMasterWrapper>\n {isExpanded && <ExpandableDetailsWrapper>{expandableDetails}</ExpandableDetailsWrapper>}\n </ExpandableColumnWrapper>\n );\n};\n\nconst expandableColumnRenderer =\n ({ renderRowLabel, renderRowDescription, renderExtraData }) =>\n (value, { rowData, isExpanded }, grid) => {\n const {\n props: { renderExpandedDetails },\n actions: { toggleExpand },\n } = grid.getInstance();\n\n const expandableDetails = renderExpandedDetails({ rowData });\n return (\n <ExpandableColumnCell\n description={renderRowDescription({ rowData })}\n expandableDetails={expandableDetails}\n extraData={renderExtraData({ rowData })}\n isExpanded={isExpanded}\n label={renderRowLabel({ rowData })}\n onToggleExpand={() => toggleExpand(rowData)}\n />\n );\n };\nconst noop = () => null;\nexport const ExpandableColumn = ({\n property,\n label,\n renderRowLabel = () => '----',\n renderRowDescription = noop,\n renderExtraData = noop,\n width,\n resizable,\n sortable,\n searchable,\n customRenderer,\n ...rest\n}) => ({\n ...rest,\n label,\n property,\n cell: {\n formatters: [\n expandableColumnRenderer({\n renderRowLabel,\n renderRowDescription,\n renderExtraData,\n }),\n ],\n },\n width: width || '50%',\n expandableColumn: true,\n resizable,\n sortable,\n searchable,\n});\n\nexport default ExpandableColumn;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;AC4BM,cASrB,YATqB;AA3B7B,SAAgB,cAAc;AAC9B,SAAS,eAAe,sBAAsB;AAC9C,SAAS,yBAAyB;AAClC,SAAS,gBAAgB;AACzB,SAAS,8BAA8B;AACvC,SAAS,yBAAyB;AAClC,SAAS,gBAAgB;AAEzB,MAAM,YAAY,GAAG;AAGrB,MAAM,0BAA0B,kBAAkB,KAAK,EAAE,SAAS;AAClE,MAAM,0BAA0B,kBAAkB,KAAK,EAAE,WAAW,2BAA2B;AAC/F,MAAM,QAAQ,kBAAkB,MAAM,EAAE,WAAW,OAAO;AAC1D,MAAM,cAAc,kBAAkB,MAAM,EAAE,WAAW,aAAa;AACtE,MAAM,kBAAkB,kBAAkB,KAAK,EAAE,WAAW,mBAAmB;AAC/E,MAAM,0BAA0B,kBAAkB,KAAK,EAAE,GAAG,0BAA0B;AACtF,MAAM,2BAA2B,kBAAkB,KAAK,EAAE,GAAG,2BAA2B;AAExF,MAAM,uBAAuB,CAAC,EAAE,OAAO,aAAa,YAAY,mBAAmB,WA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AC;AAAA,EAC/B;AAAA,EACA;AAAA,EACA,iBAAiB,MAAM;AAAA,EACvB,uBAAuB;AAAA,EACvB,kBAAkB;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,OAAO;AAAA,EACL,GAAG;AAAA,EACH;AAAA,EACA;AAAA,EACA,MAAM;AAAA,IACJ,YAAY;AAAA,MACV,yBAAyB;AAAA,QACvB;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EACA,OAAO,SAAS;AAAA,EAChB,kBAAkB;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AACF;AAEA,IAAO,2BAAQ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/expandable-grid/ExpandablePlugin.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/expandable-grid/ExpandablePlugin.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useEffect, useMemo, useRef } from 'react';\nimport { cx, isFunction } from '@elliemae/ds-utilities';\nimport { VariableSizeList } from 'react-window';\nimport { ArrowheadDown, ArrowheadRight } from '@elliemae/ds-icons';\nimport { DSButton } from '@elliemae/ds-button';\nimport { createInstancePlugin, appendCellFormatter } from '@elliemae/ds-shared';\nimport { ExpandedRow } from './ExpandedRow.js';\nimport { ExpandedRowExtra } from './ExpandedRowExtra.js';\nimport { RowSizes } from '../../rowSizes.js';\nimport { useExpandGridState } from './useExpandGridState.js';\n\nconst getExpandedRowSizeBySubrows = ({ totalAmount, amountVisible, isShowingAll, size = 36 }) =>\n isShowingAll ? size * (totalAmount + 1) - 6 : size * (amountVisible + 1) + 32;\n\nconst ExpandedRows = {\n SingleColumn: ExpandedRow,\n Master: ExpandedRowExtra,\n};\n\nconst createExpandedRow = (type) => ExpandedRows[type] || ExpandedRows.Master;\n\nconst isExpandableSingleColumn = (columns) => columns.some((column) => column.expandableColumn);\n\nexport const ExpandablePlugin = createInstancePlugin('expandable', {\n registerStateHook: useExpandGridState,\n decorateGrid(grid) {\n const { decoratedColumns, columns } = grid.getInstance();\n const detailColumns = useMemo(\n () =>\n decoratedColumns\n .map((column) => ({\n ...column,\n customRenderer: column.detailCustomRenderer,\n }))\n .filter((col) => !col.expandableColumn),\n [columns],\n );\n return {\n detailColumns,\n };\n },\n\n decorateColumns(columns, grid) {\n if (isExpandableSingleColumn(columns)) return columns;\n // get first column from user\n const firstColumnIndex = columns.findIndex((column) => column.isUserColumn);\n const firstColumn = columns[firstColumnIndex];\n firstColumn.formatExpandable = true;\n\n return [\n ...columns.slice(0, firstColumnIndex),\n appendCellFormatter((value, { isExpanded, rowData }) => {\n const {\n actions: { toggleExpand },\n } = grid.getInstance();\n /*\n * should return only 2 elements ../custom-cell-renderer/addCustomRendererToCell.js\n * getRenderer it's checking that length to apply the custom render to value only\n */\n return (\n <>\n <DSButton\n buttonType=\"text\"\n className=\"expandable-arrow\"\n icon={isExpanded ? <ArrowheadDown /> : <ArrowheadRight />}\n onClick={(e) => {\n e.stopPropagation();\n toggleExpand(rowData);\n }}\n size=\"s\"\n />\n {value}\n </>\n );\n }, firstColumn),\n ...columns.slice(firstColumnIndex + 1),\n ];\n },\n\n getBodyProps(bodyProps, grid) {\n const {\n composedRows: rows,\n props: {\n rowKey,\n getChildrenRows,\n rowSize = 'normal',\n subrowSize = 'normal',\n getExpandedRowMinSize,\n getExpandedRowSize,\n expandableSubrowsVisible,\n },\n state: { expandedRows },\n } = grid.getInstance();\n const rowSizePx = RowSizes[rowSize];\n const subrowSizePx = RowSizes[subrowSize];\n const listRef = useRef();\n\n useEffect(() => {\n if (listRef.current) listRef.current.resetAfterIndex(0, true);\n });\n\n // implementation of expandable row single column with aggregation\n const getItemSize = (index) => {\n const rowData = rows[index];\n const key = rowData[rowKey];\n const children = getChildrenRows({ rowData });\n\n const expandedSize = getExpandedRowSize\n ? getExpandedRowSize(index, { rowData }) // https://jira.elliemae.io/browse/PUI-1659\n : getExpandedRowSizeBySubrows({\n totalAmount: children.length,\n amountVisible: children.length > expandableSubrowsVisible ? expandableSubrowsVisible : children.length,\n isShowingAll:\n children.length < expandableSubrowsVisible || (expandedRows[key] && expandedRows[key].showAllRows),\n size: subrowSizePx,\n });\n\n const expandedMinSize = isFunction(getExpandedRowMinSize) && getExpandedRowMinSize(index);\n\n // eslint-disable-next-line no-nested-ternary\n return expandedRows[key] ? (expandedMinSize > expandedSize ? expandedMinSize : expandedSize) : rowSizePx;\n };\n\n return {\n ...bodyProps,\n className: cx(bodyProps.className, 'expandable'),\n listComponent: VariableSizeList,\n listProps: { ref: listRef, itemSize: getItemSize },\n };\n },\n\n decorateRenderers(renderers, grid) {\n const Row = renderers.body.row;\n const Cell = renderers.body.cell;\n\n // eslint-disable-next-line react/display-name\n renderers.body.row = useMemo(() => {\n // todo: the expandable grid should be created from another specific grid component\n const expandedRowType = isExpandableSingleColumn(grid.decoratedColumns) ? 'SingleColumn' : 'Master';\n const ExpandedRowComponent = createExpandedRow(expandedRowType);\n // eslint-disable-next-line react/display-name\n return function ({ isExpanded, ...rowProps }) {\n if (isExpanded) {\n const {\n props: { detailColumns, getChildrenRows, renderRowDetails },\n composedRows,\n } = grid.getInstance();\n // https://jira.elliemae.io/browse/PUI-1667\n const rowData = composedRows[rowProps.index] ? composedRows[rowProps.index] : rowProps.rowData;\n return (\n <ExpandedRowComponent\n cellComponent={Cell}\n detailColumns={detailColumns}\n parentGrid={grid}\n renderRowDetails={renderRowDetails}\n rowComponent={Row}\n rowData={rowData}\n rowProps={{\n rowData,\n isExpanded,\n ...rowProps,\n }}\n rows={getChildrenRows({ rowData })}\n >\n {rowProps.children}\n </ExpandedRowComponent>\n );\n }\n return <Row {...rowProps} />;\n };\n }, []);\n\n return renderers;\n },\n\n getRowProps(rowProps, grid, { rowData }) {\n const {\n props: { rowKey },\n state: { expandedRows },\n } = grid.getInstance();\n const key = rowData[rowKey];\n const isExpanded = !!expandedRows[key];\n return {\n ...rowProps,\n className: cx(\n rowProps.className,\n Object.keys(expandedRows).length > 0 && 'expandable-row',\n isExpanded && 'expanded',\n ),\n isExpanded,\n showAllRows: expandedRows[key] && expandedRows[key].showAllRows,\n };\n },\n});\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;AC6Db,mBAIuB,KAJvB;AA5DV,SAAgB,WAAW,SAAS,cAAc;AAClD,SAAS,IAAI,kBAAkB;AAC/B,SAAS,wBAAwB;AACjC,SAAS,eAAe,sBAAsB;AAC9C,SAAS,gBAAgB;AACzB,SAAS,sBAAsB,2BAA2B;AAC1D,SAAS,mBAAmB;AAC5B,SAAS,wBAAwB;AACjC,SAAS,gBAAgB;AACzB,SAAS,0BAA0B;AAEnC,MAAM,8BAA8B,CAAC,EAAE,aAAa,eAAe,cAAc,OAAO,GAAG,MACzF,eAAe,QAAQ,cAAc,KAAK,IAAI,QAAQ,gBAAgB,KAAK;AAE7E,MAAM,eAAe;AAAA,EACnB,cAAc;AAAA,EACd,QAAQ;AACV;AAEA,MAAM,oBAAoB,CAAC,SAAS,aAAa,IAAI,KAAK,aAAa;AAEvE,MAAM,2BAA2B,CAAC,YAAY,QAAQ,KAAK,CAAC,WAAW,OAAO,gBAAgB;AAEvF,MAAM,mBAAmB,qBAAqB,cAAc;AAAA,EACjE,mBAAmB;AAAA,EACnB,aAAa,MAAM;AACjB,UAAM,EAAE,kBAAkB,QAAQ,IAAI,KAAK,YAAY;AACvD,UAAM,gBAAgB;AAAA,MACpB,MACE,iBACG,IAAI,CAAC,YAAY;AAAA,QAChB,GAAG;AAAA,QACH,gBAAgB,OAAO;AAAA,MACzB,EAAE,EACD,OAAO,CAAC,QAAQ,CAAC,IAAI,gBAAgB;AAAA,MAC1C,CAAC,OAAO;AAAA,IACV;AACA,WAAO;AAAA,MACL;AAAA,IACF;AAAA,EACF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AAAA,gBACA;AAAA,gBACA,GAAG;AAAA,cACL;AAAA,cACA,MAAM,gBAAgB,EAAE,QAAQ,CAAC;AAAA,cAEhC,mBAAS;AAAA;AAAA,UACZ;AAAA,QAEJ;AACA,eAAO,oBAAC,OAAK,GAAG,UAAU;AAAA,MAC5B;AAAA,IACF,GAAG,CAAC,CAAC;AAEL,WAAO;AAAA,EACT;AAAA,EAEA,YAAY,UAAU,MAAM,EAAE,QAAQ,GAAG;AACvC,UAAM;AAAA,MACJ,OAAO,EAAE,OAAO;AAAA,MAChB,OAAO,EAAE,aAAa;AAAA,IACxB,IAAI,KAAK,YAAY;AACrB,UAAM,MAAM,QAAQ,MAAM;AAC1B,UAAM,aAAa,CAAC,CAAC,aAAa,GAAG;AACrC,WAAO;AAAA,MACL,GAAG;AAAA,MACH,WAAW;AAAA,QACT,SAAS;AAAA,QACT,OAAO,KAAK,YAAY,EAAE,SAAS,KAAK;AAAA,QACxC,cAAc;AAAA,MAChB;AAAA,MACA;AAAA,MACA,aAAa,aAAa,GAAG,KAAK,aAAa,GAAG,EAAE;AAAA,IACtD;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/expandable-grid/ExpandedRow.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/expandable-grid/ExpandedRow.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\n/* eslint-disable max-lines */\nimport React from 'react';\nimport { DSSeparator } from '@elliemae/ds-separator';\nimport { DSButton } from '@elliemae/ds-button';\nimport { styled } from '@elliemae/ds-system';\nimport { get } from '@elliemae/ds-utilities';\nimport { deferComponentRender, useDataGrid } from '@elliemae/ds-shared';\nimport { PaginationPlugin } from '../pagination/index.js';\nimport { BodyCell } from '../../components/BodyCell.js';\nimport { defaultRenderers } from '../../components/renderers/index.js';\nimport { TableBody } from '../../components/TableBody.js';\nimport { Table } from '../../components/Table.js';\nimport { ColumnSizingPlugin } from '../column-sizing/index.js';\n\nconst DetailGrid = deferComponentRender(({ parentGrid, parentRowData, rows }) => {\n const { instanceRef, ...parentProps } = parentGrid.props;\n const grid = useDataGrid({\n uuid: parentGrid.getInstance().uuid,\n ...parentProps,\n columns: parentGrid\n .getInstance()\n .decoratedColumns.filter((col) => !col.expandableColumn)\n .map((c) => ({ ...c, expandableColumn: false })),\n rows,\n plugins: [ColumnSizingPlugin, PaginationPlugin],\n renderers: defaultRenderers,\n bindColumnsSizeTo: parentGrid.uuid,\n numRowsVisible: 'all',\n paginated: true,\n pagination: {\n perPage: rows.length,\n conditionalPagination: true,\n },\n parentRowData,\n });\n\n return (\n <Table {...grid}>\n <TableBody />\n </Table>\n );\n}, null);\n\nconst DetailsWrapper = styled.span`\n flex: 1;\n width: ${(props) => props.width}px;\n`;\n\nconst DetailGridWrapper = styled.div`\n display: flex;\n height: calc(100% - ${(props) => (props.allRowsVisible ? 18 : 60)}px);\n width: ${(props) => props.expandableGridDetailWidth}px;\n margin: 12px 0;\n`;\n\nconst ExpandedRow = ({\n parentGrid,\n detailColumns,\n rowData,\n rows,\n rowProps,\n cellComponent: CellComponent,\n rowComponent: RowComponent,\n}) => {\n const {\n decoratedColumns,\n actions: { toggleShowAllRows },\n state: { expandedRows },\n props: {\n rowKey,\n showMoreRowsText = 'SHOW ALL ROWS',\n showLessRowsText = 'SHOW LESS ROWS',\n expandableSubrowsVisible,\n },\n columnSizeService: { expandableGridDetailWidth },\n } = parentGrid.getInstance();\n\n const { showAllRows, ...restRowProps } = rowProps;\n return (\n <RowComponent {...restRowProps}>\n <BodyCell\n column={decoratedColumns[0]}\n columnIndex={0}\n component={CellComponent}\n grid={parentGrid}\n rowProps={{ rowData, ...rowProps }}\n />\n <DetailsWrapper width={expandableGridDetailWidth}>\n <DetailGridWrapper\n allRowsVisible={rows.length < expandableSubrowsVisible || get(expandedRows, [rowKey, 'showAllRows'])}\n expandableGridDetailWidth={expandableGridDetailWidth}\n >\n <DSSeparator dashed orientation=\"vertical\" />\n <DetailGrid\n detailColumns={detailColumns}\n parentGrid={parentGrid.getInstance()}\n parentRowData={rowData}\n rows={showAllRows ? rows : (rows || []).slice(0, expandableSubrowsVisible)}\n />\n </DetailGridWrapper>\n {rows.length > expandableSubrowsVisible && (\n <DSButton\n buttonType=\"text\"\n labelText={showAllRows ? showLessRowsText : showMoreRowsText}\n onClick={(e) => {\n e.stopPropagation();\n toggleShowAllRows(rowData);\n }}\n style={{ marginBottom: '10px' }}\n />\n )}\n </DetailsWrapper>\n </RowComponent>\n );\n};\n\nexport { ExpandedRow };\nexport default ExpandedRow;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACuCjB,cAkDE,YAlDF;AApCN,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AACzB,SAAS,cAAc;AACvB,SAAS,WAAW;AACpB,SAAS,sBAAsB,mBAAmB;AAClD,SAAS,wBAAwB;AACjC,SAAS,gBAAgB;AACzB,SAAS,wBAAwB;AACjC,SAAS,iBAAiB;AAC1B,SAAS,aAAa;AACtB,SAAS,0BAA0B;AAEnC,MAAM,aAAa,qBAAqB,CAAC,EAAE,YAAY,eAAe,KAAK,MAAM;AAC/E,QAAM,EAAE,aAAa,GAAG,YAAY,IAAI,WAAW;AACnD,QAAM,OAAO,YAAY;AAAA,IACvB,MAAM,WAAW,YAAY,EAAE;AAAA,IAC/B,GAAG;AAAA,IACH,SAAS,WACN,YAAY,EACZ,iBAAiB,OAAO,CAAC,QAAQ,CAAC,IAAI,gBAAgB,EACtD,IAAI,CAAC,OAAO,EAAE,GAAG,GAAG,kBAAkB,MAAM,EAAE;AAAA,IACjD;AAAA,IACA,SAAS,CAAC,oBAAoB,gBAAgB;AAAA,IAC9C,WAAW;AAAA,IACX,mBAAmB,WAAW;AAAA,IAC9B,gBAAgB;AAAA,IAChB,WAAW;AAAA,IACX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AY,WAAW,YAAY;AAAA,gBACnC,eAAe;AAAA,gBACf,MAAM,cAAc,QAAQ,QAAQ,CAAC,GAAG,MAAM,GAAG,wBAAwB;AAAA;AAAA,YAC3E;AAAA;AAAA;AAAA,MACF;AAAA,MACC,KAAK,SAAS,4BACb;AAAA,QAAC;AAAA;AAAA,UACC,YAAW;AAAA,UACX,WAAW,cAAc,mBAAmB;AAAA,UAC5C,SAAS,CAAC,MAAM;AACd,cAAE,gBAAgB;AAClB,8BAAkB,OAAO;AAAA,UAC3B;AAAA,UACA,OAAO,EAAE,cAAc,OAAO;AAAA;AAAA,MAChC;AAAA,OAEJ;AAAA,KACF;AAEJ;AAGA,IAAO,sBAAQ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/expandable-grid/ExpandedRowExtra.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/expandable-grid/ExpandedRowExtra.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { cx } from '@elliemae/ds-utilities';\nimport { DSSeparator } from '@elliemae/ds-separator';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { dataGridBlockName } from '../../blockNames.js';\n\nconst blockName = `${dataGridBlockName}-expanded-row`;\n\nconst DetailsWrapper = aggregatedClasses('div')(`${blockName}-details-wrapper`, null, () => ({\n 'ie-flex-basis-auto': true,\n}));\n\nconst ExpandedRowExtra = ({\n children,\n rowData,\n rowProps,\n rowComponent: RowComponent,\n renderRowDetails = () => null,\n}) => (\n <RowComponent {...rowProps} className={cx(rowProps.className, 'expanded-detail-row')}>\n <RowComponent className=\"master-row-expanded\">{children}</RowComponent>\n <DSSeparator dashed margin=\"xs\" />\n <DetailsWrapper>{renderRowDetails({ rowData })}</DetailsWrapper>\n </RowComponent>\n);\n\nexport { ExpandedRowExtra };\nexport default ExpandedRowExtra;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACmBrB,SACE,KADF;AAlBF,SAAS,UAAU;AACnB,SAAS,mBAAmB;AAC5B,SAAS,yBAAyB;AAClC,SAAS,yBAAyB;AAElC,MAAM,YAAY,GAAG;AAErB,MAAM,iBAAiB,kBAAkB,KAAK,EAAE,GAAG,6BAA6B,MAAM,OAAO;AAAA,EAC3F,sBAAsB;AACxB,EAAE;AAEF,MAAM,mBAAmB,CAAC;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,mBAAmB,MAAM;AAC3B,MACE,qBAAC,gBAAc,GAAG,UAAU,WAAW,GAAG,SAAS,WAAW,qBAAqB,GACjF;AAAA,sBAAC,gBAAa,WAAU,uBAAuB,UAAS;AAAA,EACxD,oBAAC,eAAY,QAAM,MAAC,QAAO,MAAK;AAAA,EAChC,oBAAC,kBAAgB,2BAAiB,EAAE,QAAQ,CAAC,GAAE;AAAA,GACjD;AAIF,IAAO,2BAAQ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/expandable-grid/index.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/expandable-grid/index.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { ExpandablePlugin } from './ExpandablePlugin.js';\nexport { ExpandableColumn } from './ExpandableColumn.js';\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,wBAAwB;AACjC,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/expandable-grid/useExpandGridState.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/expandable-grid/useExpandGridState.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { isFunction, useExpandState } from '@elliemae/ds-utilities';\nimport { useState } from 'react';\n\nexport const useExpandGridState = (grid) => {\n const {\n composedRows,\n props: {\n expandedRows: expandedRowsProp = {},\n rowKey = 'id',\n onExpandRow,\n onToggleShowAllRows,\n onExpandChange,\n onExpandAll,\n onToggleExpand,\n onCollapseRow,\n },\n } = grid;\n\n const { state, actions } = useExpandState({\n items: composedRows,\n itemKey: rowKey,\n expanded: expandedRowsProp,\n onExpand: onExpandRow,\n onExpandChange,\n onExpandAll,\n onToggleExpand,\n onCollapse: onCollapseRow,\n });\n\n const [shouldRefocus, setShouldReFocus] = useState(false);\n const expandRow = (row) => actions.expand(row, { showAllRows: false });\n\n const toggleExpandAllRows = actions.toggleExpandAll;\n\n const collapseRow = actions.collapse;\n\n const toggleExpand = (row) => {\n setShouldReFocus(false);\n actions.toggleExpand(row, { showAllRows: false });\n };\n\n const toggleShowAllRows = (row) => {\n if (isFunction(onToggleShowAllRows)) {\n onToggleShowAllRows(row);\n } else {\n const key = row[rowKey];\n actions.expand(row, {\n showAllRows: state.expanded[key] && !state.expanded[key].showAllRows,\n });\n }\n };\n\n return {\n state: {\n expandedRows: state.expanded,\n isExpandedAll: state.isExpandedAll,\n shouldRefocus,\n },\n actions: {\n expandRow,\n toggleExpandAllRows,\n toggleExpand,\n toggleShowAllRows,\n collapseRow,\n },\n };\n};\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,YAAY,sBAAsB;AAC3C,SAAS,gBAAgB;AAElB,MAAM,qBAAqB,CAAC,SAAS;AAC1C,QAAM;AAAA,IACJ;AAAA,IACA,OAAO;AAAA,MACL,cAAc,mBAAmB,CAAC;AAAA,MAClC,SAAS;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF,IAAI;AAEJ,QAAM,EAAE,OAAO,QAAQ,IAAI,eAAe;AAAA,IACxC,OAAO;AAAA,IACP,SAAS;AAAA,IACT,UAAU;AAAA,IACV,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY;AAAA,EACd,CAAC;AAED,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAS,KAAK;AACxD,QAAM,YAAY,CAAC,QAAQ,QAAQ,OAAO,KAAK,EAAE,aAAa,MAAM,CAAC;AAErE,QAAM,sBAAsB,QAAQ;AAEpC,QAAM,cAAc,QAAQ;AAE5B,QAAM,eAAe,CAAC,QAAQ;AAC5B,qBAAiB,KAAK;AACtB,YAAQ,aAAa,KAAK,EAAE,aAAa,MAAM,CAAC;AAAA,EAClD;AAEA,QAAM,oBAAoB,CAAC,QAAQ;AACjC,QAAI,WAAW,mBAAmB,GAAG;AACnC,0BAAoB,GAAG;AAAA,IACzB,OAAO;AACL,YAAM,MAAM,IAAI,MAAM;AACtB,cAAQ,OAAO,KAAK;AAAA,QAClB,aAAa,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,SAAS,GAAG,EAAE;AAAA,MAC3D,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO;AAAA,IACL,OAAO;AAAA,MACL,cAAc,MAAM;AAAA,MACpB,eAAe,MAAM;AAAA,MACrB;AAAA,IACF;AAAA,IACA,SAAS;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,MACA;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/export-data/ExportDataPlugin.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/export-data/ExportDataPlugin.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable indent */\nimport { get } from '@elliemae/ds-utilities';\nimport { createInstancePlugin } from '@elliemae/ds-shared';\n\nconst isVisible = (column) => {\n if (typeof column === 'undefined') {\n return false;\n }\n return typeof column.visible === 'undefined' || column.visible;\n};\n\nexport const getColumnValue = (row, property) => get(row, property);\nexport const getVisibleRowData = (row, columns) =>\n columns.reduce((result, column) => {\n const columnProperty = column.property;\n return isVisible(column)\n ? [...result, getColumnValue(row, `_${columnProperty}`) || getColumnValue(row, columnProperty)]\n : result;\n }, []);\n\nconst defaultOptions = (uuid) => ({\n sheetName: 'SheetName',\n fileName: `datagrid-${uuid}`,\n type: 'csv',\n onlySelection: false,\n excludedColumns: undefined,\n});\n\nconst getOptions = (opts, uuid) => ({\n ...defaultOptions(uuid),\n ...opts,\n});\n\nconst getCellValue = (cell) => {\n if (cell === undefined || cell === null) return '';\n return cell;\n};\n\nexport const getExportedData = (rows, columns, range) => {\n const rowsRanged = range ? rows.slice(...range) : rows;\n const dataToExport = rowsRanged.map((row) => getVisibleRowData(row, columns));\n const columnsContent = columns\n .filter((c) => isVisible(c))\n .reduce((acc, curr, idx) => `${acc}${idx === 0 ? '' : ','}${curr.label}`, '');\n const rowsContent = dataToExport\n .map((e) => e.map((r) => `\"${String(getCellValue(r)).replace(/\"/g, '\"\"')}\"`).join(','))\n .join('\\r\\n');\n const csvContent = `${columnsContent}\\r\\n${rowsContent}`;\n return csvContent;\n};\n\n// eslint-disable-next-line max-statements\nconst exportTo = (rows, columns, { range, fileName, type, excludedColumns }) => {\n if (excludedColumns) {\n // eslint-disable-next-line no-param-reassign\n columns = columns.filter((col) => !excludedColumns.includes(col.property));\n }\n const csvContent = getExportedData(rows, columns, range);\n\n const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' });\n if (navigator.msSaveBlob) {\n // IE 10+\n navigator.msSaveBlob(blob, `${fileName}.${type}`);\n } else {\n const link = document.createElement('a');\n if (link.download !== undefined) {\n // feature detection\n // Browsers that support HTML5 download attribute\n const url = URL.createObjectURL(blob);\n link.setAttribute('href', url);\n link.setAttribute('download', `${fileName}.${type}`);\n link.style.visibility = 'hidden';\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n }\n }\n};\n\nexport const ExportDataPlugin = createInstancePlugin('export-data', {\n decorateGrid(instance) {\n return {\n exportRows(opts = {}) {\n const {\n composedRows: rows,\n columns,\n uuid,\n props: { rowKey },\n state: { selection },\n } = instance.getInstance();\n const options = getOptions(opts, uuid);\n // check paginated rows\n let currentRows = rows.allRows || rows;\n if (opts.onlySelection) {\n const selectedRows = Object.keys(selection.selectedRows);\n currentRows = currentRows.filter((r) => selectedRows.includes(String(r[rowKey])));\n }\n\n exportTo(currentRows, columns, options);\n },\n exportVisibleRows(opts = {}) {\n const {\n composedRows: rows,\n columns,\n uuid,\n props: { rowKey },\n state: { selection },\n } = instance.getInstance();\n const options = getOptions(opts, uuid);\n\n // check paginated rows\n let currentRows = rows.rows || rows;\n if (opts.onlySelection) {\n const selectedRows = Object.keys(selection.selectedRows);\n currentRows = currentRows.filter((r) => selectedRows.includes(String(r[rowKey])));\n }\n\n exportTo(currentRows, columns, options);\n },\n };\n },\n});\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,WAAW;AACpB,SAAS,4BAA4B;AAErC,MAAM,YAAY,CAAC,WAAW;AAC5B,MAAI,OAAO,WAAW,aAAa;AACjC,WAAO;AAAA,EACT;AACA,SAAO,OAAO,OAAO,YAAY,eAAe,OAAO;AACzD;AAEO,MAAM,iBAAiB,CAAC,KAAK,aAAa,IAAI,KAAK,QAAQ;AAC3D,MAAM,oBAAoB,CAAC,KAAK,YACrC,QAAQ,OAAO,CAAC,QAAQ,WAAW;AACjC,QAAM,iBAAiB,OAAO;AAC9B,SAAO,UAAU,MAAM,IACnB,CAAC,GAAG,QAAQ,eAAe,KAAK,IAAI,gBAAgB,KAAK,eAAe,KAAK,cAAc,CAAC,IAC5F;AACN,GAAG,CAAC,CAAC;AAEP,MAAM,iBAAiB,CAAC,UAAU;AAAA,EAChC,WAAW;AAAA,EACX,UAAU,YAAY;A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MACxC;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/export-data/index.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/export-data/index.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { ExportDataPlugin } from './ExportDataPlugin.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/filterable/FilterablePlugin.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/filterable/FilterablePlugin.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent */\nimport { get, isFunction } from '@elliemae/ds-utilities';\nimport { createInstancePlugin } from '@elliemae/ds-shared';\nimport { addFilterToColumn } from './addFilterToColumn.js';\nimport filterRowsByQuery, { filterRowsByQueryGroup } from './filtering-helper/filterRowsByQuery.js';\nimport { useFilterableState } from './useFilterableState.js';\n\nconst decorateColumn = (column, grid) => {\n const {\n props: { isFilterableColumnActive = (col) => col.searchable, onRemoveAllFilters },\n actions: { addFilter, removeFilter },\n state: { query, filters },\n } = grid;\n\n return isFilterableColumnActive(column)\n ? addFilterToColumn(\n {\n grid,\n onAddFilter: addFilter,\n onRemoveFilter: removeFilter,\n onRemoveAllFilters,\n query,\n filters,\n },\n column,\n )\n : column;\n};\n\nconst composeRows = (rows, grid) => {\n const {\n props: { isDataFiltered, groupedRows },\n state: { query },\n composedRows,\n } = grid.getInstance();\n const nextRows = !groupedRows ? filterRowsByQuery(rows, query) : filterRowsByQueryGroup(rows, query, composedRows);\n\n return !isDataFiltered ? nextRows : rows;\n};\n\nexport const FilterablePlugin = createInstancePlugin('filterable', {\n registerStateHook: useFilterableState,\n decorateColumn,\n composeRows,\n registerHotKeys(grid) {\n return {\n key: 'ctrl+f',\n handler: ({ cellIndex }) => {\n const { decoratedColumns } = grid.getInstance();\n\n const column = decoratedColumns[cellIndex];\n const toggleMenuMethod = get(column, ['filterMenu', 'current', 'toggleMenu']);\n if (isFunction(toggleMenuMethod)) toggleMenuMethod();\n },\n };\n },\n});\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,KAAK,kBAAkB;AAChC,SAAS,4BAA4B;AACrC,SAAS,yBAAyB;AAClC,OAAO,qBAAqB,8BAA8B;AAC1D,SAAS,0BAA0B;AAEnC,MAAM,iBAAiB,CAAC,QAAQ,SAAS;AACvC,QAAM;AAAA,IACJ,OAAO,EAAE,2BAA2B,CAAC,QAAQ,IAAI,YAAY,mBAAmB;AAAA,IAChF,SAAS,EAAE,WAAW,aAAa;AAAA,IACnC,OAAO,EAAE,OAAO,QAAQ;AAAA,EAC1B,IAAI;AAEJ,SAAO,yBAAyB,MAAM,IAClC;AAAA,IACE;AAAA,MACE;AAAA,MACA,aAAa;AAAA,MACb,gBAAgB;AAAA,MAChB;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,EACF,IACA;AACN;AAEA,MAAM,cAAc,CAAC,MAAM,SAAS;AAClC,QAAM;AAAA,IACJ,OAAO,EAAE,gBAAgB,YAAY;AAAA,IACrC,OAAO,EAAE,MAAM;AAAA,IACf;AAAA,EACF,IAAI,KAAK,YAAY;AACrB,QAAM,WAAW,CAAC,cAAc,kBAAkB,MAAM,KAAK,IAAI,uBAAuB,MAAM,OAAO,YAAY;AAEjH,SAAO,CAAC,iBAAiB,WAAW;AACtC;AAEO,MAAM,mBAAmB,qBAAqB,cAAc;AAAA,EACjE,mBAAmB;AAAA,EACnB;AAAA,EACA;AAAA,EACA,gBAAgB,MAAM;AACpB,WAAO;AAAA,MACL,KAAK;AAAA,MACL,SAAS,CAAC,EAAE,UAAU,MAAM;AAC1B,cAAM,EAAE,iBAAiB,IAAI,KAAK,YAAY;AAE9C,cAAM,SAAS,iBAAiB,SAAS;AACzC,cAAM,mBAAmB,IAAI,QAAQ,CAAC,cAAc,WAAW,YAAY,CAAC;AAC5E,YAAI,WAAW,gBAAgB;AAAG,2BAAiB;AAAA,MACrD;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/filterable/addFilterToColumn.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/filterable/addFilterToColumn.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { createRef } from 'react';\nimport { mergeClassNameToColumnHeader } from '@elliemae/ds-shared';\nimport { FilterableFormatter } from './filterableFormatter.js';\n\nexport const addFilterToColumn = (props, column) => {\n const filterMenuRef = createRef();\n column.header.formatters.push(FilterableFormatter({ ...props, filterMenuRef }));\n column.filterMenu = filterMenuRef;\n return mergeClassNameToColumnHeader('with-filtering', column);\n};\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,iBAAiB;AAC1B,SAAS,oCAAoC;AAC7C,SAAS,2BAA2B;AAE7B,MAAM,oBAAoB,CAAC,OAAO,WAAW;AAClD,QAAM,gBAAgB,UAAU;AAChC,SAAO,OAAO,WAAW,KAAK,oBAAoB,EAAE,GAAG,OAAO,cAAc,CAAC,CAAC;AAC9E,SAAO,aAAa;AACpB,SAAO,6BAA6B,kBAAkB,MAAM;AAC9D;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/plugins/filterable/components/FilterableHeader.tsx"],
3
+ "sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/plugins/filterable/components/FilterableHeader.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-param-reassign */\nimport React, { useCallback, useEffect, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { get, debounce, useResizeObserver } from '@elliemae/ds-utilities';\nimport { useTheme } from '@elliemae/ds-system';\nimport { getFilterMenuByType } from './filterable-menus/getFilterMenuByType.js';\n\nconst blockName = 'data-grid-filter-header';\n\nconst Container = aggregatedClasses('div')(blockName, null, ({ showFilter }) => ({\n 'show-filter': showFilter,\n}));\nconst FilterHeaderValue = aggregatedClasses('div')(blockName, 'value');\nconst FilterHeaderButton = aggregatedClasses('div')(blockName, 'button');\n\nexport const FilterableHeader = ({\n column,\n value,\n columnData,\n onAddFilter,\n onRemoveFilter,\n filterMenuRef,\n onFilterMenuClose,\n onFilterMenuOpen,\n filters,\n isMulti,\n}) => {\n const [isMenuOpened, setMenuOpened] = useState(false);\n const [headerWidth, setHeaderWidth] = useState();\n const debouncedWidthSetter = debounce(setHeaderWidth, 200);\n const { filterMenuMinWidth, filterMenuMaxWidth } = column;\n const theme = useTheme();\n const dropdownMinWidth = filterMenuMinWidth || Number(theme.space.xl.replace('px', '')) * 2;\n\n const defineHeaderWidth = ({ width }) => {\n let nextWidth = width + 16; // todo: use dimsum space once we convert it to JS\n if (nextWidth < dropdownMinWidth) nextWidth = dropdownMinWidth;\n if (filterMenuMaxWidth && nextWidth > filterMenuMaxWidth) nextWidth = filterMenuMaxWidth;\n return !isMenuOpened ? debouncedWidthSetter(nextWidth) : setHeaderWidth(nextWidth);\n };\n\n useEffect(() => {\n if (filterMenuRef) {\n filterMenuRef.current = {\n toggleMenu: () => setMenuOpened((prevState) => !prevState),\n };\n }\n }, [filterMenuRef]);\n\n useEffect(() => {\n if (!isMenuOpened) onFilterMenuClose(column);\n else onFilterMenuOpen(column);\n });\n\n const [ref] = useResizeObserver(defineHeaderWidth);\n const handleOpenMenu = useCallback((open) => {\n setMenuOpened(open);\n if (open) onFilterMenuOpen();\n }, []);\n const FilterMenuComponent = getFilterMenuByType(get(column, ['filter', 'type']));\n return (\n <Container ref={ref} classProps={{ showFilter: isMenuOpened }}>\n <FilterHeaderValue className=\"header-value\">{value}</FilterHeaderValue>\n <FilterHeaderButton data-testid=\"data-grid-filter-header__button\">\n <FilterMenuComponent\n className=\"filter-header-menu\"\n column={column}\n filters={filters}\n isMenuOpened={isMenuOpened}\n isMulti={isMulti}\n menuProps={{\n options: columnData || [],\n style: { minWidth: headerWidth, maxWidth: filterMenuMaxWidth },\n zIndex: 100,\n }}\n onAddFilter={onAddFilter}\n onRemoveFilter={onRemoveFilter}\n onOpenMenu={handleOpenMenu}\n onClose={onFilterMenuClose}\n width={headerWidth}\n {...get(column, ['filter'], {})}\n />\n </FilterHeaderButton>\n </Container>\n );\n};\n\nFilterableHeader.propTypes = {\n column: PropTypes.any,\n value: PropTypes.any,\n columnData: PropTypes.any,\n onAddFilter: PropTypes.func,\n onRemoveFilter: PropTypes.func,\n filterMenuRef: PropTypes.any,\n onFilterMenuClose: PropTypes.func,\n onFilterMenuOpen: PropTypes.func,\n filters: PropTypes.arrayOf(PropTypes.shape({})),\n isMulti: PropTypes.bool,\n};\n\nexport default FilterableHeader;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;AC8DnB,SACE,KADF;AA7DJ,SAAgB,aAAa,WAAW,gBAAgB;AACxD,OAAO,eAAe;AACtB,SAAS,yBAAyB;AAClC,SAAS,KAAK,UAAU,yBAAyB;AACjD,SAAS,gBAAgB;AACzB,SAAS,2BAA2B;AAEpC,MAAM,YAAY;AAElB,MAAM,YAAY,kBAAkB,KAAK,EAAE,WAAW,MAAM,CAAC,EAAE,WAAW,OAAO;AAAA,EAC/E,eAAe;AACjB,EAAE;AACF,MAAM,oBAAoB,kBAAkB,KAAK,EAAE,WAAW,OAAO;AACrE,MAAM,qBAAqB,kBAAkB,KAAK,E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A,wBAAC,qBAAkB,WAAU,gBAAgB,iBAAM;AAAA,IACnD,oBAAC,sBAAmB,eAAY,mCAC9B;AAAA,MAAC;AAAA;AAAA,QACC,WAAU;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,WAAW;AAAA,UACT,SAAS,cAAc,CAAC;AAAA,UACxB,OAAO,EAAE,UAAU,aAAa,UAAU,mBAAmB;AAAA,UAC7D,QAAQ;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA,YAAY;AAAA,QACZ,SAAS;AAAA,QACT,OAAO;AAAA,QACN,GAAG,IAAI,QAAQ,CAAC,QAAQ,GAAG,CAAC,CAAC;AAAA;AAAA,IAChC,GACF;AAAA,KACF;AAEJ;AAEA,iBAAiB,YAAY;AAAA,EAC3B,QAAQ,UAAU;AAAA,EAClB,OAAO,UAAU;AAAA,EACjB,YAAY,UAAU;AAAA,EACtB,aAAa,UAAU;AAAA,EACvB,gBAAgB,UAAU;AAAA,EAC1B,eAAe,UAAU;AAAA,EACzB,mBAAmB,UAAU;AAAA,EAC7B,kBAAkB,UAAU;AAAA,EAC5B,SAAS,UAAU,QAAQ,UAAU,MAAM,CAAC,CAAC,CAAC;AAAA,EAC9C,SAAS,UAAU;AACrB;AAEA,IAAO,2BAAQ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../../src/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.tsx"],
3
+ "sources": ["../../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../../src/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useEffect, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { DSControlledDateRangePicker } from '@elliemae/ds-controlled-form';\nimport { DSPopper, PopperPositions as Position } from '@elliemae/ds-popper';\nimport { DatePicker2 } from '@elliemae/ds-icons';\nimport { DSButton } from '@elliemae/ds-button';\nimport moment from 'moment';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { DEFAULT_DATE_FORMAT } from './defaultDateFormat.js';\n\nconst blockname = 'date-range';\nconst Wrapper = aggregatedClasses('div')(blockname, 'wrapper');\nconst Header = aggregatedClasses('div')(blockname, 'header');\n\n// const randomString = (maxLength = 5) => Math.random().toString(36).slice(-maxLength);\n\nconst DateRangePickerContainer = ({ onChange = () => null, showHeader }) => {\n const [startDate, setStartDate] = useState('');\n const [endDate, setEndDate] = useState('');\n\n // For some reason it worked like this\n const [lastChangeWasPicker, setLastChangeWasPicker] = useState(false);\n\n useEffect(() => {\n const startMoment = moment(startDate);\n const endMoment = moment(endDate);\n if (\n lastChangeWasPicker &&\n startDate &&\n !startDate.includes('_') &&\n endDate &&\n !endDate.includes('_') &&\n endMoment.diff(startMoment) >= 0\n ) {\n onChange({ startDate: startMoment, endDate: endMoment });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [startDate, endDate, lastChangeWasPicker]);\n\n return (\n <Wrapper\n data-testid=\"date-range__wrapper\"\n onKeyDown={(e) => e.code === 'Enter' && setLastChangeWasPicker(true)}\n style={{ backgroundColor: 'white', boxShadow: '0 6px 20px 0 rgb(0 0 0 / 24%)', width: '261px' }}\n >\n {showHeader && (\n <Header style={{ padding: '8px', display: 'flex', justifyContent: 'center' }}>\n <DSControlledDateRangePicker\n fromDate={startDate}\n onFromDateChange={(_start) => {\n setStartDate(_start);\n setLastChangeWasPicker(false);\n }}\n toDate={endDate}\n onToDateChange={(_end) => {\n setEndDate(_end);\n setLastChangeWasPicker(false);\n }}\n type=\"date-range-inputs\"\n />\n </Header>\n )}\n <DSControlledDateRangePicker\n fromDate={startDate}\n onFromDateChange={(_start) => {\n setStartDate(_start);\n setLastChangeWasPicker(true);\n }}\n toDate={endDate}\n onToDateChange={(_end) => {\n setEndDate(_end);\n setLastChangeWasPicker(true);\n }}\n type=\"date-range-picker-controller-only\"\n />\n </Wrapper>\n );\n};\n\nDateRangePickerContainer.propTypes = {\n onChange: PropTypes.func,\n showHeader: PropTypes.bool,\n};\n\nconst formatRangeDate = ({ startDate, endDate }, format = DEFAULT_DATE_FORMAT) => {\n const sameDay = startDate.isSame(endDate, 'day');\n if (sameDay) return `${endDate.format(format)}`;\n return `${startDate.format(format)} - ${endDate.format(format)}`;\n};\n\nconst DateRangeFilterMenu = ({\n column,\n className,\n isMenuOpened = false,\n onOpenMenu = () => null,\n placement = Position.BOTTOM_END,\n onAddFilter = () => null,\n dateFormatter = formatRangeDate,\n showHeader = true,\n menuProps,\n}) => (\n <DSPopper\n contentComponent={\n <div className={className}>\n <DateRangePickerContainer\n minimumNights={0}\n onChange={({ startDate, endDate }) => {\n startDate.startOf('day');\n endDate.endOf('day');\n onAddFilter(\n {\n group: column.property,\n label: column.label,\n value: dateFormatter({ startDate, endDate }),\n type: 'date', // todo: create constants for filter types\n filterParams: { start: startDate, end: endDate },\n transformRowValue: (value) => moment(value, column.dateFormat || DEFAULT_DATE_FORMAT),\n operator: 'range',\n },\n column,\n );\n onOpenMenu(false);\n }}\n showHeader={showHeader}\n />\n </div>\n }\n isOpen={isMenuOpened}\n onOpen={onOpenMenu}\n placement={placement}\n showArrow={false}\n triggerComponent={\n <DSButton\n buttonType=\"text\"\n icon={<DatePicker2 />}\n onClick={() => (!isMenuOpened ? onOpenMenu(true) : onOpenMenu(false))}\n size=\"s\"\n />\n }\n zIndex={menuProps.zIndex}\n />\n);\n\nDateRangeFilterMenu.propTypes = {\n column: PropTypes.any,\n className: PropTypes.string,\n isMenuOpened: PropTypes.bool,\n onOpenMenu: PropTypes.func,\n placement: PropTypes.string,\n onAddFilter: PropTypes.func,\n dateFormatter: PropTypes.any,\n showHeader: PropTypes.bool,\n menuProps: PropTypes.any,\n};\n\nexport { DateRangeFilterMenu };\nexport default DateRangeFilterMenu;\n"],
5
5
  "mappings": "AAAA,YAAY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AA,cACd,OAAO,cAAc,EAAE,WAAW,QAAQ,CAAC;AAAA,cAC3C,MAAM;AAAA;AAAA,cACN,cAAc,EAAE,OAAO,WAAW,KAAK,QAAQ;AAAA,cAC/C,mBAAmB,CAAC,UAAU,OAAO,OAAO,OAAO,cAAc,mBAAmB;AAAA,cACpF,UAAU;AAAA,YACZ;AAAA,YACA;AAAA,UACF;AACA,qBAAW,KAAK;AAAA,QAClB;AAAA,QACA;AAAA;AAAA,IACF,GACF;AAAA,IAEF,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR;AAAA,IACA,WAAW;AAAA,IACX,kBACE;AAAA,MAAC;AAAA;AAAA,QACC,YAAW;AAAA,QACX,MAAM,oBAAC,eAAY;AAAA,QACnB,SAAS,MAAO,CAAC,eAAe,WAAW,IAAI,IAAI,WAAW,KAAK;AAAA,QACnE,MAAK;AAAA;AAAA,IACP;AAAA,IAEF,QAAQ,UAAU;AAAA;AACpB;AAGF,oBAAoB,YAAY;AAAA,EAC9B,QAAQ,UAAU;AAAA,EAClB,WAAW,UAAU;AAAA,EACrB,cAAc,UAAU;AAAA,EACxB,YAAY,UAAU;AAAA,EACtB,WAAW,UAAU;AAAA,EACrB,aAAa,UAAU;AAAA,EACvB,eAAe,UAAU;AAAA,EACzB,YAAY,UAAU;AAAA,EACtB,WAAW,UAAU;AACvB;AAGA,IAAO,8BAAQ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../../src/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.tsx"],
3
+ "sources": ["../../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../../src/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSControlledDateTimePicker } from '@elliemae/ds-controlled-form';\nimport { DSPopper, PopperPositions as Position } from '@elliemae/ds-popper';\nimport { DatePicker2 } from '@elliemae/ds-icons';\nimport { DSButton } from '@elliemae/ds-button';\nimport moment from 'moment';\nimport { DEFAULT_DATE_FORMAT } from './defaultDateFormat.js';\n\nconst SingleDatePickerContainer = ({ onChange = () => null, showHeader }) => {\n const [date, setDate] = useState('');\n\n const handleDateChange = useCallback(\n (data) => {\n if (!data.includes('_')) onChange(moment(data));\n setDate(data);\n },\n [onChange],\n );\n\n return (\n <div style={{ boxShadow: '0 6px 20px 0 rgb(0 0 0 / 24%)' }}>\n {showHeader && (\n <Grid p=\"xxs\">\n <DSControlledDateTimePicker date={date} onDateChange={handleDateChange} type=\"date-inputs\" isClearable />\n </Grid>\n )}\n <DSControlledDateTimePicker date={date} onDateChange={handleDateChange} type=\"date-picker-controller-only\" />\n </div>\n );\n};\n\nSingleDatePickerContainer.propTypes = {\n onChange: PropTypes.func,\n showHeader: PropTypes.bool,\n};\n\nconst formatDate = (date, format = DEFAULT_DATE_FORMAT) => date.format(format);\n\nconst SingleDateFilterMenu = ({\n column,\n className,\n isMenuOpened = false,\n onOpenMenu = () => null,\n placement = Position.BOTTOM_END,\n onAddFilter = () => null,\n dateFormatter = formatDate,\n showHeader = false,\n menuProps,\n}) => (\n <DSPopper\n contentComponent={\n <div className={className} data-testid=\"date-single__wrapper\">\n <SingleDatePickerContainer\n minimumNights={0}\n onChange={(date) => {\n const t = date.clone();\n onAddFilter(\n {\n group: column.property,\n label: column.label,\n value: dateFormatter(date, column.dateFormat),\n type: 'date',\n operator: 'range',\n filterParams: {\n start: date.startOf('day'),\n end: t.endOf('day'),\n },\n transformRowValue: (value) => moment(value, column.dateFormat || DEFAULT_DATE_FORMAT),\n },\n column,\n );\n onOpenMenu(false);\n }}\n showHeader={showHeader}\n />\n </div>\n }\n isOpen={isMenuOpened}\n onOpen={onOpenMenu}\n placement={placement}\n showArrow={false}\n triggerComponent={\n <DSButton\n buttonType=\"text\"\n icon={<DatePicker2 />}\n onClick={() => (!isMenuOpened ? onOpenMenu(true) : onOpenMenu(false))}\n size=\"s\"\n />\n }\n zIndex={menuProps.zIndex}\n />\n);\n\nSingleDateFilterMenu.propTypes = {\n column: PropTypes.any,\n className: PropTypes.string,\n isMenuOpened: PropTypes.bool,\n onOpenMenu: PropTypes.func,\n placement: PropTypes.string,\n onAddFilter: PropTypes.func,\n dateFormatter: PropTypes.any,\n showHeader: PropTypes.bool,\n menuProps: PropTypes.any,\n};\n\nexport { SingleDateFilterMenu };\nexport default SingleDateFilterMenu;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACsBnB,SAGM,KAHN;AAtBJ,SAAgB,aAAa,gBAAgB;AAC7C,OAAO,eAAe;AACtB,SAAS,YAAY;AACrB,SAAS,kCAAkC;AAC3C,SAAS,UAAU,mBAAmB,gBAAgB;AACtD,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AACzB,OAAO,YAAY;AACnB,SAAS,2BAA2B;AAEpC,MAAM,4BAA4B,CAAC,EAAE,WAAW,MAAM,MAAM,WAAW,MAAM;AAC3E,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,EAAE;AAEnC,QAAM,mBAAmB;AAAA,IACvB,CAAC,SAAS;AACR,UAAI,CAAC,KAAK,SAAS,GAAG;AAAG,iBAAS,OAAO,IAAI,CAAC;AAC9C,cAAQ,IAAI;AAAA,IACd;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AAEA,SACE,qBAAC,SAAI,OAAO,EAAE,WAAW,gCAAgC,GACtD;AAAA,kBACC,oBAAC,QAAK,GAAE,OACN,8BAAC,8BAA2B,MAAY,cAAc,kBAAkB,MAAK,eAAc,aAAW,MAAC,GACzG;AAAA,IAEF,oBAAC,8BAA2B,MAAY,cAAc,kBAAkB,MAAK,+BAA8B;AAAA,KAC7G;AAEJ;AAEA,0BAA0B,YAAY;AAAA,EACpC,UAAU,UAAU;AAAA,EACpB,YAAY,UAAU;AACxB;AA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AAA,EACtB,WAAW,UAAU;AAAA,EACrB,aAAa,UAAU;AAAA,EACvB,eAAe,UAAU;AAAA,EACzB,YAAY,UAAU;AAAA,EACtB,WAAW,UAAU;AACvB;AAGA,IAAO,+BAAQ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../../src/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.tsx"],
3
+ "sources": ["../../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../../src/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useEffect, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport {\n DSControlledDateTimePicker,\n DSControlledDateRangePicker,\n DSControlledCheckbox,\n} from '@elliemae/ds-controlled-form';\nimport { DSPopper, PopperPositions as Position } from '@elliemae/ds-popper';\nimport { DatePicker2 } from '@elliemae/ds-icons';\nimport { DSButton } from '@elliemae/ds-button';\nimport { Grid } from '@elliemae/ds-grid';\nimport moment from 'moment';\nimport { styled } from '@elliemae/ds-system';\nimport { DEFAULT_DATE_FORMAT } from './defaultDateFormat.js';\n\nconst StyledGridWrapper = styled(Grid)`\n .notCurrentMonth {\n opacity: ${(props) => (props.enableOutsideDays ? '1' : '0')};\n pointer-events: ${(props) => (props.enableOutsideDays ? 'auto' : 'none')};\n }\n`;\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function\nconst noop = (...args) => {};\n\nconst SingleRangeSwitcherContainer = ({ onChange = noop, enableOutsideDays }) => {\n const [startDate, setStartDate] = useState('');\n const [endDate, setEndDate] = useState('');\n\n // For some reason it worked like this\n const [lastChangeWasPicker, setLastChangeWasPicker] = useState(false);\n\n const [isDateRange, setIsDateRange] = useState(false);\n\n useEffect(() => {\n const startMoment = moment(startDate);\n const endMoment = moment(endDate);\n if (\n lastChangeWasPicker &&\n startDate &&\n !startDate.includes('_') &&\n endDate &&\n !endDate.includes('_') &&\n endMoment.diff(startMoment) >= 0\n ) {\n onChange({ startDate: startMoment, endDate: endMoment });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [startDate, endDate, lastChangeWasPicker]);\n\n return (\n <StyledGridWrapper\n data-testid=\"date-single-range__wrapper\"\n style={{\n backgroundColor: 'white',\n boxShadow: '0 6px 20px 0 rgb(0 0 0 / 24%)',\n width: '261px',\n display: 'grid',\n justifyContent: 'center',\n }}\n cols={['100%']}\n enableOutsideDays={enableOutsideDays}\n onKeyDown={(e) => e.code === 'Enter' && setLastChangeWasPicker(true)}\n >\n <Grid gutter=\"xxs\" alignItems=\"center\" p=\"xxs\">\n <DSControlledCheckbox\n checked={isDateRange}\n name=\"Date range\"\n label=\"Range\"\n id=\"date-range-switcher-id-internal\"\n onChange={() => {\n setIsDateRange(!isDateRange);\n setStartDate('');\n setEndDate('');\n }}\n />\n <div style={{ width: 'fit-content' }}>\n {isDateRange ? (\n <DSControlledDateRangePicker\n fromDate={startDate}\n onFromDateChange={(_start) => {\n setStartDate(_start);\n setLastChangeWasPicker(false);\n }}\n toDate={endDate}\n onToDateChange={(_end) => {\n setEndDate(_end);\n setLastChangeWasPicker(false);\n }}\n type=\"date-range-inputs\"\n />\n ) : (\n <DSControlledDateTimePicker\n date={startDate}\n onDateChange={(_date) => {\n setLastChangeWasPicker(false);\n setStartDate(_date);\n setEndDate(_date);\n }}\n type=\"date-inputs\"\n />\n )}\n </div>\n </Grid>\n <Grid>\n {isDateRange ? (\n <DSControlledDateRangePicker\n fromDate={startDate}\n onFromDateChange={(_start) => {\n setStartDate(_start);\n setLastChangeWasPicker(true);\n }}\n toDate={endDate}\n onToDateChange={(_end) => {\n setEndDate(_end);\n setLastChangeWasPicker(true);\n }}\n type=\"date-range-picker-controller-only\"\n />\n ) : (\n <DSControlledDateTimePicker\n date={startDate}\n onDateChange={(_date) => {\n setLastChangeWasPicker(true);\n setStartDate(_date);\n setEndDate(_date);\n }}\n type=\"date-picker-controller-only\"\n />\n )}\n </Grid>\n </StyledGridWrapper>\n );\n};\n\nSingleRangeSwitcherContainer.propTypes = {\n onChange: PropTypes.func,\n enableOutsideDays: PropTypes.bool,\n};\n\nconst formatRangeDate = ({ startDate, endDate }, format = DEFAULT_DATE_FORMAT) => {\n const sameDay = startDate.isSame(endDate, 'day');\n if (sameDay) return `${endDate.format(format)}`;\n return `${startDate.format(format)} - ${endDate.format(format)}`;\n};\n\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nconst SingleRangeSwitcherMenu = ({\n column,\n className,\n isMenuOpened = false,\n onOpenMenu = noop,\n placement = Position.BOTTOM_END,\n onAddFilter = noop,\n dateFormatter = formatRangeDate,\n enableOutsideDays = true,\n menuProps,\n}): JSX.Element => (\n <DSPopper\n contentComponent={\n <div className={className}>\n <SingleRangeSwitcherContainer\n enableOutsideDays={enableOutsideDays}\n onChange={({ startDate, endDate }) => {\n startDate.startOf('day');\n endDate.endOf('day');\n onAddFilter(\n {\n group: column.property,\n label: column.label,\n value: dateFormatter({ startDate, endDate }, column.format),\n type: 'date', // todo: create constants for filter types\n filterParams: { start: startDate, end: endDate },\n transformRowValue: (value) => moment(value, column.dateFormat || DEFAULT_DATE_FORMAT),\n operator: 'range',\n },\n column,\n );\n onOpenMenu(false);\n }}\n />\n </div>\n }\n isOpen={isMenuOpened}\n onOpen={onOpenMenu}\n placement={placement}\n showArrow={false}\n triggerComponent={\n <DSButton\n buttonType=\"text\"\n icon={<DatePicker2 />}\n onClick={() => (!isMenuOpened ? onOpenMenu(true) : onOpenMenu(false))}\n size=\"s\"\n />\n }\n zIndex={menuProps.zIndex}\n />\n);\n\nSingleRangeSwitcherMenu.propTypes = {\n column: PropTypes.any,\n className: PropTypes.string,\n isMenuOpened: PropTypes.bool,\n onOpenMenu: PropTypes.func,\n placement: PropTypes.string,\n onAddFilter: PropTypes.func,\n dateFormatter: PropTypes.any,\n enableOutsideDays: PropTypes.bool,\n menuProps: PropTypes.any,\n};\n\nexport { SingleRangeSwitcherMenu };\nexport default SingleRangeSwitcherMenu;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACiEjB,SACE,KADF;AAhEN,SAAgB,WAAW,gBAAgB;AAC3C,OAAO,eAAe;AACtB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,UAAU,mBAAmB,gBAAgB;AACtD,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB,OAAO,YAAY;AACnB,SAAS,cAAc;AACvB,SAAS,2BAA2B;AAEpC,MAAM,oBAAoB,OAAO,IAAI;AAAA;AAAA,eAEtB,CAAC,UAAW,MAAM,oBAAoB,MAAM;AAAA,sBACrC,CAAC,UAAW,MAAM,oBAAoB,SAAS;AAAA;AAAA;AAKrE,MAAM,OAAO,IAAI,SAAS;AAAC;AAE3B,MAAM,+BAA+B,CAAC,EAAE,WAAW,MAAM,kBAAkB,MAAM;AAC/E,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,EAAE;AAC7C,QAAM,CAAC,SAAS,UAAU,IAAI,SAAS,EAAE;AAGzC,QAAM,CAAC,qBAAqB,sBAAsB,IAAI,SAAS,KAAK;AAEpE,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,KAAK;AAEpD,YAAU,MAAM;AACd,UAAM,cAAc,OAAO,SAAS;AACpC,UAAM,YAAY,OAAO,OAAO;AAChC,QACE,uBACA,aACA,CAAC,UAAU,SAAS,GAAG,KACvB,WACA,CAAC,QAAQ,SAAS,GAAG,KACrB,UAAU,KAAK,WAAW,KAAK,GAC/B;AACA,eAAS,EAAE,WAAW,aAAa,SAAS,UAAU,CAAC;AAAA,IACzD;AAAA,EAEF,GAAG,CAAC,WAAW,SAAS,mBAAmB,CAAC;AAE5C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAY;AAAA,MACZ,OAAO;A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A,UACF;AACA,qBAAW,KAAK;AAAA,QAClB;AAAA;AAAA,IACF,GACF;AAAA,IAEF,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR;AAAA,IACA,WAAW;AAAA,IACX,kBACE;AAAA,MAAC;AAAA;AAAA,QACC,YAAW;AAAA,QACX,MAAM,oBAAC,eAAY;AAAA,QACnB,SAAS,MAAO,CAAC,eAAe,WAAW,IAAI,IAAI,WAAW,KAAK;AAAA,QACnE,MAAK;AAAA;AAAA,IACP;AAAA,IAEF,QAAQ,UAAU;AAAA;AACpB;AAGF,wBAAwB,YAAY;AAAA,EAClC,QAAQ,UAAU;AAAA,EAClB,WAAW,UAAU;AAAA,EACrB,cAAc,UAAU;AAAA,EACxB,YAAY,UAAU;AAAA,EACtB,WAAW,UAAU;AAAA,EACrB,aAAa,UAAU;AAAA,EACvB,eAAe,UAAU;AAAA,EACzB,mBAAmB,UAAU;AAAA,EAC7B,WAAW,UAAU;AACvB;AAGA,IAAO,kCAAQ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../../src/plugins/filterable/components/filterable-menus/TextFilterMenu.tsx"],
3
+ "sources": ["../../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../../src/plugins/filterable/components/filterable-menus/TextFilterMenu.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { compact } from 'lodash';\nimport { DSDropdownMenu } from '@elliemae/ds-dropdownmenu';\nimport { DSButton } from '@elliemae/ds-button';\nimport { PopperPositions as Position } from '@elliemae/ds-popper';\nimport { Menu, MenuCombobox } from '@elliemae/ds-menu';\nimport { SearchSmall } from '@elliemae/ds-icons';\n\nconst TextFilterMenu = ({\n column,\n menuStyle = {},\n className,\n filters = [],\n isMenuOpened = false,\n onOpenMenu = () => null,\n onClose = () => null,\n placement = Position.BOTTOM_END,\n menuProps = {},\n onAddFilter = () => null,\n onRemoveFilter = () => null,\n maxOptions = 10,\n isMulti = false,\n}) => {\n const { options, ...otherMenuProps } = menuProps;\n\n const generateOption = (option, idx) => <Menu.ItemCheckbox key={idx} label={option.label} name={option.id} />;\n\n const renderOptions = (arr) => arr.map(generateOption);\n\n const filtersForColumn = filters.filter((f) => f.group === column.property);\n\n const initialSelectedOptions = filtersForColumn.map((f) => f.value);\n\n const [selected, setSelected] = useState(initialSelectedOptions);\n\n React.useEffect(() => {\n const filtersForColumn2 = filters.filter((f) => f.group === column.property);\n setSelected(filtersForColumn2.map((f) => f.value));\n }, [filters]);\n\n const filterGroup = column.searchBy || column.property;\n\n const onCloseMulti = () => {\n let nextFilters = [...filters];\n const shouldRemove = [];\n // if selected doesn't includes item, then we have to remove the filter\n // but given that we are maintaining state here and updating the grid state\n // is not implemented on useFilterableState, we have to do this in 2 traverses\n // as doing it in one gives trouble when removing and adding at the same time.\n initialSelectedOptions.forEach((item) => {\n if (!selected.includes(item)) {\n nextFilters = nextFilters.filter((filter) => !(filter.group === filterGroup && filter.value === item));\n shouldRemove.push({ group: filterGroup, pill: { value: item } });\n }\n });\n shouldRemove.forEach((removedFilter) => {\n onRemoveFilter({\n ...removedFilter,\n nextFilters,\n });\n });\n selected.forEach((item) => {\n // if initialSelectedOptions includes item, then we do nothing\n if (!initialSelectedOptions.includes(item)) {\n onAddFilter(\n {\n group: filterGroup,\n label: column.label,\n value: item,\n operator: column?.filter?.operator || 'contains',\n transformRowValue: column.valueTransformation,\n },\n column,\n );\n }\n });\n onClose();\n };\n\n return (\n <DSDropdownMenu\n closeMenuOnItemSelection\n contentStyle={menuStyle}\n customMenu={\n isMulti ? (\n <Menu containerProps={{ id: 'text-filter-menu-multiple' }} className=\"dg-multiple-filter\" visible>\n <Menu.SelectionGroup\n active={selected}\n onSelect={(newValues) => {\n setSelected(newValues);\n }}\n focusOnOpen\n multi\n searchable\n >\n {renderOptions(options)}\n </Menu.SelectionGroup>\n </Menu>\n ) : (\n <MenuCombobox\n {...otherMenuProps}\n className={className}\n dropdownFilterOptions={{\n ...column.dropdownFilterOptions,\n maxOptions,\n }}\n maxWidth={column.filterMenuMaxWidth}\n minWidth={column.filterMenuMinWidth}\n onSelectMenuItem={(selectedValue) => {\n if (selectedValue) {\n onAddFilter(\n {\n group: column.searchBy || column.property,\n label: column.label,\n value: selectedValue,\n operator: column?.filter?.operator || 'contains',\n transformRowValue: column.valueTransformation,\n },\n column,\n );\n onOpenMenu(false);\n }\n }}\n />\n )\n }\n isOpen={isMenuOpened}\n maxWidth={column.filterMenuMaxWidth}\n menuProps={menuProps}\n minWidth={column.filterMenuMinWidth}\n onOpenMenu={onOpenMenu}\n onClose={isMulti ? onCloseMulti : onClose}\n options={compact(options)}\n placement={placement}\n triggerComponent={\n <DSButton\n buttonType=\"text\"\n icon={<SearchSmall />}\n onClick={() => (isMenuOpened ? onOpenMenu(false) : onOpenMenu(true))}\n size=\"s\"\n />\n }\n />\n );\n};\n\nTextFilterMenu.propTypes = {\n column: PropTypes.any,\n menuStyle: PropTypes.shape({}),\n className: PropTypes.string,\n filters: PropTypes.arrayOf(PropTypes.shape({})),\n isMenuOpened: PropTypes.bool,\n onOpenMenu: PropTypes.func,\n onClose: PropTypes.func,\n placement: PropTypes.string,\n menuProps: PropTypes.shape({}),\n onAddFilter: PropTypes.func,\n onRemoveFilter: PropTypes.func,\n maxOptions: PropTypes.number,\n isMulti: PropTypes.bool,\n};\n\nexport { TextFilterMenu };\nexport default TextFilterMenu;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;AC2BmB;AA1B1C,OAAOA,UAAS,gBAAgB;AAChC,OAAO,eAAe;AACtB,SAAS,eAAe;AACxB,SAAS,sBAAsB;AAC/B,SAAS,gBAAgB;AACzB,SAAS,mBAAmB,gBAAgB;AAC5C,SAAS,MAAM,oBAAoB;AACnC,SAAS,mBAAmB;AAE5B,MAAM,iBAAiB,CAAC;AAAA,EAC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B;AAAA,UACF;AAAA;AAAA,MACF;AAAA,MAGJ,QAAQ;AAAA,MACR,UAAU,OAAO;AAAA,MACjB;AAAA,MACA,UAAU,OAAO;AAAA,MACjB;AAAA,MACA,SAAS,UAAU,eAAe;AAAA,MAClC,SAAS,QAAQ,OAAO;AAAA,MACxB;AAAA,MACA,kBACE;AAAA,QAAC;AAAA;AAAA,UACC,YAAW;AAAA,UACX,MAAM,oBAAC,eAAY;AAAA,UACnB,SAAS,MAAO,eAAe,WAAW,KAAK,IAAI,WAAW,IAAI;AAAA,UAClE,MAAK;AAAA;AAAA,MACP;AAAA;AAAA,EAEJ;AAEJ;AAEA,eAAe,YAAY;AAAA,EACzB,QAAQ,UAAU;AAAA,EAClB,WAAW,UAAU,MAAM,CAAC,CAAC;AAAA,EAC7B,WAAW,UAAU;AAAA,EACrB,SAAS,UAAU,QAAQ,UAAU,MAAM,CAAC,CAAC,CAAC;AAAA,EAC9C,cAAc,UAAU;AAAA,EACxB,YAAY,UAAU;AAAA,EACtB,SAAS,UAAU;AAAA,EACnB,WAAW,UAAU;AAAA,EACrB,WAAW,UAAU,MAAM,CAAC,CAAC;AAAA,EAC7B,aAAa,UAAU;AAAA,EACvB,gBAAgB,UAAU;AAAA,EAC1B,YAAY,UAAU;AAAA,EACtB,SAAS,UAAU;AACrB;AAGA,IAAO,yBAAQ;",
6
6
  "names": ["React"]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../../src/plugins/filterable/components/filterable-menus/defaultDateFormat.tsx"],
3
+ "sources": ["../../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../../src/plugins/filterable/components/filterable-menus/defaultDateFormat.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const DEFAULT_DATE_FORMAT = 'MM/DD/YYYY';\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,sBAAsB;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../../src/plugins/filterable/components/filterable-menus/getFilterMenuByType.tsx"],
3
+ "sources": ["../../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../../src/plugins/filterable/components/filterable-menus/getFilterMenuByType.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { DateRangeFilterMenu } from './DateRangeFilterMenu.js';\nimport { SingleDateFilterMenu } from './SingleDateFilterMenu.js'; // implement\nimport { SingleRangeSwitcherMenu } from './SingleRangeSwitcherMenu.js'; // implement\nimport { TextFilterMenu } from './TextFilterMenu.js';\n\nconst ComponentTypes = {\n 'date-range': DateRangeFilterMenu,\n 'single-date': SingleDateFilterMenu,\n 'date-switcher': SingleRangeSwitcherMenu,\n string: TextFilterMenu,\n};\n\nexport const getFilterMenuByType = (type) => ComponentTypes[type] || ComponentTypes.string;\n\nexport default getFilterMenuByType;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,2BAA2B;AACpC,SAAS,4BAA4B;AACrC,SAAS,+BAA+B;AACxC,SAAS,sBAAsB;AAE/B,MAAM,iBAAiB;AAAA,EACrB,cAAc;AAAA,EACd,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,QAAQ;AACV;AAEO,MAAM,sBAAsB,CAAC,SAAS,eAAe,IAAI,KAAK,eAAe;AAEpF,IAAO,8BAAQ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/filterable/filterableFormatter.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/filterable/filterableFormatter.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/display-name */\nimport React from 'react';\nimport { FilterableHeader } from './components/FilterableHeader.js';\nimport { getFilterLabels, getFilterLabelsGroup } from './helper.js';\n\nconst FilterableFormatter = ({ grid, onAddFilter, onRemoveFilter, query, filterMenuRef }) =>\n function (value, { column }) {\n const {\n rows,\n composedRows,\n props: { groupedRows, groupedBy, onFilterMenuClose, onFilterMenuOpen },\n state: { filters },\n } = grid.getInstance();\n\n let rowsToUse = composedRows;\n if (column.filter && column.filter.isMulti) {\n rowsToUse = rows;\n }\n\n const filteredLabels =\n groupedRows && !groupedBy\n ? getFilterLabelsGroup(column, rows, query)\n : getFilterLabels(column, rowsToUse.rows || rowsToUse, query);\n\n const columnData = column.filterOptions || filteredLabels;\n return (\n <FilterableHeader\n column={column}\n columnData={columnData}\n filters={filters}\n filterMenuRef={filterMenuRef}\n onAddFilter={onAddFilter}\n onFilterMenuClose={onFilterMenuClose}\n onFilterMenuOpen={onFilterMenuOpen}\n onRemoveFilter={onRemoveFilter}\n isMulti={column.filter && column.filter.isMulti}\n value={value}\n />\n );\n };\n\nexport { FilterableFormatter };\nexport default FilterableFormatter;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;AC0BjB;AAxBN,SAAS,wBAAwB;AACjC,SAAS,iBAAiB,4BAA4B;AAEtD,MAAM,sBAAsB,CAAC,EAAE,MAAM,aAAa,gBAAgB,OAAO,cAAc,MACrF,SAAU,OAAO,EAAE,OAAO,GAAG;AAC3B,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,OAAO,EAAE,aAAa,WAAW,mBAAmB,iBAAiB;AAAA,IACrE,OAAO,EAAE,QAAQ;AAAA,EACnB,IAAI,KAAK,YAAY;AAErB,MAAI,YAAY;AAChB,MAAI,OAAO,UAAU,OAAO,OAAO,SAAS;AAC1C,gBAAY;AAAA,EACd;AAEA,QAAM,iBACJ,eAAe,CAAC,YACZ,qBAAqB,QAAQ,MAAM,KAAK,IACxC,gBAAgB,QAAQ,UAAU,QAAQ,WAAW,KAAK;AAEhE,QAAM,aAAa,OAAO,iBAAiB;AAC3C,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS,OAAO,UAAU,OAAO,OAAO;AAAA,MACxC;AAAA;AAAA,EACF;AAEJ;AAGF,IAAO,8BAAQ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/plugins/filterable/filtering-helper/filterRowsByQuery.tsx"],
3
+ "sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/plugins/filterable/filtering-helper/filterRowsByQuery.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { isFunction } from '@elliemae/ds-utilities';\nimport { strategiesOperators } from './strategiesOperators.js';\n\nconst getRuleStrategyOperator = (rule) => rule.strategy || strategiesOperators(rule.operator);\n\nconst executeFilterStrategy = (rule, row) => {\n const { value, field, transform, transformRowValue } = rule;\n if (field === 'all') return Object.values(row).some((colValue) => strategiesOperators('contains')(colValue, value));\n const rowValue = row[field];\n const transformedValue = isFunction(transform) ? transform(value) : value;\n const transformedRowValue = isFunction(transformRowValue) ? transformRowValue(rowValue) : rowValue;\n\n const filterStrategy = getRuleStrategyOperator(rule);\n return filterStrategy(transformedRowValue, transformedValue);\n};\n\nconst filterByRules =\n (rules, condition = 'AND') =>\n (row) =>\n condition === 'AND'\n ? rules.reduce(\n (isFiltered, rule) =>\n rule.rules && rule.rules.length\n ? isFiltered && filterByRules(rule.rules, rule.condition)(row)\n : isFiltered && executeFilterStrategy(rule, row),\n true,\n )\n : rules.some((rule) =>\n rule.rules && rule.rules.length\n ? filterByRules(rule.rules, rule.condition)(row)\n : executeFilterStrategy(rule, row),\n );\n\nexport function filterRowsByQueryGroup(rows, query, composedRows) {\n if (query && query.rules && query.rules.length === 0) return rows;\n const newRows = [];\n const parentMap = {};\n composedRows.forEach((parentRow) => {\n if (parentRow.isGroup) {\n newRows.push({\n ...parentRow,\n _filtered: true,\n });\n } else if (!parentRow.isGroup && filterByRules(query.rules, query.condition)(parentRow.data)) {\n newRows.push({\n ...parentRow,\n _filtered: true,\n });\n parentMap[parentRow.parentNode.id] = true;\n }\n });\n\n return newRows.filter((r) => {\n if (r.isGroup && !parentMap[r.id]) return false;\n return true;\n });\n}\n\nexport const filterRowsByQuery = (rows, query) => rows.filter(filterByRules(query.rules, query.condition));\n\nexport default filterRowsByQuery;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,kBAAkB;AAC3B,SAAS,2BAA2B;AAEpC,MAAM,0BAA0B,CAAC,SAAS,KAAK,YAAY,oBAAoB,KAAK,QAAQ;AAE5F,MAAM,wBAAwB,CAAC,MAAM,QAAQ;AAC3C,QAAM,EAAE,OAAO,OAAO,WAAW,kBAAkB,IAAI;AACvD,MAAI,UAAU;AAAO,WAAO,OAAO,OAAO,GAAG,EAAE,KAAK,CAAC,aAAa,oBAAoB,UAAU,EAAE,UAAU,KAAK,CAAC;AAClH,QAAM,WAAW,IAAI,KAAK;AAC1B,QAAM,mBAAmB,WAAW,SAAS,IAAI,UAAU,KAAK,IAAI;AACpE,QAAM,sBAAsB,WAAW,iBAAiB,IAAI,kBAAkB,QAAQ,IAAI;AAE1F,QAAM,iBAAiB,wBAAwB,IAAI;AACnD,SAAO,eAAe,qBAAqB,gBAAgB;AAC7D;AAEA,MAAM,gBACJ,CAAC,OAAO,YAAY,UACpB,CAAC,QACC,cAAc,QACV,MAAM;AAAA,EACJ,CAAC,YAAY,SACX,KAAK,SAAS,KAAK,MAAM,SACrB,cAAc,cAAc,KAAK,OAAO,KAAK,SAAS,EAAE,GAAG,IAC3D,cAAc,sBAAsB,MAAM,GAAG;AAAA,EACnD;AACF,IACA,MAAM;AAAA,EAAK,CAAC,SACV,KAAK,SAAS,KAAK,MAAM,SACrB,cAAc,KAAK,OAAO,KAAK,SAAS,EAAE,GAAG,IAC7C,sBAAsB,MAAM,GAAG;AACrC;AAED,SAAS,uBAAuB,MAAM,OAAO,cAAc;AAChE,MAAI,SAAS,MAAM,SAAS,MAAM,MAAM,WAAW;AAAG,WAAO;AAC7D,QAAM,UAAU,CAAC;AACjB,QAAM,YAAY,CAAC;AACnB,eAAa,QAAQ,CAAC,cAAc;AAClC,QAAI,UAAU,SAAS;AACrB,cAAQ,KAAK;AAAA,QACX,GAAG;AAAA,QACH,WAAW;AAAA,MACb,CAAC;AAAA,IACH,WAAW,CAAC,UAAU,WAAW,cAAc,MAAM,OAAO,MAAM,SAAS,EAAE,UAAU,IAAI,GAAG;AAC5F,cAAQ,KAAK;AAAA,QACX,GAAG;AAAA,QACH,WAAW;AAAA,MACb,CAAC;AACD,gBAAU,UAAU,WAAW,EAAE,IAAI;AAAA,IACvC;AAAA,EACF,CAAC;AAED,SAAO,QAAQ,OAAO,CAAC,MAAM;AAC3B,QAAI,EAAE,WAAW,CAAC,UAAU,EAAE,EAAE;AAAG,aAAO;AAC1C,WAAO;AAAA,EACT,CAAC;AACH;AAEO,MAAM,oBAAoB,CAAC,MAAM,UAAU,KAAK,OAAO,cAAc,MAAM,OAAO,MAAM,SAAS,CAAC;AAEzG,IAAO,4BAAQ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/plugins/filterable/filtering-helper/strategiesOperators.tsx"],
3
+ "sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/plugins/filterable/filtering-helper/strategiesOperators.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import compare from 'comparejs';\n\nexport const strategiesOperators = (op) =>\n ({\n range: (rowValue, { start, end }) => start <= rowValue && end >= rowValue,\n equal: (value1, value2) => compare.id(value1, value2),\n greaterThan: compare.gt,\n lessThan: compare.lt,\n contains: (rowValue, value) => String(rowValue).toLowerCase().indexOf(String(value).toLowerCase()) !== -1,\n }[op] || compare.id);\n\nexport default strategiesOperators;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,OAAO,aAAa;AAEb,MAAM,sBAAsB,CAAC,QACjC;AAAA,EACC,OAAO,CAAC,UAAU,EAAE,OAAO,IAAI,MAAM,SAAS,YAAY,OAAO;AAAA,EACjE,OAAO,CAAC,QAAQ,WAAW,QAAQ,GAAG,QAAQ,MAAM;AAAA,EACpD,aAAa,QAAQ;AAAA,EACrB,UAAU,QAAQ;AAAA,EAClB,UAAU,CAAC,UAAU,UAAU,OAAO,QAAQ,EAAE,YAAY,EAAE,QAAQ,OAAO,KAAK,EAAE,YAAY,CAAC,MAAM;AACzG,GAAE,EAAE,KAAK,QAAQ;AAEnB,IAAO,8BAAQ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/filterable/helper.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/filterable/helper.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { isFunction, uniqBy, get, groupBy, property } from '@elliemae/ds-utilities';\n\nexport const getFilterLabel = (column, value) => (column.filterLabels ? column.filterLabels[value] || value : value);\n\nexport const getFilterLabels = (column, rows) =>\n uniqBy(rows, property(column.searchBy || column.property))\n .map((row) => {\n const value = get(row, column.searchBy || column.property);\n if (value === undefined) return {};\n const rowColumnValue = String(get(row, column.searchBy || column.property));\n if (isFunction(column.valueTransformation)) {\n const nextValue = column.valueTransformation(rowColumnValue);\n return { id: nextValue, label: nextValue };\n }\n const label = getFilterLabel(column, rowColumnValue);\n return { id: rowColumnValue || label, label };\n })\n .filter((row) => row.id)\n .filter((row) => {\n if (row.id.startsWith) return !row.id.startsWith('grouped-by');\n return true;\n });\n\nexport const getFilterLabelsGroup = (column, rows) => {\n let flat = [];\n rows.forEach((r) => {\n if (r.children) {\n flat = [...flat, ...r.children];\n }\n });\n return getFilterLabels(column, flat);\n};\n\nexport function getFilterValue(filter, column) {\n const { value } = filter;\n\n if (!column) return value;\n\n const { filterOptions, filterLabels } = column;\n\n if (filterOptions) {\n const foundOption = column.filterOptions.filter((option) => option.id === value)[0];\n if (foundOption) return foundOption.label;\n return value;\n }\n if (filterLabels) {\n return filterLabels[value];\n }\n\n return value;\n}\n\nexport function buildFilterArray(newFilter, filters) {\n // if (newFilter.type && newFilter.type === 'date') return [...filters.slice(1), newFilter]\n return uniqBy([...filters, newFilter], (v) => [v.group, v.value].join());\n}\n\nexport const groupFilters = (filters) => filters.filter((filter) => !filter.fixed);\n\nfunction parseFilterToRule(filter) {\n return {\n ...filter,\n value: filter.filterParams || filter.value,\n field: filter.group,\n };\n}\n\nexport function parseFiltersToQuery(filters) {\n const groupedFilters = groupBy(groupFilters(filters), (filter) => filter.group);\n return Object.keys(groupedFilters).reduce(\n (queryResult, field) => {\n const filter = groupedFilters[field];\n if (Array.isArray(filter) && filter.length > 1) {\n // create query group with 'OR' condition\n queryResult.rules.push({\n condition: 'OR',\n rules: filter.map(parseFilterToRule),\n });\n } else {\n queryResult.rules.push(parseFilterToRule(filter[0]));\n }\n return queryResult;\n },\n { condition: 'AND', rules: [] },\n );\n}\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,YAAY,QAAQ,KAAK,SAAS,gBAAgB;AAEpD,MAAM,iBAAiB,CAAC,QAAQ,UAAW,OAAO,eAAe,OAAO,aAAa,KAAK,KAAK,QAAQ;AAEvG,MAAM,kBAAkB,CAAC,QAAQ,SACtC,OAAO,MAAM,SAAS,OAAO,YAAY,OAAO,QAAQ,CAAC,EACtD,IAAI,CAAC,QAAQ;AACZ,QAAM,QAAQ,IAAI,KAAK,OAAO,YAAY,OAAO,QAAQ;AACzD,MAAI,UAAU;AAAW,WAAO,CAAC;AACjC,QAAM,iBAAiB,OAAO,IAAI,KAAK,OAAO,YAAY,OAAO,QAAQ,CAAC;A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AA,IACL,GAAG;AAAA,IACH,OAAO,OAAO,gBAAgB,OAAO;AAAA,IACrC,OAAO,OAAO;AAAA,EAChB;AACF;AAEO,SAAS,oBAAoB,SAAS;AAC3C,QAAM,iBAAiB,QAAQ,aAAa,OAAO,GAAG,CAAC,WAAW,OAAO,KAAK;AAC9E,SAAO,OAAO,KAAK,cAAc,EAAE;AAAA,IACjC,CAAC,aAAa,UAAU;AACtB,YAAM,SAAS,eAAe,KAAK;AACnC,UAAI,MAAM,QAAQ,MAAM,KAAK,OAAO,SAAS,GAAG;AAE9C,oBAAY,MAAM,KAAK;AAAA,UACrB,WAAW;AAAA,UACX,OAAO,OAAO,IAAI,iBAAiB;AAAA,QACrC,CAAC;AAAA,MACH,OAAO;AACL,oBAAY,MAAM,KAAK,kBAAkB,OAAO,CAAC,CAAC,CAAC;AAAA,MACrD;AACA,aAAO;AAAA,IACT;AAAA,IACA,EAAE,WAAW,OAAO,OAAO,CAAC,EAAE;AAAA,EAChC;AACF;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/filterable/index.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/filterable/index.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { FilterablePlugin } from './FilterablePlugin.js';\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,wBAAwB;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/filterable/useFilterableState.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/filterable/useFilterableState.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useMemo, useState, useEffect } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\nimport { buildFilterArray, getFilterValue, parseFiltersToQuery } from './helper.js';\n\nconst noop = () => null;\n\nexport function useFilterableState(grid) {\n const {\n filters: filtersProp,\n onAddFilter = noop,\n onRemoveFilter = noop,\n onRemoveAllFilters = noop,\n onFiltersChange = noop,\n } = grid.props;\n\n const [filters, setFilters] = useState(filtersProp || []);\n\n useEffect(() => {\n if (filtersProp && filtersProp !== filters) {\n setFilters(filtersProp);\n }\n }, [filtersProp]);\n\n const queryFromFilters = useMemo(() => parseFiltersToQuery(filters || []), [filters]);\n\n const handleFiltersChange = (nextFilters) => {\n const {\n refs: { body },\n } = grid.getInstance();\n body.current.scrollTop = 0;\n setFilters(nextFilters);\n grid.observeRows((rows) => onFiltersChange(nextFilters, queryFromFilters, rows));\n };\n\n const addFilter = (filter, column) => {\n let hasBeenCalled = false;\n const trimmedFilter = {\n ...filter,\n value: String(filter.value).trim(),\n };\n /* eslint-disable indent */\n const parsedFilter = !filter.group\n ? {\n ...trimmedFilter,\n value: String(filter.value).trim(),\n group: 'all',\n label: 'All',\n id: uuidv4(),\n }\n : {\n ...trimmedFilter,\n value: String(filter.value).trim(),\n id: uuidv4(),\n label: (column && column.filterLabel) || trimmedFilter.label,\n originalProperty: column.originalProperty || column.property,\n customValue: getFilterValue(trimmedFilter, column),\n };\n /* eslint-enable indent */\n setFilters((prevFilters) => {\n // This was setted for an issue that was recalling this function on the handleFiltersChange\n if (hasBeenCalled) {\n return;\n }\n hasBeenCalled = true;\n\n const nextFilters = buildFilterArray(parsedFilter, prevFilters);\n handleFiltersChange(nextFilters, true);\n onAddFilter(parsedFilter, nextFilters, column);\n });\n };\n\n const removeFilter = ({ group, pill, nextFilters }) => {\n onRemoveFilter(group, pill.value, nextFilters);\n handleFiltersChange(nextFilters);\n };\n\n const removeAllFilters = () => {\n onRemoveAllFilters();\n handleFiltersChange([]);\n };\n return {\n actions: {\n addFilter,\n removeFilter,\n removeAllFilters,\n },\n state: {\n query: queryFromFilters,\n filters,\n },\n };\n}\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X,OAAQ,UAAU,OAAO,eAAgB,cAAc;AAAA,MACvD,kBAAkB,OAAO,oBAAoB,OAAO;AAAA,MACpD,aAAa,eAAe,eAAe,MAAM;AAAA,IACnD;AAEJ,eAAW,CAAC,gBAAgB;AAE1B,UAAI,eAAe;AACjB;AAAA,MACF;AACA,sBAAgB;AAEhB,YAAM,cAAc,iBAAiB,cAAc,WAAW;AAC9D,0BAAoB,aAAa,IAAI;AACrC,kBAAY,cAAc,aAAa,MAAM;AAAA,IAC/C,CAAC;AAAA,EACH;AAEA,QAAM,eAAe,CAAC,EAAE,OAAO,MAAM,YAAY,MAAM;AACrD,mBAAe,OAAO,KAAK,OAAO,WAAW;AAC7C,wBAAoB,WAAW;AAAA,EACjC;AAEA,QAAM,mBAAmB,MAAM;AAC7B,uBAAmB;AACnB,wBAAoB,CAAC,CAAC;AAAA,EACxB;AACA,SAAO;AAAA,IACL,SAAS;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,OAAO;AAAA,MACL,OAAO;AAAA,MACP;AAAA,IACF;AAAA,EACF;AACF;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/grouping-by/GroupingByPlugin.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/grouping-by/GroupingByPlugin.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { createInstancePlugin } from '@elliemae/ds-shared';\nimport { groupBy } from 'lodash';\n\nconst groupedByData = (groupedBy, composedRows) => {\n const grouped = groupBy(composedRows, groupedBy);\n return Object.keys(grouped).map((c, key) => ({\n id: `grouped-by-${groupedBy}-${key}`,\n key: groupedBy,\n value: c,\n children: grouped[c],\n _isGroup: true,\n isGroup: true,\n }));\n};\n\nexport const GroupingByPlugin = createInstancePlugin('groupedByRows', {\n decorateGrid(grid) {\n const {\n composedRows,\n props: { groupedBy },\n } = grid.getInstance();\n grid.composedRows = groupedBy ? groupedByData(groupedBy, composedRows) : composedRows;\n return grid;\n },\n});\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,4BAA4B;AACrC,SAAS,eAAe;AAExB,MAAM,gBAAgB,CAAC,WAAW,iBAAiB;AACjD,QAAM,UAAU,QAAQ,cAAc,SAAS;AAC/C,SAAO,OAAO,KAAK,OAAO,EAAE,IAAI,CAAC,GAAG,SAAS;AAAA,IAC3C,IAAI,cAAc,aAAa;AAAA,IAC/B,KAAK;AAAA,IACL,OAAO;AAAA,IACP,UAAU,QAAQ,CAAC;AAAA,IACnB,UAAU;AAAA,IACV,SAAS;AAAA,EACX,EAAE;AACJ;AAEO,MAAM,mBAAmB,qBAAqB,iBAAiB;AAAA,EACpE,aAAa,MAAM;AACjB,UAAM;AAAA,MACJ;AAAA,MACA,OAAO,EAAE,UAAU;AAAA,IACrB,IAAI,KAAK,YAAY;AACrB,SAAK,eAAe,YAAY,cAAc,WAAW,YAAY,IAAI;AACzE,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/grouping-grid/GroupingPlugin.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/grouping-grid/GroupingPlugin.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable no-underscore-dangle */\nimport React, { useMemo } from 'react';\nimport { createInstancePlugin } from '@elliemae/ds-shared';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { VariableSizeList } from 'react-window';\nimport { walkTreeStrategy } from './walkStrategy.js';\nimport { RowSizes } from '../../rowSizes.js';\nimport { dataGridBlockName } from '../../blockNames.js';\n\nconst blockName = `${dataGridBlockName}-group-row-header`;\nconst GroupRowHeaderWrapper = aggregatedClasses('div')(blockName);\nconst GroupRowHeaderTitle = aggregatedClasses('div')(blockName, 'title');\n\nexport const GroupingPlugin = createInstancePlugin('groupedRows', {\n decorateGrid(grid) {\n const { columns, composedRows } = grid.getInstance();\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const detailColumns = useMemo(\n () =>\n columns\n .map((column) => ({\n ...column,\n customRenderer: column.detailCustomRenderer,\n }))\n .filter((col) => !col.expandableColumn),\n [columns],\n );\n const flatRows = [];\n walkTreeStrategy({\n data: composedRows,\n cb: (n) => flatRows.push(n),\n });\n return {\n detailColumns,\n composedRows: flatRows,\n };\n },\n getBodyProps(bodyProps, grid) {\n const { composedRows: rows } = grid.getInstance();\n // implementation of expandable row single column with aggregation\n const getItemSize = (index) => {\n const rowData = rows[index];\n if (!rowData) return RowSizes.normal;\n return rowData._isGroup || rowData.isGroup ? RowSizes.compact : RowSizes.normal;\n };\n // eslint-disable-next-line no-unused-vars\n const getListHeight = () => {\n const size = rows.reduce((h, r) => {\n const rowHeight = r._isGroup || r.isGroup ? RowSizes.compact : RowSizes.normal;\n return h + rowHeight;\n }, 0);\n return size;\n };\n return {\n ...bodyProps,\n getListHeight,\n listComponent: VariableSizeList,\n listProps: { itemSize: getItemSize },\n };\n },\n composeRows: (rows, grid) => {\n const {\n composedRows,\n props: { rowKey },\n } = grid.getInstance();\n\n if (Array.isArray(rows)) {\n const filterIds = rows.map((r) => r.data[rowKey]);\n return composedRows\n .filter((c) => filterIds.includes(c.data[rowKey]))\n .map((r) => ({\n ...r.data,\n children: Array.isArray(r.data.children)\n ? r.data.children.filter((c) => filterIds.includes(c[rowKey]))\n : r.data.children,\n _isGroup: r.isGroup,\n }))\n .filter((g) => g.children === undefined || g.children.length > 0);\n }\n return {\n ...rows,\n allRows: rows.allRows.map((r) => ({\n ...r.data,\n _isGroup: r.isGroup,\n })),\n rows: rows.rows.map((r) => ({\n ...r.data,\n _isGroup: r.isGroup,\n })),\n };\n },\n decorateRenderers(renderers, grid) {\n const Row = renderers.body.row;\n // eslint-disable-next-line react-hooks/rules-of-hooks\n renderers.body.row = useMemo(\n () =>\n // eslint-disable-next-line react/display-name\n // eslint-disable-next-line react/prop-types\n function ({ isExpanded, ...rowProps }) {\n const { composedRows } = grid.getInstance();\n // // https://jira.elliemae.io/browse/PUI-1667\n const node = composedRows[rowProps.index] ? composedRows[rowProps.index] : rowProps.rowData;\n const { groupedRowsRenderHeader } = grid.props;\n // eslint-disable-next-line no-underscore-dangle\n if (node && node._isGroup) {\n return (\n <>\n <GroupRowHeaderWrapper {...rowProps}>\n <GroupRowHeaderTitle>\n {groupedRowsRenderHeader ? groupedRowsRenderHeader(node) : 'Group'}\n </GroupRowHeaderTitle>\n </GroupRowHeaderWrapper>\n </>\n );\n }\n return <Row {...rowProps} />;\n },\n [],\n );\n\n return renderers;\n },\n});\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;AC2GT,mBAEI,WAFJ;AAzGd,SAAgB,eAAe;AAC/B,SAAS,4BAA4B;AACrC,SAAS,yBAAyB;AAClC,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AACjC,SAAS,gBAAgB;AACzB,SAAS,yBAAyB;AAElC,MAAM,YAAY,GAAG;AACrB,MAAM,wBAAwB,kBAAkB,KAAK,EAAE,SAAS;AAChE,MAAM,sBAAsB,kBAAkB,KAAK,EAAE,WAAW,OAAO;AAEhE,MAAM,iBAAiB,qBAAqB,eAAe;AAAA,EAChE,aAAa,MAAM;AACjB,UAAM,EAAE,SAAS,aAAa,IAAI,KAAK,YAAY;AAEnD,UAAM,gBAAgB;AAAA,MACpB,MACE,QACG,IAAI,CAAC,YAAY;AAAA,QAChB,GAAG;AAAA,QACH,gBAAgB,OAAO;AAAA,MACzB,EAAE,EACD,OAAO,CAAC,QAAQ,CAAC,IAAI,gBAAgB;AAAA,MAC1C,CAAC,OAAO;AAAA,IACV;AACA,UAAM,WAAW,CAAC;AAClB,qBAAiB;AAAA,MACf,MAAM;AAAA,MACN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AAM,EAAE,aAAa,UAAa,EAAE,SAAS,SAAS,CAAC;AAAA,IACpE;AACA,WAAO;AAAA,MACL,GAAG;AAAA,MACH,SAAS,KAAK,QAAQ,IAAI,CAAC,OAAO;AAAA,QAChC,GAAG,EAAE;AAAA,QACL,UAAU,EAAE;AAAA,MACd,EAAE;AAAA,MACF,MAAM,KAAK,KAAK,IAAI,CAAC,OAAO;AAAA,QAC1B,GAAG,EAAE;AAAA,QACL,UAAU,EAAE;AAAA,MACd,EAAE;AAAA,IACJ;AAAA,EACF;AAAA,EACA,kBAAkB,WAAW,MAAM;AACjC,UAAM,MAAM,UAAU,KAAK;AAE3B,cAAU,KAAK,MAAM;AAAA,MACnB;AAAA;AAAA;AAAA,QAGE,SAAU,EAAE,YAAY,GAAG,SAAS,GAAG;AACrC,gBAAM,EAAE,aAAa,IAAI,KAAK,YAAY;AAE1C,gBAAM,OAAO,aAAa,SAAS,KAAK,IAAI,aAAa,SAAS,KAAK,IAAI,SAAS;AACpF,gBAAM,EAAE,wBAAwB,IAAI,KAAK;AAEzC,cAAI,QAAQ,KAAK,UAAU;AACzB,mBACE,gCACE,8BAAC,yBAAuB,GAAG,UACzB,8BAAC,uBACE,oCAA0B,wBAAwB,IAAI,IAAI,SAC7D,GACF,GACF;AAAA,UAEJ;AACA,iBAAO,oBAAC,OAAK,GAAG,UAAU;AAAA,QAC5B;AAAA;AAAA,MACF,CAAC;AAAA,IACH;AAEA,WAAO;AAAA,EACT;AACF,CAAC;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/grouping-grid/walkStrategy.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/grouping-grid/walkStrategy.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "function getPath(parentNode, index, childrenKey) {\n if (!parentNode) return [index];\n return [...parentNode.path, childrenKey, index];\n}\n\nexport function walkTreeStrategy({\n data,\n childrenKey = 'children',\n level = 0,\n getId = (item) => item.id,\n parentNode,\n shouldWalkChildren = () => true,\n cb,\n}) {\n // eslint-disable-next-line no-loops/no-loops,no-plusplus\n for (let i = 0; i < data.length; i++) {\n const currLevel = level + 1;\n const children = data[i][childrenKey];\n const isGroup = children && !!children.length;\n const node = {\n index: i,\n id: getId(data[i]),\n data: data[i],\n path: getPath(parentNode, i, childrenKey),\n isGroup,\n nestingLevel: currLevel,\n parentNode: parentNode || {\n isGroup: true,\n data: { children: data },\n },\n };\n cb(node);\n if (shouldWalkChildren(node) && children && children.length) {\n walkTreeStrategy({\n data: children,\n level: currLevel,\n parentNode: node,\n shouldWalkChildren,\n cb,\n });\n }\n }\n}\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,YAAY,OAAO,aAAa;AAC/C,MAAI,CAAC;AAAY,WAAO,CAAC,KAAK;AAC9B,SAAO,CAAC,GAAG,WAAW,MAAM,aAAa,KAAK;AAChD;AAEO,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,QAAQ,CAAC,SAAS,KAAK;AAAA,EACvB;AAAA,EACA,qBAAqB,MAAM;AAAA,EAC3B;AACF,GAAG;AAED,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,UAAM,YAAY,QAAQ;AAC1B,UAAM,WAAW,KAAK,CAAC,EAAE,WAAW;AACpC,UAAM,UAAU,YAAY,CAAC,CAAC,SAAS;AACvC,UAAM,OAAO;AAAA,MACX,OAAO;AAAA,MACP,IAAI,MAAM,KAAK,CAAC,CAAC;AAAA,MACjB,MAAM,KAAK,CAAC;AAAA,MACZ,MAAM,QAAQ,YAAY,GAAG,WAAW;AAAA,MACxC;AAAA,MACA,cAAc;AAAA,MACd,YAAY,cAAc;AAAA,QACxB,SAAS;AAAA,QACT,MAAM,EAAE,UAAU,KAAK;AAAA,MACzB;AAAA,IACF;AACA,OAAG,IAAI;AACP,QAAI,mBAAmB,IAAI,KAAK,YAAY,SAAS,QAAQ;AAC3D,uBAAiB;AAAA,QACf,MAAM;AAAA,QACN,OAAO;AAAA,QACP,YAAY;AAAA,QACZ;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/plugins/index.tsx"],
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/plugins/index.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { BodyHeaderScrollSyncPlugin } from './body-header-scroll-sync/index.js';\nexport { DndColumnsPlugin } from './column-dnd/index.js';\nexport { ColumnSizingPlugin } from './column-sizing/index.js';\nexport { CustomRendererPlugin } from './custom-cell-renderer/index.js';\nexport { EditablePlugin, ComboBox, TextBox } from './editable/index.js';\nexport { ExpandableColumn, ExpandablePlugin } from './expandable-grid/index.js';\nexport { FilterablePlugin } from './filterable/index.js';\nexport { InfiniteScrollPlugin } from './infinite-scrolling/index.js';\nexport { PaginationPlugin } from './pagination/index.js';\nexport { ResizablePlugin } from './resizable/index.js';\nexport { DndRowsPlugin } from './row-dnd/index.js';\nexport { SelectablePlugin } from './selectable/index.js';\nexport { SortablePlugin } from './sortable/index.js';\nexport { ToolbarPlugin } from './toolbar/index.js';\nexport { ExportDataPlugin } from './export-data/index.js';\nexport { VirtualizationPlugin } from './virtualization/index.js';\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,kCAAkC;AAC3C,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC,SAAS,4BAA4B;AACrC,SAAS,gBAAgB,UAAU,eAAe;AAClD,SAAS,kBAAkB,wBAAwB;AACnD,SAAS,wBAAwB;AACjC,SAAS,4BAA4B;AACrC,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAC9B,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB;AAC9B,SAAS,wBAAwB;AACjC,SAAS,4BAA4B;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/infinite-scrolling/InfiniteScrollPlugin.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/infinite-scrolling/InfiniteScrollPlugin.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useRef, useEffect, useState } from 'react';\nimport { createInstancePlugin } from '@elliemae/ds-shared';\n\n// TODO: EXPORT A SEPARATED INFINITE LOADER GRID\n\nconst registerStateHook = (grid) => {\n const {\n props: { getData, onInfiniteScrolling = () => null },\n actions: { updateRows },\n } = grid;\n\n const loading = useRef(false);\n\n const addMoreData = (data = []) => {\n loading.current = false;\n updateRows((prevRows) => prevRows.concat(data || []));\n };\n\n const doLoadData = async (currentRows) => {\n loading.current = true;\n return Promise.resolve(getData(currentRows)).then(addMoreData);\n };\n\n const loadMoreData = (currentRows) => {\n onInfiniteScrolling(currentRows);\n if (loading.current || !getData) return;\n doLoadData(currentRows);\n };\n\n return {\n actions: {\n loadMoreData,\n },\n };\n};\n\nconst getBodyProps = ({ children, ...props }, grid) => {\n const { loadMoreData } = grid.getInstance().actions;\n\n const [bodyNode, setBodyRef] = useState();\n const prevScroll = useRef();\n prevScroll.current = 0;\n\n const handleBodyScroll = (event, s) => {\n const { target } = event;\n const { scrollHeight, scrollTop, offsetHeight, scrollLeft } = target;\n const { composedRows } = grid.getInstance();\n // prevent horizontal scroll triggering infinite scrolling callbacks\n if (prevScroll.current !== scrollLeft) {\n prevScroll.current = scrollLeft;\n return;\n }\n // todo: clean this. Better approach using another component for the infinite scroll\n if (bodyNode !== target) return;\n if (scrollTop + offsetHeight >= scrollHeight - 1) {\n loadMoreData(composedRows);\n }\n };\n\n useEffect(() => {\n if (bodyNode) {\n bodyNode.addEventListener('scroll', handleBodyScroll);\n }\n return () => {\n if (bodyNode) {\n bodyNode.removeEventListener('scroll', handleBodyScroll);\n }\n };\n }, [bodyNode]);\n\n return {\n ...props,\n listProps: { outerRef: setBodyRef },\n };\n};\n\nexport const InfiniteScrollPlugin = createInstancePlugin('infinite-scroll', {\n registerStateHook,\n getBodyProps,\n});\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,WAAW,gBAAgB;AAC5C,SAAS,4BAA4B;AAIrC,MAAM,oBAAoB,CAAC,SAAS;AAClC,QAAM;AAAA,IACJ,OAAO,EAAE,SAAS,sBAAsB,MAAM,KAAK;AAAA,IACnD,SAAS,EAAE,WAAW;AAAA,EACxB,IAAI;AAEJ,QAAM,UAAU,OAAO,KAAK;AAE5B,QAAM,cAAc,CAAC,OAAO,CAAC,MAAM;AACjC,YAAQ,UAAU;AAClB,eAAW,CAAC,aAAa,SAAS,OAAO,QAAQ,CAAC,CAAC,CAAC;AAAA,EACtD;AAEA,QAAM,aAAa,OAAO,gBAAgB;AACxC,YAAQ,UAAU;AAClB,WAAO,QAAQ,QAAQ,QAAQ,WAAW,CAAC,EAAE,KAAK,WAAW;AAAA,EAC/D;AAEA,QAAM,eAAe,CAAC,gBAAgB;AACpC,wBAAoB,WAAW;AAC/B,QAAI,QAAQ,WAAW,CAAC;AAAS;AACjC,eAAW,WAAW;AAAA,EACxB;AAEA,SAAO;AAAA,IACL,SAAS;AAAA,MACP;AAAA,IACF;AAAA,EACF;AACF;AAEA,MAAM,eAAe,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS;AACrD,QAAM,EAAE,aAAa,IAAI,KAAK,YAAY,EAAE;AAE5C,QAAM,CAAC,UAAU,UAAU,IAAI,SAAS;AACxC,QAAM,aAAa,OAAO;AAC1B,aAAW,UAAU;AAErB,QAAM,mBAAmB,CAAC,OAAO,MAAM;AACrC,UAAM,EAAE,OAAO,IAAI;AACnB,UAAM,EAAE,cAAc,WAAW,cAAc,WAAW,IAAI;AAC9D,UAAM,EAAE,aAAa,IAAI,KAAK,YAAY;AAE1C,QAAI,WAAW,YAAY,YAAY;AACrC,iBAAW,UAAU;AACrB;AAAA,IACF;AAEA,QAAI,aAAa;AAAQ;AACzB,QAAI,YAAY,gBAAgB,eAAe,GAAG;AAChD,mBAAa,YAAY;AAAA,IAC3B;AAAA,EACF;AAEA,YAAU,MAAM;AACd,QAAI,UAAU;AACZ,eAAS,iBAAiB,UAAU,gBAAgB;AAAA,IACtD;AACA,WAAO,MAAM;AACX,UAAI,UAAU;AACZ,iBAAS,oBAAoB,UAAU,gBAAgB;AAAA,MACzD;AAAA,IACF;AAAA,EACF,GAAG,CAAC,QAAQ,CAAC;AAEb,SAAO;AAAA,IACL,GAAG;AAAA,IACH,WAAW,EAAE,UAAU,WAAW;AAAA,EACpC;AACF;AAEO,MAAM,uBAAuB,qBAAqB,mBAAmB;AAAA,EAC1E;AAAA,EACA;AACF,CAAC;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/infinite-scrolling/index.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/infinite-scrolling/index.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { InfiniteScrollPlugin } from './InfiniteScrollPlugin.js';\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,4BAA4B;",
6
6
  "names": []