dcp-design-react 1.11.4 → 1.11.6
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/hooks/use-context-menu.d.ts +11 -0
- package/lib/pivot-grid/src/main/Context.d.ts +16 -2
- package/lib/pivot-grid/src/utils/index.d.ts +1 -0
- package/lib/pivot-grid/style/grid-layout.less +10 -1
- package/lib/pivot-grid/style/top-bar.less +139 -136
- package/lib/style/index.css +13 -1
- 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/table/props.d.ts +0 -1
- package/lib/table/src/table/types.d.ts +0 -1
- package/package.json +1 -1
|
@@ -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,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { IColumn, IOrderBy, IRecord, ISuperFilter } from '../../../table/src/table/types';
|
|
2
|
+
import type { IColumn, IOrderBy, IRecord, IRowKey, ISuperFilter } from '../../../table/src/table/types';
|
|
3
3
|
import type { ComponentSize } from '../../../_utils/types';
|
|
4
4
|
export type IPivotMode = 'table' | 'gantt' | 'card' | 'chart';
|
|
5
5
|
export type GroupItem = {
|
|
@@ -10,18 +10,29 @@ export type SorterItem = {
|
|
|
10
10
|
fieldName: string;
|
|
11
11
|
order: IOrderBy;
|
|
12
12
|
};
|
|
13
|
+
export type SearchResult = {
|
|
14
|
+
value: string;
|
|
15
|
+
rowKey: IRowKey;
|
|
16
|
+
dataIndex: string;
|
|
17
|
+
};
|
|
18
|
+
export type PivotRef = {
|
|
19
|
+
originGridData: IRecord[];
|
|
20
|
+
flatGroupData: IRecord[];
|
|
21
|
+
};
|
|
13
22
|
export type IPivotGridContext = {
|
|
23
|
+
pivotRef: React.MutableRefObject<PivotRef>;
|
|
14
24
|
prefixCls: string;
|
|
15
25
|
viewMode: IPivotMode;
|
|
16
26
|
size: ComponentSize;
|
|
17
27
|
columns: IColumn[];
|
|
18
28
|
gridData: IRecord[];
|
|
19
|
-
originGridData: IRecord[];
|
|
20
29
|
groupGridData: Record<string, any> | Record<string, any>[];
|
|
21
30
|
groupList: GroupItem[];
|
|
22
31
|
filterList: ISuperFilter[];
|
|
23
32
|
sorterList: SorterItem[];
|
|
24
33
|
expandedKeys: string[];
|
|
34
|
+
searchResults: SearchResult[];
|
|
35
|
+
switchIndex: number;
|
|
25
36
|
};
|
|
26
37
|
type IProps = {
|
|
27
38
|
prefixCls: string;
|
|
@@ -32,6 +43,7 @@ type IProps = {
|
|
|
32
43
|
export declare const PivotGridProvider: React.FC<IProps>;
|
|
33
44
|
export declare const usePivotGridContext: () => (IPivotGridContext & {
|
|
34
45
|
setContext: (data: Partial<IPivotGridContext>) => void;
|
|
46
|
+
setPivotGridRef: (value: Partial<PivotRef>) => void;
|
|
35
47
|
setColumns: (items: IColumn[]) => void;
|
|
36
48
|
setGridData: (items: IRecord[]) => void;
|
|
37
49
|
setGroupGridData: (data: Record<string, any> | Record<string, any>[]) => void;
|
|
@@ -39,5 +51,7 @@ export declare const usePivotGridContext: () => (IPivotGridContext & {
|
|
|
39
51
|
setFilterList: (items: ISuperFilter[]) => void;
|
|
40
52
|
setSorterList: (items: SorterItem[]) => void;
|
|
41
53
|
setExpandedKeys: (keys: string[]) => void;
|
|
54
|
+
setSearchResults: (value: SearchResult[]) => void;
|
|
55
|
+
setSwitchIndex: (value: number) => void;
|
|
42
56
|
}) | undefined;
|
|
43
57
|
export {};
|
|
@@ -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;
|
|
@@ -125,6 +130,10 @@
|
|
|
125
130
|
display: inline-flex;
|
|
126
131
|
align-items: center;
|
|
127
132
|
border-bottom: 1px solid @--border-color-secondary;
|
|
133
|
+
&.active {
|
|
134
|
+
box-shadow: inset 0 0 0 2px @--primary-color;
|
|
135
|
+
background-color: rgba(255, 235, 140, 1);
|
|
136
|
+
}
|
|
128
137
|
}
|
|
129
138
|
}
|
|
130
139
|
}
|
|
@@ -1,136 +1,139 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: 焦质晔
|
|
3
|
-
* @Date: 2022-03-16 19:05:30
|
|
4
|
-
* @Last Modified by: 焦质晔
|
|
5
|
-
* @Last Modified time: 2024-12-04 09:17:17
|
|
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-04 09:17:17
|
|
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
|
+
}
|
package/lib/style/index.css
CHANGED
|
@@ -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
|
}
|
|
@@ -31137,7 +31140,7 @@ body {
|
|
|
31137
31140
|
* @Author: 焦质晔
|
|
31138
31141
|
* @Date: 2022-03-16 19:05:30
|
|
31139
31142
|
* @Last Modified by: 焦质晔
|
|
31140
|
-
* @Last Modified time: 2024-12-
|
|
31143
|
+
* @Last Modified time: 2024-12-11 17:28:36
|
|
31141
31144
|
*/
|
|
31142
31145
|
.qm-pivot-grid__layout {
|
|
31143
31146
|
box-sizing: border-box;
|
|
@@ -31148,6 +31151,8 @@ body {
|
|
|
31148
31151
|
line-height: 1.5715;
|
|
31149
31152
|
list-style: none;
|
|
31150
31153
|
font-feature-settings: 'tnum';
|
|
31154
|
+
display: flex;
|
|
31155
|
+
flex-wrap: nowrap;
|
|
31151
31156
|
height: 100%;
|
|
31152
31157
|
}
|
|
31153
31158
|
.qm-pivot-grid__layout .header,
|
|
@@ -31181,6 +31186,9 @@ body {
|
|
|
31181
31186
|
top: 0;
|
|
31182
31187
|
z-index: 2;
|
|
31183
31188
|
}
|
|
31189
|
+
.qm-pivot-grid__layout .header .table-cell {
|
|
31190
|
+
background-color: #d6f2ff !important;
|
|
31191
|
+
}
|
|
31184
31192
|
.qm-pivot-grid__layout .header .resize-bar {
|
|
31185
31193
|
position: absolute;
|
|
31186
31194
|
top: 0;
|
|
@@ -31271,6 +31279,10 @@ body {
|
|
|
31271
31279
|
align-items: center;
|
|
31272
31280
|
border-bottom: 1px solid #e8e8e8;
|
|
31273
31281
|
}
|
|
31282
|
+
.qm-pivot-grid__layout .body .grid-list .table-row .table-cell.active {
|
|
31283
|
+
box-shadow: inset 0 0 0 2px #1890ff;
|
|
31284
|
+
background-color: #ffeb8c;
|
|
31285
|
+
}
|
|
31274
31286
|
.qm-pivot-grid__layout .footer {
|
|
31275
31287
|
position: sticky;
|
|
31276
31288
|
bottom: 0;
|