dcp-design-react 1.11.9 → 1.11.10
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/motion.d.ts +7 -0
- package/lib/collapse/style/index.less +24 -24
- package/lib/collapse/style/motion.less +11 -0
- package/lib/color-picker/index.d.ts +3 -0
- package/lib/color-picker/src/color-picker.d.ts +26 -0
- package/lib/color-picker/style/index.less +117 -0
- package/lib/guide-tracker/src/guideTracker.d.ts +1 -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 +1 -0
- package/lib/locale/lang/en.js +6 -5
- package/lib/locale/lang/zh-cn.d.ts +1 -0
- package/lib/locale/lang/zh-cn.js +6 -5
- package/lib/pivot-grid/src/grid-layout/Context.d.ts +3 -0
- package/lib/pivot-grid/src/hooks/use-export.d.ts +11 -0
- package/lib/pivot-grid/src/main/Context.d.ts +20 -2
- package/lib/pivot-grid/src/main/Main.d.ts +3 -0
- package/lib/pivot-grid/src/main/types.d.ts +19 -3
- package/lib/pivot-grid/src/top-bar/AlertInfo.d.ts +3 -0
- package/lib/pivot-grid/src/top-bar/ConfigInfo.d.ts +3 -0
- package/lib/pivot-grid/src/top-bar/FillColor.d.ts +3 -0
- package/lib/pivot-grid/src/utils/index.d.ts +3 -6
- package/lib/pivot-grid/style/grid-layout.less +2 -2
- package/lib/pivot-grid/style/main.less +33 -43
- package/lib/pivot-grid/style/top-bar.less +45 -1
- package/lib/style/index.css +174 -34
- package/lib/style/index.less +44 -43
- package/lib/style/index.min.css +1 -1
- package/lib/tour/src/Tour.d.ts +1 -1
- package/lib/tour/src/TourStep/index.d.ts +1 -1
- package/lib/tour/src/util.d.ts +1 -1
- package/lib/virtual-list/style/index.less +2 -1
- package/package.json +2 -1
- package/lib/collapse/src/_util/motion.less +0 -13
- package/lib/collapse/src/_util/motionUtil.d.ts +0 -3
- /package/lib/{tour/src → _utils}/placements.d.ts +0 -0
- /package/lib/pivot-grid/src/top-bar/{exportPanel.d.ts → ExportPanel.d.ts} +0 -0
package/lib/locale/lang/en.d.ts
CHANGED
package/lib/locale/lang/en.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: 焦质晔
|
|
3
|
-
* @Date: 2021-06-19 08:46:00
|
|
4
|
-
* @Last Modified by: 焦质晔
|
|
5
|
-
* @Last Modified time: 2024-
|
|
1
|
+
/*
|
|
2
|
+
* @Author: 焦质晔
|
|
3
|
+
* @Date: 2021-06-19 08:46:00
|
|
4
|
+
* @Last Modified by: 焦质晔
|
|
5
|
+
* @Last Modified time: 2024-12-27 09:49:21
|
|
6
6
|
*/
|
|
7
7
|
export default {
|
|
8
8
|
name: 'en',
|
|
@@ -297,6 +297,7 @@ export default {
|
|
|
297
297
|
inText: 'include',
|
|
298
298
|
ninText: 'not include',
|
|
299
299
|
likeText: 'fuzzy matching',
|
|
300
|
+
nullText: 'null value',
|
|
300
301
|
configText: 'Configuration name',
|
|
301
302
|
saveButton: 'Save',
|
|
302
303
|
savedSetting: 'Saved configuration',
|
package/lib/locale/lang/zh-cn.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: 焦质晔
|
|
3
|
-
* @Date: 2021-06-19 08:45:54
|
|
4
|
-
* @Last Modified by: 焦质晔
|
|
5
|
-
* @Last Modified time: 2024-
|
|
1
|
+
/*
|
|
2
|
+
* @Author: 焦质晔
|
|
3
|
+
* @Date: 2021-06-19 08:45:54
|
|
4
|
+
* @Last Modified by: 焦质晔
|
|
5
|
+
* @Last Modified time: 2024-12-27 09:49:04
|
|
6
6
|
*/
|
|
7
7
|
export default {
|
|
8
8
|
name: 'zh-cn',
|
|
@@ -297,6 +297,7 @@ export default {
|
|
|
297
297
|
inText: '包含',
|
|
298
298
|
ninText: '不包含',
|
|
299
299
|
likeText: '模糊匹配',
|
|
300
|
+
nullText: '空值',
|
|
300
301
|
configText: '配置名称',
|
|
301
302
|
saveButton: '保 存',
|
|
302
303
|
savedSetting: '保存的高级检索设置',
|
|
@@ -11,6 +11,7 @@ export type IGridLayoutContext = {
|
|
|
11
11
|
summationData: Summary;
|
|
12
12
|
checkedColumnKey: string;
|
|
13
13
|
hoverRowKey: IRowKey;
|
|
14
|
+
updateLayout: number;
|
|
14
15
|
};
|
|
15
16
|
type IProps = {
|
|
16
17
|
scrollbar: React.RefObject<ScrollbarRef>;
|
|
@@ -25,5 +26,7 @@ export declare const useGridLayoutContext: () => (IGridLayoutContext & {
|
|
|
25
26
|
setSummationData: (value: Summary) => void;
|
|
26
27
|
setCheckColumnKey: (value: string) => void;
|
|
27
28
|
setHoverRowKey: (value: IRowKey) => void;
|
|
29
|
+
forceUpdateLayout: () => void;
|
|
30
|
+
updateColumnsWidth: () => void;
|
|
28
31
|
}) | undefined;
|
|
29
32
|
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IColumn, IRecord } from '../../../table/src/table/types';
|
|
2
|
+
type IParamsFn1 = (columns: IColumn[], records: IRecord[]) => Record<string, number>[];
|
|
3
|
+
type IParamsFn2 = (row: IRecord, rowIndex: number, column: IColumn, columnIndex: number) => string | number;
|
|
4
|
+
declare const useExport: () => {
|
|
5
|
+
exportXLSX: (options: any, dataList: IRecord[], calcSummationValues: IParamsFn1, renderCell: IParamsFn2) => Promise<Blob>;
|
|
6
|
+
importXLSX: (options: {
|
|
7
|
+
columns: IColumn[];
|
|
8
|
+
file: Blob;
|
|
9
|
+
}, callback?: ((records: IRecord[]) => void) | undefined) => void;
|
|
10
|
+
};
|
|
11
|
+
export default useExport;
|
|
@@ -2,7 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import type { IColumn, IOrderBy, IRecord, IRowKey, ISuperFilter } from '../../../table/src/table/types';
|
|
3
3
|
import type { ComponentSize, ValueOf } from '../../../_utils/types';
|
|
4
4
|
import type { IGridLayoutContext } from '../grid-layout/Context';
|
|
5
|
-
|
|
5
|
+
import type { PivotGridProps } from './types';
|
|
6
|
+
export type IPivotMode = 'table' | 'gantt' | 'card';
|
|
6
7
|
export type GroupItem = {
|
|
7
8
|
fieldName: string;
|
|
8
9
|
order: IOrderBy;
|
|
@@ -11,16 +12,26 @@ export type SorterItem = {
|
|
|
11
12
|
fieldName: string;
|
|
12
13
|
order: IOrderBy;
|
|
13
14
|
};
|
|
15
|
+
export type FillColorItem = ISuperFilter & {
|
|
16
|
+
color: string;
|
|
17
|
+
mode: 'cell' | 'row';
|
|
18
|
+
};
|
|
14
19
|
export type SearchResult = {
|
|
15
20
|
value: string;
|
|
16
21
|
rowKey: IRowKey;
|
|
17
22
|
dataIndex: string;
|
|
18
23
|
};
|
|
24
|
+
export type FillColorCell = {
|
|
25
|
+
color: string;
|
|
26
|
+
rowKey: IRowKey;
|
|
27
|
+
dataIndex: string;
|
|
28
|
+
};
|
|
19
29
|
export type PivotRef = {
|
|
30
|
+
props: Partial<PivotGridProps>;
|
|
20
31
|
originGridData: IRecord[];
|
|
21
32
|
flatGroupData: IRecord[];
|
|
22
|
-
keyRecordMap: Map<IRowKey, IRecord>;
|
|
23
33
|
isTree: boolean;
|
|
34
|
+
keyRecordMap: Map<IRowKey, IRecord>;
|
|
24
35
|
gridLayoutContext: Partial<IGridLayoutContext>;
|
|
25
36
|
};
|
|
26
37
|
export type IPivotGridContext = {
|
|
@@ -34,12 +45,17 @@ export type IPivotGridContext = {
|
|
|
34
45
|
groupList: GroupItem[];
|
|
35
46
|
filterList: ISuperFilter[];
|
|
36
47
|
sorterList: SorterItem[];
|
|
48
|
+
colorList: FillColorItem[];
|
|
37
49
|
expandedKeys: string[];
|
|
38
50
|
searchResults: SearchResult[];
|
|
39
51
|
switchIndex: number;
|
|
52
|
+
fillColorCells: Map<string, string>;
|
|
40
53
|
};
|
|
41
54
|
type IProps = {
|
|
42
55
|
prefixCls: string;
|
|
56
|
+
size: ComponentSize;
|
|
57
|
+
pivotProps: Partial<PivotGridProps>;
|
|
58
|
+
getRowKey: (row: IRecord, index: number) => IRowKey;
|
|
43
59
|
tableData: IRecord[];
|
|
44
60
|
flatColumns: IColumn[];
|
|
45
61
|
children?: React.ReactNode;
|
|
@@ -55,8 +71,10 @@ export declare const usePivotGridContext: () => (IPivotGridContext & {
|
|
|
55
71
|
setGroupList: (items: GroupItem[]) => void;
|
|
56
72
|
setFilterList: (items: ISuperFilter[]) => void;
|
|
57
73
|
setSorterList: (items: SorterItem[]) => void;
|
|
74
|
+
setColorList: (items: FillColorItem[]) => void;
|
|
58
75
|
setExpandedKeys: (keys: string[]) => void;
|
|
59
76
|
setSearchResults: (value: SearchResult[]) => void;
|
|
60
77
|
setSwitchIndex: (value: number) => void;
|
|
78
|
+
setFillColor: (items: FillColorCell[]) => void;
|
|
61
79
|
}) | undefined;
|
|
62
80
|
export {};
|
|
@@ -1,8 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { IColumn, IRecord, IRowKey, ISuperFilter } from '../../../table/src/table/types';
|
|
3
|
+
import type { ComponentSize } from '../../../_utils/types';
|
|
4
|
+
import type { GroupItem, SorterItem } from './Context';
|
|
2
5
|
export type PivotGridRef = {};
|
|
3
6
|
export type PivotGridProps = {
|
|
7
|
+
fromTable?: boolean;
|
|
4
8
|
columns?: IColumn[];
|
|
5
|
-
tableColumns?: IColumn[];
|
|
6
9
|
dataSource?: IRecord[];
|
|
7
|
-
|
|
10
|
+
rowKey: ((row: IRecord, index: number) => IRowKey) | IRowKey;
|
|
11
|
+
uniqueKey?: string;
|
|
12
|
+
size?: ComponentSize;
|
|
13
|
+
height?: number;
|
|
14
|
+
maxHeight?: number;
|
|
15
|
+
className?: string;
|
|
16
|
+
style?: React.CSSProperties;
|
|
17
|
+
onChange?: (group: GroupItem[], filter: ISuperFilter[], sorter: SorterItem[], extra: {
|
|
18
|
+
currentDataSource: IRecord[];
|
|
19
|
+
}) => void;
|
|
20
|
+
onColumnsChange?: (columns: IColumn[]) => void;
|
|
21
|
+
onGroupChange?: (group: GroupItem[]) => void;
|
|
22
|
+
onFilterChange?: (filter: ISuperFilter[]) => void;
|
|
23
|
+
onSorterChange?: (sorter: SorterItem[]) => void;
|
|
8
24
|
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { IRecord, IOrderBy, IColumn, IRowKey } from '../../../table/src/table/types';
|
|
2
2
|
export declare const createGridColumns: (columns: IColumn[]) => IColumn[];
|
|
3
3
|
export declare const filterGridColumns: (columns: IColumn[]) => IColumn[];
|
|
4
|
+
export declare const isTreeGrid: (rows: IRecord[]) => boolean;
|
|
4
5
|
export declare const isGroupRecord: (row: IRecord) => boolean;
|
|
5
6
|
export declare const getValByPath: (obj: any, path: string) => any;
|
|
7
|
+
export declare const getDepth: (data: Record<string, any> | Record<string, any>[]) => number;
|
|
6
8
|
export declare const getStickyLeft: (flattenColumns: IColumn[], fieldName: string) => number;
|
|
7
|
-
export declare const groupMultiData: (records: IRecord[], groupKeys: Record<string, IOrderBy>[] | undefined, fn: (row: IRecord, key: string) => string | number) => Record<string, any> | Record<string, any>[];
|
|
8
9
|
export declare const getAllExpandKeys: (data: Record<string, any> | Record<string, any>[], parentKey?: string) => string[];
|
|
10
|
+
export declare const groupMultiData: (records: IRecord[], groupKeys: Record<string, IOrderBy>[] | undefined, fn: (row: IRecord, key: string) => string | number) => Record<string, any> | Record<string, any>[];
|
|
9
11
|
export type Subtotal = {
|
|
10
12
|
[key: string]: number;
|
|
11
13
|
};
|
|
@@ -16,11 +18,6 @@ export type Summary = {
|
|
|
16
18
|
[key: string]: GroupSummary | Subtotal;
|
|
17
19
|
};
|
|
18
20
|
export type FieldCalculations = Record<string, (dataList: number[]) => number>;
|
|
19
|
-
/**
|
|
20
|
-
* 递归计算分组数据
|
|
21
|
-
* @param {Object} group - 当前分组数据
|
|
22
|
-
* @returns {Object} - 计算后的结果
|
|
23
|
-
*/
|
|
24
21
|
export declare const calculateSummary: (groupData: Record<string, any> | Record<string, any>[], fieldCalculations: Record<string, (data: number[]) => number>) => Summary;
|
|
25
22
|
export declare const calculations: {
|
|
26
23
|
sum: (arr: number[]) => string;
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
* @Author: 焦质晔
|
|
3
3
|
* @Date: 2022-03-16 19:05:30
|
|
4
4
|
* @Last Modified by: 焦质晔
|
|
5
|
-
* @Last Modified time: 2024-12-
|
|
5
|
+
* @Last Modified time: 2024-12-25 11:07:14
|
|
6
6
|
*/
|
|
7
7
|
@import '../../style/common';
|
|
8
8
|
|
|
9
9
|
.@{prefix-pivot-grid}__layout {
|
|
10
10
|
.reset-container();
|
|
11
|
+
width: 100%;
|
|
11
12
|
display: flex;
|
|
12
13
|
flex-wrap: nowrap;
|
|
13
|
-
height: 100%;
|
|
14
14
|
.header,
|
|
15
15
|
.footer {
|
|
16
16
|
display: flex;
|
|
@@ -1,43 +1,33 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: 焦质晔
|
|
3
|
-
* @Date: 2022-03-16 19:05:30
|
|
4
|
-
* @Last Modified by: 焦质晔
|
|
5
|
-
* @Last Modified time: 2024-
|
|
6
|
-
*/
|
|
7
|
-
@import '../../style/common';
|
|
8
|
-
|
|
9
|
-
.@{prefix-pivot-grid}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
height: 1.25em;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
.wrapper {
|
|
38
|
-
flex: auto;
|
|
39
|
-
height: 0;
|
|
40
|
-
padding: @--padding-md;
|
|
41
|
-
background-color: @--background-color-light;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
* @Author: 焦质晔
|
|
3
|
+
* @Date: 2022-03-16 19:05:30
|
|
4
|
+
* @Last Modified by: 焦质晔
|
|
5
|
+
* @Last Modified time: 2024-12-25 14:25:58
|
|
6
|
+
*/
|
|
7
|
+
@import '../../style/common';
|
|
8
|
+
|
|
9
|
+
.@{prefix-pivot-grid} {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
&.is-from-table {
|
|
13
|
+
height: 100%;
|
|
14
|
+
}
|
|
15
|
+
&:not(.is-from-table) {
|
|
16
|
+
border: 1px solid @--border-color-secondary;
|
|
17
|
+
border-radius: @--border-radius-lg;
|
|
18
|
+
}
|
|
19
|
+
.top-bar {
|
|
20
|
+
display: flex;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
padding: @--padding-sm;
|
|
23
|
+
border-bottom: 1px solid @--border-color-secondary;
|
|
24
|
+
}
|
|
25
|
+
.wrapper {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex: auto;
|
|
28
|
+
// height: 0;
|
|
29
|
+
min-height: 0;
|
|
30
|
+
padding: @--padding-md;
|
|
31
|
+
background-color: @--background-color-light;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: 焦质晔
|
|
3
3
|
* @Date: 2022-03-16 19:05:30
|
|
4
4
|
* @Last Modified by: 焦质晔
|
|
5
|
-
* @Last Modified time: 2024-12-
|
|
5
|
+
* @Last Modified time: 2024-12-25 18:46:15
|
|
6
6
|
*/
|
|
7
7
|
@import '../../style/common';
|
|
8
8
|
|
|
@@ -28,6 +28,43 @@
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
.@{prefix-pivot-grid} {
|
|
32
|
+
.top-bar {
|
|
33
|
+
.alert-info {
|
|
34
|
+
background-color: rgba(0, 0, 0, 0.045);
|
|
35
|
+
border-radius: @--border-radius-base;
|
|
36
|
+
display: flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
margin-right: 4px;
|
|
39
|
+
padding: 5px @--padding-sm;
|
|
40
|
+
.icon {
|
|
41
|
+
margin-right: 5px;
|
|
42
|
+
color: @--primary-color;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
.action-btn {
|
|
46
|
+
display: inline-flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
padding: 5px 12px;
|
|
49
|
+
border-radius: @--border-radius-lg;
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
transition: all 0.3s ease;
|
|
52
|
+
&:hover,
|
|
53
|
+
&.active,
|
|
54
|
+
&.ant-dropdown-open {
|
|
55
|
+
background-color: @--background-color;
|
|
56
|
+
}
|
|
57
|
+
.icon {
|
|
58
|
+
margin-right: 6px;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
.ant-divider-vertical {
|
|
62
|
+
margin: 0;
|
|
63
|
+
height: 1.25em;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
31
68
|
.@{prefix-pivot-grid}__popper {
|
|
32
69
|
.container {
|
|
33
70
|
padding: 6px 15px;
|
|
@@ -80,8 +117,12 @@
|
|
|
80
117
|
li.sort-item {
|
|
81
118
|
display: flex;
|
|
82
119
|
align-items: center;
|
|
120
|
+
padding-right: 6px;
|
|
83
121
|
border-radius: @--border-radius-lg;
|
|
84
122
|
transition: none;
|
|
123
|
+
&.active {
|
|
124
|
+
background-color: @--background-color-light;
|
|
125
|
+
}
|
|
85
126
|
.handle {
|
|
86
127
|
padding: 5px 6px 5px 2px;
|
|
87
128
|
color: @--text-color-placeholder;
|
|
@@ -95,6 +136,9 @@
|
|
|
95
136
|
flex: 1 0;
|
|
96
137
|
}
|
|
97
138
|
}
|
|
139
|
+
.button-icon:hover {
|
|
140
|
+
background-color: #ddd;
|
|
141
|
+
}
|
|
98
142
|
}
|
|
99
143
|
li.divider {
|
|
100
144
|
padding: 6px;
|