import React from "react";
import MUIDataTable from "../../src/";
import Chip from '@mui/material/Chip';
import Select from '@mui/material/Select';
import MenuItem from '@mui/material/MenuItem';
import TableFilterList from '../../src/components/TableFilterList';
import MuiTooltip from '@mui/material/Tooltip';
import Fade from "@mui/material/Fade";
import Checkbox from '@mui/material/Checkbox';
import Radio from '@mui/material/Radio';
import TableViewCol from './TableViewCol';
const CustomChip = (props) => {
const { label, onDelete, columnNames, className, index } = props;
return ();
};
const CustomTooltip = (props) => {
return (
{props.children}
);
};
const CustomCheckbox = (props) => {
let newProps = Object.assign({}, props);
newProps.color = props['data-description'] === 'row-select' ? 'secondary' : 'primary';
if (props['data-description'] === 'row-select') {
return ();
} else {
return ();
}
};
const CustomFilterList = (props) => {
return ;
};
class Example extends React.Component {
render() {
const columns = [
{ name: 'Name' },
{
name: 'Company',
options: {
filter: true,
filterType: 'custom',
filterList: ['Test Corp'],
customFilterListOptions: {
render: v => {
if (v.length !== 0) {
return `Company: ${v[0]}`;
}
return false;
},
update: (filterList) => filterList,
},
filterOptions: {
names: [],
logic(status, filter) {
if (filter.length > 0) {
return status !== filter[0];
}
return false;
},
display: (filterList, onChange, index, column) => (
)
},
},
},
{ name: 'City', label: 'City Label', options: { filterList: ['Dallas'] } },
{ name: 'State' },
{
name: 'Empty',
options: {
empty: true,
filterType: 'checkbox',
filterOptions: {
renderValue: (val) => (val ? val : '(Empty)')
}
}
},
];
const data = [
['Joe James', 'Test Corp', 'Yonkers', 'NY'],
['John Walsh', 'Test Corp', 'Hartford', null],
['Bob Herm', 'Other Corp', 'Tampa', 'FL'],
['James Houston', 'Test Corp', 'Dallas', 'TX'],
];
let options = {
onFilterChipClose: (index, removedFilter, filterList) => {
console.log(index, removedFilter, filterList);
},
selectableRows: 'single',
selectToolbarPlacement: 'none',
};
return (
);
}
}
export default Example;