kelt-ui-kit-react 1.5.8 → 1.5.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.
|
@@ -12,7 +12,7 @@ export type InputNumberProps = {
|
|
|
12
12
|
autoComplete?: string;
|
|
13
13
|
tabIndex?: number;
|
|
14
14
|
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
15
|
-
onChange?: (e: React.ChangeEvent<HTMLInputElement
|
|
15
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>, valueFormat?: string) => void;
|
|
16
16
|
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
17
17
|
onClick?: (e: React.MouseEvent<HTMLInputElement>) => void;
|
|
18
18
|
onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
package/dist/index.js
CHANGED
|
@@ -4638,7 +4638,7 @@ const Ll = ({
|
|
|
4638
4638
|
const j = R(
|
|
4639
4639
|
(D) => {
|
|
4640
4640
|
let S = D.target.value.replace(",", ".");
|
|
4641
|
-
!/^-?\d*[.,]?\d*$/.test(S) && S !== "" || l && S.length > l || v == null || v(D);
|
|
4641
|
+
!/^-?\d*[.,]?\d*$/.test(S) && S !== "" || l && S.length > l || v == null || v(D, S);
|
|
4642
4642
|
},
|
|
4643
4643
|
[v, l]
|
|
4644
4644
|
), b = (D) => {
|
|
@@ -4690,7 +4690,10 @@ const Vl = nt(
|
|
|
4690
4690
|
...i
|
|
4691
4691
|
}, s) => {
|
|
4692
4692
|
const c = R(() => {
|
|
4693
|
-
|
|
4693
|
+
if (a) {
|
|
4694
|
+
let l = e.replace(",", ".");
|
|
4695
|
+
a(parseFloat(l || "0").toFixed(2));
|
|
4696
|
+
}
|
|
4694
4697
|
}, [a, e]);
|
|
4695
4698
|
return /* @__PURE__ */ o.jsx(
|
|
4696
4699
|
Fo,
|
package/package.json
CHANGED
|
@@ -15,7 +15,10 @@ export type InputNumberProps = {
|
|
|
15
15
|
autoComplete?: string;
|
|
16
16
|
tabIndex?: number;
|
|
17
17
|
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
18
|
-
onChange?: (
|
|
18
|
+
onChange?: (
|
|
19
|
+
e: React.ChangeEvent<HTMLInputElement>,
|
|
20
|
+
valueFormat?: string
|
|
21
|
+
) => void;
|
|
19
22
|
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
20
23
|
onClick?: (e: React.MouseEvent<HTMLInputElement>) => void;
|
|
21
24
|
onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
@@ -57,7 +60,7 @@ export const InputNumber = forwardRef<HTMLInputElement, InputNumberProps>(
|
|
|
57
60
|
return;
|
|
58
61
|
}
|
|
59
62
|
|
|
60
|
-
onChange?.(e);
|
|
63
|
+
onChange?.(e, newValue);
|
|
61
64
|
},
|
|
62
65
|
[onChange, maxLength]
|
|
63
66
|
);
|
|
@@ -22,7 +22,8 @@ export const InputPrice = forwardRef<HTMLInputElement, InputPriceProps>(
|
|
|
22
22
|
) => {
|
|
23
23
|
const handleBlur = useCallback(() => {
|
|
24
24
|
if (onChange) {
|
|
25
|
-
|
|
25
|
+
let newValue = value.replace(",", ".");
|
|
26
|
+
onChange(parseFloat(newValue || "0").toFixed(2));
|
|
26
27
|
}
|
|
27
28
|
}, [onChange, value]);
|
|
28
29
|
|