@tanstack/table-core
Advanced tools
Comparing version 8.13.2 to 8.14.0
@@ -1,2 +0,2 @@ | ||
import { AggregationFn } from './features/Grouping'; | ||
import { AggregationFn } from './features/ColumnGrouping'; | ||
export declare const aggregationFns: { | ||
@@ -3,0 +3,0 @@ sum: AggregationFn<any>; |
@@ -75,3 +75,3 @@ /** | ||
// Yes, we have to convert table to uknown, because we know more than the compiler here. | ||
// Yes, we have to convert table to unknown, because we know more than the compiler here. | ||
return column; | ||
@@ -78,0 +78,0 @@ } |
@@ -1,3 +0,2 @@ | ||
import { RowData, Column, Header, HeaderGroup, Table } from '../types'; | ||
import { TableFeature } from './table'; | ||
import { RowData, Column, Header, HeaderGroup, Table, TableFeature } from '../types'; | ||
export interface CoreHeaderGroup<TData extends RowData> { | ||
@@ -4,0 +3,0 @@ depth: number; |
import { RequiredKeys } from '../utils'; | ||
import { Updater, TableOptionsResolved, TableState, Table, InitialTableState, Row, Column, RowModel, ColumnDef, TableOptions, RowData, TableMeta } from '../types'; | ||
export interface TableFeature { | ||
createCell?: (cell: any, column: any, row: any, table: any) => any; | ||
createColumn?: (column: any, table: any) => any; | ||
createHeader?: (column: any, table: any) => any; | ||
createRow?: (row: any, table: any) => any; | ||
createTable?: (table: any) => any; | ||
getDefaultColumnDef?: () => any; | ||
getDefaultOptions?: (table: any) => any; | ||
getInitialState?: (initialState?: InitialTableState) => any; | ||
} | ||
import { Updater, TableOptionsResolved, TableState, Table, InitialTableState, Row, Column, RowModel, ColumnDef, TableOptions, RowData, TableMeta, TableFeature } from '../types'; | ||
export interface CoreTableState { | ||
@@ -17,2 +7,8 @@ } | ||
/** | ||
* An array of extra features that you can add to the table instance. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#_features) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
_features?: TableFeature[]; | ||
/** | ||
* Set this option to override any of the `autoReset...` feature options. | ||
@@ -19,0 +15,0 @@ * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#autoresetall) |
@@ -16,14 +16,21 @@ /** | ||
var headers = require('./headers.js'); | ||
var ColumnFaceting = require('../features/ColumnFaceting.js'); | ||
var ColumnFiltering = require('../features/ColumnFiltering.js'); | ||
var ColumnGrouping = require('../features/ColumnGrouping.js'); | ||
var ColumnOrdering = require('../features/ColumnOrdering.js'); | ||
var ColumnPinning = require('../features/ColumnPinning.js'); | ||
var ColumnSizing = require('../features/ColumnSizing.js'); | ||
var Expanding = require('../features/Expanding.js'); | ||
var Filters = require('../features/Filters.js'); | ||
var Grouping = require('../features/Grouping.js'); | ||
var Ordering = require('../features/Ordering.js'); | ||
var Pagination = require('../features/Pagination.js'); | ||
var Pinning = require('../features/Pinning.js'); | ||
var ColumnVisibility = require('../features/ColumnVisibility.js'); | ||
var GlobalFiltering = require('../features/GlobalFiltering.js'); | ||
var RowExpanding = require('../features/RowExpanding.js'); | ||
var RowPagination = require('../features/RowPagination.js'); | ||
var RowPinning = require('../features/RowPinning.js'); | ||
var RowSelection = require('../features/RowSelection.js'); | ||
var Sorting = require('../features/Sorting.js'); | ||
var Visibility = require('../features/Visibility.js'); | ||
var RowSorting = require('../features/RowSorting.js'); | ||
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 builtInFeatures = [headers.Headers, ColumnVisibility.ColumnVisibility, ColumnOrdering.ColumnOrdering, ColumnPinning.ColumnPinning, ColumnFaceting.ColumnFaceting, ColumnFiltering.ColumnFiltering, GlobalFiltering.GlobalFiltering, | ||
//depends on ColumnFiltering and ColumnFaceting | ||
RowSorting.RowSorting, ColumnGrouping.ColumnGrouping, | ||
//depends on RowSorting | ||
RowExpanding.RowExpanding, RowPagination.RowPagination, RowPinning.RowPinning, RowSelection.RowSelection, ColumnSizing.ColumnSizing]; | ||
@@ -33,8 +40,9 @@ // | ||
function createTable(options) { | ||
var _options$initialState; | ||
if (options.debugAll || options.debugTable) { | ||
var _options$_features, _options$initialState; | ||
if (process.env.NODE_ENV !== 'production' && (options.debugAll || options.debugTable)) { | ||
console.info('Creating Table Instance...'); | ||
} | ||
const _features = [...builtInFeatures, ...((_options$_features = options._features) != null ? _options$_features : [])]; | ||
let table = { | ||
_features: features | ||
_features | ||
}; | ||
@@ -65,3 +73,3 @@ const defaultOptions = table._features.reduce((obj, feature) => { | ||
const coreInstance = { | ||
_features: features, | ||
_features, | ||
options: { | ||
@@ -68,0 +76,0 @@ ...defaultOptions, |
@@ -1,4 +0,3 @@ | ||
import { TableFeature } from '../core/table'; | ||
import { OnChangeFn, Updater } from '../types'; | ||
import { ColumnPinningPosition } from './Pinning'; | ||
import { OnChangeFn, Updater, TableFeature } from '../types'; | ||
import { ColumnPinningPosition } from './ColumnPinning'; | ||
export interface ColumnSizingTableState { | ||
@@ -5,0 +4,0 @@ columnSizing: ColumnSizingState; |
@@ -14,3 +14,3 @@ /** | ||
var utils = require('../utils.js'); | ||
var Visibility = require('./Visibility.js'); | ||
var ColumnVisibility = require('./ColumnVisibility.js'); | ||
@@ -59,4 +59,4 @@ // | ||
}; | ||
column.getStart = utils.memo(position => [position, Visibility._getVisibleLeafColumns(table, position), table.getState().columnSizing], (position, columns) => columns.slice(0, column.getIndex(position)).reduce((sum, column) => sum + column.getSize(), 0), utils.getMemoOptions(table.options, 'debugColumns', 'getStart')); | ||
column.getAfter = utils.memo(position => [position, Visibility._getVisibleLeafColumns(table, position), table.getState().columnSizing], (position, columns) => columns.slice(column.getIndex(position) + 1).reduce((sum, column) => sum + column.getSize(), 0), utils.getMemoOptions(table.options, 'debugColumns', 'getAfter')); | ||
column.getStart = utils.memo(position => [position, ColumnVisibility._getVisibleLeafColumns(table, position), table.getState().columnSizing], (position, columns) => columns.slice(0, column.getIndex(position)).reduce((sum, column) => sum + column.getSize(), 0), utils.getMemoOptions(table.options, 'debugColumns', 'getStart')); | ||
column.getAfter = utils.memo(position => [position, ColumnVisibility._getVisibleLeafColumns(table, position), table.getState().columnSizing], (position, columns) => columns.slice(column.getIndex(position) + 1).reduce((sum, column) => sum + column.getSize(), 0), utils.getMemoOptions(table.options, 'debugColumns', 'getAfter')); | ||
column.resetSize = () => { | ||
@@ -63,0 +63,0 @@ table.setColumnSizing(_ref2 => { |
@@ -1,3 +0,2 @@ | ||
import { TableFeature } from '../core/table'; | ||
import { OnChangeFn, Table, Row, RowModel, Updater, RowData } from '../types'; | ||
import { OnChangeFn, Table, Row, RowModel, Updater, RowData, TableFeature } from '../types'; | ||
export type RowSelectionState = Record<string, boolean>; | ||
@@ -4,0 +3,0 @@ export interface RowSelectionTableState { |
@@ -1,2 +0,2 @@ | ||
import { FilterFn } from './features/Filters'; | ||
import { FilterFn } from './features/ColumnFiltering'; | ||
export declare const filterFns: { | ||
@@ -3,0 +3,0 @@ includesString: FilterFn<any>; |
@@ -1,30 +0,33 @@ | ||
export * from './core/table'; | ||
export * from './columnHelper'; | ||
export * from './types'; | ||
export * from './core/cell'; | ||
export * from './core/column'; | ||
export * from './core/headers'; | ||
export * from './core/row'; | ||
export * from './core/cell'; | ||
export * from './core/table'; | ||
export * from './features/ColumnFaceting'; | ||
export * from './features/ColumnFiltering'; | ||
export * from './features/ColumnGrouping'; | ||
export * from './features/ColumnOrdering'; | ||
export * from './features/ColumnPinning'; | ||
export * from './features/ColumnSizing'; | ||
export * from './features/Expanding'; | ||
export * from './features/Filters'; | ||
export * from './features/Grouping'; | ||
export * from './features/Ordering'; | ||
export * from './features/Pagination'; | ||
export * from './features/Pinning'; | ||
export * from './features/ColumnVisibility'; | ||
export * from './features/GlobalFiltering'; | ||
export * from './features/RowExpanding'; | ||
export * from './features/RowPagination'; | ||
export * from './features/RowPinning'; | ||
export * from './features/RowSelection'; | ||
export * from './features/Sorting'; | ||
export * from './features/Visibility'; | ||
export * from './filterFns'; | ||
export * from './sortingFns'; | ||
export * from './aggregationFns'; | ||
export * from './columnHelper'; | ||
export * from './features/RowSorting'; | ||
export * from './utils'; | ||
export * from './utils/getCoreRowModel'; | ||
export * from './utils/getFilteredRowModel'; | ||
export * from './utils/getExpandedRowModel'; | ||
export * from './utils/getFacetedMinMaxValues'; | ||
export * from './utils/getFacetedRowModel'; | ||
export * from './utils/getFacetedUniqueValues'; | ||
export * from './utils/getFacetedMinMaxValues'; | ||
export * from './utils/getSortedRowModel'; | ||
export * from './utils/getFilteredRowModel'; | ||
export * from './utils/getGroupedRowModel'; | ||
export * from './utils/getExpandedRowModel'; | ||
export * from './utils/getPaginationRowModel'; | ||
export * from './utils/getSortedRowModel'; | ||
export * from './aggregationFns'; | ||
export * from './filterFns'; | ||
export * from './sortingFns'; |
@@ -13,35 +13,39 @@ /** | ||
var table = require('./core/table.js'); | ||
var columnHelper = require('./columnHelper.js'); | ||
var cell = require('./core/cell.js'); | ||
var column = require('./core/column.js'); | ||
var headers = require('./core/headers.js'); | ||
var row = require('./core/row.js'); | ||
var cell = require('./core/cell.js'); | ||
var table = require('./core/table.js'); | ||
var ColumnFaceting = require('./features/ColumnFaceting.js'); | ||
var ColumnFiltering = require('./features/ColumnFiltering.js'); | ||
var ColumnGrouping = require('./features/ColumnGrouping.js'); | ||
var ColumnOrdering = require('./features/ColumnOrdering.js'); | ||
var ColumnPinning = require('./features/ColumnPinning.js'); | ||
var ColumnSizing = require('./features/ColumnSizing.js'); | ||
var Expanding = require('./features/Expanding.js'); | ||
var Filters = require('./features/Filters.js'); | ||
var Grouping = require('./features/Grouping.js'); | ||
var Ordering = require('./features/Ordering.js'); | ||
var Pagination = require('./features/Pagination.js'); | ||
var Pinning = require('./features/Pinning.js'); | ||
var ColumnVisibility = require('./features/ColumnVisibility.js'); | ||
var GlobalFiltering = require('./features/GlobalFiltering.js'); | ||
var RowExpanding = require('./features/RowExpanding.js'); | ||
var RowPagination = require('./features/RowPagination.js'); | ||
var RowPinning = require('./features/RowPinning.js'); | ||
var RowSelection = require('./features/RowSelection.js'); | ||
var Sorting = require('./features/Sorting.js'); | ||
var Visibility = require('./features/Visibility.js'); | ||
var filterFns = require('./filterFns.js'); | ||
var sortingFns = require('./sortingFns.js'); | ||
var aggregationFns = require('./aggregationFns.js'); | ||
var columnHelper = require('./columnHelper.js'); | ||
var RowSorting = require('./features/RowSorting.js'); | ||
var utils = require('./utils.js'); | ||
var getCoreRowModel = require('./utils/getCoreRowModel.js'); | ||
var getFilteredRowModel = require('./utils/getFilteredRowModel.js'); | ||
var getExpandedRowModel = require('./utils/getExpandedRowModel.js'); | ||
var getFacetedMinMaxValues = require('./utils/getFacetedMinMaxValues.js'); | ||
var getFacetedRowModel = require('./utils/getFacetedRowModel.js'); | ||
var getFacetedUniqueValues = require('./utils/getFacetedUniqueValues.js'); | ||
var getFacetedMinMaxValues = require('./utils/getFacetedMinMaxValues.js'); | ||
var getSortedRowModel = require('./utils/getSortedRowModel.js'); | ||
var getFilteredRowModel = require('./utils/getFilteredRowModel.js'); | ||
var getGroupedRowModel = require('./utils/getGroupedRowModel.js'); | ||
var getExpandedRowModel = require('./utils/getExpandedRowModel.js'); | ||
var getPaginationRowModel = require('./utils/getPaginationRowModel.js'); | ||
var getSortedRowModel = require('./utils/getSortedRowModel.js'); | ||
var aggregationFns = require('./aggregationFns.js'); | ||
var filterFns = require('./filterFns.js'); | ||
var sortingFns = require('./sortingFns.js'); | ||
exports.createTable = table.createTable; | ||
exports.createColumnHelper = columnHelper.createColumnHelper; | ||
exports.createCell = cell.createCell; | ||
exports.createColumn = column.createColumn; | ||
@@ -51,14 +55,19 @@ exports.Headers = headers.Headers; | ||
exports.createRow = row.createRow; | ||
exports.createCell = cell.createCell; | ||
exports.createTable = table.createTable; | ||
exports.ColumnFaceting = ColumnFaceting.ColumnFaceting; | ||
exports.ColumnFiltering = ColumnFiltering.ColumnFiltering; | ||
exports.shouldAutoRemoveFilter = ColumnFiltering.shouldAutoRemoveFilter; | ||
exports.ColumnGrouping = ColumnGrouping.ColumnGrouping; | ||
exports.orderColumns = ColumnGrouping.orderColumns; | ||
exports.ColumnOrdering = ColumnOrdering.ColumnOrdering; | ||
exports.ColumnPinning = ColumnPinning.ColumnPinning; | ||
exports.ColumnSizing = ColumnSizing.ColumnSizing; | ||
exports.defaultColumnSizing = ColumnSizing.defaultColumnSizing; | ||
exports.passiveEventSupported = ColumnSizing.passiveEventSupported; | ||
exports.Expanding = Expanding.Expanding; | ||
exports.Filters = Filters.Filters; | ||
exports.shouldAutoRemoveFilter = Filters.shouldAutoRemoveFilter; | ||
exports.Grouping = Grouping.Grouping; | ||
exports.orderColumns = Grouping.orderColumns; | ||
exports.Ordering = Ordering.Ordering; | ||
exports.Pagination = Pagination.Pagination; | ||
exports.Pinning = Pinning.Pinning; | ||
exports.ColumnVisibility = ColumnVisibility.ColumnVisibility; | ||
exports._getVisibleLeafColumns = ColumnVisibility._getVisibleLeafColumns; | ||
exports.GlobalFiltering = GlobalFiltering.GlobalFiltering; | ||
exports.RowExpanding = RowExpanding.RowExpanding; | ||
exports.RowPagination = RowPagination.RowPagination; | ||
exports.RowPinning = RowPinning.RowPinning; | ||
exports.RowSelection = RowSelection.RowSelection; | ||
@@ -68,10 +77,3 @@ exports.isRowSelected = RowSelection.isRowSelected; | ||
exports.selectRowsFn = RowSelection.selectRowsFn; | ||
exports.Sorting = Sorting.Sorting; | ||
exports.Visibility = Visibility.Visibility; | ||
exports._getVisibleLeafColumns = Visibility._getVisibleLeafColumns; | ||
exports.filterFns = filterFns.filterFns; | ||
exports.reSplitAlphaNumeric = sortingFns.reSplitAlphaNumeric; | ||
exports.sortingFns = sortingFns.sortingFns; | ||
exports.aggregationFns = aggregationFns.aggregationFns; | ||
exports.createColumnHelper = columnHelper.createColumnHelper; | ||
exports.RowSorting = RowSorting.RowSorting; | ||
exports.flattenBy = utils.flattenBy; | ||
@@ -86,11 +88,15 @@ exports.functionalUpdate = utils.functionalUpdate; | ||
exports.getCoreRowModel = getCoreRowModel.getCoreRowModel; | ||
exports.getFilteredRowModel = getFilteredRowModel.getFilteredRowModel; | ||
exports.expandRows = getExpandedRowModel.expandRows; | ||
exports.getExpandedRowModel = getExpandedRowModel.getExpandedRowModel; | ||
exports.getFacetedMinMaxValues = getFacetedMinMaxValues.getFacetedMinMaxValues; | ||
exports.getFacetedRowModel = getFacetedRowModel.getFacetedRowModel; | ||
exports.getFacetedUniqueValues = getFacetedUniqueValues.getFacetedUniqueValues; | ||
exports.getFacetedMinMaxValues = getFacetedMinMaxValues.getFacetedMinMaxValues; | ||
exports.getSortedRowModel = getSortedRowModel.getSortedRowModel; | ||
exports.getFilteredRowModel = getFilteredRowModel.getFilteredRowModel; | ||
exports.getGroupedRowModel = getGroupedRowModel.getGroupedRowModel; | ||
exports.expandRows = getExpandedRowModel.expandRows; | ||
exports.getExpandedRowModel = getExpandedRowModel.getExpandedRowModel; | ||
exports.getPaginationRowModel = getPaginationRowModel.getPaginationRowModel; | ||
exports.getSortedRowModel = getSortedRowModel.getSortedRowModel; | ||
exports.aggregationFns = aggregationFns.aggregationFns; | ||
exports.filterFns = filterFns.filterFns; | ||
exports.reSplitAlphaNumeric = sortingFns.reSplitAlphaNumeric; | ||
exports.sortingFns = sortingFns.sortingFns; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import { SortingFn } from './features/Sorting'; | ||
import { SortingFn } from './features/RowSorting'; | ||
export declare const reSplitAlphaNumeric: RegExp; | ||
@@ -3,0 +3,0 @@ export declare const sortingFns: { |
import { CoreOptions, CoreTableState, CoreInstance } from './core/table'; | ||
import { VisibilityInstance, VisibilityTableState, VisibilityColumn as ColumnVisibilityColumn, VisibilityOptions, VisibilityColumnDef, VisibilityRow } from './features/Visibility'; | ||
import { ColumnOrderColumn, ColumnOrderInstance, ColumnOrderOptions, ColumnOrderTableState } from './features/Ordering'; | ||
import { ColumnPinningColumn, ColumnPinningColumnDef, ColumnPinningInstance, ColumnPinningOptions, ColumnPinningRow, ColumnPinningTableState, RowPinningInstance, RowPinningOptions, RowPinningRow, RowPinningTableState } from './features/Pinning'; | ||
import { VisibilityInstance, VisibilityTableState, VisibilityColumn as ColumnVisibilityColumn, VisibilityOptions, VisibilityColumnDef, VisibilityRow } from './features/ColumnVisibility'; | ||
import { ColumnOrderColumn, ColumnOrderInstance, ColumnOrderOptions, ColumnOrderTableState } from './features/ColumnOrdering'; | ||
import { ColumnPinningColumn, ColumnPinningColumnDef, ColumnPinningInstance, ColumnPinningOptions, ColumnPinningRow, ColumnPinningTableState } from './features/ColumnPinning'; | ||
import { RowPinningInstance, RowPinningOptions, RowPinningRow, RowPinningTableState } from './features/RowPinning'; | ||
import { CoreHeader, CoreHeaderGroup, HeaderContext, HeadersInstance } from './core/headers'; | ||
import { FiltersColumn, FiltersColumnDef, FiltersInstance, FiltersOptions, FiltersRow, FiltersTableState } from './features/Filters'; | ||
import { SortingColumn, SortingColumnDef, SortingInstance, SortingOptions, SortingTableState } from './features/Sorting'; | ||
import { GroupingCell, GroupingColumn, GroupingColumnDef, GroupingInstance, GroupingOptions, GroupingRow, GroupingTableState } from './features/Grouping'; | ||
import { ExpandedInstance, ExpandedOptions, ExpandedTableState, ExpandedRow } from './features/Expanding'; | ||
import { FacetedColumn, FacetedOptions } from './features/ColumnFaceting'; | ||
import { ColumnFiltersColumn, ColumnFiltersColumnDef, ColumnFiltersInstance, ColumnFiltersOptions, ColumnFiltersRow, ColumnFiltersTableState } from './features/ColumnFiltering'; | ||
import { GlobalFilterColumn, GlobalFilterColumnDef, GlobalFilterInstance, GlobalFilterOptions, GlobalFilterTableState } from './features/GlobalFiltering'; | ||
import { SortingColumn, SortingColumnDef, SortingInstance, SortingOptions, SortingTableState } from './features/RowSorting'; | ||
import { GroupingCell, GroupingColumn, GroupingColumnDef, GroupingInstance, GroupingOptions, GroupingRow, GroupingTableState } from './features/ColumnGrouping'; | ||
import { ExpandedInstance, ExpandedOptions, ExpandedTableState, ExpandedRow } from './features/RowExpanding'; | ||
import { ColumnSizingColumn, ColumnSizingColumnDef, ColumnSizingHeader, ColumnSizingInstance, ColumnSizingOptions, ColumnSizingTableState } from './features/ColumnSizing'; | ||
import { PaginationInitialTableState, PaginationInstance, PaginationOptions, PaginationTableState } from './features/Pagination'; | ||
import { PaginationInitialTableState, PaginationInstance, PaginationOptions, PaginationTableState } from './features/RowPagination'; | ||
import { RowSelectionInstance, RowSelectionOptions, RowSelectionRow, RowSelectionTableState } from './features/RowSelection'; | ||
@@ -17,2 +20,12 @@ import { CoreRow } from './core/row'; | ||
import { CoreColumn } from './core/column'; | ||
export interface TableFeature<TData extends RowData = any> { | ||
createCell?: (cell: Cell<TData, unknown>, column: Column<TData>, row: Row<TData>, table: Table<TData>) => void; | ||
createColumn?: (column: Column<TData, unknown>, table: Table<TData>) => void; | ||
createHeader?: (header: Header<TData, unknown>, table: Table<TData>) => void; | ||
createRow?: (row: Row<TData>, table: Table<TData>) => void; | ||
createTable?: (table: Table<TData>) => void; | ||
getDefaultColumnDef?: () => Partial<ColumnDef<TData, unknown>>; | ||
getDefaultOptions?: (table: Table<TData>) => Partial<TableOptionsResolved<TData>>; | ||
getInitialState?: (initialState?: InitialTableState) => Partial<TableState>; | ||
} | ||
export interface TableMeta<TData extends RowData> { | ||
@@ -34,16 +47,17 @@ } | ||
export type AnyRender = (Comp: any, props: any) => any; | ||
export interface Table<TData extends RowData> extends CoreInstance<TData>, HeadersInstance<TData>, VisibilityInstance<TData>, ColumnOrderInstance<TData>, ColumnPinningInstance<TData>, RowPinningInstance<TData>, FiltersInstance<TData>, SortingInstance<TData>, GroupingInstance<TData>, ColumnSizingInstance, ExpandedInstance<TData>, PaginationInstance<TData>, RowSelectionInstance<TData> { | ||
export interface Table<TData extends RowData> extends CoreInstance<TData>, HeadersInstance<TData>, VisibilityInstance<TData>, ColumnOrderInstance<TData>, ColumnPinningInstance<TData>, RowPinningInstance<TData>, ColumnFiltersInstance<TData>, GlobalFilterInstance<TData>, SortingInstance<TData>, GroupingInstance<TData>, ColumnSizingInstance, ExpandedInstance<TData>, PaginationInstance<TData>, RowSelectionInstance<TData> { | ||
} | ||
interface FeatureOptions<TData extends RowData> extends VisibilityOptions, ColumnOrderOptions, ColumnPinningOptions, RowPinningOptions<TData>, FiltersOptions<TData>, SortingOptions<TData>, GroupingOptions, ExpandedOptions<TData>, ColumnSizingOptions, PaginationOptions, RowSelectionOptions<TData> { | ||
interface FeatureOptions<TData extends RowData> extends VisibilityOptions, ColumnOrderOptions, ColumnPinningOptions, RowPinningOptions<TData>, FacetedOptions<TData>, ColumnFiltersOptions<TData>, GlobalFilterOptions<TData>, SortingOptions<TData>, GroupingOptions, ExpandedOptions<TData>, ColumnSizingOptions, PaginationOptions, RowSelectionOptions<TData> { | ||
} | ||
export type TableOptionsResolved<TData extends RowData> = CoreOptions<TData> & FeatureOptions<TData>; | ||
export interface TableOptionsResolved<TData extends RowData> extends CoreOptions<TData>, FeatureOptions<TData> { | ||
} | ||
export interface TableOptions<TData extends RowData> extends PartialKeys<TableOptionsResolved<TData>, 'state' | 'onStateChange' | 'renderFallbackValue'> { | ||
} | ||
export interface TableState extends CoreTableState, VisibilityTableState, ColumnOrderTableState, ColumnPinningTableState, RowPinningTableState, FiltersTableState, SortingTableState, ExpandedTableState, GroupingTableState, ColumnSizingTableState, PaginationTableState, RowSelectionTableState { | ||
export interface TableState extends CoreTableState, VisibilityTableState, ColumnOrderTableState, ColumnPinningTableState, RowPinningTableState, ColumnFiltersTableState, GlobalFilterTableState, SortingTableState, ExpandedTableState, GroupingTableState, ColumnSizingTableState, PaginationTableState, RowSelectionTableState { | ||
} | ||
interface CompleteInitialTableState extends CoreTableState, VisibilityTableState, ColumnOrderTableState, ColumnPinningTableState, RowPinningTableState, FiltersTableState, SortingTableState, ExpandedTableState, GroupingTableState, ColumnSizingTableState, PaginationInitialTableState, RowSelectionTableState { | ||
interface CompleteInitialTableState extends CoreTableState, VisibilityTableState, ColumnOrderTableState, ColumnPinningTableState, RowPinningTableState, ColumnFiltersTableState, GlobalFilterTableState, SortingTableState, ExpandedTableState, GroupingTableState, ColumnSizingTableState, PaginationInitialTableState, RowSelectionTableState { | ||
} | ||
export interface InitialTableState extends Partial<CompleteInitialTableState> { | ||
} | ||
export interface Row<TData extends RowData> extends CoreRow<TData>, VisibilityRow<TData>, ColumnPinningRow<TData>, RowPinningRow, FiltersRow<TData>, GroupingRow, RowSelectionRow, ExpandedRow { | ||
export interface Row<TData extends RowData> extends CoreRow<TData>, VisibilityRow<TData>, ColumnPinningRow<TData>, RowPinningRow, ColumnFiltersRow<TData>, GroupingRow, RowSelectionRow, ExpandedRow { | ||
} | ||
@@ -67,3 +81,3 @@ export interface RowModel<TData extends RowData> { | ||
type ColumnIdentifiers<TData extends RowData, TValue> = IdIdentifier<TData, TValue> | StringHeaderIdentifier; | ||
interface ColumnDefExtensions<TData extends RowData, TValue = unknown> extends VisibilityColumnDef, ColumnPinningColumnDef, FiltersColumnDef<TData>, SortingColumnDef<TData>, GroupingColumnDef<TData, TValue>, ColumnSizingColumnDef { | ||
interface ColumnDefExtensions<TData extends RowData, TValue = unknown> extends VisibilityColumnDef, ColumnPinningColumnDef, ColumnFiltersColumnDef<TData>, GlobalFilterColumnDef, SortingColumnDef<TData>, GroupingColumnDef<TData, TValue>, ColumnSizingColumnDef { | ||
} | ||
@@ -99,3 +113,3 @@ export interface ColumnDefBase<TData extends RowData, TValue = unknown> extends ColumnDefExtensions<TData, TValue> { | ||
}; | ||
export interface Column<TData extends RowData, TValue = unknown> extends CoreColumn<TData, TValue>, ColumnVisibilityColumn, ColumnPinningColumn, FiltersColumn<TData>, SortingColumn<TData>, GroupingColumn<TData>, ColumnSizingColumn, ColumnOrderColumn { | ||
export interface Column<TData extends RowData, TValue = unknown> extends CoreColumn<TData, TValue>, ColumnVisibilityColumn, ColumnPinningColumn, FacetedColumn<TData>, ColumnFiltersColumn<TData>, GlobalFilterColumn, SortingColumn<TData>, GroupingColumn<TData>, ColumnSizingColumn, ColumnOrderColumn { | ||
} | ||
@@ -102,0 +116,0 @@ export interface Cell<TData extends RowData, TValue> extends CoreCell<TData, TValue>, GroupingCell { |
@@ -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 l=>{n.setState((n=>({...n,[e]:t(l,n[e])})))}}function l(e){return e instanceof Function}function o(e){return Array.isArray(e)&&e.every((e=>"number"==typeof e))}function i(e,t){const n=[],l=e=>{e.forEach((e=>{n.push(e);const o=t(e);null!=o&&o.length&&l(o)}))};return l(e),n}function r(e,t,n){let l,o=[];return i=>{let r;n.key&&n.debug&&(r=Date.now());const u=e(i);if(!(u.length!==o.length||u.some(((e,t)=>o[t]!==e))))return l;let a;if(o=u,n.key&&n.debug&&(a=Date.now()),l=t(...u),null==n||null==n.onChange||n.onChange(l),n.key&&n.debug&&null!=n&&n.debug()){const e=Math.round(100*(Date.now()-r))/100,t=Math.round(100*(Date.now()-a))/100,l=t/16,o=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${o(t,5)} /${o(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*l,120))}deg 100% 31%);`,null==n?void 0:n.key)}return l}}function u(e,t,n,l){return{debug:()=>{var n;return null!=(n=null==e?void 0:e.debugAll)?n:e[t]},key:!1,onChange:l}}function a(e,t,n,l){var o,i;const a={...e._getDefaultColumnDef(),...t},s=a.accessorKey;let g,d=null!=(o=null!=(i=a.id)?i:s?s.replace(".","_"):void 0)?o:"string"==typeof a.header?a.header:void 0;if(a.accessorFn?g=a.accessorFn:s&&(g=s.includes(".")?e=>{let t=e;for(const e of s.split(".")){var n;t=null==(n=t)?void 0:n[e]}return t}:e=>e[a.accessorKey]),!d)throw new Error;let c={id:`${String(d)}`,accessorFn:g,parent:l,depth:n,columnDef:a,columns:[],getFlatColumns:r((()=>[!0]),(()=>{var e;return[c,...null==(e=c.columns)?void 0:e.flatMap((e=>e.getFlatColumns()))]}),u(e.options,"debugColumns")),getLeafColumns:r((()=>[e._getOrderColumnsFn()]),(e=>{var t;if(null!=(t=c.columns)&&t.length){let t=c.columns.flatMap((e=>e.getLeafColumns()));return e(t)}return[c]}),u(e.options,"debugColumns"))};for(const t of e._features)null==t.createColumn||t.createColumn(c,e);return c}const s="debugHeaders";function g(e,t,n){var l;let o={id:null!=(l=n.id)?l: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=>{null==t.createHeader||t.createHeader(o,e)})),o}const d={createTable:e=>{e.getHeaderGroups=r((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,n,l,o)=>{var i,r;const u=null!=(i=null==l?void 0:l.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?i:[],a=null!=(r=null==o?void 0:o.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?r:[];return c(t,[...u,...n.filter((e=>!(null!=l&&l.includes(e.id)||null!=o&&o.includes(e.id)))),...a],e)}),u(e.options,s)),e.getCenterHeaderGroups=r((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,n,l,o)=>c(t,n=n.filter((e=>!(null!=l&&l.includes(e.id)||null!=o&&o.includes(e.id)))),e,"center")),u(e.options,s)),e.getLeftHeaderGroups=r((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left]),((t,n,l)=>{var o;return c(t,null!=(o=null==l?void 0:l.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?o:[],e,"left")}),u(e.options,s)),e.getRightHeaderGroups=r((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right]),((t,n,l)=>{var o;return c(t,null!=(o=null==l?void 0:l.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?o:[],e,"right")}),u(e.options,s)),e.getFooterGroups=r((()=>[e.getHeaderGroups()]),(e=>[...e].reverse()),u(e.options,s)),e.getLeftFooterGroups=r((()=>[e.getLeftHeaderGroups()]),(e=>[...e].reverse()),u(e.options,s)),e.getCenterFooterGroups=r((()=>[e.getCenterHeaderGroups()]),(e=>[...e].reverse()),u(e.options,s)),e.getRightFooterGroups=r((()=>[e.getRightHeaderGroups()]),(e=>[...e].reverse()),u(e.options,s)),e.getFlatHeaders=r((()=>[e.getHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),u(e.options,s)),e.getLeftFlatHeaders=r((()=>[e.getLeftHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),u(e.options,s)),e.getCenterFlatHeaders=r((()=>[e.getCenterHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),u(e.options,s)),e.getRightFlatHeaders=r((()=>[e.getRightHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),u(e.options,s)),e.getCenterLeafHeaders=r((()=>[e.getCenterFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),u(e.options,s)),e.getLeftLeafHeaders=r((()=>[e.getLeftFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),u(e.options,s)),e.getRightLeafHeaders=r((()=>[e.getRightFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),u(e.options,s)),e.getLeafHeaders=r((()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()]),((e,t,n)=>{var l,o,i,r,u,a;return[...null!=(l=null==(o=e[0])?void 0:o.headers)?l:[],...null!=(i=null==(r=t[0])?void 0:r.headers)?i:[],...null!=(u=null==(a=n[0])?void 0:a.headers)?u:[]].map((e=>e.getLeafHeaders())).flat()}),u(e.options,s))}};function c(e,t,n,l){var o,i;let r=0;const u=function(e,t){void 0===t&&(t=1),r=Math.max(r,t),e.filter((e=>e.getIsVisible())).forEach((e=>{var n;null!=(n=e.columns)&&n.length&&u(e.columns,t+1)}),0)};u(e);let a=[];const s=(e,t)=>{const o={depth:t,id:[l,`${t}`].filter(Boolean).join("_"),headers:[]},i=[];e.forEach((e=>{const r=[...i].reverse()[0];let u,a=!1;if(e.column.depth===o.depth&&e.column.parent?u=e.column.parent:(u=e.column,a=!0),r&&(null==r?void 0:r.column)===u)r.subHeaders.push(e);else{const o=g(n,u,{id:[l,t,u.id,null==e?void 0:e.id].filter(Boolean).join("_"),isPlaceholder:a,placeholderId:a?`${i.filter((e=>e.column===u)).length}`:void 0,depth:t,index:i.length});o.subHeaders.push(e),i.push(o)}o.headers.push(e),e.headerGroup=o})),a.push(o),t>0&&s(i,t-1)},d=t.map(((e,t)=>g(n,e,{depth:r,index:t})));s(d,r-1),a.reverse();const c=e=>e.filter((e=>e.column.getIsVisible())).map((e=>{let t=0,n=0,l=[0];e.subHeaders&&e.subHeaders.length?(l=[],c(e.subHeaders).forEach((e=>{let{colSpan:n,rowSpan:o}=e;t+=n,l.push(o)}))):t=1;return n+=Math.min(...l),e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}}));return c(null!=(o=null==(i=a[0])?void 0:i.headers)?o:[]),a}const p={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},f={getDefaultColumnDef:()=>p,getInitialState:e=>({columnSizing:{},columnSizingInfo:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]},...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:n("columnSizing",e),onColumnSizingInfoChange:n("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,l,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max(null!=(n=e.columnDef.minSize)?n:p.minSize,null!=(l=null!=i?i:e.columnDef.size)?l:p.size),null!=(o=e.columnDef.maxSize)?o:p.maxSize)},e.getStart=r((e=>[e,Q(t,e),t.getState().columnSizing]),((t,n)=>n.slice(0,e.getIndex(t)).reduce(((e,t)=>e+t.getSize()),0)),u(t.options,"debugColumns")),e.getAfter=r((e=>[e,Q(t,e),t.getState().columnSizing]),((t,n)=>n.slice(e.getIndex(t)+1).reduce(((e,t)=>e+t.getSize()),0)),u(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing((t=>{let{[e.id]:n,...l}=t;return l}))},e.getCanResize=()=>{var n,l;return(null==(n=e.columnDef.enableResizing)||n)&&(null==(l=t.options.enableColumnResizing)||l)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0;const n=e=>{var l;e.subHeaders.length?e.subHeaders.forEach(n):t+=null!=(l=e.column.getSize())?l:0};return n(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=n=>{const l=t.getColumn(e.column.id),o=null==l?void 0:l.getCanResize();return i=>{if(!l||!o)return;if(null==i.persist||i.persist(),h(i)&&i.touches&&i.touches.length>1)return;const r=e.getSize(),u=e?e.getLeafHeaders().map((e=>[e.column.id,e.column.getSize()])):[[l.id,l.getSize()]],a=h(i)?Math.round(i.touches[0].clientX):i.clientX,s={},g=(e,n)=>{"number"==typeof n&&(t.setColumnSizingInfo((e=>{var l,o;const i="rtl"===t.options.columnResizeDirection?-1:1,r=(n-(null!=(l=null==e?void 0:e.startOffset)?l:0))*i,u=Math.max(r/(null!=(o=null==e?void 0:e.startSize)?o:0),-.999999);return e.columnSizingStart.forEach((e=>{let[t,n]=e;s[t]=Math.round(100*Math.max(n+n*u,0))/100})),{...e,deltaOffset:r,deltaPercentage:u}})),"onChange"!==t.options.columnResizeMode&&"end"!==e||t.setColumnSizing((e=>({...e,...s}))))},d=e=>g("move",e),c=e=>{g("end",e),t.setColumnSizingInfo((e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]})))},p=n||"undefined"!=typeof document?document:null,f={moveHandler:e=>d(e.clientX),upHandler:e=>{null==p||p.removeEventListener("mousemove",f.moveHandler),null==p||p.removeEventListener("mouseup",f.upHandler),c(e.clientX)}},m={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),d(e.touches[0].clientX),!1),upHandler:e=>{var t;null==p||p.removeEventListener("touchmove",m.moveHandler),null==p||p.removeEventListener("touchend",m.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),c(null==(t=e.touches[0])?void 0:t.clientX)}},S=!!w()&&{passive:!1};h(i)?(null==p||p.addEventListener("touchmove",m.moveHandler,S),null==p||p.addEventListener("touchend",m.upHandler,S)):(null==p||p.addEventListener("mousemove",f.moveHandler,S),null==p||p.addEventListener("mouseup",f.upHandler,S)),t.setColumnSizingInfo((e=>({...e,startOffset:a,startSize:r,deltaOffset:0,deltaPercentage:0,columnSizingStart:u,isResizingColumn:l.id})))}}},createTable:e=>{e.setColumnSizing=t=>null==e.options.onColumnSizingChange?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>null==e.options.onColumnSizingInfoChange?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:null!=(n=e.initialState.columnSizing)?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}:null!=(n=e.initialState.columnSizingInfo)?n:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]})},e.getTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getLeftTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getLeftHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getCenterTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getCenterHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getRightTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getRightHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0}}};let m=null;function w(){if("boolean"==typeof m)return m;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 m=e,m}function h(e){return"touchstart"===e.type}const S={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:n("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var l,o;if(t){if(null!=(l=null!=(o=e.options.autoResetAll)?o:e.options.autoResetExpanded)?l:!e.options.manualExpanding){if(n)return;n=!0,e._queue((()=>{e.resetExpanded(),n=!1}))}}else e._queue((()=>{t=!0}))},e.setExpanded=t=>null==e.options.onExpandedChange?void 0:e.options.onExpandedChange(t),e.toggleAllRowsExpanded=t=>{(null!=t?t:!e.getIsAllRowsExpanded())?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=t=>{var n,l;e.setExpanded(t?{}:null!=(n=null==(l=e.initialState)?void 0:l.expanded)?n:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some((e=>e.getCanExpand())),e.getToggleAllRowsExpandedHandler=()=>t=>{null==t.persist||t.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const t=e.getState().expanded;return!0===t||Object.values(t).some(Boolean)},e.getIsAllRowsExpanded=()=>{const t=e.getState().expanded;return"boolean"==typeof t?!0===t:!!Object.keys(t).length&&!e.getRowModel().flatRows.some((e=>!e.getIsExpanded()))},e.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},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded((l=>{var o;const i=!0===l||!(null==l||!l[e.id]);let r={};if(!0===l?Object.keys(t.getRowModel().rowsById).forEach((e=>{r[e]=!0})):r=l,n=null!=(o=n)?o:!i,!i&&n)return{...r,[e.id]:!0};if(i&&!n){const{[e.id]:t,...n}=r;return n}return l}))},e.getIsExpanded=()=>{var n;const l=t.getState().expanded;return!!(null!=(n=null==t.options.getIsRowExpanded?void 0:t.options.getIsRowExpanded(e))?n:!0===l||(null==l?void 0:l[e.id]))},e.getCanExpand=()=>{var n,l,o;return null!=(n=null==t.options.getRowCanExpand?void 0:t.options.getRowCanExpand(e))?n:(null==(l=t.options.enableExpanding)||l)&&!(null==(o=e.subRows)||!o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,l=e;for(;n&&l.parentId;)l=t.getRow(l.parentId,!0),n=l.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},v=(e,t,n)=>{var l;const o=n.toLowerCase();return Boolean(null==(l=e.getValue(t))||null==(l=l.toString())||null==(l=l.toLowerCase())?void 0:l.includes(o))};v.autoRemove=e=>_(e);const C=(e,t,n)=>{var l;return Boolean(null==(l=e.getValue(t))||null==(l=l.toString())?void 0:l.includes(n))};C.autoRemove=e=>_(e);const R=(e,t,n)=>{var l;return(null==(l=e.getValue(t))||null==(l=l.toString())?void 0:l.toLowerCase())===(null==n?void 0:n.toLowerCase())};R.autoRemove=e=>_(e);const b=(e,t,n)=>{var l;return null==(l=e.getValue(t))?void 0:l.includes(n)};b.autoRemove=e=>_(e)||!(null!=e&&e.length);const F=(e,t,n)=>!n.some((n=>{var l;return!(null!=(l=e.getValue(t))&&l.includes(n))}));F.autoRemove=e=>_(e)||!(null!=e&&e.length);const M=(e,t,n)=>n.some((n=>{var l;return null==(l=e.getValue(t))?void 0:l.includes(n)}));M.autoRemove=e=>_(e)||!(null!=e&&e.length);const V=(e,t,n)=>e.getValue(t)===n;V.autoRemove=e=>_(e);const I=(e,t,n)=>e.getValue(t)==n;I.autoRemove=e=>_(e);const P=(e,t,n)=>{let[l,o]=n;const i=e.getValue(t);return i>=l&&i<=o};P.resolveFilterValue=e=>{let[t,n]=e,l="number"!=typeof t?parseFloat(t):t,o="number"!=typeof n?parseFloat(n):n,i=null===t||Number.isNaN(l)?-1/0:l,r=null===n||Number.isNaN(o)?1/0:o;if(i>r){const e=i;i=r,r=e}return[i,r]},P.autoRemove=e=>_(e)||_(e[0])&&_(e[1]);const x={includesString:v,includesStringSensitive:C,equalsString:R,arrIncludes:b,arrIncludesAll:F,arrIncludesSome:M,equals:V,weakEquals:I,inNumberRange:P};function _(e){return null==e||""===e}const y={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:n("columnFilters",e),onGlobalFilterChange:n("globalFilter",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100,globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const l=null==(n=e.getCoreRowModel().flatRows[0])||null==(n=n._getAllCellsByColumnId()[t.id])?void 0:n.getValue();return"string"==typeof l||"number"==typeof l}}),createColumn:(e,n)=>{e.getAutoFilterFn=()=>{const t=n.getCoreRowModel().flatRows[0],l=null==t?void 0:t.getValue(e.id);return"string"==typeof l?x.includesString:"number"==typeof l?x.inNumberRange:"boolean"==typeof l||null!==l&&"object"==typeof l?x.equals:Array.isArray(l)?x.arrIncludes:x.weakEquals},e.getFilterFn=()=>{var t,o;return l(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?e.getAutoFilterFn():null!=(t=null==(o=n.options.filterFns)?void 0:o[e.columnDef.filterFn])?t:x[e.columnDef.filterFn]},e.getCanFilter=()=>{var t,l,o;return(null==(t=e.columnDef.enableColumnFilter)||t)&&(null==(l=n.options.enableColumnFilters)||l)&&(null==(o=n.options.enableFilters)||o)&&!!e.accessorFn},e.getCanGlobalFilter=()=>{var t,l,o,i;return(null==(t=e.columnDef.enableGlobalFilter)||t)&&(null==(l=n.options.enableGlobalFilter)||l)&&(null==(o=n.options.enableFilters)||o)&&(null==(i=null==n.options.getColumnCanGlobalFilter?void 0:n.options.getColumnCanGlobalFilter(e))||i)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var t;return null==(t=n.getState().columnFilters)||null==(t=t.find((t=>t.id===e.id)))?void 0:t.value},e.getFilterIndex=()=>{var t,l;return null!=(t=null==(l=n.getState().columnFilters)?void 0:l.findIndex((t=>t.id===e.id)))?t:-1},e.setFilterValue=l=>{n.setColumnFilters((n=>{const o=e.getFilterFn(),i=null==n?void 0:n.find((t=>t.id===e.id)),r=t(l,i?i.value:void 0);var u;if(E(o,r,e))return null!=(u=null==n?void 0:n.filter((t=>t.id!==e.id)))?u:[];const a={id:e.id,value:r};var s;return i?null!=(s=null==n?void 0:n.map((t=>t.id===e.id?a:t)))?s:[]:null!=n&&n.length?[...n,a]:[a]}))},e._getFacetedRowModel=n.options.getFacetedRowModel&&n.options.getFacetedRowModel(n,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():n.getPreFilteredRowModel(),e._getFacetedUniqueValues=n.options.getFacetedUniqueValues&&n.options.getFacetedUniqueValues(n,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=n.options.getFacetedMinMaxValues&&n.options.getFacetedMinMaxValues(n,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.getGlobalAutoFilterFn=()=>x.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:o}=e.options;return l(o)?o:"auto"===o?e.getGlobalAutoFilterFn():null!=(t=null==(n=e.options.filterFns)?void 0:n[o])?t:x[o]},e.setColumnFilters=n=>{const l=e.getAllLeafColumns();null==e.options.onColumnFiltersChange||e.options.onColumnFiltersChange((e=>{var o;return null==(o=t(n,e))?void 0:o.filter((e=>{const t=l.find((t=>t.id===e.id));if(t){if(E(t.getFilterFn(),e.value,t))return!1}return!0}))}))},e.setGlobalFilter=t=>{null==e.options.onGlobalFilterChange||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)},e.resetColumnFilters=t=>{var n,l;e.setColumnFilters(t?[]:null!=(n=null==(l=e.initialState)?void 0:l.columnFilters)?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel()),e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}};function E(e,t,n){return!(!e||!e.autoRemove)&&e.autoRemove(t,n)||void 0===t||"string"==typeof t&&!t}const G={sum:(e,t,n)=>n.reduce(((t,n)=>{const l=n.getValue(e);return t+("number"==typeof l?l:0)}),0),min:(e,t,n)=>{let l;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(l>n||void 0===l&&n>=n)&&(l=n)})),l},max:(e,t,n)=>{let l;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(l<n||void 0===l&&n>=n)&&(l=n)})),l},extent:(e,t,n)=>{let l,o;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(void 0===l?n>=n&&(l=o=n):(l>n&&(l=n),o<n&&(o=n)))})),[l,o]},mean:(e,t)=>{let n=0,l=0;if(t.forEach((t=>{let o=t.getValue(e);null!=o&&(o=+o)>=o&&(++n,l+=o)})),n)return l/n},median:(e,t)=>{if(!t.length)return;const n=t.map((t=>t.getValue(e)));if(!o(n))return;if(1===n.length)return n[0];const l=Math.floor(n.length/2),i=n.sort(((e,t)=>e-t));return n.length%2!=0?i[l]:(i[l-1]+i[l])/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},z={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return null!=(t=null==(n=e.getValue())||null==n.toString?void 0:n.toString())?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:n("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping((t=>null!=t&&t.includes(e.id)?t.filter((t=>t!==e.id)):[...null!=t?t:[],e.id]))},e.getCanGroup=()=>{var n,l,o,i;return null!=(n=null==(l=null!=(o=null==(i=e.columnDef.enableGrouping)||i)?o:t.options.enableGrouping)||l)?n:!!e.accessorFn},e.getIsGrouped=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],l=null==n?void 0:n.getValue(e.id);return"number"==typeof l?G.sum:"[object Date]"===Object.prototype.toString.call(l)?G.extent:void 0},e.getAggregationFn=()=>{var n,o;if(!e)throw new Error;return l(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:"auto"===e.columnDef.aggregationFn?e.getAutoAggregationFn():null!=(n=null==(o=t.options.aggregationFns)?void 0:o[e.columnDef.aggregationFn])?n:G[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>null==e.options.onGroupingChange?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,l;e.setGrouping(t?[]:null!=(n=null==(l=e.initialState)?void 0:l.grouping)?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const l=t.getColumn(n);return null!=l&&l.columnDef.getGroupingValue?(e._groupingValuesCache[n]=l.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,l)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!(null==(t=n.subRows)||!t.length)}}};function A(e,t,n){if(null==t||!t.length||!n)return e;const l=e.filter((e=>!t.includes(e.id)));if("remove"===n)return l;return[...t.map((t=>e.find((e=>e.id===t)))).filter(Boolean),...l]}const D={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:n("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=r((e=>[Q(t,e)]),(t=>t.findIndex((t=>t.id===e.id))),u(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var l;return(null==(l=Q(t,n)[0])?void 0:l.id)===e.id},e.getIsLastColumn=n=>{var l;const o=Q(t,n);return(null==(l=o[o.length-1])?void 0:l.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>null==e.options.onColumnOrderChange?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:null!=(n=e.initialState.columnOrder)?n:[])},e._getOrderColumnsFn=r((()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode]),((e,t,n)=>l=>{let o=[];if(null!=e&&e.length){const t=[...e],n=[...l];for(;n.length&&t.length;){const e=t.shift(),l=n.findIndex((t=>t.id===e));l>-1&&o.push(n.splice(l,1)[0])}o=[...o,...n]}else o=l;return A(o,t,n)}),u(e.options,"debugTable"))}},L={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,l=!1;e._autoResetPageIndex=()=>{var t,o;if(n){if(null!=(t=null!=(o=e.options.autoResetAll)?o:e.options.autoResetPageIndex)?t:!e.options.manualPagination){if(l)return;l=!0,e._queue((()=>{e.resetPageIndex(),l=!1}))}}else e._queue((()=>{n=!0}))},e.setPagination=n=>null==e.options.onPaginationChange?void 0:e.options.onPaginationChange((e=>t(n,e))),e.resetPagination=t=>{var n;e.setPagination(t?{pageIndex:0,pageSize:10}:null!=(n=e.initialState.pagination)?n:{pageIndex:0,pageSize:10})},e.setPageIndex=n=>{e.setPagination((l=>{let o=t(n,l.pageIndex);const i=void 0===e.options.pageCount||-1===e.options.pageCount?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,i)),{...l,pageIndex:o}}))},e.resetPageIndex=t=>{var n,l;e.setPageIndex(t?0:null!=(n=null==(l=e.initialState)||null==(l=l.pagination)?void 0:l.pageIndex)?n:0)},e.resetPageSize=t=>{var n,l;e.setPageSize(t?10:null!=(n=null==(l=e.initialState)||null==(l=l.pagination)?void 0:l.pageSize)?n:10)},e.setPageSize=n=>{e.setPagination((e=>{const l=Math.max(1,t(n,e.pageSize)),o=e.pageSize*e.pageIndex,i=Math.floor(o/l);return{...e,pageIndex:i,pageSize:l}}))},e.setPageCount=n=>e.setPagination((l=>{var o;let i=t(n,null!=(o=e.options.pageCount)?o:-1);return"number"==typeof i&&(i=Math.max(-1,i)),{...l,pageCount:i}})),e.getPageOptions=r((()=>[e.getPageCount()]),(e=>{let t=[];return e&&e>0&&(t=[...new Array(e)].fill(null).map(((e,t)=>t))),t}),u(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return-1===n||0!==n&&t<n-1},e.previousPage=()=>e.setPageIndex((e=>e-1)),e.nextPage=()=>e.setPageIndex((e=>e+1)),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var t;return null!=(t=e.options.pageCount)?t:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var t;return null!=(t=e.options.rowCount)?t:e.getPrePaginationRowModel().rows.length}}},H={getInitialState:e=>({columnPinning:{left:[],right:[]},rowPinning:{top:[],bottom:[]},...e}),getDefaultOptions:e=>({onColumnPinningChange:n("columnPinning",e),onRowPinningChange:n("rowPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const l=e.getLeafColumns().map((e=>e.id)).filter(Boolean);t.setColumnPinning((e=>{var t,o,i,r,u,a;return"right"===n?{left:(null!=(i=null==e?void 0:e.left)?i:[]).filter((e=>!(null!=l&&l.includes(e)))),right:[...(null!=(r=null==e?void 0:e.right)?r:[]).filter((e=>!(null!=l&&l.includes(e)))),...l]}:"left"===n?{left:[...(null!=(u=null==e?void 0:e.left)?u:[]).filter((e=>!(null!=l&&l.includes(e)))),...l],right:(null!=(a=null==e?void 0:e.right)?a:[]).filter((e=>!(null!=l&&l.includes(e))))}:{left:(null!=(t=null==e?void 0:e.left)?t:[]).filter((e=>!(null!=l&&l.includes(e)))),right:(null!=(o=null==e?void 0:e.right)?o:[]).filter((e=>!(null!=l&&l.includes(e))))}}))},e.getCanPin=()=>e.getLeafColumns().some((e=>{var n,l,o;return(null==(n=e.columnDef.enablePinning)||n)&&(null==(l=null!=(o=t.options.enableColumnPinning)?o:t.options.enablePinning)||l)})),e.getIsPinned=()=>{const n=e.getLeafColumns().map((e=>e.id)),{left:l,right:o}=t.getState().columnPinning,i=n.some((e=>null==l?void 0:l.includes(e))),r=n.some((e=>null==o?void 0:o.includes(e)));return i?"left":!!r&&"right"},e.getPinnedIndex=()=>{var n,l;const o=e.getIsPinned();return o?null!=(n=null==(l=t.getState().columnPinning)||null==(l=l[o])?void 0:l.indexOf(e.id))?n:-1:0}},createRow:(e,t)=>{e.pin=(n,l,o)=>{const i=l?e.getLeafRows().map((e=>{let{id:t}=e;return t})):[],r=o?e.getParentRows().map((e=>{let{id:t}=e;return t})):[],u=new Set([...r,e.id,...i]);t.setRowPinning((e=>{var t,l,o,i,r,a;return"bottom"===n?{top:(null!=(o=null==e?void 0:e.top)?o:[]).filter((e=>!(null!=u&&u.has(e)))),bottom:[...(null!=(i=null==e?void 0:e.bottom)?i:[]).filter((e=>!(null!=u&&u.has(e)))),...Array.from(u)]}:"top"===n?{top:[...(null!=(r=null==e?void 0:e.top)?r:[]).filter((e=>!(null!=u&&u.has(e)))),...Array.from(u)],bottom:(null!=(a=null==e?void 0:e.bottom)?a:[]).filter((e=>!(null!=u&&u.has(e))))}:{top:(null!=(t=null==e?void 0:e.top)?t:[]).filter((e=>!(null!=u&&u.has(e)))),bottom:(null!=(l=null==e?void 0:e.bottom)?l:[]).filter((e=>!(null!=u&&u.has(e))))}}))},e.getCanPin=()=>{var n;const{enableRowPinning:l,enablePinning:o}=t.options;return"function"==typeof l?l(e):null==(n=null!=l?l:o)||n},e.getIsPinned=()=>{const n=[e.id],{top:l,bottom:o}=t.getState().rowPinning,i=n.some((e=>null==l?void 0:l.includes(e))),r=n.some((e=>null==o?void 0:o.includes(e)));return i?"top":!!r&&"bottom"},e.getPinnedIndex=()=>{var n,l;const o=e.getIsPinned();if(!o)return-1;const i=null==(n=t._getPinnedRows(o))?void 0:n.map((e=>{let{id:t}=e;return t}));return null!=(l=null==i?void 0:i.indexOf(e.id))?l:-1},e.getCenterVisibleCells=r((()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right]),((e,t,n)=>{const l=[...null!=t?t:[],...null!=n?n:[]];return e.filter((e=>!l.includes(e.column.id)))}),u(t.options,"debugRows")),e.getLeftVisibleCells=r((()=>[e._getAllVisibleCells(),t.getState().columnPinning.left]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.column.id===t)))).filter(Boolean).map((e=>({...e,position:"left"})))),u(t.options,"debugRows")),e.getRightVisibleCells=r((()=>[e._getAllVisibleCells(),t.getState().columnPinning.right]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.column.id===t)))).filter(Boolean).map((e=>({...e,position:"right"})))),u(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>null==e.options.onColumnPinningChange?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,l;return e.setColumnPinning(t?{left:[],right:[]}:null!=(n=null==(l=e.initialState)?void 0:l.columnPinning)?n:{left:[],right:[]})},e.getIsSomeColumnsPinned=t=>{var n;const l=e.getState().columnPinning;var o,i;return t?Boolean(null==(n=l[t])?void 0:n.length):Boolean((null==(o=l.left)?void 0:o.length)||(null==(i=l.right)?void 0:i.length))},e.getLeftLeafColumns=r((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),u(e.options,"debugColumns")),e.getRightLeafColumns=r((()=>[e.getAllLeafColumns(),e.getState().columnPinning.right]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),u(e.options,"debugColumns")),e.getCenterLeafColumns=r((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((e,t,n)=>{const l=[...null!=t?t:[],...null!=n?n:[]];return e.filter((e=>!l.includes(e.id)))}),u(e.options,"debugColumns")),e.setRowPinning=t=>null==e.options.onRowPinningChange?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,l;return e.setRowPinning(t?{top:[],bottom:[]}:null!=(n=null==(l=e.initialState)?void 0:l.rowPinning)?n:{top:[],bottom:[]})},e.getIsSomeRowsPinned=t=>{var n;const l=e.getState().rowPinning;var o,i;return t?Boolean(null==(n=l[t])?void 0:n.length):Boolean((null==(o=l.top)?void 0:o.length)||(null==(i=l.bottom)?void 0:i.length))},e._getPinnedRows=r((t=>[e.getRowModel().rows,e.getState().rowPinning[t],t]),((t,n,l)=>{var o;return(null==(o=e.options.keepPinnedRows)||o?(null!=n?n:[]).map((t=>{const n=e.getRow(t,!0);return n.getIsAllParentsExpanded()?n:null})):(null!=n?n:[]).map((e=>t.find((t=>t.id===e))))).filter(Boolean).map((e=>({...e,position:l})))}),u(e.options,"debugRows")),e.getTopRows=()=>e._getPinnedRows("top"),e.getBottomRows=()=>e._getPinnedRows("bottom"),e.getCenterRows=r((()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom]),((e,t,n)=>{const l=new Set([...null!=t?t:[],...null!=n?n:[]]);return e.filter((e=>!l.has(e.id)))}),u(e.options,"debugRows"))}},O={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:n("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>null==e.options.onRowSelectionChange?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:null!=(n=e.initialState.rowSelection)?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection((n=>{t=void 0!==t?t:!e.getIsAllRowsSelected();const l={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach((e=>{e.getCanSelect()&&(l[e.id]=!0)})):o.forEach((e=>{delete l[e.id]})),l}))},e.toggleAllPageRowsSelected=t=>e.setRowSelection((n=>{const l=void 0!==t?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach((t=>{B(o,t.id,l,!0,e)})),o})),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=r((()=>[e.getState().rowSelection,e.getCoreRowModel()]),((t,n)=>Object.keys(t).length?T(e,n):{rows:[],flatRows:[],rowsById:{}}),u(e.options,"debugTable")),e.getFilteredSelectedRowModel=r((()=>[e.getState().rowSelection,e.getFilteredRowModel()]),((t,n)=>Object.keys(t).length?T(e,n):{rows:[],flatRows:[],rowsById:{}}),u(e.options,"debugTable")),e.getGroupedSelectedRowModel=r((()=>[e.getState().rowSelection,e.getSortedRowModel()]),((t,n)=>Object.keys(t).length?T(e,n):{rows:[],flatRows:[],rowsById:{}}),u(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let l=Boolean(t.length&&Object.keys(n).length);return l&&t.some((e=>e.getCanSelect()&&!n[e.id]))&&(l=!1),l},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter((e=>e.getCanSelect())),{rowSelection:n}=e.getState();let l=!!t.length;return l&&t.some((e=>!n[e.id]))&&(l=!1),l},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys(null!=(t=e.getState().rowSelection)?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return!e.getIsAllPageRowsSelected()&&t.filter((e=>e.getCanSelect())).some((e=>e.getIsSelected()||e.getIsSomeSelected()))},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,l)=>{const o=e.getIsSelected();t.setRowSelection((i=>{var r;if(n=void 0!==n?n:!o,e.getCanSelect()&&o===n)return i;const u={...i};return B(u,e.id,n,null==(r=null==l?void 0:l.selectChildren)||r,t),u}))},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return q(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return"some"===k(e,n)},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return"all"===k(e,n)},e.getCanSelect=()=>{var n;return"function"==typeof t.options.enableRowSelection?t.options.enableRowSelection(e):null==(n=t.options.enableRowSelection)||n},e.getCanSelectSubRows=()=>{var n;return"function"==typeof t.options.enableSubRowSelection?t.options.enableSubRowSelection(e):null==(n=t.options.enableSubRowSelection)||n},e.getCanMultiSelect=()=>{var n;return"function"==typeof t.options.enableMultiRowSelection?t.options.enableMultiRowSelection(e):null==(n=t.options.enableMultiRowSelection)||n},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return n=>{var l;t&&e.toggleSelected(null==(l=n.target)?void 0:l.checked)}}}},B=(e,t,n,l,o)=>{var i;const r=o.getRow(t,!0);n?(r.getCanMultiSelect()||Object.keys(e).forEach((t=>delete e[t])),r.getCanSelect()&&(e[t]=!0)):delete e[t],l&&null!=(i=r.subRows)&&i.length&&r.getCanSelectSubRows()&&r.subRows.forEach((t=>B(e,t.id,n,l,o)))};function T(e,t){const n=e.getState().rowSelection,l=[],o={},i=function(e,t){return e.map((e=>{var t;const r=q(e,n);if(r&&(l.push(e),o[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:l,rowsById:o}}function q(e,t){var n;return null!=(n=t[e.id])&&n}function k(e,t,n){var l;if(null==(l=e.subRows)||!l.length)return!1;let o=!0,i=!1;return e.subRows.forEach((e=>{if((!i||o)&&(e.getCanSelect()&&(q(e,t)?i=!0:o=!1),e.subRows&&e.subRows.length)){const n=k(e,t);"all"===n?i=!0:"some"===n?(i=!0,o=!1):o=!1}})),o?"all":!!i&&"some"}const N=/([0-9]+)/gm;function U(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 $(e,t){const n=e.split(N).filter(Boolean),l=t.split(N).filter(Boolean);for(;n.length&&l.length;){const e=n.shift(),t=l.shift(),o=parseInt(e,10),i=parseInt(t,10),r=[o,i].sort();if(isNaN(r[0])){if(e>t)return 1;if(t>e)return-1}else{if(isNaN(r[1]))return isNaN(o)?-1:1;if(o>i)return 1;if(i>o)return-1}}return n.length-l.length}const X={alphanumeric:(e,t,n)=>$(j(e.getValue(n)).toLowerCase(),j(t.getValue(n)).toLowerCase()),alphanumericCaseSensitive:(e,t,n)=>$(j(e.getValue(n)),j(t.getValue(n))),text:(e,t,n)=>U(j(e.getValue(n)).toLowerCase(),j(t.getValue(n)).toLowerCase()),textCaseSensitive:(e,t,n)=>U(j(e.getValue(n)),j(t.getValue(n))),datetime:(e,t,n)=>{const l=e.getValue(n),o=t.getValue(n);return l>o?1:l<o?-1:0},basic:(e,t,n)=>U(e.getValue(n),t.getValue(n))},K={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:n("sorting",e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let l=!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 X.datetime;if("string"==typeof n&&(l=!0,n.split(N).length>1))return X.alphanumeric}return l?X.text:X.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return"string"==typeof(null==n?void 0:n.getValue(e.id))?"asc":"desc"},e.getSortingFn=()=>{var n,o;if(!e)throw new Error;return l(e.columnDef.sortingFn)?e.columnDef.sortingFn:"auto"===e.columnDef.sortingFn?e.getAutoSortingFn():null!=(n=null==(o=t.options.sortingFns)?void 0:o[e.columnDef.sortingFn])?n:X[e.columnDef.sortingFn]},e.toggleSorting=(n,l)=>{const o=e.getNextSortingOrder(),i=null!=n;t.setSorting((r=>{const u=null==r?void 0:r.find((t=>t.id===e.id)),a=null==r?void 0:r.findIndex((t=>t.id===e.id));let s,g=[],d=i?n:"desc"===o;var c;(s=null!=r&&r.length&&e.getCanMultiSort()&&l?u?"toggle":"add":null!=r&&r.length&&a!==r.length-1?"replace":u?"toggle":"replace","toggle"===s&&(i||o||(s="remove")),"add"===s)?(g=[...r,{id:e.id,desc:d}],g.splice(0,g.length-(null!=(c=t.options.maxMultiSortColCount)?c:Number.MAX_SAFE_INTEGER))):g="toggle"===s?r.map((t=>t.id===e.id?{...t,desc:d}:t)):"remove"===s?r.filter((t=>t.id!==e.id)):[{id:e.id,desc:d}];return g}))},e.getFirstSortDir=()=>{var n,l;return(null!=(n=null!=(l=e.columnDef.sortDescFirst)?l:t.options.sortDescFirst)?n:"desc"===e.getAutoSortDir())?"desc":"asc"},e.getNextSortingOrder=n=>{var l,o;const i=e.getFirstSortDir(),r=e.getIsSorted();return r?!!(r===i||null!=(l=t.options.enableSortingRemoval)&&!l||n&&null!=(o=t.options.enableMultiRemove)&&!o)&&("desc"===r?"asc":"desc"):i},e.getCanSort=()=>{var n,l;return(null==(n=e.columnDef.enableSorting)||n)&&(null==(l=t.options.enableSorting)||l)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,l;return null!=(n=null!=(l=e.columnDef.enableMultiSort)?l:t.options.enableMultiSort)?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const l=null==(n=t.getState().sorting)?void 0:n.find((t=>t.id===e.id));return!!l&&(l.desc?"desc":"asc")},e.getSortIndex=()=>{var n,l;return null!=(n=null==(l=t.getState().sorting)?void 0:l.findIndex((t=>t.id===e.id)))?n:-1},e.clearSorting=()=>{t.setSorting((t=>null!=t&&t.length?t.filter((t=>t.id!==e.id)):[]))},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return l=>{n&&(null==l.persist||l.persist(),null==e.toggleSorting||e.toggleSorting(void 0,!!e.getCanMultiSort()&&(null==t.options.isMultiSortEvent?void 0:t.options.isMultiSortEvent(l))))}}},createTable:e=>{e.setSorting=t=>null==e.options.onSortingChange?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,l;e.setSorting(t?[]:null!=(n=null==(l=e.initialState)?void 0:l.sorting)?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},J={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:n("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility((t=>({...t,[e.id]:null!=n?n:!e.getIsVisible()})))},e.getIsVisible=()=>{var n,l;const o=e.columns;return null==(n=o.length?o.some((e=>e.getIsVisible())):null==(l=t.getState().columnVisibility)?void 0:l[e.id])||n},e.getCanHide=()=>{var n,l;return(null==(n=e.columnDef.enableHiding)||n)&&(null==(l=t.options.enableHiding)||l)},e.getToggleVisibilityHandler=()=>t=>{null==e.toggleVisibility||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=r((()=>[e.getAllCells(),t.getState().columnVisibility]),(e=>e.filter((e=>e.column.getIsVisible()))),u(t.options,"debugRows")),e.getVisibleCells=r((()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()]),((e,t,n)=>[...e,...t,...n]),u(t.options,"debugRows"))},createTable:e=>{const t=(t,n)=>r((()=>[n(),n().filter((e=>e.getIsVisible())).map((e=>e.id)).join("_")]),(e=>e.filter((e=>null==e.getIsVisible?void 0:e.getIsVisible()))),u(e.options,"debugColumns"));e.getVisibleFlatColumns=t(0,(()=>e.getAllFlatColumns())),e.getVisibleLeafColumns=t(0,(()=>e.getAllLeafColumns())),e.getLeftVisibleLeafColumns=t(0,(()=>e.getLeftLeafColumns())),e.getRightVisibleLeafColumns=t(0,(()=>e.getRightLeafColumns())),e.getCenterVisibleLeafColumns=t(0,(()=>e.getCenterLeafColumns())),e.setColumnVisibility=t=>null==e.options.onColumnVisibilityChange?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var n;e.setColumnVisibility(t?{}:null!=(n=e.initialState.columnVisibility)?n:{})},e.toggleAllColumnsVisible=t=>{var n;t=null!=(n=t)?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce(((e,n)=>({...e,[n.id]:t||!(null!=n.getCanHide&&n.getCanHide())})),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some((e=>!(null!=e.getIsVisible&&e.getIsVisible()))),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some((e=>null==e.getIsVisible?void 0:e.getIsVisible())),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var n;e.toggleAllColumnsVisible(null==(n=t.target)?void 0:n.checked)}}};function Q(e,t){return t?"center"===t?e.getCenterVisibleLeafColumns():"left"===t?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const W=[d,J,D,H,y,K,z,S,L,O,f];function Y(e,t,n,l){const o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(l),renderValue:()=>{var t;return null!=(t=o.getValue())?t:e.options.renderFallbackValue},getContext:r((()=>[e,n,t,o]),((e,t,n,l)=>({table:e,column:t,row:n,cell:l,getValue:l.getValue,renderValue:l.renderValue})),u(e.options,"debugCells"))};return e._features.forEach((l=>{null==l.createCell||l.createCell(o,n,t,e)}),{}),o}const Z=(e,t,n,l,o,a,s)=>{let g={id:t,index:l,original:n,depth:o,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(g._valuesCache.hasOwnProperty(t))return g._valuesCache[t];const n=e.getColumn(t);return null!=n&&n.accessorFn?(g._valuesCache[t]=n.accessorFn(g.original,l),g._valuesCache[t]):void 0},getUniqueValues:t=>{if(g._uniqueValuesCache.hasOwnProperty(t))return g._uniqueValuesCache[t];const n=e.getColumn(t);return null!=n&&n.accessorFn?n.columnDef.getUniqueValues?(g._uniqueValuesCache[t]=n.columnDef.getUniqueValues(g.original,l),g._uniqueValuesCache[t]):(g._uniqueValuesCache[t]=[g.getValue(t)],g._uniqueValuesCache[t]):void 0},renderValue:t=>{var n;return null!=(n=g.getValue(t))?n:e.options.renderFallbackValue},subRows:null!=a?a:[],getLeafRows:()=>i(g.subRows,(e=>e.subRows)),getParentRow:()=>g.parentId?e.getRow(g.parentId,!0):void 0,getParentRows:()=>{let e=[],t=g;for(;;){const n=t.getParentRow();if(!n)break;e.push(n),t=n}return e.reverse()},getAllCells:r((()=>[e.getAllLeafColumns()]),(t=>t.map((t=>Y(e,g,t,t.id)))),u(e.options,"debugRows")),_getAllCellsByColumnId:r((()=>[g.getAllCells()]),(e=>e.reduce(((e,t)=>(e[t.column.id]=t,e)),{})),u(e.options,"debugRows"))};for(let t=0;t<e._features.length;t++){const n=e._features[t];null==n||null==n.createRow||n.createRow(g,e)}return g};function ee(e,t,n){return n.options.filterFromLeafRows?function(e,t,n){var l;const o=[],i={},r=null!=(l=n.options.maxLeafRowFilterDepth)?l:100,u=function(e,l){void 0===l&&(l=0);const a=[];for(let g=0;g<e.length;g++){var s;let d=e[g];const c=Z(n,d.id,d.original,d.index,d.depth,void 0,d.parentId);if(c.columnFilters=d.columnFilters,null!=(s=d.subRows)&&s.length&&l<r){if(c.subRows=u(d.subRows,l+1),d=c,t(d)&&!c.subRows.length){a.push(d),i[d.id]=d,o.push(d);continue}if(t(d)||c.subRows.length){a.push(d),i[d.id]=d,o.push(d);continue}}else d=c,t(d)&&(a.push(d),i[d.id]=d,o.push(d))}return a};return{rows:u(e),flatRows:o,rowsById:i}}(e,t,n):function(e,t,n){var l;const o=[],i={},r=null!=(l=n.options.maxLeafRowFilterDepth)?l:100,u=function(e,l){void 0===l&&(l=0);const a=[];for(let g=0;g<e.length;g++){let d=e[g];if(t(d)){var s;if(null!=(s=d.subRows)&&s.length&&l<r){const e=Z(n,d.id,d.original,d.index,d.depth,void 0,d.parentId);e.subRows=u(d.subRows,l+1),d=e}a.push(d),o.push(d),i[d.id]=d}}return a};return{rows:u(e),flatRows:o,rowsById:i}}(e,t,n)}function te(e){const t=[],n=e=>{var l;t.push(e),null!=(l=e.subRows)&&l.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}e.ColumnSizing=f,e.Expanding=S,e.Filters=y,e.Grouping=z,e.Headers=d,e.Ordering=D,e.Pagination=L,e.Pinning=H,e.RowSelection=O,e.Sorting=K,e.Visibility=J,e._getVisibleLeafColumns=Q,e.aggregationFns=G,e.buildHeaderGroups=c,e.createCell=Y,e.createColumn=a,e.createColumnHelper=function(){return{accessor:(e,t)=>"function"==typeof e?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}},e.createRow=Z,e.createTable=function(e){var n;(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let l={_features:W};const o=l._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultOptions?void 0:t.getDefaultOptions(l))),{});let i={...null!=(n=e.initialState)?n:{}};l._features.forEach((e=>{var t;i=null!=(t=null==e.getInitialState?void 0:e.getInitialState(i))?t:i}));const s=[];let g=!1;const d={_features:W,options:{...o,...e},initialState:i,_queue:e=>{s.push(e),g||(g=!0,Promise.resolve().then((()=>{for(;s.length;)s.shift()();g=!1})).catch((e=>setTimeout((()=>{throw e})))))},reset:()=>{l.setState(l.initialState)},setOptions:e=>{const n=t(e,l.options);l.options=(e=>l.options.mergeOptions?l.options.mergeOptions(o,e):{...o,...e})(n)},getState:()=>l.options.state,setState:e=>{null==l.options.onStateChange||l.options.onStateChange(e)},_getRowId:(e,t,n)=>{var o;return null!=(o=null==l.options.getRowId?void 0:l.options.getRowId(e,t,n))?o:`${n?[n.id,t].join("."):t}`},getCoreRowModel:()=>(l._getCoreRowModel||(l._getCoreRowModel=l.options.getCoreRowModel(l)),l._getCoreRowModel()),getRowModel:()=>l.getPaginationRowModel(),getRow:(e,t)=>{let n=(t?l.getPrePaginationRowModel():l.getRowModel()).rowsById[e];if(!n&&(n=l.getCoreRowModel().rowsById[e],!n))throw new Error;return n},_getDefaultColumnDef:r((()=>[l.options.defaultColumn]),(e=>{var t;return e=null!=(t=e)?t:{},{header:e=>{const t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t,n;return null!=(t=null==(n=e.renderValue())||null==n.toString?void 0:n.toString())?t:null},...l._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultColumnDef?void 0:t.getDefaultColumnDef())),{}),...e}}),u(e,"debugColumns")),_getColumnDefs:()=>l.options.columns,getAllColumns:r((()=>[l._getColumnDefs()]),(e=>{const t=function(e,n,o){return void 0===o&&(o=0),e.map((e=>{const i=a(l,e,o,n),r=e;return i.columns=r.columns?t(r.columns,i,o+1):[],i}))};return t(e)}),u(e,"debugColumns")),getAllFlatColumns:r((()=>[l.getAllColumns()]),(e=>e.flatMap((e=>e.getFlatColumns()))),u(e,"debugColumns")),_getAllFlatColumnsById:r((()=>[l.getAllFlatColumns()]),(e=>e.reduce(((e,t)=>(e[t.id]=t,e)),{})),u(e,"debugColumns")),getAllLeafColumns:r((()=>[l.getAllColumns(),l._getOrderColumnsFn()]),((e,t)=>t(e.flatMap((e=>e.getLeafColumns())))),u(e,"debugColumns")),getColumn:e=>l._getAllFlatColumnsById()[e]};Object.assign(l,d);for(let e=0;e<l._features.length;e++){const t=l._features[e];null==t||null==t.createTable||t.createTable(l)}return l},e.defaultColumnSizing=p,e.expandRows=te,e.filterFns=x,e.flattenBy=i,e.functionalUpdate=t,e.getCoreRowModel=function(){return e=>r((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],rowsById:{}},l=function(t,o,i){void 0===o&&(o=0);const r=[];for(let a=0;a<t.length;a++){const s=Z(e,e._getRowId(t[a],a,i),t[a],a,o,void 0,null==i?void 0:i.id);var u;if(n.flatRows.push(s),n.rowsById[s.id]=s,r.push(s),e.options.getSubRows)s.originalSubRows=e.options.getSubRows(t[a],a),null!=(u=s.originalSubRows)&&u.length&&(s.subRows=l(s.originalSubRows,o+1,s))}return r};return n.rows=l(t),n}),u(e.options,"debugTable",0,(()=>e._autoResetPageIndex())))},e.getExpandedRowModel=function(){return e=>r((()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows]),((e,t,n)=>!t.rows.length||!0!==e&&!Object.keys(null!=e?e:{}).length?t:n?te(t):t),u(e.options,"debugTable"))},e.getFacetedMinMaxValues=function(){return(e,t)=>r((()=>{var n;return[null==(n=e.getColumn(t))?void 0:n.getFacetedRowModel()]}),(e=>{var n;if(!e)return;const l=null==(n=e.flatRows[0])?void 0:n.getUniqueValues(t);if(void 0===l)return;let o=[l,l];for(let n=0;n<e.flatRows.length;n++){const l=e.flatRows[n].getUniqueValues(t);for(let e=0;e<l.length;e++){const t=l[e];t<o[0]?o[0]=t:t>o[1]&&(o[1]=t)}}return o}),u(e.options,"debugTable"))},e.getFacetedRowModel=function(){return(e,t)=>r((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()]),((n,l,o)=>{if(!n.rows.length||(null==l||!l.length)&&!o)return n;const i=[...l.map((e=>e.id)).filter((e=>e!==t)),o?"__global__":void 0].filter(Boolean);return ee(n.rows,(e=>{for(let t=0;t<i.length;t++)if(!1===e.columnFilters[i[t]])return!1;return!0}),e)}),u(e.options,"debugTable"))},e.getFacetedUniqueValues=function(){return(e,t)=>r((()=>{var n;return[null==(n=e.getColumn(t))?void 0:n.getFacetedRowModel()]}),(e=>{if(!e)return new Map;let n=new Map;for(let o=0;o<e.flatRows.length;o++){const i=e.flatRows[o].getUniqueValues(t);for(let e=0;e<i.length;e++){const t=i[e];var l;if(n.has(t))n.set(t,(null!=(l=n.get(t))?l:0)+1);else n.set(t,1)}}return n}),u(e.options,"debugTable"))},e.getFilteredRowModel=function(){return e=>r((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter]),((t,n,l)=>{if(!t.rows.length||(null==n||!n.length)&&!l){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}const o=[],i=[];(null!=n?n:[]).forEach((t=>{var n;const l=e.getColumn(t.id);if(!l)return;const i=l.getFilterFn();i&&o.push({id:t.id,filterFn:i,resolvedValue:null!=(n=null==i.resolveFilterValue?void 0:i.resolveFilterValue(t.value))?n:t.value})}));const r=n.map((e=>e.id)),u=e.getGlobalFilterFn(),a=e.getAllLeafColumns().filter((e=>e.getCanGlobalFilter()));let s,g;l&&u&&a.length&&(r.push("__global__"),a.forEach((e=>{var t;i.push({id:e.id,filterFn:u,resolvedValue:null!=(t=null==u.resolveFilterValue?void 0:u.resolveFilterValue(l))?t:l})})));for(let e=0;e<t.flatRows.length;e++){const n=t.flatRows[e];if(n.columnFilters={},o.length)for(let e=0;e<o.length;e++){s=o[e];const t=s.id;n.columnFilters[t]=s.filterFn(n,t,s.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 ee(t.rows,(e=>{for(let t=0;t<r.length;t++)if(!1===e.columnFilters[r[t]])return!1;return!0}),e)}),u(e.options,"debugTable",0,(()=>e._autoResetPageIndex())))},e.getGroupedRowModel=function(){return e=>r((()=>[e.getState().grouping,e.getPreGroupedRowModel()]),((t,n)=>{if(!n.rows.length||!t.length)return n;const l=t.filter((t=>e.getColumn(t))),o=[],r={},u=function(t,n,a){if(void 0===n&&(n=0),n>=l.length)return t.map((e=>(e.depth=n,o.push(e),r[e.id]=e,e.subRows&&(e.subRows=u(e.subRows,n+1,e.id)),e)));const s=l[n],g=function(e,t){const n=new Map;return e.reduce(((e,n)=>{const l=`${n.getGroupingValue(t)}`,o=e.get(l);return o?o.push(n):e.set(l,[n]),e}),n)}(t,s),d=Array.from(g.entries()).map(((t,g)=>{let[d,c]=t,p=`${s}:${d}`;p=a?`${a}>${p}`:p;const f=u(c,n+1,p),m=n?i(c,(e=>e.subRows)):c,w=Z(e,p,m[0].original,g,n,void 0,a);return Object.assign(w,{groupingColumnId:s,groupingValue:d,subRows:f,leafRows:m,getValue:t=>{if(l.includes(t)){if(w._valuesCache.hasOwnProperty(t))return w._valuesCache[t];var n;if(c[0])w._valuesCache[t]=null!=(n=c[0].getValue(t))?n:void 0;return w._valuesCache[t]}if(w._groupingValuesCache.hasOwnProperty(t))return w._groupingValuesCache[t];const o=e.getColumn(t),i=null==o?void 0:o.getAggregationFn();return i?(w._groupingValuesCache[t]=i(t,m,c),w._groupingValuesCache[t]):void 0}}),f.forEach((e=>{o.push(e),r[e.id]=e})),w}));return d},a=u(n.rows,0);return a.forEach((e=>{o.push(e),r[e.id]=e})),{rows:a,flatRows:o,rowsById:r}}),u(e.options,"debugTable",0,(()=>{e._queue((()=>{e._autoResetExpanded(),e._autoResetPageIndex()}))})))},e.getMemoOptions=u,e.getPaginationRowModel=function(e){return e=>r((()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded]),((t,n)=>{if(!n.rows.length)return n;const{pageSize:l,pageIndex:o}=t;let{rows:i,flatRows:r,rowsById:u}=n;const a=l*o,s=a+l;let g;i=i.slice(a,s),g=e.options.paginateExpandedRows?{rows:i,flatRows:r,rowsById:u}:te({rows:i,flatRows:r,rowsById:u}),g.flatRows=[];const d=e=>{g.flatRows.push(e),e.subRows.length&&e.subRows.forEach(d)};return g.rows.forEach(d),g}),u(e.options,"debugTable"))},e.getSortedRowModel=function(){return e=>r((()=>[e.getState().sorting,e.getPreSortedRowModel()]),((t,n)=>{if(!n.rows.length||null==t||!t.length)return n;const l=e.getState().sorting,o=[],i=l.filter((t=>{var n;return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()})),r={};i.forEach((t=>{const n=e.getColumn(t.id);n&&(r[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})}));const u=e=>{const t=e.map((e=>({...e})));return t.sort(((e,t)=>{for(let l=0;l<i.length;l+=1){var n;const o=i[l],u=r[o.id],a=null!=(n=null==o?void 0:o.desc)&&n;let s=0;if(u.sortUndefined){const n=void 0===e.getValue(o.id),l=void 0===t.getValue(o.id);(n||l)&&(s=n&&l?0:n?u.sortUndefined:-u.sortUndefined)}if(0===s&&(s=u.sortingFn(e,t,o.id)),0!==s)return a&&(s*=-1),u.invertSorting&&(s*=-1),s}return e.index-t.index})),t.forEach((e=>{var t;o.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=u(e.subRows))})),t};return{rows:u(n.rows),flatRows:o,rowsById:n.rowsById}}),u(e.options,"debugTable",0,(()=>e._autoResetPageIndex())))},e.isFunction=l,e.isNumberArray=o,e.isRowSelected=q,e.isSubRowSelected=k,e.makeStateUpdater=n,e.memo=r,e.noop=function(){},e.orderColumns=A,e.passiveEventSupported=w,e.reSplitAlphaNumeric=N,e.selectRowsFn=T,e.shouldAutoRemoveFilter=E,e.sortingFns=X})); | ||
!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 l=>{n.setState((n=>({...n,[e]:t(l,n[e])})))}}function l(e){return e instanceof Function}function o(e){return Array.isArray(e)&&e.every((e=>"number"==typeof e))}function i(e,t){const n=[],l=e=>{e.forEach((e=>{n.push(e);const o=t(e);null!=o&&o.length&&l(o)}))};return l(e),n}function r(e,t,n){let l,o=[];return i=>{let r;n.key&&n.debug&&(r=Date.now());const u=e(i);if(!(u.length!==o.length||u.some(((e,t)=>o[t]!==e))))return l;let a;if(o=u,n.key&&n.debug&&(a=Date.now()),l=t(...u),null==n||null==n.onChange||n.onChange(l),n.key&&n.debug&&null!=n&&n.debug()){const e=Math.round(100*(Date.now()-r))/100,t=Math.round(100*(Date.now()-a))/100,l=t/16,o=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${o(t,5)} /${o(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*l,120))}deg 100% 31%);`,null==n?void 0:n.key)}return l}}function u(e,t,n,l){return{debug:()=>{var n;return null!=(n=null==e?void 0:e.debugAll)?n:e[t]},key:!1,onChange:l}}function a(e,t,n,l){const o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(l),renderValue:()=>{var t;return null!=(t=o.getValue())?t:e.options.renderFallbackValue},getContext:r((()=>[e,n,t,o]),((e,t,n,l)=>({table:e,column:t,row:n,cell:l,getValue:l.getValue,renderValue:l.renderValue})),u(e.options,"debugCells"))};return e._features.forEach((l=>{null==l.createCell||l.createCell(o,n,t,e)}),{}),o}function s(e,t,n,l){var o,i;const a={...e._getDefaultColumnDef(),...t},s=a.accessorKey;let g,d=null!=(o=null!=(i=a.id)?i:s?s.replace(".","_"):void 0)?o:"string"==typeof a.header?a.header:void 0;if(a.accessorFn?g=a.accessorFn:s&&(g=s.includes(".")?e=>{let t=e;for(const e of s.split(".")){var n;t=null==(n=t)?void 0:n[e]}return t}:e=>e[a.accessorKey]),!d)throw new Error;let c={id:`${String(d)}`,accessorFn:g,parent:l,depth:n,columnDef:a,columns:[],getFlatColumns:r((()=>[!0]),(()=>{var e;return[c,...null==(e=c.columns)?void 0:e.flatMap((e=>e.getFlatColumns()))]}),u(e.options,"debugColumns")),getLeafColumns:r((()=>[e._getOrderColumnsFn()]),(e=>{var t;if(null!=(t=c.columns)&&t.length){let t=c.columns.flatMap((e=>e.getLeafColumns()));return e(t)}return[c]}),u(e.options,"debugColumns"))};for(const t of e._features)null==t.createColumn||t.createColumn(c,e);return c}const g="debugHeaders";function d(e,t,n){var l;let o={id:null!=(l=n.id)?l: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=>{null==t.createHeader||t.createHeader(o,e)})),o}const c={createTable:e=>{e.getHeaderGroups=r((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,n,l,o)=>{var i,r;const u=null!=(i=null==l?void 0:l.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?i:[],a=null!=(r=null==o?void 0:o.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?r:[];return p(t,[...u,...n.filter((e=>!(null!=l&&l.includes(e.id)||null!=o&&o.includes(e.id)))),...a],e)}),u(e.options,g)),e.getCenterHeaderGroups=r((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,n,l,o)=>p(t,n=n.filter((e=>!(null!=l&&l.includes(e.id)||null!=o&&o.includes(e.id)))),e,"center")),u(e.options,g)),e.getLeftHeaderGroups=r((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left]),((t,n,l)=>{var o;return p(t,null!=(o=null==l?void 0:l.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?o:[],e,"left")}),u(e.options,g)),e.getRightHeaderGroups=r((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right]),((t,n,l)=>{var o;return p(t,null!=(o=null==l?void 0:l.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?o:[],e,"right")}),u(e.options,g)),e.getFooterGroups=r((()=>[e.getHeaderGroups()]),(e=>[...e].reverse()),u(e.options,g)),e.getLeftFooterGroups=r((()=>[e.getLeftHeaderGroups()]),(e=>[...e].reverse()),u(e.options,g)),e.getCenterFooterGroups=r((()=>[e.getCenterHeaderGroups()]),(e=>[...e].reverse()),u(e.options,g)),e.getRightFooterGroups=r((()=>[e.getRightHeaderGroups()]),(e=>[...e].reverse()),u(e.options,g)),e.getFlatHeaders=r((()=>[e.getHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),u(e.options,g)),e.getLeftFlatHeaders=r((()=>[e.getLeftHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),u(e.options,g)),e.getCenterFlatHeaders=r((()=>[e.getCenterHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),u(e.options,g)),e.getRightFlatHeaders=r((()=>[e.getRightHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),u(e.options,g)),e.getCenterLeafHeaders=r((()=>[e.getCenterFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),u(e.options,g)),e.getLeftLeafHeaders=r((()=>[e.getLeftFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),u(e.options,g)),e.getRightLeafHeaders=r((()=>[e.getRightFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),u(e.options,g)),e.getLeafHeaders=r((()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()]),((e,t,n)=>{var l,o,i,r,u,a;return[...null!=(l=null==(o=e[0])?void 0:o.headers)?l:[],...null!=(i=null==(r=t[0])?void 0:r.headers)?i:[],...null!=(u=null==(a=n[0])?void 0:a.headers)?u:[]].map((e=>e.getLeafHeaders())).flat()}),u(e.options,g))}};function p(e,t,n,l){var o,i;let r=0;const u=function(e,t){void 0===t&&(t=1),r=Math.max(r,t),e.filter((e=>e.getIsVisible())).forEach((e=>{var n;null!=(n=e.columns)&&n.length&&u(e.columns,t+1)}),0)};u(e);let a=[];const s=(e,t)=>{const o={depth:t,id:[l,`${t}`].filter(Boolean).join("_"),headers:[]},i=[];e.forEach((e=>{const r=[...i].reverse()[0];let u,a=!1;if(e.column.depth===o.depth&&e.column.parent?u=e.column.parent:(u=e.column,a=!0),r&&(null==r?void 0:r.column)===u)r.subHeaders.push(e);else{const o=d(n,u,{id:[l,t,u.id,null==e?void 0:e.id].filter(Boolean).join("_"),isPlaceholder:a,placeholderId:a?`${i.filter((e=>e.column===u)).length}`:void 0,depth:t,index:i.length});o.subHeaders.push(e),i.push(o)}o.headers.push(e),e.headerGroup=o})),a.push(o),t>0&&s(i,t-1)},g=t.map(((e,t)=>d(n,e,{depth:r,index:t})));s(g,r-1),a.reverse();const c=e=>e.filter((e=>e.column.getIsVisible())).map((e=>{let t=0,n=0,l=[0];e.subHeaders&&e.subHeaders.length?(l=[],c(e.subHeaders).forEach((e=>{let{colSpan:n,rowSpan:o}=e;t+=n,l.push(o)}))):t=1;return n+=Math.min(...l),e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}}));return c(null!=(o=null==(i=a[0])?void 0:i.headers)?o:[]),a}const f=(e,t,n,l,o,s,g)=>{let d={id:t,index:l,original:n,depth:o,parentId:g,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(d._valuesCache.hasOwnProperty(t))return d._valuesCache[t];const n=e.getColumn(t);return null!=n&&n.accessorFn?(d._valuesCache[t]=n.accessorFn(d.original,l),d._valuesCache[t]):void 0},getUniqueValues:t=>{if(d._uniqueValuesCache.hasOwnProperty(t))return d._uniqueValuesCache[t];const n=e.getColumn(t);return null!=n&&n.accessorFn?n.columnDef.getUniqueValues?(d._uniqueValuesCache[t]=n.columnDef.getUniqueValues(d.original,l),d._uniqueValuesCache[t]):(d._uniqueValuesCache[t]=[d.getValue(t)],d._uniqueValuesCache[t]):void 0},renderValue:t=>{var n;return null!=(n=d.getValue(t))?n:e.options.renderFallbackValue},subRows:null!=s?s:[],getLeafRows:()=>i(d.subRows,(e=>e.subRows)),getParentRow:()=>d.parentId?e.getRow(d.parentId,!0):void 0,getParentRows:()=>{let e=[],t=d;for(;;){const n=t.getParentRow();if(!n)break;e.push(n),t=n}return e.reverse()},getAllCells:r((()=>[e.getAllLeafColumns()]),(t=>t.map((t=>a(e,d,t,t.id)))),u(e.options,"debugRows")),_getAllCellsByColumnId:r((()=>[d.getAllCells()]),(e=>e.reduce(((e,t)=>(e[t.column.id]=t,e)),{})),u(e.options,"debugRows"))};for(let t=0;t<e._features.length;t++){const n=e._features[t];null==n||null==n.createRow||n.createRow(d,e)}return d},m={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},w=(e,t,n)=>{var l;const o=n.toLowerCase();return Boolean(null==(l=e.getValue(t))||null==(l=l.toString())||null==(l=l.toLowerCase())?void 0:l.includes(o))};w.autoRemove=e=>I(e);const h=(e,t,n)=>{var l;return Boolean(null==(l=e.getValue(t))||null==(l=l.toString())?void 0:l.includes(n))};h.autoRemove=e=>I(e);const S=(e,t,n)=>{var l;return(null==(l=e.getValue(t))||null==(l=l.toString())?void 0:l.toLowerCase())===(null==n?void 0:n.toLowerCase())};S.autoRemove=e=>I(e);const C=(e,t,n)=>{var l;return null==(l=e.getValue(t))?void 0:l.includes(n)};C.autoRemove=e=>I(e)||!(null!=e&&e.length);const v=(e,t,n)=>!n.some((n=>{var l;return!(null!=(l=e.getValue(t))&&l.includes(n))}));v.autoRemove=e=>I(e)||!(null!=e&&e.length);const R=(e,t,n)=>n.some((n=>{var l;return null==(l=e.getValue(t))?void 0:l.includes(n)}));R.autoRemove=e=>I(e)||!(null!=e&&e.length);const b=(e,t,n)=>e.getValue(t)===n;b.autoRemove=e=>I(e);const F=(e,t,n)=>e.getValue(t)==n;F.autoRemove=e=>I(e);const M=(e,t,n)=>{let[l,o]=n;const i=e.getValue(t);return i>=l&&i<=o};M.resolveFilterValue=e=>{let[t,n]=e,l="number"!=typeof t?parseFloat(t):t,o="number"!=typeof n?parseFloat(n):n,i=null===t||Number.isNaN(l)?-1/0:l,r=null===n||Number.isNaN(o)?1/0:o;if(i>r){const e=i;i=r,r=e}return[i,r]},M.autoRemove=e=>I(e)||I(e[0])&&I(e[1]);const V={includesString:w,includesStringSensitive:h,equalsString:S,arrIncludes:C,arrIncludesAll:v,arrIncludesSome:R,equals:b,weakEquals:F,inNumberRange:M};function I(e){return null==e||""===e}const P={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:n("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,n)=>{e.getAutoFilterFn=()=>{const t=n.getCoreRowModel().flatRows[0],l=null==t?void 0:t.getValue(e.id);return"string"==typeof l?V.includesString:"number"==typeof l?V.inNumberRange:"boolean"==typeof l||null!==l&&"object"==typeof l?V.equals:Array.isArray(l)?V.arrIncludes:V.weakEquals},e.getFilterFn=()=>{var t,o;return l(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?e.getAutoFilterFn():null!=(t=null==(o=n.options.filterFns)?void 0:o[e.columnDef.filterFn])?t:V[e.columnDef.filterFn]},e.getCanFilter=()=>{var t,l,o;return(null==(t=e.columnDef.enableColumnFilter)||t)&&(null==(l=n.options.enableColumnFilters)||l)&&(null==(o=n.options.enableFilters)||o)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var t;return null==(t=n.getState().columnFilters)||null==(t=t.find((t=>t.id===e.id)))?void 0:t.value},e.getFilterIndex=()=>{var t,l;return null!=(t=null==(l=n.getState().columnFilters)?void 0:l.findIndex((t=>t.id===e.id)))?t:-1},e.setFilterValue=l=>{n.setColumnFilters((n=>{const o=e.getFilterFn(),i=null==n?void 0:n.find((t=>t.id===e.id)),r=t(l,i?i.value:void 0);var u;if(x(o,r,e))return null!=(u=null==n?void 0:n.filter((t=>t.id!==e.id)))?u:[];const a={id:e.id,value:r};var s;return i?null!=(s=null==n?void 0:n.map((t=>t.id===e.id?a:t)))?s:[]:null!=n&&n.length?[...n,a]:[a]}))}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=n=>{const l=e.getAllLeafColumns();null==e.options.onColumnFiltersChange||e.options.onColumnFiltersChange((e=>{var o;return null==(o=t(n,e))?void 0:o.filter((e=>{const t=l.find((t=>t.id===e.id));if(t){if(x(t.getFilterFn(),e.value,t))return!1}return!0}))}))},e.resetColumnFilters=t=>{var n,l;e.setColumnFilters(t?[]:null!=(n=null==(l=e.initialState)?void 0:l.columnFilters)?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};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 l=n.getValue(e);return t+("number"==typeof l?l:0)}),0),min:(e,t,n)=>{let l;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(l>n||void 0===l&&n>=n)&&(l=n)})),l},max:(e,t,n)=>{let l;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(l<n||void 0===l&&n>=n)&&(l=n)})),l},extent:(e,t,n)=>{let l,o;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(void 0===l?n>=n&&(l=o=n):(l>n&&(l=n),o<n&&(o=n)))})),[l,o]},mean:(e,t)=>{let n=0,l=0;if(t.forEach((t=>{let o=t.getValue(e);null!=o&&(o=+o)>=o&&(++n,l+=o)})),n)return l/n},median:(e,t)=>{if(!t.length)return;const n=t.map((t=>t.getValue(e)));if(!o(n))return;if(1===n.length)return n[0];const l=Math.floor(n.length/2),i=n.sort(((e,t)=>e-t));return n.length%2!=0?i[l]:(i[l-1]+i[l])/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},y={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return null!=(t=null==(n=e.getValue())||null==n.toString?void 0:n.toString())?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:n("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping((t=>null!=t&&t.includes(e.id)?t.filter((t=>t!==e.id)):[...null!=t?t:[],e.id]))},e.getCanGroup=()=>{var n,l,o,i;return null!=(n=null==(l=null!=(o=null==(i=e.columnDef.enableGrouping)||i)?o:t.options.enableGrouping)||l)?n:!!e.accessorFn},e.getIsGrouped=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],l=null==n?void 0:n.getValue(e.id);return"number"==typeof l?_.sum:"[object Date]"===Object.prototype.toString.call(l)?_.extent:void 0},e.getAggregationFn=()=>{var n,o;if(!e)throw new Error;return l(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:"auto"===e.columnDef.aggregationFn?e.getAutoAggregationFn():null!=(n=null==(o=t.options.aggregationFns)?void 0:o[e.columnDef.aggregationFn])?n:_[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>null==e.options.onGroupingChange?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,l;e.setGrouping(t?[]:null!=(n=null==(l=e.initialState)?void 0:l.grouping)?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const l=t.getColumn(n);return null!=l&&l.columnDef.getGroupingValue?(e._groupingValuesCache[n]=l.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,l)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!(null==(t=n.subRows)||!t.length)}}};function E(e,t,n){if(null==t||!t.length||!n)return e;const l=e.filter((e=>!t.includes(e.id)));if("remove"===n)return l;return[...t.map((t=>e.find((e=>e.id===t)))).filter(Boolean),...l]}const G={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:n("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=r((e=>[T(t,e)]),(t=>t.findIndex((t=>t.id===e.id))),u(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var l;return(null==(l=T(t,n)[0])?void 0:l.id)===e.id},e.getIsLastColumn=n=>{var l;const o=T(t,n);return(null==(l=o[o.length-1])?void 0:l.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>null==e.options.onColumnOrderChange?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:null!=(n=e.initialState.columnOrder)?n:[])},e._getOrderColumnsFn=r((()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode]),((e,t,n)=>l=>{let o=[];if(null!=e&&e.length){const t=[...e],n=[...l];for(;n.length&&t.length;){const e=t.shift(),l=n.findIndex((t=>t.id===e));l>-1&&o.push(n.splice(l,1)[0])}o=[...o,...n]}else o=l;return E(o,t,n)}),u(e.options,"debugTable"))}},z={getInitialState:e=>({columnPinning:{left:[],right:[]},...e}),getDefaultOptions:e=>({onColumnPinningChange:n("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const l=e.getLeafColumns().map((e=>e.id)).filter(Boolean);t.setColumnPinning((e=>{var t,o,i,r,u,a;return"right"===n?{left:(null!=(i=null==e?void 0:e.left)?i:[]).filter((e=>!(null!=l&&l.includes(e)))),right:[...(null!=(r=null==e?void 0:e.right)?r:[]).filter((e=>!(null!=l&&l.includes(e)))),...l]}:"left"===n?{left:[...(null!=(u=null==e?void 0:e.left)?u:[]).filter((e=>!(null!=l&&l.includes(e)))),...l],right:(null!=(a=null==e?void 0:e.right)?a:[]).filter((e=>!(null!=l&&l.includes(e))))}:{left:(null!=(t=null==e?void 0:e.left)?t:[]).filter((e=>!(null!=l&&l.includes(e)))),right:(null!=(o=null==e?void 0:e.right)?o:[]).filter((e=>!(null!=l&&l.includes(e))))}}))},e.getCanPin=()=>e.getLeafColumns().some((e=>{var n,l,o;return(null==(n=e.columnDef.enablePinning)||n)&&(null==(l=null!=(o=t.options.enableColumnPinning)?o:t.options.enablePinning)||l)})),e.getIsPinned=()=>{const n=e.getLeafColumns().map((e=>e.id)),{left:l,right:o}=t.getState().columnPinning,i=n.some((e=>null==l?void 0:l.includes(e))),r=n.some((e=>null==o?void 0:o.includes(e)));return i?"left":!!r&&"right"},e.getPinnedIndex=()=>{var n,l;const o=e.getIsPinned();return o?null!=(n=null==(l=t.getState().columnPinning)||null==(l=l[o])?void 0:l.indexOf(e.id))?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=r((()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right]),((e,t,n)=>{const l=[...null!=t?t:[],...null!=n?n:[]];return e.filter((e=>!l.includes(e.column.id)))}),u(t.options,"debugRows")),e.getLeftVisibleCells=r((()=>[e._getAllVisibleCells(),t.getState().columnPinning.left]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.column.id===t)))).filter(Boolean).map((e=>({...e,position:"left"})))),u(t.options,"debugRows")),e.getRightVisibleCells=r((()=>[e._getAllVisibleCells(),t.getState().columnPinning.right]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.column.id===t)))).filter(Boolean).map((e=>({...e,position:"right"})))),u(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>null==e.options.onColumnPinningChange?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,l;return e.setColumnPinning(t?{left:[],right:[]}:null!=(n=null==(l=e.initialState)?void 0:l.columnPinning)?n:{left:[],right:[]})},e.getIsSomeColumnsPinned=t=>{var n;const l=e.getState().columnPinning;var o,i;return t?Boolean(null==(n=l[t])?void 0:n.length):Boolean((null==(o=l.left)?void 0:o.length)||(null==(i=l.right)?void 0:i.length))},e.getLeftLeafColumns=r((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),u(e.options,"debugColumns")),e.getRightLeafColumns=r((()=>[e.getAllLeafColumns(),e.getState().columnPinning.right]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),u(e.options,"debugColumns")),e.getCenterLeafColumns=r((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((e,t,n)=>{const l=[...null!=t?t:[],...null!=n?n:[]];return e.filter((e=>!l.includes(e.id)))}),u(e.options,"debugColumns"))}},A={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},D={getDefaultColumnDef:()=>A,getInitialState:e=>({columnSizing:{},columnSizingInfo:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]},...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:n("columnSizing",e),onColumnSizingInfoChange:n("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,l,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max(null!=(n=e.columnDef.minSize)?n:A.minSize,null!=(l=null!=i?i:e.columnDef.size)?l:A.size),null!=(o=e.columnDef.maxSize)?o:A.maxSize)},e.getStart=r((e=>[e,T(t,e),t.getState().columnSizing]),((t,n)=>n.slice(0,e.getIndex(t)).reduce(((e,t)=>e+t.getSize()),0)),u(t.options,"debugColumns")),e.getAfter=r((e=>[e,T(t,e),t.getState().columnSizing]),((t,n)=>n.slice(e.getIndex(t)+1).reduce(((e,t)=>e+t.getSize()),0)),u(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing((t=>{let{[e.id]:n,...l}=t;return l}))},e.getCanResize=()=>{var n,l;return(null==(n=e.columnDef.enableResizing)||n)&&(null==(l=t.options.enableColumnResizing)||l)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0;const n=e=>{var l;e.subHeaders.length?e.subHeaders.forEach(n):t+=null!=(l=e.column.getSize())?l:0};return n(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=n=>{const l=t.getColumn(e.column.id),o=null==l?void 0:l.getCanResize();return i=>{if(!l||!o)return;if(null==i.persist||i.persist(),O(i)&&i.touches&&i.touches.length>1)return;const r=e.getSize(),u=e?e.getLeafHeaders().map((e=>[e.column.id,e.column.getSize()])):[[l.id,l.getSize()]],a=O(i)?Math.round(i.touches[0].clientX):i.clientX,s={},g=(e,n)=>{"number"==typeof n&&(t.setColumnSizingInfo((e=>{var l,o;const i="rtl"===t.options.columnResizeDirection?-1:1,r=(n-(null!=(l=null==e?void 0:e.startOffset)?l:0))*i,u=Math.max(r/(null!=(o=null==e?void 0:e.startSize)?o:0),-.999999);return e.columnSizingStart.forEach((e=>{let[t,n]=e;s[t]=Math.round(100*Math.max(n+n*u,0))/100})),{...e,deltaOffset:r,deltaPercentage:u}})),"onChange"!==t.options.columnResizeMode&&"end"!==e||t.setColumnSizing((e=>({...e,...s}))))},d=e=>g("move",e),c=e=>{g("end",e),t.setColumnSizingInfo((e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]})))},p=n||"undefined"!=typeof document?document:null,f={moveHandler:e=>d(e.clientX),upHandler:e=>{null==p||p.removeEventListener("mousemove",f.moveHandler),null==p||p.removeEventListener("mouseup",f.upHandler),c(e.clientX)}},m={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),d(e.touches[0].clientX),!1),upHandler:e=>{var t;null==p||p.removeEventListener("touchmove",m.moveHandler),null==p||p.removeEventListener("touchend",m.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),c(null==(t=e.touches[0])?void 0:t.clientX)}},w=!!H()&&{passive:!1};O(i)?(null==p||p.addEventListener("touchmove",m.moveHandler,w),null==p||p.addEventListener("touchend",m.upHandler,w)):(null==p||p.addEventListener("mousemove",f.moveHandler,w),null==p||p.addEventListener("mouseup",f.upHandler,w)),t.setColumnSizingInfo((e=>({...e,startOffset:a,startSize:r,deltaOffset:0,deltaPercentage:0,columnSizingStart:u,isResizingColumn:l.id})))}}},createTable:e=>{e.setColumnSizing=t=>null==e.options.onColumnSizingChange?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>null==e.options.onColumnSizingInfoChange?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:null!=(n=e.initialState.columnSizing)?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}:null!=(n=e.initialState.columnSizingInfo)?n:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]})},e.getTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getLeftTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getLeftHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getCenterTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getCenterHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getRightTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getRightHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0}}};let L=null;function H(){if("boolean"==typeof L)return L;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 L=e,L}function O(e){return"touchstart"===e.type}const B={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:n("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility((t=>({...t,[e.id]:null!=n?n:!e.getIsVisible()})))},e.getIsVisible=()=>{var n,l;const o=e.columns;return null==(n=o.length?o.some((e=>e.getIsVisible())):null==(l=t.getState().columnVisibility)?void 0:l[e.id])||n},e.getCanHide=()=>{var n,l;return(null==(n=e.columnDef.enableHiding)||n)&&(null==(l=t.options.enableHiding)||l)},e.getToggleVisibilityHandler=()=>t=>{null==e.toggleVisibility||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=r((()=>[e.getAllCells(),t.getState().columnVisibility]),(e=>e.filter((e=>e.column.getIsVisible()))),u(t.options,"debugRows")),e.getVisibleCells=r((()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()]),((e,t,n)=>[...e,...t,...n]),u(t.options,"debugRows"))},createTable:e=>{const t=(t,n)=>r((()=>[n(),n().filter((e=>e.getIsVisible())).map((e=>e.id)).join("_")]),(e=>e.filter((e=>null==e.getIsVisible?void 0:e.getIsVisible()))),u(e.options,"debugColumns"));e.getVisibleFlatColumns=t(0,(()=>e.getAllFlatColumns())),e.getVisibleLeafColumns=t(0,(()=>e.getAllLeafColumns())),e.getLeftVisibleLeafColumns=t(0,(()=>e.getLeftLeafColumns())),e.getRightVisibleLeafColumns=t(0,(()=>e.getRightLeafColumns())),e.getCenterVisibleLeafColumns=t(0,(()=>e.getCenterLeafColumns())),e.setColumnVisibility=t=>null==e.options.onColumnVisibilityChange?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var n;e.setColumnVisibility(t?{}:null!=(n=e.initialState.columnVisibility)?n:{})},e.toggleAllColumnsVisible=t=>{var n;t=null!=(n=t)?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce(((e,n)=>({...e,[n.id]:t||!(null!=n.getCanHide&&n.getCanHide())})),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some((e=>!(null!=e.getIsVisible&&e.getIsVisible()))),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some((e=>null==e.getIsVisible?void 0:e.getIsVisible())),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var n;e.toggleAllColumnsVisible(null==(n=t.target)?void 0:n.checked)}}};function T(e,t){return t?"center"===t?e.getCenterVisibleLeafColumns():"left"===t?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const q={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:n("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const l=null==(n=e.getCoreRowModel().flatRows[0])||null==(n=n._getAllCellsByColumnId()[t.id])?void 0:n.getValue();return"string"==typeof l||"number"==typeof l}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,l,o,i;return(null==(n=e.columnDef.enableGlobalFilter)||n)&&(null==(l=t.options.enableGlobalFilter)||l)&&(null==(o=t.options.enableFilters)||o)&&(null==(i=null==t.options.getColumnCanGlobalFilter?void 0:t.options.getColumnCanGlobalFilter(e))||i)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>V.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:o}=e.options;return l(o)?o:"auto"===o?e.getGlobalAutoFilterFn():null!=(t=null==(n=e.options.filterFns)?void 0:n[o])?t:V[o]},e.setGlobalFilter=t=>{null==e.options.onGlobalFilterChange||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)},e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},k={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:n("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var l,o;if(t){if(null!=(l=null!=(o=e.options.autoResetAll)?o:e.options.autoResetExpanded)?l:!e.options.manualExpanding){if(n)return;n=!0,e._queue((()=>{e.resetExpanded(),n=!1}))}}else e._queue((()=>{t=!0}))},e.setExpanded=t=>null==e.options.onExpandedChange?void 0:e.options.onExpandedChange(t),e.toggleAllRowsExpanded=t=>{(null!=t?t:!e.getIsAllRowsExpanded())?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=t=>{var n,l;e.setExpanded(t?{}:null!=(n=null==(l=e.initialState)?void 0:l.expanded)?n:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some((e=>e.getCanExpand())),e.getToggleAllRowsExpandedHandler=()=>t=>{null==t.persist||t.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const t=e.getState().expanded;return!0===t||Object.values(t).some(Boolean)},e.getIsAllRowsExpanded=()=>{const t=e.getState().expanded;return"boolean"==typeof t?!0===t:!!Object.keys(t).length&&!e.getRowModel().flatRows.some((e=>!e.getIsExpanded()))},e.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},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded((l=>{var o;const i=!0===l||!(null==l||!l[e.id]);let r={};if(!0===l?Object.keys(t.getRowModel().rowsById).forEach((e=>{r[e]=!0})):r=l,n=null!=(o=n)?o:!i,!i&&n)return{...r,[e.id]:!0};if(i&&!n){const{[e.id]:t,...n}=r;return n}return l}))},e.getIsExpanded=()=>{var n;const l=t.getState().expanded;return!!(null!=(n=null==t.options.getIsRowExpanded?void 0:t.options.getIsRowExpanded(e))?n:!0===l||(null==l?void 0:l[e.id]))},e.getCanExpand=()=>{var n,l,o;return null!=(n=null==t.options.getRowCanExpand?void 0:t.options.getRowCanExpand(e))?n:(null==(l=t.options.enableExpanding)||l)&&!(null==(o=e.subRows)||!o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,l=e;for(;n&&l.parentId;)l=t.getRow(l.parentId,!0),n=l.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},N={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,l=!1;e._autoResetPageIndex=()=>{var t,o;if(n){if(null!=(t=null!=(o=e.options.autoResetAll)?o:e.options.autoResetPageIndex)?t:!e.options.manualPagination){if(l)return;l=!0,e._queue((()=>{e.resetPageIndex(),l=!1}))}}else e._queue((()=>{n=!0}))},e.setPagination=n=>null==e.options.onPaginationChange?void 0:e.options.onPaginationChange((e=>t(n,e))),e.resetPagination=t=>{var n;e.setPagination(t?{pageIndex:0,pageSize:10}:null!=(n=e.initialState.pagination)?n:{pageIndex:0,pageSize:10})},e.setPageIndex=n=>{e.setPagination((l=>{let o=t(n,l.pageIndex);const i=void 0===e.options.pageCount||-1===e.options.pageCount?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,i)),{...l,pageIndex:o}}))},e.resetPageIndex=t=>{var n,l;e.setPageIndex(t?0:null!=(n=null==(l=e.initialState)||null==(l=l.pagination)?void 0:l.pageIndex)?n:0)},e.resetPageSize=t=>{var n,l;e.setPageSize(t?10:null!=(n=null==(l=e.initialState)||null==(l=l.pagination)?void 0:l.pageSize)?n:10)},e.setPageSize=n=>{e.setPagination((e=>{const l=Math.max(1,t(n,e.pageSize)),o=e.pageSize*e.pageIndex,i=Math.floor(o/l);return{...e,pageIndex:i,pageSize:l}}))},e.setPageCount=n=>e.setPagination((l=>{var o;let i=t(n,null!=(o=e.options.pageCount)?o:-1);return"number"==typeof i&&(i=Math.max(-1,i)),{...l,pageCount:i}})),e.getPageOptions=r((()=>[e.getPageCount()]),(e=>{let t=[];return e&&e>0&&(t=[...new Array(e)].fill(null).map(((e,t)=>t))),t}),u(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return-1===n||0!==n&&t<n-1},e.previousPage=()=>e.setPageIndex((e=>e-1)),e.nextPage=()=>e.setPageIndex((e=>e+1)),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var t;return null!=(t=e.options.pageCount)?t:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var t;return null!=(t=e.options.rowCount)?t:e.getPrePaginationRowModel().rows.length}}},U={getInitialState:e=>({rowPinning:{top:[],bottom:[]},...e}),getDefaultOptions:e=>({onRowPinningChange:n("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,l,o)=>{const i=l?e.getLeafRows().map((e=>{let{id:t}=e;return t})):[],r=o?e.getParentRows().map((e=>{let{id:t}=e;return t})):[],u=new Set([...r,e.id,...i]);t.setRowPinning((e=>{var t,l,o,i,r,a;return"bottom"===n?{top:(null!=(o=null==e?void 0:e.top)?o:[]).filter((e=>!(null!=u&&u.has(e)))),bottom:[...(null!=(i=null==e?void 0:e.bottom)?i:[]).filter((e=>!(null!=u&&u.has(e)))),...Array.from(u)]}:"top"===n?{top:[...(null!=(r=null==e?void 0:e.top)?r:[]).filter((e=>!(null!=u&&u.has(e)))),...Array.from(u)],bottom:(null!=(a=null==e?void 0:e.bottom)?a:[]).filter((e=>!(null!=u&&u.has(e))))}:{top:(null!=(t=null==e?void 0:e.top)?t:[]).filter((e=>!(null!=u&&u.has(e)))),bottom:(null!=(l=null==e?void 0:e.bottom)?l:[]).filter((e=>!(null!=u&&u.has(e))))}}))},e.getCanPin=()=>{var n;const{enableRowPinning:l,enablePinning:o}=t.options;return"function"==typeof l?l(e):null==(n=null!=l?l:o)||n},e.getIsPinned=()=>{const n=[e.id],{top:l,bottom:o}=t.getState().rowPinning,i=n.some((e=>null==l?void 0:l.includes(e))),r=n.some((e=>null==o?void 0:o.includes(e)));return i?"top":!!r&&"bottom"},e.getPinnedIndex=()=>{var n,l;const o=e.getIsPinned();if(!o)return-1;const i=null==(n=t._getPinnedRows(o))?void 0:n.map((e=>{let{id:t}=e;return t}));return null!=(l=null==i?void 0:i.indexOf(e.id))?l:-1}},createTable:e=>{e.setRowPinning=t=>null==e.options.onRowPinningChange?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,l;return e.setRowPinning(t?{top:[],bottom:[]}:null!=(n=null==(l=e.initialState)?void 0:l.rowPinning)?n:{top:[],bottom:[]})},e.getIsSomeRowsPinned=t=>{var n;const l=e.getState().rowPinning;var o,i;return t?Boolean(null==(n=l[t])?void 0:n.length):Boolean((null==(o=l.top)?void 0:o.length)||(null==(i=l.bottom)?void 0:i.length))},e._getPinnedRows=r((t=>[e.getRowModel().rows,e.getState().rowPinning[t],t]),((t,n,l)=>{var o;return(null==(o=e.options.keepPinnedRows)||o?(null!=n?n:[]).map((t=>{const n=e.getRow(t,!0);return n.getIsAllParentsExpanded()?n:null})):(null!=n?n:[]).map((e=>t.find((t=>t.id===e))))).filter(Boolean).map((e=>({...e,position:l})))}),u(e.options,"debugRows")),e.getTopRows=()=>e._getPinnedRows("top"),e.getBottomRows=()=>e._getPinnedRows("bottom"),e.getCenterRows=r((()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom]),((e,t,n)=>{const l=new Set([...null!=t?t:[],...null!=n?n:[]]);return e.filter((e=>!l.has(e.id)))}),u(e.options,"debugRows"))}},j={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:n("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>null==e.options.onRowSelectionChange?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:null!=(n=e.initialState.rowSelection)?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection((n=>{t=void 0!==t?t:!e.getIsAllRowsSelected();const l={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach((e=>{e.getCanSelect()&&(l[e.id]=!0)})):o.forEach((e=>{delete l[e.id]})),l}))},e.toggleAllPageRowsSelected=t=>e.setRowSelection((n=>{const l=void 0!==t?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach((t=>{$(o,t.id,l,!0,e)})),o})),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=r((()=>[e.getState().rowSelection,e.getCoreRowModel()]),((t,n)=>Object.keys(t).length?X(e,n):{rows:[],flatRows:[],rowsById:{}}),u(e.options,"debugTable")),e.getFilteredSelectedRowModel=r((()=>[e.getState().rowSelection,e.getFilteredRowModel()]),((t,n)=>Object.keys(t).length?X(e,n):{rows:[],flatRows:[],rowsById:{}}),u(e.options,"debugTable")),e.getGroupedSelectedRowModel=r((()=>[e.getState().rowSelection,e.getSortedRowModel()]),((t,n)=>Object.keys(t).length?X(e,n):{rows:[],flatRows:[],rowsById:{}}),u(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let l=Boolean(t.length&&Object.keys(n).length);return l&&t.some((e=>e.getCanSelect()&&!n[e.id]))&&(l=!1),l},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter((e=>e.getCanSelect())),{rowSelection:n}=e.getState();let l=!!t.length;return l&&t.some((e=>!n[e.id]))&&(l=!1),l},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys(null!=(t=e.getState().rowSelection)?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return!e.getIsAllPageRowsSelected()&&t.filter((e=>e.getCanSelect())).some((e=>e.getIsSelected()||e.getIsSomeSelected()))},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,l)=>{const o=e.getIsSelected();t.setRowSelection((i=>{var r;if(n=void 0!==n?n:!o,e.getCanSelect()&&o===n)return i;const u={...i};return $(u,e.id,n,null==(r=null==l?void 0:l.selectChildren)||r,t),u}))},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return K(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return"some"===J(e,n)},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return"all"===J(e,n)},e.getCanSelect=()=>{var n;return"function"==typeof t.options.enableRowSelection?t.options.enableRowSelection(e):null==(n=t.options.enableRowSelection)||n},e.getCanSelectSubRows=()=>{var n;return"function"==typeof t.options.enableSubRowSelection?t.options.enableSubRowSelection(e):null==(n=t.options.enableSubRowSelection)||n},e.getCanMultiSelect=()=>{var n;return"function"==typeof t.options.enableMultiRowSelection?t.options.enableMultiRowSelection(e):null==(n=t.options.enableMultiRowSelection)||n},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return n=>{var l;t&&e.toggleSelected(null==(l=n.target)?void 0:l.checked)}}}},$=(e,t,n,l,o)=>{var i;const r=o.getRow(t,!0);n?(r.getCanMultiSelect()||Object.keys(e).forEach((t=>delete e[t])),r.getCanSelect()&&(e[t]=!0)):delete e[t],l&&null!=(i=r.subRows)&&i.length&&r.getCanSelectSubRows()&&r.subRows.forEach((t=>$(e,t.id,n,l,o)))};function X(e,t){const n=e.getState().rowSelection,l=[],o={},i=function(e,t){return e.map((e=>{var t;const r=K(e,n);if(r&&(l.push(e),o[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:l,rowsById:o}}function K(e,t){var n;return null!=(n=t[e.id])&&n}function J(e,t,n){var l;if(null==(l=e.subRows)||!l.length)return!1;let o=!0,i=!1;return e.subRows.forEach((e=>{if((!i||o)&&(e.getCanSelect()&&(K(e,t)?i=!0:o=!1),e.subRows&&e.subRows.length)){const n=J(e,t);"all"===n?i=!0:"some"===n?(i=!0,o=!1):o=!1}})),o?"all":!!i&&"some"}const Q=/([0-9]+)/gm;function W(e,t){return e===t?0:e>t?1:-1}function Y(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function Z(e,t){const n=e.split(Q).filter(Boolean),l=t.split(Q).filter(Boolean);for(;n.length&&l.length;){const e=n.shift(),t=l.shift(),o=parseInt(e,10),i=parseInt(t,10),r=[o,i].sort();if(isNaN(r[0])){if(e>t)return 1;if(t>e)return-1}else{if(isNaN(r[1]))return isNaN(o)?-1:1;if(o>i)return 1;if(i>o)return-1}}return n.length-l.length}const ee={alphanumeric:(e,t,n)=>Z(Y(e.getValue(n)).toLowerCase(),Y(t.getValue(n)).toLowerCase()),alphanumericCaseSensitive:(e,t,n)=>Z(Y(e.getValue(n)),Y(t.getValue(n))),text:(e,t,n)=>W(Y(e.getValue(n)).toLowerCase(),Y(t.getValue(n)).toLowerCase()),textCaseSensitive:(e,t,n)=>W(Y(e.getValue(n)),Y(t.getValue(n))),datetime:(e,t,n)=>{const l=e.getValue(n),o=t.getValue(n);return l>o?1:l<o?-1:0},basic:(e,t,n)=>W(e.getValue(n),t.getValue(n))},te={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:n("sorting",e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let l=!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 ee.datetime;if("string"==typeof n&&(l=!0,n.split(Q).length>1))return ee.alphanumeric}return l?ee.text:ee.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return"string"==typeof(null==n?void 0:n.getValue(e.id))?"asc":"desc"},e.getSortingFn=()=>{var n,o;if(!e)throw new Error;return l(e.columnDef.sortingFn)?e.columnDef.sortingFn:"auto"===e.columnDef.sortingFn?e.getAutoSortingFn():null!=(n=null==(o=t.options.sortingFns)?void 0:o[e.columnDef.sortingFn])?n:ee[e.columnDef.sortingFn]},e.toggleSorting=(n,l)=>{const o=e.getNextSortingOrder(),i=null!=n;t.setSorting((r=>{const u=null==r?void 0:r.find((t=>t.id===e.id)),a=null==r?void 0:r.findIndex((t=>t.id===e.id));let s,g=[],d=i?n:"desc"===o;var c;(s=null!=r&&r.length&&e.getCanMultiSort()&&l?u?"toggle":"add":null!=r&&r.length&&a!==r.length-1?"replace":u?"toggle":"replace","toggle"===s&&(i||o||(s="remove")),"add"===s)?(g=[...r,{id:e.id,desc:d}],g.splice(0,g.length-(null!=(c=t.options.maxMultiSortColCount)?c:Number.MAX_SAFE_INTEGER))):g="toggle"===s?r.map((t=>t.id===e.id?{...t,desc:d}:t)):"remove"===s?r.filter((t=>t.id!==e.id)):[{id:e.id,desc:d}];return g}))},e.getFirstSortDir=()=>{var n,l;return(null!=(n=null!=(l=e.columnDef.sortDescFirst)?l:t.options.sortDescFirst)?n:"desc"===e.getAutoSortDir())?"desc":"asc"},e.getNextSortingOrder=n=>{var l,o;const i=e.getFirstSortDir(),r=e.getIsSorted();return r?!!(r===i||null!=(l=t.options.enableSortingRemoval)&&!l||n&&null!=(o=t.options.enableMultiRemove)&&!o)&&("desc"===r?"asc":"desc"):i},e.getCanSort=()=>{var n,l;return(null==(n=e.columnDef.enableSorting)||n)&&(null==(l=t.options.enableSorting)||l)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,l;return null!=(n=null!=(l=e.columnDef.enableMultiSort)?l:t.options.enableMultiSort)?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const l=null==(n=t.getState().sorting)?void 0:n.find((t=>t.id===e.id));return!!l&&(l.desc?"desc":"asc")},e.getSortIndex=()=>{var n,l;return null!=(n=null==(l=t.getState().sorting)?void 0:l.findIndex((t=>t.id===e.id)))?n:-1},e.clearSorting=()=>{t.setSorting((t=>null!=t&&t.length?t.filter((t=>t.id!==e.id)):[]))},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return l=>{n&&(null==l.persist||l.persist(),null==e.toggleSorting||e.toggleSorting(void 0,!!e.getCanMultiSort()&&(null==t.options.isMultiSortEvent?void 0:t.options.isMultiSortEvent(l))))}}},createTable:e=>{e.setSorting=t=>null==e.options.onSortingChange?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,l;e.setSorting(t?[]:null!=(n=null==(l=e.initialState)?void 0:l.sorting)?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},ne=[c,B,G,z,m,P,q,te,y,k,N,U,j,D];function le(e){const t=[],n=e=>{var l;t.push(e),null!=(l=e.subRows)&&l.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function oe(e,t,n){return n.options.filterFromLeafRows?function(e,t,n){var l;const o=[],i={},r=null!=(l=n.options.maxLeafRowFilterDepth)?l:100,u=function(e,l){void 0===l&&(l=0);const a=[];for(let g=0;g<e.length;g++){var s;let d=e[g];const c=f(n,d.id,d.original,d.index,d.depth,void 0,d.parentId);if(c.columnFilters=d.columnFilters,null!=(s=d.subRows)&&s.length&&l<r){if(c.subRows=u(d.subRows,l+1),d=c,t(d)&&!c.subRows.length){a.push(d),i[d.id]=d,o.push(d);continue}if(t(d)||c.subRows.length){a.push(d),i[d.id]=d,o.push(d);continue}}else d=c,t(d)&&(a.push(d),i[d.id]=d,o.push(d))}return a};return{rows:u(e),flatRows:o,rowsById:i}}(e,t,n):function(e,t,n){var l;const o=[],i={},r=null!=(l=n.options.maxLeafRowFilterDepth)?l:100,u=function(e,l){void 0===l&&(l=0);const a=[];for(let g=0;g<e.length;g++){let d=e[g];if(t(d)){var s;if(null!=(s=d.subRows)&&s.length&&l<r){const e=f(n,d.id,d.original,d.index,d.depth,void 0,d.parentId);e.subRows=u(d.subRows,l+1),d=e}a.push(d),o.push(d),i[d.id]=d}}return a};return{rows:u(e),flatRows:o,rowsById:i}}(e,t,n)}e.ColumnFaceting=m,e.ColumnFiltering=P,e.ColumnGrouping=y,e.ColumnOrdering=G,e.ColumnPinning=z,e.ColumnSizing=D,e.ColumnVisibility=B,e.GlobalFiltering=q,e.Headers=c,e.RowExpanding=k,e.RowPagination=N,e.RowPinning=U,e.RowSelection=j,e.RowSorting=te,e._getVisibleLeafColumns=T,e.aggregationFns=_,e.buildHeaderGroups=p,e.createCell=a,e.createColumn=s,e.createColumnHelper=function(){return{accessor:(e,t)=>"function"==typeof e?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}},e.createRow=f,e.createTable=function(e){var n,l;const o=[...ne,...null!=(n=e._features)?n:[]];let i={_features:o};const a=i._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultOptions?void 0:t.getDefaultOptions(i))),{});let g={...null!=(l=e.initialState)?l:{}};i._features.forEach((e=>{var t;g=null!=(t=null==e.getInitialState?void 0:e.getInitialState(g))?t:g}));const d=[];let c=!1;const p={_features:o,options:{...a,...e},initialState:g,_queue:e=>{d.push(e),c||(c=!0,Promise.resolve().then((()=>{for(;d.length;)d.shift()();c=!1})).catch((e=>setTimeout((()=>{throw e})))))},reset:()=>{i.setState(i.initialState)},setOptions:e=>{const n=t(e,i.options);i.options=(e=>i.options.mergeOptions?i.options.mergeOptions(a,e):{...a,...e})(n)},getState:()=>i.options.state,setState:e=>{null==i.options.onStateChange||i.options.onStateChange(e)},_getRowId:(e,t,n)=>{var l;return null!=(l=null==i.options.getRowId?void 0:i.options.getRowId(e,t,n))?l:`${n?[n.id,t].join("."):t}`},getCoreRowModel:()=>(i._getCoreRowModel||(i._getCoreRowModel=i.options.getCoreRowModel(i)),i._getCoreRowModel()),getRowModel:()=>i.getPaginationRowModel(),getRow:(e,t)=>{let n=(t?i.getPrePaginationRowModel():i.getRowModel()).rowsById[e];if(!n&&(n=i.getCoreRowModel().rowsById[e],!n))throw new Error;return n},_getDefaultColumnDef:r((()=>[i.options.defaultColumn]),(e=>{var t;return e=null!=(t=e)?t:{},{header:e=>{const t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t,n;return null!=(t=null==(n=e.renderValue())||null==n.toString?void 0:n.toString())?t:null},...i._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultColumnDef?void 0:t.getDefaultColumnDef())),{}),...e}}),u(e,"debugColumns")),_getColumnDefs:()=>i.options.columns,getAllColumns:r((()=>[i._getColumnDefs()]),(e=>{const t=function(e,n,l){return void 0===l&&(l=0),e.map((e=>{const o=s(i,e,l,n),r=e;return o.columns=r.columns?t(r.columns,o,l+1):[],o}))};return t(e)}),u(e,"debugColumns")),getAllFlatColumns:r((()=>[i.getAllColumns()]),(e=>e.flatMap((e=>e.getFlatColumns()))),u(e,"debugColumns")),_getAllFlatColumnsById:r((()=>[i.getAllFlatColumns()]),(e=>e.reduce(((e,t)=>(e[t.id]=t,e)),{})),u(e,"debugColumns")),getAllLeafColumns:r((()=>[i.getAllColumns(),i._getOrderColumnsFn()]),((e,t)=>t(e.flatMap((e=>e.getLeafColumns())))),u(e,"debugColumns")),getColumn:e=>i._getAllFlatColumnsById()[e]};Object.assign(i,p);for(let e=0;e<i._features.length;e++){const t=i._features[e];null==t||null==t.createTable||t.createTable(i)}return i},e.defaultColumnSizing=A,e.expandRows=le,e.filterFns=V,e.flattenBy=i,e.functionalUpdate=t,e.getCoreRowModel=function(){return e=>r((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],rowsById:{}},l=function(t,o,i){void 0===o&&(o=0);const r=[];for(let a=0;a<t.length;a++){const s=f(e,e._getRowId(t[a],a,i),t[a],a,o,void 0,null==i?void 0:i.id);var u;if(n.flatRows.push(s),n.rowsById[s.id]=s,r.push(s),e.options.getSubRows)s.originalSubRows=e.options.getSubRows(t[a],a),null!=(u=s.originalSubRows)&&u.length&&(s.subRows=l(s.originalSubRows,o+1,s))}return r};return n.rows=l(t),n}),u(e.options,"debugTable",0,(()=>e._autoResetPageIndex())))},e.getExpandedRowModel=function(){return e=>r((()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows]),((e,t,n)=>!t.rows.length||!0!==e&&!Object.keys(null!=e?e:{}).length?t:n?le(t):t),u(e.options,"debugTable"))},e.getFacetedMinMaxValues=function(){return(e,t)=>r((()=>{var n;return[null==(n=e.getColumn(t))?void 0:n.getFacetedRowModel()]}),(e=>{var n;if(!e)return;const l=null==(n=e.flatRows[0])?void 0:n.getUniqueValues(t);if(void 0===l)return;let o=[l,l];for(let n=0;n<e.flatRows.length;n++){const l=e.flatRows[n].getUniqueValues(t);for(let e=0;e<l.length;e++){const t=l[e];t<o[0]?o[0]=t:t>o[1]&&(o[1]=t)}}return o}),u(e.options,"debugTable"))},e.getFacetedRowModel=function(){return(e,t)=>r((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()]),((n,l,o)=>{if(!n.rows.length||(null==l||!l.length)&&!o)return n;const i=[...l.map((e=>e.id)).filter((e=>e!==t)),o?"__global__":void 0].filter(Boolean);return oe(n.rows,(e=>{for(let t=0;t<i.length;t++)if(!1===e.columnFilters[i[t]])return!1;return!0}),e)}),u(e.options,"debugTable"))},e.getFacetedUniqueValues=function(){return(e,t)=>r((()=>{var n;return[null==(n=e.getColumn(t))?void 0:n.getFacetedRowModel()]}),(e=>{if(!e)return new Map;let n=new Map;for(let o=0;o<e.flatRows.length;o++){const i=e.flatRows[o].getUniqueValues(t);for(let e=0;e<i.length;e++){const t=i[e];var l;if(n.has(t))n.set(t,(null!=(l=n.get(t))?l:0)+1);else n.set(t,1)}}return n}),u(e.options,"debugTable"))},e.getFilteredRowModel=function(){return e=>r((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter]),((t,n,l)=>{if(!t.rows.length||(null==n||!n.length)&&!l){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}const o=[],i=[];(null!=n?n:[]).forEach((t=>{var n;const l=e.getColumn(t.id);if(!l)return;const i=l.getFilterFn();i&&o.push({id:t.id,filterFn:i,resolvedValue:null!=(n=null==i.resolveFilterValue?void 0:i.resolveFilterValue(t.value))?n:t.value})}));const r=n.map((e=>e.id)),u=e.getGlobalFilterFn(),a=e.getAllLeafColumns().filter((e=>e.getCanGlobalFilter()));let s,g;l&&u&&a.length&&(r.push("__global__"),a.forEach((e=>{var t;i.push({id:e.id,filterFn:u,resolvedValue:null!=(t=null==u.resolveFilterValue?void 0:u.resolveFilterValue(l))?t:l})})));for(let e=0;e<t.flatRows.length;e++){const n=t.flatRows[e];if(n.columnFilters={},o.length)for(let e=0;e<o.length;e++){s=o[e];const t=s.id;n.columnFilters[t]=s.filterFn(n,t,s.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 oe(t.rows,(e=>{for(let t=0;t<r.length;t++)if(!1===e.columnFilters[r[t]])return!1;return!0}),e)}),u(e.options,"debugTable",0,(()=>e._autoResetPageIndex())))},e.getGroupedRowModel=function(){return e=>r((()=>[e.getState().grouping,e.getPreGroupedRowModel()]),((t,n)=>{if(!n.rows.length||!t.length)return n;const l=t.filter((t=>e.getColumn(t))),o=[],r={},u=function(t,n,a){if(void 0===n&&(n=0),n>=l.length)return t.map((e=>(e.depth=n,o.push(e),r[e.id]=e,e.subRows&&(e.subRows=u(e.subRows,n+1,e.id)),e)));const s=l[n],g=function(e,t){const n=new Map;return e.reduce(((e,n)=>{const l=`${n.getGroupingValue(t)}`,o=e.get(l);return o?o.push(n):e.set(l,[n]),e}),n)}(t,s),d=Array.from(g.entries()).map(((t,g)=>{let[d,c]=t,p=`${s}:${d}`;p=a?`${a}>${p}`:p;const m=u(c,n+1,p),w=n?i(c,(e=>e.subRows)):c,h=f(e,p,w[0].original,g,n,void 0,a);return Object.assign(h,{groupingColumnId:s,groupingValue:d,subRows:m,leafRows:w,getValue:t=>{if(l.includes(t)){if(h._valuesCache.hasOwnProperty(t))return h._valuesCache[t];var n;if(c[0])h._valuesCache[t]=null!=(n=c[0].getValue(t))?n:void 0;return h._valuesCache[t]}if(h._groupingValuesCache.hasOwnProperty(t))return h._groupingValuesCache[t];const o=e.getColumn(t),i=null==o?void 0:o.getAggregationFn();return i?(h._groupingValuesCache[t]=i(t,w,c),h._groupingValuesCache[t]):void 0}}),m.forEach((e=>{o.push(e),r[e.id]=e})),h}));return d},a=u(n.rows,0);return a.forEach((e=>{o.push(e),r[e.id]=e})),{rows:a,flatRows:o,rowsById:r}}),u(e.options,"debugTable",0,(()=>{e._queue((()=>{e._autoResetExpanded(),e._autoResetPageIndex()}))})))},e.getMemoOptions=u,e.getPaginationRowModel=function(e){return e=>r((()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded]),((t,n)=>{if(!n.rows.length)return n;const{pageSize:l,pageIndex:o}=t;let{rows:i,flatRows:r,rowsById:u}=n;const a=l*o,s=a+l;let g;i=i.slice(a,s),g=e.options.paginateExpandedRows?{rows:i,flatRows:r,rowsById:u}:le({rows:i,flatRows:r,rowsById:u}),g.flatRows=[];const d=e=>{g.flatRows.push(e),e.subRows.length&&e.subRows.forEach(d)};return g.rows.forEach(d),g}),u(e.options,"debugTable"))},e.getSortedRowModel=function(){return e=>r((()=>[e.getState().sorting,e.getPreSortedRowModel()]),((t,n)=>{if(!n.rows.length||null==t||!t.length)return n;const l=e.getState().sorting,o=[],i=l.filter((t=>{var n;return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()})),r={};i.forEach((t=>{const n=e.getColumn(t.id);n&&(r[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})}));const u=e=>{const t=e.map((e=>({...e})));return t.sort(((e,t)=>{for(let l=0;l<i.length;l+=1){var n;const o=i[l],u=r[o.id],a=null!=(n=null==o?void 0:o.desc)&&n;let s=0;if(u.sortUndefined){const n=void 0===e.getValue(o.id),l=void 0===t.getValue(o.id);(n||l)&&(s=n&&l?0:n?u.sortUndefined:-u.sortUndefined)}if(0===s&&(s=u.sortingFn(e,t,o.id)),0!==s)return a&&(s*=-1),u.invertSorting&&(s*=-1),s}return e.index-t.index})),t.forEach((e=>{var t;o.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=u(e.subRows))})),t};return{rows:u(n.rows),flatRows:o,rowsById:n.rowsById}}),u(e.options,"debugTable",0,(()=>e._autoResetPageIndex())))},e.isFunction=l,e.isNumberArray=o,e.isRowSelected=K,e.isSubRowSelected=J,e.makeStateUpdater=n,e.memo=r,e.noop=function(){},e.orderColumns=E,e.passiveEventSupported=H,e.reSplitAlphaNumeric=Q,e.selectRowsFn=X,e.shouldAutoRemoveFilter=x,e.sortingFns=ee})); | ||
//# sourceMappingURL=index.production.js.map |
{ | ||
"name": "@tanstack/table-core", | ||
"version": "8.13.2", | ||
"version": "8.14.0", | ||
"description": "Headless UI for building powerful tables & datagrids for TS/JS.", | ||
@@ -5,0 +5,0 @@ "author": "Tanner Linsley", |
@@ -1,2 +0,2 @@ | ||
import { AggregationFn } from './features/Grouping' | ||
import { AggregationFn } from './features/ColumnGrouping' | ||
import { isNumberArray } from './utils' | ||
@@ -3,0 +3,0 @@ |
@@ -160,7 +160,7 @@ import { | ||
for (const feature of table._features) { | ||
feature.createColumn?.(column, table) | ||
feature.createColumn?.(column as Column<TData, TValue>, table) | ||
} | ||
// Yes, we have to convert table to uknown, because we know more than the compiler here. | ||
// Yes, we have to convert table to unknown, because we know more than the compiler here. | ||
return column as Column<TData, TValue> | ||
} |
@@ -1,4 +0,10 @@ | ||
import { RowData, Column, Header, HeaderGroup, Table } from '../types' | ||
import { | ||
RowData, | ||
Column, | ||
Header, | ||
HeaderGroup, | ||
Table, | ||
TableFeature, | ||
} from '../types' | ||
import { getMemoOptions, memo } from '../utils' | ||
import { TableFeature } from './table' | ||
@@ -253,3 +259,3 @@ const debug = 'debugHeaders' | ||
table._features.forEach(feature => { | ||
feature.createHeader?.(header, table) | ||
feature.createHeader?.(header as Header<TData, TValue>, table) | ||
}) | ||
@@ -256,0 +262,0 @@ |
@@ -197,3 +197,3 @@ import { RowData, Cell, Row, Table } from '../types' | ||
const feature = table._features[i] | ||
feature?.createRow?.(row, table) | ||
feature?.createRow?.(row as Row<TData>, table) | ||
} | ||
@@ -200,0 +200,0 @@ |
@@ -18,2 +18,3 @@ import { functionalUpdate, getMemoOptions, memo, RequiredKeys } from '../utils' | ||
GroupColumnDef, | ||
TableFeature, | ||
} from '../types' | ||
@@ -26,34 +27,29 @@ | ||
import { ColumnFaceting } from '../features/ColumnFaceting' | ||
import { ColumnFiltering } from '../features/ColumnFiltering' | ||
import { ColumnGrouping } from '../features/ColumnGrouping' | ||
import { ColumnOrdering } from '../features/ColumnOrdering' | ||
import { ColumnPinning } from '../features/ColumnPinning' | ||
import { ColumnSizing } from '../features/ColumnSizing' | ||
import { Expanding } from '../features/Expanding' | ||
import { Filters } from '../features/Filters' | ||
import { Grouping } from '../features/Grouping' | ||
import { Ordering } from '../features/Ordering' | ||
import { Pagination } from '../features/Pagination' | ||
import { Pinning } from '../features/Pinning' | ||
import { ColumnVisibility } from '../features/ColumnVisibility' | ||
import { GlobalFiltering } from '../features/GlobalFiltering' | ||
import { RowExpanding } from '../features/RowExpanding' | ||
import { RowPagination } from '../features/RowPagination' | ||
import { RowPinning } from '../features/RowPinning' | ||
import { RowSelection } from '../features/RowSelection' | ||
import { Sorting } from '../features/Sorting' | ||
import { Visibility } from '../features/Visibility' | ||
import { RowSorting } from '../features/RowSorting' | ||
export interface TableFeature { | ||
createCell?: (cell: any, column: any, row: any, table: any) => any | ||
createColumn?: (column: any, table: any) => any | ||
createHeader?: (column: any, table: any) => any | ||
createRow?: (row: any, table: any) => any | ||
createTable?: (table: any) => any | ||
getDefaultColumnDef?: () => any | ||
getDefaultOptions?: (table: any) => any | ||
getInitialState?: (initialState?: InitialTableState) => any | ||
} | ||
const features = [ | ||
const builtInFeatures = [ | ||
Headers, | ||
Visibility, | ||
Ordering, | ||
Pinning, | ||
Filters, | ||
Sorting, | ||
Grouping, | ||
Expanding, | ||
Pagination, | ||
ColumnVisibility, | ||
ColumnOrdering, | ||
ColumnPinning, | ||
ColumnFaceting, | ||
ColumnFiltering, | ||
GlobalFiltering, //depends on ColumnFiltering and ColumnFaceting | ||
RowSorting, | ||
ColumnGrouping, //depends on RowSorting | ||
RowExpanding, | ||
RowPagination, | ||
RowPinning, | ||
RowSelection, | ||
@@ -69,2 +65,8 @@ ColumnSizing, | ||
/** | ||
* An array of extra features that you can add to the table instance. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#_features) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
_features?: TableFeature[] | ||
/** | ||
* Set this option to override any of the `autoReset...` feature options. | ||
@@ -285,8 +287,13 @@ * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#autoresetall) | ||
): Table<TData> { | ||
if (options.debugAll || options.debugTable) { | ||
if ( | ||
process.env.NODE_ENV !== 'production' && | ||
(options.debugAll || options.debugTable) | ||
) { | ||
console.info('Creating Table Instance...') | ||
} | ||
let table = { _features: features } as unknown as Table<TData> | ||
const _features = [...builtInFeatures, ...(options._features ?? [])] | ||
let table = { _features } as unknown as Table<TData> | ||
const defaultOptions = table._features.reduce((obj, feature) => { | ||
@@ -315,3 +322,4 @@ return Object.assign(obj, feature.getDefaultOptions?.(table)) | ||
table._features.forEach(feature => { | ||
initialState = feature.getInitialState?.(initialState) ?? initialState | ||
initialState = (feature.getInitialState?.(initialState) ?? | ||
initialState) as TableState | ||
}) | ||
@@ -323,3 +331,3 @@ | ||
const coreInstance: CoreInstance<TData> = { | ||
_features: features, | ||
_features, | ||
options: { | ||
@@ -326,0 +334,0 @@ ...defaultOptions, |
import { _getVisibleLeafColumns } from '..' | ||
import { TableFeature } from '../core/table' | ||
import { RowData, Column, Header, OnChangeFn, Table, Updater } from '../types' | ||
import { | ||
RowData, | ||
Column, | ||
Header, | ||
OnChangeFn, | ||
Table, | ||
Updater, | ||
TableFeature, | ||
} from '../types' | ||
import { getMemoOptions, makeStateUpdater, memo } from '../utils' | ||
import { ColumnPinningPosition } from './Pinning' | ||
import { ColumnPinningPosition } from './ColumnPinning' | ||
@@ -7,0 +14,0 @@ // |
@@ -1,3 +0,10 @@ | ||
import { TableFeature } from '../core/table' | ||
import { OnChangeFn, Table, Row, RowModel, Updater, RowData } from '../types' | ||
import { | ||
OnChangeFn, | ||
Table, | ||
Row, | ||
RowModel, | ||
Updater, | ||
RowData, | ||
TableFeature, | ||
} from '../types' | ||
import { getMemoOptions, makeStateUpdater, memo } from '../utils' | ||
@@ -4,0 +11,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { FilterFn } from './features/Filters' | ||
import { FilterFn } from './features/ColumnFiltering' | ||
@@ -3,0 +3,0 @@ const includesString: FilterFn<any> = ( |
@@ -1,30 +0,42 @@ | ||
export * from './core/table' | ||
//types | ||
export * from './columnHelper' | ||
export * from './types' | ||
//core | ||
export * from './core/cell' | ||
export * from './core/column' | ||
export * from './core/headers' | ||
export * from './core/row' | ||
export * from './core/cell' | ||
export * from './core/table' | ||
//features | ||
export * from './features/ColumnFaceting' | ||
export * from './features/ColumnFiltering' | ||
export * from './features/ColumnGrouping' | ||
export * from './features/ColumnOrdering' | ||
export * from './features/ColumnPinning' | ||
export * from './features/ColumnSizing' | ||
export * from './features/Expanding' | ||
export * from './features/Filters' | ||
export * from './features/Grouping' | ||
export * from './features/Ordering' | ||
export * from './features/Pagination' | ||
export * from './features/Pinning' | ||
export * from './features/ColumnVisibility' | ||
export * from './features/GlobalFiltering' | ||
export * from './features/RowExpanding' | ||
export * from './features/RowPagination' | ||
export * from './features/RowPinning' | ||
export * from './features/RowSelection' | ||
export * from './features/Sorting' | ||
export * from './features/Visibility' | ||
export * from './filterFns' | ||
export * from './sortingFns' | ||
export * from './aggregationFns' | ||
export * from './columnHelper' | ||
export * from './features/RowSorting' | ||
//utils | ||
export * from './utils' | ||
export * from './utils/getCoreRowModel' | ||
export * from './utils/getFilteredRowModel' | ||
export * from './utils/getExpandedRowModel' | ||
export * from './utils/getFacetedMinMaxValues' | ||
export * from './utils/getFacetedRowModel' | ||
export * from './utils/getFacetedUniqueValues' | ||
export * from './utils/getFacetedMinMaxValues' | ||
export * from './utils/getSortedRowModel' | ||
export * from './utils/getFilteredRowModel' | ||
export * from './utils/getGroupedRowModel' | ||
export * from './utils/getExpandedRowModel' | ||
export * from './utils/getPaginationRowModel' | ||
export * from './utils/getSortedRowModel' | ||
//fns | ||
export * from './aggregationFns' | ||
export * from './filterFns' | ||
export * from './sortingFns' |
@@ -1,2 +0,2 @@ | ||
import { SortingFn } from './features/Sorting' | ||
import { SortingFn } from './features/RowSorting' | ||
@@ -3,0 +3,0 @@ export const reSplitAlphaNumeric = /([0-9]+)/gm |
@@ -9,3 +9,3 @@ import { CoreOptions, CoreTableState, CoreInstance } from './core/table' | ||
VisibilityRow, | ||
} from './features/Visibility' | ||
} from './features/ColumnVisibility' | ||
import { | ||
@@ -16,3 +16,3 @@ ColumnOrderColumn, | ||
ColumnOrderTableState, | ||
} from './features/Ordering' | ||
} from './features/ColumnOrdering' | ||
import { | ||
@@ -25,2 +25,4 @@ ColumnPinningColumn, | ||
ColumnPinningTableState, | ||
} from './features/ColumnPinning' | ||
import { | ||
RowPinningInstance, | ||
@@ -30,3 +32,3 @@ RowPinningOptions, | ||
RowPinningTableState, | ||
} from './features/Pinning' | ||
} from './features/RowPinning' | ||
import { | ||
@@ -38,11 +40,19 @@ CoreHeader, | ||
} from './core/headers' | ||
import { FacetedColumn, FacetedOptions } from './features/ColumnFaceting' | ||
import { | ||
FiltersColumn, | ||
FiltersColumnDef, | ||
FiltersInstance, | ||
FiltersOptions, | ||
FiltersRow, | ||
FiltersTableState, | ||
} from './features/Filters' | ||
ColumnFiltersColumn, | ||
ColumnFiltersColumnDef, | ||
ColumnFiltersInstance, | ||
ColumnFiltersOptions, | ||
ColumnFiltersRow, | ||
ColumnFiltersTableState, | ||
} from './features/ColumnFiltering' | ||
import { | ||
GlobalFilterColumn, | ||
GlobalFilterColumnDef, | ||
GlobalFilterInstance, | ||
GlobalFilterOptions, | ||
GlobalFilterTableState, | ||
} from './features/GlobalFiltering' | ||
import { | ||
SortingColumn, | ||
@@ -53,3 +63,3 @@ SortingColumnDef, | ||
SortingTableState, | ||
} from './features/Sorting' | ||
} from './features/RowSorting' | ||
import { | ||
@@ -63,3 +73,3 @@ GroupingCell, | ||
GroupingTableState, | ||
} from './features/Grouping' | ||
} from './features/ColumnGrouping' | ||
import { | ||
@@ -70,3 +80,3 @@ ExpandedInstance, | ||
ExpandedRow, | ||
} from './features/Expanding' | ||
} from './features/RowExpanding' | ||
import { | ||
@@ -85,3 +95,3 @@ ColumnSizingColumn, | ||
PaginationTableState, | ||
} from './features/Pagination' | ||
} from './features/RowPagination' | ||
import { | ||
@@ -98,2 +108,20 @@ RowSelectionInstance, | ||
export interface TableFeature<TData extends RowData = any> { | ||
createCell?: ( | ||
cell: Cell<TData, unknown>, | ||
column: Column<TData>, | ||
row: Row<TData>, | ||
table: Table<TData> | ||
) => void | ||
createColumn?: (column: Column<TData, unknown>, table: Table<TData>) => void | ||
createHeader?: (header: Header<TData, unknown>, table: Table<TData>) => void | ||
createRow?: (row: Row<TData>, table: Table<TData>) => void | ||
createTable?: (table: Table<TData>) => void | ||
getDefaultColumnDef?: () => Partial<ColumnDef<TData, unknown>> | ||
getDefaultOptions?: ( | ||
table: Table<TData> | ||
) => Partial<TableOptionsResolved<TData>> | ||
getInitialState?: (initialState?: InitialTableState) => Partial<TableState> | ||
} | ||
export interface TableMeta<TData extends RowData> {} | ||
@@ -125,3 +153,4 @@ | ||
RowPinningInstance<TData>, | ||
FiltersInstance<TData>, | ||
ColumnFiltersInstance<TData>, | ||
GlobalFilterInstance<TData>, | ||
SortingInstance<TData>, | ||
@@ -139,3 +168,5 @@ GroupingInstance<TData>, | ||
RowPinningOptions<TData>, | ||
FiltersOptions<TData>, | ||
FacetedOptions<TData>, | ||
ColumnFiltersOptions<TData>, | ||
GlobalFilterOptions<TData>, | ||
SortingOptions<TData>, | ||
@@ -148,4 +179,5 @@ GroupingOptions, | ||
export type TableOptionsResolved<TData extends RowData> = CoreOptions<TData> & | ||
FeatureOptions<TData> | ||
export interface TableOptionsResolved<TData extends RowData> | ||
extends CoreOptions<TData>, | ||
FeatureOptions<TData> {} | ||
@@ -164,3 +196,4 @@ export interface TableOptions<TData extends RowData> | ||
RowPinningTableState, | ||
FiltersTableState, | ||
ColumnFiltersTableState, | ||
GlobalFilterTableState, | ||
SortingTableState, | ||
@@ -179,3 +212,4 @@ ExpandedTableState, | ||
RowPinningTableState, | ||
FiltersTableState, | ||
ColumnFiltersTableState, | ||
GlobalFilterTableState, | ||
SortingTableState, | ||
@@ -195,3 +229,3 @@ ExpandedTableState, | ||
RowPinningRow, | ||
FiltersRow<TData>, | ||
ColumnFiltersRow<TData>, | ||
GroupingRow, | ||
@@ -239,3 +273,4 @@ RowSelectionRow, | ||
ColumnPinningColumnDef, | ||
FiltersColumnDef<TData>, | ||
ColumnFiltersColumnDef<TData>, | ||
GlobalFilterColumnDef, | ||
SortingColumnDef<TData>, | ||
@@ -322,3 +357,5 @@ GroupingColumnDef<TData, TValue>, | ||
ColumnPinningColumn, | ||
FiltersColumn<TData>, | ||
FacetedColumn<TData>, | ||
ColumnFiltersColumn<TData>, | ||
GlobalFilterColumn, | ||
SortingColumn<TData>, | ||
@@ -325,0 +362,0 @@ GroupingColumn<TData>, |
@@ -1,2 +0,2 @@ | ||
import { ResolvedColumnFilter } from '../features/Filters' | ||
import { ResolvedColumnFilter } from '../features/ColumnFiltering' | ||
import { Table, RowModel, Row, RowData } from '../types' | ||
@@ -3,0 +3,0 @@ import { getMemoOptions, memo } from '../utils' |
import { Table, Row, RowModel, RowData } from '../types' | ||
import { SortingFn } from '../features/Sorting' | ||
import { SortingFn } from '../features/RowSorting' | ||
import { getMemoOptions, memo } from '../utils' | ||
@@ -4,0 +4,0 @@ |
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 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
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
3270878
148
24581
6