From 19d60d3b5d08566baf5a4d3974830b8109b26ac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Eikeland?= Date: Thu, 23 Jan 2025 12:30:03 +0100 Subject: [PATCH] fix(sdd): now supports using eds meta icon icon name --- .../searchable-dropdown/src/dropdown/element.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/searchable-dropdown/src/dropdown/element.ts b/packages/searchable-dropdown/src/dropdown/element.ts index db3b1e4f..7953d485 100644 --- a/packages/searchable-dropdown/src/dropdown/element.ts +++ b/packages/searchable-dropdown/src/dropdown/element.ts @@ -139,7 +139,6 @@ export class SearchableDropdownElement selectedItems: Set = new Set([]); updated(props: PropertyValues) { - console.log('props', props); if (props.has('selectedId')) { this.controller.updateSelectedByProp(); } @@ -201,7 +200,7 @@ export class SearchableDropdownElement >
${this.renderItemGraphic(item)}
${text} -
${unsafeHTML(item.meta)}
+
${this.renderItemMeta(item)}
`; } @@ -219,6 +218,20 @@ export class SearchableDropdownElement } } + protected renderItemMeta(item: SearchableDropdownResultItem): ReturnType | void { + const { meta, graphicType } = item; + switch (graphicType) { + case 'inline-html': + return unsafeHTML(meta); + case 'inline-svg': + return unsafeSVG(meta); + default: + if (meta) { + return html``; + } + } + } + /** * Render the menu if state is open * @returns HTMLTemplateResult