@grasp-labs/ds-microfrontends-integration 0.23.0 → 0.24.0
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/components/schemaFields/ArrayField.d.ts +5 -5
- package/dist/components/schemaFields/BooleanField.d.ts +5 -5
- package/dist/components/schemaFields/DateField.d.ts +5 -5
- package/dist/components/schemaFields/EnumField.d.ts +5 -5
- package/dist/components/schemaFields/JsonField.d.ts +5 -5
- package/dist/components/schemaFields/NumberField.d.ts +5 -5
- package/dist/components/schemaFields/SchemaFields.d.ts +5 -5
- package/dist/components/schemaFields/TextField.d.ts +5 -5
- package/dist/components/schemaFields/VaultField.d.ts +5 -5
- package/dist/lib/schema/defaults.d.ts +1 -1
- package/dist/lib/schema/descriptor.d.ts +2 -2
- package/dist/lib/schema/schemaResolver/schemaResolver.d.ts +2 -2
- package/dist/lib/schema/types.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Control } from 'react-hook-form';
|
|
1
|
+
import { Control, FieldValues, Path } from 'react-hook-form';
|
|
2
2
|
import { FieldDescriptor } from 'src/lib/schema';
|
|
3
|
-
type ArrayFieldProps = {
|
|
4
|
-
descriptor: FieldDescriptor
|
|
5
|
-
control: Control
|
|
3
|
+
type ArrayFieldProps<T extends FieldValues = FieldValues> = {
|
|
4
|
+
descriptor: FieldDescriptor<Path<T>>;
|
|
5
|
+
control: Control<T>;
|
|
6
6
|
};
|
|
7
|
-
export declare function ArrayField({ descriptor, control }: ArrayFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function ArrayField<T extends FieldValues = FieldValues>({ descriptor, control, }: ArrayFieldProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Control } from 'react-hook-form';
|
|
1
|
+
import { Control, FieldValues, Path } from 'react-hook-form';
|
|
2
2
|
import { FieldDescriptor } from 'src/lib/schema';
|
|
3
|
-
type BooleanFieldProps = {
|
|
4
|
-
descriptor: FieldDescriptor
|
|
5
|
-
control: Control
|
|
3
|
+
type BooleanFieldProps<T extends FieldValues = FieldValues> = {
|
|
4
|
+
descriptor: FieldDescriptor<Path<T>>;
|
|
5
|
+
control: Control<T>;
|
|
6
6
|
};
|
|
7
|
-
export declare function BooleanField({ descriptor, control }: BooleanFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function BooleanField<T extends FieldValues = FieldValues>({ descriptor, control, }: BooleanFieldProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { Control, FieldValues, Path } from 'react-hook-form';
|
|
1
2
|
import { FieldDescriptor } from 'src/lib/schema';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
control: Control;
|
|
3
|
+
type DateFieldProps<T extends FieldValues = FieldValues> = {
|
|
4
|
+
descriptor: FieldDescriptor<Path<T>>;
|
|
5
|
+
control: Control<T>;
|
|
6
6
|
};
|
|
7
|
-
export declare function DateField({ descriptor, control }: DateFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function DateField<T extends FieldValues = FieldValues>({ descriptor, control, }: DateFieldProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Control } from 'react-hook-form';
|
|
1
|
+
import { Control, FieldValues, Path } from 'react-hook-form';
|
|
2
2
|
import { FieldDescriptor } from 'src/lib/schema';
|
|
3
|
-
type EnumFieldProps = {
|
|
4
|
-
descriptor: FieldDescriptor
|
|
5
|
-
control: Control
|
|
3
|
+
type EnumFieldProps<T extends FieldValues = FieldValues> = {
|
|
4
|
+
descriptor: FieldDescriptor<Path<T>>;
|
|
5
|
+
control: Control<T>;
|
|
6
6
|
};
|
|
7
|
-
export declare function EnumField({ descriptor, control }: EnumFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function EnumField<T extends FieldValues = FieldValues>({ descriptor, control, }: EnumFieldProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Control } from 'react-hook-form';
|
|
1
|
+
import { Control, FieldValues, Path } from 'react-hook-form';
|
|
2
2
|
import { FieldDescriptor } from 'src/lib/schema';
|
|
3
|
-
type JsonFieldProps = {
|
|
4
|
-
descriptor: FieldDescriptor
|
|
5
|
-
control: Control
|
|
3
|
+
type JsonFieldProps<T extends FieldValues = FieldValues> = {
|
|
4
|
+
descriptor: FieldDescriptor<Path<T>>;
|
|
5
|
+
control: Control<T>;
|
|
6
6
|
};
|
|
7
|
-
export declare function JsonField({ descriptor, control }: JsonFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function JsonField<T extends FieldValues = FieldValues>({ descriptor, control, }: JsonFieldProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Control } from 'react-hook-form';
|
|
1
|
+
import { Control, FieldValues, Path } from 'react-hook-form';
|
|
2
2
|
import { FieldDescriptor } from 'src/lib/schema';
|
|
3
|
-
type NumberFieldProps = {
|
|
4
|
-
descriptor: FieldDescriptor
|
|
5
|
-
control: Control
|
|
3
|
+
type NumberFieldProps<T extends FieldValues = FieldValues> = {
|
|
4
|
+
descriptor: FieldDescriptor<Path<T>>;
|
|
5
|
+
control: Control<T>;
|
|
6
6
|
};
|
|
7
|
-
export declare function NumberField({ descriptor, control }: NumberFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function NumberField<T extends FieldValues = FieldValues>({ descriptor, control, }: NumberFieldProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Control, FieldErrors } from 'react-hook-form';
|
|
1
|
+
import { Control, FieldErrors, FieldValues } from 'react-hook-form';
|
|
2
2
|
import { Schema } from 'src/types/Schema';
|
|
3
|
-
type SchemaFieldsProps = {
|
|
4
|
-
control: Control
|
|
5
|
-
errors: FieldErrors
|
|
3
|
+
type SchemaFieldsProps<T extends FieldValues = FieldValues> = {
|
|
4
|
+
control: Control<T>;
|
|
5
|
+
errors: FieldErrors<T>;
|
|
6
6
|
schema: Schema | null;
|
|
7
7
|
prefix?: string;
|
|
8
8
|
fieldDirection?: "horizontal" | "vertical";
|
|
9
9
|
};
|
|
10
|
-
export declare function SchemaFields({ control, errors, schema, prefix, fieldDirection, }: SchemaFieldsProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function SchemaFields<T extends FieldValues = FieldValues>({ control, errors, schema, prefix, fieldDirection, }: SchemaFieldsProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Control } from 'react-hook-form';
|
|
1
|
+
import { Control, FieldValues, Path } from 'react-hook-form';
|
|
2
2
|
import { FieldDescriptor } from 'src/lib/schema';
|
|
3
|
-
type TextFieldProps = {
|
|
4
|
-
descriptor: FieldDescriptor
|
|
5
|
-
control: Control
|
|
3
|
+
type TextFieldProps<T extends FieldValues = FieldValues> = {
|
|
4
|
+
descriptor: FieldDescriptor<Path<T>>;
|
|
5
|
+
control: Control<T>;
|
|
6
6
|
};
|
|
7
|
-
export declare function TextField({ descriptor, control }: TextFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function TextField<T extends FieldValues = FieldValues>({ descriptor, control, }: TextFieldProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Control } from 'react-hook-form';
|
|
1
|
+
import { Control, FieldValues, Path } from 'react-hook-form';
|
|
2
2
|
import { FieldDescriptor } from 'src/lib/schema';
|
|
3
|
-
type VaultFieldProps = {
|
|
4
|
-
descriptor: FieldDescriptor
|
|
5
|
-
control: Control
|
|
3
|
+
type VaultFieldProps<T extends FieldValues = FieldValues> = {
|
|
4
|
+
descriptor: FieldDescriptor<Path<T>>;
|
|
5
|
+
control: Control<T>;
|
|
6
6
|
};
|
|
7
|
-
export declare function VaultField({ descriptor, control }: VaultFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function VaultField<T extends FieldValues = FieldValues>({ descriptor, control, }: VaultFieldProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Schema } from 'src/types/Schema';
|
|
2
2
|
export declare function getDefaultValue(fieldSchema: Schema, rootSchema?: Schema, initialValue?: unknown): unknown;
|
|
3
|
-
export declare function buildDefaultValues(schema: Schema | null, rootSchema?: Schema, initialValues?:
|
|
3
|
+
export declare function buildDefaultValues<T extends Record<string, unknown>>(schema: Schema | null, rootSchema?: Schema, initialValues?: T): T | undefined;
|
|
@@ -3,8 +3,8 @@ import { FieldDescriptor } from './types';
|
|
|
3
3
|
/**
|
|
4
4
|
* Create a field descriptor from a schema
|
|
5
5
|
*/
|
|
6
|
-
export declare function createFieldDescriptor(key: string, schema: Schema, prefix?: string, rootSchema?: Schema, requiredFields?: string[]): FieldDescriptor
|
|
6
|
+
export declare function createFieldDescriptor<TFieldName extends string = string>(key: string, schema: Schema, prefix?: string, rootSchema?: Schema, requiredFields?: string[]): FieldDescriptor<TFieldName>;
|
|
7
7
|
/**
|
|
8
8
|
* Parse schema fields into field descriptors
|
|
9
9
|
*/
|
|
10
|
-
export declare function parseSchemaFields(schema: Schema | null, prefix?: string, rootSchema?: Schema): FieldDescriptor[];
|
|
10
|
+
export declare function parseSchemaFields<TFieldName extends string = string>(schema: Schema | null, prefix?: string, rootSchema?: Schema): FieldDescriptor<TFieldName>[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { FieldValues, Resolver } from 'react-hook-form';
|
|
2
|
-
import { z } from 'zod';
|
|
3
2
|
import { CustomErrorHandler } from 'src/types';
|
|
4
|
-
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
export declare const getSchemaResolver: <T extends FieldValues = FieldValues>(schema?: z.core.JSONSchema.JSONSchema, errorHandler?: CustomErrorHandler) => Resolver<T> | undefined;
|
|
@@ -15,9 +15,9 @@ export type Constraints = {
|
|
|
15
15
|
maxDate?: Date;
|
|
16
16
|
locale?: unknown;
|
|
17
17
|
};
|
|
18
|
-
export type FieldDescriptor = {
|
|
18
|
+
export type FieldDescriptor<TFieldName extends string = string> = {
|
|
19
19
|
key: string;
|
|
20
|
-
fieldName:
|
|
20
|
+
fieldName: TFieldName;
|
|
21
21
|
schema: Schema;
|
|
22
22
|
type: FieldType;
|
|
23
23
|
label: string;
|