import Component from '../../component.js'
import UlComponent from '../../ul.js'
import CoUxAtoolbarFilter from './ux-a-toolbar-filter.js'
import CoUxPanel from './ux-panel.js'
import CoUxDropdownButton from './ux-dropdown-button.js'

export default class CoUxPanels extends Component {
    constructor(parent) {
      let selector = 'ux-panels';
      super(parent, selector);
      // https://webgate.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/src/lib/ux-components/ux-panel/ux-panels.component.ts
    }

    get toolbarDiv() {
      return this.currentPath + '//div[contains(@class,"ux-panel-toolbar")]';
    }

    async hasToolbar() {
      return await (await $(this.toolbarDiv)).isExisting();
    }

    get uxToolbarFilterCo() {
      return new CoUxAtoolbarFilter(this.toolbarDiv);
    }

    get uxDropdownButtonCO() {
      return new CoUxDropdownButton(this.uxToolbarFilterCo)
    }

    get ul() {
      return new UlComponent(this.currentPath);
    }

    panelCoByLabel(label) {
      return new CoUxPanel(this.ul).byAttributeEquals('label', label);
    }

}


