Skip to content

Commit

Permalink
Merge branch 'v2' into fix-undefined-filter-type
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinVandy committed Oct 4, 2023
2 parents e969a09 + 31078bf commit c944e22
Show file tree
Hide file tree
Showing 462 changed files with 48,992 additions and 38,601 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ body:
attributes:
label: Minimal, Reproducible Example - (Optional, but Recommended)
description: |
Please add a link to a minimal reproduction. This can really speed up the diagnosis of the problem! A Code Sandbox is preferable, but simple code snippets are also acceptable here. Feel free to fork any of the official CodeSandbox examples: https://github.com/KevinVandy/material-react-table/tree/main/apps/material-react-table-docs/examples
Please add a link to a minimal reproduction. This can really speed up the diagnosis of the problem! A Code Sandbox is preferable, but simple code snippets are also acceptable here. Feel free to fork any of the official CodeSandbox examples: https://github.com/KevinVandy/material-react-table/tree/v2/apps/material-react-table-docs/examples
placeholder: |
e.g. Code Sandbox, Stackblitz, or relevant code snippets.
validations:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Upgrade Example Versions
on:
push:
branches:
- 'main'
- 'v2'
paths:
- 'packages/material-react-table/package.json'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Clean PR
on:
pull_request:
branches:
- main
- v2

jobs:
clean-pr:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ View [Documentation](https://www.material-react-table.com/)
<a href="https://star-history.com/#kevinvandy/material-react-table&Date" target="_blank">
<img alt="" src="https://badgen.net/github/stars/KevinVandy/material-react-table?color=blue" />
</a>
<a href="https://github.com/KevinVandy/material-react-table/blob/main/LICENSE" target="_blank">
<a href="https://github.com/KevinVandy/material-react-table/blob/v2/LICENSE" target="_blank">
<img alt="" src="https://badgen.net/github/license/KevinVandy/material-react-table?color=blue" />
</a>
<a href="http://makeapullrequest.com" target="_blank">
Expand Down Expand Up @@ -193,6 +193,6 @@ _Open in [Code Sandbox](https://codesandbox.io/s/simple-material-react-table-exa

PRs are Welcome, but please discuss in [GitHub Discussions](https://github.com/KevinVandy/material-react-table/discussions) or the [Discord Server](https://discord.gg/5wqyRx6fnm) first if it is a large change!

Read the [Contributing Guide](https://github.com/KevinVandy/material-react-table/blob/main/CONTRIBUTING.md) to learn how to run this project locally.
Read the [Contributing Guide](https://github.com/KevinVandy/material-react-table/blob/v2/CONTRIBUTING.md) to learn how to run this project locally.

<!-- Use the FORCE, Luke! -->
16 changes: 16 additions & 0 deletions apps/material-react-table-docs/components/mdx/AnchorLink.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Link as MuiLink } from '@mui/material';
import Link from 'next/link';

export const AnchorLink = (props) => {
return (
<Link href={props.href} passHref legacyBehavior>
<MuiLink
target={props.href.startsWith('http') ? '_blank' : undefined}
rel="noopener"
{...props}
>
{props.children}
</MuiLink>
</Link>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ export const FeatureTable = () => {
enableColumnActions={false}
enableBottomToolbar={false}
enableTopToolbar={false}
enablePinning
enableColumnPinning
initialState={{
sorting: [{ id: 'feature', desc: false }],
density: 'compact',
Expand Down
255 changes: 204 additions & 51 deletions apps/material-react-table-docs/components/mdx/HomeCards.tsx
Original file line number Diff line number Diff line change
@@ -1,60 +1,213 @@
import { alpha, Card, Stack, Typography } from '@mui/material';
import { Box, Card, Stack, Typography } from '@mui/material';
import Image from 'next/image';

const cardData = [
{
text: 'High-quality and performant modern data grid features with a minimal amount of effort',
image: '/quality.svg',
alt: 'Quality',
},
{
text: 'Great defaults, with customization treated as a top priority',
image: '/customizable.svg',
alt: 'Customizable',
},
{
text: 'Easy to opt out of features or UI that you do not need',
image: '/opt-out.svg',
alt: 'Easy Opt-out',
},
{
text: 'Efficient bundle size (47kb minzipped, including dependencies)',
image: '/efficient.svg',
alt: 'Efficient',
},
];
import { AnchorLink } from './AnchorLink';

export const HomeCards = () => {
return (
<Stack sx={{ mt: '1rem', gap: '1rem' }}>
{cardData.map((cd, index) => (
<Card
key={index}
sx={(theme) => ({
alignItems: 'center',
backgroundColor: alpha(theme.palette.primary.main, 0.1),
display: 'flex',
gap: '1.5rem',
p: '1rem',
})}
variant="outlined"
<Box
sx={{
marginTop: '3rem',
gap: '1rem',
display: 'grid',
gridTemplateColumns: '2fr 1fr',
h3: {
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
textAlign: 'center',
marginBottom: '1rem',
gap: '0.75rem',
},
'@media (max-width: 1024px)': {
gridTemplateColumns: '1fr',
},
}}
>
<Stack sx={{ display: 'grid', gap: '1rem' }}>
<Box
sx={{
display: 'grid',
gridTemplateColumns: '1fr 1fr',
gap: '1rem',
'@media (max-width: 768px)': {
gridTemplateColumns: '1fr',
},
}}
>
<Card sx={{ p: '1rem' }}>
<Typography variant="h3">The Best of Both Worlds</Typography>
<Box
sx={{
display: 'flex',
justifyContent: 'center',
margin: '1rem auto',
}}
>
<Image
alt="Mui + React Table"
src={`/banner.png`}
height={60}
width={256}
/>
</Box>
<Typography>
Combine TanStack Table&apos;s Extensive API With Material
UI&apos;s Awesome Pre-Built Components!
</Typography>
</Card>
<Card sx={{ p: '1rem' }}>
<Typography variant="h3">
<Image
alt="Efficiency Icon"
height={24}
width={24}
src={'/efficient.svg'}
/>{' '}
Efficient Bundle Size
</Typography>
<Typography>33-47 KB depending on components imported.</Typography>
<Typography>
Import the recommended <code>MaterialReactTable</code> component,
or optionally import lighter weight MRT sub-components that only
include the UI you need.
</Typography>
</Card>
</Box>
<Box
sx={{
display: 'grid',
gridTemplateColumns: '1fr 1fr',
gap: '1rem',
'@media (max-width: 768px)': {
gridTemplateColumns: '1fr',
},
}}
>
<Image src={cd.image} alt={cd.text} height={50} width={50} />
<Typography
sx={{
fontSize: {
xs: '0.875rem',
sm: '1rem',
md: '1.1rem',
lg: '1.2rem',
},
fontWeight: 'bold',
}}
>
{cd.text}
<Card sx={{ p: '1rem' }}>
<Typography variant="h3">
<Image
alt="Quality Icon"
height={24}
width={24}
src={'/customizable.svg'}
/>{' '}
Pre-Built or 100% Custom
</Typography>
<Typography>
Use the pre-built single component data grid with the{' '}
<code>&lt;MaterialReactTable /&gt;</code> component.
</Typography>
<Typography>
Or build your own markup from scratch using the{' '}
<code>useMaterialReactTable</code> hook.
</Typography>
<Typography>
All internal MRT components are exported for you to use as
&quot;lego blocks&quot; to build your own custom tables.
</Typography>
</Card>
<Card sx={{ p: '1rem' }}>
<Typography variant="h3">
<Image
alt="Customizable Icon"
height={24}
width={24}
src={`/source-code.svg`}
/>{' '}
Easy Customization
</Typography>
<Typography>
Just about everything is customizable or overridable in Material
React Table. Pass in custom props or styles to all internal
components. Use simple <code>enable*</code> props to easily enable
or disable features.
</Typography>
</Card>
</Box>
</Stack>
<Stack sx={{ display: 'grid', gap: '1rem' }}>
<Card sx={{ p: '1rem' }}>
<Typography variant="h3">
<Image
alt="Quality Icon"
height={24}
width={24}
src={`/quality.svg`}
/>{' '}
Powerful Features
</Typography>
<Typography>
Material React Table has most of the features you would expect from
a modern table library including{' '}
<AnchorLink href="/docs/guides/pagination">Pagination</AnchorLink>,{' '}
<AnchorLink href="/docs/guides/sorting">Sorting</AnchorLink>,{' '}
<AnchorLink href="/docs/guides/column-filtering">
Filtering
</AnchorLink>
,{' '}
<AnchorLink href="/docs/guides/row-selection">
Row Selection
</AnchorLink>
,{' '}
<AnchorLink href="/docs/guides/expanding-sub-rows">
Row Expansion
</AnchorLink>
,{' '}
<AnchorLink href="/docs/guides/column-resizing">
Column Resizing
</AnchorLink>
,{' '}
<AnchorLink href="/docs/guides/column-ordering-dnd">
Column Reordering
</AnchorLink>
, etc.
</Typography>
<Typography>
However, Material React Table also has advanced features that you
may not find in other table libraries such as{' '}
<AnchorLink href="/docs/guides/virtualization">
Virtualization
</AnchorLink>
,{' '}
<AnchorLink href="/docs/guides/aggregation-and-grouping">
Aggregation and Grouping
</AnchorLink>
,{' '}
<AnchorLink href="/docs/examples/advanced">
Advanced Filter UIs
</AnchorLink>
,{' '}
<AnchorLink href="/docs/guides/global-filtering">
Fuzzy Search
</AnchorLink>
,{' '}
<AnchorLink href="/docs/guides/editing">
Full Editing (CRUD)
</AnchorLink>
,{' '}
<AnchorLink href="/docs/guides/column-pinning">
Column Pinning
</AnchorLink>
,{' '}
<AnchorLink href="/docs/guides/row-numbers">Row Numbers</AnchorLink>
,{' '}
<AnchorLink href="/docs/guides/click-to-copy">
Click to Copy
</AnchorLink>
, and more.
</Typography>
</Card>
<Card sx={{ p: '1rem' }}>
<Typography variant="h3">30+ i18n Locales</Typography>
<Typography>
The MRT Community has contributed{' '}
<AnchorLink href="/docs/guides/localization">
over&nbsp;30&nbsp;Locales
</AnchorLink>{' '}
for everyone to import and use.
</Typography>
</Card>
))}
</Stack>
</Stack>
</Box>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { SampleCodeSnippet } from './SampleCodeSnippet';
type Tab = 'npm' | 'pnpm' | 'yarn';

const defaultPackagesString =
'material-react-table @mui/material @mui/x-date-pickers @mui/icons-material @emotion/react @emotion/styled';
'material-react-table@alpha @mui/material @mui/x-date-pickers @mui/icons-material @emotion/react @emotion/styled';

export const InstallCommand = ({
packagesString = defaultPackagesString,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export const SourceCodeSnippet = ({
<Button
color="success"
endIcon={<LaunchIcon />}
href={`https://stackblitz.com/github/KevinVandy/material-react-table/tree/main/apps/material-react-table-docs/examples/${tableId}/sandbox?file=src/TS.tsx`}
href={`https://stackblitz.com/github/KevinVandy/material-react-table/tree/v2/apps/material-react-table-docs/examples/${tableId}/sandbox?file=src/TS.tsx`}
onClick={() => plausible('open-stackblitz')}
rel="noopener"
startIcon={<ElectricBoltIcon />}
Expand All @@ -151,7 +151,7 @@ export const SourceCodeSnippet = ({
<Button
color="warning"
endIcon={<LaunchIcon />}
href={`https://codesandbox.io/s/github/KevinVandy/material-react-table/tree/main/apps/material-react-table-docs/examples/${tableId}/sandbox?file=/src/TS.tsx`}
href={`https://codesandbox.io/s/github/KevinVandy/material-react-table/tree/v2/apps/material-react-table-docs/examples/${tableId}/sandbox?file=/src/TS.tsx`}
onClick={() => plausible('open-code-sandbox')}
rel="noopener"
startIcon={<CodeIcon />}
Expand All @@ -164,7 +164,7 @@ export const SourceCodeSnippet = ({
<Button
color="info"
endIcon={<LaunchIcon />}
href={`https://github.com/KevinVandy/material-react-table/tree/main/apps/material-react-table-docs/examples/${tableId}/sandbox/src/${
href={`https://github.com/KevinVandy/material-react-table/tree/v2/apps/material-react-table-docs/examples/${tableId}/sandbox/src/${
codeTab === 'ts'
? 'TS.tsx'
: codeTab === 'js'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const StatBadges = () => {
/>
</a>
<a
href="https://github.com/KevinVandy/material-react-table/blob/main/LICENSE"
href="https://github.com/KevinVandy/material-react-table/blob/v2/LICENSE"
target="_blank"
rel="noopener"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const Footer = () => {
color="secondary"
endIcon={<GitHub />}
startIcon={<Edit />}
href={`https://github.com/KevinVandy/material-react-table/edit/main/apps/material-react-table-docs/pages${pathname}${
href={`https://github.com/KevinVandy/material-react-table/edit/v2/apps/material-react-table-docs/pages${pathname}${
['/'].includes(pathname)
? 'index.tsx'
: ['/docs', '/docs/api', '/docs/examples', '/docs/guides'].includes(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export const routes: Array<RouteItem> = [
label: 'Event Listeners (onClicks)',
},
{
href: '/docs/guides/table-state-management',
href: '/docs/guides/state-management',
label: 'State Management',
},
{
Expand Down

0 comments on commit c944e22

Please sign in to comment.