dcp-design-react 1.9.23 → 1.9.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/hooks/useClickAway.d.ts +8 -0
- package/lib/index.esm.js +1 -1
- package/lib/index.full.js +1 -1
- package/lib/index.js +1 -1
- package/lib/locale/lang/en.d.ts +3 -3
- package/lib/locale/lang/en.js +8 -8
- package/lib/locale/lang/zh-cn.d.ts +3 -3
- package/lib/locale/lang/zh-cn.js +8 -8
- package/lib/style/index.css +2 -2
- package/lib/style/index.min.css +1 -1
- package/lib/table/src/context/index.d.ts +4 -1
- package/lib/table/src/hooks/useTableEffect.d.ts +1 -2
- package/lib/table/src/hooks/useTableLayout.d.ts +2 -1
- package/lib/table/src/hooks/useTableMemo.d.ts +3 -1
- package/lib/table/src/hooks/useTableRef.d.ts +1 -4
- package/lib/table/src/hooks/useTableState.d.ts +4 -1
- package/lib/table/src/table/types.d.ts +7 -3
- package/lib/table/style/area-select.less +2 -2
- package/package.json +1 -1
- package/lib/table/src/body/useMergeCell.d.ts +0 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { TableBodyRef, IColumn, IDerivedRowKey, IFetchParams, IPagination, IRecord, IRowColSpan, IRowKey, IRule } from '../table/types';
|
|
2
|
+
import type { TableBodyRef, IColumn, IDerivedRowKey, IFetchParams, IPagination, IRecord, IRowColSpan, IRowKey, IRule, IMergeCellItem, IMergedCell } from '../table/types';
|
|
3
3
|
import type { ITableRef } from '../hooks/useTableRef';
|
|
4
4
|
import type { ITableState } from '../hooks/useTableState';
|
|
5
5
|
import type { ComponentSize } from '../../../_utils/types';
|
|
@@ -16,6 +16,8 @@ export type ITableContext = {
|
|
|
16
16
|
sorter: ITableState['sorter'];
|
|
17
17
|
filters: ITableState['filters'];
|
|
18
18
|
superFilters: ITableState['superFilters'];
|
|
19
|
+
mergedTdCells: IMergedCell[];
|
|
20
|
+
derivedMergeCells: IMergeCellItem[];
|
|
19
21
|
layout: ITableState['layout'];
|
|
20
22
|
bordered: boolean;
|
|
21
23
|
showFooter: boolean;
|
|
@@ -55,6 +57,7 @@ export type ITableContext = {
|
|
|
55
57
|
setSelectionRows: (records: IRecord[]) => void;
|
|
56
58
|
setSelectionKeysEffect: (rowKeys: IRowKey[]) => void;
|
|
57
59
|
setInvalidRowKeys: (rowKeys: IRowKey[]) => void;
|
|
60
|
+
setMergedCells: (options: IMergedCell[]) => void;
|
|
58
61
|
getSpan: (row: IRecord, column: IColumn, rowIndex: number, columnIndex: number, tableData: IRecord[]) => IRowColSpan;
|
|
59
62
|
getStickyLeft: (dataIndex: string, part?: string) => number;
|
|
60
63
|
getStickyRight: (dataIndex: string, part?: string) => number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ITableRef } from './useTableRef';
|
|
3
|
-
import type { TableBodyRef, IColumn, IPagination, IRowKey, ITableProps, IDeriveRowKeys
|
|
3
|
+
import type { TableBodyRef, IColumn, IPagination, IRowKey, ITableProps, IDeriveRowKeys } from '../table/types';
|
|
4
4
|
import type { ComponentSize } from '../../../_utils/types';
|
|
5
5
|
type IExtra = {
|
|
6
6
|
tableRef: React.MutableRefObject<ITableRef>;
|
|
@@ -27,7 +27,6 @@ type IExtra = {
|
|
|
27
27
|
setRowExpandedKeys: (rowKeys: IRowKey[]) => void;
|
|
28
28
|
setHighlightKey: (rowKey: IRowKey) => void;
|
|
29
29
|
setResizeState: (option: ITableRef['resizeState']) => void;
|
|
30
|
-
setMergeCells: (values: IMergeCell[]) => void;
|
|
31
30
|
setPingRight: (value: boolean) => void;
|
|
32
31
|
setUnMounted: (value: boolean) => void;
|
|
33
32
|
calcTableHeight: () => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { getRowKeyType } from '../table/types';
|
|
3
|
-
import type { IColumn, IRecord, IRowKey, ITableProps } from '../table/types';
|
|
3
|
+
import type { IColumn, IMergeCellItem, IRecord, IRowKey, ITableProps } from '../table/types';
|
|
4
4
|
import type { ITableState } from './useTableState';
|
|
5
5
|
import type { ITableRef } from './useTableRef';
|
|
6
6
|
import type { ComponentSize } from '../../../_utils/types';
|
|
@@ -13,6 +13,7 @@ type IExtra = {
|
|
|
13
13
|
tableColumns: IColumn[];
|
|
14
14
|
flattenColumns: IColumn[];
|
|
15
15
|
leftFixedColumns: IColumn[];
|
|
16
|
+
derivedMergeCells: IMergeCellItem[];
|
|
16
17
|
layout: ITableState['layout'];
|
|
17
18
|
scrollX: boolean;
|
|
18
19
|
scrollY: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { ITableProps, IColumn, IRowKey, IRecord, getRowKeyType, IFetchParams, ISorter, IFilter, IPagination, ISuperFilter } from '../table/types';
|
|
2
|
+
import type { ITableProps, IColumn, IRowKey, IRecord, getRowKeyType, IFetchParams, ISorter, IFilter, IPagination, ISuperFilter, IMergedCell, IMergeCellItem } from '../table/types';
|
|
3
3
|
import type { ITableRef } from './useTableRef';
|
|
4
4
|
type IExtra = {
|
|
5
5
|
getRowKey: getRowKeyType;
|
|
@@ -11,6 +11,7 @@ type IExtra = {
|
|
|
11
11
|
superFilters: ISuperFilter[];
|
|
12
12
|
selectionKeys: IRowKey[];
|
|
13
13
|
pagination: IPagination;
|
|
14
|
+
mergedTdCells: IMergedCell[];
|
|
14
15
|
};
|
|
15
16
|
declare const useTableMemo: <T extends ITableProps>(props: T, extra: IExtra) => {
|
|
16
17
|
isFetch: boolean;
|
|
@@ -24,6 +25,7 @@ declare const useTableMemo: <T extends ITableProps>(props: T, extra: IExtra) =>
|
|
|
24
25
|
summationColumns: IColumn[];
|
|
25
26
|
leftFixedColumns: IColumn[];
|
|
26
27
|
rightFixedColumns: IColumn[];
|
|
28
|
+
derivedMergeCells: IMergeCellItem[];
|
|
27
29
|
treeExpandIndex: string;
|
|
28
30
|
showSummary: boolean;
|
|
29
31
|
showFooter: boolean;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import TableManager from '../manager';
|
|
3
3
|
import Store from '../store';
|
|
4
4
|
import type { ScrollbarRef } from '../../../scrollbar/src/scrollbar';
|
|
5
|
-
import type { getRowKeyType, IColumn, IDerivedRowKey, IFieldAuthItem,
|
|
5
|
+
import type { getRowKeyType, IColumn, IDerivedRowKey, IFieldAuthItem, InsertMode, IRecord, IRowKey, ITableProps } from '../table/types';
|
|
6
6
|
import type { ComponentSize, Nullable } from '../../../_utils/types';
|
|
7
7
|
export type ITableRef = {
|
|
8
8
|
props: ITableProps;
|
|
@@ -19,7 +19,6 @@ export type ITableRef = {
|
|
|
19
19
|
flattenRowKeys: IRowKey[];
|
|
20
20
|
invalidRowKeys: IRowKey[];
|
|
21
21
|
fieldAuth: Record<string, IFieldAuthItem>;
|
|
22
|
-
mergedCells: IMergeCell[];
|
|
23
22
|
columnsDefined: boolean;
|
|
24
23
|
scrollBarRef: React.RefObject<ScrollbarRef>;
|
|
25
24
|
scrollXStore: {
|
|
@@ -69,7 +68,6 @@ declare const useTableRef: <T extends ITableProps>(props: T, { getRowKey, $size
|
|
|
69
68
|
setDeriveRowKeys: (records: IRecord[]) => void;
|
|
70
69
|
setInvalidRowKeys: (rowKeys: IRowKey[]) => void;
|
|
71
70
|
setFieldAuth: (key: string, value: IFieldAuthItem) => void;
|
|
72
|
-
setMergeCells: (values: IMergeCell[]) => void;
|
|
73
71
|
setColumnsDefined: (value: boolean) => void;
|
|
74
72
|
setScrollXStore: (option: ITableRef['scrollXStore']) => void;
|
|
75
73
|
setScrollYStore: (option: ITableRef['scrollYStore']) => void;
|
|
@@ -98,7 +96,6 @@ declare const useTableRef: <T extends ITableProps>(props: T, { getRowKey, $size
|
|
|
98
96
|
flattenRowKeys: IRowKey[];
|
|
99
97
|
invalidRowKeys: IRowKey[];
|
|
100
98
|
fieldAuth: Record<string, IFieldAuthItem>;
|
|
101
|
-
mergedCells: IMergeCell[];
|
|
102
99
|
columnsDefined: boolean;
|
|
103
100
|
scrollBarRef: React.RefObject<ScrollbarRef>;
|
|
104
101
|
scrollXStore: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { IColumn, IFilter, IPagination, IRecord, IRowKey, ISorter, ISuperFilter, ITableProps } from '../table/types';
|
|
2
|
+
import type { IColumn, IFilter, IMergedCell, IPagination, IRecord, IRowKey, ISorter, ISuperFilter, ITableProps } from '../table/types';
|
|
3
3
|
export type ITableState = {
|
|
4
4
|
tableData: IRecord[];
|
|
5
5
|
tableFlatColumns: IColumn[];
|
|
@@ -11,6 +11,7 @@ export type ITableState = {
|
|
|
11
11
|
rowExpandedKeys: IRowKey[];
|
|
12
12
|
highlightKey: IRowKey;
|
|
13
13
|
updateMark: number;
|
|
14
|
+
mergedTdCells: IMergedCell[];
|
|
14
15
|
layout: {
|
|
15
16
|
gutterWidth: number;
|
|
16
17
|
tableWidth: number;
|
|
@@ -55,6 +56,8 @@ declare const useTableState: <T extends ITableProps>(props: T) => {
|
|
|
55
56
|
setHighlightKey: React.Dispatch<React.SetStateAction<string | number>>;
|
|
56
57
|
updateMark: number;
|
|
57
58
|
forceUpdate: React.DispatchWithoutAction;
|
|
59
|
+
mergedTdCells: IMergedCell[];
|
|
60
|
+
setMergedCells: (updater: IMergedCell[] | ((origin: IMergedCell[]) => IMergedCell[])) => void;
|
|
58
61
|
layout: {
|
|
59
62
|
gutterWidth: number;
|
|
60
63
|
tableWidth: number;
|
|
@@ -33,7 +33,11 @@ export type IRowColSpan = {
|
|
|
33
33
|
rowSpan: number;
|
|
34
34
|
colSpan: number;
|
|
35
35
|
};
|
|
36
|
-
export type
|
|
36
|
+
export type IMergedCell = {
|
|
37
|
+
rowKey: IRowKey;
|
|
38
|
+
dataIndex: string;
|
|
39
|
+
} & IRowColSpan;
|
|
40
|
+
export type IMergeCellItem = {
|
|
37
41
|
row: number;
|
|
38
42
|
col: number;
|
|
39
43
|
} & IRowColSpan;
|
|
@@ -219,7 +223,7 @@ export type IExpandable = {
|
|
|
219
223
|
};
|
|
220
224
|
export type IAreaSelection = {
|
|
221
225
|
cellMerge?: boolean;
|
|
222
|
-
onCellMerge?: (cells:
|
|
226
|
+
onCellMerge?: (cells: IMergedCell[]) => void;
|
|
223
227
|
};
|
|
224
228
|
export type ISummation = {
|
|
225
229
|
groupItems?: Array<{
|
|
@@ -348,7 +352,7 @@ export type ITableProps = {
|
|
|
348
352
|
nativeScrollBar?: boolean;
|
|
349
353
|
rowStyle?: CSSProperties | ((row: IRecord, rowIndex: number) => CSSProperties);
|
|
350
354
|
cellStyle?: CSSProperties | ((row: IRecord, column: IColumn, rowIndex: number, columnIndex: number) => CSSProperties);
|
|
351
|
-
mergedCells?:
|
|
355
|
+
mergedCells?: IMergedCell[];
|
|
352
356
|
spanMethod?: (options: {
|
|
353
357
|
row: IRecord;
|
|
354
358
|
column: IColumn;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: 焦质晔
|
|
3
3
|
* @Date: 2024-07-23 09:27:27
|
|
4
4
|
* @Last Modified by: 焦质晔
|
|
5
|
-
* @Last Modified time: 2024-07-
|
|
5
|
+
* @Last Modified time: 2024-07-26 08:39:21
|
|
6
6
|
*/
|
|
7
7
|
.@{prefix-table}--area-select {
|
|
8
8
|
position: static;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
font-size: 0;
|
|
11
11
|
.checked-area {
|
|
12
12
|
border: 1px solid @--primary-5;
|
|
13
|
-
background-color: rgba(@--primary-2, 0.
|
|
13
|
+
background-color: rgba(@--primary-2, 0.25);
|
|
14
14
|
position: absolute;
|
|
15
15
|
z-index: 2;
|
|
16
16
|
pointer-events: none;
|
package/package.json
CHANGED