diff --git a/package.json b/package.json index 2ba11fe2d..1931f1869 100644 --- a/package.json +++ b/package.json @@ -51,9 +51,9 @@ "dependencies": { "@rc-component/trigger": "^3.0.0", "@rc-component/util": "^1.3.0", + "@rc-component/virtual-list": "^1.0.1", "clsx": "^2.1.1", - "rc-overflow": "^1.5.0", - "rc-virtual-list": "^3.5.2" + "rc-overflow": "^1.5.0" }, "devDependencies": { "@rc-component/father-plugin": "^2.0.2", @@ -76,7 +76,7 @@ "prettier": "^3.1.1", "querystring": "^0.2.1", "rc-dialog": "^9.0.0", - "rc-test": "^7.0.9", + "rc-test": "^7.1.2", "react": "^18.2.0", "react-dom": "^18.2.0", "typescript": "^5.2.2" diff --git a/src/BaseSelect/index.tsx b/src/BaseSelect/index.tsx index 1cd445cde..d740e91ad 100644 --- a/src/BaseSelect/index.tsx +++ b/src/BaseSelect/index.tsx @@ -1,7 +1,7 @@ import type { AlignType, BuildInPlacements } from '@rc-component/trigger/lib/interface'; import { clsx } from 'clsx'; import { getDOM } from '@rc-component/util/lib/Dom/findDOMNode'; -import type { ScrollConfig, ScrollTo } from 'rc-virtual-list/lib/List'; +import type { ScrollConfig, ScrollTo } from '@rc-component/virtual-list/lib/List'; import * as React from 'react'; import { useAllowClear } from '../hooks/useAllowClear'; import { BaseSelectContext } from '../hooks/useBaseProps'; diff --git a/src/OptionList.tsx b/src/OptionList.tsx index d2e8b2212..c24c19ecf 100644 --- a/src/OptionList.tsx +++ b/src/OptionList.tsx @@ -3,9 +3,9 @@ import KeyCode from '@rc-component/util/lib/KeyCode'; import useMemo from '@rc-component/util/lib/hooks/useMemo'; import omit from '@rc-component/util/lib/omit'; import pickAttrs from '@rc-component/util/lib/pickAttrs'; -import type { ListRef } from 'rc-virtual-list'; -import List from 'rc-virtual-list'; -import type { ScrollConfig } from 'rc-virtual-list/lib/List'; +import type { ListRef } from '@rc-component/virtual-list'; +import List from '@rc-component/virtual-list'; +import type { ScrollConfig } from '@rc-component/virtual-list/lib/List'; import * as React from 'react'; import { useEffect } from 'react'; import type { BaseOptionType, RawValueType } from './Select'; diff --git a/tests/OptionList.test.tsx b/tests/OptionList.test.tsx index b73b370d0..8ff40d1c3 100644 --- a/tests/OptionList.test.tsx +++ b/tests/OptionList.test.tsx @@ -13,9 +13,9 @@ import { spyElementPrototypes } from '@rc-component/util/lib/test/domHook'; jest.mock('../src/utils/platformUtil'); // Mock VirtualList -jest.mock('rc-virtual-list', () => { +jest.mock('@rc-component/virtual-list', () => { const OriReact = jest.requireActual('react'); - const OriList = jest.requireActual('rc-virtual-list').default; + const OriList = jest.requireActual('@rc-component/virtual-list').default; return OriReact.forwardRef((props, ref) => { const oriRef = OriReact.useRef(); diff --git a/tests/Select.test.tsx b/tests/Select.test.tsx index e311e1a42..e97e45e7f 100644 --- a/tests/Select.test.tsx +++ b/tests/Select.test.tsx @@ -9,7 +9,7 @@ import { import KeyCode from '@rc-component/util/lib/KeyCode'; import { spyElementPrototypes } from '@rc-component/util/lib/test/domHook'; import { resetWarned } from '@rc-component/util/lib/warning'; -import type { ScrollConfig } from 'rc-virtual-list/lib/List'; +import type { ScrollConfig } from '@rc-component/virtual-list/lib/List'; import React, { StrictMode } from 'react'; import type { SelectProps } from '../src'; import Select, { OptGroup, Option, useBaseProps } from '../src'; diff --git a/tests/__mocks__/@rc-component/virtual-list.tsx b/tests/__mocks__/@rc-component/virtual-list.tsx new file mode 100644 index 000000000..a83162135 --- /dev/null +++ b/tests/__mocks__/@rc-component/virtual-list.tsx @@ -0,0 +1,3 @@ +import List from '@rc-component/virtual-list/lib/mock'; + +export default List; diff --git a/tests/__mocks__/rc-virtual-list.tsx b/tests/__mocks__/rc-virtual-list.tsx deleted file mode 100644 index 21b6e92a8..000000000 --- a/tests/__mocks__/rc-virtual-list.tsx +++ /dev/null @@ -1,3 +0,0 @@ -import List from 'rc-virtual-list/lib/mock'; - -export default List;