@jiaozhiye/qm-design-react 1.12.6 → 1.12.8
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/style/index.css +2 -2
- package/lib/style/index.min.css +1 -1
- package/lib/table/src/context/index.d.ts +1 -0
- package/lib/table/src/hooks/useImperativeMethod.d.ts +0 -1
- package/lib/table/src/hooks/useTableLayout.d.ts +1 -0
- package/lib/table/src/hooks/useTableMemo.d.ts +3 -0
- package/lib/table/src/hooks/useTableRef.d.ts +2 -5
- package/lib/table/src/utils/index.d.ts +1 -0
- package/lib/table/style/fast-search.less +151 -151
- package/package.json +1 -1
|
@@ -18,7 +18,6 @@ type IExtra = {
|
|
|
18
18
|
dataChange: () => void;
|
|
19
19
|
getTableData: () => Promise<void>;
|
|
20
20
|
createTableData: (records: IRecord[], fn?: (list: IRecord[]) => IRecord[]) => void;
|
|
21
|
-
createTableFullData: (records: IRecord[]) => void;
|
|
22
21
|
calcTableHeight: () => void;
|
|
23
22
|
scrollXToColumn: (dataIndex: string, index?: number) => void;
|
|
24
23
|
scrollYToRecord: (rowKey: IRowKey, index?: number) => void;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ITableProps, IColumn, IRowKey, IRecord, getRowKeyType, IFetchParams, ISorter, IFilter, IPagination, ISuperFilter, IMergedCell, IMergeCellItem } from '../table/types';
|
|
3
3
|
import type { ITableRef } from './useTableRef';
|
|
4
|
+
import type { ComponentSize } from '../../../_utils/types';
|
|
4
5
|
type IExtra = {
|
|
5
6
|
getRowKey: getRowKeyType;
|
|
6
7
|
tableRef: React.MutableRefObject<ITableRef>;
|
|
8
|
+
$size: ComponentSize;
|
|
7
9
|
tableFullData: IRecord[];
|
|
8
10
|
tableFlatData: IRecord[];
|
|
9
11
|
updateMark: number;
|
|
@@ -25,6 +27,7 @@ declare const useTableMemo: <T extends ITableProps>(props: T, extra: IExtra) =>
|
|
|
25
27
|
summationColumns: IColumn[];
|
|
26
28
|
leftFixedColumns: IColumn[];
|
|
27
29
|
rightFixedColumns: IColumn[];
|
|
30
|
+
tableRowHeight: number;
|
|
28
31
|
derivedMergeCells: IMergeCellItem[];
|
|
29
32
|
treeExpandIndex: string;
|
|
30
33
|
showSummary: boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import TableManager from '../manager';
|
|
3
3
|
import Store from '../store';
|
|
4
|
+
import type { Nullable } from '../../../_utils/types';
|
|
4
5
|
import type { ScrollbarRef } from '../../../scrollbar/src/scrollbar';
|
|
5
6
|
import type { getRowKeyType, IColumn, IFieldAuthItem, InsertMode, IRecord, IRowKey, ITableProps } from '../table/types';
|
|
6
|
-
import type { ComponentSize, Nullable } from '../../../_utils/types';
|
|
7
7
|
export type ITableRef = {
|
|
8
8
|
props: ITableProps;
|
|
9
9
|
uid: string;
|
|
@@ -16,7 +16,6 @@ export type ITableRef = {
|
|
|
16
16
|
fieldAuth: Record<string, IFieldAuthItem>;
|
|
17
17
|
columnsDefined: boolean;
|
|
18
18
|
scrollBarRef: React.RefObject<ScrollbarRef>;
|
|
19
|
-
rowHeight: number;
|
|
20
19
|
store: Store;
|
|
21
20
|
resizeState: {
|
|
22
21
|
width: number;
|
|
@@ -39,9 +38,8 @@ export type ITableRef = {
|
|
|
39
38
|
};
|
|
40
39
|
type IExtra = {
|
|
41
40
|
getRowKey: getRowKeyType;
|
|
42
|
-
$size: ComponentSize;
|
|
43
41
|
};
|
|
44
|
-
declare const useTableRef: <T extends ITableProps>(props: T, { getRowKey
|
|
42
|
+
declare const useTableRef: <T extends ITableProps>(props: T, { getRowKey }: IExtra) => {
|
|
45
43
|
setElementStore: (key: string, value: HTMLElement) => void;
|
|
46
44
|
setOriginColumns: (columns: IColumn[]) => void;
|
|
47
45
|
setTableFullData: (records: IRecord[]) => void;
|
|
@@ -69,7 +67,6 @@ declare const useTableRef: <T extends ITableProps>(props: T, { getRowKey, $size
|
|
|
69
67
|
fieldAuth: Record<string, IFieldAuthItem>;
|
|
70
68
|
columnsDefined: boolean;
|
|
71
69
|
scrollBarRef: React.RefObject<ScrollbarRef>;
|
|
72
|
-
rowHeight: number;
|
|
73
70
|
store: Store;
|
|
74
71
|
resizeState: {
|
|
75
72
|
width: number;
|
|
@@ -4,6 +4,7 @@ import type { IColumn, IDerivedRowKeys, IMergeCellItem, IRecord, IRowKey, ISorte
|
|
|
4
4
|
import type { Nullable, AnyObject } from '../../../_utils/types';
|
|
5
5
|
export declare const columnsFlatMap: (columns: IColumn[]) => IColumn[];
|
|
6
6
|
export declare const createFilterColumns: (columns: IColumn[]) => IColumn[];
|
|
7
|
+
export declare const createShadowColumns: (columns: IColumn[]) => IColumn[];
|
|
7
8
|
export declare const getAllColumns: (columns: IColumn[]) => IColumn[];
|
|
8
9
|
export declare const mapTableColumns: (columns: IColumn[], callback?: ((column: IColumn) => void) | undefined) => IColumn[];
|
|
9
10
|
export declare const deepFindColumn: (columns: IColumn[], mark: string) => Nullable<IColumn>;
|
|
@@ -1,151 +1,151 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: 焦质晔
|
|
3
|
-
* @Date: 2022-03-16 19:05:30
|
|
4
|
-
* @Last Modified by: 焦质晔
|
|
5
|
-
* @Last Modified time: 2022-11-26 21:11:04
|
|
6
|
-
*/
|
|
7
|
-
.@{prefix-table}-fast-search {
|
|
8
|
-
display: inline-block;
|
|
9
|
-
padding: 5px 3px;
|
|
10
|
-
line-height: 1;
|
|
11
|
-
cursor: pointer;
|
|
12
|
-
transition: all 0.3s ease;
|
|
13
|
-
.icon {
|
|
14
|
-
font-size: 1.05em;
|
|
15
|
-
}
|
|
16
|
-
&:hover {
|
|
17
|
-
color: @v-primary-color;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.@{prefix-table}-fast-search__setting {
|
|
22
|
-
height: 100%;
|
|
23
|
-
.main {
|
|
24
|
-
display: flex;
|
|
25
|
-
flex-direction: row;
|
|
26
|
-
height: 100%;
|
|
27
|
-
.container {
|
|
28
|
-
flex: 1;
|
|
29
|
-
min-width: 0;
|
|
30
|
-
display: flex;
|
|
31
|
-
flex-direction: column;
|
|
32
|
-
.search-box {
|
|
33
|
-
display: flex;
|
|
34
|
-
align-items: center;
|
|
35
|
-
.label {
|
|
36
|
-
width: 75px;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
.condition {
|
|
40
|
-
padding-left: 75px;
|
|
41
|
-
margin-top: @v-module-distance;
|
|
42
|
-
margin-bottom: @v-module-distance;
|
|
43
|
-
}
|
|
44
|
-
.all-list {
|
|
45
|
-
flex: 1 0;
|
|
46
|
-
min-height: 0;
|
|
47
|
-
overflow-y: auto;
|
|
48
|
-
.rtable {
|
|
49
|
-
width: 100%;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
background-color: @v-table-header-background-color;
|
|
56
|
-
height: 30px;
|
|
57
|
-
text-align: center;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
tbody {
|
|
61
|
-
tr {
|
|
62
|
-
&.active {
|
|
63
|
-
td {
|
|
64
|
-
background-color: @--primary-1;
|
|
65
|
-
color: @v-primary-color;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
&:hover {
|
|
69
|
-
td {
|
|
70
|
-
text-decoration: underline;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
td {
|
|
74
|
-
height: 30px;
|
|
75
|
-
text-align: center;
|
|
76
|
-
border-
|
|
77
|
-
cursor: pointer;
|
|
78
|
-
.text-overflow-cut();
|
|
79
|
-
max-width: 0;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
.saved {
|
|
87
|
-
width: 240px;
|
|
88
|
-
.form-wrap {
|
|
89
|
-
display: flex;
|
|
90
|
-
}
|
|
91
|
-
.card-wrap {
|
|
92
|
-
margin-top: @v-module-distance;
|
|
93
|
-
border: 1px solid @v-table-border-color;
|
|
94
|
-
> h5 {
|
|
95
|
-
display: flex;
|
|
96
|
-
align-items: center;
|
|
97
|
-
font-size: inherit;
|
|
98
|
-
font-weight: normal;
|
|
99
|
-
margin-bottom: 0;
|
|
100
|
-
padding: 0 @v-module-distance;
|
|
101
|
-
border-bottom: 1px solid @v-table-border-color;
|
|
102
|
-
background-color: @v-table-header-background-color;
|
|
103
|
-
}
|
|
104
|
-
> ul {
|
|
105
|
-
margin-bottom: 0;
|
|
106
|
-
li {
|
|
107
|
-
display: flex;
|
|
108
|
-
align-items: center;
|
|
109
|
-
position: relative;
|
|
110
|
-
padding: 6px @v-module-distance;
|
|
111
|
-
border-bottom: 1px solid @v-table-border-color;
|
|
112
|
-
cursor: pointer;
|
|
113
|
-
transition: all 0.3s ease;
|
|
114
|
-
&:last-of-type {
|
|
115
|
-
border-bottom: 0;
|
|
116
|
-
}
|
|
117
|
-
&:hover {
|
|
118
|
-
background-color: @v-table-row-hover-background-color;
|
|
119
|
-
.close {
|
|
120
|
-
visibility: visible;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
&.selected {
|
|
124
|
-
background-color: @v-table-row-selected-background-color;
|
|
125
|
-
}
|
|
126
|
-
.title {
|
|
127
|
-
i {
|
|
128
|
-
margin-right: 5px;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
.close {
|
|
132
|
-
position: absolute;
|
|
133
|
-
right: @v-module-distance;
|
|
134
|
-
visibility: hidden;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
.line {
|
|
141
|
-
border-left: 1px dashed @--border-color-base;
|
|
142
|
-
padding-left: @v-module-distance;
|
|
143
|
-
margin-left: @v-module-distance;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
.bottom-bar {
|
|
147
|
-
display: flex;
|
|
148
|
-
justify-content: space-between;
|
|
149
|
-
align-items: center;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
* @Author: 焦质晔
|
|
3
|
+
* @Date: 2022-03-16 19:05:30
|
|
4
|
+
* @Last Modified by: 焦质晔
|
|
5
|
+
* @Last Modified time: 2022-11-26 21:11:04
|
|
6
|
+
*/
|
|
7
|
+
.@{prefix-table}-fast-search {
|
|
8
|
+
display: inline-block;
|
|
9
|
+
padding: 5px 3px;
|
|
10
|
+
line-height: 1;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
transition: all 0.3s ease;
|
|
13
|
+
.icon {
|
|
14
|
+
font-size: 1.05em;
|
|
15
|
+
}
|
|
16
|
+
&:hover {
|
|
17
|
+
color: @v-primary-color;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.@{prefix-table}-fast-search__setting {
|
|
22
|
+
height: 100%;
|
|
23
|
+
.main {
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: row;
|
|
26
|
+
height: 100%;
|
|
27
|
+
.container {
|
|
28
|
+
flex: 1;
|
|
29
|
+
min-width: 0;
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
.search-box {
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
.label {
|
|
36
|
+
width: 75px;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
.condition {
|
|
40
|
+
padding-left: 75px;
|
|
41
|
+
margin-top: @v-module-distance;
|
|
42
|
+
margin-bottom: @v-module-distance;
|
|
43
|
+
}
|
|
44
|
+
.all-list {
|
|
45
|
+
flex: 1 0;
|
|
46
|
+
min-height: 0;
|
|
47
|
+
overflow-y: auto;
|
|
48
|
+
.rtable {
|
|
49
|
+
width: 100%;
|
|
50
|
+
thead {
|
|
51
|
+
position: sticky;
|
|
52
|
+
top: 0;
|
|
53
|
+
th {
|
|
54
|
+
border-bottom: 1px solid @v-table-border-color;
|
|
55
|
+
background-color: @v-table-header-background-color;
|
|
56
|
+
height: 30px;
|
|
57
|
+
text-align: center;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
tbody {
|
|
61
|
+
tr {
|
|
62
|
+
&.active {
|
|
63
|
+
td {
|
|
64
|
+
background-color: @--primary-1;
|
|
65
|
+
color: @v-primary-color;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
&:hover {
|
|
69
|
+
td {
|
|
70
|
+
text-decoration: underline;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
td {
|
|
74
|
+
height: 30px;
|
|
75
|
+
text-align: center;
|
|
76
|
+
border-bottom: 1px solid @v-table-border-color;
|
|
77
|
+
cursor: pointer;
|
|
78
|
+
.text-overflow-cut();
|
|
79
|
+
max-width: 0;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
.saved {
|
|
87
|
+
width: 240px;
|
|
88
|
+
.form-wrap {
|
|
89
|
+
display: flex;
|
|
90
|
+
}
|
|
91
|
+
.card-wrap {
|
|
92
|
+
margin-top: @v-module-distance;
|
|
93
|
+
border: 1px solid @v-table-border-color;
|
|
94
|
+
> h5 {
|
|
95
|
+
display: flex;
|
|
96
|
+
align-items: center;
|
|
97
|
+
font-size: inherit;
|
|
98
|
+
font-weight: normal;
|
|
99
|
+
margin-bottom: 0;
|
|
100
|
+
padding: 0 @v-module-distance;
|
|
101
|
+
border-bottom: 1px solid @v-table-border-color;
|
|
102
|
+
background-color: @v-table-header-background-color;
|
|
103
|
+
}
|
|
104
|
+
> ul {
|
|
105
|
+
margin-bottom: 0;
|
|
106
|
+
li {
|
|
107
|
+
display: flex;
|
|
108
|
+
align-items: center;
|
|
109
|
+
position: relative;
|
|
110
|
+
padding: 6px @v-module-distance;
|
|
111
|
+
border-bottom: 1px solid @v-table-border-color;
|
|
112
|
+
cursor: pointer;
|
|
113
|
+
transition: all 0.3s ease;
|
|
114
|
+
&:last-of-type {
|
|
115
|
+
border-bottom: 0;
|
|
116
|
+
}
|
|
117
|
+
&:hover {
|
|
118
|
+
background-color: @v-table-row-hover-background-color;
|
|
119
|
+
.close {
|
|
120
|
+
visibility: visible;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
&.selected {
|
|
124
|
+
background-color: @v-table-row-selected-background-color;
|
|
125
|
+
}
|
|
126
|
+
.title {
|
|
127
|
+
i {
|
|
128
|
+
margin-right: 5px;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
.close {
|
|
132
|
+
position: absolute;
|
|
133
|
+
right: @v-module-distance;
|
|
134
|
+
visibility: hidden;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
.line {
|
|
141
|
+
border-left: 1px dashed @--border-color-base;
|
|
142
|
+
padding-left: @v-module-distance;
|
|
143
|
+
margin-left: @v-module-distance;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
.bottom-bar {
|
|
147
|
+
display: flex;
|
|
148
|
+
justify-content: space-between;
|
|
149
|
+
align-items: center;
|
|
150
|
+
}
|
|
151
|
+
}
|