/**
 * @fileoverview added by tsickle
 * Generated from: utils/dom-util.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
/*!
 * Copyright 2020 VMware, Inc.
 * SPDX-License-Identifier: BSD-2-Clause
 */
var DomUtil = /** @class */ (function () {
    function DomUtil() {
    }
    /**
     * Scrolls view to a element so that the element becomes visible in the viewport.
     * If a css style selector is provided then the element to scroll is the html element
     * described by the css selector which parent is the provided element.
     * Id a css style selector is not provided then the element to scroll is the provided
     * element itself.
     *
     * @param elRef the view's element.
     * @param classSelector the css-style selector for the element to scroll to.
     */
    /**
     * Scrolls view to a element so that the element becomes visible in the viewport.
     * If a css style selector is provided then the element to scroll is the html element
     * described by the css selector which parent is the provided element.
     * Id a css style selector is not provided then the element to scroll is the provided
     * element itself.
     *
     * @param {?} elRef the view's element.
     * @param {?=} classSelector the css-style selector for the element to scroll to.
     * @return {?}
     */
    DomUtil.scrollToElement = /**
     * Scrolls view to a element so that the element becomes visible in the viewport.
     * If a css style selector is provided then the element to scroll is the html element
     * described by the css selector which parent is the provided element.
     * Id a css style selector is not provided then the element to scroll is the provided
     * element itself.
     *
     * @param {?} elRef the view's element.
     * @param {?=} classSelector the css-style selector for the element to scroll to.
     * @return {?}
     */
    function (elRef, classSelector) {
        if (!elRef || !elRef.nativeElement) {
            return;
        }
        /** @type {?} */
        var el = (/** @type {?} */ (elRef.nativeElement));
        /** @type {?} */
        var elementToScroll = classSelector ? el.querySelector(classSelector) : el;
        if (elementToScroll) {
            elementToScroll.scrollIntoView({ block: 'nearest', behavior: 'smooth' });
        }
    };
    return DomUtil;
}());
export { DomUtil };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZG9tLXV0aWwuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9AdmNkL3VpLWNvbXBvbmVudHMvIiwic291cmNlcyI6WyJ1dGlscy9kb20tdXRpbC50cyJdLCJuYW1lcyI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