@factorialco/f0-react 1.254.0 → 1.255.0

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.
@@ -1642,6 +1642,7 @@ export declare type DataCollectionSourceDefinition<R extends RecordType = Record
1642
1642
  */
1643
1643
  /** Navigation filters */
1644
1644
  navigationFilters?: NavigationFilters;
1645
+ currentNavigationFilters?: NavigationFiltersState<NavigationFilters>;
1645
1646
  /** URL for a single item in the collection */
1646
1647
  itemUrl?: (item: R) => string | undefined;
1647
1648
  /** Click handler for a single item in the collection */
@@ -1731,19 +1732,27 @@ export declare type DataSource<R extends RecordType, Filters extends FiltersDefi
1731
1732
  setCurrentFilters: React.Dispatch<React.SetStateAction<FiltersState<Filters>>>;
1732
1733
  /** Whether presets are currently loading */
1733
1734
  presetsLoading?: boolean;
1735
+ /***** SORTINGS ***************************************************/
1734
1736
  /** Current state of applied sortings */
1735
1737
  currentSortings: SortingsState<Sortings>;
1736
1738
  /** Function to update the current sortings state */
1737
1739
  setCurrentSortings: React.Dispatch<React.SetStateAction<SortingsState<Sortings>>>;
1740
+ /*******************************************************/
1741
+ /***** SEARCH ***************************************************/
1738
1742
  currentSearch: undefined | string;
1739
1743
  debouncedCurrentSearch: undefined | string;
1740
1744
  setCurrentSearch: (search: string | undefined) => void;
1745
+ /*******************************************************/
1746
+ /***** LOADING ***************************************************/
1741
1747
  isLoading: boolean;
1742
1748
  setIsLoading: (loading: boolean) => void;
1749
+ /*******************************************************/
1750
+ /***** GROUPING ***************************************************/
1743
1751
  /** Current state of applied grouping */
1744
1752
  currentGrouping?: Grouping["mandatory"] extends true ? Exclude<GroupingState<R, Grouping>, undefined> : GroupingState<R, Grouping>;
1745
1753
  /** Function to update the current grouping state */
1746
1754
  setCurrentGrouping: React.Dispatch<React.SetStateAction<GroupingState<R, Grouping>>>;
1755
+ /*******************************************************/
1747
1756
  /** Function to provide an id for a record, necessary for append mode */
1748
1757
  idProvider?: <Item extends R>(item: Item, index?: number) => string | number | symbol;
1749
1758
  /** Item filter that can be used to filter the items before they are displayed */
@@ -1764,27 +1773,42 @@ export declare type DataSource<R extends RecordType, Filters extends FiltersDefi
1764
1773
  * @template Summaries - The available summaries for the collection
1765
1774
  */
1766
1775
  export declare type DataSourceDefinition<R extends RecordType = RecordType, Filters extends FiltersDefinition = FiltersDefinition, Sortings extends SortingsDefinition = SortingsDefinition, Grouping extends GroupingDefinition<R> = GroupingDefinition<R>> = {
1776
+ /***** FILTERS ***************************************************/
1767
1777
  /** Available filter configurations */
1768
1778
  filters?: Filters;
1779
+ /** Default filters state (this is the state that the source will back on reset)*/
1780
+ defaultFilters?: FiltersState<Filters>;
1769
1781
  /** Current state of applied filters */
1770
1782
  currentFilters?: FiltersState<Filters>;
1771
1783
  /** Predefined filter configurations that can be applied */
1772
1784
  presets?: PresetsDefinition<Filters>;
1773
1785
  /** Whether presets are currently loading */
1774
1786
  presetsLoading?: boolean;
1787
+ /*******************************************************/
1788
+ /***** SEARCH ***************************************************/
1775
1789
  /** Search configuration */
1776
1790
  search?: SearchOptions;
1791
+ /*******************************************************/
1792
+ /***** SORTINGS ***************************************************/
1777
1793
  /** Available sorting fields. If not provided, sorting is not allowed. */
1778
1794
  sortings?: Sortings;
1779
- defaultSorting?: SortingsState<Sortings>;
1795
+ /** Default sorting state (this is the state that the source will back on reset)*/
1796
+ defaultSortings?: SortingsState<Sortings>;
1797
+ /** Current state of applied sortings */
1798
+ currentSortings?: SortingsState<Sortings>;
1799
+ /*******************************************************/
1780
1800
  /** Data adapter responsible for fetching and managing data */
1781
1801
  dataAdapter: DataAdapter<R, Filters>;
1782
1802
  /** Selectable items value under the checkbox column (undefined if not selectable) */
1783
1803
  selectable?: (item: R) => string | number | undefined;
1784
1804
  /** Default selected items */
1785
1805
  defaultSelectedItems?: SelectedItemsState;
1806
+ /***** GROUPING ***************************************************/
1786
1807
  /** Grouping configuration */
1787
1808
  grouping?: Grouping;
1809
+ /** Default grouping state (this is the state that the source will back on reset)*/
1810
+ defaultGrouping?: GroupingState<R, Grouping>;
1811
+ /** Current state of applied grouping */
1788
1812
  currentGrouping?: GroupingState<R, Grouping>;
1789
1813
  };
1790
1814