diff --git a/package.json b/package.json index 025f0858..ac8fcb76 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,30 @@ ], "main": "./lib/index", "module": "./es/index", + "types": "./es/index.d.ts", + "exports": { + ".": { + "types": "./es/index.d.ts", + "import": "./es/index.js", + "require": "./lib/index.js" + }, + "./assets/*": "./assets/*", + "./locale/*": { + "types": "./es/locale/*.d.ts", + "import": "./es/locale/*.js", + "require": "./lib/locale/*.js" + }, + "./lib/locale/*": { + "types": "./es/locale/*.d.ts", + "import": "./es/locale/*.js", + "require": "./lib/locale/*.js" + }, + "./es/locale/*": { + "types": "./es/locale/*.d.ts", + "import": "./es/locale/*.js", + "require": "./lib/locale/*.js" + } + }, "files": [ "assets/*.css", "assets/*.less", @@ -42,11 +66,11 @@ "prepare": "husky" }, "dependencies": { - "@rc-component/util": "^1.3.0", + "@rc-component/util": "^1.11.1", "clsx": "^2.1.1" }, "devDependencies": { - "@rc-component/father-plugin": "^2.0.2", + "@rc-component/father-plugin": "^2.2.0", "@rc-component/np": "^1.0.3", "@testing-library/jest-dom": "^6.1.5", "@testing-library/react": "^16.0.1", diff --git a/src/Options.tsx b/src/Options.tsx index 8e7b1118..aa570dc0 100644 --- a/src/Options.tsx +++ b/src/Options.tsx @@ -1,4 +1,4 @@ -import KEYCODE from '@rc-component/util/lib/KeyCode'; +import { KeyCode } from '@rc-component/util'; import React from 'react'; import type { PaginationLocale } from './interface'; @@ -85,7 +85,7 @@ const Options: React.FC = (props) => { if (goInputText === '') { return; } - if (e.keyCode === KEYCODE.ENTER || e.type === 'click') { + if (e.keyCode === KeyCode.ENTER || e.type === 'click') { setGoInputText(''); quickGo?.(getValidValue); } diff --git a/src/Pagination.tsx b/src/Pagination.tsx index b285eb06..452203d4 100644 --- a/src/Pagination.tsx +++ b/src/Pagination.tsx @@ -1,8 +1,10 @@ import { clsx } from 'clsx'; -import useControlledState from '@rc-component/util/lib/hooks/useControlledState'; -import KeyCode from '@rc-component/util/lib/KeyCode'; -import pickAttrs from '@rc-component/util/lib/pickAttrs'; -import warning from '@rc-component/util/lib/warning'; +import { + KeyCode, + pickAttrs, + useControlledState, + warning, +} from '@rc-component/util'; import React, { useEffect } from 'react'; import type { PaginationProps } from './interface'; import zhCN from './locale/zh_CN'; diff --git a/tests/index.test.tsx b/tests/index.test.tsx index 4e616e2c..08242676 100644 --- a/tests/index.test.tsx +++ b/tests/index.test.tsx @@ -2,7 +2,7 @@ import type { RenderResult } from '@testing-library/react'; import { render, fireEvent } from '@testing-library/react'; import React from 'react'; import Pagination from '../src'; -import { resetWarned } from '@rc-component/util/lib/warning'; +import { resetWarned } from '@rc-component/util'; import { sizeChangerRender } from './commonUtil'; describe('Default Pagination', () => {