@synerise/ds-input-number 2.0.4 → 2.0.6
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/CHANGELOG.md +19 -0
- package/CLAUDE.md +1 -1
- package/dist/InputNumber.js +1 -1
- package/dist/hooks/useStepper.js +1 -1
- package/dist/utils/inputNumber.utils.js +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.0.6](https://github.com/Synerise/synerise-design/compare/@synerise/ds-input-number@2.0.5...@synerise/ds-input-number@2.0.6) (2026-09-22)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **core:** move test helpers to a ./testing subpath export ([b38cd82](https://github.com/Synerise/synerise-design/commit/b38cd82c956111d2331d5c1e0efd1935366f1139))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [2.0.5](https://github.com/Synerise/synerise-design/compare/@synerise/ds-input-number@2.0.4...@synerise/ds-input-number@2.0.5) (2026-09-18)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @synerise/ds-input-number
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [2.0.4](https://github.com/Synerise/synerise-design/compare/@synerise/ds-input-number@2.0.3...@synerise/ds-input-number@2.0.4) (2026-09-16)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @synerise/ds-input-number
|
package/CLAUDE.md
CHANGED
|
@@ -103,7 +103,7 @@ All styling lives in `InputNumber.styles.tsx` as DS-native styled-components dri
|
|
|
103
103
|
|
|
104
104
|
> **Deep import**: `InputNumber.styles.tsx` imports `autoresizeConfObjToCss` from
|
|
105
105
|
> `@synerise/ds-input/dist/Input.styles` — a fragile internal path (pre-existing; flagged as an
|
|
106
|
-
>
|
|
106
|
+
> biome warning until ds-input exposes it from the root).
|
|
107
107
|
|
|
108
108
|
## Key dependencies
|
|
109
109
|
|
package/dist/InputNumber.js
CHANGED
|
@@ -4,8 +4,8 @@ import { v4 } from "uuid";
|
|
|
4
4
|
import { useDataFormat } from "@synerise/ds-core";
|
|
5
5
|
import FormField from "@synerise/ds-form-field";
|
|
6
6
|
import { useAutosizeWidth, useStretchToFit, SIZER_STYLE } from "@synerise/ds-input";
|
|
7
|
-
import { InputNumberRoot, HandlerWrap, HandlerUp, HandlerDown, InputFieldWrap, InputField, InputNumberAutosize, InputNumberContainer, InputNumberWrapper, GroupWrapper, Group, Addon } from "./InputNumber.styles.js";
|
|
8
7
|
import { useStepper } from "./hooks/useStepper.js";
|
|
8
|
+
import { InputNumberRoot, HandlerWrap, HandlerUp, HandlerDown, InputFieldWrap, InputField, InputNumberAutosize, InputNumberContainer, InputNumberWrapper, GroupWrapper, Group, Addon } from "./InputNumber.styles.js";
|
|
9
9
|
import { formatNumber, parseFormattedNumber } from "./utils/inputNumber.utils.js";
|
|
10
10
|
const AUTOSIZE_EXTRA_WIDTH = 45;
|
|
11
11
|
const NUMERIC_KEY = /^-?\d*(\.|,)?\d*$/i;
|
package/dist/hooks/useStepper.js
CHANGED
|
@@ -13,7 +13,7 @@ const countDecimals = (value) => {
|
|
|
13
13
|
return text.includes(".") ? text.split(".")[1].length : 0;
|
|
14
14
|
};
|
|
15
15
|
const scaledAdd = (a, b) => {
|
|
16
|
-
const factor =
|
|
16
|
+
const factor = 10 ** Math.max(countDecimals(a), countDecimals(b));
|
|
17
17
|
return (Math.round(a * factor) + Math.round(b * factor)) / factor;
|
|
18
18
|
};
|
|
19
19
|
const clamp = (value, min, max) => {
|
|
@@ -17,7 +17,7 @@ const formatNumber = (value, formatValue, notationThousandDelimiter, notationDec
|
|
|
17
17
|
const lastChar = value?.slice(-1);
|
|
18
18
|
const numberResult = parseFloat(value);
|
|
19
19
|
const notationDecimalChar = lastChar === NUMBER_DELIMITER ? notationDecimalDelimiter : "";
|
|
20
|
-
const zerosAtTheEnd = value.match(
|
|
20
|
+
const zerosAtTheEnd = value.match(/0+$/)?.[0];
|
|
21
21
|
const zerosWithDecimalDelimiterAtTheEnd = value.match(new RegExp(`\\${NUMBER_DELIMITER}0+$`))?.[0];
|
|
22
22
|
const numberDelimiterExists = new RegExp(`\\${NUMBER_DELIMITER}`).test(value);
|
|
23
23
|
if (Number.isNaN(numberResult)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-input-number",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.6",
|
|
4
4
|
"description": "Input-Number UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"sideEffects": false,
|
|
40
40
|
"types": "dist/index.d.ts",
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@synerise/ds-form-field": "^2.0.
|
|
43
|
-
"@synerise/ds-input": "^2.0.
|
|
44
|
-
"@synerise/ds-utils": "^2.
|
|
42
|
+
"@synerise/ds-form-field": "^2.0.5",
|
|
43
|
+
"@synerise/ds-input": "^2.0.6",
|
|
44
|
+
"@synerise/ds-utils": "^2.2.0",
|
|
45
45
|
"uuid": "^8.3.2"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"styled-components": "^5.3.3",
|
|
51
51
|
"vitest": "4"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "5e795fa4fd23f6b07277edb517a84bb9b5b6d256"
|
|
54
54
|
}
|