import Component  from '../component.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/core/src/lib/commons/ux-components/layout/ux-layout-page-column/ux-layout-page-column.component.html?at=refs%2Fheads%2Fsupport%2F7.x
    }
    /**
    * @type WebdriverIO.Element
    */
    get header() {
      let path = '//div[contains(@class,"ux-layout-page-column__header-wrapper")]';
      return this.currentPath + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get mainTitle() {
      let path = '//div[contains(@class,"ux-layout-page-column__header-title")]';
      return this.header + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get mainTitleText() {
      let path = '//div[contains(@class,"ux-layout-page-column__header-title-text")]';
      return this.mainTitle + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get mainSubTitle() {
      let path = '//*[contains(@class,"ux-layout-page-column__header-subtitle")]';
      return this.header + path;
    }
    /**
    * @type WebdriverIO.Element
    */
   get mainSubTitleText() {
    let path = '//*[contains(@class,"ux-layout-page-column__header-subtitle-text")]';
    return this.mainSubTitle + path;
  }
    /**
    * @type WebdriverIO.Element
    */
    get customHeaderRightContentPlaceholder() {
      let path = '//div[contains(@class,"ux-layout-page-column__header-right-content")]';
      return this.header + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get headerToggle() {
      return (this.header + '//div[contains(@class,"ux-layout-page-column__header-toggle")]');
    }
    /**
    * @type WebdriverIO.Element
    */
    get headerToggleIcon() {
      return (this.headerToggle + '//span[contains(@class,"ux-icon")]');
    }
    /**
    * @type boolean
    */
    async isCollapsible() {
      return await (await $(this.headerToggle)).isExisting();
    }
    /**
    * @type boolean
    */
    async isCollapsed() {
      let cl = await (await $(this.headerToggleIcon)).getAttribute('class');
      if (cl.includes('ux-icon-angle-right')) {
         return true;
      } else if (cl.includes('ux-icon-angle-left')) {
         return false;
      } else {
         throw new Error('ux-layout-page-column component object needs to be revised, ' +
         'HeaderToggleIcon is missing class');
      }
    }
    /**
    * @type boolean
    */
    async isClosable() {
      return await (await $(this.closeBtn)).isExisting();
    }

    get closeBtn() {
      return this.header + '//div[contains(@class,"ux-layout-page-column__header-close")]//span';
    }

    /**
    * @type WebdriverIO.Element
    */
    get customHeaderBodyContentPlaceholder() {
      let path = '//div[contains(@class,"ux-layout-page-column__header-body")]';
      return this.header + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get body() {
      let path = '//div[contains(@class,"ux-layout-page-column__body")]';
      return this.currentPath + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get bodyContentPlaceholder() {
      let path = '//div[contains(@class,"ux-layout-page-column__body-content")]';
      return this.body + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get customFooterContentPlaceholder() {
      let path = '//div[contains(@class,"ux-layout-page-column__footer")]';
      return this.currentPath + path;
    }
}


