import { NumericFormatProps } from 'react-number-format'; import { EmptyStateProps } from '../ComponentTypes.models'; /** Props interface for components that support disabling nested hierarchy behavior */ export interface IgnoreNodeHierarchyProps { /** Boolean value to indicate if the nested hierarchy is disabled */ ignoreNodeHierarchy?: boolean; } export interface GenericNode { [key: string]: string | number | null | NumericFormatProps | GenericNode[]; } export declare enum CheckboxState { UNCHECKED = "UNCHECKED", CHECKED = "CHECKED", PARTIAL = "PARTIAL" } export interface DateCheckState { id: string | number; state: CheckboxState; } export interface FlattenNestedDataProps { [key: string]: string | number | null | NumericFormatProps; } type NestedMultiselectSearchProps = { query: string; identifierKeys: { displayKey: keyof DataItem; idKey: keyof DataItem; parentKey: keyof DataItem; }; setFilteredItems: React.Dispatch>; nestedConfigData: DataItem[]; toggleExpand?: (idsToExpand: string[]) => void; }; export interface TableColumnConfigProps { /** Specifies the text to be displayed in the table column header, serving as a visual label for the column's data. */ label: string; /** Defines the unique key used to retrieve the corresponding data from each row object, linking column configuration to data source. */ dataKey: string; /** Optional property that allows custom CSS styling to be applied directly to each cell in the column, */ style?: React.CSSProperties; /** A render prop function that returns a custom React component or JSX for displaying the content of each cell in the column, * providing flexibility for complex data rendering. */ children: (data: DataItem, index?: number) => React.ReactNode; } export interface NestedCheckboxProps extends IgnoreNodeHierarchyProps { /** Data to be displayed in the nested component */ data: DataItem[]; /** If there is data available to display. If false, the component will display an empty state */ hasData: boolean; /** If the data is still loading. If true, the component will display a loading state */ isLoading: boolean; /** Configuration for the table columns */ tableConfig: TableColumnConfigProps[]; /** Object containing keys to identify the data and its parent child relationship */ identifierKeys: { displayKey: string; idKey: string; parentKey: string; }; /** @deprecated - If the component should have a search bar */ isSearchable?: boolean; /** Optional search string to filter data */ search?: string; /** Custom height for the table content */ customHeight?: number | string; /** Custom width for the table component */ customWidth?: number | string; /** Function to be called when the state of the checkboxes change */ onChange: (newItemStates: DateCheckState[]) => void; /** Useful when there is no data available such as an empty search result */ noDataText?: EmptyStateProps; /** Array of objects to keep the track of selected or unselected options */ itemStates: DateCheckState[]; /** Function to set the array of selected options */ setItemStates: React.Dispatch>; /** Optional prop to add a test id for QA testing */ qaTestId?: string; } export type GroupScrollConfig = { /** Max height for each group's scrollable child container */ maxHeight?: number | string; /** Per-group scroll and pagination configuration, keyed by group item ID */ groups?: { [groupId: string | number]: { hasMore?: boolean; fetchNextPage?: () => void; isFetching?: boolean; }; }; }; export interface CheckboxListProps { items: any[]; getStateForId: (id: string | number) => CheckboxState; idsToRender?: (string | number)[]; onClick?: (id: string | number) => void; expandedItems?: { [key: string | number]: boolean; }; onToggleExpand?: (id: string | number) => void; indentLevel?: number; tableConfig: TableColumnConfigProps[]; idKey: string; parentKey: string; displayKey: string; pathKey: string; /** Optional className that can be provided for styling table row */ className?: string; /** Optional per-group scroll and infinite-scroll pagination config */ groupScrollConfig?: GroupScrollConfig; } export declare const updateItemStates: (ignoreNodeHierarchy: boolean, oldState: DateCheckState[], items: DataItem[], clickedId: string | number, idKey: keyof DataItem, parentKey: keyof DataItem) => { id: string | number; state: CheckboxState; }[]; export declare const getFlattenNestedTreeList: ({ nestedData, parentId, childrenKey, parentKey, idKey, pathId, }: { nestedData: DataItem[]; parentId?: string | number | null; childrenKey?: string; parentKey: string; idKey?: string; pathId?: string; }) => DataItem[]; export declare const debouncedSearch: ({ query, identifierKeys, setFilteredItems, nestedConfigData, toggleExpand, }: NestedMultiselectSearchProps) => void; export declare const filterItemsWithNestedSearch: (allItems: DataItem[], query: string, identifierKeys: { displayKey: keyof DataItem; idKey: keyof DataItem; parentKey: keyof DataItem; }, toggleExpand?: (idsToExpand: string[]) => void) => DataItem[]; export declare const debouncedSearchRefactored: ({ query, identifierKeys, setFilteredItems, nestedConfigData, toggleExpand, }: NestedMultiselectSearchProps) => void; /** * Toggles the expanded state of one or multiple items. * @param {string | string[]} idOrIds - The ID(s) of the item(s) to toggle or expand. * @param {React.Dispatch>} setExpandedItems - * A React state updater function to modify the expanded state of items. */ export declare const toggleExpand: (idOrIds: string | number | (string | number)[], setExpandedItems: React.Dispatch>) => void; export {};