@tanstack/svelte-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.
@@ -3017,25 +3017,18 @@
3017
3017
  var _table$getColumn;
3018
3018
  return [(_table$getColumn = table.getColumn(columnId)) == null ? void 0 : _table$getColumn.getFacetedRowModel()];
3019
3019
  }, facetedRowModel => {
3020
- var _facetedRowModel$flat;
3021
3020
  if (!facetedRowModel) return undefined;
3022
- const firstValue = (_facetedRowModel$flat = facetedRowModel.flatRows[0]) == null ? void 0 : _facetedRowModel$flat.getUniqueValues(columnId);
3023
- if (typeof firstValue === 'undefined') {
3024
- return undefined;
3021
+ const uniqueValues = facetedRowModel.flatRows.flatMap(flatRow => {
3022
+ var _flatRow$getUniqueVal;
3023
+ return (_flatRow$getUniqueVal = flatRow.getUniqueValues(columnId)) != null ? _flatRow$getUniqueVal : [];
3024
+ }).map(Number).filter(value => !Number.isNaN(value));
3025
+ if (!uniqueValues.length) return;
3026
+ let facetedMinValue = uniqueValues[0];
3027
+ let facetedMaxValue = uniqueValues[uniqueValues.length - 1];
3028
+ for (const value of uniqueValues) {
3029
+ if (value < facetedMinValue) facetedMinValue = value;else if (value > facetedMaxValue) facetedMaxValue = value;
3025
3030
  }
3026
- let facetedMinMaxValues = [firstValue, firstValue];
3027
- for (let i = 0; i < facetedRowModel.flatRows.length; i++) {
3028
- const values = facetedRowModel.flatRows[i].getUniqueValues(columnId);
3029
- for (let j = 0; j < values.length; j++) {
3030
- const value = values[j];
3031
- if (value < facetedMinMaxValues[0]) {
3032
- facetedMinMaxValues[0] = value;
3033
- } else if (value > facetedMinMaxValues[1]) {
3034
- facetedMinMaxValues[1] = value;
3035
- }
3036
- }
3037
- }
3038
- return facetedMinMaxValues;
3031
+ return [facetedMinValue, facetedMaxValue];
3039
3032
  }, getMemoOptions(table.options, 'debugTable', 'getFacetedMinMaxValues'));
3040
3033
  }
3041
3034