Skip to content

Commit

Permalink
1.2 release
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinVandy committed Sep 27, 2022
1 parent 1773134 commit 649bb41
Show file tree
Hide file tree
Showing 74 changed files with 1,619 additions and 118 deletions.
Expand Up @@ -15,7 +15,7 @@
"@mui/material": "^5.10.6",
"@mui/x-date-pickers": "^5.0.2",
"dayjs": "^1.11.5",
"material-react-table": "^1.1.1",
"material-react-table": "^1.2.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Expand Up @@ -13,7 +13,7 @@
"@emotion/styled": "^11.10.4",
"@mui/icons-material": "^5.10.6",
"@mui/material": "^5.10.6",
"material-react-table": "^1.1.1",
"material-react-table": "^1.2.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Expand Up @@ -13,7 +13,7 @@
"@emotion/styled": "^11.10.4",
"@mui/icons-material": "^5.10.6",
"@mui/material": "^5.10.6",
"material-react-table": "^1.1.1",
"material-react-table": "^1.2.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Expand Up @@ -13,7 +13,7 @@
"@emotion/styled": "^11.10.4",
"@mui/icons-material": "^5.10.6",
"@mui/material": "^5.10.6",
"material-react-table": "^1.1.1",
"material-react-table": "^1.2.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
18 changes: 18 additions & 0 deletions material-react-table-docs/examples/column-actions-space/index.tsx
@@ -0,0 +1,18 @@
import React from 'react';
import { SourceCodeSnippet } from '../../components/mdx/SourceCodeSnippet';
import Example from './sandbox/src/TS';
const JS = require('!!raw-loader!./sandbox/src/JS.js').default;
const TS = require('!!raw-loader!./sandbox/src/TS.tsx').default;

const ExampleTable = () => {
return (
<SourceCodeSnippet
Component={Example}
javaScriptCode={JS}
typeScriptCode={TS}
tableId="column-actions-space"
/>
);
};

export default ExampleTable;
@@ -0,0 +1,5 @@
node_modules
.DS_Store
dist
dist-ssr
*.local
@@ -0,0 +1,6 @@
# Example

To run this example:

- `npm install` or `yarn`
- `npm run start` or `yarn start`
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Material React Table Example</title>
</head>

<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
@@ -0,0 +1,27 @@
{
"name": "material-react-table-example-column-actions-space",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "vite --port 3001",
"build": "vite build",
"serve": "vite preview",
"start": "vite"
},
"dependencies": {
"@emotion/react": "^11.10.4",
"@emotion/styled": "^11.10.4",
"@mui/icons-material": "^5.10.6",
"@mui/material": "^5.10.6",
"material-react-table": "^1.2.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/react": "^18.0.20",
"@types/react-dom": "^18.0.6",
"@vitejs/plugin-react": "^2.1.0",
"typescript": "^4.8.3",
"vite": "^3.1.3"
}
}
@@ -0,0 +1,54 @@
import React, { useMemo } from 'react';
import MaterialReactTable from 'material-react-table';

const data =
//data definitions...
[
{
id: 1,
firstName: 'Dillon',
lastName: 'Howler',
},
{
id: 2,
firstName: 'Ross',
lastName: 'Everest',
},
]; //end

const Example = () => {
const columns = useMemo(
//column definitions...
() => [
{
accessorKey: 'id',
header: 'ID',
},
{
accessorKey: 'firstName',
header: 'First Name',
},
{
accessorKey: 'lastName',
header: 'Last Name',
},
],
[], //end
);

return (
<MaterialReactTable
columns={columns}
data={data}
muiTableHeadCellProps={{
sx: {
'& .Mui-TableHeadCell-Content': {
justifyContent: 'space-between',
},
},
}}
/>
);
};

export default Example;
@@ -0,0 +1,54 @@
import React, { FC, useMemo } from 'react';
import MaterialReactTable, { MRT_ColumnDef } from 'material-react-table';

const data =
//data definitions...
[
{
id: 1,
firstName: 'Dillon',
lastName: 'Howler',
},
{
id: 2,
firstName: 'Ross',
lastName: 'Everest',
},
]; //end

const Example: FC = () => {
const columns = useMemo<MRT_ColumnDef<typeof data[0]>[]>(
//column definitions...
() => [
{
accessorKey: 'id',
header: 'ID',
},
{
accessorKey: 'firstName',
header: 'First Name',
},
{
accessorKey: 'lastName',
header: 'Last Name',
},
],
[], //end
);

return (
<MaterialReactTable
columns={columns}
data={data}
muiTableHeadCellProps={{
sx: {
'& .Mui-TableHeadCell-Content': {
justifyContent: 'space-between',
},
},
}}
/>
);
};

export default Example;
@@ -0,0 +1,9 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import Example from './TS';

ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
<React.StrictMode>
<Example />
</React.StrictMode>,
);
@@ -0,0 +1 @@
/// <reference types="vite/client" />
@@ -0,0 +1,31 @@
{
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"lib": [
"DOM",
"DOM.Iterable",
"ESNext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "Node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
},
"include": [
"src"
],
"references": [
{
"path": "./tsconfig.node.json"
}
]
}
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"composite": true,
"module": "ESNext",
"moduleResolution": "Node"
},
"include": ["vite.config.ts"]
}
@@ -0,0 +1,7 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
});

2 comments on commit 649bb41

@vercel
Copy link

@vercel vercel bot commented on 649bb41 Sep 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 649bb41 Sep 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.