Skip to content

chore: bump tree version #633

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 3 additions & 17 deletions examples/basic.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Dialog from 'rc-dialog';
import 'rc-dialog/assets/index.css';
import Dialog from '@rc-component/dialog';
import '@rc-component/dialog/assets/index.css';
import React from 'react';
import '../assets/index.less';
import TreeSelect, { SHOW_PARENT, TreeNode } from '../src';
Expand Down Expand Up @@ -155,20 +155,13 @@ class Demo extends React.Component {
show dialog
</button>
{visible ? (
<Dialog
visible={visible}
animation="zoom"
maskAnimation="fade"
onClose={this.onClose}
// style={{ width: 600, height: 400, overflow: 'auto' }}
>
<Dialog visible={visible} animation="zoom" maskAnimation="fade" onClose={this.onClose}>
<div style={{ height: 600, paddingTop: 100 }}>
<TreeSelect
getPopupContainer={triggerNode => triggerNode.parentNode}
style={{ width: 300 }}
transitionName="rc-tree-select-dropdown-slide-up"
choiceTransitionName="rc-tree-select-selection__choice-zoom"
// dropdownStyle={{ maxHeight: 200, overflow: 'auto', zIndex: 1500 }}
placeholder={<i>请下拉选择</i>}
showSearch
allowClear
Expand All @@ -189,7 +182,6 @@ class Demo extends React.Component {
style={{ width: 300 }}
transitionName="rc-tree-select-dropdown-slide-up"
choiceTransitionName="rc-tree-select-selection__choice-zoom"
// dropdownStyle={{ maxHeight: 200, overflow: 'auto' }}
placeholder={<i>请下拉选择</i>}
showSearch
allowClear
Expand Down Expand Up @@ -222,7 +214,6 @@ class Demo extends React.Component {
style={{ width: 300 }}
transitionName="rc-tree-select-dropdown-slide-up"
choiceTransitionName="rc-tree-select-selection__choice-zoom"
// dropdownStyle={{ maxHeight: 200, overflow: 'auto' }}
placeholder={<i>请下拉选择</i>}
showSearch
allowClear
Expand All @@ -239,7 +230,6 @@ class Demo extends React.Component {
style={{ width: 300 }}
transitionName="rc-tree-select-dropdown-slide-up"
choiceTransitionName="rc-tree-select-selection__choice-zoom"
// dropdownStyle={{ maxHeight: 200, overflow: 'auto' }}
placeholder={<i>请下拉选择</i>}
multiple
value={multipleValue}
Expand All @@ -258,7 +248,6 @@ class Demo extends React.Component {
transitionName="rc-tree-select-dropdown-slide-up"
choiceTransitionName="rc-tree-select-selection__choice-zoom"
style={{ width: 300 }}
// dropdownStyle={{ height: 200, overflow: 'auto' }}
popupAlign={{
overflow: { adjustY: 0, adjustX: 0 },
offset: [0, 2],
Expand Down Expand Up @@ -287,7 +276,6 @@ class Demo extends React.Component {
style={{ width: 500 }}
transitionName="rc-tree-select-dropdown-slide-up"
choiceTransitionName="rc-tree-select-selection__choice-zoom"
// dropdownStyle={{ maxHeight: 200, overflow: 'auto' }}
placeholder={<i>请下拉选择</i>}
showSearch
allowClear
Expand All @@ -303,7 +291,6 @@ class Demo extends React.Component {
<h2>use treeDataSimpleMode</h2>
<TreeSelect
style={{ width: 300 }}
// dropdownStyle={{ maxHeight: 200, overflow: 'auto' }}
placeholder={<i>请下拉选择</i>}
// treeLine
maxTagTextLength={10}
Expand Down Expand Up @@ -351,7 +338,6 @@ class Demo extends React.Component {
<h2>use TreeNode Component (not recommend)</h2>
<TreeSelect
style={{ width: 200 }}
// dropdownStyle={{ maxHeight: 200, overflow: 'auto' }}
defaultValue="leaf1"
treeDefaultExpandAll
treeNodeFilterProp="title"
Expand Down
2 changes: 0 additions & 2 deletions examples/big-data.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ class Demo extends React.Component {
<h3>normal check</h3>
<TreeSelect
style={{ width: 300 }}
// dropdownStyle={{ maxHeight: 200, overflow: 'auto' }}
treeData={gData}
treeLine
value={value}
Expand All @@ -68,7 +67,6 @@ class Demo extends React.Component {
<h3>checkStrictly</h3>
<TreeSelect
style={{ width: 300 }}
// dropdownStyle={{ maxHeight: 200, overflow: 'auto' }}
treeData={gData1}
treeLine
value={value1}
Expand Down
10 changes: 2 additions & 8 deletions examples/controlled.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import '../assets/index.less';
import React from 'react';
import 'rc-dialog/assets/index.css';
import '@rc-component/dialog/assets/index.css';
import TreeSelect, { TreeNode } from '../src';

class Demo extends React.Component {
Expand Down Expand Up @@ -28,19 +28,13 @@ class Demo extends React.Component {
<h2>Conrolled treeExpandedKeys</h2>
<TreeSelect
style={{ width: 200 }}
// dropdownStyle={{ maxHeight: 200, overflow: 'auto' }}
treeExpandedKeys={treeExpandedKeys}
onTreeExpand={this.onTreeExpand}
>
<TreeNode value="" title="parent 1" key="000">
<TreeNode value="parent 1-0" title="parent 1-0" key="0-1-0">
<TreeNode value="leaf1" title="my leaf" key="random" />
<TreeNode
value="leaf2"
title="your leaf"
key="random1"
disabled
/>
<TreeNode value="leaf2" title="your leaf" key="random1" disabled />
</TreeNode>
<TreeNode value="parent 1-1" title="parent 1-1" key="0-1-1">
<TreeNode
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-icons.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import '../assets/index.less';
import React from 'react';
import 'rc-dialog/assets/index.css';
import '@rc-component/dialog/assets/index.css';
import TreeSelect from '../src';
import { gData } from './utils/dataUtil';

Expand Down
2 changes: 1 addition & 1 deletion examples/fieldNames.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import '../assets/index.less';
import React from 'react';
import 'rc-dialog/assets/index.css';
import '@rc-component/dialog/assets/index.css';
import TreeSelect from '../src';

export default () => {
Expand Down
5 changes: 0 additions & 5 deletions examples/filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,6 @@ class Demo extends React.Component {
style={{ width: 300 }}
transitionName="rc-tree-select-dropdown-slide-up"
choiceTransitionName="rc-tree-select-selection__choice-zoom"
// dropdownStyle={{ height: 200, overflow: 'auto' }}
// dropdownPopupAlign={{
// overflow: { adjustY: 0, adjustX: 0 },
// offset: [0, 2],
// }}
placeholder={<i>请下拉选择</i>}
treeLine
maxTagTextLength={10}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"dependencies": {
"classnames": "2.x",
"@rc-component/select": "~1.0.0",
"rc-tree": "~5.13.1",
"@rc-component/tree": "~1.0.0",
"@rc-component/util": "^1.2.1"
},
"devDependencies": {
Expand Down Expand Up @@ -74,7 +74,7 @@
"husky": "^9.1.6",
"lint-staged": "^15.2.10",
"prettier": "^3.3.3",
"rc-dialog": "^9.6.0",
"@rc-component/dialog": "^1.2.0",
"rc-field-form": "^2.4.0",
"rc-test": "^7.1.1",
"rc-virtual-list": "^3.14.8",
Expand Down
2 changes: 1 addition & 1 deletion src/LegacyContext.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import type { DataEntity, IconType } from 'rc-tree/lib/interface';
import type { DataEntity, IconType } from '@rc-component/tree/lib/interface';
import type { LegacyDataNode, SafeKey, Key } from './interface';

interface LegacyContextProps {
Expand Down
8 changes: 4 additions & 4 deletions src/OptionList.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useBaseProps } from '@rc-component/select';
import type { RefOptionListProps } from '@rc-component/select/lib/OptionList';
import type { TreeProps } from 'rc-tree';
import Tree from 'rc-tree';
import { UnstableContext } from 'rc-tree';
import type { EventDataNode, ScrollTo } from 'rc-tree/lib/interface';
import type { TreeProps } from '@rc-component/tree';
import Tree from '@rc-component/tree';
import { UnstableContext } from '@rc-component/tree';
import type { EventDataNode, ScrollTo } from '@rc-component/tree/lib/interface';
import KeyCode from '@rc-component/util/lib/KeyCode';
import useMemo from '@rc-component/util/lib/hooks/useMemo';
import * as React from 'react';
Expand Down
6 changes: 3 additions & 3 deletions src/TreeSelect.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { BaseSelectPropsWithoutPrivate, BaseSelectRef } from '@rc-component/select';
import { BaseSelect } from '@rc-component/select';
import useId from '@rc-component/select/lib/hooks/useId';
import type { IconType } from 'rc-tree/lib/interface';
import type { ExpandAction } from 'rc-tree/lib/Tree';
import { conductCheck } from 'rc-tree/lib/utils/conductUtil';
import type { IconType } from '@rc-component/tree/lib/interface';
import type { ExpandAction } from '@rc-component/tree/lib/Tree';
import { conductCheck } from '@rc-component/tree/lib/utils/conductUtil';
import useMergedState from '@rc-component/util/lib/hooks/useMergedState';
import * as React from 'react';
import useCache from './hooks/useCache';
Expand Down
2 changes: 1 addition & 1 deletion src/TreeSelectContext.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import type { ExpandAction } from 'rc-tree/lib/Tree';
import type { ExpandAction } from '@rc-component/tree/lib/Tree';
import type { DataNode, FieldNames, Key } from './interface';
import type useDataEntities from './hooks/useDataEntities';

Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useCheckedKeys.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import type { DataEntity } from 'rc-tree/lib/interface';
import { conductCheck } from 'rc-tree/lib/utils/conductUtil';
import type { DataEntity } from '@rc-component/tree/lib/interface';
import { conductCheck } from '@rc-component/tree/lib/utils/conductUtil';
import type { LabeledValueType, SafeKey, Key } from '../interface';

const useCheckedKeys = (
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useDataEntities.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { convertDataToEntities } from 'rc-tree/lib/utils/treeUtil';
import type { DataEntity } from 'rc-tree/lib/interface';
import { convertDataToEntities } from '@rc-component/tree/lib/utils/treeUtil';
import type { DataEntity } from '@rc-component/tree/lib/interface';
import type { SafeKey, FieldNames } from '../interface';
import warning from '@rc-component/util/lib/warning';
import { isNil } from '../utils/valueUtil';
Expand Down
2 changes: 1 addition & 1 deletion src/interface.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type * as React from 'react';
import type { SafeKey, Key, DataNode as TreeDataNode } from 'rc-tree/lib/interface';
import type { SafeKey, Key, DataNode as TreeDataNode } from '@rc-component/tree/lib/interface';

export type { SafeKey, Key };

Expand Down
2 changes: 1 addition & 1 deletion src/utils/strategyUtil.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { DataEntity } from 'rc-tree/lib/interface';
import type { DataEntity } from '@rc-component/tree/lib/interface';
import type { SafeKey, FieldNames } from '../interface';
import { isCheckDisabled } from './valueUtil';

Expand Down
2 changes: 1 addition & 1 deletion tests/Select.props.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-undef, react/no-multi-comp, no-console */
import { mount } from 'enzyme';
import Tree, { TreeNode } from 'rc-tree';
import Tree, { TreeNode } from '@rc-component/tree';
import React from 'react';
import { render, fireEvent } from '@testing-library/react';

Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"paths": {
"@/*": ["src/*"],
"@@/*": [".dumi/tmp/*"],
"rc-tree-select": ["src/index.tsx"]
"@rc-component/tree-select": ["src/index.tsx"]
}
}
}