/
grid.jsx
50 lines (47 loc) · 1.21 KB
/
grid.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import React from 'react';
import PropTypes from 'prop-types';
import { PluginHost } from '@devexpress/dx-react-core';
import { GridCore } from './plugins/grid-core';
export const Grid = ({
rows,
columns,
getRowId,
getCellValue,
rootComponent,
headerPlaceholderComponent,
footerPlaceholderComponent,
children,
}) => (
<PluginHost>
<GridCore
rows={rows}
columns={columns}
getRowId={getRowId}
getCellValue={getCellValue}
rootComponent={rootComponent}
headerPlaceholderComponent={headerPlaceholderComponent}
footerPlaceholderComponent={footerPlaceholderComponent}
/>
{children}
</PluginHost>
);
Grid.propTypes = {
rows: PropTypes.array.isRequired,
getRowId: PropTypes.func,
getCellValue: PropTypes.func,
columns: PropTypes.array.isRequired,
rootComponent: PropTypes.func.isRequired,
headerPlaceholderComponent: PropTypes.func,
footerPlaceholderComponent: PropTypes.func,
children: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.node),
PropTypes.node,
]),
};
Grid.defaultProps = {
getRowId: undefined,
getCellValue: undefined,
headerPlaceholderComponent: undefined,
footerPlaceholderComponent: undefined,
children: undefined,
};