Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 35 additions & 36 deletions examples/custom-components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,20 @@ import TableViewCol from './TableViewCol';
const CustomChip = (props) => {
const { label, onDelete, columnNames, className, index } = props;
return (<Chip
className={className}
variant="outlined"
color={columnNames[index].name === 'Company' ? 'secondary' : 'primary'}
label={label}
onDelete={onDelete}
className={className}
variant="outlined"
color={columnNames[index].name === 'Company' ? 'secondary' : 'primary'}
label={label}
onDelete={onDelete}
/>);
};

const CustomTooltip = (props) => {
return (
<MuiTooltip
title={props.title}
interactive={true}
TransitionComponent={Fade}
TransitionProps={{ timeout: 250 }}
<MuiTooltip
title={props.title}
slots={{ transition: Fade }}
slotProps={{ transition: { timeout: 250 } }}
leaveDelay={250}>{props.children}</MuiTooltip>
);
};
Expand Down Expand Up @@ -72,31 +71,31 @@ class Example extends React.Component {
return false;
},
display: (filterList, onChange, index, column) => (
<Select
onChange={event => {
filterList[index][0] = event.target.value;
onChange(filterList[index], index, column);
}}
value={filterList[index]}
>
<MenuItem value="Test Corp">{'Test Corp'}</MenuItem>
<MenuItem value="Other Corp">{'Other Corp'}</MenuItem>
</Select>
<Select
onChange={event => {
filterList[index][0] = event.target.value;
onChange(filterList[index], index, column);
}}
value={filterList[index]}
>
<MenuItem value="Test Corp">{'Test Corp'}</MenuItem>
<MenuItem value="Other Corp">{'Other Corp'}</MenuItem>
</Select>
)
},
},
},
{ name: 'City', label: 'City Label', options: { filterList: ['Dallas'] } },
{ name: 'State' },
{
name: 'Empty',
options: {
empty: true,
filterType: 'checkbox',
{
name: 'Empty',
options: {
empty: true,
filterType: 'checkbox',
filterOptions: {
renderValue: (val) => (val ? val : '(Empty)')
}
}
}
},
];
const data = [
Expand All @@ -116,16 +115,16 @@ class Example extends React.Component {

return (
<MUIDataTable
title={"ACME Employee list"}
data={data}
columns={columns}
options={options}
components={{
TableFilterList: CustomFilterList,
Tooltip: CustomTooltip,
Checkbox: CustomCheckbox,
TableViewCol: TableViewCol
}}
title={"ACME Employee list"}
data={data}
columns={columns}
options={options}
components={{
TableFilterList: CustomFilterList,
Tooltip: CustomTooltip,
Checkbox: CustomCheckbox,
TableViewCol: TableViewCol
}}
/>
);

Expand Down
18 changes: 11 additions & 7 deletions examples/customize-footer/CustomFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,19 @@ class CustomFooter extends React.Component {
page={page}
labelRowsPerPage={textLabels.rowsPerPage}
labelDisplayedRows={({ from, to, count }) => `${from}-${to} ${textLabels.displayRows} ${count}`}
backIconButtonProps={{
'aria-label': textLabels.previous,
}}
nextIconButtonProps={{
'aria-label': textLabels.next,
slotProps={{
actions: {
previousButton: {
'aria-label': textLabels.previous,
},
nextButton: {
'aria-label': textLabels.next,
}
}
}}
rowsPerPageOptions={[10,20,100]}
onChangePage={this.handlePageChange}
onChangeRowsPerPage={this.handleRowChange}
onPageChange={this.handlePageChange}
onRowsPerPageChange={this.handleRowChange}
/>
</TableCell>
</TableRow>
Expand Down
2 changes: 1 addition & 1 deletion examples/customize-styling/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class Example extends React.Component {
},
setTableProps: () => {
return {
padding: this.state.denseTable ? 'none' : 'default',
padding: this.state.denseTable ? 'none' : 'normal',

// material ui v4 only
size: this.state.denseTable ? 'small' : 'medium',
Expand Down
5 changes: 3 additions & 2 deletions src/components/Popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ const Popover = ({ className, trigger, refExit, hide, content, ...providedProps
};

const triggerProps = {
key: 'content',
onClick: (event) => {
if (trigger.props.onClick) trigger.props.onClick();
handleClick(event);
Expand All @@ -54,7 +53,9 @@ const Popover = ({ className, trigger, refExit, hide, content, ...providedProps

return (
<>
<span {...triggerProps}>{trigger}</span>
<span key="content" {...triggerProps}>
{trigger}
</span>
<MuiPopover
elevation={2}
open={isOpen}
Expand Down
Loading