@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.
Files changed (73) hide show
  1. package/lib/_utils/types.d.ts +7 -1
  2. package/lib/_utils/util.d.ts +0 -1
  3. package/lib/anchor/src/anchor-nav.d.ts +1 -1
  4. package/lib/anchor/src/anchor.d.ts +3 -1
  5. package/lib/anchor/style/index.less +61 -21
  6. package/lib/antd/compact.less +11 -0
  7. package/lib/antd/index.less +11 -1
  8. package/lib/button/src/button.d.ts +6 -5
  9. package/lib/collapse/src/collapse.d.ts +1 -0
  10. package/lib/countup/style/index.less +22 -22
  11. package/lib/divider/style/index.less +54 -54
  12. package/lib/drawer/style/index.less +2 -2
  13. package/lib/form/src/context.d.ts +4 -1
  14. package/lib/form/src/form-cascader.d.ts +1 -1
  15. package/lib/form/src/form-checkbox-group.d.ts +1 -1
  16. package/lib/form/src/form-multiple-tree-table-helper.d.ts +2 -2
  17. package/lib/form/src/form-radio.d.ts +1 -1
  18. package/lib/form/src/form-select.d.ts +1 -1
  19. package/lib/form/src/form-tree-select.d.ts +1 -1
  20. package/lib/form/src/form.d.ts +14 -14
  21. package/lib/form/src/types.d.ts +25 -15
  22. package/lib/form/src/utils.d.ts +7 -3
  23. package/lib/form/style/index.less +19 -8
  24. package/lib/hooks/useDebounce.d.ts +3 -0
  25. package/lib/index.esm.js +2 -2
  26. package/lib/index.full.js +1 -1
  27. package/lib/index.js +2 -2
  28. package/lib/locale/index.js +5 -5
  29. package/lib/locale/lang/en.d.ts +4 -0
  30. package/lib/locale/lang/en.js +6 -2
  31. package/lib/locale/lang/zh-cn.d.ts +4 -0
  32. package/lib/locale/lang/zh-cn.js +6 -2
  33. package/lib/modal/style/index.less +2 -2
  34. package/lib/print/src/LodopFuncs.d.ts +1 -1
  35. package/lib/print/src/preview.d.ts +1 -1
  36. package/lib/print/src/print.d.ts +1 -1
  37. package/lib/print/style/index.less +175 -175
  38. package/lib/range-table-helper/style/index.less +5 -1
  39. package/lib/search-helper/style/index.less +1 -1
  40. package/lib/search-tree/src/search-tree.d.ts +6 -0
  41. package/lib/search-tree/style/index.less +14 -1
  42. package/lib/spin/style/index.less +3 -5
  43. package/lib/split/style/index.less +1 -1
  44. package/lib/style/compact.css +645 -685
  45. package/lib/style/compact.less +4 -3
  46. package/lib/style/compact.min.css +1 -1
  47. package/lib/style/index.css +109 -58
  48. package/lib/style/index.less +36 -36
  49. package/lib/style/index.min.css +1 -1
  50. package/lib/style/mixins/reset.less +1 -2
  51. package/lib/style/themes/compact.less +3 -280
  52. package/lib/style/themes/default.less +2 -1
  53. package/lib/table/src/context/index.d.ts +3 -3
  54. package/lib/table/src/edit/InputNumber.d.ts +2 -0
  55. package/lib/table/src/hooks/useImperativeMethod.d.ts +2 -1
  56. package/lib/table/src/hooks/useTableCore.d.ts +1 -0
  57. package/lib/table/src/hooks/useTableEffect.d.ts +3 -0
  58. package/lib/table/src/hooks/useTableLayout.d.ts +2 -2
  59. package/lib/table/src/table/props.d.ts +15 -9
  60. package/lib/table/src/table/types.d.ts +28 -10
  61. package/lib/table/src/utils/index.d.ts +3 -2
  62. package/lib/table/style/clipboard.less +1 -0
  63. package/lib/table/style/export.less +1 -1
  64. package/lib/table/style/fast-search.less +3 -2
  65. package/lib/table/style/size.less +1 -0
  66. package/lib/table/style/table.less +374 -374
  67. package/lib/tabs/src/tab-pane.d.ts +1 -0
  68. package/lib/tabs/src/tabs.d.ts +6 -1
  69. package/lib/tree-helper/style/index.less +1 -1
  70. package/lib/tree-table-helper/style/index.less +1 -1
  71. package/lib/upload-file/src/upload-file.d.ts +4 -9
  72. package/package.json +6 -7
  73. package/lib/form/src/form-item-layout.d.ts +0 -3
@@ -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 ISecretType = 'name' | 'phone' | 'IDnumber' | 'bankCard';
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?: ISecretType;
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
- callback?: (itemList: IRecord[]) => void;
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<PropTypes.InferProps<{
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>;
@@ -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-11-26 21:27:53
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
- // label
143
- .ant-form-item-label > label,
144
- .ant-form-item-label .ant-form-item-tooltip {
145
- font-size: @--font-size-sm;
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,
@@ -0,0 +1,3 @@
1
+ declare type noop = (...args: any[]) => any;
2
+ export default function useDebounce<T extends noop>(fn: T, delay?: number): () => void;
3
+ export {};