Skip to content

Commit f77d8d8

Browse files
authored
refactor: migrate to @rc-component/virtual-list (#1177)
1 parent 49ec5c0 commit f77d8d8

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@
5151
"dependencies": {
5252
"@rc-component/trigger": "^3.0.0",
5353
"@rc-component/util": "^1.3.0",
54+
"@rc-component/virtual-list": "^1.0.1",
5455
"clsx": "^2.1.1",
55-
"rc-overflow": "^1.5.0",
56-
"rc-virtual-list": "^3.5.2"
56+
"rc-overflow": "^1.5.0"
5757
},
5858
"devDependencies": {
5959
"@rc-component/father-plugin": "^2.0.2",
@@ -76,7 +76,7 @@
7676
"prettier": "^3.1.1",
7777
"querystring": "^0.2.1",
7878
"rc-dialog": "^9.0.0",
79-
"rc-test": "^7.0.9",
79+
"rc-test": "^7.1.2",
8080
"react": "^18.2.0",
8181
"react-dom": "^18.2.0",
8282
"typescript": "^5.2.2"

src/BaseSelect/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { AlignType, BuildInPlacements } from '@rc-component/trigger/lib/interface';
22
import { clsx } from 'clsx';
33
import { getDOM } from '@rc-component/util/lib/Dom/findDOMNode';
4-
import type { ScrollConfig, ScrollTo } from 'rc-virtual-list/lib/List';
4+
import type { ScrollConfig, ScrollTo } from '@rc-component/virtual-list/lib/List';
55
import * as React from 'react';
66
import { useAllowClear } from '../hooks/useAllowClear';
77
import { BaseSelectContext } from '../hooks/useBaseProps';

src/OptionList.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import KeyCode from '@rc-component/util/lib/KeyCode';
33
import useMemo from '@rc-component/util/lib/hooks/useMemo';
44
import omit from '@rc-component/util/lib/omit';
55
import pickAttrs from '@rc-component/util/lib/pickAttrs';
6-
import type { ListRef } from 'rc-virtual-list';
7-
import List from 'rc-virtual-list';
8-
import type { ScrollConfig } from 'rc-virtual-list/lib/List';
6+
import type { ListRef } from '@rc-component/virtual-list';
7+
import List from '@rc-component/virtual-list';
8+
import type { ScrollConfig } from '@rc-component/virtual-list/lib/List';
99
import * as React from 'react';
1010
import { useEffect } from 'react';
1111
import type { BaseOptionType, RawValueType } from './Select';

tests/OptionList.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import { spyElementPrototypes } from '@rc-component/util/lib/test/domHook';
1313
jest.mock('../src/utils/platformUtil');
1414

1515
// Mock VirtualList
16-
jest.mock('rc-virtual-list', () => {
16+
jest.mock('@rc-component/virtual-list', () => {
1717
const OriReact = jest.requireActual('react');
18-
const OriList = jest.requireActual('rc-virtual-list').default;
18+
const OriList = jest.requireActual('@rc-component/virtual-list').default;
1919

2020
return OriReact.forwardRef((props, ref) => {
2121
const oriRef = OriReact.useRef();

tests/Select.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
import KeyCode from '@rc-component/util/lib/KeyCode';
1010
import { spyElementPrototypes } from '@rc-component/util/lib/test/domHook';
1111
import { resetWarned } from '@rc-component/util/lib/warning';
12-
import type { ScrollConfig } from 'rc-virtual-list/lib/List';
12+
import type { ScrollConfig } from '@rc-component/virtual-list/lib/List';
1313
import React, { StrictMode } from 'react';
1414
import type { SelectProps } from '../src';
1515
import Select, { OptGroup, Option, useBaseProps } from '../src';
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import List from '@rc-component/virtual-list/lib/mock';
2+
3+
export default List;

tests/__mocks__/rc-virtual-list.tsx

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

0 commit comments

Comments
 (0)