web: re-format with prettier
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
		@ -6,16 +6,19 @@ import { ErrorDetail } from "authentik-api";
 | 
			
		||||
 | 
			
		||||
@customElement("ak-form-element")
 | 
			
		||||
export class FormElement extends LitElement {
 | 
			
		||||
 | 
			
		||||
    static get styles(): CSSResult[] {
 | 
			
		||||
        return [PFForm, PFFormControl, css`
 | 
			
		||||
            slot {
 | 
			
		||||
                display: flex;
 | 
			
		||||
                flex-direction: row;
 | 
			
		||||
                align-items: center;
 | 
			
		||||
                justify-content: space-around;
 | 
			
		||||
            }
 | 
			
		||||
        `];
 | 
			
		||||
        return [
 | 
			
		||||
            PFForm,
 | 
			
		||||
            PFFormControl,
 | 
			
		||||
            css`
 | 
			
		||||
                slot {
 | 
			
		||||
                    display: flex;
 | 
			
		||||
                    flex-direction: row;
 | 
			
		||||
                    align-items: center;
 | 
			
		||||
                    justify-content: space-around;
 | 
			
		||||
                }
 | 
			
		||||
            `,
 | 
			
		||||
        ];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @property()
 | 
			
		||||
@ -28,22 +31,23 @@ export class FormElement extends LitElement {
 | 
			
		||||
    errors?: ErrorDetail[];
 | 
			
		||||
 | 
			
		||||
    updated(): void {
 | 
			
		||||
        this.querySelectorAll<HTMLInputElement>("input[autofocus]").forEach(input => {
 | 
			
		||||
        this.querySelectorAll<HTMLInputElement>("input[autofocus]").forEach((input) => {
 | 
			
		||||
            input.focus();
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    render(): TemplateResult {
 | 
			
		||||
        return html`<div class="pf-c-form__group">
 | 
			
		||||
                <label class="pf-c-form__label">
 | 
			
		||||
                    <span class="pf-c-form__label-text">${this.label}</span>
 | 
			
		||||
                    ${this.required ? html`<span class="pf-c-form__label-required" aria-hidden="true">*</span>` : html``}
 | 
			
		||||
                </label>
 | 
			
		||||
                <slot></slot>
 | 
			
		||||
                ${(this.errors || []).map((error) => {
 | 
			
		||||
                        return html`<p class="pf-c-form__helper-text pf-m-error">${error.string}</p>`;
 | 
			
		||||
                    })}
 | 
			
		||||
            </div>`;
 | 
			
		||||
            <label class="pf-c-form__label">
 | 
			
		||||
                <span class="pf-c-form__label-text">${this.label}</span>
 | 
			
		||||
                ${this.required
 | 
			
		||||
                    ? html`<span class="pf-c-form__label-required" aria-hidden="true">*</span>`
 | 
			
		||||
                    : html``}
 | 
			
		||||
            </label>
 | 
			
		||||
            <slot></slot>
 | 
			
		||||
            ${(this.errors || []).map((error) => {
 | 
			
		||||
                return html`<p class="pf-c-form__helper-text pf-m-error">${error.string}</p>`;
 | 
			
		||||
            })}
 | 
			
		||||
        </div>`;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user