@jiaozhiye/qm-design-react 1.10.19 → 1.11.0
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/form/src/form.d.ts +2 -1
- package/lib/form/src/types.d.ts +5 -1
- 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.js +5 -5
- package/lib/locale/lang/zh-cn.js +5 -5
- package/lib/pivot-grid/style/grid-layout.less +234 -234
- package/lib/pivot-grid/style/main.less +43 -43
- package/lib/pivot-grid/style/top-bar.less +105 -105
- package/lib/style/index.css +45 -2
- package/lib/style/index.min.css +1 -1
- package/lib/table/src/body/DraggableTr.d.ts +26 -0
- package/lib/table/src/body/dragUtils.d.ts +43 -0
- package/lib/table/src/body/useDragSort.d.ts +24 -0
- package/lib/table/src/context/index.d.ts +1 -0
- package/lib/table/src/table/props.d.ts +2 -1
- package/lib/table/src/table/types.d.ts +3 -0
- package/lib/table/style/body.less +103 -77
- package/lib/table/style/index.less +31 -30
- package/lib/table/style/pivot-grid.less +19 -0
- package/package.json +1 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { DropOption } from './useDragSort';
|
|
3
|
+
import type { IRecord, IRowKey } from '../table/types';
|
|
4
|
+
export type IProps = {
|
|
5
|
+
rowKey: IRowKey;
|
|
6
|
+
row: IRecord;
|
|
7
|
+
className: string;
|
|
8
|
+
style?: React.CSSProperties;
|
|
9
|
+
indent: number;
|
|
10
|
+
filter?: string;
|
|
11
|
+
dropOption: DropOption;
|
|
12
|
+
onNodeDragStart: (ev: React.DragEvent<HTMLTableRowElement>, node: NodeType) => void;
|
|
13
|
+
onNodeDragEnter: (ev: React.DragEvent<HTMLTableRowElement>, node: NodeType) => void;
|
|
14
|
+
onNodeDragOver: (ev: React.DragEvent<HTMLTableRowElement>, node: NodeType) => void;
|
|
15
|
+
onNodeDragLeave: (ev: React.DragEvent<HTMLTableRowElement>, node: NodeType) => void;
|
|
16
|
+
onNodeDragEnd: (ev: React.DragEvent<HTMLTableRowElement>, node: NodeType) => void;
|
|
17
|
+
onNodeDrop: (ev: React.DragEvent<HTMLTableRowElement>, node: NodeType) => void;
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
};
|
|
20
|
+
export type NodeType = {
|
|
21
|
+
eventKey: IRowKey;
|
|
22
|
+
data: IRecord;
|
|
23
|
+
props: IProps;
|
|
24
|
+
};
|
|
25
|
+
declare const DraggableTr: React.FC<IProps>;
|
|
26
|
+
export default DraggableTr;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Nullable } from '../../../_utils/types';
|
|
2
|
+
import type { IRecord, IRowKey } from '../table/types';
|
|
3
|
+
import type { NodeType } from './DraggableTr';
|
|
4
|
+
export type KeyEntity = {
|
|
5
|
+
index: number;
|
|
6
|
+
key: IRowKey;
|
|
7
|
+
level: number;
|
|
8
|
+
node: IRecord;
|
|
9
|
+
nodes: IRecord[];
|
|
10
|
+
parent: Nullable<KeyEntity>;
|
|
11
|
+
pos: string;
|
|
12
|
+
children?: KeyEntity[];
|
|
13
|
+
};
|
|
14
|
+
export declare const calcDropPosition: (event: React.MouseEvent, dragNode: NodeType, targetNode: NodeType, indent: number, startMousePosition: {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
}, allowDrop: (option: any) => boolean, flattenedKeys: IRowKey[], keyEntities: Record<string, KeyEntity>, expandKeys: IRowKey[], forbidTree: boolean) => {
|
|
18
|
+
dropPosition: -1 | 0 | 1;
|
|
19
|
+
dropLevelOffset: number;
|
|
20
|
+
dropTargetKey: IRowKey;
|
|
21
|
+
dropTargetPos: string;
|
|
22
|
+
dropContainerKey: Nullable<IRowKey>;
|
|
23
|
+
dragOverNodeKey: IRowKey;
|
|
24
|
+
dropAllowed: boolean;
|
|
25
|
+
};
|
|
26
|
+
export declare const getEntity: (keyEntities: Record<string, KeyEntity>, key: IRowKey) => KeyEntity;
|
|
27
|
+
export declare const arrDel: (list: IRowKey[], value: IRowKey) => (string | number)[];
|
|
28
|
+
export declare const arrAdd: (list: IRowKey[], value: IRowKey) => (string | number)[];
|
|
29
|
+
export declare const posToArr: (pos: string) => string[];
|
|
30
|
+
export declare const isLastChild: (treeNodeEntity: KeyEntity) => boolean;
|
|
31
|
+
export declare const isFirstChild: (treeNodeEntity: KeyEntity) => boolean;
|
|
32
|
+
export declare const getDragChildrenKeys: (dragNodeKey: IRowKey, keyEntities: Record<string, KeyEntity>) => (string | number)[];
|
|
33
|
+
export declare const getTreeNodeProps: (key: IRowKey, { dragOverNodeKey, dropPosition, keyEntities }: {
|
|
34
|
+
dragOverNodeKey: any;
|
|
35
|
+
dropPosition: any;
|
|
36
|
+
keyEntities: any;
|
|
37
|
+
}) => {
|
|
38
|
+
eventKey: string | number;
|
|
39
|
+
pos: string;
|
|
40
|
+
dragOver: boolean;
|
|
41
|
+
dragOverGapTop: boolean;
|
|
42
|
+
dragOverGapBottom: boolean;
|
|
43
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Nullable } from '../../../_utils/types';
|
|
3
|
+
import type { IRowKey } from '../table/types';
|
|
4
|
+
import type { NodeType } from './DraggableTr';
|
|
5
|
+
export type DropOption = {
|
|
6
|
+
dropPosition: -1 | 0 | 1 | null;
|
|
7
|
+
dropLevelOffset: number | null;
|
|
8
|
+
dropContainerKey: IRowKey | null;
|
|
9
|
+
dropTargetKey: IRowKey | null;
|
|
10
|
+
dropTargetPos: string | null;
|
|
11
|
+
dropAllowed: boolean;
|
|
12
|
+
dragOverNodeKey: IRowKey | null;
|
|
13
|
+
};
|
|
14
|
+
declare const useDragSort: () => {
|
|
15
|
+
onNodeDragStart: (ev: React.DragEvent<HTMLTableRowElement>, node: NodeType) => void;
|
|
16
|
+
onNodeDragEnter: (ev: React.DragEvent<HTMLTableRowElement>, node: NodeType) => void;
|
|
17
|
+
onNodeDragOver: (ev: React.DragEvent<HTMLTableRowElement>, node: NodeType) => void;
|
|
18
|
+
onNodeDragLeave: (ev: React.DragEvent<HTMLTableRowElement>, node: NodeType) => void;
|
|
19
|
+
onNodeDragEnd: (ev: React.DragEvent<HTMLTableRowElement>, node: Nullable<NodeType>, outsideTree?: boolean) => void;
|
|
20
|
+
onNodeDrop: (ev: React.DragEvent<HTMLTableRowElement>, node: NodeType, outsideTree?: boolean) => void;
|
|
21
|
+
indent: number;
|
|
22
|
+
dropOptions: DropOption;
|
|
23
|
+
};
|
|
24
|
+
export default useDragSort;
|
|
@@ -7,6 +7,7 @@ export type ITableContext = {
|
|
|
7
7
|
getRowKey: (row: IRecord, index: number) => IRowKey;
|
|
8
8
|
tableRef: React.MutableRefObject<ITableRef>;
|
|
9
9
|
tableBodyRef: React.RefObject<TableBodyRef>;
|
|
10
|
+
prefixCls: string;
|
|
10
11
|
$size: ComponentSize;
|
|
11
12
|
flattenColumns: IColumn[];
|
|
12
13
|
editableColumns: IColumn[];
|
|
@@ -137,7 +137,8 @@ export declare const propTypes: {
|
|
|
137
137
|
loading: PropTypes.Requireable<boolean>;
|
|
138
138
|
resizable: PropTypes.Requireable<boolean>;
|
|
139
139
|
uniqueKey: PropTypes.Requireable<string>;
|
|
140
|
-
|
|
140
|
+
className: PropTypes.Requireable<string>;
|
|
141
|
+
style: PropTypes.Requireable<object>;
|
|
141
142
|
showHeader: PropTypes.Requireable<boolean>;
|
|
142
143
|
ellipsis: PropTypes.Requireable<boolean>;
|
|
143
144
|
dynamicThead: PropTypes.Requireable<boolean>;
|
|
@@ -350,7 +350,10 @@ export type ITableProps = {
|
|
|
350
350
|
loading?: boolean;
|
|
351
351
|
resizable?: boolean;
|
|
352
352
|
uniqueKey?: string;
|
|
353
|
+
/** @deprecated use `className` instead, and it will be deprecated in the next major version */
|
|
353
354
|
customClass?: string;
|
|
355
|
+
className?: string;
|
|
356
|
+
style?: CSSProperties;
|
|
354
357
|
showHeader?: boolean;
|
|
355
358
|
ellipsis?: boolean;
|
|
356
359
|
dynamicThead?: boolean;
|
|
@@ -1,77 +1,103 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: 焦质晔
|
|
3
|
-
* @Date: 2020-02-28 22:13:54
|
|
4
|
-
* @Last Modified by: 焦质晔
|
|
5
|
-
* @Last Modified time:
|
|
6
|
-
*/
|
|
7
|
-
.body--
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
//
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
.ant-input-
|
|
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
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
* @Author: 焦质晔
|
|
3
|
+
* @Date: 2020-02-28 22:13:54
|
|
4
|
+
* @Last Modified by: 焦质晔
|
|
5
|
+
* @Last Modified time: 2024-12-01 18:48:00
|
|
6
|
+
*/
|
|
7
|
+
.body--row {
|
|
8
|
+
&-draggable {
|
|
9
|
+
position: relative;
|
|
10
|
+
.drop-indicator {
|
|
11
|
+
position: absolute;
|
|
12
|
+
right: 0;
|
|
13
|
+
bottom: 0;
|
|
14
|
+
z-index: 5;
|
|
15
|
+
height: 2px;
|
|
16
|
+
background-color: @v-primary-color;
|
|
17
|
+
border-radius: 1px;
|
|
18
|
+
pointer-events: none;
|
|
19
|
+
&::after {
|
|
20
|
+
position: absolute;
|
|
21
|
+
top: -3px;
|
|
22
|
+
left: 0;
|
|
23
|
+
width: 8px;
|
|
24
|
+
height: 8px;
|
|
25
|
+
background-color: #fff;
|
|
26
|
+
border: 2px solid @v-primary-color;
|
|
27
|
+
border-radius: 50%;
|
|
28
|
+
content: '';
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
.body--column {
|
|
34
|
+
.cell--edit {
|
|
35
|
+
margin: 0 -1 * (@v-module-distance - 1px);
|
|
36
|
+
// placeholder
|
|
37
|
+
input::placeholder {
|
|
38
|
+
text-align: left;
|
|
39
|
+
}
|
|
40
|
+
// search
|
|
41
|
+
.ant-input-search {
|
|
42
|
+
width: calc(100% + 1px);
|
|
43
|
+
& > .ant-input-group > .ant-input-group-addon {
|
|
44
|
+
line-height: 1;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
// search-helper-multiple
|
|
48
|
+
.search-helper-multiple {
|
|
49
|
+
.ant-input-group > .ant-select:first-child {
|
|
50
|
+
z-index: 1;
|
|
51
|
+
.ant-select-selector {
|
|
52
|
+
border-top-right-radius: 0;
|
|
53
|
+
border-bottom-right-radius: 0;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
.ant-select-multiple {
|
|
57
|
+
.ant-select-selection-overflow-item-rest {
|
|
58
|
+
pointer-events: none;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// textArea
|
|
63
|
+
textarea[class='ant-input'] {
|
|
64
|
+
resize: none;
|
|
65
|
+
}
|
|
66
|
+
&.is-error {
|
|
67
|
+
position: relative;
|
|
68
|
+
.ant-input,
|
|
69
|
+
.ant-input-affix-wrapper {
|
|
70
|
+
border-color: @v-danger-color;
|
|
71
|
+
box-shadow: none;
|
|
72
|
+
z-index: 1;
|
|
73
|
+
}
|
|
74
|
+
.ant-input-search {
|
|
75
|
+
& + .cell-error {
|
|
76
|
+
right: 38px;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
.cell-error {
|
|
80
|
+
position: absolute;
|
|
81
|
+
top: calc(50% - 9px);
|
|
82
|
+
font-size: @v-font-size-small;
|
|
83
|
+
color: @v-danger-color;
|
|
84
|
+
right: 8px;
|
|
85
|
+
pointer-events: none;
|
|
86
|
+
z-index: 1;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
&.col--center {
|
|
91
|
+
.cell--edit .ant-input {
|
|
92
|
+
text-align: center;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
&.col--right {
|
|
96
|
+
.cell--edit .ant-input {
|
|
97
|
+
text-align: right;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
&.selected {
|
|
101
|
+
background-color: @v-table-row-selected-background-color !important;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: 焦质晔
|
|
3
|
-
* @Date: 2021-07-23 19:05:57
|
|
4
|
-
* @Last Modified by: 焦质晔
|
|
5
|
-
* @Last Modified time: 2024-
|
|
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 './
|
|
22
|
-
@import './
|
|
23
|
-
@import './
|
|
24
|
-
@import './
|
|
25
|
-
@import './
|
|
26
|
-
@import './
|
|
27
|
-
@import './
|
|
28
|
-
@import './
|
|
29
|
-
@import './
|
|
30
|
-
@import './
|
|
1
|
+
/*
|
|
2
|
+
* @Author: 焦质晔
|
|
3
|
+
* @Date: 2021-07-23 19:05:57
|
|
4
|
+
* @Last Modified by: 焦质晔
|
|
5
|
+
* @Last Modified time: 2024-12-01 14:16:57
|
|
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 './pivot-grid.less';
|
|
22
|
+
@import './column-filter.less';
|
|
23
|
+
@import './table.less';
|
|
24
|
+
@import './header.less';
|
|
25
|
+
@import './body.less';
|
|
26
|
+
@import './footer.less';
|
|
27
|
+
@import './area-select.less';
|
|
28
|
+
@import './pager.less';
|
|
29
|
+
@import './empty.less';
|
|
30
|
+
@import './expandable.less';
|
|
31
|
+
@import './size.less';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: 焦质晔
|
|
3
|
+
* @Date: 2024-12-01 14:16:05
|
|
4
|
+
* @Last Modified by: 焦质晔
|
|
5
|
+
* @Last Modified time: 2024-12-01 14:16:28
|
|
6
|
+
*/
|
|
7
|
+
.@{prefix-table}-pivot-grid {
|
|
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
|
+
}
|