@sustaina/shared-ui 1.64.1 → 1.64.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.
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -16904,10 +16904,10 @@ var createSourceInfo = (event) => ({
|
|
|
16904
16904
|
source: event ? "event" : "prop"
|
|
16905
16905
|
});
|
|
16906
16906
|
var parseToNumber = (val) => {
|
|
16907
|
-
if (typeof val === "number") return val;
|
|
16907
|
+
if (typeof val === "number") return Number.isFinite(val) ? val : void 0;
|
|
16908
16908
|
if (typeof val === "string" && val !== "") {
|
|
16909
16909
|
const parsed = parseFloat(val);
|
|
16910
|
-
if (
|
|
16910
|
+
if (Number.isFinite(parsed)) return parsed;
|
|
16911
16911
|
}
|
|
16912
16912
|
return void 0;
|
|
16913
16913
|
};
|
|
@@ -17299,14 +17299,16 @@ var InputNumber = ({
|
|
|
17299
17299
|
});
|
|
17300
17300
|
const handleValueChange = React__namespace.useCallback(
|
|
17301
17301
|
(values, sourceInfo) => {
|
|
17302
|
+
const safeFloatValue = typeof values.floatValue === "number" && Number.isFinite(values.floatValue) ? values.floatValue : void 0;
|
|
17303
|
+
const normalizedValues = safeFloatValue === values.floatValue ? values : { ...values, floatValue: safeFloatValue };
|
|
17302
17304
|
if (sourceInfo.source === "event") {
|
|
17303
17305
|
isEditingRef.current = true;
|
|
17304
17306
|
setDisplayOverride(values.value);
|
|
17305
17307
|
}
|
|
17306
|
-
setNumericValue(
|
|
17308
|
+
setNumericValue(safeFloatValue);
|
|
17307
17309
|
rawRef.current = values.value;
|
|
17308
|
-
onValueChange?.(
|
|
17309
|
-
if (
|
|
17310
|
+
onValueChange?.(normalizedValues, sourceInfo);
|
|
17311
|
+
if (safeFloatValue !== void 0) onStepChange?.(safeFloatValue);
|
|
17310
17312
|
},
|
|
17311
17313
|
[onValueChange, onStepChange]
|
|
17312
17314
|
);
|