@depup/react-virtualized 9.22.6-depup.0
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/LICENSE +22 -0
- package/README.md +34 -0
- package/changes.json +22 -0
- package/dist/commonjs/ArrowKeyStepper/ArrowKeyStepper.example.js +184 -0
- package/dist/commonjs/ArrowKeyStepper/ArrowKeyStepper.jest.js +338 -0
- package/dist/commonjs/ArrowKeyStepper/ArrowKeyStepper.js +204 -0
- package/dist/commonjs/ArrowKeyStepper/index.js +19 -0
- package/dist/commonjs/ArrowKeyStepper/types.js +5 -0
- package/dist/commonjs/AutoSizer/AutoSizer.example.js +104 -0
- package/dist/commonjs/AutoSizer/AutoSizer.jest.js +341 -0
- package/dist/commonjs/AutoSizer/AutoSizer.js +199 -0
- package/dist/commonjs/AutoSizer/AutoSizer.ssr.js +25 -0
- package/dist/commonjs/AutoSizer/index.js +19 -0
- package/dist/commonjs/CellMeasurer/CellMeasurer.DynamicHeightGrid.example.js +100 -0
- package/dist/commonjs/CellMeasurer/CellMeasurer.DynamicHeightList.example.js +99 -0
- package/dist/commonjs/CellMeasurer/CellMeasurer.DynamicHeightTableColumn.example.js +107 -0
- package/dist/commonjs/CellMeasurer/CellMeasurer.DynamicWidthGrid.example.js +102 -0
- package/dist/commonjs/CellMeasurer/CellMeasurer.DynamicWidthMultiGrid.example.js +107 -0
- package/dist/commonjs/CellMeasurer/CellMeasurer.example.js +129 -0
- package/dist/commonjs/CellMeasurer/CellMeasurer.jest.js +345 -0
- package/dist/commonjs/CellMeasurer/CellMeasurer.js +195 -0
- package/dist/commonjs/CellMeasurer/CellMeasurerCache.jest.js +298 -0
- package/dist/commonjs/CellMeasurer/CellMeasurerCache.js +202 -0
- package/dist/commonjs/CellMeasurer/index.js +22 -0
- package/dist/commonjs/CellMeasurer/types.js +14 -0
- package/dist/commonjs/Collection/Collection.example.js +231 -0
- package/dist/commonjs/Collection/Collection.jest.js +829 -0
- package/dist/commonjs/Collection/Collection.js +266 -0
- package/dist/commonjs/Collection/CollectionView.js +553 -0
- package/dist/commonjs/Collection/Section.jest.js +63 -0
- package/dist/commonjs/Collection/Section.js +57 -0
- package/dist/commonjs/Collection/SectionManager.jest.js +121 -0
- package/dist/commonjs/Collection/SectionManager.js +134 -0
- package/dist/commonjs/Collection/TestData.js +77 -0
- package/dist/commonjs/Collection/index.js +15 -0
- package/dist/commonjs/Collection/types.js +22 -0
- package/dist/commonjs/Collection/utils/calculateSizeAndPositionData.jest.js +34 -0
- package/dist/commonjs/Collection/utils/calculateSizeAndPositionData.js +38 -0
- package/dist/commonjs/ColumnSizer/ColumnSizer.example.js +159 -0
- package/dist/commonjs/ColumnSizer/ColumnSizer.jest.js +129 -0
- package/dist/commonjs/ColumnSizer/ColumnSizer.js +103 -0
- package/dist/commonjs/ColumnSizer/index.js +15 -0
- package/dist/commonjs/Grid/Grid.example.js +330 -0
- package/dist/commonjs/Grid/Grid.jest.js +2561 -0
- package/dist/commonjs/Grid/Grid.js +1432 -0
- package/dist/commonjs/Grid/Grid.ssr.js +62 -0
- package/dist/commonjs/Grid/accessibilityOverscanIndicesGetter.jest.js +92 -0
- package/dist/commonjs/Grid/accessibilityOverscanIndicesGetter.js +40 -0
- package/dist/commonjs/Grid/defaultCellRangeRenderer.js +139 -0
- package/dist/commonjs/Grid/defaultOverscanIndicesGetter.jest.js +92 -0
- package/dist/commonjs/Grid/defaultOverscanIndicesGetter.js +36 -0
- package/dist/commonjs/Grid/index.js +40 -0
- package/dist/commonjs/Grid/types.js +8 -0
- package/dist/commonjs/Grid/utils/CellSizeAndPositionManager.jest.js +375 -0
- package/dist/commonjs/Grid/utils/CellSizeAndPositionManager.js +296 -0
- package/dist/commonjs/Grid/utils/ScalingCellSizeAndPositionManager.jest.js +201 -0
- package/dist/commonjs/Grid/utils/ScalingCellSizeAndPositionManager.js +204 -0
- package/dist/commonjs/Grid/utils/calculateSizeAndPositionDataAndUpdateScrollOffset.jest.js +84 -0
- package/dist/commonjs/Grid/utils/calculateSizeAndPositionDataAndUpdateScrollOffset.js +59 -0
- package/dist/commonjs/Grid/utils/maxElementSize.js +22 -0
- package/dist/commonjs/Grid/utils/updateScrollIndexHelper.jest.js +180 -0
- package/dist/commonjs/Grid/utils/updateScrollIndexHelper.js +85 -0
- package/dist/commonjs/InfiniteLoader/InfiniteLoader.example.js +179 -0
- package/dist/commonjs/InfiniteLoader/InfiniteLoader.jest.js +571 -0
- package/dist/commonjs/InfiniteLoader/InfiniteLoader.js +274 -0
- package/dist/commonjs/InfiniteLoader/index.js +15 -0
- package/dist/commonjs/List/List.example.js +236 -0
- package/dist/commonjs/List/List.jest.js +517 -0
- package/dist/commonjs/List/List.js +318 -0
- package/dist/commonjs/List/index.js +19 -0
- package/dist/commonjs/List/types.js +6 -0
- package/dist/commonjs/Masonry/Masonry.example.js +287 -0
- package/dist/commonjs/Masonry/Masonry.jest.js +450 -0
- package/dist/commonjs/Masonry/Masonry.js +431 -0
- package/dist/commonjs/Masonry/PositionCache.js +88 -0
- package/dist/commonjs/Masonry/createCellPositioner.js +59 -0
- package/dist/commonjs/Masonry/index.js +22 -0
- package/dist/commonjs/MultiGrid/CellMeasurerCacheDecorator.js +106 -0
- package/dist/commonjs/MultiGrid/MultiGrid.example.js +131 -0
- package/dist/commonjs/MultiGrid/MultiGrid.jest.js +584 -0
- package/dist/commonjs/MultiGrid/MultiGrid.js +743 -0
- package/dist/commonjs/MultiGrid/index.js +15 -0
- package/dist/commonjs/ScrollSync/ScrollSync.example.js +257 -0
- package/dist/commonjs/ScrollSync/ScrollSync.jest.js +66 -0
- package/dist/commonjs/ScrollSync/ScrollSync.js +88 -0
- package/dist/commonjs/ScrollSync/index.js +15 -0
- package/dist/commonjs/Table/Column.jest.js +90 -0
- package/dist/commonjs/Table/Column.js +93 -0
- package/dist/commonjs/Table/SortDirection.js +19 -0
- package/dist/commonjs/Table/SortIndicator.js +40 -0
- package/dist/commonjs/Table/Table.example.js +325 -0
- package/dist/commonjs/Table/Table.jest.js +1257 -0
- package/dist/commonjs/Table/Table.js +742 -0
- package/dist/commonjs/Table/createMultiSort.jest.js +165 -0
- package/dist/commonjs/Table/createMultiSort.js +99 -0
- package/dist/commonjs/Table/defaultCellDataGetter.js +21 -0
- package/dist/commonjs/Table/defaultCellRenderer.js +19 -0
- package/dist/commonjs/Table/defaultHeaderRenderer.js +35 -0
- package/dist/commonjs/Table/defaultHeaderRowRenderer.js +21 -0
- package/dist/commonjs/Table/defaultRowRenderer.js +87 -0
- package/dist/commonjs/Table/index.js +78 -0
- package/dist/commonjs/Table/types.js +39 -0
- package/dist/commonjs/WindowScroller/WindowScroller.e2e.js +298 -0
- package/dist/commonjs/WindowScroller/WindowScroller.example.js +167 -0
- package/dist/commonjs/WindowScroller/WindowScroller.header-resize.e2e.js +359 -0
- package/dist/commonjs/WindowScroller/WindowScroller.jest.js +536 -0
- package/dist/commonjs/WindowScroller/WindowScroller.js +268 -0
- package/dist/commonjs/WindowScroller/WindowScroller.ssr.js +25 -0
- package/dist/commonjs/WindowScroller/index.js +23 -0
- package/dist/commonjs/WindowScroller/utils/dimensions.js +89 -0
- package/dist/commonjs/WindowScroller/utils/onScroll.js +70 -0
- package/dist/commonjs/index.js +180 -0
- package/dist/commonjs/jest-setup.js +7 -0
- package/dist/commonjs/utils/TestHelper.js +36 -0
- package/dist/commonjs/utils/animationFrame.js +29 -0
- package/dist/commonjs/utils/createCallbackMemoizer.jest.js +219 -0
- package/dist/commonjs/utils/createCallbackMemoizer.js +31 -0
- package/dist/commonjs/utils/getUpdatedOffsetForIndex.jest.js +68 -0
- package/dist/commonjs/utils/getUpdatedOffsetForIndex.js +38 -0
- package/dist/commonjs/utils/initCellMetadata.js +37 -0
- package/dist/commonjs/utils/requestAnimationTimeout.js +38 -0
- package/dist/commonjs/vendor/binarySearchBounds.js +200 -0
- package/dist/commonjs/vendor/detectElementResize.js +192 -0
- package/dist/commonjs/vendor/intervalTree.js +361 -0
- package/dist/es/ArrowKeyStepper/ArrowKeyStepper.example.js +176 -0
- package/dist/es/ArrowKeyStepper/ArrowKeyStepper.jest.js +332 -0
- package/dist/es/ArrowKeyStepper/ArrowKeyStepper.js +197 -0
- package/dist/es/ArrowKeyStepper/index.js +3 -0
- package/dist/es/ArrowKeyStepper/types.js +4 -0
- package/dist/es/AutoSizer/AutoSizer.example.js +96 -0
- package/dist/es/AutoSizer/AutoSizer.jest.js +335 -0
- package/dist/es/AutoSizer/AutoSizer.js +190 -0
- package/dist/es/AutoSizer/AutoSizer.js.flow +200 -0
- package/dist/es/AutoSizer/AutoSizer.ssr.js +19 -0
- package/dist/es/AutoSizer/index.js +2 -0
- package/dist/es/AutoSizer/index.js.flow +4 -0
- package/dist/es/CellMeasurer/CellMeasurer.DynamicHeightGrid.example.js +91 -0
- package/dist/es/CellMeasurer/CellMeasurer.DynamicHeightList.example.js +90 -0
- package/dist/es/CellMeasurer/CellMeasurer.DynamicHeightTableColumn.example.js +98 -0
- package/dist/es/CellMeasurer/CellMeasurer.DynamicWidthGrid.example.js +93 -0
- package/dist/es/CellMeasurer/CellMeasurer.DynamicWidthMultiGrid.example.js +98 -0
- package/dist/es/CellMeasurer/CellMeasurer.example.js +120 -0
- package/dist/es/CellMeasurer/CellMeasurer.jest.js +340 -0
- package/dist/es/CellMeasurer/CellMeasurer.js +187 -0
- package/dist/es/CellMeasurer/CellMeasurerCache.jest.js +293 -0
- package/dist/es/CellMeasurer/CellMeasurerCache.js +196 -0
- package/dist/es/CellMeasurer/index.js +4 -0
- package/dist/es/CellMeasurer/types.js +13 -0
- package/dist/es/Collection/Collection.example.js +223 -0
- package/dist/es/Collection/Collection.jest.js +824 -0
- package/dist/es/Collection/Collection.js +257 -0
- package/dist/es/Collection/CollectionView.js +544 -0
- package/dist/es/Collection/Section.jest.js +60 -0
- package/dist/es/Collection/Section.js +51 -0
- package/dist/es/Collection/SectionManager.jest.js +118 -0
- package/dist/es/Collection/SectionManager.js +128 -0
- package/dist/es/Collection/TestData.js +71 -0
- package/dist/es/Collection/index.js +3 -0
- package/dist/es/Collection/types.js +21 -0
- package/dist/es/Collection/utils/calculateSizeAndPositionData.jest.js +31 -0
- package/dist/es/Collection/utils/calculateSizeAndPositionData.js +31 -0
- package/dist/es/ColumnSizer/ColumnSizer.example.js +150 -0
- package/dist/es/ColumnSizer/ColumnSizer.jest.js +123 -0
- package/dist/es/ColumnSizer/ColumnSizer.js +95 -0
- package/dist/es/ColumnSizer/index.js +3 -0
- package/dist/es/Grid/Grid.example.js +321 -0
- package/dist/es/Grid/Grid.jest.js +2555 -0
- package/dist/es/Grid/Grid.js +1425 -0
- package/dist/es/Grid/Grid.ssr.js +57 -0
- package/dist/es/Grid/accessibilityOverscanIndicesGetter.jest.js +87 -0
- package/dist/es/Grid/accessibilityOverscanIndicesGetter.js +33 -0
- package/dist/es/Grid/defaultCellRangeRenderer.js +134 -0
- package/dist/es/Grid/defaultOverscanIndicesGetter.jest.js +87 -0
- package/dist/es/Grid/defaultOverscanIndicesGetter.js +29 -0
- package/dist/es/Grid/index.js +15 -0
- package/dist/es/Grid/types.js +96 -0
- package/dist/es/Grid/utils/CellSizeAndPositionManager.jest.js +372 -0
- package/dist/es/Grid/utils/CellSizeAndPositionManager.js +290 -0
- package/dist/es/Grid/utils/ScalingCellSizeAndPositionManager.jest.js +198 -0
- package/dist/es/Grid/utils/ScalingCellSizeAndPositionManager.js +198 -0
- package/dist/es/Grid/utils/calculateSizeAndPositionDataAndUpdateScrollOffset.jest.js +81 -0
- package/dist/es/Grid/utils/calculateSizeAndPositionDataAndUpdateScrollOffset.js +53 -0
- package/dist/es/Grid/utils/maxElementSize.js +16 -0
- package/dist/es/Grid/utils/updateScrollIndexHelper.jest.js +174 -0
- package/dist/es/Grid/utils/updateScrollIndexHelper.js +79 -0
- package/dist/es/InfiniteLoader/InfiniteLoader.example.js +170 -0
- package/dist/es/InfiniteLoader/InfiniteLoader.jest.js +565 -0
- package/dist/es/InfiniteLoader/InfiniteLoader.js +263 -0
- package/dist/es/InfiniteLoader/index.js +3 -0
- package/dist/es/List/List.example.js +227 -0
- package/dist/es/List/List.jest.js +511 -0
- package/dist/es/List/List.js +312 -0
- package/dist/es/List/index.js +3 -0
- package/dist/es/List/types.js +21 -0
- package/dist/es/Masonry/Masonry.example.js +278 -0
- package/dist/es/Masonry/Masonry.jest.js +444 -0
- package/dist/es/Masonry/Masonry.js +421 -0
- package/dist/es/Masonry/PositionCache.js +82 -0
- package/dist/es/Masonry/createCellPositioner.js +53 -0
- package/dist/es/Masonry/index.js +4 -0
- package/dist/es/MultiGrid/CellMeasurerCacheDecorator.js +100 -0
- package/dist/es/MultiGrid/MultiGrid.example.js +122 -0
- package/dist/es/MultiGrid/MultiGrid.jest.js +579 -0
- package/dist/es/MultiGrid/MultiGrid.js +733 -0
- package/dist/es/MultiGrid/index.js +3 -0
- package/dist/es/ScrollSync/ScrollSync.example.js +248 -0
- package/dist/es/ScrollSync/ScrollSync.jest.js +60 -0
- package/dist/es/ScrollSync/ScrollSync.js +80 -0
- package/dist/es/ScrollSync/index.js +3 -0
- package/dist/es/Table/Column.jest.js +84 -0
- package/dist/es/Table/Column.js +85 -0
- package/dist/es/Table/SortDirection.js +13 -0
- package/dist/es/Table/SortIndicator.js +31 -0
- package/dist/es/Table/Table.example.js +316 -0
- package/dist/es/Table/Table.jest.js +1251 -0
- package/dist/es/Table/Table.js +735 -0
- package/dist/es/Table/createMultiSort.jest.js +162 -0
- package/dist/es/Table/createMultiSort.js +93 -0
- package/dist/es/Table/defaultCellDataGetter.js +15 -0
- package/dist/es/Table/defaultCellRenderer.js +13 -0
- package/dist/es/Table/defaultHeaderRenderer.js +25 -0
- package/dist/es/Table/defaultHeaderRowRenderer.js +12 -0
- package/dist/es/Table/defaultRowRenderer.js +77 -0
- package/dist/es/Table/index.js +12 -0
- package/dist/es/Table/types.js +38 -0
- package/dist/es/WindowScroller/WindowScroller.e2e.js +295 -0
- package/dist/es/WindowScroller/WindowScroller.example.js +158 -0
- package/dist/es/WindowScroller/WindowScroller.header-resize.e2e.js +356 -0
- package/dist/es/WindowScroller/WindowScroller.jest.js +530 -0
- package/dist/es/WindowScroller/WindowScroller.js +259 -0
- package/dist/es/WindowScroller/WindowScroller.js.flow +277 -0
- package/dist/es/WindowScroller/WindowScroller.ssr.js +19 -0
- package/dist/es/WindowScroller/index.js +3 -0
- package/dist/es/WindowScroller/index.js.flow +6 -0
- package/dist/es/WindowScroller/utils/dimensions.js +81 -0
- package/dist/es/WindowScroller/utils/dimensions.js.flow +91 -0
- package/dist/es/WindowScroller/utils/onScroll.js +64 -0
- package/dist/es/WindowScroller/utils/onScroll.js.flow +94 -0
- package/dist/es/index.js +13 -0
- package/dist/es/jest-setup.js +5 -0
- package/dist/es/utils/TestHelper.js +30 -0
- package/dist/es/utils/animationFrame.js +23 -0
- package/dist/es/utils/createCallbackMemoizer.jest.js +216 -0
- package/dist/es/utils/createCallbackMemoizer.js +25 -0
- package/dist/es/utils/getUpdatedOffsetForIndex.jest.js +65 -0
- package/dist/es/utils/getUpdatedOffsetForIndex.js +32 -0
- package/dist/es/utils/initCellMetadata.js +31 -0
- package/dist/es/utils/requestAnimationTimeout.js +32 -0
- package/dist/es/vendor/binarySearchBounds.js +194 -0
- package/dist/es/vendor/detectElementResize.js +186 -0
- package/dist/es/vendor/intervalTree.js +354 -0
- package/dist/umd/react-virtualized.js +4638 -0
- package/package.json +188 -0
- package/styles.css +80 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _createMultiSort = _interopRequireDefault(require("./createMultiSort"));
|
|
5
|
+
describe('createMultiSort', function () {
|
|
6
|
+
function simulate(sort, dataKey) {
|
|
7
|
+
var eventModifier = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
8
|
+
var defaultSortDirection = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'ASC';
|
|
9
|
+
sort({
|
|
10
|
+
defaultSortDirection: defaultSortDirection,
|
|
11
|
+
event: {
|
|
12
|
+
ctrlKey: eventModifier === 'control',
|
|
13
|
+
metaKey: eventModifier === 'meta',
|
|
14
|
+
shiftKey: eventModifier === 'shift'
|
|
15
|
+
},
|
|
16
|
+
sortBy: dataKey
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
it('errors if the user did not specify a sort callback', function () {
|
|
20
|
+
expect(_createMultiSort["default"]).toThrow();
|
|
21
|
+
});
|
|
22
|
+
it('sets the correct default values', function () {
|
|
23
|
+
var multiSort = (0, _createMultiSort["default"])(jest.fn(), {
|
|
24
|
+
defaultSortBy: ['a', 'b'],
|
|
25
|
+
defaultSortDirection: {
|
|
26
|
+
a: 'ASC',
|
|
27
|
+
b: 'DESC'
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
expect(multiSort.sortBy).toEqual(['a', 'b']);
|
|
31
|
+
expect(multiSort.sortDirection.a).toBe('ASC');
|
|
32
|
+
expect(multiSort.sortDirection.b).toBe('DESC');
|
|
33
|
+
});
|
|
34
|
+
it('sets the correct default sparse values', function () {
|
|
35
|
+
var multiSort = (0, _createMultiSort["default"])(jest.fn(), {
|
|
36
|
+
defaultSortBy: ['a', 'b']
|
|
37
|
+
});
|
|
38
|
+
expect(multiSort.sortBy).toEqual(['a', 'b']);
|
|
39
|
+
expect(multiSort.sortDirection.a).toBe('ASC');
|
|
40
|
+
expect(multiSort.sortDirection.b).toBe('ASC');
|
|
41
|
+
});
|
|
42
|
+
describe('on click', function () {
|
|
43
|
+
it('sets the correct default value for a field', function () {
|
|
44
|
+
var multiSort = (0, _createMultiSort["default"])(jest.fn());
|
|
45
|
+
simulate(multiSort.sort, 'a');
|
|
46
|
+
expect(multiSort.sortBy).toEqual(['a']);
|
|
47
|
+
expect(multiSort.sortDirection.a).toBe('ASC');
|
|
48
|
+
simulate(multiSort.sort, 'b', '', 'DESC');
|
|
49
|
+
expect(multiSort.sortBy).toEqual(['b']);
|
|
50
|
+
expect(multiSort.sortDirection.b).toBe('DESC');
|
|
51
|
+
});
|
|
52
|
+
it('toggles a field value', function () {
|
|
53
|
+
var multiSort = (0, _createMultiSort["default"])(jest.fn());
|
|
54
|
+
simulate(multiSort.sort, 'a');
|
|
55
|
+
expect(multiSort.sortBy).toEqual(['a']);
|
|
56
|
+
expect(multiSort.sortDirection.a).toBe('ASC');
|
|
57
|
+
simulate(multiSort.sort, 'a');
|
|
58
|
+
expect(multiSort.sortBy).toEqual(['a']);
|
|
59
|
+
expect(multiSort.sortDirection.a).toBe('DESC');
|
|
60
|
+
simulate(multiSort.sort, 'b', '', 'DESC');
|
|
61
|
+
expect(multiSort.sortBy).toEqual(['b']);
|
|
62
|
+
expect(multiSort.sortDirection.b).toBe('DESC');
|
|
63
|
+
simulate(multiSort.sort, 'b', '', 'DESC');
|
|
64
|
+
expect(multiSort.sortBy).toEqual(['b']);
|
|
65
|
+
expect(multiSort.sortDirection.b).toBe('ASC');
|
|
66
|
+
});
|
|
67
|
+
it('resets sort-by fields', function () {
|
|
68
|
+
var multiSort = (0, _createMultiSort["default"])(jest.fn(), {
|
|
69
|
+
defaultSortBy: ['a', 'b']
|
|
70
|
+
});
|
|
71
|
+
expect(multiSort.sortBy).toEqual(['a', 'b']);
|
|
72
|
+
simulate(multiSort.sort, 'a');
|
|
73
|
+
expect(multiSort.sortBy).toEqual(['a']);
|
|
74
|
+
});
|
|
75
|
+
it('resets sort-direction fields', function () {
|
|
76
|
+
var multiSort = (0, _createMultiSort["default"])(jest.fn(), {
|
|
77
|
+
defaultSortBy: ['a', 'b'],
|
|
78
|
+
defaultSortDirection: {
|
|
79
|
+
a: 'DESC',
|
|
80
|
+
b: 'ASC'
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
expect(multiSort.sortBy).toEqual(['a', 'b']);
|
|
84
|
+
expect(multiSort.sortDirection.a).toEqual('DESC');
|
|
85
|
+
expect(multiSort.sortDirection.b).toEqual('ASC');
|
|
86
|
+
simulate(multiSort.sort, 'a');
|
|
87
|
+
expect(multiSort.sortBy).toEqual(['a']);
|
|
88
|
+
expect(multiSort.sortDirection.a).toEqual('ASC');
|
|
89
|
+
expect(multiSort.sortDirection.b).toEqual(undefined);
|
|
90
|
+
simulate(multiSort.sort, 'b');
|
|
91
|
+
expect(multiSort.sortBy).toEqual(['b']);
|
|
92
|
+
expect(multiSort.sortDirection.a).toEqual(undefined);
|
|
93
|
+
expect(multiSort.sortDirection.b).toEqual('ASC');
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
describe('on shift click', function () {
|
|
97
|
+
it('appends a field to the sort by list', function () {
|
|
98
|
+
var multiSort = (0, _createMultiSort["default"])(jest.fn());
|
|
99
|
+
simulate(multiSort.sort, 'a');
|
|
100
|
+
expect(multiSort.sortBy).toEqual(['a']);
|
|
101
|
+
expect(multiSort.sortDirection.a).toBe('ASC');
|
|
102
|
+
simulate(multiSort.sort, 'b', 'shift');
|
|
103
|
+
expect(multiSort.sortBy).toEqual(['a', 'b']);
|
|
104
|
+
expect(multiSort.sortDirection.a).toBe('ASC');
|
|
105
|
+
expect(multiSort.sortDirection.b).toBe('ASC');
|
|
106
|
+
});
|
|
107
|
+
it('toggles an appended field value', function () {
|
|
108
|
+
var multiSort = (0, _createMultiSort["default"])(jest.fn());
|
|
109
|
+
simulate(multiSort.sort, 'a');
|
|
110
|
+
expect(multiSort.sortBy).toEqual(['a']);
|
|
111
|
+
expect(multiSort.sortDirection.a).toBe('ASC');
|
|
112
|
+
simulate(multiSort.sort, 'b', 'shift');
|
|
113
|
+
expect(multiSort.sortBy).toEqual(['a', 'b']);
|
|
114
|
+
expect(multiSort.sortDirection.a).toBe('ASC');
|
|
115
|
+
expect(multiSort.sortDirection.b).toBe('ASC');
|
|
116
|
+
simulate(multiSort.sort, 'a', 'shift');
|
|
117
|
+
expect(multiSort.sortBy).toEqual(['a', 'b']);
|
|
118
|
+
expect(multiSort.sortDirection.a).toBe('DESC');
|
|
119
|
+
expect(multiSort.sortDirection.b).toBe('ASC');
|
|
120
|
+
simulate(multiSort.sort, 'a', 'shift');
|
|
121
|
+
expect(multiSort.sortBy).toEqual(['a', 'b']);
|
|
122
|
+
expect(multiSort.sortDirection.a).toBe('ASC');
|
|
123
|
+
expect(multiSort.sortDirection.b).toBe('ASC');
|
|
124
|
+
});
|
|
125
|
+
it('able to shift+click more than once', function () {
|
|
126
|
+
var multiSort = (0, _createMultiSort["default"])(jest.fn());
|
|
127
|
+
simulate(multiSort.sort, 'a');
|
|
128
|
+
expect(multiSort.sortBy).toEqual(['a']);
|
|
129
|
+
expect(multiSort.sortDirection.a).toBe('ASC');
|
|
130
|
+
simulate(multiSort.sort, 'b', 'shift');
|
|
131
|
+
expect(multiSort.sortBy).toEqual(['a', 'b']);
|
|
132
|
+
expect(multiSort.sortDirection.a).toBe('ASC');
|
|
133
|
+
expect(multiSort.sortDirection.b).toBe('ASC');
|
|
134
|
+
simulate(multiSort.sort, 'b');
|
|
135
|
+
expect(multiSort.sortBy).toEqual(['b']);
|
|
136
|
+
expect(multiSort.sortDirection.b).toBe('DESC');
|
|
137
|
+
simulate(multiSort.sort, 'a', 'shift');
|
|
138
|
+
expect(multiSort.sortBy).toEqual(['b', 'a']);
|
|
139
|
+
expect(multiSort.sortDirection.a).toBe('ASC');
|
|
140
|
+
expect(multiSort.sortDirection.b).toBe('DESC');
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
['control', 'meta'].forEach(function (modifier) {
|
|
144
|
+
describe("".concat(modifier, " click"), function () {
|
|
145
|
+
it('removes a field from the sort by list', function () {
|
|
146
|
+
var multiSort = (0, _createMultiSort["default"])(jest.fn(), {
|
|
147
|
+
defaultSortBy: ['a', 'b']
|
|
148
|
+
});
|
|
149
|
+
expect(multiSort.sortBy).toEqual(['a', 'b']);
|
|
150
|
+
simulate(multiSort.sort, 'a', modifier);
|
|
151
|
+
expect(multiSort.sortBy).toEqual(['b']);
|
|
152
|
+
simulate(multiSort.sort, 'b', modifier);
|
|
153
|
+
expect(multiSort.sortBy).toEqual([]);
|
|
154
|
+
});
|
|
155
|
+
it('ignores fields not in the list on control click', function () {
|
|
156
|
+
var multiSort = (0, _createMultiSort["default"])(jest.fn(), {
|
|
157
|
+
defaultSortBy: ['a', 'b']
|
|
158
|
+
});
|
|
159
|
+
expect(multiSort.sortBy).toEqual(['a', 'b']);
|
|
160
|
+
simulate(multiSort.sort, 'c', modifier);
|
|
161
|
+
expect(multiSort.sortBy).toEqual(['a', 'b']);
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
});
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = createMultiSort;
|
|
7
|
+
/*:: type SortDirection = 'ASC' | 'DESC';*/
|
|
8
|
+
/*:: type SortParams = {
|
|
9
|
+
defaultSortDirection: SortDirection,
|
|
10
|
+
event: MouseEvent,
|
|
11
|
+
sortBy: string,
|
|
12
|
+
};*/
|
|
13
|
+
/*:: type SortDirectionMap = {[string]: SortDirection};*/
|
|
14
|
+
/*:: type MultiSortOptions = {
|
|
15
|
+
defaultSortBy: ?Array<string>,
|
|
16
|
+
defaultSortDirection: ?SortDirectionMap,
|
|
17
|
+
};*/
|
|
18
|
+
/*:: type MultiSortReturn = {
|
|
19
|
+
/**
|
|
20
|
+
* Sort property to be passed to the `Table` component.
|
|
21
|
+
* This function updates `sortBy` and `sortDirection` values.
|
|
22
|
+
*-/
|
|
23
|
+
sort: (params: SortParams) => void,
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Specifies the fields currently responsible for sorting data,
|
|
27
|
+
* In order of importance.
|
|
28
|
+
*-/
|
|
29
|
+
sortBy: Array<string>,
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Specifies the direction a specific field is being sorted in.
|
|
33
|
+
*-/
|
|
34
|
+
sortDirection: SortDirectionMap,
|
|
35
|
+
};*/
|
|
36
|
+
function createMultiSort(sortCallback /*: Function*/) /*: MultiSortReturn*/{
|
|
37
|
+
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
38
|
+
defaultSortBy = _ref.defaultSortBy,
|
|
39
|
+
_ref$defaultSortDirec = _ref.defaultSortDirection,
|
|
40
|
+
defaultSortDirection = _ref$defaultSortDirec === void 0 ? {} : _ref$defaultSortDirec;
|
|
41
|
+
if (!sortCallback) {
|
|
42
|
+
throw Error("Required parameter \"sortCallback\" not specified");
|
|
43
|
+
}
|
|
44
|
+
var sortBy = defaultSortBy || [];
|
|
45
|
+
var sortDirection = {};
|
|
46
|
+
sortBy.forEach(function (dataKey) {
|
|
47
|
+
sortDirection[dataKey] = defaultSortDirection[dataKey] !== undefined ? defaultSortDirection[dataKey] : 'ASC';
|
|
48
|
+
});
|
|
49
|
+
function sort(_ref2 /*:: */) /*: void*/{
|
|
50
|
+
var defaultSortDirection = _ref2 /*:: */.defaultSortDirection,
|
|
51
|
+
event = _ref2 /*:: */.event,
|
|
52
|
+
dataKey = _ref2 /*:: */.sortBy;
|
|
53
|
+
if (event.shiftKey) {
|
|
54
|
+
// Shift + click appends a column to existing criteria
|
|
55
|
+
if (sortDirection[dataKey] !== undefined) {
|
|
56
|
+
sortDirection[dataKey] = sortDirection[dataKey] === 'ASC' ? 'DESC' : 'ASC';
|
|
57
|
+
} else {
|
|
58
|
+
sortDirection[dataKey] = defaultSortDirection;
|
|
59
|
+
sortBy.push(dataKey);
|
|
60
|
+
}
|
|
61
|
+
} else if (event.ctrlKey || event.metaKey) {
|
|
62
|
+
// Control + click removes column from sort (if pressent)
|
|
63
|
+
var index = sortBy.indexOf(dataKey);
|
|
64
|
+
if (index >= 0) {
|
|
65
|
+
sortBy.splice(index, 1);
|
|
66
|
+
delete sortDirection[dataKey];
|
|
67
|
+
}
|
|
68
|
+
} else {
|
|
69
|
+
// Clear sortBy array of all non-selected keys
|
|
70
|
+
sortBy.length = 0;
|
|
71
|
+
sortBy.push(dataKey);
|
|
72
|
+
|
|
73
|
+
// Clear sortDirection object of all non-selected keys
|
|
74
|
+
var sortDirectionKeys = Object.keys(sortDirection);
|
|
75
|
+
sortDirectionKeys.forEach(function (key) {
|
|
76
|
+
if (key !== dataKey) delete sortDirection[key];
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
// If key is already selected, reverse sort direction.
|
|
80
|
+
// Else, set sort direction to default direction.
|
|
81
|
+
if (sortDirection[dataKey] !== undefined) {
|
|
82
|
+
sortDirection[dataKey] = sortDirection[dataKey] === 'ASC' ? 'DESC' : 'ASC';
|
|
83
|
+
} else {
|
|
84
|
+
sortDirection[dataKey] = defaultSortDirection;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Notify application code
|
|
89
|
+
sortCallback({
|
|
90
|
+
sortBy: sortBy,
|
|
91
|
+
sortDirection: sortDirection
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
sort: sort,
|
|
96
|
+
sortBy: sortBy,
|
|
97
|
+
sortDirection: sortDirection
|
|
98
|
+
};
|
|
99
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = defaultCellDataGetter;
|
|
7
|
+
/*:: import type {CellDataGetterParams} from './types';*/
|
|
8
|
+
/**
|
|
9
|
+
* Default accessor for returning a cell value for a given attribute.
|
|
10
|
+
* This function expects to operate on either a vanilla Object or an Immutable Map.
|
|
11
|
+
* You should override the column's cellDataGetter if your data is some other type of object.
|
|
12
|
+
*/
|
|
13
|
+
function defaultCellDataGetter(_ref /*:: */) {
|
|
14
|
+
var dataKey = _ref /*:: */.dataKey,
|
|
15
|
+
rowData = _ref /*:: */.rowData;
|
|
16
|
+
if (typeof rowData.get === 'function') {
|
|
17
|
+
return rowData.get(dataKey);
|
|
18
|
+
} else {
|
|
19
|
+
return rowData[dataKey];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = defaultCellRenderer;
|
|
7
|
+
/*:: import type {CellRendererParams} from './types';*/
|
|
8
|
+
/**
|
|
9
|
+
* Default cell renderer that displays an attribute as a simple string
|
|
10
|
+
* You should override the column's cellRenderer if your data is some other type of object.
|
|
11
|
+
*/
|
|
12
|
+
function defaultCellRenderer(_ref /*:: */) /*: string*/{
|
|
13
|
+
var cellData = _ref /*:: */.cellData;
|
|
14
|
+
if (cellData == null) {
|
|
15
|
+
return '';
|
|
16
|
+
} else {
|
|
17
|
+
return String(cellData);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = defaultHeaderRenderer;
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _SortIndicator = _interopRequireDefault(require("./SortIndicator"));
|
|
11
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
13
|
+
/*:: import type {HeaderRendererParams} from './types';*/
|
|
14
|
+
/**
|
|
15
|
+
* Default table header renderer.
|
|
16
|
+
*/
|
|
17
|
+
function defaultHeaderRenderer(_ref /*:: */) {
|
|
18
|
+
var dataKey = _ref /*:: */.dataKey,
|
|
19
|
+
label = _ref /*:: */.label,
|
|
20
|
+
sortBy = _ref /*:: */.sortBy,
|
|
21
|
+
sortDirection = _ref /*:: */.sortDirection;
|
|
22
|
+
var showSortIndicator = sortBy === dataKey;
|
|
23
|
+
var children = [/*#__PURE__*/React.createElement("span", {
|
|
24
|
+
className: "ReactVirtualized__Table__headerTruncatedText",
|
|
25
|
+
key: "label",
|
|
26
|
+
title: typeof label === 'string' ? label : null
|
|
27
|
+
}, label)];
|
|
28
|
+
if (showSortIndicator) {
|
|
29
|
+
children.push(/*#__PURE__*/React.createElement(_SortIndicator["default"], {
|
|
30
|
+
key: "SortIndicator",
|
|
31
|
+
sortDirection: sortDirection
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
return children;
|
|
35
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = defaultHeaderRowRenderer;
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
10
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
11
|
+
/*:: import type {HeaderRowRendererParams} from './types';*/
|
|
12
|
+
function defaultHeaderRowRenderer(_ref /*:: */) {
|
|
13
|
+
var className = _ref /*:: */.className,
|
|
14
|
+
columns = _ref /*:: */.columns,
|
|
15
|
+
style = _ref /*:: */.style;
|
|
16
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
17
|
+
className: className,
|
|
18
|
+
role: "row",
|
|
19
|
+
style: style
|
|
20
|
+
}, columns);
|
|
21
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = defaultRowRenderer;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
13
|
+
/*:: import type {RowRendererParams} from './types';*/
|
|
14
|
+
/**
|
|
15
|
+
* Default row renderer for Table.
|
|
16
|
+
*/
|
|
17
|
+
function defaultRowRenderer(_ref /*:: */) {
|
|
18
|
+
var className = _ref /*:: */.className,
|
|
19
|
+
columns = _ref /*:: */.columns,
|
|
20
|
+
index = _ref /*:: */.index,
|
|
21
|
+
key = _ref /*:: */.key,
|
|
22
|
+
onRowClick = _ref /*:: */.onRowClick,
|
|
23
|
+
onRowDoubleClick = _ref /*:: */.onRowDoubleClick,
|
|
24
|
+
onRowMouseOut = _ref /*:: */.onRowMouseOut,
|
|
25
|
+
onRowMouseOver = _ref /*:: */.onRowMouseOver,
|
|
26
|
+
onRowRightClick = _ref /*:: */.onRowRightClick,
|
|
27
|
+
rowData = _ref /*:: */.rowData,
|
|
28
|
+
style = _ref /*:: */.style;
|
|
29
|
+
var a11yProps = {
|
|
30
|
+
'aria-rowindex': index + 1
|
|
31
|
+
};
|
|
32
|
+
if (onRowClick || onRowDoubleClick || onRowMouseOut || onRowMouseOver || onRowRightClick) {
|
|
33
|
+
a11yProps['aria-label'] = 'row';
|
|
34
|
+
a11yProps.tabIndex = 0;
|
|
35
|
+
if (onRowClick) {
|
|
36
|
+
a11yProps.onClick = function (event) {
|
|
37
|
+
return onRowClick({
|
|
38
|
+
event: event,
|
|
39
|
+
index: index,
|
|
40
|
+
rowData: rowData
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
if (onRowDoubleClick) {
|
|
45
|
+
a11yProps.onDoubleClick = function (event) {
|
|
46
|
+
return onRowDoubleClick({
|
|
47
|
+
event: event,
|
|
48
|
+
index: index,
|
|
49
|
+
rowData: rowData
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
if (onRowMouseOut) {
|
|
54
|
+
a11yProps.onMouseOut = function (event) {
|
|
55
|
+
return onRowMouseOut({
|
|
56
|
+
event: event,
|
|
57
|
+
index: index,
|
|
58
|
+
rowData: rowData
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
if (onRowMouseOver) {
|
|
63
|
+
a11yProps.onMouseOver = function (event) {
|
|
64
|
+
return onRowMouseOver({
|
|
65
|
+
event: event,
|
|
66
|
+
index: index,
|
|
67
|
+
rowData: rowData
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
if (onRowRightClick) {
|
|
72
|
+
a11yProps.onContextMenu = function (event) {
|
|
73
|
+
return onRowRightClick({
|
|
74
|
+
event: event,
|
|
75
|
+
index: index,
|
|
76
|
+
rowData: rowData
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, a11yProps, {
|
|
82
|
+
className: className,
|
|
83
|
+
key: key,
|
|
84
|
+
role: "row",
|
|
85
|
+
style: style
|
|
86
|
+
}), columns);
|
|
87
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
Object.defineProperty(exports, "Column", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _Column["default"];
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, "SortDirection", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function get() {
|
|
16
|
+
return _SortDirection["default"];
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, "SortIndicator", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function get() {
|
|
22
|
+
return _SortIndicator["default"];
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
Object.defineProperty(exports, "Table", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function get() {
|
|
28
|
+
return _Table["default"];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(exports, "createMultiSort", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function get() {
|
|
34
|
+
return _createMultiSort["default"];
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
exports["default"] = void 0;
|
|
38
|
+
Object.defineProperty(exports, "defaultCellDataGetter", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function get() {
|
|
41
|
+
return _defaultCellDataGetter["default"];
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
Object.defineProperty(exports, "defaultCellRenderer", {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
get: function get() {
|
|
47
|
+
return _defaultCellRenderer["default"];
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
Object.defineProperty(exports, "defaultHeaderRenderer", {
|
|
51
|
+
enumerable: true,
|
|
52
|
+
get: function get() {
|
|
53
|
+
return _defaultHeaderRenderer["default"];
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
Object.defineProperty(exports, "defaultHeaderRowRenderer", {
|
|
57
|
+
enumerable: true,
|
|
58
|
+
get: function get() {
|
|
59
|
+
return _defaultHeaderRowRenderer["default"];
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
Object.defineProperty(exports, "defaultRowRenderer", {
|
|
63
|
+
enumerable: true,
|
|
64
|
+
get: function get() {
|
|
65
|
+
return _defaultRowRenderer["default"];
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
var _createMultiSort = _interopRequireDefault(require("./createMultiSort"));
|
|
69
|
+
var _defaultCellDataGetter = _interopRequireDefault(require("./defaultCellDataGetter"));
|
|
70
|
+
var _defaultCellRenderer = _interopRequireDefault(require("./defaultCellRenderer"));
|
|
71
|
+
var _defaultHeaderRowRenderer = _interopRequireDefault(require("./defaultHeaderRowRenderer.js"));
|
|
72
|
+
var _defaultHeaderRenderer = _interopRequireDefault(require("./defaultHeaderRenderer"));
|
|
73
|
+
var _defaultRowRenderer = _interopRequireDefault(require("./defaultRowRenderer"));
|
|
74
|
+
var _Column = _interopRequireDefault(require("./Column"));
|
|
75
|
+
var _SortDirection = _interopRequireDefault(require("./SortDirection"));
|
|
76
|
+
var _SortIndicator = _interopRequireDefault(require("./SortIndicator"));
|
|
77
|
+
var _Table = _interopRequireDefault(require("./Table"));
|
|
78
|
+
var _default = exports["default"] = _Table["default"];
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*:: export type CellDataGetterParams = {
|
|
2
|
+
columnData: ?any,
|
|
3
|
+
dataKey: string,
|
|
4
|
+
rowData: any,
|
|
5
|
+
};*/
|
|
6
|
+
/*:: export type CellRendererParams = {
|
|
7
|
+
cellData: ?any,
|
|
8
|
+
columnData: ?any,
|
|
9
|
+
dataKey: string,
|
|
10
|
+
rowData: any,
|
|
11
|
+
rowIndex: number,
|
|
12
|
+
};*/
|
|
13
|
+
/*:: export type HeaderRowRendererParams = {
|
|
14
|
+
className: string,
|
|
15
|
+
columns: Array<any>,
|
|
16
|
+
style: any,
|
|
17
|
+
};*/
|
|
18
|
+
/*:: export type HeaderRendererParams = {
|
|
19
|
+
columnData: ?any,
|
|
20
|
+
dataKey: string,
|
|
21
|
+
disableSort: ?boolean,
|
|
22
|
+
label: ?any,
|
|
23
|
+
sortBy: ?string,
|
|
24
|
+
sortDirection: ?string,
|
|
25
|
+
};*/
|
|
26
|
+
/*:: export type RowRendererParams = {
|
|
27
|
+
className: string,
|
|
28
|
+
columns: Array<any>,
|
|
29
|
+
index: number,
|
|
30
|
+
isScrolling: boolean,
|
|
31
|
+
onRowClick: ?Function,
|
|
32
|
+
onRowDoubleClick: ?Function,
|
|
33
|
+
onRowMouseOver: ?Function,
|
|
34
|
+
onRowMouseOut: ?Function,
|
|
35
|
+
rowData: any,
|
|
36
|
+
style: any,
|
|
37
|
+
key: string,
|
|
38
|
+
};*/
|
|
39
|
+
"use strict";
|