From 60e2de4e64251cea95ed42c41dccdf5bb82b2e00 Mon Sep 17 00:00:00 2001 From: Jony J <1844749591@qq.com> Date: Wed, 5 Mar 2025 21:01:29 +0800 Subject: [PATCH] chore: bump tree version (#633) * chore: bump tree version * chore: update import path --- examples/basic.tsx | 20 +++----------------- examples/big-data.tsx | 2 -- examples/controlled.tsx | 10 ++-------- examples/custom-icons.tsx | 2 +- examples/fieldNames.tsx | 2 +- examples/filter.tsx | 5 ----- package.json | 4 ++-- src/LegacyContext.tsx | 2 +- src/OptionList.tsx | 8 ++++---- src/TreeSelect.tsx | 6 +++--- src/TreeSelectContext.ts | 2 +- src/hooks/useCheckedKeys.ts | 4 ++-- src/hooks/useDataEntities.ts | 4 ++-- src/interface.ts | 2 +- src/utils/strategyUtil.ts | 2 +- tests/Select.props.spec.js | 2 +- tsconfig.json | 2 +- 17 files changed, 26 insertions(+), 53 deletions(-) diff --git a/examples/basic.tsx b/examples/basic.tsx index 0346307b..a4bdd960 100644 --- a/examples/basic.tsx +++ b/examples/basic.tsx @@ -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'; @@ -155,20 +155,13 @@ class Demo extends React.Component { show dialog {visible ? ( - +
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={请下拉选择} showSearch allowClear @@ -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={请下拉选择} showSearch allowClear @@ -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={请下拉选择} showSearch allowClear @@ -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={请下拉选择} multiple value={multipleValue} @@ -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], @@ -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={请下拉选择} showSearch allowClear @@ -303,7 +291,6 @@ class Demo extends React.Component {

use treeDataSimpleMode

请下拉选择} // treeLine maxTagTextLength={10} @@ -351,7 +338,6 @@ class Demo extends React.Component {

use TreeNode Component (not recommend)

normal check checkStrictly Conrolled treeExpandedKeys - + { diff --git a/examples/filter.tsx b/examples/filter.tsx index 28ca57e8..1cb07caf 100644 --- a/examples/filter.tsx +++ b/examples/filter.tsx @@ -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={请下拉选择} treeLine maxTagTextLength={10} diff --git a/package.json b/package.json index f9eb5ad9..e3331c32 100644 --- a/package.json +++ b/package.json @@ -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": { @@ -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", diff --git a/src/LegacyContext.tsx b/src/LegacyContext.tsx index 36a9bc00..fba91cc7 100644 --- a/src/LegacyContext.tsx +++ b/src/LegacyContext.tsx @@ -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 { diff --git a/src/OptionList.tsx b/src/OptionList.tsx index b242f505..587cfc35 100644 --- a/src/OptionList.tsx +++ b/src/OptionList.tsx @@ -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'; diff --git a/src/TreeSelect.tsx b/src/TreeSelect.tsx index ac3d538c..79c35855 100644 --- a/src/TreeSelect.tsx +++ b/src/TreeSelect.tsx @@ -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'; diff --git a/src/TreeSelectContext.ts b/src/TreeSelectContext.ts index f2545071..722bdbd5 100644 --- a/src/TreeSelectContext.ts +++ b/src/TreeSelectContext.ts @@ -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'; diff --git a/src/hooks/useCheckedKeys.ts b/src/hooks/useCheckedKeys.ts index f70567ab..1724a184 100644 --- a/src/hooks/useCheckedKeys.ts +++ b/src/hooks/useCheckedKeys.ts @@ -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 = ( diff --git a/src/hooks/useDataEntities.ts b/src/hooks/useDataEntities.ts index 709b4321..dd2837bd 100644 --- a/src/hooks/useDataEntities.ts +++ b/src/hooks/useDataEntities.ts @@ -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'; diff --git a/src/interface.ts b/src/interface.ts index ccacc8cb..9eb41418 100644 --- a/src/interface.ts +++ b/src/interface.ts @@ -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 }; diff --git a/src/utils/strategyUtil.ts b/src/utils/strategyUtil.ts index 747977f0..4388e522 100644 --- a/src/utils/strategyUtil.ts +++ b/src/utils/strategyUtil.ts @@ -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'; diff --git a/tests/Select.props.spec.js b/tests/Select.props.spec.js index d49c8b67..b440fa03 100644 --- a/tests/Select.props.spec.js +++ b/tests/Select.props.spec.js @@ -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'; diff --git a/tsconfig.json b/tsconfig.json index 6be50871..a0d29f04 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,7 +10,7 @@ "paths": { "@/*": ["src/*"], "@@/*": [".dumi/tmp/*"], - "rc-tree-select": ["src/index.tsx"] + "@rc-component/tree-select": ["src/index.tsx"] } } }