@r2digisolutions/ui 0.15.0 → 0.15.2
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,11 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type {
|
|
2
|
+
import type { IFileInputProps, Props } from './type.js';
|
|
3
3
|
|
|
4
4
|
const { onchange, type = 'text', ...props }: Props = $props();
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
<input
|
|
8
8
|
{...props}
|
|
9
|
+
{type}
|
|
9
10
|
onchange={(e) => {
|
|
10
11
|
const value = e.currentTarget.value;
|
|
11
12
|
|
|
@@ -16,7 +17,7 @@
|
|
|
16
17
|
const inputEl = e.currentTarget as HTMLInputElement;
|
|
17
18
|
const files = inputEl.files;
|
|
18
19
|
|
|
19
|
-
const fileValue = (props as
|
|
20
|
+
const fileValue = (props as IFileInputProps).multiple
|
|
20
21
|
? Array.from(files ?? [])
|
|
21
22
|
: (files?.[0] ?? null);
|
|
22
23
|
|
|
@@ -25,5 +26,8 @@
|
|
|
25
26
|
(onchange as (value: string | null, e: Event) => void)?.(value || null, e);
|
|
26
27
|
}
|
|
27
28
|
}}
|
|
28
|
-
class=
|
|
29
|
+
class={[
|
|
30
|
+
'block w-full rounded-lg border border-gray-300 py-3 pr-3 pl-10 transition-colors focus:border-transparent focus:ring-2 focus:ring-purple-500',
|
|
31
|
+
props.class
|
|
32
|
+
]}
|
|
29
33
|
/>
|