@jiaozhiye/qm-design-react 1.1.0-beta.2 → 1.1.0-beta.22

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 (50) hide show
  1. package/lib/_utils/cloneElement.d.ts +1 -1
  2. package/lib/_utils/types.d.ts +1 -1
  3. package/lib/_utils/util.d.ts +2 -0
  4. package/lib/button/src/button.d.ts +2 -1
  5. package/lib/copy-to-clipboard/index.d.ts +3 -0
  6. package/lib/copy-to-clipboard/src/copy-to-clipboard.d.ts +15 -0
  7. package/lib/copy-to-clipboard/style/index.less +12 -0
  8. package/lib/drawer/src/drawer.d.ts +1 -0
  9. package/lib/form/src/form-cascader.d.ts +1 -0
  10. package/lib/form/src/form-checkbox-group.d.ts +1 -0
  11. package/lib/form/src/form-input.d.ts +3 -1
  12. package/lib/form/src/form-item-layout.d.ts +3 -0
  13. package/lib/form/src/form-radio.d.ts +1 -0
  14. package/lib/form/src/form-select.d.ts +1 -0
  15. package/lib/form/src/form-tree-select.d.ts +1 -0
  16. package/lib/form/src/form.d.ts +10 -6
  17. package/lib/form/src/types.d.ts +16 -3
  18. package/lib/index.d.ts +4 -0
  19. package/lib/index.esm.js +2 -2
  20. package/lib/index.full.js +1 -1
  21. package/lib/index.js +2 -2
  22. package/lib/locale/lang/en.d.ts +15 -0
  23. package/lib/locale/lang/en.js +16 -1
  24. package/lib/locale/lang/zh-cn.d.ts +15 -0
  25. package/lib/locale/lang/zh-cn.js +16 -1
  26. package/lib/search-helper/src/search-helper.d.ts +2 -1
  27. package/lib/search-helper/style/index.less +3 -2
  28. package/lib/style/index.css +114 -37
  29. package/lib/style/index.less +1 -0
  30. package/lib/style/index.min.css +1 -1
  31. package/lib/table/src/clipboard/index.d.ts +7 -0
  32. package/lib/table/src/clipboard/setting.d.ts +8 -0
  33. package/lib/table/src/edit/InputNumber.d.ts +1 -0
  34. package/lib/table/src/hooks/useImperativeMethod.d.ts +3 -3
  35. package/lib/table/src/hooks/useTableCore.d.ts +16 -4
  36. package/lib/table/src/hooks/useTableEffect.d.ts +1 -1
  37. package/lib/table/src/hooks/useTableMemo.d.ts +1 -0
  38. package/lib/table/src/hooks/useTableState.d.ts +3 -0
  39. package/lib/table/src/table/props.d.ts +13 -6
  40. package/lib/table/src/table/types.d.ts +13 -6
  41. package/lib/table/style/body.less +4 -7
  42. package/lib/table/style/clipboard.less +25 -0
  43. package/lib/table/style/index.less +1 -0
  44. package/lib/table/style/table.less +15 -0
  45. package/lib/tree-helper/index.d.ts +3 -0
  46. package/lib/tree-helper/src/tree-helper.d.ts +19 -0
  47. package/lib/tree-helper/style/index.less +21 -0
  48. package/lib/tree-table-helper/src/tree-table-helper.d.ts +2 -1
  49. package/lib/tree-table-helper/style/index.less +2 -2
  50. package/package.json +18 -17
@@ -1,2 +1,2 @@
1
1
  import React from 'react';
2
- export declare const cloneElement: (element: React.ReactNode, ...restArgs: any[]) => {} | null | undefined;
2
+ export declare const cloneElement: (element: React.ReactNode, ...rest: any[]) => React.ReactElement | null;
@@ -27,7 +27,7 @@ export declare type ComponentSize = 'small' | 'middle' | 'large';
27
27
  export declare type Locale = 'zh-cn' | 'en';
28
28
  export declare type IDict = {
29
29
  text: string;
30
- value: string;
30
+ value: string | number;
31
31
  disabled?: boolean;
32
32
  children?: Array<IDict> | Nullable<undefined>;
33
33
  };
@@ -19,5 +19,7 @@ export declare const camelize: (input: string) => string;
19
19
  export declare const isEmpty: (val: any) => boolean;
20
20
  export declare const isValid: (val: string) => boolean;
21
21
  export declare const getValueByPath: (obj: AnyObject<any>, paths?: string) => unknown;
22
+ export declare const deepClone: (target: object, map?: WeakMap<object, any>) => object;
22
23
  export declare const getParserWidth: (val: number | string) => string;
23
24
  export declare const flatJson: <T extends Record<string, any>>(jsonObject: T) => T;
25
+ export declare const getAuthValue: (code: string) => Record<string, any> | undefined;
@@ -2,6 +2,7 @@ import React, { Component } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import type { ButtonProps } from '../../antd';
4
4
  declare type IProps = ButtonProps & {
5
+ authCode?: string;
5
6
  click?: () => Promise<void> | void;
6
7
  confirm?: {
7
8
  title?: string;
@@ -25,6 +26,6 @@ declare class QmButton extends Component<IProps, IState> {
25
26
  static contextType: React.Context<import("../../config-provider/context").IConfig>;
26
27
  state: IState;
27
28
  clickHandle: () => Promise<void>;
28
- render(): React.ReactElement;
29
+ render(): React.ReactElement | null;
29
30
  }
30
31
  export default QmButton;
@@ -0,0 +1,3 @@
1
+ import CopyToClipboard from './src/copy-to-clipboard';
2
+ export type { QmCopyToClipboardProps } from './src/copy-to-clipboard';
3
+ export default CopyToClipboard;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ declare type IProps = {
3
+ text: string;
4
+ showMessage?: boolean;
5
+ options?: {
6
+ debug?: boolean;
7
+ message?: string;
8
+ format?: string;
9
+ };
10
+ onCopy?: (text: string, result: boolean) => void;
11
+ children?: React.ReactNode;
12
+ };
13
+ export declare type QmCopyToClipboardProps = IProps;
14
+ declare const CopyToClipboard: React.FC<IProps>;
15
+ export default CopyToClipboard;
@@ -0,0 +1,12 @@
1
+ /*
2
+ * @Author: 焦质晔
3
+ * @Date: 2021-07-23 19:05:57
4
+ * @Last Modified by: 焦质晔
5
+ * @Last Modified time: 2021-07-31 22:38:07
6
+ */
7
+ @import '../../style/common';
8
+
9
+ @prefix-clipboard: ~'@{qm-prefix}-clipboard';
10
+
11
+ .@{prefix-clipboard} {
12
+ }
@@ -26,6 +26,7 @@ declare class QmDrawer extends Component<IProps, IState> {
26
26
  width: string;
27
27
  showFullScreen: boolean;
28
28
  destroyOnClose: boolean;
29
+ footer: null;
29
30
  };
30
31
  titleRef: React.RefObject<HTMLSpanElement>;
31
32
  $drawer: Nullable<HTMLElement>;
@@ -13,6 +13,7 @@ declare class FormCascader extends Component<IProps, IState> {
13
13
  static contextType: React.Context<import("./context").IFormContext | undefined>;
14
14
  state: IState;
15
15
  componentDidMount(): void;
16
+ componentWillUnmount(): void;
16
17
  componentDidUpdate(prevProps: IProps): void;
17
18
  createViewText(val: string | string[], items: IDict[]): string;
18
19
  getItemList(): Promise<void>;
@@ -11,6 +11,7 @@ declare class FormCheckboxGroup extends Component<IProps, IState> {
11
11
  static contextType: React.Context<import("./context").IFormContext | undefined>;
12
12
  state: IState;
13
13
  componentDidMount(): void;
14
+ componentWillUnmount(): void;
14
15
  componentDidUpdate(prevProps: IProps): void;
15
16
  getItemList(): Promise<void>;
16
17
  render(): React.ReactElement;
@@ -5,13 +5,15 @@ declare type IProps = {
5
5
  };
6
6
  declare type IInputProps<T = string> = IProps & {
7
7
  value?: T;
8
+ onBlur?: (value: T) => void;
8
9
  onChange?: (value: T) => void;
9
10
  onValuesChange: (value: T) => void;
10
11
  };
11
12
  declare class VInput extends Component<IInputProps> {
12
13
  static contextType: React.Context<import("./context").IFormContext | undefined>;
13
14
  triggerChange: (value: string) => void;
14
- render(): JSX.Element;
15
+ triggerBlur: (value: string) => void;
16
+ render(): React.ReactElement;
15
17
  }
16
18
  declare class FormInput extends Component<IProps> {
17
19
  static contextType: React.Context<import("./context").IFormContext | undefined>;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const FormItemLayout: React.FC<any>;
3
+ export default FormItemLayout;
@@ -11,6 +11,7 @@ declare class FormRadio extends Component<IProps, IState> {
11
11
  static contextType: React.Context<import("./context").IFormContext | undefined>;
12
12
  state: IState;
13
13
  componentDidMount(): void;
14
+ componentWillUnmount(): void;
14
15
  componentDidUpdate(prevProps: IProps): void;
15
16
  getItemList(): Promise<void>;
16
17
  render(): React.ReactElement;
@@ -13,6 +13,7 @@ declare class FormSelect extends Component<IProps, IState> {
13
13
  static contextType: React.Context<import("./context").IFormContext | undefined>;
14
14
  state: IState;
15
15
  componentDidMount(): void;
16
+ componentWillUnmount(): void;
16
17
  componentDidUpdate(prevProps: IProps): void;
17
18
  createViewText(val: any, list: IDict[]): string | undefined;
18
19
  getItemList(): Promise<void>;
@@ -13,6 +13,7 @@ declare class FormTreeSelect extends Component<IProps, IState> {
13
13
  static contextType: React.Context<import("./context").IFormContext | undefined>;
14
14
  state: IState;
15
15
  componentDidMount(): void;
16
+ componentWillUnmount(): void;
16
17
  componentDidUpdate(prevProps: IProps): void;
17
18
  getItemText(val: any, items: IDict[]): any;
18
19
  createViewText(val: any, items: IDict[]): any;
@@ -32,6 +32,7 @@ declare class QmForm extends Component<IProps, IState> {
32
32
  labelAlign: import("prop-types").Requireable<string>;
33
33
  formType: import("prop-types").Requireable<string>;
34
34
  uniqueKey: import("prop-types").Requireable<string>;
35
+ authCode: import("prop-types").Requireable<string>;
35
36
  defaultRows: import("prop-types").Requireable<number>;
36
37
  authConfig: import("prop-types").Requireable<import("prop-types").InferProps<{
37
38
  fetch: import("prop-types").Requireable<import("prop-types").InferProps<{
@@ -50,6 +51,7 @@ declare class QmForm extends Component<IProps, IState> {
50
51
  onFieldsChange: import("prop-types").Requireable<(...args: any[]) => any>;
51
52
  onFinish: import("prop-types").Requireable<(...args: any[]) => any>;
52
53
  onFinishFailed: import("prop-types").Requireable<(...args: any[]) => any>;
54
+ onReset: import("prop-types").Requireable<(...args: any[]) => any>;
53
55
  onCollapse: import("prop-types").Requireable<(...args: any[]) => any>;
54
56
  };
55
57
  static defaultProps: {
@@ -67,6 +69,7 @@ declare class QmForm extends Component<IProps, IState> {
67
69
  onFieldsChange: () => void;
68
70
  onFinish: () => void;
69
71
  onFinishFailed: () => void;
72
+ onReset: () => void;
70
73
  onCollapse: () => void;
71
74
  onFormItemsChange: () => void;
72
75
  };
@@ -114,7 +117,8 @@ declare class QmForm extends Component<IProps, IState> {
114
117
  type: any;
115
118
  fieldName: any;
116
119
  }): boolean;
117
- formatFormValue: (values: IFormData) => IFormData;
120
+ formatFormValue(values: IFormData): IFormData;
121
+ createFormAuth(): void;
118
122
  getFormAuth(): Promise<void>;
119
123
  INPUT(option: IFormItem): JSXElement;
120
124
  RANGE_INPUT(option: IFormItem): JSXElement;
@@ -155,8 +159,8 @@ declare class QmForm extends Component<IProps, IState> {
155
159
  createFormLayout(): (JSX.Element | null)[];
156
160
  createSearchButtonLayout(lastCols?: number): JSX.Element | null;
157
161
  createFormButtonLayout(): JSX.Element | null;
158
- createFieldsDefine: () => JSX.Element;
159
- setExpandHandle: (collapse: boolean) => void;
162
+ createFieldsDefine(): JSX.Element;
163
+ setExpandHandle(collapse: boolean): void;
160
164
  valuesChangeHandle: (changedValues: IFormData, allValues: IFormData) => void;
161
165
  fieldsChangeHandle: (changedFields: IFieldData[], allFields: IFieldData[]) => void;
162
166
  finishHandle: (values: IFormData) => void;
@@ -168,12 +172,12 @@ declare class QmForm extends Component<IProps, IState> {
168
172
  get_fields_other(fields?: string[]): IFormData;
169
173
  SET_FIELDS_VALUE(values: IFormData): void;
170
174
  GET_FIELDS_VALUE(fields?: string[]): IFormData;
171
- GET_FORM_DATA: () => Promise<any[]>;
175
+ GET_FORM_DATA(): Promise<any[]>;
172
176
  SET_FIELDS_EXTRA(values: IExtraData): void;
173
177
  GET_FIELDS_EXTRA(fields?: string[]): IExtraData;
174
178
  GET_FIELDS_TOUCHED(fields?: string[]): boolean;
175
- SUBMIT_FORM: () => void;
176
- RESET_FORM: () => void;
179
+ SUBMIT_FORM(): void;
180
+ RESET_FORM(): void;
177
181
  render(): React.ReactElement;
178
182
  }
179
183
  export default QmForm;
@@ -1,17 +1,19 @@
1
1
  /// <reference types="react" />
2
2
  import PropTypes from 'prop-types';
3
3
  import type { BuildInPlacements } from 'rc-trigger';
4
- import type { IFetch, IColumn, IRecord, IRowKey } from '../../table/src/table/types';
5
- import type { Nullable, CSSProperties, ComponentSize, JSXElement, ValueOf, AjaxResponse, IDict } from '../../_utils/types';
4
+ import type { IFetch, IColumn, IRowKey } from '../../table/src/table/types';
5
+ import type { CSSProperties, ComponentSize, JSXElement, ValueOf, AjaxResponse, IDict } 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;
9
9
  export declare const DEFAULT_COL_WIDTH = 300;
10
10
  export declare const DEFAULT_TRUE_VALUE = "1";
11
11
  export declare const DEFAULT_FALSE_VALUE = "0";
12
+ export declare type IRecord = Record<string, any>;
12
13
  export declare type IFormLayout = 'horizontal' | 'vertical';
13
14
  export declare type ILabelAlign = 'left' | 'right';
14
15
  export declare type IFormType = 'default' | 'search' | 'onlyShow';
16
+ export declare type IValidateTrigger = 'onChange' | 'onBlur';
15
17
  export declare type IFormItemType = 'DIVIDER' | 'INPUT' | 'TEXT_AREA' | 'RANGE_INPUT' | 'INPUT_NUMBER' | 'RANGE_INPUT_NUMBER' | 'CHECKBOX' | 'MULTIPLE_CHECKBOX' | 'RADIO' | 'SWITCH' | 'DATE' | 'RANGE_DATE' | 'TIME' | 'RANGE_TIME' | 'SELECT' | 'MULTIPLE_SELECT' | 'IMMEDIATE' | 'SEARCH_HELPER' | 'MULTIPLE_SEARCH_HELPER' | 'TREE_SELECT' | 'MULTIPLE_TREE_SELECT' | 'CASCADER' | 'MULTIPLE_CASCADER' | 'CITY_SELECT' | 'REGION_SELECT' | 'UPLOAD_FILE' | 'UPLOAD_IMG' | 'TINYMCE';
16
18
  export declare const ARRAY_TYPE: IFormItemType[];
17
19
  export declare const BUILT_IN_PLACEMENTS: BuildInPlacements;
@@ -72,6 +74,7 @@ export declare type IFormItem = {
72
74
  noAuth?: boolean;
73
75
  invisible?: boolean;
74
76
  rules?: Record<string, any>[];
77
+ validateTrigger?: IValidateTrigger | IValidateTrigger[];
75
78
  selfCol?: number;
76
79
  offsetLeft?: number;
77
80
  offsetRight?: number;
@@ -143,6 +146,11 @@ export declare type IFormItem = {
143
146
  fetch?: IFetch;
144
147
  tableParamsMap?: (() => Record<string, string>) | Record<string, string>;
145
148
  };
149
+ request?: {
150
+ fetchApi?: IFetchFn;
151
+ params?: IFetchParams;
152
+ dataKey?: string;
153
+ };
146
154
  width?: number | string;
147
155
  initialValue?: IFormData;
148
156
  onlySelect?: boolean;
@@ -182,7 +190,7 @@ export declare type IFormItem = {
182
190
  onCollapse?: (collapse: boolean) => void;
183
191
  };
184
192
  render?: (options: IFormItem, instance: any) => JSXElement;
185
- onChange?: (value: ValueOf<IFormData> | boolean, others?: string | Nullable<IFormData>) => void;
193
+ onChange?: (value: ValueOf<IFormData> | boolean, others?: any) => void;
186
194
  onBlur?: (value: ValueOf<IFormData>) => void;
187
195
  onEnter?: (value: ValueOf<IFormData>) => void;
188
196
  };
@@ -198,6 +206,7 @@ export declare type IFormProps = {
198
206
  labelAlign?: ILabelAlign;
199
207
  formType?: IFormType;
200
208
  uniqueKey?: string;
209
+ authCode?: string;
201
210
  defaultRows?: number;
202
211
  authConfig?: IAuthConfig;
203
212
  isAutoFocus?: boolean;
@@ -210,6 +219,7 @@ export declare type IFormProps = {
210
219
  onFieldsChange?: (changedFields: IFieldData[], allFields: IFieldData[]) => void;
211
220
  onFinish?: (values: IFormData) => void;
212
221
  onFinishFailed?: (errorFields: any) => void;
222
+ onReset?: () => void;
213
223
  onCollapse?: (collapse: boolean) => void;
214
224
  };
215
225
  export declare const propTypes: {
@@ -227,6 +237,7 @@ export declare const propTypes: {
227
237
  labelAlign: PropTypes.Requireable<string>;
228
238
  formType: PropTypes.Requireable<string>;
229
239
  uniqueKey: PropTypes.Requireable<string>;
240
+ authCode: PropTypes.Requireable<string>;
230
241
  defaultRows: PropTypes.Requireable<number>;
231
242
  authConfig: PropTypes.Requireable<PropTypes.InferProps<{
232
243
  fetch: PropTypes.Requireable<PropTypes.InferProps<{
@@ -245,6 +256,7 @@ export declare const propTypes: {
245
256
  onFieldsChange: PropTypes.Requireable<(...args: any[]) => any>;
246
257
  onFinish: PropTypes.Requireable<(...args: any[]) => any>;
247
258
  onFinishFailed: PropTypes.Requireable<(...args: any[]) => any>;
259
+ onReset: PropTypes.Requireable<(...args: any[]) => any>;
248
260
  onCollapse: PropTypes.Requireable<(...args: any[]) => any>;
249
261
  };
250
262
  export declare const defaultProps: {
@@ -262,6 +274,7 @@ export declare const defaultProps: {
262
274
  onFieldsChange: () => void;
263
275
  onFinish: () => void;
264
276
  onFinishFailed: () => void;
277
+ onReset: () => void;
265
278
  onCollapse: () => void;
266
279
  onFormItemsChange: () => void;
267
280
  };
package/lib/index.d.ts CHANGED
@@ -40,6 +40,10 @@ export type { QmSearchHelperProps } from './search-helper';
40
40
  export { default as QmSearchHelper } from './search-helper';
41
41
  export type { QmTreeTableHelperProps } from './tree-table-helper';
42
42
  export { default as QmTreeTableHelper } from './tree-table-helper';
43
+ export type { QmTreeHelperProps } from './tree-helper';
44
+ export { default as QmTreeHelper } from './tree-helper';
45
+ export type { QmCopyToClipboardProps } from './copy-to-clipboard';
46
+ export { default as QmCopyToClipboard } from './copy-to-clipboard';
43
47
  export type { QmPrintProps } from './print';
44
48
  export { default as QmPrint } from './print';
45
49
  export { default as pinyin } from './pinyin';