indicator-ui 1.0.35 → 1.0.37
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.
- package/dist/index.cjs +14 -14
- package/dist/index.js +4776 -4766
- package/dist/types/src/hooks/forms/lib/index.d.ts +1 -0
- package/dist/types/src/hooks/forms/lib/mergeRefs.d.ts +2 -0
- package/dist/types/src/hooks/forms/useForm.d.ts +5 -2
- package/dist/types/src/types/mixins.d.ts +2 -8
- package/dist/types/src/ui/formFields/FormPaginatedSelectField/ui/FormPaginatedSelectField.d.ts +1 -2
- package/dist/types/src/ui/formFields/FormSelectField/ui/FormSelectField.d.ts +1 -2
- package/package.json +1 -1
|
@@ -1,9 +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?: {
|
|
9
|
+
ref?: FormInstance;
|
|
7
10
|
initFormData?: T;
|
|
8
11
|
scheme?: FormSchemeType<T>;
|
|
9
12
|
onSubmit?: (data: Form, event: FormEvent<HTMLFormElement>, services: UseFormServices<Form, T>) => void | Promise<void>;
|
|
@@ -232,7 +235,7 @@ export declare function useForm<Form, T extends Nullable<Undefinable<Form>> = Nu
|
|
|
232
235
|
(): FieldPropsType<FormValue<T, "">>;
|
|
233
236
|
<P extends FormPath<T>>(path: P, config?: FormSchemeType<T>[P]): FieldPropsType<FormValue<T, P>>;
|
|
234
237
|
};
|
|
235
|
-
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">;
|
|
236
239
|
getValidForm: () => Promise<Form | null>;
|
|
237
240
|
submitForm: () => void;
|
|
238
241
|
resetForm: () => void;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import { default as 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.
|
|
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 {};
|
package/dist/types/src/ui/formFields/FormPaginatedSelectField/ui/FormPaginatedSelectField.d.ts
CHANGED
|
@@ -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 =
|
|
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 =
|
|
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 {};
|