import Component  from '../component.js';
import CalendarBody from './calendar-body.js';

export default class MonthView extends Component {
    constructor(parent) {
      let selector = 'mat-month-view';
      super(parent, selector);
    }
    // https://github.com/angular/components/blob/master/src/material/datepicker/month-view.html
    
    get calendarTable() {
        let path = '//table[contains(@class, "mat-calendar-table")]';
        return this.currentPath + path;
    }
    get calendarTableHeader() {
        let path = '//thead[contains(@class, "mat-calendar-table-header")]';
        return this.calendarTable + path;
    }
    getWeekDayByIndex(index) {
        let path = '/tr/th[@class= "ng-star-inserted"]';
        return '(' + this.calendarTableHeader + path + ')[' + index + ']';
    }
    getWeekDayByText(text) {
        let path = '/tr/th[text()[normalize-space()="' + text + '"]]';
        return this.calendarTableHeader + path;
    }
    get calendarTableHeaderDivider() {
        let path = '//th[contains(@class, "mat-calendar-table-header-divider")]';
        return this.calendarTableHeader + path;
    }
    get calendarBodyCO() {
        return new CalendarBody(this.calendarTable);
    }
}



