import Component  from '../component.js'
import { elementAttributeContains } from '../../core/utils.js'

export default class MatDateRangeInput extends Component {
    constructor(parent) {
      let selector = 'mat-date-range-input[contains(@class, "mat-date-range-input")]';
      super(parent, selector);
      //https://github.com/angular/components/blob/master/src/material/datepicker/date-range-input.html
    }
    get inputContainer() {
        return this.currentPath + '//div[contains(@class, "mat-date-range-input-container")]';
    }
    //START
    get inputStartWrapper() {
        return this.inputContainer + '//div[contains(@class, "mat-date-range-input-start-wrapper")]';
    }
    get startInput() {
        let path = '//input[contains(@class, "mat-start-date")]';
        return this.inputStartWrapper + path;
    }
    get inputMirror() {
        let path = '//span[contains(@class, "mat-date-range-input-mirror")]';
        return this.inputStartWrapper + path;
    }

    //SEPARATOR
    get separator() {
        let path = '//span[contains(@class, "mat-date-range-input-separator")]';
        return this.inputContainer + path;
    }
    async isSeparatorHidden() {
        return await elementAttributeContains(this.separator, 'class', 'mat-date-range-input-separator-hidden');
    }
    
    //END
    get inputEndtWrapper() {
        return this.inputContainer + '//div[contains(@class, "mat-date-range-input-end-wrapper")]';
    }
    get endInput() {
        let path = '//input[contains(@class, "mat-end-date")]';
        return this.inputEndtWrapper + path;
    }
}