material-react-table 0.29.0 → 0.30.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 +4 -4
- package/dist/MaterialReactTable.d.ts +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/material-react-table.cjs.development.js +9 -9
- 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 +9 -9
- package/dist/material-react-table.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/MaterialReactTable.tsx +1 -1
- package/src/column.utils.ts +1 -1
- package/src/index.tsx +6 -0
- package/src/inputs/MRT_FilterTextField.tsx +4 -2
- package/src/menus/MRT_ColumnActionMenu.tsx +3 -3
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# Material React Table
|
|
2
2
|
|
|
3
3
|
<a href="https://npmjs.com/package/material-react-table" target="_blank">
|
|
4
|
-
<img alt="" src="https://badgen.net/npm/v/material-react-table" />
|
|
4
|
+
<img alt="" src="https://badgen.net/npm/v/material-react-table?color=blue" />
|
|
5
5
|
</a>
|
|
6
6
|
<a href="https://npmjs.com/package/material-react-table" target="_blank">
|
|
7
|
-
<img alt="" src="https://img.shields.io/npm/dm/material-react-table.svg" />
|
|
7
|
+
<img alt="" src="https://img.shields.io/npm/dm/material-react-table.svg?color=blue" />
|
|
8
8
|
</a>
|
|
9
9
|
<a href="https://bundlephobia.com/result?p=material-react-table" target="_blank">
|
|
10
|
-
<img alt="" src="https://badgen.net/bundlephobia/minzip/material-react-table@latest" />
|
|
10
|
+
<img alt="" src="https://badgen.net/bundlephobia/minzip/material-react-table@latest?color=blue" />
|
|
11
11
|
</a>
|
|
12
12
|
<a href="https://github.com/KevinVandy/material-react-table" target="_blank">
|
|
13
13
|
<img alt="" src="https://img.shields.io/github/stars/KevinVandy/material-react-table.svg?style=social&label=Star" />
|
|
@@ -53,7 +53,7 @@ View additional [storybook examples](https://www.material-react-table.dev/)
|
|
|
53
53
|
|
|
54
54
|
_All features can easily be enabled/disabled_
|
|
55
55
|
|
|
56
|
-
- [x] <
|
|
56
|
+
- [x] < 37kb gzipped - [Bundlephobia](https://bundlephobia.com/package/material-react-table)
|
|
57
57
|
- [x] Advanced TypeScript Generics Support (TypeScript Optional)
|
|
58
58
|
- [x] Click To Copy Cell Values
|
|
59
59
|
- [x] Column Action Dropdown Menu
|
|
@@ -130,7 +130,7 @@ export declare type MRT_ColumnDef<TData extends Record<string, any> = {}> = Omit
|
|
|
130
130
|
text: string;
|
|
131
131
|
value: string;
|
|
132
132
|
})[];
|
|
133
|
-
filterVariant?: 'text' | 'select' | '
|
|
133
|
+
filterVariant?: 'text' | 'select' | 'multi-select' | 'range';
|
|
134
134
|
/**
|
|
135
135
|
* footer must be a string. If you want custom JSX to render the footer, you can also specify a `Footer` option. (Capital F)
|
|
136
136
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import MaterialReactTable from './MaterialReactTable';
|
|
2
2
|
export default MaterialReactTable;
|
|
3
3
|
export * from './MaterialReactTable';
|
|
4
|
+
import type { MRT_Icons } from './icons';
|
|
5
|
+
export type { MRT_Icons };
|
|
6
|
+
import type { MRT_Localization } from './localization';
|
|
7
|
+
export type { MRT_Localization };
|
|
@@ -752,7 +752,7 @@ var getDefaultColumnOrderIds = function getDefaultColumnOrderIds(props) {
|
|
|
752
752
|
}), getTrailingDisplayColumnIds(props)).filter(Boolean);
|
|
753
753
|
};
|
|
754
754
|
var getDefaultColumnFilterFn = function getDefaultColumnFilterFn(columnDef) {
|
|
755
|
-
if (columnDef.filterVariant === '
|
|
755
|
+
if (columnDef.filterVariant === 'multi-select') return 'arrIncludesSome';
|
|
756
756
|
if (columnDef.filterVariant === 'select') return 'equals';
|
|
757
757
|
if (columnDef.filterVariant === 'range') return 'betweenInclusive';
|
|
758
758
|
return 'fuzzy';
|
|
@@ -1151,7 +1151,11 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
|
|
|
1151
1151
|
sx: commonMenuItemStyles
|
|
1152
1152
|
}, React__default.createElement(material.Box, {
|
|
1153
1153
|
sx: commonListItemStyles
|
|
1154
|
-
}, React__default.createElement(material.ListItemIcon, null, React__default.createElement(SortIcon,
|
|
1154
|
+
}, React__default.createElement(material.ListItemIcon, null, React__default.createElement(SortIcon, {
|
|
1155
|
+
style: {
|
|
1156
|
+
transform: 'rotate(180deg) scaleX(-1)'
|
|
1157
|
+
}
|
|
1158
|
+
})), (_localization$sortByC = localization.sortByColumnAsc) == null ? void 0 : _localization$sortByC.replace('{column}', String(columnDef.header)))), React__default.createElement(material.MenuItem, {
|
|
1155
1159
|
divider: enableColumnFilters || enableGrouping || enableHiding,
|
|
1156
1160
|
key: 2,
|
|
1157
1161
|
disabled: column.getIsSorted() === 'desc',
|
|
@@ -1159,11 +1163,7 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
|
|
|
1159
1163
|
sx: commonMenuItemStyles
|
|
1160
1164
|
}, React__default.createElement(material.Box, {
|
|
1161
1165
|
sx: commonListItemStyles
|
|
1162
|
-
}, React__default.createElement(material.ListItemIcon, null, React__default.createElement(SortIcon, {
|
|
1163
|
-
style: {
|
|
1164
|
-
transform: 'rotate(180deg) scaleX(-1)'
|
|
1165
|
-
}
|
|
1166
|
-
})), (_localization$sortByC2 = localization.sortByColumnDesc) == null ? void 0 : _localization$sortByC2.replace('{column}', String(columnDef.header))))], enableColumnFilters && column.getCanFilter() && [React__default.createElement(material.MenuItem, {
|
|
1166
|
+
}, React__default.createElement(material.ListItemIcon, null, React__default.createElement(SortIcon, null)), (_localization$sortByC2 = localization.sortByColumnDesc) == null ? void 0 : _localization$sortByC2.replace('{column}', String(columnDef.header))))], enableColumnFilters && column.getCanFilter() && [React__default.createElement(material.MenuItem, {
|
|
1167
1167
|
disabled: !column.getFilterValue(),
|
|
1168
1168
|
key: 0,
|
|
1169
1169
|
onClick: handleClearFilter,
|
|
@@ -2178,8 +2178,8 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
|
|
|
2178
2178
|
|
|
2179
2179
|
var isRangeFilter = columnDef.filterVariant === 'range' || rangeFilterIndex !== undefined;
|
|
2180
2180
|
var isSelectFilter = columnDef.filterVariant === 'select';
|
|
2181
|
-
var isMultiSelectFilter = columnDef.filterVariant === '
|
|
2182
|
-
var isTextboxFilter = !isSelectFilter && !isMultiSelectFilter;
|
|
2181
|
+
var isMultiSelectFilter = columnDef.filterVariant === 'multi-select';
|
|
2182
|
+
var isTextboxFilter = columnDef.filterVariant === 'text' || !isSelectFilter && !isMultiSelectFilter;
|
|
2183
2183
|
var currentFilterOption = currentFilterFns == null ? void 0 : currentFilterFns[header.id];
|
|
2184
2184
|
var filterId = "mrt-" + tableId + "-" + header.id + "-filter-text-field" + (rangeFilterIndex != null ? rangeFilterIndex : '');
|
|
2185
2185
|
var filterChipLabel = ['empty', 'notEmpty'].includes(currentFilterOption) ? //@ts-ignore
|