/* eslint-disable no-unused-vars */ import Toolbar from "@mui/material/Toolbar"; import Chip from "@mui/material/Chip"; import Typography from "@mui/material/Typography"; import PropTypes from "prop-types"; import * as React from "react"; import { Droppable, Draggable } from "react-beautiful-dnd"; /* eslint-enable no-unused-vars */ class MTableGroupbar extends React.Component { constructor(props) { super(props); this.state = {}; } getItemStyle = (isDragging, draggableStyle) => ({ // some basic styles to make the items look a bit nicer userSelect: "none", // padding: '8px 16px', margin: `0 ${8}px 0 0`, // change background colour if dragging // background: isDragging ? 'lightgreen' : 'grey', // styles we need to apply on draggables ...draggableStyle, }); getListStyle = (isDraggingOver) => ({ // background: isDraggingOver ? 'lightblue' : '#0000000a', background: "#0000000a", display: "flex", width: "100%", padding: 8, overflow: "auto", border: "1px solid #ccc", borderStyle: "dashed", }); render() { return ( {(provided, snapshot) => (
{this.props.groupColumns.length > 0 && ( {this.props.localization.groupedBy} )} {this.props.groupColumns.map((columnDef, index) => { return ( {(provided, snapshot) => (
this.props.onSortChanged(columnDef)} label={
{columnDef.title}
{columnDef.tableData.groupSort && ( )}
} style={{ boxShadow: "none", textTransform: "none" }} onDelete={() => this.props.onGroupRemoved(columnDef, index) } />
)}
); })} {this.props.groupColumns.length === 0 && ( {this.props.localization.placeholder} )} {provided.placeholder}
)}
); } } MTableGroupbar.defaultProps = {}; MTableGroupbar.propTypes = { localization: PropTypes.shape({ groupedBy: PropTypes.string, placeholder: PropTypes.string, }), }; export default MTableGroupbar;