@overmap-ai/forms 1.0.36 → 1.0.37-condition-serialize-improvements.1
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.
|
@@ -2,3 +2,6 @@ import { Condition, SerializedCondition } from './typings';
|
|
|
2
2
|
import { Field } from '../fields';
|
|
3
3
|
export declare const deserializeCondition: (field: Field, serializedCondition: SerializedCondition) => Condition;
|
|
4
4
|
export declare const deserializeConditions: (fields: Field[], serializedConditions: SerializedCondition[]) => Condition[];
|
|
5
|
+
export declare const serializeConditions: (fields: Field[], conditions: Condition[]) => SerializedCondition[];
|
|
6
|
+
export declare const cleanSerializedConditions: (fields: Field[], serializedConditions: SerializedCondition[]) => SerializedCondition[];
|
|
7
|
+
export declare const cleanConditions: (fields: Field[], conditions: Condition[]) => Condition[];
|
|
@@ -9,6 +9,7 @@ export interface BaseSerializedFormElement<TType extends string> {
|
|
|
9
9
|
export interface FieldRenderProps {
|
|
10
10
|
formId: string;
|
|
11
11
|
size: FieldsRendererSize;
|
|
12
|
+
index: number;
|
|
12
13
|
disabled?: boolean;
|
|
13
14
|
onValuesChange?: (identifier: string, value: any) => void;
|
|
14
15
|
showInputOnly?: boolean;
|
|
@@ -2,7 +2,7 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { AnyField, AnyFormElement, ValueOfField } from './typings';
|
|
3
3
|
import { FieldRenderProps } from './BaseFormElement';
|
|
4
4
|
export declare const useFieldInput: <TField extends AnyFormElement>(field: TField, props: FieldRenderProps) => ReactNode;
|
|
5
|
-
export declare const useFieldInputs: (fields: AnyFormElement[], props: FieldRenderProps) => ReactNode;
|
|
5
|
+
export declare const useFieldInputs: (fields: AnyFormElement[], props: Omit<FieldRenderProps, "index">) => ReactNode;
|
|
6
6
|
export declare const useFormikInput: <TField extends AnyField>(props: FieldRenderProps & {
|
|
7
7
|
field: TField;
|
|
8
8
|
}) => readonly [{
|
|
@@ -27,5 +27,6 @@ export declare const useFormikInput: <TField extends AnyField>(props: FieldRende
|
|
|
27
27
|
}, {
|
|
28
28
|
readonly "aria-labelledby": string;
|
|
29
29
|
readonly formId: string;
|
|
30
|
+
readonly index: number;
|
|
30
31
|
readonly disabled?: boolean;
|
|
31
32
|
}];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DirectedGraph } from 'graphology';
|
|
2
2
|
import { FieldFilesAndPromises, FieldValues, SerializedFieldValues } from '../typings';
|
|
3
3
|
import { ReseedOptions } from '../builder/list/sectionSerialization';
|
|
4
|
-
import { SerializedCondition } from '../conditions';
|
|
4
|
+
import { Condition, SerializedCondition } from '../conditions';
|
|
5
5
|
import { Field, FieldSection, FieldSectionManager, SerializedFieldSection } from '../fields';
|
|
6
6
|
import { Observable } from '../Observable';
|
|
7
7
|
export declare class FieldSchema extends Observable<FieldSchema> implements FieldSectionManager {
|
|
@@ -25,7 +25,10 @@ export declare class FieldSchema extends Observable<FieldSchema> implements Fiel
|
|
|
25
25
|
serializeValues(values: FieldValues, clean?: boolean): SerializedFieldValues;
|
|
26
26
|
initializeValues(values: FieldValues): FieldValues;
|
|
27
27
|
validateValues(values: FieldValues): import('formik').FormikErrors<FieldValues> | undefined;
|
|
28
|
-
deserializeConditions(
|
|
28
|
+
deserializeConditions(serializedConditions: SerializedCondition[]): Condition[];
|
|
29
|
+
cleanConditions(conditions: Condition[]): Condition[];
|
|
30
|
+
serializeConditions(conditions: Condition[]): SerializedCondition[];
|
|
31
|
+
cleanSerializedConditions(serializedConditions: SerializedCondition[]): SerializedCondition[];
|
|
29
32
|
changedFieldValues(values1: FieldValues, values2: FieldValues): FieldValues;
|
|
30
33
|
unchangedFieldValues(values1: FieldValues, values2: FieldValues): FieldValues;
|
|
31
34
|
areValuesEqual(values1: FieldValues, values2: FieldValues): boolean;
|