@lavalogic/scoria 0.23.0 → 0.24.0
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/Components/HorizontalTabGroup.svelte +26 -3
- package/dist/Components/HorizontalTabGroupButton.svelte +1 -1
- package/dist/Components/HorizontalTabGroupProps.d.ts +1 -1
- package/dist/Components/VerticalTabGroup.svelte +44 -6
- package/dist/Components/VerticalTabGroupButton.svelte +1 -1
- package/dist/Types/Internal/TabOption.d.ts +1 -0
- package/package.json +1 -1
|
@@ -4,16 +4,39 @@
|
|
|
4
4
|
lang="ts"
|
|
5
5
|
generics="CommonDenominator"
|
|
6
6
|
>
|
|
7
|
+
import { dev } from '$app/environment';
|
|
8
|
+
|
|
7
9
|
import HorizontalTabGroupButton from './HorizontalTabGroupButton.svelte';
|
|
8
10
|
import type { HorizontalTabGroupProps } from './HorizontalTabGroupProps.js';
|
|
9
11
|
let {
|
|
10
12
|
// name: _name, //FIXME why is this not implemented?
|
|
11
13
|
tabComponent,
|
|
12
|
-
|
|
14
|
+
tabs,
|
|
13
15
|
selected,
|
|
14
16
|
noRadius = false,
|
|
15
17
|
grow = false,
|
|
16
18
|
}: HorizontalTabGroupProps<CommonDenominator> = $props();
|
|
19
|
+
|
|
20
|
+
$effect(() => {
|
|
21
|
+
if (!dev) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
for (const tab of tabs) {
|
|
25
|
+
if (tab.debug) {
|
|
26
|
+
$inspect(
|
|
27
|
+
tab.label,
|
|
28
|
+
tab.content,
|
|
29
|
+
tab.onclick,
|
|
30
|
+
tab.args,
|
|
31
|
+
tab.iconLeft,
|
|
32
|
+
tab.iconRight,
|
|
33
|
+
tab.isValid,
|
|
34
|
+
tab.disabled,
|
|
35
|
+
tab.visible
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
17
40
|
</script>
|
|
18
41
|
|
|
19
42
|
<div
|
|
@@ -23,11 +46,11 @@
|
|
|
23
46
|
>
|
|
24
47
|
<div class="tabs">
|
|
25
48
|
{#if tabComponent}
|
|
26
|
-
{#each
|
|
49
|
+
{#each tabs as option (option)}
|
|
27
50
|
{@render tabComponent(option, selected === option)}
|
|
28
51
|
{/each}
|
|
29
52
|
{:else}
|
|
30
|
-
{#each
|
|
53
|
+
{#each tabs as option (option)}
|
|
31
54
|
<HorizontalTabGroupButton
|
|
32
55
|
{option}
|
|
33
56
|
selected={selected === option}
|
|
@@ -5,6 +5,6 @@ export interface HorizontalTabGroupProps<CommonDenominator> {
|
|
|
5
5
|
tabComponent?: Snippet<[TabOption<CommonDenominator>, boolean]>;
|
|
6
6
|
noRadius?: boolean;
|
|
7
7
|
grow?: boolean;
|
|
8
|
-
|
|
8
|
+
tabs: Array<TabOption<CommonDenominator>>;
|
|
9
9
|
selected: TabOption<CommonDenominator> | undefined;
|
|
10
10
|
}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
<svelte:options runes />
|
|
2
2
|
|
|
3
|
-
<script
|
|
3
|
+
<script
|
|
4
|
+
lang="ts"
|
|
5
|
+
module
|
|
6
|
+
>
|
|
7
|
+
import { dev } from '$app/environment';
|
|
4
8
|
import { onMount, untrack } from 'svelte';
|
|
5
9
|
import VerticalTabGroupButton from './VerticalTabGroupButton.svelte';
|
|
6
10
|
import type { VerticalTabGroupProps } from './VerticalTabGroupProps.js';
|
|
7
11
|
</script>
|
|
8
12
|
|
|
9
|
-
<script
|
|
13
|
+
<script
|
|
14
|
+
lang="ts"
|
|
15
|
+
generics="CommonDenominator"
|
|
16
|
+
>
|
|
10
17
|
let {
|
|
11
18
|
name,
|
|
12
19
|
tabs,
|
|
@@ -14,9 +21,30 @@
|
|
|
14
21
|
style,
|
|
15
22
|
noscroll,
|
|
16
23
|
noTabMessage,
|
|
17
|
-
nohistory = false
|
|
24
|
+
nohistory = false,
|
|
18
25
|
}: VerticalTabGroupProps<CommonDenominator> = $props();
|
|
19
26
|
|
|
27
|
+
$effect(() => {
|
|
28
|
+
if (!dev) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
for (const tab of tabs) {
|
|
32
|
+
if (tab.debug) {
|
|
33
|
+
$inspect(
|
|
34
|
+
tab.label,
|
|
35
|
+
tab.content,
|
|
36
|
+
tab.onclick,
|
|
37
|
+
tab.args,
|
|
38
|
+
tab.iconLeft,
|
|
39
|
+
tab.iconRight,
|
|
40
|
+
tab.isValid,
|
|
41
|
+
tab.disabled,
|
|
42
|
+
tab.visible
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
20
48
|
onMount(() => {
|
|
21
49
|
if (name && !nohistory) {
|
|
22
50
|
const tabName = sessionStorage.getItem(`${name}-active-tab`);
|
|
@@ -35,14 +63,24 @@
|
|
|
35
63
|
});
|
|
36
64
|
</script>
|
|
37
65
|
|
|
38
|
-
<div
|
|
66
|
+
<div
|
|
67
|
+
class="wrapper"
|
|
68
|
+
class:noscroll
|
|
69
|
+
{style}
|
|
70
|
+
>
|
|
39
71
|
<div class="tabs">
|
|
40
72
|
{#each tabs as option (option)}
|
|
41
|
-
<VerticalTabGroupButton
|
|
73
|
+
<VerticalTabGroupButton
|
|
74
|
+
{option}
|
|
75
|
+
selected={selected?.label === option.label}
|
|
76
|
+
/>
|
|
42
77
|
{/each}
|
|
43
78
|
</div>
|
|
44
79
|
|
|
45
|
-
<div
|
|
80
|
+
<div
|
|
81
|
+
class="content"
|
|
82
|
+
class:noscroll
|
|
83
|
+
>
|
|
46
84
|
{#if selected}
|
|
47
85
|
{@render selected.content(selected.args)}
|
|
48
86
|
{:else}
|