@simplybusiness/mobius 6.9.2 → 6.9.3
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 +6 -0
- package/dist/cjs/index.js +0 -19
- package/dist/esm/index.js +0 -19
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/NumberField/NumberField.test.tsx +36 -1
- package/src/components/NumberField/NumberField.tsx +0 -31
- package/src/components/Radio/Radio.stories.tsx +35 -0
package/CHANGELOG.md
CHANGED
package/dist/cjs/index.js
CHANGED
|
@@ -3292,7 +3292,6 @@ Modal2.displayName = "Modal";
|
|
|
3292
3292
|
var import_dedupe35 = __toESM(require("classnames/dedupe"));
|
|
3293
3293
|
var import_react38 = require("react");
|
|
3294
3294
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3295
|
-
var SMALLEST_INCREMENT = 1e-3;
|
|
3296
3295
|
var NumberField = ({ ref, ...props }) => {
|
|
3297
3296
|
const {
|
|
3298
3297
|
minValue,
|
|
@@ -3328,23 +3327,6 @@ var NumberField = ({ ref, ...props }) => {
|
|
|
3328
3327
|
event.preventDefault();
|
|
3329
3328
|
}
|
|
3330
3329
|
};
|
|
3331
|
-
const handleChange = (event) => {
|
|
3332
|
-
const { value } = event.target;
|
|
3333
|
-
const numValue = parseFloat(value);
|
|
3334
|
-
if (value === "" || value === "-" || isNaN(numValue)) {
|
|
3335
|
-
otherProps.onChange?.(event);
|
|
3336
|
-
return;
|
|
3337
|
-
}
|
|
3338
|
-
if (step && step > 1) {
|
|
3339
|
-
const baseValue = minValue ?? 0;
|
|
3340
|
-
const remainder = (numValue - baseValue) % step;
|
|
3341
|
-
if (Math.abs(remainder) > SMALLEST_INCREMENT && Math.abs(remainder - step) > SMALLEST_INCREMENT) {
|
|
3342
|
-
event.preventDefault();
|
|
3343
|
-
return;
|
|
3344
|
-
}
|
|
3345
|
-
}
|
|
3346
|
-
otherProps.onChange?.(event);
|
|
3347
|
-
};
|
|
3348
3330
|
const handleBlur = (event) => {
|
|
3349
3331
|
const { value } = event.target;
|
|
3350
3332
|
const numValue = parseFloat(value);
|
|
@@ -3368,7 +3350,6 @@ var NumberField = ({ ref, ...props }) => {
|
|
|
3368
3350
|
};
|
|
3369
3351
|
const forwardedProps = {
|
|
3370
3352
|
...rest,
|
|
3371
|
-
onChange: handleChange,
|
|
3372
3353
|
onFocus: (e) => {
|
|
3373
3354
|
const el = e.currentTarget;
|
|
3374
3355
|
focusedInputRef.current?.removeEventListener("wheel", wheelHandler);
|
package/dist/esm/index.js
CHANGED
|
@@ -3189,7 +3189,6 @@ Modal2.displayName = "Modal";
|
|
|
3189
3189
|
import classNames37 from "classnames/dedupe";
|
|
3190
3190
|
import { useCallback as useCallback5, useEffect as useEffect21, useRef as useRef13 } from "react";
|
|
3191
3191
|
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
3192
|
-
var SMALLEST_INCREMENT = 1e-3;
|
|
3193
3192
|
var NumberField = ({ ref, ...props }) => {
|
|
3194
3193
|
const {
|
|
3195
3194
|
minValue,
|
|
@@ -3225,23 +3224,6 @@ var NumberField = ({ ref, ...props }) => {
|
|
|
3225
3224
|
event.preventDefault();
|
|
3226
3225
|
}
|
|
3227
3226
|
};
|
|
3228
|
-
const handleChange = (event) => {
|
|
3229
|
-
const { value } = event.target;
|
|
3230
|
-
const numValue = parseFloat(value);
|
|
3231
|
-
if (value === "" || value === "-" || isNaN(numValue)) {
|
|
3232
|
-
otherProps.onChange?.(event);
|
|
3233
|
-
return;
|
|
3234
|
-
}
|
|
3235
|
-
if (step && step > 1) {
|
|
3236
|
-
const baseValue = minValue ?? 0;
|
|
3237
|
-
const remainder = (numValue - baseValue) % step;
|
|
3238
|
-
if (Math.abs(remainder) > SMALLEST_INCREMENT && Math.abs(remainder - step) > SMALLEST_INCREMENT) {
|
|
3239
|
-
event.preventDefault();
|
|
3240
|
-
return;
|
|
3241
|
-
}
|
|
3242
|
-
}
|
|
3243
|
-
otherProps.onChange?.(event);
|
|
3244
|
-
};
|
|
3245
3227
|
const handleBlur = (event) => {
|
|
3246
3228
|
const { value } = event.target;
|
|
3247
3229
|
const numValue = parseFloat(value);
|
|
@@ -3265,7 +3247,6 @@ var NumberField = ({ ref, ...props }) => {
|
|
|
3265
3247
|
};
|
|
3266
3248
|
const forwardedProps = {
|
|
3267
3249
|
...rest,
|
|
3268
|
-
onChange: handleChange,
|
|
3269
3250
|
onFocus: (e) => {
|
|
3270
3251
|
const el = e.currentTarget;
|
|
3271
3252
|
focusedInputRef.current?.removeEventListener("wheel", wheelHandler);
|