/**
 * @fileoverview added by tsickle
 * Generated from: utils/test/datagrid/datagrid.wo.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import { __extends } from "tslib";
/*!
 * Copyright 2019 VMware, Inc.
 * SPDX-License-Identifier: BSD-2-Clause
 */
import { GridSelectionType } from './../../../datagrid/datagrid.component';
import { By } from '@angular/platform-browser';
import { ShowClippedTextDirective } from '../../../lib/directives/show-clipped-text.directive';
import { WidgetObject } from '../widget-object';
/** @type {?} */
var ROW_TAG = 'clr-dg-row';
/** @type {?} */
var CELL_TAG = 'clr-dg-cell';
/** @type {?} */
var COLUMN_SELECTOR = 'clr-dg-column';
/** @type {?} */
var COLUMN_CSS_SELECTOR = '.datagrid-column-title';
/** @type {?} */
var FILTER_SELECTOR = 'clr-dg-filter';
/**
 * Widget Object for a Clarity DataGrid
 */
var ClrDatagridWidgetObject = /** @class */ (function (_super) {
    __extends(ClrDatagridWidgetObject, _super);
    function ClrDatagridWidgetObject() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    /**
     * Retrieves the text content of a cell
     * @param row 0-based index of row
     * @param column 0-based index of column
     */
    /**
     * Retrieves the text content of a cell
     * @param {?} row 0-based index of row
     * @param {?} column 0-based index of column
     * @return {?}
     */
    ClrDatagridWidgetObject.prototype.getCellText = /**
     * Retrieves the text content of a cell
     * @param {?} row 0-based index of row
     * @param {?} column 0-based index of column
     * @return {?}
     */
    function (row, column) {
        return this.getNodeText(this.getCell(row, column));
    };
    /**
     * Gives the text content of all the cells in a row.
     * @param rowIndex 0-based index of row
     */
    /**
     * Gives the text content of all the cells in a row.
     * @param {?} rowIndex 0-based index of row
     * @return {?}
     */
    ClrDatagridWidgetObject.prototype.getRowValues = /**
     * Gives the text content of all the cells in a row.
     * @param {?} rowIndex 0-based index of row
     * @return {?}
     */
    function (rowIndex) {
        return this.getTexts(ROW_TAG + ":nth-of-type(" + (rowIndex + 1) + ") " + CELL_TAG);
    };
    /**
     * Gives the linked text in the given cell represented by the {@param rowIndex} and {@param columnIndex} if present.
     */
    /**
     * Gives the linked text in the given cell represented by the {\@param rowIndex} and {\@param columnIndex} if present.
     * @param {?} rowIndex
     * @param {?} columnIndex
     * @return {?}
     */
    ClrDatagridWidgetObject.prototype.getCellLink = /**
     * Gives the linked text in the given cell represented by the {\@param rowIndex} and {\@param columnIndex} if present.
     * @param {?} rowIndex
     * @param {?} columnIndex
     * @return {?}
     */
    function (rowIndex, columnIndex) {
        return this.getCell(rowIndex, columnIndex)
            .nativeElement.querySelector('a')
            .getAttribute('href');
    };
    /**
     * Retrieves if the cell will clip text
     * @param column 0-based index of column
     */
    /**
     * Retrieves if the cell will clip text
     * @param {?} column 0-based index of column
     * @return {?}
     */
    ClrDatagridWidgetObject.prototype.columnClippedTextDirective = /**
     * Retrieves if the cell will clip text
     * @param {?} column 0-based index of column
     * @return {?}
     */
    function (column) {
        /** @type {?} */
        var res = this.getCell(0, column);
        return res.injector.get(ShowClippedTextDirective);
    };
    Object.defineProperty(ClrDatagridWidgetObject.prototype, "columnCount", {
        /**
         * Returns the number of visible columns
         */
        get: /**
         * Returns the number of visible columns
         * @return {?}
         */
        function () {
            return this.component.columns ? this.component.columns.length : this.columns.length;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * Returns the text for a header
     * @param columnIndex 0-based index of header to retrieve
     */
    /**
     * Returns the text for a header
     * @param {?} columnIndex 0-based index of header to retrieve
     * @return {?}
     */
    ClrDatagridWidgetObject.prototype.getColumnHeader = /**
     * Returns the text for a header
     * @param {?} columnIndex 0-based index of header to retrieve
     * @return {?}
     */
    function (columnIndex) {
        return this.getText(COLUMN_CSS_SELECTOR + ":nth-of-type(" + (columnIndex + 1) + ")");
    };
    Object.defineProperty(ClrDatagridWidgetObject.prototype, "columnHeaders", {
        /**
         * Returns an array of the texts for columns, in DOM order
         */
        get: /**
         * Returns an array of the texts for columns, in DOM order
         * @return {?}
         */
        function () {
            return this.getTexts(COLUMN_CSS_SELECTOR);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ClrDatagridWidgetObject.prototype, "hiddenColumnHeaders", {
        /**
         * Returns an array of the texts for columns that are hidden.
         */
        get: /**
         * Returns an array of the texts for columns that are hidden.
         * @return {?}
         */
        function () {
            return this.getTexts('clr-dg-column.datagrid-hidden-column');
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ClrDatagridWidgetObject.prototype, "rowCount", {
        /**
         * Returns the number of rows currently displayed
         */
        get: /**
         * Returns the number of rows currently displayed
         * @return {?}
         */
        function () {
            return this.rows.length;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ClrDatagridWidgetObject.prototype, "loading", {
        /**
         * Says if this datagrid is loading.
         */
        get: /**
         * Says if this datagrid is loading.
         * @return {?}
         */
        function () {
            return this.component.loading;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ClrDatagridWidgetObject.prototype, "placeholder", {
        /**
         * Gives the placeholder present on the datagrid.
         */
        get: /**
         * Gives the placeholder present on the datagrid.
         * @return {?}
         */
        function () {
            return this.getText('clr-dg-placeholder');
        },
        enumerable: true,
        configurable: true
    });
    /**
     * Returns whether or not the column with the given index is displayed by the CSS.
     */
    /**
     * Returns whether or not the column with the given index is displayed by the CSS.
     * @param {?} index
     * @return {?}
     */
    ClrDatagridWidgetObject.prototype.isColumnDisplayed = /**
     * Returns whether or not the column with the given index is displayed by the CSS.
     * @param {?} index
     * @return {?}
     */
    function (index) {
        return this.findElements(COLUMN_SELECTOR)[index].classes['datagrid-hidden-column'] !== true;
    };
    /**
     * Returns the classes of the column with the given index.
     */
    /**
     * Returns the classes of the column with the given index.
     * @param {?} index
     * @return {?}
     */
    ClrDatagridWidgetObject.prototype.getColumnClasses = /**
     * Returns the classes of the column with the given index.
     * @param {?} index
     * @return {?}
     */
    function (index) {
        return Object.keys(this.findElements(COLUMN_SELECTOR)[index].classes);
    };
    Object.defineProperty(ClrDatagridWidgetObject.prototype, "gridCssClass", {
        /*
         * Returns the CSS class of the Clarity datagrid.
         */
        get: /*
             * Returns the CSS class of the Clarity datagrid.
             */
        /**
         * @return {?}
         */
        function () {
            return Object.keys(this.root.classes);
        },
        enumerable: true,
        configurable: true
    });
    /**
     * Returns the CSS class names of the given Clarity datarow.
     */
    /**
     * Returns the CSS class names of the given Clarity datarow.
     * @param {?} index
     * @return {?}
     */
    ClrDatagridWidgetObject.prototype.getRowsCssClass = /**
     * Returns the CSS class names of the given Clarity datarow.
     * @param {?} index
     * @return {?}
     */
    function (index) {
        return Object.keys(this.rows[index].classes);
    };
    /**
     * Returns the native element contents within all the detail pane open.
     */
    /**
     * Returns the native element contents within all the detail pane open.
     * @return {?}
     */
    ClrDatagridWidgetObject.prototype.getAllDetailRowContents = /**
     * Returns the native element contents within all the detail pane open.
     * @return {?}
     */
    function () {
        return this.findElements('clr-dg-row-detail').map((/**
         * @param {?} detail
         * @return {?}
         */
        function (detail) { return detail.nativeElement; }));
    };
    /**
     * Returns the native element contents within all the detail pane open.
     */
    /**
     * Returns the native element contents within all the detail pane open.
     * @return {?}
     */
    ClrDatagridWidgetObject.prototype.getAllDetailPaneContents = /**
     * Returns the native element contents within all the detail pane open.
     * @return {?}
     */
    function () {
        return this.findElements('.datagrid-detail-pane-content').map((/**
         * @param {?} detail
         * @return {?}
         */
        function (detail) { return detail.nativeElement; }));
    };
    /**
     * Returns the header of the detail pane.
     */
    /**
     * Returns the header of the detail pane.
     * @return {?}
     */
    ClrDatagridWidgetObject.prototype.getDetailPaneHeader = /**
     * Returns the header of the detail pane.
     * @return {?}
     */
    function () {
        return this.getText('.datagrid-detail-header-title');
    };
    /**
     * Clicks the given detail row button.
     */
    /**
     * Clicks the given detail row button.
     * @param {?} row
     * @return {?}
     */
    ClrDatagridWidgetObject.prototype.clickDetailRowButton = /**
     * Clicks the given detail row button.
     * @param {?} row
     * @return {?}
     */
    function (row) {
        this.detailRowButtons[row].nativeElement.click();
    };
    /**
     * Clicks the given detail pane button.
     */
    /**
     * Clicks the given detail pane button.
     * @param {?} row
     * @return {?}
     */
    ClrDatagridWidgetObject.prototype.clickDetailPaneButton = /**
     * Clicks the given detail pane button.
     * @param {?} row
     * @return {?}
     */
    function (row) {
        this.detailPaneButtons[row].nativeElement.click();
    };
    /**
     * Sorts the column at the given index.
     */
    /**
     * Sorts the column at the given index.
     * @param {?} index
     * @return {?}
     */
    ClrDatagridWidgetObject.prototype.sortColumn = /**
     * Sorts the column at the given index.
     * @param {?} index
     * @return {?}
     */
    function (index) {
        this.columns[index].nativeElement.click();
    };
    /**
     * Returns the selection type of the grid.
     */
    /**
     * Returns the selection type of the grid.
     * @return {?}
     */
    ClrDatagridWidgetObject.prototype.getSelectionType = /**
     * Returns the selection type of the grid.
     * @return {?}
     */
    function () {
        if (this.findElements('clr-checkbox-wrapper').length !== 0) {
            return GridSelectionType.Multi;
        }
        else if (this.findElements('clr-radio-wrapper').length !== 0) {
            return GridSelectionType.Single;
        }
        else {
            return GridSelectionType.None;
        }
    };
    /**
     * Clicks the selection icon on the given row.
     */
    /**
     * Clicks the selection icon on the given row.
     * @param {?} row
     * @return {?}
     */
    ClrDatagridWidgetObject.prototype.selectRow = /**
     * Clicks the selection icon on the given row.
     * @param {?} row
     * @return {?}
     */
    function (row) {
        this.click("input", this.rows[row]);
    };
    /**
     * Gives the pagination description text.
     */
    /**
     * Gives the pagination description text.
     * @return {?}
     */
    ClrDatagridWidgetObject.prototype.getPaginationDescription = /**
     * Gives the pagination description text.
     * @return {?}
     */
    function () {
        return this.findElement('.pagination-description').nativeElement.textContent;
    };
    /**
     * Gives the text next to the pagination selector.
     * Gives empty string if the size dropdown is not in the page.
     */
    /**
     * Gives the text next to the pagination selector.
     * Gives empty string if the size dropdown is not in the page.
     * @return {?}
     */
    ClrDatagridWidgetObject.prototype.getPaginationSizeSelectorText = /**
     * Gives the text next to the pagination selector.
     * Gives empty string if the size dropdown is not in the page.
     * @return {?}
     */
    function () {
        /** @type {?} */
        var sizer = this.findElement('clr-dg-page-size');
        return sizer ? sizer.nativeElement.textContent : '';
    };
    /**
     * Clicks the next page button.
     */
    /**
     * Clicks the next page button.
     * @return {?}
     */
    ClrDatagridWidgetObject.prototype.nextPage = /**
     * Clicks the next page button.
     * @return {?}
     */
    function () {
        this.click('.pagination-next');
    };
    /**
     * Gives a list of the labels of the displayed action buttons at the top of the grid.
     */
    /**
     * Gives a list of the labels of the displayed action buttons at the top of the grid.
     * @return {?}
     */
    ClrDatagridWidgetObject.prototype.getTopPositionedButtons = /**
     * Gives a list of the labels of the displayed action buttons at the top of the grid.
     * @return {?}
     */
    function () {
        return this.findElements('clr-dg-action-bar button').map((/**
         * @param {?} button
         * @return {?}
         */
        function (button) { return button.nativeElement.textContent; }));
    };
    /**
     * Gives the class of the cell that holds the row buttons.
     */
    /**
     * Gives the class of the cell that holds the row buttons.
     * @param {?} rowIndex
     * @return {?}
     */
    ClrDatagridWidgetObject.prototype.getRowButtonContainerClass = /**
     * Gives the class of the cell that holds the row buttons.
     * @param {?} rowIndex
     * @return {?}
     */
    function (rowIndex) {
        return Object.keys(this.findElement(".action-button-cell", this.rows[rowIndex]).classes);
    };
    /**
     * Gives the text of the button with the given buttonClass on the top of the datagrid.
     */
    /**
     * Gives the text of the button with the given buttonClass on the top of the datagrid.
     * @param {?} buttonClass
     * @return {?}
     */
    ClrDatagridWidgetObject.prototype.getTopButtonText = /**
     * Gives the text of the button with the given buttonClass on the top of the datagrid.
     * @param {?} buttonClass
     * @return {?}
     */
    function (buttonClass) {
        return this.getText("button." + buttonClass);
    };
    /**
     * Gives the text of the button with the given buttonClass at a row of the datagrid.
     * @param row 0-based index of row
     */
    /**
     * Gives the text of the button with the given buttonClass at a row of the datagrid.
     * @param {?} buttonClass
     * @param {?} row 0-based index of row
     * @return {?}
     */
    ClrDatagridWidgetObject.prototype.getRowButtonText = /**
     * Gives the text of the button with the given buttonClass at a row of the datagrid.
     * @param {?} buttonClass
     * @param {?} row 0-based index of row
     * @return {?}
     */
    function (buttonClass, row) {
        return this.getText("button." + buttonClass, this.rows[row]);
    };
    /**
     * Says if the button on the top of the grid with the given buttonClass is enabled.
     */
    /**
     * Says if the button on the top of the grid with the given buttonClass is enabled.
     * @param {?} buttonClass
     * @return {?}
     */
    ClrDatagridWidgetObject.prototype.isTopButtonEnabled = /**
     * Says if the button on the top of the grid with the given buttonClass is enabled.
     * @param {?} buttonClass
     * @return {?}
     */
    function (buttonClass) {
        return !this.findElement("button." + buttonClass).nativeElement.disabled;
    };
    /**
     * Says if the button at a row in the datagrid with the given buttonClass is enabled.
     * @param row 0-based index of row
     */
    /**
     * Says if the button at a row in the datagrid with the given buttonClass is enabled.
     * @param {?} buttonClass
     * @param {?} row 0-based index of row
     * @return {?}
     */
    ClrDatagridWidgetObject.prototype.isRowButtonEnabled = /**
     * Says if the button at a row in the datagrid with the given buttonClass is enabled.
     * @param {?} buttonClass
     * @param {?} row 0-based index of row
     * @return {?}
     */
    function (buttonClass, row) {
        return !this.findElement("button." + buttonClass, this.rows[row]).nativeElement.disabled;
    };
    /**
     * Presses the button with the given buttonClass on the top of the datagrid.
     */
    /**
     * Presses the button with the given buttonClass on the top of the datagrid.
     * @param {?} buttonClass
     * @return {?}
     */
    ClrDatagridWidgetObject.prototype.pressTopButton = /**
     * Presses the button with the given buttonClass on the top of the datagrid.
     * @param {?} buttonClass
     * @return {?}
     */
    function (buttonClass) {
        this.click("button." + buttonClass);
    };
    /**
     * Presses the button with the given buttonClass on a row of the datagrid.
     * @param row 0-based index of row
     */
    /**
     * Presses the button with the given buttonClass on a row of the datagrid.
     * @param {?} buttonClass
     * @param {?} row 0-based index of row
     * @return {?}
     */
    ClrDatagridWidgetObject.prototype.pressRowButton = /**
     * Presses the button with the given buttonClass on a row of the datagrid.
     * @param {?} buttonClass
     * @param {?} row 0-based index of row
     * @return {?}
     */
    function (buttonClass, row) {
        this.click("button." + buttonClass, this.rows[row]);
    };
    Object.defineProperty(ClrDatagridWidgetObject.prototype, "gridHeight", {
        /**
         * Gives the height CSS of this clr-datagrid.
         */
        get: /**
         * Gives the height CSS of this clr-datagrid.
         * @return {?}
         */
        function () {
            return this.root.parent.nativeElement.style.getPropertyValue('--datagrid-height');
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ClrDatagridWidgetObject.prototype, "gridContainerClasses", {
        /**
         * Gives the height of the grids container.
         */
        get: /**
         * Gives the height of the grids container.
         * @return {?}
         */
        function () {
            return Object.keys(this.root.parent.classes);
        },
        enumerable: true,
        configurable: true
    });
    /**
     * Can be used by subclasses to create methods that assert about HTML in custom rendered columns. Note that
     * subclasses should not return the DebugElement, they should return a string from a section of the HTML.
     *
     * @param row 0-based index of row
     * @param column 0-based index of column
     *
     * Because the custom renderer widget object requires getting the {@link DebugElement} of a cell,
     * but doesn't directly extend {@link ClrDatagridWidgetObject}, this method needs to be public.
     * This will be fixed in {@link https://jira.eng.vmware.com/browse/VDUCC-127}.
     */
    /**
     * Can be used by subclasses to create methods that assert about HTML in custom rendered columns. Note that
     * subclasses should not return the DebugElement, they should return a string from a section of the HTML.
     *
     * @param {?} row 0-based index of row
     * @param {?} column 0-based index of column
     *
     * Because the custom renderer widget object requires getting the {\@link DebugElement} of a cell,
     * but doesn't directly extend {\@link ClrDatagridWidgetObject}, this method needs to be public.
     * This will be fixed in {\@link https://jira.eng.vmware.com/browse/VDUCC-127}.
     * @return {?}
     */
    ClrDatagridWidgetObject.prototype.getCell = /**
     * Can be used by subclasses to create methods that assert about HTML in custom rendered columns. Note that
     * subclasses should not return the DebugElement, they should return a string from a section of the HTML.
     *
     * @param {?} row 0-based index of row
     * @param {?} column 0-based index of column
     *
     * Because the custom renderer widget object requires getting the {\@link DebugElement} of a cell,
     * but doesn't directly extend {\@link ClrDatagridWidgetObject}, this method needs to be public.
     * This will be fixed in {\@link https://jira.eng.vmware.com/browse/VDUCC-127}.
     * @return {?}
     */
    function (row, column) {
        return this.findElement(ROW_TAG + ":nth-of-type(" + (row + 1) + ") " + CELL_TAG + ":nth-of-type(" + (column + 1) + ")");
    };
    Object.defineProperty(ClrDatagridWidgetObject.prototype, "rows", {
        get: /**
         * @private
         * @return {?}
         */
        function () {
            return this.findElements(ROW_TAG);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ClrDatagridWidgetObject.prototype, "columns", {
        get: /**
         * @private
         * @return {?}
         */
        function () {
            return this.findElements(COLUMN_CSS_SELECTOR);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ClrDatagridWidgetObject.prototype, "detailRowButtons", {
        get: /**
         * @private
         * @return {?}
         */
        function () {
            return this.findElements('.datagrid-expandable-caret-button');
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ClrDatagridWidgetObject.prototype, "detailPaneButtons", {
        get: /**
         * @private
         * @return {?}
         */
        function () {
            return this.findElements('.datagrid-detail-caret-button');
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @private
     * @return {?}
     */
    ClrDatagridWidgetObject.prototype.openFilter = /**
     * @private
     * @return {?}
     */
    function () {
        /** @type {?} */
        var clrDgColumn = this.findElements(COLUMN_SELECTOR)[0];
        /** @type {?} */
        var filterDebugEl = this.findElement(FILTER_SELECTOR, clrDgColumn);
        this.click('.datagrid-filter-toggle', filterDebugEl);
        this.detectChanges();
    };
    /**
     * Used by the {@link createDatagridFilterTestHelper} to query for a filter component. Opens filter of first
     * column and returns the filter component.
     * @param ctor The constructor of a grid filter component
     */
    /**
     * Used by the {\@link createDatagridFilterTestHelper} to query for a filter component. Opens filter of first
     * column and returns the filter component.
     * @template V, C
     * @param {?} ctor The constructor of a grid filter component
     * @return {?}
     */
    ClrDatagridWidgetObject.prototype.getFilter = /**
     * Used by the {\@link createDatagridFilterTestHelper} to query for a filter component. Opens filter of first
     * column and returns the filter component.
     * @template V, C
     * @param {?} ctor The constructor of a grid filter component
     * @return {?}
     */
    function (ctor) {
        this.openFilter();
        return this.root.parent.parent.parent.query(By.directive(ctor)).componentInstance;
    };
    ClrDatagridWidgetObject.tagName = "clr-datagrid";
    return ClrDatagridWidgetObject;
}(WidgetObject));
export { ClrDatagridWidgetObject };
if (false) {
    /** @type {?} */
    ClrDatagridWidgetObject.tagName;
}
//# sourceMappingURL=data:application/json;base64, 