import { useRef, useEffect } from 'react';
export var useFilterAutoFocus = function (rowsData) {
    var attributeFilterRef = useRef(null);
    var lastAttributesCountRef = useRef(null);
    var attributesCountRef = useRef(null);
    attributesCountRef.current = rowsData.length;
    useEffect(function () {
        if (attributeFilterRef.current && lastAttributesCountRef.current !== attributesCountRef.current) {
            attributeFilterRef.current.querySelector('input').focus();
            lastAttributesCountRef.current = null;
        }
    }, [rowsData.length]);
    return { attributeFilterRef: attributeFilterRef, lastAttributesCountRef: lastAttributesCountRef, attributesCountRef: attributesCountRef };
};
