Skip to content

Commit 60e2de4

Browse files
authored
chore: bump tree version (#633)
* chore: bump tree version * chore: update import path
1 parent 9ffd1f0 commit 60e2de4

17 files changed

+26
-53
lines changed

examples/basic.tsx

+3-17
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import Dialog from 'rc-dialog';
2-
import 'rc-dialog/assets/index.css';
1+
import Dialog from '@rc-component/dialog';
2+
import '@rc-component/dialog/assets/index.css';
33
import React from 'react';
44
import '../assets/index.less';
55
import TreeSelect, { SHOW_PARENT, TreeNode } from '../src';
@@ -155,20 +155,13 @@ class Demo extends React.Component {
155155
show dialog
156156
</button>
157157
{visible ? (
158-
<Dialog
159-
visible={visible}
160-
animation="zoom"
161-
maskAnimation="fade"
162-
onClose={this.onClose}
163-
// style={{ width: 600, height: 400, overflow: 'auto' }}
164-
>
158+
<Dialog visible={visible} animation="zoom" maskAnimation="fade" onClose={this.onClose}>
165159
<div style={{ height: 600, paddingTop: 100 }}>
166160
<TreeSelect
167161
getPopupContainer={triggerNode => triggerNode.parentNode}
168162
style={{ width: 300 }}
169163
transitionName="rc-tree-select-dropdown-slide-up"
170164
choiceTransitionName="rc-tree-select-selection__choice-zoom"
171-
// dropdownStyle={{ maxHeight: 200, overflow: 'auto', zIndex: 1500 }}
172165
placeholder={<i>请下拉选择</i>}
173166
showSearch
174167
allowClear
@@ -189,7 +182,6 @@ class Demo extends React.Component {
189182
style={{ width: 300 }}
190183
transitionName="rc-tree-select-dropdown-slide-up"
191184
choiceTransitionName="rc-tree-select-selection__choice-zoom"
192-
// dropdownStyle={{ maxHeight: 200, overflow: 'auto' }}
193185
placeholder={<i>请下拉选择</i>}
194186
showSearch
195187
allowClear
@@ -222,7 +214,6 @@ class Demo extends React.Component {
222214
style={{ width: 300 }}
223215
transitionName="rc-tree-select-dropdown-slide-up"
224216
choiceTransitionName="rc-tree-select-selection__choice-zoom"
225-
// dropdownStyle={{ maxHeight: 200, overflow: 'auto' }}
226217
placeholder={<i>请下拉选择</i>}
227218
showSearch
228219
allowClear
@@ -239,7 +230,6 @@ class Demo extends React.Component {
239230
style={{ width: 300 }}
240231
transitionName="rc-tree-select-dropdown-slide-up"
241232
choiceTransitionName="rc-tree-select-selection__choice-zoom"
242-
// dropdownStyle={{ maxHeight: 200, overflow: 'auto' }}
243233
placeholder={<i>请下拉选择</i>}
244234
multiple
245235
value={multipleValue}
@@ -258,7 +248,6 @@ class Demo extends React.Component {
258248
transitionName="rc-tree-select-dropdown-slide-up"
259249
choiceTransitionName="rc-tree-select-selection__choice-zoom"
260250
style={{ width: 300 }}
261-
// dropdownStyle={{ height: 200, overflow: 'auto' }}
262251
popupAlign={{
263252
overflow: { adjustY: 0, adjustX: 0 },
264253
offset: [0, 2],
@@ -287,7 +276,6 @@ class Demo extends React.Component {
287276
style={{ width: 500 }}
288277
transitionName="rc-tree-select-dropdown-slide-up"
289278
choiceTransitionName="rc-tree-select-selection__choice-zoom"
290-
// dropdownStyle={{ maxHeight: 200, overflow: 'auto' }}
291279
placeholder={<i>请下拉选择</i>}
292280
showSearch
293281
allowClear
@@ -303,7 +291,6 @@ class Demo extends React.Component {
303291
<h2>use treeDataSimpleMode</h2>
304292
<TreeSelect
305293
style={{ width: 300 }}
306-
// dropdownStyle={{ maxHeight: 200, overflow: 'auto' }}
307294
placeholder={<i>请下拉选择</i>}
308295
// treeLine
309296
maxTagTextLength={10}
@@ -351,7 +338,6 @@ class Demo extends React.Component {
351338
<h2>use TreeNode Component (not recommend)</h2>
352339
<TreeSelect
353340
style={{ width: 200 }}
354-
// dropdownStyle={{ maxHeight: 200, overflow: 'auto' }}
355341
defaultValue="leaf1"
356342
treeDefaultExpandAll
357343
treeNodeFilterProp="title"

examples/big-data.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ class Demo extends React.Component {
5454
<h3>normal check</h3>
5555
<TreeSelect
5656
style={{ width: 300 }}
57-
// dropdownStyle={{ maxHeight: 200, overflow: 'auto' }}
5857
treeData={gData}
5958
treeLine
6059
value={value}
@@ -68,7 +67,6 @@ class Demo extends React.Component {
6867
<h3>checkStrictly</h3>
6968
<TreeSelect
7069
style={{ width: 300 }}
71-
// dropdownStyle={{ maxHeight: 200, overflow: 'auto' }}
7270
treeData={gData1}
7371
treeLine
7472
value={value1}

examples/controlled.tsx

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import '../assets/index.less';
22
import React from 'react';
3-
import 'rc-dialog/assets/index.css';
3+
import '@rc-component/dialog/assets/index.css';
44
import TreeSelect, { TreeNode } from '../src';
55

66
class Demo extends React.Component {
@@ -28,19 +28,13 @@ class Demo extends React.Component {
2828
<h2>Conrolled treeExpandedKeys</h2>
2929
<TreeSelect
3030
style={{ width: 200 }}
31-
// dropdownStyle={{ maxHeight: 200, overflow: 'auto' }}
3231
treeExpandedKeys={treeExpandedKeys}
3332
onTreeExpand={this.onTreeExpand}
3433
>
3534
<TreeNode value="" title="parent 1" key="000">
3635
<TreeNode value="parent 1-0" title="parent 1-0" key="0-1-0">
3736
<TreeNode value="leaf1" title="my leaf" key="random" />
38-
<TreeNode
39-
value="leaf2"
40-
title="your leaf"
41-
key="random1"
42-
disabled
43-
/>
37+
<TreeNode value="leaf2" title="your leaf" key="random1" disabled />
4438
</TreeNode>
4539
<TreeNode value="parent 1-1" title="parent 1-1" key="0-1-1">
4640
<TreeNode

examples/custom-icons.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import '../assets/index.less';
22
import React from 'react';
3-
import 'rc-dialog/assets/index.css';
3+
import '@rc-component/dialog/assets/index.css';
44
import TreeSelect from '../src';
55
import { gData } from './utils/dataUtil';
66

examples/fieldNames.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import '../assets/index.less';
22
import React from 'react';
3-
import 'rc-dialog/assets/index.css';
3+
import '@rc-component/dialog/assets/index.css';
44
import TreeSelect from '../src';
55

66
export default () => {

examples/filter.tsx

-5
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,6 @@ class Demo extends React.Component {
6363
style={{ width: 300 }}
6464
transitionName="rc-tree-select-dropdown-slide-up"
6565
choiceTransitionName="rc-tree-select-selection__choice-zoom"
66-
// dropdownStyle={{ height: 200, overflow: 'auto' }}
67-
// dropdownPopupAlign={{
68-
// overflow: { adjustY: 0, adjustX: 0 },
69-
// offset: [0, 2],
70-
// }}
7166
placeholder={<i>请下拉选择</i>}
7267
treeLine
7368
maxTagTextLength={10}

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"dependencies": {
4747
"classnames": "2.x",
4848
"@rc-component/select": "~1.0.0",
49-
"rc-tree": "~5.13.1",
49+
"@rc-component/tree": "~1.0.0",
5050
"@rc-component/util": "^1.2.1"
5151
},
5252
"devDependencies": {
@@ -74,7 +74,7 @@
7474
"husky": "^9.1.6",
7575
"lint-staged": "^15.2.10",
7676
"prettier": "^3.3.3",
77-
"rc-dialog": "^9.6.0",
77+
"@rc-component/dialog": "^1.2.0",
7878
"rc-field-form": "^2.4.0",
7979
"rc-test": "^7.1.1",
8080
"rc-virtual-list": "^3.14.8",

src/LegacyContext.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import type { DataEntity, IconType } from 'rc-tree/lib/interface';
2+
import type { DataEntity, IconType } from '@rc-component/tree/lib/interface';
33
import type { LegacyDataNode, SafeKey, Key } from './interface';
44

55
interface LegacyContextProps {

src/OptionList.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { useBaseProps } from '@rc-component/select';
22
import type { RefOptionListProps } from '@rc-component/select/lib/OptionList';
3-
import type { TreeProps } from 'rc-tree';
4-
import Tree from 'rc-tree';
5-
import { UnstableContext } from 'rc-tree';
6-
import type { EventDataNode, ScrollTo } from 'rc-tree/lib/interface';
3+
import type { TreeProps } from '@rc-component/tree';
4+
import Tree from '@rc-component/tree';
5+
import { UnstableContext } from '@rc-component/tree';
6+
import type { EventDataNode, ScrollTo } from '@rc-component/tree/lib/interface';
77
import KeyCode from '@rc-component/util/lib/KeyCode';
88
import useMemo from '@rc-component/util/lib/hooks/useMemo';
99
import * as React from 'react';

src/TreeSelect.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import type { BaseSelectPropsWithoutPrivate, BaseSelectRef } from '@rc-component/select';
22
import { BaseSelect } from '@rc-component/select';
33
import useId from '@rc-component/select/lib/hooks/useId';
4-
import type { IconType } from 'rc-tree/lib/interface';
5-
import type { ExpandAction } from 'rc-tree/lib/Tree';
6-
import { conductCheck } from 'rc-tree/lib/utils/conductUtil';
4+
import type { IconType } from '@rc-component/tree/lib/interface';
5+
import type { ExpandAction } from '@rc-component/tree/lib/Tree';
6+
import { conductCheck } from '@rc-component/tree/lib/utils/conductUtil';
77
import useMergedState from '@rc-component/util/lib/hooks/useMergedState';
88
import * as React from 'react';
99
import useCache from './hooks/useCache';

src/TreeSelectContext.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import type { ExpandAction } from 'rc-tree/lib/Tree';
2+
import type { ExpandAction } from '@rc-component/tree/lib/Tree';
33
import type { DataNode, FieldNames, Key } from './interface';
44
import type useDataEntities from './hooks/useDataEntities';
55

src/hooks/useCheckedKeys.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
2-
import type { DataEntity } from 'rc-tree/lib/interface';
3-
import { conductCheck } from 'rc-tree/lib/utils/conductUtil';
2+
import type { DataEntity } from '@rc-component/tree/lib/interface';
3+
import { conductCheck } from '@rc-component/tree/lib/utils/conductUtil';
44
import type { LabeledValueType, SafeKey, Key } from '../interface';
55

66
const useCheckedKeys = (

src/hooks/useDataEntities.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
2-
import { convertDataToEntities } from 'rc-tree/lib/utils/treeUtil';
3-
import type { DataEntity } from 'rc-tree/lib/interface';
2+
import { convertDataToEntities } from '@rc-component/tree/lib/utils/treeUtil';
3+
import type { DataEntity } from '@rc-component/tree/lib/interface';
44
import type { SafeKey, FieldNames } from '../interface';
55
import warning from '@rc-component/util/lib/warning';
66
import { isNil } from '../utils/valueUtil';

src/interface.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type * as React from 'react';
2-
import type { SafeKey, Key, DataNode as TreeDataNode } from 'rc-tree/lib/interface';
2+
import type { SafeKey, Key, DataNode as TreeDataNode } from '@rc-component/tree/lib/interface';
33

44
export type { SafeKey, Key };
55

src/utils/strategyUtil.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { DataEntity } from 'rc-tree/lib/interface';
1+
import type { DataEntity } from '@rc-component/tree/lib/interface';
22
import type { SafeKey, FieldNames } from '../interface';
33
import { isCheckDisabled } from './valueUtil';
44

tests/Select.props.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable no-undef, react/no-multi-comp, no-console */
22
import { mount } from 'enzyme';
3-
import Tree, { TreeNode } from 'rc-tree';
3+
import Tree, { TreeNode } from '@rc-component/tree';
44
import React from 'react';
55
import { render, fireEvent } from '@testing-library/react';
66

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"paths": {
1111
"@/*": ["src/*"],
1212
"@@/*": [".dumi/tmp/*"],
13-
"rc-tree-select": ["src/index.tsx"]
13+
"@rc-component/tree-select": ["src/index.tsx"]
1414
}
1515
}
1616
}

0 commit comments

Comments
 (0)