web: re-format with prettier
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
@ -7,11 +7,10 @@ import AKGlobal from "../../authentik.css";
|
||||
|
||||
@customElement("ak-chip")
|
||||
export class Chip extends LitElement {
|
||||
|
||||
@property()
|
||||
value?: number | string;
|
||||
|
||||
@property({type: Boolean})
|
||||
@property({ type: Boolean })
|
||||
removable = false;
|
||||
|
||||
static get styles(): CSSResult[] {
|
||||
@ -24,16 +23,23 @@ export class Chip extends LitElement {
|
||||
<span class="pf-c-chip__text">
|
||||
<slot></slot>
|
||||
</span>
|
||||
${this.removable ? html`<button class="pf-c-button pf-m-plain" type="button" @click=${() => {
|
||||
this.dispatchEvent(new CustomEvent("remove", {
|
||||
bubbles: true,
|
||||
composed: true,
|
||||
}));
|
||||
}}>
|
||||
<i class="fas fa-times" aria-hidden="true"></i>
|
||||
</button>` : html``}
|
||||
${this.removable
|
||||
? html`<button
|
||||
class="pf-c-button pf-m-plain"
|
||||
type="button"
|
||||
@click=${() => {
|
||||
this.dispatchEvent(
|
||||
new CustomEvent("remove", {
|
||||
bubbles: true,
|
||||
composed: true,
|
||||
}),
|
||||
);
|
||||
}}
|
||||
>
|
||||
<i class="fas fa-times" aria-hidden="true"></i>
|
||||
</button>`
|
||||
: html``}
|
||||
</div>
|
||||
</li>`;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -9,7 +9,6 @@ import { Chip } from "./Chip";
|
||||
|
||||
@customElement("ak-chip-group")
|
||||
export class ChipGroup extends LitElement {
|
||||
|
||||
static get styles(): CSSResult[] {
|
||||
return [PFBase, PFChip, PFChipGroup, PFButton, AKGlobal];
|
||||
}
|
||||
@ -20,7 +19,7 @@ export class ChipGroup extends LitElement {
|
||||
|
||||
get value(): (string | number | undefined)[] {
|
||||
const values: (string | number | undefined)[] = [];
|
||||
this.querySelectorAll<Chip>("ak-chip").forEach(chip => {
|
||||
this.querySelectorAll<Chip>("ak-chip").forEach((chip) => {
|
||||
values.push(chip.value);
|
||||
});
|
||||
return values;
|
||||
@ -28,12 +27,11 @@ export class ChipGroup extends LitElement {
|
||||
|
||||
render(): TemplateResult {
|
||||
return html`<div class="pf-c-chip-group">
|
||||
<div class="pf-c-chip-group__main">
|
||||
<ul class="pf-c-chip-group__list" role="list">
|
||||
<slot></slot>
|
||||
</ul>
|
||||
</div>
|
||||
</div>`;
|
||||
<div class="pf-c-chip-group__main">
|
||||
<ul class="pf-c-chip-group__list" role="list">
|
||||
<slot></slot>
|
||||
</ul>
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user