@graphcommerce/ecommerce-ui 10.0.0-canary.65 → 10.0.0-canary.67
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
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @graphcommerce/ecommerce-ui
|
|
2
2
|
|
|
3
|
+
## 10.0.0-canary.67
|
|
4
|
+
|
|
5
|
+
## 10.0.0-canary.66
|
|
6
|
+
|
|
7
|
+
### Patch Changes
|
|
8
|
+
|
|
9
|
+
- [#2538](https://github.com/graphcommerce-org/graphcommerce/pull/2538) [`9b96d69`](https://github.com/graphcommerce-org/graphcommerce/commit/9b96d69d2aba2779e1875ffb068096087582f10d) - fix issue where stepper could have values such as 8,10000000000 inste… ([@FrankHarland](https://github.com/FrankHarland))
|
|
10
|
+
|
|
3
11
|
## 10.0.0-canary.65
|
|
4
12
|
|
|
5
13
|
## 10.0.0-canary.64
|
|
@@ -34,11 +34,10 @@ const { withState } = extendableComponent<OwnerState, typeof componentName, type
|
|
|
34
34
|
parts,
|
|
35
35
|
)
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
return Math.round(newStepValue * 100) / 100
|
|
37
|
+
// Add precision rounding helper
|
|
38
|
+
const roundToPrecision = (num: number, precision: number = 2): number => {
|
|
39
|
+
const factor = Math.pow(10, precision)
|
|
40
|
+
return Math.round(num * factor) / factor
|
|
42
41
|
}
|
|
43
42
|
|
|
44
43
|
/** @public */
|
|
@@ -142,8 +141,9 @@ function NumberFieldElementBase(props: NumberFieldElementProps) {
|
|
|
142
141
|
(inputProps.min === 0 && valueAsNumber <= inputProps.min)
|
|
143
142
|
)
|
|
144
143
|
return
|
|
145
|
-
// Round to nearest step
|
|
146
|
-
|
|
144
|
+
// Round to nearest step with precision fix
|
|
145
|
+
const newValue = roundToPrecision(Math.round((valueAsNumber - step) / step) * step)
|
|
146
|
+
onChange(newValue)
|
|
147
147
|
}}
|
|
148
148
|
sx={{
|
|
149
149
|
boxShadow: variant === 'standard' ? 4 : 0,
|
|
@@ -164,8 +164,9 @@ function NumberFieldElementBase(props: NumberFieldElementProps) {
|
|
|
164
164
|
size='smaller'
|
|
165
165
|
onClick={() => {
|
|
166
166
|
if (valueAsNumber >= (inputProps.max ?? Infinity)) return
|
|
167
|
-
// Round to nearest step
|
|
168
|
-
|
|
167
|
+
// Round to nearest step with precision fix
|
|
168
|
+
const newValue = roundToPrecision(Math.round((valueAsNumber + step) / step) * step)
|
|
169
|
+
onChange(newValue)
|
|
169
170
|
}}
|
|
170
171
|
sx={{
|
|
171
172
|
boxShadow: variant === 'standard' ? 4 : 0,
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/ecommerce-ui",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "10.0.0-canary.
|
|
5
|
+
"version": "10.0.0-canary.67",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@graphcommerce/eslint-config-pwa": "^10.0.0-canary.
|
|
16
|
-
"@graphcommerce/graphql": "^10.0.0-canary.
|
|
17
|
-
"@graphcommerce/next-ui": "^10.0.0-canary.
|
|
18
|
-
"@graphcommerce/prettier-config-pwa": "^10.0.0-canary.
|
|
19
|
-
"@graphcommerce/react-hook-form": "^10.0.0-canary.
|
|
20
|
-
"@graphcommerce/typescript-config-pwa": "^10.0.0-canary.
|
|
15
|
+
"@graphcommerce/eslint-config-pwa": "^10.0.0-canary.67",
|
|
16
|
+
"@graphcommerce/graphql": "^10.0.0-canary.67",
|
|
17
|
+
"@graphcommerce/next-ui": "^10.0.0-canary.67",
|
|
18
|
+
"@graphcommerce/prettier-config-pwa": "^10.0.0-canary.67",
|
|
19
|
+
"@graphcommerce/react-hook-form": "^10.0.0-canary.67",
|
|
20
|
+
"@graphcommerce/typescript-config-pwa": "^10.0.0-canary.67",
|
|
21
21
|
"@lingui/core": "^5",
|
|
22
22
|
"@lingui/macro": "^5",
|
|
23
23
|
"@lingui/react": "^5",
|