import EuiBasePage from '../eui-base.po.js'
import CoEuiTable from '../../../../components/10x/eui/eui-table.js'
import CoEuiTablePaginator from '../../../../components/10x/eui/eui-table-paginator.js'
import CoEuiDropdownContent from '../../../../components/10x/eui/eui-dropdown-content.js'
import CoEuiList from '../../../../components/10x/eui/eui-list.js'
import CoEuiTableFilter from '../../../../components/10x/eui/eui-table-filter.js'
import CoEuiTableSelectableHeader from '../../../../components/10x/eui/eui-table-selectable-header.js'
import CoEuiTableSelectableRow from '../../../../components/10x/eui/eui-table-selectable-row.js'
import CoEuiTableSortableCol from '../../../../components/10x/eui/eui-table-sortable-col.js'
import CoEuiTableExpandableRow from '../../../../components/10x/eui/eui-table-expandable-row.js'
import TrComponent from '../../../../components/tr.js'

export default class EuiTablePage extends EuiBasePage {
  constructor() {
      super();
  }
  get euiTableCO() {
    return new CoEuiTable(this.mainContent);
  }
  tableFromSectionId(sectionId) {
    return new CoEuiTable(this.sectionById(sectionId));
  }
  get euiTablePaginatorCO() {
    return new CoEuiTablePaginator(this.mainContent);
  }
  tablePaginatorFromSectionId(sectionId) {
    return new CoEuiTablePaginator(this.sectionById(sectionId));
  }
  get dropdownContentCO() {
    return new CoEuiDropdownContent(this.overlay.overlayPane);
  }
  get listCO() {
    return new CoEuiList(this.dropdownContentCO);
  }
  tableFilterFromSectionId(sectionId) {
    return new CoEuiTableFilter(this.sectionById(sectionId));
  }
  tableRowCOfromSectionID(sectionId) {
    return this.tableFromSectionId(sectionId).bodyRowCO;
  }
  tableCellCOfromSectionID(sectionId) {
    return this.tableFromSectionId(sectionId).bodyCellCO;
  }
  tableSelHeaderCOfromSectionID(sectionId) {
    return new CoEuiTableSelectableHeader(this.tableFromSectionId(sectionId));
  }
  tableSelRowCOfromSectionID(sectionId) {
    return new CoEuiTableSelectableRow(this.tableFromSectionId(sectionId));
  }
  tableSortColCOfromSectionID(sectionId) {
    return new CoEuiTableSortableCol(this.tableFromSectionId(sectionId));
  }
  tableExpandableRowCOfromSectionID(sectionId) {
    return new CoEuiTableExpandableRow(this.tableFromSectionId(sectionId));
  }
  expandToggleFromTableWithSectionId(sectionId, index) {
    return new TrComponent(this.tableFromSectionId(sectionId)).byIndex(index).currentPath + '//td[contains(@class, "expandable-row__toggler")]';
  }
}

