dcp-design-react 1.11.1 → 1.11.3
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/_utils/util.d.ts +2 -2
- package/lib/form/style/index.less +3 -1
- package/lib/index.d.ts +4 -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 +4 -4
- package/lib/locale/lang/en.js +4 -4
- package/lib/locale/lang/zh-cn.d.ts +4 -4
- package/lib/locale/lang/zh-cn.js +4 -4
- package/lib/pivot-grid/src/config/index.d.ts +2 -5
- package/lib/pivot-grid/src/grid-layout/Context.d.ts +5 -2
- package/lib/pivot-grid/src/grid-layout/CountPanel.d.ts +2 -0
- package/lib/pivot-grid/src/grid-layout/GroupCard.d.ts +2 -1
- package/lib/pivot-grid/src/main/Context.d.ts +6 -2
- package/lib/pivot-grid/src/utils/index.d.ts +30 -1
- package/lib/pivot-grid/style/grid-layout.less +36 -31
- package/lib/pivot-grid/style/top-bar.less +34 -3
- package/lib/pivot-grid/style/variable.less +0 -2
- package/lib/scrollbar/src/scrollbar.d.ts +1 -0
- package/lib/scrollbar/style/index.less +1 -0
- package/lib/style/index.css +113 -34
- package/lib/style/index.less +2 -1
- package/lib/style/index.min.css +1 -1
- package/lib/table/src/body/DraggableTr.d.ts +2 -1
- package/lib/table/src/body/index.d.ts +2 -6
- package/lib/table/src/config/index.d.ts +1 -0
- package/lib/table/src/context/index.d.ts +3 -8
- package/lib/table/src/export/useExport.d.ts +1 -1
- package/lib/table/src/footer/index.d.ts +1 -4
- package/lib/table/src/header/index.d.ts +1 -3
- package/lib/table/src/hooks/useImperativeMethod.d.ts +0 -1
- package/lib/table/src/hooks/useTableCore.d.ts +3 -17
- package/lib/table/src/hooks/useTableEffect.d.ts +0 -2
- package/lib/table/src/hooks/useTableLayout.d.ts +3 -15
- package/lib/table/src/hooks/useTableMemo.d.ts +1 -3
- package/lib/table/src/hooks/useTableRef.d.ts +4 -33
- package/lib/table/src/hooks/useTableState.d.ts +5 -14
- package/lib/table/src/hooks/useTableVirtual.d.ts +17 -0
- package/lib/table/src/table/props.d.ts +0 -1
- package/lib/table/src/table/types.d.ts +3 -2
- package/lib/table/style/body.less +103 -103
- package/lib/table/style/column-filter.less +5 -5
- package/lib/table/style/index.less +31 -31
- package/lib/table/style/pivot-grid.less +19 -19
- package/lib/virtual-list/index.d.ts +3 -0
- package/lib/virtual-list/src/core.d.ts +133 -0
- package/lib/virtual-list/src/list-item.d.ts +9 -0
- package/lib/virtual-list/src/useVirtual.d.ts +5 -0
- package/lib/virtual-list/src/utils.d.ts +12 -0
- package/lib/virtual-list/src/virtual-list.d.ts +20 -0
- package/lib/virtual-list/style/index.less +21 -0
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ import type { DropOption } from './useDragSort';
|
|
|
3
3
|
import type { IRecord, IRowKey } from '../table/types';
|
|
4
4
|
export type IProps = {
|
|
5
5
|
rowKey: IRowKey;
|
|
6
|
+
rowIndex: number;
|
|
6
7
|
row: IRecord;
|
|
7
8
|
className: string;
|
|
8
9
|
style?: React.CSSProperties;
|
|
@@ -22,5 +23,5 @@ export type NodeType = {
|
|
|
22
23
|
data: IRecord;
|
|
23
24
|
props: IProps;
|
|
24
25
|
};
|
|
25
|
-
declare const DraggableTr: React.
|
|
26
|
+
declare const DraggableTr: React.ForwardRefExoticComponent<IProps & React.RefAttributes<any>>;
|
|
26
27
|
export default DraggableTr;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
tableFlatColumns: IColumn[];
|
|
5
|
-
tableData: IRecord[];
|
|
6
|
-
};
|
|
7
|
-
declare const TableBody: React.ForwardRefExoticComponent<IBodyProps & React.RefAttributes<TableBodyRef>>;
|
|
2
|
+
import type { TableBodyRef } from '../table/types';
|
|
3
|
+
declare const TableBody: React.ForwardRefExoticComponent<React.RefAttributes<TableBodyRef>>;
|
|
8
4
|
export default TableBody;
|
|
@@ -9,6 +9,7 @@ export type ITableContext = {
|
|
|
9
9
|
tableBodyRef: React.RefObject<TableBodyRef>;
|
|
10
10
|
prefixCls: string;
|
|
11
11
|
$size: ComponentSize;
|
|
12
|
+
tableFlatData: IRecord[];
|
|
12
13
|
flattenColumns: IColumn[];
|
|
13
14
|
editableColumns: IColumn[];
|
|
14
15
|
leftFixedColumns: IColumn[];
|
|
@@ -24,8 +25,6 @@ export type ITableContext = {
|
|
|
24
25
|
showFooter: boolean;
|
|
25
26
|
showSummary: boolean;
|
|
26
27
|
summationRows: Record<string, number | string>[];
|
|
27
|
-
scrollX: ITableState['scrollX'];
|
|
28
|
-
scrollY: ITableState['scrollY'];
|
|
29
28
|
pagination: IPagination;
|
|
30
29
|
fetchParams: IFetchParams;
|
|
31
30
|
selectionKeys: IRowKey[];
|
|
@@ -40,16 +39,15 @@ export type ITableContext = {
|
|
|
40
39
|
isFullScreen: boolean;
|
|
41
40
|
isTableEmpty: boolean;
|
|
42
41
|
isHeadGroup: boolean;
|
|
43
|
-
isTreeTable: boolean;
|
|
44
42
|
isGroupSubtotal: boolean;
|
|
45
43
|
isWebPagination: boolean;
|
|
46
44
|
dataChange: () => void;
|
|
47
45
|
tableChange: () => void;
|
|
48
46
|
getTableData: () => Promise<void>;
|
|
49
47
|
setElementStore: (key: string, value: HTMLElement) => void;
|
|
50
|
-
|
|
48
|
+
createTableList: () => IRecord[];
|
|
51
49
|
createTableFullData: (records: IRecord[]) => void;
|
|
52
|
-
|
|
50
|
+
updateTableFlatData: () => void;
|
|
53
51
|
setSorter: (value: ITableState['sorter']) => void;
|
|
54
52
|
setFilters: (value: ITableState['filters']) => void;
|
|
55
53
|
setSuperFilters: (options: ITableState['superFilters']) => void;
|
|
@@ -64,7 +62,6 @@ export type ITableContext = {
|
|
|
64
62
|
getStickyRight: (dataIndex: string, part?: string) => number;
|
|
65
63
|
scrollXToColumn: (dataIndex: string, index?: number) => void;
|
|
66
64
|
scrollYToRecord: (rowKey: IRowKey, index?: number) => void;
|
|
67
|
-
rowInViewport: (index: number) => boolean;
|
|
68
65
|
setPagination: (pagination: IPagination) => void;
|
|
69
66
|
setPingLeft: (value: boolean) => void;
|
|
70
67
|
setPingRight: (value: boolean) => void;
|
|
@@ -76,8 +73,6 @@ export type ITableContext = {
|
|
|
76
73
|
createGroupData: (records: IRecord[]) => IRecord[];
|
|
77
74
|
findParentRowKeys: (deriveRowKeys: IDerivedRowKey[], key: IRowKey) => IRowKey[];
|
|
78
75
|
getAllChildRowKeys: (deriveRowKeys: IDerivedRowKey[]) => IRowKey[];
|
|
79
|
-
triggerScrollXEvent: (sl: number) => void;
|
|
80
|
-
triggerScrollYEvent: (st: number) => void;
|
|
81
76
|
scrollBottomDebouncer: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
82
77
|
resetTableScroll: () => void;
|
|
83
78
|
clearTableSorter: () => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IColumn, IRecord } from '../table/types';
|
|
2
2
|
import type { IOptions } from './index';
|
|
3
|
-
type IParamsFn1 = (columns: IColumn[],
|
|
3
|
+
type IParamsFn1 = (columns: IColumn[], records: IRecord[]) => Record<string, number>[];
|
|
4
4
|
type IParamsFn2 = (row: IRecord, rowIndex: number, column: IColumn, columnIndex: number) => string | number;
|
|
5
5
|
declare const useExport: () => {
|
|
6
6
|
exportXLSX: (options: IOptions, dataList: IRecord[], calcSummationValues: IParamsFn1, renderCell: IParamsFn2) => Promise<Blob>;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { IColumn
|
|
2
|
+
import type { IColumn } from '../table/types';
|
|
3
3
|
type IHeaderProps = {
|
|
4
4
|
tableColumns: IColumn[];
|
|
5
|
-
sorter: ISorter;
|
|
6
|
-
filters: IFilter;
|
|
7
5
|
};
|
|
8
6
|
declare const TableHeader: React.FC<IHeaderProps>;
|
|
9
7
|
export default TableHeader;
|
|
@@ -17,7 +17,6 @@ type IExtra = {
|
|
|
17
17
|
isFetch: boolean;
|
|
18
18
|
dataChange: () => void;
|
|
19
19
|
getTableData: () => Promise<void>;
|
|
20
|
-
handleTableData: (records: IRecord[]) => void;
|
|
21
20
|
createTableData: (records: IRecord[]) => void;
|
|
22
21
|
createTableFullData: (records: IRecord[]) => void;
|
|
23
22
|
calcTableHeight: () => void;
|
|
@@ -23,22 +23,20 @@ type IExtra = {
|
|
|
23
23
|
rowExpandedKeys: IRowKey[];
|
|
24
24
|
highlightKey: IRowKey;
|
|
25
25
|
summationColumns: IColumn[];
|
|
26
|
-
shouldUpdateHeight: boolean;
|
|
27
26
|
isFetch: boolean;
|
|
28
|
-
isTreeTable: boolean;
|
|
29
27
|
isWebPagination: boolean;
|
|
30
28
|
isScrollPagination: boolean;
|
|
31
29
|
isServiceSummation: boolean;
|
|
32
30
|
isGroupSubtotal: boolean;
|
|
33
31
|
doLayout: () => void;
|
|
34
|
-
setTableData: (records: IRecord[]) => void;
|
|
35
|
-
setTableFlatColumns: (columns: IColumn[]) => void;
|
|
36
32
|
setTableFullData: (records: IRecord[]) => void;
|
|
37
33
|
setTableOriginData: (records: IRecord[]) => void;
|
|
38
34
|
setTableFlatData: (records: IRecord[]) => void;
|
|
39
35
|
setAllTableData: (records: IRecord[]) => void;
|
|
40
36
|
setDeriveRowKeys: (records: IRecord[]) => void;
|
|
41
37
|
setPagination: <T extends IPagination>(pagination: T | ((prev: T) => T)) => void;
|
|
38
|
+
setPingRight: (value: boolean) => void;
|
|
39
|
+
setPingLeft: (value: boolean) => void;
|
|
42
40
|
setSpinning: (value: boolean) => void;
|
|
43
41
|
setSorter: (sorter: ITableState['sorter']) => void;
|
|
44
42
|
setFilters: (sorter: ITableState['filters']) => void;
|
|
@@ -49,15 +47,6 @@ type IExtra = {
|
|
|
49
47
|
setSelectionRows: (records: IRecord[]) => void;
|
|
50
48
|
setScrollXLoad: (value: boolean) => void;
|
|
51
49
|
setScrollYLoad: (value: boolean) => void;
|
|
52
|
-
setScrollXStore: (option: ITableRef['scrollXStore']) => void;
|
|
53
|
-
setScrollYStore: (option: ITableRef['scrollYStore']) => void;
|
|
54
|
-
computeVirtualX: (sl: number, tableWidth: number) => {
|
|
55
|
-
toVisibleIndex: number;
|
|
56
|
-
visibleSize: number;
|
|
57
|
-
};
|
|
58
|
-
computeVirtualY: (st: number, rowHeight: number) => {
|
|
59
|
-
toVisibleIndex: number;
|
|
60
|
-
};
|
|
61
50
|
setFieldAuth: (key: string, value: IFieldAuthItem) => void;
|
|
62
51
|
setResizeState: (option: ITableRef['resizeState']) => void;
|
|
63
52
|
setSummaries: (option: ITableRef['summaries']) => void;
|
|
@@ -72,8 +61,7 @@ declare const useTableCore: <T extends ITableProps>(props: T, extra: IExtra) =>
|
|
|
72
61
|
checkDataIndex: () => void;
|
|
73
62
|
createTableFullData: (list: IRecord[]) => void;
|
|
74
63
|
getTableData: () => Promise<void>;
|
|
75
|
-
|
|
76
|
-
createWebPageData: () => IRecord<any>[];
|
|
64
|
+
createTableList: () => IRecord<any>[];
|
|
77
65
|
createTableData: (list: IRecord[]) => void;
|
|
78
66
|
createGroupData: (list: IRecord[]) => IRecord<any>[];
|
|
79
67
|
createSelectionKeys: (rowKeys?: IRowKey[]) => (string | number)[];
|
|
@@ -95,8 +83,6 @@ declare const useTableCore: <T extends ITableProps>(props: T, extra: IExtra) =>
|
|
|
95
83
|
toFirstPage: () => void;
|
|
96
84
|
getPageCount: () => number;
|
|
97
85
|
pagerChangeHandle: ({ current, pageSize }: Omit<IPagination, 'total'>) => void;
|
|
98
|
-
triggerScrollXEvent: (sl: number) => void;
|
|
99
|
-
triggerScrollYEvent: (st: number) => void;
|
|
100
86
|
scrollBottomDebouncer: (ev: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
101
87
|
clearTableSorter: () => void;
|
|
102
88
|
clearTableFilter: () => void;
|
|
@@ -6,7 +6,6 @@ type IExtra = {
|
|
|
6
6
|
tableRef: React.MutableRefObject<ITableRef>;
|
|
7
7
|
tableBodyRef: React.RefObject<TableBodyRef>;
|
|
8
8
|
$size: ComponentSize;
|
|
9
|
-
scrollX: boolean;
|
|
10
9
|
pagination: IPagination;
|
|
11
10
|
selectionKeys: IDerivedRowKeys;
|
|
12
11
|
rowExpandedKeys: IDerivedRowKeys;
|
|
@@ -26,7 +25,6 @@ type IExtra = {
|
|
|
26
25
|
setRowExpandedKeys: (rowKeys: IRowKey[]) => void;
|
|
27
26
|
setHighlightKey: (rowKey: IRowKey) => void;
|
|
28
27
|
setResizeState: (option: ITableRef['resizeState']) => void;
|
|
29
|
-
setPingRight: (value: boolean) => void;
|
|
30
28
|
setUnMounted: (value: boolean) => void;
|
|
31
29
|
calcTableHeight: () => void;
|
|
32
30
|
createSelectionKeys: (rowKeys?: IRowKey[]) => IRowKey[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { getRowKeyType } from '../table/types';
|
|
3
|
-
import type { IColumn, IMergeCellItem, IRecord, IRowKey, ITableProps } from '../table/types';
|
|
3
|
+
import type { IColumn, IMergeCellItem, IRecord, IRowKey, ITableProps, TableBodyRef } 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';
|
|
@@ -9,23 +9,19 @@ type IExtra = {
|
|
|
9
9
|
tableRef: React.MutableRefObject<ITableRef>;
|
|
10
10
|
topElementRef: React.RefObject<HTMLDivElement>;
|
|
11
11
|
tableElementRef: React.RefObject<HTMLDivElement>;
|
|
12
|
+
tableBodyRef: React.RefObject<TableBodyRef>;
|
|
12
13
|
$size: ComponentSize;
|
|
13
14
|
tableColumns: IColumn[];
|
|
14
15
|
flattenColumns: IColumn[];
|
|
15
16
|
leftFixedColumns: IColumn[];
|
|
16
17
|
derivedMergeCells: IMergeCellItem[];
|
|
18
|
+
tableFlatData: IRecord[];
|
|
17
19
|
layout: ITableState['layout'];
|
|
18
|
-
scrollX: boolean;
|
|
19
|
-
scrollY: boolean;
|
|
20
20
|
showFooter: boolean;
|
|
21
21
|
showPagination: boolean;
|
|
22
22
|
isFullScreen: boolean;
|
|
23
23
|
setLayout: <T extends ITableState['layout']>(layout: T | ((prev: T) => T)) => void;
|
|
24
|
-
setScrollX: (scrollX: boolean) => void;
|
|
25
|
-
setScrollY: (scrollY: boolean) => void;
|
|
26
24
|
setElementStore: (key: string, value: HTMLElement) => void;
|
|
27
|
-
setScrollXStore: (option: ITableRef['scrollXStore']) => void;
|
|
28
|
-
setScrollYStore: (option: ITableRef['scrollYStore']) => void;
|
|
29
25
|
setShouldToTop: (value: boolean) => void;
|
|
30
26
|
};
|
|
31
27
|
declare const useTableLayout: <T extends ITableProps>(props: T, extra: IExtra) => {
|
|
@@ -39,16 +35,8 @@ declare const useTableLayout: <T extends ITableProps>(props: T, extra: IExtra) =
|
|
|
39
35
|
getStickyRight: (dataIndex: string, part?: string) => number;
|
|
40
36
|
scrollXToColumn: (dataIndex: string, index?: number) => void;
|
|
41
37
|
scrollYToRecord: (rowKey: IRowKey, index?: number) => void;
|
|
42
|
-
rowInViewport: (index: number) => boolean;
|
|
43
38
|
calcTableHeight: () => void;
|
|
44
39
|
resetTableScroll: () => void;
|
|
45
|
-
computeVirtualX: (sl: number, tableWidth: number) => {
|
|
46
|
-
toVisibleIndex: number;
|
|
47
|
-
visibleSize: number;
|
|
48
|
-
};
|
|
49
|
-
computeVirtualY: (st: number, rowHeight: number) => {
|
|
50
|
-
toVisibleIndex: number;
|
|
51
|
-
};
|
|
52
40
|
doLayout: () => void;
|
|
53
41
|
};
|
|
54
42
|
export default useTableLayout;
|
|
@@ -5,7 +5,7 @@ type IExtra = {
|
|
|
5
5
|
getRowKey: getRowKeyType;
|
|
6
6
|
tableRef: React.MutableRefObject<ITableRef>;
|
|
7
7
|
tableFullData: IRecord[];
|
|
8
|
-
|
|
8
|
+
tableFlatData: IRecord[];
|
|
9
9
|
sorter: ISorter;
|
|
10
10
|
filters: IFilter;
|
|
11
11
|
superFilters: ISuperFilter[];
|
|
@@ -18,7 +18,6 @@ declare const useTableMemo: <T extends ITableProps>(props: T, extra: IExtra) =>
|
|
|
18
18
|
isWebPagination: boolean;
|
|
19
19
|
isScrollPagination: boolean;
|
|
20
20
|
showPagination: boolean;
|
|
21
|
-
shouldUpdateHeight: boolean;
|
|
22
21
|
tableColumns: IColumn[];
|
|
23
22
|
flattenColumns: IColumn[];
|
|
24
23
|
editableColumns: IColumn[];
|
|
@@ -42,7 +41,6 @@ declare const useTableMemo: <T extends ITableProps>(props: T, extra: IExtra) =>
|
|
|
42
41
|
isPivotGrid: boolean;
|
|
43
42
|
isGroupSummary: boolean;
|
|
44
43
|
isGroupSubtotal: boolean;
|
|
45
|
-
isTreeTable: boolean;
|
|
46
44
|
isTableEmpty: boolean;
|
|
47
45
|
summationRows: Record<string, string | number>[];
|
|
48
46
|
fetchParams: IFetchParams;
|
|
@@ -12,7 +12,6 @@ export type ITableRef = {
|
|
|
12
12
|
originColumns: IColumn[];
|
|
13
13
|
tableFullData: IRecord[];
|
|
14
14
|
tableOriginData: IRecord[];
|
|
15
|
-
tableFlatData: IRecord[];
|
|
16
15
|
allTableData: IRecord[];
|
|
17
16
|
allRowKeys: IRowKey[];
|
|
18
17
|
deriveRowKeys: IDerivedRowKey[];
|
|
@@ -21,19 +20,7 @@ export type ITableRef = {
|
|
|
21
20
|
fieldAuth: Record<string, IFieldAuthItem>;
|
|
22
21
|
columnsDefined: boolean;
|
|
23
22
|
scrollBarRef: React.RefObject<ScrollbarRef>;
|
|
24
|
-
|
|
25
|
-
startIndex: number;
|
|
26
|
-
endIndex: number;
|
|
27
|
-
offsetSize: number;
|
|
28
|
-
visibleSize: number;
|
|
29
|
-
};
|
|
30
|
-
scrollYStore: {
|
|
31
|
-
startIndex: number;
|
|
32
|
-
endIndex: number;
|
|
33
|
-
offsetSize: number;
|
|
34
|
-
visibleSize: number;
|
|
35
|
-
rowHeight: number;
|
|
36
|
-
};
|
|
23
|
+
rowHeight: number;
|
|
37
24
|
store: Store;
|
|
38
25
|
resizeState: {
|
|
39
26
|
width: number;
|
|
@@ -45,7 +32,7 @@ export type ITableRef = {
|
|
|
45
32
|
remove: boolean;
|
|
46
33
|
};
|
|
47
34
|
summaries: Record<string, number>;
|
|
48
|
-
|
|
35
|
+
isTreeTable: boolean;
|
|
49
36
|
scrollXLoad: boolean;
|
|
50
37
|
scrollYLoad: boolean;
|
|
51
38
|
shouldToTop: boolean;
|
|
@@ -62,15 +49,12 @@ declare const useTableRef: <T extends ITableProps>(props: T, { getRowKey, $size
|
|
|
62
49
|
setElementStore: (key: string, value: HTMLElement) => void;
|
|
63
50
|
setOriginColumns: (columns: IColumn[]) => void;
|
|
64
51
|
setTableFullData: (records: IRecord[]) => void;
|
|
65
|
-
setTableFlatData: (records: IRecord[]) => void;
|
|
66
52
|
setTableOriginData: (records: IRecord[]) => void;
|
|
67
53
|
setAllTableData: (records: IRecord[]) => void;
|
|
68
54
|
setDeriveRowKeys: (records: IRecord[]) => void;
|
|
69
55
|
setInvalidRowKeys: (rowKeys: IRowKey[]) => void;
|
|
70
56
|
setFieldAuth: (key: string, value: IFieldAuthItem) => void;
|
|
71
57
|
setColumnsDefined: (value: boolean) => void;
|
|
72
|
-
setScrollXStore: (option: ITableRef['scrollXStore']) => void;
|
|
73
|
-
setScrollYStore: (option: ITableRef['scrollYStore']) => void;
|
|
74
58
|
setResizeState: (option: ITableRef['resizeState']) => void;
|
|
75
59
|
setHandleState: (option: ITableRef['handleState']) => void;
|
|
76
60
|
setSummaries: (option: ITableRef['summaries']) => void;
|
|
@@ -89,7 +73,6 @@ declare const useTableRef: <T extends ITableProps>(props: T, { getRowKey, $size
|
|
|
89
73
|
originColumns: IColumn[];
|
|
90
74
|
tableFullData: IRecord[];
|
|
91
75
|
tableOriginData: IRecord[];
|
|
92
|
-
tableFlatData: IRecord[];
|
|
93
76
|
allTableData: IRecord[];
|
|
94
77
|
allRowKeys: IRowKey[];
|
|
95
78
|
deriveRowKeys: IDerivedRowKey[];
|
|
@@ -98,19 +81,7 @@ declare const useTableRef: <T extends ITableProps>(props: T, { getRowKey, $size
|
|
|
98
81
|
fieldAuth: Record<string, IFieldAuthItem>;
|
|
99
82
|
columnsDefined: boolean;
|
|
100
83
|
scrollBarRef: React.RefObject<ScrollbarRef>;
|
|
101
|
-
|
|
102
|
-
startIndex: number;
|
|
103
|
-
endIndex: number;
|
|
104
|
-
offsetSize: number;
|
|
105
|
-
visibleSize: number;
|
|
106
|
-
};
|
|
107
|
-
scrollYStore: {
|
|
108
|
-
startIndex: number;
|
|
109
|
-
endIndex: number;
|
|
110
|
-
offsetSize: number;
|
|
111
|
-
visibleSize: number;
|
|
112
|
-
rowHeight: number;
|
|
113
|
-
};
|
|
84
|
+
rowHeight: number;
|
|
114
85
|
store: Store;
|
|
115
86
|
resizeState: {
|
|
116
87
|
width: number;
|
|
@@ -122,7 +93,7 @@ declare const useTableRef: <T extends ITableProps>(props: T, { getRowKey, $size
|
|
|
122
93
|
remove: boolean;
|
|
123
94
|
};
|
|
124
95
|
summaries: Record<string, number>;
|
|
125
|
-
|
|
96
|
+
isTreeTable: boolean;
|
|
126
97
|
scrollXLoad: boolean;
|
|
127
98
|
scrollYLoad: boolean;
|
|
128
99
|
shouldToTop: boolean;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { IFilter, IMergedCell, IPagination, IRecord, IRowKey, ISorter, ISuperFilter, ITableProps } from '../table/types';
|
|
3
3
|
export type ITableState = {
|
|
4
|
-
|
|
5
|
-
tableFlatColumns: IColumn[];
|
|
4
|
+
tableFlatData: IRecord[];
|
|
6
5
|
filters: IFilter;
|
|
7
6
|
sorter: ISorter;
|
|
8
7
|
superFilters: ISuperFilter[];
|
|
@@ -29,17 +28,13 @@ export type ITableState = {
|
|
|
29
28
|
print: boolean;
|
|
30
29
|
};
|
|
31
30
|
spinning: boolean;
|
|
32
|
-
scrollX: boolean;
|
|
33
|
-
scrollY: boolean;
|
|
34
31
|
isPingLeft: boolean;
|
|
35
32
|
isPingRight: boolean;
|
|
36
33
|
isFullScreen: boolean;
|
|
37
34
|
};
|
|
38
35
|
declare const useTableState: <T extends ITableProps>(props: T) => {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
tableFlatColumns: IColumn[];
|
|
42
|
-
setTableFlatColumns: React.Dispatch<React.SetStateAction<IColumn[]>>;
|
|
36
|
+
tableFlatData: IRecord<any>[];
|
|
37
|
+
setTableFlatData: React.Dispatch<React.SetStateAction<IRecord<any>[]>>;
|
|
43
38
|
filters: IFilter;
|
|
44
39
|
setFilters: React.Dispatch<IFilter>;
|
|
45
40
|
sorter: ISorter;
|
|
@@ -92,16 +87,12 @@ declare const useTableState: <T extends ITableProps>(props: T) => {
|
|
|
92
87
|
}>>;
|
|
93
88
|
spinning: boolean;
|
|
94
89
|
setSpinning: React.Dispatch<React.SetStateAction<boolean>>;
|
|
95
|
-
scrollX: boolean;
|
|
96
|
-
setScrollX: React.Dispatch<React.SetStateAction<boolean>>;
|
|
97
|
-
scrollY: boolean;
|
|
98
|
-
setScrollY: React.Dispatch<React.SetStateAction<boolean>>;
|
|
99
90
|
isPingLeft: boolean;
|
|
100
91
|
setPingLeft: React.Dispatch<React.SetStateAction<boolean>>;
|
|
101
92
|
isPingRight: boolean;
|
|
102
93
|
setPingRight: React.Dispatch<React.SetStateAction<boolean>>;
|
|
103
94
|
isFullScreen: boolean;
|
|
104
95
|
setFullScreen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
105
|
-
|
|
96
|
+
updateTableFlatData: () => void;
|
|
106
97
|
};
|
|
107
98
|
export default useTableState;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IColumn, IRecord } from '../table/types';
|
|
2
|
+
declare const useTableVirtual: (tableFlatData: IRecord[], tableFlatColumns: IColumn[]) => {
|
|
3
|
+
rowVirtualizer: import("../../../virtual-list/src/core").Virtualizer<HTMLElement, Element>;
|
|
4
|
+
columnVirtualizer: import("../../../virtual-list/src/core").Virtualizer<HTMLElement, Element>;
|
|
5
|
+
virtualRows: import("../../../virtual-list/src/core").VirtualItem[];
|
|
6
|
+
virtualColumns: import("../../../virtual-list/src/core").VirtualItem[];
|
|
7
|
+
resetItemXSize: (columns: IColumn[]) => void;
|
|
8
|
+
getYIndexes: () => number[];
|
|
9
|
+
getXIndexes: () => number[];
|
|
10
|
+
virtualTranslateY: () => number;
|
|
11
|
+
virtualTranslateX: () => number;
|
|
12
|
+
calcVirtualYSize: () => number | undefined;
|
|
13
|
+
calcVirtualXSize: () => number | undefined;
|
|
14
|
+
scrollToYIndex: (index: number) => void;
|
|
15
|
+
scrollToXIndex: (index: number) => void;
|
|
16
|
+
};
|
|
17
|
+
export default useTableVirtual;
|
|
@@ -142,7 +142,6 @@ export declare const propTypes: {
|
|
|
142
142
|
showHeader: PropTypes.Requireable<boolean>;
|
|
143
143
|
ellipsis: PropTypes.Requireable<boolean>;
|
|
144
144
|
dynamicThead: PropTypes.Requireable<boolean>;
|
|
145
|
-
nativeScrollBar: PropTypes.Requireable<boolean>;
|
|
146
145
|
rowStyle: PropTypes.Requireable<object>;
|
|
147
146
|
cellStyle: PropTypes.Requireable<object>;
|
|
148
147
|
mergedCells: PropTypes.Requireable<any[]>;
|
|
@@ -293,7 +293,7 @@ export type IColumn = {
|
|
|
293
293
|
className?: string;
|
|
294
294
|
theadClassName?: string;
|
|
295
295
|
children?: Array<IColumn> | Nullable<undefined>;
|
|
296
|
-
sorter?: boolean | ((a: IRecord, b: IRecord) =>
|
|
296
|
+
sorter?: boolean | ((a: IRecord, b: IRecord) => number);
|
|
297
297
|
filter?: {
|
|
298
298
|
type: IFilterType;
|
|
299
299
|
items?: Array<IDict>;
|
|
@@ -357,7 +357,6 @@ export type ITableProps = {
|
|
|
357
357
|
showHeader?: boolean;
|
|
358
358
|
ellipsis?: boolean;
|
|
359
359
|
dynamicThead?: boolean;
|
|
360
|
-
nativeScrollBar?: boolean;
|
|
361
360
|
rowStyle?: CSSProperties | ((row: IRecord, rowIndex: number) => CSSProperties);
|
|
362
361
|
cellStyle?: CSSProperties | ((row: IRecord, column: IColumn, rowIndex: number, columnIndex: number) => CSSProperties);
|
|
363
362
|
mergedCells?: IMergedCell[];
|
|
@@ -458,6 +457,8 @@ export type TableBodyRef = {
|
|
|
458
457
|
setClickedValues: (clicked: IClicked) => void;
|
|
459
458
|
createFocus: (rowKey: IRowKey, dataIndex: string) => void;
|
|
460
459
|
forceUpdate: () => void;
|
|
460
|
+
resetItemXSize: (columns: IColumn[]) => void;
|
|
461
|
+
scrollToYIndex: (index: number) => void;
|
|
461
462
|
};
|
|
462
463
|
export type ColumnDefineRef = {
|
|
463
464
|
initialHandler: () => void;
|