@hillac/mantine-react-table 1.0.5 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -21
- package/UPSTREAM.md +7 -5
- package/dist/index.d.ts +37 -34
- package/dist/index.js +186 -66
- package/dist/index.js.map +1 -1
- package/package.json +45 -32
- package/styles.css +346 -365
package/README.md
CHANGED
|
@@ -1,32 +1,35 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Mantine React Table
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
TanStack Table
|
|
3
|
+
This repository owns and publishes `@hillac/mantine-react-table`, a Mantine 9
|
|
4
|
+
and TanStack Table 9 port of the Mantine React Table example maintained in
|
|
5
|
+
`TanStack/table`.
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
See the [migration guide](https://github.com/TanStack/table/blob/290284f29867021c77afbdd02c05f16f862cb509/examples/react/mantine-react-table/README.md)
|
|
8
|
+
when upgrading from the original `mantine-react-table` v2 package.
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
The package source is checked into `src/` and is edited directly. See
|
|
11
|
+
[`UPSTREAM.md`](./UPSTREAM.md) for the pinned upstream revision.
|
|
12
|
+
|
|
13
|
+
## Development
|
|
10
14
|
|
|
11
15
|
```bash
|
|
12
|
-
|
|
16
|
+
pnpm install
|
|
17
|
+
pnpm demo
|
|
18
|
+
pnpm typecheck
|
|
19
|
+
pnpm build
|
|
20
|
+
pnpm test:e2e
|
|
21
|
+
pnpm validate
|
|
13
22
|
```
|
|
14
23
|
|
|
15
|
-
|
|
24
|
+
The playground includes asynchronous mock data, client and mock-server
|
|
25
|
+
filtering/sorting, numeric and date ranges, pagination, infinite scrolling, URL
|
|
26
|
+
state, configurable latency, loading skeletons, and error banners.
|
|
16
27
|
|
|
17
|
-
|
|
18
|
-
import {
|
|
19
|
-
MantineReactTable,
|
|
20
|
-
createMRTColumnHelper,
|
|
21
|
-
useMantineReactTable,
|
|
22
|
-
} from '@hillac/mantine-react-table'
|
|
28
|
+
## Consuming the package
|
|
23
29
|
|
|
24
|
-
|
|
30
|
+
```bash
|
|
31
|
+
pnpm add @hillac/mantine-react-table
|
|
25
32
|
```
|
|
26
33
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
```tsx
|
|
30
|
-
import '@mantine/core/styles.css'
|
|
31
|
-
import '@mantine/dates/styles.css'
|
|
32
|
-
```
|
|
34
|
+
The package can also be aliased as `mantine-react-table` in a consumer's
|
|
35
|
+
`package.json`.
|
package/UPSTREAM.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# Upstream source
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
- Commit: `36733a38b6a77878eea616b25012c47a0f93d4da`
|
|
3
|
+
The implementation in `src/` was copied from the Mantine React Table example in
|
|
4
|
+
[`TanStack/table`](https://github.com/TanStack/table/tree/c14e0221b1e656c7bb35e7b3d4cdf188719a3599/examples/react/mantine-react-table/src/mantine-react-table)
|
|
5
|
+
at revision `c14e0221b1e656c7bb35e7b3d4cdf188719a3599`.
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
The former publisher patches were applied before the source was checked in. This
|
|
8
|
+
repository now owns its source directly. Run `scripts/create-upstream-patch.sh`
|
|
9
|
+
to produce one reviewable patch containing the difference from this pinned
|
|
10
|
+
upstream revision.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { MutableRefObject, HTMLProps, ReactNode, Dispatch, SetStateAction, RefObject, DragEventHandler, MouseEvent, ChangeEvent, JSX } from 'react';
|
|
3
|
+
import * as _tanstack_react_table from '@tanstack/react-table';
|
|
3
4
|
import { Row, StockFeatures, DeepKeys, FilterFn, Column, Cell, Header, HeaderGroup, TableState, AggregationFnDef, SortFn, OnChangeFn, TableOptions, Updater, Table, ColumnDef, ColumnFiltersState, AccessorFn, DeepValue, ColumnOrderState, ColumnPinningState, columnResizingState, ColumnSizingState, ColumnVisibilityState, ExpandedState, GroupingState, PaginationState, RowSelectionState, SortingState, RowPinningPosition, Renderable } from '@tanstack/react-table';
|
|
4
5
|
import { Virtualizer, VirtualizerOptions, VirtualItem } from '@tanstack/react-virtual';
|
|
5
6
|
import { BoxProps, ActionIconProps, UnstyledButtonProps, ModalProps, SelectProps, TextInputProps, AutocompleteProps, CheckboxProps, MultiSelectProps, RangeSliderProps, HighlightProps, LoadingOverlayProps, PaginationProps, PaperProps, ProgressProps, RadioProps, SwitchProps, SkeletonProps, TableTdProps, TableTbodyProps, TableTrProps, TableThProps, TableTfootProps, TableTheadProps, TableProps, BadgeProps, AlertProps, FlexProps, MenuProps, MantineTheme } from '@mantine/core';
|
|
6
7
|
import { DateInputProps } from '@mantine/dates';
|
|
7
|
-
import * as _tanstack_table_core from '@tanstack/table-core';
|
|
8
8
|
import { RankingInfo } from '@tanstack/match-sorter-utils';
|
|
9
9
|
import * as _tabler_icons_react from '@tabler/icons-react';
|
|
10
10
|
|
|
11
11
|
declare const MRT_RowAggregationFns: {
|
|
12
|
-
sum:
|
|
13
|
-
min:
|
|
14
|
-
max:
|
|
15
|
-
extent:
|
|
16
|
-
mean:
|
|
17
|
-
median:
|
|
18
|
-
unique:
|
|
19
|
-
uniqueCount:
|
|
20
|
-
count:
|
|
21
|
-
first:
|
|
22
|
-
last:
|
|
12
|
+
sum: _tanstack_react_table.AggregationFnDef<any, any, unknown, number>;
|
|
13
|
+
min: _tanstack_react_table.AggregationFnDef<any, any, unknown, (number | Date) | undefined>;
|
|
14
|
+
max: _tanstack_react_table.AggregationFnDef<any, any, unknown, (number | Date) | undefined>;
|
|
15
|
+
extent: _tanstack_react_table.AggregationFnDef<any, any, unknown, [(number | Date) | undefined, (number | Date) | undefined]>;
|
|
16
|
+
mean: _tanstack_react_table.AggregationFnDef<any, any, unknown, number | undefined>;
|
|
17
|
+
median: _tanstack_react_table.AggregationFnDef<any, any, unknown, number | undefined>;
|
|
18
|
+
unique: _tanstack_react_table.AggregationFnDef<any, any, unknown, unknown[]>;
|
|
19
|
+
uniqueCount: _tanstack_react_table.AggregationFnDef<any, any, unknown, number>;
|
|
20
|
+
count: _tanstack_react_table.AggregationFnDef<any, any, unknown, number>;
|
|
21
|
+
first: _tanstack_react_table.AggregationFnDef<any, any, unknown, unknown>;
|
|
22
|
+
last: _tanstack_react_table.AggregationFnDef<any, any, unknown, unknown>;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
declare const MRT_FilterFns: {
|
|
@@ -28,7 +28,7 @@ declare const MRT_FilterFns: {
|
|
|
28
28
|
autoRemove(val: any): boolean;
|
|
29
29
|
};
|
|
30
30
|
betweenInclusive: {
|
|
31
|
-
<TData extends MRT_RowData>(row: Row<StockFeatures, TData>, id: string, filterValues: [number | string, number | string]): boolean;
|
|
31
|
+
<TData extends MRT_RowData>(row: Row<StockFeatures, TData>, id: string, filterValues: [Date | number | string | null | undefined, Date | number | string | null | undefined]): boolean;
|
|
32
32
|
autoRemove(val: any): boolean;
|
|
33
33
|
};
|
|
34
34
|
contains: {
|
|
@@ -79,28 +79,28 @@ declare const MRT_FilterFns: {
|
|
|
79
79
|
<TData extends MRT_RowData>(row: Row<StockFeatures, TData>, id: string, filterValue: number | string): boolean;
|
|
80
80
|
autoRemove(val: any): boolean;
|
|
81
81
|
};
|
|
82
|
-
arrIncludes:
|
|
83
|
-
arrIncludesAll:
|
|
84
|
-
arrHas:
|
|
85
|
-
arrIncludesSome:
|
|
86
|
-
equalsString:
|
|
87
|
-
equalsStringSensitive:
|
|
88
|
-
inDateRange:
|
|
89
|
-
inNumberRange:
|
|
90
|
-
includesString:
|
|
91
|
-
includesStringSensitive:
|
|
92
|
-
weakEquals:
|
|
82
|
+
arrIncludes: _tanstack_react_table.CreatedFilterFn<any, any>;
|
|
83
|
+
arrIncludesAll: _tanstack_react_table.CreatedFilterFn<any, any>;
|
|
84
|
+
arrHas: _tanstack_react_table.CreatedFilterFn<any, any>;
|
|
85
|
+
arrIncludesSome: _tanstack_react_table.CreatedFilterFn<any, any>;
|
|
86
|
+
equalsString: _tanstack_react_table.CreatedFilterFn<any, any>;
|
|
87
|
+
equalsStringSensitive: _tanstack_react_table.CreatedFilterFn<any, any>;
|
|
88
|
+
inDateRange: _tanstack_react_table.CreatedFilterFn<any, any>;
|
|
89
|
+
inNumberRange: _tanstack_react_table.CreatedFilterFn<any, any>;
|
|
90
|
+
includesString: _tanstack_react_table.CreatedFilterFn<any, any>;
|
|
91
|
+
includesStringSensitive: _tanstack_react_table.CreatedFilterFn<any, any>;
|
|
92
|
+
weakEquals: _tanstack_react_table.CreatedFilterFn<any, any>;
|
|
93
93
|
};
|
|
94
94
|
declare function localizedFilterOption(localization: MRT_Localization, option: MRT_FilterOption): string;
|
|
95
95
|
|
|
96
96
|
declare const MRT_SortFns: {
|
|
97
97
|
fuzzy: <TData extends MRT_RowData>(rowA: Row<StockFeatures, TData>, rowB: Row<StockFeatures, TData>, columnId: string) => number;
|
|
98
|
-
alphanumeric:
|
|
99
|
-
alphanumericCaseSensitive:
|
|
100
|
-
basic:
|
|
101
|
-
datetime:
|
|
102
|
-
text:
|
|
103
|
-
textCaseSensitive:
|
|
98
|
+
alphanumeric: _tanstack_react_table.CreatedSortFn<any, any>;
|
|
99
|
+
alphanumericCaseSensitive: _tanstack_react_table.CreatedSortFn<any, any>;
|
|
100
|
+
basic: _tanstack_react_table.CreatedSortFn<any, any>;
|
|
101
|
+
datetime: _tanstack_react_table.CreatedSortFn<any, any>;
|
|
102
|
+
text: _tanstack_react_table.CreatedSortFn<any, any>;
|
|
103
|
+
textCaseSensitive: _tanstack_react_table.CreatedSortFn<any, any>;
|
|
104
104
|
};
|
|
105
105
|
declare const rankGlobalFuzzy: <TData extends MRT_RowData>(rowA: MRT_Row<TData>, rowB: MRT_Row<TData>) => number;
|
|
106
106
|
|
|
@@ -1365,10 +1365,12 @@ declare const MRT_FilterRangeSlider: <TData extends MRT_RowData>({ header, table
|
|
|
1365
1365
|
|
|
1366
1366
|
interface Props$j<TData extends MRT_RowData> extends TextInputProps {
|
|
1367
1367
|
header: MRT_Header<TData>;
|
|
1368
|
+
onRangeFilterValueChange?: (value: any) => void;
|
|
1368
1369
|
rangeFilterIndex?: number;
|
|
1370
|
+
rangeFilterValue?: any;
|
|
1369
1371
|
table: MRT_TableInstance<TData>;
|
|
1370
1372
|
}
|
|
1371
|
-
declare const MRT_FilterTextInput: <TData extends MRT_RowData>({ header, rangeFilterIndex, table, ...rest }: Props$j<TData>) => react.JSX.Element;
|
|
1373
|
+
declare const MRT_FilterTextInput: <TData extends MRT_RowData>({ header, onRangeFilterValueChange, rangeFilterIndex, rangeFilterValue, table, ...rest }: Props$j<TData>) => react.JSX.Element;
|
|
1372
1374
|
|
|
1373
1375
|
interface Props$i<TData extends MRT_RowData> extends TextInputProps {
|
|
1374
1376
|
table: MRT_TableInstance<TData>;
|
|
@@ -1497,11 +1499,12 @@ declare const useMRT_RowVirtualizer: <TData extends MRT_RowData, TScrollElement
|
|
|
1497
1499
|
* state, refs, and helpers. State management is built on top of TanStack
|
|
1498
1500
|
* Store atoms (`useCreateAtom` from `@tanstack/react-store`):
|
|
1499
1501
|
*
|
|
1500
|
-
* - **TanStack-aware slices** (`columnOrder`, `columnResizing`, `grouping
|
|
1501
|
-
*
|
|
1502
|
-
* writes (e.g. `table.setSorting(...)`, `table.firstPage()`) flow directly
|
|
1502
|
+
* - **TanStack-aware slices** (`columnOrder`, `columnResizing`, `grouping`)
|
|
1503
|
+
* are passed via the `atoms` option on `useTable`. Library writes flow directly
|
|
1503
1504
|
* through these atoms, and they're automatically tracked in
|
|
1504
1505
|
* `table.state` by the v9 store.
|
|
1506
|
+
* - Pagination uses `state` and `onPaginationChange`, with local React state
|
|
1507
|
+
* as the fallback when the consumer does not control it.
|
|
1505
1508
|
* - **MRT-only slices** (`density`, `isFullScreen`, `creatingRow`,
|
|
1506
1509
|
* `editingCell`, `editingRow`, `draggingColumn`, `draggingRow`,
|
|
1507
1510
|
* `hoveredColumn`, `hoveredRow`, `globalFilterFn`, `columnFilterFns`,
|