This commit is contained in:
Jesper Møller Jensen
2022-12-20 13:21:23 +01:00
parent f64de04337
commit f30933f016
2 changed files with 6 additions and 6 deletions

View File

@@ -146,7 +146,7 @@ export class UmbCollectionToolbarElement extends UmbObserverMixin(LitElement) {
<uui-icon .name=${this._currentLayout.meta.icon}></uui-icon>
</uui-button>
<umb-tooltip-menu
icon
icon-only
slot="popover"
.items=${this._layouts.map((layout) => ({
label: layout.meta.label,

View File

@@ -45,8 +45,8 @@ export class UmbTooltipMenuElement extends LitElement {
`,
];
@property({ type: Boolean, reflect: true })
public icon = false;
@property({ type: Boolean, reflect: true, attribute: 'icon-only' })
public iconOnly = false;
@property()
public items: Array<TooltipMenuItem> = [];
@@ -62,7 +62,7 @@ export class UmbTooltipMenuElement extends LitElement {
}
private _renderItem(item: TooltipMenuItem) {
if (this.icon && item.icon) {
if (this.iconOnly && item.icon) {
return html`<div
@click=${() => this._handleItemClick(item)}
@keydown=${(e: KeyboardEvent) => this._handleItemKeyDown(e, item)}
@@ -74,9 +74,9 @@ export class UmbTooltipMenuElement extends LitElement {
return html`<div
@click=${() => this._handleItemClick(item)}
@keydown=${(e: KeyboardEvent) => this._handleItemKeyDown(e, item)}
class="item ${this.icon ? 'icon' : 'label'}">
class="item ${this.iconOnly ? 'icon' : 'label'}">
${item.icon ? html`<uui-icon .name=${item.icon}></uui-icon>` : nothing}
${!this.icon ? html`<span>${item.label}</span>` : nothing}
${!this.iconOnly ? html`<span>${item.label}</span>` : nothing}
</div>`;
}