diff --git a/__tests__/demo/demo-components/index.js b/__tests__/demo/demo-components/index.js index 2c8c9ffd..86a95b2b 100644 --- a/__tests__/demo/demo-components/index.js +++ b/__tests__/demo/demo-components/index.js @@ -5,6 +5,46 @@ import MaterialTable, { MTableBodyRow, MTableEditRow } from '../../../src'; // r export { default as EditableRowDateColumnIssue } from './EditableRowDateColumnIssue'; const global_data = [ + { name: 'Mehmet', surname: 'Baran', birthYear: 1987, birthCity: 63, id: 0 }, + { + name: 'Zerya Betül', + surname: 'Baran', + birthYear: 2017, + birthCity: 34, + id: 1 + }, + { name: 'Mehmet', surname: 'Baran', birthYear: 1987, birthCity: 63, id: 0 }, + { + name: 'Zerya Betül', + surname: 'Baran', + birthYear: 2017, + birthCity: 34, + id: 1 + }, + { name: 'Mehmet', surname: 'Baran', birthYear: 1987, birthCity: 63, id: 0 }, + { + name: 'Zerya Betül', + surname: 'Baran', + birthYear: 2017, + birthCity: 34, + id: 1 + }, + { name: 'Mehmet', surname: 'Baran', birthYear: 1987, birthCity: 63, id: 0 }, + { + name: 'Zerya Betül', + surname: 'Baran', + birthYear: 2017, + birthCity: 34, + id: 1 + }, + { name: 'Mehmet', surname: 'Baran', birthYear: 1987, birthCity: 63, id: 0 }, + { + name: 'Zerya Betül', + surname: 'Baran', + birthYear: 2017, + birthCity: 34, + id: 1 + }, { name: 'Mehmet', surname: 'Baran', birthYear: 1987, birthCity: 63, id: 0 }, { name: 'Zerya Betül', @@ -35,13 +75,21 @@ const global_data_CustomExport = [ ]; const global_cols = [ - { title: 'Name', field: 'name' }, - { title: 'Surname', field: 'surname' }, - { title: 'Birth Year', field: 'birthYear', type: 'numeric' }, + { title: 'Name', field: 'name', minWidth: 140, maxWidth: 400 }, + { title: 'Surname', field: 'surname', minWidth: 140, maxWidth: 400 }, + { + title: 'Birth Year', + field: 'birthYear', + type: 'numeric', + minWidth: 140, + maxWidth: 400 + }, { title: 'Birth Place', field: 'birthCity', - lookup: { 34: 'İstanbul', 63: 'Şanlıurfa' } + lookup: { 34: 'İstanbul', 63: 'Şanlıurfa' }, + minWidth: 140, + maxWidth: 400 } ]; @@ -553,7 +601,8 @@ export function Resizable() { data={global_data} options={{ columnResizable: true, - tableLayout: 'fixed' + tableLayout: 'fixed', + paging: true }} /> ); diff --git a/material-table-core-3.1.0.tgz b/material-table-core-3.1.0.tgz new file mode 100644 index 00000000..f49bc543 Binary files /dev/null and b/material-table-core-3.1.0.tgz differ diff --git a/src/components/MTableHeader/index.js b/src/components/MTableHeader/index.js index f5a9246b..bd37e94b 100644 --- a/src/components/MTableHeader/index.js +++ b/src/components/MTableHeader/index.js @@ -40,7 +40,8 @@ export function MTableHeader({ onColumnResized, ...props }) { let currentWidth = th && +window.getComputedStyle(th).width.slice(0, -2); let realWidth = currentWidth - - resizingColumnDef.tableData.additionalWidth - + resizingColumnDef.tableData.additionalWidth + + lastAdditionalWidth - lastX + e.clientX; if (realWidth <= resizingColumnDef.minWidth && realWidth < currentWidth) diff --git a/src/components/m-table-body-row.js b/src/components/m-table-body-row.js index 40dc5494..72a47ead 100644 --- a/src/components/m-table-body-row.js +++ b/src/components/m-table-body-row.js @@ -182,7 +182,6 @@ export default function MTableBodyRow(props) { onClick={(e) => e.stopPropagation()} value={props.data.tableData.id.toString()} onChange={(event) => { - console.log('call'); props.onRowSelected(event, props.path, props.data); }} style={styles}