@jiaozhiye/qm-design-react 1.4.0-beta.2 → 1.4.0-beta.20
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/types.d.ts +7 -1
- package/lib/_utils/util.d.ts +0 -1
- package/lib/anchor/src/anchor-nav.d.ts +1 -1
- package/lib/anchor/src/anchor.d.ts +2 -1
- package/lib/anchor/style/index.less +61 -21
- package/lib/antd/compact.less +11 -0
- package/lib/button/src/button.d.ts +4 -3
- package/lib/collapse/src/collapse.d.ts +1 -0
- package/lib/countup/style/index.less +22 -22
- package/lib/divider/style/index.less +54 -54
- package/lib/drawer/style/index.less +2 -2
- package/lib/form/src/context.d.ts +4 -1
- package/lib/form/src/form.d.ts +8 -11
- package/lib/form/src/types.d.ts +12 -14
- package/lib/form/src/utils.d.ts +3 -1
- package/lib/form/style/index.less +20 -8
- package/lib/index.esm.js +2 -2
- package/lib/index.full.js +1 -1
- package/lib/index.js +2 -2
- package/lib/locale/lang/en.d.ts +1 -0
- package/lib/locale/lang/en.js +2 -1
- package/lib/locale/lang/zh-cn.d.ts +1 -0
- package/lib/locale/lang/zh-cn.js +2 -1
- package/lib/modal/style/index.less +2 -2
- package/lib/print/style/index.less +175 -175
- package/lib/range-table-helper/style/index.less +5 -1
- package/lib/search-helper/style/index.less +1 -1
- package/lib/search-tree/src/search-tree.d.ts +6 -0
- package/lib/search-tree/style/index.less +14 -1
- package/lib/spin/style/index.less +3 -5
- package/lib/split/style/index.less +1 -1
- package/lib/style/compact.css +623 -669
- package/lib/style/compact.less +9 -9
- package/lib/style/compact.min.css +1 -1
- package/lib/style/index.css +86 -40
- package/lib/style/index.less +36 -36
- package/lib/style/index.min.css +1 -1
- package/lib/style/mixins/reset.less +1 -2
- package/lib/style/themes/compact.less +19 -296
- package/lib/table/src/edit/InputNumber.d.ts +1 -0
- package/lib/table/src/hooks/useTableEffect.d.ts +2 -0
- package/lib/table/src/table/props.d.ts +7 -7
- package/lib/table/src/table/types.d.ts +17 -9
- package/lib/table/src/utils/index.d.ts +1 -0
- package/lib/table/style/export.less +1 -1
- package/lib/table/style/fast-search.less +2 -2
- package/lib/table/style/table.less +374 -374
- package/lib/tree-helper/style/index.less +1 -1
- package/lib/tree-table-helper/style/index.less +1 -1
- package/lib/upload-file/src/upload-file.d.ts +1 -5
- package/package.json +6 -7
package/lib/_utils/types.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export declare type IntervalHandle = ReturnType<typeof setInterval>;
|
|
|
16
16
|
export declare type AjaxResponse<T = any> = {
|
|
17
17
|
code: number;
|
|
18
18
|
data: T;
|
|
19
|
-
|
|
19
|
+
message: string;
|
|
20
20
|
};
|
|
21
21
|
export declare enum SizeHeight {
|
|
22
22
|
large = 40,
|
|
@@ -31,3 +31,9 @@ export declare type IDict = {
|
|
|
31
31
|
disabled?: boolean;
|
|
32
32
|
children?: Array<IDict> | Nullable<undefined>;
|
|
33
33
|
};
|
|
34
|
+
export declare type IAuth = {
|
|
35
|
+
dataIndex?: string;
|
|
36
|
+
visible?: number;
|
|
37
|
+
disabled?: number;
|
|
38
|
+
secretName?: string;
|
|
39
|
+
};
|
package/lib/_utils/util.d.ts
CHANGED
|
@@ -22,4 +22,3 @@ export declare const getValueByPath: (obj: AnyObject<any>, paths?: string) => un
|
|
|
22
22
|
export declare const deepClone: <T extends object>(target: T, map?: WeakMap<object, any>) => T;
|
|
23
23
|
export declare const getParserWidth: (val: number | string) => string;
|
|
24
24
|
export declare const flatJson: <T extends Record<string, any>>(jsonObject: T) => T;
|
|
25
|
-
export declare const getAuthValue: (code: string) => Record<string, any> | undefined;
|
|
@@ -9,6 +9,7 @@ declare type IProps = {
|
|
|
9
9
|
size?: ComponentSize;
|
|
10
10
|
labelWidth?: number | string;
|
|
11
11
|
labelList?: Array<ILabelItem>;
|
|
12
|
+
tabPosition?: 'left' | 'top';
|
|
12
13
|
className?: string;
|
|
13
14
|
style?: CSSProperties;
|
|
14
15
|
children?: React.ReactNode;
|
|
@@ -34,7 +35,7 @@ declare class QmAnchor extends Component<IProps, IState> {
|
|
|
34
35
|
}> | null | undefined)[]>;
|
|
35
36
|
};
|
|
36
37
|
static defaultProps: {
|
|
37
|
-
|
|
38
|
+
tabPosition: string;
|
|
38
39
|
};
|
|
39
40
|
static contextType: React.Context<import("../../config-provider/context").IConfig>;
|
|
40
41
|
private currentState;
|
|
@@ -9,22 +9,15 @@
|
|
|
9
9
|
@prefix-anchor: ~'@{qm-prefix}-anchor';
|
|
10
10
|
|
|
11
11
|
.@{prefix-anchor} {
|
|
12
|
-
.reset-
|
|
12
|
+
.reset-container;
|
|
13
13
|
display: flex;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
&-nav {
|
|
19
|
-
height: 100%;
|
|
20
|
-
margin-right: @--margin-md;
|
|
21
|
-
border-right: 1px solid @--border-color-base;
|
|
22
|
-
&__item {
|
|
14
|
+
.anchor-nav {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex: none;
|
|
17
|
+
.item {
|
|
23
18
|
display: flex;
|
|
24
19
|
align-items: center;
|
|
25
|
-
justify-content: flex-end;
|
|
26
20
|
height: @--height-md;
|
|
27
|
-
padding-right: @--padding-md;
|
|
28
21
|
position: relative;
|
|
29
22
|
cursor: pointer;
|
|
30
23
|
&.actived {
|
|
@@ -32,30 +25,77 @@
|
|
|
32
25
|
&::after {
|
|
33
26
|
content: '';
|
|
34
27
|
position: absolute;
|
|
35
|
-
right: -2px;
|
|
36
|
-
top: 0;
|
|
37
|
-
width: 2px;
|
|
38
|
-
height: 100%;
|
|
39
28
|
background-color: @--primary-color;
|
|
40
29
|
}
|
|
41
30
|
}
|
|
42
31
|
span {
|
|
43
32
|
.text-overflow-cut();
|
|
44
33
|
display: block;
|
|
45
|
-
text-align: right;
|
|
46
34
|
}
|
|
47
35
|
}
|
|
48
36
|
}
|
|
49
|
-
|
|
50
|
-
flex:
|
|
51
|
-
|
|
52
|
-
|
|
37
|
+
&-left {
|
|
38
|
+
flex-direction: row;
|
|
39
|
+
.anchor-nav {
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
margin-right: @--margin-md;
|
|
42
|
+
border-right: 1px solid @--border-color-base;
|
|
43
|
+
.item {
|
|
44
|
+
justify-content: flex-end;
|
|
45
|
+
padding: 0 @--padding-md;
|
|
46
|
+
&.actived {
|
|
47
|
+
&::after {
|
|
48
|
+
width: 2px;
|
|
49
|
+
right: -2px;
|
|
50
|
+
top: 0;
|
|
51
|
+
bottom: 0;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
&-top {
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
.anchor-nav {
|
|
60
|
+
flex-direction: row;
|
|
61
|
+
margin-bottom: @--margin-md;
|
|
62
|
+
border-bottom: 1px solid @--border-color-base;
|
|
63
|
+
.item {
|
|
64
|
+
justify-content: center;
|
|
65
|
+
padding: 0 @--padding-md + 2px;
|
|
66
|
+
&.actived {
|
|
67
|
+
&::after {
|
|
68
|
+
height: 2px;
|
|
69
|
+
bottom: -2px;
|
|
70
|
+
left: @--padding-md;
|
|
71
|
+
right: @--padding-md;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
.anchor-container {
|
|
78
|
+
flex: auto;
|
|
79
|
+
min-width: 0;
|
|
80
|
+
min-height: 0;
|
|
53
81
|
overflow-y: auto;
|
|
82
|
+
overflow-x: hidden;
|
|
54
83
|
}
|
|
55
84
|
// ------ size ------
|
|
56
85
|
// 40 32 24
|
|
57
86
|
&--lg {
|
|
87
|
+
.anchor-nav {
|
|
88
|
+
.item {
|
|
89
|
+
height: @--height-lg;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
58
92
|
}
|
|
59
93
|
&--sm {
|
|
94
|
+
.anchor-nav {
|
|
95
|
+
.item {
|
|
96
|
+
height: @--height-sm + 2px;
|
|
97
|
+
font-size: 13px;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
60
100
|
}
|
|
61
101
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import type { IAuth } from '../../_utils/types';
|
|
3
4
|
import type { ButtonProps } from '../../antd';
|
|
4
5
|
declare type IProps = ButtonProps & {
|
|
5
|
-
authCode?: string;
|
|
6
6
|
click?: () => Promise<void> | void;
|
|
7
|
+
authConfig?: IAuth;
|
|
7
8
|
confirm?: {
|
|
8
|
-
title?: string;
|
|
9
|
+
title?: string | React.ReactNode;
|
|
9
10
|
onConfirm?: () => void;
|
|
10
11
|
onCancel?: (ev: any) => void;
|
|
11
12
|
};
|
|
@@ -18,7 +19,7 @@ declare class QmButton extends Component<IProps, IState> {
|
|
|
18
19
|
static propTypes: {
|
|
19
20
|
click: PropTypes.Requireable<(...args: any[]) => any>;
|
|
20
21
|
confirm: PropTypes.Requireable<PropTypes.InferProps<{
|
|
21
|
-
title: PropTypes.Requireable<
|
|
22
|
+
title: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
22
23
|
onConfirm: PropTypes.Requireable<(...args: any[]) => any>;
|
|
23
24
|
onCancel: PropTypes.Requireable<(...args: any[]) => any>;
|
|
24
25
|
}>>;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: 焦质晔
|
|
3
|
-
* @Date: 2021-07-23 19:05:57
|
|
4
|
-
* @Last Modified by: 焦质晔
|
|
5
|
-
* @Last Modified time: 2021-08-01 21:58:46
|
|
6
|
-
*/
|
|
7
|
-
@import '../../style/common';
|
|
8
|
-
|
|
9
|
-
@prefix-countup: ~'@{qm-prefix}-countup';
|
|
10
|
-
|
|
11
|
-
.@{prefix-countup} {
|
|
12
|
-
.reset-
|
|
13
|
-
font-size: @--font-size-base;
|
|
14
|
-
// ------ size ------
|
|
15
|
-
// 40 32 24
|
|
16
|
-
&--lg {
|
|
17
|
-
font-size: @--font-size-base;
|
|
18
|
-
}
|
|
19
|
-
&--sm {
|
|
20
|
-
font-size: @--font-size-sm;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
* @Author: 焦质晔
|
|
3
|
+
* @Date: 2021-07-23 19:05:57
|
|
4
|
+
* @Last Modified by: 焦质晔
|
|
5
|
+
* @Last Modified time: 2021-08-01 21:58:46
|
|
6
|
+
*/
|
|
7
|
+
@import '../../style/common';
|
|
8
|
+
|
|
9
|
+
@prefix-countup: ~'@{qm-prefix}-countup';
|
|
10
|
+
|
|
11
|
+
.@{prefix-countup} {
|
|
12
|
+
.reset-container;
|
|
13
|
+
font-size: @--font-size-base;
|
|
14
|
+
// ------ size ------
|
|
15
|
+
// 40 32 24
|
|
16
|
+
&--lg {
|
|
17
|
+
font-size: @--font-size-base;
|
|
18
|
+
}
|
|
19
|
+
&--sm {
|
|
20
|
+
font-size: @--font-size-sm;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: 焦质晔
|
|
3
|
-
* @Date: 2021-07-23 19:05:57
|
|
4
|
-
* @Last Modified by: 焦质晔
|
|
5
|
-
* @Last Modified time: 2021-08-21 20:34:44
|
|
6
|
-
*/
|
|
7
|
-
@import '../../style/common';
|
|
8
|
-
|
|
9
|
-
@prefix-divider: ~'@{qm-prefix}-divider';
|
|
10
|
-
|
|
11
|
-
.@{prefix-divider} {
|
|
12
|
-
.reset-
|
|
13
|
-
display: flex;
|
|
14
|
-
align-items: center;
|
|
15
|
-
padding: 0 @--padding-md;
|
|
16
|
-
height: @--height-md;
|
|
17
|
-
border: 1px solid @--border-color-base;
|
|
18
|
-
border-radius: @--border-radius-base;
|
|
19
|
-
background-color: @--background-color-cecondary;
|
|
20
|
-
position: relative;
|
|
21
|
-
&::before {
|
|
22
|
-
content: ' ';
|
|
23
|
-
position: absolute;
|
|
24
|
-
width: 6px;
|
|
25
|
-
left: -1px;
|
|
26
|
-
top: -1px;
|
|
27
|
-
bottom: -1px;
|
|
28
|
-
background-color: @--primary-color;
|
|
29
|
-
}
|
|
30
|
-
&__title {
|
|
31
|
-
margin-left: 5px;
|
|
32
|
-
}
|
|
33
|
-
&__extra {
|
|
34
|
-
.text-overflow-cut();
|
|
35
|
-
flex: 1;
|
|
36
|
-
margin-left: @--margin-md;
|
|
37
|
-
}
|
|
38
|
-
&__collapse {
|
|
39
|
-
margin-left: @--margin-md;
|
|
40
|
-
padding-left: 0;
|
|
41
|
-
padding-right: 0;
|
|
42
|
-
.anticon {
|
|
43
|
-
margin-left: 4px !important;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
// ------ size ------
|
|
47
|
-
// 40 32 24
|
|
48
|
-
&--lg {
|
|
49
|
-
height: @--height-lg;
|
|
50
|
-
}
|
|
51
|
-
&--sm {
|
|
52
|
-
height: @--height-sm;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
* @Author: 焦质晔
|
|
3
|
+
* @Date: 2021-07-23 19:05:57
|
|
4
|
+
* @Last Modified by: 焦质晔
|
|
5
|
+
* @Last Modified time: 2021-08-21 20:34:44
|
|
6
|
+
*/
|
|
7
|
+
@import '../../style/common';
|
|
8
|
+
|
|
9
|
+
@prefix-divider: ~'@{qm-prefix}-divider';
|
|
10
|
+
|
|
11
|
+
.@{prefix-divider} {
|
|
12
|
+
.reset-container;
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
padding: 0 @--padding-md;
|
|
16
|
+
height: @--height-md;
|
|
17
|
+
border: 1px solid @--border-color-base;
|
|
18
|
+
border-radius: @--border-radius-base;
|
|
19
|
+
background-color: @--background-color-cecondary;
|
|
20
|
+
position: relative;
|
|
21
|
+
&::before {
|
|
22
|
+
content: ' ';
|
|
23
|
+
position: absolute;
|
|
24
|
+
width: 6px;
|
|
25
|
+
left: -1px;
|
|
26
|
+
top: -1px;
|
|
27
|
+
bottom: -1px;
|
|
28
|
+
background-color: @--primary-color;
|
|
29
|
+
}
|
|
30
|
+
&__title {
|
|
31
|
+
margin-left: 5px;
|
|
32
|
+
}
|
|
33
|
+
&__extra {
|
|
34
|
+
.text-overflow-cut();
|
|
35
|
+
flex: 1;
|
|
36
|
+
margin-left: @--margin-md;
|
|
37
|
+
}
|
|
38
|
+
&__collapse {
|
|
39
|
+
margin-left: @--margin-md;
|
|
40
|
+
padding-left: 0;
|
|
41
|
+
padding-right: 0;
|
|
42
|
+
.anticon {
|
|
43
|
+
margin-left: 4px !important;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
// ------ size ------
|
|
47
|
+
// 40 32 24
|
|
48
|
+
&--lg {
|
|
49
|
+
height: @--height-lg;
|
|
50
|
+
}
|
|
51
|
+
&--sm {
|
|
52
|
+
height: @--height-sm;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
.ant-drawer-header {
|
|
68
68
|
height: 48px;
|
|
69
69
|
}
|
|
70
|
-
|
|
70
|
+
.@{qm-prefix}-drawer-spin {
|
|
71
71
|
top: 48px;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
.ant-drawer-header {
|
|
76
76
|
height: 40px;
|
|
77
77
|
}
|
|
78
|
-
|
|
78
|
+
.@{qm-prefix}-drawer-spin {
|
|
79
79
|
top: 40px;
|
|
80
80
|
}
|
|
81
81
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import type { FormRef } from './form';
|
|
3
|
+
import type { IDict } from '../../_utils/types';
|
|
2
4
|
export declare type IFormContext = {
|
|
3
|
-
$$form:
|
|
5
|
+
$$form: FormRef;
|
|
6
|
+
echo_data: Record<string, IDict[]>;
|
|
4
7
|
};
|
|
5
8
|
declare const FormContext: import("react").Context<IFormContext | undefined>;
|
|
6
9
|
export default FormContext;
|
package/lib/form/src/form.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import React, { Component } from 'react';
|
|
3
3
|
import { IFieldData } from './types';
|
|
4
4
|
import type { IFormProps, IFormData, IFormItem, IExtraData, IViewData, IExpandData } from './types';
|
|
5
|
-
import type { JSXElement, ValueOf } from '../../_utils/types';
|
|
5
|
+
import type { JSXElement, ValueOf, IDict } from '../../_utils/types';
|
|
6
6
|
import type { FormProps } from '../../antd';
|
|
7
7
|
declare type IProps = FormProps & IFormProps;
|
|
8
8
|
declare type IState = {
|
|
@@ -29,22 +29,16 @@ declare class QmForm extends Component<IProps, IState> {
|
|
|
29
29
|
size: (props: any, propName: any, componentName: any) => void;
|
|
30
30
|
cols: import("prop-types").Requireable<number>;
|
|
31
31
|
customClass: import("prop-types").Requireable<string>;
|
|
32
|
+
compactMode: import("prop-types").Requireable<boolean>;
|
|
32
33
|
labelWidth: import("prop-types").Requireable<string | number>;
|
|
33
34
|
labelAlign: import("prop-types").Requireable<string>;
|
|
34
35
|
labelWrap: import("prop-types").Requireable<boolean>;
|
|
35
36
|
formType: import("prop-types").Requireable<string>;
|
|
36
37
|
uniqueKey: import("prop-types").Requireable<string>;
|
|
37
|
-
authCode: import("prop-types").Requireable<string>;
|
|
38
38
|
defaultRows: import("prop-types").Requireable<number>;
|
|
39
39
|
searchButtonCols: import("prop-types").Requireable<number>;
|
|
40
40
|
scrollToFirstError: import("prop-types").Requireable<boolean>;
|
|
41
|
-
authConfig: import("prop-types").Requireable<
|
|
42
|
-
fetch: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
43
|
-
api: import("prop-types").Validator<(...args: any[]) => any>;
|
|
44
|
-
params: import("prop-types").Requireable<object>;
|
|
45
|
-
dataKey: import("prop-types").Requireable<string>;
|
|
46
|
-
}>>;
|
|
47
|
-
}>>;
|
|
41
|
+
authConfig: import("prop-types").Requireable<object>;
|
|
48
42
|
isAutoFocus: import("prop-types").Requireable<boolean>;
|
|
49
43
|
isCollapse: import("prop-types").Requireable<boolean>;
|
|
50
44
|
isFieldsDefine: import("prop-types").Requireable<boolean>;
|
|
@@ -92,6 +86,7 @@ declare class QmForm extends Component<IProps, IState> {
|
|
|
92
86
|
get dividers(): IFormItem[];
|
|
93
87
|
get isFilterType(): boolean;
|
|
94
88
|
get isOnlyShow(): boolean;
|
|
89
|
+
get isCompactMode(): boolean;
|
|
95
90
|
get showDividerCollapse(): boolean;
|
|
96
91
|
get showFilterCollapse(): boolean | undefined;
|
|
97
92
|
componentDidMount(): void;
|
|
@@ -124,8 +119,7 @@ declare class QmForm extends Component<IProps, IState> {
|
|
|
124
119
|
fieldName: any;
|
|
125
120
|
}): boolean;
|
|
126
121
|
formatFormValue(values: IFormData): IFormData;
|
|
127
|
-
createFormAuth(): void
|
|
128
|
-
getFormAuth(): Promise<void>;
|
|
122
|
+
createFormAuth(): Promise<void>;
|
|
129
123
|
INPUT(option: IFormItem): JSXElement;
|
|
130
124
|
RANGE_INPUT(option: IFormItem): JSXElement;
|
|
131
125
|
INPUT_NUMBER(option: IFormItem): JSXElement;
|
|
@@ -179,6 +173,7 @@ declare class QmForm extends Component<IProps, IState> {
|
|
|
179
173
|
}) => void;
|
|
180
174
|
set_fields_other(values: IFormData): void;
|
|
181
175
|
get_fields_other(fields?: string[]): IFormData;
|
|
176
|
+
openValidateInfo: (errorFields: any) => void;
|
|
182
177
|
scrollToField: (fieldName?: string) => void;
|
|
183
178
|
formValidate(): Promise<IFormData>;
|
|
184
179
|
SET_FIELDS_VALUE(values: IFormData): void;
|
|
@@ -186,10 +181,12 @@ declare class QmForm extends Component<IProps, IState> {
|
|
|
186
181
|
GET_FORM_DATA(): Promise<[any, any]>;
|
|
187
182
|
VALIDATE_FIELDS(fields?: string[]): Promise<any[]>;
|
|
188
183
|
SET_FIELDS_EXTRA(values: IExtraData): void;
|
|
184
|
+
SET_FIELDS_ECHO(values: Record<string, IDict[]>): void;
|
|
189
185
|
GET_FIELDS_EXTRA(fields?: string[]): IExtraData;
|
|
190
186
|
GET_FIELDS_TOUCHED(fields?: string[]): boolean;
|
|
191
187
|
SUBMIT_FORM(): Promise<void>;
|
|
192
188
|
RESET_FORM(): void;
|
|
189
|
+
CREATE_FOCUS(fieldName: string): void;
|
|
193
190
|
SET_FORM_ITEM(fieldName: string, option: Record<string, any>, forceUpdate?: boolean): void;
|
|
194
191
|
render(): JSX.Element;
|
|
195
192
|
}
|
package/lib/form/src/types.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import type { BuildInPlacements } from 'rc-trigger';
|
|
4
4
|
import type { IFetch, IColumn, IRowKey } from '../../table/src/table/types';
|
|
5
|
-
import type { CSSProperties, ComponentSize, JSXElement, ValueOf, AjaxResponse, IDict } from '../../_utils/types';
|
|
5
|
+
import type { CSSProperties, ComponentSize, JSXElement, ValueOf, AjaxResponse, IDict, IAuth } from '../../_utils/types';
|
|
6
6
|
export declare const DEFAULT_COL = 4;
|
|
7
7
|
export declare const DEFAULT_ROWS = 1;
|
|
8
8
|
export declare const DEFAULT_LABEL_WIDTH = 80;
|
|
@@ -24,7 +24,6 @@ export declare type IFieldsDefine = {
|
|
|
24
24
|
displayKey?: string;
|
|
25
25
|
extraKey?: string;
|
|
26
26
|
};
|
|
27
|
-
export declare type ISecretType = 'name' | 'phone' | 'IDnumber' | 'bankCard';
|
|
28
27
|
export declare type IDateType = 'date' | 'datetime' | 'exactdate' | 'week' | 'month' | 'quarter' | 'year';
|
|
29
28
|
export declare enum EDateType {
|
|
30
29
|
'date' = "date",
|
|
@@ -70,13 +69,15 @@ export declare type IRequest = {
|
|
|
70
69
|
params?: IFetchParams;
|
|
71
70
|
formatter?: (params: IFetchParams) => IFetchParams;
|
|
72
71
|
dataKey?: string;
|
|
72
|
+
callback?: (itemList: IRecord[]) => void;
|
|
73
73
|
};
|
|
74
74
|
export declare type IAuthConfig = {
|
|
75
|
-
fetch
|
|
75
|
+
fetch?: {
|
|
76
76
|
api: IFetchFn;
|
|
77
77
|
params?: IFetchParams;
|
|
78
78
|
dataKey?: string;
|
|
79
79
|
};
|
|
80
|
+
fieldList?: IAuth[];
|
|
80
81
|
};
|
|
81
82
|
export declare type IFormItem = {
|
|
82
83
|
type: IFormItemType;
|
|
@@ -109,7 +110,7 @@ export declare type IFormItem = {
|
|
|
109
110
|
toUpper?: boolean;
|
|
110
111
|
toTrim?: boolean;
|
|
111
112
|
pattern?: RegExp;
|
|
112
|
-
secretType?:
|
|
113
|
+
secretType?: string;
|
|
113
114
|
step?: number;
|
|
114
115
|
min?: number;
|
|
115
116
|
max?: number;
|
|
@@ -204,7 +205,10 @@ export declare type IFormItem = {
|
|
|
204
205
|
request?: IRequest & {
|
|
205
206
|
valueKey?: string;
|
|
206
207
|
textKey?: string;
|
|
207
|
-
|
|
208
|
+
};
|
|
209
|
+
asyncLoad?: IRequest & {
|
|
210
|
+
valueKey?: string;
|
|
211
|
+
textKey?: string;
|
|
208
212
|
};
|
|
209
213
|
upload?: {
|
|
210
214
|
action?: string;
|
|
@@ -247,12 +251,12 @@ export declare type IFormProps = {
|
|
|
247
251
|
size?: ComponentSize;
|
|
248
252
|
cols?: number;
|
|
249
253
|
customClass?: string;
|
|
254
|
+
compactMode?: boolean;
|
|
250
255
|
labelWidth?: number | string;
|
|
251
256
|
labelAlign?: ILabelAlign;
|
|
252
257
|
labelWrap?: boolean;
|
|
253
258
|
formType?: IFormType;
|
|
254
259
|
uniqueKey?: string;
|
|
255
|
-
authCode?: string;
|
|
256
260
|
defaultRows?: number;
|
|
257
261
|
searchButtonCols?: number;
|
|
258
262
|
scrollToFirstError?: boolean;
|
|
@@ -281,22 +285,16 @@ export declare const propTypes: {
|
|
|
281
285
|
size: (props: any, propName: any, componentName: any) => void;
|
|
282
286
|
cols: PropTypes.Requireable<number>;
|
|
283
287
|
customClass: PropTypes.Requireable<string>;
|
|
288
|
+
compactMode: PropTypes.Requireable<boolean>;
|
|
284
289
|
labelWidth: PropTypes.Requireable<string | number>;
|
|
285
290
|
labelAlign: PropTypes.Requireable<string>;
|
|
286
291
|
labelWrap: PropTypes.Requireable<boolean>;
|
|
287
292
|
formType: PropTypes.Requireable<string>;
|
|
288
293
|
uniqueKey: PropTypes.Requireable<string>;
|
|
289
|
-
authCode: PropTypes.Requireable<string>;
|
|
290
294
|
defaultRows: PropTypes.Requireable<number>;
|
|
291
295
|
searchButtonCols: PropTypes.Requireable<number>;
|
|
292
296
|
scrollToFirstError: PropTypes.Requireable<boolean>;
|
|
293
|
-
authConfig: PropTypes.Requireable<
|
|
294
|
-
fetch: PropTypes.Requireable<PropTypes.InferProps<{
|
|
295
|
-
api: PropTypes.Validator<(...args: any[]) => any>;
|
|
296
|
-
params: PropTypes.Requireable<object>;
|
|
297
|
-
dataKey: PropTypes.Requireable<string>;
|
|
298
|
-
}>>;
|
|
299
|
-
}>>;
|
|
297
|
+
authConfig: PropTypes.Requireable<object>;
|
|
300
298
|
isAutoFocus: PropTypes.Requireable<boolean>;
|
|
301
299
|
isCollapse: PropTypes.Requireable<boolean>;
|
|
302
300
|
isFieldsDefine: PropTypes.Requireable<boolean>;
|
package/lib/form/src/utils.d.ts
CHANGED
|
@@ -7,7 +7,9 @@ export declare const isEmptyValue: (value: unknown) => boolean;
|
|
|
7
7
|
export declare const getSplitValue: (data: IRecord, path: string) => any;
|
|
8
8
|
export declare const setEchoRecord: (row: IRecord, alias: any, echoAlias: any) => void;
|
|
9
9
|
export declare const setEchoExtras: (row: IRecord, extras: any, echoExtras: any) => void;
|
|
10
|
-
export declare const deepMapList: (list: any[], valueKey: string, textKey: string) => IDict
|
|
10
|
+
export declare const deepMapList: (list: any[], valueKey: string, textKey: string) => (IDict & {
|
|
11
|
+
isLeaf?: boolean | undefined;
|
|
12
|
+
})[];
|
|
11
13
|
export declare const deepFind: (arr: any[], mark: string) => any;
|
|
12
14
|
export declare const deepFindValues: <T>(arr: T[], str: string, depth?: number) => T[];
|
|
13
15
|
export declare const deepGetPath: (arr: any[], value: string) => string[] | undefined;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: 焦质晔
|
|
3
3
|
* @Date: 2021-07-23 19:05:57
|
|
4
4
|
* @Last Modified by: 焦质晔
|
|
5
|
-
* @Last Modified time: 2022-
|
|
5
|
+
* @Last Modified time: 2022-12-02 20:00:11
|
|
6
6
|
*/
|
|
7
7
|
@import '../../style/common';
|
|
8
8
|
|
|
@@ -129,9 +129,6 @@
|
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
-
&__only-show {
|
|
133
|
-
// ...
|
|
134
|
-
}
|
|
135
132
|
// ------ size ------
|
|
136
133
|
// 40 32 24
|
|
137
134
|
&--lg {
|
|
@@ -139,10 +136,10 @@
|
|
|
139
136
|
&--sm {
|
|
140
137
|
.ant-form-item {
|
|
141
138
|
margin-bottom: @--margin-md;
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
139
|
+
.ant-form-item-label {
|
|
140
|
+
&-wrap {
|
|
141
|
+
line-height: 1;
|
|
142
|
+
}
|
|
146
143
|
}
|
|
147
144
|
// valigator
|
|
148
145
|
.ant-form-item-control {
|
|
@@ -154,6 +151,19 @@
|
|
|
154
151
|
}
|
|
155
152
|
}
|
|
156
153
|
}
|
|
154
|
+
&__only-show {
|
|
155
|
+
// ...
|
|
156
|
+
}
|
|
157
|
+
&__compact {
|
|
158
|
+
.ant-form-item {
|
|
159
|
+
margin-bottom: 4px;
|
|
160
|
+
.ant-form-item-control {
|
|
161
|
+
& > div:nth-last-of-type(1)[style*='nowrap'] {
|
|
162
|
+
display: none !important;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
157
167
|
}
|
|
158
168
|
|
|
159
169
|
.ant-picker-footer-extra {
|
|
@@ -165,6 +175,8 @@
|
|
|
165
175
|
// immediate
|
|
166
176
|
.@{prefix-form}-immediate {
|
|
167
177
|
padding: 5px 15px;
|
|
178
|
+
max-height: calc(100vh - 10px);
|
|
179
|
+
overflow-y: auto !important;
|
|
168
180
|
.table {
|
|
169
181
|
width: 100%;
|
|
170
182
|
th,
|