Skip to content
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
12 changes: 5 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@ updates:
- 17.0.0
- 17.0.1
- 17.0.2
- dependency-name: np
- dependency-name: '@rc-component/np'
versions:
- 7.2.0
- 7.3.0
- 7.4.0
- dependency-name: rc-tooltip
- 1.0.0
- dependency-name: '@rc-component/tooltip'
versions:
- 5.0.2
- 1.0.0
- dependency-name: less
versions:
- 4.1.0
- 4.1.0
2 changes: 1 addition & 1 deletion docs/examples/animation-draggable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ react/no-danger, no-param-reassign */
import React from 'react';
import { gData } from './utils/dataUtil';
import '../../assets/index.less';
import Tree from 'rc-tree';
import Tree from '@rc-component/tree';

const STYLE = `
.rc-tree-child-tree {
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/animation.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint no-console:0, react/no-danger: 0 */
import { Provider } from 'rc-motion';
import Tree from 'rc-tree';
import { Provider } from '@rc-component/motion';
import Tree from '@rc-component/tree';
import React from 'react';
import '../../assets/index.less';
import './animation.less';
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/basic-controlled.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint-disable no-console, react/no-unescaped-entities */
import '../../assets/index.less';
import React from 'react';
import 'rc-dialog/assets/index.css';
import Modal from 'rc-dialog';
import Tree, { TreeNode } from 'rc-tree';
import '@rc-component/dialog/assets/index.css';
import Modal from '@rc-component/dialog';
import Tree, { TreeNode } from '@rc-component/tree';
import { gData, getRadioSelectKeys } from './utils/dataUtil';

class Demo extends React.Component {
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/basic.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import React from 'react';
import '../../assets/index.less';
import './basic.less';
import Tree, { TreeNode } from 'rc-tree';
import Tree, { TreeNode } from '@rc-component/tree';

const treeData = [
{
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/big-data.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import React from 'react';
import Gen from './big-data-generator';
import '../../assets/index.less';
import Tree, { TreeNode } from 'rc-tree';
import Tree, { TreeNode } from '@rc-component/tree';

class Demo extends React.Component {
state = {
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/contextmenu.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* eslint-disable no-console, react/no-find-dom-node */
import React from 'react';
import ReactDOM from 'react-dom';
import Tooltip from 'rc-tooltip';
import Tooltip from '@rc-component/tooltip';
import './contextmenu.less';
import '../../assets/index.less';
import Tree, { TreeNode } from 'rc-tree';
import Tree, { TreeNode } from '@rc-component/tree';

function contains(root, n) {
let node = n;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/custom-switch-icon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint no-alert:0 */
import React from 'react';
import '../../assets/index.less';
import Tree, { TreeNode } from 'rc-tree';
import Tree, { TreeNode } from '@rc-component/tree';

const arrowPath =
'M869 487.8L491.2 159.9c-2.9-2.5-6.6-3.9-10.5-3.9h-88' +
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/draggable-allow-drop.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
import { gData } from './utils/dataUtil';
import './draggable.less';
import '../../assets/index.less';
import Tree from 'rc-tree';
import Tree from '@rc-component/tree';

function allowDrop({ dropNode, dropPosition }) {
if (!dropNode.children) {
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/dropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
/* eslint no-console:0 */
/* eslint react/no-string-refs:0 */
import React from 'react';
import Trigger from 'rc-trigger';
import Trigger from '@rc-component/trigger';
import { gData } from './utils/dataUtil';
import './dropdown.less';
import '../../assets/index.less';
import Tree, { TreeNode } from 'rc-tree';
import Tree, { TreeNode } from '@rc-component/tree';

const placements = {
topLeft: {
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/dynamic.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-console, react/no-access-state-in-setstate */
import '../../assets/index.less';
import React from 'react';
import Tree from 'rc-tree';
import Tree from '@rc-component/tree';

function generateTreeNodes(treeNode) {
const arr = [];
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/expandAction.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-console, react/no-access-state-in-setstate */
import React from 'react';
import '../../assets/index.less';
import Tree, { TreeNode } from 'rc-tree';
import Tree, { TreeNode } from '@rc-component/tree';

const Demo = () => (
<div className="expandAction-demo">
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/fieldNames.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import React from 'react';
import '../../assets/index.less';
import './basic.less';
import Tree from 'rc-tree';
import Tree from '@rc-component/tree';

const treeData = [
{
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/funtionTitle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import '../../assets/index.less';
import './animation.less';
import React, { useState } from 'react';
import Tree from 'rc-tree';
import Tree from '@rc-component/tree';
import data from './longData.json';

const STYLE = `
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/icon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint no-alert:0 */
import React from 'react';
import classNames from 'classnames';
import Tree, { TreeNode } from 'rc-tree';
import Tree, { TreeNode } from '@rc-component/tree';
import '../../assets/index.less';
import './icon.less';

Expand Down
3 changes: 1 addition & 2 deletions docs/examples/selectable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
import React from 'react';
import './selectable.less';
import '../../assets/index.less';
import Tree, { TreeNode } from 'rc-tree';
import Tree, { TreeNode } from '@rc-component/tree';

class Demo extends React.Component {

render() {
return (
<div className="selectable-demo">
Expand Down
21 changes: 10 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rc-tree",
"version": "5.13.1",
"name": "@rc-component/tree",
"version": "1.0.0",
"description": "tree ui component for react",
"engines": {
"node": ">=10.x"
Expand Down Expand Up @@ -34,7 +34,7 @@
"docs:deploy": "gh-pages -d dist",
"compile": "father build && lessc assets/index.less assets/index.css",
"prepare": "husky",
"prepublishOnly": "npm run compile && np --yolo --no-publish",
"prepublishOnly": "npm run compile && rc-np",
"postpublish": "npm run gh-pages",
"lint": "eslint src/ --ext .tsx,.ts,.jsx,.js",
"test": "rc-test",
Expand All @@ -50,7 +50,7 @@
"react-dom": "*"
},
"devDependencies": {
"@rc-component/father-plugin": "^1.0.2",
"@rc-component/father-plugin": "^2.0.3",
"@testing-library/jest-dom": "^6.1.5",
"@testing-library/react": "^16.1.0",
"@types/jest": "^29.5.10",
Expand All @@ -69,21 +69,20 @@
"husky": "^9.1.6",
"less": "^4.2.1",
"lint-staged": "^15.2.10",
"np": "^10.0.5",
"@rc-component/np": "^1.0.0",
"prettier": "^3.3.3",
"rc-dialog": "^9.0.0",
"@rc-component/dialog": "^1.0.0",
"rc-test": "^7.0.15",
"rc-tooltip": "^6.3.2",
"rc-trigger": "^5.0.7",
"@rc-component/tooltip": "^1.0.0",
"@rc-component/trigger": "^3.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^5.3.3"
},
"dependencies": {
"@babel/runtime": "^7.10.1",
"classnames": "2.x",
"rc-motion": "^2.0.1",
"rc-util": "^5.16.1",
"@rc-component/motion": "^1.0.0",
"@rc-component/util": "^1.2.1",
"rc-virtual-list": "^3.5.1"
}
}
4 changes: 2 additions & 2 deletions src/MotionTreeNode.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import classNames from 'classnames';
import CSSMotion from 'rc-motion';
import useLayoutEffect from 'rc-util/lib/hooks/useLayoutEffect';
import CSSMotion from '@rc-component/motion';
import useLayoutEffect from '@rc-component/util/lib/hooks/useLayoutEffect';
import * as React from 'react';
import { TreeContext } from './contextTypes';
import type { FlattenNode, TreeNodeProps } from './interface';
Expand Down
2 changes: 1 addition & 1 deletion src/NodeList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Handle virtual list of the TreeNodes.
*/

import useLayoutEffect from 'rc-util/lib/hooks/useLayoutEffect';
import useLayoutEffect from '@rc-component/util/lib/hooks/useLayoutEffect';
import VirtualList, { type ListRef } from 'rc-virtual-list';
import * as React from 'react';
import MotionTreeNode from './MotionTreeNode';
Expand Down
6 changes: 3 additions & 3 deletions src/Tree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// Fully accessibility support

import classNames from 'classnames';
import KeyCode from 'rc-util/lib/KeyCode';
import pickAttrs from 'rc-util/lib/pickAttrs';
import warning from 'rc-util/lib/warning';
import KeyCode from '@rc-component/util/lib/KeyCode';
import pickAttrs from '@rc-component/util/lib/pickAttrs';
import warning from '@rc-component/util/lib/warning';
import * as React from 'react';

import type {
Expand Down
2 changes: 1 addition & 1 deletion src/TreeNode.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import classNames from 'classnames';
import pickAttrs from 'rc-util/lib/pickAttrs';
import pickAttrs from '@rc-component/util/lib/pickAttrs';
import { TreeContext, UnstableContext } from './contextTypes';
import Indent from './Indent';
import type { TreeNodeProps } from './interface';
Expand Down
2 changes: 1 addition & 1 deletion src/useUnmount.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import useLayoutEffect from 'rc-util/lib/hooks/useLayoutEffect';
import useLayoutEffect from '@rc-component/util/lib/hooks/useLayoutEffect';

/**
* Trigger only when component unmount
Expand Down
2 changes: 1 addition & 1 deletion src/util.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Legacy code. Should avoid to use if you are new to import these code.
*/

import warning from 'rc-util/lib/warning';
import warning from '@rc-component/util/lib/warning';
import React from 'react';
import type {
BasicDataNode,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/conductUtil.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import warning from 'rc-util/lib/warning';
import warning from '@rc-component/util/lib/warning';
import type {
BasicDataNode,
DataEntity,
Expand Down
6 changes: 3 additions & 3 deletions src/utils/treeUtil.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import toArray from 'rc-util/lib/Children/toArray';
import omit from 'rc-util/lib/omit';
import warning from 'rc-util/lib/warning';
import toArray from '@rc-component/util/lib/Children/toArray';
import omit from '@rc-component/util/lib/omit';
import warning from '@rc-component/util/lib/warning';
import * as React from 'react';
import type {
BasicDataNode,
Expand Down
2 changes: 1 addition & 1 deletion tests/Accessibility.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-undef, react/no-multi-comp */
import { fireEvent, render } from '@testing-library/react';
import KeyCode from 'rc-util/lib/KeyCode';
import KeyCode from '@rc-component/util/lib/KeyCode';
import React from 'react';
import Tree, { FieldDataNode } from '../src';
import { spyConsole } from './util';
Expand Down
4 changes: 2 additions & 2 deletions tests/Tree.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
react/no-unused-state, react/prop-types, no-return-assign */
import React from 'react';
import { render, fireEvent, act } from '@testing-library/react';
import { resetWarned } from 'rc-util/lib/warning';
import { spyElementPrototypes } from 'rc-util/lib/test/domHook';
import { resetWarned } from '@rc-component/util/lib/warning';
import { spyElementPrototypes } from '@rc-component/util/lib/test/domHook';
import Tree, { TreeNode } from '../src';
import { objectMatcher, spyConsole, spyError } from './util';
import { UnstableContext } from '../src';
Expand Down
2 changes: 1 addition & 1 deletion tests/TreeDraggable.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-undef, react/no-multi-comp, no-console,
react/no-unused-state, react/prop-types, no-return-assign */
import { act, createEvent, fireEvent, render } from '@testing-library/react';
import { spyElementPrototypes } from 'rc-util/lib/test/domHook';
import { spyElementPrototypes } from '@rc-component/util/lib/test/domHook';
import React from 'react';
import Tree, { FieldDataNode, TreeNode, TreeProps } from '../src';
import { spyConsole } from './util';
Expand Down
4 changes: 2 additions & 2 deletions tests/TreeMotion.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { TreeContext } from '../src/contextTypes';
import MotionTreeNode from '../src/MotionTreeNode';
import { getMinimumRangeTransitionRange } from '../src/NodeList';

jest.mock('rc-motion/lib/util/motion', () => {
const origin = jest.requireActual('rc-motion/lib/util/motion');
jest.mock('@rc-component/motion/lib/util/motion', () => {
const origin = jest.requireActual('@rc-component/motion/lib/util/motion');

return {
...origin,
Expand Down
2 changes: 1 addition & 1 deletion tests/TreeProps.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-undef, react/no-multi-comp */
import { act, fireEvent, render } from '@testing-library/react';
import { resetWarned } from 'rc-util/lib/warning';
import { resetWarned } from '@rc-component/util/lib/warning';
import React from 'react';
import Tree, { FieldDataNode, TreeNode } from '../src';
import { objectMatcher, spyConsole, spyError } from './util';
Expand Down
16 changes: 3 additions & 13 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,13 @@
"declaration": true,
"skipLibCheck": true,
"esModuleInterop": true,
"paths": {
"@/*": [
"src/*"
],
"@@/*": [
"src/.umi/*"
],
"rc-tree": [
"src/index.ts"
]
}
"paths": { "@/*": ["src/*"], "@@/*": ["src/.umi/*"], "@rc-component/tree": ["src/index.ts"] }
},
"include": [
".dumirc.ts",
"./src/**/*.ts",
"./src/**/*.tsx",
"./docs/**/*.tsx",
"./tests/**/*.tsx",
"./tests/**/*.tsx"
]
}
}