import Component from '../../component.js'
import CoUxLayoutPageColumnHeader from './ux-layout-page-column-header.js'

export default class CoUxLayoutPageColumn extends Component {
    constructor(parent) {
      let selector = 'ux-layout-page-column';
      super(parent, selector);
      //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/src/lib/ux-components/layout/ux-layout-page-column/ux-layout-page-column.component.html
    }
    get dataE2E() {
      let path = '//div[@data-e2e="ux-layout-page-column"]';
      return this.currentPath + path;
    }
    async isClosed() {
      return !(await(await $(this.dataE2E)).isExisting());
    }
    get layoutPageColumnHeaderCO(){
      return new CoUxLayoutPageColumnHeader(this.dataE2E);
    }
    async isCollapsible() {
      return await (await $(this.dataE2E + '/self::div[contains(@class,"--collapsible")]')).isExisting();
    }
    async isCollapsed() {
      return await (await $(this.dataE2E + '/self::div[contains(@class,"--collapsed")]')).isExisting();
    }
    async isHighlighted() {
      return await (await $(this.dataE2E + '/self::div[contains(@class,"--highlighted")]')).isExisting();
    }
    async hasFooter() {
      return await (await $(this.dataE2E + '/self::div[contains(@class,"--has-footer")]')).isExisting();
    }
    async isInfiniteScrollDisabled() {
      return await (await $(this.layoutPageColumnBody)).getAttribute('isInfiniteScrollDisabled');
    }
    async isClosable() {
      return await (await $(this.dataE2E + '/self::div[contains(@class,"--closable")]')).isExisting();
    }
    get layoutPageColumnBody() {
      let path = '//div[contains(@class,"ux-layout-page-column__body")]';
      return this.dataE2E + path;
    }
    get layoutPageColumnBodyContentPlaceholder() {
      let path = '//div[contains(@class,"ux-layout-page-column__body-content")]';
      return this.layoutPageColumnBody + path;
    }
    get customFooterContentPlaceholder() {
      let path = '//div[contains(@class,"ux-layout-page-column__footer")]';
      return this.dataE2E + path;
    }
}


