material-react-table 0.14.0 → 0.14.3
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 +20 -3
- package/dist/{buttons/MRT_ToggleColumnActionMenuButton.d.ts → head/MRT_TableHeadCellColumnActionsButton.d.ts} +1 -1
- package/dist/material-react-table.cjs.development.js +16 -7
- package/dist/material-react-table.cjs.development.js.map +1 -1
- package/dist/material-react-table.cjs.production.min.js +1 -1
- package/dist/material-react-table.cjs.production.min.js.map +1 -1
- package/dist/material-react-table.esm.js +16 -7
- package/dist/material-react-table.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/body/MRT_TableBodyCell.tsx +5 -1
- package/src/head/MRT_TableHeadCell.tsx +3 -2
- package/src/{buttons/MRT_ToggleColumnActionMenuButton.tsx → head/MRT_TableHeadCellColumnActionsButton.tsx} +1 -2
- package/src/head/MRT_TableHeadCellFilterLabel.tsx +1 -0
- package/src/head/MRT_TableHeadCellResizeHandle.tsx +1 -0
- package/src/head/MRT_TableHeadCellSortLabel.tsx +4 -0
- package/src/toolbar/MRT_ToolbarBottom.tsx +2 -0
package/README.md
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
# Material React Table
|
|
2
2
|
|
|
3
|
+
<a href="https://npmjs.com/package/material-react-table" target="_blank_">
|
|
4
|
+
<img alt="" src="https://badgen.net/npm/v/material-react-table" />
|
|
5
|
+
</a>
|
|
3
6
|
<a href="https://bundlephobia.com/result?p=material-react-table" target="_blank_">
|
|
4
7
|
<img alt="" src="https://badgen.net/bundlephobia/minzip/material-react-table@latest" />
|
|
5
8
|
</a>
|
|
6
|
-
|
|
7
9
|
<a href="https://npmjs.com/package/material-react-table" target="_blank_">
|
|
8
10
|
<img alt="" src="https://img.shields.io/npm/dm/material-react-table.svg" />
|
|
9
11
|
</a>
|
|
10
|
-
|
|
11
12
|
<a href="https://github.com/KevinVandy/material-react-table" target="_blank_">
|
|
12
13
|
<img alt="" src="https://img.shields.io/github/stars/KevinVandy/material-react-table.svg?style=social&label=Star" />
|
|
13
14
|
</a>
|
|
14
15
|
|
|
16
|
+
---
|
|
17
|
+
|
|
15
18
|
> This Project is based on `@tanstack/react-table` v8, which itself is still in beta, so therefore this package is also still in alpha/beta
|
|
16
19
|
|
|
17
20
|
- A fully featured Material UI V5 implementation of Tanstack React Table v8 (beta)
|
|
@@ -31,6 +34,8 @@ View the [github source code](https://github.com/KevinVandy/material-react-table
|
|
|
31
34
|
|
|
32
35
|
Join the [discord](https://discord.gg/5wqyRx6fnm) server to join in on the development discussion or ask questions
|
|
33
36
|
|
|
37
|
+
---
|
|
38
|
+
|
|
34
39
|
### Features (All Features work and are MVP, but are still being polished)
|
|
35
40
|
|
|
36
41
|
_All features can easily be enabled/disabled_
|
|
@@ -65,6 +70,8 @@ _All features can easily be enabled/disabled_
|
|
|
65
70
|
- [x] Tree Data / Expanding Sub-rows
|
|
66
71
|
- [x] Virtualization (react-virtual)
|
|
67
72
|
|
|
73
|
+
---
|
|
74
|
+
|
|
68
75
|
### Installation
|
|
69
76
|
|
|
70
77
|
1. Install Peer Dependencies (Material UI v5)
|
|
@@ -79,4 +86,14 @@ npm install @mui/material @mui/icons-material @emotion/react @emotion/styled
|
|
|
79
86
|
npm install material-react-table
|
|
80
87
|
```
|
|
81
88
|
|
|
82
|
-
_`@tanstack/react-table`, `react-virtual` and `react-dnd`_ are internal dependencies, so you don't need to install them yourself.
|
|
89
|
+
_`@tanstack/react-table`, `react-virtual` and `react-dnd`_ are internal dependencies, so you don't need to install them yourself.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
### Contributors
|
|
94
|
+
|
|
95
|
+
<a href="https://github.com/kevinvandy/material-react-table/graphs/contributors">
|
|
96
|
+
<img src="https://contrib.rocks/image?repo=kevinvandy/material-react-table" />
|
|
97
|
+
</a>
|
|
98
|
+
|
|
99
|
+
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!
|
|
@@ -5687,7 +5687,9 @@ var MRT_ToolbarBottom = function MRT_ToolbarBottom(_ref) {
|
|
|
5687
5687
|
}), {
|
|
5688
5688
|
bottom: isFullScreen ? '0' : undefined,
|
|
5689
5689
|
boxShadow: "-3px 0 6px " + material.alpha(theme.palette.common.black, 0.1),
|
|
5690
|
-
|
|
5690
|
+
left: 0,
|
|
5691
|
+
position: isFullScreen ? 'fixed' : 'relative',
|
|
5692
|
+
right: 0
|
|
5691
5693
|
}, toolbarProps == null ? void 0 : toolbarProps.sx);
|
|
5692
5694
|
}
|
|
5693
5695
|
}), React__default.createElement(MRT_LinearProgressBar, {
|
|
@@ -6052,7 +6054,8 @@ var MRT_TableHeadCellFilterLabel = function MRT_TableHeadCellFilterLabel(_ref) {
|
|
|
6052
6054
|
'&:hover': {
|
|
6053
6055
|
backgroundColor: 'transparent',
|
|
6054
6056
|
opacity: 0.8
|
|
6055
|
-
}
|
|
6057
|
+
},
|
|
6058
|
+
width: '1.5ch'
|
|
6056
6059
|
}
|
|
6057
6060
|
}, showFilters && !column.getFilterValue() ? React__default.createElement(FilterAltOffIcon, null) : React__default.createElement(FilterAltIcon, null)));
|
|
6058
6061
|
};
|
|
@@ -6081,6 +6084,7 @@ var MRT_TableHeadCellResizeHandle = function MRT_TableHeadCellResizeHandle(_ref)
|
|
|
6081
6084
|
height: showFilters && columnDefType === 'data' ? '4rem' : '2rem',
|
|
6082
6085
|
opacity: 0.8,
|
|
6083
6086
|
position: 'absolute',
|
|
6087
|
+
mr: '-1rem',
|
|
6084
6088
|
right: '1px',
|
|
6085
6089
|
touchAction: 'none',
|
|
6086
6090
|
transition: column.getIsResizing() ? undefined : 'all 0.2s ease-in-out',
|
|
@@ -6114,11 +6118,15 @@ var MRT_TableHeadCellSortLabel = function MRT_TableHeadCellSortLabel(_ref) {
|
|
|
6114
6118
|
}, React__default.createElement(material.TableSortLabel, {
|
|
6115
6119
|
"aria-label": sortTooltip,
|
|
6116
6120
|
active: !!column.getIsSorted(),
|
|
6117
|
-
direction: column.getIsSorted() ? column.getIsSorted() : undefined
|
|
6121
|
+
direction: column.getIsSorted() ? column.getIsSorted() : undefined,
|
|
6122
|
+
sx: {
|
|
6123
|
+
width: '2ch',
|
|
6124
|
+
transform: 'translateX(-0.5ch)'
|
|
6125
|
+
}
|
|
6118
6126
|
}));
|
|
6119
6127
|
};
|
|
6120
6128
|
|
|
6121
|
-
var
|
|
6129
|
+
var MRT_TableHeadCellColumnActionsButton = function MRT_TableHeadCellColumnActionsButton(_ref) {
|
|
6122
6130
|
var header = _ref.header,
|
|
6123
6131
|
instance = _ref.instance;
|
|
6124
6132
|
var _instance$options = instance.options,
|
|
@@ -6162,7 +6170,6 @@ var MRT_ToggleColumnActionMenuButton = function MRT_ToggleColumnActionMenuButton
|
|
|
6162
6170
|
}, iconButtonProps, {
|
|
6163
6171
|
sx: _extends({
|
|
6164
6172
|
height: '2rem',
|
|
6165
|
-
mr: '2px',
|
|
6166
6173
|
mt: '-0.2rem',
|
|
6167
6174
|
opacity: 0.5,
|
|
6168
6175
|
transition: 'opacity 0.2s',
|
|
@@ -6268,6 +6275,7 @@ var MRT_TableHeadCell = function MRT_TableHeadCell(_ref) {
|
|
|
6268
6275
|
display: 'flex',
|
|
6269
6276
|
justifyContent: columnDefType === 'group' ? 'center' : 'space-between',
|
|
6270
6277
|
opacity: isDragging ? 0.5 : 1,
|
|
6278
|
+
position: 'relative',
|
|
6271
6279
|
width: '100%'
|
|
6272
6280
|
}
|
|
6273
6281
|
}, React__default.createElement(material.Box, {
|
|
@@ -6294,7 +6302,7 @@ var MRT_TableHeadCell = function MRT_TableHeadCell(_ref) {
|
|
|
6294
6302
|
}, columnDefType === 'data' && (enableColumnOrdering && columnDef.enableColumnOrdering !== false || enableGrouping && columnDef.enableGrouping !== false) && React__default.createElement(MRT_GrabHandleButton, {
|
|
6295
6303
|
ref: dragRef,
|
|
6296
6304
|
instance: instance
|
|
6297
|
-
}), (enableColumnActions || columnDef.enableColumnActions) && columnDef.enableColumnActions !== false && columnDefType !== 'group' && React__default.createElement(
|
|
6305
|
+
}), (enableColumnActions || columnDef.enableColumnActions) && columnDef.enableColumnActions !== false && columnDefType !== 'group' && React__default.createElement(MRT_TableHeadCellColumnActionsButton, {
|
|
6298
6306
|
header: header,
|
|
6299
6307
|
instance: instance
|
|
6300
6308
|
})), column.getCanResize() && React__default.createElement(MRT_TableHeadCellResizeHandle, {
|
|
@@ -7060,6 +7068,7 @@ var MRT_TableBodyCell = function MRT_TableBodyCell(_ref) {
|
|
|
7060
7068
|
muiTableBodyCellProps = _instance$options.muiTableBodyCellProps,
|
|
7061
7069
|
muiTableBodyCellSkeletonProps = _instance$options.muiTableBodyCellSkeletonProps,
|
|
7062
7070
|
onCellClick = _instance$options.onCellClick,
|
|
7071
|
+
onRowClick = _instance$options.onRowClick,
|
|
7063
7072
|
rowNumberMode = _instance$options.rowNumberMode,
|
|
7064
7073
|
tableId = _instance$options.tableId,
|
|
7065
7074
|
setColumnOrder = instance.setColumnOrder,
|
|
@@ -7146,7 +7155,7 @@ var MRT_TableBodyCell = function MRT_TableBodyCell(_ref) {
|
|
|
7146
7155
|
return _extends({
|
|
7147
7156
|
backgroundColor: column.getIsPinned() ? material.alpha(material.lighten(theme.palette.background["default"], 0.04), 0.95) : undefined,
|
|
7148
7157
|
boxShadow: getIsLastLeftPinnedColumn() ? "4px 0 4px -2px " + material.alpha(theme.palette.common.black, 0.1) : getIsFirstRightPinnedColumn() ? "-4px 0 4px -2px " + material.alpha(theme.palette.common.black, 0.1) : undefined,
|
|
7149
|
-
cursor: isEditable && editingMode === 'cell' ? 'pointer' : 'text',
|
|
7158
|
+
cursor: isEditable && editingMode === 'cell' || onRowClick || onCellClick ? 'pointer' : 'text',
|
|
7150
7159
|
left: column.getIsPinned() === 'left' ? column.getStart('left') + "px" : undefined,
|
|
7151
7160
|
overflow: 'hidden',
|
|
7152
7161
|
p: density === 'compact' ? columnDefType === 'display' ? '0 0.5rem' : '0.5rem' : density === 'comfortable' ? columnDefType === 'display' ? '0.5rem 0.75rem' : '1rem' : columnDefType === 'display' ? '1rem 1.25rem' : '1.5rem',
|