material-react-table 0.29.1 → 0.30.2
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 +2 -2
- package/dist/column.utils.d.ts +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/material-react-table.cjs.development.js +24 -13
- 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 +24 -13
- package/dist/material-react-table.esm.js.map +1 -1
- package/package.json +2 -5
- package/src/MaterialReactTable.tsx +6 -2
- package/src/column.utils.ts +1 -0
- package/src/head/MRT_TableHeadCell.tsx +12 -2
- package/src/index.tsx +6 -0
- package/src/inputs/MRT_FilterTextField.tsx +28 -26
- package/src/inputs/MRT_GlobalFilterTextField.tsx +1 -1
- package/src/menus/MRT_ColumnActionMenu.tsx +3 -3
- package/src/table/MRT_TableRoot.tsx +1 -0
|
@@ -711,7 +711,8 @@ var prepareColumns = function prepareColumns(columnDefs, currentFilterFns) {
|
|
|
711
711
|
if (Object.keys(MRT_FilterFns).includes(currentFilterFns[columnDef.id])) {
|
|
712
712
|
var _MRT_FilterFns$curren;
|
|
713
713
|
|
|
714
|
-
columnDef.filterFn =
|
|
714
|
+
columnDef.filterFn = // @ts-ignore
|
|
715
|
+
(_MRT_FilterFns$curren = MRT_FilterFns[currentFilterFns[columnDef.id]]) != null ? _MRT_FilterFns$curren : MRT_FilterFns.fuzzy; //@ts-ignore
|
|
715
716
|
|
|
716
717
|
columnDef._filterFn = currentFilterFns[columnDef.id];
|
|
717
718
|
}
|
|
@@ -1144,7 +1145,11 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
|
|
|
1144
1145
|
sx: commonMenuItemStyles
|
|
1145
1146
|
}, React.createElement(Box, {
|
|
1146
1147
|
sx: commonListItemStyles
|
|
1147
|
-
}, React.createElement(ListItemIcon, null, React.createElement(SortIcon,
|
|
1148
|
+
}, React.createElement(ListItemIcon, null, React.createElement(SortIcon, {
|
|
1149
|
+
style: {
|
|
1150
|
+
transform: 'rotate(180deg) scaleX(-1)'
|
|
1151
|
+
}
|
|
1152
|
+
})), (_localization$sortByC = localization.sortByColumnAsc) == null ? void 0 : _localization$sortByC.replace('{column}', String(columnDef.header)))), React.createElement(MenuItem, {
|
|
1148
1153
|
divider: enableColumnFilters || enableGrouping || enableHiding,
|
|
1149
1154
|
key: 2,
|
|
1150
1155
|
disabled: column.getIsSorted() === 'desc',
|
|
@@ -1152,11 +1157,7 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
|
|
|
1152
1157
|
sx: commonMenuItemStyles
|
|
1153
1158
|
}, React.createElement(Box, {
|
|
1154
1159
|
sx: commonListItemStyles
|
|
1155
|
-
}, React.createElement(ListItemIcon, null, React.createElement(SortIcon, {
|
|
1156
|
-
style: {
|
|
1157
|
-
transform: 'rotate(180deg) scaleX(-1)'
|
|
1158
|
-
}
|
|
1159
|
-
})), (_localization$sortByC2 = localization.sortByColumnDesc) == null ? void 0 : _localization$sortByC2.replace('{column}', String(columnDef.header))))], enableColumnFilters && column.getCanFilter() && [React.createElement(MenuItem, {
|
|
1160
|
+
}, React.createElement(ListItemIcon, null, React.createElement(SortIcon, null)), (_localization$sortByC2 = localization.sortByColumnDesc) == null ? void 0 : _localization$sortByC2.replace('{column}', String(columnDef.header))))], enableColumnFilters && column.getCanFilter() && [React.createElement(MenuItem, {
|
|
1160
1161
|
disabled: !column.getFilterValue(),
|
|
1161
1162
|
key: 0,
|
|
1162
1163
|
onClick: handleClearFilter,
|
|
@@ -1547,7 +1548,11 @@ var MRT_GlobalFilterTextField = function MRT_GlobalFilterTextField(_ref) {
|
|
|
1547
1548
|
height: '1.75rem',
|
|
1548
1549
|
width: '1.75rem'
|
|
1549
1550
|
}
|
|
1550
|
-
}, React.createElement(SearchIcon, null)))) : React.createElement(SearchIcon,
|
|
1551
|
+
}, React.createElement(SearchIcon, null)))) : React.createElement(SearchIcon, {
|
|
1552
|
+
style: {
|
|
1553
|
+
marginRight: '4px'
|
|
1554
|
+
}
|
|
1555
|
+
}),
|
|
1551
1556
|
endAdornment: React.createElement(InputAdornment, {
|
|
1552
1557
|
position: "end"
|
|
1553
1558
|
}, React.createElement(Tooltip, {
|
|
@@ -2298,7 +2303,11 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
|
|
|
2298
2303
|
}, React.createElement(FilterListIcon, null)))), filterChipLabel && React.createElement(Chip, {
|
|
2299
2304
|
onDelete: handleClearEmptyFilterChip,
|
|
2300
2305
|
label: filterChipLabel
|
|
2301
|
-
})) : React.createElement(FilterListIcon,
|
|
2306
|
+
})) : React.createElement(FilterListIcon, {
|
|
2307
|
+
style: {
|
|
2308
|
+
marginRight: '4px'
|
|
2309
|
+
}
|
|
2310
|
+
}),
|
|
2302
2311
|
endAdornment: !filterChipLabel && React.createElement(InputAdornment, {
|
|
2303
2312
|
position: "end"
|
|
2304
2313
|
}, React.createElement(Tooltip, {
|
|
@@ -2343,7 +2352,7 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
|
|
|
2343
2352
|
return _extends({
|
|
2344
2353
|
p: 0,
|
|
2345
2354
|
minWidth: !filterChipLabel ? '6rem' : 'auto',
|
|
2346
|
-
width: '
|
|
2355
|
+
width: '100%',
|
|
2347
2356
|
'& .MuiSelect-icon': {
|
|
2348
2357
|
mr: '1.5rem'
|
|
2349
2358
|
}
|
|
@@ -2624,7 +2633,8 @@ var MRT_TableHeadCell = function MRT_TableHeadCell(_ref) {
|
|
|
2624
2633
|
var _getState = getState(),
|
|
2625
2634
|
density = _getState.density,
|
|
2626
2635
|
currentDraggingColumn = _getState.currentDraggingColumn,
|
|
2627
|
-
currentHoveredColumn = _getState.currentHoveredColumn
|
|
2636
|
+
currentHoveredColumn = _getState.currentHoveredColumn,
|
|
2637
|
+
showColumnFilters = _getState.showColumnFilters;
|
|
2628
2638
|
|
|
2629
2639
|
var column = header.column;
|
|
2630
2640
|
var columnDef = column.columnDef;
|
|
@@ -2687,7 +2697,7 @@ var MRT_TableHeadCell = function MRT_TableHeadCell(_ref) {
|
|
|
2687
2697
|
overflow: 'visible',
|
|
2688
2698
|
opacity: (currentDraggingColumn == null ? void 0 : currentDraggingColumn.id) === column.id || (currentHoveredColumn == null ? void 0 : currentHoveredColumn.id) === column.id ? 0.5 : 1,
|
|
2689
2699
|
p: density === 'compact' ? '0.5rem' : density === 'comfortable' ? columnDefType === 'display' ? '0.75rem' : '1rem' : columnDefType === 'display' ? '1rem 1.25rem' : '1.5rem',
|
|
2690
|
-
pb: columnDefType === 'display' ? 0 : undefined,
|
|
2700
|
+
pb: columnDefType === 'display' ? 0 : showColumnFilters ? '0.5rem' : undefined,
|
|
2691
2701
|
position: column.getIsPinned() && columnDefType !== 'group' ? 'sticky' : undefined,
|
|
2692
2702
|
pt: columnDefType === 'group' ? 0 : density === 'compact' ? '0.25' : density === 'comfortable' ? '.75rem' : '1.25rem',
|
|
2693
2703
|
right: column.getIsPinned() === 'right' ? getTotalRight() + "px" : undefined,
|
|
@@ -3721,7 +3731,8 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
|
|
|
3721
3731
|
getSubRows: function getSubRows(row) {
|
|
3722
3732
|
return row == null ? void 0 : row.subRows;
|
|
3723
3733
|
},
|
|
3724
|
-
globalFilterFn:
|
|
3734
|
+
globalFilterFn: //@ts-ignore
|
|
3735
|
+
(_MRT_FilterFns$curren = MRT_FilterFns[currentGlobalFilterFn]) != null ? _MRT_FilterFns$curren : MRT_FilterFns.fuzzy,
|
|
3725
3736
|
initialState: initialState,
|
|
3726
3737
|
state: _extends({
|
|
3727
3738
|
columnOrder: columnOrder,
|