clean up Tree Item component
This commit is contained in:
parent
7403e4925e
commit
7b9377ea1e
1 changed files with 13 additions and 19 deletions
|
@ -5,12 +5,14 @@
|
||||||
export let icon;
|
export let icon;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<li class:is-selected={selected} class:is-open={open} class="spectrum-TreeView-item">
|
<li
|
||||||
|
class:is-selected={selected} class:is-open={open} class="spectrum-TreeView-item">
|
||||||
|
<a on:click class="spectrum-TreeView-itemLink" href="#">
|
||||||
{#if $$slots.default}
|
{#if $$slots.default}
|
||||||
<a class="spectrum-TreeView-itemLink" href="#">
|
|
||||||
<svg class="spectrum-Icon spectrum-UIIcon-ChevronRight100 spectrum-TreeView-itemIndicator" focusable="false" aria-hidden="true">
|
<svg class="spectrum-Icon spectrum-UIIcon-ChevronRight100 spectrum-TreeView-itemIndicator" focusable="false" aria-hidden="true">
|
||||||
<use xlink:href="#spectrum-css-icon-Chevron100" />
|
<use xlink:href="#spectrum-css-icon-Chevron100" />
|
||||||
</svg>
|
</svg>
|
||||||
|
{/if}
|
||||||
{#if icon}
|
{#if icon}
|
||||||
<svg class="spectrum-TreeView-itemIcon spectrum-Icon spectrum-Icon--sizeM" focusable="false" aria-hidden="true" aria-label="Layers">
|
<svg class="spectrum-TreeView-itemIcon spectrum-Icon spectrum-Icon--sizeM" focusable="false" aria-hidden="true" aria-label="Layers">
|
||||||
<use xlink:href="#spectrum-icon-18-{icon}" />
|
<use xlink:href="#spectrum-icon-18-{icon}" />
|
||||||
|
@ -18,17 +20,9 @@
|
||||||
{/if}
|
{/if}
|
||||||
<span class="spectrum-TreeView-itemLabel">{title}</span>
|
<span class="spectrum-TreeView-itemLabel">{title}</span>
|
||||||
</a>
|
</a>
|
||||||
|
{#if $$slots.default}
|
||||||
<ul class="spectrum-TreeView">
|
<ul class="spectrum-TreeView">
|
||||||
<slot />
|
<slot />
|
||||||
</ul>
|
</ul>
|
||||||
{:else}
|
|
||||||
<a class="spectrum-TreeView-itemLink" href="#">
|
|
||||||
{#if icon}
|
|
||||||
<svg class="spectrum-TreeView-itemIcon spectrum-Icon spectrum-Icon--sizeM" focusable="false" aria-hidden="true" aria-label="Layers">
|
|
||||||
<use xlink:href="#spectrum-icon-18-{icon}" />
|
|
||||||
</svg>
|
|
||||||
{/if}
|
|
||||||
<span class="spectrum-TreeView-itemLabel">{title}</span>
|
|
||||||
</a>
|
|
||||||
{/if}
|
{/if}
|
||||||
</li>
|
</li>
|
Loading…
Reference in a new issue