@jiaozhiye/qm-design-react 1.4.0-beta.9 → 1.5.1

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 (45) hide show
  1. package/lib/_utils/types.d.ts +7 -1
  2. package/lib/_utils/util.d.ts +0 -1
  3. package/lib/antd/compact.less +11 -0
  4. package/lib/button/src/button.d.ts +4 -3
  5. package/lib/collapse/src/collapse.d.ts +1 -0
  6. package/lib/drawer/style/index.less +2 -2
  7. package/lib/form/src/form-cascader.d.ts +1 -1
  8. package/lib/form/src/form-checkbox-group.d.ts +1 -1
  9. package/lib/form/src/form-multiple-tree-table-helper.d.ts +2 -2
  10. package/lib/form/src/form-radio.d.ts +1 -1
  11. package/lib/form/src/form-select.d.ts +1 -1
  12. package/lib/form/src/form-tree-select.d.ts +1 -1
  13. package/lib/form/src/form.d.ts +4 -12
  14. package/lib/form/src/types.d.ts +7 -16
  15. package/lib/form/src/utils.d.ts +1 -1
  16. package/lib/form/style/index.less +2 -0
  17. package/lib/index.esm.js +2 -2
  18. package/lib/index.full.js +1 -1
  19. package/lib/index.js +2 -2
  20. package/lib/locale/lang/en.d.ts +1 -0
  21. package/lib/locale/lang/en.js +1 -0
  22. package/lib/locale/lang/zh-cn.d.ts +1 -0
  23. package/lib/locale/lang/zh-cn.js +1 -0
  24. package/lib/modal/style/index.less +2 -2
  25. package/lib/print/src/preview.d.ts +1 -1
  26. package/lib/print/src/print.d.ts +1 -1
  27. package/lib/range-table-helper/style/index.less +4 -0
  28. package/lib/search-tree/src/search-tree.d.ts +6 -0
  29. package/lib/search-tree/style/index.less +13 -0
  30. package/lib/spin/style/index.less +3 -5
  31. package/lib/style/compact.css +619 -666
  32. package/lib/style/compact.less +9 -9
  33. package/lib/style/compact.min.css +1 -1
  34. package/lib/style/index.css +22 -3
  35. package/lib/style/index.min.css +1 -1
  36. package/lib/style/themes/compact.less +2 -280
  37. package/lib/table/src/hooks/useTableEffect.d.ts +2 -0
  38. package/lib/table/src/table/props.d.ts +7 -7
  39. package/lib/table/src/table/types.d.ts +17 -9
  40. package/lib/table/src/utils/index.d.ts +1 -0
  41. package/lib/table/style/export.less +1 -1
  42. package/lib/table/style/fast-search.less +2 -2
  43. package/lib/upload-file/src/upload-file.d.ts +4 -9
  44. package/package.json +5 -6
  45. package/lib/form/src/form-item-layout.d.ts +0 -3
@@ -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
- msg: string;
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
+ };
@@ -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;
@@ -0,0 +1,11 @@
1
+ /*
2
+ * @Author: 焦质晔
3
+ * @Date: 2023-01-07 14:07:04
4
+ * @Last Modified by: 焦质晔
5
+ * @Last Modified time: 2023-01-07 14:07:27
6
+ */
7
+ @import 'antd/dist/antd.compact.less';
8
+
9
+ #__compact__ {
10
+ background-color: transparent;
11
+ }
@@ -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<string>;
22
+ title: PropTypes.Requireable<PropTypes.ReactNodeLike>;
22
23
  onConfirm: PropTypes.Requireable<(...args: any[]) => any>;
23
24
  onCancel: PropTypes.Requireable<(...args: any[]) => any>;
24
25
  }>>;
@@ -7,6 +7,7 @@ declare type IProps = {
7
7
  disabled?: boolean;
8
8
  forceRender?: boolean;
9
9
  destroyOnClose?: boolean;
10
+ onChange?: (value: boolean) => void;
10
11
  className?: string;
11
12
  style?: React.CSSProperties;
12
13
  containerStyle?: React.CSSProperties;
@@ -67,7 +67,7 @@
67
67
  .ant-drawer-header {
68
68
  height: 48px;
69
69
  }
70
- .qm-drawer-spin {
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
- .qm-drawer-spin {
78
+ .@{qm-prefix}-drawer-spin {
79
79
  top: 40px;
80
80
  }
81
81
  }
@@ -6,7 +6,7 @@ declare type IProps = {
6
6
  multiple?: boolean;
7
7
  };
8
8
  declare type IState = {
9
- results: IDict[];
9
+ itemList: IDict[];
10
10
  loading: boolean;
11
11
  };
12
12
  declare class FormCascader extends Component<IProps, IState> {
@@ -5,7 +5,7 @@ declare type IProps = {
5
5
  option: IFormItem;
6
6
  };
7
7
  declare type IState = {
8
- results: IDict[];
8
+ itemList: IDict[];
9
9
  };
10
10
  declare class FormCheckboxGroup extends Component<IProps, IState> {
11
11
  static contextType: React.Context<import("./context").IFormContext | undefined>;
@@ -6,7 +6,7 @@ declare type IProps = {
6
6
  declare type IState = {
7
7
  searchHelper: IFormItem['searchHelper'];
8
8
  };
9
- declare class FormMultipleTreeHelper extends Component<IProps, IState> {
9
+ declare class FormMultipleTreeTableHelper extends Component<IProps, IState> {
10
10
  static contextType: React.Context<import("./context").IFormContext | undefined>;
11
11
  private promiseRef;
12
12
  state: IState;
@@ -17,4 +17,4 @@ declare class FormMultipleTreeHelper extends Component<IProps, IState> {
17
17
  getHelperConfig: ($configContext: any) => void;
18
18
  render(): JSX.Element;
19
19
  }
20
- export default FormMultipleTreeHelper;
20
+ export default FormMultipleTreeTableHelper;
@@ -5,7 +5,7 @@ declare type IProps = {
5
5
  option: IFormItem;
6
6
  };
7
7
  declare type IState = {
8
- results: IDict[];
8
+ itemList: IDict[];
9
9
  };
10
10
  declare class FormRadio extends Component<IProps, IState> {
11
11
  static contextType: React.Context<import("./context").IFormContext | undefined>;
@@ -6,7 +6,7 @@ declare type IProps = {
6
6
  multiple?: boolean;
7
7
  };
8
8
  declare type IState = {
9
- results: IDict[];
9
+ itemList: IDict[];
10
10
  loading: boolean;
11
11
  };
12
12
  declare class FormSelect extends Component<IProps, IState> {
@@ -6,7 +6,7 @@ declare type IProps = {
6
6
  multiple?: boolean;
7
7
  };
8
8
  declare type IState = {
9
- results: IDict[];
9
+ itemList: IDict[];
10
10
  loading: boolean;
11
11
  };
12
12
  declare class FormTreeSelect extends Component<IProps, IState> {
@@ -35,17 +35,10 @@ declare class QmForm extends Component<IProps, IState> {
35
35
  labelWrap: import("prop-types").Requireable<boolean>;
36
36
  formType: import("prop-types").Requireable<string>;
37
37
  uniqueKey: import("prop-types").Requireable<string>;
38
- authCode: import("prop-types").Requireable<string>;
39
38
  defaultRows: import("prop-types").Requireable<number>;
40
39
  searchButtonCols: import("prop-types").Requireable<number>;
41
40
  scrollToFirstError: import("prop-types").Requireable<boolean>;
42
- authConfig: import("prop-types").Requireable<import("prop-types").InferProps<{
43
- fetch: import("prop-types").Requireable<import("prop-types").InferProps<{
44
- api: import("prop-types").Validator<(...args: any[]) => any>;
45
- params: import("prop-types").Requireable<object>;
46
- dataKey: import("prop-types").Requireable<string>;
47
- }>>;
48
- }>>;
41
+ authConfig: import("prop-types").Requireable<object>;
49
42
  isAutoFocus: import("prop-types").Requireable<boolean>;
50
43
  isCollapse: import("prop-types").Requireable<boolean>;
51
44
  isFieldsDefine: import("prop-types").Requireable<boolean>;
@@ -118,6 +111,7 @@ declare class QmForm extends Component<IProps, IState> {
118
111
  getFlattenItems: import("memoize-one").MemoizedFn<(items: IFormItem[]) => IFormItem[]>;
119
112
  setViewValue(fieldName: string, val?: string): void;
120
113
  getViewValue(fieldName: string): string;
114
+ setExpandHandle(collapse: boolean): void;
121
115
  createInputFocus(): void;
122
116
  getFormItemLabel(label: string | IFormItem): string;
123
117
  getBlockDerivedItems(): Pick<IFormItem, "fieldName" | "label">[][];
@@ -126,8 +120,7 @@ declare class QmForm extends Component<IProps, IState> {
126
120
  fieldName: any;
127
121
  }): boolean;
128
122
  formatFormValue(values: IFormData): IFormData;
129
- createFormAuth(): void;
130
- getFormAuth(): Promise<void>;
123
+ createFormAuth(): Promise<void>;
131
124
  INPUT(option: IFormItem): JSXElement;
132
125
  RANGE_INPUT(option: IFormItem): JSXElement;
133
126
  INPUT_NUMBER(option: IFormItem): JSXElement;
@@ -160,7 +153,7 @@ declare class QmForm extends Component<IProps, IState> {
160
153
  UPLOAD_FILE(option: IFormItem): JSXElement;
161
154
  UPLOAD_IMG(option: IFormItem): JSXElement;
162
155
  TINYMCE(option: IFormItem): JSXElement;
163
- renderFormLabel(label: IFormItem): JSX.Element | IFormItem;
156
+ renderFormLabel(label: IFormItem | string): string | JSX.Element;
164
157
  renderFormItemExtra(option: IFormItem['extra'] & {
165
158
  fieldName: string;
166
159
  }): JSX.Element;
@@ -171,7 +164,6 @@ declare class QmForm extends Component<IProps, IState> {
171
164
  createSearchButtonLayout(lastCols?: number): JSX.Element | null;
172
165
  createFormButtonLayout(): JSX.Element | null;
173
166
  createFieldsDefine(): JSX.Element;
174
- setExpandHandle(collapse: boolean): void;
175
167
  valuesChangeHandle: (changedValues: IFormData, allValues: IFormData) => void;
176
168
  fieldsChangeHandle: (changedFields: IFieldData[], allFields: IFieldData[]) => void;
177
169
  finishHandle: (values: IFormData) => void;
@@ -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?: ISecretType;
113
+ secretType?: string;
113
114
  step?: number;
114
115
  min?: number;
115
116
  max?: number;
@@ -204,12 +205,10 @@ export declare type IFormItem = {
204
205
  request?: IRequest & {
205
206
  valueKey?: string;
206
207
  textKey?: string;
207
- callback?: (itemList: IRecord[]) => void;
208
208
  };
209
209
  asyncLoad?: IRequest & {
210
210
  valueKey?: string;
211
211
  textKey?: string;
212
- callback?: (itemList: IRecord[]) => void;
213
212
  };
214
213
  upload?: {
215
214
  action?: string;
@@ -258,7 +257,6 @@ export declare type IFormProps = {
258
257
  labelWrap?: boolean;
259
258
  formType?: IFormType;
260
259
  uniqueKey?: string;
261
- authCode?: string;
262
260
  defaultRows?: number;
263
261
  searchButtonCols?: number;
264
262
  scrollToFirstError?: boolean;
@@ -272,7 +270,7 @@ export declare type IFormProps = {
272
270
  onValuesChange?: (changedValues: IFormData, initialValues: IFormData) => void;
273
271
  onFieldsChange?: (changedFields: IFieldData[], allFields: IFieldData[]) => void;
274
272
  onFinish?: (values: IFormData) => void;
275
- onFinishFailed?: (errorFields: any) => void;
273
+ onFinishFailed?: (errorFields: any[]) => void;
276
274
  onReset?: () => void;
277
275
  onCollapse?: (collapse: boolean) => void;
278
276
  };
@@ -293,17 +291,10 @@ export declare const propTypes: {
293
291
  labelWrap: PropTypes.Requireable<boolean>;
294
292
  formType: PropTypes.Requireable<string>;
295
293
  uniqueKey: PropTypes.Requireable<string>;
296
- authCode: PropTypes.Requireable<string>;
297
294
  defaultRows: PropTypes.Requireable<number>;
298
295
  searchButtonCols: PropTypes.Requireable<number>;
299
296
  scrollToFirstError: PropTypes.Requireable<boolean>;
300
- authConfig: PropTypes.Requireable<PropTypes.InferProps<{
301
- fetch: PropTypes.Requireable<PropTypes.InferProps<{
302
- api: PropTypes.Validator<(...args: any[]) => any>;
303
- params: PropTypes.Requireable<object>;
304
- dataKey: PropTypes.Requireable<string>;
305
- }>>;
306
- }>>;
297
+ authConfig: PropTypes.Requireable<object>;
307
298
  isAutoFocus: PropTypes.Requireable<boolean>;
308
299
  isCollapse: PropTypes.Requireable<boolean>;
309
300
  isFieldsDefine: PropTypes.Requireable<boolean>;
@@ -15,7 +15,7 @@ export declare const deepFindValues: <T>(arr: T[], str: string, depth?: number)
15
15
  export declare const deepGetPath: (arr: any[], value: string) => string[] | undefined;
16
16
  export declare const formatNumber: (value: string | number) => string;
17
17
  export declare const parserNumber: (value: string) => string;
18
- export declare const secretFormat: (value: string | undefined, type: string) => string;
18
+ export declare const secretFormat: (value: string | number | undefined, type: string) => string;
19
19
  export declare const createShConfig: (data: any, fieldName: string, createFetch: IFetchFnMaker, multiple?: boolean) => {
20
20
  name?: string | undefined;
21
21
  getServerConfig?: import("./types").IFetchFn | undefined;
@@ -175,6 +175,8 @@
175
175
  // immediate
176
176
  .@{prefix-form}-immediate {
177
177
  padding: 5px 15px;
178
+ max-height: calc(100vh - 10px);
179
+ overflow-y: auto !important;
178
180
  .table {
179
181
  width: 100%;
180
182
  th,