@swr-data-lab/components 2.32.2 → 2.33.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,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">import FormLabel from '../FormLabel/FormLabel.svelte';
|
|
2
|
-
let { label, options, size = 'default', value = $bindable(null), onchange } = $props();
|
|
2
|
+
let { label, options, size = 'default', hideLabel = false, value = $bindable(null), onchange } = $props();
|
|
3
3
|
const groupId = $props.id();
|
|
4
4
|
const groupName = 'select-' + groupId;
|
|
5
5
|
function optionToID(o) {
|
|
@@ -8,7 +8,9 @@ function optionToID(o) {
|
|
|
8
8
|
</script>
|
|
9
9
|
|
|
10
10
|
<fieldset class="container" class:small={size === 'small'}>
|
|
11
|
-
<
|
|
11
|
+
<div class="legend" class:hidden={hideLabel}>
|
|
12
|
+
<FormLabel as="legend">{label}</FormLabel>
|
|
13
|
+
</div>
|
|
12
14
|
<ul>
|
|
13
15
|
{#each options as o (o)}
|
|
14
16
|
<li class:is-selected={o === value}>
|
|
@@ -33,6 +35,11 @@ function optionToID(o) {
|
|
|
33
35
|
font-family: var(--swr-sans);
|
|
34
36
|
}
|
|
35
37
|
|
|
38
|
+
.legend.hidden {
|
|
39
|
+
position: absolute;
|
|
40
|
+
left: -9999px;
|
|
41
|
+
}
|
|
42
|
+
|
|
36
43
|
ul {
|
|
37
44
|
width: 100%;
|
|
38
45
|
display: flex;
|
|
@@ -61,7 +68,7 @@ li:last-child label {
|
|
|
61
68
|
|
|
62
69
|
input {
|
|
63
70
|
position: absolute;
|
|
64
|
-
left: -
|
|
71
|
+
left: -9999px;
|
|
65
72
|
}
|
|
66
73
|
|
|
67
74
|
.small label {
|