@elliemae/ds-datagrids 2.0.0-next.1 → 2.0.0-next.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/DSDataGrid.js +246 -243
- package/cjs/DataGridImpl.js +18 -9
- package/cjs/PaginatedDataGrid.js +5 -0
- package/cjs/blockNames.js +2 -2
- package/cjs/columns/IconColumn.js +19 -17
- package/cjs/columns/NumberColumn.js +2 -4
- package/cjs/components/BodyCell.js +20 -12
- package/cjs/components/BodyList.js +7 -0
- package/cjs/components/ColumnVisibilityMenuOption.js +12 -6
- package/cjs/components/ColumnsOptionsMenuSection.js +35 -28
- package/cjs/components/EmptyState.js +19 -17
- package/cjs/components/HeaderCell.js +15 -9
- package/cjs/components/List.js +5 -0
- package/cjs/components/ListItem.js +7 -0
- package/cjs/components/NoResults.js +5 -0
- package/cjs/components/RowsLoader.js +5 -4
- package/cjs/components/Table.js +5 -0
- package/cjs/components/TableBody.js +5 -0
- package/cjs/components/TableHeader.js +5 -0
- package/cjs/components/footer/addOptionalFooterComponents.js +5 -4
- package/cjs/components/header/PrimaryControls.js +20 -15
- package/cjs/components/header/addOptionalHeaderComponents.js +4 -3
- package/cjs/components/renderers/defaultClassedRenderers.js +35 -23
- package/cjs/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js +50 -39
- package/cjs/plugins/column-dnd/DndColumnsPlugin.js +11 -7
- package/cjs/plugins/column-dnd/decorateGridWithDndColumns.js +2 -3
- package/cjs/plugins/column-sizing/ColumnSizingPlugin.js +11 -9
- package/cjs/plugins/column-sizing/columnMeasurerTransformer.js +13 -6
- package/cjs/plugins/column-sizing/ext-points/decorateColumn.js +3 -3
- package/cjs/plugins/column-sizing/ext-points/getTableProps.js +23 -17
- package/cjs/plugins/column-sizing/useColumnSizeService.js +13 -3
- package/cjs/plugins/column-sizing/useStylesheetHelpers.js +69 -53
- package/cjs/plugins/column-sizing/utils.js +10 -6
- package/cjs/plugins/custom-cell-renderer/addCustomRendererToCell.js +9 -4
- package/cjs/plugins/custom-cell-renderer/getRendererComponent.js +20 -21
- package/cjs/plugins/editable/EditableComponents/ComboBox.js +7 -3
- package/cjs/plugins/editable/EditableComponents/TextBox.js +20 -14
- package/cjs/plugins/editable/EditablePlugin.js +16 -15
- package/cjs/plugins/editable/decorateEditable.js +19 -11
- package/cjs/plugins/editable/getEditorComponent.js +45 -34
- package/cjs/plugins/expandable-grid/ExpandableColumn.js +60 -53
- package/cjs/plugins/expandable-grid/ExpandablePlugin.js +38 -26
- package/cjs/plugins/expandable-grid/ExpandedRow.js +28 -18
- package/cjs/plugins/expandable-grid/ExpandedRowExtra.js +18 -12
- package/cjs/plugins/expandable-grid/useExpandGridState.js +4 -8
- package/cjs/plugins/export-data/ExportDataPlugin.js +31 -17
- package/cjs/plugins/filterable/FilterablePlugin.js +7 -6
- package/cjs/plugins/filterable/addFilterToColumn.js +5 -0
- package/cjs/plugins/filterable/components/FilterableHeader.js +36 -27
- package/cjs/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js +41 -34
- package/cjs/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js +27 -22
- package/cjs/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js +122 -156
- package/cjs/plugins/filterable/components/filterable-menus/TextFilterMenu.js +29 -20
- package/cjs/plugins/filterable/filterableFormatter.js +15 -10
- package/cjs/plugins/filterable/filtering-helper/filterRowsByQuery.js +16 -4
- package/cjs/plugins/filterable/filtering-helper/strategiesOperators.js +7 -4
- package/cjs/plugins/filterable/helper.js +17 -7
- package/cjs/plugins/filterable/useFilterableState.js +12 -5
- package/cjs/plugins/grouping-by/GroupingByPlugin.js +3 -1
- package/cjs/plugins/grouping-grid/GroupingPlugin.js +10 -1
- package/cjs/plugins/grouping-grid/walkStrategy.js +13 -9
- package/cjs/plugins/infinite-scrolling/InfiniteScrollPlugin.js +8 -1
- package/cjs/plugins/pagination/PaginationPlugin.js +9 -2
- package/cjs/plugins/pagination/components/Pagination.js +10 -9
- package/cjs/plugins/pagination/components/Paginator.js +8 -7
- package/cjs/plugins/pagination/components/PerPageDropdown.js +20 -13
- package/cjs/plugins/pagination/helper.js +10 -7
- package/cjs/plugins/pagination/usePaginationState.js +8 -3
- package/cjs/plugins/resizable/ResizablePlugin.js +5 -4
- package/cjs/plugins/resizable/decorateResizable.js +14 -8
- package/cjs/plugins/resizable/useResizeHandle.js +21 -16
- package/cjs/plugins/resizable/utils.js +9 -6
- package/cjs/plugins/row-dnd/DndRowsPlugin.js +24 -16
- package/cjs/plugins/selectable/SelectablePlugin.js +11 -10
- package/cjs/plugins/selectable/addSelectableColumn.js +24 -16
- package/cjs/plugins/selectable/helper.js +12 -3
- package/cjs/plugins/selectable/selectableFormatter.js +80 -71
- package/cjs/plugins/selectable/useSelectableState.js +25 -11
- package/cjs/plugins/sortable/SortablePlugin.js +8 -7
- package/cjs/plugins/sortable/sortHeaderFormatter.js +14 -15
- package/cjs/plugins/sortable/sortTree.js +13 -3
- package/cjs/plugins/sortable/sorter.js +152 -134
- package/cjs/plugins/sortable/useSortableState.js +8 -0
- package/cjs/plugins/toolbar/RowRenderer.js +9 -3
- package/cjs/plugins/toolbar/ToolbarPlugin.js +1 -0
- package/cjs/plugins/toolbar/ToolbarTrigger.js +18 -13
- package/cjs/plugins/virtualization/AutoHeightList.js +10 -8
- package/cjs/plugins/virtualization/VirtualizationPlugin.js +32 -25
- package/cjs/plugins/virtualization/VirtualizedBody.js +20 -10
- package/cjs/plugins/virtualization/VirtualizedBodyRow.js +8 -7
- package/cjs/renders/CellWithAddons.js +20 -18
- package/cjs/renders/styled.js +5 -16
- package/cjs/utilities/getPluginsFromProps.js +5 -1
- package/cjs/utilities/getScrollbarSize.js +2 -1
- package/cjs/utilities/normalizeData.js +7 -1
- package/esm/DSDataGrid.js +246 -243
- package/esm/DataGridImpl.js +18 -9
- package/esm/PaginatedDataGrid.js +5 -0
- package/esm/blockNames.js +2 -2
- package/esm/columns/IconColumn.js +19 -17
- package/esm/columns/NumberColumn.js +2 -4
- package/esm/components/BodyCell.js +20 -12
- package/esm/components/BodyList.js +7 -0
- package/esm/components/ColumnVisibilityMenuOption.js +12 -6
- package/esm/components/ColumnsOptionsMenuSection.js +35 -28
- package/esm/components/EmptyState.js +18 -15
- package/esm/components/HeaderCell.js +15 -9
- package/esm/components/List.js +5 -0
- package/esm/components/ListItem.js +7 -0
- package/esm/components/NoResults.js +5 -0
- package/esm/components/RowsLoader.js +5 -4
- package/esm/components/Table.js +5 -0
- package/esm/components/TableBody.js +5 -0
- package/esm/components/TableHeader.js +5 -0
- package/esm/components/footer/addOptionalFooterComponents.js +5 -4
- package/esm/components/header/PrimaryControls.js +20 -14
- package/esm/components/header/addOptionalHeaderComponents.js +4 -3
- package/esm/components/renderers/defaultClassedRenderers.js +35 -23
- package/esm/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js +50 -39
- package/esm/plugins/column-dnd/DndColumnsPlugin.js +8 -4
- package/esm/plugins/column-dnd/decorateGridWithDndColumns.js +1 -1
- package/esm/plugins/column-sizing/ColumnSizingPlugin.js +10 -8
- package/esm/plugins/column-sizing/columnMeasurerTransformer.js +12 -5
- package/esm/plugins/column-sizing/ext-points/decorateColumn.js +1 -1
- package/esm/plugins/column-sizing/ext-points/getTableProps.js +22 -15
- package/esm/plugins/column-sizing/useColumnSizeService.js +13 -3
- package/esm/plugins/column-sizing/useStylesheetHelpers.js +67 -51
- package/esm/plugins/column-sizing/utils.js +8 -4
- package/esm/plugins/custom-cell-renderer/addCustomRendererToCell.js +6 -1
- package/esm/plugins/custom-cell-renderer/getRendererComponent.js +15 -11
- package/esm/plugins/editable/EditableComponents/ComboBox.js +6 -1
- package/esm/plugins/editable/EditableComponents/TextBox.js +19 -12
- package/esm/plugins/editable/EditablePlugin.js +14 -12
- package/esm/plugins/editable/decorateEditable.js +18 -9
- package/esm/plugins/editable/getEditorComponent.js +49 -38
- package/esm/plugins/expandable-grid/ExpandableColumn.js +59 -50
- package/esm/plugins/expandable-grid/ExpandablePlugin.js +34 -20
- package/esm/plugins/expandable-grid/ExpandedRow.js +27 -17
- package/esm/plugins/expandable-grid/ExpandedRowExtra.js +17 -11
- package/esm/plugins/expandable-grid/useExpandGridState.js +2 -2
- package/esm/plugins/export-data/ExportDataPlugin.js +30 -16
- package/esm/plugins/filterable/FilterablePlugin.js +5 -4
- package/esm/plugins/filterable/addFilterToColumn.js +5 -0
- package/esm/plugins/filterable/components/FilterableHeader.js +32 -22
- package/esm/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js +41 -33
- package/esm/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js +27 -21
- package/esm/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js +121 -154
- package/esm/plugins/filterable/components/filterable-menus/TextFilterMenu.js +28 -18
- package/esm/plugins/filterable/filterableFormatter.js +15 -10
- package/esm/plugins/filterable/filtering-helper/filterRowsByQuery.js +14 -2
- package/esm/plugins/filterable/filtering-helper/strategiesOperators.js +7 -4
- package/esm/plugins/filterable/helper.js +11 -1
- package/esm/plugins/filterable/useFilterableState.js +12 -5
- package/esm/plugins/grouping-by/GroupingByPlugin.js +3 -1
- package/esm/plugins/grouping-grid/GroupingPlugin.js +10 -1
- package/esm/plugins/grouping-grid/walkStrategy.js +13 -9
- package/esm/plugins/infinite-scrolling/InfiniteScrollPlugin.js +8 -1
- package/esm/plugins/pagination/PaginationPlugin.js +8 -1
- package/esm/plugins/pagination/components/Pagination.js +10 -9
- package/esm/plugins/pagination/components/Paginator.js +8 -7
- package/esm/plugins/pagination/components/PerPageDropdown.js +17 -9
- package/esm/plugins/pagination/helper.js +10 -7
- package/esm/plugins/pagination/usePaginationState.js +7 -1
- package/esm/plugins/resizable/ResizablePlugin.js +4 -3
- package/esm/plugins/resizable/decorateResizable.js +14 -8
- package/esm/plugins/resizable/useResizeHandle.js +21 -16
- package/esm/plugins/resizable/utils.js +7 -4
- package/esm/plugins/row-dnd/DndRowsPlugin.js +22 -13
- package/esm/plugins/selectable/SelectablePlugin.js +10 -9
- package/esm/plugins/selectable/addSelectableColumn.js +24 -16
- package/esm/plugins/selectable/helper.js +10 -1
- package/esm/plugins/selectable/selectableFormatter.js +79 -68
- package/esm/plugins/selectable/useSelectableState.js +20 -5
- package/esm/plugins/sortable/SortablePlugin.js +5 -4
- package/esm/plugins/sortable/sortHeaderFormatter.js +12 -11
- package/esm/plugins/sortable/sortTree.js +13 -3
- package/esm/plugins/sortable/sorter.js +152 -134
- package/esm/plugins/sortable/useSortableState.js +8 -0
- package/esm/plugins/toolbar/RowRenderer.js +8 -2
- package/esm/plugins/toolbar/ToolbarPlugin.js +1 -0
- package/esm/plugins/toolbar/ToolbarTrigger.js +17 -11
- package/esm/plugins/virtualization/AutoHeightList.js +6 -3
- package/esm/plugins/virtualization/VirtualizationPlugin.js +31 -24
- package/esm/plugins/virtualization/VirtualizedBody.js +16 -6
- package/esm/plugins/virtualization/VirtualizedBodyRow.js +8 -7
- package/esm/renders/CellWithAddons.js +15 -14
- package/esm/renders/styled.js +3 -15
- package/esm/utilities/getPluginsFromProps.js +5 -1
- package/esm/utilities/getScrollbarSize.js +2 -1
- package/esm/utilities/normalizeData.js +7 -1
- package/package.json +19 -18
- package/types/components/BodyCell.d.ts +1 -1
- package/types/components/HeaderCell.d.ts +1 -1
- package/types/plugins/column-sizing/columnMeasurerTransformer.d.ts +1 -1
- package/types/plugins/column-sizing/ext-points/getTableProps.d.ts +1 -1
- package/types/plugins/expandable-grid/ExpandedRowExtra.d.ts +1 -1
- package/types/plugins/expandable-grid/useExpandGridState.d.ts +4 -4
- package/types/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.d.ts +1 -1
- package/types/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.d.ts +1 -1
- package/types/plugins/filterable/components/filterable-menus/TextFilterMenu.d.ts +1 -1
- package/types/plugins/filterable/helper.d.ts +15 -3
- package/types/plugins/pagination/components/PerPageDropdown.d.ts +1 -1
- package/cjs/package.json +0 -7
- package/esm/package.json +0 -7
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
2
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
3
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
4
|
import 'core-js/modules/es.string.replace.js';
|
|
5
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
6
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
7
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
8
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
9
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
4
10
|
import { useState, useEffect, useCallback } from 'react';
|
|
5
11
|
import { aggregatedClasses } from '@elliemae/ds-classnames';
|
|
6
|
-
import { debounce, get } from '@elliemae/ds-utilities
|
|
7
|
-
import useResizeObserver from '@elliemae/ds-utilities/hooks/useResizeObserver';
|
|
12
|
+
import { debounce, useResizeObserver, get } from '@elliemae/ds-utilities';
|
|
8
13
|
import { useTheme } from '@elliemae/ds-system';
|
|
9
14
|
import getFilterMenuByType from './filterable-menus/getFilterMenuByType.js';
|
|
10
15
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
@@ -13,25 +18,29 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
13
18
|
|
|
14
19
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
15
20
|
const blockName = 'data-grid-filter-header';
|
|
16
|
-
const Container = aggregatedClasses('div')(blockName, null,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
const Container = aggregatedClasses('div')(blockName, null, _ref => {
|
|
22
|
+
let {
|
|
23
|
+
showFilter
|
|
24
|
+
} = _ref;
|
|
25
|
+
return {
|
|
26
|
+
'show-filter': showFilter
|
|
27
|
+
};
|
|
28
|
+
});
|
|
21
29
|
const FilterHeaderValue = aggregatedClasses('div')(blockName, 'value');
|
|
22
30
|
const FilterHeaderButton = aggregatedClasses('div')(blockName, 'button');
|
|
23
|
-
function FilterableHeader({
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
function FilterableHeader(_ref2) {
|
|
32
|
+
let {
|
|
33
|
+
column,
|
|
34
|
+
value,
|
|
35
|
+
columnData,
|
|
36
|
+
onAddFilter,
|
|
37
|
+
onRemoveFilter,
|
|
38
|
+
filterMenuRef,
|
|
39
|
+
onFilterMenuClose,
|
|
40
|
+
onFilterMenuOpen,
|
|
41
|
+
filters,
|
|
42
|
+
isMulti
|
|
43
|
+
} = _ref2;
|
|
35
44
|
const [isMenuOpened, setMenuOpened] = useState(false);
|
|
36
45
|
const [headerWidth, setHeaderWidth] = useState();
|
|
37
46
|
const debouncedWidthSetter = debounce(setHeaderWidth, 200);
|
|
@@ -42,9 +51,10 @@ function FilterableHeader({
|
|
|
42
51
|
const theme = useTheme();
|
|
43
52
|
const dropdownMinWidth = filterMenuMinWidth || Number(theme.space.xl.replace('px', '')) * 2;
|
|
44
53
|
|
|
45
|
-
const defineHeaderWidth =
|
|
46
|
-
|
|
47
|
-
|
|
54
|
+
const defineHeaderWidth = _ref3 => {
|
|
55
|
+
let {
|
|
56
|
+
width
|
|
57
|
+
} = _ref3;
|
|
48
58
|
let nextWidth = width + 16; // todo: use dimsum space once we convert it to JS
|
|
49
59
|
|
|
50
60
|
if (nextWidth < dropdownMinWidth) nextWidth = dropdownMinWidth;
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
2
3
|
import { useState, useEffect } from 'react';
|
|
3
4
|
import { DSControlledDateRangePicker } from '@elliemae/ds-controlled-form';
|
|
4
|
-
import DSPopper, { PopperPositions } from '@elliemae/ds-
|
|
5
|
-
import
|
|
6
|
-
import DSButton from '@elliemae/ds-
|
|
5
|
+
import DSPopper, { PopperPositions } from '@elliemae/ds-popper';
|
|
6
|
+
import { DatePicker2 } from '@elliemae/ds-icons';
|
|
7
|
+
import DSButton from '@elliemae/ds-button';
|
|
7
8
|
import moment from 'moment';
|
|
8
9
|
import { aggregatedClasses } from '@elliemae/ds-classnames';
|
|
9
10
|
import { DEFAULT_DATE_FORMAT } from './defaultDateFormat.js';
|
|
10
11
|
|
|
11
|
-
var
|
|
12
|
+
var _DatePicker;
|
|
12
13
|
const blockname = 'date-range';
|
|
13
14
|
const Wrapper = aggregatedClasses('div')(blockname, 'wrapper');
|
|
14
15
|
const Header = aggregatedClasses('div')(blockname, 'header'); // const randomString = (maxLength = 5) => Math.random().toString(36).slice(-maxLength);
|
|
15
16
|
|
|
16
|
-
const DateRangePickerContainer =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
const DateRangePickerContainer = _ref => {
|
|
18
|
+
let {
|
|
19
|
+
onChange = () => null,
|
|
20
|
+
showHeader
|
|
21
|
+
} = _ref;
|
|
20
22
|
const [startDate, setStartDate] = useState('');
|
|
21
23
|
const [endDate, setEndDate] = useState(''); // For some reason it worked like this
|
|
22
24
|
|
|
@@ -35,10 +37,12 @@ const DateRangePickerContainer = ({
|
|
|
35
37
|
}, [startDate, endDate, lastChangeWasPicker]);
|
|
36
38
|
return /*#__PURE__*/_jsx(Wrapper, {
|
|
37
39
|
"data-testid": "date-range__wrapper",
|
|
40
|
+
onKeyDown: e => e.code === 'Enter' && setLastChangeWasPicker(true),
|
|
38
41
|
style: {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
backgroundColor: 'white',
|
|
43
|
+
boxShadow: '0 6px 20px 0 rgb(0 0 0 / 24%)',
|
|
44
|
+
width: '261px'
|
|
45
|
+
}
|
|
42
46
|
}, void 0, showHeader && /*#__PURE__*/_jsx(Header, {
|
|
43
47
|
style: {
|
|
44
48
|
padding: '8px',
|
|
@@ -72,35 +76,39 @@ const DateRangePickerContainer = ({
|
|
|
72
76
|
}));
|
|
73
77
|
};
|
|
74
78
|
|
|
75
|
-
const formatRangeDate = ({
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
+
const formatRangeDate = function (_ref2) {
|
|
80
|
+
let {
|
|
81
|
+
startDate,
|
|
82
|
+
endDate
|
|
83
|
+
} = _ref2;
|
|
84
|
+
let format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_DATE_FORMAT;
|
|
79
85
|
const sameDay = startDate.isSame(endDate, 'day');
|
|
80
|
-
if (sameDay) return
|
|
81
|
-
return
|
|
86
|
+
if (sameDay) return "".concat(endDate.format(format));
|
|
87
|
+
return "".concat(startDate.format(format), " - ").concat(endDate.format(format));
|
|
82
88
|
};
|
|
83
89
|
|
|
84
|
-
function DateRangeFilterMenu({
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
90
|
+
function DateRangeFilterMenu(_ref3) {
|
|
91
|
+
let {
|
|
92
|
+
column,
|
|
93
|
+
className,
|
|
94
|
+
isMenuOpened = false,
|
|
95
|
+
onOpenMenu = () => null,
|
|
96
|
+
placement = PopperPositions.BOTTOM_END,
|
|
97
|
+
onAddFilter = () => null,
|
|
98
|
+
dateFormatter = formatRangeDate,
|
|
99
|
+
showHeader = true,
|
|
100
|
+
menuProps
|
|
101
|
+
} = _ref3;
|
|
95
102
|
return /*#__PURE__*/_jsx(DSPopper, {
|
|
96
103
|
contentComponent: /*#__PURE__*/_jsx("div", {
|
|
97
104
|
className: className
|
|
98
105
|
}, void 0, /*#__PURE__*/_jsx(DateRangePickerContainer, {
|
|
99
106
|
minimumNights: 0,
|
|
100
|
-
onChange:
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
107
|
+
onChange: _ref4 => {
|
|
108
|
+
let {
|
|
109
|
+
startDate,
|
|
110
|
+
endDate
|
|
111
|
+
} = _ref4;
|
|
104
112
|
startDate.startOf('day');
|
|
105
113
|
endDate.endOf('day');
|
|
106
114
|
onAddFilter({
|
|
@@ -129,7 +137,7 @@ function DateRangeFilterMenu({
|
|
|
129
137
|
showArrow: false,
|
|
130
138
|
triggerComponent: /*#__PURE__*/_jsx(DSButton, {
|
|
131
139
|
buttonType: "text",
|
|
132
|
-
icon:
|
|
140
|
+
icon: _DatePicker || (_DatePicker = /*#__PURE__*/_jsx(DatePicker2, {})),
|
|
133
141
|
onClick: () => !isMenuOpened ? onOpenMenu(true) : onOpenMenu(false),
|
|
134
142
|
size: "s"
|
|
135
143
|
}),
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
2
3
|
import { useState, useCallback } from 'react';
|
|
3
4
|
import Grid from '@elliemae/ds-grid';
|
|
4
5
|
import { DSControlledDateTimePicker } from '@elliemae/ds-controlled-form';
|
|
5
|
-
import DSPopper, { PopperPositions } from '@elliemae/ds-
|
|
6
|
-
import
|
|
7
|
-
import DSButton from '@elliemae/ds-
|
|
6
|
+
import DSPopper, { PopperPositions } from '@elliemae/ds-popper';
|
|
7
|
+
import { DatePicker2 } from '@elliemae/ds-icons';
|
|
8
|
+
import DSButton from '@elliemae/ds-button';
|
|
8
9
|
import moment from 'moment';
|
|
9
10
|
import { DEFAULT_DATE_FORMAT } from './defaultDateFormat.js';
|
|
10
11
|
|
|
11
|
-
var
|
|
12
|
+
var _DatePicker;
|
|
12
13
|
|
|
13
|
-
const SingleDatePickerContainer =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const SingleDatePickerContainer = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
onChange = () => null,
|
|
17
|
+
showHeader
|
|
18
|
+
} = _ref;
|
|
17
19
|
const [date, setDate] = useState('');
|
|
18
20
|
const handleDateChange = useCallback(data => {
|
|
19
21
|
if (!data.includes('_')) onChange(moment(data));
|
|
@@ -37,19 +39,23 @@ const SingleDatePickerContainer = ({
|
|
|
37
39
|
}));
|
|
38
40
|
};
|
|
39
41
|
|
|
40
|
-
const formatDate = (date
|
|
42
|
+
const formatDate = function (date) {
|
|
43
|
+
let format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_DATE_FORMAT;
|
|
44
|
+
return date.format(format);
|
|
45
|
+
};
|
|
41
46
|
|
|
42
|
-
function SingleDateFilterMenu({
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
function SingleDateFilterMenu(_ref2) {
|
|
48
|
+
let {
|
|
49
|
+
column,
|
|
50
|
+
className,
|
|
51
|
+
isMenuOpened = false,
|
|
52
|
+
onOpenMenu = () => null,
|
|
53
|
+
placement = PopperPositions.BOTTOM_END,
|
|
54
|
+
onAddFilter = () => null,
|
|
55
|
+
dateFormatter = formatDate,
|
|
56
|
+
showHeader = false,
|
|
57
|
+
menuProps
|
|
58
|
+
} = _ref2;
|
|
53
59
|
return /*#__PURE__*/_jsx(DSPopper, {
|
|
54
60
|
contentComponent: /*#__PURE__*/_jsx("div", {
|
|
55
61
|
className: className,
|
|
@@ -80,7 +86,7 @@ function SingleDateFilterMenu({
|
|
|
80
86
|
showArrow: false,
|
|
81
87
|
triggerComponent: /*#__PURE__*/_jsx(DSButton, {
|
|
82
88
|
buttonType: "text",
|
|
83
|
-
icon:
|
|
89
|
+
icon: _DatePicker || (_DatePicker = /*#__PURE__*/_jsx(DatePicker2, {})),
|
|
84
90
|
onClick: () => !isMenuOpened ? onOpenMenu(true) : onOpenMenu(false),
|
|
85
91
|
size: "s"
|
|
86
92
|
}),
|
|
@@ -1,184 +1,151 @@
|
|
|
1
1
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { DayPickerRangeController } from '@elliemae/ds-date-range-picker';
|
|
6
|
-
import { SingleRangeDateSwitcher, DSDatePickerController } from '@elliemae/ds-date-picker';
|
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
|
+
import { useState, useEffect } from 'react';
|
|
4
|
+
import { DSControlledCheckbox, DSControlledDateRangePicker, DSControlledDateTimePicker } from '@elliemae/ds-controlled-form';
|
|
7
5
|
import DSPopper, { PopperPositions } from '@elliemae/ds-basic/Popper';
|
|
8
|
-
import
|
|
6
|
+
import { DatePicker2 } from '@elliemae/ds-icons';
|
|
9
7
|
import DSButton from '@elliemae/ds-basic/Button';
|
|
8
|
+
import Grid from '@elliemae/ds-grid';
|
|
10
9
|
import moment from 'moment';
|
|
11
|
-
import
|
|
10
|
+
import styled from 'styled-components';
|
|
12
11
|
import { DEFAULT_DATE_FORMAT } from './defaultDateFormat.js';
|
|
13
|
-
import { jsx } from 'react/jsx-runtime';
|
|
14
12
|
|
|
15
|
-
var
|
|
13
|
+
var _DatePicker;
|
|
14
|
+
const StyledGridWrapper = /*#__PURE__*/styled(Grid).withConfig({
|
|
15
|
+
componentId: "sc-jay5xg-0"
|
|
16
|
+
})([".notCurrentMonth{opacity:", ";pointer-events:", ";}"], props => props.enableOutsideDays ? '1' : '0', props => props.enableOutsideDays ? 'auto' : 'none'); // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
|
|
16
17
|
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
20
|
-
|
|
21
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
22
|
-
const START_DATE = 'startDate';
|
|
23
|
-
const END_DATE = 'endDate';
|
|
24
|
-
const blockname = 'date-range';
|
|
25
|
-
const Wrapper = aggregatedClasses('div')(blockname, 'wrapper'); // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
|
|
26
|
-
|
|
27
|
-
const noop = (...args) => {};
|
|
18
|
+
const noop = function () {};
|
|
28
19
|
|
|
29
20
|
const SingleRangeSwitcherContainer = _ref => {
|
|
30
21
|
let {
|
|
31
22
|
onChange = noop,
|
|
32
23
|
enableOutsideDays
|
|
33
|
-
} = _ref
|
|
34
|
-
|
|
24
|
+
} = _ref;
|
|
25
|
+
const [startDate, setStartDate] = useState('');
|
|
26
|
+
const [endDate, setEndDate] = useState(''); // For some reason it worked like this
|
|
35
27
|
|
|
36
|
-
const [
|
|
37
|
-
const [focusedInputPicker, setFocusedInputPicker] = useState(START_DATE);
|
|
38
|
-
const [singleDate, setSingleDate] = useState();
|
|
39
|
-
const [dateRange, setDateRange] = useState({});
|
|
28
|
+
const [lastChangeWasPicker, setLastChangeWasPicker] = useState(false);
|
|
40
29
|
const [isDateRange, setIsDateRange] = useState(false);
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
const startMoment = moment(startDate);
|
|
32
|
+
const endMoment = moment(endDate);
|
|
33
|
+
|
|
34
|
+
if (lastChangeWasPicker && startDate && !startDate.includes('_') && endDate && !endDate.includes('_') && endMoment.diff(startMoment) >= 0) {
|
|
35
|
+
onChange({
|
|
36
|
+
startDate: startMoment,
|
|
37
|
+
endDate: endMoment
|
|
38
|
+
});
|
|
39
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
40
|
+
|
|
41
|
+
}, [startDate, endDate, lastChangeWasPicker]);
|
|
42
|
+
return /*#__PURE__*/_jsx(StyledGridWrapper, {
|
|
43
|
+
"data-testid": "date-single-range__wrapper",
|
|
44
|
+
style: {
|
|
45
|
+
backgroundColor: 'white',
|
|
46
|
+
boxShadow: '0 6px 20px 0 rgb(0 0 0 / 24%)',
|
|
47
|
+
width: '261px',
|
|
48
|
+
display: 'grid',
|
|
49
|
+
justifyContent: 'center'
|
|
50
|
+
},
|
|
51
|
+
cols: ['100%'],
|
|
52
|
+
enableOutsideDays: enableOutsideDays,
|
|
53
|
+
onKeyDown: e => e.code === 'Enter' && setLastChangeWasPicker(true)
|
|
54
|
+
}, void 0, /*#__PURE__*/_jsx(Grid, {
|
|
55
|
+
gutter: "xxs",
|
|
56
|
+
alignItems: "center",
|
|
57
|
+
p: "xxs"
|
|
58
|
+
}, void 0, /*#__PURE__*/_jsx(DSControlledCheckbox, {
|
|
59
|
+
checked: isDateRange,
|
|
60
|
+
name: "Date range",
|
|
61
|
+
label: "Range",
|
|
62
|
+
id: "date-range-switcher-id-internal",
|
|
63
|
+
onChange: () => {
|
|
64
|
+
setIsDateRange(!isDateRange);
|
|
65
|
+
setStartDate('');
|
|
66
|
+
setEndDate('');
|
|
59
67
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
endDate: dateRange.endDate
|
|
64
|
-
});
|
|
65
|
-
setDateRange(dates);
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
const handlePickerChange = dates => {
|
|
69
|
-
if (dates.endDate) {
|
|
70
|
-
setTimeout(() => {
|
|
71
|
-
onChange({
|
|
72
|
-
startDate: dates.startDate,
|
|
73
|
-
endDate: dates.endDate
|
|
74
|
-
});
|
|
75
|
-
}, 500);
|
|
68
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
69
|
+
style: {
|
|
70
|
+
width: 'fit-content'
|
|
76
71
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const handleSingleDateChange = useCallback(date => {
|
|
84
|
-
const dates = {
|
|
85
|
-
startDate: moment(date).startOf('day'),
|
|
86
|
-
endDate: moment(date).endOf('day')
|
|
87
|
-
};
|
|
88
|
-
onChange(dates);
|
|
89
|
-
setSingleDate(dates);
|
|
90
|
-
}, [onChange]);
|
|
91
|
-
|
|
92
|
-
const handleStartInputChange = newDate => {
|
|
93
|
-
setDateRange({
|
|
94
|
-
startDate: newDate,
|
|
95
|
-
endDate: dateRange.endDate
|
|
96
|
-
});
|
|
97
|
-
setPickerRange(_objectSpread(_objectSpread({}, pickerRange), {}, {
|
|
98
|
-
startDate: newDate
|
|
99
|
-
}));
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
const handleEndInputChange = newDate => {
|
|
103
|
-
setDateRange({
|
|
104
|
-
startDate: dateRange.startDate,
|
|
105
|
-
endDate: newDate
|
|
106
|
-
});
|
|
107
|
-
setPickerRange(_objectSpread(_objectSpread({}, pickerRange), {}, {
|
|
108
|
-
endDate: newDate
|
|
109
|
-
}));
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
const dateRangeController = /*#__PURE__*/jsx(DayPickerRangeController, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
113
|
-
enableOutsideDays: enableOutsideDays,
|
|
114
|
-
endDate: pickerRange.endDate,
|
|
115
|
-
focusedInput: focusedInputPicker,
|
|
116
|
-
hideKeyboardShortcutsPanel: true,
|
|
117
|
-
onDatesChange: handlePickerChange,
|
|
118
|
-
onFocusChange: handlePickerFocusChange,
|
|
119
|
-
startDate: pickerRange.startDate
|
|
120
|
-
}));
|
|
121
|
-
|
|
122
|
-
const singleDateController = /*#__PURE__*/_jsx(DSDatePickerController, {
|
|
123
|
-
date: singleDate,
|
|
124
|
-
enableOutsideDays: enableOutsideDays,
|
|
125
|
-
onDateChange: handleSingleDateChange
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
return /*#__PURE__*/_jsx(Wrapper, {
|
|
129
|
-
"data-testid": "date-single-range__wrapper"
|
|
130
|
-
}, void 0, /*#__PURE__*/_jsx(SingleRangeDateSwitcher, {
|
|
131
|
-
isDateRange: isDateRange,
|
|
132
|
-
focusedInput: focusedInputHeader,
|
|
133
|
-
onFocusChange: handleHeaderFocusChange,
|
|
134
|
-
onEndInputChange: handleEndInputChange,
|
|
135
|
-
onSingleInputChange: handleSingleDateChange,
|
|
136
|
-
onStartInputChange: handleStartInputChange,
|
|
137
|
-
selectedEndDate: dateRange.endDate,
|
|
138
|
-
selectedSingleDate: singleDate,
|
|
139
|
-
selectedStartDate: dateRange.startDate,
|
|
140
|
-
setIsDateRange: ({
|
|
141
|
-
target: {
|
|
142
|
-
checked
|
|
143
|
-
}
|
|
144
|
-
}) => {
|
|
145
|
-
setIsDateRange(checked);
|
|
72
|
+
}, void 0, isDateRange ? /*#__PURE__*/_jsx(DSControlledDateRangePicker, {
|
|
73
|
+
fromDate: startDate,
|
|
74
|
+
onFromDateChange: _start => {
|
|
75
|
+
setStartDate(_start);
|
|
76
|
+
setLastChangeWasPicker(false);
|
|
146
77
|
},
|
|
147
|
-
|
|
148
|
-
|
|
78
|
+
toDate: endDate,
|
|
79
|
+
onToDateChange: _end => {
|
|
80
|
+
setEndDate(_end);
|
|
81
|
+
setLastChangeWasPicker(false);
|
|
82
|
+
},
|
|
83
|
+
type: "date-range-inputs"
|
|
84
|
+
}) : /*#__PURE__*/_jsx(DSControlledDateTimePicker, {
|
|
85
|
+
date: startDate,
|
|
86
|
+
onDateChange: _date => {
|
|
87
|
+
setLastChangeWasPicker(false);
|
|
88
|
+
setStartDate(_date);
|
|
89
|
+
setEndDate(_date);
|
|
90
|
+
},
|
|
91
|
+
type: "date-inputs"
|
|
92
|
+
}))), /*#__PURE__*/_jsx(Grid, {}, void 0, isDateRange ? /*#__PURE__*/_jsx(DSControlledDateRangePicker, {
|
|
93
|
+
fromDate: startDate,
|
|
94
|
+
onFromDateChange: _start => {
|
|
95
|
+
setStartDate(_start);
|
|
96
|
+
setLastChangeWasPicker(true);
|
|
97
|
+
},
|
|
98
|
+
toDate: endDate,
|
|
99
|
+
onToDateChange: _end => {
|
|
100
|
+
setEndDate(_end);
|
|
101
|
+
setLastChangeWasPicker(true);
|
|
102
|
+
},
|
|
103
|
+
type: "date-range-picker-controller-only"
|
|
104
|
+
}) : /*#__PURE__*/_jsx(DSControlledDateTimePicker, {
|
|
105
|
+
date: startDate,
|
|
106
|
+
onDateChange: _date => {
|
|
107
|
+
setLastChangeWasPicker(true);
|
|
108
|
+
setStartDate(_date);
|
|
109
|
+
setEndDate(_date);
|
|
110
|
+
},
|
|
111
|
+
type: "date-picker-controller-only"
|
|
112
|
+
})));
|
|
149
113
|
};
|
|
150
114
|
|
|
151
|
-
const formatRangeDate = ({
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
115
|
+
const formatRangeDate = function (_ref2) {
|
|
116
|
+
let {
|
|
117
|
+
startDate,
|
|
118
|
+
endDate
|
|
119
|
+
} = _ref2;
|
|
120
|
+
let format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_DATE_FORMAT;
|
|
155
121
|
const sameDay = startDate.isSame(endDate, 'day');
|
|
156
|
-
if (sameDay) return
|
|
157
|
-
return
|
|
122
|
+
if (sameDay) return "".concat(endDate.format(format));
|
|
123
|
+
return "".concat(startDate.format(format), " - ").concat(endDate.format(format));
|
|
158
124
|
}; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
159
125
|
|
|
160
126
|
|
|
161
|
-
function SingleRangeSwitcherMenu({
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
127
|
+
function SingleRangeSwitcherMenu(_ref3) {
|
|
128
|
+
let {
|
|
129
|
+
column,
|
|
130
|
+
className,
|
|
131
|
+
isMenuOpened = false,
|
|
132
|
+
onOpenMenu = noop,
|
|
133
|
+
placement = PopperPositions.BOTTOM_END,
|
|
134
|
+
onAddFilter = noop,
|
|
135
|
+
dateFormatter = formatRangeDate,
|
|
136
|
+
enableOutsideDays = true,
|
|
137
|
+
menuProps
|
|
138
|
+
} = _ref3;
|
|
172
139
|
return /*#__PURE__*/_jsx(DSPopper, {
|
|
173
140
|
contentComponent: /*#__PURE__*/_jsx("div", {
|
|
174
141
|
className: className
|
|
175
142
|
}, void 0, /*#__PURE__*/_jsx(SingleRangeSwitcherContainer, {
|
|
176
143
|
enableOutsideDays: enableOutsideDays,
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
144
|
+
onChange: _ref4 => {
|
|
145
|
+
let {
|
|
146
|
+
startDate,
|
|
147
|
+
endDate
|
|
148
|
+
} = _ref4;
|
|
182
149
|
startDate.startOf('day');
|
|
183
150
|
endDate.endOf('day');
|
|
184
151
|
onAddFilter({
|
|
@@ -206,7 +173,7 @@ function SingleRangeSwitcherMenu({
|
|
|
206
173
|
showArrow: false,
|
|
207
174
|
triggerComponent: /*#__PURE__*/_jsx(DSButton, {
|
|
208
175
|
buttonType: "text",
|
|
209
|
-
icon:
|
|
176
|
+
icon: _DatePicker || (_DatePicker = /*#__PURE__*/_jsx(DatePicker2, {})),
|
|
210
177
|
onClick: () => !isMenuOpened ? onOpenMenu(true) : onOpenMenu(false),
|
|
211
178
|
size: "s"
|
|
212
179
|
}),
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
2
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
3
3
|
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
6
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
7
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
8
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
9
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
10
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
11
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
4
12
|
import React, { useState } from 'react';
|
|
5
13
|
import { compact } from 'lodash';
|
|
6
14
|
import DSDropdownMenu from '@elliemae/ds-dropdownmenu';
|
|
7
|
-
import DSButton from '@elliemae/ds-
|
|
8
|
-
import { PopperPositions } from '@elliemae/ds-
|
|
15
|
+
import DSButton from '@elliemae/ds-button';
|
|
16
|
+
import { PopperPositions } from '@elliemae/ds-popper';
|
|
9
17
|
import { Menu, MenuCombobox } from '@elliemae/ds-menu';
|
|
10
|
-
import SearchSmall from '@elliemae/ds-icons
|
|
18
|
+
import { SearchSmall } from '@elliemae/ds-icons';
|
|
11
19
|
import { jsx } from 'react/jsx-runtime';
|
|
12
20
|
|
|
13
21
|
var _SearchSmall;
|
|
@@ -18,21 +26,23 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
18
26
|
|
|
19
27
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
20
28
|
|
|
21
|
-
function TextFilterMenu({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
function TextFilterMenu(_ref) {
|
|
30
|
+
let {
|
|
31
|
+
column,
|
|
32
|
+
menuStyle = {},
|
|
33
|
+
className,
|
|
34
|
+
filters = [],
|
|
35
|
+
isMenuOpened = false,
|
|
36
|
+
onOpenMenu = () => null,
|
|
37
|
+
onClose = () => null,
|
|
38
|
+
placement = PopperPositions.BOTTOM_END,
|
|
39
|
+
menuProps = {},
|
|
40
|
+
onAddFilter = () => null,
|
|
41
|
+
onRemoveFilter = () => null,
|
|
42
|
+
maxOptions = 10,
|
|
43
|
+
isMulti = false
|
|
44
|
+
} = _ref;
|
|
45
|
+
|
|
36
46
|
const {
|
|
37
47
|
options
|
|
38
48
|
} = menuProps,
|