@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.
- package/dist/cjs/DSDataGrid.js +145 -2
- package/dist/cjs/DSDataGrid.js.map +2 -2
- package/dist/cjs/DataGridImpl.js +15 -11
- package/dist/cjs/DataGridImpl.js.map +2 -2
- package/dist/cjs/PaginatedDataGrid.js +13 -9
- package/dist/cjs/PaginatedDataGrid.js.map +2 -2
- package/dist/cjs/blockNames.js +4 -0
- package/dist/cjs/blockNames.js.map +1 -1
- package/dist/cjs/columns/IconColumn.js +4 -0
- package/dist/cjs/columns/IconColumn.js.map +1 -1
- package/dist/cjs/columns/NumberColumn.js +4 -0
- package/dist/cjs/columns/NumberColumn.js.map +1 -1
- package/dist/cjs/components/BodyCell.js +6 -0
- package/dist/cjs/components/BodyCell.js.map +1 -1
- package/dist/cjs/components/BodyList.js +7 -5
- package/dist/cjs/components/BodyList.js.map +2 -2
- package/dist/cjs/components/ColumnVisibilityMenuOption.js +5 -6
- package/dist/cjs/components/ColumnVisibilityMenuOption.js.map +2 -2
- package/dist/cjs/components/ColumnsOptionsMenuSection.js +7 -11
- package/dist/cjs/components/ColumnsOptionsMenuSection.js.map +2 -2
- package/dist/cjs/components/EmptyState.js +9 -6
- package/dist/cjs/components/EmptyState.js.map +3 -3
- package/dist/cjs/components/HeaderCell.js +4 -0
- package/dist/cjs/components/HeaderCell.js.map +1 -1
- package/dist/cjs/components/List.js +6 -2
- package/dist/cjs/components/List.js.map +2 -2
- package/dist/cjs/components/ListItem.js +7 -6
- package/dist/cjs/components/ListItem.js.map +2 -2
- package/dist/cjs/components/NoResults.js +8 -10
- package/dist/cjs/components/NoResults.js.map +2 -2
- package/dist/cjs/components/RowsLoader.js +5 -1
- package/dist/cjs/components/RowsLoader.js.map +2 -2
- package/dist/cjs/components/Table.js +9 -5
- package/dist/cjs/components/Table.js.map +2 -2
- package/dist/cjs/components/TableBody.js +6 -7
- package/dist/cjs/components/TableBody.js.map +2 -2
- package/dist/cjs/components/TableHeader.js +5 -1
- package/dist/cjs/components/TableHeader.js.map +2 -2
- package/dist/cjs/components/footer/addOptionalFooterComponents.js +5 -1
- package/dist/cjs/components/footer/addOptionalFooterComponents.js.map +2 -2
- package/dist/cjs/components/header/PrimaryControls.js +4 -0
- package/dist/cjs/components/header/PrimaryControls.js.map +1 -1
- package/dist/cjs/components/header/addOptionalHeaderComponents.js +4 -0
- package/dist/cjs/components/header/addOptionalHeaderComponents.js.map +1 -1
- package/dist/cjs/components/index.js +9 -5
- package/dist/cjs/components/index.js.map +2 -2
- package/dist/cjs/components/renderers/defaultClassedRenderers.js +20 -36
- package/dist/cjs/components/renderers/defaultClassedRenderers.js.map +2 -2
- package/dist/cjs/components/renderers/index.js +6 -2
- package/dist/cjs/components/renderers/index.js.map +2 -2
- package/dist/cjs/components/renderers/renderRowsLoader.js +6 -4
- package/dist/cjs/components/renderers/renderRowsLoader.js.map +2 -2
- package/dist/cjs/components/tableContext.js +4 -0
- package/dist/cjs/components/tableContext.js.map +1 -1
- package/dist/cjs/defaultPlugins.js +9 -10
- package/dist/cjs/defaultPlugins.js.map +2 -2
- package/dist/cjs/index.js +13 -9
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js +26 -18
- package/dist/cjs/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js.map +2 -2
- package/dist/cjs/plugins/body-header-scroll-sync/index.js +5 -1
- package/dist/cjs/plugins/body-header-scroll-sync/index.js.map +2 -2
- package/dist/cjs/plugins/column-dnd/DndColumnsPlugin.js +5 -1
- package/dist/cjs/plugins/column-dnd/DndColumnsPlugin.js.map +2 -2
- package/dist/cjs/plugins/column-dnd/decorateGridWithDndColumns.js +4 -0
- package/dist/cjs/plugins/column-dnd/decorateGridWithDndColumns.js.map +1 -1
- package/dist/cjs/plugins/column-dnd/index.js +5 -1
- package/dist/cjs/plugins/column-dnd/index.js.map +2 -2
- package/dist/cjs/plugins/column-sizing/ColumnSizingPlugin.js +8 -4
- package/dist/cjs/plugins/column-sizing/ColumnSizingPlugin.js.map +2 -2
- package/dist/cjs/plugins/column-sizing/columnMeasurerTransformer.js +4 -0
- package/dist/cjs/plugins/column-sizing/columnMeasurerTransformer.js.map +1 -1
- package/dist/cjs/plugins/column-sizing/ext-points/decorateColumn.js +5 -1
- package/dist/cjs/plugins/column-sizing/ext-points/decorateColumn.js.map +2 -2
- package/dist/cjs/plugins/column-sizing/ext-points/getTableProps.js +5 -1
- package/dist/cjs/plugins/column-sizing/ext-points/getTableProps.js.map +2 -2
- package/dist/cjs/plugins/column-sizing/getColumnNameFromProperty.js +4 -0
- package/dist/cjs/plugins/column-sizing/getColumnNameFromProperty.js.map +1 -1
- package/dist/cjs/plugins/column-sizing/index.js +5 -1
- package/dist/cjs/plugins/column-sizing/index.js.map +2 -2
- package/dist/cjs/plugins/column-sizing/useColumnSizeService.js +11 -26
- package/dist/cjs/plugins/column-sizing/useColumnSizeService.js.map +2 -2
- package/dist/cjs/plugins/column-sizing/useStylesheetHelpers.js +7 -2
- package/dist/cjs/plugins/column-sizing/useStylesheetHelpers.js.map +2 -2
- package/dist/cjs/plugins/column-sizing/utils.js +4 -0
- package/dist/cjs/plugins/column-sizing/utils.js.map +1 -1
- package/dist/cjs/plugins/custom-cell-renderer/CustomRendererPlugin.js +5 -1
- package/dist/cjs/plugins/custom-cell-renderer/CustomRendererPlugin.js.map +2 -2
- package/dist/cjs/plugins/custom-cell-renderer/addCustomRendererToCell.js +6 -1
- package/dist/cjs/plugins/custom-cell-renderer/addCustomRendererToCell.js.map +2 -2
- package/dist/cjs/plugins/custom-cell-renderer/getRendererComponent.js +5 -1
- package/dist/cjs/plugins/custom-cell-renderer/getRendererComponent.js.map +2 -2
- package/dist/cjs/plugins/custom-cell-renderer/index.js +5 -1
- package/dist/cjs/plugins/custom-cell-renderer/index.js.map +2 -2
- package/dist/cjs/plugins/editable/EditableComponents/ComboBox.js +4 -0
- package/dist/cjs/plugins/editable/EditableComponents/ComboBox.js.map +2 -2
- package/dist/cjs/plugins/editable/EditableComponents/TextBox.js +4 -0
- package/dist/cjs/plugins/editable/EditableComponents/TextBox.js.map +2 -2
- package/dist/cjs/plugins/editable/EditableComponents/index.js +6 -2
- package/dist/cjs/plugins/editable/EditableComponents/index.js.map +2 -2
- package/dist/cjs/plugins/editable/EditablePlugin.js +5 -1
- package/dist/cjs/plugins/editable/EditablePlugin.js.map +2 -2
- package/dist/cjs/plugins/editable/decorateEditable.js +5 -1
- package/dist/cjs/plugins/editable/decorateEditable.js.map +2 -2
- package/dist/cjs/plugins/editable/getEditorComponent.js +7 -16
- package/dist/cjs/plugins/editable/getEditorComponent.js.map +2 -2
- package/dist/cjs/plugins/editable/index.js +6 -2
- package/dist/cjs/plugins/editable/index.js.map +2 -2
- package/dist/cjs/plugins/expandable-grid/ExpandableColumn.js +27 -25
- package/dist/cjs/plugins/expandable-grid/ExpandableColumn.js.map +2 -2
- package/dist/cjs/plugins/expandable-grid/ExpandablePlugin.js +9 -5
- package/dist/cjs/plugins/expandable-grid/ExpandablePlugin.js.map +2 -2
- package/dist/cjs/plugins/expandable-grid/ExpandedRow.js +10 -6
- package/dist/cjs/plugins/expandable-grid/ExpandedRow.js.map +2 -2
- package/dist/cjs/plugins/expandable-grid/ExpandedRowExtra.js +16 -8
- package/dist/cjs/plugins/expandable-grid/ExpandedRowExtra.js.map +2 -2
- package/dist/cjs/plugins/expandable-grid/index.js +6 -2
- package/dist/cjs/plugins/expandable-grid/index.js.map +2 -2
- package/dist/cjs/plugins/expandable-grid/useExpandGridState.js +4 -0
- package/dist/cjs/plugins/expandable-grid/useExpandGridState.js.map +2 -2
- package/dist/cjs/plugins/export-data/ExportDataPlugin.js +4 -0
- package/dist/cjs/plugins/export-data/ExportDataPlugin.js.map +1 -1
- package/dist/cjs/plugins/export-data/index.js +5 -1
- package/dist/cjs/plugins/export-data/index.js.map +2 -2
- package/dist/cjs/plugins/filterable/FilterablePlugin.js +7 -3
- package/dist/cjs/plugins/filterable/FilterablePlugin.js.map +2 -2
- package/dist/cjs/plugins/filterable/addFilterToColumn.js +5 -1
- package/dist/cjs/plugins/filterable/addFilterToColumn.js.map +2 -2
- package/dist/cjs/plugins/filterable/components/FilterableHeader.js +5 -1
- package/dist/cjs/plugins/filterable/components/FilterableHeader.js.map +2 -2
- package/dist/cjs/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js +50 -47
- package/dist/cjs/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js.map +2 -2
- package/dist/cjs/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js +50 -48
- package/dist/cjs/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js.map +2 -2
- package/dist/cjs/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js +48 -45
- package/dist/cjs/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js.map +2 -2
- package/dist/cjs/plugins/filterable/components/filterable-menus/TextFilterMenu.js +7 -3
- package/dist/cjs/plugins/filterable/components/filterable-menus/TextFilterMenu.js.map +2 -2
- package/dist/cjs/plugins/filterable/components/filterable-menus/defaultDateFormat.js +4 -0
- package/dist/cjs/plugins/filterable/components/filterable-menus/defaultDateFormat.js.map +1 -1
- package/dist/cjs/plugins/filterable/components/filterable-menus/getFilterMenuByType.js +9 -7
- package/dist/cjs/plugins/filterable/components/filterable-menus/getFilterMenuByType.js.map +2 -2
- package/dist/cjs/plugins/filterable/filterableFormatter.js +33 -37
- package/dist/cjs/plugins/filterable/filterableFormatter.js.map +2 -2
- package/dist/cjs/plugins/filterable/filtering-helper/filterRowsByQuery.js +6 -4
- package/dist/cjs/plugins/filterable/filtering-helper/filterRowsByQuery.js.map +2 -2
- package/dist/cjs/plugins/filterable/filtering-helper/strategiesOperators.js +4 -0
- package/dist/cjs/plugins/filterable/filtering-helper/strategiesOperators.js.map +2 -2
- package/dist/cjs/plugins/filterable/helper.js +4 -0
- package/dist/cjs/plugins/filterable/helper.js.map +2 -2
- package/dist/cjs/plugins/filterable/index.js +5 -1
- package/dist/cjs/plugins/filterable/index.js.map +2 -2
- package/dist/cjs/plugins/filterable/useFilterableState.js +7 -7
- package/dist/cjs/plugins/filterable/useFilterableState.js.map +2 -2
- package/dist/cjs/plugins/grouping-by/GroupingByPlugin.js +4 -0
- package/dist/cjs/plugins/grouping-by/GroupingByPlugin.js.map +1 -1
- package/dist/cjs/plugins/grouping-grid/GroupingPlugin.js +19 -11
- package/dist/cjs/plugins/grouping-grid/GroupingPlugin.js.map +2 -2
- package/dist/cjs/plugins/grouping-grid/walkStrategy.js +4 -0
- package/dist/cjs/plugins/grouping-grid/walkStrategy.js.map +2 -2
- package/dist/cjs/plugins/index.js +20 -16
- package/dist/cjs/plugins/index.js.map +2 -2
- package/dist/cjs/plugins/infinite-scrolling/InfiniteScrollPlugin.js +4 -0
- package/dist/cjs/plugins/infinite-scrolling/InfiniteScrollPlugin.js.map +1 -1
- package/dist/cjs/plugins/infinite-scrolling/index.js +5 -1
- package/dist/cjs/plugins/infinite-scrolling/index.js.map +2 -2
- package/dist/cjs/plugins/pagination/PaginationPlugin.js +9 -4
- package/dist/cjs/plugins/pagination/PaginationPlugin.js.map +2 -2
- package/dist/cjs/plugins/pagination/components/Pagination.js +9 -24
- package/dist/cjs/plugins/pagination/components/Pagination.js.map +2 -2
- package/dist/cjs/plugins/pagination/components/Paginator.js +15 -10
- package/dist/cjs/plugins/pagination/components/Paginator.js.map +2 -2
- package/dist/cjs/plugins/pagination/components/PerPageDropdown.js +6 -2
- package/dist/cjs/plugins/pagination/components/PerPageDropdown.js.map +2 -2
- package/dist/cjs/plugins/pagination/helper.js +4 -0
- package/dist/cjs/plugins/pagination/helper.js.map +2 -2
- package/dist/cjs/plugins/pagination/index.js +5 -1
- package/dist/cjs/plugins/pagination/index.js.map +2 -2
- package/dist/cjs/plugins/pagination/usePaginationState.js +5 -1
- package/dist/cjs/plugins/pagination/usePaginationState.js.map +2 -2
- package/dist/cjs/plugins/resizable/ResizablePlugin.js +5 -1
- package/dist/cjs/plugins/resizable/ResizablePlugin.js.map +2 -2
- package/dist/cjs/plugins/resizable/decorateResizable.js +8 -2
- package/dist/cjs/plugins/resizable/decorateResizable.js.map +2 -2
- package/dist/cjs/plugins/resizable/index.js +5 -1
- package/dist/cjs/plugins/resizable/index.js.map +2 -2
- package/dist/cjs/plugins/resizable/useResizeHandle.js +10 -13
- package/dist/cjs/plugins/resizable/useResizeHandle.js.map +2 -2
- package/dist/cjs/plugins/resizable/utils.js +4 -0
- package/dist/cjs/plugins/resizable/utils.js.map +1 -1
- package/dist/cjs/plugins/row-dnd/DndRowsPlugin.js +5 -0
- package/dist/cjs/plugins/row-dnd/DndRowsPlugin.js.map +1 -1
- package/dist/cjs/plugins/row-dnd/index.js +5 -1
- package/dist/cjs/plugins/row-dnd/index.js.map +2 -2
- package/dist/cjs/plugins/selectable/SelectablePlugin.js +7 -3
- package/dist/cjs/plugins/selectable/SelectablePlugin.js.map +2 -2
- package/dist/cjs/plugins/selectable/addSelectableColumn.js +7 -1
- package/dist/cjs/plugins/selectable/addSelectableColumn.js.map +2 -2
- package/dist/cjs/plugins/selectable/helper.js +4 -0
- package/dist/cjs/plugins/selectable/helper.js.map +1 -1
- package/dist/cjs/plugins/selectable/index.js +5 -1
- package/dist/cjs/plugins/selectable/index.js.map +2 -2
- package/dist/cjs/plugins/selectable/selectableFormatter.js +5 -1
- package/dist/cjs/plugins/selectable/selectableFormatter.js.map +2 -2
- package/dist/cjs/plugins/selectable/useSelectableState.js +7 -1
- package/dist/cjs/plugins/selectable/useSelectableState.js.map +2 -2
- package/dist/cjs/plugins/sortable/SortablePlugin.js +7 -3
- package/dist/cjs/plugins/sortable/SortablePlugin.js.map +2 -2
- package/dist/cjs/plugins/sortable/checkIfSortable.js +4 -0
- package/dist/cjs/plugins/sortable/checkIfSortable.js.map +1 -1
- package/dist/cjs/plugins/sortable/index.js +5 -1
- package/dist/cjs/plugins/sortable/index.js.map +2 -2
- package/dist/cjs/plugins/sortable/sortHeaderFormatter.js +4 -0
- package/dist/cjs/plugins/sortable/sortHeaderFormatter.js.map +1 -1
- package/dist/cjs/plugins/sortable/sortTree.js +4 -0
- package/dist/cjs/plugins/sortable/sortTree.js.map +2 -2
- package/dist/cjs/plugins/sortable/sorter.js +5 -0
- package/dist/cjs/plugins/sortable/sorter.js.map +1 -1
- package/dist/cjs/plugins/sortable/useSortableState.js +6 -4
- package/dist/cjs/plugins/sortable/useSortableState.js.map +2 -2
- package/dist/cjs/plugins/toolbar/RowRenderer.js +7 -2
- package/dist/cjs/plugins/toolbar/RowRenderer.js.map +2 -2
- package/dist/cjs/plugins/toolbar/ToolbarPlugin.js +5 -1
- package/dist/cjs/plugins/toolbar/ToolbarPlugin.js.map +2 -2
- package/dist/cjs/plugins/toolbar/ToolbarTrigger.js +5 -0
- package/dist/cjs/plugins/toolbar/ToolbarTrigger.js.map +1 -1
- package/dist/cjs/plugins/toolbar/index.js +5 -1
- package/dist/cjs/plugins/toolbar/index.js.map +2 -2
- package/dist/cjs/plugins/virtualization/AutoHeightList.js +4 -0
- package/dist/cjs/plugins/virtualization/AutoHeightList.js.map +2 -2
- package/dist/cjs/plugins/virtualization/VirtualizationPlugin.js +8 -2
- package/dist/cjs/plugins/virtualization/VirtualizationPlugin.js.map +2 -2
- package/dist/cjs/plugins/virtualization/VirtualizedBody.js +9 -4
- package/dist/cjs/plugins/virtualization/VirtualizedBody.js.map +2 -2
- package/dist/cjs/plugins/virtualization/VirtualizedBodyRow.js +5 -0
- package/dist/cjs/plugins/virtualization/VirtualizedBodyRow.js.map +1 -1
- package/dist/cjs/plugins/virtualization/helper.js +4 -0
- package/dist/cjs/plugins/virtualization/helper.js.map +1 -1
- package/dist/cjs/plugins/virtualization/index.js +5 -1
- package/dist/cjs/plugins/virtualization/index.js.map +2 -2
- package/dist/cjs/renders/CellWithAddons.js +15 -1
- package/dist/cjs/renders/CellWithAddons.js.map +2 -2
- package/dist/cjs/renders/index.js +6 -2
- package/dist/cjs/renders/index.js.map +2 -2
- package/dist/cjs/renders/styled.js +4 -0
- package/dist/cjs/renders/styled.js.map +1 -1
- package/dist/cjs/rowSizes.js +5 -5
- package/dist/cjs/rowSizes.js.map +2 -2
- package/dist/cjs/utilities/getPluginsFromProps.js +17 -13
- package/dist/cjs/utilities/getPluginsFromProps.js.map +2 -2
- package/dist/cjs/utilities/getScrollbarSize.js +4 -0
- package/dist/cjs/utilities/getScrollbarSize.js.map +1 -1
- package/dist/cjs/utilities/normalizeData.js +4 -0
- package/dist/cjs/utilities/normalizeData.js.map +2 -2
- package/dist/esm/DSDataGrid.js +141 -2
- package/dist/esm/DSDataGrid.js.map +2 -2
- package/dist/esm/DataGridImpl.js +11 -11
- package/dist/esm/DataGridImpl.js.map +2 -2
- package/dist/esm/PaginatedDataGrid.js +9 -9
- package/dist/esm/PaginatedDataGrid.js.map +2 -2
- package/dist/esm/columns/IconColumn.js.map +1 -1
- package/dist/esm/components/BodyCell.js +2 -0
- package/dist/esm/components/BodyCell.js.map +1 -1
- package/dist/esm/components/BodyList.js +3 -5
- package/dist/esm/components/BodyList.js.map +2 -2
- package/dist/esm/components/ColumnVisibilityMenuOption.js +1 -6
- package/dist/esm/components/ColumnVisibilityMenuOption.js.map +2 -2
- package/dist/esm/components/ColumnsOptionsMenuSection.js +3 -11
- package/dist/esm/components/ColumnsOptionsMenuSection.js.map +2 -2
- package/dist/esm/components/EmptyState.js +1 -2
- package/dist/esm/components/EmptyState.js.map +2 -2
- package/dist/esm/components/List.js +2 -2
- package/dist/esm/components/List.js.map +2 -2
- package/dist/esm/components/ListItem.js +3 -6
- package/dist/esm/components/ListItem.js.map +2 -2
- package/dist/esm/components/NoResults.js +4 -10
- package/dist/esm/components/NoResults.js.map +2 -2
- package/dist/esm/components/RowsLoader.js +1 -1
- package/dist/esm/components/RowsLoader.js.map +1 -1
- package/dist/esm/components/Table.js +5 -5
- package/dist/esm/components/Table.js.map +2 -2
- package/dist/esm/components/TableBody.js +2 -7
- package/dist/esm/components/TableBody.js.map +2 -2
- package/dist/esm/components/TableHeader.js +1 -1
- package/dist/esm/components/TableHeader.js.map +2 -2
- package/dist/esm/components/footer/addOptionalFooterComponents.js +1 -1
- package/dist/esm/components/footer/addOptionalFooterComponents.js.map +1 -1
- package/dist/esm/components/index.js +5 -5
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/components/renderers/defaultClassedRenderers.js +16 -40
- package/dist/esm/components/renderers/defaultClassedRenderers.js.map +2 -2
- package/dist/esm/components/renderers/index.js +2 -2
- package/dist/esm/components/renderers/index.js.map +1 -1
- package/dist/esm/components/renderers/renderRowsLoader.js +2 -4
- package/dist/esm/components/renderers/renderRowsLoader.js.map +2 -2
- package/dist/esm/defaultPlugins.js +5 -10
- package/dist/esm/defaultPlugins.js.map +2 -2
- package/dist/esm/index.js +9 -9
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/package.json +7 -0
- package/dist/esm/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js +22 -18
- package/dist/esm/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js.map +2 -2
- package/dist/esm/plugins/body-header-scroll-sync/index.js +1 -1
- package/dist/esm/plugins/body-header-scroll-sync/index.js.map +1 -1
- package/dist/esm/plugins/column-dnd/DndColumnsPlugin.js +1 -1
- package/dist/esm/plugins/column-dnd/DndColumnsPlugin.js.map +2 -2
- package/dist/esm/plugins/column-dnd/index.js +1 -1
- package/dist/esm/plugins/column-dnd/index.js.map +1 -1
- package/dist/esm/plugins/column-sizing/ColumnSizingPlugin.js +4 -4
- package/dist/esm/plugins/column-sizing/ColumnSizingPlugin.js.map +1 -1
- package/dist/esm/plugins/column-sizing/columnMeasurerTransformer.js.map +1 -1
- package/dist/esm/plugins/column-sizing/ext-points/decorateColumn.js +1 -1
- package/dist/esm/plugins/column-sizing/ext-points/decorateColumn.js.map +1 -1
- package/dist/esm/plugins/column-sizing/ext-points/getTableProps.js +1 -1
- package/dist/esm/plugins/column-sizing/ext-points/getTableProps.js.map +1 -1
- package/dist/esm/plugins/column-sizing/index.js +1 -1
- package/dist/esm/plugins/column-sizing/index.js.map +1 -1
- package/dist/esm/plugins/column-sizing/useColumnSizeService.js +7 -26
- package/dist/esm/plugins/column-sizing/useColumnSizeService.js.map +2 -2
- package/dist/esm/plugins/column-sizing/useStylesheetHelpers.js +3 -2
- package/dist/esm/plugins/column-sizing/useStylesheetHelpers.js.map +2 -2
- package/dist/esm/plugins/column-sizing/utils.js.map +1 -1
- package/dist/esm/plugins/custom-cell-renderer/CustomRendererPlugin.js +1 -1
- package/dist/esm/plugins/custom-cell-renderer/CustomRendererPlugin.js.map +1 -1
- package/dist/esm/plugins/custom-cell-renderer/addCustomRendererToCell.js +2 -1
- package/dist/esm/plugins/custom-cell-renderer/addCustomRendererToCell.js.map +2 -2
- package/dist/esm/plugins/custom-cell-renderer/getRendererComponent.js +1 -1
- package/dist/esm/plugins/custom-cell-renderer/getRendererComponent.js.map +2 -2
- package/dist/esm/plugins/custom-cell-renderer/index.js +1 -1
- package/dist/esm/plugins/custom-cell-renderer/index.js.map +1 -1
- package/dist/esm/plugins/editable/EditableComponents/ComboBox.js.map +1 -1
- package/dist/esm/plugins/editable/EditableComponents/TextBox.js.map +1 -1
- package/dist/esm/plugins/editable/EditableComponents/index.js +2 -2
- package/dist/esm/plugins/editable/EditableComponents/index.js.map +1 -1
- package/dist/esm/plugins/editable/EditablePlugin.js +1 -1
- package/dist/esm/plugins/editable/EditablePlugin.js.map +2 -2
- package/dist/esm/plugins/editable/decorateEditable.js +1 -1
- package/dist/esm/plugins/editable/decorateEditable.js.map +2 -2
- package/dist/esm/plugins/editable/getEditorComponent.js +3 -16
- package/dist/esm/plugins/editable/getEditorComponent.js.map +2 -2
- package/dist/esm/plugins/editable/index.js +2 -2
- package/dist/esm/plugins/editable/index.js.map +1 -1
- package/dist/esm/plugins/expandable-grid/ExpandableColumn.js +23 -25
- package/dist/esm/plugins/expandable-grid/ExpandableColumn.js.map +2 -2
- package/dist/esm/plugins/expandable-grid/ExpandablePlugin.js +5 -5
- package/dist/esm/plugins/expandable-grid/ExpandablePlugin.js.map +2 -2
- package/dist/esm/plugins/expandable-grid/ExpandedRow.js +6 -6
- package/dist/esm/plugins/expandable-grid/ExpandedRow.js.map +2 -2
- package/dist/esm/plugins/expandable-grid/ExpandedRowExtra.js +12 -8
- package/dist/esm/plugins/expandable-grid/ExpandedRowExtra.js.map +2 -2
- package/dist/esm/plugins/expandable-grid/index.js +2 -2
- package/dist/esm/plugins/expandable-grid/index.js.map +1 -1
- package/dist/esm/plugins/expandable-grid/useExpandGridState.js.map +2 -2
- package/dist/esm/plugins/export-data/ExportDataPlugin.js.map +1 -1
- package/dist/esm/plugins/export-data/index.js +1 -1
- package/dist/esm/plugins/export-data/index.js.map +1 -1
- package/dist/esm/plugins/filterable/FilterablePlugin.js +3 -3
- package/dist/esm/plugins/filterable/FilterablePlugin.js.map +2 -2
- package/dist/esm/plugins/filterable/addFilterToColumn.js +1 -1
- package/dist/esm/plugins/filterable/addFilterToColumn.js.map +1 -1
- package/dist/esm/plugins/filterable/components/FilterableHeader.js +1 -1
- package/dist/esm/plugins/filterable/components/FilterableHeader.js.map +2 -2
- package/dist/esm/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js +46 -47
- package/dist/esm/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js.map +2 -2
- package/dist/esm/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js +46 -48
- package/dist/esm/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js.map +2 -2
- package/dist/esm/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js +44 -45
- package/dist/esm/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js.map +2 -2
- package/dist/esm/plugins/filterable/components/filterable-menus/TextFilterMenu.js +3 -3
- package/dist/esm/plugins/filterable/components/filterable-menus/TextFilterMenu.js.map +2 -2
- package/dist/esm/plugins/filterable/components/filterable-menus/getFilterMenuByType.js +5 -7
- package/dist/esm/plugins/filterable/components/filterable-menus/getFilterMenuByType.js.map +2 -2
- package/dist/esm/plugins/filterable/filterableFormatter.js +29 -37
- package/dist/esm/plugins/filterable/filterableFormatter.js.map +2 -2
- package/dist/esm/plugins/filterable/filtering-helper/filterRowsByQuery.js +2 -4
- package/dist/esm/plugins/filterable/filtering-helper/filterRowsByQuery.js.map +2 -2
- package/dist/esm/plugins/filterable/filtering-helper/strategiesOperators.js.map +2 -2
- package/dist/esm/plugins/filterable/helper.js +1 -7
- package/dist/esm/plugins/filterable/helper.js.map +2 -2
- package/dist/esm/plugins/filterable/index.js +1 -1
- package/dist/esm/plugins/filterable/index.js.map +1 -1
- package/dist/esm/plugins/filterable/useFilterableState.js +3 -11
- package/dist/esm/plugins/filterable/useFilterableState.js.map +2 -2
- package/dist/esm/plugins/grouping-by/GroupingByPlugin.js.map +1 -1
- package/dist/esm/plugins/grouping-grid/GroupingPlugin.js +15 -11
- package/dist/esm/plugins/grouping-grid/GroupingPlugin.js.map +2 -2
- package/dist/esm/plugins/grouping-grid/walkStrategy.js.map +2 -2
- package/dist/esm/plugins/index.js +16 -16
- package/dist/esm/plugins/index.js.map +1 -1
- package/dist/esm/plugins/infinite-scrolling/InfiniteScrollPlugin.js.map +1 -1
- package/dist/esm/plugins/infinite-scrolling/index.js +1 -1
- package/dist/esm/plugins/infinite-scrolling/index.js.map +1 -1
- package/dist/esm/plugins/pagination/PaginationPlugin.js +5 -4
- package/dist/esm/plugins/pagination/PaginationPlugin.js.map +2 -2
- package/dist/esm/plugins/pagination/components/Pagination.js +5 -24
- package/dist/esm/plugins/pagination/components/Pagination.js.map +2 -2
- package/dist/esm/plugins/pagination/components/Paginator.js +12 -11
- package/dist/esm/plugins/pagination/components/Paginator.js.map +2 -2
- package/dist/esm/plugins/pagination/components/PerPageDropdown.js +2 -2
- package/dist/esm/plugins/pagination/components/PerPageDropdown.js.map +2 -2
- package/dist/esm/plugins/pagination/helper.js.map +2 -2
- package/dist/esm/plugins/pagination/index.js +1 -1
- package/dist/esm/plugins/pagination/index.js.map +1 -1
- package/dist/esm/plugins/pagination/usePaginationState.js +1 -1
- package/dist/esm/plugins/pagination/usePaginationState.js.map +1 -1
- package/dist/esm/plugins/resizable/ResizablePlugin.js +1 -1
- package/dist/esm/plugins/resizable/ResizablePlugin.js.map +2 -2
- package/dist/esm/plugins/resizable/decorateResizable.js +4 -2
- package/dist/esm/plugins/resizable/decorateResizable.js.map +2 -2
- package/dist/esm/plugins/resizable/index.js +1 -1
- package/dist/esm/plugins/resizable/index.js.map +1 -1
- package/dist/esm/plugins/resizable/useResizeHandle.js +6 -13
- package/dist/esm/plugins/resizable/useResizeHandle.js.map +2 -2
- package/dist/esm/plugins/row-dnd/DndRowsPlugin.js +1 -0
- package/dist/esm/plugins/row-dnd/DndRowsPlugin.js.map +1 -1
- package/dist/esm/plugins/row-dnd/index.js +1 -1
- package/dist/esm/plugins/row-dnd/index.js.map +1 -1
- package/dist/esm/plugins/selectable/SelectablePlugin.js +3 -3
- package/dist/esm/plugins/selectable/SelectablePlugin.js.map +2 -2
- package/dist/esm/plugins/selectable/addSelectableColumn.js +3 -1
- package/dist/esm/plugins/selectable/addSelectableColumn.js.map +2 -2
- package/dist/esm/plugins/selectable/helper.js.map +1 -1
- package/dist/esm/plugins/selectable/index.js +1 -1
- package/dist/esm/plugins/selectable/index.js.map +1 -1
- package/dist/esm/plugins/selectable/selectableFormatter.js +1 -1
- package/dist/esm/plugins/selectable/selectableFormatter.js.map +2 -2
- package/dist/esm/plugins/selectable/useSelectableState.js +3 -5
- package/dist/esm/plugins/selectable/useSelectableState.js.map +2 -2
- package/dist/esm/plugins/sortable/SortablePlugin.js +3 -3
- package/dist/esm/plugins/sortable/SortablePlugin.js.map +2 -2
- package/dist/esm/plugins/sortable/checkIfSortable.js.map +1 -1
- package/dist/esm/plugins/sortable/index.js +1 -1
- package/dist/esm/plugins/sortable/index.js.map +1 -1
- package/dist/esm/plugins/sortable/sortHeaderFormatter.js.map +1 -1
- package/dist/esm/plugins/sortable/sortTree.js.map +2 -2
- package/dist/esm/plugins/sortable/sorter.js +1 -0
- package/dist/esm/plugins/sortable/sorter.js.map +1 -1
- package/dist/esm/plugins/sortable/useSortableState.js +2 -4
- package/dist/esm/plugins/sortable/useSortableState.js.map +2 -2
- package/dist/esm/plugins/toolbar/RowRenderer.js +3 -2
- package/dist/esm/plugins/toolbar/RowRenderer.js.map +2 -2
- package/dist/esm/plugins/toolbar/ToolbarPlugin.js +1 -1
- package/dist/esm/plugins/toolbar/ToolbarPlugin.js.map +2 -2
- package/dist/esm/plugins/toolbar/ToolbarTrigger.js +1 -0
- package/dist/esm/plugins/toolbar/ToolbarTrigger.js.map +1 -1
- package/dist/esm/plugins/toolbar/index.js +1 -1
- package/dist/esm/plugins/toolbar/index.js.map +1 -1
- package/dist/esm/plugins/virtualization/AutoHeightList.js.map +2 -2
- package/dist/esm/plugins/virtualization/VirtualizationPlugin.js +4 -2
- package/dist/esm/plugins/virtualization/VirtualizationPlugin.js.map +2 -2
- package/dist/esm/plugins/virtualization/VirtualizedBody.js +5 -4
- package/dist/esm/plugins/virtualization/VirtualizedBody.js.map +2 -2
- package/dist/esm/plugins/virtualization/VirtualizedBodyRow.js +1 -0
- package/dist/esm/plugins/virtualization/VirtualizedBodyRow.js.map +1 -1
- package/dist/esm/plugins/virtualization/index.js +1 -1
- package/dist/esm/plugins/virtualization/index.js.map +1 -1
- package/dist/esm/renders/CellWithAddons.js +11 -1
- package/dist/esm/renders/CellWithAddons.js.map +2 -2
- package/dist/esm/renders/index.js +2 -2
- package/dist/esm/renders/index.js.map +1 -1
- package/dist/esm/renders/styled.js.map +1 -1
- package/dist/esm/rowSizes.js +1 -5
- package/dist/esm/rowSizes.js.map +2 -2
- package/dist/esm/utilities/getPluginsFromProps.js +13 -13
- package/dist/esm/utilities/getPluginsFromProps.js.map +2 -2
- package/dist/esm/utilities/normalizeData.js.map +2 -2
- package/package.json +25 -25
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../../src/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.tsx"],
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useEffect, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { DSControlledDateRangePicker } from '@elliemae/ds-controlled-form';\nimport { DSPopper, PopperPositions as Position } from '@elliemae/ds-popper';\nimport { DatePicker2 } from '@elliemae/ds-icons';\nimport { DSButton } from '@elliemae/ds-button';\nimport moment from 'moment';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { DEFAULT_DATE_FORMAT } from './defaultDateFormat';\n\nconst blockname = 'date-range';\nconst Wrapper = aggregatedClasses('div')(blockname, 'wrapper');\nconst Header = aggregatedClasses('div')(blockname, 'header');\n\n// const randomString = (maxLength = 5) => Math.random().toString(36).slice(-maxLength);\n\nconst DateRangePickerContainer = ({ onChange = () => null, showHeader }) => {\n const [startDate, setStartDate] = useState('');\n const [endDate, setEndDate] = useState('');\n\n // For some reason it worked like this\n const [lastChangeWasPicker, setLastChangeWasPicker] = useState(false);\n\n useEffect(() => {\n const startMoment = moment(startDate);\n const endMoment = moment(endDate);\n if (\n lastChangeWasPicker &&\n startDate &&\n !startDate.includes('_') &&\n endDate &&\n !endDate.includes('_') &&\n endMoment.diff(startMoment) >= 0\n ) {\n onChange({ startDate: startMoment, endDate: endMoment });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [startDate, endDate, lastChangeWasPicker]);\n\n return (\n <Wrapper\n data-testid=\"date-range__wrapper\"\n onKeyDown={(e) => e.code === 'Enter' && setLastChangeWasPicker(true)}\n style={{ backgroundColor: 'white', boxShadow: '0 6px 20px 0 rgb(0 0 0 / 24%)', width: '261px' }}\n >\n {showHeader && (\n <Header style={{ padding: '8px', display: 'flex', justifyContent: 'center' }}>\n <DSControlledDateRangePicker\n fromDate={startDate}\n onFromDateChange={(_start) => {\n setStartDate(_start);\n setLastChangeWasPicker(false);\n }}\n toDate={endDate}\n onToDateChange={(_end) => {\n setEndDate(_end);\n setLastChangeWasPicker(false);\n }}\n type=\"date-range-inputs\"\n />\n </Header>\n )}\n <DSControlledDateRangePicker\n fromDate={startDate}\n onFromDateChange={(_start) => {\n setStartDate(_start);\n setLastChangeWasPicker(true);\n }}\n toDate={endDate}\n onToDateChange={(_end) => {\n setEndDate(_end);\n setLastChangeWasPicker(true);\n }}\n type=\"date-range-picker-controller-only\"\n />\n </Wrapper>\n );\n};\n\nDateRangePickerContainer.propTypes = {\n onChange: PropTypes.func,\n showHeader: PropTypes.bool,\n};\n\nconst formatRangeDate = ({ startDate, endDate }, format = DEFAULT_DATE_FORMAT) => {\n const sameDay = startDate.isSame(endDate, 'day');\n if (sameDay) return `${endDate.format(format)}`;\n return `${startDate.format(format)} - ${endDate.format(format)}`;\n};\n\
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACyCnB,SAOM,KAPN;AAxCJ,SAAgB,WAAW,gBAAgB;AAC3C,OAAO,eAAe;AACtB,SAAS,mCAAmC;AAC5C,SAAS,UAAU,mBAAmB,gBAAgB;AACtD,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AACzB,OAAO,YAAY;AACnB,SAAS,yBAAyB;AAClC,SAAS,2BAA2B;AAEpC,MAAM,YAAY;AAClB,MAAM,UAAU,kBAAkB,KAAK,EAAE,WAAW,SAAS;AAC7D,MAAM,SAAS,kBAAkB,KAAK,EAAE,WAAW,QAAQ;AAI3D,MAAM,2BAA2B,CAAC,EAAE,WAAW,MAAM,MAAM,WAAW,MAAM;AAC1E,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,EAAE;AAC7C,QAAM,CAAC,SAAS,UAAU,IAAI,SAAS,EAAE;AAGzC,QAAM,CAAC,qBAAqB,sBAAsB,IAAI,SAAS,KAA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,CAAC,EAAE,WAAW,QAAQ,GAAG,SAAS,wBAAwB;AAChF,QAAM,UAAU,UAAU,OAAO,SAAS,KAAK;AAC/C,MAAI;AAAS,WAAO,GAAG,QAAQ,OAAO,MAAM;AAC5C,SAAO,GAAG,UAAU,OAAO,MAAM,OAAO,QAAQ,OAAO,MAAM;AAC/D;AAEA,
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useEffect, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { DSControlledDateRangePicker } from '@elliemae/ds-controlled-form';\nimport { DSPopper, PopperPositions as Position } from '@elliemae/ds-popper';\nimport { DatePicker2 } from '@elliemae/ds-icons';\nimport { DSButton } from '@elliemae/ds-button';\nimport moment from 'moment';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { DEFAULT_DATE_FORMAT } from './defaultDateFormat.js';\n\nconst blockname = 'date-range';\nconst Wrapper = aggregatedClasses('div')(blockname, 'wrapper');\nconst Header = aggregatedClasses('div')(blockname, 'header');\n\n// const randomString = (maxLength = 5) => Math.random().toString(36).slice(-maxLength);\n\nconst DateRangePickerContainer = ({ onChange = () => null, showHeader }) => {\n const [startDate, setStartDate] = useState('');\n const [endDate, setEndDate] = useState('');\n\n // For some reason it worked like this\n const [lastChangeWasPicker, setLastChangeWasPicker] = useState(false);\n\n useEffect(() => {\n const startMoment = moment(startDate);\n const endMoment = moment(endDate);\n if (\n lastChangeWasPicker &&\n startDate &&\n !startDate.includes('_') &&\n endDate &&\n !endDate.includes('_') &&\n endMoment.diff(startMoment) >= 0\n ) {\n onChange({ startDate: startMoment, endDate: endMoment });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [startDate, endDate, lastChangeWasPicker]);\n\n return (\n <Wrapper\n data-testid=\"date-range__wrapper\"\n onKeyDown={(e) => e.code === 'Enter' && setLastChangeWasPicker(true)}\n style={{ backgroundColor: 'white', boxShadow: '0 6px 20px 0 rgb(0 0 0 / 24%)', width: '261px' }}\n >\n {showHeader && (\n <Header style={{ padding: '8px', display: 'flex', justifyContent: 'center' }}>\n <DSControlledDateRangePicker\n fromDate={startDate}\n onFromDateChange={(_start) => {\n setStartDate(_start);\n setLastChangeWasPicker(false);\n }}\n toDate={endDate}\n onToDateChange={(_end) => {\n setEndDate(_end);\n setLastChangeWasPicker(false);\n }}\n type=\"date-range-inputs\"\n />\n </Header>\n )}\n <DSControlledDateRangePicker\n fromDate={startDate}\n onFromDateChange={(_start) => {\n setStartDate(_start);\n setLastChangeWasPicker(true);\n }}\n toDate={endDate}\n onToDateChange={(_end) => {\n setEndDate(_end);\n setLastChangeWasPicker(true);\n }}\n type=\"date-range-picker-controller-only\"\n />\n </Wrapper>\n );\n};\n\nDateRangePickerContainer.propTypes = {\n onChange: PropTypes.func,\n showHeader: PropTypes.bool,\n};\n\nconst formatRangeDate = ({ startDate, endDate }, format = DEFAULT_DATE_FORMAT) => {\n const sameDay = startDate.isSame(endDate, 'day');\n if (sameDay) return `${endDate.format(format)}`;\n return `${startDate.format(format)} - ${endDate.format(format)}`;\n};\n\nconst DateRangeFilterMenu = ({\n column,\n className,\n isMenuOpened = false,\n onOpenMenu = () => null,\n placement = Position.BOTTOM_END,\n onAddFilter = () => null,\n dateFormatter = formatRangeDate,\n showHeader = true,\n menuProps,\n}) => (\n <DSPopper\n contentComponent={\n <div className={className}>\n <DateRangePickerContainer\n minimumNights={0}\n onChange={({ startDate, endDate }) => {\n startDate.startOf('day');\n endDate.endOf('day');\n onAddFilter(\n {\n group: column.property,\n label: column.label,\n value: dateFormatter({ startDate, endDate }),\n type: 'date', // todo: create constants for filter types\n filterParams: { start: startDate, end: endDate },\n transformRowValue: (value) => moment(value, column.dateFormat || DEFAULT_DATE_FORMAT),\n operator: 'range',\n },\n column,\n );\n onOpenMenu(false);\n }}\n showHeader={showHeader}\n />\n </div>\n }\n isOpen={isMenuOpened}\n onOpen={onOpenMenu}\n placement={placement}\n showArrow={false}\n triggerComponent={\n <DSButton\n buttonType=\"text\"\n icon={<DatePicker2 />}\n onClick={() => (!isMenuOpened ? onOpenMenu(true) : onOpenMenu(false))}\n size=\"s\"\n />\n }\n zIndex={menuProps.zIndex}\n />\n);\n\nDateRangeFilterMenu.propTypes = {\n column: PropTypes.any,\n className: PropTypes.string,\n isMenuOpened: PropTypes.bool,\n onOpenMenu: PropTypes.func,\n placement: PropTypes.string,\n onAddFilter: PropTypes.func,\n dateFormatter: PropTypes.any,\n showHeader: PropTypes.bool,\n menuProps: PropTypes.any,\n};\n\nexport { DateRangeFilterMenu };\nexport default DateRangeFilterMenu;\n"],
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACyCnB,SAOM,KAPN;AAxCJ,SAAgB,WAAW,gBAAgB;AAC3C,OAAO,eAAe;AACtB,SAAS,mCAAmC;AAC5C,SAAS,UAAU,mBAAmB,gBAAgB;AACtD,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AACzB,OAAO,YAAY;AACnB,SAAS,yBAAyB;AAClC,SAAS,2BAA2B;AAEpC,MAAM,YAAY;AAClB,MAAM,UAAU,kBAAkB,KAAK,EAAE,WAAW,SAAS;AAC7D,MAAM,SAAS,kBAAkB,KAAK,EAAE,WAAW,QAAQ;AAI3D,MAAM,2BAA2B,CAAC,EAAE,WAAW,MAAM,MAAM,WAAW,MAAM;AAC1E,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,EAAE;AAC7C,QAAM,CAAC,SAAS,UAAU,IAAI,SAAS,EAAE;AAGzC,QAAM,CAAC,qBAAqB,sBAAsB,IAAI,SAAS,KAAK;AAEpE,YAAU,MAAM;AACd,UAAM,cAAc,OAAO,SAAS;AACpC,UAAM,YAAY,OAAO,OAAO;AAChC,QACE,uBACA,aACA,CAAC,UAAU,SAAS,GAAG,KACvB,WACA,CAAC,QAAQ,SAAS,GAAG,KACrB,UAAU,KAAK,WAAW,KAAK,GAC/B;AACA,eAAS,EAAE,WAAW,aAAa,SAAS,UAAU,CAAC;AAAA,I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ACvB;AAGA,IAAO,8BAAQ;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -8,7 +8,7 @@ import { DSPopper, PopperPositions as Position } from "@elliemae/ds-popper";
|
|
8
8
|
import { DatePicker2 } from "@elliemae/ds-icons";
|
9
9
|
import { DSButton } from "@elliemae/ds-button";
|
10
10
|
import moment from "moment";
|
11
|
-
import { DEFAULT_DATE_FORMAT } from "./defaultDateFormat";
|
11
|
+
import { DEFAULT_DATE_FORMAT } from "./defaultDateFormat.js";
|
12
12
|
const SingleDatePickerContainer = ({ onChange = () => null, showHeader }) => {
|
13
13
|
const [date, setDate] = useState("");
|
14
14
|
const handleDateChange = useCallback(
|
@@ -29,7 +29,7 @@ SingleDatePickerContainer.propTypes = {
|
|
29
29
|
showHeader: PropTypes.bool
|
30
30
|
};
|
31
31
|
const formatDate = (date, format = DEFAULT_DATE_FORMAT) => date.format(format);
|
32
|
-
|
32
|
+
const SingleDateFilterMenu = ({
|
33
33
|
column,
|
34
34
|
className,
|
35
35
|
isMenuOpened = false,
|
@@ -39,53 +39,51 @@ function SingleDateFilterMenu({
|
|
39
39
|
dateFormatter = formatDate,
|
40
40
|
showHeader = false,
|
41
41
|
menuProps
|
42
|
-
})
|
43
|
-
|
44
|
-
|
45
|
-
{
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
end: t.endOf("day")
|
62
|
-
},
|
63
|
-
transformRowValue: (value) => moment(value, column.dateFormat || DEFAULT_DATE_FORMAT)
|
42
|
+
}) => /* @__PURE__ */ jsx(
|
43
|
+
DSPopper,
|
44
|
+
{
|
45
|
+
contentComponent: /* @__PURE__ */ jsx("div", { className, "data-testid": "date-single__wrapper", children: /* @__PURE__ */ jsx(
|
46
|
+
SingleDatePickerContainer,
|
47
|
+
{
|
48
|
+
minimumNights: 0,
|
49
|
+
onChange: (date) => {
|
50
|
+
const t = date.clone();
|
51
|
+
onAddFilter(
|
52
|
+
{
|
53
|
+
group: column.property,
|
54
|
+
label: column.label,
|
55
|
+
value: dateFormatter(date, column.dateFormat),
|
56
|
+
type: "date",
|
57
|
+
operator: "range",
|
58
|
+
filterParams: {
|
59
|
+
start: date.startOf("day"),
|
60
|
+
end: t.endOf("day")
|
64
61
|
},
|
65
|
-
column
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
}
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
}
|
62
|
+
transformRowValue: (value) => moment(value, column.dateFormat || DEFAULT_DATE_FORMAT)
|
63
|
+
},
|
64
|
+
column
|
65
|
+
);
|
66
|
+
onOpenMenu(false);
|
67
|
+
},
|
68
|
+
showHeader
|
69
|
+
}
|
70
|
+
) }),
|
71
|
+
isOpen: isMenuOpened,
|
72
|
+
onOpen: onOpenMenu,
|
73
|
+
placement,
|
74
|
+
showArrow: false,
|
75
|
+
triggerComponent: /* @__PURE__ */ jsx(
|
76
|
+
DSButton,
|
77
|
+
{
|
78
|
+
buttonType: "text",
|
79
|
+
icon: /* @__PURE__ */ jsx(DatePicker2, {}),
|
80
|
+
onClick: () => !isMenuOpened ? onOpenMenu(true) : onOpenMenu(false),
|
81
|
+
size: "s"
|
82
|
+
}
|
83
|
+
),
|
84
|
+
zIndex: menuProps.zIndex
|
85
|
+
}
|
86
|
+
);
|
89
87
|
SingleDateFilterMenu.propTypes = {
|
90
88
|
column: PropTypes.any,
|
91
89
|
className: PropTypes.string,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../../src/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.tsx"],
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSControlledDateTimePicker } from '@elliemae/ds-controlled-form';\nimport { DSPopper, PopperPositions as Position } from '@elliemae/ds-popper';\nimport { DatePicker2 } from '@elliemae/ds-icons';\nimport { DSButton } from '@elliemae/ds-button';\nimport moment from 'moment';\nimport { DEFAULT_DATE_FORMAT } from './defaultDateFormat';\n\nconst SingleDatePickerContainer = ({ onChange = () => null, showHeader }) => {\n const [date, setDate] = useState('');\n\n const handleDateChange = useCallback(\n (data) => {\n if (!data.includes('_')) onChange(moment(data));\n setDate(data);\n },\n [onChange],\n );\n\n return (\n <div style={{ boxShadow: '0 6px 20px 0 rgb(0 0 0 / 24%)' }}>\n {showHeader && (\n <Grid p=\"xxs\">\n <DSControlledDateTimePicker date={date} onDateChange={handleDateChange} type=\"date-inputs\" isClearable />\n </Grid>\n )}\n <DSControlledDateTimePicker date={date} onDateChange={handleDateChange} type=\"date-picker-controller-only\" />\n </div>\n );\n};\n\nSingleDatePickerContainer.propTypes = {\n onChange: PropTypes.func,\n showHeader: PropTypes.bool,\n};\n\nconst formatDate = (date, format = DEFAULT_DATE_FORMAT) => date.format(format);\n\
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACsBnB,SAGM,KAHN;AAtBJ,SAAgB,aAAa,gBAAgB;AAC7C,OAAO,eAAe;AACtB,SAAS,YAAY;AACrB,SAAS,kCAAkC;AAC3C,SAAS,UAAU,mBAAmB,gBAAgB;AACtD,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AACzB,OAAO,YAAY;AACnB,SAAS,2BAA2B;AAEpC,MAAM,4BAA4B,CAAC,EAAE,WAAW,MAAM,MAAM,WAAW,MAAM;AAC3E,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,EAAE;AAEnC,QAAM,mBAAmB;AAAA,IACvB,CAAC,SAAS;AACR,UAAI,CAAC,KAAK,SAAS,GAAG;AAAG,iBAAS,OAAO,IAAI,CAAC;AAC9C,cAAQ,IAAI;AAAA,IACd;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AAEA,SACE,qBAAC,SAAI,OAAO,EAAE,WAAW,gCAAgC,GACtD;AAAA,kBACC,oBAAC,QAAK,GAAE,OACN,8BAAC,8BAA2B,MAAY,cAAc,kBAAkB,MAAK,eAAc,aAAW,MAAC,GACzG;AAAA,IAEF,oBAAC,8BAA2B,MAAY,cAAc,kBAAkB,MAAK,+BAA8B;AAAA,KAC7G;AAEJ;AAEA,0BAA0B,YAAY;AAAA,EACpC,UAAU,UAAU;AAAA,EACpB,YAAY,UAAU;AACxB;AAEA,MAAM,aAAa,CAAC,MAAM,SAAS,wBAAwB,KAAK,OAAO,MAAM;AAE7E,
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSControlledDateTimePicker } from '@elliemae/ds-controlled-form';\nimport { DSPopper, PopperPositions as Position } from '@elliemae/ds-popper';\nimport { DatePicker2 } from '@elliemae/ds-icons';\nimport { DSButton } from '@elliemae/ds-button';\nimport moment from 'moment';\nimport { DEFAULT_DATE_FORMAT } from './defaultDateFormat.js';\n\nconst SingleDatePickerContainer = ({ onChange = () => null, showHeader }) => {\n const [date, setDate] = useState('');\n\n const handleDateChange = useCallback(\n (data) => {\n if (!data.includes('_')) onChange(moment(data));\n setDate(data);\n },\n [onChange],\n );\n\n return (\n <div style={{ boxShadow: '0 6px 20px 0 rgb(0 0 0 / 24%)' }}>\n {showHeader && (\n <Grid p=\"xxs\">\n <DSControlledDateTimePicker date={date} onDateChange={handleDateChange} type=\"date-inputs\" isClearable />\n </Grid>\n )}\n <DSControlledDateTimePicker date={date} onDateChange={handleDateChange} type=\"date-picker-controller-only\" />\n </div>\n );\n};\n\nSingleDatePickerContainer.propTypes = {\n onChange: PropTypes.func,\n showHeader: PropTypes.bool,\n};\n\nconst formatDate = (date, format = DEFAULT_DATE_FORMAT) => date.format(format);\n\nconst SingleDateFilterMenu = ({\n column,\n className,\n isMenuOpened = false,\n onOpenMenu = () => null,\n placement = Position.BOTTOM_END,\n onAddFilter = () => null,\n dateFormatter = formatDate,\n showHeader = false,\n menuProps,\n}) => (\n <DSPopper\n contentComponent={\n <div className={className} data-testid=\"date-single__wrapper\">\n <SingleDatePickerContainer\n minimumNights={0}\n onChange={(date) => {\n const t = date.clone();\n onAddFilter(\n {\n group: column.property,\n label: column.label,\n value: dateFormatter(date, column.dateFormat),\n type: 'date',\n operator: 'range',\n filterParams: {\n start: date.startOf('day'),\n end: t.endOf('day'),\n },\n transformRowValue: (value) => moment(value, column.dateFormat || DEFAULT_DATE_FORMAT),\n },\n column,\n );\n onOpenMenu(false);\n }}\n showHeader={showHeader}\n />\n </div>\n }\n isOpen={isMenuOpened}\n onOpen={onOpenMenu}\n placement={placement}\n showArrow={false}\n triggerComponent={\n <DSButton\n buttonType=\"text\"\n icon={<DatePicker2 />}\n onClick={() => (!isMenuOpened ? onOpenMenu(true) : onOpenMenu(false))}\n size=\"s\"\n />\n }\n zIndex={menuProps.zIndex}\n />\n);\n\nSingleDateFilterMenu.propTypes = {\n column: PropTypes.any,\n className: PropTypes.string,\n isMenuOpened: PropTypes.bool,\n onOpenMenu: PropTypes.func,\n placement: PropTypes.string,\n onAddFilter: PropTypes.func,\n dateFormatter: PropTypes.any,\n showHeader: PropTypes.bool,\n menuProps: PropTypes.any,\n};\n\nexport { SingleDateFilterMenu };\nexport default SingleDateFilterMenu;\n"],
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACsBnB,SAGM,KAHN;AAtBJ,SAAgB,aAAa,gBAAgB;AAC7C,OAAO,eAAe;AACtB,SAAS,YAAY;AACrB,SAAS,kCAAkC;AAC3C,SAAS,UAAU,mBAAmB,gBAAgB;AACtD,S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A,cACN,UAAU;AAAA,cACV,cAAc;AAAA,gBACZ,OAAO,KAAK,QAAQ,KAAK;AAAA,gBACzB,KAAK,EAAE,MAAM,KAAK;AAAA,cACpB;AAAA,cACA,mBAAmB,CAAC,UAAU,OAAO,OAAO,OAAO,cAAc,mBAAmB;AAAA,YACtF;AAAA,YACA;AAAA,UACF;AACA,qBAAW,KAAK;AAAA,QAClB;AAAA,QACA;AAAA;AAAA,IACF,GACF;AAAA,IAEF,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR;AAAA,IACA,WAAW;AAAA,IACX,kBACE;AAAA,MAAC;AAAA;AAAA,QACC,YAAW;AAAA,QACX,MAAM,oBAAC,eAAY;AAAA,QACnB,SAAS,MAAO,CAAC,eAAe,WAAW,IAAI,IAAI,WAAW,KAAK;AAAA,QACnE,MAAK;AAAA;AAAA,IACP;AAAA,IAEF,QAAQ,UAAU;AAAA;AACpB;AAGF,qBAAqB,YAAY;AAAA,EAC/B,QAAQ,UAAU;AAAA,EAClB,WAAW,UAAU;AAAA,EACrB,cAAc,UAAU;AAAA,EACxB,YAAY,UAAU;AAAA,EACtB,WAAW,UAAU;AAAA,EACrB,aAAa,UAAU;AAAA,EACvB,eAAe,UAAU;AAAA,EACzB,YAAY,UAAU;AAAA,EACtB,WAAW,UAAU;AACvB;AAGA,IAAO,+BAAQ;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -13,7 +13,7 @@ import { DSButton } from "@elliemae/ds-button";
|
|
13
13
|
import { Grid } from "@elliemae/ds-grid";
|
14
14
|
import moment from "moment";
|
15
15
|
import { styled } from "@elliemae/ds-system";
|
16
|
-
import { DEFAULT_DATE_FORMAT } from "./defaultDateFormat";
|
16
|
+
import { DEFAULT_DATE_FORMAT } from "./defaultDateFormat.js";
|
17
17
|
const StyledGridWrapper = styled(Grid)`
|
18
18
|
.notCurrentMonth {
|
19
19
|
opacity: ${(props) => props.enableOutsideDays ? "1" : "0"};
|
@@ -133,7 +133,7 @@ const formatRangeDate = ({ startDate, endDate }, format = DEFAULT_DATE_FORMAT) =
|
|
133
133
|
return `${endDate.format(format)}`;
|
134
134
|
return `${startDate.format(format)} - ${endDate.format(format)}`;
|
135
135
|
};
|
136
|
-
|
136
|
+
const SingleRangeSwitcherMenu = ({
|
137
137
|
column,
|
138
138
|
className,
|
139
139
|
isMenuOpened = false,
|
@@ -143,50 +143,49 @@ function SingleRangeSwitcherMenu({
|
|
143
143
|
dateFormatter = formatRangeDate,
|
144
144
|
enableOutsideDays = true,
|
145
145
|
menuProps
|
146
|
-
})
|
147
|
-
|
148
|
-
|
149
|
-
{
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
}
|
171
|
-
}
|
172
|
-
) }),
|
173
|
-
isOpen: isMenuOpened,
|
174
|
-
onOpen: onOpenMenu,
|
175
|
-
placement,
|
176
|
-
showArrow: false,
|
177
|
-
triggerComponent: /* @__PURE__ */ jsx(
|
178
|
-
DSButton,
|
179
|
-
{
|
180
|
-
buttonType: "text",
|
181
|
-
icon: /* @__PURE__ */ jsx(DatePicker2, {}),
|
182
|
-
onClick: () => !isMenuOpened ? onOpenMenu(true) : onOpenMenu(false),
|
183
|
-
size: "s"
|
146
|
+
}) => /* @__PURE__ */ jsx(
|
147
|
+
DSPopper,
|
148
|
+
{
|
149
|
+
contentComponent: /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx(
|
150
|
+
SingleRangeSwitcherContainer,
|
151
|
+
{
|
152
|
+
enableOutsideDays,
|
153
|
+
onChange: ({ startDate, endDate }) => {
|
154
|
+
startDate.startOf("day");
|
155
|
+
endDate.endOf("day");
|
156
|
+
onAddFilter(
|
157
|
+
{
|
158
|
+
group: column.property,
|
159
|
+
label: column.label,
|
160
|
+
value: dateFormatter({ startDate, endDate }, column.format),
|
161
|
+
type: "date",
|
162
|
+
// todo: create constants for filter types
|
163
|
+
filterParams: { start: startDate, end: endDate },
|
164
|
+
transformRowValue: (value) => moment(value, column.dateFormat || DEFAULT_DATE_FORMAT),
|
165
|
+
operator: "range"
|
166
|
+
},
|
167
|
+
column
|
168
|
+
);
|
169
|
+
onOpenMenu(false);
|
184
170
|
}
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
171
|
+
}
|
172
|
+
) }),
|
173
|
+
isOpen: isMenuOpened,
|
174
|
+
onOpen: onOpenMenu,
|
175
|
+
placement,
|
176
|
+
showArrow: false,
|
177
|
+
triggerComponent: /* @__PURE__ */ jsx(
|
178
|
+
DSButton,
|
179
|
+
{
|
180
|
+
buttonType: "text",
|
181
|
+
icon: /* @__PURE__ */ jsx(DatePicker2, {}),
|
182
|
+
onClick: () => !isMenuOpened ? onOpenMenu(true) : onOpenMenu(false),
|
183
|
+
size: "s"
|
184
|
+
}
|
185
|
+
),
|
186
|
+
zIndex: menuProps.zIndex
|
187
|
+
}
|
188
|
+
);
|
190
189
|
SingleRangeSwitcherMenu.propTypes = {
|
191
190
|
column: PropTypes.any,
|
192
191
|
className: PropTypes.string,
|
package/dist/esm/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js.map
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../../src/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.tsx"],
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useEffect, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport {\n DSControlledDateTimePicker,\n DSControlledDateRangePicker,\n DSControlledCheckbox,\n} from '@elliemae/ds-controlled-form';\nimport { DSPopper, PopperPositions as Position } from '@elliemae/ds-popper';\nimport { DatePicker2 } from '@elliemae/ds-icons';\nimport { DSButton } from '@elliemae/ds-button';\nimport { Grid } from '@elliemae/ds-grid';\nimport moment from 'moment';\nimport { styled } from '@elliemae/ds-system';\nimport { DEFAULT_DATE_FORMAT } from './defaultDateFormat';\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\
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACiEjB,SACE,KADF;AAhEN,SAAgB,WAAW,gBAAgB;AAC3C,OAAO,eAAe;AACtB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,UAAU,mBAAmB,gBAAgB;AACtD,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB,O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AAQ,GAAG,SAAS,wBAAwB;AAChF,QAAM,UAAU,UAAU,OAAO,SAAS,KAAK;AAC/C,MAAI;AAAS,WAAO,GAAG,QAAQ,OAAO,MAAM;AAC5C,SAAO,GAAG,UAAU,OAAO,MAAM,OAAO,QAAQ,OAAO,MAAM;AAC/D;AAGA,
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useEffect, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport {\n DSControlledDateTimePicker,\n DSControlledDateRangePicker,\n DSControlledCheckbox,\n} from '@elliemae/ds-controlled-form';\nimport { DSPopper, PopperPositions as Position } from '@elliemae/ds-popper';\nimport { DatePicker2 } from '@elliemae/ds-icons';\nimport { DSButton } from '@elliemae/ds-button';\nimport { Grid } from '@elliemae/ds-grid';\nimport moment from 'moment';\nimport { styled } from '@elliemae/ds-system';\nimport { DEFAULT_DATE_FORMAT } from './defaultDateFormat.js';\n\nconst StyledGridWrapper = styled(Grid)`\n .notCurrentMonth {\n opacity: ${(props) => (props.enableOutsideDays ? '1' : '0')};\n pointer-events: ${(props) => (props.enableOutsideDays ? 'auto' : 'none')};\n }\n`;\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function\nconst noop = (...args) => {};\n\nconst SingleRangeSwitcherContainer = ({ onChange = noop, enableOutsideDays }) => {\n const [startDate, setStartDate] = useState('');\n const [endDate, setEndDate] = useState('');\n\n // For some reason it worked like this\n const [lastChangeWasPicker, setLastChangeWasPicker] = useState(false);\n\n const [isDateRange, setIsDateRange] = useState(false);\n\n useEffect(() => {\n const startMoment = moment(startDate);\n const endMoment = moment(endDate);\n if (\n lastChangeWasPicker &&\n startDate &&\n !startDate.includes('_') &&\n endDate &&\n !endDate.includes('_') &&\n endMoment.diff(startMoment) >= 0\n ) {\n onChange({ startDate: startMoment, endDate: endMoment });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [startDate, endDate, lastChangeWasPicker]);\n\n return (\n <StyledGridWrapper\n data-testid=\"date-single-range__wrapper\"\n style={{\n backgroundColor: 'white',\n boxShadow: '0 6px 20px 0 rgb(0 0 0 / 24%)',\n width: '261px',\n display: 'grid',\n justifyContent: 'center',\n }}\n cols={['100%']}\n enableOutsideDays={enableOutsideDays}\n onKeyDown={(e) => e.code === 'Enter' && setLastChangeWasPicker(true)}\n >\n <Grid gutter=\"xxs\" alignItems=\"center\" p=\"xxs\">\n <DSControlledCheckbox\n checked={isDateRange}\n name=\"Date range\"\n label=\"Range\"\n id=\"date-range-switcher-id-internal\"\n onChange={() => {\n setIsDateRange(!isDateRange);\n setStartDate('');\n setEndDate('');\n }}\n />\n <div style={{ width: 'fit-content' }}>\n {isDateRange ? (\n <DSControlledDateRangePicker\n fromDate={startDate}\n onFromDateChange={(_start) => {\n setStartDate(_start);\n setLastChangeWasPicker(false);\n }}\n toDate={endDate}\n onToDateChange={(_end) => {\n setEndDate(_end);\n setLastChangeWasPicker(false);\n }}\n type=\"date-range-inputs\"\n />\n ) : (\n <DSControlledDateTimePicker\n date={startDate}\n onDateChange={(_date) => {\n setLastChangeWasPicker(false);\n setStartDate(_date);\n setEndDate(_date);\n }}\n type=\"date-inputs\"\n />\n )}\n </div>\n </Grid>\n <Grid>\n {isDateRange ? (\n <DSControlledDateRangePicker\n fromDate={startDate}\n onFromDateChange={(_start) => {\n setStartDate(_start);\n setLastChangeWasPicker(true);\n }}\n toDate={endDate}\n onToDateChange={(_end) => {\n setEndDate(_end);\n setLastChangeWasPicker(true);\n }}\n type=\"date-range-picker-controller-only\"\n />\n ) : (\n <DSControlledDateTimePicker\n date={startDate}\n onDateChange={(_date) => {\n setLastChangeWasPicker(true);\n setStartDate(_date);\n setEndDate(_date);\n }}\n type=\"date-picker-controller-only\"\n />\n )}\n </Grid>\n </StyledGridWrapper>\n );\n};\n\nSingleRangeSwitcherContainer.propTypes = {\n onChange: PropTypes.func,\n enableOutsideDays: PropTypes.bool,\n};\n\nconst formatRangeDate = ({ startDate, endDate }, format = DEFAULT_DATE_FORMAT) => {\n const sameDay = startDate.isSame(endDate, 'day');\n if (sameDay) return `${endDate.format(format)}`;\n return `${startDate.format(format)} - ${endDate.format(format)}`;\n};\n\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nconst SingleRangeSwitcherMenu = ({\n column,\n className,\n isMenuOpened = false,\n onOpenMenu = noop,\n placement = Position.BOTTOM_END,\n onAddFilter = noop,\n dateFormatter = formatRangeDate,\n enableOutsideDays = true,\n menuProps,\n}): JSX.Element => (\n <DSPopper\n contentComponent={\n <div className={className}>\n <SingleRangeSwitcherContainer\n enableOutsideDays={enableOutsideDays}\n onChange={({ startDate, endDate }) => {\n startDate.startOf('day');\n endDate.endOf('day');\n onAddFilter(\n {\n group: column.property,\n label: column.label,\n value: dateFormatter({ startDate, endDate }, column.format),\n type: 'date', // todo: create constants for filter types\n filterParams: { start: startDate, end: endDate },\n transformRowValue: (value) => moment(value, column.dateFormat || DEFAULT_DATE_FORMAT),\n operator: 'range',\n },\n column,\n );\n onOpenMenu(false);\n }}\n />\n </div>\n }\n isOpen={isMenuOpened}\n onOpen={onOpenMenu}\n placement={placement}\n showArrow={false}\n triggerComponent={\n <DSButton\n buttonType=\"text\"\n icon={<DatePicker2 />}\n onClick={() => (!isMenuOpened ? onOpenMenu(true) : onOpenMenu(false))}\n size=\"s\"\n />\n }\n zIndex={menuProps.zIndex}\n />\n);\n\nSingleRangeSwitcherMenu.propTypes = {\n column: PropTypes.any,\n className: PropTypes.string,\n isMenuOpened: PropTypes.bool,\n onOpenMenu: PropTypes.func,\n placement: PropTypes.string,\n onAddFilter: PropTypes.func,\n dateFormatter: PropTypes.any,\n enableOutsideDays: PropTypes.bool,\n menuProps: PropTypes.any,\n};\n\nexport { SingleRangeSwitcherMenu };\nexport default SingleRangeSwitcherMenu;\n"],
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACiEjB,SACE,KADF;AAhEN,SAAgB,WAAW,gBAAgB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AC,eAAY;AAAA,QACnB,SAAS,MAAO,CAAC,eAAe,WAAW,IAAI,IAAI,WAAW,KAAK;AAAA,QACnE,MAAK;AAAA;AAAA,IACP;AAAA,IAEF,QAAQ,UAAU;AAAA;AACpB;AAGF,wBAAwB,YAAY;AAAA,EAClC,QAAQ,UAAU;AAAA,EAClB,WAAW,UAAU;AAAA,EACrB,cAAc,UAAU;AAAA,EACxB,YAAY,UAAU;AAAA,EACtB,WAAW,UAAU;AAAA,EACrB,aAAa,UAAU;AAAA,EACvB,eAAe,UAAU;AAAA,EACzB,mBAAmB,UAAU;AAAA,EAC7B,WAAW,UAAU;AACvB;AAGA,IAAO,kCAAQ;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -8,7 +8,7 @@ import { DSButton } from "@elliemae/ds-button";
|
|
8
8
|
import { PopperPositions as Position } from "@elliemae/ds-popper";
|
9
9
|
import { Menu, MenuCombobox } from "@elliemae/ds-menu";
|
10
10
|
import { SearchSmall } from "@elliemae/ds-icons";
|
11
|
-
|
11
|
+
const TextFilterMenu = ({
|
12
12
|
column,
|
13
13
|
menuStyle = {},
|
14
14
|
className,
|
@@ -22,7 +22,7 @@ function TextFilterMenu({
|
|
22
22
|
onRemoveFilter = () => null,
|
23
23
|
maxOptions = 10,
|
24
24
|
isMulti = false
|
25
|
-
}) {
|
25
|
+
}) => {
|
26
26
|
const { options, ...otherMenuProps } = menuProps;
|
27
27
|
const generateOption = (option, idx) => /* @__PURE__ */ jsx(Menu.ItemCheckbox, { label: option.label, name: option.id }, idx);
|
28
28
|
const renderOptions = (arr) => arr.map(generateOption);
|
@@ -129,7 +129,7 @@ function TextFilterMenu({
|
|
129
129
|
)
|
130
130
|
}
|
131
131
|
);
|
132
|
-
}
|
132
|
+
};
|
133
133
|
TextFilterMenu.propTypes = {
|
134
134
|
column: PropTypes.any,
|
135
135
|
menuStyle: PropTypes.shape({}),
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../../src/plugins/filterable/components/filterable-menus/TextFilterMenu.tsx"],
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { compact } from 'lodash';\nimport { DSDropdownMenu } from '@elliemae/ds-dropdownmenu';\nimport { DSButton } from '@elliemae/ds-button';\nimport { PopperPositions as Position } from '@elliemae/ds-popper';\nimport { Menu, MenuCombobox } from '@elliemae/ds-menu';\nimport { SearchSmall } from '@elliemae/ds-icons';\n\
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;AC2BmB;AA1B1C,OAAOA,UAAS,gBAAgB;AAChC,OAAO,eAAe;AACtB,SAAS,eAAe;AACxB,SAAS,sBAAsB;AAC/B,SAAS,gBAAgB;AACzB,SAAS,mBAAmB,gBAAgB;AAC5C,SAAS,MAAM,oBAAoB;AACnC,SAAS,mBAAmB;AAE5B,
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { compact } from 'lodash';\nimport { DSDropdownMenu } from '@elliemae/ds-dropdownmenu';\nimport { DSButton } from '@elliemae/ds-button';\nimport { PopperPositions as Position } from '@elliemae/ds-popper';\nimport { Menu, MenuCombobox } from '@elliemae/ds-menu';\nimport { SearchSmall } from '@elliemae/ds-icons';\n\nconst TextFilterMenu = ({\n column,\n menuStyle = {},\n className,\n filters = [],\n isMenuOpened = false,\n onOpenMenu = () => null,\n onClose = () => null,\n placement = Position.BOTTOM_END,\n menuProps = {},\n onAddFilter = () => null,\n onRemoveFilter = () => null,\n maxOptions = 10,\n isMulti = false,\n}) => {\n const { options, ...otherMenuProps } = menuProps;\n\n const generateOption = (option, idx) => <Menu.ItemCheckbox key={idx} label={option.label} name={option.id} />;\n\n const renderOptions = (arr) => arr.map(generateOption);\n\n const filtersForColumn = filters.filter((f) => f.group === column.property);\n\n const initialSelectedOptions = filtersForColumn.map((f) => f.value);\n\n const [selected, setSelected] = useState(initialSelectedOptions);\n\n React.useEffect(() => {\n const filtersForColumn2 = filters.filter((f) => f.group === column.property);\n setSelected(filtersForColumn2.map((f) => f.value));\n }, [filters]);\n\n const filterGroup = column.searchBy || column.property;\n\n const onCloseMulti = () => {\n let nextFilters = [...filters];\n const shouldRemove = [];\n // if selected doesn't includes item, then we have to remove the filter\n // but given that we are maintaining state here and updating the grid state\n // is not implemented on useFilterableState, we have to do this in 2 traverses\n // as doing it in one gives trouble when removing and adding at the same time.\n initialSelectedOptions.forEach((item) => {\n if (!selected.includes(item)) {\n nextFilters = nextFilters.filter((filter) => !(filter.group === filterGroup && filter.value === item));\n shouldRemove.push({ group: filterGroup, pill: { value: item } });\n }\n });\n shouldRemove.forEach((removedFilter) => {\n onRemoveFilter({\n ...removedFilter,\n nextFilters,\n });\n });\n selected.forEach((item) => {\n // if initialSelectedOptions includes item, then we do nothing\n if (!initialSelectedOptions.includes(item)) {\n onAddFilter(\n {\n group: filterGroup,\n label: column.label,\n value: item,\n operator: column?.filter?.operator || 'contains',\n transformRowValue: column.valueTransformation,\n },\n column,\n );\n }\n });\n onClose();\n };\n\n return (\n <DSDropdownMenu\n closeMenuOnItemSelection\n contentStyle={menuStyle}\n customMenu={\n isMulti ? (\n <Menu containerProps={{ id: 'text-filter-menu-multiple' }} className=\"dg-multiple-filter\" visible>\n <Menu.SelectionGroup\n active={selected}\n onSelect={(newValues) => {\n setSelected(newValues);\n }}\n focusOnOpen\n multi\n searchable\n >\n {renderOptions(options)}\n </Menu.SelectionGroup>\n </Menu>\n ) : (\n <MenuCombobox\n {...otherMenuProps}\n className={className}\n dropdownFilterOptions={{\n ...column.dropdownFilterOptions,\n maxOptions,\n }}\n maxWidth={column.filterMenuMaxWidth}\n minWidth={column.filterMenuMinWidth}\n onSelectMenuItem={(selectedValue) => {\n if (selectedValue) {\n onAddFilter(\n {\n group: column.searchBy || column.property,\n label: column.label,\n value: selectedValue,\n operator: column?.filter?.operator || 'contains',\n transformRowValue: column.valueTransformation,\n },\n column,\n );\n onOpenMenu(false);\n }\n }}\n />\n )\n }\n isOpen={isMenuOpened}\n maxWidth={column.filterMenuMaxWidth}\n menuProps={menuProps}\n minWidth={column.filterMenuMinWidth}\n onOpenMenu={onOpenMenu}\n onClose={isMulti ? onCloseMulti : onClose}\n options={compact(options)}\n placement={placement}\n triggerComponent={\n <DSButton\n buttonType=\"text\"\n icon={<SearchSmall />}\n onClick={() => (isMenuOpened ? onOpenMenu(false) : onOpenMenu(true))}\n size=\"s\"\n />\n }\n />\n );\n};\n\nTextFilterMenu.propTypes = {\n column: PropTypes.any,\n menuStyle: PropTypes.shape({}),\n className: PropTypes.string,\n filters: PropTypes.arrayOf(PropTypes.shape({})),\n isMenuOpened: PropTypes.bool,\n onOpenMenu: PropTypes.func,\n onClose: PropTypes.func,\n placement: PropTypes.string,\n menuProps: PropTypes.shape({}),\n onAddFilter: PropTypes.func,\n onRemoveFilter: PropTypes.func,\n maxOptions: PropTypes.number,\n isMulti: PropTypes.bool,\n};\n\nexport { TextFilterMenu };\nexport default TextFilterMenu;\n"],
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC2BmB;AA1B1C,OAAOA,UAAS,gBAAgB;AAChC,OAAO,eAAe;AACtB,SAAS,eAAe;AACxB,SAAS,sBAAsB;AAC/B,SAAS,gBAAgB;AACzB,SAAS,mBAAmB,gBAAgB;AAC5C,SAAS,MAAM,oBAAoB;AACnC,SAAS,mBAAmB;AAE5B,MAAM,iBAAiB,CAAC;AAAA,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,SAAS;AAAA,EACrB,YAAY,CAAC;AAAA,EACb,cAAc,MAAM;AAAA,EACpB,iBAAiB,MAAM;AAA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A;AAAA,UACC,YAAW;AAAA,UACX,MAAM,oBAAC,eAAY;AAAA,UACnB,SAAS,MAAO,eAAe,WAAW,KAAK,IAAI,WAAW,IAAI;AAAA,UAClE,MAAK;AAAA;AAAA,MACP;AAAA;AAAA,EAEJ;AAEJ;AAEA,eAAe,YAAY;AAAA,EACzB,QAAQ,UAAU;AAAA,EAClB,WAAW,UAAU,MAAM,CAAC,CAAC;AAAA,EAC7B,WAAW,UAAU;AAAA,EACrB,SAAS,UAAU,QAAQ,UAAU,MAAM,CAAC,CAAC,CAAC;AAAA,EAC9C,cAAc,UAAU;AAAA,EACxB,YAAY,UAAU;AAAA,EACtB,SAAS,UAAU;AAAA,EACnB,WAAW,UAAU;AAAA,EACrB,WAAW,UAAU,MAAM,CAAC,CAAC;AAAA,EAC7B,aAAa,UAAU;AAAA,EACvB,gBAAgB,UAAU;AAAA,EAC1B,YAAY,UAAU;AAAA,EACtB,SAAS,UAAU;AACrB;AAGA,IAAO,yBAAQ;",
|
6
6
|
"names": ["React"]
|
7
7
|
}
|
@@ -1,17 +1,15 @@
|
|
1
1
|
import * as React from "react";
|
2
|
-
import { DateRangeFilterMenu } from "./DateRangeFilterMenu";
|
3
|
-
import { SingleDateFilterMenu } from "./SingleDateFilterMenu";
|
4
|
-
import { SingleRangeSwitcherMenu } from "./SingleRangeSwitcherMenu";
|
5
|
-
import { TextFilterMenu } from "./TextFilterMenu";
|
2
|
+
import { DateRangeFilterMenu } from "./DateRangeFilterMenu.js";
|
3
|
+
import { SingleDateFilterMenu } from "./SingleDateFilterMenu.js";
|
4
|
+
import { SingleRangeSwitcherMenu } from "./SingleRangeSwitcherMenu.js";
|
5
|
+
import { TextFilterMenu } from "./TextFilterMenu.js";
|
6
6
|
const ComponentTypes = {
|
7
7
|
"date-range": DateRangeFilterMenu,
|
8
8
|
"single-date": SingleDateFilterMenu,
|
9
9
|
"date-switcher": SingleRangeSwitcherMenu,
|
10
10
|
string: TextFilterMenu
|
11
11
|
};
|
12
|
-
const getFilterMenuByType = (type) =>
|
13
|
-
return ComponentTypes[type] || ComponentTypes.string;
|
14
|
-
};
|
12
|
+
const getFilterMenuByType = (type) => ComponentTypes[type] || ComponentTypes.string;
|
15
13
|
var getFilterMenuByType_default = getFilterMenuByType;
|
16
14
|
export {
|
17
15
|
getFilterMenuByType_default as default,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../../src/plugins/filterable/components/filterable-menus/getFilterMenuByType.tsx"],
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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) =>
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,2BAA2B;AACpC,SAAS,4BAA4B;AACrC,SAAS,+BAA+B;AACxC,SAAS,sBAAsB;AAE/B,MAAM,iBAAiB;AAAA,EACrB,cAAc;AAAA,EACd,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,QAAQ;AACV;AAEO,MAAM,sBAAsB,CAAC,SAAS
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { DateRangeFilterMenu } from './DateRangeFilterMenu.js';\nimport { SingleDateFilterMenu } from './SingleDateFilterMenu.js'; // implement\nimport { SingleRangeSwitcherMenu } from './SingleRangeSwitcherMenu.js'; // implement\nimport { TextFilterMenu } from './TextFilterMenu.js';\n\nconst ComponentTypes = {\n 'date-range': DateRangeFilterMenu,\n 'single-date': SingleDateFilterMenu,\n 'date-switcher': SingleRangeSwitcherMenu,\n string: TextFilterMenu,\n};\n\nexport const getFilterMenuByType = (type) => ComponentTypes[type] || ComponentTypes.string;\n\nexport default getFilterMenuByType;\n"],
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,2BAA2B;AACpC,SAAS,4BAA4B;AACrC,SAAS,+BAA+B;AACxC,SAAS,sBAAsB;AAE/B,MAAM,iBAAiB;AAAA,EACrB,cAAc;AAAA,EACd,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,QAAQ;AACV;AAEO,MAAM,sBAAsB,CAAC,SAAS,eAAe,IAAI,KAAK,eAAe;AAEpF,IAAO,8BAAQ;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -1,43 +1,35 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
3
|
-
import { FilterableHeader } from "./components/FilterableHeader";
|
4
|
-
import { getFilterLabels, getFilterLabelsGroup } from "./helper";
|
5
|
-
const FilterableFormatter = ({
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
}
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
3
|
+
import { FilterableHeader } from "./components/FilterableHeader.js";
|
4
|
+
import { getFilterLabels, getFilterLabelsGroup } from "./helper.js";
|
5
|
+
const FilterableFormatter = ({ grid, onAddFilter, onRemoveFilter, query, filterMenuRef }) => function(value, { column }) {
|
6
|
+
const {
|
7
|
+
rows,
|
8
|
+
composedRows,
|
9
|
+
props: { groupedRows, groupedBy, onFilterMenuClose, onFilterMenuOpen },
|
10
|
+
state: { filters }
|
11
|
+
} = grid.getInstance();
|
12
|
+
let rowsToUse = composedRows;
|
13
|
+
if (column.filter && column.filter.isMulti) {
|
14
|
+
rowsToUse = rows;
|
15
|
+
}
|
16
|
+
const filteredLabels = groupedRows && !groupedBy ? getFilterLabelsGroup(column, rows, query) : getFilterLabels(column, rowsToUse.rows || rowsToUse, query);
|
17
|
+
const columnData = column.filterOptions || filteredLabels;
|
18
|
+
return /* @__PURE__ */ jsx(
|
19
|
+
FilterableHeader,
|
20
|
+
{
|
21
|
+
column,
|
22
|
+
columnData,
|
23
|
+
filters,
|
24
|
+
filterMenuRef,
|
25
|
+
onAddFilter,
|
26
|
+
onFilterMenuClose,
|
27
|
+
onFilterMenuOpen,
|
28
|
+
onRemoveFilter,
|
29
|
+
isMulti: column.filter && column.filter.isMulti,
|
30
|
+
value
|
22
31
|
}
|
23
|
-
|
24
|
-
const columnData = column.filterOptions || filteredLabels;
|
25
|
-
return /* @__PURE__ */ jsx(
|
26
|
-
FilterableHeader,
|
27
|
-
{
|
28
|
-
column,
|
29
|
-
columnData,
|
30
|
-
filters,
|
31
|
-
filterMenuRef,
|
32
|
-
onAddFilter,
|
33
|
-
onFilterMenuClose,
|
34
|
-
onFilterMenuOpen,
|
35
|
-
onRemoveFilter,
|
36
|
-
isMulti: column.filter && column.filter.isMulti,
|
37
|
-
value
|
38
|
-
}
|
39
|
-
);
|
40
|
-
};
|
32
|
+
);
|
41
33
|
};
|
42
34
|
var filterableFormatter_default = FilterableFormatter;
|
43
35
|
export {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/filterable/filterableFormatter.tsx"],
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/display-name */\nimport React from 'react';\nimport { FilterableHeader } from './components/FilterableHeader';\nimport { getFilterLabels, getFilterLabelsGroup } from './helper';\n\nconst FilterableFormatter = ({
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/display-name */\nimport React from 'react';\nimport { FilterableHeader } from './components/FilterableHeader.js';\nimport { getFilterLabels, getFilterLabelsGroup } from './helper.js';\n\nconst FilterableFormatter = ({ grid, onAddFilter, onRemoveFilter, query, filterMenuRef }) =>\n function (value, { column }) {\n const {\n rows,\n composedRows,\n props: { groupedRows, groupedBy, onFilterMenuClose, onFilterMenuOpen },\n state: { filters },\n } = grid.getInstance();\n\n let rowsToUse = composedRows;\n if (column.filter && column.filter.isMulti) {\n rowsToUse = rows;\n }\n\n const filteredLabels =\n groupedRows && !groupedBy\n ? getFilterLabelsGroup(column, rows, query)\n : getFilterLabels(column, rowsToUse.rows || rowsToUse, query);\n\n const columnData = column.filterOptions || filteredLabels;\n return (\n <FilterableHeader\n column={column}\n columnData={columnData}\n filters={filters}\n filterMenuRef={filterMenuRef}\n onAddFilter={onAddFilter}\n onFilterMenuClose={onFilterMenuClose}\n onFilterMenuOpen={onFilterMenuOpen}\n onRemoveFilter={onRemoveFilter}\n isMulti={column.filter && column.filter.isMulti}\n value={value}\n />\n );\n };\n\nexport { FilterableFormatter };\nexport default FilterableFormatter;\n"],
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC0BjB;AAxBN,SAAS,wBAAwB;AACjC,SAAS,iBAAiB,4BAA4B;AAEtD,MAAM,sBAAsB,CAAC,EAAE,MAAM,aAAa,gBAAgB,OAAO,cAAc,MACrF,SAAU,OAAO,EAAE,OAAO,GAAG;AAC3B,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,OAAO,EAAE,aAAa,WAAW,mBAAmB,iBAAiB;AAAA,IACrE,OAAO,EAAE,QAAQ;AAAA,EACnB,IAAI,KAAK,YAAY;AAErB,MAAI,YAAY;AAChB,MAAI,OAAO,UAAU,OAAO,OAAO,SAAS;AAC1C,gBAAY;AAAA,EACd;AAEA,QAAM,iBACJ,eAAe,CAAC,YACZ,qBAAqB,QAAQ,MAAM,KAAK,IACxC,gBAAgB,QAAQ,UAAU,QAAQ,WAAW,KAAK;AAEhE,QAAM,aAAa,OAAO,iBAAiB;AAC3C,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS,OAAO,UAAU,OAAO,OAAO;AAAA,MACxC;AAAA;AAAA,EACF;AAEJ;AAGF,IAAO,8BAAQ;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import { isFunction } from "@elliemae/ds-utilities";
|
3
|
-
import { strategiesOperators } from "./strategiesOperators";
|
3
|
+
import { strategiesOperators } from "./strategiesOperators.js";
|
4
4
|
const getRuleStrategyOperator = (rule) => rule.strategy || strategiesOperators(rule.operator);
|
5
5
|
const executeFilterStrategy = (rule, row) => {
|
6
6
|
const { value, field, transform, transformRowValue } = rule;
|
@@ -43,9 +43,7 @@ function filterRowsByQueryGroup(rows, query, composedRows) {
|
|
43
43
|
return true;
|
44
44
|
});
|
45
45
|
}
|
46
|
-
const filterRowsByQuery = (rows, query) =>
|
47
|
-
return rows.filter(filterByRules(query.rules, query.condition));
|
48
|
-
};
|
46
|
+
const filterRowsByQuery = (rows, query) => rows.filter(filterByRules(query.rules, query.condition));
|
49
47
|
var filterRowsByQuery_default = filterRowsByQuery;
|
50
48
|
export {
|
51
49
|
filterRowsByQuery_default as default,
|