import Component from '../../component.js'
import CoUxAtoolbarFilter from './ux-a-toolbar-filter.js'
import CoUxTreeListItem from './ux-tree-list-item.js'
import { elementAttributeContains } from '../../../core/utils.js'

export default class CoUxTreeList extends Component {
    constructor(parent) {
      let selector = 'ux-tree-list';
      super(parent, selector);
     //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/src/lib/ux-components/ux-tree-list/ux-tree-list.component.html
    }
    get toolbarFilterCO() {
      return new CoUxAtoolbarFilter(this.currentPath);
    }
    get dataE2E() {
      let path = '//div[@data-e2e="ux-tree-list"]';
      return this.currentPath + path;
    }
    async hasItemsUrl() {
      return await elementAttributeContains(this.dataE2E, 'class', 'ux-tree-list--with-items-url');
    }
    async hasLeftIndent() {
      return await elementAttributeContains(this.dataE2E, 'class', 'ux-tree-list--with-left-indent');
    }
    async hasItemsBullet() {
      return await elementAttributeContains(this.dataE2E, 'class', 'ux-tree-list--no-bullets');
    }
    get treeListItemCO() {
      return new CoUxTreeListItem(this.dataE2E);
    }
}


