dcp-design-react 1.9.20 → 1.9.22
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/with-default-props.d.ts +1 -0
- package/lib/form/src/types.d.ts +1 -1
- package/lib/index.esm.js +1 -1
- package/lib/index.full.js +1 -1
- package/lib/index.js +1 -1
- package/lib/scrollbar/src/scrollbar.d.ts +1 -0
- package/lib/scrollbar/src/thumb.d.ts +1 -0
- package/lib/scrollbar/style/index.less +4 -0
- package/lib/style/index.css +37 -20
- package/lib/style/index.min.css +1 -1
- package/lib/table/src/area-select/index.d.ts +6 -0
- package/lib/table/src/context/index.d.ts +0 -1
- package/lib/table/src/hooks/useTableEffect.d.ts +0 -3
- package/lib/table/src/hooks/useTableLayout.d.ts +3 -1
- package/lib/table/src/hooks/useTableMemo.d.ts +0 -1
- package/lib/table/src/hooks/useTableRef.d.ts +2 -2
- package/lib/table/src/table/props.d.ts +6 -3
- package/lib/table/src/table/types.d.ts +8 -6
- package/lib/table/src/utils/index.d.ts +0 -3
- package/lib/table/style/area-select.less +24 -0
- package/lib/table/style/index.less +30 -29
- package/lib/table/style/table.less +360 -372
- package/package.json +1 -1
|
@@ -4,8 +4,6 @@ import type { TableBodyRef, IColumn, IPagination, IRowKey, ITableProps, IDeriveR
|
|
|
4
4
|
import type { ComponentSize } from '../../../_utils/types';
|
|
5
5
|
type IExtra = {
|
|
6
6
|
tableRef: React.MutableRefObject<ITableRef>;
|
|
7
|
-
topElementRef: React.RefObject<HTMLDivElement>;
|
|
8
|
-
tableElementRef: React.RefObject<HTMLDivElement>;
|
|
9
7
|
tableBodyRef: React.RefObject<TableBodyRef>;
|
|
10
8
|
$size: ComponentSize;
|
|
11
9
|
scrollX: boolean;
|
|
@@ -35,7 +33,6 @@ type IExtra = {
|
|
|
35
33
|
calcTableHeight: () => void;
|
|
36
34
|
createSelectionKeys: (rowKeys?: IRowKey[]) => IRowKey[];
|
|
37
35
|
createRowExpandedKeys: (rowKeys?: IRowKey[]) => IRowKey[];
|
|
38
|
-
createElementStore: (option: Record<string, HTMLElement>) => void;
|
|
39
36
|
initialTable: () => void;
|
|
40
37
|
destroy: () => void;
|
|
41
38
|
};
|
|
@@ -7,6 +7,8 @@ import type { ComponentSize } from '../../../_utils/types';
|
|
|
7
7
|
type IExtra = {
|
|
8
8
|
getRowKey: getRowKeyType;
|
|
9
9
|
tableRef: React.MutableRefObject<ITableRef>;
|
|
10
|
+
topElementRef: React.RefObject<HTMLDivElement>;
|
|
11
|
+
tableElementRef: React.RefObject<HTMLDivElement>;
|
|
10
12
|
$size: ComponentSize;
|
|
11
13
|
tableColumns: IColumn[];
|
|
12
14
|
flattenColumns: IColumn[];
|
|
@@ -26,7 +28,7 @@ type IExtra = {
|
|
|
26
28
|
setShouldToTop: (value: boolean) => void;
|
|
27
29
|
};
|
|
28
30
|
declare const useTableLayout: <T extends ITableProps>(props: T, extra: IExtra) => {
|
|
29
|
-
createElementStore: (
|
|
31
|
+
createElementStore: () => void;
|
|
30
32
|
tableStyles: React.CSSProperties;
|
|
31
33
|
getSpan: (row: IRecord, column: IColumn, rowIndex: number, columnIndex: number, tableData: IRecord[]) => {
|
|
32
34
|
rowSpan: number;
|
|
@@ -39,7 +39,6 @@ declare const useTableMemo: <T extends ITableProps>(props: T, extra: IExtra) =>
|
|
|
39
39
|
isFastSearch: boolean;
|
|
40
40
|
isGroupSummary: boolean;
|
|
41
41
|
isGroupSubtotal: boolean;
|
|
42
|
-
isDragMergeCell: boolean;
|
|
43
42
|
isTreeTable: boolean;
|
|
44
43
|
isTableEmpty: boolean;
|
|
45
44
|
summationRows: Record<string, string | number>[];
|
|
@@ -19,7 +19,7 @@ export type ITableRef = {
|
|
|
19
19
|
flattenRowKeys: IRowKey[];
|
|
20
20
|
invalidRowKeys: IRowKey[];
|
|
21
21
|
fieldAuth: Record<string, IFieldAuthItem>;
|
|
22
|
-
|
|
22
|
+
mergedCells: IMergeCell[];
|
|
23
23
|
columnsDefined: boolean;
|
|
24
24
|
scrollBarRef: React.RefObject<ScrollbarRef>;
|
|
25
25
|
scrollXStore: {
|
|
@@ -98,7 +98,7 @@ declare const useTableRef: <T extends ITableProps>(props: T, { getRowKey, $size
|
|
|
98
98
|
flattenRowKeys: IRowKey[];
|
|
99
99
|
invalidRowKeys: IRowKey[];
|
|
100
100
|
fieldAuth: Record<string, IFieldAuthItem>;
|
|
101
|
-
|
|
101
|
+
mergedCells: IMergeCell[];
|
|
102
102
|
columnsDefined: boolean;
|
|
103
103
|
scrollBarRef: React.RefObject<ScrollbarRef>;
|
|
104
104
|
scrollXStore: {
|
|
@@ -143,10 +143,9 @@ export declare const propTypes: {
|
|
|
143
143
|
nativeScrollBar: PropTypes.Requireable<boolean>;
|
|
144
144
|
rowStyle: PropTypes.Requireable<object>;
|
|
145
145
|
cellStyle: PropTypes.Requireable<object>;
|
|
146
|
-
|
|
146
|
+
mergedCells: PropTypes.Requireable<any[]>;
|
|
147
147
|
spanMethod: PropTypes.Requireable<(...args: any[]) => any>;
|
|
148
148
|
rowDraggable: PropTypes.Requireable<boolean>;
|
|
149
|
-
dragMergeCell: PropTypes.Requireable<boolean>;
|
|
150
149
|
initialSorter: PropTypes.Requireable<object>;
|
|
151
150
|
initialFilter: PropTypes.Requireable<object>;
|
|
152
151
|
rowSelection: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -182,6 +181,7 @@ export declare const propTypes: {
|
|
|
182
181
|
}>>;
|
|
183
182
|
tableConfig: PropTypes.Requireable<PropTypes.InferProps<{
|
|
184
183
|
virtual: PropTypes.Requireable<boolean>;
|
|
184
|
+
doubleXScrollbar: PropTypes.Requireable<boolean>;
|
|
185
185
|
}>>;
|
|
186
186
|
treeConfig: PropTypes.Requireable<PropTypes.InferProps<{
|
|
187
187
|
virtual: PropTypes.Requireable<boolean>;
|
|
@@ -198,6 +198,10 @@ export declare const propTypes: {
|
|
|
198
198
|
onExpand: PropTypes.Requireable<(...args: any[]) => any>;
|
|
199
199
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
200
200
|
}>>;
|
|
201
|
+
areaSelection: PropTypes.Requireable<PropTypes.InferProps<{
|
|
202
|
+
cellMerge: PropTypes.Requireable<boolean>;
|
|
203
|
+
onCellMerge: PropTypes.Requireable<(...args: any[]) => any>;
|
|
204
|
+
}>>;
|
|
201
205
|
summation: PropTypes.Requireable<PropTypes.InferProps<{
|
|
202
206
|
groupItems: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
203
207
|
dataIndex: PropTypes.Validator<string>;
|
|
@@ -274,7 +278,6 @@ export declare const propTypes: {
|
|
|
274
278
|
onRowEnter: PropTypes.Requireable<(...args: any[]) => any>;
|
|
275
279
|
onScrollEnd: PropTypes.Requireable<(...args: any[]) => any>;
|
|
276
280
|
onFetchError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
277
|
-
onMergeChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
278
281
|
};
|
|
279
282
|
export declare const defaultProps: ITableProps;
|
|
280
283
|
/**
|
|
@@ -36,9 +36,7 @@ export type IRowColSpan = {
|
|
|
36
36
|
export type IMergeCell = {
|
|
37
37
|
row: number;
|
|
38
38
|
col: number;
|
|
39
|
-
|
|
40
|
-
colSpan: number;
|
|
41
|
-
};
|
|
39
|
+
} & IRowColSpan;
|
|
42
40
|
export declare enum EAlign {
|
|
43
41
|
left = "flex-start",
|
|
44
42
|
right = "flex-end"
|
|
@@ -202,6 +200,7 @@ export type IRowHighlight = {
|
|
|
202
200
|
};
|
|
203
201
|
export type ITableConfig = {
|
|
204
202
|
virtual?: boolean;
|
|
203
|
+
doubleXScrollbar?: boolean;
|
|
205
204
|
};
|
|
206
205
|
export type ITreeConfig = {
|
|
207
206
|
virtual?: boolean;
|
|
@@ -218,6 +217,10 @@ export type IExpandable = {
|
|
|
218
217
|
onExpand?: (expand: boolean, row: IRecord) => void;
|
|
219
218
|
onChange?: (expandedKeys: IRowKey[], expandedRows: IRecord[]) => void;
|
|
220
219
|
};
|
|
220
|
+
export type IAreaSelection = {
|
|
221
|
+
cellMerge?: boolean;
|
|
222
|
+
onCellMerge?: (cells: IMergeCell[]) => void;
|
|
223
|
+
};
|
|
221
224
|
export type ISummation = {
|
|
222
225
|
groupItems?: Array<{
|
|
223
226
|
dataIndex: string;
|
|
@@ -345,7 +348,7 @@ export type ITableProps = {
|
|
|
345
348
|
nativeScrollBar?: boolean;
|
|
346
349
|
rowStyle?: CSSProperties | ((row: IRecord, rowIndex: number) => CSSProperties);
|
|
347
350
|
cellStyle?: CSSProperties | ((row: IRecord, column: IColumn, rowIndex: number, columnIndex: number) => CSSProperties);
|
|
348
|
-
|
|
351
|
+
mergedCells?: IMergeCell[];
|
|
349
352
|
spanMethod?: (options: {
|
|
350
353
|
row: IRecord;
|
|
351
354
|
column: IColumn;
|
|
@@ -353,7 +356,6 @@ export type ITableProps = {
|
|
|
353
356
|
columnIndex: number;
|
|
354
357
|
tableData: IRecord[];
|
|
355
358
|
}) => IRowColSpan | [number, number];
|
|
356
|
-
dragMergeCell?: boolean;
|
|
357
359
|
rowDraggable?: boolean;
|
|
358
360
|
initialSorter?: ISorter;
|
|
359
361
|
initialFilter?: IFilter;
|
|
@@ -362,6 +364,7 @@ export type ITableProps = {
|
|
|
362
364
|
tableConfig?: ITableConfig;
|
|
363
365
|
treeConfig?: ITreeConfig;
|
|
364
366
|
expandable?: IExpandable;
|
|
367
|
+
areaSelection?: IAreaSelection;
|
|
365
368
|
summation?: ISummation;
|
|
366
369
|
footRender?: (flattenColumns: IColumn[], tableData: IRecord[]) => React.ReactNode;
|
|
367
370
|
multipleSort?: boolean;
|
|
@@ -404,7 +407,6 @@ export type ITableProps = {
|
|
|
404
407
|
onRowEnter?: (row: IRecord, event: KeyboardEvent) => void;
|
|
405
408
|
onScrollEnd?: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
406
409
|
onFetchError?: (error: any) => void;
|
|
407
|
-
onMergeChange?: (cells: IMergeCell[]) => void;
|
|
408
410
|
};
|
|
409
411
|
export type TableRef = {
|
|
410
412
|
CALCULATE_HEIGHT: () => void;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import dayjs, { Dayjs } from 'dayjs';
|
|
3
|
-
import { hasOwn } from '../../../_utils/util';
|
|
4
3
|
import type { IColumn, IDerivedRowKey, IRecord, IRowKey, ISorter } from '../table/types';
|
|
5
4
|
import type { Nullable, AnyObject } from '../../../_utils/types';
|
|
6
|
-
export { hasOwn };
|
|
7
5
|
export declare const columnsFlatMap: (columns: IColumn[]) => IColumn[];
|
|
8
6
|
export declare const createFilterColumns: (columns: IColumn[]) => IColumn[];
|
|
9
7
|
export declare const getAllColumns: (columns: IColumn[]) => IColumn[];
|
|
@@ -53,4 +51,3 @@ export declare const sortableFormatter: <T>(items: T[]) => T[];
|
|
|
53
51
|
* @returns
|
|
54
52
|
*/
|
|
55
53
|
export declare const equalFn: <T = any>(obj1: T, obj2: T, shallow?: boolean) => boolean;
|
|
56
|
-
export declare const withDefaultProps: <T extends object>(defaultProps: T, props: Partial<T>) => T;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: 焦质晔
|
|
3
|
+
* @Date: 2024-07-23 09:27:27
|
|
4
|
+
* @Last Modified by: 焦质晔
|
|
5
|
+
* @Last Modified time: 2024-07-24 13:32:48
|
|
6
|
+
*/
|
|
7
|
+
.@{prefix-table}--area-select {
|
|
8
|
+
position: static;
|
|
9
|
+
height: 0;
|
|
10
|
+
font-size: 0;
|
|
11
|
+
.checked-area {
|
|
12
|
+
border: 1px solid @--primary-5;
|
|
13
|
+
background-color: rgba(@--primary-2, 0.35);
|
|
14
|
+
position: absolute;
|
|
15
|
+
z-index: 2;
|
|
16
|
+
pointer-events: none;
|
|
17
|
+
}
|
|
18
|
+
.active-area {
|
|
19
|
+
border: 2px solid @--primary-5;
|
|
20
|
+
position: absolute;
|
|
21
|
+
z-index: 2;
|
|
22
|
+
pointer-events: none;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: 焦质晔
|
|
3
|
-
* @Date: 2021-07-23 19:05:57
|
|
4
|
-
* @Last Modified by: 焦质晔
|
|
5
|
-
* @Last Modified time:
|
|
6
|
-
*/
|
|
7
|
-
@import './variable.less';
|
|
8
|
-
@import './toper.less';
|
|
9
|
-
@import './alert.less';
|
|
10
|
-
@import './full-screen.less';
|
|
11
|
-
@import './reload.less';
|
|
12
|
-
@import './print.less';
|
|
13
|
-
@import './import.less';
|
|
14
|
-
@import './export.less';
|
|
15
|
-
@import './clipboard.less';
|
|
16
|
-
@import './tollbox.less';
|
|
17
|
-
@import './select-collection.less';
|
|
18
|
-
@import './group-summary.less';
|
|
19
|
-
@import './super-search.less';
|
|
20
|
-
@import './fast-search.less';
|
|
21
|
-
@import './column-filter.less';
|
|
22
|
-
@import './table.less';
|
|
23
|
-
@import './header.less';
|
|
24
|
-
@import './body.less';
|
|
25
|
-
@import './footer.less';
|
|
26
|
-
@import './
|
|
27
|
-
@import './
|
|
28
|
-
@import './
|
|
29
|
-
@import './
|
|
1
|
+
/*
|
|
2
|
+
* @Author: 焦质晔
|
|
3
|
+
* @Date: 2021-07-23 19:05:57
|
|
4
|
+
* @Last Modified by: 焦质晔
|
|
5
|
+
* @Last Modified time: 2024-07-23 09:28:50
|
|
6
|
+
*/
|
|
7
|
+
@import './variable.less';
|
|
8
|
+
@import './toper.less';
|
|
9
|
+
@import './alert.less';
|
|
10
|
+
@import './full-screen.less';
|
|
11
|
+
@import './reload.less';
|
|
12
|
+
@import './print.less';
|
|
13
|
+
@import './import.less';
|
|
14
|
+
@import './export.less';
|
|
15
|
+
@import './clipboard.less';
|
|
16
|
+
@import './tollbox.less';
|
|
17
|
+
@import './select-collection.less';
|
|
18
|
+
@import './group-summary.less';
|
|
19
|
+
@import './super-search.less';
|
|
20
|
+
@import './fast-search.less';
|
|
21
|
+
@import './column-filter.less';
|
|
22
|
+
@import './table.less';
|
|
23
|
+
@import './header.less';
|
|
24
|
+
@import './body.less';
|
|
25
|
+
@import './footer.less';
|
|
26
|
+
@import './area-select.less';
|
|
27
|
+
@import './pager.less';
|
|
28
|
+
@import './empty.less';
|
|
29
|
+
@import './expandable.less';
|
|
30
|
+
@import './size.less';
|