@elliemae/ds-data-table 2.0.0-rc.1 → 2.0.0-rc.10
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/DataTableSchema.js +21 -12
- package/cjs/addons/Filters/Components/CurrencyRangeFilter/index.js +24 -2
- package/cjs/addons/Filters/Components/NumberRangeFilter/index.js +25 -3
- package/cjs/addons/Filters/Components/index.js +0 -2
- package/cjs/addons/Filters/index.js +0 -2
- package/cjs/configs/usePaginationConfig.js +1 -1
- package/cjs/configs/useRowFlattenization.js +3 -3
- package/cjs/exported-related/EditableCell.js +2 -2
- package/cjs/exported-related/FilterPopover.js +17 -3
- package/cjs/exported-related/FilterTypes.js +0 -1
- package/cjs/exported-related/Filters/applyOutOfTheBoxFilters.js +0 -2
- package/cjs/exported-related/Filters/index.js +0 -2
- package/cjs/exported-related/index.js +0 -2
- package/cjs/helpers/refs-helpers.js +2 -2
- package/cjs/index.js +0 -2
- package/cjs/parts/FilterBar/FiltersBar.js +0 -2
- package/cjs/parts/FilterBar/components/index.js +0 -2
- package/cjs/parts/Filters/index.js +10 -12
- package/cjs/parts/Headers/HeaderCellGroup.js +4 -3
- package/cjs/parts/Headers/index.js +1 -1
- package/cjs/parts/Headers/useHeaderCellHandlers.js +4 -2
- package/cjs/parts/HoC/withConditionalDnDColumnContext.js +37 -16
- package/cjs/parts/HoC/withConditionalDnDRowContext.js +11 -12
- package/cjs/parts/HoC/withConditionalDnDSortableContext.js +1 -1
- package/cjs/parts/HoC/withDnDSortableColumnContext.js +5 -19
- package/cjs/parts/HoC/withDnDSortableRowContext.js +3 -17
- package/cjs/parts/Row.js +10 -10
- package/cjs/parts/Rows.js +1 -1
- package/cjs/parts/index.js +1 -1
- package/cjs/styled.js +2 -2
- package/esm/DataTableSchema.js +21 -12
- package/esm/addons/Filters/Components/CurrencyRangeFilter/index.js +24 -2
- package/esm/addons/Filters/Components/NumberRangeFilter/index.js +25 -3
- package/esm/addons/Filters/Components/index.js +0 -1
- package/esm/addons/Filters/index.js +0 -1
- package/esm/configs/usePaginationConfig.js +1 -1
- package/esm/configs/useRowFlattenization.js +3 -3
- package/esm/exported-related/EditableCell.js +2 -2
- package/esm/exported-related/FilterPopover.js +17 -3
- package/esm/exported-related/FilterTypes.js +0 -1
- package/esm/exported-related/Filters/applyOutOfTheBoxFilters.js +0 -2
- package/esm/exported-related/Filters/index.js +0 -1
- package/esm/exported-related/index.js +0 -1
- package/esm/helpers/refs-helpers.js +2 -2
- package/esm/index.js +0 -1
- package/esm/parts/FilterBar/FiltersBar.js +0 -2
- package/esm/parts/FilterBar/components/index.js +0 -1
- package/esm/parts/Filters/index.js +0 -2
- package/esm/parts/Headers/HeaderCellGroup.js +4 -4
- package/esm/parts/Headers/index.js +2 -2
- package/esm/parts/Headers/useHeaderCellHandlers.js +4 -2
- package/esm/parts/HoC/withConditionalDnDColumnContext.js +38 -17
- package/esm/parts/HoC/withConditionalDnDRowContext.js +12 -13
- package/esm/parts/HoC/withConditionalDnDSortableContext.js +1 -1
- package/esm/parts/HoC/withDnDSortableColumnContext.js +6 -20
- package/esm/parts/HoC/withDnDSortableRowContext.js +4 -18
- package/esm/parts/Row.js +7 -10
- package/esm/styled.js +2 -2
- package/package.json +25 -103
- package/types/DataTable.d.ts +245 -43
- package/types/DataTableSchema.d.ts +245 -43
- package/types/addons/Filters/Components/SelectFilter/components.d.ts +6 -6
- package/types/addons/Filters/Components/index.d.ts +0 -1
- package/types/exported-related/FilterTypes.d.ts +0 -1
- package/types/exported-related/Filters/index.d.ts +0 -1
- package/types/helpers/refs-helpers.d.ts +1 -1
- package/types/parts/FilterBar/components/index.d.ts +0 -1
- package/types/parts/FilterBar/styled.d.ts +165 -30
- package/types/parts/Headers/HeaderCellGroup.d.ts +4 -3
- package/types/parts/Row.d.ts +2 -1
- package/types/styled.d.ts +19 -19
- package/types/types/props.d.ts +2 -2
- package/cjs/addons/Filters/Components/TextInputFilter/index.js +0 -92
- package/cjs/exported-related/Filters/textFilterFn.js +0 -14
- package/cjs/helpers/dndkit/hierarchy/customCollisionDetection.js +0 -76
- package/cjs/helpers/dndkit/hierarchy/getHierarchyKeyboardCoordinates.js +0 -141
- package/cjs/helpers/dndkit/hierarchy/types.js +0 -2
- package/cjs/helpers/dndkit/hierarchy/useHierarchyActionHandlers.js +0 -55
- package/cjs/helpers/dndkit/hierarchy/useHierarchyAnnouncements.js +0 -36
- package/cjs/helpers/dndkit/hierarchy/useHierarchyDndkitConfig.js +0 -109
- package/cjs/helpers/dndkit/hierarchy/useHierarchyPreviewHandlers.js +0 -87
- package/cjs/helpers/dndkit/tree/customCollisionDetection.js +0 -98
- package/cjs/helpers/dndkit/tree/getTreeKeyboardCoordinates.js +0 -139
- package/cjs/helpers/dndkit/tree/types.js +0 -2
- package/cjs/helpers/dndkit/tree/useTreeActionHandlers.js +0 -75
- package/cjs/helpers/dndkit/tree/useTreeAnnouncements.js +0 -55
- package/cjs/helpers/dndkit/tree/useTreeDndkitConfig.js +0 -139
- package/cjs/helpers/dndkit/tree/useTreePreviewHandlers.js +0 -54
- package/cjs/helpers/dndkit/types.js +0 -2
- package/cjs/helpers/dndkit/utilities.js +0 -52
- package/cjs/parts/FilterBar/components/TextPill.js +0 -42
- package/cjs/parts/HoC/DragOverlayContext.js +0 -11
- package/esm/addons/Filters/Components/TextInputFilter/index.js +0 -84
- package/esm/exported-related/Filters/textFilterFn.js +0 -10
- package/esm/helpers/dndkit/hierarchy/customCollisionDetection.js +0 -72
- package/esm/helpers/dndkit/hierarchy/getHierarchyKeyboardCoordinates.js +0 -133
- package/esm/helpers/dndkit/hierarchy/types.js +0 -1
- package/esm/helpers/dndkit/hierarchy/useHierarchyActionHandlers.js +0 -51
- package/esm/helpers/dndkit/hierarchy/useHierarchyAnnouncements.js +0 -32
- package/esm/helpers/dndkit/hierarchy/useHierarchyDndkitConfig.js +0 -103
- package/esm/helpers/dndkit/hierarchy/useHierarchyPreviewHandlers.js +0 -83
- package/esm/helpers/dndkit/tree/customCollisionDetection.js +0 -94
- package/esm/helpers/dndkit/tree/getTreeKeyboardCoordinates.js +0 -131
- package/esm/helpers/dndkit/tree/types.js +0 -1
- package/esm/helpers/dndkit/tree/useTreeActionHandlers.js +0 -71
- package/esm/helpers/dndkit/tree/useTreeAnnouncements.js +0 -51
- package/esm/helpers/dndkit/tree/useTreeDndkitConfig.js +0 -133
- package/esm/helpers/dndkit/tree/useTreePreviewHandlers.js +0 -50
- package/esm/helpers/dndkit/types.js +0 -1
- package/esm/helpers/dndkit/utilities.js +0 -47
- package/esm/parts/FilterBar/components/TextPill.js +0 -34
- package/esm/parts/HoC/DragOverlayContext.js +0 -7
- package/types/addons/Filters/Components/TextInputFilter/index.d.ts +0 -3
- package/types/exported-related/Filters/textFilterFn.d.ts +0 -2
- package/types/helpers/dndkit/hierarchy/customCollisionDetection.d.ts +0 -3
- package/types/helpers/dndkit/hierarchy/getHierarchyKeyboardCoordinates.d.ts +0 -3
- package/types/helpers/dndkit/hierarchy/types.d.ts +0 -66
- package/types/helpers/dndkit/hierarchy/useHierarchyActionHandlers.d.ts +0 -2
- package/types/helpers/dndkit/hierarchy/useHierarchyAnnouncements.d.ts +0 -3
- package/types/helpers/dndkit/hierarchy/useHierarchyDndkitConfig.d.ts +0 -3
- package/types/helpers/dndkit/hierarchy/useHierarchyPreviewHandlers.d.ts +0 -2
- package/types/helpers/dndkit/tree/customCollisionDetection.d.ts +0 -4
- package/types/helpers/dndkit/tree/getTreeKeyboardCoordinates.d.ts +0 -3
- package/types/helpers/dndkit/tree/types.d.ts +0 -83
- package/types/helpers/dndkit/tree/useTreeActionHandlers.d.ts +0 -2
- package/types/helpers/dndkit/tree/useTreeAnnouncements.d.ts +0 -4
- package/types/helpers/dndkit/tree/useTreeDndkitConfig.d.ts +0 -3
- package/types/helpers/dndkit/tree/useTreePreviewHandlers.d.ts +0 -2
- package/types/helpers/dndkit/types.d.ts +0 -20
- package/types/helpers/dndkit/utilities.d.ts +0 -7
- package/types/parts/FilterBar/components/TextPill.d.ts +0 -2
- package/types/parts/HoC/DragOverlayContext.d.ts +0 -6
|
@@ -8,15 +8,17 @@ require('core-js/modules/web.dom-collections.iterator.js');
|
|
|
8
8
|
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
9
|
require('core-js/modules/esnext.iterator.constructor.js');
|
|
10
10
|
require('core-js/modules/esnext.iterator.for-each.js');
|
|
11
|
+
require('core-js/modules/esnext.async-iterator.find.js');
|
|
12
|
+
require('core-js/modules/esnext.iterator.find.js');
|
|
11
13
|
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
12
14
|
require('core-js/modules/esnext.iterator.filter.js');
|
|
13
15
|
var React = require('react');
|
|
14
16
|
var core = require('@dnd-kit/core');
|
|
15
17
|
var sortable = require('@dnd-kit/sortable');
|
|
16
18
|
var DataTableContext = require('../../DataTableContext.js');
|
|
17
|
-
var
|
|
18
|
-
var DragOverlayContext = require('./DragOverlayContext.js');
|
|
19
|
+
var dsDragAndDrop = require('@elliemae/ds-drag-and-drop');
|
|
19
20
|
var SortableItemContext = require('./SortableItemContext.js');
|
|
21
|
+
var Row = require('../Row.js');
|
|
20
22
|
var jsxRuntime = require('react/jsx-runtime');
|
|
21
23
|
|
|
22
24
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -48,8 +50,6 @@ const withConditionalDnDRowContext = Component => props => {
|
|
|
48
50
|
flattenedData,
|
|
49
51
|
allDataFlattened
|
|
50
52
|
} = React__default["default"].useContext(DataTableContext["default"]);
|
|
51
|
-
const [PureDraggedJSX, setPureDraggedJSX] = React__default["default"].useState(null); // todo: check if this can be done via portal
|
|
52
|
-
|
|
53
53
|
const [lastActiveId, setLastActiveId] = React__default["default"].useState(null);
|
|
54
54
|
const onReorder = React.useCallback((newData, indexes, considerExpanding) => {
|
|
55
55
|
// Pull the row's original data into an object
|
|
@@ -78,7 +78,7 @@ const withConditionalDnDRowContext = Component => props => {
|
|
|
78
78
|
depth,
|
|
79
79
|
dropIndicatorPosition,
|
|
80
80
|
visibleItems
|
|
81
|
-
} = useTreeDndkitConfig({
|
|
81
|
+
} = dsDragAndDrop.useTreeDndkitConfig({
|
|
82
82
|
flattenedItems: allDataFlattened,
|
|
83
83
|
visibleItems: flattenedData,
|
|
84
84
|
isHorizontalDnD: false,
|
|
@@ -89,11 +89,7 @@ const withConditionalDnDRowContext = Component => props => {
|
|
|
89
89
|
if (lastActiveId !== activeId && activeId) setLastActiveId(activeId);
|
|
90
90
|
if (dragAndDropRows) return /*#__PURE__*/jsxRuntime.jsxs(core.DndContext, _objectSpread(_objectSpread({}, dndContextProps), {}, {
|
|
91
91
|
children: [/*#__PURE__*/jsxRuntime.jsx(sortable.SortableContext, _objectSpread(_objectSpread({}, sortableContextProps), {}, {
|
|
92
|
-
children: /*#__PURE__*/_jsx__default["default"](
|
|
93
|
-
value: {
|
|
94
|
-
setPureDraggedJSX
|
|
95
|
-
}
|
|
96
|
-
}, void 0, /*#__PURE__*/_jsx__default["default"](DnDTreeContext.Provider, {
|
|
92
|
+
children: /*#__PURE__*/_jsx__default["default"](DnDTreeContext.Provider, {
|
|
97
93
|
value: {
|
|
98
94
|
activeIndex,
|
|
99
95
|
depth,
|
|
@@ -102,12 +98,15 @@ const withConditionalDnDRowContext = Component => props => {
|
|
|
102
98
|
lastActiveId,
|
|
103
99
|
setLastActiveId
|
|
104
100
|
}
|
|
105
|
-
}, void 0, /*#__PURE__*/jsxRuntime.jsx(Component, _objectSpread({}, props)))
|
|
101
|
+
}, void 0, /*#__PURE__*/jsxRuntime.jsx(Component, _objectSpread({}, props)))
|
|
106
102
|
})), /*#__PURE__*/_jsx__default["default"](core.DragOverlay, {
|
|
107
103
|
style: {
|
|
108
104
|
width: 'auto'
|
|
109
105
|
}
|
|
110
|
-
}, void 0, activeId ?
|
|
106
|
+
}, void 0, activeId ? /*#__PURE__*/_jsx__default["default"](Row.Row, {
|
|
107
|
+
row: flattenedData.find(row => row.uid === activeId),
|
|
108
|
+
isDragOverlay: true
|
|
109
|
+
}) : null)]
|
|
111
110
|
}));
|
|
112
111
|
return /*#__PURE__*/jsxRuntime.jsx(Component, _objectSpread({}, props));
|
|
113
112
|
};
|
|
@@ -35,7 +35,7 @@ const withConditionalDnDSortableContext = function (items) {
|
|
|
35
35
|
// It's important that drag overlays DO NOT have any sortable functionality!
|
|
36
36
|
|
|
37
37
|
if (!isDragOverlay && dragAndDropColumns) return /*#__PURE__*/_jsx__default["default"](sortable.SortableContext, {
|
|
38
|
-
items: items.map(item => item.
|
|
38
|
+
items: items.map(item => item.id),
|
|
39
39
|
strategy: sortable.horizontalListSortingStrategy
|
|
40
40
|
}, void 0, /*#__PURE__*/jsxRuntime.jsx(Component, _objectSpread({}, props)));
|
|
41
41
|
return /*#__PURE__*/jsxRuntime.jsx(Component, _objectSpread({}, props));
|
|
@@ -12,7 +12,6 @@ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
|
12
12
|
var React = require('react');
|
|
13
13
|
var sortable = require('@dnd-kit/sortable');
|
|
14
14
|
var DataTableContext = require('../../DataTableContext.js');
|
|
15
|
-
var DragOverlayContext = require('./DragOverlayContext.js');
|
|
16
15
|
var withConditionalDnDColumnContext = require('./withConditionalDnDColumnContext.js');
|
|
17
16
|
var SortableItemContext = require('./SortableItemContext.js');
|
|
18
17
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -31,18 +30,14 @@ const withDnDSortableColumnContext = Component => props => {
|
|
|
31
30
|
dragAndDropColumns
|
|
32
31
|
}
|
|
33
32
|
} = React.useContext(DataTableContext["default"]);
|
|
34
|
-
const {
|
|
35
|
-
setPureDraggedJSX
|
|
36
|
-
} = React.useContext(DragOverlayContext.DragOverlayContext);
|
|
37
33
|
const {
|
|
38
34
|
activeIndex
|
|
39
35
|
} = React.useContext(withConditionalDnDColumnContext.DnDGroupContext); // onMount generate unique options, so everyting is only ran once
|
|
40
36
|
|
|
41
37
|
const draggableOptions = React.useMemo(() => ({
|
|
42
|
-
id: props.header.
|
|
43
|
-
}), [props.header.
|
|
44
|
-
const useSortableHelpers = sortable.useSortable(draggableOptions);
|
|
45
|
-
const PureComponentJSX = React.useMemo(() => /*#__PURE__*/jsxRuntime.jsx(Component, _objectSpread({}, props)), [props]); // calculate all the "useSortable" values as per required
|
|
38
|
+
id: props.header.id
|
|
39
|
+
}), [props.header.id]);
|
|
40
|
+
const useSortableHelpers = sortable.useSortable(draggableOptions); // calculate all the "useSortable" values as per required
|
|
46
41
|
|
|
47
42
|
const draggableProps = React.useMemo(() => {
|
|
48
43
|
if (!dragAndDropColumns) return false;
|
|
@@ -54,16 +49,7 @@ const withDnDSortableColumnContext = Component => props => {
|
|
|
54
49
|
shouldShowDropIndicatorPosition: overIndex === index && overIndex !== -1,
|
|
55
50
|
dropIndicatorPosition: index > activeIndex ? SortableItemContext.DropIndicatorPosition.After : SortableItemContext.DropIndicatorPosition.Before
|
|
56
51
|
});
|
|
57
|
-
}, [useSortableHelpers, dragAndDropColumns, activeIndex]);
|
|
58
|
-
React.useEffect(() => {
|
|
59
|
-
// We assume the structure of the inner element WON'T change during DnD
|
|
60
|
-
// This is a huge performance boost
|
|
61
|
-
if (useSortableHelpers.isDragging) {
|
|
62
|
-
setPureDraggedJSX( /*#__PURE__*/React.cloneElement(PureComponentJSX, {
|
|
63
|
-
isDragOverlay: true
|
|
64
|
-
}));
|
|
65
|
-
}
|
|
66
|
-
}, [useSortableHelpers.isDragging, setPureDraggedJSX]); // we use a context so we can easly access information wherever without bubbling down
|
|
52
|
+
}, [useSortableHelpers, dragAndDropColumns, activeIndex]); // we use a context so we can easly access information wherever without bubbling down
|
|
67
53
|
// this context is all Memoized so as long as component is not re-mounted,
|
|
68
54
|
// the context won't trigger un-required renders per-se...
|
|
69
55
|
|
|
@@ -73,7 +59,7 @@ const withDnDSortableColumnContext = Component => props => {
|
|
|
73
59
|
|
|
74
60
|
return /*#__PURE__*/_jsx__default["default"](SortableItemContext.SortableItemContext.Provider, {
|
|
75
61
|
value: ctx
|
|
76
|
-
}, void 0,
|
|
62
|
+
}, void 0, /*#__PURE__*/jsxRuntime.jsx(Component, _objectSpread({}, props)));
|
|
77
63
|
};
|
|
78
64
|
|
|
79
65
|
exports.withDnDSortableColumnContext = withDnDSortableColumnContext;
|
|
@@ -13,7 +13,6 @@ var React = require('react');
|
|
|
13
13
|
var sortable = require('@dnd-kit/sortable');
|
|
14
14
|
var DataTableContext = require('../../DataTableContext.js');
|
|
15
15
|
var withConditionalDnDRowContext = require('./withConditionalDnDRowContext.js');
|
|
16
|
-
var DragOverlayContext = require('./DragOverlayContext.js');
|
|
17
16
|
var SortableItemContext = require('./SortableItemContext.js');
|
|
18
17
|
var jsxRuntime = require('react/jsx-runtime');
|
|
19
18
|
|
|
@@ -31,9 +30,6 @@ const withDnDSortableRowContext = Component => props => {
|
|
|
31
30
|
dragAndDropRows
|
|
32
31
|
}
|
|
33
32
|
} = React.useContext(DataTableContext["default"]);
|
|
34
|
-
const {
|
|
35
|
-
setPureDraggedJSX
|
|
36
|
-
} = React.useContext(DragOverlayContext.DragOverlayContext);
|
|
37
33
|
const {
|
|
38
34
|
dropIndicatorPosition,
|
|
39
35
|
lastActiveId,
|
|
@@ -43,8 +39,7 @@ const withDnDSortableRowContext = Component => props => {
|
|
|
43
39
|
const draggableOptions = React.useMemo(() => ({
|
|
44
40
|
id: props.row.uid
|
|
45
41
|
}), [props.row]);
|
|
46
|
-
const useSortableHelpers = sortable.useSortable(draggableOptions);
|
|
47
|
-
const PureComponentJSX = React.useMemo(() => /*#__PURE__*/jsxRuntime.jsx(Component, _objectSpread({}, props)), [props]); // calculate all the "useSortable" values as per required
|
|
42
|
+
const useSortableHelpers = sortable.useSortable(draggableOptions); // calculate all the "useSortable" values as per required
|
|
48
43
|
|
|
49
44
|
const draggableProps = React.useMemo(() => {
|
|
50
45
|
if (!dragAndDropRows) return false;
|
|
@@ -58,16 +53,7 @@ const withDnDSortableRowContext = Component => props => {
|
|
|
58
53
|
lastActiveId,
|
|
59
54
|
setLastActiveId
|
|
60
55
|
});
|
|
61
|
-
}, [dragAndDropRows, useSortableHelpers, dropIndicatorPosition, lastActiveId, setLastActiveId]);
|
|
62
|
-
React.useEffect(() => {
|
|
63
|
-
// We assume the structure of the inner element WON'T change during DnD
|
|
64
|
-
// This is a huge performance boost
|
|
65
|
-
if (useSortableHelpers.isDragging) {
|
|
66
|
-
setPureDraggedJSX( /*#__PURE__*/React.cloneElement(PureComponentJSX, {
|
|
67
|
-
isDragOverlay: true
|
|
68
|
-
}));
|
|
69
|
-
}
|
|
70
|
-
}, [useSortableHelpers.isDragging, setPureDraggedJSX]); // we use a context so we can easly access information wherever without bubbling down
|
|
56
|
+
}, [dragAndDropRows, useSortableHelpers, dropIndicatorPosition, lastActiveId, setLastActiveId]); // we use a context so we can easly access information wherever without bubbling down
|
|
71
57
|
// this context is all Memoized so as long as component is not re-mounted,
|
|
72
58
|
// the context won't trigger un-required renders per-se...
|
|
73
59
|
|
|
@@ -77,7 +63,7 @@ const withDnDSortableRowContext = Component => props => {
|
|
|
77
63
|
|
|
78
64
|
return /*#__PURE__*/_jsx__default["default"](SortableItemContext.SortableItemContext.Provider, {
|
|
79
65
|
value: ctx
|
|
80
|
-
}, void 0,
|
|
66
|
+
}, void 0, /*#__PURE__*/jsxRuntime.jsx(Component, _objectSpread({}, props)));
|
|
81
67
|
};
|
|
82
68
|
|
|
83
69
|
exports.withDnDSortableRowContext = withDnDSortableRowContext;
|
package/cjs/parts/Row.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
3
5
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
4
6
|
require('core-js/modules/web.dom-collections.iterator.js');
|
|
5
7
|
var React = require('react');
|
|
@@ -22,17 +24,17 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
22
24
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
23
25
|
|
|
24
26
|
const setItemRefs = (measureRef, draggableRef, ref) => {
|
|
25
|
-
const refsToSet = [
|
|
27
|
+
const refsToSet = [];
|
|
28
|
+
if (measureRef) refsToSet.push(measureRef);
|
|
26
29
|
if (draggableRef) refsToSet.push(draggableRef);
|
|
27
30
|
refsHelpers.setMultipleRefs(...refsToSet)(ref);
|
|
28
31
|
};
|
|
29
32
|
|
|
30
|
-
const
|
|
33
|
+
const RowComp = props => {
|
|
31
34
|
const {
|
|
32
35
|
row,
|
|
33
36
|
measureRef,
|
|
34
37
|
itemWrapperStyle,
|
|
35
|
-
itemIndex,
|
|
36
38
|
isDragOverlay,
|
|
37
39
|
focusedRowId,
|
|
38
40
|
selectedRowId
|
|
@@ -47,7 +49,7 @@ const Row = props => {
|
|
|
47
49
|
ref: ref => setItemRefs(measureRef, draggableRef, ref),
|
|
48
50
|
children: /*#__PURE__*/_jsx__default["default"](index.RowVariantMapItem, {
|
|
49
51
|
row: row,
|
|
50
|
-
itemIndex:
|
|
52
|
+
itemIndex: row.realIndex,
|
|
51
53
|
isDragOverlay: isDragOverlay,
|
|
52
54
|
ctx: ctx,
|
|
53
55
|
focusedRowId: focusedRowId,
|
|
@@ -56,15 +58,13 @@ const Row = props => {
|
|
|
56
58
|
});
|
|
57
59
|
};
|
|
58
60
|
|
|
59
|
-
Row.defaultProps = {
|
|
60
|
-
itemWrapperStyle: {}
|
|
61
|
-
};
|
|
62
|
-
|
|
63
61
|
const mapStateToProps = state => ({
|
|
64
62
|
focusedRowId: state.rows.focusedRowId,
|
|
65
63
|
selectedRowId: state.rows.selectedRowId
|
|
66
64
|
});
|
|
67
65
|
|
|
68
|
-
|
|
66
|
+
const Row = reactRedux.connect(mapStateToProps)(RowComp);
|
|
67
|
+
var Row$1 = withDnDSortableRowContext.withDnDSortableRowContext(Row);
|
|
69
68
|
|
|
70
|
-
|
|
69
|
+
exports.Row = Row;
|
|
70
|
+
exports["default"] = Row$1;
|
package/cjs/parts/Rows.js
CHANGED
|
@@ -64,7 +64,7 @@ const Rows = () => {
|
|
|
64
64
|
itemIndex: index,
|
|
65
65
|
itemWrapperStyle: style
|
|
66
66
|
};
|
|
67
|
-
return /*#__PURE__*/jsxRuntime.jsx(Row, _objectSpread({}, rowProps));
|
|
67
|
+
return /*#__PURE__*/jsxRuntime.jsx(Row["default"], _objectSpread({}, rowProps));
|
|
68
68
|
})
|
|
69
69
|
}), [virtualItems, items, visibleColumns, totalColumnsWidth]);
|
|
70
70
|
return PureVirtualizedRows;
|
package/cjs/parts/index.js
CHANGED
|
@@ -14,6 +14,6 @@ var DnDHandle = require('./DnDHandle.js');
|
|
|
14
14
|
exports.TableContent = TableContent;
|
|
15
15
|
exports.Loader = Loader;
|
|
16
16
|
exports.EmptyContent = EmptyContent;
|
|
17
|
-
exports.Row = Row;
|
|
17
|
+
exports.Row = Row["default"];
|
|
18
18
|
exports.Footer = Footer;
|
|
19
19
|
exports.DnDHandle = DnDHandle;
|
package/cjs/styled.js
CHANGED
|
@@ -181,7 +181,7 @@ const GroupHeaderTitle = /*#__PURE__*/styled__default["default"].span.withConfig
|
|
|
181
181
|
})(["font-weight:", ";font-size:12px;color:", ";"], props => props.theme.fontWeights.semibold, props => props.theme.colors.neutral[700]);
|
|
182
182
|
const StyledCellContainer = /*#__PURE__*/styled__default["default"](Grid__default["default"]).withConfig({
|
|
183
183
|
componentId: "sc-38sgfo-18"
|
|
184
|
-
})(["position:relative;z-index:2;min-height:", ";height:", ";width:", ";", ";background-color:", ";outline:none;:focus{", "}", " ", " box-shadow:0 2px 4px 0 ", ";opacity:", ";", " color:", ";"], props => props.minHeight || '36px', props => props.height || 'auto', props => props.colLayoutStyle === constants.ColsLayoutStyle.Fixed ? sizeToCss.sizeToCss(props.totalColumnsWidth) : '100%', props => getGridTemplateColumnsStyle({
|
|
184
|
+
})(["position:relative;z-index:2;min-height:", ";height:", ";width:", ";", ";", ";background-color:", ";outline:none;:focus{", "}", " ", " box-shadow:0 2px 4px 0 ", ";opacity:", ";", " color:", ";"], props => props.minHeight || '36px', props => props.height || 'auto', props => props.colLayoutStyle === constants.ColsLayoutStyle.Fixed ? sizeToCss.sizeToCss(props.totalColumnsWidth) : '100%', props => props.isDragOverlay ? 'width: fit-content;' : '', props => getGridTemplateColumnsStyle({
|
|
185
185
|
cols: props.cols,
|
|
186
186
|
colsLayoutStyle: props.colLayoutStyle,
|
|
187
187
|
isExpandable: props.isExpandable
|
|
@@ -207,7 +207,7 @@ const StyledCellContainer = /*#__PURE__*/styled__default["default"](Grid__defaul
|
|
|
207
207
|
theme
|
|
208
208
|
} = _ref12;
|
|
209
209
|
return shouldDisplayHover ? ":hover {\n background-color: ".concat(theme.colors.brand[200], ";\n }") : '';
|
|
210
|
-
}, props => props.isDragOverlay ? 'rgba(0,0,0,0.5)' : 'transparent', props => props.isDragging ? 0.8 : 1, props => !props.selected ? '' : "\n background-color: ".concat(props.theme.colors.brand[200], ";\n border: 1px solid ").concat(props.theme.colors.brand[
|
|
210
|
+
}, props => props.isDragOverlay ? 'rgba(0,0,0,0.5)' : 'transparent', props => props.isDragging ? 0.8 : 1, props => !props.selected ? '' : "\n background-color: ".concat(props.theme.colors.brand[200], ";\n border: 1px solid ").concat(props.theme.colors.brand[500], ";\n "), props => props.disabled ? props.theme.colors.neutral['500'] : '#333333');
|
|
211
211
|
|
|
212
212
|
exports.GroupHeaderContainer = GroupHeaderContainer;
|
|
213
213
|
exports.GroupHeaderTitle = GroupHeaderTitle;
|
package/esm/DataTableSchema.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PropTypes } from 'react-desc';
|
|
2
2
|
|
|
3
3
|
/* eslint-disable max-lines */
|
|
4
|
-
const outOfTheBoxFilterType = PropTypes.oneOf(['ds-filter-select', 'ds-filter-multi-select', 'ds-filter-
|
|
4
|
+
const outOfTheBoxFilterType = PropTypes.oneOf(['ds-filter-select', 'ds-filter-multi-select', 'ds-filter-single-date', 'ds-filter-date-range', 'ds-filter-number-range']);
|
|
5
5
|
const textWrappingType = PropTypes.oneOf(['wrap', 'wrap-all', 'truncate']);
|
|
6
6
|
const rowVariantType = PropTypes.oneOf(['ds_header_group_row', 'ds_primary_row', 'ds_secondary_row']);
|
|
7
7
|
const columnPropTypes = {
|
|
@@ -64,20 +64,29 @@ const DataTableSchema = {
|
|
|
64
64
|
})).description('Any extra option you want in the dropdownmenu of the filter bar')
|
|
65
65
|
}).description('Props for the filter bar'),
|
|
66
66
|
onFiltersChange: PropTypes.func.description('Function invoked when filters change'),
|
|
67
|
-
pagination: PropTypes.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
onPageChange: PropTypes.func.description('Function invoked when the page is changed'),
|
|
74
|
-
onPreviousPage: PropTypes.func.description('Function invoked when the previous button is pressed'),
|
|
75
|
-
onNextPage: PropTypes.func.description('Function invoked when next button is pressed'),
|
|
76
|
-
pageCount: PropTypes.number.description('How many pages are there. By default it will be calculated based on the ammount of rows you have'),
|
|
67
|
+
pagination: PropTypes.shape({
|
|
68
|
+
pageCount: PropTypes.number.description('How many pages are there'),
|
|
69
|
+
pageIndex: PropTypes.number.description('Index of the current page, starting from 1').defaultValue(1),
|
|
70
|
+
canPreviousPage: PropTypes.bool.description('Whether the previous button is disabled or not').defaultValue(true),
|
|
71
|
+
canNextPage: PropTypes.bool.description('Whether the next button is disabled or not').defaultValue(true),
|
|
72
|
+
pageSize: PropTypes.number.description('The current page size').defaultValue(10),
|
|
77
73
|
showPerPageSelector: PropTypes.bool.description('Whether to show the page selector').defaultValue(true),
|
|
74
|
+
perPageOptions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
75
|
+
dsId: PropTypes.string,
|
|
76
|
+
value: PropTypes.number,
|
|
77
|
+
label: PropTypes.string,
|
|
78
|
+
type: PropTypes.oneOf(['single'])
|
|
79
|
+
})])).description('The available options for page size').defaultValue([10]),
|
|
80
|
+
perPageStep: PropTypes.number.description('Step for the per page options').defaultValue(5),
|
|
81
|
+
minPerPage: PropTypes.number.description('Step for the per page options').defaultValue(0),
|
|
82
|
+
maxPerPage: PropTypes.number.description('Step for the per page options').defaultValue(100),
|
|
83
|
+
onPageSizeChange: PropTypes.func.description('Function invoked when the page size changes').defaultValue(() => null),
|
|
84
|
+
onPreviousPage: PropTypes.func.description('Function invoked when the previous button is pressed').defaultValue(() => null),
|
|
85
|
+
onPageChange: PropTypes.func.description('Function invoked when the page changes').defaultValue(() => null),
|
|
86
|
+
onNextPage: PropTypes.func.description('Function invoked when next button is pressed').defaultValue(() => null),
|
|
78
87
|
pageDetails: PropTypes.arrayOf(PropTypes.string).description('Details to provide for each page').defaultValue([]),
|
|
79
88
|
pageDetailsTitle: PropTypes.string.description('The title of the details (usually a column of your dataset)').defaultValue('')
|
|
80
|
-
})
|
|
89
|
+
}).description('Object containing the data for the pagination'),
|
|
81
90
|
colsLayoutStyle: PropTypes.oneOf(['auto', 'fixed']).description('Whether the datatable fills its container or not'),
|
|
82
91
|
hiddenColumns: PropTypes.arrayOf(PropTypes.string).description('IDs of columns not to render'),
|
|
83
92
|
dragAndDropRows: PropTypes.bool.description('Whether to turn on the d&d feature for the rows').defaultValue(false),
|
|
@@ -37,6 +37,8 @@ import '../../../../exported-related/Filters/applyOutOfTheBoxFilters.js';
|
|
|
37
37
|
import 'moment';
|
|
38
38
|
import 'core-js/modules/esnext.async-iterator.some.js';
|
|
39
39
|
import 'core-js/modules/esnext.iterator.some.js';
|
|
40
|
+
import '../../../../redux/reducers/headersReducers/headersReducers.js';
|
|
41
|
+
import { useDispatchHeadersActions } from '../../../../redux/reducers/headersReducers/useDispatchHeadersActions.js';
|
|
40
42
|
|
|
41
43
|
var _SearchXsmall;
|
|
42
44
|
|
|
@@ -82,6 +84,20 @@ const CurrencyRangeFilter = props => {
|
|
|
82
84
|
onValueChange(FILTER_TYPES.CURRENCY_RANGE, nextValue);
|
|
83
85
|
};
|
|
84
86
|
|
|
87
|
+
const {
|
|
88
|
+
patchHeader
|
|
89
|
+
} = useDispatchHeadersActions(); // workaround to close menu with esc key since DSInputMask has stoppropagation on key down
|
|
90
|
+
|
|
91
|
+
const closePopover = e => {
|
|
92
|
+
if (e.code === 'Escape') {
|
|
93
|
+
patchHeader(column.id, {
|
|
94
|
+
hideFilterMenu: true,
|
|
95
|
+
hideFilterButton: false
|
|
96
|
+
});
|
|
97
|
+
innerRef.current.focus();
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
85
101
|
const idPreffix = 'datatable-currency-range';
|
|
86
102
|
return /*#__PURE__*/_jsx(FilterPopover, {
|
|
87
103
|
reduxHeader: reduxHeader,
|
|
@@ -106,7 +122,10 @@ const CurrencyRangeFilter = props => {
|
|
|
106
122
|
onChange: handleFromChange,
|
|
107
123
|
placeholder: "0.00",
|
|
108
124
|
mask: number => MASK_TYPES.NUMBER(opts)(number),
|
|
109
|
-
autoFocus: true
|
|
125
|
+
autoFocus: true,
|
|
126
|
+
onKeyDown: e => {
|
|
127
|
+
closePopover(e);
|
|
128
|
+
}
|
|
110
129
|
})), /*#__PURE__*/_jsx(DSFormLayoutBlockItem, {
|
|
111
130
|
label: "Max",
|
|
112
131
|
inputID: "".concat(idPreffix, "-max-").concat(column.id)
|
|
@@ -120,7 +139,10 @@ const CurrencyRangeFilter = props => {
|
|
|
120
139
|
value: "".concat((_filterValue$to = filterValue === null || filterValue === void 0 ? void 0 : filterValue.to) !== null && _filterValue$to !== void 0 ? _filterValue$to : ''),
|
|
121
140
|
onChange: handleToChange,
|
|
122
141
|
placeholder: "0.00",
|
|
123
|
-
mask: number => MASK_TYPES.NUMBER(opts)(number)
|
|
142
|
+
mask: number => MASK_TYPES.NUMBER(opts)(number),
|
|
143
|
+
onKeyDown: e => {
|
|
144
|
+
closePopover(e);
|
|
145
|
+
}
|
|
124
146
|
}))),
|
|
125
147
|
triggerIcon: _SearchXsmall || (_SearchXsmall = /*#__PURE__*/_jsx(SearchXsmall, {})),
|
|
126
148
|
customStyles: {
|
|
@@ -37,6 +37,8 @@ import '../../../../exported-related/Filters/applyOutOfTheBoxFilters.js';
|
|
|
37
37
|
import 'moment';
|
|
38
38
|
import 'core-js/modules/esnext.async-iterator.some.js';
|
|
39
39
|
import 'core-js/modules/esnext.iterator.some.js';
|
|
40
|
+
import '../../../../redux/reducers/headersReducers/headersReducers.js';
|
|
41
|
+
import { useDispatchHeadersActions } from '../../../../redux/reducers/headersReducers/useDispatchHeadersActions.js';
|
|
40
42
|
|
|
41
43
|
var _SearchXsmall;
|
|
42
44
|
|
|
@@ -85,13 +87,27 @@ const NumberRangeFilter = props => {
|
|
|
85
87
|
onValueChange(FILTER_TYPES.CURRENCY_RANGE, nextValue);
|
|
86
88
|
};
|
|
87
89
|
|
|
90
|
+
const {
|
|
91
|
+
patchHeader
|
|
92
|
+
} = useDispatchHeadersActions(); // workaround to close menu with esc key since DSInputMask has stoppropagation on key down
|
|
93
|
+
|
|
94
|
+
const closePopover = e => {
|
|
95
|
+
if (e.code === 'Escape') {
|
|
96
|
+
patchHeader(column.id, {
|
|
97
|
+
hideFilterMenu: true,
|
|
98
|
+
hideFilterButton: false
|
|
99
|
+
});
|
|
100
|
+
innerRef.current.focus();
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
|
|
88
104
|
const idPreffix = 'datatable-number-range';
|
|
89
105
|
return /*#__PURE__*/_jsx(FilterPopover, {
|
|
90
106
|
reduxHeader: reduxHeader,
|
|
91
107
|
column: column,
|
|
92
108
|
columnId: column.id,
|
|
93
109
|
menuContent: /*#__PURE__*/_jsx(Grid, {
|
|
94
|
-
"data-testid": DATA_TESTID.
|
|
110
|
+
"data-testid": DATA_TESTID.DATA_TABLE_NUMBER_RANGE_CONTROLLER,
|
|
95
111
|
gutter: "xxxs",
|
|
96
112
|
padding: "xxs",
|
|
97
113
|
cols: ['auto', 'auto']
|
|
@@ -109,7 +125,10 @@ const NumberRangeFilter = props => {
|
|
|
109
125
|
onChange: handleFromChange,
|
|
110
126
|
placeholder: "0",
|
|
111
127
|
mask: number => MASK_TYPES.NUMBER(opts)(number),
|
|
112
|
-
autoFocus: true
|
|
128
|
+
autoFocus: true,
|
|
129
|
+
onKeyDown: e => {
|
|
130
|
+
closePopover(e);
|
|
131
|
+
}
|
|
113
132
|
})), /*#__PURE__*/_jsx(DSFormLayoutBlockItem, {
|
|
114
133
|
label: "High",
|
|
115
134
|
inputID: "".concat(idPreffix, "-high-").concat(column.id)
|
|
@@ -123,7 +142,10 @@ const NumberRangeFilter = props => {
|
|
|
123
142
|
value: "".concat((_filterValue$to = filterValue === null || filterValue === void 0 ? void 0 : filterValue.to) !== null && _filterValue$to !== void 0 ? _filterValue$to : ''),
|
|
124
143
|
onChange: handleToChange,
|
|
125
144
|
placeholder: "0",
|
|
126
|
-
mask: number => MASK_TYPES.NUMBER(opts)(number)
|
|
145
|
+
mask: number => MASK_TYPES.NUMBER(opts)(number),
|
|
146
|
+
onKeyDown: e => {
|
|
147
|
+
closePopover(e);
|
|
148
|
+
}
|
|
127
149
|
}))),
|
|
128
150
|
triggerIcon: _SearchXsmall || (_SearchXsmall = /*#__PURE__*/_jsx(SearchXsmall, {})),
|
|
129
151
|
customStyles: {
|
|
@@ -5,4 +5,3 @@ export { CurrencyRangeFilter } from './CurrencyRangeFilter/index.js';
|
|
|
5
5
|
export { SingleSelectFilter } from './SelectFilter/SingleSelectFilter.js';
|
|
6
6
|
export { MultiSelectFilter } from './SelectFilter/MultiSelectFilter.js';
|
|
7
7
|
export { SingleDateFilter } from './SingleDateFilter/index.js';
|
|
8
|
-
export { TextInputFilter } from './TextInputFilter/index.js';
|
|
@@ -5,4 +5,3 @@ export { CurrencyRangeFilter } from './Components/CurrencyRangeFilter/index.js';
|
|
|
5
5
|
export { SingleSelectFilter } from './Components/SelectFilter/SingleSelectFilter.js';
|
|
6
6
|
export { MultiSelectFilter } from './Components/SelectFilter/MultiSelectFilter.js';
|
|
7
7
|
export { SingleDateFilter } from './Components/SingleDateFilter/index.js';
|
|
8
|
-
export { TextInputFilter } from './Components/TextInputFilter/index.js';
|
|
@@ -20,7 +20,7 @@ const usePaginationConfig = (props, flattenedData) => {
|
|
|
20
20
|
onPreviousPage = emptyFunc,
|
|
21
21
|
onNextPage = emptyFunc,
|
|
22
22
|
onPageChange = emptyFunc,
|
|
23
|
-
pageCount = Math.
|
|
23
|
+
pageCount = Math.ceil(flattenedData.length / pageSize),
|
|
24
24
|
perPageStep = 5,
|
|
25
25
|
minPerPage = 0,
|
|
26
26
|
maxPerPage = 100,
|
|
@@ -21,7 +21,7 @@ const flatten = function (data, expandedRows, uniqueRowAccessor) {
|
|
|
21
21
|
const id = (parentId ? "".concat(parentId, ".") : '') + index.toString();
|
|
22
22
|
const uid = getIdFromUniqueRowAccessor(uniqueRowAccessor, {
|
|
23
23
|
id,
|
|
24
|
-
original: row
|
|
24
|
+
original: row !== null && row !== void 0 ? row : {}
|
|
25
25
|
});
|
|
26
26
|
const isExpanded = expandedRows[uid];
|
|
27
27
|
const rowToPush = {
|
|
@@ -33,11 +33,11 @@ const flatten = function (data, expandedRows, uniqueRowAccessor) {
|
|
|
33
33
|
parentIndex,
|
|
34
34
|
depth,
|
|
35
35
|
isExpanded,
|
|
36
|
-
original: row
|
|
36
|
+
original: row !== null && row !== void 0 ? row : {}
|
|
37
37
|
};
|
|
38
38
|
result.push(rowToPush); // If we have subrows and we are expanded
|
|
39
39
|
|
|
40
|
-
if (row.subRows && expandedRows[uid] && depth <= maxDepth) {
|
|
40
|
+
if (row !== null && row !== void 0 && row.subRows && expandedRows[uid] && depth <= maxDepth) {
|
|
41
41
|
row.subRows.forEach((subRow, i) => doit(subRow, i, uid, rowToPush.realIndex, depth + 1));
|
|
42
42
|
}
|
|
43
43
|
};
|
|
@@ -54,14 +54,14 @@ const EditableCell = props => {
|
|
|
54
54
|
onBlur: handleOnBlur,
|
|
55
55
|
shouldDisplayEditIcon: cell.column.alwaysDisplayEditIcon,
|
|
56
56
|
role: "cell",
|
|
57
|
-
"aria-
|
|
57
|
+
"aria-labelledby": isEditing ? undefined : cell.id,
|
|
58
58
|
children: [!isEditing ? StandardRender : EditableRenderer, !isEditing && (_StyledPencilIcon || (_StyledPencilIcon = /*#__PURE__*/_jsx(StyledPencilIcon, {}))), /*#__PURE__*/_jsx("span", {
|
|
59
59
|
id: cell.id,
|
|
60
60
|
style: {
|
|
61
61
|
display: 'none'
|
|
62
62
|
},
|
|
63
63
|
"aria-hidden": "true"
|
|
64
|
-
}, void 0, "
|
|
64
|
+
}, void 0, cell.value, ", editable cell. To edit the content's of this cell, press the Enter key")]
|
|
65
65
|
});
|
|
66
66
|
};
|
|
67
67
|
|
|
@@ -41,6 +41,9 @@ const FilterButton = /*#__PURE__*/styled.span.withConfig({
|
|
|
41
41
|
const Button = /*#__PURE__*/styled(DSButton).withConfig({
|
|
42
42
|
componentId: "sc-16i88ut-1"
|
|
43
43
|
})(["position:relative;justify-self:flex-end;"]);
|
|
44
|
+
const PopperContent = /*#__PURE__*/styled.div.withConfig({
|
|
45
|
+
componentId: "sc-16i88ut-2"
|
|
46
|
+
})(["background-color:'#fff';"]);
|
|
44
47
|
const FilterPopover = _ref2 => {
|
|
45
48
|
var _column$ref$current$o, _column$ref, _column$ref$current;
|
|
46
49
|
|
|
@@ -141,9 +144,20 @@ const FilterPopover = _ref2 => {
|
|
|
141
144
|
minWidth: (_column$ref$current$o = (_column$ref = column.ref) === null || _column$ref === void 0 ? void 0 : (_column$ref$current = _column$ref.current) === null || _column$ref$current === void 0 ? void 0 : _column$ref$current.offsetWidth) !== null && _column$ref$current$o !== void 0 ? _column$ref$current$o : '0px'
|
|
142
145
|
}),
|
|
143
146
|
placementOrderPreference: ['bottom-end']
|
|
144
|
-
}, void 0, /*#__PURE__*/jsx(
|
|
145
|
-
|
|
146
|
-
|
|
147
|
+
}, void 0, /*#__PURE__*/jsx(PopperContent, {
|
|
148
|
+
onKeyDown: e => {
|
|
149
|
+
if (e.code === 'Tab') {
|
|
150
|
+
setTimeout(() => {
|
|
151
|
+
var _popperRef$current;
|
|
152
|
+
|
|
153
|
+
if (!(popperRef !== null && popperRef !== void 0 && (_popperRef$current = popperRef.current) !== null && _popperRef$current !== void 0 && _popperRef$current.contains(document.activeElement))) {
|
|
154
|
+
patchHeader(columnId, {
|
|
155
|
+
hideFilterMenu: true,
|
|
156
|
+
hideFilterButton: false
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
}
|
|
147
161
|
},
|
|
148
162
|
ref: popperRef,
|
|
149
163
|
children: menuContent
|
|
@@ -3,7 +3,6 @@ import 'core-js/modules/esnext.iterator.constructor.js';
|
|
|
3
3
|
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
4
4
|
import { singleSelectFilterFn } from './singleSelectFilterFn.js';
|
|
5
5
|
import { multiSelectFilterFn } from './multiSelectFilterFn.js';
|
|
6
|
-
import { textFilterFn } from './textFilterFn.js';
|
|
7
6
|
import { singleDateFilterFn } from './singleDateFilterFn.js';
|
|
8
7
|
import { dateRangeFilterFn } from './dateRangeFilterFn.js';
|
|
9
8
|
import { dateSwitcherFilterFn } from './dateSwitcherFilterFn.js';
|
|
@@ -15,7 +14,6 @@ import { FILTER_TYPES } from '../FilterTypes.js';
|
|
|
15
14
|
const filterMapper = {
|
|
16
15
|
[FILTER_TYPES.SELECT]: singleSelectFilterFn,
|
|
17
16
|
[FILTER_TYPES.MULTI_SELECT]: multiSelectFilterFn,
|
|
18
|
-
[FILTER_TYPES.TEXT]: textFilterFn,
|
|
19
17
|
[FILTER_TYPES.SINGLE_DATE]: singleDateFilterFn,
|
|
20
18
|
[FILTER_TYPES.DATE_RANGE]: dateRangeFilterFn,
|
|
21
19
|
[FILTER_TYPES.DATE_SWITCHER]: dateSwitcherFilterFn,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { applyOutOfTheBoxFilters } from './applyOutOfTheBoxFilters.js';
|
|
2
|
-
export { textFilterFn } from './textFilterFn.js';
|
|
3
2
|
export { singleDateFilterFn } from './singleDateFilterFn.js';
|
|
4
3
|
export { singleSelectFilterFn } from './singleSelectFilterFn.js';
|
|
5
4
|
export { multiSelectFilterFn } from './multiSelectFilterFn.js';
|
|
@@ -5,7 +5,6 @@ export { groupBy } from './groupBy.js';
|
|
|
5
5
|
export { FILTER_TYPES } from './FilterTypes.js';
|
|
6
6
|
export { ROW_VARIANTS, ROW_VARIANT_COMPACT_KEY, ROW_VARIANT_KEY } from './RowVariants.js';
|
|
7
7
|
export { applyOutOfTheBoxFilters } from './Filters/applyOutOfTheBoxFilters.js';
|
|
8
|
-
export { textFilterFn } from './Filters/textFilterFn.js';
|
|
9
8
|
export { singleDateFilterFn } from './Filters/singleDateFilterFn.js';
|
|
10
9
|
export { singleSelectFilterFn } from './Filters/singleSelectFilterFn.js';
|
|
11
10
|
export { multiSelectFilterFn } from './Filters/multiSelectFilterFn.js';
|
|
@@ -11,8 +11,8 @@ const setMultipleRefs = function () {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
const filteredRefs = refs.filter(Boolean);
|
|
14
|
-
if (!filteredRefs.length) return null;
|
|
15
|
-
if (filteredRefs.length === 0) return
|
|
14
|
+
if (!filteredRefs.length) return () => null;
|
|
15
|
+
if (filteredRefs.length === 0) return () => null;
|
|
16
16
|
return newRef => {
|
|
17
17
|
filteredRefs.forEach(refToBeUpdated => {
|
|
18
18
|
if (typeof refToBeUpdated === 'function') {
|
package/esm/index.js
CHANGED
|
@@ -6,7 +6,6 @@ export { groupBy } from './exported-related/groupBy.js';
|
|
|
6
6
|
export { FILTER_TYPES } from './exported-related/FilterTypes.js';
|
|
7
7
|
export { ROW_VARIANTS, ROW_VARIANT_COMPACT_KEY, ROW_VARIANT_KEY } from './exported-related/RowVariants.js';
|
|
8
8
|
export { applyOutOfTheBoxFilters } from './exported-related/Filters/applyOutOfTheBoxFilters.js';
|
|
9
|
-
export { textFilterFn } from './exported-related/Filters/textFilterFn.js';
|
|
10
9
|
export { singleDateFilterFn } from './exported-related/Filters/singleDateFilterFn.js';
|
|
11
10
|
export { singleSelectFilterFn } from './exported-related/Filters/singleSelectFilterFn.js';
|
|
12
11
|
export { multiSelectFilterFn } from './exported-related/Filters/multiSelectFilterFn.js';
|
|
@@ -45,14 +45,12 @@ import { MultiSelectPill } from './components/MultiSelectPill.js';
|
|
|
45
45
|
import { NumberRangePill } from './components/NumberRangePill.js';
|
|
46
46
|
import { SelectPill } from './components/SelectPill.js';
|
|
47
47
|
import { SingleDatePill } from './components/SingleDatePill.js';
|
|
48
|
-
import { TextPill } from './components/TextPill.js';
|
|
49
48
|
import { StyledWrapper, StyledDropdownMenu } from './styled.js';
|
|
50
49
|
|
|
51
50
|
var _MoreOptionsVert;
|
|
52
51
|
const pillRenderMapper = {
|
|
53
52
|
[FILTER_TYPES.SELECT]: SelectPill,
|
|
54
53
|
[FILTER_TYPES.MULTI_SELECT]: MultiSelectPill,
|
|
55
|
-
[FILTER_TYPES.TEXT]: TextPill,
|
|
56
54
|
[FILTER_TYPES.SINGLE_DATE]: SingleDatePill,
|
|
57
55
|
[FILTER_TYPES.DATE_RANGE]: DateRangePill,
|
|
58
56
|
[FILTER_TYPES.DATE_SWITCHER]: DateSwitcherPill,
|