Skip to content

Commit 5ad6803

Browse files
committed
release v2.1.0 - better rtl column resizing
1 parent da52088 commit 5ad6803

File tree

40 files changed

+3906
-1368
lines changed

40 files changed

+3906
-1368
lines changed

apps/material-react-table-docs/components/prop-tables/tableOptions.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,17 @@ export const tableOptions: TableOption[] = [
6666
source: 'MRT',
6767
type: 'Array<MRT_FilterOption | string> | null',
6868
},
69+
{
70+
tableOption: 'columnResizeDirection',
71+
defaultValue: "muiTheme.direction || 'ltr'",
72+
description:
73+
'Determines the direction of column resizing. ltr = left to right, rtl = right to left.',
74+
link: 'https://tanstack.com/table/v8/docs/api/features/column-sizing#columnresizedirection',
75+
linkText: 'MRT Column Resizing Docs',
76+
required: false,
77+
source: 'TanStack Table',
78+
type: "'ltr' | 'rtl'",
79+
},
6980
{
7081
tableOption: 'columnResizeMode',
7182
defaultValue: "'onChange'",
@@ -1038,7 +1049,7 @@ export const tableOptions: TableOption[] = [
10381049
linkText: 'TanStack Table Core Docs',
10391050
required: false,
10401051
source: 'TanStack Table',
1041-
type: ' <T>(defaultOptions: T, options: Partial<T>) => T',
1052+
type: '<T>(defaultOptions: T, options: Partial<T>) => T',
10421053
},
10431054
{
10441055
tableOption: 'meta',
@@ -1463,7 +1474,7 @@ export const tableOptions: TableOption[] = [
14631474
linkText: 'TanStack Table Column Sizing Docs',
14641475
required: false,
14651476
source: 'TanStack Table',
1466-
type: ' OnChangeFn<ColumnSizingState>',
1477+
type: 'OnChangeFn<ColumnSizingState>',
14671478
},
14681479
{
14691480
tableOption: 'onColumnSizingInfoChange',

apps/material-react-table-docs/example-groups/LocaleExamples.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import ET_Table from '../examples/localization-i18n-et';
1313
import FA_Table from '../examples/localization-i18n-fa';
1414
import FI_Table from '../examples/localization-i18n-fi';
1515
import FR_Table from '../examples/localization-i18n-fr';
16+
import HE_Table from '../examples/localization-i18n-he';
1617
import HU_Table from '../examples/localization-i18n-hu';
1718
import HY_Table from '../examples/localization-i18n-hy';
1819
import ID_Table from '../examples/localization-i18n-id';
@@ -51,6 +52,7 @@ const supportedLocales = [
5152
'fa',
5253
'fi',
5354
'fr',
55+
'he',
5456
'hu',
5557
'hy',
5658
'id',
@@ -113,6 +115,7 @@ const LocaleExamples = () => {
113115
{currentLocale === 'fa' && <FA_Table />}
114116
{currentLocale === 'fi' && <FI_Table />}
115117
{currentLocale === 'fr' && <FR_Table />}
118+
{currentLocale === 'he' && <HE_Table />}
116119
{currentLocale === 'hu' && <HU_Table />}
117120
{currentLocale === 'hy' && <HY_Table />}
118121
{currentLocale === 'id' && <ID_Table />}

apps/material-react-table-docs/examples/localization-i18n-ar/sandbox/src/JS.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ const Example = () => {
3030
<MaterialReactTable
3131
columns={columns}
3232
data={data}
33+
defaultColumn={{ size: 250 }}
34+
columnResizeDirection="rtl"
3335
enableColumnFilterModes
3436
enableColumnResizing
3537
enableColumnOrdering

apps/material-react-table-docs/examples/localization-i18n-ar/sandbox/src/TS.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ const Example = () => {
3030
<MaterialReactTable
3131
columns={columns}
3232
data={data}
33+
defaultColumn={{ size: 250 }}
34+
columnResizeDirection="rtl"
3335
enableColumnFilterModes
3436
enableColumnOrdering
3537
enableColumnResizing

apps/material-react-table-docs/examples/localization-i18n-fa/sandbox/src/JS.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ const Example = () => {
3030
<MaterialReactTable
3131
columns={columns}
3232
data={data}
33+
defaultColumn={{ size: 250 }}
34+
columnResizeDirection="rtl"
3335
enableColumnFilterModes
3436
enableColumnResizing
3537
enableColumnOrdering

apps/material-react-table-docs/examples/localization-i18n-fa/sandbox/src/TS.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ const Example = () => {
3030
<MaterialReactTable
3131
columns={columns}
3232
data={data}
33+
defaultColumn={{ size: 250 }}
34+
columnResizeDirection="rtl"
3335
enableColumnFilterModes
3436
enableColumnOrdering
3537
enableColumnResizing
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { SourceCodeSnippet } from '../../components/mdx/SourceCodeSnippet';
2+
import Example from './sandbox/src/TS';
3+
const JS = require('!!raw-loader!./sandbox/src/JS.js').default;
4+
const TS = require('!!raw-loader!./sandbox/src/TS.tsx').default;
5+
6+
const ExampleTable = () => {
7+
return (
8+
<SourceCodeSnippet
9+
Component={Example}
10+
javaScriptCode={JS}
11+
typeScriptCode={TS}
12+
tableId="localization-i18n-he"
13+
/>
14+
);
15+
};
16+
17+
export default ExampleTable;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
.DS_Store
3+
dist
4+
dist-ssr
5+
*.local
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Example
2+
3+
To run this example:
4+
5+
- `npm install` or `yarn`
6+
- `npm run start` or `yarn start`
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Material React Table Example</title>
7+
</head>
8+
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>

0 commit comments

Comments
 (0)