@dooherceg/material-react-table 3.2.2-alpha.7 → 3.2.2-alpha.9

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/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var reactTable = require('@tanstack/react-table');
4
3
  var matchSorterUtils = require('@tanstack/match-sorter-utils');
4
+ var reactTable = require('@tanstack/react-table');
5
5
  var react = require('react');
6
6
  var jsxRuntime = require('react/jsx-runtime');
7
7
  var IconButton = require('@mui/material/IconButton');
@@ -489,7 +489,7 @@ const cellKeyboardShortcuts = ({ cell, cellElements, cellValue, containerElement
489
489
  }
490
490
  };
491
491
 
492
- const getColumnId$1 = (columnDef) => { var _a, _b, _c, _d; return (_d = (_a = columnDef.id) !== null && _a !== void 0 ? _a : (_c = (_b = columnDef.accessorKey) === null || _b === void 0 ? void 0 : _b.toString) === null || _c === void 0 ? void 0 : _c.call(_b)) !== null && _d !== void 0 ? _d : columnDef.header; };
492
+ const getColumnId = (columnDef) => { var _a, _b, _c, _d; return (_d = (_a = columnDef.id) !== null && _a !== void 0 ? _a : (_c = (_b = columnDef.accessorKey) === null || _b === void 0 ? void 0 : _b.toString) === null || _c === void 0 ? void 0 : _c.call(_b)) !== null && _d !== void 0 ? _d : columnDef.header; };
493
493
  const getAllLeafColumnDefs = (columns) => {
494
494
  const allLeafColumnDefs = [];
495
495
  const getLeafColumns = (cols) => {
@@ -511,7 +511,7 @@ const prepareColumns = ({ columnDefs, tableOptions, }) => {
511
511
  var _a, _b;
512
512
  //assign columnId
513
513
  if (!columnDef.id)
514
- columnDef.id = getColumnId$1(columnDef);
514
+ columnDef.id = getColumnId(columnDef);
515
515
  //assign columnDefType
516
516
  if (!columnDef.columnDefType)
517
517
  columnDef.columnDefType = 'data';
@@ -696,7 +696,7 @@ const getDefaultColumnOrderIds = (tableOptions, reset = false) => {
696
696
  const { state: { columnOrder: currentColumnOrderIds = [] }, } = tableOptions;
697
697
  const leadingDisplayColIds = getLeadingDisplayColumnIds(tableOptions);
698
698
  const trailingDisplayColIds = getTrailingDisplayColumnIds(tableOptions);
699
- const defaultColumnDefIds = getAllLeafColumnDefs(tableOptions.columns).map((columnDef) => getColumnId$1(columnDef));
699
+ const defaultColumnDefIds = getAllLeafColumnDefs(tableOptions.columns).map((columnDef) => getColumnId(columnDef));
700
700
  let allLeafColumnDefIds = reset
701
701
  ? defaultColumnDefIds
702
702
  : Array.from(new Set([...currentColumnOrderIds, ...defaultColumnDefIds]));
@@ -721,7 +721,7 @@ function createMRTColumnHelper() {
721
721
  };
722
722
  }
723
723
  const createRow = (table, originalRow, rowIndex = -1, depth = 0, subRows, parentId) => reactTable.createRow(table, 'mrt-row-create', originalRow !== null && originalRow !== void 0 ? originalRow : Object.assign({}, ...getAllLeafColumnDefs(table.options.columns).map((col) => ({
724
- [getColumnId$1(col)]: '',
724
+ [getColumnId(col)]: '',
725
725
  }))), rowIndex, depth, subRows, parentId);
726
726
 
727
727
  const MRT_AggregationFns = Object.assign({}, reactTable.aggregationFns);
@@ -2274,9 +2274,9 @@ const useMRT_TableInstance = (definedTableOptions) => {
2274
2274
  const [columnFilterFns, setColumnFilterFns] = react.useState(() => Object.assign({}, ...getAllLeafColumnDefs(definedTableOptions.columns).map((col) => {
2275
2275
  var _a, _b, _c, _d;
2276
2276
  return ({
2277
- [getColumnId$1(col)]: col.filterFn instanceof Function
2277
+ [getColumnId(col)]: col.filterFn instanceof Function
2278
2278
  ? ((_a = col.filterFn.name) !== null && _a !== void 0 ? _a : 'custom')
2279
- : ((_d = (_b = col.filterFn) !== null && _b !== void 0 ? _b : (_c = initialState === null || initialState === void 0 ? void 0 : initialState.columnFilterFns) === null || _c === void 0 ? void 0 : _c[getColumnId$1(col)]) !== null && _d !== void 0 ? _d : getDefaultColumnFilterFn(col)),
2279
+ : ((_d = (_b = col.filterFn) !== null && _b !== void 0 ? _b : (_c = initialState === null || initialState === void 0 ? void 0 : initialState.columnFilterFns) === null || _c === void 0 ? void 0 : _c[getColumnId(col)]) !== null && _d !== void 0 ? _d : getDefaultColumnFilterFn(col)),
2280
2280
  });
2281
2281
  })));
2282
2282
  const [columnOrder, onColumnOrderChange] = react.useState((_c = initialState.columnOrder) !== null && _c !== void 0 ? _c : []);
@@ -2384,7 +2384,7 @@ const useMRT_TableInstance = (definedTableOptions) => {
2384
2384
  ? [
2385
2385
  ...Array(Math.min(statefulTableOptions.state.pagination.pageSize, 20)).fill(null),
2386
2386
  ].map(() => Object.assign({}, ...getAllLeafColumnDefs(statefulTableOptions.columns).map((col) => ({
2387
- [getColumnId$1(col)]: null,
2387
+ [getColumnId(col)]: null,
2388
2388
  }))))
2389
2389
  : rows, [
2390
2390
  rows,
@@ -4309,7 +4309,6 @@ const isFilterRuleIncomplete = (table, rule) => {
4309
4309
  // Delegate to the operator's own value-empty check
4310
4310
  return operator.isValueEmpty(rule.value);
4311
4311
  };
4312
- const getColumnId = (columnDef) => { var _a, _b, _c, _d; return (_d = (_a = columnDef.id) !== null && _a !== void 0 ? _a : (_c = (_b = columnDef.accessorKey) === null || _b === void 0 ? void 0 : _b.toString) === null || _c === void 0 ? void 0 : _c.call(_b)) !== null && _d !== void 0 ? _d : columnDef.header; };
4313
4312
 
4314
4313
  const FILTER_RULE_VALUE_TEST_ID = 'mrt-filter-rule-value';
4315
4314
  // Renders a single row in the advanced filter builder.
@@ -8091,7 +8090,7 @@ exports.flexRender = flexRender;
8091
8090
  exports.getAllLeafColumnDefs = getAllLeafColumnDefs;
8092
8091
  exports.getCanRankRows = getCanRankRows;
8093
8092
  exports.getColumnFilterInfo = getColumnFilterInfo;
8094
- exports.getColumnId = getColumnId$1;
8093
+ exports.getColumnId = getColumnId;
8095
8094
  exports.getDefaultColumnFilterFn = getDefaultColumnFilterFn;
8096
8095
  exports.getDefaultColumnOrderIds = getDefaultColumnOrderIds;
8097
8096
  exports.getDefaultColumnPinningState = getDefaultColumnPinningState;