@immich/ui 0.37.0 → 0.37.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.
|
@@ -2,14 +2,20 @@
|
|
|
2
2
|
import Input from '../Input/Input.svelte';
|
|
3
3
|
import type { NumberInputProps } from '../../types.js';
|
|
4
4
|
|
|
5
|
-
let { value = $bindable
|
|
5
|
+
let { value = $bindable(), color = 'secondary', size, ...props }: NumberInputProps = $props();
|
|
6
6
|
|
|
7
|
-
const getValue = () => String(value
|
|
7
|
+
const getValue = () => (typeof value === 'number' ? String(value) : '');
|
|
8
8
|
const setValue = (newValue: string) => {
|
|
9
|
+
if (!newValue) {
|
|
10
|
+
value = undefined;
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
|
|
9
14
|
const parsed = parseFloat(newValue);
|
|
10
|
-
if (isNaN(parsed)) {
|
|
15
|
+
if (Number.isNaN(parsed)) {
|
|
11
16
|
return;
|
|
12
17
|
}
|
|
18
|
+
|
|
13
19
|
value = parsed;
|
|
14
20
|
};
|
|
15
21
|
</script>
|
package/dist/types.d.ts
CHANGED
|
@@ -117,7 +117,7 @@ type BaseInputProps<T> = {
|
|
|
117
117
|
export type InputProps = BaseInputProps<string> & {
|
|
118
118
|
type?: HTMLInputAttributes['type'];
|
|
119
119
|
};
|
|
120
|
-
export type NumberInputProps = BaseInputProps<number>;
|
|
120
|
+
export type NumberInputProps = BaseInputProps<number | undefined>;
|
|
121
121
|
export type PasswordInputProps = BaseInputProps<string> & {
|
|
122
122
|
translations?: TranslationProps<'show_password' | 'hide_password'>;
|
|
123
123
|
isVisible?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@immich/ui",
|
|
3
|
-
"version": "0.37.
|
|
3
|
+
"version": "0.37.1",
|
|
4
4
|
"license": "GNU Affero General Public License version 3",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"globals": "^16.0.0",
|
|
61
61
|
"prettier": "^3.3.2",
|
|
62
62
|
"prettier-plugin-svelte": "^3.2.6",
|
|
63
|
-
"prettier-plugin-tailwindcss": "^0.
|
|
63
|
+
"prettier-plugin-tailwindcss": "^0.7.0",
|
|
64
64
|
"publint": "^0.3.0",
|
|
65
65
|
"svelte": "^5.37.0",
|
|
66
66
|
"svelte-check": "^4.0.0",
|