Skip to content

Commit e75d2fe

Browse files
committed
3.5.0 prep
1 parent 06de5bb commit e75d2fe

File tree

7 files changed

+79
-61
lines changed

7 files changed

+79
-61
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@ class CustomDataTable extends React.Component {
417417
Supported customizable components:
418418
* `Checkbox` - A special 'data-description' prop lets you differentiate checkboxes [Example](https://github.com/gregnb/mui-datatables/blob/master/examples/custom-components/index.js). Valid values: ['row-select', 'row-select-header', 'table-filter', 'table-view-col'].The dataIndex is also passed via the "data-index" prop.
419419
* `ExpandButton` [Example](https://github.com/gregnb/mui-datatables/blob/master/examples/expandable-rows/index.js)
420+
* `DragDropBackend`
420421
* `TableBody`
421422
* `TableViewCol` - The component that displays the view/hide list of columns on the toolbar.
422423
* `TableFilterList` - You can pass `ItemComponent` prop to render custom filter list item.

examples/text-localization/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class Example extends React.Component {
5151
},
5252
pagination:{
5353
next: "Following page",
54-
privous: "Preceding page"
54+
previous: "Preceding page"
5555
},
5656
filter: {
5757
all: "All Records",

package-lock.json

Lines changed: 39 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mui-datatables",
3-
"version": "3.4.1",
3+
"version": "3.5.0",
44
"description": "Datatables for React using Material-UI",
55
"main": "dist/index.js",
66
"files": [

src/MUIDataTable.js

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@ class MUIDataTable extends React.Component {
276276
this.draggableHeadCellRefs = {};
277277
this.resizeHeadCellRefs = {};
278278
this.timers = {};
279-
this.setHeadResizeable = () => { };
280-
this.updateDividers = () => { };
279+
this.setHeadResizeable = () => {};
280+
this.updateDividers = () => {};
281281

282282
let defaultState = {
283283
activeColumn: null,
@@ -450,12 +450,12 @@ class MUIDataTable extends React.Component {
450450
) {
451451
this.warnDep(
452452
this.options.responsive +
453-
' has been deprecated, but will still work in version 3.x. Please use string option: standard | vertical | simple. More info: https://github.com/gregnb/mui-datatables/tree/master/docs/v2_to_v3_guide.md',
453+
' has been deprecated, but will still work in version 3.x. Please use string option: standard | vertical | simple. More info: https://github.com/gregnb/mui-datatables/tree/master/docs/v2_to_v3_guide.md',
454454
);
455455
} else {
456456
this.warnInfo(
457457
this.options.responsive +
458-
' is not recognized as a valid input for responsive option. Please use string option: standard | vertical | simple. More info: https://github.com/gregnb/mui-datatables/tree/master/docs/v2_to_v3_guide.md',
458+
' is not recognized as a valid input for responsive option. Please use string option: standard | vertical | simple. More info: https://github.com/gregnb/mui-datatables/tree/master/docs/v2_to_v3_guide.md',
459459
);
460460
}
461461
}
@@ -674,19 +674,19 @@ class MUIDataTable extends React.Component {
674674

675675
const transformedData = Array.isArray(data[0])
676676
? data.map(row => {
677-
let i = -1;
677+
let i = -1;
678678

679-
return columns.map(col => {
680-
if (!col.empty) i++;
681-
return col.empty ? undefined : row[i];
682-
});
683-
})
679+
return columns.map(col => {
680+
if (!col.empty) i++;
681+
return col.empty ? undefined : row[i];
682+
});
683+
})
684684
: data.map(row => columns.map(col => leaf(row, col.name)));
685685

686686
return transformedData;
687687
};
688688

689-
setTableData(props, status, dataUpdated, callback = () => { }, fromConstructor = false) {
689+
setTableData(props, status, dataUpdated, callback = () => {}, fromConstructor = false) {
690690
let tableData = [];
691691
let { columns, filterData, filterList, columnOrder } = this.buildColumns(
692692
props.columns,
@@ -974,8 +974,8 @@ class MUIDataTable extends React.Component {
974974
typeof funcResult === 'string' || !funcResult
975975
? funcResult
976976
: funcResult.props && funcResult.props.value
977-
? funcResult.props.value
978-
: columnValue;
977+
? funcResult.props.value
978+
: columnValue;
979979

980980
displayRow.push(columnDisplay);
981981
} else {
@@ -1369,13 +1369,13 @@ class MUIDataTable extends React.Component {
13691369
displayData: this.options.serverSide
13701370
? prevState.displayData
13711371
: this.getDisplayData(
1372-
prevState.columns,
1373-
prevState.data,
1374-
filterList,
1375-
prevState.searchText,
1376-
null,
1377-
this.props,
1378-
),
1372+
prevState.columns,
1373+
prevState.data,
1374+
filterList,
1375+
prevState.searchText,
1376+
null,
1377+
this.props,
1378+
),
13791379
};
13801380
},
13811381
() => {
@@ -1427,13 +1427,13 @@ class MUIDataTable extends React.Component {
14271427
displayData: this.options.serverSide
14281428
? prevState.displayData
14291429
: this.getDisplayData(
1430-
prevState.columns,
1431-
prevState.data,
1432-
filterList,
1433-
prevState.searchText,
1434-
null,
1435-
this.props,
1436-
),
1430+
prevState.columns,
1431+
prevState.data,
1432+
filterList,
1433+
prevState.searchText,
1434+
null,
1435+
this.props,
1436+
),
14371437
previousSelectedRow: null,
14381438
};
14391439
},
@@ -1989,7 +1989,7 @@ class MUIDataTable extends React.Component {
19891989
)}
19901990
{(() => {
19911991
const components = (
1992-
<MuiTable
1992+
<MuiTable
19931993
ref={el => (this.tableRef = el)}
19941994
tabIndex={'0'}
19951995
role={'grid'}
@@ -2050,7 +2050,9 @@ class MUIDataTable extends React.Component {
20502050
);
20512051
if (DragDropBackend) {
20522052
return (
2053-
<DndProvider backend={DragDropBackend} {...dndProps}>{components}</DndProvider>
2053+
<DndProvider backend={DragDropBackend} {...dndProps}>
2054+
{components}
2055+
</DndProvider>
20542056
);
20552057
}
20562058

src/components/TableHeadCell.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ const TableHeadCell = ({
118118
...(ariaSortDirection ? { direction: sortDirection } : {}),
119119
};
120120

121-
const [{ opacity }, dragRef, preview] = isDraggingEnabled()? useDrag({
121+
const [{ opacity }, dragRef, preview] = useDrag({
122122
item: {
123123
type: 'HEADER',
124124
colIndex: index,
@@ -140,9 +140,9 @@ const TableHeadCell = ({
140140
opacity: monitor.isDragging() ? 1 : 0,
141141
};
142142
},
143-
}) : [{}];
143+
});
144144

145-
const [drop] = isDraggingEnabled()? useColumnDrop({
145+
const [drop] = useColumnDrop({
146146
drop: (item, mon) => {
147147
setSortTooltipOpen(false);
148148
setHintTooltipOpen(false);
@@ -157,7 +157,7 @@ const TableHeadCell = ({
157157
tableRef: tableRef ? tableRef() : null,
158158
tableId: tableId || 'none',
159159
timers,
160-
}) : [];
160+
});
161161

162162
const cellClass = clsx({
163163
[classes.root]: true,

src/components/TablePagination.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ function TablePagination(props) {
8080
id: 'pagination-back',
8181
'data-testid': 'pagination-back',
8282
'aria-label': textLabels.previous,
83-
title: textLabels.previous,
83+
title: textLabels.previous || '',
8484
}}
8585
nextIconButtonProps={{
8686
id: 'pagination-next',
8787
'data-testid': 'pagination-next',
8888
'aria-label': textLabels.next,
89-
title: textLabels.next,
89+
title: textLabels.next || '',
9090
}}
9191
SelectProps={{
9292
id: 'pagination-input',

0 commit comments

Comments
 (0)