@tuspe/components 1.8.10 → 1.8.12
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/README.md +5 -3
- package/dist/Checkbox.svelte +21 -1
- package/dist/Checkbox.svelte.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -203,14 +203,16 @@ Allows users to toggle between checked and unchecked states.
|
|
|
203
203
|
|
|
204
204
|
```TypeScript
|
|
205
205
|
interface Props {
|
|
206
|
+
checked?: boolean
|
|
206
207
|
children: Snippet
|
|
207
|
-
onchange?: () => void
|
|
208
|
-
checked: boolean
|
|
209
208
|
disabled?: boolean
|
|
210
209
|
group?: boolean
|
|
211
210
|
id?: string
|
|
211
|
+
noLineHeight?: boolean
|
|
212
|
+
onchange?: () => void
|
|
212
213
|
outerClass?: string
|
|
213
|
-
|
|
214
|
+
required?: boolean
|
|
215
|
+
value?: number | string
|
|
214
216
|
}
|
|
215
217
|
```
|
|
216
218
|
|
package/dist/Checkbox.svelte
CHANGED
|
@@ -9,17 +9,33 @@
|
|
|
9
9
|
disabled?: boolean
|
|
10
10
|
group?: boolean
|
|
11
11
|
id?: string
|
|
12
|
+
noLineHeight?: boolean
|
|
12
13
|
outerClass?: string
|
|
13
14
|
required?: boolean
|
|
14
15
|
value?: number | string
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
let {
|
|
18
|
+
let {
|
|
19
|
+
children,
|
|
20
|
+
onchange,
|
|
21
|
+
checked = $bindable(false),
|
|
22
|
+
disabled,
|
|
23
|
+
group = $bindable(),
|
|
24
|
+
id,
|
|
25
|
+
noLineHeight = false,
|
|
26
|
+
outerClass,
|
|
27
|
+
required,
|
|
28
|
+
value,
|
|
29
|
+
...props
|
|
30
|
+
}: Props = $props()
|
|
18
31
|
|
|
19
32
|
let classes = $state('input-checkbox')
|
|
20
33
|
if (outerClass) {
|
|
21
34
|
classes += ` ${outerClass}`
|
|
22
35
|
}
|
|
36
|
+
if (noLineHeight) {
|
|
37
|
+
classes += ' lh-none'
|
|
38
|
+
}
|
|
23
39
|
</script>
|
|
24
40
|
|
|
25
41
|
<label class={classes}>
|
|
@@ -59,6 +75,10 @@
|
|
|
59
75
|
grid-template-columns: 20px 1fr;
|
|
60
76
|
}
|
|
61
77
|
|
|
78
|
+
label:not(.lh-none) {
|
|
79
|
+
line-height: 1.25;
|
|
80
|
+
}
|
|
81
|
+
|
|
62
82
|
sup {
|
|
63
83
|
color: darkred;
|
|
64
84
|
}
|