@ui5/webcomponents-react
Version:
React Wrapper for UI5 Web Components and additional components
21 lines (20 loc) • 1.2 kB
TypeScript
import type { ReactTableHooks } from '../types/index.js';
type onIndeterminateChange = (e: {
indeterminateRowsById: Record<string | number, boolean>;
tableInstance: Record<string, any>;
}) => void;
/**
* A plugin hook that marks parent rows as indeterminate if a child row is selected in `Multiple` mode.
* When using this hook, it is recommended to also select all sub-rows when selecting a row. (`reactTableOptions={{ selectSubRows: true }}`)
*
* __Note:__ The `indeterminate` state has a higher priority than the `selected` state. Therefore, a row can be selected and indeterminate at the same time. This can for example happen, if `selectSubRows: true` is set and a row with sub-rows is selected and then a sub-row is unselected.
*
* __Note:__ This hook has to traverse the whole data tree on each selection, which can lead to performance degradation with large datasets. Please use with caution!
*
* @param {event} onIndeterminateChange Fired when the indeterminate state of rows is changed.
*/
export declare const useIndeterminateRowSelection: (onIndeterminateChange?: onIndeterminateChange) => {
(hooks: ReactTableHooks): void;
pluginName: string;
};
export {};