@jiaozhiye/qm-design-react 1.11.5 → 1.11.7
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/index.esm.js +1 -1
- package/lib/index.full.js +1 -1
- package/lib/index.js +1 -1
- package/lib/pivot-grid/src/grid-layout/Context.d.ts +2 -0
- package/lib/pivot-grid/src/hooks/use-context-menu.d.ts +11 -0
- package/lib/pivot-grid/src/main/Context.d.ts +12 -2
- package/lib/pivot-grid/src/main/index.d.ts +2 -1
- package/lib/pivot-grid/src/top-bar/exportPanel.d.ts +3 -0
- package/lib/pivot-grid/src/utils/index.d.ts +3 -1
- package/lib/pivot-grid/style/grid-layout.less +18 -1
- package/lib/pivot-grid/style/top-bar.less +145 -136
- package/lib/style/index.css +28 -2
- package/lib/style/index.min.css +1 -1
- package/lib/table/src/context/index.d.ts +1 -1
- package/lib/table/src/hooks/useImperativeMethod.d.ts +1 -1
- package/lib/table/src/hooks/useTableCore.d.ts +1 -2
- package/lib/table/src/hooks/useTableRef.d.ts +2 -2
- package/lib/table/src/table/props.d.ts +1 -0
- package/lib/table/src/table/types.d.ts +1 -1
- package/lib/table/src/utils/index.d.ts +2 -0
- package/lib/virtual-list/src/core.d.ts +1 -1
- package/package.json +139 -139
|
@@ -6,6 +6,7 @@ export type IGridLayoutContext = {
|
|
|
6
6
|
scrollbarRef: React.RefObject<ScrollbarRef>;
|
|
7
7
|
indentDepth: number;
|
|
8
8
|
selectionKeys: IRowKey[];
|
|
9
|
+
treeExpandKeys: IRowKey[];
|
|
9
10
|
countMethod: Record<string, string>;
|
|
10
11
|
summationData: Summary;
|
|
11
12
|
};
|
|
@@ -17,6 +18,7 @@ export declare const GridLayoutProvider: React.FC<IProps>;
|
|
|
17
18
|
export declare const useGridLayoutContext: () => (IGridLayoutContext & {
|
|
18
19
|
setContext: (data: Partial<IGridLayoutContext>) => void;
|
|
19
20
|
setSelectionKeys: (rowKeys: IRowKey[]) => void;
|
|
21
|
+
setTreeExpandKeys: (rowKeys: IRowKey[]) => void;
|
|
20
22
|
setCountMethod: (value: Record<string, string | undefined>) => void;
|
|
21
23
|
setSummationData: (value: Summary) => void;
|
|
22
24
|
}) | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type UseContextMenuProps = {
|
|
3
|
+
ref: React.RefObject<HTMLElement>;
|
|
4
|
+
popup: (ev: MouseEvent) => React.ReactNode;
|
|
5
|
+
enabled?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare const useContextMenu: ({ ref, popup, enabled }: UseContextMenuProps) => {
|
|
8
|
+
contextMenu: React.JSX.Element;
|
|
9
|
+
closeMenu: () => void;
|
|
10
|
+
};
|
|
11
|
+
export default useContextMenu;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { IColumn, IOrderBy, IRecord, IRowKey, ISuperFilter } from '../../../table/src/table/types';
|
|
3
|
-
import type { ComponentSize } from '../../../_utils/types';
|
|
3
|
+
import type { ComponentSize, ValueOf } from '../../../_utils/types';
|
|
4
|
+
import type { IGridLayoutContext } from '../grid-layout/Context';
|
|
4
5
|
export type IPivotMode = 'table' | 'gantt' | 'card' | 'chart';
|
|
5
6
|
export type GroupItem = {
|
|
6
7
|
fieldName: string;
|
|
@@ -15,13 +16,20 @@ export type SearchResult = {
|
|
|
15
16
|
rowKey: IRowKey;
|
|
16
17
|
dataIndex: string;
|
|
17
18
|
};
|
|
19
|
+
export type PivotRef = {
|
|
20
|
+
originGridData: IRecord[];
|
|
21
|
+
flatGroupData: IRecord[];
|
|
22
|
+
keyRecordMap: Map<IRowKey, IRecord>;
|
|
23
|
+
isTree: boolean;
|
|
24
|
+
gridLayoutContext: Partial<IGridLayoutContext>;
|
|
25
|
+
};
|
|
18
26
|
export type IPivotGridContext = {
|
|
27
|
+
pivotRef: React.MutableRefObject<PivotRef>;
|
|
19
28
|
prefixCls: string;
|
|
20
29
|
viewMode: IPivotMode;
|
|
21
30
|
size: ComponentSize;
|
|
22
31
|
columns: IColumn[];
|
|
23
32
|
gridData: IRecord[];
|
|
24
|
-
originGridData: IRecord[];
|
|
25
33
|
groupGridData: Record<string, any> | Record<string, any>[];
|
|
26
34
|
groupList: GroupItem[];
|
|
27
35
|
filterList: ISuperFilter[];
|
|
@@ -39,6 +47,8 @@ type IProps = {
|
|
|
39
47
|
export declare const PivotGridProvider: React.FC<IProps>;
|
|
40
48
|
export declare const usePivotGridContext: () => (IPivotGridContext & {
|
|
41
49
|
setContext: (data: Partial<IPivotGridContext>) => void;
|
|
50
|
+
getRowKey: (row: IRecord, index: number) => IRowKey;
|
|
51
|
+
setPivotGridRef: (key: string, value: ValueOf<PivotRef>) => void;
|
|
42
52
|
setColumns: (items: IColumn[]) => void;
|
|
43
53
|
setGridData: (items: IRecord[]) => void;
|
|
44
54
|
setGroupGridData: (data: Record<string, any> | Record<string, any>[]) => void;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { IRecord, IOrderBy, IColumn } from '../../../table/src/table/types';
|
|
2
2
|
export declare const createGridColumns: (columns: IColumn[]) => IColumn[];
|
|
3
|
+
export declare const filterGridColumns: (columns: IColumn[]) => IColumn[];
|
|
3
4
|
export declare const getStickyLeft: (flattenColumns: IColumn[], fieldName: string) => number;
|
|
4
|
-
export declare const groupMultiData: (records: IRecord[], groupKeys: Record<string, IOrderBy>[] | undefined, fn: (row: IRecord, key: string) => string | number) => any;
|
|
5
|
+
export declare const groupMultiData: (records: IRecord[], groupKeys: Record<string, IOrderBy>[] | undefined, isTree: boolean, fn: (row: IRecord, key: string) => string | number) => Record<string, any> | Record<string, any>[];
|
|
5
6
|
export declare const getAllKeys: (data: Record<string, any> | Record<string, any>[], parentKey?: string) => string[];
|
|
6
7
|
export type Subtotal = {
|
|
7
8
|
[key: string]: number;
|
|
@@ -29,3 +30,4 @@ export declare const calculations: {
|
|
|
29
30
|
empty: (arr: number[]) => number;
|
|
30
31
|
notEmpty: (arr: number[]) => number;
|
|
31
32
|
};
|
|
33
|
+
export declare const flattenGroupedData: (groupData: Record<string, any> | Record<string, any>[]) => IRecord[];
|
|
@@ -2,12 +2,14 @@
|
|
|
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-11 17:28:36
|
|
6
6
|
*/
|
|
7
7
|
@import '../../style/common';
|
|
8
8
|
|
|
9
9
|
.@{prefix-pivot-grid}__layout {
|
|
10
10
|
.reset-container();
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-wrap: nowrap;
|
|
11
13
|
height: 100%;
|
|
12
14
|
.header,
|
|
13
15
|
.footer {
|
|
@@ -33,6 +35,9 @@
|
|
|
33
35
|
position: sticky;
|
|
34
36
|
top: 0;
|
|
35
37
|
z-index: 2;
|
|
38
|
+
.table-cell {
|
|
39
|
+
background-color: #d6f2ff !important;
|
|
40
|
+
}
|
|
36
41
|
.resize-bar {
|
|
37
42
|
position: absolute;
|
|
38
43
|
top: 0;
|
|
@@ -127,6 +132,18 @@
|
|
|
127
132
|
border-bottom: 1px solid @--border-color-secondary;
|
|
128
133
|
&.active {
|
|
129
134
|
box-shadow: inset 0 0 0 2px @--primary-color;
|
|
135
|
+
background-color: rgba(255, 235, 140, 1);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
.cell--expand {
|
|
139
|
+
display: inline-flex;
|
|
140
|
+
padding: 4px;
|
|
141
|
+
font-size: 13px;
|
|
142
|
+
color: @--text-color-placeholder;
|
|
143
|
+
cursor: pointer;
|
|
144
|
+
transition: transform 0.3s ease;
|
|
145
|
+
&.fold {
|
|
146
|
+
transform: rotate(-90deg);
|
|
130
147
|
}
|
|
131
148
|
}
|
|
132
149
|
}
|
|
@@ -1,136 +1,145 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: 焦质晔
|
|
3
|
-
* @Date: 2022-03-16 19:05:30
|
|
4
|
-
* @Last Modified by: 焦质晔
|
|
5
|
-
* @Last Modified time: 2024-12-
|
|
6
|
-
*/
|
|
7
|
-
@import '../../style/common';
|
|
8
|
-
|
|
9
|
-
.button-icon {
|
|
10
|
-
display: inline-flex;
|
|
11
|
-
text-align: center;
|
|
12
|
-
text-transform: none;
|
|
13
|
-
text-decoration: none;
|
|
14
|
-
background: transparent;
|
|
15
|
-
border: 0;
|
|
16
|
-
outline: 0;
|
|
17
|
-
line-height: 1;
|
|
18
|
-
padding: 5px;
|
|
19
|
-
color: @--text-color-placeholder;
|
|
20
|
-
border-radius: @--border-radius-lg;
|
|
21
|
-
transition: background-color 0.3s ease;
|
|
22
|
-
cursor: pointer;
|
|
23
|
-
&:not(.no-hover-bg):hover {
|
|
24
|
-
background-color: @--background-color;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
* @Author: 焦质晔
|
|
3
|
+
* @Date: 2022-03-16 19:05:30
|
|
4
|
+
* @Last Modified by: 焦质晔
|
|
5
|
+
* @Last Modified time: 2024-12-13 14:07:07
|
|
6
|
+
*/
|
|
7
|
+
@import '../../style/common';
|
|
8
|
+
|
|
9
|
+
.button-icon {
|
|
10
|
+
display: inline-flex;
|
|
11
|
+
text-align: center;
|
|
12
|
+
text-transform: none;
|
|
13
|
+
text-decoration: none;
|
|
14
|
+
background: transparent;
|
|
15
|
+
border: 0;
|
|
16
|
+
outline: 0;
|
|
17
|
+
line-height: 1;
|
|
18
|
+
padding: 5px;
|
|
19
|
+
color: @--text-color-placeholder;
|
|
20
|
+
border-radius: @--border-radius-lg;
|
|
21
|
+
transition: background-color 0.3s ease;
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
&:not(.no-hover-bg):hover {
|
|
24
|
+
background-color: @--background-color;
|
|
25
|
+
}
|
|
26
|
+
&.disabled {
|
|
27
|
+
cursor: not-allowed;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.@{prefix-pivot-grid}__popper {
|
|
32
|
+
.container {
|
|
33
|
+
padding: 6px 15px;
|
|
34
|
+
&.scroll-y {
|
|
35
|
+
overflow-y: auto;
|
|
36
|
+
max-height: calc(100vh - 10px);
|
|
37
|
+
}
|
|
38
|
+
& > .label {
|
|
39
|
+
display: flex;
|
|
40
|
+
justify-content: space-between;
|
|
41
|
+
align-items: center;
|
|
42
|
+
padding: 4px 0;
|
|
43
|
+
}
|
|
44
|
+
& > .list {
|
|
45
|
+
li.item {
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
margin: 6px 0;
|
|
49
|
+
.icon {
|
|
50
|
+
padding: 6px 2px;
|
|
51
|
+
color: @--text-color-placeholder;
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
}
|
|
54
|
+
.close {
|
|
55
|
+
margin-left: @--margin-sm;
|
|
56
|
+
font-size: @--font-size-lg;
|
|
57
|
+
padding: @--padding-sm;
|
|
58
|
+
border-radius: @--border-radius-lg;
|
|
59
|
+
transition: all 0.3s ease;
|
|
60
|
+
&:hover {
|
|
61
|
+
background-color: @--background-color;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
li.check-item {
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
justify-content: space-between;
|
|
69
|
+
border-radius: @--border-radius-lg;
|
|
70
|
+
&.active {
|
|
71
|
+
.icon {
|
|
72
|
+
display: block;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
.icon {
|
|
76
|
+
color: @--primary-color;
|
|
77
|
+
display: none;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
li.sort-item {
|
|
81
|
+
display: flex;
|
|
82
|
+
align-items: center;
|
|
83
|
+
border-radius: @--border-radius-lg;
|
|
84
|
+
transition: none;
|
|
85
|
+
.handle {
|
|
86
|
+
padding: 5px 6px 5px 2px;
|
|
87
|
+
color: @--text-color-placeholder;
|
|
88
|
+
cursor: s-resize;
|
|
89
|
+
}
|
|
90
|
+
.label {
|
|
91
|
+
flex: 1 0;
|
|
92
|
+
display: inline-flex;
|
|
93
|
+
align-items: center;
|
|
94
|
+
.title {
|
|
95
|
+
flex: 1 0;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
li.divider {
|
|
100
|
+
padding: 6px;
|
|
101
|
+
&::after {
|
|
102
|
+
content: '';
|
|
103
|
+
display: block;
|
|
104
|
+
border-top: 1px solid @--border-color-secondary;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
& > .add-record {
|
|
109
|
+
display: flex;
|
|
110
|
+
justify-content: space-between;
|
|
111
|
+
align-items: center;
|
|
112
|
+
padding: @--margin-md 0 4px;
|
|
113
|
+
.insert {
|
|
114
|
+
color: @--primary-4;
|
|
115
|
+
cursor: pointer;
|
|
116
|
+
.icon {
|
|
117
|
+
margin-right: 4px;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
& > .search {
|
|
122
|
+
.search-switch {
|
|
123
|
+
display: inline-flex;
|
|
124
|
+
align-items: center;
|
|
125
|
+
margin-right: -7px;
|
|
126
|
+
&.disabled {
|
|
127
|
+
.btn {
|
|
128
|
+
pointer-events: none;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
.num {
|
|
132
|
+
margin: 0 4px;
|
|
133
|
+
color: @--text-color-placeholder;
|
|
134
|
+
line-height: 1;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
.ant-dropdown-menu-root {
|
|
140
|
+
padding: 5px;
|
|
141
|
+
.ant-dropdown-menu-item {
|
|
142
|
+
border-radius: @--border-radius-lg;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
package/lib/style/index.css
CHANGED
|
@@ -31014,7 +31014,7 @@ body {
|
|
|
31014
31014
|
* @Author: 焦质晔
|
|
31015
31015
|
* @Date: 2022-03-16 19:05:30
|
|
31016
31016
|
* @Last Modified by: 焦质晔
|
|
31017
|
-
* @Last Modified time: 2024-12-
|
|
31017
|
+
* @Last Modified time: 2024-12-13 14:07:07
|
|
31018
31018
|
*/
|
|
31019
31019
|
.button-icon {
|
|
31020
31020
|
display: inline-flex;
|
|
@@ -31034,6 +31034,9 @@ body {
|
|
|
31034
31034
|
.button-icon:not(.no-hover-bg):hover {
|
|
31035
31035
|
background-color: #f2f2f2;
|
|
31036
31036
|
}
|
|
31037
|
+
.button-icon.disabled {
|
|
31038
|
+
cursor: not-allowed;
|
|
31039
|
+
}
|
|
31037
31040
|
.qm-pivot-grid__popper .container {
|
|
31038
31041
|
padding: 6px 15px;
|
|
31039
31042
|
}
|
|
@@ -31133,11 +31136,17 @@ body {
|
|
|
31133
31136
|
color: rgba(0, 0, 0, 0.45);
|
|
31134
31137
|
line-height: 1;
|
|
31135
31138
|
}
|
|
31139
|
+
.qm-pivot-grid__popper .ant-dropdown-menu-root {
|
|
31140
|
+
padding: 5px;
|
|
31141
|
+
}
|
|
31142
|
+
.qm-pivot-grid__popper .ant-dropdown-menu-root .ant-dropdown-menu-item {
|
|
31143
|
+
border-radius: 4px;
|
|
31144
|
+
}
|
|
31136
31145
|
/*
|
|
31137
31146
|
* @Author: 焦质晔
|
|
31138
31147
|
* @Date: 2022-03-16 19:05:30
|
|
31139
31148
|
* @Last Modified by: 焦质晔
|
|
31140
|
-
* @Last Modified time: 2024-12-
|
|
31149
|
+
* @Last Modified time: 2024-12-11 17:28:36
|
|
31141
31150
|
*/
|
|
31142
31151
|
.qm-pivot-grid__layout {
|
|
31143
31152
|
box-sizing: border-box;
|
|
@@ -31148,6 +31157,8 @@ body {
|
|
|
31148
31157
|
line-height: 1.5715;
|
|
31149
31158
|
list-style: none;
|
|
31150
31159
|
font-feature-settings: 'tnum';
|
|
31160
|
+
display: flex;
|
|
31161
|
+
flex-wrap: nowrap;
|
|
31151
31162
|
height: 100%;
|
|
31152
31163
|
}
|
|
31153
31164
|
.qm-pivot-grid__layout .header,
|
|
@@ -31181,6 +31192,9 @@ body {
|
|
|
31181
31192
|
top: 0;
|
|
31182
31193
|
z-index: 2;
|
|
31183
31194
|
}
|
|
31195
|
+
.qm-pivot-grid__layout .header .table-cell {
|
|
31196
|
+
background-color: #d6f2ff !important;
|
|
31197
|
+
}
|
|
31184
31198
|
.qm-pivot-grid__layout .header .resize-bar {
|
|
31185
31199
|
position: absolute;
|
|
31186
31200
|
top: 0;
|
|
@@ -31273,6 +31287,18 @@ body {
|
|
|
31273
31287
|
}
|
|
31274
31288
|
.qm-pivot-grid__layout .body .grid-list .table-row .table-cell.active {
|
|
31275
31289
|
box-shadow: inset 0 0 0 2px #1890ff;
|
|
31290
|
+
background-color: #ffeb8c;
|
|
31291
|
+
}
|
|
31292
|
+
.qm-pivot-grid__layout .body .grid-list .table-row .cell--expand {
|
|
31293
|
+
display: inline-flex;
|
|
31294
|
+
padding: 4px;
|
|
31295
|
+
font-size: 13px;
|
|
31296
|
+
color: rgba(0, 0, 0, 0.45);
|
|
31297
|
+
cursor: pointer;
|
|
31298
|
+
transition: transform 0.3s ease;
|
|
31299
|
+
}
|
|
31300
|
+
.qm-pivot-grid__layout .body .grid-list .table-row .cell--expand.fold {
|
|
31301
|
+
transform: rotate(-90deg);
|
|
31276
31302
|
}
|
|
31277
31303
|
.qm-pivot-grid__layout .footer {
|
|
31278
31304
|
position: sticky;
|