indicator-ui 1.0.43 → 1.0.44

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.
@@ -8,5 +8,5 @@ type PropsType<T, P extends FormPath<T>> = {
8
8
  formErrors: FormError<T>;
9
9
  highlightField: (path: P) => void;
10
10
  };
11
- export declare function getFieldPropsType<T, P extends FormPath<T>>(props: PropsType<T, P>): FieldPropsType<FormValue<T, P>>;
11
+ export declare function getFieldPropsType<T, P extends FormPath<T>>(props: PropsType<T, P>): FieldPropsType<FormValue<T, P>, 'update'>;
12
12
  export {};
@@ -152,10 +152,11 @@ export type FieldConfigType<T, F> = DefaultValueConfig<T, F> & BaseFieldValidato
152
152
  export type FormSchemeType<T> = Nullable<Undefinable<T>> extends infer Form ? {
153
153
  [K in ExtendFormPath<Form>]?: FieldConfigType<Form, ExtendFormValue<Form, K>>;
154
154
  } : never;
155
- export type FieldPropsType<V> = {
156
- value?: V | null;
157
- onChange?: (action?: V | null) => void;
158
- onUpdate?: (action: SetStateAction<V | undefined | null>) => void;
155
+ export type FieldChangeMode = 'change' | 'update';
156
+ export type FieldOnChange<V, M extends FieldChangeMode> = M extends 'change' ? (action?: V | null) => void : (action: SetStateAction<V | undefined | null>) => void;
157
+ export type FieldPropsType<V, M extends FieldChangeMode = 'change'> = {
158
+ value?: V | undefined | null;
159
+ onChange?: FieldOnChange<V, M>;
159
160
  error?: FormErrorType;
160
161
  onBlur?: (event?: FocusEvent) => void;
161
162
  };
@@ -233,8 +233,8 @@ export declare function useForm<Form, T extends Nullable<Undefinable<Form>> = Nu
233
233
  clearErrors: () => void;
234
234
  clearField: (_path: FormPath<T> | FormPath<T>[]) => void;
235
235
  register: {
236
- (): FieldPropsType<FormValue<T, "">>;
237
- <P extends FormPath<T>>(path: P, config?: FormSchemeType<T>[P]): FieldPropsType<FormValue<T, P>>;
236
+ (): FieldPropsType<FormValue<T, "">, "update">;
237
+ <P extends FormPath<T>>(path: P, config?: FormSchemeType<T>[P]): FieldPropsType<FormValue<T, P>, "update">;
238
238
  };
239
239
  registerForm: (refsInstance?: FormInstance) => Pick<React.ComponentProps<"form">, "onSubmit" | "onReset" | "noValidate" | "ref"> & Pick<InstanceRefAttributes<React.ComponentRef<"form">>, "instanceRef">;
240
240
  getValidForm: () => Promise<Form | null>;
@@ -5,7 +5,7 @@ import { useSearching } from './useSearching';
5
5
  import { useOptionsManagement } from './useOptionsManagement';
6
6
  import { useValueBuffer } from './useValueBuffer';
7
7
  import { useWrapperServices } from './useWrapperServices';
8
- type PropsType<D, M extends boolean> = Pick<ReturnType<typeof useModalServices>, 'isShow'> & Pick<ReturnType<typeof useSearching<D, M>>, 'searchString' | 'canSearch'> & Pick<ReturnType<typeof useOptionsManagement<D, M>>, 'options'> & Pick<ReturnType<typeof useWrapperServices>, 'blurWrapper'> & Pick<ReturnType<typeof useValueBuffer<D, M>>, 'bufValueOptions'> & Pick<FieldPropsType<ValueType<D, M>>, 'value' | 'onChange' | 'onUpdate'> & {
8
+ type PropsType<D, M extends boolean> = Pick<ReturnType<typeof useModalServices>, 'isShow'> & Pick<ReturnType<typeof useSearching<D, M>>, 'searchString' | 'canSearch'> & Pick<ReturnType<typeof useOptionsManagement<D, M>>, 'options'> & Pick<ReturnType<typeof useWrapperServices>, 'blurWrapper'> & Pick<ReturnType<typeof useValueBuffer<D, M>>, 'bufValueOptions'> & Pick<FieldPropsType<ValueType<D, M>>, 'value' | 'onChange'> & {
9
9
  maxCount?: number;
10
10
  multiple: M;
11
11
  };
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "react-components",
12
12
  "ui-kit"
13
13
  ],
14
- "version": "1.0.43",
14
+ "version": "1.0.44",
15
15
  "exports": {
16
16
  ".": {
17
17
  "types": "./dist/types/index.d.ts",