import Component  from '../component.js'
import LabelComponent from '../label.js'

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

    get matFormFieldWrapper() {
        let path = '//div[contains(@class,"mat-form-field-wrapper")]';
        return this.currentPath + path;
    }

    get matFormFieldFlex() {
        return this.matFormFieldWrapper + '//div[contains(@class,"mat-form-field-flex")]';
    }

    get matFormFieldOutline() {
        return this.matFormFieldFlex + '//div[contains(@class,"mat-form-field-outline")]';
    }

    get matFormFieldOutlineStart() {
        return this.matFormFieldFlex + '//div[contains(@class,"mat-form-field-outline-start")]';
    }

    get matFormFieldOutlineGap() {
        return this.matFormFieldFlex + '//div[contains(@class,"mat-form-field-outline-gap")]';
    }

    get matFormFieldOutlineEnd() {
        return this.matFormFieldFlex + '//div[contains(@class,"mat-form-field-outline-end")]';
    }

    get matFormFieldOutlineThick() {
        return this.matFormFieldFlex + '//div[contains(@class,"mat-form-field-outline-thick")]';
    }

    get matFormFieldOutlineThickStart() {
        return this.matFormFieldOutlineThick + '//div[contains(@class,"mat-form-field-outline-start")]';
    }

    get matFormFieldOutlineThickGap() {
        return this.matFormFieldOutlineThick + '//div[contains(@class,"mat-form-field-outline-gap")]';
    }

    get matFormFieldOutlineThickEnd() {
        return this.matFormFieldOutlineThick + '//div[contains(@class,"mat-form-field-outline-end")]';
    }

    get matFormFieldPrefix() {
        return this.matFormFieldFlex + '//div[contains(@class,"mat-form-field-prefix")]';
    }

    get matFormFieldInfix() {
        return this.matFormFieldFlex + '//div[contains(@class,"mat-form-field-infix")]';
    }

    get matFormFieldLabelWrapper() {
        return this.matFormFieldInfix + '//span[contains(@class,"mat-form-field-label-wrapper")]';
    }

    get matFormFieldLabelCo() {
        return LabelComponent(this.matFormFieldLabelWrapper);
    }

    get matFormFieldRequiredMarker() {
        return this.matFormFieldLabelCo + '//span[contains(@class,"mat-form-field-required-marker")]';
    }

    get matFormFieldSuffix() {
        return this.matFormFieldFlex + '//div[contains(@class,"mat-form-field-suffix")]';
    }

    get matFormFieldUnderline() {
        return this.matFormFieldWrapper + '//div[contains(@class,"mat-form-field-underline")]';
    }

    get matFormFieldRipple() {
        return this.matFormFieldUnderline + '//span[contains(@class,"mat-form-field-ripple")]';
    }

    get matFormFieldSubscriptWrapper() {
        return this.matFormFieldWrapper + '//div[contains(@class,"mat-form-field-subscript-wrapper")]';
    }

    get matFormFieldHintWrapper() {
        return this.matFormFieldSubscriptWrapper + '//div[contains(@class,"mat-form-field-hint-wrapper")]';
    }

    get matHint() {
        return this.matFormFieldHintWrapper + '//div[contains(@class,"mat-hint")]';
    }

    get matFormFieldHintSpacer() {
        return this.matFormFieldHintWrapper + '//div[contains(@class,"mat-form-field-hint-spacer")]';
    }

}
