forked from CITKParus/P8-Panels
WEB APP: P8PDataGrid, P8PTable - управление контейнером таблицы
This commit is contained in:
parent
a2af117193
commit
2d76f0cafc
@ -54,6 +54,8 @@ const P8PDataGrid = ({
|
|||||||
groupCellRender,
|
groupCellRender,
|
||||||
rowExpandRender,
|
rowExpandRender,
|
||||||
valueFormatter,
|
valueFormatter,
|
||||||
|
containerComponent,
|
||||||
|
containerComponentProps,
|
||||||
onOrderChanged,
|
onOrderChanged,
|
||||||
onFilterChanged,
|
onFilterChanged,
|
||||||
onPagesCountChanged,
|
onPagesCountChanged,
|
||||||
@ -129,6 +131,8 @@ const P8PDataGrid = ({
|
|||||||
rowExpandRender={rowExpandRender}
|
rowExpandRender={rowExpandRender}
|
||||||
valueFormatter={valueFormatter}
|
valueFormatter={valueFormatter}
|
||||||
objectsCopier={objectsCopier}
|
objectsCopier={objectsCopier}
|
||||||
|
containerComponent={containerComponent}
|
||||||
|
containerComponentProps={containerComponentProps}
|
||||||
onOrderChanged={handleOrderChanged}
|
onOrderChanged={handleOrderChanged}
|
||||||
onFilterChanged={handleFilterChanged}
|
onFilterChanged={handleFilterChanged}
|
||||||
onPagesCountChanged={handlePagesCountChanged}
|
onPagesCountChanged={handlePagesCountChanged}
|
||||||
@ -162,6 +166,8 @@ P8PDataGrid.propTypes = {
|
|||||||
groupCellRender: PropTypes.func,
|
groupCellRender: PropTypes.func,
|
||||||
rowExpandRender: PropTypes.func,
|
rowExpandRender: PropTypes.func,
|
||||||
valueFormatter: PropTypes.func,
|
valueFormatter: PropTypes.func,
|
||||||
|
containerComponent: PropTypes.oneOfType([PropTypes.elementType, PropTypes.string]),
|
||||||
|
containerComponentProps: PropTypes.object,
|
||||||
onOrderChanged: PropTypes.func,
|
onOrderChanged: PropTypes.func,
|
||||||
onFilterChanged: PropTypes.func,
|
onFilterChanged: PropTypes.func,
|
||||||
onPagesCountChanged: PropTypes.func,
|
onPagesCountChanged: PropTypes.func,
|
||||||
|
@ -482,7 +482,9 @@ const P8PTable = ({
|
|||||||
onOrderChanged,
|
onOrderChanged,
|
||||||
onFilterChanged,
|
onFilterChanged,
|
||||||
onPagesCountChanged,
|
onPagesCountChanged,
|
||||||
objectsCopier
|
objectsCopier,
|
||||||
|
containerComponent,
|
||||||
|
containerComponentProps
|
||||||
}) => {
|
}) => {
|
||||||
//Собственное состояние - описание заголовка
|
//Собственное состояние - описание заголовка
|
||||||
const [header, dispatchHeaderAction] = useReducer(p8pTableReducer, HEADER_INITIAL_STATE());
|
const [header, dispatchHeaderAction] = useReducer(p8pTableReducer, HEADER_INITIAL_STATE());
|
||||||
@ -682,7 +684,8 @@ const P8PTable = ({
|
|||||||
valueFormatter={valueFormatter}
|
valueFormatter={valueFormatter}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
<TableContainer component={Paper}>
|
|
||||||
|
<TableContainer component={containerComponent ? containerComponent : Paper} {...(containerComponentProps ? containerComponentProps : {})}>
|
||||||
<Table sx={STYLES.TABLE} size={size || P8P_TABLE_SIZE.MEDIUM}>
|
<Table sx={STYLES.TABLE} size={size || P8P_TABLE_SIZE.MEDIUM}>
|
||||||
<TableHead>
|
<TableHead>
|
||||||
{header.displayLevels.map(level => (
|
{header.displayLevels.map(level => (
|
||||||
@ -868,7 +871,9 @@ P8PTable.propTypes = {
|
|||||||
onOrderChanged: PropTypes.func,
|
onOrderChanged: PropTypes.func,
|
||||||
onFilterChanged: PropTypes.func,
|
onFilterChanged: PropTypes.func,
|
||||||
onPagesCountChanged: PropTypes.func,
|
onPagesCountChanged: PropTypes.func,
|
||||||
objectsCopier: PropTypes.func.isRequired
|
objectsCopier: PropTypes.func.isRequired,
|
||||||
|
containerComponent: PropTypes.oneOfType([PropTypes.elementType, PropTypes.string]),
|
||||||
|
containerComponentProps: PropTypes.object
|
||||||
};
|
};
|
||||||
|
|
||||||
//----------------
|
//----------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user