@tanstack/svelte-table 8.19.3 → 8.20.1
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.
|
@@ -205,7 +205,7 @@
|
|
|
205
205
|
...columnDef
|
|
206
206
|
};
|
|
207
207
|
const accessorKey = resolvedColumnDef.accessorKey;
|
|
208
|
-
let id = (_ref = (_resolvedColumnDef$id = resolvedColumnDef.id) != null ? _resolvedColumnDef$id : accessorKey ? accessorKey.
|
|
208
|
+
let id = (_ref = (_resolvedColumnDef$id = resolvedColumnDef.id) != null ? _resolvedColumnDef$id : accessorKey ? typeof String.prototype.replaceAll === 'function' ? accessorKey.replaceAll('.', '_') : accessorKey.replace(/\./g, '_') : undefined) != null ? _ref : typeof resolvedColumnDef.header === 'string' ? resolvedColumnDef.header : undefined;
|
|
209
209
|
let accessorFn;
|
|
210
210
|
if (resolvedColumnDef.accessorFn) {
|
|
211
211
|
accessorFn = resolvedColumnDef.accessorFn;
|
|
@@ -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
|
|
3023
|
-
|
|
3024
|
-
return
|
|
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
|
-
|
|
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
|
|