indicator-ui 1.0.36 → 1.0.38

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.
@@ -1,10 +1,12 @@
1
- import { default as React, FormEvent } from 'react';
1
+ import { default as React, FormEvent, Ref } from 'react';
2
2
  import { ExtendFormPath, FieldPropsType, FormErrorsType, FormErrorType } from '..';
3
3
  import { InstanceRefAttributes, Nullable, Undefinable } from '../../types';
4
4
  import { FormPath, FormSchemeType, FormValue, UseFormServices } from './types';
5
+ type FormRef = React.ComponentRef<'form'>;
6
+ type FormInstance = Ref<FormRef> | Array<Ref<FormRef>>;
5
7
  type PropsType<T, Form> = [
6
8
  props?: {
7
- ref?: React.Ref<HTMLFormElement>;
9
+ ref?: FormInstance;
8
10
  initFormData?: T;
9
11
  scheme?: FormSchemeType<T>;
10
12
  onSubmit?: (data: Form, event: FormEvent<HTMLFormElement>, services: UseFormServices<Form, T>) => void | Promise<void>;
@@ -233,7 +235,7 @@ export declare function useForm<Form, T extends Nullable<Undefinable<Form>> = Nu
233
235
  (): FieldPropsType<FormValue<T, "">>;
234
236
  <P extends FormPath<T>>(path: P, config?: FormSchemeType<T>[P]): FieldPropsType<FormValue<T, P>>;
235
237
  };
236
- registerForm: () => Pick<React.ComponentProps<"form">, "onSubmit" | "onReset" | "noValidate" | "ref"> & Pick<InstanceRefAttributes<React.ComponentRef<"form">>, "instanceRef">;
238
+ registerForm: (refsInstance?: FormInstance) => Pick<React.ComponentProps<"form">, "onSubmit" | "onReset" | "noValidate" | "ref"> & Pick<InstanceRefAttributes<React.ComponentRef<"form">>, "instanceRef">;
237
239
  getValidForm: () => Promise<Form | null>;
238
240
  submitForm: () => void;
239
241
  resetForm: () => void;
@@ -1,9 +1,4 @@
1
- import { default as React, ComponentType, ElementType, ForwardedRef, LegacyRef } from 'react';
2
- type RefType<R> = [R] extends [LegacyRef<infer T> | ForwardedRef<infer T> | undefined] ? T : never;
3
- export type PropsOf<C> = C extends ComponentType<infer P> ? P : C extends (...args: infer P) => any ? P : never;
4
- export type ComponentRefType<R> = [
5
- R
6
- ] extends [ComponentType<any>] ? RefType<PropsOf<R>['ref']> : RefType<R>;
1
+ import { default as React, ElementType } from 'react';
7
2
  export type IsAny<T> = 0 extends 1 & T ? true : false;
8
3
  export type IsFile<T> = T extends File ? true : false;
9
4
  export type IsString<T> = T extends string ? true : false;
@@ -29,8 +24,7 @@ export type AsProps<T extends ElementType, P extends Record<string, any> = {}, I
29
24
  as?: T;
30
25
  } & InstanceRefAttributes<IR> & P>;
31
26
  export type InstanceRefAttributes<T> = {
32
- instanceRef?: React.LegacyRef<T>;
27
+ instanceRef?: React.Ref<T>;
33
28
  };
34
29
  export type ComponentPropsWithoutInstanceRef<T extends ElementType> = Omit<React.ComponentProps<T>, keyof InstanceRefAttributes<T>>;
35
30
  export type ComponentInstanceRef<T extends ElementType> = React.ComponentProps<T> extends InstanceRefAttributes<infer Method> ? Method : never;
36
- export {};
@@ -1,4 +1,5 @@
1
- export type PropsType = {
1
+ import { AsProps } from '../../../types';
2
+ export type PropsType = AsProps<'div', {
2
3
  /**
3
4
  * Ссылка на изображение.
4
5
  *
@@ -10,9 +11,6 @@ export type PropsType = {
10
11
  * которому будет равна длинна и высота картинки.
11
12
  * */
12
13
  size?: '20' | '24' | '32' | '40' | '48' | '64' | '72' | '80' | '96' | '120' | '144' | '160' | number;
13
- /** Дополнительные имена стилей */
14
- additionStyles?: string | string[];
15
- className?: string;
16
14
  disabled?: boolean;
17
- };
15
+ }>;
18
16
  export declare function UserPick(props: PropsType): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,7 @@
1
1
  import { default as React } from 'react';
2
- import { ComponentRefType } from '../../../../types';
3
2
  import { FormPaginatedSelectFieldBase } from './FormPaginatedSelectFieldBase';
4
3
  import { FormFieldWrapper } from '../../FormFieldWrapper';
5
- type RefType = ComponentRefType<typeof FormFieldWrapper>;
4
+ type RefType = React.ComponentRef<typeof FormFieldWrapper>;
6
5
  type PropsType<D, M extends boolean> = React.ComponentProps<typeof FormPaginatedSelectFieldBase<D, M>> & React.ComponentProps<typeof FormFieldWrapper>;
7
6
  export declare const FormPaginatedSelectField: <D, M extends boolean = false>(props: PropsType<D, M> & React.RefAttributes<RefType>) => React.ReactElement | null;
8
7
  export {};
@@ -1,8 +1,7 @@
1
1
  import { default as React } from 'react';
2
- import { ComponentRefType } from '../../../../types';
3
2
  import { FormSelectFieldBase } from './FormSelectFieldBase';
4
3
  import { FormFieldWrapper } from '../../FormFieldWrapper';
5
- type RefType = ComponentRefType<typeof FormFieldWrapper>;
4
+ type RefType = React.ComponentRef<typeof FormFieldWrapper>;
6
5
  type PropsType<D, M extends boolean> = React.ComponentProps<typeof FormSelectFieldBase<D, M>> & React.ComponentProps<typeof FormFieldWrapper>;
7
6
  export declare const FormSelectField: <D, M extends boolean = false>(props: PropsType<D, M> & React.RefAttributes<RefType>) => React.ReactElement | null;
8
7
  export {};
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "react-components",
12
12
  "ui-kit"
13
13
  ],
14
- "version": "1.0.36",
14
+ "version": "1.0.38",
15
15
  "exports": {
16
16
  ".": {
17
17
  "types": "./dist/types/index.d.ts",