@tuspe/components 1.7.1 → 1.7.3
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/Checkbox.svelte +13 -8
- package/dist/Checkbox.svelte.d.ts +1 -0
- package/package.json +1 -1
package/dist/Checkbox.svelte
CHANGED
|
@@ -9,15 +9,19 @@
|
|
|
9
9
|
disabled?: boolean
|
|
10
10
|
id?: string
|
|
11
11
|
outerClass?: string
|
|
12
|
+
required?: boolean
|
|
12
13
|
value?: string
|
|
13
14
|
}
|
|
14
15
|
|
|
15
|
-
let {children, onchange, checked = $bindable(false), disabled, id, outerClass, value}: Props = $props()
|
|
16
|
+
let {children, onchange, checked = $bindable(false), disabled, id, outerClass, required, value}: Props = $props()
|
|
16
17
|
</script>
|
|
17
18
|
|
|
18
19
|
<label class={outerClass}>
|
|
19
|
-
<input bind:checked disabled={disabled || $loading} {id} {onchange} type="checkbox" {value} />
|
|
20
|
-
<span>
|
|
20
|
+
<input bind:checked disabled={disabled || $loading} {id} {onchange} {required} type="checkbox" {value} />
|
|
21
|
+
<span>
|
|
22
|
+
{@render children?.()}
|
|
23
|
+
{#if required}<sup>*</sup>{/if}
|
|
24
|
+
</span>
|
|
21
25
|
</label>
|
|
22
26
|
|
|
23
27
|
<style scoped>
|
|
@@ -25,7 +29,6 @@
|
|
|
25
29
|
accent-color: var(--color-primary);
|
|
26
30
|
border: 1px solid var(--color-border);
|
|
27
31
|
height: 20px;
|
|
28
|
-
margin-right: 10px;
|
|
29
32
|
outline: none;
|
|
30
33
|
vertical-align: middle;
|
|
31
34
|
width: 20px;
|
|
@@ -42,14 +45,16 @@
|
|
|
42
45
|
}
|
|
43
46
|
|
|
44
47
|
label {
|
|
45
|
-
display: flex;
|
|
46
48
|
align-items: center;
|
|
47
49
|
cursor: pointer;
|
|
48
|
-
|
|
50
|
+
display: grid;
|
|
49
51
|
font-size: 1rem;
|
|
52
|
+
gap: 1rem;
|
|
53
|
+
grid-template-columns: 20px 1fr;
|
|
54
|
+
line-height: 1.25;
|
|
50
55
|
}
|
|
51
56
|
|
|
52
|
-
|
|
53
|
-
|
|
57
|
+
sup {
|
|
58
|
+
color: darkred;
|
|
54
59
|
}
|
|
55
60
|
</style>
|