@jiaozhiye/qm-design-react 1.4.0-beta.2 → 1.4.0-beta.21
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 +3 -1
- package/lib/anchor/style/index.less +61 -21
- package/lib/antd/compact.less +11 -0
- package/lib/antd/index.less +11 -1
- package/lib/button/src/button.d.ts +6 -5
- 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-cascader.d.ts +1 -1
- package/lib/form/src/form-checkbox-group.d.ts +1 -1
- package/lib/form/src/form-multiple-tree-table-helper.d.ts +2 -2
- package/lib/form/src/form-radio.d.ts +1 -1
- package/lib/form/src/form-select.d.ts +1 -1
- package/lib/form/src/form-tree-select.d.ts +1 -1
- package/lib/form/src/form.d.ts +14 -14
- package/lib/form/src/types.d.ts +25 -15
- package/lib/form/src/utils.d.ts +7 -3
- package/lib/form/style/index.less +19 -8
- package/lib/hooks/useDebounce.d.ts +3 -0
- package/lib/index.esm.js +2 -2
- package/lib/index.full.js +1 -1
- package/lib/index.js +2 -2
- package/lib/locale/index.js +5 -5
- package/lib/locale/lang/en.d.ts +4 -0
- package/lib/locale/lang/en.js +6 -2
- package/lib/locale/lang/zh-cn.d.ts +4 -0
- package/lib/locale/lang/zh-cn.js +6 -2
- package/lib/modal/style/index.less +2 -2
- package/lib/print/src/LodopFuncs.d.ts +1 -1
- package/lib/print/src/preview.d.ts +1 -1
- package/lib/print/src/print.d.ts +1 -1
- 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 +645 -685
- package/lib/style/compact.less +4 -3
- package/lib/style/compact.min.css +1 -1
- package/lib/style/index.css +109 -58
- 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 +3 -280
- package/lib/style/themes/default.less +2 -1
- package/lib/table/src/context/index.d.ts +3 -3
- package/lib/table/src/edit/InputNumber.d.ts +2 -0
- package/lib/table/src/hooks/useImperativeMethod.d.ts +2 -1
- package/lib/table/src/hooks/useTableCore.d.ts +1 -0
- package/lib/table/src/hooks/useTableEffect.d.ts +3 -0
- package/lib/table/src/hooks/useTableLayout.d.ts +2 -2
- package/lib/table/src/table/props.d.ts +15 -9
- package/lib/table/src/table/types.d.ts +28 -10
- package/lib/table/src/utils/index.d.ts +3 -2
- package/lib/table/style/clipboard.less +1 -0
- package/lib/table/style/export.less +1 -1
- package/lib/table/style/fast-search.less +3 -2
- package/lib/table/style/size.less +1 -0
- package/lib/table/style/table.less +374 -374
- package/lib/tabs/src/tab-pane.d.ts +1 -0
- package/lib/tabs/src/tabs.d.ts +6 -1
- 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 +4 -9
- package/package.json +6 -7
- package/lib/form/src/form-item-layout.d.ts +0 -3
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,11 @@ export declare type IFieldsDefine = {
|
|
|
24
24
|
displayKey?: string;
|
|
25
25
|
extraKey?: string;
|
|
26
26
|
};
|
|
27
|
-
export declare type
|
|
27
|
+
export declare type IFieldAuthItem = {
|
|
28
|
+
visible: number;
|
|
29
|
+
disabled?: number;
|
|
30
|
+
secretName?: string;
|
|
31
|
+
};
|
|
28
32
|
export declare type IDateType = 'date' | 'datetime' | 'exactdate' | 'week' | 'month' | 'quarter' | 'year';
|
|
29
33
|
export declare enum EDateType {
|
|
30
34
|
'date' = "date",
|
|
@@ -70,13 +74,15 @@ export declare type IRequest = {
|
|
|
70
74
|
params?: IFetchParams;
|
|
71
75
|
formatter?: (params: IFetchParams) => IFetchParams;
|
|
72
76
|
dataKey?: string;
|
|
77
|
+
callback?: (itemList: IRecord[]) => void;
|
|
73
78
|
};
|
|
74
79
|
export declare type IAuthConfig = {
|
|
75
|
-
fetch
|
|
80
|
+
fetch?: {
|
|
76
81
|
api: IFetchFn;
|
|
77
82
|
params?: IFetchParams;
|
|
78
83
|
dataKey?: string;
|
|
79
84
|
};
|
|
85
|
+
fieldList?: IAuth[];
|
|
80
86
|
};
|
|
81
87
|
export declare type IFormItem = {
|
|
82
88
|
type: IFormItemType;
|
|
@@ -109,13 +115,14 @@ export declare type IFormItem = {
|
|
|
109
115
|
toUpper?: boolean;
|
|
110
116
|
toTrim?: boolean;
|
|
111
117
|
pattern?: RegExp;
|
|
112
|
-
secretType?:
|
|
118
|
+
secretType?: string;
|
|
113
119
|
step?: number;
|
|
114
120
|
min?: number;
|
|
115
121
|
max?: number;
|
|
116
122
|
textAlign?: ILabelAlign | 'center';
|
|
117
123
|
controls?: boolean;
|
|
118
124
|
precision?: number;
|
|
125
|
+
stringMode?: boolean;
|
|
119
126
|
formatter?: (value: number | string) => string;
|
|
120
127
|
parser?: (value: string) => string | number;
|
|
121
128
|
falseValue?: string | number;
|
|
@@ -134,6 +141,9 @@ export declare type IFormItem = {
|
|
|
134
141
|
hourStep?: number;
|
|
135
142
|
minuteStep?: number;
|
|
136
143
|
secondStep?: number;
|
|
144
|
+
startTime?: string;
|
|
145
|
+
endTime?: string;
|
|
146
|
+
timeStep?: string;
|
|
137
147
|
allowHalf?: boolean;
|
|
138
148
|
tooltips?: string[];
|
|
139
149
|
count?: number;
|
|
@@ -194,6 +204,7 @@ export declare type IFormItem = {
|
|
|
194
204
|
width?: number | string;
|
|
195
205
|
initialValue?: IFormData;
|
|
196
206
|
onlySelect?: boolean;
|
|
207
|
+
autoQueryAssign?: boolean;
|
|
197
208
|
closeRemoteMatch?: boolean;
|
|
198
209
|
fieldAliasMap?: (() => Record<string, string>) | Record<string, string>;
|
|
199
210
|
extraAliasMap?: (() => Record<string, string>) | Record<string, string>;
|
|
@@ -204,7 +215,10 @@ export declare type IFormItem = {
|
|
|
204
215
|
request?: IRequest & {
|
|
205
216
|
valueKey?: string;
|
|
206
217
|
textKey?: string;
|
|
207
|
-
|
|
218
|
+
};
|
|
219
|
+
asyncLoad?: IRequest & {
|
|
220
|
+
valueKey?: string;
|
|
221
|
+
textKey?: string;
|
|
208
222
|
};
|
|
209
223
|
upload?: {
|
|
210
224
|
action?: string;
|
|
@@ -247,12 +261,13 @@ export declare type IFormProps = {
|
|
|
247
261
|
size?: ComponentSize;
|
|
248
262
|
cols?: number;
|
|
249
263
|
customClass?: string;
|
|
264
|
+
compactMode?: boolean;
|
|
250
265
|
labelWidth?: number | string;
|
|
251
266
|
labelAlign?: ILabelAlign;
|
|
252
267
|
labelWrap?: boolean;
|
|
253
268
|
formType?: IFormType;
|
|
269
|
+
disabled?: boolean;
|
|
254
270
|
uniqueKey?: string;
|
|
255
|
-
authCode?: string;
|
|
256
271
|
defaultRows?: number;
|
|
257
272
|
searchButtonCols?: number;
|
|
258
273
|
scrollToFirstError?: boolean;
|
|
@@ -266,7 +281,7 @@ export declare type IFormProps = {
|
|
|
266
281
|
onValuesChange?: (changedValues: IFormData, initialValues: IFormData) => void;
|
|
267
282
|
onFieldsChange?: (changedFields: IFieldData[], allFields: IFieldData[]) => void;
|
|
268
283
|
onFinish?: (values: IFormData) => void;
|
|
269
|
-
onFinishFailed?: (errorFields: any) => void;
|
|
284
|
+
onFinishFailed?: (errorFields: any[]) => void;
|
|
270
285
|
onReset?: () => void;
|
|
271
286
|
onCollapse?: (collapse: boolean) => void;
|
|
272
287
|
};
|
|
@@ -281,22 +296,17 @@ export declare const propTypes: {
|
|
|
281
296
|
size: (props: any, propName: any, componentName: any) => void;
|
|
282
297
|
cols: PropTypes.Requireable<number>;
|
|
283
298
|
customClass: PropTypes.Requireable<string>;
|
|
299
|
+
compactMode: PropTypes.Requireable<boolean>;
|
|
284
300
|
labelWidth: PropTypes.Requireable<string | number>;
|
|
285
301
|
labelAlign: PropTypes.Requireable<string>;
|
|
286
302
|
labelWrap: PropTypes.Requireable<boolean>;
|
|
287
303
|
formType: PropTypes.Requireable<string>;
|
|
304
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
288
305
|
uniqueKey: PropTypes.Requireable<string>;
|
|
289
|
-
authCode: PropTypes.Requireable<string>;
|
|
290
306
|
defaultRows: PropTypes.Requireable<number>;
|
|
291
307
|
searchButtonCols: PropTypes.Requireable<number>;
|
|
292
308
|
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
|
-
}>>;
|
|
309
|
+
authConfig: PropTypes.Requireable<object>;
|
|
300
310
|
isAutoFocus: PropTypes.Requireable<boolean>;
|
|
301
311
|
isCollapse: PropTypes.Requireable<boolean>;
|
|
302
312
|
isFieldsDefine: PropTypes.Requireable<boolean>;
|
package/lib/form/src/utils.d.ts
CHANGED
|
@@ -4,16 +4,19 @@ import type { IFormItem, IFetchFnMaker, IRecord } from './types';
|
|
|
4
4
|
export declare const getDate: (dateString: string | undefined, format: string) => dayjs.Dayjs | null;
|
|
5
5
|
export declare const formatDate: (date: Dayjs | null, format: string) => string;
|
|
6
6
|
export declare const isEmptyValue: (value: unknown) => boolean;
|
|
7
|
-
export declare const getSplitValue: (data: IRecord, path: string) => any;
|
|
7
|
+
export declare const getSplitValue: (data: IRecord | null, 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
|
+
selectable?: boolean | undefined;
|
|
12
|
+
isLeaf?: boolean | undefined;
|
|
13
|
+
})[];
|
|
11
14
|
export declare const deepFind: (arr: any[], mark: string) => any;
|
|
12
15
|
export declare const deepFindValues: <T>(arr: T[], str: string, depth?: number) => T[];
|
|
13
16
|
export declare const deepGetPath: (arr: any[], value: string) => string[] | undefined;
|
|
14
17
|
export declare const formatNumber: (value: string | number) => string;
|
|
15
18
|
export declare const parserNumber: (value: string) => string;
|
|
16
|
-
export declare const secretFormat: (value: string | undefined, type: string) => string;
|
|
19
|
+
export declare const secretFormat: (value: string | number | undefined, type: string) => string;
|
|
17
20
|
export declare const createShConfig: (data: any, fieldName: string, createFetch: IFetchFnMaker, multiple?: boolean) => {
|
|
18
21
|
name?: string | undefined;
|
|
19
22
|
getServerConfig?: import("./types").IFetchFn | undefined;
|
|
@@ -42,6 +45,7 @@ export declare const createShConfig: (data: any, fieldName: string, createFetch:
|
|
|
42
45
|
width?: string | number | undefined;
|
|
43
46
|
initialValue?: import("./types").IFormData | undefined;
|
|
44
47
|
onlySelect?: boolean | undefined;
|
|
48
|
+
autoQueryAssign?: boolean | undefined;
|
|
45
49
|
closeRemoteMatch?: boolean | undefined;
|
|
46
50
|
fieldAliasMap?: Record<string, string> | (() => Record<string, string>) | undefined;
|
|
47
51
|
extraAliasMap?: Record<string, string> | (() => Record<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,7 @@
|
|
|
165
175
|
// immediate
|
|
166
176
|
.@{prefix-form}-immediate {
|
|
167
177
|
padding: 5px 15px;
|
|
178
|
+
overflow-y: auto !important;
|
|
168
179
|
.table {
|
|
169
180
|
width: 100%;
|
|
170
181
|
th,
|