From 4bca40e1219c628c331f773e8f2cdb6c0d38569e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=B1=AA?= <1844749591@qq.com> Date: Tue, 4 Mar 2025 14:23:09 +0800 Subject: [PATCH 1/2] chore: bump tree version --- examples/basic.tsx | 16 +--------------- examples/big-data.tsx | 2 -- examples/controlled.tsx | 8 +------- examples/filter.tsx | 5 ----- package.json | 2 +- 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 +- tsconfig.json | 2 +- 14 files changed, 19 insertions(+), 46 deletions(-) diff --git a/examples/basic.tsx b/examples/basic.tsx index 0346307b..7b46df44 100644 --- a/examples/basic.tsx +++ b/examples/basic.tsx @@ -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 - + 请下拉选择} treeLine maxTagTextLength={10} diff --git a/package.json b/package.json index f9eb5ad9..d44fb96c 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": { 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/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"] } } } From 28304d765cbfac5298b5b74cba09059b3522e3bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=B1=AA?= <1844749591@qq.com> Date: Wed, 5 Mar 2025 19:18:01 +0800 Subject: [PATCH 2/2] chore: update import path --- examples/basic.tsx | 4 ++-- examples/controlled.tsx | 2 +- examples/custom-icons.tsx | 2 +- examples/fieldNames.tsx | 2 +- package.json | 2 +- tests/Select.props.spec.js | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/basic.tsx b/examples/basic.tsx index 7b46df44..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'; diff --git a/examples/controlled.tsx b/examples/controlled.tsx index e6b07ff9..d451f1d1 100644 --- a/examples/controlled.tsx +++ b/examples/controlled.tsx @@ -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 { diff --git a/examples/custom-icons.tsx b/examples/custom-icons.tsx index 7a5d66d2..1b9a2258 100644 --- a/examples/custom-icons.tsx +++ b/examples/custom-icons.tsx @@ -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'; diff --git a/examples/fieldNames.tsx b/examples/fieldNames.tsx index 6b20325e..028a8ec3 100644 --- a/examples/fieldNames.tsx +++ b/examples/fieldNames.tsx @@ -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 () => { diff --git a/package.json b/package.json index d44fb96c..e3331c32 100644 --- a/package.json +++ b/package.json @@ -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/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';