material-react-table 1.9.1 → 1.9.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/dist/cjs/index.js CHANGED
@@ -2293,11 +2293,11 @@ const MRT_TableBodyRowGrabHandle = ({ cell, rowRef, table }) => {
2293
2293
 
2294
2294
  const allowedTypes = ['string', 'number'];
2295
2295
  const MRT_TableBodyCellValue = ({ cell, table }) => {
2296
- var _a, _b, _c, _d;
2296
+ var _a, _b, _c;
2297
2297
  const { getState, options: { enableFilterMatchHighlighting }, } = table;
2298
2298
  const { column, row } = cell;
2299
2299
  const { columnDef } = column;
2300
- const { globalFilter } = getState();
2300
+ const { globalFilter, globalFilterFn } = getState();
2301
2301
  const filterValue = column.getFilterValue();
2302
2302
  let renderedCellValue = cell.getIsAggregated() && columnDef.AggregatedCell
2303
2303
  ? columnDef.AggregatedCell({
@@ -2327,13 +2327,16 @@ const MRT_TableBodyCellValue = ({ cell, table }) => {
2327
2327
  ((filterValue &&
2328
2328
  allowedTypes.includes(typeof filterValue) &&
2329
2329
  columnDef.filterVariant === 'text') ||
2330
- (globalFilter && allowedTypes.includes(typeof globalFilter)))) {
2330
+ (globalFilter &&
2331
+ allowedTypes.includes(typeof globalFilter) &&
2332
+ column.getCanGlobalFilter()))) {
2331
2333
  const chunks = highlightWords__default["default"] === null || highlightWords__default["default"] === void 0 ? void 0 : highlightWords__default["default"]({
2332
2334
  text: renderedCellValue === null || renderedCellValue === void 0 ? void 0 : renderedCellValue.toString(),
2333
- query: ((_b = (_a = column.getFilterValue()) !== null && _a !== void 0 ? _a : globalFilter) !== null && _b !== void 0 ? _b : '').toString(),
2335
+ query: ((_a = filterValue !== null && filterValue !== void 0 ? filterValue : globalFilter) !== null && _a !== void 0 ? _a : '').toString(),
2336
+ matchExactly: (filterValue ? columnDef._filterFn : globalFilterFn) !== 'fuzzy',
2334
2337
  });
2335
- if ((chunks === null || chunks === void 0 ? void 0 : chunks.length) > 1 || ((_c = chunks === null || chunks === void 0 ? void 0 : chunks[0]) === null || _c === void 0 ? void 0 : _c.match)) {
2336
- renderedCellValue = (React__default["default"].createElement("span", { "aria-label": renderedCellValue, role: "note" }, (_d = chunks === null || chunks === void 0 ? void 0 : chunks.map(({ key, match, text }) => (React__default["default"].createElement(Box__default["default"], { "aria-hidden": "true", component: "span", key: key, sx: match
2338
+ if ((chunks === null || chunks === void 0 ? void 0 : chunks.length) > 1 || ((_b = chunks === null || chunks === void 0 ? void 0 : chunks[0]) === null || _b === void 0 ? void 0 : _b.match)) {
2339
+ renderedCellValue = (React__default["default"].createElement("span", { "aria-label": renderedCellValue, role: "note" }, (_c = chunks === null || chunks === void 0 ? void 0 : chunks.map(({ key, match, text }) => (React__default["default"].createElement(Box__default["default"], { "aria-hidden": "true", component: "span", key: key, sx: match
2337
2340
  ? {
2338
2341
  backgroundColor: (theme) => theme.palette.mode === 'dark'
2339
2342
  ? styles.darken(theme.palette.warning.dark, 0.25)
@@ -2342,7 +2345,7 @@ const MRT_TableBodyCellValue = ({ cell, table }) => {
2342
2345
  color: (theme) => theme.palette.mode === 'dark' ? 'white' : 'black',
2343
2346
  padding: '2px 1px',
2344
2347
  }
2345
- : undefined }, text)))) !== null && _d !== void 0 ? _d : renderedCellValue));
2348
+ : undefined }, text)))) !== null && _c !== void 0 ? _c : renderedCellValue));
2346
2349
  }
2347
2350
  }
2348
2351
  if (columnDef.Cell && !isGroupedValue) {