web/elements: use <slot> in ak-label instead of attribute

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-11-28 21:03:24 +01:00
parent 96a86b3298
commit 235d283def
7 changed files with 31 additions and 40 deletions

View File

@ -20,9 +20,6 @@ export class Label extends LitElement {
@property()
icon?: string;
@property()
text?: string;
static get styles(): CSSResult[] {
return [PFBase, PFLabel, AKGlobal];
}
@ -47,12 +44,11 @@ export class Label extends LitElement {
<span class="pf-c-label__content">
<span class="pf-c-label__icon">
<i
class="fas ${this.text ? "fa-fw" : ""} ${this.icon ||
this.getDefaultIcon()}"
class="fas fa-fw${this.icon || this.getDefaultIcon()}"
aria-hidden="true"
></i>
</span>
${this.text || ""}
<slot></slot>
</span>
</span>`;
}