@sentropic/design-system-svelte 0.34.42 → 0.34.43
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.
- package/dist/Tabs.svelte +10 -2
- package/dist/Tabs.svelte.d.ts +3 -1
- package/dist/Tabs.svelte.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/Tabs.svelte
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
|
|
2
4
|
export interface TabItem {
|
|
3
5
|
value: string;
|
|
4
6
|
label: string;
|
|
5
|
-
|
|
7
|
+
/** Contenu du panneau : texte simple OU un Snippet (composant/markup riche). */
|
|
8
|
+
content: string | Snippet;
|
|
6
9
|
disabled?: boolean;
|
|
7
10
|
}
|
|
8
11
|
</script>
|
|
@@ -33,6 +36,7 @@
|
|
|
33
36
|
);
|
|
34
37
|
const classes = () => ["st-tabs", className].filter(Boolean).join(" ");
|
|
35
38
|
const activeItem = () => items.find((item) => item.value === current) ?? items[0];
|
|
39
|
+
const panelContent = $derived(activeItem()?.content);
|
|
36
40
|
|
|
37
41
|
function select(value: string): void {
|
|
38
42
|
selected = value;
|
|
@@ -57,7 +61,11 @@
|
|
|
57
61
|
{/each}
|
|
58
62
|
</div>
|
|
59
63
|
<div class="st-tabs__panel" role="tabpanel">
|
|
60
|
-
{
|
|
64
|
+
{#if typeof panelContent === "function"}
|
|
65
|
+
{@render panelContent()}
|
|
66
|
+
{:else}
|
|
67
|
+
{panelContent}
|
|
68
|
+
{/if}
|
|
61
69
|
</div>
|
|
62
70
|
</section>
|
|
63
71
|
|
package/dist/Tabs.svelte.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
1
2
|
export interface TabItem {
|
|
2
3
|
value: string;
|
|
3
4
|
label: string;
|
|
4
|
-
|
|
5
|
+
/** Contenu du panneau : texte simple OU un Snippet (composant/markup riche). */
|
|
6
|
+
content: string | Snippet;
|
|
5
7
|
disabled?: boolean;
|
|
6
8
|
}
|
|
7
9
|
import type { HTMLAttributes } from "svelte/elements";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.svelte.d.ts","sourceRoot":"","sources":["../src/lib/Tabs.svelte.ts"],"names":[],"mappings":"AAGE,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"Tabs.svelte.d.ts","sourceRoot":"","sources":["../src/lib/Tabs.svelte.ts"],"names":[],"mappings":"AAGE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,gFAAgF;IAChF,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGpD,KAAK,SAAS,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,GAAG;IAC5D,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,CAAC;AAmDJ,QAAA,MAAM,IAAI,+CAAwC,CAAC;AACnD,KAAK,IAAI,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC;AACpC,eAAe,IAAI,CAAC"}
|