noph-ui 0.26.0 → 0.26.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.
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
value = $bindable(),
|
|
19
19
|
label,
|
|
20
20
|
disabled,
|
|
21
|
+
required,
|
|
22
|
+
noAsterisk,
|
|
21
23
|
children,
|
|
22
24
|
onchange,
|
|
23
25
|
oninvalid,
|
|
@@ -27,8 +29,8 @@
|
|
|
27
29
|
const selectId = id ?? `select-${uid}`
|
|
28
30
|
|
|
29
31
|
let animateLabel = $state(false)
|
|
30
|
-
let errorTextRaw = $
|
|
31
|
-
let errorRaw = $
|
|
32
|
+
let errorTextRaw = $derived(errorText)
|
|
33
|
+
let errorRaw = $derived(error)
|
|
32
34
|
</script>
|
|
33
35
|
|
|
34
36
|
<div
|
|
@@ -37,6 +39,7 @@
|
|
|
37
39
|
variant,
|
|
38
40
|
errorRaw && 'error',
|
|
39
41
|
disabled && 'disabled',
|
|
42
|
+
required && !noAsterisk && 'asterisk',
|
|
40
43
|
(value === undefined || value === '' || value === null) && 'is-empty',
|
|
41
44
|
animateLabel && 'label-animate',
|
|
42
45
|
]}
|
|
@@ -78,6 +81,7 @@
|
|
|
78
81
|
oninvalid?.(event)
|
|
79
82
|
}}
|
|
80
83
|
{disabled}
|
|
84
|
+
{required}
|
|
81
85
|
id={selectId}
|
|
82
86
|
aria-invalid={error}
|
|
83
87
|
bind:value
|
|
@@ -277,6 +281,10 @@
|
|
|
277
281
|
font-size: 0.75rem;
|
|
278
282
|
}
|
|
279
283
|
|
|
284
|
+
.asterisk label::after {
|
|
285
|
+
content: '*';
|
|
286
|
+
}
|
|
287
|
+
|
|
280
288
|
.np-select-outline label {
|
|
281
289
|
transform: translateY(-0.5rem);
|
|
282
290
|
}
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
<style>
|
|
26
26
|
option {
|
|
27
|
+
all: unset;
|
|
27
28
|
cursor: pointer;
|
|
28
29
|
position: relative;
|
|
29
30
|
display: flex;
|
|
@@ -31,6 +32,7 @@
|
|
|
31
32
|
gap: 0.75rem;
|
|
32
33
|
height: 2rem;
|
|
33
34
|
background: var(--np-surface);
|
|
35
|
+
align-items: center;
|
|
34
36
|
|
|
35
37
|
&:checked {
|
|
36
38
|
background-color: var(--np-color-secondary-container);
|