Skip to content

Commit 032ae49

Browse files
committed
refactor: use mini-decimal
1 parent 1bfec7a commit 032ae49

File tree

7 files changed

+49
-607
lines changed

7 files changed

+49
-607
lines changed

package.json

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,38 @@
88
"react-input-number",
99
"input-number"
1010
],
11-
"files": [
12-
"lib",
13-
"es",
14-
"assets/*.css"
15-
],
16-
"main": "./lib/index",
17-
"module": "./es/index",
1811
"homepage": "https://github.com/react-component/input-number",
19-
"author": "tsjxyz@gmail.com",
12+
"bugs": {
13+
"url": "http://github.com/react-component/input-number/issues"
14+
},
2015
"repository": {
2116
"type": "git",
2217
"url": "git@github.com:react-component/input-number.git"
2318
},
24-
"bugs": {
25-
"url": "http://github.com/react-component/input-number/issues"
26-
},
2719
"license": "MIT",
20+
"author": "tsjxyz@gmail.com",
21+
"main": "./lib/index",
22+
"module": "./es/index",
23+
"files": [
24+
"lib",
25+
"es",
26+
"assets/*.css"
27+
],
2828
"scripts": {
29-
"start": "dumi dev",
29+
"compile": "father-build && lessc assets/index.less assets/index.css",
30+
"coverage": "father test --coverage",
3031
"docs:build": "dumi build",
3132
"docs:deploy": "gh-pages -d docs-dist",
32-
"compile": "father-build && lessc assets/index.less assets/index.css",
33-
"prepublishOnly": "npm run compile && np --yolo --no-publish",
3433
"lint": "eslint src/ --ext .ts,.tsx,.jsx,.js,.md",
34+
"now-build": "npm run docs:build",
35+
"prepublishOnly": "npm run compile && np --yolo --no-publish",
3536
"prettier": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"",
36-
"test": "father test",
37-
"coverage": "father test --coverage",
38-
"now-build": "npm run docs:build"
37+
"start": "dumi dev",
38+
"test": "father test"
3939
},
4040
"dependencies": {
4141
"@babel/runtime": "^7.10.1",
42+
"@rc-component/mini-decimal": "^1.0.1",
4243
"classnames": "^2.2.5",
4344
"rc-util": "^5.23.0"
4445
},

src/InputNumber.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,16 @@ import classNames from 'classnames';
33
import KeyCode from 'rc-util/lib/KeyCode';
44
import { useLayoutUpdateEffect } from 'rc-util/lib/hooks/useLayoutEffect';
55
import { composeRef } from 'rc-util/lib/ref';
6-
import getMiniDecimal, { DecimalClass, toFixed, ValueType } from './utils/MiniDecimal';
6+
import getMiniDecimal, {
7+
DecimalClass,
8+
toFixed,
9+
ValueType,
10+
getNumberPrecision,
11+
num2str,
12+
validateNumber,
13+
} from '@rc-component/mini-decimal';
714
import StepHandler from './StepHandler';
8-
import { getNumberPrecision, num2str, getDecupleSteps, validateNumber } from './utils/numberUtil';
15+
import { getDecupleSteps } from './utils/numberUtil';
916
import useCursor from './hooks/useCursor';
1017

1118
import useFrame from './hooks/useFrame';

src/utils/MiniDecimal.ts

Lines changed: 0 additions & 305 deletions
This file was deleted.

0 commit comments

Comments
 (0)