ChemPare Documentation - v0.0.0
    Preparing search index...

    Interface Column<TData, TValue>

    interface Column<TData extends RowData, TValue> {
        getVisibleUniqueValues: () => (string | number)[];
        getVisibleRange: () => [number, number];
        getAllUniqueValues: () => (string | number)[];
        getFullRange: () => [number, number];
        getHeaderText: () => undefined | string;
        setFilterValueDebounced: (value: TValue) => void;
        setFilterValueThrottled: (value: TValue) => void;
        setColumnVisibility: (visible: boolean) => void;
    }

    Type Parameters

    • TData extends RowData
    • TValue
    Index

    Properties

    getVisibleUniqueValues: () => (string | number)[]

    Returns a sorted array of unique values from the currently visible rows in the column. This excludes values from rows that are filtered out by other column filters.

    Type declaration

      • (): (string | number)[]
      • Returns (string | number)[]

        Array of unique string or number values, sorted in ascending order

    getVisibleRange: () => [number, number]

    Returns the minimum and maximum values from the currently visible rows in the column. This excludes values from rows that are filtered out by other column filters.

    Type declaration

      • (): [number, number]
      • Returns [number, number]

        Tuple containing [min, max] values

    getAllUniqueValues: () => (string | number)[]

    Returns a sorted array of all unique values in the column, regardless of current filters.

    Type declaration

      • (): (string | number)[]
      • Returns (string | number)[]

        Array of unique string or number values, sorted in ascending order

    getFullRange: () => [number, number]

    Returns the minimum and maximum values from all rows in the column, regardless of current filters.

    Type declaration

      • (): [number, number]
      • Returns [number, number]

        Tuple containing [min, max] values

    getHeaderText: () => undefined | string

    Returns the display text of the column header. Handles cases where the header might be a string, function, or React element.

    Type declaration

      • (): undefined | string
      • Returns undefined | string

        The header text as a string, or undefined if no header text is available

    setFilterValueDebounced: (value: TValue) => void

    Sets the filter value for the column with a 500ms debounce. Useful for text input filters to prevent excessive filtering operations.

    Type declaration

      • (value: TValue): void
      • Parameters

        • value: TValue

          The new filter value to set

        Returns void

    setFilterValueThrottled: (value: TValue) => void

    Sets the filter value for the column with a 500ms throttle. Useful for range filters to limit the frequency of filter updates.

    Type declaration

      • (value: TValue): void
      • Parameters

        • value: TValue

          The new filter value to set

        Returns void

    setColumnVisibility: (visible: boolean) => void

    Explicitly sets the visibility state of the column. Only works if the column is configured to be hideable.

    Type declaration

      • (visible: boolean): void
      • Parameters

        • visible: boolean

          Whether the column should be visible

        Returns void