Skip to content

Commit

Permalink
filterselectoptions prop any value
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinVandy committed Aug 30, 2022
1 parent 0d07be7 commit 8118164
Show file tree
Hide file tree
Showing 43 changed files with 93 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ const ColumnOptionsTable: FC<Props> = ({ onlyProps }) => {
header: 'Column Option',
muiTableBodyCellCopyButtonProps: ({ cell }) => ({
className: 'column-option',
component: 'a',
// component: 'a',
id: `${cell.getValue<string>()}-column-option`,
href: `#${cell.getValue<string>()}-column-option`,
// href: `#${cell.getValue<string>()}-column-option`,
}),
Cell: ({ cell, row }) =>
row.original?.required ? (
Expand Down Expand Up @@ -85,7 +85,7 @@ const ColumnOptionsTable: FC<Props> = ({ onlyProps }) => {
if (typeof window !== 'undefined') {
if (isDesktop) {
setColumnPinning({
left: ['mrt-row-numbers', 'mrt-row-expand', 'columnOption'],
left: ['mrt-row-expand', 'mrt-row-numbers', 'columnOption'],
right: ['link'],
});
} else {
Expand All @@ -107,6 +107,14 @@ const ColumnOptionsTable: FC<Props> = ({ onlyProps }) => {
<MaterialReactTable
columns={columns}
data={data}
displayColumnDefOptions={{
'mrt-row-numbers': {
size: 10,
},
'mrt-row-expand': {
size: 10,
},
}}
enableColumnActions={!onlyProps}
enableColumnFilterModes
enableColumnOrdering={!onlyProps}
Expand Down Expand Up @@ -137,8 +145,10 @@ const ColumnOptionsTable: FC<Props> = ({ onlyProps }) => {
}}
positionGlobalFilter="left"
renderDetailPanel={({ row }) => (
<Typography>
{row.original.description ?? 'No Description Provided... Yet...'}
<Typography
color={row.original.description ? 'secondary.main' : 'text.secondary'}
>
{row.original.description || 'No Description Provided... Yet...'}
</Typography>
)}
rowNumberMode="static"
Expand Down
27 changes: 21 additions & 6 deletions material-react-table-docs/components/prop-tables/RootPropTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import MaterialReactTable, {
MaterialReactTableProps,
MRT_ColumnDef,
} from 'material-react-table';
import { Link as MuiLink, Typography, useMediaQuery, useTheme } from '@mui/material';
import {
Link as MuiLink,
Typography,
useMediaQuery,
useTheme,
} from '@mui/material';
import { PropRow, rootProps } from './rootProps';

interface Props {
Expand All @@ -24,9 +29,9 @@ const RootPropTable: FC<Props> = ({ onlyProps }) => {
accessorKey: 'propName',
muiTableBodyCellCopyButtonProps: ({ cell }) => ({
className: 'prop',
component: 'a',
// component: 'a',
id: `${cell.getValue<string>()}-prop`,
href: `#${cell.getValue<string>()}-prop`,
// href: `#${cell.getValue<string>()}-prop`,
}),
Cell: ({ cell, row }) =>
row.original?.required ? (
Expand Down Expand Up @@ -83,7 +88,7 @@ const RootPropTable: FC<Props> = ({ onlyProps }) => {
if (typeof window !== 'undefined') {
if (isDesktop) {
setColumnPinning({
left: ['mrt-row-numbers', 'propName'],
left: ['mrt-row-expand', 'mrt-row-numbers', 'propName'],
right: ['link'],
});
} else {
Expand All @@ -103,6 +108,14 @@ const RootPropTable: FC<Props> = ({ onlyProps }) => {
<MaterialReactTable
columns={columns}
data={data}
displayColumnDefOptions={{
'mrt-row-numbers': {
size: 10,
},
'mrt-row-expand': {
size: 10,
},
}}
enableColumnActions={!onlyProps}
enableColumnFilterModes
enableColumnOrdering={!onlyProps}
Expand Down Expand Up @@ -131,8 +144,10 @@ const RootPropTable: FC<Props> = ({ onlyProps }) => {
}}
positionGlobalFilter="left"
renderDetailPanel={({ row }) => (
<Typography>
{row.original.description ?? 'No Description Provided... Yet...'}
<Typography
color={row.original.description ? 'secondary.main' : 'text.secondary'}
>
{row.original.description || 'No Description Provided... Yet...'}
</Typography>
)}
rowNumberMode="static"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ const StateOptionsTable: FC<Props> = ({ onlyProps }) => {
header: 'State Option',
muiTableBodyCellCopyButtonProps: ({ cell }) => ({
className: 'state-option',
component: 'a',
// component: 'a',
id: `${cell.getValue<string>()}-state-option`,
href: `#${cell.getValue<string>()}-state-option`,
// href: `#${cell.getValue<string>()}-state-option`,
}),
Cell: ({ cell }) => cell.getValue<string>(),
},
Expand Down Expand Up @@ -70,7 +70,7 @@ const StateOptionsTable: FC<Props> = ({ onlyProps }) => {
if (typeof window !== 'undefined') {
if (isDesktop) {
setColumnPinning({
left: ['mrt-row-numbers', 'stateOption'],
left: ['mrt-row-expand', 'mrt-row-numbers', 'stateOption'],
right: ['link'],
});
} else {
Expand All @@ -92,6 +92,14 @@ const StateOptionsTable: FC<Props> = ({ onlyProps }) => {
<MaterialReactTable
columns={columns}
data={data}
displayColumnDefOptions={{
'mrt-row-numbers': {
size: 10,
},
'mrt-row-expand': {
size: 10,
},
}}
enableColumnActions={!onlyProps}
enableColumnFilterModes
enableColumnOrdering={!onlyProps}
Expand All @@ -117,8 +125,10 @@ const StateOptionsTable: FC<Props> = ({ onlyProps }) => {
}}
positionGlobalFilter="left"
renderDetailPanel={({ row }) => (
<Typography>
{row.original.description ?? 'No Description Provided... Yet...'}
<Typography
color={row.original.description ? 'secondary.main' : 'text.secondary'}
>
{row.original.description || 'No Description Provided... Yet...'}
</Typography>
)}
rowNumberMode="static"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@emotion/styled": "^11.9.3",
"@mui/icons-material": "^5.8.4",
"@mui/material": "^5.9.0",
"material-react-table": "^0.40.8",
"material-react-table": "^0.40.9",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@emotion/styled": "^11.9.3",
"@mui/icons-material": "^5.8.4",
"@mui/material": "^5.9.0",
"material-react-table": "^0.40.8",
"material-react-table": "^0.40.9",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@emotion/styled": "^11.9.3",
"@mui/icons-material": "^5.8.4",
"@mui/material": "^5.9.0",
"material-react-table": "^0.40.8",
"material-react-table": "^0.40.9",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@emotion/styled": "^11.9.3",
"@mui/icons-material": "^5.8.4",
"@mui/material": "^5.9.0",
"material-react-table": "^0.40.8",
"material-react-table": "^0.40.9",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@emotion/styled": "^11.9.3",
"@mui/icons-material": "^5.8.4",
"@mui/material": "^5.9.0",
"material-react-table": "^0.40.8",
"material-react-table": "^0.40.9",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@emotion/styled": "^11.9.3",
"@mui/icons-material": "^5.8.4",
"@mui/material": "^5.9.0",
"material-react-table": "^0.40.8",
"material-react-table": "^0.40.9",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@emotion/styled": "^11.9.3",
"@mui/icons-material": "^5.8.4",
"@mui/material": "^5.9.0",
"material-react-table": "^0.40.8",
"material-react-table": "^0.40.9",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@emotion/styled": "^11.9.3",
"@mui/icons-material": "^5.8.4",
"@mui/material": "^5.9.0",
"material-react-table": "^0.40.8",
"material-react-table": "^0.40.9",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@emotion/styled": "^11.9.3",
"@mui/icons-material": "^5.8.4",
"@mui/material": "^5.9.0",
"material-react-table": "^0.40.8",
"material-react-table": "^0.40.9",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@emotion/styled": "^11.9.3",
"@mui/icons-material": "^5.8.4",
"@mui/material": "^5.9.0",
"material-react-table": "^0.40.8",
"material-react-table": "^0.40.9",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@emotion/styled": "^11.9.3",
"@mui/icons-material": "^5.8.4",
"@mui/material": "^5.9.0",
"material-react-table": "^0.40.8",
"material-react-table": "^0.40.9",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@emotion/styled": "^11.9.3",
"@mui/icons-material": "^5.8.4",
"@mui/material": "^5.9.0",
"material-react-table": "^0.40.8",
"material-react-table": "^0.40.9",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@emotion/styled": "^11.9.3",
"@mui/icons-material": "^5.8.4",
"@mui/material": "^5.9.0",
"material-react-table": "^0.40.8",
"material-react-table": "^0.40.9",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@emotion/styled": "^11.9.3",
"@mui/icons-material": "^5.8.4",
"@mui/material": "^5.9.0",
"material-react-table": "^0.40.8",
"material-react-table": "^0.40.9",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@emotion/styled": "^11.9.3",
"@mui/icons-material": "^5.8.4",
"@mui/material": "^5.9.0",
"material-react-table": "^0.40.8",
"material-react-table": "^0.40.9",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@emotion/styled": "^11.9.3",
"@mui/icons-material": "^5.8.4",
"@mui/material": "^5.9.0",
"material-react-table": "^0.40.8",
"material-react-table": "^0.40.9",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@emotion/styled": "^11.9.3",
"@mui/icons-material": "^5.8.4",
"@mui/material": "^5.9.0",
"material-react-table": "^0.40.8",
"material-react-table": "^0.40.9",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@emotion/styled": "^11.9.3",
"@mui/icons-material": "^5.8.4",
"@mui/material": "^5.9.0",
"material-react-table": "^0.40.8",
"material-react-table": "^0.40.9",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@emotion/styled": "^11.9.3",
"@mui/icons-material": "^5.8.4",
"@mui/material": "^5.9.0",
"material-react-table": "^0.40.8",
"material-react-table": "^0.40.9",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@emotion/styled": "^11.9.3",
"@mui/icons-material": "^5.8.4",
"@mui/material": "^5.9.0",
"material-react-table": "^0.40.8",
"material-react-table": "^0.40.9",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@emotion/styled": "^11.9.3",
"@mui/icons-material": "^5.8.4",
"@mui/material": "^5.9.0",
"material-react-table": "^0.40.8",
"material-react-table": "^0.40.9",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@emotion/styled": "^11.9.3",
"@mui/icons-material": "^5.8.4",
"@mui/material": "^5.9.0",
"material-react-table": "^0.40.8",
"material-react-table": "^0.40.9",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@emotion/styled": "^11.9.3",
"@mui/icons-material": "^5.8.4",
"@mui/material": "^5.9.0",
"material-react-table": "^0.40.8",
"material-react-table": "^0.40.9",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@emotion/styled": "^11.9.3",
"@mui/icons-material": "^5.8.4",
"@mui/material": "^5.9.0",
"material-react-table": "^0.40.8",
"material-react-table": "^0.40.9",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@emotion/styled": "^11.9.3",
"@mui/icons-material": "^5.8.4",
"@mui/material": "^5.9.0",
"material-react-table": "^0.40.8",
"material-react-table": "^0.40.9",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@emotion/styled": "^11.9.3",
"@mui/icons-material": "^5.8.4",
"@mui/material": "^5.9.0",
"material-react-table": "^0.40.8",
"material-react-table": "^0.40.9",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down

2 comments on commit 8118164

@vercel
Copy link

@vercel vercel bot commented on 8118164 Aug 30, 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 8118164 Aug 30, 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.