import Component  from '../component.js';

export default class CoUxFormControlDatepicker extends Component {

    constructor(parent) {
        let selector = 'p-calendar[@data-e2e = "ux-form-control-dpicker-rw"]';
        super(parent, selector);
        //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/core/src/lib/commons/ux-components/ux-form-control/ux-form-control.component.html?at=refs%2Fheads%2Fsupport%2F7.x
    }
    get datePickerSpan() {
        let path = '/span[contains(@class, "ui-calendar") and contains(@class, "ui-calendar-w-btn")]';
        return this.currentPath + path;
    }
    get datePickerInput() {
        let path = '/input[contains(@class, "ui-inputtext")]';
        return this.datePickerSpan + path;
    }
    get datePickerButton() {
        let path = '/button[contains(@class, "ui-datepicker-trigger")]';
        return this.datePickerSpan + path;
    }
    async isDatePickerDisabled() {
        return await (await $(this.currentPath + '//p-calendar[@data-e2e ="ux-form-control-dpicker-dis"]')).isExisting();
    }
}


