Skip to content

Commit 9ffd1f0

Browse files
authored
chore: bump @rc-component deps (#631)
* chore: bump deps * test: fix test case * test: lint * chore: rm now file * chore: fix lint * fix: depreacted api * fix: lint * chore: clean up
1 parent 1867fce commit 9ffd1f0

24 files changed

+379
-215
lines changed

README.md

Lines changed: 52 additions & 52 deletions
Large diffs are not rendered by default.

assets/select.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
@import '~rc-select/assets/index';
1+
@import '~@rc-component/select/assets/index';
22

33
@select-prefix: ~'rc-tree-select';

examples/basic.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class Demo extends React.Component {
124124
console.log(args);
125125
};
126126

127-
onDropdownVisibleChange = visible => {
127+
onPopupVisibleChange = visible => {
128128
const { value } = this.state;
129129
console.log(visible, value);
130130
if (Array.isArray(value) && value.length > 1 && value.length < 3) {
@@ -205,8 +205,8 @@ class Demo extends React.Component {
205205
console.log('onChange', val, ...args);
206206
this.setState({ value: val });
207207
}}
208-
onDropdownVisibleChange={v => {
209-
console.log('single onDropdownVisibleChange', v);
208+
onPopupVisibleChange={v => {
209+
console.log('single onPopupVisibleChange', v);
210210
this.setState({
211211
tsOpen: v,
212212
});
@@ -259,11 +259,11 @@ class Demo extends React.Component {
259259
choiceTransitionName="rc-tree-select-selection__choice-zoom"
260260
style={{ width: 300 }}
261261
// dropdownStyle={{ height: 200, overflow: 'auto' }}
262-
dropdownAlign={{
262+
popupAlign={{
263263
overflow: { adjustY: 0, adjustX: 0 },
264264
offset: [0, 2],
265265
}}
266-
onDropdownVisibleChange={this.onDropdownVisibleChange}
266+
onPopupVisibleChange={this.onPopupVisibleChange}
267267
placeholder={<i>请下拉选择</i>}
268268
treeLine
269269
maxTagTextLength={10}
@@ -327,7 +327,7 @@ class Demo extends React.Component {
327327
<h2>Testing in extreme conditions (Boundary conditions test) </h2>
328328
<TreeSelect
329329
style={{ width: 200 }}
330-
dropdownStyle={{ maxHeight: 200, overflow: 'auto' }}
330+
popupStyle={{ maxHeight: 200, overflow: 'auto' }}
331331
defaultValue="leaf1"
332332
multiple
333333
treeCheckable

examples/custom-icons.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function Demo() {
8686
placeholder={<span>Please Select</span>}
8787
transitionName="rc-tree-select-dropdown-slide-up"
8888
style={{ width: 300 }}
89-
dropdownStyle={{ maxHeight: 200, overflow: 'auto', zIndex: 1500 }}
89+
popupStyle={{ maxHeight: 200, overflow: 'auto', zIndex: 1500 }}
9090
showSearch
9191
allowClear
9292
{...iconProps}
@@ -99,7 +99,7 @@ function Demo() {
9999
placeholder={<span>Please Select</span>}
100100
transitionName="rc-tree-select-dropdown-slide-up"
101101
style={{ width: 300 }}
102-
dropdownStyle={{ maxHeight: 200, overflow: 'auto', zIndex: 1500 }}
102+
popupStyle={{ maxHeight: 200, overflow: 'auto', zIndex: 1500 }}
103103
showSearch
104104
allowClear
105105
{...iconPropsFunction}

examples/filter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class Demo extends React.Component {
8282
<h2>use treeDataSimpleMode</h2>
8383
<TreeSelect
8484
style={{ width: 300 }}
85-
dropdownStyle={{ maxHeight: 200, overflow: 'auto' }}
85+
popupStyle={{ maxHeight: 200, overflow: 'auto' }}
8686
placeholder={<i>请下拉选择</i>}
8787
treeLine
8888
maxTagTextLength={10}

examples/form.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React, { Component } from 'react';
2-
import Select from 'rc-select';
2+
import Select from '@rc-component/select';
33
import Form, { useForm, Field } from 'rc-field-form';
44
import TreeSelect from '../src';
5-
import 'rc-select/assets/index.less';
5+
import '@rc-component/select/assets/index.less';
66
import '../assets/index.less';
77
import { gData } from './utils/dataUtil';
88

examples/width.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import TreeSelect, { TreeNode } from '../src';
44

55
function Demo() {
66
return (
7-
<TreeSelect style={{ width: 120 }} dropdownMatchSelectWidth={false} treeDefaultExpandAll>
7+
<TreeSelect style={{ width: 120 }} popupMatchSelectWidth={false} treeDefaultExpandAll>
88
<TreeNode value="parent 1" title="parent 1">
99
<TreeNode value="parent 1-0 sdfsdfsdsdfsd" title="parent 1-0 sdfsdfsd">
1010
<TreeNode value="leaf1 sdfsdf" title="leaf1" />

now.json

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

package.json

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "rc-tree-select",
3-
"version": "5.27.0",
2+
"name": "@rc-component/tree-select",
3+
"version": "1.0.0",
44
"description": "tree-select ui component for react",
55
"keywords": [
66
"react",
@@ -35,7 +35,7 @@
3535
"lint": "eslint src/ examples/ --ext .tsx,.ts,.jsx,.js",
3636
"now-build": "npm run build",
3737
"prepare": "husky && dumi setup",
38-
"prepublishOnly": "npm run compile && np --yolo --no-publish --any-branch",
38+
"prepublishOnly": "npm run compile && rc-np",
3939
"prettier": "prettier '{src,tests}/**/*.{ts,tsx}' 'tests/**/*.js' --write",
4040
"start": "dumi dev",
4141
"test": "rc-test"
@@ -44,15 +44,15 @@
4444
"*": "prettier --write --ignore-unknown"
4545
},
4646
"dependencies": {
47-
"@babel/runtime": "^7.25.7",
4847
"classnames": "2.x",
49-
"rc-select": "~14.16.2",
50-
"rc-tree": "~5.13.0",
51-
"rc-util": "^5.43.0"
48+
"@rc-component/select": "~1.0.0",
49+
"rc-tree": "~5.13.1",
50+
"@rc-component/util": "^1.2.1"
5251
},
5352
"devDependencies": {
54-
"@rc-component/father-plugin": "^1.1.0",
55-
"@rc-component/trigger": "^1.18.3",
53+
"@rc-component/father-plugin": "^2.0.2",
54+
"@rc-component/np": "^1.0.3",
55+
"@rc-component/trigger": "^3.0.0",
5656
"@testing-library/react": "^12.1.5",
5757
"@types/jest": "^29.5.13",
5858
"@types/node": "^22.7.5",
@@ -73,7 +73,6 @@
7373
"glob": "^11.0.0",
7474
"husky": "^9.1.6",
7575
"lint-staged": "^15.2.10",
76-
"np": "^10.0.7",
7776
"prettier": "^3.3.3",
7877
"rc-dialog": "^9.6.0",
7978
"rc-field-form": "^2.4.0",

src/OptionList.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import { useBaseProps } from 'rc-select';
2-
import type { RefOptionListProps } from 'rc-select/lib/OptionList';
1+
import { useBaseProps } from '@rc-component/select';
2+
import type { RefOptionListProps } from '@rc-component/select/lib/OptionList';
33
import type { TreeProps } from 'rc-tree';
44
import Tree from 'rc-tree';
55
import { UnstableContext } from 'rc-tree';
66
import type { EventDataNode, ScrollTo } from 'rc-tree/lib/interface';
7-
import KeyCode from 'rc-util/lib/KeyCode';
8-
import useMemo from 'rc-util/lib/hooks/useMemo';
7+
import KeyCode from '@rc-component/util/lib/KeyCode';
8+
import useMemo from '@rc-component/util/lib/hooks/useMemo';
99
import * as React from 'react';
1010
import LegacyContext from './LegacyContext';
1111
import TreeSelectContext from './TreeSelectContext';
1212
import type { DataNode, Key, SafeKey } from './interface';
1313
import { getAllKeys, isCheckDisabled } from './utils/valueUtil';
14-
import { useEvent } from 'rc-util';
14+
import { useEvent } from '@rc-component/util';
1515

1616
const HIDDEN_STYLE = {
1717
width: 0,
@@ -43,7 +43,7 @@ const OptionList: React.ForwardRefRenderFunction<ReviseRefOptionListProps> = (_,
4343
treeData,
4444
fieldNames,
4545
onSelect,
46-
dropdownMatchSelectWidth,
46+
popupMatchSelectWidth,
4747
treeExpandAction,
4848
treeTitleRender,
4949
onPopupScroll,
@@ -263,6 +263,7 @@ const OptionList: React.ForwardRefRenderFunction<ReviseRefOptionListProps> = (_,
263263
}
264264

265265
setActiveKey(nextActiveKey);
266+
// eslint-disable-next-line react-hooks/exhaustive-deps
266267
}, [open, searchValue]);
267268

268269
// ========================= Keyboard =========================
@@ -305,6 +306,7 @@ const OptionList: React.ForwardRefRenderFunction<ReviseRefOptionListProps> = (_,
305306

306307
const hasLoadDataFn = useMemo(
307308
() => (searchValue ? false : true),
309+
// eslint-disable-next-line react-hooks/exhaustive-deps
308310
[searchValue, treeExpandedKeys || expandedKeys],
309311
([preSearchValue], [nextSearchValue, nextExcludeSearchExpandedKeys]) =>
310312
preSearchValue !== nextSearchValue && !!(nextSearchValue || nextExcludeSearchExpandedKeys),
@@ -347,7 +349,7 @@ const OptionList: React.ForwardRefRenderFunction<ReviseRefOptionListProps> = (_,
347349
height={listHeight}
348350
itemHeight={listItemHeight}
349351
itemScrollOffset={listItemScrollOffset}
350-
virtual={virtual !== false && dropdownMatchSelectWidth !== false}
352+
virtual={virtual !== false && popupMatchSelectWidth !== false}
351353
multiple={multiple}
352354
icon={treeIcon}
353355
showIcon={showTreeIcon}

0 commit comments

Comments
 (0)