import Component from '../../component.js'
import CoEuiModalPickerItem from './eui-modal-picker-item.js'

export default class CoEuiModalPicker extends Component {
  constructor(parent) {
    let selector = 'div[contains(@class,"eui-modal-picker-container")]';
    super(parent, selector);
    //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components-next/src/lib/components/eui-picker/modal-picker/eui-modal-picker.component.html
  }
  get searchContainer() {
    return this.currentPath + '//div[contains(@class,"eui-modal-picker__search-container")]';
  }
  get searchInput() {
    return this.searchContainer + '//input[@formControlName="search"]';
  }
  get clear() {
    return this.searchContainer + '//span[contains(@class,"eui-clearable-input-wrapper__clear")]';
  }
  async hasClear() {
    return await (await $(this.clear)).isExisting();
  }
  get itemsContainer() {
    return this.currentPath + '//div[contains(@class,"eui-modal-picker__items-container")]';
  }
  get euiModalPickerItemCO() {
    return new CoEuiModalPickerItem(this.itemsContainer);
  }
}


