import Component  from '../component.js'
import CdkOverlayContainer from '../cdk-overlay-container.js'

export default class MatSelect extends Component {
  constructor(parent) {
    let selector = 'mat-select';
    super(parent, selector);
      // https://github.com/angular/components/blob/ad248652e7da31398176fe11878b59805e440b5a/src/material/select/select.html
  }

  get trigger() {
    return this.currentPath + '//div[contains(@class,"mat-select-trigger")]';
  }

  get value() {
    return this.trigger + '//div[contains(@class,"mat-select-value")]';
  }

  get placeholder() {
    return this.value + '//span[contains(@class,"mat-select-placeholder")]';
  }

  get valueText() {
    return this.value + '//span[contains(@class,"mat-select-value-text")]';
  }

  get minLine() {
    return this.valueText + '//span[contains(@class,"mat-select-min-line")]';
  }

  get arrowWrapper() {
    return this.trigger + '//div[contains(@class,"mat-select-arrow-wrapper")]';
  }

  get arrow() {
    return this.arrowWrapper + '//div[contains(@class,"mat-select-arrow")]';
  }

  get overlayContainerCO() {
    return new CdkOverlayContainer('//body');
  }

  get panelWrap() {
    return this.overlayContainerCO.overlayPane + '//div[contains(@class, "mat-select-panel-wrap")]'
  }

  get panel() {
    return this.panelWrap + '//div[contains(@class,"mat-select-panel")]';
  }

}

