var FocusUtility = /** @class */ (function () {
    function FocusUtility() {
    }
    FocusUtility.focusFirstField = function (currentForm) {
        window.setTimeout(function () {
            var focusDone = false;
            var forms = document.forms;
            for (var _i = 0, forms_1 = forms; _i < forms_1.length; _i++) {
                var form = forms_1[_i];
                if (currentForm == null || form.name !== "search") {
                    for (var _a = 0, _b = form.elements; _a < _b.length; _a++) {
                        var element = _b[_a];
                        if (element instanceof HTMLInputElement &&
                            (element.type === "text" ||
                                element.type === "number" ||
                                element.type === "textarea")) {
                            var input = element;
                            if (input.outerHTML.indexOf("readonly-with-required") < 0) { // no focus on readonly fields
                                input.focus();
                                focusDone = true;
                            }
                            break;
                        }
                    }
                    if (focusDone) {
                        break;
                    }
                }
            }
        }, 1);
    };
    return FocusUtility;
}());
export { FocusUtility };
//# sourceMappingURL=focus-utility.js.map