@tanstack/react-table 8.19.3 → 8.19.4
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.
|
@@ -3036,25 +3036,18 @@
|
|
|
3036
3036
|
var _table$getColumn;
|
|
3037
3037
|
return [(_table$getColumn = table.getColumn(columnId)) == null ? void 0 : _table$getColumn.getFacetedRowModel()];
|
|
3038
3038
|
}, facetedRowModel => {
|
|
3039
|
-
var _facetedRowModel$flat;
|
|
3040
3039
|
if (!facetedRowModel) return undefined;
|
|
3041
|
-
const
|
|
3042
|
-
|
|
3043
|
-
return
|
|
3040
|
+
const uniqueValues = facetedRowModel.flatRows.flatMap(flatRow => {
|
|
3041
|
+
var _flatRow$getUniqueVal;
|
|
3042
|
+
return (_flatRow$getUniqueVal = flatRow.getUniqueValues(columnId)) != null ? _flatRow$getUniqueVal : [];
|
|
3043
|
+
}).map(Number).filter(value => !Number.isNaN(value));
|
|
3044
|
+
if (!uniqueValues.length) return;
|
|
3045
|
+
let facetedMinValue = uniqueValues[0];
|
|
3046
|
+
let facetedMaxValue = uniqueValues[uniqueValues.length - 1];
|
|
3047
|
+
for (const value of uniqueValues) {
|
|
3048
|
+
if (value < facetedMinValue) facetedMinValue = value;else if (value > facetedMaxValue) facetedMaxValue = value;
|
|
3044
3049
|
}
|
|
3045
|
-
|
|
3046
|
-
for (let i = 0; i < facetedRowModel.flatRows.length; i++) {
|
|
3047
|
-
const values = facetedRowModel.flatRows[i].getUniqueValues(columnId);
|
|
3048
|
-
for (let j = 0; j < values.length; j++) {
|
|
3049
|
-
const value = values[j];
|
|
3050
|
-
if (value < facetedMinMaxValues[0]) {
|
|
3051
|
-
facetedMinMaxValues[0] = value;
|
|
3052
|
-
} else if (value > facetedMinMaxValues[1]) {
|
|
3053
|
-
facetedMinMaxValues[1] = value;
|
|
3054
|
-
}
|
|
3055
|
-
}
|
|
3056
|
-
}
|
|
3057
|
-
return facetedMinMaxValues;
|
|
3050
|
+
return [facetedMinValue, facetedMaxValue];
|
|
3058
3051
|
}, getMemoOptions(table.options, 'debugTable', 'getFacetedMinMaxValues'));
|
|
3059
3052
|
}
|
|
3060
3053
|
|