Skip to content

Commit

Permalink
revert demo changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Domino987 committed Jan 13, 2023
1 parent 5590bad commit 6fd5708
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 25 deletions.
42 changes: 18 additions & 24 deletions __tests__/demo/demo-components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1154,33 +1154,27 @@ const TREE_COLUMNS = [
}
];
export function TreeData() {
const words = ['Paper', 'Rock', 'Scissors'];

const rawData = [];
for (let i = 0; i < 10; i++) {
rawData.push({ id: i, word: words[i % words.length] });
}

const columns = [
{ title: 'Id', field: 'id' },
{ title: 'Word', field: 'word' }
];
const [path, setPath] = useState();
const myTableRef = useRef(null);
return (
<MaterialTable
parentChildData={(row, rows) => rows.find((a) => a.id === row.parentId)}
data={[
...rawData,
{ id: 11, word: 'test', parentId: 0 },
{ id: 12, word: 'test', parentId: 1 }
]}
columns={columns}
options={{
selection: true
}}
/>
<React.Fragment>
<MaterialTable
tableRef={myTableRef}
data={TREE_DATA}
columns={TREE_COLUMNS}
parentChildData={(row, rows) => rows.find((a) => a.id === row.parentId)}
onRowClick={(e, rowData) => {
setPath(rowData.tableData.path);
myTableRef.current.onTreeExpandChanged(
rowData.tableData.path,
rowData
);
}}
/>
<pre>{JSON.stringify(path)}</pre>
</React.Fragment>
);
}

export function TableWithSummary() {
return (
<MaterialTable
Expand Down
67 changes: 67 additions & 0 deletions __tests__/demo/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ root.render(
<StyledEngineProvider injectFirst>
<ThemeProvider theme={createTheme()}>
<h1>DetailPanelRemounting</h1>
<DetailPanelRemounting />
{/* <h1>Switcher</h1>
<DataSwitcher />
Expand Down Expand Up @@ -90,8 +91,74 @@ root.render(
<h1>Custom Export </h1>
<CustomExport />
*/}
<h1>Bulk Edit</h1>
<BulkEdit />
<h1>Default Order Issue</h1>
<DefaultOrderIssue />
<h1>Bulk Edit With Detail Panel</h1>
<BulkEditWithDetailPanel />
<h1>Hiding Columns</h1>
<HidingColumns />
<h1>TestingNewActionHandlersProp</h1>
<TestingNewActionHandlersProp />
<h1>Editable Rows</h1>
<EditableRow />
<h1>One Detail Panel</h1>
<OneDetailPanel />
<h1>Multiple Detail Panels</h1>
<MultipleDetailPanels />
<h1>Editable</h1>
<EditableCells />
<h1>Frankenstein</h1>
<FrankensteinDemo />
<h1>Resizable Columns</h1>
<Resizable />
<h1>Persistent Groupings</h1>
<PersistentGroupings persistentGroupingsId="persistence-id" />
<h1>Persistent Groupings Same ID</h1>
<PersistentGroupings persistentGroupingsId="persistence-id" />
<h1>Persistent Groupings unshared</h1>
<PersistentGroupings persistentGroupingsId="some-other-id" />
<h1>Tree data</h1>
<TreeData />
<h1>Table with Summary Row</h1>
<TableWithSummary />
<h1>
Table with custom numbers of pages around current page in stepped
navigation
</h1>
<TableWithNumberOfPagesAround />
<h1>Fixed Column with Row Edits</h1>
<FixedColumnWithEdit />
<h1>Remote Data Related</h1>
<ol>
<li>
<h3>
mbrn{' '}
<a href="https://github.com/mbrn/material-table/issues/1353">
#1353
</a>
</h3>
<I1353 />
</li>
<li>
<h3>
mbrn{' '}
<a href="https://github.com/mbrn/material-table/issues/1941">
#1941
</a>
</h3>
<I1941 />
</li>
<li>
<h3>
<a href="https://github.com/material-table-core/core/issues/122">
#122
</a>
</h3>
<I122 />
</li>
</ol>
</ThemeProvider>
</StyledEngineProvider>
</StrictMode>
Expand Down
1 change: 0 additions & 1 deletion src/components/MTableHeader/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,6 @@ export function MTableHeader({
{ ...props, options },
props.treeDataMaxLevel
);
console.log(props);
return (
<TableCell
padding="none"
Expand Down

0 comments on commit 6fd5708

Please sign in to comment.