@functionalcms/svelte-components 4.9.0 → 4.9.1
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { cn } from '../../utils.
|
|
3
|
-
import { NavigationDirection, Tab, TabSizes } from './tabs.
|
|
2
|
+
import { cn } from '../../utils.js';
|
|
3
|
+
import { NavigationDirection, Tab, TabSizes } from './tabs.js';
|
|
4
4
|
|
|
5
5
|
interface Props {
|
|
6
6
|
tabs: Array<Tab>; //` = [];
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
let dynamicComponentRefs = $state([]); //https://svelte.dev/tutorial/component-this
|
|
22
22
|
let tabButtonRefs: Array<HTMLButtonElement> = $state([]);
|
|
23
|
+
let activePanel = $state(null);
|
|
23
24
|
|
|
24
25
|
const baseStyles = () => `tabs ${isVerticalOrientation ? 'tabs-vertical' : ''}`;
|
|
25
26
|
|
|
@@ -181,11 +182,14 @@
|
|
|
181
182
|
<!-- {/if} -->
|
|
182
183
|
{/each}
|
|
183
184
|
</div>
|
|
184
|
-
{#
|
|
185
|
+
{#if activePanel}
|
|
186
|
+
{@render activePanel?.tabPanelComponent()}
|
|
187
|
+
{/if}
|
|
188
|
+
<!-- {#each tabs as panel}
|
|
185
189
|
{#if panel.isActive}
|
|
186
190
|
{@render panel?.tabPanelComponent()}
|
|
187
|
-
|
|
188
|
-
{/each}
|
|
191
|
+
|
|
192
|
+
{/each} -->
|
|
189
193
|
</div>
|
|
190
194
|
|
|
191
195
|
<style>
|