@tanstack/table-core
Advanced tools
Comparing version 8.5.15 to 8.5.16
@@ -23,3 +23,2 @@ /** | ||
}; | ||
const min = (columnId, _leafRows, childRows) => { | ||
@@ -29,3 +28,2 @@ let min; | ||
const value = row.getValue(columnId); | ||
if (value != null && (min > value || min === undefined && value >= value)) { | ||
@@ -37,3 +35,2 @@ min = value; | ||
}; | ||
const max = (columnId, _leafRows, childRows) => { | ||
@@ -43,3 +40,2 @@ let max; | ||
const value = row.getValue(columnId); | ||
if (value != null && (max < value || max === undefined && value >= value)) { | ||
@@ -51,3 +47,2 @@ max = value; | ||
}; | ||
const extent = (columnId, _leafRows, childRows) => { | ||
@@ -58,3 +53,2 @@ let min; | ||
const value = row.getValue(columnId); | ||
if (value != null) { | ||
@@ -71,3 +65,2 @@ if (min === undefined) { | ||
}; | ||
const mean = (columnId, leafRows) => { | ||
@@ -78,3 +71,2 @@ let count = 0; | ||
let value = row.getValue(columnId); | ||
if (value != null && (value = +value) >= value) { | ||
@@ -87,3 +79,2 @@ ++count, sum += value; | ||
}; | ||
const median = (columnId, leafRows) => { | ||
@@ -93,3 +84,2 @@ if (!leafRows.length) { | ||
} | ||
let min = 0; | ||
@@ -99,3 +89,2 @@ let max = 0; | ||
let value = row.getValue(columnId); | ||
if (typeof value === 'number') { | ||
@@ -108,15 +97,11 @@ min = Math.min(min, value); | ||
}; | ||
const unique = (columnId, leafRows) => { | ||
return Array.from(new Set(leafRows.map(d => d.getValue(columnId))).values()); | ||
}; | ||
const uniqueCount = (columnId, leafRows) => { | ||
return new Set(leafRows.map(d => d.getValue(columnId))).size; | ||
}; | ||
const count = (_columnId, leafRows) => { | ||
return leafRows.length; | ||
}; | ||
const aggregationFns = { | ||
@@ -123,0 +108,0 @@ sum, |
@@ -38,20 +38,28 @@ /** | ||
// } | ||
// const test: DeepKeys<Person> = 'nested.foo.0.bar' | ||
// const test2: DeepKeys<Person> = 'nested.bar' | ||
// const helper = createColumnHelper<Person>() | ||
// helper.accessor('nested.foo', { | ||
// cell: info => info.getValue(), | ||
// }) | ||
// helper.accessor('nested.foo.0.bar', { | ||
// cell: info => info.getValue(), | ||
// }) | ||
// helper.accessor('nested.bar', { | ||
// cell: info => info.getValue(), | ||
// }) | ||
function createColumnHelper() { | ||
return { | ||
accessor: (accessor, column) => { | ||
return typeof accessor === 'function' ? { ...column, | ||
return typeof accessor === 'function' ? { | ||
...column, | ||
accessorFn: accessor | ||
} : { ...column, | ||
} : { | ||
...column, | ||
accessorKey: accessor | ||
@@ -58,0 +66,0 @@ }; |
@@ -19,3 +19,2 @@ /** | ||
const getRenderValue = () => cell.getValue() ?? table.options.renderFallbackValue; | ||
const cell = { | ||
@@ -39,7 +38,5 @@ id: `${row.id}_${column.id}`, | ||
}; | ||
table._features.forEach(feature => { | ||
Object.assign(cell, feature.createCell == null ? void 0 : feature.createCell(cell, column, row, table)); | ||
}, {}); | ||
return cell; | ||
@@ -46,0 +43,0 @@ } |
@@ -19,4 +19,4 @@ /** | ||
const defaultColumn = table._getDefaultColumnDef(); | ||
const resolvedColumnDef = { ...defaultColumn, | ||
const resolvedColumnDef = { | ||
...defaultColumn, | ||
...columnDef | ||
@@ -27,3 +27,2 @@ }; | ||
let accessorFn; | ||
if (resolvedColumnDef.accessorFn) { | ||
@@ -36,7 +35,5 @@ accessorFn = resolvedColumnDef.accessorFn; | ||
let result = originalRow; | ||
for (const key of accessorKey.split('.')) { | ||
result = result[key]; | ||
} | ||
return result; | ||
@@ -48,3 +45,2 @@ }; | ||
} | ||
if (!id) { | ||
@@ -54,6 +50,4 @@ if (process.env.NODE_ENV !== 'production') { | ||
} | ||
throw new Error(); | ||
} | ||
let column = { | ||
@@ -68,3 +62,2 @@ id: `${String(id)}`, | ||
var _column$columns; | ||
return [column, ...((_column$columns = column.columns) == null ? void 0 : _column$columns.flatMap(d => d.getFlatColumns()))]; | ||
@@ -77,3 +70,2 @@ }, { | ||
var _column$columns2; | ||
if ((_column$columns2 = column.columns) != null && _column$columns2.length) { | ||
@@ -83,3 +75,2 @@ let leafColumns = column.columns.flatMap(column => column.getLeafColumns()); | ||
} | ||
return [column]; | ||
@@ -93,4 +84,5 @@ }, { | ||
return Object.assign(obj, feature.createColumn == null ? void 0 : feature.createColumn(column, table)); | ||
}, column); // Yes, we have to convert table to uknown, because we know more than the compiler here. | ||
}, column); | ||
// Yes, we have to convert table to uknown, because we know more than the compiler here. | ||
return column; | ||
@@ -97,0 +89,0 @@ } |
@@ -18,2 +18,3 @@ /** | ||
// | ||
function createHeader(table, column, options) { | ||
@@ -34,3 +35,2 @@ const id = options.id ?? column.id; | ||
const leafHeaders = []; | ||
const recurseHeader = h => { | ||
@@ -40,6 +40,4 @@ if (h.subHeaders && h.subHeaders.length) { | ||
} | ||
leafHeaders.push(h); | ||
}; | ||
recurseHeader(header); | ||
@@ -54,10 +52,7 @@ return leafHeaders; | ||
}; | ||
table._features.forEach(feature => { | ||
Object.assign(header, feature.createHeader == null ? void 0 : feature.createHeader(header, table)); | ||
}); | ||
return header; | ||
} | ||
const Headers = { | ||
@@ -67,2 +62,3 @@ createTable: table => { | ||
// Header Groups | ||
getHeaderGroups: utils.memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, leafColumns, left, right) => { | ||
@@ -100,2 +96,3 @@ const leftColumns = (left == null ? void 0 : left.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) ?? []; | ||
// Footer Groups | ||
getFooterGroups: utils.memo(() => [table.getHeaderGroups()], headerGroups => { | ||
@@ -126,2 +123,3 @@ return [...headerGroups].reverse(); | ||
// Flat Headers | ||
getFlatHeaders: utils.memo(() => [table.getHeaderGroups()], headerGroups => { | ||
@@ -160,6 +158,6 @@ return headerGroups.map(headerGroup => { | ||
// Leaf Headers | ||
getCenterLeafHeaders: utils.memo(() => [table.getCenterFlatHeaders()], flatHeaders => { | ||
return flatHeaders.filter(header => { | ||
var _header$subHeaders; | ||
return !((_header$subHeaders = header.subHeaders) != null && _header$subHeaders.length); | ||
@@ -174,3 +172,2 @@ }); | ||
var _header$subHeaders2; | ||
return !((_header$subHeaders2 = header.subHeaders) != null && _header$subHeaders2.length); | ||
@@ -185,3 +182,2 @@ }); | ||
var _header$subHeaders3; | ||
return !((_header$subHeaders3 = header.subHeaders) != null && _header$subHeaders3.length); | ||
@@ -195,3 +191,2 @@ }); | ||
var _left$, _center$, _right$; | ||
return [...(((_left$ = left[0]) == null ? void 0 : _left$.headers) ?? []), ...(((_center$ = center[0]) == null ? void 0 : _center$.headers) ?? []), ...(((_right$ = right[0]) == null ? void 0 : _right$.headers) ?? [])].map(header => { | ||
@@ -209,3 +204,2 @@ return header.getLeafHeaders(); | ||
var _headerGroups$; | ||
// Find the max depth of the columns: | ||
@@ -216,4 +210,4 @@ // build the leaf column row | ||
// real column for existing level | ||
let maxDepth = 0; | ||
const findMaxDepth = function (columns, depth) { | ||
@@ -223,7 +217,5 @@ if (depth === void 0) { | ||
} | ||
maxDepth = Math.max(maxDepth, depth); | ||
columns.filter(column => column.getIsVisible()).forEach(column => { | ||
var _column$columns; | ||
if ((_column$columns = column.columns) != null && _column$columns.length) { | ||
@@ -234,6 +226,4 @@ findMaxDepth(column.columns, depth + 1); | ||
}; | ||
findMaxDepth(allColumns); | ||
let headerGroups = []; | ||
const createHeaderGroup = (headersToGroup, depth) => { | ||
@@ -245,8 +235,11 @@ // The header group we are creating | ||
headers: [] | ||
}; // The parent columns we're going to scan next | ||
}; | ||
const pendingParentHeaders = []; // Scan each column for parents | ||
// The parent columns we're going to scan next | ||
const pendingParentHeaders = []; | ||
// Scan each column for parents | ||
headersToGroup.forEach(headerToGroup => { | ||
// What is the latest (last) parent column? | ||
const latestPendingParentHeader = [...pendingParentHeaders].reverse()[0]; | ||
@@ -256,3 +249,2 @@ const isLeafHeader = headerToGroup.column.depth === headerGroup.depth; | ||
let isPlaceholder = false; | ||
if (isLeafHeader && headerToGroup.column.parent) { | ||
@@ -266,3 +258,2 @@ // The parent header is new | ||
} | ||
if (latestPendingParentHeader && (latestPendingParentHeader == null ? void 0 : latestPendingParentHeader.column) === column) { | ||
@@ -279,10 +270,10 @@ // This column is repeated. Add it as a sub header to the next batch | ||
index: pendingParentHeaders.length | ||
}); // Add the headerToGroup as a subHeader of the new header | ||
}); | ||
header.subHeaders.push(headerToGroup); // Add the new header to the pendingParentHeaders to get grouped | ||
// Add the headerToGroup as a subHeader of the new header | ||
header.subHeaders.push(headerToGroup); | ||
// Add the new header to the pendingParentHeaders to get grouped | ||
// in the next batch | ||
pendingParentHeaders.push(header); | ||
} | ||
headerGroup.headers.push(headerToGroup); | ||
@@ -292,3 +283,2 @@ headerToGroup.headerGroup = headerGroup; | ||
headerGroups.push(headerGroup); | ||
if (depth > 0) { | ||
@@ -298,3 +288,2 @@ createHeaderGroup(pendingParentHeaders, depth - 1); | ||
}; | ||
const bottomHeaders = columnsToGroup.map((column, index) => createHeader(table, column, { | ||
@@ -305,3 +294,5 @@ depth: maxDepth, | ||
createHeaderGroup(bottomHeaders, maxDepth - 1); | ||
headerGroups.reverse(); // headerGroups = headerGroups.filter(headerGroup => { | ||
headerGroups.reverse(); | ||
// headerGroups = headerGroups.filter(headerGroup => { | ||
// return !headerGroup.headers.every(header => header.isPlaceholder) | ||
@@ -316,3 +307,2 @@ // }) | ||
let childRowSpans = [0]; | ||
if (header.subHeaders && header.subHeaders.length) { | ||
@@ -331,3 +321,2 @@ childRowSpans = []; | ||
} | ||
const minChildRowSpan = Math.min(...childRowSpans); | ||
@@ -343,3 +332,2 @@ rowSpan = rowSpan + minChildRowSpan; | ||
}; | ||
recurseHeadersForSpans(((_headerGroups$ = headerGroups[0]) == null ? void 0 : _headerGroups$.headers) ?? []); | ||
@@ -346,0 +334,0 @@ return headerGroups; |
@@ -29,9 +29,6 @@ /** | ||
} | ||
const column = table.getColumn(columnId); | ||
if (!column.accessorFn) { | ||
return undefined; | ||
} | ||
row._valuesCache[columnId] = column.accessorFn(row.original, rowIndex); | ||
@@ -61,3 +58,2 @@ return row._valuesCache[columnId]; | ||
}; | ||
for (let i = 0; i < table._features.length; i++) { | ||
@@ -67,3 +63,2 @@ const feature = table._features[i]; | ||
} | ||
return row; | ||
@@ -70,0 +65,0 @@ }; |
@@ -29,4 +29,6 @@ /** | ||
const features = [headers.Headers, Visibility.Visibility, Ordering.Ordering, Pinning.Pinning, Filters.Filters, Sorting.Sorting, Grouping.Grouping, Expanding.Expanding, Pagination.Pagination, RowSelection.RowSelection, ColumnSizing.ColumnSizing]; // | ||
const features = [headers.Headers, Visibility.Visibility, Ordering.Ordering, Pinning.Pinning, Filters.Filters, Sorting.Sorting, Grouping.Grouping, Expanding.Expanding, Pagination.Pagination, RowSelection.RowSelection, ColumnSizing.ColumnSizing]; | ||
// | ||
function createTable(options) { | ||
@@ -36,11 +38,8 @@ if (options.debugAll || options.debugTable) { | ||
} | ||
let table = { | ||
_features: features | ||
}; | ||
const defaultOptions = table._features.reduce((obj, feature) => { | ||
return Object.assign(obj, feature.getDefaultOptions == null ? void 0 : feature.getDefaultOptions(table)); | ||
}, {}); | ||
const mergeOptions = options => { | ||
@@ -50,17 +49,15 @@ if (table.options.mergeOptions) { | ||
} | ||
return { ...defaultOptions, | ||
return { | ||
...defaultOptions, | ||
...options | ||
}; | ||
}; | ||
const coreInitialState = {}; | ||
let initialState = { ...coreInitialState, | ||
let initialState = { | ||
...coreInitialState, | ||
...(options.initialState ?? {}) | ||
}; | ||
table._features.forEach(feature => { | ||
initialState = (feature.getInitialState == null ? void 0 : feature.getInitialState(initialState)) ?? initialState; | ||
}); | ||
const queued = []; | ||
@@ -70,3 +67,4 @@ let queuedTimeout = false; | ||
_features: features, | ||
options: { ...defaultOptions, | ||
options: { | ||
...defaultOptions, | ||
...options | ||
@@ -77,7 +75,7 @@ }, | ||
queued.push(cb); | ||
if (!queuedTimeout) { | ||
queuedTimeout = true; | ||
if (!queuedTimeout) { | ||
queuedTimeout = true; // Schedule a microtask to run the queued callbacks after | ||
// Schedule a microtask to run the queued callbacks after | ||
// the current call stack (render, etc) has finished. | ||
Promise.resolve().then(() => { | ||
@@ -87,3 +85,2 @@ while (queued.length) { | ||
} | ||
queuedTimeout = false; | ||
@@ -113,3 +110,2 @@ }).catch(error => setTimeout(() => { | ||
} | ||
return table._getCoreRowModel(); | ||
@@ -119,2 +115,3 @@ }, | ||
// expanded rows, which then work their way up | ||
getRowModel: () => { | ||
@@ -125,3 +122,2 @@ return table.getPaginationRowModel(); | ||
const row = table.getRowModel().rowsById[id]; | ||
if (!row) { | ||
@@ -131,6 +127,4 @@ if (process.env.NODE_ENV !== 'production') { | ||
} | ||
throw new Error(); | ||
} | ||
return row; | ||
@@ -143,11 +137,8 @@ }, | ||
const resolvedColumnDef = props.header.column.columnDef; | ||
if (resolvedColumnDef.accessorKey) { | ||
return resolvedColumnDef.accessorKey; | ||
} | ||
if (resolvedColumnDef.accessorFn) { | ||
return resolvedColumnDef.id; | ||
} | ||
return null; | ||
@@ -158,3 +149,2 @@ }, | ||
var _props$renderValue; | ||
return ((_props$renderValue = props.renderValue()) == null ? void 0 : _props$renderValue.toString == null ? void 0 : _props$renderValue.toString()) ?? null; | ||
@@ -177,3 +167,2 @@ }, | ||
} | ||
return columnDefs.map(columnDef => { | ||
@@ -186,3 +175,2 @@ const column$1 = column.createColumn(table, columnDef, depth, parent); | ||
}; | ||
return recurseColumns(columnDefs); | ||
@@ -219,3 +207,2 @@ }, { | ||
const column = table._getAllFlatColumnsById()[columnId]; | ||
if (!column) { | ||
@@ -225,6 +212,4 @@ if (process.env.NODE_ENV !== 'production') { | ||
} | ||
throw new Error(); | ||
} | ||
return column; | ||
@@ -234,7 +219,5 @@ } | ||
Object.assign(table, coreInstance); | ||
table._features.forEach(feature => { | ||
return Object.assign(table, feature.createTable == null ? void 0 : feature.createTable(table)); | ||
}); | ||
return table; | ||
@@ -241,0 +224,0 @@ } |
@@ -18,2 +18,3 @@ /** | ||
// | ||
const defaultColumnSizing = { | ||
@@ -24,3 +25,2 @@ size: 150, | ||
}; | ||
const getDefaultColumnSizingInfoState = () => ({ | ||
@@ -34,3 +34,2 @@ startOffset: null, | ||
}); | ||
const ColumnSizing = { | ||
@@ -63,3 +62,2 @@ getDefaultColumnDef: () => { | ||
const index = columns.findIndex(d => d.id === column.id); | ||
if (index > 0) { | ||
@@ -69,3 +67,2 @@ const prevSiblingColumn = columns[index - 1]; | ||
} | ||
return 0; | ||
@@ -94,3 +91,2 @@ }, | ||
let sum = 0; | ||
const recurse = header => { | ||
@@ -103,3 +99,2 @@ if (header.subHeaders.length) { | ||
}; | ||
recurse(header); | ||
@@ -113,3 +108,2 @@ return sum; | ||
} | ||
return 0; | ||
@@ -125,3 +119,2 @@ }, | ||
e.persist == null ? void 0 : e.persist(); | ||
if (isTouchStartEvent(e)) { | ||
@@ -133,7 +126,5 @@ // lets not respond to multiple touches (e.g. 2 or 3 fingers) | ||
} | ||
const startSize = header.getSize(); | ||
const columnSizingStart = header ? header.getLeafHeaders().map(d => [d.column.id, d.column.getSize()]) : [[column.id, column.getSize()]]; | ||
const clientX = isTouchStartEvent(e) ? Math.round(e.touches[0].clientX) : e.clientX; | ||
const updateOffset = (eventType, clientXPos) => { | ||
@@ -143,3 +134,2 @@ if (typeof clientXPos !== 'number') { | ||
} | ||
let newColumnSizing = {}; | ||
@@ -153,3 +143,4 @@ table.setColumnSizingInfo(old => { | ||
}); | ||
return { ...old, | ||
return { | ||
...old, | ||
deltaOffset, | ||
@@ -159,5 +150,5 @@ deltaPercentage | ||
}); | ||
if (table.options.columnResizeMode === 'onChange' || eventType === 'end') { | ||
table.setColumnSizing(old => ({ ...old, | ||
table.setColumnSizing(old => ({ | ||
...old, | ||
...newColumnSizing | ||
@@ -167,8 +158,7 @@ })); | ||
}; | ||
const onMove = clientXPos => updateOffset('move', clientXPos); | ||
const onEnd = clientXPos => { | ||
updateOffset('end', clientXPos); | ||
table.setColumnSizingInfo(old => ({ ...old, | ||
table.setColumnSizingInfo(old => ({ | ||
...old, | ||
isResizingColumn: false, | ||
@@ -182,3 +172,2 @@ startOffset: null, | ||
}; | ||
const mouseEvents = { | ||
@@ -192,12 +181,34 @@ moveHandler: e => onMove(e.clientX), | ||
}; | ||
const touchEvents = { | ||
moveHandler: e => { | ||
if (e.cancelable) { | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
} | ||
onMove(e.touches[0].clientX); | ||
return false; | ||
}, | ||
upHandler: e => { | ||
var _e$touches$; | ||
document.removeEventListener('touchmove', touchEvents.moveHandler); | ||
document.removeEventListener('touchend', touchEvents.upHandler); | ||
if (e.cancelable) { | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
} | ||
onEnd((_e$touches$ = e.touches[0]) == null ? void 0 : _e$touches$.clientX); | ||
} | ||
}; | ||
const passiveIfSupported = passiveEventSupported() ? { | ||
passive: false | ||
} : false; | ||
if (isTouchStartEvent(e)) ; else { | ||
if (isTouchStartEvent(e)) { | ||
document.addEventListener('touchmove', touchEvents.moveHandler, passiveIfSupported); | ||
document.addEventListener('touchend', touchEvents.upHandler, passiveIfSupported); | ||
} else { | ||
document.addEventListener('mousemove', mouseEvents.moveHandler, passiveIfSupported); | ||
document.addEventListener('mouseup', mouseEvents.upHandler, passiveIfSupported); | ||
} | ||
table.setColumnSizingInfo(old => ({ ...old, | ||
table.setColumnSizingInfo(old => ({ | ||
...old, | ||
startOffset: clientX, | ||
@@ -226,3 +237,2 @@ startSize, | ||
var _table$getHeaderGroup; | ||
return ((_table$getHeaderGroup = table.getHeaderGroups()[0]) == null ? void 0 : _table$getHeaderGroup.headers.reduce((sum, header) => { | ||
@@ -234,3 +244,2 @@ return sum + header.getSize(); | ||
var _table$getLeftHeaderG; | ||
return ((_table$getLeftHeaderG = table.getLeftHeaderGroups()[0]) == null ? void 0 : _table$getLeftHeaderG.headers.reduce((sum, header) => { | ||
@@ -242,3 +251,2 @@ return sum + header.getSize(); | ||
var _table$getCenterHeade; | ||
return ((_table$getCenterHeade = table.getCenterHeaderGroups()[0]) == null ? void 0 : _table$getCenterHeade.headers.reduce((sum, header) => { | ||
@@ -250,3 +258,2 @@ return sum + header.getSize(); | ||
var _table$getRightHeader; | ||
return ((_table$getRightHeader = table.getRightHeaderGroups()[0]) == null ? void 0 : _table$getRightHeader.headers.reduce((sum, header) => { | ||
@@ -263,3 +270,2 @@ return sum + header.getSize(); | ||
let supported = false; | ||
try { | ||
@@ -271,7 +277,4 @@ const options = { | ||
} | ||
}; | ||
const noop = () => {}; | ||
window.addEventListener('test', noop, options); | ||
@@ -282,7 +285,5 @@ window.removeEventListener('test', noop); | ||
} | ||
passiveSupported = supported; | ||
return passiveSupported; | ||
} | ||
function isTouchStartEvent(e) { | ||
@@ -289,0 +290,0 @@ return e.type === 'touchstart'; |
@@ -18,2 +18,3 @@ /** | ||
// | ||
const Expanding = { | ||
@@ -41,10 +42,7 @@ getInitialState: state => { | ||
}); | ||
return; | ||
} | ||
if (table.options.autoResetAll ?? table.options.autoResetExpanded ?? !table.options.manualExpanding) { | ||
if (queued) return; | ||
queued = true; | ||
table._queue(() => { | ||
@@ -66,3 +64,2 @@ table.resetExpanded(); | ||
var _table$initialState; | ||
table.setExpanded(defaultState ? {} : ((_table$initialState = table.initialState) == null ? void 0 : _table$initialState.expanded) ?? {}); | ||
@@ -84,18 +81,18 @@ }, | ||
getIsAllRowsExpanded: () => { | ||
const expanded = table.getState().expanded; // If expanded is true, save some cycles and return true | ||
const expanded = table.getState().expanded; | ||
// If expanded is true, save some cycles and return true | ||
if (typeof expanded === 'boolean') { | ||
return expanded === true; | ||
} | ||
if (!Object.keys(expanded).length) { | ||
return false; | ||
} // If any row is not expanded, return false | ||
} | ||
// If any row is not expanded, return false | ||
if (table.getRowModel().flatRows.some(row => !row.getIsExpanded())) { | ||
return false; | ||
} // They must all be expanded :shrug: | ||
} | ||
// They must all be expanded :shrug: | ||
return true; | ||
@@ -117,7 +114,5 @@ }, | ||
} | ||
if (table.options.manualExpanding || !table._getExpandedRowModel) { | ||
return table.getPreExpandedRowModel(); | ||
} | ||
return table._getExpandedRowModel(); | ||
@@ -133,3 +128,2 @@ } | ||
let oldExpanded = {}; | ||
if (old === true) { | ||
@@ -142,11 +136,9 @@ Object.keys(table.getRowModel().rowsById).forEach(rowId => { | ||
} | ||
expanded = expanded ?? !exists; | ||
if (!exists && expanded) { | ||
return { ...oldExpanded, | ||
return { | ||
...oldExpanded, | ||
[row.id]: true | ||
}; | ||
} | ||
if (exists && !expanded) { | ||
@@ -159,3 +151,2 @@ const { | ||
} | ||
return old; | ||
@@ -170,3 +161,2 @@ }); | ||
var _row$subRows; | ||
return (table.options.getRowCanExpand == null ? void 0 : table.options.getRowCanExpand(row)) ?? ((table.options.enableExpanding ?? true) && !!((_row$subRows = row.subRows) != null && _row$subRows.length)); | ||
@@ -173,0 +163,0 @@ }, |
@@ -19,2 +19,3 @@ /** | ||
// | ||
const Filters = { | ||
@@ -43,3 +44,2 @@ getDefaultColumnDef: () => { | ||
var _table$getCoreRowMode, _table$getCoreRowMode2; | ||
const value = (_table$getCoreRowMode = table.getCoreRowModel().flatRows[0]) == null ? void 0 : (_table$getCoreRowMode2 = _table$getCoreRowMode._getAllCellsByColumnId()[column.id]) == null ? void 0 : _table$getCoreRowMode2.getValue(); | ||
@@ -55,23 +55,17 @@ return typeof value === 'string' || typeof value === 'number'; | ||
const value = firstRow == null ? void 0 : firstRow.getValue(column.id); | ||
if (typeof value === 'string') { | ||
return filterFns.filterFns.includesString; | ||
} | ||
if (typeof value === 'number') { | ||
return filterFns.filterFns.inNumberRange; | ||
} | ||
if (typeof value === 'boolean') { | ||
return filterFns.filterFns.equals; | ||
} | ||
if (value !== null && typeof value === 'object') { | ||
return filterFns.filterFns.equals; | ||
} | ||
if (Array.isArray(value)) { | ||
return filterFns.filterFns.arrIncludes; | ||
} | ||
return filterFns.filterFns.weakEquals; | ||
@@ -81,3 +75,2 @@ }, | ||
var _table$options$filter; | ||
return utils.isFunction(column.columnDef.filterFn) ? column.columnDef.filterFn : column.columnDef.filterFn === 'auto' ? column.getAutoFilterFn() : ((_table$options$filter = table.options.filterFns) == null ? void 0 : _table$options$filter[column.columnDef.filterFn]) ?? filterFns.filterFns[column.columnDef.filterFn]; | ||
@@ -94,3 +87,2 @@ }, | ||
var _table$getState$colum, _table$getState$colum2; | ||
return (_table$getState$colum = table.getState().columnFilters) == null ? void 0 : (_table$getState$colum2 = _table$getState$colum.find(d => d.id === column.id)) == null ? void 0 : _table$getState$colum2.value; | ||
@@ -100,3 +92,2 @@ }, | ||
var _table$getState$colum3; | ||
return ((_table$getState$colum3 = table.getState().columnFilters) == null ? void 0 : _table$getState$colum3.findIndex(d => d.id === column.id)) ?? -1; | ||
@@ -108,8 +99,8 @@ }, | ||
const previousfilter = old == null ? void 0 : old.find(d => d.id === column.id); | ||
const newFilter = utils.functionalUpdate(value, previousfilter ? previousfilter.value : undefined); // | ||
const newFilter = utils.functionalUpdate(value, previousfilter ? previousfilter.value : undefined); | ||
// | ||
if (shouldAutoRemoveFilter(filterFn, newFilter, column)) { | ||
return (old == null ? void 0 : old.filter(d => d.id !== column.id)) ?? []; | ||
} | ||
const newFilterObj = { | ||
@@ -119,3 +110,2 @@ id: column.id, | ||
}; | ||
if (previousfilter) { | ||
@@ -126,11 +116,8 @@ return (old == null ? void 0 : old.map(d => { | ||
} | ||
return d; | ||
})) ?? []; | ||
} | ||
if (old != null && old.length) { | ||
return [...old, newFilterObj]; | ||
} | ||
return [newFilterObj]; | ||
@@ -144,3 +131,2 @@ }); | ||
} | ||
return column._getFacetedRowModel(); | ||
@@ -153,3 +139,2 @@ }, | ||
} | ||
return column._getFacetedUniqueValues(); | ||
@@ -162,9 +147,9 @@ }, | ||
} | ||
return column._getFacetedMinMaxValues(); | ||
} // () => [column.getFacetedRowModel()], | ||
} | ||
// () => [column.getFacetedRowModel()], | ||
// facetedRowModel => getRowModelMinMaxValues(facetedRowModel, column.id), | ||
}; | ||
}, | ||
createRow: (row, table) => { | ||
@@ -183,3 +168,2 @@ return { | ||
var _table$options$filter2; | ||
const { | ||
@@ -192,12 +176,8 @@ globalFilterFn: globalFilterFn | ||
const leafColumns = table.getAllLeafColumns(); | ||
const updateFn = old => { | ||
var _functionalUpdate; | ||
return (_functionalUpdate = utils.functionalUpdate(updater, old)) == null ? void 0 : _functionalUpdate.filter(filter => { | ||
const column = leafColumns.find(d => d.id === filter.id); | ||
if (column) { | ||
const filterFn = column.getFilterFn(); | ||
if (shouldAutoRemoveFilter(filterFn, filter.value, column)) { | ||
@@ -207,7 +187,5 @@ return false; | ||
} | ||
return true; | ||
}); | ||
}; | ||
table.options.onColumnFiltersChange == null ? void 0 : table.options.onColumnFiltersChange(updateFn); | ||
@@ -223,3 +201,2 @@ }, | ||
var _table$initialState; | ||
table.setColumnFilters(defaultState ? [] : ((_table$initialState = table.initialState) == null ? void 0 : _table$initialState.columnFilters) ?? []); | ||
@@ -232,7 +209,5 @@ }, | ||
} | ||
if (table.options.manualFiltering || !table._getFilteredRowModel) { | ||
return table.getPreFilteredRowModel(); | ||
} | ||
return table._getFilteredRowModel(); | ||
@@ -245,3 +220,2 @@ }, | ||
} | ||
return table._getGlobalFacetedRowModel(); | ||
@@ -254,3 +228,2 @@ }, | ||
} | ||
return table._getGlobalFacetedUniqueValues(); | ||
@@ -263,3 +236,2 @@ }, | ||
} | ||
return table._getGlobalFacetedMinMaxValues(); | ||
@@ -266,0 +238,0 @@ } |
@@ -19,2 +19,3 @@ /** | ||
// | ||
const Grouping = { | ||
@@ -25,3 +26,2 @@ getDefaultColumnDef: () => { | ||
var _props$getValue; | ||
return ((_props$getValue = props.getValue()) == null ? void 0 : _props$getValue.toString == null ? void 0 : _props$getValue.toString()) ?? null; | ||
@@ -52,3 +52,2 @@ }, | ||
} | ||
return [...(old ?? []), column.id]; | ||
@@ -62,3 +61,2 @@ }); | ||
var _table$getState$group; | ||
return (_table$getState$group = table.getState().grouping) == null ? void 0 : _table$getState$group.includes(column.id); | ||
@@ -68,3 +66,2 @@ }, | ||
var _table$getState$group2; | ||
return (_table$getState$group2 = table.getState().grouping) == null ? void 0 : _table$getState$group2.indexOf(column.id); | ||
@@ -82,7 +79,5 @@ }, | ||
const value = firstRow == null ? void 0 : firstRow.getValue(column.id); | ||
if (typeof value === 'number') { | ||
return aggregationFns.aggregationFns.sum; | ||
} | ||
if (Object.prototype.toString.call(value) === '[object Date]') { | ||
@@ -94,7 +89,5 @@ return aggregationFns.aggregationFns.extent; | ||
var _table$options$aggreg; | ||
if (!column) { | ||
throw new Error(); | ||
} | ||
return utils.isFunction(column.columnDef.aggregationFn) ? column.columnDef.aggregationFn : column.columnDef.aggregationFn === 'auto' ? column.getAutoAggregationFn() : ((_table$options$aggreg = table.options.aggregationFns) == null ? void 0 : _table$options$aggreg[column.columnDef.aggregationFn]) ?? aggregationFns.aggregationFns[column.columnDef.aggregationFn]; | ||
@@ -109,3 +102,2 @@ } | ||
var _table$initialState; | ||
table.setGrouping(defaultState ? [] : ((_table$initialState = table.initialState) == null ? void 0 : _table$initialState.grouping) ?? []); | ||
@@ -118,7 +110,5 @@ }, | ||
} | ||
if (table.options.manualGrouping || !table._getGroupedRowModel) { | ||
return table.getPreGroupedRowModel(); | ||
} | ||
return table._getGroupedRowModel(); | ||
@@ -135,3 +125,2 @@ } | ||
createCell: (cell, column, row, table) => { | ||
return { | ||
@@ -142,3 +131,2 @@ getIsGrouped: () => column.getIsGrouped() && column.id === row.groupingColumnId, | ||
var _row$subRows; | ||
return !cell.getIsGrouped() && !cell.getIsPlaceholder() && !!((_row$subRows = row.subRows) != null && _row$subRows.length); | ||
@@ -153,9 +141,6 @@ } | ||
} | ||
const nonGroupingColumns = leafColumns.filter(col => !grouping.includes(col.id)); | ||
if (groupedColumnMode === 'remove') { | ||
return nonGroupingColumns; | ||
} | ||
const groupingColumns = grouping.map(g => leafColumns.find(col => col.id === g)).filter(Boolean); | ||
@@ -162,0 +147,0 @@ return [...groupingColumns, ...nonGroupingColumns]; |
@@ -19,2 +19,3 @@ /** | ||
// | ||
const Ordering = { | ||
@@ -41,29 +42,31 @@ getInitialState: state => { | ||
// before the headers are built | ||
let orderedColumns = []; // If there is no order, return the normal columns | ||
let orderedColumns = []; | ||
// If there is no order, return the normal columns | ||
if (!(columnOrder != null && columnOrder.length)) { | ||
orderedColumns = columns; | ||
} else { | ||
const columnOrderCopy = [...columnOrder]; // If there is an order, make a copy of the columns | ||
const columnOrderCopy = [...columnOrder]; | ||
const columnsCopy = [...columns]; // And make a new ordered array of the columns | ||
// If there is an order, make a copy of the columns | ||
const columnsCopy = [...columns]; | ||
// And make a new ordered array of the columns | ||
// Loop over the columns and place them in order into the new array | ||
while (columnsCopy.length && columnOrderCopy.length) { | ||
const targetColumnId = columnOrderCopy.shift(); | ||
const foundIndex = columnsCopy.findIndex(d => d.id === targetColumnId); | ||
if (foundIndex > -1) { | ||
orderedColumns.push(columnsCopy.splice(foundIndex, 1)[0]); | ||
} | ||
} // If there are any columns left, add them to the end | ||
} | ||
// If there are any columns left, add them to the end | ||
orderedColumns = [...orderedColumns, ...columnsCopy]; | ||
} | ||
return Grouping.orderColumns(orderedColumns, grouping, groupedColumnMode); | ||
}, { | ||
key: process.env.NODE_ENV === 'development' && 'getOrderColumnsFn' // debug: () => table.options.debugAll ?? table.options.debugTable, | ||
key: process.env.NODE_ENV === 'development' && 'getOrderColumnsFn' | ||
// debug: () => table.options.debugAll ?? table.options.debugTable, | ||
}) | ||
@@ -70,0 +73,0 @@ }; |
@@ -18,5 +18,5 @@ /** | ||
// | ||
const defaultPageIndex = 0; | ||
const defaultPageSize = 10; | ||
const getDefaultPaginationState = () => ({ | ||
@@ -26,7 +26,8 @@ pageIndex: defaultPageIndex, | ||
}); | ||
const Pagination = { | ||
getInitialState: state => { | ||
return { ...state, | ||
pagination: { ...getDefaultPaginationState(), | ||
return { | ||
...state, | ||
pagination: { | ||
...getDefaultPaginationState(), | ||
...(state == null ? void 0 : state.pagination) | ||
@@ -50,10 +51,7 @@ } | ||
}); | ||
return; | ||
} | ||
if (table.options.autoResetAll ?? table.options.autoResetPageIndex ?? !table.options.manualPagination) { | ||
if (queued) return; | ||
queued = true; | ||
table._queue(() => { | ||
@@ -70,3 +68,2 @@ table.resetPageIndex(); | ||
}; | ||
return table.options.onPaginationChange == null ? void 0 : table.options.onPaginationChange(safeUpdater); | ||
@@ -82,3 +79,4 @@ }, | ||
pageIndex = Math.min(Math.max(0, pageIndex), maxPageIndex); | ||
return { ...old, | ||
return { | ||
...old, | ||
pageIndex | ||
@@ -90,3 +88,2 @@ }; | ||
var _table$initialState, _table$initialState$p; | ||
table.setPageIndex(defaultState ? defaultPageIndex : ((_table$initialState = table.initialState) == null ? void 0 : (_table$initialState$p = _table$initialState.pagination) == null ? void 0 : _table$initialState$p.pageIndex) ?? defaultPageIndex); | ||
@@ -96,3 +93,2 @@ }, | ||
var _table$initialState2, _table$initialState2$; | ||
table.setPageSize(defaultState ? defaultPageSize : ((_table$initialState2 = table.initialState) == null ? void 0 : (_table$initialState2$ = _table$initialState2.pagination) == null ? void 0 : _table$initialState2$.pageSize) ?? defaultPageSize); | ||
@@ -105,3 +101,4 @@ }, | ||
const pageIndex = Math.floor(topRowIndex / pageSize); | ||
return { ...old, | ||
return { | ||
...old, | ||
pageIndex, | ||
@@ -114,8 +111,7 @@ pageSize | ||
let newPageCount = utils.functionalUpdate(updater, table.options.pageCount ?? -1); | ||
if (typeof newPageCount === 'number') { | ||
newPageCount = Math.max(-1, newPageCount); | ||
} | ||
return { ...old, | ||
return { | ||
...old, | ||
pageCount: newPageCount | ||
@@ -126,7 +122,5 @@ }; | ||
let pageOptions = []; | ||
if (pageCount && pageCount > 0) { | ||
pageOptions = [...new Array(pageCount)].fill(null).map((_, i) => i); | ||
} | ||
return pageOptions; | ||
@@ -143,11 +137,8 @@ }, { | ||
const pageCount = table.getPageCount(); | ||
if (pageCount === -1) { | ||
return true; | ||
} | ||
if (pageCount === 0) { | ||
return false; | ||
} | ||
return pageIndex < pageCount - 1; | ||
@@ -168,7 +159,5 @@ }, | ||
} | ||
if (table.options.manualPagination || !table._getPaginationRowModel) { | ||
return table.getPrePaginationRowModel(); | ||
} | ||
return table._getPaginationRowModel(); | ||
@@ -175,0 +164,0 @@ }, |
@@ -18,2 +18,3 @@ /** | ||
// | ||
const getDefaultPinningState = () => ({ | ||
@@ -23,3 +24,2 @@ left: [], | ||
}); | ||
const Pinning = { | ||
@@ -48,3 +48,2 @@ getInitialState: state => { | ||
} | ||
if (position === 'left') { | ||
@@ -56,3 +55,2 @@ return { | ||
} | ||
return { | ||
@@ -80,3 +78,2 @@ left: ((old == null ? void 0 : old.left) ?? []).filter(d => !(columnIds != null && columnIds.includes(d))), | ||
var _table$getState$colum, _table$getState$colum2; | ||
const position = column.getIsPinned(); | ||
@@ -97,3 +94,4 @@ return position ? ((_table$getState$colum = table.getState().columnPinning) == null ? void 0 : (_table$getState$colum2 = _table$getState$colum[position]) == null ? void 0 : _table$getState$colum2.indexOf(column.id)) ?? -1 : 0; | ||
getLeftVisibleCells: utils.memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.left,,], (allCells, left) => { | ||
const cells = (left ?? []).map(columnId => allCells.find(cell => cell.column.id === columnId)).filter(Boolean).map(d => ({ ...d, | ||
const cells = (left ?? []).map(columnId => allCells.find(cell => cell.column.id === columnId)).filter(Boolean).map(d => ({ | ||
...d, | ||
position: 'left' | ||
@@ -107,3 +105,4 @@ })); | ||
getRightVisibleCells: utils.memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.right], (allCells, right) => { | ||
const cells = (right ?? []).map(columnId => allCells.find(cell => cell.column.id === columnId)).filter(Boolean).map(d => ({ ...d, | ||
const cells = (right ?? []).map(columnId => allCells.find(cell => cell.column.id === columnId)).filter(Boolean).map(d => ({ | ||
...d, | ||
position: 'right' | ||
@@ -123,3 +122,2 @@ })); | ||
var _table$initialState; | ||
return table.setColumnPinning(defaultState ? getDefaultPinningState() : ((_table$initialState = table.initialState) == null ? void 0 : _table$initialState.columnPinning) ?? getDefaultPinningState()); | ||
@@ -129,11 +127,7 @@ }, | ||
var _pinningState$positio; | ||
const pinningState = table.getState().columnPinning; | ||
if (!position) { | ||
var _pinningState$left, _pinningState$right; | ||
return Boolean(((_pinningState$left = pinningState.left) == null ? void 0 : _pinningState$left.length) || ((_pinningState$right = pinningState.right) == null ? void 0 : _pinningState$right.length)); | ||
} | ||
return Boolean((_pinningState$positio = pinningState[position]) == null ? void 0 : _pinningState$positio.length); | ||
@@ -140,0 +134,0 @@ }, |
@@ -18,2 +18,3 @@ /** | ||
// | ||
const RowSelection = { | ||
@@ -31,8 +32,9 @@ getInitialState: state => { | ||
enableMultiRowSelection: true, | ||
enableSubRowSelection: true // enableGroupingRowSelection: false, | ||
enableSubRowSelection: true | ||
// enableGroupingRowSelection: false, | ||
// isAdditiveSelectEvent: (e: unknown) => !!e.metaKey, | ||
// isInclusiveSelectEvent: (e: unknown) => !!e.shiftKey, | ||
}; | ||
}, | ||
createTable: table => { | ||
@@ -45,7 +47,9 @@ return { | ||
value = typeof value !== 'undefined' ? value : !table.getIsAllRowsSelected(); | ||
const rowSelection = { ...old | ||
const rowSelection = { | ||
...old | ||
}; | ||
const preGroupedFlatRows = table.getPreGroupedRowModel().flatRows; // We don't use `mutateRowIsSelected` here for performance reasons. | ||
const preGroupedFlatRows = table.getPreGroupedRowModel().flatRows; | ||
// We don't use `mutateRowIsSelected` here for performance reasons. | ||
// All of the rows are flat already, so it wouldn't be worth it | ||
if (value) { | ||
@@ -56,3 +60,2 @@ preGroupedFlatRows.forEach(row => { | ||
} | ||
rowSelection[row.id] = true; | ||
@@ -65,3 +68,2 @@ }); | ||
} | ||
return rowSelection; | ||
@@ -72,3 +74,4 @@ }); | ||
const resolvedValue = typeof value !== 'undefined' ? value : !table.getIsAllPageRowsSelected(); | ||
const rowSelection = { ...old | ||
const rowSelection = { | ||
...old | ||
}; | ||
@@ -86,2 +89,3 @@ table.getRowModel().rows.forEach(row => { | ||
// } = table | ||
// const findSelectedRow = (rows: Row[]) => { | ||
@@ -103,6 +107,9 @@ // let found | ||
// } | ||
// const firstRow = findSelectedRow(rows) || rows[0] | ||
// const lastRow = rowsById[rowId] | ||
// let include = false | ||
// const selectedRowIds = {} | ||
// const addRow = (row: Row) => { | ||
@@ -115,5 +122,7 @@ // mutateRowIsSelected(selectedRowIds, row.id, true, { | ||
// } | ||
// table.rows.forEach(row => { | ||
// const isFirstRow = row.id === firstRow.id | ||
// const isLastRow = row.id === lastRow.id | ||
// if (isFirstRow || isLastRow) { | ||
@@ -127,2 +136,3 @@ // if (!include) { | ||
// } | ||
// if (include) { | ||
@@ -132,2 +142,3 @@ // addRow(row) | ||
// }) | ||
// table.setRowSelection(selectedRowIds) | ||
@@ -144,3 +155,2 @@ // }, | ||
} | ||
return selectRowsFn(table, rowModel); | ||
@@ -159,3 +169,2 @@ }, { | ||
} | ||
return selectRowsFn(table, rowModel); | ||
@@ -174,3 +183,2 @@ }, { | ||
} | ||
return selectRowsFn(table, rowModel); | ||
@@ -182,12 +190,17 @@ }, { | ||
/// | ||
// getGroupingRowCanSelect: rowId => { | ||
// const row = table.getRow(rowId) | ||
// if (!row) { | ||
// throw new Error() | ||
// } | ||
// if (typeof table.options.enableGroupingRowSelection === 'function') { | ||
// return table.options.enableGroupingRowSelection(row) | ||
// } | ||
// return table.options.enableGroupingRowSelection ?? false | ||
// }, | ||
getIsAllRowsSelected: () => { | ||
@@ -199,3 +212,2 @@ const preGroupedFlatRows = table.getFilteredRowModel().flatRows; | ||
let isAllRowsSelected = Boolean(preGroupedFlatRows.length && Object.keys(rowSelection).length); | ||
if (isAllRowsSelected) { | ||
@@ -206,3 +218,2 @@ if (preGroupedFlatRows.some(row => row.getCanSelect() && !rowSelection[row.id])) { | ||
} | ||
return isAllRowsSelected; | ||
@@ -216,7 +227,5 @@ }, | ||
let isAllPageRowsSelected = !!paginationFlatRows.length; | ||
if (isAllPageRowsSelected && paginationFlatRows.some(row => !rowSelection[row.id])) { | ||
isAllPageRowsSelected = false; | ||
} | ||
return isAllPageRowsSelected; | ||
@@ -250,8 +259,7 @@ }, | ||
value = typeof value !== 'undefined' ? value : !isSelected; | ||
if (isSelected === value) { | ||
return old; | ||
} | ||
const selectedRowIds = { ...old | ||
const selectedRowIds = { | ||
...old | ||
}; | ||
@@ -284,3 +292,2 @@ mutateRowIsSelected(selectedRowIds, row.id, value, table); | ||
} | ||
return table.options.enableRowSelection ?? true; | ||
@@ -292,3 +299,2 @@ }, | ||
} | ||
return table.options.enableSubRowSelection ?? true; | ||
@@ -300,3 +306,2 @@ }, | ||
} | ||
return table.options.enableMultiRowSelection ?? true; | ||
@@ -308,3 +313,2 @@ }, | ||
var _target; | ||
if (!canSelect) return; | ||
@@ -317,7 +321,8 @@ row.toggleSelected((_target = e.target) == null ? void 0 : _target.checked); | ||
}; | ||
const mutateRowIsSelected = (selectedRowIds, id, value, table) => { | ||
var _row$subRows; | ||
const row = table.getRow(id); | ||
const row = table.getRow(id); // const isGrouped = row.getIsGrouped() | ||
// const isGrouped = row.getIsGrouped() | ||
// if ( // TODO: enforce grouping row selection rules | ||
@@ -327,3 +332,2 @@ // !isGrouped || | ||
// ) { | ||
if (value) { | ||
@@ -333,3 +337,2 @@ if (!row.getCanMultiSelect()) { | ||
} | ||
if (row.getCanSelect()) { | ||
@@ -340,5 +343,5 @@ selectedRowIds[id] = true; | ||
delete selectedRowIds[id]; | ||
} // } | ||
} | ||
// } | ||
if ((_row$subRows = row.subRows) != null && _row$subRows.length && row.getCanSelectSubRows()) { | ||
@@ -348,15 +351,12 @@ row.subRows.forEach(row => mutateRowIsSelected(selectedRowIds, row.id, value, table)); | ||
}; | ||
function selectRowsFn(table, rowModel) { | ||
const rowSelection = table.getState().rowSelection; | ||
const newSelectedFlatRows = []; | ||
const newSelectedRowsById = {}; // Filters top level and nested rows | ||
const newSelectedRowsById = {}; | ||
// Filters top level and nested rows | ||
const recurseRows = function (rows, depth) { | ||
return rows.map(row => { | ||
var _row$subRows2; | ||
const isSelected = isRowSelected(row, rowSelection); | ||
if (isSelected) { | ||
@@ -366,9 +366,8 @@ newSelectedFlatRows.push(row); | ||
} | ||
if ((_row$subRows2 = row.subRows) != null && _row$subRows2.length) { | ||
row = { ...row, | ||
row = { | ||
...row, | ||
subRows: recurseRows(row.subRows) | ||
}; | ||
} | ||
if (isSelected) { | ||
@@ -379,3 +378,2 @@ return row; | ||
}; | ||
return { | ||
@@ -399,3 +397,2 @@ rows: recurseRows(rowModel.rows), | ||
} | ||
if (isRowSelected(subRow, selection)) { | ||
@@ -409,3 +406,2 @@ someSelected = true; | ||
} | ||
return false; | ||
@@ -412,0 +408,0 @@ } |
@@ -19,2 +19,3 @@ /** | ||
// | ||
const Sorting = { | ||
@@ -45,13 +46,9 @@ getInitialState: state => { | ||
let isString = false; | ||
for (const row of firstRows) { | ||
const value = row == null ? void 0 : row.getValue(column.id); | ||
if (Object.prototype.toString.call(value) === '[object Date]') { | ||
return sortingFns.sortingFns.datetime; | ||
} | ||
if (typeof value === 'string') { | ||
isString = true; | ||
if (value.split(sortingFns.reSplitAlphaNumeric).length > 1) { | ||
@@ -62,7 +59,5 @@ return sortingFns.sortingFns.alphanumeric; | ||
} | ||
if (isString) { | ||
return sortingFns.sortingFns.text; | ||
} | ||
return sortingFns.sortingFns.basic; | ||
@@ -73,7 +68,5 @@ }, | ||
const value = firstRow == null ? void 0 : firstRow.getValue(column.id); | ||
if (typeof value === 'string') { | ||
return 'asc'; | ||
} | ||
return 'desc'; | ||
@@ -83,7 +76,5 @@ }, | ||
var _table$options$sortin; | ||
if (!column) { | ||
throw new Error(); | ||
} | ||
return utils.isFunction(column.columnDef.sortingFn) ? column.columnDef.sortingFn : column.columnDef.sortingFn === 'auto' ? column.getAutoSortingFn() : ((_table$options$sortin = table.options.sortingFns) == null ? void 0 : _table$options$sortin[column.columnDef.sortingFn]) ?? sortingFns.sortingFns[column.columnDef.sortingFn]; | ||
@@ -100,2 +91,3 @@ }, | ||
// } | ||
// this needs to be outside of table.setSorting to be in sync with rerender | ||
@@ -108,7 +100,9 @@ const nextSortingOrder = column.getNextSortingOrder(); | ||
const existingIndex = old == null ? void 0 : old.findIndex(d => d.id === column.id); | ||
let newSorting = []; // What should we do with this sort action? | ||
let newSorting = []; | ||
// What should we do with this sort action? | ||
let sortAction; | ||
let nextDesc = hasManualValue ? desc : nextSortingOrder === 'desc'; // Multi-mode | ||
let nextDesc = hasManualValue ? desc : nextSortingOrder === 'desc'; | ||
// Multi-mode | ||
if (old != null && old.length && column.getCanMultiSort() && multi) { | ||
@@ -129,5 +123,5 @@ if (existingSorting) { | ||
} | ||
} // Handle toggle states that will remove the sorting | ||
} | ||
// Handle toggle states that will remove the sorting | ||
if (sortAction === 'toggle') { | ||
@@ -142,3 +136,2 @@ // If we are "actually" toggling (not a manual set value), should we remove the sorting? | ||
} | ||
if (sortAction === 'add') { | ||
@@ -148,4 +141,4 @@ newSorting = [...old, { | ||
desc: nextDesc | ||
}]; // Take latest n columns | ||
}]; | ||
// Take latest n columns | ||
newSorting.splice(0, newSorting.length - (table.options.maxMultiSortColCount ?? Number.MAX_SAFE_INTEGER)); | ||
@@ -156,7 +149,7 @@ } else if (sortAction === 'toggle') { | ||
if (d.id === column.id) { | ||
return { ...d, | ||
return { | ||
...d, | ||
desc: nextDesc | ||
}; | ||
} | ||
return d; | ||
@@ -172,3 +165,2 @@ }); | ||
} | ||
return newSorting; | ||
@@ -184,8 +176,7 @@ }); | ||
const isSorted = column.getIsSorted(); | ||
if (!isSorted) { | ||
return firstSortDirection; | ||
} | ||
if (isSorted !== firstSortDirection && (table.options.enableSortingRemoval ?? true) && ( // If enableSortRemove, enable in general | ||
if (isSorted !== firstSortDirection && (table.options.enableSortingRemoval ?? true) && ( | ||
// If enableSortRemove, enable in general | ||
multi ? table.options.enableMultiRemove ?? true : true) // If multi, don't allow if enableMultiRemove)) | ||
@@ -195,3 +186,2 @@ ) { | ||
} | ||
return isSorted === 'desc' ? 'asc' : 'desc'; | ||
@@ -207,3 +197,2 @@ }, | ||
var _table$getState$sorti; | ||
const columnSort = (_table$getState$sorti = table.getState().sorting) == null ? void 0 : _table$getState$sorti.find(d => d.id === column.id); | ||
@@ -214,3 +203,2 @@ return !columnSort ? false : columnSort.desc ? 'desc' : 'asc'; | ||
var _table$getState$sorti2; | ||
return ((_table$getState$sorti2 = table.getState().sorting) == null ? void 0 : _table$getState$sorti2.findIndex(d => d.id === column.id)) ?? -1; | ||
@@ -237,3 +225,2 @@ }, | ||
var _table$initialState; | ||
table.setSorting(defaultState ? [] : ((_table$initialState = table.initialState) == null ? void 0 : _table$initialState.sorting) ?? []); | ||
@@ -246,7 +233,5 @@ }, | ||
} | ||
if (table.options.manualSorting || !table._getSortedRowModel) { | ||
return table.getPreSortedRowModel(); | ||
} | ||
return table._getSortedRowModel(); | ||
@@ -253,0 +238,0 @@ } |
@@ -18,2 +18,3 @@ /** | ||
// | ||
const Visibility = { | ||
@@ -35,3 +36,4 @@ getInitialState: state => { | ||
if (column.getCanHide()) { | ||
table.setColumnVisibility(old => ({ ...old, | ||
table.setColumnVisibility(old => ({ | ||
...old, | ||
[column.id]: value ?? !column.getIsVisible() | ||
@@ -43,3 +45,2 @@ })); | ||
var _table$getState$colum; | ||
return ((_table$getState$colum = table.getState().columnVisibility) == null ? void 0 : _table$getState$colum[column.id]) ?? true; | ||
@@ -80,3 +81,2 @@ }, | ||
}; | ||
return { | ||
@@ -94,3 +94,4 @@ getVisibleFlatColumns: makeVisibleColumnsMethod('getVisibleFlatColumns', () => table.getAllFlatColumns()), | ||
value = value ?? !table.getIsAllColumnsVisible(); | ||
table.setColumnVisibility(table.getAllLeafColumns().reduce((obj, column) => ({ ...obj, | ||
table.setColumnVisibility(table.getAllLeafColumns().reduce((obj, column) => ({ | ||
...obj, | ||
[column.id]: !value ? !(column.getCanHide != null && column.getCanHide()) : value | ||
@@ -104,3 +105,2 @@ }), {})); | ||
var _target; | ||
table.toggleAllColumnsVisible((_target = e.target) == null ? void 0 : _target.checked); | ||
@@ -107,0 +107,0 @@ }; |
@@ -17,65 +17,43 @@ /** | ||
var _row$getValue; | ||
const search = filterValue.toLowerCase(); | ||
return (_row$getValue = row.getValue(columnId)) == null ? void 0 : _row$getValue.toLowerCase().includes(search); | ||
}; | ||
includesString.autoRemove = val => testFalsey(val); | ||
const includesStringSensitive = (row, columnId, filterValue) => { | ||
var _row$getValue2; | ||
return (_row$getValue2 = row.getValue(columnId)) == null ? void 0 : _row$getValue2.includes(filterValue); | ||
}; | ||
includesStringSensitive.autoRemove = val => testFalsey(val); | ||
const equalsString = (row, columnId, filterValue) => { | ||
var _row$getValue3; | ||
return ((_row$getValue3 = row.getValue(columnId)) == null ? void 0 : _row$getValue3.toLowerCase()) === filterValue.toLowerCase(); | ||
}; | ||
equalsString.autoRemove = val => testFalsey(val); | ||
const arrIncludes = (row, columnId, filterValue) => { | ||
var _row$getValue4; | ||
return (_row$getValue4 = row.getValue(columnId)) == null ? void 0 : _row$getValue4.includes(filterValue); | ||
}; | ||
arrIncludes.autoRemove = val => testFalsey(val) || !(val != null && val.length); | ||
const arrIncludesAll = (row, columnId, filterValue) => { | ||
return !filterValue.some(val => { | ||
var _row$getValue5; | ||
return !((_row$getValue5 = row.getValue(columnId)) != null && _row$getValue5.includes(val)); | ||
}); | ||
}; | ||
arrIncludesAll.autoRemove = val => testFalsey(val) || !(val != null && val.length); | ||
const arrIncludesSome = (row, columnId, filterValue) => { | ||
return filterValue.some(val => { | ||
var _row$getValue6; | ||
return (_row$getValue6 = row.getValue(columnId)) == null ? void 0 : _row$getValue6.includes(val); | ||
}); | ||
}; | ||
arrIncludesSome.autoRemove = val => testFalsey(val) || !(val != null && val.length); | ||
const equals = (row, columnId, filterValue) => { | ||
return row.getValue(columnId) === filterValue; | ||
}; | ||
equals.autoRemove = val => testFalsey(val); | ||
const weakEquals = (row, columnId, filterValue) => { | ||
return row.getValue(columnId) == filterValue; | ||
}; | ||
weakEquals.autoRemove = val => testFalsey(val); | ||
const inNumberRange = (row, columnId, filterValue) => { | ||
@@ -86,3 +64,2 @@ let [min, max] = filterValue; | ||
}; | ||
inNumberRange.resolveFilterValue = val => { | ||
@@ -94,3 +71,2 @@ let [unsafeMin, unsafeMax] = val; | ||
let max = unsafeMax === null || Number.isNaN(parsedMax) ? Infinity : parsedMax; | ||
if (min > max) { | ||
@@ -101,9 +77,8 @@ const temp = min; | ||
} | ||
return [min, max]; | ||
}; | ||
inNumberRange.autoRemove = val => testFalsey(val) || testFalsey(val[0]) && testFalsey(val[1]); | ||
inNumberRange.autoRemove = val => testFalsey(val) || testFalsey(val[0]) && testFalsey(val[1]); // Export | ||
// Export | ||
const filterFns = { | ||
@@ -120,4 +95,4 @@ includesString, | ||
}; | ||
// Utils | ||
// Utils | ||
function testFalsey(val) { | ||
@@ -124,0 +99,0 @@ return val === undefined || val === null || val === ''; |
@@ -16,36 +16,34 @@ /** | ||
const reSplitAlphaNumeric = /([0-9]+)/gm; | ||
const alphanumeric = (rowA, rowB, columnId) => { | ||
return compareAlphanumeric(toString(rowA.getValue(columnId)).toLowerCase(), toString(rowB.getValue(columnId)).toLowerCase()); | ||
}; | ||
const alphanumericCaseSensitive = (rowA, rowB, columnId) => { | ||
return compareAlphanumeric(toString(rowA.getValue(columnId)), toString(rowB.getValue(columnId))); | ||
}; // The text filter is more basic (less numeric support) | ||
}; | ||
// The text filter is more basic (less numeric support) | ||
// but is much faster | ||
const text = (rowA, rowB, columnId) => { | ||
return compareBasic(toString(rowA.getValue(columnId)).toLowerCase(), toString(rowB.getValue(columnId)).toLowerCase()); | ||
}; // The text filter is more basic (less numeric support) | ||
}; | ||
// The text filter is more basic (less numeric support) | ||
// but is much faster | ||
const textCaseSensitive = (rowA, rowB, columnId) => { | ||
return compareBasic(toString(rowA.getValue(columnId)), toString(rowB.getValue(columnId))); | ||
}; | ||
const datetime = (rowA, rowB, columnId) => { | ||
const a = rowA.getValue(columnId); | ||
const b = rowB.getValue(columnId); // Can handle nullish values | ||
const b = rowB.getValue(columnId); | ||
// Can handle nullish values | ||
// Use > and < because == (and ===) doesn't work with | ||
// Date objects (would require calling getTime()). | ||
return a > b ? 1 : a < b ? -1 : 0; | ||
}; | ||
const basic = (rowA, rowB, columnId) => { | ||
return compareBasic(rowA.getValue(columnId), rowB.getValue(columnId)); | ||
}; // Utils | ||
}; | ||
// Utils | ||
@@ -55,3 +53,2 @@ function compareBasic(a, b) { | ||
} | ||
function toString(a) { | ||
@@ -62,16 +59,13 @@ if (typeof a === 'number') { | ||
} | ||
return String(a); | ||
} | ||
if (typeof a === 'string') { | ||
return a; | ||
} | ||
return ''; | ||
} | ||
return ''; | ||
} // Mixed sorting is slow, but very inclusive of many edge cases. | ||
// Mixed sorting is slow, but very inclusive of many edge cases. | ||
// It handles numbers, mixed alphanumeric combinations, and even | ||
// null, undefined, and Infinity | ||
function compareAlphanumeric(aStr, bStr) { | ||
@@ -81,4 +75,5 @@ // Split on number groups, but keep the delimiter | ||
const a = aStr.split(reSplitAlphaNumeric).filter(Boolean); | ||
const b = bStr.split(reSplitAlphaNumeric).filter(Boolean); // While | ||
const b = bStr.split(reSplitAlphaNumeric).filter(Boolean); | ||
// While | ||
while (a.length && b.length) { | ||
@@ -89,4 +84,5 @@ const aa = a.shift(); | ||
const bn = parseInt(bb, 10); | ||
const combo = [an, bn].sort(); // Both are string | ||
const combo = [an, bn].sort(); | ||
// Both are string | ||
if (isNaN(combo[0])) { | ||
@@ -96,20 +92,17 @@ if (aa > bb) { | ||
} | ||
if (bb > aa) { | ||
return -1; | ||
} | ||
continue; | ||
} // One is a string, one is a number | ||
} | ||
// One is a string, one is a number | ||
if (isNaN(combo[1])) { | ||
return isNaN(an) ? -1 : 1; | ||
} // Both are numbers | ||
} | ||
// Both are numbers | ||
if (an > bn) { | ||
return 1; | ||
} | ||
if (bn > an) { | ||
@@ -119,6 +112,6 @@ return -1; | ||
} | ||
return a.length - b.length; | ||
} // Exports | ||
} | ||
// Exports | ||
@@ -125,0 +118,0 @@ const sortingFns = { |
@@ -16,8 +16,12 @@ /** | ||
// Is this type a tuple? | ||
// If this type is a tuple, what indices are allowed? | ||
/// | ||
function functionalUpdate(updater, input) { | ||
return typeof updater === 'function' ? updater(input) : updater; | ||
} | ||
function noop() {// | ||
function noop() { | ||
// | ||
} | ||
@@ -27,3 +31,4 @@ function makeStateUpdater(key, instance) { | ||
instance.setState(old => { | ||
return { ...old, | ||
return { | ||
...old, | ||
[key]: functionalUpdate(updater, old[key]) | ||
@@ -39,3 +44,2 @@ }; | ||
const flat = []; | ||
const recurse = subArr => { | ||
@@ -45,3 +49,2 @@ subArr.forEach(item => { | ||
const children = getChildren(item); | ||
if (children != null && children.length) { | ||
@@ -52,3 +55,2 @@ recurse(children); | ||
}; | ||
recurse(arr); | ||
@@ -65,7 +67,5 @@ return flat; | ||
const depsChanged = newDeps.length !== deps.length || newDeps.some((dep, index) => deps[index] !== dep); | ||
if (!depsChanged) { | ||
return result; | ||
} | ||
deps = newDeps; | ||
@@ -76,3 +76,2 @@ let resultTime; | ||
opts == null ? void 0 : opts.onChange == null ? void 0 : opts.onChange(result); | ||
if (opts.key && opts.debug) { | ||
@@ -83,13 +82,9 @@ if (opts != null && opts.debug()) { | ||
const resultFpsPercentage = resultEndTime / 16; | ||
const pad = (str, num) => { | ||
str = String(str); | ||
while (str.length < num) { | ||
str = ' ' + str; | ||
} | ||
return str; | ||
}; | ||
console.info(`%c⏱ ${pad(resultEndTime, 5)} /${pad(depEndTime, 5)} ms`, ` | ||
@@ -101,3 +96,2 @@ font-size: .6rem; | ||
} | ||
return result; | ||
@@ -104,0 +98,0 @@ }; |
@@ -21,3 +21,2 @@ /** | ||
} | ||
return filterRowModelFromRoot(rows, filterRowImpl, table); | ||
@@ -28,12 +27,9 @@ } | ||
const newFilteredRowsById = {}; | ||
const recurseFilterRows = function (rowsToFilter, depth) { | ||
const rows = []; | ||
const rows = []; // Filter from children up first | ||
// Filter from children up first | ||
for (let i = 0; i < rowsToFilter.length; i++) { | ||
var _row$subRows; | ||
let row$1 = rowsToFilter[i]; | ||
if ((_row$subRows = row$1.subRows) != null && _row$subRows.length) { | ||
@@ -43,10 +39,7 @@ const newRow = row.createRow(table, row$1.id, row$1.original, row$1.index, row$1.depth); | ||
newRow.subRows = recurseFilterRows(row$1.subRows); | ||
if (!newRow.subRows.length) { | ||
continue; | ||
} | ||
row$1 = newRow; | ||
} | ||
if (filterRow(row$1)) { | ||
@@ -58,6 +51,4 @@ rows.push(row$1); | ||
} | ||
return rows; | ||
}; | ||
return { | ||
@@ -71,16 +62,16 @@ rows: recurseFilterRows(rowsToFilter), | ||
const newFilteredFlatRows = []; | ||
const newFilteredRowsById = {}; // Filters top level and nested rows | ||
const newFilteredRowsById = {}; | ||
// Filters top level and nested rows | ||
const recurseFilterRows = function (rowsToFilter, depth) { | ||
// Filter from parents downward first | ||
const rows = []; // Apply the filter to any subRows | ||
const rows = []; | ||
// Apply the filter to any subRows | ||
for (let i = 0; i < rowsToFilter.length; i++) { | ||
let row$1 = rowsToFilter[i]; | ||
const pass = filterRow(row$1); | ||
if (pass) { | ||
var _row$subRows2; | ||
if ((_row$subRows2 = row$1.subRows) != null && _row$subRows2.length) { | ||
@@ -91,3 +82,2 @@ const newRow = row.createRow(table, row$1.id, row$1.original, row$1.index, row$1.depth); | ||
} | ||
rows.push(row$1); | ||
@@ -98,6 +88,4 @@ newFilteredFlatRows.push(row$1); | ||
} | ||
return rows; | ||
}; | ||
return { | ||
@@ -104,0 +92,0 @@ rows: recurseFilterRows(rowsToFilter), |
@@ -25,3 +25,2 @@ /** | ||
}; | ||
const accessRows = function (originalRows, depth, parent) { | ||
@@ -31,5 +30,3 @@ if (depth === void 0) { | ||
} | ||
const rows = []; | ||
for (let i = 0; i < originalRows.length; i++) { | ||
@@ -42,16 +39,19 @@ // This could be an expensive check at scale, so we should move it somewhere else, but where? | ||
// } | ||
// Make the row | ||
const row$1 = row.createRow(table, table._getRowId(originalRows[i], i, parent), originalRows[i], i, depth); // Keep track of every row in a flat array | ||
const row$1 = row.createRow(table, table._getRowId(originalRows[i], i, parent), originalRows[i], i, depth); | ||
rowModel.flatRows.push(row$1); // Also keep track of every row by its ID | ||
// Keep track of every row in a flat array | ||
rowModel.flatRows.push(row$1); | ||
// Also keep track of every row by its ID | ||
rowModel.rowsById[row$1.id] = row$1; | ||
// Push table row into parent | ||
rows.push(row$1); | ||
rowModel.rowsById[row$1.id] = row$1; // Push table row into parent | ||
rows.push(row$1); // Get the original subrows | ||
// Get the original subrows | ||
if (table.options.getSubRows) { | ||
var _row$originalSubRows; | ||
row$1.originalSubRows = table.options.getSubRows(originalRows[i], i); | ||
row$1.originalSubRows = table.options.getSubRows(originalRows[i], i); // Then recursively access them | ||
// Then recursively access them | ||
if ((_row$originalSubRows = row$1.originalSubRows) != null && _row$originalSubRows.length) { | ||
@@ -62,6 +62,4 @@ row$1.subRows = accessRows(row$1.originalSubRows, depth + 1, row$1); | ||
} | ||
return rows; | ||
}; | ||
rowModel.rows = accessRows(data); | ||
@@ -68,0 +66,0 @@ return rowModel; |
@@ -22,3 +22,2 @@ /** | ||
} | ||
if (!paginateExpandedRows) { | ||
@@ -28,3 +27,2 @@ // Only expand rows at this point if they are being paginated | ||
} | ||
return expandRows(rowModel); | ||
@@ -38,8 +36,5 @@ }, { | ||
const expandedRows = []; | ||
const handleRow = row => { | ||
var _row$subRows; | ||
expandedRows.push(row); | ||
if ((_row$subRows = row.subRows) != null && _row$subRows.length && row.getIsExpanded()) { | ||
@@ -49,3 +44,2 @@ row.subRows.forEach(handleRow); | ||
}; | ||
rowModel.rows.forEach(handleRow); | ||
@@ -52,0 +46,0 @@ return { |
@@ -20,14 +20,9 @@ /** | ||
var _facetedRowModel$flat; | ||
const firstValue = (_facetedRowModel$flat = facetedRowModel.flatRows[0]) == null ? void 0 : _facetedRowModel$flat.getValue(columnId); | ||
if (typeof firstValue === 'undefined') { | ||
return undefined; | ||
} | ||
let facetedMinMaxValues = [firstValue, firstValue]; | ||
for (let i = 0; i < facetedRowModel.flatRows.length; i++) { | ||
const value = facetedRowModel.flatRows[i].getValue(columnId); | ||
if (value < facetedMinMaxValues[0]) { | ||
@@ -39,3 +34,2 @@ facetedMinMaxValues[0] = value; | ||
} | ||
return facetedMinMaxValues; | ||
@@ -42,0 +36,0 @@ }, { |
@@ -23,5 +23,3 @@ /** | ||
} | ||
const filterableIds = [...columnFilters.map(d => d.id).filter(d => d !== columnId), globalFilter ? '__global__' : undefined].filter(Boolean); | ||
const filterRowsImpl = row => { | ||
@@ -34,6 +32,4 @@ // Horizontally filter rows through each column | ||
} | ||
return true; | ||
}; | ||
return filterRowsUtils.filterRows(preRowModel.rows, filterRowsImpl, table); | ||
@@ -40,0 +36,0 @@ }, { |
@@ -20,8 +20,5 @@ /** | ||
let facetedUniqueValues = new Map(); | ||
for (let i = 0; i < facetedRowModel.flatRows.length; i++) { | ||
var _facetedRowModel$flat; | ||
const value = (_facetedRowModel$flat = facetedRowModel.flatRows[i]) == null ? void 0 : _facetedRowModel$flat.getValue(columnId); | ||
if (facetedUniqueValues.has(value)) { | ||
@@ -33,3 +30,2 @@ facetedUniqueValues.set(value, (facetedUniqueValues.get(value) ?? 0) + 1); | ||
} | ||
return facetedUniqueValues; | ||
@@ -36,0 +32,0 @@ }, { |
@@ -25,6 +25,4 @@ /** | ||
} | ||
return rowModel; | ||
} | ||
const resolvedColumnFilters = []; | ||
@@ -34,3 +32,2 @@ const resolvedGlobalFilters = []; | ||
const column = table.getColumn(d.id); | ||
if (!column) { | ||
@@ -41,5 +38,3 @@ if (process.env.NODE_ENV !== 'production') { | ||
} | ||
const filterFn = column.getFilterFn(); | ||
if (!filterFn) { | ||
@@ -49,6 +44,4 @@ if (process.env.NODE_ENV !== 'production') { | ||
} | ||
return; | ||
} | ||
resolvedColumnFilters.push({ | ||
@@ -63,3 +56,2 @@ id: d.id, | ||
const globallyFilterableColumns = table.getAllLeafColumns().filter(column => column.getCanGlobalFilter()); | ||
if (globalFilter && globalFilterFn && globallyFilterableColumns.length) { | ||
@@ -75,15 +67,15 @@ filterableIds.push('__global__'); | ||
} | ||
let currentColumnFilter; | ||
let currentGlobalFilter; // Flag the prefiltered row model with each filter state | ||
let currentGlobalFilter; | ||
// Flag the prefiltered row model with each filter state | ||
for (let j = 0; j < rowModel.flatRows.length; j++) { | ||
const row = rowModel.flatRows[j]; | ||
row.columnFilters = {}; | ||
if (resolvedColumnFilters.length) { | ||
for (let i = 0; i < resolvedColumnFilters.length; i++) { | ||
currentColumnFilter = resolvedColumnFilters[i]; | ||
const id = currentColumnFilter.id; // Tag the row with the column filter state | ||
const id = currentColumnFilter.id; | ||
// Tag the row with the column filter state | ||
row.columnFilters[id] = currentColumnFilter.filterFn(row, id, currentColumnFilter.resolvedValue, filterMeta => { | ||
@@ -94,8 +86,7 @@ row.columnFiltersMeta[id] = filterMeta; | ||
} | ||
if (resolvedGlobalFilters.length) { | ||
for (let i = 0; i < resolvedGlobalFilters.length; i++) { | ||
currentGlobalFilter = resolvedGlobalFilters[i]; | ||
const id = currentGlobalFilter.id; // Tag the row with the first truthy global filter state | ||
const id = currentGlobalFilter.id; | ||
// Tag the row with the first truthy global filter state | ||
if (currentGlobalFilter.filterFn(row, id, currentGlobalFilter.resolvedValue, filterMeta => { | ||
@@ -108,3 +99,2 @@ row.columnFiltersMeta[id] = filterMeta; | ||
} | ||
if (row.columnFilters.__global__ !== true) { | ||
@@ -115,3 +105,2 @@ row.columnFilters.__global__ = false; | ||
} | ||
const filterRowsImpl = row => { | ||
@@ -124,7 +113,6 @@ // Horizontally filter rows through each column | ||
} | ||
return true; | ||
}; // Filter final rows using all of the active filters | ||
}; | ||
// Filter final rows using all of the active filters | ||
return filterRowsUtils.filterRows(rowModel.rows, filterRowsImpl, table); | ||
@@ -131,0 +119,0 @@ }, { |
@@ -22,13 +22,14 @@ /** | ||
return rowModel; | ||
} // Filter the grouping list down to columns that exist | ||
} | ||
// Filter the grouping list down to columns that exist | ||
const existingGrouping = grouping.filter(columnId => table.getColumn(columnId)); | ||
const groupedFlatRows = []; | ||
const groupedRowsById = {}; // const onlyGroupedFlatRows: Row[] = []; | ||
const groupedRowsById = {}; | ||
// const onlyGroupedFlatRows: Row[] = []; | ||
// const onlyGroupedRowsById: Record<RowId, Row> = {}; | ||
// const nonGroupedFlatRows: Row[] = []; | ||
// const nonGroupedRowsById: Record<RowId, Row> = {}; | ||
// Recursively group the data | ||
const groupUpRecursively = function (rows, depth, parentId) { | ||
@@ -38,3 +39,2 @@ if (depth === void 0) { | ||
} | ||
// Grouping depth has been been met | ||
@@ -47,22 +47,23 @@ // Stop grouping and simply rewrite thd depth and row relationships | ||
groupedRowsById[row.id] = row; | ||
if (row.subRows) { | ||
row.subRows = groupUpRecursively(row.subRows, depth + 1); | ||
} | ||
return row; | ||
}); | ||
} | ||
const columnId = existingGrouping[depth]; | ||
const columnId = existingGrouping[depth]; // Group the rows together for this level | ||
// Group the rows together for this level | ||
const rowGroupsMap = groupBy(rows, columnId); | ||
const rowGroupsMap = groupBy(rows, columnId); // Peform aggregations for each group | ||
// Peform aggregations for each group | ||
const aggregatedGroupedRows = Array.from(rowGroupsMap.entries()).map((_ref, index) => { | ||
let [groupingValue, groupedRows] = _ref; | ||
let id = `${columnId}:${groupingValue}`; | ||
id = parentId ? `${parentId}>${id}` : id; // First, Recurse to group sub rows before aggregation | ||
id = parentId ? `${parentId}>${id}` : id; | ||
const subRows = groupUpRecursively(groupedRows, depth + 1, id); // Flatten the leaf rows of the rows in this group | ||
// First, Recurse to group sub rows before aggregation | ||
const subRows = groupUpRecursively(groupedRows, depth + 1, id); | ||
// Flatten the leaf rows of the rows in this group | ||
const leafRows = depth ? utils.flattenBy(groupedRows, row => row.subRows) : groupedRows; | ||
@@ -81,18 +82,14 @@ const row$1 = row.createRow(table, id, leafRows[0].original, index, depth); | ||
} | ||
if (groupedRows[0]) { | ||
row$1._valuesCache[columnId] = groupedRows[0].getValue(columnId) ?? undefined; | ||
} | ||
return row$1._valuesCache[columnId]; | ||
} | ||
if (row$1._groupingValuesCache.hasOwnProperty(columnId)) { | ||
return row$1._groupingValuesCache[columnId]; | ||
} // Aggregate the values | ||
} | ||
// Aggregate the values | ||
const column = table.getColumn(columnId); | ||
const aggregateFn = column.getAggregationFn(); | ||
if (aggregateFn) { | ||
@@ -106,3 +103,4 @@ row$1._groupingValuesCache[columnId] = aggregateFn(columnId, leafRows, groupedRows); | ||
groupedFlatRows.push(subRow); | ||
groupedRowsById[subRow.id] = subRow; // if (subRow.getIsGrouped?.()) { | ||
groupedRowsById[subRow.id] = subRow; | ||
// if (subRow.getIsGrouped?.()) { | ||
// onlyGroupedFlatRows.push(subRow); | ||
@@ -115,2 +113,3 @@ // onlyGroupedRowsById[subRow.id] = subRow; | ||
}); | ||
return row$1; | ||
@@ -120,7 +119,7 @@ }); | ||
}; | ||
const groupedRows = groupUpRecursively(rowModel.rows, 0, ''); | ||
groupedRows.forEach(subRow => { | ||
groupedFlatRows.push(subRow); | ||
groupedRowsById[subRow.id] = subRow; // if (subRow.getIsGrouped?.()) { | ||
groupedRowsById[subRow.id] = subRow; | ||
// if (subRow.getIsGrouped?.()) { | ||
// onlyGroupedFlatRows.push(subRow); | ||
@@ -133,2 +132,3 @@ // onlyGroupedRowsById[subRow.id] = subRow; | ||
}); | ||
return { | ||
@@ -145,3 +145,2 @@ rows: groupedRows, | ||
table._autoResetExpanded(); | ||
table._autoResetPageIndex(); | ||
@@ -152,3 +151,2 @@ }); | ||
} | ||
function groupBy(rows, columnId) { | ||
@@ -159,3 +157,2 @@ const groupMap = new Map(); | ||
const previous = map.get(resKey); | ||
if (!previous) { | ||
@@ -166,3 +163,2 @@ map.set(resKey, [row]); | ||
} | ||
return map; | ||
@@ -169,0 +165,0 @@ }, groupMap); |
@@ -23,3 +23,2 @@ /** | ||
} | ||
const { | ||
@@ -38,3 +37,2 @@ pageSize, | ||
let paginatedRowModel; | ||
if (!table.options.paginateExpandedRows) { | ||
@@ -53,8 +51,5 @@ paginatedRowModel = getExpandedRowModel.expandRows({ | ||
} | ||
paginatedRowModel.flatRows = []; | ||
const handleRow = row => { | ||
paginatedRowModel.flatRows.push(row); | ||
if (row.subRows.length) { | ||
@@ -64,3 +59,2 @@ row.subRows.forEach(handleRow); | ||
}; | ||
paginatedRowModel.rows.forEach(handleRow); | ||
@@ -67,0 +61,0 @@ return paginatedRowModel; |
@@ -22,6 +22,6 @@ /** | ||
} | ||
const sortingState = table.getState().sorting; | ||
const sortedFlatRows = []; // Filter out sortings that correspond to non existing columns | ||
const sortedFlatRows = []; | ||
// Filter out sortings that correspond to non existing columns | ||
const availableSorting = sortingState.filter(sort => table.getColumn(sort.id).getCanSort()); | ||
@@ -37,3 +37,2 @@ const columnInfoById = {}; | ||
}); | ||
const sortData = rows => { | ||
@@ -48,3 +47,2 @@ // This will also perform a stable sorting using the row index | ||
const isDesc = (sortEntry == null ? void 0 : sortEntry.desc) ?? false; | ||
if (columnInfo.sortUndefined) { | ||
@@ -55,11 +53,9 @@ const aValue = rowA.getValue(sortEntry.id); | ||
const bUndefined = typeof bValue === 'undefined'; | ||
if (aUndefined || bUndefined) { | ||
return aUndefined && bUndefined ? 0 : aUndefined ? columnInfo.sortUndefined : -columnInfo.sortUndefined; | ||
} | ||
} // This function should always return in ascending order | ||
} | ||
// This function should always return in ascending order | ||
let sortInt = columnInfo.sortingFn(rowA, rowB, sortEntry.id); | ||
if (sortInt !== 0) { | ||
@@ -69,21 +65,17 @@ if (isDesc) { | ||
} | ||
if (columnInfo.invertSorting) { | ||
sortInt *= -1; | ||
} | ||
return sortInt; | ||
} | ||
} | ||
return rowA.index - rowB.index; | ||
}); // If there are sub-rows, sort them | ||
}); | ||
// If there are sub-rows, sort them | ||
sortedData.forEach(row => { | ||
sortedFlatRows.push(row); | ||
if (!row.subRows || row.subRows.length <= 1) { | ||
return; | ||
} | ||
row.subRows = sortData(row.subRows); | ||
@@ -93,3 +85,2 @@ }); | ||
}; | ||
return { | ||
@@ -96,0 +87,0 @@ rows: sortData(rowModel.rows), |
@@ -13,3 +13,3 @@ { | ||
{ | ||
"uid": "ef32-64", | ||
"uid": "8283-64", | ||
"name": "utils.ts" | ||
@@ -21,19 +21,19 @@ }, | ||
{ | ||
"uid": "ef32-66", | ||
"uid": "8283-66", | ||
"name": "column.ts" | ||
}, | ||
{ | ||
"uid": "ef32-68", | ||
"uid": "8283-68", | ||
"name": "headers.ts" | ||
}, | ||
{ | ||
"uid": "ef32-96", | ||
"uid": "8283-96", | ||
"name": "table.ts" | ||
}, | ||
{ | ||
"uid": "ef32-98", | ||
"uid": "8283-98", | ||
"name": "cell.ts" | ||
}, | ||
{ | ||
"uid": "ef32-100", | ||
"uid": "8283-100", | ||
"name": "row.ts" | ||
@@ -47,39 +47,39 @@ } | ||
{ | ||
"uid": "ef32-70", | ||
"uid": "8283-70", | ||
"name": "ColumnSizing.ts" | ||
}, | ||
{ | ||
"uid": "ef32-72", | ||
"uid": "8283-72", | ||
"name": "Expanding.ts" | ||
}, | ||
{ | ||
"uid": "ef32-76", | ||
"uid": "8283-76", | ||
"name": "Filters.ts" | ||
}, | ||
{ | ||
"uid": "ef32-80", | ||
"uid": "8283-80", | ||
"name": "Grouping.ts" | ||
}, | ||
{ | ||
"uid": "ef32-82", | ||
"uid": "8283-82", | ||
"name": "Ordering.ts" | ||
}, | ||
{ | ||
"uid": "ef32-84", | ||
"uid": "8283-84", | ||
"name": "Pagination.ts" | ||
}, | ||
{ | ||
"uid": "ef32-86", | ||
"uid": "8283-86", | ||
"name": "Pinning.ts" | ||
}, | ||
{ | ||
"uid": "ef32-88", | ||
"uid": "8283-88", | ||
"name": "RowSelection.ts" | ||
}, | ||
{ | ||
"uid": "ef32-92", | ||
"uid": "8283-92", | ||
"name": "Sorting.ts" | ||
}, | ||
{ | ||
"uid": "ef32-94", | ||
"uid": "8283-94", | ||
"name": "Visibility.ts" | ||
@@ -90,15 +90,15 @@ } | ||
{ | ||
"uid": "ef32-74", | ||
"uid": "8283-74", | ||
"name": "filterFns.ts" | ||
}, | ||
{ | ||
"uid": "ef32-78", | ||
"uid": "8283-78", | ||
"name": "aggregationFns.ts" | ||
}, | ||
{ | ||
"uid": "ef32-90", | ||
"uid": "8283-90", | ||
"name": "sortingFns.ts" | ||
}, | ||
{ | ||
"uid": "ef32-102", | ||
"uid": "8283-102", | ||
"name": "columnHelper.ts" | ||
@@ -110,39 +110,39 @@ }, | ||
{ | ||
"uid": "ef32-104", | ||
"uid": "8283-104", | ||
"name": "getCoreRowModel.ts" | ||
}, | ||
{ | ||
"uid": "ef32-106", | ||
"uid": "8283-106", | ||
"name": "filterRowsUtils.ts" | ||
}, | ||
{ | ||
"uid": "ef32-108", | ||
"uid": "8283-108", | ||
"name": "getFilteredRowModel.ts" | ||
}, | ||
{ | ||
"uid": "ef32-110", | ||
"uid": "8283-110", | ||
"name": "getFacetedRowModel.ts" | ||
}, | ||
{ | ||
"uid": "ef32-112", | ||
"uid": "8283-112", | ||
"name": "getFacetedUniqueValues.ts" | ||
}, | ||
{ | ||
"uid": "ef32-114", | ||
"uid": "8283-114", | ||
"name": "getFacetedMinMaxValues.ts" | ||
}, | ||
{ | ||
"uid": "ef32-116", | ||
"uid": "8283-116", | ||
"name": "getSortedRowModel.ts" | ||
}, | ||
{ | ||
"uid": "ef32-118", | ||
"uid": "8283-118", | ||
"name": "getGroupedRowModel.ts" | ||
}, | ||
{ | ||
"uid": "ef32-120", | ||
"uid": "8283-120", | ||
"name": "getExpandedRowModel.ts" | ||
}, | ||
{ | ||
"uid": "ef32-122", | ||
"uid": "8283-122", | ||
"name": "getPaginationRowModel.ts" | ||
@@ -153,3 +153,3 @@ } | ||
{ | ||
"uid": "ef32-124", | ||
"uid": "8283-124", | ||
"name": "index.ts" | ||
@@ -165,194 +165,194 @@ } | ||
"nodeParts": { | ||
"ef32-64": { | ||
"renderedLength": 2269, | ||
"gzipLength": 845, | ||
"8283-64": { | ||
"renderedLength": 2276, | ||
"gzipLength": 835, | ||
"brotliLength": 0, | ||
"mainUid": "ef32-63" | ||
"mainUid": "8283-63" | ||
}, | ||
"ef32-66": { | ||
"8283-66": { | ||
"renderedLength": 2315, | ||
"gzipLength": 800, | ||
"gzipLength": 789, | ||
"brotliLength": 0, | ||
"mainUid": "ef32-65" | ||
"mainUid": "8283-65" | ||
}, | ||
"ef32-68": { | ||
"renderedLength": 12739, | ||
"gzipLength": 2304, | ||
"8283-68": { | ||
"renderedLength": 12758, | ||
"gzipLength": 2299, | ||
"brotliLength": 0, | ||
"mainUid": "ef32-67" | ||
"mainUid": "8283-67" | ||
}, | ||
"ef32-70": { | ||
"renderedLength": 8802, | ||
"gzipLength": 2019, | ||
"8283-70": { | ||
"renderedLength": 9827, | ||
"gzipLength": 2131, | ||
"brotliLength": 0, | ||
"mainUid": "ef32-69" | ||
"mainUid": "8283-69" | ||
}, | ||
"ef32-72": { | ||
"renderedLength": 5105, | ||
"gzipLength": 1245, | ||
"8283-72": { | ||
"renderedLength": 5137, | ||
"gzipLength": 1235, | ||
"brotliLength": 0, | ||
"mainUid": "ef32-71" | ||
"mainUid": "8283-71" | ||
}, | ||
"ef32-74": { | ||
"renderedLength": 3252, | ||
"gzipLength": 764, | ||
"8283-74": { | ||
"renderedLength": 3228, | ||
"gzipLength": 759, | ||
"brotliLength": 0, | ||
"mainUid": "ef32-73" | ||
"mainUid": "8283-73" | ||
}, | ||
"ef32-76": { | ||
"renderedLength": 9352, | ||
"gzipLength": 1747, | ||
"8283-76": { | ||
"renderedLength": 9342, | ||
"gzipLength": 1745, | ||
"brotliLength": 0, | ||
"mainUid": "ef32-75" | ||
"mainUid": "8283-75" | ||
}, | ||
"ef32-78": { | ||
"renderedLength": 2447, | ||
"gzipLength": 657, | ||
"8283-78": { | ||
"renderedLength": 2432, | ||
"gzipLength": 653, | ||
"brotliLength": 0, | ||
"mainUid": "ef32-77" | ||
"mainUid": "8283-77" | ||
}, | ||
"ef32-80": { | ||
"renderedLength": 4730, | ||
"gzipLength": 1247, | ||
"8283-80": { | ||
"renderedLength": 4715, | ||
"gzipLength": 1240, | ||
"brotliLength": 0, | ||
"mainUid": "ef32-79" | ||
"mainUid": "8283-79" | ||
}, | ||
"ef32-82": { | ||
"renderedLength": 2097, | ||
"gzipLength": 738, | ||
"8283-82": { | ||
"renderedLength": 2151, | ||
"gzipLength": 737, | ||
"brotliLength": 0, | ||
"mainUid": "ef32-81" | ||
"mainUid": "8283-81" | ||
}, | ||
"ef32-84": { | ||
"renderedLength": 5376, | ||
"gzipLength": 1255, | ||
"8283-84": { | ||
"renderedLength": 5418, | ||
"gzipLength": 1251, | ||
"brotliLength": 0, | ||
"mainUid": "ef32-83" | ||
"mainUid": "8283-83" | ||
}, | ||
"ef32-86": { | ||
"renderedLength": 6512, | ||
"gzipLength": 1235, | ||
"8283-86": { | ||
"renderedLength": 6528, | ||
"gzipLength": 1229, | ||
"brotliLength": 0, | ||
"mainUid": "ef32-85" | ||
"mainUid": "8283-85" | ||
}, | ||
"ef32-88": { | ||
"renderedLength": 12273, | ||
"gzipLength": 2403, | ||
"8283-88": { | ||
"renderedLength": 12344, | ||
"gzipLength": 2410, | ||
"brotliLength": 0, | ||
"mainUid": "ef32-87" | ||
"mainUid": "8283-87" | ||
}, | ||
"ef32-90": { | ||
"renderedLength": 2914, | ||
"gzipLength": 936, | ||
"8283-90": { | ||
"renderedLength": 2933, | ||
"gzipLength": 929, | ||
"brotliLength": 0, | ||
"mainUid": "ef32-89" | ||
"mainUid": "8283-89" | ||
}, | ||
"ef32-92": { | ||
"renderedLength": 8152, | ||
"gzipLength": 2015, | ||
"8283-92": { | ||
"renderedLength": 8211, | ||
"gzipLength": 2005, | ||
"brotliLength": 0, | ||
"mainUid": "ef32-91" | ||
"mainUid": "8283-91" | ||
}, | ||
"ef32-94": { | ||
"renderedLength": 4032, | ||
"gzipLength": 975, | ||
"8283-94": { | ||
"renderedLength": 4056, | ||
"gzipLength": 979, | ||
"brotliLength": 0, | ||
"mainUid": "ef32-93" | ||
"mainUid": "8283-93" | ||
}, | ||
"ef32-96": { | ||
"renderedLength": 6370, | ||
"gzipLength": 1635, | ||
"8283-96": { | ||
"renderedLength": 6382, | ||
"gzipLength": 1631, | ||
"brotliLength": 0, | ||
"mainUid": "ef32-95" | ||
"mainUid": "8283-95" | ||
}, | ||
"ef32-98": { | ||
"renderedLength": 832, | ||
"gzipLength": 383, | ||
"8283-98": { | ||
"renderedLength": 829, | ||
"gzipLength": 381, | ||
"brotliLength": 0, | ||
"mainUid": "ef32-97" | ||
"mainUid": "8283-97" | ||
}, | ||
"ef32-100": { | ||
"renderedLength": 1676, | ||
"gzipLength": 619, | ||
"8283-100": { | ||
"renderedLength": 1671, | ||
"gzipLength": 613, | ||
"brotliLength": 0, | ||
"mainUid": "ef32-99" | ||
"mainUid": "8283-99" | ||
}, | ||
"ef32-102": { | ||
"renderedLength": 1168, | ||
"gzipLength": 409, | ||
"8283-102": { | ||
"renderedLength": 1194, | ||
"gzipLength": 414, | ||
"brotliLength": 0, | ||
"mainUid": "ef32-101" | ||
"mainUid": "8283-101" | ||
}, | ||
"ef32-104": { | ||
"renderedLength": 1791, | ||
"gzipLength": 728, | ||
"8283-104": { | ||
"renderedLength": 1836, | ||
"gzipLength": 729, | ||
"brotliLength": 0, | ||
"mainUid": "ef32-103" | ||
"mainUid": "8283-103" | ||
}, | ||
"ef32-106": { | ||
"renderedLength": 2418, | ||
"gzipLength": 599, | ||
"8283-106": { | ||
"renderedLength": 2419, | ||
"gzipLength": 590, | ||
"brotliLength": 0, | ||
"mainUid": "ef32-105" | ||
"mainUid": "8283-105" | ||
}, | ||
"ef32-108": { | ||
"renderedLength": 3745, | ||
"gzipLength": 1028, | ||
"8283-108": { | ||
"renderedLength": 3766, | ||
"gzipLength": 1021, | ||
"brotliLength": 0, | ||
"mainUid": "ef32-107" | ||
"mainUid": "8283-107" | ||
}, | ||
"ef32-110": { | ||
"renderedLength": 1064, | ||
"gzipLength": 472, | ||
"8283-110": { | ||
"renderedLength": 1060, | ||
"gzipLength": 469, | ||
"brotliLength": 0, | ||
"mainUid": "ef32-109" | ||
"mainUid": "8283-109" | ||
}, | ||
"ef32-112": { | ||
"renderedLength": 842, | ||
"gzipLength": 372, | ||
"8283-112": { | ||
"renderedLength": 838, | ||
"gzipLength": 369, | ||
"brotliLength": 0, | ||
"mainUid": "ef32-111" | ||
"mainUid": "8283-111" | ||
}, | ||
"ef32-114": { | ||
"renderedLength": 1001, | ||
"gzipLength": 404, | ||
"8283-114": { | ||
"renderedLength": 995, | ||
"gzipLength": 400, | ||
"brotliLength": 0, | ||
"mainUid": "ef32-113" | ||
"mainUid": "8283-113" | ||
}, | ||
"ef32-116": { | ||
"renderedLength": 2895, | ||
"gzipLength": 962, | ||
"8283-116": { | ||
"renderedLength": 2909, | ||
"gzipLength": 958, | ||
"brotliLength": 0, | ||
"mainUid": "ef32-115" | ||
"mainUid": "8283-115" | ||
}, | ||
"ef32-118": { | ||
"renderedLength": 5039, | ||
"gzipLength": 1424, | ||
"8283-118": { | ||
"renderedLength": 5108, | ||
"gzipLength": 1426, | ||
"brotliLength": 0, | ||
"mainUid": "ef32-117" | ||
"mainUid": "8283-117" | ||
}, | ||
"ef32-120": { | ||
"renderedLength": 1108, | ||
"gzipLength": 466, | ||
"8283-120": { | ||
"renderedLength": 1102, | ||
"gzipLength": 461, | ||
"brotliLength": 0, | ||
"mainUid": "ef32-119" | ||
"mainUid": "8283-119" | ||
}, | ||
"ef32-122": { | ||
"renderedLength": 1336, | ||
"gzipLength": 457, | ||
"8283-122": { | ||
"renderedLength": 1330, | ||
"gzipLength": 454, | ||
"brotliLength": 0, | ||
"mainUid": "ef32-121" | ||
"mainUid": "8283-121" | ||
}, | ||
"ef32-124": { | ||
"8283-124": { | ||
"renderedLength": 0, | ||
"gzipLength": 0, | ||
"brotliLength": 0, | ||
"mainUid": "ef32-123" | ||
"mainUid": "8283-123" | ||
} | ||
}, | ||
"nodeMetas": { | ||
"ef32-63": { | ||
"8283-63": { | ||
"id": "/packages/table-core/src/utils.ts", | ||
"moduleParts": { | ||
"index.production.js": "ef32-64" | ||
"index.production.js": "8283-64" | ||
}, | ||
@@ -362,86 +362,86 @@ "imported": [], | ||
{ | ||
"uid": "ef32-123" | ||
"uid": "8283-123" | ||
}, | ||
{ | ||
"uid": "ef32-95" | ||
"uid": "8283-95" | ||
}, | ||
{ | ||
"uid": "ef32-65" | ||
"uid": "8283-65" | ||
}, | ||
{ | ||
"uid": "ef32-67" | ||
"uid": "8283-67" | ||
}, | ||
{ | ||
"uid": "ef32-99" | ||
"uid": "8283-99" | ||
}, | ||
{ | ||
"uid": "ef32-97" | ||
"uid": "8283-97" | ||
}, | ||
{ | ||
"uid": "ef32-69" | ||
"uid": "8283-69" | ||
}, | ||
{ | ||
"uid": "ef32-71" | ||
"uid": "8283-71" | ||
}, | ||
{ | ||
"uid": "ef32-75" | ||
"uid": "8283-75" | ||
}, | ||
{ | ||
"uid": "ef32-79" | ||
"uid": "8283-79" | ||
}, | ||
{ | ||
"uid": "ef32-81" | ||
"uid": "8283-81" | ||
}, | ||
{ | ||
"uid": "ef32-83" | ||
"uid": "8283-83" | ||
}, | ||
{ | ||
"uid": "ef32-85" | ||
"uid": "8283-85" | ||
}, | ||
{ | ||
"uid": "ef32-87" | ||
"uid": "8283-87" | ||
}, | ||
{ | ||
"uid": "ef32-91" | ||
"uid": "8283-91" | ||
}, | ||
{ | ||
"uid": "ef32-93" | ||
"uid": "8283-93" | ||
}, | ||
{ | ||
"uid": "ef32-103" | ||
"uid": "8283-103" | ||
}, | ||
{ | ||
"uid": "ef32-107" | ||
"uid": "8283-107" | ||
}, | ||
{ | ||
"uid": "ef32-109" | ||
"uid": "8283-109" | ||
}, | ||
{ | ||
"uid": "ef32-111" | ||
"uid": "8283-111" | ||
}, | ||
{ | ||
"uid": "ef32-113" | ||
"uid": "8283-113" | ||
}, | ||
{ | ||
"uid": "ef32-115" | ||
"uid": "8283-115" | ||
}, | ||
{ | ||
"uid": "ef32-117" | ||
"uid": "8283-117" | ||
}, | ||
{ | ||
"uid": "ef32-119" | ||
"uid": "8283-119" | ||
}, | ||
{ | ||
"uid": "ef32-121" | ||
"uid": "8283-121" | ||
} | ||
] | ||
}, | ||
"ef32-65": { | ||
"8283-65": { | ||
"id": "/packages/table-core/src/core/column.ts", | ||
"moduleParts": { | ||
"index.production.js": "ef32-66" | ||
"index.production.js": "8283-66" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "ef32-63" | ||
"uid": "8283-63" | ||
} | ||
@@ -451,17 +451,17 @@ ], | ||
{ | ||
"uid": "ef32-123" | ||
"uid": "8283-123" | ||
}, | ||
{ | ||
"uid": "ef32-95" | ||
"uid": "8283-95" | ||
} | ||
] | ||
}, | ||
"ef32-67": { | ||
"8283-67": { | ||
"id": "/packages/table-core/src/core/headers.ts", | ||
"moduleParts": { | ||
"index.production.js": "ef32-68" | ||
"index.production.js": "8283-68" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "ef32-63" | ||
"uid": "8283-63" | ||
} | ||
@@ -471,17 +471,17 @@ ], | ||
{ | ||
"uid": "ef32-123" | ||
"uid": "8283-123" | ||
}, | ||
{ | ||
"uid": "ef32-95" | ||
"uid": "8283-95" | ||
} | ||
] | ||
}, | ||
"ef32-69": { | ||
"8283-69": { | ||
"id": "/packages/table-core/src/features/ColumnSizing.ts", | ||
"moduleParts": { | ||
"index.production.js": "ef32-70" | ||
"index.production.js": "8283-70" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "ef32-63" | ||
"uid": "8283-63" | ||
} | ||
@@ -491,17 +491,17 @@ ], | ||
{ | ||
"uid": "ef32-123" | ||
"uid": "8283-123" | ||
}, | ||
{ | ||
"uid": "ef32-95" | ||
"uid": "8283-95" | ||
} | ||
] | ||
}, | ||
"ef32-71": { | ||
"8283-71": { | ||
"id": "/packages/table-core/src/features/Expanding.ts", | ||
"moduleParts": { | ||
"index.production.js": "ef32-72" | ||
"index.production.js": "8283-72" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "ef32-63" | ||
"uid": "8283-63" | ||
} | ||
@@ -511,13 +511,13 @@ ], | ||
{ | ||
"uid": "ef32-123" | ||
"uid": "8283-123" | ||
}, | ||
{ | ||
"uid": "ef32-95" | ||
"uid": "8283-95" | ||
} | ||
] | ||
}, | ||
"ef32-73": { | ||
"8283-73": { | ||
"id": "/packages/table-core/src/filterFns.ts", | ||
"moduleParts": { | ||
"index.production.js": "ef32-74" | ||
"index.production.js": "8283-74" | ||
}, | ||
@@ -527,20 +527,20 @@ "imported": [], | ||
{ | ||
"uid": "ef32-123" | ||
"uid": "8283-123" | ||
}, | ||
{ | ||
"uid": "ef32-75" | ||
"uid": "8283-75" | ||
} | ||
] | ||
}, | ||
"ef32-75": { | ||
"8283-75": { | ||
"id": "/packages/table-core/src/features/Filters.ts", | ||
"moduleParts": { | ||
"index.production.js": "ef32-76" | ||
"index.production.js": "8283-76" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "ef32-73" | ||
"uid": "8283-73" | ||
}, | ||
{ | ||
"uid": "ef32-63" | ||
"uid": "8283-63" | ||
} | ||
@@ -550,13 +550,13 @@ ], | ||
{ | ||
"uid": "ef32-123" | ||
"uid": "8283-123" | ||
}, | ||
{ | ||
"uid": "ef32-95" | ||
"uid": "8283-95" | ||
} | ||
] | ||
}, | ||
"ef32-77": { | ||
"8283-77": { | ||
"id": "/packages/table-core/src/aggregationFns.ts", | ||
"moduleParts": { | ||
"index.production.js": "ef32-78" | ||
"index.production.js": "8283-78" | ||
}, | ||
@@ -566,20 +566,20 @@ "imported": [], | ||
{ | ||
"uid": "ef32-123" | ||
"uid": "8283-123" | ||
}, | ||
{ | ||
"uid": "ef32-79" | ||
"uid": "8283-79" | ||
} | ||
] | ||
}, | ||
"ef32-79": { | ||
"8283-79": { | ||
"id": "/packages/table-core/src/features/Grouping.ts", | ||
"moduleParts": { | ||
"index.production.js": "ef32-80" | ||
"index.production.js": "8283-80" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "ef32-77" | ||
"uid": "8283-77" | ||
}, | ||
{ | ||
"uid": "ef32-63" | ||
"uid": "8283-63" | ||
} | ||
@@ -589,23 +589,23 @@ ], | ||
{ | ||
"uid": "ef32-123" | ||
"uid": "8283-123" | ||
}, | ||
{ | ||
"uid": "ef32-95" | ||
"uid": "8283-95" | ||
}, | ||
{ | ||
"uid": "ef32-81" | ||
"uid": "8283-81" | ||
} | ||
] | ||
}, | ||
"ef32-81": { | ||
"8283-81": { | ||
"id": "/packages/table-core/src/features/Ordering.ts", | ||
"moduleParts": { | ||
"index.production.js": "ef32-82" | ||
"index.production.js": "8283-82" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "ef32-63" | ||
"uid": "8283-63" | ||
}, | ||
{ | ||
"uid": "ef32-79" | ||
"uid": "8283-79" | ||
} | ||
@@ -615,17 +615,17 @@ ], | ||
{ | ||
"uid": "ef32-123" | ||
"uid": "8283-123" | ||
}, | ||
{ | ||
"uid": "ef32-95" | ||
"uid": "8283-95" | ||
} | ||
] | ||
}, | ||
"ef32-83": { | ||
"8283-83": { | ||
"id": "/packages/table-core/src/features/Pagination.ts", | ||
"moduleParts": { | ||
"index.production.js": "ef32-84" | ||
"index.production.js": "8283-84" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "ef32-63" | ||
"uid": "8283-63" | ||
} | ||
@@ -635,17 +635,17 @@ ], | ||
{ | ||
"uid": "ef32-123" | ||
"uid": "8283-123" | ||
}, | ||
{ | ||
"uid": "ef32-95" | ||
"uid": "8283-95" | ||
} | ||
] | ||
}, | ||
"ef32-85": { | ||
"8283-85": { | ||
"id": "/packages/table-core/src/features/Pinning.ts", | ||
"moduleParts": { | ||
"index.production.js": "ef32-86" | ||
"index.production.js": "8283-86" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "ef32-63" | ||
"uid": "8283-63" | ||
} | ||
@@ -655,17 +655,17 @@ ], | ||
{ | ||
"uid": "ef32-123" | ||
"uid": "8283-123" | ||
}, | ||
{ | ||
"uid": "ef32-95" | ||
"uid": "8283-95" | ||
} | ||
] | ||
}, | ||
"ef32-87": { | ||
"8283-87": { | ||
"id": "/packages/table-core/src/features/RowSelection.ts", | ||
"moduleParts": { | ||
"index.production.js": "ef32-88" | ||
"index.production.js": "8283-88" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "ef32-63" | ||
"uid": "8283-63" | ||
} | ||
@@ -675,13 +675,13 @@ ], | ||
{ | ||
"uid": "ef32-123" | ||
"uid": "8283-123" | ||
}, | ||
{ | ||
"uid": "ef32-95" | ||
"uid": "8283-95" | ||
} | ||
] | ||
}, | ||
"ef32-89": { | ||
"8283-89": { | ||
"id": "/packages/table-core/src/sortingFns.ts", | ||
"moduleParts": { | ||
"index.production.js": "ef32-90" | ||
"index.production.js": "8283-90" | ||
}, | ||
@@ -691,20 +691,20 @@ "imported": [], | ||
{ | ||
"uid": "ef32-123" | ||
"uid": "8283-123" | ||
}, | ||
{ | ||
"uid": "ef32-91" | ||
"uid": "8283-91" | ||
} | ||
] | ||
}, | ||
"ef32-91": { | ||
"8283-91": { | ||
"id": "/packages/table-core/src/features/Sorting.ts", | ||
"moduleParts": { | ||
"index.production.js": "ef32-92" | ||
"index.production.js": "8283-92" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "ef32-89" | ||
"uid": "8283-89" | ||
}, | ||
{ | ||
"uid": "ef32-63" | ||
"uid": "8283-63" | ||
} | ||
@@ -714,17 +714,17 @@ ], | ||
{ | ||
"uid": "ef32-123" | ||
"uid": "8283-123" | ||
}, | ||
{ | ||
"uid": "ef32-95" | ||
"uid": "8283-95" | ||
} | ||
] | ||
}, | ||
"ef32-93": { | ||
"8283-93": { | ||
"id": "/packages/table-core/src/features/Visibility.ts", | ||
"moduleParts": { | ||
"index.production.js": "ef32-94" | ||
"index.production.js": "8283-94" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "ef32-63" | ||
"uid": "8283-63" | ||
} | ||
@@ -734,53 +734,53 @@ ], | ||
{ | ||
"uid": "ef32-123" | ||
"uid": "8283-123" | ||
}, | ||
{ | ||
"uid": "ef32-95" | ||
"uid": "8283-95" | ||
} | ||
] | ||
}, | ||
"ef32-95": { | ||
"8283-95": { | ||
"id": "/packages/table-core/src/core/table.ts", | ||
"moduleParts": { | ||
"index.production.js": "ef32-96" | ||
"index.production.js": "8283-96" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "ef32-63" | ||
"uid": "8283-63" | ||
}, | ||
{ | ||
"uid": "ef32-65" | ||
"uid": "8283-65" | ||
}, | ||
{ | ||
"uid": "ef32-67" | ||
"uid": "8283-67" | ||
}, | ||
{ | ||
"uid": "ef32-69" | ||
"uid": "8283-69" | ||
}, | ||
{ | ||
"uid": "ef32-71" | ||
"uid": "8283-71" | ||
}, | ||
{ | ||
"uid": "ef32-75" | ||
"uid": "8283-75" | ||
}, | ||
{ | ||
"uid": "ef32-79" | ||
"uid": "8283-79" | ||
}, | ||
{ | ||
"uid": "ef32-81" | ||
"uid": "8283-81" | ||
}, | ||
{ | ||
"uid": "ef32-83" | ||
"uid": "8283-83" | ||
}, | ||
{ | ||
"uid": "ef32-85" | ||
"uid": "8283-85" | ||
}, | ||
{ | ||
"uid": "ef32-87" | ||
"uid": "8283-87" | ||
}, | ||
{ | ||
"uid": "ef32-91" | ||
"uid": "8283-91" | ||
}, | ||
{ | ||
"uid": "ef32-93" | ||
"uid": "8283-93" | ||
} | ||
@@ -790,14 +790,14 @@ ], | ||
{ | ||
"uid": "ef32-123" | ||
"uid": "8283-123" | ||
} | ||
] | ||
}, | ||
"ef32-97": { | ||
"8283-97": { | ||
"id": "/packages/table-core/src/core/cell.ts", | ||
"moduleParts": { | ||
"index.production.js": "ef32-98" | ||
"index.production.js": "8283-98" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "ef32-63" | ||
"uid": "8283-63" | ||
} | ||
@@ -807,20 +807,20 @@ ], | ||
{ | ||
"uid": "ef32-123" | ||
"uid": "8283-123" | ||
}, | ||
{ | ||
"uid": "ef32-99" | ||
"uid": "8283-99" | ||
} | ||
] | ||
}, | ||
"ef32-99": { | ||
"8283-99": { | ||
"id": "/packages/table-core/src/core/row.ts", | ||
"moduleParts": { | ||
"index.production.js": "ef32-100" | ||
"index.production.js": "8283-100" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "ef32-63" | ||
"uid": "8283-63" | ||
}, | ||
{ | ||
"uid": "ef32-97" | ||
"uid": "8283-97" | ||
} | ||
@@ -830,19 +830,19 @@ ], | ||
{ | ||
"uid": "ef32-123" | ||
"uid": "8283-123" | ||
}, | ||
{ | ||
"uid": "ef32-103" | ||
"uid": "8283-103" | ||
}, | ||
{ | ||
"uid": "ef32-117" | ||
"uid": "8283-117" | ||
}, | ||
{ | ||
"uid": "ef32-105" | ||
"uid": "8283-105" | ||
} | ||
] | ||
}, | ||
"ef32-101": { | ||
"8283-101": { | ||
"id": "/packages/table-core/src/columnHelper.ts", | ||
"moduleParts": { | ||
"index.production.js": "ef32-102" | ||
"index.production.js": "8283-102" | ||
}, | ||
@@ -852,17 +852,17 @@ "imported": [], | ||
{ | ||
"uid": "ef32-123" | ||
"uid": "8283-123" | ||
} | ||
] | ||
}, | ||
"ef32-103": { | ||
"8283-103": { | ||
"id": "/packages/table-core/src/utils/getCoreRowModel.ts", | ||
"moduleParts": { | ||
"index.production.js": "ef32-104" | ||
"index.production.js": "8283-104" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "ef32-99" | ||
"uid": "8283-99" | ||
}, | ||
{ | ||
"uid": "ef32-63" | ||
"uid": "8283-63" | ||
} | ||
@@ -872,14 +872,14 @@ ], | ||
{ | ||
"uid": "ef32-123" | ||
"uid": "8283-123" | ||
} | ||
] | ||
}, | ||
"ef32-105": { | ||
"8283-105": { | ||
"id": "/packages/table-core/src/utils/filterRowsUtils.ts", | ||
"moduleParts": { | ||
"index.production.js": "ef32-106" | ||
"index.production.js": "8283-106" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "ef32-99" | ||
"uid": "8283-99" | ||
} | ||
@@ -889,20 +889,20 @@ ], | ||
{ | ||
"uid": "ef32-107" | ||
"uid": "8283-107" | ||
}, | ||
{ | ||
"uid": "ef32-109" | ||
"uid": "8283-109" | ||
} | ||
] | ||
}, | ||
"ef32-107": { | ||
"8283-107": { | ||
"id": "/packages/table-core/src/utils/getFilteredRowModel.ts", | ||
"moduleParts": { | ||
"index.production.js": "ef32-108" | ||
"index.production.js": "8283-108" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "ef32-63" | ||
"uid": "8283-63" | ||
}, | ||
{ | ||
"uid": "ef32-105" | ||
"uid": "8283-105" | ||
} | ||
@@ -912,17 +912,17 @@ ], | ||
{ | ||
"uid": "ef32-123" | ||
"uid": "8283-123" | ||
} | ||
] | ||
}, | ||
"ef32-109": { | ||
"8283-109": { | ||
"id": "/packages/table-core/src/utils/getFacetedRowModel.ts", | ||
"moduleParts": { | ||
"index.production.js": "ef32-110" | ||
"index.production.js": "8283-110" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "ef32-63" | ||
"uid": "8283-63" | ||
}, | ||
{ | ||
"uid": "ef32-105" | ||
"uid": "8283-105" | ||
} | ||
@@ -932,14 +932,14 @@ ], | ||
{ | ||
"uid": "ef32-123" | ||
"uid": "8283-123" | ||
} | ||
] | ||
}, | ||
"ef32-111": { | ||
"8283-111": { | ||
"id": "/packages/table-core/src/utils/getFacetedUniqueValues.ts", | ||
"moduleParts": { | ||
"index.production.js": "ef32-112" | ||
"index.production.js": "8283-112" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "ef32-63" | ||
"uid": "8283-63" | ||
} | ||
@@ -949,14 +949,14 @@ ], | ||
{ | ||
"uid": "ef32-123" | ||
"uid": "8283-123" | ||
} | ||
] | ||
}, | ||
"ef32-113": { | ||
"8283-113": { | ||
"id": "/packages/table-core/src/utils/getFacetedMinMaxValues.ts", | ||
"moduleParts": { | ||
"index.production.js": "ef32-114" | ||
"index.production.js": "8283-114" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "ef32-63" | ||
"uid": "8283-63" | ||
} | ||
@@ -966,14 +966,14 @@ ], | ||
{ | ||
"uid": "ef32-123" | ||
"uid": "8283-123" | ||
} | ||
] | ||
}, | ||
"ef32-115": { | ||
"8283-115": { | ||
"id": "/packages/table-core/src/utils/getSortedRowModel.ts", | ||
"moduleParts": { | ||
"index.production.js": "ef32-116" | ||
"index.production.js": "8283-116" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "ef32-63" | ||
"uid": "8283-63" | ||
} | ||
@@ -983,17 +983,17 @@ ], | ||
{ | ||
"uid": "ef32-123" | ||
"uid": "8283-123" | ||
} | ||
] | ||
}, | ||
"ef32-117": { | ||
"8283-117": { | ||
"id": "/packages/table-core/src/utils/getGroupedRowModel.ts", | ||
"moduleParts": { | ||
"index.production.js": "ef32-118" | ||
"index.production.js": "8283-118" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "ef32-99" | ||
"uid": "8283-99" | ||
}, | ||
{ | ||
"uid": "ef32-63" | ||
"uid": "8283-63" | ||
} | ||
@@ -1003,14 +1003,14 @@ ], | ||
{ | ||
"uid": "ef32-123" | ||
"uid": "8283-123" | ||
} | ||
] | ||
}, | ||
"ef32-119": { | ||
"8283-119": { | ||
"id": "/packages/table-core/src/utils/getExpandedRowModel.ts", | ||
"moduleParts": { | ||
"index.production.js": "ef32-120" | ||
"index.production.js": "8283-120" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "ef32-63" | ||
"uid": "8283-63" | ||
} | ||
@@ -1020,20 +1020,20 @@ ], | ||
{ | ||
"uid": "ef32-123" | ||
"uid": "8283-123" | ||
}, | ||
{ | ||
"uid": "ef32-121" | ||
"uid": "8283-121" | ||
} | ||
] | ||
}, | ||
"ef32-121": { | ||
"8283-121": { | ||
"id": "/packages/table-core/src/utils/getPaginationRowModel.ts", | ||
"moduleParts": { | ||
"index.production.js": "ef32-122" | ||
"index.production.js": "8283-122" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "ef32-63" | ||
"uid": "8283-63" | ||
}, | ||
{ | ||
"uid": "ef32-119" | ||
"uid": "8283-119" | ||
} | ||
@@ -1043,101 +1043,101 @@ ], | ||
{ | ||
"uid": "ef32-123" | ||
"uid": "8283-123" | ||
} | ||
] | ||
}, | ||
"ef32-123": { | ||
"8283-123": { | ||
"id": "/packages/table-core/src/index.ts", | ||
"moduleParts": { | ||
"index.production.js": "ef32-124" | ||
"index.production.js": "8283-124" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "ef32-95" | ||
"uid": "8283-95" | ||
}, | ||
{ | ||
"uid": "ef32-125" | ||
"uid": "8283-125" | ||
}, | ||
{ | ||
"uid": "ef32-65" | ||
"uid": "8283-65" | ||
}, | ||
{ | ||
"uid": "ef32-67" | ||
"uid": "8283-67" | ||
}, | ||
{ | ||
"uid": "ef32-99" | ||
"uid": "8283-99" | ||
}, | ||
{ | ||
"uid": "ef32-97" | ||
"uid": "8283-97" | ||
}, | ||
{ | ||
"uid": "ef32-69" | ||
"uid": "8283-69" | ||
}, | ||
{ | ||
"uid": "ef32-71" | ||
"uid": "8283-71" | ||
}, | ||
{ | ||
"uid": "ef32-75" | ||
"uid": "8283-75" | ||
}, | ||
{ | ||
"uid": "ef32-79" | ||
"uid": "8283-79" | ||
}, | ||
{ | ||
"uid": "ef32-81" | ||
"uid": "8283-81" | ||
}, | ||
{ | ||
"uid": "ef32-83" | ||
"uid": "8283-83" | ||
}, | ||
{ | ||
"uid": "ef32-85" | ||
"uid": "8283-85" | ||
}, | ||
{ | ||
"uid": "ef32-87" | ||
"uid": "8283-87" | ||
}, | ||
{ | ||
"uid": "ef32-91" | ||
"uid": "8283-91" | ||
}, | ||
{ | ||
"uid": "ef32-93" | ||
"uid": "8283-93" | ||
}, | ||
{ | ||
"uid": "ef32-73" | ||
"uid": "8283-73" | ||
}, | ||
{ | ||
"uid": "ef32-89" | ||
"uid": "8283-89" | ||
}, | ||
{ | ||
"uid": "ef32-77" | ||
"uid": "8283-77" | ||
}, | ||
{ | ||
"uid": "ef32-101" | ||
"uid": "8283-101" | ||
}, | ||
{ | ||
"uid": "ef32-63" | ||
"uid": "8283-63" | ||
}, | ||
{ | ||
"uid": "ef32-103" | ||
"uid": "8283-103" | ||
}, | ||
{ | ||
"uid": "ef32-107" | ||
"uid": "8283-107" | ||
}, | ||
{ | ||
"uid": "ef32-109" | ||
"uid": "8283-109" | ||
}, | ||
{ | ||
"uid": "ef32-111" | ||
"uid": "8283-111" | ||
}, | ||
{ | ||
"uid": "ef32-113" | ||
"uid": "8283-113" | ||
}, | ||
{ | ||
"uid": "ef32-115" | ||
"uid": "8283-115" | ||
}, | ||
{ | ||
"uid": "ef32-117" | ||
"uid": "8283-117" | ||
}, | ||
{ | ||
"uid": "ef32-119" | ||
"uid": "8283-119" | ||
}, | ||
{ | ||
"uid": "ef32-121" | ||
"uid": "8283-121" | ||
} | ||
@@ -1148,3 +1148,3 @@ ], | ||
}, | ||
"ef32-125": { | ||
"8283-125": { | ||
"id": "/packages/table-core/src/types.ts", | ||
@@ -1155,3 +1155,3 @@ "moduleParts": {}, | ||
{ | ||
"uid": "ef32-123" | ||
"uid": "8283-123" | ||
} | ||
@@ -1158,0 +1158,0 @@ ] |
@@ -11,3 +11,3 @@ /** | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).TableCore={})}(this,(function(e){"use strict";function t(e,t){return"function"==typeof e?e(t):e}function n(e,n){return o=>{n.setState((n=>({...n,[e]:t(o,n[e])})))}}function o(e){return e instanceof Function}function l(e,t){const n=[],o=e=>{e.forEach((e=>{n.push(e);const l=t(e);null!=l&&l.length&&o(l)}))};return o(e),n}function i(e,t,n){let o,l=[];return()=>{let i;n.key&&n.debug&&(i=Date.now());const r=e();if(!(r.length!==l.length||r.some(((e,t)=>l[t]!==e))))return o;let s;if(l=r,n.key&&n.debug&&(s=Date.now()),o=t(...r),null==n||null==n.onChange||n.onChange(o),n.key&&n.debug&&null!=n&&n.debug()){const e=Math.round(100*(Date.now()-i))/100,t=Math.round(100*(Date.now()-s))/100,o=t/16,l=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${l(t,5)} /${l(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*o,120))}deg 100% 31%);`,null==n?void 0:n.key)}return o}}function r(e,t,n,o){const l={...e._getDefaultColumnDef(),...t},r=l.accessorKey;let s,a=l.id??(r?r.replace(".","_"):void 0)??("string"==typeof l.header?l.header:void 0);if(l.accessorFn?s=l.accessorFn:r&&(s=r.includes(".")?e=>{let t=e;for(const e of r.split("."))t=t[e];return t}:e=>e[l.accessorKey]),!a)throw new Error;let u={id:`${String(a)}`,accessorFn:s,parent:o,depth:n,columnDef:l,columns:[],getFlatColumns:i((()=>[!0]),(()=>{var e;return[u,...null==(e=u.columns)?void 0:e.flatMap((e=>e.getFlatColumns()))]}),{key:"column.getFlatColumns",debug:()=>e.options.debugAll??e.options.debugColumns}),getLeafColumns:i((()=>[e._getOrderColumnsFn()]),(e=>{var t;if(null!=(t=u.columns)&&t.length){let t=u.columns.flatMap((e=>e.getLeafColumns()));return e(t)}return[u]}),{key:"column.getLeafColumns",debug:()=>e.options.debugAll??e.options.debugColumns})};return u=e._features.reduce(((t,n)=>Object.assign(t,null==n.createColumn?void 0:n.createColumn(u,e))),u),u}function s(e,t,n){let o={id:n.id??t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const e=[],t=n=>{n.subHeaders&&n.subHeaders.length&&n.subHeaders.map(t),e.push(n)};return t(o),e},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach((t=>{Object.assign(o,null==t.createHeader?void 0:t.createHeader(o,e))})),o}const a={createTable:e=>({getHeaderGroups:i((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,n,o,l)=>{const i=(null==o?void 0:o.map((e=>n.find((t=>t.id===e)))).filter(Boolean))??[],r=(null==l?void 0:l.map((e=>n.find((t=>t.id===e)))).filter(Boolean))??[];return u(t,[...i,...n.filter((e=>!(null!=o&&o.includes(e.id)||null!=l&&l.includes(e.id)))),...r],e)}),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getCenterHeaderGroups:i((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,n,o,l)=>u(t,n=n.filter((e=>!(null!=o&&o.includes(e.id)||null!=l&&l.includes(e.id)))),e,"center")),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getLeftHeaderGroups:i((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left]),((t,n,o)=>u(t,(null==o?void 0:o.map((e=>n.find((t=>t.id===e)))).filter(Boolean))??[],e,"left")),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getRightHeaderGroups:i((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right]),((t,n,o)=>u(t,(null==o?void 0:o.map((e=>n.find((t=>t.id===e)))).filter(Boolean))??[],e,"right")),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getFooterGroups:i((()=>[e.getHeaderGroups()]),(e=>[...e].reverse()),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getLeftFooterGroups:i((()=>[e.getLeftHeaderGroups()]),(e=>[...e].reverse()),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getCenterFooterGroups:i((()=>[e.getCenterHeaderGroups()]),(e=>[...e].reverse()),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getRightFooterGroups:i((()=>[e.getRightHeaderGroups()]),(e=>[...e].reverse()),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getFlatHeaders:i((()=>[e.getHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getLeftFlatHeaders:i((()=>[e.getLeftHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getCenterFlatHeaders:i((()=>[e.getCenterHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getRightFlatHeaders:i((()=>[e.getRightHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getCenterLeafHeaders:i((()=>[e.getCenterFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getLeftLeafHeaders:i((()=>[e.getLeftFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getRightLeafHeaders:i((()=>[e.getRightFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getLeafHeaders:i((()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()]),((e,t,n)=>{var o,l,i;return[...(null==(o=e[0])?void 0:o.headers)??[],...(null==(l=t[0])?void 0:l.headers)??[],...(null==(i=n[0])?void 0:i.headers)??[]].map((e=>e.getLeafHeaders())).flat()}),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders})})};function u(e,t,n,o){var l;let i=0;const r=function(e,t){void 0===t&&(t=1),i=Math.max(i,t),e.filter((e=>e.getIsVisible())).forEach((e=>{var n;null!=(n=e.columns)&&n.length&&r(e.columns,t+1)}),0)};r(e);let a=[];const u=(e,t)=>{const l={depth:t,id:[o,`${t}`].filter(Boolean).join("_"),headers:[]},i=[];e.forEach((e=>{const r=[...i].reverse()[0];let a,u=!1;if(e.column.depth===l.depth&&e.column.parent?a=e.column.parent:(a=e.column,u=!0),r&&(null==r?void 0:r.column)===a)r.subHeaders.push(e);else{const l=s(n,a,{id:[o,t,a.id,null==e?void 0:e.id].filter(Boolean).join("_"),isPlaceholder:u,placeholderId:u?`${i.filter((e=>e.column===a)).length}`:void 0,depth:t,index:i.length});l.subHeaders.push(e),i.push(l)}l.headers.push(e),e.headerGroup=l})),a.push(l),t>0&&u(i,t-1)},g=t.map(((e,t)=>s(n,e,{depth:i,index:t})));u(g,i-1),a.reverse();const d=e=>e.filter((e=>e.column.getIsVisible())).map((e=>{let t=0,n=0,o=[0];e.subHeaders&&e.subHeaders.length?(o=[],d(e.subHeaders).forEach((e=>{let{colSpan:n,rowSpan:l}=e;t+=n,o.push(l)}))):t=1;return n+=Math.min(...o),e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}}));return d((null==(l=a[0])?void 0:l.headers)??[]),a}const g={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},d={getDefaultColumnDef:()=>g,getInitialState:e=>({columnSizing:{},columnSizingInfo:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]},...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",onColumnSizingChange:n("columnSizing",e),onColumnSizingInfoChange:n("columnSizingInfo",e)}),createColumn:(e,t)=>({getSize:()=>{const n=t.getState().columnSizing[e.id];return Math.min(Math.max(e.columnDef.minSize??g.minSize,n??e.columnDef.size??g.size),e.columnDef.maxSize??g.maxSize)},getStart:n=>{const o=n?"left"===n?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns(),l=o.findIndex((t=>t.id===e.id));if(l>0){const e=o[l-1];return e.getStart(n)+e.getSize()}return 0},resetSize:()=>{t.setColumnSizing((t=>{let{[e.id]:n,...o}=t;return o}))},getCanResize:()=>(e.columnDef.enableResizing??!0)&&(t.options.enableColumnResizing??!0),getIsResizing:()=>t.getState().columnSizingInfo.isResizingColumn===e.id}),createHeader:(e,t)=>({getSize:()=>{let t=0;const n=e=>{e.subHeaders.length?e.subHeaders.forEach(n):t+=e.column.getSize()??0};return n(e),t},getStart:()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},getResizeHandler:()=>{const n=t.getColumn(e.column.id),o=n.getCanResize();return l=>{if(!o)return;if(null==l.persist||l.persist(),f(l)&&l.touches&&l.touches.length>1)return;const i=e.getSize(),r=e?e.getLeafHeaders().map((e=>[e.column.id,e.column.getSize()])):[[n.id,n.getSize()]],s=f(l)?Math.round(l.touches[0].clientX):l.clientX,a=(e,n)=>{if("number"!=typeof n)return;let o={};t.setColumnSizingInfo((e=>{const t=n-((null==e?void 0:e.startOffset)??0),l=Math.max(t/((null==e?void 0:e.startSize)??0),-.999999);return e.columnSizingStart.forEach((e=>{let[t,n]=e;o[t]=Math.round(100*Math.max(n+n*l,0))/100})),{...e,deltaOffset:t,deltaPercentage:l}})),"onChange"!==t.options.columnResizeMode&&"end"!==e||t.setColumnSizing((e=>({...e,...o})))},u={moveHandler:e=>{return t=e.clientX,a("move",t);var t},upHandler:e=>{var n;document.removeEventListener("mousemove",u.moveHandler),document.removeEventListener("mouseup",u.upHandler),n=e.clientX,a("end",n),t.setColumnSizingInfo((e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]})))}},g=!!p()&&{passive:!1};f(l)||(document.addEventListener("mousemove",u.moveHandler,g),document.addEventListener("mouseup",u.upHandler,g)),t.setColumnSizingInfo((e=>({...e,startOffset:s,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:r,isResizingColumn:n.id})))}}}),createTable:e=>({setColumnSizing:t=>null==e.options.onColumnSizingChange?void 0:e.options.onColumnSizingChange(t),setColumnSizingInfo:t=>null==e.options.onColumnSizingInfoChange?void 0:e.options.onColumnSizingInfoChange(t),resetColumnSizing:t=>{e.setColumnSizing(t?{}:e.initialState.columnSizing??{})},resetHeaderSizeInfo:t=>{e.setColumnSizingInfo(t?{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}:e.initialState.columnSizingInfo??{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]})},getTotalSize:()=>{var t;return(null==(t=e.getHeaderGroups()[0])?void 0:t.headers.reduce(((e,t)=>e+t.getSize()),0))??0},getLeftTotalSize:()=>{var t;return(null==(t=e.getLeftHeaderGroups()[0])?void 0:t.headers.reduce(((e,t)=>e+t.getSize()),0))??0},getCenterTotalSize:()=>{var t;return(null==(t=e.getCenterHeaderGroups()[0])?void 0:t.headers.reduce(((e,t)=>e+t.getSize()),0))??0},getRightTotalSize:()=>{var t;return(null==(t=e.getRightHeaderGroups()[0])?void 0:t.headers.reduce(((e,t)=>e+t.getSize()),0))??0}})};let c=null;function p(){if("boolean"==typeof c)return c;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch(t){e=!1}return c=e,c}function f(e){return"touchstart"===e.type}const m={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:n("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;return{_autoResetExpanded:()=>{if(t){if(e.options.autoResetAll??e.options.autoResetExpanded??!e.options.manualExpanding){if(n)return;n=!0,e._queue((()=>{e.resetExpanded(),n=!1}))}}else e._queue((()=>{t=!0}))},setExpanded:t=>null==e.options.onExpandedChange?void 0:e.options.onExpandedChange(t),toggleAllRowsExpanded:t=>{t??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},resetExpanded:t=>{var n;e.setExpanded(t?{}:(null==(n=e.initialState)?void 0:n.expanded)??{})},getCanSomeRowsExpand:()=>e.getRowModel().flatRows.some((e=>e.getCanExpand())),getToggleAllRowsExpandedHandler:()=>t=>{null==t.persist||t.persist(),e.toggleAllRowsExpanded()},getIsSomeRowsExpanded:()=>{const t=e.getState().expanded;return!0===t||Object.values(t).some(Boolean)},getIsAllRowsExpanded:()=>{const t=e.getState().expanded;return"boolean"==typeof t?!0===t:!!Object.keys(t).length&&!e.getRowModel().flatRows.some((e=>!e.getIsExpanded()))},getExpandedDepth:()=>{let t=0;return(!0===e.getState().expanded?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach((e=>{const n=e.split(".");t=Math.max(t,n.length)})),t},getPreExpandedRowModel:()=>e.getSortedRowModel(),getExpandedRowModel:()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())}},createRow:(e,t)=>({toggleExpanded:n=>{t.setExpanded((o=>{const l=!0===o||!(null==o||!o[e.id]);let i={};if(!0===o?Object.keys(t.getRowModel().rowsById).forEach((e=>{i[e]=!0})):i=o,n=n??!l,!l&&n)return{...i,[e.id]:!0};if(l&&!n){const{[e.id]:t,...n}=i;return n}return o}))},getIsExpanded:()=>{const n=t.getState().expanded;return!!((null==t.options.getIsRowExpanded?void 0:t.options.getIsRowExpanded(e))??(!0===n||null!=n&&n[e.id]))},getCanExpand:()=>{var n;return(null==t.options.getRowCanExpand?void 0:t.options.getRowCanExpand(e))??((t.options.enableExpanding??!0)&&!(null==(n=e.subRows)||!n.length))},getToggleExpandedHandler:()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}})},b=(e,t,n)=>{var o;const l=n.toLowerCase();return null==(o=e.getValue(t))?void 0:o.toLowerCase().includes(l)};b.autoRemove=e=>y(e);const w=(e,t,n)=>{var o;return null==(o=e.getValue(t))?void 0:o.includes(n)};w.autoRemove=e=>y(e);const S=(e,t,n)=>{var o;return(null==(o=e.getValue(t))?void 0:o.toLowerCase())===n.toLowerCase()};S.autoRemove=e=>y(e);const C=(e,t,n)=>{var o;return null==(o=e.getValue(t))?void 0:o.includes(n)};C.autoRemove=e=>y(e)||!(null!=e&&e.length);const h=(e,t,n)=>!n.some((n=>{var o;return!(null!=(o=e.getValue(t))&&o.includes(n))}));h.autoRemove=e=>y(e)||!(null!=e&&e.length);const R=(e,t,n)=>n.some((n=>{var o;return null==(o=e.getValue(t))?void 0:o.includes(n)}));R.autoRemove=e=>y(e)||!(null!=e&&e.length);const v=(e,t,n)=>e.getValue(t)===n;v.autoRemove=e=>y(e);const F=(e,t,n)=>e.getValue(t)==n;F.autoRemove=e=>y(e);const M=(e,t,n)=>{let[o,l]=n;const i=e.getValue(t);return i>=o&&i<=l};M.resolveFilterValue=e=>{let[t,n]=e,o="number"!=typeof t?parseFloat(t):t,l="number"!=typeof n?parseFloat(n):n,i=null===t||Number.isNaN(o)?-1/0:o,r=null===n||Number.isNaN(l)?1/0:l;if(i>r){const e=i;i=r,r=e}return[i,r]},M.autoRemove=e=>y(e)||y(e[0])&&y(e[1]);const V={includesString:b,includesStringSensitive:w,equalsString:S,arrIncludes:C,arrIncludesAll:h,arrIncludesSome:R,equals:v,weakEquals:F,inNumberRange:M};function y(e){return null==e||""===e}const I={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:n("columnFilters",e),onGlobalFilterChange:n("globalFilter",e),filterFromLeafRows:!1,globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n,o;const l=null==(n=e.getCoreRowModel().flatRows[0])||null==(o=n._getAllCellsByColumnId()[t.id])?void 0:o.getValue();return"string"==typeof l||"number"==typeof l}}),createColumn:(e,n)=>({getAutoFilterFn:()=>{const t=n.getCoreRowModel().flatRows[0],o=null==t?void 0:t.getValue(e.id);return"string"==typeof o?V.includesString:"number"==typeof o?V.inNumberRange:"boolean"==typeof o||null!==o&&"object"==typeof o?V.equals:Array.isArray(o)?V.arrIncludes:V.weakEquals},getFilterFn:()=>{var t;return o(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?e.getAutoFilterFn():(null==(t=n.options.filterFns)?void 0:t[e.columnDef.filterFn])??V[e.columnDef.filterFn]},getCanFilter:()=>(e.columnDef.enableColumnFilter??!0)&&(n.options.enableColumnFilters??!0)&&(n.options.enableFilters??!0)&&!!e.accessorFn,getCanGlobalFilter:()=>(e.columnDef.enableGlobalFilter??!0)&&(n.options.enableGlobalFilter??!0)&&(n.options.enableFilters??!0)&&((null==n.options.getColumnCanGlobalFilter?void 0:n.options.getColumnCanGlobalFilter(e))??!0)&&!!e.accessorFn,getIsFiltered:()=>e.getFilterIndex()>-1,getFilterValue:()=>{var t,o;return null==(t=n.getState().columnFilters)||null==(o=t.find((t=>t.id===e.id)))?void 0:o.value},getFilterIndex:()=>{var t;return(null==(t=n.getState().columnFilters)?void 0:t.findIndex((t=>t.id===e.id)))??-1},setFilterValue:o=>{n.setColumnFilters((n=>{const l=e.getFilterFn(),i=null==n?void 0:n.find((t=>t.id===e.id)),r=t(o,i?i.value:void 0);if(x(l,r,e))return(null==n?void 0:n.filter((t=>t.id!==e.id)))??[];const s={id:e.id,value:r};return i?(null==n?void 0:n.map((t=>t.id===e.id?s:t)))??[]:null!=n&&n.length?[...n,s]:[s]}))},_getFacetedRowModel:n.options.getFacetedRowModel&&n.options.getFacetedRowModel(n,e.id),getFacetedRowModel:()=>e._getFacetedRowModel?e._getFacetedRowModel():n.getPreFilteredRowModel(),_getFacetedUniqueValues:n.options.getFacetedUniqueValues&&n.options.getFacetedUniqueValues(n,e.id),getFacetedUniqueValues:()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,_getFacetedMinMaxValues:n.options.getFacetedMinMaxValues&&n.options.getFacetedMinMaxValues(n,e.id),getFacetedMinMaxValues:()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}),createRow:(e,t)=>({columnFilters:{},columnFiltersMeta:{}}),createTable:e=>({getGlobalAutoFilterFn:()=>V.includesString,getGlobalFilterFn:()=>{var t;const{globalFilterFn:n}=e.options;return o(n)?n:"auto"===n?e.getGlobalAutoFilterFn():(null==(t=e.options.filterFns)?void 0:t[n])??V[n]},setColumnFilters:n=>{const o=e.getAllLeafColumns();null==e.options.onColumnFiltersChange||e.options.onColumnFiltersChange((e=>{var l;return null==(l=t(n,e))?void 0:l.filter((e=>{const t=o.find((t=>t.id===e.id));if(t){if(x(t.getFilterFn(),e.value,t))return!1}return!0}))}))},setGlobalFilter:t=>{null==e.options.onGlobalFilterChange||e.options.onGlobalFilterChange(t)},resetGlobalFilter:t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)},resetColumnFilters:t=>{var n;e.setColumnFilters(t?[]:(null==(n=e.initialState)?void 0:n.columnFilters)??[])},getPreFilteredRowModel:()=>e.getCoreRowModel(),getFilteredRowModel:()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel()),_getGlobalFacetedRowModel:e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),getGlobalFacetedRowModel:()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),_getGlobalFacetedUniqueValues:e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),getGlobalFacetedUniqueValues:()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,_getGlobalFacetedMinMaxValues:e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),getGlobalFacetedMinMaxValues:()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}})};function x(e,t,n){return!(!e||!e.autoRemove)&&e.autoRemove(t,n)||void 0===t||"string"==typeof t&&!t}const _={sum:(e,t,n)=>n.reduce(((t,n)=>{const o=n.getValue(e);return t+("number"==typeof o?o:0)}),0),min:(e,t,n)=>{let o;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(o>n||void 0===o&&n>=n)&&(o=n)})),o},max:(e,t,n)=>{let o;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(o<n||void 0===o&&n>=n)&&(o=n)})),o},extent:(e,t,n)=>{let o,l;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(void 0===o?n>=n&&(o=l=n):(o>n&&(o=n),l<n&&(l=n)))})),[o,l]},mean:(e,t)=>{let n=0,o=0;if(t.forEach((t=>{let l=t.getValue(e);null!=l&&(l=+l)>=l&&(++n,o+=l)})),n)return o/n},median:(e,t)=>{if(!t.length)return;let n=0,o=0;return t.forEach((t=>{let l=t.getValue(e);"number"==typeof l&&(n=Math.min(n,l),o=Math.max(o,l))})),(n+o)/2},unique:(e,t)=>Array.from(new Set(t.map((t=>t.getValue(e)))).values()),uniqueCount:(e,t)=>new Set(t.map((t=>t.getValue(e)))).size,count:(e,t)=>t.length},A={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t;return(null==(t=e.getValue())||null==t.toString?void 0:t.toString())??null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:n("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>({toggleGrouping:()=>{t.setGrouping((t=>null!=t&&t.includes(e.id)?t.filter((t=>t!==e.id)):[...t??[],e.id]))},getCanGroup:()=>e.columnDef.enableGrouping??!0??t.options.enableGrouping??!0??!!e.accessorFn,getIsGrouped:()=>{var n;return null==(n=t.getState().grouping)?void 0:n.includes(e.id)},getGroupedIndex:()=>{var n;return null==(n=t.getState().grouping)?void 0:n.indexOf(e.id)},getToggleGroupingHandler:()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},getAutoAggregationFn:()=>{const n=t.getCoreRowModel().flatRows[0],o=null==n?void 0:n.getValue(e.id);return"number"==typeof o?_.sum:"[object Date]"===Object.prototype.toString.call(o)?_.extent:void 0},getAggregationFn:()=>{var n;if(!e)throw new Error;return o(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:"auto"===e.columnDef.aggregationFn?e.getAutoAggregationFn():(null==(n=t.options.aggregationFns)?void 0:n[e.columnDef.aggregationFn])??_[e.columnDef.aggregationFn]}}),createTable:e=>({setGrouping:t=>null==e.options.onGroupingChange?void 0:e.options.onGroupingChange(t),resetGrouping:t=>{var n;e.setGrouping(t?[]:(null==(n=e.initialState)?void 0:n.grouping)??[])},getPreGroupedRowModel:()=>e.getFilteredRowModel(),getGroupedRowModel:()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())}),createRow:e=>({getIsGrouped:()=>!!e.groupingColumnId,_groupingValuesCache:{}}),createCell:(e,t,n,o)=>({getIsGrouped:()=>t.getIsGrouped()&&t.id===n.groupingColumnId,getIsPlaceholder:()=>!e.getIsGrouped()&&t.getIsGrouped(),getIsAggregated:()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!(null==(t=n.subRows)||!t.length)}})};function P(e,t,n){if(null==t||!t.length||!n)return e;const o=e.filter((e=>!t.includes(e.id)));if("remove"===n)return o;return[...t.map((t=>e.find((e=>e.id===t)))).filter(Boolean),...o]}const E={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:n("columnOrder",e)}),createTable:e=>({setColumnOrder:t=>null==e.options.onColumnOrderChange?void 0:e.options.onColumnOrderChange(t),resetColumnOrder:t=>{e.setColumnOrder(t?[]:e.initialState.columnOrder??[])},_getOrderColumnsFn:i((()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode]),((e,t,n)=>o=>{let l=[];if(null!=e&&e.length){const t=[...e],n=[...o];for(;n.length&&t.length;){const e=t.shift(),o=n.findIndex((t=>t.id===e));o>-1&&l.push(n.splice(o,1)[0])}l=[...l,...n]}else l=o;return P(l,t,n)}),{key:!1})})},G={getInitialState:e=>({...e,pagination:{pageIndex:0,pageSize:10,...null==e?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:n("pagination",e)}),createTable:e=>{let n=!1,o=!1;return{_autoResetPageIndex:()=>{if(n){if(e.options.autoResetAll??e.options.autoResetPageIndex??!e.options.manualPagination){if(o)return;o=!0,e._queue((()=>{e.resetPageIndex(),o=!1}))}}else e._queue((()=>{n=!0}))},setPagination:n=>null==e.options.onPaginationChange?void 0:e.options.onPaginationChange((e=>t(n,e))),resetPagination:t=>{e.setPagination(t?{pageIndex:0,pageSize:10}:e.initialState.pagination??{pageIndex:0,pageSize:10})},setPageIndex:n=>{e.setPagination((o=>{let l=t(n,o.pageIndex);const i=void 0===e.options.pageCount||-1===e.options.pageCount?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return l=Math.min(Math.max(0,l),i),{...o,pageIndex:l}}))},resetPageIndex:t=>{var n,o;e.setPageIndex(t?0:(null==(n=e.initialState)||null==(o=n.pagination)?void 0:o.pageIndex)??0)},resetPageSize:t=>{var n,o;e.setPageSize(t?10:(null==(n=e.initialState)||null==(o=n.pagination)?void 0:o.pageSize)??10)},setPageSize:n=>{e.setPagination((e=>{const o=Math.max(1,t(n,e.pageSize)),l=e.pageSize*e.pageIndex,i=Math.floor(l/o);return{...e,pageIndex:i,pageSize:o}}))},setPageCount:n=>e.setPagination((o=>{let l=t(n,e.options.pageCount??-1);return"number"==typeof l&&(l=Math.max(-1,l)),{...o,pageCount:l}})),getPageOptions:i((()=>[e.getPageCount()]),(e=>{let t=[];return e&&e>0&&(t=[...new Array(e)].fill(null).map(((e,t)=>t))),t}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable}),getCanPreviousPage:()=>e.getState().pagination.pageIndex>0,getCanNextPage:()=>{const{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return-1===n||0!==n&&t<n-1},previousPage:()=>e.setPageIndex((e=>e-1)),nextPage:()=>e.setPageIndex((e=>e+1)),getPrePaginationRowModel:()=>e.getExpandedRowModel(),getPaginationRowModel:()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),getPageCount:()=>e.options.pageCount??Math.ceil(e.getPrePaginationRowModel().rows.length/e.getState().pagination.pageSize)}}},z={getInitialState:e=>({columnPinning:{left:[],right:[]},...e}),getDefaultOptions:e=>({onColumnPinningChange:n("columnPinning",e)}),createColumn:(e,t)=>({pin:n=>{const o=e.getLeafColumns().map((e=>e.id)).filter(Boolean);t.setColumnPinning((e=>"right"===n?{left:((null==e?void 0:e.left)??[]).filter((e=>!(null!=o&&o.includes(e)))),right:[...((null==e?void 0:e.right)??[]).filter((e=>!(null!=o&&o.includes(e)))),...o]}:"left"===n?{left:[...((null==e?void 0:e.left)??[]).filter((e=>!(null!=o&&o.includes(e)))),...o],right:((null==e?void 0:e.right)??[]).filter((e=>!(null!=o&&o.includes(e))))}:{left:((null==e?void 0:e.left)??[]).filter((e=>!(null!=o&&o.includes(e)))),right:((null==e?void 0:e.right)??[]).filter((e=>!(null!=o&&o.includes(e))))}))},getCanPin:()=>e.getLeafColumns().some((e=>(e.columnDef.enablePinning??!0)&&(t.options.enablePinning??!0))),getIsPinned:()=>{const n=e.getLeafColumns().map((e=>e.id)),{left:o,right:l}=t.getState().columnPinning,i=n.some((e=>null==o?void 0:o.includes(e))),r=n.some((e=>null==l?void 0:l.includes(e)));return i?"left":!!r&&"right"},getPinnedIndex:()=>{var n,o;const l=e.getIsPinned();return l?(null==(n=t.getState().columnPinning)||null==(o=n[l])?void 0:o.indexOf(e.id))??-1:0}}),createRow:(e,t)=>({getCenterVisibleCells:i((()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right]),((e,t,n)=>{const o=[...t??[],...n??[]];return e.filter((e=>!o.includes(e.column.id)))}),{key:"row.getCenterVisibleCells",debug:()=>t.options.debugAll??t.options.debugRows}),getLeftVisibleCells:i((()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,,]),((e,t)=>(t??[]).map((t=>e.find((e=>e.column.id===t)))).filter(Boolean).map((e=>({...e,position:"left"})))),{key:"row.getLeftVisibleCells",debug:()=>t.options.debugAll??t.options.debugRows}),getRightVisibleCells:i((()=>[e._getAllVisibleCells(),t.getState().columnPinning.right]),((e,t)=>(t??[]).map((t=>e.find((e=>e.column.id===t)))).filter(Boolean).map((e=>({...e,position:"right"})))),{key:"row.getRightVisibleCells",debug:()=>t.options.debugAll??t.options.debugRows})}),createTable:e=>({setColumnPinning:t=>null==e.options.onColumnPinningChange?void 0:e.options.onColumnPinningChange(t),resetColumnPinning:t=>{var n;return e.setColumnPinning(t?{left:[],right:[]}:(null==(n=e.initialState)?void 0:n.columnPinning)??{left:[],right:[]})},getIsSomeColumnsPinned:t=>{var n;const o=e.getState().columnPinning;var l,i;return t?Boolean(null==(n=o[t])?void 0:n.length):Boolean((null==(l=o.left)?void 0:l.length)||(null==(i=o.right)?void 0:i.length))},getLeftLeafColumns:i((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left]),((e,t)=>(t??[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),{key:!1,debug:()=>e.options.debugAll??e.options.debugColumns}),getRightLeafColumns:i((()=>[e.getAllLeafColumns(),e.getState().columnPinning.right]),((e,t)=>(t??[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),{key:!1,debug:()=>e.options.debugAll??e.options.debugColumns}),getCenterLeafColumns:i((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((e,t,n)=>{const o=[...t??[],...n??[]];return e.filter((e=>!o.includes(e.id)))}),{key:!1,debug:()=>e.options.debugAll??e.options.debugColumns})})},H={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:n("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>({setRowSelection:t=>null==e.options.onRowSelectionChange?void 0:e.options.onRowSelectionChange(t),resetRowSelection:t=>e.setRowSelection(t?{}:e.initialState.rowSelection??{}),toggleAllRowsSelected:t=>{e.setRowSelection((n=>{t=void 0!==t?t:!e.getIsAllRowsSelected();const o={...n},l=e.getPreGroupedRowModel().flatRows;return t?l.forEach((e=>{e.getCanSelect()&&(o[e.id]=!0)})):l.forEach((e=>{delete o[e.id]})),o}))},toggleAllPageRowsSelected:t=>e.setRowSelection((n=>{const o=void 0!==t?t:!e.getIsAllPageRowsSelected(),l={...n};return e.getRowModel().rows.forEach((t=>{L(l,t.id,o,e)})),l})),getPreSelectedRowModel:()=>e.getCoreRowModel(),getSelectedRowModel:i((()=>[e.getState().rowSelection,e.getCoreRowModel()]),((t,n)=>Object.keys(t).length?k(e,n):{rows:[],flatRows:[],rowsById:{}}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable}),getFilteredSelectedRowModel:i((()=>[e.getState().rowSelection,e.getFilteredRowModel()]),((t,n)=>Object.keys(t).length?k(e,n):{rows:[],flatRows:[],rowsById:{}}),{key:"getFilteredSelectedRowModel",debug:()=>e.options.debugAll??e.options.debugTable}),getGroupedSelectedRowModel:i((()=>[e.getState().rowSelection,e.getSortedRowModel()]),((t,n)=>Object.keys(t).length?k(e,n):{rows:[],flatRows:[],rowsById:{}}),{key:"getGroupedSelectedRowModel",debug:()=>e.options.debugAll??e.options.debugTable}),getIsAllRowsSelected:()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let o=Boolean(t.length&&Object.keys(n).length);return o&&t.some((e=>e.getCanSelect()&&!n[e.id]))&&(o=!1),o},getIsAllPageRowsSelected:()=>{const t=e.getPaginationRowModel().flatRows,{rowSelection:n}=e.getState();let o=!!t.length;return o&&t.some((e=>!n[e.id]))&&(o=!1),o},getIsSomeRowsSelected:()=>{const t=Object.keys(e.getState().rowSelection??{}).length;return t>0&&t<e.getFilteredRowModel().flatRows.length},getIsSomePageRowsSelected:()=>{const t=e.getPaginationRowModel().flatRows;return!e.getIsAllPageRowsSelected()&&t.some((e=>e.getIsSelected()||e.getIsSomeSelected()))},getToggleAllRowsSelectedHandler:()=>t=>{e.toggleAllRowsSelected(t.target.checked)},getToggleAllPageRowsSelectedHandler:()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}}),createRow:(e,t)=>({toggleSelected:n=>{const o=e.getIsSelected();t.setRowSelection((l=>{if(o===(n=void 0!==n?n:!o))return l;const i={...l};return L(i,e.id,n,t),i}))},getIsSelected:()=>{const{rowSelection:n}=t.getState();return D(e,n)},getIsSomeSelected:()=>{const{rowSelection:n}=t.getState();return"some"===O(e,n)},getIsAllSubRowsSelected:()=>{const{rowSelection:n}=t.getState();return"all"===O(e,n)},getCanSelect:()=>"function"==typeof t.options.enableRowSelection?t.options.enableRowSelection(e):t.options.enableRowSelection??!0,getCanSelectSubRows:()=>"function"==typeof t.options.enableSubRowSelection?t.options.enableSubRowSelection(e):t.options.enableSubRowSelection??!0,getCanMultiSelect:()=>"function"==typeof t.options.enableMultiRowSelection?t.options.enableMultiRowSelection(e):t.options.enableMultiRowSelection??!0,getToggleSelectedHandler:()=>{const t=e.getCanSelect();return n=>{var o;t&&e.toggleSelected(null==(o=n.target)?void 0:o.checked)}}})},L=(e,t,n,o)=>{var l;const i=o.getRow(t);n?(i.getCanMultiSelect()||Object.keys(e).forEach((t=>delete e[t])),i.getCanSelect()&&(e[t]=!0)):delete e[t],null!=(l=i.subRows)&&l.length&&i.getCanSelectSubRows()&&i.subRows.forEach((t=>L(e,t.id,n,o)))};function k(e,t){const n=e.getState().rowSelection,o=[],l={},i=function(e,t){return e.map((e=>{var t;const r=D(e,n);if(r&&(o.push(e),l[e.id]=e),null!=(t=e.subRows)&&t.length&&(e={...e,subRows:i(e.subRows)}),r)return e})).filter(Boolean)};return{rows:i(t.rows),flatRows:o,rowsById:l}}function D(e,t){return t[e.id]??!1}function O(e,t,n){if(e.subRows&&e.subRows.length){let n=!0,o=!1;return e.subRows.forEach((e=>{o&&!n||(D(e,t)?o=!0:n=!1)})),n?"all":!!o&&"some"}return!1}const T=/([0-9]+)/gm;function B(e,t){return e===t?0:e>t?1:-1}function j(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function q(e,t){const n=e.split(T).filter(Boolean),o=t.split(T).filter(Boolean);for(;n.length&&o.length;){const e=n.shift(),t=o.shift(),l=parseInt(e,10),i=parseInt(t,10),r=[l,i].sort();if(isNaN(r[0])){if(e>t)return 1;if(t>e)return-1}else{if(isNaN(r[1]))return isNaN(l)?-1:1;if(l>i)return 1;if(i>l)return-1}}return n.length-o.length}const N={alphanumeric:(e,t,n)=>q(j(e.getValue(n)).toLowerCase(),j(t.getValue(n)).toLowerCase()),alphanumericCaseSensitive:(e,t,n)=>q(j(e.getValue(n)),j(t.getValue(n))),text:(e,t,n)=>B(j(e.getValue(n)).toLowerCase(),j(t.getValue(n)).toLowerCase()),textCaseSensitive:(e,t,n)=>B(j(e.getValue(n)),j(t.getValue(n))),datetime:(e,t,n)=>{const o=e.getValue(n),l=t.getValue(n);return o>l?1:o<l?-1:0},basic:(e,t,n)=>B(e.getValue(n),t.getValue(n))},U={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto"}),getDefaultOptions:e=>({onSortingChange:n("sorting",e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>({getAutoSortingFn:()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const t of n){const n=null==t?void 0:t.getValue(e.id);if("[object Date]"===Object.prototype.toString.call(n))return N.datetime;if("string"==typeof n&&(o=!0,n.split(T).length>1))return N.alphanumeric}return o?N.text:N.basic},getAutoSortDir:()=>{const n=t.getFilteredRowModel().flatRows[0];return"string"==typeof(null==n?void 0:n.getValue(e.id))?"asc":"desc"},getSortingFn:()=>{var n;if(!e)throw new Error;return o(e.columnDef.sortingFn)?e.columnDef.sortingFn:"auto"===e.columnDef.sortingFn?e.getAutoSortingFn():(null==(n=t.options.sortingFns)?void 0:n[e.columnDef.sortingFn])??N[e.columnDef.sortingFn]},toggleSorting:(n,o)=>{const l=e.getNextSortingOrder(),i=null!=n;t.setSorting((r=>{const s=null==r?void 0:r.find((t=>t.id===e.id)),a=null==r?void 0:r.findIndex((t=>t.id===e.id));let u,g=[],d=i?n:"desc"===l;return u=null!=r&&r.length&&e.getCanMultiSort()&&o?s?"toggle":"add":null!=r&&r.length&&a!==r.length-1?"replace":s?"toggle":"replace","toggle"===u&&(i||l||(u="remove")),"add"===u?(g=[...r,{id:e.id,desc:d}],g.splice(0,g.length-(t.options.maxMultiSortColCount??Number.MAX_SAFE_INTEGER))):g="toggle"===u?r.map((t=>t.id===e.id?{...t,desc:d}:t)):"remove"===u?r.filter((t=>t.id!==e.id)):[{id:e.id,desc:d}],g}))},getFirstSortDir:()=>e.columnDef.sortDescFirst??t.options.sortDescFirst??"desc"===e.getAutoSortDir()?"desc":"asc",getNextSortingOrder:n=>{const o=e.getFirstSortDir(),l=e.getIsSorted();return l?!(l!==o&&(t.options.enableSortingRemoval??1)&&(!n||(t.options.enableMultiRemove??1)))&&("desc"===l?"asc":"desc"):o},getCanSort:()=>(e.columnDef.enableSorting??!0)&&(t.options.enableSorting??!0)&&!!e.accessorFn,getCanMultiSort:()=>e.columnDef.enableMultiSort??t.options.enableMultiSort??!!e.accessorFn,getIsSorted:()=>{var n;const o=null==(n=t.getState().sorting)?void 0:n.find((t=>t.id===e.id));return!!o&&(o.desc?"desc":"asc")},getSortIndex:()=>{var n;return(null==(n=t.getState().sorting)?void 0:n.findIndex((t=>t.id===e.id)))??-1},clearSorting:()=>{t.setSorting((t=>null!=t&&t.length?t.filter((t=>t.id!==e.id)):[]))},getToggleSortingHandler:()=>{const n=e.getCanSort();return o=>{n&&(null==o.persist||o.persist(),null==e.toggleSorting||e.toggleSorting(void 0,!!e.getCanMultiSort()&&(null==t.options.isMultiSortEvent?void 0:t.options.isMultiSortEvent(o))))}}}),createTable:e=>({setSorting:t=>null==e.options.onSortingChange?void 0:e.options.onSortingChange(t),resetSorting:t=>{var n;e.setSorting(t?[]:(null==(n=e.initialState)?void 0:n.sorting)??[])},getPreSortedRowModel:()=>e.getGroupedRowModel(),getSortedRowModel:()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())})},$={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:n("columnVisibility",e)}),createColumn:(e,t)=>({toggleVisibility:n=>{e.getCanHide()&&t.setColumnVisibility((t=>({...t,[e.id]:n??!e.getIsVisible()})))},getIsVisible:()=>{var n;return(null==(n=t.getState().columnVisibility)?void 0:n[e.id])??!0},getCanHide:()=>(e.columnDef.enableHiding??!0)&&(t.options.enableHiding??!0),getToggleVisibilityHandler:()=>t=>{null==e.toggleVisibility||e.toggleVisibility(t.target.checked)}}),createRow:(e,t)=>({_getAllVisibleCells:i((()=>[e.getAllCells(),t.getState().columnVisibility]),(e=>e.filter((e=>e.column.getIsVisible()))),{key:"row._getAllVisibleCells",debug:()=>t.options.debugAll??t.options.debugRows}),getVisibleCells:i((()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()]),((e,t,n)=>[...e,...t,...n]),{key:!1,debug:()=>t.options.debugAll??t.options.debugRows})}),createTable:e=>{const t=(t,n)=>i((()=>[n(),n().filter((e=>e.getIsVisible())).map((e=>e.id)).join("_")]),(e=>e.filter((e=>null==e.getIsVisible?void 0:e.getIsVisible()))),{key:t,debug:()=>e.options.debugAll??e.options.debugColumns});return{getVisibleFlatColumns:t("getVisibleFlatColumns",(()=>e.getAllFlatColumns())),getVisibleLeafColumns:t("getVisibleLeafColumns",(()=>e.getAllLeafColumns())),getLeftVisibleLeafColumns:t("getLeftVisibleLeafColumns",(()=>e.getLeftLeafColumns())),getRightVisibleLeafColumns:t("getRightVisibleLeafColumns",(()=>e.getRightLeafColumns())),getCenterVisibleLeafColumns:t("getCenterVisibleLeafColumns",(()=>e.getCenterLeafColumns())),setColumnVisibility:t=>null==e.options.onColumnVisibilityChange?void 0:e.options.onColumnVisibilityChange(t),resetColumnVisibility:t=>{e.setColumnVisibility(t?{}:e.initialState.columnVisibility??{})},toggleAllColumnsVisible:t=>{t=t??!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce(((e,n)=>({...e,[n.id]:t||!(null!=n.getCanHide&&n.getCanHide())})),{}))},getIsAllColumnsVisible:()=>!e.getAllLeafColumns().some((e=>!(null!=e.getIsVisible&&e.getIsVisible()))),getIsSomeColumnsVisible:()=>e.getAllLeafColumns().some((e=>null==e.getIsVisible?void 0:e.getIsVisible())),getToggleAllColumnsVisibilityHandler:()=>t=>{var n;e.toggleAllColumnsVisible(null==(n=t.target)?void 0:n.checked)}}}},X=[a,$,E,z,I,U,A,m,G,H,d];function K(e,t,n,o){const l={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(o),renderValue:()=>l.getValue()??e.options.renderFallbackValue,getContext:i((()=>[e,n,t,l]),((e,t,n,o)=>({table:e,column:t,row:n,cell:o,getValue:o.getValue,renderValue:o.renderValue})),{key:!1,debug:()=>e.options.debugAll})};return e._features.forEach((o=>{Object.assign(l,null==o.createCell?void 0:o.createCell(l,n,t,e))}),{}),l}const J=(e,t,n,o,r,s)=>{let a={id:t,index:o,original:n,depth:r,_valuesCache:{},getValue:t=>{if(a._valuesCache.hasOwnProperty(t))return a._valuesCache[t];const n=e.getColumn(t);return n.accessorFn?(a._valuesCache[t]=n.accessorFn(a.original,o),a._valuesCache[t]):void 0},renderValue:t=>a.getValue(t)??e.options.renderFallbackValue,subRows:s??[],getLeafRows:()=>l(a.subRows,(e=>e.subRows)),getAllCells:i((()=>[e.getAllLeafColumns()]),(t=>t.map((t=>K(e,a,t,t.id)))),{key:!1,debug:()=>e.options.debugAll??e.options.debugRows}),_getAllCellsByColumnId:i((()=>[a.getAllCells()]),(e=>e.reduce(((e,t)=>(e[t.column.id]=t,e)),{})),{key:"row.getAllCellsByColumnId",debug:()=>e.options.debugAll??e.options.debugRows})};for(let t=0;t<e._features.length;t++){const n=e._features[t];Object.assign(a,null==n||null==n.createRow?void 0:n.createRow(a,e))}return a};function Q(e,t,n){return n.options.filterFromLeafRows?function(e,t,n){const o=[],l={},i=function(e,o){const r=[];for(let o=0;o<e.length;o++){var s;let a=e[o];if(null!=(s=a.subRows)&&s.length){const e=J(n,a.id,a.original,a.index,a.depth);if(e.columnFilters=a.columnFilters,e.subRows=i(a.subRows),!e.subRows.length)continue;a=e}t(a)&&(r.push(a),l[a.id]=a,l[o]=a)}return r};return{rows:i(e),flatRows:o,rowsById:l}}(e,t,n):function(e,t,n){const o=[],l={},i=function(e,r){const s=[];for(let r=0;r<e.length;r++){let u=e[r];if(t(u)){var a;if(null!=(a=u.subRows)&&a.length){const e=J(n,u.id,u.original,u.index,u.depth);e.subRows=i(u.subRows),u=e}s.push(u),o.push(u),l[u.id]=u}}return s};return{rows:i(e),flatRows:o,rowsById:l}}(e,t,n)}function W(e){const t=[],n=e=>{var o;t.push(e),null!=(o=e.subRows)&&o.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}e.ColumnSizing=d,e.Expanding=m,e.Filters=I,e.Grouping=A,e.Headers=a,e.Ordering=E,e.Pagination=G,e.Pinning=z,e.RowSelection=H,e.Sorting=U,e.Visibility=$,e.aggregationFns=_,e.buildHeaderGroups=u,e.createCell=K,e.createColumn=r,e.createColumnHelper=function(){return{accessor:(e,t)=>"function"==typeof e?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}},e.createRow=J,e.createTable=function(e){(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let n={_features:X};const o=n._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultOptions?void 0:t.getDefaultOptions(n))),{});let l={...e.initialState??{}};n._features.forEach((e=>{l=(null==e.getInitialState?void 0:e.getInitialState(l))??l}));const s=[];let a=!1;const u={_features:X,options:{...o,...e},initialState:l,_queue:e=>{s.push(e),a||(a=!0,Promise.resolve().then((()=>{for(;s.length;)s.shift()();a=!1})).catch((e=>setTimeout((()=>{throw e})))))},reset:()=>{n.setState(n.initialState)},setOptions:e=>{const l=t(e,n.options);n.options=(e=>n.options.mergeOptions?n.options.mergeOptions(o,e):{...o,...e})(l)},getState:()=>n.options.state,setState:e=>{null==n.options.onStateChange||n.options.onStateChange(e)},_getRowId:(e,t,o)=>(null==n.options.getRowId?void 0:n.options.getRowId(e,t,o))??`${o?[o.id,t].join("."):t}`,getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:e=>{const t=n.getRowModel().rowsById[e];if(!t)throw new Error;return t},_getDefaultColumnDef:i((()=>[n.options.defaultColumn]),(e=>(e=e??{},{header:e=>{const t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t;return(null==(t=e.renderValue())||null==t.toString?void 0:t.toString())??null},...n._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultColumnDef?void 0:t.getDefaultColumnDef())),{}),...e})),{debug:()=>n.options.debugAll??n.options.debugColumns,key:!1}),_getColumnDefs:()=>n.options.columns,getAllColumns:i((()=>[n._getColumnDefs()]),(e=>{const t=function(e,o,l){return void 0===l&&(l=0),e.map((e=>{const i=r(n,e,l,o),s=e;return i.columns=s.columns?t(s.columns,i,l+1):[],i}))};return t(e)}),{key:!1,debug:()=>n.options.debugAll??n.options.debugColumns}),getAllFlatColumns:i((()=>[n.getAllColumns()]),(e=>e.flatMap((e=>e.getFlatColumns()))),{key:!1,debug:()=>n.options.debugAll??n.options.debugColumns}),_getAllFlatColumnsById:i((()=>[n.getAllFlatColumns()]),(e=>e.reduce(((e,t)=>(e[t.id]=t,e)),{})),{key:!1,debug:()=>n.options.debugAll??n.options.debugColumns}),getAllLeafColumns:i((()=>[n.getAllColumns(),n._getOrderColumnsFn()]),((e,t)=>t(e.flatMap((e=>e.getLeafColumns())))),{key:!1,debug:()=>n.options.debugAll??n.options.debugColumns}),getColumn:e=>{const t=n._getAllFlatColumnsById()[e];if(!t)throw new Error;return t}};return Object.assign(n,u),n._features.forEach((e=>Object.assign(n,null==e.createTable?void 0:e.createTable(n)))),n},e.defaultColumnSizing=g,e.expandRows=W,e.filterFns=V,e.flattenBy=l,e.functionalUpdate=t,e.getCoreRowModel=function(){return e=>i((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(t,l,i){void 0===l&&(l=0);const r=[];for(let a=0;a<t.length;a++){const u=J(e,e._getRowId(t[a],a,i),t[a],a,l);var s;if(n.flatRows.push(u),n.rowsById[u.id]=u,r.push(u),e.options.getSubRows)u.originalSubRows=e.options.getSubRows(t[a],a),null!=(s=u.originalSubRows)&&s.length&&(u.subRows=o(u.originalSubRows,l+1,u))}return r};return n.rows=o(t),n}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable,onChange:()=>{e._autoResetPageIndex()}})},e.getExpandedRowModel=function(){return e=>i((()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows]),((e,t,n)=>!t.rows.length||!0!==e&&!Object.keys(e??{}).length?t:n?W(t):t),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable})},e.getFacetedMinMaxValues=function(){return(e,t)=>i((()=>[e.getColumn(t).getFacetedRowModel()]),(e=>{var n;const o=null==(n=e.flatRows[0])?void 0:n.getValue(t);if(void 0===o)return;let l=[o,o];for(let n=0;n<e.flatRows.length;n++){const o=e.flatRows[n].getValue(t);o<l[0]?l[0]=o:o>l[1]&&(l[1]=o)}return l}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable,onChange:()=>{}})},e.getFacetedRowModel=function(){return(e,t)=>i((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()]),((n,o,l)=>{if(!n.rows.length||(null==o||!o.length)&&!l)return n;const i=[...o.map((e=>e.id)).filter((e=>e!==t)),l?"__global__":void 0].filter(Boolean);return Q(n.rows,(e=>{for(let t=0;t<i.length;t++)if(!1===e.columnFilters[i[t]])return!1;return!0}),e)}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable,onChange:()=>{}})},e.getFacetedUniqueValues=function(){return(e,t)=>i((()=>[e.getColumn(t).getFacetedRowModel()]),(e=>{let n=new Map;for(let l=0;l<e.flatRows.length;l++){var o;const i=null==(o=e.flatRows[l])?void 0:o.getValue(t);n.has(i)?n.set(i,(n.get(i)??0)+1):n.set(i,1)}return n}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable,onChange:()=>{}})},e.getFilteredRowModel=function(){return e=>i((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter]),((t,n,o)=>{if(!t.rows.length||(null==n||!n.length)&&!o){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}const l=[],i=[];(n??[]).forEach((t=>{const n=e.getColumn(t.id).getFilterFn();n&&l.push({id:t.id,filterFn:n,resolvedValue:(null==n.resolveFilterValue?void 0:n.resolveFilterValue(t.value))??t.value})}));const r=n.map((e=>e.id)),s=e.getGlobalFilterFn(),a=e.getAllLeafColumns().filter((e=>e.getCanGlobalFilter()));let u,g;o&&s&&a.length&&(r.push("__global__"),a.forEach((e=>{i.push({id:e.id,filterFn:s,resolvedValue:(null==s.resolveFilterValue?void 0:s.resolveFilterValue(o))??o})})));for(let e=0;e<t.flatRows.length;e++){const n=t.flatRows[e];if(n.columnFilters={},l.length)for(let e=0;e<l.length;e++){u=l[e];const t=u.id;n.columnFilters[t]=u.filterFn(n,t,u.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))}if(i.length){for(let e=0;e<i.length;e++){g=i[e];const t=g.id;if(g.filterFn(n,t,g.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))){n.columnFilters.__global__=!0;break}}!0!==n.columnFilters.__global__&&(n.columnFilters.__global__=!1)}}return Q(t.rows,(e=>{for(let t=0;t<r.length;t++)if(!1===e.columnFilters[r[t]])return!1;return!0}),e)}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable,onChange:()=>{e._autoResetPageIndex()}})},e.getGroupedRowModel=function(){return e=>i((()=>[e.getState().grouping,e.getPreGroupedRowModel()]),((t,n)=>{if(!n.rows.length||!t.length)return n;const o=t.filter((t=>e.getColumn(t))),i=[],r={},s=function(t,n,a){if(void 0===n&&(n=0),n>=o.length)return t.map((e=>(e.depth=n,i.push(e),r[e.id]=e,e.subRows&&(e.subRows=s(e.subRows,n+1)),e)));const u=o[n],g=function(e,t){const n=new Map;return e.reduce(((e,n)=>{const o=`${n.getValue(t)}`,l=e.get(o);return l?e.set(o,[...l,n]):e.set(o,[n]),e}),n)}(t,u),d=Array.from(g.entries()).map(((t,g)=>{let[d,c]=t,p=`${u}:${d}`;p=a?`${a}>${p}`:p;const f=s(c,n+1,p),m=n?l(c,(e=>e.subRows)):c,b=J(e,p,m[0].original,g,n);return Object.assign(b,{groupingColumnId:u,groupingValue:d,subRows:f,leafRows:m,getValue:t=>{if(o.includes(t))return b._valuesCache.hasOwnProperty(t)||c[0]&&(b._valuesCache[t]=c[0].getValue(t)??void 0),b._valuesCache[t];if(b._groupingValuesCache.hasOwnProperty(t))return b._groupingValuesCache[t];const n=e.getColumn(t).getAggregationFn();return n?(b._groupingValuesCache[t]=n(t,m,c),b._groupingValuesCache[t]):void 0}}),f.forEach((e=>{i.push(e),r[e.id]=e})),b}));return d},a=s(n.rows,0,"");return a.forEach((e=>{i.push(e),r[e.id]=e})),{rows:a,flatRows:i,rowsById:r}}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable,onChange:()=>{e._queue((()=>{e._autoResetExpanded(),e._autoResetPageIndex()}))}})},e.getPaginationRowModel=function(e){return e=>i((()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded]),((t,n)=>{if(!n.rows.length)return n;const{pageSize:o,pageIndex:l}=t;let{rows:i,flatRows:r,rowsById:s}=n;const a=o*l,u=a+o;let g;i=i.slice(a,u),g=e.options.paginateExpandedRows?{rows:i,flatRows:r,rowsById:s}:W({rows:i,flatRows:r,rowsById:s}),g.flatRows=[];const d=e=>{g.flatRows.push(e),e.subRows.length&&e.subRows.forEach(d)};return g.rows.forEach(d),g}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable})},e.getSortedRowModel=function(){return e=>i((()=>[e.getState().sorting,e.getPreSortedRowModel()]),((t,n)=>{if(!n.rows.length||null==t||!t.length)return n;const o=e.getState().sorting,l=[],i=o.filter((t=>e.getColumn(t.id).getCanSort())),r={};i.forEach((t=>{const n=e.getColumn(t.id);r[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()}}));const s=e=>{const t=e.slice();return t.sort(((e,t)=>{for(let n=0;n<i.length;n+=1){const o=i[n],l=r[o.id],s=(null==o?void 0:o.desc)??!1;if(l.sortUndefined){const n=void 0===e.getValue(o.id),i=void 0===t.getValue(o.id);if(n||i)return n&&i?0:n?l.sortUndefined:-l.sortUndefined}let a=l.sortingFn(e,t,o.id);if(0!==a)return s&&(a*=-1),l.invertSorting&&(a*=-1),a}return e.index-t.index})),t.forEach((e=>{l.push(e),!e.subRows||e.subRows.length<=1||(e.subRows=s(e.subRows))})),t};return{rows:s(n.rows),flatRows:l,rowsById:n.rowsById}}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable,onChange:()=>{e._autoResetPageIndex()}})},e.isFunction=o,e.isRowSelected=D,e.isSubRowSelected=O,e.makeStateUpdater=n,e.memo=i,e.noop=function(){},e.orderColumns=P,e.passiveEventSupported=p,e.reSplitAlphaNumeric=T,e.selectRowsFn=k,e.shouldAutoRemoveFilter=x,e.sortingFns=N,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).TableCore={})}(this,(function(e){"use strict";function t(e,t){return"function"==typeof e?e(t):e}function n(e,n){return o=>{n.setState((n=>({...n,[e]:t(o,n[e])})))}}function o(e){return e instanceof Function}function l(e,t){const n=[],o=e=>{e.forEach((e=>{n.push(e);const l=t(e);null!=l&&l.length&&o(l)}))};return o(e),n}function i(e,t,n){let o,l=[];return()=>{let i;n.key&&n.debug&&(i=Date.now());const r=e();if(!(r.length!==l.length||r.some(((e,t)=>l[t]!==e))))return o;let a;if(l=r,n.key&&n.debug&&(a=Date.now()),o=t(...r),null==n||null==n.onChange||n.onChange(o),n.key&&n.debug&&null!=n&&n.debug()){const e=Math.round(100*(Date.now()-i))/100,t=Math.round(100*(Date.now()-a))/100,o=t/16,l=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${l(t,5)} /${l(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*o,120))}deg 100% 31%);`,null==n?void 0:n.key)}return o}}function r(e,t,n,o){const l={...e._getDefaultColumnDef(),...t},r=l.accessorKey;let a,s=l.id??(r?r.replace(".","_"):void 0)??("string"==typeof l.header?l.header:void 0);if(l.accessorFn?a=l.accessorFn:r&&(a=r.includes(".")?e=>{let t=e;for(const e of r.split("."))t=t[e];return t}:e=>e[l.accessorKey]),!s)throw new Error;let u={id:`${String(s)}`,accessorFn:a,parent:o,depth:n,columnDef:l,columns:[],getFlatColumns:i((()=>[!0]),(()=>{var e;return[u,...null==(e=u.columns)?void 0:e.flatMap((e=>e.getFlatColumns()))]}),{key:"column.getFlatColumns",debug:()=>e.options.debugAll??e.options.debugColumns}),getLeafColumns:i((()=>[e._getOrderColumnsFn()]),(e=>{var t;if(null!=(t=u.columns)&&t.length){let t=u.columns.flatMap((e=>e.getLeafColumns()));return e(t)}return[u]}),{key:"column.getLeafColumns",debug:()=>e.options.debugAll??e.options.debugColumns})};return u=e._features.reduce(((t,n)=>Object.assign(t,null==n.createColumn?void 0:n.createColumn(u,e))),u),u}function a(e,t,n){let o={id:n.id??t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const e=[],t=n=>{n.subHeaders&&n.subHeaders.length&&n.subHeaders.map(t),e.push(n)};return t(o),e},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach((t=>{Object.assign(o,null==t.createHeader?void 0:t.createHeader(o,e))})),o}const s={createTable:e=>({getHeaderGroups:i((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,n,o,l)=>{const i=(null==o?void 0:o.map((e=>n.find((t=>t.id===e)))).filter(Boolean))??[],r=(null==l?void 0:l.map((e=>n.find((t=>t.id===e)))).filter(Boolean))??[];return u(t,[...i,...n.filter((e=>!(null!=o&&o.includes(e.id)||null!=l&&l.includes(e.id)))),...r],e)}),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getCenterHeaderGroups:i((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,n,o,l)=>u(t,n=n.filter((e=>!(null!=o&&o.includes(e.id)||null!=l&&l.includes(e.id)))),e,"center")),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getLeftHeaderGroups:i((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left]),((t,n,o)=>u(t,(null==o?void 0:o.map((e=>n.find((t=>t.id===e)))).filter(Boolean))??[],e,"left")),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getRightHeaderGroups:i((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right]),((t,n,o)=>u(t,(null==o?void 0:o.map((e=>n.find((t=>t.id===e)))).filter(Boolean))??[],e,"right")),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getFooterGroups:i((()=>[e.getHeaderGroups()]),(e=>[...e].reverse()),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getLeftFooterGroups:i((()=>[e.getLeftHeaderGroups()]),(e=>[...e].reverse()),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getCenterFooterGroups:i((()=>[e.getCenterHeaderGroups()]),(e=>[...e].reverse()),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getRightFooterGroups:i((()=>[e.getRightHeaderGroups()]),(e=>[...e].reverse()),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getFlatHeaders:i((()=>[e.getHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getLeftFlatHeaders:i((()=>[e.getLeftHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getCenterFlatHeaders:i((()=>[e.getCenterHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getRightFlatHeaders:i((()=>[e.getRightHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getCenterLeafHeaders:i((()=>[e.getCenterFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getLeftLeafHeaders:i((()=>[e.getLeftFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getRightLeafHeaders:i((()=>[e.getRightFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getLeafHeaders:i((()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()]),((e,t,n)=>{var o,l,i;return[...(null==(o=e[0])?void 0:o.headers)??[],...(null==(l=t[0])?void 0:l.headers)??[],...(null==(i=n[0])?void 0:i.headers)??[]].map((e=>e.getLeafHeaders())).flat()}),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders})})};function u(e,t,n,o){var l;let i=0;const r=function(e,t){void 0===t&&(t=1),i=Math.max(i,t),e.filter((e=>e.getIsVisible())).forEach((e=>{var n;null!=(n=e.columns)&&n.length&&r(e.columns,t+1)}),0)};r(e);let s=[];const u=(e,t)=>{const l={depth:t,id:[o,`${t}`].filter(Boolean).join("_"),headers:[]},i=[];e.forEach((e=>{const r=[...i].reverse()[0];let s,u=!1;if(e.column.depth===l.depth&&e.column.parent?s=e.column.parent:(s=e.column,u=!0),r&&(null==r?void 0:r.column)===s)r.subHeaders.push(e);else{const l=a(n,s,{id:[o,t,s.id,null==e?void 0:e.id].filter(Boolean).join("_"),isPlaceholder:u,placeholderId:u?`${i.filter((e=>e.column===s)).length}`:void 0,depth:t,index:i.length});l.subHeaders.push(e),i.push(l)}l.headers.push(e),e.headerGroup=l})),s.push(l),t>0&&u(i,t-1)},g=t.map(((e,t)=>a(n,e,{depth:i,index:t})));u(g,i-1),s.reverse();const d=e=>e.filter((e=>e.column.getIsVisible())).map((e=>{let t=0,n=0,o=[0];e.subHeaders&&e.subHeaders.length?(o=[],d(e.subHeaders).forEach((e=>{let{colSpan:n,rowSpan:l}=e;t+=n,o.push(l)}))):t=1;return n+=Math.min(...o),e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}}));return d((null==(l=s[0])?void 0:l.headers)??[]),s}const g={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},d={getDefaultColumnDef:()=>g,getInitialState:e=>({columnSizing:{},columnSizingInfo:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]},...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",onColumnSizingChange:n("columnSizing",e),onColumnSizingInfoChange:n("columnSizingInfo",e)}),createColumn:(e,t)=>({getSize:()=>{const n=t.getState().columnSizing[e.id];return Math.min(Math.max(e.columnDef.minSize??g.minSize,n??e.columnDef.size??g.size),e.columnDef.maxSize??g.maxSize)},getStart:n=>{const o=n?"left"===n?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns(),l=o.findIndex((t=>t.id===e.id));if(l>0){const e=o[l-1];return e.getStart(n)+e.getSize()}return 0},resetSize:()=>{t.setColumnSizing((t=>{let{[e.id]:n,...o}=t;return o}))},getCanResize:()=>(e.columnDef.enableResizing??!0)&&(t.options.enableColumnResizing??!0),getIsResizing:()=>t.getState().columnSizingInfo.isResizingColumn===e.id}),createHeader:(e,t)=>({getSize:()=>{let t=0;const n=e=>{e.subHeaders.length?e.subHeaders.forEach(n):t+=e.column.getSize()??0};return n(e),t},getStart:()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},getResizeHandler:()=>{const n=t.getColumn(e.column.id),o=n.getCanResize();return l=>{if(!o)return;if(null==l.persist||l.persist(),f(l)&&l.touches&&l.touches.length>1)return;const i=e.getSize(),r=e?e.getLeafHeaders().map((e=>[e.column.id,e.column.getSize()])):[[n.id,n.getSize()]],a=f(l)?Math.round(l.touches[0].clientX):l.clientX,s=(e,n)=>{if("number"!=typeof n)return;let o={};t.setColumnSizingInfo((e=>{const t=n-((null==e?void 0:e.startOffset)??0),l=Math.max(t/((null==e?void 0:e.startSize)??0),-.999999);return e.columnSizingStart.forEach((e=>{let[t,n]=e;o[t]=Math.round(100*Math.max(n+n*l,0))/100})),{...e,deltaOffset:t,deltaPercentage:l}})),"onChange"!==t.options.columnResizeMode&&"end"!==e||t.setColumnSizing((e=>({...e,...o})))},u=e=>s("move",e),g=e=>{s("end",e),t.setColumnSizingInfo((e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]})))},d={moveHandler:e=>u(e.clientX),upHandler:e=>{document.removeEventListener("mousemove",d.moveHandler),document.removeEventListener("mouseup",d.upHandler),g(e.clientX)}},c={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),u(e.touches[0].clientX),!1),upHandler:e=>{var t;document.removeEventListener("touchmove",c.moveHandler),document.removeEventListener("touchend",c.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),g(null==(t=e.touches[0])?void 0:t.clientX)}},m=!!p()&&{passive:!1};f(l)?(document.addEventListener("touchmove",c.moveHandler,m),document.addEventListener("touchend",c.upHandler,m)):(document.addEventListener("mousemove",d.moveHandler,m),document.addEventListener("mouseup",d.upHandler,m)),t.setColumnSizingInfo((e=>({...e,startOffset:a,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:r,isResizingColumn:n.id})))}}}),createTable:e=>({setColumnSizing:t=>null==e.options.onColumnSizingChange?void 0:e.options.onColumnSizingChange(t),setColumnSizingInfo:t=>null==e.options.onColumnSizingInfoChange?void 0:e.options.onColumnSizingInfoChange(t),resetColumnSizing:t=>{e.setColumnSizing(t?{}:e.initialState.columnSizing??{})},resetHeaderSizeInfo:t=>{e.setColumnSizingInfo(t?{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}:e.initialState.columnSizingInfo??{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]})},getTotalSize:()=>{var t;return(null==(t=e.getHeaderGroups()[0])?void 0:t.headers.reduce(((e,t)=>e+t.getSize()),0))??0},getLeftTotalSize:()=>{var t;return(null==(t=e.getLeftHeaderGroups()[0])?void 0:t.headers.reduce(((e,t)=>e+t.getSize()),0))??0},getCenterTotalSize:()=>{var t;return(null==(t=e.getCenterHeaderGroups()[0])?void 0:t.headers.reduce(((e,t)=>e+t.getSize()),0))??0},getRightTotalSize:()=>{var t;return(null==(t=e.getRightHeaderGroups()[0])?void 0:t.headers.reduce(((e,t)=>e+t.getSize()),0))??0}})};let c=null;function p(){if("boolean"==typeof c)return c;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch(t){e=!1}return c=e,c}function f(e){return"touchstart"===e.type}const m={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:n("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;return{_autoResetExpanded:()=>{if(t){if(e.options.autoResetAll??e.options.autoResetExpanded??!e.options.manualExpanding){if(n)return;n=!0,e._queue((()=>{e.resetExpanded(),n=!1}))}}else e._queue((()=>{t=!0}))},setExpanded:t=>null==e.options.onExpandedChange?void 0:e.options.onExpandedChange(t),toggleAllRowsExpanded:t=>{t??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},resetExpanded:t=>{var n;e.setExpanded(t?{}:(null==(n=e.initialState)?void 0:n.expanded)??{})},getCanSomeRowsExpand:()=>e.getRowModel().flatRows.some((e=>e.getCanExpand())),getToggleAllRowsExpandedHandler:()=>t=>{null==t.persist||t.persist(),e.toggleAllRowsExpanded()},getIsSomeRowsExpanded:()=>{const t=e.getState().expanded;return!0===t||Object.values(t).some(Boolean)},getIsAllRowsExpanded:()=>{const t=e.getState().expanded;return"boolean"==typeof t?!0===t:!!Object.keys(t).length&&!e.getRowModel().flatRows.some((e=>!e.getIsExpanded()))},getExpandedDepth:()=>{let t=0;return(!0===e.getState().expanded?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach((e=>{const n=e.split(".");t=Math.max(t,n.length)})),t},getPreExpandedRowModel:()=>e.getSortedRowModel(),getExpandedRowModel:()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())}},createRow:(e,t)=>({toggleExpanded:n=>{t.setExpanded((o=>{const l=!0===o||!(null==o||!o[e.id]);let i={};if(!0===o?Object.keys(t.getRowModel().rowsById).forEach((e=>{i[e]=!0})):i=o,n=n??!l,!l&&n)return{...i,[e.id]:!0};if(l&&!n){const{[e.id]:t,...n}=i;return n}return o}))},getIsExpanded:()=>{const n=t.getState().expanded;return!!((null==t.options.getIsRowExpanded?void 0:t.options.getIsRowExpanded(e))??(!0===n||null!=n&&n[e.id]))},getCanExpand:()=>{var n;return(null==t.options.getRowCanExpand?void 0:t.options.getRowCanExpand(e))??((t.options.enableExpanding??!0)&&!(null==(n=e.subRows)||!n.length))},getToggleExpandedHandler:()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}})},b=(e,t,n)=>{var o;const l=n.toLowerCase();return null==(o=e.getValue(t))?void 0:o.toLowerCase().includes(l)};b.autoRemove=e=>y(e);const w=(e,t,n)=>{var o;return null==(o=e.getValue(t))?void 0:o.includes(n)};w.autoRemove=e=>y(e);const S=(e,t,n)=>{var o;return(null==(o=e.getValue(t))?void 0:o.toLowerCase())===n.toLowerCase()};S.autoRemove=e=>y(e);const h=(e,t,n)=>{var o;return null==(o=e.getValue(t))?void 0:o.includes(n)};h.autoRemove=e=>y(e)||!(null!=e&&e.length);const C=(e,t,n)=>!n.some((n=>{var o;return!(null!=(o=e.getValue(t))&&o.includes(n))}));C.autoRemove=e=>y(e)||!(null!=e&&e.length);const R=(e,t,n)=>n.some((n=>{var o;return null==(o=e.getValue(t))?void 0:o.includes(n)}));R.autoRemove=e=>y(e)||!(null!=e&&e.length);const v=(e,t,n)=>e.getValue(t)===n;v.autoRemove=e=>y(e);const F=(e,t,n)=>e.getValue(t)==n;F.autoRemove=e=>y(e);const M=(e,t,n)=>{let[o,l]=n;const i=e.getValue(t);return i>=o&&i<=l};M.resolveFilterValue=e=>{let[t,n]=e,o="number"!=typeof t?parseFloat(t):t,l="number"!=typeof n?parseFloat(n):n,i=null===t||Number.isNaN(o)?-1/0:o,r=null===n||Number.isNaN(l)?1/0:l;if(i>r){const e=i;i=r,r=e}return[i,r]},M.autoRemove=e=>y(e)||y(e[0])&&y(e[1]);const V={includesString:b,includesStringSensitive:w,equalsString:S,arrIncludes:h,arrIncludesAll:C,arrIncludesSome:R,equals:v,weakEquals:F,inNumberRange:M};function y(e){return null==e||""===e}const I={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:n("columnFilters",e),onGlobalFilterChange:n("globalFilter",e),filterFromLeafRows:!1,globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n,o;const l=null==(n=e.getCoreRowModel().flatRows[0])||null==(o=n._getAllCellsByColumnId()[t.id])?void 0:o.getValue();return"string"==typeof l||"number"==typeof l}}),createColumn:(e,n)=>({getAutoFilterFn:()=>{const t=n.getCoreRowModel().flatRows[0],o=null==t?void 0:t.getValue(e.id);return"string"==typeof o?V.includesString:"number"==typeof o?V.inNumberRange:"boolean"==typeof o||null!==o&&"object"==typeof o?V.equals:Array.isArray(o)?V.arrIncludes:V.weakEquals},getFilterFn:()=>{var t;return o(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?e.getAutoFilterFn():(null==(t=n.options.filterFns)?void 0:t[e.columnDef.filterFn])??V[e.columnDef.filterFn]},getCanFilter:()=>(e.columnDef.enableColumnFilter??!0)&&(n.options.enableColumnFilters??!0)&&(n.options.enableFilters??!0)&&!!e.accessorFn,getCanGlobalFilter:()=>(e.columnDef.enableGlobalFilter??!0)&&(n.options.enableGlobalFilter??!0)&&(n.options.enableFilters??!0)&&((null==n.options.getColumnCanGlobalFilter?void 0:n.options.getColumnCanGlobalFilter(e))??!0)&&!!e.accessorFn,getIsFiltered:()=>e.getFilterIndex()>-1,getFilterValue:()=>{var t,o;return null==(t=n.getState().columnFilters)||null==(o=t.find((t=>t.id===e.id)))?void 0:o.value},getFilterIndex:()=>{var t;return(null==(t=n.getState().columnFilters)?void 0:t.findIndex((t=>t.id===e.id)))??-1},setFilterValue:o=>{n.setColumnFilters((n=>{const l=e.getFilterFn(),i=null==n?void 0:n.find((t=>t.id===e.id)),r=t(o,i?i.value:void 0);if(x(l,r,e))return(null==n?void 0:n.filter((t=>t.id!==e.id)))??[];const a={id:e.id,value:r};return i?(null==n?void 0:n.map((t=>t.id===e.id?a:t)))??[]:null!=n&&n.length?[...n,a]:[a]}))},_getFacetedRowModel:n.options.getFacetedRowModel&&n.options.getFacetedRowModel(n,e.id),getFacetedRowModel:()=>e._getFacetedRowModel?e._getFacetedRowModel():n.getPreFilteredRowModel(),_getFacetedUniqueValues:n.options.getFacetedUniqueValues&&n.options.getFacetedUniqueValues(n,e.id),getFacetedUniqueValues:()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,_getFacetedMinMaxValues:n.options.getFacetedMinMaxValues&&n.options.getFacetedMinMaxValues(n,e.id),getFacetedMinMaxValues:()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}),createRow:(e,t)=>({columnFilters:{},columnFiltersMeta:{}}),createTable:e=>({getGlobalAutoFilterFn:()=>V.includesString,getGlobalFilterFn:()=>{var t;const{globalFilterFn:n}=e.options;return o(n)?n:"auto"===n?e.getGlobalAutoFilterFn():(null==(t=e.options.filterFns)?void 0:t[n])??V[n]},setColumnFilters:n=>{const o=e.getAllLeafColumns();null==e.options.onColumnFiltersChange||e.options.onColumnFiltersChange((e=>{var l;return null==(l=t(n,e))?void 0:l.filter((e=>{const t=o.find((t=>t.id===e.id));if(t){if(x(t.getFilterFn(),e.value,t))return!1}return!0}))}))},setGlobalFilter:t=>{null==e.options.onGlobalFilterChange||e.options.onGlobalFilterChange(t)},resetGlobalFilter:t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)},resetColumnFilters:t=>{var n;e.setColumnFilters(t?[]:(null==(n=e.initialState)?void 0:n.columnFilters)??[])},getPreFilteredRowModel:()=>e.getCoreRowModel(),getFilteredRowModel:()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel()),_getGlobalFacetedRowModel:e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),getGlobalFacetedRowModel:()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),_getGlobalFacetedUniqueValues:e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),getGlobalFacetedUniqueValues:()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,_getGlobalFacetedMinMaxValues:e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),getGlobalFacetedMinMaxValues:()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}})};function x(e,t,n){return!(!e||!e.autoRemove)&&e.autoRemove(t,n)||void 0===t||"string"==typeof t&&!t}const _={sum:(e,t,n)=>n.reduce(((t,n)=>{const o=n.getValue(e);return t+("number"==typeof o?o:0)}),0),min:(e,t,n)=>{let o;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(o>n||void 0===o&&n>=n)&&(o=n)})),o},max:(e,t,n)=>{let o;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(o<n||void 0===o&&n>=n)&&(o=n)})),o},extent:(e,t,n)=>{let o,l;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(void 0===o?n>=n&&(o=l=n):(o>n&&(o=n),l<n&&(l=n)))})),[o,l]},mean:(e,t)=>{let n=0,o=0;if(t.forEach((t=>{let l=t.getValue(e);null!=l&&(l=+l)>=l&&(++n,o+=l)})),n)return o/n},median:(e,t)=>{if(!t.length)return;let n=0,o=0;return t.forEach((t=>{let l=t.getValue(e);"number"==typeof l&&(n=Math.min(n,l),o=Math.max(o,l))})),(n+o)/2},unique:(e,t)=>Array.from(new Set(t.map((t=>t.getValue(e)))).values()),uniqueCount:(e,t)=>new Set(t.map((t=>t.getValue(e)))).size,count:(e,t)=>t.length},A={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t;return(null==(t=e.getValue())||null==t.toString?void 0:t.toString())??null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:n("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>({toggleGrouping:()=>{t.setGrouping((t=>null!=t&&t.includes(e.id)?t.filter((t=>t!==e.id)):[...t??[],e.id]))},getCanGroup:()=>e.columnDef.enableGrouping??!0??t.options.enableGrouping??!0??!!e.accessorFn,getIsGrouped:()=>{var n;return null==(n=t.getState().grouping)?void 0:n.includes(e.id)},getGroupedIndex:()=>{var n;return null==(n=t.getState().grouping)?void 0:n.indexOf(e.id)},getToggleGroupingHandler:()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},getAutoAggregationFn:()=>{const n=t.getCoreRowModel().flatRows[0],o=null==n?void 0:n.getValue(e.id);return"number"==typeof o?_.sum:"[object Date]"===Object.prototype.toString.call(o)?_.extent:void 0},getAggregationFn:()=>{var n;if(!e)throw new Error;return o(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:"auto"===e.columnDef.aggregationFn?e.getAutoAggregationFn():(null==(n=t.options.aggregationFns)?void 0:n[e.columnDef.aggregationFn])??_[e.columnDef.aggregationFn]}}),createTable:e=>({setGrouping:t=>null==e.options.onGroupingChange?void 0:e.options.onGroupingChange(t),resetGrouping:t=>{var n;e.setGrouping(t?[]:(null==(n=e.initialState)?void 0:n.grouping)??[])},getPreGroupedRowModel:()=>e.getFilteredRowModel(),getGroupedRowModel:()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())}),createRow:e=>({getIsGrouped:()=>!!e.groupingColumnId,_groupingValuesCache:{}}),createCell:(e,t,n,o)=>({getIsGrouped:()=>t.getIsGrouped()&&t.id===n.groupingColumnId,getIsPlaceholder:()=>!e.getIsGrouped()&&t.getIsGrouped(),getIsAggregated:()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!(null==(t=n.subRows)||!t.length)}})};function P(e,t,n){if(null==t||!t.length||!n)return e;const o=e.filter((e=>!t.includes(e.id)));if("remove"===n)return o;return[...t.map((t=>e.find((e=>e.id===t)))).filter(Boolean),...o]}const E={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:n("columnOrder",e)}),createTable:e=>({setColumnOrder:t=>null==e.options.onColumnOrderChange?void 0:e.options.onColumnOrderChange(t),resetColumnOrder:t=>{e.setColumnOrder(t?[]:e.initialState.columnOrder??[])},_getOrderColumnsFn:i((()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode]),((e,t,n)=>o=>{let l=[];if(null!=e&&e.length){const t=[...e],n=[...o];for(;n.length&&t.length;){const e=t.shift(),o=n.findIndex((t=>t.id===e));o>-1&&l.push(n.splice(o,1)[0])}l=[...l,...n]}else l=o;return P(l,t,n)}),{key:!1})})},G={getInitialState:e=>({...e,pagination:{pageIndex:0,pageSize:10,...null==e?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:n("pagination",e)}),createTable:e=>{let n=!1,o=!1;return{_autoResetPageIndex:()=>{if(n){if(e.options.autoResetAll??e.options.autoResetPageIndex??!e.options.manualPagination){if(o)return;o=!0,e._queue((()=>{e.resetPageIndex(),o=!1}))}}else e._queue((()=>{n=!0}))},setPagination:n=>null==e.options.onPaginationChange?void 0:e.options.onPaginationChange((e=>t(n,e))),resetPagination:t=>{e.setPagination(t?{pageIndex:0,pageSize:10}:e.initialState.pagination??{pageIndex:0,pageSize:10})},setPageIndex:n=>{e.setPagination((o=>{let l=t(n,o.pageIndex);const i=void 0===e.options.pageCount||-1===e.options.pageCount?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return l=Math.min(Math.max(0,l),i),{...o,pageIndex:l}}))},resetPageIndex:t=>{var n,o;e.setPageIndex(t?0:(null==(n=e.initialState)||null==(o=n.pagination)?void 0:o.pageIndex)??0)},resetPageSize:t=>{var n,o;e.setPageSize(t?10:(null==(n=e.initialState)||null==(o=n.pagination)?void 0:o.pageSize)??10)},setPageSize:n=>{e.setPagination((e=>{const o=Math.max(1,t(n,e.pageSize)),l=e.pageSize*e.pageIndex,i=Math.floor(l/o);return{...e,pageIndex:i,pageSize:o}}))},setPageCount:n=>e.setPagination((o=>{let l=t(n,e.options.pageCount??-1);return"number"==typeof l&&(l=Math.max(-1,l)),{...o,pageCount:l}})),getPageOptions:i((()=>[e.getPageCount()]),(e=>{let t=[];return e&&e>0&&(t=[...new Array(e)].fill(null).map(((e,t)=>t))),t}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable}),getCanPreviousPage:()=>e.getState().pagination.pageIndex>0,getCanNextPage:()=>{const{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return-1===n||0!==n&&t<n-1},previousPage:()=>e.setPageIndex((e=>e-1)),nextPage:()=>e.setPageIndex((e=>e+1)),getPrePaginationRowModel:()=>e.getExpandedRowModel(),getPaginationRowModel:()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),getPageCount:()=>e.options.pageCount??Math.ceil(e.getPrePaginationRowModel().rows.length/e.getState().pagination.pageSize)}}},H={getInitialState:e=>({columnPinning:{left:[],right:[]},...e}),getDefaultOptions:e=>({onColumnPinningChange:n("columnPinning",e)}),createColumn:(e,t)=>({pin:n=>{const o=e.getLeafColumns().map((e=>e.id)).filter(Boolean);t.setColumnPinning((e=>"right"===n?{left:((null==e?void 0:e.left)??[]).filter((e=>!(null!=o&&o.includes(e)))),right:[...((null==e?void 0:e.right)??[]).filter((e=>!(null!=o&&o.includes(e)))),...o]}:"left"===n?{left:[...((null==e?void 0:e.left)??[]).filter((e=>!(null!=o&&o.includes(e)))),...o],right:((null==e?void 0:e.right)??[]).filter((e=>!(null!=o&&o.includes(e))))}:{left:((null==e?void 0:e.left)??[]).filter((e=>!(null!=o&&o.includes(e)))),right:((null==e?void 0:e.right)??[]).filter((e=>!(null!=o&&o.includes(e))))}))},getCanPin:()=>e.getLeafColumns().some((e=>(e.columnDef.enablePinning??!0)&&(t.options.enablePinning??!0))),getIsPinned:()=>{const n=e.getLeafColumns().map((e=>e.id)),{left:o,right:l}=t.getState().columnPinning,i=n.some((e=>null==o?void 0:o.includes(e))),r=n.some((e=>null==l?void 0:l.includes(e)));return i?"left":!!r&&"right"},getPinnedIndex:()=>{var n,o;const l=e.getIsPinned();return l?(null==(n=t.getState().columnPinning)||null==(o=n[l])?void 0:o.indexOf(e.id))??-1:0}}),createRow:(e,t)=>({getCenterVisibleCells:i((()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right]),((e,t,n)=>{const o=[...t??[],...n??[]];return e.filter((e=>!o.includes(e.column.id)))}),{key:"row.getCenterVisibleCells",debug:()=>t.options.debugAll??t.options.debugRows}),getLeftVisibleCells:i((()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,,]),((e,t)=>(t??[]).map((t=>e.find((e=>e.column.id===t)))).filter(Boolean).map((e=>({...e,position:"left"})))),{key:"row.getLeftVisibleCells",debug:()=>t.options.debugAll??t.options.debugRows}),getRightVisibleCells:i((()=>[e._getAllVisibleCells(),t.getState().columnPinning.right]),((e,t)=>(t??[]).map((t=>e.find((e=>e.column.id===t)))).filter(Boolean).map((e=>({...e,position:"right"})))),{key:"row.getRightVisibleCells",debug:()=>t.options.debugAll??t.options.debugRows})}),createTable:e=>({setColumnPinning:t=>null==e.options.onColumnPinningChange?void 0:e.options.onColumnPinningChange(t),resetColumnPinning:t=>{var n;return e.setColumnPinning(t?{left:[],right:[]}:(null==(n=e.initialState)?void 0:n.columnPinning)??{left:[],right:[]})},getIsSomeColumnsPinned:t=>{var n;const o=e.getState().columnPinning;var l,i;return t?Boolean(null==(n=o[t])?void 0:n.length):Boolean((null==(l=o.left)?void 0:l.length)||(null==(i=o.right)?void 0:i.length))},getLeftLeafColumns:i((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left]),((e,t)=>(t??[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),{key:!1,debug:()=>e.options.debugAll??e.options.debugColumns}),getRightLeafColumns:i((()=>[e.getAllLeafColumns(),e.getState().columnPinning.right]),((e,t)=>(t??[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),{key:!1,debug:()=>e.options.debugAll??e.options.debugColumns}),getCenterLeafColumns:i((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((e,t,n)=>{const o=[...t??[],...n??[]];return e.filter((e=>!o.includes(e.id)))}),{key:!1,debug:()=>e.options.debugAll??e.options.debugColumns})})},z={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:n("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>({setRowSelection:t=>null==e.options.onRowSelectionChange?void 0:e.options.onRowSelectionChange(t),resetRowSelection:t=>e.setRowSelection(t?{}:e.initialState.rowSelection??{}),toggleAllRowsSelected:t=>{e.setRowSelection((n=>{t=void 0!==t?t:!e.getIsAllRowsSelected();const o={...n},l=e.getPreGroupedRowModel().flatRows;return t?l.forEach((e=>{e.getCanSelect()&&(o[e.id]=!0)})):l.forEach((e=>{delete o[e.id]})),o}))},toggleAllPageRowsSelected:t=>e.setRowSelection((n=>{const o=void 0!==t?t:!e.getIsAllPageRowsSelected(),l={...n};return e.getRowModel().rows.forEach((t=>{L(l,t.id,o,e)})),l})),getPreSelectedRowModel:()=>e.getCoreRowModel(),getSelectedRowModel:i((()=>[e.getState().rowSelection,e.getCoreRowModel()]),((t,n)=>Object.keys(t).length?D(e,n):{rows:[],flatRows:[],rowsById:{}}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable}),getFilteredSelectedRowModel:i((()=>[e.getState().rowSelection,e.getFilteredRowModel()]),((t,n)=>Object.keys(t).length?D(e,n):{rows:[],flatRows:[],rowsById:{}}),{key:"getFilteredSelectedRowModel",debug:()=>e.options.debugAll??e.options.debugTable}),getGroupedSelectedRowModel:i((()=>[e.getState().rowSelection,e.getSortedRowModel()]),((t,n)=>Object.keys(t).length?D(e,n):{rows:[],flatRows:[],rowsById:{}}),{key:"getGroupedSelectedRowModel",debug:()=>e.options.debugAll??e.options.debugTable}),getIsAllRowsSelected:()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let o=Boolean(t.length&&Object.keys(n).length);return o&&t.some((e=>e.getCanSelect()&&!n[e.id]))&&(o=!1),o},getIsAllPageRowsSelected:()=>{const t=e.getPaginationRowModel().flatRows,{rowSelection:n}=e.getState();let o=!!t.length;return o&&t.some((e=>!n[e.id]))&&(o=!1),o},getIsSomeRowsSelected:()=>{const t=Object.keys(e.getState().rowSelection??{}).length;return t>0&&t<e.getFilteredRowModel().flatRows.length},getIsSomePageRowsSelected:()=>{const t=e.getPaginationRowModel().flatRows;return!e.getIsAllPageRowsSelected()&&t.some((e=>e.getIsSelected()||e.getIsSomeSelected()))},getToggleAllRowsSelectedHandler:()=>t=>{e.toggleAllRowsSelected(t.target.checked)},getToggleAllPageRowsSelectedHandler:()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}}),createRow:(e,t)=>({toggleSelected:n=>{const o=e.getIsSelected();t.setRowSelection((l=>{if(o===(n=void 0!==n?n:!o))return l;const i={...l};return L(i,e.id,n,t),i}))},getIsSelected:()=>{const{rowSelection:n}=t.getState();return k(e,n)},getIsSomeSelected:()=>{const{rowSelection:n}=t.getState();return"some"===O(e,n)},getIsAllSubRowsSelected:()=>{const{rowSelection:n}=t.getState();return"all"===O(e,n)},getCanSelect:()=>"function"==typeof t.options.enableRowSelection?t.options.enableRowSelection(e):t.options.enableRowSelection??!0,getCanSelectSubRows:()=>"function"==typeof t.options.enableSubRowSelection?t.options.enableSubRowSelection(e):t.options.enableSubRowSelection??!0,getCanMultiSelect:()=>"function"==typeof t.options.enableMultiRowSelection?t.options.enableMultiRowSelection(e):t.options.enableMultiRowSelection??!0,getToggleSelectedHandler:()=>{const t=e.getCanSelect();return n=>{var o;t&&e.toggleSelected(null==(o=n.target)?void 0:o.checked)}}})},L=(e,t,n,o)=>{var l;const i=o.getRow(t);n?(i.getCanMultiSelect()||Object.keys(e).forEach((t=>delete e[t])),i.getCanSelect()&&(e[t]=!0)):delete e[t],null!=(l=i.subRows)&&l.length&&i.getCanSelectSubRows()&&i.subRows.forEach((t=>L(e,t.id,n,o)))};function D(e,t){const n=e.getState().rowSelection,o=[],l={},i=function(e,t){return e.map((e=>{var t;const r=k(e,n);if(r&&(o.push(e),l[e.id]=e),null!=(t=e.subRows)&&t.length&&(e={...e,subRows:i(e.subRows)}),r)return e})).filter(Boolean)};return{rows:i(t.rows),flatRows:o,rowsById:l}}function k(e,t){return t[e.id]??!1}function O(e,t,n){if(e.subRows&&e.subRows.length){let n=!0,o=!1;return e.subRows.forEach((e=>{o&&!n||(k(e,t)?o=!0:n=!1)})),n?"all":!!o&&"some"}return!1}const T=/([0-9]+)/gm;function B(e,t){return e===t?0:e>t?1:-1}function j(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function q(e,t){const n=e.split(T).filter(Boolean),o=t.split(T).filter(Boolean);for(;n.length&&o.length;){const e=n.shift(),t=o.shift(),l=parseInt(e,10),i=parseInt(t,10),r=[l,i].sort();if(isNaN(r[0])){if(e>t)return 1;if(t>e)return-1}else{if(isNaN(r[1]))return isNaN(l)?-1:1;if(l>i)return 1;if(i>l)return-1}}return n.length-o.length}const N={alphanumeric:(e,t,n)=>q(j(e.getValue(n)).toLowerCase(),j(t.getValue(n)).toLowerCase()),alphanumericCaseSensitive:(e,t,n)=>q(j(e.getValue(n)),j(t.getValue(n))),text:(e,t,n)=>B(j(e.getValue(n)).toLowerCase(),j(t.getValue(n)).toLowerCase()),textCaseSensitive:(e,t,n)=>B(j(e.getValue(n)),j(t.getValue(n))),datetime:(e,t,n)=>{const o=e.getValue(n),l=t.getValue(n);return o>l?1:o<l?-1:0},basic:(e,t,n)=>B(e.getValue(n),t.getValue(n))},U={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto"}),getDefaultOptions:e=>({onSortingChange:n("sorting",e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>({getAutoSortingFn:()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const t of n){const n=null==t?void 0:t.getValue(e.id);if("[object Date]"===Object.prototype.toString.call(n))return N.datetime;if("string"==typeof n&&(o=!0,n.split(T).length>1))return N.alphanumeric}return o?N.text:N.basic},getAutoSortDir:()=>{const n=t.getFilteredRowModel().flatRows[0];return"string"==typeof(null==n?void 0:n.getValue(e.id))?"asc":"desc"},getSortingFn:()=>{var n;if(!e)throw new Error;return o(e.columnDef.sortingFn)?e.columnDef.sortingFn:"auto"===e.columnDef.sortingFn?e.getAutoSortingFn():(null==(n=t.options.sortingFns)?void 0:n[e.columnDef.sortingFn])??N[e.columnDef.sortingFn]},toggleSorting:(n,o)=>{const l=e.getNextSortingOrder(),i=null!=n;t.setSorting((r=>{const a=null==r?void 0:r.find((t=>t.id===e.id)),s=null==r?void 0:r.findIndex((t=>t.id===e.id));let u,g=[],d=i?n:"desc"===l;return u=null!=r&&r.length&&e.getCanMultiSort()&&o?a?"toggle":"add":null!=r&&r.length&&s!==r.length-1?"replace":a?"toggle":"replace","toggle"===u&&(i||l||(u="remove")),"add"===u?(g=[...r,{id:e.id,desc:d}],g.splice(0,g.length-(t.options.maxMultiSortColCount??Number.MAX_SAFE_INTEGER))):g="toggle"===u?r.map((t=>t.id===e.id?{...t,desc:d}:t)):"remove"===u?r.filter((t=>t.id!==e.id)):[{id:e.id,desc:d}],g}))},getFirstSortDir:()=>e.columnDef.sortDescFirst??t.options.sortDescFirst??"desc"===e.getAutoSortDir()?"desc":"asc",getNextSortingOrder:n=>{const o=e.getFirstSortDir(),l=e.getIsSorted();return l?!(l!==o&&(t.options.enableSortingRemoval??1)&&(!n||(t.options.enableMultiRemove??1)))&&("desc"===l?"asc":"desc"):o},getCanSort:()=>(e.columnDef.enableSorting??!0)&&(t.options.enableSorting??!0)&&!!e.accessorFn,getCanMultiSort:()=>e.columnDef.enableMultiSort??t.options.enableMultiSort??!!e.accessorFn,getIsSorted:()=>{var n;const o=null==(n=t.getState().sorting)?void 0:n.find((t=>t.id===e.id));return!!o&&(o.desc?"desc":"asc")},getSortIndex:()=>{var n;return(null==(n=t.getState().sorting)?void 0:n.findIndex((t=>t.id===e.id)))??-1},clearSorting:()=>{t.setSorting((t=>null!=t&&t.length?t.filter((t=>t.id!==e.id)):[]))},getToggleSortingHandler:()=>{const n=e.getCanSort();return o=>{n&&(null==o.persist||o.persist(),null==e.toggleSorting||e.toggleSorting(void 0,!!e.getCanMultiSort()&&(null==t.options.isMultiSortEvent?void 0:t.options.isMultiSortEvent(o))))}}}),createTable:e=>({setSorting:t=>null==e.options.onSortingChange?void 0:e.options.onSortingChange(t),resetSorting:t=>{var n;e.setSorting(t?[]:(null==(n=e.initialState)?void 0:n.sorting)??[])},getPreSortedRowModel:()=>e.getGroupedRowModel(),getSortedRowModel:()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())})},$={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:n("columnVisibility",e)}),createColumn:(e,t)=>({toggleVisibility:n=>{e.getCanHide()&&t.setColumnVisibility((t=>({...t,[e.id]:n??!e.getIsVisible()})))},getIsVisible:()=>{var n;return(null==(n=t.getState().columnVisibility)?void 0:n[e.id])??!0},getCanHide:()=>(e.columnDef.enableHiding??!0)&&(t.options.enableHiding??!0),getToggleVisibilityHandler:()=>t=>{null==e.toggleVisibility||e.toggleVisibility(t.target.checked)}}),createRow:(e,t)=>({_getAllVisibleCells:i((()=>[e.getAllCells(),t.getState().columnVisibility]),(e=>e.filter((e=>e.column.getIsVisible()))),{key:"row._getAllVisibleCells",debug:()=>t.options.debugAll??t.options.debugRows}),getVisibleCells:i((()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()]),((e,t,n)=>[...e,...t,...n]),{key:!1,debug:()=>t.options.debugAll??t.options.debugRows})}),createTable:e=>{const t=(t,n)=>i((()=>[n(),n().filter((e=>e.getIsVisible())).map((e=>e.id)).join("_")]),(e=>e.filter((e=>null==e.getIsVisible?void 0:e.getIsVisible()))),{key:t,debug:()=>e.options.debugAll??e.options.debugColumns});return{getVisibleFlatColumns:t("getVisibleFlatColumns",(()=>e.getAllFlatColumns())),getVisibleLeafColumns:t("getVisibleLeafColumns",(()=>e.getAllLeafColumns())),getLeftVisibleLeafColumns:t("getLeftVisibleLeafColumns",(()=>e.getLeftLeafColumns())),getRightVisibleLeafColumns:t("getRightVisibleLeafColumns",(()=>e.getRightLeafColumns())),getCenterVisibleLeafColumns:t("getCenterVisibleLeafColumns",(()=>e.getCenterLeafColumns())),setColumnVisibility:t=>null==e.options.onColumnVisibilityChange?void 0:e.options.onColumnVisibilityChange(t),resetColumnVisibility:t=>{e.setColumnVisibility(t?{}:e.initialState.columnVisibility??{})},toggleAllColumnsVisible:t=>{t=t??!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce(((e,n)=>({...e,[n.id]:t||!(null!=n.getCanHide&&n.getCanHide())})),{}))},getIsAllColumnsVisible:()=>!e.getAllLeafColumns().some((e=>!(null!=e.getIsVisible&&e.getIsVisible()))),getIsSomeColumnsVisible:()=>e.getAllLeafColumns().some((e=>null==e.getIsVisible?void 0:e.getIsVisible())),getToggleAllColumnsVisibilityHandler:()=>t=>{var n;e.toggleAllColumnsVisible(null==(n=t.target)?void 0:n.checked)}}}},X=[s,$,E,H,I,U,A,m,G,z,d];function K(e,t,n,o){const l={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(o),renderValue:()=>l.getValue()??e.options.renderFallbackValue,getContext:i((()=>[e,n,t,l]),((e,t,n,o)=>({table:e,column:t,row:n,cell:o,getValue:o.getValue,renderValue:o.renderValue})),{key:!1,debug:()=>e.options.debugAll})};return e._features.forEach((o=>{Object.assign(l,null==o.createCell?void 0:o.createCell(l,n,t,e))}),{}),l}const J=(e,t,n,o,r,a)=>{let s={id:t,index:o,original:n,depth:r,_valuesCache:{},getValue:t=>{if(s._valuesCache.hasOwnProperty(t))return s._valuesCache[t];const n=e.getColumn(t);return n.accessorFn?(s._valuesCache[t]=n.accessorFn(s.original,o),s._valuesCache[t]):void 0},renderValue:t=>s.getValue(t)??e.options.renderFallbackValue,subRows:a??[],getLeafRows:()=>l(s.subRows,(e=>e.subRows)),getAllCells:i((()=>[e.getAllLeafColumns()]),(t=>t.map((t=>K(e,s,t,t.id)))),{key:!1,debug:()=>e.options.debugAll??e.options.debugRows}),_getAllCellsByColumnId:i((()=>[s.getAllCells()]),(e=>e.reduce(((e,t)=>(e[t.column.id]=t,e)),{})),{key:"row.getAllCellsByColumnId",debug:()=>e.options.debugAll??e.options.debugRows})};for(let t=0;t<e._features.length;t++){const n=e._features[t];Object.assign(s,null==n||null==n.createRow?void 0:n.createRow(s,e))}return s};function Q(e,t,n){return n.options.filterFromLeafRows?function(e,t,n){const o=[],l={},i=function(e,o){const r=[];for(let o=0;o<e.length;o++){var a;let s=e[o];if(null!=(a=s.subRows)&&a.length){const e=J(n,s.id,s.original,s.index,s.depth);if(e.columnFilters=s.columnFilters,e.subRows=i(s.subRows),!e.subRows.length)continue;s=e}t(s)&&(r.push(s),l[s.id]=s,l[o]=s)}return r};return{rows:i(e),flatRows:o,rowsById:l}}(e,t,n):function(e,t,n){const o=[],l={},i=function(e,r){const a=[];for(let r=0;r<e.length;r++){let u=e[r];if(t(u)){var s;if(null!=(s=u.subRows)&&s.length){const e=J(n,u.id,u.original,u.index,u.depth);e.subRows=i(u.subRows),u=e}a.push(u),o.push(u),l[u.id]=u}}return a};return{rows:i(e),flatRows:o,rowsById:l}}(e,t,n)}function W(e){const t=[],n=e=>{var o;t.push(e),null!=(o=e.subRows)&&o.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}e.ColumnSizing=d,e.Expanding=m,e.Filters=I,e.Grouping=A,e.Headers=s,e.Ordering=E,e.Pagination=G,e.Pinning=H,e.RowSelection=z,e.Sorting=U,e.Visibility=$,e.aggregationFns=_,e.buildHeaderGroups=u,e.createCell=K,e.createColumn=r,e.createColumnHelper=function(){return{accessor:(e,t)=>"function"==typeof e?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}},e.createRow=J,e.createTable=function(e){(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let n={_features:X};const o=n._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultOptions?void 0:t.getDefaultOptions(n))),{});let l={...e.initialState??{}};n._features.forEach((e=>{l=(null==e.getInitialState?void 0:e.getInitialState(l))??l}));const a=[];let s=!1;const u={_features:X,options:{...o,...e},initialState:l,_queue:e=>{a.push(e),s||(s=!0,Promise.resolve().then((()=>{for(;a.length;)a.shift()();s=!1})).catch((e=>setTimeout((()=>{throw e})))))},reset:()=>{n.setState(n.initialState)},setOptions:e=>{const l=t(e,n.options);n.options=(e=>n.options.mergeOptions?n.options.mergeOptions(o,e):{...o,...e})(l)},getState:()=>n.options.state,setState:e=>{null==n.options.onStateChange||n.options.onStateChange(e)},_getRowId:(e,t,o)=>(null==n.options.getRowId?void 0:n.options.getRowId(e,t,o))??`${o?[o.id,t].join("."):t}`,getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:e=>{const t=n.getRowModel().rowsById[e];if(!t)throw new Error;return t},_getDefaultColumnDef:i((()=>[n.options.defaultColumn]),(e=>(e=e??{},{header:e=>{const t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t;return(null==(t=e.renderValue())||null==t.toString?void 0:t.toString())??null},...n._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultColumnDef?void 0:t.getDefaultColumnDef())),{}),...e})),{debug:()=>n.options.debugAll??n.options.debugColumns,key:!1}),_getColumnDefs:()=>n.options.columns,getAllColumns:i((()=>[n._getColumnDefs()]),(e=>{const t=function(e,o,l){return void 0===l&&(l=0),e.map((e=>{const i=r(n,e,l,o),a=e;return i.columns=a.columns?t(a.columns,i,l+1):[],i}))};return t(e)}),{key:!1,debug:()=>n.options.debugAll??n.options.debugColumns}),getAllFlatColumns:i((()=>[n.getAllColumns()]),(e=>e.flatMap((e=>e.getFlatColumns()))),{key:!1,debug:()=>n.options.debugAll??n.options.debugColumns}),_getAllFlatColumnsById:i((()=>[n.getAllFlatColumns()]),(e=>e.reduce(((e,t)=>(e[t.id]=t,e)),{})),{key:!1,debug:()=>n.options.debugAll??n.options.debugColumns}),getAllLeafColumns:i((()=>[n.getAllColumns(),n._getOrderColumnsFn()]),((e,t)=>t(e.flatMap((e=>e.getLeafColumns())))),{key:!1,debug:()=>n.options.debugAll??n.options.debugColumns}),getColumn:e=>{const t=n._getAllFlatColumnsById()[e];if(!t)throw new Error;return t}};return Object.assign(n,u),n._features.forEach((e=>Object.assign(n,null==e.createTable?void 0:e.createTable(n)))),n},e.defaultColumnSizing=g,e.expandRows=W,e.filterFns=V,e.flattenBy=l,e.functionalUpdate=t,e.getCoreRowModel=function(){return e=>i((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(t,l,i){void 0===l&&(l=0);const r=[];for(let s=0;s<t.length;s++){const u=J(e,e._getRowId(t[s],s,i),t[s],s,l);var a;if(n.flatRows.push(u),n.rowsById[u.id]=u,r.push(u),e.options.getSubRows)u.originalSubRows=e.options.getSubRows(t[s],s),null!=(a=u.originalSubRows)&&a.length&&(u.subRows=o(u.originalSubRows,l+1,u))}return r};return n.rows=o(t),n}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable,onChange:()=>{e._autoResetPageIndex()}})},e.getExpandedRowModel=function(){return e=>i((()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows]),((e,t,n)=>!t.rows.length||!0!==e&&!Object.keys(e??{}).length?t:n?W(t):t),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable})},e.getFacetedMinMaxValues=function(){return(e,t)=>i((()=>[e.getColumn(t).getFacetedRowModel()]),(e=>{var n;const o=null==(n=e.flatRows[0])?void 0:n.getValue(t);if(void 0===o)return;let l=[o,o];for(let n=0;n<e.flatRows.length;n++){const o=e.flatRows[n].getValue(t);o<l[0]?l[0]=o:o>l[1]&&(l[1]=o)}return l}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable,onChange:()=>{}})},e.getFacetedRowModel=function(){return(e,t)=>i((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()]),((n,o,l)=>{if(!n.rows.length||(null==o||!o.length)&&!l)return n;const i=[...o.map((e=>e.id)).filter((e=>e!==t)),l?"__global__":void 0].filter(Boolean);return Q(n.rows,(e=>{for(let t=0;t<i.length;t++)if(!1===e.columnFilters[i[t]])return!1;return!0}),e)}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable,onChange:()=>{}})},e.getFacetedUniqueValues=function(){return(e,t)=>i((()=>[e.getColumn(t).getFacetedRowModel()]),(e=>{let n=new Map;for(let l=0;l<e.flatRows.length;l++){var o;const i=null==(o=e.flatRows[l])?void 0:o.getValue(t);n.has(i)?n.set(i,(n.get(i)??0)+1):n.set(i,1)}return n}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable,onChange:()=>{}})},e.getFilteredRowModel=function(){return e=>i((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter]),((t,n,o)=>{if(!t.rows.length||(null==n||!n.length)&&!o){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}const l=[],i=[];(n??[]).forEach((t=>{const n=e.getColumn(t.id).getFilterFn();n&&l.push({id:t.id,filterFn:n,resolvedValue:(null==n.resolveFilterValue?void 0:n.resolveFilterValue(t.value))??t.value})}));const r=n.map((e=>e.id)),a=e.getGlobalFilterFn(),s=e.getAllLeafColumns().filter((e=>e.getCanGlobalFilter()));let u,g;o&&a&&s.length&&(r.push("__global__"),s.forEach((e=>{i.push({id:e.id,filterFn:a,resolvedValue:(null==a.resolveFilterValue?void 0:a.resolveFilterValue(o))??o})})));for(let e=0;e<t.flatRows.length;e++){const n=t.flatRows[e];if(n.columnFilters={},l.length)for(let e=0;e<l.length;e++){u=l[e];const t=u.id;n.columnFilters[t]=u.filterFn(n,t,u.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))}if(i.length){for(let e=0;e<i.length;e++){g=i[e];const t=g.id;if(g.filterFn(n,t,g.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))){n.columnFilters.__global__=!0;break}}!0!==n.columnFilters.__global__&&(n.columnFilters.__global__=!1)}}return Q(t.rows,(e=>{for(let t=0;t<r.length;t++)if(!1===e.columnFilters[r[t]])return!1;return!0}),e)}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable,onChange:()=>{e._autoResetPageIndex()}})},e.getGroupedRowModel=function(){return e=>i((()=>[e.getState().grouping,e.getPreGroupedRowModel()]),((t,n)=>{if(!n.rows.length||!t.length)return n;const o=t.filter((t=>e.getColumn(t))),i=[],r={},a=function(t,n,s){if(void 0===n&&(n=0),n>=o.length)return t.map((e=>(e.depth=n,i.push(e),r[e.id]=e,e.subRows&&(e.subRows=a(e.subRows,n+1)),e)));const u=o[n],g=function(e,t){const n=new Map;return e.reduce(((e,n)=>{const o=`${n.getValue(t)}`,l=e.get(o);return l?e.set(o,[...l,n]):e.set(o,[n]),e}),n)}(t,u),d=Array.from(g.entries()).map(((t,g)=>{let[d,c]=t,p=`${u}:${d}`;p=s?`${s}>${p}`:p;const f=a(c,n+1,p),m=n?l(c,(e=>e.subRows)):c,b=J(e,p,m[0].original,g,n);return Object.assign(b,{groupingColumnId:u,groupingValue:d,subRows:f,leafRows:m,getValue:t=>{if(o.includes(t))return b._valuesCache.hasOwnProperty(t)||c[0]&&(b._valuesCache[t]=c[0].getValue(t)??void 0),b._valuesCache[t];if(b._groupingValuesCache.hasOwnProperty(t))return b._groupingValuesCache[t];const n=e.getColumn(t).getAggregationFn();return n?(b._groupingValuesCache[t]=n(t,m,c),b._groupingValuesCache[t]):void 0}}),f.forEach((e=>{i.push(e),r[e.id]=e})),b}));return d},s=a(n.rows,0,"");return s.forEach((e=>{i.push(e),r[e.id]=e})),{rows:s,flatRows:i,rowsById:r}}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable,onChange:()=>{e._queue((()=>{e._autoResetExpanded(),e._autoResetPageIndex()}))}})},e.getPaginationRowModel=function(e){return e=>i((()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded]),((t,n)=>{if(!n.rows.length)return n;const{pageSize:o,pageIndex:l}=t;let{rows:i,flatRows:r,rowsById:a}=n;const s=o*l,u=s+o;let g;i=i.slice(s,u),g=e.options.paginateExpandedRows?{rows:i,flatRows:r,rowsById:a}:W({rows:i,flatRows:r,rowsById:a}),g.flatRows=[];const d=e=>{g.flatRows.push(e),e.subRows.length&&e.subRows.forEach(d)};return g.rows.forEach(d),g}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable})},e.getSortedRowModel=function(){return e=>i((()=>[e.getState().sorting,e.getPreSortedRowModel()]),((t,n)=>{if(!n.rows.length||null==t||!t.length)return n;const o=e.getState().sorting,l=[],i=o.filter((t=>e.getColumn(t.id).getCanSort())),r={};i.forEach((t=>{const n=e.getColumn(t.id);r[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()}}));const a=e=>{const t=e.slice();return t.sort(((e,t)=>{for(let n=0;n<i.length;n+=1){const o=i[n],l=r[o.id],a=(null==o?void 0:o.desc)??!1;if(l.sortUndefined){const n=void 0===e.getValue(o.id),i=void 0===t.getValue(o.id);if(n||i)return n&&i?0:n?l.sortUndefined:-l.sortUndefined}let s=l.sortingFn(e,t,o.id);if(0!==s)return a&&(s*=-1),l.invertSorting&&(s*=-1),s}return e.index-t.index})),t.forEach((e=>{l.push(e),!e.subRows||e.subRows.length<=1||(e.subRows=a(e.subRows))})),t};return{rows:a(n.rows),flatRows:l,rowsById:n.rowsById}}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable,onChange:()=>{e._autoResetPageIndex()}})},e.isFunction=o,e.isRowSelected=k,e.isSubRowSelected=O,e.makeStateUpdater=n,e.memo=i,e.noop=function(){},e.orderColumns=P,e.passiveEventSupported=p,e.reSplitAlphaNumeric=T,e.selectRowsFn=D,e.shouldAutoRemoveFilter=x,e.sortingFns=N,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=index.production.js.map |
{ | ||
"name": "@tanstack/table-core", | ||
"author": "Tanner Linsley", | ||
"version": "8.5.15", | ||
"version": "8.5.16", | ||
"description": "Headless UI for building powerful tables & datagrids for TS/JS.", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -305,3 +305,3 @@ import { TableFeature } from '../core/table' | ||
} | ||
onEnd(e.touches[0]!.clientX) | ||
onEnd(e.touches[0]?.clientX) | ||
}, | ||
@@ -315,2 +315,12 @@ } | ||
if (isTouchStartEvent(e)) { | ||
document.addEventListener( | ||
'touchmove', | ||
touchEvents.moveHandler, | ||
passiveIfSupported | ||
) | ||
document.addEventListener( | ||
'touchend', | ||
touchEvents.upHandler, | ||
passiveIfSupported | ||
) | ||
} else { | ||
@@ -317,0 +327,0 @@ document.addEventListener( |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2031348
17739