indicator-ui 1.0.15 → 1.0.17

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 {};
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { ToggleBaseSizeType } from '../..';
2
+ import { ToggleBase } from '../..';
3
3
  type AdditionElementPropsType = {
4
4
  isHover?: boolean;
5
5
  active?: boolean;
@@ -35,6 +35,6 @@ export type TogglePropsType = {
35
35
  * */
36
36
  textAfterElement?: AdditionElementType;
37
37
  theme?: "light" | "dark";
38
- size?: ToggleBaseSizeType;
38
+ size?: React.ComponentProps<typeof ToggleBase>['size'];
39
39
  };
40
40
  export {};
@@ -1,2 +1 @@
1
1
  export * from './ui';
2
- export * from './types';
@@ -1,3 +1,16 @@
1
1
  import { default as React } from 'react';
2
- import { ToggleBasePropsType } from '../types';
3
- export declare function ToggleBase(props: ToggleBasePropsType): React.FunctionComponentElement<any>;
2
+ import { AsProps } from '../../../types';
3
+ type PropsType<T extends React.ElementType> = AsProps<T, {
4
+ /**
5
+ * Активирована ли кнопка. (В дизайне pressed)
6
+ * */
7
+ active?: boolean;
8
+ size?: 'medium' | 'large';
9
+ error?: boolean;
10
+ hover?: boolean;
11
+ disabled?: boolean;
12
+ /** @deprecated */
13
+ theme?: "light" | "dark";
14
+ }>;
15
+ export declare function ToggleBase<T extends React.ElementType>(props: PropsType<T>): import("react/jsx-runtime").JSX.Element;
16
+ export {};
@@ -305,6 +305,7 @@ export declare function useFormPaginatedSelectField<D, M extends boolean = false
305
305
  is?: string | undefined | undefined;
306
306
  exportparts?: string | undefined | undefined;
307
307
  part?: string | undefined | undefined;
308
+ onUpdate?: ((action: React.SetStateAction<ValueType<D, M> | null | undefined>) => void) | undefined;
308
309
  error?: import('../../../../hooks').FormErrorType;
309
310
  };
310
311
  };
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "react-components",
12
12
  "ui-kit"
13
13
  ],
14
- "version": "1.0.15",
14
+ "version": "1.0.17",
15
15
  "exports": {
16
16
  ".": {
17
17
  "types": "./dist/types/index.d.ts",
@@ -1,17 +0,0 @@
1
- export type ToggleBaseSizeType = 'medium' | 'large';
2
- export type ToggleBasePropsType = {
3
- /**
4
- * Активирована ли кнопка. (В дизайне pressed)
5
- * */
6
- active?: boolean;
7
- onClick?: () => void;
8
- size?: ToggleBaseSizeType;
9
- error?: boolean;
10
- hover?: boolean;
11
- disabled?: boolean;
12
- /**
13
- * Включает обертку в ```<button>```, иначе обернет в ```<span>```.
14
- * */
15
- isButton?: boolean;
16
- theme?: "light" | "dark";
17
- };
@@ -1 +0,0 @@
1
- export * from './ToggleBaseTypes';