@r2digisolutions/components 0.14.21 → 0.14.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -74,65 +74,42 @@
|
|
|
74
74
|
</button>
|
|
75
75
|
{/snippet}
|
|
76
76
|
|
|
77
|
-
{#snippet
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
77
|
+
{#snippet tree(node: OrgNode)}
|
|
78
|
+
<div class="flex flex-col items-center">
|
|
79
|
+
<div class="shrink-0" style:width="{CARD_W}px">
|
|
80
|
+
{@render nodeCard(node)}
|
|
81
|
+
</div>
|
|
82
|
+
{#if node.children?.length}
|
|
83
|
+
<div class="h-6 w-0.5 shrink-0 bg-border-strong" aria-hidden="true"></div>
|
|
84
|
+
{#if node.children.length === 1}
|
|
85
|
+
{@render tree(node.children[0])}
|
|
86
|
+
{:else}
|
|
87
87
|
<div
|
|
88
|
-
class="relative inline-flex items-start justify-center gap-4
|
|
88
|
+
class="relative inline-flex items-start justify-center gap-4"
|
|
89
89
|
style:--siblings={node.children.length}
|
|
90
90
|
>
|
|
91
91
|
<div
|
|
92
|
-
class="pointer-events-none absolute top-0 h-
|
|
92
|
+
class="pointer-events-none absolute top-0 h-0.5 bg-border-strong"
|
|
93
93
|
style:left="calc(50% / var(--siblings))"
|
|
94
94
|
style:right="calc(50% / var(--siblings))"
|
|
95
95
|
aria-hidden="true"
|
|
96
96
|
></div>
|
|
97
97
|
{#each node.children as child (child.id)}
|
|
98
|
-
<div class="flex shrink-0 flex-col items-center" style:width="{CARD_W}px">
|
|
99
|
-
<div class="h-4 w-
|
|
100
|
-
|
|
101
|
-
{@render nodeCard(child)}
|
|
102
|
-
</div>
|
|
103
|
-
</div>
|
|
104
|
-
{/each}
|
|
105
|
-
</div>
|
|
106
|
-
<div class="inline-flex items-start justify-center gap-4">
|
|
107
|
-
{#each node.children as child (child.id)}
|
|
108
|
-
<div
|
|
109
|
-
class="flex flex-col items-center pt-2"
|
|
110
|
-
style:min-width="{CARD_W}px"
|
|
111
|
-
>
|
|
112
|
-
{#if child.children?.length}
|
|
113
|
-
{@render childForest(child)}
|
|
114
|
-
{/if}
|
|
98
|
+
<div class="flex shrink-0 flex-col items-center" style:min-width="{CARD_W}px">
|
|
99
|
+
<div class="h-4 w-0.5 shrink-0 bg-border-strong" aria-hidden="true"></div>
|
|
100
|
+
{@render tree(child)}
|
|
115
101
|
</div>
|
|
116
102
|
{/each}
|
|
117
103
|
</div>
|
|
118
|
-
|
|
104
|
+
{/if}
|
|
119
105
|
{/if}
|
|
120
|
-
{/if}
|
|
121
|
-
{/snippet}
|
|
122
|
-
|
|
123
|
-
{#snippet branch(node: OrgNode)}
|
|
124
|
-
<div class="flex flex-col items-center">
|
|
125
|
-
<div class="w-full" style:width="{CARD_W}px">
|
|
126
|
-
{@render nodeCard(node)}
|
|
127
|
-
</div>
|
|
128
|
-
{@render childForest(node)}
|
|
129
106
|
</div>
|
|
130
107
|
{/snippet}
|
|
131
108
|
|
|
132
109
|
<div class={['overflow-x-auto py-4', className]} role="tree" aria-label="Organization chart">
|
|
133
110
|
{#if root}
|
|
134
|
-
<div class="flex justify-center px-4 pb-2">
|
|
135
|
-
{@render
|
|
111
|
+
<div class="flex min-w-max justify-center px-4 pb-2">
|
|
112
|
+
{@render tree(root)}
|
|
136
113
|
</div>
|
|
137
114
|
{:else}
|
|
138
115
|
<p class="py-8 text-center text-sm text-muted">No organization data</p>
|