diff --git a/docs/demo/combination-key-format.tsx b/docs/demo/combination-key-format.tsx index 9727279f..75180804 100644 --- a/docs/demo/combination-key-format.tsx +++ b/docs/demo/combination-key-format.tsx @@ -1,6 +1,6 @@ /* eslint no-console:0 */ import React from 'react'; -import InputNumber from 'rc-input-number'; +import InputNumber from '@rc-component/input-number'; import '../../assets/index.less'; class Component extends React.Component { diff --git a/docs/demo/custom.tsx b/docs/demo/custom.tsx index b2bf7e19..ac8f9295 100644 --- a/docs/demo/custom.tsx +++ b/docs/demo/custom.tsx @@ -1,6 +1,6 @@ /* eslint no-console:0 */ import React from 'react'; -import InputNumber from 'rc-input-number'; +import InputNumber from '@rc-component/input-number'; import '../../assets/index.less'; class Component extends React.Component { diff --git a/docs/demo/debug.tsx b/docs/demo/debug.tsx index 6212b9df..88870f37 100644 --- a/docs/demo/debug.tsx +++ b/docs/demo/debug.tsx @@ -1,6 +1,6 @@ /* eslint no-console:0 */ import React, { useEffect } from 'react'; -import InputNumber from 'rc-input-number'; +import InputNumber from '@rc-component/input-number'; import '../../assets/index.less'; export default () => { diff --git a/docs/demo/decimal.tsx b/docs/demo/decimal.tsx index 785d9f83..2c0edcad 100644 --- a/docs/demo/decimal.tsx +++ b/docs/demo/decimal.tsx @@ -1,6 +1,6 @@ /* eslint no-console:0 */ import React from 'react'; -import InputNumber from 'rc-input-number'; +import InputNumber from '@rc-component/input-number'; import '../../assets/index.less'; export default class Demo extends React.Component { diff --git a/docs/demo/focus.tsx b/docs/demo/focus.tsx index 7b114b63..6c1651dd 100644 --- a/docs/demo/focus.tsx +++ b/docs/demo/focus.tsx @@ -1,5 +1,5 @@ /* eslint no-console:0 */ -import InputNumber, { InputNumberRef } from 'rc-input-number'; +import InputNumber, { InputNumberRef } from '@rc-component/input-number'; import React from 'react'; import '../../assets/index.less'; diff --git a/docs/demo/formatter.tsx b/docs/demo/formatter.tsx index 735acc9f..f3e030e5 100644 --- a/docs/demo/formatter.tsx +++ b/docs/demo/formatter.tsx @@ -1,6 +1,6 @@ /* eslint no-console:0 */ import React from 'react'; -import InputNumber from 'rc-input-number'; +import InputNumber from '@rc-component/input-number'; import '../../assets/index.less'; function getSum(str) { diff --git a/docs/demo/input-control.tsx b/docs/demo/input-control.tsx index 33bc1d69..2fe8db9a 100644 --- a/docs/demo/input-control.tsx +++ b/docs/demo/input-control.tsx @@ -1,7 +1,7 @@ /* eslint no-console:0 */ import React from 'react'; -import type { ValueType} from 'rc-input-number' -import InputNumber from 'rc-input-number'; +import type { ValueType} from '@rc-component/input-number' +import InputNumber from '@rc-component/input-number'; import '../../assets/index.less'; export default () => { diff --git a/docs/demo/precision.tsx b/docs/demo/precision.tsx index 99d2e73d..cdfc552e 100644 --- a/docs/demo/precision.tsx +++ b/docs/demo/precision.tsx @@ -1,6 +1,6 @@ /* eslint no-console:0 */ import React from 'react'; -import InputNumber from 'rc-input-number'; +import InputNumber from '@rc-component/input-number'; import '../../assets/index.less'; export default () => { diff --git a/docs/demo/simple.tsx b/docs/demo/simple.tsx index 77d16033..bed250f7 100644 --- a/docs/demo/simple.tsx +++ b/docs/demo/simple.tsx @@ -1,5 +1,5 @@ /* eslint no-console:0 */ -import InputNumber from 'rc-input-number'; +import InputNumber from '@rc-component/input-number'; import React from 'react'; import '../../assets/index.less'; diff --git a/docs/demo/small-step.tsx b/docs/demo/small-step.tsx index 64376f44..2f0380c4 100644 --- a/docs/demo/small-step.tsx +++ b/docs/demo/small-step.tsx @@ -1,6 +1,6 @@ /* eslint no-console:0 */ import React from 'react'; -import InputNum from 'rc-input-number'; +import InputNum from '@rc-component/input-number'; import '../../assets/index.less'; export default () => { diff --git a/docs/demo/wheel.tsx b/docs/demo/wheel.tsx index 84b2b70e..51ee7e95 100644 --- a/docs/demo/wheel.tsx +++ b/docs/demo/wheel.tsx @@ -1,5 +1,5 @@ /* eslint no-console:0 */ -import InputNumber from 'rc-input-number'; +import InputNumber from '@rc-component/input-number'; import React from 'react'; import '../../assets/index.less'; diff --git a/package.json b/package.json index 2a00f260..13a9fe63 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "rc-input-number", - "version": "9.4.0", + "name": "@rc-component/input-number", + "version": "1.0.0", "description": "React input-number component", "keywords": [ "react", @@ -34,7 +34,7 @@ "lint": "eslint src/ --ext .ts,.tsx,.jsx,.js,.md", "now-build": "npm run docs:build", "prepare": "husky install", - "prepublishOnly": "npm run compile && np --yolo --no-publish", + "prepublishOnly": "npm run compile && rc-np", "prettier": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"", "start": "dumi dev", "test": "rc-test" @@ -46,14 +46,14 @@ ] }, "dependencies": { - "@babel/runtime": "^7.10.1", "@rc-component/mini-decimal": "^1.0.1", "classnames": "^2.2.5", - "rc-input": "~1.7.1", - "rc-util": "^5.40.1" + "@rc-component/input": "~1.0.0", + "@rc-component/util": "^1.2.0" }, "devDependencies": { - "@rc-component/father-plugin": "^1.0.1", + "@rc-component/father-plugin": "^2.0.2", + "@rc-component/np": "^1.0.3", "@swc-node/jest": "^1.5.5", "@testing-library/jest-dom": "^6.1.5", "@testing-library/react": "^16.0.0", diff --git a/src/InputNumber.tsx b/src/InputNumber.tsx index 78c04b9b..07e3ac0e 100644 --- a/src/InputNumber.tsx +++ b/src/InputNumber.tsx @@ -7,18 +7,18 @@ import getMiniDecimal, { ValueType, } from '@rc-component/mini-decimal'; import clsx from 'classnames'; -import { BaseInput } from 'rc-input'; -import { useLayoutUpdateEffect } from 'rc-util/lib/hooks/useLayoutEffect'; -import proxyObject from 'rc-util/lib/proxyObject'; -import { composeRef } from 'rc-util/lib/ref'; +import { BaseInput } from '@rc-component/input'; +import { useLayoutUpdateEffect } from '@rc-component/util/lib/hooks/useLayoutEffect'; +import proxyObject from '@rc-component/util/lib/proxyObject'; +import { composeRef } from '@rc-component/util/lib/ref'; import * as React from 'react'; import useCursor from './hooks/useCursor'; import StepHandler from './StepHandler'; import { getDecupleSteps } from './utils/numberUtil'; -import type { HolderRef } from 'rc-input/lib/BaseInput'; -import { BaseInputProps } from 'rc-input/lib/interface'; -import { InputFocusOptions, triggerFocus } from 'rc-input/lib/utils/commonUtils'; +import type { HolderRef } from '@rc-component/input/lib/BaseInput'; +import { BaseInputProps } from '@rc-component/input/lib/interface'; +import { InputFocusOptions, triggerFocus } from '@rc-component/input/lib/utils/commonUtils'; import useFrame from './hooks/useFrame'; export type { ValueType }; diff --git a/src/StepHandler.tsx b/src/StepHandler.tsx index aaafb41e..2d6da10c 100644 --- a/src/StepHandler.tsx +++ b/src/StepHandler.tsx @@ -1,8 +1,8 @@ /* eslint-disable react/no-unknown-property */ import * as React from 'react'; import classNames from 'classnames'; -import useMobile from 'rc-util/lib/hooks/useMobile'; -import raf from 'rc-util/lib/raf'; +import useMobile from '@rc-component/util/lib/hooks/useMobile'; +import raf from '@rc-component/util/lib/raf'; /** * When click and hold on a button - the speed of auto changing the value. diff --git a/src/hooks/useCursor.ts b/src/hooks/useCursor.ts index 10d7c503..5a70a877 100644 --- a/src/hooks/useCursor.ts +++ b/src/hooks/useCursor.ts @@ -1,5 +1,5 @@ import { useRef } from 'react'; -import warning from 'rc-util/lib/warning'; +import warning from '@rc-component/util/lib/warning'; /** * Keep input cursor in the correct position if possible. * Is this necessary since we have `formatter` which may mass the content? diff --git a/src/hooks/useFrame.ts b/src/hooks/useFrame.ts index d0902577..44634ef4 100644 --- a/src/hooks/useFrame.ts +++ b/src/hooks/useFrame.ts @@ -1,5 +1,5 @@ import { useRef, useEffect } from 'react'; -import raf from 'rc-util/lib/raf'; +import raf from '@rc-component/util/lib/raf'; /** * Always trigger latest once when call multiple time diff --git a/tests/click.test.tsx b/tests/click.test.tsx index 96023038..d70af273 100644 --- a/tests/click.test.tsx +++ b/tests/click.test.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { render, fireEvent, act } from '@testing-library/react'; import InputNumber, { InputNumberProps } from '../src'; -import KeyCode from 'rc-util/lib/KeyCode'; +import KeyCode from '@rc-component/util/lib/KeyCode'; jest.mock('@rc-component/mini-decimal/lib/supportUtil'); const { supportBigInt } = require('@rc-component/mini-decimal/lib/supportUtil'); diff --git a/tests/cursor.test.tsx b/tests/cursor.test.tsx index 83003b83..90669640 100644 --- a/tests/cursor.test.tsx +++ b/tests/cursor.test.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import KeyCode from 'rc-util/lib/KeyCode'; +import KeyCode from '@rc-component/util/lib/KeyCode'; import { render, fireEvent } from './util/wrapper'; import InputNumber from '../src'; diff --git a/tests/focus.test.tsx b/tests/focus.test.tsx index a71bd577..33a69c8f 100644 --- a/tests/focus.test.tsx +++ b/tests/focus.test.tsx @@ -1,6 +1,6 @@ import { fireEvent, render } from '@testing-library/react'; -import InputNumber, { InputNumberRef } from 'rc-input-number'; -import { spyElementPrototypes } from 'rc-util/lib/test/domHook'; +import InputNumber, { InputNumberRef } from '../src'; +import { spyElementPrototypes } from '@rc-component/util/lib/test/domHook'; import React from 'react'; const getInputRef = () => { diff --git a/tests/formatter.test.tsx b/tests/formatter.test.tsx index c5419769..1947de7d 100644 --- a/tests/formatter.test.tsx +++ b/tests/formatter.test.tsx @@ -1,4 +1,4 @@ -import KeyCode from 'rc-util/lib/KeyCode'; +import KeyCode from '@rc-component/util/lib/KeyCode'; import React from 'react'; import InputNumber from '../src'; import { fireEvent, render } from './util/wrapper'; diff --git a/tests/github.test.tsx b/tests/github.test.tsx index 1edcb35c..e1e3b94e 100644 --- a/tests/github.test.tsx +++ b/tests/github.test.tsx @@ -1,4 +1,4 @@ -import KeyCode from 'rc-util/lib/KeyCode'; +import KeyCode from '@rc-component/util/lib/KeyCode'; import React from 'react'; import InputNumber from '../src'; import { act, fireEvent, render, screen, waitFor } from './util/wrapper'; diff --git a/tests/input.test.tsx b/tests/input.test.tsx index 095aa11d..ee0ea161 100644 --- a/tests/input.test.tsx +++ b/tests/input.test.tsx @@ -1,4 +1,4 @@ -import KeyCode from 'rc-util/lib/KeyCode'; +import KeyCode from '@rc-component/util/lib/KeyCode'; import React from 'react'; import InputNumber, { InputNumberProps, InputNumberRef } from '../src'; import { fireEvent, render } from './util/wrapper'; diff --git a/tests/keyboard.test.tsx b/tests/keyboard.test.tsx index a6f1dfa7..596735c6 100644 --- a/tests/keyboard.test.tsx +++ b/tests/keyboard.test.tsx @@ -1,4 +1,4 @@ -import KeyCode from 'rc-util/lib/KeyCode'; +import KeyCode from '@rc-component/util/lib/KeyCode'; import InputNumber from '../src'; import { fireEvent, render } from './util/wrapper'; diff --git a/tests/mobile.test.tsx b/tests/mobile.test.tsx index 2a7eda28..5e4c4c59 100644 --- a/tests/mobile.test.tsx +++ b/tests/mobile.test.tsx @@ -3,7 +3,7 @@ import { render } from './util/wrapper'; import InputNumber from '../src'; import { renderToString } from 'react-dom/server'; -jest.mock('rc-util/lib/isMobile', () => () => true); +jest.mock('@rc-component/util/lib/isMobile', () => () => true); // Mobile touch experience is not user-friendly which not apply in antd. // Let's hide operator instead. diff --git a/tests/precision.test.tsx b/tests/precision.test.tsx index 353a2a5d..60f8fc20 100644 --- a/tests/precision.test.tsx +++ b/tests/precision.test.tsx @@ -1,7 +1,7 @@ import React from 'react'; import '@testing-library/jest-dom'; import { render, fireEvent } from '@testing-library/react'; -import KeyCode from 'rc-util/lib/KeyCode'; +import KeyCode from '@rc-component/util/lib/KeyCode'; import InputNumber from '../src'; describe('InputNumber.Precision', () => { diff --git a/tests/props.test.tsx b/tests/props.test.tsx index 9f488f85..0b50c102 100644 --- a/tests/props.test.tsx +++ b/tests/props.test.tsx @@ -1,7 +1,7 @@ import React from 'react'; import '@testing-library/jest-dom'; import { render, fireEvent } from '@testing-library/react'; -import KeyCode from 'rc-util/lib/KeyCode'; +import KeyCode from '@rc-component/util/lib/KeyCode'; import type { ValueType } from '../src' import InputNumber from '../src'; diff --git a/tests/wheel.test.tsx b/tests/wheel.test.tsx index 07707c42..1e0404e0 100644 --- a/tests/wheel.test.tsx +++ b/tests/wheel.test.tsx @@ -1,4 +1,4 @@ -import KeyCode from 'rc-util/lib/KeyCode'; +import KeyCode from '@rc-component/util/lib/KeyCode'; import InputNumber from '../src'; import { fireEvent, render } from './util/wrapper'; diff --git a/tsconfig.json b/tsconfig.json index 0314f9fe..172aabc3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,7 +10,7 @@ "paths": { "@/*": ["src/*"], "@@/*": ["src/.umi/*"], - "rc-input-number": ["src/index.ts"] + "@rc-component/input-number": ["src/index.ts"] } } }