mirror of
https://github.com/garraflavatra/rolens.git
synced 2025-07-16 21:14:05 +00:00
dump/export (wip)
This commit is contained in:
@ -13,6 +13,7 @@
|
||||
export let level = 0;
|
||||
export let striped = true;
|
||||
export let hideObjectIndicators = false;
|
||||
export let hideChildrenToggles = false;
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
let childrenOpen = {};
|
||||
@ -105,17 +106,19 @@
|
||||
class:selected={!activePath[level + 1] && activePath.every(k => path.includes(k) || k === item[key]) && (activePath[level] === item[key])}
|
||||
class:striped
|
||||
>
|
||||
<td class="has-toggle">
|
||||
{#if item.children?.length}
|
||||
<button
|
||||
class="toggle"
|
||||
on:click={evt => toggleChildren(item[key], evt.shiftKey)}
|
||||
style:transform="translateX({level * 10}px)"
|
||||
>
|
||||
<Icon name={childrenOpen[item[key]] ? 'chev-d' : 'chev-r'} />
|
||||
</button>
|
||||
{/if}
|
||||
</td>
|
||||
{#if !hideChildrenToggles}
|
||||
<td class="has-toggle">
|
||||
{#if item.children?.length}
|
||||
<button
|
||||
class="toggle"
|
||||
on:click={evt => toggleChildren(item[key], evt.shiftKey)}
|
||||
style:transform="translateX({level * 10}px)"
|
||||
>
|
||||
<Icon name={childrenOpen[item[key]] ? 'chev-d' : 'chev-r'} />
|
||||
</button>
|
||||
{/if}
|
||||
</td>
|
||||
{/if}
|
||||
|
||||
<td class="has-icon">
|
||||
<div style:margin-left="{level * 10}px">
|
||||
|
@ -8,8 +8,9 @@
|
||||
export let key = 'id';
|
||||
export let activePath = [];
|
||||
export let striped = true;
|
||||
export let hideObjectIndicators = false;
|
||||
export let showHeaders = false;
|
||||
export let hideObjectIndicators = false;
|
||||
export let hideChildrenToggles = false;
|
||||
</script>
|
||||
|
||||
<div class="grid">
|
||||
@ -28,8 +29,12 @@
|
||||
{#if showHeaders && columns.some(col => col.title)}
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="has-toggle"></th>
|
||||
{#if !hideChildrenToggles}
|
||||
<th class="has-toggle"></th>
|
||||
{/if}
|
||||
|
||||
<th class="has-icon"></th>
|
||||
|
||||
{#each columns as column}
|
||||
<th scope="col">{column.title || ''}</th>
|
||||
{/each}
|
||||
@ -44,6 +49,7 @@
|
||||
{key}
|
||||
{striped}
|
||||
{hideObjectIndicators}
|
||||
{hideChildrenToggles}
|
||||
bind:activePath
|
||||
on:select
|
||||
on:trigger
|
||||
|
Reference in New Issue
Block a user