@tanstack/react-table 8.14.0 → 8.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1578,6 +1578,34 @@
1578
1578
 
1579
1579
  //
1580
1580
 
1581
+ const GlobalFaceting = {
1582
+ createTable: table => {
1583
+ table._getGlobalFacetedRowModel = table.options.getFacetedRowModel && table.options.getFacetedRowModel(table, '__global__');
1584
+ table.getGlobalFacetedRowModel = () => {
1585
+ if (table.options.manualFiltering || !table._getGlobalFacetedRowModel) {
1586
+ return table.getPreFilteredRowModel();
1587
+ }
1588
+ return table._getGlobalFacetedRowModel();
1589
+ };
1590
+ table._getGlobalFacetedUniqueValues = table.options.getFacetedUniqueValues && table.options.getFacetedUniqueValues(table, '__global__');
1591
+ table.getGlobalFacetedUniqueValues = () => {
1592
+ if (!table._getGlobalFacetedUniqueValues) {
1593
+ return new Map();
1594
+ }
1595
+ return table._getGlobalFacetedUniqueValues();
1596
+ };
1597
+ table._getGlobalFacetedMinMaxValues = table.options.getFacetedMinMaxValues && table.options.getFacetedMinMaxValues(table, '__global__');
1598
+ table.getGlobalFacetedMinMaxValues = () => {
1599
+ if (!table._getGlobalFacetedMinMaxValues) {
1600
+ return;
1601
+ }
1602
+ return table._getGlobalFacetedMinMaxValues();
1603
+ };
1604
+ }
1605
+ };
1606
+
1607
+ //
1608
+
1581
1609
  const GlobalFiltering = {
1582
1610
  getInitialState: state => {
1583
1611
  return {
@@ -1611,8 +1639,7 @@
1611
1639
  const {
1612
1640
  globalFilterFn: globalFilterFn
1613
1641
  } = table.options;
1614
- return isFunction(globalFilterFn) ? globalFilterFn : globalFilterFn === 'auto' ? table.getGlobalAutoFilterFn() : // @ts-ignore
1615
- (_table$options$filter = (_table$options$filter2 = table.options.filterFns) == null ? void 0 : _table$options$filter2[globalFilterFn]) != null ? _table$options$filter : filterFns[globalFilterFn];
1642
+ return isFunction(globalFilterFn) ? globalFilterFn : globalFilterFn === 'auto' ? table.getGlobalAutoFilterFn() : (_table$options$filter = (_table$options$filter2 = table.options.filterFns) == null ? void 0 : _table$options$filter2[globalFilterFn]) != null ? _table$options$filter : filterFns[globalFilterFn];
1616
1643
  };
1617
1644
  table.setGlobalFilter = updater => {
1618
1645
  table.options.onGlobalFilterChange == null || table.options.onGlobalFilterChange(updater);
@@ -1620,27 +1647,6 @@
1620
1647
  table.resetGlobalFilter = defaultState => {
1621
1648
  table.setGlobalFilter(defaultState ? undefined : table.initialState.globalFilter);
1622
1649
  };
1623
- table._getGlobalFacetedRowModel = table.options.getFacetedRowModel && table.options.getFacetedRowModel(table, '__global__');
1624
- table.getGlobalFacetedRowModel = () => {
1625
- if (table.options.manualFiltering || !table._getGlobalFacetedRowModel) {
1626
- return table.getPreFilteredRowModel();
1627
- }
1628
- return table._getGlobalFacetedRowModel();
1629
- };
1630
- table._getGlobalFacetedUniqueValues = table.options.getFacetedUniqueValues && table.options.getFacetedUniqueValues(table, '__global__');
1631
- table.getGlobalFacetedUniqueValues = () => {
1632
- if (!table._getGlobalFacetedUniqueValues) {
1633
- return new Map();
1634
- }
1635
- return table._getGlobalFacetedUniqueValues();
1636
- };
1637
- table._getGlobalFacetedMinMaxValues = table.options.getFacetedMinMaxValues && table.options.getFacetedMinMaxValues(table, '__global__');
1638
- table.getGlobalFacetedMinMaxValues = () => {
1639
- if (!table._getGlobalFacetedMinMaxValues) {
1640
- return;
1641
- }
1642
- return table._getGlobalFacetedMinMaxValues();
1643
- };
1644
1650
  }
1645
1651
  };
1646
1652
 
@@ -2769,8 +2775,10 @@
2769
2775
  }
2770
2776
  };
2771
2777
 
2772
- const builtInFeatures = [Headers, ColumnVisibility, ColumnOrdering, ColumnPinning, ColumnFaceting, ColumnFiltering, GlobalFiltering,
2773
- //depends on ColumnFiltering and ColumnFaceting
2778
+ const builtInFeatures = [Headers, ColumnVisibility, ColumnOrdering, ColumnPinning, ColumnFaceting, ColumnFiltering, GlobalFaceting,
2779
+ //depends on ColumnFaceting
2780
+ GlobalFiltering,
2781
+ //depends on ColumnFiltering
2774
2782
  RowSorting, ColumnGrouping,
2775
2783
  //depends on RowSorting
2776
2784
  RowExpanding, RowPagination, RowPinning, RowSelection, ColumnSizing];
@@ -3605,6 +3613,7 @@
3605
3613
  exports.ColumnPinning = ColumnPinning;
3606
3614
  exports.ColumnSizing = ColumnSizing;
3607
3615
  exports.ColumnVisibility = ColumnVisibility;
3616
+ exports.GlobalFaceting = GlobalFaceting;
3608
3617
  exports.GlobalFiltering = GlobalFiltering;
3609
3618
  exports.Headers = Headers;
3610
3619
  exports.RowExpanding = RowExpanding;