@elliemae/ds-datagrids 3.16.0-rc.4 → 3.16.0-rc.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (468) hide show
  1. package/dist/cjs/DSDataGrid.js +145 -2
  2. package/dist/cjs/DSDataGrid.js.map +2 -2
  3. package/dist/cjs/DataGridImpl.js +15 -11
  4. package/dist/cjs/DataGridImpl.js.map +2 -2
  5. package/dist/cjs/PaginatedDataGrid.js +13 -9
  6. package/dist/cjs/PaginatedDataGrid.js.map +2 -2
  7. package/dist/cjs/blockNames.js +4 -0
  8. package/dist/cjs/blockNames.js.map +1 -1
  9. package/dist/cjs/columns/IconColumn.js +4 -0
  10. package/dist/cjs/columns/IconColumn.js.map +1 -1
  11. package/dist/cjs/columns/NumberColumn.js +4 -0
  12. package/dist/cjs/columns/NumberColumn.js.map +1 -1
  13. package/dist/cjs/components/BodyCell.js +6 -0
  14. package/dist/cjs/components/BodyCell.js.map +1 -1
  15. package/dist/cjs/components/BodyList.js +7 -5
  16. package/dist/cjs/components/BodyList.js.map +2 -2
  17. package/dist/cjs/components/ColumnVisibilityMenuOption.js +5 -6
  18. package/dist/cjs/components/ColumnVisibilityMenuOption.js.map +2 -2
  19. package/dist/cjs/components/ColumnsOptionsMenuSection.js +7 -11
  20. package/dist/cjs/components/ColumnsOptionsMenuSection.js.map +2 -2
  21. package/dist/cjs/components/EmptyState.js +9 -6
  22. package/dist/cjs/components/EmptyState.js.map +3 -3
  23. package/dist/cjs/components/HeaderCell.js +4 -0
  24. package/dist/cjs/components/HeaderCell.js.map +1 -1
  25. package/dist/cjs/components/List.js +6 -2
  26. package/dist/cjs/components/List.js.map +2 -2
  27. package/dist/cjs/components/ListItem.js +7 -6
  28. package/dist/cjs/components/ListItem.js.map +2 -2
  29. package/dist/cjs/components/NoResults.js +8 -10
  30. package/dist/cjs/components/NoResults.js.map +2 -2
  31. package/dist/cjs/components/RowsLoader.js +5 -1
  32. package/dist/cjs/components/RowsLoader.js.map +2 -2
  33. package/dist/cjs/components/Table.js +9 -5
  34. package/dist/cjs/components/Table.js.map +2 -2
  35. package/dist/cjs/components/TableBody.js +6 -7
  36. package/dist/cjs/components/TableBody.js.map +2 -2
  37. package/dist/cjs/components/TableHeader.js +5 -1
  38. package/dist/cjs/components/TableHeader.js.map +2 -2
  39. package/dist/cjs/components/footer/addOptionalFooterComponents.js +5 -1
  40. package/dist/cjs/components/footer/addOptionalFooterComponents.js.map +2 -2
  41. package/dist/cjs/components/header/PrimaryControls.js +4 -0
  42. package/dist/cjs/components/header/PrimaryControls.js.map +1 -1
  43. package/dist/cjs/components/header/addOptionalHeaderComponents.js +4 -0
  44. package/dist/cjs/components/header/addOptionalHeaderComponents.js.map +1 -1
  45. package/dist/cjs/components/index.js +9 -5
  46. package/dist/cjs/components/index.js.map +2 -2
  47. package/dist/cjs/components/renderers/defaultClassedRenderers.js +20 -36
  48. package/dist/cjs/components/renderers/defaultClassedRenderers.js.map +2 -2
  49. package/dist/cjs/components/renderers/index.js +6 -2
  50. package/dist/cjs/components/renderers/index.js.map +2 -2
  51. package/dist/cjs/components/renderers/renderRowsLoader.js +6 -4
  52. package/dist/cjs/components/renderers/renderRowsLoader.js.map +2 -2
  53. package/dist/cjs/components/tableContext.js +4 -0
  54. package/dist/cjs/components/tableContext.js.map +1 -1
  55. package/dist/cjs/defaultPlugins.js +9 -10
  56. package/dist/cjs/defaultPlugins.js.map +2 -2
  57. package/dist/cjs/index.js +13 -9
  58. package/dist/cjs/index.js.map +2 -2
  59. package/dist/cjs/package.json +7 -0
  60. package/dist/cjs/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js +26 -18
  61. package/dist/cjs/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js.map +2 -2
  62. package/dist/cjs/plugins/body-header-scroll-sync/index.js +5 -1
  63. package/dist/cjs/plugins/body-header-scroll-sync/index.js.map +2 -2
  64. package/dist/cjs/plugins/column-dnd/DndColumnsPlugin.js +5 -1
  65. package/dist/cjs/plugins/column-dnd/DndColumnsPlugin.js.map +2 -2
  66. package/dist/cjs/plugins/column-dnd/decorateGridWithDndColumns.js +4 -0
  67. package/dist/cjs/plugins/column-dnd/decorateGridWithDndColumns.js.map +1 -1
  68. package/dist/cjs/plugins/column-dnd/index.js +5 -1
  69. package/dist/cjs/plugins/column-dnd/index.js.map +2 -2
  70. package/dist/cjs/plugins/column-sizing/ColumnSizingPlugin.js +8 -4
  71. package/dist/cjs/plugins/column-sizing/ColumnSizingPlugin.js.map +2 -2
  72. package/dist/cjs/plugins/column-sizing/columnMeasurerTransformer.js +4 -0
  73. package/dist/cjs/plugins/column-sizing/columnMeasurerTransformer.js.map +1 -1
  74. package/dist/cjs/plugins/column-sizing/ext-points/decorateColumn.js +5 -1
  75. package/dist/cjs/plugins/column-sizing/ext-points/decorateColumn.js.map +2 -2
  76. package/dist/cjs/plugins/column-sizing/ext-points/getTableProps.js +5 -1
  77. package/dist/cjs/plugins/column-sizing/ext-points/getTableProps.js.map +2 -2
  78. package/dist/cjs/plugins/column-sizing/getColumnNameFromProperty.js +4 -0
  79. package/dist/cjs/plugins/column-sizing/getColumnNameFromProperty.js.map +1 -1
  80. package/dist/cjs/plugins/column-sizing/index.js +5 -1
  81. package/dist/cjs/plugins/column-sizing/index.js.map +2 -2
  82. package/dist/cjs/plugins/column-sizing/useColumnSizeService.js +11 -26
  83. package/dist/cjs/plugins/column-sizing/useColumnSizeService.js.map +2 -2
  84. package/dist/cjs/plugins/column-sizing/useStylesheetHelpers.js +7 -2
  85. package/dist/cjs/plugins/column-sizing/useStylesheetHelpers.js.map +2 -2
  86. package/dist/cjs/plugins/column-sizing/utils.js +4 -0
  87. package/dist/cjs/plugins/column-sizing/utils.js.map +1 -1
  88. package/dist/cjs/plugins/custom-cell-renderer/CustomRendererPlugin.js +5 -1
  89. package/dist/cjs/plugins/custom-cell-renderer/CustomRendererPlugin.js.map +2 -2
  90. package/dist/cjs/plugins/custom-cell-renderer/addCustomRendererToCell.js +6 -1
  91. package/dist/cjs/plugins/custom-cell-renderer/addCustomRendererToCell.js.map +2 -2
  92. package/dist/cjs/plugins/custom-cell-renderer/getRendererComponent.js +5 -1
  93. package/dist/cjs/plugins/custom-cell-renderer/getRendererComponent.js.map +2 -2
  94. package/dist/cjs/plugins/custom-cell-renderer/index.js +5 -1
  95. package/dist/cjs/plugins/custom-cell-renderer/index.js.map +2 -2
  96. package/dist/cjs/plugins/editable/EditableComponents/ComboBox.js +4 -0
  97. package/dist/cjs/plugins/editable/EditableComponents/ComboBox.js.map +2 -2
  98. package/dist/cjs/plugins/editable/EditableComponents/TextBox.js +4 -0
  99. package/dist/cjs/plugins/editable/EditableComponents/TextBox.js.map +2 -2
  100. package/dist/cjs/plugins/editable/EditableComponents/index.js +6 -2
  101. package/dist/cjs/plugins/editable/EditableComponents/index.js.map +2 -2
  102. package/dist/cjs/plugins/editable/EditablePlugin.js +5 -1
  103. package/dist/cjs/plugins/editable/EditablePlugin.js.map +2 -2
  104. package/dist/cjs/plugins/editable/decorateEditable.js +5 -1
  105. package/dist/cjs/plugins/editable/decorateEditable.js.map +2 -2
  106. package/dist/cjs/plugins/editable/getEditorComponent.js +7 -16
  107. package/dist/cjs/plugins/editable/getEditorComponent.js.map +2 -2
  108. package/dist/cjs/plugins/editable/index.js +6 -2
  109. package/dist/cjs/plugins/editable/index.js.map +2 -2
  110. package/dist/cjs/plugins/expandable-grid/ExpandableColumn.js +27 -25
  111. package/dist/cjs/plugins/expandable-grid/ExpandableColumn.js.map +2 -2
  112. package/dist/cjs/plugins/expandable-grid/ExpandablePlugin.js +9 -5
  113. package/dist/cjs/plugins/expandable-grid/ExpandablePlugin.js.map +2 -2
  114. package/dist/cjs/plugins/expandable-grid/ExpandedRow.js +10 -6
  115. package/dist/cjs/plugins/expandable-grid/ExpandedRow.js.map +2 -2
  116. package/dist/cjs/plugins/expandable-grid/ExpandedRowExtra.js +16 -8
  117. package/dist/cjs/plugins/expandable-grid/ExpandedRowExtra.js.map +2 -2
  118. package/dist/cjs/plugins/expandable-grid/index.js +6 -2
  119. package/dist/cjs/plugins/expandable-grid/index.js.map +2 -2
  120. package/dist/cjs/plugins/expandable-grid/useExpandGridState.js +4 -0
  121. package/dist/cjs/plugins/expandable-grid/useExpandGridState.js.map +2 -2
  122. package/dist/cjs/plugins/export-data/ExportDataPlugin.js +4 -0
  123. package/dist/cjs/plugins/export-data/ExportDataPlugin.js.map +1 -1
  124. package/dist/cjs/plugins/export-data/index.js +5 -1
  125. package/dist/cjs/plugins/export-data/index.js.map +2 -2
  126. package/dist/cjs/plugins/filterable/FilterablePlugin.js +7 -3
  127. package/dist/cjs/plugins/filterable/FilterablePlugin.js.map +2 -2
  128. package/dist/cjs/plugins/filterable/addFilterToColumn.js +5 -1
  129. package/dist/cjs/plugins/filterable/addFilterToColumn.js.map +2 -2
  130. package/dist/cjs/plugins/filterable/components/FilterableHeader.js +5 -1
  131. package/dist/cjs/plugins/filterable/components/FilterableHeader.js.map +2 -2
  132. package/dist/cjs/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js +50 -47
  133. package/dist/cjs/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js.map +2 -2
  134. package/dist/cjs/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js +50 -48
  135. package/dist/cjs/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js.map +2 -2
  136. package/dist/cjs/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js +48 -45
  137. package/dist/cjs/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js.map +2 -2
  138. package/dist/cjs/plugins/filterable/components/filterable-menus/TextFilterMenu.js +7 -3
  139. package/dist/cjs/plugins/filterable/components/filterable-menus/TextFilterMenu.js.map +2 -2
  140. package/dist/cjs/plugins/filterable/components/filterable-menus/defaultDateFormat.js +4 -0
  141. package/dist/cjs/plugins/filterable/components/filterable-menus/defaultDateFormat.js.map +1 -1
  142. package/dist/cjs/plugins/filterable/components/filterable-menus/getFilterMenuByType.js +9 -7
  143. package/dist/cjs/plugins/filterable/components/filterable-menus/getFilterMenuByType.js.map +2 -2
  144. package/dist/cjs/plugins/filterable/filterableFormatter.js +33 -37
  145. package/dist/cjs/plugins/filterable/filterableFormatter.js.map +2 -2
  146. package/dist/cjs/plugins/filterable/filtering-helper/filterRowsByQuery.js +6 -4
  147. package/dist/cjs/plugins/filterable/filtering-helper/filterRowsByQuery.js.map +2 -2
  148. package/dist/cjs/plugins/filterable/filtering-helper/strategiesOperators.js +4 -0
  149. package/dist/cjs/plugins/filterable/filtering-helper/strategiesOperators.js.map +2 -2
  150. package/dist/cjs/plugins/filterable/helper.js +4 -0
  151. package/dist/cjs/plugins/filterable/helper.js.map +2 -2
  152. package/dist/cjs/plugins/filterable/index.js +5 -1
  153. package/dist/cjs/plugins/filterable/index.js.map +2 -2
  154. package/dist/cjs/plugins/filterable/useFilterableState.js +7 -7
  155. package/dist/cjs/plugins/filterable/useFilterableState.js.map +2 -2
  156. package/dist/cjs/plugins/grouping-by/GroupingByPlugin.js +4 -0
  157. package/dist/cjs/plugins/grouping-by/GroupingByPlugin.js.map +1 -1
  158. package/dist/cjs/plugins/grouping-grid/GroupingPlugin.js +19 -11
  159. package/dist/cjs/plugins/grouping-grid/GroupingPlugin.js.map +2 -2
  160. package/dist/cjs/plugins/grouping-grid/walkStrategy.js +4 -0
  161. package/dist/cjs/plugins/grouping-grid/walkStrategy.js.map +2 -2
  162. package/dist/cjs/plugins/index.js +20 -16
  163. package/dist/cjs/plugins/index.js.map +2 -2
  164. package/dist/cjs/plugins/infinite-scrolling/InfiniteScrollPlugin.js +4 -0
  165. package/dist/cjs/plugins/infinite-scrolling/InfiniteScrollPlugin.js.map +1 -1
  166. package/dist/cjs/plugins/infinite-scrolling/index.js +5 -1
  167. package/dist/cjs/plugins/infinite-scrolling/index.js.map +2 -2
  168. package/dist/cjs/plugins/pagination/PaginationPlugin.js +9 -4
  169. package/dist/cjs/plugins/pagination/PaginationPlugin.js.map +2 -2
  170. package/dist/cjs/plugins/pagination/components/Pagination.js +9 -24
  171. package/dist/cjs/plugins/pagination/components/Pagination.js.map +2 -2
  172. package/dist/cjs/plugins/pagination/components/Paginator.js +15 -10
  173. package/dist/cjs/plugins/pagination/components/Paginator.js.map +2 -2
  174. package/dist/cjs/plugins/pagination/components/PerPageDropdown.js +6 -2
  175. package/dist/cjs/plugins/pagination/components/PerPageDropdown.js.map +2 -2
  176. package/dist/cjs/plugins/pagination/helper.js +4 -0
  177. package/dist/cjs/plugins/pagination/helper.js.map +2 -2
  178. package/dist/cjs/plugins/pagination/index.js +5 -1
  179. package/dist/cjs/plugins/pagination/index.js.map +2 -2
  180. package/dist/cjs/plugins/pagination/usePaginationState.js +5 -1
  181. package/dist/cjs/plugins/pagination/usePaginationState.js.map +2 -2
  182. package/dist/cjs/plugins/resizable/ResizablePlugin.js +5 -1
  183. package/dist/cjs/plugins/resizable/ResizablePlugin.js.map +2 -2
  184. package/dist/cjs/plugins/resizable/decorateResizable.js +8 -2
  185. package/dist/cjs/plugins/resizable/decorateResizable.js.map +2 -2
  186. package/dist/cjs/plugins/resizable/index.js +5 -1
  187. package/dist/cjs/plugins/resizable/index.js.map +2 -2
  188. package/dist/cjs/plugins/resizable/useResizeHandle.js +10 -13
  189. package/dist/cjs/plugins/resizable/useResizeHandle.js.map +2 -2
  190. package/dist/cjs/plugins/resizable/utils.js +4 -0
  191. package/dist/cjs/plugins/resizable/utils.js.map +1 -1
  192. package/dist/cjs/plugins/row-dnd/DndRowsPlugin.js +5 -0
  193. package/dist/cjs/plugins/row-dnd/DndRowsPlugin.js.map +1 -1
  194. package/dist/cjs/plugins/row-dnd/index.js +5 -1
  195. package/dist/cjs/plugins/row-dnd/index.js.map +2 -2
  196. package/dist/cjs/plugins/selectable/SelectablePlugin.js +7 -3
  197. package/dist/cjs/plugins/selectable/SelectablePlugin.js.map +2 -2
  198. package/dist/cjs/plugins/selectable/addSelectableColumn.js +7 -1
  199. package/dist/cjs/plugins/selectable/addSelectableColumn.js.map +2 -2
  200. package/dist/cjs/plugins/selectable/helper.js +4 -0
  201. package/dist/cjs/plugins/selectable/helper.js.map +1 -1
  202. package/dist/cjs/plugins/selectable/index.js +5 -1
  203. package/dist/cjs/plugins/selectable/index.js.map +2 -2
  204. package/dist/cjs/plugins/selectable/selectableFormatter.js +5 -1
  205. package/dist/cjs/plugins/selectable/selectableFormatter.js.map +2 -2
  206. package/dist/cjs/plugins/selectable/useSelectableState.js +7 -1
  207. package/dist/cjs/plugins/selectable/useSelectableState.js.map +2 -2
  208. package/dist/cjs/plugins/sortable/SortablePlugin.js +7 -3
  209. package/dist/cjs/plugins/sortable/SortablePlugin.js.map +2 -2
  210. package/dist/cjs/plugins/sortable/checkIfSortable.js +4 -0
  211. package/dist/cjs/plugins/sortable/checkIfSortable.js.map +1 -1
  212. package/dist/cjs/plugins/sortable/index.js +5 -1
  213. package/dist/cjs/plugins/sortable/index.js.map +2 -2
  214. package/dist/cjs/plugins/sortable/sortHeaderFormatter.js +4 -0
  215. package/dist/cjs/plugins/sortable/sortHeaderFormatter.js.map +1 -1
  216. package/dist/cjs/plugins/sortable/sortTree.js +4 -0
  217. package/dist/cjs/plugins/sortable/sortTree.js.map +2 -2
  218. package/dist/cjs/plugins/sortable/sorter.js +5 -0
  219. package/dist/cjs/plugins/sortable/sorter.js.map +1 -1
  220. package/dist/cjs/plugins/sortable/useSortableState.js +6 -4
  221. package/dist/cjs/plugins/sortable/useSortableState.js.map +2 -2
  222. package/dist/cjs/plugins/toolbar/RowRenderer.js +7 -2
  223. package/dist/cjs/plugins/toolbar/RowRenderer.js.map +2 -2
  224. package/dist/cjs/plugins/toolbar/ToolbarPlugin.js +5 -1
  225. package/dist/cjs/plugins/toolbar/ToolbarPlugin.js.map +2 -2
  226. package/dist/cjs/plugins/toolbar/ToolbarTrigger.js +5 -0
  227. package/dist/cjs/plugins/toolbar/ToolbarTrigger.js.map +1 -1
  228. package/dist/cjs/plugins/toolbar/index.js +5 -1
  229. package/dist/cjs/plugins/toolbar/index.js.map +2 -2
  230. package/dist/cjs/plugins/virtualization/AutoHeightList.js +4 -0
  231. package/dist/cjs/plugins/virtualization/AutoHeightList.js.map +2 -2
  232. package/dist/cjs/plugins/virtualization/VirtualizationPlugin.js +8 -2
  233. package/dist/cjs/plugins/virtualization/VirtualizationPlugin.js.map +2 -2
  234. package/dist/cjs/plugins/virtualization/VirtualizedBody.js +9 -4
  235. package/dist/cjs/plugins/virtualization/VirtualizedBody.js.map +2 -2
  236. package/dist/cjs/plugins/virtualization/VirtualizedBodyRow.js +5 -0
  237. package/dist/cjs/plugins/virtualization/VirtualizedBodyRow.js.map +1 -1
  238. package/dist/cjs/plugins/virtualization/helper.js +4 -0
  239. package/dist/cjs/plugins/virtualization/helper.js.map +1 -1
  240. package/dist/cjs/plugins/virtualization/index.js +5 -1
  241. package/dist/cjs/plugins/virtualization/index.js.map +2 -2
  242. package/dist/cjs/renders/CellWithAddons.js +15 -1
  243. package/dist/cjs/renders/CellWithAddons.js.map +2 -2
  244. package/dist/cjs/renders/index.js +6 -2
  245. package/dist/cjs/renders/index.js.map +2 -2
  246. package/dist/cjs/renders/styled.js +4 -0
  247. package/dist/cjs/renders/styled.js.map +1 -1
  248. package/dist/cjs/rowSizes.js +5 -5
  249. package/dist/cjs/rowSizes.js.map +2 -2
  250. package/dist/cjs/utilities/getPluginsFromProps.js +17 -13
  251. package/dist/cjs/utilities/getPluginsFromProps.js.map +2 -2
  252. package/dist/cjs/utilities/getScrollbarSize.js +4 -0
  253. package/dist/cjs/utilities/getScrollbarSize.js.map +1 -1
  254. package/dist/cjs/utilities/normalizeData.js +4 -0
  255. package/dist/cjs/utilities/normalizeData.js.map +2 -2
  256. package/dist/esm/DSDataGrid.js +141 -2
  257. package/dist/esm/DSDataGrid.js.map +2 -2
  258. package/dist/esm/DataGridImpl.js +11 -11
  259. package/dist/esm/DataGridImpl.js.map +2 -2
  260. package/dist/esm/PaginatedDataGrid.js +9 -9
  261. package/dist/esm/PaginatedDataGrid.js.map +2 -2
  262. package/dist/esm/columns/IconColumn.js.map +1 -1
  263. package/dist/esm/components/BodyCell.js +2 -0
  264. package/dist/esm/components/BodyCell.js.map +1 -1
  265. package/dist/esm/components/BodyList.js +3 -5
  266. package/dist/esm/components/BodyList.js.map +2 -2
  267. package/dist/esm/components/ColumnVisibilityMenuOption.js +1 -6
  268. package/dist/esm/components/ColumnVisibilityMenuOption.js.map +2 -2
  269. package/dist/esm/components/ColumnsOptionsMenuSection.js +3 -11
  270. package/dist/esm/components/ColumnsOptionsMenuSection.js.map +2 -2
  271. package/dist/esm/components/EmptyState.js +1 -2
  272. package/dist/esm/components/EmptyState.js.map +2 -2
  273. package/dist/esm/components/List.js +2 -2
  274. package/dist/esm/components/List.js.map +2 -2
  275. package/dist/esm/components/ListItem.js +3 -6
  276. package/dist/esm/components/ListItem.js.map +2 -2
  277. package/dist/esm/components/NoResults.js +4 -10
  278. package/dist/esm/components/NoResults.js.map +2 -2
  279. package/dist/esm/components/RowsLoader.js +1 -1
  280. package/dist/esm/components/RowsLoader.js.map +1 -1
  281. package/dist/esm/components/Table.js +5 -5
  282. package/dist/esm/components/Table.js.map +2 -2
  283. package/dist/esm/components/TableBody.js +2 -7
  284. package/dist/esm/components/TableBody.js.map +2 -2
  285. package/dist/esm/components/TableHeader.js +1 -1
  286. package/dist/esm/components/TableHeader.js.map +2 -2
  287. package/dist/esm/components/footer/addOptionalFooterComponents.js +1 -1
  288. package/dist/esm/components/footer/addOptionalFooterComponents.js.map +1 -1
  289. package/dist/esm/components/index.js +5 -5
  290. package/dist/esm/components/index.js.map +1 -1
  291. package/dist/esm/components/renderers/defaultClassedRenderers.js +16 -40
  292. package/dist/esm/components/renderers/defaultClassedRenderers.js.map +2 -2
  293. package/dist/esm/components/renderers/index.js +2 -2
  294. package/dist/esm/components/renderers/index.js.map +1 -1
  295. package/dist/esm/components/renderers/renderRowsLoader.js +2 -4
  296. package/dist/esm/components/renderers/renderRowsLoader.js.map +2 -2
  297. package/dist/esm/defaultPlugins.js +5 -10
  298. package/dist/esm/defaultPlugins.js.map +2 -2
  299. package/dist/esm/index.js +9 -9
  300. package/dist/esm/index.js.map +1 -1
  301. package/dist/esm/package.json +7 -0
  302. package/dist/esm/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js +22 -18
  303. package/dist/esm/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js.map +2 -2
  304. package/dist/esm/plugins/body-header-scroll-sync/index.js +1 -1
  305. package/dist/esm/plugins/body-header-scroll-sync/index.js.map +1 -1
  306. package/dist/esm/plugins/column-dnd/DndColumnsPlugin.js +1 -1
  307. package/dist/esm/plugins/column-dnd/DndColumnsPlugin.js.map +2 -2
  308. package/dist/esm/plugins/column-dnd/index.js +1 -1
  309. package/dist/esm/plugins/column-dnd/index.js.map +1 -1
  310. package/dist/esm/plugins/column-sizing/ColumnSizingPlugin.js +4 -4
  311. package/dist/esm/plugins/column-sizing/ColumnSizingPlugin.js.map +1 -1
  312. package/dist/esm/plugins/column-sizing/columnMeasurerTransformer.js.map +1 -1
  313. package/dist/esm/plugins/column-sizing/ext-points/decorateColumn.js +1 -1
  314. package/dist/esm/plugins/column-sizing/ext-points/decorateColumn.js.map +1 -1
  315. package/dist/esm/plugins/column-sizing/ext-points/getTableProps.js +1 -1
  316. package/dist/esm/plugins/column-sizing/ext-points/getTableProps.js.map +1 -1
  317. package/dist/esm/plugins/column-sizing/index.js +1 -1
  318. package/dist/esm/plugins/column-sizing/index.js.map +1 -1
  319. package/dist/esm/plugins/column-sizing/useColumnSizeService.js +7 -26
  320. package/dist/esm/plugins/column-sizing/useColumnSizeService.js.map +2 -2
  321. package/dist/esm/plugins/column-sizing/useStylesheetHelpers.js +3 -2
  322. package/dist/esm/plugins/column-sizing/useStylesheetHelpers.js.map +2 -2
  323. package/dist/esm/plugins/column-sizing/utils.js.map +1 -1
  324. package/dist/esm/plugins/custom-cell-renderer/CustomRendererPlugin.js +1 -1
  325. package/dist/esm/plugins/custom-cell-renderer/CustomRendererPlugin.js.map +1 -1
  326. package/dist/esm/plugins/custom-cell-renderer/addCustomRendererToCell.js +2 -1
  327. package/dist/esm/plugins/custom-cell-renderer/addCustomRendererToCell.js.map +2 -2
  328. package/dist/esm/plugins/custom-cell-renderer/getRendererComponent.js +1 -1
  329. package/dist/esm/plugins/custom-cell-renderer/getRendererComponent.js.map +2 -2
  330. package/dist/esm/plugins/custom-cell-renderer/index.js +1 -1
  331. package/dist/esm/plugins/custom-cell-renderer/index.js.map +1 -1
  332. package/dist/esm/plugins/editable/EditableComponents/ComboBox.js.map +1 -1
  333. package/dist/esm/plugins/editable/EditableComponents/TextBox.js.map +1 -1
  334. package/dist/esm/plugins/editable/EditableComponents/index.js +2 -2
  335. package/dist/esm/plugins/editable/EditableComponents/index.js.map +1 -1
  336. package/dist/esm/plugins/editable/EditablePlugin.js +1 -1
  337. package/dist/esm/plugins/editable/EditablePlugin.js.map +2 -2
  338. package/dist/esm/plugins/editable/decorateEditable.js +1 -1
  339. package/dist/esm/plugins/editable/decorateEditable.js.map +2 -2
  340. package/dist/esm/plugins/editable/getEditorComponent.js +3 -16
  341. package/dist/esm/plugins/editable/getEditorComponent.js.map +2 -2
  342. package/dist/esm/plugins/editable/index.js +2 -2
  343. package/dist/esm/plugins/editable/index.js.map +1 -1
  344. package/dist/esm/plugins/expandable-grid/ExpandableColumn.js +23 -25
  345. package/dist/esm/plugins/expandable-grid/ExpandableColumn.js.map +2 -2
  346. package/dist/esm/plugins/expandable-grid/ExpandablePlugin.js +5 -5
  347. package/dist/esm/plugins/expandable-grid/ExpandablePlugin.js.map +2 -2
  348. package/dist/esm/plugins/expandable-grid/ExpandedRow.js +6 -6
  349. package/dist/esm/plugins/expandable-grid/ExpandedRow.js.map +2 -2
  350. package/dist/esm/plugins/expandable-grid/ExpandedRowExtra.js +12 -8
  351. package/dist/esm/plugins/expandable-grid/ExpandedRowExtra.js.map +2 -2
  352. package/dist/esm/plugins/expandable-grid/index.js +2 -2
  353. package/dist/esm/plugins/expandable-grid/index.js.map +1 -1
  354. package/dist/esm/plugins/expandable-grid/useExpandGridState.js.map +2 -2
  355. package/dist/esm/plugins/export-data/ExportDataPlugin.js.map +1 -1
  356. package/dist/esm/plugins/export-data/index.js +1 -1
  357. package/dist/esm/plugins/export-data/index.js.map +1 -1
  358. package/dist/esm/plugins/filterable/FilterablePlugin.js +3 -3
  359. package/dist/esm/plugins/filterable/FilterablePlugin.js.map +2 -2
  360. package/dist/esm/plugins/filterable/addFilterToColumn.js +1 -1
  361. package/dist/esm/plugins/filterable/addFilterToColumn.js.map +1 -1
  362. package/dist/esm/plugins/filterable/components/FilterableHeader.js +1 -1
  363. package/dist/esm/plugins/filterable/components/FilterableHeader.js.map +2 -2
  364. package/dist/esm/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js +46 -47
  365. package/dist/esm/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js.map +2 -2
  366. package/dist/esm/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js +46 -48
  367. package/dist/esm/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js.map +2 -2
  368. package/dist/esm/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js +44 -45
  369. package/dist/esm/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js.map +2 -2
  370. package/dist/esm/plugins/filterable/components/filterable-menus/TextFilterMenu.js +3 -3
  371. package/dist/esm/plugins/filterable/components/filterable-menus/TextFilterMenu.js.map +2 -2
  372. package/dist/esm/plugins/filterable/components/filterable-menus/getFilterMenuByType.js +5 -7
  373. package/dist/esm/plugins/filterable/components/filterable-menus/getFilterMenuByType.js.map +2 -2
  374. package/dist/esm/plugins/filterable/filterableFormatter.js +29 -37
  375. package/dist/esm/plugins/filterable/filterableFormatter.js.map +2 -2
  376. package/dist/esm/plugins/filterable/filtering-helper/filterRowsByQuery.js +2 -4
  377. package/dist/esm/plugins/filterable/filtering-helper/filterRowsByQuery.js.map +2 -2
  378. package/dist/esm/plugins/filterable/filtering-helper/strategiesOperators.js.map +2 -2
  379. package/dist/esm/plugins/filterable/helper.js +1 -7
  380. package/dist/esm/plugins/filterable/helper.js.map +2 -2
  381. package/dist/esm/plugins/filterable/index.js +1 -1
  382. package/dist/esm/plugins/filterable/index.js.map +1 -1
  383. package/dist/esm/plugins/filterable/useFilterableState.js +3 -11
  384. package/dist/esm/plugins/filterable/useFilterableState.js.map +2 -2
  385. package/dist/esm/plugins/grouping-by/GroupingByPlugin.js.map +1 -1
  386. package/dist/esm/plugins/grouping-grid/GroupingPlugin.js +15 -11
  387. package/dist/esm/plugins/grouping-grid/GroupingPlugin.js.map +2 -2
  388. package/dist/esm/plugins/grouping-grid/walkStrategy.js.map +2 -2
  389. package/dist/esm/plugins/index.js +16 -16
  390. package/dist/esm/plugins/index.js.map +1 -1
  391. package/dist/esm/plugins/infinite-scrolling/InfiniteScrollPlugin.js.map +1 -1
  392. package/dist/esm/plugins/infinite-scrolling/index.js +1 -1
  393. package/dist/esm/plugins/infinite-scrolling/index.js.map +1 -1
  394. package/dist/esm/plugins/pagination/PaginationPlugin.js +5 -4
  395. package/dist/esm/plugins/pagination/PaginationPlugin.js.map +2 -2
  396. package/dist/esm/plugins/pagination/components/Pagination.js +5 -24
  397. package/dist/esm/plugins/pagination/components/Pagination.js.map +2 -2
  398. package/dist/esm/plugins/pagination/components/Paginator.js +12 -11
  399. package/dist/esm/plugins/pagination/components/Paginator.js.map +2 -2
  400. package/dist/esm/plugins/pagination/components/PerPageDropdown.js +2 -2
  401. package/dist/esm/plugins/pagination/components/PerPageDropdown.js.map +2 -2
  402. package/dist/esm/plugins/pagination/helper.js.map +2 -2
  403. package/dist/esm/plugins/pagination/index.js +1 -1
  404. package/dist/esm/plugins/pagination/index.js.map +1 -1
  405. package/dist/esm/plugins/pagination/usePaginationState.js +1 -1
  406. package/dist/esm/plugins/pagination/usePaginationState.js.map +1 -1
  407. package/dist/esm/plugins/resizable/ResizablePlugin.js +1 -1
  408. package/dist/esm/plugins/resizable/ResizablePlugin.js.map +2 -2
  409. package/dist/esm/plugins/resizable/decorateResizable.js +4 -2
  410. package/dist/esm/plugins/resizable/decorateResizable.js.map +2 -2
  411. package/dist/esm/plugins/resizable/index.js +1 -1
  412. package/dist/esm/plugins/resizable/index.js.map +1 -1
  413. package/dist/esm/plugins/resizable/useResizeHandle.js +6 -13
  414. package/dist/esm/plugins/resizable/useResizeHandle.js.map +2 -2
  415. package/dist/esm/plugins/row-dnd/DndRowsPlugin.js +1 -0
  416. package/dist/esm/plugins/row-dnd/DndRowsPlugin.js.map +1 -1
  417. package/dist/esm/plugins/row-dnd/index.js +1 -1
  418. package/dist/esm/plugins/row-dnd/index.js.map +1 -1
  419. package/dist/esm/plugins/selectable/SelectablePlugin.js +3 -3
  420. package/dist/esm/plugins/selectable/SelectablePlugin.js.map +2 -2
  421. package/dist/esm/plugins/selectable/addSelectableColumn.js +3 -1
  422. package/dist/esm/plugins/selectable/addSelectableColumn.js.map +2 -2
  423. package/dist/esm/plugins/selectable/helper.js.map +1 -1
  424. package/dist/esm/plugins/selectable/index.js +1 -1
  425. package/dist/esm/plugins/selectable/index.js.map +1 -1
  426. package/dist/esm/plugins/selectable/selectableFormatter.js +1 -1
  427. package/dist/esm/plugins/selectable/selectableFormatter.js.map +2 -2
  428. package/dist/esm/plugins/selectable/useSelectableState.js +3 -5
  429. package/dist/esm/plugins/selectable/useSelectableState.js.map +2 -2
  430. package/dist/esm/plugins/sortable/SortablePlugin.js +3 -3
  431. package/dist/esm/plugins/sortable/SortablePlugin.js.map +2 -2
  432. package/dist/esm/plugins/sortable/checkIfSortable.js.map +1 -1
  433. package/dist/esm/plugins/sortable/index.js +1 -1
  434. package/dist/esm/plugins/sortable/index.js.map +1 -1
  435. package/dist/esm/plugins/sortable/sortHeaderFormatter.js.map +1 -1
  436. package/dist/esm/plugins/sortable/sortTree.js.map +2 -2
  437. package/dist/esm/plugins/sortable/sorter.js +1 -0
  438. package/dist/esm/plugins/sortable/sorter.js.map +1 -1
  439. package/dist/esm/plugins/sortable/useSortableState.js +2 -4
  440. package/dist/esm/plugins/sortable/useSortableState.js.map +2 -2
  441. package/dist/esm/plugins/toolbar/RowRenderer.js +3 -2
  442. package/dist/esm/plugins/toolbar/RowRenderer.js.map +2 -2
  443. package/dist/esm/plugins/toolbar/ToolbarPlugin.js +1 -1
  444. package/dist/esm/plugins/toolbar/ToolbarPlugin.js.map +2 -2
  445. package/dist/esm/plugins/toolbar/ToolbarTrigger.js +1 -0
  446. package/dist/esm/plugins/toolbar/ToolbarTrigger.js.map +1 -1
  447. package/dist/esm/plugins/toolbar/index.js +1 -1
  448. package/dist/esm/plugins/toolbar/index.js.map +1 -1
  449. package/dist/esm/plugins/virtualization/AutoHeightList.js.map +2 -2
  450. package/dist/esm/plugins/virtualization/VirtualizationPlugin.js +4 -2
  451. package/dist/esm/plugins/virtualization/VirtualizationPlugin.js.map +2 -2
  452. package/dist/esm/plugins/virtualization/VirtualizedBody.js +5 -4
  453. package/dist/esm/plugins/virtualization/VirtualizedBody.js.map +2 -2
  454. package/dist/esm/plugins/virtualization/VirtualizedBodyRow.js +1 -0
  455. package/dist/esm/plugins/virtualization/VirtualizedBodyRow.js.map +1 -1
  456. package/dist/esm/plugins/virtualization/index.js +1 -1
  457. package/dist/esm/plugins/virtualization/index.js.map +1 -1
  458. package/dist/esm/renders/CellWithAddons.js +11 -1
  459. package/dist/esm/renders/CellWithAddons.js.map +2 -2
  460. package/dist/esm/renders/index.js +2 -2
  461. package/dist/esm/renders/index.js.map +1 -1
  462. package/dist/esm/renders/styled.js.map +1 -1
  463. package/dist/esm/rowSizes.js +1 -5
  464. package/dist/esm/rowSizes.js.map +2 -2
  465. package/dist/esm/utilities/getPluginsFromProps.js +13 -13
  466. package/dist/esm/utilities/getPluginsFromProps.js.map +2 -2
  467. package/dist/esm/utilities/normalizeData.js.map +2 -2
  468. package/package.json +25 -25
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* 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';\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\nfunction 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 return (\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}\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", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADiEjB;AAhEN,mBAA2C;AAC3C,wBAAsB;AACtB,gCAIO;AACP,uBAAsD;AACtD,sBAA4B;AAC5B,uBAAyB;AACzB,qBAAqB;AACrB,oBAA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MAEF,QAAQ,UAAU;AAAA;AAAA,EACpB;AAEJ;AAEA,wBAAwB,YAAY;AAAA,EAClC,QAAQ,kBAAAC,QAAU;AAAA,EAClB,WAAW,kBAAAA,QAAU;AAAA,EACrB,cAAc,kBAAAA,QAAU;AAAA,EACxB,YAAY,kBAAAA,QAAU;AAAA,EACtB,WAAW,kBAAAA,QAAU;AAAA,EACrB,aAAa,kBAAAA,QAAU;AAAA,EACvB,eAAe,kBAAAA,QAAU;AAAA,EACzB,mBAAmB,kBAAAA,QAAU;AAAA,EAC7B,WAAW,kBAAAA,QAAU;AACvB;AAGA,IAAO,kCAAQ;",
4
+ "sourcesContent": ["/* 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", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADiEjB;AAhEN,mBAA2C;AAC3C,wBAAsB;AACtB,gCAIO;AACP,uBAAsD;AACtD,sBAA4B;AAC5B,uBAAyB;AACzB,qBAAqB;AACrB,oBAAmB;AACnB,uBAAuB;AACvB,+BAAoC;AAEpC,MAAM,wBAAoB,yBAAO,mBAAI;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,QAAI,uBAAS,EAAE;AAC7C,QAAM,CAAC,SAAS,UAAU,QAAI,uBAAS,EAAE;AAGzC,QAAM,CAAC,qBAAqB,sBAAsB,QAAI,uBAAS,KAAK;AAEpE,QAAM,CAAC,aAAa,cAAc,QAAI,uBAAS,KAAK;AAEpD,8BAAU,MAAM;AACd,UAAM,kBAAc,cAAAA,SAAO,SAAS;AACpC,UAAM,gBAAY,cAAAA,SAAO,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;AAAA,QACL,iBAAiB;AAAA,QACjB,WA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AAAA,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,4CAAC,+BAAY;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,kBAAAC,QAAU;AAAA,EAClB,WAAW,kBAAAA,QAAU;AAAA,EACrB,cAAc,kBAAAA,QAAU;AAAA,EACxB,YAAY,kBAAAA,QAAU;AAAA,EACtB,WAAW,kBAAAA,QAAU;AAAA,EACrB,aAAa,kBAAAA,QAAU;AAAA,EACvB,eAAe,kBAAAA,QAAU;AAAA,EACzB,mBAAmB,kBAAAA,QAAU;AAAA,EAC7B,WAAW,kBAAAA,QAAU;AACvB;AAGA,IAAO,kCAAQ;",
6
6
  "names": ["moment", "PropTypes", "Position"]
7
7
  }
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
18
18
  return to;
19
19
  };
20
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
25
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
26
  mod
23
27
  ));
@@ -38,7 +42,7 @@ var import_ds_button = require("@elliemae/ds-button");
38
42
  var import_ds_popper = require("@elliemae/ds-popper");
39
43
  var import_ds_menu = require("@elliemae/ds-menu");
40
44
  var import_ds_icons = require("@elliemae/ds-icons");
41
- function TextFilterMenu({
45
+ const TextFilterMenu = ({
42
46
  column,
43
47
  menuStyle = {},
44
48
  className,
@@ -52,7 +56,7 @@ function TextFilterMenu({
52
56
  onRemoveFilter = () => null,
53
57
  maxOptions = 10,
54
58
  isMulti = false
55
- }) {
59
+ }) => {
56
60
  const { options, ...otherMenuProps } = menuProps;
57
61
  const generateOption = (option, idx) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_menu.Menu.ItemCheckbox, { label: option.label, name: option.id }, idx);
58
62
  const renderOptions = (arr) => arr.map(generateOption);
@@ -159,7 +163,7 @@ function TextFilterMenu({
159
163
  )
160
164
  }
161
165
  );
162
- }
166
+ };
163
167
  TextFilterMenu.propTypes = {
164
168
  column: import_prop_types.default.any,
165
169
  menuStyle: import_prop_types.default.shape({}),
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/plugins/filterable/components/filterable-menus/TextFilterMenu.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* 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\nfunction 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", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD2BmB;AA1B1C,mBAAgC;AAChC,wBAAsB;AACtB,oBAAwB;AACxB,6BAA+B;AAC/B,uBAAyB;AACzB,uBAA4C;AAC5C,qBAAmC;AACnC,sBAA4B;AAE5B,SAAS,eAAe;AAAA,EACtB;AAAA,EACA,YAAY,CAAC;AAAA,EACb;AAAA,EACA,UAAU,CAAC;AAAA,EACX,eAAe;AAAA,EACf,aAAa,MAAM;AAAA,EACnB,UAAU,MAAM;AAAA,EAChB,YAAY,iBAAAA,gBAAS;AAAA,EACrB,YAAY,CAAC;AAAA,EACb,cAAc,MAAM;AAAA,EACpB,iBAAiB,MAAM;A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AA;AAAA,UACC,YAAW;AAAA,UACX,MAAM,4CAAC,+BAAY;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,kBAAAC,QAAU;AAAA,EAClB,WAAW,kBAAAA,QAAU,MAAM,CAAC,CAAC;AAAA,EAC7B,WAAW,kBAAAA,QAAU;AAAA,EACrB,SAAS,kBAAAA,QAAU,QAAQ,kBAAAA,QAAU,MAAM,CAAC,CAAC,CAAC;AAAA,EAC9C,cAAc,kBAAAA,QAAU;AAAA,EACxB,YAAY,kBAAAA,QAAU;AAAA,EACtB,SAAS,kBAAAA,QAAU;AAAA,EACnB,WAAW,kBAAAA,QAAU;AAAA,EACrB,WAAW,kBAAAA,QAAU,MAAM,CAAC,CAAC;AAAA,EAC7B,aAAa,kBAAAA,QAAU;AAAA,EACvB,gBAAgB,kBAAAA,QAAU;AAAA,EAC1B,YAAY,kBAAAA,QAAU;AAAA,EACtB,SAAS,kBAAAA,QAAU;AACrB;AAGA,IAAO,yBAAQ;",
4
+ "sourcesContent": ["/* 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", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD2BmB;AA1B1C,mBAAgC;AAChC,wBAAsB;AACtB,oBAAwB;AACxB,6BAA+B;AAC/B,uBAAyB;AACzB,uBAA4C;AAC5C,qBAAmC;AACnC,sBAA4B;AAE5B,MAAM,iBAAiB,CAAC;AAAA,EACtB;AAAA,EACA,YAAY,CAAC;AAAA,EACb;AAAA,EACA,UAAU,CAAC;AAAA,EACX,eAAe;AAAA,EACf,aAAa,MAAM;AAAA,EACnB,UAAU,MAA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;AAAA,MACjB;AAAA,MACA,SAAS,UAAU,eAAe;AAAA,MAClC,aAAS,uBAAQ,OAAO;AAAA,MACxB;AAAA,MACA,kBACE;AAAA,QAAC;AAAA;AAAA,UACC,YAAW;AAAA,UACX,MAAM,4CAAC,+BAAY;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,kBAAAC,QAAU;AAAA,EAClB,WAAW,kBAAAA,QAAU,MAAM,CAAC,CAAC;AAAA,EAC7B,WAAW,kBAAAA,QAAU;AAAA,EACrB,SAAS,kBAAAA,QAAU,QAAQ,kBAAAA,QAAU,MAAM,CAAC,CAAC,CAAC;AAAA,EAC9C,cAAc,kBAAAA,QAAU;AAAA,EACxB,YAAY,kBAAAA,QAAU;AAAA,EACtB,SAAS,kBAAAA,QAAU;AAAA,EACnB,WAAW,kBAAAA,QAAU;AAAA,EACrB,WAAW,kBAAAA,QAAU,MAAM,CAAC,CAAC;AAAA,EAC7B,aAAa,kBAAAA,QAAU;AAAA,EACvB,gBAAgB,kBAAAA,QAAU;AAAA,EAC1B,YAAY,kBAAAA,QAAU;AAAA,EACtB,SAAS,kBAAAA,QAAU;AACrB;AAGA,IAAO,yBAAQ;",
6
6
  "names": ["Position", "React", "PropTypes"]
7
7
  }
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
18
18
  return to;
19
19
  };
20
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
25
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
26
  mod
23
27
  ));
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/plugins/filterable/components/filterable-menus/defaultDateFormat.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["export const DEFAULT_DATE_FORMAT = 'MM/DD/YYYY';\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,sBAAsB;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,sBAAsB;",
6
6
  "names": []
7
7
  }
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
18
18
  return to;
19
19
  };
20
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
25
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
26
  mod
23
27
  ));
@@ -29,18 +33,16 @@ __export(getFilterMenuByType_exports, {
29
33
  });
30
34
  module.exports = __toCommonJS(getFilterMenuByType_exports);
31
35
  var React = __toESM(require("react"));
32
- var import_DateRangeFilterMenu = require("./DateRangeFilterMenu");
33
- var import_SingleDateFilterMenu = require("./SingleDateFilterMenu");
34
- var import_SingleRangeSwitcherMenu = require("./SingleRangeSwitcherMenu");
35
- var import_TextFilterMenu = require("./TextFilterMenu");
36
+ var import_DateRangeFilterMenu = require("./DateRangeFilterMenu.js");
37
+ var import_SingleDateFilterMenu = require("./SingleDateFilterMenu.js");
38
+ var import_SingleRangeSwitcherMenu = require("./SingleRangeSwitcherMenu.js");
39
+ var import_TextFilterMenu = require("./TextFilterMenu.js");
36
40
  const ComponentTypes = {
37
41
  "date-range": import_DateRangeFilterMenu.DateRangeFilterMenu,
38
42
  "single-date": import_SingleDateFilterMenu.SingleDateFilterMenu,
39
43
  "date-switcher": import_SingleRangeSwitcherMenu.SingleRangeSwitcherMenu,
40
44
  string: import_TextFilterMenu.TextFilterMenu
41
45
  };
42
- const getFilterMenuByType = (type) => {
43
- return ComponentTypes[type] || ComponentTypes.string;
44
- };
46
+ const getFilterMenuByType = (type) => ComponentTypes[type] || ComponentTypes.string;
45
47
  var getFilterMenuByType_default = getFilterMenuByType;
46
48
  //# sourceMappingURL=getFilterMenuByType.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/plugins/filterable/components/filterable-menus/getFilterMenuByType.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { DateRangeFilterMenu } from './DateRangeFilterMenu';\nimport { SingleDateFilterMenu } from './SingleDateFilterMenu'; // implement\nimport { SingleRangeSwitcherMenu } from './SingleRangeSwitcherMenu'; // implement\nimport { TextFilterMenu } from './TextFilterMenu';\n\nconst ComponentTypes = {\n 'date-range': DateRangeFilterMenu,\n 'single-date': SingleDateFilterMenu,\n 'date-switcher': SingleRangeSwitcherMenu,\n string: TextFilterMenu,\n};\n\nexport const getFilterMenuByType = (type) => {\n return ComponentTypes[type] || ComponentTypes.string;\n};\n\nexport default getFilterMenuByType;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,iCAAoC;AACpC,kCAAqC;AACrC,qCAAwC;AACxC,4BAA+B;AAE/B,MAAM,iBAAiB;AAAA,EACrB,cAAc;AAAA,EACd,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,QAAQ;AACV;AAEO,MAAM,sBAAsB,CAAC,SAAS;AAC3C,SAAO,eAAe,SAAS,eAAe;AAChD;AAEA,IAAO,8BAAQ;",
4
+ "sourcesContent": ["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", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,iCAAoC;AACpC,kCAAqC;AACrC,qCAAwC;AACxC,4BAA+B;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": []
7
7
  }
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
18
18
  return to;
19
19
  };
20
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
25
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
26
  mod
23
27
  ));
@@ -30,44 +34,36 @@ __export(filterableFormatter_exports, {
30
34
  module.exports = __toCommonJS(filterableFormatter_exports);
31
35
  var React = __toESM(require("react"));
32
36
  var import_jsx_runtime = require("react/jsx-runtime");
33
- var import_FilterableHeader = require("./components/FilterableHeader");
34
- var import_helper = require("./helper");
35
- const FilterableFormatter = ({
36
- grid,
37
- onAddFilter,
38
- onRemoveFilter,
39
- query,
40
- filterMenuRef
41
- }) => {
42
- return (value, { column }) => {
43
- const {
44
- rows,
45
- composedRows,
46
- props: { groupedRows, groupedBy, onFilterMenuClose, onFilterMenuOpen },
47
- state: { filters }
48
- } = grid.getInstance();
49
- let rowsToUse = composedRows;
50
- if (column.filter && column.filter.isMulti) {
51
- rowsToUse = rows;
37
+ var import_FilterableHeader = require("./components/FilterableHeader.js");
38
+ var import_helper = require("./helper.js");
39
+ const FilterableFormatter = ({ grid, onAddFilter, onRemoveFilter, query, filterMenuRef }) => function(value, { column }) {
40
+ const {
41
+ rows,
42
+ composedRows,
43
+ props: { groupedRows, groupedBy, onFilterMenuClose, onFilterMenuOpen },
44
+ state: { filters }
45
+ } = grid.getInstance();
46
+ let rowsToUse = composedRows;
47
+ if (column.filter && column.filter.isMulti) {
48
+ rowsToUse = rows;
49
+ }
50
+ const filteredLabels = groupedRows && !groupedBy ? (0, import_helper.getFilterLabelsGroup)(column, rows, query) : (0, import_helper.getFilterLabels)(column, rowsToUse.rows || rowsToUse, query);
51
+ const columnData = column.filterOptions || filteredLabels;
52
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
53
+ import_FilterableHeader.FilterableHeader,
54
+ {
55
+ column,
56
+ columnData,
57
+ filters,
58
+ filterMenuRef,
59
+ onAddFilter,
60
+ onFilterMenuClose,
61
+ onFilterMenuOpen,
62
+ onRemoveFilter,
63
+ isMulti: column.filter && column.filter.isMulti,
64
+ value
52
65
  }
53
- const filteredLabels = groupedRows && !groupedBy ? (0, import_helper.getFilterLabelsGroup)(column, rows, query) : (0, import_helper.getFilterLabels)(column, rowsToUse.rows || rowsToUse, query);
54
- const columnData = column.filterOptions || filteredLabels;
55
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
56
- import_FilterableHeader.FilterableHeader,
57
- {
58
- column,
59
- columnData,
60
- filters,
61
- filterMenuRef,
62
- onAddFilter,
63
- onFilterMenuClose,
64
- onFilterMenuOpen,
65
- onRemoveFilter,
66
- isMulti: column.filter && column.filter.isMulti,
67
- value
68
- }
69
- );
70
- };
66
+ );
71
67
  };
72
68
  var filterableFormatter_default = FilterableFormatter;
73
69
  //# sourceMappingURL=filterableFormatter.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/plugins/filterable/filterableFormatter.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable react/display-name */\nimport React from 'react';\nimport { FilterableHeader } from './components/FilterableHeader';\nimport { getFilterLabels, getFilterLabelsGroup } from './helper';\n\nconst FilterableFormatter = ({\n grid,\n onAddFilter,\n onRemoveFilter,\n query,\n filterMenuRef,\n}) => {\n return (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}\n\nexport { FilterableFormatter };\nexport default FilterableFormatter;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADgCjB;AA9BN,8BAAiC;AACjC,oBAAsD;AAEtD,MAAM,sBAAsB,CAAC;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,SAAO,CAAC,OAAO,EAAE,OAAO,MAAM;AAC5B,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA,OAAO,EAAE,aAAa,WAAW,mBAAmB,iBAAiB;AAAA,MACrE,OAAO,EAAE,QAAQ;AAAA,IACnB,IAAI,KAAK,YAAY;AAErB,QAAI,YAAY;AAChB,QAAI,OAAO,UAAU,OAAO,OAAO,SAAS;AAC1C,kBAAY;AAAA,IACd;AAEA,UAAM,iBACJ,eAAe,CAAC,gBACZ,oCAAqB,QAAQ,MAAM,KAAK,QACxC,+BAAgB,QAAQ,UAAU,QAAQ,WAAW,KAAK;AAEhE,UAAM,aAAa,OAAO,iBAAiB;AAC3C,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,SAAS,OAAO,UAAU,OAAO,OAAO;AAAA,QACxC;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAGA,IAAO,8BAAQ;",
4
+ "sourcesContent": ["/* 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", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD0BjB;AAxBN,8BAAiC;AACjC,oBAAsD;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,gBACZ,oCAAqB,QAAQ,MAAM,KAAK,QACxC,+BAAgB,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": []
7
7
  }
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
18
18
  return to;
19
19
  };
20
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
25
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
26
  mod
23
27
  ));
@@ -31,7 +35,7 @@ __export(filterRowsByQuery_exports, {
31
35
  module.exports = __toCommonJS(filterRowsByQuery_exports);
32
36
  var React = __toESM(require("react"));
33
37
  var import_ds_utilities = require("@elliemae/ds-utilities");
34
- var import_strategiesOperators = require("./strategiesOperators");
38
+ var import_strategiesOperators = require("./strategiesOperators.js");
35
39
  const getRuleStrategyOperator = (rule) => rule.strategy || (0, import_strategiesOperators.strategiesOperators)(rule.operator);
36
40
  const executeFilterStrategy = (rule, row) => {
37
41
  const { value, field, transform, transformRowValue } = rule;
@@ -74,8 +78,6 @@ function filterRowsByQueryGroup(rows, query, composedRows) {
74
78
  return true;
75
79
  });
76
80
  }
77
- const filterRowsByQuery = (rows, query) => {
78
- return rows.filter(filterByRules(query.rules, query.condition));
79
- };
81
+ const filterRowsByQuery = (rows, query) => rows.filter(filterByRules(query.rules, query.condition));
80
82
  var filterRowsByQuery_default = filterRowsByQuery;
81
83
  //# sourceMappingURL=filterRowsByQuery.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/plugins/filterable/filtering-helper/filterRowsByQuery.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { isFunction } from '@elliemae/ds-utilities';\nimport { strategiesOperators } from './strategiesOperators';\n\nconst getRuleStrategyOperator = (rule) => rule.strategy || strategiesOperators(rule.operator);\n\nconst executeFilterStrategy = (rule, row) => {\n const { value, field, transform, transformRowValue } = rule;\n if (field === 'all') return Object.values(row).some((colValue) => strategiesOperators('contains')(colValue, value));\n const rowValue = row[field];\n const transformedValue = isFunction(transform) ? transform(value) : value;\n const transformedRowValue = isFunction(transformRowValue) ? transformRowValue(rowValue) : rowValue;\n\n const filterStrategy = getRuleStrategyOperator(rule);\n return filterStrategy(transformedRowValue, transformedValue);\n};\n\nconst filterByRules =\n (rules, condition = 'AND') =>\n (row) =>\n condition === 'AND'\n ? rules.reduce(\n (isFiltered, rule) =>\n rule.rules && rule.rules.length\n ? isFiltered && filterByRules(rule.rules, rule.condition)(row)\n : isFiltered && executeFilterStrategy(rule, row),\n true,\n )\n : rules.some((rule) =>\n rule.rules && rule.rules.length\n ? filterByRules(rule.rules, rule.condition)(row)\n : executeFilterStrategy(rule, row),\n );\n\nexport function filterRowsByQueryGroup(rows, query, composedRows) {\n if (query && query.rules && query.rules.length === 0) return rows;\n const newRows = [];\n const parentMap = {};\n composedRows.forEach((parentRow) => {\n if (parentRow.isGroup) {\n newRows.push({\n ...parentRow,\n _filtered: true,\n });\n } else if (!parentRow.isGroup && filterByRules(query.rules, query.condition)(parentRow.data)) {\n newRows.push({\n ...parentRow,\n _filtered: true,\n });\n parentMap[parentRow.parentNode.id] = true;\n }\n });\n\n return newRows.filter((r) => {\n if (r.isGroup && !parentMap[r.id]) return false;\n return true;\n });\n}\n\nexport const filterRowsByQuery = (rows, query) => {\n return rows.filter(filterByRules(query.rules, query.condition));\n};\n\nexport default filterRowsByQuery;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,0BAA2B;AAC3B,iCAAoC;AAEpC,MAAM,0BAA0B,CAAC,SAAS,KAAK,gBAAY,gDAAoB,KAAK,QAAQ;AAE5F,MAAM,wBAAwB,CAAC,MAAM,QAAQ;AAC3C,QAAM,EAAE,OAAO,OAAO,WAAW,kBAAkB,IAAI;AACvD,M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AAI,EAAE,WAAW,CAAC,UAAU,EAAE;AAAK,aAAO;AAC1C,WAAO;AAAA,EACT,CAAC;AACH;AAEO,MAAM,oBAAoB,CAAC,MAAM,UAAU;AAChD,SAAO,KAAK,OAAO,cAAc,MAAM,OAAO,MAAM,SAAS,CAAC;AAChE;AAEA,IAAO,4BAAQ;",
4
+ "sourcesContent": ["import { 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", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,0BAA2B;AAC3B,iCAAoC;AAEpC,MAAM,0BAA0B,CAAC,SAAS,KAAK,gBAAY,gDAAoB,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,iBAAa,gDAAoB,UAAU,EAAE,UAAU,KAAK,CAAC;AAClH,QAAM,WAAW,IAAI,KAAK;AAC1B,QAAM,uBAAmB,gCAAW,SAAS,IAAI,UAAU,KAAK,IAAI;AACpE,QAAM,0BAAsB,gCAAW,iBAAiB,IAAI,kBAAkB,QAAQ,IAAI;AAE1F,QAAM,iBAAiB,wBAAwB,IAAI;AACnD,SAAO,eAAe,qBAAqB,gBAAgB;AAC7D;AAEA,MAAM,gBACJ,CAAC,OAAO,YAAY,UACpB,CAAC,QACC,cAAc,QACV,MAAM;AAAA,EACJ,CAAC,YAAY,SACX,KAAK,SAAS,KAAK,MAAM,SACrB,cAAc,cAAc,KAAK,OAAO,KAAK,SAAS,EAAE,GAAG,IAC3D,cAAc,sBAAsB,MAAM,GAAG;AAAA,EACnD;AACF,IACA,MAAM;AAAA,EAAK,CAAC,SACV,KAAK,SAAS,KAAK,MAAM,SACrB,cAAc,KAAK,OAAO,KAAK,SAAS,EAAE,GAAG,IAC7C,sBAAsB,MAAM,GAAG;AACrC;AAED,SAAS,uBAAuB,MAAM,OAAO,cAAc;AAChE,MAAI,SAAS,MAAM,SAAS,MAAM,MAAM,WAAW;AAAG,WAAO;AAC7D,QAAM,UAAU,CAAC;AACjB,QAAM,YAAY,CAAC;AACnB,eAAa,QAAQ,CAAC,cAAc;AAClC,QAAI,UAAU,SAAS;AACrB,cAAQ,KAAK;AAAA,QACX,GAAG;AAAA,QACH,WAAW;AAAA,MACb,CAAC;AAAA,IACH,WAAW,CAAC,UAAU,WAAW,cAAc,MAAM,OAAO,MAAM,SAAS,EAAE,UAAU,IAAI,GAAG;AAC5F,cAAQ,KAAK;AAAA,QACX,GAAG;AAAA,QACH,WAAW;AAAA,MACb,CAAC;AACD,gBAAU,UAAU,WAAW,EAAE,IAAI;AAAA,IACvC;AAAA,EACF,CAAC;AAED,SAAO,QAAQ,OAAO,CAAC,MAAM;AAC3B,QAAI,EAAE,WAAW,CAAC,UAAU,EAAE,EAAE;AAAG,aAAO;AAC1C,WAAO;AAAA,EACT,CAAC;AACH;AAEO,MAAM,oBAAoB,CAAC,MAAM,UAAU,KAAK,OAAO,cAAc,MAAM,OAAO,MAAM,SAAS,CAAC;AAEzG,IAAO,4BAAQ;",
6
6
  "names": []
7
7
  }
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
18
18
  return to;
19
19
  };
20
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
25
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
26
  mod
23
27
  ));
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/plugins/filterable/filtering-helper/strategiesOperators.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import compare from 'comparejs';\n\nexport const strategiesOperators = op =>\n ({\n range: (rowValue, { start, end }) => start <= rowValue && end >= rowValue,\n equal: (value1, value2) => compare.id(value1, value2),\n greaterThan: compare.gt,\n lessThan: compare.lt,\n contains: (rowValue, value) =>\n String(rowValue)\n .toLowerCase()\n .indexOf(String(value).toLowerCase()) !== -1,\n }[op] || compare.id);\n\nexport default strategiesOperators;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAoB;AAEb,MAAM,sBAAsB,SAChC;AAAA,EACC,OAAO,CAAC,UAAU,EAAE,OAAO,IAAI,MAAM,SAAS,YAAY,OAAO;AAAA,EACjE,OAAO,CAAC,QAAQ,WAAW,iBAAAA,QAAQ,GAAG,QAAQ,MAAM;AAAA,EACpD,aAAa,iBAAAA,QAAQ;AAAA,EACrB,UAAU,iBAAAA,QAAQ;AAAA,EAClB,UAAU,CAAC,UAAU,UACnB,OAAO,QAAQ,EACZ,YAAY,EACZ,QAAQ,OAAO,KAAK,EAAE,YAAY,CAAC,MAAM;AAChD,GAAE,OAAO,iBAAAA,QAAQ;AAEnB,IAAO,8BAAQ;",
4
+ "sourcesContent": ["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", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAoB;AAEb,MAAM,sBAAsB,CAAC,QACjC;AAAA,EACC,OAAO,CAAC,UAAU,EAAE,OAAO,IAAI,MAAM,SAAS,YAAY,OAAO;AAAA,EACjE,OAAO,CAAC,QAAQ,WAAW,iBAAAA,QAAQ,GAAG,QAAQ,MAAM;AAAA,EACpD,aAAa,iBAAAA,QAAQ;AAAA,EACrB,UAAU,iBAAAA,QAAQ;AAAA,EAClB,UAAU,CAAC,UAAU,UAAU,OAAO,QAAQ,EAAE,YAAY,EAAE,QAAQ,OAAO,KAAK,EAAE,YAAY,CAAC,MAAM;AACzG,GAAE,EAAE,KAAK,iBAAAA,QAAQ;AAEnB,IAAO,8BAAQ;",
6
6
  "names": ["compare"]
7
7
  }
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
18
18
  return to;
19
19
  };
20
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
25
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
26
  mod
23
27
  ));
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/plugins/filterable/helper.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import {\n isFunction,\n uniqBy,\n get,\n groupBy,\n property,\n} from '@elliemae/ds-utilities';\n\nexport const getFilterLabel = (column, value) => (column.filterLabels ? column.filterLabels[value] || value : value);\n\nexport const getFilterLabels = (column, rows) =>\n uniqBy(rows, property(column.searchBy || column.property))\n .map((row) => {\n const value = get(row, column.searchBy || column.property);\n if (value === undefined) return {};\n const rowColumnValue = String(get(row, column.searchBy || column.property));\n if (isFunction(column.valueTransformation)) {\n const nextValue = column.valueTransformation(rowColumnValue);\n return { id: nextValue, label: nextValue };\n }\n const label = getFilterLabel(column, rowColumnValue);\n return { id: rowColumnValue || label, label };\n })\n .filter((row) => row.id)\n .filter((row) => {\n if (row.id.startsWith) return !row.id.startsWith('grouped-by');\n return true;\n });\n\nexport const getFilterLabelsGroup = (column, rows) => {\n let flat = [];\n rows.forEach((r) => {\n if (r.children) {\n flat = [...flat, ...r.children];\n }\n });\n return getFilterLabels(column, flat);\n};\n\nexport function getFilterValue(filter, column) {\n const { value } = filter;\n\n if (!column) return value;\n\n const { filterOptions, filterLabels } = column;\n\n if (filterOptions) {\n const foundOption = column.filterOptions.filter((option) => option.id === value)[0];\n if (foundOption) return foundOption.label;\n return value;\n }\n if (filterLabels) {\n return filterLabels[value];\n }\n\n return value;\n}\n\nexport function buildFilterArray(newFilter, filters) {\n // if (newFilter.type && newFilter.type === 'date') return [...filters.slice(1), newFilter]\n return uniqBy([...filters, newFilter], (v) => [v.group, v.value].join());\n}\n\nexport const groupFilters = (filters) => filters.filter((filter) => !filter.fixed);\n\nfunction parseFilterToRule(filter) {\n return {\n ...filter,\n value: filter.filterParams || filter.value,\n field: filter.group,\n };\n}\n\nexport function parseFiltersToQuery(filters) {\n const groupedFilters = groupBy(groupFilters(filters), (filter) => filter.group);\n return Object.keys(groupedFilters).reduce(\n (queryResult, field) => {\n const filter = groupedFilters[field];\n if (Array.isArray(filter) && filter.length > 1) {\n // create query group with 'OR' condition\n queryResult.rules.push({\n condition: 'OR',\n rules: filter.map(parseFilterToRule),\n });\n } else {\n queryResult.rules.push(parseFilterToRule(filter[0]));\n }\n return queryResult;\n },\n { condition: 'AND', rules: [] },\n );\n}\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,0BAMO;AAEA,MAAM,iBAAiB,CAAC,QAAQ,UAAW,OAAO,eAAe,OAAO,aAAa,UAAU,QAAQ;AAEvG,MAAM,kBAAkB,CAAC,QAAQ,aACtC,4BAAO,UAAM,8BAAS,OAAO,YAAY,OAAO,QAAQ,CAAC,EACtD,IAAI,CAAC,QAAQ;AACZ,QAAM,YAAQ,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,KAAK,CAAC;AACzE;AAEO,MAAM,eAAe,CAAC,YAAY,QAAQ,OAAO,CAAC,WAAW,CAAC,OAAO,KAAK;AAEjF,SAAS,kBAAkB,QAAQ;AACjC,SAAO;AAAA,IACL,GAAG;AAAA,IACH,OAAO,OAAO,gBAAgB,OAAO;AAAA,IACrC,OAAO,OAAO;AAAA,EAChB;AACF;AAEO,SAAS,oBAAoB,SAAS;AAC3C,QAAM,qBAAiB,6BAAQ,aAAa,OAAO,GAAG,CAAC,WAAW,OAAO,KAAK;AAC9E,SAAO,OAAO,KAAK,cAAc,EAAE;AAAA,IACjC,CAAC,aAAa,UAAU;AACtB,YAAM,SAAS,eAAe;AAC9B,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,EAAE,CAAC;AAAA,MACrD;AACA,aAAO;AAAA,IACT;AAAA,IACA,EAAE,WAAW,OAAO,OAAO,CAAC,EAAE;AAAA,EAChC;AACF;",
4
+ "sourcesContent": ["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", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,0BAA2D;AAEpD,MAAM,iBAAiB,CAAC,QAAQ,UAAW,OAAO,eAAe,OAAO,aAAa,KAAK,KAAK,QAAQ;AAEvG,MAAM,kBAAkB,CAAC,QAAQ,aACtC,4BAAO,UAAM,8BAAS,OAAO,YAAY,OAAO,QAAQ,CAAC,EACtD,IAAI,CAAC,QAAQ;AACZ,QAAM,YAAQ,yBA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AAK,EAAE,KAAK,CAAC;AACzE;AAEO,MAAM,eAAe,CAAC,YAAY,QAAQ,OAAO,CAAC,WAAW,CAAC,OAAO,KAAK;AAEjF,SAAS,kBAAkB,QAAQ;AACjC,SAAO;AAAA,IACL,GAAG;AAAA,IACH,OAAO,OAAO,gBAAgB,OAAO;AAAA,IACrC,OAAO,OAAO;AAAA,EAChB;AACF;AAEO,SAAS,oBAAoB,SAAS;AAC3C,QAAM,qBAAiB,6BAAQ,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": []
7
7
  }
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
18
18
  return to;
19
19
  };
20
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
25
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
26
  mod
23
27
  ));
@@ -28,5 +32,5 @@ __export(filterable_exports, {
28
32
  });
29
33
  module.exports = __toCommonJS(filterable_exports);
30
34
  var React = __toESM(require("react"));
31
- var import_FilterablePlugin = require("./FilterablePlugin");
35
+ var import_FilterablePlugin = require("./FilterablePlugin.js");
32
36
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/plugins/filterable/index.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["export { FilterablePlugin } from './FilterablePlugin';\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAAiC;",
4
+ "sourcesContent": ["export { FilterablePlugin } from './FilterablePlugin.js';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAAiC;",
6
6
  "names": []
7
7
  }
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
18
18
  return to;
19
19
  };
20
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
25
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
26
  mod
23
27
  ));
@@ -30,7 +34,7 @@ module.exports = __toCommonJS(useFilterableState_exports);
30
34
  var React = __toESM(require("react"));
31
35
  var import_react = require("react");
32
36
  var import_uuid = require("uuid");
33
- var import_helper = require("./helper");
37
+ var import_helper = require("./helper.js");
34
38
  const noop = () => null;
35
39
  function useFilterableState(grid) {
36
40
  const {
@@ -46,18 +50,14 @@ function useFilterableState(grid) {
46
50
  setFilters(filtersProp);
47
51
  }
48
52
  }, [filtersProp]);
49
- const queryFromFilters = (0, import_react.useMemo)(() => (0, import_helper.parseFiltersToQuery)(filters || []), [
50
- filters
51
- ]);
53
+ const queryFromFilters = (0, import_react.useMemo)(() => (0, import_helper.parseFiltersToQuery)(filters || []), [filters]);
52
54
  const handleFiltersChange = (nextFilters) => {
53
55
  const {
54
56
  refs: { body }
55
57
  } = grid.getInstance();
56
58
  body.current.scrollTop = 0;
57
59
  setFilters(nextFilters);
58
- grid.observeRows(
59
- (rows) => onFiltersChange(nextFilters, queryFromFilters, rows)
60
- );
60
+ grid.observeRows((rows) => onFiltersChange(nextFilters, queryFromFilters, rows));
61
61
  };
62
62
  const addFilter = (filter, column) => {
63
63
  let hasBeenCalled = false;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/plugins/filterable/useFilterableState.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { useMemo, useState, useEffect } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\nimport {\n buildFilterArray,\n getFilterValue,\n parseFiltersToQuery,\n} from './helper';\n\nconst noop = () => null;\n\nexport function useFilterableState(grid) {\n const {\n filters: filtersProp,\n onAddFilter = noop,\n onRemoveFilter = noop,\n onRemoveAllFilters = noop,\n onFiltersChange = noop,\n } = grid.props;\n\n const [filters, setFilters] = useState(filtersProp || []);\n\n useEffect(() => {\n if (filtersProp && filtersProp !== filters) {\n setFilters(filtersProp);\n }\n }, [filtersProp]);\n\n const queryFromFilters = useMemo(() => parseFiltersToQuery(filters || []), [\n filters,\n ]);\n\n const handleFiltersChange = (nextFilters) => {\n const {\n refs: { body },\n } = grid.getInstance();\n body.current.scrollTop = 0;\n setFilters(nextFilters);\n grid.observeRows((rows) =>\n onFiltersChange(nextFilters, queryFromFilters, rows),\n );\n };\n\n const addFilter = (filter, column) => {\n let hasBeenCalled = false;\n const trimmedFilter = {\n ...filter,\n value: String(filter.value).trim(),\n };\n /* eslint-disable indent */\n const parsedFilter = !filter.group\n ? {\n ...trimmedFilter,\n value: String(filter.value).trim(),\n group: 'all',\n label: 'All',\n id: uuidv4(),\n }\n : {\n ...trimmedFilter,\n value: String(filter.value).trim(),\n id: uuidv4(),\n label: (column && column.filterLabel) || trimmedFilter.label,\n originalProperty: column.originalProperty || column.property,\n customValue: getFilterValue(trimmedFilter, column),\n };\n /* eslint-enable indent */\n setFilters((prevFilters) => {\n // This was setted for an issue that was recalling this function on the handleFiltersChange\n if (hasBeenCalled) {\n return;\n }\n hasBeenCalled = true;\n\n const nextFilters = buildFilterArray(parsedFilter, prevFilters);\n handleFiltersChange(nextFilters, true);\n onAddFilter(parsedFilter, nextFilters, column);\n });\n };\n\n const removeFilter = ({ group, pill, nextFilters }) => {\n onRemoveFilter(group, pill.value, nextFilters);\n handleFiltersChange(nextFilters);\n };\n\n const removeAllFilters = () => {\n onRemoveAllFilters();\n handleFiltersChange([]);\n };\n return {\n actions: {\n addFilter,\n removeFilter,\n removeAllFilters,\n },\n state: {\n query: queryFromFilters,\n filters,\n },\n };\n}\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA6C;AAC7C,kBAA6B;AAC7B,oBAIO;AAEP,MAAM,OAAO,MAAM;AAEZ,SAAS,mBAAmB,MAAM;AACvC,QAAM;AAAA,IACJ,SAAS;AAAA,IACT,cAAc;AAAA,IACd,iBAAiB;AAAA,IACjB,qBAAqB;AAAA,IACrB,kBAAkB;AAAA,EACpB,IAAI,KAAK;AAET,QAAM,CAAC,SAAS,UAAU,QAAI,uBAAS,eAAe,CAAC,CAAC;AAExD,8BAAU,MAAM;AACd,QAAI,eAAe,gBAAgB,SAAS;AAC1C,iBAAW,WAAW;AAAA,IACxB;AAAA,EACF,GAAG,CAAC,WAAW,CAAC;AAEhB,QAAM,uBAAmB,sBAAQ,UAAM,mCAAoB,WAAW,CAAC,CAAC,GAAG;AAAA,IACzE;A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ACA,SAAO;AAAA,IACL,SAAS;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,OAAO;AAAA,MACL,OAAO;AAAA,MACP;AAAA,IACF;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import { useMemo, useState, useEffect } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\nimport { buildFilterArray, getFilterValue, parseFiltersToQuery } from './helper.js';\n\nconst noop = () => null;\n\nexport function useFilterableState(grid) {\n const {\n filters: filtersProp,\n onAddFilter = noop,\n onRemoveFilter = noop,\n onRemoveAllFilters = noop,\n onFiltersChange = noop,\n } = grid.props;\n\n const [filters, setFilters] = useState(filtersProp || []);\n\n useEffect(() => {\n if (filtersProp && filtersProp !== filters) {\n setFilters(filtersProp);\n }\n }, [filtersProp]);\n\n const queryFromFilters = useMemo(() => parseFiltersToQuery(filters || []), [filters]);\n\n const handleFiltersChange = (nextFilters) => {\n const {\n refs: { body },\n } = grid.getInstance();\n body.current.scrollTop = 0;\n setFilters(nextFilters);\n grid.observeRows((rows) => onFiltersChange(nextFilters, queryFromFilters, rows));\n };\n\n const addFilter = (filter, column) => {\n let hasBeenCalled = false;\n const trimmedFilter = {\n ...filter,\n value: String(filter.value).trim(),\n };\n /* eslint-disable indent */\n const parsedFilter = !filter.group\n ? {\n ...trimmedFilter,\n value: String(filter.value).trim(),\n group: 'all',\n label: 'All',\n id: uuidv4(),\n }\n : {\n ...trimmedFilter,\n value: String(filter.value).trim(),\n id: uuidv4(),\n label: (column && column.filterLabel) || trimmedFilter.label,\n originalProperty: column.originalProperty || column.property,\n customValue: getFilterValue(trimmedFilter, column),\n };\n /* eslint-enable indent */\n setFilters((prevFilters) => {\n // This was setted for an issue that was recalling this function on the handleFiltersChange\n if (hasBeenCalled) {\n return;\n }\n hasBeenCalled = true;\n\n const nextFilters = buildFilterArray(parsedFilter, prevFilters);\n handleFiltersChange(nextFilters, true);\n onAddFilter(parsedFilter, nextFilters, column);\n });\n };\n\n const removeFilter = ({ group, pill, nextFilters }) => {\n onRemoveFilter(group, pill.value, nextFilters);\n handleFiltersChange(nextFilters);\n };\n\n const removeAllFilters = () => {\n onRemoveAllFilters();\n handleFiltersChange([]);\n };\n return {\n actions: {\n addFilter,\n removeFilter,\n removeAllFilters,\n },\n state: {\n query: queryFromFilters,\n filters,\n },\n };\n}\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA6C;AAC7C,kBAA6B;AAC7B,oBAAsE;AAEtE,MAAM,OAAO,MAAM;AAEZ,SAAS,mBAAmB,MAAM;AACvC,QAAM;AAAA,IACJ,SAAS;AAAA,IACT,cAAc;AAAA,IACd,iBAAiB;AAAA,IACjB,qBAAqB;AAAA,IACrB,kBAAkB;AAAA,EACpB,IAAI,KAAK;AAET,QAAM,CAAC,SAAS,UAAU,QAAI,uBAAS,eAAe,CAAC,CAAC;AAExD,8BAAU,MAAM;AACd,QAAI,eAAe,gBAAgB,SAAS;AAC1C,iBAAW,WAAW;AAAA,IACxB;AAAA,EACF,GAAG,CAAC,WAAW,CAAC;AAEhB,QAAM,uBAAmB,sBAAQ,UAAM,mCAAoB,WAAW,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC;AAEpF,QAAM,sBAAsB,CAAC,gBAAgB;AAC3C,UAAM;AAAA,MACJ,MAAM,EAAE,KAAK;AAAA,IACf,IAAI,KAAK,YAAY;AACrB,SAAK,QAAQ,YAAY;AACzB,eAAW,WAAW;AACtB,SAAK,YAAY,CAAC,SAAS,gBAAgB,aAAa,kBAAkB,IAAI,CAAC;AAAA,EACjF;AAEA,QAAM,YAAY,CAAC,QAAQ,WAAW;AACpC,QAAI,gBAAgB;AACpB,UAAM,gBAAgB;AAAA,MACpB,GAAG;AAAA,MACH,OAAO,OAAO,OAAO,KAAK,EAAE,KAAK;AAAA,IACnC;AAEA,UAAM,eAAe,CAAC,OAAO,QACzB;AAAA,MACE,GAAG;AAAA,MACH,OAAO,OAAO,OAAO,KAAK,EAAE,KAAK;AAAA,MACjC,OAAO;AAAA,MACP,OAAO;AAAA,MACP,QAAI,YAAAA,IAAO;AAAA,IACb,IACA;AAAA,MACE,GAAG;AAAA,MACH,OAAO,OAAO,OAAO,KAAK,EAAE,KAAK;AAAA,MACjC,QAAI,YAAAA,IAAO;AAAA,MACX,OAAQ,UAAU,OAAO,eAAgB,cAAc;AAAA,MACvD,kBAAkB,OAAO,oBAAoB,OAAO;AAAA,MACpD,iBAAa,8BAAe,eAAe,MAAM;AAAA,IACnD;AAEJ,eAAW,CAAC,gBAAgB;AAE1B,UAAI,eAAe;AACjB;AAAA,MACF;AACA,sBAAgB;AAEhB,YAAM,kBAAc,gCAAiB,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": ["uuidv4"]
7
7
  }
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
18
18
  return to;
19
19
  };
20
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
25
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
26
  mod
23
27
  ));
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/plugins/grouping-by/GroupingByPlugin.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["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", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAqC;AACrC,oBAAwB;AAExB,MAAM,gBAAgB,CAAC,WAAW,iBAAiB;AACjD,QAAM,cAAU,uBAAQ,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;AAAA,IAClB,UAAU;AAAA,IACV,SAAS;AAAA,EACX,EAAE;AACJ;AAEO,MAAM,uBAAmB,uCAAqB,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,YAA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