implements working TreeView component
This commit is contained in:
parent
8aa6e66be2
commit
fb77d95e34
|
@ -6,8 +6,8 @@
|
||||||
</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 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>
|
||||||
|
@ -17,16 +17,18 @@
|
||||||
</svg>
|
</svg>
|
||||||
{/if}
|
{/if}
|
||||||
<span class="spectrum-TreeView-itemLabel">{title}</span>
|
<span class="spectrum-TreeView-itemLabel">{title}</span>
|
||||||
<ul class="spectrum-TreeView">
|
</a>
|
||||||
<slot />
|
<ul class="spectrum-TreeView">
|
||||||
</ul>
|
<slot />
|
||||||
{:else}
|
</ul>
|
||||||
|
{:else}
|
||||||
|
<a class="spectrum-TreeView-itemLink" href="#">
|
||||||
{#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}" />
|
||||||
</svg>
|
</svg>
|
||||||
{/if}
|
{/if}
|
||||||
<span class="spectrum-TreeView-itemLabel">{title}</span>
|
<span class="spectrum-TreeView-itemLabel">{title}</span>
|
||||||
{/if}
|
</a>
|
||||||
</a>
|
{/if}
|
||||||
</li>
|
</li>
|
|
@ -2,9 +2,10 @@
|
||||||
import "@spectrum-css/treeview/dist/index-vars.css"
|
import "@spectrum-css/treeview/dist/index-vars.css"
|
||||||
|
|
||||||
export let quiet = false
|
export let quiet = false
|
||||||
export let width;
|
export let standalone = true
|
||||||
|
export let width = '250px';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ul class:spectrum-TreeView--quiet={quiet} class="spectrum-TreeView" style="width: {width}">
|
<ul class:spectrum-TreeView--standalone={standalone} class:spectrum-TreeView--quiet={quiet} class="spectrum-TreeView" style="width: {width}">
|
||||||
<slot />
|
<slot />
|
||||||
</ul>
|
</ul>
|
Loading…
Reference in New Issue