@tuspe/components 1.8.7 → 1.8.9
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/Button.svelte +1 -1
- package/dist/Checkbox.svelte +5 -1
- package/dist/Input.svelte +12 -8
- package/package.json +4 -4
package/dist/Button.svelte
CHANGED
package/dist/Checkbox.svelte
CHANGED
|
@@ -15,9 +15,13 @@
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
let {children, onchange, checked = $bindable(false), disabled, group = $bindable(), id, outerClass, required, value, ...props}: Props = $props()
|
|
18
|
+
let classes = $state('checkbox')
|
|
19
|
+
if (outerClass) {
|
|
20
|
+
classes += ` ${outerClass}`
|
|
21
|
+
}
|
|
18
22
|
</script>
|
|
19
23
|
|
|
20
|
-
<label class={
|
|
24
|
+
<label class={classes}>
|
|
21
25
|
<input bind:checked disabled={disabled || $loading} {id} {onchange} {required} type="checkbox" {value} {...props} />
|
|
22
26
|
<span>
|
|
23
27
|
{@render children?.()}
|
package/dist/Input.svelte
CHANGED
|
@@ -39,25 +39,29 @@
|
|
|
39
39
|
...props
|
|
40
40
|
}: Props = $props()
|
|
41
41
|
|
|
42
|
-
let
|
|
42
|
+
let classesIn = $state(''),
|
|
43
|
+
classesOut = $state(`input-${type}`)
|
|
43
44
|
if (inputClass) {
|
|
44
|
-
|
|
45
|
+
classesIn = inputClass
|
|
45
46
|
}
|
|
46
47
|
if (bgColor && bgColor !== 'none') {
|
|
47
|
-
|
|
48
|
+
classesIn += ` bg-${bgColor}`
|
|
48
49
|
}
|
|
49
50
|
if (borderColor && borderColor !== 'none') {
|
|
50
|
-
|
|
51
|
+
classesIn += ` border-color-${borderColor}`
|
|
52
|
+
}
|
|
53
|
+
if (outerClass) {
|
|
54
|
+
classesOut += ` ${outerClass}`
|
|
51
55
|
}
|
|
52
56
|
</script>
|
|
53
57
|
|
|
54
|
-
<label class={
|
|
58
|
+
<label class={classesOut}>
|
|
55
59
|
{label}{#if required}<sup>*</sup>{/if}
|
|
56
60
|
|
|
57
61
|
{#if type === 'textarea'}
|
|
58
62
|
<textarea
|
|
59
63
|
bind:value
|
|
60
|
-
class={
|
|
64
|
+
class={classesIn}
|
|
61
65
|
disabled={disabled || $loading}
|
|
62
66
|
{id}
|
|
63
67
|
maxlength={max ? Number(max) : undefined}
|
|
@@ -69,7 +73,7 @@
|
|
|
69
73
|
{:else if ['date', 'number'].includes(type)}
|
|
70
74
|
<input
|
|
71
75
|
bind:value
|
|
72
|
-
class={
|
|
76
|
+
class={classesIn}
|
|
73
77
|
disabled={disabled || $loading}
|
|
74
78
|
lang="fi-FI"
|
|
75
79
|
{max}
|
|
@@ -88,7 +92,7 @@
|
|
|
88
92
|
{placeholder}
|
|
89
93
|
{required}
|
|
90
94
|
{type}
|
|
91
|
-
class={
|
|
95
|
+
class={classesIn}
|
|
92
96
|
disabled={disabled || $loading}
|
|
93
97
|
maxlength={max ? Number(max) : undefined}
|
|
94
98
|
minlength={min ? Number(min) : undefined}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tuspe/components",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.9",
|
|
4
4
|
"description": "A reusable SvelteKit component library for form elements, breadcrumbs, prices and images.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"svelteKit",
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
"publint": "^0.3.12",
|
|
76
76
|
"svelte-check": "^4.1.7",
|
|
77
77
|
"svelte": "^5.28.2",
|
|
78
|
-
"typescript-eslint": "^8.
|
|
78
|
+
"typescript-eslint": "^8.32.0",
|
|
79
79
|
"typescript": "^5.8.3",
|
|
80
|
-
"vite": "^6.3.
|
|
80
|
+
"vite": "^6.3.5"
|
|
81
81
|
}
|
|
82
|
-
}
|
|
82
|
+
}
|