Skip to content

Commit 2fbf34d

Browse files
authored
Merge branch 'master' into fix/option-position
2 parents e06bc3c + a264f26 commit 2fbf34d

23 files changed

Lines changed: 201 additions & 76 deletions

.eslintrc.js

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

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ updates:
88
time: '21:00'
99
timezone: Asia/Shanghai
1010
open-pull-requests-limit: 10
11+
groups:
12+
npm-dependencies:
13+
patterns:
14+
- '*'
1115

1216
- package-ecosystem: github-actions
1317
directory: '/'
@@ -17,3 +21,7 @@ updates:
1721
time: '21:00'
1822
timezone: Asia/Shanghai
1923
open-pull-requests-limit: 10
24+
groups:
25+
github-actions:
26+
patterns:
27+
- '*'

.github/workflows/surge-preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Build preview
3232
if: ${{ steps.surge-token.outputs.enabled == 'true' }}
3333
run: |
34-
npm install
34+
npm install --legacy-peer-deps
3535
npm run build
3636
- uses: afc163/surge-preview@bf90a5a86111f6311ca42f0a5a0f80fb0fb03cec
3737
if: ${{ steps.surge-token.outputs.enabled == 'true' }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div align="center">
22
<h1>@rc-component/select</h1>
3-
<p><sub><img alt="Ant Design" height="14" src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg" style="vertical-align: -0.125em;" /> Part of the Ant Design ecosystem.</sub></p>
3+
<p><sub><a href="https://ant.design"><img alt="Ant Design" height="14" src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg" style="vertical-align: -0.125em;" /></a> Part of the Ant Design ecosystem.</sub></p>
44
<p>🎯 Composable Select component for React, with search, async-friendly option data, custom rendering, and virtual scrolling.</p>
55

66
<p>

README.zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div align="center">
22
<h1>@rc-component/select</h1>
3-
<p><sub><img alt="Ant Design" height="14" src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg" style="vertical-align: -0.125em;" /> Ant Design 生态的一部分。</sub></p>
3+
<p><sub><a href="https://ant.design"><img alt="Ant Design" height="14" src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg" style="vertical-align: -0.125em;" /></a> Ant Design 生态的一部分。</sub></p>
44
<p>🎯 React 选择器组件,支持单选、多选、搜索、标签和自定义渲染。</p>
55

66
<p>

eslint.config.mjs

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
import js from '@eslint/js';
2+
import { fixupConfigRules } from '@eslint/compat';
3+
import { defineConfig } from 'eslint/config';
4+
import { dirname } from 'node:path';
5+
import { fileURLToPath } from 'node:url';
6+
import prettier from 'eslint-config-prettier';
7+
import jest from 'eslint-plugin-jest';
8+
import react from 'eslint-plugin-react';
9+
import reactHooks from 'eslint-plugin-react-hooks';
10+
import globals from 'globals';
11+
import tseslint from 'typescript-eslint';
12+
13+
const tsconfigRootDir = dirname(fileURLToPath(import.meta.url));
14+
15+
export default defineConfig([
16+
{
17+
plugins: {
18+
'@typescript-eslint': tseslint.plugin,
19+
},
20+
},
21+
{
22+
linterOptions: {
23+
reportUnusedDisableDirectives: 'warn',
24+
},
25+
},
26+
{
27+
ignores: [
28+
'node_modules/',
29+
'coverage/',
30+
'es/',
31+
'lib/',
32+
'dist/',
33+
'docs-dist/',
34+
'.docs-dist/',
35+
'.dumi/',
36+
'.doc/',
37+
'.vercel/',
38+
],
39+
},
40+
{
41+
files: ['**/*.{js,jsx,ts,tsx}'],
42+
extends: [
43+
js.configs.recommended,
44+
...fixupConfigRules(react.configs.flat.recommended),
45+
...fixupConfigRules(react.configs.flat['jsx-runtime']),
46+
prettier,
47+
],
48+
plugins: {
49+
'react-hooks': reactHooks,
50+
},
51+
languageOptions: {
52+
globals: {
53+
...globals.browser,
54+
...globals.node,
55+
},
56+
},
57+
settings: {
58+
react: {
59+
version: 'detect',
60+
},
61+
},
62+
rules: {
63+
'no-async-promise-executor': 'off',
64+
'no-empty-pattern': 'off',
65+
'no-irregular-whitespace': 'off',
66+
'no-prototype-builtins': 'off',
67+
'no-useless-escape': 'off',
68+
'no-extra-boolean-cast': 'off',
69+
'no-undef': 'off',
70+
'no-unused-vars': 'off',
71+
'react/no-find-dom-node': 'off',
72+
'react/display-name': 'off',
73+
'react/no-unknown-property': 'off',
74+
'react/prop-types': 'off',
75+
'react-hooks/exhaustive-deps': 'warn',
76+
'react-hooks/rules-of-hooks': 'error',
77+
},
78+
},
79+
{
80+
files: ['**/*.{ts,tsx}'],
81+
extends: [...tseslint.configs.recommended],
82+
rules: {
83+
'@typescript-eslint/ban-ts-comment': 'off',
84+
'@typescript-eslint/no-empty-object-type': 'off',
85+
'@typescript-eslint/no-explicit-any': 'off',
86+
'@typescript-eslint/no-unsafe-function-type': 'off',
87+
'@typescript-eslint/no-unnecessary-type-constraint': 'off',
88+
'@typescript-eslint/no-unused-vars': 'off',
89+
},
90+
},
91+
{
92+
files: ['src/**/*.{ts,tsx}'],
93+
languageOptions: {
94+
parserOptions: {
95+
projectService: true,
96+
tsconfigRootDir,
97+
},
98+
},
99+
},
100+
{
101+
files: ['tests/**/*.{js,jsx,ts,tsx}', '**/*.{test,spec}.{js,jsx,ts,tsx}'],
102+
extends: [jest.configs['flat/recommended']],
103+
rules: {
104+
'jest/no-disabled-tests': 'off',
105+
'jest/no-done-callback': 'off',
106+
'jest/no-identical-title': 'off',
107+
'jest/expect-expect': 'off',
108+
'jest/no-alias-methods': 'off',
109+
'jest/no-conditional-expect': 'off',
110+
'jest/no-export': 'off',
111+
'jest/no-standalone-expect': 'off',
112+
'jest/valid-expect': 'off',
113+
'jest/valid-title': 'off',
114+
},
115+
},
116+
]);

global.d.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/// <reference types="jest" />
2+
/// <reference types="node" />
3+
/// <reference types="react" />
4+
/// <reference types="react-dom" />
5+
/// <reference types="@testing-library/jest-dom" />
6+
7+
declare module '*.css';
8+
declare module '*.less';
9+
declare module 'jsonp';
10+
11+
declare module 'moment/locale/zh-cn';

package.json

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,30 +55,38 @@
5555
"clsx": "^2.1.1"
5656
},
5757
"devDependencies": {
58+
"@eslint/js": "^10.0.1",
59+
"@eslint/compat": "^2.1.0",
5860
"@rc-component/dialog": "^1.10.0",
5961
"@rc-component/father-plugin": "^2.2.0",
6062
"@rc-component/np": "^1.0.4",
63+
"@testing-library/dom": "^10.4.1",
6164
"@testing-library/jest-dom": "^6.9.1",
62-
"@testing-library/react": "^15.0.7",
63-
"@types/jest": "^29.5.14",
65+
"@testing-library/react": "^16.3.2",
66+
"@types/jest": "^30.0.0",
6467
"@types/node": "^26.0.1",
65-
"@types/react": "^18.3.31",
66-
"@types/react-dom": "^18.3.7",
67-
"@umijs/fabric": "^4.0.1",
68-
"babel-jest": "^29.7.0",
69-
"dumi": "^2.4.35",
70-
"eslint": "^8.57.1",
71-
"father": "^4.6.23",
68+
"@types/react": "^19.2.17",
69+
"@types/react-dom": "^19.2.3",
70+
"babel-jest": "^30.4.1",
71+
"dumi": "^2.4.38",
72+
"eslint": "^10.6.0",
73+
"eslint-config-prettier": "^10.1.8",
74+
"eslint-plugin-jest": "^29.15.4",
75+
"eslint-plugin-react": "^7.37.5",
76+
"eslint-plugin-react-hooks": "^7.1.1",
77+
"father": "^4.6.24",
78+
"globals": "^17.7.0",
7279
"husky": "^9.1.7",
7380
"jsonp": "^0.2.1",
7481
"less": "^4.6.7",
75-
"lint-staged": "^16.4.0",
76-
"prettier": "^3.9.0",
82+
"lint-staged": "^17.0.8",
83+
"prettier": "^3.9.4",
7784
"querystring": "^0.2.1",
7885
"rc-test": "^7.1.3",
79-
"react": "^18.3.1",
80-
"react-dom": "^18.3.1",
81-
"typescript": "^5.9.3"
86+
"react": "^19.2.7",
87+
"react-dom": "^19.2.7",
88+
"typescript": "^6.0.3",
89+
"typescript-eslint": "^8.62.1"
8290
},
8391
"publishConfig": {
8492
"access": "public"

src/BaseSelect/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@ export interface BaseSelectProps
171171

172172
// >>> Customize Input
173173
/** @private Internal usage. Do not use in your production. */
174-
getInputElement?: () => JSX.Element;
174+
getInputElement?: () => React.ReactElement;
175175
/** @private Internal usage. Do not use in your production. */
176-
getRawInputElement?: () => JSX.Element;
176+
getRawInputElement?: () => React.ReactElement;
177177

178178
// >>> Selector
179179
maxTagTextLength?: number;

src/Select.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ const Select = React.forwardRef<BaseSelectRef, SelectProps<any, DefaultOptionTyp
539539
const mergedDefaultActiveFirstOption =
540540
defaultActiveFirstOption !== undefined ? defaultActiveFirstOption : mode !== 'combobox';
541541

542-
const activeEventRef = React.useRef<Promise<void>>();
542+
const activeEventRef = React.useRef<Promise<void> | undefined>(undefined);
543543

544544
const onActiveValue: OnActiveValue = React.useCallback(
545545
(active, index, { source = 'keyboard' } = {}) => {

0 commit comments

Comments
 (0)