Skip to content

Commit

Permalink
Merge branch 'master' of github.com:material-table-core/core
Browse files Browse the repository at this point in the history
  • Loading branch information
Domino987 committed Mar 28, 2024
2 parents 6d5496a + 6c9c53f commit 7fd916a
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 11 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@
},
"dependencies": {
"@babel/runtime": "^7.19.0",
"@date-io/core": "^3.2.0",
"@date-io/date-fns": "^3.2.0",
"@date-io/core": "^3.0.0",
"@date-io/date-fns": "^3.0.0",
"@emotion/core": "^11.0.0",
"@emotion/react": "^11.10.4",
"@emotion/styled": "^11.10.4",
"@hello-pangea/dnd": "^16.0.0",
"@mui/icons-material": ">=5.15.5",
"@mui/material": ">=5.15.5",
"@mui/icons-material": ">=5.10.6",
"@mui/material": ">=5.11.12",
"@mui/x-date-pickers": "^6.19.0",
"classnames": "^2.3.2",
"date-fns": "^3.2.0",
Expand Down
2 changes: 1 addition & 1 deletion src/components/MTableEditField/DateField.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFnsV3';
import { TextField } from '@mui/material';
import { LocalizationProvider, DatePicker } from '@mui/x-date-pickers';

Expand Down
3 changes: 2 additions & 1 deletion src/components/MTableEditRow/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ function MTableEditRow(props) {
style={{
width: 42 * actions.length,
padding: '0px 5px',
...options.editCellStyle
...options.editCellStyle,
...options.actionsCellStyle
}}
>
<props.components.Actions
Expand Down
2 changes: 1 addition & 1 deletion src/components/MTableFilterRow/DateFilter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFnsV3';
import TextField from '@mui/material/TextField';
import { getLocalizedFilterPlaceHolder } from './utils';
import {
Expand Down
2 changes: 1 addition & 1 deletion src/components/m-table-edit-field.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import FormControl from '@mui/material/FormControl';
import FormHelperText from '@mui/material/FormHelperText';
import FormGroup from '@mui/material/FormGroup';
import FormControlLabel from '@mui/material/FormControlLabel';
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFnsV3';
import {
LocalizationProvider,
TimePicker,
Expand Down
14 changes: 11 additions & 3 deletions src/material-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -465,9 +465,15 @@ export default class MaterialTable extends React.Component {
(a) => a.tableData.id === orderBy
);
query.orderDirection = orderDirection;
console.warn(
'Properties orderBy and orderDirection had been deprecated when remote data, please start using orderByCollection instead'
);
/**
* THIS WILL NEED TO BE REMOVED EVENTUALLY.
* Warn consumer of deprecated prop.
*/
if (query.orderDirection !== undefined || query.orderBy !== undefined) {
console.warn(
'Properties orderBy and orderDirection had been deprecated when remote data, please start using orderByCollection instead'
);
}
query.orderByCollection = orderByCollection;
this.onQueryChange(query, () => {
this.props.onOrderChange &&
Expand Down Expand Up @@ -693,6 +699,8 @@ export default class MaterialTable extends React.Component {
this.dataManager.changeRowEditing(rowData);
this.setState(this.dataManager.getRenderState());
} else if (mode === 'delete') {
this.props.editable.onRowDeleteCancelled &&
this.props.editable.onRowDeleteCancelled(rowData);
this.dataManager.changeRowEditing(rowData);
this.setState(this.dataManager.getRenderState());
}
Expand Down
1 change: 1 addition & 0 deletions src/prop-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ export const propTypes = {
onRowUpdate: PropTypes.func,
onRowDelete: PropTypes.func,
onRowAddCancelled: PropTypes.func,
onRowDeleteCancelled: PropTypes.func,
onRowUpdateCancelled: PropTypes.func,
isEditHidden: PropTypes.func,
isDeleteHidden: PropTypes.func
Expand Down
1 change: 1 addition & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export interface MaterialTableProps<RowData extends object> {
editTooltip?: (rowData: RowData) => string;
deleteTooltip?: (rowData: RowData) => string;
onRowAddCancelled?: (rowData: RowData) => void;
onRowDeleteCancelled?: (rowData: RowData) => void;
onRowUpdateCancelled?: (rowData: RowData) => void;
isEditHidden?: (rowData: RowData) => boolean;
isDeleteHidden?: (rowData: RowData) => boolean;
Expand Down

0 comments on commit 7fd916a

Please sign in to comment.