import Component from '../../component.js'

export default class CoUxLayoutPageColumnHeader extends Component {
    constructor(parent) {
      let selector = 'div[contains(@class,"ux-layout-page-column__header-wrapper")]';
      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 header() {
      let path = '//div[contains(@class,"ux-layout-page-column__header")]';
      return this.currentPath + path;
    }
    get leftContent() {
      let path = '//div[contains(@class,"ux-layout-page-column__header-left-content")]';
      return this.header + path;
    }
    get title() {
      let path = '//div[contains(@class,"ux-layout-page-column__header-title")]';
      return this.leftContent + path;
    }
    async hasMainTitle() {
      return await (await $(this.title)).isExisting();
    }
    get titleText() {
      let path = '//div[contains(@class,"ux-layout-page-column__header-title-text")]';
      return this.title + path;
    }
    get subtitle() {
      let path = '//div[contains(@class,"ux-layout-page-column__header-subtitle-text")]';
      return this.leftContent + path;
    }
    async hasMainSubtitle() {
      return await (await $(this.subtitle)).isExisting();
    }
    get subtitleText() {
      let path = '//*[contains(@class,"ux-layout-page-column__header-subtitle-text")]';
      return this.subtitle + path;
    }
    get customHeaderRightContentPlaceholder() {
      let path = '//div[contains(@class,"ux-layout-page-column__header-right-content")]';
      return this.header + path;
    }
    async hasCustomHeaderRightContent() {
      return await (await $(this.customHeaderRightContentPlaceholder)).isExisting();
    }
    get rightIcons() {
      let path = '//div[contains(@class,"ux-layout-page-column__header-right-icons")]';
      return this.header + path;
    }
    async hasRightIcons() {
      return await (await $(this.rightIcons)).isExisting();
    }
    get toggle() {
      let path = '//div[contains(@class,"ux-layout-page-column__header-toggle")]';
      return this.rightIcons + path;
    }
    async hasToggle() {
      return await (await $(this.toggle)).isExisting();
    }
    get toggleIcon() {
      let path = '//span[contains(@class,"ux-icon-fw")]';
      return this.toggle + path;
    }
    async isCollapsed() {
      return await (await $(this.toggleIcon + '/self::*[contains(@class, "ux-icon-angle-right")]')).isExisting();
    }
    get close() {
      let path = '//div[contains(@class,"ux-layout-page-column__header-close")]';
      return this.rightIcons + path;
    }
    async isClosable() {
      return await (await $(this.close)).isExisting();
    }
    get closeIcon() {
      let path = '//span[contains(@class,"ux-icon-times")]';
      return this.close + path;
    }
    get customHeaderBodyContentPlaceholder() {
      let path = '//div[contains(@class,"ux-layout-page-column__header-body")]';
      return this.header + path;
    }
    async hasCustomHeaderBodyContent() {
      return await (await $(this.customHeaderBodyContentPlaceholder)).isExisting();
    }

}


