@dooherceg/material-react-table 3.2.2-alpha.0 → 3.2.2-alpha.10
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.d.ts +34 -10
- package/dist/index.esm.js +6 -12
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +6 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -712,10 +712,7 @@ const getDefaultColumnOrderIds = (tableOptions, reset = false) => {
|
|
|
712
712
|
const flexRender = reactTable.flexRender;
|
|
713
713
|
function createMRTColumnHelper() {
|
|
714
714
|
return {
|
|
715
|
-
accessor: (accessor, column) => {
|
|
716
|
-
return typeof accessor === 'function'
|
|
717
|
-
? Object.assign(Object.assign({}, column), { accessorFn: accessor }) : Object.assign(Object.assign({}, column), { accessorKey: accessor });
|
|
718
|
-
},
|
|
715
|
+
accessor: (accessor, column) => (Object.assign(Object.assign({}, column), { accessorKey: accessor })),
|
|
719
716
|
display: (column) => column,
|
|
720
717
|
group: (column) => column,
|
|
721
718
|
};
|
|
@@ -4265,14 +4262,11 @@ const getFilterableColumns = (table) => {
|
|
|
4265
4262
|
// Users define them as regular MRT_ColumnDef (same API), but they are not rendered as a column in the table.
|
|
4266
4263
|
const virtualColumns = allLeafColumns.flatMap((column) => {
|
|
4267
4264
|
var _a, _b;
|
|
4268
|
-
return ((_b = (_a = column.columnDef.meta) === null || _a === void 0 ? void 0 : _a.extraFieldFilters) !== null && _b !== void 0 ? _b : []).map((extraColumnDef) => {
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
columnDef: Object.assign(Object.assign({}, extraColumnDef), { columnDefType: 'data', enableColumnFilter: true }),
|
|
4274
|
-
});
|
|
4275
|
-
});
|
|
4265
|
+
return ((_b = (_a = column.columnDef.meta) === null || _a === void 0 ? void 0 : _a.extraFieldFilters) !== null && _b !== void 0 ? _b : []).map((extraColumnDef) => ({
|
|
4266
|
+
// accessorKey is the primary identifier; id as fallback
|
|
4267
|
+
id: getColumnId(extraColumnDef),
|
|
4268
|
+
columnDef: Object.assign(Object.assign({}, extraColumnDef), { columnDefType: 'data', enableColumnFilter: true }),
|
|
4269
|
+
}));
|
|
4276
4270
|
});
|
|
4277
4271
|
return [...realFilterableColumns, ...virtualColumns];
|
|
4278
4272
|
};
|