@jiaozhiye/qm-design-react 1.10.1 → 1.10.3

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.
@@ -105,11 +105,11 @@ declare class QmForm extends Component<IProps, IState> {
105
105
  initialHandle(): void;
106
106
  checkFieldNames(): void;
107
107
  getFormItemRequired(rules?: Record<string, any>[]): boolean;
108
- createOtherValue(values: IFormData): IFormData;
108
+ createOtherValue(values: IFormData): IFormData<string | number, string | number | (string | number)[] | undefined>;
109
109
  createExtraValue(values: IExtraData): IExtraData;
110
110
  createDividerExpand(): IExpandData;
111
- getInitialValue(item: IFormItem, val?: ValueOf<IFormData>): string | number | any[] | undefined;
112
- createFormValue(values: IFormData): IFormData;
111
+ getInitialValue(item: IFormItem, val?: ValueOf<IFormData>): string | number | (string | number)[] | Record<string, string | number> | undefined;
112
+ createFormValue(values: IFormData): IFormData<string | number, string | number | (string | number)[] | undefined>;
113
113
  createInitialValues(): void;
114
114
  createInitialOthers(): void;
115
115
  createInitialExtras(): void;
@@ -127,7 +127,7 @@ declare class QmForm extends Component<IProps, IState> {
127
127
  type: any;
128
128
  fieldName: any;
129
129
  }): boolean;
130
- formatFormValue(values: IFormData): IFormData;
130
+ formatFormValue(values: IFormData): IFormData<string | number, string | number | (string | number)[] | undefined>;
131
131
  setFieldAuth(key: string, value: IFieldAuthItem): void;
132
132
  createFormAuth(): Promise<void>;
133
133
  INPUT(option: IFormItem): JSXElement;
@@ -181,7 +181,7 @@ declare class QmForm extends Component<IProps, IState> {
181
181
  errorFields: any;
182
182
  }) => void;
183
183
  set_fields_other(values: IFormData): void;
184
- get_fields_other(fields?: string[]): IFormData;
184
+ get_fields_other(fields?: string[]): IFormData<string | number, string | number | (string | number)[] | undefined>;
185
185
  openValidateInfo: (errorFields: any) => void;
186
186
  scrollToField: (fieldName?: string) => void;
187
187
  formValidate(): Promise<IFormData>;
@@ -57,7 +57,7 @@ export declare enum ETimeFormat {
57
57
  'hour-minute' = "HH:mm",
58
58
  'hour-minute-second' = "HH:mm:ss"
59
59
  }
60
- export type IFormData = Record<string, string | number | any[] | undefined>;
60
+ export type IFormData<U = string | number, T = U | U[] | undefined> = Record<string, T | Record<string, U>>;
61
61
  export type IFetchHeader = Record<string, string>;
62
62
  export type IFetchParams = Record<string, any>;
63
63
  export type IFieldData = {
@@ -281,8 +281,10 @@ export type IFormItem = {
281
281
  };
282
282
  render?: (options: IFormItem, instance: any) => JSXElement;
283
283
  onChange?: (value: ValueOf<IFormData> | boolean, ...rest: any[]) => void;
284
- onBlur?: (value: ValueOf<IFormData>) => void;
285
- onEnter?: (value: ValueOf<IFormData>) => void;
284
+ onFocus?: (value: ValueOf<IFormData>, ev: React.FocusEvent<HTMLElement>) => void;
285
+ onBlur?: (value: ValueOf<IFormData>, ev: React.FocusEvent<HTMLElement>) => void;
286
+ onClear?: () => void;
287
+ onEnter?: (value: ValueOf<IFormData>, ev: React.KeyboardEvent<HTMLElement>) => void;
286
288
  };
287
289
  export type IFormProps = {
288
290
  items: IFormItem[];
@@ -49,13 +49,13 @@ export declare const createShConfig: (data: any, fieldName: string, createFetch:
49
49
  hideHeader?: boolean | undefined;
50
50
  columns?: import("../..").QmTableColumn[] | undefined;
51
51
  width?: string | number | undefined;
52
- initialValue?: import("./types").IFormData | undefined;
52
+ initialValue?: import("./types").IFormData<string | number, string | number | (string | number)[] | undefined> | undefined;
53
53
  onlySelect?: boolean | undefined;
54
54
  autoQueryAssign?: boolean | undefined;
55
55
  closeRemoteMatch?: boolean | undefined;
56
56
  fieldAliasMap?: Record<string, string> | (() => Record<string, string>) | undefined;
57
57
  extraAliasMap?: Record<string, string> | (() => Record<string, string>) | undefined;
58
58
  filterAliasMap?: string[] | Record<string, (input: string) => string> | (() => string[] | Record<string, (input: string) => string>) | undefined;
59
- beforeOpen?: ((formData: import("./types").IFormData) => boolean | void | Promise<void>) | undefined;
59
+ beforeOpen?: ((formData: import("./types").IFormData<string | number, string | number | (string | number)[] | undefined>) => boolean | void | Promise<void>) | undefined;
60
60
  closed?: ((rowData: Record<string, any>) => void) | undefined;
61
61
  };
@@ -0,0 +1,6 @@
1
+ type UseWindowSizeProps = {
2
+ handler: (ev: Event) => void;
3
+ delay?: number;
4
+ };
5
+ export default function useWindowSize({ handler, delay }: UseWindowSizeProps): void;
6
+ export {};