Skip to content

Commit 5703c8e

Browse files
li-jia-nanzombieJ
andauthored
refactor: rc-component/table (#1219)
* refactor: rc-component/table * fix: fix * fix: fix * fix: fix * test: fix test case * fix: fix * chore: bump father plugin --------- Co-authored-by: 二货机器人 <[email protected]>
1 parent bd5e664 commit 5703c8e

29 files changed

+69
-70
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ es/
3333
.storybook
3434
.doc
3535
!__mocks__/rc-util/lib
36+
!__mocks__/@rc-component/util/lib
3637
examples/debug.tsx
3738
.history
3839
~*

docs/examples/animation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import CSSMotionList from 'rc-animate/lib/CSSMotionList';
33
import classNames from 'classnames';
4-
import toArray from 'rc-util/lib/Children/toArray';
4+
import toArray from '@rc-component/util/lib/Children/toArray';
55
import type { TableProps } from 'rc-table';
66
import Table from 'rc-table';
77
import '../../assets/index.less';

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "rc-table",
3-
"version": "7.50.2",
2+
"name": "@rc-component/table",
3+
"version": "1.0.0-0",
44
"description": "table ui component for react",
55
"engines": {
66
"node": ">=8.x"
@@ -53,15 +53,14 @@
5353
"react-dom": ">=16.9.0"
5454
},
5555
"dependencies": {
56-
"@babel/runtime": "^7.10.1",
5756
"@rc-component/context": "^1.4.0",
57+
"@rc-component/util": "^1.1.0",
5858
"classnames": "^2.2.5",
5959
"rc-resize-observer": "^1.1.0",
60-
"rc-util": "^5.44.3",
6160
"rc-virtual-list": "^3.14.2"
6261
},
6362
"devDependencies": {
64-
"@rc-component/father-plugin": "^1.0.2",
63+
"@rc-component/father-plugin": "^2.0.1",
6564
"@testing-library/jest-dom": "^6.4.0",
6665
"@testing-library/react": "^12.1.5",
6766
"@types/enzyme": "^3.10.5",

src/Cell/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import type {
1414
} from '../interface';
1515
import useCellRender from './useCellRender';
1616
import useHoverState from './useHoverState';
17-
import { useEvent } from 'rc-util';
17+
import { useEvent } from '@rc-component/util';
1818

1919
export interface CellProps<RecordType extends DefaultRecordType> {
2020
prefixCls?: string;

src/Cell/useCellRender.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import useMemo from 'rc-util/lib/hooks/useMemo';
2-
import isEqual from 'rc-util/lib/isEqual';
3-
import getValue from 'rc-util/lib/utils/get';
4-
import warning from 'rc-util/lib/warning';
1+
import useMemo from '@rc-component/util/lib/hooks/useMemo';
2+
import isEqual from '@rc-component/util/lib/isEqual';
3+
import getValue from '@rc-component/util/lib/utils/get';
4+
import warning from '@rc-component/util/lib/warning';
55
import * as React from 'react';
66
import PerfContext from '../context/PerfContext';
77
import type { CellType, ColumnType, DataIndex, RenderedCell } from '../interface';

src/FixedHolder/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useContext } from '@rc-component/context';
22
import classNames from 'classnames';
3-
import { fillRef } from 'rc-util/lib/ref';
3+
import { fillRef } from '@rc-component/util/lib/ref';
44
import * as React from 'react';
55
import { useMemo } from 'react';
66
import ColGroup from '../ColGroup';

src/Table.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@
2727
import type { CompareProps } from '@rc-component/context/lib/Immutable';
2828
import classNames from 'classnames';
2929
import ResizeObserver from 'rc-resize-observer';
30-
import isVisible from 'rc-util/lib/Dom/isVisible';
31-
import { isStyleSupport } from 'rc-util/lib/Dom/styleChecker';
32-
import { getTargetScrollBarSize } from 'rc-util/lib/getScrollBarSize';
33-
import useEvent from 'rc-util/lib/hooks/useEvent';
34-
import pickAttrs from 'rc-util/lib/pickAttrs';
35-
import getValue from 'rc-util/lib/utils/get';
36-
import warning from 'rc-util/lib/warning';
30+
import isVisible from '@rc-component/util/lib/Dom/isVisible';
31+
import { isStyleSupport } from '@rc-component/util/lib/Dom/styleChecker';
32+
import { getTargetScrollBarSize } from '@rc-component/util/lib/getScrollBarSize';
33+
import useEvent from '@rc-component/util/lib/hooks/useEvent';
34+
import pickAttrs from '@rc-component/util/lib/pickAttrs';
35+
import getValue from '@rc-component/util/lib/utils/get';
36+
import warning from '@rc-component/util/lib/warning';
3737
import * as React from 'react';
3838
import Body from './Body';
3939
import ColGroup from './ColGroup';
@@ -75,7 +75,7 @@ import StickyScrollBar from './stickyScrollBar';
7575
import Column from './sugar/Column';
7676
import ColumnGroup from './sugar/ColumnGroup';
7777
import { getColumnsKey, validateValue, validNumberValue } from './utils/valueUtil';
78-
import { getDOM } from 'rc-util/lib/Dom/findDOMNode';
78+
import { getDOM } from '@rc-component/util/lib/Dom/findDOMNode';
7979

8080
export const DEFAULT_PREFIX = 'rc-table';
8181

src/VirtualTable/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import type { CompareProps } from '@rc-component/context/lib/Immutable';
22
import classNames from 'classnames';
3-
import { useEvent, warning } from 'rc-util';
3+
import { useEvent, warning } from '@rc-component/util';
44
import * as React from 'react';
55
import { INTERNAL_HOOKS } from '../constant';
66
import { makeImmutable } from '../context/TableContext';
77
import type { CustomizeScrollBody, GetComponent, Reference } from '../interface';
88
import Table, { DEFAULT_PREFIX, type TableProps } from '../Table';
99
import Grid from './BodyGrid';
1010
import { StaticContext } from './context';
11-
import getValue from 'rc-util/lib/utils/get';
11+
import getValue from '@rc-component/util/lib/utils/get';
1212

1313
const renderBody: CustomizeScrollBody<any> = (rawData, props) => {
1414
const { ref, onScroll } = props;

src/hooks/useColumns/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import toArray from 'rc-util/lib/Children/toArray';
2-
import warning from 'rc-util/lib/warning';
1+
import toArray from '@rc-component/util/lib/Children/toArray';
2+
import warning from '@rc-component/util/lib/warning';
33
import * as React from 'react';
44
import { EXPAND_COLUMN } from '../../constant';
55
import type {

0 commit comments

Comments
 (0)