"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useFilterAutoFocus = void 0;
var react_1 = require("react");
var useFilterAutoFocus = function (rowsData) {
    var attributeFilterRef = (0, react_1.useRef)(null);
    var lastAttributesCountRef = (0, react_1.useRef)(null);
    var attributesCountRef = (0, react_1.useRef)(null);
    attributesCountRef.current = rowsData.length;
    (0, react_1.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 };
};
exports.useFilterAutoFocus = useFilterAutoFocus;
