dcp-design-react 1.8.32 → 1.9.1
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/form/src/types.d.ts +1 -0
- package/lib/index.esm.js +1 -1
- package/lib/index.full.js +1 -1
- package/lib/index.js +1 -1
- package/lib/signature/style/index.less +186 -186
- package/lib/style/index.css +6 -3
- package/lib/style/index.min.css +1 -1
- package/lib/table/src/body/index.d.ts +1 -1
- package/lib/table/src/clipboard/index.d.ts +1 -2
- package/lib/table/src/config/index.d.ts +1 -0
- package/lib/table/src/context/index.d.ts +1 -0
- package/lib/table/src/footer/index.d.ts +0 -2
- package/lib/table/src/header/index.d.ts +0 -1
- package/lib/table/src/hooks/useTableCore.d.ts +12 -1
- package/lib/table/src/hooks/useTableLayout.d.ts +8 -0
- package/lib/table/src/hooks/useTableRef.d.ts +19 -0
- package/lib/table/src/hooks/useTableState.d.ts +4 -1
- package/lib/table/style/table.less +380 -370
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { IColumn, IRecord, TableBodyRef } from '../table/types';
|
|
3
3
|
type IBodyProps = {
|
|
4
|
+
tableFlatColumns: IColumn[];
|
|
4
5
|
tableData: IRecord[];
|
|
5
|
-
flattenColumns: IColumn[];
|
|
6
6
|
};
|
|
7
7
|
declare const TableBody: React.ForwardRefExoticComponent<IBodyProps & React.RefAttributes<TableBodyRef>>;
|
|
8
8
|
export default TableBody;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ToolMethodRef } from '../table/types';
|
|
3
3
|
type ITableClipboardProps = {
|
|
4
|
-
flattenColumns: IColumn[];
|
|
5
4
|
open?: boolean;
|
|
6
5
|
};
|
|
7
6
|
declare const TableClipboard: React.ForwardRefExoticComponent<ITableClipboardProps & React.RefAttributes<ToolMethodRef>>;
|
|
@@ -72,6 +72,7 @@ export type ITableContext = {
|
|
|
72
72
|
createGroupData: (records: IRecord[]) => IRecord[];
|
|
73
73
|
findParentRowKeys: (deriveRowKeys: IDerivedRowKey[], key: IRowKey) => IRowKey[];
|
|
74
74
|
getAllChildRowKeys: (deriveRowKeys: IDerivedRowKey[]) => IRowKey[];
|
|
75
|
+
triggerScrollXEvent: (sl: number) => void;
|
|
75
76
|
triggerScrollYEvent: (st: number) => void;
|
|
76
77
|
scrollBottomDebouncer: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
77
78
|
resetTableScroll: () => void;
|
|
@@ -31,6 +31,7 @@ type IExtra = {
|
|
|
31
31
|
isGroupSubtotal: boolean;
|
|
32
32
|
doLayout: () => void;
|
|
33
33
|
setTableData: (records: IRecord[]) => void;
|
|
34
|
+
setTableFlatColumns: (columns: IColumn[]) => void;
|
|
34
35
|
setTableFullData: (records: IRecord[]) => void;
|
|
35
36
|
setTableOriginData: (records: IRecord[]) => void;
|
|
36
37
|
setAllTableData: (records: IRecord[]) => void;
|
|
@@ -44,8 +45,17 @@ type IExtra = {
|
|
|
44
45
|
setRowExpandedKeys: (rowKeys: IRowKey[]) => void;
|
|
45
46
|
setHighlightKey: (rowKey: IRowKey) => void;
|
|
46
47
|
setSelectionRows: (records: IRecord[]) => void;
|
|
47
|
-
|
|
48
|
+
setScrollXLoad: (value: boolean) => void;
|
|
49
|
+
setScrollYLoad: (value: boolean) => void;
|
|
50
|
+
setScrollXStore: (option: ITableRef['scrollXStore']) => void;
|
|
48
51
|
setScrollYStore: (option: ITableRef['scrollYStore']) => void;
|
|
52
|
+
computeVirtualX: (sl: number, tableWidth: number) => {
|
|
53
|
+
toVisibleIndex: number;
|
|
54
|
+
visibleSize: number;
|
|
55
|
+
};
|
|
56
|
+
computeVirtualY: (st: number, rowHeight: number) => {
|
|
57
|
+
toVisibleIndex: number;
|
|
58
|
+
};
|
|
49
59
|
setFieldAuth: (key: string, value: IFieldAuthItem) => void;
|
|
50
60
|
setResizeState: (option: ITableRef['resizeState']) => void;
|
|
51
61
|
setSummaries: (option: ITableRef['summaries']) => void;
|
|
@@ -82,6 +92,7 @@ declare const useTableCore: <T extends ITableProps>(props: T, extra: IExtra) =>
|
|
|
82
92
|
toFirstPage: () => void;
|
|
83
93
|
getPageCount: () => number;
|
|
84
94
|
pagerChangeHandle: ({ current, pageSize }: Omit<IPagination, 'total'>) => void;
|
|
95
|
+
triggerScrollXEvent: (sl: number) => void;
|
|
85
96
|
triggerScrollYEvent: (st: number) => void;
|
|
86
97
|
scrollBottomDebouncer: (...args: any[]) => void;
|
|
87
98
|
clearTableSorter: () => void;
|
|
@@ -22,6 +22,7 @@ type IExtra = {
|
|
|
22
22
|
setScrollX: (scrollX: boolean) => void;
|
|
23
23
|
setScrollY: (scrollY: boolean) => void;
|
|
24
24
|
setElementStore: (key: string, value: HTMLElement) => void;
|
|
25
|
+
setScrollXStore: (option: ITableRef['scrollXStore']) => void;
|
|
25
26
|
setScrollYStore: (option: ITableRef['scrollYStore']) => void;
|
|
26
27
|
setShouldToTop: (value: boolean) => void;
|
|
27
28
|
};
|
|
@@ -39,6 +40,13 @@ declare const useTableLayout: <T extends ITableProps>(props: T, extra: IExtra) =
|
|
|
39
40
|
rowInViewport: (index: number) => boolean;
|
|
40
41
|
calcTableHeight: () => void;
|
|
41
42
|
resetTableScroll: () => void;
|
|
43
|
+
computeVirtualX: (sl: number, tableWidth: number) => {
|
|
44
|
+
toVisibleIndex: number;
|
|
45
|
+
visibleSize: number;
|
|
46
|
+
};
|
|
47
|
+
computeVirtualY: (st: number, rowHeight: number) => {
|
|
48
|
+
toVisibleIndex: number;
|
|
49
|
+
};
|
|
42
50
|
doLayout: () => void;
|
|
43
51
|
};
|
|
44
52
|
export default useTableLayout;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Store from '../store';
|
|
3
|
+
import type { ScrollbarRef } from '../../../scrollbar/src/scrollbar';
|
|
3
4
|
import type { getRowKeyType, IColumn, IDerivedRowKey, IFieldAuthItem, IMergeCell, InsertMode, IRecord, IRowKey, ITableProps } from '../table/types';
|
|
4
5
|
import type { ComponentSize, Nullable } from '../../../_utils/types';
|
|
5
6
|
export type ITableRef = {
|
|
@@ -17,6 +18,13 @@ export type ITableRef = {
|
|
|
17
18
|
fieldAuth: Record<string, IFieldAuthItem>;
|
|
18
19
|
mergeCells: IMergeCell[];
|
|
19
20
|
columnsDefined: boolean;
|
|
21
|
+
scrollBarRef: React.RefObject<ScrollbarRef>;
|
|
22
|
+
scrollXStore: {
|
|
23
|
+
startIndex: number;
|
|
24
|
+
endIndex: number;
|
|
25
|
+
offsetSize: number;
|
|
26
|
+
visibleSize: number;
|
|
27
|
+
};
|
|
20
28
|
scrollYStore: {
|
|
21
29
|
startIndex: number;
|
|
22
30
|
endIndex: number;
|
|
@@ -36,6 +44,7 @@ export type ITableRef = {
|
|
|
36
44
|
};
|
|
37
45
|
summaries: Record<string, number>;
|
|
38
46
|
treeTable: boolean;
|
|
47
|
+
scrollXLoad: boolean;
|
|
39
48
|
scrollYLoad: boolean;
|
|
40
49
|
shouldToTop: boolean;
|
|
41
50
|
selectionRows: IRecord[];
|
|
@@ -59,10 +68,12 @@ declare const useTableRef: <T extends ITableProps>(props: T, { getRowKey, $size
|
|
|
59
68
|
setFieldAuth: (key: string, value: IFieldAuthItem) => void;
|
|
60
69
|
setMergeCells: (values: IMergeCell[]) => void;
|
|
61
70
|
setColumnsDefined: (value: boolean) => void;
|
|
71
|
+
setScrollXStore: (option: ITableRef['scrollXStore']) => void;
|
|
62
72
|
setScrollYStore: (option: ITableRef['scrollYStore']) => void;
|
|
63
73
|
setResizeState: (option: ITableRef['resizeState']) => void;
|
|
64
74
|
setHandleState: (option: ITableRef['handleState']) => void;
|
|
65
75
|
setSummaries: (option: ITableRef['summaries']) => void;
|
|
76
|
+
setScrollXLoad: (value: boolean) => void;
|
|
66
77
|
setScrollYLoad: (value: boolean) => void;
|
|
67
78
|
setShouldToTop: (value: boolean) => void;
|
|
68
79
|
setSelectionRows: (selectKeys: IRecord[]) => void;
|
|
@@ -85,6 +96,13 @@ declare const useTableRef: <T extends ITableProps>(props: T, { getRowKey, $size
|
|
|
85
96
|
fieldAuth: Record<string, IFieldAuthItem>;
|
|
86
97
|
mergeCells: IMergeCell[];
|
|
87
98
|
columnsDefined: boolean;
|
|
99
|
+
scrollBarRef: React.RefObject<ScrollbarRef>;
|
|
100
|
+
scrollXStore: {
|
|
101
|
+
startIndex: number;
|
|
102
|
+
endIndex: number;
|
|
103
|
+
offsetSize: number;
|
|
104
|
+
visibleSize: number;
|
|
105
|
+
};
|
|
88
106
|
scrollYStore: {
|
|
89
107
|
startIndex: number;
|
|
90
108
|
endIndex: number;
|
|
@@ -104,6 +122,7 @@ declare const useTableRef: <T extends ITableProps>(props: T, { getRowKey, $size
|
|
|
104
122
|
};
|
|
105
123
|
summaries: Record<string, number>;
|
|
106
124
|
treeTable: boolean;
|
|
125
|
+
scrollXLoad: boolean;
|
|
107
126
|
scrollYLoad: boolean;
|
|
108
127
|
shouldToTop: boolean;
|
|
109
128
|
selectionRows: IRecord[];
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { IFilter, IPagination, IRecord, IRowKey, ISorter, ISuperFilter, ITableProps } from '../table/types';
|
|
2
|
+
import type { IColumn, IFilter, IPagination, IRecord, IRowKey, ISorter, ISuperFilter, ITableProps } from '../table/types';
|
|
3
3
|
export type ITableState = {
|
|
4
4
|
tableData: IRecord[];
|
|
5
|
+
tableFlatColumns: IColumn[];
|
|
5
6
|
filters: IFilter;
|
|
6
7
|
sorter: ISorter;
|
|
7
8
|
superFilters: ISuperFilter[];
|
|
@@ -36,6 +37,8 @@ export type ITableState = {
|
|
|
36
37
|
declare const useTableState: <T extends ITableProps>(props: T) => {
|
|
37
38
|
tableData: IRecord<any>[];
|
|
38
39
|
setTableData: React.Dispatch<React.SetStateAction<IRecord<any>[]>>;
|
|
40
|
+
tableFlatColumns: IColumn[];
|
|
41
|
+
setTableFlatColumns: React.Dispatch<React.SetStateAction<IColumn[]>>;
|
|
39
42
|
filters: IFilter;
|
|
40
43
|
setFilters: React.Dispatch<IFilter>;
|
|
41
44
|
sorter: ISorter;
|