indicator-ui 1.0.16 → 1.0.18

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.
@@ -3,6 +3,7 @@ import { Form, FormError } from '../classes';
3
3
  type PropsType<T, P extends FormPath<T>> = {
4
4
  path: P;
5
5
  form: Form<T>;
6
+ getFieldSync: (path: P) => FormValue<T, P> | null | undefined;
6
7
  setField: (path: P, value: FormValue<T, P> | null | undefined) => void;
7
8
  formErrors: FormError<T>;
8
9
  highlightField: (path: P) => void;
@@ -1,4 +1,4 @@
1
- import { FocusEvent } from 'react';
1
+ import { FocusEvent, SetStateAction } from 'react';
2
2
  import { Nullable, Undefinable } from '../../../types';
3
3
  import { ExtendFormPath, ExtendFormValue, FormErrorType, FormPath, FormValue } from './formTypes';
4
4
  export type StringFieldValidators = Partial<{
@@ -154,7 +154,8 @@ export type FormSchemeType<T> = Nullable<Undefinable<T>> extends infer Form ? {
154
154
  } : never;
155
155
  export type FieldPropsType<V> = {
156
156
  value?: V | null;
157
- onChange?: (value?: V | null) => void;
157
+ onChange?: (action?: V | null) => void;
158
+ onUpdate?: (action: SetStateAction<V | undefined | null>) => void;
158
159
  error?: FormErrorType;
159
160
  onBlur?: (event?: FocusEvent) => void;
160
161
  };
@@ -8,6 +8,7 @@ export * from './useAsyncState';
8
8
  export * from './useResettableTimeout';
9
9
  export * from './useDebouncedInvoker';
10
10
  export * from './useDidUpdateEffect';
11
+ export * from './useSafeCallback';
11
12
  export * from './useSmartPosition';
12
13
  export * from './useSmartScroll';
13
14
  export * from './useInteractiveZone';
@@ -0,0 +1,9 @@
1
+ type Callback = (...args: any[]) => any;
2
+ type PropsType = [
3
+ callback?: Callback
4
+ ];
5
+ export declare function useSafeCallback(...args: PropsType): {
6
+ getPrevCallback: () => Callback | undefined;
7
+ getCallback: () => Callback | undefined;
8
+ };
9
+ export {};
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "react-components",
12
12
  "ui-kit"
13
13
  ],
14
- "version": "1.0.16",
14
+ "version": "1.0.18",
15
15
  "exports": {
16
16
  ".": {
17
17
  "types": "./dist/types/index.d.ts",